@erickxavier/no-js 1.8.2 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/cjs/no.js +9 -6
- package/dist/cjs/no.js.map +3 -3
- package/dist/esm/no.js +9 -6
- package/dist/esm/no.js.map +3 -3
- package/dist/iife/no.js +9 -6
- package/dist/iife/no.js.map +3 -3
- package/package.json +2 -3
- package/src/evaluate.js +1038 -93
- package/src/globals.js +0 -1
- package/src/index.js +5 -1
package/README.md
CHANGED
|
@@ -31,7 +31,7 @@ No build step. No virtual DOM. No transpiler. No JSX. Just HTML.
|
|
|
31
31
|
- **Filters** — `uppercase`, `currency`, `date`, `truncate`, 32 built-in pipes
|
|
32
32
|
- **Drag & Drop** — `drag`, `drop`, `drag-image`, `drag-data`, `drop-zone`
|
|
33
33
|
- **Custom Directives** — Extend with `NoJS.directive()`
|
|
34
|
-
- **~
|
|
34
|
+
- **~24 KB gzipped** — Zero dependencies
|
|
35
35
|
|
|
36
36
|
---
|
|
37
37
|
|
|
@@ -157,5 +157,5 @@ Contributions are welcome! Please open an issue or submit a pull request.
|
|
|
157
157
|
|
|
158
158
|
<p align="center">
|
|
159
159
|
<strong>No.JS</strong> — Because the best JavaScript is the JavaScript you don't write.<br>
|
|
160
|
-
<code>~
|
|
160
|
+
<code>~24 KB gzipped</code> · <code>Zero dependencies</code> · <code>MIT License</code>
|
|
161
161
|
</p>
|
package/dist/cjs/no.js
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* No.JS v1.
|
|
2
|
+
* No.JS v1.9.0 — The HTML-First Reactive Framework
|
|
3
3
|
* No more JavaScript. Just HTML attributes with superpowers.
|
|
4
|
+
* @author exs.dev
|
|
5
|
+
* @homepage https://no-js.dev
|
|
4
6
|
* @license MIT
|
|
5
7
|
* @see https://github.com/ErickXavier/no-js
|
|
6
8
|
*/
|
|
7
|
-
var Wt=Object.defineProperty;var Me=Object.getOwnPropertyDescriptor;var Oe=Object.getOwnPropertyNames;var Re=Object.prototype.hasOwnProperty;var ie=(t,r)=>()=>(t&&(r=t(t=0)),r);var ae=(t,r)=>{for(var e in r)Wt(t,e,{get:r[e],enumerable:!0})},Pe=(t,r,e,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of Oe(r))!Re.call(t,o)&&o!==e&&Wt(t,o,{get:()=>r[o],enumerable:!(n=Me(r,o))||n.enumerable});return t};var Fe=t=>Pe(Wt({},"__esModule",{value:!0}),t);function Kt(t){ut=t}function ce(t){X=t}function G(...t){_.debug&&console.log("[No.JS]",...t)}function st(...t){console.warn("[No.JS]",...t)}function _t(){for(let t of It){if(t._el&&!t._el.isConnected){It.delete(t);continue}t()}}function V(t,r,e){let n=r.$watch(e);q(()=>{n(),It.delete(e)}),typeof t=="string"&&t.includes("$store")&&It.add(e)}function q(t){ut&&(ut.__disposers=ut.__disposers||[],ut.__disposers.push(t))}function vt(t,r){(At[t]||[]).forEach(e=>e(r))}var _,kt,At,J,It,B,pt,zt,mt,X,ut,Q=ie(()=>{_={baseApiUrl:"",headers:{},timeout:1e4,retries:0,retryDelay:1e3,credentials:"same-origin",csrf:null,cache:{strategy:"none",ttl:3e5},templates:{cache:!0},router:{useHash:!1,base:"/",scrollBehavior:"top",templates:"pages",ext:".tpl"},i18n:{defaultLocale:"en",fallbackLocale:"en",detectBrowser:!1,loadPath:null,ns:[],cache:!0,persist:!1},debug:!1,devtools:!1,csp:null,sanitize:!0},kt={request:[],response:[]},At={},J={},It=new Set,B={},pt={},zt=new Map,mt={},X=null,ut=null});var le={};ae(le,{_deepMerge:()=>Vt,_i18n:()=>K,_i18nCache:()=>Jt,_i18nListeners:()=>Lt,_loadI18nForLocale:()=>Yt,_loadI18nNamespace:()=>Gt,_loadLocale:()=>jt,_loadedNs:()=>Xt,_notifyI18n:()=>Dt,_watchI18n:()=>Ht});function Ht(t){return Lt.add(t),()=>Lt.delete(t)}function Dt(){for(let t of Lt){if(t._el&&!t._el.isConnected){Lt.delete(t);continue}t()}}function Vt(t,r){let e={...t};for(let n of Object.keys(r))r[n]&&typeof r[n]=="object"&&!Array.isArray(r[n])&&t[n]&&typeof t[n]=="object"&&!Array.isArray(t[n])?e[n]=Vt(t[n],r[n]):e[n]=r[n];return e}async function jt(t,r){let e=r?`${t}:${r}`:t;if(_.i18n.cache&&Jt.has(e))return;let n=_.i18n.loadPath.replace("{locale}",t);if(r)n=n.replace("{ns}",r);else if(n.includes("{ns}"))return;try{let o=await fetch(n);if(!o.ok){st(`i18n: failed to load ${n} (${o.status})`);return}let s=await o.json();K.locales[t]=Vt(K.locales[t]||{},s),_.i18n.cache&&Jt.set(e,s)}catch(o){st(`i18n: error loading ${n}`,o)}}async function Yt(t){if(!_.i18n.loadPath)return;let r=_.i18n.ns;!r.length||!_.i18n.loadPath.includes("{ns}")?await jt(t,null):await Promise.all(r.map(e=>jt(t,e)))}async function Gt(t){if(!_.i18n.loadPath)return;Xt.add(t);let r=new Set([K.locale,_.i18n.fallbackLocale]);await Promise.all([...r].map(e=>jt(e,t)))}var Lt,Jt,Xt,K,gt=ie(()=>{Q();Lt=new Set;Jt=new Map,Xt=new Set;K={_locale:"en",locales:{},get locale(){return this._locale},set locale(t){if(this._locale!==t){if(this._locale=t,_.i18n.persist&&typeof localStorage<"u")try{localStorage.setItem("nojs-locale",t)}catch{}if(_.i18n.loadPath){let r=new Set([..._.i18n.ns,...Xt]);Promise.all([...r].map(e=>jt(t,e))).then(()=>Dt())}else Dt()}},t(t,r={}){let e=K.locales[K.locale]||K.locales[_.i18n.fallbackLocale]||{},n=t.split(".").reduce((o,s)=>o?.[s],e);if(n==null)return t;if(typeof n=="string"&&n.includes("|")&&r.count!=null){let o=n.split("|").map(s=>s.trim());n=Number(r.count)===1?o[0]:o[1]||o[0]}return typeof n=="string"&&(n=n.replace(/\{(\w+)\}/g,(o,s)=>r[s]!=null?r[s]:"")),n}}});var dr={};ae(dr,{default:()=>lr});module.exports=Fe(dr);Q();gt();Q();gt();Q();gt();var Tt=new Map;function tt(t,r){!_.devtools||typeof window>"u"||window.dispatchEvent(new CustomEvent("nojs:devtools",{detail:{type:t,data:r,timestamp:Date.now()}}))}function Qt(t){if(!t||!t.__isProxy)return null;let r=t.__raw,e={};for(let n of Object.keys(r)){if(n.startsWith("__"))continue;let o=r[n];if(o&&typeof o=="object"&&o.__isProxy)e[n]=Qt(o);else try{JSON.stringify(o),e[n]=o}catch{e[n]=String(o)}}return e}function de(t){if(!t||!t.tagName)return null;let r=t.tagName.toLowerCase(),e=t.id?`#${t.id}`:"",n=t.className&&typeof t.className=="string"?"."+t.className.trim().split(/\s+/).join("."):"";return r+e+n}function ue(t){let r=document.querySelector(t);if(!r)return{error:"Element not found",selector:t};let e=r.__ctx;return{selector:t,tag:de(r),hasContext:!!e,contextId:e?.__raw?.__devtoolsId??null,data:e?Qt(e):null,directives:[...r.attributes].filter(n=>!["class","id","style"].includes(n.name)).map(n=>({name:n.name,value:n.value}))}}function fe(t){let r=J[t];return r?{name:t,contextId:r.__raw?.__devtoolsId??null,data:Qt(r)}:{error:"Store not found",name:t}}function pe(t){let r=t?document.querySelector(t):document.body;if(!r)return{error:"Root not found",selector:t};function e(n){let o=n.__ctx,s={tag:de(n),contextId:o?.__raw?.__devtoolsId??null,children:[]};for(let i of n.children)i.tagName==="TEMPLATE"||i.tagName==="SCRIPT"||(i.__ctx||i.__declared)&&s.children.push(e(i));return s}return e(r)}function me(t,r,e){let n=Tt.get(t);return n?(n[r]=e,{ok:!0,id:t,key:r}):{error:"Context not found",id:t}}function ge(t,r,e){let n=J[t];return n?(n[r]=e,{ok:!0,name:t,key:r}):{error:"Store not found",name:t}}function he(){let t=0;for(let[,r]of Tt)r.__listeners&&(t+=r.__listeners.size);return{contexts:Tt.size,stores:Object.keys(J).length,listeners:t,refs:Object.keys(mt).length,hasRouter:!!X,locale:K.locale}}var Ct=null;function be(t){Zt();let r=document.querySelector(t);if(!r)return;let e=r.getBoundingClientRect();Ct=document.createElement("div"),Ct.id="__nojs_devtools_highlight__",Object.assign(Ct.style,{position:"fixed",top:e.top+"px",left:e.left+"px",width:e.width+"px",height:e.height+"px",background:"rgba(66, 133, 244, 0.25)",border:"2px solid rgba(66, 133, 244, 0.8)",pointerEvents:"none",zIndex:"2147483647",borderRadius:"3px"}),document.body.appendChild(Ct)}function Zt(){Ct&&(Ct.remove(),Ct=null)}function qe(t){let{command:r,args:e={}}=t.detail||{},n;switch(r){case"inspect:element":n=ue(e.selector);break;case"inspect:store":n=fe(e.name);break;case"inspect:tree":n=pe(e.selector);break;case"mutate:context":n=me(e.id,e.key,e.value);break;case"mutate:store":n=ge(e.name,e.key,e.value);break;case"get:config":n={..._};break;case"get:routes":n=X?X.routes||[]:[];break;case"get:stats":n=he();break;case"highlight:element":be(e.selector),n={ok:!0};break;case"unhighlight":Zt(),n={ok:!0};break;default:n={error:"Unknown command",command:r}}window.dispatchEvent(new CustomEvent("nojs:devtools:response",{detail:{command:r,result:n,timestamp:Date.now()}}))}function ye(t){!_.devtools||typeof window>"u"||(window.addEventListener("nojs:devtools:cmd",qe),window.__NOJS_DEVTOOLS__={stores:J,config:_,refs:mt,router:X,version:t.version,inspect:r=>ue(r),inspectStore:r=>fe(r),inspectTree:r=>pe(r),stats:()=>he(),mutate:(r,e,n)=>me(r,e,n),mutateStore:(r,e,n)=>ge(r,e,n),highlight:r=>be(r),unhighlight:()=>Zt(),on:(r,e)=>{let n=o=>{(!r||o.detail.type===r)&&e(o.detail)};return window.addEventListener("nojs:devtools",n),()=>window.removeEventListener("nojs:devtools",n)}},console.log("[No.JS DevTools] enabled \u2014 access via window.__NOJS_DEVTOOLS__"))}var Ue=0,We=new Set,ze=0;function F(t={},r=null){let e=new Set,n={};Object.assign(n,t),_.devtools&&(n.__devtoolsId=++ze);let o=!1;function s(){if(!o){o=!0;try{if(Ue>0)for(let c of e){if(c._el&&!c._el.isConnected){e.delete(c);continue}We.add(c)}else for(let c of e){if(c._el&&!c._el.isConnected){e.delete(c);continue}c()}}finally{o=!1}}}let i={get(c,l){if(l==="__isProxy")return!0;if(l==="__raw")return c;if(l==="__listeners")return e;if(l==="$watch")return d=>(ut&&(d._el=ut),e.add(d),()=>e.delete(d));if(l==="$notify")return s;if(l==="$set")return(d,f)=>{let y=d.split(".");if(y.length===1)a[d]=f;else{let u=a;for(let p=0;p<y.length-1;p++)if(u=u[y[p]],u==null)return;let h=y[y.length-1],b=u[h];u[h]=f,b!==f&&s()}};if(l==="$parent")return r;if(l==="$refs")return mt;if(l==="$store")return J;if(l==="$route")return X?X.current:{};if(l==="$router")return X;if(l==="$i18n")return K;if(l==="$form")return c.$form||null;if(l in c)return c[l];if(r&&r.__isProxy)return r[l]},set(c,l,d){let f=c[l];return c[l]=d,f!==d&&(s(),tt("ctx:updated",{id:c.__devtoolsId,key:l,oldValue:f,newValue:d})),!0},has(c,l){return l in c?!0:r&&r.__isProxy?l in r:!1}},a=new Proxy(n,i);return _.devtools&&n.__devtoolsId&&(Tt.set(n.__devtoolsId,a),tt("ctx:created",{id:n.__devtoolsId,parentId:r?.__raw?.__devtoolsId??null,keys:Object.keys(t),elementTag:ut?.tagName?.toLowerCase()??null})),a}function te(t){let r=new Set,e={},n=t;for(;n&&n.__isProxy;){let o=n.__raw;for(let s of Object.keys(o))r.has(s)||(r.add(s),e[s]=o[s]);n=n.$parent}return{keys:[...r],vals:e}}Q();gt();var _e=new Map;function Et(t,r,e){let n={};for(let l=0;l<r.length;l++)n[r[l]]=e[l];function o(l,d){return l.split(".").reduce((f,y)=>f?.[y],d)}function s(l){let d=l.trim();if(d==="true")return!0;if(d==="false")return!1;if(d==="null")return null;if(d!=="undefined")return/^-?\d+(\.\d+)?$/.test(d)?Number(d):/^(['"`]).*\1$/.test(d)?d.slice(1,-1):o(d,n)}let i=t.trim(),a=i.match(/^(.+?)\s*\?\s*(.+?)\s*:\s*(.+)$/);if(a){let l=Et(a[1].trim(),r,e);return Et(l?a[2].trim():a[3].trim(),r,e)}if(i.includes("||")){let l=i.split("||");for(let d of l){let f=Et(d.trim(),r,e);if(f)return f}return Et(l[l.length-1].trim(),r,e)}if(i.includes("&&")){let l=i.split("&&"),d;for(let f of l)if(d=Et(f.trim(),r,e),!d)return d;return d}let c=i.match(/^(.+?)\s*(===|!==|==|!=|>=|<=|>|<)\s*(.+)$/);if(c){let l=s(c[1]),d=s(c[3]);switch(c[2]){case"===":return l===d;case"!==":return l!==d;case"==":return l==d;case"!=":return l!=d;case">=":return l>=d;case"<=":return l<=d;case">":return l>d;case"<":return l<d}}return i.startsWith("!")?!Et(i.slice(1).trim(),r,e):s(i)}function Ke(t){let r=[],e="",n=0,o=!1,s="";for(let i=0;i<t.length;i++){let a=t[i];if(o){e+=a,a===s&&t[i-1]!=="\\"&&(o=!1);continue}if(a==="'"||a==='"'||a==="`"){o=!0,s=a,e+=a;continue}if(a==="("||a==="["||a==="{"){n++,e+=a;continue}if(a===")"||a==="]"||a==="}"){n--,e+=a;continue}if(a==="|"&&n===0&&t[i+1]!=="|"&&t[i-1]!=="|"){r.push(e.trim()),e="";continue}e+=a}return r.push(e.trim()),r}function Je(t,r){let e=r.indexOf(":"),n,o;e===-1?(n=r.trim(),o=null):(n=r.substring(0,e).trim(),o=r.substring(e+1).trim());let s=B[n];if(!s)return st(`Unknown filter: ${n}`),t;let i=o?Ve(o):[];return s(t,...i)}function Ve(t){let r=[],e="",n=!1,o="";for(let s of t){if(n){if(s===o){n=!1;continue}e+=s;continue}if(s==="'"||s==='"'){n=!0,o=s;continue}if(s===","){r.push(e.trim()),e="";continue}e+=s}return e.trim()&&r.push(e.trim()),r.map(s=>{let i=Number(s);return isNaN(i)?s:i})}function C(t,r){if(!(t==null||t===""))try{let e=Ke(t),n=e[0],{keys:o,vals:s}=te(r),i=["$store","$route","$router","$i18n","$refs","$form"];for(let d of i)o.includes(d)||(o.push(d),s[d]=r[d]);let a=o,c=a.map(d=>s[d]),l;if(_.csp==="strict")l=Et(n,a,c);else{let d=n+"|"+a.join(","),f=_e.get(d);f||(f=new Function(...a,`return (${n})`),_e.set(d,f)),l=f(...c)}for(let d=1;d<e.length;d++)l=Je(l,e[d]);return l}catch{return}}function et(t,r,e={}){try{let{keys:n,vals:o}=te(r),s={$store:J,$route:X?.current,$router:X,$i18n:K,$refs:r.$refs};Object.assign(s,e);for(let[u,h]of Object.entries(s))n.includes(u)||(n.push(u),o[u]=h);let i=[...n],a=i.map(u=>o[u]),c=new Set,l=r;for(;l&&l.__isProxy;){for(let u of Object.keys(l.__raw))c.add(u);l=l.$parent}let d={};for(let u of c)!u.startsWith("$")&&u in o&&(d[u]=o[u]);let f=[...c].filter(u=>!u.startsWith("$")).map(u=>`{let _c=__ctx;while(_c&&_c.__isProxy){if('${u}'in _c.__raw){if(typeof ${u}!=='undefined'){if(${u}!==__orig['${u}'])_c.$set('${u}',${u});else if(typeof ${u}==='object'&&${u}!==null)_c.$notify();}break;}_c=_c.$parent;}}`).join(`
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
var zt=Object.defineProperty;var We=Object.getOwnPropertyDescriptor;var ze=Object.getOwnPropertyNames;var Ke=Object.prototype.hasOwnProperty;var fe=(t,n)=>()=>(t&&(n=t(t=0)),n);var pe=(t,n)=>{for(var r in n)zt(t,r,{get:n[r],enumerable:!0})},Ve=(t,n,r,e)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of ze(n))!Ke.call(t,i)&&i!==r&&zt(t,i,{get:()=>n[i],enumerable:!(e=We(n,i))||e.enumerable});return t};var Je=t=>Ve(zt({},"__esModule",{value:!0}),t);function Vt(t){ft=t}function me(t){G=t}function Z(...t){L.debug&&console.log("[No.JS]",...t)}function at(...t){console.warn("[No.JS]",...t)}function _t(){for(let t of It){if(t._el&&!t._el.isConnected){It.delete(t);continue}t()}}function Y(t,n,r){let e=n.$watch(r);U(()=>{e(),It.delete(r)}),typeof t=="string"&&t.includes("$store")&&It.add(r)}function U(t){ft&&(ft.__disposers=ft.__disposers||[],ft.__disposers.push(t))}function Et(t,n){(At[t]||[]).forEach(r=>r(n))}var L,Nt,At,J,It,B,mt,Kt,gt,G,ft,tt=fe(()=>{L={baseApiUrl:"",headers:{},timeout:1e4,retries:0,retryDelay:1e3,credentials:"same-origin",csrf:null,cache:{strategy:"none",ttl:3e5},templates:{cache:!0},router:{useHash:!1,base:"/",scrollBehavior:"top",templates:"pages",ext:".tpl"},i18n:{defaultLocale:"en",fallbackLocale:"en",detectBrowser:!1,loadPath:null,ns:[],cache:!0,persist:!1},debug:!1,devtools:!1,sanitize:!0},Nt={request:[],response:[]},At={},J={},It=new Set,B={},mt={},Kt=new Map,gt={},G=null,ft=null});var ge={};pe(ge,{_deepMerge:()=>Xt,_i18n:()=>V,_i18nCache:()=>Jt,_i18nListeners:()=>Lt,_loadI18nForLocale:()=>Gt,_loadI18nNamespace:()=>Qt,_loadLocale:()=>Ot,_loadedNs:()=>Yt,_notifyI18n:()=>Dt,_watchI18n:()=>Pt});function Pt(t){return Lt.add(t),()=>Lt.delete(t)}function Dt(){for(let t of Lt){if(t._el&&!t._el.isConnected){Lt.delete(t);continue}t()}}function Xt(t,n){let r={...t};for(let e of Object.keys(n))n[e]&&typeof n[e]=="object"&&!Array.isArray(n[e])&&t[e]&&typeof t[e]=="object"&&!Array.isArray(t[e])?r[e]=Xt(t[e],n[e]):r[e]=n[e];return r}async function Ot(t,n){let r=n?`${t}:${n}`:t;if(L.i18n.cache&&Jt.has(r))return;let e=L.i18n.loadPath.replace("{locale}",t);if(n)e=e.replace("{ns}",n);else if(e.includes("{ns}"))return;try{let i=await fetch(e);if(!i.ok){at(`i18n: failed to load ${e} (${i.status})`);return}let o=await i.json();V.locales[t]=Xt(V.locales[t]||{},o),L.i18n.cache&&Jt.set(r,o)}catch(i){at(`i18n: error loading ${e}`,i)}}async function Gt(t){if(!L.i18n.loadPath)return;let n=L.i18n.ns;!n.length||!L.i18n.loadPath.includes("{ns}")?await Ot(t,null):await Promise.all(n.map(r=>Ot(t,r)))}async function Qt(t){if(!L.i18n.loadPath)return;Yt.add(t);let n=new Set([V.locale,L.i18n.fallbackLocale]);await Promise.all([...n].map(r=>Ot(r,t)))}var Lt,Jt,Yt,V,ht=fe(()=>{tt();Lt=new Set;Jt=new Map,Yt=new Set;V={_locale:"en",locales:{},get locale(){return this._locale},set locale(t){if(this._locale!==t){if(this._locale=t,L.i18n.persist&&typeof localStorage<"u")try{localStorage.setItem("nojs-locale",t)}catch{}if(L.i18n.loadPath){let n=new Set([...L.i18n.ns,...Yt]);Promise.all([...n].map(r=>Ot(t,r))).then(()=>Dt())}else Dt()}},t(t,n={}){let r=V.locales[V.locale]||V.locales[L.i18n.fallbackLocale]||{},e=t.split(".").reduce((i,o)=>i?.[o],r);if(e==null)return t;if(typeof e=="string"&&e.includes("|")&&n.count!=null){let i=e.split("|").map(o=>o.trim());e=Number(n.count)===1?i[0]:i[1]||i[0]}return typeof e=="string"&&(e=e.replace(/\{(\w+)\}/g,(i,o)=>n[o]!=null?n[o]:"")),e}}});var Ar={};pe(Ar,{default:()=>xr});module.exports=Je(Ar);tt();ht();tt();ht();tt();ht();var Tt=new Map;function rt(t,n){!L.devtools||typeof window>"u"||window.dispatchEvent(new CustomEvent("nojs:devtools",{detail:{type:t,data:n,timestamp:Date.now()}}))}function Zt(t){if(!t||!t.__isProxy)return null;let n=t.__raw,r={};for(let e of Object.keys(n)){if(e.startsWith("__"))continue;let i=n[e];if(i&&typeof i=="object"&&i.__isProxy)r[e]=Zt(i);else try{JSON.stringify(i),r[e]=i}catch{r[e]=String(i)}}return r}function he(t){if(!t||!t.tagName)return null;let n=t.tagName.toLowerCase(),r=t.id?`#${t.id}`:"",e=t.className&&typeof t.className=="string"?"."+t.className.trim().split(/\s+/).join("."):"";return n+r+e}function ye(t){let n=document.querySelector(t);if(!n)return{error:"Element not found",selector:t};let r=n.__ctx;return{selector:t,tag:he(n),hasContext:!!r,contextId:r?.__raw?.__devtoolsId??null,data:r?Zt(r):null,directives:[...n.attributes].filter(e=>!["class","id","style"].includes(e.name)).map(e=>({name:e.name,value:e.value}))}}function be(t){let n=J[t];return n?{name:t,contextId:n.__raw?.__devtoolsId??null,data:Zt(n)}:{error:"Store not found",name:t}}function ve(t){let n=t?document.querySelector(t):document.body;if(!n)return{error:"Root not found",selector:t};function r(e){let i=e.__ctx,o={tag:he(e),contextId:i?.__raw?.__devtoolsId??null,children:[]};for(let s of e.children)s.tagName==="TEMPLATE"||s.tagName==="SCRIPT"||(s.__ctx||s.__declared)&&o.children.push(r(s));return o}return r(n)}function _e(t,n,r){let e=Tt.get(t);return e?(e[n]=r,{ok:!0,id:t,key:n}):{error:"Context not found",id:t}}function Ee(t,n,r){let e=J[t];return e?(e[n]=r,{ok:!0,name:t,key:n}):{error:"Store not found",name:t}}function we(){let t=0;for(let[,n]of Tt)n.__listeners&&(t+=n.__listeners.size);return{contexts:Tt.size,stores:Object.keys(J).length,listeners:t,refs:Object.keys(gt).length,hasRouter:!!G,locale:V.locale}}var Ct=null;function xe(t){te();let n=document.querySelector(t);if(!n)return;let r=n.getBoundingClientRect();Ct=document.createElement("div"),Ct.id="__nojs_devtools_highlight__",Object.assign(Ct.style,{position:"fixed",top:r.top+"px",left:r.left+"px",width:r.width+"px",height:r.height+"px",background:"rgba(66, 133, 244, 0.25)",border:"2px solid rgba(66, 133, 244, 0.8)",pointerEvents:"none",zIndex:"2147483647",borderRadius:"3px"}),document.body.appendChild(Ct)}function te(){Ct&&(Ct.remove(),Ct=null)}function Xe(t){let{command:n,args:r={}}=t.detail||{},e;switch(n){case"inspect:element":e=ye(r.selector);break;case"inspect:store":e=be(r.name);break;case"inspect:tree":e=ve(r.selector);break;case"mutate:context":e=_e(r.id,r.key,r.value);break;case"mutate:store":e=Ee(r.name,r.key,r.value);break;case"get:config":e={...L};break;case"get:routes":e=G?G.routes||[]:[];break;case"get:stats":e=we();break;case"highlight:element":xe(r.selector),e={ok:!0};break;case"unhighlight":te(),e={ok:!0};break;default:e={error:"Unknown command",command:n}}window.dispatchEvent(new CustomEvent("nojs:devtools:response",{detail:{command:n,result:e,timestamp:Date.now()}}))}function Ae(t){!L.devtools||typeof window>"u"||(window.addEventListener("nojs:devtools:cmd",Xe),window.__NOJS_DEVTOOLS__={stores:J,config:L,refs:gt,router:G,version:t.version,inspect:n=>ye(n),inspectStore:n=>be(n),inspectTree:n=>ve(n),stats:()=>we(),mutate:(n,r,e)=>_e(n,r,e),mutateStore:(n,r,e)=>Ee(n,r,e),highlight:n=>xe(n),unhighlight:()=>te(),on:(n,r)=>{let e=i=>{(!n||i.detail.type===n)&&r(i.detail)};return window.addEventListener("nojs:devtools",e),()=>window.removeEventListener("nojs:devtools",e)}},console.log("[No.JS DevTools] enabled \u2014 access via window.__NOJS_DEVTOOLS__"))}var Ye=0,Ge=new Set,Qe=0;function q(t={},n=null){let r=new Set,e={};Object.assign(e,t),L.devtools&&(e.__devtoolsId=++Qe);let i=!1;function o(){if(!i){i=!0;try{if(Ye>0)for(let c of r){if(c._el&&!c._el.isConnected){r.delete(c);continue}Ge.add(c)}else for(let c of r){if(c._el&&!c._el.isConnected){r.delete(c);continue}c()}}finally{i=!1}}}let s={get(c,d){if(d==="__isProxy")return!0;if(d==="__raw")return c;if(d==="__listeners")return r;if(d==="$watch")return f=>(ft&&(f._el=ft),r.add(f),()=>r.delete(f));if(d==="$notify")return o;if(d==="$set")return(f,u)=>{let _=f.split(".");if(_.length===1)a[f]=u;else{let p=a;for(let m=0;m<_.length-1;m++)if(p=p[_[m]],p==null)return;let v=_[_.length-1],E=p[v];p[v]=u,E!==u&&o()}};if(d==="$parent")return n;if(d==="$refs")return gt;if(d==="$store")return J;if(d==="$route")return G?G.current:{};if(d==="$router")return G;if(d==="$i18n")return V;if(d==="$form")return c.$form||null;if(d in c)return c[d];if(n&&n.__isProxy)return n[d]},set(c,d,f){let u=c[d];return c[d]=f,u!==f&&(o(),rt("ctx:updated",{id:c.__devtoolsId,key:d,oldValue:u,newValue:f})),!0},has(c,d){return d in c?!0:n&&n.__isProxy?d in n:!1}},a=new Proxy(e,s);return L.devtools&&e.__devtoolsId&&(Tt.set(e.__devtoolsId,a),rt("ctx:created",{id:e.__devtoolsId,parentId:n?.__raw?.__devtoolsId??null,keys:Object.keys(t),elementTag:ft?.tagName?.toLowerCase()??null})),a}function ee(t){let n=new Set,r={},e=t;for(;e&&e.__isProxy;){let i=e.__raw;for(let o of Object.keys(i))n.has(o)||(n.add(o),r[o]=i[o]);e=e.$parent}return{keys:[...n],vals:r}}tt();ht();var Le=new Map,re=new Map,Ze=new Set(["true","false","null","undefined","typeof","in","instanceof"]),tr=new Set(["__proto__","constructor","prototype"]),Ce=["===","!==","...","??","?.","==","!=",">=","<=","&&","||","+=","-=","*=","/=","%=","++","--","=>"],er=new Set(["+","-","*","/","%",">","<","!","=","|"]),rr=new Set(["(",")","[","]","{","}",".",",",":",";","?"]);function oe(t){if(typeof t!="string")return[];let n=[],r=t.length,e=0;for(;e<r;){let i=t[e];if(i===" "||i===" "||i===`
|
|
10
|
+
`||i==="\r"){e++;continue}if(i==="'"||i==='"'){let s=e,a=i;e++;let c="";for(;e<r&&t[e]!==a;)if(t[e]==="\\"){if(e++,e<r){let d=t[e];d==="n"?c+=`
|
|
11
|
+
`:d==="t"?c+=" ":d==="r"?c+="\r":c+=d,e++}}else c+=t[e++];e<r&&e++,n.push({type:"String",value:c,pos:s});continue}if(i==="`"){let s=e;e++;let a=[],c=[],d="";for(;e<r&&t[e]!=="`";)if(t[e]==="\\"&&e+1<r){let f=t[e+1];f==="n"?d+=`
|
|
12
|
+
`:f==="t"?d+=" ":f==="r"?d+="\r":d+=f,e+=2}else if(t[e]==="$"&&e+1<r&&t[e+1]==="{"){a.push(d),d="",e+=2;let f=1,u="";for(;e<r&&f>0;){if(t[e]==="{")f++;else if(t[e]==="}"){if(f--,f===0)break}else if(t[e]==="'"||t[e]==='"'||t[e]==="`"){let _=t[e];for(u+=_,e++;e<r&&t[e]!==_;)t[e]==="\\"?(u+=t[e++],e<r&&(u+=t[e++])):u+=t[e++];e<r&&(u+=t[e],e++);continue}u+=t[e++]}e<r&&e++,c.push(oe(u))}else d+=t[e++];e<r&&e++,a.push(d),n.push({type:"Template",parts:a,exprs:c,pos:s});continue}if(i>="0"&&i<="9"||i==="."&&e+1<r&&t[e+1]>="0"&&t[e+1]<="9"){let s=e,a="";for(;e<r&&(t[e]>="0"&&t[e]<="9"||t[e]===".");)a+=t[e++];n.push({type:"Number",value:a,pos:s});continue}if(i>="a"&&i<="z"||i>="A"&&i<="Z"||i==="_"||i==="$"){let s=e,a="";for(;e<r;){let c=t[e];if(c>="a"&&c<="z"||c>="A"&&c<="Z"||c>="0"&&c<="9"||c==="_"||c==="$")a+=c,e++;else break}tr.has(a)?n.push({type:"Forbidden",value:a,pos:s}):Ze.has(a)?n.push({type:"Keyword",value:a,pos:s}):n.push({type:"Ident",value:a,pos:s});continue}let o=!1;for(let s=0;s<Ce.length;s++){let a=Ce[s];if(t.startsWith(a,e)){let c=a==="..."||a==="?.";n.push({type:c?"Punc":"Op",value:a,pos:e}),e+=a.length,o=!0;break}}if(!o){if(er.has(i)){n.push({type:"Op",value:i,pos:e}),e++;continue}if(rr.has(i)){n.push({type:"Punc",value:i,pos:e}),e++;continue}e++}}return n}function se(t){if(!t||t.length===0)return{type:"Literal",value:void 0};let n=0;function r(){return t[n]}function e(){return t[n++]}function i(l,g){let b=t[n];return b?g!==void 0?b.type===l&&b.value===g:b.type===l:!1}function o(l,g){let b=t[n];return b&&b.type===l&&(g===void 0||b.value===g)?(n++,b):null}function s(){return a()}function a(){let l=c();if(i("Punc","?")){e();let g=a();o("Punc",":");let b=a();l={type:"ConditionalExpr",test:l,consequent:g,alternate:b}}return l}function c(){let l=d();if(i("Op","??")){e();let g=c();l={type:"BinaryExpr",op:"??",left:l,right:g}}return l}function d(){let l=f();for(;i("Op","||");){e();let g=f();l={type:"BinaryExpr",op:"||",left:l,right:g}}return l}function f(){let l=u();for(;i("Op","&&");){e();let g=u();l={type:"BinaryExpr",op:"&&",left:l,right:g}}return l}function u(){let l=_();for(;r()&&r().type==="Op"&&r().value==="|"&&(!t[n+1]||t[n+1].value!=="|");){e();let g=_();l={type:"BinaryExpr",op:"|",left:l,right:g}}return l}function _(){let l=p(),g=r();if(!g)return l;let b=["===","!==","==","!=",">=","<=",">","<"];if(g.type==="Op"&&b.indexOf(g.value)!==-1||g.type==="Keyword"&&(g.value==="in"||g.value==="instanceof")){let X=e().value,M=p();l={type:"BinaryExpr",op:X,left:l,right:M}}return l}function p(){let l=v();for(;r()&&r().type==="Op"&&(r().value==="+"||r().value==="-");){let g=e().value,b=v();l={type:"BinaryExpr",op:g,left:l,right:b}}return l}function v(){let l=E();for(;r()&&r().type==="Op"&&(r().value==="*"||r().value==="/"||r().value==="%");){let g=e().value,b=E();l={type:"BinaryExpr",op:g,left:l,right:b}}return l}function E(){let l=r();return l?l.type==="Keyword"&&l.value==="typeof"?(e(),{type:"UnaryExpr",op:"typeof",argument:E()}):l.type==="Op"&&(l.value==="!"||l.value==="-"||l.value==="+")?(e(),{type:"UnaryExpr",op:l.value,argument:E()}):l.type==="Op"&&(l.value==="++"||l.value==="--")?(e(),{type:"UnaryExpr",op:l.value,argument:E(),prefix:!0}):m():{type:"Literal",value:void 0}}function m(){let l=T(),g=r();return g&&g.type==="Op"&&(g.value==="++"||g.value==="--")&&(e(),l={type:"PostfixExpr",op:g.value,argument:l}),l}function T(){let l=h();for(;;){let g=r();if(!g)break;if(g.type==="Punc"&&g.value==="."){e();let b=r();if(b&&(b.type==="Ident"||b.type==="Keyword"))e(),l={type:"MemberExpr",object:l,property:{type:"Identifier",name:b.value},computed:!1};else if(b&&b.type==="Forbidden")e(),l={type:"Forbidden"};else break;continue}if(g.type==="Punc"&&g.value==="?."){e();let b=r();if(b&&b.type==="Punc"&&b.value==="("){e();let X=w();o("Punc",")"),l={type:"OptionalCallExpr",callee:l,args:X}}else if(b&&(b.type==="Ident"||b.type==="Keyword"))e(),l={type:"OptionalMemberExpr",object:l,property:{type:"Identifier",name:b.value},computed:!1};else if(b&&b.type==="Punc"&&b.value==="["){e();let X=s();o("Punc","]"),l={type:"OptionalMemberExpr",object:l,property:X,computed:!0}}else break;continue}if(g.type==="Punc"&&g.value==="["){e();let b=s();o("Punc","]"),l={type:"MemberExpr",object:l,property:b,computed:!0};continue}if(g.type==="Punc"&&g.value==="("){e();let b=w();o("Punc",")"),l={type:"CallExpr",callee:l,args:b};continue}break}return l}function w(){let l=[];if(i("Punc",")"))return l;for(l.push(y());i("Punc",",")&&(e(),!i("Punc",")"));)l.push(y());return l}function y(){return i("Punc","...")?(e(),{type:"SpreadElement",argument:s()}):s()}function A(){let l=n;if(i("Punc",")")){let g=t[n+1];return g&&g.type==="Op"&&g.value==="=>"?(n=l,!0):(n=l,!1)}for(;n<t.length;){let g=r();if(!g)break;if(g.type==="Ident"){if(e(),i("Punc",",")){e();continue}if(i("Punc",")")){let b=t[n+1];return b&&b.type==="Op"&&b.value==="=>"?(n=l,!0):(n=l,!1)}return n=l,!1}if(g.type==="Punc"&&g.value==="..."){if(e(),i("Ident")&&e(),i("Punc",")")){let b=t[n+1];if(b&&b.type==="Op"&&b.value==="=>")return n=l,!0}return n=l,!1}return n=l,!1}return n=l,!1}function S(){let l=[];if(i("Punc",")"))return l;for(i("Punc","...")?(e(),i("Ident")&&l.push("..."+e().value)):i("Ident")&&l.push(e().value);i("Punc",",")&&(e(),!i("Punc",")"));)i("Punc","...")?(e(),i("Ident")&&l.push("..."+e().value)):i("Ident")&&l.push(e().value);return l}function h(){let l=r();if(!l)return{type:"Literal",value:void 0};if(l.type==="Forbidden")return e(),{type:"Forbidden"};if(l.type==="Number")return e(),{type:"Literal",value:Number(l.value)};if(l.type==="String")return e(),{type:"Literal",value:l.value};if(l.type==="Template")return e(),{type:"TemplateLiteral",parts:l.parts,expressions:l.exprs.map(function(g){return se(g)})};if(l.type==="Keyword"){if(l.value==="true")return e(),{type:"Literal",value:!0};if(l.value==="false")return e(),{type:"Literal",value:!1};if(l.value==="null")return e(),{type:"Literal",value:null};if(l.value==="undefined")return e(),{type:"Literal",value:void 0}}if(l.type==="Punc"&&l.value==="["){e();let g=[];for(;!i("Punc","]")&&n<t.length;)g.push(y()),i("Punc",",")&&e();return o("Punc","]"),{type:"ArrayExpr",elements:g}}if(l.type==="Punc"&&l.value==="{")return x();if(l.type==="Punc"&&l.value==="("){if(e(),A()){let b=S();o("Punc",")"),o("Op","=>");let X=s();return{type:"ArrowFunction",params:b,body:X}}let g=s();return o("Punc",")"),g}if(l.type==="Ident"){if(e(),i("Op","=>")){e();let g=s();return{type:"ArrowFunction",params:[l.value],body:g}}return{type:"Identifier",name:l.value}}return l.type==="Op"&&(l.value==="="||l.value==="+="||l.value==="-="||l.value==="*="||l.value==="/="||l.value==="%=")?(e(),{type:"Literal",value:void 0}):l.type==="Punc"&&l.value==="..."?(e(),{type:"SpreadElement",argument:s()}):(e(),{type:"Literal",value:void 0})}function x(){e();let l=[];for(;!i("Punc","}")&&n<t.length;){if(i("Punc","...")){e(),l.push({key:null,value:s(),computed:!1,spread:!0}),i("Punc",",")&&e();continue}if(i("Punc","[")){e();let g=s();o("Punc","]"),o("Punc",":");let b=s();l.push({key:g,value:b,computed:!0,spread:!1}),i("Punc",",")&&e();continue}if(i("String")){let g=e();if(i("Punc",":")){e();let b=s();l.push({key:g.value,value:b,computed:!1,spread:!1})}i("Punc",",")&&e();continue}if(i("Ident")||i("Keyword")){let g=e();if(i("Punc",":")){e();let b=s();l.push({key:g.value,value:b,computed:!1,spread:!1})}else l.push({key:g.value,value:{type:"Identifier",name:g.value},computed:!1,spread:!1});i("Punc",",")&&e();continue}if(i("Number")){let g=e();if(i("Punc",":")){e();let b=s();l.push({key:g.value,value:b,computed:!1,spread:!1})}i("Punc",",")&&e();continue}e()}return o("Punc","}"),{type:"ObjectExpr",properties:l}}function I(){let l=s(),g=r();if(g&&g.type==="Op"&&(g.value==="="||g.value==="+="||g.value==="-="||g.value==="*="||g.value==="/="||g.value==="%=")){let b=e().value,X=s();return{type:"AssignExpr",op:b,left:l,right:X}}return l}return I()}var Bt={__proto__:1,constructor:1,prototype:1},ie={Array,Object,String,Number,Boolean,Math,Date,RegExp,Map,Set,JSON,parseInt,parseFloat,isNaN,isFinite,Infinity:1/0,NaN:NaN,undefined:void 0,Error,Symbol,console},nr={eval:1,Function:1,process:1,require:1,importScripts:1};function j(t,n){try{if(!t)return;switch(t.type){case"Literal":return t.value;case"Identifier":return t.name in n?n[t.name]:t.name in ie?ie[t.name]:typeof globalThis<"u"&&t.name in globalThis&&!nr[t.name]?globalThis[t.name]:void 0;case"Forbidden":return;case"BinaryExpr":{if(t.op==="&&"){let i=j(t.left,n);return i&&j(t.right,n)}if(t.op==="||"){let i=j(t.left,n);return i||j(t.right,n)}if(t.op==="??"){let i=j(t.left,n);return i??j(t.right,n)}let r=j(t.left,n),e=j(t.right,n);switch(t.op){case"+":return r+e;case"-":return r-e;case"*":return r*e;case"/":return r/e;case"%":return r%e;case"**":return r**e;case"===":return r===e;case"!==":return r!==e;case"==":return r==e;case"!=":return r!=e;case">":return r>e;case"<":return r<e;case">=":return r>=e;case"<=":return r<=e;case"in":return e&&typeof e=="object"?r in e:void 0;case"instanceof":return r instanceof e;case"&":return r&e;case"|":return r|e;case"^":return r^e;case"<<":return r<<e;case">>":return r>>e;case">>>":return r>>>e;default:return}}case"UnaryExpr":{if(t.op==="typeof")return t.argument&&t.argument.type==="Identifier"&&!(t.argument.name in n)?"undefined":typeof j(t.argument,n);if(t.op==="++"||t.op==="--"){let e=j(t.argument,n),i=t.op==="++"?e+1:e-1;return t.prefix?i:e}let r=j(t.argument,n);switch(t.op){case"!":return!r;case"-":return-r;case"+":return+r;case"~":return~r;case"void":return;default:return}}case"ConditionalExpr":return j(t.test,n)?j(t.consequent,n):j(t.alternate,n);case"MemberExpr":case"OptionalMemberExpr":{let r=j(t.object,n);if(r==null)return;let e=t.computed?j(t.property,n):t.property.name||t.property.value;return Bt[e]?void 0:r[e]}case"CallExpr":case"OptionalCallExpr":{let r=i=>{let o=[];for(let s=0;s<i.length;s++)if(i[s].type==="SpreadElement"){let a=j(i[s].argument,n);a&&typeof a[Symbol.iterator]=="function"&&o.push(...a)}else o.push(j(i[s],n));return o};if(t.callee.type==="MemberExpr"||t.callee.type==="OptionalMemberExpr"){let i=j(t.callee.object,n);if(i==null)return t.type==="OptionalCallExpr"||t.callee.type==="OptionalMemberExpr",void 0;let o=t.callee.computed?j(t.callee.property,n):t.callee.property.name;if(Bt[o])return;let s=i[o];return typeof s!="function"?void 0:s.apply(i,r(t.args))}let e=j(t.callee,n);return e==null&&t.type==="OptionalCallExpr"||typeof e!="function"?void 0:e.apply(void 0,r(t.args))}case"ArrayExpr":{let r=[];for(let e=0;e<t.elements.length;e++){let i=t.elements[e];if(i.type==="SpreadElement"){let o=j(i.argument,n);o&&typeof o[Symbol.iterator]=="function"&&r.push(...o)}else r.push(j(i,n))}return r}case"ObjectExpr":{let r={};for(let e=0;e<t.properties.length;e++){let i=t.properties[e];if(i.spread)Object.assign(r,j(i.value,n));else{let o=i.computed?j(i.key,n):i.key;if(Bt[o])continue;r[o]=j(i.value,n)}}return r}case"SpreadElement":return j(t.argument,n);case"ArrowFunction":return function(...r){let e=Object.create(n);for(let i=0;i<t.params.length;i++){let o=t.params[i];if(typeof o=="string"&&o.startsWith("...")){e[o.slice(3)]=r.slice(i);break}e[o]=r[i]}return j(t.body,e)};case"TemplateLiteral":{let r=t.parts[0];for(let e=0;e<t.expressions.length;e++)r+=String(j(t.expressions[e],n)),r+=t.parts[e+1];return r}case"PostfixExpr":return j(t.argument,n);case"AssignExpr":return j(t.right,n);default:return}}catch{return}}function ir(t){if(re.has(t))return re.get(t);let n=oe(t),r=[],e=0;for(let i=0;i<=n.length;i++)if(i===n.length||n[i].type==="Punc"&&n[i].value===";"){let o=n.slice(e,i);o.length>0&&r.push(se(o)),e=i+1}return re.set(t,r),r}function ne(t,n,r){if(t.type==="Identifier")r[t.name]=n;else if(t.type==="MemberExpr"||t.type==="OptionalMemberExpr"){let e=j(t.object,r);if(e==null)return;let i=t.computed?j(t.property,r):t.property.name||t.property.value;if(Bt[i])return;e[i]=n}}function or(t,n){if(t)switch(t.type){case"AssignExpr":{let r=j(t.right,n),e;if(t.op==="=")e=r;else{let i=j(t.left,n);switch(t.op){case"+=":e=i+r;break;case"-=":e=i-r;break;case"*=":e=i*r;break;case"/=":e=i/r;break;case"%=":e=i%r;break;default:e=r}}return ne(t.left,e,n),e}case"PostfixExpr":{let r=j(t.argument,n),e=t.op==="++"?r+1:r-1;return ne(t.argument,e,n),r}case"UnaryExpr":{if(t.op==="++"||t.op==="--"){let r=j(t.argument,n),e=t.op==="++"?r+1:r-1;return ne(t.argument,e,n),e}return j(t,n)}default:{if(t.type==="CallExpr"&&t.callee.type==="Identifier"){let r=t.callee.name;if(!(r in n)&&!(r in ie)&&(typeof globalThis>"u"||!(r in globalThis)))throw new ReferenceError(r+" is not defined")}return j(t,n)}}}function sr(t){let n=[],r="",e=0,i=!1,o="";for(let s=0;s<t.length;s++){let a=t[s];if(i){r+=a,a===o&&t[s-1]!=="\\"&&(i=!1);continue}if(a==="'"||a==='"'||a==="`"){i=!0,o=a,r+=a;continue}if(a==="("||a==="["||a==="{"){e++,r+=a;continue}if(a===")"||a==="]"||a==="}"){e--,r+=a;continue}if(a==="|"&&e===0&&t[s+1]!=="|"&&t[s-1]!=="|"){n.push(r.trim()),r="";continue}r+=a}return n.push(r.trim()),n}function ar(t,n){let r=n.indexOf(":"),e,i;r===-1?(e=n.trim(),i=null):(e=n.substring(0,r).trim(),i=n.substring(r+1).trim());let o=B[e];if(!o)return at(`Unknown filter: ${e}`),t;let s=i?cr(i):[];return o(t,...s)}function cr(t){let n=[],r="",e=!1,i="";for(let o of t){if(e){if(o===i){e=!1;continue}r+=o;continue}if(o==="'"||o==='"'){e=!0,i=o;continue}if(o===","){n.push(r.trim()),r="";continue}r+=o}return r.trim()&&n.push(r.trim()),n.map(o=>{let s=Number(o);return isNaN(s)?o:s})}function k(t,n){if(!(t==null||t===""))try{let r=sr(t),e=r[0],{keys:i,vals:o}=ee(n),s=["$store","$route","$router","$i18n","$refs","$form"];for(let f of s)i.includes(f)||(i.push(f),o[f]=n[f]);let a={};for(let f=0;f<i.length;f++)a[i[f]]=o[i[f]];let c=Le.get(e);c||(c=se(oe(e)),Le.set(e,c));let d=j(c,a);for(let f=1;f<r.length;f++)d=ar(d,r[f]);return d}catch{return}}function nt(t,n,r={}){try{let{keys:e,vals:i}=ee(n),o={$store:J,$route:G?.current,$router:G,$i18n:V,$refs:n.$refs};Object.assign(o,r);for(let[u,_]of Object.entries(o))e.includes(u)||(e.push(u),i[u]=_);let s={};for(let u=0;u<e.length;u++)s[e[u]]=i[e[u]];let a=new Set,c=n;for(;c&&c.__isProxy;){for(let u of Object.keys(c.__raw))a.add(u);c=c.$parent}let d={};for(let u of a)!u.startsWith("$")&&u in s&&(d[u]=s[u]);let f=ir(t);for(let u=0;u<f.length;u++)or(f[u],s);for(let u of a){if(u.startsWith("$")||!(u in s))continue;let _=s[u],p=d[u];if(_!==p){let v=n;for(;v&&v.__isProxy;){if(u in v.__raw){v.$set(u,_);break}v=v.$parent}}else if(typeof _=="object"&&_!==null){let v=n;for(;v&&v.__isProxy;){if(u in v.__raw){v.$notify();break}v=v.$parent}}}for(let u in s)u.startsWith("$")||a.has(u)||u in i||n.$set(u,s[u]);typeof t=="string"&&t.includes("$store")&&_t()}catch(e){at("Expression error:",t,e.message),r.$el&&r.$el.dispatchEvent(new CustomEvent("nojs:error",{bubbles:!0,detail:{message:e.message,error:e}}))}}function lt(t,n){return t.split(".").reduce((r,e)=>r?.[e],n)}function wt(t,n){return t.replace(/\{([^}]+)\}/g,(r,e)=>{let i=k(e.trim(),n);return i??""})}tt();tt();function ae(t,n){if(t.startsWith("http://")||t.startsWith("https://")||t.startsWith("//"))return t;let r=n;for(;r;){let e=r.getAttribute?.("base");if(e)return e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,"");r=r.parentElement}return L.baseApiUrl?L.baseApiUrl.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):t}async function Mt(t,n="GET",r=null,e={},i=null,o=null){let s=ae(t,i),a={method:n.toUpperCase(),headers:{...L.headers||{},...e},credentials:L.credentials};if(r&&n!=="GET")if(typeof r=="string")try{JSON.parse(r),a.headers["Content-Type"]="application/json",a.body=r}catch{a.body=r}else r instanceof FormData?a.body=r:(a.headers["Content-Type"]="application/json",a.body=JSON.stringify(r));L.csrf&&n!=="GET"&&(a.headers[L.csrf.header||"X-CSRF-Token"]=L.csrf.token||"");for(let f of Nt.request)a=f(s,a)||a;let c=L.retries||0,d;for(let f=0;f<=c;f++)try{let u=new AbortController,_=setTimeout(()=>u.abort(),L.timeout||1e4);if(o){if(o.aborted)throw clearTimeout(_),new DOMException("Aborted","AbortError");o.addEventListener("abort",()=>u.abort(),{once:!0})}a.signal=u.signal;let p=await fetch(s,a);clearTimeout(_);for(let E of Nt.response)p=E(p,s)||p;if(!p.ok){let E=await p.json().catch(()=>({})),m=new Error(E.message||`HTTP ${p.status}`);throw m.status=p.status,m.body=E,m}let v=await p.text();try{return JSON.parse(v)}catch{return v}}catch(u){if(u.name==="AbortError")throw u;d=u,f<c&&await new Promise(_=>setTimeout(_,L.retryDelay||1e3))}throw d}function Te(t,n){if(n==="none")return null;if(n==="memory"){let e=Kt.get(t);return e&&Date.now()-e.time<(L.cache.ttl||3e5)?e.data:null}let r=n==="local"?localStorage:n==="session"?sessionStorage:null;if(!r)return null;try{let e=r.getItem("nojs_cache_"+t);if(!e)return null;let i=JSON.parse(e);if(Date.now()-i.time<(L.cache.ttl||3e5))return i.data;r.removeItem("nojs_cache_"+t)}catch{}return null}function Se(t,n,r){if(r==="none")return;let e={data:n,time:Date.now()};if(r==="memory"){Kt.set(t,e);return}let i=r==="local"?localStorage:r==="session"?sessionStorage:null;if(i)try{i.setItem("nojs_cache_"+t,JSON.stringify(e))}catch{}}var xt=new Map;function P(t){let n=t;for(;n;){if(n.__ctx)return n.__ctx;n=n.parentElement}return q()}function bt(t){let n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT);for(;n.nextNode();)n.currentNode.__declared=!1}function Q(t){if(!t)return null;let n=t.startsWith("#")?t.slice(1):t,r=document.getElementById(n);return r&&r.content?r.content.cloneNode(!0):null}function ke(t){return L.sanitize?t.replace(/<script[\s\S]*?<\/script>/gi,"").replace(/on\w+\s*=/gi,"data-blocked=").replace(/javascript:/gi,""):t}function ce(t,n){if(t.startsWith("./")){let r=n.parentNode;for(;r;){if(r.__srcBase)return r.__srcBase+t.slice(2);r=r.parentNode}return t.slice(2)}return ae(t,n)}async function Ie(t){let n=t||document,r=n.querySelectorAll("template[src]");if(Z("[LRT] called on",n===document?"document":n.nodeName||"fragment","\u2014 found",r.length,"template[src]",[...r].map(i=>i.getAttribute("src"))),!r.length)return;let e=[...r].map(async i=>{if(i.__srcLoaded){Z("[LRT] SKIP (already loaded):",i.getAttribute("src"));return}i.__srcLoaded=!0;let o=i.getAttribute("src"),s=ce(o,i),a=s.substring(0,s.lastIndexOf("/")+1);try{let c=L.templates.cache!==!1,d;if(c&&xt.has(s))d=xt.get(s),Z("[LRT] CACHE HIT:",s);else{let f=await fetch(s);if(!f.ok){at("Failed to load template:",o,"HTTP",f.status),i.__loadFailed=!0;return}d=await f.text(),c&&xt.set(s,d)}if(i.innerHTML=d,i.content&&(i.content.__srcBase=a),Z("Loaded remote template:",o,"\u2192",s),await Ie(i.content||i),!i.hasAttribute("route")&&i.parentNode){let u=[...i.content.childNodes],_=i.parentNode,p=i.nextSibling;_.removeChild(i);for(let v of u)v.nodeType===1&&(v.__srcBase=v.__srcBase||a),_.insertBefore(v,p)}}catch(c){at("Failed to load template:",o,c.message)}});await Promise.all(e)}async function yt(t){let n=t.getAttribute("src");if(t.__srcLoaded){Z("[LTE] SKIP (already loaded):",n);return}Z("[LTE] START fetch:",n,"| route:",t.hasAttribute("route"),"| inDOM:",document.contains(t),"| loading:",t.getAttribute("loading")),t.__srcLoaded=!0;let r=ce(n,t),e=r.substring(0,r.lastIndexOf("/")+1),i=null,o=t.getAttribute("loading");if(o&&t.parentNode){let s=o.startsWith("#")?o.slice(1):o,a=document.getElementById(s);a&&a.content&&(i=document.createElement("span"),i.style.cssText="display:contents",i.appendChild(a.content.cloneNode(!0)),t.parentNode.insertBefore(i,t))}try{let s=L.templates.cache!==!1,a;if(s&&xt.has(r))a=xt.get(r),Z("[LTE] CACHE HIT:",r);else{let c=await fetch(r);if(!c.ok){at("Failed to load template:",n,"HTTP",c.status),t.__loadFailed=!0,i&&i.remove();return}a=await c.text(),s&&xt.set(r,a)}if(t.innerHTML=a,t.content&&(t.content.__srcBase=e),Z("Loaded remote template:",n,"\u2192",r),!t.hasAttribute("route"))await Ie(t.content||t);else if(s&&t.content){let d=[...t.content.querySelectorAll("template[src]")].map(f=>{let u=f.getAttribute("src"),_=ce(u,f);if(!xt.has(_))return fetch(_).then(p=>{if(!p.ok)throw new Error("HTTP "+p.status);return p.text()}).then(p=>{xt.set(_,p)}).catch(()=>{})});Promise.all(d)}if(i&&i.remove(),!t.hasAttribute("route")&&t.parentNode){let d=[...t.content.childNodes],f=t.parentNode,u=t.nextSibling;f.removeChild(t);for(let _ of d)_.nodeType===1&&(_.__srcBase=_.__srcBase||e),f.insertBefore(_,u)}}catch(s){i&&i.remove(),at("Failed to load template:",n,s.message)}}function Ht(t){(t||document).querySelectorAll("template[include]").forEach(r=>{let e=r.getAttribute("include"),i=document.getElementById(e.startsWith("#")?e.slice(1):e);!i||!i.content||r.replaceWith(i.content.cloneNode(!0))})}async function Ne(t){let n=[...document.querySelectorAll("template[src]")],r=n.filter(i=>!i.__srcLoaded&&i.getAttribute("lazy")==="priority");await Promise.all(r.map(yt));let e=n.filter(i=>{if(i.__srcLoaded)return!1;let o=i.getAttribute("lazy");return o==="ondemand"||o==="priority"?!1:i.hasAttribute("route")?t!=null&&i.getAttribute("route")===t:!0});await Promise.all(e.map(yt))}function $e(){let n=[...document.querySelectorAll("template[src]")].filter(r=>r.__srcLoaded||r.getAttribute("lazy")==="ondemand"?!1:r.hasAttribute("route"));return Promise.all(n.map(yt))}tt();ht();var jt=new Map;function O(t,n){jt.set(t,{priority:n.priority??50,init:n.init})}function lr(t){if(jt.has(t))return{directive:jt.get(t),match:t};let n=["class-*","on:*","style-*","bind-*"];for(let r of n){let e=r.replace("*","");if(t.startsWith(e)&&jt.has(r))return{directive:jt.get(r),match:r}}return null}function De(t){if(t.__declared)return;t.__declared=!0;let n=[];for(let e of[...t.attributes]){let i=lr(e.name);i&&n.push({name:e.name,value:e.value,priority:i.directive.priority,init:i.directive.init})}n.sort((e,i)=>e.priority-i.priority);let r=ft;for(let e of n)Vt(t),e.init(t,e.name,e.value);Vt(r),n.length>0&&rt("directive:init",{element:t.tagName?.toLowerCase(),directives:n.map(e=>({name:e.name,value:e.value}))})}function F(t){if(!t)return;t.nodeType===1&&!t.__declared&&De(t);let n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT);for(;n.nextNode();){let r=n.currentNode;r.tagName==="TEMPLATE"||r.tagName==="SCRIPT"||r.__declared||De(r)}}function le(t){let n=t.__ctx?.__raw?.__devtoolsId;if(t.__ctx&&t.__ctx.__listeners){for(let r of t.__ctx.__listeners)It.delete(r),Lt.delete(r);t.__ctx.__listeners.clear()}t.__disposers&&(t.__disposers.forEach(r=>r()),t.__disposers=null),t.__declared=!1,n!=null&&(Tt.delete(n),rt("ctx:disposed",{id:n,elementTag:t.tagName?.toLowerCase()}))}function Oe(t){if(!t)return;le(t);let n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT);for(;n.nextNode();)le(n.currentNode)}function K(t){if(!t)return;let n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT);for(;n.nextNode();)le(n.currentNode)}tt();var Pe=!1;function je(){if(Pe||typeof document>"u")return;Pe=!0;let t=`
|
|
10
13
|
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
|
|
11
14
|
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }
|
|
12
15
|
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
|
|
@@ -21,7 +24,7 @@ ${f}`)(r,d,...a),typeof t=="string"&&t.includes("$store")&&_t()}catch(n){st("Exp
|
|
|
21
24
|
@keyframes zoomOut { from { opacity: 1; transform: scale(1); } to { opacity: 0; transform: scale(0.5); } }
|
|
22
25
|
@keyframes bounceIn { 0% { opacity: 0; transform: scale(0.3); } 50% { opacity: 1; transform: scale(1.05); } 70% { transform: scale(0.9); } 100% { opacity: 1; transform: scale(1); } }
|
|
23
26
|
@keyframes bounceOut { 0% { opacity: 1; transform: scale(1); } 20% { transform: scale(0.9); } 50%,55% { opacity: 1; transform: scale(1.1); } 100% { opacity: 0; transform: scale(0.3); } }
|
|
24
|
-
`.trim(),r=document.createElement("style");r.setAttribute("data-nojs-animations",""),r.textContent=t,document.head.appendChild(r)}function Nt(t,r,e,n){$e();let o=n||1e3;if(r){let s=t.firstElementChild||t;s.classList.add(r),n&&(s.style.animationDuration=n+"ms"),s.addEventListener("animationend",()=>s.classList.remove(r),{once:!0})}if(e){let s=t.firstElementChild||t;s.classList.add(e+"-enter",e+"-enter-active"),requestAnimationFrame(()=>{s.classList.remove(e+"-enter"),s.classList.add(e+"-enter-to");let i=()=>{s.classList.remove(e+"-enter-active",e+"-enter-to")};s.addEventListener("transitionend",i,{once:!0}),setTimeout(i,o)})}}function Rt(t,r,e,n,o){$e();let s=o||2e3;if(!t.firstElementChild&&!t.childNodes.length){n();return}if(r){let i=t.firstElementChild||t;i.classList.add(r),o&&(i.style.animationDuration=o+"ms");let a=!1,c=()=>{a||(a=!0,i.classList.remove(r),n())};i.addEventListener("animationend",c,{once:!0}),setTimeout(c,s);return}if(e){let i=t.firstElementChild||t;i.classList.add(e+"-leave",e+"-leave-active"),requestAnimationFrame(()=>{i.classList.remove(e+"-leave"),i.classList.add(e+"-leave-to");let a=!1,c=()=>{a||(a=!0,i.classList.remove(e+"-leave-active",e+"-leave-to"),n())};i.addEventListener("transitionend",c,{once:!0}),setTimeout(c,s)});return}n()}var Ie='<div style="text-align:center;padding:3rem 1rem;font-family:system-ui,sans-serif"><h1 style="font-size:4rem;margin:0;opacity:.3">404</h1><p style="font-size:1.25rem;color:#666">Page not found</p></div>';function ke(t){let r=(_.router.base||"/").replace(/\/$/,"");if(!r)return t||"/";let e=r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return t.replace(new RegExp("^"+e),"")||"/"}function Ne(){let t=[],r=new Map,e={path:"",params:{},query:{},hash:""},n=new Set,o=new Map;function s(u){let h=t.find(b=>b.path===u);return h||(h={path:u,outlets:{}},t.push(h)),h}function i(u){let h={};return new URLSearchParams(u).forEach((b,p)=>{h[p]=b}),h}function a(u){for(let h of t){let b=[],p=h.path.replace(/:(\w+)/g,(g,x)=>(b.push(x),"([^/]+)")),A=new RegExp("^"+p+"$"),E=u.match(A);if(E){let g={};return b.forEach((x,L)=>{g[x]=E[L+1]}),{route:h,params:g}}}return null}async function c(u,h=!1){let b=u.indexOf("#"),p=b>=0?u.slice(b+1):"",A=b>=0?u.slice(0,b):u,[E,g=""]=A.split("?");e={path:E,params:{},query:i(g),hash:p?"#"+p:""};let x=a(E);if(x){e.matched=!0,e.params=x.params;let L=x.route.outlets?.default,m=L?.getAttribute("guard"),v=L?.getAttribute("redirect");if(m){let S=F({},null);if(S.__raw.$store=J,S.__raw.$route=e,!C(m,S)&&v){await c(v,!0);return}}}else{e.matched=!1;let L=r.get("default");if(L){let m=L.getAttribute("guard"),v=L.getAttribute("redirect");if(m){let S=F({},null);if(S.__raw.$store=J,S.__raw.$route=e,!C(m,S)&&v){await c(v,!0);return}}}}if(_.router.useHash){let L="#"+u;h?window.location.replace(L):window.location.hash=u}else{let L=(_.router.base||"/").replace(/\/$/,"")+u;h?window.history.replaceState({},"",L):window.history.pushState({},"",L)}if(await l(x),n.forEach(L=>L(e)),tt("route:navigate",{path:e.path,params:e.params,query:e.query,hash:e.hash}),e.hash){let L=e.hash.slice(1);requestAnimationFrame(()=>{let m=document.getElementById(L);m&&m.scrollIntoView({behavior:"smooth"})})}}async function l(u){let h=document.querySelectorAll("[route-view]");for(let p of h){let A=p.getAttribute("route-view"),E=A&&A.trim()!==""?A.trim():"default",g=u?.route?.outlets?.[E],x=_.router.templates||"";if(!g&&(p.hasAttribute("src")||x)){let m=(p.getAttribute("src")||x).replace(/\/?$/,"/"),v=p.getAttribute("ext")||_.router.ext||".html",S=p.getAttribute("route-index")||"index",I=e.path==="/"?S:e.path.replace(/^\//,""),T=m+I+v,H=E+":"+T;o.has(H)?g=o.get(H):(g=document.createElement("template"),g.setAttribute("src",T),g.setAttribute("route",e.path),document.body.appendChild(g),o.set(H,g),G("[ROUTER] File-based route:",e.path,"\u2192",T)),p.hasAttribute("i18n-ns")&&!g.getAttribute("i18n-ns")&&g.setAttribute("i18n-ns",I)}if((!g||g.__loadFailed)&&(!u||g?.__loadFailed)){let L=r.get(E)||(E!=="default"?r.get("default"):null);L&&(g=L)}if(Te(p),p.innerHTML="",g&&!g.__loadFailed){if(g.getAttribute("src")&&!g.__srcLoaded&&(G("Loading route template on demand:",g.getAttribute("src")),await ht(g)),g.__loadFailed){let H=r.get(E)||(E!=="default"?r.get("default"):null);if(H&&!H.__loadFailed&&(g=H,g.getAttribute("src")&&!g.__srcLoaded&&await ht(g)),!g||g.__loadFailed){p.innerHTML=Ie;continue}}let L=g.getAttribute("i18n-ns");if(L){let{_loadI18nNamespace:H}=await Promise.resolve().then(()=>(gt(),le));await H(L)}let m=g.content.cloneNode(!0),v=F({$route:e},j(p)),S=document.createElement("div");S.style.display="contents",S.__ctx=v,g.content.__srcBase&&(S.__srcBase=g.content.__srcBase),S.appendChild(m),p.appendChild(S),Ot(S);let I=[...S.querySelectorAll("template[src]")];G("[ROUTER] nested templates found in wrapper:",I.length,I.map(H=>H.getAttribute("src")+(H.__srcLoaded?"[LOADED]":"[NEW]"))),await Promise.all(I.map(ht)),G("[ROUTER] all nested loads done for route:",e.path);let T=p.getAttribute("transition");T&&Nt(S,null,T),bt(S),R(S)}else(!u||g?.__loadFailed)&&(p.innerHTML=Ie)}document.querySelectorAll("[route]").forEach(p=>{let A=p.getAttribute("route"),E=p.getAttribute("route-active")||"active",g=p.getAttribute("route-active-exact");if(g)p.classList.toggle(g,e.path===A);else if(E&&!p.hasAttribute("route-active-exact")){let x=A==="/"?e.path==="/":e.path.startsWith(A);p.classList.toggle(E,x)}});let b=_.router.scrollBehavior;b==="top"?window.scrollTo(0,0):b==="smooth"&&window.scrollTo({top:0,behavior:"smooth"})}function d(u,h){h.scrollIntoView({behavior:"smooth"});let b='a[href="#'+u+'"]';document.querySelectorAll('a[href^="#"]').forEach(p=>{p.hasAttribute("route")||p.classList.toggle("active",p.matches(b))})}function f(){let u=document.querySelectorAll("[route-view]");for(let h of u){let b=h.getAttribute("src")||_.router.templates||"";if(!b)continue;let p=b.replace(/\/?$/,"/"),A=h.getAttribute("ext")||_.router.ext||".html",E=h.getAttribute("route-index")||"index",g=(h.getAttribute("route-view")||"").trim()||"default",x=new Map;document.querySelectorAll("[route]:not([route-view])").forEach(v=>{let S=v.getAttribute("route");if(!S)return;let I=S.split("?")[0].split("#")[0],T=v.getAttribute("lazy"),H=x.get(I);(!x.has(I)||T==="priority"||H==="ondemand"&&T!=="ondemand")&&x.set(I,T)});let L=[],m=[];for(let[v,S]of x){if(S==="ondemand"||v===e.path||v==="*")continue;let I=v==="/"?E:v.replace(/^\//,""),T=p+I+A,H=g+":"+T;if(o.has(H))continue;let $=document.createElement("template");$.setAttribute("src",T),$.setAttribute("route",v),document.body.appendChild($),o.set(H,$),G("[ROUTER] Prefetch:",v,"\u2192",T,S==="priority"?"(priority)":"(background)"),h.hasAttribute("i18n-ns")&&$.setAttribute("i18n-ns",I),S==="priority"?L.push($):m.push($)}(L.length||m.length)&&Promise.all(L.map(ht)).then(()=>{m.forEach(ht)})}}return{get current(){return e},push(u){return c(u)},replace(u){return c(u,!0)},back(){window.history.back()},forward(){window.history.forward()},on(u){return n.add(u),()=>n.delete(u)},register(u,h,b="default"){if(u==="*"){r.set(b,h);return}let p=s(u);p.outlets[b]=h},async init(){if(document.querySelectorAll("template[route]").forEach(u=>{let h=u.getAttribute("route"),b=u.getAttribute("outlet")||"default";if(h==="*"){r.set(b,u);return}let p=s(h);p.outlets[b]=u}),document.addEventListener("click",u=>{let h=u.target.closest("[route]");if(h&&!h.hasAttribute("route-view")){u.preventDefault();let p=h.getAttribute("route");c(p);return}let b=u.target.closest('a[href^="#"]');if(b&&!b.hasAttribute("route")){let A=b.getAttribute("href").slice(1);if(A&&!A.startsWith("/")){let E=document.getElementById(A);E&&(u.preventDefault(),d(A,E),_.router.useHash||window.history.replaceState(null,"","#"+A))}}}),_.router.useHash){window.addEventListener("hashchange",()=>{let h=window.location.hash.slice(1)||"/";if(!h.startsWith("/")){let p=document.getElementById(h);p&&(d(h,p),window.history.replaceState(null,"","#"+e.path));return}let[b]=h.split("?");b!==e.path&&c(h,!0)});let u=window.location.hash.slice(1)||"/";await c(u,!0)}else{window.addEventListener("popstate",()=>{let h=ke(window.location.pathname);if(h===e.path){let b=window.location.hash.slice(1);if(b){let p=document.getElementById(b);p&&d(b,p)}return}c(h,!0)});let u=ke(window.location.pathname);await c(u,!0)}f()}}}Q();B.uppercase=t=>String(t??"").toUpperCase();B.lowercase=t=>String(t??"").toLowerCase();B.capitalize=t=>String(t??"").replace(/\b\w/g,r=>r.toUpperCase());B.truncate=(t,r=100)=>{let e=String(t??"");return e.length>r?e.slice(0,r)+"...":e};B.trim=t=>String(t??"").trim();B.stripHtml=t=>String(t??"").replace(/<[^>]*>/g,"");B.slugify=t=>String(t??"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"");B.nl2br=t=>String(t??"").replace(/\n/g,"<br>");B.encodeUri=t=>encodeURIComponent(String(t??""));B.number=(t,r=0)=>{let e=Number(t);return isNaN(e)?t:e.toLocaleString(void 0,{minimumFractionDigits:r,maximumFractionDigits:r})};B.currency=(t,r="USD")=>{let e=Number(t);if(isNaN(e))return t;try{return e.toLocaleString(void 0,{style:"currency",currency:r})}catch{return`${r} ${e.toFixed(2)}`}};B.percent=(t,r=0)=>{let e=Number(t);return isNaN(e)?t:(e*100).toFixed(r)+"%"};B.filesize=t=>{let r=Number(t);if(isNaN(r))return t;let e=["B","KB","MB","GB","TB"],n=0,o=r;for(;o>=1024&&n<e.length-1;)o/=1024,n++;return o.toFixed(n>0?1:0)+" "+e[n]};B.ordinal=t=>{let r=Number(t);if(isNaN(r))return t;let e=["th","st","nd","rd"],n=r%100;return r+(e[(n-20)%10]||e[n]||e[0])};B.count=t=>Array.isArray(t)?t.length:0;B.first=t=>Array.isArray(t)?t[0]:t;B.last=t=>Array.isArray(t)?t[t.length-1]:t;B.join=(t,r=", ")=>Array.isArray(t)?t.join(r):t;B.reverse=t=>Array.isArray(t)?[...t].reverse():t;B.unique=t=>Array.isArray(t)?[...new Set(t)]:t;B.pluck=(t,r)=>Array.isArray(t)?t.map(e=>e?.[r]):t;B.sortBy=(t,r)=>{if(!Array.isArray(t))return t;let e=r?.startsWith("-"),n=e?r.slice(1):r;return[...t].sort((o,s)=>{let i=o?.[n],a=s?.[n],c=i<a?-1:i>a?1:0;return e?-c:c})};B.where=(t,r,e)=>Array.isArray(t)?t.filter(n=>n?.[r]===e):t;B.date=(t,r="short")=>{let e=new Date(t);if(isNaN(e))return t;let n=r==="long"?{dateStyle:"long"}:r==="full"?{dateStyle:"full"}:{dateStyle:"short"};return e.toLocaleDateString(void 0,n)};B.datetime=t=>{let r=new Date(t);return isNaN(r)?t:r.toLocaleString()};B.relative=t=>{let r=new Date(t);if(isNaN(r))return t;let e=(Date.now()-r.getTime())/1e3;return e<60?"just now":e<3600?Math.floor(e/60)+"m ago":e<86400?Math.floor(e/3600)+"h ago":e<2592e3?Math.floor(e/86400)+"d ago":r.toLocaleDateString()};B.fromNow=t=>{let r=new Date(t);if(isNaN(r))return t;let e=(r.getTime()-Date.now())/1e3;return e<0?B.relative(t):e<60?"in a moment":e<3600?"in "+Math.floor(e/60)+"m":e<86400?"in "+Math.floor(e/3600)+"h":"in "+Math.floor(e/86400)+"d"};B.default=(t,r="")=>t==null||t===""?r:t;B.json=(t,r=2)=>JSON.stringify(t,null,r);B.debug=t=>(console.log("[No.JS debug]",t),t);B.keys=t=>t&&typeof t=="object"?Object.keys(t):[];B.values=t=>t&&typeof t=="object"?Object.values(t):[];Q();D("state",{priority:0,init(t,r,e){let n=C(e,F())||{},o=t.parentElement?j(t.parentElement):null,s=F(n,o);t.__ctx=s;let i=t.getAttribute("persist"),a=t.getAttribute("persist-key");if(i&&a){let c=i==="localStorage"?localStorage:i==="sessionStorage"?sessionStorage:null;if(c){try{let l=c.getItem("nojs_state_"+a);if(l){let d=JSON.parse(l);for(let[f,y]of Object.entries(d))s.$set(f,y)}}catch{}s.$watch(()=>{try{c.setItem("nojs_state_"+a,JSON.stringify(s.__raw))}catch{}})}}G("state",n)}});D("store",{priority:0,init(t,r,e){let n=t.getAttribute("value");if(e){if(!J[e]){let o=n?C(n,F())||{}:{};J[e]=F(o),tt("store:created",{name:e,keys:Object.keys(o)})}G("store",e)}}});D("computed",{priority:2,init(t,r,e){let n=t.getAttribute("expr");if(!e||!n)return;let o=j(t);function s(){let i=C(n,o);o.$set(e,i)}V(n,o,s),s()}});D("watch",{priority:2,init(t,r,e){let n=j(t),o=t.getAttribute("on:change"),s=C(e,n);V(e,n,()=>{let i=C(e,n);if(i!==s){let a=s;s=i,o&&et(o,n,{$old:a,$new:i})}})}});Q();var Ye=["get","post","put","patch","delete"];for(let t of Ye)D(t,{priority:1,init(r,e,n){let o=r.getAttribute("as")||"data",s=r.getAttribute("loading"),i=r.getAttribute("error"),a=r.getAttribute("empty"),c=r.getAttribute("success"),l=r.getAttribute("then"),d=r.getAttribute("redirect"),f=r.getAttribute("confirm"),y=parseInt(r.getAttribute("refresh"))||0,u=r.getAttribute("cached"),h=r.hasAttribute("cached")?u||"memory":"none",b=r.getAttribute("body"),p=r.getAttribute("headers"),A=r.getAttribute("var"),E=r.getAttribute("into"),g=parseInt(r.getAttribute("retry"))||_.retries,x=parseInt(r.getAttribute("retry-delay"))||_.retryDelay||1e3,L=r.getAttribute("params"),m=r.parentElement?j(r.parentElement):F(),v=r.__ctx||F({},m);r.__ctx=v;let S=[...r.childNodes].map($=>$.cloneNode(!0)),I=null;async function T(){if(I&&I.abort(),I=new AbortController,f&&!window.confirm(f))return;let $=xt(n,v);if(L){let P=C(L,v);if(P&&typeof P=="object"){let rt=$.includes("?")?"&":"?",k=new URLSearchParams(P).toString();k&&($+=rt+k)}}let it=t+":"+$;if(t==="get"){let P=ve(it,h);if(P!=null){v.$set(o,P),bt(r),R(r);return}}if(s){let P=Y(s);P&&(z(r),r.innerHTML="",r.appendChild(P),R(r))}try{let P=null;if(b){let N=xt(b,v);try{P=JSON.parse(N)}catch{P=N}}if(r.tagName==="FORM"){let N=new FormData(r);P=Object.fromEntries(N.entries())}let rt=p?JSON.parse(p):{},k=_.retries,U=_.retryDelay;_.retries=g,_.retryDelay=x;let M;try{M=await Mt($,t,P,rt,r,I.signal)}finally{_.retries=k,_.retryDelay=U}if(t==="get"&&Ee(it,M,h),a&&(M==null||Array.isArray(M)&&M.length===0)){let N=Y(a);N&&(z(r),r.innerHTML="",r.appendChild(N),R(r));return}if(v.$set(o,M),E&&(J[E]||(J[E]=F({})),J[E].$set(o,M),_t()),c){let N=Y(c);if(N){z(r),r.innerHTML="";let at=document.getElementById(c.replace("#",""))?.getAttribute("var")||A||"result",yt=F({[at]:M},v),nt=document.createElement("div");nt.style.display="contents",nt.__ctx=yt,nt.appendChild(N),r.appendChild(nt),R(nt)}}else{z(r),r.innerHTML="";for(let N of S)r.appendChild(N.cloneNode(!0));bt(r),R(r)}l&&et(l,v,{result:M}),d&&X&&X.push(d),vt("fetch:success",{url:$,data:M}),tt("fetch:success",{method:t,url:$})}catch(P){if(P.name==="AbortError")return;if(st(`${t.toUpperCase()} ${$} failed:`,P.message),vt("fetch:error",{url:$,error:P}),vt("error",{url:$,error:P}),tt("fetch:error",{method:t,url:$,error:P.message}),i){let rt=Y(i);if(rt){z(r),r.innerHTML="";let U=document.getElementById(i.replace("#",""))?.getAttribute("var")||"err",M=F({[U]:{message:P.message,status:P.status,body:P.body}},v),N=document.createElement("div");N.style.display="contents",N.__ctx=M,N.appendChild(rt),r.appendChild(N),R(N)}}}}if(r.tagName==="FORM"&&t!=="get"){let $=it=>{it.preventDefault(),T()};r.addEventListener("submit",$),q(()=>r.removeEventListener("submit",$))}else if(t==="get")T();else{let $=it=>{it.preventDefault(),T()};r.addEventListener("click",$),q(()=>r.removeEventListener("click",$))}if(/\{[^}]+\}/.test(n)){let rt=function(){let U=xt(n,v);U!==it&&(it=U,P&&clearTimeout(P),$>0?P=setTimeout(T,$):T())},$=parseInt(r.getAttribute("debounce"))||0,it=xt(n,v),P=null;q(()=>{P&&clearTimeout(P)});let k=m;for(;k&&k.__isProxy;){let U=k.$watch(rt);q(U),k=k.$parent}}if(r.refresh=T,q(()=>{delete r.refresh}),y>0){let $=setInterval(T,y);q(()=>clearInterval($))}}});Q();D("bind",{priority:20,init(t,r,e){let n=j(t);function o(){let s=C(e,n);t.textContent=s!=null?String(s):""}V(e,n,o),o()}});D("bind-html",{priority:20,init(t,r,e){let n=j(t);function o(){let s=C(e,n);s!=null&&(t.innerHTML=xe(String(s)))}V(e,n,o),o()}});D("bind-*",{priority:20,init(t,r,e){let n=r.replace("bind-",""),o=j(t);if(n==="value"&&(t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.tagName==="SELECT")){let i=()=>{let a=t.type==="number"?Number(t.value):t.value;et(`${e} = ${JSON.stringify(a)}`,o)};t.addEventListener("input",i),q(()=>t.removeEventListener("input",i))}function s(){let i=C(e,o);if(["disabled","readonly","checked","selected","hidden","required"].includes(n)){i?t.setAttribute(n,""):t.removeAttribute(n),n in t&&(t[n]=!!i);return}i!=null?t.setAttribute(n,String(i)):t.removeAttribute(n)}V(e,o,s),s()}});D("model",{priority:20,init(t,r,e){let n=j(t),o=t.tagName,s=t.type;function i(){let l=C(e,n);o==="INPUT"&&s==="checkbox"?t.checked=!!l:o==="INPUT"&&s==="radio"?t.checked=t.value===String(l):t.value=l!=null?String(l):""}let a=o==="SELECT"||s==="checkbox"||s==="radio"?"change":"input",c=()=>{let l;s==="checkbox"?l=t.checked:s==="number"||s==="range"?l=Number(t.value):l=t.value,et(`${e} = __val`,n,{__val:l})};t.addEventListener(a,c),q(()=>t.removeEventListener(a,c)),V(e,n,i),i()}});Q();D("if",{priority:10,init(t,r,e){let n=j(t),o=t.getAttribute("then"),s=t.getAttribute("else"),i=t.getAttribute("animate-enter")||t.getAttribute("animate"),a=t.getAttribute("animate-leave"),c=t.getAttribute("transition"),l=parseInt(t.getAttribute("animate-duration"))||0,d=[...t.childNodes].map(h=>h.cloneNode(!0)),f;function y(){let h=!!C(e,n);h!==f&&(f=h,a||c?Rt(t,a,c,()=>u(h),l):u(h))}function u(h){if(z(t),h)if(o){let b=Y(o);b&&(t.innerHTML="",t.appendChild(b))}else{t.innerHTML="";for(let b of d)t.appendChild(b.cloneNode(!0))}else if(s){let b=Y(s);b&&(t.innerHTML="",t.appendChild(b))}else t.innerHTML="";bt(t),R(t),(i||c)&&Nt(t,i,c,l)}V(e,n,y),y()}});D("else-if",{priority:10,init(t,r,e){let n=j(t),o=t.getAttribute("then"),s=[...t.childNodes].map(a=>a.cloneNode(!0));function i(){let a=t.previousElementSibling;for(;a;){let l=a.getAttribute("if")||a.getAttribute("else-if");if(l){if(C(l,n)){z(t),t.innerHTML="",t.style.display="none";return}}else break;a=a.previousElementSibling}let c=!!C(e,n);if(t.style.display="",c){if(o){let l=Y(o);l&&(z(t),t.innerHTML="",t.appendChild(l))}else{z(t),t.innerHTML="";for(let l of s)t.appendChild(l.cloneNode(!0))}bt(t),R(t)}else z(t),t.innerHTML=""}V(e,n,i),i()}});D("else",{priority:10,init(t){if(t.hasAttribute("if"))return;let r=j(t),e=t.getAttribute("then"),n=[...t.childNodes].map(s=>s.cloneNode(!0));function o(){let s=t.previousElementSibling;for(;s;){let i=s.getAttribute("if")||s.getAttribute("else-if");if(i){if(C(i,r)){z(t),t.innerHTML="",t.style.display="none";return}}else break;s=s.previousElementSibling}if(t.style.display="",e){let i=Y(e);i&&(z(t),t.innerHTML="",t.appendChild(i))}else{z(t),t.innerHTML="";for(let i of n)t.appendChild(i.cloneNode(!0))}bt(t),R(t)}V("",r,o),o()}});D("show",{priority:20,init(t,r,e){let n=j(t),o=t.getAttribute("animate-enter")||t.getAttribute("animate"),s=t.getAttribute("animate-leave"),i=t.getAttribute("transition"),a=parseInt(t.getAttribute("animate-duration"))||0,c;function l(){let d=!!C(e,n);d!==c&&(c=d,d?(t.style.display="",(o||i)&&Nt(t,o,i,a)):s||i?Rt(t,s,i,()=>{t.style.display="none"},a):t.style.display="none")}V(e,n,l),l()}});D("hide",{priority:20,init(t,r,e){let n=j(t),o=t.getAttribute("animate-enter")||t.getAttribute("animate"),s=t.getAttribute("animate-leave"),i=t.getAttribute("transition"),a=parseInt(t.getAttribute("animate-duration"))||0,c;function l(){let d=!C(e,n);d!==c&&(c=d,d?(t.style.display="",(o||i)&&Nt(t,o,i,a)):s||i?Rt(t,s,i,()=>{t.style.display="none"},a):t.style.display="none")}V(e,n,l),l()}});D("switch",{priority:10,init(t,r,e){let n=j(t);function o(){let s=C(e,n),i=!1;for(let a of[...t.children]){let c=a.getAttribute("case"),l=a.hasAttribute("default"),d=a.getAttribute("then");if(c){let f=c.split(",").map(y=>C(y.trim(),n));if(!i&&f.includes(s)){if(i=!0,a.style.display="",d){let y=Y(d);y&&(z(a),a.innerHTML="",a.appendChild(y)),a.__declared=!1,R(a)}}else a.style.display="none"}else if(l&&(a.style.display=i?"none":"",!i&&d)){let f=Y(d);f&&(z(a),a.innerHTML="",a.appendChild(f)),a.__declared=!1,R(a)}}}V(e,n,o),o()}});Q();D("each",{priority:10,init(t,r,e){let n=j(t),o=e.match(/^(\w+)\s+in\s+(\S+)$/);if(!o)return;let[,s,i]=o,a=t.getAttribute("template"),c=t.getAttribute("else"),l=t.getAttribute("key"),d=t.getAttribute("animate-enter")||t.getAttribute("animate"),f=t.getAttribute("animate-leave"),y=parseInt(t.getAttribute("animate-stagger"))||0,u=parseInt(t.getAttribute("animate-duration"))||0,h=null;function b(){let A=/[\[\]()\s+\-*\/!?:&|]/.test(i)?C(i,n):ct(i,n);if(!Array.isArray(A))return;if(A===h&&A.length>0&&t.children.length>0){for(let g of t.children)g.__ctx&&g.__ctx.$notify&&g.__ctx.$notify();return}if(h=A,A.length===0&&c){let g=Y(c);g&&(z(t),t.innerHTML="",t.appendChild(g),R(t));return}let E=a?document.getElementById(a):null;if(E)if(f&&t.children.length>0){let g=[...t.children],x=g.length;g.forEach(L=>{let m=L.firstElementChild||L;m.classList.add(f);let v=()=>{m.classList.remove(f),x--,x<=0&&p(E,A)};m.addEventListener("animationend",v,{once:!0}),setTimeout(v,u||2e3)})}else p(E,A)}function p(A,E){let g=E.length;z(t),t.innerHTML="",E.forEach((x,L)=>{let m={[s]:x,$index:L,$count:g,$first:L===0,$last:L===g-1,$even:L%2===0,$odd:L%2!==0},v=F(m,n),S=A.content.cloneNode(!0),I=document.createElement("div");if(I.style.display="contents",I.__ctx=v,I.appendChild(S),t.appendChild(I),R(I),d){let T=I.firstElementChild;T&&(T.classList.add(d),T.addEventListener("animationend",()=>T.classList.remove(d),{once:!0}),y&&(T.style.animationDelay=L*y+"ms"))}})}V(e,n,b),b()}});D("foreach",{priority:10,init(t,r,e){let n=j(t),o=t.getAttribute("from"),s=t.getAttribute("index")||"$index",i=t.getAttribute("else"),a=t.getAttribute("filter"),c=t.getAttribute("sort"),l=parseInt(t.getAttribute("limit"))||1/0,d=parseInt(t.getAttribute("offset"))||0,f=t.getAttribute("template"),y=t.getAttribute("animate-enter")||t.getAttribute("animate"),u=t.getAttribute("animate-leave"),h=parseInt(t.getAttribute("animate-stagger"))||0,b=parseInt(t.getAttribute("animate-duration"))||0;if(!o||!e)return;let p=f?null:t.cloneNode(!0);function A(){let E=ct(o,n);if(!Array.isArray(E))return;if(a&&(E=E.filter((m,v)=>{let S=F({[e]:m,[s]:v},n);return!!C(a,S)})),c){let m=c.startsWith("-"),v=m?c.slice(1):c;E=[...E].sort((S,I)=>{let T=ct(v,S)??S?.[v],H=ct(v,I)??I?.[v],$=T<H?-1:T>H?1:0;return m?-$:$})}if(E=E.slice(d,d+l),E.length===0&&i){let m=Y(i);m&&(z(t),t.innerHTML="",t.appendChild(m),R(t));return}let g=f?document.getElementById(f):null,x=E.length;function L(){z(t),t.innerHTML="",E.forEach((m,v)=>{let S={[e]:m,[s]:v,$index:v,$count:x,$first:v===0,$last:v===x-1,$even:v%2===0,$odd:v%2!==0},I=F(S,n),T;g?T=g.content.cloneNode(!0):T=p.cloneNode(!0);let H=document.createElement("div");if(H.style.display="contents",H.__ctx=I,H.appendChild(T),t.appendChild(H),R(H),y){let $=H.firstElementChild;$&&($.classList.add(y),$.addEventListener("animationend",()=>$.classList.remove(y),{once:!0}),h&&($.style.animationDelay=v*h+"ms"))}})}if(u&&t.children.length>0){let m=[...t.children],v=m.length;m.forEach(S=>{let I=S.firstElementChild||S;I.classList.add(u);let T=()=>{I.classList.remove(u),v--,v<=0&&L()};I.addEventListener("animationend",T,{once:!0}),setTimeout(T,b||2e3)})}else L()}V(o,n,A),A()}});Q();gt();D("class-*",{priority:20,init(t,r,e){let n=r.replace("class-",""),o=j(t);if(n==="map"){let i=function(){let a=C(e,o);if(a&&typeof a=="object")for(let[c,l]of Object.entries(a))c.split(/\s+/).filter(Boolean).forEach(f=>t.classList.toggle(f,!!l))};V(e,o,i),i();return}if(n==="list"){let a=function(){let c=C(e,o);if(Array.isArray(c)){i.forEach(d=>{d&&t.classList.remove(d)});let l=c.filter(Boolean);l.forEach(d=>t.classList.add(d)),i=l}},i=[];V(e,o,a),a();return}function s(){t.classList.toggle(n,!!C(e,o))}V(e,o,s),(e.includes("$i18n")||e.includes("NoJS.locale"))&&Ht(s),s()}});D("style-*",{priority:20,init(t,r,e){let n=r.replace("style-",""),o=j(t);if(n==="map"){let a=function(){let c=C(e,o);if(c&&typeof c=="object")for(let[l,d]of Object.entries(c))t.style[l]=d??""};V(e,o,a),a();return}let s=n.replace(/-([a-z])/g,(a,c)=>c.toUpperCase());function i(){let a=C(e,o);t.style[s]=a!=null?String(a):""}V(e,o,i),i()}});Q();D("on:*",{priority:20,init(t,r,e){let n=j(t),o=r.replace("on:","").split("."),s=o[0],i=new Set(o.slice(1));if(s==="mounted"){requestAnimationFrame(()=>et(e,n,{$el:t}));return}if(s==="init"){et(e,n,{$el:t});return}if(s==="updated"){let f=new MutationObserver(()=>{et(e,n,{$el:t})});f.observe(t,{childList:!0,subtree:!0,characterData:!0,attributes:!0}),q(()=>f.disconnect());return}if(s==="error"){let f=y=>{(t.contains(y.target)||y.target===t)&&et(e,n,{$el:t,$error:y.error||y.message})};window.addEventListener("error",f),q(()=>window.removeEventListener("error",f));return}if(s==="unmounted"){let f=new MutationObserver(y=>{for(let u of y)for(let h of u.removedNodes)if(h===t||h.contains?.(t)){et(e,n,{$el:t}),f.disconnect();return}});t.parentElement&&f.observe(t.parentElement,{childList:!0,subtree:!0}),q(()=>f.disconnect());return}let a=0,c=0;for(let f of i)/^\d+$/.test(f)&&(i.has("debounce")?a=parseInt(f):i.has("throttle")&&(c=parseInt(f)));let l=f=>{if(s==="keydown"||s==="keyup"||s==="keypress"){let y=["enter","escape","tab","space","delete","backspace","up","down","left","right","ctrl","alt","shift","meta"];for(let u of i)if(y.includes(u)&&(u==="enter"&&f.key!=="Enter"||u==="escape"&&f.key!=="Escape"||u==="tab"&&f.key!=="Tab"||u==="space"&&f.key!==" "||u==="delete"&&f.key!=="Delete"&&f.key!=="Backspace"||u==="up"&&f.key!=="ArrowUp"||u==="down"&&f.key!=="ArrowDown"||u==="left"&&f.key!=="ArrowLeft"||u==="right"&&f.key!=="ArrowRight"||u==="ctrl"&&!f.ctrlKey||u==="alt"&&!f.altKey||u==="shift"&&!f.shiftKey||u==="meta"&&!f.metaKey))return}i.has("prevent")&&f.preventDefault(),i.has("stop")&&f.stopPropagation(),!(i.has("self")&&f.target!==t)&&et(e,n,{$event:f,$el:t})};if(a>0){let f=l,y;l=u=>{clearTimeout(y),y=setTimeout(()=>f(u),a)}}if(c>0){let f=l,y=0;l=u=>{let h=Date.now();h-y>=c&&(y=h,f(u))}}let d={};i.has("once")&&(d.once=!0),t.addEventListener(s,l,d),d.once||q(()=>t.removeEventListener(s,l,d))}});D("trigger",{priority:20,init(t,r,e){let n=j(t),o=t.getAttribute("trigger-data"),s=()=>{let i=o?C(o,n):null;t.dispatchEvent(new CustomEvent(e,{detail:i,bubbles:!0}))};t.addEventListener("click",s),q(()=>t.removeEventListener("click",s))}});Q();D("ref",{priority:5,init(t,r,e){mt[e]=t,q(()=>{mt[e]===t&&delete mt[e]})}});D("use",{priority:10,init(t,r,e){let n=j(t),o=Y(e);if(!o)return;let s={};for(let d of[...t.attributes])if(d.name.startsWith("var-")){let f=d.name.replace("var-","");s[f]=C(d.value,n)}let i=F(s,n),a={};for(let d of[...t.children]){let f=d.getAttribute("slot")||"default";a[f]||(a[f]=document.createDocumentFragment()),a[f].appendChild(d.cloneNode(!0))}let c=o.querySelectorAll("slot");for(let d of c){let f=d.getAttribute("name")||"default";a[f]&&d.replaceWith(a[f])}z(t),t.innerHTML="";let l=document.createElement("div");l.style.display="contents",l.__ctx=i,l.appendChild(o),t.appendChild(l),R(l)}});D("call",{priority:20,init(t,r,e){let n=j(t),o=t.getAttribute("method")||"get",s=t.getAttribute("as")||"data",i=t.getAttribute("into"),a=t.getAttribute("success"),c=t.getAttribute("error"),l=t.getAttribute("loading"),d=t.getAttribute("then"),f=t.getAttribute("confirm"),y=t.getAttribute("body"),u=t.getAttribute("redirect"),h=t.getAttribute("headers"),b=[...t.childNodes].map(E=>E.cloneNode(!0)),p=null,A=async E=>{if(E.preventDefault(),f&&!window.confirm(f))return;p&&p.abort(),p=new AbortController;let g=xt(e,n);if(l){let x=Y(l);x&&(z(t),t.innerHTML="",t.appendChild(x),R(t),t.disabled=!0)}try{let x=null;if(y){let v=xt(y,n);try{x=JSON.parse(v)}catch{x=v}}let L=h?JSON.parse(h):{},m=await Mt(g,o,x,L,t,p.signal);if(l){z(t),t.innerHTML="";for(let v of b)t.appendChild(v.cloneNode(!0));t.disabled=!1}if(s&&n.$set(s,m),i&&(J[i]||(J[i]=F({})),J[i].$set(s,m),_t()),d&&et(d,n,{result:m}),a){let v=Y(a);if(v){let I=document.getElementById(a.replace("#",""))?.getAttribute("var")||"result",T=F({[I]:m},n),H=t.closest("[route-view]")||t.parentElement,$=document.createElement("div");$.style.display="contents",$.__ctx=T,$.appendChild(v),H.appendChild($),R($)}}u&&X&&X.push(u),vt("fetch:success",{url:g,data:m}),tt("fetch:success",{method:o,url:g})}catch(x){if(x.name==="AbortError")return;if(st(`call ${o.toUpperCase()} ${g} failed:`,x.message),l){z(t),t.innerHTML="";for(let L of b)t.appendChild(L.cloneNode(!0));t.disabled=!1}if(vt("fetch:error",{url:g,error:x}),vt("error",{url:g,error:x}),tt("fetch:error",{method:o,url:g,error:x.message}),c){let L=Y(c);if(L){let v=document.getElementById(c.replace("#",""))?.getAttribute("var")||"err",S=F({[v]:{message:x.message,status:x.status,body:x.body}},n),I=t.parentElement,T=document.createElement("div");T.style.display="contents",T.__ctx=S,T.appendChild(L),I.appendChild(T),R(T)}}}};t.addEventListener("click",A),q(()=>t.removeEventListener("click",A))}});Q();var Ge=[["valueMissing","required"],["typeMismatch",null],["tooShort","minlength"],["tooLong","maxlength"],["patternMismatch","pattern"],["rangeUnderflow","min"],["rangeOverflow","max"],["stepMismatch","step"]],De=["required","email","url","number","date","time","datetime-local","month","week","tel","minlength","maxlength","pattern","min","max","step"];function Qe(t){return(t.getAttribute("type")||"text").toLowerCase()}function Ze(t,r){let e=[],n=new Set,o=t.getAttribute("validate");if(o){let i=o.split("|").map(a=>a.trim());for(let a of i){let[c,...l]=a.split(":"),d=pt[c];if(d){let f=d(t.value,...l,r);f!==!0&&f&&(e.push({rule:c,message:f}),n.add(c))}else{let f=t.value,y=null;switch(c){case"required":(f==null||String(f).trim()==="")&&(y="Required");break;case"email":f&&!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(f)&&(y="Invalid email");break;case"url":try{new URL(f)}catch{y="Invalid URL"}break;case"min":Number(f)<Number(l[0])&&(y=`Minimum value is ${l[0]}`);break;case"max":Number(f)>Number(l[0])&&(y=`Maximum value is ${l[0]}`);break;case"custom":if(l[0]&&pt[l[0]]){let u=pt[l[0]](f,r);u!==!0&&u&&(y=u)}break}y&&(e.push({rule:c,message:y}),n.add(c))}}}let s=t.validity;if(s&&!s.valid){for(let[i,a]of Ge)if(s[i]){let c=a||Qe(t);n.has(c)||(e.push({rule:c,message:t.validationMessage}),n.add(c))}}return e}function tr(t,r,e){let n=t.getAttribute(`error-${r}`);if(n)return n;let o=t.getAttribute("error");return o&&!o.startsWith("#")?o:e}function er(t,r){if(!t.length)return null;let n=[...t].sort((o,s)=>{let i=De.indexOf(o.rule),a=De.indexOf(s.rule);return(i===-1?999:i)-(a===-1?999:a)})[0];return{rule:n.rule,message:tr(r,n.rule,n.message)}}function rr(t,r,e,n,o){oe(n);let s=document.querySelector(t);if(!s)return;let i=s.content.cloneNode(!0),a=document.createElement("div");a.style.display="contents",a.__errorTemplateFor=n;let c=F({$error:r,$rule:e},o);a.__ctx=c,a.appendChild(i),s.parentNode.insertBefore(a,s.nextSibling),R(a)}function oe(t){let r=document.querySelector('div[style="display: contents;"]'),e=document.querySelectorAll('div[style="display: contents;"]');for(let n of e)n.__errorTemplateFor===t&&n.remove()}function nr(t,r){let e=t.getAttribute("validate-if");if(!e)return!0;try{return!!C(e,r)}catch{return!0}}function or(t,r){let e=t.getAttribute("validate-on");if(e)return e.split(/\s+/);let n=r?r.getAttribute("validate-on"):null;return n?n.split(/\s+/):["input","focusout"]}function sr(t,r,e){let n=r.split("|").map(o=>o.trim());for(let o of n){let[s,...i]=o.split(":"),a=pt[s];if(a){let c=a(t,...i,e);if(c!==!0&&c)return c}else switch(s){case"required":if(t==null||String(t).trim()==="")return"Required";break;case"email":if(t&&!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t))return"Invalid email";break;case"url":try{new URL(t)}catch{return"Invalid URL"}break;case"min":if(Number(t)<Number(i[0]))return`Minimum value is ${i[0]}`;break;case"max":if(Number(t)>Number(i[0]))return`Maximum value is ${i[0]}`;break;case"custom":if(i[0]&&pt[i[0]]){let c=pt[i[0]](t,e);if(c!==!0&&c)return c}break}}return null}D("validate",{priority:30,init(t,r,e){let n=j(t);if(t.tagName==="FORM"){let l=function(){return t.querySelectorAll("input, textarea, select")},d=function(){let b={},p={},A={},E=!0,g=null,x=0,L=!1;for(let m of l())m.name&&(m.type==="checkbox"?p[m.name]=m.checked:m.type==="radio"?m.checked?p[m.name]=m.value:m.name in p||(p[m.name]=""):p[m.name]=m.value);for(let m of l()){if(!m.name)continue;let v=s.has(m.name),S=i.has(m.name);if(!nr(m,n)){A[m.name]={valid:!0,dirty:S,touched:v,error:null,value:p[m.name]};continue}let I=Ze(m,p),T=er(I,m),H=!T,$=v||S;H||(E=!1),!H&&$&&(b[m.name]=T.message,x++,g||(g=T.message)),A[m.name]={valid:H,dirty:S,touched:v,error:T?T.message:null,value:p[m.name]};let it=m.getAttribute("error-class")||o;if(it){let rt=it.split(/\s+/);!H&&$?m.classList.add(...rt):m.classList.remove(...rt)}if(T&&$){let rt=m.getAttribute(`error-${T.rule}`),k=m.getAttribute("error"),U=(rt&&rt.startsWith("#")?rt:null)||(k&&k.startsWith("#")?k:null);U?rr(U,T.message,T.rule,m,n):oe(m)}else oe(m);let P=m.getAttribute("as");P&&n.$set(P,A[m.name])}a.size>0&&(L=!0),c.valid=E,c.errors=b,c.values=p,c.fields=A,c.firstError=g,c.errorCount=x,c.pending=L,n.$set("$form",{...c}),f(t,E&&!L)},f=function(b,p){let A=b.querySelectorAll('button:not([type="button"]), input[type="submit"]');for(let E of A){if(E.hasAttribute("disabled")&&E.getAttribute("disabled")!==""){let g=E.getAttribute("disabled");if(g!=="disabled"&&g!=="true"&&g!=="false")continue}E.disabled=!p,E.__autoDisabled=!0}},y=function(b){if(!b.name)return;let p=or(b,t),A=()=>{i.add(b.name),c.dirty=!0,d()},E=()=>{s.add(b.name),c.touched=!0,d()};p.includes("input")?b.addEventListener("input",A):b.addEventListener("input",()=>{i.add(b.name),c.dirty=!0,d()}),p.includes("blur")||p.includes("focusout")?b.addEventListener("focusout",g=>{E(),p.includes("blur")&&A()}):b.addEventListener("focusout",E),p.includes("submit")&&b.addEventListener("focusout",E)};t.setAttribute("novalidate","");let o=t.getAttribute("error-class"),s=new Set,i=new Set,a=new Map,c={valid:!1,dirty:!1,touched:!1,submitting:!1,pending:!1,errors:{},values:{},firstError:null,errorCount:0,fields:{},reset:()=>{c.dirty=!1,c.touched=!1,c.pending=!1,s.clear(),i.clear(),t.reset(),d()}};n.$set("$form",c);let u=t.hasAttribute("validate-on"),h=[...l()].some(b=>b.hasAttribute("validate-on"));if(!u&&!h){let b=p=>{let A=p.target;A&&A.name&&i.add(A.name),c.dirty=!0,d()};t.addEventListener("input",b),t.addEventListener("change",b),t.addEventListener("focusout",p=>{p.target&&p.target.name&&s.add(p.target.name),c.touched=!0,d()})}else for(let b of l())y(b);t.addEventListener("submit",b=>{c.submitting=!0;for(let p of l())p.name&&s.add(p.name);c.touched=!0,d(),n.$set("$form",{...c}),requestAnimationFrame(()=>{c.submitting=!1,n.$set("$form",{...c})})}),requestAnimationFrame(d);return}if(e&&(t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.tagName==="SELECT")){let o=t.getAttribute("error");t.addEventListener("input",()=>{let s=sr(t.value,e,{});if(s&&o){let i=t.nextElementSibling?.__validationError?t.nextElementSibling:null;i||(i=document.createElement("div"),i.__validationError=!0,i.style.display="contents",t.parentNode.insertBefore(i,t.nextSibling));let a=Y(o);if(a){let c=F({err:{message:s}},n);i.innerHTML="",i.__ctx=c,i.appendChild(a),R(i)}}else{let i=t.nextElementSibling?.__validationError?t.nextElementSibling:null;i&&(i.innerHTML="")}})}}});D("error-boundary",{priority:1,init(t,r,e){let n=j(t);function o(i){let a=Y(e);if(a){let c=F({err:{message:i}},n);z(t),t.innerHTML="";let l=document.createElement("div");l.style.display="contents",l.__ctx=c,l.appendChild(a),t.appendChild(l),R(l)}}t.addEventListener("nojs:error",i=>{o(i.detail?.message||"An error occurred")});let s=i=>{(t.contains(i.target)||t===i.target)&&o(i.message||"An error occurred")};window.addEventListener("error",s),q(()=>window.removeEventListener("error",s))}});gt();Q();D("t",{priority:20,init(t,r,e){let n=j(t),o=t.hasAttribute("t-html");function s(){let i={};for(let c of[...t.attributes])if(c.name.startsWith("t-")&&c.name!=="t"&&c.name!=="t-html"){let l=c.name.replace("t-","");i[l]=C(c.value,n)??c.value}let a=K.t(e,i);o?t.innerHTML=a:t.textContent=a}V(e,n,s),Ht(s),s()}});D("i18n-ns",{priority:1,init(t,r,e){if(!e)return;let n=document.createDocumentFragment();for(;t.firstChild;)n.appendChild(t.firstChild);Gt(e).then(()=>{t.appendChild(n),R(t),Dt()})}});Q();var w={dragging:null,selected:new Map,placeholder:null};function Pt(t){let r=0;for(let e of t.children){if(e.classList.contains("nojs-drop-placeholder"))continue;(e.style||{}).display==="contents"?r+=Pt(e):r++}return r}function se(){if(typeof document>"u"||document.querySelector("style[data-nojs-dnd]"))return;let t=`
|
|
27
|
+
`.trim(),n=document.createElement("style");n.setAttribute("data-nojs-animations",""),n.textContent=t,document.head.appendChild(n)}function $t(t,n,r,e){je();let i=e||1e3;if(n){let o=t.firstElementChild||t;o.classList.add(n),e&&(o.style.animationDuration=e+"ms"),o.addEventListener("animationend",()=>o.classList.remove(n),{once:!0})}if(r){let o=t.firstElementChild||t;o.classList.add(r+"-enter",r+"-enter-active"),requestAnimationFrame(()=>{o.classList.remove(r+"-enter"),o.classList.add(r+"-enter-to");let s=()=>{o.classList.remove(r+"-enter-active",r+"-enter-to")};o.addEventListener("transitionend",s,{once:!0}),setTimeout(s,i)})}}function Rt(t,n,r,e,i){je();let o=i||2e3;if(!t.firstElementChild&&!t.childNodes.length){e();return}if(n){let s=t.firstElementChild||t;s.classList.add(n),i&&(s.style.animationDuration=i+"ms");let a=!1,c=()=>{a||(a=!0,s.classList.remove(n),e())};s.addEventListener("animationend",c,{once:!0}),setTimeout(c,o);return}if(r){let s=t.firstElementChild||t;s.classList.add(r+"-leave",r+"-leave-active"),requestAnimationFrame(()=>{s.classList.remove(r+"-leave"),s.classList.add(r+"-leave-to");let a=!1,c=()=>{a||(a=!0,s.classList.remove(r+"-leave-active",r+"-leave-to"),e())};s.addEventListener("transitionend",c,{once:!0}),setTimeout(c,o)});return}e()}var Be='<div style="text-align:center;padding:3rem 1rem;font-family:system-ui,sans-serif"><h1 style="font-size:4rem;margin:0;opacity:.3">404</h1><p style="font-size:1.25rem;color:#666">Page not found</p></div>';function Me(t){let n=(L.router.base||"/").replace(/\/$/,"");if(!n)return t||"/";let r=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return t.replace(new RegExp("^"+r),"")||"/"}function He(){let t=[],n=new Map,r={path:"",params:{},query:{},hash:""},e=new Set,i=new Map;function o(p){let v=t.find(E=>E.path===p);return v||(v={path:p,outlets:{}},t.push(v)),v}function s(p){let v={};return new URLSearchParams(p).forEach((E,m)=>{v[m]=E}),v}function a(p){for(let v of t){let E=[],m=v.path.replace(/:(\w+)/g,(y,A)=>(E.push(A),"([^/]+)")),T=new RegExp("^"+m+"$"),w=p.match(T);if(w){let y={};return E.forEach((A,S)=>{y[A]=w[S+1]}),{route:v,params:y}}}return null}async function c(p,v=!1){let E=p.indexOf("#"),m=E>=0?p.slice(E+1):"",T=E>=0?p.slice(0,E):p,[w,y=""]=T.split("?");r={path:w,params:{},query:s(y),hash:m?"#"+m:""};let A=a(w);if(A){r.matched=!0,r.params=A.params;let S=A.route.outlets?.default,h=S?.getAttribute("guard"),x=S?.getAttribute("redirect");if(h){let I=q({},null);if(I.__raw.$store=J,I.__raw.$route=r,!k(h,I)&&x){await c(x,!0);return}}}else{r.matched=!1;let S=n.get("default");if(S){let h=S.getAttribute("guard"),x=S.getAttribute("redirect");if(h){let I=q({},null);if(I.__raw.$store=J,I.__raw.$route=r,!k(h,I)&&x){await c(x,!0);return}}}}if(L.router.useHash){let S="#"+p;v?window.location.replace(S):window.location.hash=p}else{let S=(L.router.base||"/").replace(/\/$/,"")+p;v?window.history.replaceState({},"",S):window.history.pushState({},"",S)}if(await d(A),e.forEach(S=>S(r)),rt("route:navigate",{path:r.path,params:r.params,query:r.query,hash:r.hash}),r.hash){let S=r.hash.slice(1);requestAnimationFrame(()=>{let h=document.getElementById(S);h&&h.scrollIntoView({behavior:"smooth"})})}}async function d(p){let v=document.querySelectorAll("[route-view]");for(let m of v){let T=m.getAttribute("route-view"),w=T&&T.trim()!==""?T.trim():"default",y=p?.route?.outlets?.[w],A=L.router.templates||"";if(!y&&(m.hasAttribute("src")||A)){let h=(m.getAttribute("src")||A).replace(/\/?$/,"/"),x=m.getAttribute("ext")||L.router.ext||".html",I=m.getAttribute("route-index")||"index",N=r.path==="/"?I:r.path.replace(/^\//,""),l=h+N+x,g=w+":"+l;i.has(g)?y=i.get(g):(y=document.createElement("template"),y.setAttribute("src",l),y.setAttribute("route",r.path),document.body.appendChild(y),i.set(g,y),Z("[ROUTER] File-based route:",r.path,"\u2192",l)),m.hasAttribute("i18n-ns")&&!y.getAttribute("i18n-ns")&&y.setAttribute("i18n-ns",N)}if((!y||y.__loadFailed)&&(!p||y?.__loadFailed)){let S=n.get(w)||(w!=="default"?n.get("default"):null);S&&(y=S)}if(Oe(m),m.innerHTML="",y&&!y.__loadFailed){if(y.getAttribute("src")&&!y.__srcLoaded&&(Z("Loading route template on demand:",y.getAttribute("src")),await yt(y)),y.__loadFailed){let g=n.get(w)||(w!=="default"?n.get("default"):null);if(g&&!g.__loadFailed&&(y=g,y.getAttribute("src")&&!y.__srcLoaded&&await yt(y)),!y||y.__loadFailed){m.innerHTML=Be;continue}}let S=y.getAttribute("i18n-ns");if(S){let{_loadI18nNamespace:g}=await Promise.resolve().then(()=>(ht(),ge));await g(S)}let h=y.content.cloneNode(!0),x=q({$route:r},P(m)),I=document.createElement("div");I.style.display="contents",I.__ctx=x,y.content.__srcBase&&(I.__srcBase=y.content.__srcBase),I.appendChild(h),m.appendChild(I),Ht(I);let N=[...I.querySelectorAll("template[src]")];Z("[ROUTER] nested templates found in wrapper:",N.length,N.map(g=>g.getAttribute("src")+(g.__srcLoaded?"[LOADED]":"[NEW]"))),await Promise.all(N.map(yt)),Z("[ROUTER] all nested loads done for route:",r.path);let l=m.getAttribute("transition");l&&$t(I,null,l),bt(I),F(I)}else(!p||y?.__loadFailed)&&(m.innerHTML=Be)}document.querySelectorAll("[route]").forEach(m=>{let T=m.getAttribute("route"),w=m.getAttribute("route-active")||"active",y=m.getAttribute("route-active-exact");if(y)m.classList.toggle(y,r.path===T);else if(w&&!m.hasAttribute("route-active-exact")){let A=T==="/"?r.path==="/":r.path.startsWith(T);m.classList.toggle(w,A)}});let E=L.router.scrollBehavior;E==="top"?window.scrollTo(0,0):E==="smooth"&&window.scrollTo({top:0,behavior:"smooth"})}function f(p,v){v.scrollIntoView({behavior:"smooth"});let E='a[href="#'+p+'"]';document.querySelectorAll('a[href^="#"]').forEach(m=>{m.hasAttribute("route")||m.classList.toggle("active",m.matches(E))})}function u(){let p=document.querySelectorAll("[route-view]");for(let v of p){let E=v.getAttribute("src")||L.router.templates||"";if(!E)continue;let m=E.replace(/\/?$/,"/"),T=v.getAttribute("ext")||L.router.ext||".html",w=v.getAttribute("route-index")||"index",y=(v.getAttribute("route-view")||"").trim()||"default",A=new Map;document.querySelectorAll("[route]:not([route-view])").forEach(x=>{let I=x.getAttribute("route");if(!I)return;let N=I.split("?")[0].split("#")[0],l=x.getAttribute("lazy"),g=A.get(N);(!A.has(N)||l==="priority"||g==="ondemand"&&l!=="ondemand")&&A.set(N,l)});let S=[],h=[];for(let[x,I]of A){if(I==="ondemand"||x===r.path||x==="*")continue;let N=x==="/"?w:x.replace(/^\//,""),l=m+N+T,g=y+":"+l;if(i.has(g))continue;let b=document.createElement("template");b.setAttribute("src",l),b.setAttribute("route",x),document.body.appendChild(b),i.set(g,b),Z("[ROUTER] Prefetch:",x,"\u2192",l,I==="priority"?"(priority)":"(background)"),v.hasAttribute("i18n-ns")&&b.setAttribute("i18n-ns",N),I==="priority"?S.push(b):h.push(b)}(S.length||h.length)&&Promise.all(S.map(yt)).then(()=>{h.forEach(yt)})}}return{get current(){return r},push(p){return c(p)},replace(p){return c(p,!0)},back(){window.history.back()},forward(){window.history.forward()},on(p){return e.add(p),()=>e.delete(p)},register(p,v,E="default"){if(p==="*"){n.set(E,v);return}let m=o(p);m.outlets[E]=v},async init(){if(document.querySelectorAll("template[route]").forEach(p=>{let v=p.getAttribute("route"),E=p.getAttribute("outlet")||"default";if(v==="*"){n.set(E,p);return}let m=o(v);m.outlets[E]=p}),document.addEventListener("click",p=>{let v=p.target.closest("[route]");if(v&&!v.hasAttribute("route-view")){p.preventDefault();let m=v.getAttribute("route");c(m);return}let E=p.target.closest('a[href^="#"]');if(E&&!E.hasAttribute("route")){let T=E.getAttribute("href").slice(1);if(T&&!T.startsWith("/")){let w=document.getElementById(T);w&&(p.preventDefault(),f(T,w),L.router.useHash||window.history.replaceState(null,"","#"+T))}}}),L.router.useHash){window.addEventListener("hashchange",()=>{let v=window.location.hash.slice(1)||"/";if(!v.startsWith("/")){let m=document.getElementById(v);m&&(f(v,m),window.history.replaceState(null,"","#"+r.path));return}let[E]=v.split("?");E!==r.path&&c(v,!0)});let p=window.location.hash.slice(1)||"/";await c(p,!0)}else{window.addEventListener("popstate",()=>{let v=Me(window.location.pathname);if(v===r.path){let E=window.location.hash.slice(1);if(E){let m=document.getElementById(E);m&&f(E,m)}return}c(v,!0)});let p=Me(window.location.pathname);await c(p,!0)}u()}}}tt();B.uppercase=t=>String(t??"").toUpperCase();B.lowercase=t=>String(t??"").toLowerCase();B.capitalize=t=>String(t??"").replace(/\b\w/g,n=>n.toUpperCase());B.truncate=(t,n=100)=>{let r=String(t??"");return r.length>n?r.slice(0,n)+"...":r};B.trim=t=>String(t??"").trim();B.stripHtml=t=>String(t??"").replace(/<[^>]*>/g,"");B.slugify=t=>String(t??"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"");B.nl2br=t=>String(t??"").replace(/\n/g,"<br>");B.encodeUri=t=>encodeURIComponent(String(t??""));B.number=(t,n=0)=>{let r=Number(t);return isNaN(r)?t:r.toLocaleString(void 0,{minimumFractionDigits:n,maximumFractionDigits:n})};B.currency=(t,n="USD")=>{let r=Number(t);if(isNaN(r))return t;try{return r.toLocaleString(void 0,{style:"currency",currency:n})}catch{return`${n} ${r.toFixed(2)}`}};B.percent=(t,n=0)=>{let r=Number(t);return isNaN(r)?t:(r*100).toFixed(n)+"%"};B.filesize=t=>{let n=Number(t);if(isNaN(n))return t;let r=["B","KB","MB","GB","TB"],e=0,i=n;for(;i>=1024&&e<r.length-1;)i/=1024,e++;return i.toFixed(e>0?1:0)+" "+r[e]};B.ordinal=t=>{let n=Number(t);if(isNaN(n))return t;let r=["th","st","nd","rd"],e=n%100;return n+(r[(e-20)%10]||r[e]||r[0])};B.count=t=>Array.isArray(t)?t.length:0;B.first=t=>Array.isArray(t)?t[0]:t;B.last=t=>Array.isArray(t)?t[t.length-1]:t;B.join=(t,n=", ")=>Array.isArray(t)?t.join(n):t;B.reverse=t=>Array.isArray(t)?[...t].reverse():t;B.unique=t=>Array.isArray(t)?[...new Set(t)]:t;B.pluck=(t,n)=>Array.isArray(t)?t.map(r=>r?.[n]):t;B.sortBy=(t,n)=>{if(!Array.isArray(t))return t;let r=n?.startsWith("-"),e=r?n.slice(1):n;return[...t].sort((i,o)=>{let s=i?.[e],a=o?.[e],c=s<a?-1:s>a?1:0;return r?-c:c})};B.where=(t,n,r)=>Array.isArray(t)?t.filter(e=>e?.[n]===r):t;B.date=(t,n="short")=>{let r=new Date(t);if(isNaN(r))return t;let e=n==="long"?{dateStyle:"long"}:n==="full"?{dateStyle:"full"}:{dateStyle:"short"};return r.toLocaleDateString(void 0,e)};B.datetime=t=>{let n=new Date(t);return isNaN(n)?t:n.toLocaleString()};B.relative=t=>{let n=new Date(t);if(isNaN(n))return t;let r=(Date.now()-n.getTime())/1e3;return r<60?"just now":r<3600?Math.floor(r/60)+"m ago":r<86400?Math.floor(r/3600)+"h ago":r<2592e3?Math.floor(r/86400)+"d ago":n.toLocaleDateString()};B.fromNow=t=>{let n=new Date(t);if(isNaN(n))return t;let r=(n.getTime()-Date.now())/1e3;return r<0?B.relative(t):r<60?"in a moment":r<3600?"in "+Math.floor(r/60)+"m":r<86400?"in "+Math.floor(r/3600)+"h":"in "+Math.floor(r/86400)+"d"};B.default=(t,n="")=>t==null||t===""?n:t;B.json=(t,n=2)=>JSON.stringify(t,null,n);B.debug=t=>(console.log("[No.JS debug]",t),t);B.keys=t=>t&&typeof t=="object"?Object.keys(t):[];B.values=t=>t&&typeof t=="object"?Object.values(t):[];tt();O("state",{priority:0,init(t,n,r){let e=k(r,q())||{},i=t.parentElement?P(t.parentElement):null,o=q(e,i);t.__ctx=o;let s=t.getAttribute("persist"),a=t.getAttribute("persist-key");if(s&&a){let c=s==="localStorage"?localStorage:s==="sessionStorage"?sessionStorage:null;if(c){try{let d=c.getItem("nojs_state_"+a);if(d){let f=JSON.parse(d);for(let[u,_]of Object.entries(f))o.$set(u,_)}}catch{}o.$watch(()=>{try{c.setItem("nojs_state_"+a,JSON.stringify(o.__raw))}catch{}})}}Z("state",e)}});O("store",{priority:0,init(t,n,r){let e=t.getAttribute("value");if(r){if(!J[r]){let i=e?k(e,q())||{}:{};J[r]=q(i),rt("store:created",{name:r,keys:Object.keys(i)})}Z("store",r)}}});O("computed",{priority:2,init(t,n,r){let e=t.getAttribute("expr");if(!r||!e)return;let i=P(t);function o(){let s=k(e,i);i.$set(r,s)}Y(e,i,o),o()}});O("watch",{priority:2,init(t,n,r){let e=P(t),i=t.getAttribute("on:change"),o=k(r,e);Y(r,e,()=>{let s=k(r,e);if(s!==o){let a=o;o=s,i&&nt(i,e,{$old:a,$new:s})}})}});tt();var ur=["get","post","put","patch","delete"];for(let t of ur)O(t,{priority:1,init(n,r,e){let i=n.getAttribute("as")||"data",o=n.getAttribute("loading"),s=n.getAttribute("error"),a=n.getAttribute("empty"),c=n.getAttribute("success"),d=n.getAttribute("then"),f=n.getAttribute("redirect"),u=n.getAttribute("confirm"),_=parseInt(n.getAttribute("refresh"))||0,p=n.getAttribute("cached"),v=n.hasAttribute("cached")?p||"memory":"none",E=n.getAttribute("body"),m=n.getAttribute("headers"),T=n.getAttribute("var"),w=n.getAttribute("into"),y=parseInt(n.getAttribute("retry"))||L.retries,A=parseInt(n.getAttribute("retry-delay"))||L.retryDelay||1e3,S=n.getAttribute("params"),h=n.parentElement?P(n.parentElement):q(),x=n.__ctx||q({},h);n.__ctx=x;let I=[...n.childNodes].map(b=>b.cloneNode(!0)),N=null;async function l(){if(N&&N.abort(),N=new AbortController,u&&!window.confirm(u))return;let b=wt(e,x);if(S){let M=k(S,x);if(M&&typeof M=="object"){let it=b.includes("?")?"&":"?",$=new URLSearchParams(M).toString();$&&(b+=it+$)}}let X=t+":"+b;if(t==="get"){let M=Te(X,v);if(M!=null){x.$set(i,M),bt(n),F(n);return}}if(o){let M=Q(o);M&&(K(n),n.innerHTML="",n.appendChild(M),F(n))}try{let M=null;if(E){let D=wt(E,x);try{M=JSON.parse(D)}catch{M=D}}if(n.tagName==="FORM"){let D=new FormData(n);M=Object.fromEntries(D.entries())}let it=m?JSON.parse(m):{},$=L.retries,W=L.retryDelay;L.retries=y,L.retryDelay=A;let H;try{H=await Mt(b,t,M,it,n,N.signal)}finally{L.retries=$,L.retryDelay=W}if(t==="get"&&Se(X,H,v),a&&(H==null||Array.isArray(H)&&H.length===0)){let D=Q(a);D&&(K(n),n.innerHTML="",n.appendChild(D),F(n));return}if(x.$set(i,H),w&&(J[w]||(J[w]=q({})),J[w].$set(i,H),_t()),c){let D=Q(c);if(D){K(n),n.innerHTML="";let ct=document.getElementById(c.replace("#",""))?.getAttribute("var")||T||"result",vt=q({[ct]:H},x),ot=document.createElement("div");ot.style.display="contents",ot.__ctx=vt,ot.appendChild(D),n.appendChild(ot),F(ot)}}else{K(n),n.innerHTML="";for(let D of I)n.appendChild(D.cloneNode(!0));bt(n),F(n)}d&&nt(d,x,{result:H}),f&&G&&G.push(f),Et("fetch:success",{url:b,data:H}),rt("fetch:success",{method:t,url:b})}catch(M){if(M.name==="AbortError")return;if(at(`${t.toUpperCase()} ${b} failed:`,M.message),Et("fetch:error",{url:b,error:M}),Et("error",{url:b,error:M}),rt("fetch:error",{method:t,url:b,error:M.message}),s){let it=Q(s);if(it){K(n),n.innerHTML="";let W=document.getElementById(s.replace("#",""))?.getAttribute("var")||"err",H=q({[W]:{message:M.message,status:M.status,body:M.body}},x),D=document.createElement("div");D.style.display="contents",D.__ctx=H,D.appendChild(it),n.appendChild(D),F(D)}}}}if(n.tagName==="FORM"&&t!=="get"){let b=X=>{X.preventDefault(),l()};n.addEventListener("submit",b),U(()=>n.removeEventListener("submit",b))}else if(t==="get")l();else{let b=X=>{X.preventDefault(),l()};n.addEventListener("click",b),U(()=>n.removeEventListener("click",b))}if(/\{[^}]+\}/.test(e)){let it=function(){let W=wt(e,x);W!==X&&(X=W,M&&clearTimeout(M),b>0?M=setTimeout(l,b):l())},b=parseInt(n.getAttribute("debounce"))||0,X=wt(e,x),M=null;U(()=>{M&&clearTimeout(M)});let $=h;for(;$&&$.__isProxy;){let W=$.$watch(it);U(W),$=$.$parent}}if(n.refresh=l,U(()=>{delete n.refresh}),_>0){let b=setInterval(l,_);U(()=>clearInterval(b))}}});tt();O("bind",{priority:20,init(t,n,r){let e=P(t);function i(){let o=k(r,e);t.textContent=o!=null?String(o):""}Y(r,e,i),i()}});O("bind-html",{priority:20,init(t,n,r){let e=P(t);function i(){let o=k(r,e);o!=null&&(t.innerHTML=ke(String(o)))}Y(r,e,i),i()}});O("bind-*",{priority:20,init(t,n,r){let e=n.replace("bind-",""),i=P(t);if(e==="value"&&(t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.tagName==="SELECT")){let s=()=>{let a=t.type==="number"?Number(t.value):t.value;nt(`${r} = ${JSON.stringify(a)}`,i)};t.addEventListener("input",s),U(()=>t.removeEventListener("input",s))}function o(){let s=k(r,i);if(["disabled","readonly","checked","selected","hidden","required"].includes(e)){s?t.setAttribute(e,""):t.removeAttribute(e),e in t&&(t[e]=!!s);return}s!=null?t.setAttribute(e,String(s)):t.removeAttribute(e)}Y(r,i,o),o()}});O("model",{priority:20,init(t,n,r){let e=P(t),i=t.tagName,o=t.type;function s(){let d=k(r,e);i==="INPUT"&&o==="checkbox"?t.checked=!!d:i==="INPUT"&&o==="radio"?t.checked=t.value===String(d):t.value=d!=null?String(d):""}let a=i==="SELECT"||o==="checkbox"||o==="radio"?"change":"input",c=()=>{let d;o==="checkbox"?d=t.checked:o==="number"||o==="range"?d=Number(t.value):d=t.value,nt(`${r} = __val`,e,{__val:d})};t.addEventListener(a,c),U(()=>t.removeEventListener(a,c)),Y(r,e,s),s()}});tt();O("if",{priority:10,init(t,n,r){let e=P(t),i=t.getAttribute("then"),o=t.getAttribute("else"),s=t.getAttribute("animate-enter")||t.getAttribute("animate"),a=t.getAttribute("animate-leave"),c=t.getAttribute("transition"),d=parseInt(t.getAttribute("animate-duration"))||0,f=[...t.childNodes].map(v=>v.cloneNode(!0)),u;function _(){let v=!!k(r,e);v!==u&&(u=v,a||c?Rt(t,a,c,()=>p(v),d):p(v))}function p(v){if(K(t),v)if(i){let E=Q(i);E&&(t.innerHTML="",t.appendChild(E))}else{t.innerHTML="";for(let E of f)t.appendChild(E.cloneNode(!0))}else if(o){let E=Q(o);E&&(t.innerHTML="",t.appendChild(E))}else t.innerHTML="";bt(t),F(t),(s||c)&&$t(t,s,c,d)}Y(r,e,_),_()}});O("else-if",{priority:10,init(t,n,r){let e=P(t),i=t.getAttribute("then"),o=[...t.childNodes].map(a=>a.cloneNode(!0));function s(){let a=t.previousElementSibling;for(;a;){let d=a.getAttribute("if")||a.getAttribute("else-if");if(d){if(k(d,e)){K(t),t.innerHTML="",t.style.display="none";return}}else break;a=a.previousElementSibling}let c=!!k(r,e);if(t.style.display="",c){if(i){let d=Q(i);d&&(K(t),t.innerHTML="",t.appendChild(d))}else{K(t),t.innerHTML="";for(let d of o)t.appendChild(d.cloneNode(!0))}bt(t),F(t)}else K(t),t.innerHTML=""}Y(r,e,s),s()}});O("else",{priority:10,init(t){if(t.hasAttribute("if"))return;let n=P(t),r=t.getAttribute("then"),e=[...t.childNodes].map(o=>o.cloneNode(!0));function i(){let o=t.previousElementSibling;for(;o;){let s=o.getAttribute("if")||o.getAttribute("else-if");if(s){if(k(s,n)){K(t),t.innerHTML="",t.style.display="none";return}}else break;o=o.previousElementSibling}if(t.style.display="",r){let s=Q(r);s&&(K(t),t.innerHTML="",t.appendChild(s))}else{K(t),t.innerHTML="";for(let s of e)t.appendChild(s.cloneNode(!0))}bt(t),F(t)}Y("",n,i),i()}});O("show",{priority:20,init(t,n,r){let e=P(t),i=t.getAttribute("animate-enter")||t.getAttribute("animate"),o=t.getAttribute("animate-leave"),s=t.getAttribute("transition"),a=parseInt(t.getAttribute("animate-duration"))||0,c;function d(){let f=!!k(r,e);f!==c&&(c=f,f?(t.style.display="",(i||s)&&$t(t,i,s,a)):o||s?Rt(t,o,s,()=>{t.style.display="none"},a):t.style.display="none")}Y(r,e,d),d()}});O("hide",{priority:20,init(t,n,r){let e=P(t),i=t.getAttribute("animate-enter")||t.getAttribute("animate"),o=t.getAttribute("animate-leave"),s=t.getAttribute("transition"),a=parseInt(t.getAttribute("animate-duration"))||0,c;function d(){let f=!k(r,e);f!==c&&(c=f,f?(t.style.display="",(i||s)&&$t(t,i,s,a)):o||s?Rt(t,o,s,()=>{t.style.display="none"},a):t.style.display="none")}Y(r,e,d),d()}});O("switch",{priority:10,init(t,n,r){let e=P(t);function i(){let o=k(r,e),s=!1;for(let a of[...t.children]){let c=a.getAttribute("case"),d=a.hasAttribute("default"),f=a.getAttribute("then");if(c){let u=c.split(",").map(_=>k(_.trim(),e));if(!s&&u.includes(o)){if(s=!0,a.style.display="",f){let _=Q(f);_&&(K(a),a.innerHTML="",a.appendChild(_)),a.__declared=!1,F(a)}}else a.style.display="none"}else if(d&&(a.style.display=s?"none":"",!s&&f)){let u=Q(f);u&&(K(a),a.innerHTML="",a.appendChild(u)),a.__declared=!1,F(a)}}}Y(r,e,i),i()}});tt();O("each",{priority:10,init(t,n,r){let e=P(t),i=r.match(/^(\w+)\s+in\s+(\S+)$/);if(!i)return;let[,o,s]=i,a=t.getAttribute("template"),c=t.getAttribute("else"),d=t.getAttribute("key"),f=t.getAttribute("animate-enter")||t.getAttribute("animate"),u=t.getAttribute("animate-leave"),_=parseInt(t.getAttribute("animate-stagger"))||0,p=parseInt(t.getAttribute("animate-duration"))||0,v=null;function E(){let T=/[\[\]()\s+\-*\/!?:&|]/.test(s)?k(s,e):lt(s,e);if(!Array.isArray(T))return;if(T===v&&T.length>0&&t.children.length>0){for(let y of t.children)y.__ctx&&y.__ctx.$notify&&y.__ctx.$notify();return}if(v=T,T.length===0&&c){let y=Q(c);y&&(K(t),t.innerHTML="",t.appendChild(y),F(t));return}let w=a?document.getElementById(a):null;if(w)if(u&&t.children.length>0){let y=[...t.children],A=y.length;y.forEach(S=>{let h=S.firstElementChild||S;h.classList.add(u);let x=()=>{h.classList.remove(u),A--,A<=0&&m(w,T)};h.addEventListener("animationend",x,{once:!0}),setTimeout(x,p||2e3)})}else m(w,T)}function m(T,w){let y=w.length;K(t),t.innerHTML="",w.forEach((A,S)=>{let h={[o]:A,$index:S,$count:y,$first:S===0,$last:S===y-1,$even:S%2===0,$odd:S%2!==0},x=q(h,e),I=T.content.cloneNode(!0),N=document.createElement("div");if(N.style.display="contents",N.__ctx=x,N.appendChild(I),t.appendChild(N),F(N),f){let l=N.firstElementChild;l&&(l.classList.add(f),l.addEventListener("animationend",()=>l.classList.remove(f),{once:!0}),_&&(l.style.animationDelay=S*_+"ms"))}})}Y(r,e,E),E()}});O("foreach",{priority:10,init(t,n,r){let e=P(t),i=t.getAttribute("from"),o=t.getAttribute("index")||"$index",s=t.getAttribute("else"),a=t.getAttribute("filter"),c=t.getAttribute("sort"),d=parseInt(t.getAttribute("limit"))||1/0,f=parseInt(t.getAttribute("offset"))||0,u=t.getAttribute("template"),_=t.getAttribute("animate-enter")||t.getAttribute("animate"),p=t.getAttribute("animate-leave"),v=parseInt(t.getAttribute("animate-stagger"))||0,E=parseInt(t.getAttribute("animate-duration"))||0;if(!i||!r)return;let m=u?null:t.cloneNode(!0);function T(){let w=lt(i,e);if(!Array.isArray(w))return;if(a&&(w=w.filter((h,x)=>{let I=q({[r]:h,[o]:x},e);return!!k(a,I)})),c){let h=c.startsWith("-"),x=h?c.slice(1):c;w=[...w].sort((I,N)=>{let l=lt(x,I)??I?.[x],g=lt(x,N)??N?.[x],b=l<g?-1:l>g?1:0;return h?-b:b})}if(w=w.slice(f,f+d),w.length===0&&s){let h=Q(s);h&&(K(t),t.innerHTML="",t.appendChild(h),F(t));return}let y=u?document.getElementById(u):null,A=w.length;function S(){K(t),t.innerHTML="",w.forEach((h,x)=>{let I={[r]:h,[o]:x,$index:x,$count:A,$first:x===0,$last:x===A-1,$even:x%2===0,$odd:x%2!==0},N=q(I,e),l;y?l=y.content.cloneNode(!0):l=m.cloneNode(!0);let g=document.createElement("div");if(g.style.display="contents",g.__ctx=N,g.appendChild(l),t.appendChild(g),F(g),_){let b=g.firstElementChild;b&&(b.classList.add(_),b.addEventListener("animationend",()=>b.classList.remove(_),{once:!0}),v&&(b.style.animationDelay=x*v+"ms"))}})}if(p&&t.children.length>0){let h=[...t.children],x=h.length;h.forEach(I=>{let N=I.firstElementChild||I;N.classList.add(p);let l=()=>{N.classList.remove(p),x--,x<=0&&S()};N.addEventListener("animationend",l,{once:!0}),setTimeout(l,E||2e3)})}else S()}Y(i,e,T),T()}});tt();ht();O("class-*",{priority:20,init(t,n,r){let e=n.replace("class-",""),i=P(t);if(e==="map"){let s=function(){let a=k(r,i);if(a&&typeof a=="object")for(let[c,d]of Object.entries(a))c.split(/\s+/).filter(Boolean).forEach(u=>t.classList.toggle(u,!!d))};Y(r,i,s),s();return}if(e==="list"){let a=function(){let c=k(r,i);if(Array.isArray(c)){s.forEach(f=>{f&&t.classList.remove(f)});let d=c.filter(Boolean);d.forEach(f=>t.classList.add(f)),s=d}},s=[];Y(r,i,a),a();return}function o(){t.classList.toggle(e,!!k(r,i))}Y(r,i,o),(r.includes("$i18n")||r.includes("NoJS.locale"))&&Pt(o),o()}});O("style-*",{priority:20,init(t,n,r){let e=n.replace("style-",""),i=P(t);if(e==="map"){let a=function(){let c=k(r,i);if(c&&typeof c=="object")for(let[d,f]of Object.entries(c))t.style[d]=f??""};Y(r,i,a),a();return}let o=e.replace(/-([a-z])/g,(a,c)=>c.toUpperCase());function s(){let a=k(r,i);t.style[o]=a!=null?String(a):""}Y(r,i,s),s()}});tt();O("on:*",{priority:20,init(t,n,r){let e=P(t),i=n.replace("on:","").split("."),o=i[0],s=new Set(i.slice(1));if(o==="mounted"){requestAnimationFrame(()=>nt(r,e,{$el:t}));return}if(o==="init"){nt(r,e,{$el:t});return}if(o==="updated"){let u=new MutationObserver(()=>{nt(r,e,{$el:t})});u.observe(t,{childList:!0,subtree:!0,characterData:!0,attributes:!0}),U(()=>u.disconnect());return}if(o==="error"){let u=_=>{(t.contains(_.target)||_.target===t)&&nt(r,e,{$el:t,$error:_.error||_.message})};window.addEventListener("error",u),U(()=>window.removeEventListener("error",u));return}if(o==="unmounted"){let u=new MutationObserver(_=>{for(let p of _)for(let v of p.removedNodes)if(v===t||v.contains?.(t)){nt(r,e,{$el:t}),u.disconnect();return}});t.parentElement&&u.observe(t.parentElement,{childList:!0,subtree:!0}),U(()=>u.disconnect());return}let a=0,c=0;for(let u of s)/^\d+$/.test(u)&&(s.has("debounce")?a=parseInt(u):s.has("throttle")&&(c=parseInt(u)));let d=u=>{if(o==="keydown"||o==="keyup"||o==="keypress"){let _=["enter","escape","tab","space","delete","backspace","up","down","left","right","ctrl","alt","shift","meta"];for(let p of s)if(_.includes(p)&&(p==="enter"&&u.key!=="Enter"||p==="escape"&&u.key!=="Escape"||p==="tab"&&u.key!=="Tab"||p==="space"&&u.key!==" "||p==="delete"&&u.key!=="Delete"&&u.key!=="Backspace"||p==="up"&&u.key!=="ArrowUp"||p==="down"&&u.key!=="ArrowDown"||p==="left"&&u.key!=="ArrowLeft"||p==="right"&&u.key!=="ArrowRight"||p==="ctrl"&&!u.ctrlKey||p==="alt"&&!u.altKey||p==="shift"&&!u.shiftKey||p==="meta"&&!u.metaKey))return}s.has("prevent")&&u.preventDefault(),s.has("stop")&&u.stopPropagation(),!(s.has("self")&&u.target!==t)&&nt(r,e,{$event:u,$el:t})};if(a>0){let u=d,_;d=p=>{clearTimeout(_),_=setTimeout(()=>u(p),a)}}if(c>0){let u=d,_=0;d=p=>{let v=Date.now();v-_>=c&&(_=v,u(p))}}let f={};s.has("once")&&(f.once=!0),t.addEventListener(o,d,f),f.once||U(()=>t.removeEventListener(o,d,f))}});O("trigger",{priority:20,init(t,n,r){let e=P(t),i=t.getAttribute("trigger-data"),o=()=>{let s=i?k(i,e):null;t.dispatchEvent(new CustomEvent(r,{detail:s,bubbles:!0}))};t.addEventListener("click",o),U(()=>t.removeEventListener("click",o))}});tt();O("ref",{priority:5,init(t,n,r){gt[r]=t,U(()=>{gt[r]===t&&delete gt[r]})}});O("use",{priority:10,init(t,n,r){let e=P(t),i=Q(r);if(!i)return;let o={};for(let f of[...t.attributes])if(f.name.startsWith("var-")){let u=f.name.replace("var-","");o[u]=k(f.value,e)}let s=q(o,e),a={};for(let f of[...t.children]){let u=f.getAttribute("slot")||"default";a[u]||(a[u]=document.createDocumentFragment()),a[u].appendChild(f.cloneNode(!0))}let c=i.querySelectorAll("slot");for(let f of c){let u=f.getAttribute("name")||"default";a[u]&&f.replaceWith(a[u])}K(t),t.innerHTML="";let d=document.createElement("div");d.style.display="contents",d.__ctx=s,d.appendChild(i),t.appendChild(d),F(d)}});O("call",{priority:20,init(t,n,r){let e=P(t),i=t.getAttribute("method")||"get",o=t.getAttribute("as")||"data",s=t.getAttribute("into"),a=t.getAttribute("success"),c=t.getAttribute("error"),d=t.getAttribute("loading"),f=t.getAttribute("then"),u=t.getAttribute("confirm"),_=t.getAttribute("body"),p=t.getAttribute("redirect"),v=t.getAttribute("headers"),E=[...t.childNodes].map(w=>w.cloneNode(!0)),m=null,T=async w=>{if(w.preventDefault(),u&&!window.confirm(u))return;m&&m.abort(),m=new AbortController;let y=wt(r,e);if(d){let A=Q(d);A&&(K(t),t.innerHTML="",t.appendChild(A),F(t),t.disabled=!0)}try{let A=null;if(_){let x=wt(_,e);try{A=JSON.parse(x)}catch{A=x}}let S=v?JSON.parse(v):{},h=await Mt(y,i,A,S,t,m.signal);if(d){K(t),t.innerHTML="";for(let x of E)t.appendChild(x.cloneNode(!0));t.disabled=!1}if(o&&e.$set(o,h),s&&(J[s]||(J[s]=q({})),J[s].$set(o,h),_t()),f&&nt(f,e,{result:h}),a){let x=Q(a);if(x){let N=document.getElementById(a.replace("#",""))?.getAttribute("var")||"result",l=q({[N]:h},e),g=t.closest("[route-view]")||t.parentElement,b=document.createElement("div");b.style.display="contents",b.__ctx=l,b.appendChild(x),g.appendChild(b),F(b)}}p&&G&&G.push(p),Et("fetch:success",{url:y,data:h}),rt("fetch:success",{method:i,url:y})}catch(A){if(A.name==="AbortError")return;if(at(`call ${i.toUpperCase()} ${y} failed:`,A.message),d){K(t),t.innerHTML="";for(let S of E)t.appendChild(S.cloneNode(!0));t.disabled=!1}if(Et("fetch:error",{url:y,error:A}),Et("error",{url:y,error:A}),rt("fetch:error",{method:i,url:y,error:A.message}),c){let S=Q(c);if(S){let x=document.getElementById(c.replace("#",""))?.getAttribute("var")||"err",I=q({[x]:{message:A.message,status:A.status,body:A.body}},e),N=t.parentElement,l=document.createElement("div");l.style.display="contents",l.__ctx=I,l.appendChild(S),N.appendChild(l),F(l)}}}};t.addEventListener("click",T),U(()=>t.removeEventListener("click",T))}});tt();var dr=[["valueMissing","required"],["typeMismatch",null],["tooShort","minlength"],["tooLong","maxlength"],["patternMismatch","pattern"],["rangeUnderflow","min"],["rangeOverflow","max"],["stepMismatch","step"]],Re=["required","email","url","number","date","time","datetime-local","month","week","tel","minlength","maxlength","pattern","min","max","step"];function fr(t){return(t.getAttribute("type")||"text").toLowerCase()}function pr(t,n){let r=[],e=new Set,i=t.getAttribute("validate");if(i){let s=i.split("|").map(a=>a.trim());for(let a of s){let[c,...d]=a.split(":"),f=mt[c];if(f){let u=f(t.value,...d,n);u!==!0&&u&&(r.push({rule:c,message:u}),e.add(c))}else{let u=t.value,_=null;switch(c){case"required":(u==null||String(u).trim()==="")&&(_="Required");break;case"email":u&&!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(u)&&(_="Invalid email");break;case"url":try{new URL(u)}catch{_="Invalid URL"}break;case"min":Number(u)<Number(d[0])&&(_=`Minimum value is ${d[0]}`);break;case"max":Number(u)>Number(d[0])&&(_=`Maximum value is ${d[0]}`);break;case"custom":if(d[0]&&mt[d[0]]){let p=mt[d[0]](u,n);p!==!0&&p&&(_=p)}break}_&&(r.push({rule:c,message:_}),e.add(c))}}}let o=t.validity;if(o&&!o.valid){for(let[s,a]of dr)if(o[s]){let c=a||fr(t);e.has(c)||(r.push({rule:c,message:t.validationMessage}),e.add(c))}}return r}function mr(t,n,r){let e=t.getAttribute(`error-${n}`);if(e)return e;let i=t.getAttribute("error");return i&&!i.startsWith("#")?i:r}function gr(t,n){if(!t.length)return null;let e=[...t].sort((i,o)=>{let s=Re.indexOf(i.rule),a=Re.indexOf(o.rule);return(s===-1?999:s)-(a===-1?999:a)})[0];return{rule:e.rule,message:mr(n,e.rule,e.message)}}function hr(t,n,r,e,i){ue(e);let o=document.querySelector(t);if(!o)return;let s=o.content.cloneNode(!0),a=document.createElement("div");a.style.display="contents",a.__errorTemplateFor=e;let c=q({$error:n,$rule:r},i);a.__ctx=c,a.appendChild(s),o.parentNode.insertBefore(a,o.nextSibling),F(a)}function ue(t){let n=document.querySelector('div[style="display: contents;"]'),r=document.querySelectorAll('div[style="display: contents;"]');for(let e of r)e.__errorTemplateFor===t&&e.remove()}function yr(t,n){let r=t.getAttribute("validate-if");if(!r)return!0;try{return!!k(r,n)}catch{return!0}}function br(t,n){let r=t.getAttribute("validate-on");if(r)return r.split(/\s+/);let e=n?n.getAttribute("validate-on"):null;return e?e.split(/\s+/):["input","focusout"]}function vr(t,n,r){let e=n.split("|").map(i=>i.trim());for(let i of e){let[o,...s]=i.split(":"),a=mt[o];if(a){let c=a(t,...s,r);if(c!==!0&&c)return c}else switch(o){case"required":if(t==null||String(t).trim()==="")return"Required";break;case"email":if(t&&!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t))return"Invalid email";break;case"url":try{new URL(t)}catch{return"Invalid URL"}break;case"min":if(Number(t)<Number(s[0]))return`Minimum value is ${s[0]}`;break;case"max":if(Number(t)>Number(s[0]))return`Maximum value is ${s[0]}`;break;case"custom":if(s[0]&&mt[s[0]]){let c=mt[s[0]](t,r);if(c!==!0&&c)return c}break}}return null}O("validate",{priority:30,init(t,n,r){let e=P(t);if(t.tagName==="FORM"){let d=function(){return t.querySelectorAll("input, textarea, select")},f=function(){let E={},m={},T={},w=!0,y=null,A=0,S=!1;for(let h of d())h.name&&(h.type==="checkbox"?m[h.name]=h.checked:h.type==="radio"?h.checked?m[h.name]=h.value:h.name in m||(m[h.name]=""):m[h.name]=h.value);for(let h of d()){if(!h.name)continue;let x=o.has(h.name),I=s.has(h.name);if(!yr(h,e)){T[h.name]={valid:!0,dirty:I,touched:x,error:null,value:m[h.name]};continue}let N=pr(h,m),l=gr(N,h),g=!l,b=x||I;g||(w=!1),!g&&b&&(E[h.name]=l.message,A++,y||(y=l.message)),T[h.name]={valid:g,dirty:I,touched:x,error:l?l.message:null,value:m[h.name]};let X=h.getAttribute("error-class")||i;if(X){let it=X.split(/\s+/);!g&&b?h.classList.add(...it):h.classList.remove(...it)}if(l&&b){let it=h.getAttribute(`error-${l.rule}`),$=h.getAttribute("error"),W=(it&&it.startsWith("#")?it:null)||($&&$.startsWith("#")?$:null);W?hr(W,l.message,l.rule,h,e):ue(h)}else ue(h);let M=h.getAttribute("as");M&&e.$set(M,T[h.name])}a.size>0&&(S=!0),c.valid=w,c.errors=E,c.values=m,c.fields=T,c.firstError=y,c.errorCount=A,c.pending=S,e.$set("$form",{...c}),u(t,w&&!S)},u=function(E,m){let T=E.querySelectorAll('button:not([type="button"]), input[type="submit"]');for(let w of T){if(w.hasAttribute("disabled")&&w.getAttribute("disabled")!==""){let y=w.getAttribute("disabled");if(y!=="disabled"&&y!=="true"&&y!=="false")continue}w.disabled=!m,w.__autoDisabled=!0}},_=function(E){if(!E.name)return;let m=br(E,t),T=()=>{s.add(E.name),c.dirty=!0,f()},w=()=>{o.add(E.name),c.touched=!0,f()};m.includes("input")?E.addEventListener("input",T):E.addEventListener("input",()=>{s.add(E.name),c.dirty=!0,f()}),m.includes("blur")||m.includes("focusout")?E.addEventListener("focusout",y=>{w(),m.includes("blur")&&T()}):E.addEventListener("focusout",w),m.includes("submit")&&E.addEventListener("focusout",w)};t.setAttribute("novalidate","");let i=t.getAttribute("error-class"),o=new Set,s=new Set,a=new Map,c={valid:!1,dirty:!1,touched:!1,submitting:!1,pending:!1,errors:{},values:{},firstError:null,errorCount:0,fields:{},reset:()=>{c.dirty=!1,c.touched=!1,c.pending=!1,o.clear(),s.clear(),t.reset(),f()}};e.$set("$form",c);let p=t.hasAttribute("validate-on"),v=[...d()].some(E=>E.hasAttribute("validate-on"));if(!p&&!v){let E=m=>{let T=m.target;T&&T.name&&s.add(T.name),c.dirty=!0,f()};t.addEventListener("input",E),t.addEventListener("change",E),t.addEventListener("focusout",m=>{m.target&&m.target.name&&o.add(m.target.name),c.touched=!0,f()})}else for(let E of d())_(E);t.addEventListener("submit",E=>{c.submitting=!0;for(let m of d())m.name&&o.add(m.name);c.touched=!0,f(),e.$set("$form",{...c}),requestAnimationFrame(()=>{c.submitting=!1,e.$set("$form",{...c})})}),requestAnimationFrame(f);return}if(r&&(t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.tagName==="SELECT")){let i=t.getAttribute("error");t.addEventListener("input",()=>{let o=vr(t.value,r,{});if(o&&i){let s=t.nextElementSibling?.__validationError?t.nextElementSibling:null;s||(s=document.createElement("div"),s.__validationError=!0,s.style.display="contents",t.parentNode.insertBefore(s,t.nextSibling));let a=Q(i);if(a){let c=q({err:{message:o}},e);s.innerHTML="",s.__ctx=c,s.appendChild(a),F(s)}}else{let s=t.nextElementSibling?.__validationError?t.nextElementSibling:null;s&&(s.innerHTML="")}})}}});O("error-boundary",{priority:1,init(t,n,r){let e=P(t);function i(s){let a=Q(r);if(a){let c=q({err:{message:s}},e);K(t),t.innerHTML="";let d=document.createElement("div");d.style.display="contents",d.__ctx=c,d.appendChild(a),t.appendChild(d),F(d)}}t.addEventListener("nojs:error",s=>{i(s.detail?.message||"An error occurred")});let o=s=>{(t.contains(s.target)||t===s.target)&&i(s.message||"An error occurred")};window.addEventListener("error",o),U(()=>window.removeEventListener("error",o))}});ht();tt();O("t",{priority:20,init(t,n,r){let e=P(t),i=t.hasAttribute("t-html");function o(){let s={};for(let c of[...t.attributes])if(c.name.startsWith("t-")&&c.name!=="t"&&c.name!=="t-html"){let d=c.name.replace("t-","");s[d]=k(c.value,e)??c.value}let a=V.t(r,s);i?t.innerHTML=a:t.textContent=a}Y(r,e,o),Pt(o),o()}});O("i18n-ns",{priority:1,init(t,n,r){if(!r)return;let e=document.createDocumentFragment();for(;t.firstChild;)e.appendChild(t.firstChild);Qt(r).then(()=>{t.appendChild(e),F(t),Dt()})}});tt();var C={dragging:null,selected:new Map,placeholder:null};function Ft(t){let n=0;for(let r of t.children){if(r.classList.contains("nojs-drop-placeholder"))continue;(r.style||{}).display==="contents"?n+=Ft(r):n++}return n}function de(){if(typeof document>"u"||document.querySelector("style[data-nojs-dnd]"))return;let t=`
|
|
25
28
|
.nojs-dragging {
|
|
26
29
|
opacity: 0.5;
|
|
27
30
|
cursor: grabbing !important;
|
|
@@ -60,5 +63,5 @@ ${f}`)(r,d,...a),typeof t=="string"&&t.includes("$store")&&_t()}catch(n){st("Exp
|
|
|
60
63
|
.nojs-drag-list-empty {
|
|
61
64
|
min-height: 3rem;
|
|
62
65
|
}
|
|
63
|
-
`.trim(),r=document.createElement("style");r.setAttribute("data-nojs-dnd",""),r.textContent=t,document.head.appendChild(r)}function Ft(t,r,e,n){let o=[...t.children].filter(s=>!s.classList.contains("nojs-drop-placeholder"));if(o.length===0)return 0;for(let s=0;s<o.length;s++){let a=(o[s].style&&o[s].style.display==="contents"&&o[s].firstElementChild||o[s]).getBoundingClientRect();if(n==="horizontal"){let c=a.left+a.width/2;if(r<c)return s}else if(n==="grid"){let c=a.left+a.width/2,l=a.top+a.height/2;if(e<l&&r<c||e<a.top+a.height&&r<c)return s}else{let c=a.top+a.height/2;if(e<c)return s}}return o.length}function He(t,r,e,n){ft();let o;if(e==="auto"){if(o=document.createElement("div"),o.className=n||"nojs-drop-placeholder",w.dragging&&w.dragging.sourceEl){let a=(w.dragging.sourceEl.firstElementChild||w.dragging.sourceEl).getBoundingClientRect();a.height>0&&(o.style.height=a.height+"px"),a.width>0&&(o.style.width=a.width+"px")}}else{let i=document.getElementById(e.startsWith("#")?e.slice(1):e);i&&i.content?(o=document.createElement("div"),o.style.display="contents",o.className=n||"nojs-drop-placeholder",o.appendChild(i.content.cloneNode(!0))):(o=document.createElement("div"),o.className=n||"nojs-drop-placeholder")}o.classList.add("nojs-drop-placeholder");let s=[...t.children].filter(i=>!i.classList.contains("nojs-drop-placeholder"));r>=s.length?t.appendChild(o):t.insertBefore(o,s[r]),w.placeholder=o}function ft(){w.placeholder&&(w.placeholder.remove(),w.placeholder=null)}function St(t,r){return!r||r==="*"?!0:r.split(",").map(n=>n.trim()).includes(t)}function ir(t,r){let e=document.createElement("div");e.style.cssText="position:fixed;top:-9999px;left:-9999px;pointer-events:none;z-index:99999;";let n=t.style&&t.style.display==="contents"&&t.firstElementChild||t,o=n.getBoundingClientRect(),s=o.width,i=o.height,a=getComputedStyle(n),c=Math.min(r,3);for(let d=c-1;d>=0;d--){let f=document.createElement("div"),y=d*4;f.style.cssText="position:absolute;top:"+y+"px;left:"+y+"px;width:"+s+"px;height:"+i+"px;border-radius:"+a.borderRadius+";box-shadow:0 1px 4px rgba(0,0,0,0.12);overflow:hidden;box-sizing:border-box;",d===0?(f.innerHTML=n.innerHTML,f.style.background=a.backgroundColor||"#fff",f.style.border=a.border,f.style.padding=a.padding,f.style.fontSize=a.fontSize,f.style.color=a.color,f.style.fontFamily=a.fontFamily):(f.style.background=a.backgroundColor||"#fff",f.style.border=a.border||"1px solid #ddd"),e.appendChild(f)}let l=document.createElement("div");return l.textContent=r,l.style.cssText="position:absolute;top:-6px;right:-6px;min-width:22px;height:22px;padding:0 5px;background:#3b82f6;color:#fff;border-radius:11px;display:flex;align-items:center;justify-content:center;font-size:11px;font-weight:700;border:2px solid #fff;box-shadow:0 1px 3px rgba(0,0,0,0.2);",e.appendChild(l),e.style.width=s+(c-1)*4+"px",e.style.height=i+(c-1)*4+"px",e}D("drag",{priority:15,init(t,r,e){se();let n=j(t),o=t.getAttribute("drag-type")||"default",s=t.getAttribute("drag-effect")||"move",i=t.getAttribute("drag-handle"),a=t.getAttribute("drag-image"),c=t.getAttribute("drag-image-offset")||"0,0",l=t.getAttribute("drag-disabled"),d=t.getAttribute("drag-class")||"nojs-dragging",f=t.getAttribute("drag-ghost-class");t.draggable=!0,t.setAttribute("aria-grabbed","false"),t.getAttribute("tabindex")||t.setAttribute("tabindex","0");let y=!0;if(i){let p=A=>{y=!!A.target.closest(i)};t.addEventListener("mousedown",p),q(()=>t.removeEventListener("mousedown",p))}let u=p=>{if(i&&!y){p.preventDefault();return}if(l&&C(l,n)){p.preventDefault();return}let A=C(e,n),E=t.getAttribute("drag-group"),g=A;if(E&&w.selected.has(E)){let x=w.selected.get(E);x.size>0&&[...x].some(m=>m.el===t)&&(g=[...x].map(m=>m.item))}if(w.dragging={item:g,type:o,effect:s,sourceEl:t,sourceCtx:n,sourceList:null,sourceIndex:null,listDirective:null},p.dataTransfer){if(p.dataTransfer.effectAllowed=s,p.dataTransfer.setData("text/plain",""),Array.isArray(g)&&g.length>1&&p.dataTransfer.setDragImage){let x=ir(t,g.length);document.body.appendChild(x);let L=t.getBoundingClientRect();p.dataTransfer.setDragImage(x,L.width/2,L.height/2),requestAnimationFrame(()=>x.remove())}else if(a&&p.dataTransfer.setDragImage)if(a==="none"){let x=document.createElement("div");x.style.cssText="width:1px;height:1px;opacity:0;position:fixed;top:-999px",document.body.appendChild(x);let[L,m]=c.split(",").map(Number);p.dataTransfer.setDragImage(x,L||0,m||0),requestAnimationFrame(()=>x.remove())}else{let x=t.querySelector(a);if(x){let[L,m]=c.split(",").map(Number);f&&x.classList.add(f),p.dataTransfer.setDragImage(x,L||0,m||0)}}}if(d.split(/\s+/).filter(Boolean).forEach(x=>t.classList.add(x)),Array.isArray(g)&&E&&w.selected.has(E))for(let x of w.selected.get(E))x.el!==t&&d.split(/\s+/).filter(Boolean).forEach(L=>x.el.classList.add(L));t.setAttribute("aria-grabbed","true"),t.dispatchEvent(new CustomEvent("drag-start",{bubbles:!0,detail:{item:g,index:w.dragging.sourceIndex,el:t}}))},h=()=>{d.split(/\s+/).filter(Boolean).forEach(A=>t.classList.remove(A));let p=t.getAttribute("drag-group");if(p&&w.selected.has(p))for(let A of w.selected.get(p))d.split(/\s+/).filter(Boolean).forEach(E=>A.el.classList.remove(E));if(t.setAttribute("aria-grabbed","false"),f&&a&&a!=="none"){let A=t.querySelector(a);A&&A.classList.remove(f)}t.dispatchEvent(new CustomEvent("drag-end",{bubbles:!0,detail:{item:w.dragging?.item,index:w.dragging?.sourceIndex,dropped:w.dragging===null}})),w.dragging=null,ft()};if(t.addEventListener("dragstart",u),t.addEventListener("dragend",h),q(()=>{t.removeEventListener("dragstart",u),t.removeEventListener("dragend",h)}),l){let p=function(){let E=!!C(l,n);t.draggable=!E,E?t.removeAttribute("aria-grabbed"):t.setAttribute("aria-grabbed","false")},A=n.$watch(p);q(A)}let b=p=>{if(w.dragging&&!w.dragging.sourceEl.isConnected&&(w.dragging=null),p.key===" "&&!w.dragging){p.preventDefault();let A=C(e,n);w.dragging={item:A,type:o,effect:s,sourceEl:t,sourceCtx:n,sourceList:null,sourceIndex:null,listDirective:null},d.split(/\s+/).filter(Boolean).forEach(E=>t.classList.add(E)),t.setAttribute("aria-grabbed","true"),t.dispatchEvent(new CustomEvent("drag-start",{bubbles:!0,detail:{item:A,index:null,el:t}}))}else p.key==="Escape"&&w.dragging&&w.dragging.sourceEl===t&&(p.preventDefault(),d.split(/\s+/).filter(Boolean).forEach(A=>t.classList.remove(A)),t.setAttribute("aria-grabbed","false"),w.dragging=null,ft())};t.addEventListener("keydown",b),q(()=>t.removeEventListener("keydown",b))}});D("drop",{priority:15,init(t,r,e){se();let n=j(t),o=t.getAttribute("drop-accept")||"default",s=t.getAttribute("drop-effect")||"move",i=t.getAttribute("drop-class")||"nojs-drag-over",a=t.getAttribute("drop-reject-class")||"nojs-drop-reject",c=t.getAttribute("drop-disabled"),l=t.getAttribute("drop-max"),d=t.getAttribute("drop-sort"),f=t.getAttribute("drop-placeholder"),y=t.getAttribute("drop-placeholder-class");t.setAttribute("aria-dropeffect",s);let u=0,h=g=>{if(!w.dragging||c&&C(c,n))return;let x=St(w.dragging.type,o),L=!0;if(l){let m=C(l,n),v=Pt(t);typeof m=="number"&&v>=m&&(L=!1)}if(!x||!L){a.split(/\s+/).filter(Boolean).forEach(m=>t.classList.add(m)),i.split(/\s+/).filter(Boolean).forEach(m=>t.classList.remove(m)),ft();return}if(a.split(/\s+/).filter(Boolean).forEach(m=>t.classList.remove(m)),g.preventDefault(),g.dataTransfer&&(g.dataTransfer.dropEffect=s),d){let m=Ft(t,g.clientX,g.clientY,d);f&&He(t,m,f,y),t.dispatchEvent(new CustomEvent("drag-over",{bubbles:!1,detail:{item:w.dragging.item,index:m}}))}},b=g=>{if(w.dragging&&!(c&&C(c,n))&&(u++,u===1)){let x=St(w.dragging.type,o),L=!0;if(l){let m=C(l,n),v=Pt(t);typeof m=="number"&&v>=m&&(L=!1)}x&&L?(i.split(/\s+/).filter(Boolean).forEach(m=>t.classList.add(m)),t.dispatchEvent(new CustomEvent("drag-enter",{bubbles:!1,detail:{item:w.dragging.item,type:w.dragging.type}}))):a.split(/\s+/).filter(Boolean).forEach(m=>t.classList.add(m))}},p=g=>{w.dragging&&(u--,u<=0&&(u=0,i.split(/\s+/).filter(Boolean).forEach(x=>t.classList.remove(x)),a.split(/\s+/).filter(Boolean).forEach(x=>t.classList.remove(x)),ft(),t.dispatchEvent(new CustomEvent("drag-leave",{bubbles:!1,detail:{item:w.dragging.item}}))))},A=g=>{if(g.preventDefault(),g.stopPropagation(),u=0,!w.dragging||c&&C(c,n)||!St(w.dragging.type,o))return;if(l){let I=C(l,n),T=Pt(t);if(typeof I=="number"&&T>=I)return}let x=w.dragging.item,L=w.dragging.type,m=w.dragging.effect,v=0;d&&(v=Ft(t,g.clientX,g.clientY,d)),i.split(/\s+/).filter(Boolean).forEach(I=>t.classList.remove(I)),a.split(/\s+/).filter(Boolean).forEach(I=>t.classList.remove(I)),ft();let S={$drag:x,$dragType:L,$dragEffect:m,$dropIndex:v,$source:{list:w.dragging.sourceList,index:w.dragging.sourceIndex,el:w.dragging.sourceEl},$target:{list:null,index:v,el:t},$el:t};et(e,n,S),w.dragging=null,t.dispatchEvent(new CustomEvent("drop",{bubbles:!1,detail:{item:x,index:v,source:S.$source,target:S.$target,effect:m}}))},E=g=>{w.dragging&&(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),A(g))};t.addEventListener("dragover",h),t.addEventListener("dragenter",b),t.addEventListener("dragleave",p),t.addEventListener("drop",A),t.addEventListener("keydown",E),q(()=>{t.removeEventListener("dragover",h),t.removeEventListener("dragenter",b),t.removeEventListener("dragleave",p),t.removeEventListener("drop",A),t.removeEventListener("keydown",E)})}});var je=new Map;D("drag-list",{priority:10,init(t,r,e){se();let n=j(t),o=t.getAttribute("template"),s=t.getAttribute("drag-list-key"),i=t.getAttribute("drag-list-item")||"item",a=t.getAttribute("drop-sort")||"vertical",c=t.getAttribute("drag-type")||"__draglist_"+e,l=t.getAttribute("drop-accept")||c,d=t.hasAttribute("drag-list-copy"),f=t.hasAttribute("drag-list-remove"),y=t.getAttribute("drag-disabled"),u=t.getAttribute("drop-disabled"),h=t.getAttribute("drop-max"),b=t.getAttribute("drop-placeholder"),p=t.getAttribute("drop-placeholder-class"),A=t.getAttribute("drag-class")||"nojs-dragging",E=t.getAttribute("drop-class")||"nojs-drag-over",g=t.getAttribute("drop-reject-class")||"nojs-drop-reject",x=t.getAttribute("drop-settle-class")||"nojs-drop-settle",L=t.getAttribute("drop-empty-class")||"nojs-drag-list-empty";t.setAttribute("role","listbox"),t.setAttribute("aria-dropeffect",d?"copy":"move");let m={listPath:e,ctx:n,el:t};je.set(t,m),q(()=>je.delete(t));let v=0,S=null;function I(){let k=ct(e,n);if(!Array.isArray(k))return;if(k===S&&k.length>0&&t.children.length>0){for(let O of t.children)O.__ctx&&O.__ctx.$notify&&O.__ctx.$notify();return}S=k;let U=o?document.getElementById(o):null;if(!U)return;z(t),t.innerHTML="";let M=k.length;k.forEach((O,at)=>{let yt={[i]:O,$index:at,$count:M,$first:at===0,$last:at===M-1,$even:at%2===0,$odd:at%2!==0},nt=F(yt,n),lt=U.content.cloneNode(!0),W=document.createElement("div");W.style.display="contents",W.__ctx=nt,W.setAttribute("role","option"),W.appendChild(lt),t.appendChild(W);let Z=W.firstElementChild||W;Z.draggable=!0,Z.setAttribute("aria-grabbed","false"),Z.getAttribute("tabindex")||Z.setAttribute("tabindex","0");let $t=ot=>{if(y&&C(y,n)){ot.preventDefault();return}w.dragging={item:O,type:c,effect:d?"copy":"move",sourceEl:W,sourceCtx:nt,sourceList:k,sourceIndex:at,listDirective:{el:t,listPath:e,ctx:n,keyProp:s,copyMode:d,removeMode:f}},ot.dataTransfer&&(ot.dataTransfer.effectAllowed=d?"copy":"move",ot.dataTransfer.setData("text/plain","")),A.split(/\s+/).filter(Boolean).forEach(dt=>Z.classList.add(dt)),Z.setAttribute("aria-grabbed","true"),t.dispatchEvent(new CustomEvent("drag-start",{bubbles:!0,detail:{item:O,index:at,el:Z}}))},Ut=()=>{A.split(/\s+/).filter(Boolean).forEach(ot=>Z.classList.remove(ot)),Z.setAttribute("aria-grabbed","false"),w.dragging&&w.dragging.sourceEl===W&&(w.dragging=null),ft()};W.addEventListener("dragstart",$t),W.addEventListener("dragend",Ut),W.addEventListener("keydown",ot=>{if(ot.key===" "&&!w.dragging)ot.preventDefault(),w.dragging={item:O,type:c,effect:d?"copy":"move",sourceEl:W,sourceCtx:nt,sourceList:k,sourceIndex:at,listDirective:{el:t,listPath:e,ctx:n,keyProp:s,copyMode:d,removeMode:f}},A.split(/\s+/).filter(Boolean).forEach(dt=>Z.classList.add(dt)),Z.setAttribute("aria-grabbed","true");else if(ot.key==="Escape"&&w.dragging&&w.dragging.sourceEl===W)ot.preventDefault(),A.split(/\s+/).filter(Boolean).forEach(dt=>Z.classList.remove(dt)),Z.setAttribute("aria-grabbed","false"),w.dragging=null,ft();else if((ot.key==="ArrowDown"||ot.key==="ArrowRight")&&w.dragging&&w.dragging.sourceEl===W){ot.preventDefault();let dt=W.nextElementSibling;dt&&(dt.firstElementChild||dt).focus()}else if((ot.key==="ArrowUp"||ot.key==="ArrowLeft")&&w.dragging&&w.dragging.sourceEl===W){ot.preventDefault();let dt=W.previousElementSibling;dt&&(dt.firstElementChild||dt).focus()}}),R(W)});let N=k.length===0;L.split(/\s+/).filter(Boolean).forEach(O=>t.classList.toggle(O,N))}let T=k=>{if(!w.dragging||u&&C(u,n))return;let U=St(w.dragging.type,l),M=!0;if(h){let O=C(h,n),at=ct(e,n);typeof O=="number"&&Array.isArray(at)&&at.length>=O&&(M=!1)}if(!U||!M){g.split(/\s+/).filter(Boolean).forEach(O=>t.classList.add(O)),E.split(/\s+/).filter(Boolean).forEach(O=>t.classList.remove(O)),ft();return}g.split(/\s+/).filter(Boolean).forEach(O=>t.classList.remove(O)),k.preventDefault(),k.dataTransfer&&(k.dataTransfer.dropEffect=d?"copy":"move");let N=Ft(t,k.clientX,k.clientY,a);b&&He(t,N,b,p)},H=k=>{if(w.dragging&&!(u&&C(u,n))&&(v++,v===1)){let U=St(w.dragging.type,l),M=!0;if(h){let N=C(h,n),O=ct(e,n);typeof N=="number"&&Array.isArray(O)&&O.length>=N&&(M=!1)}U&&M?(E.split(/\s+/).filter(Boolean).forEach(N=>t.classList.add(N)),t.dispatchEvent(new CustomEvent("drag-enter",{bubbles:!1,detail:{item:w.dragging.item,type:w.dragging.type}}))):g.split(/\s+/).filter(Boolean).forEach(N=>t.classList.add(N))}},$=()=>{w.dragging&&(v--,v<=0&&(v=0,E.split(/\s+/).filter(Boolean).forEach(k=>t.classList.remove(k)),g.split(/\s+/).filter(Boolean).forEach(k=>t.classList.remove(k)),ft(),t.dispatchEvent(new CustomEvent("drag-leave",{bubbles:!1,detail:{item:w.dragging?.item}}))))},it=k=>{if(k.preventDefault(),k.stopPropagation(),v=0,!w.dragging||u&&C(u,n)||!St(w.dragging.type,l))return;if(h){let lt=C(h,n),W=ct(e,n);if(typeof lt=="number"&&Array.isArray(W)&&W.length>=lt)return}let U=w.dragging.item,M=w.dragging.listDirective,N=w.dragging.sourceIndex,O=Ft(t,k.clientX,k.clientY,a);E.split(/\s+/).filter(Boolean).forEach(lt=>t.classList.remove(lt)),g.split(/\s+/).filter(Boolean).forEach(lt=>t.classList.remove(lt)),ft();let at=ct(e,n);if(!Array.isArray(at))return;let yt=M&&M.el===t;if(yt&&N===O){w.dragging=null;return}if(yt&&N+1===O){w.dragging=null;return}let nt=[...at];if(yt){let[lt]=nt.splice(N,1),W=N<O?O-1:O;nt.splice(W,0,lt),n.$set(e,nt),t.dispatchEvent(new CustomEvent("reorder",{bubbles:!0,detail:{list:nt,item:U,from:N,to:W}}))}else{let lt=d&&typeof U=="object"?{...U}:U;if(nt.splice(O,0,lt),n.$set(e,nt),M&&!M.copyMode&&(f||M.removeMode)){let W=ct(M.listPath,M.ctx);if(Array.isArray(W)&&N!=null){let Z=W.filter(($t,Ut)=>Ut!==N);M.ctx.$set(M.listPath,Z),M.el.dispatchEvent(new CustomEvent("remove",{bubbles:!0,detail:{list:Z,item:U,index:N}}))}}t.dispatchEvent(new CustomEvent("receive",{bubbles:!0,detail:{list:nt,item:U,from:N,fromList:M?ct(M.listPath,M.ctx):null}}))}requestAnimationFrame(()=>{let W=[...t.children][yt&&N<O?O-1:O];if(W){let Z=W.firstElementChild||W;x.split(/\s+/).filter(Boolean).forEach($t=>Z.classList.add($t)),Z.addEventListener("animationend",()=>{x.split(/\s+/).filter(Boolean).forEach($t=>Z.classList.remove($t))},{once:!0})}}),w.dragging=null},P=k=>{if(w.dragging&&St(w.dragging.type,l)&&(k.key==="Enter"||k.key===" ")){k.preventDefault();let U=t.querySelector(":focus");if(U){let N=(U.style?.display==="contents"&&U.firstElementChild||U).getBoundingClientRect(),O={preventDefault(){},stopPropagation(){},clientX:N.left+N.width/2,clientY:N.top+N.height+1,dataTransfer:null};it(O)}}};t.addEventListener("dragover",T),t.addEventListener("dragenter",H),t.addEventListener("dragleave",$),t.addEventListener("drop",it),t.addEventListener("keydown",P),q(()=>{t.removeEventListener("dragover",T),t.removeEventListener("dragenter",H),t.removeEventListener("dragleave",$),t.removeEventListener("drop",it),t.removeEventListener("keydown",P)});let rt=n.$watch(I);q(rt),I()}});D("drag-multiple",{priority:16,init(t,r){let e=j(t),n=t.getAttribute("drag-group"),o=t.getAttribute("drag-multiple-class")||"nojs-selected";if(!n){st("drag-multiple requires drag-group attribute");return}w.selected.has(n)||w.selected.set(n,new Set);let s=w.selected.get(n),i=c=>{let l=t.getAttribute("drag"),f={item:l?C(l,e):null,el:t,ctx:e};if(c.ctrlKey||c.metaKey){let y=[...s].find(u=>u.el===t);y?(s.delete(y),o.split(/\s+/).filter(Boolean).forEach(u=>t.classList.remove(u))):(s.add(f),o.split(/\s+/).filter(Boolean).forEach(u=>t.classList.add(u)))}else{for(let y of s)o.split(/\s+/).filter(Boolean).forEach(u=>y.el.classList.remove(u));s.clear(),s.add(f),o.split(/\s+/).filter(Boolean).forEach(y=>t.classList.add(y))}};t.addEventListener("click",i),q(()=>{t.removeEventListener("click",i);let c=[...s].find(l=>l.el===t);c&&s.delete(c)});let a=c=>{if(c.key==="Escape"){for(let l of s)o.split(/\s+/).filter(Boolean).forEach(d=>l.el.classList.remove(d));s.clear()}};window.addEventListener("keydown",a),q(()=>window.removeEventListener("keydown",a))}});function ar(t){let r=(_.router.base||"/").replace(/\/$/,"");if(!r)return t||"/";let e=r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return t.replace(new RegExp("^"+e),"")||"/"}function cr(){return typeof window>"u"?null:(_.router||{}).useHash?window.location.hash.slice(1)||"/":ar(window.location.pathname)}var qt={get baseApiUrl(){return _.baseApiUrl},set baseApiUrl(t){_.baseApiUrl=t},get locale(){return K.locale},set locale(t){K.locale=t},config(t={}){let r={..._.headers},e={..._.cache},n={..._.templates},o={..._.router},s={..._.i18n};if(Object.assign(_,t),t.headers&&(_.headers={...r,...t.headers}),t.csrf&&(_.csrf=t.csrf),t.cache&&(_.cache={...e,...t.cache}),t.templates&&(_.templates={...n,...t.templates}),t.router&&("mode"in t.router&&!("useHash"in t.router)&&(G('router.mode is deprecated. Use router.useHash instead: mode: "hash" \u2192 useHash: true, mode: "history" \u2192 useHash: false',"warn"),t.router.useHash=t.router.mode==="hash",delete t.router.mode),_.router={...o,...t.router}),t.i18n&&(_.i18n={...s,...t.i18n},K.locale=t.i18n.defaultLocale||K.locale),t.stores){for(let[i,a]of Object.entries(t.stores))J[i]||(J[i]=F(a||{}),tt("store:created",{name:i,keys:Object.keys(a||{})}));delete _.stores}},async init(t){if(typeof document>"u"||qt._initialized)return;if(qt._initialized=!0,t=t||document.body,G("Initializing..."),_.i18n.loadPath){let e=new Set([K.locale,_.i18n.fallbackLocale]);await Promise.all([...e].map(n=>Yt(n)))}Ot(t);let r=cr();await Ae(r),document.querySelector("[route-view]")&&ce(Ne()),R(t),X&&await X.init(),G("Initialized."),Le(),ye(qt)},directive(t,r){D(t,r)},filter(t,r){B[t]=r},validator(t,r){pt[t]=r},i18n(t){if(t.loadPath!=null&&(_.i18n.loadPath=t.loadPath),t.ns&&(_.i18n.ns=t.ns),t.cache!=null&&(_.i18n.cache=t.cache),t.persist!=null&&(_.i18n.persist=t.persist),t.locales&&(K.locales=t.locales),t.fallbackLocale&&(_.i18n.fallbackLocale=t.fallbackLocale),t.defaultLocale&&(K._locale=t.defaultLocale),_.i18n.persist&&typeof localStorage<"u")try{let r=localStorage.getItem("nojs-locale");if(r){K._locale=r;return}}catch{}if(t.detectBrowser){let r=typeof navigator<"u"?navigator.language:"en",e=r.split("-")[0];K.locales[r]?K._locale=r:K.locales[e]&&(K._locale=e)}},on(t,r){return At[t]||(At[t]=[]),At[t].push(r),()=>{At[t]=At[t].filter(e=>e!==r)}},interceptor(t,r){kt[t]&&kt[t].push(r)},get store(){return J},notify(){_t()},get router(){return X},createContext:F,evaluate:C,findContext:j,processTree:R,resolve:ct,version:"1.8.2"},lr=qt;
|
|
66
|
+
`.trim(),n=document.createElement("style");n.setAttribute("data-nojs-dnd",""),n.textContent=t,document.head.appendChild(n)}function qt(t,n,r,e){let i=[...t.children].filter(o=>!o.classList.contains("nojs-drop-placeholder"));if(i.length===0)return 0;for(let o=0;o<i.length;o++){let a=(i[o].style&&i[o].style.display==="contents"&&i[o].firstElementChild||i[o]).getBoundingClientRect();if(e==="horizontal"){let c=a.left+a.width/2;if(n<c)return o}else if(e==="grid"){let c=a.left+a.width/2,d=a.top+a.height/2;if(r<d&&n<c||r<a.top+a.height&&n<c)return o}else{let c=a.top+a.height/2;if(r<c)return o}}return i.length}function qe(t,n,r,e){pt();let i;if(r==="auto"){if(i=document.createElement("div"),i.className=e||"nojs-drop-placeholder",C.dragging&&C.dragging.sourceEl){let a=(C.dragging.sourceEl.firstElementChild||C.dragging.sourceEl).getBoundingClientRect();a.height>0&&(i.style.height=a.height+"px"),a.width>0&&(i.style.width=a.width+"px")}}else{let s=document.getElementById(r.startsWith("#")?r.slice(1):r);s&&s.content?(i=document.createElement("div"),i.style.display="contents",i.className=e||"nojs-drop-placeholder",i.appendChild(s.content.cloneNode(!0))):(i=document.createElement("div"),i.className=e||"nojs-drop-placeholder")}i.classList.add("nojs-drop-placeholder");let o=[...t.children].filter(s=>!s.classList.contains("nojs-drop-placeholder"));n>=o.length?t.appendChild(i):t.insertBefore(i,o[n]),C.placeholder=i}function pt(){C.placeholder&&(C.placeholder.remove(),C.placeholder=null)}function St(t,n){return!n||n==="*"?!0:n.split(",").map(e=>e.trim()).includes(t)}function _r(t,n){let r=document.createElement("div");r.style.cssText="position:fixed;top:-9999px;left:-9999px;pointer-events:none;z-index:99999;";let e=t.style&&t.style.display==="contents"&&t.firstElementChild||t,i=e.getBoundingClientRect(),o=i.width,s=i.height,a=getComputedStyle(e),c=Math.min(n,3);for(let f=c-1;f>=0;f--){let u=document.createElement("div"),_=f*4;u.style.cssText="position:absolute;top:"+_+"px;left:"+_+"px;width:"+o+"px;height:"+s+"px;border-radius:"+a.borderRadius+";box-shadow:0 1px 4px rgba(0,0,0,0.12);overflow:hidden;box-sizing:border-box;",f===0?(u.innerHTML=e.innerHTML,u.style.background=a.backgroundColor||"#fff",u.style.border=a.border,u.style.padding=a.padding,u.style.fontSize=a.fontSize,u.style.color=a.color,u.style.fontFamily=a.fontFamily):(u.style.background=a.backgroundColor||"#fff",u.style.border=a.border||"1px solid #ddd"),r.appendChild(u)}let d=document.createElement("div");return d.textContent=n,d.style.cssText="position:absolute;top:-6px;right:-6px;min-width:22px;height:22px;padding:0 5px;background:#3b82f6;color:#fff;border-radius:11px;display:flex;align-items:center;justify-content:center;font-size:11px;font-weight:700;border:2px solid #fff;box-shadow:0 1px 3px rgba(0,0,0,0.2);",r.appendChild(d),r.style.width=o+(c-1)*4+"px",r.style.height=s+(c-1)*4+"px",r}O("drag",{priority:15,init(t,n,r){de();let e=P(t),i=t.getAttribute("drag-type")||"default",o=t.getAttribute("drag-effect")||"move",s=t.getAttribute("drag-handle"),a=t.getAttribute("drag-image"),c=t.getAttribute("drag-image-offset")||"0,0",d=t.getAttribute("drag-disabled"),f=t.getAttribute("drag-class")||"nojs-dragging",u=t.getAttribute("drag-ghost-class");t.draggable=!0,t.setAttribute("aria-grabbed","false"),t.getAttribute("tabindex")||t.setAttribute("tabindex","0");let _=!0;if(s){let m=T=>{_=!!T.target.closest(s)};t.addEventListener("mousedown",m),U(()=>t.removeEventListener("mousedown",m))}let p=m=>{if(s&&!_){m.preventDefault();return}if(d&&k(d,e)){m.preventDefault();return}let T=k(r,e),w=t.getAttribute("drag-group"),y=T;if(w&&C.selected.has(w)){let A=C.selected.get(w);A.size>0&&[...A].some(h=>h.el===t)&&(y=[...A].map(h=>h.item))}if(C.dragging={item:y,type:i,effect:o,sourceEl:t,sourceCtx:e,sourceList:null,sourceIndex:null,listDirective:null},m.dataTransfer){if(m.dataTransfer.effectAllowed=o,m.dataTransfer.setData("text/plain",""),Array.isArray(y)&&y.length>1&&m.dataTransfer.setDragImage){let A=_r(t,y.length);document.body.appendChild(A);let S=t.getBoundingClientRect();m.dataTransfer.setDragImage(A,S.width/2,S.height/2),requestAnimationFrame(()=>A.remove())}else if(a&&m.dataTransfer.setDragImage)if(a==="none"){let A=document.createElement("div");A.style.cssText="width:1px;height:1px;opacity:0;position:fixed;top:-999px",document.body.appendChild(A);let[S,h]=c.split(",").map(Number);m.dataTransfer.setDragImage(A,S||0,h||0),requestAnimationFrame(()=>A.remove())}else{let A=t.querySelector(a);if(A){let[S,h]=c.split(",").map(Number);u&&A.classList.add(u),m.dataTransfer.setDragImage(A,S||0,h||0)}}}if(f.split(/\s+/).filter(Boolean).forEach(A=>t.classList.add(A)),Array.isArray(y)&&w&&C.selected.has(w))for(let A of C.selected.get(w))A.el!==t&&f.split(/\s+/).filter(Boolean).forEach(S=>A.el.classList.add(S));t.setAttribute("aria-grabbed","true"),t.dispatchEvent(new CustomEvent("drag-start",{bubbles:!0,detail:{item:y,index:C.dragging.sourceIndex,el:t}}))},v=()=>{f.split(/\s+/).filter(Boolean).forEach(T=>t.classList.remove(T));let m=t.getAttribute("drag-group");if(m&&C.selected.has(m))for(let T of C.selected.get(m))f.split(/\s+/).filter(Boolean).forEach(w=>T.el.classList.remove(w));if(t.setAttribute("aria-grabbed","false"),u&&a&&a!=="none"){let T=t.querySelector(a);T&&T.classList.remove(u)}t.dispatchEvent(new CustomEvent("drag-end",{bubbles:!0,detail:{item:C.dragging?.item,index:C.dragging?.sourceIndex,dropped:C.dragging===null}})),C.dragging=null,pt()};if(t.addEventListener("dragstart",p),t.addEventListener("dragend",v),U(()=>{t.removeEventListener("dragstart",p),t.removeEventListener("dragend",v)}),d){let m=function(){let w=!!k(d,e);t.draggable=!w,w?t.removeAttribute("aria-grabbed"):t.setAttribute("aria-grabbed","false")},T=e.$watch(m);U(T)}let E=m=>{if(C.dragging&&!C.dragging.sourceEl.isConnected&&(C.dragging=null),m.key===" "&&!C.dragging){m.preventDefault();let T=k(r,e);C.dragging={item:T,type:i,effect:o,sourceEl:t,sourceCtx:e,sourceList:null,sourceIndex:null,listDirective:null},f.split(/\s+/).filter(Boolean).forEach(w=>t.classList.add(w)),t.setAttribute("aria-grabbed","true"),t.dispatchEvent(new CustomEvent("drag-start",{bubbles:!0,detail:{item:T,index:null,el:t}}))}else m.key==="Escape"&&C.dragging&&C.dragging.sourceEl===t&&(m.preventDefault(),f.split(/\s+/).filter(Boolean).forEach(T=>t.classList.remove(T)),t.setAttribute("aria-grabbed","false"),C.dragging=null,pt())};t.addEventListener("keydown",E),U(()=>t.removeEventListener("keydown",E))}});O("drop",{priority:15,init(t,n,r){de();let e=P(t),i=t.getAttribute("drop-accept")||"default",o=t.getAttribute("drop-effect")||"move",s=t.getAttribute("drop-class")||"nojs-drag-over",a=t.getAttribute("drop-reject-class")||"nojs-drop-reject",c=t.getAttribute("drop-disabled"),d=t.getAttribute("drop-max"),f=t.getAttribute("drop-sort"),u=t.getAttribute("drop-placeholder"),_=t.getAttribute("drop-placeholder-class");t.setAttribute("aria-dropeffect",o);let p=0,v=y=>{if(!C.dragging||c&&k(c,e))return;let A=St(C.dragging.type,i),S=!0;if(d){let h=k(d,e),x=Ft(t);typeof h=="number"&&x>=h&&(S=!1)}if(!A||!S){a.split(/\s+/).filter(Boolean).forEach(h=>t.classList.add(h)),s.split(/\s+/).filter(Boolean).forEach(h=>t.classList.remove(h)),pt();return}if(a.split(/\s+/).filter(Boolean).forEach(h=>t.classList.remove(h)),y.preventDefault(),y.dataTransfer&&(y.dataTransfer.dropEffect=o),f){let h=qt(t,y.clientX,y.clientY,f);u&&qe(t,h,u,_),t.dispatchEvent(new CustomEvent("drag-over",{bubbles:!1,detail:{item:C.dragging.item,index:h}}))}},E=y=>{if(C.dragging&&!(c&&k(c,e))&&(p++,p===1)){let A=St(C.dragging.type,i),S=!0;if(d){let h=k(d,e),x=Ft(t);typeof h=="number"&&x>=h&&(S=!1)}A&&S?(s.split(/\s+/).filter(Boolean).forEach(h=>t.classList.add(h)),t.dispatchEvent(new CustomEvent("drag-enter",{bubbles:!1,detail:{item:C.dragging.item,type:C.dragging.type}}))):a.split(/\s+/).filter(Boolean).forEach(h=>t.classList.add(h))}},m=y=>{C.dragging&&(p--,p<=0&&(p=0,s.split(/\s+/).filter(Boolean).forEach(A=>t.classList.remove(A)),a.split(/\s+/).filter(Boolean).forEach(A=>t.classList.remove(A)),pt(),t.dispatchEvent(new CustomEvent("drag-leave",{bubbles:!1,detail:{item:C.dragging.item}}))))},T=y=>{if(y.preventDefault(),y.stopPropagation(),p=0,!C.dragging||c&&k(c,e)||!St(C.dragging.type,i))return;if(d){let N=k(d,e),l=Ft(t);if(typeof N=="number"&&l>=N)return}let A=C.dragging.item,S=C.dragging.type,h=C.dragging.effect,x=0;f&&(x=qt(t,y.clientX,y.clientY,f)),s.split(/\s+/).filter(Boolean).forEach(N=>t.classList.remove(N)),a.split(/\s+/).filter(Boolean).forEach(N=>t.classList.remove(N)),pt();let I={$drag:A,$dragType:S,$dragEffect:h,$dropIndex:x,$source:{list:C.dragging.sourceList,index:C.dragging.sourceIndex,el:C.dragging.sourceEl},$target:{list:null,index:x,el:t},$el:t};nt(r,e,I),C.dragging=null,t.dispatchEvent(new CustomEvent("drop",{bubbles:!1,detail:{item:A,index:x,source:I.$source,target:I.$target,effect:h}}))},w=y=>{C.dragging&&(y.key==="Enter"||y.key===" ")&&(y.preventDefault(),T(y))};t.addEventListener("dragover",v),t.addEventListener("dragenter",E),t.addEventListener("dragleave",m),t.addEventListener("drop",T),t.addEventListener("keydown",w),U(()=>{t.removeEventListener("dragover",v),t.removeEventListener("dragenter",E),t.removeEventListener("dragleave",m),t.removeEventListener("drop",T),t.removeEventListener("keydown",w)})}});var Fe=new Map;O("drag-list",{priority:10,init(t,n,r){de();let e=P(t),i=t.getAttribute("template"),o=t.getAttribute("drag-list-key"),s=t.getAttribute("drag-list-item")||"item",a=t.getAttribute("drop-sort")||"vertical",c=t.getAttribute("drag-type")||"__draglist_"+r,d=t.getAttribute("drop-accept")||c,f=t.hasAttribute("drag-list-copy"),u=t.hasAttribute("drag-list-remove"),_=t.getAttribute("drag-disabled"),p=t.getAttribute("drop-disabled"),v=t.getAttribute("drop-max"),E=t.getAttribute("drop-placeholder"),m=t.getAttribute("drop-placeholder-class"),T=t.getAttribute("drag-class")||"nojs-dragging",w=t.getAttribute("drop-class")||"nojs-drag-over",y=t.getAttribute("drop-reject-class")||"nojs-drop-reject",A=t.getAttribute("drop-settle-class")||"nojs-drop-settle",S=t.getAttribute("drop-empty-class")||"nojs-drag-list-empty";t.setAttribute("role","listbox"),t.setAttribute("aria-dropeffect",f?"copy":"move");let h={listPath:r,ctx:e,el:t};Fe.set(t,h),U(()=>Fe.delete(t));let x=0,I=null;function N(){let $=lt(r,e);if(!Array.isArray($))return;if($===I&&$.length>0&&t.children.length>0){for(let R of t.children)R.__ctx&&R.__ctx.$notify&&R.__ctx.$notify();return}I=$;let W=i?document.getElementById(i):null;if(!W)return;K(t),t.innerHTML="";let H=$.length;$.forEach((R,ct)=>{let vt={[s]:R,$index:ct,$count:H,$first:ct===0,$last:ct===H-1,$even:ct%2===0,$odd:ct%2!==0},ot=q(vt,e),ut=W.content.cloneNode(!0),z=document.createElement("div");z.style.display="contents",z.__ctx=ot,z.setAttribute("role","option"),z.appendChild(ut),t.appendChild(z);let et=z.firstElementChild||z;et.draggable=!0,et.setAttribute("aria-grabbed","false"),et.getAttribute("tabindex")||et.setAttribute("tabindex","0");let kt=st=>{if(_&&k(_,e)){st.preventDefault();return}C.dragging={item:R,type:c,effect:f?"copy":"move",sourceEl:z,sourceCtx:ot,sourceList:$,sourceIndex:ct,listDirective:{el:t,listPath:r,ctx:e,keyProp:o,copyMode:f,removeMode:u}},st.dataTransfer&&(st.dataTransfer.effectAllowed=f?"copy":"move",st.dataTransfer.setData("text/plain","")),T.split(/\s+/).filter(Boolean).forEach(dt=>et.classList.add(dt)),et.setAttribute("aria-grabbed","true"),t.dispatchEvent(new CustomEvent("drag-start",{bubbles:!0,detail:{item:R,index:ct,el:et}}))},Wt=()=>{T.split(/\s+/).filter(Boolean).forEach(st=>et.classList.remove(st)),et.setAttribute("aria-grabbed","false"),C.dragging&&C.dragging.sourceEl===z&&(C.dragging=null),pt()};z.addEventListener("dragstart",kt),z.addEventListener("dragend",Wt),z.addEventListener("keydown",st=>{if(st.key===" "&&!C.dragging)st.preventDefault(),C.dragging={item:R,type:c,effect:f?"copy":"move",sourceEl:z,sourceCtx:ot,sourceList:$,sourceIndex:ct,listDirective:{el:t,listPath:r,ctx:e,keyProp:o,copyMode:f,removeMode:u}},T.split(/\s+/).filter(Boolean).forEach(dt=>et.classList.add(dt)),et.setAttribute("aria-grabbed","true");else if(st.key==="Escape"&&C.dragging&&C.dragging.sourceEl===z)st.preventDefault(),T.split(/\s+/).filter(Boolean).forEach(dt=>et.classList.remove(dt)),et.setAttribute("aria-grabbed","false"),C.dragging=null,pt();else if((st.key==="ArrowDown"||st.key==="ArrowRight")&&C.dragging&&C.dragging.sourceEl===z){st.preventDefault();let dt=z.nextElementSibling;dt&&(dt.firstElementChild||dt).focus()}else if((st.key==="ArrowUp"||st.key==="ArrowLeft")&&C.dragging&&C.dragging.sourceEl===z){st.preventDefault();let dt=z.previousElementSibling;dt&&(dt.firstElementChild||dt).focus()}}),F(z)});let D=$.length===0;S.split(/\s+/).filter(Boolean).forEach(R=>t.classList.toggle(R,D))}let l=$=>{if(!C.dragging||p&&k(p,e))return;let W=St(C.dragging.type,d),H=!0;if(v){let R=k(v,e),ct=lt(r,e);typeof R=="number"&&Array.isArray(ct)&&ct.length>=R&&(H=!1)}if(!W||!H){y.split(/\s+/).filter(Boolean).forEach(R=>t.classList.add(R)),w.split(/\s+/).filter(Boolean).forEach(R=>t.classList.remove(R)),pt();return}y.split(/\s+/).filter(Boolean).forEach(R=>t.classList.remove(R)),$.preventDefault(),$.dataTransfer&&($.dataTransfer.dropEffect=f?"copy":"move");let D=qt(t,$.clientX,$.clientY,a);E&&qe(t,D,E,m)},g=$=>{if(C.dragging&&!(p&&k(p,e))&&(x++,x===1)){let W=St(C.dragging.type,d),H=!0;if(v){let D=k(v,e),R=lt(r,e);typeof D=="number"&&Array.isArray(R)&&R.length>=D&&(H=!1)}W&&H?(w.split(/\s+/).filter(Boolean).forEach(D=>t.classList.add(D)),t.dispatchEvent(new CustomEvent("drag-enter",{bubbles:!1,detail:{item:C.dragging.item,type:C.dragging.type}}))):y.split(/\s+/).filter(Boolean).forEach(D=>t.classList.add(D))}},b=()=>{C.dragging&&(x--,x<=0&&(x=0,w.split(/\s+/).filter(Boolean).forEach($=>t.classList.remove($)),y.split(/\s+/).filter(Boolean).forEach($=>t.classList.remove($)),pt(),t.dispatchEvent(new CustomEvent("drag-leave",{bubbles:!1,detail:{item:C.dragging?.item}}))))},X=$=>{if($.preventDefault(),$.stopPropagation(),x=0,!C.dragging||p&&k(p,e)||!St(C.dragging.type,d))return;if(v){let ut=k(v,e),z=lt(r,e);if(typeof ut=="number"&&Array.isArray(z)&&z.length>=ut)return}let W=C.dragging.item,H=C.dragging.listDirective,D=C.dragging.sourceIndex,R=qt(t,$.clientX,$.clientY,a);w.split(/\s+/).filter(Boolean).forEach(ut=>t.classList.remove(ut)),y.split(/\s+/).filter(Boolean).forEach(ut=>t.classList.remove(ut)),pt();let ct=lt(r,e);if(!Array.isArray(ct))return;let vt=H&&H.el===t;if(vt&&D===R){C.dragging=null;return}if(vt&&D+1===R){C.dragging=null;return}let ot=[...ct];if(vt){let[ut]=ot.splice(D,1),z=D<R?R-1:R;ot.splice(z,0,ut),e.$set(r,ot),t.dispatchEvent(new CustomEvent("reorder",{bubbles:!0,detail:{list:ot,item:W,from:D,to:z}}))}else{let ut=f&&typeof W=="object"?{...W}:W;if(ot.splice(R,0,ut),e.$set(r,ot),H&&!H.copyMode&&(u||H.removeMode)){let z=lt(H.listPath,H.ctx);if(Array.isArray(z)&&D!=null){let et=z.filter((kt,Wt)=>Wt!==D);H.ctx.$set(H.listPath,et),H.el.dispatchEvent(new CustomEvent("remove",{bubbles:!0,detail:{list:et,item:W,index:D}}))}}t.dispatchEvent(new CustomEvent("receive",{bubbles:!0,detail:{list:ot,item:W,from:D,fromList:H?lt(H.listPath,H.ctx):null}}))}requestAnimationFrame(()=>{let z=[...t.children][vt&&D<R?R-1:R];if(z){let et=z.firstElementChild||z;A.split(/\s+/).filter(Boolean).forEach(kt=>et.classList.add(kt)),et.addEventListener("animationend",()=>{A.split(/\s+/).filter(Boolean).forEach(kt=>et.classList.remove(kt))},{once:!0})}}),C.dragging=null},M=$=>{if(C.dragging&&St(C.dragging.type,d)&&($.key==="Enter"||$.key===" ")){$.preventDefault();let W=t.querySelector(":focus");if(W){let D=(W.style?.display==="contents"&&W.firstElementChild||W).getBoundingClientRect(),R={preventDefault(){},stopPropagation(){},clientX:D.left+D.width/2,clientY:D.top+D.height+1,dataTransfer:null};X(R)}}};t.addEventListener("dragover",l),t.addEventListener("dragenter",g),t.addEventListener("dragleave",b),t.addEventListener("drop",X),t.addEventListener("keydown",M),U(()=>{t.removeEventListener("dragover",l),t.removeEventListener("dragenter",g),t.removeEventListener("dragleave",b),t.removeEventListener("drop",X),t.removeEventListener("keydown",M)});let it=e.$watch(N);U(it),N()}});O("drag-multiple",{priority:16,init(t,n){let r=P(t),e=t.getAttribute("drag-group"),i=t.getAttribute("drag-multiple-class")||"nojs-selected";if(!e){at("drag-multiple requires drag-group attribute");return}C.selected.has(e)||C.selected.set(e,new Set);let o=C.selected.get(e),s=c=>{let d=t.getAttribute("drag"),u={item:d?k(d,r):null,el:t,ctx:r};if(c.ctrlKey||c.metaKey){let _=[...o].find(p=>p.el===t);_?(o.delete(_),i.split(/\s+/).filter(Boolean).forEach(p=>t.classList.remove(p))):(o.add(u),i.split(/\s+/).filter(Boolean).forEach(p=>t.classList.add(p)))}else{for(let _ of o)i.split(/\s+/).filter(Boolean).forEach(p=>_.el.classList.remove(p));o.clear(),o.add(u),i.split(/\s+/).filter(Boolean).forEach(_=>t.classList.add(_))}};t.addEventListener("click",s),U(()=>{t.removeEventListener("click",s);let c=[...o].find(d=>d.el===t);c&&o.delete(c)});let a=c=>{if(c.key==="Escape"){for(let d of o)i.split(/\s+/).filter(Boolean).forEach(f=>d.el.classList.remove(f));o.clear()}};window.addEventListener("keydown",a),U(()=>window.removeEventListener("keydown",a))}});function Er(t){let n=(L.router.base||"/").replace(/\/$/,"");if(!n)return t||"/";let r=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return t.replace(new RegExp("^"+r),"")||"/"}function wr(){return typeof window>"u"?null:(L.router||{}).useHash?window.location.hash.slice(1)||"/":Er(window.location.pathname)}var Ut={get baseApiUrl(){return L.baseApiUrl},set baseApiUrl(t){L.baseApiUrl=t},get locale(){return V.locale},set locale(t){V.locale=t},config(t={}){let n={...L.headers},r={...L.cache},e={...L.templates},i={...L.router},o={...L.i18n};if("csp"in t&&(_warn("csp config option removed \u2014 No.JS is now CSP-safe by default"),delete t.csp),Object.assign(L,t),t.headers&&(L.headers={...n,...t.headers}),t.csrf&&(L.csrf=t.csrf),t.cache&&(L.cache={...r,...t.cache}),t.templates&&(L.templates={...e,...t.templates}),t.router&&("mode"in t.router&&!("useHash"in t.router)&&(Z('router.mode is deprecated. Use router.useHash instead: mode: "hash" \u2192 useHash: true, mode: "history" \u2192 useHash: false',"warn"),t.router.useHash=t.router.mode==="hash",delete t.router.mode),L.router={...i,...t.router}),t.i18n&&(L.i18n={...o,...t.i18n},V.locale=t.i18n.defaultLocale||V.locale),t.stores){for(let[s,a]of Object.entries(t.stores))J[s]||(J[s]=q(a||{}),rt("store:created",{name:s,keys:Object.keys(a||{})}));delete L.stores}},async init(t){if(typeof document>"u"||Ut._initialized)return;if(Ut._initialized=!0,t=t||document.body,Z("Initializing..."),L.i18n.loadPath){let r=new Set([V.locale,L.i18n.fallbackLocale]);await Promise.all([...r].map(e=>Gt(e)))}Ht(t);let n=wr();await Ne(n),document.querySelector("[route-view]")&&me(He()),F(t),G&&await G.init(),Z("Initialized."),$e(),Ae(Ut)},directive(t,n){O(t,n)},filter(t,n){B[t]=n},validator(t,n){mt[t]=n},i18n(t){if(t.loadPath!=null&&(L.i18n.loadPath=t.loadPath),t.ns&&(L.i18n.ns=t.ns),t.cache!=null&&(L.i18n.cache=t.cache),t.persist!=null&&(L.i18n.persist=t.persist),t.locales&&(V.locales=t.locales),t.fallbackLocale&&(L.i18n.fallbackLocale=t.fallbackLocale),t.defaultLocale&&(V._locale=t.defaultLocale),L.i18n.persist&&typeof localStorage<"u")try{let n=localStorage.getItem("nojs-locale");if(n){V._locale=n;return}}catch{}if(t.detectBrowser){let n=typeof navigator<"u"?navigator.language:"en",r=n.split("-")[0];V.locales[n]?V._locale=n:V.locales[r]&&(V._locale=r)}},on(t,n){return At[t]||(At[t]=[]),At[t].push(n),()=>{At[t]=At[t].filter(r=>r!==n)}},interceptor(t,n){Nt[t]&&Nt[t].push(n)},get store(){return J},notify(){_t()},get router(){return G},createContext:q,evaluate:k,findContext:P,processTree:F,resolve:lt,version:"1.9.0"},xr=Ut;
|
|
64
67
|
//# sourceMappingURL=no.js.map
|