@livx.cc/bare-v3 0.1.0-alpha.85 → 0.1.0-alpha.87
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/components/board.js
CHANGED
|
@@ -2,9 +2,9 @@ var{defineProperty:at,getOwnPropertyNames:hi,getOwnPropertyDescriptor:pi}=Object
|
|
|
2
2
|
|
|
3
3
|
${r?'Expression: "'+r+`"
|
|
4
4
|
|
|
5
|
-
`:""}`,t),setTimeout(()=>{throw e},0)}function Ur(e){let t=W;W=!1;let r=e();return W=t,r}function Y(e,t,r={}){let n;return A(e,t)((i)=>n=i,r),n}function A(...e){return jr(...e)}function Yi(e){jr=e}function Ji(e){qr=e}function Gi(e,t){return(r=()=>{},{scope:n={},params:i=[],context:o}={})=>{if(!W){wt(r,t,G([n,...e]),i);return}let s=t.apply(G([n,...e]),i);wt(r,s)}}function wt(e,t,r,n,i){if(W&&typeof t==="function"){let o=t.apply(r,n);if(o instanceof Promise)o.then((s)=>wt(e,s,r,n)).catch((s)=>Ye(s,i,t));else e(o)}else if(typeof t==="object"&&t instanceof Promise)t.then((o)=>e(o));else e(t)}function Xi(...e){return qr(...e)}function de(e=""){return qt+e}function Zi(e){qt=e}function E(e,t){return je[e]=t,{before(r){if(!je[r]){console.warn(String.raw`Cannot find directive \`${r}\`. \`${e}\` will use the default order of execution`);return}let n=V.indexOf(r);V.splice(n>=0?n:V.indexOf("DEFAULT"),0,e)}}}function Qi(e){return Object.keys(je).includes(e)}function Je(e,t,r){if(t=Array.from(t),e._x_virtualDirectives){let o=Object.entries(e._x_virtualDirectives).map(([a,l])=>({name:a,value:l})),s=Fr(o);o=o.map((a)=>{if(s.find((l)=>l.name===a.name))return{name:`x-bind:${a.name}`,value:`"${a.value}"`};return a}),t=t.concat(o)}let n={};return t.map(Jr((o,s)=>n[o]=s)).filter(Xr).map(rs(n,r)).sort(ns).map((o)=>ts(e,o))}function Fr(e){return Array.from(e).map(Jr()).filter((t)=>!Xr(t))}function es(e){_t=!0;let t=Symbol();Kr=t,be.set(t,[]);let r=()=>{while(be.get(t).length)be.get(t).shift()();be.delete(t)},n=()=>{_t=!1,r()};e(r),n()}function Vr(e){let t=[],r=(a)=>t.push(a),[n,i]=Di(e);return t.push(i),[{Alpine:ue,effect:n,cleanup:r,evaluateLater:A.bind(A,e),evaluate:Y.bind(Y,e)},()=>t.forEach((a)=>a())]}function ts(e,t){let r=()=>{},n=je[t.type]||r,[i,o]=Vr(e);Dr(e,t.original,o);let s=()=>{if(e._x_ignore||e._x_ignoreSelf)return;n.inline&&n.inline(e,t,i),n=n.bind(n,e,t,i),_t?be.get(Kr).push(n):n()};return s.runCleanups=o,s}function Jr(e=()=>{}){return({name:t,value:r})=>{let{name:n,value:i}=Gr.reduce((o,s)=>s(o),{name:t,value:r});if(n!==t)e(n,t);return{name:n,value:i}}}function Ft(e){Gr.push(e)}function Xr({name:e}){return Zr().test(e)}function rs(e,t){return({name:r,value:n})=>{if(r===n)n="";let i=r.match(Zr()),o=r.match(/:([a-zA-Z0-9\-_:]+)/),s=r.match(/\.[^.\]]+(?=[^\]]*$)/g)||[],a=t||e[r]||r;return{type:i?i[1]:null,value:o?o[1]:null,modifiers:s.map((l)=>l.replace(".","")),expression:n,original:a}}}function ns(e,t){let r=V.indexOf(e.type)===-1?Et:e.type,n=V.indexOf(t.type)===-1?Et:t.type;return V.indexOf(r)-V.indexOf(n)}function X(e,t){if(typeof ShadowRoot==="function"&&e instanceof ShadowRoot){Array.from(e.children).forEach((i)=>X(i,t));return}let r=!1;if(t(e,()=>r=!0),r)return;let n=e.firstElementChild;while(n)X(n,t,!1),n=n.nextElementSibling}function R(e,t=()=>{}){return(...r)=>j?t(...r):e(...r)}function is(e){return(...t)=>j&&e(...t)}function Ce(e){Qr.push(e)}function ss(e,t){Qr.forEach((r)=>r(e,t)),j=!0,en(()=>{D(t,(r,n)=>{n(r,()=>{})})}),j=!1}function os(e,t){if(!t._x_dataStack)t._x_dataStack=e._x_dataStack;j=!0,kt=!0,en(()=>{as(t)}),j=!1,kt=!1}function as(e){let t=!1;D(e,(n,i)=>{X(n,(o,s)=>{if(t&&hs(o))return s();t=!0,i(o,s)})})}function en(e){let t=re;pr((r,n)=>{let i=t(r);return ce(i),()=>{}}),e(),pr(t)}function ls(e,t){let r=e._x_deferInit;if(!r){if(r=e._x_deferInit={pending:0,ownsIgnore:!e._x_ignore,queuedAttributes:new Map},r.ownsIgnore)e._x_ignore=!0;Ge++}r.pending++,Promise.resolve(t).catch((n)=>{try{Ye(n,e)}catch(i){setTimeout(()=>{throw i},0)}}).then(()=>cs(e,r))}function cs(e,t){if(t.pending--,t.pending>0)return;if(Ri(),t.pending>0)return;if(e._x_deferInit!==t)return;if(delete e._x_deferInit,t.ownsIgnore)delete e._x_ignore;if(Ge--,!e.isConnected)return;us(t),D(e)}function ds(e,t){if(Ge===0)return!1;let r=T(e,(n)=>n._x_deferInit);if(!r)return!1;return tn(r._x_deferInit,e,t.map(({name:n})=>n)),!0}function tn(e,t,r){let n=e.queuedAttributes.get(t);if(!n||n.marker!==t._x_marker)n={marker:t._x_marker,names:new Set},e.queuedAttributes.set(t,n);r.forEach((i)=>n.names.add(i))}function us(e){e.queuedAttributes.forEach((t,r)=>{if(!r.isConnected)return;if(!r._x_marker)return;if(r._x_marker!==t.marker)return;let n=T(r,(o)=>o._x_deferInit);if(n){tn(n._x_deferInit,r,Array.from(t.names));return}let i=Array.from(t.names).filter((o)=>r.hasAttribute(o)).map((o)=>({name:o,value:r.getAttribute(o)}));if(i.length===0)return;Je(r,i).forEach((o)=>o())})}function me(e,t,r={},n={}){return e.dispatchEvent(new CustomEvent(t,{detail:r,bubbles:!0,composed:!0,cancelable:!0,...n}))}function L(e,...t){console.warn(`Alpine Warning: ${e}`,...t)}function fs(){if(br)L("Alpine has already been initialized on this page. Calling Alpine.start() more than once can cause problems.");if(br=!0,!document.body)L("Unable to initialize. Trying to load Alpine before `<body>` is available. Did you forget to add `defer` in Alpine's `<script>` tag?");me(document,"alpine:init"),me(document,"alpine:initializing"),Ht(),Bi((t)=>D(t,X)),Rt((t)=>ne(t)),Lr((t,r)=>{if(ds(t,r))return;Je(t,r).forEach((n)=>n())});let e=(t)=>!Xe(t.parentElement,!0);Array.from(document.querySelectorAll(sn().join(","))).filter(e).forEach((t)=>{D(t)}),me(document,"alpine:initialized"),setTimeout(()=>{ms()})}function nn(){return Kt.map((e)=>e())}function sn(){return Kt.concat(rn).map((e)=>e())}function on(e){Kt.push(e)}function an(e){rn.push(e)}function Xe(e,t=!1){return T(e,(r)=>{if((t?sn():nn()).some((i)=>r.matches(i)))return!0})}function T(e,t){if(!e)return;if(t(e))return e;if(e._x_teleportBack)return T(e._x_teleportBack,t);if(e.parentNode instanceof ShadowRoot)return T(e.parentNode.host,t);if(!e.parentElement)return;return T(e.parentElement,t)}function hs(e){return nn().some((t)=>e.matches(t))}function ps(e){ln.push(e)}function D(e,t=X,r=()=>{}){if(T(e,(n)=>n._x_ignore))return;es(()=>{t(e,(n,i)=>{if(n._x_marker)return;if(r(n,i),ln.forEach((o)=>o(n,i)),Je(n,n.attributes).forEach((o)=>o()),!n._x_ignore)n._x_marker=bs++;n._x_ignore&&i()})})}function ne(e,t=X){t(e,(r)=>{Pi(r),Nr(r),delete r._x_marker})}function ms(){[["ui","dialog",["[x-dialog], [x-popover]"]],["anchor","anchor",["[x-anchor]"]],["sort","sort",["[x-sort]"]]].forEach(([t,r,n])=>{if(Qi(r))return;n.some((i)=>{if(document.querySelector(i))return L(`found "${i}", but missing ${t} plugin`),!0})})}function Wt(e=()=>{}){return queueMicrotask(()=>{Vt||setTimeout(()=>{St()})}),new Promise((t)=>{At.push(()=>{e(),t()})})}function St(){Vt=!1;while(At.length)At.shift()()}function gs(){Vt=!0}function Yt(e,t){if(Array.isArray(t))return mr(e,t.join(" "));else if(typeof t==="object"&&t!==null)return xs(e,t);else if(typeof t==="function")return Yt(e,t());return mr(e,t)}function Ct(e){return e.split(/\s/).filter(Boolean)}function mr(e,t){let r=(i)=>Ct(i).filter((o)=>!e.classList.contains(o)).filter(Boolean),n=(i)=>(e.classList.add(...i),()=>{e.classList.remove(...i)});return t=t===!0?t="":t||"",n(r(t))}function xs(e,t){let r=Object.entries(t).flatMap(([s,a])=>a?Ct(s):!1).filter(Boolean),n=Object.entries(t).flatMap(([s,a])=>!a?Ct(s):!1).filter(Boolean),i=[],o=[];return n.forEach((s)=>{if(e.classList.contains(s))e.classList.remove(s),o.push(s)}),r.forEach((s)=>{if(!e.classList.contains(s))e.classList.add(s),i.push(s)}),()=>{o.forEach((s)=>e.classList.add(s)),i.forEach((s)=>e.classList.remove(s))}}function Ze(e,t){if(typeof t==="object"&&t!==null)return ys(e,t);return vs(e,t)}function ys(e,t){let r={};return Object.entries(t).forEach(([n,i])=>{if(r[n]=e.style[n],!n.startsWith("--"))n=ws(n);e.style.setProperty(n,i)}),setTimeout(()=>{if(e.style.length===0)e.removeAttribute("style")}),()=>{Ze(e,r)}}function vs(e,t){let r=e.getAttribute("style",t);return e.setAttribute("style",t),()=>{e.setAttribute("style",r||"")}}function ws(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function Tt(e,t=()=>{}){let r=!1;return function(){if(!r)r=!0,e.apply(this,arguments);else t.apply(this,arguments)}}function _s(e,t,r){cn(e,Yt,""),{enter:(i)=>{e._x_transition.enter.during=i},"enter-start":(i)=>{e._x_transition.enter.start=i},"enter-end":(i)=>{e._x_transition.enter.end=i},leave:(i)=>{e._x_transition.leave.during=i},"leave-start":(i)=>{e._x_transition.leave.start=i},"leave-end":(i)=>{e._x_transition.leave.end=i}}[r](t)}function Es(e,t,r){cn(e,Ze);let n=!t.includes("in")&&!t.includes("out")&&!r,i=n||t.includes("in")||["enter"].includes(r),o=n||t.includes("out")||["leave"].includes(r);if(t.includes("in")&&!n)t=t.filter((h,x)=>x<t.indexOf("out"));if(t.includes("out")&&!n)t=t.filter((h,x)=>x>t.indexOf("out"));let s=!t.includes("opacity")&&!t.includes("scale"),a=s||t.includes("opacity"),l=s||t.includes("scale"),c=a?0:1,d=l?he(t,"scale",95)/100:1,u=he(t,"delay",0)/1000,f=he(t,"origin","center"),m="opacity, transform",g=he(t,"duration",150)/1000,p=he(t,"duration",75)/1000,b="cubic-bezier(0.4, 0.0, 0.2, 1)";if(i)e._x_transition.enter.during={transformOrigin:f,transitionDelay:`${u}s`,transitionProperty:m,transitionDuration:`${g}s`,transitionTimingFunction:b},e._x_transition.enter.start={opacity:c,transform:`scale(${d})`},e._x_transition.enter.end={opacity:1,transform:"scale(1)"};if(o)e._x_transition.leave.during={transformOrigin:f,transitionDelay:`${u}s`,transitionProperty:m,transitionDuration:`${p}s`,transitionTimingFunction:b},e._x_transition.leave.start={opacity:1,transform:"scale(1)"},e._x_transition.leave.end={opacity:c,transform:`scale(${d})`}}function cn(e,t,r={}){if(!e._x_transition)e._x_transition={enter:{during:r,start:r,end:r},leave:{during:r,start:r,end:r},in(n=()=>{},i=()=>{}){Ot(e,t,{during:this.enter.during,start:this.enter.start,end:this.enter.end},n,i)},out(n=()=>{},i=()=>{}){Ot(e,t,{during:this.leave.during,start:this.leave.start,end:this.leave.end},n,i)}}}function dn(e){let t=e.parentNode;if(!t)return;return t._x_hidePromise?t:dn(t)}function Ot(e,t,{during:r,start:n,end:i}={},o=()=>{},s=()=>{}){if(e._x_transitioning)e._x_transitioning.cancel();if(Object.keys(r).length===0&&Object.keys(n).length===0&&Object.keys(i).length===0){o(),s();return}let a,l,c;ks(e,{start(){a=t(e,n)},during(){l=t(e,r)},before:o,end(){a(),c=t(e,i)},after:s,cleanup(){l(),c()}})}function ks(e,t){let r,n,i,o=Tt(()=>{_(()=>{if(r=!0,!n)t.before();if(!i)t.end(),St();if(t.after(),e.isConnected)t.cleanup();delete e._x_transitioning})});e._x_transitioning={beforeCancels:[],beforeCancel(s){this.beforeCancels.push(s)},cancel:Tt(function(){while(this.beforeCancels.length)this.beforeCancels.shift()();o()}),finish:o},_(()=>{t.start(),t.during()}),gs(),requestAnimationFrame(()=>{if(r)return;let s=Number(getComputedStyle(e).transitionDuration.replace(/,.*/,"").replace("s",""))*1000,a=Number(getComputedStyle(e).transitionDelay.replace(/,.*/,"").replace("s",""))*1000;if(s===0)s=Number(getComputedStyle(e).animationDuration.replace("s",""))*1000;_(()=>{t.before()}),n=!0,requestAnimationFrame(()=>{if(r)return;_(()=>{t.end()}),St(),setTimeout(e._x_transitioning.finish,s+a),i=!0})})}function he(e,t,r){if(e.indexOf(t)===-1)return r;let n=e[e.indexOf(t)+1];if(!n)return r;if(t==="scale"){if(isNaN(n))return r}if(t==="duration"||t==="delay"){let i=n.match(/([0-9]+)ms/);if(i)return i[1]}if(t==="origin"){if(["top","right","left","center","bottom"].includes(e[e.indexOf(t)+2]))return[n,e[e.indexOf(t)+2]].join(" ")}return n}function un(e,t,r,n=[]){if(!e._x_bindings)e._x_bindings=le({});switch(e._x_bindings[t]=r,t=n.includes("camel")?Ls(t):t,t){case"value":As(e,r);break;case"style":Cs(e,r);break;case"class":Ss(e,r);break;case"selected":case"checked":Ts(e,t,r);break;default:Jt(e,t,r);break}}function As(e,t){if(Gt(e)){if(e.attributes.value===void 0)e.value=t}else if(qe(e))if(Number.isInteger(t))e.value=t;else if(!Array.isArray(t)&&typeof t!=="boolean"&&![null,void 0].includes(t))e.value=String(t);else if(Array.isArray(t))e.checked=t.some((r)=>Ds(r,e.value));else e.checked=!!t;else if(e.tagName==="SELECT")Is(e,t);else if(e.tagName==="OPTION")Jt(e,"value",t);else{if(e.value===t&&(typeof t!=="object"||t===null))return;e.value=t===void 0?"":t}}function Ss(e,t){if(e._x_undoAddedClasses)e._x_undoAddedClasses();e._x_undoAddedClasses=Yt(e,t)}function Cs(e,t){if(e._x_undoAddedStyles)e._x_undoAddedStyles();e._x_undoAddedStyles=Ze(e,t)}function Ts(e,t,r){Jt(e,t,r),Ms(e,t,r)}function Jt(e,t,r){if([null,void 0,!1].includes(r)&&Bs(t))e.removeAttribute(t);else{if(fn(t))r=t;if(Ps(r))r=JSON.stringify(r);Os(e,t,r)}}function Os(e,t,r){if(e.getAttribute(t)!=r)e.setAttribute(t,r)}function Ms(e,t,r){if(e[t]!==r)e[t]=r}function Is(e,t){let r=[].concat(t).map((n)=>n+"");Array.from(e.options).forEach((n)=>{n.selected=r.includes(n.value)})}function Ls(e){return e.toLowerCase().replace(/-(\w)/g,(t,r)=>r.toUpperCase())}function Ds(e,t){return e==t}function Re(e){if([1,"1","true","on","yes",!0].includes(e))return!0;if([0,"0","false","off","no",!1].includes(e))return!1;return e?Boolean(e):null}function fn(e){return Ns.has(e)}function Bs(e){return!["aria-pressed","aria-checked","aria-expanded","aria-selected"].includes(e)}function Ps(e){return typeof e==="object"&&e!==null}function $s(e,t,r){if(e._x_bindings&&e._x_bindings[t]!==void 0)return e._x_bindings[t];return hn(e,t,r)}function Rs(e,t,r,n=!0){if(e._x_bindings&&e._x_bindings[t]!==void 0)return e._x_bindings[t];if(e._x_inlineBindings&&e._x_inlineBindings[t]!==void 0){let i=e._x_inlineBindings[t];return i.extract=n,Ur(()=>Y(e,i.expression))}return hn(e,t,r)}function hn(e,t,r){let n=e.getAttribute(t);if(n===null)return typeof r==="function"?r():r;if(n==="")return!0;if(fn(t))return!![t,"true"].includes(n);return n}function qe(e){return e.type==="checkbox"||e.localName==="ui-checkbox"||e.localName==="ui-switch"}function Gt(e){return e.type==="radio"||e.localName==="ui-radio"}function pn(e,t){let r;return function(){let n=this,i=arguments,o=function(){r=null,e.apply(n,i)};clearTimeout(r),r=setTimeout(o,t)}}function bn(e,t){let r;return function(){let n=this,i=arguments;if(!r)e.apply(n,i),r=!0,setTimeout(()=>r=!1,t)}}function mn({get:e,set:t},{get:r,set:n}){let i=!0,o,s,a=re(()=>{let l=e(),c=r();if(i)n(ct(l)),i=!1;else{let d=JSON.stringify(l),u=JSON.stringify(c);if(d!==o)n(ct(l));else if(d!==u)t(ct(c))}o=JSON.stringify(e()),s=JSON.stringify(r())});return()=>{$t(a),ce(a)}}function ct(e){return typeof e==="object"?JSON.parse(JSON.stringify(e)):e}function zs(e){(Array.isArray(e)?e:[e]).forEach((r)=>r(ue))}function Hs(e,t){if(!gr)B=le(B),gr=!0;if(t===void 0)return B[e];if(B[e]=t,typeof t==="object"&&t!==null&&t._x_interceptor)B[e]=t.initialize(B,e,e,()=>{});else jt(B[e]);if(typeof t==="object"&&t!==null&&t.hasOwnProperty("init")&&typeof t.init==="function")B[e].init()}function Us(){return B}function js(e,t){let r=typeof t!=="function"?()=>t:t;if(e instanceof Element)return xn(e,r());else gn[e]=r;return()=>{}}function qs(e){return Object.entries(gn).forEach(([t,r])=>{Object.defineProperty(e,t,{get(){return(...n)=>r(...n)}})}),e}function xn(e,t,r){let n=[];while(n.length)n.pop()();let i=Object.entries(t).map(([s,a])=>({name:s,value:a})),o=Fr(i);return i=i.map((s)=>{if(o.find((a)=>a.name===s.name))return{name:`x-bind:${s.name}`,value:`"${s.value}"`};return s}),Je(e,i,r).map((s)=>{n.push(s.runCleanups),s()}),()=>{while(n.length)n.pop()()}}function Fs(e,t){yn[e]=t}function Ks(e,t){return Object.entries(yn).forEach(([r,n])=>{Object.defineProperty(e,r,{get(){return(...i)=>n.bind(t)(...i)},enumerable:!1})}),e}function wn(e){try{let r=new Ys(e).tokenize(),i=new Js(r).parse(),o=new Gs;return function(s={}){let{scope:a={},context:l=null,forceBindingRootScopeToFunctions:c=!1}=s;return o.evaluate({node:i,scope:a,context:l,forceBindingRootScopeToFunctions:c})}}catch(t){throw Error(`CSP Parser Error: ${t.message}`)}}function Xs(e,t,r={}){let n=_n(e),i=G([r.scope??{},...n]),o=r.params??[],a=wn(t)({scope:i,forceBindingRootScopeToFunctions:!0});if(typeof a==="function"&&W)return a.apply(i,o);return a}function Zs(e,t){let r=_n(e);if(typeof t==="function")return Gi(r,t);let n=Qs(e,t,r);return Ki.bind(null,e,t,n)}function _n(e){let t={};return Ue(t,e),[t,...ae(e)]}function Qs(e,t,r){if(e instanceof HTMLIFrameElement)throw Error("Evaluating expressions on an iframe is prohibited in the CSP build");if(e instanceof HTMLScriptElement)throw Error("Evaluating expressions on a script is prohibited in the CSP build");return(n=()=>{},{scope:i={},params:o=[]}={})=>{let s=G([i,...r]),l=wn(t)({scope:s,forceBindingRootScopeToFunctions:!0});if(W&&typeof l==="function"){let c=l.apply(l,o);if(c instanceof Promise)c.then((d)=>n(d));else n(c)}else if(typeof l==="object"&&l instanceof Promise)l.then((c)=>n(c));else n(l)}}function En(e){let t=Object.create(null);for(let r of e.split(","))t[r]=1;return(r)=>(r in t)}function Z(e,...t){console.warn(`[Vue warn] ${e}`,...t)}function oo(e,t=!1){if(e.flags|=8,t){e.next=ye,ye=e;return}e.next=xe,xe=e}function Zt(){Cn++}function Qt(){if(--Cn>0)return;if(ye){let t=ye;ye=void 0;while(t){let r=t.next;t.next=void 0,t.flags&=-9,t=r}}let e;while(xe){let t=xe;xe=void 0;while(t){let r=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(n){if(!e)e=n}t=r}}if(e)throw e}function Tn(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function On(e){let t,r=e.depsTail,n=r;while(n){let i=n.prevDep;if(n.version===-1){if(n===r)r=i;er(n),lo(n)}else t=n;n.dep.activeLink=n.prevActiveLink,n.prevActiveLink=void 0,n=i}e.deps=t,e.depsTail=r}function It(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(ao(t.dep.computed)||t.dep.version!==t.version))return!0;if(e._dirty)return!0;return!1}function ao(e){if(e.flags&4&&!(e.flags&16))return;if(e.flags&=-17,e.globalVersion===Fe)return;if(e.globalVersion=Fe,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!It(e)))return;e.flags|=2;let t=e.dep,r=y,n=O;y=e,O=!0;try{Tn(e);let i=e.fn(e._value);if(t.version===0||K(i,e._value))e.flags|=128,e._value=i,t.version++}catch(i){throw t.version++,i}finally{y=r,O=n,On(e),e.flags&=-3}}function er(e,t=!1){let{dep:r,prevSub:n,nextSub:i}=e;if(n)n.nextSub=i,e.prevSub=void 0;if(i)i.prevSub=n,e.nextSub=void 0;if(r.subsHead===e)r.subsHead=i;if(r.subs===e){if(r.subs=n,!n&&r.computed){r.computed.flags&=-5;for(let o=r.computed.deps;o;o=o.nextDep)er(o,!0)}}if(!t&&!--r.sc&&r.map)r.map.delete(r.key)}function lo(e){let{prevDep:t,nextDep:r}=e;if(t)t.nextDep=r,e.prevDep=void 0;if(r)r.prevDep=t,e.nextDep=void 0}function co(e,t){if(e.effect instanceof yr)e=e.effect.fn;let r=new yr(e);if(t)we(r,t);try{r.run()}catch(i){throw r.stop(),i}let n=r.run.bind(r);return n.effect=r,n}function uo(e){e.effect.stop()}function fo(){Mn.push(O),O=!1}function ho(){let e=Mn.pop();O=e===void 0?!0:e}function vr(e){let{cleanup:t}=e;if(e.cleanup=void 0,t){let r=y;y=void 0;try{t()}finally{y=r}}}function In(e){if(e.dep.sc++,e.sub.flags&4){let t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let n=t.deps;n;n=n.nextDep)In(n)}let r=e.dep.subs;if(r!==e){if(e.prevSub=r,r)r.nextSub=e}if(e.dep.subsHead===void 0)e.dep.subsHead=e;e.dep.subs=e}}function S(e,t,r){if(O&&y){let n=Lt.get(e);if(!n)Lt.set(e,n=new Map);let i=n.get(r);if(!i)n.set(r,i=new bo),i.map=n,i.key=r;i.track({target:e,type:t,key:r})}}function U(e,t,r,n,i,o){let s=Lt.get(e);if(!s){Fe++;return}let a=(l)=>{if(l)l.trigger({target:e,type:t,key:r,newValue:n,oldValue:i,oldTarget:o})};if(Zt(),t==="clear")s.forEach(a);else{let l=_e(e),c=l&&Xt(r);if(l&&r==="length"){let d=Number(n);s.forEach((u,f)=>{if(f==="length"||f===ke||!Te(f)&&f>=d)a(u)})}else{if(r!==void 0||s.has(void 0))a(s.get(r));if(c)a(s.get(ke));switch(t){case"add":if(!l){if(a(s.get(J)),ge(e))a(s.get(Dt))}else if(c)a(s.get("length"));break;case"delete":if(!l){if(a(s.get(J)),ge(e))a(s.get(Dt))}break;case"set":if(ge(e))a(s.get(J));break}}}Qt()}function se(e){let t=v(e);if(t===e)return t;return S(t,"iterate",ke),ee(e)?t:t.map(te)}function tr(e){return S(e=v(e),"iterate",ke),e}function I(e,t){if(Q(e))return Rn(e)?Ae(te(t)):Ae(t);return te(t)}function ft(e,t,r){let n=tr(e),i=n[t]();if(n!==e&&!ee(e))i._next=i.next,i.next=()=>{let o=i._next();if(!o.done)o.value=r(o.value);return o};return i}function N(e,t,r,n,i,o){let s=tr(e),a=s!==e&&!ee(e),l=s[t];if(l!==go[t]){let u=l.apply(e,o);return a?te(u):u}let c=r;if(s!==e){if(a)c=function(u,f){return r.call(this,I(e,u),f,e)};else if(r.length>2)c=function(u,f){return r.call(this,u,f,e)}}let d=l.call(s,c,n);return a&&i?i(d):d}function wr(e,t,r,n){let i=tr(e),o=i!==e&&!ee(e),s=r,a=!1;if(i!==e){if(o)a=n.length===0,s=function(c,d,u){if(a)a=!1,c=I(e,c);return r.call(this,c,I(e,d),u,e)};else if(r.length>3)s=function(c,d,u){return r.call(this,c,d,u,e)}}let l=i[t](s,...n);return a?I(e,l):l}function ht(e,t,r){let n=v(e);S(n,"iterate",ke);let i=n[t](...r);if((i===-1||i===!1)&&Io(r[0]))return r[0]=v(r[0]),n[t](...r);return i}function pe(e,t,r=[]){fo(),Zt();let n=v(e)[t].apply(e,r);return Qt(),ho(),n}function yo(e){if(!Te(e))e=String(e);let t=v(this);return S(t,"has",e),t.hasOwnProperty(e)}function ko(e,t,r){return function(...n){let i=this.__v_raw,o=v(i),s=ge(o),a=e==="entries"||e===Symbol.iterator&&s,l=e==="keys"&&s,c=i[e](...n),d=r?Nt:t?Ae:te;return!t&&S(o,"iterate",l?Dt:J),we(Object.create(c),{next(){let{value:u,done:f}=c.next();return f?{value:u,done:f}:{value:a?[d(u[0]),d(u[1])]:d(u),done:f}}})}}function Pe(e){return function(...t){{let r=t[0]?`on key "${t[0]}" `:"";Z(`${Sn(e)} operation ${r}failed: target is readonly.`,v(this))}return e==="delete"?!1:e==="clear"?void 0:this}}function Ao(e,t){let r={get(i){let o=this.__v_raw,s=v(o),a=v(i);if(!e){if(K(i,a))S(s,"get",i);S(s,"get",a)}let{has:l}=Be(s),c=t?Nt:e?Ae:te;if(l.call(s,i))return c(o.get(i));else if(l.call(s,a))return c(o.get(a));else if(o!==s)o.get(i)},get size(){let i=this.__v_raw;return!e&&S(v(i),"iterate",J),i.size},has(i){let o=this.__v_raw,s=v(o),a=v(i);if(!e){if(K(i,a))S(s,"has",i);S(s,"has",a)}return i===a?o.has(i):o.has(i)||o.has(a)},forEach(i,o){let s=this,a=s.__v_raw,l=v(a),c=t?Nt:e?Ae:te;return!e&&S(l,"iterate",J),a.forEach((d,u)=>i.call(o,c(d),c(u),s))}};return we(r,e?{add:Pe("add"),set:Pe("set"),delete:Pe("delete"),clear:Pe("clear")}:{add(i){let o=v(this),s=Be(o),a=v(i),l=!t&&!ee(i)&&!Q(i)?a:i;if(!(s.has.call(o,l)||K(i,l)&&s.has.call(o,i)||K(a,l)&&s.has.call(o,a)))o.add(l),U(o,"add",l,l);return this},set(i,o){if(!t&&!ee(o)&&!Q(o))o=v(o);let s=v(this),{has:a,get:l}=Be(s),c=a.call(s,i);if(!c)i=v(i),c=a.call(s,i);else _r(s,a,i);let d=l.call(s,i);if(s.set(i,o),!c)U(s,"add",i,o);else if(K(o,d))U(s,"set",i,o,d);return this},delete(i){let o=v(this),{has:s,get:a}=Be(o),l=s.call(o,i);if(!l)i=v(i),l=s.call(o,i);else _r(o,s,i);let c=a?a.call(o,i):void 0,d=o.delete(i);if(l)U(o,"delete",i,void 0,c);return d},clear(){let i=v(this),o=i.size!==0,s=ge(i)?new Map(i):new Set(i),a=i.clear();if(o)U(i,"clear",void 0,void 0,s);return a}}),["keys","values","entries",Symbol.iterator].forEach((i)=>{r[i]=ko(i,e,t)}),r}function Nn(e,t){let r=Ao(e,t);return(n,i,o)=>{if(i==="__v_isReactive")return!e;else if(i==="__v_isReadonly")return e;else if(i==="__v_raw")return n;return Reflect.get(Mt(r,i)&&i in n?r:n,i,o)}}function _r(e,t,r){let n=v(r);if(n!==r&&t.call(e,n)){let i=An(e);Z(`Reactive ${i} contains both the raw and reactive versions of the same object${i==="Map"?" as keys":""}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`)}}function Mo(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function rr(e){if(Q(e))return e;return $n(e,!1,_o,So,Bn)}function Bt(e){return $n(e,!0,Eo,Co,Pn)}function $n(e,t,r,n,i){if(!Ee(e))return Z(`value cannot be made ${t?"readonly":"reactive"}: ${String(e)}`),e;if(e.__v_raw&&!(t&&e.__v_isReactive))return e;if(e.__v_skip||!Object.isExtensible(e))return e;let o=i.get(e);if(o)return o;let s=Mo(An(e));if(s===0)return e;let a=new Proxy(e,s===2?n:r);return i.set(e,a),a}function Rn(e){if(Q(e))return Rn(e.__v_raw);return!!(e&&e.__v_isReactive)}function Q(e){return!!(e&&e.__v_isReadonly)}function ee(e){return!!(e&&e.__v_isShallow)}function Io(e){return e?!!e.__v_raw:!1}function v(e){let t=e&&e.__v_raw;return t?v(t):e}function ve(e){return e?e.__v_isRef===!0:!1}function Lo(e){let t=[];return T(e,(r)=>{if(r._x_refs)t.push(r._x_refs)}),t}function zn(e){if(!pt[e])pt[e]=0;return++pt[e]}function Do(e,t){return T(e,(r)=>{if(r._x_ids&&r._x_ids[t])return!0})}function No(e,t){if(!e._x_ids)e._x_ids={};if(!e._x_ids[t])e._x_ids[t]=zn(t)}function Bo(e,t,r,n){if(!e._x_id)e._x_id={};if(e._x_id[t])return e._x_id[t];let i=n();return e._x_id[t]=i,r(()=>{delete e._x_id[t]}),i}function Hn(e,t,r){M(t,(n)=>L(`You can't use [$${t}] without first installing the "${e}" plugin here: https://alpinejs.dev/plugins/${r}`,n))}function Er(e){let t=R(()=>document.querySelector(e),()=>Po)();if(!t)L(`Cannot find x-teleport element for selector: "${e}"`);return t}function oe(e,t,r,n){let i=e,o=(l)=>n(l),s={},a=(l,c)=>(d)=>c(l,d);if(r.includes("dot"))t=$o(t);if(r.includes("camel"))t=Ro(t);if(r.includes("capture"))s.capture=!0;if(r.includes("window"))i=window;if(r.includes("document"))i=document;if(r.includes("passive"))s.passive=r[r.indexOf("passive")+1]!=="false";if(o=jn(r,o),r.includes("prevent"))o=a(o,(l,c)=>{c.preventDefault(),l(c)});if(r.includes("stop"))o=a(o,(l,c)=>{c.stopPropagation(),l(c)});if(r.includes("once"))o=a(o,(l,c)=>{l(c),i.removeEventListener(t,o,s)});if(r.includes("away")||r.includes("outside"))i=document,o=a(o,(l,c)=>{if(e.contains(c.target))return;if(c.target.isConnected===!1)return;if(e.offsetWidth<1&&e.offsetHeight<1)return;if(e._x_isShown===!1)return;l(c)});if(r.includes("self"))o=a(o,(l,c)=>{c.target===e&&l(c)});if(t==="submit")o=a(o,(l,c)=>{if(c.target._x_pendingModelUpdates)c.target._x_pendingModelUpdates.forEach((d)=>d());l(c)});if(Ho(t)||qn(t))o=a(o,(l,c)=>{if(jo(c,r))return;l(c)});return i.addEventListener(t,o,s),()=>{i.removeEventListener(t,o,s)}}function jn(e,t){if(e.includes("debounce")){let r=e[e.indexOf("debounce")+1]||"invalid-wait",n=Ke(r.split("ms")[0])?Number(r.split("ms")[0]):250;t=pn(t,n)}if(e.includes("throttle")){let r=e[e.indexOf("throttle")+1]||"invalid-wait",n=Ke(r.split("ms")[0])?Number(r.split("ms")[0]):250;t=bn(t,n)}return t}function $o(e){return e.replace(/-/g,".")}function Ro(e){return e.toLowerCase().replace(/-(\w)/g,(t,r)=>r.toUpperCase())}function Ke(e){return!Array.isArray(e)&&!isNaN(e)}function zo(e){if([" ","_"].includes(e))return e;return e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[_\s]/,"-").toLowerCase()}function Ho(e){return["keydown","keyup"].includes(e)}function qn(e){return["contextmenu","click","mouse"].some((t)=>e.includes(t))}function jo(e,t){let r=t.filter((o,s)=>{if(o==="false"&&t[s-1]==="passive")return!1;return!Uo.includes(o)});if(r.includes("debounce")){let o=r.indexOf("debounce");r.splice(o,Ke((r[o+1]||"invalid-wait").split("ms")[0])?2:1)}if(r.includes("throttle")){let o=r.indexOf("throttle");r.splice(o,Ke((r[o+1]||"invalid-wait").split("ms")[0])?2:1)}if(r.length===0)return!1;if(r.length===1&&kr(e.key).includes(r[0]))return!1;let i=["ctrl","shift","alt","meta","cmd","super"].filter((o)=>r.includes(o));if(r=r.filter((o)=>!i.includes(o)),i.length>0){if(i.filter((s)=>{if(s==="cmd"||s==="super")s="meta";return e[`${s}Key`]}).length===i.length){if(qn(e.type))return!1;if(kr(e.key).includes(r[0]))return!1}}return!0}function kr(e){if(!e)return[];e=zo(e);let t={ctrl:"control",slash:"/",space:" ",spacebar:" ",cmd:"meta",esc:"escape",up:"arrow-up",down:"arrow-down",left:"arrow-left",right:"arrow-right",period:".",comma:",",equal:"=",minus:"-",underscore:"_"};return t[e]=e,Object.keys(t).map((r)=>{if(t[r]===e)return r}).filter((r)=>r)}function $e(e,t,r,n){return _(()=>{if(r instanceof CustomEvent&&r.detail!==void 0)return r.detail!==null&&r.detail!==void 0?r.detail:r.target.value;else if(qe(e))if(Array.isArray(n)){let i=null;if(t.includes("number"))i=bt(r.target.value);else if(t.includes("boolean"))i=Re(r.target.value);else i=r.target.value;return r.target.checked?n.includes(i)?n:n.concat([i]):n.filter((o)=>!qo(o,i))}else return r.target.checked;else if(e.tagName.toLowerCase()==="select"&&e.multiple){if(t.includes("number"))return Array.from(r.target.selectedOptions).map((i)=>{let o=i.value||i.text;return bt(o)});else if(t.includes("boolean"))return Array.from(r.target.selectedOptions).map((i)=>{let o=i.value||i.text;return Re(o)});return Array.from(r.target.selectedOptions).map((i)=>i.value||i.text)}else{let i;if(Gt(e))if(r.target.checked)i=r.target.value;else i=n;else i=r.target.value;if(t.includes("number"))return bt(i);else if(t.includes("boolean"))return Re(i);else if(t.includes("trim"))return i.trim();else return i}})}function bt(e){let t=e?parseFloat(e):null;return Fo(t)?t:e}function qo(e,t){return e==t}function Fo(e){return!Array.isArray(e)&&!isNaN(e)}function Ar(e){return e!==null&&typeof e==="object"&&typeof e.get==="function"&&typeof e.set==="function"}function Ko(e,t){e._x_keyExpression=t}function Vo(e,t){Object.keys(t).forEach((r)=>{let n=Object.getOwnPropertyDescriptor(t,r),i=Object.getOwnPropertyDescriptor(e,r);if(n.get||n.set||i?.get||i?.set){if(i)delete e[r];if(!i)e[r]=void 0;n.get||n.set?Object.defineProperty(e,r,n):e[r]=t[r]}else e[r]=t[r]}),Object.keys(e).filter((r)=>!Object.prototype.hasOwnProperty.call(t,r)).forEach((r)=>delete e[r])}function Wo(e){if(!j)return!1;if(kt)return!0;return e.hasAttribute("data-has-alpine-state")}function Yo(e){return(t)=>{Object.entries(t).forEach(([r,n])=>{e[r]=n})}}function Jo(e,t,r,n){r((i)=>{if(Zo(i))i=Array.from({length:i},(c,d)=>d+1);if(i===void 0||i===null)i=[];if(i instanceof Set)i=Array.from(i);if(i instanceof Map)i=Array.from(i);let o=e._x_lookup,s=new Map;e._x_lookup=s;let a=Qo(i),l=Object.entries(i).map(([c,d])=>{if(!a)c=parseInt(c);let u=Xo(t,d,c,i),f;return n((m)=>{if(typeof m==="object")L("x-for key cannot be an object, it must be a string or an integer",e);if(o.has(m))s.set(m,o.get(m)),o.delete(m);f=m},{scope:{index:c,...u}}),[f,u]});_(()=>{o.forEach((u)=>{ne(u),u.remove()});let c=new Set,d=e;if(l.forEach(([u,f])=>{if(s.has(u)){let p=s.get(u);if(p._x_refreshXForScope(f),d.nextElementSibling!==p){if(d.nextElementSibling)p.replaceWith(d.nextElementSibling);d.after(p)}if(d=p,p._x_currentIfEl){if(p.nextElementSibling!==p._x_currentIfEl)d.after(p._x_currentIfEl);d=p._x_currentIfEl}return}if(e.content.children.length>1)L("x-for templates require a single root element, additional elements will be ignored.",e);let m=document.importNode(e.content,!0).firstElementChild,g=le(f);Se(m,g,e),m._x_refreshXForScope=Yo(g),s.set(u,m),c.add(m),d.after(m),d=m}),c.forEach((u)=>D(u)),d!==e)e._x_lastRenderedEl=d;else delete e._x_lastRenderedEl})})}function Go(e){let t=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,r=/^\s*\(|\)\s*$/g,n=/([\s\S]*?)\b(?:in|of)\b([\s\S]*)/,i=e.match(n);if(!i)return;let o={};o.items=i[2].trim();let s=i[1].replace(r,"").trim(),a=s.match(t);if(a){if(o.item=s.replace(t,"").trim(),o.index=a[1].trim(),a[2])o.collection=a[2].trim()}else o.item=s;return o}function Xo(e,t,r,n){let i={};if(/^\[.*\]$/.test(e.item)&&Array.isArray(t))e.item.replace("[","").replace("]","").split(",").map((s)=>s.trim()).forEach((s,a)=>{i[s]=t[a]});else if(/^\{.*\}$/.test(e.item)&&!Array.isArray(t)&&typeof t==="object")e.item.replace("{","").replace("}","").split(",").map((s)=>s.trim()).forEach((s)=>{i[s]=t[s]});else i[e.item]=t;if(e.index)i[e.index]=r;if(e.collection)i[e.collection]=n;return i}function Zo(e){return typeof e!=="object"&&!isNaN(e)}function Qo(e){return typeof e==="object"&&!Array.isArray(e)}function Kn(){}function et(e,t,r){E(t,(n)=>L(`You can't use [x-${t}] without first installing the "${e}" plugin here: https://alpinejs.dev/plugins/${r}`,n))}var mt=!1,gt=!1,P,xt=-1,ze=!1,Pt=!1,le,re,ce,Cr,Mi=0,yt=!0,Or,Mr,Ir,Ve,zt=!1,F,Ut=!1,He,Ui,zr,Hr,W=!0,jr=()=>{},qr,qt="x-",je,_t=!1,be,Kr,Wr=(e,t)=>({name:r,value:n})=>{if(r.startsWith(e))r=r.replace(e,t);return{name:r,value:n}},Yr=(e)=>e,Gr,Zr=()=>new RegExp(`^${qt}([^:^.]+)\\b`),Et="DEFAULT",V,j=!1,Qr,kt=!1,Ge=0,br=!1,Kt,rn,ln,bs=1,At,Vt=!1,Ns,B,gr=!1,gn,yn,Vs,ue,xr,vn,k=class{constructor(e,t,r,n){this.type=e,this.value=t,this.start=r,this.end=n}},Ws,Ys=class{constructor(e){this.input=e,this.position=0,this.tokens=[]}tokenize(){while(this.position<this.input.length){if(this.skipWhitespace(),this.position>=this.input.length)break;let e=this.input[this.position];if(this.isDigit(e))this.readNumber();else if(this.isAlpha(e)||e==="_"||e==="$")this.readIdentifierOrKeyword();else if(e==='"'||e==="'")this.readString();else if(e==="/"&&this.peek()==="/")this.skipLineComment();else this.readOperatorOrPunctuation()}return this.tokens.push(new k("EOF",null,this.position,this.position)),this.tokens}skipWhitespace(){while(this.position<this.input.length&&/\s/.test(this.input[this.position]))this.position++}skipLineComment(){while(this.position<this.input.length&&this.input[this.position]!==`
|
|
5
|
+
`:""}`,t),setTimeout(()=>{throw e},0)}function Ur(e){let t=W;W=!1;let r=e();return W=t,r}function Y(e,t,r={}){let n;return A(e,t)((i)=>n=i,r),n}function A(...e){return jr(...e)}function Yi(e){jr=e}function Ji(e){qr=e}function Gi(e,t){return(r=()=>{},{scope:n={},params:i=[],context:o}={})=>{if(!W){wt(r,t,G([n,...e]),i);return}let s=t.apply(G([n,...e]),i);wt(r,s)}}function wt(e,t,r,n,i){if(W&&typeof t==="function"){let o=t.apply(r,n);if(o instanceof Promise)o.then((s)=>wt(e,s,r,n)).catch((s)=>Ye(s,i,t));else e(o)}else if(typeof t==="object"&&t instanceof Promise)t.then((o)=>e(o));else e(t)}function Xi(...e){return qr(...e)}function de(e=""){return qt+e}function Zi(e){qt=e}function E(e,t){return je[e]=t,{before(r){if(!je[r]){console.warn(String.raw`Cannot find directive \`${r}\`. \`${e}\` will use the default order of execution`);return}let n=V.indexOf(r);V.splice(n>=0?n:V.indexOf("DEFAULT"),0,e)}}}function Qi(e){return Object.keys(je).includes(e)}function Je(e,t,r){if(t=Array.from(t),e._x_virtualDirectives){let o=Object.entries(e._x_virtualDirectives).map(([a,l])=>({name:a,value:l})),s=Fr(o);o=o.map((a)=>{if(s.find((l)=>l.name===a.name))return{name:`x-bind:${a.name}`,value:`"${a.value}"`};return a}),t=t.concat(o)}let n={};return t.map(Jr((o,s)=>n[o]=s)).filter(Xr).map(rs(n,r)).sort(ns).map((o)=>ts(e,o))}function Fr(e){return Array.from(e).map(Jr()).filter((t)=>!Xr(t))}function es(e){_t=!0;let t=Symbol();Kr=t,be.set(t,[]);let r=()=>{while(be.get(t).length)be.get(t).shift()();be.delete(t)},n=()=>{_t=!1,r()};e(r),n()}function Vr(e){let t=[],r=(a)=>t.push(a),[n,i]=Di(e);return t.push(i),[{Alpine:ue,effect:n,cleanup:r,evaluateLater:A.bind(A,e),evaluate:Y.bind(Y,e)},()=>t.forEach((a)=>a())]}function ts(e,t){let r=()=>{},n=je[t.type]||r,[i,o]=Vr(e);Dr(e,t.original,o);let s=()=>{if(e._x_ignore||e._x_ignoreSelf)return;n.inline&&n.inline(e,t,i),n=n.bind(n,e,t,i),_t?be.get(Kr).push(n):n()};return s.runCleanups=o,s}function Jr(e=()=>{}){return({name:t,value:r})=>{let{name:n,value:i}=Gr.reduce((o,s)=>s(o),{name:t,value:r});if(n!==t)e(n,t);return{name:n,value:i}}}function Ft(e){Gr.push(e)}function Xr({name:e}){return Zr().test(e)}function rs(e,t){return({name:r,value:n})=>{if(r===n)n="";let i=r.match(Zr()),o=r.match(/:([a-zA-Z0-9\-_:]+)/),s=r.match(/\.[^.\]]+(?=[^\]]*$)/g)||[],a=t||e[r]||r;return{type:i?i[1]:null,value:o?o[1]:null,modifiers:s.map((l)=>l.replace(".","")),expression:n,original:a}}}function ns(e,t){let r=V.indexOf(e.type)===-1?Et:e.type,n=V.indexOf(t.type)===-1?Et:t.type;return V.indexOf(r)-V.indexOf(n)}function X(e,t){if(typeof ShadowRoot==="function"&&e instanceof ShadowRoot){Array.from(e.children).forEach((i)=>X(i,t));return}let r=!1;if(t(e,()=>r=!0),r)return;let n=e.firstElementChild;while(n)X(n,t,!1),n=n.nextElementSibling}function R(e,t=()=>{}){return(...r)=>j?t(...r):e(...r)}function is(e){return(...t)=>j&&e(...t)}function Ce(e){Qr.push(e)}function ss(e,t){Qr.forEach((r)=>r(e,t)),j=!0,en(()=>{D(t,(r,n)=>{n(r,()=>{})})}),j=!1}function os(e,t){if(!t._x_dataStack)t._x_dataStack=e._x_dataStack;j=!0,kt=!0,en(()=>{as(t)}),j=!1,kt=!1}function as(e){let t=!1;D(e,(n,i)=>{X(n,(o,s)=>{if(t&&hs(o))return s();t=!0,i(o,s)})})}function en(e){let t=re;pr((r,n)=>{let i=t(r);return ce(i),()=>{}}),e(),pr(t)}function ls(e,t){let r=e._x_deferInit;if(!r){if(r=e._x_deferInit={pending:0,ownsIgnore:!e._x_ignore,queuedAttributes:new Map},r.ownsIgnore)e._x_ignore=!0;Ge++}r.pending++,Promise.resolve(t).catch((n)=>{try{Ye(n,e)}catch(i){setTimeout(()=>{throw i},0)}}).then(()=>cs(e,r))}function cs(e,t){if(t.pending--,t.pending>0)return;if(Ri(),t.pending>0)return;if(e._x_deferInit!==t)return;if(delete e._x_deferInit,t.ownsIgnore)delete e._x_ignore;if(Ge--,!e.isConnected)return;us(t),D(e)}function ds(e,t){if(Ge===0)return!1;let r=T(e,(n)=>n._x_deferInit);if(!r)return!1;return tn(r._x_deferInit,e,t.map(({name:n})=>n)),!0}function tn(e,t,r){let n=e.queuedAttributes.get(t);if(!n||n.marker!==t._x_marker)n={marker:t._x_marker,names:new Set},e.queuedAttributes.set(t,n);r.forEach((i)=>n.names.add(i))}function us(e){e.queuedAttributes.forEach((t,r)=>{if(!r.isConnected)return;if(!r._x_marker)return;if(r._x_marker!==t.marker)return;let n=T(r,(o)=>o._x_deferInit);if(n){tn(n._x_deferInit,r,Array.from(t.names));return}let i=Array.from(t.names).filter((o)=>r.hasAttribute(o)).map((o)=>({name:o,value:r.getAttribute(o)}));if(i.length===0)return;Je(r,i).forEach((o)=>o())})}function me(e,t,r={},n={}){return e.dispatchEvent(new CustomEvent(t,{detail:r,bubbles:!0,composed:!0,cancelable:!0,...n}))}function L(e,...t){console.warn(`Alpine Warning: ${e}`,...t)}function fs(){if(br)L("Alpine has already been initialized on this page. Calling Alpine.start() more than once can cause problems.");if(br=!0,!document.body)L("Unable to initialize. Trying to load Alpine before `<body>` is available. Did you forget to add `defer` in Alpine's `<script>` tag?");me(document,"alpine:init"),me(document,"alpine:initializing"),Ht(),Bi((t)=>D(t,X)),Rt((t)=>ne(t)),Lr((t,r)=>{if(ds(t,r))return;Je(t,r).forEach((n)=>n())});let e=(t)=>!Xe(t.parentElement,!0);Array.from(document.querySelectorAll(sn().join(","))).filter(e).forEach((t)=>{D(t)}),me(document,"alpine:initialized"),setTimeout(()=>{ms()})}function nn(){return Kt.map((e)=>e())}function sn(){return Kt.concat(rn).map((e)=>e())}function on(e){Kt.push(e)}function an(e){rn.push(e)}function Xe(e,t=!1){return T(e,(r)=>{if((t?sn():nn()).some((i)=>r.matches(i)))return!0})}function T(e,t){if(!e)return;if(t(e))return e;if(e._x_teleportBack)return T(e._x_teleportBack,t);if(e.parentNode instanceof ShadowRoot)return T(e.parentNode.host,t);if(!e.parentElement)return;return T(e.parentElement,t)}function hs(e){return nn().some((t)=>e.matches(t))}function ps(e){ln.push(e)}function D(e,t=X,r=()=>{}){if(T(e,(n)=>n._x_ignore))return;es(()=>{t(e,(n,i)=>{if(n._x_marker)return;if(r(n,i),ln.forEach((o)=>o(n,i)),Je(n,n.attributes).forEach((o)=>o()),!n._x_ignore)n._x_marker=bs++;n._x_ignore&&i()})})}function ne(e,t=X){t(e,(r)=>{Pi(r),Nr(r),delete r._x_marker})}function ms(){[["ui","dialog",["[x-dialog], [x-popover]"]],["anchor","anchor",["[x-anchor]"]],["sort","sort",["[x-sort]"]]].forEach(([t,r,n])=>{if(Qi(r))return;n.some((i)=>{if(document.querySelector(i))return L(`found "${i}", but missing ${t} plugin`),!0})})}function Wt(e=()=>{}){return queueMicrotask(()=>{Vt||setTimeout(()=>{St()})}),new Promise((t)=>{At.push(()=>{e(),t()})})}function St(){Vt=!1;while(At.length)At.shift()()}function gs(){Vt=!0}function Yt(e,t){if(Array.isArray(t))return mr(e,t.join(" "));else if(typeof t==="object"&&t!==null)return xs(e,t);else if(typeof t==="function")return Yt(e,t());return mr(e,t)}function Ct(e){return e.split(/\s/).filter(Boolean)}function mr(e,t){let r=(i)=>Ct(i).filter((o)=>!e.classList.contains(o)).filter(Boolean),n=(i)=>(e.classList.add(...i),()=>{e.classList.remove(...i)});return t=t===!0?t="":t||"",n(r(t))}function xs(e,t){let r=Object.entries(t).flatMap(([s,a])=>a?Ct(s):!1).filter(Boolean),n=Object.entries(t).flatMap(([s,a])=>!a?Ct(s):!1).filter(Boolean),i=[],o=[];return n.forEach((s)=>{if(e.classList.contains(s))e.classList.remove(s),o.push(s)}),r.forEach((s)=>{if(!e.classList.contains(s))e.classList.add(s),i.push(s)}),()=>{o.forEach((s)=>e.classList.add(s)),i.forEach((s)=>e.classList.remove(s))}}function Ze(e,t){if(typeof t==="object"&&t!==null)return ys(e,t);return vs(e,t)}function ys(e,t){let r={};return Object.entries(t).forEach(([n,i])=>{if(r[n]=e.style[n],!n.startsWith("--"))n=ws(n);e.style.setProperty(n,i)}),setTimeout(()=>{if(e.style.length===0)e.removeAttribute("style")}),()=>{Ze(e,r)}}function vs(e,t){let r=e.getAttribute("style",t);return e.setAttribute("style",t),()=>{e.setAttribute("style",r||"")}}function ws(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function Tt(e,t=()=>{}){let r=!1;return function(){if(!r)r=!0,e.apply(this,arguments);else t.apply(this,arguments)}}function _s(e,t,r){cn(e,Yt,""),{enter:(i)=>{e._x_transition.enter.during=i},"enter-start":(i)=>{e._x_transition.enter.start=i},"enter-end":(i)=>{e._x_transition.enter.end=i},leave:(i)=>{e._x_transition.leave.during=i},"leave-start":(i)=>{e._x_transition.leave.start=i},"leave-end":(i)=>{e._x_transition.leave.end=i}}[r](t)}function Es(e,t,r){cn(e,Ze);let n=!t.includes("in")&&!t.includes("out")&&!r,i=n||t.includes("in")||["enter"].includes(r),o=n||t.includes("out")||["leave"].includes(r);if(t.includes("in")&&!n)t=t.filter((f,x)=>x<t.indexOf("out"));if(t.includes("out")&&!n)t=t.filter((f,x)=>x>t.indexOf("out"));let s=!t.includes("opacity")&&!t.includes("scale"),a=s||t.includes("opacity"),l=s||t.includes("scale"),c=a?0:1,d=l?he(t,"scale",95)/100:1,u=he(t,"delay",0)/1000,p=he(t,"origin","center"),b="opacity, transform",m=he(t,"duration",150)/1000,h=he(t,"duration",75)/1000,g="cubic-bezier(0.4, 0.0, 0.2, 1)";if(i)e._x_transition.enter.during={transformOrigin:p,transitionDelay:`${u}s`,transitionProperty:b,transitionDuration:`${m}s`,transitionTimingFunction:g},e._x_transition.enter.start={opacity:c,transform:`scale(${d})`},e._x_transition.enter.end={opacity:1,transform:"scale(1)"};if(o)e._x_transition.leave.during={transformOrigin:p,transitionDelay:`${u}s`,transitionProperty:b,transitionDuration:`${h}s`,transitionTimingFunction:g},e._x_transition.leave.start={opacity:1,transform:"scale(1)"},e._x_transition.leave.end={opacity:c,transform:`scale(${d})`}}function cn(e,t,r={}){if(!e._x_transition)e._x_transition={enter:{during:r,start:r,end:r},leave:{during:r,start:r,end:r},in(n=()=>{},i=()=>{}){Ot(e,t,{during:this.enter.during,start:this.enter.start,end:this.enter.end},n,i)},out(n=()=>{},i=()=>{}){Ot(e,t,{during:this.leave.during,start:this.leave.start,end:this.leave.end},n,i)}}}function dn(e){let t=e.parentNode;if(!t)return;return t._x_hidePromise?t:dn(t)}function Ot(e,t,{during:r,start:n,end:i}={},o=()=>{},s=()=>{}){if(e._x_transitioning)e._x_transitioning.cancel();if(Object.keys(r).length===0&&Object.keys(n).length===0&&Object.keys(i).length===0){o(),s();return}let a,l,c;ks(e,{start(){a=t(e,n)},during(){l=t(e,r)},before:o,end(){a(),c=t(e,i)},after:s,cleanup(){l(),c()}})}function ks(e,t){let r,n,i,o=Tt(()=>{_(()=>{if(r=!0,!n)t.before();if(!i)t.end(),St();if(t.after(),e.isConnected)t.cleanup();delete e._x_transitioning})});e._x_transitioning={beforeCancels:[],beforeCancel(s){this.beforeCancels.push(s)},cancel:Tt(function(){while(this.beforeCancels.length)this.beforeCancels.shift()();o()}),finish:o},_(()=>{t.start(),t.during()}),gs(),requestAnimationFrame(()=>{if(r)return;let s=Number(getComputedStyle(e).transitionDuration.replace(/,.*/,"").replace("s",""))*1000,a=Number(getComputedStyle(e).transitionDelay.replace(/,.*/,"").replace("s",""))*1000;if(s===0)s=Number(getComputedStyle(e).animationDuration.replace("s",""))*1000;_(()=>{t.before()}),n=!0,requestAnimationFrame(()=>{if(r)return;_(()=>{t.end()}),St(),setTimeout(e._x_transitioning.finish,s+a),i=!0})})}function he(e,t,r){if(e.indexOf(t)===-1)return r;let n=e[e.indexOf(t)+1];if(!n)return r;if(t==="scale"){if(isNaN(n))return r}if(t==="duration"||t==="delay"){let i=n.match(/([0-9]+)ms/);if(i)return i[1]}if(t==="origin"){if(["top","right","left","center","bottom"].includes(e[e.indexOf(t)+2]))return[n,e[e.indexOf(t)+2]].join(" ")}return n}function un(e,t,r,n=[]){if(!e._x_bindings)e._x_bindings=le({});switch(e._x_bindings[t]=r,t=n.includes("camel")?Ls(t):t,t){case"value":As(e,r);break;case"style":Cs(e,r);break;case"class":Ss(e,r);break;case"selected":case"checked":Ts(e,t,r);break;default:Jt(e,t,r);break}}function As(e,t){if(Gt(e)){if(e.attributes.value===void 0)e.value=t}else if(qe(e))if(Number.isInteger(t))e.value=t;else if(!Array.isArray(t)&&typeof t!=="boolean"&&![null,void 0].includes(t))e.value=String(t);else if(Array.isArray(t))e.checked=t.some((r)=>Ds(r,e.value));else e.checked=!!t;else if(e.tagName==="SELECT")Is(e,t);else if(e.tagName==="OPTION")Jt(e,"value",t);else{if(e.value===t&&(typeof t!=="object"||t===null))return;e.value=t===void 0?"":t}}function Ss(e,t){if(e._x_undoAddedClasses)e._x_undoAddedClasses();e._x_undoAddedClasses=Yt(e,t)}function Cs(e,t){if(e._x_undoAddedStyles)e._x_undoAddedStyles();e._x_undoAddedStyles=Ze(e,t)}function Ts(e,t,r){Jt(e,t,r),Ms(e,t,r)}function Jt(e,t,r){if([null,void 0,!1].includes(r)&&Bs(t))e.removeAttribute(t);else{if(fn(t))r=t;if(Ps(r))r=JSON.stringify(r);Os(e,t,r)}}function Os(e,t,r){if(e.getAttribute(t)!=r)e.setAttribute(t,r)}function Ms(e,t,r){if(e[t]!==r)e[t]=r}function Is(e,t){let r=[].concat(t).map((n)=>n+"");Array.from(e.options).forEach((n)=>{n.selected=r.includes(n.value)})}function Ls(e){return e.toLowerCase().replace(/-(\w)/g,(t,r)=>r.toUpperCase())}function Ds(e,t){return e==t}function Re(e){if([1,"1","true","on","yes",!0].includes(e))return!0;if([0,"0","false","off","no",!1].includes(e))return!1;return e?Boolean(e):null}function fn(e){return Ns.has(e)}function Bs(e){return!["aria-pressed","aria-checked","aria-expanded","aria-selected"].includes(e)}function Ps(e){return typeof e==="object"&&e!==null}function $s(e,t,r){if(e._x_bindings&&e._x_bindings[t]!==void 0)return e._x_bindings[t];return hn(e,t,r)}function Rs(e,t,r,n=!0){if(e._x_bindings&&e._x_bindings[t]!==void 0)return e._x_bindings[t];if(e._x_inlineBindings&&e._x_inlineBindings[t]!==void 0){let i=e._x_inlineBindings[t];return i.extract=n,Ur(()=>Y(e,i.expression))}return hn(e,t,r)}function hn(e,t,r){let n=e.getAttribute(t);if(n===null)return typeof r==="function"?r():r;if(n==="")return!0;if(fn(t))return!![t,"true"].includes(n);return n}function qe(e){return e.type==="checkbox"||e.localName==="ui-checkbox"||e.localName==="ui-switch"}function Gt(e){return e.type==="radio"||e.localName==="ui-radio"}function pn(e,t){let r;return function(){let n=this,i=arguments,o=function(){r=null,e.apply(n,i)};clearTimeout(r),r=setTimeout(o,t)}}function bn(e,t){let r;return function(){let n=this,i=arguments;if(!r)e.apply(n,i),r=!0,setTimeout(()=>r=!1,t)}}function mn({get:e,set:t},{get:r,set:n}){let i=!0,o,s,a=re(()=>{let l=e(),c=r();if(i)n(ct(l)),i=!1;else{let d=JSON.stringify(l),u=JSON.stringify(c);if(d!==o)n(ct(l));else if(d!==u)t(ct(c))}o=JSON.stringify(e()),s=JSON.stringify(r())});return()=>{$t(a),ce(a)}}function ct(e){return typeof e==="object"?JSON.parse(JSON.stringify(e)):e}function zs(e){(Array.isArray(e)?e:[e]).forEach((r)=>r(ue))}function Hs(e,t){if(!gr)B=le(B),gr=!0;if(t===void 0)return B[e];if(B[e]=t,typeof t==="object"&&t!==null&&t._x_interceptor)B[e]=t.initialize(B,e,e,()=>{});else jt(B[e]);if(typeof t==="object"&&t!==null&&t.hasOwnProperty("init")&&typeof t.init==="function")B[e].init()}function Us(){return B}function js(e,t){let r=typeof t!=="function"?()=>t:t;if(e instanceof Element)return xn(e,r());else gn[e]=r;return()=>{}}function qs(e){return Object.entries(gn).forEach(([t,r])=>{Object.defineProperty(e,t,{get(){return(...n)=>r(...n)}})}),e}function xn(e,t,r){let n=[];while(n.length)n.pop()();let i=Object.entries(t).map(([s,a])=>({name:s,value:a})),o=Fr(i);return i=i.map((s)=>{if(o.find((a)=>a.name===s.name))return{name:`x-bind:${s.name}`,value:`"${s.value}"`};return s}),Je(e,i,r).map((s)=>{n.push(s.runCleanups),s()}),()=>{while(n.length)n.pop()()}}function Fs(e,t){yn[e]=t}function Ks(e,t){return Object.entries(yn).forEach(([r,n])=>{Object.defineProperty(e,r,{get(){return(...i)=>n.bind(t)(...i)},enumerable:!1})}),e}function wn(e){try{let r=new Ys(e).tokenize(),i=new Js(r).parse(),o=new Gs;return function(s={}){let{scope:a={},context:l=null,forceBindingRootScopeToFunctions:c=!1}=s;return o.evaluate({node:i,scope:a,context:l,forceBindingRootScopeToFunctions:c})}}catch(t){throw Error(`CSP Parser Error: ${t.message}`)}}function Xs(e,t,r={}){let n=_n(e),i=G([r.scope??{},...n]),o=r.params??[],a=wn(t)({scope:i,forceBindingRootScopeToFunctions:!0});if(typeof a==="function"&&W)return a.apply(i,o);return a}function Zs(e,t){let r=_n(e);if(typeof t==="function")return Gi(r,t);let n=Qs(e,t,r);return Ki.bind(null,e,t,n)}function _n(e){let t={};return Ue(t,e),[t,...ae(e)]}function Qs(e,t,r){if(e instanceof HTMLIFrameElement)throw Error("Evaluating expressions on an iframe is prohibited in the CSP build");if(e instanceof HTMLScriptElement)throw Error("Evaluating expressions on a script is prohibited in the CSP build");return(n=()=>{},{scope:i={},params:o=[]}={})=>{let s=G([i,...r]),l=wn(t)({scope:s,forceBindingRootScopeToFunctions:!0});if(W&&typeof l==="function"){let c=l.apply(l,o);if(c instanceof Promise)c.then((d)=>n(d));else n(c)}else if(typeof l==="object"&&l instanceof Promise)l.then((c)=>n(c));else n(l)}}function En(e){let t=Object.create(null);for(let r of e.split(","))t[r]=1;return(r)=>(r in t)}function Z(e,...t){console.warn(`[Vue warn] ${e}`,...t)}function oo(e,t=!1){if(e.flags|=8,t){e.next=ye,ye=e;return}e.next=xe,xe=e}function Zt(){Cn++}function Qt(){if(--Cn>0)return;if(ye){let t=ye;ye=void 0;while(t){let r=t.next;t.next=void 0,t.flags&=-9,t=r}}let e;while(xe){let t=xe;xe=void 0;while(t){let r=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(n){if(!e)e=n}t=r}}if(e)throw e}function Tn(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function On(e){let t,r=e.depsTail,n=r;while(n){let i=n.prevDep;if(n.version===-1){if(n===r)r=i;er(n),lo(n)}else t=n;n.dep.activeLink=n.prevActiveLink,n.prevActiveLink=void 0,n=i}e.deps=t,e.depsTail=r}function It(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(ao(t.dep.computed)||t.dep.version!==t.version))return!0;if(e._dirty)return!0;return!1}function ao(e){if(e.flags&4&&!(e.flags&16))return;if(e.flags&=-17,e.globalVersion===Fe)return;if(e.globalVersion=Fe,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!It(e)))return;e.flags|=2;let t=e.dep,r=y,n=O;y=e,O=!0;try{Tn(e);let i=e.fn(e._value);if(t.version===0||K(i,e._value))e.flags|=128,e._value=i,t.version++}catch(i){throw t.version++,i}finally{y=r,O=n,On(e),e.flags&=-3}}function er(e,t=!1){let{dep:r,prevSub:n,nextSub:i}=e;if(n)n.nextSub=i,e.prevSub=void 0;if(i)i.prevSub=n,e.nextSub=void 0;if(r.subsHead===e)r.subsHead=i;if(r.subs===e){if(r.subs=n,!n&&r.computed){r.computed.flags&=-5;for(let o=r.computed.deps;o;o=o.nextDep)er(o,!0)}}if(!t&&!--r.sc&&r.map)r.map.delete(r.key)}function lo(e){let{prevDep:t,nextDep:r}=e;if(t)t.nextDep=r,e.prevDep=void 0;if(r)r.prevDep=t,e.nextDep=void 0}function co(e,t){if(e.effect instanceof yr)e=e.effect.fn;let r=new yr(e);if(t)we(r,t);try{r.run()}catch(i){throw r.stop(),i}let n=r.run.bind(r);return n.effect=r,n}function uo(e){e.effect.stop()}function fo(){Mn.push(O),O=!1}function ho(){let e=Mn.pop();O=e===void 0?!0:e}function vr(e){let{cleanup:t}=e;if(e.cleanup=void 0,t){let r=y;y=void 0;try{t()}finally{y=r}}}function In(e){if(e.dep.sc++,e.sub.flags&4){let t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let n=t.deps;n;n=n.nextDep)In(n)}let r=e.dep.subs;if(r!==e){if(e.prevSub=r,r)r.nextSub=e}if(e.dep.subsHead===void 0)e.dep.subsHead=e;e.dep.subs=e}}function S(e,t,r){if(O&&y){let n=Lt.get(e);if(!n)Lt.set(e,n=new Map);let i=n.get(r);if(!i)n.set(r,i=new bo),i.map=n,i.key=r;i.track({target:e,type:t,key:r})}}function U(e,t,r,n,i,o){let s=Lt.get(e);if(!s){Fe++;return}let a=(l)=>{if(l)l.trigger({target:e,type:t,key:r,newValue:n,oldValue:i,oldTarget:o})};if(Zt(),t==="clear")s.forEach(a);else{let l=_e(e),c=l&&Xt(r);if(l&&r==="length"){let d=Number(n);s.forEach((u,p)=>{if(p==="length"||p===ke||!Te(p)&&p>=d)a(u)})}else{if(r!==void 0||s.has(void 0))a(s.get(r));if(c)a(s.get(ke));switch(t){case"add":if(!l){if(a(s.get(J)),ge(e))a(s.get(Dt))}else if(c)a(s.get("length"));break;case"delete":if(!l){if(a(s.get(J)),ge(e))a(s.get(Dt))}break;case"set":if(ge(e))a(s.get(J));break}}}Qt()}function se(e){let t=v(e);if(t===e)return t;return S(t,"iterate",ke),ee(e)?t:t.map(te)}function tr(e){return S(e=v(e),"iterate",ke),e}function I(e,t){if(Q(e))return Rn(e)?Ae(te(t)):Ae(t);return te(t)}function ft(e,t,r){let n=tr(e),i=n[t]();if(n!==e&&!ee(e))i._next=i.next,i.next=()=>{let o=i._next();if(!o.done)o.value=r(o.value);return o};return i}function N(e,t,r,n,i,o){let s=tr(e),a=s!==e&&!ee(e),l=s[t];if(l!==go[t]){let u=l.apply(e,o);return a?te(u):u}let c=r;if(s!==e){if(a)c=function(u,p){return r.call(this,I(e,u),p,e)};else if(r.length>2)c=function(u,p){return r.call(this,u,p,e)}}let d=l.call(s,c,n);return a&&i?i(d):d}function wr(e,t,r,n){let i=tr(e),o=i!==e&&!ee(e),s=r,a=!1;if(i!==e){if(o)a=n.length===0,s=function(c,d,u){if(a)a=!1,c=I(e,c);return r.call(this,c,I(e,d),u,e)};else if(r.length>3)s=function(c,d,u){return r.call(this,c,d,u,e)}}let l=i[t](s,...n);return a?I(e,l):l}function ht(e,t,r){let n=v(e);S(n,"iterate",ke);let i=n[t](...r);if((i===-1||i===!1)&&Io(r[0]))return r[0]=v(r[0]),n[t](...r);return i}function pe(e,t,r=[]){fo(),Zt();let n=v(e)[t].apply(e,r);return Qt(),ho(),n}function yo(e){if(!Te(e))e=String(e);let t=v(this);return S(t,"has",e),t.hasOwnProperty(e)}function ko(e,t,r){return function(...n){let i=this.__v_raw,o=v(i),s=ge(o),a=e==="entries"||e===Symbol.iterator&&s,l=e==="keys"&&s,c=i[e](...n),d=r?Nt:t?Ae:te;return!t&&S(o,"iterate",l?Dt:J),we(Object.create(c),{next(){let{value:u,done:p}=c.next();return p?{value:u,done:p}:{value:a?[d(u[0]),d(u[1])]:d(u),done:p}}})}}function Pe(e){return function(...t){{let r=t[0]?`on key "${t[0]}" `:"";Z(`${Sn(e)} operation ${r}failed: target is readonly.`,v(this))}return e==="delete"?!1:e==="clear"?void 0:this}}function Ao(e,t){let r={get(i){let o=this.__v_raw,s=v(o),a=v(i);if(!e){if(K(i,a))S(s,"get",i);S(s,"get",a)}let{has:l}=Be(s),c=t?Nt:e?Ae:te;if(l.call(s,i))return c(o.get(i));else if(l.call(s,a))return c(o.get(a));else if(o!==s)o.get(i)},get size(){let i=this.__v_raw;return!e&&S(v(i),"iterate",J),i.size},has(i){let o=this.__v_raw,s=v(o),a=v(i);if(!e){if(K(i,a))S(s,"has",i);S(s,"has",a)}return i===a?o.has(i):o.has(i)||o.has(a)},forEach(i,o){let s=this,a=s.__v_raw,l=v(a),c=t?Nt:e?Ae:te;return!e&&S(l,"iterate",J),a.forEach((d,u)=>i.call(o,c(d),c(u),s))}};return we(r,e?{add:Pe("add"),set:Pe("set"),delete:Pe("delete"),clear:Pe("clear")}:{add(i){let o=v(this),s=Be(o),a=v(i),l=!t&&!ee(i)&&!Q(i)?a:i;if(!(s.has.call(o,l)||K(i,l)&&s.has.call(o,i)||K(a,l)&&s.has.call(o,a)))o.add(l),U(o,"add",l,l);return this},set(i,o){if(!t&&!ee(o)&&!Q(o))o=v(o);let s=v(this),{has:a,get:l}=Be(s),c=a.call(s,i);if(!c)i=v(i),c=a.call(s,i);else _r(s,a,i);let d=l.call(s,i);if(s.set(i,o),!c)U(s,"add",i,o);else if(K(o,d))U(s,"set",i,o,d);return this},delete(i){let o=v(this),{has:s,get:a}=Be(o),l=s.call(o,i);if(!l)i=v(i),l=s.call(o,i);else _r(o,s,i);let c=a?a.call(o,i):void 0,d=o.delete(i);if(l)U(o,"delete",i,void 0,c);return d},clear(){let i=v(this),o=i.size!==0,s=ge(i)?new Map(i):new Set(i),a=i.clear();if(o)U(i,"clear",void 0,void 0,s);return a}}),["keys","values","entries",Symbol.iterator].forEach((i)=>{r[i]=ko(i,e,t)}),r}function Nn(e,t){let r=Ao(e,t);return(n,i,o)=>{if(i==="__v_isReactive")return!e;else if(i==="__v_isReadonly")return e;else if(i==="__v_raw")return n;return Reflect.get(Mt(r,i)&&i in n?r:n,i,o)}}function _r(e,t,r){let n=v(r);if(n!==r&&t.call(e,n)){let i=An(e);Z(`Reactive ${i} contains both the raw and reactive versions of the same object${i==="Map"?" as keys":""}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`)}}function Mo(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function rr(e){if(Q(e))return e;return $n(e,!1,_o,So,Bn)}function Bt(e){return $n(e,!0,Eo,Co,Pn)}function $n(e,t,r,n,i){if(!Ee(e))return Z(`value cannot be made ${t?"readonly":"reactive"}: ${String(e)}`),e;if(e.__v_raw&&!(t&&e.__v_isReactive))return e;if(e.__v_skip||!Object.isExtensible(e))return e;let o=i.get(e);if(o)return o;let s=Mo(An(e));if(s===0)return e;let a=new Proxy(e,s===2?n:r);return i.set(e,a),a}function Rn(e){if(Q(e))return Rn(e.__v_raw);return!!(e&&e.__v_isReactive)}function Q(e){return!!(e&&e.__v_isReadonly)}function ee(e){return!!(e&&e.__v_isShallow)}function Io(e){return e?!!e.__v_raw:!1}function v(e){let t=e&&e.__v_raw;return t?v(t):e}function ve(e){return e?e.__v_isRef===!0:!1}function Lo(e){let t=[];return T(e,(r)=>{if(r._x_refs)t.push(r._x_refs)}),t}function zn(e){if(!pt[e])pt[e]=0;return++pt[e]}function Do(e,t){return T(e,(r)=>{if(r._x_ids&&r._x_ids[t])return!0})}function No(e,t){if(!e._x_ids)e._x_ids={};if(!e._x_ids[t])e._x_ids[t]=zn(t)}function Bo(e,t,r,n){if(!e._x_id)e._x_id={};if(e._x_id[t])return e._x_id[t];let i=n();return e._x_id[t]=i,r(()=>{delete e._x_id[t]}),i}function Hn(e,t,r){M(t,(n)=>L(`You can't use [$${t}] without first installing the "${e}" plugin here: https://alpinejs.dev/plugins/${r}`,n))}function Er(e){let t=R(()=>document.querySelector(e),()=>Po)();if(!t)L(`Cannot find x-teleport element for selector: "${e}"`);return t}function oe(e,t,r,n){let i=e,o=(l)=>n(l),s={},a=(l,c)=>(d)=>c(l,d);if(r.includes("dot"))t=$o(t);if(r.includes("camel"))t=Ro(t);if(r.includes("capture"))s.capture=!0;if(r.includes("window"))i=window;if(r.includes("document"))i=document;if(r.includes("passive"))s.passive=r[r.indexOf("passive")+1]!=="false";if(o=jn(r,o),r.includes("prevent"))o=a(o,(l,c)=>{c.preventDefault(),l(c)});if(r.includes("stop"))o=a(o,(l,c)=>{c.stopPropagation(),l(c)});if(r.includes("once"))o=a(o,(l,c)=>{l(c),i.removeEventListener(t,o,s)});if(r.includes("away")||r.includes("outside"))i=document,o=a(o,(l,c)=>{if(e.contains(c.target))return;if(c.target.isConnected===!1)return;if(e.offsetWidth<1&&e.offsetHeight<1)return;if(e._x_isShown===!1)return;l(c)});if(r.includes("self"))o=a(o,(l,c)=>{c.target===e&&l(c)});if(t==="submit")o=a(o,(l,c)=>{if(c.target._x_pendingModelUpdates)c.target._x_pendingModelUpdates.forEach((d)=>d());l(c)});if(Ho(t)||qn(t))o=a(o,(l,c)=>{if(jo(c,r))return;l(c)});return i.addEventListener(t,o,s),()=>{i.removeEventListener(t,o,s)}}function jn(e,t){if(e.includes("debounce")){let r=e[e.indexOf("debounce")+1]||"invalid-wait",n=Ke(r.split("ms")[0])?Number(r.split("ms")[0]):250;t=pn(t,n)}if(e.includes("throttle")){let r=e[e.indexOf("throttle")+1]||"invalid-wait",n=Ke(r.split("ms")[0])?Number(r.split("ms")[0]):250;t=bn(t,n)}return t}function $o(e){return e.replace(/-/g,".")}function Ro(e){return e.toLowerCase().replace(/-(\w)/g,(t,r)=>r.toUpperCase())}function Ke(e){return!Array.isArray(e)&&!isNaN(e)}function zo(e){if([" ","_"].includes(e))return e;return e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[_\s]/,"-").toLowerCase()}function Ho(e){return["keydown","keyup"].includes(e)}function qn(e){return["contextmenu","click","mouse"].some((t)=>e.includes(t))}function jo(e,t){let r=t.filter((o,s)=>{if(o==="false"&&t[s-1]==="passive")return!1;return!Uo.includes(o)});if(r.includes("debounce")){let o=r.indexOf("debounce");r.splice(o,Ke((r[o+1]||"invalid-wait").split("ms")[0])?2:1)}if(r.includes("throttle")){let o=r.indexOf("throttle");r.splice(o,Ke((r[o+1]||"invalid-wait").split("ms")[0])?2:1)}if(r.length===0)return!1;if(r.length===1&&kr(e.key).includes(r[0]))return!1;let i=["ctrl","shift","alt","meta","cmd","super"].filter((o)=>r.includes(o));if(r=r.filter((o)=>!i.includes(o)),i.length>0){if(i.filter((s)=>{if(s==="cmd"||s==="super")s="meta";return e[`${s}Key`]}).length===i.length){if(qn(e.type))return!1;if(kr(e.key).includes(r[0]))return!1}}return!0}function kr(e){if(!e)return[];e=zo(e);let t={ctrl:"control",slash:"/",space:" ",spacebar:" ",cmd:"meta",esc:"escape",up:"arrow-up",down:"arrow-down",left:"arrow-left",right:"arrow-right",period:".",comma:",",equal:"=",minus:"-",underscore:"_"};return t[e]=e,Object.keys(t).map((r)=>{if(t[r]===e)return r}).filter((r)=>r)}function $e(e,t,r,n){return _(()=>{if(r instanceof CustomEvent&&r.detail!==void 0)return r.detail!==null&&r.detail!==void 0?r.detail:r.target.value;else if(qe(e))if(Array.isArray(n)){let i=null;if(t.includes("number"))i=bt(r.target.value);else if(t.includes("boolean"))i=Re(r.target.value);else i=r.target.value;return r.target.checked?n.includes(i)?n:n.concat([i]):n.filter((o)=>!qo(o,i))}else return r.target.checked;else if(e.tagName.toLowerCase()==="select"&&e.multiple){if(t.includes("number"))return Array.from(r.target.selectedOptions).map((i)=>{let o=i.value||i.text;return bt(o)});else if(t.includes("boolean"))return Array.from(r.target.selectedOptions).map((i)=>{let o=i.value||i.text;return Re(o)});return Array.from(r.target.selectedOptions).map((i)=>i.value||i.text)}else{let i;if(Gt(e))if(r.target.checked)i=r.target.value;else i=n;else i=r.target.value;if(t.includes("number"))return bt(i);else if(t.includes("boolean"))return Re(i);else if(t.includes("trim"))return i.trim();else return i}})}function bt(e){let t=e?parseFloat(e):null;return Fo(t)?t:e}function qo(e,t){return e==t}function Fo(e){return!Array.isArray(e)&&!isNaN(e)}function Ar(e){return e!==null&&typeof e==="object"&&typeof e.get==="function"&&typeof e.set==="function"}function Ko(e,t){e._x_keyExpression=t}function Vo(e,t){Object.keys(t).forEach((r)=>{let n=Object.getOwnPropertyDescriptor(t,r),i=Object.getOwnPropertyDescriptor(e,r);if(n.get||n.set||i?.get||i?.set){if(i)delete e[r];if(!i)e[r]=void 0;n.get||n.set?Object.defineProperty(e,r,n):e[r]=t[r]}else e[r]=t[r]}),Object.keys(e).filter((r)=>!Object.prototype.hasOwnProperty.call(t,r)).forEach((r)=>delete e[r])}function Wo(e){if(!j)return!1;if(kt)return!0;return e.hasAttribute("data-has-alpine-state")}function Yo(e){return(t)=>{Object.entries(t).forEach(([r,n])=>{e[r]=n})}}function Jo(e,t,r,n){r((i)=>{if(Zo(i))i=Array.from({length:i},(c,d)=>d+1);if(i===void 0||i===null)i=[];if(i instanceof Set)i=Array.from(i);if(i instanceof Map)i=Array.from(i);let o=e._x_lookup,s=new Map;e._x_lookup=s;let a=Qo(i),l=Object.entries(i).map(([c,d])=>{if(!a)c=parseInt(c);let u=Xo(t,d,c,i),p;return n((b)=>{if(typeof b==="object")L("x-for key cannot be an object, it must be a string or an integer",e);if(o.has(b))s.set(b,o.get(b)),o.delete(b);p=b},{scope:{index:c,...u}}),[p,u]});_(()=>{o.forEach((u)=>{ne(u),u.remove()});let c=new Set,d=e;if(l.forEach(([u,p])=>{if(s.has(u)){let h=s.get(u);if(h._x_refreshXForScope(p),d.nextElementSibling!==h){if(d.nextElementSibling)h.replaceWith(d.nextElementSibling);d.after(h)}if(d=h,h._x_currentIfEl){if(h.nextElementSibling!==h._x_currentIfEl)d.after(h._x_currentIfEl);d=h._x_currentIfEl}return}if(e.content.children.length>1)L("x-for templates require a single root element, additional elements will be ignored.",e);let b=document.importNode(e.content,!0).firstElementChild,m=le(p);Se(b,m,e),b._x_refreshXForScope=Yo(m),s.set(u,b),c.add(b),d.after(b),d=b}),c.forEach((u)=>D(u)),d!==e)e._x_lastRenderedEl=d;else delete e._x_lastRenderedEl})})}function Go(e){let t=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,r=/^\s*\(|\)\s*$/g,n=/([\s\S]*?)\b(?:in|of)\b([\s\S]*)/,i=e.match(n);if(!i)return;let o={};o.items=i[2].trim();let s=i[1].replace(r,"").trim(),a=s.match(t);if(a){if(o.item=s.replace(t,"").trim(),o.index=a[1].trim(),a[2])o.collection=a[2].trim()}else o.item=s;return o}function Xo(e,t,r,n){let i={};if(/^\[.*\]$/.test(e.item)&&Array.isArray(t))e.item.replace("[","").replace("]","").split(",").map((s)=>s.trim()).forEach((s,a)=>{i[s]=t[a]});else if(/^\{.*\}$/.test(e.item)&&!Array.isArray(t)&&typeof t==="object")e.item.replace("{","").replace("}","").split(",").map((s)=>s.trim()).forEach((s)=>{i[s]=t[s]});else i[e.item]=t;if(e.index)i[e.index]=r;if(e.collection)i[e.collection]=n;return i}function Zo(e){return typeof e!=="object"&&!isNaN(e)}function Qo(e){return typeof e==="object"&&!Array.isArray(e)}function Kn(){}function et(e,t,r){E(t,(n)=>L(`You can't use [x-${t}] without first installing the "${e}" plugin here: https://alpinejs.dev/plugins/${r}`,n))}var mt=!1,gt=!1,P,xt=-1,ze=!1,Pt=!1,le,re,ce,Cr,Mi=0,yt=!0,Or,Mr,Ir,Ve,zt=!1,F,Ut=!1,He,Ui,zr,Hr,W=!0,jr=()=>{},qr,qt="x-",je,_t=!1,be,Kr,Wr=(e,t)=>({name:r,value:n})=>{if(r.startsWith(e))r=r.replace(e,t);return{name:r,value:n}},Yr=(e)=>e,Gr,Zr=()=>new RegExp(`^${qt}([^:^.]+)\\b`),Et="DEFAULT",V,j=!1,Qr,kt=!1,Ge=0,br=!1,Kt,rn,ln,bs=1,At,Vt=!1,Ns,B,gr=!1,gn,yn,Vs,ue,xr,vn,k=class{constructor(e,t,r,n){this.type=e,this.value=t,this.start=r,this.end=n}},Ws,Ys=class{constructor(e){this.input=e,this.position=0,this.tokens=[]}tokenize(){while(this.position<this.input.length){if(this.skipWhitespace(),this.position>=this.input.length)break;let e=this.input[this.position];if(this.isDigit(e))this.readNumber();else if(this.isAlpha(e)||e==="_"||e==="$")this.readIdentifierOrKeyword();else if(e==='"'||e==="'")this.readString();else if(e==="/"&&this.peek()==="/")this.skipLineComment();else this.readOperatorOrPunctuation()}return this.tokens.push(new k("EOF",null,this.position,this.position)),this.tokens}skipWhitespace(){while(this.position<this.input.length&&/\s/.test(this.input[this.position]))this.position++}skipLineComment(){while(this.position<this.input.length&&this.input[this.position]!==`
|
|
6
6
|
`)this.position++}isDigit(e){return/[0-9]/.test(e)}isAlpha(e){return/[a-zA-Z]/.test(e)}isAlphaNumeric(e){return/[a-zA-Z0-9_$]/.test(e)}peek(e=1){return this.input[this.position+e]||""}readNumber(){let e=this.position,t=!1;while(this.position<this.input.length){let n=this.input[this.position];if(this.isDigit(n))this.position++;else if(n==="."&&!t)t=!0,this.position++;else break}let r=this.input.slice(e,this.position);this.tokens.push(new k("NUMBER",parseFloat(r),e,this.position))}readIdentifierOrKeyword(){let e=this.position;while(this.position<this.input.length&&this.isAlphaNumeric(this.input[this.position]))this.position++;let t=this.input.slice(e,this.position);if(["true","false","null","undefined","new","typeof","void","delete","in","instanceof"].includes(t))if(t==="true"||t==="false")this.tokens.push(new k("BOOLEAN",t==="true",e,this.position));else if(t==="null")this.tokens.push(new k("NULL",null,e,this.position));else if(t==="undefined")this.tokens.push(new k("UNDEFINED",void 0,e,this.position));else this.tokens.push(new k("KEYWORD",t,e,this.position));else this.tokens.push(new k("IDENTIFIER",t,e,this.position))}readString(){let e=this.position,t=this.input[this.position];this.position++;let r="",n=!1;while(this.position<this.input.length){let i=this.input[this.position];if(n){switch(i){case"n":r+=`
|
|
7
|
-
`;break;case"t":r+="\t";break;case"r":r+="\r";break;case"\\":r+="\\";break;case t:r+=t;break;case"u":{let o=this.input.slice(this.position+1,this.position+5);if(/^[0-9a-fA-F]{4}$/.test(o))r+=String.fromCharCode(parseInt(o,16)),this.position+=4;else r+=i;break}default:r+=i}n=!1}else if(i==="\\")n=!0;else if(i===t){this.position++,this.tokens.push(new k("STRING",r,e,this.position));return}else r+=i;this.position++}throw Error(`Unterminated string starting at position ${e}`)}readOperatorOrPunctuation(){let e=this.position,t=this.input[this.position],r=this.peek(),n=this.peek(2);if(t==="="&&r==="="&&n==="=")this.position+=3,this.tokens.push(new k("OPERATOR","===",e,this.position));else if(t==="!"&&r==="="&&n==="=")this.position+=3,this.tokens.push(new k("OPERATOR","!==",e,this.position));else if(t==="="&&r==="=")this.position+=2,this.tokens.push(new k("OPERATOR","==",e,this.position));else if(t==="!"&&r==="=")this.position+=2,this.tokens.push(new k("OPERATOR","!=",e,this.position));else if(t==="<"&&r==="=")this.position+=2,this.tokens.push(new k("OPERATOR","<=",e,this.position));else if(t===">"&&r==="=")this.position+=2,this.tokens.push(new k("OPERATOR",">=",e,this.position));else if(t==="&"&&r==="&")this.position+=2,this.tokens.push(new k("OPERATOR","&&",e,this.position));else if(t==="|"&&r==="|")this.position+=2,this.tokens.push(new k("OPERATOR","||",e,this.position));else if(t==="+"&&r==="+")this.position+=2,this.tokens.push(new k("OPERATOR","++",e,this.position));else if(t==="-"&&r==="-")this.position+=2,this.tokens.push(new k("OPERATOR","--",e,this.position));else{this.position++;let i="()[]{},.;:?".includes(t)?"PUNCTUATION":"OPERATOR";this.tokens.push(new k(i,t,e,this.position))}}},Js=class{constructor(e){this.tokens=e,this.position=0}parse(){if(this.isAtEnd())throw Error("Empty expression");let e=this.parseExpression();if(this.match("PUNCTUATION",";"),!this.isAtEnd())throw Error(`Unexpected token: ${this.current().value}`);return e}parseExpression(){return this.parseAssignment()}parseAssignment(){let e=this.parseTernary();if(this.match("OPERATOR","=")){let t=this.parseAssignment();if(e.type==="Identifier"||e.type==="MemberExpression")return{type:"AssignmentExpression",left:e,operator:"=",right:t};throw Error("Invalid assignment target")}return e}parseTernary(){let e=this.parseLogicalOr();if(this.match("PUNCTUATION","?")){let t=this.parseExpression();this.consume("PUNCTUATION",":");let r=this.parseExpression();return{type:"ConditionalExpression",test:e,consequent:t,alternate:r}}return e}parseLogicalOr(){let e=this.parseLogicalAnd();while(this.match("OPERATOR","||")){let t=this.previous().value,r=this.parseLogicalAnd();e={type:"BinaryExpression",operator:t,left:e,right:r}}return e}parseLogicalAnd(){let e=this.parseEquality();while(this.match("OPERATOR","&&")){let t=this.previous().value,r=this.parseEquality();e={type:"BinaryExpression",operator:t,left:e,right:r}}return e}parseEquality(){let e=this.parseRelational();while(this.match("OPERATOR","==","!=","===","!==")){let t=this.previous().value,r=this.parseRelational();e={type:"BinaryExpression",operator:t,left:e,right:r}}return e}parseRelational(){let e=this.parseAdditive();while(this.match("OPERATOR","<",">","<=",">=")){let t=this.previous().value,r=this.parseAdditive();e={type:"BinaryExpression",operator:t,left:e,right:r}}return e}parseAdditive(){let e=this.parseMultiplicative();while(this.match("OPERATOR","+","-")){let t=this.previous().value,r=this.parseMultiplicative();e={type:"BinaryExpression",operator:t,left:e,right:r}}return e}parseMultiplicative(){let e=this.parseUnary();while(this.match("OPERATOR","*","/","%")){let t=this.previous().value,r=this.parseUnary();e={type:"BinaryExpression",operator:t,left:e,right:r}}return e}parseUnary(){if(this.match("OPERATOR","++","--")){let e=this.previous().value,t=this.parseUnary();return{type:"UpdateExpression",operator:e,argument:t,prefix:!0}}if(this.match("OPERATOR","!","-","+")){let e=this.previous().value,t=this.parseUnary();return{type:"UnaryExpression",operator:e,argument:t,prefix:!0}}return this.parsePostfix()}parsePostfix(){let e=this.parseMember();if(this.match("OPERATOR","++","--"))return{type:"UpdateExpression",operator:this.previous().value,argument:e,prefix:!1};return e}parseMember(){let e=this.parsePrimary();while(!0)if(this.match("PUNCTUATION",".")){let t=this.consumeIdentifierName();e={type:"MemberExpression",object:e,property:{type:"Identifier",name:t},computed:!1}}else if(this.match("PUNCTUATION","[")){let t=this.parseExpression();this.consume("PUNCTUATION","]"),e={type:"MemberExpression",object:e,property:t,computed:!0}}else if(this.match("PUNCTUATION","(")){let t=this.parseArguments();e={type:"CallExpression",callee:e,arguments:t}}else break;return e}parseArguments(){let e=[];if(!this.check("PUNCTUATION",")"))do e.push(this.parseExpression());while(this.match("PUNCTUATION",","));return this.consume("PUNCTUATION",")"),e}parsePrimary(){if(this.match("NUMBER"))return{type:"Literal",value:this.previous().value};if(this.match("STRING"))return{type:"Literal",value:this.previous().value};if(this.match("BOOLEAN"))return{type:"Literal",value:this.previous().value};if(this.match("NULL"))return{type:"Literal",value:null};if(this.match("UNDEFINED"))return{type:"Literal",value:void 0};if(this.match("IDENTIFIER"))return{type:"Identifier",name:this.previous().value};if(this.match("PUNCTUATION","(")){let e=this.parseExpression();return this.consume("PUNCTUATION",")"),e}if(this.match("PUNCTUATION","["))return this.parseArrayLiteral();if(this.match("PUNCTUATION","{"))return this.parseObjectLiteral();throw Error(`Unexpected token: ${this.current().type} "${this.current().value}"`)}parseArrayLiteral(){let e=[];while(!this.check("PUNCTUATION","]")&&!this.isAtEnd())if(e.push(this.parseExpression()),this.match("PUNCTUATION",",")){if(this.check("PUNCTUATION","]"))break}else break;return this.consume("PUNCTUATION","]"),{type:"ArrayExpression",elements:e}}parseObjectLiteral(){let e=[];while(!this.check("PUNCTUATION","}")&&!this.isAtEnd()){let t,r=!1;if(this.match("STRING"))t={type:"Literal",value:this.previous().value};else if(this.checkIdentifierName())t={type:"Identifier",name:this.consumeIdentifierName()};else if(this.match("PUNCTUATION","["))t=this.parseExpression(),r=!0,this.consume("PUNCTUATION","]");else throw Error("Expected property key");this.consume("PUNCTUATION",":");let n=this.parseExpression();if(e.push({type:"Property",key:t,value:n,computed:r,shorthand:!1}),this.match("PUNCTUATION",",")){if(this.check("PUNCTUATION","}"))break}else break}return this.consume("PUNCTUATION","}"),{type:"ObjectExpression",properties:e}}match(...e){for(let t=0;t<e.length;t++){let r=e[t];if(t===0&&e.length>1){let n=r;for(let i=1;i<e.length;i++)if(this.check(n,e[i]))return this.advance(),!0;return!1}else if(e.length===1){if(this.checkType(r))return this.advance(),!0;return!1}}return!1}check(e,t){if(this.isAtEnd())return!1;if(t!==void 0)return this.current().type===e&&this.current().value===t;return this.current().type===e}checkType(e){if(this.isAtEnd())return!1;return this.current().type===e}advance(){if(!this.isAtEnd())this.position++;return this.previous()}isAtEnd(){return this.current().type==="EOF"}current(){return this.tokens[this.position]}previous(){return this.tokens[this.position-1]}consume(e,t){if(t!==void 0){if(this.check(e,t))return this.advance();throw Error(`Expected ${e} "${t}" but got ${this.current().type} "${this.current().value}"`)}if(this.check(e))return this.advance();throw Error(`Expected ${e} but got ${this.current().type} "${this.current().value}"`)}checkIdentifierName(){if(this.isAtEnd())return!1;return Ws.includes(this.current().type)}consumeIdentifierName(){if(!this.checkIdentifierName())throw Error(`Expected an identifier name but got ${this.current().type} "${this.current().value}"`);let e=this.advance();switch(e.type){case"BOOLEAN":return e.value?"true":"false";case"NULL":return"null";case"UNDEFINED":return"undefined";default:return e.value}}},Gs=class{evaluate({node:e,scope:t={},context:r=null,forceBindingRootScopeToFunctions:n=!0}){switch(e.type){case"Literal":return e.value;case"Identifier":if(e.name in t){let b=t[e.name];if(this.checkForDangerousValues(b),typeof b==="function")return b.bind(t);return b}throw Error(`Undefined variable: ${e.name}`);case"MemberExpression":let i=this.evaluate({node:e.object,scope:t,context:r,forceBindingRootScopeToFunctions:n});if(i==null)throw Error("Cannot read property of null or undefined");let o;if(e.computed)o=this.evaluate({node:e.property,scope:t,context:r,forceBindingRootScopeToFunctions:n});else o=e.property.name;this.checkForDangerousKeywords(o);let s=i[o];if(this.checkForDangerousValues(s),typeof s==="function")if(n)return s.bind(t);else return s.bind(i);return s;case"CallExpression":let a=e.arguments.map((b)=>this.evaluate({node:b,scope:t,context:r,forceBindingRootScopeToFunctions:n})),l;if(e.callee.type==="MemberExpression"){let b=this.evaluate({node:e.callee.object,scope:t,context:r,forceBindingRootScopeToFunctions:n}),h;if(e.callee.computed)h=this.evaluate({node:e.callee.property,scope:t,context:r,forceBindingRootScopeToFunctions:n});else h=e.callee.property.name;this.checkForDangerousKeywords(h);let x=b[h];if(typeof x!=="function")throw Error("Value is not a function");l=x.apply(b,a)}else if(e.callee.type==="Identifier"){let b=e.callee.name,h;if(b in t)h=t[b];else throw Error(`Undefined variable: ${b}`);if(typeof h!=="function")throw Error("Value is not a function");let x=r!==null?r:t;l=h.apply(x,a)}else{let b=this.evaluate({node:e.callee,scope:t,context:r,forceBindingRootScopeToFunctions:n});if(typeof b!=="function")throw Error("Value is not a function");l=b.apply(r,a)}return this.checkForDangerousValues(l),l;case"UnaryExpression":let c=this.evaluate({node:e.argument,scope:t,context:r,forceBindingRootScopeToFunctions:n});switch(e.operator){case"!":return!c;case"-":return-c;case"+":return+c;default:throw Error(`Unknown unary operator: ${e.operator}`)}case"UpdateExpression":if(e.argument.type==="Identifier"){let b=e.argument.name;if(!(b in t))throw Error(`Undefined variable: ${b}`);let h=t[b];if(e.operator==="++")t[b]=h+1;else if(e.operator==="--")t[b]=h-1;return e.prefix?t[b]:h}else if(e.argument.type==="MemberExpression"){let b=this.evaluate({node:e.argument.object,scope:t,context:r,forceBindingRootScopeToFunctions:n}),h=e.argument.computed?this.evaluate({node:e.argument.property,scope:t,context:r,forceBindingRootScopeToFunctions:n}):e.argument.property.name;if(this.isDOMObject(b))throw Error("Property assignments on DOM objects are prohibited in the CSP build");this.checkForDangerousKeywords(h);let x=b[h];if(e.operator==="++")b[h]=x+1;else if(e.operator==="--")b[h]=x-1;return e.prefix?b[h]:x}throw Error("Invalid update expression target");case"BinaryExpression":let d=this.evaluate({node:e.left,scope:t,context:r,forceBindingRootScopeToFunctions:n}),u=()=>this.evaluate({node:e.right,scope:t,context:r,forceBindingRootScopeToFunctions:n});if(e.operator==="&&")return d&&u();if(e.operator==="||")return d||u();let f=u();switch(e.operator){case"+":return d+f;case"-":return d-f;case"*":return d*f;case"/":return d/f;case"%":return d%f;case"==":return d==f;case"!=":return d!=f;case"===":return d===f;case"!==":return d!==f;case"<":return d<f;case">":return d>f;case"<=":return d<=f;case">=":return d>=f;default:throw Error(`Unknown binary operator: ${e.operator}`)}case"ConditionalExpression":return this.evaluate({node:e.test,scope:t,context:r,forceBindingRootScopeToFunctions:n})?this.evaluate({node:e.consequent,scope:t,context:r,forceBindingRootScopeToFunctions:n}):this.evaluate({node:e.alternate,scope:t,context:r,forceBindingRootScopeToFunctions:n});case"AssignmentExpression":let g=this.evaluate({node:e.right,scope:t,context:r,forceBindingRootScopeToFunctions:n});if(e.left.type==="Identifier")return t[e.left.name]=g,g;else if(e.left.type==="MemberExpression"){let b=this.evaluate({node:e.left.object,scope:t,context:r,forceBindingRootScopeToFunctions:n}),h=e.left.computed?this.evaluate({node:e.left.property,scope:t,context:r,forceBindingRootScopeToFunctions:n}):e.left.property.name;if(this.isDOMObject(b))throw Error("Property assignments on DOM objects are prohibited in the CSP build");return this.checkForDangerousKeywords(h),b[h]=g,g}throw Error("Invalid assignment target");case"ArrayExpression":return e.elements.map((b)=>this.evaluate({node:b,scope:t,context:r,forceBindingRootScopeToFunctions:n}));case"ObjectExpression":let p={};for(let b of e.properties){let h=b.computed?this.evaluate({node:b.key,scope:t,context:r,forceBindingRootScopeToFunctions:n}):b.key.type==="Identifier"?b.key.name:this.evaluate({node:b.key,scope:t,context:r,forceBindingRootScopeToFunctions:n}),x=this.evaluate({node:b.value,scope:t,context:r,forceBindingRootScopeToFunctions:n});p[h]=x}return p;default:throw Error(`Unknown node type: ${e.type}`)}}isDOMObject(e){if(e instanceof Node)return!0;if(typeof CSSStyleDeclaration<"u"&&e instanceof CSSStyleDeclaration)return!0;if(typeof DOMStringMap<"u"&&e instanceof DOMStringMap)return!0;if(typeof DOMTokenList<"u"&&e instanceof DOMTokenList)return!0;if(typeof NamedNodeMap<"u"&&e instanceof NamedNodeMap)return!0;let t=e!=null&&e.constructor;if(t&&typeof t.name==="string"&&/^(SVG|CSS|DOM)[A-Z]/.test(t.name))return!0;return!1}checkForDangerousKeywords(e){if(["constructor","prototype","__proto__","__defineGetter__","__defineSetter__","insertAdjacentHTML","insertAdjacentElement","insertAdjacentText","setAttribute","setAttributeNS","setAttributeNode","setAttributeNodeNS","createElement","createElementNS","createDocumentFragment","createContextualFragment","appendChild","insertBefore","replaceChild"].includes(e))throw Error(`Accessing "${e}" is prohibited in the CSP build`)}checkForDangerousValues(e){if(e===null)return;if(typeof e!=="object"&&typeof e!=="function")return;if(xr.has(e))return;if(e instanceof HTMLIFrameElement||e instanceof HTMLScriptElement||typeof SVGScriptElement<"u"&&e instanceof SVGScriptElement)throw Error("Accessing iframes and scripts is prohibited in the CSP build");if(typeof Document<"u"&&e instanceof Document)throw Error("Accessing document objects is prohibited in the CSP build");if(vn.has(e))throw Error("Accessing global variables is prohibited in the CSP build");return xr.set(e,!0),!0}},Oa,Ma,we,eo,Mt=(e,t)=>eo.call(e,t),_e,ge=(e)=>kn(e)==="[object Map]",to=(e)=>typeof e==="string",Te=(e)=>typeof e==="symbol",Ee=(e)=>e!==null&&typeof e==="object",ro,kn=(e)=>ro.call(e),An=(e)=>kn(e).slice(8,-1),Xt=(e)=>to(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Qe=(e)=>{let t=Object.create(null);return(r)=>t[r]||(t[r]=e(r))},no,Ia,io,La,Sn,Da,K=(e,t)=>!Object.is(e,t),so="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",Na,dt,y,ut,yr=class{constructor(e){if(this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,dt)if(dt.active)dt.effects.push(this);else this.flags&=-2}pause(){this.flags|=64}resume(){if(this.flags&64){if(this.flags&=-65,ut.has(this))ut.delete(this),this.trigger()}}notify(){if(this.flags&2&&!(this.flags&32))return;if(!(this.flags&8))oo(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,vr(this),Tn(this);let e=y,t=O;y=this,O=!0;try{return this.fn()}finally{if(y!==this)Z("Active effect was not restored correctly - this is likely a Vue internal bug.");On(this),y=e,O=t,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)er(e);this.deps=this.depsTail=void 0,vr(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){if(this.flags&64)ut.add(this);else if(this.scheduler)this.scheduler();else this.runIfDirty()}runIfDirty(){if(It(this))this.run()}get dirty(){return It(this)}},Cn=0,xe,ye,O=!0,Mn,Fe=0,po=class{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}},bo=class{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0,this.subsHead=void 0}track(e){if(!y||!O||y===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==y){if(t=this.activeLink=new po(y,this),!y.deps)y.deps=y.depsTail=t;else t.prevDep=y.depsTail,y.depsTail.nextDep=t,y.depsTail=t;In(t)}else if(t.version===-1){if(t.version=this.version,t.nextDep){let r=t.nextDep;if(r.prevDep=t.prevDep,t.prevDep)t.prevDep.nextDep=r;if(t.prevDep=y.depsTail,t.nextDep=void 0,y.depsTail.nextDep=t,y.depsTail=t,y.deps===t)y.deps=r}}if(y.onTrack)y.onTrack(we({effect:y},e));return t}trigger(e){this.version++,Fe++,this.notify(e)}notify(e){Zt();try{for(let t=this.subsHead;t;t=t.nextSub)if(t.sub.onTrigger&&!(t.sub.flags&8))t.sub.onTrigger(we({effect:t.sub},e));for(let t=this.subs;t;t=t.prevSub)if(t.sub.notify())t.sub.dep.notify()}finally{Qt()}}},Lt,J,Dt,ke,mo,go,xo,Ln,Dn=class{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,r){if(t==="__v_skip")return e.__v_skip;let n=this._isReadonly,i=this._isShallow;if(t==="__v_isReactive")return!n;else if(t==="__v_isReadonly")return n;else if(t==="__v_isShallow")return i;else if(t==="__v_raw"){if(r===(n?i?Oo:Pn:i?To:Bn).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(r))return e;return}let o=_e(e);if(!n){let a;if(o&&(a=mo[t]))return a;if(t==="hasOwnProperty")return yo}let s=Reflect.get(e,t,ve(e)?e:r);if(Te(t)?Ln.has(t):xo(t))return s;if(!n)S(e,"get",t);if(i)return s;if(ve(s)){let a=o&&Xt(t)?s:s.value;return n&&Ee(a)?Bt(a):a}if(Ee(s))return n?Bt(s):rr(s);return s}},vo,wo,_o,Eo,Nt=(e)=>e,Be=(e)=>Reflect.getPrototypeOf(e),So,Co,Bn,To,Pn,Oo,te=(e)=>Ee(e)?rr(e):e,Ae=(e)=>Ee(e)?Bt(e):e,pt,Po,Un=()=>{},Uo,Fn=(e,{value:t,modifiers:r,expression:n,original:i},{effect:o,cleanup:s})=>{if(!t){let l={};qs(l),A(e,n)((d)=>{xn(e,d,i)},{scope:l});return}if(t==="key")return Ko(e,n);if(e._x_inlineBindings&&e._x_inlineBindings[t]&&e._x_inlineBindings[t].extract)return;let a=A(e,n);o(()=>a((l)=>{if(l===void 0&&typeof n==="string"&&n.match(/\./))l="";_(()=>un(e,t,l,r))})),s(()=>{e._x_undoAddedClasses&&e._x_undoAddedClasses(),e._x_undoAddedStyles&&e._x_undoAddedStyles()})},q,Vn,ea;var Yn=wi(()=>{P=[];Or=[],Mr=[],Ir=[];Ve=new MutationObserver(We);F=[];He=[];Ui={ownKeys({objects:e}){return Array.from(new Set(e.flatMap((t)=>Object.keys(t))))},has({objects:e},t){if(t==Symbol.unscopables)return!1;return e.some((r)=>Object.prototype.hasOwnProperty.call(r,t)||Reflect.has(r,t))},get({objects:e},t,r){if(t=="toJSON")return ji;return Reflect.get(e.find((n)=>Reflect.has(n,t))||{},t,r)},set({objects:e},t,r,n){let i;for(let s of e)if(i=$r(s,t),i)break;if(!i)i=e[e.length-1];let o=Object.getOwnPropertyDescriptor(i,t);if(o?.set&&o?.get)return o.set.call(n,r)||!0;return Reflect.set(i,t,r)}};zr={};Hr=Wi;je={};be=new Map,Kr=Symbol();Gr=[];V=["ignore","ref","id","data","anchor","bind","init","for","model","modelable","transition","show","if",Et,"teleport"];Qr=[];Ce((e,t)=>{if(Ge===0)return;if(!e||e.nodeType!==1||!t||t.nodeType!==1)return;if(T(e,(r)=>r._x_deferInit))t._x_ignore=!0});Kt=[],rn=[];ln=[];At=[];E("transition",(e,{value:t,modifiers:r,expression:n},{evaluate:i})=>{if(typeof n==="function")n=i(n);if(n===!1)return;if(!n||typeof n==="boolean")Es(e,r,t);else _s(e,n,t)});window.Element.prototype._x_toggleAndCascadeWithTransitions=function(e,t,r,n){let i=document.visibilityState==="visible"?requestAnimationFrame:setTimeout,o=()=>i(r);if(t){if(e._x_transition&&(e._x_transition.enter||e._x_transition.leave))e._x_transition.enter&&(Object.entries(e._x_transition.enter.during).length||Object.entries(e._x_transition.enter.start).length||Object.entries(e._x_transition.enter.end).length)?e._x_transition.in(r):o();else e._x_transition?e._x_transition.in(r):o();return}e._x_hidePromise=e._x_transition?new Promise((s,a)=>{e._x_transition.out(()=>{},()=>s(n)),e._x_transitioning&&e._x_transitioning.beforeCancel(()=>a({isFromCancelledTransition:!0}))}):Promise.resolve(n),queueMicrotask(()=>{let s=dn(e);if(s){if(!s._x_hideChildren)s._x_hideChildren=[];s._x_hideChildren.push(e)}else i(()=>{let a=(l)=>{let c=Promise.all([l._x_hidePromise,...(l._x_hideChildren||[]).map(a)]).then(([d])=>d?.());return delete l._x_hidePromise,delete l._x_hideChildren,c};a(e).catch((l)=>{if(!l.isFromCancelledTransition)throw l})})})};Ns=new Set(["allowfullscreen","async","autofocus","autoplay","checked","controls","default","defer","disabled","formnovalidate","inert","ismap","itemscope","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected","shadowrootclonable","shadowrootdelegatesfocus","shadowrootserializable"]);B={};gn={};yn={};Vs={get reactive(){return le},get release(){return ce},get effect(){return re},get raw(){return Cr},get transaction(){return Ni},version:"3.17.4",flushAndStopDeferringMutations:Hi,dontAutoEvaluateFunctions:Ur,disableEffectScheduling:Ii,startObservingMutations:Ht,stopObservingMutations:Br,setReactivityEngine:Li,onAttributeRemoved:Dr,onAttributesAdded:Lr,closestDataStack:ae,skipDuringClone:R,onlyDuringClone:is,addRootSelector:on,addInitSelector:an,setErrorHandler:Vi,interceptClone:Ce,addScopeToNode:Se,deferMutations:zi,mapAttributes:Ft,evaluateLater:A,interceptInit:ps,initInterceptors:jt,injectMagics:Ue,setEvaluator:Yi,setRawEvaluator:Ji,mergeProxies:G,extractProp:Rs,findClosest:T,onElRemoved:Rt,closestRoot:Xe,destroyTree:ne,interceptor:Rr,transition:Ot,setStyles:Ze,mutateDom:_,deferInit:ls,directive:E,entangle:mn,throttle:bn,debounce:pn,evaluate:Y,evaluateRaw:Xi,initTree:D,nextTick:Wt,prefixed:de,prefix:Zi,plugin:zs,magic:M,store:Hs,start:fs,clone:os,cloneNode:ss,bound:$s,$data:Pr,watch:Tr,walk:X,data:Fs,bind:js},ue=Vs,xr=new WeakMap,vn=new Set;Object.getOwnPropertyNames(globalThis).forEach((e)=>{if(e==="styleMedia"||e==="sharedStorage")return;let t;try{t=globalThis[e]}catch{return}vn.add(t)});Ws=["IDENTIFIER","KEYWORD","BOOLEAN","NULL","UNDEFINED"];Oa=Object.freeze({}),Ma=Object.freeze([]),we=Object.assign,eo=Object.prototype.hasOwnProperty,_e=Array.isArray,ro=Object.prototype.toString,no=/-\w/g,Ia=Qe((e)=>e.replace(no,(t)=>t.slice(1).toUpperCase())),io=/\B([A-Z])/g,La=Qe((e)=>e.replace(io,"-$1").toLowerCase()),Sn=Qe((e)=>e.charAt(0).toUpperCase()+e.slice(1)),Da=Qe((e)=>e?`on${Sn(e)}`:""),Na=En(so+",async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");ut=new WeakSet;Mn=[];Lt=new WeakMap,J=Symbol("Object iterate"),Dt=Symbol("Map keys iterate"),ke=Symbol("Array iterate");mo={__proto__:null,[Symbol.iterator](){return ft(this,Symbol.iterator,(e)=>I(this,e))},concat(...e){return se(this).concat(...e.map((t)=>_e(t)?se(t):t))},entries(){return ft(this,"entries",(e)=>(e[1]=I(this,e[1]),e))},every(e,t){return N(this,"every",e,t,void 0,arguments)},filter(e,t){return N(this,"filter",e,t,(r)=>r.map((n)=>I(this,n)),arguments)},find(e,t){return N(this,"find",e,t,(r)=>I(this,r),arguments)},findIndex(e,t){return N(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return N(this,"findLast",e,t,(r)=>I(this,r),arguments)},findLastIndex(e,t){return N(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return N(this,"forEach",e,t,void 0,arguments)},includes(...e){return ht(this,"includes",e)},indexOf(...e){return ht(this,"indexOf",e)},join(e){return se(this).join(e)},lastIndexOf(...e){return ht(this,"lastIndexOf",e)},map(e,t){return N(this,"map",e,t,void 0,arguments)},pop(){return pe(this,"pop")},push(...e){return pe(this,"push",e)},reduce(e,...t){return wr(this,"reduce",e,t)},reduceRight(e,...t){return wr(this,"reduceRight",e,t)},shift(){return pe(this,"shift")},some(e,t){return N(this,"some",e,t,void 0,arguments)},splice(...e){return pe(this,"splice",e)},toReversed(){return se(this).toReversed()},toSorted(e){return se(this).toSorted(e)},toSpliced(...e){return se(this).toSpliced(...e)},unshift(...e){return pe(this,"unshift",e)},values(){return ft(this,"values",(e)=>I(this,e))}};go=Array.prototype;xo=En("__proto__,__v_isRef,__isVue"),Ln=new Set(Object.getOwnPropertyNames(Symbol).filter((e)=>e!=="arguments"&&e!=="caller").map((e)=>Symbol[e]).filter(Te));vo=class extends Dn{constructor(e=!1){super(!1,e)}set(e,t,r,n){let i=e[t],o=_e(e)&&Xt(t);if(!this._isShallow){let l=Q(i);if(!ee(r)&&!Q(r))i=v(i),r=v(r);if(!o&&ve(i)&&!ve(r))if(l)return Z(`Set operation on key "${String(t)}" failed: target is readonly.`,e[t]),!0;else return i.value=r,!0}let s=o?Number(t)<e.length:Mt(e,t),a=Reflect.set(e,t,r,ve(e)?e:n);if(e===v(n)&&a){if(!s)U(e,"add",t,r);else if(K(r,i))U(e,"set",t,r,i)}return a}deleteProperty(e,t){let r=Mt(e,t),n=e[t],i=Reflect.deleteProperty(e,t);if(i&&r)U(e,"delete",t,void 0,n);return i}has(e,t){let r=Reflect.has(e,t);if(!Te(t)||!Ln.has(t))S(e,"has",t);return r}ownKeys(e){return S(e,"iterate",_e(e)?"length":J),Reflect.ownKeys(e)}},wo=class extends Dn{constructor(e=!1){super(!0,e)}set(e,t){return Z(`Set operation on key "${String(t)}" failed: target is readonly.`,e),!0}deleteProperty(e,t){return Z(`Delete operation on key "${String(t)}" failed: target is readonly.`,e),!0}},_o=new vo,Eo=new wo;So={get:Nn(!1,!1)},Co={get:Nn(!0,!1)};Bn=new WeakMap,To=new WeakMap,Pn=new WeakMap,Oo=new WeakMap;M("nextTick",()=>Wt);M("dispatch",(e)=>me.bind(me,e));M("watch",(e,{evaluateLater:t,cleanup:r})=>(n,i)=>{let o=t(n),a=Tr(()=>{let l;return o((c)=>l=c),l},i);r(a)});M("store",Us);M("data",(e)=>Pr(e));M("root",(e)=>Xe(e));M("refs",(e)=>{if(e._x_refs_proxy)return e._x_refs_proxy;return e._x_refs_proxy=G(Lo(e)),e._x_refs_proxy});pt={};M("id",(e,{cleanup:t})=>(r,n=null)=>{let i=`${r}${n?`-${n}`:""}`;return Bo(e,i,t,()=>{let o=Do(e,r),s=o?o._x_ids[r]:zn(r);return n?`${r}-${s}-${n}`:`${r}-${s}`})});Ce((e,t)=>{if(e._x_id)t._x_id=e._x_id});M("el",(e)=>e);Hn("Focus","focus","focus");Hn("Persist","persist","persist");E("modelable",(e,{expression:t},{effect:r,evaluateLater:n,cleanup:i})=>{let o=n(t),s=()=>{let d;return o((u)=>d=u),d},a=n(`${t} = __placeholder`),l=(d)=>a(()=>{},{scope:{__placeholder:d}}),c=s();l(c),queueMicrotask(()=>{if(!e._x_model)return;e._x_removeModelListeners.default();let d=e._x_model.get,u=e._x_model.setWithModifiers,f=mn({get(){return d()},set(m){u(m)}},{get(){return s()},set(m){l(m)}});i(f)})});E("teleport",(e,{modifiers:t,expression:r},{cleanup:n})=>{if(e.tagName.toLowerCase()!=="template")L("x-teleport can only be used on a <template> tag",e);let i=Er(r),o=e.content.cloneNode(!0).firstElementChild;if(e._x_teleport=o,o._x_teleportBack=e,e.setAttribute("data-teleport-template",!0),o.setAttribute("data-teleport-target",!0),e._x_forwardEvents)e._x_forwardEvents.forEach((a)=>{o.addEventListener(a,(l)=>{l.stopPropagation(),e.dispatchEvent(new l.constructor(l.type,l))})});Se(o,{},e);let s=(a,l,c)=>{if(c.includes("prepend"))l.parentNode.insertBefore(a,l);else if(c.includes("append"))l.parentNode.insertBefore(a,l.nextSibling);else l.appendChild(a)};_(()=>{R(()=>{s(o,i,t),D(o)})()}),e._x_teleportPutBack=()=>{let a=Er(r);_(()=>{s(e._x_teleport,a,t)})},n(()=>_(()=>{o.remove(),ne(o)}))});Po=document.createElement("div");Un.inline=(e,{modifiers:t},{cleanup:r})=>{t.includes("self")?e._x_ignoreSelf=!0:e._x_ignore=!0,r(()=>{t.includes("self")?delete e._x_ignoreSelf:delete e._x_ignore})};E("ignore",Un);E("effect",R((e,{expression:t},{effect:r})=>{r(A(e,t))}));Uo=["window","document","prevent","stop","once","capture","self","away","outside","passive","dot","camel","preserve-scroll","blur","change","lazy","number","boolean","trim","fill","unintrusive","parent"];E("model",(e,{modifiers:t,expression:r},{effect:n,cleanup:i})=>{let o=e;if(t.includes("parent"))o=T(e,(p)=>p!==e);let s=A(o,r),a;if(typeof r==="string")a=A(o,`${r} = __placeholder`);else if(typeof r==="function"&&typeof r()==="string")a=A(o,`${r()} = __placeholder`);else a=()=>{};let l=()=>{let p;return s((b)=>p=b),Ar(p)?p.get():p},c=(p)=>{let b;if(s((h)=>b=h),Ar(b))b.set(p);else a(()=>{},{scope:{__placeholder:p}})};if(typeof r==="string"&&e.type==="radio")_(()=>{if(!e.hasAttribute("name"))e.setAttribute("name",r)});let d=t.includes("change")||t.includes("lazy"),u=t.includes("blur"),f=t.includes("enter"),m=d||u||f,g;if(j)g=()=>{};else if(m){let p=[],b=(h)=>c($e(e,t,h,l()));if(d)p.push(oe(e,"change",t,b));if(u){if(p.push(oe(e,"blur",t,b)),e.form){let h=e.form,x=()=>b({target:e});if(!h._x_pendingModelUpdates)h._x_pendingModelUpdates=[];h._x_pendingModelUpdates.push(x),i(()=>{if(h._x_pendingModelUpdates)h._x_pendingModelUpdates.splice(h._x_pendingModelUpdates.indexOf(x),1)})}}if(f)p.push(oe(e,"keydown",t,(h)=>{if(h.key==="Enter")b(h)}));g=()=>p.forEach((h)=>h())}else{let p=e.tagName.toLowerCase()==="select"||["checkbox","radio"].includes(e.type)?"change":"input";g=oe(e,p,t,(b)=>{c($e(e,t,b,l()))})}if(t.includes("fill")){if([void 0,null,""].includes(l())||qe(e)&&Array.isArray(l())||e.tagName.toLowerCase()==="select"&&e.multiple)c($e(e,t,{target:e},l()))}if(!e._x_removeModelListeners)e._x_removeModelListeners={};if(e._x_removeModelListeners.default=g,i(()=>e._x_removeModelListeners.default()),e.form){let p=oe(e.form,"reset",[],(b)=>{Wt(()=>e._x_model&&e._x_model.set($e(e,t,{target:e},l())))});i(()=>p())}if(e._x_model={get(){return l()},set(p){c(p)},setWithModifiers:jn(t,c)},e._x_forceModelUpdate=(p)=>{if(p===void 0&&typeof r==="string"&&r.match(/\./))p="";_(()=>{if(qe(e))if(Array.isArray(p))e.checked=p.some((b)=>b==e.value);else e.checked=!!p;else if(Gt(e))if(typeof p==="boolean")e.checked=Re(e.value)===p;else e.checked=e.value==p;else un(e,"value",p)})},e.tagName==="SELECT"){let p=new MutationObserver(()=>{e._x_forceModelUpdate(l())});p.observe(e,{childList:!0}),i(()=>p.disconnect())}n(()=>{let p=l();if(t.includes("unintrusive")&&document.activeElement.isSameNode(e))return;e._x_forceModelUpdate(p)})});E("cloak",(e)=>queueMicrotask(()=>_(()=>e.removeAttribute(de("cloak")))));an(()=>`[${de("init")}]`);E("init",R((e,{expression:t},{evaluate:r})=>{if(typeof t==="string")return!!t.trim()&&r(t,{},!1);return r(t,{},!1)}));E("text",(e,{expression:t},{effect:r,evaluateLater:n})=>{let i=n(t);r(()=>{i((o)=>{_(()=>{e.textContent=o})})})});E("html",(e,{expression:t},{effect:r,evaluateLater:n})=>{let i=n(t);r(()=>{i((o)=>{_(()=>{Array.from(e.children).forEach((s)=>ne(s)),e.innerHTML=o??"",e._x_ignoreSelf=!0,D(e),delete e._x_ignoreSelf})})},{priority:"structural"})});Ft(Wr(":",Yr(de("bind:"))));Fn.inline=(e,{value:t,modifiers:r,expression:n})=>{if(!t)return;if(!e._x_inlineBindings)e._x_inlineBindings={};e._x_inlineBindings[t]={expression:n,extract:!1}};E("bind",Fn);on(()=>`[${de("data")}]`);q=Symbol();E("data",(e,{expression:t},{cleanup:r})=>{if(Wo(e))return;let n=e[q];if(n?.expression===t)return;t=t===""?"{}":t;let i={};Ue(i,e);let o={};Ks(o,i);let s=Y(e,t,{scope:o});if(s===void 0||s===!0)s={};Ue(s,e);let a;if(n?.reactiveData){a=n.reactiveData,Vo(a,s);let c={expression:t};e[q]=c,queueMicrotask(()=>{if(e[q]===c)delete e[q]})}else a=le(s);jt(a,r);let l=Se(e,a);R(()=>{a.init&&Y(e,a.init)})(),r(()=>{a.destroy&&Y(e,a.destroy),l();let c={reactiveData:a};e[q]=c,queueMicrotask(()=>{if(e[q]===c)delete e[q]})})});Ce((e,t)=>{if(e._x_dataStack)t._x_dataStack=e._x_dataStack,t.setAttribute("data-has-alpine-state",!0)});E("show",(e,{modifiers:t,expression:r},{effect:n})=>{let i=A(e,r);if(!e._x_doHide)e._x_doHide=()=>{_(()=>{e.style.setProperty("display","none",t.includes("important")?"important":void 0)})};if(!e._x_doShow)e._x_doShow=()=>{_(()=>{if(e.style.length===1&&e.style.display==="none")e.removeAttribute("style");else e.style.removeProperty("display")})};let o=()=>{e._x_doHide(),e._x_isShown=!1},s=()=>{e._x_doShow(),e._x_isShown=!0},a=()=>setTimeout(s),l=Tt((u)=>u?s():o(),(u)=>{if(typeof e._x_toggleAndCascadeWithTransitions==="function")e._x_toggleAndCascadeWithTransitions(e,u,s,o);else u?a():o()}),c,d=!0;n(()=>i((u)=>{if(!d&&u===c)return;if(t.includes("immediate"))u?a():o();l(u),c=u,d=!1}))});E("for",R((e,{expression:t},{effect:r,cleanup:n})=>{let i=Go(t),o=A(e,i.items),s=A(e,e._x_keyExpression||"index");e._x_lookup=new Map,r(()=>Jo(e,i,o,s),{priority:"structural"}),n(()=>{e._x_lookup.forEach((a)=>_(()=>{ne(a),a.remove()})),delete e._x_lookup,delete e._x_lastRenderedEl})}));Kn.inline=(e,{expression:t},{cleanup:r})=>{let n=Xe(e);if(!n)return;if(!n._x_refs)n._x_refs={};n._x_refs[t]=e,r(()=>delete n._x_refs[t])};E("ref",Kn);E("if",R((e,{expression:t},{effect:r,cleanup:n})=>{if(e.tagName.toLowerCase()!=="template")L("x-if can only be used on a <template> tag",e);let i=A(e,t),o=()=>{if(e._x_currentIfEl)return e._x_currentIfEl;let a=e.content.cloneNode(!0).firstElementChild;return Se(a,{},e),_(()=>{e.after(a),D(a)}),e._x_currentIfEl=a,e._x_lastRenderedEl=a,e._x_undoIf=()=>{_(()=>{ne(a),a.remove()}),delete e._x_currentIfEl,delete e._x_lastRenderedEl},a},s=()=>{if(!e._x_undoIf)return;e._x_undoIf(),delete e._x_undoIf};r(()=>i((a)=>{a?o():s()}),{priority:"structural"}),n(()=>e._x_undoIf&&e._x_undoIf())}));E("id",(e,{expression:t},{evaluate:r})=>{r(t).forEach((i)=>No(e,i))});Ce((e,t)=>{if(e._x_ids)t._x_ids=e._x_ids});Ft(Wr("@",Yr(de("on:"))));E("on",R((e,{value:t,modifiers:r,expression:n},{cleanup:i})=>{let o=n?A(e,n):()=>{};if(e.tagName.toLowerCase()==="template"){if(!e._x_forwardEvents)e._x_forwardEvents=[];if(!e._x_forwardEvents.includes(t))e._x_forwardEvents.push(t)}let s=oe(e,t,r,(a)=>{o(()=>{},{scope:{$event:a},params:[a]})});i(()=>s())}));et("Collapse","collapse","collapse");et("Intersect","intersect","intersect");et("Focus","trap","focus");et("Mask","mask","mask");E("html",(e,{expression:t})=>{Ye(Error("Using the x-html directive is prohibited in the CSP build"),e)});ue.setEvaluator(Zs);ue.setRawEvaluator(Xs);ue.setReactivityEngine({reactive:rr,effect:(e,t={})=>{let r;return r=co(e,{scheduler:()=>{if(!r)return;t.scheduler?t.scheduler(r):r()}}),r},release:uo,raw:v});Vn=ue,ea=Vn;/*! Bundled license information:
|
|
7
|
+
`;break;case"t":r+="\t";break;case"r":r+="\r";break;case"\\":r+="\\";break;case t:r+=t;break;case"u":{let o=this.input.slice(this.position+1,this.position+5);if(/^[0-9a-fA-F]{4}$/.test(o))r+=String.fromCharCode(parseInt(o,16)),this.position+=4;else r+=i;break}default:r+=i}n=!1}else if(i==="\\")n=!0;else if(i===t){this.position++,this.tokens.push(new k("STRING",r,e,this.position));return}else r+=i;this.position++}throw Error(`Unterminated string starting at position ${e}`)}readOperatorOrPunctuation(){let e=this.position,t=this.input[this.position],r=this.peek(),n=this.peek(2);if(t==="="&&r==="="&&n==="=")this.position+=3,this.tokens.push(new k("OPERATOR","===",e,this.position));else if(t==="!"&&r==="="&&n==="=")this.position+=3,this.tokens.push(new k("OPERATOR","!==",e,this.position));else if(t==="="&&r==="=")this.position+=2,this.tokens.push(new k("OPERATOR","==",e,this.position));else if(t==="!"&&r==="=")this.position+=2,this.tokens.push(new k("OPERATOR","!=",e,this.position));else if(t==="<"&&r==="=")this.position+=2,this.tokens.push(new k("OPERATOR","<=",e,this.position));else if(t===">"&&r==="=")this.position+=2,this.tokens.push(new k("OPERATOR",">=",e,this.position));else if(t==="&"&&r==="&")this.position+=2,this.tokens.push(new k("OPERATOR","&&",e,this.position));else if(t==="|"&&r==="|")this.position+=2,this.tokens.push(new k("OPERATOR","||",e,this.position));else if(t==="+"&&r==="+")this.position+=2,this.tokens.push(new k("OPERATOR","++",e,this.position));else if(t==="-"&&r==="-")this.position+=2,this.tokens.push(new k("OPERATOR","--",e,this.position));else{this.position++;let i="()[]{},.;:?".includes(t)?"PUNCTUATION":"OPERATOR";this.tokens.push(new k(i,t,e,this.position))}}},Js=class{constructor(e){this.tokens=e,this.position=0}parse(){if(this.isAtEnd())throw Error("Empty expression");let e=this.parseExpression();if(this.match("PUNCTUATION",";"),!this.isAtEnd())throw Error(`Unexpected token: ${this.current().value}`);return e}parseExpression(){return this.parseAssignment()}parseAssignment(){let e=this.parseTernary();if(this.match("OPERATOR","=")){let t=this.parseAssignment();if(e.type==="Identifier"||e.type==="MemberExpression")return{type:"AssignmentExpression",left:e,operator:"=",right:t};throw Error("Invalid assignment target")}return e}parseTernary(){let e=this.parseLogicalOr();if(this.match("PUNCTUATION","?")){let t=this.parseExpression();this.consume("PUNCTUATION",":");let r=this.parseExpression();return{type:"ConditionalExpression",test:e,consequent:t,alternate:r}}return e}parseLogicalOr(){let e=this.parseLogicalAnd();while(this.match("OPERATOR","||")){let t=this.previous().value,r=this.parseLogicalAnd();e={type:"BinaryExpression",operator:t,left:e,right:r}}return e}parseLogicalAnd(){let e=this.parseEquality();while(this.match("OPERATOR","&&")){let t=this.previous().value,r=this.parseEquality();e={type:"BinaryExpression",operator:t,left:e,right:r}}return e}parseEquality(){let e=this.parseRelational();while(this.match("OPERATOR","==","!=","===","!==")){let t=this.previous().value,r=this.parseRelational();e={type:"BinaryExpression",operator:t,left:e,right:r}}return e}parseRelational(){let e=this.parseAdditive();while(this.match("OPERATOR","<",">","<=",">=")){let t=this.previous().value,r=this.parseAdditive();e={type:"BinaryExpression",operator:t,left:e,right:r}}return e}parseAdditive(){let e=this.parseMultiplicative();while(this.match("OPERATOR","+","-")){let t=this.previous().value,r=this.parseMultiplicative();e={type:"BinaryExpression",operator:t,left:e,right:r}}return e}parseMultiplicative(){let e=this.parseUnary();while(this.match("OPERATOR","*","/","%")){let t=this.previous().value,r=this.parseUnary();e={type:"BinaryExpression",operator:t,left:e,right:r}}return e}parseUnary(){if(this.match("OPERATOR","++","--")){let e=this.previous().value,t=this.parseUnary();return{type:"UpdateExpression",operator:e,argument:t,prefix:!0}}if(this.match("OPERATOR","!","-","+")){let e=this.previous().value,t=this.parseUnary();return{type:"UnaryExpression",operator:e,argument:t,prefix:!0}}return this.parsePostfix()}parsePostfix(){let e=this.parseMember();if(this.match("OPERATOR","++","--"))return{type:"UpdateExpression",operator:this.previous().value,argument:e,prefix:!1};return e}parseMember(){let e=this.parsePrimary();while(!0)if(this.match("PUNCTUATION",".")){let t=this.consumeIdentifierName();e={type:"MemberExpression",object:e,property:{type:"Identifier",name:t},computed:!1}}else if(this.match("PUNCTUATION","[")){let t=this.parseExpression();this.consume("PUNCTUATION","]"),e={type:"MemberExpression",object:e,property:t,computed:!0}}else if(this.match("PUNCTUATION","(")){let t=this.parseArguments();e={type:"CallExpression",callee:e,arguments:t}}else break;return e}parseArguments(){let e=[];if(!this.check("PUNCTUATION",")"))do e.push(this.parseExpression());while(this.match("PUNCTUATION",","));return this.consume("PUNCTUATION",")"),e}parsePrimary(){if(this.match("NUMBER"))return{type:"Literal",value:this.previous().value};if(this.match("STRING"))return{type:"Literal",value:this.previous().value};if(this.match("BOOLEAN"))return{type:"Literal",value:this.previous().value};if(this.match("NULL"))return{type:"Literal",value:null};if(this.match("UNDEFINED"))return{type:"Literal",value:void 0};if(this.match("IDENTIFIER"))return{type:"Identifier",name:this.previous().value};if(this.match("PUNCTUATION","(")){let e=this.parseExpression();return this.consume("PUNCTUATION",")"),e}if(this.match("PUNCTUATION","["))return this.parseArrayLiteral();if(this.match("PUNCTUATION","{"))return this.parseObjectLiteral();throw Error(`Unexpected token: ${this.current().type} "${this.current().value}"`)}parseArrayLiteral(){let e=[];while(!this.check("PUNCTUATION","]")&&!this.isAtEnd())if(e.push(this.parseExpression()),this.match("PUNCTUATION",",")){if(this.check("PUNCTUATION","]"))break}else break;return this.consume("PUNCTUATION","]"),{type:"ArrayExpression",elements:e}}parseObjectLiteral(){let e=[];while(!this.check("PUNCTUATION","}")&&!this.isAtEnd()){let t,r=!1;if(this.match("STRING"))t={type:"Literal",value:this.previous().value};else if(this.checkIdentifierName())t={type:"Identifier",name:this.consumeIdentifierName()};else if(this.match("PUNCTUATION","["))t=this.parseExpression(),r=!0,this.consume("PUNCTUATION","]");else throw Error("Expected property key");this.consume("PUNCTUATION",":");let n=this.parseExpression();if(e.push({type:"Property",key:t,value:n,computed:r,shorthand:!1}),this.match("PUNCTUATION",",")){if(this.check("PUNCTUATION","}"))break}else break}return this.consume("PUNCTUATION","}"),{type:"ObjectExpression",properties:e}}match(...e){for(let t=0;t<e.length;t++){let r=e[t];if(t===0&&e.length>1){let n=r;for(let i=1;i<e.length;i++)if(this.check(n,e[i]))return this.advance(),!0;return!1}else if(e.length===1){if(this.checkType(r))return this.advance(),!0;return!1}}return!1}check(e,t){if(this.isAtEnd())return!1;if(t!==void 0)return this.current().type===e&&this.current().value===t;return this.current().type===e}checkType(e){if(this.isAtEnd())return!1;return this.current().type===e}advance(){if(!this.isAtEnd())this.position++;return this.previous()}isAtEnd(){return this.current().type==="EOF"}current(){return this.tokens[this.position]}previous(){return this.tokens[this.position-1]}consume(e,t){if(t!==void 0){if(this.check(e,t))return this.advance();throw Error(`Expected ${e} "${t}" but got ${this.current().type} "${this.current().value}"`)}if(this.check(e))return this.advance();throw Error(`Expected ${e} but got ${this.current().type} "${this.current().value}"`)}checkIdentifierName(){if(this.isAtEnd())return!1;return Ws.includes(this.current().type)}consumeIdentifierName(){if(!this.checkIdentifierName())throw Error(`Expected an identifier name but got ${this.current().type} "${this.current().value}"`);let e=this.advance();switch(e.type){case"BOOLEAN":return e.value?"true":"false";case"NULL":return"null";case"UNDEFINED":return"undefined";default:return e.value}}},Gs=class{evaluate({node:e,scope:t={},context:r=null,forceBindingRootScopeToFunctions:n=!0}){switch(e.type){case"Literal":return e.value;case"Identifier":if(e.name in t){let g=t[e.name];if(this.checkForDangerousValues(g),typeof g==="function")return g.bind(t);return g}throw Error(`Undefined variable: ${e.name}`);case"MemberExpression":let i=this.evaluate({node:e.object,scope:t,context:r,forceBindingRootScopeToFunctions:n});if(i==null)throw Error("Cannot read property of null or undefined");let o;if(e.computed)o=this.evaluate({node:e.property,scope:t,context:r,forceBindingRootScopeToFunctions:n});else o=e.property.name;this.checkForDangerousKeywords(o);let s=i[o];if(this.checkForDangerousValues(s),typeof s==="function")if(n)return s.bind(t);else return s.bind(i);return s;case"CallExpression":let a=e.arguments.map((g)=>this.evaluate({node:g,scope:t,context:r,forceBindingRootScopeToFunctions:n})),l;if(e.callee.type==="MemberExpression"){let g=this.evaluate({node:e.callee.object,scope:t,context:r,forceBindingRootScopeToFunctions:n}),f;if(e.callee.computed)f=this.evaluate({node:e.callee.property,scope:t,context:r,forceBindingRootScopeToFunctions:n});else f=e.callee.property.name;this.checkForDangerousKeywords(f);let x=g[f];if(typeof x!=="function")throw Error("Value is not a function");l=x.apply(g,a)}else if(e.callee.type==="Identifier"){let g=e.callee.name,f;if(g in t)f=t[g];else throw Error(`Undefined variable: ${g}`);if(typeof f!=="function")throw Error("Value is not a function");let x=r!==null?r:t;l=f.apply(x,a)}else{let g=this.evaluate({node:e.callee,scope:t,context:r,forceBindingRootScopeToFunctions:n});if(typeof g!=="function")throw Error("Value is not a function");l=g.apply(r,a)}return this.checkForDangerousValues(l),l;case"UnaryExpression":let c=this.evaluate({node:e.argument,scope:t,context:r,forceBindingRootScopeToFunctions:n});switch(e.operator){case"!":return!c;case"-":return-c;case"+":return+c;default:throw Error(`Unknown unary operator: ${e.operator}`)}case"UpdateExpression":if(e.argument.type==="Identifier"){let g=e.argument.name;if(!(g in t))throw Error(`Undefined variable: ${g}`);let f=t[g];if(e.operator==="++")t[g]=f+1;else if(e.operator==="--")t[g]=f-1;return e.prefix?t[g]:f}else if(e.argument.type==="MemberExpression"){let g=this.evaluate({node:e.argument.object,scope:t,context:r,forceBindingRootScopeToFunctions:n}),f=e.argument.computed?this.evaluate({node:e.argument.property,scope:t,context:r,forceBindingRootScopeToFunctions:n}):e.argument.property.name;if(this.isDOMObject(g))throw Error("Property assignments on DOM objects are prohibited in the CSP build");this.checkForDangerousKeywords(f);let x=g[f];if(e.operator==="++")g[f]=x+1;else if(e.operator==="--")g[f]=x-1;return e.prefix?g[f]:x}throw Error("Invalid update expression target");case"BinaryExpression":let d=this.evaluate({node:e.left,scope:t,context:r,forceBindingRootScopeToFunctions:n}),u=()=>this.evaluate({node:e.right,scope:t,context:r,forceBindingRootScopeToFunctions:n});if(e.operator==="&&")return d&&u();if(e.operator==="||")return d||u();let p=u();switch(e.operator){case"+":return d+p;case"-":return d-p;case"*":return d*p;case"/":return d/p;case"%":return d%p;case"==":return d==p;case"!=":return d!=p;case"===":return d===p;case"!==":return d!==p;case"<":return d<p;case">":return d>p;case"<=":return d<=p;case">=":return d>=p;default:throw Error(`Unknown binary operator: ${e.operator}`)}case"ConditionalExpression":return this.evaluate({node:e.test,scope:t,context:r,forceBindingRootScopeToFunctions:n})?this.evaluate({node:e.consequent,scope:t,context:r,forceBindingRootScopeToFunctions:n}):this.evaluate({node:e.alternate,scope:t,context:r,forceBindingRootScopeToFunctions:n});case"AssignmentExpression":let m=this.evaluate({node:e.right,scope:t,context:r,forceBindingRootScopeToFunctions:n});if(e.left.type==="Identifier")return t[e.left.name]=m,m;else if(e.left.type==="MemberExpression"){let g=this.evaluate({node:e.left.object,scope:t,context:r,forceBindingRootScopeToFunctions:n}),f=e.left.computed?this.evaluate({node:e.left.property,scope:t,context:r,forceBindingRootScopeToFunctions:n}):e.left.property.name;if(this.isDOMObject(g))throw Error("Property assignments on DOM objects are prohibited in the CSP build");return this.checkForDangerousKeywords(f),g[f]=m,m}throw Error("Invalid assignment target");case"ArrayExpression":return e.elements.map((g)=>this.evaluate({node:g,scope:t,context:r,forceBindingRootScopeToFunctions:n}));case"ObjectExpression":let h={};for(let g of e.properties){let f=g.computed?this.evaluate({node:g.key,scope:t,context:r,forceBindingRootScopeToFunctions:n}):g.key.type==="Identifier"?g.key.name:this.evaluate({node:g.key,scope:t,context:r,forceBindingRootScopeToFunctions:n}),x=this.evaluate({node:g.value,scope:t,context:r,forceBindingRootScopeToFunctions:n});h[f]=x}return h;default:throw Error(`Unknown node type: ${e.type}`)}}isDOMObject(e){if(e instanceof Node)return!0;if(typeof CSSStyleDeclaration<"u"&&e instanceof CSSStyleDeclaration)return!0;if(typeof DOMStringMap<"u"&&e instanceof DOMStringMap)return!0;if(typeof DOMTokenList<"u"&&e instanceof DOMTokenList)return!0;if(typeof NamedNodeMap<"u"&&e instanceof NamedNodeMap)return!0;let t=e!=null&&e.constructor;if(t&&typeof t.name==="string"&&/^(SVG|CSS|DOM)[A-Z]/.test(t.name))return!0;return!1}checkForDangerousKeywords(e){if(["constructor","prototype","__proto__","__defineGetter__","__defineSetter__","insertAdjacentHTML","insertAdjacentElement","insertAdjacentText","setAttribute","setAttributeNS","setAttributeNode","setAttributeNodeNS","createElement","createElementNS","createDocumentFragment","createContextualFragment","appendChild","insertBefore","replaceChild"].includes(e))throw Error(`Accessing "${e}" is prohibited in the CSP build`)}checkForDangerousValues(e){if(e===null)return;if(typeof e!=="object"&&typeof e!=="function")return;if(xr.has(e))return;if(e instanceof HTMLIFrameElement||e instanceof HTMLScriptElement||typeof SVGScriptElement<"u"&&e instanceof SVGScriptElement)throw Error("Accessing iframes and scripts is prohibited in the CSP build");if(typeof Document<"u"&&e instanceof Document)throw Error("Accessing document objects is prohibited in the CSP build");if(vn.has(e))throw Error("Accessing global variables is prohibited in the CSP build");return xr.set(e,!0),!0}},Oa,Ma,we,eo,Mt=(e,t)=>eo.call(e,t),_e,ge=(e)=>kn(e)==="[object Map]",to=(e)=>typeof e==="string",Te=(e)=>typeof e==="symbol",Ee=(e)=>e!==null&&typeof e==="object",ro,kn=(e)=>ro.call(e),An=(e)=>kn(e).slice(8,-1),Xt=(e)=>to(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Qe=(e)=>{let t=Object.create(null);return(r)=>t[r]||(t[r]=e(r))},no,Ia,io,La,Sn,Da,K=(e,t)=>!Object.is(e,t),so="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",Na,dt,y,ut,yr=class{constructor(e){if(this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,dt)if(dt.active)dt.effects.push(this);else this.flags&=-2}pause(){this.flags|=64}resume(){if(this.flags&64){if(this.flags&=-65,ut.has(this))ut.delete(this),this.trigger()}}notify(){if(this.flags&2&&!(this.flags&32))return;if(!(this.flags&8))oo(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,vr(this),Tn(this);let e=y,t=O;y=this,O=!0;try{return this.fn()}finally{if(y!==this)Z("Active effect was not restored correctly - this is likely a Vue internal bug.");On(this),y=e,O=t,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)er(e);this.deps=this.depsTail=void 0,vr(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){if(this.flags&64)ut.add(this);else if(this.scheduler)this.scheduler();else this.runIfDirty()}runIfDirty(){if(It(this))this.run()}get dirty(){return It(this)}},Cn=0,xe,ye,O=!0,Mn,Fe=0,po=class{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}},bo=class{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0,this.subsHead=void 0}track(e){if(!y||!O||y===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==y){if(t=this.activeLink=new po(y,this),!y.deps)y.deps=y.depsTail=t;else t.prevDep=y.depsTail,y.depsTail.nextDep=t,y.depsTail=t;In(t)}else if(t.version===-1){if(t.version=this.version,t.nextDep){let r=t.nextDep;if(r.prevDep=t.prevDep,t.prevDep)t.prevDep.nextDep=r;if(t.prevDep=y.depsTail,t.nextDep=void 0,y.depsTail.nextDep=t,y.depsTail=t,y.deps===t)y.deps=r}}if(y.onTrack)y.onTrack(we({effect:y},e));return t}trigger(e){this.version++,Fe++,this.notify(e)}notify(e){Zt();try{for(let t=this.subsHead;t;t=t.nextSub)if(t.sub.onTrigger&&!(t.sub.flags&8))t.sub.onTrigger(we({effect:t.sub},e));for(let t=this.subs;t;t=t.prevSub)if(t.sub.notify())t.sub.dep.notify()}finally{Qt()}}},Lt,J,Dt,ke,mo,go,xo,Ln,Dn=class{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,r){if(t==="__v_skip")return e.__v_skip;let n=this._isReadonly,i=this._isShallow;if(t==="__v_isReactive")return!n;else if(t==="__v_isReadonly")return n;else if(t==="__v_isShallow")return i;else if(t==="__v_raw"){if(r===(n?i?Oo:Pn:i?To:Bn).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(r))return e;return}let o=_e(e);if(!n){let a;if(o&&(a=mo[t]))return a;if(t==="hasOwnProperty")return yo}let s=Reflect.get(e,t,ve(e)?e:r);if(Te(t)?Ln.has(t):xo(t))return s;if(!n)S(e,"get",t);if(i)return s;if(ve(s)){let a=o&&Xt(t)?s:s.value;return n&&Ee(a)?Bt(a):a}if(Ee(s))return n?Bt(s):rr(s);return s}},vo,wo,_o,Eo,Nt=(e)=>e,Be=(e)=>Reflect.getPrototypeOf(e),So,Co,Bn,To,Pn,Oo,te=(e)=>Ee(e)?rr(e):e,Ae=(e)=>Ee(e)?Bt(e):e,pt,Po,Un=()=>{},Uo,Fn=(e,{value:t,modifiers:r,expression:n,original:i},{effect:o,cleanup:s})=>{if(!t){let l={};qs(l),A(e,n)((d)=>{xn(e,d,i)},{scope:l});return}if(t==="key")return Ko(e,n);if(e._x_inlineBindings&&e._x_inlineBindings[t]&&e._x_inlineBindings[t].extract)return;let a=A(e,n);o(()=>a((l)=>{if(l===void 0&&typeof n==="string"&&n.match(/\./))l="";_(()=>un(e,t,l,r))})),s(()=>{e._x_undoAddedClasses&&e._x_undoAddedClasses(),e._x_undoAddedStyles&&e._x_undoAddedStyles()})},q,Vn,ea;var Yn=wi(()=>{P=[];Or=[],Mr=[],Ir=[];Ve=new MutationObserver(We);F=[];He=[];Ui={ownKeys({objects:e}){return Array.from(new Set(e.flatMap((t)=>Object.keys(t))))},has({objects:e},t){if(t==Symbol.unscopables)return!1;return e.some((r)=>Object.prototype.hasOwnProperty.call(r,t)||Reflect.has(r,t))},get({objects:e},t,r){if(t=="toJSON")return ji;return Reflect.get(e.find((n)=>Reflect.has(n,t))||{},t,r)},set({objects:e},t,r,n){let i;for(let s of e)if(i=$r(s,t),i)break;if(!i)i=e[e.length-1];let o=Object.getOwnPropertyDescriptor(i,t);if(o?.set&&o?.get)return o.set.call(n,r)||!0;return Reflect.set(i,t,r)}};zr={};Hr=Wi;je={};be=new Map,Kr=Symbol();Gr=[];V=["ignore","ref","id","data","anchor","bind","init","for","model","modelable","transition","show","if",Et,"teleport"];Qr=[];Ce((e,t)=>{if(Ge===0)return;if(!e||e.nodeType!==1||!t||t.nodeType!==1)return;if(T(e,(r)=>r._x_deferInit))t._x_ignore=!0});Kt=[],rn=[];ln=[];At=[];E("transition",(e,{value:t,modifiers:r,expression:n},{evaluate:i})=>{if(typeof n==="function")n=i(n);if(n===!1)return;if(!n||typeof n==="boolean")Es(e,r,t);else _s(e,n,t)});window.Element.prototype._x_toggleAndCascadeWithTransitions=function(e,t,r,n){let i=document.visibilityState==="visible"?requestAnimationFrame:setTimeout,o=()=>i(r);if(t){if(e._x_transition&&(e._x_transition.enter||e._x_transition.leave))e._x_transition.enter&&(Object.entries(e._x_transition.enter.during).length||Object.entries(e._x_transition.enter.start).length||Object.entries(e._x_transition.enter.end).length)?e._x_transition.in(r):o();else e._x_transition?e._x_transition.in(r):o();return}e._x_hidePromise=e._x_transition?new Promise((s,a)=>{e._x_transition.out(()=>{},()=>s(n)),e._x_transitioning&&e._x_transitioning.beforeCancel(()=>a({isFromCancelledTransition:!0}))}):Promise.resolve(n),queueMicrotask(()=>{let s=dn(e);if(s){if(!s._x_hideChildren)s._x_hideChildren=[];s._x_hideChildren.push(e)}else i(()=>{let a=(l)=>{let c=Promise.all([l._x_hidePromise,...(l._x_hideChildren||[]).map(a)]).then(([d])=>d?.());return delete l._x_hidePromise,delete l._x_hideChildren,c};a(e).catch((l)=>{if(!l.isFromCancelledTransition)throw l})})})};Ns=new Set(["allowfullscreen","async","autofocus","autoplay","checked","controls","default","defer","disabled","formnovalidate","inert","ismap","itemscope","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected","shadowrootclonable","shadowrootdelegatesfocus","shadowrootserializable"]);B={};gn={};yn={};Vs={get reactive(){return le},get release(){return ce},get effect(){return re},get raw(){return Cr},get transaction(){return Ni},version:"3.17.4",flushAndStopDeferringMutations:Hi,dontAutoEvaluateFunctions:Ur,disableEffectScheduling:Ii,startObservingMutations:Ht,stopObservingMutations:Br,setReactivityEngine:Li,onAttributeRemoved:Dr,onAttributesAdded:Lr,closestDataStack:ae,skipDuringClone:R,onlyDuringClone:is,addRootSelector:on,addInitSelector:an,setErrorHandler:Vi,interceptClone:Ce,addScopeToNode:Se,deferMutations:zi,mapAttributes:Ft,evaluateLater:A,interceptInit:ps,initInterceptors:jt,injectMagics:Ue,setEvaluator:Yi,setRawEvaluator:Ji,mergeProxies:G,extractProp:Rs,findClosest:T,onElRemoved:Rt,closestRoot:Xe,destroyTree:ne,interceptor:Rr,transition:Ot,setStyles:Ze,mutateDom:_,deferInit:ls,directive:E,entangle:mn,throttle:bn,debounce:pn,evaluate:Y,evaluateRaw:Xi,initTree:D,nextTick:Wt,prefixed:de,prefix:Zi,plugin:zs,magic:M,store:Hs,start:fs,clone:os,cloneNode:ss,bound:$s,$data:Pr,watch:Tr,walk:X,data:Fs,bind:js},ue=Vs,xr=new WeakMap,vn=new Set;Object.getOwnPropertyNames(globalThis).forEach((e)=>{if(e==="styleMedia"||e==="sharedStorage")return;let t;try{t=globalThis[e]}catch{return}vn.add(t)});Ws=["IDENTIFIER","KEYWORD","BOOLEAN","NULL","UNDEFINED"];Oa=Object.freeze({}),Ma=Object.freeze([]),we=Object.assign,eo=Object.prototype.hasOwnProperty,_e=Array.isArray,ro=Object.prototype.toString,no=/-\w/g,Ia=Qe((e)=>e.replace(no,(t)=>t.slice(1).toUpperCase())),io=/\B([A-Z])/g,La=Qe((e)=>e.replace(io,"-$1").toLowerCase()),Sn=Qe((e)=>e.charAt(0).toUpperCase()+e.slice(1)),Da=Qe((e)=>e?`on${Sn(e)}`:""),Na=En(so+",async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");ut=new WeakSet;Mn=[];Lt=new WeakMap,J=Symbol("Object iterate"),Dt=Symbol("Map keys iterate"),ke=Symbol("Array iterate");mo={__proto__:null,[Symbol.iterator](){return ft(this,Symbol.iterator,(e)=>I(this,e))},concat(...e){return se(this).concat(...e.map((t)=>_e(t)?se(t):t))},entries(){return ft(this,"entries",(e)=>(e[1]=I(this,e[1]),e))},every(e,t){return N(this,"every",e,t,void 0,arguments)},filter(e,t){return N(this,"filter",e,t,(r)=>r.map((n)=>I(this,n)),arguments)},find(e,t){return N(this,"find",e,t,(r)=>I(this,r),arguments)},findIndex(e,t){return N(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return N(this,"findLast",e,t,(r)=>I(this,r),arguments)},findLastIndex(e,t){return N(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return N(this,"forEach",e,t,void 0,arguments)},includes(...e){return ht(this,"includes",e)},indexOf(...e){return ht(this,"indexOf",e)},join(e){return se(this).join(e)},lastIndexOf(...e){return ht(this,"lastIndexOf",e)},map(e,t){return N(this,"map",e,t,void 0,arguments)},pop(){return pe(this,"pop")},push(...e){return pe(this,"push",e)},reduce(e,...t){return wr(this,"reduce",e,t)},reduceRight(e,...t){return wr(this,"reduceRight",e,t)},shift(){return pe(this,"shift")},some(e,t){return N(this,"some",e,t,void 0,arguments)},splice(...e){return pe(this,"splice",e)},toReversed(){return se(this).toReversed()},toSorted(e){return se(this).toSorted(e)},toSpliced(...e){return se(this).toSpliced(...e)},unshift(...e){return pe(this,"unshift",e)},values(){return ft(this,"values",(e)=>I(this,e))}};go=Array.prototype;xo=En("__proto__,__v_isRef,__isVue"),Ln=new Set(Object.getOwnPropertyNames(Symbol).filter((e)=>e!=="arguments"&&e!=="caller").map((e)=>Symbol[e]).filter(Te));vo=class extends Dn{constructor(e=!1){super(!1,e)}set(e,t,r,n){let i=e[t],o=_e(e)&&Xt(t);if(!this._isShallow){let l=Q(i);if(!ee(r)&&!Q(r))i=v(i),r=v(r);if(!o&&ve(i)&&!ve(r))if(l)return Z(`Set operation on key "${String(t)}" failed: target is readonly.`,e[t]),!0;else return i.value=r,!0}let s=o?Number(t)<e.length:Mt(e,t),a=Reflect.set(e,t,r,ve(e)?e:n);if(e===v(n)&&a){if(!s)U(e,"add",t,r);else if(K(r,i))U(e,"set",t,r,i)}return a}deleteProperty(e,t){let r=Mt(e,t),n=e[t],i=Reflect.deleteProperty(e,t);if(i&&r)U(e,"delete",t,void 0,n);return i}has(e,t){let r=Reflect.has(e,t);if(!Te(t)||!Ln.has(t))S(e,"has",t);return r}ownKeys(e){return S(e,"iterate",_e(e)?"length":J),Reflect.ownKeys(e)}},wo=class extends Dn{constructor(e=!1){super(!0,e)}set(e,t){return Z(`Set operation on key "${String(t)}" failed: target is readonly.`,e),!0}deleteProperty(e,t){return Z(`Delete operation on key "${String(t)}" failed: target is readonly.`,e),!0}},_o=new vo,Eo=new wo;So={get:Nn(!1,!1)},Co={get:Nn(!0,!1)};Bn=new WeakMap,To=new WeakMap,Pn=new WeakMap,Oo=new WeakMap;M("nextTick",()=>Wt);M("dispatch",(e)=>me.bind(me,e));M("watch",(e,{evaluateLater:t,cleanup:r})=>(n,i)=>{let o=t(n),a=Tr(()=>{let l;return o((c)=>l=c),l},i);r(a)});M("store",Us);M("data",(e)=>Pr(e));M("root",(e)=>Xe(e));M("refs",(e)=>{if(e._x_refs_proxy)return e._x_refs_proxy;return e._x_refs_proxy=G(Lo(e)),e._x_refs_proxy});pt={};M("id",(e,{cleanup:t})=>(r,n=null)=>{let i=`${r}${n?`-${n}`:""}`;return Bo(e,i,t,()=>{let o=Do(e,r),s=o?o._x_ids[r]:zn(r);return n?`${r}-${s}-${n}`:`${r}-${s}`})});Ce((e,t)=>{if(e._x_id)t._x_id=e._x_id});M("el",(e)=>e);Hn("Focus","focus","focus");Hn("Persist","persist","persist");E("modelable",(e,{expression:t},{effect:r,evaluateLater:n,cleanup:i})=>{let o=n(t),s=()=>{let d;return o((u)=>d=u),d},a=n(`${t} = __placeholder`),l=(d)=>a(()=>{},{scope:{__placeholder:d}}),c=s();l(c),queueMicrotask(()=>{if(!e._x_model)return;e._x_removeModelListeners.default();let d=e._x_model.get,u=e._x_model.setWithModifiers,p=mn({get(){return d()},set(b){u(b)}},{get(){return s()},set(b){l(b)}});i(p)})});E("teleport",(e,{modifiers:t,expression:r},{cleanup:n})=>{if(e.tagName.toLowerCase()!=="template")L("x-teleport can only be used on a <template> tag",e);let i=Er(r),o=e.content.cloneNode(!0).firstElementChild;if(e._x_teleport=o,o._x_teleportBack=e,e.setAttribute("data-teleport-template",!0),o.setAttribute("data-teleport-target",!0),e._x_forwardEvents)e._x_forwardEvents.forEach((a)=>{o.addEventListener(a,(l)=>{l.stopPropagation(),e.dispatchEvent(new l.constructor(l.type,l))})});Se(o,{},e);let s=(a,l,c)=>{if(c.includes("prepend"))l.parentNode.insertBefore(a,l);else if(c.includes("append"))l.parentNode.insertBefore(a,l.nextSibling);else l.appendChild(a)};_(()=>{R(()=>{s(o,i,t),D(o)})()}),e._x_teleportPutBack=()=>{let a=Er(r);_(()=>{s(e._x_teleport,a,t)})},n(()=>_(()=>{o.remove(),ne(o)}))});Po=document.createElement("div");Un.inline=(e,{modifiers:t},{cleanup:r})=>{t.includes("self")?e._x_ignoreSelf=!0:e._x_ignore=!0,r(()=>{t.includes("self")?delete e._x_ignoreSelf:delete e._x_ignore})};E("ignore",Un);E("effect",R((e,{expression:t},{effect:r})=>{r(A(e,t))}));Uo=["window","document","prevent","stop","once","capture","self","away","outside","passive","dot","camel","preserve-scroll","blur","change","lazy","number","boolean","trim","fill","unintrusive","parent"];E("model",(e,{modifiers:t,expression:r},{effect:n,cleanup:i})=>{let o=e;if(t.includes("parent"))o=T(e,(h)=>h!==e);let s=A(o,r),a;if(typeof r==="string")a=A(o,`${r} = __placeholder`);else if(typeof r==="function"&&typeof r()==="string")a=A(o,`${r()} = __placeholder`);else a=()=>{};let l=()=>{let h;return s((g)=>h=g),Ar(h)?h.get():h},c=(h)=>{let g;if(s((f)=>g=f),Ar(g))g.set(h);else a(()=>{},{scope:{__placeholder:h}})};if(typeof r==="string"&&e.type==="radio")_(()=>{if(!e.hasAttribute("name"))e.setAttribute("name",r)});let d=t.includes("change")||t.includes("lazy"),u=t.includes("blur"),p=t.includes("enter"),b=d||u||p,m;if(j)m=()=>{};else if(b){let h=[],g=(f)=>c($e(e,t,f,l()));if(d)h.push(oe(e,"change",t,g));if(u){if(h.push(oe(e,"blur",t,g)),e.form){let f=e.form,x=()=>g({target:e});if(!f._x_pendingModelUpdates)f._x_pendingModelUpdates=[];f._x_pendingModelUpdates.push(x),i(()=>{if(f._x_pendingModelUpdates)f._x_pendingModelUpdates.splice(f._x_pendingModelUpdates.indexOf(x),1)})}}if(p)h.push(oe(e,"keydown",t,(f)=>{if(f.key==="Enter")g(f)}));m=()=>h.forEach((f)=>f())}else{let h=e.tagName.toLowerCase()==="select"||["checkbox","radio"].includes(e.type)?"change":"input";m=oe(e,h,t,(g)=>{c($e(e,t,g,l()))})}if(t.includes("fill")){if([void 0,null,""].includes(l())||qe(e)&&Array.isArray(l())||e.tagName.toLowerCase()==="select"&&e.multiple)c($e(e,t,{target:e},l()))}if(!e._x_removeModelListeners)e._x_removeModelListeners={};if(e._x_removeModelListeners.default=m,i(()=>e._x_removeModelListeners.default()),e.form){let h=oe(e.form,"reset",[],(g)=>{Wt(()=>e._x_model&&e._x_model.set($e(e,t,{target:e},l())))});i(()=>h())}if(e._x_model={get(){return l()},set(h){c(h)},setWithModifiers:jn(t,c)},e._x_forceModelUpdate=(h)=>{if(h===void 0&&typeof r==="string"&&r.match(/\./))h="";_(()=>{if(qe(e))if(Array.isArray(h))e.checked=h.some((g)=>g==e.value);else e.checked=!!h;else if(Gt(e))if(typeof h==="boolean")e.checked=Re(e.value)===h;else e.checked=e.value==h;else un(e,"value",h)})},e.tagName==="SELECT"){let h=new MutationObserver(()=>{e._x_forceModelUpdate(l())});h.observe(e,{childList:!0}),i(()=>h.disconnect())}n(()=>{let h=l();if(t.includes("unintrusive")&&document.activeElement.isSameNode(e))return;e._x_forceModelUpdate(h)})});E("cloak",(e)=>queueMicrotask(()=>_(()=>e.removeAttribute(de("cloak")))));an(()=>`[${de("init")}]`);E("init",R((e,{expression:t},{evaluate:r})=>{if(typeof t==="string")return!!t.trim()&&r(t,{},!1);return r(t,{},!1)}));E("text",(e,{expression:t},{effect:r,evaluateLater:n})=>{let i=n(t);r(()=>{i((o)=>{_(()=>{e.textContent=o})})})});E("html",(e,{expression:t},{effect:r,evaluateLater:n})=>{let i=n(t);r(()=>{i((o)=>{_(()=>{Array.from(e.children).forEach((s)=>ne(s)),e.innerHTML=o??"",e._x_ignoreSelf=!0,D(e),delete e._x_ignoreSelf})})},{priority:"structural"})});Ft(Wr(":",Yr(de("bind:"))));Fn.inline=(e,{value:t,modifiers:r,expression:n})=>{if(!t)return;if(!e._x_inlineBindings)e._x_inlineBindings={};e._x_inlineBindings[t]={expression:n,extract:!1}};E("bind",Fn);on(()=>`[${de("data")}]`);q=Symbol();E("data",(e,{expression:t},{cleanup:r})=>{if(Wo(e))return;let n=e[q];if(n?.expression===t)return;t=t===""?"{}":t;let i={};Ue(i,e);let o={};Ks(o,i);let s=Y(e,t,{scope:o});if(s===void 0||s===!0)s={};Ue(s,e);let a;if(n?.reactiveData){a=n.reactiveData,Vo(a,s);let c={expression:t};e[q]=c,queueMicrotask(()=>{if(e[q]===c)delete e[q]})}else a=le(s);jt(a,r);let l=Se(e,a);R(()=>{a.init&&Y(e,a.init)})(),r(()=>{a.destroy&&Y(e,a.destroy),l();let c={reactiveData:a};e[q]=c,queueMicrotask(()=>{if(e[q]===c)delete e[q]})})});Ce((e,t)=>{if(e._x_dataStack)t._x_dataStack=e._x_dataStack,t.setAttribute("data-has-alpine-state",!0)});E("show",(e,{modifiers:t,expression:r},{effect:n})=>{let i=A(e,r);if(!e._x_doHide)e._x_doHide=()=>{_(()=>{e.style.setProperty("display","none",t.includes("important")?"important":void 0)})};if(!e._x_doShow)e._x_doShow=()=>{_(()=>{if(e.style.length===1&&e.style.display==="none")e.removeAttribute("style");else e.style.removeProperty("display")})};let o=()=>{e._x_doHide(),e._x_isShown=!1},s=()=>{e._x_doShow(),e._x_isShown=!0},a=()=>setTimeout(s),l=Tt((u)=>u?s():o(),(u)=>{if(typeof e._x_toggleAndCascadeWithTransitions==="function")e._x_toggleAndCascadeWithTransitions(e,u,s,o);else u?a():o()}),c,d=!0;n(()=>i((u)=>{if(!d&&u===c)return;if(t.includes("immediate"))u?a():o();l(u),c=u,d=!1}))});E("for",R((e,{expression:t},{effect:r,cleanup:n})=>{let i=Go(t),o=A(e,i.items),s=A(e,e._x_keyExpression||"index");e._x_lookup=new Map,r(()=>Jo(e,i,o,s),{priority:"structural"}),n(()=>{e._x_lookup.forEach((a)=>_(()=>{ne(a),a.remove()})),delete e._x_lookup,delete e._x_lastRenderedEl})}));Kn.inline=(e,{expression:t},{cleanup:r})=>{let n=Xe(e);if(!n)return;if(!n._x_refs)n._x_refs={};n._x_refs[t]=e,r(()=>delete n._x_refs[t])};E("ref",Kn);E("if",R((e,{expression:t},{effect:r,cleanup:n})=>{if(e.tagName.toLowerCase()!=="template")L("x-if can only be used on a <template> tag",e);let i=A(e,t),o=()=>{if(e._x_currentIfEl)return e._x_currentIfEl;let a=e.content.cloneNode(!0).firstElementChild;return Se(a,{},e),_(()=>{e.after(a),D(a)}),e._x_currentIfEl=a,e._x_lastRenderedEl=a,e._x_undoIf=()=>{_(()=>{ne(a),a.remove()}),delete e._x_currentIfEl,delete e._x_lastRenderedEl},a},s=()=>{if(!e._x_undoIf)return;e._x_undoIf(),delete e._x_undoIf};r(()=>i((a)=>{a?o():s()}),{priority:"structural"}),n(()=>e._x_undoIf&&e._x_undoIf())}));E("id",(e,{expression:t},{evaluate:r})=>{r(t).forEach((i)=>No(e,i))});Ce((e,t)=>{if(e._x_ids)t._x_ids=e._x_ids});Ft(Wr("@",Yr(de("on:"))));E("on",R((e,{value:t,modifiers:r,expression:n},{cleanup:i})=>{let o=n?A(e,n):()=>{};if(e.tagName.toLowerCase()==="template"){if(!e._x_forwardEvents)e._x_forwardEvents=[];if(!e._x_forwardEvents.includes(t))e._x_forwardEvents.push(t)}let s=oe(e,t,r,(a)=>{o(()=>{},{scope:{$event:a},params:[a]})});i(()=>s())}));et("Collapse","collapse","collapse");et("Intersect","intersect","intersect");et("Focus","trap","focus");et("Mask","mask","mask");E("html",(e,{expression:t})=>{Ye(Error("Using the x-html directive is prohibited in the CSP build"),e)});ue.setEvaluator(Zs);ue.setRawEvaluator(Xs);ue.setReactivityEngine({reactive:rr,effect:(e,t={})=>{let r;return r=co(e,{scheduler:()=>{if(!r)return;t.scheduler?t.scheduler(r):r()}}),r},release:uo,raw:v});Vn=ue,ea=Vn;/*! Bundled license information:
|
|
8
8
|
|
|
9
9
|
@vue/shared/dist/shared.esm-bundler.js:
|
|
10
10
|
(**
|
|
@@ -19,7 +19,7 @@ ${r?'Expression: "'+r+`"
|
|
|
19
19
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
20
20
|
* @license MIT
|
|
21
21
|
**)
|
|
22
|
-
*/});var De=typeof HTMLElement==="function"?HTMLElement:class{};function ur(e,t){if(typeof customElements>"u"||customElements.get?.(e))return;try{customElements.define(e,t)}catch(r){console.warn(`bare-v3: ${e} was not registered`,r)}}function fr(e,t,r={},n=[]){let i=()=>{for(let s of n)if(!e.classList.contains(s))e.classList.add(s);for(let[s,a]of Object.entries(r))if(!e.hasAttribute(s))e.setAttribute(s,a)};i();let o=new MutationObserver(i);o.observe(e,{attributes:!0,attributeFilter:["class",...Object.keys(r)]}),t.addEventListener("abort",()=>o.disconnect(),{once:!0})}var _i=Symbol.for("bare-v3.styles");function Ne(e,t,r){if(!e?.head||e.getElementById(t))return;let n=e[_i]??=new Set;if(n.has(t))return;let i=e.defaultView;if(i&&"adoptedStyleSheets"in e&&"replaceSync"in i.CSSStyleSheet.prototype){let s=new i.CSSStyleSheet;s.replaceSync(r),e.adoptedStyleSheets=[...e.adoptedStyleSheets,s],n.add(t);return}let o=e.createElement("style");o.id=t,o.textContent=r,e.head.append(o)}var Oe=null;function Jn(){if(Oe)return Oe;let e=(Yn(),gi(Wn)).default;return e.prefix("b3x-"),e.setErrorHandler((t,r,n)=>{console.warn(`bare-v3: component template error${n?` in "${n}"`:""}`,t,r)}),Oe=e}var Gn=(e)=>Jn().reactive(e),Xn=(e)=>Oe?Oe.raw(e):e;function Zn(e,t,r){let n=Jn(),i=n.reactive(r);return e.innerHTML=t,n.addScopeToNode(e,i),n.initTree(e),i}function ta(e,t){let r=e.ownerDocument||e,n=r.defaultView,i={signal:t},o=null,s=null,a=0,l=null,c=0,d=null,u=new n.MutationObserver((
|
|
22
|
+
*/});var De=typeof HTMLElement==="function"?HTMLElement:class{};function ur(e,t){if(typeof customElements>"u"||customElements.get?.(e))return;try{customElements.define(e,t)}catch(r){console.warn(`bare-v3: ${e} was not registered`,r)}}function fr(e,t,r={},n=[]){let i=()=>{for(let s of n)if(!e.classList.contains(s))e.classList.add(s);for(let[s,a]of Object.entries(r))if(!e.hasAttribute(s))e.setAttribute(s,a)};i();let o=new MutationObserver(i);o.observe(e,{attributes:!0,attributeFilter:["class",...Object.keys(r)]}),t.addEventListener("abort",()=>o.disconnect(),{once:!0})}var _i=Symbol.for("bare-v3.styles");function Ne(e,t,r){if(!e?.head||e.getElementById(t))return;let n=e[_i]??=new Set;if(n.has(t))return;let i=e.defaultView;if(i&&"adoptedStyleSheets"in e&&"replaceSync"in i.CSSStyleSheet.prototype){let s=new i.CSSStyleSheet;s.replaceSync(r),e.adoptedStyleSheets=[...e.adoptedStyleSheets,s],n.add(t);return}let o=e.createElement("style");o.id=t,o.textContent=r,e.head.append(o)}var Oe=null;function Jn(){if(Oe)return Oe;let e=(Yn(),gi(Wn)).default;return e.prefix("b3x-"),e.setErrorHandler((t,r,n)=>{console.warn(`bare-v3: component template error${n?` in "${n}"`:""}`,t,r)}),Oe=e}var Gn=(e)=>Jn().reactive(e),Xn=(e)=>Oe?Oe.raw(e):e;function Zn(e,t,r){let n=Jn(),i=n.reactive(r);return e.innerHTML=t,n.addScopeToNode(e,i),n.initTree(e),i}function ta(e,t){let r=e.ownerDocument||e,n=r.defaultView,i={signal:t},o=null,s=null,a=0,l=null,c=0,d=null,u=new n.MutationObserver((m)=>{if(!o.isConnected||m.some(({target:h})=>s.contains(h)&&!d.contains(h)))p()});function p(){if(!o)return;n.clearTimeout(c),u.disconnect();let m=o.dataset.b3Confirm;if(l&&m&&o.textContent===m)o.replaceChildren(...l);o.removeAttribute("data-b3-armed"),o=s=l=null,d.textContent=""}function b(m){if(!d?.isConnected)d=r.createElement("span"),d.className="b3-visually-hidden",d.setAttribute("role","status"),r.body.append(d);let h=d;o=m,a=n.performance.now(),s=m.parentElement.closest("li, tr, article, [data-id], .b3-row, .b3-card")||m.parentElement;let g=m.dataset.b3Confirm;if(g)l=[...m.childNodes],m.replaceChildren(g);m.setAttribute("data-b3-armed",""),u.observe(e,{childList:!0,subtree:!0}),u.observe(s,{childList:!0,subtree:!0,attributes:!0,characterData:!0}),c=n.setTimeout(p,4000),n.requestAnimationFrame(()=>{if(o===m)h.textContent=g||"Press again to confirm"})}e.addEventListener("click",(m)=>{let h=m.target.closest?.("[data-b3-confirm]");if(o&&h!==o)p();if(!h||h.disabled||!e.contains(h))return;if(h===o&&n.performance.now()-a>=350)return p();if(m.preventDefault(),m.stopImmediatePropagation(),h!==o)b(h)},{...i,capture:!0}),e.addEventListener("focusout",({target:m})=>{if(m===o)n.queueMicrotask(()=>m===o&&p())},i),e.addEventListener("keydown",(m)=>{let h=m;if(h.key==="Escape")p();else if(h.repeat&&(h.key==="Enter"||h.key===" ")&&h.target.closest?.("[data-b3-confirm]"))h.preventDefault()},{...i,capture:!0}),t?.addEventListener("abort",()=>{p(),d?.remove()},{once:!0})}var Qn=Symbol.for("bare-v3.confirm");function ei(){if(typeof document>"u"||!document.defaultView?.MutationObserver)return;let e=document;if(e[Qn])return;e[Qn]=!0,ta(document)}var fe=1.001,ra=320,na=30,ia=350,sa="b3-image-viewer-style",oa=`
|
|
23
23
|
.b3-image-viewer{position:relative;display:block;overflow:hidden;touch-action:pan-y;
|
|
24
24
|
background:var(--b3-color-canvas,#f6f5f0);color:var(--b3-color-text,#202923);
|
|
25
25
|
border-radius:var(--b3-radius,.75rem);-webkit-user-select:none;user-select:none;}
|
|
@@ -38,7 +38,7 @@ ${r?'Expression: "'+r+`"
|
|
|
38
38
|
min-height:44px;min-width:44px;}
|
|
39
39
|
.b3-image-viewer>.b3-image-viewer-close{inset-inline-end:var(--b3-space,1rem);}
|
|
40
40
|
.b3-image-viewer>.b3-image-viewer-fit{inset-inline-start:var(--b3-space,1rem);}
|
|
41
|
-
`;class nr extends De{static observedAttributes=["src","alt","max-scale","open"];#t=1;#e=0;#n=0;#o=!1;#s=null;#i=new Map;#a=!1;#b=0;#r=0;#x=0;#y=0;#E=!1;#v=null;#m=null;#k=new WeakSet;#l=null;get scale(){return this.#t}get fitted(){return this.#t<=fe}get src(){return this.#l??this.getAttribute("src")}set src(e){if(e&&typeof e==="object")this.#l=e.src??e.default??String(e);else if(this.#l=null,e==null)this.removeAttribute("src");else this.setAttribute("src",e);this.#w()}get alt(){return this.getAttribute("alt")??""}set alt(e){this.setAttribute("alt",e??"")}get maxScale(){let e=Number(this.getAttribute("max-scale"));return e>=1?e:8}set maxScale(e){this.setAttribute("max-scale",String(e))}get open(){return this.hasAttribute("open")}set open(e){this.toggleAttribute("open",Boolean(e))}connectedCallback(){if(this.#E)return;if(this.#E=!0,Ne(this.ownerDocument,sa,oa),this.classList.add("b3-image-viewer"),!this.hasAttribute("tabindex"))this.tabIndex=0;if(!this.hasAttribute("role"))this.setAttribute("role","group");this.#_(),this.#w(),this.#M(),this.#m=new MutationObserver(()=>{this.#A(),this.#u()}),this.#m.observe(this,{childList:!0}),this.#A(),this.#u()}disconnectedCallback(){this.#v?.abort(),this.#v=null,this.#m?.disconnect(),this.#m=null;for(let e of this.#i.keys())if(this.hasPointerCapture?.(e))this.releasePointerCapture(e);this.#i.clear(),this.#s=null,this.#a=!1,this.#E=!1}attributeChangedCallback(e,t,r){if(t===r)return;if(e==="src")this.#w(),this.reset();if(e==="alt"){let n=this.#h();if(n)n.alt=this.alt;this.#_()}if(e==="open"){if(this.#A(),this.reset(),this.open)this.focus({preventScroll:!0})}if(e==="max-scale"&&this.#t>this.maxScale)this.zoomTo(this.maxScale)}#h(){return this.querySelector(":scope > img, :scope > svg, :scope > canvas")}#w(){let e=this.#h(),t=this.src,r=!1;if(!e&&t)e=this.ownerDocument.createElement("img"),r=!0,this.prepend(e);if(!e)return;if(t&&e.tagName==="IMG"&&e.getAttribute("src")!==t)e.setAttribute("src",t);if(e.tagName==="IMG"&&(r||this.hasAttribute("alt")))e.alt=this.alt;if(this.#_(),e.tagName==="IMG")this.#f(e)}#_(){if(this.hasAttribute("aria-labelledby"))return;let e=this.getAttribute("alt");if(e)this.setAttribute("aria-label",e);else if(!this.hasAttribute("aria-label"))this.setAttribute("aria-label","Zoomable image")}#f(e){if(this.#k.has(e))return;if(this.#k.add(e),e.addEventListener("load",()=>{this.removeAttribute("data-b3-error"),this.reset()}),e.addEventListener("error",()=>this.#g(e)),e.complete&&e.naturalWidth===0&&e.getAttribute("src"))setTimeout(()=>{if(e.isConnected&&e.complete&&e.naturalWidth===0)this.#g(e)},0)}#g(e){if(this.hasAttribute("data-b3-error"))return;this.setAttribute("data-b3-error",""),this.dispatchEvent(new CustomEvent("b3-error",{bubbles:!0,composed:!0,detail:{src:e.getAttribute("src")??this.src??null}}))}#A(){if(!this.open){for(let t of this.querySelectorAll(":scope > .b3-image-viewer-close"))t.remove();return}if(this.querySelector(":scope > .b3-image-viewer-close"))return;let e=this.ownerDocument.createElement("button");e.type="button",e.className="b3-image-viewer-close",e.setAttribute("aria-label","Close"),e.textContent="×",e.addEventListener("click",(t)=>{t.preventDefault(),t.stopPropagation(),this.requestClose()}),e.addEventListener("pointerdown",(t)=>t.stopPropagation()),this.append(e)}#c(){let e=this.#h();if(!e)return null;let t=e.style.transform;e.style.transform="none";let r=this.getBoundingClientRect(),n=e.getBoundingClientRect();return e.style.transform=t,this.#o=n.width>r.width+1||n.height>r.height+1,{element:e,vw:r.width,vh:r.height,x:n.left-r.left,y:n.top-r.top,w:n.width,h:n.height}}#d(e){if(this.#t<=fe&&!this.#o){this.#e=0,this.#n=0;return}let t=e.w*this.#t,r=e.h*this.#t;this.#e=t<=e.vw?(e.vw-t)/2-e.x:Math.min(-e.x,Math.max(-e.x-(t-e.vw),this.#e)),this.#n=r<=e.vh?(e.vh-r)/2-e.y:Math.min(-e.y,Math.max(-e.y-(r-e.vh),this.#n))}#u(e){let t=e?.element??this.#h();if(!t)return;let r=this.#t<=fe,n=!r||this.#o;t.style.transformOrigin="0 0",t.style.transform=r&&!this.#e&&!this.#n?"":`translate(${this.#e}px, ${this.#n}px) scale(${this.#t})`,t.style.setProperty("--b3-zoom",String(this.#t)),this.toggleAttribute("data-b3-zoomed",!r),this.toggleAttribute("data-b3-pannable",n),this.style.touchAction=n||this.open?"none":"pan-y";let i=this.querySelector(":scope > .b3-image-viewer-fit");if(i)i.hidden=r}#S(e,t,r,n=this.#c()){if(!n)return;let i=this.#t;e=Math.max(1,Math.min(this.maxScale,e));let o=(t-this.#e)/this.#t,s=(r-this.#n)/this.#t;if(this.#e=t-o*e,this.#n=r-s*e,this.#t=e,this.#d(n),this.#u(n),i!==this.#t)this.#C()}#C(){this.dispatchEvent(new CustomEvent("b3-zoom",{bubbles:!0,composed:!0,detail:{scale:this.#t,fitted:this.fitted,src:this.src}}))}reset(){let e=this.#t!==1;this.#t=1,this.#e=0,this.#n=0;let t=this.#c();if(t)this.#d(t);if(this.#u(t),e)this.#C()}zoomTo(e){let t=this.#c();if(t)this.#S(e,t.vw/2,t.vh/2,t)}requestClose(){this.dispatchEvent(new CustomEvent("b3-close",{bubbles:!0,composed:!0,detail:{src:this.src}}))}#T(){let e=0,t=0;for(let r of this.#i.values())e+=r.x,t+=r.y;return{x:e/this.#i.size,y:t/this.#i.size}}#O(){let[e,t]=[...this.#i.values()];return Math.hypot(e.x-t.x,e.y-t.y)}#M(){this.#v=new AbortController;let e={signal:this.#v.signal},t={...e,passive:!1};this.addEventListener("pointerdown",(n)=>{if(n.pointerType==="mouse"&&n.button!==0)return;if(!this.#h())return;if(this.#i.set(n.pointerId,{x:n.clientX,y:n.clientY}),this.#s=this.#c(),this.#i.size>1||this.#t>fe||this.#o)this.setPointerCapture(n.pointerId),n.preventDefault()},e),this.addEventListener("pointermove",(n)=>{if(!this.#i.has(n.pointerId))return;let i=this.#i.size===2;if(!i&&this.#t<=fe&&!this.#o){this.#i.set(n.pointerId,{x:n.clientX,y:n.clientY});return}if(this.#s??=this.#c(),!this.#s)return;n.preventDefault();let o=this.#T(),s=i?this.#O():0;this.#i.set(n.pointerId,{x:n.clientX,y:n.clientY});let a=this.#T(),l=i?this.#O():0,c=this.getBoundingClientRect(),d=this.#t,u=i&&s>0?Math.max(1,Math.min(this.maxScale,this.#t*(l/s))):this.#t,f=(o.x-c.left-this.#e)/this.#t,m=(o.y-c.top-this.#n)/this.#t;if(this.#e=a.x-c.left-f*u,this.#n=a.y-c.top-m*u,this.#t=u,this.#d(this.#s),this.#u(this.#s),this.#a=!0,d!==this.#t)this.#C()},t);let r=(n)=>{if(!this.#i.delete(n.pointerId))return;if(this.hasPointerCapture?.(n.pointerId))this.releasePointerCapture(n.pointerId);if(this.#i.size){this.#s=this.#c();return}if(this.#s=null,this.#a){this.#b=performance.now(),this.#a=!1;return}if(n.type!=="pointerup")return;let i=performance.now(),o=Math.hypot(n.clientX-this.#x,n.clientY-this.#y)<na;if(i-this.#r<ra&&o){this.#r=0;let s=this.getBoundingClientRect();this.#S(this.#t>fe?1:2.5,n.clientX-s.left,n.clientY-s.top),this.#b=i}else this.#r=i,this.#x=n.clientX,this.#y=n.clientY};this.addEventListener("pointerup",r,e),this.addEventListener("pointercancel",r,e),this.addEventListener("click",(n)=>{if(n.target.closest?.(".b3-image-viewer-close, .b3-image-viewer-fit"))return;if(performance.now()-this.#b<ia){n.preventDefault(),n.stopPropagation();return}if(this.open&&this.fitted&&n.target===this)this.requestClose()},{...e,capture:!0}),this.addEventListener("wheel",(n)=>{let i=this.getBoundingClientRect();if(n.ctrlKey){n.preventDefault(),this.#S(this.#t*Math.exp(-n.deltaY/180),n.clientX-i.left,n.clientY-i.top);return}let o=this.#c();if(!o||o.h*this.#t<=o.vh&&!this.#o)return;let s=this.#n;if(this.#n-=n.deltaY,this.#d(o),this.#n===s)return;n.preventDefault(),this.#u(o)},t);for(let n of["gesturestart","gesturechange","gestureend"])this.addEventListener(n,(i)=>i.preventDefault(),t);this.addEventListener("keydown",(n)=>{if(n.metaKey||n.altKey)return;let i=n.shiftKey?80:40,o=(s,a)=>{let l=this.#c();if(!l||this.fitted)return!1;return this.#e+=s,this.#n+=a,this.#d(l),this.#u(l),!0};switch(n.key){case"+":case"=":this.zoomTo(this.#t*1.5);break;case"-":case"_":this.zoomTo(this.#t/1.5);break;case"0":this.reset();break;case"Enter":case" ":this.zoomTo(this.fitted?2.5:1);break;case"Escape":if(!this.open)return;this.requestClose();break;case"ArrowLeft":if(!o(i,0))return;break;case"ArrowRight":if(!o(-i,0))return;break;case"ArrowUp":if(!o(0,i))return;break;case"ArrowDown":if(!o(0,-i))return;break;default:return}n.preventDefault()},e),this.ownerDocument.defaultView.addEventListener("resize",()=>{let n=this.#c();if(n)this.#d(n),this.#u(n)},e)}}var ti=nr;function ir(e="b3-image-viewer"){if(typeof customElements>"u")return null;let t=customElements.get?.(e);if(t)return t;let r=ti;return ti=class extends nr{},customElements.define(e,r),r}ir();var aa=/(^|\s)([#@][\p{L}\p{N}_-]+)/gu,la=/(?:\s+[#@][\p{L}\p{N}_-]+)+\s*$/u,ca=350,Ie=()=>globalThis.crypto?.randomUUID?.()??Math.random().toString(36).slice(2,11),sr=(e)=>JSON.parse(JSON.stringify(Xn(e))),w=(e,t)=>e!=null&&String(e)===String(t),tt=(e)=>!!e&&typeof e==="object",C=(e)=>Array.isArray(e.subtasks)?e.subtasks:[],rt=(e)=>Array.isArray(e.comments)?e.comments:[];function da(e,t){if(e==null||e==="")return"";let r=new Date(typeof e==="string"?e.replace(" ","T"):e).getTime();if(!Number.isFinite(r))return"";let n=Math.max(0,Math.round((t-r)/60000));if(n<1)return"just now";for(let[i,o]of[["y",525600],["mo",43200],["w",10080],["d",1440],["h",60]])if(n>=o)return`${Math.floor(n/o)}${i} ago`;return`${n}m ago`}var li=(e)=>[...e.filter((t)=>t.starred),...e.filter((t)=>!t.starred)];function or(e){if(!Array.isArray(e))return[];let t=new Set,r=(n)=>{let{id:i}=n;if(!(typeof i==="string"&&i!==""||typeof i==="number"&&Number.isFinite(i))||t.has(String(i)))n.id=Ie();t.add(String(n.id))};return e.filter(tt).map((n)=>{r(n),n.cards=li(Array.isArray(n.cards)?n.cards.filter(tt):[]);for(let i of n.cards){if(r(i),Array.isArray(i.subtasks)){for(let o of i.subtasks)if(tt(o))r(o)}if(Array.isArray(i.comments)){for(let o of i.comments)if(tt(o))r(o)}}return n})}function ri(e,{field:t,id:r}){if(t==="name"){let n=e.findIndex((i)=>w(i.id,r));if(n>=0)e.splice(n,1);return}for(let n of e){let i=n.cards.findIndex((o)=>w(o.id,r));if(t==="title"&&i>=0)return void n.cards.splice(i,1);if(t==="subtask")for(let o of n.cards){let s=C(o),a=s.findIndex((l)=>w(l.id,r));if(a>=0)return void s.splice(a,1)}}}var ua=(e)=>e.toLowerCase().split(/\s+/).filter(Boolean);function fa(e){return[e.title??"",e.description??"",...C(e).map((t)=>t.title??""),...st(e)].join(`
|
|
41
|
+
`;class nr extends De{static observedAttributes=["src","alt","max-scale","open"];#t=1;#e=0;#n=0;#o=!1;#s=null;#i=new Map;#a=!1;#b=0;#r=0;#x=0;#y=0;#E=!1;#v=null;#m=null;#k=new WeakSet;#l=null;get scale(){return this.#t}get fitted(){return this.#t<=fe}get src(){return this.#l??this.getAttribute("src")}set src(e){if(e&&typeof e==="object")this.#l=e.src??e.default??String(e);else if(this.#l=null,e==null)this.removeAttribute("src");else this.setAttribute("src",e);this.#w()}get alt(){return this.getAttribute("alt")??""}set alt(e){this.setAttribute("alt",e??"")}get maxScale(){let e=Number(this.getAttribute("max-scale"));return e>=1?e:8}set maxScale(e){this.setAttribute("max-scale",String(e))}get open(){return this.hasAttribute("open")}set open(e){this.toggleAttribute("open",Boolean(e))}connectedCallback(){if(this.#E)return;if(this.#E=!0,Ne(this.ownerDocument,sa,oa),this.classList.add("b3-image-viewer"),!this.hasAttribute("tabindex"))this.tabIndex=0;if(!this.hasAttribute("role"))this.setAttribute("role","group");this.#_(),this.#w(),this.#M(),this.#m=new MutationObserver(()=>{this.#A(),this.#f()}),this.#m.observe(this,{childList:!0}),this.#A(),this.#f()}disconnectedCallback(){this.#v?.abort(),this.#v=null,this.#m?.disconnect(),this.#m=null;for(let e of this.#i.keys())if(this.hasPointerCapture?.(e))this.releasePointerCapture(e);this.#i.clear(),this.#s=null,this.#a=!1,this.#E=!1}attributeChangedCallback(e,t,r){if(t===r)return;if(e==="src")this.#w(),this.reset();if(e==="alt"){let n=this.#h();if(n)n.alt=this.alt;this.#_()}if(e==="open"){if(this.#A(),this.reset(),this.open)this.focus({preventScroll:!0})}if(e==="max-scale"&&this.#t>this.maxScale)this.zoomTo(this.maxScale)}#h(){return this.querySelector(":scope > img, :scope > svg, :scope > canvas")}#w(){let e=this.#h(),t=this.src,r=!1;if(!e&&t)e=this.ownerDocument.createElement("img"),r=!0,this.prepend(e);if(!e)return;if(t&&e.tagName==="IMG"&&e.getAttribute("src")!==t)e.setAttribute("src",t);if(e.tagName==="IMG"&&(r||this.hasAttribute("alt")))e.alt=this.alt;if(this.#_(),e.tagName==="IMG")this.#c(e)}#_(){if(this.hasAttribute("aria-labelledby"))return;let e=this.getAttribute("alt");if(e)this.setAttribute("aria-label",e);else if(!this.hasAttribute("aria-label"))this.setAttribute("aria-label","Zoomable image")}#c(e){if(this.#k.has(e))return;if(this.#k.add(e),e.addEventListener("load",()=>{this.removeAttribute("data-b3-error"),this.reset()}),e.addEventListener("error",()=>this.#g(e)),e.complete&&e.naturalWidth===0&&e.getAttribute("src"))setTimeout(()=>{if(e.isConnected&&e.complete&&e.naturalWidth===0)this.#g(e)},0)}#g(e){if(this.hasAttribute("data-b3-error"))return;this.setAttribute("data-b3-error",""),this.dispatchEvent(new CustomEvent("b3-error",{bubbles:!0,composed:!0,detail:{src:e.getAttribute("src")??this.src??null}}))}#A(){if(!this.open){for(let t of this.querySelectorAll(":scope > .b3-image-viewer-close"))t.remove();return}if(this.querySelector(":scope > .b3-image-viewer-close"))return;let e=this.ownerDocument.createElement("button");e.type="button",e.className="b3-image-viewer-close",e.setAttribute("aria-label","Close"),e.textContent="×",e.addEventListener("click",(t)=>{t.preventDefault(),t.stopPropagation(),this.requestClose()}),e.addEventListener("pointerdown",(t)=>t.stopPropagation()),this.append(e)}#d(){let e=this.#h();if(!e)return null;let t=e.style.transform;e.style.transform="none";let r=this.getBoundingClientRect(),n=e.getBoundingClientRect();return e.style.transform=t,this.#o=n.width>r.width+1||n.height>r.height+1,{element:e,vw:r.width,vh:r.height,x:n.left-r.left,y:n.top-r.top,w:n.width,h:n.height}}#u(e){if(this.#t<=fe&&!this.#o){this.#e=0,this.#n=0;return}let t=e.w*this.#t,r=e.h*this.#t;this.#e=t<=e.vw?(e.vw-t)/2-e.x:Math.min(-e.x,Math.max(-e.x-(t-e.vw),this.#e)),this.#n=r<=e.vh?(e.vh-r)/2-e.y:Math.min(-e.y,Math.max(-e.y-(r-e.vh),this.#n))}#f(e){let t=e?.element??this.#h();if(!t)return;let r=this.#t<=fe,n=!r||this.#o;t.style.transformOrigin="0 0",t.style.transform=r&&!this.#e&&!this.#n?"":`translate(${this.#e}px, ${this.#n}px) scale(${this.#t})`,t.style.setProperty("--b3-zoom",String(this.#t)),this.toggleAttribute("data-b3-zoomed",!r),this.toggleAttribute("data-b3-pannable",n),this.style.touchAction=n||this.open?"none":"pan-y";let i=this.querySelector(":scope > .b3-image-viewer-fit");if(i)i.hidden=r}#S(e,t,r,n=this.#d()){if(!n)return;let i=this.#t;e=Math.max(1,Math.min(this.maxScale,e));let o=(t-this.#e)/this.#t,s=(r-this.#n)/this.#t;if(this.#e=t-o*e,this.#n=r-s*e,this.#t=e,this.#u(n),this.#f(n),i!==this.#t)this.#C()}#C(){this.dispatchEvent(new CustomEvent("b3-zoom",{bubbles:!0,composed:!0,detail:{scale:this.#t,fitted:this.fitted,src:this.src}}))}reset(){let e=this.#t!==1;this.#t=1,this.#e=0,this.#n=0;let t=this.#d();if(t)this.#u(t);if(this.#f(t),e)this.#C()}zoomTo(e){let t=this.#d();if(t)this.#S(e,t.vw/2,t.vh/2,t)}requestClose(){this.dispatchEvent(new CustomEvent("b3-close",{bubbles:!0,composed:!0,detail:{src:this.src}}))}#T(){let e=0,t=0;for(let r of this.#i.values())e+=r.x,t+=r.y;return{x:e/this.#i.size,y:t/this.#i.size}}#O(){let[e,t]=[...this.#i.values()];return Math.hypot(e.x-t.x,e.y-t.y)}#M(){this.#v=new AbortController;let e={signal:this.#v.signal},t={...e,passive:!1};this.addEventListener("pointerdown",(n)=>{if(n.pointerType==="mouse"&&n.button!==0)return;if(!this.#h())return;if(this.#i.set(n.pointerId,{x:n.clientX,y:n.clientY}),this.#s=this.#d(),this.#i.size>1||this.#t>fe||this.#o)this.setPointerCapture(n.pointerId),n.preventDefault()},e),this.addEventListener("pointermove",(n)=>{if(!this.#i.has(n.pointerId))return;let i=this.#i.size===2;if(!i&&this.#t<=fe&&!this.#o){this.#i.set(n.pointerId,{x:n.clientX,y:n.clientY});return}if(this.#s??=this.#d(),!this.#s)return;n.preventDefault();let o=this.#T(),s=i?this.#O():0;this.#i.set(n.pointerId,{x:n.clientX,y:n.clientY});let a=this.#T(),l=i?this.#O():0,c=this.getBoundingClientRect(),d=this.#t,u=i&&s>0?Math.max(1,Math.min(this.maxScale,this.#t*(l/s))):this.#t,p=(o.x-c.left-this.#e)/this.#t,b=(o.y-c.top-this.#n)/this.#t;if(this.#e=a.x-c.left-p*u,this.#n=a.y-c.top-b*u,this.#t=u,this.#u(this.#s),this.#f(this.#s),this.#a=!0,d!==this.#t)this.#C()},t);let r=(n)=>{if(!this.#i.delete(n.pointerId))return;if(this.hasPointerCapture?.(n.pointerId))this.releasePointerCapture(n.pointerId);if(this.#i.size){this.#s=this.#d();return}if(this.#s=null,this.#a){this.#b=performance.now(),this.#a=!1;return}if(n.type!=="pointerup")return;let i=performance.now(),o=Math.hypot(n.clientX-this.#x,n.clientY-this.#y)<na;if(i-this.#r<ra&&o){this.#r=0;let s=this.getBoundingClientRect();this.#S(this.#t>fe?1:2.5,n.clientX-s.left,n.clientY-s.top),this.#b=i}else this.#r=i,this.#x=n.clientX,this.#y=n.clientY};this.addEventListener("pointerup",r,e),this.addEventListener("pointercancel",r,e),this.addEventListener("click",(n)=>{if(n.target.closest?.(".b3-image-viewer-close, .b3-image-viewer-fit"))return;if(performance.now()-this.#b<ia){n.preventDefault(),n.stopPropagation();return}if(this.open&&this.fitted&&n.target===this)this.requestClose()},{...e,capture:!0}),this.addEventListener("wheel",(n)=>{let i=this.getBoundingClientRect();if(n.ctrlKey){n.preventDefault(),this.#S(this.#t*Math.exp(-n.deltaY/180),n.clientX-i.left,n.clientY-i.top);return}let o=this.#d();if(!o||o.h*this.#t<=o.vh&&!this.#o)return;let s=this.#n;if(this.#n-=n.deltaY,this.#u(o),this.#n===s)return;n.preventDefault(),this.#f(o)},t);for(let n of["gesturestart","gesturechange","gestureend"])this.addEventListener(n,(i)=>i.preventDefault(),t);this.addEventListener("keydown",(n)=>{if(n.metaKey||n.altKey)return;let i=n.shiftKey?80:40,o=(s,a)=>{let l=this.#d();if(!l||this.fitted)return!1;return this.#e+=s,this.#n+=a,this.#u(l),this.#f(l),!0};switch(n.key){case"+":case"=":this.zoomTo(this.#t*1.5);break;case"-":case"_":this.zoomTo(this.#t/1.5);break;case"0":this.reset();break;case"Enter":case" ":this.zoomTo(this.fitted?2.5:1);break;case"Escape":if(!this.open)return;this.requestClose();break;case"ArrowLeft":if(!o(i,0))return;break;case"ArrowRight":if(!o(-i,0))return;break;case"ArrowUp":if(!o(0,i))return;break;case"ArrowDown":if(!o(0,-i))return;break;default:return}n.preventDefault()},e),this.ownerDocument.defaultView.addEventListener("resize",()=>{let n=this.#d();if(n)this.#u(n),this.#f(n)},e)}}var ti=nr;function ir(e="b3-image-viewer"){if(typeof customElements>"u")return null;let t=customElements.get?.(e);if(t)return t;let r=ti;return ti=class extends nr{},customElements.define(e,r),r}ir();var aa=/(^|\s)([#@][\p{L}\p{N}_-]+)/gu,la=/(?:\s+[#@][\p{L}\p{N}_-]+)+\s*$/u,ca=350,Ie=()=>globalThis.crypto?.randomUUID?.()??Math.random().toString(36).slice(2,11),sr=(e)=>JSON.parse(JSON.stringify(Xn(e))),w=(e,t)=>e!=null&&String(e)===String(t),tt=(e)=>!!e&&typeof e==="object",C=(e)=>Array.isArray(e.subtasks)?e.subtasks:[],rt=(e)=>Array.isArray(e.comments)?e.comments:[];function da(e,t){if(e==null||e==="")return"";let r=new Date(typeof e==="string"?e.replace(" ","T"):e).getTime();if(!Number.isFinite(r))return"";let n=Math.max(0,Math.round((t-r)/60000));if(n<1)return"just now";for(let[i,o]of[["y",525600],["mo",43200],["w",10080],["d",1440],["h",60]])if(n>=o)return`${Math.floor(n/o)}${i} ago`;return`${n}m ago`}var li=(e)=>[...e.filter((t)=>t.starred),...e.filter((t)=>!t.starred)];function or(e){if(!Array.isArray(e))return[];let t=new Set,r=(n)=>{let{id:i}=n;if(!(typeof i==="string"&&i!==""||typeof i==="number"&&Number.isFinite(i))||t.has(String(i)))n.id=Ie();t.add(String(n.id))};return e.filter(tt).map((n)=>{r(n),n.cards=li(Array.isArray(n.cards)?n.cards.filter(tt):[]);for(let i of n.cards){if(r(i),Array.isArray(i.subtasks)){for(let o of i.subtasks)if(tt(o))r(o)}if(Array.isArray(i.comments)){for(let o of i.comments)if(tt(o))r(o)}}return n})}function ri(e,{field:t,id:r}){if(t==="name"){let n=e.findIndex((i)=>w(i.id,r));if(n>=0)e.splice(n,1);return}for(let n of e){let i=n.cards.findIndex((o)=>w(o.id,r));if(t==="title"&&i>=0)return void n.cards.splice(i,1);if(t==="subtask")for(let o of n.cards){let s=C(o),a=s.findIndex((l)=>w(l.id,r));if(a>=0)return void s.splice(a,1)}}}var ua=(e)=>e.toLowerCase().split(/\s+/).filter(Boolean);function fa(e){return[e.title??"",e.description??"",...C(e).map((t)=>t.title??""),...st(e)].join(`
|
|
42
42
|
`).toLowerCase()}function st(e){let t=new Set((e.tags??[]).map((n)=>(/^[#@]/.test(n)?n:`#${n}`).toLowerCase())),r=[e.title??"",e.description??"",...C(e).map((n)=>n.title??"")].join(`
|
|
43
43
|
`);for(let[,,n]of r.matchAll(aa))t.add(n.toLowerCase());return[...t]}var ni=String.raw`(<[^<>\n]+>|(?:[^()\n]|\([^()\n]*\))+)`,ha=new RegExp(String.raw`!\[([^\]\n]*)\]\(${ni}\)|\[([^\]\n]+)\]\(${ni}\)|\bhttps?:\/\/[^\s<>]+`,"giu"),pa=new Set(["javascript","data","vbscript","file","blob","about"]),ba=(e)=>{let t=e.trim();return t.startsWith("<")&&t.endsWith(">")?t.slice(1,-1):t.replace(/\s+"[^"\n]*"$/,"")};function ma(e,t=[]){if(/[\u0000-\u001f\u007f\\]/.test(e)||/\s/.test(e.replaceAll(" ",""))||e!==e.trim()||!e)return null;let r=/^([a-z][a-z\d+.-]*):/i.exec(e)?.[1].toLowerCase();if(r==="http"||r==="https"||r==="mailto")return{href:e,file:!1};if(r)return!pa.has(r)&&t.includes(r)?{href:e,file:!1}:null;return e.startsWith("//")?null:{href:e,file:!0}}var ii=(e)=>(e??"").toLowerCase().split(/[\s,]+/).map((t)=>t.replace(/:$/,"")).filter(Boolean);function lr(e,t=[]){let r=[],n=0;for(let i of e.matchAll(ha)){let o=i[2]!==void 0,[s]=i,a=o?i[1]:i[3],l=o?i[2]:i[4],c=i.index+s.length;if(!l){let u=s;for(;;){if(u=u.replace(/[.,;:!?'"\]]+$/u,""),!u.endsWith(")")||u.split("(").length>=u.split(")").length)break;u=u.slice(0,-1)}c-=s.length-u.length,s=a=l=u}else l=ba(l);let d=ma(l,t);if(!d||o&&!d.file&&!/^https?:/i.test(d.href))continue;if(i.index>n)r.push(e.slice(n,i.index));r.push({text:a,...d,...o?{image:o}:{}}),n=c}if(n<e.length)r.push(e.slice(n));return r}var si=(e,t=[])=>lr(e,t).map((r)=>typeof r==="string"?r:r.text).join(""),ar=null;function ga(e,t,r=[]){let n=e.ownerDocument;e.replaceChildren(...lr(t,r).map((i)=>{if(typeof i==="string")return n.createTextNode(i);let o=n.createElement("a");if(o.className="b3-board-ref",o.href=i.href,o.dataset.href=i.href,o.draggable=!1,i.image){let s=n.createElement("img");if(s.src=i.href,s.alt=i.text,s.loading="lazy",s.draggable=!1,o.classList.add("b3-board-image"),o.append(s),i.file)o.dataset.file="";else o.target="_blank",o.rel="noopener noreferrer";return o}if(i.file){if(o.dataset.file="",!ar){let s=n.createElement("template");s.innerHTML=wa,ar=s.content.firstElementChild}o.append(ar.cloneNode(!0))}else if(/^https?:/i.test(i.href))o.target="_blank",o.rel="noopener noreferrer";return o.append(i.text),o}))}var xa="b3-board-style",ya=`
|
|
44
44
|
:where(b3-board){--b3-board-hit:var(--b3-d-control,var(--b3-touch,2.75rem));--b3-board-chip:var(--b3-d-control-small,2rem);
|
|
@@ -174,6 +174,7 @@ b3-board{display:flex;flex-direction:column;min-inline-size:0;min-block-size:0;c
|
|
|
174
174
|
.b3-board-card:hover{border-color:color-mix(in srgb,var(--b3-color-accent) 30%,var(--b3-color-border));box-shadow:0 4px 14px color-mix(in srgb,var(--b3-color-text) 12%,transparent);}
|
|
175
175
|
.b3-board-card:not(:hover,:focus-within) :is(.b3-board-tools>.b3-board-remove:not([data-b3-armed]),.b3-board-star:not([aria-pressed="true"]),.b3-board-details,.b3-board-grip),
|
|
176
176
|
.b3-board-subtask:not(:hover,:focus-within) :is(.b3-board-remove,.b3-board-subtask-grip),
|
|
177
|
+
.b3-board-comment:not(:hover,:focus-within)>.b3-board-remove:not([data-b3-armed]),
|
|
177
178
|
.b3-board-column-header:not(:hover,:focus-within) .b3-board-remove:not([data-b3-armed]){opacity:0;}
|
|
178
179
|
}
|
|
179
180
|
@media (hover:none){.b3-board-grip{display:none;}}
|
|
@@ -303,8 +304,8 @@ b3-board [data-b3-drop="before"]{box-shadow:0 -3px 0 -1px var(--b3-color-accent)
|
|
|
303
304
|
</template>
|
|
304
305
|
<button type="button" class="b3-board-link b3-board-add" b3x-show="!readonly" b3x-on:click="addColumn()">${nt}<span>Add column</span></button>
|
|
305
306
|
</div>
|
|
306
|
-
<span class="b3-visually-hidden" role="status" b3x-text="announcement"></span>`;class ci extends De{static observedAttributes=["readonly","search","link-schemes","searchable"];#t=null;#e=null;#n=null;#o=null;#s=null;#i=!1;#a=null;#b=null;#r=null;#x=!1;#y=null;#E=0;#v=Math.random().toString(36).slice(2,8);#m=!1;#k=[];#l={past:[],future:[],now:null,key:"",at:0};#h=!1;get columns(){let e=sr(this.#e?.columns??this.#n??[]),t=this.#e?.editing;if(t?.fresh)ri(e,t);return e}set columns(e){let t=or(sr(e));if(!this.#e){this.#n=t;return}this.#p();let r=this.#e;if(r.columns=t,r.editing&&!this.#
|
|
307
|
-
`).map((d)=>si(d,s.schemes)).find((d)=>d.trim())?.trim()??(lr(l,s.schemes).some((d)=>typeof d!=="string"&&d.image)?"Image":"")},plain(a){return si(s.label(a),s.schemes)},rich(a,l){ga(a,String(l??""),s.schemes)},keyText(a,l,c,d){if(a.target!==a.currentTarget||a.key!=="Enter"&&a.key!==" ")return;a.preventDefault(),a.stopPropagation(),s.edit(l,c,d)},isOpen(a){let l=s.viewed[String(a.id)];return s.readonly&&l!==void 0?l:!!a.expanded},expanded(a){return String(s.isOpen(a))},isEditing(a,l){return!!s.editing&&s.editing.field===a&&s.editing.id===l},focusEditor(a){queueMicrotask(()=>n.#S(a))},blurEditor(a,l){if(s.isEditing(a,l))s.commit()},tokens(){let a=new Set;for(let l of s.columns)for(let c of l.cards)for(let d of st(c))a.add(d);return[...a].sort()},visible(a){let l=ua(s.search);if(!s.filter.length&&!l.length)return a.cards;let c=s.editing&&n.#
|
|
307
|
+
<span class="b3-visually-hidden" role="status" b3x-text="announcement"></span>`;class ci extends De{static observedAttributes=["readonly","search","link-schemes","searchable"];#t=null;#e=null;#n=null;#o=null;#s=null;#i=!1;#a=null;#b=null;#r=null;#x=!1;#y=null;#E=0;#v=Math.random().toString(36).slice(2,8);#m=!1;#k=[];#l={past:[],future:[],now:null,key:"",at:0};#h=!1;get columns(){let e=sr(this.#e?.columns??this.#n??[]),t=this.#e?.editing;if(t?.fresh)ri(e,t);return e}set columns(e){let t=or(sr(e));if(!this.#e){this.#n=t;return}this.#p();let r=this.#e;if(r.columns=t,r.editing&&!this.#c(r.editing.id))r.editing=null;if(!this.#h)this.#l={past:[],future:[],now:null,key:"",at:0};this.#l.now=this.columns}undo(){return this.#w(-1)}openSearch(){if(!this.#e?.searchable)return!1;return this.#e.openSearch(),!0}redo(){return this.#w(1)}get canUndo(){return!this.readonly&&(this.#l.past.length>0||!!this.#e?.editing)}get canRedo(){return!this.readonly&&this.#l.future.length>0}#w(e){let t=this.#e;if(!t||this.readonly)return!1;t.settle();let r=this.#l,i=(e<0?r.past:r.future).pop();if(!i||!r.now)return!1;(e<0?r.future:r.past).push(r.now),r.key="";let o=new Map(t.columns.flatMap((a)=>a.cards.map((l)=>[String(l.id),l.expanded]))),s=or(sr(i));for(let a of s)for(let l of a.cards){let c=o.get(String(l.id));if(o.has(String(l.id)))if(c)l.expanded=!0;else delete l.expanded}return this.#p(),t.columns=s,r.now=this.columns,this.#u(e<0?"Undone":"Redone"),this.#_({type:e<0?"undo":"redo"}),!0}#_(e){this.#h=!0;try{this.dispatchEvent(new CustomEvent("b3-change",{bubbles:!0,detail:{columns:this.columns,action:e}}))}finally{this.#h=!1}}get filter(){return[...this.#e?.filter??this.#o??[]]}set filter(e){let t=[...e??[]].map((r)=>String(r).toLowerCase());if(this.#e){if(t.join(" ")!==this.#e.filter.join(" "))this.#e.kept=[];this.#e.filter=t}else this.#o=t}get search(){return this.#e?.search??this.#s??""}set search(e){let t=String(e??"");if(this.#e){if(t!==this.#e.search)this.#e.kept=[];this.#e.search=t}else this.#s=t}get defaultColumn(){return this.getAttribute("default-column")??""}set defaultColumn(e){if(e)this.setAttribute("default-column",String(e));else this.removeAttribute("default-column")}addCard(e){let t=this.#e;if(!t||this.readonly)return!1;let r=e??this.defaultColumn,n=String(r).trim().toLowerCase(),i=r!==""&&(t.columns.find((o)=>w(o.id,r))??t.columns.find((o)=>String(o.name??"").trim().toLowerCase()===n))||(e===void 0?t.columns[0]:void 0);if(!i)return!1;return t.addCard(i),!0}get upload(){return this.#y}set upload(e){this.#y=typeof e==="function"?e:null}get readonly(){return this.hasAttribute("readonly")}set readonly(e){this.toggleAttribute("readonly",!!e)}connectedCallback(){for(let t of["columns","filter","search","defaultColumn","readonly","upload"]){if(!Object.hasOwn(this,t))continue;let r=this[t];delete this[t],this[t]=r}let e=this.ownerDocument;if(!this.#t&&e.readyState==="loading"){if(!this.#i)this.#i=!0,e.addEventListener("DOMContentLoaded",()=>{if(this.#i=!1,this.isConnected)this.connectedCallback()},{once:!0});return}if(Ne(e,xa,ya),ei(),!this.#t){let t=this.querySelector(':scope > script[type="application/json"]'),r=this.#n;if(!r&&t)try{r=or(JSON.parse(t.textContent||"[]"))}catch(n){console.warn("b3-board: ignoring unreadable JSON data",n)}this.#t=e.createElement("div"),this.#t.className="b3-board-ui",this.append(this.#t),this.#e=Zn(this.#t,Aa,this.#A(r??[],this.#o??[],this.#s??this.getAttribute("search")??"")),this.#n=this.#o=this.#s=null,this.#l.now=this.columns}else if(this.#t.parentNode!==this)this.append(this.#t);this.#b=new MutationObserver(()=>{if(this.#t&&this.#t.parentNode!==this)this.append(this.#t)}),this.#b.observe(this,{childList:!0}),this.#M(),fr(this,this.#a.signal,{role:"region"})}disconnectedCallback(){this.#p(),this.#a?.abort(),this.#a=null,this.#I(),this.#b?.disconnect(),this.#b=null}attributeChangedCallback(e,t,r){if(e==="search")return void(this.search=r??"");if(!this.#e)return;if(e==="link-schemes")return void(this.#e.schemes=ii(r));if(e==="searchable")return void(this.#e.searchable=r!==null);if(this.#e.readonly=this.readonly,this.#e.viewed={},this.readonly)this.#p(),this.#e.editing=null}#c(e){for(let t of this.#e?.columns??[]){if(w(t.id,e))return t;for(let r of t.cards)if(w(r.id,e)||C(r).some((n)=>w(n.id,e)))return r}return null}#g(e){let t="card"in e&&e.card!=null&&e.type!=="toggle"&&e.type!=="remove"?this.#c(e.card):null;if(t){if(t.updated=new Date().toISOString(),e.type==="add")t.created=t.updated}let r=this.#l,n=Date.now();if(e.type!=="toggle"){let i=e.type==="edit"?JSON.stringify([e.card,e.column,e.field,e.subtask]):"";if(r.now&&!(i&&i===r.key&&n-r.at<1000)){if(r.past.push(r.now),r.past.length>100)r.past.shift()}r.future=[],r.key=i,r.at=n}r.now=this.columns,this.#_(e)}#A(e,t,r){let n=this,i=(a)=>this.#g(a),o=(a)=>{for(let l of s.columns){let c=l.cards.findIndex((d)=>w(d.id,a));if(c>=0)return{column:l,index:c,card:l.cards[c]}}return null},s=Gn({columns:e,filter:t,search:r,kept:[],editing:null,announcement:"",readonly:n.readonly,searchable:n.hasAttribute("searchable"),searching:!1,schemes:ii(n.getAttribute("link-schemes")),viewed:{},tokensOf:st,subtasksOf:C,commentsOf:rt,now:Date.now(),ago(a){return da(a,s.now)},label(a){let l=String(a??"");return l.replace(la,"").trim()||l},pressed(a){return String(s.filter.includes(a))},mention(a){return a.startsWith("@")?"":null},starred(a){return String(!!a.starred)},hasDetails(a){return!!(a.description||C(a).length||rt(a).length)},complete(a){let l=C(a).length;return l>0&&s.done(a)===l},preview(a){let l=String(a.description??"");return l.split(`
|
|
308
|
+
`).map((d)=>si(d,s.schemes)).find((d)=>d.trim())?.trim()??(lr(l,s.schemes).some((d)=>typeof d!=="string"&&d.image)?"Image":"")},plain(a){return si(s.label(a),s.schemes)},rich(a,l){ga(a,String(l??""),s.schemes)},keyText(a,l,c,d){if(a.target!==a.currentTarget||a.key!=="Enter"&&a.key!==" ")return;a.preventDefault(),a.stopPropagation(),s.edit(l,c,d)},isOpen(a){let l=s.viewed[String(a.id)];return s.readonly&&l!==void 0?l:!!a.expanded},expanded(a){return String(s.isOpen(a))},isEditing(a,l){return!!s.editing&&s.editing.field===a&&s.editing.id===l},focusEditor(a){queueMicrotask(()=>n.#S(a))},blurEditor(a,l){if(s.isEditing(a,l))s.commit()},tokens(){let a=new Set;for(let l of s.columns)for(let c of l.cards)for(let d of st(c))a.add(d);return[...a].sort()},visible(a){let l=ua(s.search);if(!s.filter.length&&!l.length)return a.cards;let c=s.editing&&n.#c(s.editing.id);return a.cards.filter((d)=>{if(d===c||s.kept.some((b)=>w(d.id,b)))return!0;let u=st(d),p=l.length?fa(d):"";return s.filter.every((b)=>u.includes(b))&&l.every((b)=>p.includes(b))})},count(a){let l=s.visible(a).length;return l===a.cards.length?String(l):`${l}/${a.cards.length}`},done(a){return C(a).filter((l)=>l.done).length},disclosable(a){return!!(s.hasDetails(a)||!s.readonly)},toggleFilter(a){s.kept=[],s.filter=s.filter.includes(a)?s.filter.filter((l)=>l!==a):[...s.filter,a]},setFilter(a){s.kept=[],s.filter=a},searchShown(){return s.searching||!!s.search},openSearch(){s.searching=!0;let a=n.querySelector(".b3-board-search-input");if(!a)return;a.hidden=!1,a.closest(".b3-board-filters").hidden=!1,a.focus(),a.select()},typeSearch(a){n.search=a.target.value},keySearch(a){if(a.isComposing||a.keyCode===229)return;if(a.key!=="Escape"&&a.key!=="Enter")return;a.preventDefault(),a.stopPropagation();let l=a.target;if(a.key==="Escape")l.value="",n.search="";l.blur()},blurSearch(){s.searching=!1},toggleStar(a){let l=o(a.id);if(s.readonly||!l)return;if(a.starred)delete a.starred;else a.starred=!0;l.column.cards=li(l.column.cards);let c=!!a.starred;s.announcement=`${a.title??""} ${c?"starred":"unstarred"}`,i({type:"star",card:a.id,starred:c}),n.#T(a.id)},toggle(a){if(s.readonly){s.viewed={...s.viewed,[String(a.id)]:!s.isOpen(a)};return}a.expanded=!a.expanded,i({type:"toggle",card:a.id,expanded:a.expanded})},edit(a,l,c,d=!1,u=!1,p=!1){if(s.readonly||n.#r?.started)return;if(s.editing&&!s.isEditing(a,l))s.commit();s.editing={field:a,id:l,draft:c??"",fresh:d,opened:u,atEnd:p},n.#C()},addDetails(a,l=!1){if(s.readonly)return;let c=!a.expanded;a.expanded=!0,s.edit("description",a.id,String(a.description??""),!1,c,l)},keyEditor(a,l){if(a.stopPropagation(),a.key==="Escape")a.preventDefault(),s.cancel();else if(a.key==="Enter"&&!(l&&a.shiftKey)&&!a.isComposing)a.preventDefault(),s.commit(!0)},pasteEditor(a,l,c){let d=[...a.clipboardData?.files??[]].filter((u)=>u.type.startsWith("image/"));if(s.readonly||!n.upload||l!=="title"&&l!=="description"||!d.length)return;if(a.clipboardData?.getData("text/plain").trim())return;a.preventDefault();for(let u of d)n.#d(c,u,l==="description"?a.target:null)},cancel(){let a=s.editing;if(s.editing=null,a?.fresh)s.discard(a);if(a?.opened)s.close(a);n.#O(a)},close(a){let l=n.#c(a.id);if(l&&!s.hasDetails(l))l.expanded=!1},commit(a=!1){let l=s.editing;if(!l)return;if(s.editing=null,s.readonly)return;let c=l.field==="description"||l.field==="comment"?l.draft.trim():l.draft.replace(/\s+/g," ").trim(),d=n.#c(l.id);if(!d)return;if(!c&&l.fresh)return s.discard(l);if(!c&&l.opened)s.close(l);let u=null;if(l.field==="comment"){let b=d;if(c){let m={id:Ie(),at:new Date().toISOString(),by:n.getAttribute("author")||"you",text:c};b.comments=[...rt(b),m],u={type:"comment",card:b.id,comment:m.id,op:"add"}}}else if(l.field==="name"){let b=d;if(c&&c!==b.name)b.name=c,u={type:"edit",column:b.id,field:"name"};if(l.fresh)u={type:"add",column:b.id}}else if(l.field==="subtask"){let b=d,m=C(b).find((h)=>w(h.id,l.id));if(!c)return s.removeSubtask(b,m);if(c!==m.title)m.title=c,u={type:"edit",card:b.id,field:"subtask",subtask:m.id};if(l.fresh)u={type:"subtask",card:b.id,subtask:m.id,op:"add"}}else{let b=d,m=l.field;if((c||m==="description")&&c!==(b[m]??""))b[m]=c,u={type:"edit",card:b.id,field:m};if(l.fresh)u={type:"add",card:b.id,column:o(b.id).column.id},s.kept=[...s.kept,b.id]}if(u)i(u);let p=n.#c(l.id)??d;if(l.fresh&&l.field==="subtask"&&a)s.addSubtask(p);else if(l.fresh&&l.field==="title"&&a&&!n.hasAttribute("compact"))s.addDetails(p,!0);else n.#O(l)},discard(a){ri(s.columns,a)},settle(){if(s.editing)s.commit()},addCard(a){if(s.readonly)return;s.settle();let l={id:Ie(),title:""};a.cards.push(l),s.edit("title",l.id,"",!0)},addColumn(){if(s.readonly)return;s.settle();let a={id:Ie(),name:"",cards:[]};s.columns.push(a),s.edit("name",a.id,"",!0)},addSubtask(a){if(s.readonly)return;s.settle();let l={id:Ie(),title:"",done:!1};if(a.expanded=!0,!Array.isArray(a.subtasks))a.subtasks=[];a.subtasks.push(l),s.edit("subtask",l.id,"",!0)},removeCard(a,l){if(s.readonly)return;a.cards=a.cards.filter((c)=>c!==l),i({type:"remove",card:l.id,column:a.id})},removeColumn(a){if(s.readonly)return;s.columns=s.columns.filter((l)=>l!==a),i({type:"remove",column:a.id})},removeSubtask(a,l){if(s.readonly)return;a.subtasks=C(a).filter((c)=>c!==l),i({type:"subtask",card:a.id,subtask:l.id,op:"remove"})},removeComment(a,l){if(s.readonly)return;a.comments=rt(a).filter((c)=>c!==l),i({type:"comment",card:a.id,comment:l.id,op:"remove"})},check(a,l,c){if(s.readonly)return;l.done=c,i({type:"check",card:a.id,subtask:l.id,done:c})},keyCard(a,l){if(a.target!==a.currentTarget)return;if(a.key==="Enter")return a.preventDefault(),s.edit("title",l.id,l.title);if(!a.altKey||s.readonly)return;let c=o(l.id);if(!c)return;let d=getComputedStyle(n).direction==="rtl",u={ArrowUp:-1,ArrowDown:1,ArrowLeft:d?1:-1,ArrowRight:d?-1:1}[a.key];if(!u)return;if(a.preventDefault(),a.key==="ArrowUp"||a.key==="ArrowDown"){let b=s.visible(c.column),m=b[b.indexOf(c.card)+u];if(m&&!m.starred===!l.starred)n.moveCard(l.id,c.column.id,c.column.cards.indexOf(m));return}let p=s.columns[s.columns.indexOf(c.column)+u];if(p)n.moveCard(l.id,p.id,Math.min(c.index,p.cards.length))},keySubtask(a,l,c){s.keyText(a,"subtask",c.id,c.title);let d=a.key==="ArrowUp"?-1:a.key==="ArrowDown"?1:0;if(!a.altKey||!d||s.readonly)return;a.preventDefault(),a.stopPropagation(),n.#f(l,c.id,C(l).indexOf(c)+d)},keyColumn(a,l){if(!a.altKey||s.readonly)return;let c=getComputedStyle(n).direction==="rtl",d=a.key==="ArrowLeft"?c?1:-1:a.key==="ArrowRight"?c?-1:1:0;if(!d)return;a.preventDefault();let u=s.columns.indexOf(l)+d;if(u>=0&&u<s.columns.length)n.moveColumn(l.id,u)}});return s}async#d(e,t,r){let n=this.#e,i=()=>n.editing?.field==="description"&&w(n.editing.id,e)?n.editing:null,o=`![Uploading image ${this.#v}-${++this.#E}…]()`,s="",a=i();if(a&&r){let{selectionStart:f,selectionEnd:x}=r;s=f&&r.value[f-1]!==`
|
|
308
309
|
`?`
|
|
309
|
-
${o}`:o,a.draft=r.value=r.value.slice(0,
|
|
310
|
-
${d}`:d:h;let x=u(h);return x?h.slice(0,x[0])+x[2]+h.slice(x[1]):h},m=i();if(m){let h=this.querySelector("textarea.b3-board-editor"),x=h?.value===m.draft&&u(h.value);if(h&&x){let[H,ie,ot]=x,{selectionStart:di,selectionEnd:ui,selectionDirection:fi}=h,cr=(Le)=>Le>=ie?Le+ot.length-(ie-H):Le>H?H+ot.length:Le;h.setRangeText(ot,H,ie),h.setSelectionRange(cr(di),cr(ui),fi??void 0),m.draft=h.value}else if(f(m.draft)!==m.draft)m.draft=f(m.draft);else if(d)this.#d("Image not added");return}let g=this.#f(e);if(s&&!String(g?.description??"").includes(o))g=n.columns.flatMap((h)=>h.cards).find((h)=>String(h.description??"").includes(o))??g;let p=String(g?.description??""),b=f(p).trim();if(!g||this.readonly||b===p.trim()){if(d)this.#d("Image not added");return}g.description=b,g.expanded=!0,this.#g({type:"edit",card:g.id,field:"description"})}#d(e){let t=this.#e;t.announcement="",requestAnimationFrame(()=>{if(!t.announcement)t.announcement=e})}moveCard(e,t,r){let n=this.#e;if(!n||this.readonly)return!1;let i=n.columns.find((u)=>u.cards.some((f)=>w(f.id,e))),o=n.columns.find((u)=>w(u.id,t));if(!i||!o)return!1;let s=i.cards.findIndex((u)=>w(u.id,e)),[a]=i.cards.splice(s,1),l=o.cards.filter((u)=>u.starred).length,c=Math.max(0,Math.min(o.cards.length,r)),d=a.starred?Math.min(c,l):Math.max(c,l);if(o.cards.splice(d,0,a),i===o&&s===d)return!1;return n.announcement=`${a.title??""} moved to ${o.name??""}, position ${d+1} of ${o.cards.length}`,this.#g({type:"move",card:a.id,from:i.id,to:o.id,index:d}),this.#T(a.id),!0}moveColumn(e,t){let r=this.#e;if(!r||this.readonly)return!1;let n=r.columns.findIndex((s)=>w(s.id,e));if(n<0)return!1;let[i]=r.columns.splice(n,1),o=Math.max(0,Math.min(r.columns.length,t));if(r.columns.splice(o,0,i),n===o)return!1;return r.announcement=`${i.name??""} moved to position ${o+1} of ${r.columns.length}`,this.#g({type:"reorder",column:i.id,index:o}),queueMicrotask(()=>this.querySelector(`[data-column="${CSS.escape(String(i.id))}"] .b3-board-column-name`)?.focus()),!0}#u(e,t,r){let n=this.#e,i=C(e),o=i.findIndex((l)=>w(l.id,t));if(!n||this.readonly||o<0)return!1;let s=Math.max(0,Math.min(i.length-1,r));if(o===s)return!1;let[a]=i.splice(o,1);return i.splice(s,0,a),n.announcement=`${a.title??""} moved to position ${s+1} of ${i.length}`,this.#g({type:"subtask",card:e.id,subtask:a.id,op:"move",index:s}),requestAnimationFrame(()=>this.querySelector(`[data-subtask="${CSS.escape(String(a.id))}"] .b3-board-title`)?.focus()),!0}#S(e){if(!e.isConnected)return;e.focus({preventScroll:!0}),e.select();let t=e.closest(".b3-board-card-head")?e.closest(".b3-board-card"):e.closest(".b3-board-column-header")?e.closest(".b3-board-column"):e.parentElement?.matches(".b3-board-body")?e.parentElement:e,r=()=>t.scrollIntoView({block:"nearest",inline:"nearest"});requestAnimationFrame(r);let n=this.ownerDocument.defaultView;if(!n)return;let i=new AbortController,o=()=>({height:n.visualViewport?.height??n.innerHeight,scale:n.visualViewport?.scale??1}),s=o(),a=()=>{if(!e.isConnected||this.ownerDocument.activeElement!==e)return i.abort();let l=o(),c=l.scale===s.scale&&l.height<s.height;if(s=l,!c)return;if(r(),t!==e)e.scrollIntoView({block:"nearest",inline:"nearest"})};for(let l of[n,n.visualViewport])l?.addEventListener("resize",a,{signal:i.signal});e.addEventListener("blur",()=>i.abort(),{signal:i.signal,once:!0})}#C(){let e=this.ownerDocument,t=e.activeElement;if(!e.defaultView?.matchMedia("(pointer: coarse)").matches||t?.matches("textarea, input"))return;let r=this.#t?.querySelector(":scope > .b3-board-holder");if(!r)r=e.createElement("textarea"),r.className="b3-board-holder",r.tabIndex=-1,r.setAttribute("aria-hidden","true"),this.#t?.append(r);r.focus({preventScroll:!0}),requestAnimationFrame(()=>requestAnimationFrame(()=>{if(e.activeElement===r)r.blur()}))}#T(e){requestAnimationFrame(()=>this.querySelector(`[data-card="${CSS.escape(String(e))}"]`)?.focus({preventScroll:!1}))}#O(e){if(!e)return;let t=CSS.escape(String(e.id));requestAnimationFrame(()=>{if(this.contains(this.ownerDocument.activeElement)&&this.ownerDocument.activeElement!==this.ownerDocument.body)return;let r=e.field==="name"?`[data-column="${t}"] .b3-board-column-name`:e.field==="subtask"?null:`[data-card="${t}"]`;if(r)this.querySelector(r)?.focus({preventScroll:!0})})}#M(){this.#a?.abort(),this.#a=new AbortController;let e=this.#a.signal,t=this.ownerDocument.defaultView,r=t.setInterval(()=>{if(this.#e)this.#e.now=Date.now()},60000);e.addEventListener("abort",()=>t.clearInterval(r)),this.addEventListener("pointerdown",(o)=>this.#$(o),{signal:e}),t.addEventListener("pointermove",(o)=>this.#R(o),{signal:e}),t.addEventListener("pointerup",(o)=>this.#z(o),{signal:e}),t.addEventListener("pointercancel",(o)=>{if(o.pointerId===this.#r?.pointerId)this.#p()},{signal:e}),t.addEventListener("keydown",(o)=>{if(o.key==="Escape"&&this.#r?.started)o.preventDefault(),this.#p()},{signal:e}),this.addEventListener("touchmove",(o)=>{if(this.#r?.started)o.preventDefault()},{signal:e,passive:!1}),this.addEventListener("contextmenu",(o)=>{if(this.#r)o.preventDefault()},{signal:e}),this.addEventListener("click",(o)=>{if(!this.#x)return;this.#x=!1,o.preventDefault(),o.stopImmediatePropagation()},{signal:e,capture:!0}),this.addEventListener("keydown",(o)=>{if(o.defaultPrevented||o.altKey||!(o.metaKey||o.ctrlKey))return;if(o.target.closest?.('input, textarea, select, [contenteditable]:not([contenteditable="false"])'))return;let s=o.key.toLowerCase(),a=s==="y"||s==="z"&&o.shiftKey;if(s!=="z"&&s!=="y")return;if(o.preventDefault(),a)this.redo();else this.undo()},{signal:e});let n=(o)=>this.#B(o);this.addEventListener("click",n,{signal:e,capture:!0}),this.addEventListener("auxclick",(o)=>{if(o.button===1)n(o)},{signal:e,capture:!0});let i=()=>this.#I();this.addEventListener("compositionstart",()=>{this.#m=!0},{signal:e}),this.addEventListener("compositionend",i,{signal:e}),this.addEventListener("focusout",i,{signal:e})}#I(){this.#m=!1;for(let e of this.#k.splice(0))e()}#B(e){let t=e.target.closest?.("a.b3-board-ref");if(!t||!this.contains(t))return;e.stopPropagation();let r=(c)=>t.closest(c),n=this.#e?.columns.find((c)=>w(c.id,r("[data-column]")?.dataset.column)),i=n?.cards.find((c)=>w(c.id,r("[data-card]")?.dataset.card)),o=i&&C(i).find((c)=>w(c.id,r("[data-subtask]")?.dataset.subtask)),s={href:t.dataset.href??"",text:t.textContent??"",file:t.hasAttribute("data-file"),newTab:e.metaKey||e.ctrlKey||e.shiftKey||e.button===1,card:i?.id,column:n?.id};if(o)s.subtask=o.id;let a=t.querySelector("img");if(a&&!s.newTab&&e.type==="click"){e.preventDefault(),this.#P(t,a,s);return}if(!t.dispatchEvent(new CustomEvent("b3-link",{bubbles:!0,cancelable:!0,detail:s}))||s.file)e.preventDefault()}#P(e,t,r){let n=this.ownerDocument;n.body.querySelector(":scope > .b3-board-lightbox")?.dispatchEvent(new CustomEvent("b3-close")),ir();let i=n.createElement("b3-image-viewer");i.className="b3-board-lightbox",i.setAttribute("alt",t.alt||"Image"),i.setAttribute("role","dialog"),i.setAttribute("aria-modal","true");let o=n.createElement("img");o.src=t.currentSrc||t.src,o.alt=t.alt;let s=n.createElement("button");s.type="button",s.className="b3-board-lightbox-open",s.textContent="Open",i.append(o,s);let a=n.activeElement,l=[...n.body.children].filter((d)=>d instanceof HTMLElement&&!d.inert),c=()=>{i.remove();for(let d of l)d.inert=!1;if(e.isConnected)e.focus({preventScroll:!0});else a?.focus?.({preventScroll:!0})};i.addEventListener("b3-close",c),i.addEventListener("click",(d)=>{if(d.target===i)c()}),s.addEventListener("pointerdown",(d)=>d.stopPropagation()),s.addEventListener("click",(d)=>{if(d.stopPropagation(),c(),e.dispatchEvent(new CustomEvent("b3-link",{bubbles:!0,cancelable:!0,detail:{...r}}))&&!r.file)this.ownerDocument.defaultView?.open(r.href,"_blank","noopener")}),n.body.append(i);for(let d of l)d.inert=!0;i.setAttribute("open",""),i.focus({preventScroll:!0})}#$(e){if(this.readonly||this.#r||!e.isPrimary||e.button!==0||this.#e?.editing)return;let t=e.target,r=t.closest(".b3-board-subtask-grip")?.closest(".b3-board-subtask"),n;if(r)n={kind:"subtask",id:r.dataset.subtask,card:r.closest(".b3-board-card").dataset.card,node:r,pointerId:e.pointerId,x:e.clientX,y:e.clientY,started:!1,hold:0};else{if(t.closest("input, textarea, select, a, .b3-board-quiet, .b3-board-chip, .b3-board-link, .b3-board-toggle, .b3-board-description"))return;let i=t.closest(".b3-board-card"),o=!i&&t.closest(".b3-board-column-header")?t.closest(".b3-board-column"):null,s=i??o;if(!s)return;n={kind:i?"card":"column",id:i?i.dataset.card:o.dataset.column,node:s,pointerId:e.pointerId,x:e.clientX,y:e.clientY,started:!1,hold:0}}if(!this.contains(n.node))return;if(this.#r=n,e.pointerType!=="mouse")n.hold=window.setTimeout(()=>{if(this.#r===n)this.#L(e.clientX,e.clientY)},ca)}#L(e,t){let r=this.#r;r.started=!0;let n=r.node.getBoundingClientRect(),i=r.node.cloneNode(!0);i.classList.add("b3-board-ghost"),i.removeAttribute("data-b3-dragging");for(let s of[i,...i.querySelectorAll("[id]")])s.removeAttribute("id");i.setAttribute("aria-hidden","true"),Object.assign(i.style,{inlineSize:`${n.width}px`,left:`${n.left}px`,top:`${n.top}px`}),r.dx=e-n.left,r.dy=t-n.top,r.ghost=i,this.#t.append(i),r.node.setAttribute("data-b3-dragging",""),this.ownerDocument.getSelection()?.removeAllRanges(),r.px=e,r.py=t;let o=()=>{if(this.#r!==r)return;this.#U(r.px,r.py),this.#H(this.#D(r.px,r.py)),r.frame=requestAnimationFrame(o)};r.frame=requestAnimationFrame(o)}#R(e){let t=this.#r;if(!t||e.pointerId!==t.pointerId)return;if(!t.started){let r=Math.hypot(e.clientX-t.x,e.clientY-t.y);if(e.pointerType!=="mouse"){if(r>8)this.#p();return}if(r<5)return;this.#L(e.clientX,e.clientY)}e.preventDefault(),t.ghost.style.left=`${e.clientX-t.dx}px`,t.ghost.style.top=`${e.clientY-t.dy}px`,t.px=e.clientX,t.py=e.clientY}#z(e){let t=this.#r;if(!t||e.pointerId!==t.pointerId)return;if(!t.started)return this.#p();let r=this.#D(e.clientX,e.clientY);if(this.#p(),this.#x=!0,setTimeout(()=>{this.#x=!1},0),!r)return;let n=this.#e;if(t.kind==="card"){let i=n.columns.find((l)=>w(l.id,r.column)),o=n.columns.find((l)=>l.cards.some((c)=>w(c.id,t.id))),s=r.before?i.cards.findIndex((l)=>w(l.id,r.before)):i.cards.length,a=o.cards.findIndex((l)=>w(l.id,t.id));if(o===i&&a<s)s-=1;this.moveCard(t.id,i.id,s)}else if(t.kind==="subtask"){let i=this.#f(t.card);if(!i)return;let o=C(i),s=r.before?o.findIndex((a)=>w(a.id,r.before)):o.length;if(o.findIndex((a)=>w(a.id,t.id))<s)s-=1;this.#u(i,t.id,s)}else{let i=r.before?n.columns.findIndex((s)=>w(s.id,r.before)):n.columns.length;if(n.columns.findIndex((s)=>w(s.id,t.id))<i)i-=1;this.moveColumn(t.id,i)}}#D(e,t){let r=this.#r,n=this.ownerDocument.elementFromPoint(e,t);if(!n||!this.contains(n))return null;if(r.kind==="card"){let l=this.#N(e,n);if(!l)return null;let c=l.querySelector(".b3-board-cards"),d=[...c.querySelectorAll(":scope > .b3-board-card:not([data-b3-dragging])")],u=d.find((m)=>{let g=m.getBoundingClientRect();return t<g.top+g.height/2}),f=(m)=>!!(m!=null&&this.#f(m)?.starred);if(f(u?.dataset.card)!==f(r.id)&&(u||f(r.id)))u=d.find((m)=>!f(m.dataset.card));return{column:l.dataset.column,before:u?.dataset.card??null,list:c}}if(r.kind==="subtask"){let l=r.node.parentElement;return{column:"",before:[...l.querySelectorAll(":scope > .b3-board-subtask:not([data-b3-dragging])")].find((u)=>{let f=u.getBoundingClientRect();return t<f.top+f.height/2})?.dataset.subtask??null,list:l}}let i=this.querySelector(".b3-board-columns"),o=[...i.querySelectorAll(":scope > .b3-board-column:not([data-b3-dragging])")],s=getComputedStyle(this).direction==="rtl";return{column:"",before:o.find((l)=>{let c=l.getBoundingClientRect();return s?e>c.left+c.width/2:e<c.left+c.width/2})?.dataset.column??null,list:i}}#H(e){for(let n of this.querySelectorAll("[data-b3-drop]"))n.removeAttribute("data-b3-drop");if(!e)return;let t=`[data-${this.#r.kind}="${CSS.escape(e.before??"")}"]`,r=e.before?e.list.querySelector(t):null;(r??e.list).setAttribute("data-b3-drop",r?"before":"end")}#N(e,t){return t?.closest(".b3-board-column")??[...this.querySelectorAll(".b3-board-column")].find((r)=>{let n=r.getBoundingClientRect();return e>=n.left&&e<=n.right})}#U(e,t){let r=(s,a,l)=>s<a+40?-12:s>l-40?12:0,n=this.querySelector(".b3-board-columns");if(n){let s=n.getBoundingClientRect();n.scrollLeft+=r(e,s.left,s.right)}let i=this.#r?.kind==="card"?this.#N(e,this.ownerDocument.elementFromPoint(e,t))?.querySelector(".b3-board-cards"):null;if(i&&i.scrollHeight>i.clientHeight){let s=i.getBoundingClientRect();i.scrollTop+=r(t,s.top,s.bottom)}let o=this.ownerDocument.defaultView;o.scrollBy(0,r(t,0,o.innerHeight))}#p(){let e=this.#r;if(!e)return;this.#r=null,clearTimeout(e.hold),cancelAnimationFrame(e.frame??0),e.ghost?.remove(),e.node.removeAttribute("data-b3-dragging");for(let t of this.querySelectorAll("[data-b3-drop]"))t.removeAttribute("data-b3-drop")}}ur("b3-board",ci);export{ci as B3Board};
|
|
310
|
+
${o}`:o,a.draft=r.value=r.value.slice(0,f)+s+r.value.slice(x),r.setSelectionRange(f+s.length,f+s.length)}let l=n.columns.find((f)=>f.cards.some((x)=>w(x.id,e))),c=null;try{c=await this.#y?.(t,{card:e,column:l?.id})}catch(f){console.warn("b3-board: image upload failed",f)}let d=c?`.replace(/[\s()]/g,(f)=>`%${f.charCodeAt(0).toString(16).toUpperCase().padStart(2,"0")}`)})`:"";if(!d)this.#u("Image not added");while(this.#m)await new Promise((f)=>this.#k.push(f));let u=(f)=>{if(!s)return null;let x=f.indexOf(s),H=x>=0?x:f.indexOf(o);if(H<0)return null;let ie=x>=0?s:o;return[H,H+ie.length,d?ie.replace(o,d):""]},p=(f)=>{if(!s)return d?f.trim()?`${f.replace(/\s+$/,"")}
|
|
311
|
+
${d}`:d:f;let x=u(f);return x?f.slice(0,x[0])+x[2]+f.slice(x[1]):f},b=i();if(b){let f=this.querySelector("textarea.b3-board-editor"),x=f?.value===b.draft&&u(f.value);if(f&&x){let[H,ie,ot]=x,{selectionStart:di,selectionEnd:ui,selectionDirection:fi}=f,cr=(Le)=>Le>=ie?Le+ot.length-(ie-H):Le>H?H+ot.length:Le;f.setRangeText(ot,H,ie),f.setSelectionRange(cr(di),cr(ui),fi??void 0),b.draft=f.value}else if(p(b.draft)!==b.draft)b.draft=p(b.draft);else if(d)this.#u("Image not added");return}let m=this.#c(e);if(s&&!String(m?.description??"").includes(o))m=n.columns.flatMap((f)=>f.cards).find((f)=>String(f.description??"").includes(o))??m;let h=String(m?.description??""),g=p(h).trim();if(!m||this.readonly||g===h.trim()){if(d)this.#u("Image not added");return}m.description=g,m.expanded=!0,this.#g({type:"edit",card:m.id,field:"description"})}#u(e){let t=this.#e;t.announcement="",requestAnimationFrame(()=>{if(!t.announcement)t.announcement=e})}moveCard(e,t,r){let n=this.#e;if(!n||this.readonly)return!1;let i=n.columns.find((u)=>u.cards.some((p)=>w(p.id,e))),o=n.columns.find((u)=>w(u.id,t));if(!i||!o)return!1;let s=i.cards.findIndex((u)=>w(u.id,e)),[a]=i.cards.splice(s,1),l=o.cards.filter((u)=>u.starred).length,c=Math.max(0,Math.min(o.cards.length,r)),d=a.starred?Math.min(c,l):Math.max(c,l);if(o.cards.splice(d,0,a),i===o&&s===d)return!1;return n.announcement=`${a.title??""} moved to ${o.name??""}, position ${d+1} of ${o.cards.length}`,this.#g({type:"move",card:a.id,from:i.id,to:o.id,index:d}),this.#T(a.id),!0}moveColumn(e,t){let r=this.#e;if(!r||this.readonly)return!1;let n=r.columns.findIndex((s)=>w(s.id,e));if(n<0)return!1;let[i]=r.columns.splice(n,1),o=Math.max(0,Math.min(r.columns.length,t));if(r.columns.splice(o,0,i),n===o)return!1;return r.announcement=`${i.name??""} moved to position ${o+1} of ${r.columns.length}`,this.#g({type:"reorder",column:i.id,index:o}),queueMicrotask(()=>this.querySelector(`[data-column="${CSS.escape(String(i.id))}"] .b3-board-column-name`)?.focus()),!0}#f(e,t,r){let n=this.#e,i=C(e),o=i.findIndex((l)=>w(l.id,t));if(!n||this.readonly||o<0)return!1;let s=Math.max(0,Math.min(i.length-1,r));if(o===s)return!1;let[a]=i.splice(o,1);return i.splice(s,0,a),n.announcement=`${a.title??""} moved to position ${s+1} of ${i.length}`,this.#g({type:"subtask",card:e.id,subtask:a.id,op:"move",index:s}),requestAnimationFrame(()=>this.querySelector(`[data-subtask="${CSS.escape(String(a.id))}"] .b3-board-title`)?.focus()),!0}#S(e){if(!e.isConnected)return;if(e.focus({preventScroll:!0}),this.#e?.editing?.atEnd)e.setSelectionRange(e.value.length,e.value.length);else e.select();let t=e.closest(".b3-board-card-head")?e.closest(".b3-board-card"):e.closest(".b3-board-column-header")?e.closest(".b3-board-column"):e.parentElement?.matches(".b3-board-body")?e.parentElement:e,r=()=>t.scrollIntoView({block:"nearest",inline:"nearest"});requestAnimationFrame(r);let n=this.ownerDocument.defaultView;if(!n)return;let i=new AbortController,o=()=>({height:n.visualViewport?.height??n.innerHeight,scale:n.visualViewport?.scale??1}),s=o(),a=()=>{if(!e.isConnected||this.ownerDocument.activeElement!==e)return i.abort();let l=o(),c=l.scale===s.scale&&l.height<s.height;if(s=l,!c)return;if(r(),t!==e)e.scrollIntoView({block:"nearest",inline:"nearest"})};for(let l of[n,n.visualViewport])l?.addEventListener("resize",a,{signal:i.signal});e.addEventListener("blur",()=>i.abort(),{signal:i.signal,once:!0})}#C(){let e=this.ownerDocument,t=e.activeElement;if(!e.defaultView?.matchMedia("(pointer: coarse)").matches||t?.matches("textarea, input"))return;let r=this.#t?.querySelector(":scope > .b3-board-holder");if(!r)r=e.createElement("textarea"),r.className="b3-board-holder",r.tabIndex=-1,r.setAttribute("aria-hidden","true"),this.#t?.append(r);r.focus({preventScroll:!0}),requestAnimationFrame(()=>requestAnimationFrame(()=>{if(e.activeElement===r)r.blur()}))}#T(e){requestAnimationFrame(()=>this.querySelector(`[data-card="${CSS.escape(String(e))}"]`)?.focus({preventScroll:!1}))}#O(e){if(!e)return;let t=CSS.escape(String(e.id));requestAnimationFrame(()=>{if(this.contains(this.ownerDocument.activeElement)&&this.ownerDocument.activeElement!==this.ownerDocument.body)return;let r=e.field==="name"?`[data-column="${t}"] .b3-board-column-name`:e.field==="subtask"?null:`[data-card="${t}"]`;if(r)this.querySelector(r)?.focus({preventScroll:!0})})}#M(){this.#a?.abort(),this.#a=new AbortController;let e=this.#a.signal,t=this.ownerDocument.defaultView,r=t.setInterval(()=>{if(this.#e)this.#e.now=Date.now()},60000);e.addEventListener("abort",()=>t.clearInterval(r)),this.addEventListener("pointerdown",(o)=>this.#$(o),{signal:e}),t.addEventListener("pointermove",(o)=>this.#R(o),{signal:e}),t.addEventListener("pointerup",(o)=>this.#z(o),{signal:e}),t.addEventListener("pointercancel",(o)=>{if(o.pointerId===this.#r?.pointerId)this.#p()},{signal:e}),t.addEventListener("keydown",(o)=>{if(o.key==="Escape"&&this.#r?.started)o.preventDefault(),this.#p()},{signal:e}),this.addEventListener("touchmove",(o)=>{if(this.#r?.started)o.preventDefault()},{signal:e,passive:!1}),this.addEventListener("contextmenu",(o)=>{if(this.#r)o.preventDefault()},{signal:e}),this.addEventListener("click",(o)=>{if(!this.#x)return;this.#x=!1,o.preventDefault(),o.stopImmediatePropagation()},{signal:e,capture:!0}),this.addEventListener("keydown",(o)=>{if(o.defaultPrevented||o.altKey||!(o.metaKey||o.ctrlKey))return;if(o.target.closest?.('input, textarea, select, [contenteditable]:not([contenteditable="false"])'))return;let s=o.key.toLowerCase(),a=s==="y"||s==="z"&&o.shiftKey;if(s!=="z"&&s!=="y")return;if(o.preventDefault(),a)this.redo();else this.undo()},{signal:e});let n=(o)=>this.#B(o);this.addEventListener("click",n,{signal:e,capture:!0}),this.addEventListener("auxclick",(o)=>{if(o.button===1)n(o)},{signal:e,capture:!0});let i=()=>this.#I();this.addEventListener("compositionstart",()=>{this.#m=!0},{signal:e}),this.addEventListener("compositionend",i,{signal:e}),this.addEventListener("focusout",i,{signal:e})}#I(){this.#m=!1;for(let e of this.#k.splice(0))e()}#B(e){let t=e.target.closest?.("a.b3-board-ref");if(!t||!this.contains(t))return;e.stopPropagation();let r=(c)=>t.closest(c),n=this.#e?.columns.find((c)=>w(c.id,r("[data-column]")?.dataset.column)),i=n?.cards.find((c)=>w(c.id,r("[data-card]")?.dataset.card)),o=i&&C(i).find((c)=>w(c.id,r("[data-subtask]")?.dataset.subtask)),s={href:t.dataset.href??"",text:t.textContent??"",file:t.hasAttribute("data-file"),newTab:e.metaKey||e.ctrlKey||e.shiftKey||e.button===1,card:i?.id,column:n?.id};if(o)s.subtask=o.id;let a=t.querySelector("img");if(a&&!s.newTab&&e.type==="click"){e.preventDefault(),this.#P(t,a,s);return}if(!t.dispatchEvent(new CustomEvent("b3-link",{bubbles:!0,cancelable:!0,detail:s}))||s.file)e.preventDefault()}#P(e,t,r){let n=this.ownerDocument;n.body.querySelector(":scope > .b3-board-lightbox")?.dispatchEvent(new CustomEvent("b3-close")),ir();let i=n.createElement("b3-image-viewer");i.className="b3-board-lightbox",i.setAttribute("alt",t.alt||"Image"),i.setAttribute("role","dialog"),i.setAttribute("aria-modal","true");let o=n.createElement("img");o.src=t.currentSrc||t.src,o.alt=t.alt;let s=n.createElement("button");s.type="button",s.className="b3-board-lightbox-open",s.textContent="Open",i.append(o,s);let a=n.activeElement,l=[...n.body.children].filter((d)=>d instanceof HTMLElement&&!d.inert),c=()=>{i.remove();for(let d of l)d.inert=!1;if(e.isConnected)e.focus({preventScroll:!0});else a?.focus?.({preventScroll:!0})};i.addEventListener("b3-close",c),i.addEventListener("click",(d)=>{if(d.target===i)c()}),s.addEventListener("pointerdown",(d)=>d.stopPropagation()),s.addEventListener("click",(d)=>{if(d.stopPropagation(),c(),e.dispatchEvent(new CustomEvent("b3-link",{bubbles:!0,cancelable:!0,detail:{...r}}))&&!r.file)this.ownerDocument.defaultView?.open(r.href,"_blank","noopener")}),n.body.append(i);for(let d of l)d.inert=!0;i.setAttribute("open",""),i.focus({preventScroll:!0})}#$(e){if(this.readonly||this.#r||!e.isPrimary||e.button!==0||this.#e?.editing)return;let t=e.target,r=t.closest(".b3-board-subtask-grip")?.closest(".b3-board-subtask"),n;if(r)n={kind:"subtask",id:r.dataset.subtask,card:r.closest(".b3-board-card").dataset.card,node:r,pointerId:e.pointerId,x:e.clientX,y:e.clientY,started:!1,hold:0};else{if(t.closest("input, textarea, select, a, .b3-board-quiet, .b3-board-chip, .b3-board-link, .b3-board-toggle, .b3-board-description"))return;let i=t.closest(".b3-board-card"),o=!i&&t.closest(".b3-board-column-header")?t.closest(".b3-board-column"):null,s=i??o;if(!s)return;n={kind:i?"card":"column",id:i?i.dataset.card:o.dataset.column,node:s,pointerId:e.pointerId,x:e.clientX,y:e.clientY,started:!1,hold:0}}if(!this.contains(n.node))return;if(this.#r=n,e.pointerType!=="mouse")n.hold=window.setTimeout(()=>{if(this.#r===n)this.#L(e.clientX,e.clientY)},ca)}#L(e,t){let r=this.#r;r.started=!0;let n=r.node.getBoundingClientRect(),i=r.node.cloneNode(!0);i.classList.add("b3-board-ghost"),i.removeAttribute("data-b3-dragging");for(let s of[i,...i.querySelectorAll("[id]")])s.removeAttribute("id");i.setAttribute("aria-hidden","true"),Object.assign(i.style,{inlineSize:`${n.width}px`,left:`${n.left}px`,top:`${n.top}px`}),r.dx=e-n.left,r.dy=t-n.top,r.ghost=i,this.#t.append(i),r.node.setAttribute("data-b3-dragging",""),this.ownerDocument.getSelection()?.removeAllRanges(),r.px=e,r.py=t;let o=()=>{if(this.#r!==r)return;this.#U(r.px,r.py),this.#H(this.#D(r.px,r.py)),r.frame=requestAnimationFrame(o)};r.frame=requestAnimationFrame(o)}#R(e){let t=this.#r;if(!t||e.pointerId!==t.pointerId)return;if(!t.started){let r=Math.hypot(e.clientX-t.x,e.clientY-t.y);if(e.pointerType!=="mouse"){if(r>8)this.#p();return}if(r<5)return;this.#L(e.clientX,e.clientY)}e.preventDefault(),t.ghost.style.left=`${e.clientX-t.dx}px`,t.ghost.style.top=`${e.clientY-t.dy}px`,t.px=e.clientX,t.py=e.clientY}#z(e){let t=this.#r;if(!t||e.pointerId!==t.pointerId)return;if(!t.started)return this.#p();let r=this.#D(e.clientX,e.clientY);if(this.#p(),this.#x=!0,setTimeout(()=>{this.#x=!1},0),!r)return;let n=this.#e;if(t.kind==="card"){let i=n.columns.find((l)=>w(l.id,r.column)),o=n.columns.find((l)=>l.cards.some((c)=>w(c.id,t.id))),s=r.before?i.cards.findIndex((l)=>w(l.id,r.before)):i.cards.length,a=o.cards.findIndex((l)=>w(l.id,t.id));if(o===i&&a<s)s-=1;this.moveCard(t.id,i.id,s)}else if(t.kind==="subtask"){let i=this.#c(t.card);if(!i)return;let o=C(i),s=r.before?o.findIndex((a)=>w(a.id,r.before)):o.length;if(o.findIndex((a)=>w(a.id,t.id))<s)s-=1;this.#f(i,t.id,s)}else{let i=r.before?n.columns.findIndex((s)=>w(s.id,r.before)):n.columns.length;if(n.columns.findIndex((s)=>w(s.id,t.id))<i)i-=1;this.moveColumn(t.id,i)}}#D(e,t){let r=this.#r,n=this.ownerDocument.elementFromPoint(e,t);if(!n||!this.contains(n))return null;if(r.kind==="card"){let l=this.#N(e,n);if(!l)return null;let c=l.querySelector(".b3-board-cards"),d=[...c.querySelectorAll(":scope > .b3-board-card:not([data-b3-dragging])")],u=d.find((b)=>{let m=b.getBoundingClientRect();return t<m.top+m.height/2}),p=(b)=>!!(b!=null&&this.#c(b)?.starred);if(p(u?.dataset.card)!==p(r.id)&&(u||p(r.id)))u=d.find((b)=>!p(b.dataset.card));return{column:l.dataset.column,before:u?.dataset.card??null,list:c}}if(r.kind==="subtask"){let l=r.node.parentElement;return{column:"",before:[...l.querySelectorAll(":scope > .b3-board-subtask:not([data-b3-dragging])")].find((u)=>{let p=u.getBoundingClientRect();return t<p.top+p.height/2})?.dataset.subtask??null,list:l}}let i=this.querySelector(".b3-board-columns"),o=[...i.querySelectorAll(":scope > .b3-board-column:not([data-b3-dragging])")],s=getComputedStyle(this).direction==="rtl";return{column:"",before:o.find((l)=>{let c=l.getBoundingClientRect();return s?e>c.left+c.width/2:e<c.left+c.width/2})?.dataset.column??null,list:i}}#H(e){for(let n of this.querySelectorAll("[data-b3-drop]"))n.removeAttribute("data-b3-drop");if(!e)return;let t=`[data-${this.#r.kind}="${CSS.escape(e.before??"")}"]`,r=e.before?e.list.querySelector(t):null;(r??e.list).setAttribute("data-b3-drop",r?"before":"end")}#N(e,t){return t?.closest(".b3-board-column")??[...this.querySelectorAll(".b3-board-column")].find((r)=>{let n=r.getBoundingClientRect();return e>=n.left&&e<=n.right})}#U(e,t){let r=(s,a,l)=>s<a+40?-12:s>l-40?12:0,n=this.querySelector(".b3-board-columns");if(n){let s=n.getBoundingClientRect();n.scrollLeft+=r(e,s.left,s.right)}let i=this.#r?.kind==="card"?this.#N(e,this.ownerDocument.elementFromPoint(e,t))?.querySelector(".b3-board-cards"):null;if(i&&i.scrollHeight>i.clientHeight){let s=i.getBoundingClientRect();i.scrollTop+=r(t,s.top,s.bottom)}let o=this.ownerDocument.defaultView;o.scrollBy(0,r(t,0,o.innerHeight))}#p(){let e=this.#r;if(!e)return;this.#r=null,clearTimeout(e.hold),cancelAnimationFrame(e.frame??0),e.ghost?.remove(),e.node.removeAttribute("data-b3-dragging");for(let t of this.querySelectorAll("[data-b3-drop]"))t.removeAttribute("data-b3-drop")}}ur("b3-board",ci);export{ci as B3Board};
|
package/dist/manifest.json
CHANGED
|
@@ -42,6 +42,14 @@ export declare const isNum: (s: unknown) => boolean;
|
|
|
42
42
|
export declare const directives: Record<string, DirectiveRenderer>;
|
|
43
43
|
/** Built-in fence renderers by language: (text, ctx) => html. Unlisted languages render as code. */
|
|
44
44
|
export declare const fences: Record<string, FenceRenderer>;
|
|
45
|
+
/**
|
|
46
|
+
* Opt-in ```chart renderer that also takes JSON (a dependency-free SVG bar/line/pie chart); a body that is not JSON
|
|
47
|
+
* falls back to the built-in bars. Enable with `new MarkdownStream({ fences: { chart: jsonChart } })` and pass the same
|
|
48
|
+
* `fences` to promptGuide(). JSON: an array of rows (`[{"month":"Jan","sales":3}]`), or `{ type?: bar|line|pie,
|
|
49
|
+
* title?, x?, y?, data: rows }`, or `{ series: { name: { label: value } } }`. The label column is the first
|
|
50
|
+
* non-numeric one; every numeric column is a series. An unfinished JSON body (still streaming) shows a placeholder.
|
|
51
|
+
*/
|
|
52
|
+
export declare const jsonChart: FenceRenderer;
|
|
45
53
|
/**
|
|
46
54
|
* A system-prompt snippet teaching a model what this renderer turns into components. Generated from
|
|
47
55
|
* the same options the stream uses, so custom directives/fences (with a `.doc`) and tones are included.
|
package/dist/markdown-stream.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
var
|
|
2
|
-
`).filter((
|
|
3
|
-
`).map((t)=>t.split(":")).filter((t)=>t.length>1&&!isNaN(parseFloat(t[1]))),
|
|
4
|
-
`)}var
|
|
5
|
-
`),t=[];while(
|
|
6
|
-
`)?t:t.slice(0,-1),
|
|
7
|
-
`);if(
|
|
1
|
+
var q=Symbol.for("bare-v3.styles");function R(e,n,a){if(!e?.head||e.getElementById(n))return;let t=e[q]??=new Set;if(t.has(n))return;let r=e.defaultView;if(r&&"adoptedStyleSheets"in e&&"replaceSync"in r.CSSStyleSheet.prototype){let i=new r.CSSStyleSheet;i.replaceSync(a),e.adoptedStyleSheets=[...e.adoptedStyleSheets,i],t.add(n);return}let s=e.createElement("style");s.id=n,s.textContent=a,e.head.append(s)}var b=(e)=>String(e).replace(/[&<>"]/g,(n)=>({"&":"&","<":"<",">":">",'"':"""})[n]),P=(e)=>Object.fromEntries([...(e||"").matchAll(/(\w+)=(?:"([^"]*)"|(\S+))/g)].map((n)=>[n[1],n[2]??n[3]])),B=(e)=>/^[-+$€£]?[\d,.]+%?$/.test(String(e).trim()),z=(e)=>e?` data-b3-tone="${b(e)}"`:"",T={callout(e,n){let a=e.attrs.title?`<strong>${b(e.attrs.title)}</strong>`:"";return`<div class="b3-alert"${z(e.attrs.tone)}><div>${a}${n.parse(e.tokens)}</div></div>`},stats(e,n){let a=n?.inline??b;return`<div class="b3-md-stats">${e.body.split(`
|
|
2
|
+
`).filter((r)=>r.trim()).map((r)=>{let[s="",i,o=""]=r.replace(/^\s*\|/,"").replace(/\|\s*$/,"").split("|").map((c)=>c.trim()),l=/^[↑+]/.test(o)?"success":/^[↓-]/.test(o)?"danger":"";return`<div class="b3-stat b3-surface"><span class="b3-label">${a(s)}</span><strong class="b3-stat-value">${i?a(i.replace(/^\*\*(.*)\*\*$/,"$1")):"…"}</strong>${o?`<span class="b3-badge"${z(l)}>${a(o)}</span>`:""}</div>`}).join("")}</div>`}},S={chart(e){let n=e.split(`
|
|
3
|
+
`).map((t)=>t.split(":")).filter((t)=>t.length>1&&!isNaN(parseFloat(t[1]))),a=Math.max(...n.map((t)=>parseFloat(t[1])),1);return`<figure class="b3-md-bars b3-surface">${n.map(([t="",r=""])=>`<div class="b3-md-bar"><span>${b(t.trim())}</span><i style="inline-size:${Math.max(parseFloat(r),0)/a*100}%"></i><b>${b(r.trim())}</b></div>`).join("")}</figure>`}},U=(e,n)=>{let a=e.trim();if(!/^[[{]/.test(a))return S.chart(e,n);let t;try{t=JSON.parse(a)}catch{return(a.match(/[[{]/g)?.length??0)>(a.match(/[\]}]/g)?.length??0)?'<figure class="b3-md-chart b3-surface b3-md-pending"><div class="b3-skeleton"></div></figure>':j(e,"json")}let r=_(t);return r?Y(r):j(e,"json")};U.doc='```chart fence with JSON — `{"type":"bar|line|pie","title":"…","data":[{"label":"Jan","sales":120,"costs":80}]}` (numbers, not strings; every numeric field is a series; type is optional) — for trends over time (line), comparing groups/series (bar) or shares of a whole (pie). For a few single values, one `Label: number` per line gives simple bars.';var M=(e)=>typeof e==="number"&&Number.isFinite(e);function _(e){let n=Array.isArray(e)?{data:e}:e&&typeof e==="object"?e:null;if(!n)return null;let a=n.data??n.rows,t=n.series??n.values;if(!a&&t&&typeof t==="object"&&!Array.isArray(t)){let c=Object.keys(t);a=[...new Set(c.flatMap((p)=>Object.keys(t[p]||{})))].map((p)=>({label:p,...Object.fromEntries(c.map((g)=>[g,Number(t[g]?.[p]??0)]))}))}if(!Array.isArray(a)||!a.length||!a.every((c)=>c&&typeof c==="object"&&!Array.isArray(c)))return null;let r=[...new Set(a.flatMap((c)=>Object.keys(c)))],s=typeof n.x==="string"?n.x:r.find((c)=>a.some((d)=>d[c]!=null&&!M(d[c])))??"",i=n.y?[n.y].flat().map(String):r.filter((c)=>c!==s&&a.some((d)=>M(d[c])));if(!i.length)return null;let o=a.some((c)=>/^\d{4}-\d{2}/.test(String(c[s]??""))),l=["bar","line","pie"].includes(n.type)?n.type:o||a.length>12?"line":"bar";return{type:l,title:String(n.title??""),x:s,ys:l==="pie"?i.slice(0,1):i.slice(0,8),rows:a.slice(0,500)}}var A=(e)=>{try{return new Intl.NumberFormat(void 0,{notation:"compact",maximumFractionDigits:1}).format(e)}catch{return String(e)}};function Y({type:e,title:n,x:a,ys:t,rows:r}){let s=(m,u)=>M(m[u])?m[u]:0,i=(m,u)=>String(a?m[a]??"":u+1),o=(m,u,h)=>`<title>${b(i(m,u))} · ${b(h)}: ${b(m[h]??"")}</title>`,l=n?`<figcaption>${b(n)}</figcaption>`:"",c=(m)=>`<div class="b3-md-legend">${m.map((u,h)=>`<span><i class="b3-md-c${h%8}"></i>${b(u)}</span>`).join("")}</div>`;if(e==="pie"){let m=t[0],u=r.map((v)=>Math.max(s(v,m),0)),h=u.reduce((v,w)=>v+w,0)||1,f=0,E=r.map((v,w)=>{let x=f+u[w]/h*Math.PI*2,C=(O)=>`${(16+15*Math.sin(O)).toFixed(3)} ${(16-15*Math.cos(O)).toFixed(3)}`,N=u[w]>=h?"M16 1a15 15 0 1 1 0 30a15 15 0 1 1 0-30Z":`M16 16L${C(f)}A15 15 0 ${x-f>Math.PI?1:0} 1 ${C(x)}Z`;return f=x,`<path class="b3-md-c${w%8}" d="${N}">${o(v,w,m)}</path>`});return`<figure class="b3-md-chart b3-surface">${l}<div class="b3-md-pie"><svg viewBox="0 0 32 32" role="img" aria-label="${b(n||m)}">${E.join("")}</svg>${c(r.map(i))}</div></figure>`}let d=r.flatMap((m)=>t.map((u)=>s(m,u))),p=Math.min(0,...d),g=Math.max(0,...d),H=g-p||1,k=(m)=>(100-(m-p)/H*100).toFixed(2),y=r.length,I=e==="line"?t.map((m,u)=>`<polyline class="b3-md-c${u%8}" vector-effect="non-scaling-stroke" points="${r.map((h,f)=>`${(y>1?f/(y-1)*100:50).toFixed(2)},${k(s(h,m))}`).join(" ")}"><title>${b(m)}</title></polyline>`).join(""):r.map((m,u)=>t.map((h,f)=>{let E=100/y*0.8/t.length,v=100/y*(u+0.1)+E*f,w=s(m,h),x=Math.min(+k(w),+k(0));return`<rect class="b3-md-c${f%8}" x="${v.toFixed(2)}" y="${x.toFixed(2)}" width="${E.toFixed(2)}" height="${Math.max(Math.abs(+k(w)-+k(0)),0.4).toFixed(2)}">${o(m,u,h)}</rect>`}).join("")).join(""),D=y>2?[0,Math.floor((y-1)/2),y-1]:[...Array(y).keys()];return`<figure class="b3-md-chart b3-surface">${l}<div class="b3-md-plot"><div class="b3-md-y"><span>${A(g)}</span><span>${A(p)}</span></div><svg viewBox="0 0 100 100" preserveAspectRatio="none" role="img" aria-label="${b(n||t.join(", "))}">${I}</svg><div class="b3-md-x">${D.map((m)=>`<span>${b(i(r[m],m))}</span>`).join("")}</div></div>${t.length>1?c(t):""}</figure>`}T.callout.doc='`:::callout{tone=info|success|warning|danger title="Short title"}` newline, markdown body, newline `:::` — a highlighted note, tip, warning or recommendation.';T.stats.doc="`:::stats` newline, one card per line `Label | Value | note`, newline `:::` — headline numbers; a note starting with ↑ or + shows as good, ↓ or - as bad.";S.chart.doc="```chart fence, one bar per line `Label: number` (plain number, no units) — a horizontal bar chart for comparing a few values.";function X(e={}){let n={...T,...e.directives,...S,...e.fences},a=Object.entries(e.tones??new L().tones).reduce((t,[r,s])=>((t[s]??=[]).push(r),t),{});return["Your replies are Markdown rendered live into UI components. Use GitHub-flavoured Markdown (headings, **bold**, lists, links, `inline code`, fenced code with a language, > quotes) plus:",`- Tables: GFM pipe tables with a header row and a \`| --- |\` delimiter row. Never add a Status column the data does not already have. Only when a row really has one of these states (e.g. an invoice that is paid), write the plain word alone in the cell and it is shown as a coloured badge automatically (no images, emoji or badge URLs): ${Object.entries(a).map(([t,r])=>`${r.join(", ")} (${t})`).join("; ")}. Numeric columns align right.`,"- Task lists: `- [x] done` and `- [ ] to do`.",...Object.values(n).filter((t)=>t?.doc).map((t)=>`- ${t.doc}`),"Use a component only when it makes the answer clearer; plain prose is fine. Put every block on its own lines with a blank line around it, always close ::: and ``` blocks, and never write raw HTML."].join(`
|
|
4
|
+
`)}var j=(e,n)=>`<div class="b3-md-code"><header><span class="b3-muted">${b(n||"text")}</span><button type="button" class="b3-button" data-b3-emphasis="quiet" data-b3-md-copy>Copy</button></header><pre><code>${b(e)}</code></pre></div>`;function V(e){let n=e,a=n.split(`
|
|
5
|
+
`),t=[];while(a.length&&/^\s*\|/.test(a.at(-1)))t.unshift(a.pop());let r=e.endsWith(`
|
|
6
|
+
`)?t:t.slice(0,-1),s=!1;if(t.length&&!r.some((c)=>/^\s*\|?\s*:?-{2,}/.test(c)))s=!0,n=a.join(`
|
|
7
|
+
`);if(n=n.replace(/(^|\n) {0,3}(`{3}[^\n]*|~{3}[^\n]*|:{3}[^\n]*|`{1,2}|~{1,2}|:{1,2})$/,"$1"),(n.match(/^ {0,3}(`{3}|~{3})/gm)||[]).length%2)return{src:n,pendingTable:s};n=n.replace(/\[([^\]\n]*)\]?\([^)\n]*$/,"$1").replace(/\[([^\]\n]*)$/,"$1").replace(/(\*{1,3}|_{1,3}|~{1,2}|`)$/,"");let i=[...n.matchAll(/^ {0,3}(`{3}|~{3})[^\n]*\n?/gm)].at(-1),o=n.slice(Math.max(n.lastIndexOf(`
|
|
8
8
|
|
|
9
|
-
`)+1,
|
|
9
|
+
`)+1,i?i.index+i[0].length:0)),l="";for(let c of["`","~~"])if(o.split(c).length%2===0)l=c+l;return l+=G(o),{src:l?n.trimEnd()+l:n,pendingTable:s}}function G(e){let n=e.replace(/`[^`\n]*`?/g,"").replace(/\\[*_]/g,"").replace(/\]\([^)\n]*\)?|https?:\/\/\S*/g,"]"),a=[];for(let{0:t,index:r}of n.matchAll(/\*+|_+/g)){let s=n[r-1]??" ",i=n[r+t.length]??" ",o=t.length;if(/\S/.test(s)&&(t[0]==="*"||!/\w/.test(i)))while(o&&a.at(-1)?.[0]===t[0]){let c=a.pop(),d=Math.min(o,c.length);if(o-=d,c.length>d)a.push(c.slice(d))}let l=/[\p{L}\p{N}]/u.test(i)||t.length>1&&/\s/.test(s)&&/^[^\s\w*_-]\S*$/.test(n.slice(r+t.length));if(o&&l&&!(/\w/.test(s)&&(t[0]==="_"||o===1)))a.push(t.slice(0,o))}return a.reverse().join("")}var F={note:"info",info:"info",tip:"success",important:"info",warning:"warning",caution:"danger",danger:"danger"},J="b3-markdown-stream-style",W=`
|
|
10
10
|
.b3-prose > :is(.b3-md-stats,.b3-table-wrap,.b3-alert,.b3-md-code,.b3-md-bars){margin-block:1rem;}
|
|
11
11
|
.b3-prose > :first-child{margin-block-start:0;}
|
|
12
12
|
.b3-md-appear{animation:b3-md-in var(--b3-duration,.2s) ease-out;}
|
|
@@ -21,6 +21,24 @@ var y=Symbol.for("bare-v3.styles");function f(e,s,l){if(!e?.head||e.getElementBy
|
|
|
21
21
|
.b3-md-bar>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
|
|
22
22
|
.b3-md-bar>i{display:block;block-size:.7rem;border-radius:999px;background:var(--b3-color-accent);transition:inline-size var(--b3-duration,.2s);}
|
|
23
23
|
.b3-md-bar>b{text-align:end;font-variant-numeric:tabular-nums;}
|
|
24
|
+
.b3-prose > .b3-md-chart{margin-block:1rem;}
|
|
25
|
+
.b3-md-chart{display:grid;gap:.5rem;margin-inline:0;padding:var(--b3-space,1rem);font-size:.8rem;}
|
|
26
|
+
.b3-md-chart>figcaption{font-weight:600;font-size:.9rem;}
|
|
27
|
+
.b3-md-plot{display:grid;grid-template-columns:max-content minmax(0,1fr);gap:.25rem .5rem;}
|
|
28
|
+
.b3-md-plot>svg{block-size:10rem;inline-size:100%;overflow:visible;border-block-end:1px solid var(--b3-color-border);}
|
|
29
|
+
.b3-md-y{display:flex;flex-direction:column;justify-content:space-between;text-align:end;}
|
|
30
|
+
.b3-md-x{grid-column:2;display:flex;justify-content:space-between;gap:.5rem;}
|
|
31
|
+
.b3-md-x>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
|
|
32
|
+
.b3-md-x>span:only-child{margin-inline:auto;}
|
|
33
|
+
:is(.b3-md-y,.b3-md-x,.b3-md-legend){color:var(--b3-color-muted);font-variant-numeric:tabular-nums;}
|
|
34
|
+
.b3-md-chart rect,.b3-md-chart path{fill:var(--c);stroke:none;}
|
|
35
|
+
.b3-md-chart polyline{fill:none;stroke:var(--c);stroke-width:2;stroke-linejoin:round;}
|
|
36
|
+
.b3-md-pie{display:flex;flex-wrap:wrap;align-items:center;gap:1rem;}
|
|
37
|
+
.b3-md-pie>svg{inline-size:8rem;block-size:8rem;flex:none;}
|
|
38
|
+
.b3-md-legend{display:flex;flex-wrap:wrap;gap:.25rem .75rem;}
|
|
39
|
+
.b3-md-legend i{display:inline-block;inline-size:.6rem;block-size:.6rem;border-radius:2px;margin-inline-end:.3rem;background:var(--c);}
|
|
40
|
+
.b3-md-c0{--c:var(--b3-color-accent);}.b3-md-c1{--c:#f59e0b;}.b3-md-c2{--c:#10b981;}.b3-md-c3{--c:#ef4444;}.b3-md-c4{--c:#8b5cf6;}.b3-md-c5{--c:#ec4899;}.b3-md-c6{--c:#14b8a6;}.b3-md-c7{--c:#f97316;}
|
|
41
|
+
.b3-md-chart.b3-md-pending>.b3-skeleton{block-size:10rem;}
|
|
24
42
|
.b3-md-stats{display:grid;gap:.75rem;grid-template-columns:repeat(auto-fit,minmax(min(10rem,100%),1fr));}
|
|
25
43
|
.b3-md-stats>.b3-stat{container-type:inline-size;}
|
|
26
44
|
.b3-md-stats .b3-stat-value{font-size:clamp(1.5rem,18cqi,3rem);}
|
|
@@ -34,8 +52,8 @@ var y=Symbol.for("bare-v3.styles");function f(e,s,l){if(!e?.head||e.getElementBy
|
|
|
34
52
|
.b3-md-pending>.b3-skeleton{block-size:1.5rem;}
|
|
35
53
|
.b3-md-pending>.b3-skeleton+.b3-skeleton{inline-size:80%;}
|
|
36
54
|
@media (prefers-reduced-motion:reduce){.b3-md-appear,.b3-md-caret{animation:none;}}
|
|
37
|
-
`;class
|
|
38
|
-
`),
|
|
39
|
-
`).replace(/\n$/,""),c=
|
|
40
|
-
`)+(c&&
|
|
41
|
-
`:""),name:
|
|
55
|
+
`;class L{Marked=null;sanitize=null;directives=T;fences=S;code=j;tones={paid:"success",done:"success",ok:"success",active:"success",pending:"warning",overdue:"danger",failed:"danger",blocked:"danger",draft:"info"};html="escape";images="alt";markedOptions={}}class Z{el=null;buf="";nodes=[];ended=!1;options;#e;#t=(e)=>this.#n(e);constructor(e){this.options={...new L,...e},this.options.directives={...T,...e?.directives},this.options.fences={...S,...e?.fences};let{Marked:n,sanitize:a}=this.options;if(typeof n!=="function")throw TypeError('MarkdownStream: options.Marked (from "marked") is required');if(typeof a!=="function")throw TypeError("MarkdownStream: options.sanitize is required (e.g. html => DOMPurify.sanitize(html))");this.#e=this.#s()}attach(e){return this.detach(),this.el=e,e.replaceChildren(),this.buf="",this.nodes=[],this.ended=!1,R(e.ownerDocument,J,W),e.addEventListener("click",this.#t),this}detach(){this.el?.removeEventListener("click",this.#t),this.el=null}push(e){if(this.ended){console.warn("MarkdownStream: push() after end() ignored; call attach(el) to start a new stream");return}this.buf+=e,this.render(!0)}end(e){if(e!==void 0)this.buf=String(e);this.ended=!0,this.render(!1)}toHtml(e){return this.options.sanitize(this.#e.parse(e))}render(e){let{el:n}=this;if(!n)throw Error("MarkdownStream: call attach(el) before push()");let a=n.ownerDocument,{src:t,pendingTable:r}=e?V(this.buf):{src:this.buf,pendingTable:!1},s=this.#e.lexer(t).filter((i)=>i.type!=="space");if(s.forEach((i,o)=>{let l=this.nodes[o];if(l&&l.raw===i.raw)return;let c=a.createElement("div");c.innerHTML=this.options.sanitize(this.#e.parser([i]));let p=(c.childElementCount===1&&[...c.childNodes].every((g)=>g.nodeType===1||!g.textContent.trim())?c.firstElementChild:null)??c;if(!l)p.classList.add("b3-md-appear");l?l.el.replaceWith(p):n.append(p),this.nodes[o]={raw:i.raw,el:p}}),this.nodes.splice(s.length).forEach((i)=>i.el.remove()),n.querySelector(":scope .b3-md-caret, :scope > .b3-md-pending")?.remove(),r)n.insertAdjacentHTML("beforeend",'<div class="b3-md-pending" aria-hidden="true"><div class="b3-skeleton"></div><div class="b3-skeleton"></div></div>');else if(e){let i=this.nodes.at(-1)?.el;((i?.matches("p, li, td, th, pre"))?i:i?.querySelector("p:last-of-type, li:last-child, td:last-child")||i||n).insertAdjacentHTML("beforeend",'<span class="b3-md-caret" aria-hidden="true"></span>')}}#n(e){let n=e.target.closest?.("[data-b3-md-copy]");if(!n||!this.el?.contains(n))return;let a=n.closest(".b3-md-code")?.querySelector("code")?.textContent??"",t=(i)=>{n.textContent=i,setTimeout(()=>{n.textContent="Copy"},1200)},r=(i)=>{console.warn("MarkdownStream: copy failed",i),t("Copy failed")},s=this.el.ownerDocument.defaultView?.navigator?.clipboard;if(s?.writeText)s.writeText(a).then(()=>t("Copied"),r);else r(Error("navigator.clipboard is unavailable (insecure context?)"))}#s(){let e=this.options,n={name:"directive",level:"block",start:(t)=>t.match(/^:::/m)?.index,tokenizer(t){let r=/^:::(\w+)(?:\{([^}\n]*)\})?[^\n]*(?:\n|$)/.exec(t);if(!r)return;let s=t.slice(r[0].length).split(`
|
|
56
|
+
`),i=null,o=s.length;for(let p=0;p<s.length;p++){let g=/^ {0,3}(`{3,}|~{3,})/.exec(s[p])?.[1];if(i){if(g&&g[0]===i[0]&&g.length>=i.length&&!s[p].trim().slice(g.length))i=null}else if(g)i=g;else if(/^:::[^\S\n]*$/.test(s[p])){o=p;break}}let l=s.slice(0,o).join(`
|
|
57
|
+
`).replace(/\n$/,""),c=o<s.length;return{type:"directive",raw:r[0]+s.slice(0,c?o+1:o).join(`
|
|
58
|
+
`)+(c&&o+1<s.length?`
|
|
59
|
+
`:""),name:r[1],attrs:P(r[2]),body:l,tokens:this.lexer.blockTokens(l,[])}},renderer(t){return(e.directives[t.name]??e.directives.callout)(t,{parse:(s)=>this.parser.parse(s),parseInline:(s)=>this.parser.parseInline(s),inline:(s)=>a.parseInline(s),esc:b})}},a=new e.Marked({gfm:!0,extensions:[n]});if(a.use({renderer:{blockquote(t){let r=/^\s*(?:\[!(\w+)\][^\S\n]*\n?|\*\*(\w+):?\*\*:?[^\S\n]*)/.exec(t.text),s=(r?.[1]??r?.[2])?.toLowerCase();if(!s||!r||!Object.hasOwn(F,s))return!1;let i=s[0].toUpperCase()+s.slice(1);return e.directives.callout({attrs:{tone:F[s],title:i},tokens:a.lexer(t.text.slice(r[0].length))},{parse:(o)=>this.parser.parse(o),parseInline:(o)=>this.parser.parseInline(o),inline:(o)=>a.parseInline(o),esc:b})},table(t){let r=t.header.map((i,o)=>t.rows.length>0&&t.rows.every((l)=>B(l[o]?.text||"0"))),s=(i,o,l)=>{let c=this.parser.parseInline(i.tokens),d=l==="td"&&e.tones[i.text.trim().toLowerCase()],p=d?`<span class="b3-badge" data-b3-tone="${b(d)}">${c}</span>`:c;return`<${l}${l==="th"?' scope="col"':""}${r[o]?' class="b3-md-num"':""}>${p}</${l}>`};return`<div class="b3-table-wrap" tabindex="0" role="region" aria-label="Table"><table class="b3-table b3-md-table"><thead><tr>${t.header.map((i,o)=>s(i,o,"th")).join("")}</tr></thead><tbody>${t.rows.map((i)=>`<tr>${i.map((o,l)=>s(o,l,"td")).join("")}</tr>`).join("")}</tbody></table></div>`},code({text:t,lang:r}){let s=(r||"").trim().split(/\s/)[0],i=Object.hasOwn(e.fences,s)?e.fences[s]:null;return i?i(t,{esc:b,lang:s}):e.code(t,s)},html(t){return e.html==="render"?!1:t.block?`<p>${b(t.text.trim())}</p>`:b(t.text)},image({href:t,text:r}){return e.images==="render"||typeof e.images==="function"&&e.images(t??"")?!1:b(r)},list(t){if(!t.items.some((r)=>r.task))return!1;return`<ul class="b3-md-tasks">${t.items.map((r)=>{let s=r.tokens.filter((l)=>l.type!=="checkbox"),i=s.find((l)=>l.type==="text"||l.type==="paragraph");if(i?.tokens)i.tokens=i.tokens.filter((l)=>l.type!=="checkbox");let o=s.map((l)=>l.type==="text"&&!r.loose?this.parser.parseInline(l.tokens??[l]):this.parser.parse([l])).join("");return`<li><input type="checkbox" disabled${r.checked?" checked":""}>${o}</li>`}).join("")}</ul>`}}}),e.markedOptions&&Object.keys(e.markedOptions).length)a.use(e.markedOptions);return a}}function ee(e=document.scrollingElement,{threshold:n=80}={}){let a=e.ownerDocument,t=a.defaultView,r=e===a.scrollingElement?t:e,s=!0,i=e.scrollTop,o=()=>{let d=e.scrollTop;if(e.scrollHeight-d-e.clientHeight>=n)s=!1;else if(d>=i)s=!0;i=d},l=(d)=>{if(d.target?.closest?.('input, textarea, select, [contenteditable]:not([contenteditable="false"])'))return;if(e.scrollTop>0&&((d.deltaY??0)<0||/^(ArrowUp|PageUp|Home)$/.test(d.key??"")))s=!1},c=[["scroll",o],["wheel",l],["keydown",l]];return c.forEach(([d,p])=>r.addEventListener(d,p,{passive:!0})),{get pinned(){return s},stick(d=!1){if(d||s)e.scrollTop=e.scrollHeight,s=!0},destroy(){c.forEach(([d,p])=>r.removeEventListener(d,p))}}}export{Z as MarkdownStream,L as MarkdownStreamOptions,j as codeBlock,T as directives,b as esc,S as fences,B as isNum,U as jsonChart,P as parseAttrs,X as promptGuide,V as settle,ee as stickToBottom};
|
|
@@ -29,6 +29,7 @@ Any markdown-speaking model works with no prompt: standard markdown is upgraded
|
|
|
29
29
|
| `:::callout{tone=warning title="…"}` … `:::` | `b3-alert` with tone and title; body is markdown |
|
|
30
30
|
| `:::stats` lines `Label \| Value \| ↑ note` `:::` | `b3-stat` cards; `↑`/`+` notes success, `↓`/`-` danger |
|
|
31
31
|
| ```` ```chart ```` lines `Label: number` | horizontal bars scaled to the max |
|
|
32
|
+
| ```` ```chart ```` JSON rows, opt-in: `fences: { chart: jsonChart }` | SVG bar / line / pie (no chart library); unfinished JSON shows a placeholder |
|
|
32
33
|
| ```` ```lang ```` | code block with language label and Copy button |
|
|
33
34
|
| `- [x] task` | list with disabled checkboxes |
|
|
34
35
|
| `> [!NOTE]` / `> [!WARNING]` (GitHub alerts) or `> **Note:** …` | `b3-alert`; note/important → info, tip → success, warning → warning, caution/danger → danger |
|