@livx.cc/bare-v3 0.1.0-alpha.92 → 0.1.0-alpha.93

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.
@@ -196,8 +196,8 @@ export declare class B3Board extends Base {
196
196
  /** Move a column to `index`. */
197
197
  moveColumn(columnId: BoardId, index: number): boolean;
198
198
  /**
199
- * Put keyboard focus on a card (by id; the first card shown when none is given or it is not shown) and bring it into
200
- * view — a start for a host's arrow keys when nothing on the board has focus. False when there is no card to focus.
199
+ * Put keyboard focus on a card (by id; else the selected card; else the first card shown) and bring it into view — a
200
+ * start for a host's arrow keys, or where a host's menu or dialog hands the keyboard back. False when there is no card.
201
201
  */
202
202
  focusCard(cardId?: BoardId): boolean;
203
203
  /** Host keys listed after the board's own in the `?` sheet, e.g. `[['N', 'New card'], ['/', 'Search']]`. */
@@ -1,10 +1,10 @@
1
- var{defineProperty:at,getOwnPropertyNames:gi,getOwnPropertyDescriptor:yi}=Object,xi=Object.prototype.hasOwnProperty;function vi(e){return this[e]}var wi=(e)=>{var t=(fr??=new WeakMap).get(e),r;if(t)return t;if(t=at({},"__esModule",{value:!0}),e&&typeof e==="object"||typeof e==="function"){for(var n of gi(e))if(!xi.call(t,n))at(t,n,{get:vi.bind(e,n),enumerable:!(r=yi(e,n))||r.enumerable})}return fr.set(e,t),t},fr;var _i=(e)=>e;function Ei(e,t){this[e]=_i.bind(null,t)}var ki=(e,t)=>{for(var r in t)at(e,r,{get:t[r],enumerable:!0,configurable:!0,set:Ei.bind(t,r)})};var Si=(e,t)=>()=>(e&&(t=e(e=0)),t);var Jn={};ki(Jn,{Alpine:()=>Yn,default:()=>ia});function Ci(e){Mi(e)}function Ti(){Pt=!0}function Oi(){Pt=!1,Tr()}function Mi(e){if(!P.includes(e)){if(P.push(e),e._x_schedulerPriority!==void 0)ze=!0}Tr()}function $t(e){let t=P.indexOf(e);if(t!==-1&&t>yt)P.splice(t,1)}function Tr(){if(!gt&&!mt){if(Pt)return;mt=!0,queueMicrotask(Li)}}function Li(){mt=!1,gt=!0;for(let e=0;e<P.length;e++){if(ze)Ii(e);P[e](),yt=e}P.length=0,yt=-1,ze=!1,gt=!1}function Ii(e){let t=new Map,r=P.slice(e).sort((n,i)=>Di(n,i,t));for(let n=0;n<r.length;n++)P[e+n]=r[n];ze=!1}function Di(e,t,r){if(!lt(e))return lt(t)?1:0;if(!lt(t))return-1;return br(e._x_schedulerPriority.el,r)-br(t._x_schedulerPriority.el,r)||e._x_schedulerPriority.order-t._x_schedulerPriority.order}function lt(e){return e._x_schedulerPriority!==void 0}function br(e,t){if(t.has(e))return t.get(e);let r=0,n=e;while(e)if(r++,e._x_teleportBack)e=e._x_teleportBack;else if(typeof ShadowRoot==="function"&&e.parentNode instanceof ShadowRoot)e=e.parentNode.host;else e=e.parentElement;return t.set(n,r),r}function Bi(e){xt=!1,e(),xt=!0}function Pi(e){le=e.reactive,ce=e.release,re=(t)=>e.effect(t,{scheduler:(r)=>{if(xt)Ci(r);else r()}}),Or=e.raw}function mr(e){re=e}function $i(e){let t=()=>{};return[(n,i)=>{let o=i?.priority==="structural"?Ni++:void 0,s=re(n);if(o!==void 0&&s!==void 0)s._x_schedulerPriority={el:e,order:o};if(!e._x_effects)e._x_effects=new Set,e._x_runEffects=()=>{e._x_effects.forEach((a)=>a())};return e._x_effects.add(s),t=()=>{if(s===void 0)return;e._x_effects.delete(s),ce(s)},s},()=>{t()}]}function Mr(e,t){let r=!0,n,i,o=re(()=>{let s=e(),a=JSON.stringify(s);if(!r){if(typeof s==="object"||s!==n){let l=typeof n==="object"?JSON.parse(i):n;queueMicrotask(()=>{t(s,l)})}}n=s,i=a,r=!1});return()=>{$t(o),ce(o)}}async function Ri(e){Ti();try{await e(),await Promise.resolve()}finally{Oi()}}function Hi(e){Dr.push(e)}function Rt(e,t){if(typeof t==="function"){if(!e._x_cleanups)e._x_cleanups=[];e._x_cleanups.push(t)}else t=e,Ir.push(t)}function Nr(e){Lr.push(e)}function Br(e,t,r){if(!e._x_attributeCleanups)e._x_attributeCleanups={};if(!e._x_attributeCleanups[t])e._x_attributeCleanups[t]=[];e._x_attributeCleanups[t].push(r)}function Pr(e,t){if(!e._x_attributeCleanups)return;Object.entries(e._x_attributeCleanups).forEach(([r,n])=>{if(t===void 0||t.includes(r))n.forEach((i)=>i()),delete e._x_attributeCleanups[r]})}function zi(e){e._x_effects?.forEach($t);while(e._x_cleanups?.length)e._x_cleanups.pop()()}function zt(){We.observe(document,{subtree:!0,childList:!0,attributes:!0,attributeOldValue:!0}),Ht=!0}function $r(){Ui(),We.disconnect(),Ht=!1}function Ui(){let e=We.takeRecords();F.push(()=>e.length>0&&Ye(e));let t=F.length;queueMicrotask(()=>{if(F.length===t)while(F.length>0)F.shift()()})}function ji(){while(F.length>0)F.shift()();let e=We.takeRecords();if(e.length>0)Ye(e)}function _(e){if(!Ht)return e();$r();try{return e()}finally{zt()}}function qi(){Ut=!0}function Fi(){Ut=!1,Ye(Ue),Ue=[]}function Ye(e){if(Ut){Ue=Ue.concat(e);return}let t=[],r=new Set,n=new Map,i=new Map;for(let o=0;o<e.length;o++){if(e[o].target._x_ignoreMutationObserver)continue;if(e[o].type==="childList")e[o].removedNodes.forEach((s)=>{if(s.nodeType!==1)return;if(!s._x_marker)return;r.add(s)}),e[o].addedNodes.forEach((s)=>{if(s.nodeType!==1)return;if(r.has(s)){r.delete(s);return}if(s._x_marker)return;t.push(s)});if(e[o].type==="attributes"){let s=e[o].target,a=e[o].attributeName,l=e[o].oldValue,c=()=>{if(!n.has(s))n.set(s,[]);n.get(s).push({name:a,value:s.getAttribute(a)})},d=()=>{if(!i.has(s))i.set(s,[]);i.get(s).push(a)};if(s.hasAttribute(a)&&l===null)c();else if(s.hasAttribute(a))d(),c();else d()}}i.forEach((o,s)=>{Pr(s,o)}),n.forEach((o,s)=>{Lr.forEach((a)=>a(s,o))});for(let o of r){if(t.some((s)=>s.contains(o)))continue;Ir.forEach((s)=>s(o))}for(let o of t){if(!o.isConnected)continue;Dr.forEach((s)=>s(o))}t=null,r=null,n=null,i=null}function Rr(e){return G(ae(e))}function Ce(e,t,r){return e._x_dataStack=[t,...ae(r||e)],()=>{e._x_dataStack=e._x_dataStack.filter((n)=>n!==t)}}function ae(e){if(e._x_dataStack)return e._x_dataStack;if(typeof ShadowRoot==="function"&&e instanceof ShadowRoot)return ae(e.host);if(!e.parentNode)return[];return ae(e.parentNode)}function G(e){return new Proxy({objects:e},Ki)}function Hr(e,t){if(e===null||e===Object.prototype)return null;if(Object.prototype.hasOwnProperty.call(e,t))return e;return Hr(Object.getPrototypeOf(e),t)}function Vi(){return Reflect.ownKeys(this).reduce((t,r)=>(t[r]=Reflect.get(this,r),t),{})}function jt(e,t=()=>{}){let r=(i)=>typeof i==="object"&&!Array.isArray(i)&&i!==null,n=(i,o="")=>{Object.entries(Object.getOwnPropertyDescriptors(i)).forEach(([s,{value:a,enumerable:l}])=>{if(l===!1||a===void 0)return;if(typeof a==="object"&&a!==null&&a.__v_skip)return;let c=o===""?s:`${o}.${s}`;if(typeof a==="object"&&a!==null&&a._x_interceptor)i[s]=a.initialize(e,c,s,t);else if(r(a)&&a!==i&&!(a instanceof Element))n(a,c)})};return n(e)}function zr(e,t=()=>{}){let r={initialValue:void 0,_x_interceptor:!0,initialize(n,i,o,s){return e(this.initialValue,()=>Wi(n,i),(a)=>vt(n,i,a),i,o,s)}};return t(r),(n)=>{if(typeof n==="object"&&n!==null&&n._x_interceptor){let i=r.initialize.bind(r);r.initialize=(o,s,a,l)=>{let c=n.initialize(o,s,a,l);return r.initialValue=c,i(o,s,a,l)}}else r.initialValue=n;return r}}function Wi(e,t){return t.split(".").reduce((r,n)=>r[n],e)}function vt(e,t,r){if(typeof t==="string")t=t.split(".");if(t.length===1)e[t[0]]=r;else if(t.length===0)throw error;else if(e[t[0]])return vt(e[t[0]],t.slice(1),r);else return e[t[0]]={},vt(e[t[0]],t.slice(1),r)}function M(e,t){Ur[e]=t}function je(e,t){let r=Yi(t);return Object.entries(Ur).forEach(([n,i])=>{Object.defineProperty(e,`$${n}`,{get(){return i(t,r)},enumerable:!1})}),e}function Yi(e){let[t,r]=Yr(e),n={interceptor:zr,...t};return Rt(e,r),n}function Ji(e,t,r,...n){try{return r(...n)}catch(i){Je(i,e,t)}}function Je(...e){return jr(...e)}function Gi(e){jr=e}function Xi(e,t,r=void 0){e=Object.assign(e??{message:"No error message given."},{el:t,expression:r}),console.warn(`Alpine Expression Error: ${e.message}
1
+ var{defineProperty:at,getOwnPropertyNames:gi,getOwnPropertyDescriptor:yi}=Object,xi=Object.prototype.hasOwnProperty;function vi(e){return this[e]}var wi=(e)=>{var t=(fr??=new WeakMap).get(e),r;if(t)return t;if(t=at({},"__esModule",{value:!0}),e&&typeof e==="object"||typeof e==="function"){for(var n of gi(e))if(!xi.call(t,n))at(t,n,{get:vi.bind(e,n),enumerable:!(r=yi(e,n))||r.enumerable})}return fr.set(e,t),t},fr;var _i=(e)=>e;function Ei(e,t){this[e]=_i.bind(null,t)}var ki=(e,t)=>{for(var r in t)at(e,r,{get:t[r],enumerable:!0,configurable:!0,set:Ei.bind(t,r)})};var Ai=(e,t)=>()=>(e&&(t=e(e=0)),t);var Jn={};ki(Jn,{Alpine:()=>Yn,default:()=>ia});function Ci(e){Mi(e)}function Ti(){Pt=!0}function Oi(){Pt=!1,Tr()}function Mi(e){if(!P.includes(e)){if(P.push(e),e._x_schedulerPriority!==void 0)ze=!0}Tr()}function $t(e){let t=P.indexOf(e);if(t!==-1&&t>yt)P.splice(t,1)}function Tr(){if(!gt&&!mt){if(Pt)return;mt=!0,queueMicrotask(Li)}}function Li(){mt=!1,gt=!0;for(let e=0;e<P.length;e++){if(ze)Ii(e);P[e](),yt=e}P.length=0,yt=-1,ze=!1,gt=!1}function Ii(e){let t=new Map,r=P.slice(e).sort((n,i)=>Di(n,i,t));for(let n=0;n<r.length;n++)P[e+n]=r[n];ze=!1}function Di(e,t,r){if(!lt(e))return lt(t)?1:0;if(!lt(t))return-1;return pr(e._x_schedulerPriority.el,r)-pr(t._x_schedulerPriority.el,r)||e._x_schedulerPriority.order-t._x_schedulerPriority.order}function lt(e){return e._x_schedulerPriority!==void 0}function pr(e,t){if(t.has(e))return t.get(e);let r=0,n=e;while(e)if(r++,e._x_teleportBack)e=e._x_teleportBack;else if(typeof ShadowRoot==="function"&&e.parentNode instanceof ShadowRoot)e=e.parentNode.host;else e=e.parentElement;return t.set(n,r),r}function Bi(e){xt=!1,e(),xt=!0}function Pi(e){le=e.reactive,ce=e.release,re=(t)=>e.effect(t,{scheduler:(r)=>{if(xt)Ci(r);else r()}}),Or=e.raw}function mr(e){re=e}function $i(e){let t=()=>{};return[(n,i)=>{let a=i?.priority==="structural"?Ni++:void 0,s=re(n);if(a!==void 0&&s!==void 0)s._x_schedulerPriority={el:e,order:a};if(!e._x_effects)e._x_effects=new Set,e._x_runEffects=()=>{e._x_effects.forEach((o)=>o())};return e._x_effects.add(s),t=()=>{if(s===void 0)return;e._x_effects.delete(s),ce(s)},s},()=>{t()}]}function Mr(e,t){let r=!0,n,i,a=re(()=>{let s=e(),o=JSON.stringify(s);if(!r){if(typeof s==="object"||s!==n){let l=typeof n==="object"?JSON.parse(i):n;queueMicrotask(()=>{t(s,l)})}}n=s,i=o,r=!1});return()=>{$t(a),ce(a)}}async function Ri(e){Ti();try{await e(),await Promise.resolve()}finally{Oi()}}function Hi(e){Dr.push(e)}function Rt(e,t){if(typeof t==="function"){if(!e._x_cleanups)e._x_cleanups=[];e._x_cleanups.push(t)}else t=e,Ir.push(t)}function Nr(e){Lr.push(e)}function Br(e,t,r){if(!e._x_attributeCleanups)e._x_attributeCleanups={};if(!e._x_attributeCleanups[t])e._x_attributeCleanups[t]=[];e._x_attributeCleanups[t].push(r)}function Pr(e,t){if(!e._x_attributeCleanups)return;Object.entries(e._x_attributeCleanups).forEach(([r,n])=>{if(t===void 0||t.includes(r))n.forEach((i)=>i()),delete e._x_attributeCleanups[r]})}function zi(e){e._x_effects?.forEach($t);while(e._x_cleanups?.length)e._x_cleanups.pop()()}function zt(){We.observe(document,{subtree:!0,childList:!0,attributes:!0,attributeOldValue:!0}),Ht=!0}function $r(){Ui(),We.disconnect(),Ht=!1}function Ui(){let e=We.takeRecords();F.push(()=>e.length>0&&Ye(e));let t=F.length;queueMicrotask(()=>{if(F.length===t)while(F.length>0)F.shift()()})}function qi(){while(F.length>0)F.shift()();let e=We.takeRecords();if(e.length>0)Ye(e)}function _(e){if(!Ht)return e();$r();try{return e()}finally{zt()}}function ji(){Ut=!0}function Fi(){Ut=!1,Ye(Ue),Ue=[]}function Ye(e){if(Ut){Ue=Ue.concat(e);return}let t=[],r=new Set,n=new Map,i=new Map;for(let a=0;a<e.length;a++){if(e[a].target._x_ignoreMutationObserver)continue;if(e[a].type==="childList")e[a].removedNodes.forEach((s)=>{if(s.nodeType!==1)return;if(!s._x_marker)return;r.add(s)}),e[a].addedNodes.forEach((s)=>{if(s.nodeType!==1)return;if(r.has(s)){r.delete(s);return}if(s._x_marker)return;t.push(s)});if(e[a].type==="attributes"){let s=e[a].target,o=e[a].attributeName,l=e[a].oldValue,c=()=>{if(!n.has(s))n.set(s,[]);n.get(s).push({name:o,value:s.getAttribute(o)})},d=()=>{if(!i.has(s))i.set(s,[]);i.get(s).push(o)};if(s.hasAttribute(o)&&l===null)c();else if(s.hasAttribute(o))d(),c();else d()}}i.forEach((a,s)=>{Pr(s,a)}),n.forEach((a,s)=>{Lr.forEach((o)=>o(s,a))});for(let a of r){if(t.some((s)=>s.contains(a)))continue;Ir.forEach((s)=>s(a))}for(let a of t){if(!a.isConnected)continue;Dr.forEach((s)=>s(a))}t=null,r=null,n=null,i=null}function Rr(e){return G(ae(e))}function Ce(e,t,r){return e._x_dataStack=[t,...ae(r||e)],()=>{e._x_dataStack=e._x_dataStack.filter((n)=>n!==t)}}function ae(e){if(e._x_dataStack)return e._x_dataStack;if(typeof ShadowRoot==="function"&&e instanceof ShadowRoot)return ae(e.host);if(!e.parentNode)return[];return ae(e.parentNode)}function G(e){return new Proxy({objects:e},Ki)}function Hr(e,t){if(e===null||e===Object.prototype)return null;if(Object.prototype.hasOwnProperty.call(e,t))return e;return Hr(Object.getPrototypeOf(e),t)}function Vi(){return Reflect.ownKeys(this).reduce((t,r)=>(t[r]=Reflect.get(this,r),t),{})}function qt(e,t=()=>{}){let r=(i)=>typeof i==="object"&&!Array.isArray(i)&&i!==null,n=(i,a="")=>{Object.entries(Object.getOwnPropertyDescriptors(i)).forEach(([s,{value:o,enumerable:l}])=>{if(l===!1||o===void 0)return;if(typeof o==="object"&&o!==null&&o.__v_skip)return;let c=a===""?s:`${a}.${s}`;if(typeof o==="object"&&o!==null&&o._x_interceptor)i[s]=o.initialize(e,c,s,t);else if(r(o)&&o!==i&&!(o instanceof Element))n(o,c)})};return n(e)}function zr(e,t=()=>{}){let r={initialValue:void 0,_x_interceptor:!0,initialize(n,i,a,s){return e(this.initialValue,()=>Wi(n,i),(o)=>vt(n,i,o),i,a,s)}};return t(r),(n)=>{if(typeof n==="object"&&n!==null&&n._x_interceptor){let i=r.initialize.bind(r);r.initialize=(a,s,o,l)=>{let c=n.initialize(a,s,o,l);return r.initialValue=c,i(a,s,o,l)}}else r.initialValue=n;return r}}function Wi(e,t){return t.split(".").reduce((r,n)=>r[n],e)}function vt(e,t,r){if(typeof t==="string")t=t.split(".");if(t.length===1)e[t[0]]=r;else if(t.length===0)throw error;else if(e[t[0]])return vt(e[t[0]],t.slice(1),r);else return e[t[0]]={},vt(e[t[0]],t.slice(1),r)}function M(e,t){Ur[e]=t}function qe(e,t){let r=Yi(t);return Object.entries(Ur).forEach(([n,i])=>{Object.defineProperty(e,`$${n}`,{get(){return i(t,r)},enumerable:!1})}),e}function Yi(e){let[t,r]=Yr(e),n={interceptor:zr,...t};return Rt(e,r),n}function Ji(e,t,r,...n){try{return r(...n)}catch(i){Je(i,e,t)}}function Je(...e){return qr(...e)}function Gi(e){qr=e}function Xi(e,t,r=void 0){e=Object.assign(e??{message:"No error message given."},{el:t,expression:r}),console.warn(`Alpine Expression Error: ${e.message}
2
2
 
3
3
  ${r?'Expression: "'+r+`"
4
4
 
5
- `:""}`,t),setTimeout(()=>{throw e},0)}function qr(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 Fr(...e)}function Zi(e){Fr=e}function Qi(e){Kr=e}function es(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)=>Je(s,i,t));else e(o)}else if(typeof t==="object"&&t instanceof Promise)t.then((o)=>e(o));else e(t)}function ts(...e){return Kr(...e)}function de(e=""){return qt+e}function rs(e){qt=e}function E(e,t){return qe[e]=t,{before(r){if(!qe[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 ns(e){return Object.keys(qe).includes(e)}function Ge(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=Vr(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(Xr((o,s)=>n[o]=s)).filter(Qr).map(os(n,r)).sort(as).map((o)=>ss(e,o))}function Vr(e){return Array.from(e).map(Xr()).filter((t)=>!Qr(t))}function is(e){_t=!0;let t=Symbol();Wr=t,me.set(t,[]);let r=()=>{while(me.get(t).length)me.get(t).shift()();me.delete(t)},n=()=>{_t=!1,r()};e(r),n()}function Yr(e){let t=[],r=(a)=>t.push(a),[n,i]=$i(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 ss(e,t){let r=()=>{},n=qe[t.type]||r,[i,o]=Yr(e);Br(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?me.get(Wr).push(n):n()};return s.runCleanups=o,s}function Xr(e=()=>{}){return({name:t,value:r})=>{let{name:n,value:i}=Zr.reduce((o,s)=>s(o),{name:t,value:r});if(n!==t)e(n,t);return{name:n,value:i}}}function Ft(e){Zr.push(e)}function Qr({name:e}){return en().test(e)}function os(e,t){return({name:r,value:n})=>{if(r===n)n="";let i=r.match(en()),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 as(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 ls(e){return(...t)=>j&&e(...t)}function Te(e){tn.push(e)}function cs(e,t){tn.forEach((r)=>r(e,t)),j=!0,rn(()=>{D(t,(r,n)=>{n(r,()=>{})})}),j=!1}function ds(e,t){if(!t._x_dataStack)t._x_dataStack=e._x_dataStack;j=!0,kt=!0,rn(()=>{us(t)}),j=!1,kt=!1}function us(e){let t=!1;D(e,(n,i)=>{X(n,(o,s)=>{if(t&&gs(o))return s();t=!0,i(o,s)})})}function rn(e){let t=re;mr((r,n)=>{let i=t(r);return ce(i),()=>{}}),e(),mr(t)}function fs(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;Xe++}r.pending++,Promise.resolve(t).catch((n)=>{try{Je(n,e)}catch(i){setTimeout(()=>{throw i},0)}}).then(()=>hs(e,r))}function hs(e,t){if(t.pending--,t.pending>0)return;if(ji(),t.pending>0)return;if(e._x_deferInit!==t)return;if(delete e._x_deferInit,t.ownsIgnore)delete e._x_ignore;if(Xe--,!e.isConnected)return;bs(t),D(e)}function ps(e,t){if(Xe===0)return!1;let r=T(e,(n)=>n._x_deferInit);if(!r)return!1;return nn(r._x_deferInit,e,t.map(({name:n})=>n)),!0}function nn(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 bs(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){nn(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;Ge(r,i).forEach((o)=>o())})}function ge(e,t,r={},n={}){return e.dispatchEvent(new CustomEvent(t,{detail:r,bubbles:!0,composed:!0,cancelable:!0,...n}))}function I(e,...t){console.warn(`Alpine Warning: ${e}`,...t)}function ms(){if(gr)I("Alpine has already been initialized on this page. Calling Alpine.start() more than once can cause problems.");if(gr=!0,!document.body)I("Unable to initialize. Trying to load Alpine before `<body>` is available. Did you forget to add `defer` in Alpine's `<script>` tag?");ge(document,"alpine:init"),ge(document,"alpine:initializing"),zt(),Hi((t)=>D(t,X)),Rt((t)=>ne(t)),Nr((t,r)=>{if(ps(t,r))return;Ge(t,r).forEach((n)=>n())});let e=(t)=>!Ze(t.parentElement,!0);Array.from(document.querySelectorAll(an().join(","))).filter(e).forEach((t)=>{D(t)}),ge(document,"alpine:initialized"),setTimeout(()=>{vs()})}function on(){return Kt.map((e)=>e())}function an(){return Kt.concat(sn).map((e)=>e())}function ln(e){Kt.push(e)}function cn(e){sn.push(e)}function Ze(e,t=!1){return T(e,(r)=>{if((t?an():on()).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 gs(e){return on().some((t)=>e.matches(t))}function ys(e){dn.push(e)}function D(e,t=X,r=()=>{}){if(T(e,(n)=>n._x_ignore))return;is(()=>{t(e,(n,i)=>{if(n._x_marker)return;if(r(n,i),dn.forEach((o)=>o(n,i)),Ge(n,n.attributes).forEach((o)=>o()),!n._x_ignore)n._x_marker=xs++;n._x_ignore&&i()})})}function ne(e,t=X){t(e,(r)=>{zi(r),Pr(r),delete r._x_marker})}function vs(){[["ui","dialog",["[x-dialog], [x-popover]"]],["anchor","anchor",["[x-anchor]"]],["sort","sort",["[x-sort]"]]].forEach(([t,r,n])=>{if(ns(r))return;n.some((i)=>{if(document.querySelector(i))return I(`found "${i}", but missing ${t} plugin`),!0})})}function Wt(e=()=>{}){return queueMicrotask(()=>{Vt||setTimeout(()=>{At()})}),new Promise((t)=>{St.push(()=>{e(),t()})})}function At(){Vt=!1;while(St.length)St.shift()()}function ws(){Vt=!0}function Yt(e,t){if(Array.isArray(t))return yr(e,t.join(" "));else if(typeof t==="object"&&t!==null)return _s(e,t);else if(typeof t==="function")return Yt(e,t());return yr(e,t)}function Ct(e){return e.split(/\s/).filter(Boolean)}function yr(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 _s(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 Qe(e,t){if(typeof t==="object"&&t!==null)return Es(e,t);return ks(e,t)}function Es(e,t){let r={};return Object.entries(t).forEach(([n,i])=>{if(r[n]=e.style[n],!n.startsWith("--"))n=Ss(n);e.style.setProperty(n,i)}),setTimeout(()=>{if(e.style.length===0)e.removeAttribute("style")}),()=>{Qe(e,r)}}function ks(e,t){let r=e.getAttribute("style",t);return e.setAttribute("style",t),()=>{e.setAttribute("style",r||"")}}function Ss(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 As(e,t,r){un(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 Cs(e,t,r){un(e,Qe);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((b,x)=>x<t.indexOf("out"));if(t.includes("out")&&!n)t=t.filter((b,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?pe(t,"scale",95)/100:1,u=pe(t,"delay",0)/1000,f=pe(t,"origin","center"),p="opacity, transform",m=pe(t,"duration",150)/1000,h=pe(t,"duration",75)/1000,g="cubic-bezier(0.4, 0.0, 0.2, 1)";if(i)e._x_transition.enter.during={transformOrigin:f,transitionDelay:`${u}s`,transitionProperty:p,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:f,transitionDelay:`${u}s`,transitionProperty:p,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 un(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 fn(e){let t=e.parentNode;if(!t)return;return t._x_hidePromise?t:fn(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;Ts(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 Ts(e,t){let r,n,i,o=Tt(()=>{_(()=>{if(r=!0,!n)t.before();if(!i)t.end(),At();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()}),ws(),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()}),At(),setTimeout(e._x_transitioning.finish,s+a),i=!0})})}function pe(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 hn(e,t,r,n=[]){if(!e._x_bindings)e._x_bindings=le({});switch(e._x_bindings[t]=r,t=n.includes("camel")?Ps(t):t,t){case"value":Os(e,r);break;case"style":Ls(e,r);break;case"class":Ms(e,r);break;case"selected":case"checked":Is(e,t,r);break;default:Jt(e,t,r);break}}function Os(e,t){if(Gt(e)){if(e.attributes.value===void 0)e.value=t}else if(Fe(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)=>$s(r,e.value));else e.checked=!!t;else if(e.tagName==="SELECT")Bs(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 Ms(e,t){if(e._x_undoAddedClasses)e._x_undoAddedClasses();e._x_undoAddedClasses=Yt(e,t)}function Ls(e,t){if(e._x_undoAddedStyles)e._x_undoAddedStyles();e._x_undoAddedStyles=Qe(e,t)}function Is(e,t,r){Jt(e,t,r),Ns(e,t,r)}function Jt(e,t,r){if([null,void 0,!1].includes(r)&&Hs(t))e.removeAttribute(t);else{if(pn(t))r=t;if(zs(r))r=JSON.stringify(r);Ds(e,t,r)}}function Ds(e,t,r){if(e.getAttribute(t)!=r)e.setAttribute(t,r)}function Ns(e,t,r){if(e[t]!==r)e[t]=r}function Bs(e,t){let r=[].concat(t).map((n)=>n+"");Array.from(e.options).forEach((n)=>{n.selected=r.includes(n.value)})}function Ps(e){return e.toLowerCase().replace(/-(\w)/g,(t,r)=>r.toUpperCase())}function $s(e,t){return e==t}function He(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 pn(e){return Rs.has(e)}function Hs(e){return!["aria-pressed","aria-checked","aria-expanded","aria-selected"].includes(e)}function zs(e){return typeof e==="object"&&e!==null}function Us(e,t,r){if(e._x_bindings&&e._x_bindings[t]!==void 0)return e._x_bindings[t];return bn(e,t,r)}function js(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,qr(()=>Y(e,i.expression))}return bn(e,t,r)}function bn(e,t,r){let n=e.getAttribute(t);if(n===null)return typeof r==="function"?r():r;if(n==="")return!0;if(pn(t))return!![t,"true"].includes(n);return n}function Fe(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 mn(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 gn(e,t){let r;return function(){let n=this,i=arguments;if(!r)e.apply(n,i),r=!0,setTimeout(()=>r=!1,t)}}function yn({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 qs(e){(Array.isArray(e)?e:[e]).forEach((r)=>r(ue))}function Fs(e,t){if(!xr)B=le(B),xr=!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 Ks(){return B}function Vs(e,t){let r=typeof t!=="function"?()=>t:t;if(e instanceof Element)return vn(e,r());else xn[e]=r;return()=>{}}function Ws(e){return Object.entries(xn).forEach(([t,r])=>{Object.defineProperty(e,t,{get(){return(...n)=>r(...n)}})}),e}function vn(e,t,r){let n=[];while(n.length)n.pop()();let i=Object.entries(t).map(([s,a])=>({name:s,value:a})),o=Vr(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}),Ge(e,i,r).map((s)=>{n.push(s.runCleanups),s()}),()=>{while(n.length)n.pop()()}}function Ys(e,t){wn[e]=t}function Js(e,t){return Object.entries(wn).forEach(([r,n])=>{Object.defineProperty(e,r,{get(){return(...i)=>n.bind(t)(...i)},enumerable:!1})}),e}function En(e){try{let r=new Zs(e).tokenize(),i=new Qs(r).parse(),o=new eo;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 to(e,t,r={}){let n=kn(e),i=G([r.scope??{},...n]),o=r.params??[],a=En(t)({scope:i,forceBindingRootScopeToFunctions:!0});if(typeof a==="function"&&W)return a.apply(i,o);return a}function ro(e,t){let r=kn(e);if(typeof t==="function")return es(r,t);let n=no(e,t,r);return Ji.bind(null,e,t,n)}function kn(e){let t={};return je(t,e),[t,...ae(e)]}function no(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=En(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 Sn(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 uo(e,t=!1){if(e.flags|=8,t){e.next=ve,ve=e;return}e.next=xe,xe=e}function Zt(){On++}function Qt(){if(--On>0)return;if(ve){let t=ve;ve=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 Mn(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Ln(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),ho(n)}else t=n;n.dep.activeLink=n.prevActiveLink,n.prevActiveLink=void 0,n=i}e.deps=t,e.depsTail=r}function Lt(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(fo(t.dep.computed)||t.dep.version!==t.version))return!0;if(e._dirty)return!0;return!1}function fo(e){if(e.flags&4&&!(e.flags&16))return;if(e.flags&=-17,e.globalVersion===Ke)return;if(e.globalVersion=Ke,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Lt(e)))return;e.flags|=2;let t=e.dep,r=v,n=O;v=e,O=!0;try{Mn(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{v=r,O=n,Ln(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 ho(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 po(e,t){if(e.effect instanceof wr)e=e.effect.fn;let r=new wr(e);if(t)_e(r,t);try{r.run()}catch(i){throw r.stop(),i}let n=r.run.bind(r);return n.effect=r,n}function bo(e){e.effect.stop()}function mo(){In.push(O),O=!1}function go(){let e=In.pop();O=e===void 0?!0:e}function _r(e){let{cleanup:t}=e;if(e.cleanup=void 0,t){let r=v;v=void 0;try{t()}finally{v=r}}}function Dn(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)Dn(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 C(e,t,r){if(O&&v){let n=It.get(e);if(!n)It.set(e,n=new Map);let i=n.get(r);if(!i)n.set(r,i=new xo),i.map=n,i.key=r;i.track({target:e,type:t,key:r})}}function U(e,t,r,n,i,o){let s=It.get(e);if(!s){Ke++;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=Ee(e),c=l&&Xt(r);if(l&&r==="length"){let d=Number(n);s.forEach((u,f)=>{if(f==="length"||f===Se||!Oe(f)&&f>=d)a(u)})}else{if(r!==void 0||s.has(void 0))a(s.get(r));if(c)a(s.get(Se));switch(t){case"add":if(!l){if(a(s.get(J)),ye(e))a(s.get(Dt))}else if(c)a(s.get("length"));break;case"delete":if(!l){if(a(s.get(J)),ye(e))a(s.get(Dt))}break;case"set":if(ye(e))a(s.get(J));break}}}Qt()}function se(e){let t=w(e);if(t===e)return t;return C(t,"iterate",Se),ee(e)?t:t.map(te)}function tr(e){return C(e=w(e),"iterate",Se),e}function L(e,t){if(Q(e))return zn(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!==wo[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,L(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 Er(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=L(e,c);return r.call(this,c,L(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?L(e,l):l}function ht(e,t,r){let n=w(e);C(n,"iterate",Se);let i=n[t](...r);if((i===-1||i===!1)&&Bo(r[0]))return r[0]=w(r[0]),n[t](...r);return i}function be(e,t,r=[]){mo(),Zt();let n=w(e)[t].apply(e,r);return Qt(),go(),n}function Eo(e){if(!Oe(e))e=String(e);let t=w(this);return C(t,"has",e),t.hasOwnProperty(e)}function To(e,t,r){return function(...n){let i=this.__v_raw,o=w(i),s=ye(o),a=e==="entries"||e===Symbol.iterator&&s,l=e==="keys"&&s,c=i[e](...n),d=r?Nt:t?Ae:te;return!t&&C(o,"iterate",l?Dt:J),_e(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 $e(e){return function(...t){{let r=t[0]?`on key "${t[0]}" `:"";Z(`${Tn(e)} operation ${r}failed: target is readonly.`,w(this))}return e==="delete"?!1:e==="clear"?void 0:this}}function Oo(e,t){let r={get(i){let o=this.__v_raw,s=w(o),a=w(i);if(!e){if(K(i,a))C(s,"get",i);C(s,"get",a)}let{has:l}=Pe(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&&C(w(i),"iterate",J),i.size},has(i){let o=this.__v_raw,s=w(o),a=w(i);if(!e){if(K(i,a))C(s,"has",i);C(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=w(a),c=t?Nt:e?Ae:te;return!e&&C(l,"iterate",J),a.forEach((d,u)=>i.call(o,c(d),c(u),s))}};return _e(r,e?{add:$e("add"),set:$e("set"),delete:$e("delete"),clear:$e("clear")}:{add(i){let o=w(this),s=Pe(o),a=w(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=w(o);let s=w(this),{has:a,get:l}=Pe(s),c=a.call(s,i);if(!c)i=w(i),c=a.call(s,i);else kr(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=w(this),{has:s,get:a}=Pe(o),l=s.call(o,i);if(!l)i=w(i),l=s.call(o,i);else kr(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=w(this),o=i.size!==0,s=ye(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]=To(i,e,t)}),r}function Pn(e,t){let r=Oo(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 kr(e,t,r){let n=w(r);if(n!==r&&t.call(e,n)){let i=Cn(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 No(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 Hn(e,!1,Ao,Mo,$n)}function Bt(e){return Hn(e,!0,Co,Lo,Rn)}function Hn(e,t,r,n,i){if(!ke(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=No(Cn(e));if(s===0)return e;let a=new Proxy(e,s===2?n:r);return i.set(e,a),a}function zn(e){if(Q(e))return zn(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 Bo(e){return e?!!e.__v_raw:!1}function w(e){let t=e&&e.__v_raw;return t?w(t):e}function we(e){return e?e.__v_isRef===!0:!1}function Po(e){let t=[];return T(e,(r)=>{if(r._x_refs)t.push(r._x_refs)}),t}function Un(e){if(!pt[e])pt[e]=0;return++pt[e]}function $o(e,t){return T(e,(r)=>{if(r._x_ids&&r._x_ids[t])return!0})}function Ro(e,t){if(!e._x_ids)e._x_ids={};if(!e._x_ids[t])e._x_ids[t]=Un(t)}function Ho(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 jn(e,t,r){M(t,(n)=>I(`You can't use [$${t}] without first installing the "${e}" plugin here: https://alpinejs.dev/plugins/${r}`,n))}function Sr(e){let t=R(()=>document.querySelector(e),()=>zo)();if(!t)I(`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=Uo(t);if(r.includes("camel"))t=jo(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=Fn(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(Fo(t)||Kn(t))o=a(o,(l,c)=>{if(Vo(c,r))return;l(c)});return i.addEventListener(t,o,s),()=>{i.removeEventListener(t,o,s)}}function Fn(e,t){if(e.includes("debounce")){let r=e[e.indexOf("debounce")+1]||"invalid-wait",n=Ve(r.split("ms")[0])?Number(r.split("ms")[0]):250;t=mn(t,n)}if(e.includes("throttle")){let r=e[e.indexOf("throttle")+1]||"invalid-wait",n=Ve(r.split("ms")[0])?Number(r.split("ms")[0]):250;t=gn(t,n)}return t}function Uo(e){return e.replace(/-/g,".")}function jo(e){return e.toLowerCase().replace(/-(\w)/g,(t,r)=>r.toUpperCase())}function Ve(e){return!Array.isArray(e)&&!isNaN(e)}function qo(e){if([" ","_"].includes(e))return e;return e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[_\s]/,"-").toLowerCase()}function Fo(e){return["keydown","keyup"].includes(e)}function Kn(e){return["contextmenu","click","mouse"].some((t)=>e.includes(t))}function Vo(e,t){let r=t.filter((o,s)=>{if(o==="false"&&t[s-1]==="passive")return!1;return!Ko.includes(o)});if(r.includes("debounce")){let o=r.indexOf("debounce");r.splice(o,Ve((r[o+1]||"invalid-wait").split("ms")[0])?2:1)}if(r.includes("throttle")){let o=r.indexOf("throttle");r.splice(o,Ve((r[o+1]||"invalid-wait").split("ms")[0])?2:1)}if(r.length===0)return!1;if(r.length===1&&Ar(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(Kn(e.type))return!1;if(Ar(e.key).includes(r[0]))return!1}}return!0}function Ar(e){if(!e)return[];e=qo(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 Re(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(Fe(e))if(Array.isArray(n)){let i=null;if(t.includes("number"))i=bt(r.target.value);else if(t.includes("boolean"))i=He(r.target.value);else i=r.target.value;return r.target.checked?n.includes(i)?n:n.concat([i]):n.filter((o)=>!Wo(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 He(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 He(i);else if(t.includes("trim"))return i.trim();else return i}})}function bt(e){let t=e?parseFloat(e):null;return Yo(t)?t:e}function Wo(e,t){return e==t}function Yo(e){return!Array.isArray(e)&&!isNaN(e)}function Cr(e){return e!==null&&typeof e==="object"&&typeof e.get==="function"&&typeof e.set==="function"}function Jo(e,t){e._x_keyExpression=t}function Go(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 Xo(e){if(!j)return!1;if(kt)return!0;return e.hasAttribute("data-has-alpine-state")}function Zo(e){return(t)=>{Object.entries(t).forEach(([r,n])=>{e[r]=n})}}function Qo(e,t,r,n){r((i)=>{if(ra(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=na(i),l=Object.entries(i).map(([c,d])=>{if(!a)c=parseInt(c);let u=ta(t,d,c,i),f;return n((p)=>{if(typeof p==="object")I("x-for key cannot be an object, it must be a string or an integer",e);if(o.has(p))s.set(p,o.get(p)),o.delete(p);f=p},{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 h=s.get(u);if(h._x_refreshXForScope(f),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)I("x-for templates require a single root element, additional elements will be ignored.",e);let p=document.importNode(e.content,!0).firstElementChild,m=le(f);Ce(p,m,e),p._x_refreshXForScope=Zo(m),s.set(u,p),c.add(p),d.after(p),d=p}),c.forEach((u)=>D(u)),d!==e)e._x_lastRenderedEl=d;else delete e._x_lastRenderedEl})})}function ea(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 ta(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 ra(e){return typeof e!=="object"&&!isNaN(e)}function na(e){return typeof e==="object"&&!Array.isArray(e)}function Wn(){}function tt(e,t,r){E(t,(n)=>I(`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,yt=-1,ze=!1,Pt=!1,le,re,ce,Or,Ni=0,xt=!0,Lr,Ir,Dr,We,Ht=!1,F,Ut=!1,Ue,Ki,Ur,jr,W=!0,Fr=()=>{},Kr,qt="x-",qe,_t=!1,me,Wr,Jr=(e,t)=>({name:r,value:n})=>{if(r.startsWith(e))r=r.replace(e,t);return{name:r,value:n}},Gr=(e)=>e,Zr,en=()=>new RegExp(`^${qt}([^:^.]+)\\b`),Et="DEFAULT",V,j=!1,tn,kt=!1,Xe=0,gr=!1,Kt,sn,dn,xs=1,St,Vt=!1,Rs,B,xr=!1,xn,wn,Gs,ue,vr,_n,k=class{constructor(e,t,r,n){this.type=e,this.value=t,this.start=r,this.end=n}},Xs,Zs=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 jr(e){let t=W;W=!1;let r=e();return W=t,r}function Y(e,t,r={}){let n;return S(e,t)((i)=>n=i,r),n}function S(...e){return Fr(...e)}function Zi(e){Fr=e}function Qi(e){Kr=e}function es(e,t){return(r=()=>{},{scope:n={},params:i=[],context:a}={})=>{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 a=t.apply(r,n);if(a instanceof Promise)a.then((s)=>wt(e,s,r,n)).catch((s)=>Je(s,i,t));else e(a)}else if(typeof t==="object"&&t instanceof Promise)t.then((a)=>e(a));else e(t)}function ts(...e){return Kr(...e)}function de(e=""){return jt+e}function rs(e){jt=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 ns(e){return Object.keys(je).includes(e)}function Ge(e,t,r){if(t=Array.from(t),e._x_virtualDirectives){let a=Object.entries(e._x_virtualDirectives).map(([o,l])=>({name:o,value:l})),s=Vr(a);a=a.map((o)=>{if(s.find((l)=>l.name===o.name))return{name:`x-bind:${o.name}`,value:`"${o.value}"`};return o}),t=t.concat(a)}let n={};return t.map(Xr((a,s)=>n[a]=s)).filter(Qr).map(os(n,r)).sort(as).map((a)=>ss(e,a))}function Vr(e){return Array.from(e).map(Xr()).filter((t)=>!Qr(t))}function is(e){_t=!0;let t=Symbol();Wr=t,me.set(t,[]);let r=()=>{while(me.get(t).length)me.get(t).shift()();me.delete(t)},n=()=>{_t=!1,r()};e(r),n()}function Yr(e){let t=[],r=(o)=>t.push(o),[n,i]=$i(e);return t.push(i),[{Alpine:ue,effect:n,cleanup:r,evaluateLater:S.bind(S,e),evaluate:Y.bind(Y,e)},()=>t.forEach((o)=>o())]}function ss(e,t){let r=()=>{},n=je[t.type]||r,[i,a]=Yr(e);Br(e,t.original,a);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?me.get(Wr).push(n):n()};return s.runCleanups=a,s}function Xr(e=()=>{}){return({name:t,value:r})=>{let{name:n,value:i}=Zr.reduce((a,s)=>s(a),{name:t,value:r});if(n!==t)e(n,t);return{name:n,value:i}}}function Ft(e){Zr.push(e)}function Qr({name:e}){return en().test(e)}function os(e,t){return({name:r,value:n})=>{if(r===n)n="";let i=r.match(en()),a=r.match(/:([a-zA-Z0-9\-_:]+)/),s=r.match(/\.[^.\]]+(?=[^\]]*$)/g)||[],o=t||e[r]||r;return{type:i?i[1]:null,value:a?a[1]:null,modifiers:s.map((l)=>l.replace(".","")),expression:n,original:o}}}function as(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)=>q?t(...r):e(...r)}function ls(e){return(...t)=>q&&e(...t)}function Te(e){tn.push(e)}function cs(e,t){tn.forEach((r)=>r(e,t)),q=!0,rn(()=>{D(t,(r,n)=>{n(r,()=>{})})}),q=!1}function ds(e,t){if(!t._x_dataStack)t._x_dataStack=e._x_dataStack;q=!0,kt=!0,rn(()=>{us(t)}),q=!1,kt=!1}function us(e){let t=!1;D(e,(n,i)=>{X(n,(a,s)=>{if(t&&gs(a))return s();t=!0,i(a,s)})})}function rn(e){let t=re;mr((r,n)=>{let i=t(r);return ce(i),()=>{}}),e(),mr(t)}function fs(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;Xe++}r.pending++,Promise.resolve(t).catch((n)=>{try{Je(n,e)}catch(i){setTimeout(()=>{throw i},0)}}).then(()=>hs(e,r))}function hs(e,t){if(t.pending--,t.pending>0)return;if(qi(),t.pending>0)return;if(e._x_deferInit!==t)return;if(delete e._x_deferInit,t.ownsIgnore)delete e._x_ignore;if(Xe--,!e.isConnected)return;ps(t),D(e)}function bs(e,t){if(Xe===0)return!1;let r=T(e,(n)=>n._x_deferInit);if(!r)return!1;return nn(r._x_deferInit,e,t.map(({name:n})=>n)),!0}function nn(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 ps(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,(a)=>a._x_deferInit);if(n){nn(n._x_deferInit,r,Array.from(t.names));return}let i=Array.from(t.names).filter((a)=>r.hasAttribute(a)).map((a)=>({name:a,value:r.getAttribute(a)}));if(i.length===0)return;Ge(r,i).forEach((a)=>a())})}function ge(e,t,r={},n={}){return e.dispatchEvent(new CustomEvent(t,{detail:r,bubbles:!0,composed:!0,cancelable:!0,...n}))}function I(e,...t){console.warn(`Alpine Warning: ${e}`,...t)}function ms(){if(gr)I("Alpine has already been initialized on this page. Calling Alpine.start() more than once can cause problems.");if(gr=!0,!document.body)I("Unable to initialize. Trying to load Alpine before `<body>` is available. Did you forget to add `defer` in Alpine's `<script>` tag?");ge(document,"alpine:init"),ge(document,"alpine:initializing"),zt(),Hi((t)=>D(t,X)),Rt((t)=>ne(t)),Nr((t,r)=>{if(bs(t,r))return;Ge(t,r).forEach((n)=>n())});let e=(t)=>!Ze(t.parentElement,!0);Array.from(document.querySelectorAll(an().join(","))).filter(e).forEach((t)=>{D(t)}),ge(document,"alpine:initialized"),setTimeout(()=>{vs()})}function on(){return Kt.map((e)=>e())}function an(){return Kt.concat(sn).map((e)=>e())}function ln(e){Kt.push(e)}function cn(e){sn.push(e)}function Ze(e,t=!1){return T(e,(r)=>{if((t?an():on()).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 gs(e){return on().some((t)=>e.matches(t))}function ys(e){dn.push(e)}function D(e,t=X,r=()=>{}){if(T(e,(n)=>n._x_ignore))return;is(()=>{t(e,(n,i)=>{if(n._x_marker)return;if(r(n,i),dn.forEach((a)=>a(n,i)),Ge(n,n.attributes).forEach((a)=>a()),!n._x_ignore)n._x_marker=xs++;n._x_ignore&&i()})})}function ne(e,t=X){t(e,(r)=>{zi(r),Pr(r),delete r._x_marker})}function vs(){[["ui","dialog",["[x-dialog], [x-popover]"]],["anchor","anchor",["[x-anchor]"]],["sort","sort",["[x-sort]"]]].forEach(([t,r,n])=>{if(ns(r))return;n.some((i)=>{if(document.querySelector(i))return I(`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 ws(){Vt=!0}function Yt(e,t){if(Array.isArray(t))return yr(e,t.join(" "));else if(typeof t==="object"&&t!==null)return _s(e,t);else if(typeof t==="function")return Yt(e,t());return yr(e,t)}function Ct(e){return e.split(/\s/).filter(Boolean)}function yr(e,t){let r=(i)=>Ct(i).filter((a)=>!e.classList.contains(a)).filter(Boolean),n=(i)=>(e.classList.add(...i),()=>{e.classList.remove(...i)});return t=t===!0?t="":t||"",n(r(t))}function _s(e,t){let r=Object.entries(t).flatMap(([s,o])=>o?Ct(s):!1).filter(Boolean),n=Object.entries(t).flatMap(([s,o])=>!o?Ct(s):!1).filter(Boolean),i=[],a=[];return n.forEach((s)=>{if(e.classList.contains(s))e.classList.remove(s),a.push(s)}),r.forEach((s)=>{if(!e.classList.contains(s))e.classList.add(s),i.push(s)}),()=>{a.forEach((s)=>e.classList.add(s)),i.forEach((s)=>e.classList.remove(s))}}function Qe(e,t){if(typeof t==="object"&&t!==null)return Es(e,t);return ks(e,t)}function Es(e,t){let r={};return Object.entries(t).forEach(([n,i])=>{if(r[n]=e.style[n],!n.startsWith("--"))n=As(n);e.style.setProperty(n,i)}),setTimeout(()=>{if(e.style.length===0)e.removeAttribute("style")}),()=>{Qe(e,r)}}function ks(e,t){let r=e.getAttribute("style",t);return e.setAttribute("style",t),()=>{e.setAttribute("style",r||"")}}function As(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 Ss(e,t,r){un(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 Cs(e,t,r){un(e,Qe);let n=!t.includes("in")&&!t.includes("out")&&!r,i=n||t.includes("in")||["enter"].includes(r),a=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"),o=s||t.includes("opacity"),l=s||t.includes("scale"),c=o?0:1,d=l?be(t,"scale",95)/100:1,u=be(t,"delay",0)/1000,f=be(t,"origin","center"),b="opacity, transform",m=be(t,"duration",150)/1000,p=be(t,"duration",75)/1000,g="cubic-bezier(0.4, 0.0, 0.2, 1)";if(i)e._x_transition.enter.during={transformOrigin:f,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(a)e._x_transition.leave.during={transformOrigin:f,transitionDelay:`${u}s`,transitionProperty:b,transitionDuration:`${p}s`,transitionTimingFunction:g},e._x_transition.leave.start={opacity:1,transform:"scale(1)"},e._x_transition.leave.end={opacity:c,transform:`scale(${d})`}}function un(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 fn(e){let t=e.parentNode;if(!t)return;return t._x_hidePromise?t:fn(t)}function Ot(e,t,{during:r,start:n,end:i}={},a=()=>{},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){a(),s();return}let o,l,c;Ts(e,{start(){o=t(e,n)},during(){l=t(e,r)},before:a,end(){o(),c=t(e,i)},after:s,cleanup(){l(),c()}})}function Ts(e,t){let r,n,i,a=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()();a()}),finish:a},_(()=>{t.start(),t.during()}),ws(),requestAnimationFrame(()=>{if(r)return;let s=Number(getComputedStyle(e).transitionDuration.replace(/,.*/,"").replace("s",""))*1000,o=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+o),i=!0})})}function be(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 hn(e,t,r,n=[]){if(!e._x_bindings)e._x_bindings=le({});switch(e._x_bindings[t]=r,t=n.includes("camel")?Ps(t):t,t){case"value":Os(e,r);break;case"style":Ls(e,r);break;case"class":Ms(e,r);break;case"selected":case"checked":Is(e,t,r);break;default:Jt(e,t,r);break}}function Os(e,t){if(Gt(e)){if(e.attributes.value===void 0)e.value=t}else if(Fe(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)=>$s(r,e.value));else e.checked=!!t;else if(e.tagName==="SELECT")Bs(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 Ms(e,t){if(e._x_undoAddedClasses)e._x_undoAddedClasses();e._x_undoAddedClasses=Yt(e,t)}function Ls(e,t){if(e._x_undoAddedStyles)e._x_undoAddedStyles();e._x_undoAddedStyles=Qe(e,t)}function Is(e,t,r){Jt(e,t,r),Ns(e,t,r)}function Jt(e,t,r){if([null,void 0,!1].includes(r)&&Hs(t))e.removeAttribute(t);else{if(bn(t))r=t;if(zs(r))r=JSON.stringify(r);Ds(e,t,r)}}function Ds(e,t,r){if(e.getAttribute(t)!=r)e.setAttribute(t,r)}function Ns(e,t,r){if(e[t]!==r)e[t]=r}function Bs(e,t){let r=[].concat(t).map((n)=>n+"");Array.from(e.options).forEach((n)=>{n.selected=r.includes(n.value)})}function Ps(e){return e.toLowerCase().replace(/-(\w)/g,(t,r)=>r.toUpperCase())}function $s(e,t){return e==t}function He(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 bn(e){return Rs.has(e)}function Hs(e){return!["aria-pressed","aria-checked","aria-expanded","aria-selected"].includes(e)}function zs(e){return typeof e==="object"&&e!==null}function Us(e,t,r){if(e._x_bindings&&e._x_bindings[t]!==void 0)return e._x_bindings[t];return pn(e,t,r)}function qs(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,jr(()=>Y(e,i.expression))}return pn(e,t,r)}function pn(e,t,r){let n=e.getAttribute(t);if(n===null)return typeof r==="function"?r():r;if(n==="")return!0;if(bn(t))return!![t,"true"].includes(n);return n}function Fe(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 mn(e,t){let r;return function(){let n=this,i=arguments,a=function(){r=null,e.apply(n,i)};clearTimeout(r),r=setTimeout(a,t)}}function gn(e,t){let r;return function(){let n=this,i=arguments;if(!r)e.apply(n,i),r=!0,setTimeout(()=>r=!1,t)}}function yn({get:e,set:t},{get:r,set:n}){let i=!0,a,s,o=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!==a)n(ct(l));else if(d!==u)t(ct(c))}a=JSON.stringify(e()),s=JSON.stringify(r())});return()=>{$t(o),ce(o)}}function ct(e){return typeof e==="object"?JSON.parse(JSON.stringify(e)):e}function js(e){(Array.isArray(e)?e:[e]).forEach((r)=>r(ue))}function Fs(e,t){if(!xr)B=le(B),xr=!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 qt(B[e]);if(typeof t==="object"&&t!==null&&t.hasOwnProperty("init")&&typeof t.init==="function")B[e].init()}function Ks(){return B}function Vs(e,t){let r=typeof t!=="function"?()=>t:t;if(e instanceof Element)return vn(e,r());else xn[e]=r;return()=>{}}function Ws(e){return Object.entries(xn).forEach(([t,r])=>{Object.defineProperty(e,t,{get(){return(...n)=>r(...n)}})}),e}function vn(e,t,r){let n=[];while(n.length)n.pop()();let i=Object.entries(t).map(([s,o])=>({name:s,value:o})),a=Vr(i);return i=i.map((s)=>{if(a.find((o)=>o.name===s.name))return{name:`x-bind:${s.name}`,value:`"${s.value}"`};return s}),Ge(e,i,r).map((s)=>{n.push(s.runCleanups),s()}),()=>{while(n.length)n.pop()()}}function Ys(e,t){wn[e]=t}function Js(e,t){return Object.entries(wn).forEach(([r,n])=>{Object.defineProperty(e,r,{get(){return(...i)=>n.bind(t)(...i)},enumerable:!1})}),e}function En(e){try{let r=new Zs(e).tokenize(),i=new Qs(r).parse(),a=new eo;return function(s={}){let{scope:o={},context:l=null,forceBindingRootScopeToFunctions:c=!1}=s;return a.evaluate({node:i,scope:o,context:l,forceBindingRootScopeToFunctions:c})}}catch(t){throw Error(`CSP Parser Error: ${t.message}`)}}function to(e,t,r={}){let n=kn(e),i=G([r.scope??{},...n]),a=r.params??[],o=En(t)({scope:i,forceBindingRootScopeToFunctions:!0});if(typeof o==="function"&&W)return o.apply(i,a);return o}function ro(e,t){let r=kn(e);if(typeof t==="function")return es(r,t);let n=no(e,t,r);return Ji.bind(null,e,t,n)}function kn(e){let t={};return qe(t,e),[t,...ae(e)]}function no(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:a=[]}={})=>{let s=G([i,...r]),l=En(t)({scope:s,forceBindingRootScopeToFunctions:!0});if(W&&typeof l==="function"){let c=l.apply(l,a);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 An(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 uo(e,t=!1){if(e.flags|=8,t){e.next=ve,ve=e;return}e.next=xe,xe=e}function Zt(){On++}function Qt(){if(--On>0)return;if(ve){let t=ve;ve=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 Mn(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Ln(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),ho(n)}else t=n;n.dep.activeLink=n.prevActiveLink,n.prevActiveLink=void 0,n=i}e.deps=t,e.depsTail=r}function Lt(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(fo(t.dep.computed)||t.dep.version!==t.version))return!0;if(e._dirty)return!0;return!1}function fo(e){if(e.flags&4&&!(e.flags&16))return;if(e.flags&=-17,e.globalVersion===Ke)return;if(e.globalVersion=Ke,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Lt(e)))return;e.flags|=2;let t=e.dep,r=v,n=O;v=e,O=!0;try{Mn(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{v=r,O=n,Ln(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 a=r.computed.deps;a;a=a.nextDep)er(a,!0)}}if(!t&&!--r.sc&&r.map)r.map.delete(r.key)}function ho(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 bo(e,t){if(e.effect instanceof wr)e=e.effect.fn;let r=new wr(e);if(t)_e(r,t);try{r.run()}catch(i){throw r.stop(),i}let n=r.run.bind(r);return n.effect=r,n}function po(e){e.effect.stop()}function mo(){In.push(O),O=!1}function go(){let e=In.pop();O=e===void 0?!0:e}function _r(e){let{cleanup:t}=e;if(e.cleanup=void 0,t){let r=v;v=void 0;try{t()}finally{v=r}}}function Dn(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)Dn(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 C(e,t,r){if(O&&v){let n=It.get(e);if(!n)It.set(e,n=new Map);let i=n.get(r);if(!i)n.set(r,i=new xo),i.map=n,i.key=r;i.track({target:e,type:t,key:r})}}function U(e,t,r,n,i,a){let s=It.get(e);if(!s){Ke++;return}let o=(l)=>{if(l)l.trigger({target:e,type:t,key:r,newValue:n,oldValue:i,oldTarget:a})};if(Zt(),t==="clear")s.forEach(o);else{let l=Ee(e),c=l&&Xt(r);if(l&&r==="length"){let d=Number(n);s.forEach((u,f)=>{if(f==="length"||f===Ae||!Oe(f)&&f>=d)o(u)})}else{if(r!==void 0||s.has(void 0))o(s.get(r));if(c)o(s.get(Ae));switch(t){case"add":if(!l){if(o(s.get(J)),ye(e))o(s.get(Dt))}else if(c)o(s.get("length"));break;case"delete":if(!l){if(o(s.get(J)),ye(e))o(s.get(Dt))}break;case"set":if(ye(e))o(s.get(J));break}}}Qt()}function se(e){let t=w(e);if(t===e)return t;return C(t,"iterate",Ae),ee(e)?t:t.map(te)}function tr(e){return C(e=w(e),"iterate",Ae),e}function L(e,t){if(Q(e))return zn(e)?Se(te(t)):Se(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 a=i._next();if(!a.done)a.value=r(a.value);return a};return i}function N(e,t,r,n,i,a){let s=tr(e),o=s!==e&&!ee(e),l=s[t];if(l!==wo[t]){let u=l.apply(e,a);return o?te(u):u}let c=r;if(s!==e){if(o)c=function(u,f){return r.call(this,L(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 o&&i?i(d):d}function Er(e,t,r,n){let i=tr(e),a=i!==e&&!ee(e),s=r,o=!1;if(i!==e){if(a)o=n.length===0,s=function(c,d,u){if(o)o=!1,c=L(e,c);return r.call(this,c,L(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 o?L(e,l):l}function ht(e,t,r){let n=w(e);C(n,"iterate",Ae);let i=n[t](...r);if((i===-1||i===!1)&&Bo(r[0]))return r[0]=w(r[0]),n[t](...r);return i}function pe(e,t,r=[]){mo(),Zt();let n=w(e)[t].apply(e,r);return Qt(),go(),n}function Eo(e){if(!Oe(e))e=String(e);let t=w(this);return C(t,"has",e),t.hasOwnProperty(e)}function To(e,t,r){return function(...n){let i=this.__v_raw,a=w(i),s=ye(a),o=e==="entries"||e===Symbol.iterator&&s,l=e==="keys"&&s,c=i[e](...n),d=r?Nt:t?Se:te;return!t&&C(a,"iterate",l?Dt:J),_e(Object.create(c),{next(){let{value:u,done:f}=c.next();return f?{value:u,done:f}:{value:o?[d(u[0]),d(u[1])]:d(u),done:f}}})}}function $e(e){return function(...t){{let r=t[0]?`on key "${t[0]}" `:"";Z(`${Tn(e)} operation ${r}failed: target is readonly.`,w(this))}return e==="delete"?!1:e==="clear"?void 0:this}}function Oo(e,t){let r={get(i){let a=this.__v_raw,s=w(a),o=w(i);if(!e){if(K(i,o))C(s,"get",i);C(s,"get",o)}let{has:l}=Pe(s),c=t?Nt:e?Se:te;if(l.call(s,i))return c(a.get(i));else if(l.call(s,o))return c(a.get(o));else if(a!==s)a.get(i)},get size(){let i=this.__v_raw;return!e&&C(w(i),"iterate",J),i.size},has(i){let a=this.__v_raw,s=w(a),o=w(i);if(!e){if(K(i,o))C(s,"has",i);C(s,"has",o)}return i===o?a.has(i):a.has(i)||a.has(o)},forEach(i,a){let s=this,o=s.__v_raw,l=w(o),c=t?Nt:e?Se:te;return!e&&C(l,"iterate",J),o.forEach((d,u)=>i.call(a,c(d),c(u),s))}};return _e(r,e?{add:$e("add"),set:$e("set"),delete:$e("delete"),clear:$e("clear")}:{add(i){let a=w(this),s=Pe(a),o=w(i),l=!t&&!ee(i)&&!Q(i)?o:i;if(!(s.has.call(a,l)||K(i,l)&&s.has.call(a,i)||K(o,l)&&s.has.call(a,o)))a.add(l),U(a,"add",l,l);return this},set(i,a){if(!t&&!ee(a)&&!Q(a))a=w(a);let s=w(this),{has:o,get:l}=Pe(s),c=o.call(s,i);if(!c)i=w(i),c=o.call(s,i);else kr(s,o,i);let d=l.call(s,i);if(s.set(i,a),!c)U(s,"add",i,a);else if(K(a,d))U(s,"set",i,a,d);return this},delete(i){let a=w(this),{has:s,get:o}=Pe(a),l=s.call(a,i);if(!l)i=w(i),l=s.call(a,i);else kr(a,s,i);let c=o?o.call(a,i):void 0,d=a.delete(i);if(l)U(a,"delete",i,void 0,c);return d},clear(){let i=w(this),a=i.size!==0,s=ye(i)?new Map(i):new Set(i),o=i.clear();if(a)U(i,"clear",void 0,void 0,s);return o}}),["keys","values","entries",Symbol.iterator].forEach((i)=>{r[i]=To(i,e,t)}),r}function Pn(e,t){let r=Oo(e,t);return(n,i,a)=>{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,a)}}function kr(e,t,r){let n=w(r);if(n!==r&&t.call(e,n)){let i=Cn(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 No(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 Hn(e,!1,So,Mo,$n)}function Bt(e){return Hn(e,!0,Co,Lo,Rn)}function Hn(e,t,r,n,i){if(!ke(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 a=i.get(e);if(a)return a;let s=No(Cn(e));if(s===0)return e;let o=new Proxy(e,s===2?n:r);return i.set(e,o),o}function zn(e){if(Q(e))return zn(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 Bo(e){return e?!!e.__v_raw:!1}function w(e){let t=e&&e.__v_raw;return t?w(t):e}function we(e){return e?e.__v_isRef===!0:!1}function Po(e){let t=[];return T(e,(r)=>{if(r._x_refs)t.push(r._x_refs)}),t}function Un(e){if(!bt[e])bt[e]=0;return++bt[e]}function $o(e,t){return T(e,(r)=>{if(r._x_ids&&r._x_ids[t])return!0})}function Ro(e,t){if(!e._x_ids)e._x_ids={};if(!e._x_ids[t])e._x_ids[t]=Un(t)}function Ho(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 qn(e,t,r){M(t,(n)=>I(`You can't use [$${t}] without first installing the "${e}" plugin here: https://alpinejs.dev/plugins/${r}`,n))}function Ar(e){let t=R(()=>document.querySelector(e),()=>zo)();if(!t)I(`Cannot find x-teleport element for selector: "${e}"`);return t}function oe(e,t,r,n){let i=e,a=(l)=>n(l),s={},o=(l,c)=>(d)=>c(l,d);if(r.includes("dot"))t=Uo(t);if(r.includes("camel"))t=qo(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(a=Fn(r,a),r.includes("prevent"))a=o(a,(l,c)=>{c.preventDefault(),l(c)});if(r.includes("stop"))a=o(a,(l,c)=>{c.stopPropagation(),l(c)});if(r.includes("once"))a=o(a,(l,c)=>{l(c),i.removeEventListener(t,a,s)});if(r.includes("away")||r.includes("outside"))i=document,a=o(a,(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"))a=o(a,(l,c)=>{c.target===e&&l(c)});if(t==="submit")a=o(a,(l,c)=>{if(c.target._x_pendingModelUpdates)c.target._x_pendingModelUpdates.forEach((d)=>d());l(c)});if(Fo(t)||Kn(t))a=o(a,(l,c)=>{if(Vo(c,r))return;l(c)});return i.addEventListener(t,a,s),()=>{i.removeEventListener(t,a,s)}}function Fn(e,t){if(e.includes("debounce")){let r=e[e.indexOf("debounce")+1]||"invalid-wait",n=Ve(r.split("ms")[0])?Number(r.split("ms")[0]):250;t=mn(t,n)}if(e.includes("throttle")){let r=e[e.indexOf("throttle")+1]||"invalid-wait",n=Ve(r.split("ms")[0])?Number(r.split("ms")[0]):250;t=gn(t,n)}return t}function Uo(e){return e.replace(/-/g,".")}function qo(e){return e.toLowerCase().replace(/-(\w)/g,(t,r)=>r.toUpperCase())}function Ve(e){return!Array.isArray(e)&&!isNaN(e)}function jo(e){if([" ","_"].includes(e))return e;return e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[_\s]/,"-").toLowerCase()}function Fo(e){return["keydown","keyup"].includes(e)}function Kn(e){return["contextmenu","click","mouse"].some((t)=>e.includes(t))}function Vo(e,t){let r=t.filter((a,s)=>{if(a==="false"&&t[s-1]==="passive")return!1;return!Ko.includes(a)});if(r.includes("debounce")){let a=r.indexOf("debounce");r.splice(a,Ve((r[a+1]||"invalid-wait").split("ms")[0])?2:1)}if(r.includes("throttle")){let a=r.indexOf("throttle");r.splice(a,Ve((r[a+1]||"invalid-wait").split("ms")[0])?2:1)}if(r.length===0)return!1;if(r.length===1&&Sr(e.key).includes(r[0]))return!1;let i=["ctrl","shift","alt","meta","cmd","super"].filter((a)=>r.includes(a));if(r=r.filter((a)=>!i.includes(a)),i.length>0){if(i.filter((s)=>{if(s==="cmd"||s==="super")s="meta";return e[`${s}Key`]}).length===i.length){if(Kn(e.type))return!1;if(Sr(e.key).includes(r[0]))return!1}}return!0}function Sr(e){if(!e)return[];e=jo(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 Re(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(Fe(e))if(Array.isArray(n)){let i=null;if(t.includes("number"))i=pt(r.target.value);else if(t.includes("boolean"))i=He(r.target.value);else i=r.target.value;return r.target.checked?n.includes(i)?n:n.concat([i]):n.filter((a)=>!Wo(a,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 a=i.value||i.text;return pt(a)});else if(t.includes("boolean"))return Array.from(r.target.selectedOptions).map((i)=>{let a=i.value||i.text;return He(a)});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 pt(i);else if(t.includes("boolean"))return He(i);else if(t.includes("trim"))return i.trim();else return i}})}function pt(e){let t=e?parseFloat(e):null;return Yo(t)?t:e}function Wo(e,t){return e==t}function Yo(e){return!Array.isArray(e)&&!isNaN(e)}function Cr(e){return e!==null&&typeof e==="object"&&typeof e.get==="function"&&typeof e.set==="function"}function Jo(e,t){e._x_keyExpression=t}function Go(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 Xo(e){if(!q)return!1;if(kt)return!0;return e.hasAttribute("data-has-alpine-state")}function Zo(e){return(t)=>{Object.entries(t).forEach(([r,n])=>{e[r]=n})}}function Qo(e,t,r,n){r((i)=>{if(ra(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 a=e._x_lookup,s=new Map;e._x_lookup=s;let o=na(i),l=Object.entries(i).map(([c,d])=>{if(!o)c=parseInt(c);let u=ta(t,d,c,i),f;return n((b)=>{if(typeof b==="object")I("x-for key cannot be an object, it must be a string or an integer",e);if(a.has(b))s.set(b,a.get(b)),a.delete(b);f=b},{scope:{index:c,...u}}),[f,u]});_(()=>{a.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)I("x-for templates require a single root element, additional elements will be ignored.",e);let b=document.importNode(e.content,!0).firstElementChild,m=le(f);Ce(b,m,e),b._x_refreshXForScope=Zo(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 ea(e){let t=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,r=/^\s*\(|\)\s*$/g,n=/([\s\S]*?)\b(?:in|of)\b([\s\S]*)/,i=e.match(n);if(!i)return;let a={};a.items=i[2].trim();let s=i[1].replace(r,"").trim(),o=s.match(t);if(o){if(a.item=s.replace(t,"").trim(),a.index=o[1].trim(),o[2])a.collection=o[2].trim()}else a.item=s;return a}function ta(e,t,r,n){let i={};if(/^\[.*\]$/.test(e.item)&&Array.isArray(t))e.item.replace("[","").replace("]","").split(",").map((s)=>s.trim()).forEach((s,o)=>{i[s]=t[o]});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 ra(e){return typeof e!=="object"&&!isNaN(e)}function na(e){return typeof e==="object"&&!Array.isArray(e)}function Wn(){}function tt(e,t,r){E(t,(n)=>I(`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,yt=-1,ze=!1,Pt=!1,le,re,ce,Or,Ni=0,xt=!0,Lr,Ir,Dr,We,Ht=!1,F,Ut=!1,Ue,Ki,Ur,qr,W=!0,Fr=()=>{},Kr,jt="x-",je,_t=!1,me,Wr,Jr=(e,t)=>({name:r,value:n})=>{if(r.startsWith(e))r=r.replace(e,t);return{name:r,value:n}},Gr=(e)=>e,Zr,en=()=>new RegExp(`^${jt}([^:^.]+)\\b`),Et="DEFAULT",V,q=!1,tn,kt=!1,Xe=0,gr=!1,Kt,sn,dn,xs=1,At,Vt=!1,Rs,B,xr=!1,xn,wn,Gs,ue,vr,_n,k=class{constructor(e,t,r,n){this.type=e,this.value=t,this.start=r,this.end=n}},Xs,Zs=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))}}},Qs=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 Xs.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}}},eo=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}),b;if(e.callee.computed)b=this.evaluate({node:e.callee.property,scope:t,context:r,forceBindingRootScopeToFunctions:n});else b=e.callee.property.name;this.checkForDangerousKeywords(b);let x=g[b];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,b;if(g in t)b=t[g];else throw Error(`Undefined variable: ${g}`);if(typeof b!=="function")throw Error("Value is not a function");let x=r!==null?r:t;l=b.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 b=t[g];if(e.operator==="++")t[g]=b+1;else if(e.operator==="--")t[g]=b-1;return e.prefix?t[g]:b}else if(e.argument.type==="MemberExpression"){let g=this.evaluate({node:e.argument.object,scope:t,context:r,forceBindingRootScopeToFunctions:n}),b=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(b);let x=g[b];if(e.operator==="++")g[b]=x+1;else if(e.operator==="--")g[b]=x-1;return e.prefix?g[b]: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 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}),b=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(b),g[b]=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 b=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[b]=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(vr.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(_n.has(e))throw Error("Accessing global variables is prohibited in the CSP build");return vr.set(e,!0),!0}},Da,Na,_e,io,Mt=(e,t)=>io.call(e,t),Ee,ye=(e)=>An(e)==="[object Map]",so=(e)=>typeof e==="string",Oe=(e)=>typeof e==="symbol",ke=(e)=>e!==null&&typeof e==="object",oo,An=(e)=>oo.call(e),Cn=(e)=>An(e).slice(8,-1),Xt=(e)=>so(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,et=(e)=>{let t=Object.create(null);return(r)=>t[r]||(t[r]=e(r))},ao,Ba,lo,Pa,Tn,$a,K=(e,t)=>!Object.is(e,t),co="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",Ra,dt,v,ut,wr=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))uo(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,_r(this),Mn(this);let e=v,t=O;v=this,O=!0;try{return this.fn()}finally{if(v!==this)Z("Active effect was not restored correctly - this is likely a Vue internal bug.");Ln(this),v=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,_r(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(Lt(this))this.run()}get dirty(){return Lt(this)}},On=0,xe,ve,O=!0,In,Ke=0,yo=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}},xo=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(!v||!O||v===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==v){if(t=this.activeLink=new yo(v,this),!v.deps)v.deps=v.depsTail=t;else t.prevDep=v.depsTail,v.depsTail.nextDep=t,v.depsTail=t;Dn(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=v.depsTail,t.nextDep=void 0,v.depsTail.nextDep=t,v.depsTail=t,v.deps===t)v.deps=r}}if(v.onTrack)v.onTrack(_e({effect:v},e));return t}trigger(e){this.version++,Ke++,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(_e({effect:t.sub},e));for(let t=this.subs;t;t=t.prevSub)if(t.sub.notify())t.sub.dep.notify()}finally{Qt()}}},It,J,Dt,Se,vo,wo,_o,Nn,Bn=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?Do:Rn:i?Io:$n).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(r))return e;return}let o=Ee(e);if(!n){let a;if(o&&(a=vo[t]))return a;if(t==="hasOwnProperty")return Eo}let s=Reflect.get(e,t,we(e)?e:r);if(Oe(t)?Nn.has(t):_o(t))return s;if(!n)C(e,"get",t);if(i)return s;if(we(s)){let a=o&&Xt(t)?s:s.value;return n&&ke(a)?Bt(a):a}if(ke(s))return n?Bt(s):rr(s);return s}},ko,So,Ao,Co,Nt=(e)=>e,Pe=(e)=>Reflect.getPrototypeOf(e),Mo,Lo,$n,Io,Rn,Do,te=(e)=>ke(e)?rr(e):e,Ae=(e)=>ke(e)?Bt(e):e,pt,zo,qn=()=>{},Ko,Vn=(e,{value:t,modifiers:r,expression:n,original:i},{effect:o,cleanup:s})=>{if(!t){let l={};Ws(l),A(e,n)((d)=>{vn(e,d,i)},{scope:l});return}if(t==="key")return Jo(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="";_(()=>hn(e,t,l,r))})),s(()=>{e._x_undoAddedClasses&&e._x_undoAddedClasses(),e._x_undoAddedStyles&&e._x_undoAddedStyles()})},q,Yn,ia;var Gn=Si(()=>{P=[];Lr=[],Ir=[],Dr=[];We=new MutationObserver(Ye);F=[];Ue=[];Ki={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 Vi;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=Hr(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)}};Ur={};jr=Xi;qe={};me=new Map,Wr=Symbol();Zr=[];V=["ignore","ref","id","data","anchor","bind","init","for","model","modelable","transition","show","if",Et,"teleport"];tn=[];Te((e,t)=>{if(Xe===0)return;if(!e||e.nodeType!==1||!t||t.nodeType!==1)return;if(T(e,(r)=>r._x_deferInit))t._x_ignore=!0});Kt=[],sn=[];dn=[];St=[];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")Cs(e,r,t);else As(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=fn(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})})})};Rs=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={};xn={};wn={};Gs={get reactive(){return le},get release(){return ce},get effect(){return re},get raw(){return Or},get transaction(){return Ri},version:"3.17.4",flushAndStopDeferringMutations:Fi,dontAutoEvaluateFunctions:qr,disableEffectScheduling:Bi,startObservingMutations:zt,stopObservingMutations:$r,setReactivityEngine:Pi,onAttributeRemoved:Br,onAttributesAdded:Nr,closestDataStack:ae,skipDuringClone:R,onlyDuringClone:ls,addRootSelector:ln,addInitSelector:cn,setErrorHandler:Gi,interceptClone:Te,addScopeToNode:Ce,deferMutations:qi,mapAttributes:Ft,evaluateLater:A,interceptInit:ys,initInterceptors:jt,injectMagics:je,setEvaluator:Zi,setRawEvaluator:Qi,mergeProxies:G,extractProp:js,findClosest:T,onElRemoved:Rt,closestRoot:Ze,destroyTree:ne,interceptor:zr,transition:Ot,setStyles:Qe,mutateDom:_,deferInit:fs,directive:E,entangle:yn,throttle:gn,debounce:mn,evaluate:Y,evaluateRaw:ts,initTree:D,nextTick:Wt,prefixed:de,prefix:rs,plugin:qs,magic:M,store:Fs,start:ms,clone:ds,cloneNode:cs,bound:Us,$data:Rr,watch:Mr,walk:X,data:Ys,bind:Vs},ue=Gs,vr=new WeakMap,_n=new Set;Object.getOwnPropertyNames(globalThis).forEach((e)=>{if(e==="styleMedia"||e==="sharedStorage")return;let t;try{t=globalThis[e]}catch{return}_n.add(t)});Xs=["IDENTIFIER","KEYWORD","BOOLEAN","NULL","UNDEFINED"];Da=Object.freeze({}),Na=Object.freeze([]),_e=Object.assign,io=Object.prototype.hasOwnProperty,Ee=Array.isArray,oo=Object.prototype.toString,ao=/-\w/g,Ba=et((e)=>e.replace(ao,(t)=>t.slice(1).toUpperCase())),lo=/\B([A-Z])/g,Pa=et((e)=>e.replace(lo,"-$1").toLowerCase()),Tn=et((e)=>e.charAt(0).toUpperCase()+e.slice(1)),$a=et((e)=>e?`on${Tn(e)}`:""),Ra=Sn(co+",async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");ut=new WeakSet;In=[];It=new WeakMap,J=Symbol("Object iterate"),Dt=Symbol("Map keys iterate"),Se=Symbol("Array iterate");vo={__proto__:null,[Symbol.iterator](){return ft(this,Symbol.iterator,(e)=>L(this,e))},concat(...e){return se(this).concat(...e.map((t)=>Ee(t)?se(t):t))},entries(){return ft(this,"entries",(e)=>(e[1]=L(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)=>L(this,n)),arguments)},find(e,t){return N(this,"find",e,t,(r)=>L(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)=>L(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 be(this,"pop")},push(...e){return be(this,"push",e)},reduce(e,...t){return Er(this,"reduce",e,t)},reduceRight(e,...t){return Er(this,"reduceRight",e,t)},shift(){return be(this,"shift")},some(e,t){return N(this,"some",e,t,void 0,arguments)},splice(...e){return be(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 be(this,"unshift",e)},values(){return ft(this,"values",(e)=>L(this,e))}};wo=Array.prototype;_o=Sn("__proto__,__v_isRef,__isVue"),Nn=new Set(Object.getOwnPropertyNames(Symbol).filter((e)=>e!=="arguments"&&e!=="caller").map((e)=>Symbol[e]).filter(Oe));ko=class extends Bn{constructor(e=!1){super(!1,e)}set(e,t,r,n){let i=e[t],o=Ee(e)&&Xt(t);if(!this._isShallow){let l=Q(i);if(!ee(r)&&!Q(r))i=w(i),r=w(r);if(!o&&we(i)&&!we(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,we(e)?e:n);if(e===w(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(!Oe(t)||!Nn.has(t))C(e,"has",t);return r}ownKeys(e){return C(e,"iterate",Ee(e)?"length":J),Reflect.ownKeys(e)}},So=class extends Bn{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}},Ao=new ko,Co=new So;Mo={get:Pn(!1,!1)},Lo={get:Pn(!0,!1)};$n=new WeakMap,Io=new WeakMap,Rn=new WeakMap,Do=new WeakMap;M("nextTick",()=>Wt);M("dispatch",(e)=>ge.bind(ge,e));M("watch",(e,{evaluateLater:t,cleanup:r})=>(n,i)=>{let o=t(n),a=Mr(()=>{let l;return o((c)=>l=c),l},i);r(a)});M("store",Ks);M("data",(e)=>Rr(e));M("root",(e)=>Ze(e));M("refs",(e)=>{if(e._x_refs_proxy)return e._x_refs_proxy;return e._x_refs_proxy=G(Po(e)),e._x_refs_proxy});pt={};M("id",(e,{cleanup:t})=>(r,n=null)=>{let i=`${r}${n?`-${n}`:""}`;return Ho(e,i,t,()=>{let o=$o(e,r),s=o?o._x_ids[r]:Un(r);return n?`${r}-${s}-${n}`:`${r}-${s}`})});Te((e,t)=>{if(e._x_id)t._x_id=e._x_id});M("el",(e)=>e);jn("Focus","focus","focus");jn("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=yn({get(){return d()},set(p){u(p)}},{get(){return s()},set(p){l(p)}});i(f)})});E("teleport",(e,{modifiers:t,expression:r},{cleanup:n})=>{if(e.tagName.toLowerCase()!=="template")I("x-teleport can only be used on a <template> tag",e);let i=Sr(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))})});Ce(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=Sr(r);_(()=>{s(e._x_teleport,a,t)})},n(()=>_(()=>{o.remove(),ne(o)}))});zo=document.createElement("div");qn.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",qn);E("effect",R((e,{expression:t},{effect:r})=>{r(A(e,t))}));Ko=["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),Cr(h)?h.get():h},c=(h)=>{let g;if(s((b)=>g=b),Cr(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"),f=t.includes("enter"),p=d||u||f,m;if(j)m=()=>{};else if(p){let h=[],g=(b)=>c(Re(e,t,b,l()));if(d)h.push(oe(e,"change",t,g));if(u){if(h.push(oe(e,"blur",t,g)),e.form){let b=e.form,x=()=>g({target:e});if(!b._x_pendingModelUpdates)b._x_pendingModelUpdates=[];b._x_pendingModelUpdates.push(x),i(()=>{if(b._x_pendingModelUpdates)b._x_pendingModelUpdates.splice(b._x_pendingModelUpdates.indexOf(x),1)})}}if(f)h.push(oe(e,"keydown",t,(b)=>{if(b.key==="Enter")g(b)}));m=()=>h.forEach((b)=>b())}else{let h=e.tagName.toLowerCase()==="select"||["checkbox","radio"].includes(e.type)?"change":"input";m=oe(e,h,t,(g)=>{c(Re(e,t,g,l()))})}if(t.includes("fill")){if([void 0,null,""].includes(l())||Fe(e)&&Array.isArray(l())||e.tagName.toLowerCase()==="select"&&e.multiple)c(Re(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(Re(e,t,{target:e},l())))});i(()=>h())}if(e._x_model={get(){return l()},set(h){c(h)},setWithModifiers:Fn(t,c)},e._x_forceModelUpdate=(h)=>{if(h===void 0&&typeof r==="string"&&r.match(/\./))h="";_(()=>{if(Fe(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=He(e.value)===h;else e.checked=e.value==h;else hn(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")))));cn(()=>`[${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(Jr(":",Gr(de("bind:"))));Vn.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",Vn);ln(()=>`[${de("data")}]`);q=Symbol();E("data",(e,{expression:t},{cleanup:r})=>{if(Xo(e))return;let n=e[q];if(n?.expression===t)return;t=t===""?"{}":t;let i={};je(i,e);let o={};Js(o,i);let s=Y(e,t,{scope:o});if(s===void 0||s===!0)s={};je(s,e);let a;if(n?.reactiveData){a=n.reactiveData,Go(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=Ce(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]})})});Te((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=ea(t),o=A(e,i.items),s=A(e,e._x_keyExpression||"index");e._x_lookup=new Map,r(()=>Qo(e,i,o,s),{priority:"structural"}),n(()=>{e._x_lookup.forEach((a)=>_(()=>{ne(a),a.remove()})),delete e._x_lookup,delete e._x_lastRenderedEl})}));Wn.inline=(e,{expression:t},{cleanup:r})=>{let n=Ze(e);if(!n)return;if(!n._x_refs)n._x_refs={};n._x_refs[t]=e,r(()=>delete n._x_refs[t])};E("ref",Wn);E("if",R((e,{expression:t},{effect:r,cleanup:n})=>{if(e.tagName.toLowerCase()!=="template")I("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 Ce(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)=>Ro(e,i))});Te((e,t)=>{if(e._x_ids)t._x_ids=e._x_ids});Ft(Jr("@",Gr(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())}));tt("Collapse","collapse","collapse");tt("Intersect","intersect","intersect");tt("Focus","trap","focus");tt("Mask","mask","mask");E("html",(e,{expression:t})=>{Je(Error("Using the x-html directive is prohibited in the CSP build"),e)});ue.setEvaluator(ro);ue.setRawEvaluator(to);ue.setReactivityEngine({reactive:rr,effect:(e,t={})=>{let r;return r=po(e,{scheduler:()=>{if(!r)return;t.scheduler?t.scheduler(r):r()}}),r},release:bo,raw:w});Yn=ue,ia=Yn;/*! 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 a=this.input.slice(this.position+1,this.position+5);if(/^[0-9a-fA-F]{4}$/.test(a))r+=String.fromCharCode(parseInt(a,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))}}},Qs=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 Xs.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}}},eo=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 a;if(e.computed)a=this.evaluate({node:e.property,scope:t,context:r,forceBindingRootScopeToFunctions:n});else a=e.property.name;this.checkForDangerousKeywords(a);let s=i[a];if(this.checkForDangerousValues(s),typeof s==="function")if(n)return s.bind(t);else return s.bind(i);return s;case"CallExpression":let o=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}),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=g[h];if(typeof x!=="function")throw Error("Value is not a function");l=x.apply(g,o)}else if(e.callee.type==="Identifier"){let g=e.callee.name,h;if(g in t)h=t[g];else throw Error(`Undefined variable: ${g}`);if(typeof h!=="function")throw Error("Value is not a function");let x=r!==null?r:t;l=h.apply(x,o)}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,o)}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 h=t[g];if(e.operator==="++")t[g]=h+1;else if(e.operator==="--")t[g]=h-1;return e.prefix?t[g]:h}else if(e.argument.type==="MemberExpression"){let g=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(g))throw Error("Property assignments on DOM objects are prohibited in the CSP build");this.checkForDangerousKeywords(h);let x=g[h];if(e.operator==="++")g[h]=x+1;else if(e.operator==="--")g[h]=x-1;return e.prefix?g[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 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}),h=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(h),g[h]=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 p={};for(let g of e.properties){let h=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});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(vr.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(_n.has(e))throw Error("Accessing global variables is prohibited in the CSP build");return vr.set(e,!0),!0}},Da,Na,_e,io,Mt=(e,t)=>io.call(e,t),Ee,ye=(e)=>Sn(e)==="[object Map]",so=(e)=>typeof e==="string",Oe=(e)=>typeof e==="symbol",ke=(e)=>e!==null&&typeof e==="object",oo,Sn=(e)=>oo.call(e),Cn=(e)=>Sn(e).slice(8,-1),Xt=(e)=>so(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,et=(e)=>{let t=Object.create(null);return(r)=>t[r]||(t[r]=e(r))},ao,Ba,lo,Pa,Tn,$a,K=(e,t)=>!Object.is(e,t),co="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",Ra,dt,v,ut,wr=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))uo(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,_r(this),Mn(this);let e=v,t=O;v=this,O=!0;try{return this.fn()}finally{if(v!==this)Z("Active effect was not restored correctly - this is likely a Vue internal bug.");Ln(this),v=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,_r(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(Lt(this))this.run()}get dirty(){return Lt(this)}},On=0,xe,ve,O=!0,In,Ke=0,yo=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}},xo=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(!v||!O||v===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==v){if(t=this.activeLink=new yo(v,this),!v.deps)v.deps=v.depsTail=t;else t.prevDep=v.depsTail,v.depsTail.nextDep=t,v.depsTail=t;Dn(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=v.depsTail,t.nextDep=void 0,v.depsTail.nextDep=t,v.depsTail=t,v.deps===t)v.deps=r}}if(v.onTrack)v.onTrack(_e({effect:v},e));return t}trigger(e){this.version++,Ke++,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(_e({effect:t.sub},e));for(let t=this.subs;t;t=t.prevSub)if(t.sub.notify())t.sub.dep.notify()}finally{Qt()}}},It,J,Dt,Ae,vo,wo,_o,Nn,Bn=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?Do:Rn:i?Io:$n).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(r))return e;return}let a=Ee(e);if(!n){let o;if(a&&(o=vo[t]))return o;if(t==="hasOwnProperty")return Eo}let s=Reflect.get(e,t,we(e)?e:r);if(Oe(t)?Nn.has(t):_o(t))return s;if(!n)C(e,"get",t);if(i)return s;if(we(s)){let o=a&&Xt(t)?s:s.value;return n&&ke(o)?Bt(o):o}if(ke(s))return n?Bt(s):rr(s);return s}},ko,Ao,So,Co,Nt=(e)=>e,Pe=(e)=>Reflect.getPrototypeOf(e),Mo,Lo,$n,Io,Rn,Do,te=(e)=>ke(e)?rr(e):e,Se=(e)=>ke(e)?Bt(e):e,bt,zo,jn=()=>{},Ko,Vn=(e,{value:t,modifiers:r,expression:n,original:i},{effect:a,cleanup:s})=>{if(!t){let l={};Ws(l),S(e,n)((d)=>{vn(e,d,i)},{scope:l});return}if(t==="key")return Jo(e,n);if(e._x_inlineBindings&&e._x_inlineBindings[t]&&e._x_inlineBindings[t].extract)return;let o=S(e,n);a(()=>o((l)=>{if(l===void 0&&typeof n==="string"&&n.match(/\./))l="";_(()=>hn(e,t,l,r))})),s(()=>{e._x_undoAddedClasses&&e._x_undoAddedClasses(),e._x_undoAddedStyles&&e._x_undoAddedStyles()})},j,Yn,ia;var Gn=Ai(()=>{P=[];Lr=[],Ir=[],Dr=[];We=new MutationObserver(Ye);F=[];Ue=[];Ki={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 Vi;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=Hr(s,t),i)break;if(!i)i=e[e.length-1];let a=Object.getOwnPropertyDescriptor(i,t);if(a?.set&&a?.get)return a.set.call(n,r)||!0;return Reflect.set(i,t,r)}};Ur={};qr=Xi;je={};me=new Map,Wr=Symbol();Zr=[];V=["ignore","ref","id","data","anchor","bind","init","for","model","modelable","transition","show","if",Et,"teleport"];tn=[];Te((e,t)=>{if(Xe===0)return;if(!e||e.nodeType!==1||!t||t.nodeType!==1)return;if(T(e,(r)=>r._x_deferInit))t._x_ignore=!0});Kt=[],sn=[];dn=[];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")Cs(e,r,t);else Ss(e,n,t)});window.Element.prototype._x_toggleAndCascadeWithTransitions=function(e,t,r,n){let i=document.visibilityState==="visible"?requestAnimationFrame:setTimeout,a=()=>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):a();else e._x_transition?e._x_transition.in(r):a();return}e._x_hidePromise=e._x_transition?new Promise((s,o)=>{e._x_transition.out(()=>{},()=>s(n)),e._x_transitioning&&e._x_transitioning.beforeCancel(()=>o({isFromCancelledTransition:!0}))}):Promise.resolve(n),queueMicrotask(()=>{let s=fn(e);if(s){if(!s._x_hideChildren)s._x_hideChildren=[];s._x_hideChildren.push(e)}else i(()=>{let o=(l)=>{let c=Promise.all([l._x_hidePromise,...(l._x_hideChildren||[]).map(o)]).then(([d])=>d?.());return delete l._x_hidePromise,delete l._x_hideChildren,c};o(e).catch((l)=>{if(!l.isFromCancelledTransition)throw l})})})};Rs=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={};xn={};wn={};Gs={get reactive(){return le},get release(){return ce},get effect(){return re},get raw(){return Or},get transaction(){return Ri},version:"3.17.4",flushAndStopDeferringMutations:Fi,dontAutoEvaluateFunctions:jr,disableEffectScheduling:Bi,startObservingMutations:zt,stopObservingMutations:$r,setReactivityEngine:Pi,onAttributeRemoved:Br,onAttributesAdded:Nr,closestDataStack:ae,skipDuringClone:R,onlyDuringClone:ls,addRootSelector:ln,addInitSelector:cn,setErrorHandler:Gi,interceptClone:Te,addScopeToNode:Ce,deferMutations:ji,mapAttributes:Ft,evaluateLater:S,interceptInit:ys,initInterceptors:qt,injectMagics:qe,setEvaluator:Zi,setRawEvaluator:Qi,mergeProxies:G,extractProp:qs,findClosest:T,onElRemoved:Rt,closestRoot:Ze,destroyTree:ne,interceptor:zr,transition:Ot,setStyles:Qe,mutateDom:_,deferInit:fs,directive:E,entangle:yn,throttle:gn,debounce:mn,evaluate:Y,evaluateRaw:ts,initTree:D,nextTick:Wt,prefixed:de,prefix:rs,plugin:js,magic:M,store:Fs,start:ms,clone:ds,cloneNode:cs,bound:Us,$data:Rr,watch:Mr,walk:X,data:Ys,bind:Vs},ue=Gs,vr=new WeakMap,_n=new Set;Object.getOwnPropertyNames(globalThis).forEach((e)=>{if(e==="styleMedia"||e==="sharedStorage")return;let t;try{t=globalThis[e]}catch{return}_n.add(t)});Xs=["IDENTIFIER","KEYWORD","BOOLEAN","NULL","UNDEFINED"];Da=Object.freeze({}),Na=Object.freeze([]),_e=Object.assign,io=Object.prototype.hasOwnProperty,Ee=Array.isArray,oo=Object.prototype.toString,ao=/-\w/g,Ba=et((e)=>e.replace(ao,(t)=>t.slice(1).toUpperCase())),lo=/\B([A-Z])/g,Pa=et((e)=>e.replace(lo,"-$1").toLowerCase()),Tn=et((e)=>e.charAt(0).toUpperCase()+e.slice(1)),$a=et((e)=>e?`on${Tn(e)}`:""),Ra=An(co+",async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");ut=new WeakSet;In=[];It=new WeakMap,J=Symbol("Object iterate"),Dt=Symbol("Map keys iterate"),Ae=Symbol("Array iterate");vo={__proto__:null,[Symbol.iterator](){return ft(this,Symbol.iterator,(e)=>L(this,e))},concat(...e){return se(this).concat(...e.map((t)=>Ee(t)?se(t):t))},entries(){return ft(this,"entries",(e)=>(e[1]=L(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)=>L(this,n)),arguments)},find(e,t){return N(this,"find",e,t,(r)=>L(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)=>L(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 Er(this,"reduce",e,t)},reduceRight(e,...t){return Er(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)=>L(this,e))}};wo=Array.prototype;_o=An("__proto__,__v_isRef,__isVue"),Nn=new Set(Object.getOwnPropertyNames(Symbol).filter((e)=>e!=="arguments"&&e!=="caller").map((e)=>Symbol[e]).filter(Oe));ko=class extends Bn{constructor(e=!1){super(!1,e)}set(e,t,r,n){let i=e[t],a=Ee(e)&&Xt(t);if(!this._isShallow){let l=Q(i);if(!ee(r)&&!Q(r))i=w(i),r=w(r);if(!a&&we(i)&&!we(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=a?Number(t)<e.length:Mt(e,t),o=Reflect.set(e,t,r,we(e)?e:n);if(e===w(n)&&o){if(!s)U(e,"add",t,r);else if(K(r,i))U(e,"set",t,r,i)}return o}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(!Oe(t)||!Nn.has(t))C(e,"has",t);return r}ownKeys(e){return C(e,"iterate",Ee(e)?"length":J),Reflect.ownKeys(e)}},Ao=class extends Bn{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}},So=new ko,Co=new Ao;Mo={get:Pn(!1,!1)},Lo={get:Pn(!0,!1)};$n=new WeakMap,Io=new WeakMap,Rn=new WeakMap,Do=new WeakMap;M("nextTick",()=>Wt);M("dispatch",(e)=>ge.bind(ge,e));M("watch",(e,{evaluateLater:t,cleanup:r})=>(n,i)=>{let a=t(n),o=Mr(()=>{let l;return a((c)=>l=c),l},i);r(o)});M("store",Ks);M("data",(e)=>Rr(e));M("root",(e)=>Ze(e));M("refs",(e)=>{if(e._x_refs_proxy)return e._x_refs_proxy;return e._x_refs_proxy=G(Po(e)),e._x_refs_proxy});bt={};M("id",(e,{cleanup:t})=>(r,n=null)=>{let i=`${r}${n?`-${n}`:""}`;return Ho(e,i,t,()=>{let a=$o(e,r),s=a?a._x_ids[r]:Un(r);return n?`${r}-${s}-${n}`:`${r}-${s}`})});Te((e,t)=>{if(e._x_id)t._x_id=e._x_id});M("el",(e)=>e);qn("Focus","focus","focus");qn("Persist","persist","persist");E("modelable",(e,{expression:t},{effect:r,evaluateLater:n,cleanup:i})=>{let a=n(t),s=()=>{let d;return a((u)=>d=u),d},o=n(`${t} = __placeholder`),l=(d)=>o(()=>{},{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=yn({get(){return d()},set(b){u(b)}},{get(){return s()},set(b){l(b)}});i(f)})});E("teleport",(e,{modifiers:t,expression:r},{cleanup:n})=>{if(e.tagName.toLowerCase()!=="template")I("x-teleport can only be used on a <template> tag",e);let i=Ar(r),a=e.content.cloneNode(!0).firstElementChild;if(e._x_teleport=a,a._x_teleportBack=e,e.setAttribute("data-teleport-template",!0),a.setAttribute("data-teleport-target",!0),e._x_forwardEvents)e._x_forwardEvents.forEach((o)=>{a.addEventListener(o,(l)=>{l.stopPropagation(),e.dispatchEvent(new l.constructor(l.type,l))})});Ce(a,{},e);let s=(o,l,c)=>{if(c.includes("prepend"))l.parentNode.insertBefore(o,l);else if(c.includes("append"))l.parentNode.insertBefore(o,l.nextSibling);else l.appendChild(o)};_(()=>{R(()=>{s(a,i,t),D(a)})()}),e._x_teleportPutBack=()=>{let o=Ar(r);_(()=>{s(e._x_teleport,o,t)})},n(()=>_(()=>{a.remove(),ne(a)}))});zo=document.createElement("div");jn.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",jn);E("effect",R((e,{expression:t},{effect:r})=>{r(S(e,t))}));Ko=["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 a=e;if(t.includes("parent"))a=T(e,(p)=>p!==e);let s=S(a,r),o;if(typeof r==="string")o=S(a,`${r} = __placeholder`);else if(typeof r==="function"&&typeof r()==="string")o=S(a,`${r()} = __placeholder`);else o=()=>{};let l=()=>{let p;return s((g)=>p=g),Cr(p)?p.get():p},c=(p)=>{let g;if(s((h)=>g=h),Cr(g))g.set(p);else o(()=>{},{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"),b=d||u||f,m;if(q)m=()=>{};else if(b){let p=[],g=(h)=>c(Re(e,t,h,l()));if(d)p.push(oe(e,"change",t,g));if(u){if(p.push(oe(e,"blur",t,g)),e.form){let h=e.form,x=()=>g({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")g(h)}));m=()=>p.forEach((h)=>h())}else{let p=e.tagName.toLowerCase()==="select"||["checkbox","radio"].includes(e.type)?"change":"input";m=oe(e,p,t,(g)=>{c(Re(e,t,g,l()))})}if(t.includes("fill")){if([void 0,null,""].includes(l())||Fe(e)&&Array.isArray(l())||e.tagName.toLowerCase()==="select"&&e.multiple)c(Re(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 p=oe(e.form,"reset",[],(g)=>{Wt(()=>e._x_model&&e._x_model.set(Re(e,t,{target:e},l())))});i(()=>p())}if(e._x_model={get(){return l()},set(p){c(p)},setWithModifiers:Fn(t,c)},e._x_forceModelUpdate=(p)=>{if(p===void 0&&typeof r==="string"&&r.match(/\./))p="";_(()=>{if(Fe(e))if(Array.isArray(p))e.checked=p.some((g)=>g==e.value);else e.checked=!!p;else if(Gt(e))if(typeof p==="boolean")e.checked=He(e.value)===p;else e.checked=e.value==p;else hn(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")))));cn(()=>`[${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((a)=>{_(()=>{e.textContent=a})})})});E("html",(e,{expression:t},{effect:r,evaluateLater:n})=>{let i=n(t);r(()=>{i((a)=>{_(()=>{Array.from(e.children).forEach((s)=>ne(s)),e.innerHTML=a??"",e._x_ignoreSelf=!0,D(e),delete e._x_ignoreSelf})})},{priority:"structural"})});Ft(Jr(":",Gr(de("bind:"))));Vn.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",Vn);ln(()=>`[${de("data")}]`);j=Symbol();E("data",(e,{expression:t},{cleanup:r})=>{if(Xo(e))return;let n=e[j];if(n?.expression===t)return;t=t===""?"{}":t;let i={};qe(i,e);let a={};Js(a,i);let s=Y(e,t,{scope:a});if(s===void 0||s===!0)s={};qe(s,e);let o;if(n?.reactiveData){o=n.reactiveData,Go(o,s);let c={expression:t};e[j]=c,queueMicrotask(()=>{if(e[j]===c)delete e[j]})}else o=le(s);qt(o,r);let l=Ce(e,o);R(()=>{o.init&&Y(e,o.init)})(),r(()=>{o.destroy&&Y(e,o.destroy),l();let c={reactiveData:o};e[j]=c,queueMicrotask(()=>{if(e[j]===c)delete e[j]})})});Te((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=S(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 a=()=>{e._x_doHide(),e._x_isShown=!1},s=()=>{e._x_doShow(),e._x_isShown=!0},o=()=>setTimeout(s),l=Tt((u)=>u?s():a(),(u)=>{if(typeof e._x_toggleAndCascadeWithTransitions==="function")e._x_toggleAndCascadeWithTransitions(e,u,s,a);else u?o():a()}),c,d=!0;n(()=>i((u)=>{if(!d&&u===c)return;if(t.includes("immediate"))u?o():a();l(u),c=u,d=!1}))});E("for",R((e,{expression:t},{effect:r,cleanup:n})=>{let i=ea(t),a=S(e,i.items),s=S(e,e._x_keyExpression||"index");e._x_lookup=new Map,r(()=>Qo(e,i,a,s),{priority:"structural"}),n(()=>{e._x_lookup.forEach((o)=>_(()=>{ne(o),o.remove()})),delete e._x_lookup,delete e._x_lastRenderedEl})}));Wn.inline=(e,{expression:t},{cleanup:r})=>{let n=Ze(e);if(!n)return;if(!n._x_refs)n._x_refs={};n._x_refs[t]=e,r(()=>delete n._x_refs[t])};E("ref",Wn);E("if",R((e,{expression:t},{effect:r,cleanup:n})=>{if(e.tagName.toLowerCase()!=="template")I("x-if can only be used on a <template> tag",e);let i=S(e,t),a=()=>{if(e._x_currentIfEl)return e._x_currentIfEl;let o=e.content.cloneNode(!0).firstElementChild;return Ce(o,{},e),_(()=>{e.after(o),D(o)}),e._x_currentIfEl=o,e._x_lastRenderedEl=o,e._x_undoIf=()=>{_(()=>{ne(o),o.remove()}),delete e._x_currentIfEl,delete e._x_lastRenderedEl},o},s=()=>{if(!e._x_undoIf)return;e._x_undoIf(),delete e._x_undoIf};r(()=>i((o)=>{o?a():s()}),{priority:"structural"}),n(()=>e._x_undoIf&&e._x_undoIf())}));E("id",(e,{expression:t},{evaluate:r})=>{r(t).forEach((i)=>Ro(e,i))});Te((e,t)=>{if(e._x_ids)t._x_ids=e._x_ids});Ft(Jr("@",Gr(de("on:"))));E("on",R((e,{value:t,modifiers:r,expression:n},{cleanup:i})=>{let a=n?S(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,(o)=>{a(()=>{},{scope:{$event:o},params:[o]})});i(()=>s())}));tt("Collapse","collapse","collapse");tt("Intersect","intersect","intersect");tt("Focus","trap","focus");tt("Mask","mask","mask");E("html",(e,{expression:t})=>{Je(Error("Using the x-html directive is prohibited in the CSP build"),e)});ue.setEvaluator(ro);ue.setRawEvaluator(to);ue.setReactivityEngine({reactive:rr,effect:(e,t={})=>{let r;return r=bo(e,{scheduler:()=>{if(!r)return;t.scheduler?t.scheduler(r):r()}}),r},release:po,raw:w});Yn=ue,ia=Yn;/*! 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 Ne=typeof HTMLElement==="function"?HTMLElement:class{};function hr(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 pr(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 Ai=Symbol.for("bare-v3.styles");function Be(e,t,r){if(!e?.head||e.getElementById(t))return;let n=e[Ai]??=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 Me=null;function Xn(){if(Me)return Me;let e=(Gn(),wi(Jn)).default;return e.prefix("b3x-"),e.setErrorHandler((t,r,n)=>{console.warn(`bare-v3: component template error${n?` in "${n}"`:""}`,t,r)}),Me=e}var Zn=(e)=>Xn().reactive(e),nr=(e)=>Me?Me.raw(e):e;function Qn(e,t,r){let n=Xn(),i=n.reactive(r);return e.innerHTML=t,n.addScopeToNode(e,i),n.initTree(e),i}function sa(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)))f()});function f(){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 p(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(f,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)f();if(!h||h.disabled||!e.contains(h))return;if(h===o&&n.performance.now()-a>=350)return f();if(m.preventDefault(),m.stopImmediatePropagation(),h!==o)p(h)},{...i,capture:!0}),e.addEventListener("focusout",({target:m})=>{if(m===o)n.queueMicrotask(()=>m===o&&f())},i),e.addEventListener("keydown",(m)=>{let h=m;if(h.key==="Escape")f();else if(h.repeat&&(h.key==="Enter"||h.key===" ")&&h.target.closest?.("[data-b3-confirm]"))h.preventDefault()},{...i,capture:!0}),t?.addEventListener("abort",()=>{f(),d?.remove()},{once:!0})}var ei=Symbol.for("bare-v3.confirm");function ti(){if(typeof document>"u"||!document.defaultView?.MutationObserver)return;let e=document;if(e[ei])return;e[ei]=!0,sa(document)}var fe=1.001,oa=320,aa=30,la=350,ca="b3-image-viewer-style",da=`
22
+ */});var Ne=typeof HTMLElement==="function"?HTMLElement:class{};function hr(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 br(e,t,r={},n=[]){let i=()=>{for(let s of n)if(!e.classList.contains(s))e.classList.add(s);for(let[s,o]of Object.entries(r))if(!e.hasAttribute(s))e.setAttribute(s,o)};i();let a=new MutationObserver(i);a.observe(e,{attributes:!0,attributeFilter:["class",...Object.keys(r)]}),t.addEventListener("abort",()=>a.disconnect(),{once:!0})}var Si=Symbol.for("bare-v3.styles");function Be(e,t,r){if(!e?.head||e.getElementById(t))return;let n=e[Si]??=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 a=e.createElement("style");a.id=t,a.textContent=r,e.head.append(a)}var Me=null;function Xn(){if(Me)return Me;let e=(Gn(),wi(Jn)).default;return e.prefix("b3x-"),e.setErrorHandler((t,r,n)=>{console.warn(`bare-v3: component template error${n?` in "${n}"`:""}`,t,r)}),Me=e}var Zn=(e)=>Xn().reactive(e),nr=(e)=>Me?Me.raw(e):e;function Qn(e,t,r){let n=Xn(),i=n.reactive(r);return e.innerHTML=t,n.addScopeToNode(e,i),n.initTree(e),i}function sa(e,t){let r=e.ownerDocument||e,n=r.defaultView,i={signal:t},a=null,s=null,o=0,l=null,c=0,d=null,u=new n.MutationObserver((m)=>{if(!a.isConnected||m.some(({target:p})=>s.contains(p)&&!d.contains(p)))f()});function f(){if(!a)return;n.clearTimeout(c),u.disconnect();let m=a.dataset.b3Confirm;if(l&&m&&a.textContent===m)a.replaceChildren(...l);a.removeAttribute("data-b3-armed"),a=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 p=d;a=m,o=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(f,4000),n.requestAnimationFrame(()=>{if(a===m)p.textContent=g||"Press again to confirm"})}e.addEventListener("click",(m)=>{let p=m.target.closest?.("[data-b3-confirm]");if(a&&p!==a)f();if(!p||p.disabled||!e.contains(p))return;if(p===a&&n.performance.now()-o>=350)return f();if(m.preventDefault(),m.stopImmediatePropagation(),p!==a)b(p)},{...i,capture:!0}),e.addEventListener("focusout",({target:m})=>{if(m===a)n.queueMicrotask(()=>m===a&&f())},i),e.addEventListener("keydown",(m)=>{let p=m;if(p.key==="Escape")f();else if(p.repeat&&(p.key==="Enter"||p.key===" ")&&p.target.closest?.("[data-b3-confirm]"))p.preventDefault()},{...i,capture:!0}),t?.addEventListener("abort",()=>{f(),d?.remove()},{once:!0})}var ei=Symbol.for("bare-v3.confirm");function ti(){if(typeof document>"u"||!document.defaultView?.MutationObserver)return;let e=document;if(e[ei])return;e[ei]=!0,sa(document)}var fe=1.001,oa=320,aa=30,la=350,ca="b3-image-viewer-style",da=`
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,9 +38,9 @@ ${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 ir extends Ne{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;#y=0;#v=0;#k=!1;#w=null;#m=null;#S=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.#_()}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.#k)return;if(this.#k=!0,Be(this.ownerDocument,ca,da),this.classList.add("b3-image-viewer"),!this.hasAttribute("tabindex"))this.tabIndex=0;if(!this.hasAttribute("role"))this.setAttribute("role","group");this.#E(),this.#_(),this.#M(),this.#m=new MutationObserver(()=>{this.#A(),this.#f()}),this.#m.observe(this,{childList:!0}),this.#A(),this.#f()}disconnectedCallback(){this.#w?.abort(),this.#w=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.#k=!1}attributeChangedCallback(e,t,r){if(t===r)return;if(e==="src")this.#_(),this.reset();if(e==="alt"){let n=this.#h();if(n)n.alt=this.alt;this.#E()}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")}#_(){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(),e.tagName==="IMG")this.#c(e)}#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.#S.has(e))return;if(this.#S.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}#C(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.#T()}#T(){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.#T()}zoomTo(e){let t=this.#d();if(t)this.#C(e,t.vw/2,t.vh/2,t)}requestClose(){this.dispatchEvent(new CustomEvent("b3-close",{bubbles:!0,composed:!0,detail:{src:this.src}}))}#x(){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.#w=new AbortController;let e={signal:this.#w.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.#x(),s=i?this.#O():0;this.#i.set(n.pointerId,{x:n.clientX,y:n.clientY});let a=this.#x(),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,p=(o.y-c.top-this.#n)/this.#t;if(this.#e=a.x-c.left-f*u,this.#n=a.y-c.top-p*u,this.#t=u,this.#u(this.#s),this.#f(this.#s),this.#a=!0,d!==this.#t)this.#T()},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.#y,n.clientY-this.#v)<aa;if(i-this.#r<oa&&o){this.#r=0;let s=this.getBoundingClientRect();this.#C(this.#t>fe?1:2.5,n.clientX-s.left,n.clientY-s.top),this.#b=i}else this.#r=i,this.#y=n.clientX,this.#v=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<la){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.#C(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 ri=ir;function sr(e="b3-image-viewer"){if(typeof customElements>"u")return null;let t=customElements.get?.(e);if(t)return t;let r=ri;return ri=class extends ir{},customElements.define(e,r),r}sr();var ua=/(^|\s)([#@][\p{L}\p{N}_-]+)/gu,fa=/(?:\s+[#@][\p{L}\p{N}_-]+)+\s*$/u,ha=350,Ie=()=>globalThis.crypto?.randomUUID?.()??Math.random().toString(36).slice(2,11),or=(e)=>JSON.parse(JSON.stringify(nr(e))),y=(e,t)=>e!=null&&String(e)===String(t),rt=(e)=>!!e&&typeof e==="object",S=(e)=>Array.isArray(e.subtasks)?e.subtasks:[],he=(e)=>Array.isArray(e.comments)?e.comments:[];function pa(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 ui=(e)=>[...e.filter((t)=>t.starred),...e.filter((t)=>!t.starred)];function ar(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(rt).map((n)=>{r(n),n.cards=ui(Array.isArray(n.cards)?n.cards.filter(rt):[]);for(let i of n.cards){if(r(i),Array.isArray(i.subtasks)){for(let o of i.subtasks)if(rt(o))r(o)}if(Array.isArray(i.comments)){for(let o of i.comments)if(rt(o))r(o)}}return n})}function ni(e,{field:t,id:r}){if(t==="name"){let n=e.findIndex((i)=>y(i.id,r));if(n>=0)e.splice(n,1);return}for(let n of e){let i=n.cards.findIndex((o)=>y(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=S(o),a=s.findIndex((l)=>y(l.id,r));if(a>=0)return void s.splice(a,1)}}}function ba(e,t,r){let{field:n,id:i}=r,o=(s,a,l)=>s.splice(Math.min(l,s.length),0,nr(a));if(n==="name"){let s=e.findIndex((a)=>y(a.id,i));if(s>=0&&!t.some((a)=>y(a.id,i)))o(t,e[s],s);return}for(let s of e){let a=s.cards.findIndex((l)=>y(l.id,i));if(n==="title"&&a>=0){let l=t.find((c)=>y(c.id,s.id));if(l&&!l.cards.some((c)=>y(c.id,i)))o(l.cards,s.cards[a],a);return}if(n==="subtask")for(let l of s.cards){let c=S(l).findIndex((u)=>y(u.id,i));if(c<0)continue;let d=t.flatMap((u)=>u.cards).find((u)=>y(u.id,l.id));if(d&&!S(d).some((u)=>y(u.id,i))){if(!Array.isArray(d.subtasks))d.subtasks=[];o(d.subtasks,S(l)[c],c)}return}}}var fi=(e)=>e.toLowerCase().split(/\s+/).filter(Boolean);function ma(e){return[e.title??"",e.description??"",...S(e).map((t)=>t.title??""),...st(e),...he(e).map((t)=>t.text??"")].join(`
42
- `).toLowerCase()}var ii=(e,t)=>{let r=String(t.text??"").toLowerCase();return fi(e).some((n)=>r.includes(n))};function st(e){let t=new Set((e.tags??[]).map((n)=>(/^[#@]/.test(n)?n:`#${n}`).toLowerCase())),r=[e.title??"",e.description??"",...S(e).map((n)=>n.title??"")].join(`
43
- `);for(let[,,n]of r.matchAll(ua))t.add(n.toLowerCase());return[...t]}var si=String.raw`(<[^<>\n]+>|(?:[^()\n]|\([^()\n]*\))+)`,ga=new RegExp(String.raw`!\[([^\]\n]*)\]\(${si}\)|\[([^\]\n]+)\]\(${si}\)|\bhttps?:\/\/[^\s<>]+`,"giu"),ya=new Set(["javascript","data","vbscript","file","blob","about"]),xa=(e)=>{let t=e.trim();return t.startsWith("<")&&t.endsWith(">")?t.slice(1,-1):t.replace(/\s+"[^"\n]*"$/,"")};function va(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!ya.has(r)&&t.includes(r)?{href:e,file:!1}:null;return e.startsWith("//")?null:{href:e,file:!0}}var oi=(e)=>(e??"").toLowerCase().split(/[\s,]+/).map((t)=>t.replace(/:$/,"")).filter(Boolean),ai=(e)=>(e??"").toLowerCase().split(",").map((t)=>t.trim()).filter(Boolean),lr=(e,t)=>!!t&&e.includes(String(t.name??"").trim().toLowerCase());function dr(e,t=[]){let r=[],n=0;for(let i of e.matchAll(ga)){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=xa(l);let d=va(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 li=(e,t=[])=>dr(e,t).map((r)=>typeof r==="string"?r:r.text).join(""),cr=null;function wa(e,t,r=[]){let n=e.ownerDocument;e.replaceChildren(...dr(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="",!cr){let s=n.createElement("template");s.innerHTML=Sa,cr=s.content.firstElementChild}o.append(cr.cloneNode(!0))}else if(/^https?:/i.test(i.href))o.target="_blank",o.rel="noopener noreferrer";return o.append(i.text),o}))}var _a="b3-board-style",Ea=`
41
+ `;class ir extends Ne{static observedAttributes=["src","alt","max-scale","open"];#t=1;#e=0;#n=0;#l=!1;#s=null;#i=new Map;#c=!1;#p=0;#r=0;#y=0;#v=0;#k=!1;#w=null;#m=null;#A=new WeakSet;#d=null;get scale(){return this.#t}get fitted(){return this.#t<=fe}get src(){return this.#d??this.getAttribute("src")}set src(e){if(e&&typeof e==="object")this.#d=e.src??e.default??String(e);else if(this.#d=null,e==null)this.removeAttribute("src");else this.setAttribute("src",e);this.#_()}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.#k)return;if(this.#k=!0,Be(this.ownerDocument,ca,da),this.classList.add("b3-image-viewer"),!this.hasAttribute("tabindex"))this.tabIndex=0;if(!this.hasAttribute("role"))this.setAttribute("role","group");this.#E(),this.#_(),this.#M(),this.#m=new MutationObserver(()=>{this.#S(),this.#f()}),this.#m.observe(this,{childList:!0}),this.#S(),this.#f()}disconnectedCallback(){this.#w?.abort(),this.#w=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.#c=!1,this.#k=!1}attributeChangedCallback(e,t,r){if(t===r)return;if(e==="src")this.#_(),this.reset();if(e==="alt"){let n=this.#h();if(n)n.alt=this.alt;this.#E()}if(e==="open"){if(this.#S(),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")}#_(){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(),e.tagName==="IMG")this.#o(e)}#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")}#o(e){if(this.#A.has(e))return;if(this.#A.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}}))}#S(){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)}#u(){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.#l=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}}#a(e){if(this.#t<=fe&&!this.#l){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.#l;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}#C(e,t,r,n=this.#u()){if(!n)return;let i=this.#t;e=Math.max(1,Math.min(this.maxScale,e));let a=(t-this.#e)/this.#t,s=(r-this.#n)/this.#t;if(this.#e=t-a*e,this.#n=r-s*e,this.#t=e,this.#a(n),this.#f(n),i!==this.#t)this.#T()}#T(){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.#u();if(t)this.#a(t);if(this.#f(t),e)this.#T()}zoomTo(e){let t=this.#u();if(t)this.#C(e,t.vw/2,t.vh/2,t)}requestClose(){this.dispatchEvent(new CustomEvent("b3-close",{bubbles:!0,composed:!0,detail:{src:this.src}}))}#x(){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.#w=new AbortController;let e={signal:this.#w.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.#u(),this.#i.size>1||this.#t>fe||this.#l)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.#l){this.#i.set(n.pointerId,{x:n.clientX,y:n.clientY});return}if(this.#s??=this.#u(),!this.#s)return;n.preventDefault();let a=this.#x(),s=i?this.#O():0;this.#i.set(n.pointerId,{x:n.clientX,y:n.clientY});let o=this.#x(),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=(a.x-c.left-this.#e)/this.#t,b=(a.y-c.top-this.#n)/this.#t;if(this.#e=o.x-c.left-f*u,this.#n=o.y-c.top-b*u,this.#t=u,this.#a(this.#s),this.#f(this.#s),this.#c=!0,d!==this.#t)this.#T()},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.#u();return}if(this.#s=null,this.#c){this.#p=performance.now(),this.#c=!1;return}if(n.type!=="pointerup")return;let i=performance.now(),a=Math.hypot(n.clientX-this.#y,n.clientY-this.#v)<aa;if(i-this.#r<oa&&a){this.#r=0;let s=this.getBoundingClientRect();this.#C(this.#t>fe?1:2.5,n.clientX-s.left,n.clientY-s.top),this.#p=i}else this.#r=i,this.#y=n.clientX,this.#v=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.#p<la){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.#C(this.#t*Math.exp(-n.deltaY/180),n.clientX-i.left,n.clientY-i.top);return}let a=this.#u();if(!a||a.h*this.#t<=a.vh&&!this.#l)return;let s=this.#n;if(this.#n-=n.deltaY,this.#a(a),this.#n===s)return;n.preventDefault(),this.#f(a)},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,a=(s,o)=>{let l=this.#u();if(!l||this.fitted)return!1;return this.#e+=s,this.#n+=o,this.#a(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(!a(i,0))return;break;case"ArrowRight":if(!a(-i,0))return;break;case"ArrowUp":if(!a(0,i))return;break;case"ArrowDown":if(!a(0,-i))return;break;default:return}n.preventDefault()},e),this.ownerDocument.defaultView.addEventListener("resize",()=>{let n=this.#u();if(n)this.#a(n),this.#f(n)},e)}}var ri=ir;function sr(e="b3-image-viewer"){if(typeof customElements>"u")return null;let t=customElements.get?.(e);if(t)return t;let r=ri;return ri=class extends ir{},customElements.define(e,r),r}sr();var ua=/(^|\s)([#@][\p{L}\p{N}_-]+)/gu,fa=/(?:\s+[#@][\p{L}\p{N}_-]+)+\s*$/u,ha=350,Ie=()=>globalThis.crypto?.randomUUID?.()??Math.random().toString(36).slice(2,11),or=(e)=>JSON.parse(JSON.stringify(nr(e))),y=(e,t)=>e!=null&&String(e)===String(t),rt=(e)=>!!e&&typeof e==="object",A=(e)=>Array.isArray(e.subtasks)?e.subtasks:[],he=(e)=>Array.isArray(e.comments)?e.comments:[];function ba(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,a]of[["y",525600],["mo",43200],["w",10080],["d",1440],["h",60]])if(n>=a)return`${Math.floor(n/a)}${i} ago`;return`${n}m ago`}var ui=(e)=>[...e.filter((t)=>t.starred),...e.filter((t)=>!t.starred)];function ar(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(rt).map((n)=>{r(n),n.cards=ui(Array.isArray(n.cards)?n.cards.filter(rt):[]);for(let i of n.cards){if(r(i),Array.isArray(i.subtasks)){for(let a of i.subtasks)if(rt(a))r(a)}if(Array.isArray(i.comments)){for(let a of i.comments)if(rt(a))r(a)}}return n})}function ni(e,{field:t,id:r}){if(t==="name"){let n=e.findIndex((i)=>y(i.id,r));if(n>=0)e.splice(n,1);return}for(let n of e){let i=n.cards.findIndex((a)=>y(a.id,r));if(t==="title"&&i>=0)return void n.cards.splice(i,1);if(t==="subtask")for(let a of n.cards){let s=A(a),o=s.findIndex((l)=>y(l.id,r));if(o>=0)return void s.splice(o,1)}}}function pa(e,t,r){let{field:n,id:i}=r,a=(s,o,l)=>s.splice(Math.min(l,s.length),0,nr(o));if(n==="name"){let s=e.findIndex((o)=>y(o.id,i));if(s>=0&&!t.some((o)=>y(o.id,i)))a(t,e[s],s);return}for(let s of e){let o=s.cards.findIndex((l)=>y(l.id,i));if(n==="title"&&o>=0){let l=t.find((c)=>y(c.id,s.id));if(l&&!l.cards.some((c)=>y(c.id,i)))a(l.cards,s.cards[o],o);return}if(n==="subtask")for(let l of s.cards){let c=A(l).findIndex((u)=>y(u.id,i));if(c<0)continue;let d=t.flatMap((u)=>u.cards).find((u)=>y(u.id,l.id));if(d&&!A(d).some((u)=>y(u.id,i))){if(!Array.isArray(d.subtasks))d.subtasks=[];a(d.subtasks,A(l)[c],c)}return}}}var fi=(e)=>e.toLowerCase().split(/\s+/).filter(Boolean);function ma(e){return[e.title??"",e.description??"",...A(e).map((t)=>t.title??""),...st(e),...he(e).map((t)=>t.text??"")].join(`
42
+ `).toLowerCase()}var ii=(e,t)=>{let r=String(t.text??"").toLowerCase();return fi(e).some((n)=>r.includes(n))};function st(e){let t=new Set((e.tags??[]).map((n)=>(/^[#@]/.test(n)?n:`#${n}`).toLowerCase())),r=[e.title??"",e.description??"",...A(e).map((n)=>n.title??"")].join(`
43
+ `);for(let[,,n]of r.matchAll(ua))t.add(n.toLowerCase());return[...t]}var si=String.raw`(<[^<>\n]+>|(?:[^()\n]|\([^()\n]*\))+)`,ga=new RegExp(String.raw`!\[([^\]\n]*)\]\(${si}\)|\[([^\]\n]+)\]\(${si}\)|\bhttps?:\/\/[^\s<>]+`,"giu"),ya=new Set(["javascript","data","vbscript","file","blob","about"]),xa=(e)=>{let t=e.trim();return t.startsWith("<")&&t.endsWith(">")?t.slice(1,-1):t.replace(/\s+"[^"\n]*"$/,"")};function va(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!ya.has(r)&&t.includes(r)?{href:e,file:!1}:null;return e.startsWith("//")?null:{href:e,file:!0}}var oi=(e)=>(e??"").toLowerCase().split(/[\s,]+/).map((t)=>t.replace(/:$/,"")).filter(Boolean),ai=(e)=>(e??"").toLowerCase().split(",").map((t)=>t.trim()).filter(Boolean),lr=(e,t)=>!!t&&e.includes(String(t.name??"").trim().toLowerCase());function dr(e,t=[]){let r=[],n=0;for(let i of e.matchAll(ga)){let a=i[2]!==void 0,[s]=i,o=a?i[1]:i[3],l=a?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=o=l=u}else l=xa(l);let d=va(l,t);if(!d||a&&!d.file&&!/^https?:/i.test(d.href))continue;if(i.index>n)r.push(e.slice(n,i.index));r.push({text:o,...d,...a?{image:a}:{}}),n=c}if(n<e.length)r.push(e.slice(n));return r}var li=(e,t=[])=>dr(e,t).map((r)=>typeof r==="string"?r:r.text).join(""),cr=null;function wa(e,t,r=[]){let n=e.ownerDocument;e.replaceChildren(...dr(t,r).map((i)=>{if(typeof i==="string")return n.createTextNode(i);let a=n.createElement("a");if(a.className="b3-board-ref",a.href=i.href,a.dataset.href=i.href,a.draggable=!1,i.image){let s=n.createElement("img");if(s.src=i.href,s.alt=i.text,s.loading="lazy",s.draggable=!1,a.classList.add("b3-board-image"),a.append(s),i.file)a.dataset.file="";else a.target="_blank",a.rel="noopener noreferrer";return a}if(i.file){if(a.dataset.file="",!cr){let s=n.createElement("template");s.innerHTML=Aa,cr=s.content.firstElementChild}a.append(cr.cloneNode(!0))}else if(/^https?:/i.test(i.href))a.target="_blank",a.rel="noopener noreferrer";return a.append(i.text),a}))}var _a="b3-board-style",Ea=`
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);
45
45
  --b3-board-tag:var(--b3-color-accent);--b3-board-mention:var(--b3-color-info);--b3-board-star:var(--b3-color-warning);
46
46
  --b3-board-line:color-mix(in srgb,var(--b3-color-border) 70%,transparent);--b3-board-soft:color-mix(in srgb,var(--b3-color-text) 5%,var(--b3-color-surface));}
@@ -108,7 +108,13 @@ b3-board{display:flex;flex-direction:column;min-inline-size:0;min-block-size:0;c
108
108
  border:1px solid var(--b3-board-line);border-radius:var(--b3-radius);background:var(--b3-color-surface);
109
109
  box-shadow:0 1px 2px color-mix(in srgb,var(--b3-color-text) 6%,transparent);transition:box-shadow var(--b3-duration,.16s),border-color var(--b3-duration,.16s);
110
110
  -webkit-touch-callout:none;-webkit-user-select:none;user-select:none;}
111
- .b3-board-card:focus-visible{outline:2px solid var(--b3-color-focus);outline-offset:1px;}
111
+ /* The selected card (the keys act on it): one solid ring inside its border — never clipped by the column, kept while focus
112
+ is elsewhere, apart from hover's faint tint. A focused card is always the selected one, so focus draws no ring of its own. */
113
+ .b3-board-card:focus{outline:none;}
114
+ .b3-board-card[data-b3-selected]{outline:2px solid var(--b3-color-focus);outline-offset:-1px;}
115
+ /* An ⌥-move with nowhere to go: a nudge that way. */
116
+ .b3-board-card[data-b3-bump]{animation:b3-board-bump .22s ease-out;}
117
+ @keyframes b3-board-bump{40%{translate:0 calc(var(--b3-board-bump,1) * 4px);}}
112
118
  .b3-board-grip{position:absolute;inset-inline-start:.125rem;inset-block-start:.75rem;display:grid;color:var(--b3-color-muted);opacity:.6;}
113
119
  .b3-board-card-head{position:relative;display:flex;align-items:flex-start;gap:.125rem;min-inline-size:0;}
114
120
  .b3-board-tools{flex:none;display:flex;align-items:flex-start;gap:.125rem;}
@@ -217,8 +223,8 @@ b3-board [data-b3-drop="before"]{box-shadow:0 -3px 0 -1px var(--b3-color-accent)
217
223
  .b3-board-keys dt{display:flex;gap:.25rem;justify-content:flex-end;}
218
224
  .b3-board-keys dd{margin:0;color:var(--b3-color-muted);}
219
225
  .b3-board-keys kbd{padding:0 .375rem;border:1px solid var(--b3-board-line);border-radius:.25rem;font:inherit;font-size:.75rem;white-space:nowrap;}
220
- @media (prefers-reduced-motion:reduce){.b3-board-toggle>.b3-board-icon,.b3-board-card{transition:none;}.b3-board-ghost{rotate:none;}}
221
- `,H=(e)=>`<svg class="b3-board-icon" viewBox="0 0 24 24" aria-hidden="true" focusable="false">${e}</svg>`,ci=H('<circle cx="9" cy="5" r="1"/><circle cx="9" cy="12" r="1"/><circle cx="9" cy="19" r="1"/><circle cx="15" cy="5" r="1"/><circle cx="15" cy="12" r="1"/><circle cx="15" cy="19" r="1"/>'),nt=H('<path d="M5 12h14M12 5v14"/>'),it=H('<path d="M3 6h18M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2M10 11v6M14 11v6"/>'),ka=H('<path d="m9 18 6-6-6-6"/>'),Sa=H('<path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"/><path d="M14 2v4a2 2 0 0 0 2 2h4M10 9H8M16 13H8M16 17H8"/>'),di=H('<path d="M7.9 20A9 9 0 1 0 4 16.1L2 22Z"/>'),Aa=H('<path d="M11 12H3M16 6H3M16 18H3M18 9v6M21 12h-6"/>'),Ca=H('<circle cx="11" cy="11" r="7"/><path d="m20 20-3.5-3.5"/>'),Ta=H('<path d="M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z"/>'),Le=(e,t,r=!0)=>`<template b3x-if="isEditing('${e}', ${t})">
226
+ @media (prefers-reduced-motion:reduce){.b3-board-toggle>.b3-board-icon,.b3-board-card{transition:none;}.b3-board-card[data-b3-bump]{animation:none;}.b3-board-ghost{rotate:none;}}
227
+ `,H=(e)=>`<svg class="b3-board-icon" viewBox="0 0 24 24" aria-hidden="true" focusable="false">${e}</svg>`,ci=H('<circle cx="9" cy="5" r="1"/><circle cx="9" cy="12" r="1"/><circle cx="9" cy="19" r="1"/><circle cx="15" cy="5" r="1"/><circle cx="15" cy="12" r="1"/><circle cx="15" cy="19" r="1"/>'),nt=H('<path d="M5 12h14M12 5v14"/>'),it=H('<path d="M3 6h18M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2M10 11v6M14 11v6"/>'),ka=H('<path d="m9 18 6-6-6-6"/>'),Aa=H('<path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"/><path d="M14 2v4a2 2 0 0 0 2 2h4M10 9H8M16 13H8M16 17H8"/>'),di=H('<path d="M7.9 20A9 9 0 1 0 4 16.1L2 22Z"/>'),Sa=H('<path d="M11 12H3M16 6H3M16 18H3M18 9v6M21 12h-6"/>'),Ca=H('<circle cx="11" cy="11" r="7"/><path d="m20 20-3.5-3.5"/>'),Ta=H('<path d="M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z"/>'),Le=(e,t,r=!0)=>`<template b3x-if="isEditing('${e}', ${t})">
222
228
  <textarea class="b3-board-editor" rows="1" b3x-model="editing.draft" b3x-init="focusEditor($el)"
223
229
  b3x-on:keydown="keyEditor($event, ${r})" b3x-on:paste="pasteEditor($event, '${e}', ${t})" b3x-on:blur="blurEditor('${e}', ${t})" aria-label="Edit"></textarea></template>`,Oa=`
224
230
  <div class="b3-board-filters" b3x-bind:hidden="!tokens().length && !searchable" role="group" aria-label="Filter">
@@ -248,7 +254,7 @@ b3-board [data-b3-drop="before"]{box-shadow:0 -3px 0 -1px var(--b3-color-accent)
248
254
  </header>
249
255
  <ol class="b3-board-cards">
250
256
  <template b3x-for="card in visible(column)" b3x-bind:key="card.id">
251
- <li class="b3-board-card" tabindex="0" b3x-bind:data-card="card.id" b3x-bind:data-starred="card.starred ? '' : null" b3x-on:keydown="keyCard($event, card)">
257
+ <li class="b3-board-card" tabindex="0" b3x-bind:data-card="card.id" b3x-bind:data-starred="card.starred ? '' : null" b3x-bind:data-b3-selected="isSelected(card) ? '' : null" b3x-on:keydown="keyCard($event, card)">
252
258
  <span class="b3-board-grip" b3x-show="!readonly">${ci}</span>
253
259
  <div class="b3-board-card-head">
254
260
  ${Le("title","card.id")}
@@ -256,7 +262,7 @@ b3-board [data-b3-drop="before"]{box-shadow:0 -3px 0 -1px var(--b3-color-accent)
256
262
  b3x-on:keydown="keyText($event, 'title', card.id, card.title)" b3x-effect="rich($el, label(card.title))"></span>
257
263
  <span class="b3-board-tools" b3x-show="!isEditing('title', card.id)">
258
264
  <button type="button" class="b3-board-quiet b3-board-details" b3x-show="!readonly && !hasDetails(card) && !isOpen(card)" b3x-bind:aria-label="'Add details to ' + plain(card.title)"
259
- b3x-on:click="addDetails(card)">${Aa}</button>
265
+ b3x-on:click="addDetails(card)">${Sa}</button>
260
266
  <button type="button" class="b3-board-quiet b3-board-remove" data-b3-confirm="Delete?" b3x-show="!readonly" b3x-bind:aria-label="'Delete ' + plain(card.title)"
261
267
  b3x-on:click="removeCard(column, card)">${it}</button>
262
268
  <button type="button" class="b3-board-quiet b3-board-star" b3x-show="!readonly || card.starred" b3x-bind:disabled="readonly"
@@ -321,8 +327,8 @@ b3-board [data-b3-drop="before"]{box-shadow:0 -3px 0 -1px var(--b3-color-accent)
321
327
  </template>
322
328
  <button type="button" class="b3-board-link b3-board-add" b3x-show="!readonly" b3x-on:click="addColumn()">${nt}<span>Add column</span></button>
323
329
  </div>
324
- <span class="b3-visually-hidden" role="status" b3x-text="announcement"></span>`;class hi extends Ne{static observedAttributes=["readonly","search","link-schemes","searchable","expand-in"];#t=null;#e=null;#n=null;#o=null;#s=null;#i=!1;#a=null;#b=null;#r=null;#y=!1;#v=null;#k=0;#w=Math.random().toString(36).slice(2,8);#m=!1;#S=[];#l={past:[],future:[],now:null,key:"",at:0};#h=!1;get columns(){let e=or(this.#e?.columns??this.#n??[]),t=this.#e?.editing;if(t?.fresh)ni(e,t);return e}set columns(e){let t=ar(or(e));if(!this.#e){this.#n=t;return}this.#p();let r=this.#M();if(r)this.#$(r);let n=this.#e;if(n.editing?.fresh)ba(n.columns,t,n.editing);if(n.columns=t,n.editing&&!this.#c(n.editing.id))n.editing=null;if(!this.#h)this.#l={past:[],future:[],now:null,key:"",at:0};this.#l.now=this.columns}undo(){return this.#_(-1)}openSearch(){if(!this.#e?.searchable)return!1;return this.#e.openSearch(),!0}redo(){return this.#_(1)}get canUndo(){return!this.readonly&&(this.#l.past.length>0||!!this.#e?.editing)}get canRedo(){return!this.readonly&&this.#l.future.length>0}#_(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=ar(or(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===void 0)delete l.expanded;else l.expanded=c}return this.#p(),t.columns=s,r.now=this.columns,this.#u(e<0?"Undone":"Redone"),this.#E({type:e<0?"undo":"redo"}),!0}#E(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)=>y(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.#v}set upload(e){this.#v=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(Be(e,_a,Ea),ti(),!this.#t){let t=this.querySelector(':scope > script[type="application/json"]'),r=this.#n;if(!r&&t)try{r=ar(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=Qn(this.#t,Oa,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.#R(),pr(this,this.#a.signal,{role:"region"})}disconnectedCallback(){this.#p(),this.#a?.abort(),this.#a=null,this.#D(),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=oi(r));if(e==="searchable")return void(this.#e.searchable=r!==null);if(e==="expand-in")return void(this.#e.expandIn=ai(r));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(y(t.id,e))return t;for(let r of t.cards)if(y(r.id,e)||S(r).some((n)=>y(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(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)=>y(d.id,a));if(c>=0)return{column:l,index:c,card:l.cards[c]}}return null},s=Zn({columns:e,filter:t,search:r,kept:[],editing:null,announcement:"",readonly:n.readonly,searchable:n.hasAttribute("searchable"),expandIn:ai(n.getAttribute("expand-in")),searching:!1,schemes:oi(n.getAttribute("link-schemes")),viewed:{},tokensOf:st,subtasksOf:S,commentsOf:he,hits:ii,said(a){return he(a).some((l)=>ii(s.search,l))},now:Date.now(),ago(a){return pa(a,s.now)},label(a){let l=String(a??"");return l.replace(fa,"").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||S(a).length||he(a).length)},complete(a){let l=S(a).length;return l>0&&s.done(a)===l},preview(a){let l=String(a.description??"");return l.split(`
325
- `).map((d)=>li(d,s.schemes)).find((d)=>d.trim())?.trim()??(dr(l,s.schemes).some((d)=>typeof d!=="string"&&d.image)?"Image":"")},plain(a){return li(s.label(a),s.schemes)},rich(a,l){wa(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??(s.hasDetails(a)&&lr(s.expandIn,s.columns.find((c)=>c.cards.some((d)=>y(d.id,a.id)))))},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.#C(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=fi(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((p)=>y(d.id,p)))return!0;let u=st(d),f=l.length?ma(d):"";return s.filter.every((p)=>u.includes(p))&&l.every((p)=>f.includes(p))})},count(a){let l=s.visible(a).length;return l===a.cards.length?String(l):`${l}/${a.cards.length}`},done(a){return S(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=ui(l.column.cards);let c=!!a.starred;s.announcement=`${a.title??""} ${c?"starred":"unstarred"}`,i({type:"star",card:a.id,starred:c}),n.#L(a.id)},toggle(a){if(s.readonly){s.viewed={...s.viewed,[String(a.id)]:!s.isOpen(a)};return}a.expanded=!s.isOpen(a),i({type:"toggle",card:a.id,expanded:a.expanded})},edit(a,l,c,d=!1,u=!1,f=!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:f},n.#T()},addDetails(a,l=!1){if(s.readonly)return;let c=!s.isOpen(a);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.#I(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 p=d;if(c){let m={id:Ie(),at:new Date().toISOString(),by:n.getAttribute("author")||"you",text:c};p.comments=[...he(p),m],u={type:"comment",card:p.id,comment:m.id,op:"add"}}}else if(l.field==="name"){let p=d;if(c&&c!==p.name)p.name=c,u={type:"edit",column:p.id,field:"name"};if(l.fresh)u={type:"add",column:p.id}}else if(l.field==="subtask"){let p=d,m=S(p).find((h)=>y(h.id,l.id));if(!c)return s.removeSubtask(p,m);if(c!==m.title)m.title=c,u={type:"edit",card:p.id,field:"subtask",subtask:m.id};if(l.fresh)u={type:"subtask",card:p.id,subtask:m.id,op:"add"}}else{let p=d,m=l.field;if((c||m==="description")&&c!==(p[m]??""))p[m]=c,u={type:"edit",card:p.id,field:m};if(l.fresh)u={type:"add",card:p.id,column:o(p.id).column.id},s.kept=[...s.kept,p.id]}if(u)i(u);let f=n.#c(l.id)??d;if(l.fresh&&l.field==="subtask"&&a)s.addSubtask(f);else if(l.fresh&&l.field==="title"&&a&&!n.hasAttribute("compact"))s.addDetails(f,!0);else n.#I(l)},discard(a){ni(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=S(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=he(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.metaKey||a.ctrlKey)return;if(!a.altKey)return void n.#O(a,l);if(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 p=s.visible(c.column),m=p[p.indexOf(c.card)+u];if(m&&!m.starred===!l.starred)n.moveCard(l.id,c.column.id,c.column.cards.indexOf(m));return}let f=s.columns[s.columns.indexOf(c.column)+u];if(f)n.moveCard(l.id,f.id,Math.min(c.index,f.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,S(l).indexOf(c)+d)},keyColumn(a,l){if(a.metaKey||a.ctrlKey||a.shiftKey)return;let c=getComputedStyle(n).direction==="rtl",d=a.key==="ArrowLeft"?c?1:-1:a.key==="ArrowRight"?c?-1:1:0;if(!a.altKey){let f=a.currentTarget.closest(".b3-board-column"),p=[...n.querySelectorAll(".b3-board-column")],m=a.key==="ArrowDown"?f.querySelector(".b3-board-card"):d?p[p.indexOf(f)+d]?.querySelector(".b3-board-column-name"):void 0;if(m===void 0)return;if(a.preventDefault(),m)n.#x(m);return}if(!d||s.readonly)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"&&y(n.editing.id,e)?n.editing:null,o=`![Uploading image ${this.#w}-${++this.#k}…]()`,s="",a=i();if(a&&r){let{selectionStart:b,selectionEnd:x}=r;s=b&&r.value[b-1]!==`
330
+ <span class="b3-visually-hidden" role="status" b3x-text="announcement"></span>`;class hi extends Ne{static observedAttributes=["readonly","search","link-schemes","searchable","expand-in"];#t=null;#e=null;#n=null;#l=null;#s=null;#i=!1;#c=null;#p=null;#r=null;#y=!1;#v=null;#k=0;#w=Math.random().toString(36).slice(2,8);#m=!1;#A=[];#d={past:[],future:[],now:null,key:"",at:0};#h=!1;get columns(){let e=or(this.#e?.columns??this.#n??[]),t=this.#e?.editing;if(t?.fresh)ni(e,t);return e}set columns(e){let t=ar(or(e));if(!this.#e){this.#n=t;return}this.#b();let r=this.#M();if(r)this.#z(r);let n=this.#e;if(n.editing?.fresh)pa(n.columns,t,n.editing);if(n.columns=t,n.editing&&!this.#o(n.editing.id))n.editing=null;if(!this.#h)this.#d={past:[],future:[],now:null,key:"",at:0};this.#d.now=this.columns}undo(){return this.#_(-1)}openSearch(){if(!this.#e?.searchable)return!1;return this.#e.openSearch(),!0}redo(){return this.#_(1)}get canUndo(){return!this.readonly&&(this.#d.past.length>0||!!this.#e?.editing)}get canRedo(){return!this.readonly&&this.#d.future.length>0}#_(e){let t=this.#e;if(!t||this.readonly)return!1;t.settle();let r=this.#d,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 a=new Map(t.columns.flatMap((o)=>o.cards.map((l)=>[String(l.id),l.expanded]))),s=ar(or(i));for(let o of s)for(let l of o.cards){let c=a.get(String(l.id));if(a.has(String(l.id)))if(c===void 0)delete l.expanded;else l.expanded=c}return this.#b(),t.columns=s,r.now=this.columns,this.#a(e<0?"Undone":"Redone"),this.#E({type:e<0?"undo":"redo"}),!0}#E(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.#l??[]]}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.#l=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((a)=>y(a.id,r))??t.columns.find((a)=>String(a.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.#v}set upload(e){this.#v=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(Be(e,_a,Ea),ti(),!this.#t){let t=this.querySelector(':scope > script[type="application/json"]'),r=this.#n;if(!r&&t)try{r=ar(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=Qn(this.#t,Oa,this.#S(r??[],this.#l??[],this.#s??this.getAttribute("search")??"")),this.#n=this.#l=this.#s=null,this.#d.now=this.columns}else if(this.#t.parentNode!==this)this.append(this.#t);this.#p=new MutationObserver(()=>{if(this.#t&&this.#t.parentNode!==this)this.append(this.#t)}),this.#p.observe(this,{childList:!0}),this.#U(),br(this,this.#c.signal,{role:"region"})}disconnectedCallback(){this.#b(),this.#c?.abort(),this.#c=null,this.#P(),this.#p?.disconnect(),this.#p=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=oi(r));if(e==="searchable")return void(this.#e.searchable=r!==null);if(e==="expand-in")return void(this.#e.expandIn=ai(r));if(this.#e.readonly=this.readonly,this.#e.viewed={},this.readonly)this.#b(),this.#e.editing=null}#o(e){for(let t of this.#e?.columns??[]){if(y(t.id,e))return t;for(let r of t.cards)if(y(r.id,e)||A(r).some((n)=>y(n.id,e)))return r}return null}#g(e){let t="card"in e&&e.card!=null&&e.type!=="toggle"&&e.type!=="remove"?this.#o(e.card):null;if(t){if(t.updated=new Date().toISOString(),e.type==="add")t.created=t.updated}let r=this.#d,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(e)}#S(e,t,r){let n=this,i=(o)=>this.#g(o),a=(o)=>{for(let l of s.columns){let c=l.cards.findIndex((d)=>y(d.id,o));if(c>=0)return{column:l,index:c,card:l.cards[c]}}return null},s=Zn({columns:e,filter:t,search:r,kept:[],editing:null,announcement:"",readonly:n.readonly,searchable:n.hasAttribute("searchable"),expandIn:ai(n.getAttribute("expand-in")),searching:!1,schemes:oi(n.getAttribute("link-schemes")),viewed:{},selected:null,tokensOf:st,subtasksOf:A,commentsOf:he,hits:ii,said(o){return he(o).some((l)=>ii(s.search,l))},now:Date.now(),ago(o){return ba(o,s.now)},label(o){let l=String(o??"");return l.replace(fa,"").trim()||l},pressed(o){return String(s.filter.includes(o))},mention(o){return o.startsWith("@")?"":null},starred(o){return String(!!o.starred)},hasDetails(o){return!!(o.description||A(o).length||he(o).length)},complete(o){let l=A(o).length;return l>0&&s.done(o)===l},preview(o){let l=String(o.description??"");return l.split(`
331
+ `).map((d)=>li(d,s.schemes)).find((d)=>d.trim())?.trim()??(dr(l,s.schemes).some((d)=>typeof d!=="string"&&d.image)?"Image":"")},plain(o){return li(s.label(o),s.schemes)},rich(o,l){wa(o,String(l??""),s.schemes)},keyText(o,l,c,d){if(o.target!==o.currentTarget||o.key!=="Enter"&&o.key!==" ")return;o.preventDefault(),o.stopPropagation(),s.edit(l,c,d)},isOpen(o){let l=s.viewed[String(o.id)];return s.readonly&&l!==void 0?l:o.expanded??(s.hasDetails(o)&&lr(s.expandIn,s.columns.find((c)=>c.cards.some((d)=>y(d.id,o.id)))))},expanded(o){return String(s.isOpen(o))},isSelected(o){return y(s.selected,o.id)},isEditing(o,l){return!!s.editing&&s.editing.field===o&&s.editing.id===l},focusEditor(o){queueMicrotask(()=>n.#C(o))},blurEditor(o,l){if(s.isEditing(o,l))s.commit()},tokens(){let o=new Set;for(let l of s.columns)for(let c of l.cards)for(let d of st(c))o.add(d);return[...o].sort()},visible(o){let l=fi(s.search);if(!s.filter.length&&!l.length)return o.cards;let c=s.editing&&n.#o(s.editing.id);return o.cards.filter((d)=>{if(d===c||s.kept.some((b)=>y(d.id,b)))return!0;let u=st(d),f=l.length?ma(d):"";return s.filter.every((b)=>u.includes(b))&&l.every((b)=>f.includes(b))})},count(o){let l=s.visible(o).length;return l===o.cards.length?String(l):`${l}/${o.cards.length}`},done(o){return A(o).filter((l)=>l.done).length},disclosable(o){return!!(s.hasDetails(o)||!s.readonly)},toggleFilter(o){s.kept=[],s.filter=s.filter.includes(o)?s.filter.filter((l)=>l!==o):[...s.filter,o]},setFilter(o){s.kept=[],s.filter=o},searchShown(){return s.searching||!!s.search},openSearch(){s.searching=!0;let o=n.querySelector(".b3-board-search-input");if(!o)return;o.hidden=!1,o.closest(".b3-board-filters").hidden=!1,o.focus(),o.select()},typeSearch(o){n.search=o.target.value},keySearch(o){if(o.isComposing||o.keyCode===229)return;if(o.key!=="Escape"&&o.key!=="Enter")return;o.preventDefault(),o.stopPropagation();let l=o.target;if(o.key==="Escape")l.value="",n.search="";l.blur()},blurSearch(){s.searching=!1},toggleStar(o){let l=a(o.id);if(s.readonly||!l)return;if(o.starred)delete o.starred;else o.starred=!0;l.column.cards=ui(l.column.cards);let c=!!o.starred;s.announcement=`${o.title??""} ${c?"starred":"unstarred"}`,i({type:"star",card:o.id,starred:c}),n.#N(o.id)},toggle(o){if(s.readonly){s.viewed={...s.viewed,[String(o.id)]:!s.isOpen(o)};return}o.expanded=!s.isOpen(o),i({type:"toggle",card:o.id,expanded:o.expanded})},edit(o,l,c,d=!1,u=!1,f=!1){if(s.readonly||n.#r?.started)return;if(s.editing&&!s.isEditing(o,l))s.commit();s.editing={field:o,id:l,draft:c??"",fresh:d,opened:u,atEnd:f},n.#T()},addDetails(o,l=!1){if(s.readonly)return;let c=!s.isOpen(o);o.expanded=!0,s.edit("description",o.id,String(o.description??""),!1,c,l)},keyEditor(o,l){if(o.stopPropagation(),o.key==="Escape")o.preventDefault(),s.cancel();else if(o.key==="Enter"&&!(l&&o.shiftKey)&&!o.isComposing)o.preventDefault(),s.commit(!0);else if(o.key==="Tab"&&!o.altKey&&!o.metaKey&&!o.ctrlKey&&!o.isComposing&&!n.hasAttribute("compact")){let c=s.editing,d=c?.field==="title"&&!o.shiftKey?"description":c?.field==="description"&&o.shiftKey?"title":null;if(!d)return;o.preventDefault(),s.commit();let u=n.#o(c.id);if(!u||s.readonly)return;if(d==="description")s.addDetails(u,!0);else s.edit("title",u.id,String(u.title??""))}},pasteEditor(o,l,c){let d=[...o.clipboardData?.files??[]].filter((u)=>u.type.startsWith("image/"));if(s.readonly||!n.upload||l!=="title"&&l!=="description"||!d.length)return;if(o.clipboardData?.getData("text/plain").trim())return;o.preventDefault();for(let u of d)n.#u(c,u,l==="description"?o.target:null)},cancel(){let o=s.editing;if(s.editing=null,o?.fresh)s.discard(o);if(o?.opened)s.close(o);n.#B(o)},close(o){let l=n.#o(o.id);if(l&&!s.hasDetails(l))l.expanded=!1},commit(o=!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.#o(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=[...he(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=A(b).find((p)=>y(p.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:a(b.id).column.id},s.kept=[...s.kept,b.id]}if(u)i(u);let f=n.#o(l.id)??d;if(l.fresh&&l.field==="subtask"&&o)s.addSubtask(f);else if(l.fresh&&l.field==="title"&&o&&!n.hasAttribute("compact"))s.addDetails(f,!0);else n.#B(l)},discard(o){ni(s.columns,o)},settle(){if(s.editing)s.commit()},addCard(o){if(s.readonly)return;s.settle();let l={id:Ie(),title:""};o.cards.push(l),s.edit("title",l.id,"",!0)},addColumn(){if(s.readonly)return;s.settle();let o={id:Ie(),name:"",cards:[]};s.columns.push(o),s.edit("name",o.id,"",!0)},addSubtask(o){if(s.readonly)return;s.settle();let l={id:Ie(),title:"",done:!1};if(o.expanded=!0,!Array.isArray(o.subtasks))o.subtasks=[];o.subtasks.push(l),s.edit("subtask",l.id,"",!0)},removeCard(o,l){if(s.readonly)return;o.cards=o.cards.filter((c)=>c!==l),i({type:"remove",card:l.id,column:o.id})},removeColumn(o){if(s.readonly)return;s.columns=s.columns.filter((l)=>l!==o),i({type:"remove",column:o.id})},removeSubtask(o,l){if(s.readonly)return;o.subtasks=A(o).filter((c)=>c!==l),i({type:"subtask",card:o.id,subtask:l.id,op:"remove"})},removeComment(o,l){if(s.readonly)return;o.comments=he(o).filter((c)=>c!==l),i({type:"comment",card:o.id,comment:l.id,op:"remove"})},check(o,l,c){if(s.readonly)return;l.done=c,i({type:"check",card:o.id,subtask:l.id,done:c})},keyCard(o,l){if(o.target!==o.currentTarget)return;if(o.key==="Enter")return o.preventDefault(),s.edit("title",l.id,l.title);if(o.metaKey||o.ctrlKey)return;if(!o.altKey)return void n.#O(o,l);if(s.readonly)return;let c=a(l.id);if(!c)return;let d=getComputedStyle(n).direction==="rtl",u={ArrowUp:-1,ArrowDown:1,ArrowLeft:d?1:-1,ArrowRight:d?-1:1}[o.key];if(!u)return;if(o.preventDefault(),o.key==="ArrowUp"||o.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));else n.#I(o.currentTarget,u,!m?u<0?"Already first":"Already last":l.starred?"Starred cards stay above the others — unstar it to move it lower":"Starred cards stay on top — star it to move it among them");return}let f=s.columns[s.columns.indexOf(c.column)+u];if(f)n.moveCard(l.id,f.id,Math.min(c.index,f.cards.length));else n.#I(o.currentTarget,0,"No column there")},keySubtask(o,l,c){s.keyText(o,"subtask",c.id,c.title);let d=o.key==="ArrowUp"?-1:o.key==="ArrowDown"?1:0;if(!o.altKey||!d||s.readonly)return;o.preventDefault(),o.stopPropagation(),n.#f(l,c.id,A(l).indexOf(c)+d)},keyColumn(o,l){if(o.metaKey||o.ctrlKey||o.shiftKey)return;let c=getComputedStyle(n).direction==="rtl",d=o.key==="ArrowLeft"?c?1:-1:o.key==="ArrowRight"?c?-1:1:0;if(!o.altKey){let f=o.currentTarget.closest(".b3-board-column"),b=[...n.querySelectorAll(".b3-board-column")],m=o.key==="ArrowDown"?f.querySelector(".b3-board-card"):d?b[b.indexOf(f)+d]?.querySelector(".b3-board-column-name"):void 0;if(m===void 0)return;if(o.preventDefault(),m)n.#x(m);return}if(!d||s.readonly)return;o.preventDefault();let u=s.columns.indexOf(l)+d;if(u>=0&&u<s.columns.length)n.moveColumn(l.id,u)}});return s}async#u(e,t,r){let n=this.#e,i=()=>n.editing?.field==="description"&&y(n.editing.id,e)?n.editing:null,a=`![Uploading image ${this.#w}-${++this.#k}…]()`,s="",o=i();if(o&&r){let{selectionStart:h,selectionEnd:x}=r;s=h&&r.value[h-1]!==`
326
332
  `?`
327
- ${o}`:o,a.draft=r.value=r.value.slice(0,b)+s+r.value.slice(x),r.setSelectionRange(b+s.length,b+s.length)}let l=n.columns.find((b)=>b.cards.some((x)=>y(x.id,e))),c=null;try{c=await this.#v?.(t,{card:e,column:l?.id})}catch(b){console.warn("b3-board: image upload failed",b)}let d=c?`![](${String(c).replace(/[\s()]/g,(b)=>`%${b.charCodeAt(0).toString(16).toUpperCase().padStart(2,"0")}`)})`:"";if(!d)this.#u("Image not added");while(this.#m)await new Promise((b)=>this.#S.push(b));let u=(b)=>{if(!s)return null;let x=b.indexOf(s),z=x>=0?x:b.indexOf(o);if(z<0)return null;let ie=x>=0?s:o;return[z,z+ie.length,d?ie.replace(o,d):""]},f=(b)=>{if(!s)return d?b.trim()?`${b.replace(/\s+$/,"")}
328
- ${d}`:d:b;let x=u(b);return x?b.slice(0,x[0])+x[2]+b.slice(x[1]):b},p=i();if(p){let b=this.querySelector("textarea.b3-board-editor"),x=b?.value===p.draft&&u(b.value);if(b&&x){let[z,ie,ot]=x,{selectionStart:pi,selectionEnd:bi,selectionDirection:mi}=b,ur=(De)=>De>=ie?De+ot.length-(ie-z):De>z?z+ot.length:De;b.setRangeText(ot,z,ie),b.setSelectionRange(ur(pi),ur(bi),mi??void 0),p.draft=b.value}else if(f(p.draft)!==p.draft)p.draft=f(p.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((b)=>b.cards).find((b)=>String(b.description??"").includes(o))??m;let h=String(m?.description??""),g=f(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((f)=>y(f.id,e))),o=n.columns.find((u)=>y(u.id,t));if(!i||!o)return!1;let s=i.cards.findIndex((u)=>y(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;if(lr(n.expandIn,i)!==lr(n.expandIn,o))delete a.expanded;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.#L(a.id),!0}moveColumn(e,t){let r=this.#e;if(!r||this.readonly)return!1;let n=r.columns.findIndex((s)=>y(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=S(e),o=i.findIndex((l)=>y(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}#C(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})}#T(){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()}))}#x(e){e.focus({preventScroll:!0}),e.scrollIntoView({block:"nearest",inline:"nearest"})}#O(e,t){let r=this.#e,n=e.currentTarget,i=(c)=>[...c.querySelectorAll(".b3-board-cards > .b3-board-card")],o=n.closest(".b3-board-column"),s=i(o),a=s.indexOf(n),l;switch(e.key){case"ArrowUp":l=s[a-1];break;case"ArrowDown":l=s[a+1];break;case"Home":l=s[0];break;case"End":l=s.at(-1);break;case"ArrowLeft":case"ArrowRight":{let c=[...this.querySelectorAll(".b3-board-column")],d=e.key==="ArrowLeft"!==(getComputedStyle(this).direction==="rtl")?-1:1;for(let u=c.indexOf(o)+d;u>=0&&u<c.length&&!l;u+=d){let f=i(c[u]);l=f[Math.min(a,f.length-1)]}break}case" ":if(e.preventDefault(),!this.hasAttribute("compact")&&r.disclosable(t))r.toggle(t);return;case"Delete":case"Backspace":{if(r.readonly||e.shiftKey)return;e.preventDefault();let c=(s[a+1]??s[a-1])?.dataset.card;n.querySelector(":scope > .b3-board-card-head .b3-board-remove")?.click(),requestAnimationFrame(()=>{if(n.isConnected)return;let d=c!==void 0&&this.querySelector(`[data-card="${CSS.escape(c)}"]`),u=this.querySelector(`[data-column="${CSS.escape(o.dataset.column??"")}"] .b3-board-column-name`),f=d||u;if(f)this.#x(f)});return}default:return}if(e.preventDefault(),l)this.#x(l)}focusCard(e){let t=e!==void 0&&this.querySelector(`[data-card="${CSS.escape(String(e))}"]`)||this.querySelector(".b3-board-cards > .b3-board-card");if(!t)return!1;return this.#x(t),!0}shortcuts=[];showShortcuts(e=!0){let t=this.#t;if(!t)return!1;let r=t.querySelector(":scope > .b3-board-keys");if(!e){if(r){if(r.dataset.back)this.focusCard(r.dataset.back);r.remove()}return!0}if(r)return!0;let n=/Mac|iP(hone|ad|od)/.test(this.ownerDocument.defaultView?.navigator.platform??""),i=n?"⌥":"Alt+",o=n?"⌘":"Ctrl+",s=[["↑ ↓","Previous / next card"],["← →","Card in the next column"],["Home End","First / last card"],["Space","Expand / collapse"],["Enter","Edit the title"],...this.readonly?[]:[[`${i}↑ ${i}↓`,"Move the card up / down"],[`${i}← ${i}→`,"Move the card to the next column"],["Delete","Delete the card (press twice)"],[`${o}Z ${n?"⇧⌘Z":"Ctrl+Y"}`,"Undo / redo"]],...this.shortcuts,["Esc","Cancel / close"],["?","This list"]];r=this.ownerDocument.createElement("div"),r.className="b3-board-keys",r.tabIndex=-1,r.setAttribute("role","dialog"),r.setAttribute("aria-label","Keyboard shortcuts");let a=this.ownerDocument.activeElement;if(a?.matches(".b3-board-card"))r.dataset.back=a.dataset.card;let l=this.ownerDocument.createElement("dl");for(let[c,d]of s){let u=this.ownerDocument.createElement("div"),f=this.ownerDocument.createElement("dt"),p=this.ownerDocument.createElement("dd");for(let m of c.split(" ")){let h=this.ownerDocument.createElement("kbd");h.textContent=m,f.append(h)}p.textContent=d,u.append(f,p),l.append(u)}return r.append(l),r.addEventListener("keydown",(c)=>{if(c.key!=="Escape"&&c.key!=="?")return;c.preventDefault(),c.stopPropagation(),this.showShortcuts(!1)}),r.addEventListener("focusout",(c)=>{if(!r.contains(c.relatedTarget))queueMicrotask(()=>r.remove())}),t.append(r),r.focus({preventScroll:!0}),!0}#M(){let e=this.ownerDocument.activeElement;if(!e?.matches(".b3-board-card")||!this.contains(e))return null;let t=e.closest(".b3-board-column");return{id:e.dataset.card,column:t.dataset.column,index:[...t.querySelectorAll(".b3-board-cards > .b3-board-card")].indexOf(e)}}#$(e){requestAnimationFrame(()=>{let t=this.ownerDocument.activeElement;if(t&&t!==this.ownerDocument.body&&t.isConnected)return;let r=[...this.querySelectorAll(`[data-column="${CSS.escape(e.column)}"] .b3-board-cards > .b3-board-card`)];(this.querySelector(`[data-card="${CSS.escape(e.id)}"]`)??r[Math.min(e.index,r.length-1)])?.focus({preventScroll:!0})})}#L(e){requestAnimationFrame(()=>this.querySelector(`[data-card="${CSS.escape(String(e))}"]`)?.focus({preventScroll:!1}))}#I(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})})}#R(){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.#U(o),{signal:e}),t.addEventListener("pointermove",(o)=>this.#j(o),{signal:e}),t.addEventListener("pointerup",(o)=>this.#q(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("focusin",(o)=>{let s=o.target,a=s.parentElement;if(!a?.matches(".b3-board-filters"))return;a.style.scrollPaddingInlineEnd=`${a.querySelector(":scope > .b3-board-search")?.offsetWidth??0}px`,s.scrollIntoView({inline:"nearest",block:"nearest"})},{signal:e}),this.addEventListener("click",(o)=>{if(!this.#y)return;this.#y=!1,o.preventDefault(),o.stopImmediatePropagation()},{signal:e,capture:!0}),this.addEventListener("keydown",(o)=>{if(o.key!=="?"||o.defaultPrevented||o.metaKey||o.ctrlKey||o.altKey||o.isComposing)return;if(o.target.closest?.('input, textarea, select, [contenteditable]:not([contenteditable="false"]), .b3-board-keys'))return;o.preventDefault(),this.showShortcuts()},{signal:e}),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.#H(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.#D();this.addEventListener("compositionstart",()=>{this.#m=!0},{signal:e}),this.addEventListener("compositionend",i,{signal:e}),this.addEventListener("focusout",i,{signal:e})}#D(){this.#m=!1;for(let e of this.#S.splice(0))e()}#H(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)=>y(c.id,r("[data-column]")?.dataset.column)),i=n?.cards.find((c)=>y(c.id,r("[data-card]")?.dataset.card)),o=i&&S(i).find((c)=>y(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.#z(t,a,s);return}if(!t.dispatchEvent(new CustomEvent("b3-link",{bubbles:!0,cancelable:!0,detail:s}))||s.file)e.preventDefault()}#z(e,t,r){let n=this.ownerDocument;n.body.querySelector(":scope > .b3-board-lightbox")?.dispatchEvent(new CustomEvent("b3-close")),sr();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})}#U(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.#N(e.clientX,e.clientY)},ha)}#N(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.#K(r.px,r.py),this.#F(this.#B(r.px,r.py)),r.frame=requestAnimationFrame(o)};r.frame=requestAnimationFrame(o)}#j(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.#N(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}#q(e){let t=this.#r;if(!t||e.pointerId!==t.pointerId)return;if(!t.started)return this.#p();let r=this.#B(e.clientX,e.clientY);if(this.#p(),this.#y=!0,setTimeout(()=>{this.#y=!1},0),!r)return;let n=this.#e;if(t.kind==="card"){let i=n.columns.find((l)=>y(l.id,r.column)),o=n.columns.find((l)=>l.cards.some((c)=>y(c.id,t.id))),s=r.before?i.cards.findIndex((l)=>y(l.id,r.before)):i.cards.length,a=o.cards.findIndex((l)=>y(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=S(i),s=r.before?o.findIndex((a)=>y(a.id,r.before)):o.length;if(o.findIndex((a)=>y(a.id,t.id))<s)s-=1;this.#f(i,t.id,s)}else{let i=r.before?n.columns.findIndex((s)=>y(s.id,r.before)):n.columns.length;if(n.columns.findIndex((s)=>y(s.id,t.id))<i)i-=1;this.moveColumn(t.id,i)}}#B(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.#P(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((p)=>{let m=p.getBoundingClientRect();return t<m.top+m.height/2}),f=(p)=>!!(p!=null&&this.#c(p)?.starred);if(f(u?.dataset.card)!==f(r.id)&&(u||f(r.id)))u=d.find((p)=>!f(p.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}}#F(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")}#P(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})}#K(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.#P(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")}}hr("b3-board",hi);export{hi as B3Board};
333
+ ${a}`:a,o.draft=r.value=r.value.slice(0,h)+s+r.value.slice(x),r.setSelectionRange(h+s.length,h+s.length)}let l=n.columns.find((h)=>h.cards.some((x)=>y(x.id,e))),c=null;try{c=await this.#v?.(t,{card:e,column:l?.id})}catch(h){console.warn("b3-board: image upload failed",h)}let d=c?`![](${String(c).replace(/[\s()]/g,(h)=>`%${h.charCodeAt(0).toString(16).toUpperCase().padStart(2,"0")}`)})`:"";if(!d)this.#a("Image not added");while(this.#m)await new Promise((h)=>this.#A.push(h));let u=(h)=>{if(!s)return null;let x=h.indexOf(s),z=x>=0?x:h.indexOf(a);if(z<0)return null;let ie=x>=0?s:a;return[z,z+ie.length,d?ie.replace(a,d):""]},f=(h)=>{if(!s)return d?h.trim()?`${h.replace(/\s+$/,"")}
334
+ ${d}`:d:h;let x=u(h);return x?h.slice(0,x[0])+x[2]+h.slice(x[1]):h},b=i();if(b){let h=this.querySelector("textarea.b3-board-editor"),x=h?.value===b.draft&&u(h.value);if(h&&x){let[z,ie,ot]=x,{selectionStart:bi,selectionEnd:pi,selectionDirection:mi}=h,ur=(De)=>De>=ie?De+ot.length-(ie-z):De>z?z+ot.length:De;h.setRangeText(ot,z,ie),h.setSelectionRange(ur(bi),ur(pi),mi??void 0),b.draft=h.value}else if(f(b.draft)!==b.draft)b.draft=f(b.draft);else if(d)this.#a("Image not added");return}let m=this.#o(e);if(s&&!String(m?.description??"").includes(a))m=n.columns.flatMap((h)=>h.cards).find((h)=>String(h.description??"").includes(a))??m;let p=String(m?.description??""),g=f(p).trim();if(!m||this.readonly||g===p.trim()){if(d)this.#a("Image not added");return}m.description=g,m.expanded=!0,this.#g({type:"edit",card:m.id,field:"description"})}#a(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)=>y(f.id,e))),a=n.columns.find((u)=>y(u.id,t));if(!i||!a)return!1;let s=i.cards.findIndex((u)=>y(u.id,e)),[o]=i.cards.splice(s,1),l=a.cards.filter((u)=>u.starred).length,c=Math.max(0,Math.min(a.cards.length,r)),d=o.starred?Math.min(c,l):Math.max(c,l);if(a.cards.splice(d,0,o),i===a&&s===d)return!1;if(lr(n.expandIn,i)!==lr(n.expandIn,a))delete o.expanded;return n.announcement=`${o.title??""} moved to ${a.name??""}, position ${d+1} of ${a.cards.length}`,this.#g({type:"move",card:o.id,from:i.id,to:a.id,index:d}),this.#N(o.id),!0}moveColumn(e,t){let r=this.#e;if(!r||this.readonly)return!1;let n=r.columns.findIndex((s)=>y(s.id,e));if(n<0)return!1;let[i]=r.columns.splice(n,1),a=Math.max(0,Math.min(r.columns.length,t));if(r.columns.splice(a,0,i),n===a)return!1;return r.announcement=`${i.name??""} moved to position ${a+1} of ${r.columns.length}`,this.#g({type:"reorder",column:i.id,index:a}),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=A(e),a=i.findIndex((l)=>y(l.id,t));if(!n||this.readonly||a<0)return!1;let s=Math.max(0,Math.min(i.length-1,r));if(a===s)return!1;let[o]=i.splice(a,1);return i.splice(s,0,o),n.announcement=`${o.title??""} moved to position ${s+1} of ${i.length}`,this.#g({type:"subtask",card:e.id,subtask:o.id,op:"move",index:s}),requestAnimationFrame(()=>this.querySelector(`[data-subtask="${CSS.escape(String(o.id))}"] .b3-board-title`)?.focus()),!0}#C(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,a=()=>({height:n.visualViewport?.height??n.innerHeight,scale:n.visualViewport?.scale??1}),s=a(),o=()=>{if(!e.isConnected||this.ownerDocument.activeElement!==e)return i.abort();let l=a(),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",o,{signal:i.signal});e.addEventListener("blur",()=>i.abort(),{signal:i.signal,once:!0})}#T(){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()}))}#x(e){e.focus({preventScroll:!0}),e.scrollIntoView({block:"nearest",inline:"nearest"})}#O(e,t){let r=this.#e,n=e.currentTarget,i=(c)=>[...c.querySelectorAll(".b3-board-cards > .b3-board-card")],a=n.closest(".b3-board-column"),s=i(a),o=s.indexOf(n),l;switch(e.key){case"ArrowUp":l=s[o-1];break;case"ArrowDown":l=s[o+1];break;case"Home":l=s[0];break;case"End":l=s.at(-1);break;case"ArrowLeft":case"ArrowRight":{let c=[...this.querySelectorAll(".b3-board-column")],d=e.key==="ArrowLeft"!==(getComputedStyle(this).direction==="rtl")?-1:1;for(let u=c.indexOf(a)+d;u>=0&&u<c.length&&!l;u+=d){let f=i(c[u]);l=f[Math.min(o,f.length-1)]}break}case" ":if(e.preventDefault(),!this.hasAttribute("compact")&&r.disclosable(t))r.toggle(t);return;case"Delete":case"Backspace":{if(r.readonly||e.shiftKey)return;e.preventDefault();let c=(s[o+1]??s[o-1])?.dataset.card;n.querySelector(":scope > .b3-board-card-head .b3-board-remove")?.click(),requestAnimationFrame(()=>{if(n.isConnected)return;let d=c!==void 0&&this.querySelector(`[data-card="${CSS.escape(c)}"]`),u=this.querySelector(`[data-column="${CSS.escape(a.dataset.column??"")}"] .b3-board-column-name`),f=d||u;if(f)this.#x(f)});return}default:return}if(e.preventDefault(),l)this.#x(l)}focusCard(e){let t=(n)=>n!=null&&this.querySelector(`.b3-board-cards > [data-card="${CSS.escape(String(n))}"]`),r=t(e)||t(this.#e?.selected)||this.querySelector(".b3-board-cards > .b3-board-card");if(!r)return!1;return this.#x(r),!0}shortcuts=[];showShortcuts(e=!0){let t=this.#t;if(!t)return!1;let r=t.querySelector(":scope > .b3-board-keys");if(!e){if(r)this.focusCard(),r.remove();return!0}if(r)return!0;let n=/Mac|iP(hone|ad|od)/.test(this.ownerDocument.defaultView?.navigator.platform??""),i=n?"⌥":"Alt+",a=n?"⌘":"Ctrl+",s=[["↑ ↓","Previous / next card"],["← →","Card in the next column"],["Home End","First / last card"],["Space","Expand / collapse"],["Enter","Edit the title"],...this.readonly?[]:[[`${i}↑ ${i}↓`,"Move the card up / down"],[`${i}← ${i}→`,"Move the card to the next column"],["Tab ⇧Tab","Editing: title ⇄ details"],["Delete","Delete the card (press twice)"],[`${a}Z ${n?"⇧⌘Z":"Ctrl+Y"}`,"Undo / redo"]],...this.shortcuts,["Esc","Cancel / close"],["?","This list"]];r=this.ownerDocument.createElement("div"),r.className="b3-board-keys",r.tabIndex=-1,r.setAttribute("role","dialog"),r.setAttribute("aria-label","Keyboard shortcuts");let o=this.ownerDocument.createElement("dl");for(let[l,c]of s){let d=this.ownerDocument.createElement("div"),u=this.ownerDocument.createElement("dt"),f=this.ownerDocument.createElement("dd");for(let b of l.split(" ")){let m=this.ownerDocument.createElement("kbd");m.textContent=b,u.append(m)}f.textContent=c,d.append(u,f),o.append(d)}return r.append(o),r.addEventListener("keydown",(l)=>{if(l.key!=="Escape"&&l.key!=="?")return;l.preventDefault(),l.stopPropagation(),this.showShortcuts(!1)}),r.addEventListener("focusout",(l)=>{if(!r.contains(l.relatedTarget))queueMicrotask(()=>r.remove())}),t.append(r),r.focus({preventScroll:!0}),!0}#M(){let e=this.ownerDocument.activeElement;if(!e?.matches(".b3-board-card")||!this.contains(e))return null;let t=e.closest(".b3-board-column");return{id:e.dataset.card,column:t.dataset.column,index:[...t.querySelectorAll(".b3-board-cards > .b3-board-card")].indexOf(e)}}#z(e){requestAnimationFrame(()=>{let t=this.ownerDocument.activeElement;if(t&&t!==this.ownerDocument.body&&t.isConnected)return;let r=[...this.querySelectorAll(`[data-column="${CSS.escape(e.column)}"] .b3-board-cards > .b3-board-card`)];(this.querySelector(`[data-card="${CSS.escape(e.id)}"]`)??r[Math.min(e.index,r.length-1)])?.focus({preventScroll:!0})})}#I(e,t,r){e.style.setProperty("--b3-board-bump",String(t)),e.removeAttribute("data-b3-bump"),e.offsetWidth,e.setAttribute("data-b3-bump",""),e.addEventListener("animationend",()=>e.removeAttribute("data-b3-bump"),{once:!0}),this.#a(r)}#D(){let e=this.ownerDocument,t=e.activeElement;if(!this.#L||!this.#e?.selected||t&&t!==e.body&&t!==e.documentElement)return;this.focusCard(this.#e.selected)}#N(e){requestAnimationFrame(()=>this.querySelector(`[data-card="${CSS.escape(String(e))}"]`)?.focus({preventScroll:!1}))}#B(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})})}#L=!1;#U(){this.#c?.abort(),this.#c=new AbortController;let e=this.#c.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",(a)=>this.#F(a),{signal:e}),t.addEventListener("pointermove",(a)=>this.#K(a),{signal:e}),t.addEventListener("pointerup",(a)=>this.#V(a),{signal:e}),t.addEventListener("pointercancel",(a)=>{if(a.pointerId===this.#r?.pointerId)this.#b()},{signal:e}),t.addEventListener("keydown",(a)=>{if(a.key==="Escape"&&this.#r?.started)a.preventDefault(),this.#b()},{signal:e}),this.addEventListener("touchmove",(a)=>{if(this.#r?.started)a.preventDefault()},{signal:e,passive:!1}),this.addEventListener("contextmenu",(a)=>{if(this.#r)a.preventDefault()},{signal:e}),this.addEventListener("focusin",(a)=>{let s=a.target,o=s.parentElement;if(!o?.matches(".b3-board-filters"))return;o.style.scrollPaddingInlineEnd=`${o.querySelector(":scope > .b3-board-search")?.offsetWidth??0}px`,s.scrollIntoView({inline:"nearest",block:"nearest"})},{signal:e}),this.addEventListener("focusin",(a)=>{this.#L=!0;let s=a.target.closest?.(".b3-board-card");if(s&&this.#e&&this.contains(s))this.#e.selected=s.dataset.card??null},{signal:e}),this.addEventListener("focusout",(a)=>{let s=a.relatedTarget;if(s&&!this.contains(s)){this.#L=!1;return}if(!s)requestAnimationFrame(()=>requestAnimationFrame(()=>this.#D()))},{signal:e}),t.addEventListener("focus",()=>queueMicrotask(()=>this.#D()),{signal:e}),this.addEventListener("click",(a)=>{if(!this.#y)return;this.#y=!1,a.preventDefault(),a.stopImmediatePropagation()},{signal:e,capture:!0}),this.addEventListener("keydown",(a)=>{if(a.key!=="?"||a.defaultPrevented||a.metaKey||a.ctrlKey||a.altKey||a.isComposing)return;if(a.target.closest?.('input, textarea, select, [contenteditable]:not([contenteditable="false"]), .b3-board-keys'))return;a.preventDefault(),this.showShortcuts()},{signal:e}),this.addEventListener("keydown",(a)=>{if(a.defaultPrevented||a.altKey||!(a.metaKey||a.ctrlKey))return;if(a.target.closest?.('input, textarea, select, [contenteditable]:not([contenteditable="false"])'))return;let s=a.key.toLowerCase(),o=s==="y"||s==="z"&&a.shiftKey;if(s!=="z"&&s!=="y")return;if(a.preventDefault(),o)this.redo();else this.undo()},{signal:e});let n=(a)=>this.#q(a);this.addEventListener("click",n,{signal:e,capture:!0}),this.addEventListener("auxclick",(a)=>{if(a.button===1)n(a)},{signal:e,capture:!0});let i=()=>this.#P();this.addEventListener("compositionstart",()=>{this.#m=!0},{signal:e}),this.addEventListener("compositionend",i,{signal:e}),this.addEventListener("focusout",i,{signal:e})}#P(){this.#m=!1;for(let e of this.#A.splice(0))e()}#q(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)=>y(c.id,r("[data-column]")?.dataset.column)),i=n?.cards.find((c)=>y(c.id,r("[data-card]")?.dataset.card)),a=i&&A(i).find((c)=>y(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(a)s.subtask=a.id;let o=t.querySelector("img");if(o&&!s.newTab&&e.type==="click"){e.preventDefault(),this.#j(t,o,s);return}if(!t.dispatchEvent(new CustomEvent("b3-link",{bubbles:!0,cancelable:!0,detail:s}))||s.file)e.preventDefault()}#j(e,t,r){let n=this.ownerDocument;n.body.querySelector(":scope > .b3-board-lightbox")?.dispatchEvent(new CustomEvent("b3-close")),sr();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 a=n.createElement("img");a.src=t.currentSrc||t.src,a.alt=t.alt;let s=n.createElement("button");s.type="button",s.className="b3-board-lightbox-open",s.textContent="Open",i.append(a,s);let o=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 o?.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})}#F(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"),a=!i&&t.closest(".b3-board-column-header")?t.closest(".b3-board-column"):null,s=i??a;if(!s)return;n={kind:i?"card":"column",id:i?i.dataset.card:a.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.#$(e.clientX,e.clientY)},ha)}#$(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 a=()=>{if(this.#r!==r)return;this.#Y(r.px,r.py),this.#W(this.#R(r.px,r.py)),r.frame=requestAnimationFrame(a)};r.frame=requestAnimationFrame(a)}#K(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.#b();return}if(r<5)return;this.#$(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}#V(e){let t=this.#r;if(!t||e.pointerId!==t.pointerId)return;if(!t.started)return this.#b();let r=this.#R(e.clientX,e.clientY);if(this.#b(),this.#y=!0,setTimeout(()=>{this.#y=!1},0),!r)return;let n=this.#e;if(t.kind==="card"){let i=n.columns.find((l)=>y(l.id,r.column)),a=n.columns.find((l)=>l.cards.some((c)=>y(c.id,t.id))),s=r.before?i.cards.findIndex((l)=>y(l.id,r.before)):i.cards.length,o=a.cards.findIndex((l)=>y(l.id,t.id));if(a===i&&o<s)s-=1;this.moveCard(t.id,i.id,s)}else if(t.kind==="subtask"){let i=this.#o(t.card);if(!i)return;let a=A(i),s=r.before?a.findIndex((o)=>y(o.id,r.before)):a.length;if(a.findIndex((o)=>y(o.id,t.id))<s)s-=1;this.#f(i,t.id,s)}else{let i=r.before?n.columns.findIndex((s)=>y(s.id,r.before)):n.columns.length;if(n.columns.findIndex((s)=>y(s.id,t.id))<i)i-=1;this.moveColumn(t.id,i)}}#R(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.#H(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}),f=(b)=>!!(b!=null&&this.#o(b)?.starred);if(f(u?.dataset.card)!==f(r.id)&&(u||f(r.id)))u=d.find((b)=>!f(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 f=u.getBoundingClientRect();return t<f.top+f.height/2})?.dataset.subtask??null,list:l}}let i=this.querySelector(".b3-board-columns"),a=[...i.querySelectorAll(":scope > .b3-board-column:not([data-b3-dragging])")],s=getComputedStyle(this).direction==="rtl";return{column:"",before:a.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}}#W(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")}#H(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})}#Y(e,t){let r=(s,o,l)=>s<o+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.#H(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 a=this.ownerDocument.defaultView;a.scrollBy(0,r(t,0,a.innerHeight))}#b(){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")}}hr("b3-board",hi);export{hi as B3Board};
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.1.0-alpha.92",
2
+ "version": "0.1.0-alpha.93",
3
3
  "cssSha256": "3b9a615b1efe3f2b63524bac154c1da07a0f14ca67073f906a7085a9a2196e9a",
4
4
  "classes": [
5
5
  "b3-accordion",
@@ -70,14 +70,19 @@ typed, and a `b3-change` listener receives `CustomEvent<BoardChangeDetail>` (`b3
70
70
  Space opens/closes a card, Enter edits its title, Delete (or Backspace) presses its delete button (the
71
71
  two-press confirm applies; focus moves to the neighbour). Alt+Up/Down moves a card within its column,
72
72
  Alt+Left/Right to the neighbouring column; Alt+Left/Right on a column name moves the column. Alt+Up/Down
73
- on a subtask reorders it; a subtask also drags by its grip, within its card. Moves are announced. `?`
73
+ on a subtask reorders it; a subtask also drags by its grip, within its card. Moves are announced; a move
74
+ with nowhere to go (a starred card stays above the rest) nudges the card and says why. `?`
74
75
  shows a shortcut sheet (`board.showShortcuts()`; append host keys with `board.shortcuts = [['N', 'New
75
- card']]`). Keys typed in a field are the field's. A `columns` write keeps the focused card focused (or
76
- the one now in its place). `board.focusCard(id?)` gives a host's arrow keys a start when nothing has focus.
76
+ card']]`). Keys typed in a field are the field's. The focused (clicked or arrowed-to) card is the
77
+ **selected** one — a solid ring inside its border that stays while focus is elsewhere; focus that drops
78
+ to the page (a re-render, a closed sheet, the page getting the keyboard back) returns to it. A `columns`
79
+ write keeps the focused card focused (or the one now in its place). `board.focusCard(id?)` focuses that
80
+ card, else the selected one, else the first — where a host's arrows start or its menu hands the keyboard back.
77
81
  - **Edit**: activating a title, column name, description or subtask edits it in place. Enter
78
82
  commits (Shift+Enter is a new line in a description), Escape cancels, leaving the field commits.
79
83
  An empty title is refused; an empty subtask is removed. Enter on a new card's title goes on to its
80
- description (not under `compact`); Enter on a new subtask opens the next one. Starting an edit commits
84
+ description (not under `compact`); Tab in a title editor goes on to the card's description, Shift+Tab back
85
+ (not under `compact`); Enter on a new subtask opens the next one. Starting an edit commits
81
86
  any other open one. A new editor is focused and scrolled into view (its whole card, in the column's
82
87
  scroller and the columns row); on touch the keyboard opens within the tap, and editors use 16px text
83
88
  so iOS does not zoom. While an editor keeps focus, a viewport that gets shorter at the same zoom (the keyboard) brings it back into view — a pinch or a growing viewport leaves the scroll alone — a
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@livx.cc/bare-v3",
3
- "version": "0.1.0-alpha.92",
3
+ "version": "0.1.0-alpha.93",
4
4
  "type": "module",
5
5
  "thirdPartyNotices": "./dist/third-party.json",
6
6
  "files": [