beads-ui 0.5.0 → 0.7.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/CHANGES.md +42 -0
- package/README.md +4 -2
- package/app/main.bundle.js +232 -203
- package/app/main.bundle.js.map +3 -3
- package/app/protocol.js +5 -2
- package/app/styles.css +64 -0
- package/package.json +1 -1
- package/server/bd.js +32 -0
- package/server/cli/commands.js +14 -4
- package/server/cli/daemon.js +11 -2
- package/server/cli/index.js +29 -11
- package/server/cli/usage.js +5 -3
- package/server/config.js +2 -1
- package/server/index.js +10 -0
- package/server/ws.js +73 -1
package/app/main.bundle.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
var
|
|
2
|
-
\f\r]`,
|
|
3
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),dn=/'/g,un=/"/g,gn=/^(?:script|style|textarea|title)$/i,vr=r=>(e,...t)=>({_$litType$:r,strings:e,values:t}),L=vr(1),io=vr(2),oo=vr(3),rt=Symbol.for("lit-noChange"),oe=Symbol.for("lit-nothing"),pn=new WeakMap,et=tt.createTreeWalker(tt,129);function mn(r,e){if(!xr(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return an!==void 0?an.createHTML(e):e}var Ps=(r,e)=>{let t=r.length-1,s=[],n,i=e===2?"<svg>":e===3?"<math>":"",a=_t;for(let l=0;l<t;l++){let o=r[l],p,d,u=-1,f=0;for(;f<o.length&&(a.lastIndex=f,d=a.exec(o),d!==null);)f=a.lastIndex,a===_t?d[1]==="!--"?a=ln:d[1]!==void 0?a=cn:d[2]!==void 0?(gn.test(d[2])&&(n=RegExp("</"+d[2],"g")),a=Je):d[3]!==void 0&&(a=Je):a===Je?d[0]===">"?(a=n??_t,u=-1):d[1]===void 0?u=-2:(u=a.lastIndex-d[2].length,p=d[1],a=d[3]===void 0?Je:d[3]==='"'?un:dn):a===un||a===dn?a=Je:a===ln||a===cn?a=_t:(a=Je,n=void 0);let m=a===Je&&r[l+1].startsWith("/>")?" ":"";i+=a===_t?o+Ms:u>=0?(s.push(p),o.slice(0,u)+fn+o.slice(u)+Ge+m):o+Ge+(u===-2?l:m)}return[mn(r,i+(r[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),s]},St=class r{constructor({strings:e,_$litType$:t},s){let n;this.parts=[];let i=0,a=0,l=e.length-1,o=this.parts,[p,d]=Ps(e,t);if(this.el=r.createElement(p,s),et.currentNode=this.el.content,t===2||t===3){let u=this.el.content.firstChild;u.replaceWith(...u.childNodes)}for(;(n=et.nextNode())!==null&&o.length<l;){if(n.nodeType===1){if(n.hasAttributes())for(let u of n.getAttributeNames())if(u.endsWith(fn)){let f=d[a++],m=n.getAttribute(u).split(Ge),v=/([.?@])?(.*)/.exec(f);o.push({type:1,index:i,name:v[2],strings:m,ctor:v[1]==="."?yr:v[1]==="?"?wr:v[1]==="@"?kr:ft}),n.removeAttribute(u)}else u.startsWith(Ge)&&(o.push({type:6,index:i}),n.removeAttribute(u));if(gn.test(n.tagName)){let u=n.textContent.split(Ge),f=u.length-1;if(f>0){n.textContent=Wt?Wt.emptyScript:"";for(let m=0;m<f;m++)n.append(u[m],vt()),et.nextNode(),o.push({type:2,index:++i});n.append(u[f],vt())}}}else if(n.nodeType===8)if(n.data===hn)o.push({type:2,index:i});else{let u=-1;for(;(u=n.data.indexOf(Ge,u+1))!==-1;)o.push({type:7,index:i}),u+=Ge.length-1}i++}}static createElement(e,t){let s=tt.createElement("template");return s.innerHTML=e,s}};function pt(r,e,t=r,s){if(e===rt)return e;let n=s!==void 0?t._$Co?.[s]:t._$Cl,i=At(e)?void 0:e._$litDirective$;return n?.constructor!==i&&(n?._$AO?.(!1),i===void 0?n=void 0:(n=new i(r),n._$AT(r,t,s)),s!==void 0?(t._$Co??(t._$Co=[]))[s]=n:t._$Cl=n),n!==void 0&&(e=pt(r,n._$AS(r,e.values),n,s)),e}var br=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){let{el:{content:t},parts:s}=this._$AD,n=(e?.creationScope??tt).importNode(t,!0);et.currentNode=n;let i=et.nextNode(),a=0,l=0,o=s[0];for(;o!==void 0;){if(a===o.index){let p;o.type===2?p=new Tt(i,i.nextSibling,this,e):o.type===1?p=new o.ctor(i,o.name,o.strings,this,e):o.type===6&&(p=new _r(i,this,e)),this._$AV.push(p),o=s[++l]}a!==o?.index&&(i=et.nextNode(),a++)}return et.currentNode=tt,n}p(e){let t=0;for(let 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++}},Tt=class r{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,s,n){this.type=2,this._$AH=oe,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=s,this.options=n,this._$Cv=n?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,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=pt(this,e,t),At(e)?e===oe||e==null||e===""?(this._$AH!==oe&&this._$AR(),this._$AH=oe):e!==this._$AH&&e!==rt&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Os(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!==oe&&At(this._$AH)?this._$AA.nextSibling.data=e:this.T(tt.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:s}=e,n=typeof s=="number"?this._$AC(e):(s.el===void 0&&(s.el=St.createElement(mn(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===n)this._$AH.p(t);else{let i=new br(n,this),a=i.u(this.options);i.p(t),this.T(a),this._$AH=i}}_$AC(e){let t=pn.get(e.strings);return t===void 0&&pn.set(e.strings,t=new St(e)),t}k(e){xr(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,s,n=0;for(let i of e)n===t.length?t.push(s=new r(this.O(vt()),this.O(vt()),this,this.options)):s=t[n],s._$AI(i),n++;n<t.length&&(this._$AR(s&&s._$AB.nextSibling,n),t.length=n)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let s=e.nextSibling;e.remove(),e=s}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},ft=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,s,n,i){this.type=1,this._$AH=oe,this._$AN=void 0,this.element=e,this.name=t,this._$AM=n,this.options=i,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=oe}_$AI(e,t=this,s,n){let i=this.strings,a=!1;if(i===void 0)e=pt(this,e,t,0),a=!At(e)||e!==this._$AH&&e!==rt,a&&(this._$AH=e);else{let l=e,o,p;for(e=i[0],o=0;o<i.length-1;o++)p=pt(this,l[s+o],t,o),p===rt&&(p=this._$AH[o]),a||(a=!At(p)||p!==this._$AH[o]),p===oe?e=oe:e!==oe&&(e+=(p??"")+i[o+1]),this._$AH[o]=p}a&&!n&&this.j(e)}j(e){e===oe?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},yr=class extends ft{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===oe?void 0:e}},wr=class extends ft{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==oe)}},kr=class extends ft{constructor(e,t,s,n,i){super(e,t,s,n,i),this.type=5}_$AI(e,t=this){if((e=pt(this,e,t,0)??oe)===rt)return;let s=this._$AH,n=e===oe&&s!==oe||e.capture!==s.capture||e.once!==s.once||e.passive!==s.passive,i=e!==oe&&(s===oe||n);n&&this.element.removeEventListener(this.name,this,s),i&&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)}},_r=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){pt(this,e)}};var Fs=xt.litHtmlPolyfillSupport;Fs?.(St,Tt),(xt.litHtmlVersions??(xt.litHtmlVersions=[])).push("3.3.1");var Ae=(r,e,t)=>{let s=t?.renderBefore??e,n=s._$litPart$;if(n===void 0){let i=t?.renderBefore??null;s._$litPart$=n=new Tt(e.insertBefore(vt(),i),i,void 0,t??{})}return n._$AI(r),n};function Ie(r,e){let t=r.priority??2,s=e.priority??2;if(t!==s)return t-s;let n=r.created_at??0,i=e.created_at??0;if(n!==i)return n<i?-1:1;let a=r.id,l=e.id;return a<l?-1:a>l?1:0}function ht(r,e){let t=r.closed_at??0,s=e.closed_at??0;if(t!==s)return t<s?1:-1;let n=r?.id,i=e?.id;return n<i?-1:n>i?1:0}function We(r=void 0){function e(i){return!r||typeof r.snapshotFor!="function"?[]:r.snapshotFor(i).slice().sort(Ie)}function t(i,a){let l=r&&r.snapshotFor?r.snapshotFor(i).slice():[];return a==="in_progress"?l.sort(Ie):a==="closed"?l.sort(ht):l.sort(Ie),l}function s(i){if(!r||typeof r.snapshotFor!="function")return[];let l=(r.snapshotFor(`detail:${i}`)||[]).find(p=>String(p?.id||"")===String(i));return(Array.isArray(l?.dependents)?l.dependents:[]).slice().sort(Ie)}function n(i){return r&&typeof r.subscribe=="function"?r.subscribe(i):()=>{}}return{selectIssuesFor:e,selectBoardColumn:t,selectEpicChildren:s,subscribe:n}}var xn=Ns(_n(),1);function se(r){return(0,xn.default)(`beads-ui:${r}`)}function vn(r){let e=se("data");async function t(s){let{id:n}=s;e("updateIssue %s %o",n,Object.keys(s));let i=null;return typeof s.title=="string"&&(i=await r("edit-text",{id:n,field:"title",value:s.title})),typeof s.acceptance=="string"&&(i=await r("edit-text",{id:n,field:"acceptance",value:s.acceptance})),typeof s.notes=="string"&&(i=await r("edit-text",{id:n,field:"notes",value:s.notes})),typeof s.design=="string"&&(i=await r("edit-text",{id:n,field:"design",value:s.design})),typeof s.status=="string"&&(i=await r("update-status",{id:n,status:s.status})),typeof s.priority=="number"&&(i=await r("update-priority",{id:n,priority:s.priority})),typeof s.assignee=="string"&&(i=await r("update-assignee",{id:n,assignee:s.assignee})),e("updateIssue done %s",n),i}return{updateIssue:t}}function Ar(r,e={}){let t=se(`issue-store:${r}`),s=new Map,n=[],i=0,a=new Set,l=!1,o=e.sort||Ie;function p(){for(let f of Array.from(a))try{f()}catch{}}function d(){n=Array.from(s.values()).sort(o)}function u(f){if(l||!f||f.id!==r)return;let m=Number(f.revision)||0;if(t("apply %s rev=%d",f.type,m),!(m<=i&&f.type!=="snapshot")){if(f.type==="snapshot"){if(m<=i)return;s.clear();let v=Array.isArray(f.issues)?f.issues:[];for(let k of v)k&&typeof k.id=="string"&&k.id.length>0&&s.set(k.id,k);d(),i=m,p();return}if(f.type==="upsert"){let v=f.issue;if(v&&typeof v.id=="string"&&v.id.length>0){let k=s.get(v.id);if(!k)s.set(v.id,v);else{let I=Number.isFinite(k.updated_at)?k.updated_at:0,S=Number.isFinite(v.updated_at)?v.updated_at:0;if(I<=S){for(let P of Object.keys(k))P in v||delete k[P];for(let[P,$]of Object.entries(v))k[P]=$}}d()}i=m,p()}else if(f.type==="delete"){let v=String(f.issue_id||"");v&&(s.delete(v),d()),i=m,p()}}}return{id:r,subscribe(f){return a.add(f),()=>{a.delete(f)}},applyPush:u,snapshot(){return n},size(){return s.size},getById(f){return s.get(f)},dispose(){l=!0,s.clear(),n=[],a.clear(),i=0}}}function Yt(r){let e=String(r.type||"").trim(),t={};if(r.params&&typeof r.params=="object"){let n=Object.keys(r.params).sort();for(let i of n){let a=r.params[i];t[i]=String(a)}}let s=new URLSearchParams(t).toString();return s.length>0?`${e}?${s}`:e}function An(r){let e=se("subs"),t=new Map,s=new Map;function n(l,o){e("applyDelta %s +%d ~%d -%d",l,(o.added||[]).length,(o.updated||[]).length,(o.removed||[]).length);let p=s.get(l);if(!p||p.size===0)return;let d=Array.isArray(o.added)?o.added:[],u=Array.isArray(o.updated)?o.updated:[],f=Array.isArray(o.removed)?o.removed:[];for(let m of Array.from(p)){let v=t.get(m);if(!v)continue;let k=v.itemsById;for(let I of d)typeof I=="string"&&I.length>0&&k.set(I,!0);for(let I of u)typeof I=="string"&&I.length>0&&k.set(I,!0);for(let I of f)typeof I=="string"&&I.length>0&&k.delete(I)}}async function i(l,o){let p=Yt(o);if(e("subscribe %s key=%s",l,p),!t.has(l))t.set(l,{key:p,itemsById:new Map});else{let u=t.get(l);if(u&&u.key!==p){let f=s.get(u.key);f&&(f.delete(l),f.size===0&&s.delete(u.key)),t.set(l,{key:p,itemsById:new Map})}}s.has(p)||s.set(p,new Set);let d=s.get(p);d&&d.add(l);try{await r("subscribe-list",{id:l,type:o.type,params:o.params})}catch(u){let f=t.get(l)||null;if(f){let m=s.get(f.key);m&&(m.delete(l),m.size===0&&s.delete(f.key))}throw t.delete(l),u}return async()=>{e("unsubscribe %s key=%s",l,p);try{await r("unsubscribe-list",{id:l})}catch{}let u=t.get(l)||null;if(u){let f=s.get(u.key);f&&(f.delete(l),f.size===0&&s.delete(u.key))}t.delete(l)}}return{subscribeList:i,_applyDelta:n,_subKeyOf:Yt,selectors:{getIds(l){let o=t.get(l);return o?Array.from(o.itemsById.keys()):[]},has(l,o){let p=t.get(l);return p?p.itemsById.has(o):!1},count(l){let o=t.get(l);return o?o.itemsById.size:0},getItemsById(l){let o=t.get(l),p={};if(!o)return p;for(let d of o.itemsById.keys())p[d]=!0;return p}}}}function Sn(){let r=se("issue-stores"),e=new Map,t=new Map,s=new Set,n=new Map;function i(){for(let o of Array.from(s))try{o()}catch{}}function a(o,p,d){let u=p?Yt(p):"",f=t.get(o)||"",m=e.has(o);if(r("register %s key=%s (prev=%s)",o,u,f),m&&f&&u&&f!==u){let v=e.get(o);if(v)try{v.dispose()}catch{}let k=n.get(o);if(k){try{k()}catch{}n.delete(o)}let I=Ar(o,d);e.set(o,I);let S=I.subscribe(()=>i());n.set(o,S)}else if(!m){let v=Ar(o,d);e.set(o,v);let k=v.subscribe(()=>i());n.set(o,k)}return t.set(o,u),()=>l(o)}function l(o){r("unregister %s",o),t.delete(o);let p=e.get(o);p&&(p.dispose(),e.delete(o));let d=n.get(o);if(d){try{d()}catch{}n.delete(o)}}return{register:a,unregister:l,getStore(o){return e.get(o)||null},snapshotFor(o){let p=e.get(o);return p?p.snapshot().slice():[]},subscribe(o){return s.add(o),()=>s.delete(o)}}}function Ze(r,e){return`#/${r==="epics"||r==="board"?r:"issues"}?issue=${encodeURIComponent(e)}`}function Vt(r){let e=String(r||""),t=e.startsWith("#")?e.slice(1):e,s=t.indexOf("?"),n=s>=0?t.slice(s+1):"";if(n){let l=new URLSearchParams(n).get("issue");if(l)return decodeURIComponent(l)}let i=/^\/issue\/([^\s?#]+)/.exec(t);return i&&i[1]?decodeURIComponent(i[1]):null}function Sr(r){let e=String(r||"");return/^#\/epics(\b|\/|$)/.test(e)?"epics":/^#\/board(\b|\/|$)/.test(e)?"board":"issues"}function Tn(r){let e=se("router"),t=()=>{let s=window.location.hash||"",n=/^#\/issue\/([^\s?#]+)/.exec(s);if(n&&n[1]){let l=decodeURIComponent(n[1]);r.setState({selected_id:l,view:"issues"});let o=`#/issues?issue=${encodeURIComponent(l)}`;if(window.location.hash!==o){window.location.hash=o;return}}let i=Vt(s),a=Sr(s);e("hash change \u2192 view=%s id=%s",a,i),r.setState({selected_id:i,view:a})};return{start(){window.addEventListener("hashchange",t),t()},stop(){window.removeEventListener("hashchange",t)},gotoIssue(s){let i=(r.getState?r.getState():{view:"issues"}).view||"issues",a=Ze(i,s);e("goto issue %s (view=%s)",s,i),window.location.hash!==a?window.location.hash=a:r.setState({selected_id:s,view:i})},gotoView(s){let i=(r.getState?r.getState():{selected_id:null}).selected_id,a=i?Ze(s,i):`#/${s}`;e("goto view %s (id=%s)",s,i||""),window.location.hash!==a?window.location.hash=a:r.setState({view:s,selected_id:null})}}}function En(r={}){let e=se("state"),t={selected_id:r.selected_id??null,view:r.view??"issues",filters:{status:r.filters?.status??"all",search:r.filters?.search??"",type:typeof r.filters?.type=="string"?r.filters?.type:""},board:{closed_filter:r.board?.closed_filter==="3"||r.board?.closed_filter==="7"||r.board?.closed_filter==="today"?r.board?.closed_filter:"today"}},s=new Set;function n(){for(let i of Array.from(s))try{i(t)}catch{}}return{getState(){return t},setState(i){let a={...t,...i,filters:{...t.filters,...i.filters||{}},board:{...t.board,...i.board||{}}};a.selected_id===t.selected_id&&a.view===t.view&&a.filters.status===t.filters.status&&a.filters.search===t.filters.search&&a.filters.type===t.filters.type&&a.board.closed_filter===t.board.closed_filter||(t=a,e("state change %o",{selected_id:t.selected_id,view:t.view,filters:t.filters,board:t.board}),n())},subscribe(i){return s.add(i),()=>s.delete(i)}}}function $n(r){let e=0;function t(){if(!r)return;let a=e>0;r.toggleAttribute("hidden",!a),r.setAttribute("aria-busy",a?"true":"false")}function s(){e+=1,t()}function n(){e=Math.max(0,e-1),t()}function i(a){return async(l,o)=>{s();try{return await a(l,o)}finally{n()}}}return t(),{wrapSend:i,start:s,done:n,getCount:()=>e}}function be(r,e="info",t=2800){let s=document.createElement("div");s.className="toast",s.textContent=r,s.style.position="fixed",s.style.right="12px",s.style.bottom="12px",s.style.zIndex="1000",s.style.color="#fff",s.style.padding="8px 10px",s.style.borderRadius="4px",s.style.fontSize="12px",e==="success"?s.style.background="#156d36":e==="error"?s.style.background="#9f2011":s.style.background="rgba(0,0,0,0.85)",(document.body||document.documentElement).appendChild(s),setTimeout(()=>{try{s.remove()}catch{}},t)}function Ke(r,e){let t=typeof e?.duration_ms=="number"?e.duration_ms:1200,s=document.createElement("button");s.className=(e?.class_name?e.class_name+" ":"")+"mono id-copy",s.type="button",s.setAttribute("aria-live","polite"),s.setAttribute("title","Copy issue ID"),s.setAttribute("aria-label",`Copy issue ID ${r}`),s.textContent=r;async function n(){try{navigator.clipboard&&typeof navigator.clipboard.writeText=="function"&&await navigator.clipboard.writeText(String(r)),s.textContent="Copied";let i=s.getAttribute("aria-label")||"";s.setAttribute("aria-label","Copied"),setTimeout(()=>{s.textContent=r,s.setAttribute("aria-label",i)},Math.max(80,t))}catch{}}return s.addEventListener("click",i=>{i.preventDefault(),i.stopPropagation(),n()}),s.addEventListener("keydown",i=>{(i.key==="Enter"||i.key===" ")&&(i.preventDefault(),i.stopPropagation(),n())}),s}var Ye=["Critical","High","Medium","Low","Backlog"];function Cn(r){let e=typeof r=="number"?r:2,t=document.createElement("span");t.className="priority-badge",t.classList.add(`is-p${Math.max(0,Math.min(4,e))}`),t.setAttribute("role","img");let s=Xs(e);return t.setAttribute("title",s),t.setAttribute("aria-label",`Priority: ${s}`),t.textContent=Et(e)+" "+s,t}function Xs(r){let e=Math.max(0,Math.min(4,r));return Ye[e]||"Medium"}function Et(r){switch(r){case 0:return"\u{1F525}";case 1:return"\u26A1\uFE0F";case 2:return"\u{1F527}";case 3:return"\u{1FAB6}";case 4:return"\u{1F4A4}";default:return"\u{1F527}"}}function st(r){let e=document.createElement("span");e.className="type-badge";let t=(r||"").toString().toLowerCase(),s=new Set(["bug","feature","task","epic","chore"]),n=s.has(t)?t:"neutral";e.classList.add(`type-badge--${n}`),e.setAttribute("role","img");let i=s.has(t)?t==="bug"?"Bug":t==="feature"?"Feature":t==="task"?"Task":t==="epic"?"Epic":"Chore":"\u2014";return e.setAttribute("aria-label",s.has(t)?`Issue type: ${i}`:"Issue type: unknown"),e.setAttribute("title",s.has(t)?`Type: ${i}`:"Type: unknown"),e.textContent=i,e}function Rn(r,e,t,s,n=void 0,i=void 0){let a=se("views:board"),l=[],o=[],p=[],d=[],u=[],f=i?We(i):null,m="today";if(s)try{let _=s.getState(),b=_&&_.board?String(_.board.closed_filter||"today"):"today";(b==="today"||b==="3"||b==="7")&&(m=b)}catch{}function v(){return L`
|
|
1
|
+
var $s=Object.create;var br=Object.defineProperty;var Es=Object.getOwnPropertyDescriptor;var Cs=Object.getOwnPropertyNames;var Rs=Object.getPrototypeOf,Is=Object.prototype.hasOwnProperty;var Ls=(r,e,t)=>e in r?br(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var yr=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports);var Ds=(r,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Cs(e))!Is.call(r,n)&&n!==t&&br(r,n,{get:()=>e[n],enumerable:!(s=Es(e,n))||s.enumerable});return r};var Ns=(r,e,t)=>(t=r!=null?$s(Rs(r)):{},Ds(e||!r||!r.__esModule?br(t,"default",{value:r,enumerable:!0}):t,r));var J=(r,e,t)=>Ls(r,typeof e!="symbol"?e+"":e,t);var xn=yr((fo,_n)=>{var _t=1e3,xt=_t*60,vt=xt*60,ct=vt*24,zs=ct*7,Bs=ct*365.25;_n.exports=function(r,e){e=e||{};var t=typeof r;if(t==="string"&&r.length>0)return Hs(r);if(t==="number"&&isFinite(r))return e.long?qs(r):Us(r);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(r))};function Hs(r){if(r=String(r),!(r.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(r);if(e){var t=parseFloat(e[1]),s=(e[2]||"ms").toLowerCase();switch(s){case"years":case"year":case"yrs":case"yr":case"y":return t*Bs;case"weeks":case"week":case"w":return t*zs;case"days":case"day":case"d":return t*ct;case"hours":case"hour":case"hrs":case"hr":case"h":return t*vt;case"minutes":case"minute":case"mins":case"min":case"m":return t*xt;case"seconds":case"second":case"secs":case"sec":case"s":return t*_t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t;default:return}}}}function Us(r){var e=Math.abs(r);return e>=ct?Math.round(r/ct)+"d":e>=vt?Math.round(r/vt)+"h":e>=xt?Math.round(r/xt)+"m":e>=_t?Math.round(r/_t)+"s":r+"ms"}function qs(r){var e=Math.abs(r);return e>=ct?Zt(r,e,ct,"day"):e>=vt?Zt(r,e,vt,"hour"):e>=xt?Zt(r,e,xt,"minute"):e>=_t?Zt(r,e,_t,"second"):r+" ms"}function Zt(r,e,t,s){var n=e>=t*1.5;return Math.round(r/t)+" "+s+(n?"s":"")}});var An=yr((ho,vn)=>{function js(r){t.debug=t,t.default=t,t.coerce=a,t.disable=o,t.enable=n,t.enabled=l,t.humanize=xn(),t.destroy=p,Object.keys(r).forEach(d=>{t[d]=r[d]}),t.names=[],t.skips=[],t.formatters={};function e(d){let u=0;for(let h=0;h<d.length;h++)u=(u<<5)-u+d.charCodeAt(h),u|=0;return t.colors[Math.abs(u)%t.colors.length]}t.selectColor=e;function t(d){let u,h=null,m,x;function y(...C){if(!y.enabled)return;let A=y,P=Number(new Date),$=P-(u||P);A.diff=$,A.prev=u,A.curr=P,u=P,C[0]=t.coerce(C[0]),typeof C[0]!="string"&&C.unshift("%O");let E=0;C[0]=C[0].replace(/%([a-zA-Z%])/g,(w,k)=>{if(w==="%%")return"%";E++;let b=t.formatters[k];if(typeof b=="function"){let S=C[E];w=b.call(A,S),C.splice(E,1),E--}return w}),t.formatArgs.call(A,C),(A.log||t.log).apply(A,C)}return y.namespace=d,y.useColors=t.useColors(),y.color=t.selectColor(d),y.extend=s,y.destroy=t.destroy,Object.defineProperty(y,"enabled",{enumerable:!0,configurable:!1,get:()=>h!==null?h:(m!==t.namespaces&&(m=t.namespaces,x=t.enabled(d)),x),set:C=>{h=C}}),typeof t.init=="function"&&t.init(y),y}function s(d,u){let h=t(this.namespace+(typeof u>"u"?":":u)+d);return h.log=this.log,h}function n(d){t.save(d),t.namespaces=d,t.names=[],t.skips=[];let u=(typeof d=="string"?d:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let h of u)h[0]==="-"?t.skips.push(h.slice(1)):t.names.push(h)}function i(d,u){let h=0,m=0,x=-1,y=0;for(;h<d.length;)if(m<u.length&&(u[m]===d[h]||u[m]==="*"))u[m]==="*"?(x=m,y=h,m++):(h++,m++);else if(x!==-1)m=x+1,y++,h=y;else return!1;for(;m<u.length&&u[m]==="*";)m++;return m===u.length}function o(){let d=[...t.names,...t.skips.map(u=>"-"+u)].join(",");return t.enable(""),d}function l(d){for(let u of t.skips)if(i(d,u))return!1;for(let u of t.names)if(i(d,u))return!0;return!1}function a(d){return d instanceof Error?d.stack||d.message:d}function p(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return t.enable(t.load()),t}vn.exports=js});var Sn=yr(($e,Yt)=>{$e.formatArgs=Ws;$e.save=Ks;$e.load=Zs;$e.useColors=Gs;$e.storage=Ys();$e.destroy=(()=>{let r=!1;return()=>{r||(r=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();$e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function Gs(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let r;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(r=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(r[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function Ws(r){if(r[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+r[0]+(this.useColors?"%c ":" ")+"+"+Yt.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;r.splice(1,0,e,"color: inherit");let t=0,s=0;r[0].replace(/%[a-zA-Z%]/g,n=>{n!=="%%"&&(t++,n==="%c"&&(s=t))}),r.splice(s,0,e)}$e.log=console.debug||console.log||(()=>{});function Ks(r){try{r?$e.storage.setItem("debug",r):$e.storage.removeItem("debug")}catch{}}function Zs(){let r;try{r=$e.storage.getItem("debug")||$e.storage.getItem("DEBUG")}catch{}return!r&&typeof process<"u"&&"env"in process&&(r=process.env.DEBUG),r}function Ys(){try{return localStorage}catch{}}Yt.exports=An()($e);var{formatters:Vs}=Yt.exports;Vs.j=function(r){try{return JSON.stringify(r)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var $t=globalThis,Kt=$t.trustedTypes,un=Kt?Kt.createPolicy("lit-html",{createHTML:r=>r}):void 0,bn="$lit$",Ke=`lit$${Math.random().toFixed(9).slice(2)}$`,yn="?"+Ke,Ms=`<${yn}>`,at=document,Et=()=>at.createComment(""),Ct=r=>r===null||typeof r!="object"&&typeof r!="function",Sr=Array.isArray,Os=r=>Sr(r)||typeof r?.[Symbol.iterator]=="function",wr=`[
|
|
2
|
+
\f\r]`,Tt=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,pn=/-->/g,fn=/>/g,it=RegExp(`>|${wr}(?:([^\\s"'>=/]+)(${wr}*=${wr}*(?:[^
|
|
3
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),hn=/'/g,gn=/"/g,wn=/^(?:script|style|textarea|title)$/i,Tr=r=>(e,...t)=>({_$litType$:r,strings:e,values:t}),L=Tr(1),oo=Tr(2),ao=Tr(3),lt=Symbol.for("lit-noChange"),ae=Symbol.for("lit-nothing"),mn=new WeakMap,ot=at.createTreeWalker(at,129);function kn(r,e){if(!Sr(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return un!==void 0?un.createHTML(e):e}var Ps=(r,e)=>{let t=r.length-1,s=[],n,i=e===2?"<svg>":e===3?"<math>":"",o=Tt;for(let l=0;l<t;l++){let a=r[l],p,d,u=-1,h=0;for(;h<a.length&&(o.lastIndex=h,d=o.exec(a),d!==null);)h=o.lastIndex,o===Tt?d[1]==="!--"?o=pn:d[1]!==void 0?o=fn:d[2]!==void 0?(wn.test(d[2])&&(n=RegExp("</"+d[2],"g")),o=it):d[3]!==void 0&&(o=it):o===it?d[0]===">"?(o=n??Tt,u=-1):d[1]===void 0?u=-2:(u=o.lastIndex-d[2].length,p=d[1],o=d[3]===void 0?it:d[3]==='"'?gn:hn):o===gn||o===hn?o=it:o===pn||o===fn?o=Tt:(o=it,n=void 0);let m=o===it&&r[l+1].startsWith("/>")?" ":"";i+=o===Tt?a+Ms:u>=0?(s.push(p),a.slice(0,u)+bn+a.slice(u)+Ke+m):a+Ke+(u===-2?l:m)}return[kn(r,i+(r[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),s]},Rt=class r{constructor({strings:e,_$litType$:t},s){let n;this.parts=[];let i=0,o=0,l=e.length-1,a=this.parts,[p,d]=Ps(e,t);if(this.el=r.createElement(p,s),ot.currentNode=this.el.content,t===2||t===3){let u=this.el.content.firstChild;u.replaceWith(...u.childNodes)}for(;(n=ot.nextNode())!==null&&a.length<l;){if(n.nodeType===1){if(n.hasAttributes())for(let u of n.getAttributeNames())if(u.endsWith(bn)){let h=d[o++],m=n.getAttribute(u).split(Ke),x=/([.?@])?(.*)/.exec(h);a.push({type:1,index:i,name:x[2],strings:m,ctor:x[1]==="."?_r:x[1]==="?"?xr:x[1]==="@"?vr:wt}),n.removeAttribute(u)}else u.startsWith(Ke)&&(a.push({type:6,index:i}),n.removeAttribute(u));if(wn.test(n.tagName)){let u=n.textContent.split(Ke),h=u.length-1;if(h>0){n.textContent=Kt?Kt.emptyScript:"";for(let m=0;m<h;m++)n.append(u[m],Et()),ot.nextNode(),a.push({type:2,index:++i});n.append(u[h],Et())}}}else if(n.nodeType===8)if(n.data===yn)a.push({type:2,index:i});else{let u=-1;for(;(u=n.data.indexOf(Ke,u+1))!==-1;)a.push({type:7,index:i}),u+=Ke.length-1}i++}}static createElement(e,t){let s=at.createElement("template");return s.innerHTML=e,s}};function yt(r,e,t=r,s){if(e===lt)return e;let n=s!==void 0?t._$Co?.[s]:t._$Cl,i=Ct(e)?void 0:e._$litDirective$;return n?.constructor!==i&&(n?._$AO?.(!1),i===void 0?n=void 0:(n=new i(r),n._$AT(r,t,s)),s!==void 0?(t._$Co??(t._$Co=[]))[s]=n:t._$Cl=n),n!==void 0&&(e=yt(r,n._$AS(r,e.values),n,s)),e}var kr=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){let{el:{content:t},parts:s}=this._$AD,n=(e?.creationScope??at).importNode(t,!0);ot.currentNode=n;let i=ot.nextNode(),o=0,l=0,a=s[0];for(;a!==void 0;){if(o===a.index){let p;a.type===2?p=new It(i,i.nextSibling,this,e):a.type===1?p=new a.ctor(i,a.name,a.strings,this,e):a.type===6&&(p=new Ar(i,this,e)),this._$AV.push(p),a=s[++l]}o!==a?.index&&(i=ot.nextNode(),o++)}return ot.currentNode=at,n}p(e){let t=0;for(let 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++}},It=class r{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,s,n){this.type=2,this._$AH=ae,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=s,this.options=n,this._$Cv=n?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,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=yt(this,e,t),Ct(e)?e===ae||e==null||e===""?(this._$AH!==ae&&this._$AR(),this._$AH=ae):e!==this._$AH&&e!==lt&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Os(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!==ae&&Ct(this._$AH)?this._$AA.nextSibling.data=e:this.T(at.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:s}=e,n=typeof s=="number"?this._$AC(e):(s.el===void 0&&(s.el=Rt.createElement(kn(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===n)this._$AH.p(t);else{let i=new kr(n,this),o=i.u(this.options);i.p(t),this.T(o),this._$AH=i}}_$AC(e){let t=mn.get(e.strings);return t===void 0&&mn.set(e.strings,t=new Rt(e)),t}k(e){Sr(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,s,n=0;for(let i of e)n===t.length?t.push(s=new r(this.O(Et()),this.O(Et()),this,this.options)):s=t[n],s._$AI(i),n++;n<t.length&&(this._$AR(s&&s._$AB.nextSibling,n),t.length=n)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let s=e.nextSibling;e.remove(),e=s}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},wt=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,s,n,i){this.type=1,this._$AH=ae,this._$AN=void 0,this.element=e,this.name=t,this._$AM=n,this.options=i,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=ae}_$AI(e,t=this,s,n){let i=this.strings,o=!1;if(i===void 0)e=yt(this,e,t,0),o=!Ct(e)||e!==this._$AH&&e!==lt,o&&(this._$AH=e);else{let l=e,a,p;for(e=i[0],a=0;a<i.length-1;a++)p=yt(this,l[s+a],t,a),p===lt&&(p=this._$AH[a]),o||(o=!Ct(p)||p!==this._$AH[a]),p===ae?e=ae:e!==ae&&(e+=(p??"")+i[a+1]),this._$AH[a]=p}o&&!n&&this.j(e)}j(e){e===ae?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},_r=class extends wt{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===ae?void 0:e}},xr=class extends wt{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==ae)}},vr=class extends wt{constructor(e,t,s,n,i){super(e,t,s,n,i),this.type=5}_$AI(e,t=this){if((e=yt(this,e,t,0)??ae)===lt)return;let s=this._$AH,n=e===ae&&s!==ae||e.capture!==s.capture||e.once!==s.once||e.passive!==s.passive,i=e!==ae&&(s===ae||n);n&&this.element.removeEventListener(this.name,this,s),i&&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)}},Ar=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){yt(this,e)}};var Fs=$t.litHtmlPolyfillSupport;Fs?.(Rt,It),($t.litHtmlVersions??($t.litHtmlVersions=[])).push("3.3.1");var Te=(r,e,t)=>{let s=t?.renderBefore??e,n=s._$litPart$;if(n===void 0){let i=t?.renderBefore??null;s._$litPart$=n=new It(e.insertBefore(Et(),i),i,void 0,t??{})}return n._$AI(r),n};function Le(r,e){let t=r.priority??2,s=e.priority??2;if(t!==s)return t-s;let n=r.created_at??0,i=e.created_at??0;if(n!==i)return n<i?-1:1;let o=r.id,l=e.id;return o<l?-1:o>l?1:0}function kt(r,e){let t=r.closed_at??0,s=e.closed_at??0;if(t!==s)return t<s?1:-1;let n=r?.id,i=e?.id;return n<i?-1:n>i?1:0}function Ze(r=void 0){function e(i){return!r||typeof r.snapshotFor!="function"?[]:r.snapshotFor(i).slice().sort(Le)}function t(i,o){let l=r&&r.snapshotFor?r.snapshotFor(i).slice():[];return o==="in_progress"?l.sort(Le):o==="closed"?l.sort(kt):l.sort(Le),l}function s(i){if(!r||typeof r.snapshotFor!="function")return[];let l=(r.snapshotFor(`detail:${i}`)||[]).find(p=>String(p?.id||"")===String(i));return(Array.isArray(l?.dependents)?l.dependents:[]).slice().sort(Le)}function n(i){return r&&typeof r.subscribe=="function"?r.subscribe(i):()=>{}}return{selectIssuesFor:e,selectBoardColumn:t,selectEpicChildren:s,subscribe:n}}var Tn=Ns(Sn(),1);function oe(r){return(0,Tn.default)(`beads-ui:${r}`)}function $n(r){let e=oe("data");async function t(s){let{id:n}=s;e("updateIssue %s %o",n,Object.keys(s));let i=null;return typeof s.title=="string"&&(i=await r("edit-text",{id:n,field:"title",value:s.title})),typeof s.acceptance=="string"&&(i=await r("edit-text",{id:n,field:"acceptance",value:s.acceptance})),typeof s.notes=="string"&&(i=await r("edit-text",{id:n,field:"notes",value:s.notes})),typeof s.design=="string"&&(i=await r("edit-text",{id:n,field:"design",value:s.design})),typeof s.status=="string"&&(i=await r("update-status",{id:n,status:s.status})),typeof s.priority=="number"&&(i=await r("update-priority",{id:n,priority:s.priority})),typeof s.assignee=="string"&&(i=await r("update-assignee",{id:n,assignee:s.assignee})),e("updateIssue done %s",n),i}return{updateIssue:t}}function $r(r,e={}){let t=oe(`issue-store:${r}`),s=new Map,n=[],i=0,o=new Set,l=!1,a=e.sort||Le;function p(){for(let h of Array.from(o))try{h()}catch{}}function d(){n=Array.from(s.values()).sort(a)}function u(h){if(l||!h||h.id!==r)return;let m=Number(h.revision)||0;if(t("apply %s rev=%d",h.type,m),!(m<=i&&h.type!=="snapshot")){if(h.type==="snapshot"){if(m<=i)return;s.clear();let x=Array.isArray(h.issues)?h.issues:[];for(let y of x)y&&typeof y.id=="string"&&y.id.length>0&&s.set(y.id,y);d(),i=m,p();return}if(h.type==="upsert"){let x=h.issue;if(x&&typeof x.id=="string"&&x.id.length>0){let y=s.get(x.id);if(!y)s.set(x.id,x);else{let C=Number.isFinite(y.updated_at)?y.updated_at:0,A=Number.isFinite(x.updated_at)?x.updated_at:0;if(C<=A){for(let P of Object.keys(y))P in x||delete y[P];for(let[P,$]of Object.entries(x))y[P]=$}}d()}i=m,p()}else if(h.type==="delete"){let x=String(h.issue_id||"");x&&(s.delete(x),d()),i=m,p()}}}return{id:r,subscribe(h){return o.add(h),()=>{o.delete(h)}},applyPush:u,snapshot(){return n},size(){return s.size},getById(h){return s.get(h)},dispose(){l=!0,s.clear(),n=[],o.clear(),i=0}}}function Vt(r){let e=String(r.type||"").trim(),t={};if(r.params&&typeof r.params=="object"){let n=Object.keys(r.params).sort();for(let i of n){let o=r.params[i];t[i]=String(o)}}let s=new URLSearchParams(t).toString();return s.length>0?`${e}?${s}`:e}function En(r){let e=oe("subs"),t=new Map,s=new Map;function n(l,a){e("applyDelta %s +%d ~%d -%d",l,(a.added||[]).length,(a.updated||[]).length,(a.removed||[]).length);let p=s.get(l);if(!p||p.size===0)return;let d=Array.isArray(a.added)?a.added:[],u=Array.isArray(a.updated)?a.updated:[],h=Array.isArray(a.removed)?a.removed:[];for(let m of Array.from(p)){let x=t.get(m);if(!x)continue;let y=x.itemsById;for(let C of d)typeof C=="string"&&C.length>0&&y.set(C,!0);for(let C of u)typeof C=="string"&&C.length>0&&y.set(C,!0);for(let C of h)typeof C=="string"&&C.length>0&&y.delete(C)}}async function i(l,a){let p=Vt(a);if(e("subscribe %s key=%s",l,p),!t.has(l))t.set(l,{key:p,itemsById:new Map});else{let u=t.get(l);if(u&&u.key!==p){let h=s.get(u.key);h&&(h.delete(l),h.size===0&&s.delete(u.key)),t.set(l,{key:p,itemsById:new Map})}}s.has(p)||s.set(p,new Set);let d=s.get(p);d&&d.add(l);try{await r("subscribe-list",{id:l,type:a.type,params:a.params})}catch(u){let h=t.get(l)||null;if(h){let m=s.get(h.key);m&&(m.delete(l),m.size===0&&s.delete(h.key))}throw t.delete(l),u}return async()=>{e("unsubscribe %s key=%s",l,p);try{await r("unsubscribe-list",{id:l})}catch{}let u=t.get(l)||null;if(u){let h=s.get(u.key);h&&(h.delete(l),h.size===0&&s.delete(u.key))}t.delete(l)}}return{subscribeList:i,_applyDelta:n,_subKeyOf:Vt,selectors:{getIds(l){let a=t.get(l);return a?Array.from(a.itemsById.keys()):[]},has(l,a){let p=t.get(l);return p?p.itemsById.has(a):!1},count(l){let a=t.get(l);return a?a.itemsById.size:0},getItemsById(l){let a=t.get(l),p={};if(!a)return p;for(let d of a.itemsById.keys())p[d]=!0;return p}}}}function Cn(){let r=oe("issue-stores"),e=new Map,t=new Map,s=new Set,n=new Map;function i(){for(let a of Array.from(s))try{a()}catch{}}function o(a,p,d){let u=p?Vt(p):"",h=t.get(a)||"",m=e.has(a);if(r("register %s key=%s (prev=%s)",a,u,h),m&&h&&u&&h!==u){let x=e.get(a);if(x)try{x.dispose()}catch{}let y=n.get(a);if(y){try{y()}catch{}n.delete(a)}let C=$r(a,d);e.set(a,C);let A=C.subscribe(()=>i());n.set(a,A)}else if(!m){let x=$r(a,d);e.set(a,x);let y=x.subscribe(()=>i());n.set(a,y)}return t.set(a,u),()=>l(a)}function l(a){r("unregister %s",a),t.delete(a);let p=e.get(a);p&&(p.dispose(),e.delete(a));let d=n.get(a);if(d){try{d()}catch{}n.delete(a)}}return{register:o,unregister:l,getStore(a){return e.get(a)||null},snapshotFor(a){let p=e.get(a);return p?p.snapshot().slice():[]},subscribe(a){return s.add(a),()=>s.delete(a)}}}function Ye(r,e){return`#/${r==="epics"||r==="board"?r:"issues"}?issue=${encodeURIComponent(e)}`}function Xt(r){let e=String(r||""),t=e.startsWith("#")?e.slice(1):e,s=t.indexOf("?"),n=s>=0?t.slice(s+1):"";if(n){let l=new URLSearchParams(n).get("issue");if(l)return decodeURIComponent(l)}let i=/^\/issue\/([^\s?#]+)/.exec(t);return i&&i[1]?decodeURIComponent(i[1]):null}function Er(r){let e=String(r||"");return/^#\/epics(\b|\/|$)/.test(e)?"epics":/^#\/board(\b|\/|$)/.test(e)?"board":"issues"}function Rn(r){let e=oe("router"),t=()=>{let s=window.location.hash||"",n=/^#\/issue\/([^\s?#]+)/.exec(s);if(n&&n[1]){let l=decodeURIComponent(n[1]);r.setState({selected_id:l,view:"issues"});let a=`#/issues?issue=${encodeURIComponent(l)}`;if(window.location.hash!==a){window.location.hash=a;return}}let i=Xt(s),o=Er(s);e("hash change \u2192 view=%s id=%s",o,i),r.setState({selected_id:i,view:o})};return{start(){window.addEventListener("hashchange",t),t()},stop(){window.removeEventListener("hashchange",t)},gotoIssue(s){let i=(r.getState?r.getState():{view:"issues"}).view||"issues",o=Ye(i,s);e("goto issue %s (view=%s)",s,i),window.location.hash!==o?window.location.hash=o:r.setState({selected_id:s,view:i})},gotoView(s){let i=(r.getState?r.getState():{selected_id:null}).selected_id,o=i?Ye(s,i):`#/${s}`;e("goto view %s (id=%s)",s,i||""),window.location.hash!==o?window.location.hash=o:r.setState({view:s,selected_id:null})}}}function In(r={}){let e=oe("state"),t={selected_id:r.selected_id??null,view:r.view??"issues",filters:{status:r.filters?.status??"all",search:r.filters?.search??"",type:typeof r.filters?.type=="string"?r.filters?.type:""},board:{closed_filter:r.board?.closed_filter==="3"||r.board?.closed_filter==="7"||r.board?.closed_filter==="today"?r.board?.closed_filter:"today"}},s=new Set;function n(){for(let i of Array.from(s))try{i(t)}catch{}}return{getState(){return t},setState(i){let o={...t,...i,filters:{...t.filters,...i.filters||{}},board:{...t.board,...i.board||{}}};o.selected_id===t.selected_id&&o.view===t.view&&o.filters.status===t.filters.status&&o.filters.search===t.filters.search&&o.filters.type===t.filters.type&&o.board.closed_filter===t.board.closed_filter||(t=o,e("state change %o",{selected_id:t.selected_id,view:t.view,filters:t.filters,board:t.board}),n())},subscribe(i){return s.add(i),()=>s.delete(i)}}}function Ln(r){let e=0;function t(){if(!r)return;let o=e>0;r.toggleAttribute("hidden",!o),r.setAttribute("aria-busy",o?"true":"false")}function s(){e+=1,t()}function n(){e=Math.max(0,e-1),t()}function i(o){return async(l,a)=>{s();try{return await o(l,a)}finally{n()}}}return t(),{wrapSend:i,start:s,done:n,getCount:()=>e}}function he(r,e="info",t=2800){let s=document.createElement("div");s.className="toast",s.textContent=r,s.style.position="fixed",s.style.right="12px",s.style.bottom="12px",s.style.zIndex="1000",s.style.color="#fff",s.style.padding="8px 10px",s.style.borderRadius="4px",s.style.fontSize="12px",e==="success"?s.style.background="#156d36":e==="error"?s.style.background="#9f2011":s.style.background="rgba(0,0,0,0.85)",(document.body||document.documentElement).appendChild(s),setTimeout(()=>{try{s.remove()}catch{}},t)}function Ve(r,e){let t=typeof e?.duration_ms=="number"?e.duration_ms:1200,s=document.createElement("button");s.className=(e?.class_name?e.class_name+" ":"")+"mono id-copy",s.type="button",s.setAttribute("aria-live","polite"),s.setAttribute("title","Copy issue ID"),s.setAttribute("aria-label",`Copy issue ID ${r}`),s.textContent=r;async function n(){try{navigator.clipboard&&typeof navigator.clipboard.writeText=="function"&&await navigator.clipboard.writeText(String(r)),s.textContent="Copied";let i=s.getAttribute("aria-label")||"";s.setAttribute("aria-label","Copied"),setTimeout(()=>{s.textContent=r,s.setAttribute("aria-label",i)},Math.max(80,t))}catch{}}return s.addEventListener("click",i=>{i.preventDefault(),i.stopPropagation(),n()}),s.addEventListener("keydown",i=>{(i.key==="Enter"||i.key===" ")&&(i.preventDefault(),i.stopPropagation(),n())}),s}var Xe=["Critical","High","Medium","Low","Backlog"];function Dn(r){let e=typeof r=="number"?r:2,t=document.createElement("span");t.className="priority-badge",t.classList.add(`is-p${Math.max(0,Math.min(4,e))}`),t.setAttribute("role","img");let s=Xs(e);return t.setAttribute("title",s),t.setAttribute("aria-label",`Priority: ${s}`),t.textContent=Lt(e)+" "+s,t}function Xs(r){let e=Math.max(0,Math.min(4,r));return Xe[e]||"Medium"}function Lt(r){switch(r){case 0:return"\u{1F525}";case 1:return"\u26A1\uFE0F";case 2:return"\u{1F527}";case 3:return"\u{1FAB6}";case 4:return"\u{1F4A4}";default:return"\u{1F527}"}}function dt(r){let e=document.createElement("span");e.className="type-badge";let t=(r||"").toString().toLowerCase(),s=new Set(["bug","feature","task","epic","chore"]),n=s.has(t)?t:"neutral";e.classList.add(`type-badge--${n}`),e.setAttribute("role","img");let i=s.has(t)?t==="bug"?"Bug":t==="feature"?"Feature":t==="task"?"Task":t==="epic"?"Epic":"Chore":"\u2014";return e.setAttribute("aria-label",s.has(t)?`Issue type: ${i}`:"Issue type: unknown"),e.setAttribute("title",s.has(t)?`Type: ${i}`:"Type: unknown"),e.textContent=i,e}function Nn(r,e,t,s,n=void 0,i=void 0){let o=oe("views:board"),l=[],a=[],p=[],d=[],u=[],h=i?Ze(i):null,m="today";if(s)try{let k=s.getState(),b=k&&k.board?String(k.board.closed_filter||"today"):"today";(b==="today"||b==="3"||b==="7")&&(m=b)}catch{}function x(){return L`
|
|
4
4
|
<div class="panel__body board-root">
|
|
5
|
-
${
|
|
6
|
-
${
|
|
7
|
-
${
|
|
8
|
-
${
|
|
5
|
+
${y("Blocked","blocked-col",a)}
|
|
6
|
+
${y("Ready","ready-col",l)}
|
|
7
|
+
${y("In Progress","in-progress-col",p)}
|
|
8
|
+
${y("Closed","closed-col",d)}
|
|
9
9
|
</div>
|
|
10
|
-
`}function k
|
|
10
|
+
`}function y(k,b,S){let T=Array.isArray(S)?S.length:0,N=T===1?"1 issue":`${T} issues`;return L`
|
|
11
11
|
<section class="board-column" id=${b}>
|
|
12
12
|
<header
|
|
13
13
|
class="board-column__header"
|
|
@@ -16,9 +16,9 @@ var Es=Object.create;var hr=Object.defineProperty;var $s=Object.getOwnPropertyDe
|
|
|
16
16
|
aria-level="2"
|
|
17
17
|
>
|
|
18
18
|
<div class="board-column__title">
|
|
19
|
-
<span class="board-column__title-text">${
|
|
20
|
-
<span class="badge board-column__count" aria-label=${
|
|
21
|
-
${
|
|
19
|
+
<span class="board-column__title-text">${k}</span>
|
|
20
|
+
<span class="badge board-column__count" aria-label=${N}>
|
|
21
|
+
${T}
|
|
22
22
|
</span>
|
|
23
23
|
</div>
|
|
24
24
|
${b==="closed-col"?L`<label class="board-closed-filter">
|
|
@@ -48,123 +48,123 @@ var Es=Object.create;var hr=Object.defineProperty;var $s=Object.getOwnPropertyDe
|
|
|
48
48
|
role="list"
|
|
49
49
|
aria-labelledby=${b+"-header"}
|
|
50
50
|
>
|
|
51
|
-
${
|
|
51
|
+
${S.map(q=>C(q))}
|
|
52
52
|
</div>
|
|
53
53
|
</section>
|
|
54
|
-
`}function
|
|
54
|
+
`}function C(k){return L`
|
|
55
55
|
<article
|
|
56
56
|
class="board-card"
|
|
57
|
-
data-issue-id=${
|
|
57
|
+
data-issue-id=${k.id}
|
|
58
58
|
role="listitem"
|
|
59
59
|
tabindex="-1"
|
|
60
|
-
@click=${()=>t(
|
|
60
|
+
@click=${()=>t(k.id)}
|
|
61
61
|
>
|
|
62
62
|
<div class="board-card__title text-truncate">
|
|
63
|
-
${
|
|
63
|
+
${k.title||"(no title)"}
|
|
64
64
|
</div>
|
|
65
65
|
<div class="board-card__meta">
|
|
66
|
-
${
|
|
67
|
-
${
|
|
66
|
+
${dt(k.issue_type)} ${Dn(k.priority)}
|
|
67
|
+
${Ve(k.id,{class_name:"mono"})}
|
|
68
68
|
</div>
|
|
69
69
|
</article>
|
|
70
|
-
`}function S(){Ae(v(),r),P()}function P(){try{let _=Array.from(r.querySelectorAll(".board-column"));for(let b of _){let T=b.querySelector(".board-column__body");if(!T)continue;let E=Array.from(T.querySelectorAll(".board-card")),D=b.querySelector(".board-column__header"),U=D&&D.textContent?.trim()||"";for(let W of E){let Z=W.querySelector(".board-card__title"),K=Z&&Z.textContent?.trim()||"";W.setAttribute("aria-label",`Issue ${K||"(no title)"} \u2014 Column ${U}`),W.tabIndex=-1}E.length>0&&(E[0].tabIndex=0)}}catch{}}r.addEventListener("keydown",_=>{let b=_.target;if(!b||!(b instanceof HTMLElement))return;let T=String(b.tagName||"").toLowerCase();if(T==="input"||T==="textarea"||T==="select"||b.isContentEditable===!0)return;let E=b.closest(".board-card");if(!E)return;let D=String(_.key||"");if(D==="Enter"||D===" "){_.preventDefault();let j=E.getAttribute("data-issue-id");j&&t(j);return}if(D!=="ArrowUp"&&D!=="ArrowDown"&&D!=="ArrowLeft"&&D!=="ArrowRight")return;_.preventDefault();let U=E.closest(".board-column");if(!U)return;let W=U.querySelector(".board-column__body");if(!W)return;let Z=Array.from(W.querySelectorAll(".board-card")),K=Z.indexOf(E);if(K!==-1){if(D==="ArrowDown"&&K<Z.length-1){$(Z[K],Z[K+1]);return}if(D==="ArrowUp"&&K>0){$(Z[K],Z[K-1]);return}if(D==="ArrowRight"||D==="ArrowLeft"){let j=Array.from(r.querySelectorAll(".board-column")),re=j.indexOf(U);if(re===-1)return;let ie=D==="ArrowRight"?1:-1,he=re+ie,ue=null;for(;he>=0&&he<j.length;){let B=j[he],ge=B.querySelector(".board-column__body");if((ge?Array.from(ge.querySelectorAll(".board-card")):[]).length>0){ue=B;break}he+=ie}if(ue){let B=ue.querySelector(".board-column__body .board-card");B&&$(E,B)}return}}});function $(_,b){try{_.tabIndex=-1,b.tabIndex=0,b.focus()}catch{}}function C(){a("applyClosedFilter %s",m);let _=Array.isArray(u)?[...u]:[],b=new Date,T=0;m==="today"?T=new Date(b.getFullYear(),b.getMonth(),b.getDate(),0,0,0,0).getTime():m==="3"?T=b.getTime()-4320*60*1e3:m==="7"&&(T=b.getTime()-10080*60*1e3),_=_.filter(E=>{let D=Number.isFinite(E.closed_at)?E.closed_at:NaN;return Number.isFinite(D)?D>=T:!1}),_.sort(ht),d=_}function O(_){try{let b=_.target,T=String(b.value||"today");if(m=T==="3"||T==="7"?T:"today",a("closed filter %s",m),s)try{s.setState({board:{closed_filter:m}})}catch{}C(),S()}catch{}}function y(){try{if(f){let _=f.selectBoardColumn("tab:board:in-progress","in_progress"),b=f.selectBoardColumn("tab:board:blocked","blocked"),T=f.selectBoardColumn("tab:board:ready","ready"),E=f.selectBoardColumn("tab:board:closed","closed"),D=new Set(_.map(W=>W.id));l=T.filter(W=>!D.has(W.id)),o=b,p=_,u=E}C(),S()}catch{l=[],o=[],p=[],d=[],S()}}return f&&f.subscribe(()=>{try{y()}catch{}}),{async load(){a("load"),y();try{let _=!!(n&&n.selectors),b=U=>{if(!_||!n)return 0;let W=n.selectors;if(typeof W.count=="function")return Number(W.count(U)||0);try{let Z=W.getIds(U);return Array.isArray(Z)?Z.length:0}catch{return 0}},T=b("tab:board:ready")+b("tab:board:blocked")+b("tab:board:in-progress")+b("tab:board:closed"),E=e,D=E&&typeof E.getReady=="function"&&typeof E.getBlocked=="function"&&typeof E.getInProgress=="function"&&typeof E.getClosed=="function";if(T===0&&D){a("fallback fetch");let[U,W,Z,K]=await Promise.all([E.getReady().catch(()=>[]),E.getBlocked().catch(()=>[]),E.getInProgress().catch(()=>[]),E.getClosed().catch(()=>[])]),j=Array.isArray(U)?U.map(B=>B):[],re=Array.isArray(W)?W.map(B=>B):[],ie=Array.isArray(Z)?Z.map(B=>B):[],he=Array.isArray(K)?K.map(B=>B):[],ue=new Set(ie.map(B=>B.id));j=j.filter(B=>!ue.has(B.id)),j.sort(Ie),re.sort(Ie),ie.sort(Ie),l=j,o=re,p=ie,u=he,C(),S()}}catch{}},clear(){r.replaceChildren(),l=[],o=[],p=[],d=[]}}}var{entries:zn,setPrototypeOf:In,isFrozen:Qs,getPrototypeOf:Js,getOwnPropertyDescriptor:ei}=Object,{freeze:ke,seal:$e,create:Lr}=Object,{apply:Dr,construct:Nr}=typeof Reflect<"u"&&Reflect;ke||(ke=function(e){return e});$e||($e=function(e){return e});Dr||(Dr=function(e,t){for(var s=arguments.length,n=new Array(s>2?s-2:0),i=2;i<s;i++)n[i-2]=arguments[i];return e.apply(t,n)});Nr||(Nr=function(e){for(var t=arguments.length,s=new Array(t>1?t-1:0),n=1;n<t;n++)s[n-1]=arguments[n];return new e(...s)});var Xt=_e(Array.prototype.forEach),ti=_e(Array.prototype.lastIndexOf),Ln=_e(Array.prototype.pop),$t=_e(Array.prototype.push),ri=_e(Array.prototype.splice),Jt=_e(String.prototype.toLowerCase),Tr=_e(String.prototype.toString),Er=_e(String.prototype.match),Ct=_e(String.prototype.replace),ni=_e(String.prototype.indexOf),si=_e(String.prototype.trim),Le=_e(Object.prototype.hasOwnProperty),we=_e(RegExp.prototype.test),Rt=ii(TypeError);function _e(r){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var t=arguments.length,s=new Array(t>1?t-1:0),n=1;n<t;n++)s[n-1]=arguments[n];return Dr(r,e,s)}}function ii(r){return function(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];return Nr(r,t)}}function G(r,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Jt;In&&In(r,null);let s=e.length;for(;s--;){let n=e[s];if(typeof n=="string"){let i=t(n);i!==n&&(Qs(e)||(e[s]=i),n=i)}r[n]=!0}return r}function oi(r){for(let e=0;e<r.length;e++)Le(r,e)||(r[e]=null);return r}function Fe(r){let e=Lr(null);for(let[t,s]of zn(r))Le(r,t)&&(Array.isArray(s)?e[t]=oi(s):s&&typeof s=="object"&&s.constructor===Object?e[t]=Fe(s):e[t]=s);return e}function It(r,e){for(;r!==null;){let s=ei(r,e);if(s){if(s.get)return _e(s.get);if(typeof s.value=="function")return _e(s.value)}r=Js(r)}function t(){return null}return t}var Dn=ke(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),$r=ke(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Cr=ke(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),ai=ke(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Rr=ke(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),li=ke(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Nn=ke(["#text"]),Mn=ke(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Ir=ke(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),On=ke(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Qt=ke(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),ci=$e(/\{\{[\w\W]*|[\w\W]*\}\}/gm),di=$e(/<%[\w\W]*|[\w\W]*%>/gm),ui=$e(/\$\{[\w\W]*/gm),pi=$e(/^data-[\-\w.\u00B7-\uFFFF]+$/),fi=$e(/^aria-[\-\w]+$/),Bn=$e(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),hi=$e(/^(?:\w+script|data):/i),gi=$e(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Hn=$e(/^html$/i),mi=$e(/^[a-z][.\w]*(-[.\w]+)+$/i),Pn=Object.freeze({__proto__:null,ARIA_ATTR:fi,ATTR_WHITESPACE:gi,CUSTOM_ELEMENT:mi,DATA_ATTR:pi,DOCTYPE_NAME:Hn,ERB_EXPR:di,IS_ALLOWED_URI:Bn,IS_SCRIPT_OR_DATA:hi,MUSTACHE_EXPR:ci,TMPLIT_EXPR:ui}),Lt={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},bi=function(){return typeof window>"u"?null:window},yi=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let s=null,n="data-tt-policy-suffix";t&&t.hasAttribute(n)&&(s=t.getAttribute(n));let i="dompurify"+(s?"#"+s:"");try{return e.createPolicy(i,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+i+" could not be created."),null}},Fn=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Un(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:bi(),e=F=>Un(F);if(e.version="3.3.0",e.removed=[],!r||!r.document||r.document.nodeType!==Lt.document||!r.Element)return e.isSupported=!1,e;let{document:t}=r,s=t,n=s.currentScript,{DocumentFragment:i,HTMLTemplateElement:a,Node:l,Element:o,NodeFilter:p,NamedNodeMap:d=r.NamedNodeMap||r.MozNamedAttrMap,HTMLFormElement:u,DOMParser:f,trustedTypes:m}=r,v=o.prototype,k=It(v,"cloneNode"),I=It(v,"remove"),S=It(v,"nextSibling"),P=It(v,"childNodes"),$=It(v,"parentNode");if(typeof a=="function"){let F=t.createElement("template");F.content&&F.content.ownerDocument&&(t=F.content.ownerDocument)}let C,O="",{implementation:y,createNodeIterator:_,createDocumentFragment:b,getElementsByTagName:T}=t,{importNode:E}=s,D=Fn();e.isSupported=typeof zn=="function"&&typeof $=="function"&&y&&y.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:U,ERB_EXPR:W,TMPLIT_EXPR:Z,DATA_ATTR:K,ARIA_ATTR:j,IS_SCRIPT_OR_DATA:re,ATTR_WHITESPACE:ie,CUSTOM_ELEMENT:he}=Pn,{IS_ALLOWED_URI:ue}=Pn,B=null,ge=G({},[...Dn,...$r,...Cr,...Rr,...Nn]),ee=null,Ce=G({},[...Mn,...Ir,...On,...Qt]),X=Object.seal(Lr(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Te=null,Re=null,Ee=Object.seal(Lr(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),Be=!0,He=!0,Xe=!1,x=!0,g=!1,w=!0,z=!1,le=!1,ce=!1,Ue=!1,at=!1,lt=!1,Bt=!0,h=!1,N="user-content-",q=!0,R=!1,Q={},de=null,yt=G({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),pe=null,Ht=G({},["audio","video","img","source","image","track"]),wt=null,Ut=G({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),qe="http://www.w3.org/1998/Math/MathML",ct="http://www.w3.org/2000/svg",H="http://www.w3.org/1999/xhtml",te=H,je=!1,qt=null,ks=G({},[qe,ct,H],Tr),jt=G({},["mi","mo","mn","ms","mtext"]),Gt=G({},["annotation-xml"]),_s=G({},["title","style","font","a","script"]),kt=null,xs=["application/xhtml+xml","text/html"],vs="text/html",fe=null,dt=null,As=t.createElement("form"),Kr=function(c){return c instanceof RegExp||c instanceof Function},ur=function(){let c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(dt&&dt===c)){if((!c||typeof c!="object")&&(c={}),c=Fe(c),kt=xs.indexOf(c.PARSER_MEDIA_TYPE)===-1?vs:c.PARSER_MEDIA_TYPE,fe=kt==="application/xhtml+xml"?Tr:Jt,B=Le(c,"ALLOWED_TAGS")?G({},c.ALLOWED_TAGS,fe):ge,ee=Le(c,"ALLOWED_ATTR")?G({},c.ALLOWED_ATTR,fe):Ce,qt=Le(c,"ALLOWED_NAMESPACES")?G({},c.ALLOWED_NAMESPACES,Tr):ks,wt=Le(c,"ADD_URI_SAFE_ATTR")?G(Fe(Ut),c.ADD_URI_SAFE_ATTR,fe):Ut,pe=Le(c,"ADD_DATA_URI_TAGS")?G(Fe(Ht),c.ADD_DATA_URI_TAGS,fe):Ht,de=Le(c,"FORBID_CONTENTS")?G({},c.FORBID_CONTENTS,fe):yt,Te=Le(c,"FORBID_TAGS")?G({},c.FORBID_TAGS,fe):Fe({}),Re=Le(c,"FORBID_ATTR")?G({},c.FORBID_ATTR,fe):Fe({}),Q=Le(c,"USE_PROFILES")?c.USE_PROFILES:!1,Be=c.ALLOW_ARIA_ATTR!==!1,He=c.ALLOW_DATA_ATTR!==!1,Xe=c.ALLOW_UNKNOWN_PROTOCOLS||!1,x=c.ALLOW_SELF_CLOSE_IN_ATTR!==!1,g=c.SAFE_FOR_TEMPLATES||!1,w=c.SAFE_FOR_XML!==!1,z=c.WHOLE_DOCUMENT||!1,Ue=c.RETURN_DOM||!1,at=c.RETURN_DOM_FRAGMENT||!1,lt=c.RETURN_TRUSTED_TYPE||!1,ce=c.FORCE_BODY||!1,Bt=c.SANITIZE_DOM!==!1,h=c.SANITIZE_NAMED_PROPS||!1,q=c.KEEP_CONTENT!==!1,R=c.IN_PLACE||!1,ue=c.ALLOWED_URI_REGEXP||Bn,te=c.NAMESPACE||H,jt=c.MATHML_TEXT_INTEGRATION_POINTS||jt,Gt=c.HTML_INTEGRATION_POINTS||Gt,X=c.CUSTOM_ELEMENT_HANDLING||{},c.CUSTOM_ELEMENT_HANDLING&&Kr(c.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(X.tagNameCheck=c.CUSTOM_ELEMENT_HANDLING.tagNameCheck),c.CUSTOM_ELEMENT_HANDLING&&Kr(c.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(X.attributeNameCheck=c.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),c.CUSTOM_ELEMENT_HANDLING&&typeof c.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(X.allowCustomizedBuiltInElements=c.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),g&&(He=!1),at&&(Ue=!0),Q&&(B=G({},Nn),ee=[],Q.html===!0&&(G(B,Dn),G(ee,Mn)),Q.svg===!0&&(G(B,$r),G(ee,Ir),G(ee,Qt)),Q.svgFilters===!0&&(G(B,Cr),G(ee,Ir),G(ee,Qt)),Q.mathMl===!0&&(G(B,Rr),G(ee,On),G(ee,Qt))),c.ADD_TAGS&&(typeof c.ADD_TAGS=="function"?Ee.tagCheck=c.ADD_TAGS:(B===ge&&(B=Fe(B)),G(B,c.ADD_TAGS,fe))),c.ADD_ATTR&&(typeof c.ADD_ATTR=="function"?Ee.attributeCheck=c.ADD_ATTR:(ee===Ce&&(ee=Fe(ee)),G(ee,c.ADD_ATTR,fe))),c.ADD_URI_SAFE_ATTR&&G(wt,c.ADD_URI_SAFE_ATTR,fe),c.FORBID_CONTENTS&&(de===yt&&(de=Fe(de)),G(de,c.FORBID_CONTENTS,fe)),q&&(B["#text"]=!0),z&&G(B,["html","head","body"]),B.table&&(G(B,["tbody"]),delete Te.tbody),c.TRUSTED_TYPES_POLICY){if(typeof c.TRUSTED_TYPES_POLICY.createHTML!="function")throw Rt('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof c.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Rt('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');C=c.TRUSTED_TYPES_POLICY,O=C.createHTML("")}else C===void 0&&(C=yi(m,n)),C!==null&&typeof O=="string"&&(O=C.createHTML(""));ke&&ke(c),dt=c}},Yr=G({},[...$r,...Cr,...ai]),Vr=G({},[...Rr,...li]),Ss=function(c){let A=$(c);(!A||!A.tagName)&&(A={namespaceURI:te,tagName:"template"});let M=Jt(c.tagName),ne=Jt(A.tagName);return qt[c.namespaceURI]?c.namespaceURI===ct?A.namespaceURI===H?M==="svg":A.namespaceURI===qe?M==="svg"&&(ne==="annotation-xml"||jt[ne]):!!Yr[M]:c.namespaceURI===qe?A.namespaceURI===H?M==="math":A.namespaceURI===ct?M==="math"&&Gt[ne]:!!Vr[M]:c.namespaceURI===H?A.namespaceURI===ct&&!Gt[ne]||A.namespaceURI===qe&&!jt[ne]?!1:!Vr[M]&&(_s[M]||!Yr[M]):!!(kt==="application/xhtml+xml"&&qt[c.namespaceURI]):!1},Me=function(c){$t(e.removed,{element:c});try{$(c).removeChild(c)}catch{I(c)}},Qe=function(c,A){try{$t(e.removed,{attribute:A.getAttributeNode(c),from:A})}catch{$t(e.removed,{attribute:null,from:A})}if(A.removeAttribute(c),c==="is")if(Ue||at)try{Me(A)}catch{}else try{A.setAttribute(c,"")}catch{}},Xr=function(c){let A=null,M=null;if(ce)c="<remove></remove>"+c;else{let ae=Er(c,/^[\r\n\t ]+/);M=ae&&ae[0]}kt==="application/xhtml+xml"&&te===H&&(c='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+c+"</body></html>");let ne=C?C.createHTML(c):c;if(te===H)try{A=new f().parseFromString(ne,kt)}catch{}if(!A||!A.documentElement){A=y.createDocument(te,"template",null);try{A.documentElement.innerHTML=je?O:ne}catch{}}let ye=A.body||A.documentElement;return c&&M&&ye.insertBefore(t.createTextNode(M),ye.childNodes[0]||null),te===H?T.call(A,z?"html":"body")[0]:z?A.documentElement:ye},Qr=function(c){return _.call(c.ownerDocument||c,c,p.SHOW_ELEMENT|p.SHOW_COMMENT|p.SHOW_TEXT|p.SHOW_PROCESSING_INSTRUCTION|p.SHOW_CDATA_SECTION,null)},pr=function(c){return c instanceof u&&(typeof c.nodeName!="string"||typeof c.textContent!="string"||typeof c.removeChild!="function"||!(c.attributes instanceof d)||typeof c.removeAttribute!="function"||typeof c.setAttribute!="function"||typeof c.namespaceURI!="string"||typeof c.insertBefore!="function"||typeof c.hasChildNodes!="function")},Jr=function(c){return typeof l=="function"&&c instanceof l};function Oe(F,c,A){Xt(F,M=>{M.call(e,c,A,dt)})}let en=function(c){let A=null;if(Oe(D.beforeSanitizeElements,c,null),pr(c))return Me(c),!0;let M=fe(c.nodeName);if(Oe(D.uponSanitizeElement,c,{tagName:M,allowedTags:B}),w&&c.hasChildNodes()&&!Jr(c.firstElementChild)&&we(/<[/\w!]/g,c.innerHTML)&&we(/<[/\w!]/g,c.textContent)||c.nodeType===Lt.progressingInstruction||w&&c.nodeType===Lt.comment&&we(/<[/\w]/g,c.data))return Me(c),!0;if(!(Ee.tagCheck instanceof Function&&Ee.tagCheck(M))&&(!B[M]||Te[M])){if(!Te[M]&&rn(M)&&(X.tagNameCheck instanceof RegExp&&we(X.tagNameCheck,M)||X.tagNameCheck instanceof Function&&X.tagNameCheck(M)))return!1;if(q&&!de[M]){let ne=$(c)||c.parentNode,ye=P(c)||c.childNodes;if(ye&&ne){let ae=ye.length;for(let ve=ae-1;ve>=0;--ve){let Pe=k(ye[ve],!0);Pe.__removalCount=(c.__removalCount||0)+1,ne.insertBefore(Pe,S(c))}}}return Me(c),!0}return c instanceof o&&!Ss(c)||(M==="noscript"||M==="noembed"||M==="noframes")&&we(/<\/no(script|embed|frames)/i,c.innerHTML)?(Me(c),!0):(g&&c.nodeType===Lt.text&&(A=c.textContent,Xt([U,W,Z],ne=>{A=Ct(A,ne," ")}),c.textContent!==A&&($t(e.removed,{element:c.cloneNode()}),c.textContent=A)),Oe(D.afterSanitizeElements,c,null),!1)},tn=function(c,A,M){if(Bt&&(A==="id"||A==="name")&&(M in t||M in As))return!1;if(!(He&&!Re[A]&&we(K,A))){if(!(Be&&we(j,A))){if(!(Ee.attributeCheck instanceof Function&&Ee.attributeCheck(A,c))){if(!ee[A]||Re[A]){if(!(rn(c)&&(X.tagNameCheck instanceof RegExp&&we(X.tagNameCheck,c)||X.tagNameCheck instanceof Function&&X.tagNameCheck(c))&&(X.attributeNameCheck instanceof RegExp&&we(X.attributeNameCheck,A)||X.attributeNameCheck instanceof Function&&X.attributeNameCheck(A,c))||A==="is"&&X.allowCustomizedBuiltInElements&&(X.tagNameCheck instanceof RegExp&&we(X.tagNameCheck,M)||X.tagNameCheck instanceof Function&&X.tagNameCheck(M))))return!1}else if(!wt[A]){if(!we(ue,Ct(M,ie,""))){if(!((A==="src"||A==="xlink:href"||A==="href")&&c!=="script"&&ni(M,"data:")===0&&pe[c])){if(!(Xe&&!we(re,Ct(M,ie,"")))){if(M)return!1}}}}}}}return!0},rn=function(c){return c!=="annotation-xml"&&Er(c,he)},nn=function(c){Oe(D.beforeSanitizeAttributes,c,null);let{attributes:A}=c;if(!A||pr(c))return;let M={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ee,forceKeepAttr:void 0},ne=A.length;for(;ne--;){let ye=A[ne],{name:ae,namespaceURI:ve,value:Pe}=ye,ut=fe(ae),fr=Pe,me=ae==="value"?fr:si(fr);if(M.attrName=ut,M.attrValue=me,M.keepAttr=!0,M.forceKeepAttr=void 0,Oe(D.uponSanitizeAttribute,c,M),me=M.attrValue,h&&(ut==="id"||ut==="name")&&(Qe(ae,c),me=N+me),w&&we(/((--!?|])>)|<\/(style|title|textarea)/i,me)){Qe(ae,c);continue}if(ut==="attributename"&&Er(me,"href")){Qe(ae,c);continue}if(M.forceKeepAttr)continue;if(!M.keepAttr){Qe(ae,c);continue}if(!x&&we(/\/>/i,me)){Qe(ae,c);continue}g&&Xt([U,W,Z],on=>{me=Ct(me,on," ")});let sn=fe(c.nodeName);if(!tn(sn,ut,me)){Qe(ae,c);continue}if(C&&typeof m=="object"&&typeof m.getAttributeType=="function"&&!ve)switch(m.getAttributeType(sn,ut)){case"TrustedHTML":{me=C.createHTML(me);break}case"TrustedScriptURL":{me=C.createScriptURL(me);break}}if(me!==fr)try{ve?c.setAttributeNS(ve,ae,me):c.setAttribute(ae,me),pr(c)?Me(c):Ln(e.removed)}catch{Qe(ae,c)}}Oe(D.afterSanitizeAttributes,c,null)},Ts=function F(c){let A=null,M=Qr(c);for(Oe(D.beforeSanitizeShadowDOM,c,null);A=M.nextNode();)Oe(D.uponSanitizeShadowNode,A,null),en(A),nn(A),A.content instanceof i&&F(A.content);Oe(D.afterSanitizeShadowDOM,c,null)};return e.sanitize=function(F){let c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},A=null,M=null,ne=null,ye=null;if(je=!F,je&&(F="<!-->"),typeof F!="string"&&!Jr(F))if(typeof F.toString=="function"){if(F=F.toString(),typeof F!="string")throw Rt("dirty is not a string, aborting")}else throw Rt("toString is not a function");if(!e.isSupported)return F;if(le||ur(c),e.removed=[],typeof F=="string"&&(R=!1),R){if(F.nodeName){let Pe=fe(F.nodeName);if(!B[Pe]||Te[Pe])throw Rt("root node is forbidden and cannot be sanitized in-place")}}else if(F instanceof l)A=Xr("<!---->"),M=A.ownerDocument.importNode(F,!0),M.nodeType===Lt.element&&M.nodeName==="BODY"||M.nodeName==="HTML"?A=M:A.appendChild(M);else{if(!Ue&&!g&&!z&&F.indexOf("<")===-1)return C&<?C.createHTML(F):F;if(A=Xr(F),!A)return Ue?null:lt?O:""}A&&ce&&Me(A.firstChild);let ae=Qr(R?F:A);for(;ne=ae.nextNode();)en(ne),nn(ne),ne.content instanceof i&&Ts(ne.content);if(R)return F;if(Ue){if(at)for(ye=b.call(A.ownerDocument);A.firstChild;)ye.appendChild(A.firstChild);else ye=A;return(ee.shadowroot||ee.shadowrootmode)&&(ye=E.call(s,ye,!0)),ye}let ve=z?A.outerHTML:A.innerHTML;return z&&B["!doctype"]&&A.ownerDocument&&A.ownerDocument.doctype&&A.ownerDocument.doctype.name&&we(Hn,A.ownerDocument.doctype.name)&&(ve="<!DOCTYPE "+A.ownerDocument.doctype.name+`>
|
|
71
|
-
`+
|
|
72
|
-
]`).replace("lheading",
|
|
73
|
-
`).map(i=>{let
|
|
74
|
-
`)}var
|
|
75
|
-
`)}}}fences(r){let e=this.rules.block.fences.exec(r);if(e){let t=e[0],s=eo(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(r){let e=this.rules.block.heading.exec(r);if(e){let t=e[2].trim();if(this.rules.other.endingHash.test(t)){let s=
|
|
76
|
-
`)}}blockquote(r){let e=this.rules.block.blockquote.exec(r);if(e){let t=
|
|
70
|
+
`}function A(){Te(x(),r),P()}function P(){try{let k=Array.from(r.querySelectorAll(".board-column"));for(let b of k){let S=b.querySelector(".board-column__body");if(!S)continue;let T=Array.from(S.querySelectorAll(".board-card")),N=b.querySelector(".board-column__header"),q=N&&N.textContent?.trim()||"";for(let W of T){let Z=W.querySelector(".board-card__title"),Y=Z&&Z.textContent?.trim()||"";W.setAttribute("aria-label",`Issue ${Y||"(no title)"} \u2014 Column ${q}`),W.tabIndex=-1}T.length>0&&(T[0].tabIndex=0)}}catch{}}r.addEventListener("keydown",k=>{let b=k.target;if(!b||!(b instanceof HTMLElement))return;let S=String(b.tagName||"").toLowerCase();if(S==="input"||S==="textarea"||S==="select"||b.isContentEditable===!0)return;let T=b.closest(".board-card");if(!T)return;let N=String(k.key||"");if(N==="Enter"||N===" "){k.preventDefault();let j=T.getAttribute("data-issue-id");j&&t(j);return}if(N!=="ArrowUp"&&N!=="ArrowDown"&&N!=="ArrowLeft"&&N!=="ArrowRight")return;k.preventDefault();let q=T.closest(".board-column");if(!q)return;let W=q.querySelector(".board-column__body");if(!W)return;let Z=Array.from(W.querySelectorAll(".board-card")),Y=Z.indexOf(T);if(Y!==-1){if(N==="ArrowDown"&&Y<Z.length-1){$(Z[Y],Z[Y+1]);return}if(N==="ArrowUp"&&Y>0){$(Z[Y],Z[Y-1]);return}if(N==="ArrowRight"||N==="ArrowLeft"){let j=Array.from(r.querySelectorAll(".board-column")),re=j.indexOf(q);if(re===-1)return;let ne=N==="ArrowRight"?1:-1,ge=re+ne,me=null;for(;ge>=0&&ge<j.length;){let B=j[ge],pe=B.querySelector(".board-column__body");if((pe?Array.from(pe.querySelectorAll(".board-card")):[]).length>0){me=B;break}ge+=ne}if(me){let B=me.querySelector(".board-column__body .board-card");B&&$(T,B)}return}}});function $(k,b){try{k.tabIndex=-1,b.tabIndex=0,b.focus()}catch{}}function E(){o("applyClosedFilter %s",m);let k=Array.isArray(u)?[...u]:[],b=new Date,S=0;m==="today"?S=new Date(b.getFullYear(),b.getMonth(),b.getDate(),0,0,0,0).getTime():m==="3"?S=b.getTime()-4320*60*1e3:m==="7"&&(S=b.getTime()-10080*60*1e3),k=k.filter(T=>{let N=Number.isFinite(T.closed_at)?T.closed_at:NaN;return Number.isFinite(N)?N>=S:!1}),k.sort(kt),d=k}function O(k){try{let b=k.target,S=String(b.value||"today");if(m=S==="3"||S==="7"?S:"today",o("closed filter %s",m),s)try{s.setState({board:{closed_filter:m}})}catch{}E(),A()}catch{}}function w(){try{if(h){let k=h.selectBoardColumn("tab:board:in-progress","in_progress"),b=h.selectBoardColumn("tab:board:blocked","blocked"),S=h.selectBoardColumn("tab:board:ready","ready"),T=h.selectBoardColumn("tab:board:closed","closed"),N=new Set(k.map(W=>W.id));l=S.filter(W=>!N.has(W.id)),a=b,p=k,u=T}E(),A()}catch{l=[],a=[],p=[],d=[],A()}}return h&&h.subscribe(()=>{try{w()}catch{}}),{async load(){o("load"),w();try{let k=!!(n&&n.selectors),b=q=>{if(!k||!n)return 0;let W=n.selectors;if(typeof W.count=="function")return Number(W.count(q)||0);try{let Z=W.getIds(q);return Array.isArray(Z)?Z.length:0}catch{return 0}},S=b("tab:board:ready")+b("tab:board:blocked")+b("tab:board:in-progress")+b("tab:board:closed"),T=e,N=T&&typeof T.getReady=="function"&&typeof T.getBlocked=="function"&&typeof T.getInProgress=="function"&&typeof T.getClosed=="function";if(S===0&&N){o("fallback fetch");let[q,W,Z,Y]=await Promise.all([T.getReady().catch(()=>[]),T.getBlocked().catch(()=>[]),T.getInProgress().catch(()=>[]),T.getClosed().catch(()=>[])]),j=Array.isArray(q)?q.map(B=>B):[],re=Array.isArray(W)?W.map(B=>B):[],ne=Array.isArray(Z)?Z.map(B=>B):[],ge=Array.isArray(Y)?Y.map(B=>B):[],me=new Set(ne.map(B=>B.id));j=j.filter(B=>!me.has(B.id)),j.sort(Le),re.sort(Le),ne.sort(Le),l=j,a=re,p=ne,u=ge,E(),A()}}catch{}},clear(){r.replaceChildren(),l=[],a=[],p=[],d=[]}}}var{entries:qn,setPrototypeOf:Mn,isFrozen:Qs,getPrototypeOf:Js,getOwnPropertyDescriptor:ei}=Object,{freeze:_e,seal:Ee,create:Mr}=Object,{apply:Or,construct:Pr}=typeof Reflect<"u"&&Reflect;_e||(_e=function(e){return e});Ee||(Ee=function(e){return e});Or||(Or=function(e,t){for(var s=arguments.length,n=new Array(s>2?s-2:0),i=2;i<s;i++)n[i-2]=arguments[i];return e.apply(t,n)});Pr||(Pr=function(e){for(var t=arguments.length,s=new Array(t>1?t-1:0),n=1;n<t;n++)s[n-1]=arguments[n];return new e(...s)});var Qt=xe(Array.prototype.forEach),ti=xe(Array.prototype.lastIndexOf),On=xe(Array.prototype.pop),Dt=xe(Array.prototype.push),ri=xe(Array.prototype.splice),er=xe(String.prototype.toLowerCase),Cr=xe(String.prototype.toString),Rr=xe(String.prototype.match),Nt=xe(String.prototype.replace),ni=xe(String.prototype.indexOf),si=xe(String.prototype.trim),De=xe(Object.prototype.hasOwnProperty),ke=xe(RegExp.prototype.test),Mt=ii(TypeError);function xe(r){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var t=arguments.length,s=new Array(t>1?t-1:0),n=1;n<t;n++)s[n-1]=arguments[n];return Or(r,e,s)}}function ii(r){return function(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];return Pr(r,t)}}function G(r,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:er;Mn&&Mn(r,null);let s=e.length;for(;s--;){let n=e[s];if(typeof n=="string"){let i=t(n);i!==n&&(Qs(e)||(e[s]=i),n=i)}r[n]=!0}return r}function oi(r){for(let e=0;e<r.length;e++)De(r,e)||(r[e]=null);return r}function He(r){let e=Mr(null);for(let[t,s]of qn(r))De(r,t)&&(Array.isArray(s)?e[t]=oi(s):s&&typeof s=="object"&&s.constructor===Object?e[t]=He(s):e[t]=s);return e}function Ot(r,e){for(;r!==null;){let s=ei(r,e);if(s){if(s.get)return xe(s.get);if(typeof s.value=="function")return xe(s.value)}r=Js(r)}function t(){return null}return t}var Pn=_e(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Ir=_e(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Lr=_e(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),ai=_e(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Dr=_e(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),li=_e(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Fn=_e(["#text"]),zn=_e(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Nr=_e(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Bn=_e(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Jt=_e(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),ci=Ee(/\{\{[\w\W]*|[\w\W]*\}\}/gm),di=Ee(/<%[\w\W]*|[\w\W]*%>/gm),ui=Ee(/\$\{[\w\W]*/gm),pi=Ee(/^data-[\-\w.\u00B7-\uFFFF]+$/),fi=Ee(/^aria-[\-\w]+$/),jn=Ee(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),hi=Ee(/^(?:\w+script|data):/i),gi=Ee(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Gn=Ee(/^html$/i),mi=Ee(/^[a-z][.\w]*(-[.\w]+)+$/i),Hn=Object.freeze({__proto__:null,ARIA_ATTR:fi,ATTR_WHITESPACE:gi,CUSTOM_ELEMENT:mi,DATA_ATTR:pi,DOCTYPE_NAME:Gn,ERB_EXPR:di,IS_ALLOWED_URI:jn,IS_SCRIPT_OR_DATA:hi,MUSTACHE_EXPR:ci,TMPLIT_EXPR:ui}),Pt={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},bi=function(){return typeof window>"u"?null:window},yi=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let s=null,n="data-tt-policy-suffix";t&&t.hasAttribute(n)&&(s=t.getAttribute(n));let i="dompurify"+(s?"#"+s:"");try{return e.createPolicy(i,{createHTML(o){return o},createScriptURL(o){return o}})}catch{return console.warn("TrustedTypes policy "+i+" could not be created."),null}},Un=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Wn(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:bi(),e=F=>Wn(F);if(e.version="3.3.0",e.removed=[],!r||!r.document||r.document.nodeType!==Pt.document||!r.Element)return e.isSupported=!1,e;let{document:t}=r,s=t,n=s.currentScript,{DocumentFragment:i,HTMLTemplateElement:o,Node:l,Element:a,NodeFilter:p,NamedNodeMap:d=r.NamedNodeMap||r.MozNamedAttrMap,HTMLFormElement:u,DOMParser:h,trustedTypes:m}=r,x=a.prototype,y=Ot(x,"cloneNode"),C=Ot(x,"remove"),A=Ot(x,"nextSibling"),P=Ot(x,"childNodes"),$=Ot(x,"parentNode");if(typeof o=="function"){let F=t.createElement("template");F.content&&F.content.ownerDocument&&(t=F.content.ownerDocument)}let E,O="",{implementation:w,createNodeIterator:k,createDocumentFragment:b,getElementsByTagName:S}=t,{importNode:T}=s,N=Un();e.isSupported=typeof qn=="function"&&typeof $=="function"&&w&&w.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:q,ERB_EXPR:W,TMPLIT_EXPR:Z,DATA_ATTR:Y,ARIA_ATTR:j,IS_SCRIPT_OR_DATA:re,ATTR_WHITESPACE:ne,CUSTOM_ELEMENT:ge}=Hn,{IS_ALLOWED_URI:me}=Hn,B=null,pe=G({},[...Pn,...Ir,...Lr,...Dr,...Fn]),te=null,Oe=G({},[...zn,...Nr,...Bn,...Jt]),Q=Object.seal(Mr(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Ae=null,Ce=null,Re=Object.seal(Mr(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),qe=!0,Fe=!0,Je=!1,_=!0,g=!1,H=!0,z=!1,ue=!1,le=!1,je=!1,D=!1,ft=!1,Gt=!0,Wt=!1,pr="user-content-",At=!0,et=!1,Ge={},f=null,R=G({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),U=null,I=G({},["audio","video","img","source","image","track"]),ee=null,we=G({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),tt="http://www.w3.org/1998/Math/MathML",ce="http://www.w3.org/2000/svg",Ie="http://www.w3.org/1999/xhtml",We=Ie,St=!1,rt=null,fr=G({},[tt,ce,Ie],Cr),nt=G({},["mi","mo","mn","ms","mtext"]),ht=G({},["annotation-xml"]),K=G({},["title","style","font","a","script"]),se=null,gt=["application/xhtml+xml","text/html"],Xr="text/html",fe=null,mt=null,As=t.createElement("form"),Qr=function(c){return c instanceof RegExp||c instanceof Function},hr=function(){let c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(mt&&mt===c)){if((!c||typeof c!="object")&&(c={}),c=He(c),se=gt.indexOf(c.PARSER_MEDIA_TYPE)===-1?Xr:c.PARSER_MEDIA_TYPE,fe=se==="application/xhtml+xml"?Cr:er,B=De(c,"ALLOWED_TAGS")?G({},c.ALLOWED_TAGS,fe):pe,te=De(c,"ALLOWED_ATTR")?G({},c.ALLOWED_ATTR,fe):Oe,rt=De(c,"ALLOWED_NAMESPACES")?G({},c.ALLOWED_NAMESPACES,Cr):fr,ee=De(c,"ADD_URI_SAFE_ATTR")?G(He(we),c.ADD_URI_SAFE_ATTR,fe):we,U=De(c,"ADD_DATA_URI_TAGS")?G(He(I),c.ADD_DATA_URI_TAGS,fe):I,f=De(c,"FORBID_CONTENTS")?G({},c.FORBID_CONTENTS,fe):R,Ae=De(c,"FORBID_TAGS")?G({},c.FORBID_TAGS,fe):He({}),Ce=De(c,"FORBID_ATTR")?G({},c.FORBID_ATTR,fe):He({}),Ge=De(c,"USE_PROFILES")?c.USE_PROFILES:!1,qe=c.ALLOW_ARIA_ATTR!==!1,Fe=c.ALLOW_DATA_ATTR!==!1,Je=c.ALLOW_UNKNOWN_PROTOCOLS||!1,_=c.ALLOW_SELF_CLOSE_IN_ATTR!==!1,g=c.SAFE_FOR_TEMPLATES||!1,H=c.SAFE_FOR_XML!==!1,z=c.WHOLE_DOCUMENT||!1,je=c.RETURN_DOM||!1,D=c.RETURN_DOM_FRAGMENT||!1,ft=c.RETURN_TRUSTED_TYPE||!1,le=c.FORCE_BODY||!1,Gt=c.SANITIZE_DOM!==!1,Wt=c.SANITIZE_NAMED_PROPS||!1,At=c.KEEP_CONTENT!==!1,et=c.IN_PLACE||!1,me=c.ALLOWED_URI_REGEXP||jn,We=c.NAMESPACE||Ie,nt=c.MATHML_TEXT_INTEGRATION_POINTS||nt,ht=c.HTML_INTEGRATION_POINTS||ht,Q=c.CUSTOM_ELEMENT_HANDLING||{},c.CUSTOM_ELEMENT_HANDLING&&Qr(c.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Q.tagNameCheck=c.CUSTOM_ELEMENT_HANDLING.tagNameCheck),c.CUSTOM_ELEMENT_HANDLING&&Qr(c.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Q.attributeNameCheck=c.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),c.CUSTOM_ELEMENT_HANDLING&&typeof c.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(Q.allowCustomizedBuiltInElements=c.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),g&&(Fe=!1),D&&(je=!0),Ge&&(B=G({},Fn),te=[],Ge.html===!0&&(G(B,Pn),G(te,zn)),Ge.svg===!0&&(G(B,Ir),G(te,Nr),G(te,Jt)),Ge.svgFilters===!0&&(G(B,Lr),G(te,Nr),G(te,Jt)),Ge.mathMl===!0&&(G(B,Dr),G(te,Bn),G(te,Jt))),c.ADD_TAGS&&(typeof c.ADD_TAGS=="function"?Re.tagCheck=c.ADD_TAGS:(B===pe&&(B=He(B)),G(B,c.ADD_TAGS,fe))),c.ADD_ATTR&&(typeof c.ADD_ATTR=="function"?Re.attributeCheck=c.ADD_ATTR:(te===Oe&&(te=He(te)),G(te,c.ADD_ATTR,fe))),c.ADD_URI_SAFE_ATTR&&G(ee,c.ADD_URI_SAFE_ATTR,fe),c.FORBID_CONTENTS&&(f===R&&(f=He(f)),G(f,c.FORBID_CONTENTS,fe)),At&&(B["#text"]=!0),z&&G(B,["html","head","body"]),B.table&&(G(B,["tbody"]),delete Ae.tbody),c.TRUSTED_TYPES_POLICY){if(typeof c.TRUSTED_TYPES_POLICY.createHTML!="function")throw Mt('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof c.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Mt('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');E=c.TRUSTED_TYPES_POLICY,O=E.createHTML("")}else E===void 0&&(E=yi(m,n)),E!==null&&typeof O=="string"&&(O=E.createHTML(""));_e&&_e(c),mt=c}},Jr=G({},[...Ir,...Lr,...ai]),en=G({},[...Dr,...li]),Ss=function(c){let v=$(c);(!v||!v.tagName)&&(v={namespaceURI:We,tagName:"template"});let M=er(c.tagName),ie=er(v.tagName);return rt[c.namespaceURI]?c.namespaceURI===ce?v.namespaceURI===Ie?M==="svg":v.namespaceURI===tt?M==="svg"&&(ie==="annotation-xml"||nt[ie]):!!Jr[M]:c.namespaceURI===tt?v.namespaceURI===Ie?M==="math":v.namespaceURI===ce?M==="math"&&ht[ie]:!!en[M]:c.namespaceURI===Ie?v.namespaceURI===ce&&!ht[ie]||v.namespaceURI===tt&&!nt[ie]?!1:!en[M]&&(K[M]||!Jr[M]):!!(se==="application/xhtml+xml"&&rt[c.namespaceURI]):!1},Pe=function(c){Dt(e.removed,{element:c});try{$(c).removeChild(c)}catch{C(c)}},st=function(c,v){try{Dt(e.removed,{attribute:v.getAttributeNode(c),from:v})}catch{Dt(e.removed,{attribute:null,from:v})}if(v.removeAttribute(c),c==="is")if(je||D)try{Pe(v)}catch{}else try{v.setAttribute(c,"")}catch{}},tn=function(c){let v=null,M=null;if(le)c="<remove></remove>"+c;else{let de=Rr(c,/^[\r\n\t ]+/);M=de&&de[0]}se==="application/xhtml+xml"&&We===Ie&&(c='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+c+"</body></html>");let ie=E?E.createHTML(c):c;if(We===Ie)try{v=new h().parseFromString(ie,se)}catch{}if(!v||!v.documentElement){v=w.createDocument(We,"template",null);try{v.documentElement.innerHTML=St?O:ie}catch{}}let ye=v.body||v.documentElement;return c&&M&&ye.insertBefore(t.createTextNode(M),ye.childNodes[0]||null),We===Ie?S.call(v,z?"html":"body")[0]:z?v.documentElement:ye},rn=function(c){return k.call(c.ownerDocument||c,c,p.SHOW_ELEMENT|p.SHOW_COMMENT|p.SHOW_TEXT|p.SHOW_PROCESSING_INSTRUCTION|p.SHOW_CDATA_SECTION,null)},gr=function(c){return c instanceof u&&(typeof c.nodeName!="string"||typeof c.textContent!="string"||typeof c.removeChild!="function"||!(c.attributes instanceof d)||typeof c.removeAttribute!="function"||typeof c.setAttribute!="function"||typeof c.namespaceURI!="string"||typeof c.insertBefore!="function"||typeof c.hasChildNodes!="function")},nn=function(c){return typeof l=="function"&&c instanceof l};function ze(F,c,v){Qt(F,M=>{M.call(e,c,v,mt)})}let sn=function(c){let v=null;if(ze(N.beforeSanitizeElements,c,null),gr(c))return Pe(c),!0;let M=fe(c.nodeName);if(ze(N.uponSanitizeElement,c,{tagName:M,allowedTags:B}),H&&c.hasChildNodes()&&!nn(c.firstElementChild)&&ke(/<[/\w!]/g,c.innerHTML)&&ke(/<[/\w!]/g,c.textContent)||c.nodeType===Pt.progressingInstruction||H&&c.nodeType===Pt.comment&&ke(/<[/\w]/g,c.data))return Pe(c),!0;if(!(Re.tagCheck instanceof Function&&Re.tagCheck(M))&&(!B[M]||Ae[M])){if(!Ae[M]&&an(M)&&(Q.tagNameCheck instanceof RegExp&&ke(Q.tagNameCheck,M)||Q.tagNameCheck instanceof Function&&Q.tagNameCheck(M)))return!1;if(At&&!f[M]){let ie=$(c)||c.parentNode,ye=P(c)||c.childNodes;if(ye&&ie){let de=ye.length;for(let Se=de-1;Se>=0;--Se){let Be=y(ye[Se],!0);Be.__removalCount=(c.__removalCount||0)+1,ie.insertBefore(Be,A(c))}}}return Pe(c),!0}return c instanceof a&&!Ss(c)||(M==="noscript"||M==="noembed"||M==="noframes")&&ke(/<\/no(script|embed|frames)/i,c.innerHTML)?(Pe(c),!0):(g&&c.nodeType===Pt.text&&(v=c.textContent,Qt([q,W,Z],ie=>{v=Nt(v,ie," ")}),c.textContent!==v&&(Dt(e.removed,{element:c.cloneNode()}),c.textContent=v)),ze(N.afterSanitizeElements,c,null),!1)},on=function(c,v,M){if(Gt&&(v==="id"||v==="name")&&(M in t||M in As))return!1;if(!(Fe&&!Ce[v]&&ke(Y,v))){if(!(qe&&ke(j,v))){if(!(Re.attributeCheck instanceof Function&&Re.attributeCheck(v,c))){if(!te[v]||Ce[v]){if(!(an(c)&&(Q.tagNameCheck instanceof RegExp&&ke(Q.tagNameCheck,c)||Q.tagNameCheck instanceof Function&&Q.tagNameCheck(c))&&(Q.attributeNameCheck instanceof RegExp&&ke(Q.attributeNameCheck,v)||Q.attributeNameCheck instanceof Function&&Q.attributeNameCheck(v,c))||v==="is"&&Q.allowCustomizedBuiltInElements&&(Q.tagNameCheck instanceof RegExp&&ke(Q.tagNameCheck,M)||Q.tagNameCheck instanceof Function&&Q.tagNameCheck(M))))return!1}else if(!ee[v]){if(!ke(me,Nt(M,ne,""))){if(!((v==="src"||v==="xlink:href"||v==="href")&&c!=="script"&&ni(M,"data:")===0&&U[c])){if(!(Je&&!ke(re,Nt(M,ne,"")))){if(M)return!1}}}}}}}return!0},an=function(c){return c!=="annotation-xml"&&Rr(c,ge)},ln=function(c){ze(N.beforeSanitizeAttributes,c,null);let{attributes:v}=c;if(!v||gr(c))return;let M={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:te,forceKeepAttr:void 0},ie=v.length;for(;ie--;){let ye=v[ie],{name:de,namespaceURI:Se,value:Be}=ye,bt=fe(de),mr=Be,be=de==="value"?mr:si(mr);if(M.attrName=bt,M.attrValue=be,M.keepAttr=!0,M.forceKeepAttr=void 0,ze(N.uponSanitizeAttribute,c,M),be=M.attrValue,Wt&&(bt==="id"||bt==="name")&&(st(de,c),be=pr+be),H&&ke(/((--!?|])>)|<\/(style|title|textarea)/i,be)){st(de,c);continue}if(bt==="attributename"&&Rr(be,"href")){st(de,c);continue}if(M.forceKeepAttr)continue;if(!M.keepAttr){st(de,c);continue}if(!_&&ke(/\/>/i,be)){st(de,c);continue}g&&Qt([q,W,Z],dn=>{be=Nt(be,dn," ")});let cn=fe(c.nodeName);if(!on(cn,bt,be)){st(de,c);continue}if(E&&typeof m=="object"&&typeof m.getAttributeType=="function"&&!Se)switch(m.getAttributeType(cn,bt)){case"TrustedHTML":{be=E.createHTML(be);break}case"TrustedScriptURL":{be=E.createScriptURL(be);break}}if(be!==mr)try{Se?c.setAttributeNS(Se,de,be):c.setAttribute(de,be),gr(c)?Pe(c):On(e.removed)}catch{st(de,c)}}ze(N.afterSanitizeAttributes,c,null)},Ts=function F(c){let v=null,M=rn(c);for(ze(N.beforeSanitizeShadowDOM,c,null);v=M.nextNode();)ze(N.uponSanitizeShadowNode,v,null),sn(v),ln(v),v.content instanceof i&&F(v.content);ze(N.afterSanitizeShadowDOM,c,null)};return e.sanitize=function(F){let c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},v=null,M=null,ie=null,ye=null;if(St=!F,St&&(F="<!-->"),typeof F!="string"&&!nn(F))if(typeof F.toString=="function"){if(F=F.toString(),typeof F!="string")throw Mt("dirty is not a string, aborting")}else throw Mt("toString is not a function");if(!e.isSupported)return F;if(ue||hr(c),e.removed=[],typeof F=="string"&&(et=!1),et){if(F.nodeName){let Be=fe(F.nodeName);if(!B[Be]||Ae[Be])throw Mt("root node is forbidden and cannot be sanitized in-place")}}else if(F instanceof l)v=tn("<!---->"),M=v.ownerDocument.importNode(F,!0),M.nodeType===Pt.element&&M.nodeName==="BODY"||M.nodeName==="HTML"?v=M:v.appendChild(M);else{if(!je&&!g&&!z&&F.indexOf("<")===-1)return E&&ft?E.createHTML(F):F;if(v=tn(F),!v)return je?null:ft?O:""}v&&le&&Pe(v.firstChild);let de=rn(et?F:v);for(;ie=de.nextNode();)sn(ie),ln(ie),ie.content instanceof i&&Ts(ie.content);if(et)return F;if(je){if(D)for(ye=b.call(v.ownerDocument);v.firstChild;)ye.appendChild(v.firstChild);else ye=v;return(te.shadowroot||te.shadowrootmode)&&(ye=T.call(s,ye,!0)),ye}let Se=z?v.outerHTML:v.innerHTML;return z&&B["!doctype"]&&v.ownerDocument&&v.ownerDocument.doctype&&v.ownerDocument.doctype.name&&ke(Gn,v.ownerDocument.doctype.name)&&(Se="<!DOCTYPE "+v.ownerDocument.doctype.name+`>
|
|
71
|
+
`+Se),g&&Qt([q,W,Z],Be=>{Se=Nt(Se,Be," ")}),E&&ft?E.createHTML(Se):Se},e.setConfig=function(){let F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};hr(F),ue=!0},e.clearConfig=function(){mt=null,ue=!1},e.isValidAttribute=function(F,c,v){mt||hr({});let M=fe(F),ie=fe(c);return on(M,ie,v)},e.addHook=function(F,c){typeof c=="function"&&Dt(N[F],c)},e.removeHook=function(F,c){if(c!==void 0){let v=ti(N[F],c);return v===-1?void 0:ri(N[F],v,1)[0]}return On(N[F])},e.removeHooks=function(F){N[F]=[]},e.removeAllHooks=function(){N=Un()},e}var Kn=Wn();var Zn={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Yn=r=>(...e)=>({_$litDirective$:r,values:e}),tr=class{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)}};var Ft=class extends tr{constructor(e){if(super(e),this.it=ae,e.type!==Zn.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===ae||e==null)return this._t=void 0,this.it=e;if(e===lt)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;let t=[e];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}};Ft.directiveName="unsafeHTML",Ft.resultType=1;var Vn=Yn(Ft);function Hr(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var pt=Hr();function ns(r){pt=r}var Ut={exec:()=>null};function V(r,e=""){let t=typeof r=="string"?r:r.source,s={replace:(n,i)=>{let o=typeof i=="string"?i:i.source;return o=o.replace(ve.caret,"$1"),t=t.replace(n,o),s},getRegex:()=>new RegExp(t,e)};return s}var wi=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),ve={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,listReplaceTabs:/^\t+/,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,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:r=>new RegExp(`^( {0,3}${r})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}#`),htmlBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}<(?:[a-z].*>|!--)`,"i")},ki=/^(?:[ \t]*(?:\n|$))+/,_i=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,xi=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,qt=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,vi=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Ur=/(?:[*+-]|\d{1,9}[.)])/,ss=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,is=V(ss).replace(/bull/g,Ur).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Ai=V(ss).replace(/bull/g,Ur).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),qr=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Si=/^[^\n]+/,jr=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Ti=V(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",jr).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),$i=V(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Ur).getRegex(),ar="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",Gr=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Ei=V("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Gr).replace("tag",ar).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),os=V(qr).replace("hr",qt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ar).getRegex(),Ci=V(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",os).getRegex(),Wr={blockquote:Ci,code:_i,def:Ti,fences:xi,heading:vi,hr:qt,html:Ei,lheading:is,list:$i,newline:ki,paragraph:os,table:Ut,text:Si},Xn=V("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",qt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ar).getRegex(),Ri={...Wr,lheading:Ai,table:Xn,paragraph:V(qr).replace("hr",qt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Xn).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ar).getRegex()},Ii={...Wr,html:V(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Gr).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:Ut,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:V(qr).replace("hr",qt).replace("heading",` *#{1,6} *[^
|
|
72
|
+
]`).replace("lheading",is).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Li=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Di=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,as=/^( {2,}|\\)\n(?!\s*$)/,Ni=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,lr=/[\p{P}\p{S}]/u,Kr=/[\s\p{P}\p{S}]/u,ls=/[^\s\p{P}\p{S}]/u,Mi=V(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Kr).getRegex(),cs=/(?!~)[\p{P}\p{S}]/u,Oi=/(?!~)[\s\p{P}\p{S}]/u,Pi=/(?:[^\s\p{P}\p{S}]|~)/u,Fi=V(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",wi?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),ds=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,zi=V(ds,"u").replace(/punct/g,lr).getRegex(),Bi=V(ds,"u").replace(/punct/g,cs).getRegex(),us="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Hi=V(us,"gu").replace(/notPunctSpace/g,ls).replace(/punctSpace/g,Kr).replace(/punct/g,lr).getRegex(),Ui=V(us,"gu").replace(/notPunctSpace/g,Pi).replace(/punctSpace/g,Oi).replace(/punct/g,cs).getRegex(),qi=V("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,ls).replace(/punctSpace/g,Kr).replace(/punct/g,lr).getRegex(),ji=V(/\\(punct)/,"gu").replace(/punct/g,lr).getRegex(),Gi=V(/^<(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(),Wi=V(Gr).replace("(?:-->|$)","-->").getRegex(),Ki=V("^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",Wi).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),sr=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,Zi=V(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",sr).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),ps=V(/^!?\[(label)\]\[(ref)\]/).replace("label",sr).replace("ref",jr).getRegex(),fs=V(/^!?\[(ref)\](?:\[\])?/).replace("ref",jr).getRegex(),Yi=V("reflink|nolink(?!\\()","g").replace("reflink",ps).replace("nolink",fs).getRegex(),Qn=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Zr={_backpedal:Ut,anyPunctuation:ji,autolink:Gi,blockSkip:Fi,br:as,code:Di,del:Ut,emStrongLDelim:zi,emStrongRDelimAst:Hi,emStrongRDelimUnd:qi,escape:Li,link:Zi,nolink:fs,punctuation:Mi,reflink:ps,reflinkSearch:Yi,tag:Ki,text:Ni,url:Ut},Vi={...Zr,link:V(/^!?\[(label)\]\((.*?)\)/).replace("label",sr).getRegex(),reflink:V(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",sr).getRegex()},Fr={...Zr,emStrongRDelimAst:Ui,emStrongLDelim:Bi,url:V(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Qn).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:V(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Qn).getRegex()},Xi={...Fr,br:V(as).replace("{2,}","*").getRegex(),text:V(Fr.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},rr={normal:Wr,gfm:Ri,pedantic:Ii},zt={normal:Zr,gfm:Fr,breaks:Xi,pedantic:Vi},Qi={"&":"&","<":"<",">":">",'"':""","'":"'"},Jn=r=>Qi[r];function Ue(r,e){if(e){if(ve.escapeTest.test(r))return r.replace(ve.escapeReplace,Jn)}else if(ve.escapeTestNoEncode.test(r))return r.replace(ve.escapeReplaceNoEncode,Jn);return r}function es(r){try{r=encodeURI(r).replace(ve.percentDecode,"%")}catch{return null}return r}function ts(r,e){let t=r.replace(ve.findPipe,(i,o,l)=>{let a=!1,p=o;for(;--p>=0&&l[p]==="\\";)a=!a;return a?"|":" |"}),s=t.split(ve.splitPipe),n=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(;n<s.length;n++)s[n]=s[n].trim().replace(ve.slashPipe,"|");return s}function Bt(r,e,t){let s=r.length;if(s===0)return"";let n=0;for(;n<s;){let i=r.charAt(s-n-1);if(i===e&&!t)n++;else if(i!==e&&t)n++;else break}return r.slice(0,s-n)}function Ji(r,e){if(r.indexOf(e[1])===-1)return-1;let t=0;for(let s=0;s<r.length;s++)if(r[s]==="\\")s++;else if(r[s]===e[0])t++;else if(r[s]===e[1]&&(t--,t<0))return s;return t>0?-2:-1}function rs(r,e,t,s,n){let i=e.href,o=e.title||null,l=r[1].replace(n.other.outputLinkReplace,"$1");s.state.inLink=!0;let a={type:r[0].charAt(0)==="!"?"image":"link",raw:t,href:i,title:o,text:l,tokens:s.inlineTokens(l)};return s.state.inLink=!1,a}function eo(r,e,t){let s=r.match(t.other.indentCodeCompensation);if(s===null)return e;let n=s[1];return e.split(`
|
|
73
|
+
`).map(i=>{let o=i.match(t.other.beginningSpace);if(o===null)return i;let[l]=o;return l.length>=n.length?i.slice(n.length):i}).join(`
|
|
74
|
+
`)}var ir=class{constructor(r){J(this,"options");J(this,"rules");J(this,"lexer");this.options=r||pt}space(r){let e=this.rules.block.newline.exec(r);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(r){let e=this.rules.block.code.exec(r);if(e){let t=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?t:Bt(t,`
|
|
75
|
+
`)}}}fences(r){let e=this.rules.block.fences.exec(r);if(e){let t=e[0],s=eo(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(r){let e=this.rules.block.heading.exec(r);if(e){let t=e[2].trim();if(this.rules.other.endingHash.test(t)){let s=Bt(t,"#");(this.options.pedantic||!s||this.rules.other.endingSpaceChar.test(s))&&(t=s.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:t,tokens:this.lexer.inline(t)}}}hr(r){let e=this.rules.block.hr.exec(r);if(e)return{type:"hr",raw:Bt(e[0],`
|
|
76
|
+
`)}}blockquote(r){let e=this.rules.block.blockquote.exec(r);if(e){let t=Bt(e[0],`
|
|
77
77
|
`).split(`
|
|
78
|
-
`),s="",n="",i=[];for(;t.length>0;){let
|
|
78
|
+
`),s="",n="",i=[];for(;t.length>0;){let o=!1,l=[],a;for(a=0;a<t.length;a++)if(this.rules.other.blockquoteStart.test(t[a]))l.push(t[a]),o=!0;else if(!o)l.push(t[a]);else break;t=t.slice(a);let p=l.join(`
|
|
79
79
|
`),d=p.replace(this.rules.other.blockquoteSetextReplace,`
|
|
80
80
|
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");s=s?`${s}
|
|
81
81
|
${p}`:p,n=n?`${n}
|
|
82
|
-
${d}`:d;let u=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(d,i,!0),this.lexer.state.top=u,t.length===0)break;let
|
|
82
|
+
${d}`:d;let u=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(d,i,!0),this.lexer.state.top=u,t.length===0)break;let h=i.at(-1);if(h?.type==="code")break;if(h?.type==="blockquote"){let m=h,x=m.raw+`
|
|
83
83
|
`+t.join(`
|
|
84
|
-
`),
|
|
84
|
+
`),y=this.blockquote(x);i[i.length-1]=y,s=s.substring(0,s.length-m.raw.length)+y.raw,n=n.substring(0,n.length-m.text.length)+y.text;break}else if(h?.type==="list"){let m=h,x=m.raw+`
|
|
85
85
|
`+t.join(`
|
|
86
|
-
`),
|
|
87
|
-
`);continue}}return{type:"blockquote",raw:s,tokens:i,text:n}}}list(r){let e=this.rules.block.list.exec(r);if(e){let t=e[1].trim(),s=t.length>1,n={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 i=this.rules.other.listItemRegex(t),
|
|
88
|
-
`,1)[0].replace(this.rules.other.listReplaceTabs,
|
|
89
|
-
`,1)[0],m=!u.trim(),
|
|
90
|
-
`,r=r.substring(
|
|
91
|
-
`,1)[0],O;if(
|
|
92
|
-
`+O.slice(
|
|
93
|
-
`+
|
|
94
|
-
`,r=r.substring(
|
|
95
|
-
`):[],i={type:"table",raw:e[0],header:[],align:[],rows:[]};if(t.length===s.length){for(let
|
|
96
|
-
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:t,tokens:this.lexer.inline(t)}}}text(r){let e=this.rules.block.text.exec(r);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(r){let e=this.rules.inline.escape.exec(r);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(r){let e=this.rules.inline.tag.exec(r);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(r){let e=this.rules.inline.link.exec(r);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 i=
|
|
97
|
-
`),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){for(this.options.pedantic&&(e=e.replace(
|
|
98
|
-
`:t.push(n);continue}if(n=this.tokenizer.code(e)){e=e.substring(n.raw.length);let
|
|
86
|
+
`),y=this.list(x);i[i.length-1]=y,s=s.substring(0,s.length-h.raw.length)+y.raw,n=n.substring(0,n.length-m.raw.length)+y.raw,t=x.substring(i.at(-1).raw.length).split(`
|
|
87
|
+
`);continue}}return{type:"blockquote",raw:s,tokens:i,text:n}}}list(r){let e=this.rules.block.list.exec(r);if(e){let t=e[1].trim(),s=t.length>1,n={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 i=this.rules.other.listItemRegex(t),o=!1;for(;r;){let a=!1,p="",d="";if(!(e=i.exec(r))||this.rules.block.hr.test(r))break;p=e[0],r=r.substring(p.length);let u=e[2].split(`
|
|
88
|
+
`,1)[0].replace(this.rules.other.listReplaceTabs,y=>" ".repeat(3*y.length)),h=r.split(`
|
|
89
|
+
`,1)[0],m=!u.trim(),x=0;if(this.options.pedantic?(x=2,d=u.trimStart()):m?x=e[1].length+1:(x=e[2].search(this.rules.other.nonSpaceChar),x=x>4?1:x,d=u.slice(x),x+=e[1].length),m&&this.rules.other.blankLine.test(h)&&(p+=h+`
|
|
90
|
+
`,r=r.substring(h.length+1),a=!0),!a){let y=this.rules.other.nextBulletRegex(x),C=this.rules.other.hrRegex(x),A=this.rules.other.fencesBeginRegex(x),P=this.rules.other.headingBeginRegex(x),$=this.rules.other.htmlBeginRegex(x);for(;r;){let E=r.split(`
|
|
91
|
+
`,1)[0],O;if(h=E,this.options.pedantic?(h=h.replace(this.rules.other.listReplaceNesting," "),O=h):O=h.replace(this.rules.other.tabCharGlobal," "),A.test(h)||P.test(h)||$.test(h)||y.test(h)||C.test(h))break;if(O.search(this.rules.other.nonSpaceChar)>=x||!h.trim())d+=`
|
|
92
|
+
`+O.slice(x);else{if(m||u.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||A.test(u)||P.test(u)||C.test(u))break;d+=`
|
|
93
|
+
`+h}!m&&!h.trim()&&(m=!0),p+=E+`
|
|
94
|
+
`,r=r.substring(E.length+1),u=O.slice(x)}}n.loose||(o?n.loose=!0:this.rules.other.doubleBlankLine.test(p)&&(o=!0)),n.items.push({type:"list_item",raw:p,task:!!this.options.gfm&&this.rules.other.listIsTask.test(d),loose:!1,text:d,tokens:[]}),n.raw+=p}let l=n.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;n.raw=n.raw.trimEnd();for(let a of n.items){if(this.lexer.state.top=!1,a.tokens=this.lexer.blockTokens(a.text,[]),a.task){if(a.text=a.text.replace(this.rules.other.listReplaceTask,""),a.tokens[0]?.type==="text"||a.tokens[0]?.type==="paragraph"){a.tokens[0].raw=a.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),a.tokens[0].text=a.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let d=this.lexer.inlineQueue.length-1;d>=0;d--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[d].src)){this.lexer.inlineQueue[d].src=this.lexer.inlineQueue[d].src.replace(this.rules.other.listReplaceTask,"");break}}let p=this.rules.other.listTaskCheckbox.exec(a.raw);if(p){let d={type:"checkbox",raw:p[0]+" ",checked:p[0]!=="[ ]"};a.checked=d.checked,n.loose?a.tokens[0]&&["paragraph","text"].includes(a.tokens[0].type)&&"tokens"in a.tokens[0]&&a.tokens[0].tokens?(a.tokens[0].raw=d.raw+a.tokens[0].raw,a.tokens[0].text=d.raw+a.tokens[0].text,a.tokens[0].tokens.unshift(d)):a.tokens.unshift({type:"paragraph",raw:d.raw,text:d.raw,tokens:[d]}):a.tokens.unshift(d)}}if(!n.loose){let p=a.tokens.filter(u=>u.type==="space"),d=p.length>0&&p.some(u=>this.rules.other.anyLine.test(u.raw));n.loose=d}}if(n.loose)for(let a of n.items){a.loose=!0;for(let p of a.tokens)p.type==="text"&&(p.type="paragraph")}return n}}html(r){let e=this.rules.block.html.exec(r);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(r){let e=this.rules.block.def.exec(r);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"):"",n=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:t,raw:e[0],href:s,title:n}}}table(r){let e=this.rules.block.table.exec(r);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let t=ts(e[1]),s=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),n=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
95
|
+
`):[],i={type:"table",raw:e[0],header:[],align:[],rows:[]};if(t.length===s.length){for(let o of s)this.rules.other.tableAlignRight.test(o)?i.align.push("right"):this.rules.other.tableAlignCenter.test(o)?i.align.push("center"):this.rules.other.tableAlignLeft.test(o)?i.align.push("left"):i.align.push(null);for(let o=0;o<t.length;o++)i.header.push({text:t[o],tokens:this.lexer.inline(t[o]),header:!0,align:i.align[o]});for(let o of n)i.rows.push(ts(o,i.header.length).map((l,a)=>({text:l,tokens:this.lexer.inline(l),header:!1,align:i.align[a]})));return i}}lheading(r){let e=this.rules.block.lheading.exec(r);if(e)return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}paragraph(r){let e=this.rules.block.paragraph.exec(r);if(e){let t=e[1].charAt(e[1].length-1)===`
|
|
96
|
+
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:t,tokens:this.lexer.inline(t)}}}text(r){let e=this.rules.block.text.exec(r);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(r){let e=this.rules.inline.escape.exec(r);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(r){let e=this.rules.inline.tag.exec(r);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(r){let e=this.rules.inline.link.exec(r);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 i=Bt(t.slice(0,-1),"\\");if((t.length-i.length)%2===0)return}else{let i=Ji(e[2],"()");if(i===-2)return;if(i>-1){let o=(e[0].indexOf("!")===0?5:4)+e[1].length+i;e[2]=e[2].substring(0,i),e[0]=e[0].substring(0,o).trim(),e[3]=""}}let s=e[2],n="";if(this.options.pedantic){let i=this.rules.other.pedanticHrefTitle.exec(s);i&&(s=i[1],n=i[3])}else n=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)),rs(e,{href:s&&s.replace(this.rules.inline.anyPunctuation,"$1"),title:n&&n.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(r,e){let t;if((t=this.rules.inline.reflink.exec(r))||(t=this.rules.inline.nolink.exec(r))){let s=(t[2]||t[1]).replace(this.rules.other.multipleSpaceGlobal," "),n=e[s.toLowerCase()];if(!n){let i=t[0].charAt(0);return{type:"text",raw:i,text:i}}return rs(t,n,t[0],this.lexer,this.rules)}}emStrong(r,e,t=""){let s=this.rules.inline.emStrongLDelim.exec(r);if(!(!s||s[3]&&t.match(this.rules.other.unicodeAlphaNumeric))&&(!(s[1]||s[2])||!t||this.rules.inline.punctuation.exec(t))){let n=[...s[0]].length-1,i,o,l=n,a=0,p=s[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(p.lastIndex=0,e=e.slice(-1*r.length+n);(s=p.exec(e))!=null;){if(i=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!i)continue;if(o=[...i].length,s[3]||s[4]){l+=o;continue}else if((s[5]||s[6])&&n%3&&!((n+o)%3)){a+=o;continue}if(l-=o,l>0)continue;o=Math.min(o,o+l+a);let d=[...s[0]][0].length,u=r.slice(0,n+s.index+d+o);if(Math.min(n,o)%2){let m=u.slice(1,-1);return{type:"em",raw:u,text:m,tokens:this.lexer.inlineTokens(m)}}let h=u.slice(2,-2);return{type:"strong",raw:u,text:h,tokens:this.lexer.inlineTokens(h)}}}}codespan(r){let e=this.rules.inline.code.exec(r);if(e){let t=e[2].replace(this.rules.other.newLineCharGlobal," "),s=this.rules.other.nonSpaceChar.test(t),n=this.rules.other.startingSpaceChar.test(t)&&this.rules.other.endingSpaceChar.test(t);return s&&n&&(t=t.substring(1,t.length-1)),{type:"codespan",raw:e[0],text:t}}}br(r){let e=this.rules.inline.br.exec(r);if(e)return{type:"br",raw:e[0]}}del(r){let e=this.rules.inline.del.exec(r);if(e)return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2])}}autolink(r){let e=this.rules.inline.autolink.exec(r);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(r){let e;if(e=this.rules.inline.url.exec(r)){let t,s;if(e[2]==="@")t=e[0],s="mailto:"+t;else{let n;do n=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(n!==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(r){let e=this.rules.inline.text.exec(r);if(e){let t=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:t}}}},Ne=class zr{constructor(e){J(this,"tokens");J(this,"options");J(this,"state");J(this,"inlineQueue");J(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||pt,this.options.tokenizer=this.options.tokenizer||new ir,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:ve,block:rr.normal,inline:zt.normal};this.options.pedantic?(t.block=rr.pedantic,t.inline=zt.pedantic):this.options.gfm&&(t.block=rr.gfm,this.options.breaks?t.inline=zt.breaks:t.inline=zt.gfm),this.tokenizer.rules=t}static get rules(){return{block:rr,inline:zt}}static lex(e,t){return new zr(t).lex(e)}static lexInline(e,t){return new zr(t).inlineTokens(e)}lex(e){e=e.replace(ve.carriageReturn,`
|
|
97
|
+
`),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){for(this.options.pedantic&&(e=e.replace(ve.tabCharGlobal," ").replace(ve.spaceLine,""));e;){let n;if(this.options.extensions?.block?.some(o=>(n=o.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 o=t.at(-1);n.raw.length===1&&o!==void 0?o.raw+=`
|
|
98
|
+
`:t.push(n);continue}if(n=this.tokenizer.code(e)){e=e.substring(n.raw.length);let o=t.at(-1);o?.type==="paragraph"||o?.type==="text"?(o.raw+=(o.raw.endsWith(`
|
|
99
99
|
`)?"":`
|
|
100
|
-
`)+n.raw,
|
|
101
|
-
`+n.text,this.inlineQueue.at(-1).src=
|
|
100
|
+
`)+n.raw,o.text+=`
|
|
101
|
+
`+n.text,this.inlineQueue.at(-1).src=o.text):t.push(n);continue}if(n=this.tokenizer.fences(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.heading(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.hr(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.blockquote(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.list(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.html(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.def(e)){e=e.substring(n.raw.length);let o=t.at(-1);o?.type==="paragraph"||o?.type==="text"?(o.raw+=(o.raw.endsWith(`
|
|
102
102
|
`)?"":`
|
|
103
|
-
`)+n.raw,
|
|
104
|
-
`+n.raw,this.inlineQueue.at(-1).src=
|
|
103
|
+
`)+n.raw,o.text+=`
|
|
104
|
+
`+n.raw,this.inlineQueue.at(-1).src=o.text):this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title},t.push(n));continue}if(n=this.tokenizer.table(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.lheading(e)){e=e.substring(n.raw.length),t.push(n);continue}let i=e;if(this.options.extensions?.startBlock){let o=1/0,l=e.slice(1),a;this.options.extensions.startBlock.forEach(p=>{a=p.call({lexer:this},l),typeof a=="number"&&a>=0&&(o=Math.min(o,a))}),o<1/0&&o>=0&&(i=e.substring(0,o+1))}if(this.state.top&&(n=this.tokenizer.paragraph(i))){let o=t.at(-1);s&&o?.type==="paragraph"?(o.raw+=(o.raw.endsWith(`
|
|
105
105
|
`)?"":`
|
|
106
|
-
`)+n.raw,
|
|
107
|
-
`+n.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=
|
|
106
|
+
`)+n.raw,o.text+=`
|
|
107
|
+
`+n.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):t.push(n),s=i.length!==e.length,e=e.substring(n.raw.length);continue}if(n=this.tokenizer.text(e)){e=e.substring(n.raw.length);let o=t.at(-1);o?.type==="text"?(o.raw+=(o.raw.endsWith(`
|
|
108
108
|
`)?"":`
|
|
109
|
-
`)+n.raw,
|
|
110
|
-
`+n.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=
|
|
111
|
-
`;return s?'<pre><code class="language-'+
|
|
112
|
-
`:"<pre><code>"+(t?n:
|
|
109
|
+
`)+n.raw,o.text+=`
|
|
110
|
+
`+n.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):t.push(n);continue}if(e){let o="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(o);break}else throw new Error(o)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let s=e,n=null;if(this.tokens.links){let a=Object.keys(this.tokens.links);if(a.length>0)for(;(n=this.tokenizer.rules.inline.reflinkSearch.exec(s))!=null;)a.includes(n[0].slice(n[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,n.index)+"["+"a".repeat(n[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(n=this.tokenizer.rules.inline.anyPunctuation.exec(s))!=null;)s=s.slice(0,n.index)+"++"+s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(n=this.tokenizer.rules.inline.blockSkip.exec(s))!=null;)i=n[2]?n[2].length:0,s=s.slice(0,n.index+i)+"["+"a".repeat(n[0].length-i-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);s=this.options.hooks?.emStrongMask?.call({lexer:this},s)??s;let o=!1,l="";for(;e;){o||(l=""),o=!1;let a;if(this.options.extensions?.inline?.some(d=>(a=d.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 d=t.at(-1);a.type==="text"&&d?.type==="text"?(d.raw+=a.raw,d.text+=a.text):t.push(a);continue}if(a=this.tokenizer.emStrong(e,s,l)){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)){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 p=e;if(this.options.extensions?.startInline){let d=1/0,u=e.slice(1),h;this.options.extensions.startInline.forEach(m=>{h=m.call({lexer:this},u),typeof h=="number"&&h>=0&&(d=Math.min(d,h))}),d<1/0&&d>=0&&(p=e.substring(0,d+1))}if(a=this.tokenizer.inlineText(p)){e=e.substring(a.raw.length),a.raw.slice(-1)!=="_"&&(l=a.raw.slice(-1)),o=!0;let d=t.at(-1);d?.type==="text"?(d.raw+=a.raw,d.text+=a.text):t.push(a);continue}if(e){let d="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(d);break}else throw new Error(d)}}return t}},or=class{constructor(r){J(this,"options");J(this,"parser");this.options=r||pt}space(r){return""}code({text:r,lang:e,escaped:t}){let s=(e||"").match(ve.notSpaceStart)?.[0],n=r.replace(ve.endingNewline,"")+`
|
|
111
|
+
`;return s?'<pre><code class="language-'+Ue(s)+'">'+(t?n:Ue(n,!0))+`</code></pre>
|
|
112
|
+
`:"<pre><code>"+(t?n:Ue(n,!0))+`</code></pre>
|
|
113
113
|
`}blockquote({tokens:r}){return`<blockquote>
|
|
114
114
|
${this.parser.parse(r)}</blockquote>
|
|
115
115
|
`}html({text:r}){return r}def(r){return""}heading({tokens:r,depth:e}){return`<h${e}>${this.parser.parseInline(r)}</h${e}>
|
|
116
116
|
`}hr(r){return`<hr>
|
|
117
|
-
`}list(r){let e=r.ordered,t=r.start,s="";for(let
|
|
117
|
+
`}list(r){let e=r.ordered,t=r.start,s="";for(let o=0;o<r.items.length;o++){let l=r.items[o];s+=this.listitem(l)}let n=e?"ol":"ul",i=e&&t!==1?' start="'+t+'"':"";return"<"+n+i+`>
|
|
118
118
|
`+s+"</"+n+`>
|
|
119
119
|
`}listitem(r){return`<li>${this.parser.parse(r.tokens)}</li>
|
|
120
120
|
`}checkbox({checked:r}){return"<input "+(r?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:r}){return`<p>${this.parser.parseInline(r)}</p>
|
|
121
|
-
`}table(r){let e="",t="";for(let n=0;n<r.header.length;n++)t+=this.tablecell(r.header[n]);e+=this.tablerow({text:t});let s="";for(let n=0;n<r.rows.length;n++){let i=r.rows[n];t="";for(let
|
|
121
|
+
`}table(r){let e="",t="";for(let n=0;n<r.header.length;n++)t+=this.tablecell(r.header[n]);e+=this.tablerow({text:t});let s="";for(let n=0;n<r.rows.length;n++){let i=r.rows[n];t="";for(let o=0;o<i.length;o++)t+=this.tablecell(i[o]);s+=this.tablerow({text:t})}return s&&(s=`<tbody>${s}</tbody>`),`<table>
|
|
122
122
|
<thead>
|
|
123
123
|
`+e+`</thead>
|
|
124
124
|
`+s+`</table>
|
|
125
125
|
`}tablerow({text:r}){return`<tr>
|
|
126
126
|
${r}</tr>
|
|
127
127
|
`}tablecell(r){let e=this.parser.parseInline(r.tokens),t=r.header?"th":"td";return(r.align?`<${t} align="${r.align}">`:`<${t}>`)+e+`</${t}>
|
|
128
|
-
`}strong({tokens:r}){return`<strong>${this.parser.parseInline(r)}</strong>`}em({tokens:r}){return`<em>${this.parser.parseInline(r)}</em>`}codespan({text:r}){return`<code>${
|
|
129
|
-
Please report this to https://github.com/markedjs/marked.`,r){let s="<p>An error occurred:</p><pre>"+
|
|
128
|
+
`}strong({tokens:r}){return`<strong>${this.parser.parseInline(r)}</strong>`}em({tokens:r}){return`<em>${this.parser.parseInline(r)}</em>`}codespan({text:r}){return`<code>${Ue(r,!0)}</code>`}br(r){return"<br>"}del({tokens:r}){return`<del>${this.parser.parseInline(r)}</del>`}link({href:r,title:e,tokens:t}){let s=this.parser.parseInline(t),n=es(r);if(n===null)return s;r=n;let i='<a href="'+r+'"';return e&&(i+=' title="'+Ue(e)+'"'),i+=">"+s+"</a>",i}image({href:r,title:e,text:t,tokens:s}){s&&(t=this.parser.parseInline(s,this.parser.textRenderer));let n=es(r);if(n===null)return Ue(t);r=n;let i=`<img src="${r}" alt="${t}"`;return e&&(i+=` title="${Ue(e)}"`),i+=">",i}text(r){return"tokens"in r&&r.tokens?this.parser.parseInline(r.tokens):"escaped"in r&&r.escaped?r.text:Ue(r.text)}},Yr=class{strong({text:r}){return r}em({text:r}){return r}codespan({text:r}){return r}del({text:r}){return r}html({text:r}){return r}text({text:r}){return r}link({text:r}){return""+r}image({text:r}){return""+r}br(){return""}checkbox({raw:r}){return r}},Me=class Br{constructor(e){J(this,"options");J(this,"renderer");J(this,"textRenderer");this.options=e||pt,this.options.renderer=this.options.renderer||new or,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Yr}static parse(e,t){return new Br(t).parse(e)}static parseInline(e,t){return new Br(t).parseInline(e)}parse(e){let t="";for(let s=0;s<e.length;s++){let n=e[s];if(this.options.extensions?.renderers?.[n.type]){let o=n,l=this.options.extensions.renderers[o.type].call({parser:this},o);if(l!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(o.type)){t+=l||"";continue}}let i=n;switch(i.type){case"space":{t+=this.renderer.space(i);break}case"hr":{t+=this.renderer.hr(i);break}case"heading":{t+=this.renderer.heading(i);break}case"code":{t+=this.renderer.code(i);break}case"table":{t+=this.renderer.table(i);break}case"blockquote":{t+=this.renderer.blockquote(i);break}case"list":{t+=this.renderer.list(i);break}case"checkbox":{t+=this.renderer.checkbox(i);break}case"html":{t+=this.renderer.html(i);break}case"def":{t+=this.renderer.def(i);break}case"paragraph":{t+=this.renderer.paragraph(i);break}case"text":{t+=this.renderer.text(i);break}default:{let o='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return t}parseInline(e,t=this.renderer){let s="";for(let n=0;n<e.length;n++){let i=e[n];if(this.options.extensions?.renderers?.[i.type]){let l=this.options.extensions.renderers[i.type].call({parser:this},i);if(l!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){s+=l||"";continue}}let o=i;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 l='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return s}},nr,Ht=(nr=class{constructor(r){J(this,"options");J(this,"block");this.options=r||pt}preprocess(r){return r}postprocess(r){return r}processAllTokens(r){return r}emStrongMask(r){return r}provideLexer(){return this.block?Ne.lex:Ne.lexInline}provideParser(){return this.block?Me.parse:Me.parseInline}},J(nr,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),J(nr,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),nr),to=class{constructor(...r){J(this,"defaults",Hr());J(this,"options",this.setOptions);J(this,"parse",this.parseMarkdown(!0));J(this,"parseInline",this.parseMarkdown(!1));J(this,"Parser",Me);J(this,"Renderer",or);J(this,"TextRenderer",Yr);J(this,"Lexer",Ne);J(this,"Tokenizer",ir);J(this,"Hooks",Ht);this.use(...r)}walkTokens(r,e){let t=[];for(let s of r)switch(t=t.concat(e.call(this,s)),s.type){case"table":{let n=s;for(let i of n.header)t=t.concat(this.walkTokens(i.tokens,e));for(let i of n.rows)for(let o of i)t=t.concat(this.walkTokens(o.tokens,e));break}case"list":{let n=s;t=t.concat(this.walkTokens(n.items,e));break}default:{let n=s;this.defaults.extensions?.childTokens?.[n.type]?this.defaults.extensions.childTokens[n.type].forEach(i=>{let o=n[i].flat(1/0);t=t.concat(this.walkTokens(o,e))}):n.tokens&&(t=t.concat(this.walkTokens(n.tokens,e)))}}return t}use(...r){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return r.forEach(t=>{let s={...t};if(s.async=this.defaults.async||s.async||!1,t.extensions&&(t.extensions.forEach(n=>{if(!n.name)throw new Error("extension name required");if("renderer"in n){let i=e.renderers[n.name];i?e.renderers[n.name]=function(...o){let l=n.renderer.apply(this,o);return l===!1&&(l=i.apply(this,o)),l}:e.renderers[n.name]=n.renderer}if("tokenizer"in n){if(!n.level||n.level!=="block"&&n.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let i=e[n.level];i?i.unshift(n.tokenizer):e[n.level]=[n.tokenizer],n.start&&(n.level==="block"?e.startBlock?e.startBlock.push(n.start):e.startBlock=[n.start]:n.level==="inline"&&(e.startInline?e.startInline.push(n.start):e.startInline=[n.start]))}"childTokens"in n&&n.childTokens&&(e.childTokens[n.name]=n.childTokens)}),s.extensions=e),t.renderer){let n=this.defaults.renderer||new or(this.defaults);for(let i in t.renderer){if(!(i in n))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;let o=i,l=t.renderer[o],a=n[o];n[o]=(...p)=>{let d=l.apply(n,p);return d===!1&&(d=a.apply(n,p)),d||""}}s.renderer=n}if(t.tokenizer){let n=this.defaults.tokenizer||new ir(this.defaults);for(let i in t.tokenizer){if(!(i in n))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;let o=i,l=t.tokenizer[o],a=n[o];n[o]=(...p)=>{let d=l.apply(n,p);return d===!1&&(d=a.apply(n,p)),d}}s.tokenizer=n}if(t.hooks){let n=this.defaults.hooks||new Ht;for(let i in t.hooks){if(!(i in n))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;let o=i,l=t.hooks[o],a=n[o];Ht.passThroughHooks.has(i)?n[o]=p=>{if(this.defaults.async&&Ht.passThroughHooksRespectAsync.has(i))return(async()=>{let u=await l.call(n,p);return a.call(n,u)})();let d=l.call(n,p);return a.call(n,d)}:n[o]=(...p)=>{if(this.defaults.async)return(async()=>{let u=await l.apply(n,p);return u===!1&&(u=await a.apply(n,p)),u})();let d=l.apply(n,p);return d===!1&&(d=a.apply(n,p)),d}}s.hooks=n}if(t.walkTokens){let n=this.defaults.walkTokens,i=t.walkTokens;s.walkTokens=function(o){let l=[];return l.push(i.call(this,o)),n&&(l=l.concat(n.call(this,o))),l}}this.defaults={...this.defaults,...s}}),this}setOptions(r){return this.defaults={...this.defaults,...r},this}lexer(r,e){return Ne.lex(r,e??this.defaults)}parser(r,e){return Me.parse(r,e??this.defaults)}parseMarkdown(r){return(e,t)=>{let s={...t},n={...this.defaults,...s},i=this.onError(!!n.silent,!!n.async);if(this.defaults.async===!0&&s.async===!1)return i(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return i(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(n.hooks&&(n.hooks.options=n,n.hooks.block=r),n.async)return(async()=>{let o=n.hooks?await n.hooks.preprocess(e):e,l=await(n.hooks?await n.hooks.provideLexer():r?Ne.lex:Ne.lexInline)(o,n),a=n.hooks?await n.hooks.processAllTokens(l):l;n.walkTokens&&await Promise.all(this.walkTokens(a,n.walkTokens));let p=await(n.hooks?await n.hooks.provideParser():r?Me.parse:Me.parseInline)(a,n);return n.hooks?await n.hooks.postprocess(p):p})().catch(i);try{n.hooks&&(e=n.hooks.preprocess(e));let o=(n.hooks?n.hooks.provideLexer():r?Ne.lex:Ne.lexInline)(e,n);n.hooks&&(o=n.hooks.processAllTokens(o)),n.walkTokens&&this.walkTokens(o,n.walkTokens);let l=(n.hooks?n.hooks.provideParser():r?Me.parse:Me.parseInline)(o,n);return n.hooks&&(l=n.hooks.postprocess(l)),l}catch(o){return i(o)}}}onError(r,e){return t=>{if(t.message+=`
|
|
129
|
+
Please report this to https://github.com/markedjs/marked.`,r){let s="<p>An error occurred:</p><pre>"+Ue(t.message+"",!0)+"</pre>";return e?Promise.resolve(s):s}if(e)return Promise.reject(t);throw t}}},ut=new to;function X(r,e){return ut.parse(r,e)}X.options=X.setOptions=function(r){return ut.setOptions(r),X.defaults=ut.defaults,ns(X.defaults),X};X.getDefaults=Hr;X.defaults=pt;X.use=function(...r){return ut.use(...r),X.defaults=ut.defaults,ns(X.defaults),X};X.walkTokens=function(r,e){return ut.walkTokens(r,e)};X.parseInline=ut.parseInline;X.Parser=Me;X.parser=Me.parse;X.Renderer=or;X.TextRenderer=Yr;X.Lexer=Ne;X.lexer=Ne.lex;X.Tokenizer=ir;X.Hooks=Ht;X.parse=X;var Jo=X.options,ea=X.setOptions,ta=X.use,ra=X.walkTokens,na=X.parseInline;var sa=Me.parse,ia=Ne.lex;function jt(r){let e=X.parse(r),t=Kn.sanitize(e);return Vn(t)}function Qe(r){switch((r||"").toString()){case"open":return"Open";case"in_progress":return"In progress";case"closed":return"Closed";default:return(r||"").toString()||"Open"}}function ro(r){if(!r)return"";try{return new Date(r).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return r}}function no(r){window.location.hash=r}function hs(r,e,t=no,s=void 0){let n=oe("views:detail"),i=null,o=null,l=!1,a=!1,p=!1,d=!1,u=!1,h=!1,m=!1,x="",y="",C=!1;function A(f){let R=Er(window.location.hash||"");return Ye(R,f)}function P(f){Te(L`
|
|
130
130
|
<div class="panel__body" id="detail-root">
|
|
131
|
-
<p class="muted">${
|
|
131
|
+
<p class="muted">${f}</p>
|
|
132
132
|
</div>
|
|
133
|
-
`,r)}function
|
|
133
|
+
`,r)}function $(){if(!o||!s||typeof s.snapshotFor!="function")return;let f=s.snapshotFor(`detail:${o}`);Array.isArray(f)&&f.length>0&&(i=f.find(U=>String(U.id)===String(o))||f[0])}s&&typeof s.subscribe=="function"&&s.subscribe(()=>{try{$(),D()}catch(f){n("issue stores listener error %o",f)}});let E=()=>{a=!0,D()},O=f=>{f.key==="Enter"?(a=!0,D()):f.key==="Escape"&&(a=!1,D())},w=async()=>{if(!i||l)return;let f=r.querySelector("h2 input"),R=i.title||"",U=f?f.value:"";if(U===R){a=!1,D();return}l=!0,f&&(f.disabled=!0);try{n("save title %s \u2192 %s",String(i.id),U);let I=await e("edit-text",{id:i.id,field:"title",value:U});I&&typeof I=="object"&&(i=I,a=!1,D())}catch(I){n("save title failed %s %o",String(i.id),I),i.title=R,a=!1,D(),he("Failed to save title","error")}finally{l=!1}},k=()=>{a=!1,D()},b=()=>{m=!0,D()},S=f=>{f.key==="Enter"?(f.preventDefault(),m=!0,D()):f.key==="Escape"&&(f.preventDefault(),m=!1,D())},T=async()=>{if(!i||l)return;let f=r.querySelector("#detail-root .prop.assignee input"),R=i?.assignee??"",U=f?.value??"";if(U===R){m=!1,D();return}l=!0,f&&(f.disabled=!0);try{n("save assignee %s \u2192 %s",String(i.id),U);let I=await e("update-assignee",{id:i.id,assignee:U});I&&typeof I=="object"&&(i=I,m=!1,D())}catch(I){n("save assignee failed %s %o",String(i.id),I),i.assignee=R,m=!1,D(),he("Failed to update assignee","error")}finally{l=!1}},N=()=>{m=!1,D()},q=f=>{x=f.currentTarget.value||""};function W(f){f.key==="Enter"&&(f.preventDefault(),Z())}async function Z(){if(!i||l)return;let f=x.trim();if(f){l=!0;try{n("add label %s \u2192 %s",String(i.id),f);let R=await e("label-add",{id:i.id,label:f});R&&typeof R=="object"&&(i=R,x="",D())}catch(R){n("add label failed %s %o",String(i.id),R),he("Failed to add label","error")}finally{l=!1}}}async function Y(f){if(!(!i||l)){l=!0;try{n("remove label %s \u2192 %s",String(i?.id||""),f);let R=await e("label-remove",{id:i.id,label:f});R&&typeof R=="object"&&(i=R,D())}catch(R){n("remove label failed %s %o",String(i?.id||""),R),he("Failed to remove label","error")}finally{l=!1}}}let j=async f=>{if(!i||l){D();return}let R=f.currentTarget,U=i.status||"open",I=R.value;if(I!==U){l=!0,i.status=I,D();try{n("update status %s \u2192 %s",String(i.id),I);let ee=await e("update-status",{id:i.id,status:I});ee&&typeof ee=="object"&&(i=ee,D())}catch(ee){n("update status failed %s %o",String(i.id),ee),i.status=U,D(),he("Failed to update status","error")}finally{l=!1}}},re=async f=>{if(!i||l){D();return}let R=f.currentTarget,U=typeof i.priority=="number"?i.priority:2,I=Number(R.value);if(I!==U){l=!0,i.priority=I,D();try{n("update priority %s \u2192 %d",String(i.id),I);let ee=await e("update-priority",{id:i.id,priority:I});ee&&typeof ee=="object"&&(i=ee,D())}catch(ee){n("update priority failed %s %o",String(i.id),ee),i.priority=U,D(),he("Failed to update priority","error")}finally{l=!1}}},ne=()=>{p=!0,D()},ge=f=>{if(f.key==="Escape")p=!1,D();else if(f.key==="Enter"&&f.ctrlKey){let R=r.querySelector("#detail-root .editable-actions button");R&&R.click()}},me=async()=>{if(!i||l)return;let f=r.querySelector("#detail-root textarea"),R=i.description||"",U=f?f.value:"";if(U===R){p=!1,D();return}l=!0,f&&(f.disabled=!0);try{n("save description %s",String(i?.id||""));let I=await e("edit-text",{id:i.id,field:"description",value:U});I&&typeof I=="object"&&(i=I,p=!1,D())}catch(I){n("save description failed %s %o",String(i?.id||""),I),i.description=R,p=!1,D(),he("Failed to save description","error")}finally{l=!1}},B=()=>{p=!1,D()},pe=()=>{d=!0,D();try{let f=r.querySelector("#detail-root .design textarea");f&&f.focus()}catch(f){n("focus design textarea failed %o",f)}},te=f=>{if(f.key==="Escape")d=!1,D();else if(f.key==="Enter"&&(f.ctrlKey||f.metaKey)){let R=r.querySelector("#detail-root .design .editable-actions button");R&&R.click()}},Oe=async()=>{if(!i||l)return;let f=r.querySelector("#detail-root .design textarea"),R=i.design||"",U=f?f.value:"";if(U===R){d=!1,D();return}l=!0,f&&(f.disabled=!0);try{n("save design %s",String(i?.id||""));let I=await e("edit-text",{id:i.id,field:"design",value:U});I&&typeof I=="object"&&(i=I,d=!1,D())}catch(I){n("save design failed %s %o",String(i?.id||""),I),i.design=R,d=!1,D(),he("Failed to save design","error")}finally{l=!1}},Q=()=>{d=!1,D()},Ae=()=>{u=!0,D()},Ce=f=>{if(f.key==="Escape")u=!1,D();else if(f.key==="Enter"&&(f.ctrlKey||f.metaKey)){let R=r.querySelector("#detail-root .notes .editable-actions button");R&&R.click()}},Re=async()=>{if(!i||l)return;let f=r.querySelector("#detail-root .notes textarea"),R=i.notes||"",U=f?f.value:"";if(U===R){u=!1,D();return}l=!0,f&&(f.disabled=!0);try{n("save notes %s",String(i?.id||""));let I=await e("edit-text",{id:i.id,field:"notes",value:U});I&&typeof I=="object"&&(i=I,u=!1,D())}catch(I){n("save notes failed %s %o",String(i?.id||""),I),i.notes=R,u=!1,D(),he("Failed to save notes","error")}finally{l=!1}},qe=()=>{u=!1,D()},Fe=()=>{h=!0,D()},Je=f=>{if(f.key==="Escape")h=!1,D();else if(f.key==="Enter"&&(f.ctrlKey||f.metaKey)){let R=r.querySelector("#detail-root .acceptance .editable-actions button");R&&R.click()}},_=async()=>{if(!i||l)return;let f=r.querySelector("#detail-root .acceptance textarea"),R=i.acceptance||"",U=f?f.value:"";if(U===R){h=!1,D();return}l=!0,f&&(f.disabled=!0);try{n("save acceptance %s",String(i?.id||""));let I=await e("edit-text",{id:i.id,field:"acceptance",value:U});I&&typeof I=="object"&&(i=I,h=!1,D())}catch(I){n("save acceptance failed %s %o",String(i?.id||""),I),i.acceptance=R,h=!1,D(),he("Failed to save acceptance","error")}finally{l=!1}},g=()=>{h=!1,D()},H=f=>{let R=f.currentTarget,U=y.trim().length>0;y=R.value||"";let I=y.trim().length>0;U!==I&&D()},z=async()=>{if(!(!i||C||!y.trim())){C=!0,D();try{n("add comment to %s",String(i.id));let f=await e("add-comment",{id:i.id,text:y.trim()});Array.isArray(f)&&(i.comments=f,y="",D())}catch(f){n("add comment failed %s %o",String(i.id),f),he("Failed to add comment","error")}finally{C=!1,D()}}},ue=f=>{f.key==="Enter"&&(f.ctrlKey||f.metaKey)&&(f.preventDefault(),z())};function le(f,R){let U=f==="Dependencies"?"add-dependency":"add-dependent";return L`
|
|
134
134
|
<div class="props-card">
|
|
135
135
|
<div>
|
|
136
|
-
<div class="props-card__title">${
|
|
136
|
+
<div class="props-card__title">${f}</div>
|
|
137
137
|
</div>
|
|
138
138
|
<ul>
|
|
139
|
-
${!
|
|
140
|
-
data-href=${
|
|
141
|
-
@click=${()=>t(
|
|
139
|
+
${!R||R.length===0?null:R.map(I=>{let ee=I.id,we=A(ee);return L`<li
|
|
140
|
+
data-href=${we}
|
|
141
|
+
@click=${()=>t(we)}
|
|
142
142
|
>
|
|
143
|
-
${
|
|
144
|
-
<span class="text-truncate">${
|
|
143
|
+
${dt(I.issue_type||"")}
|
|
144
|
+
<span class="text-truncate">${I.title||""}</span>
|
|
145
145
|
<button
|
|
146
|
-
aria-label=${`Remove dependency ${
|
|
147
|
-
@click=${
|
|
146
|
+
aria-label=${`Remove dependency ${ee}`}
|
|
147
|
+
@click=${ft(ee,f)}
|
|
148
148
|
>
|
|
149
149
|
×
|
|
150
150
|
</button>
|
|
151
151
|
</li>`})}
|
|
152
152
|
</ul>
|
|
153
153
|
<div class="props-card__footer">
|
|
154
|
-
<input type="text" placeholder="Issue ID" data-testid=${
|
|
155
|
-
<button @click=${
|
|
154
|
+
<input type="text" placeholder="Issue ID" data-testid=${U} />
|
|
155
|
+
<button @click=${Gt(R,f)}>Add</button>
|
|
156
156
|
</div>
|
|
157
157
|
</div>
|
|
158
|
-
`}function
|
|
158
|
+
`}function je(f){let R=a?L`<div class="detail-title">
|
|
159
159
|
<h2>
|
|
160
160
|
<input
|
|
161
161
|
type="text"
|
|
162
162
|
aria-label="Edit title"
|
|
163
|
-
.value=${
|
|
164
|
-
@keydown=${
|
|
163
|
+
.value=${f.title||""}
|
|
164
|
+
@keydown=${Wt}
|
|
165
165
|
/>
|
|
166
|
-
<button @click=${
|
|
167
|
-
<button @click=${
|
|
166
|
+
<button @click=${w}>Save</button>
|
|
167
|
+
<button @click=${k}>Cancel</button>
|
|
168
168
|
</h2>
|
|
169
169
|
</div>`:L`<div class="detail-title">
|
|
170
170
|
<h2>
|
|
@@ -173,110 +173,110 @@ Please report this to https://github.com/markedjs/marked.`,r){let s="<p>An error
|
|
|
173
173
|
tabindex="0"
|
|
174
174
|
role="button"
|
|
175
175
|
aria-label="Edit title"
|
|
176
|
-
@click=${
|
|
177
|
-
@keydown=${
|
|
178
|
-
>${
|
|
176
|
+
@click=${E}
|
|
177
|
+
@keydown=${O}
|
|
178
|
+
>${f.title||""}</span
|
|
179
179
|
>
|
|
180
180
|
</h2>
|
|
181
|
-
</div>`,
|
|
182
|
-
class=${`badge-select badge--status is-${
|
|
183
|
-
@change=${
|
|
184
|
-
.value=${
|
|
181
|
+
</div>`,U=L`<select
|
|
182
|
+
class=${`badge-select badge--status is-${f.status||"open"}`}
|
|
183
|
+
@change=${j}
|
|
184
|
+
.value=${f.status||"open"}
|
|
185
185
|
?disabled=${l}
|
|
186
186
|
>
|
|
187
|
-
${(()=>{let
|
|
188
|
-
${
|
|
187
|
+
${(()=>{let K=String(f.status||"open");return["open","in_progress","closed"].map(se=>L`<option value=${se} ?selected=${K===se}>
|
|
188
|
+
${Qe(se)}
|
|
189
189
|
</option>`)})()}
|
|
190
|
-
</select>`,
|
|
191
|
-
class=${`badge-select badge--priority is-p${String(typeof
|
|
192
|
-
@change=${
|
|
193
|
-
.value=${String(typeof
|
|
190
|
+
</select>`,I=L`<select
|
|
191
|
+
class=${`badge-select badge--priority is-p${String(typeof f.priority=="number"?f.priority:2)}`}
|
|
192
|
+
@change=${re}
|
|
193
|
+
.value=${String(typeof f.priority=="number"?f.priority:2)}
|
|
194
194
|
?disabled=${l}
|
|
195
195
|
>
|
|
196
|
-
${(()=>{let
|
|
197
|
-
${
|
|
196
|
+
${(()=>{let K=String(typeof f.priority=="number"?f.priority:2);return Xe.map((se,gt)=>L`<option value=${String(gt)} ?selected=${K===String(gt)}>
|
|
197
|
+
${Lt(gt)} ${se}
|
|
198
198
|
</option>`)})()}
|
|
199
|
-
</select>`,
|
|
199
|
+
</select>`,ee=p?L`<div class="description">
|
|
200
200
|
<textarea
|
|
201
|
-
@keydown=${
|
|
202
|
-
.value=${
|
|
201
|
+
@keydown=${ge}
|
|
202
|
+
.value=${f.description||""}
|
|
203
203
|
rows="8"
|
|
204
204
|
style="width:100%"
|
|
205
205
|
></textarea>
|
|
206
206
|
<div class="editable-actions">
|
|
207
|
-
<button @click=${
|
|
208
|
-
<button @click=${
|
|
207
|
+
<button @click=${me}>Save</button>
|
|
208
|
+
<button @click=${B}>Cancel</button>
|
|
209
209
|
</div>
|
|
210
210
|
</div>`:L`<div
|
|
211
211
|
class="md editable"
|
|
212
212
|
tabindex="0"
|
|
213
213
|
role="button"
|
|
214
214
|
aria-label="Edit description"
|
|
215
|
-
@click=${
|
|
216
|
-
@keydown=${
|
|
215
|
+
@click=${ne}
|
|
216
|
+
@keydown=${pr}
|
|
217
217
|
>
|
|
218
|
-
${(()=>{let
|
|
219
|
-
</div>`,
|
|
220
|
-
${
|
|
218
|
+
${(()=>{let K=f.description||"";return K.trim()===""?L`<div class="muted">Description</div>`:jt(K)})()}
|
|
219
|
+
</div>`,we=(()=>{let K=f;return String(f.acceptance||K.acceptance_criteria||"")})(),tt=h?L`<div class="acceptance">
|
|
220
|
+
${we.trim().length>0?L`<div class="props-card__title">Acceptance Criteria</div>`:""}
|
|
221
221
|
<textarea
|
|
222
|
-
@keydown=${
|
|
223
|
-
.value=${
|
|
222
|
+
@keydown=${Je}
|
|
223
|
+
.value=${we}
|
|
224
224
|
rows="6"
|
|
225
225
|
style="width:100%"
|
|
226
226
|
></textarea>
|
|
227
227
|
<div class="editable-actions">
|
|
228
|
-
<button @click=${
|
|
229
|
-
<button @click=${
|
|
228
|
+
<button @click=${_}>Save</button>
|
|
229
|
+
<button @click=${g}>Cancel</button>
|
|
230
230
|
</div>
|
|
231
231
|
</div>`:L`<div class="acceptance">
|
|
232
|
-
${(()=>{let
|
|
232
|
+
${(()=>{let K=we,se=K.trim().length>0;return L`${se?L`<div class="props-card__title">Acceptance Criteria</div>`:""}
|
|
233
233
|
<div
|
|
234
234
|
class="md editable"
|
|
235
235
|
tabindex="0"
|
|
236
236
|
role="button"
|
|
237
237
|
aria-label="Edit acceptance criteria"
|
|
238
|
-
@click=${
|
|
239
|
-
@keydown=${
|
|
238
|
+
@click=${Fe}
|
|
239
|
+
@keydown=${At}
|
|
240
240
|
>
|
|
241
|
-
${
|
|
241
|
+
${se?jt(K):L`<div class="muted">Add acceptance criteria…</div>`}
|
|
242
242
|
</div>`})()}
|
|
243
|
-
</div>`,
|
|
244
|
-
${
|
|
243
|
+
</div>`,ce=String(f.notes||""),Ie=u?L`<div class="notes">
|
|
244
|
+
${ce.trim().length>0?L`<div class="props-card__title">Notes</div>`:""}
|
|
245
245
|
<textarea
|
|
246
|
-
@keydown=${
|
|
247
|
-
.value=${
|
|
246
|
+
@keydown=${Ce}
|
|
247
|
+
.value=${ce}
|
|
248
248
|
rows="6"
|
|
249
249
|
style="width:100%"
|
|
250
250
|
></textarea>
|
|
251
251
|
<div class="editable-actions">
|
|
252
|
-
<button @click=${
|
|
253
|
-
<button @click=${
|
|
252
|
+
<button @click=${Re}>Save</button>
|
|
253
|
+
<button @click=${qe}>Cancel</button>
|
|
254
254
|
</div>
|
|
255
255
|
</div>`:L`<div class="notes">
|
|
256
|
-
${(()=>{let
|
|
256
|
+
${(()=>{let K=ce,se=K.trim().length>0;return L`${se?L`<div class="props-card__title">Notes</div>`:""}
|
|
257
257
|
<div
|
|
258
258
|
class="md editable"
|
|
259
259
|
tabindex="0"
|
|
260
260
|
role="button"
|
|
261
261
|
aria-label="Edit notes"
|
|
262
|
-
@click=${
|
|
263
|
-
@keydown=${
|
|
262
|
+
@click=${Ae}
|
|
263
|
+
@keydown=${et}
|
|
264
264
|
>
|
|
265
|
-
${
|
|
265
|
+
${se?jt(K):L`<div class="muted">Add notes…</div>`}
|
|
266
266
|
</div>`})()}
|
|
267
|
-
</div>`,
|
|
267
|
+
</div>`,We=Array.isArray(f.labels)?f.labels:[],St=L`<div class="props-card labels">
|
|
268
268
|
<div>
|
|
269
269
|
<div class="props-card__title">Labels</div>
|
|
270
270
|
</div>
|
|
271
271
|
<ul>
|
|
272
|
-
${
|
|
273
|
-
<span class="badge" title=${
|
|
274
|
-
>${
|
|
272
|
+
${We.map(K=>L`<li>
|
|
273
|
+
<span class="badge" title=${K}
|
|
274
|
+
>${K}
|
|
275
275
|
<button
|
|
276
276
|
class="icon-button"
|
|
277
277
|
title="Remove label"
|
|
278
|
-
aria-label=${"Remove label "+
|
|
279
|
-
@click=${()=>
|
|
278
|
+
aria-label=${"Remove label "+K}
|
|
279
|
+
@click=${()=>Y(K)}
|
|
280
280
|
style="margin-left:6px"
|
|
281
281
|
>
|
|
282
282
|
×
|
|
@@ -289,43 +289,72 @@ Please report this to https://github.com/markedjs/marked.`,r){let s="<p>An error
|
|
|
289
289
|
type="text"
|
|
290
290
|
placeholder="Label"
|
|
291
291
|
size="12"
|
|
292
|
-
.value=${
|
|
293
|
-
@input=${
|
|
294
|
-
@keydown=${
|
|
292
|
+
.value=${x}
|
|
293
|
+
@input=${q}
|
|
294
|
+
@keydown=${W}
|
|
295
295
|
/>
|
|
296
|
-
<button @click=${
|
|
296
|
+
<button @click=${Z}>Add</button>
|
|
297
297
|
</div>
|
|
298
|
-
</div>`,
|
|
299
|
-
${
|
|
298
|
+
</div>`,rt=String(f.design||""),fr=d?L`<div class="design">
|
|
299
|
+
${rt.trim().length>0?L`<div class="props-card__title">Design</div>`:""}
|
|
300
300
|
<textarea
|
|
301
|
-
@keydown=${
|
|
302
|
-
.value=${
|
|
301
|
+
@keydown=${te}
|
|
302
|
+
.value=${rt}
|
|
303
303
|
rows="6"
|
|
304
304
|
style="width:100%"
|
|
305
305
|
></textarea>
|
|
306
306
|
<div class="editable-actions">
|
|
307
|
-
<button @click=${
|
|
308
|
-
<button @click=${
|
|
307
|
+
<button @click=${Oe}>Save</button>
|
|
308
|
+
<button @click=${Q}>Cancel</button>
|
|
309
309
|
</div>
|
|
310
310
|
</div>`:L`<div class="design">
|
|
311
|
-
${(()=>{let
|
|
311
|
+
${(()=>{let K=rt,se=K.trim().length>0;return L`${se?L`<div class="props-card__title">Design</div>`:""}
|
|
312
312
|
<div
|
|
313
313
|
class="md editable"
|
|
314
314
|
tabindex="0"
|
|
315
315
|
role="button"
|
|
316
316
|
aria-label="Edit design"
|
|
317
|
-
@click=${
|
|
318
|
-
@keydown=${
|
|
317
|
+
@click=${pe}
|
|
318
|
+
@keydown=${Ge}
|
|
319
319
|
>
|
|
320
|
-
${
|
|
320
|
+
${se?jt(K):L`<div class="muted">Add design…</div>`}
|
|
321
321
|
</div>`})()}
|
|
322
|
-
</div
|
|
322
|
+
</div>`,nt=Array.isArray(f.comments)?f.comments:[],ht=L`<div class="comments">
|
|
323
|
+
<div class="props-card__title">Comments</div>
|
|
324
|
+
${nt.length===0?L`<div class="muted">No comments yet</div>`:nt.map(K=>L`
|
|
325
|
+
<div class="comment-item">
|
|
326
|
+
<div class="comment-header">
|
|
327
|
+
<span class="comment-author">${K.author||"Unknown"}</span>
|
|
328
|
+
<span class="comment-date"
|
|
329
|
+
>${ro(K.created_at)}</span
|
|
330
|
+
>
|
|
331
|
+
</div>
|
|
332
|
+
<div class="comment-text">${K.text}</div>
|
|
333
|
+
</div>
|
|
334
|
+
`)}
|
|
335
|
+
<div class="comment-input">
|
|
336
|
+
<textarea
|
|
337
|
+
placeholder="Add a comment... (Ctrl+Enter to submit)"
|
|
338
|
+
rows="3"
|
|
339
|
+
.value=${y}
|
|
340
|
+
@input=${H}
|
|
341
|
+
@keydown=${ue}
|
|
342
|
+
?disabled=${C}
|
|
343
|
+
></textarea>
|
|
344
|
+
<button
|
|
345
|
+
@click=${z}
|
|
346
|
+
?disabled=${C||!y.trim()}
|
|
347
|
+
>
|
|
348
|
+
${C?"Adding...":"Add Comment"}
|
|
349
|
+
</button>
|
|
350
|
+
</div>
|
|
351
|
+
</div>`;return L`
|
|
323
352
|
<div class="panel__body" id="detail-root">
|
|
324
353
|
<div style="position:relative">
|
|
325
354
|
<div class="detail-layout">
|
|
326
355
|
<div class="detail-main">
|
|
327
|
-
${
|
|
328
|
-
${
|
|
356
|
+
${R} ${ee} ${fr} ${Ie}
|
|
357
|
+
${tt} ${ht}
|
|
329
358
|
</div>
|
|
330
359
|
<div class="detail-side">
|
|
331
360
|
<div class="props-card">
|
|
@@ -333,16 +362,16 @@ Please report this to https://github.com/markedjs/marked.`,r){let s="<p>An error
|
|
|
333
362
|
<div class="prop">
|
|
334
363
|
<div class="label">Type</div>
|
|
335
364
|
<div class="value">
|
|
336
|
-
${
|
|
365
|
+
${dt(f.issue_type)}
|
|
337
366
|
</div>
|
|
338
367
|
</div>
|
|
339
368
|
<div class="prop">
|
|
340
369
|
<div class="label">Status</div>
|
|
341
|
-
<div class="value">${
|
|
370
|
+
<div class="value">${U}</div>
|
|
342
371
|
</div>
|
|
343
372
|
<div class="prop">
|
|
344
373
|
<div class="label">Priority</div>
|
|
345
|
-
<div class="value">${
|
|
374
|
+
<div class="value">${I}</div>
|
|
346
375
|
</div>
|
|
347
376
|
<div class="prop assignee">
|
|
348
377
|
<div class="label">Assignee</div>
|
|
@@ -350,75 +379,75 @@ Please report this to https://github.com/markedjs/marked.`,r){let s="<p>An error
|
|
|
350
379
|
${m?L`<input
|
|
351
380
|
type="text"
|
|
352
381
|
aria-label="Edit assignee"
|
|
353
|
-
.value=${
|
|
354
|
-
size=${Math.min(40,Math.max(12,(
|
|
355
|
-
@keydown=${
|
|
382
|
+
.value=${f.assignee||""}
|
|
383
|
+
size=${Math.min(40,Math.max(12,(f.assignee||"").length+3))}
|
|
384
|
+
@keydown=${K=>{K.key==="Escape"?(K.preventDefault(),N()):K.key==="Enter"&&(K.preventDefault(),T())}}
|
|
356
385
|
/>
|
|
357
386
|
<button
|
|
358
387
|
class="btn"
|
|
359
388
|
style="margin-left:6px"
|
|
360
|
-
@click=${
|
|
389
|
+
@click=${T}
|
|
361
390
|
>
|
|
362
391
|
Save
|
|
363
392
|
</button>
|
|
364
393
|
<button
|
|
365
394
|
class="btn"
|
|
366
395
|
style="margin-left:6px"
|
|
367
|
-
@click=${
|
|
396
|
+
@click=${N}
|
|
368
397
|
>
|
|
369
398
|
Cancel
|
|
370
|
-
</button>`:L`${(()=>{let
|
|
371
|
-
class=${
|
|
399
|
+
</button>`:L`${(()=>{let K=f.assignee||"",se=K.trim().length>0;return L`<span
|
|
400
|
+
class=${se?"editable":"editable muted"}
|
|
372
401
|
tabindex="0"
|
|
373
402
|
role="button"
|
|
374
403
|
aria-label="Edit assignee"
|
|
375
|
-
@click=${
|
|
376
|
-
@keydown=${
|
|
377
|
-
>${
|
|
404
|
+
@click=${b}
|
|
405
|
+
@keydown=${S}
|
|
406
|
+
>${se?K:"Unassigned"}</span
|
|
378
407
|
>`})()}`}
|
|
379
408
|
</div>
|
|
380
409
|
</div>
|
|
381
410
|
</div>
|
|
382
|
-
${
|
|
383
|
-
${
|
|
384
|
-
${
|
|
411
|
+
${St}
|
|
412
|
+
${le("Dependencies",f.dependencies||[])}
|
|
413
|
+
${le("Dependents",f.dependents||[])}
|
|
385
414
|
</div>
|
|
386
415
|
</div>
|
|
387
416
|
</div>
|
|
388
417
|
</div>
|
|
389
|
-
`}function
|
|
418
|
+
`}function D(){if(!i){P(o?"Loading\u2026":"No issue selected");return}Te(je(i),r)}function ft(f,R){return async U=>{if(U.stopPropagation(),!(!i||l)){l=!0;try{if(R==="Dependencies"){let I=await e("dep-remove",{a:i.id,b:f,view_id:i.id});I&&typeof I=="object"&&(i=I,D())}else{let I=await e("dep-remove",{a:f,b:i.id,view_id:i.id});I&&typeof I=="object"&&(i=I,D())}}catch(I){n("dep-remove failed %o",I)}finally{l=!1}}}}function Gt(f,R){return async U=>{if(!i||l)return;let I=U.currentTarget,ee=I.previousElementSibling,we=ee?ee.value.trim():"";if(!we||we===i.id){he("Enter a different issue id");return}if(new Set((f||[]).map(ce=>ce.id)).has(we)){he("Link already exists");return}l=!0,I&&(I.disabled=!0),ee&&(ee.disabled=!0);try{if(R==="Dependencies"){let ce=await e("dep-add",{a:i.id,b:we,view_id:i.id});ce&&typeof ce=="object"&&(i=ce,D())}else{let ce=await e("dep-add",{a:we,b:i.id,view_id:i.id});ce&&typeof ce=="object"&&(i=ce,D())}}catch(ce){n("dep-add failed %o",ce),he("Failed to add dependency","error")}finally{l=!1}}}function Wt(f){f.key==="Escape"?(a=!1,D()):f.key==="Enter"&&(f.preventDefault(),w())}function pr(f){f.key==="Enter"&&ne()}function At(f){f.key==="Enter"&&Fe()}function et(f){f.key==="Enter"&&Ae()}function Ge(f){f.key==="Enter"&&pe()}return{async load(f){if(!f){P("No issue selected");return}if(o=String(f),i=null,$(),i||P("Loading\u2026"),l=!1,y="",C=!1,D(),i&&!i.comments)try{let R=await e("get-comments",{id:o});Array.isArray(R)&&i&&o===f&&(i.comments=R,D())}catch(R){n("fetch comments failed %s %o",f,R)}},clear(){P("Select an issue to view details")},destroy(){r.replaceChildren()}}}function cr(r){let e=r.navigate,t=r.onUpdate,s=r.requestRender,n=r.getSelectedId||(()=>null),i=r.row_class||"issue-row",o=new Set;function l(u,h,m,x=""){let y=`${u}:${h}`;return o.has(y)?L`<span>
|
|
390
419
|
<input
|
|
391
420
|
type="text"
|
|
392
421
|
.value=${m}
|
|
393
422
|
class="inline-edit"
|
|
394
|
-
@keydown=${async
|
|
395
|
-
@blur=${async
|
|
423
|
+
@keydown=${async A=>{if(A.key==="Escape")o.delete(y),s();else if(A.key==="Enter"){let $=A.currentTarget.value||"";$!==m&&await t(u,{[h]:$}),o.delete(y),s()}}}
|
|
424
|
+
@blur=${async A=>{let $=A.currentTarget.value||"";$!==m&&await t(u,{[h]:$}),o.delete(y),s()}}
|
|
396
425
|
autofocus
|
|
397
426
|
/>
|
|
398
427
|
</span>`:L`<span
|
|
399
428
|
class="editable text-truncate ${m?"":"muted"}"
|
|
400
429
|
tabindex="0"
|
|
401
430
|
role="button"
|
|
402
|
-
@click=${
|
|
403
|
-
@keydown=${
|
|
404
|
-
>${m||
|
|
405
|
-
>`}function
|
|
431
|
+
@click=${A=>{A.stopPropagation(),A.preventDefault(),o.add(y),s()}}
|
|
432
|
+
@keydown=${A=>{A.key==="Enter"&&(A.preventDefault(),A.stopPropagation(),o.add(y),s())}}
|
|
433
|
+
>${m||x}</span
|
|
434
|
+
>`}function a(u,h){return async m=>{let y=m.currentTarget.value||"",C={};C[h]=h==="priority"?Number(y):y,await t(u,C)}}function p(u){return h=>{let m=h.target;m&&(m.tagName==="INPUT"||m.tagName==="SELECT")||e(u)}}function d(u){let h=String(u.status||"open"),m=String(u.priority??2),x=n()===u.id;return L`<tr
|
|
406
435
|
role="row"
|
|
407
|
-
class="${i} ${
|
|
436
|
+
class="${i} ${x?"selected":""}"
|
|
408
437
|
data-issue-id=${u.id}
|
|
409
438
|
@click=${p(u.id)}
|
|
410
439
|
>
|
|
411
|
-
<td role="gridcell" class="mono">${
|
|
412
|
-
<td role="gridcell">${
|
|
440
|
+
<td role="gridcell" class="mono">${Ve(u.id)}</td>
|
|
441
|
+
<td role="gridcell">${dt(u.issue_type)}</td>
|
|
413
442
|
<td role="gridcell">${l(u.id,"title",u.title||"")}</td>
|
|
414
443
|
<td role="gridcell">
|
|
415
444
|
<select
|
|
416
|
-
class="badge-select badge--status is-${
|
|
417
|
-
.value=${
|
|
418
|
-
@change=${
|
|
445
|
+
class="badge-select badge--status is-${h}"
|
|
446
|
+
.value=${h}
|
|
447
|
+
@change=${a(u.id,"status")}
|
|
419
448
|
>
|
|
420
|
-
${["open","in_progress","closed"].map(
|
|
421
|
-
${
|
|
449
|
+
${["open","in_progress","closed"].map(y=>L`<option value=${y} ?selected=${h===y}>
|
|
450
|
+
${Qe(y)}
|
|
422
451
|
</option>`)}
|
|
423
452
|
</select>
|
|
424
453
|
</td>
|
|
@@ -429,26 +458,26 @@ Please report this to https://github.com/markedjs/marked.`,r){let s="<p>An error
|
|
|
429
458
|
<select
|
|
430
459
|
class="badge-select badge--priority ${"is-p"+m}"
|
|
431
460
|
.value=${m}
|
|
432
|
-
@change=${
|
|
461
|
+
@change=${a(u.id,"priority")}
|
|
433
462
|
>
|
|
434
|
-
${
|
|
435
|
-
value=${String(
|
|
436
|
-
?selected=${m===String(
|
|
463
|
+
${Xe.map((y,C)=>L`<option
|
|
464
|
+
value=${String(C)}
|
|
465
|
+
?selected=${m===String(C)}
|
|
437
466
|
>
|
|
438
|
-
${
|
|
467
|
+
${Lt(C)} ${y}
|
|
439
468
|
</option>`)}
|
|
440
469
|
</select>
|
|
441
470
|
</td>
|
|
442
|
-
</tr>`}return d}function
|
|
471
|
+
</tr>`}return d}function gs(r,e,t,s=void 0,n=void 0){let i=[],o=new Set,l=new Set,a=new Map,p=n?Ze(n):null;p&&p.subscribe(()=>{let A=i.length===0;if(i=C(),u(),A&&i.length>0){let P=String(i[0].epic?.id||"");P&&!o.has(P)&&y(P)}});let d=cr({navigate:A=>t(A),onUpdate:x,requestRender:u,getSelectedId:()=>null,row_class:"epic-row"});function u(){Te(h(),r)}function h(){return i.length?L`${i.map(A=>m(A))}`:L`<div class="panel__header muted">No epics found.</div>`}function m(A){let P=A.epic||{},$=String(P.id||""),E=o.has($),O=p?p.selectEpicChildren($):[],w=l.has($);return L`
|
|
443
472
|
<div class="epic-group" data-epic-id=${$}>
|
|
444
473
|
<div
|
|
445
474
|
class="epic-header"
|
|
446
|
-
@click=${()=>
|
|
475
|
+
@click=${()=>y($)}
|
|
447
476
|
role="button"
|
|
448
477
|
tabindex="0"
|
|
449
|
-
aria-expanded=${
|
|
478
|
+
aria-expanded=${E}
|
|
450
479
|
>
|
|
451
|
-
${
|
|
480
|
+
${Ve($,{class_name:"mono"})}
|
|
452
481
|
<span class="text-truncate" style="margin-left:8px"
|
|
453
482
|
>${P.title||"(no title)"}</span
|
|
454
483
|
>
|
|
@@ -457,16 +486,16 @@ Please report this to https://github.com/markedjs/marked.`,r){let s="<p>An error
|
|
|
457
486
|
style="margin-left:auto; display:flex; align-items:center; gap:8px;"
|
|
458
487
|
>
|
|
459
488
|
<progress
|
|
460
|
-
value=${Number(
|
|
461
|
-
max=${Math.max(1,Number(
|
|
489
|
+
value=${Number(A.closed_children||0)}
|
|
490
|
+
max=${Math.max(1,Number(A.total_children||0))}
|
|
462
491
|
></progress>
|
|
463
492
|
<span class="muted mono"
|
|
464
|
-
>${
|
|
493
|
+
>${A.closed_children}/${A.total_children}</span
|
|
465
494
|
>
|
|
466
495
|
</span>
|
|
467
496
|
</div>
|
|
468
|
-
${
|
|
469
|
-
${
|
|
497
|
+
${E?L`<div class="epic-children">
|
|
498
|
+
${w?L`<div class="muted">Loading…</div>`:O.length===0?L`<div class="muted">No issues found</div>`:L`<table class="table">
|
|
470
499
|
<colgroup>
|
|
471
500
|
<col style="width: 100px" />
|
|
472
501
|
<col style="width: 120px" />
|
|
@@ -486,12 +515,12 @@ Please report this to https://github.com/markedjs/marked.`,r){let s="<p>An error
|
|
|
486
515
|
</tr>
|
|
487
516
|
</thead>
|
|
488
517
|
<tbody>
|
|
489
|
-
${O.map(
|
|
518
|
+
${O.map(k=>d(k))}
|
|
490
519
|
</tbody>
|
|
491
520
|
</table>`}
|
|
492
521
|
</div>`:null}
|
|
493
522
|
</div>
|
|
494
|
-
`}async function
|
|
523
|
+
`}async function x(A,P){try{await e.updateIssue({id:A,...P}),u()}catch{}}async function y(A){if(o.has(A)){if(o.delete(A),a.has(A)){try{let P=a.get(A);P&&await P()}catch{}a.delete(A);try{n&&n.unregister&&n.unregister(`detail:${A}`)}catch{}}}else{if(o.add(A),l.add(A),u(),s&&typeof s.subscribeList=="function")try{try{n&&n.register&&n.register(`detail:${A}`,{type:"issue-detail",params:{id:A}})}catch{}let P=await s.subscribeList(`detail:${A}`,{type:"issue-detail",params:{id:A}});a.set(A,P)}catch{}l.delete(A)}u()}function C(){let A=n&&n.snapshotFor?n.snapshotFor("tab:epics")||[]:[],P=[];for(let $ of A){let E=Array.isArray($.dependents)?$.dependents:[],O=Number.isFinite($.total_children),w=Number.isFinite($.closed_children),k=O?Number($.total_children)||0:E.length,b=w&&Number($.closed_children)||0;if(!w)for(let S of E)String(S.status||"")==="closed"&&b++;P.push({epic:$,total_children:k,closed_children:b})}return P}return{async load(){i=C(),u();try{if(i.length>0){let A=String(i[0].epic?.id||"");A&&!o.has(A)&&await y(A)}}catch{}}}}function ms(r){let e=document.createElement("dialog");e.id="fatal-error-dialog",e.setAttribute("role","alertdialog"),e.setAttribute("aria-modal","true"),e.innerHTML=`
|
|
495
524
|
<div class="fatal-error">
|
|
496
525
|
<div class="fatal-error__icon" aria-hidden="true">!</div>
|
|
497
526
|
<div class="fatal-error__body">
|
|
@@ -504,7 +533,7 @@ Please report this to https://github.com/markedjs/marked.`,r){let s="<p>An error
|
|
|
504
533
|
<button type="button" class="btn" id="fatal-error-close">Dismiss</button>
|
|
505
534
|
</div>
|
|
506
535
|
</div>
|
|
507
|
-
</div>`,r.appendChild(e);let t=e.querySelector("#fatal-error-title"),s=e.querySelector("#fatal-error-message"),n=e.querySelector("#fatal-error-detail"),i=e.querySelector("#fatal-error-reload"),
|
|
536
|
+
</div>`,r.appendChild(e);let t=e.querySelector("#fatal-error-title"),s=e.querySelector("#fatal-error-message"),n=e.querySelector("#fatal-error-detail"),i=e.querySelector("#fatal-error-reload"),o=e.querySelector("#fatal-error-close"),l=()=>{if(typeof e.close=="function")try{e.close()}catch{}e.removeAttribute("open")},a=(p,d,u="")=>{t&&(t.textContent=p||"Unexpected Error"),s&&(s.textContent=d||"An unrecoverable error occurred.");let h=typeof u=="string"?u.trim():"";if(n&&(h.length>0?(n.textContent=h,n.removeAttribute("hidden")):(n.textContent="No additional diagnostics available.",n.setAttribute("hidden",""))),typeof e.showModal=="function")try{e.showModal(),e.setAttribute("open","")}catch{e.setAttribute("open","")}else e.setAttribute("open","")};return i&&i.addEventListener("click",()=>{window.location.reload()}),o&&o.addEventListener("click",()=>l()),e.addEventListener("cancel",p=>{p.preventDefault(),l()}),{open:a,close:l,getElement(){return e}}}function bs(r,e,t){let s=document.createElement("dialog");s.id="issue-dialog",s.setAttribute("role","dialog"),s.setAttribute("aria-modal","true"),s.innerHTML=`
|
|
508
537
|
<div class="issue-dialog__container" part="container">
|
|
509
538
|
<header class="issue-dialog__header">
|
|
510
539
|
<div class="issue-dialog__title">
|
|
@@ -514,40 +543,40 @@ Please report this to https://github.com/markedjs/marked.`,r){let s="<p>An error
|
|
|
514
543
|
</header>
|
|
515
544
|
<div class="issue-dialog__body" id="issue-dialog-body"></div>
|
|
516
545
|
</div>
|
|
517
|
-
`,r.appendChild(s);let n=s.querySelector("#issue-dialog-body"),i=s.querySelector("#issue-dialog-title"),
|
|
546
|
+
`,r.appendChild(s);let n=s.querySelector("#issue-dialog-body"),i=s.querySelector("#issue-dialog-title"),o=s.querySelector(".issue-dialog__close");function l(m){i.replaceChildren(),i.appendChild(Ve(m))}s.addEventListener("mousedown",m=>{m.target===s&&(m.preventDefault(),p())}),s.addEventListener("cancel",m=>{m.preventDefault(),p()}),o.addEventListener("click",()=>p());let a=null;function p(){try{typeof s.close=="function"?s.close():s.removeAttribute("open")}catch{s.removeAttribute("open")}try{t()}catch{}h()}function d(m){try{let x=document.activeElement;x&&x instanceof HTMLElement?a=x:a=null}catch{a=null}l(m);try{"showModal"in s&&typeof s.showModal=="function"?s.showModal():s.setAttribute("open",""),setTimeout(()=>{try{o.focus()}catch{}},0)}catch{s.setAttribute("open","")}}function u(){try{typeof s.close=="function"?s.close():s.removeAttribute("open")}catch{s.removeAttribute("open")}h()}function h(){try{a&&document.contains(a)&&a.focus()}catch{}finally{a=null}}return{open:d,close:u,getMount(){return n}}}var dr=["bug","feature","task","epic","chore"];function ur(r){switch((r||"").toString().toLowerCase()){case"bug":return"Bug";case"feature":return"Feature";case"task":return"Task";case"epic":return"Epic";case"chore":return"Chore";default:return""}}function ys(r,e,t,s,n=void 0,i=void 0){let o=oe("views:list"),l="all",a="",p=[],d="",u=s?s.getState().selected_id:null,h=null,m=cr({navigate:w=>{let k=t||(S=>window.location.hash=S),b=s?s.getState().view:"issues";k(Ye(b,w))},onUpdate:E,requestRender:$,getSelectedId:()=>u,row_class:"issue-row"}),x=async w=>{l=w.currentTarget.value,o("status change %s",l),s&&s.setState({filters:{status:l}}),await O()},y=w=>{a=w.currentTarget.value,o("search input %s",a),s&&s.setState({filters:{search:a}}),$()},C=w=>{d=w.currentTarget.value||"",o("type change %s",d||"(all)"),s&&s.setState({filters:{type:d}}),$()};if(s){let w=s.getState();w&&w.filters&&typeof w.filters=="object"&&(l=w.filters.status||"all",a=w.filters.search||"",d=typeof w.filters.type=="string"?w.filters.type:"")}let A=i?Ze(i):null;function P(){let w=p;if(l!=="all"&&l!=="ready"&&(w=w.filter(k=>String(k.status||"")===l)),a){let k=a.toLowerCase();w=w.filter(b=>{let S=String(b.id).toLowerCase(),T=String(b.title||"").toLowerCase();return S.includes(k)||T.includes(k)})}return d&&(w=w.filter(k=>String(k.issue_type||"")===String(d))),l==="closed"&&(w=w.slice().sort(kt)),L`
|
|
518
547
|
<div class="panel__header">
|
|
519
|
-
<select @change=${
|
|
548
|
+
<select @change=${x} .value=${l}>
|
|
520
549
|
<option value="all">All</option>
|
|
521
550
|
<option value="ready">Ready</option>
|
|
522
|
-
<option value="open">${
|
|
523
|
-
<option value="in_progress">${
|
|
524
|
-
<option value="closed">${
|
|
551
|
+
<option value="open">${Qe("open")}</option>
|
|
552
|
+
<option value="in_progress">${Qe("in_progress")}</option>
|
|
553
|
+
<option value="closed">${Qe("closed")}</option>
|
|
525
554
|
</select>
|
|
526
555
|
<select
|
|
527
|
-
@change=${
|
|
556
|
+
@change=${C}
|
|
528
557
|
.value=${d}
|
|
529
558
|
aria-label="Filter by type"
|
|
530
559
|
>
|
|
531
560
|
<option value="">All types</option>
|
|
532
|
-
${
|
|
533
|
-
${
|
|
561
|
+
${dr.map(k=>L`<option value=${k} ?selected=${d===k}>
|
|
562
|
+
${ur(k)}
|
|
534
563
|
</option>`)}
|
|
535
564
|
</select>
|
|
536
565
|
<input
|
|
537
566
|
type="search"
|
|
538
567
|
placeholder="Search…"
|
|
539
|
-
@input=${
|
|
540
|
-
.value=${
|
|
568
|
+
@input=${y}
|
|
569
|
+
.value=${a}
|
|
541
570
|
/>
|
|
542
571
|
</div>
|
|
543
572
|
<div class="panel__body" id="list-root">
|
|
544
|
-
${
|
|
573
|
+
${w.length===0?L`<div class="issues-block">
|
|
545
574
|
<div class="muted" style="padding:10px 12px;">No issues</div>
|
|
546
575
|
</div>`:L`<div class="issues-block">
|
|
547
576
|
<table
|
|
548
577
|
class="table"
|
|
549
578
|
role="grid"
|
|
550
|
-
aria-rowcount=${String(
|
|
579
|
+
aria-rowcount=${String(w.length)}
|
|
551
580
|
aria-colcount="6"
|
|
552
581
|
>
|
|
553
582
|
<colgroup>
|
|
@@ -569,12 +598,12 @@ Please report this to https://github.com/markedjs/marked.`,r){let s="<p>An error
|
|
|
569
598
|
</tr>
|
|
570
599
|
</thead>
|
|
571
600
|
<tbody role="rowgroup">
|
|
572
|
-
${
|
|
601
|
+
${w.map(k=>m(k))}
|
|
573
602
|
</tbody>
|
|
574
603
|
</table>
|
|
575
604
|
</div>`}
|
|
576
605
|
</div>
|
|
577
|
-
`}function $(){
|
|
606
|
+
`}function $(){Te(P(),r)}$();async function E(w,k){try{o("updateInline %s %o",w,Object.keys(k)),typeof k.title=="string"&&await e("edit-text",{id:w,field:"title",value:k.title}),typeof k.assignee=="string"&&await e("update-assignee",{id:w,assignee:k.assignee}),typeof k.status=="string"&&await e("update-status",{id:w,status:k.status}),typeof k.priority=="number"&&await e("update-priority",{id:w,priority:k.priority})}catch{}}async function O(){o("load");let w=r.querySelector("#list-root"),k=w?w.scrollTop:0;try{A?p=A.selectIssuesFor("tab:issues"):p=[]}catch(b){o("load failed: %o",b),p=[]}$();try{let b=r.querySelector("#list-root");b&&k>0&&(b.scrollTop=k)}catch{}}return r.tabIndex=0,r.addEventListener("keydown",w=>{if(w.key==="ArrowDown"||w.key==="ArrowUp"){let T=w.target;if((T&&typeof T.closest=="function"?T.closest("#list-root table.table"):null)&&!!!(T&&typeof T.closest=="function"&&(T.closest("input")||T.closest("textarea")||T.closest("select")))){let W=T&&typeof T.closest=="function"?T.closest("td"):null;if(W&&W.parentElement){let Z=W.parentElement,Y=Z.parentElement;if(Y&&Y.querySelectorAll){let j=Array.from(Y.querySelectorAll("tr")),re=Math.max(0,j.indexOf(Z)),ne=W.cellIndex||0,ge=w.key==="ArrowDown"?Math.min(re+1,j.length-1):Math.max(re-1,0),me=j[ge],B=me&&me.cells?me.cells[ne]:null;if(B){let pe=B.querySelector('button:not([disabled]), [tabindex]:not([tabindex="-1"]), a[href], select:not([disabled]), input:not([disabled]):not([type="hidden"]), textarea:not([disabled])');if(pe&&typeof pe.focus=="function"){w.preventDefault(),pe.focus();return}}}}}}let k=r.querySelector("#list-root tbody"),b=k?k.querySelectorAll("tr"):[];if(b.length===0)return;let S=0;if(u&&(S=Array.from(b).findIndex(N=>(N.getAttribute("data-issue-id")||"")===u),S<0&&(S=0)),w.key==="ArrowDown"){w.preventDefault();let T=b[Math.min(S+1,b.length-1)],N=T?T.getAttribute("data-issue-id"):"",q=N||null;s&&q&&s.setState({selected_id:q}),u=q,$()}else if(w.key==="ArrowUp"){w.preventDefault();let T=b[Math.max(S-1,0)],N=T?T.getAttribute("data-issue-id"):"",q=N||null;s&&q&&s.setState({selected_id:q}),u=q,$()}else if(w.key==="Enter"){w.preventDefault();let T=b[S],N=T?T.getAttribute("data-issue-id"):"";if(N){let q=t||(Z=>window.location.hash=Z),W=s?s.getState().view:"issues";q(Ye(W,N))}}}),s&&(h=s.subscribe(w=>{if(w.selected_id!==u&&(u=w.selected_id,o("selected %s",u||"(none)"),$()),w.filters&&typeof w.filters=="object"){let k=w.filters.status,b=w.filters.search||"",S=typeof w.filters.type=="string"?w.filters.type:"",T=!1;if(k!==l){l=k,O();return}b!==a&&(a=b,T=!0),S!==d&&(d=S,T=!0),T&&$()}})),A&&A.subscribe(()=>{try{p=A.selectIssuesFor("tab:issues"),$()}catch{}}),{load:O,destroy(){r.replaceChildren(),h&&(h(),h=null)}}}function ws(r,e,t){let s=oe("views:nav"),n=null;function i(a){return p=>{p.preventDefault(),s("click tab %s",a),t.gotoView(a)}}function o(){let p=e.getState().view||"issues";return L`
|
|
578
607
|
<nav class="header-nav" aria-label="Primary">
|
|
579
608
|
<a
|
|
580
609
|
href="#/issues"
|
|
@@ -595,7 +624,7 @@ Please report this to https://github.com/markedjs/marked.`,r){let s="<p>An error
|
|
|
595
624
|
>Board</a
|
|
596
625
|
>
|
|
597
626
|
</nav>
|
|
598
|
-
`}function l(){
|
|
627
|
+
`}function l(){Te(o(),r)}return l(),n=e.subscribe(()=>l()),{destroy(){n&&(n(),n=null),Te(L``,r)}}}function ks(r,e,t,s){let n=document.createElement("dialog");n.id="new-issue-dialog",n.setAttribute("role","dialog"),n.setAttribute("aria-modal","true"),n.innerHTML=`
|
|
599
628
|
<div class="new-issue__container" part="container">
|
|
600
629
|
<header class="new-issue__header">
|
|
601
630
|
<div class="new-issue__title">New Issue</div>
|
|
@@ -627,12 +656,12 @@ Please report this to https://github.com/markedjs/marked.`,r){let s="<p>An error
|
|
|
627
656
|
</form>
|
|
628
657
|
</div>
|
|
629
658
|
</div>
|
|
630
|
-
`,r.appendChild(n);let i=n.querySelector("#new-issue-form"),
|
|
659
|
+
`,r.appendChild(n);let i=n.querySelector("#new-issue-form"),o=n.querySelector("#new-title"),l=n.querySelector("#new-type"),a=n.querySelector("#new-priority"),p=n.querySelector("#new-labels"),d=n.querySelector("#new-description"),u=n.querySelector("#new-issue-error"),h=n.querySelector("#btn-cancel"),m=n.querySelector("#btn-create"),x=n.querySelector(".new-issue__close");function y(){l.replaceChildren();let b=document.createElement("option");b.value="",b.textContent="\u2014 Select \u2014",l.appendChild(b);for(let S of dr){let T=document.createElement("option");T.value=S,T.textContent=ur(S),l.appendChild(T)}a.replaceChildren();for(let S=0;S<=4;S+=1){let T=document.createElement("option");T.value=String(S);let N=Xe[S]||"Medium";T.textContent=`${S} \u2013 ${N}`,a.appendChild(T)}}y();function C(){try{typeof n.close=="function"?n.close():n.removeAttribute("open")}catch{n.removeAttribute("open")}}function A(b){o.disabled=b,l.disabled=b,a.disabled=b,p.disabled=b,d.disabled=b,h.disabled=b,m.disabled=b,m.textContent=b?"Creating\u2026":"Create"}function P(){u.textContent=""}function $(b){u.textContent=b}function E(){try{let b=window.localStorage.getItem("beads-ui.new.type");b?l.value=b:l.value="";let S=window.localStorage.getItem("beads-ui.new.priority");S&&/^\d$/.test(S)?a.value=S:a.value="2"}catch{l.value="",a.value="2"}}function O(){let b=l.value||"",S=a.value||"";b.length>0&&window.localStorage.setItem("beads-ui.new.type",b),S.length>0&&window.localStorage.setItem("beads-ui.new.priority",S)}function w(b){let S=/-(\d+)$/.exec(String(b||""));return S&&S[1]?Number(S[1]):-1}async function k(){P();let b=String(o.value||"").trim();if(b.length===0){$("Title is required"),o.focus();return}let S=Number(a.value||"2");if(!(S>=0&&S<=4)){$("Priority must be 0..4"),a.focus();return}let T=String(l.value||""),N=String(d.value||""),q=String(p.value||"").split(",").map(j=>j.trim()).filter(j=>j.length>0),W={title:b};T.length>0&&(W.type=T),String(S).length>0&&(W.priority=S),N.length>0&&(W.description=N),A(!0);try{await e("create-issue",W)}catch{A(!1),$("Failed to create issue");return}O();let Z=null;try{Z=await e("list-issues",{filters:{status:"open",limit:50}})}catch{Z=null}let Y="";if(Array.isArray(Z)){let j=Z.filter(re=>String(re.title||"")===b);if(j.length>0){let re=j[0];for(let ne of j){let ge=w(re.id||"");w(ne.id||"")>ge&&(re=ne)}Y=String(re.id||"")}}if(Y&&q.length>0)for(let j of q)try{await e("label-add",{id:Y,label:j})}catch{}if(Y){try{t.gotoIssue(Y)}catch{}try{s&&s.setState({selected_id:Y})}catch{}}A(!1),C()}return n.addEventListener("cancel",b=>{b.preventDefault(),C()}),x.addEventListener("click",()=>C()),h.addEventListener("click",()=>C()),n.addEventListener("keydown",b=>{b.key==="Enter"&&(b.ctrlKey||b.metaKey)&&(b.preventDefault(),k())}),i.addEventListener("submit",b=>{b.preventDefault(),k()}),{open(){i.reset(),P(),E();try{"showModal"in n&&typeof n.showModal=="function"?n.showModal():n.setAttribute("open","")}catch{n.setAttribute("open","")}setTimeout(()=>{try{o.focus()}catch{}},0)},close(){C()}}}var _s=["list-issues","update-status","edit-text","update-priority","create-issue","list-ready","dep-add","dep-remove","epic-status","update-assignee","label-add","label-remove","subscribe-list","unsubscribe-list","snapshot","upsert","delete","get-comments","add-comment"];function Vr(){let r=Date.now().toString(36),e=Math.random().toString(36).slice(2,8);return`${r}-${e}`}function xs(r,e,t=Vr()){return{id:t,type:r,payload:e}}function vs(r={}){let e=oe("ws"),t={initialMs:r.backoff?.initialMs??1e3,maxMs:r.backoff?.maxMs??3e4,factor:r.backoff?.factor??2,jitterRatio:r.backoff?.jitterRatio??.2},s=()=>r.url&&r.url.length>0?r.url:typeof location<"u"?(location.protocol==="https:"?"wss://":"ws://")+location.host+"/ws":"ws://localhost/ws",n=null,i="closed",o=0,l=null,a=!0,p=new Map,d=[],u=new Map,h=new Set;function m(E){for(let O of Array.from(h))try{O(E)}catch{}}function x(){if(!a||l)return;i="reconnecting",e("ws reconnecting\u2026"),m(i);let E=Math.min(t.maxMs||0,(t.initialMs||0)*Math.pow(t.factor||1,o)),O=(t.jitterRatio||0)*E,w=Math.max(0,Math.round(E+(Math.random()*2-1)*O));e("ws retry in %d ms (attempt %d)",w,o+1),l=setTimeout(()=>{l=null,$()},w)}function y(E){try{n?.send(JSON.stringify(E))}catch(O){e("ws send failed",O)}}function C(){for(i="open",e("ws open"),m(i),o=0;d.length;){let E=d.shift();E&&y(E)}}function A(E){let O;try{O=JSON.parse(String(E.data))}catch{e("ws received non-JSON message");return}if(!O||typeof O.id!="string"||typeof O.type!="string"){e("ws received invalid envelope");return}if(p.has(O.id)){let k=p.get(O.id);p.delete(O.id),O.ok?k?.resolve(O.payload):k?.reject(O.error||new Error("ws error"));return}let w=u.get(O.type);if(w&&w.size>0)for(let k of Array.from(w))try{k(O.payload)}catch(b){e("ws event handler error",b)}else e("ws received unhandled message type: %s",O.type)}function P(){i="closed",e("ws closed"),m(i);for(let[E,O]of p.entries())O.reject(new Error("ws disconnected")),p.delete(E);o+=1,x()}function $(){if(!a)return;let E=s();try{n=new WebSocket(E),e("ws connecting %s",E),i="connecting",m(i),n.addEventListener("open",C),n.addEventListener("message",A),n.addEventListener("error",()=>{}),n.addEventListener("close",P)}catch(O){e("ws connect failed %o",O),x()}}return $(),{send(E,O){if(!_s.includes(E))return Promise.reject(new Error(`unknown message type: ${E}`));let w=Vr(),k=xs(E,O,w);return e("send %s id=%s",E,w),new Promise((b,S)=>{p.set(w,{resolve:b,reject:S,type:E}),n&&n.readyState===n.OPEN?y(k):(e("queue %s id=%s (state=%s)",E,w,i),d.push(k))})},on(E,O){u.has(E)||u.set(E,new Set);let w=u.get(E);return w?.add(O),()=>{w?.delete(O)}},onConnection(E){return h.add(E),()=>{h.delete(E)}},close(){a=!1,l&&(clearTimeout(l),l=null);try{n?.close()}catch{}},getState(){return i}}}function so(r){let e=oe("main");e("bootstrap start");let t=L`
|
|
631
660
|
<section id="issues-root" class="route issues">
|
|
632
661
|
<aside id="list-panel" class="panel"></aside>
|
|
633
662
|
</section>
|
|
634
663
|
<section id="epics-root" class="route epics" hidden></section>
|
|
635
664
|
<section id="board-root" class="route board" hidden></section>
|
|
636
665
|
<section id="detail-panel" class="route detail" hidden></section>
|
|
637
|
-
`;
|
|
666
|
+
`;Te(t,r);let s=document.getElementById("top-nav"),n=document.getElementById("issues-root"),i=document.getElementById("epics-root"),o=document.getElementById("board-root"),l=document.getElementById("list-panel"),a=document.getElementById("detail-panel");if(l&&n&&i&&o&&a){let y=function(_,g){let H="Request failed",z="";if(_&&typeof _=="object"){let le=_;if(typeof le.message=="string"&&le.message.length>0&&(H=le.message),typeof le.details=="string")z=le.details;else if(le.details&&typeof le.details=="object")try{z=JSON.stringify(le.details,null,2)}catch{z=""}}else typeof _=="string"&&_.length>0&&(H=_);let ue=g&&g.length>0?`Failed to load ${g}`:"Request failed";x.open(ue,H,z)},Re=function(_){let g=String(_?.status||"all");return g==="ready"?{type:"ready-issues"}:g==="in_progress"?{type:"in-progress-issues"}:g==="closed"?{type:"closed-issues"}:{type:"all-issues"}},Fe=function(_){if(_.view==="issues"){let g=Re(_.filters||{}),H=JSON.stringify(g);try{$.register("tab:issues",g)}catch(z){e("register issues store failed: %o",z)}(!pe||H!==qe)&&P.subscribeList("tab:issues",g).then(z=>{pe=z,qe=H}).catch(z=>{e("subscribe issues failed: %o",z),y(z,"issues list")})}else if(pe){pe().catch(()=>{}),pe=null,qe=null;try{$.unregister("tab:issues")}catch(g){e("unregister issues store failed: %o",g)}}if(_.view==="epics"){try{$.register("tab:epics",{type:"epics"})}catch(g){e("register epics store failed: %o",g)}P.subscribeList("tab:epics",{type:"epics"}).then(g=>{te=g}).catch(g=>{e("subscribe epics failed: %o",g),y(g,"epics")})}else if(te){te().catch(()=>{}),te=null;try{$.unregister("tab:epics")}catch(g){e("unregister epics store failed: %o",g)}}if(_.view==="board"){if(!Oe){try{$.register("tab:board:ready",{type:"ready-issues"})}catch(g){e("register board:ready store failed: %o",g)}P.subscribeList("tab:board:ready",{type:"ready-issues"}).then(g=>Oe=g).catch(g=>{e("subscribe board ready failed: %o",g),y(g,"board (Ready)")})}if(!Q){try{$.register("tab:board:in-progress",{type:"in-progress-issues"})}catch(g){e("register board:in-progress store failed: %o",g)}P.subscribeList("tab:board:in-progress",{type:"in-progress-issues"}).then(g=>Q=g).catch(g=>{e("subscribe board in-progress failed: %o",g),y(g,"board (In Progress)")})}if(!Ae){try{$.register("tab:board:closed",{type:"closed-issues"})}catch(g){e("register board:closed store failed: %o",g)}P.subscribeList("tab:board:closed",{type:"closed-issues"}).then(g=>Ae=g).catch(g=>{e("subscribe board closed failed: %o",g),y(g,"board (Closed)")})}if(!Ce){try{$.register("tab:board:blocked",{type:"blocked-issues"})}catch(g){e("register board:blocked store failed: %o",g)}P.subscribeList("tab:board:blocked",{type:"blocked-issues"}).then(g=>Ce=g).catch(g=>{e("subscribe board blocked failed: %o",g),y(g,"board (Blocked)")})}}else{if(Oe){Oe().catch(()=>{}),Oe=null;try{$.unregister("tab:board:ready")}catch(g){e("unregister board:ready failed: %o",g)}}if(Q){Q().catch(()=>{}),Q=null;try{$.unregister("tab:board:in-progress")}catch(g){e("unregister board:in-progress failed: %o",g)}}if(Ae){Ae().catch(()=>{}),Ae=null;try{$.unregister("tab:board:closed")}catch(g){e("unregister board:closed failed: %o",g)}}if(Ce){Ce().catch(()=>{}),Ce=null;try{$.unregister("tab:board:blocked")}catch(g){e("unregister board:blocked failed: %o",g)}}}};var p=y,d=Re,u=Fe;let h=document.getElementById("header-loading"),m=Ln(h),x=ms(r),C=vs(),A=m.wrapSend((_,g)=>C.send(_,g)),P=En(A),$=Cn();C.on("snapshot",_=>{let g=_,H=g&&typeof g.id=="string"?g.id:"",z=H?$.getStore(H):null;if(z&&g&&g.type==="snapshot")try{z.applyPush(g)}catch{}}),C.on("upsert",_=>{let g=_,H=g&&typeof g.id=="string"?g.id:"",z=H?$.getStore(H):null;if(z&&g&&g.type==="upsert")try{z.applyPush(g)}catch{}}),C.on("delete",_=>{let g=_,H=g&&typeof g.id=="string"?g.id:"",z=H?$.getStore(H):null;if(z&&g&&g.type==="delete")try{z.applyPush(g)}catch{}});let E=Ze($),O=!1;if(typeof C.onConnection=="function"){let _=g=>{e("ws state %s",g),g==="reconnecting"||g==="closed"?(O=!0,he("Connection lost. Reconnecting\u2026","error",4e3)):g==="open"&&O&&(O=!1,he("Reconnected","success",2200))};C.onConnection(_)}let w={status:"all",search:"",type:""};try{let _=window.localStorage.getItem("beads-ui.filters");if(_){let g=JSON.parse(_);if(g&&typeof g=="object"){let H=["bug","feature","task","epic","chore"],z="";if(typeof g.type=="string"&&H.includes(g.type))z=g.type;else if(Array.isArray(g.types)){let ue="";for(let le of g.types)if(H.includes(String(le))){ue=le;break}z=ue}w={status:["all","open","in_progress","closed","ready"].includes(g.status)?g.status:"all",search:typeof g.search=="string"?g.search:"",type:z}}}}catch(_){e("filters parse error: %o",_)}let k="issues";try{let _=window.localStorage.getItem("beads-ui.view");(_==="issues"||_==="epics"||_==="board")&&(k=_)}catch(_){e("view parse error: %o",_)}let b={closed_filter:"today"};try{let _=window.localStorage.getItem("beads-ui.board");if(_){let g=JSON.parse(_);if(g&&typeof g=="object"){let H=String(g.closed_filter||"today");(H==="today"||H==="3"||H==="7")&&(b.closed_filter=H)}}}catch(_){e("board prefs parse error: %o",_)}let S=In({filters:w,view:k,board:b}),T=Rn(S);T.start();let N=async(_,g)=>{try{return await A(_,g)}catch{return[]}};s&&ws(s,S,T);let q=ks(r,(_,g)=>A(_,g),T,S);try{let _=document.getElementById("new-issue-btn");_&&_.addEventListener("click",()=>q.open())}catch{}let Z=ys(l,async(_,g)=>{if(_==="list-issues")try{return E.selectIssuesFor("tab:issues")}catch(H){return e("list selectors failed: %o",H),[]}return N(_,g)},_=>{let g=Xt(_);g&&T.gotoIssue(g)},S,P,$);S.subscribe(_=>{let g={status:_.filters.status,search:_.filters.search,type:typeof _.filters.type=="string"?_.filters.type:""};window.localStorage.setItem("beads-ui.filters",JSON.stringify(g))}),S.subscribe(_=>{window.localStorage.setItem("beads-ui.board",JSON.stringify({closed_filter:_.board.closed_filter}))}),Z.load();let Y=bs(a,S,()=>{let _=S.getState();S.setState({selected_id:null});try{let g=_.view||"issues";T.gotoView(g)}catch{}}),j=null;j=hs(Y.getMount(),N,_=>{let g=Xt(_);g&&T.gotoIssue(g)},$);let re=S.getState().selected_id;if(re){a.hidden=!1,Y.open(re),j&&j.load(re);let _=`detail:${re}`,g={type:"issue-detail",params:{id:re}};try{$.register(_,g)}catch(H){e("register detail store failed: %o",H)}P.subscribeList(_,g).catch(H=>{e("detail subscribe failed: %o",H),y(H,"issue details")})}let ne=null;S.subscribe(_=>{let g=_.selected_id;if(g){a.hidden=!1,Y.open(g),j&&j.load(g);let H=`detail:${g}`,z={type:"issue-detail",params:{id:g}};try{$.register(H,z)}catch{}P.subscribeList(H,z).then(ue=>{ne&&ne().catch(()=>{}),ne=ue}).catch(ue=>{e("detail subscribe failed: %o",ue),y(ue,"issue details")})}else{try{Y.close()}catch{}j&&j.clear(),a.hidden=!0,ne&&(ne().catch(()=>{}),ne=null)}});let ge=$n(N),me=gs(i,ge,_=>T.gotoIssue(_),P,$),B=Nn(o,ge,_=>T.gotoIssue(_),S,P,$),pe=null,te=null,Oe=null,Q=null,Ae=null,Ce=null,qe=null,Je=_=>{n&&i&&o&&a&&(n.hidden=_.view!=="issues",i.hidden=_.view!=="epics",o.hidden=_.view!=="board"),Fe(_),!_.selected_id&&_.view==="epics"&&me.load(),!_.selected_id&&_.view==="board"&&B.load(),window.localStorage.setItem("beads-ui.view",_.view)};S.subscribe(Je),Je(S.getState()),window.addEventListener("keydown",_=>{let g=_.ctrlKey||_.metaKey,H=String(_.key||"").toLowerCase(),z=_.target,ue=z&&z.tagName?String(z.tagName).toLowerCase():"",le=ue==="input"||ue==="textarea"||ue==="select"||z&&typeof z.isContentEditable=="boolean"&&z.isContentEditable;g&&H==="n"&&(le||(_.preventDefault(),q.open()))})}}typeof window<"u"&&typeof document<"u"&&window.addEventListener("DOMContentLoaded",()=>{try{let t=window.localStorage.getItem("beads-ui.theme"),s=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches,n=t==="dark"||t==="light"?t:s?"dark":"light";document.documentElement.setAttribute("data-theme",n);let i=document.getElementById("theme-switch");i&&(i.checked=n==="dark")}catch{}let r=document.getElementById("theme-switch");r&&r.addEventListener("change",()=>{let t=r.checked?"dark":"light";document.documentElement.setAttribute("data-theme",t),window.localStorage.setItem("beads-ui.theme",t)});let e=document.getElementById("app");e&&so(e)});export{so as bootstrap};
|
|
638
667
|
//# sourceMappingURL=main.bundle.js.map
|