@livx.cc/bare-v3 0.1.0-alpha.147 → 0.1.0-alpha.149

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.
@@ -6,7 +6,7 @@
6
6
  * detail carries the full, plain `columns` after every user edit plus the `action` that made it.
7
7
  * `#tag` and `@mention` words in a title or description become filter labels; a trailing run of
8
8
  * them is shown as labels instead of title text. `search` narrows the cards to those whose text (comments included) holds every word typed;
9
- * `addCard()` starts a new card in the `default-column`. Starred cards stay above the rest of their column. Opt-in entry: `@livx.cc/bare-v3/components/board`.
9
+ * `addCard()` starts a new card in the `default-column`, at its end — or on top (under any starred cards) in a `top-columns` column (comma-separated names/ids). Starred cards stay above the rest of their column. Opt-in entry: `@livx.cc/bare-v3/components/board`.
10
10
  */
11
11
  import { Base } from './base';
12
12
  /** Ids are kept as given (a number stays a number); missing ones are generated as strings. */
@@ -175,8 +175,12 @@ export declare class B3Board extends Base {
175
175
  /** The column `addCard()` adds to when given none (`default-column`): an id, or a name (case-insensitive); else the first. */
176
176
  get defaultColumn(): string;
177
177
  set defaultColumn(value: string);
178
+ /** Columns whose new cards go on top (`top-columns`): comma-separated ids or names (case-insensitive). */
179
+ get topColumns(): string;
180
+ set topColumns(value: string);
181
+ /** @internal */ onTop(column: BoardColumn): boolean;
178
182
  /**
179
- * Start a new card, its title editor focused and in view, at the end of `column` (an id or name) or the default
183
+ * Start a new card, its title editor focused and in view, at the end (or top, `top-columns`) of `column` (an id or name) or the default
180
184
  * column. Reported by `b3-change` once it has a title. False when readonly or there is no such column.
181
185
  */
182
186
  addCard(column?: BoardId): boolean;
@@ -1,10 +1,10 @@
1
- var{defineProperty:ct,getOwnPropertyNames:xi,getOwnPropertyDescriptor:vi}=Object,wi=Object.prototype.hasOwnProperty;function _i(e){return this[e]}var Ei=(e)=>{var t=(br??=new WeakMap).get(e),r;if(t)return t;if(t=ct({},"__esModule",{value:!0}),e&&typeof e==="object"||typeof e==="function"){for(var n of xi(e))if(!wi.call(t,n))ct(t,n,{get:_i.bind(e,n),enumerable:!(r=vi(e,n))||r.enumerable})}return br.set(e,t),t},br;var ki=(e)=>e;function Si(e,t){this[e]=ki.bind(null,t)}var Ai=(e,t)=>{for(var r in t)ct(e,r,{get:t[r],enumerable:!0,configurable:!0,set:Si.bind(t,r)})};var Ci=(e,t)=>()=>(e&&(t=e(e=0)),t);var Xn={};Ai(Xn,{Alpine:()=>Gn,default:()=>oa});function Oi(e){Ii(e)}function Mi(){Rt=!0}function Li(){Rt=!1,Mr()}function Ii(e){if(!z.includes(e)){if(z.push(e),e._x_schedulerPriority!==void 0)qe=!0}Mr()}function Ht(e){let t=z.indexOf(e);if(t!==-1&&t>vt)z.splice(t,1)}function Mr(){if(!xt&&!yt){if(Rt)return;yt=!0,queueMicrotask(Di)}}function Di(){yt=!1,xt=!0;for(let e=0;e<z.length;e++){if(qe)Ni(e);z[e](),vt=e}z.length=0,vt=-1,qe=!1,xt=!1}function Ni(e){let t=new Map,r=z.slice(e).sort((n,i)=>Bi(n,i,t));for(let n=0;n<r.length;n++)z[e+n]=r[n];qe=!1}function Bi(e,t,r){if(!dt(e))return dt(t)?1:0;if(!dt(t))return-1;return gr(e._x_schedulerPriority.el,r)-gr(t._x_schedulerPriority.el,r)||e._x_schedulerPriority.order-t._x_schedulerPriority.order}function dt(e){return e._x_schedulerPriority!==void 0}function gr(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 $i(e){wt=!1,e(),wt=!0}function Ri(e){ue=e.reactive,fe=e.release,oe=(t)=>e.effect(t,{scheduler:(r)=>{if(wt)Oi(r);else r()}}),Lr=e.raw}function yr(e){oe=e}function Hi(e){let t=()=>{};return[(n,i)=>{let a=i?.priority==="structural"?Pi++:void 0,s=oe(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),fe(s)},s},()=>{t()}]}function Ir(e,t){let r=!0,n,i,a=oe(()=>{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()=>{Ht(a),fe(a)}}async function zi(e){Mi();try{await e(),await Promise.resolve()}finally{Li()}}function Ui(e){Br.push(e)}function zt(e,t){if(typeof t==="function"){if(!e._x_cleanups)e._x_cleanups=[];e._x_cleanups.push(t)}else t=e,Nr.push(t)}function Pr(e){Dr.push(e)}function $r(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 Rr(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 qi(e){e._x_effects?.forEach(Ht);while(e._x_cleanups?.length)e._x_cleanups.pop()()}function qt(){Je.observe(document,{subtree:!0,childList:!0,attributes:!0,attributeOldValue:!0}),Ut=!0}function Hr(){ji(),Je.disconnect(),Ut=!1}function ji(){let e=Je.takeRecords();Y.push(()=>e.length>0&&Ge(e));let t=Y.length;queueMicrotask(()=>{if(Y.length===t)while(Y.length>0)Y.shift()()})}function Fi(){while(Y.length>0)Y.shift()();let e=Je.takeRecords();if(e.length>0)Ge(e)}function _(e){if(!Ut)return e();Hr();try{return e()}finally{qt()}}function Ki(){jt=!0}function Vi(){jt=!1,Ge(je),je=[]}function Ge(e){if(jt){je=je.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)=>{Rr(s,a)}),n.forEach((a,s)=>{Dr.forEach((o)=>o(s,a))});for(let a of r){if(t.some((s)=>s.contains(a)))continue;Nr.forEach((s)=>s(a))}for(let a of t){if(!a.isConnected)continue;Br.forEach((s)=>s(a))}t=null,r=null,n=null,i=null}function zr(e){return ee(de(e))}function Oe(e,t,r){return e._x_dataStack=[t,...de(r||e)],()=>{e._x_dataStack=e._x_dataStack.filter((n)=>n!==t)}}function de(e){if(e._x_dataStack)return e._x_dataStack;if(typeof ShadowRoot==="function"&&e instanceof ShadowRoot)return de(e.host);if(!e.parentNode)return[];return de(e.parentNode)}function ee(e){return new Proxy({objects:e},Wi)}function Ur(e,t){if(e===null||e===Object.prototype)return null;if(Object.prototype.hasOwnProperty.call(e,t))return e;return Ur(Object.getPrototypeOf(e),t)}function Yi(){return Reflect.ownKeys(this).reduce((t,r)=>(t[r]=Reflect.get(this,r),t),{})}function Ft(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 qr(e,t=()=>{}){let r={initialValue:void 0,_x_interceptor:!0,initialize(n,i,a,s){return e(this.initialValue,()=>Ji(n,i),(o)=>_t(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 Ji(e,t){return t.split(".").reduce((r,n)=>r[n],e)}function _t(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 _t(e[t[0]],t.slice(1),r);else return e[t[0]]={},_t(e[t[0]],t.slice(1),r)}function D(e,t){jr[e]=t}function Fe(e,t){let r=Gi(t);return Object.entries(jr).forEach(([n,i])=>{Object.defineProperty(e,`$${n}`,{get(){return i(t,r)},enumerable:!1})}),e}function Gi(e){let[t,r]=Gr(e),n={interceptor:qr,...t};return zt(e,r),n}function Xi(e,t,r,...n){try{return r(...n)}catch(i){Xe(i,e,t)}}function Xe(...e){return Fr(...e)}function Zi(e){Fr=e}function Qi(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:ct,getOwnPropertyNames:xi,getOwnPropertyDescriptor:vi}=Object,wi=Object.prototype.hasOwnProperty;function Ei(e){return this[e]}var _i=(e)=>{var t=(pr??=new WeakMap).get(e),r;if(t)return t;if(t=ct({},"__esModule",{value:!0}),e&&typeof e==="object"||typeof e==="function"){for(var n of xi(e))if(!wi.call(t,n))ct(t,n,{get:Ei.bind(e,n),enumerable:!(r=vi(e,n))||r.enumerable})}return pr.set(e,t),t},pr;var ki=(e)=>e;function Si(e,t){this[e]=ki.bind(null,t)}var Ai=(e,t)=>{for(var r in t)ct(e,r,{get:t[r],enumerable:!0,configurable:!0,set:Si.bind(t,r)})};var Ci=(e,t)=>()=>(e&&(t=e(e=0)),t);var Xn={};Ai(Xn,{Alpine:()=>Gn,default:()=>oa});function Mi(e){Ii(e)}function Oi(){Rt=!0}function Li(){Rt=!1,Or()}function Ii(e){if(!z.includes(e)){if(z.push(e),e._x_schedulerPriority!==void 0)qe=!0}Or()}function Ht(e){let t=z.indexOf(e);if(t!==-1&&t>vt)z.splice(t,1)}function Or(){if(!xt&&!yt){if(Rt)return;yt=!0,queueMicrotask(Di)}}function Di(){yt=!1,xt=!0;for(let e=0;e<z.length;e++){if(qe)Bi(e);z[e](),vt=e}z.length=0,vt=-1,qe=!1,xt=!1}function Bi(e){let t=new Map,r=z.slice(e).sort((n,i)=>Ni(n,i,t));for(let n=0;n<r.length;n++)z[e+n]=r[n];qe=!1}function Ni(e,t,r){if(!dt(e))return dt(t)?1:0;if(!dt(t))return-1;return gr(e._x_schedulerPriority.el,r)-gr(t._x_schedulerPriority.el,r)||e._x_schedulerPriority.order-t._x_schedulerPriority.order}function dt(e){return e._x_schedulerPriority!==void 0}function gr(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 $i(e){wt=!1,e(),wt=!0}function Ri(e){ue=e.reactive,fe=e.release,oe=(t)=>e.effect(t,{scheduler:(r)=>{if(wt)Mi(r);else r()}}),Lr=e.raw}function yr(e){oe=e}function Hi(e){let t=()=>{};return[(n,i)=>{let a=i?.priority==="structural"?Pi++:void 0,o=oe(n);if(a!==void 0&&o!==void 0)o._x_schedulerPriority={el:e,order:a};if(!e._x_effects)e._x_effects=new Set,e._x_runEffects=()=>{e._x_effects.forEach((s)=>s())};return e._x_effects.add(o),t=()=>{if(o===void 0)return;e._x_effects.delete(o),fe(o)},o},()=>{t()}]}function Ir(e,t){let r=!0,n,i,a=oe(()=>{let o=e(),s=JSON.stringify(o);if(!r){if(typeof o==="object"||o!==n){let l=typeof n==="object"?JSON.parse(i):n;queueMicrotask(()=>{t(o,l)})}}n=o,i=s,r=!1});return()=>{Ht(a),fe(a)}}async function zi(e){Oi();try{await e(),await Promise.resolve()}finally{Li()}}function Ui(e){Nr.push(e)}function zt(e,t){if(typeof t==="function"){if(!e._x_cleanups)e._x_cleanups=[];e._x_cleanups.push(t)}else t=e,Br.push(t)}function Pr(e){Dr.push(e)}function $r(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 Rr(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 qi(e){e._x_effects?.forEach(Ht);while(e._x_cleanups?.length)e._x_cleanups.pop()()}function qt(){Je.observe(document,{subtree:!0,childList:!0,attributes:!0,attributeOldValue:!0}),Ut=!0}function Hr(){ji(),Je.disconnect(),Ut=!1}function ji(){let e=Je.takeRecords();Y.push(()=>e.length>0&&Ge(e));let t=Y.length;queueMicrotask(()=>{if(Y.length===t)while(Y.length>0)Y.shift()()})}function Ki(){while(Y.length>0)Y.shift()();let e=Je.takeRecords();if(e.length>0)Ge(e)}function E(e){if(!Ut)return e();Hr();try{return e()}finally{qt()}}function Fi(){jt=!0}function Vi(){jt=!1,Ge(je),je=[]}function Ge(e){if(jt){je=je.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((o)=>{if(o.nodeType!==1)return;if(!o._x_marker)return;r.add(o)}),e[a].addedNodes.forEach((o)=>{if(o.nodeType!==1)return;if(r.has(o)){r.delete(o);return}if(o._x_marker)return;t.push(o)});if(e[a].type==="attributes"){let o=e[a].target,s=e[a].attributeName,l=e[a].oldValue,c=()=>{if(!n.has(o))n.set(o,[]);n.get(o).push({name:s,value:o.getAttribute(s)})},d=()=>{if(!i.has(o))i.set(o,[]);i.get(o).push(s)};if(o.hasAttribute(s)&&l===null)c();else if(o.hasAttribute(s))d(),c();else d()}}i.forEach((a,o)=>{Rr(o,a)}),n.forEach((a,o)=>{Dr.forEach((s)=>s(o,a))});for(let a of r){if(t.some((o)=>o.contains(a)))continue;Br.forEach((o)=>o(a))}for(let a of t){if(!a.isConnected)continue;Nr.forEach((o)=>o(a))}t=null,r=null,n=null,i=null}function zr(e){return ee(de(e))}function Me(e,t,r){return e._x_dataStack=[t,...de(r||e)],()=>{e._x_dataStack=e._x_dataStack.filter((n)=>n!==t)}}function de(e){if(e._x_dataStack)return e._x_dataStack;if(typeof ShadowRoot==="function"&&e instanceof ShadowRoot)return de(e.host);if(!e.parentNode)return[];return de(e.parentNode)}function ee(e){return new Proxy({objects:e},Wi)}function Ur(e,t){if(e===null||e===Object.prototype)return null;if(Object.prototype.hasOwnProperty.call(e,t))return e;return Ur(Object.getPrototypeOf(e),t)}function Yi(){return Reflect.ownKeys(this).reduce((t,r)=>(t[r]=Reflect.get(this,r),t),{})}function Kt(e,t=()=>{}){let r=(i)=>typeof i==="object"&&!Array.isArray(i)&&i!==null,n=(i,a="")=>{Object.entries(Object.getOwnPropertyDescriptors(i)).forEach(([o,{value:s,enumerable:l}])=>{if(l===!1||s===void 0)return;if(typeof s==="object"&&s!==null&&s.__v_skip)return;let c=a===""?o:`${a}.${o}`;if(typeof s==="object"&&s!==null&&s._x_interceptor)i[o]=s.initialize(e,c,o,t);else if(r(s)&&s!==i&&!(s instanceof Element))n(s,c)})};return n(e)}function qr(e,t=()=>{}){let r={initialValue:void 0,_x_interceptor:!0,initialize(n,i,a,o){return e(this.initialValue,()=>Ji(n,i),(s)=>Et(n,i,s),i,a,o)}};return t(r),(n)=>{if(typeof n==="object"&&n!==null&&n._x_interceptor){let i=r.initialize.bind(r);r.initialize=(a,o,s,l)=>{let c=n.initialize(a,o,s,l);return r.initialValue=c,i(a,o,s,l)}}else r.initialValue=n;return r}}function Ji(e,t){return t.split(".").reduce((r,n)=>r[n],e)}function Et(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 Et(e[t[0]],t.slice(1),r);else return e[t[0]]={},Et(e[t[0]],t.slice(1),r)}function D(e,t){jr[e]=t}function Ke(e,t){let r=Gi(t);return Object.entries(jr).forEach(([n,i])=>{Object.defineProperty(e,`$${n}`,{get(){return i(t,r)},enumerable:!1})}),e}function Gi(e){let[t,r]=Gr(e),n={interceptor:qr,...t};return zt(e,r),n}function Xi(e,t,r,...n){try{return r(...n)}catch(i){Xe(i,e,t)}}function Xe(...e){return Kr(...e)}function Zi(e){Kr=e}function Qi(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 Kr(e){let t=X;X=!1;let r=e();return X=t,r}function Z(e,t,r={}){let n;return T(e,t)((i)=>n=i,r),n}function T(...e){return Vr(...e)}function es(e){Vr=e}function ts(e){Wr=e}function rs(e,t){return(r=()=>{},{scope:n={},params:i=[],context:a}={})=>{if(!X){Et(r,t,ee([n,...e]),i);return}let s=t.apply(ee([n,...e]),i);Et(r,s)}}function Et(e,t,r,n,i){if(X&&typeof t==="function"){let a=t.apply(r,n);if(a instanceof Promise)a.then((s)=>Et(e,s,r,n)).catch((s)=>Xe(s,i,t));else e(a)}else if(typeof t==="object"&&t instanceof Promise)t.then((a)=>e(a));else e(t)}function ns(...e){return Wr(...e)}function he(e=""){return Kt+e}function is(e){Kt=e}function E(e,t){return Ke[e]=t,{before(r){if(!Ke[r]){console.warn(String.raw`Cannot find directive \`${r}\`. \`${e}\` will use the default order of execution`);return}let n=G.indexOf(r);G.splice(n>=0?n:G.indexOf("DEFAULT"),0,e)}}}function ss(e){return Object.keys(Ke).includes(e)}function Ze(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=Yr(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(Qr((a,s)=>n[a]=s)).filter(tn).map(ls(n,r)).sort(cs).map((a)=>as(e,a))}function Yr(e){return Array.from(e).map(Qr()).filter((t)=>!tn(t))}function os(e){kt=!0;let t=Symbol();Jr=t,ye.set(t,[]);let r=()=>{while(ye.get(t).length)ye.get(t).shift()();ye.delete(t)},n=()=>{kt=!1,r()};e(r),n()}function Gr(e){let t=[],r=(o)=>t.push(o),[n,i]=Hi(e);return t.push(i),[{Alpine:be,effect:n,cleanup:r,evaluateLater:T.bind(T,e),evaluate:Z.bind(Z,e)},()=>t.forEach((o)=>o())]}function as(e,t){let r=()=>{},n=Ke[t.type]||r,[i,a]=Gr(e);$r(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),kt?ye.get(Jr).push(n):n()};return s.runCleanups=a,s}function Qr(e=()=>{}){return({name:t,value:r})=>{let{name:n,value:i}=en.reduce((a,s)=>s(a),{name:t,value:r});if(n!==t)e(n,t);return{name:n,value:i}}}function Vt(e){en.push(e)}function tn({name:e}){return rn().test(e)}function ls(e,t){return({name:r,value:n})=>{if(r===n)n="";let i=r.match(rn()),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 cs(e,t){let r=G.indexOf(e.type)===-1?St:e.type,n=G.indexOf(t.type)===-1?St:t.type;return G.indexOf(r)-G.indexOf(n)}function te(e,t){if(typeof ShadowRoot==="function"&&e instanceof ShadowRoot){Array.from(e.children).forEach((i)=>te(i,t));return}let r=!1;if(t(e,()=>r=!0),r)return;let n=e.firstElementChild;while(n)te(n,t,!1),n=n.nextElementSibling}function U(e,t=()=>{}){return(...r)=>K?t(...r):e(...r)}function ds(e){return(...t)=>K&&e(...t)}function Me(e){nn.push(e)}function us(e,t){nn.forEach((r)=>r(e,t)),K=!0,sn(()=>{P(t,(r,n)=>{n(r,()=>{})})}),K=!1}function fs(e,t){if(!t._x_dataStack)t._x_dataStack=e._x_dataStack;K=!0,At=!0,sn(()=>{hs(t)}),K=!1,At=!1}function hs(e){let t=!1;P(e,(n,i)=>{te(n,(a,s)=>{if(t&&xs(a))return s();t=!0,i(a,s)})})}function sn(e){let t=oe;yr((r,n)=>{let i=t(r);return fe(i),()=>{}}),e(),yr(t)}function bs(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;Qe++}r.pending++,Promise.resolve(t).catch((n)=>{try{Xe(n,e)}catch(i){setTimeout(()=>{throw i},0)}}).then(()=>ps(e,r))}function ps(e,t){if(t.pending--,t.pending>0)return;if(Fi(),t.pending>0)return;if(e._x_deferInit!==t)return;if(delete e._x_deferInit,t.ownsIgnore)delete e._x_ignore;if(Qe--,!e.isConnected)return;gs(t),P(e)}function ms(e,t){if(Qe===0)return!1;let r=L(e,(n)=>n._x_deferInit);if(!r)return!1;return on(r._x_deferInit,e,t.map(({name:n})=>n)),!0}function on(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 gs(e){e.queuedAttributes.forEach((t,r)=>{if(!r.isConnected)return;if(!r._x_marker)return;if(r._x_marker!==t.marker)return;let n=L(r,(a)=>a._x_deferInit);if(n){on(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;Ze(r,i).forEach((a)=>a())})}function xe(e,t,r={},n={}){return e.dispatchEvent(new CustomEvent(t,{detail:r,bubbles:!0,composed:!0,cancelable:!0,...n}))}function B(e,...t){console.warn(`Alpine Warning: ${e}`,...t)}function ys(){if(xr)B("Alpine has already been initialized on this page. Calling Alpine.start() more than once can cause problems.");if(xr=!0,!document.body)B("Unable to initialize. Trying to load Alpine before `<body>` is available. Did you forget to add `defer` in Alpine's `<script>` tag?");xe(document,"alpine:init"),xe(document,"alpine:initializing"),qt(),Ui((t)=>P(t,te)),zt((t)=>ae(t)),Pr((t,r)=>{if(ms(t,r))return;Ze(t,r).forEach((n)=>n())});let e=(t)=>!et(t.parentElement,!0);Array.from(document.querySelectorAll(cn().join(","))).filter(e).forEach((t)=>{P(t)}),xe(document,"alpine:initialized"),setTimeout(()=>{_s()})}function ln(){return Wt.map((e)=>e())}function cn(){return Wt.concat(an).map((e)=>e())}function dn(e){Wt.push(e)}function un(e){an.push(e)}function et(e,t=!1){return L(e,(r)=>{if((t?cn():ln()).some((i)=>r.matches(i)))return!0})}function L(e,t){if(!e)return;if(t(e))return e;if(e._x_teleportBack)return L(e._x_teleportBack,t);if(e.parentNode instanceof ShadowRoot)return L(e.parentNode.host,t);if(!e.parentElement)return;return L(e.parentElement,t)}function xs(e){return ln().some((t)=>e.matches(t))}function vs(e){fn.push(e)}function P(e,t=te,r=()=>{}){if(L(e,(n)=>n._x_ignore))return;os(()=>{t(e,(n,i)=>{if(n._x_marker)return;if(r(n,i),fn.forEach((a)=>a(n,i)),Ze(n,n.attributes).forEach((a)=>a()),!n._x_ignore)n._x_marker=ws++;n._x_ignore&&i()})})}function ae(e,t=te){t(e,(r)=>{qi(r),Rr(r),delete r._x_marker})}function _s(){[["ui","dialog",["[x-dialog], [x-popover]"]],["anchor","anchor",["[x-anchor]"]],["sort","sort",["[x-sort]"]]].forEach(([t,r,n])=>{if(ss(r))return;n.some((i)=>{if(document.querySelector(i))return B(`found "${i}", but missing ${t} plugin`),!0})})}function Jt(e=()=>{}){return queueMicrotask(()=>{Yt||setTimeout(()=>{Tt()})}),new Promise((t)=>{Ct.push(()=>{e(),t()})})}function Tt(){Yt=!1;while(Ct.length)Ct.shift()()}function Es(){Yt=!0}function Gt(e,t){if(Array.isArray(t))return vr(e,t.join(" "));else if(typeof t==="object"&&t!==null)return ks(e,t);else if(typeof t==="function")return Gt(e,t());return vr(e,t)}function Ot(e){return e.split(/\s/).filter(Boolean)}function vr(e,t){let r=(i)=>Ot(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 ks(e,t){let r=Object.entries(t).flatMap(([s,o])=>o?Ot(s):!1).filter(Boolean),n=Object.entries(t).flatMap(([s,o])=>!o?Ot(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 tt(e,t){if(typeof t==="object"&&t!==null)return Ss(e,t);return As(e,t)}function Ss(e,t){let r={};return Object.entries(t).forEach(([n,i])=>{if(r[n]=e.style[n],!n.startsWith("--"))n=Cs(n);e.style.setProperty(n,i)}),setTimeout(()=>{if(e.style.length===0)e.removeAttribute("style")}),()=>{tt(e,r)}}function As(e,t){let r=e.getAttribute("style",t);return e.setAttribute("style",t),()=>{e.setAttribute("style",r||"")}}function Cs(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function Mt(e,t=()=>{}){let r=!1;return function(){if(!r)r=!0,e.apply(this,arguments);else t.apply(this,arguments)}}function Ts(e,t,r){hn(e,Gt,""),{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 Os(e,t,r){hn(e,tt);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((g,S)=>S<t.indexOf("out"));if(t.includes("out")&&!n)t=t.filter((g,S)=>S>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?me(t,"scale",95)/100:1,u=me(t,"delay",0)/1000,f=me(t,"origin","center"),b="opacity, transform",p=me(t,"duration",150)/1000,h=me(t,"duration",75)/1000,m="cubic-bezier(0.4, 0.0, 0.2, 1)";if(i)e._x_transition.enter.during={transformOrigin:f,transitionDelay:`${u}s`,transitionProperty:b,transitionDuration:`${p}s`,transitionTimingFunction:m},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:`${h}s`,transitionTimingFunction:m},e._x_transition.leave.start={opacity:1,transform:"scale(1)"},e._x_transition.leave.end={opacity:c,transform:`scale(${d})`}}function hn(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=()=>{}){Lt(e,t,{during:this.enter.during,start:this.enter.start,end:this.enter.end},n,i)},out(n=()=>{},i=()=>{}){Lt(e,t,{during:this.leave.during,start:this.leave.start,end:this.leave.end},n,i)}}}function bn(e){let t=e.parentNode;if(!t)return;return t._x_hidePromise?t:bn(t)}function Lt(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;Ms(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 Ms(e,t){let r,n,i,a=Mt(()=>{_(()=>{if(r=!0,!n)t.before();if(!i)t.end(),Tt();if(t.after(),e.isConnected)t.cleanup();delete e._x_transitioning})});e._x_transitioning={beforeCancels:[],beforeCancel(s){this.beforeCancels.push(s)},cancel:Mt(function(){while(this.beforeCancels.length)this.beforeCancels.shift()();a()}),finish:a},_(()=>{t.start(),t.during()}),Es(),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()}),Tt(),setTimeout(e._x_transitioning.finish,s+o),i=!0})})}function me(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 pn(e,t,r,n=[]){if(!e._x_bindings)e._x_bindings=ue({});switch(e._x_bindings[t]=r,t=n.includes("camel")?Rs(t):t,t){case"value":Ls(e,r);break;case"style":Ds(e,r);break;case"class":Is(e,r);break;case"selected":case"checked":Ns(e,t,r);break;default:Xt(e,t,r);break}}function Ls(e,t){if(Zt(e)){if(e.attributes.value===void 0)e.value=t}else if(Ve(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)=>Hs(r,e.value));else e.checked=!!t;else if(e.tagName==="SELECT")$s(e,t);else if(e.tagName==="OPTION")Xt(e,"value",t);else{if(e.value===t&&(typeof t!=="object"||t===null))return;e.value=t===void 0?"":t}}function Is(e,t){if(e._x_undoAddedClasses)e._x_undoAddedClasses();e._x_undoAddedClasses=Gt(e,t)}function Ds(e,t){if(e._x_undoAddedStyles)e._x_undoAddedStyles();e._x_undoAddedStyles=tt(e,t)}function Ns(e,t,r){Xt(e,t,r),Ps(e,t,r)}function Xt(e,t,r){if([null,void 0,!1].includes(r)&&Us(t))e.removeAttribute(t);else{if(mn(t))r=t;if(qs(r))r=JSON.stringify(r);Bs(e,t,r)}}function Bs(e,t,r){if(e.getAttribute(t)!=r)e.setAttribute(t,r)}function Ps(e,t,r){if(e[t]!==r)e[t]=r}function $s(e,t){let r=[].concat(t).map((n)=>n+"");Array.from(e.options).forEach((n)=>{n.selected=r.includes(n.value)})}function Rs(e){return e.toLowerCase().replace(/-(\w)/g,(t,r)=>r.toUpperCase())}function Hs(e,t){return e==t}function Ue(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 mn(e){return zs.has(e)}function Us(e){return!["aria-pressed","aria-checked","aria-expanded","aria-selected"].includes(e)}function qs(e){return typeof e==="object"&&e!==null}function js(e,t,r){if(e._x_bindings&&e._x_bindings[t]!==void 0)return e._x_bindings[t];return gn(e,t,r)}function Fs(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,Kr(()=>Z(e,i.expression))}return gn(e,t,r)}function gn(e,t,r){let n=e.getAttribute(t);if(n===null)return typeof r==="function"?r():r;if(n==="")return!0;if(mn(t))return!![t,"true"].includes(n);return n}function Ve(e){return e.type==="checkbox"||e.localName==="ui-checkbox"||e.localName==="ui-switch"}function Zt(e){return e.type==="radio"||e.localName==="ui-radio"}function yn(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 xn(e,t){let r;return function(){let n=this,i=arguments;if(!r)e.apply(n,i),r=!0,setTimeout(()=>r=!1,t)}}function vn({get:e,set:t},{get:r,set:n}){let i=!0,a,s,o=oe(()=>{let l=e(),c=r();if(i)n(ut(l)),i=!1;else{let d=JSON.stringify(l),u=JSON.stringify(c);if(d!==a)n(ut(l));else if(d!==u)t(ut(c))}a=JSON.stringify(e()),s=JSON.stringify(r())});return()=>{Ht(o),fe(o)}}function ut(e){return typeof e==="object"?JSON.parse(JSON.stringify(e)):e}function Ks(e){(Array.isArray(e)?e:[e]).forEach((r)=>r(be))}function Vs(e,t){if(!wr)H=ue(H),wr=!0;if(t===void 0)return H[e];if(H[e]=t,typeof t==="object"&&t!==null&&t._x_interceptor)H[e]=t.initialize(H,e,e,()=>{});else Ft(H[e]);if(typeof t==="object"&&t!==null&&t.hasOwnProperty("init")&&typeof t.init==="function")H[e].init()}function Ws(){return H}function Ys(e,t){let r=typeof t!=="function"?()=>t:t;if(e instanceof Element)return _n(e,r());else wn[e]=r;return()=>{}}function Js(e){return Object.entries(wn).forEach(([t,r])=>{Object.defineProperty(e,t,{get(){return(...n)=>r(...n)}})}),e}function _n(e,t,r){let n=[];while(n.length)n.pop()();let i=Object.entries(t).map(([s,o])=>({name:s,value:o})),a=Yr(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}),Ze(e,i,r).map((s)=>{n.push(s.runCleanups),s()}),()=>{while(n.length)n.pop()()}}function Gs(e,t){En[e]=t}function Xs(e,t){return Object.entries(En).forEach(([r,n])=>{Object.defineProperty(e,r,{get(){return(...i)=>n.bind(t)(...i)},enumerable:!1})}),e}function Sn(e){try{let r=new eo(e).tokenize(),i=new to(r).parse(),a=new ro;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 no(e,t,r={}){let n=An(e),i=ee([r.scope??{},...n]),a=r.params??[],o=Sn(t)({scope:i,forceBindingRootScopeToFunctions:!0});if(typeof o==="function"&&X)return o.apply(i,a);return o}function io(e,t){let r=An(e);if(typeof t==="function")return rs(r,t);let n=so(e,t,r);return Xi.bind(null,e,t,n)}function An(e){let t={};return Fe(t,e),[t,...de(e)]}function so(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=ee([i,...r]),l=Sn(t)({scope:s,forceBindingRootScopeToFunctions:!0});if(X&&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 Cn(e){let t=Object.create(null);for(let r of e.split(","))t[r]=1;return(r)=>(r in t)}function re(e,...t){console.warn(`[Vue warn] ${e}`,...t)}function ho(e,t=!1){if(e.flags|=8,t){e.next=_e,_e=e;return}e.next=we,we=e}function er(){Ln++}function tr(){if(--Ln>0)return;if(_e){let t=_e;_e=void 0;while(t){let r=t.next;t.next=void 0,t.flags&=-9,t=r}}let e;while(we){let t=we;we=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 In(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Dn(e){let t,r=e.depsTail,n=r;while(n){let i=n.prevDep;if(n.version===-1){if(n===r)r=i;rr(n),po(n)}else t=n;n.dep.activeLink=n.prevActiveLink,n.prevActiveLink=void 0,n=i}e.deps=t,e.depsTail=r}function Dt(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(bo(t.dep.computed)||t.dep.version!==t.version))return!0;if(e._dirty)return!0;return!1}function bo(e){if(e.flags&4&&!(e.flags&16))return;if(e.flags&=-17,e.globalVersion===We)return;if(e.globalVersion=We,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Dt(e)))return;e.flags|=2;let t=e.dep,r=v,n=I;v=e,I=!0;try{In(e);let i=e.fn(e._value);if(t.version===0||J(i,e._value))e.flags|=128,e._value=i,t.version++}catch(i){throw t.version++,i}finally{v=r,I=n,Dn(e),e.flags&=-3}}function rr(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)rr(a,!0)}}if(!t&&!--r.sc&&r.map)r.map.delete(r.key)}function po(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 mo(e,t){if(e.effect instanceof Er)e=e.effect.fn;let r=new Er(e);if(t)ke(r,t);try{r.run()}catch(i){throw r.stop(),i}let n=r.run.bind(r);return n.effect=r,n}function go(e){e.effect.stop()}function yo(){Nn.push(I),I=!1}function xo(){let e=Nn.pop();I=e===void 0?!0:e}function kr(e){let{cleanup:t}=e;if(e.cleanup=void 0,t){let r=v;v=void 0;try{t()}finally{v=r}}}function Bn(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)Bn(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 M(e,t,r){if(I&&v){let n=Nt.get(e);if(!n)Nt.set(e,n=new Map);let i=n.get(r);if(!i)n.set(r,i=new wo),i.map=n,i.key=r;i.track({target:e,type:t,key:r})}}function F(e,t,r,n,i,a){let s=Nt.get(e);if(!s){We++;return}let o=(l)=>{if(l)l.trigger({target:e,type:t,key:r,newValue:n,oldValue:i,oldTarget:a})};if(er(),t==="clear")s.forEach(o);else{let l=Se(e),c=l&&Qt(r);if(l&&r==="length"){let d=Number(n);s.forEach((u,f)=>{if(f==="length"||f===Ce||!Le(f)&&f>=d)o(u)})}else{if(r!==void 0||s.has(void 0))o(s.get(r));if(c)o(s.get(Ce));switch(t){case"add":if(!l){if(o(s.get(Q)),ve(e))o(s.get(Bt))}else if(c)o(s.get("length"));break;case"delete":if(!l){if(o(s.get(Q)),ve(e))o(s.get(Bt))}break;case"set":if(ve(e))o(s.get(Q));break}}}tr()}function le(e){let t=w(e);if(t===e)return t;return M(t,"iterate",Ce),ie(e)?t:t.map(se)}function nr(e){return M(e=w(e),"iterate",Ce),e}function N(e,t){if(ne(e))return qn(e)?Te(se(t)):Te(t);return se(t)}function bt(e,t,r){let n=nr(e),i=n[t]();if(n!==e&&!ie(e))i._next=i.next,i.next=()=>{let a=i._next();if(!a.done)a.value=r(a.value);return a};return i}function R(e,t,r,n,i,a){let s=nr(e),o=s!==e&&!ie(e),l=s[t];if(l!==Eo[t]){let u=l.apply(e,a);return o?se(u):u}let c=r;if(s!==e){if(o)c=function(u,f){return r.call(this,N(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 Sr(e,t,r,n){let i=nr(e),a=i!==e&&!ie(e),s=r,o=!1;if(i!==e){if(a)o=n.length===0,s=function(c,d,u){if(o)o=!1,c=N(e,c);return r.call(this,c,N(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?N(e,l):l}function pt(e,t,r){let n=w(e);M(n,"iterate",Ce);let i=n[t](...r);if((i===-1||i===!1)&&$o(r[0]))return r[0]=w(r[0]),n[t](...r);return i}function ge(e,t,r=[]){yo(),er();let n=w(e)[t].apply(e,r);return tr(),xo(),n}function So(e){if(!Le(e))e=String(e);let t=w(this);return M(t,"has",e),t.hasOwnProperty(e)}function Mo(e,t,r){return function(...n){let i=this.__v_raw,a=w(i),s=ve(a),o=e==="entries"||e===Symbol.iterator&&s,l=e==="keys"&&s,c=i[e](...n),d=r?Pt:t?Te:se;return!t&&M(a,"iterate",l?Bt:Q),ke(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 He(e){return function(...t){{let r=t[0]?`on key "${t[0]}" `:"";re(`${Mn(e)} operation ${r}failed: target is readonly.`,w(this))}return e==="delete"?!1:e==="clear"?void 0:this}}function Lo(e,t){let r={get(i){let a=this.__v_raw,s=w(a),o=w(i);if(!e){if(J(i,o))M(s,"get",i);M(s,"get",o)}let{has:l}=Re(s),c=t?Pt:e?Te:se;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&&M(w(i),"iterate",Q),i.size},has(i){let a=this.__v_raw,s=w(a),o=w(i);if(!e){if(J(i,o))M(s,"has",i);M(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?Pt:e?Te:se;return!e&&M(l,"iterate",Q),o.forEach((d,u)=>i.call(a,c(d),c(u),s))}};return ke(r,e?{add:He("add"),set:He("set"),delete:He("delete"),clear:He("clear")}:{add(i){let a=w(this),s=Re(a),o=w(i),l=!t&&!ie(i)&&!ne(i)?o:i;if(!(s.has.call(a,l)||J(i,l)&&s.has.call(a,i)||J(o,l)&&s.has.call(a,o)))a.add(l),F(a,"add",l,l);return this},set(i,a){if(!t&&!ie(a)&&!ne(a))a=w(a);let s=w(this),{has:o,get:l}=Re(s),c=o.call(s,i);if(!c)i=w(i),c=o.call(s,i);else Ar(s,o,i);let d=l.call(s,i);if(s.set(i,a),!c)F(s,"add",i,a);else if(J(a,d))F(s,"set",i,a,d);return this},delete(i){let a=w(this),{has:s,get:o}=Re(a),l=s.call(a,i);if(!l)i=w(i),l=s.call(a,i);else Ar(a,s,i);let c=o?o.call(a,i):void 0,d=a.delete(i);if(l)F(a,"delete",i,void 0,c);return d},clear(){let i=w(this),a=i.size!==0,s=ve(i)?new Map(i):new Set(i),o=i.clear();if(a)F(i,"clear",void 0,void 0,s);return o}}),["keys","values","entries",Symbol.iterator].forEach((i)=>{r[i]=Mo(i,e,t)}),r}function Rn(e,t){let r=Lo(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(It(r,i)&&i in n?r:n,i,a)}}function Ar(e,t,r){let n=w(r);if(n!==r&&t.call(e,n)){let i=On(e);re(`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 Po(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function ir(e){if(ne(e))return e;return Un(e,!1,To,Io,Hn)}function $t(e){return Un(e,!0,Oo,Do,zn)}function Un(e,t,r,n,i){if(!Ae(e))return re(`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=Po(On(e));if(s===0)return e;let o=new Proxy(e,s===2?n:r);return i.set(e,o),o}function qn(e){if(ne(e))return qn(e.__v_raw);return!!(e&&e.__v_isReactive)}function ne(e){return!!(e&&e.__v_isReadonly)}function ie(e){return!!(e&&e.__v_isShallow)}function $o(e){return e?!!e.__v_raw:!1}function w(e){let t=e&&e.__v_raw;return t?w(t):e}function Ee(e){return e?e.__v_isRef===!0:!1}function Ro(e){let t=[];return L(e,(r)=>{if(r._x_refs)t.push(r._x_refs)}),t}function jn(e){if(!mt[e])mt[e]=0;return++mt[e]}function Ho(e,t){return L(e,(r)=>{if(r._x_ids&&r._x_ids[t])return!0})}function zo(e,t){if(!e._x_ids)e._x_ids={};if(!e._x_ids[t])e._x_ids[t]=jn(t)}function Uo(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 Fn(e,t,r){D(t,(n)=>B(`You can't use [$${t}] without first installing the "${e}" plugin here: https://alpinejs.dev/plugins/${r}`,n))}function Cr(e){let t=U(()=>document.querySelector(e),()=>qo)();if(!t)B(`Cannot find x-teleport element for selector: "${e}"`);return t}function ce(e,t,r,n){let i=e,a=(l)=>n(l),s={},o=(l,c)=>(d)=>c(l,d);if(r.includes("dot"))t=jo(t);if(r.includes("camel"))t=Fo(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=Vn(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(Vo(t)||Wn(t))a=o(a,(l,c)=>{if(Yo(c,r))return;l(c)});return i.addEventListener(t,a,s),()=>{i.removeEventListener(t,a,s)}}function Vn(e,t){if(e.includes("debounce")){let r=e[e.indexOf("debounce")+1]||"invalid-wait",n=Ye(r.split("ms")[0])?Number(r.split("ms")[0]):250;t=yn(t,n)}if(e.includes("throttle")){let r=e[e.indexOf("throttle")+1]||"invalid-wait",n=Ye(r.split("ms")[0])?Number(r.split("ms")[0]):250;t=xn(t,n)}return t}function jo(e){return e.replace(/-/g,".")}function Fo(e){return e.toLowerCase().replace(/-(\w)/g,(t,r)=>r.toUpperCase())}function Ye(e){return!Array.isArray(e)&&!isNaN(e)}function Ko(e){if([" ","_"].includes(e))return e;return e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[_\s]/,"-").toLowerCase()}function Vo(e){return["keydown","keyup"].includes(e)}function Wn(e){return["contextmenu","click","mouse"].some((t)=>e.includes(t))}function Yo(e,t){let r=t.filter((a,s)=>{if(a==="false"&&t[s-1]==="passive")return!1;return!Wo.includes(a)});if(r.includes("debounce")){let a=r.indexOf("debounce");r.splice(a,Ye((r[a+1]||"invalid-wait").split("ms")[0])?2:1)}if(r.includes("throttle")){let a=r.indexOf("throttle");r.splice(a,Ye((r[a+1]||"invalid-wait").split("ms")[0])?2:1)}if(r.length===0)return!1;if(r.length===1&&Tr(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(Wn(e.type))return!1;if(Tr(e.key).includes(r[0]))return!1}}return!0}function Tr(e){if(!e)return[];e=Ko(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 ze(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(Ve(e))if(Array.isArray(n)){let i=null;if(t.includes("number"))i=gt(r.target.value);else if(t.includes("boolean"))i=Ue(r.target.value);else i=r.target.value;return r.target.checked?n.includes(i)?n:n.concat([i]):n.filter((a)=>!Jo(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 gt(a)});else if(t.includes("boolean"))return Array.from(r.target.selectedOptions).map((i)=>{let a=i.value||i.text;return Ue(a)});return Array.from(r.target.selectedOptions).map((i)=>i.value||i.text)}else{let i;if(Zt(e))if(r.target.checked)i=r.target.value;else i=n;else i=r.target.value;if(t.includes("number"))return gt(i);else if(t.includes("boolean"))return Ue(i);else if(t.includes("trim"))return i.trim();else return i}})}function gt(e){let t=e?parseFloat(e):null;return Go(t)?t:e}function Jo(e,t){return e==t}function Go(e){return!Array.isArray(e)&&!isNaN(e)}function Or(e){return e!==null&&typeof e==="object"&&typeof e.get==="function"&&typeof e.set==="function"}function Xo(e,t){e._x_keyExpression=t}function Zo(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 Qo(e){if(!K)return!1;if(At)return!0;return e.hasAttribute("data-has-alpine-state")}function ea(e){return(t)=>{Object.entries(t).forEach(([r,n])=>{e[r]=n})}}function ta(e,t,r,n){r((i)=>{if(ia(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=sa(i),l=Object.entries(i).map(([c,d])=>{if(!o)c=parseInt(c);let u=na(t,d,c,i),f;return n((b)=>{if(typeof b==="object")B("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)=>{ae(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)B("x-for templates require a single root element, additional elements will be ignored.",e);let b=document.importNode(e.content,!0).firstElementChild,p=ue(f);Oe(b,p,e),b._x_refreshXForScope=ea(p),s.set(u,b),c.add(b),d.after(b),d=b}),c.forEach((u)=>P(u)),d!==e)e._x_lastRenderedEl=d;else delete e._x_lastRenderedEl})})}function ra(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 na(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 ia(e){return typeof e!=="object"&&!isNaN(e)}function sa(e){return typeof e==="object"&&!Array.isArray(e)}function Jn(){}function nt(e,t,r){E(t,(n)=>B(`You can't use [x-${t}] without first installing the "${e}" plugin here: https://alpinejs.dev/plugins/${r}`,n))}var yt=!1,xt=!1,z,vt=-1,qe=!1,Rt=!1,ue,oe,fe,Lr,Pi=0,wt=!0,Dr,Nr,Br,Je,Ut=!1,Y,jt=!1,je,Wi,jr,Fr,X=!0,Vr=()=>{},Wr,Kt="x-",Ke,kt=!1,ye,Jr,Xr=(e,t)=>({name:r,value:n})=>{if(r.startsWith(e))r=r.replace(e,t);return{name:r,value:n}},Zr=(e)=>e,en,rn=()=>new RegExp(`^${Kt}([^:^.]+)\\b`),St="DEFAULT",G,K=!1,nn,At=!1,Qe=0,xr=!1,Wt,an,fn,ws=1,Ct,Yt=!1,zs,H,wr=!1,wn,En,Zs,be,_r,kn,A=class{constructor(e,t,r,n){this.type=e,this.value=t,this.start=r,this.end=n}},Qs,eo=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 A("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 Fr(e){let t=X;X=!1;let r=e();return X=t,r}function Z(e,t,r={}){let n;return T(e,t)((i)=>n=i,r),n}function T(...e){return Vr(...e)}function es(e){Vr=e}function ts(e){Wr=e}function rs(e,t){return(r=()=>{},{scope:n={},params:i=[],context:a}={})=>{if(!X){_t(r,t,ee([n,...e]),i);return}let o=t.apply(ee([n,...e]),i);_t(r,o)}}function _t(e,t,r,n,i){if(X&&typeof t==="function"){let a=t.apply(r,n);if(a instanceof Promise)a.then((o)=>_t(e,o,r,n)).catch((o)=>Xe(o,i,t));else e(a)}else if(typeof t==="object"&&t instanceof Promise)t.then((a)=>e(a));else e(t)}function ns(...e){return Wr(...e)}function he(e=""){return Ft+e}function is(e){Ft=e}function _(e,t){return Fe[e]=t,{before(r){if(!Fe[r]){console.warn(String.raw`Cannot find directive \`${r}\`. \`${e}\` will use the default order of execution`);return}let n=G.indexOf(r);G.splice(n>=0?n:G.indexOf("DEFAULT"),0,e)}}}function ss(e){return Object.keys(Fe).includes(e)}function Ze(e,t,r){if(t=Array.from(t),e._x_virtualDirectives){let a=Object.entries(e._x_virtualDirectives).map(([s,l])=>({name:s,value:l})),o=Yr(a);a=a.map((s)=>{if(o.find((l)=>l.name===s.name))return{name:`x-bind:${s.name}`,value:`"${s.value}"`};return s}),t=t.concat(a)}let n={};return t.map(Qr((a,o)=>n[a]=o)).filter(tn).map(ls(n,r)).sort(cs).map((a)=>as(e,a))}function Yr(e){return Array.from(e).map(Qr()).filter((t)=>!tn(t))}function os(e){kt=!0;let t=Symbol();Jr=t,ye.set(t,[]);let r=()=>{while(ye.get(t).length)ye.get(t).shift()();ye.delete(t)},n=()=>{kt=!1,r()};e(r),n()}function Gr(e){let t=[],r=(s)=>t.push(s),[n,i]=Hi(e);return t.push(i),[{Alpine:pe,effect:n,cleanup:r,evaluateLater:T.bind(T,e),evaluate:Z.bind(Z,e)},()=>t.forEach((s)=>s())]}function as(e,t){let r=()=>{},n=Fe[t.type]||r,[i,a]=Gr(e);$r(e,t.original,a);let o=()=>{if(e._x_ignore||e._x_ignoreSelf)return;n.inline&&n.inline(e,t,i),n=n.bind(n,e,t,i),kt?ye.get(Jr).push(n):n()};return o.runCleanups=a,o}function Qr(e=()=>{}){return({name:t,value:r})=>{let{name:n,value:i}=en.reduce((a,o)=>o(a),{name:t,value:r});if(n!==t)e(n,t);return{name:n,value:i}}}function Vt(e){en.push(e)}function tn({name:e}){return rn().test(e)}function ls(e,t){return({name:r,value:n})=>{if(r===n)n="";let i=r.match(rn()),a=r.match(/:([a-zA-Z0-9\-_:]+)/),o=r.match(/\.[^.\]]+(?=[^\]]*$)/g)||[],s=t||e[r]||r;return{type:i?i[1]:null,value:a?a[1]:null,modifiers:o.map((l)=>l.replace(".","")),expression:n,original:s}}}function cs(e,t){let r=G.indexOf(e.type)===-1?St:e.type,n=G.indexOf(t.type)===-1?St:t.type;return G.indexOf(r)-G.indexOf(n)}function te(e,t){if(typeof ShadowRoot==="function"&&e instanceof ShadowRoot){Array.from(e.children).forEach((i)=>te(i,t));return}let r=!1;if(t(e,()=>r=!0),r)return;let n=e.firstElementChild;while(n)te(n,t,!1),n=n.nextElementSibling}function U(e,t=()=>{}){return(...r)=>F?t(...r):e(...r)}function ds(e){return(...t)=>F&&e(...t)}function Oe(e){nn.push(e)}function us(e,t){nn.forEach((r)=>r(e,t)),F=!0,sn(()=>{P(t,(r,n)=>{n(r,()=>{})})}),F=!1}function fs(e,t){if(!t._x_dataStack)t._x_dataStack=e._x_dataStack;F=!0,At=!0,sn(()=>{hs(t)}),F=!1,At=!1}function hs(e){let t=!1;P(e,(n,i)=>{te(n,(a,o)=>{if(t&&xs(a))return o();t=!0,i(a,o)})})}function sn(e){let t=oe;yr((r,n)=>{let i=t(r);return fe(i),()=>{}}),e(),yr(t)}function ps(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;Qe++}r.pending++,Promise.resolve(t).catch((n)=>{try{Xe(n,e)}catch(i){setTimeout(()=>{throw i},0)}}).then(()=>bs(e,r))}function bs(e,t){if(t.pending--,t.pending>0)return;if(Ki(),t.pending>0)return;if(e._x_deferInit!==t)return;if(delete e._x_deferInit,t.ownsIgnore)delete e._x_ignore;if(Qe--,!e.isConnected)return;gs(t),P(e)}function ms(e,t){if(Qe===0)return!1;let r=L(e,(n)=>n._x_deferInit);if(!r)return!1;return on(r._x_deferInit,e,t.map(({name:n})=>n)),!0}function on(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 gs(e){e.queuedAttributes.forEach((t,r)=>{if(!r.isConnected)return;if(!r._x_marker)return;if(r._x_marker!==t.marker)return;let n=L(r,(a)=>a._x_deferInit);if(n){on(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;Ze(r,i).forEach((a)=>a())})}function xe(e,t,r={},n={}){return e.dispatchEvent(new CustomEvent(t,{detail:r,bubbles:!0,composed:!0,cancelable:!0,...n}))}function N(e,...t){console.warn(`Alpine Warning: ${e}`,...t)}function ys(){if(xr)N("Alpine has already been initialized on this page. Calling Alpine.start() more than once can cause problems.");if(xr=!0,!document.body)N("Unable to initialize. Trying to load Alpine before `<body>` is available. Did you forget to add `defer` in Alpine's `<script>` tag?");xe(document,"alpine:init"),xe(document,"alpine:initializing"),qt(),Ui((t)=>P(t,te)),zt((t)=>ae(t)),Pr((t,r)=>{if(ms(t,r))return;Ze(t,r).forEach((n)=>n())});let e=(t)=>!et(t.parentElement,!0);Array.from(document.querySelectorAll(cn().join(","))).filter(e).forEach((t)=>{P(t)}),xe(document,"alpine:initialized"),setTimeout(()=>{Es()})}function ln(){return Wt.map((e)=>e())}function cn(){return Wt.concat(an).map((e)=>e())}function dn(e){Wt.push(e)}function un(e){an.push(e)}function et(e,t=!1){return L(e,(r)=>{if((t?cn():ln()).some((i)=>r.matches(i)))return!0})}function L(e,t){if(!e)return;if(t(e))return e;if(e._x_teleportBack)return L(e._x_teleportBack,t);if(e.parentNode instanceof ShadowRoot)return L(e.parentNode.host,t);if(!e.parentElement)return;return L(e.parentElement,t)}function xs(e){return ln().some((t)=>e.matches(t))}function vs(e){fn.push(e)}function P(e,t=te,r=()=>{}){if(L(e,(n)=>n._x_ignore))return;os(()=>{t(e,(n,i)=>{if(n._x_marker)return;if(r(n,i),fn.forEach((a)=>a(n,i)),Ze(n,n.attributes).forEach((a)=>a()),!n._x_ignore)n._x_marker=ws++;n._x_ignore&&i()})})}function ae(e,t=te){t(e,(r)=>{qi(r),Rr(r),delete r._x_marker})}function Es(){[["ui","dialog",["[x-dialog], [x-popover]"]],["anchor","anchor",["[x-anchor]"]],["sort","sort",["[x-sort]"]]].forEach(([t,r,n])=>{if(ss(r))return;n.some((i)=>{if(document.querySelector(i))return N(`found "${i}", but missing ${t} plugin`),!0})})}function Jt(e=()=>{}){return queueMicrotask(()=>{Yt||setTimeout(()=>{Tt()})}),new Promise((t)=>{Ct.push(()=>{e(),t()})})}function Tt(){Yt=!1;while(Ct.length)Ct.shift()()}function _s(){Yt=!0}function Gt(e,t){if(Array.isArray(t))return vr(e,t.join(" "));else if(typeof t==="object"&&t!==null)return ks(e,t);else if(typeof t==="function")return Gt(e,t());return vr(e,t)}function Mt(e){return e.split(/\s/).filter(Boolean)}function vr(e,t){let r=(i)=>Mt(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 ks(e,t){let r=Object.entries(t).flatMap(([o,s])=>s?Mt(o):!1).filter(Boolean),n=Object.entries(t).flatMap(([o,s])=>!s?Mt(o):!1).filter(Boolean),i=[],a=[];return n.forEach((o)=>{if(e.classList.contains(o))e.classList.remove(o),a.push(o)}),r.forEach((o)=>{if(!e.classList.contains(o))e.classList.add(o),i.push(o)}),()=>{a.forEach((o)=>e.classList.add(o)),i.forEach((o)=>e.classList.remove(o))}}function tt(e,t){if(typeof t==="object"&&t!==null)return Ss(e,t);return As(e,t)}function Ss(e,t){let r={};return Object.entries(t).forEach(([n,i])=>{if(r[n]=e.style[n],!n.startsWith("--"))n=Cs(n);e.style.setProperty(n,i)}),setTimeout(()=>{if(e.style.length===0)e.removeAttribute("style")}),()=>{tt(e,r)}}function As(e,t){let r=e.getAttribute("style",t);return e.setAttribute("style",t),()=>{e.setAttribute("style",r||"")}}function Cs(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function Ot(e,t=()=>{}){let r=!1;return function(){if(!r)r=!0,e.apply(this,arguments);else t.apply(this,arguments)}}function Ts(e,t,r){hn(e,Gt,""),{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 Ms(e,t,r){hn(e,tt);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((g,S)=>S<t.indexOf("out"));if(t.includes("out")&&!n)t=t.filter((g,S)=>S>t.indexOf("out"));let o=!t.includes("opacity")&&!t.includes("scale"),s=o||t.includes("opacity"),l=o||t.includes("scale"),c=s?0:1,d=l?me(t,"scale",95)/100:1,u=me(t,"delay",0)/1000,f=me(t,"origin","center"),h="opacity, transform",b=me(t,"duration",150)/1000,p=me(t,"duration",75)/1000,m="cubic-bezier(0.4, 0.0, 0.2, 1)";if(i)e._x_transition.enter.during={transformOrigin:f,transitionDelay:`${u}s`,transitionProperty:h,transitionDuration:`${b}s`,transitionTimingFunction:m},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:h,transitionDuration:`${p}s`,transitionTimingFunction:m},e._x_transition.leave.start={opacity:1,transform:"scale(1)"},e._x_transition.leave.end={opacity:c,transform:`scale(${d})`}}function hn(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=()=>{}){Lt(e,t,{during:this.enter.during,start:this.enter.start,end:this.enter.end},n,i)},out(n=()=>{},i=()=>{}){Lt(e,t,{during:this.leave.during,start:this.leave.start,end:this.leave.end},n,i)}}}function pn(e){let t=e.parentNode;if(!t)return;return t._x_hidePromise?t:pn(t)}function Lt(e,t,{during:r,start:n,end:i}={},a=()=>{},o=()=>{}){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(),o();return}let s,l,c;Os(e,{start(){s=t(e,n)},during(){l=t(e,r)},before:a,end(){s(),c=t(e,i)},after:o,cleanup(){l(),c()}})}function Os(e,t){let r,n,i,a=Ot(()=>{E(()=>{if(r=!0,!n)t.before();if(!i)t.end(),Tt();if(t.after(),e.isConnected)t.cleanup();delete e._x_transitioning})});e._x_transitioning={beforeCancels:[],beforeCancel(o){this.beforeCancels.push(o)},cancel:Ot(function(){while(this.beforeCancels.length)this.beforeCancels.shift()();a()}),finish:a},E(()=>{t.start(),t.during()}),_s(),requestAnimationFrame(()=>{if(r)return;let o=Number(getComputedStyle(e).transitionDuration.replace(/,.*/,"").replace("s",""))*1000,s=Number(getComputedStyle(e).transitionDelay.replace(/,.*/,"").replace("s",""))*1000;if(o===0)o=Number(getComputedStyle(e).animationDuration.replace("s",""))*1000;E(()=>{t.before()}),n=!0,requestAnimationFrame(()=>{if(r)return;E(()=>{t.end()}),Tt(),setTimeout(e._x_transitioning.finish,o+s),i=!0})})}function me(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 bn(e,t,r,n=[]){if(!e._x_bindings)e._x_bindings=ue({});switch(e._x_bindings[t]=r,t=n.includes("camel")?Rs(t):t,t){case"value":Ls(e,r);break;case"style":Ds(e,r);break;case"class":Is(e,r);break;case"selected":case"checked":Bs(e,t,r);break;default:Xt(e,t,r);break}}function Ls(e,t){if(Zt(e)){if(e.attributes.value===void 0)e.value=t}else if(Ve(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)=>Hs(r,e.value));else e.checked=!!t;else if(e.tagName==="SELECT")$s(e,t);else if(e.tagName==="OPTION")Xt(e,"value",t);else{if(e.value===t&&(typeof t!=="object"||t===null))return;e.value=t===void 0?"":t}}function Is(e,t){if(e._x_undoAddedClasses)e._x_undoAddedClasses();e._x_undoAddedClasses=Gt(e,t)}function Ds(e,t){if(e._x_undoAddedStyles)e._x_undoAddedStyles();e._x_undoAddedStyles=tt(e,t)}function Bs(e,t,r){Xt(e,t,r),Ps(e,t,r)}function Xt(e,t,r){if([null,void 0,!1].includes(r)&&Us(t))e.removeAttribute(t);else{if(mn(t))r=t;if(qs(r))r=JSON.stringify(r);Ns(e,t,r)}}function Ns(e,t,r){if(e.getAttribute(t)!=r)e.setAttribute(t,r)}function Ps(e,t,r){if(e[t]!==r)e[t]=r}function $s(e,t){let r=[].concat(t).map((n)=>n+"");Array.from(e.options).forEach((n)=>{n.selected=r.includes(n.value)})}function Rs(e){return e.toLowerCase().replace(/-(\w)/g,(t,r)=>r.toUpperCase())}function Hs(e,t){return e==t}function Ue(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 mn(e){return zs.has(e)}function Us(e){return!["aria-pressed","aria-checked","aria-expanded","aria-selected"].includes(e)}function qs(e){return typeof e==="object"&&e!==null}function js(e,t,r){if(e._x_bindings&&e._x_bindings[t]!==void 0)return e._x_bindings[t];return gn(e,t,r)}function Ks(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,Fr(()=>Z(e,i.expression))}return gn(e,t,r)}function gn(e,t,r){let n=e.getAttribute(t);if(n===null)return typeof r==="function"?r():r;if(n==="")return!0;if(mn(t))return!![t,"true"].includes(n);return n}function Ve(e){return e.type==="checkbox"||e.localName==="ui-checkbox"||e.localName==="ui-switch"}function Zt(e){return e.type==="radio"||e.localName==="ui-radio"}function yn(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 xn(e,t){let r;return function(){let n=this,i=arguments;if(!r)e.apply(n,i),r=!0,setTimeout(()=>r=!1,t)}}function vn({get:e,set:t},{get:r,set:n}){let i=!0,a,o,s=oe(()=>{let l=e(),c=r();if(i)n(ut(l)),i=!1;else{let d=JSON.stringify(l),u=JSON.stringify(c);if(d!==a)n(ut(l));else if(d!==u)t(ut(c))}a=JSON.stringify(e()),o=JSON.stringify(r())});return()=>{Ht(s),fe(s)}}function ut(e){return typeof e==="object"?JSON.parse(JSON.stringify(e)):e}function Fs(e){(Array.isArray(e)?e:[e]).forEach((r)=>r(pe))}function Vs(e,t){if(!wr)H=ue(H),wr=!0;if(t===void 0)return H[e];if(H[e]=t,typeof t==="object"&&t!==null&&t._x_interceptor)H[e]=t.initialize(H,e,e,()=>{});else Kt(H[e]);if(typeof t==="object"&&t!==null&&t.hasOwnProperty("init")&&typeof t.init==="function")H[e].init()}function Ws(){return H}function Ys(e,t){let r=typeof t!=="function"?()=>t:t;if(e instanceof Element)return En(e,r());else wn[e]=r;return()=>{}}function Js(e){return Object.entries(wn).forEach(([t,r])=>{Object.defineProperty(e,t,{get(){return(...n)=>r(...n)}})}),e}function En(e,t,r){let n=[];while(n.length)n.pop()();let i=Object.entries(t).map(([o,s])=>({name:o,value:s})),a=Yr(i);return i=i.map((o)=>{if(a.find((s)=>s.name===o.name))return{name:`x-bind:${o.name}`,value:`"${o.value}"`};return o}),Ze(e,i,r).map((o)=>{n.push(o.runCleanups),o()}),()=>{while(n.length)n.pop()()}}function Gs(e,t){_n[e]=t}function Xs(e,t){return Object.entries(_n).forEach(([r,n])=>{Object.defineProperty(e,r,{get(){return(...i)=>n.bind(t)(...i)},enumerable:!1})}),e}function Sn(e){try{let r=new eo(e).tokenize(),i=new to(r).parse(),a=new ro;return function(o={}){let{scope:s={},context:l=null,forceBindingRootScopeToFunctions:c=!1}=o;return a.evaluate({node:i,scope:s,context:l,forceBindingRootScopeToFunctions:c})}}catch(t){throw Error(`CSP Parser Error: ${t.message}`)}}function no(e,t,r={}){let n=An(e),i=ee([r.scope??{},...n]),a=r.params??[],s=Sn(t)({scope:i,forceBindingRootScopeToFunctions:!0});if(typeof s==="function"&&X)return s.apply(i,a);return s}function io(e,t){let r=An(e);if(typeof t==="function")return rs(r,t);let n=so(e,t,r);return Xi.bind(null,e,t,n)}function An(e){let t={};return Ke(t,e),[t,...de(e)]}function so(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 o=ee([i,...r]),l=Sn(t)({scope:o,forceBindingRootScopeToFunctions:!0});if(X&&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 Cn(e){let t=Object.create(null);for(let r of e.split(","))t[r]=1;return(r)=>(r in t)}function re(e,...t){console.warn(`[Vue warn] ${e}`,...t)}function ho(e,t=!1){if(e.flags|=8,t){e.next=Ee,Ee=e;return}e.next=we,we=e}function er(){Ln++}function tr(){if(--Ln>0)return;if(Ee){let t=Ee;Ee=void 0;while(t){let r=t.next;t.next=void 0,t.flags&=-9,t=r}}let e;while(we){let t=we;we=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 In(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Dn(e){let t,r=e.depsTail,n=r;while(n){let i=n.prevDep;if(n.version===-1){if(n===r)r=i;rr(n),bo(n)}else t=n;n.dep.activeLink=n.prevActiveLink,n.prevActiveLink=void 0,n=i}e.deps=t,e.depsTail=r}function Dt(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(po(t.dep.computed)||t.dep.version!==t.version))return!0;if(e._dirty)return!0;return!1}function po(e){if(e.flags&4&&!(e.flags&16))return;if(e.flags&=-17,e.globalVersion===We)return;if(e.globalVersion=We,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Dt(e)))return;e.flags|=2;let t=e.dep,r=v,n=I;v=e,I=!0;try{In(e);let i=e.fn(e._value);if(t.version===0||J(i,e._value))e.flags|=128,e._value=i,t.version++}catch(i){throw t.version++,i}finally{v=r,I=n,Dn(e),e.flags&=-3}}function rr(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)rr(a,!0)}}if(!t&&!--r.sc&&r.map)r.map.delete(r.key)}function bo(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 mo(e,t){if(e.effect instanceof _r)e=e.effect.fn;let r=new _r(e);if(t)ke(r,t);try{r.run()}catch(i){throw r.stop(),i}let n=r.run.bind(r);return n.effect=r,n}function go(e){e.effect.stop()}function yo(){Bn.push(I),I=!1}function xo(){let e=Bn.pop();I=e===void 0?!0:e}function kr(e){let{cleanup:t}=e;if(e.cleanup=void 0,t){let r=v;v=void 0;try{t()}finally{v=r}}}function Nn(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)Nn(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 O(e,t,r){if(I&&v){let n=Bt.get(e);if(!n)Bt.set(e,n=new Map);let i=n.get(r);if(!i)n.set(r,i=new wo),i.map=n,i.key=r;i.track({target:e,type:t,key:r})}}function K(e,t,r,n,i,a){let o=Bt.get(e);if(!o){We++;return}let s=(l)=>{if(l)l.trigger({target:e,type:t,key:r,newValue:n,oldValue:i,oldTarget:a})};if(er(),t==="clear")o.forEach(s);else{let l=Se(e),c=l&&Qt(r);if(l&&r==="length"){let d=Number(n);o.forEach((u,f)=>{if(f==="length"||f===Ce||!Le(f)&&f>=d)s(u)})}else{if(r!==void 0||o.has(void 0))s(o.get(r));if(c)s(o.get(Ce));switch(t){case"add":if(!l){if(s(o.get(Q)),ve(e))s(o.get(Nt))}else if(c)s(o.get("length"));break;case"delete":if(!l){if(s(o.get(Q)),ve(e))s(o.get(Nt))}break;case"set":if(ve(e))s(o.get(Q));break}}}tr()}function le(e){let t=w(e);if(t===e)return t;return O(t,"iterate",Ce),ie(e)?t:t.map(se)}function nr(e){return O(e=w(e),"iterate",Ce),e}function B(e,t){if(ne(e))return qn(e)?Te(se(t)):Te(t);return se(t)}function pt(e,t,r){let n=nr(e),i=n[t]();if(n!==e&&!ie(e))i._next=i.next,i.next=()=>{let a=i._next();if(!a.done)a.value=r(a.value);return a};return i}function R(e,t,r,n,i,a){let o=nr(e),s=o!==e&&!ie(e),l=o[t];if(l!==_o[t]){let u=l.apply(e,a);return s?se(u):u}let c=r;if(o!==e){if(s)c=function(u,f){return r.call(this,B(e,u),f,e)};else if(r.length>2)c=function(u,f){return r.call(this,u,f,e)}}let d=l.call(o,c,n);return s&&i?i(d):d}function Sr(e,t,r,n){let i=nr(e),a=i!==e&&!ie(e),o=r,s=!1;if(i!==e){if(a)s=n.length===0,o=function(c,d,u){if(s)s=!1,c=B(e,c);return r.call(this,c,B(e,d),u,e)};else if(r.length>3)o=function(c,d,u){return r.call(this,c,d,u,e)}}let l=i[t](o,...n);return s?B(e,l):l}function bt(e,t,r){let n=w(e);O(n,"iterate",Ce);let i=n[t](...r);if((i===-1||i===!1)&&$o(r[0]))return r[0]=w(r[0]),n[t](...r);return i}function ge(e,t,r=[]){yo(),er();let n=w(e)[t].apply(e,r);return tr(),xo(),n}function So(e){if(!Le(e))e=String(e);let t=w(this);return O(t,"has",e),t.hasOwnProperty(e)}function Oo(e,t,r){return function(...n){let i=this.__v_raw,a=w(i),o=ve(a),s=e==="entries"||e===Symbol.iterator&&o,l=e==="keys"&&o,c=i[e](...n),d=r?Pt:t?Te:se;return!t&&O(a,"iterate",l?Nt:Q),ke(Object.create(c),{next(){let{value:u,done:f}=c.next();return f?{value:u,done:f}:{value:s?[d(u[0]),d(u[1])]:d(u),done:f}}})}}function He(e){return function(...t){{let r=t[0]?`on key "${t[0]}" `:"";re(`${On(e)} operation ${r}failed: target is readonly.`,w(this))}return e==="delete"?!1:e==="clear"?void 0:this}}function Lo(e,t){let r={get(i){let a=this.__v_raw,o=w(a),s=w(i);if(!e){if(J(i,s))O(o,"get",i);O(o,"get",s)}let{has:l}=Re(o),c=t?Pt:e?Te:se;if(l.call(o,i))return c(a.get(i));else if(l.call(o,s))return c(a.get(s));else if(a!==o)a.get(i)},get size(){let i=this.__v_raw;return!e&&O(w(i),"iterate",Q),i.size},has(i){let a=this.__v_raw,o=w(a),s=w(i);if(!e){if(J(i,s))O(o,"has",i);O(o,"has",s)}return i===s?a.has(i):a.has(i)||a.has(s)},forEach(i,a){let o=this,s=o.__v_raw,l=w(s),c=t?Pt:e?Te:se;return!e&&O(l,"iterate",Q),s.forEach((d,u)=>i.call(a,c(d),c(u),o))}};return ke(r,e?{add:He("add"),set:He("set"),delete:He("delete"),clear:He("clear")}:{add(i){let a=w(this),o=Re(a),s=w(i),l=!t&&!ie(i)&&!ne(i)?s:i;if(!(o.has.call(a,l)||J(i,l)&&o.has.call(a,i)||J(s,l)&&o.has.call(a,s)))a.add(l),K(a,"add",l,l);return this},set(i,a){if(!t&&!ie(a)&&!ne(a))a=w(a);let o=w(this),{has:s,get:l}=Re(o),c=s.call(o,i);if(!c)i=w(i),c=s.call(o,i);else Ar(o,s,i);let d=l.call(o,i);if(o.set(i,a),!c)K(o,"add",i,a);else if(J(a,d))K(o,"set",i,a,d);return this},delete(i){let a=w(this),{has:o,get:s}=Re(a),l=o.call(a,i);if(!l)i=w(i),l=o.call(a,i);else Ar(a,o,i);let c=s?s.call(a,i):void 0,d=a.delete(i);if(l)K(a,"delete",i,void 0,c);return d},clear(){let i=w(this),a=i.size!==0,o=ve(i)?new Map(i):new Set(i),s=i.clear();if(a)K(i,"clear",void 0,void 0,o);return s}}),["keys","values","entries",Symbol.iterator].forEach((i)=>{r[i]=Oo(i,e,t)}),r}function Rn(e,t){let r=Lo(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(It(r,i)&&i in n?r:n,i,a)}}function Ar(e,t,r){let n=w(r);if(n!==r&&t.call(e,n)){let i=Mn(e);re(`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 Po(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function ir(e){if(ne(e))return e;return Un(e,!1,To,Io,Hn)}function $t(e){return Un(e,!0,Mo,Do,zn)}function Un(e,t,r,n,i){if(!Ae(e))return re(`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 o=Po(Mn(e));if(o===0)return e;let s=new Proxy(e,o===2?n:r);return i.set(e,s),s}function qn(e){if(ne(e))return qn(e.__v_raw);return!!(e&&e.__v_isReactive)}function ne(e){return!!(e&&e.__v_isReadonly)}function ie(e){return!!(e&&e.__v_isShallow)}function $o(e){return e?!!e.__v_raw:!1}function w(e){let t=e&&e.__v_raw;return t?w(t):e}function _e(e){return e?e.__v_isRef===!0:!1}function Ro(e){let t=[];return L(e,(r)=>{if(r._x_refs)t.push(r._x_refs)}),t}function jn(e){if(!mt[e])mt[e]=0;return++mt[e]}function Ho(e,t){return L(e,(r)=>{if(r._x_ids&&r._x_ids[t])return!0})}function zo(e,t){if(!e._x_ids)e._x_ids={};if(!e._x_ids[t])e._x_ids[t]=jn(t)}function Uo(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 Kn(e,t,r){D(t,(n)=>N(`You can't use [$${t}] without first installing the "${e}" plugin here: https://alpinejs.dev/plugins/${r}`,n))}function Cr(e){let t=U(()=>document.querySelector(e),()=>qo)();if(!t)N(`Cannot find x-teleport element for selector: "${e}"`);return t}function ce(e,t,r,n){let i=e,a=(l)=>n(l),o={},s=(l,c)=>(d)=>c(l,d);if(r.includes("dot"))t=jo(t);if(r.includes("camel"))t=Ko(t);if(r.includes("capture"))o.capture=!0;if(r.includes("window"))i=window;if(r.includes("document"))i=document;if(r.includes("passive"))o.passive=r[r.indexOf("passive")+1]!=="false";if(a=Vn(r,a),r.includes("prevent"))a=s(a,(l,c)=>{c.preventDefault(),l(c)});if(r.includes("stop"))a=s(a,(l,c)=>{c.stopPropagation(),l(c)});if(r.includes("once"))a=s(a,(l,c)=>{l(c),i.removeEventListener(t,a,o)});if(r.includes("away")||r.includes("outside"))i=document,a=s(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=s(a,(l,c)=>{c.target===e&&l(c)});if(t==="submit")a=s(a,(l,c)=>{if(c.target._x_pendingModelUpdates)c.target._x_pendingModelUpdates.forEach((d)=>d());l(c)});if(Vo(t)||Wn(t))a=s(a,(l,c)=>{if(Yo(c,r))return;l(c)});return i.addEventListener(t,a,o),()=>{i.removeEventListener(t,a,o)}}function Vn(e,t){if(e.includes("debounce")){let r=e[e.indexOf("debounce")+1]||"invalid-wait",n=Ye(r.split("ms")[0])?Number(r.split("ms")[0]):250;t=yn(t,n)}if(e.includes("throttle")){let r=e[e.indexOf("throttle")+1]||"invalid-wait",n=Ye(r.split("ms")[0])?Number(r.split("ms")[0]):250;t=xn(t,n)}return t}function jo(e){return e.replace(/-/g,".")}function Ko(e){return e.toLowerCase().replace(/-(\w)/g,(t,r)=>r.toUpperCase())}function Ye(e){return!Array.isArray(e)&&!isNaN(e)}function Fo(e){if([" ","_"].includes(e))return e;return e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[_\s]/,"-").toLowerCase()}function Vo(e){return["keydown","keyup"].includes(e)}function Wn(e){return["contextmenu","click","mouse"].some((t)=>e.includes(t))}function Yo(e,t){let r=t.filter((a,o)=>{if(a==="false"&&t[o-1]==="passive")return!1;return!Wo.includes(a)});if(r.includes("debounce")){let a=r.indexOf("debounce");r.splice(a,Ye((r[a+1]||"invalid-wait").split("ms")[0])?2:1)}if(r.includes("throttle")){let a=r.indexOf("throttle");r.splice(a,Ye((r[a+1]||"invalid-wait").split("ms")[0])?2:1)}if(r.length===0)return!1;if(r.length===1&&Tr(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((o)=>{if(o==="cmd"||o==="super")o="meta";return e[`${o}Key`]}).length===i.length){if(Wn(e.type))return!1;if(Tr(e.key).includes(r[0]))return!1}}return!0}function Tr(e){if(!e)return[];e=Fo(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 ze(e,t,r,n){return E(()=>{if(r instanceof CustomEvent&&r.detail!==void 0)return r.detail!==null&&r.detail!==void 0?r.detail:r.target.value;else if(Ve(e))if(Array.isArray(n)){let i=null;if(t.includes("number"))i=gt(r.target.value);else if(t.includes("boolean"))i=Ue(r.target.value);else i=r.target.value;return r.target.checked?n.includes(i)?n:n.concat([i]):n.filter((a)=>!Jo(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 gt(a)});else if(t.includes("boolean"))return Array.from(r.target.selectedOptions).map((i)=>{let a=i.value||i.text;return Ue(a)});return Array.from(r.target.selectedOptions).map((i)=>i.value||i.text)}else{let i;if(Zt(e))if(r.target.checked)i=r.target.value;else i=n;else i=r.target.value;if(t.includes("number"))return gt(i);else if(t.includes("boolean"))return Ue(i);else if(t.includes("trim"))return i.trim();else return i}})}function gt(e){let t=e?parseFloat(e):null;return Go(t)?t:e}function Jo(e,t){return e==t}function Go(e){return!Array.isArray(e)&&!isNaN(e)}function Mr(e){return e!==null&&typeof e==="object"&&typeof e.get==="function"&&typeof e.set==="function"}function Xo(e,t){e._x_keyExpression=t}function Zo(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 Qo(e){if(!F)return!1;if(At)return!0;return e.hasAttribute("data-has-alpine-state")}function ea(e){return(t)=>{Object.entries(t).forEach(([r,n])=>{e[r]=n})}}function ta(e,t,r,n){r((i)=>{if(ia(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,o=new Map;e._x_lookup=o;let s=sa(i),l=Object.entries(i).map(([c,d])=>{if(!s)c=parseInt(c);let u=na(t,d,c,i),f;return n((h)=>{if(typeof h==="object")N("x-for key cannot be an object, it must be a string or an integer",e);if(a.has(h))o.set(h,a.get(h)),a.delete(h);f=h},{scope:{index:c,...u}}),[f,u]});E(()=>{a.forEach((u)=>{ae(u),u.remove()});let c=new Set,d=e;if(l.forEach(([u,f])=>{if(o.has(u)){let p=o.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)N("x-for templates require a single root element, additional elements will be ignored.",e);let h=document.importNode(e.content,!0).firstElementChild,b=ue(f);Me(h,b,e),h._x_refreshXForScope=ea(b),o.set(u,h),c.add(h),d.after(h),d=h}),c.forEach((u)=>P(u)),d!==e)e._x_lastRenderedEl=d;else delete e._x_lastRenderedEl})})}function ra(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 o=i[1].replace(r,"").trim(),s=o.match(t);if(s){if(a.item=o.replace(t,"").trim(),a.index=s[1].trim(),s[2])a.collection=s[2].trim()}else a.item=o;return a}function na(e,t,r,n){let i={};if(/^\[.*\]$/.test(e.item)&&Array.isArray(t))e.item.replace("[","").replace("]","").split(",").map((o)=>o.trim()).forEach((o,s)=>{i[o]=t[s]});else if(/^\{.*\}$/.test(e.item)&&!Array.isArray(t)&&typeof t==="object")e.item.replace("{","").replace("}","").split(",").map((o)=>o.trim()).forEach((o)=>{i[o]=t[o]});else i[e.item]=t;if(e.index)i[e.index]=r;if(e.collection)i[e.collection]=n;return i}function ia(e){return typeof e!=="object"&&!isNaN(e)}function sa(e){return typeof e==="object"&&!Array.isArray(e)}function Jn(){}function nt(e,t,r){_(t,(n)=>N(`You can't use [x-${t}] without first installing the "${e}" plugin here: https://alpinejs.dev/plugins/${r}`,n))}var yt=!1,xt=!1,z,vt=-1,qe=!1,Rt=!1,ue,oe,fe,Lr,Pi=0,wt=!0,Dr,Br,Nr,Je,Ut=!1,Y,jt=!1,je,Wi,jr,Kr,X=!0,Vr=()=>{},Wr,Ft="x-",Fe,kt=!1,ye,Jr,Xr=(e,t)=>({name:r,value:n})=>{if(r.startsWith(e))r=r.replace(e,t);return{name:r,value:n}},Zr=(e)=>e,en,rn=()=>new RegExp(`^${Ft}([^:^.]+)\\b`),St="DEFAULT",G,F=!1,nn,At=!1,Qe=0,xr=!1,Wt,an,fn,ws=1,Ct,Yt=!1,zs,H,wr=!1,wn,_n,Zs,pe,Er,kn,A=class{constructor(e,t,r,n){this.type=e,this.value=t,this.start=r,this.end=n}},Qs,eo=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 A("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 A("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 A("BOOLEAN",t==="true",e,this.position));else if(t==="null")this.tokens.push(new A("NULL",null,e,this.position));else if(t==="undefined")this.tokens.push(new A("UNDEFINED",void 0,e,this.position));else this.tokens.push(new A("KEYWORD",t,e,this.position));else this.tokens.push(new A("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 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 A("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 A("OPERATOR","===",e,this.position));else if(t==="!"&&r==="="&&n==="=")this.position+=3,this.tokens.push(new A("OPERATOR","!==",e,this.position));else if(t==="="&&r==="=")this.position+=2,this.tokens.push(new A("OPERATOR","==",e,this.position));else if(t==="!"&&r==="=")this.position+=2,this.tokens.push(new A("OPERATOR","!=",e,this.position));else if(t==="<"&&r==="=")this.position+=2,this.tokens.push(new A("OPERATOR","<=",e,this.position));else if(t===">"&&r==="=")this.position+=2,this.tokens.push(new A("OPERATOR",">=",e,this.position));else if(t==="&"&&r==="&")this.position+=2,this.tokens.push(new A("OPERATOR","&&",e,this.position));else if(t==="|"&&r==="|")this.position+=2,this.tokens.push(new A("OPERATOR","||",e,this.position));else if(t==="+"&&r==="+")this.position+=2,this.tokens.push(new A("OPERATOR","++",e,this.position));else if(t==="-"&&r==="-")this.position+=2,this.tokens.push(new A("OPERATOR","--",e,this.position));else{this.position++;let i="()[]{},.;:?".includes(t)?"PUNCTUATION":"OPERATOR";this.tokens.push(new A(i,t,e,this.position))}}},to=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 Qs.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}}},ro=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 m=t[e.name];if(this.checkForDangerousValues(m),typeof m==="function")return m.bind(t);return m}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((m)=>this.evaluate({node:m,scope:t,context:r,forceBindingRootScopeToFunctions:n})),l;if(e.callee.type==="MemberExpression"){let m=this.evaluate({node:e.callee.object,scope:t,context:r,forceBindingRootScopeToFunctions:n}),g;if(e.callee.computed)g=this.evaluate({node:e.callee.property,scope:t,context:r,forceBindingRootScopeToFunctions:n});else g=e.callee.property.name;this.checkForDangerousKeywords(g);let S=m[g];if(typeof S!=="function")throw Error("Value is not a function");l=S.apply(m,o)}else if(e.callee.type==="Identifier"){let m=e.callee.name,g;if(m in t)g=t[m];else throw Error(`Undefined variable: ${m}`);if(typeof g!=="function")throw Error("Value is not a function");let S=r!==null?r:t;l=g.apply(S,o)}else{let m=this.evaluate({node:e.callee,scope:t,context:r,forceBindingRootScopeToFunctions:n});if(typeof m!=="function")throw Error("Value is not a function");l=m.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 m=e.argument.name;if(!(m in t))throw Error(`Undefined variable: ${m}`);let g=t[m];if(e.operator==="++")t[m]=g+1;else if(e.operator==="--")t[m]=g-1;return e.prefix?t[m]:g}else if(e.argument.type==="MemberExpression"){let m=this.evaluate({node:e.argument.object,scope:t,context:r,forceBindingRootScopeToFunctions:n}),g=e.argument.computed?this.evaluate({node:e.argument.property,scope:t,context:r,forceBindingRootScopeToFunctions:n}):e.argument.property.name;if(this.isDOMObject(m))throw Error("Property assignments on DOM objects are prohibited in the CSP build");this.checkForDangerousKeywords(g);let S=m[g];if(e.operator==="++")m[g]=S+1;else if(e.operator==="--")m[g]=S-1;return e.prefix?m[g]:S}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 p=this.evaluate({node:e.right,scope:t,context:r,forceBindingRootScopeToFunctions:n});if(e.left.type==="Identifier")return t[e.left.name]=p,p;else if(e.left.type==="MemberExpression"){let m=this.evaluate({node:e.left.object,scope:t,context:r,forceBindingRootScopeToFunctions:n}),g=e.left.computed?this.evaluate({node:e.left.property,scope:t,context:r,forceBindingRootScopeToFunctions:n}):e.left.property.name;if(this.isDOMObject(m))throw Error("Property assignments on DOM objects are prohibited in the CSP build");return this.checkForDangerousKeywords(g),m[g]=p,p}throw Error("Invalid assignment target");case"ArrayExpression":return e.elements.map((m)=>this.evaluate({node:m,scope:t,context:r,forceBindingRootScopeToFunctions:n}));case"ObjectExpression":let h={};for(let m of e.properties){let g=m.computed?this.evaluate({node:m.key,scope:t,context:r,forceBindingRootScopeToFunctions:n}):m.key.type==="Identifier"?m.key.name:this.evaluate({node:m.key,scope:t,context:r,forceBindingRootScopeToFunctions:n}),S=this.evaluate({node:m.value,scope:t,context:r,forceBindingRootScopeToFunctions:n});h[g]=S}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(_r.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(kn.has(e))throw Error("Accessing global variables is prohibited in the CSP build");return _r.set(e,!0),!0}},Pa,$a,ke,oo,It=(e,t)=>oo.call(e,t),Se,ve=(e)=>Tn(e)==="[object Map]",ao=(e)=>typeof e==="string",Le=(e)=>typeof e==="symbol",Ae=(e)=>e!==null&&typeof e==="object",lo,Tn=(e)=>lo.call(e),On=(e)=>Tn(e).slice(8,-1),Qt=(e)=>ao(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,rt=(e)=>{let t=Object.create(null);return(r)=>t[r]||(t[r]=e(r))},co,Ra,uo,Ha,Mn,za,J=(e,t)=>!Object.is(e,t),fo="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",Ua,ft,v,ht,Er=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,ft)if(ft.active)ft.effects.push(this);else this.flags&=-2}pause(){this.flags|=64}resume(){if(this.flags&64){if(this.flags&=-65,ht.has(this))ht.delete(this),this.trigger()}}notify(){if(this.flags&2&&!(this.flags&32))return;if(!(this.flags&8))ho(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,kr(this),In(this);let e=v,t=I;v=this,I=!0;try{return this.fn()}finally{if(v!==this)re("Active effect was not restored correctly - this is likely a Vue internal bug.");Dn(this),v=e,I=t,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)rr(e);this.deps=this.depsTail=void 0,kr(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){if(this.flags&64)ht.add(this);else if(this.scheduler)this.scheduler();else this.runIfDirty()}runIfDirty(){if(Dt(this))this.run()}get dirty(){return Dt(this)}},Ln=0,we,_e,I=!0,Nn,We=0,vo=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}},wo=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||!I||v===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==v){if(t=this.activeLink=new vo(v,this),!v.deps)v.deps=v.depsTail=t;else t.prevDep=v.depsTail,v.depsTail.nextDep=t,v.depsTail=t;Bn(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(ke({effect:v},e));return t}trigger(e){this.version++,We++,this.notify(e)}notify(e){er();try{for(let t=this.subsHead;t;t=t.nextSub)if(t.sub.onTrigger&&!(t.sub.flags&8))t.sub.onTrigger(ke({effect:t.sub},e));for(let t=this.subs;t;t=t.prevSub)if(t.sub.notify())t.sub.dep.notify()}finally{tr()}}},Nt,Q,Bt,Ce,_o,Eo,ko,Pn,$n=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?Bo:zn:i?No:Hn).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(r))return e;return}let a=Se(e);if(!n){let o;if(a&&(o=_o[t]))return o;if(t==="hasOwnProperty")return So}let s=Reflect.get(e,t,Ee(e)?e:r);if(Le(t)?Pn.has(t):ko(t))return s;if(!n)M(e,"get",t);if(i)return s;if(Ee(s)){let o=a&&Qt(t)?s:s.value;return n&&Ae(o)?$t(o):o}if(Ae(s))return n?$t(s):ir(s);return s}},Ao,Co,To,Oo,Pt=(e)=>e,Re=(e)=>Reflect.getPrototypeOf(e),Io,Do,Hn,No,zn,Bo,se=(e)=>Ae(e)?ir(e):e,Te=(e)=>Ae(e)?$t(e):e,mt,qo,Kn=()=>{},Wo,Yn=(e,{value:t,modifiers:r,expression:n,original:i},{effect:a,cleanup:s})=>{if(!t){let l={};Js(l),T(e,n)((d)=>{_n(e,d,i)},{scope:l});return}if(t==="key")return Xo(e,n);if(e._x_inlineBindings&&e._x_inlineBindings[t]&&e._x_inlineBindings[t].extract)return;let o=T(e,n);a(()=>o((l)=>{if(l===void 0&&typeof n==="string"&&n.match(/\./))l="";_(()=>pn(e,t,l,r))})),s(()=>{e._x_undoAddedClasses&&e._x_undoAddedClasses(),e._x_undoAddedStyles&&e._x_undoAddedStyles()})},W,Gn,oa;var Zn=Ci(()=>{z=[];Dr=[],Nr=[],Br=[];Je=new MutationObserver(Ge);Y=[];je=[];Wi={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 Yi;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=Ur(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)}};jr={};Fr=Qi;Ke={};ye=new Map,Jr=Symbol();en=[];G=["ignore","ref","id","data","anchor","bind","init","for","model","modelable","transition","show","if",St,"teleport"];nn=[];Me((e,t)=>{if(Qe===0)return;if(!e||e.nodeType!==1||!t||t.nodeType!==1)return;if(L(e,(r)=>r._x_deferInit))t._x_ignore=!0});Wt=[],an=[];fn=[];Ct=[];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")Os(e,r,t);else Ts(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=bn(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})})})};zs=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"]);H={};wn={};En={};Zs={get reactive(){return ue},get release(){return fe},get effect(){return oe},get raw(){return Lr},get transaction(){return zi},version:"3.17.4",flushAndStopDeferringMutations:Vi,dontAutoEvaluateFunctions:Kr,disableEffectScheduling:$i,startObservingMutations:qt,stopObservingMutations:Hr,setReactivityEngine:Ri,onAttributeRemoved:$r,onAttributesAdded:Pr,closestDataStack:de,skipDuringClone:U,onlyDuringClone:ds,addRootSelector:dn,addInitSelector:un,setErrorHandler:Zi,interceptClone:Me,addScopeToNode:Oe,deferMutations:Ki,mapAttributes:Vt,evaluateLater:T,interceptInit:vs,initInterceptors:Ft,injectMagics:Fe,setEvaluator:es,setRawEvaluator:ts,mergeProxies:ee,extractProp:Fs,findClosest:L,onElRemoved:zt,closestRoot:et,destroyTree:ae,interceptor:qr,transition:Lt,setStyles:tt,mutateDom:_,deferInit:bs,directive:E,entangle:vn,throttle:xn,debounce:yn,evaluate:Z,evaluateRaw:ns,initTree:P,nextTick:Jt,prefixed:he,prefix:is,plugin:Ks,magic:D,store:Vs,start:ys,clone:fs,cloneNode:us,bound:js,$data:zr,watch:Ir,walk:te,data:Gs,bind:Ys},be=Zs,_r=new WeakMap,kn=new Set;Object.getOwnPropertyNames(globalThis).forEach((e)=>{if(e==="styleMedia"||e==="sharedStorage")return;let t;try{t=globalThis[e]}catch{return}kn.add(t)});Qs=["IDENTIFIER","KEYWORD","BOOLEAN","NULL","UNDEFINED"];Pa=Object.freeze({}),$a=Object.freeze([]),ke=Object.assign,oo=Object.prototype.hasOwnProperty,Se=Array.isArray,lo=Object.prototype.toString,co=/-\w/g,Ra=rt((e)=>e.replace(co,(t)=>t.slice(1).toUpperCase())),uo=/\B([A-Z])/g,Ha=rt((e)=>e.replace(uo,"-$1").toLowerCase()),Mn=rt((e)=>e.charAt(0).toUpperCase()+e.slice(1)),za=rt((e)=>e?`on${Mn(e)}`:""),Ua=Cn(fo+",async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");ht=new WeakSet;Nn=[];Nt=new WeakMap,Q=Symbol("Object iterate"),Bt=Symbol("Map keys iterate"),Ce=Symbol("Array iterate");_o={__proto__:null,[Symbol.iterator](){return bt(this,Symbol.iterator,(e)=>N(this,e))},concat(...e){return le(this).concat(...e.map((t)=>Se(t)?le(t):t))},entries(){return bt(this,"entries",(e)=>(e[1]=N(this,e[1]),e))},every(e,t){return R(this,"every",e,t,void 0,arguments)},filter(e,t){return R(this,"filter",e,t,(r)=>r.map((n)=>N(this,n)),arguments)},find(e,t){return R(this,"find",e,t,(r)=>N(this,r),arguments)},findIndex(e,t){return R(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return R(this,"findLast",e,t,(r)=>N(this,r),arguments)},findLastIndex(e,t){return R(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return R(this,"forEach",e,t,void 0,arguments)},includes(...e){return pt(this,"includes",e)},indexOf(...e){return pt(this,"indexOf",e)},join(e){return le(this).join(e)},lastIndexOf(...e){return pt(this,"lastIndexOf",e)},map(e,t){return R(this,"map",e,t,void 0,arguments)},pop(){return ge(this,"pop")},push(...e){return ge(this,"push",e)},reduce(e,...t){return Sr(this,"reduce",e,t)},reduceRight(e,...t){return Sr(this,"reduceRight",e,t)},shift(){return ge(this,"shift")},some(e,t){return R(this,"some",e,t,void 0,arguments)},splice(...e){return ge(this,"splice",e)},toReversed(){return le(this).toReversed()},toSorted(e){return le(this).toSorted(e)},toSpliced(...e){return le(this).toSpliced(...e)},unshift(...e){return ge(this,"unshift",e)},values(){return bt(this,"values",(e)=>N(this,e))}};Eo=Array.prototype;ko=Cn("__proto__,__v_isRef,__isVue"),Pn=new Set(Object.getOwnPropertyNames(Symbol).filter((e)=>e!=="arguments"&&e!=="caller").map((e)=>Symbol[e]).filter(Le));Ao=class extends $n{constructor(e=!1){super(!1,e)}set(e,t,r,n){let i=e[t],a=Se(e)&&Qt(t);if(!this._isShallow){let l=ne(i);if(!ie(r)&&!ne(r))i=w(i),r=w(r);if(!a&&Ee(i)&&!Ee(r))if(l)return re(`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:It(e,t),o=Reflect.set(e,t,r,Ee(e)?e:n);if(e===w(n)&&o){if(!s)F(e,"add",t,r);else if(J(r,i))F(e,"set",t,r,i)}return o}deleteProperty(e,t){let r=It(e,t),n=e[t],i=Reflect.deleteProperty(e,t);if(i&&r)F(e,"delete",t,void 0,n);return i}has(e,t){let r=Reflect.has(e,t);if(!Le(t)||!Pn.has(t))M(e,"has",t);return r}ownKeys(e){return M(e,"iterate",Se(e)?"length":Q),Reflect.ownKeys(e)}},Co=class extends $n{constructor(e=!1){super(!0,e)}set(e,t){return re(`Set operation on key "${String(t)}" failed: target is readonly.`,e),!0}deleteProperty(e,t){return re(`Delete operation on key "${String(t)}" failed: target is readonly.`,e),!0}},To=new Ao,Oo=new Co;Io={get:Rn(!1,!1)},Do={get:Rn(!0,!1)};Hn=new WeakMap,No=new WeakMap,zn=new WeakMap,Bo=new WeakMap;D("nextTick",()=>Jt);D("dispatch",(e)=>xe.bind(xe,e));D("watch",(e,{evaluateLater:t,cleanup:r})=>(n,i)=>{let a=t(n),o=Ir(()=>{let l;return a((c)=>l=c),l},i);r(o)});D("store",Ws);D("data",(e)=>zr(e));D("root",(e)=>et(e));D("refs",(e)=>{if(e._x_refs_proxy)return e._x_refs_proxy;return e._x_refs_proxy=ee(Ro(e)),e._x_refs_proxy});mt={};D("id",(e,{cleanup:t})=>(r,n=null)=>{let i=`${r}${n?`-${n}`:""}`;return Uo(e,i,t,()=>{let a=Ho(e,r),s=a?a._x_ids[r]:jn(r);return n?`${r}-${s}-${n}`:`${r}-${s}`})});Me((e,t)=>{if(e._x_id)t._x_id=e._x_id});D("el",(e)=>e);Fn("Focus","focus","focus");Fn("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=vn({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")B("x-teleport can only be used on a <template> tag",e);let i=Cr(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))})});Oe(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)};_(()=>{U(()=>{s(a,i,t),P(a)})()}),e._x_teleportPutBack=()=>{let o=Cr(r);_(()=>{s(e._x_teleport,o,t)})},n(()=>_(()=>{a.remove(),ae(a)}))});qo=document.createElement("div");Kn.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",Kn);E("effect",U((e,{expression:t},{effect:r})=>{r(T(e,t))}));Wo=["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=L(e,(h)=>h!==e);let s=T(a,r),o;if(typeof r==="string")o=T(a,`${r} = __placeholder`);else if(typeof r==="function"&&typeof r()==="string")o=T(a,`${r()} = __placeholder`);else o=()=>{};let l=()=>{let h;return s((m)=>h=m),Or(h)?h.get():h},c=(h)=>{let m;if(s((g)=>m=g),Or(m))m.set(h);else o(()=>{},{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"),b=d||u||f,p;if(K)p=()=>{};else if(b){let h=[],m=(g)=>c(ze(e,t,g,l()));if(d)h.push(ce(e,"change",t,m));if(u){if(h.push(ce(e,"blur",t,m)),e.form){let g=e.form,S=()=>m({target:e});if(!g._x_pendingModelUpdates)g._x_pendingModelUpdates=[];g._x_pendingModelUpdates.push(S),i(()=>{if(g._x_pendingModelUpdates)g._x_pendingModelUpdates.splice(g._x_pendingModelUpdates.indexOf(S),1)})}}if(f)h.push(ce(e,"keydown",t,(g)=>{if(g.key==="Enter")m(g)}));p=()=>h.forEach((g)=>g())}else{let h=e.tagName.toLowerCase()==="select"||["checkbox","radio"].includes(e.type)?"change":"input";p=ce(e,h,t,(m)=>{c(ze(e,t,m,l()))})}if(t.includes("fill")){if([void 0,null,""].includes(l())||Ve(e)&&Array.isArray(l())||e.tagName.toLowerCase()==="select"&&e.multiple)c(ze(e,t,{target:e},l()))}if(!e._x_removeModelListeners)e._x_removeModelListeners={};if(e._x_removeModelListeners.default=p,i(()=>e._x_removeModelListeners.default()),e.form){let h=ce(e.form,"reset",[],(m)=>{Jt(()=>e._x_model&&e._x_model.set(ze(e,t,{target:e},l())))});i(()=>h())}if(e._x_model={get(){return l()},set(h){c(h)},setWithModifiers:Vn(t,c)},e._x_forceModelUpdate=(h)=>{if(h===void 0&&typeof r==="string"&&r.match(/\./))h="";_(()=>{if(Ve(e))if(Array.isArray(h))e.checked=h.some((m)=>m==e.value);else e.checked=!!h;else if(Zt(e))if(typeof h==="boolean")e.checked=Ue(e.value)===h;else e.checked=e.value==h;else pn(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(he("cloak")))));un(()=>`[${he("init")}]`);E("init",U((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)=>ae(s)),e.innerHTML=a??"",e._x_ignoreSelf=!0,P(e),delete e._x_ignoreSelf})})},{priority:"structural"})});Vt(Xr(":",Zr(he("bind:"))));Yn.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",Yn);dn(()=>`[${he("data")}]`);W=Symbol();E("data",(e,{expression:t},{cleanup:r})=>{if(Qo(e))return;let n=e[W];if(n?.expression===t)return;t=t===""?"{}":t;let i={};Fe(i,e);let a={};Xs(a,i);let s=Z(e,t,{scope:a});if(s===void 0||s===!0)s={};Fe(s,e);let o;if(n?.reactiveData){o=n.reactiveData,Zo(o,s);let c={expression:t};e[W]=c,queueMicrotask(()=>{if(e[W]===c)delete e[W]})}else o=ue(s);Ft(o,r);let l=Oe(e,o);U(()=>{o.init&&Z(e,o.init)})(),r(()=>{o.destroy&&Z(e,o.destroy),l();let c={reactiveData:o};e[W]=c,queueMicrotask(()=>{if(e[W]===c)delete e[W]})})});Me((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=T(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=Mt((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",U((e,{expression:t},{effect:r,cleanup:n})=>{let i=ra(t),a=T(e,i.items),s=T(e,e._x_keyExpression||"index");e._x_lookup=new Map,r(()=>ta(e,i,a,s),{priority:"structural"}),n(()=>{e._x_lookup.forEach((o)=>_(()=>{ae(o),o.remove()})),delete e._x_lookup,delete e._x_lastRenderedEl})}));Jn.inline=(e,{expression:t},{cleanup:r})=>{let n=et(e);if(!n)return;if(!n._x_refs)n._x_refs={};n._x_refs[t]=e,r(()=>delete n._x_refs[t])};E("ref",Jn);E("if",U((e,{expression:t},{effect:r,cleanup:n})=>{if(e.tagName.toLowerCase()!=="template")B("x-if can only be used on a <template> tag",e);let i=T(e,t),a=()=>{if(e._x_currentIfEl)return e._x_currentIfEl;let o=e.content.cloneNode(!0).firstElementChild;return Oe(o,{},e),_(()=>{e.after(o),P(o)}),e._x_currentIfEl=o,e._x_lastRenderedEl=o,e._x_undoIf=()=>{_(()=>{ae(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)=>zo(e,i))});Me((e,t)=>{if(e._x_ids)t._x_ids=e._x_ids});Vt(Xr("@",Zr(he("on:"))));E("on",U((e,{value:t,modifiers:r,expression:n},{cleanup:i})=>{let a=n?T(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=ce(e,t,r,(o)=>{a(()=>{},{scope:{$event:o},params:[o]})});i(()=>s())}));nt("Collapse","collapse","collapse");nt("Intersect","intersect","intersect");nt("Focus","trap","focus");nt("Mask","mask","mask");E("html",(e,{expression:t})=>{Xe(Error("Using the x-html directive is prohibited in the CSP build"),e)});be.setEvaluator(io);be.setRawEvaluator(no);be.setReactivityEngine({reactive:ir,effect:(e,t={})=>{let r;return r=mo(e,{scheduler:()=>{if(!r)return;t.scheduler?t.scheduler(r):r()}}),r},release:go,raw:w});Gn=be,oa=Gn;/*! 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 A("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 A("OPERATOR","===",e,this.position));else if(t==="!"&&r==="="&&n==="=")this.position+=3,this.tokens.push(new A("OPERATOR","!==",e,this.position));else if(t==="="&&r==="=")this.position+=2,this.tokens.push(new A("OPERATOR","==",e,this.position));else if(t==="!"&&r==="=")this.position+=2,this.tokens.push(new A("OPERATOR","!=",e,this.position));else if(t==="<"&&r==="=")this.position+=2,this.tokens.push(new A("OPERATOR","<=",e,this.position));else if(t===">"&&r==="=")this.position+=2,this.tokens.push(new A("OPERATOR",">=",e,this.position));else if(t==="&"&&r==="&")this.position+=2,this.tokens.push(new A("OPERATOR","&&",e,this.position));else if(t==="|"&&r==="|")this.position+=2,this.tokens.push(new A("OPERATOR","||",e,this.position));else if(t==="+"&&r==="+")this.position+=2,this.tokens.push(new A("OPERATOR","++",e,this.position));else if(t==="-"&&r==="-")this.position+=2,this.tokens.push(new A("OPERATOR","--",e,this.position));else{this.position++;let i="()[]{},.;:?".includes(t)?"PUNCTUATION":"OPERATOR";this.tokens.push(new A(i,t,e,this.position))}}},to=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 Qs.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}}},ro=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 m=t[e.name];if(this.checkForDangerousValues(m),typeof m==="function")return m.bind(t);return m}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 o=i[a];if(this.checkForDangerousValues(o),typeof o==="function")if(n)return o.bind(t);else return o.bind(i);return o;case"CallExpression":let s=e.arguments.map((m)=>this.evaluate({node:m,scope:t,context:r,forceBindingRootScopeToFunctions:n})),l;if(e.callee.type==="MemberExpression"){let m=this.evaluate({node:e.callee.object,scope:t,context:r,forceBindingRootScopeToFunctions:n}),g;if(e.callee.computed)g=this.evaluate({node:e.callee.property,scope:t,context:r,forceBindingRootScopeToFunctions:n});else g=e.callee.property.name;this.checkForDangerousKeywords(g);let S=m[g];if(typeof S!=="function")throw Error("Value is not a function");l=S.apply(m,s)}else if(e.callee.type==="Identifier"){let m=e.callee.name,g;if(m in t)g=t[m];else throw Error(`Undefined variable: ${m}`);if(typeof g!=="function")throw Error("Value is not a function");let S=r!==null?r:t;l=g.apply(S,s)}else{let m=this.evaluate({node:e.callee,scope:t,context:r,forceBindingRootScopeToFunctions:n});if(typeof m!=="function")throw Error("Value is not a function");l=m.apply(r,s)}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 m=e.argument.name;if(!(m in t))throw Error(`Undefined variable: ${m}`);let g=t[m];if(e.operator==="++")t[m]=g+1;else if(e.operator==="--")t[m]=g-1;return e.prefix?t[m]:g}else if(e.argument.type==="MemberExpression"){let m=this.evaluate({node:e.argument.object,scope:t,context:r,forceBindingRootScopeToFunctions:n}),g=e.argument.computed?this.evaluate({node:e.argument.property,scope:t,context:r,forceBindingRootScopeToFunctions:n}):e.argument.property.name;if(this.isDOMObject(m))throw Error("Property assignments on DOM objects are prohibited in the CSP build");this.checkForDangerousKeywords(g);let S=m[g];if(e.operator==="++")m[g]=S+1;else if(e.operator==="--")m[g]=S-1;return e.prefix?m[g]:S}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 b=this.evaluate({node:e.right,scope:t,context:r,forceBindingRootScopeToFunctions:n});if(e.left.type==="Identifier")return t[e.left.name]=b,b;else if(e.left.type==="MemberExpression"){let m=this.evaluate({node:e.left.object,scope:t,context:r,forceBindingRootScopeToFunctions:n}),g=e.left.computed?this.evaluate({node:e.left.property,scope:t,context:r,forceBindingRootScopeToFunctions:n}):e.left.property.name;if(this.isDOMObject(m))throw Error("Property assignments on DOM objects are prohibited in the CSP build");return this.checkForDangerousKeywords(g),m[g]=b,b}throw Error("Invalid assignment target");case"ArrayExpression":return e.elements.map((m)=>this.evaluate({node:m,scope:t,context:r,forceBindingRootScopeToFunctions:n}));case"ObjectExpression":let p={};for(let m of e.properties){let g=m.computed?this.evaluate({node:m.key,scope:t,context:r,forceBindingRootScopeToFunctions:n}):m.key.type==="Identifier"?m.key.name:this.evaluate({node:m.key,scope:t,context:r,forceBindingRootScopeToFunctions:n}),S=this.evaluate({node:m.value,scope:t,context:r,forceBindingRootScopeToFunctions:n});p[g]=S}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(Er.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(kn.has(e))throw Error("Accessing global variables is prohibited in the CSP build");return Er.set(e,!0),!0}},Pa,$a,ke,oo,It=(e,t)=>oo.call(e,t),Se,ve=(e)=>Tn(e)==="[object Map]",ao=(e)=>typeof e==="string",Le=(e)=>typeof e==="symbol",Ae=(e)=>e!==null&&typeof e==="object",lo,Tn=(e)=>lo.call(e),Mn=(e)=>Tn(e).slice(8,-1),Qt=(e)=>ao(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,rt=(e)=>{let t=Object.create(null);return(r)=>t[r]||(t[r]=e(r))},co,Ra,uo,Ha,On,za,J=(e,t)=>!Object.is(e,t),fo="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",Ua,ft,v,ht,_r=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,ft)if(ft.active)ft.effects.push(this);else this.flags&=-2}pause(){this.flags|=64}resume(){if(this.flags&64){if(this.flags&=-65,ht.has(this))ht.delete(this),this.trigger()}}notify(){if(this.flags&2&&!(this.flags&32))return;if(!(this.flags&8))ho(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,kr(this),In(this);let e=v,t=I;v=this,I=!0;try{return this.fn()}finally{if(v!==this)re("Active effect was not restored correctly - this is likely a Vue internal bug.");Dn(this),v=e,I=t,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)rr(e);this.deps=this.depsTail=void 0,kr(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){if(this.flags&64)ht.add(this);else if(this.scheduler)this.scheduler();else this.runIfDirty()}runIfDirty(){if(Dt(this))this.run()}get dirty(){return Dt(this)}},Ln=0,we,Ee,I=!0,Bn,We=0,vo=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}},wo=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||!I||v===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==v){if(t=this.activeLink=new vo(v,this),!v.deps)v.deps=v.depsTail=t;else t.prevDep=v.depsTail,v.depsTail.nextDep=t,v.depsTail=t;Nn(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(ke({effect:v},e));return t}trigger(e){this.version++,We++,this.notify(e)}notify(e){er();try{for(let t=this.subsHead;t;t=t.nextSub)if(t.sub.onTrigger&&!(t.sub.flags&8))t.sub.onTrigger(ke({effect:t.sub},e));for(let t=this.subs;t;t=t.prevSub)if(t.sub.notify())t.sub.dep.notify()}finally{tr()}}},Bt,Q,Nt,Ce,Eo,_o,ko,Pn,$n=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?No:zn:i?Bo:Hn).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(r))return e;return}let a=Se(e);if(!n){let s;if(a&&(s=Eo[t]))return s;if(t==="hasOwnProperty")return So}let o=Reflect.get(e,t,_e(e)?e:r);if(Le(t)?Pn.has(t):ko(t))return o;if(!n)O(e,"get",t);if(i)return o;if(_e(o)){let s=a&&Qt(t)?o:o.value;return n&&Ae(s)?$t(s):s}if(Ae(o))return n?$t(o):ir(o);return o}},Ao,Co,To,Mo,Pt=(e)=>e,Re=(e)=>Reflect.getPrototypeOf(e),Io,Do,Hn,Bo,zn,No,se=(e)=>Ae(e)?ir(e):e,Te=(e)=>Ae(e)?$t(e):e,mt,qo,Fn=()=>{},Wo,Yn=(e,{value:t,modifiers:r,expression:n,original:i},{effect:a,cleanup:o})=>{if(!t){let l={};Js(l),T(e,n)((d)=>{En(e,d,i)},{scope:l});return}if(t==="key")return Xo(e,n);if(e._x_inlineBindings&&e._x_inlineBindings[t]&&e._x_inlineBindings[t].extract)return;let s=T(e,n);a(()=>s((l)=>{if(l===void 0&&typeof n==="string"&&n.match(/\./))l="";E(()=>bn(e,t,l,r))})),o(()=>{e._x_undoAddedClasses&&e._x_undoAddedClasses(),e._x_undoAddedStyles&&e._x_undoAddedStyles()})},W,Gn,oa;var Zn=Ci(()=>{z=[];Dr=[],Br=[],Nr=[];Je=new MutationObserver(Ge);Y=[];je=[];Wi={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 Yi;return Reflect.get(e.find((n)=>Reflect.has(n,t))||{},t,r)},set({objects:e},t,r,n){let i;for(let o of e)if(i=Ur(o,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)}};jr={};Kr=Qi;Fe={};ye=new Map,Jr=Symbol();en=[];G=["ignore","ref","id","data","anchor","bind","init","for","model","modelable","transition","show","if",St,"teleport"];nn=[];Oe((e,t)=>{if(Qe===0)return;if(!e||e.nodeType!==1||!t||t.nodeType!==1)return;if(L(e,(r)=>r._x_deferInit))t._x_ignore=!0});Wt=[],an=[];fn=[];Ct=[];_("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")Ms(e,r,t);else Ts(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((o,s)=>{e._x_transition.out(()=>{},()=>o(n)),e._x_transitioning&&e._x_transitioning.beforeCancel(()=>s({isFromCancelledTransition:!0}))}):Promise.resolve(n),queueMicrotask(()=>{let o=pn(e);if(o){if(!o._x_hideChildren)o._x_hideChildren=[];o._x_hideChildren.push(e)}else i(()=>{let s=(l)=>{let c=Promise.all([l._x_hidePromise,...(l._x_hideChildren||[]).map(s)]).then(([d])=>d?.());return delete l._x_hidePromise,delete l._x_hideChildren,c};s(e).catch((l)=>{if(!l.isFromCancelledTransition)throw l})})})};zs=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"]);H={};wn={};_n={};Zs={get reactive(){return ue},get release(){return fe},get effect(){return oe},get raw(){return Lr},get transaction(){return zi},version:"3.17.4",flushAndStopDeferringMutations:Vi,dontAutoEvaluateFunctions:Fr,disableEffectScheduling:$i,startObservingMutations:qt,stopObservingMutations:Hr,setReactivityEngine:Ri,onAttributeRemoved:$r,onAttributesAdded:Pr,closestDataStack:de,skipDuringClone:U,onlyDuringClone:ds,addRootSelector:dn,addInitSelector:un,setErrorHandler:Zi,interceptClone:Oe,addScopeToNode:Me,deferMutations:Fi,mapAttributes:Vt,evaluateLater:T,interceptInit:vs,initInterceptors:Kt,injectMagics:Ke,setEvaluator:es,setRawEvaluator:ts,mergeProxies:ee,extractProp:Ks,findClosest:L,onElRemoved:zt,closestRoot:et,destroyTree:ae,interceptor:qr,transition:Lt,setStyles:tt,mutateDom:E,deferInit:ps,directive:_,entangle:vn,throttle:xn,debounce:yn,evaluate:Z,evaluateRaw:ns,initTree:P,nextTick:Jt,prefixed:he,prefix:is,plugin:Fs,magic:D,store:Vs,start:ys,clone:fs,cloneNode:us,bound:js,$data:zr,watch:Ir,walk:te,data:Gs,bind:Ys},pe=Zs,Er=new WeakMap,kn=new Set;Object.getOwnPropertyNames(globalThis).forEach((e)=>{if(e==="styleMedia"||e==="sharedStorage")return;let t;try{t=globalThis[e]}catch{return}kn.add(t)});Qs=["IDENTIFIER","KEYWORD","BOOLEAN","NULL","UNDEFINED"];Pa=Object.freeze({}),$a=Object.freeze([]),ke=Object.assign,oo=Object.prototype.hasOwnProperty,Se=Array.isArray,lo=Object.prototype.toString,co=/-\w/g,Ra=rt((e)=>e.replace(co,(t)=>t.slice(1).toUpperCase())),uo=/\B([A-Z])/g,Ha=rt((e)=>e.replace(uo,"-$1").toLowerCase()),On=rt((e)=>e.charAt(0).toUpperCase()+e.slice(1)),za=rt((e)=>e?`on${On(e)}`:""),Ua=Cn(fo+",async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");ht=new WeakSet;Bn=[];Bt=new WeakMap,Q=Symbol("Object iterate"),Nt=Symbol("Map keys iterate"),Ce=Symbol("Array iterate");Eo={__proto__:null,[Symbol.iterator](){return pt(this,Symbol.iterator,(e)=>B(this,e))},concat(...e){return le(this).concat(...e.map((t)=>Se(t)?le(t):t))},entries(){return pt(this,"entries",(e)=>(e[1]=B(this,e[1]),e))},every(e,t){return R(this,"every",e,t,void 0,arguments)},filter(e,t){return R(this,"filter",e,t,(r)=>r.map((n)=>B(this,n)),arguments)},find(e,t){return R(this,"find",e,t,(r)=>B(this,r),arguments)},findIndex(e,t){return R(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return R(this,"findLast",e,t,(r)=>B(this,r),arguments)},findLastIndex(e,t){return R(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return R(this,"forEach",e,t,void 0,arguments)},includes(...e){return bt(this,"includes",e)},indexOf(...e){return bt(this,"indexOf",e)},join(e){return le(this).join(e)},lastIndexOf(...e){return bt(this,"lastIndexOf",e)},map(e,t){return R(this,"map",e,t,void 0,arguments)},pop(){return ge(this,"pop")},push(...e){return ge(this,"push",e)},reduce(e,...t){return Sr(this,"reduce",e,t)},reduceRight(e,...t){return Sr(this,"reduceRight",e,t)},shift(){return ge(this,"shift")},some(e,t){return R(this,"some",e,t,void 0,arguments)},splice(...e){return ge(this,"splice",e)},toReversed(){return le(this).toReversed()},toSorted(e){return le(this).toSorted(e)},toSpliced(...e){return le(this).toSpliced(...e)},unshift(...e){return ge(this,"unshift",e)},values(){return pt(this,"values",(e)=>B(this,e))}};_o=Array.prototype;ko=Cn("__proto__,__v_isRef,__isVue"),Pn=new Set(Object.getOwnPropertyNames(Symbol).filter((e)=>e!=="arguments"&&e!=="caller").map((e)=>Symbol[e]).filter(Le));Ao=class extends $n{constructor(e=!1){super(!1,e)}set(e,t,r,n){let i=e[t],a=Se(e)&&Qt(t);if(!this._isShallow){let l=ne(i);if(!ie(r)&&!ne(r))i=w(i),r=w(r);if(!a&&_e(i)&&!_e(r))if(l)return re(`Set operation on key "${String(t)}" failed: target is readonly.`,e[t]),!0;else return i.value=r,!0}let o=a?Number(t)<e.length:It(e,t),s=Reflect.set(e,t,r,_e(e)?e:n);if(e===w(n)&&s){if(!o)K(e,"add",t,r);else if(J(r,i))K(e,"set",t,r,i)}return s}deleteProperty(e,t){let r=It(e,t),n=e[t],i=Reflect.deleteProperty(e,t);if(i&&r)K(e,"delete",t,void 0,n);return i}has(e,t){let r=Reflect.has(e,t);if(!Le(t)||!Pn.has(t))O(e,"has",t);return r}ownKeys(e){return O(e,"iterate",Se(e)?"length":Q),Reflect.ownKeys(e)}},Co=class extends $n{constructor(e=!1){super(!0,e)}set(e,t){return re(`Set operation on key "${String(t)}" failed: target is readonly.`,e),!0}deleteProperty(e,t){return re(`Delete operation on key "${String(t)}" failed: target is readonly.`,e),!0}},To=new Ao,Mo=new Co;Io={get:Rn(!1,!1)},Do={get:Rn(!0,!1)};Hn=new WeakMap,Bo=new WeakMap,zn=new WeakMap,No=new WeakMap;D("nextTick",()=>Jt);D("dispatch",(e)=>xe.bind(xe,e));D("watch",(e,{evaluateLater:t,cleanup:r})=>(n,i)=>{let a=t(n),s=Ir(()=>{let l;return a((c)=>l=c),l},i);r(s)});D("store",Ws);D("data",(e)=>zr(e));D("root",(e)=>et(e));D("refs",(e)=>{if(e._x_refs_proxy)return e._x_refs_proxy;return e._x_refs_proxy=ee(Ro(e)),e._x_refs_proxy});mt={};D("id",(e,{cleanup:t})=>(r,n=null)=>{let i=`${r}${n?`-${n}`:""}`;return Uo(e,i,t,()=>{let a=Ho(e,r),o=a?a._x_ids[r]:jn(r);return n?`${r}-${o}-${n}`:`${r}-${o}`})});Oe((e,t)=>{if(e._x_id)t._x_id=e._x_id});D("el",(e)=>e);Kn("Focus","focus","focus");Kn("Persist","persist","persist");_("modelable",(e,{expression:t},{effect:r,evaluateLater:n,cleanup:i})=>{let a=n(t),o=()=>{let d;return a((u)=>d=u),d},s=n(`${t} = __placeholder`),l=(d)=>s(()=>{},{scope:{__placeholder:d}}),c=o();l(c),queueMicrotask(()=>{if(!e._x_model)return;e._x_removeModelListeners.default();let d=e._x_model.get,u=e._x_model.setWithModifiers,f=vn({get(){return d()},set(h){u(h)}},{get(){return o()},set(h){l(h)}});i(f)})});_("teleport",(e,{modifiers:t,expression:r},{cleanup:n})=>{if(e.tagName.toLowerCase()!=="template")N("x-teleport can only be used on a <template> tag",e);let i=Cr(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((s)=>{a.addEventListener(s,(l)=>{l.stopPropagation(),e.dispatchEvent(new l.constructor(l.type,l))})});Me(a,{},e);let o=(s,l,c)=>{if(c.includes("prepend"))l.parentNode.insertBefore(s,l);else if(c.includes("append"))l.parentNode.insertBefore(s,l.nextSibling);else l.appendChild(s)};E(()=>{U(()=>{o(a,i,t),P(a)})()}),e._x_teleportPutBack=()=>{let s=Cr(r);E(()=>{o(e._x_teleport,s,t)})},n(()=>E(()=>{a.remove(),ae(a)}))});qo=document.createElement("div");Fn.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})};_("ignore",Fn);_("effect",U((e,{expression:t},{effect:r})=>{r(T(e,t))}));Wo=["window","document","prevent","stop","once","capture","self","away","outside","passive","dot","camel","preserve-scroll","blur","change","lazy","number","boolean","trim","fill","unintrusive","parent"];_("model",(e,{modifiers:t,expression:r},{effect:n,cleanup:i})=>{let a=e;if(t.includes("parent"))a=L(e,(p)=>p!==e);let o=T(a,r),s;if(typeof r==="string")s=T(a,`${r} = __placeholder`);else if(typeof r==="function"&&typeof r()==="string")s=T(a,`${r()} = __placeholder`);else s=()=>{};let l=()=>{let p;return o((m)=>p=m),Mr(p)?p.get():p},c=(p)=>{let m;if(o((g)=>m=g),Mr(m))m.set(p);else s(()=>{},{scope:{__placeholder:p}})};if(typeof r==="string"&&e.type==="radio")E(()=>{if(!e.hasAttribute("name"))e.setAttribute("name",r)});let d=t.includes("change")||t.includes("lazy"),u=t.includes("blur"),f=t.includes("enter"),h=d||u||f,b;if(F)b=()=>{};else if(h){let p=[],m=(g)=>c(ze(e,t,g,l()));if(d)p.push(ce(e,"change",t,m));if(u){if(p.push(ce(e,"blur",t,m)),e.form){let g=e.form,S=()=>m({target:e});if(!g._x_pendingModelUpdates)g._x_pendingModelUpdates=[];g._x_pendingModelUpdates.push(S),i(()=>{if(g._x_pendingModelUpdates)g._x_pendingModelUpdates.splice(g._x_pendingModelUpdates.indexOf(S),1)})}}if(f)p.push(ce(e,"keydown",t,(g)=>{if(g.key==="Enter")m(g)}));b=()=>p.forEach((g)=>g())}else{let p=e.tagName.toLowerCase()==="select"||["checkbox","radio"].includes(e.type)?"change":"input";b=ce(e,p,t,(m)=>{c(ze(e,t,m,l()))})}if(t.includes("fill")){if([void 0,null,""].includes(l())||Ve(e)&&Array.isArray(l())||e.tagName.toLowerCase()==="select"&&e.multiple)c(ze(e,t,{target:e},l()))}if(!e._x_removeModelListeners)e._x_removeModelListeners={};if(e._x_removeModelListeners.default=b,i(()=>e._x_removeModelListeners.default()),e.form){let p=ce(e.form,"reset",[],(m)=>{Jt(()=>e._x_model&&e._x_model.set(ze(e,t,{target:e},l())))});i(()=>p())}if(e._x_model={get(){return l()},set(p){c(p)},setWithModifiers:Vn(t,c)},e._x_forceModelUpdate=(p)=>{if(p===void 0&&typeof r==="string"&&r.match(/\./))p="";E(()=>{if(Ve(e))if(Array.isArray(p))e.checked=p.some((m)=>m==e.value);else e.checked=!!p;else if(Zt(e))if(typeof p==="boolean")e.checked=Ue(e.value)===p;else e.checked=e.value==p;else bn(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)})});_("cloak",(e)=>queueMicrotask(()=>E(()=>e.removeAttribute(he("cloak")))));un(()=>`[${he("init")}]`);_("init",U((e,{expression:t},{evaluate:r})=>{if(typeof t==="string")return!!t.trim()&&r(t,{},!1);return r(t,{},!1)}));_("text",(e,{expression:t},{effect:r,evaluateLater:n})=>{let i=n(t);r(()=>{i((a)=>{E(()=>{e.textContent=a})})})});_("html",(e,{expression:t},{effect:r,evaluateLater:n})=>{let i=n(t);r(()=>{i((a)=>{E(()=>{Array.from(e.children).forEach((o)=>ae(o)),e.innerHTML=a??"",e._x_ignoreSelf=!0,P(e),delete e._x_ignoreSelf})})},{priority:"structural"})});Vt(Xr(":",Zr(he("bind:"))));Yn.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}};_("bind",Yn);dn(()=>`[${he("data")}]`);W=Symbol();_("data",(e,{expression:t},{cleanup:r})=>{if(Qo(e))return;let n=e[W];if(n?.expression===t)return;t=t===""?"{}":t;let i={};Ke(i,e);let a={};Xs(a,i);let o=Z(e,t,{scope:a});if(o===void 0||o===!0)o={};Ke(o,e);let s;if(n?.reactiveData){s=n.reactiveData,Zo(s,o);let c={expression:t};e[W]=c,queueMicrotask(()=>{if(e[W]===c)delete e[W]})}else s=ue(o);Kt(s,r);let l=Me(e,s);U(()=>{s.init&&Z(e,s.init)})(),r(()=>{s.destroy&&Z(e,s.destroy),l();let c={reactiveData:s};e[W]=c,queueMicrotask(()=>{if(e[W]===c)delete e[W]})})});Oe((e,t)=>{if(e._x_dataStack)t._x_dataStack=e._x_dataStack,t.setAttribute("data-has-alpine-state",!0)});_("show",(e,{modifiers:t,expression:r},{effect:n})=>{let i=T(e,r);if(!e._x_doHide)e._x_doHide=()=>{E(()=>{e.style.setProperty("display","none",t.includes("important")?"important":void 0)})};if(!e._x_doShow)e._x_doShow=()=>{E(()=>{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},o=()=>{e._x_doShow(),e._x_isShown=!0},s=()=>setTimeout(o),l=Ot((u)=>u?o():a(),(u)=>{if(typeof e._x_toggleAndCascadeWithTransitions==="function")e._x_toggleAndCascadeWithTransitions(e,u,o,a);else u?s():a()}),c,d=!0;n(()=>i((u)=>{if(!d&&u===c)return;if(t.includes("immediate"))u?s():a();l(u),c=u,d=!1}))});_("for",U((e,{expression:t},{effect:r,cleanup:n})=>{let i=ra(t),a=T(e,i.items),o=T(e,e._x_keyExpression||"index");e._x_lookup=new Map,r(()=>ta(e,i,a,o),{priority:"structural"}),n(()=>{e._x_lookup.forEach((s)=>E(()=>{ae(s),s.remove()})),delete e._x_lookup,delete e._x_lastRenderedEl})}));Jn.inline=(e,{expression:t},{cleanup:r})=>{let n=et(e);if(!n)return;if(!n._x_refs)n._x_refs={};n._x_refs[t]=e,r(()=>delete n._x_refs[t])};_("ref",Jn);_("if",U((e,{expression:t},{effect:r,cleanup:n})=>{if(e.tagName.toLowerCase()!=="template")N("x-if can only be used on a <template> tag",e);let i=T(e,t),a=()=>{if(e._x_currentIfEl)return e._x_currentIfEl;let s=e.content.cloneNode(!0).firstElementChild;return Me(s,{},e),E(()=>{e.after(s),P(s)}),e._x_currentIfEl=s,e._x_lastRenderedEl=s,e._x_undoIf=()=>{E(()=>{ae(s),s.remove()}),delete e._x_currentIfEl,delete e._x_lastRenderedEl},s},o=()=>{if(!e._x_undoIf)return;e._x_undoIf(),delete e._x_undoIf};r(()=>i((s)=>{s?a():o()}),{priority:"structural"}),n(()=>e._x_undoIf&&e._x_undoIf())}));_("id",(e,{expression:t},{evaluate:r})=>{r(t).forEach((i)=>zo(e,i))});Oe((e,t)=>{if(e._x_ids)t._x_ids=e._x_ids});Vt(Xr("@",Zr(he("on:"))));_("on",U((e,{value:t,modifiers:r,expression:n},{cleanup:i})=>{let a=n?T(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 o=ce(e,t,r,(s)=>{a(()=>{},{scope:{$event:s},params:[s]})});i(()=>o())}));nt("Collapse","collapse","collapse");nt("Intersect","intersect","intersect");nt("Focus","trap","focus");nt("Mask","mask","mask");_("html",(e,{expression:t})=>{Xe(Error("Using the x-html directive is prohibited in the CSP build"),e)});pe.setEvaluator(io);pe.setRawEvaluator(no);pe.setReactivityEngine({reactive:ir,effect:(e,t={})=>{let r;return r=mo(e,{scheduler:()=>{if(!r)return;t.scheduler?t.scheduler(r):r()}}),r},release:go,raw:w});Gn=pe,oa=Gn;/*! 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 Pe=typeof HTMLElement==="function"?HTMLElement:class{};function pr(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 mr(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 Ti=Symbol.for("bare-v3.styles");function $e(e,t,r){if(!e?.head||e.getElementById(t))return;let n=e[Ti]??=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 Ie=null;function Qn(){if(Ie)return Ie;let e=(Zn(),Ei(Xn)).default;return e.prefix("b3x-"),e.setErrorHandler((t,r,n)=>{console.warn(`bare-v3: component template error${n?` in "${n}"`:""}`,t,r)}),Ie=e}var ei=(e)=>Qn().reactive(e),sr=(e)=>Ie?Ie.raw(e):e;function ti(e,t,r){let n=Qn(),i=n.reactive(r);return e.innerHTML=t,n.addScopeToNode(e,i),n.initTree(e),i}function aa(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((p)=>{if(!a.isConnected||p.some(({target:h})=>s.contains(h)&&!d.contains(h)))f()});function f(){if(!a)return;n.clearTimeout(c),u.disconnect();let p=a.dataset.b3Confirm;if(l&&p&&a.textContent===p)a.replaceChildren(...l);a.removeAttribute("data-b3-armed"),a=s=l=null,d.textContent=""}function b(p){if(!d?.isConnected)d=r.createElement("span"),d.className="b3-visually-hidden",d.setAttribute("role","status"),r.body.append(d);let h=d;a=p,o=n.performance.now(),s=p.parentElement.closest("li, tr, article, [data-id], .b3-row, .b3-card")||p.parentElement;let m=p.dataset.b3Confirm;if(m)l=[...p.childNodes],p.replaceChildren(m);p.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===p)h.textContent=m||"Press again to confirm"})}e.addEventListener("click",(p)=>{let h=p.target.closest?.("[data-b3-confirm]");if(a&&h!==a)f();if(!h||h.disabled||!e.contains(h))return;if(h===a&&n.performance.now()-o>=350)return f();if(p.preventDefault(),p.stopImmediatePropagation(),h!==a)b(h)},{...i,capture:!0}),e.addEventListener("focusout",({target:p})=>{if(p===a)n.queueMicrotask(()=>p===a&&f())},i),e.addEventListener("keydown",(p)=>{let h=p;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 ri=Symbol.for("bare-v3.confirm");function ni(){if(typeof document>"u"||!document.defaultView?.MutationObserver)return;let e=document;if(e[ri])return;e[ri]=!0,aa(document)}var pe=1.001,la=320,ca=30,da=350,ua="b3-image-viewer-style",fa=`
22
+ */});var Pe=typeof HTMLElement==="function"?HTMLElement:class{};function br(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 mr(e,t,r={},n=[]){let i=()=>{for(let o of n)if(!e.classList.contains(o))e.classList.add(o);for(let[o,s]of Object.entries(r))if(!e.hasAttribute(o))e.setAttribute(o,s)};i();let a=new MutationObserver(i);a.observe(e,{attributes:!0,attributeFilter:["class",...Object.keys(r)]}),t.addEventListener("abort",()=>a.disconnect(),{once:!0})}var Ti=Symbol.for("bare-v3.styles");function $e(e,t,r){if(!e?.head||e.getElementById(t))return;let n=e[Ti]??=new Set;if(n.has(t))return;let i=e.defaultView;if(i&&"adoptedStyleSheets"in e&&"replaceSync"in i.CSSStyleSheet.prototype){let o=new i.CSSStyleSheet;o.replaceSync(r),e.adoptedStyleSheets=[...e.adoptedStyleSheets,o],n.add(t);return}let a=e.createElement("style");a.id=t,a.textContent=r,e.head.append(a)}var Ie=null;function Qn(){if(Ie)return Ie;let e=(Zn(),_i(Xn)).default;return e.prefix("b3x-"),e.setErrorHandler((t,r,n)=>{console.warn(`bare-v3: component template error${n?` in "${n}"`:""}`,t,r)}),Ie=e}var ei=(e)=>Qn().reactive(e),sr=(e)=>Ie?Ie.raw(e):e;function ti(e,t,r){let n=Qn(),i=n.reactive(r);return e.innerHTML=t,n.addScopeToNode(e,i),n.initTree(e),i}function aa(e,t){let r=e.ownerDocument||e,n=r.defaultView,i={signal:t},a=null,o=null,s=0,l=null,c=0,d=null,u=new n.MutationObserver((b)=>{if(!a.isConnected||b.some(({target:p})=>o.contains(p)&&!d.contains(p)))f()});function f(){if(!a)return;n.clearTimeout(c),u.disconnect();let b=a.dataset.b3Confirm;if(l&&b&&a.textContent===b)a.replaceChildren(...l);a.removeAttribute("data-b3-armed"),a=o=l=null,d.textContent=""}function h(b){if(!d?.isConnected)d=r.createElement("span"),d.className="b3-visually-hidden",d.setAttribute("role","status"),r.body.append(d);let p=d;a=b,s=n.performance.now(),o=b.parentElement.closest("li, tr, article, [data-id], .b3-row, .b3-card")||b.parentElement;let m=b.dataset.b3Confirm;if(m)l=[...b.childNodes],b.replaceChildren(m);b.setAttribute("data-b3-armed",""),u.observe(e,{childList:!0,subtree:!0}),u.observe(o,{childList:!0,subtree:!0,attributes:!0,characterData:!0}),c=n.setTimeout(f,4000),n.requestAnimationFrame(()=>{if(a===b)p.textContent=m||"Press again to confirm"})}e.addEventListener("click",(b)=>{let p=b.target.closest?.("[data-b3-confirm]");if(a&&p!==a)f();if(!p||p.disabled||!e.contains(p))return;if(p===a&&n.performance.now()-s>=350)return f();if(b.preventDefault(),b.stopImmediatePropagation(),p!==a)h(p)},{...i,capture:!0}),e.addEventListener("focusout",({target:b})=>{if(b===a)n.queueMicrotask(()=>b===a&&f())},i),e.addEventListener("keydown",(b)=>{let p=b;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 ri=Symbol.for("bare-v3.confirm");function ni(){if(typeof document>"u"||!document.defaultView?.MutationObserver)return;let e=document;if(e[ri])return;e[ri]=!0,aa(document)}var be=1.001,la=320,ca=30,da=350,ua="b3-image-viewer-style",fa=`
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 or extends Pe{static observedAttributes=["src","alt","max-scale","open"];#t=1;#e=0;#n=0;#l=!1;#o=null;#i=new Map;#c=!1;#m=0;#r=0;#g=0;#v=0;#S=!1;#w=null;#y=null;#A=new WeakSet;#d=null;get scale(){return this.#t}get fitted(){return this.#t<=pe}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.#S)return;if(this.#S=!0,$e(this.ownerDocument,ua,fa),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.#y=new MutationObserver(()=>{this.#C(),this.#s()}),this.#y.observe(this,{childList:!0}),this.#C(),this.#s()}disconnectedCallback(){this.#w?.abort(),this.#w=null,this.#y?.disconnect(),this.#y=null;for(let e of this.#i.keys())if(this.hasPointerCapture?.(e))this.releasePointerCapture(e);this.#i.clear(),this.#o=null,this.#c=!1,this.#S=!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.#C(),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.#a(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")}#a(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.#b(e)),e.complete&&e.naturalWidth===0&&e.getAttribute("src"))setTimeout(()=>{if(e.isConnected&&e.complete&&e.naturalWidth===0)this.#b(e)},0)}#b(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}}))}#C(){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}}#f(e){if(this.#t<=pe&&!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))}#s(e){let t=e?.element??this.#h();if(!t)return;let r=this.#t<=pe,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}#k(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.#f(n),this.#s(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.#f(t);if(this.#s(t),e)this.#T()}zoomTo(e){let t=this.#u();if(t)this.#k(e,t.vw/2,t.vh/2,t)}requestClose(){this.dispatchEvent(new CustomEvent("b3-close",{bubbles:!0,composed:!0,detail:{src:this.src}}))}#O(){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}}#x(){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.#o=this.#u(),this.#i.size>1||this.#t>pe||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<=pe&&!this.#l){this.#i.set(n.pointerId,{x:n.clientX,y:n.clientY});return}if(this.#o??=this.#u(),!this.#o)return;n.preventDefault();let a=this.#O(),s=i?this.#x():0;this.#i.set(n.pointerId,{x:n.clientX,y:n.clientY});let o=this.#O(),l=i?this.#x():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.#f(this.#o),this.#s(this.#o),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.#o=this.#u();return}if(this.#o=null,this.#c){this.#m=performance.now(),this.#c=!1;return}if(n.type!=="pointerup")return;let i=performance.now(),a=Math.hypot(n.clientX-this.#g,n.clientY-this.#v)<ca;if(i-this.#r<la&&a){this.#r=0;let s=this.getBoundingClientRect();this.#k(this.#t>pe?1:2.5,n.clientX-s.left,n.clientY-s.top),this.#m=i}else this.#r=i,this.#g=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.#m<da){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.#k(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.#f(a),this.#n===s)return;n.preventDefault(),this.#s(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.#f(l),this.#s(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.#f(n),this.#s(n)},e)}}var ii=or;function ar(e="b3-image-viewer"){if(typeof customElements>"u")return null;let t=customElements.get?.(e);if(t)return t;let r=ii;return ii=class extends or{},customElements.define(e,r),r}ar();var ha=/(^|\s)([#@][\p{L}\p{N}_-]+)/gu,ba=/(?:\s+(?!#\d+(?:\s|$))[#@][\p{L}\p{N}_-]+)+\s*$/u,pa=350,Ne=()=>globalThis.crypto?.randomUUID?.()??Math.random().toString(36).slice(2,11),lr=(e)=>JSON.parse(JSON.stringify(sr(e))),x=(e,t)=>e!=null&&String(e)===String(t),it=(e)=>!!e&&typeof e==="object",C=(e)=>Array.isArray(e.subtasks)?e.subtasks:[],V=(e)=>Array.isArray(e.comments)?e.comments:[];function ma(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 hi=(e)=>[...e.filter((t)=>t.starred),...e.filter((t)=>!t.starred)];function cr(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=Ne();t.add(String(n.id))};return e.filter(it).map((n)=>{r(n),n.cards=hi(Array.isArray(n.cards)?n.cards.filter(it):[]);for(let i of n.cards){if(r(i),Array.isArray(i.subtasks)){for(let a of i.subtasks)if(it(a))r(a)}if(Array.isArray(i.comments)){for(let a of i.comments)if(it(a))r(a)}}return n})}function si(e,{field:t,id:r}){if(t==="name"){let n=e.findIndex((i)=>x(i.id,r));if(n>=0)e.splice(n,1);return}for(let n of e){let i=n.cards.findIndex((a)=>x(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=C(a),o=s.findIndex((l)=>x(l.id,r));if(o>=0)return void s.splice(o,1)}}}function ga(e,t,r){let{field:n,id:i}=r,a=(s,o,l)=>s.splice(Math.min(l,s.length),0,sr(o));if(n==="name"){let s=e.findIndex((o)=>x(o.id,i));if(s>=0&&!t.some((o)=>x(o.id,i)))a(t,e[s],s);return}for(let s of e){let o=s.cards.findIndex((l)=>x(l.id,i));if(n==="title"&&o>=0){let l=t.find((c)=>x(c.id,s.id));if(l&&!l.cards.some((c)=>x(c.id,i)))a(l.cards,s.cards[o],o);return}if(n==="subtask")for(let l of s.cards){let c=C(l).findIndex((u)=>x(u.id,i));if(c<0)continue;let d=t.flatMap((u)=>u.cards).find((u)=>x(u.id,l.id));if(d&&!C(d).some((u)=>x(u.id,i))){if(!Array.isArray(d.subtasks))d.subtasks=[];a(d.subtasks,C(l)[c],c)}return}}}var bi=(e)=>e.toLowerCase().split(/\s+/).filter(Boolean);function ya(e){return[e.title??"",e.description??"",...C(e).map((t)=>t.title??""),...at(e),...V(e).map((t)=>t.text??"")].join(`
42
- `).toLowerCase()}var oi=(e,t)=>{let r=String(t.text??"").toLowerCase();return bi(e).some((n)=>r.includes(n))},xa=/^#\d+$/;function at(e){let t=new Set((e.tags??[]).map((n)=>(/^[#@]/.test(n)?n:`#${n}`).toLowerCase())),r=[e.title??"",e.description??"",...C(e).map((n)=>n.title??"")].join(`
43
- `);for(let[,,n]of r.matchAll(ha))t.add(n.toLowerCase());return[...t].filter((n)=>!xa.test(n))}var ai=String.raw`(<[^<>\n]+>|(?:[^()\n]|\([^()\n]*\))+)`,va=new RegExp(String.raw`!\[([^\]\n]*)\]\(${ai}\)|\[([^\]\n]+)\]\(${ai}\)|\[([^[\]\s]*\/[^[\]\s]*\.[a-z][a-z\d]{0,7}|[^[\]\s\/]+\.(?:md|markdown|txt|json|ya?ml|csv|log|pdf|png|jpe?g|gif|webp|svg|html|kanban))\](?![(\[])|\bhttps?:\/\/[^\s<>]+`,"giu"),wa=new Set(["javascript","data","vbscript","file","blob","about"]),_a=(e)=>{let t=e.trim();return t.startsWith("<")&&t.endsWith(">")?t.slice(1,-1):t.replace(/\s+"[^"\n]*"$/,"")};function Ea(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!wa.has(r)&&t.includes(r)?{href:e,file:!1}:null;return e.startsWith("//")?null:{href:e,file:!0}}var li=(e)=>(e??"").toLowerCase().split(/[\s,]+/).map((t)=>t.replace(/:$/,"")).filter(Boolean),ci=(e)=>(e??"").toLowerCase().split(",").map((t)=>t.trim()).filter(Boolean),dr=(e,t)=>!!t&&e.includes(String(t.name??"").trim().toLowerCase());function fr(e,t=[]){let r=[],n=0;for(let i of e.matchAll(va)){let a=i[2]!==void 0,[s]=i,o=a?i[1]:i[3]??i[5],l=a?i[2]:i[4]??i[5],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=_a(l);let d=Ea(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 di=(e,t=[])=>fr(e,t).map((r)=>typeof r==="string"?r:r.text).join(""),ur=null;function ka(e,t,r=[]){let n=e.ownerDocument;e.replaceChildren(...fr(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="",!ur){let s=n.createElement("template");s.innerHTML=Ta,ur=s.content.firstElementChild}a.append(ur.cloneNode(!0))}else if(/^https?:/i.test(i.href))a.target="_blank",a.rel="noopener noreferrer";return a.append(i.text),a}))}var Sa="b3-board-style",Aa=`
41
+ `;class or extends Pe{static observedAttributes=["src","alt","max-scale","open"];#t=1;#e=0;#n=0;#c=!1;#o=null;#i=new Map;#d=!1;#g=0;#r=0;#y=0;#w=0;#A=!1;#E=null;#x=null;#C=new WeakSet;#l=null;get scale(){return this.#t}get fitted(){return this.#t<=be}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.#A)return;if(this.#A=!0,$e(this.ownerDocument,ua,fa),this.classList.add("b3-image-viewer"),!this.hasAttribute("tabindex"))this.tabIndex=0;if(!this.hasAttribute("role"))this.setAttribute("role","group");this.#k(),this.#_(),this.#D(),this.#x=new MutationObserver(()=>{this.#T(),this.#s()}),this.#x.observe(this,{childList:!0}),this.#T(),this.#s()}disconnectedCallback(){this.#E?.abort(),this.#E=null,this.#x?.disconnect(),this.#x=null;for(let e of this.#i.keys())if(this.hasPointerCapture?.(e))this.releasePointerCapture(e);this.#i.clear(),this.#o=null,this.#d=!1,this.#A=!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.#k()}if(e==="open"){if(this.#T(),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.#k(),e.tagName==="IMG")this.#a(e)}#k(){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")}#a(e){if(this.#C.has(e))return;if(this.#C.add(e),e.addEventListener("load",()=>{this.removeAttribute("data-b3-error"),this.reset()}),e.addEventListener("error",()=>this.#p(e)),e.complete&&e.naturalWidth===0&&e.getAttribute("src"))setTimeout(()=>{if(e.isConnected&&e.complete&&e.naturalWidth===0)this.#p(e)},0)}#p(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}}))}#T(){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.#c=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}}#f(e){if(this.#t<=be&&!this.#c){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))}#s(e){let t=e?.element??this.#h();if(!t)return;let r=this.#t<=be,n=!r||this.#c;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}#b(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,o=(r-this.#n)/this.#t;if(this.#e=t-a*e,this.#n=r-o*e,this.#t=e,this.#f(n),this.#s(n),i!==this.#t)this.#v()}#v(){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.#f(t);if(this.#s(t),e)this.#v()}zoomTo(e){let t=this.#u();if(t)this.#b(e,t.vw/2,t.vh/2,t)}requestClose(){this.dispatchEvent(new CustomEvent("b3-close",{bubbles:!0,composed:!0,detail:{src:this.src}}))}#M(){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}}#S(){let[e,t]=[...this.#i.values()];return Math.hypot(e.x-t.x,e.y-t.y)}#D(){this.#E=new AbortController;let e={signal:this.#E.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.#o=this.#u(),this.#i.size>1||this.#t>be||this.#c)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<=be&&!this.#c){this.#i.set(n.pointerId,{x:n.clientX,y:n.clientY});return}if(this.#o??=this.#u(),!this.#o)return;n.preventDefault();let a=this.#M(),o=i?this.#S():0;this.#i.set(n.pointerId,{x:n.clientX,y:n.clientY});let s=this.#M(),l=i?this.#S():0,c=this.getBoundingClientRect(),d=this.#t,u=i&&o>0?Math.max(1,Math.min(this.maxScale,this.#t*(l/o))):this.#t,f=(a.x-c.left-this.#e)/this.#t,h=(a.y-c.top-this.#n)/this.#t;if(this.#e=s.x-c.left-f*u,this.#n=s.y-c.top-h*u,this.#t=u,this.#f(this.#o),this.#s(this.#o),this.#d=!0,d!==this.#t)this.#v()},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.#o=this.#u();return}if(this.#o=null,this.#d){this.#g=performance.now(),this.#d=!1;return}if(n.type!=="pointerup")return;let i=performance.now(),a=Math.hypot(n.clientX-this.#y,n.clientY-this.#w)<ca;if(i-this.#r<la&&a){this.#r=0;let o=this.getBoundingClientRect();this.#b(this.#t>be?1:2.5,n.clientX-o.left,n.clientY-o.top),this.#g=i}else this.#r=i,this.#y=n.clientX,this.#w=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.#g<da){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.#b(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.#c)return;let o=this.#n;if(this.#n-=n.deltaY,this.#f(a),this.#n===o)return;n.preventDefault(),this.#s(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=(o,s)=>{let l=this.#u();if(!l||this.fitted)return!1;return this.#e+=o,this.#n+=s,this.#f(l),this.#s(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.#f(n),this.#s(n)},e)}}var ii=or;function ar(e="b3-image-viewer"){if(typeof customElements>"u")return null;let t=customElements.get?.(e);if(t)return t;let r=ii;return ii=class extends or{},customElements.define(e,r),r}ar();var ha=/(^|\s)([#@][\p{L}\p{N}_-]+)/gu,pa=/(?:\s+(?!#\d+(?:\s|$))[#@][\p{L}\p{N}_-]+)+\s*$/u,ba=350,Be=()=>globalThis.crypto?.randomUUID?.()??Math.random().toString(36).slice(2,11),lr=(e)=>JSON.parse(JSON.stringify(sr(e))),x=(e,t)=>e!=null&&String(e)===String(t),it=(e)=>!!e&&typeof e==="object",C=(e)=>Array.isArray(e.subtasks)?e.subtasks:[],V=(e)=>Array.isArray(e.comments)?e.comments:[];function ma(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 hi=(e)=>[...e.filter((t)=>t.starred),...e.filter((t)=>!t.starred)];function cr(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=Be();t.add(String(n.id))};return e.filter(it).map((n)=>{r(n),n.cards=hi(Array.isArray(n.cards)?n.cards.filter(it):[]);for(let i of n.cards){if(r(i),Array.isArray(i.subtasks)){for(let a of i.subtasks)if(it(a))r(a)}if(Array.isArray(i.comments)){for(let a of i.comments)if(it(a))r(a)}}return n})}function si(e,{field:t,id:r}){if(t==="name"){let n=e.findIndex((i)=>x(i.id,r));if(n>=0)e.splice(n,1);return}for(let n of e){let i=n.cards.findIndex((a)=>x(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 o=C(a),s=o.findIndex((l)=>x(l.id,r));if(s>=0)return void o.splice(s,1)}}}function ga(e,t,r){let{field:n,id:i}=r,a=(o,s,l)=>o.splice(Math.min(l,o.length),0,sr(s));if(n==="name"){let o=e.findIndex((s)=>x(s.id,i));if(o>=0&&!t.some((s)=>x(s.id,i)))a(t,e[o],o);return}for(let o of e){let s=o.cards.findIndex((l)=>x(l.id,i));if(n==="title"&&s>=0){let l=t.find((c)=>x(c.id,o.id));if(l&&!l.cards.some((c)=>x(c.id,i)))a(l.cards,o.cards[s],s);return}if(n==="subtask")for(let l of o.cards){let c=C(l).findIndex((u)=>x(u.id,i));if(c<0)continue;let d=t.flatMap((u)=>u.cards).find((u)=>x(u.id,l.id));if(d&&!C(d).some((u)=>x(u.id,i))){if(!Array.isArray(d.subtasks))d.subtasks=[];a(d.subtasks,C(l)[c],c)}return}}}var pi=(e)=>e.toLowerCase().split(/\s+/).filter(Boolean);function ya(e){return[e.title??"",e.description??"",...C(e).map((t)=>t.title??""),...at(e),...V(e).map((t)=>t.text??"")].join(`
42
+ `).toLowerCase()}var oi=(e,t)=>{let r=String(t.text??"").toLowerCase();return pi(e).some((n)=>r.includes(n))},xa=/^#\d+$/;function at(e){let t=new Set((e.tags??[]).map((n)=>(/^[#@]/.test(n)?n:`#${n}`).toLowerCase())),r=[e.title??"",e.description??"",...C(e).map((n)=>n.title??"")].join(`
43
+ `);for(let[,,n]of r.matchAll(ha))t.add(n.toLowerCase());return[...t].filter((n)=>!xa.test(n))}var ai=String.raw`(<[^<>\n]+>|(?:[^()\n]|\([^()\n]*\))+)`,va=new RegExp(String.raw`!\[([^\]\n]*)\]\(${ai}\)|\[([^\]\n]+)\]\(${ai}\)|\[([^[\]\s]*\/[^[\]\s]*\.[a-z][a-z\d]{0,7}|[^[\]\s\/]+\.(?:md|markdown|txt|json|ya?ml|csv|log|pdf|png|jpe?g|gif|webp|svg|html|kanban))\](?![(\[])|\bhttps?:\/\/[^\s<>]+`,"giu"),wa=new Set(["javascript","data","vbscript","file","blob","about"]),Ea=(e)=>{let t=e.trim();return t.startsWith("<")&&t.endsWith(">")?t.slice(1,-1):t.replace(/\s+"[^"\n]*"$/,"")};function _a(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!wa.has(r)&&t.includes(r)?{href:e,file:!1}:null;return e.startsWith("//")?null:{href:e,file:!0}}var li=(e)=>(e??"").toLowerCase().split(/[\s,]+/).map((t)=>t.replace(/:$/,"")).filter(Boolean),ci=(e)=>(e??"").toLowerCase().split(",").map((t)=>t.trim()).filter(Boolean),dr=(e,t)=>!!t&&e.includes(String(t.name??"").trim().toLowerCase());function fr(e,t=[]){let r=[],n=0;for(let i of e.matchAll(va)){let a=i[2]!==void 0,[o]=i,s=a?i[1]:i[3]??i[5],l=a?i[2]:i[4]??i[5],c=i.index+o.length;if(!l){let u=o;for(;;){if(u=u.replace(/[.,;:!?'"\]]+$/u,""),!u.endsWith(")")||u.split("(").length>=u.split(")").length)break;u=u.slice(0,-1)}c-=o.length-u.length,o=s=l=u}else l=Ea(l);let d=_a(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:s,...d,...a?{image:a}:{}}),n=c}if(n<e.length)r.push(e.slice(n));return r}var di=(e,t=[])=>fr(e,t).map((r)=>typeof r==="string"?r:r.text).join(""),ur=null;function ka(e,t,r=[]){let n=e.ownerDocument;e.replaceChildren(...fr(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 o=n.createElement("img");if(o.src=i.href,o.alt=i.text,o.loading="lazy",o.draggable=!1,a.classList.add("b3-board-image"),a.append(o),i.file)a.dataset.file="";else a.target="_blank",a.rel="noopener noreferrer";return a}if(i.file){if(a.dataset.file="",!ur){let o=n.createElement("template");o.innerHTML=Ta,ur=o.content.firstElementChild}a.append(ur.cloneNode(!0))}else if(/^https?:/i.test(i.href))a.target="_blank",a.rel="noopener noreferrer";return a.append(i.text),a}))}var Sa="b3-board-style",Aa=`
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));}
@@ -116,6 +116,7 @@ b3-board{display:flex;flex-direction:column;min-inline-size:0;min-block-size:0;c
116
116
  is elsewhere, apart from hover's faint tint. A focused card is always the selected one, so focus draws no ring of its own. */
117
117
  .b3-board-card:focus{outline:none;}
118
118
  .b3-board-card[data-b3-selected]{outline:2px solid var(--b3-color-focus);outline-offset:-1px;}
119
+ .b3-board-ghost[data-b3-count]::after{content:attr(data-b3-count);position:absolute;inset-block-start:-.5rem;inset-inline-end:-.5rem;min-inline-size:1.5rem;padding:.125rem .375rem;border-radius:999px;background:var(--b3-color-focus);color:#fff;font-size:.75rem;font-weight:600;text-align:center;}
119
120
  /* An ⌥-move with nowhere to go: a nudge that way. */
120
121
  .b3-board-card[data-b3-bump]{animation:b3-board-bump .22s ease-out;}
121
122
  @keyframes b3-board-bump{40%{translate:0 calc(var(--b3-board-bump,1) * 4px);}}
@@ -232,7 +233,7 @@ b3-board [data-b3-drop="before"]{box-shadow:0 -3px 0 -1px var(--b3-color-accent)
232
233
  .b3-board-keys dd{margin:0;color:var(--b3-color-muted);}
233
234
  .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;}
234
235
  @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;}}
235
- `,q=(e)=>`<svg class="b3-board-icon" viewBox="0 0 24 24" aria-hidden="true" focusable="false">${e}</svg>`,ui=q('<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"/>'),st=q('<path d="M5 12h14M12 5v14"/>'),ot=q('<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"/>'),Ca=q('<path d="m9 18 6-6-6-6"/>'),Ta=q('<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"/>'),fi=q('<path d="M7.9 20A9 9 0 1 0 4 16.1L2 22Z"/>'),Oa=q('<path d="M11 12H3M16 6H3M16 18H3M18 9v6M21 12h-6"/>'),Ma=q('<circle cx="11" cy="11" r="7"/><path d="m20 20-3.5-3.5"/>'),La=q('<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"/>'),De=(e,t,r=!0)=>`<template b3x-if="isEditing('${e}', ${t})">
236
+ `,q=(e)=>`<svg class="b3-board-icon" viewBox="0 0 24 24" aria-hidden="true" focusable="false">${e}</svg>`,ui=q('<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"/>'),st=q('<path d="M5 12h14M12 5v14"/>'),ot=q('<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"/>'),Ca=q('<path d="m9 18 6-6-6-6"/>'),Ta=q('<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"/>'),fi=q('<path d="M7.9 20A9 9 0 1 0 4 16.1L2 22Z"/>'),Ma=q('<path d="M11 12H3M16 6H3M16 18H3M18 9v6M21 12h-6"/>'),Oa=q('<circle cx="11" cy="11" r="7"/><path d="m20 20-3.5-3.5"/>'),La=q('<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"/>'),De=(e,t,r=!0)=>`<template b3x-if="isEditing('${e}', ${t})">
236
237
  <textarea class="b3-board-editor" rows="1" b3x-model="editing.draft" b3x-init="focusEditor($el)"
237
238
  b3x-on:keydown="keyEditor($event, ${r})" b3x-on:paste="pasteEditor($event, '${e}', ${t})" b3x-on:blur="blurEditor('${e}', ${t})" aria-label="Edit"></textarea></template>`,Ia=`
238
239
  <div class="b3-board-filters" b3x-bind:hidden="!tokens().length && !searchable" role="group" aria-label="Filter" b3x-on:keydown="keyTags($event)">
@@ -242,7 +243,7 @@ b3-board [data-b3-drop="before"]{box-shadow:0 -3px 0 -1px var(--b3-color-accent)
242
243
  </template>
243
244
  <button type="button" class="b3-board-link" b3x-show="filter.length" b3x-on:click="setFilter([])">Clear</button>
244
245
  <span class="b3-board-search" b3x-show="searchable" b3x-bind:data-open="searchShown() ? '' : null">
245
- <button type="button" class="b3-board-quiet" b3x-bind:hidden="searchShown()" b3x-on:click="openSearch()" aria-label="Search cards" title="Search cards (/)">${Ma}</button>
246
+ <button type="button" class="b3-board-quiet" b3x-bind:hidden="searchShown()" b3x-on:click="openSearch()" aria-label="Search cards" title="Search cards (/)">${Oa}</button>
246
247
  <input type="search" class="b3-board-search-input" b3x-bind:hidden="!searchShown()" b3x-bind:value="search" placeholder="Search" aria-label="Search cards"
247
248
  spellcheck="false" autocomplete="off" enterkeyhint="search" b3x-on:input="typeSearch($event)" b3x-on:keydown="keySearch($event)" b3x-on:blur="blurSearch()">
248
249
  </span>
@@ -270,8 +271,8 @@ b3-board [data-b3-drop="before"]{box-shadow:0 -3px 0 -1px var(--b3-color-accent)
270
271
  b3x-on:keydown="keyText($event, 'title', card.id, card.title)" b3x-effect="rich($el, label(card.title))"></span>
271
272
  <span class="b3-board-tools" b3x-show="!isEditing('title', card.id)">
272
273
  <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)"
273
- b3x-on:click="addDetails(card)">${Oa}</button>
274
- <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)"
274
+ b3x-on:click="addDetails(card)">${Ma}</button>
275
+ <button type="button" class="b3-board-quiet b3-board-remove" data-b3-confirm="Delete?" b3x-bind:data-b3-confirm="deleteLabel(card)" b3x-show="!readonly" b3x-bind:aria-label="'Delete ' + plain(card.title)"
275
276
  b3x-on:click="removeCard(column, card)">${ot}</button>
276
277
  <button type="button" class="b3-board-quiet b3-board-star" b3x-show="!readonly || card.starred" b3x-bind:disabled="readonly"
277
278
  b3x-bind:aria-pressed="starred(card)" b3x-bind:aria-label="(card.starred ? 'Unstar ' : 'Star ') + plain(card.title)" b3x-on:click="toggleStar(card)">${La}</button>
@@ -335,8 +336,8 @@ b3-board [data-b3-drop="before"]{box-shadow:0 -3px 0 -1px var(--b3-color-accent)
335
336
  </template>
336
337
  <button type="button" class="b3-board-link b3-board-add" b3x-show="!readonly" b3x-on:click="addColumn()">${st}<span>Add column</span></button>
337
338
  </div>
338
- <span class="b3-visually-hidden" role="status" b3x-text="announcement"></span>`;class pi extends Pe{static observedAttributes=["readonly","search","link-schemes","searchable","expand-in"];#t=null;#e=null;#n=null;#l=null;#o=null;#i=!1;#c=null;#m=null;#r=null;#g=!1;#v=null;#S=0;#w=Math.random().toString(36).slice(2,8);#y=!1;#A=[];#d={past:[],future:[],now:null,key:"",at:0};#h=!1;get columns(){let e=lr(this.#e?.columns??this.#n??[]),t=this.#e?.editing;if(t?.fresh)si(e,t);return e}set columns(e){let t=cr(lr(e));if(!this.#e){this.#n=t;return}this.#p();let r=this.#j();if(r)this.#F(r);let n=this.#e;if(n.editing?.fresh)ga(n.columns,t,n.editing);if(n.columns=t,n.editing&&!this.#a(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=cr(lr(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.#p(),t.columns=s,r.now=this.columns,this.#s(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.#o??""}set search(e){let t=String(e??"");if(this.#e){if(t!==this.#e.search)this.#e.kept=[];this.#e.search=t}else this.#o=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)=>x(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($e(e,Sa,Aa),ni(),!this.#t){let t=this.querySelector(':scope > script[type="application/json"]'),r=this.#n;if(!r&&t)try{r=cr(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=ti(this.#t,Ia,this.#C(r??[],this.#l??[],this.#o??this.getAttribute("search")??"")),this.#n=this.#l=this.#o=null,this.#d.now=this.columns}else if(this.#t.parentNode!==this)this.append(this.#t);this.#m=new MutationObserver(()=>{if(this.#t&&this.#t.parentNode!==this)this.append(this.#t)}),this.#m.observe(this,{childList:!0}),this.#K(),mr(this,this.#c.signal,{role:"region"})}disconnectedCallback(){this.#p(),this.#c?.abort(),this.#c=null,this.#$(),this.#m?.disconnect(),this.#m=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=li(r));if(e==="searchable")return void(this.#e.searchable=r!==null);if(e==="expand-in")return void(this.#e.expandIn=ci(r));if(this.#e.readonly=this.readonly,this.#e.viewed={},this.readonly)this.#p(),this.#e.editing=null}#a(e){for(let t of this.#e?.columns??[]){if(x(t.id,e))return t;for(let r of t.cards)if(x(r.id,e)||C(r).some((n)=>x(n.id,e)))return r}return null}#b(e){let t="card"in e&&e.card!=null&&e.type!=="toggle"&&e.type!=="remove"?this.#a(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)}#C(e,t,r){let n=this,i=(o)=>this.#b(o),a=(o)=>{for(let l of s.columns){let c=l.cards.findIndex((d)=>x(d.id,o));if(c>=0)return{column:l,index:c,card:l.cards[c]}}return null},s=ei({columns:e,filter:t,search:r,kept:[],editing:null,announcement:"",readonly:n.readonly,searchable:n.hasAttribute("searchable"),expandIn:ci(n.getAttribute("expand-in")),searching:!1,schemes:li(n.getAttribute("link-schemes")),viewed:{},selected:null,tokensOf:at,subtasksOf:C,commentsOf:V,hits:oi,said(o){return V(o).some((l)=>oi(s.search,l))},now:Date.now(),ago(o){return ma(o,s.now)},label(o){let l=String(o??"");return l.replace(ba,"").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||C(o).length||V(o).length)},complete(o){let l=C(o).length;return l>0&&s.done(o)===l},preview(o){let l=String(o.description??"");return l.split(`
339
- `).map((d)=>di(d,s.schemes)).find((d)=>d.trim())?.trim()??(fr(l,s.schemes).some((d)=>typeof d!=="string"&&d.image)?"Image":"")},plain(o){return di(s.label(o),s.schemes)},rich(o,l){ka(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)&&dr(s.expandIn,s.columns.find((c)=>c.cards.some((d)=>x(d.id,o.id)))))},expanded(o){return String(s.isOpen(o))},isSelected(o){return x(s.selected,o.id)},isEditing(o,l){return!!s.editing&&s.editing.field===o&&s.editing.id===l},focusEditor(o){queueMicrotask(()=>n.#T(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 at(c))o.add(d);return[...o].sort()},visible(o){let l=bi(s.search);if(!s.filter.length&&!l.length)return o.cards;let c=s.editing&&n.#a(s.editing.id);return o.cards.filter((d)=>{if(d===c||s.kept.some((b)=>x(d.id,b)))return!0;let u=at(d),f=l.length?ya(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 C(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){if(s.readonly)return;if(s.editing)s.commit();let l=a(o.id),c=l?.card;if(!l||!c)return;if(c.starred)delete c.starred;else c.starred=!0;l.column.cards=hi(l.column.cards);let d=!!c.starred;s.announcement=`${c.title??""} ${d?"starred":"unstarred"}`,i({type:"star",card:c.id,starred:d}),n.#B(c.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.#O()},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.#a(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||!["title","description","comment"].includes(l)||!d.length)return;if(o.clipboardData?.getData("text/plain").trim())return;o.preventDefault();for(let u of d)n.#u(c,u,l==="title"?null:o.target,l==="comment"?"comment":"description")},cancel(){let o=s.editing;if(s.editing=null,o?.fresh)s.discard(o);if(o?.opened)s.close(o);n.#P(o)},close(o){let l=n.#a(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.#a(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 p={id:Ne(),at:new Date().toISOString(),by:n.getAttribute("author")||"you",text:c};b.comments=[...V(b),p],u={type:"comment",card:b.id,comment:p.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,p=C(b).find((h)=>x(h.id,l.id));if(!c)return s.removeSubtask(b,p);if(c!==p.title)p.title=c,u={type:"edit",card:b.id,field:"subtask",subtask:p.id};if(l.fresh)u={type:"subtask",card:b.id,subtask:p.id,op:"add"}}else{let b=d,p=l.field;if((c||p==="description")&&c!==(b[p]??""))b[p]=c,u={type:"edit",card:b.id,field:p};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.#a(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.#P(l)},discard(o){si(s.columns,o)},settle(){if(s.editing)s.commit()},addCard(o){if(s.readonly)return;s.settle();let l={id:Ne(),title:""};o.cards.push(l),s.edit("title",l.id,"",!0)},addColumn(){if(s.readonly)return;s.settle();let o={id:Ne(),name:"",cards:[]};s.columns.push(o),s.edit("name",o.id,"",!0)},addSubtask(o){if(s.readonly)return;s.settle();let l={id:Ne(),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=C(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=V(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})},keyTags(o){n.#q(o)},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.#M(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),p=b[b.indexOf(c.card)+u];if(p&&!p.starred===!l.starred)n.moveCard(l.id,c.column.id,c.column.cards.indexOf(p));else n.#D(o.currentTarget,u,!p?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.#D(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.#k(l,c.id,C(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")],p=o.key==="ArrowDown"?f.querySelector(".b3-board-card"):d?b[b.indexOf(f)+d]?.querySelector(".b3-board-column-name"):void 0;if(p===void 0)return;if(o.preventDefault(),p)n.#x(p);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,n="description"){let i=this.#e,a=()=>i.editing?.field===n&&x(i.editing.id,e)?i.editing:null,s=`![Uploading image ${this.#w}-${++this.#S}…]()`,o="",l=a();if(l&&r){let{selectionStart:y,selectionEnd:k}=r;o=y&&r.value[y-1]!==`
339
+ <span class="b3-visually-hidden" role="status" b3x-text="announcement"></span>`;class bi extends Pe{static observedAttributes=["readonly","search","link-schemes","searchable","expand-in"];#t=null;#e=null;#n=null;#c=null;#o=null;#i=!1;#d=null;#g=null;#r=null;#y=!1;#w=null;#A=0;#E=Math.random().toString(36).slice(2,8);#x=!1;#C=[];#l={past:[],future:[],now:null,key:"",at:0};#h=!1;get columns(){let e=lr(this.#e?.columns??this.#n??[]),t=this.#e?.editing;if(t?.fresh)si(e,t);return e}set columns(e){let t=cr(lr(e));if(!this.#e){this.#n=t;return}this.#m();let r=this.#J();if(r)this.#G(r);let n=this.#e;if(n.editing?.fresh)ga(n.columns,t,n.editing);if(n.columns=t,n.editing&&!this.#a(n.editing.id))n.editing=null;if(n.picked.length)n.picked=n.picked.filter((i)=>this.#a(i));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 a=new Map(t.columns.flatMap((s)=>s.cards.map((l)=>[String(l.id),l.expanded]))),o=cr(lr(i));for(let s of o)for(let l of s.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.#m(),t.columns=o,r.now=this.columns,this.#s(e<0?"Undone":"Redone"),this.#k({type:e<0?"undo":"redo"}),!0}#k(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.#c??[]]}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.#c=t}get search(){return this.#e?.search??this.#o??""}set search(e){let t=String(e??"");if(this.#e){if(t!==this.#e.search)this.#e.kept=[];this.#e.search=t}else this.#o=t}get defaultColumn(){return this.getAttribute("default-column")??""}set defaultColumn(e){if(e)this.setAttribute("default-column",String(e));else this.removeAttribute("default-column")}get topColumns(){return this.getAttribute("top-columns")??""}set topColumns(e){if(e)this.setAttribute("top-columns",String(e));else this.removeAttribute("top-columns")}onTop(e){return this.topColumns.split(",").map((t)=>t.trim().toLowerCase()).filter(Boolean).some((t)=>x(e.id,t)||String(e.name??"").trim().toLowerCase()===t)}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)=>x(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.#w}set upload(e){this.#w=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($e(e,Sa,Aa),ni(),!this.#t){let t=this.querySelector(':scope > script[type="application/json"]'),r=this.#n;if(!r&&t)try{r=cr(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=ti(this.#t,Ia,this.#T(r??[],this.#c??[],this.#o??this.getAttribute("search")??"")),this.#n=this.#c=this.#o=null,this.#l.now=this.columns}else if(this.#t.parentNode!==this)this.append(this.#t);this.#g=new MutationObserver(()=>{if(this.#t&&this.#t.parentNode!==this)this.append(this.#t)}),this.#g.observe(this,{childList:!0}),this.#X(),mr(this,this.#d.signal,{role:"region"})}disconnectedCallback(){this.#m(),this.#d?.abort(),this.#d=null,this.#H(),this.#g?.disconnect(),this.#g=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=li(r));if(e==="searchable")return void(this.#e.searchable=r!==null);if(e==="expand-in")return void(this.#e.expandIn=ci(r));if(this.#e.readonly=this.readonly,this.#e.viewed={},this.readonly)this.#m(),this.#e.editing=null}#a(e){for(let t of this.#e?.columns??[]){if(x(t.id,e))return t;for(let r of t.cards)if(x(r.id,e)||C(r).some((n)=>x(n.id,e)))return r}return null}#p(e){let t="card"in e&&e.card!=null&&e.type!=="toggle"&&e.type!=="remove"?this.#a(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&&!this.#v&&!(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.#k(e)}#T(e,t,r){let n=this,i=(s)=>this.#p(s),a=(s)=>{for(let l of o.columns){let c=l.cards.findIndex((d)=>x(d.id,s));if(c>=0)return{column:l,index:c,card:l.cards[c]}}return null},o=ei({columns:e,filter:t,search:r,kept:[],editing:null,announcement:"",readonly:n.readonly,searchable:n.hasAttribute("searchable"),expandIn:ci(n.getAttribute("expand-in")),searching:!1,schemes:li(n.getAttribute("link-schemes")),viewed:{},selected:null,picked:[],tokensOf:at,subtasksOf:C,commentsOf:V,hits:oi,said(s){return V(s).some((l)=>oi(o.search,l))},now:Date.now(),ago(s){return ma(s,o.now)},label(s){let l=String(s??"");return l.replace(pa,"").trim()||l},pressed(s){return String(o.filter.includes(s))},mention(s){return s.startsWith("@")?"":null},starred(s){return String(!!s.starred)},hasDetails(s){return!!(s.description||C(s).length||V(s).length)},complete(s){let l=C(s).length;return l>0&&o.done(s)===l},preview(s){let l=String(s.description??"");return l.split(`
340
+ `).map((d)=>di(d,o.schemes)).find((d)=>d.trim())?.trim()??(fr(l,o.schemes).some((d)=>typeof d!=="string"&&d.image)?"Image":"")},plain(s){return di(o.label(s),o.schemes)},rich(s,l){ka(s,String(l??""),o.schemes)},keyText(s,l,c,d){if(s.target!==s.currentTarget||s.key!=="Enter"&&s.key!==" ")return;s.preventDefault(),s.stopPropagation(),o.edit(l,c,d)},isOpen(s){let l=o.viewed[String(s.id)];return o.readonly&&l!==void 0?l:s.expanded??(o.hasDetails(s)&&dr(o.expandIn,o.columns.find((c)=>c.cards.some((d)=>x(d.id,s.id)))))},expanded(s){return String(o.isOpen(s))},isSelected(s){return x(o.selected,s.id)||o.picked.includes(String(s.id))},deleteLabel(s){let l=n.#b(s.id).length;return l>1?`Delete ${l}?`:"Delete?"},isEditing(s,l){return!!o.editing&&o.editing.field===s&&o.editing.id===l},focusEditor(s){queueMicrotask(()=>n.#K(s))},blurEditor(s,l){if(o.isEditing(s,l))o.commit()},tokens(){let s=new Set;for(let l of o.columns)for(let c of l.cards)for(let d of at(c))s.add(d);return[...s].sort()},visible(s){let l=pi(o.search);if(!o.filter.length&&!l.length)return s.cards;let c=o.editing&&n.#a(o.editing.id);return s.cards.filter((d)=>{if(d===c||o.kept.some((h)=>x(d.id,h)))return!0;let u=at(d),f=l.length?ya(d):"";return o.filter.every((h)=>u.includes(h))&&l.every((h)=>f.includes(h))})},count(s){let l=o.visible(s).length;return l===s.cards.length?String(l):`${l}/${s.cards.length}`},done(s){return C(s).filter((l)=>l.done).length},disclosable(s){return!!(o.hasDetails(s)||!o.readonly)},toggleFilter(s){o.kept=[],o.filter=o.filter.includes(s)?o.filter.filter((l)=>l!==s):[...o.filter,s]},setFilter(s){o.kept=[],o.filter=s},searchShown(){return o.searching||!!o.search},openSearch(){o.searching=!0;let s=n.querySelector(".b3-board-search-input");if(!s)return;s.hidden=!1,s.closest(".b3-board-filters").hidden=!1,s.focus(),s.select()},typeSearch(s){n.search=s.target.value},keySearch(s){if(s.isComposing||s.keyCode===229)return;if(s.key!=="Escape"&&s.key!=="Enter")return;s.preventDefault(),s.stopPropagation();let l=s.target;if(s.key==="Escape")l.value="",n.search="";l.blur()},blurSearch(){o.searching=!1},toggleStar(s){if(o.readonly)return;if(o.editing)o.commit();let l=a(s.id),c=l?.card;if(!l||!c)return;if(c.starred)delete c.starred;else c.starred=!0;l.column.cards=hi(l.column.cards);let d=!!c.starred;o.announcement=`${c.title??""} ${d?"starred":"unstarred"}`,i({type:"star",card:c.id,starred:d}),n.#I(c.id)},toggle(s){if(o.readonly){o.viewed={...o.viewed,[String(s.id)]:!o.isOpen(s)};return}s.expanded=!o.isOpen(s),i({type:"toggle",card:s.id,expanded:s.expanded})},edit(s,l,c,d=!1,u=!1,f=!1){if(o.readonly||n.#r?.started)return;if(o.editing&&!o.isEditing(s,l))o.commit();o.editing={field:s,id:l,draft:c??"",fresh:d,opened:u,atEnd:f},n.#F()},addDetails(s,l=!1){if(o.readonly)return;let c=!o.isOpen(s);s.expanded=!0,o.edit("description",s.id,String(s.description??""),!1,c,l)},keyEditor(s,l){if(s.stopPropagation(),s.key==="Escape")s.preventDefault(),o.cancel();else if(s.key==="Enter"&&!(l&&s.shiftKey)&&!s.isComposing)s.preventDefault(),o.commit(!0);else if(s.key==="Tab"&&!s.altKey&&!s.metaKey&&!s.ctrlKey&&!s.isComposing&&!n.hasAttribute("compact")){let c=o.editing,d=c?.field==="title"&&!s.shiftKey?"description":c?.field==="description"&&s.shiftKey?"title":null;if(!d)return;s.preventDefault(),o.commit();let u=n.#a(c.id);if(!u||o.readonly)return;if(d==="description")o.addDetails(u,!0);else o.edit("title",u.id,String(u.title??""))}},pasteEditor(s,l,c){let d=[...s.clipboardData?.files??[]].filter((u)=>u.type.startsWith("image/"));if(o.readonly||!n.upload||!["title","description","comment"].includes(l)||!d.length)return;if(s.clipboardData?.getData("text/plain").trim())return;s.preventDefault();for(let u of d)n.#u(c,u,l==="title"?null:s.target,l==="comment"?"comment":"description")},cancel(){let s=o.editing;if(o.editing=null,s?.fresh)o.discard(s);if(s?.opened)o.close(s);n.#R(s)},close(s){let l=n.#a(s.id);if(l&&!o.hasDetails(l))l.expanded=!1},commit(s=!1){let l=o.editing;if(!l)return;if(o.editing=null,o.readonly)return;let c=l.field==="description"||l.field==="comment"?l.draft.trim():l.draft.replace(/\s+/g," ").trim(),d=n.#a(l.id);if(!d)return;if(!c&&l.fresh)return o.discard(l);if(!c&&l.opened)o.close(l);let u=null;if(l.field==="comment"){let h=d;if(c){let b={id:Be(),at:new Date().toISOString(),by:n.getAttribute("author")||"you",text:c};h.comments=[...V(h),b],u={type:"comment",card:h.id,comment:b.id,op:"add"}}}else if(l.field==="name"){let h=d;if(c&&c!==h.name)h.name=c,u={type:"edit",column:h.id,field:"name"};if(l.fresh)u={type:"add",column:h.id}}else if(l.field==="subtask"){let h=d,b=C(h).find((p)=>x(p.id,l.id));if(!c)return o.removeSubtask(h,b);if(c!==b.title)b.title=c,u={type:"edit",card:h.id,field:"subtask",subtask:b.id};if(l.fresh)u={type:"subtask",card:h.id,subtask:b.id,op:"add"}}else{let h=d,b=l.field;if((c||b==="description")&&c!==(h[b]??""))h[b]=c,u={type:"edit",card:h.id,field:b};if(l.fresh)u={type:"add",card:h.id,column:a(h.id).column.id},o.kept=[...o.kept,h.id]}if(u)i(u);let f=n.#a(l.id)??d;if(l.fresh&&l.field==="subtask"&&s)o.addSubtask(f);else if(l.fresh&&l.field==="title"&&s&&!n.hasAttribute("compact"))o.addDetails(f,!0);else n.#R(l)},discard(s){si(o.columns,s)},settle(){if(o.editing)o.commit()},addCard(s){if(o.readonly)return;o.settle();let l={id:Be(),title:""};if(n.onTop(s)){let c=s.cards.findIndex((d)=>!d.starred);s.cards.splice(c<0?s.cards.length:c,0,l)}else s.cards.push(l);o.edit("title",l.id,"",!0)},addColumn(){if(o.readonly)return;o.settle();let s={id:Be(),name:"",cards:[]};o.columns.push(s),o.edit("name",s.id,"",!0)},addSubtask(s){if(o.readonly)return;o.settle();let l={id:Be(),title:"",done:!1};if(s.expanded=!0,!Array.isArray(s.subtasks))s.subtasks=[];s.subtasks.push(l),o.edit("subtask",l.id,"",!0)},removeCard(s,l){if(o.readonly)return;let c=n.#b(l.id);n.#M(()=>{for(let d of c){let u=a(d);if(!u)continue;u.column.cards=u.column.cards.filter((f)=>f!==u.card),i({type:"remove",card:u.card.id,column:u.column.id})}}),o.picked=[]},removeColumn(s){if(o.readonly)return;o.columns=o.columns.filter((l)=>l!==s),i({type:"remove",column:s.id})},removeSubtask(s,l){if(o.readonly)return;s.subtasks=C(s).filter((c)=>c!==l),i({type:"subtask",card:s.id,subtask:l.id,op:"remove"})},removeComment(s,l){if(o.readonly)return;s.comments=V(s).filter((c)=>c!==l),i({type:"comment",card:s.id,comment:l.id,op:"remove"})},check(s,l,c){if(o.readonly)return;l.done=c,i({type:"check",card:s.id,subtask:l.id,done:c})},keyTags(s){n.#Y(s)},keyCard(s,l){if(s.target!==s.currentTarget)return;if(s.key==="Enter")return s.preventDefault(),o.edit("title",l.id,l.title);if(s.metaKey||s.ctrlKey)return;if(s.key==="Escape"&&o.picked.length){s.preventDefault(),s.stopPropagation(),o.picked=[];return}if(!s.altKey)return void n.#V(s,l);if(o.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}[s.key];if(!u)return;s.preventDefault();let f=n.#b(l.id);if(f.length>1)return void n.#D(s,l,f,u);if(s.key==="ArrowUp"||s.key==="ArrowDown"){let b=o.visible(c.column),p=b[b.indexOf(c.card)+u];if(p&&!p.starred===!l.starred)n.moveCard(l.id,c.column.id,c.column.cards.indexOf(p));else n.#L(s.currentTarget,u,!p?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 h=o.columns[o.columns.indexOf(c.column)+u];if(h)n.moveCard(l.id,h.id,Math.min(c.index,h.cards.length));else n.#L(s.currentTarget,0,"No column there")},keySubtask(s,l,c){o.keyText(s,"subtask",c.id,c.title);let d=s.key==="ArrowUp"?-1:s.key==="ArrowDown"?1:0;if(!s.altKey||!d||o.readonly)return;s.preventDefault(),s.stopPropagation(),n.#P(l,c.id,C(l).indexOf(c)+d)},keyColumn(s,l){if(s.metaKey||s.ctrlKey||s.shiftKey)return;let c=getComputedStyle(n).direction==="rtl",d=s.key==="ArrowLeft"?c?1:-1:s.key==="ArrowRight"?c?-1:1:0;if(!s.altKey){let f=s.currentTarget.closest(".b3-board-column"),h=[...n.querySelectorAll(".b3-board-column")],b=s.key==="ArrowDown"?f.querySelector(".b3-board-card"):d?h[h.indexOf(f)+d]?.querySelector(".b3-board-column-name"):void 0;if(b===void 0)return;if(s.preventDefault(),b)n.#O(b);return}if(!d||o.readonly)return;s.preventDefault();let u=o.columns.indexOf(l)+d;if(u>=0&&u<o.columns.length)n.moveColumn(l.id,u)}});return o}async#u(e,t,r,n="description"){let i=this.#e,a=()=>i.editing?.field===n&&x(i.editing.id,e)?i.editing:null,o=`![Uploading image ${this.#E}-${++this.#A}…]()`,s="",l=a();if(l&&r){let{selectionStart:y,selectionEnd:k}=r;s=y&&r.value[y-1]!==`
340
341
  `?`
341
- ${s}`:s,l.draft=r.value=r.value.slice(0,y)+o+r.value.slice(k),r.setSelectionRange(y+o.length,y+o.length),this.#f(r)}let c=i.columns.find((y)=>y.cards.some((k)=>x(k.id,e))),d=null;try{d=await this.#v?.(t,{card:e,column:c?.id})}catch(y){console.warn("b3-board: image upload failed",y)}let u=d?`![](${String(d).replace(/[\s()]/g,(y)=>`%${y.charCodeAt(0).toString(16).toUpperCase().padStart(2,"0")}`)})`:"";if(!u)this.#s("Image not added");while(this.#y)await new Promise((y)=>this.#A.push(y));let f=(y)=>{if(!o)return null;let k=y.indexOf(o),O=k>=0?k:y.indexOf(s);if(O<0)return null;let j=k>=0?o:s;return[O,O+j.length,u?j.replace(s,u):""]},b=(y)=>{if(!o)return u?y.trim()?`${y.replace(/\s+$/,"")}
342
- ${u}`:u:y;let k=f(y);return k?y.slice(0,k[0])+k[2]+y.slice(k[1]):y},p=a();if(p){let y=this.querySelector("textarea.b3-board-editor"),k=y?.value===p.draft&&f(y.value);if(y&&k){let[O,j,lt]=k,{selectionStart:mi,selectionEnd:gi,selectionDirection:yi}=y,hr=(Be)=>Be>=j?Be+lt.length-(j-O):Be>O?O+lt.length:Be;y.setRangeText(lt,O,j),y.setSelectionRange(hr(mi),hr(gi),yi??void 0),p.draft=y.value,this.#f(y)}else if(b(p.draft)!==p.draft)p.draft=b(p.draft);else if(u)this.#s("Image not added");return}if(n==="comment"){let y=i.columns.flatMap((O)=>O.cards).find((O)=>V(O).some((j)=>String(j.text??"").includes(s))),k=y&&V(y).find((O)=>String(O.text??"").includes(s));if(!y||!k||this.readonly){if(u)this.#s("Image not added");return}k.text=b(String(k.text)).trim(),this.#b({type:"edit",card:y.id,field:"comment",comment:k.id});return}let h=this.#a(e);if(o&&!String(h?.description??"").includes(s))h=i.columns.flatMap((y)=>y.cards).find((y)=>String(y.description??"").includes(s))??h;let m=String(h?.description??""),g=b(m).trim();if(!h||this.readonly||g===m.trim()){if(u)this.#s("Image not added");return}h.description=g,h.expanded=!0,this.#b({type:"edit",card:h.id,field:"description"});let S=h.id;requestAnimationFrame(()=>this.#f(this.querySelector(`[data-card="${CSS.escape(String(S))}"]`)))}#f(e){requestAnimationFrame(()=>e?.isConnected&&e.scrollIntoView({block:"nearest",inline:"nearest"}))}#s(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)=>x(f.id,e))),a=n.columns.find((u)=>x(u.id,t));if(!i||!a)return!1;let s=i.cards.findIndex((u)=>x(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(dr(n.expandIn,i)!==dr(n.expandIn,a))delete o.expanded;return n.announcement=`${o.title??""} moved to ${a.name??""}, position ${d+1} of ${a.cards.length}`,this.#b({type:"move",card:o.id,from:i.id,to:a.id,index:d}),this.#B(o.id),!0}moveColumn(e,t){let r=this.#e;if(!r||this.readonly)return!1;let n=r.columns.findIndex((s)=>x(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.#b({type:"reorder",column:i.id,index:a}),queueMicrotask(()=>this.querySelector(`[data-column="${CSS.escape(String(i.id))}"] .b3-board-column-name`)?.focus()),!0}#k(e,t,r){let n=this.#e,i=C(e),a=i.findIndex((l)=>x(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.#b({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}#T(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})}#O(){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"})}#M(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":if(l=s[o-1],!l&&this.#U())return void e.preventDefault();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)}#U(){let e=[...this.querySelectorAll(".b3-board-filters > .b3-board-chip")],t=e.find((r)=>r.textContent===this.#L)??e[0];return t?.focus(),!!t}#L=null;#q(e){let t=e.target;if(!t.matches(".b3-board-chip")||e.altKey||e.metaKey||e.ctrlKey)return;let r=[...this.querySelectorAll(".b3-board-filters > .b3-board-chip")],n=r.indexOf(t);if(this.#L=t.textContent,e.key==="ArrowDown"||e.key==="Escape"){e.preventDefault(),this.focusCard();return}if(e.key===" "||e.key==="Enter"){if(e.preventDefault(),!e.repeat)t.click();return}if(e.key!=="ArrowLeft"&&e.key!=="ArrowRight")return;e.preventDefault();let i=e.key==="ArrowLeft"!==(getComputedStyle(this).direction==="rtl")?-1:1,a=r[n+i];if(a)this.#L=a.textContent,a.focus()}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"],["↑ (top card)","Filter tags: ← → pick, Space toggle, ↓ back"],["← →","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 p=this.ownerDocument.createElement("kbd");p.textContent=b,u.append(p)}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}#j(){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)}}#F(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})})}#D(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.#s(r)}#N(){let e=this.ownerDocument,t=e.activeElement;if(!this.#I||!this.#e?.selected||t&&t!==e.body&&t!==e.documentElement)return;this.querySelector(`.b3-board-cards > [data-card="${CSS.escape(String(this.#e.selected))}"]`)?.focus({preventScroll:!0})}#B(e){requestAnimationFrame(()=>this.querySelector(`[data-card="${CSS.escape(String(e))}"]`)?.focus({preventScroll:!1}))}#P(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})})}#I=!1;#K(){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.#Y(a),{signal:e}),this.addEventListener("mousedown",(a)=>{if(this.#e?.editing&&a.target.closest?.(".b3-board-actions > button, .b3-board-star")&&this.contains(this.ownerDocument.activeElement))a.preventDefault()},{signal:e,capture:!0}),t.addEventListener("pointermove",(a)=>this.#J(a),{signal:e}),t.addEventListener("pointerup",(a)=>this.#G(a),{signal:e}),t.addEventListener("pointercancel",(a)=>{if(a.pointerId===this.#r?.pointerId)this.#p()},{signal:e}),t.addEventListener("keydown",(a)=>{if(a.key==="Escape"&&this.#r?.started)a.preventDefault(),this.#p()},{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.#I=!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.#I=!1;return}if(!s)requestAnimationFrame(()=>requestAnimationFrame(()=>this.#N()))},{signal:e}),t.addEventListener("focus",()=>queueMicrotask(()=>this.#N()),{signal:e}),this.addEventListener("click",(a)=>{let s=this.ownerDocument.getSelection(),o=a.target;if(!this.#g&&s&&!s.isCollapsed&&(o.contains(s.anchorNode)||s.containsNode(o,!0))&&!o.closest?.("button, .b3-board-grip, .b3-board-card-head>.b3-board-title")){a.preventDefault(),a.stopImmediatePropagation();return}if(!this.#g)return;this.#g=!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.#V(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.#$();this.addEventListener("compositionstart",()=>{this.#y=!0},{signal:e}),this.addEventListener("compositionend",i,{signal:e}),this.addEventListener("focusout",i,{signal:e})}#$(){this.#y=!1;for(let e of this.#A.splice(0))e()}#V(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)=>x(c.id,r("[data-column]")?.dataset.column)),i=n?.cards.find((c)=>x(c.id,r("[data-card]")?.dataset.card)),a=i&&C(i).find((c)=>x(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.#W(t,o,s);return}if(!t.dispatchEvent(new CustomEvent("b3-link",{bubbles:!0,cancelable:!0,detail:s}))||s.file)e.preventDefault()}#W(e,t,r){let n=this.ownerDocument;n.body.querySelector(":scope > .b3-board-lightbox")?.dispatchEvent(new CustomEvent("b3-close")),ar();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})}#Y(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-grip, .b3-board-card-head>.b3-board-title")?t.closest(".b3-board-card"):null;if(!i&&t.closest(".b3-board-card"))return;let 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.#R(e.clientX,e.clientY)},pa)}#R(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.#Z(r.px,r.py),this.#X(this.#H(r.px,r.py)),r.frame=requestAnimationFrame(a)};r.frame=requestAnimationFrame(a)}#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.#R(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}#G(e){let t=this.#r;if(!t||e.pointerId!==t.pointerId)return;if(!t.started)return this.#p();let r=this.#H(e.clientX,e.clientY);if(this.#p(),this.#g=!0,setTimeout(()=>{this.#g=!1},0),!r)return;let n=this.#e;if(t.kind==="card"){let i=n.columns.find((l)=>x(l.id,r.column)),a=n.columns.find((l)=>l.cards.some((c)=>x(c.id,t.id))),s=r.before?i.cards.findIndex((l)=>x(l.id,r.before)):i.cards.length,o=a.cards.findIndex((l)=>x(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.#a(t.card);if(!i)return;let a=C(i),s=r.before?a.findIndex((o)=>x(o.id,r.before)):a.length;if(a.findIndex((o)=>x(o.id,t.id))<s)s-=1;this.#k(i,t.id,s)}else{let i=r.before?n.columns.findIndex((s)=>x(s.id,r.before)):n.columns.length;if(n.columns.findIndex((s)=>x(s.id,t.id))<i)i-=1;this.moveColumn(t.id,i)}}#H(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.#z(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 p=b.getBoundingClientRect();return t<p.top+p.height/2}),f=(b)=>!!(b!=null&&this.#a(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}}#X(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")}#z(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})}#Z(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.#z(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))}#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")}}pr("b3-board",pi);export{pi as B3Board};
342
+ ${o}`:o,l.draft=r.value=r.value.slice(0,y)+s+r.value.slice(k),r.setSelectionRange(y+s.length,y+s.length),this.#f(r)}let c=i.columns.find((y)=>y.cards.some((k)=>x(k.id,e))),d=null;try{d=await this.#w?.(t,{card:e,column:c?.id})}catch(y){console.warn("b3-board: image upload failed",y)}let u=d?`![](${String(d).replace(/[\s()]/g,(y)=>`%${y.charCodeAt(0).toString(16).toUpperCase().padStart(2,"0")}`)})`:"";if(!u)this.#s("Image not added");while(this.#x)await new Promise((y)=>this.#C.push(y));let f=(y)=>{if(!s)return null;let k=y.indexOf(s),M=k>=0?k:y.indexOf(o);if(M<0)return null;let j=k>=0?s:o;return[M,M+j.length,u?j.replace(o,u):""]},h=(y)=>{if(!s)return u?y.trim()?`${y.replace(/\s+$/,"")}
343
+ ${u}`:u:y;let k=f(y);return k?y.slice(0,k[0])+k[2]+y.slice(k[1]):y},b=a();if(b){let y=this.querySelector("textarea.b3-board-editor"),k=y?.value===b.draft&&f(y.value);if(y&&k){let[M,j,lt]=k,{selectionStart:mi,selectionEnd:gi,selectionDirection:yi}=y,hr=(Ne)=>Ne>=j?Ne+lt.length-(j-M):Ne>M?M+lt.length:Ne;y.setRangeText(lt,M,j),y.setSelectionRange(hr(mi),hr(gi),yi??void 0),b.draft=y.value,this.#f(y)}else if(h(b.draft)!==b.draft)b.draft=h(b.draft);else if(u)this.#s("Image not added");return}if(n==="comment"){let y=i.columns.flatMap((M)=>M.cards).find((M)=>V(M).some((j)=>String(j.text??"").includes(o))),k=y&&V(y).find((M)=>String(M.text??"").includes(o));if(!y||!k||this.readonly){if(u)this.#s("Image not added");return}k.text=h(String(k.text)).trim(),this.#p({type:"edit",card:y.id,field:"comment",comment:k.id});return}let p=this.#a(e);if(s&&!String(p?.description??"").includes(o))p=i.columns.flatMap((y)=>y.cards).find((y)=>String(y.description??"").includes(o))??p;let m=String(p?.description??""),g=h(m).trim();if(!p||this.readonly||g===m.trim()){if(u)this.#s("Image not added");return}p.description=g,p.expanded=!0,this.#p({type:"edit",card:p.id,field:"description"});let S=p.id;requestAnimationFrame(()=>this.#f(this.querySelector(`[data-card="${CSS.escape(String(S))}"]`)))}#f(e){requestAnimationFrame(()=>e?.isConnected&&e.scrollIntoView({block:"nearest",inline:"nearest"}))}#s(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)=>x(f.id,e))),a=n.columns.find((u)=>x(u.id,t));if(!i||!a)return!1;let o=i.cards.findIndex((u)=>x(u.id,e)),[s]=i.cards.splice(o,1),l=a.cards.filter((u)=>u.starred).length,c=Math.max(0,Math.min(a.cards.length,r)),d=s.starred?Math.min(c,l):Math.max(c,l);if(a.cards.splice(d,0,s),i===a&&o===d)return!1;if(dr(n.expandIn,i)!==dr(n.expandIn,a))delete s.expanded;return n.announcement=`${s.title??""} moved to ${a.name??""}, position ${d+1} of ${a.cards.length}`,this.#p({type:"move",card:s.id,from:i.id,to:a.id,index:d}),this.#I(s.id),!0}#b(e){let t=this.#e,r=String(e);if(!t?.picked.length)return[r];let n=new Set([...t.picked,...t.selected!=null?[String(t.selected)]:[]]);if(!n.has(r))return[r];return t.columns.flatMap((i)=>i.cards.map((a)=>String(a.id)).filter((a)=>n.has(a)))}#v=!1;#M(e){let t=this.#l,r=t.now;this.#v=!0;try{e()}finally{this.#v=!1}if(r&&t.now!==r){if(t.past.push(r),t.past.length>100)t.past.shift();t.key=""}}#S(e,t,r){let n=this.#e,i=n.columns.find((o)=>x(o.id,t));if(!i)return;let a=0;if(this.#M(()=>{for(let o of e){let s=n.columns.find((c)=>c.cards.some((d)=>x(d.id,o))),l=r==null?i.cards.length:i.cards.findIndex((c)=>x(c.id,r));if(l<0)l=i.cards.length;if(s===i&&s.cards.findIndex((c)=>x(c.id,o))<l)l-=1;if(this.moveCard(o,i.id,l))a++}}),a)n.announcement=`${e.length} cards moved to ${i.name??""}`}#D(e,t,r,n){let i=this.#e,a=e.currentTarget,o=(l)=>i.columns.find((c)=>c.cards.some((d)=>x(d.id,l))),s=o(String(t.id));if(e.key==="ArrowUp"||e.key==="ArrowDown"){if(r.some((h)=>o(h)!==s))return this.#L(a,0,"The selected cards are in different columns");let l=i.visible(s),c=l.findIndex((h)=>x(h.id,n<0?r[0]:r.at(-1))),d=(h)=>l.slice(h).find((b)=>!r.includes(String(b.id))),u=n<0?l.slice(0,c).reverse().find((h)=>!r.includes(String(h.id))):d(c+1);if(!u)return this.#L(a,n,n<0?"Already first":"Already last");let f=n<0?u.id:s.cards[s.cards.indexOf(u)+1]?.id??null;this.#S(r,s.id,f)}else{let l=i.columns[i.columns.indexOf(s)+n];if(!l)return this.#L(a,0,"No column there");let c=o(r[0]).cards.findIndex((d)=>x(d.id,r[0]));this.#S(r,l.id,l.cards.filter((d)=>!r.includes(String(d.id)))[c]?.id??null)}this.#I(t.id)}moveColumn(e,t){let r=this.#e;if(!r||this.readonly)return!1;let n=r.columns.findIndex((o)=>x(o.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.#p({type:"reorder",column:i.id,index:a}),queueMicrotask(()=>this.querySelector(`[data-column="${CSS.escape(String(i.id))}"] .b3-board-column-name`)?.focus()),!0}#P(e,t,r){let n=this.#e,i=C(e),a=i.findIndex((l)=>x(l.id,t));if(!n||this.readonly||a<0)return!1;let o=Math.max(0,Math.min(i.length-1,r));if(a===o)return!1;let[s]=i.splice(a,1);return i.splice(o,0,s),n.announcement=`${s.title??""} moved to position ${o+1} of ${i.length}`,this.#p({type:"subtask",card:e.id,subtask:s.id,op:"move",index:o}),requestAnimationFrame(()=>this.querySelector(`[data-subtask="${CSS.escape(String(s.id))}"] .b3-board-title`)?.focus()),!0}#K(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}),o=a(),s=()=>{if(!e.isConnected||this.ownerDocument.activeElement!==e)return i.abort();let l=a(),c=l.scale===o.scale&&l.height<o.height;if(o=l,!c)return;if(r(),t!==e)e.scrollIntoView({block:"nearest",inline:"nearest"})};for(let l of[n,n.visualViewport])l?.addEventListener("resize",s,{signal:i.signal});e.addEventListener("blur",()=>i.abort(),{signal:i.signal,once:!0})}#F(){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()}))}#O(e){e.focus({preventScroll:!0}),e.scrollIntoView({block:"nearest",inline:"nearest"})}#V(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"),o=i(a),s=o.indexOf(n),l;if(e.shiftKey&&(e.key==="ArrowUp"||e.key==="ArrowDown")){if(e.preventDefault(),l=o[s+(e.key==="ArrowUp"?-1:1)],!l)return;let c=String(t.id),d=l.dataset.card;return r.picked=r.picked.includes(d)?r.picked.filter((u)=>u!==c&&u!==d):[...r.picked.filter((u)=>u!==c),c],this.#s(`${r.picked.length+1} cards selected`),void this.#O(l)}if(/^(Arrow|Home$|End$)/.test(e.key))r.picked=[];switch(e.key){case"ArrowUp":if(l=o[s-1],!l&&this.#W())return void e.preventDefault();break;case"ArrowDown":l=o[s+1];break;case"Home":l=o[0];break;case"End":l=o.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(s,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=this.#b(t.id),d=(f)=>f.find((h)=>!c.includes(h.dataset.card)),u=(d(o.slice(s+1))??d(o.slice(0,s).reverse()))?.dataset.card;n.querySelector(":scope > .b3-board-card-head .b3-board-remove")?.click(),requestAnimationFrame(()=>{if(n.isConnected)return;let f=u!==void 0&&this.querySelector(`[data-card="${CSS.escape(u)}"]`),h=this.querySelector(`[data-column="${CSS.escape(a.dataset.column??"")}"] .b3-board-column-name`),b=f||h;if(b)this.#O(b)});return}default:return}if(e.preventDefault(),l)this.#O(l)}#W(){let e=[...this.querySelectorAll(".b3-board-filters > .b3-board-chip")],t=e.find((r)=>r.textContent===this.#B)??e[0];return t?.focus(),!!t}#B=null;#Y(e){let t=e.target;if(!t.matches(".b3-board-chip")||e.altKey||e.metaKey||e.ctrlKey)return;let r=[...this.querySelectorAll(".b3-board-filters > .b3-board-chip")],n=r.indexOf(t);if(this.#B=t.textContent,e.key==="ArrowDown"||e.key==="Escape"){e.preventDefault(),this.focusCard();return}if(e.key===" "||e.key==="Enter"){if(e.preventDefault(),!e.repeat)t.click();return}if(e.key!=="ArrowLeft"&&e.key!=="ArrowRight")return;e.preventDefault();let i=e.key==="ArrowLeft"!==(getComputedStyle(this).direction==="rtl")?-1:1,a=r[n+i];if(a)this.#B=a.textContent,a.focus()}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.#O(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+",o=[["↑ ↓","Previous / next card"],["↑ (top card)","Filter tags: ← → pick, Space toggle, ↓ back"],["← →","Card in the next column"],["Home End","First / last card"],["Space","Expand / collapse"],["Enter","Edit the title"],...this.readonly?[]:[["⇧↑ ⇧↓","Select more cards (moves and Delete act on all; Esc drops)"],[`${a}click ⇧click`,"Select cards with the mouse"],[`${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 s=this.ownerDocument.createElement("dl");for(let[l,c]of o){let d=this.ownerDocument.createElement("div"),u=this.ownerDocument.createElement("dt"),f=this.ownerDocument.createElement("dd");for(let h of l.split(" ")){let b=this.ownerDocument.createElement("kbd");b.textContent=h,u.append(b)}f.textContent=c,d.append(u,f),s.append(d)}return r.append(s),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}#J(){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)}}#G(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,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.#s(r)}#$(){let e=this.ownerDocument,t=e.activeElement;if(!this.#N||!this.#e?.selected||t&&t!==e.body&&t!==e.documentElement)return;this.querySelector(`.b3-board-cards > [data-card="${CSS.escape(String(this.#e.selected))}"]`)?.focus({preventScroll:!0})}#I(e){requestAnimationFrame(()=>this.querySelector(`[data-card="${CSS.escape(String(e))}"]`)?.focus({preventScroll:!1}))}#R(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})})}#N=!1;#X(){this.#d?.abort(),this.#d=new AbortController;let e=this.#d.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",(s)=>this.#ee(s),{signal:e}),this.addEventListener("mousedown",(s)=>{if(this.#e?.editing&&s.target.closest?.(".b3-board-actions > button, .b3-board-star")&&this.contains(this.ownerDocument.activeElement))s.preventDefault()},{signal:e,capture:!0}),t.addEventListener("pointermove",(s)=>this.#te(s),{signal:e}),t.addEventListener("pointerup",(s)=>this.#re(s),{signal:e}),t.addEventListener("pointercancel",(s)=>{if(s.pointerId===this.#r?.pointerId)this.#m()},{signal:e}),t.addEventListener("keydown",(s)=>{if(s.key==="Escape"&&this.#r?.started)s.preventDefault(),this.#m()},{signal:e}),this.addEventListener("touchmove",(s)=>{if(this.#r?.started)s.preventDefault()},{signal:e,passive:!1}),this.addEventListener("contextmenu",(s)=>{if(this.#r)s.preventDefault()},{signal:e}),this.addEventListener("focusin",(s)=>{let l=s.target,c=l.parentElement;if(!c?.matches(".b3-board-filters"))return;c.style.scrollPaddingInlineEnd=`${c.querySelector(":scope > .b3-board-search")?.offsetWidth??0}px`,l.scrollIntoView({inline:"nearest",block:"nearest"})},{signal:e}),this.addEventListener("focusin",(s)=>{this.#N=!0;let l=s.target.closest?.(".b3-board-card"),c=this.#e;if(!l||!c||!this.contains(l))return;let d=l.dataset.card??null;if(d!=null&&c.picked.includes(d)&&c.selected!=null)c.picked=[...c.picked.filter((u)=>u!==d),String(c.selected)];c.selected=d},{signal:e}),this.addEventListener("focusout",(s)=>{let l=s.relatedTarget;if(l&&!this.contains(l)){this.#N=!1;return}if(!l)requestAnimationFrame(()=>requestAnimationFrame(()=>this.#$()))},{signal:e}),t.addEventListener("focus",()=>queueMicrotask(()=>this.#$()),{signal:e}),this.addEventListener("click",(s)=>{let l=this.ownerDocument.getSelection(),c=s.target;if(!this.#y&&l&&!l.isCollapsed&&(c.contains(l.anchorNode)||l.containsNode(c,!0))&&!c.closest?.("button, .b3-board-grip, .b3-board-card-head>.b3-board-title")){s.preventDefault(),s.stopImmediatePropagation();return}if(!this.#y)return;this.#y=!1,s.preventDefault(),s.stopImmediatePropagation()},{signal:e,capture:!0});let n='button, a, input, textarea, select, [contenteditable]:not([contenteditable="false"])',i=(s)=>{let l=s.target,c=l.closest?.(".b3-board-card");return c&&this.contains(c)&&!l.closest(n)&&(s.metaKey||s.ctrlKey||s.shiftKey)&&!s.altKey?c:null};this.addEventListener("mousedown",(s)=>{if(i(s))s.preventDefault()},{signal:e,capture:!0}),this.addEventListener("click",(s)=>{let l=this.#e,c=i(s);if(!l)return;if(!c){if(l.picked.length&&s.target.closest?.(".b3-board-card")&&!s.target.closest(n))l.picked=[];return}s.preventDefault(),s.stopImmediatePropagation();let d=c.dataset.card,u=l.selected!=null?String(l.selected):null,f=new Set(l.picked);if(s.shiftKey&&u!=null){let h=[...c.closest(".b3-board-cards").querySelectorAll(":scope > .b3-board-card")].map((m)=>m.dataset.card),b=h.indexOf(u),p=h.indexOf(d);for(let m of b<0?[u]:h.slice(Math.min(b,p),Math.max(b,p)+1))f.add(m)}else if(d===u||f.has(d)){f.delete(d);let h=[...f].at(-1);if(d===u&&h!==void 0)return f.delete(h),l.picked=[...f],void this.focusCard(h);l.picked=[...f];return}else if(u!=null)f.add(u);f.delete(d),l.picked=[...f],this.#s(`${f.size+1} cards selected`),c.focus({preventScroll:!0})},{signal:e,capture:!0}),this.addEventListener("keydown",(s)=>{if(s.key!=="?"||s.defaultPrevented||s.metaKey||s.ctrlKey||s.altKey||s.isComposing)return;if(s.target.closest?.('input, textarea, select, [contenteditable]:not([contenteditable="false"]), .b3-board-keys'))return;s.preventDefault(),this.showShortcuts()},{signal:e}),this.addEventListener("keydown",(s)=>{if(s.defaultPrevented||s.altKey||!(s.metaKey||s.ctrlKey))return;if(s.target.closest?.('input, textarea, select, [contenteditable]:not([contenteditable="false"])'))return;let l=s.key.toLowerCase(),c=l==="y"||l==="z"&&s.shiftKey;if(l!=="z"&&l!=="y")return;if(s.preventDefault(),c)this.redo();else this.undo()},{signal:e});let a=(s)=>this.#Z(s);this.addEventListener("click",a,{signal:e,capture:!0}),this.addEventListener("auxclick",(s)=>{if(s.button===1)a(s)},{signal:e,capture:!0});let o=()=>this.#H();this.addEventListener("compositionstart",()=>{this.#x=!0},{signal:e}),this.addEventListener("compositionend",o,{signal:e}),this.addEventListener("focusout",o,{signal:e})}#H(){this.#x=!1;for(let e of this.#C.splice(0))e()}#Z(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)=>x(c.id,r("[data-column]")?.dataset.column)),i=n?.cards.find((c)=>x(c.id,r("[data-card]")?.dataset.card)),a=i&&C(i).find((c)=>x(c.id,r("[data-subtask]")?.dataset.subtask)),o={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)o.subtask=a.id;let s=t.querySelector("img");if(s&&!o.newTab&&e.type==="click"){e.preventDefault(),this.#Q(t,s,o);return}if(!t.dispatchEvent(new CustomEvent("b3-link",{bubbles:!0,cancelable:!0,detail:o}))||o.file)e.preventDefault()}#Q(e,t,r){let n=this.ownerDocument;n.body.querySelector(":scope > .b3-board-lightbox")?.dispatchEvent(new CustomEvent("b3-close")),ar();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 o=n.createElement("button");o.type="button",o.className="b3-board-lightbox-open",o.textContent="Open",i.append(a,o);let s=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 s?.focus?.({preventScroll:!0})};i.addEventListener("b3-close",c),i.addEventListener("click",(d)=>{if(d.target===i)c()}),o.addEventListener("pointerdown",(d)=>d.stopPropagation()),o.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})}#ee(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-grip, .b3-board-card-head>.b3-board-title")?t.closest(".b3-board-card"):null;if(!i&&t.closest(".b3-board-card"))return;let a=!i&&t.closest(".b3-board-column-header")?t.closest(".b3-board-column"):null,o=i??a;if(!o)return;if(n={kind:i?"card":"column",id:i?i.dataset.card:a.dataset.column,node:o,pointerId:e.pointerId,x:e.clientX,y:e.clientY,started:!1,hold:0},i)n.ids=this.#b(n.id)}if(!this.contains(n.node))return;if(this.#r=n,e.pointerType!=="mouse")n.hold=window.setTimeout(()=>{if(this.#r===n)this.#z(e.clientX,e.clientY)},ba)}#z(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 o of[i,...i.querySelectorAll("[id]")])o.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","");for(let o of this.#j(r))o.setAttribute("data-b3-dragging","");if((r.ids?.length??0)>1)i.dataset.b3Count=String(r.ids.length);this.ownerDocument.getSelection()?.removeAllRanges(),r.px=e,r.py=t;let a=()=>{if(this.#r!==r)return;this.#ie(r.px,r.py),this.#ne(this.#U(r.px,r.py)),r.frame=requestAnimationFrame(a)};r.frame=requestAnimationFrame(a)}#te(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.#m();return}if(r<5)return;this.#z(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}#re(e){let t=this.#r;if(!t||e.pointerId!==t.pointerId)return;if(!t.started)return this.#m();let r=this.#U(e.clientX,e.clientY);if(this.#m(),this.#y=!0,setTimeout(()=>{this.#y=!1},0),!r)return;let n=this.#e;if(t.kind==="card")this.#S(t.ids??[t.id],r.column,r.before),this.#I(t.id);else if(t.kind==="subtask"){let i=this.#a(t.card);if(!i)return;let a=C(i),o=r.before?a.findIndex((s)=>x(s.id,r.before)):a.length;if(a.findIndex((s)=>x(s.id,t.id))<o)o-=1;this.#P(i,t.id,o)}else{let i=r.before?n.columns.findIndex((o)=>x(o.id,r.before)):n.columns.length;if(n.columns.findIndex((o)=>x(o.id,t.id))<i)i-=1;this.moveColumn(t.id,i)}}#U(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.#q(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((h)=>{let b=h.getBoundingClientRect();return t<b.top+b.height/2}),f=(h)=>!!(h!=null&&this.#a(h)?.starred);if(f(u?.dataset.card)!==f(r.id)&&(u||f(r.id)))u=d.find((h)=>!f(h.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])")],o=getComputedStyle(this).direction==="rtl";return{column:"",before:a.find((l)=>{let c=l.getBoundingClientRect();return o?e>c.left+c.width/2:e<c.left+c.width/2})?.dataset.column??null,list:i}}#ne(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")}#q(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})}#ie(e,t){let r=(o,s,l)=>o<s+40?-12:o>l-40?12:0,n=this.querySelector(".b3-board-columns");if(n){let o=n.getBoundingClientRect();n.scrollLeft+=r(e,o.left,o.right)}let i=this.#r?.kind==="card"?this.#q(e,this.ownerDocument.elementFromPoint(e,t))?.querySelector(".b3-board-cards"):null;if(i&&i.scrollHeight>i.clientHeight){let o=i.getBoundingClientRect();i.scrollTop+=r(t,o.top,o.bottom)}let a=this.ownerDocument.defaultView;a.scrollBy(0,r(t,0,a.innerHeight))}#j(e){return(e.ids??[]).map((t)=>this.querySelector(`.b3-board-cards > [data-card="${CSS.escape(t)}"]`)).filter((t)=>!!t)}#m(){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.#j(e))t.removeAttribute("data-b3-dragging");for(let t of this.querySelectorAll("[data-b3-drop]"))t.removeAttribute("data-b3-drop")}}br("b3-board",bi);export{bi as B3Board};
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.1.0-alpha.147",
2
+ "version": "0.1.0-alpha.149",
3
3
  "cssSha256": "a1e97a6aa21ed495e8de168d029455630332805d056b112c8e40fe7127611142",
4
4
  "classes": [
5
5
  "b3-accordion",
@@ -80,6 +80,11 @@ typed, and a `b3-change` listener receives `CustomEvent<BoardChangeDetail>` (`b3
80
80
  to the page (a re-render, a closed sheet, the page getting the keyboard back) returns to it. A `columns`
81
81
  write keeps the focused card focused (or the one now in its place). `board.focusCard(id?)` focuses that
82
82
  card, else the selected one, else the first — where a host's arrows start or its menu hands the keyboard back.
83
+ - **Multi-select**: Cmd/Ctrl-click picks or unpicks a card, Shift-click picks the shown cards from the
84
+ selected one to it (one column), Shift+Up/Down extends the selection card by card (back onto a picked
85
+ card shrinks it); a plain arrow, a plain click on a card or Esc drops the picks. Alt+arrows, a drag of a
86
+ picked card and Delete (its button reads "Delete N?") act on every selected card in board order, as one
87
+ undo step; Alt+Up/Down needs them in one column.
83
88
  - **Edit**: activating a title, column name, description or subtask edits it in place. Enter
84
89
  commits (Shift+Enter is a new line in a description), Escape cancels, leaving the field commits.
85
90
  An empty title is refused; an empty subtask is removed. Enter on a new card's title goes on to its
@@ -120,6 +125,8 @@ typed, and a `b3-change` listener receives `CustomEvent<BoardChangeDetail>` (`b3
120
125
  does; it is reported once named. With no argument it uses `default-column` (`board.defaultColumn`, an
121
126
  id or name), else the first column. Returns false when readonly or the column does not exist. Wire it
122
127
  to the host's own shortcut, e.g. `default-column="TODO"` and N.
128
+ - **Newest on top**: `top-columns="Backlog,Done"` (`board.topColumns`, ids or names) — a new card there
129
+ (addCard or the column's +) starts on top, under any starred cards.
123
130
  - **Links**: `[text](target)` and bare `http(s)://` URLs in a title, description or subtask render as
124
131
  links, built as DOM nodes (never as HTML). Only http, https, mailto, paths and the schemes named in the
125
132
  `link-schemes` attribute (e.g. `link-schemes="bare"` for `bare://…`; space or comma separated) link; any other scheme,
@@ -158,7 +165,7 @@ typed, and a `b3-change` listener receives `CustomEvent<BoardChangeDetail>` (`b3
158
165
 
159
166
  ## Attributes and styling
160
167
 
161
- - `search`, `searchable`, `default-column`, `link-schemes`: see Search, Add and Links above.
168
+ - `search`, `searchable`, `default-column`, `top-columns`, `link-schemes`: see Search, Add and Links above.
162
169
  - `expand-in="Doing"`: column names (comma separated, any case) whose cards with details show them open by default.
163
170
  A card's own `expanded` (`true` or `false`) still wins; moving a card into or out of such a column clears it, so it
164
171
  takes the new column's default.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@livx.cc/bare-v3",
3
- "version": "0.1.0-alpha.147",
3
+ "version": "0.1.0-alpha.149",
4
4
  "type": "module",
5
5
  "thirdPartyNotices": "./dist/third-party.json",
6
6
  "files": [