vanilla-jui 1.4.8 → 1.5.1
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 +10 -4
- package/dist/index.d.ts +402 -977
- package/dist/index.js +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +3 -3
- package/src/components/accordion.ts +467 -349
- package/src/components/flow.ts +779 -1133
- package/src/components/form.ts +666 -509
- package/src/components/menu.ts +199 -326
- package/src/components/modal.ts +510 -747
- package/src/components/offcanvas.ts +281 -361
- package/src/components/pagination.ts +207 -374
- package/src/components/swiper.ts +688 -1168
- package/src/components/tabs.ts +468 -788
- package/src/components/toc.ts +191 -244
- package/src/core/component.ts +332 -0
- package/src/core/motion.ts +298 -0
- package/src/core/presence.ts +233 -0
- package/src/core/scheduler.ts +91 -0
- package/src/core/view.ts +31 -0
- package/src/css/accordion.css +94 -3
- package/src/css/content.css +18 -24
- package/src/css/drop.css +4 -1
- package/src/css/form.css +8 -0
- package/src/css/menu.css +10 -5
- package/src/css/modal.css +2 -1
- package/src/css/offcanvas.css +5 -17
- package/src/css/swiper.css +2 -1
- package/src/css/tabs.css +8 -17
- package/src/css/themes/default/accordion.css +0 -48
- package/src/css/themes/default/swiper.css +1 -1
- package/src/css/themes/default/tabs.css +4 -6
- package/src/css/toast.css +1 -17
- package/src/css/tooltip.css +2 -1
- package/src/index.ts +8 -3
- package/src/locales/index.ts +3 -0
- package/src/primitives/drop.ts +253 -262
- package/src/primitives/loading.ts +22 -4
- package/src/primitives/parabola.ts +123 -164
- package/src/primitives/sticky.ts +297 -0
- package/src/primitives/theme.ts +164 -222
- package/src/primitives/toast.ts +309 -284
- package/src/primitives/tooltip.ts +65 -66
- package/src/utilities/browser.ts +38 -0
- package/src/utilities/dom.ts +0 -54
- package/src/utilities/refs.ts +61 -0
- package/src/utilities/state.ts +73 -0
- package/src/utilities/timer.ts +11 -31
- package/src/validation/validator.ts +289 -389
- package/src/components/sticky.ts +0 -297
- package/src/core/Component.ts +0 -377
- package/src/utilities/scheduler.ts +0 -156
package/dist/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("vanilla-signal"),require("vanilla-signal-i18n"),require("vanilla-create-storage")):typeof define==`function`&&define.amd?define([`exports`,`vanilla-signal`,`vanilla-signal-i18n`,`vanilla-create-storage`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.jui={},e.vanillaSignal,e.vanillaSignalI18n,e.vanillaStorage))})(this,function(e,t,n,r){Object.defineProperty(e,f.toStringTag,{value:`Module`});function i(){if(typeof navigator>`u`)return!1;if(typeof navigator.userAgentData?.mobile==`boolean`)return navigator.userAgentData.mobile;let e=navigator.userAgent||``;return/\b(BlackBerry|webOS|iPhone|IEMobile|Android|Windows Phone|iPad|iPod)\b/i.test(e)?!0:typeof window>`u`||typeof window.matchMedia!=`function`?!1:window.matchMedia(`(pointer: coarse)`).matches&&window.matchMedia(`(max-width: 820px)`).matches}async function a(e){if(typeof window>`u`||typeof document>`u`)return Promise.resolve(!1);let t=String(e);if(navigator.clipboard&&typeof navigator.clipboard.writeText==`function`)try{return await navigator.clipboard.writeText(t),!0}catch{return o(t)}return o(t)}function o(e){let t=null;try{return t=document.createElement(`textarea`),t.value=e,t.setAttribute(`readonly`,``),t.style.position=`absolute`,t.style.left=`-9999px`,t.style.opacity=`0`,document.body.appendChild(t),t.select(),t.setSelectionRange(0,e.length),document.execCommand(`copy`)}catch{return!1}finally{t&&t.parentNode&&t.parentNode.removeChild(t)}}function s(){if(typeof crypto.randomUUID==`function`)return crypto.randomUUID();let e=new Uint8Array(16);if(typeof crypto.getRandomValues!=`function`)throw Error(`Your browser is too old to support secure login.`);crypto.getRandomValues(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t=Array.from(e).map(e=>e.toString(16).padStart(2,`0`)).join(``);return[t.slice(0,8),t.slice(8,12),t.slice(12,16),t.slice(16,20),t.slice(20,32)].join(`-`)}function c(e=8){if(!Number.isInteger(e)||e<1||e>87381)throw Error(`Length must be an integer between 1 and 87381`);let t=Math.ceil(e*3/4),n=new Uint8Array(t);crypto.getRandomValues(n);let r=``;for(let e of n)r+=String.fromCharCode(e);return btoa(r).substring(0,e).replace(/\+/g,`-`).replace(/\//g,`_`)}var l=typeof global==`object`&&global&&global.Object===Object&&global,u=typeof self==`object`&&self&&self.Object===Object&&self,d=l||u||Function(`return this`)(),f=d.Symbol,p=Object.prototype,ee=p.hasOwnProperty,te=p.toString,m=f?f.toStringTag:void 0;function h(e){var t=ee.call(e,m),n=e[m];try{e[m]=void 0;var r=!0}catch{}var i=te.call(e);return r&&(t?e[m]=n:delete e[m]),i}var ne=Object.prototype.toString;function re(e){return ne.call(e)}var ie=`[object Null]`,g=`[object Undefined]`,ae=f?f.toStringTag:void 0;function oe(e){return e==null?e===void 0?g:ie:ae&&ae in Object(e)?h(e):re(e)}function se(e,t){return function(n){return e(t(n))}}var ce=se(Object.getPrototypeOf,Object);function le(e){return typeof e==`object`&&!!e}var ue=`[object Object]`,de=Function.prototype,fe=Object.prototype,pe=de.toString,me=fe.hasOwnProperty,he=pe.call(Object);function ge(e){if(!le(e)||oe(e)!=ue)return!1;var t=ce(e);if(t===null)return!0;var n=me.call(t,`constructor`)&&t.constructor;return typeof n==`function`&&n instanceof n&&pe.call(n)==he}function _(e){return ge(e)}function v(e){return e==null}function y(e){return typeof Node<`u`&&e instanceof Node}function _e(e){return typeof Element<`u`&&e instanceof Element}function ve(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function ye(e){return typeof e==`string`||typeof e==`number`||typeof e==`boolean`}function be(e){return v(e)||ye(e)||typeof e==`function`||Array.isArray(e)||y(e)}let xe=e=>e===null?`null`:Array.isArray(e)?`array`:ve(e)?`HTMLElement`:y(e)?`Node`:typeof e;function Se(e){return Array.isArray(e)?e.slice():_(e)?{...e}:e}function Ce(e={}){return typeof e==`string`||Array.isArray(e)?{type:e}:!e||typeof e!=`object`?{}:e}function b(e,t){throw Error(`Validator: ${e} ${t}`)}function we(e){return typeof e==`string`?e:String(e)}function Te(e){return typeof e==`string`?`string`:`array`}function Ee(e,t,n){if(v(t)||typeof t!=`string`&&!Array.isArray(t))return;let r=Te(t);n.nonEmpty&&t.length===0&&b(e,`expects a non-empty ${r}.`),typeof n.minLength==`number`&&t.length<n.minLength&&b(e,`expects ${r} length to be at least ${n.minLength}.`),typeof n.maxLength==`number`&&t.length>n.maxLength&&b(e,`expects ${r} length to be at most ${n.maxLength}.`)}function De(e,t,n){v(t)||typeof t!=`number`||(n.finite&&!Number.isFinite(t)&&b(e,`expects a finite number.`),n.integer&&!Number.isInteger(t)&&b(e,`expects an integer.`),typeof n.min==`number`&&t<n.min&&b(e,`expects a number greater than or equal to ${n.min}.`),typeof n.max==`number`&&t>n.max&&b(e,`expects a number less than or equal to ${n.max}.`),typeof n.greaterThan==`number`&&t<=n.greaterThan&&b(e,`expects a number greater than ${n.greaterThan}.`),typeof n.lessThan==`number`&&t>=n.lessThan&&b(e,`expects a number less than ${n.lessThan}.`))}function Oe(e,t,n){!n.plain||v(t)||_(t)||b(e,`expects an object.`)}function ke(e,t,n){!n.items||v(t)||(Array.isArray(t)||b(e,`expects array.`),t.forEach((t,r)=>{x(String(r),t,n.items,e)}))}function Ae(e,t,n){if(!n.shape||v(t))return;(!t||typeof t!=`object`||Array.isArray(t))&&b(e,`expects object.`);let r=t;for(let[t,i]of Object.entries(n.shape))x(t,r[t],i,e)}function je(e,t){return t===`renderable`?be(e):t===`Node`?y(e):t===`Element`?_e(e):t===`HTMLElement`?ve(e):t===`plainObject`?_(e):xe(e)===t}function Me(e){return _(e)?`object`:xe(e)}function Ne(e,t,n=[]){let r=Array.isArray(n)?n:n?[n]:[];for(let n of r){let r,i;if(typeof n==`function`)r=n,i=`does not satisfy the required condition.`;else if(n&&typeof n.test==`function`)r=n.test,i=n.message||`condition failed.`;else throw Error(`Validator: Condition must be a function or { test, message }.`);r(t)||b(e,i)}}function Pe(e,t){return e?`${e}.${t}`:t}function x(e,t,n={},r=``){let i=Ce(n),a=Pe(r,e),o=Object.hasOwn(i,`types`)?i.types:i.type;if(i.required&&v(t)&&b(a,`is required.`),o!==void 0){let e=Array.isArray(o)?o:[o],n=Me(t);e.some(e=>je(t,e))||b(a,`expects ${e.join(`, `)}, but got ${n}.`)}return Array.isArray(i.enum)&&!i.enum.includes(t)&&b(a,`expects one of ${i.enum.map(we).join(`, `)}.`),Ee(a,t,i),De(a,t,i),Oe(a,t,i),ke(a,t,i),Ae(a,t,i),Ne(a,t,i.conditions),typeof i.validate==`function`&&(i.validate(t)||b(a,i.message||`does not satisfy the required condition.`)),t}function S(e={},t={},n=`Options`){let r=e??{};if(typeof r!=`object`||Array.isArray(r))throw Error(`${n} expects object.`);let i=r,a={...i},o=Object.entries(t||{});for(let[e,t]of o){let n=Ce(t);a[e]=Object.hasOwn(i,e)?i[e]:Fe(n)}for(let[e,n]of o){let r=Ce(n);typeof r.normalize==`function`&&(a[e]=r.normalize(a[e],{key:e,input:i,options:a,schema:t}))}for(let[e,t]of o)x(e,a[e],t,n);return a}function Fe(e){if(!Object.hasOwn(e,`default`))return;let t=e.default;return Se(e.factory&&typeof t==`function`?t():t)}let Ie=[`node`,`element`,`array`];function Le(e){return Ie.includes(e)}function C(e){return y(e)}function w(e){return _e(e)}function Re(e){return typeof e==`string`||w(e)||C(e)||Array.isArray(e)}function ze(e){return e.find(w)||null}function Be(e,t=[]){for(let n of e){if(Array.isArray(n)){if(!Be(n,t))return null;continue}if(C(n)){t.push(n);continue}return null}return t}function T(e,t){if(typeof e==`function`)return T(e(t),t);let n=e;if(n==null||n===!1||n===!0)return[];if(Array.isArray(n))return n.flatMap(e=>T(e,t));if(C(n))return[n];if(typeof n==`string`){let e=document.createElement(`template`);return e.innerHTML=n,Array.from(e.content.childNodes)}return[document.createTextNode(String(n))]}function Ve(e){if(e===!1||e==null)return null;if(typeof e==`string`){let t=k(e);return t.length>0?t:null}if(Array.isArray(e)){let t=Be(e,[]);return t&&t.length>0?t:null}return C(e)?[e]:null}function He(e){return w(e)||C(e)?e:typeof e==`string`?document.querySelector(e):Array.isArray(e)&&(Ve(e)||[])[0]||null}function E(e){if(!Re(e))return null;if(typeof e==`string`){let t=document.querySelector(e);return w(t)?t:null}if(Array.isArray(e)){let t=Ve(e);return Array.isArray(t)?ze(t):null}return w(e)?e:null}function Ue(e,t=`Component`,n=`element`){if(!Le(n))throw Error(`${t}: expect must be one of 'node', 'element', 'array'.`);return Re(e)?n===`array`?Ve(e):n===`node`?He(e):E(e):null}function D(e,t=`Component`,n=`element`){let r=Ue(e,t,n);if(r==null)throw Error(`${t}: container not found.`);return r}function We(e){return be(e)}function Ge(e,t){return We(e)?T(e,t):null}function O(e,t=document){return t.querySelector(e)}function k(e,t=document){return Array.from(t.querySelectorAll(e))}function Ke(e,t,n={}){if(typeof t!=`function`)throw TypeError(`lazyRender: renderCallback expects function.`);let{threshold:r=.1,rootMargin:i=`0px`,root:a=null,waitForDOM:o=!0}=n,s={threshold:r,rootMargin:i,root:a};if(!Je(e))return console.warn(`lazyRender: target 必须是 CSS 选择器字符串或 DOM 元素`),qe;let c=qe,l=Ye(e);if(l&&document.body.contains(l))return c=Xe(l,t,s),c;if(!o||typeof MutationObserver>`u`)return t(),c;let u=new MutationObserver(()=>{let n=Ye(e);!n||!document.body.contains(n)||(l=n,u.disconnect(),c=Xe(l,t,s))});return u.observe(document.documentElement,{childList:!0,subtree:!0}),()=>{u.disconnect(),c()}}function qe(){}function Je(e){return typeof e==`string`||w(e)}function Ye(e){return typeof e==`string`?O(e):e}function Xe(e,t,n){if(typeof window>`u`||window.IntersectionObserver===void 0)return t(),qe;let r=new window.IntersectionObserver(n=>{for(let i of n)if(i.isIntersecting){r.unobserve(e),r.disconnect(),t();break}},n);return r.observe(e),()=>{r.unobserve(e),r.disconnect()}}function Ze(e,t,n,r){let i=!0;return e.addEventListener(t,n,r),()=>{i&&(i=!1,e.removeEventListener(t,n,r))}}function A(){let e=new Map,t=t=>{let n=e.get(t);return n?(n(),e.delete(t),!0):!1};return{on(n,r,i,a,o){if(typeof n!=`string`||n.trim()===``)throw TypeError(`EventManager.on: key expects a non-empty string.`);if(t(n),r==null)return()=>{};let s=Ze(r,i,a,o);return e.set(n,s),s},off:t,clear(){for(let t of e.values())t();e.clear()},size(){return e.size}}}let Qe=typeof window<`u`?`${window.location.origin}/wp-json`:``;async function $e(e,t,n={}){let r=new Headers(n.headers);return r.has(`Content-Type`)||r.set(`Content-Type`,`application/json`),(await fetch(e,{...n,method:`POST`,headers:r,body:JSON.stringify(t)})).json()}let j={timers:{},start(e,t,n){this.timers[e]&&clearTimeout(this.timers[e]),this.timers[e]=setTimeout(()=>{n(),delete this.timers[e]},t)},cancel(e){this.timers[e]&&(clearTimeout(this.timers[e]),delete this.timers[e])}};function M(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}var et=function(){return d.Date.now()},tt=/\s/;function nt(e){for(var t=e.length;t--&&tt.test(e.charAt(t)););return t}var rt=/^\s+/;function it(e){return e&&e.slice(0,nt(e)+1).replace(rt,``)}var at=`[object Symbol]`;function ot(e){return typeof e==`symbol`||le(e)&&oe(e)==at}var st=NaN,ct=/^[-+]0x[0-9a-f]+$/i,lt=/^0b[01]+$/i,ut=/^0o[0-7]+$/i,dt=parseInt;function ft(e){if(typeof e==`number`)return e;if(ot(e))return st;if(M(e)){var t=typeof e.valueOf==`function`?e.valueOf():e;e=M(t)?t+``:t}if(typeof e!=`string`)return e===0?e:+e;e=it(e);var n=lt.test(e);return n||ut.test(e)?dt(e.slice(2),n?2:8):ct.test(e)?st:+e}var pt=`Expected a function`,mt=Math.max,ht=Math.min;function gt(e,t,n){var r,i,a,o,s,c,l=0,u=!1,d=!1,f=!0;if(typeof e!=`function`)throw TypeError(pt);t=ft(t)||0,M(n)&&(u=!!n.leading,d=`maxWait`in n,a=d?mt(ft(n.maxWait)||0,t):a,f=`trailing`in n?!!n.trailing:f);function p(t){var n=r,a=i;return r=i=void 0,l=t,o=e.apply(a,n),o}function ee(e){return l=e,s=setTimeout(h,t),u?p(e):o}function te(e){var n=e-c,r=e-l,i=t-n;return d?ht(i,a-r):i}function m(e){var n=e-c,r=e-l;return c===void 0||n>=t||n<0||d&&r>=a}function h(){var e=et();if(m(e))return ne(e);s=setTimeout(h,te(e))}function ne(e){return s=void 0,f&&r?p(e):(r=i=void 0,o)}function re(){s!==void 0&&clearTimeout(s),l=0,r=c=i=s=void 0}function ie(){return s===void 0?o:ne(et())}function g(){var e=et(),n=m(e);if(r=arguments,i=this,c=e,n){if(s===void 0)return ee(c);if(d)return clearTimeout(s),s=setTimeout(h,t),p(c)}return s===void 0&&(s=setTimeout(h,t)),o}return g.cancel=re,g.flush=ie,g}var _t=`Expected a function`;function vt(e,t,n){var r=!0,i=!0;if(typeof e!=`function`)throw TypeError(_t);return M(n)&&(r=`leading`in n?!!n.leading:r,i=`trailing`in n?!!n.trailing:i),gt(e,t,{leading:r,maxWait:t,trailing:i})}let yt=null,N=null,bt=!1;function xt(e){if(typeof queueMicrotask==`function`){queueMicrotask(e);return}Promise.resolve().then(e)}function St(){bt||(bt=!0,xt(wt))}function Ct(e){N?N.next=e:yt=e,N=e,St()}function wt(){bt=!1;let e=yt;yt=null,N=null;let t=e;for(;t;){let e=t.next;t.next=null,!t.disposed&&t.queued&&(t.queued=!1,t.run()),t=e}}function Tt(e){let t={queued:!1,disposed:!1,next:null,run:e};return{schedule(){t.disposed||t.queued||(t.queued=!0,Ct(t))},flush(){t.disposed||(t.queued=!1,t.run())},cancel(){t.queued=!1},dispose(){t.disposed=!0,t.queued=!1,t.next=null}}}function P(e){if(e&&typeof e==`object`){let t=e.__version__;return typeof t==`number`?t:0}return 0}function F(e){return P(e),e}function I(e){return(0,t.unwrap)(e)}function L(e,n,{deferInitial:r=!0,flushInitial:i=!1,flush:a=`microtask`}={}){let o=!1,s=!1,c,l=Tt(()=>{s&&(s=!1,(0,t.untrack)(()=>n(c)))}),u=(0,t.createWatch)(e,e=>{let t=!o;if(o=!0,c=e,s=!0,t&&i||a===`sync`){l.flush();return}l.schedule()},{defer:r});return()=>{l.dispose(),u.dispose()}}var Et={info:`<path d="M12 22C6.47715 22 2 17.5228 2 12 2 6.47715 6.47715 2 12 2 17.5228 2 22 6.47715 22 12 22 17.5228 17.5228 22 12 22ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM13 10.5V15H14V17H10V15H11V12.5H10V10.5H13ZM13.5 8C13.5 8.82843 12.8284 9.5 12 9.5 11.1716 9.5 10.5 8.82843 10.5 8 10.5 7.17157 11.1716 6.5 12 6.5 12.8284 6.5 13.5 7.17157 13.5 8Z"></path>`,success:`<path d="M4 12C4 7.58172 7.58172 4 12 4C16.4183 4 20 7.58172 20 12C20 16.4183 16.4183 20 12 20C7.58172 20 4 16.4183 4 12ZM12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2ZM17.4571 9.45711L16.0429 8.04289L11 13.0858L8.20711 10.2929L6.79289 11.7071L11 15.9142L17.4571 9.45711Z"></path>`,warning:`<path d="M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM11 15H13V17H11V15ZM11 7H13V13H11V7Z"></path>`,error:`<path d="M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM12 10.5858L14.8284 7.75736L16.2426 9.17157L13.4142 12L16.2426 14.8284L14.8284 16.2426L12 13.4142L9.17157 16.2426L7.75736 14.8284L10.5858 12L7.75736 9.17157L9.17157 7.75736L12 10.5858Z"></path>`,"arrow-left":`<path d="M10.8284 12.0007L15.7782 16.9504L14.364 18.3646L8 12.0007L14.364 5.63672L15.7782 7.05093L10.8284 12.0007Z"></path>`,"arrow-right":`<path d="M13.1717 12.0007L8.22192 7.05093L9.63614 5.63672L16.0001 12.0007L9.63614 18.3646L8.22192 16.9504L13.1717 12.0007Z"></path>`,"arrow-up":`<path d="M11.9999 10.8284L7.0502 15.7782L5.63599 14.364L11.9999 8L18.3639 14.364L16.9497 15.7782L11.9999 10.8284Z"></path>`,"arrow-down":`<path d="M11.9999 13.1714L16.9497 8.22168L18.3639 9.63589L11.9999 15.9999L5.63599 9.63589L7.0502 8.22168L11.9999 13.1714Z"></path>`,more:`<path d="M5 10C3.9 10 3 10.9 3 12C3 13.1 3.9 14 5 14C6.1 14 7 13.1 7 12C7 10.9 6.1 10 5 10ZM19 10C17.9 10 17 10.9 17 12C17 13.1 17.9 14 19 14C20.1 14 21 13.1 21 12C21 10.9 20.1 10 19 10ZM12 10C10.9 10 10 10.9 10 12C10 13.1 10.9 14 12 14C13.1 14 14 13.1 14 12C14 10.9 13.1 10 12 10Z"></path>`,close:`<path d="M11.9997 10.5865L16.9495 5.63672L18.3637 7.05093L13.4139 12.0007L18.3637 16.9504L16.9495 18.3646L11.9997 13.4149L7.04996 18.3646L5.63574 16.9504L10.5855 12.0007L5.63574 7.05093L7.04996 5.63672L11.9997 10.5865Z"></path>`,loader:`<path d="M12 3C16.9706 3 21 7.02944 21 12H19C19 8.13401 15.866 5 12 5V3Z"></path>`,menu:`<path d="M3 4H21V6H3V4ZM3 11H21V13H3V11ZM3 18H21V20H3V18Z"></path>`,palette:`<path fill="none" d="M0 0h24v24H0z"></path><path d="M12 2C17.5222 2 22 5.97778 22 10.8889C22 13.9556 19.5111 16.4444 16.4444 16.4444H14.4778C13.5556 16.4444 12.8111 17.1889 12.8111 18.1111C12.8111 18.5333 12.9778 18.9222 13.2333 19.2111C13.5 19.5111 13.6667 19.9 13.6667 20.3333C13.6667 21.2556 12.9 22 12 22C6.47778 22 2 17.5222 2 12C2 6.47778 6.47778 2 12 2ZM10.8111 18.1111C10.8111 16.0843 12.451 14.4444 14.4778 14.4444H16.4444C18.4065 14.4444 20 12.851 20 10.8889C20 7.1392 16.4677 4 12 4C7.58235 4 4 7.58235 4 12C4 16.19 7.2226 19.6285 11.324 19.9718C10.9948 19.4168 10.8111 18.7761 10.8111 18.1111ZM7.5 12C6.67157 12 6 11.3284 6 10.5C6 9.67157 6.67157 9 7.5 9C8.32843 9 9 9.67157 9 10.5C9 11.3284 8.32843 12 7.5 12ZM16.5 12C15.6716 12 15 11.3284 15 10.5C15 9.67157 15.6716 9 16.5 9C17.3284 9 18 9.67157 18 10.5C18 11.3284 17.3284 12 16.5 12ZM12 9C11.1716 9 10.5 8.32843 10.5 7.5C10.5 6.67157 11.1716 6 12 6C12.8284 6 13.5 6.67157 13.5 7.5C13.5 8.32843 12.8284 9 12 9Z"></path>`,message:`<path d="M2 8.99374C2 5.68349 4.67654 3 8.00066 3H15.9993C19.3134 3 22 5.69478 22 8.99374V21H8.00066C4.68659 21 2 18.3052 2 15.0063V8.99374ZM20 19V8.99374C20 6.79539 18.2049 5 15.9993 5H8.00066C5.78458 5 4 6.78458 4 8.99374V15.0063C4 17.2046 5.79512 19 8.00066 19H20ZM14 11H16V13H14V11ZM8 11H10V13H8V11Z"></path>`,chat:`<path d="M10 3H14C18.4183 3 22 6.58172 22 11C22 15.4183 18.4183 19 14 19V22.5C9 20.5 2 17.5 2 11C2 6.58172 5.58172 3 10 3ZM12 17H14C17.3137 17 20 14.3137 20 11C20 7.68629 17.3137 5 14 5H10C6.68629 5 4 7.68629 4 11C4 14.61 6.46208 16.9656 12 19.4798V17Z"></path>`,discuss:`<path d="M14 22.5L11.2 19H6C5.44772 19 5 18.5523 5 18V7.10256C5 6.55028 5.44772 6.10256 6 6.10256H22C22.5523 6.10256 23 6.55028 23 7.10256V18C23 18.5523 22.5523 19 22 19H16.8L14 22.5ZM15.8387 17H21V8.10256H7V17H11.2H12.1613L14 19.2984L15.8387 17ZM2 2H19V4H3V15H1V3C1 2.44772 1.44772 2 2 2Z"></path>`};let Dt=`http://www.w3.org/2000/svg`,R=Et;function Ot(e){if(!(e in R))throw Error(`Icon "${e}" not found.`)}function kt(e){return Ot(e),`<svg xmlns="${Dt}" viewBox="0 0 24 24" fill="currentColor">${R[e]}</svg>`}function At(e){return e!==null&&e.namespaceURI===Dt}function z(e,t={}){let n=document.createElement(`template`);n.innerHTML=kt(e);let r=n.content.firstElementChild;if(!At(r))throw Error(`Icon "${e}" cannot be rendered.`);for(let[e,n]of Object.entries(t||{})){if(n==null||n===!1)continue;let t=e===`className`?`class`:e;r.setAttribute(t,n===!0?``:String(n))}return r}function jt(e){return kt(e)}let Mt=jt;function Nt(){return{...R}}function Pt(e){if(typeof e!=`object`||!e)throw Error(`Icons must be a valid object.`);for(let[t,n]of Object.entries(e)){if(typeof n!=`string`||!n.trim().startsWith(`<`))throw Error(`Invalid SVG path for icon "${t}".`);R[t]=n}}function B(){return(0,t.jsx)(`div`,{"aria-live":`polite`,style:{display:`flex`,justifyContent:`center`,alignItems:`center`,position:`absolute`,width:`100%`,height:`100%`,backdropFilter:`blur(4px)`},children:z(`loader`,{width:24,className:`animate-spin`})})}let Ft={className:{default:`j-popup-layout`,type:`string`},position:{default:`center`,type:`string`},component:{default:``,type:`string`},labelledby:{default:``,type:`string`},content:{default:``,type:`renderable`}};function It(e){let t=S(e,Ft,`Popup`);return{className:t.className,position:t.position,component:t.component,labelledby:t.labelledby,content:t.content}}function Lt(e={}){let{className:n,position:r,component:i,labelledby:a,content:o}=It(e),s={className:`${n} is-${r}`,role:`dialog`,children:o};return i&&(s[`data-${i}`]=`root`,s[`aria-${i}`]=`true`),a&&(s[`aria-labelledby`]=a),(0,t.jsx)(`div`,s)}let Rt={root:`j-drop`,container:`drop-container`},zt={name:{default:null,types:[`string`,`null`]},mode:{default:`click`,type:`string`,enum:[`hover`,`click`]},position:{default:`auto`,type:`string`,enum:[`auto`,`top-left`,`top-center`,`top-right`,`bottom-left`,`bottom-center`,`bottom-right`,`left`,`right`]},offset:{default:10,type:`number`,min:0},content:{default:``,type:`renderable`},className:{default:Rt,type:`object`,normalize:e=>({...Rt,...e&&typeof e==`object`?e:{}})},id:{default:null,types:[`string`,`null`],normalize:e=>typeof e==`string`?e.trim()||c():e??c()},delay:{default:0,types:[`number`,`object`]},hoverIntent:{default:!0,type:`boolean`},onShown:{default:null,types:[`function`,`null`]},onHidden:{default:null,types:[`function`,`null`]}};function Bt(e){let t=S(e,zt,`Drop`);return{name:t.name,mode:t.mode,position:t.position,offset:t.offset,content:t.content,className:t.className,id:t.id,delay:t.delay,hoverIntent:t.hoverIntent,onShown:t.onShown,onHidden:t.onHidden}}function Vt(e){return typeof e==`number`&&e>=0?{show:e,hide:e}:typeof e==`object`&&e?{show:Number(e.show)||0,hide:Number(e.hide)||0}:{show:0,hide:0}}var Ht=class{target;props;dom;isVisible;cleanup;delayShow;delayHide;timer;hoverIntentData;lastX;lastY;constructor(e,t={}){this.target=E(e),this.props=Bt(t),this.dom={root:null},this.isVisible=!1,this.cleanup=null,this.delayShow=0,this.delayHide=0,this.timer={show:null,hide:null},this.hoverIntentData={x:0,y:0,lastMoveTime:0},this.lastX=0,this.lastY=0,this.init(this.props)}init(e){this.cleanup={events:A()};let t=Vt(e.delay);this.delayShow=t.show,this.delayHide=t.hide,this.buildDrop(e),this.bindEvents(e)}buildDrop(e){let{className:n,content:r,id:i,name:a}=e,o=C(r)&&r.nodeType===Node.ELEMENT_NODE?r:(0,t.jsx)(`div`,{className:n.container,"data-drop-container":a||i,children:T(r,this)});this.dom.root=(0,t.jsx)(`div`,{className:n.root,id:i,"data-drop":a||c(),children:o})}bindEvents(e){let{mode:t,hoverIntent:n}=e;this.unbindEvents(),!(!this.target||!this.cleanup)&&(t===`hover`?n?(this.cleanup.events.on(`target:enter`,this.target,`mouseenter`,()=>this.startHoverIntent()),this.cleanup.events.on(`target:leave`,this.target,`mouseleave`,()=>this.cancelHoverIntent())):(this.cleanup.events.on(`target:enter`,this.target,`mouseenter`,()=>this.show()),this.cleanup.events.on(`target:leave`,this.target,`mouseleave`,()=>this.hide())):(this.cleanup.events.on(`target:click`,this.target,`click`,()=>this.toggle()),this.cleanup.events.on(`document:click`,document,`click`,e=>this.docClick(e))))}bindRootEvents(){let{root:e}=this.dom;!e||this.props?.mode!==`hover`||!this.cleanup||(this.cleanup.events.on(`root:enter`,e,`mouseenter`,()=>this.show()),this.cleanup.events.on(`root:leave`,e,`mouseleave`,()=>this.hide()))}unbindRootEvents(){this.cleanup?.events.off(`root:enter`),this.cleanup?.events.off(`root:leave`)}unbindEvents(){this.cleanup?.events.clear()}startHoverIntent(){this.cleanup&&(this.cleanup.events.on(`document:mousemove`,document,`mousemove`,e=>this.onMouseMove(e)),this.timer.show&&clearTimeout(this.timer.show),this.timer.show=setTimeout(()=>{let e=Date.now()-this.hoverIntentData.lastMoveTime;Math.abs(this.hoverIntentData.x-this.lastX)+Math.abs(this.hoverIntentData.y-this.lastY)<5||e>100?(this.show(),this.cleanup?.events.off(`document:mousemove`)):this.startHoverIntent()},this.delayShow))}cancelHoverIntent(){this.timer.show&&clearTimeout(this.timer.show),this.cleanup?.events.off(`document:mousemove`),this.hide()}onMouseMove(e){e instanceof MouseEvent&&(this.lastX=e.clientX,this.lastY=e.clientY,this.hoverIntentData.lastMoveTime=Date.now(),this.hoverIntentData.x=e.clientX,this.hoverIntentData.y=e.clientY)}setPosition(){if(!this.target||!this.dom.root||!this.props)return;let e=this.target.getBoundingClientRect(),t=this.dom.root,{offset:n,position:r}=this.props;t.style.visibility=`hidden`,t.style.display=`block`;let i=t.getBoundingClientRect(),a=0,o=0,s=r;switch(s===`auto`&&(s=window.innerHeight-e.bottom>i.height+n?`top-center`:`bottom-center`),s){case`top-left`:a=e.top-i.height-n,o=e.left;break;case`top-center`:a=e.top-i.height-n,o=e.left+e.width/2-i.width/2;break;case`top-right`:a=e.top-i.height-n,o=e.right-i.width;break;case`bottom-left`:a=e.bottom+n,o=e.left;break;case`bottom-center`:a=e.bottom+n,o=e.left+e.width/2-i.width/2;break;case`bottom-right`:a=e.bottom+n,o=e.right-i.width;break;case`left`:a=e.top+e.height/2-i.height/2,o=e.left-i.width-n;break;case`right`:a=e.top+e.height/2-i.height/2,o=e.right+n;break;default:break}a=Math.max(8,Math.min(a,window.innerHeight-i.height-8)),o=Math.max(8,Math.min(o,window.innerWidth-i.width-8)),t.style.top=`${a+window.scrollY}px`,t.style.left=`${o+window.scrollX}px`,t.style.visibility=``,t.style.display=``}docClick(e){e.target instanceof Node&&(!this.dom.root||!this.target||!this.dom.root.contains(e.target)&&!this.target.contains(e.target)&&this.hide())}exec(e){let{root:t}=this.dom;!t||!this.props||(e?(t.parentNode||document.body.appendChild(t),this.bindRootEvents(),this.setPosition()):(this.unbindRootEvents(),t.style.top=``,t.style.left=``,t.remove()),t.setAttribute(`aria-hidden`,e?`false`:`true`),t.setAttribute(`aria-expanded`,e?`true`:`false`),this.isVisible=e)}show(e=!0){this.timer.hide&&clearTimeout(this.timer.hide),!this.isVisible&&(e&&this.delayShow>0?(this.timer.show&&clearTimeout(this.timer.show),this.timer.show=setTimeout(()=>this.exec(!0),this.delayShow)):this.exec(!0),this.props?.onShown?.(this))}hide(e=!0){this.timer.show&&clearTimeout(this.timer.show),this.isVisible&&(e&&this.delayHide>0?(this.timer.hide&&clearTimeout(this.timer.hide),this.timer.hide=setTimeout(()=>this.exec(!1),this.delayHide)):this.exec(!1),this.props?.onHidden?.(this))}toggle(){this.isVisible?this.hide():this.show()}destroy(){this.props&&(this.timer.show&&clearTimeout(this.timer.show),this.timer.hide&&clearTimeout(this.timer.hide),this.unbindEvents(),this.dom.root?.remove(),this.props=null,this.dom.root=null,this.target=null,this.timer={show:null,hide:null},this.cleanup?.events.clear(),this.cleanup=null,this.isVisible=!1)}};function Ut(e,t={}){return new Ht(e,t)}function V(...e){return e.filter(Boolean).join(` `)}let Wt={container:`j-tooltip`,message:`el-text`,ui:{reverse:`is-reverse`,primary:`is-primary`,success:`is-success`,warning:`is-warning`,error:`is-error`}};function Gt(e){let t=e&&typeof e==`object`?e:{},n=`ui`in t&&t.ui&&typeof t.ui==`object`?t.ui:{};return{...Wt,...t,ui:{...Wt.ui,...n}}}let Kt={name:{default:null,types:[`string`,`null`]},mode:{default:`hover`,type:`string`,enum:[`hover`,`click`]},position:{default:`auto`,type:`string`,enum:[`auto`,`top-left`,`top-center`,`top-right`,`bottom-left`,`bottom-center`,`bottom-right`,`left`,`right`]},offset:{default:8,type:`number`},message:{default:``,type:`string`,normalize:e=>typeof e==`string`?e.trim():e,nonEmpty:!0},theme:{default:!1,types:[`string`,`boolean`],enum:[!1,`reverse`,`primary`,`success`,`warning`,`error`]},className:{default:Wt,type:`object`,normalize:Gt},id:{default:null,types:[`string`,`null`]},delay:{default:100,types:[`number`,`object`]},hoverIntent:{default:!0,type:`boolean`},onShown:{default:null,types:[`function`,`null`]},onHidden:{default:null,types:[`function`,`null`]}};function qt(e){let t=S(e,Kt,`Tooltip.props`);return{name:t.name,mode:t.mode,position:t.position,offset:t.offset,message:t.message,theme:t.theme,className:t.className,id:t.id,delay:t.delay,hoverIntent:t.hoverIntent,onShown:t.onShown,onHidden:t.onHidden}}var Jt=class{dom;drop;props;constructor(e,t={}){let n=qt(t);this.props=n,this.drop=Ut(e,{name:n.name,mode:n.mode,position:n.position,offset:n.offset,id:n.id,delay:n.delay,hoverIntent:n.hoverIntent,onShown:n.onShown,onHidden:n.onHidden,content:this.buildContent(n)}),this.dom=this.drop.dom}buildContent(e){return(0,t.jsx)(`div`,{className:V(e.className.container,e.theme&&e.className.ui[e.theme]),"data-tooltip":e.name||e.id||``,children:(0,t.jsx)(`div`,{className:e.className.message,"data-tooltip-message":``,children:e.message})})}show(e=!0){this.drop?.show(e)}hide(e=!0){this.drop?.hide(e)}toggle(){this.drop?.toggle()}destroy(){this.drop?.destroy(),this.drop=null,this.props=null}};function Yt(e,t={}){return new Jt(e,t)}var H={en:{b:`Back`,t:`Customize`,sm:`Small`,md:`Medium`,lg:`Large`},zh:{b:`返回`,t:`自定义主题`,Primary:`主色`,Radius:`圆角`,Shadow:`阴影`,Font:`字号`,Mode:`模式`,Gray:`灰色`,Olive:`橄榄绿`,Tomato:`番茄红`,Ruby:`红宝石`,Pink:`粉红`,Violet:`紫罗兰`,Indigo:`靛蓝`,Blue:`蓝色`,Teal:`青色`,Grass:`草绿`,Mint:`薄荷绿`,Lime:`酸橙绿`,Yellow:`黄色`,Orange:`橙色`,Gold:`金色`,None:`无`,sm:`小`,md:`中`,lg:`大`,XL:`更大`,Round:`圆角`,Light:`浅色`,Dark:`深色`,Auto:`自动`,Close:`关闭`,Confirm:`确认`}};let Xt={container:`j-toast-container`,toast:`j-toast`,icon:`el-icon`,message:`el-text`,lite:`j-toast-lite`,action:`j-toast is-action`,actions:`toast-actions`,button:`j-button is-sm`,closeBtn:`is-ghost`,actionBtn:`is-outline`,info:`is-info`,primary:`is-primary`,success:`is-success`,warning:`is-warning`,error:`is-error`},Zt={type:`string`,enum:[`info`,`success`,`warning`,`error`,`primary`]},Qt={type:`number`,min:0},$t={type:`number`,greaterThan:0};function en(e){return{...Xt,...e}}var tn=class e{static timers=new Set;static disposers=new Map;static classNames=new WeakMap;static options={className:Xt};static configure(t={}){return e.options={className:en(t.className)},e.options}static resolveClassNames(t){return en({...e.options.className,...t?.className})}static show(n=``,r=3e3,i=`info`,a={}){x(`message`,n,`string`,`Toast.show`),x(`duration`,r,Qt,`Toast.show`),x(`type`,i,Zt,`Toast.show`);let o=e.resolveClassNames(a),s=e.getOrCreateContainer(o),l=c(),u=(0,t.jsx)(`div`,{className:V(o.toast,o[i]),"data-toast":l,role:`alert`,"aria-atomic":`true`,children:[(0,t.jsx)(`span`,{className:o.icon,"data-toast-icon":l,children:z(i===`primary`?`info`:i)}),(0,t.jsx)(`span`,{className:o.message,"data-toast-message":l,children:n})]});e.classNames.set(u,o),s.appendChild(u);let d=i===`error`?`assertive`:`polite`;e.setTimer(l,`show`,()=>u.setAttribute(`aria-live`,d),10),r>0&&e.setTimer(l,`hide`,()=>e.hide(u),r);let f=Ze(u,`click`,()=>e.hide(u));return e.disposers.set(u,f),u}static success(t=``,n=3e3,r={}){return e.show(t,n,`success`,r)}static info(t=``,n=3e3,r={}){return e.show(t,n,`info`,r)}static primary(t=``,n=3e3,r={}){return e.show(t,n,`primary`,r)}static warning(t=``,n=3e3,r={}){return e.show(t,n,`warning`,r)}static error(t=``,n=3e3,r={}){return e.show(t,n,`error`,r)}static hide(t){if(!t)return;e.disposers.get(t)?.(),e.disposers.delete(t),t.removeAttribute(`aria-live`),t.setAttribute(`aria-hidden`,`true`);let n=t.dataset.toast||c();e.setTimer(n,`remove`,()=>{t.remove();let e=O(`[data-toast-container]`);e&&e.children.length===0&&e.remove()},300)}static lite(n=``,r=2e3,i={}){x(`message`,n,`string`,`Toast.lite`),x(`duration`,r,$t,`Toast.lite`);let a=e.resolveClassNames(i);O(`[data-toast-lite]`)?.remove();let o=c(),s=(0,t.jsx)(`div`,{className:a.lite,"data-toast":o,"data-toast-lite":``,children:n});return e.classNames.set(s,a),document.body.appendChild(s),e.setTimer(o,`show`,()=>s.setAttribute(`aria-live`,`polite`),10),e.setTimer(o,`hide`,()=>{s.removeAttribute(`aria-live`),s.setAttribute(`aria-hidden`,`true`),e.setTimer(o,`remove`,()=>s.remove(),300)},r),s}static action(r=``,i={}){x(`message`,r,`string`,`Toast.action`);let a=(0,n.t)(`Close`,H),o=(0,n.t)(`Confirm`,H),s=e.resolveClassNames(i),l=e.getOrCreateContainer(s),u=c(),d=(0,t.jsx)(`div`,{className:s.action,"data-toast":u,"data-toast-action":``,children:[(0,t.jsx)(`div`,{className:s.message,"data-toast-message":u,children:r}),(0,t.jsx)(`div`,{className:s.actions,"data-toast-actions":u,children:[(0,t.jsx)(`button`,{className:V(s.button,s.closeBtn),children:i.text?.close||a,"data-action":`close`,"aria-label":i.text?.close||a,onClick:async()=>{await i.onClose?.(),e.hide(d)}}),(0,t.jsx)(`button`,{className:V(s.button,s.actionBtn),children:i.text?.action||o,"data-action":`toast-action`,"aria-label":i.text?.action||o,onClick:async()=>{await i.onAction?.(),e.hide(d)}})]})]});return e.classNames.set(d,s),l.appendChild(d),e.setTimer(u,`show`,()=>{d.setAttribute(`aria-live`,`polite`),O(`[data-action="toast-action"]`,d)?.focus()},10),d}static getOrCreateContainer(e){let n=O(`[data-toast-container]`);return n?n.className=e.container:(n=(0,t.jsx)(`div`,{className:e.container,"data-toast-container":``}),document.body.appendChild(n)),n}static setTimer(t,n,r,i){let a=`${t}-${n}`;return e.timers.add(a),j.start(a,i,()=>{e.timers.delete(a),r()}),a}static clearAll(){for(let t of e.timers)j.cancel(t);e.timers.clear();for(let t of e.disposers.values())t();e.disposers.clear(),O(`[data-toast-container]`)?.remove(),O(`[data-toast-lite]`)?.remove()}static destroyAll(){e.clearAll()}};let nn={panel:`j-theme-palette`,title:`theme-palette-title`,container:`palette-container`,item:`palette-item`,itemTitle:`item-title`,items:`items`,button:`j-button is-default`,active:`is-active`,prefix:`el-prefix`,swatch:`item-hex`,buttonText:`button-text`},rn={mode:`dark`,theme:`indigo`,radius:`sm`,shadow:`sm`,font:`sm`,key:`ui-theme`,className:nn},an={theme:`j-theme-`,radius:`j-radius-`,shadow:`j-shadow-`,font:`j-font-`};function on(e){return{...nn,...e}}function sn(e={}){return{...rn,...e,className:on(e.className)}}function cn(e){return e===`mode`||e===`theme`||e===`radius`||e===`shadow`||e===`font`}function ln(){return(0,r.createStorage)({driver:`cookie`,codec:`json`,driverOptions:{path:`/`,sameSite:`Lax`,secure:typeof location<`u`&&location.protocol===`https:`},ttl:864e5})}function un(e){if(!_(e))return null;let t=e,n={};for(let e of[`mode`,`theme`,`radius`,`shadow`,`font`]){let r=t[e];typeof r==`string`&&(n[e]=r)}return Object.keys(n).length?n:null}var dn=class{props;languages;cleanup;runtime;storage;constructor(e={}){this.props=(0,t.createDeepStore)(sn(e)),this.languages=H,this.cleanup=null,this.runtime={configVersion:0,destroyed:!1},this.storage=ln(),this.init()}init(){this.cleanup={bindings:new Set,events:A()},this.loadConfig(),this.bindEvent()}translate(e){return(0,n.t)(e,this.languages)}loadConfig(){let e=this.runtime.configVersion;this.storage.get(this.props.key).then(n=>{if(this.runtime.destroyed||this.runtime.configVersion!==e)return;let r=un(n);r&&(0,t.flushSync)(()=>{Object.assign(this.props,r)})}).catch(()=>{})}saveConfig(){let{mode:e,theme:t,radius:n,shadow:r,font:i}=this.props,a={mode:e,theme:t,radius:n,shadow:r,font:i,render:e===`auto`?this.scheme():e};this.storage.set(this.props.key,a).catch(()=>{})}scheme(){return window.matchMedia?.(`(prefers-color-scheme: dark)`).matches?`dark`:`light`}bindActiveButtons(e){let n=(0,t.createRoot)(n=>{let r=k(`[data-theme-group]`,e);for(let e of r){let n=e.dataset.themeGroup;if(!cn(n))continue;let r=k(`[data-theme-button]`,e);for(let e of r){let r=()=>e.dataset.themeValue===String(this.props[n]);(0,t.bindClass)(e,this.props.className.active,r),(0,t.bindAttr)(e,`aria-selected`,()=>r()?`true`:null)}}return n});this.cleanup?.bindings.add(n)}bindEvent(){this.cleanup?.events.on(`palette`,document.body,`click`,e=>{if(!(e.target instanceof Element))return;let n=e.target.closest(`[data-theme-button]`);if(!n)return;let r=n.closest(`[data-theme-group]`),i=r?.dataset.themeGroup,a=n.dataset.themeValue;if(!r||!cn(i)||!a||n.classList.contains(this.props.className.active))return;let o=this.props[i];this.runtime.configVersion+=1,(0,t.flushSync)(()=>{this.props[i]=a});let s=document.documentElement;if(i===`mode`){let e=a===`auto`?this.scheme():a;s.classList.remove(`light`,`dark`,o),s.classList.add(e)}else{let e=an[i],t=Array.from(s.classList).filter(t=>t.startsWith(e));t.length&&s.classList.remove(...t),s.classList.add(`${e}${a}`)}this.saveConfig()})}unbindEvent(){this.cleanup?.events.clear()}createPanel(e=null,n=null){let r=this.props.className,i=n||this.defaultPanelConfig(),a=(0,t.jsx)(`div`,{className:e||r.panel,"data-theme-palette":`root`,children:[(0,t.jsx)(`h3`,{className:r.title,"data-theme-title":``,style:{margin:`0 0 1rem`},children:this.translate(`t`)}),(0,t.jsx)(`div`,{className:r.container,"data-theme-container":``,children:i.map(e=>(0,t.jsx)(`div`,{className:r.item,"data-palette":e.type,"data-theme-group":e.type,children:[(0,t.jsx)(`div`,{className:r.itemTitle,"data-theme-group-title":e.type,children:e.title}),(0,t.jsx)(`div`,{className:r.items,"data-theme-items":e.type,children:e.buttons.map(([n,i])=>{let a=String(this.props[e.type])===String(n);return(0,t.jsx)(`button`,{className:V(r.button,a&&r.active),"data-palette":n,"data-theme-button":e.type,"data-theme-value":n,"aria-selected":a?`true`:null,children:[e.type===`theme`?(0,t.jsx)(`span`,{className:V(r.prefix,r.swatch),"data-theme-swatch":n,style:{backgroundColor:`var(--ui-${n})`}}):null,(0,t.jsx)(`span`,{className:r.buttonText,"data-theme-button-text":n,children:i})]})})})]}))})]});return this.bindActiveButtons(a),a}setConfig(e){this.runtime.configVersion+=1,(0,t.flushSync)(()=>{Object.assign(this.props,e,{className:on({...this.props.className,...e.className})})}),this.saveConfig()}destroy(){this.runtime.destroyed||(this.runtime.destroyed=!0,this.unbindEvent(),this.cleanup?.bindings.forEach(e=>e()),this.cleanup?.bindings.clear(),this.cleanup=null,this.storage.close().catch(()=>{}))}defaultPanelConfig(){return[{title:this.translate(`Primary`),type:`theme`,buttons:[[`gray`,this.translate(`Gray`)],[`olive`,this.translate(`Olive`)],[`tomato`,this.translate(`Tomato`)],[`ruby`,this.translate(`Ruby`)],[`pink`,this.translate(`Pink`)],[`violet`,this.translate(`Violet`)],[`indigo`,this.translate(`Indigo`)],[`blue`,this.translate(`Blue`)],[`teal`,this.translate(`Teal`)],[`grass`,this.translate(`Grass`)],[`mint`,this.translate(`Mint`)],[`lime`,this.translate(`Lime`)],[`yellow`,this.translate(`Yellow`)],[`orange`,this.translate(`Orange`)],[`gold`,this.translate(`Gold`)]]},{title:this.translate(`Radius`),type:`radius`,buttons:[[`none`,this.translate(`None`)],[`sm`,this.translate(`sm`)],[`md`,this.translate(`md`)],[`lg`,this.translate(`lg`)],[`xl`,this.translate(`XL`)],[`round`,this.translate(`Round`)]]},{title:this.translate(`Shadow`),type:`shadow`,buttons:[[`none`,this.translate(`None`)],[`sm`,this.translate(`sm`)],[`md`,this.translate(`md`)],[`lg`,this.translate(`lg`)]]},{title:this.translate(`Font`),type:`font`,buttons:[[`sm`,this.translate(`sm`)],[`md`,this.translate(`md`)]]},{title:this.translate(`Mode`),type:`mode`,buttons:[[`light`,this.translate(`Light`)],[`dark`,this.translate(`Dark`)],[`auto`,this.translate(`Auto`)]]}]}};function fn(e={}){return new dn(e)}let pn={color:`var(--tone-solid)`,size:`12px`},mn={ball:`parabola-ball`},hn={types:[`string`,`Node`,`array`,`null`,`undefined`]},gn={ball:{default:pn,type:`plainObject`,normalize:e=>({...pn,...e&&typeof e==`object`?e:{}}),shape:{color:`string`,size:`string`}},className:{default:mn,type:`object`,normalize:e=>({...mn,...e&&typeof e==`object`?e:{}})},from:{default:null,...hn},to:{default:null,...hn},direction:{default:`center`,type:`string`,enum:[`center`,`top-right`,`top-left`,`bottom-right`,`bottom-left`]},showDelay:{default:0,type:`number`},onShow:{default:null,types:[`function`,`null`]},onHidden:{default:null,types:[`function`,`null`]}};function _n(e){let t=S(e,gn,`Parabola.props`);return{ball:t.ball,className:t.className,from:t.from,to:t.to,direction:t.direction,showDelay:t.showDelay,onShow:t.onShow,onHidden:t.onHidden}}var vn=class{props;dom;runtime;cache;constructor(e={}){this.props=_n(e),this.dom={root:null,from:E(this.props.from),to:E(this.props.to),balls:new Set},this.runtime={destroyed:!1},this.cache={delays:new Map},this.createRoot()}createRoot(){if(!this.runtime.destroyed){if(this.dom.root){this.dom.root.isConnected||document.body.appendChild(this.dom.root);return}this.dom.root=(0,t.jsx)(`div`,{"data-parabola":`root`,style:{position:`fixed`,inset:`0`,pointerEvents:`none`,zIndex:`9999`}}),document.body.appendChild(this.dom.root)}}createBall(e){if(this.runtime.destroyed||(this.createRoot(),!this.dom.root))return null;let{color:n,size:r}=this.props.ball,i=(0,t.jsx)(`div`,{className:this.props.className.ball,"data-parabola":`ball`,style:{backgroundColor:n,width:r,height:r,position:`fixed`,borderRadius:`50%`,transform:`translate(-50%, -50%)`,pointerEvents:`none`,zIndex:`9999`,opacity:`1`,left:`${e.startX}px`,top:`${e.startY}px`}});return this.dom.root.appendChild(i),this.dom.balls.add(i),i}resolveTargets(){this.dom.from=E(this.props.from),this.dom.to=E(this.props.to)}calculatePath(){let e=this.dom.from?.getBoundingClientRect(),t=this.dom.to?.getBoundingClientRect();if(!e||!t)return null;let{left:n,top:r,width:i,height:a}=e,{left:o,top:s,width:c,height:l}=t,u,d;switch(this.props.direction){case`top-left`:u=n+i*.2,d=r+a*.2;break;case`top-right`:u=n+i*.8,d=r+a*.2;break;case`bottom-left`:u=n+i*.2,d=r+a*.8;break;case`bottom-right`:u=n+i*.8,d=r+a*.8;break;default:u=n+i/2,d=r+a/2}let f=o+c/2,p=s+l/2;return{startX:u,startY:d,endX:f,endY:p}}easeOutCubic(e){return 1-(1-e)**3}animate(e,t,n,r,i,a=800){if(!e.isConnected)return;let o=performance.now(),s=r-t,c=i-n,l=r=>{if(!e.isConnected)return;let i=r-o,u=Math.min(i/a,1),d=this.easeOutCubic(u),f=t+s*d,p=n+-100*Math.sin(Math.PI*d)+c*d,ee=1-u;e.style.left=`${f}px`,e.style.top=`${p}px`,e.style.opacity=`${ee}`,e.style.transform=`translate(-50%, -50%) scale(${1-d*.3})`,u<1?requestAnimationFrame(l):this.removeBall(e,!0)};requestAnimationFrame(l)}startDelay(e,t){let n=`parabola-show-${c()}`;this.cache.delays.set(n,t),j.start(n,this.props.showDelay,()=>{this.cache.delays.delete(n),e()})}cancelDelays(){for(let[e,t]of this.cache.delays)j.cancel(e),t();this.cache.delays.clear()}removeBall(e,t){this.dom.balls.has(e)&&(e.remove(),this.dom.balls.delete(e),t&&this.props.onHidden?.(this),this.removeRootIfIdle())}removeRootIfIdle(){!this.runtime.destroyed||this.dom.balls.size>0||(this.dom.root?.remove(),this.dom.root=null)}show(){return this.runtime.destroyed?Promise.resolve(!1):new Promise(e=>{this.startDelay(()=>{if(this.runtime.destroyed){e(!1);return}this.resolveTargets();let t=this.calculatePath();if(!t){e(!1);return}let n=this.createBall(t);if(!n){e(!1);return}this.props.onShow?.(this),this.animate(n,t.startX,t.startY,t.endX,t.endY),e(!0)},()=>e(!1))})}destroy(){this.runtime.destroyed||(this.cancelDelays(),this.dom.from=null,this.dom.to=null,this.runtime.destroyed=!0,this.removeRootIfIdle())}};function yn(e={}){return new vn(e)}let bn={rules:{default:{},type:`object`},messages:{default:{},type:`object`},onSubmit:{default:null,types:[`function`,`null`]}};function xn(e){let t=S(e,bn,`Validator.props`);return{rules:t.rules,messages:t.messages,onSubmit:t.onSubmit}}function Sn(e){return e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement}function Cn(e){if(!e)return null;if(e instanceof Element)return Sn(e)?e:null;for(let t of Array.from(e))if(t instanceof Element&&Sn(t))return t;return null}function wn(){return{valid:!0,message:``,destroyed:!1}}function Tn(e){return e.closest(`[data-form-control]`)||e.parentElement}function En(e){return Array.from(e.selectedOptions).map(e=>e.value.trim())}function Dn(e){return e instanceof HTMLInputElement&&e.type===`file`}function On(e){return!!e.files&&e.files.length>0}var kn=class{dom;props;runtime;cleanup;constructor(e,t={},n=!1){this.props=xn(t),this.dom={root:this.resolveRoot(e)},this.runtime=wn(),this.cleanup={events:A()},this.validateOptions(n),n&&this.bindEvents()}resolveRoot(e){let t=E(e);if(!(t instanceof HTMLFormElement))throw Error(`Validator.element expects a form element.`);return t}validateOptions(e){x(`bindEvents`,e,`boolean`,`Validator`)}bindEvents(){this.unbindEvents();let{root:e}=this.dom;!e||!this.cleanup||(this.cleanup.events.on(`submit`,e,`submit`,e=>{e.preventDefault(),this.validate()}),this.cleanup.events.on(`reset`,e,`reset`,()=>{this.reset({native:!1})}))}unbindEvents(){this.cleanup?.events.clear()}validate(){let{root:e}=this.dom;if(!e||!this.props)return!1;this.runtime.valid=!0,this.runtime.message=``;for(let t of Array.from(e.elements))if(!(!Sn(t)||!t.name)&&this.props.rules[t.name]&&(this.runtime.valid=this.validateRule(t,t.name),!this.runtime.valid))break;return this.runtime.valid&&this.props.onSubmit&&this.props.onSubmit(this),this.runtime.valid}validateRule(e,t){if(!this.props)return!1;let n=this.props.rules[t];if(!n)return!0;if(this.hasNativeValidationRule(e))return this.runtime.valid;for(let r of Object.keys(n)){let i=n[r],a=``;switch(r){case`required`:this.runtime.valid=this.validateRequired(e,i);break;case`minLength`:this.runtime.valid=this.validateMinLength(e,i);break;case`maxLength`:this.runtime.valid=this.validateMaxLength(e,i);break;case`equalTo`:this.runtime.valid=this.validateEqualTo(e,i);break;case`email`:this.runtime.valid=this.validateEmail(e);break;case`checked`:this.runtime.valid=this.validateCheck(e,i);break;case`selected`:this.runtime.valid=this.validateSelected(e,i);break;case`multiple`:this.runtime.valid=this.validateMultiple(e,i);break;case`min`:this.runtime.valid=this.validateSelectMin(e,i);break;case`max`:this.runtime.valid=this.validateSelectMax(e,i);break;case`noSpace`:this.runtime.valid=this.validateNoSpace(e,i);break;case`noChinese`:this.runtime.valid=!/[\u4e00-\u9fa5]/.test(e.value);break;case`noSpecial`:this.runtime.valid=!/[@#$%^&*]+/g.test(e.value);break;case`pattern`:this.runtime.valid=this.validatePattern(e,i);break;case`file`:this.runtime.valid=this.validateFile(e,i);break;case`minSize`:this.runtime.valid=this.validateMinSize(e,i);break;case`maxSize`:this.runtime.valid=this.validateMaxSize(e,i);break;case`accept`:this.runtime.valid=this.validateAccept(e,i);break;case`validate`:{let t=this.validateCustom(e,i);this.runtime.valid=t===!0,a=typeof t==`string`?t:``;break}}if(!this.runtime.valid){this.showError(e,t,r,a);break}this.showSuccess(e)}return this.runtime.valid}hasNativeValidationRule(e){return e.hasAttribute(`required`)||e.hasAttribute(`minlength`)||e.hasAttribute(`maxlength`)||e.hasAttribute(`pattern`)||e.hasAttribute(`min`)||e.hasAttribute(`max`)||e.hasAttribute(`step`)}validateRequired(e,t){return t===!0?e instanceof HTMLSelectElement?En(e).some(e=>e.length>0):e.value.trim().length>=1:!0}validateMinLength(e,t){return typeof t!=`number`||e.value.length>=t}validateMaxLength(e,t){return typeof t!=`number`||e.value.length<=t}validateEmail(e){return/^([\w-.]+@([\w-]+\.)+[\w-]{2,4})?$/.test(e.value)}validateEqualTo(e,t){let{root:n}=this.dom;if(!n||typeof t!=`string`)return!0;let r=Cn(n.elements.namedItem(t));if(!r)throw Error(`Validator: target element "${t}" not found.`);return e.value===r.value}validateCheck(e,t){if(!(e instanceof HTMLInputElement)||e.type!==`checkbox`)throw Error(`Validator: element expects a checkbox input, but ${e.tagName.toLowerCase()} given.`);return e.checked===t}validateSelected(e,t){if(!(e instanceof HTMLSelectElement))throw Error(`Validator: element expects a select element, but ${e.tagName.toLowerCase()} given.`);return t!==!0||En(e).some(e=>e.length>0)}validateMultiple(e,t){if(!(e instanceof HTMLSelectElement))throw Error(`Validator: element expects a select element, but ${e.tagName.toLowerCase()} given.`);return t!==!0||e.selectedOptions.length>0}validateSelectMin(e,t){return!(e instanceof HTMLSelectElement)||typeof t!=`number`||e.selectedOptions.length>=t}validateSelectMax(e,t){return!(e instanceof HTMLSelectElement)||typeof t!=`number`||e.selectedOptions.length<=t}validateNoSpace(e,t){return!/\s/.test(e.value)||t!==!0}validatePattern(e,t){return typeof t==`string`||t instanceof RegExp?new RegExp(t).test(e.value):!0}validateFile(e,t){return!Dn(e)||t!==!0||On(e)}validateMinSize(e,t){return!Dn(e)||!On(e)||typeof t!=`number`||e.files[0].size>=t}validateMaxSize(e,t){return!Dn(e)||!On(e)||typeof t!=`number`||e.files[0].size<=t}validateAccept(e,t){if(!Dn(e)||!On(e)||typeof t!=`string`)return!0;let n=e.files[0];return t.split(`,`).map(e=>e.trim().toLowerCase()).some(e=>e.startsWith(`.`)?n.name.toLowerCase().endsWith(e):e.endsWith(`/*`)?n.type.startsWith(e.replace(`/*`,`/`)):n.type===e)}validateCustom(e,t){if(typeof t!=`function`)return!0;let n=t(e,this);return typeof n==`string`?n:!!n}showError(e,n,r,i=``){(!(e instanceof HTMLInputElement)||e.type!==`checkbox`)&&(e.classList.remove(`is-valid`),e.classList.add(`is-invalid`));let a=i||this.props?.messages[n]?.[r]||``;if(!a)return;this.runtime.message=a;let o=Tn(e);if(!o)return;let s=k(`[data-validator-help]`,o).find(e=>e.dataset.validatorHelp===n)||null;s||(s=(0,t.jsx)(`div`,{className:`help-block is-invalid`,"data-validator-help":n}),o.appendChild(s)),s.textContent=a}showSuccess(e){let t=Tn(e);if(t)for(let n of k(`[data-validator-help]`,t))n.dataset.validatorHelp===e.name&&n.remove();(!(e instanceof HTMLInputElement)||e.type!==`checkbox`)&&(e.classList.remove(`is-invalid`),e.classList.add(`is-valid`))}reset({native:e=!0}={}){let{root:t}=this.dom;if(t){e&&t.reset();for(let e of Array.from(t.elements))Sn(e)&&(e.classList.remove(`is-valid`),e.classList.remove(`is-invalid`));for(let e of k(`[data-validator-help]`,t))e.remove();this.runtime.valid=!0,this.runtime.message=``}}destroy(){this.runtime.destroyed||(this.runtime.destroyed=!0,this.unbindEvents(),this.reset({native:!1}),this.dom.root=null,this.props=null,this.runtime.valid=!1,this.runtime.message=``,this.cleanup?.events.clear(),this.cleanup=null)}};function An(e,t={},n=!1){return new kn(e,t,n)}var U=class e{static globalPlugins=new Map;props;dom;cache;plugins;cleanup;_listeners;state;runtime;constructor(e={}){this.props=e||{},this.dom={root:null},this.cache={},this.plugins=new Map,this.cleanup={events:A(),plugins:new Map},this._listeners={init:[],beforeReCreate:[],afterReCreate:[],destroy:[]},this.state=(0,t.createDeepStore)({}),this.runtime={destroyed:!1},this.installGlobalPlugins()}use(e,t){if(!e)return this;let n=typeof e==`function`?e(this,t):e.install?.(this,t);return this.cleanup.plugins.set(e,n),this}on(e,t){return!this._listeners[e]||typeof t!=`function`||this._listeners[e].push(t),this}off(e,t){return this._listeners[e]&&(this._listeners[e]=this._listeners[e].filter(e=>e!==t)),this}installGlobalPlugins(){for(let t of e.globalPlugins.values())this.use(t)}static useGlobal(t,n){!t||!n||e.globalPlugins.set(t,n)}emit(e,...t){let n=this._listeners[e];if(!n)return this;for(let e of n)try{e(...t)}catch{}return this}init(e={}){if(this.runtime.destroyed)throw Error(`Component.init: instance destroyed`);return _(e)&&(this.props=Object.assign({},this.props,e)),typeof this.onInit==`function`&&this.onInit(this.props),this.emit(`init`,this.props),this}setState(e={},n){if(this.runtime.destroyed)throw Error(`Component.setState: instance destroyed`);let r=typeof e==`string`&&arguments.length>1?{[e]:n}:e;if(!_(r))throw Error(`Component.setState: expects a plain object patch.`);let i=this.normalizeStatePatch(r);if(!_(i))throw Error(`Component.setState: expects a plain object patch.`);return this.validateStatePatch(i),(0,t.flushSync)(()=>{for(let[e,t]of Object.entries(i)){if(!this.state)return;this.state[e]=t}}),this.afterSetState(i),this}reCreate(e={},{force:t=!1}={}){if(this.runtime.destroyed)throw Error(`Component.reCreate: instance destroyed`);if(!_(e))return this;let n=Object.assign({},this.props,e);this.emit(`beforeReCreate`,e,{force:t}),typeof this.onReCreate==`function`&&this.onReCreate(e,{force:t});let r=this.createInstance(n);return this.destroy(),r.emit(`afterReCreate`,e,{force:t}),r}createInstance(e){let t=this.constructor;return new t(e)}destroy(){if(!this.runtime.destroyed){this.runtime.destroyed=!0,typeof this.onDestroy==`function`&&this.onDestroy(),this.emit(`destroy`);for(let e of this.cleanup.plugins.values())try{typeof e==`function`?e():e&&typeof e.destroy==`function`&&e.destroy()}catch{}this.cleanup.plugins.clear(),this.cleanup.events.clear(),this.dom={root:null},this.cache={},this.state=null}}normalizeStatePatch(e){return e}validateStatePatch(e){if(this.state)for(let t of Object.keys(e)){let e=String(t);if(!Object.hasOwn(this.state,e))throw Error(`Component.setState: "${e}" is not a supported state key.`)}}afterSetState(e){}};let jn={toc:`j-toc`,list:`toc-list`,link:`toc-link`,active:`is-active`,levelPrefix:`is-level-`},Mn={target:{default:`.j-content`},headings:{default:`h2, h3`,type:`string`},offset:{default:80,type:`number`,min:0},className:{default:jn,type:`object`,normalize:e=>({...jn,...e&&typeof e==`object`?e:{}})},onChange:{default:null,types:[`function`,`null`]}};function Nn(e){let t=S(e,Mn,`Toc.props`);return{target:t.target,headings:t.headings,offset:t.offset,className:t.className,onChange:t.onChange}}function Pn(e){let t=/^H([1-6])$/.exec(e.tagName);return t?Number(t[1]):1}function Fn(e,t){return e.id||=`toc-${c()}-${t}`,{id:e.id,text:e.textContent||``,level:Pn(e),element:e}}var In=class extends U{constructor(e={}){let n=Nn(e);super(n),this.dom.target=null,this.dom.list=null,this.dom.headings=[],this.dom.links=[],this.runtime.built=!1,this.runtime.ticking=!1,this.state=(0,t.createDeepStore)({items:[],current:{index:-1,item:null}})}build(){if(this.runtime.destroyed)throw Error(`Toc.build: instance destroyed`);return this.runtime.built?this:(this.init(this.props),this.dom.target=D(this.props.target,`Toc.target`),this.dom.list=(0,t.jsx)(`div`,{className:this.props.className.list,"data-toc-list":`root`}),this.dom.root=(0,t.jsx)(`nav`,{className:this.props.className.toc,"data-toc":`root`,children:this.dom.list}),this.runtime.built=!0,this.refresh(),this)}bindEvents(){this.dom.list&&(this.cleanup.events.on(`scroll`,window,`scroll`,()=>this.onScroll(),{passive:!0}),this.cleanup.events.on(`click`,this.dom.list,`click`,e=>this.onClick(e)))}onScroll(){this.runtime.ticking||(requestAnimationFrame(()=>{this.updateActive(),this.runtime.ticking=!1}),this.runtime.ticking=!0)}onClick(e){if(!(e.target instanceof Element)||!this.dom.list)return;let t=e.target.closest(`[data-toc-index]`);if(!t||!this.dom.list.contains(t))return;let n=Number(t.dataset.tocIndex),r=this.state?.items[n];r&&(e.preventDefault(),this.scrollToItem(r,{activeIndex:n,updateHash:!0}))}scrollToItem(e,{activeIndex:t=-1,updateHash:n=!1}={}){let r=window.scrollY||window.pageYOffset||0,i=Math.max(0,e.element.getBoundingClientRect().top+r-this.props.offset);window.scrollTo({top:i,behavior:`smooth`}),t>=0&&this.setActive(t),n&&window.history?.pushState&&window.history.pushState(null,``,`#${e.id}`)}linkClassName(e,t=!1){let n=[this.props.className.link,`${this.props.className.levelPrefix}${e.level}`];return t&&n.push(this.props.className.active),V(...n)}buildLink(e,n){return(0,t.jsx)(`a`,{className:this.linkClassName(e),href:`#${e.id}`,"data-toc-index":String(n),"data-toc-target":e.id,children:e.text})}updateActive(){if(!this.runtime.built)return;let e=-1,t=this.props.offset+1;for(let n=this.dom.headings.length-1;n>=0;n--)if(this.dom.headings[n].getBoundingClientRect().top<=t){e=n;break}this.setActive(e)}setActive(e){if(!this.state||e===this.state.current.index)return;let t=this.state.items[e]||null;this.setState({current:{index:e,item:t}});let n=this.state.items;this.dom.links.forEach((t,r)=>{let i=r===e;t.dataset.active=i?`1`:`0`,t.className=this.linkClassName(n[r],i)}),typeof this.props.onChange==`function`&&this.props.onChange(t,e,this)}refresh(){if(this.runtime.destroyed||!this.runtime.built||!this.dom.target||!this.dom.list)return this;this.cleanup.events.clear(),this.dom.headings=k(this.props.headings,this.dom.target);let e=this.dom.headings.map(Fn);this.dom.links=e.map((e,t)=>this.buildLink(e,t)),this.dom.list.innerHTML=``;for(let e of this.dom.links)this.dom.list.appendChild(e);return this.setState({items:e,current:{index:-1,item:null}}),this.bindEvents(),this.updateActive(),this}activate(e){return!this.runtime.built||!this.state||!Number.isInteger(e)||e<0||e>=this.dom.links.length||this.scrollToItem(this.state.items[e]),this}onDestroy(){this.cleanup.events.clear(),this.dom.root?.remove(),this.runtime.built=!1,this.runtime.ticking=!1,this.dom.target=null,this.dom.list=null,this.dom.headings=[],this.dom.links=[]}};function Ln(e={}){return new In(e)}let Rn={target:{default:null},parent:{default:null},max:{default:10,type:`number`,integer:!0,greaterThan:0},top:{default:16,type:`number`,min:0},gap:{default:16,type:`number`,min:0},overflow:{default:`destroy`,type:`string`,enum:[`destroy`,`ignore`]},onRefresh:{default:null,types:[`function`,`null`]}};function zn(e){let t=S(e,Rn,`Sticky.props`);return{target:t.target,parent:t.parent,max:t.max,top:t.top,gap:t.gap,overflow:t.overflow,onRefresh:t.onRefresh}}function Bn(e){let t=e.filter(e=>e instanceof HTMLElement);return Array.from(new Set(t))}function Vn(e){return e===!1||e==null?null:D(e,`Sticky.parent`,`element`)}function Hn(e,t){if(e===!1||e==null)return[];if(typeof e==`string`){if(!t)return Bn(D(e,`Sticky.target`,`array`));let n=Bn(k(e,t));if(n.length===0)throw Error(`Sticky.target: target not found.`);return n}let n=Bn(D(e,`Sticky.target`,`array`));if(!t)return n;let r=n.filter(e=>e===t||t.contains(e));if(r.length===0)throw Error(`Sticky.target: target not found in parent.`);return r}var Un=class extends U{constructor(e={}){let n=zn(e);super(n),this.dom.parent=null,this.dom.targets=[],this.cache.originalStyles=[],this.runtime.built=!1,this.state=(0,t.createDeepStore)({items:[]})}build(){if(this.runtime.destroyed)throw Error(`Sticky.build: instance destroyed`);return this.runtime.built||(this.init(this.props),this.dom.parent=Vn(this.props.parent),this.dom.targets=Hn(this.props.target,this.dom.parent),this.dom.targets=this.resolveOverflow(this.dom.targets),this.runtime.built=!0,this.dom.targets.length===0)?this:(this.captureOriginalStyles(),this.apply(),this)}captureOriginalStyles(){this.cache.originalStyles=this.dom.targets.map(e=>({element:e,originalPosition:e.style.position,originalTop:e.style.top,originalZIndex:e.style.zIndex}))}resolveOverflow(e){let{max:t,overflow:n}=this.props;return e.length<=t?e:n===`ignore`?[]:e.slice(-t)}apply(e=this.props.top){let t=e,n=[];for(let e of this.dom.targets)e.style.position=`sticky`,e.style.top=`${t}px`,n.push({element:e,top:t}),t+=e.offsetHeight+this.props.gap;return this.setState({items:n}),typeof this.props.onRefresh==`function`&&this.props.onRefresh(this),t}restore(){for(let e of this.cache.originalStyles)e.element.style.position=e.originalPosition,e.element.style.top=e.originalTop,e.element.style.zIndex=e.originalZIndex}refresh(){return this.runtime.destroyed||!this.runtime.built||this.dom.targets.length===0||this.apply(),this}destroy(){this.runtime.destroyed||(this.restore(),super.destroy())}onDestroy(){this.runtime.built=!1,this.cache.originalStyles=[],this.dom.targets=[]}};function Wn(e={}){return new Un(e)}let Gn={root:`j-accordion`,header:`accordion-header`,title:`header-title`,arrow:`header-arrow`,panel:`accordion-panel`,content:`panel-content`},Kn={type:`array`,nonEmpty:!0,items:{type:`plainObject`,shape:{name:[`string`,`null`,`undefined`],title:`renderable`,content:`renderable`}}},qn={id:{default:null,types:[`string`,`null`],normalize:e=>typeof e==`string`?e.trim()||c():e??c()},active:{default:0,types:[`number`,`string`,`array`,`null`],validate:e=>e==null?!0:Array.isArray(e)?e.every(Jn):Jn(e),message:`expects a non-negative integer, non-empty string, array or null.`},collapsible:{default:!1,type:`boolean`},multiple:{default:!1,type:`boolean`},className:{default:Gn,type:`object`,normalize:e=>({...Gn,...e&&typeof e==`object`?e:{}})},onChange:{default:null,types:[`function`,`null`]},items:{default:[],...Kn}};function Jn(e){return typeof e==`number`?Number.isInteger(e)&&e>=0:typeof e==`string`&&e.trim().length>0}function Yn(e){let t=S(e,qn,`Accordion.props`);return{id:t.id,active:t.active,collapsible:t.collapsible,multiple:t.multiple,className:t.className,items:Xn(t.items,!1),onChange:t.onChange}}function Xn(e,t=!0){t&&x(`items`,e,Kn,`Accordion`);let n=new Set;return e.map(e=>{let t=e,r=typeof t.name==`string`?t.name.trim():``;if(r){if(n.has(r))throw Error(`Accordion: item name "${r}" must be unique.`);n.add(r)}return{...t,name:r||c()}})}function Zn(e,t){return t.some((t,n)=>e[n]?.name!==t.name)}function Qn(e,t,n){if(e==null)return[];let r=Array.isArray(e)?e:[e],i=[];for(let e of r){let r=t[typeof e==`number`?e:t.findIndex(t=>t.name===e)]?.name;if(r&&(i.push(r),!n))break}return Array.from(new Set(i))}function $n(e,t,n){let r=new Set(t.map(e=>e.name).filter(Boolean)),i=e.filter(e=>r.has(e));return n?i:i.slice(0,1)}function er(e,t){let n=e[0]||null;if(!n)return{index:null,name:null};let r=t.findIndex(e=>e.name===n);return r>=0?{index:r,name:n}:{index:null,name:null}}var tr=class extends U{bindingsDispose;itemsDispose;constructor(e){let n=Yn(e);super(n);let r=Qn(n.active,n.items,n.multiple);this.dom.headers=[],this.dom.panels=[],this.bindingsDispose=null,this.itemsDispose=null,this.runtime.built=!1,this.state=(0,t.createDeepStore)({items:n.items,activeNames:r,current:er(r,n.items)})}onInit(e){this.dom.root=this.buildRoot(e),this.bindItems(),this.bindEvents()}buildRoot(e){return(0,t.jsx)(`div`,{className:e.className.root,id:e.id,"data-accordion":`root`})}bindItems(){this.itemsDispose?.(),this.syncItems(this.state.items),this.itemsDispose=L(()=>F(this.state.items),e=>this.syncItems(e))}syncItems(e){let t=Xn(I(e));Zn(e,t)&&(this.state.items=t);let n=$n(this.state.activeNames,t,this.props.multiple);this.buildItems(t,n),this.syncActiveNames(n,t)}buildItems(e,n){if(!this.dom.root)return;let r=document.createDocumentFragment();this.bindingsDispose?.(),this.bindingsDispose=null,this.dom.root.textContent=``,this.dom.headers=[],this.dom.panels=[],e.forEach((e,i)=>{let a=e.name||c(),o=n.includes(a),s=`${this.props.id}_header_${i}`,l=`${this.props.id}_panel_${i}`,u=(0,t.jsx)(`div`,{className:this.props.className.header,id:s,"data-accordion-header":a,role:`button`,tabindex:`0`,"aria-controls":l,children:[(0,t.jsx)(`span`,{className:this.props.className.title,"data-accordion-title":a,role:`heading`,children:this.contentView(e,i,`title`,o)}),(0,t.jsx)(`span`,{className:this.props.className.arrow,"data-accordion-arrow":a,"aria-hidden":`true`,children:z(`arrow-down`)})]}),d=(0,t.jsx)(`div`,{className:this.props.className.panel,"data-accordion-panel":a,id:l,role:`region`,"aria-labelledby":s,children:(0,t.jsx)(`div`,{className:this.props.className.content,"data-accordion-content":a,children:this.contentView(e,i,`content`,o)})});this.dom.headers.push(u),this.dom.panels.push(d),r.append(u,d)}),this.dom.root.append(r),this.bindItemState()}bindItemState(){this.bindingsDispose=(0,t.createRoot)(e=>(this.dom.headers.forEach(e=>{let n=e.dataset.accordionHeader||``;(0,t.bindAttr)(e,`aria-expanded`,()=>this.state.activeNames.includes(n)?`true`:`false`)}),this.dom.panels.forEach((e,n)=>{let r=this.dom.headers[n]?.dataset.accordionHeader||``;(0,t.bindAttr)(e,`aria-hidden`,()=>this.state.activeNames.includes(r)?`false`:`true`),(0,t.bindAttr)(e,`hidden`,()=>!this.state.activeNames.includes(r))}),e))}contentView(e,t,n,r){return T(n===`title`?e.title:e.content,{accordion:this,item:e,index:t,type:n,active:r})}syncActiveNames(e,n=this.state.items){(0,t.flushSync)(()=>{this.state.activeNames=e,this.state.current=er(e,n)})}bindEvents(){this.unbindEvents(),this.dom.root&&(this.cleanup.events.on(`click`,this.dom.root,`click`,e=>{if(!(e.target instanceof Element))return;let t=e.target.closest(`[data-accordion-header]`);!t||!this.dom.root?.contains(t)||this.activate(t.dataset.accordionHeader)}),this.cleanup.events.on(`keydown`,this.dom.root,`keydown`,e=>{if(!(e instanceof KeyboardEvent)||e.key!==`Enter`&&e.key!==` `||!(e.target instanceof Element))return;let t=e.target.closest(`[data-accordion-header]`);!t||!this.dom.root?.contains(t)||(e.preventDefault(),this.activate(t.dataset.accordionHeader))}))}unbindEvents(){this.cleanup.events.clear()}isActive(e){return this.state.activeNames.includes(e)}getIndex(e){return typeof e==`number`?e:typeof e==`string`?this.dom.headers.findIndex(t=>t.dataset.accordionHeader===e):-1}async activate(e){this.assertActive(`activate`),this.assertBuilt(`activate`);let t=this.getIndex(e);if(t<0||t>=this.dom.headers.length)return;let n=this.dom.headers[t],r=this.dom.panels[t],i=n.dataset.accordionHeader||String(t),a=this.isActive(i);if(a&&!this.props.multiple&&!this.props.collapsible)return;let o;if(this.props.multiple)if(a){let e=this.state.activeNames.filter(e=>e!==i);o=!this.props.collapsible&&e.length===0?this.state.activeNames:e}else o=[...this.state.activeNames,i];else o=a?this.props.collapsible?[]:this.state.activeNames:[i];this.syncActiveNames(o),this.props.onChange&&await Promise.resolve(this.props.onChange(t,i,n,r,this))}build(){if(this.assertActive(`build`),this.runtime.built)return this;this.runtime.built=!0;try{this.init(this.props)}catch(e){throw this.runtime.built=!1,this.destroy(),e}return this}normalizeStatePatch(e){return{...e,...Object.hasOwn(e,`items`)?{items:Xn(e.items)}:{}}}assertActive(e){if(this.runtime.destroyed)throw Error(`Accordion.${e}: instance has been destroyed.`)}assertBuilt(e){if(!this.runtime.built)throw Error(`Accordion.${e}: call build() first.`)}onDestroy(){this.unbindEvents(),this.itemsDispose?.(),this.bindingsDispose?.(),this.itemsDispose=null,this.bindingsDispose=null,this.dom.root?.parentNode&&this.dom.root.parentNode.removeChild(this.dom.root),this.runtime.built=!1}};function nr(e){return new tr(e)}let rr={form:`j-form`,vertical:`is-vertical`,horizontal:`is-horizontal`,itemVertical:`is-item-vertical`,itemHorizontal:`is-item-horizontal`,item:`form-item`,label:`item-label`,required:`is-required`,control:`form-control`,helpInvalid:`is-invalid`,buttons:`form-buttons`,button:`j-button`,input:`j-input`,textarea:`j-textarea`,select:`j-select`,radio:`j-radio`,checkbox:`j-checkbox`,choiceVertical:`is-vertical`,choiceHorizontal:`is-horizontal`,choiceGroup:`is-group`,radioLabel:`radio-label`,radioText:`radio-text`,switch:`j-switch`,switchDefault:`is-default`,switchSizeMd:`is-md`,switchSlider:`switch-slider`},ir=[{type:`submit`,text:`Submit`,theme:`primary`,action:`submit`},{type:`reset`,text:`Reset`,theme:`ghost`,action:`reset`}],ar={id:{default:null,types:[`string`,`null`],normalize:e=>typeof e==`string`?e.trim()?e.trim():c():e??c()},vertical:{default:!0,type:`boolean`},itemVertical:{default:!0,type:`boolean`},style:{default:``,types:[`string`,`object`,`null`]},fields:{default:[],type:`array`},buttons:{default:ir,types:[`boolean`,`array`],normalize:e=>e===!1?[]:e===!0?cr(ir):Array.isArray(e)?cr(e):e},className:{default:rr,type:`object`,normalize:e=>dr(e)},validator:{default:{},type:`object`},onSubmit:{default:null,types:[`function`,`null`]},onReset:{default:null,types:[`function`,`null`]}};function or(e){return Array.isArray(e)?e.map(e=>e&&typeof e==`object`?{...e}:e):[]}function sr(e){return Array.isArray(e)?e.map(e=>({...e,options:or(e.options)})):[]}function cr(e){return Array.isArray(e)?e.map(e=>({...e})):[]}function lr(e){return e&&typeof e==`object`?e:{value:e,text:String(e)}}function W(e){return e==null?``:typeof e==`string`?e:typeof e==`number`||typeof e==`boolean`?String(e):e.name}function ur(e,t){return e.name?!!e.required||!!t?.[e.name]?.required:!!e.required}function dr(e){return{...rr,..._(e)?e:{}}}function fr(e,t){if(e.removeAttribute(`style`),!t)return;if(typeof t==`string`){e.style.cssText=t;return}if(!_(t))return;let n=t;for(let[t,r]of Object.entries(n)){if(r==null||typeof r!=`string`&&typeof r!=`number`)continue;let n=t.startsWith(`--`)?t:t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`);e.style.setProperty(n,String(r))}}function pr(e){let t=_(e)?e:{};return{...t,rules:_(t.rules)?t.rules:{},messages:_(t.messages)?t.messages:{}}}function mr(e){let t=S(e,ar,`Form.props`);return{...t,id:String(t.id),vertical:!!t.vertical,itemVertical:!!t.itemVertical,style:t.style,fields:sr(t.fields),buttons:cr(t.buttons),className:dr(t.className),validator:pr(t.validator),onSubmit:t.onSubmit,onReset:t.onReset}}var hr=class extends U{validator;cache;constructor(e={}){let n=mr(e);super(n),this.dom.fields=new Map,this.validator=null,this.cleanup.view=null,this.cache={initial:this.cloneProps(n),fieldIds:new Map},this.state=(0,t.createDeepStore)({...this.cloneProps(n),submitting:!1,data:null})}get root(){return this.dom?.root||null}set root(e){this.dom.root=e}build(){if(this.runtime.destroyed)throw Error(`Form.build: instance destroyed`);if(this.cleanup.view)return this;this.init(this.props);let e=document.createElement(`div`);return this.cleanup.view=(0,t.createRoot)(n=>((0,t.onCleanup)((0,t.render)(()=>this.view(),e)),n)),this}view(){let e=this.state.className;return(0,t.jsx)(`form`,{className:()=>V(this.state.className.form,this.state.vertical?e.vertical:e.horizontal,this.state.itemVertical?e.itemVertical:e.itemHorizontal),id:()=>this.state.id,style:()=>this.state.style,"data-form":`root`,"data-form-layout":()=>this.state.vertical?`vertical`:`horizontal`,"data-form-item-layout":()=>this.state.itemVertical?`vertical`:`horizontal`,ref:e=>{let t=this.root!==e;this.root=e,fr(e,this.state.style),(t||!this.validator)&&this.syncValidator()},onSubmit:e=>this.handleSubmit(e),onReset:e=>this.handleReset(e),children:()=>[...this.state.fields.map((e,t)=>this.fieldView(e,t)),this.buttonsView()]})}fieldView(e,n){let r=this.resolveFieldId(e,n),i=e.type===`hidden`,a=this.state.className;return(0,t.jsx)(`div`,{className:a.item,"data-form-item":e.name||String(n),style:{display:i?`none`:``},children:[this.labelView(e,r),(0,t.jsx)(`div`,{className:a.control,"data-form-control":e.name||String(n),children:[this.controlView(e,r,n),e.help?(0,t.jsx)(`div`,{className:`help-block`,"data-form-help":e.name||String(n),children:e.help}):null]})]})}labelView(e,n){if(e.label===!1||e.label===void 0)return null;let r=this.state.className;return(0,t.jsx)(`label`,{className:V(r.label,ur(e,this.state.validator?.rules)?r.required:``),"data-form-label":e.name||n,for:n,children:e.label})}controlView(e,t,n){switch(e.type){case`textarea`:return this.textareaView(e,t);case`select`:return this.selectView(e,t);case`radio`:return this.choiceGroupView(e,t,`radio`);case`checkbox`:return Array.isArray(e.options)?this.choiceGroupView(e,t,`checkbox`):this.inputView(e,t);case`switch`:return this.switchView(e,t);case`custom`:return Ge(e.content,{form:this,field:e,index:n});default:return this.inputView(e,t)}}inputView(e,n){let r=e.type||`text`;return(0,t.jsx)(`input`,{...this.controlProps(e,n,{type:r,className:e.className||this.state.className.input,autocomplete:e.autocomplete||this.autoComplete(r),value:e.value??``}),checked:e.checked===void 0?void 0:!!e.checked})}textareaView(e,n){return(0,t.jsx)(`textarea`,this.controlProps(e,n,{className:e.className||this.state.className.textarea,autocomplete:e.autocomplete,value:e.value??``}))}selectView(e,n){let r=e.value;return(0,t.jsx)(`select`,this.controlProps(e,n,{className:e.className||this.state.className.select,autocomplete:e.autocomplete||`off`,multiple:!!e.multiple,children:(e.options||[]).map(e=>{let n=lr(e);return(0,t.jsx)(`option`,{value:n.value??``,disabled:!!n.disabled,selected:this.isSelected(r,n.value),children:n.text??n.label??n.value??``})})}))}choiceGroupView(e,n,r){let i=e.vertical?`vertical`:`horizontal`,a=this.state.className;return(0,t.jsx)(`div`,{className:V(r===`radio`?a.radio:a.checkbox,i===`vertical`?a.choiceVertical:a.choiceHorizontal,e.group?a.choiceGroup:``,e.size?`is-${e.size}`:``),"data-form-choice-group":e.name||n,"data-choice-type":r,"data-choice-layout":i,children:(e.options||[]).map((i,o)=>{let s=lr(i),c=`${n}_${o}`;return(0,t.jsx)(`label`,{className:r===`radio`?a.radioLabel:``,"data-form-choice":e.name||n,for:c,children:[(0,t.jsx)(`input`,{type:r,id:c,name:e.name,value:s.value??``,checked:r===`radio`?this.isSelected(e.value,s.value):this.isChecked(e.value,s.value,s.checked),disabled:!!s.disabled||!!e.disabled,required:!!e.required}),(0,t.jsx)(`span`,{className:r===`radio`?a.radioText:``,"data-form-choice-text":``,children:s.text??s.label??s.value??``})]})})})}switchView(e,n){let r=this.state.className;return(0,t.jsx)(`label`,{className:V(r.switch,e.variant?`is-${e.variant}`:r.switchDefault,e.size?`is-${e.size}`:r.switchSizeMd),"data-form-switch":e.name||n,for:n,children:[(0,t.jsx)(`input`,{type:`checkbox`,id:n,name:e.name,value:e.value??`1`,checked:!!e.checked,disabled:!!e.disabled,required:!!e.required}),(0,t.jsx)(`span`,{className:r.switchSlider,"data-form-switch-slider":``})]})}buttonsView(){if(!this.state.buttons.length)return null;let e=this.state.className;return(0,t.jsx)(`div`,{className:e.buttons,"data-form-buttons":``,children:this.state.buttons.map(n=>(0,t.jsx)(`button`,{type:n.type||`button`,className:V(e.button,n.theme?`is-${n.theme}`:``,n.className||``),"data-action":n.action||n.type||`button`,disabled:()=>!!this.state.submitting||!!n.disabled,children:n.text??n.label??``}))})}controlProps(e,t,n){return{...n,name:e.name,id:t,placeholder:e.placeholder||``,required:!!e.required,disabled:!!e.disabled,readonly:!!e.readonly,"data-form-field":e.name||t,ref:t=>{e.name&&this.dom.fields.set(e.name,t)}}}resolveFieldId(e,t){if(e.id)return e.id;let n=e.name||t;return this.cache.fieldIds.has(n)||this.cache.fieldIds.set(n,`${this.state.id}_field_${t}`),this.cache.fieldIds.get(n)||`${this.state.id}_field_${t}`}syncValidator(){if(!this.root)return;let e={...this.state.validator,onSubmit:null};if(this.validator?.dom.root===this.root){this.validator.props=e;return}this.validator?.destroy(),this.validator=An(this.root,e,!1)}validate(){return!this.validator||this.validator.validate()}reset(){return this.validator?.reset(),(0,t.flushSync)(()=>{this.state.data=null}),this}async handleSubmit(e){if(e.preventDefault(),this.state.submitting||!this.validate())return;let n=this.collectData();(0,t.flushSync)(()=>{this.state.submitting=!0,this.state.data=n});try{await Promise.resolve(this.state.onSubmit?.(n,this))}finally{this.runtime.destroyed||(0,t.flushSync)(()=>{this.state.submitting=!1})}}handleReset(e){this.resetValidationState(),(0,t.flushSync)(()=>{this.state.data=null}),this.state.onReset?.(e,this)}resetValidationState(){if(this.root){for(let e of Array.from(this.root.elements))e.classList.remove(`is-valid`),e.classList.remove(`is-invalid`);for(let e of k(`[data-form-help], [data-validator-help]`,this.root))(e.dataset.validatorHelp||e.classList.contains(`is-invalid`))&&e.remove()}}collectData(){return this.root?this.collectFormData(this.root):{}}collectFormData(e){let t={},n=new FormData(e);for(let[e,r]of n.entries())Object.hasOwn(t,e)?t[e]=Array.isArray(t[e])?[...t[e],r]:[t[e],r]:t[e]=r;return t}requestSubmit(){if(!this.root)return this;if(typeof this.root.requestSubmit==`function`)return this.root.requestSubmit(),this;let e=new Event(`submit`,{bubbles:!0,cancelable:!0});return this.root.dispatchEvent(e),this}setFields(e){return x(`fields`,e,`array`,`Form.setFields`),this.cache.fieldIds.clear(),(0,t.flushSync)(()=>{this.state.fields=sr(e)}),this}resetFields(){return this.setFields(this.cache.initial.fields)}cloneProps(e){return{...e,fields:sr(e.fields),buttons:cr(e.buttons),className:dr(e.className),validator:pr(e.validator)}}autoComplete(e){switch(e){case`password`:return`current-password`;case`email`:return`email`;default:return`on`}}isSelected(e,t){return Array.isArray(e)?e.map(e=>W(e)).includes(W(t)):e==t}isChecked(e,t,n){return n===void 0?Array.isArray(e)?e.map(e=>W(e)).includes(W(t)):typeof e!=`string`&&typeof e!=`boolean`&&!(e instanceof File)?!1:e===!0||W(e)===W(t):!!n}onDestroy(){let e=this.cleanup.view;typeof e==`function`&&e(),this.cleanup.view=null,this.validator?.destroy(),this.validator=null}};function gr(e={}){return new hr(e)}let G={root:`j-flow`,header:`flow-header`,steps:`flow-steps`,step:`flow-step`,active:`is-active`,complete:`is-complete`,stepButton:`flow-step-button`,stepIndex:`flow-step-index`,stepTitle:`flow-step-title`,body:`flow-body`,footer:`flow-footer`,button:`j-button`,reset:`is-ghost flow-reset`,back:`is-ghost flow-back`,next:`is-primary flow-next`};function _r(e){return e==null||e===!1||typeof e==`function`}function K(e){return _(e)?{...e}:{}}function vr(e){return Array.isArray(e)?[...e]:[]}function yr(e){return Array.isArray(e)?e.map(e=>{let t={...e};return delete t.description,delete t.view,{...t,data:K(t.data),modal:typeof t.modal==`function`||t.modal==null?t.modal:K(t.modal)}}):[]}function br(e,t){if(typeof e==`string`)return{id:e};if(_(e)){let n=e;if(typeof n.id!=`string`)return{id:t};let r=_(n.data)||n.data==null?n.data:void 0;return{id:n.id,data:r}}return{id:t}}function xr(e){if(typeof e==`string`){let t=e.trim();return{...G,root:t?`${G.root} ${t}`:G.root}}return{...G,..._(e)?e:{}}}function Sr(...e){return e.filter(Boolean).join(` `)}let Cr={type:`plainObject`,shape:{id:{type:`string`,nonEmpty:!0}}},wr={type:`renderable`},Tr={type:`array`,nonEmpty:!0},q={types:[`plainObject`,`null`,`undefined`]},Er={validate:_r,message:`expects function, false or null.`},Dr={default:{},type:`plainObject`,normalize:e=>{let t=_(e)?e:{};return{...Object.fromEntries(Object.entries(t).filter(([,e])=>typeof e==`string`)),back:typeof t.back==`string`?t.back:`Back`,next:typeof t.next==`string`?t.next:`Next`,finish:typeof t.finish==`string`?t.finish:`Finish`,reset:typeof t.reset==`string`?t.reset:`Reset`}}},Or={id:{default:null,types:[`string`,`null`],normalize:e=>typeof e==`string`?e.trim()||c():e??c()},steps:{default:[],...Tr},initial:{default:null,types:[`string`,`number`,`null`]},cache:{default:!0,type:`boolean`},linear:{default:!0,type:`boolean`},render:{default:!0,type:`boolean`},rollbackOnError:{default:!0,type:`boolean`},busyStrategy:{default:`ignore`,type:`string`,enum:[`ignore`,`throw`]},showBack:{default:!0,type:`boolean`},showNext:{default:!0,type:`boolean`},showReset:{default:!1,type:`boolean`},text:Dr,className:{default:G,types:[`object`,`string`],normalize:xr},renderHeader:{default:null,...Er},renderBody:{default:null,...Er},renderFooter:{default:null,...Er},onChange:{default:null,types:[`function`,`null`]},onNext:{default:null,types:[`function`,`null`]},onBack:{default:null,types:[`function`,`null`]},onFinish:{default:null,types:[`function`,`null`]},onError:{default:null,types:[`function`,`null`]},onBusy:{default:null,types:[`function`,`null`]}};function kr(e){let t=S(e,Or,`Flow.props`);return{id:t.id,steps:yr(t.steps),initial:t.initial,cache:t.cache,linear:t.linear,render:t.render,rollbackOnError:t.rollbackOnError,busyStrategy:t.busyStrategy,showBack:t.showBack,showNext:t.showNext,showReset:t.showReset,text:t.text,className:t.className,renderHeader:t.renderHeader,renderBody:t.renderBody,renderFooter:t.renderFooter,onChange:t.onChange,onNext:t.onNext,onBack:t.onBack,onFinish:t.onFinish,onError:t.onError,onBusy:t.onBusy}}var Ar=class{props;steps;state;dom;runtime;stepMap;initialStepId;initialData;subscribers;renderDispose;cleanupTasks;constructor(e={}){this.props=kr(e),this.steps=this.props.steps,this.validateSteps(this.steps),this.stepMap=new Map(this.steps.map((e,t)=>[e.id,t])),this.initialStepId=this.resolveInitialStepId(this.props.initial),this.initialData=this.createInitialStepData(),this.subscribers=new Set,this.renderDispose=null,this.cleanupTasks=new Set,this.dom={root:null,header:null,body:null,footer:null},this.runtime={built:!1,destroyed:!1,activeAction:null,actionController:null},this.state=(0,t.createDeepStore)({id:this.props.id,currentId:this.initialStepId,currentIndex:this.stepMap.get(this.initialStepId)??0,previousId:null,previousIndex:null,direction:null,history:[this.initialStepId],data:K(this.initialData.global),stepData:K(this.initialData.stepData),loading:!1,error:null,busyAction:null,version:0})}get currentStep(){return this.steps[this.state.currentIndex]}get currentData(){return this.getStepData(this.state.currentId)}get canBack(){return this.state.currentIndex>0&&!this.state.loading}get canNext(){return this.state.currentIndex<this.steps.length-1&&!this.state.loading}get isLast(){return this.state.currentIndex===this.steps.length-1}subscribe(e){if(this.assertActive(`subscribe`),typeof e!=`function`)throw Error(`Flow.subscribe: handler expects a function.`);return this.subscribers.add(e),e(this.snapshot(),this,null),()=>this.subscribers.delete(e)}snapshot(){let e=this.currentStep;return{id:this.state.id,currentId:this.state.currentId,currentIndex:this.state.currentIndex,previousId:this.state.previousId,previousIndex:this.state.previousIndex,direction:this.state.direction,history:[...this.state.history],data:K(this.state.data),stepData:K(this.state.stepData),currentData:this.currentData,currentStep:this.publicStep(e),canBack:this.canBack,canNext:this.canNext,isLast:this.isLast,loading:this.state.loading,busyAction:this.state.busyAction,error:this.state.error}}build(){return this.assertActive(`build`),this.runtime.built||(this.runtime.built=!0,!this.props.render)?this:(this.dom.root=this.buildRoot(),this.mountView(),this)}teardownView(){this.renderDispose?.(),this.renderDispose=null,this.dom.root?.remove(),this.dom.root=null,this.dom.header=null,this.dom.body=null,this.dom.footer=null,this.runtime.built=!1}async next(e=null){return this.assertActive(`next`),x(`payload`,e,q,`Flow.next`),this.handleBusy(`next`)||this.runAction(`next`,async()=>{if(this.isLast)return this.finish(e,{internal:!0});let t=this.currentStep,n=this.steps[this.state.currentIndex+1]?.id,{id:r,data:i}=br(await this.runMoveHook(`next`,t,e,n),n);return this.goTo(r,i??e,{direction:`next`,internal:!0})})}async back(e=null){return this.assertActive(`back`),x(`payload`,e,q,`Flow.back`),this.handleBusy(`back`)||(this.canBack?this.runAction(`back`,async()=>{let t=this.currentStep,n=this.steps[this.state.currentIndex-1]?.id,{id:r,data:i}=br(await this.runMoveHook(`back`,t,e,n),n);return this.goTo(r,i??e,{direction:`back`,internal:!0})}):this.snapshot())}async goTo(e,t=null,n={}){return this.assertActive(`goTo`),x(`payload`,t,q,`Flow.goTo`),(n.internal?null:this.handleBusy(`goTo`))||this.runAction(`goTo`,async()=>{let r=this.resolveStepIndex(e),i=this.steps[r],a=this.currentStep;return!i||i.id===this.state.currentId?(t&&this.setStepData(this.state.currentId,t),this.snapshot()):(await this.transitionTo(i,{direction:n.direction||`go`,payload:t,fromStep:a}),this.snapshot())},{internal:n.internal})}setData(e){return this.assertActive(`setData`),x(`data`,e,q,`Flow.setData`),e?((0,t.flushSync)(()=>{Object.assign(this.state.data,e),this.state.version+=1}),this.emitChange(),this):this}setStepData(e,n,r={}){return this.assertActive(`setStepData`),x(`stepId`,e,{type:`string`},`Flow.setStepData`),x(`data`,n,q,`Flow.setStepData`),!n||!this.stepMap.has(e)?this:((0,t.flushSync)(()=>{this.state.stepData[e]={...K(this.state.stepData[e]),...n},this.props.cache&&Object.assign(this.state.data,n),this.state.version+=1}),r.silent||this.emitChange(),this)}getStepData(e){return K(this.state.stepData[e])}reset(){return this.assertActive(`reset`),(0,t.flushSync)(()=>{this.state.currentId=this.initialStepId,this.state.currentIndex=this.stepMap.get(this.initialStepId)??0,this.state.previousId=null,this.state.previousIndex=null,this.state.direction=null,this.state.history.splice(0,this.state.history.length,this.initialStepId),this.replaceObject(this.state.data,K(this.initialData.global)),this.replaceObject(this.state.stepData,K(this.initialData.stepData)),this.state.loading=!1,this.state.busyAction=null,this.state.error=null,this.state.version+=1}),this.emitChange(),this}async finish(e=null,t={}){return this.assertActive(`finish`),x(`payload`,e,q,`Flow.finish`),(t.internal?null:this.handleBusy(`finish`))||this.runAction(`finish`,async()=>(e&&this.setStepData(this.state.currentId,e),await this.callHook(this.props.onFinish,[this.snapshot(),this]),this.snapshot()),{internal:t.internal})}destroy(){if(!this.runtime.destroyed){this.runtime.destroyed=!0,this.abortActiveAction(),this.teardownView();for(let e of Array.from(this.cleanupTasks))e();this.cleanupTasks.clear(),this.subscribers.clear(),this.steps=[],this.stepMap.clear(),this.runtime.activeAction=null,this.runtime.actionController=null}}resolveInitialStepId(e){if(typeof e==`number`){let t=this.steps[e];if(!t)throw Error(`Flow.props.initial index is out of range.`);return t.id}if(typeof e==`string`){if(!this.stepMap.has(e))throw Error(`Flow.props.initial step "${e}" does not exist.`);return e}return this.steps[0].id}validateSteps(e){let t=new Set;for(let[n,r]of e.entries()){if(x(String(n),r,Cr,`Flow.props.steps`),x(`content`,r.content??null,wr,`Flow.props.steps.${n}`),t.has(r.id))throw Error(`Flow.props.steps: duplicated step id "${r.id}".`);t.add(r.id)}}resolveStepIndex(e){if(typeof e==`number`){if(!this.steps[e])throw Error(`Flow.goTo target is out of range.`);return e}if(typeof e==`string`){let t=this.stepMap.get(e);if(t==null)throw Error(`Flow.goTo target "${e}" does not exist.`);return t}throw Error(`Flow.goTo target expects string or number.`)}createInitialStepData(){let e={},t={};for(let n of this.steps)e[n.id]=K(n.data),Object.assign(t,e[n.id]);return{stepData:e,global:t}}async runMoveHook(e,t,n,r){let i=e===`back`?this.props.onBack:this.props.onNext,a=e===`back`?t.onBack:t.onNext,o=this.createContext({payload:n,targetId:r});if(typeof a==`function`){let e=await this.callHook(a,[o]);if(e!=null)return e}if(typeof i==`function`){let e=await this.callHook(i,[o]);if(e!=null)return e}return r}async transitionTo(e,{direction:n,payload:r,fromStep:i}){let a=this.snapshot(),o=this.captureState();try{r&&this.setStepData(i.id,r,{silent:!0}),await this.assertCanLeave(i,e,n),await this.assertCanEnter(e,i,n),typeof i.onLeave==`function`&&await this.callHook(i.onLeave,[this.createContext({direction:n,step:i,targetId:e.id})]);let o=this.state.currentId,s=this.state.currentIndex,c=this.stepMap.get(e.id)??0;(0,t.flushSync)(()=>{this.state.previousId=o,this.state.previousIndex=s,this.state.currentId=e.id,this.state.currentIndex=c,this.state.direction=n,n===`back`?this.state.history.pop():this.state.history.push(e.id),this.state.error=null,this.state.version+=1}),typeof e.onEnter==`function`&&await this.callHook(e.onEnter,[this.createContext({direction:n,fromId:o,step:e})]),this.emitChange(a)}catch(e){throw this.runtime.destroyed?e:(this.props.rollbackOnError&&this.restoreState(o,{keepLoading:!0}),this.handleError(e,a),e)}}async assertCanLeave(e,t,n){if(typeof e.canLeave==`function`&&await this.callHook(e.canLeave,[this.createContext({direction:n,targetId:t.id})])===!1)throw Error(`Flow: step "${e.id}" blocked leaving.`)}async assertCanEnter(e,t,n){if(typeof e.canEnter==`function`&&await this.callHook(e.canEnter,[this.createContext({direction:n,fromId:t.id})])===!1)throw Error(`Flow: step "${e.id}" blocked entering.`)}createContext(e={}){let t=e.step||this.currentStep,n=this.snapshot();return{...e,flow:this,step:t,state:this.state,signal:this.runtime.actionController?.signal||null,snapshot:n,data:K(this.state.data),currentData:this.getStepData(t.id),setData:e=>this.setData(e),setStepData:(e,t)=>this.setStepData(e,t),getStepData:e=>this.getStepData(e),next:e=>this.next(e),back:e=>this.back(e),goTo:(e,t,n)=>this.goTo(e,t,n),addCleanup:e=>this.addCleanup(e)}}async runAction(e,t,n={}){let r=!n.internal&&!this.state.loading;r&&(this.runtime.actionController=typeof AbortController<`u`?new AbortController:null,this.runtime.activeAction=e,this.setLoading(!0,e));try{return await t()}catch(e){if(this.runtime.destroyed)return null;throw this.state.error!==e&&this.handleError(e),e}finally{r&&!this.runtime.destroyed&&(this.setLoading(!1,null),this.runtime.activeAction=null,this.runtime.actionController=null)}}handleBusy(e){if(!this.state.loading)return null;let t=Error(`Flow: action "${e}" ignored while loading.`);if(t.code=`FLOW_BUSY`,typeof this.props.onBusy==`function`&&this.props.onBusy(e,this.snapshot(),this),this.props.busyStrategy===`throw`)throw t;return this.snapshot()}abortActiveAction(){this.runtime.actionController?.abort(),this.runtime.actionController=null,this.runtime.activeAction=null}async callHook(e,t){if(typeof e!=`function`)return;let n=await e(...t);if(this.runtime.destroyed)throw this.createAbortError();return n}createAbortError(){let e=Error(`Flow: active action was aborted.`);return e.code=`FLOW_ABORTED`,e}setLoading(e,n=this.state.busyAction){let r=this.snapshot(),i=e?n:null;(this.state.loading!==e||this.state.busyAction!==i)&&((0,t.flushSync)(()=>{this.state.loading=e,this.state.busyAction=i,this.state.version+=1}),this.emitChange(r))}handleError(e,n=null){(0,t.flushSync)(()=>{this.state.error=e,this.state.version+=1}),typeof this.props.onError==`function`&&this.props.onError(e,this.snapshot(),this,n)}emitChange(e=null){let t=this.snapshot();for(let n of Array.from(this.subscribers))n(t,this,e);typeof this.props.onChange==`function`&&this.props.onChange(t,this,e)}replaceObject(e,t){for(let t of Object.keys(e))delete e[t];Object.assign(e,t)}captureState(){return{currentId:this.state.currentId,currentIndex:this.state.currentIndex,previousId:this.state.previousId,previousIndex:this.state.previousIndex,direction:this.state.direction,history:vr(this.state.history),data:K(this.state.data),stepData:K(this.state.stepData),loading:this.state.loading,busyAction:this.state.busyAction,error:this.state.error,version:this.state.version}}restoreState(e,n={}){(0,t.flushSync)(()=>{this.state.currentId=e.currentId,this.state.currentIndex=e.currentIndex,this.state.previousId=e.previousId,this.state.previousIndex=e.previousIndex,this.state.direction=e.direction,this.state.history.splice(0,this.state.history.length,...e.history),this.replaceObject(this.state.data,e.data),this.replaceObject(this.state.stepData,e.stepData),this.state.loading=n.keepLoading?!0:e.loading,this.state.busyAction=e.busyAction,this.state.error=e.error,this.state.version=e.version+1})}addCleanup(e){if(typeof e!=`function`)throw Error(`Flow.addCleanup: cleanup expects a function.`);return this.runtime.destroyed?(e(),()=>{}):(this.cleanupTasks.add(e),()=>this.cleanupTasks.delete(e))}assertActive(e){if(this.runtime.destroyed)throw Error(`Flow.${e}: instance has been destroyed.`)}publicStep(e){if(!e)return null;let{onEnter:t,onLeave:n,onNext:r,onBack:i,canEnter:a,canLeave:o,...s}=e;return s}buildRoot(){return(0,t.jsx)(`div`,{className:this.props.className.root,id:this.props.id,role:`group`,"data-flow":`root`,"aria-busy":()=>this.state.loading?`true`:`false`})}mountView(){this.renderDispose||!this.dom.root||(this.renderDispose=(0,t.createRoot)(e=>((0,t.onCleanup)((0,t.render)(()=>this.view(),this.dom.root)),e)))}view(){let e=this.snapshot();return[this.headerView(e),this.bodyView(e),this.footerView(e)]}renderSlot(e,t,n){let r=this.props[e];return r===!1?null:typeof r==`function`?r(this.createRenderContext(t,n)):n()}createRenderContext(e,t){return{flow:this,snapshot:e,state:this.state,steps:this.steps.map(e=>this.publicStep(e)),currentStep:e.currentStep,currentData:e.currentData,data:e.data,fallback:t,next:e=>this.next(e),back:e=>this.back(e),goTo:(e,t,n)=>this.goTo(e,t,n),reset:()=>this.reset()}}headerView(e){return(0,t.jsx)(`div`,{className:this.props.className.header,"data-flow-header":``,ref:e=>{this.dom.header=e},children:this.renderSlot(`renderHeader`,e,()=>this.stepsView(e))})}stepsView(e){return(0,t.jsx)(`ol`,{className:this.props.className.steps,"data-flow-steps":``,role:`list`,"aria-label":`Flow steps`,children:this.steps.map((n,r)=>(0,t.jsx)(`li`,{className:this.stepClass(r,e.currentIndex),"data-flow-step":n.id,"data-flow-step-index":String(r),"aria-current":r===e.currentIndex?`step`:void 0,children:[(0,t.jsx)(`button`,{type:`button`,className:this.props.className.stepButton,disabled:this.props.linear&&r>e.currentIndex,"aria-current":r===e.currentIndex?`step`:void 0,"aria-disabled":this.props.linear&&r>e.currentIndex?`true`:`false`,"aria-label":`${r+1}. ${n.title||n.id}`,"data-flow-step-action":`goTo`,onClick:()=>{r!==e.currentIndex&&this.goTo(r)},children:[(0,t.jsx)(`span`,{className:this.props.className.stepIndex,"data-flow-step-number":``,children:r+1}),(0,t.jsx)(`span`,{className:this.props.className.stepTitle,"data-flow-step-title":``,children:n.title||n.id})]})]}))})}bodyView(e){return(0,t.jsx)(`div`,{className:this.props.className.body,"data-flow-body":``,role:`region`,"aria-live":`polite`,"aria-busy":e.loading?`true`:`false`,ref:e=>{this.dom.body=e},children:this.renderSlot(`renderBody`,e,()=>this.contentView(this.currentStep.content))})}footerView(e){return(0,t.jsx)(`div`,{className:this.props.className.footer,"data-flow-footer":``,ref:e=>{this.dom.footer=e},children:this.renderSlot(`renderFooter`,e,()=>[this.props.showReset?(0,t.jsx)(`button`,{type:`button`,className:Sr(this.props.className.button,this.props.className.reset),"data-action":`reset`,onClick:()=>this.reset(),disabled:e.loading,"aria-disabled":e.loading?`true`:`false`,children:this.props.text.reset}):null,this.props.showBack?(0,t.jsx)(`button`,{type:`button`,className:Sr(this.props.className.button,this.props.className.back),"data-action":`back`,onClick:()=>void this.back(),disabled:!e.canBack,"aria-disabled":e.canBack?`false`:`true`,children:this.props.text.back}):null,this.props.showNext?(0,t.jsx)(`button`,{type:`button`,className:Sr(this.props.className.button,this.props.className.next),"data-action":`next`,onClick:()=>void this.next(),disabled:e.loading,"aria-disabled":e.loading?`true`:`false`,children:e.isLast?this.props.text.finish:this.props.text.next}):null])})}contentView(e){return typeof e==`function`?e(this.createContext()):e??``}stepClass(e,t=this.state.currentIndex){return Sr(this.props.className.step,e===t&&this.props.className.active,e<t&&this.props.className.complete)}};function jr(e={}){return new Ar(e)}let Mr={layout:`j-popup-layout`,modal:`j-modal`,header:`modal-header`,body:`modal-body`,footer:`modal-footer`,title:`modal-title`,button:`j-button`,closeBtn:`is-icon is-sm is-ghost`,cancelBtn:`is-ghost`,confirmBtn:`is-primary`};function J(e){return Array.isArray(e)?e.map(e=>({...e,options:Array.isArray(e.options)?e.options.map(e=>e&&typeof e==`object`?{...e}:e):e.options})):[]}function Nr(e){return{...e,fields:Array.isArray(e.fields)?J(e.fields):null,text:{...e.text},className:{...e.className}}}function Pr(e){return{mode:e.mode,content:e.content,fields:Array.isArray(e.fields)?J(e.fields):null,loading:!1,processing:!1,visible:!1,data:null,extraData:null}}function Fr(e,t){return!t||typeof t!=`object`?e:Object.assign(e,t)}let Ir={type:`renderable`},Lr={default:{},type:`object`,plain:!0,normalize:e=>{let t=_(e)?e:{};return{...t,title:typeof t.title==`string`?t.title:`Tip`,confirm:typeof t.confirm==`string`?t.confirm:`Confirm`,cancel:typeof t.cancel==`string`?t.cancel:`Cancel`}}},Rr={types:[`array`,`null`]},zr={mode:{default:null,types:[`string`,`null`],enum:[`content`,`form`,null],normalize:(e,t)=>e??(Array.isArray(t.options.fields)?`form`:`content`)},content:{default:``,...Ir},position:{default:`center`,type:`string`},showCancel:{default:!0,type:`boolean`},showClose:{default:!0,type:`boolean`},fullscreen:{default:!1,type:`boolean`},text:Lr,onShow:{default:null,types:[`function`,`null`]},onShown:{default:null,types:[`function`,`null`]},onHide:{default:null,types:[`function`,`null`]},onHidden:{default:null,types:[`function`,`null`]},onConfirm:{default:null,types:[`function`,`null`]},onSubmit:{default:null,types:[`function`,`null`]},onCancel:{default:null,types:[`function`,`null`]},fields:{default:null,...Rr},header:{default:!0,type:`boolean`},footer:{default:!0,type:`boolean`},id:{default:null,types:[`string`,`null`],normalize:e=>typeof e==`string`?e.trim()||c():e??c()},escClose:{default:!1,type:`boolean`},bgClose:{default:!1,type:`boolean`},className:{default:Mr,type:`object`,normalize:e=>({...Mr,...e&&typeof e==`object`?e:{}})}},Br={mode:{type:`string`,enum:[`content`,`form`]},content:zr.content,fields:zr.fields,loading:{default:!1,type:`boolean`},processing:{default:!1,type:`boolean`},visible:{default:!1,type:`boolean`},data:{default:null,types:[`object`,`null`]},extraData:{default:null,types:[`object`,`null`]}},Vr={type:`plainObject`};function Hr(e){let t=S(e,zr,`Modal`);return{mode:t.mode,content:t.content,position:t.position,showCancel:t.showCancel,showClose:t.showClose,fullscreen:t.fullscreen,text:t.text,onShow:t.onShow,onShown:t.onShown,onHide:t.onHide,onHidden:t.onHidden,onConfirm:t.onConfirm,onSubmit:t.onSubmit,onCancel:t.onCancel,fields:Array.isArray(t.fields)?J(t.fields):null,header:t.header,footer:t.footer,id:t.id,escClose:t.escClose,bgClose:t.bgClose,className:t.className}}let Y=0,Ur=``;var Wr=class extends U{constructor(e={}){let n=Hr(e);super(n),this.dom.modal=null,this.dom.header=null,this.dom.body=null,this.dom.footer=null,this.dom.form=null,this.dom.formContainer=null,this.cleanup.visibility=null,this.cleanup.view=null,this.cleanup.hideTimer=null,this.runtime.scrollLocked=!1,this.runtime.visibleApplied=!1,this.cache={initial:Nr(this.props),fieldIds:new Map,previousActiveElement:null,formId:`${this.props.id}_form`},this.state=(0,t.createDeepStore)(Pr(this.props)),this.init(n)}onInit(){this.bindReactiveVisibility()}build(){if(this.assertActive(`build`),this.dom.root instanceof HTMLElement)return this;let{id:e,className:n}=this.props,r=(0,t.jsx)(`div`,{className:()=>V(this.props.className.modal,this.props.fullscreen&&`is-fullscreen`),id:e,role:`document`,"data-modal-dialog":e,ref:e=>{this.dom.modal=e},children:[(0,t.jsx)(`div`,{className:n.header,style:{display:this.props.header?``:`none`},ref:e=>{this.dom.header=e}}),(0,t.jsx)(`div`,{className:n.body,ref:e=>{this.dom.body=e}}),(0,t.jsx)(`div`,{className:n.footer,style:{display:this.props.footer?``:`none`},ref:e=>{this.dom.footer=e}})]}),i=Lt({className:n.layout,position:this.props.position,component:`modal`,labelledby:this.props.header?`${e}_title`:``,content:r});return this.props.header||i.setAttribute(`aria-label`,this.props.text.title||`Modal`),this.dom.root=i,this.mountView(),this}mountView(){this.cleanup.view||!this.dom.body||(this.cleanup.view=(0,t.createRoot)(e=>(this.dom.header&&(0,t.onCleanup)((0,t.render)(()=>this.headerView(),this.dom.header)),this.dom.body&&(0,t.onCleanup)((0,t.render)(()=>this.bodyView(),this.dom.body)),this.dom.footer&&(0,t.onCleanup)((0,t.render)(()=>this.footerView(),this.dom.footer)),this.bindReactiveLoading(),e)))}headerView(){return()=>this.props.header?[(0,t.jsx)(`div`,{className:this.props.className.title,id:`${this.props.id}_title`,"aria-label":this.props.text.title,children:this.props.text.title}),this.props.showClose?(0,t.jsx)(`button`,{type:`button`,className:V(this.props.className.button,this.props.className.closeBtn),"data-action":`close`,"aria-label":(0,n.t)(`Close`,H),children:z(`close`)}):null]:null}footerView(){return()=>this.props.footer?[this.props.showCancel?(0,t.jsx)(`button`,{type:`button`,className:V(this.props.className.button,this.props.className.cancelBtn),"data-action":`cancel`,disabled:()=>this.isBusy(),children:this.props.text.cancel}):null,(0,t.jsx)(`button`,{type:()=>this.state.mode===`form`?`submit`:`button`,className:V(this.props.className.button,this.props.className.confirmBtn),"data-action":()=>this.state.mode===`form`?`submit`:`confirm`,disabled:()=>this.isBusy(),children:this.props.text.confirm})]:null}bodyView(){return this.state.mode===`form`?this.formView():(this.destroyForm(),this.contentView(this.state.content))}formView(){return(0,t.jsx)(`div`,{ref:e=>{this.mountForm(e)}})}mountForm(e){if(!e)return;this.dom.formContainer=e;let t=this.createFormProps();if(this.dom.form){this.dom.form.setFields(t.fields||[]),this.dom.form.dom.root&&!e.contains(this.dom.form.dom.root)&&e.appendChild(this.dom.form.dom.root);return}this.dom.form=gr(t).build(),this.dom.form.dom.root&&e.appendChild(this.dom.form.dom.root)}createFormProps(){return{id:this.cache.formId,fields:this.state.fields||[],buttons:!1,onSubmit:e=>this.handleFormSubmit(e)}}destroyForm(){this.dom.form?.destroy(),this.dom.form=null,this.dom.formContainer=null}contentView(e){return T(e,this)}bindReactiveLoading(){let e=null;(0,t.createEffect)(()=>{this.state.loading&&!e?(e=B(),this.dom.modal?.appendChild(e)):!this.state.loading&&e&&(e.remove(),e=null)}),(0,t.onCleanup)(()=>{e?.remove(),e=null})}isBusy(){return!!(this.state.loading||this.state.processing)}bindReactiveVisibility(){this.cleanup.visibility=(0,t.createRoot)(e=>((0,t.createEffect)(()=>{let e=!!this.state.visible;(0,t.untrack)(()=>this.applyVisibility(e))}),e))}applyVisibility(e){if(e!==this.runtime.visibleApplied){if(e){this.showFromState();return}this.hideFromState()}}showFromState(){if(this.runtime.destroyed)throw Error(`Modal: The current instance has been destroyed.`);if(!this.dom.root)throw Error(`Modal.show: build() must be called before show().`);this.cancelHideTimer(),this.resetAnimationStyles();let{onShow:e,onShown:t}=this.props;e?.(this),this.cache.previousActiveElement=document.activeElement instanceof HTMLElement?document.activeElement:null,this.dom.root&&!this.dom.root.parentNode&&document.body.appendChild(this.dom.root),this.lockScroll(),this.runtime.visibleApplied=!0,this.bindEvents(this.dom.root),this.focusFirst(),t?.(this)}hideFromState(){if(!this.runtime.visibleApplied||!this.dom.root)return;let{onHide:e,onHidden:n}=this.props;e?.(this),this.runtime.visibleApplied=!1,this.clearEvents(),(0,t.flushSync)(()=>{this.state.loading=!1,this.state.extraData=null,this.state.data=null}),this.dom.modal&&(this.dom.modal.style.transition=`opacity 300ms ease-out, transform 300ms ease-out`,this.dom.modal.style.opacity=`0`,this.dom.modal.style.transform=`scale(0.3)`),this.cancelHideTimer(),this.cleanup.hideTimer=setTimeout(()=>this.finishHide(n),300)}bindEvents(e){this.clearEvents(),this.bindOverlayCloseEvent(e),this.bindDocumentKeyEvent(),this.bindInsideEvent()}bindOverlayCloseEvent(e){e&&this.cleanup.events.on(`bg`,e,`click`,t=>{this.props.bgClose&&t.target===e&&this.hide()})}bindDocumentKeyEvent(){this.cleanup.events.on(`keydown`,document,`keydown`,e=>{if(!(!this.state.visible||!(e instanceof KeyboardEvent))){if(e.key===`Escape`&&this.props.escClose){e.preventDefault(),this.hide();return}e.key===`Tab`&&this.trapFocus(e)}})}bindInsideEvent(){this.dom.modal&&this.cleanup.events.on(`inside`,this.dom.modal,`click`,e=>{let t=(e.target instanceof Element?e.target:null)?.closest(`[data-action]`);if(!t||!this.dom.modal?.contains(t))return;let n=t.dataset.action;if(n===`cancel`||n===`close`){this.handleCancel();return}if(n===`submit`){this.requestSubmit();return}if(n===`confirm`){if(this.state.mode===`form`){this.requestSubmit();return}this.handleConfirm()}})}clearEvents(){this.cleanup.events.clear()}requestSubmit(){if(this.state.mode!==`form`||!this.dom.form){this.handleConfirm();return}this.dom.form.requestSubmit()}async handleFormSubmit(e){if(this.isBusy())return;let n=Fr(e,this.state.extraData);(0,t.flushSync)(()=>{this.state.data=n}),await this.handleSubmit(n)}async handleConfirm(){if(!this.isBusy()){(0,t.flushSync)(()=>{this.state.processing=!0});try{await Promise.resolve(this.props.onConfirm?.(this))}catch(e){console.error(`Modal.onConfirm error:`,e)}finally{this.state&&(0,t.flushSync)(()=>{this.state.processing=!1})}}}async handleCancel(){if(!this.isBusy()){(0,t.flushSync)(()=>{this.state.processing=!0});try{await Promise.resolve(this.props.onCancel?.(this)),this.hide()}catch(e){console.error(`Modal.onCancel error:`,e)}finally{this.state&&(0,t.flushSync)(()=>{this.state.processing=!1})}}}async handleSubmit(e){if(this.props.onSubmit){(0,t.flushSync)(()=>{this.state.processing=!0});try{await Promise.resolve(this.props.onSubmit(e,this)),this.state.extraData=null}catch(e){console.error(`Modal.onSubmit error:`,e)}finally{this.state&&(0,t.flushSync)(()=>{this.state.processing=!1})}}}trapFocus(e){if(!this.dom.modal)return;let t=Array.from(k(`a[href], button:not([disabled]):not([data-action=close]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])`,this.dom.modal)).filter(e=>e.offsetParent!==null||e===document.activeElement);if(t.length===0){e.preventDefault(),this.dom.modal.focus();return}let n=t[0],r=t[t.length-1];e.shiftKey&&document.activeElement===n?(e.preventDefault(),r?.focus()):!e.shiftKey&&document.activeElement===r&&(e.preventDefault(),n?.focus())}focusFirst(){if(!this.dom.modal)return;let e=O(`input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]):not([data-action=close]), [tabindex]:not([tabindex="-1"])`,this.dom.form?.root||this.dom.modal);e?e.focus():(this.dom.modal.setAttribute(`tabindex`,`-1`),this.dom.modal.focus())}lockScroll(){this.runtime.scrollLocked||(Y===0&&(Ur=document.body.style.overflow,document.body.style.overflow=`hidden`),Y+=1,this.runtime.scrollLocked=!0)}unlockScroll(){this.runtime.scrollLocked&&(Y=Math.max(0,Y-1),Y===0&&(document.body.style.overflow=Ur,Ur=``),this.runtime.scrollLocked=!1)}cancelHideTimer(){this.cleanup.hideTimer&&(clearTimeout(this.cleanup.hideTimer),this.cleanup.hideTimer=null)}resetAnimationStyles(){this.dom.modal&&(this.dom.modal.style.removeProperty(`transition`),this.dom.modal.style.removeProperty(`opacity`),this.dom.modal.style.removeProperty(`transform`))}finishHide(e){this.cleanup.hideTimer=null,this.dom.root?.remove(),this.resetAnimationStyles(),this.unlockScroll(),this.restoreFocus(),e?.(this)}restoreFocus(){let e=this.cache.previousActiveElement;this.cache.previousActiveElement=null,e&&typeof e.focus==`function`&&document.contains(e)&&e.focus()}assertActive(e){if(this.runtime.destroyed)throw Error(`Modal.${e}: The current instance has been destroyed.`)}normalizeStatePatch(e){let t={...e};return Object.hasOwn(t,`fields`)&&(t.fields=Array.isArray(t.fields)?J(t.fields):null),t}validateStatePatch(e){x(`state`,e,Vr,`Modal.setState`);for(let t of Object.keys(e)){if(!Object.hasOwn(Br,t))throw Error(`Modal.setState: "${t}" is not a supported state key.`);x(t,e[t],Br[t],`Modal.setState`)}}afterSetState(e){Object.hasOwn(e,`fields`)&&this.cache.fieldIds?.clear(),this.state.mode===`form`&&this.dom.form&&this.dom.form.setFields(this.createFormProps().fields||[])}show(){if(this.assertActive(`show`),!this.dom.root)throw Error(`Modal.show: build() must be called before show().`);return this.setState({visible:!0}),this}hide(){return this.assertActive(`hide`),this.setState({visible:!1}),this}reset(){return this.cache.fieldIds?.clear(),this.cache.initial&&this.setState({mode:this.cache.initial.mode,content:this.cache.initial.content,fields:Array.isArray(this.cache.initial.fields)?J(this.cache.initial.fields):null,loading:!1,processing:!1,data:null,extraData:null}),this}onDestroy(){let e=!!this.runtime.visibleApplied,{onHide:t,onHidden:n}=this.props;e&&t?.(this),this.cancelHideTimer(),this.clearEvents(),this.destroyForm(),this.unlockScroll(),this.cleanup.visibility?.(),this.cleanup.visibility=null,this.cleanup.view?.(),this.cleanup.view=null,this.dom.root?.remove(),e&&n?.(this),this.cache={initial:null,fieldIds:null,previousActiveElement:null,formId:``}}destroy(){return this.runtime.destroyed||super.destroy(),this}};function Gr(e={}){return new Wr(e)}let Kr={root:`j-swiper`,wrapper:`swiper-wrapper`,slide:`swiper-slide`,image:`swiper-image`,title:`swiper-slide-title`,pagination:`swiper-pagination`,paginationHorizontal:`is-horizontal`,paginationClickable:`is-clickable`,paginationBulletGroup:`is-bullet`,indicator:`swiper-pagination-indicator`,bullet:`swiper-pagination-bullet`,navigation:`swiper-navigation`,prev:`is-prev`,next:`is-next`,active:`is-active`,disabled:`is-disabled`,loading:`loading`,loaded:`loaded`,error:`error`},qr={id:{default:null,types:[`string`,`null`],nonEmpty:!0,normalize:e=>typeof e==`string`?e.trim():e},data:{default:[],type:`array`},loop:{default:!0,type:`boolean`},autoplay:{default:!0,type:`boolean`},delay:{default:3e3,type:`number`,min:0},lazyload:{default:!0,type:`boolean`},pagination:{default:!0,type:`boolean`},navigation:{default:!0,type:`boolean`},speed:{default:300,type:`number`,min:0},touchRatio:{default:1,type:`number`,greaterThan:0},touchAngle:{default:45,type:`number`,min:0,max:90},longSwipesMs:{default:300,type:`number`,min:0},longSwipesRatio:{default:.05,type:`number`,min:0,max:1},preventClick:{default:!0,type:`boolean`},className:{default:Kr,type:`object`,normalize:e=>({...Kr,...e&&typeof e==`object`?e:{}})}},Jr={type:`plainObject`,shape:{image:[`string`,`null`,`undefined`],url:[`string`,`null`,`undefined`],title:[`string`,`null`,`undefined`],sort:[`number`,`null`,`undefined`],blank:[`boolean`,`null`,`undefined`],children:`renderable`}},Yr={data:qr.data,index:{type:`number`},trackIndex:{type:`number`},transform:{type:`number`},animating:{type:`boolean`},width:{type:`number`}};function Xr(e){return e instanceof Element&&!!e.closest(`a, button, input, textarea, select, label, [data-swiper-ignore]`)}function X(e,t=0){let n=Number(e);return Number.isFinite(n)?n:t}function Zr(e,t){return T(e,t)}function Qr(e){return Array.isArray(e)?e.map(e=>({...e})):[]}function $r(e={}){let t=S(e,qr,`Swiper.props`);return{...t,id:t.id?.trim()||null,data:Qr(t.data),className:{...t.className}}}function ei(e){let t=Array.from(document.querySelectorAll(`[id]`)).filter(t=>t.id===e);return x(`id`,t,{type:`array`,maxLength:1},`Swiper.props`),t[0]||null}var ti=class extends U{constructor(e={}){let n=$r(e);super(n),this.dom.createdRoot=!1,this.dom.wrapper=null,this.dom.slides=[],this.dom.pagination=null,this.dom.prevButton=null,this.dom.nextButton=null,this.dom.bullets=[],this.dom.createdPagination=!1,this.dom.createdPrevButton=!1,this.dom.createdNextButton=!1,this.cleanup.data=null,this.cleanup.bindings=null,this.cleanup.navBindings=null,this.runtime.built=!1,this.runtime.logs=[],this.runtime.startTarget=null,this.runtime.touching=!1,this.runtime.scrolling=!1,this.runtime.swiping=!1,this.runtime.clickPrevented=!1,this.runtime.timer=null,this.runtime.mountRefreshId=null,this.runtime.imageCleanups=new Set,this.runtime.realCount=0,this.state=(0,t.createDeepStore)({data:Qr(this.props.data),index:0,trackIndex:0,transform:0,animating:!1,width:0})}build(){if(this.runtime.destroyed)throw Error(`Swiper.build: instance destroyed`);if(this.runtime.built)return this;let e=this.props.id?ei(this.props.id):null,n=e||(0,t.h)(`div`,{id:this.props.id||c(),className:this.props.className.root,"data-swiper":`root`});try{this.dom.root=n,this.dom.createdRoot=!e;let t=this.dom.createdRoot?this.createDataView(n,this.state.data):O(`[data-swiper-wrapper]`,n);x(`wrapper`,t,{validate:w,message:`expects [data-swiper-wrapper] in the root element.`},`Swiper`),this.dom.wrapper=t,this.dom.slides=k(`[data-swiper-slide]`,this.dom.wrapper),this.dom.pagination=O(`[data-swiper-pagination]`,n),this.dom.prevButton=O(`[data-action="prev"]`,n),this.dom.nextButton=O(`[data-action="next"]`,n),this.dom.bullets=[],this.dom.createdPagination=!1,this.dom.createdPrevButton=!1,this.dom.createdNextButton=!1,this.runtime.realCount=this.dom.slides.length,this.runtime.built=!0,this.dom.slides.length>0&&this.onInit(),this.dom.createdRoot&&this.bindStateData(),this.queueMountRefresh()}catch(e){throw this.destroy(),e}return this.emit(`init`,this.props),this}set index(e){this.setState({index:X(e)})}set trackIndex(e){this.setState({trackIndex:X(e)})}set transform(e){this.setState({transform:X(e)})}set animating(e){this.setState({animating:!!e})}set width(e){this.setState({width:X(e)})}get realCount(){return this.runtime?.destroyed?0:this.runtime?.realCount||0}get realIndex(){return this.toRealIndex()}assertBuilt(e){if(!this.runtime.built)throw Error(`Swiper.${e}: call build() first.`)}createDataView(e,n){let r=this.normalizeData(n),i=(0,t.h)(`div`,{className:this.props.className.wrapper,"data-swiper-wrapper":``,"aria-live":`polite`});return e.textContent=``,r.forEach((e,t)=>{i.appendChild(this.createDataSlide(e,t))}),e.appendChild(i),i}bindStateData(){this.cleanup.data||(this.cleanup.data=L(()=>F(this.state.data),e=>this.syncStateData(e)))}syncStateData(e){if(!this.runtime.built||!this.dom.createdRoot)return;let t=Qr(I(e));x(`data`,t,qr.data,`Swiper.state`);let n=this.state.index,r=this.dom.wrapper;!r&&this.dom.root&&(r=this.createDataView(this.dom.root,t),this.dom.wrapper=r),r&&(this.pause(),this.clearImageCleanups(),this.cleanup.bindings?.(),this.cleanup.bindings=null,this.cleanup.navBindings?.(),this.cleanup.navBindings=null,this.cleanup.events.clear(),k(`[data-clone]`,r).forEach(e=>e.remove()),r.textContent=``,this.normalizeData(t).forEach((e,t)=>{r.appendChild(this.createDataSlide(e,t))}),this.refreshSlides(),this.runtime.realCount=this.dom.slides.length,this.setState({index:Math.min(n,Math.max(0,this.realCount-1))}),this.reInitView())}normalizeData(e){e.forEach((e,t)=>{x(String(t),e,Jr,`Swiper.options.data`)});let t=e.map((e,t)=>({...e,blank:e.blank!==!1,index:t}));return t.some(e=>e.sort!=null)?t.sort((e,t)=>e.sort==null&&t.sort==null?e.index-t.index:e.sort==null?1:t.sort==null?-1:e.sort-t.sort||e.index-t.index):t}createDataSlide(e,n){let r=(0,t.h)(e.url?`a`:`div`,{className:this.props.className.slide,href:e.url||void 0,target:e.url?e.blank?`_blank`:`_self`:void 0,"data-swiper-slide":String(n),"data-swiper-index":String(n),role:`group`,"aria-label":`Slide ${n+1}`});if(e.children!=null)return r.append(...Zr(e.children,{swiper:this,item:e,index:n})),r;if(e.image){let n=(0,t.h)(`img`,{className:this.props.className.image,alt:e.title||``,loading:`lazy`});this.props.lazyload?n.dataset.lazy=e.image:n.src=e.image,r.appendChild(n)}return e.title&&r.appendChild((0,t.h)(`span`,{className:this.props.className.title,children:e.title})),r}onInit(){!this.dom.root||!this.dom.wrapper||(this.dom.wrapper.setAttribute(`aria-live`,`polite`),this.updateSize(),this.props.loop&&this.realCount>1&&this.initLoop(),this.setupStyles(),this.setTrackIndex(+!!this.props.loop,!1),this.render(!1),this.bindEvents(),this.props.pagination&&this.initPagination(),this.props.navigation&&this.initNavigation(),this.props.lazyload&&this.loadImages(),this.props.autoplay&&this.play())}onDestroy(){this.pause(),this.cancelMountRefresh(),this.clearImageCleanups(),this.cleanup.events.clear(),this.cleanup.data?.(),this.cleanup.data=null,this.cleanup.bindings?.(),this.cleanup.bindings=null,this.cleanup.navBindings?.(),this.cleanup.navBindings=null,this.dom.wrapper&&k(`[data-clone]`,this.dom.wrapper).forEach(e=>e.remove()),this.dom.createdPagination&&this.dom.pagination?.remove(),this.dom.createdPrevButton&&this.dom.prevButton?.remove(),this.dom.createdNextButton&&this.dom.nextButton?.remove(),this.dom.createdRoot&&this.dom.root?.remove(),this.runtime.built=!1}updateSize(){if(this.assertBuilt(`updateSize`),!this.dom.root)return;let e=this.dom.root.clientWidth||this.dom.root.offsetWidth;(e>0||!this.dom.root.isConnected||this.state.width===0)&&(this.width=e)}refresh(){return this.assertBuilt(`refresh`),this.updateSize(),this.setupStyles(),this.setTrackIndex(this.trackIndexForRealIndex(this.state.index),!1),this.props.lazyload&&this.loadImages(),this.props.autoplay&&this.hasLayout()?this.resume():this.pause(),this}hasLayout(){return!!this.dom.root?.isConnected&&this.state.width>0}syncLayout(){return this.updateSize(),this.hasLayout()?(this.setupStyles(),!0):!1}queueMountRefresh(){if(!(!this.dom.createdRoot||!this.dom.root||this.runtime.mountRefreshId)){if(typeof requestAnimationFrame!=`function`){queueMicrotask(()=>{!this.runtime.destroyed&&this.runtime.built&&this.dom.root?.isConnected&&this.refresh()});return}this.runtime.mountRefreshId=requestAnimationFrame(()=>{this.runtime.mountRefreshId=null,!this.runtime.destroyed&&this.runtime.built&&this.dom.root?.isConnected&&this.refresh()})}}cancelMountRefresh(){if(this.runtime.mountRefreshId==null||typeof cancelAnimationFrame!=`function`){this.runtime.mountRefreshId=null;return}cancelAnimationFrame(this.runtime.mountRefreshId),this.runtime.mountRefreshId=null}refreshSlides(){this.dom.wrapper&&(this.dom.slides=k(`[data-swiper-slide]`,this.dom.wrapper),this.runtime.realCount=this.dom.slides.filter(e=>!e.hasAttribute(`data-clone`)).length)}initLoop(){if(!this.dom.wrapper||this.dom.slides.length===0)return;let e=this.dom.slides[0].cloneNode(!0),t=this.dom.slides[this.dom.slides.length-1].cloneNode(!0);e.setAttribute(`data-clone`,``),t.setAttribute(`data-clone`,``),e.removeAttribute(`data-swiper-index`),t.removeAttribute(`data-swiper-index`),this.dom.wrapper.appendChild(e),this.dom.wrapper.insertBefore(t,this.dom.slides[0]),this.refreshSlides()}setupStyles(){this.dom.root&&this.dom.root.style.setProperty(`--swiper-slide-width`,`${this.state.width}px`)}reInitView(){this.dom.wrapper&&(this.pause(),this.clearImageCleanups(),this.cleanup.bindings?.(),this.cleanup.bindings=null,this.cleanup.navBindings?.(),this.cleanup.navBindings=null,this.cleanup.events.clear(),k(`[data-clone]`,this.dom.wrapper).forEach(e=>e.remove()),this.refreshSlides(),this.props.loop&&this.realCount>1&&this.initLoop(),this.updateSize(),this.setupStyles(),this.setTrackIndex(this.trackIndexForRealIndex(this.state.index),!1),this.render(!1),this.bindEvents(),this.props.pagination?this.initPagination():this.clearPagination(),this.props.navigation?this.initNavigation():this.clearNavigation(),this.props.lazyload&&this.loadImages(),this.props.autoplay&&this.play())}clearPagination(){this.cleanup.bindings?.(),this.cleanup.bindings=null,this.dom.bullets.forEach((e,t)=>{this.cleanup.events.off(`bullet:${t}:click`),this.cleanup.events.off(`bullet:${t}:keydown`)}),this.dom.bullets=[],this.dom.createdPagination?(this.dom.pagination?.remove(),this.dom.pagination=null,this.dom.createdPagination=!1):this.dom.pagination&&(this.dom.pagination.textContent=``)}clearNavigation(){this.cleanup.navBindings?.(),this.cleanup.navBindings=null,this.cleanup.events.off(`nav:prev`),this.cleanup.events.off(`nav:next`),this.dom.createdPrevButton&&(this.dom.prevButton?.remove(),this.dom.prevButton=null,this.dom.createdPrevButton=!1),this.dom.createdNextButton&&(this.dom.nextButton?.remove(),this.dom.nextButton=null,this.dom.createdNextButton=!1)}bindEvents(){let e=this.dom.root,t=this.dom.wrapper;!e||!t||(this.cleanup.events.on(`touchstart`,t,`touchstart`,e=>{let t=e;t.touches[0]&&this.onStart(t.touches[0],t.target)},{passive:!0}),this.cleanup.events.on(`touchmove`,t,`touchmove`,e=>{let t=e;t.touches[0]&&this.onMove(t.touches[0],e)},{passive:!1}),this.cleanup.events.on(`touchend`,t,`touchend`,e=>{let t=e;t.changedTouches[0]&&this.pushLog(t.changedTouches[0]),this.onEnd()}),this.cleanup.events.on(`touchcancel`,t,`touchcancel`,()=>{this.resetDrag(!0)}),this.cleanup.events.on(`window:touchcancel`,window,`touchcancel`,()=>{this.resetDrag(!0)}),this.cleanup.events.on(`mousedown`,t,`mousedown`,e=>{let n=e;n.button===0&&(this.onStart(n,n.target),t.style.cursor=`grabbing`)}),this.cleanup.events.on(`mousemove`,t,`mousemove`,e=>{let t=e;t.buttons===1&&this.onMove(t,e)}),this.cleanup.events.on(`window:mousemove`,window,`mousemove`,e=>{let t=e;this.runtime.touching&&t.buttons===1&&this.onMove(t,e)}),this.cleanup.events.on(`mouseup`,t,`mouseup`,e=>{t.style.cursor=`grab`,this.pushLog(e),this.onEnd()}),this.cleanup.events.on(`window:mouseup`,window,`mouseup`,e=>{this.runtime.touching&&(t.style.cursor=`grab`,this.pushLog(e),this.onEnd())}),this.cleanup.events.on(`wrapper:mouseleave`,t,`mouseleave`,()=>{t.style.cursor=`grab`}),this.cleanup.events.on(`click`,t,`click`,e=>{!this.runtime.clickPrevented||!this.props.preventClick||(e.preventDefault(),e.stopPropagation(),this.runtime.clickPrevented=!1)},{capture:!0}),this.cleanup.events.on(`dragstart`,t,`dragstart`,e=>e.preventDefault()),this.cleanup.events.on(`transitionend`,t,`transitionend`,e=>this.onTransitionEnd(e)),this.cleanup.events.on(`window:resize`,window,`resize`,()=>this.refresh()),this.cleanup.events.on(`root:mouseenter`,e,`mouseenter`,()=>this.pause()),this.cleanup.events.on(`root:mouseleave`,e,`mouseleave`,()=>this.resume()))}onStart(e,t=null){this.state.animating||!this.syncLayout()||(this.runtime.logs=[],this.pushLog(e),this.runtime.startTarget=t,this.runtime.touching=!0,this.runtime.scrolling=!1,this.runtime.swiping=!1,this.runtime.clickPrevented=!1,this.pause(),this.dom.wrapper&&(this.dom.wrapper.style.transition=`none`))}onMove(e,t){if(!this.runtime.touching||this.runtime.scrolling||this.state.animating)return;this.pushLog(e);let n=this.getOffset(),r=Math.abs(n.x),i=Math.abs(n.y);if(!(r<6&&i<6)){if(!this.runtime.swiping)if(Math.atan2(i,r)*180/Math.PI<this.props.touchAngle)this.runtime.swiping=!0,this.runtime.clickPrevented=Xr(this.runtime.startTarget);else{this.runtime.scrolling=!0,this.resetDrag(!0);return}this.runtime.swiping&&(t.preventDefault(),this.transform=-this.state.trackIndex*this.state.width+n.x*this.props.touchRatio,this.render(!1))}}onEnd(){if(!this.runtime.touching)return;if(this.runtime.touching=!1,!this.runtime.swiping){this.resetDrag(!0);return}let e=this.getDuration(),t=this.getOffset().x,n=this.state.trackIndex;if(e>this.props.longSwipesMs){let e=Math.ceil(Math.abs(t)/this.state.width-this.props.longSwipesRatio);e>0&&(n=this.state.trackIndex+e*(t>0?-1:1))}else{let e=Math.abs(t)/this.state.width,r=e>=this.props.longSwipesRatio?Math.max(1,Math.ceil(e-this.props.longSwipesRatio)):0;r>0&&(n=t>0?this.state.trackIndex-r:this.state.trackIndex+r)}this.slideToTrack(n),this.runtime.logs=[],this.resume()}resetDrag(e=!0){let t=this.state.trackIndex===0?0:-this.state.trackIndex*this.state.width,n=e&&this.state.transform!==t;this.runtime.touching=!1,this.runtime.scrolling=!1,this.runtime.swiping=!1,this.runtime.logs=[],this.runtime.startTarget=null,this.transform=t,this.render(n),this.resume()}onTransitionEnd(e){e&&(e.target!==this.dom.wrapper||!(`propertyName`in e)||e.propertyName!==`transform`)||(this.animating=!1,this.props.loop&&(this.state.trackIndex===0?(this.setTrackIndex(this.realCount,!1),this.render(!1)):this.state.trackIndex===this.dom.slides.length-1&&(this.setTrackIndex(1,!1),this.render(!1))))}pushLog(e){this.runtime.logs.push({x:e.pageX??e.clientX??0,y:e.pageY??e.clientY??0,time:Date.now()}),this.runtime.logs.length>5&&this.runtime.logs.shift()}getDuration(){return this.runtime.logs.length===0?0:this.runtime.logs[this.runtime.logs.length-1].time-this.runtime.logs[0].time}getOffset(){if(this.runtime.logs.length===0)return{x:0,y:0};let e=this.runtime.logs[0],t=this.runtime.logs[this.runtime.logs.length-1];return{x:t.x-e.x,y:t.y-e.y}}toRealIndex(e=this.state.trackIndex){return this.realCount?this.props.loop?e===0?this.realCount-1:e===this.dom.slides.length-1?0:e-1:e:0}trackIndexForRealIndex(e){if(!this.realCount)return 0;let t=Math.max(0,Math.min(e,this.realCount-1));return this.props.loop&&this.realCount>1?t+1:t}setTrackIndex(e,t=!0){let n=X(e);this.setState({trackIndex:n,index:this.toRealIndex(n),transform:-n*this.state.width}),t!=null&&this.render(t)}slideTo(e){return this.slideToTrack(this.trackIndexForRealIndex(e))}slideToTrack(e){if(this.assertBuilt(`slideToTrack`),this.state.animating||this.dom.slides.length===0||!this.syncLayout())return;let t=e;this.props.loop?e<0?t=0:e>=this.dom.slides.length&&(t=this.dom.slides.length-1):t=Math.max(0,Math.min(e,this.dom.slides.length-1)),this.setTrackIndex(t,!0),this.props.lazyload&&this.loadImages()}next(){this.assertBuilt(`next`),!this.state.animating&&this.slideToTrack(this.state.trackIndex+1)}prev(){this.assertBuilt(`prev`),!this.state.animating&&this.slideToTrack(this.state.trackIndex-1)}render(e){if(this.assertBuilt(`render`),!this.dom.wrapper)return;let t=`translate3d(${this.state.transform}px, 0, 0)`;e&&this.props.speed>0&&this.state.width>0&&this.dom.wrapper.style.transform!==t?(this.dom.wrapper.style.transition=`transform ${this.props.speed}ms cubic-bezier(0.25, 0.46, 0.45, 0.94)`,this.animating=!0):(this.dom.wrapper.style.transition=`none`,this.animating=!1),this.dom.wrapper.style.transform=t}loadImages(){this.assertBuilt(`loadImages`);let e=[this.state.trackIndex];this.state.trackIndex>0&&e.push(this.state.trackIndex-1),this.state.trackIndex<this.dom.slides.length-1&&e.push(this.state.trackIndex+1),e.forEach(e=>{let t=this.dom.slides[e];if(!t)return;let n=O(`img[data-lazy]`,t);if(!n||n.src)return;n.classList.add(this.props.className.loading),n.src=n.dataset.lazy||``;let r=()=>{n.onload=null,n.onerror=null,this.runtime.imageCleanups.delete(r)};this.runtime.imageCleanups.add(r),n.onload=()=>{n.classList.remove(this.props.className.loading),n.classList.add(this.props.className.loaded),r()},n.onerror=()=>{n.classList.remove(this.props.className.loading),n.classList.add(this.props.className.error),r()}})}clearImageCleanups(){this.runtime.imageCleanups?.forEach(e=>e()),this.runtime.imageCleanups?.clear()}initPagination(){if(!this.dom.root)return;this.dom.pagination?(this.dom.pagination.classList.add(this.props.className.paginationHorizontal,this.props.className.paginationClickable,this.props.className.paginationBulletGroup),this.dom.pagination.setAttribute(`data-swiper-pagination`,``)):(this.dom.pagination=(0,t.h)(`div`,{className:V(this.props.className.pagination,this.props.className.paginationHorizontal,this.props.className.paginationClickable,this.props.className.paginationBulletGroup),"data-swiper-pagination":``}),this.dom.root.appendChild(this.dom.pagination),this.dom.createdPagination=!0);let e=this.dom.pagination;if(e){e.textContent=``,this.dom.bullets=[];for(let n=0;n<this.realCount;n++){let r=(0,t.h)(`button`,{type:`button`,className:V(this.props.className.indicator,this.props.className.bullet),"data-swiper-bullet":String(n),"aria-label":`Go to slide ${n+1}`});this.cleanup.events.on(`bullet:${n}:click`,r,`click`,()=>{this.slideTo(n)}),this.cleanup.events.on(`bullet:${n}:keydown`,r,`keydown`,e=>{let t=e;(t.key===`Enter`||t.key===` `)&&(e.preventDefault(),this.slideTo(n))}),this.dom.bullets.push(r),e.appendChild(r)}this.cleanup.bindings=(0,t.createRoot)(e=>(this.dom.bullets.forEach((e,n)=>{(0,t.bindClass)(e,this.props.className.active,()=>this.state.index===n),(0,t.bindAttr)(e,`aria-current`,()=>this.state.index===n?`true`:null)}),e))}}initNavigation(){let e=this.ensureNavigation(`prev`,`arrow-left`),n=this.ensureNavigation(`next`,`arrow-right`);this.dom.prevButton=e,this.dom.nextButton=n,this.cleanup.events.on(`nav:prev`,e,`click`,()=>this.prev()),this.cleanup.events.on(`nav:next`,n,`click`,()=>this.next()),this.props.loop||(this.cleanup.navBindings=(0,t.createRoot)(r=>((0,t.bindClass)(e,this.props.className.disabled,()=>this.state.trackIndex<=0),(0,t.bindAttr)(e,`disabled`,()=>this.state.trackIndex<=0?``:null),(0,t.bindClass)(n,this.props.className.disabled,()=>this.state.trackIndex>=this.dom.slides.length-1),(0,t.bindAttr)(n,`disabled`,()=>this.state.trackIndex>=this.dom.slides.length-1?``:null),r)))}ensureNavigation(e,n){if(!this.dom.root)throw Error(`Swiper.ensureNavigation: root not found.`);let r=e===`prev`?`createdPrevButton`:`createdNextButton`,i=e===`prev`?this.props.className.prev:this.props.className.next,a=V(this.props.className.navigation,i),o=O(`[data-action="${e}"]`,this.dom.root);return o?o.tagName.toLowerCase()===`button`?(o.classList.add(this.props.className.navigation,i),o.setAttribute(`data-swiper-navigation`,e)):(o.setAttribute(`role`,`button`),o.setAttribute(`tabindex`,`0`),o.classList.add(this.props.className.navigation,i),o.setAttribute(`data-swiper-navigation`,e)):(o=(0,t.h)(`button`,{type:`button`,className:a,"data-action":e,"data-swiper-navigation":e}),this.dom.root.appendChild(o),this.dom[r]=!0),o.setAttribute(`aria-label`,e===`prev`?`Previous slide`:`Next slide`),O(`svg`,o)||(o.textContent=``,o.appendChild(z(n))),o}play(){if(this.assertBuilt(`play`),this.runtime.destroyed||this.runtime.timer||this.realCount<=1||!this.syncLayout())return;let e=Math.max(this.props.delay,16);this.runtime.timer=setInterval(()=>this.next(),e)}pause(){this.runtime.timer&&(clearInterval(this.runtime.timer),this.runtime.timer=null)}resume(){this.runtime.destroyed||this.props.autoplay&&!this.runtime.timer&&this.play()}restartAutoplay(){this.pause(),this.props.autoplay&&this.play()}normalizeStatePatch(e){let t={...e};return Object.hasOwn(t,`data`)&&Array.isArray(t.data)&&(t.data=Qr(t.data)),t}validateStatePatch(e){x(`state`,e,{type:`plainObject`},`Swiper.setState`);for(let t of Object.keys(e)){if(!Object.hasOwn(Yr,t))throw Error(`Swiper.setState: "${t}" is not a supported state key.`);x(t,e[t],Yr[t],`Swiper.setState`)}Array.isArray(e.data)&&this.normalizeData(e.data)}};function ni(e={}){return new ti(e)}let ri={root:`j-tabs`,wrap:`tab-wrap`,list:`tab-list`,tab:`tab-item`,panelWrap:`tab-panel`,panel:`panel-item`,disabled:`is-disabled`,dragging:`dragging`},Z={id:{default:null,types:[`string`,`null`],normalize:e=>typeof e==`string`?e.trim()||c():e??c()},direction:{default:`top`,type:`string`,enum:[`top`,`bottom`,`left`,`right`]},active:{default:0,types:[`number`,`string`]},disabled:{default:[],types:[`number`,`string`,`array`]},onChange:{default:null,types:[`function`,`null`]},data:{default:[],type:`array`},className:{default:ri,type:`object`,normalize:e=>({...ri,...e&&typeof e==`object`?e:{}})}},ii={type:`plainObject`,shape:{title:`renderable`,panel:`renderable`}};function ai(e){return Array.isArray(e)?e.map(e=>{let t={...e};return t.name=t.name||c(),t}):[]}function oi(e){return Array.isArray(e)?e.slice():e}function si(e,t){let n=e=>typeof e==`number`?t[e]?.name||null:typeof e==`string`?e:null,r=Array.isArray(e)?e.map(n).filter(e=>!!e):(()=>{let t=n(e);return t?[t]:[]})(),i=Array.from(new Set(r));return{names:i,indexes:i.map(e=>t.findIndex(t=>t.name===e)).filter(e=>e>=0)}}function ci(e){return typeof e==`number`&&e>0?e:0}function li(e){let t=S(e,Z,`Tabs`);return{id:t.id,direction:t.direction,active:t.active,disabled:t.disabled,onChange:t.onChange,data:ai(t.data),className:t.className}}let Q={data:Z.data,active:Z.active,disabled:Z.disabled,direction:Z.direction};var ui=class extends U{bindingsDispose;stateDispose;isDragging;raf;resizeRaf;velocity;constructor(e={}){let n=li(e);super(n),this.dom.tabs=[],this.dom.panels=[],this.bindingsDispose=null,this.stateDispose=null,this.isDragging=!1,this.raf=0,this.resizeRaf=0,this.velocity=0,this.state=(0,t.createDeepStore)({data:ai(n.data),active:n.active,disabled:oi(n.disabled),direction:n.direction,current:{index:-1,name:null},isVertical:n.direction===`left`||n.direction===`right`,draggable:!1,loading:!1}),this.runtime.cache={panels:new Map},this.runtime.built=!1,this.runtime.panelLoadId=0}onInit(e){this.dom.root=this.buildRoot(e),this.renderItems(),this.activateInternal(this.state.active,!1),this.bindEvents(),this.initDrag(),this.bindState()}buildRoot(e){let{id:n,className:r}=e,i=(0,t.jsx)(`nav`,{className:r.list,"data-tabs-list":``}),a=(0,t.jsx)(`div`,{className:r.wrap,"data-tabs-wrap":``,children:i}),o=(0,t.jsx)(`div`,{className:r.panelWrap,"data-tabs-panel-wrap":``});return(0,t.jsx)(`div`,{className:r.root,id:n,"data-tabs":`root`,"data-tabs-direction":this.state.direction,children:[a,o]})}renderItems(e=this.state.data){if(!this.dom.root)return;let n=O(`[data-tabs-list]`,this.dom.root),r=O(`[data-tabs-panel-wrap]`,this.dom.root);if(!n||!r)return;n.textContent=``,r.textContent=``,this.dom.tabs=[],this.dom.panels=[];let i=document.createDocumentFragment(),a=document.createDocumentFragment();e.forEach((e,n)=>{let r=e.name||c(),o=(0,t.jsx)(`div`,{className:this.props.className.tab,"data-tabs-tab":r,role:`tab`,children:T(e.title,{tabs:this,item:e})});this.dom.tabs.push(o);let s=(0,t.jsx)(`div`,{className:this.props.className.panel,"data-tabs-panel":r,role:`tabpanel`});this.dom.panels.push(s),typeof e.panel!=`function`&&s.append(...T(e.panel,{tabs:this,item:e,index:n,name:r})),i.append(o),a.append(s)}),n.append(i),r.append(a),this.bindingsDispose?.(),this.bindingsDispose=(0,t.createRoot)(e=>(this.dom.tabs.forEach((e,n)=>{let r=e.dataset.tabsTab||``;(0,t.bindAttr)(e,`aria-selected`,()=>this.state.current.index===n?`true`:`false`),(0,t.bindAttr)(e,`aria-disabled`,()=>this.isDisabledName(r)?`true`:`false`)}),this.dom.panels.forEach((e,n)=>{(0,t.bindAttr)(e,`aria-hidden`,()=>this.state.current.index===n?`false`:`true`)}),e))}bindState(){if(this.stateDispose)return;let e=this.state.data,t=P(e),n=this.state.direction,r=this.state.active;this.stateDispose=L(()=>{let i=this.state.data,a=P(i),o=this.state.direction,s=this.state.disabled,c=this.state.active,l={data:i,direction:o,disabled:s,active:c,dataChanged:i!==e||a!==t,directionChanged:o!==n,activeChanged:c!==r};return e=i,t=a,n=o,r=c,l},e=>this.syncStateView(e))}async syncStateView({data:e,direction:n,disabled:r,active:i,dataChanged:a,directionChanged:o,activeChanged:s}){if(!this.runtime.built||!this.dom.root)return;let c=ai(I(e));this.validateData(c),x(`direction`,n,Q.direction,`Tabs.state`),x(`disabled`,r,Q.disabled,`Tabs.state`),x(`active`,i,Q.active,`Tabs.state`),o&&(this.dom.root.setAttribute(`data-tabs-direction`,n),(0,t.flushSync)(()=>{this.state.isVertical=n===`left`||n===`right`})),a&&(this.runtime.cache.panels.clear(),this.renderItems(c),this.bindEvents(),(0,t.flushSync)(()=>{this.syncCurrent(-1)})),(a||s)&&await this.activateInternal(i,s),this.refreshDrag()}get disabledState(){return si(this.state.disabled,this.state.data)}isDisabledName(e){return this.disabledState.names.includes(e)}syncCurrent(e){this.state.current={index:e,name:e>=0&&e<this.dom.tabs.length&&this.dom.tabs[e]?.dataset.tabsTab||null}}getPanelKey(e,t){return e.name||this.dom.tabs[t]?.dataset.tabsTab||String(t)}getCachedPanel(e,t){if(!e.cache)return null;let n=this.getPanelKey(e,t),r=this.runtime.cache.panels.get(n);if(!r)return null;let i=ci(e.ttl);return i&&Date.now()-r.updatedAt>i?(this.runtime.cache.panels.delete(n),null):r}setCachedPanel(e,t,n){e.cache&&this.runtime.cache.panels.set(this.getPanelKey(e,t),{content:n,updatedAt:Date.now()})}renderPanelContent(e,t){let n=this.dom.panels[e],r=this.state.data[e];!n||!r||(n.textContent=``,n.append(...T(t,{tabs:this,item:r,index:e,name:this.dom.tabs[e]?.dataset.tabsTab||r.name||e})))}async loadPanel(e){let n=this.state.data[e],r=this.dom.panels[e];if(!n||!r||typeof n.panel!=`function`){this.runtime.panelLoadId+=1,(0,t.flushSync)(()=>{this.state.loading=!1});return}let i=this.getCachedPanel(n,e);if(i){this.runtime.panelLoadId+=1,(0,t.flushSync)(()=>{this.state.loading=!1}),this.renderPanelContent(e,i.content);return}let a=++this.runtime.panelLoadId;(0,t.flushSync)(()=>{this.state.loading=!0}),r.setAttribute(`aria-live`,`polite`),r.setAttribute(`aria-busy`,`true`),r.textContent=``,r.appendChild(B());try{let t=await Promise.resolve(n.panel({tabs:this,item:n,index:e,name:this.dom.tabs[e]?.dataset.tabsTab||n.name||e}));if(this.runtime.destroyed||a!==this.runtime.panelLoadId)return;this.setCachedPanel(n,e,t),this.renderPanelContent(e,t)}finally{!this.runtime.destroyed&&a===this.runtime.panelLoadId&&((0,t.flushSync)(()=>{this.state.loading=!1}),r.setAttribute(`aria-busy`,`false`))}}get activeIndex(){return this.state.current.index}get disabledNames(){return this.disabledState.names}bindEvents(){if(this.unbindEvents(),!this.dom.root)return;let e=O(`[data-tabs-list]`,this.dom.root);e&&this.cleanup.events.on(`tabClick`,e,`click`,t=>{if(!(t.target instanceof Element))return;let n=t.target.closest(`[data-tabs-tab]`);if(!n||!e.contains(n))return;let r=n.dataset.tabsTab;r&&!this.isDisabledName(r)&&this.activate(r)})}unbindEvents(){this.cleanup.events.clear()}assertActive(e){if(this.runtime.destroyed)throw Error(`Tabs.${e}: instance has been destroyed.`);if(!this.runtime.built)throw Error(`Tabs.${e}: call build() first.`)}getIndex(e){return typeof e==`number`?e:typeof e==`string`?this.dom.tabs.findIndex(t=>t.dataset.tabsTab===e):-1}async activateInternal(e,n=!0){let r=this.getIndex(e),i=this.dom.tabs[r]?.dataset.tabsTab||``;if(!(r<0||r>=this.dom.tabs.length||this.isDisabledName(i)||this.state.current.index===r)&&((0,t.flushSync)(()=>{this.syncCurrent(r)}),await this.loadPanel(r),n&&this.props.onChange)){let e=this.dom.tabs[r],t=this.dom.panels[r];await Promise.resolve(this.props.onChange(r,e?.dataset.tabsTab||r,e,t))}}async activate(e){this.assertActive(`activate`),this.state.active=e,await this.activateInternal(e,!0)}build(){if(this.runtime.destroyed)throw Error(`Tabs.build: instance has been destroyed.`);if(this.runtime.built)return this;try{this.runtime.built=!0,this.onInit(this.props)}catch(e){throw this.destroy(),e}return this.emit(`init`,this.props),this}refresh(){return this.assertActive(`refresh`),this.refreshDrag(),this}get dragContainer(){return this.dom.root?O(`[data-tabs-wrap]`,this.dom.root):null}get dragInner(){return this.dom.root?O(`[data-tabs-list]`,this.dom.root):null}initDrag(){let e=this.state.direction,n=this.dragContainer,r=this.dragInner;if(!n||!r)return;let i=e===`left`||e===`right`,a=i?r.scrollHeight>n.clientHeight+5:r.scrollWidth>n.clientWidth+5;if((0,t.flushSync)(()=>{this.state.isVertical=i,this.state.draggable=a}),!a){this.removeDragEvents();return}this.bindDragEvents(),this.cleanup.events.on(`resize`,window,`resize`,()=>{cancelAnimationFrame(this.resizeRaf),this.resizeRaf=requestAnimationFrame(()=>{this.refreshDrag()})})}bindDragEvents(){this.removeDragEvents();let e=this.dragContainer,t=this.dragInner;if(!e||!t)return;let n=this.state.isVertical,r=0,i=0,a=0,o=!1,s=e=>{if(`touches`in e){let t=e.touches[0]||e.changedTouches[0];return n?t.pageY:t.pageX}return n?e.pageY:e.pageX},c=o=>{!(o instanceof MouseEvent)&&!(o instanceof TouchEvent)||(this.isDragging=!0,t.classList.add(this.props.className.dragging),r=s(o),a=r,i=n?e.scrollTop:e.scrollLeft,this.velocity=0,cancelAnimationFrame(this.raf))},l=t=>{if(!this.isDragging||!(t instanceof MouseEvent)&&!(t instanceof TouchEvent))return;t.preventDefault();let c=s(t),l=r-c;this.velocity=a-c,a=c,o||(o=!0,requestAnimationFrame(()=>{o=!1,n?e.scrollTop=i+l:e.scrollLeft=i+l}))},u=()=>{this.isDragging&&(this.isDragging=!1,t.classList.remove(this.props.className.dragging),this.startInertiaScroll())};this.cleanup.events.on(`drag:mousedown`,t,`mousedown`,c),this.cleanup.events.on(`drag:touchstart`,t,`touchstart`,c,{passive:!0}),this.cleanup.events.on(`drag:mousemove`,window,`mousemove`,l,{passive:!1}),this.cleanup.events.on(`drag:touchmove`,window,`touchmove`,l,{passive:!1}),this.cleanup.events.on(`drag:mouseup`,window,`mouseup`,u),this.cleanup.events.on(`drag:touchend`,window,`touchend`,u)}startInertiaScroll(){let e=this.dragContainer;if(!e)return;let t=this.velocity,n=this.state.isVertical,r=performance.now(),i=a=>{let o=a-r;r=a,t*=.92,!(Math.abs(t)<.3)&&(n?e.scrollTop+=t*o*.05:e.scrollLeft+=t*o*.05,this.raf=requestAnimationFrame(i))};this.raf=requestAnimationFrame(i)}removeDragEvents(){this.cleanup.events.off(`drag:mousedown`),this.cleanup.events.off(`drag:touchstart`),this.cleanup.events.off(`drag:mousemove`),this.cleanup.events.off(`drag:touchmove`),this.cleanup.events.off(`drag:mouseup`),this.cleanup.events.off(`drag:touchend`)}refreshDrag(){this.initDrag()}onDestroy(){this.unbindEvents(),this.removeDragEvents(),this.bindingsDispose?.(),this.bindingsDispose=null,this.stateDispose?.(),this.stateDispose=null,cancelAnimationFrame(this.raf),cancelAnimationFrame(this.resizeRaf),this.cleanup.events.off(`resize`),this.dom.root?.remove(),this.runtime.built=!1}validateData(e){x(`data`,e,Q.data,`Tabs.state`),e.forEach((e,t)=>{x(String(t),e,ii,`Tabs.state.data`)})}normalizeStatePatch(e){let t={...e};return Object.hasOwn(t,`data`)&&Array.isArray(t.data)&&(t.data=ai(t.data)),Object.hasOwn(t,`disabled`)&&Array.isArray(t.disabled)&&(t.disabled=oi(t.disabled)),t}validateStatePatch(e){x(`state`,e,{type:`plainObject`},`Tabs.setState`);for(let t of Object.keys(e)){if(!Object.hasOwn(Q,t))throw Error(`Tabs.setState: "${t}" is not a supported state key.`);let n=t;x(t,e[t],Q[n],`Tabs.setState`)}Array.isArray(e.data)&&this.validateData(e.data)}};function di(e={}){return new ui(e)}let fi={root:`j-offcanvas`,overlay:`j-offcanvas-overlay`,content:`offcanvas-content`},pi={content:{default:``,type:`renderable`},overlay:{default:!0,type:`boolean`},filter:{default:!0,type:`boolean`},bodyOverflow:{default:!0,type:`boolean`},cache:{default:!1,type:`boolean`},ttl:{default:0,type:`number`},direction:{default:`left`,type:`string`,enum:[`top`,`right`,`bottom`,`left`]},animate:{default:`slide`,type:`string`},bgClose:{default:!0,type:`boolean`},escClose:{default:!0,type:`boolean`},id:{default:null,types:[`string`,`null`],normalize:e=>typeof e==`string`?e.trim()||c():e??c()},className:{default:fi,type:`object`,normalize:e=>({...fi,...e&&typeof e==`object`?e:{}})},onShow:{default:null,types:[`function`,`null`]},onShown:{default:null,types:[`function`,`null`]},onHide:{default:null,types:[`function`,`null`]},onHidden:{default:null,types:[`function`,`null`]}},mi={content:pi.content};function hi(e){return e>0?e:0}function gi(e){let t=S(e,pi,`Offcanvas`);return{content:t.content,overlay:t.overlay,filter:t.filter,bodyOverflow:t.bodyOverflow,cache:t.cache,ttl:t.ttl,direction:t.direction,animate:t.animate,bgClose:t.bgClose,escClose:t.escClose,id:t.id,className:t.className,onShow:t.onShow,onShown:t.onShown,onHide:t.onHide,onHidden:t.onHidden}}var _i=class extends U{constructor(e={}){let n=gi(e);super(n),this.dom.overlay=null,this.dom.content=null,this.cleanup.state=null,this.runtime.built=!1,this.runtime.cache={content:null,hasContent:!1,updatedAt:0},this.runtime.contentLoadId=0,this.state=(0,t.createDeepStore)({content:n.content,visible:!1,loading:!1})}build(){if(this.runtime.destroyed)throw Error(`Offcanvas.build: instance has been destroyed.`);if(this.runtime.built)return this;try{this.dom.root=this.buildRoot(),this.runtime.built=!0,this.bindState()}catch(e){throw this.destroy(),e}return this.emit(`init`,this.props),this}assertBuilt(e){if(this.runtime.destroyed)throw Error(`Offcanvas.${e}: instance has been destroyed.`);if(!this.runtime.built)throw Error(`Offcanvas.${e}: call build() first.`)}buildRoot(){return this.props.overlay&&(this.dom.overlay=this.buildOverlay()),this.buildPanel()}buildOverlay(){let e=this.props.filter?{backdropFilter:`blur(2px)`}:{};return(0,t.jsx)(`div`,{className:this.props.className.overlay,hidden:!0,"data-offcanvas-overlay":this.props.id,style:{...e}})}buildPanel(){let e=(0,t.jsx)(`div`,{className:this.props.className.content,"data-offcanvas-content":this.props.id});return this.dom.content=e,typeof this.state.content!=`function`&&this.renderContent(this.state.content),(0,t.jsx)(`div`,{className:this.props.className.root,id:this.props.id,role:`dialog`,"aria-modal":this.props.overlay?`true`:`false`,"aria-expanded":`false`,"data-offcanvas":`root`,"data-direction":this.props.direction,"data-animate":this.props.animate,children:e})}bindState(){this.cleanup.state||(this.cleanup.state=L(()=>this.state.content,e=>this.syncContent(e)))}async syncContent(e){if(this.runtime.built){if(x(`content`,e,mi.content,`Offcanvas.state`),this.runtime.cache.hasContent=!1,this.runtime.cache.content=null,this.runtime.cache.updatedAt=0,typeof e==`function`){this.state.visible?await this.loadContent():this.clearContent();return}this.runtime.contentLoadId+=1,(0,t.flushSync)(()=>{this.state.loading=!1}),this.renderContent(e)}}isCacheValid(){if(!this.props.cache||!this.runtime.cache.hasContent)return!1;let e=hi(this.props.ttl);return!e||Date.now()-this.runtime.cache.updatedAt<=e}clearContent(){this.dom.content&&(this.dom.content.textContent=``)}renderContent(e){this.dom.content&&(this.clearContent(),this.dom.content.append(...T(e,this)))}async loadContent(){let{cache:e}=this.props,n=this.state.content;if(typeof n!=`function`){this.runtime.contentLoadId+=1,(0,t.flushSync)(()=>{this.state.loading=!1});return}if(this.isCacheValid()){this.runtime.contentLoadId+=1,this.renderContent(this.runtime.cache.content),(0,t.flushSync)(()=>{this.state.loading=!1});return}let r=++this.runtime.contentLoadId;(0,t.flushSync)(()=>{this.state.loading=!0}),this.dom.content&&(this.clearContent(),this.dom.content.appendChild(B()));try{let t=await Promise.resolve(n(this));if(this.runtime.destroyed||r!==this.runtime.contentLoadId)return;e&&(this.runtime.cache.content=t,this.runtime.cache.hasContent=!0,this.runtime.cache.updatedAt=Date.now()),this.renderContent(t)}finally{!this.runtime.destroyed&&r===this.runtime.contentLoadId&&(0,t.flushSync)(()=>{this.state.loading=!1})}}bindEvents(){this.unbindEvents();let{bgClose:e,escClose:t}=this.props;this.dom.overlay&&e&&this.cleanup.events.on(`overlay`,this.dom.overlay,`click`,()=>{this.hide()}),t&&this.cleanup.events.on(`esc`,document,`keydown`,e=>{e instanceof KeyboardEvent&&e.key===`Escape`&&this.state.visible&&this.hide()}),this.dom.root&&this.cleanup.events.on(`close`,this.dom.root,`click`,e=>{if(!(e.target instanceof Element))return;let t=e.target.closest(`[data-action]`)?.dataset.action;(t===`close`||t===`cancel`)&&this.hide()})}unbindEvents(){this.cleanup.events.clear()}showPanel(){let{id:e}=this.props;j.cancel(`oc-hide-${e}`),this.dom.overlay&&!this.dom.overlay.isConnected&&(this.dom.overlay.hidden=!1,document.body.appendChild(this.dom.overlay)),this.dom.root&&!this.dom.root.isConnected&&document.body.appendChild(this.dom.root),this.props.bodyOverflow&&(document.body.style.overflow=`hidden`),j.start(`oc-show-${e}`,10,()=>{this.dom.root?.setAttribute(`aria-expanded`,`true`)})}hidePanel(){let{id:e}=this.props;j.cancel(`oc-show-${e}`),j.cancel(`oc-shown-${e}`),this.dom.root?.setAttribute(`aria-expanded`,`false`),j.start(`oc-hide-${e}`,100,()=>{this.dom.overlay?.remove(),this.dom.root?.remove(),this.props.bodyOverflow&&(document.body.style.overflow=``)})}async show(){if(this.assertBuilt(`show`),this.state.visible)return;let{onShow:e,onShown:n,id:r}=this.props;e&&await Promise.resolve(e(this)),this.showPanel(),this.bindEvents(),(0,t.flushSync)(()=>{this.state.visible=!0}),await this.loadContent(),j.start(`oc-shown-${r}`,300,()=>{this.runtime.destroyed||n?.(this)})}async hide(){if(this.assertBuilt(`hide`),!this.state.visible)return;let{onHide:e,onHidden:n}=this.props;e&&await Promise.resolve(e(this)),this.runtime.contentLoadId+=1,(0,t.flushSync)(()=>{this.state.loading=!1}),this.unbindEvents(),this.hidePanel(),(0,t.flushSync)(()=>{this.state.visible=!1}),n?.(this)}onDestroy(){let{id:e}=this.props;j.cancel(`oc-show-${e}`),j.cancel(`oc-hide-${e}`),j.cancel(`oc-shown-${e}`),this.unbindEvents(),this.cleanup.state?.(),this.cleanup.state=null,this.dom.root?.setAttribute(`aria-expanded`,`false`),this.dom.overlay?.remove(),this.dom.root?.remove(),this.props.bodyOverflow&&(document.body.style.overflow=``),this.runtime.built=!1}validateStatePatch(e){x(`state`,e,{type:`plainObject`},`Offcanvas.setState`);for(let t of Object.keys(e)){if(!Object.hasOwn(mi,t))throw Error(`Offcanvas.setState: "${t}" is not a supported state key.`);let n=t;x(t,e[t],mi[n],`Offcanvas.setState`)}}};function vi(e={}){return new _i(e)}let yi={size:10,current:1},bi={sibling:1,boundary:1},xi={root:`j-pagination`,list:`pagination`,item:`item`,more:`more`,button:`j-button is-icon is-ghost`,current:`j-button is-icon is-active`,loading:`animate-spin`},Si={default:0,type:`number`,finite:!0,min:0},Ci={type:`plainObject`,required:!0,shape:{size:{type:`number`,integer:!0,greaterThan:0},current:{type:`number`,integer:!0,greaterThan:0}}},wi={type:`plainObject`,required:!0,shape:{sibling:{type:`number`,integer:!0,min:0},boundary:{type:`number`,integer:!0,min:0}}},Ti={total:Si,page:{default:()=>({...yi}),factory:!0,normalize:e=>({...yi,...e&&typeof e==`object`?e:{}}),...Ci},count:{default:()=>({...bi}),factory:!0,normalize:e=>({...bi,...e&&typeof e==`object`?e:{}}),...wi},lock:{default:!0,type:`boolean`},onChange:{default:null,types:[`function`,`null`]},className:{default:xi,type:`object`,normalize:e=>({...xi,...e&&typeof e==`object`?e:{}})}},Ei={total:Si,page:Ci,count:wi};function Di(e,t,n){return Math.min(Math.max(e,t),n)}function Oi(e,t){return Math.max(1,Math.ceil(e/t))}function ki(e){return{size:e.size,current:e.current}}function Ai(e){return{sibling:e.sibling,boundary:e.boundary}}function ji(e={}){let t=S(e,Ti,`Pagination.props`),n=Oi(t.total,t.page.size);return{...t,page:{size:t.page.size,current:Di(t.page.current,1,n)},count:Ai(t.count),className:{...t.className}}}function Mi(e){return{type:`more`,key:e}}function Ni(e){return{type:`page`,key:`page-${e}`,page:e}}function Pi(e,t){let n=[];for(let r=e;r<=t;r++)n.push(r);return n}function Fi(e,t,n){if(t<=0)return[];let r=Math.max(0,n.boundary),i=Math.max(0,n.sibling);if(t<=r*2+i*2+3)return Pi(1,t).map(Ni);let a=new Set;for(let e=1;e<=Math.min(r,t);e++)a.add(e);for(let n=Math.max(1,e-i);n<=Math.min(t,e+i);n++)a.add(n);for(let e=Math.max(1,t-r+1);e<=t;e++)a.add(e);let o=Array.from(a).sort((e,t)=>e-t),s=[];for(let e of o){let t=s[s.length-1];t?.type===`page`&&e-t.page>1&&(e-t.page===2?s.push(Ni(t.page+1)):s.push(Mi(`more-${t.page}-${e}`))),s.push(Ni(e))}return s}var Ii=class extends U{constructor(e={}){let n=ji(e);super(n),this.dom.list=null,this.cleanup.state=null,this.runtime.built=!1,this.runtime.itemsKey=``,this.runtime.changeId=0,this.state=(0,t.createDeepStore)({total:n.total,page:ki(n.page),count:Ai(n.count),pageCount:Oi(n.total,n.page.size),locked:!1})}build(){if(this.runtime.destroyed)throw Error(`Pagination.build: instance has been destroyed.`);return this.runtime.built?this:(this.dom.root=(0,t.jsx)(`div`,{className:this.props.className.root,role:`navigation`,"aria-label":`Pagination`,"data-pagination":`root`,children:(0,t.jsx)(`ul`,{className:this.props.className.list,"data-pagination-list":``,"aria-live":`polite`})}),this.dom.list=this.dom.root.querySelector(`[data-pagination-list]`),this.runtime.built=!0,this.bindState(),this.bindEvents(),this.emit(`init`,this.props),this)}go(e){if(this.assertActive(`go`),x(`page`,e,{type:`number`,integer:!0},`Pagination.go`),this.isLocked())return this;let n=Di(e,1,this.state.pageCount);if(n===this.state.page.current)return this;let r=this.props.lock&&typeof this.props.onChange==`function`,i=r?++this.runtime.changeId:this.runtime.changeId;if((0,t.flushSync)(()=>{this.state.page.current=n,r&&(this.state.locked=!0)}),typeof this.props.onChange==`function`){let e;try{e=this.props.onChange(n,this)}catch(e){throw this.unlock(i),e}if(r&&e&&typeof e.then==`function`){let t=()=>this.unlock(i);Promise.resolve(e).then(t,t)}else this.unlock(i)}return this}bindState(){this.cleanup.state||(this.cleanup.state=L(()=>({total:this.state.total,size:this.state.page.size,current:this.state.page.current,sibling:this.state.count.sibling,boundary:this.state.count.boundary,locked:this.state.locked}),e=>this.syncState(e),{deferInitial:!1,flushInitial:!0,flush:`sync`}))}syncState(e){x(`total`,e.total,Si,`Pagination.state`),x(`page`,{size:e.size,current:e.current},Ci,`Pagination.state`),x(`count`,{sibling:e.sibling,boundary:e.boundary},wi,`Pagination.state`);let n=Oi(e.total,e.size),r=Di(e.current,1,n);(this.state.pageCount!==n||this.state.page.current!==r)&&(0,t.flushSync)(()=>{this.state.pageCount=n,this.state.page.current=r}),this.renderItems()}renderItems(){if(!this.dom.list)return;let e=this.getPageItems(),t=[this.state.page.current,this.state.pageCount,this.isLocked()?`locked`:`unlocked`,...e.map(e=>e.key)].join(`|`);t!==this.runtime.itemsKey&&(this.runtime.itemsKey=t,this.dom.list.textContent=``,this.dom.list.append(this.buildControlItem(`prev`),...e.map(e=>this.buildPageItem(e)),this.buildControlItem(`next`)))}getPageItems(){return Fi(this.state.page.current,this.state.pageCount,{sibling:this.state.count.sibling,boundary:this.state.count.boundary})}isLocked(){return this.props.lock&&this.state.locked}isPrevDisabled(){return this.isLocked()||this.state.page.current<=1}isNextDisabled(){return this.isLocked()||this.state.page.current>=this.state.pageCount}buildControlItem(e){let n=e===`prev`?this.isPrevDisabled():this.isNextDisabled();return(0,t.jsx)(`li`,{className:this.props.className.item,"data-pagination-control":e,children:(0,t.jsx)(`button`,{className:this.props.className.button,type:`button`,"data-page-action":e,"aria-label":e===`prev`?`Go to previous page`:`Go to next page`,"aria-disabled":n?`true`:`false`,tabindex:n?`-1`:null,disabled:n,children:z(e===`prev`?`arrow-left`:`arrow-right`)})})}buildPageItem(e){let n=this.isLocked();return e.type===`more`?(0,t.jsx)(`li`,{className:[this.props.className.item,this.props.className.more].filter(Boolean).join(` `),"data-pagination-more":e.key,children:(0,t.jsx)(`span`,{className:this.props.className.button,children:z(`more`)})}):e.page===this.state.page.current?(0,t.jsx)(`li`,{className:this.props.className.item,"data-pagination-item":String(e.page),children:(0,t.jsx)(`span`,{className:this.props.className.current,"data-current-page":String(e.page),"aria-current":`page`,"aria-label":`Page ${e.page}, current page`,children:n?(0,t.jsx)(`i`,{className:this.props.className.loading,children:z(`loader`)}):String(e.page)})}):(0,t.jsx)(`li`,{className:this.props.className.item,"data-pagination-item":String(e.page),children:(0,t.jsx)(`button`,{className:this.props.className.button,type:`button`,"data-page":String(e.page),"aria-label":`Go to page ${e.page}`,"aria-disabled":n?`true`:`false`,tabindex:n?`-1`:null,disabled:n,children:String(e.page)})})}bindEvents(){this.unbindEvents();let e=this.dom.root;e&&this.cleanup.events.on(`click`,e,`click`,t=>{let n=t.target;if(!(n instanceof Element))return;let r=n.closest(`[data-page], [data-page-action]`);if(!r||!e.contains(r))return;t.preventDefault();let i=r.dataset.pageAction;if(i===`prev`&&!this.isPrevDisabled()){this.go(this.state.page.current-1);return}if(i===`next`&&!this.isNextDisabled()){this.go(this.state.page.current+1);return}r.dataset.page&&this.go(Number(r.dataset.page))})}unbindEvents(){this.cleanup.events.clear()}unlock(e){this.props.lock&&!this.runtime.destroyed&&e===this.runtime.changeId&&(0,t.flushSync)(()=>{this.state.locked=!1})}assertActive(e){if(this.runtime.destroyed)throw Error(`Pagination.${e}: instance has been destroyed.`);if(!this.runtime.built)throw Error(`Pagination.${e}: call build() first.`)}normalizeStatePatch(e){let t={...e};return Object.hasOwn(t,`page`)&&_(t.page)&&(t.page={...this.state.page,...t.page}),Object.hasOwn(t,`count`)&&_(t.count)&&(t.count={...this.state.count,...t.count}),t}validateStatePatch(e){x(`state`,e,{type:`plainObject`},`Pagination.setState`);for(let t of Object.keys(e)){if(!Object.hasOwn(Ei,t))throw Error(`Pagination.setState: "${t}" is not a supported state key.`);let n=t;x(t,e[t],Ei[n],`Pagination.setState`)}}onDestroy(){this.unbindEvents(),this.cleanup.state?.(),this.cleanup.state=null,this.dom.root?.remove(),this.runtime.built=!1,this.runtime.itemsKey=``,this.runtime.changeId=0,this.dom.list=null}};function Li(e={}){return new Ii(e)}let Ri={root:`j-menu`,list:`menu`,item:`menu-item`,hasChildren:`menu-item-has-children`,link:`menu-link`,subMenu:`sub-menu`,active:`is-active`,text:`menu-text`,backItem:`menu-item back`,backIcon:`el-icon el-prefix`},zi={type:`object`,validate:qi,message:`expects { title, id?, url?, target?, classes?, children? }.`},Bi={type:`array`,items:zi},Vi={type:{default:void 0,types:[`string`,`undefined`]},id:{default:null,types:[`string`,`null`],normalize:e=>typeof e==`string`?e.trim()||c():e??c()},data:{default:[],type:`array`,normalize:$,items:zi},backText:{default:(0,n.t)(`b`,H),type:`string`},className:{default:Ri,type:`object`,normalize:e=>({...Ri,...e&&typeof e==`object`?e:{}})}},Hi={data:Bi};function Ui(e={}){let t=S(e,Vi,`Menu.props`);return{...t,data:$(t.data),className:{...t.className}}}function Wi(e){return e==null?[]:typeof e==`string`?e.trim().split(/\s+/).filter(Boolean):e.slice()}function Gi(e){return`menu-item-${e??c()}`}function Ki(e){return typeof e==`string`?e.trim():``}function qi(e){if(!e||typeof e!=`object`||Array.isArray(e))return!1;let t=e;return(typeof t.title==`string`||typeof t.title==`number`)&&(t.id==null||typeof t.id==`string`||typeof t.id==`number`)&&(t.url==null||typeof t.url==`string`)&&(t.target==null||typeof t.target==`string`)&&(t.classes==null||typeof t.classes==`string`||Array.isArray(t.classes)&&t.classes.every(e=>typeof e==`string`))&&(t.children==null||Array.isArray(t.children)&&t.children.every(qi))}function $(e){return Array.isArray(e)?e.map(e=>{x(`item`,e,zi,`Menu.data`);let t={...e};return Array.isArray(t.classes)&&(t.classes=t.classes.slice()),Array.isArray(t.children)&&(t.children=$(t.children)),t}):[]}function Ji(e){return k(`[data-menu-link]`,e).find(t=>t.parentElement===e)||null}function Yi(e){return k(`[data-menu-list="sub"]`,e).find(t=>t.parentElement===e)||null}function Xi(e){return k(`[data-menu-back]`,e).find(t=>t.parentElement===e)||null}var Zi=class extends U{constructor(e={}){let n=Ui(e);super(n),this.dom.list=null,this.cleanup.state=null,this.runtime.built=!1,this.state=(0,t.createDeepStore)({data:$(n.data)})}build(){if(this.runtime.destroyed)throw Error(`Menu.build: instance has been destroyed.`);return this.runtime.built?this:(this.validateData(this.state.data),this.dom.root=(0,t.jsx)(`nav`,{className:this.props.className.root,"data-menu":`root`,...this.props.type!==void 0&&{"data-menu-type":this.props.type},children:(0,t.jsx)(`ul`,{className:this.props.className.list,id:this.props.id,"data-menu-list":`root`})}),this.dom.list=this.dom.root.querySelector(`[data-menu-list="root"]`),this.runtime.built=!0,this.bindState(),this.bindEvents(),this.emit(`init`,this.props),this)}bindState(){this.cleanup.state||(this.cleanup.state=L(()=>({data:F(this.state.data)}),e=>this.renderSnapshot(e),{deferInitial:!1,flushInitial:!0}))}renderSnapshot(e){if(!this.runtime.built||!this.dom.root||!this.dom.list)return;this.validateData(e.data);let t=$(I(e.data));this.dom.list.textContent=``,this.dom.list.append(...t.map(e=>this.buildItem(e)))}buildItem(e){let{className:n}=this.props,r=e.children||[],i=r.length>0,a=[n.item];i&&a.push(n.hasChildren),a.push(...Wi(e.classes));let o=Ki(e.url),s=[!i&&!o?(0,t.jsx)(`span`,{className:n.link,"data-menu-link":``,children:e.title}):(0,t.jsx)(`a`,{className:n.link,href:o,...e.target&&{target:e.target},"data-menu-link":``,children:e.title})];return i&&s.push((0,t.jsx)(`ul`,{className:n.subMenu,"data-menu-list":`sub`,children:r.map(e=>this.buildItem(e))})),(0,t.jsx)(`li`,{className:V(...a),id:Gi(e.id),"data-menu-item":e.id==null?``:String(e.id),...i&&{"data-menu-has-children":``},children:s})}bindEvents(){this.unbindEvents();let e=this.dom.root;e&&(this.props.type===`mobile`&&this.cleanup.events.on(`mobile`,e,`click`,t=>{let n=t.target;if(!(n instanceof Element))return;let r=n.closest(`[data-menu-back]`);if(r&&e.contains(r)){t.preventDefault(),this.handleBack(r);return}let i=n.closest(`[data-menu-has-children]`);if(!i||!e.contains(i)||Yi(i)?.contains(n))return;let a=Ji(i);(n===i||a&&(n===a||a.contains(n)))&&(t.preventDefault(),this.handleMenuClick(i))}),this.props.type===`bottom`&&this.cleanup.events.on(`bottom`,document,`click`,t=>{let n=t.target;if(!(n instanceof Element)||!e.isConnected)return;let r=n.closest(`[data-menu-list="sub"] [data-menu-link]`);if(r&&e.contains(r))return;let i=n.closest(`[data-menu-list="root"] > [data-menu-has-children]`);i&&e.contains(i)?(t.preventDefault(),this.toggleActive(i)):this.clearActive()}))}unbindEvents(){this.cleanup.events.clear()}handleMenuClick(e){e.classList.add(this.props.className.active);let n=Yi(e);if(!n||Xi(n))return;let{className:r}=this.props,i=(0,t.jsx)(`li`,{className:r.backItem,"data-menu-back":``,children:(0,t.jsx)(`a`,{className:r.link,href:``,"data-menu-link":``,children:[(0,t.jsx)(`span`,{className:r.backIcon,children:z(`arrow-left`)}),(0,t.jsx)(`span`,{className:r.text,children:this.props.backText})]})});n.insertBefore(i,n.firstChild)}handleBack(e){let t=e.closest(`[data-menu-back]`);if(!t)return;let n=t.parentElement?.parentElement;n?.hasAttribute(`data-menu-has-children`)&&n.classList.remove(this.props.className.active),t.remove()}toggleActive(e){let t=e.classList.contains(this.props.className.active);this.clearActive(),t||e.classList.add(this.props.className.active)}clearActive(){this.dom.root&&k(`[data-menu-item]`,this.dom.root).forEach(e=>{e.classList.remove(this.props.className.active)})}validateData(e){x(`data`,e,Bi,`Menu`)}assertStatePatchKey(e){if(!Object.hasOwn(Hi,e))throw Error(`Menu.setState: "${e}" is not a supported state key.`)}normalizeStatePatch(e){let t={...e};return Object.hasOwn(t,`data`)&&(t.data=$(t.data)),t}validateStatePatch(e){x(`state`,e,{type:`plainObject`},`Menu.setState`);for(let t of Object.keys(e)){this.assertStatePatchKey(t);let n=t;x(t,e[t],Hi[n],`Menu.setState`)}}onDestroy(){this.unbindEvents(),this.cleanup.state?.(),this.cleanup.state=null,this.dom.root?.remove(),this.dom.list=null,this.runtime.built=!1}};function Qi(e={}){return new Zi(e)}e.Component=U,e.Toast=tn,e.addIcons=Pt,e.all=k,e.copy=a,e.createAccordion=nr,e.createDrop=Ut,e.createEventManager=A,e.createFlow=jr,e.createForm=gr,e.createLoading=B,e.createMenu=Qi,e.createModal=Gr,e.createOffcanvas=vi,e.createPagination=Li,e.createParabola=yn,e.createPopup=Lt,e.createScheduledTask=Tt,e.createStateSync=L,e.createSticky=Wn,e.createSwiper=ni,e.createTabs=di,e.createTheme=fn,e.createToc=Ln,e.createTooltip=Yt,e.createValidator=An,e.debounce=gt,e.getRegistedIconPath=Nt,e.getStoreVersion=P,e.getType=xe,e.icon=z,e.iconHtml=jt,e.iconMarkup=Mt,e.isDomElementValue=_e,e.isDomNodeValue=y,e.isElement=w,e.isHtmlElementValue=ve,e.isMobile=i,e.isNilValue=v,e.isNode=C,e.isPlainObject=_,e.isRenderableContent=We,e.isRenderablePrimitive=ye,e.isRenderableValue=be,e.lazyRender=Ke,e.listen=Ze,e.normalizeContentNodes=T,e.normalizeRenderableContentNodes=Ge,e.postJson=$e,e.q=O,e.randomId=c,e.requireContainer=D,e.resolveContainer=Ue,e.resolveElement=E,e.resolveNode=He,e.resolveNodeList=Ve,e.resolveProps=S,e.restUrl=Qe,e.stateSnapshot=I,e.throttle=vt,e.timer=j,e.trackStoreVersion=F,e.uuid=s,e.validateParam=x});
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("vanilla-signal-i18n"),require("vanilla-signal"),require("vanilla-create-storage")):typeof define==`function`&&define.amd?define([`exports`,`vanilla-signal-i18n`,`vanilla-signal`,`vanilla-create-storage`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.jui={},e.vanillaSignalI18n,e.vanillaSignal,e.vanillaStorage))})(this,function(e,t,n,r){Object.defineProperty(e,b.toStringTag,{value:`Module`});var i={en:{b:`Back`,t:`Customize`,sm:`Small`,md:`Medium`,lg:`Large`,wn:`Your browser is outdated and may pose security risks. Please upgrade your browser to access this site.`},zh:{b:`返回`,t:`自定义主题`,Primary:`主色`,Radius:`圆角`,Shadow:`阴影`,Font:`字号`,Mode:`模式`,Gray:`灰色`,Olive:`橄榄绿`,Tomato:`番茄红`,Ruby:`红宝石`,Pink:`粉红`,Violet:`紫罗兰`,Indigo:`靛蓝`,Blue:`蓝色`,Teal:`青色`,Grass:`草绿`,Mint:`薄荷绿`,Lime:`酸橙绿`,Yellow:`黄色`,Orange:`橙色`,Gold:`金色`,None:`无`,sm:`小`,md:`中`,lg:`大`,XL:`更大`,Round:`圆角`,Light:`浅色`,Dark:`深色`,Auto:`自动`,Close:`关闭`,Confirm:`确认`,Upgrade:`升级`,wn:`您的浏览器版本过低,存在安全风险。请升级浏览器后再访问本站。`}},a={info:`<path d="M12 22C6.47715 22 2 17.5228 2 12 2 6.47715 6.47715 2 12 2 17.5228 2 22 6.47715 22 12 22 17.5228 17.5228 22 12 22ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM13 10.5V15H14V17H10V15H11V12.5H10V10.5H13ZM13.5 8C13.5 8.82843 12.8284 9.5 12 9.5 11.1716 9.5 10.5 8.82843 10.5 8 10.5 7.17157 11.1716 6.5 12 6.5 12.8284 6.5 13.5 7.17157 13.5 8Z"></path>`,success:`<path d="M4 12C4 7.58172 7.58172 4 12 4C16.4183 4 20 7.58172 20 12C20 16.4183 16.4183 20 12 20C7.58172 20 4 16.4183 4 12ZM12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2ZM17.4571 9.45711L16.0429 8.04289L11 13.0858L8.20711 10.2929L6.79289 11.7071L11 15.9142L17.4571 9.45711Z"></path>`,warning:`<path d="M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM11 15H13V17H11V15ZM11 7H13V13H11V7Z"></path>`,error:`<path d="M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM12 10.5858L14.8284 7.75736L16.2426 9.17157L13.4142 12L16.2426 14.8284L14.8284 16.2426L12 13.4142L9.17157 16.2426L7.75736 14.8284L10.5858 12L7.75736 9.17157L9.17157 7.75736L12 10.5858Z"></path>`,"arrow-left":`<path d="M10.8284 12.0007L15.7782 16.9504L14.364 18.3646L8 12.0007L14.364 5.63672L15.7782 7.05093L10.8284 12.0007Z"></path>`,"arrow-right":`<path d="M13.1717 12.0007L8.22192 7.05093L9.63614 5.63672L16.0001 12.0007L9.63614 18.3646L8.22192 16.9504L13.1717 12.0007Z"></path>`,"arrow-up":`<path d="M11.9999 10.8284L7.0502 15.7782L5.63599 14.364L11.9999 8L18.3639 14.364L16.9497 15.7782L11.9999 10.8284Z"></path>`,"arrow-down":`<path d="M11.9999 13.1714L16.9497 8.22168L18.3639 9.63589L11.9999 15.9999L5.63599 9.63589L7.0502 8.22168L11.9999 13.1714Z"></path>`,more:`<path d="M5 10C3.9 10 3 10.9 3 12C3 13.1 3.9 14 5 14C6.1 14 7 13.1 7 12C7 10.9 6.1 10 5 10ZM19 10C17.9 10 17 10.9 17 12C17 13.1 17.9 14 19 14C20.1 14 21 13.1 21 12C21 10.9 20.1 10 19 10ZM12 10C10.9 10 10 10.9 10 12C10 13.1 10.9 14 12 14C13.1 14 14 13.1 14 12C14 10.9 13.1 10 12 10Z"></path>`,close:`<path d="M11.9997 10.5865L16.9495 5.63672L18.3637 7.05093L13.4139 12.0007L18.3637 16.9504L16.9495 18.3646L11.9997 13.4149L7.04996 18.3646L5.63574 16.9504L10.5855 12.0007L5.63574 7.05093L7.04996 5.63672L11.9997 10.5865Z"></path>`,loader:`<path d="M12 3C16.9706 3 21 7.02944 21 12H19C19 8.13401 15.866 5 12 5V3Z"></path>`,menu:`<path d="M3 4H21V6H3V4ZM3 11H21V13H3V11ZM3 18H21V20H3V18Z"></path>`,palette:`<path fill="none" d="M0 0h24v24H0z"></path><path d="M12 2C17.5222 2 22 5.97778 22 10.8889C22 13.9556 19.5111 16.4444 16.4444 16.4444H14.4778C13.5556 16.4444 12.8111 17.1889 12.8111 18.1111C12.8111 18.5333 12.9778 18.9222 13.2333 19.2111C13.5 19.5111 13.6667 19.9 13.6667 20.3333C13.6667 21.2556 12.9 22 12 22C6.47778 22 2 17.5222 2 12C2 6.47778 6.47778 2 12 2ZM10.8111 18.1111C10.8111 16.0843 12.451 14.4444 14.4778 14.4444H16.4444C18.4065 14.4444 20 12.851 20 10.8889C20 7.1392 16.4677 4 12 4C7.58235 4 4 7.58235 4 12C4 16.19 7.2226 19.6285 11.324 19.9718C10.9948 19.4168 10.8111 18.7761 10.8111 18.1111ZM7.5 12C6.67157 12 6 11.3284 6 10.5C6 9.67157 6.67157 9 7.5 9C8.32843 9 9 9.67157 9 10.5C9 11.3284 8.32843 12 7.5 12ZM16.5 12C15.6716 12 15 11.3284 15 10.5C15 9.67157 15.6716 9 16.5 9C17.3284 9 18 9.67157 18 10.5C18 11.3284 17.3284 12 16.5 12ZM12 9C11.1716 9 10.5 8.32843 10.5 7.5C10.5 6.67157 11.1716 6 12 6C12.8284 6 13.5 6.67157 13.5 7.5C13.5 8.32843 12.8284 9 12 9Z"></path>`,message:`<path d="M2 8.99374C2 5.68349 4.67654 3 8.00066 3H15.9993C19.3134 3 22 5.69478 22 8.99374V21H8.00066C4.68659 21 2 18.3052 2 15.0063V8.99374ZM20 19V8.99374C20 6.79539 18.2049 5 15.9993 5H8.00066C5.78458 5 4 6.78458 4 8.99374V15.0063C4 17.2046 5.79512 19 8.00066 19H20ZM14 11H16V13H14V11ZM8 11H10V13H8V11Z"></path>`,chat:`<path d="M10 3H14C18.4183 3 22 6.58172 22 11C22 15.4183 18.4183 19 14 19V22.5C9 20.5 2 17.5 2 11C2 6.58172 5.58172 3 10 3ZM12 17H14C17.3137 17 20 14.3137 20 11C20 7.68629 17.3137 5 14 5H10C6.68629 5 4 7.68629 4 11C4 14.61 6.46208 16.9656 12 19.4798V17Z"></path>`,discuss:`<path d="M14 22.5L11.2 19H6C5.44772 19 5 18.5523 5 18V7.10256C5 6.55028 5.44772 6.10256 6 6.10256H22C22.5523 6.10256 23 6.55028 23 7.10256V18C23 18.5523 22.5523 19 22 19H16.8L14 22.5ZM15.8387 17H21V8.10256H7V17H11.2H12.1613L14 19.2984L15.8387 17ZM2 2H19V4H3V15H1V3C1 2.44772 1.44772 2 2 2Z"></path>`};let o=`http://www.w3.org/2000/svg`,s=a;function c(e){if(!(e in s))throw Error(`Icon "${e}" not found.`)}function l(e){return c(e),`<svg xmlns="${o}" viewBox="0 0 24 24" fill="currentColor">${s[e]}</svg>`}function u(e){return e!==null&&e.namespaceURI===o}function d(e,t={}){let n=document.createElement(`template`);n.innerHTML=l(e);let r=n.content.firstElementChild;if(!u(r))throw Error(`Icon "${e}" cannot be rendered.`);for(let[e,n]of Object.entries(t||{})){if(n==null||n===!1)continue;let t=e===`className`?`class`:e;r.setAttribute(t,n===!0?``:String(n))}return r}function f(e){return l(e)}let p=f;function m(){return{...s}}function h(e){if(typeof e!=`object`||!e)throw Error(`Icons must be a valid object.`);for(let[t,n]of Object.entries(e)){if(typeof n!=`string`||!n.trim().startsWith(`<`))throw Error(`Invalid SVG path for icon "${t}".`);s[t]=n}}function g(...e){return e.filter(Boolean).join(` `)}var _=typeof global==`object`&&global&&global.Object===Object&&global,v=typeof self==`object`&&self&&self.Object===Object&&self,y=_||v||Function(`return this`)(),b=y.Symbol,x=Object.prototype,S=x.hasOwnProperty,C=x.toString,w=b?b.toStringTag:void 0;function T(e){var t=S.call(e,w),n=e[w];try{e[w]=void 0;var r=!0}catch{}var i=C.call(e);return r&&(t?e[w]=n:delete e[w]),i}var E=Object.prototype.toString;function D(e){return E.call(e)}var O=`[object Null]`,k=`[object Undefined]`,A=b?b.toStringTag:void 0;function j(e){return e==null?e===void 0?k:O:A&&A in Object(e)?T(e):D(e)}function ee(e,t){return function(n){return e(t(n))}}var te=ee(Object.getPrototypeOf,Object);function M(e){return typeof e==`object`&&!!e}var N=`[object Object]`,ne=Function.prototype,P=Object.prototype,F=ne.toString,I=P.hasOwnProperty,re=F.call(Object);function ie(e){if(!M(e)||j(e)!=N)return!1;var t=te(e);if(t===null)return!0;var n=I.call(t,`constructor`)&&t.constructor;return typeof n==`function`&&n instanceof n&&F.call(n)==re}function L(e){return ie(e)}function R(e){return e==null}function ae(e){return typeof Node<`u`&&e instanceof Node}function oe(e){return typeof Element<`u`&&e instanceof Element}function se(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function ce(e){return typeof e==`string`||typeof e==`number`||typeof e==`boolean`}function le(e){return R(e)||ce(e)||typeof e==`function`||Array.isArray(e)||ae(e)}let ue=e=>e===null?`null`:Array.isArray(e)?`array`:se(e)?`HTMLElement`:ae(e)?`Node`:typeof e;function de(e){return Array.isArray(e)?e.slice():L(e)?{...e}:e}function fe(e={}){return typeof e==`string`||Array.isArray(e)?{type:e}:!e||typeof e!=`object`?{}:e}function z(e,t){throw Error(`Validator: ${e} ${t}`)}function pe(e){return typeof e==`string`?e:String(e)}function me(e){return typeof e==`string`?`string`:`array`}function he(e,t,n){if(R(t)||typeof t!=`string`&&!Array.isArray(t))return;let r=me(t);n.nonEmpty&&t.length===0&&z(e,`expects a non-empty ${r}.`),typeof n.minLength==`number`&&t.length<n.minLength&&z(e,`expects ${r} length to be at least ${n.minLength}.`),typeof n.maxLength==`number`&&t.length>n.maxLength&&z(e,`expects ${r} length to be at most ${n.maxLength}.`)}function ge(e,t,n){R(t)||typeof t!=`number`||(n.finite&&!Number.isFinite(t)&&z(e,`expects a finite number.`),n.integer&&!Number.isInteger(t)&&z(e,`expects an integer.`),typeof n.min==`number`&&t<n.min&&z(e,`expects a number greater than or equal to ${n.min}.`),typeof n.max==`number`&&t>n.max&&z(e,`expects a number less than or equal to ${n.max}.`),typeof n.greaterThan==`number`&&t<=n.greaterThan&&z(e,`expects a number greater than ${n.greaterThan}.`),typeof n.lessThan==`number`&&t>=n.lessThan&&z(e,`expects a number less than ${n.lessThan}.`))}function _e(e,t,n){!n.plain||R(t)||L(t)||z(e,`expects an object.`)}function ve(e,t,n){!n.items||R(t)||(Array.isArray(t)||z(e,`expects array.`),t.forEach((t,r)=>{B(String(r),t,n.items,e)}))}function ye(e,t,n){if(!n.shape||R(t))return;(!t||typeof t!=`object`||Array.isArray(t))&&z(e,`expects object.`);let r=t;for(let[t,i]of Object.entries(n.shape))B(t,r[t],i,e)}function be(e,t){return t===`renderable`?le(e):t===`Node`?ae(e):t===`Element`?oe(e):t===`HTMLElement`?se(e):t===`plainObject`?L(e):ue(e)===t}function xe(e){return L(e)?`object`:ue(e)}function Se(e,t,n=[]){let r=Array.isArray(n)?n:n?[n]:[];for(let n of r){let r,i;if(typeof n==`function`)r=n,i=`does not satisfy the required condition.`;else if(n&&typeof n.test==`function`)r=n.test,i=n.message||`condition failed.`;else throw Error(`Validator: Condition must be a function or { test, message }.`);r(t)||z(e,i)}}function Ce(e,t){return e?`${e}.${t}`:t}function B(e,t,n={},r=``){let i=fe(n),a=Ce(r,e),o=Object.hasOwn(i,`types`)?i.types:i.type;if(i.required&&R(t)&&z(a,`is required.`),o!==void 0){let e=Array.isArray(o)?o:[o],n=xe(t);e.some(e=>be(t,e))||z(a,`expects ${e.join(`, `)}, but got ${n}.`)}return Array.isArray(i.enum)&&!i.enum.includes(t)&&z(a,`expects one of ${i.enum.map(pe).join(`, `)}.`),he(a,t,i),ge(a,t,i),_e(a,t,i),ve(a,t,i),ye(a,t,i),Se(a,t,i.conditions),typeof i.validate==`function`&&(i.validate(t)||z(a,i.message||`does not satisfy the required condition.`)),t}function V(e={},t={},n=`Options`){let r=e??{};if(typeof r!=`object`||Array.isArray(r))throw Error(`${n} expects object.`);let i=r,a={...i},o=Object.entries(t||{});for(let[e,t]of o){let n=fe(t);a[e]=Object.hasOwn(i,e)?i[e]:we(n)}for(let[e,n]of o){let r=fe(n);typeof r.normalize==`function`&&(a[e]=r.normalize(a[e],{key:e,input:i,options:a,schema:t}))}for(let[e,t]of o)B(e,a[e],t,n);return a}function we(e){if(!Object.hasOwn(e,`default`))return;let t=e.default;return de(e.factory&&typeof t==`function`?t():t)}let Te=[`node`,`element`,`array`];function Ee(e){return Te.includes(e)}function De(e){return ae(e)}function H(e){return oe(e)}function Oe(e){return typeof e==`string`||H(e)||De(e)||Array.isArray(e)}function ke(e){return e.find(H)||null}function Ae(e,t=[]){for(let n of e){if(Array.isArray(n)){if(!Ae(n,t))return null;continue}if(De(n)){t.push(n);continue}return null}return t}function je(e){if(e===!1||e==null)return null;if(typeof e==`string`){let t=G(e);return t.length>0?t:null}if(Array.isArray(e)){let t=Ae(e,[]);return t&&t.length>0?t:null}return De(e)?[e]:null}function Me(e){return H(e)||De(e)?e:typeof e==`string`?document.querySelector(e):Array.isArray(e)&&(je(e)||[])[0]||null}function U(e){if(!Oe(e))return null;if(typeof e==`string`){let t=document.querySelector(e);return H(t)?t:null}if(Array.isArray(e)){let t=je(e);return Array.isArray(t)?ke(t):null}return H(e)?e:null}function Ne(e,t=`Component`,n=`element`){if(!Ee(n))throw Error(`${t}: expect must be one of 'node', 'element', 'array'.`);return Oe(e)?n===`array`?je(e):n===`node`?Me(e):U(e):null}function Pe(e,t=`Component`,n=`element`){let r=Ne(e,t,n);if(r==null)throw Error(`${t}: container not found.`);return r}function Fe(e){return le(e)}function W(e,t=document){return t.querySelector(e)}function G(e,t=document){return Array.from(t.querySelectorAll(e))}function Ie(e,t,n={}){if(typeof t!=`function`)throw TypeError(`lazyRender: renderCallback expects function.`);let{threshold:r=.1,rootMargin:i=`0px`,root:a=null,waitForDOM:o=!0}=n,s={threshold:r,rootMargin:i,root:a};if(!Re(e))return console.warn(`lazyRender: target 必须是 CSS 选择器字符串或 DOM 元素`),Le;let c=Le,l=ze(e);if(l&&document.body.contains(l))return c=Be(l,t,s),c;if(!o||typeof MutationObserver>`u`)return t(),c;let u=new MutationObserver(()=>{let n=ze(e);!n||!document.body.contains(n)||(l=n,u.disconnect(),c=Be(l,t,s))});return u.observe(document.documentElement,{childList:!0,subtree:!0}),()=>{u.disconnect(),c()}}function Le(){}function Re(e){return typeof e==`string`||H(e)}function ze(e){return typeof e==`string`?W(e):e}function Be(e,t,n){if(typeof window>`u`||window.IntersectionObserver===void 0)return t(),Le;let r=new window.IntersectionObserver(n=>{for(let i of n)if(i.isIntersecting){r.unobserve(e),r.disconnect(),t();break}},n);return r.observe(e),()=>{r.unobserve(e),r.disconnect()}}function Ve(e,t,n,r){let i=!0;return e.addEventListener(t,n,r),()=>{i&&(i=!1,e.removeEventListener(t,n,r))}}function K(){let e=new Map,t=t=>{let n=e.get(t);return n?(n(),e.delete(t),!0):!1};return{on(n,r,i,a,o){if(typeof n!=`string`||n.trim()===``)throw TypeError(`EventManager.on: key expects a non-empty string.`);if(t(n),r==null)return()=>{};let s=Ve(r,i,a,o);return e.set(n,s),s},off:t,clear(){for(let t of e.values())t();e.clear()},size(){return e.size}}}function He(){if(typeof crypto.randomUUID==`function`)return crypto.randomUUID();let e=new Uint8Array(16);if(typeof crypto.getRandomValues!=`function`)throw Error(`Your browser is too old to support secure login.`);crypto.getRandomValues(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t=Array.from(e).map(e=>e.toString(16).padStart(2,`0`)).join(``);return[t.slice(0,8),t.slice(8,12),t.slice(12,16),t.slice(16,20),t.slice(20,32)].join(`-`)}function q(e=8){if(!Number.isInteger(e)||e<1||e>87381)throw Error(`Length must be an integer between 1 and 87381`);let t=Math.ceil(e*3/4),n=new Uint8Array(t);crypto.getRandomValues(n);let r=``;for(let e of n)r+=String.fromCharCode(e);return btoa(r).substring(0,e).replace(/\+/g,`-`).replace(/\//g,`_`)}let J={},Ue={timers:J,start(e,t,n){J[e]&&clearTimeout(J[e]),J[e]=setTimeout(()=>{n(),delete J[e]},t)},cancel(e){J[e]&&(clearTimeout(J[e]),delete J[e])}},We={container:`j-toast-container`,toast:`j-toast`,icon:`el-icon`,message:`el-text`,lite:`j-toast-lite`,action:`j-toast is-action`,actions:`toast-actions`,button:`j-button is-sm`,closeBtn:`is-ghost`,actionBtn:`is-outline`,info:`is-info`,primary:`is-primary`,success:`is-success`,warning:`is-warning`,error:`is-error`},Ge={type:`string`,enum:[`info`,`success`,`warning`,`error`,`primary`]},Ke={type:`number`,min:0},qe={type:`number`,greaterThan:0},Je=new Set,Y=new Map,X=new Map,Ye=new Map,Xe=We;function Ze(e){return{...We,...e}}function Qe(e){return Ze({...Xe,...e?.className})}function $e(e){let t=W(`[data-toast-container]`);return t?t.className=e.container:(t=(0,n.jsx)(`div`,{className:e.container,"data-toast-container":``}),(0,n.insert)(document.body,t)),t}function et(e,t,n,r){let i=`${e}-${t}`;return Je.add(i),Ue.start(i,r,()=>{Je.delete(i),n()}),i}function tt(e){for(let t of Array.from(Je))t.startsWith(`${e}-`)&&(Ue.cancel(t),Je.delete(t))}function nt(e){X.get(e)?.cancel(),X.delete(e),Ye.delete(e),e.remove(),Y.get(e)?.(),Y.delete(e);let t=W(`[data-toast-container]`);t&&t.children.length===0&&t.remove()}function rt(e,t,n){return{duration:e.ownerDocument.defaultView?.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches?0:t,easing:n,fill:`both`}}function it(e){return e.finished.then(()=>void 0,()=>void 0)}function at(e,t){let n=e.hasAttribute(`data-toast-lite`);return n&&t===`enter`?[{opacity:0},{opacity:1}]:n?[{opacity:1,transform:`translate(-50%, -50%)`},{opacity:0,transform:`translate(-50%, calc(-50% - 8px))`}]:t===`enter`?[{opacity:0,transform:`translate3d(0, -16px, 0)`},{opacity:1,transform:`translate3d(0, 0, 0)`}]:[{opacity:1,transform:`translate3d(0, 0, 0)`},{opacity:0,transform:`translate3d(0, -16px, 0)`}]}async function ot(e,t){let n=(Ye.get(e)||0)+1;if(Ye.set(e,n),X.get(e)?.cancel(),X.delete(e),typeof e.animate!=`function`)return;let r=e.hasAttribute(`data-toast-lite`),i=e.animate(at(e,t),rt(e,t===`enter`?r?150:240:r?120:180,t===`enter`?`cubic-bezier(0.16, 1, 0.3, 1)`:`cubic-bezier(0.4, 0, 1, 1)`));X.set(e,i),await it(i),Ye.get(e)===n&&X.get(e)===i&&X.delete(e)}function st(e,t,n,r){e.removeAttribute(`data-mount`),e.setAttribute(`aria-live`,n),t(),e.getBoundingClientRect(),ot(e,`enter`).then(()=>{!e.isConnected||e.dataset.mount===`false`||r?.()})}function ct(e){e&&e.getAttribute(`data-mount`)!==`false`&&(Y.get(e)?.(),Y.delete(e),tt(e.dataset.toast||q()),e.removeAttribute(`aria-live`),e.setAttribute(`data-mount`,`false`),ot(e,`leave`).then(()=>{e.dataset.mount===`false`&&nt(e)}))}function lt(e=``,t=3e3,r=`info`,i={}){B(`message`,e,`string`,`Toast.show`),B(`duration`,t,Ke,`Toast.show`),B(`type`,r,Ge,`Toast.show`);let a=Qe(i),o=q(),s=(0,n.jsx)(`div`,{className:g(a.toast,a[r]),"data-toast":o,role:`alert`,"aria-atomic":`true`,children:[(0,n.jsx)(`span`,{className:a.icon,"data-toast-icon":o,children:d(r===`primary`?`info`:r)}),(0,n.jsx)(`span`,{className:a.message,"data-toast-message":o,children:e})]});return st(s,()=>(0,n.insert)($e(a),s),r===`error`?`assertive`:`polite`),t>0&&et(o,`hide`,()=>ct(s),t),Y.set(s,Ve(s,`click`,()=>ct(s))),s}function ut(e=``,t=2e3,r={}){B(`message`,e,`string`,`Toast.lite`),B(`duration`,t,qe,`Toast.lite`);let i=Qe(r),a=W(`[data-toast-lite]`);a&&(tt(a.dataset.toast||``),X.get(a)?.cancel(),nt(a));let o=q(),s=(0,n.jsx)(`div`,{className:i.lite,"data-toast":o,"data-toast-lite":``,children:e});return st(s,()=>(0,n.insert)(document.body,s),`polite`),et(o,`hide`,()=>ct(s),t),s}function dt(e=``,r={}){B(`message`,e,`string`,`Toast.action`);let a=r.text?.close||(0,t.t)(`Close`,i),o=r.text?.action||(0,t.t)(`Confirm`,i),s=Qe(r),c=q(),l=(0,n.jsx)(`div`,{className:g(s.action,s[r.type||`info`]),"data-toast":c,"data-toast-action":``,children:[(0,n.jsx)(`div`,{className:s.message,"data-toast-message":c,children:e}),(0,n.jsx)(`div`,{className:s.actions,"data-toast-actions":c,children:[(0,n.jsx)(`button`,{className:g(s.button,s.closeBtn),children:a,"data-action":`close`,"aria-label":a,onClick:async()=>{await r.onClose?.(),ct(l)}}),(0,n.jsx)(`button`,{className:g(s.button,s.actionBtn),children:o,"data-action":`toast-action`,"aria-label":o,onClick:async()=>{await r.onAction?.(),ct(l)}})]})]});return st(l,()=>(0,n.insert)($e(s),l),`polite`,()=>{W(`[data-action="toast-action"]`,l)?.focus()}),l}function ft(){for(let e of Je)Ue.cancel(e);Je.clear();for(let e of Y.values())e();Y.clear();for(let e of X.values())e.cancel();X.clear(),Ye.clear(),W(`[data-toast-container]`)?.remove(),W(`[data-toast-lite]`)?.remove()}let pt={timers:Je,disposers:Y,configure(e={}){return Xe=Ze(e.className),{className:Xe}},show:lt,success:(e=``,t=3e3,n={})=>lt(e,t,`success`,n),info:(e=``,t=3e3,n={})=>lt(e,t,`info`,n),primary:(e=``,t=3e3,n={})=>lt(e,t,`primary`,n),warning:(e=``,t=3e3,n={})=>lt(e,t,`warning`,n),error:(e=``,t=3e3,n={})=>lt(e,t,`error`,n),hide:ct,lite:ut,action:dt,clearAll:ft,destroyAll:ft};function mt(){if(typeof navigator>`u`)return!1;if(typeof navigator.userAgentData?.mobile==`boolean`)return navigator.userAgentData.mobile;let e=navigator.userAgent||``;return/\b(BlackBerry|webOS|iPhone|IEMobile|Android|Windows Phone|iPad|iPod)\b/i.test(e)?!0:typeof window>`u`||typeof window.matchMedia!=`function`?!1:window.matchMedia(`(pointer: coarse)`).matches&&window.matchMedia(`(max-width: 820px)`).matches}async function ht(e){if(typeof window>`u`||typeof document>`u`)return Promise.resolve(!1);let t=String(e);if(navigator.clipboard&&typeof navigator.clipboard.writeText==`function`)try{return await navigator.clipboard.writeText(t),!0}catch{return gt(t)}return gt(t)}function gt(e){let t=null;try{return t=document.createElement(`textarea`),t.value=e,t.setAttribute(`readonly`,``),t.style.position=`absolute`,t.style.left=`-9999px`,t.style.opacity=`0`,document.body.appendChild(t),t.select(),t.setSelectionRange(0,e.length),document.execCommand(`copy`)}catch{return!1}finally{t&&t.parentNode&&t.parentNode.removeChild(t)}}function _t(){try{return typeof Object.hasOwn==`function`&&typeof[].at==`function`}catch{return!1}}function vt(){return _t()?!0:(pt.action((0,t.t)(`wn`,i),{type:`error`,onAction:()=>{window.open(`https://www.google.cn/chrome/fallback/`,`_blank`)},className:{actionBtn:`j-button is-sm is-danger`}}),!1)}let yt=typeof window<`u`?`${window.location.origin}/wp-json`:``;async function bt(e,t,n={}){let r=new Headers(n.headers);return r.has(`Content-Type`)||r.set(`Content-Type`,`application/json`),(await fetch(e,{...n,method:`POST`,headers:r,body:JSON.stringify(t)})).json()}function xt(...e){return{async enter(t){await Promise.all(e.map(e=>e.enter(t)))},async leave(t){await Promise.all(e.map(e=>e.leave(t)))},cancel(){for(let t of e)t.cancel()}}}function St(e,t){let n=e.finished.then(()=>void 0,()=>void 0);return t?new Promise(e=>{let r=()=>{t.removeEventListener(`abort`,r),e()};if(t.aborted){r();return}t.addEventListener(`abort`,r,{once:!0}),n.then(r)}):n}function Ct(e,t){let n={fill:`both`,...t.options},r=e.ownerDocument.defaultView;return t.respectReducedMotion!==!1&&r?.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches&&(n.duration=0,n.delay=0,n.endDelay=0),n}function wt(e,t){let n=null,r=()=>{let t=e()||null;return!t||typeof t.animate!=`function`?null:t},i=e=>e===1||!Array.isArray(t.keyframes)?t.keyframes:t.keyframes.slice().reverse(),a=async(e,a)=>{if(a?.aborted)return;let o=r();o&&(n?.cancel(),n=o.animate(i(e),Ct(o,t)),await St(n,a),a?.aborted)};return{enter:e=>a(1,e),leave:e=>a(-1,e),cancel(){n?.cancel(),n=null}}}function Tt(e,t={}){let n=t.axis||`vertical`,r=null,i=null,a=null,o=`1`,s=0,c=e=>n===`vertical`?e.style.height:e.style.width,l=(e,t)=>{n===`vertical`?e.style.height=t:e.style.width=t},u=()=>{!r||!a||(l(r,a.size),r.style.opacity=a.opacity,r.style.overflow=a.overflow,r.style.visibility=a.visibility)},d=()=>{let t=e()||null;return t===r?r:(i?.cancel(),u(),i=null,r=t,a=t?{size:c(t),opacity:t.style.opacity,overflow:t.style.overflow,visibility:t.style.visibility}:null,o=t?.ownerDocument.defaultView?.getComputedStyle(t).opacity||`1`,r)},f=e=>{let n=d();if(!(!n||!a)){if(e){u();return}l(n,`0px`),n.style.overflow=`hidden`,n.style.visibility=`hidden`,t.fade!==!1&&(n.style.opacity=`0`)}},p=e=>{if(!a)return 0;let t=c(e),r=e.style.visibility;l(e,a.size),e.style.visibility=a.visibility;let i=e.getBoundingClientRect(),o=n===`vertical`?Math.max(i.height,e.scrollHeight):Math.max(i.width,e.scrollWidth);return l(e,t),e.style.visibility=r,o},m=async(e,r)=>{if(r?.aborted)return;let c=d();if(!c||!a)return;let l=c.getBoundingClientRect(),u=n===`vertical`?l.height:l.width,m=c.ownerDocument.defaultView?.getComputedStyle(c).opacity,h=i?m||(e?`0`:o):c.style.opacity||m||(e?`0`:o),g=++s;i?.cancel(),i=null;let _=e?p(c):0;if(c.style.overflow=`hidden`,c.style.visibility=a.visibility,typeof c.animate!=`function`){f(e);return}let v=Ct(c,{keyframes:[],options:{duration:250,easing:`ease`,...t.options,fill:`both`},respectReducedMotion:t.respectReducedMotion});i=c.animate([{[n===`vertical`?`height`:`width`]:`${u}px`,...t.fade===!1?{}:{opacity:h}},{[n===`vertical`?`height`:`width`]:`${_}px`,...t.fade===!1?{}:{opacity:e?o:`0`}}],v);let y=i;await St(y,r),!(g!==s||r?.aborted)&&(y.cancel(),i===y&&(i=null),f(e))};return{enter:e=>m(!0,e),leave:e=>m(!1,e),setExpanded(e){s+=1,i?.cancel(),i=null,f(e)},cancel(){s+=1,i?.cancel(),i=null,u(),r=null,a=null}}}function Et(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}var Dt=function(){return y.Date.now()},Ot=/\s/;function kt(e){for(var t=e.length;t--&&Ot.test(e.charAt(t)););return t}var At=/^\s+/;function jt(e){return e&&e.slice(0,kt(e)+1).replace(At,``)}var Mt=`[object Symbol]`;function Nt(e){return typeof e==`symbol`||M(e)&&j(e)==Mt}var Pt=NaN,Ft=/^[-+]0x[0-9a-f]+$/i,It=/^0b[01]+$/i,Lt=/^0o[0-7]+$/i,Rt=parseInt;function zt(e){if(typeof e==`number`)return e;if(Nt(e))return Pt;if(Et(e)){var t=typeof e.valueOf==`function`?e.valueOf():e;e=Et(t)?t+``:t}if(typeof e!=`string`)return e===0?e:+e;e=jt(e);var n=It.test(e);return n||Lt.test(e)?Rt(e.slice(2),n?2:8):Ft.test(e)?Pt:+e}var Bt=`Expected a function`,Vt=Math.max,Ht=Math.min;function Ut(e,t,n){var r,i,a,o,s,c,l=0,u=!1,d=!1,f=!0;if(typeof e!=`function`)throw TypeError(Bt);t=zt(t)||0,Et(n)&&(u=!!n.leading,d=`maxWait`in n,a=d?Vt(zt(n.maxWait)||0,t):a,f=`trailing`in n?!!n.trailing:f);function p(t){var n=r,a=i;return r=i=void 0,l=t,o=e.apply(a,n),o}function m(e){return l=e,s=setTimeout(_,t),u?p(e):o}function h(e){var n=e-c,r=e-l,i=t-n;return d?Ht(i,a-r):i}function g(e){var n=e-c,r=e-l;return c===void 0||n>=t||n<0||d&&r>=a}function _(){var e=Dt();if(g(e))return v(e);s=setTimeout(_,h(e))}function v(e){return s=void 0,f&&r?p(e):(r=i=void 0,o)}function y(){s!==void 0&&clearTimeout(s),l=0,r=c=i=s=void 0}function b(){return s===void 0?o:v(Dt())}function x(){var e=Dt(),n=g(e);if(r=arguments,i=this,c=e,n){if(s===void 0)return m(c);if(d)return clearTimeout(s),s=setTimeout(_,t),p(c)}return s===void 0&&(s=setTimeout(_,t)),o}return x.cancel=y,x.flush=b,x}var Wt=`Expected a function`;function Gt(e,t,n){var r=!0,i=!0;if(typeof e!=`function`)throw TypeError(Wt);return Et(n)&&(r=`leading`in n?!!n.leading:r,i=`trailing`in n?!!n.trailing:i),Ut(e,t,{leading:r,maxWait:t,trailing:i})}let Kt=null,qt=null,Jt=!1;function Yt(e){if(typeof queueMicrotask==`function`){queueMicrotask(e);return}Promise.resolve().then(e)}function Xt(){Jt||(Jt=!0,Yt(Qt))}function Zt(e){e.enqueued=!0,qt?qt.next=e:Kt=e,qt=e,Xt()}function Qt(){Jt=!1;let e=Kt;Kt=null,qt=null;let t=e;for(;t;){let e=t.next;t.next=null,t.enqueued=!1,!t.disposed&&t.queued&&(t.queued=!1,t.run()),t=e}}function $t(e){let t={queued:!1,enqueued:!1,disposed:!1,next:null,run:e};return{schedule(){t.disposed||t.queued||(t.queued=!0,t.enqueued||Zt(t))},flush(){t.disposed||(t.queued=!1,t.run())},cancel(){t.queued=!1},dispose(){t.disposed=!0,t.queued=!1}}}function en(e){if(e&&typeof e==`object`){let t=e.__version__;return typeof t==`number`?t:0}return 0}function tn(e){return en(e),e}function nn(e){return(0,n.unwrap)(e)}function rn(e,t,{deferInitial:r=!0,flushInitial:i=!1,flush:a=`microtask`}={}){let o=!1,s=!1,c,l=$t(()=>{s&&(s=!1,(0,n.untrack)(()=>t(c)))}),u=(0,n.createWatch)(e,e=>{let t=!o;if(o=!0,c=e,s=!0,t&&i||a===`sync`){l.flush();return}l.schedule()},{defer:r});return()=>{l.dispose(),u.dispose()}}function an(){let e=null;return{get current(){return e},set(t){e=t},clear(){e=null}}}function on(){let e=new Map;return{elements:e,get(t){return e.get(t)},bind(t){return r=>{e.set(t,r),(0,n.onCleanup)(()=>{e.get(t)===r&&e.delete(t)})}},delete(t){e.delete(t)},clear(){e.clear()}}}function sn(e,t={}){let r,i=t.removeOnDispose!==!1,a=(0,n.createRoot)(t=>(r=(0,n.untrack)(e),i&&(0,n.onCleanup)(()=>r.remove()),t));return{element:r,dispose:a}}function cn(e){return e.filter(e=>e!=null&&e.isConnected)}function ln(e){e[0]?.getBoundingClientRect()}function un(e){return e.split(`,`).map(e=>{let t=e.trim();return t.endsWith(`ms`)?Number.parseFloat(t)||0:t.endsWith(`s`)?(Number.parseFloat(t)||0)*1e3:0})}function dn(e){return e.split(`,`).map(e=>{let t=Number.parseFloat(e);return Number.isFinite(t)?t:0})}function fn(e,t,n=[1],r=[!0]){let i=Math.max(e.length,t.length,n.length,r.length),a=0;for(let o=0;o<i;o+=1){if(!r[o%r.length])continue;let i=(e[o%e.length]||0)*(n[o%n.length]||0)+(t[o%t.length]||0);a=Math.max(a,i)}return Math.max(0,a)}function pn(e){let t=e.ownerDocument.defaultView;if(!t)return 0;let n=t.getComputedStyle(e),r=fn(un(n.transitionDuration),un(n.transitionDelay),[1],n.transitionProperty.split(`,`).map(e=>e.trim()!==`none`)),i=fn(un(n.animationDuration),un(n.animationDelay),dn(n.animationIterationCount),n.animationName.split(`,`).map(e=>e.trim()!==`none`));return Math.max(r,i)}function mn(e,t){return new Promise(n=>{if(t?.aborted){n();return}let r=()=>{clearTimeout(i),t?.removeEventListener(`abort`,r),n()},i=setTimeout(r,e);t?.addEventListener(`abort`,r,{once:!0})})}async function hn(e,t){let n=new Set,r=0;for(let t of e){if(typeof t.getAnimations!=`function`){r=Math.max(r,pn(t));continue}for(let e of t.getAnimations()){let t=e.effect?.getComputedTiming().endTime;(typeof t!=`number`||Number.isFinite(t))&&n.add(e)}}let i=Array.from(n,e=>e.finished);if(r>0&&i.push(mn(r,t)),i.length===0)return;let a=Promise.allSettled(i);if(!t){await a;return}await new Promise(e=>{let n=()=>{t.removeEventListener(`abort`,n),e()};if(t.aborted){n();return}t.addEventListener(`abort`,n,{once:!0}),a.then(n)})}function gn(e){let t=`hidden`,r=0,i=null,a=null,o=null,s=()=>(o?.abort(),o=new AbortController,o.signal);return{get phase(){return t},enter:()=>{if(t===`visible`)return Promise.resolve(!1);if(t===`entering`&&i)return i;let a=++r,o=s();return t=`entering`,i=(async()=>{e.mount();let i=cn(e.elements());return ln(i),(0,n.flushSync)(e.activate),e.motion?await e.motion.enter(o):await hn(i,o),a===r?(t=`visible`,!0):!1})(),i},leave:()=>{if(t===`hidden`)return Promise.resolve(!1);if(t===`leaving`&&a)return a;let i=++r,o=s();return t=`leaving`,a=(async()=>{(0,n.flushSync)(e.deactivate);let a=cn(e.elements());return e.motion?await e.motion.leave(o):await hn(a,o),i===r?(e.unmount(),t=`hidden`,!0):!1})(),a},cancel(){r+=1,o?.abort(),o=null,e.motion?.cancel(),t=`hidden`,i=null,a=null}}}function Z(e=`center`,t=`center`){let r=d(`loader`,{width:24});return requestAnimationFrame(()=>{typeof r.animate==`function`&&r.animate([{transform:`rotate(0deg)`},{transform:`rotate(360deg)`}],{duration:1e3,iterations:1/0,easing:`linear`})}),(0,n.jsx)(`div`,{"aria-live":`polite`,style:{display:`flex`,justifyContent:e,alignItems:t,position:`absolute`,width:`100%`,height:`100%`,borderRadius:`inherit`,backdropFilter:`blur(4px)`},children:r})}let _n={className:{default:`j-popup-layout`,type:`string`},position:{default:`center`,type:`string`},component:{default:``,type:`string`},labelledby:{default:``,type:`string`},content:{default:``,type:`renderable`}};function vn(e){let t=V(e,_n,`Popup`);return{className:t.className,position:t.position,component:t.component,labelledby:t.labelledby,content:t.content}}function yn(e={}){let{className:t,position:r,component:i,labelledby:a,content:o}=vn(e),s={className:`${t} is-${r}`,role:`dialog`,children:o};return i&&(s[`data-${i}`]=`root`,s[`aria-${i}`]=`true`),a&&(s[`aria-labelledby`]=a),(0,n.jsx)(`div`,s)}let bn={root:`j-drop`,container:`drop-container`},xn={name:{default:null,types:[`string`,`null`]},mode:{default:`click`,type:`string`,enum:[`hover`,`click`]},position:{default:`auto`,type:`string`,enum:[`auto`,`top-left`,`top-center`,`top-right`,`bottom-left`,`bottom-center`,`bottom-right`,`left`,`right`]},offset:{default:10,type:`number`,min:0},content:{default:``,type:`renderable`},cache:{default:!1,type:`boolean`},ttl:{default:0,type:`number`,min:0},className:{default:bn,type:`object`,normalize:e=>({...bn,...e&&typeof e==`object`?e:{}})},id:{default:null,types:[`string`,`null`],normalize:e=>typeof e==`string`?e.trim()||q():e??q()},delay:{default:0,types:[`number`,`object`]},hoverIntent:{default:!0,type:`boolean`},onShown:{default:null,types:[`function`,`null`]},onHidden:{default:null,types:[`function`,`null`]}};function Sn(e){let t=V(e,xn,`Drop`);return{name:t.name,mode:t.mode,position:t.position,offset:t.offset,content:t.content,cache:t.cache,ttl:t.ttl,className:t.className,id:t.id,delay:t.delay,hoverIntent:t.hoverIntent,onShown:t.onShown,onHidden:t.onHidden}}function Cn(e){return typeof e==`number`&&e>=0?{show:e,hide:e}:typeof e==`object`&&e?{show:Number(e.show)||0,hide:Number(e.hide)||0}:{show:0,hide:0}}function wn(e){return typeof e==`number`&&e>0?e:0}function Tn(e,t={}){let r=U(e),i=Sn(t),a=K(),o=Cn(i.delay),s={show:null,hide:null},c={x:0,y:0,lastMoveTime:0},l=0,u=0,d=!1,f=!1,p,m=null,h=null,g=0,_=()=>{},[v,y]=(0,n.createSignal)(typeof i.content==`function`?null:i.content),[b,x]=(0,n.createSignal)(!1),S=()=>{if(b())return Z();let e=v();return typeof e==`function`?e(p):e},{root:C}=(0,n.createRoot)(e=>{_=e;let t=(0,n.jsx)(`div`,{className:i.className.container,"data-drop-container":i.name||i.id,"aria-live":()=>typeof i.content==`function`?`polite`:null,"aria-busy":()=>String(b()),children:S});return{root:(0,n.jsx)(`div`,{className:i.className.root,id:i.id,"data-drop":i.name||q(),"aria-expanded":`false`,children:t})}}),w=e=>{s[e]&&clearTimeout(s[e]),s[e]=null},T=async()=>{let e=i.content;if(typeof e!=`function`){y(e);return}let t=wn(i.ttl);if(i.cache&&m&&(!t||Date.now()-m.updatedAt<=t)){y(m.content);return}if(h)return h;let n=++g;x(!0);let r=Promise.resolve().then(()=>e(p)).then(e=>{f||n!==g||(i.cache&&(m={content:e,updatedAt:Date.now()}),y(e))}).finally(()=>{n===g&&!f&&x(!1),h===r&&(h=null)});return h=r,r},E=()=>{if(!r)return;let e=r.getBoundingClientRect(),{offset:t,position:n}=i;C.style.visibility=`hidden`,C.style.display=`block`;let a=C.getBoundingClientRect(),o=0,s=0,c=n;switch(c===`auto`&&(c=window.innerHeight-e.bottom>a.height+t?`bottom-center`:`top-center`),c){case`top-left`:o=e.top-a.height-t,s=e.left;break;case`top-center`:o=e.top-a.height-t,s=e.left+e.width/2-a.width/2;break;case`top-right`:o=e.top-a.height-t,s=e.right-a.width;break;case`bottom-left`:o=e.bottom+t,s=e.left;break;case`bottom-center`:o=e.bottom+t,s=e.left+e.width/2-a.width/2;break;case`bottom-right`:o=e.bottom+t,s=e.right-a.width;break;case`left`:o=e.top+e.height/2-a.height/2,s=e.left-a.width-t;break;case`right`:o=e.top+e.height/2-a.height/2,s=e.right+t;break;default:break}o=Math.max(8,Math.min(o,window.innerHeight-a.height-8)),s=Math.max(8,Math.min(s,window.innerWidth-a.width-8)),C.style.top=`${o+window.scrollY}px`,C.style.left=`${s+window.scrollX}px`,C.style.visibility=``,C.style.display=``},D=e=>{f||d===e||(e?(C.parentNode||(0,n.insert)(document.body,C),E(),T().then(()=>{d&&!f&&E()})):(g+=1,h=null,x(!1),C.style.top=``,C.style.left=``,C.remove()),C.setAttribute(`aria-expanded`,e?`true`:`false`),d=e,e?i.onShown?.(p):i.onHidden?.(p))},O=e=>{e.target instanceof Node&&r&&!C.contains(e.target)&&!r.contains(e.target)&&p.hide()},k=e=>{e instanceof MouseEvent&&(l=e.clientX,u=e.clientY,c.lastMoveTime=Date.now(),c.x=e.clientX,c.y=e.clientY)},A=()=>{a.on(`document:mousemove`,document,`mousemove`,k),w(`show`),s.show=setTimeout(()=>{let e=Date.now()-c.lastMoveTime;Math.abs(c.x-l)+Math.abs(c.y-u)<5||e>100?(p.show(!1),a.off(`document:mousemove`)):A()},o.show)};return p={get target(){return r},props:i,get element(){return f?null:C},get isVisible(){return d},delayShow:o.show,delayHide:o.hide,show(e=!0){w(`hide`),!(d||f)&&(e&&o.show>0?(w(`show`),s.show=setTimeout(()=>D(!0),o.show)):D(!0))},hide(e=!0){w(`show`),!(!d||f)&&(e&&o.hide>0?(w(`hide`),s.hide=setTimeout(()=>D(!1),o.hide)):D(!1))},toggle(){d?p.hide():p.show()},destroy(){f||(f=!0,w(`show`),w(`hide`),a.clear(),g+=1,h=null,x(!1),C.remove(),_(),r=null,d=!1)}},r&&(i.mode===`hover`?(a.on(`target:enter`,r,`mouseenter`,()=>{i.hoverIntent?A():p.show()}),a.on(`target:leave`,r,`mouseleave`,()=>{w(`show`),a.off(`document:mousemove`),p.hide()}),a.on(`root:enter`,C,`mouseenter`,()=>p.show()),a.on(`root:leave`,C,`mouseleave`,()=>p.hide())):(a.on(`target:click`,r,`click`,()=>p.toggle()),a.on(`document:click`,document,`click`,O))),p}let En={container:`j-tooltip`,message:`el-text`,ui:{reverse:`is-reverse`,primary:`is-primary`,success:`is-success`,warning:`is-warning`,error:`is-error`}};function Dn(e){let t=e&&typeof e==`object`?e:{},n=`ui`in t&&t.ui&&typeof t.ui==`object`?t.ui:{};return{...En,...t,ui:{...En.ui,...n}}}let On={name:{default:null,types:[`string`,`null`]},mode:{default:`hover`,type:`string`,enum:[`hover`,`click`]},position:{default:`auto`,type:`string`,enum:[`auto`,`top-left`,`top-center`,`top-right`,`bottom-left`,`bottom-center`,`bottom-right`,`left`,`right`]},offset:{default:8,type:`number`},message:{default:``,type:`string`,normalize:e=>typeof e==`string`?e.trim():e,nonEmpty:!0},theme:{default:!1,types:[`string`,`boolean`],enum:[!1,`reverse`,`primary`,`success`,`warning`,`error`]},cache:{default:!1,type:`boolean`},ttl:{default:0,type:`number`,min:0},className:{default:En,type:`object`,normalize:Dn},id:{default:null,types:[`string`,`null`]},delay:{default:100,types:[`number`,`object`]},hoverIntent:{default:!0,type:`boolean`},onShown:{default:null,types:[`function`,`null`]},onHidden:{default:null,types:[`function`,`null`]}};function kn(e){let t=V(e,On,`Tooltip.props`);return{name:t.name,mode:t.mode,position:t.position,offset:t.offset,message:t.message,theme:t.theme,cache:t.cache,ttl:t.ttl,className:t.className,id:t.id,delay:t.delay,hoverIntent:t.hoverIntent,onShown:t.onShown,onHidden:t.onHidden}}function An(e,t={}){let r=kn(t),i=(0,n.jsx)(`div`,{className:g(r.className.container,r.theme&&r.className.ui[r.theme]),"data-tooltip":r.name||r.id||``,children:(0,n.jsx)(`div`,{className:r.className.message,"data-tooltip-message":``,children:r.message})}),a=Tn(e,{name:r.name,mode:r.mode,position:r.position,offset:r.offset,cache:r.cache,ttl:r.ttl,id:r.id,delay:r.delay,hoverIntent:r.hoverIntent,onShown:r.onShown,onHidden:r.onHidden,content:i});return{get element(){return a?.element||null},get drop(){return a},show(e=!0){a?.show(e)},hide(e=!0){a?.hide(e)},toggle(){a?.toggle()},destroy(){a?.destroy(),a=null}}}let jn={panel:`j-theme-palette`,title:`theme-palette-title`,container:`palette-container`,item:`palette-item`,itemTitle:`item-title`,items:`items`,button:`j-button is-default`,active:`is-active`,prefix:`el-prefix`,swatch:`item-hex`,buttonText:`button-text`},Mn={mode:`dark`,theme:`indigo`,radius:`sm`,shadow:`sm`,font:`sm`,key:`ui-theme`,className:jn},Nn={theme:`j-theme-`,radius:`j-radius-`,shadow:`j-shadow-`,font:`j-font-`};function Pn(e){return{...jn,...e}}function Fn(e={}){return{...Mn,...e,className:Pn(e.className)}}function In(e){return e===`mode`||e===`theme`||e===`radius`||e===`shadow`||e===`font`}function Ln(){return(0,r.createStorage)({driver:`cookie`,codec:`json`,namespace:``,keySeparator:``,driverOptions:{path:`/`,sameSite:`Lax`,secure:typeof location<`u`&&location.protocol===`https:`},ttl:864e5*7})}function Rn(e){if(!L(e))return null;let t=e,n={};for(let e of[`mode`,`theme`,`radius`,`shadow`,`font`]){let r=t[e];typeof r==`string`&&(n[e]=r)}return Object.keys(n).length?n:null}function zn(e){return[{title:e(`Primary`),type:`theme`,buttons:[[`gray`,e(`Gray`)],[`olive`,e(`Olive`)],[`tomato`,e(`Tomato`)],[`ruby`,e(`Ruby`)],[`pink`,e(`Pink`)],[`violet`,e(`Violet`)],[`indigo`,e(`Indigo`)],[`blue`,e(`Blue`)],[`teal`,e(`Teal`)],[`grass`,e(`Grass`)],[`mint`,e(`Mint`)],[`lime`,e(`Lime`)],[`yellow`,e(`Yellow`)],[`orange`,e(`Orange`)],[`gold`,e(`Gold`)]]},{title:e(`Radius`),type:`radius`,buttons:[[`none`,e(`None`)],[`sm`,e(`sm`)],[`md`,e(`md`)],[`lg`,e(`lg`)],[`xl`,e(`XL`)],[`round`,e(`Round`)]]},{title:e(`Shadow`),type:`shadow`,buttons:[[`none`,e(`None`)],[`sm`,e(`sm`)],[`md`,e(`md`)],[`lg`,e(`lg`)]]},{title:e(`Font`),type:`font`,buttons:[[`sm`,e(`sm`)],[`md`,e(`md`)]]},{title:e(`Mode`),type:`mode`,buttons:[[`light`,e(`Light`)],[`dark`,e(`Dark`)],[`auto`,e(`Auto`)]]}]}function Bn(e={}){let r=(0,n.createDeepStore)(Fn(e)),a={configVersion:0,destroyed:!1},o=Ln(),s=new Set,c=K(),l=e=>(0,t.t)(e,i),u=()=>window.matchMedia?.(`(prefers-color-scheme: dark)`).matches?`dark`:`light`,d=()=>{let{mode:e,theme:t,radius:n,shadow:i,font:a}=r,s={mode:e,theme:t,radius:n,shadow:i,font:a,render:e===`auto`?u():e};o.set(r.key,s).catch(()=>{})},f=e=>{let t=(0,n.createRoot)(t=>{for(let t of G(`[data-theme-group]`,e)){let e=t.dataset.themeGroup;if(In(e))for(let i of G(`[data-theme-button]`,t)){let t=()=>i.dataset.themeValue===String(r[e]);(0,n.bindClass)(i,r.className.active,t),(0,n.bindAttr)(i,`aria-selected`,()=>t()?`true`:null)}}return t});s.add(t)},p=(e=null,t=null)=>{let i=r.className,a=t||zn(l),o=(0,n.jsx)(`div`,{className:e||i.panel,"data-theme-palette":`root`,children:[(0,n.jsx)(`h3`,{className:i.title,"data-theme-title":``,style:{margin:`0 0 1rem`},children:l(`t`)}),(0,n.jsx)(`div`,{className:i.container,"data-theme-container":``,children:a.map(e=>(0,n.jsx)(`div`,{className:i.item,"data-palette":e.type,"data-theme-group":e.type,children:[(0,n.jsx)(`div`,{className:i.itemTitle,"data-theme-group-title":e.type,children:e.title}),(0,n.jsx)(`div`,{className:i.items,"data-theme-items":e.type,children:e.buttons.map(([t,a])=>{let o=String(r[e.type])===String(t);return(0,n.jsx)(`button`,{className:g(i.button,o&&i.active),"data-palette":t,"data-theme-button":e.type,"data-theme-value":t,"aria-selected":o?`true`:null,children:[e.type===`theme`?(0,n.jsx)(`span`,{className:g(i.prefix,i.swatch),"data-theme-swatch":t,style:{backgroundColor:`var(--ui-${t})`}}):null,(0,n.jsx)(`span`,{className:i.buttonText,"data-theme-button-text":t,children:a})]})})})]}))})]});return f(o),o},m=e=>{a.configVersion+=1,(0,n.flushSync)(()=>{Object.assign(r,e,{className:Pn({...r.className,...e.className})})}),d()},h=()=>{if(!a.destroyed){a.destroyed=!0,c.clear();for(let e of s)e();s.clear(),o.close().catch(()=>{})}};c.on(`palette`,document.body,`click`,e=>{if(!(e.target instanceof Element))return;let t=e.target.closest(`[data-theme-button]`),i=(t?.closest(`[data-theme-group]`))?.dataset.themeGroup,o=t?.dataset.themeValue;if(!t||!In(i)||!o||t.classList.contains(r.className.active))return;let s=r[i];a.configVersion+=1,(0,n.flushSync)(()=>{r[i]=o});let c=document.documentElement;if(i===`mode`)c.classList.remove(`light`,`dark`,s),c.classList.add(o===`auto`?u():o);else{let e=Nn[i],t=Array.from(c.classList).filter(t=>t.startsWith(e));t.length&&c.classList.remove(...t),c.classList.add(`${e}${o}`)}d()});let _=a.configVersion;return o.get(r.key).then(e=>{if(a.destroyed||a.configVersion!==_)return;let t=Rn(e);t&&(0,n.flushSync)(()=>{Object.assign(r,t)})}).catch(()=>{}),{props:r,createPanel:p,setConfig:m,destroy:h}}let Vn={color:`var(--tone-solid)`,size:`12px`},Hn={ball:`parabola-ball`},Un={types:[`string`,`Node`,`array`,`null`,`undefined`]},Wn={ball:{default:Vn,type:`plainObject`,normalize:e=>({...Vn,...e&&typeof e==`object`?e:{}}),shape:{color:`string`,size:`string`}},className:{default:Hn,type:`object`,normalize:e=>({...Hn,...e&&typeof e==`object`?e:{}})},from:{default:null,...Un},to:{default:null,...Un},direction:{default:`center`,type:`string`,enum:[`center`,`top-right`,`top-left`,`bottom-right`,`bottom-left`]},showDelay:{default:0,type:`number`},onShow:{default:null,types:[`function`,`null`]},onHidden:{default:null,types:[`function`,`null`]}};function Gn(e){let t=V(e,Wn,`Parabola.props`);return{ball:t.ball,className:t.className,from:t.from,to:t.to,direction:t.direction,showDelay:t.showDelay,onShow:t.onShow,onHidden:t.onHidden}}function Kn(e={}){let t=Gn(e),r={destroyed:!1},i=new Set,a=new Map,o=new Map,s=null,c=U(t.from),l=U(t.to),u,d=()=>{if(!r.destroyed){if(s){s.isConnected||(0,n.insert)(document.body,s);return}s=(0,n.jsx)(`div`,{"data-parabola":`root`,style:{position:`fixed`,inset:`0`,pointerEvents:`none`,zIndex:`9999`}}),(0,n.insert)(document.body,s)}},f=()=>{!r.destroyed||i.size>0||(s?.remove(),s=null)},p=(e,n)=>{if(!i.has(e))return;let r=o.get(e);r&&cancelAnimationFrame(r),o.delete(e),e.remove(),i.delete(e),n&&t.onHidden?.(u),f()},m=e=>{if(r.destroyed||(d(),!s))return null;let{color:a,size:o}=t.ball,c=(0,n.jsx)(`div`,{className:t.className.ball,"data-parabola":`ball`,style:{backgroundColor:a,width:o,height:o,position:`fixed`,borderRadius:`50%`,transform:`translate(-50%, -50%)`,pointerEvents:`none`,zIndex:`9999`,opacity:`1`,left:`${e.startX}px`,top:`${e.startY}px`}});return(0,n.insert)(s,c),i.add(c),c},h=()=>{let e=c?.getBoundingClientRect(),n=l?.getBoundingClientRect();if(!e||!n)return null;let{left:r,top:i,width:a,height:o}=e,{left:s,top:u,width:d,height:f}=n,p,m;switch(t.direction){case`top-left`:p=r+a*.2,m=i+o*.2;break;case`top-right`:p=r+a*.8,m=i+o*.2;break;case`bottom-left`:p=r+a*.2,m=i+o*.8;break;case`bottom-right`:p=r+a*.8,m=i+o*.8;break;default:p=r+a/2,m=i+o/2}let h=s+d/2,g=u+f/2;return{startX:p,startY:m,endX:h,endY:g}},g=(e,t,n,i,a,s=800)=>{if(!e.isConnected)return;let c=performance.now(),l=i-t,u=a-n,d=i=>{if(r.destroyed||!e.isConnected){o.delete(e);return}let a=i-c,f=Math.min(a/s,1),m=1-(1-f)**3,h=t+l*m,g=n+-100*Math.sin(Math.PI*m)+u*m,_=1-f;e.style.left=`${h}px`,e.style.top=`${g}px`,e.style.opacity=`${_}`,e.style.transform=`translate(-50%, -50%) scale(${1-m*.3})`,f<1?o.set(e,requestAnimationFrame(d)):(o.delete(e),p(e,!0))};o.set(e,requestAnimationFrame(d))},_=(e,n)=>{let r=`parabola-show-${q()}`;a.set(r,n),Ue.start(r,t.showDelay,()=>{a.delete(r),e()})},v=()=>{for(let[e,t]of a)Ue.cancel(e),t();a.clear()};return u={props:t,runtime:r,get element(){return s},show(){return r.destroyed?Promise.resolve(!1):new Promise(e=>{_(()=>{if(r.destroyed){e(!1);return}c=U(t.from),l=U(t.to);let n=h();if(!n){e(!1);return}let i=m(n);if(!i){e(!1);return}t.onShow?.(u),g(i,n.startX,n.startY,n.endX,n.endY),e(!0)},()=>e(!1))})},destroy(){if(!r.destroyed){v(),c=null,l=null,r.destroyed=!0;for(let e of i)p(e,!1);o.clear(),f()}}},d(),u}let qn={target:{default:null},parent:{default:null},max:{default:10,type:`number`,integer:!0,greaterThan:0},top:{default:16,type:`number`,min:0},gap:{default:16,type:`number`,min:0},overflow:{default:`destroy`,type:`string`,enum:[`destroy`,`ignore`]},reactive:{default:!1,type:`boolean`},onReBuild:{default:null,types:[`function`,`null`]}};function Jn(e){let t=V(e,qn,`Sticky.props`);return{target:t.target,parent:t.parent,max:t.max,top:t.top,gap:t.gap,overflow:t.overflow,reactive:t.reactive,onReBuild:t.onReBuild}}function Yn(e){let t=e.filter(e=>e instanceof HTMLElement);return Array.from(new Set(t))}function Xn(e){return e===!1||e==null?null:Pe(e,`Sticky.parent`,`element`)}function Zn(e,t){if(e===!1||e==null)return[];if(typeof e==`string`){if(!t)return Yn(Pe(e,`Sticky.target`,`array`));let n=Yn(G(e,t));if(n.length===0)throw Error(`Sticky.target: target not found.`);return n}let n=Yn(Pe(e,`Sticky.target`,`array`));if(!t)return n;let r=n.filter(e=>e===t||t.contains(e));if(r.length===0)throw Error(`Sticky.target: target not found in parent.`);return r}function Qn(e={}){let t=Jn(e),r=(0,n.createDeepStore)({items:[]}),i={built:!1,destroyed:!1,reBuilding:!1,reBuildFrameId:0},a={originalStyles:new Map,keys:new WeakMap},o=null,s=[],c=null,l,u=e=>e.length<=t.max?e:t.overflow===`ignore`?[]:e.slice(-t.max),d=()=>{for(let e of a.originalStyles.values())f(e)},f=e=>{e.element.style.position=e.originalPosition,e.element.style.top=e.originalTop,e.element.style.zIndex=e.originalZIndex},p=(e,t)=>{if(e.id)return e.id;let n=a.keys.get(e);if(n)return n;let r=`sticky-${q()}-${t}`;return a.keys.set(e,r),r},m=e=>{a.originalStyles.has(e)||a.originalStyles.set(e,{element:e,originalPosition:e.style.position,originalTop:e.style.top,originalZIndex:e.style.zIndex})},h=()=>u(Zn(t.target,o)),g=(e=t.top)=>{let i=e,o=[],c=new Set(s);for(let[e,t]of a.originalStyles)c.has(e)||(f(t),a.originalStyles.delete(e));return s.forEach((e,n)=>{m(e),e.style.position=`sticky`,e.style.top=`${i}px`,o.push({key:p(e,n),index:n,top:i}),i+=e.offsetHeight+t.gap}),(0,n.flushSync)(()=>{r.items=o}),t.onReBuild?.(l),i},_=()=>{if(c?.disconnect(),c=null,!t.reactive)return;let e=o||document.body;c=new MutationObserver(()=>{i.reBuilding||i.destroyed||!i.built||(i.reBuilding=!0,i.reBuildFrameId=requestAnimationFrame(()=>{i.reBuilding=!1,i.reBuildFrameId=0,l.reBuild()}))}),c.observe(e,{childList:!0,subtree:!0})};return l={props:t,state:r,runtime:i,build:()=>{if(i.destroyed)throw Error(`Sticky.build: instance destroyed`);return i.built?l:(o=Xn(t.parent),s=h(),i.built=!0,_(),s.length===0?((0,n.flushSync)(()=>{r.items=[]}),l):(g(),l))},reBuild:()=>(!i.destroyed&&i.built&&(s=h(),g()),l),destroy:()=>{i.destroyed||(i.reBuildFrameId&&cancelAnimationFrame(i.reBuildFrameId),c?.disconnect(),c=null,d(),i.destroyed=!0,i.built=!1,i.reBuilding=!1,i.reBuildFrameId=0,a.originalStyles.clear(),s=[],o=null)}},l}let $n={rules:{default:{},type:`object`},messages:{default:{},type:`object`},onSubmit:{default:null,types:[`function`,`null`]}};function er(e){let t=V(e,$n,`Validator.props`);return{rules:t.rules,messages:t.messages,onSubmit:t.onSubmit}}function tr(e){return e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement}function nr(e){if(!e)return null;if(e instanceof Element)return tr(e)?e:null;for(let t of Array.from(e))if(t instanceof Element&&tr(t))return t;return null}function rr(){return{valid:!0,message:``,destroyed:!1}}function ir(e){return e.closest(`[data-form-control]`)||e.parentElement}function ar(e){return Array.from(e.selectedOptions).map(e=>e.value.trim())}function or(e){return e instanceof HTMLInputElement&&e.type===`file`}function sr(e){return!!e.files&&e.files.length>0}function cr(e,t){return t===!0?e instanceof HTMLSelectElement?ar(e).some(e=>e.length>0):e.value.trim().length>=1:!0}function lr(e,t){return typeof t!=`number`||e.value.length>=t}function ur(e,t){return typeof t!=`number`||e.value.length<=t}function dr(e){return/^([\w-.]+@([\w-]+\.)+[\w-]{2,4})?$/.test(e.value)}function fr(e,t,n){if(!e||typeof n!=`string`)return!0;let r=nr(e.elements.namedItem(n));if(!r)throw Error(`Validator: target element "${n}" not found.`);return t.value===r.value}function pr(e,t){if(!(e instanceof HTMLInputElement)||e.type!==`checkbox`)throw Error(`Validator: element expects a checkbox input, but ${e.tagName.toLowerCase()} given.`);return e.checked===t}function mr(e,t){if(!(e instanceof HTMLSelectElement))throw Error(`Validator: element expects a select element, but ${e.tagName.toLowerCase()} given.`);return t!==!0||ar(e).some(e=>e.length>0)}function hr(e,t){if(!(e instanceof HTMLSelectElement))throw Error(`Validator: element expects a select element, but ${e.tagName.toLowerCase()} given.`);return t!==!0||e.selectedOptions.length>0}function gr(e,t){return!(e instanceof HTMLSelectElement)||typeof t!=`number`||e.selectedOptions.length>=t}function _r(e,t){return!(e instanceof HTMLSelectElement)||typeof t!=`number`||e.selectedOptions.length<=t}function vr(e,t){return!/\s/.test(e.value)||t!==!0}function yr(e,t){return typeof t==`string`||t instanceof RegExp?new RegExp(t).test(e.value):!0}function br(e,t){return!or(e)||t!==!0||sr(e)}function xr(e,t){return!or(e)||!sr(e)||typeof t!=`number`||e.files[0].size>=t}function Sr(e,t){return!or(e)||!sr(e)||typeof t!=`number`||e.files[0].size<=t}function Cr(e,t){if(!or(e)||!sr(e)||typeof t!=`string`)return!0;let n=e.files[0];return t.split(`,`).map(e=>e.trim().toLowerCase()).some(e=>e.startsWith(`.`)?n.name.toLowerCase().endsWith(e):e.endsWith(`/*`)?n.type.startsWith(e.replace(`/*`,`/`)):n.type===e)}function wr(e,t,r,i,a,o=``){(!(r instanceof HTMLInputElement)||r.type!==`checkbox`)&&(r.classList.remove(`is-valid`),r.classList.add(`is-invalid`));let s=o||e?.messages[i]?.[a]||``;if(!s)return;t.message=s;let c=ir(r);if(!c)return;let l=G(`[data-validator-help]`,c).find(e=>e.dataset.validatorHelp===i)||null;l||(l=(0,n.jsx)(`div`,{className:`help-block is-invalid`,"data-validator-help":i}),c.appendChild(l)),l.textContent=s}function Tr(e){let t=ir(e);if(t)for(let n of G(`[data-validator-help]`,t))n.dataset.validatorHelp===e.name&&n.remove();(!(e instanceof HTMLInputElement)||e.type!==`checkbox`)&&(e.classList.remove(`is-invalid`),e.classList.add(`is-valid`))}function Er(e,t={},n=!1){B(`bindEvents`,n,`boolean`,`Validator`);let r=U(e);if(!(r instanceof HTMLFormElement))throw Error(`Validator.element expects a form element.`);let i=r,a=er(t),o=rr(),s=K(),c,l=(e,t)=>{if(typeof t!=`function`)return!0;let n=t(e,c);return typeof n==`string`?n:!!n},u=(e,t)=>{let n=a?.rules[t];if(!n)return!0;for(let r of Object.keys(n)){let s=n[r],c=``;switch(r){case`required`:o.valid=cr(e,s);break;case`minLength`:o.valid=lr(e,s);break;case`maxLength`:o.valid=ur(e,s);break;case`equalTo`:o.valid=fr(i,e,s);break;case`email`:o.valid=dr(e);break;case`checked`:o.valid=pr(e,s);break;case`selected`:o.valid=mr(e,s);break;case`multiple`:o.valid=hr(e,s);break;case`min`:o.valid=gr(e,s);break;case`max`:o.valid=_r(e,s);break;case`noSpace`:o.valid=vr(e,s);break;case`noChinese`:o.valid=!/[\u4e00-\u9fa5]/.test(e.value);break;case`noSpecial`:o.valid=!/[@#$%^&*]+/g.test(e.value);break;case`pattern`:o.valid=yr(e,s);break;case`file`:o.valid=br(e,s);break;case`minSize`:o.valid=xr(e,s);break;case`maxSize`:o.valid=Sr(e,s);break;case`accept`:o.valid=Cr(e,s);break;case`validate`:{let t=l(e,s);o.valid=t===!0,c=typeof t==`string`?t:``;break}}if(!o.valid){wr(a,o,e,t,r,c);break}Tr(e)}return o.valid},d=()=>{if(!i||!a||o.destroyed)return!1;o.valid=!0,o.message=``;for(let e of Array.from(i.elements))if(!(!tr(e)||!e.name)&&a.rules[e.name]&&(o.valid=u(e,e.name),!o.valid))break;return o.valid&&a.onSubmit?.(c),o.valid},f=({native:e=!0}={})=>{if(i){e&&i.reset();for(let e of Array.from(i.elements))tr(e)&&e.classList.remove(`is-valid`,`is-invalid`);for(let e of G(`[data-validator-help]`,i))e.remove();o.valid=!0,o.message=``}};return c={get element(){return i},get props(){return a},set props(e){a=e},runtime:o,validate:d,reset:f,destroy:()=>{o.destroyed||(o.destroyed=!0,s.clear(),f({native:!1}),i=null,a=null,o.valid=!1,o.message=``)}},n&&(s.on(`submit`,i,`submit`,e=>{e.preventDefault(),d()}),s.on(`reset`,i,`reset`,()=>f({native:!1}))),c}let Dr=new Map;function Or(e,t){!e||!t||Dr.set(e,t)}function kr(e){Dr.delete(e)}function Ar(e){typeof e==`function`?e():e&&typeof e.destroy==`function`&&e.destroy()}function Q(e){let t={built:!1,mounted:!1,destroyed:!1},r=new Map,i=new Set,a=new Map,o=null,s=null,c,l=n=>{if(t.destroyed)throw Error(`${e.name}.${n}: instance destroyed`)},u=(e,...t)=>{for(let n of r.get(e)||[])try{n(...t)}catch{}},d={props:e.props,state:e.state,runtime:t,get element(){return o},own(e){e&&i.add(e)},assertActive:l,emit:u},f={props:e.props,state:e.state,runtime:t,get element(){return o},build(){if(l(`build`),t.built)return c;let n=sn(()=>e.view(d),{removeOnDispose:e.ownsElement});return o=n.element,s=n.dispose,t.built=!0,e.onBuild?.(d),u(`build`,c),c},mount(n){if(l(`mount`),t.built||c.build(),!o)throw Error(`${e.name}.mount: view did not create an element.`);return o.parentNode!==n&&n.appendChild(o),t.mounted=!0,e.onMount?.(d),u(`mount`,c,n),c},unmount(){return l(`unmount`),!t.mounted&&!o?.parentNode?c:(e.onUnmount?.(d),e.ownsElement!==!1&&o?.remove(),t.mounted=!1,u(`unmount`,c),c)},setState(t={},r){l(`setState`);let i=typeof t==`string`&&arguments.length>1?{[t]:r}:t;if(!L(i))throw Error(`${e.name}.setState: expects a plain object patch.`);let a=e.normalizeStatePatch?e.normalizeStatePatch(i):i;if(!L(a))throw Error(`${e.name}.setState: expects a plain object patch.`);if(e.validateStatePatch)e.validateStatePatch(a,e.state);else for(let t of Object.keys(a))if(!Object.hasOwn(e.state,t))throw Error(`${e.name}.setState: "${t}" is not a supported state key.`);return(0,n.flushSync)(()=>{Object.assign(e.state,a)}),c},own(e){return e&&i.add(e),c},use(e,t){if(!e)return c;let n=typeof e==`function`?e(c,t):e.install(c,t);return a.set(e,n),c},on(e,t){if(!e||typeof t!=`function`)return c;let n=r.get(e);return n||(n=new Set,r.set(e,n)),n.add(t),c},off(e,t){return r.get(e)?.delete(t),c},emit(e,...t){return u(e,...t),c},destroy(){if(!t.destroyed){t.destroyed=!0,e.onDestroy?.(d),u(`destroy`,c);for(let e of i)try{Ar(e)}catch{}i.clear();for(let e of a.values())try{Ar(e)}catch{}a.clear(),s?.(),s=null,e.ownsElement!==!1&&o?.remove(),o=null,t.built=!1,t.mounted=!1,r.clear()}}};c=Object.assign(f,e.actions||{});for(let e of Dr.values())c.use(e);return c}let jr={toc:`j-toc`,list:`toc-list`,link:`toc-link`,active:`is-active`,levelPrefix:`is-level-`},Mr={target:{default:`.j-content`},headings:{default:`h2, h3`,type:`string`},offset:{default:80,type:`number`,min:0},reactive:{default:!1,type:`boolean`},className:{default:jr,type:`object`,normalize:e=>({...jr,...e&&typeof e==`object`?e:{}})},onChange:{default:null,types:[`function`,`null`]}};function Nr(e){let t=V(e,Mr,`Toc.props`);return{target:t.target,headings:t.headings,offset:t.offset,reactive:t.reactive,className:t.className,onChange:t.onChange}}function Pr(e){let t=/^H([1-6])$/.exec(e.tagName);return t?Number(t[1]):1}function Fr(e,t){return e.id||=`toc-${q()}-${t}`,{id:e.id,text:e.textContent||``,level:Pr(e)}}function Ir(e={}){let t=Nr(e),r=(0,n.createDeepStore)({items:[],current:{index:-1,item:null}}),i={ticking:!1,frameId:0,refreshing:!1,refreshFrameId:0},a=K(),o=null,s=[],c=null,l,u=(0,n.createMemo)(()=>r.items),d=e=>{if(e===r.current.index)return;let i=r.items[e]||null;(0,n.flushSync)(()=>{r.current={index:e,item:i}}),t.onChange?.(i,e,l)},f=()=>{if(!l.runtime.built)return;let e=-1,n=t.offset+1;for(let t=s.length-1;t>=0;t--)if(s[t].getBoundingClientRect().top<=n){e=t;break}d(e)},p=()=>{i.ticking||(i.ticking=!0,i.frameId=requestAnimationFrame(()=>{i.ticking=!1,i.frameId=0,f()}))},m=()=>{i.refreshing||(i.refreshing=!0,i.refreshFrameId=requestAnimationFrame(()=>{i.refreshing=!1,i.refreshFrameId=0,_()}))},h=(e,{activeIndex:n=-1,updateHash:r=!1}={})=>{let i=s.find(t=>t.id===e.id);if(!i)return;let a=window.scrollY||window.pageYOffset||0,o=Math.max(0,i.getBoundingClientRect().top+a-t.offset);window.scrollTo({top:o,behavior:`smooth`}),n>=0&&d(n),r&&window.history?.pushState&&window.history.pushState(null,``,`#${e.id}`)},_=()=>{if(l.runtime.destroyed||!l.runtime.built||!o)return;s=G(t.headings,o);let e=s.map(Fr);(0,n.flushSync)(()=>{r.items=e,r.current={index:-1,item:null}}),f()};return l=Q({name:`Toc`,props:t,state:r,actions:{activate:e=>(l.runtime.built&&Number.isInteger(e)&&e>=0&&e<r.items.length&&h(r.items[e]),l)},view:()=>(0,n.jsx)(`nav`,{className:t.className.toc,"data-toc":`root`,children:(0,n.jsx)(`div`,{className:t.className.list,"data-toc-list":`root`,children:(0,n.For)({each:u,key:e=>e.id,children:(e,i)=>(0,n.jsx)(`a`,{className:()=>{let n=e();return g(t.className.link,`${t.className.levelPrefix}${n.level}`,r.current.index===i()?t.className.active:``)},href:()=>`#${e().id}`,"data-toc-index":()=>String(i()),"data-toc-target":()=>e().id,"data-active":()=>r.current.index===i()?`1`:`0`,onClick:t=>{t.preventDefault(),h(e(),{activeIndex:i(),updateHash:!0})},children:()=>e().text})})})}),onBuild(e){o=Pe(t.target,`Toc.target`),a.on(`scroll`,window,`scroll`,p,{passive:!0}),e.own(()=>a.clear()),_(),t.reactive&&(c=new MutationObserver(m),c.observe(o,{childList:!0,subtree:!0,characterData:!0}),e.own(()=>{c?.disconnect(),c=null}))},onDestroy(){i.frameId&&cancelAnimationFrame(i.frameId),i.refreshFrameId&&cancelAnimationFrame(i.refreshFrameId),i.frameId=0,i.refreshFrameId=0,i.ticking=!1,i.refreshing=!1,c?.disconnect(),c=null,o=null,s=[]}}),l}let Lr={root:`j-accordion`,header:`accordion-header`,title:`header-title`,arrow:`header-arrow j-button is-icon is-ghost is-sm`,panel:`accordion-panel`,content:`panel-content`},Rr={type:`plainObject`,shape:{name:[`string`,`null`,`undefined`],title:`renderable`,content:`renderable`,cache:[`boolean`,`undefined`],ttl:[`number`,`undefined`]}},zr={type:`array`,nonEmpty:!0,items:Rr},Br={id:{default:null,types:[`string`,`null`],normalize:e=>typeof e==`string`?e.trim()||q():e??q()},active:{default:0,types:[`number`,`string`,`array`,`null`],validate:e=>e==null?!0:Array.isArray(e)?e.every(Vr):Vr(e),message:`expects a non-negative integer, non-empty string, array or null.`},collapsible:{default:!1,type:`boolean`},multiple:{default:!1,type:`boolean`},direction:{default:`vertical`,type:`string`,enum:[`vertical`,`horizontal`]},className:{default:Lr,type:`object`,normalize:e=>({...Lr,...e&&typeof e==`object`?e:{}})},onChange:{default:null,types:[`function`,`null`]},data:{default:[],...zr}};function Vr(e){return typeof e==`number`?Number.isInteger(e)&&e>=0:typeof e==`string`&&e.trim().length>0}function Hr(e){let t=V(e,Br,`Accordion.props`);return{id:t.id,active:t.active,collapsible:t.collapsible,multiple:t.multiple,direction:t.direction,className:t.className,data:Wr(t.data,!1),onChange:t.onChange}}function Ur(e,t,n=!0){n&&B(String(t),e,Rr,`Accordion.data`);let r=e,i=typeof r.name==`string`?r.name.trim():``;return{...r,name:i||q()}}function Wr(e,t=!0){t&&B(`data`,e,zr,`Accordion`);let n=new Set;return e.map((e,t)=>{let r=Ur(e,t,!1),i=r.name;if(n.has(i))throw Error(`Accordion: item name "${i}" must be unique.`);return n.add(i),r})}function Gr(e,t,n){if(e==null)return[];let r=Array.isArray(e)?e:[e],i=[];for(let e of r){let r=t[typeof e==`number`?e:t.findIndex(t=>t.name===e)]?.name;if(r&&(i.push(r),!n))break}return Array.from(new Set(i))}function Kr(e,t,n){let r=new Set(t.map(e=>e.name).filter(Boolean)),i=e.filter(e=>r.has(e));return n?i:i.slice(0,1)}function qr(e,t){let n=e[0]||null;if(!n)return{index:null,name:null};let r=t.findIndex(e=>e.name===n);return r>=0?{index:r,name:n}:{index:null,name:null}}function Jr(e){return typeof e==`number`&&e>0?e:0}function Yr(e){let t=Hr(e),r=Gr(t.active,t.data,t.multiple),i=(0,n.createDeepStore)({data:t.data,activeNames:r,loading:!1}),a=new WeakMap,o=on(),s=on(),c=new Map,l=new Map,u=new Map,f=new Set(r),p=Promise.resolve(),m=0,h=0,g=!1,_,v=e=>(typeof e.name==`string`?e.name.trim():``)||(a.has(e)||a.set(e,q()),a.get(e)),y=()=>{let e=i.data.map(e=>({...e,name:v(e)}));return qr(Kr(i.activeNames,e,t.multiple),e)},b=e=>i.activeNames.includes(e),x=()=>{h+=1,!g&&!_.runtime.destroyed&&(g=!0,(0,n.flushSync)(()=>{i.loading=!0}))},S=()=>{h=Math.max(0,h-1),h===0&&g&&!_.runtime.destroyed&&(g=!1,(0,n.flushSync)(()=>{i.loading=!1}))},C=e=>typeof e==`number`?e:typeof e==`string`?i.data.findIndex(t=>v(t)===e):-1,w=e=>{let t=new Set(e),n=new Set([...f,...t]),r=[];for(let e of n){let n=f.has(e),i=t.has(e);if(n===i)continue;let a=s.get(e);a&&(a.inert=!i);let o=c.get(e);o&&r.push(i?o.enter():o.leave())}return f=t,r.length>0&&(p=Promise.all(r).then(()=>void 0)),p},T=e=>r=>{s.bind(e)(r),c.get(e)?.cancel();let a=Tt(()=>s.get(e),{axis:t.direction,options:{duration:250,easing:`ease`}});c.set(e,a);let o=b(e);r.inert=!o,a.setExpanded(o),(0,n.onCleanup)(()=>{c.get(e)===a&&(a.cancel(),c.delete(e),f.delete(e),i.activeNames.includes(e)&&(0,n.flushSync)(()=>{i.activeNames=i.activeNames.filter(t=>t!==e)}))})},E=async e=>{if(_.runtime.destroyed)throw Error(`Accordion.activate: instance destroyed`);if(!_.runtime.built)throw Error(`Accordion.activate: call build() first.`);let r=C(e),a=i.data[r];if(!a)return;let c=v(a),l=b(c);if(l&&!t.multiple&&!t.collapsible)return;let d;if(t.multiple)if(l){let e=i.activeNames.filter(e=>e!==c);d=!t.collapsible&&e.length===0?[...i.activeNames]:e}else d=[...i.activeNames,c];else d=l?t.collapsible?[]:[...i.activeNames]:[c];(0,n.flushSync)(()=>{i.activeNames=d});let f=w(d),p=d.includes(c)&&u.get(c)?.()||Promise.resolve(),m=o.get(c),h=s.get(c),g=t.onChange&&m&&h?p.then(()=>t.onChange?.(r,c,m,h,_)):Promise.resolve();await Promise.all([f,g])},D=(e,t,n)=>{let r=v(e);return{accordion:_,item:e,index:t,type:n,active:b(r)}},O=(e,t,n)=>typeof e==`function`?e(D(t,n,`title`)):e,k=(e,t,r)=>{let i=e().content,[a,o]=(0,n.createSignal)(typeof i==`function`?null:i),[s,c]=(0,n.createSignal)(!1),d=i,f=0,p=null,h=()=>D(e(),t(),`content`),g=async()=>{let t=e(),n=t.content;if(typeof n!=`function`){o(n);return}let i=t.cache?l.get(r):null,a=Jr(t.ttl);if(i&&(!a||Date.now()-i.updatedAt<=a)){o(i.content);return}if(p)return p;let s=++f;m+=1;let u=m;c(!0),x();let d=Promise.resolve().then(()=>n(h())).then(t=>{s!==f||_.runtime.destroyed||(e().cache&&l.set(r,{content:t,updatedAt:Date.now()}),o(t))}).finally(()=>{s===f&&!_.runtime.destroyed&&c(!1),u<=m&&S(),p===d&&(p=null)});return p=d,d};return u.set(r,g),(0,n.onCleanup)(()=>{f+=1,l.delete(r),u.delete(r),p=null}),(0,n.createEffect)(()=>{let t=e().content;t!==d&&(d=t,f+=1,p=null,l.delete(r),o(typeof t==`function`?null:t)),b(r)&&g()}),{loading:s,isAsync:()=>typeof e().content==`function`,render:()=>{if(s())return Z(`flex-start`,`flex-start`);let e=a();return typeof e==`function`?e(h()):e}}},A=(e,r)=>{let i=v(e()),a=k(e,r,i),s=`${t.id}_header_${i}`,c=`${t.id}_panel_${i}`;return[(0,n.jsx)(`div`,{className:t.className.header,id:s,"data-accordion-header":i,role:`button`,tabindex:`0`,"aria-controls":c,"aria-expanded":()=>b(i)?`true`:`false`,ref:o.bind(i),onClick:()=>void E(i),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),E(i))},children:[(0,n.jsx)(`span`,{className:t.className.title,"data-accordion-title":i,role:`heading`,children:()=>{let t=e();return O(t.title,t,r())}}),(0,n.jsx)(`span`,{className:t.className.arrow,"data-accordion-arrow":i,"aria-hidden":`true`,children:d(`arrow-down`)})]}),(0,n.jsx)(`div`,{className:t.className.panel,"data-accordion-panel":i,id:c,role:`region`,"aria-labelledby":s,"aria-hidden":()=>b(i)?`false`:`true`,"aria-live":()=>a.isAsync()?`polite`:null,"aria-busy":()=>String(a.loading()),"data-state":()=>b(i)?`open`:`closed`,ref:T(i),children:(0,n.jsx)(`div`,{className:t.className.content,"data-accordion-content":i,children:a.render})})]};return _=Q({name:`Accordion`,props:t,state:i,actions:{isActive:b,getIndex:C,activate:E},normalizeStatePatch(e){return{...e,...Object.hasOwn(e,`data`)?{data:Wr(e.data)}:{}}},view:()=>{let e=(0,n.jsx)(`div`,{className:t.className.root,id:t.id,"data-accordion":`root`,"data-direction":t.direction,children:(0,n.For)({each:()=>i.data,key:e=>v(e),children:(e,t)=>A(e,t)})});return f=new Set(i.activeNames),(0,n.createEffect)(()=>{w([...i.activeNames])}),e},onDestroy(){m+=1,h=0,g=!1,l.clear(),u.clear();for(let e of c.values())e.cancel();c.clear(),o.clear(),s.clear()}}),Object.defineProperty(_,"current",{enumerable:!0,get:y}),_}let Xr={form:`j-form`,vertical:`is-vertical`,horizontal:`is-horizontal`,itemVertical:`is-item-vertical`,itemHorizontal:`is-item-horizontal`,item:`form-item`,label:`item-label`,required:`is-required`,control:`form-control`,helpInvalid:`is-invalid`,buttons:`form-buttons`,button:`j-button`,input:`j-input`,textarea:`j-textarea`,select:`j-select`,radio:`j-radio`,checkbox:`j-checkbox`,choiceVertical:`is-vertical`,choiceHorizontal:`is-horizontal`,choiceGroup:`is-group`,radioLabel:`radio-label`,radioText:`radio-text`,switch:`j-switch`,switchDefault:`is-default`,switchSizeMd:`is-md`,switchSlider:`switch-slider`},Zr=[{type:`submit`,text:`Submit`,theme:`primary`,action:`submit`},{type:`reset`,text:`Reset`,theme:`ghost`,action:`reset`}],Qr={id:{default:null,types:[`string`,`null`],normalize:e=>typeof e==`string`?e.trim()?e.trim():q():e??q()},vertical:{default:!0,type:`boolean`},itemVertical:{default:!0,type:`boolean`},style:{default:``,types:[`string`,`object`,`null`]},fields:{default:[],type:`array`},buttons:{default:Zr,types:[`boolean`,`array`],normalize:e=>e===!1?[]:e===!0?ri(Zr):Array.isArray(e)?ri(e):e},className:{default:Xr,type:`object`,normalize:e=>ci(e)},validator:{default:{},type:`object`},onSubmit:{default:null,types:[`function`,`null`]},onReset:{default:null,types:[`function`,`null`]}};function $r(e){return Array.isArray(e)?e.map(e=>e&&typeof e==`object`?{...e}:e):[]}function ei(e){return{...e,options:$r(e.options)}}function ti(e){return{...e.id?{id:e.id}:{},type:e.type,payload:ei(e.payload),next:e.next||null}}function ni(e){return Array.isArray(e)?e.map(e=>ti(e)):[]}function ri(e){return Array.isArray(e)?e.map(e=>({...e})):[]}function ii(e,t){let n=[],r=Array.isArray(e)?e:[],i=new WeakSet,a=e=>{let t=r.indexOf(e);return t>=0&&r[t+1]||null};for(let e of r){if(i.has(e))continue;let r=e,o=[],s=0;for(;r&&s<1e3&&(s+=1,!i.has(r));){i.add(r),n.push(r),o.push(r);let e=r.next?r.next(r,o):a(r);r=e?t(e):null}}return n}function ai(e){return e&&typeof e==`object`?e:{value:e,text:String(e)}}function oi(e){return e==null?``:typeof e==`string`?e:typeof e==`number`||typeof e==`boolean`?String(e):e.name}function si(e,t){return e.name?!!e.required||!!t?.[e.name]?.required:!!e.required}function ci(e){return{...Xr,...L(e)?e:{}}}function li(e,t){if(e.removeAttribute(`style`),!t)return;if(typeof t==`string`){e.style.cssText=t;return}if(!L(t))return;let n=t;for(let[t,r]of Object.entries(n)){if(r==null||typeof r!=`string`&&typeof r!=`number`)continue;let n=t.startsWith(`--`)?t:t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`);e.style.setProperty(n,String(r))}}function ui(e){let t=L(e)?e:{};return{...t,rules:L(t.rules)?t.rules:{},messages:L(t.messages)?t.messages:{}}}function di(e){let t=V(e,Qr,`Form.props`),n=ni(t.fields);return{...t,id:String(t.id),vertical:!!t.vertical,itemVertical:!!t.itemVertical,style:t.style,fields:n,buttons:ri(t.buttons),className:ci(t.className),validator:ui(t.validator),onSubmit:t.onSubmit,onReset:t.onReset}}function fi(e){return{...e,fields:ni(e.fields),buttons:ri(e.buttons),className:ci(e.className),validator:ui(e.validator)}}function pi(e){return e===`password`?`current-password`:e===`email`?`email`:`on`}function mi(e,t){return Array.isArray(e)?e.map(e=>oi(e)).includes(oi(t)):e==t}function hi(e,t,n){return n===void 0?Array.isArray(e)?e.map(e=>oi(e)).includes(oi(t)):typeof e!=`string`&&typeof e!=`boolean`&&!(e instanceof File)?!1:e===!0||oi(e)===oi(t):n}function gi(e){return e instanceof RadioNodeList?Array.from(e):[e]}function _i(e={}){let t=di(e),r=fi(t),i=(0,n.createDeepStore)({...fi(t),submitting:!1,data:null}),a={initial:r,fieldIds:new Map},o=new WeakMap,[s,c]=(0,n.createSignal)(0),l=new WeakMap,u=null,d,f=e=>{if(i.fields.includes(e))return e;let t=l.get(e);if(t)return t;let r=(0,n.createDeepStore)(ti(e));return l.set(e,r),r},p=(0,n.createMemo)(()=>(s(),ii(i.fields,f))),m=e=>e.id?`id:${e.id}`:e.name?`name:${e.name}`:(o.has(e)||o.set(e,q()),o.get(e)),h=(e,t)=>{if(e.id)return`item:${e.id}`;let n=e.payload;return n&&typeof n==`object`?`${m(n)}:${e.type}`:`item:${e.type}:${t}`},_=(e,t)=>{if(e.id)return e.id;let n=e.name||t;return a.fieldIds.has(n)||a.fieldIds.set(n,`${i.id}_field_${t}`),a.fieldIds.get(n)},v=()=>{let e=d.element;if(!e)return;let t={...i.validator,onSubmit:null};if(u?.element===e){u.props=t;return}u?.destroy(),u=Er(e,t,!1)},y=()=>u?.validate()??!0,b=()=>{let e=d.element;if(e){for(let t of Array.from(e.elements))t.classList.remove(`is-valid`,`is-invalid`);for(let t of G(`[data-form-help], [data-validator-help]`,e))(t.dataset.validatorHelp||t.classList.contains(`is-invalid`))&&t.remove()}},x=()=>{let e={};if(!d.element)return e;for(let[t,n]of new FormData(d.element).entries())Object.hasOwn(e,t)?e[t]=Array.isArray(e[t])?[...e[t],n]:[e[t],n]:e[t]=n;return e},S=async e=>{if(e.preventDefault(),i.submitting||!y())return;let t=x();(0,n.flushSync)(()=>{i.submitting=!0,i.data=t});try{await Promise.resolve(i.onSubmit?.(t,d))}finally{d.runtime.destroyed||(0,n.flushSync)(()=>{i.submitting=!1})}},C=e=>{if(!e.name||!d.element)return[];let t=d.element.elements.namedItem(e.name);return t?gi(t).filter(e=>e instanceof Element):[]},w=(e,t,r=`text`)=>{(0,n.flushSync)(()=>{if(t instanceof HTMLSelectElement){e.value=t.multiple?Array.from(t.selectedOptions).map(e=>e.value):t.value;return}if(t instanceof HTMLTextAreaElement){e.value=t.value;return}if(r===`switch`){e.checked=t.checked,e.value=t.checked?t.value:``;return}if(r===`radio`){t.checked&&(e.value=t.value);return}if(r===`checkbox`){if(Array.isArray(e.options)){e.value=C(e).filter(e=>e instanceof HTMLInputElement&&e.checked).map(e=>e.value);return}e.checked=t.checked,e.value=t.checked?t.value:``;return}e.value=t.value,t.type===`checkbox`&&(e.checked=t.checked)}),c(e=>e+1)},T=(e,t,n)=>({...n,name:e.name,id:t,placeholder:e.placeholder||``,required:!!e.required,disabled:()=>i.submitting||!!e.disabled,readonly:!!e.readonly,"data-form-field":e.name||t}),E=(e,t,r)=>{let a=e.vertical?`vertical`:`horizontal`,o=i.className;return(0,n.jsx)(`div`,{className:g(r===`radio`?o.radio:o.checkbox,a===`vertical`?o.choiceVertical:o.choiceHorizontal,e.group?o.choiceGroup:``,e.size?`is-${e.size}`:``),"data-form-choice-group":e.name||t,"data-choice-type":r,"data-choice-layout":a,children:(e.options||[]).map((a,s)=>{let c=ai(a),l=`${t}_${s}`;return(0,n.jsx)(`label`,{className:r===`radio`?o.radioLabel:``,"data-form-choice":e.name||t,for:l,children:[(0,n.jsx)(`input`,{type:r,id:l,name:e.name,value:c.value??``,checked:r===`radio`?mi(e.value,c.value):hi(e.value,c.value,c.checked),disabled:()=>i.submitting||!!c.disabled||!!e.disabled,required:!!e.required,onChange:t=>{let n=t.currentTarget;n instanceof HTMLInputElement&&w(e,n,r)}}),(0,n.jsx)(`span`,{className:r===`radio`?o.radioText:``,"data-form-choice-text":``,children:c.text??c.label??c.value??``})]})})})},D=(e,t,r,a,o)=>{let s=i.className;if(e===`textarea`)return(0,n.jsx)(`textarea`,T(t,r,{className:t.className||s.textarea,autocomplete:t.autocomplete,value:t.value??``,onInput:e=>{let n=e.currentTarget;n instanceof HTMLTextAreaElement&&w(t,n,`textarea`)}}));if(e===`select`)return(0,n.jsx)(`select`,T(t,r,{className:t.className||s.select,autocomplete:t.autocomplete||`off`,multiple:!!t.multiple,onChange:e=>{let n=e.currentTarget;n instanceof HTMLSelectElement&&w(t,n,`select`)},children:(t.options||[]).map(e=>{let r=ai(e);return(0,n.jsx)(`option`,{value:r.value??``,disabled:!!r.disabled,selected:mi(t.value,r.value),children:r.text??r.label??r.value??``})})}));if(e===`radio`)return E(t,r,`radio`);if(e===`checkbox`&&Array.isArray(t.options))return E(t,r,`checkbox`);if(e===`switch`)return(0,n.jsx)(`label`,{className:g(s.switch,t.variant?`is-${t.variant}`:s.switchDefault,t.size?`is-${t.size}`:s.switchSizeMd),"data-form-switch":t.name||r,for:r,children:[(0,n.jsx)(`input`,{type:`checkbox`,id:r,name:t.name,value:t.value??`1`,checked:!!t.checked,disabled:()=>i.submitting||!!t.disabled,required:!!t.required,onChange:e=>{let n=e.currentTarget;n instanceof HTMLInputElement&&w(t,n,`switch`)}}),(0,n.jsx)(`span`,{className:s.switchSlider,"data-form-switch-slider":``})]});if(e===`custom`)return typeof t.content==`function`?t.content({form:d,field:t,index:a,item:o}):t.content;let c=e||`text`;return(0,n.jsx)(`input`,{...T(t,r,{type:c,className:t.className||s.input,autocomplete:t.autocomplete||pi(c),value:t.value??``,onInput:e=>{let n=e.currentTarget;n instanceof HTMLInputElement&&w(t,n,c)}}),checked:t.checked===void 0?void 0:!!t.checked})},O=(e,t)=>{let r=e(),a=r.payload,o=()=>e().payload,s=t(),c=_(a,s);return(0,n.jsx)(`div`,{className:()=>i.className.item,"data-form-item":()=>o().name||String(t()),style:()=>({display:e().type===`hidden`?`none`:``}),children:[()=>{let e=o();return e.label===!1||e.label===void 0?null:(0,n.jsx)(`label`,{className:()=>g(i.className.label,si(o(),i.validator.rules)?i.className.required:``),"data-form-label":()=>o().name||c,for:c,children:()=>o().label})},(0,n.jsx)(`div`,{className:()=>i.className.control,"data-form-control":()=>o().name||String(t()),children:[D(r.type,a,c,s,r),()=>o().help?(0,n.jsx)(`div`,{className:`help-block`,"data-form-help":()=>o().name||String(t()),children:()=>o().help}):null]})]})},k=(e,t)=>O(e,t),A=()=>(0,n.jsx)(`div`,{className:()=>i.className.buttons,"data-form-buttons":``,hidden:()=>i.buttons.length===0,children:(0,n.For)({each:()=>i.buttons,key:(e,t)=>`${e.action||e.type||`button`}:${t}`,children:e=>(0,n.jsx)(`button`,{type:()=>e().type||`button`,className:()=>{let t=e();return g(i.className.button,t.theme?`is-${t.theme}`:``,t.className||``)},"data-action":()=>{let t=e();return t.action||t.type||`button`},disabled:()=>i.submitting||!!e().disabled,children:()=>{let t=e(),n=t.text??t.label??``;return i.submitting&&(t.type===`submit`||t.action===`submit`)?[Z(),n]:n}})})});return d=Q({name:`Form`,props:t,state:i,actions:{validate:y,reset(){return u?.reset(),(0,n.flushSync)(()=>{i.data=null}),d},collectData:x,requestSubmit(){let e=d.element;return e&&(typeof e.requestSubmit==`function`?e.requestSubmit():e.dispatchEvent(new Event(`submit`,{bubbles:!0,cancelable:!0}))),d},setFields(e){return B(`fields`,e,`array`,`Form.setFields`),a.fieldIds.clear(),l=new WeakMap,(0,n.flushSync)(()=>{i.fields=ni(e)}),d},resetFields(){return a.fieldIds.clear(),l=new WeakMap,(0,n.flushSync)(()=>{i.fields=ni(r.fields)}),d}},normalizeStatePatch(e){return{...e,...Object.hasOwn(e,`fields`)?{fields:ni(e.fields)}:{},...Object.hasOwn(e,`buttons`)?{buttons:ri(e.buttons)}:{},...Object.hasOwn(e,`className`)?{className:ci(e.className)}:{},...Object.hasOwn(e,`validator`)?{validator:ui(e.validator)}:{}}},view:()=>{let e=(0,n.jsx)(`form`,{className:()=>g(i.className.form,i.vertical?i.className.vertical:i.className.horizontal,i.itemVertical?i.className.itemVertical:i.className.itemHorizontal),id:()=>i.id,"data-form":`root`,"data-form-layout":()=>i.vertical?`vertical`:`horizontal`,"data-form-item-layout":()=>i.itemVertical?`vertical`:`horizontal`,onSubmit:e=>void S(e),onReset:e=>{b(),(0,n.flushSync)(()=>{i.data=null}),i.onReset?.(e,d)},children:[(0,n.For)({each:p,key:h,children:k}),A()]});return(0,n.createEffect)(()=>li(e,i.style)),(0,n.createEffect)(()=>{u&&(u.props={...i.validator,onSubmit:null})}),e},onBuild(){v()},onDestroy(){u?.destroy(),u=null,a.fieldIds.clear(),l=new WeakMap}}),d}let vi={root:`j-flow`,header:`flow-header`,steps:`flow-steps`,step:`flow-step`,active:`is-active`,complete:`is-complete`,stepButton:`flow-step-button`,stepIndex:`flow-step-index`,stepTitle:`flow-step-title`,body:`flow-body`,footer:`flow-footer`,button:`j-button`,reset:`is-ghost flow-reset`,back:`is-ghost flow-back`,next:`is-primary flow-next`},yi={type:`plainObject`,shape:{id:{type:`string`,nonEmpty:!0}}},bi={type:`renderable`},xi={types:[`plainObject`,`null`,`undefined`]};function $(e){return L(e)?{...e}:{}}function Si(e){return Array.isArray(e)?e.map(e=>{let t={...e};return delete t.description,delete t.view,{...t,data:$(t.data),modal:typeof t.modal==`function`||t.modal==null?t.modal:$(t.modal)}}):[]}function Ci(e){return typeof e==`string`?{...vi,root:[vi.root,e.trim()].filter(Boolean).join(` `)}:{...vi,...L(e)?e:{}}}function wi(e,t){if(typeof e==`string`)return{id:e};if(!L(e))return{id:t};let n=e;return typeof n.id==`string`?{id:n.id,data:L(n.data)||n.data==null?n.data:void 0}:{id:t}}let Ti={id:{default:null,types:[`string`,`null`],normalize:e=>typeof e==`string`&&e.trim()||q()},steps:{default:[],type:`array`,nonEmpty:!0},initial:{default:null,types:[`string`,`number`,`null`]},cache:{default:!0,type:`boolean`},linear:{default:!0,type:`boolean`},render:{default:!0,type:`boolean`},rollbackOnError:{default:!0,type:`boolean`},busyStrategy:{default:`ignore`,type:`string`,enum:[`ignore`,`throw`]},showBack:{default:!0,type:`boolean`},showNext:{default:!0,type:`boolean`},showReset:{default:!1,type:`boolean`},text:{default:{},type:`plainObject`,normalize:e=>{let t=L(e)?e:{};return{back:typeof t.back==`string`?t.back:`Back`,next:typeof t.next==`string`?t.next:`Next`,finish:typeof t.finish==`string`?t.finish:`Finish`,reset:typeof t.reset==`string`?t.reset:`Reset`}}},className:{default:vi,types:[`object`,`string`],normalize:Ci},renderHeader:{default:null,validate:e=>e==null||e===!1||typeof e==`function`},renderBody:{default:null,validate:e=>e==null||e===!1||typeof e==`function`},renderFooter:{default:null,validate:e=>e==null||e===!1||typeof e==`function`},onChange:{default:null,types:[`function`,`null`]},onNext:{default:null,types:[`function`,`null`]},onBack:{default:null,types:[`function`,`null`]},onFinish:{default:null,types:[`function`,`null`]},onError:{default:null,types:[`function`,`null`]},onBusy:{default:null,types:[`function`,`null`]}};function Ei(e){let t=V(e,Ti,`Flow.props`);return{id:t.id,steps:Si(t.steps),initial:t.initial,cache:t.cache,linear:t.linear,render:t.render,rollbackOnError:t.rollbackOnError,busyStrategy:t.busyStrategy,showBack:t.showBack,showNext:t.showNext,showReset:t.showReset,text:t.text,className:t.className,renderHeader:t.renderHeader,renderBody:t.renderBody,renderFooter:t.renderFooter,onChange:t.onChange,onNext:t.onNext,onBack:t.onBack,onFinish:t.onFinish,onError:t.onError,onBusy:t.onBusy}}function Di(e={}){let t=Ei(e),r=t.steps,i=new Map;for(let[e,t]of r.entries()){if(B(String(e),t,yi,`Flow.props.steps`),B(`content`,t.content??null,bi,`Flow.props.steps.${e}`),i.has(t.id))throw Error(`Flow.props.steps: duplicated step id "${t.id}".`);i.set(t.id,e)}let a=(()=>{if(typeof t.initial==`number`){let e=r[t.initial];if(!e)throw Error(`Flow.props.initial index is out of range.`);return e.id}if(typeof t.initial==`string`){if(!i.has(t.initial))throw Error(`Flow.props.initial step "${t.initial}" does not exist.`);return t.initial}return r[0].id})(),o={},s={};for(let e of r)o[e.id]=$(e.data),Object.assign(s,o[e.id]);let c=(0,n.createDeepStore)({id:t.id,currentId:a,currentIndex:i.get(a)??0,previousId:null,previousIndex:null,direction:null,history:[a],data:$(s),stepData:$(o),loading:!1,error:null,busyAction:null,version:0}),l={built:!1,mounted:!1,destroyed:!1,activeAction:null,actionController:null},u=new Set,d=new Set,f=null,p,m=e=>{if(l.destroyed)throw Error(`Flow.${e}: instance has been destroyed.`)},h=()=>r[c.currentIndex],g=e=>$(c.stepData[e]),_=e=>{if(!e)return null;let{onEnter:t,onLeave:n,onNext:r,onBack:i,canEnter:a,canLeave:o,...s}=e;return s},v=()=>({id:c.id,currentId:c.currentId,currentIndex:c.currentIndex,previousId:c.previousId,previousIndex:c.previousIndex,direction:c.direction,history:[...c.history],data:$(c.data),stepData:$(c.stepData),currentData:g(c.currentId),currentStep:_(h()),canBack:c.currentIndex>0&&!c.loading,canNext:c.currentIndex<r.length-1&&!c.loading,isLast:c.currentIndex===r.length-1,loading:c.loading,busyAction:c.busyAction,error:c.error}),y=(e=null)=>{let n=v();for(let t of u)t(n,p,e);t.onChange?.(n,p,e)},b=(e,t)=>{for(let t of Object.keys(e))delete e[t];Object.assign(e,t)},x=(e,r,a={})=>(m(`setStepData`),B(`stepId`,e,{type:`string`},`Flow.setStepData`),B(`data`,r,xi,`Flow.setStepData`),!r||!i.has(e)?p:((0,n.flushSync)(()=>{c.stepData[e]={...$(c.stepData[e]),...r},t.cache&&Object.assign(c.data,r),c.version+=1}),a.silent||y(),p)),S=e=>(m(`setData`),B(`data`,e,xi,`Flow.setData`),e?((0,n.flushSync)(()=>{Object.assign(c.data,e),c.version+=1}),y(),p):p),C=e=>{if(typeof e!=`function`)throw Error(`Flow.addCleanup: cleanup expects a function.`);return l.destroyed?(e(),()=>{}):(d.add(e),()=>d.delete(e))},w=()=>{let e=Error(`Flow: active action was aborted.`);return e.code=`FLOW_ABORTED`,e},T=async(e,t)=>{if(typeof e!=`function`)return;let n=await e(...t);if(l.destroyed)throw w();return n},E=(e={})=>{let t=e.step||h();return{...e,flow:p,step:t,state:c,signal:l.actionController?.signal||null,snapshot:v(),data:$(c.data),currentData:g(t.id),setData:S,setStepData:(e,t)=>x(e,t),getStepData:g,next:e=>p.next(e),back:e=>p.back(e),goTo:(e,t,n)=>p.goTo(e,t,n),addCleanup:C}},D=(e,r=null)=>{(0,n.flushSync)(()=>{c.error=e,c.version+=1}),t.onError?.(e,v(),p,r)},O=(e,t)=>{let r=v();(c.loading!==e||c.busyAction!==t)&&((0,n.flushSync)(()=>{c.loading=e,c.busyAction=e?t:null,c.version+=1}),y(r))},k=e=>{if(!c.loading)return null;let n=Error(`Flow: action "${e}" ignored while loading.`);if(n.code=`FLOW_BUSY`,t.onBusy?.(e,v(),p),t.busyStrategy===`throw`)throw n;return v()},A=async(e,t,n=!1)=>{let r=!n&&!c.loading;r&&(l.actionController=new AbortController,l.activeAction=e,O(!0,e));try{return await t()}catch(e){if(l.destroyed)return null;throw c.error!==e&&D(e),e}finally{r&&!l.destroyed&&(O(!1,null),l.activeAction=null,l.actionController=null)}},j=()=>({currentId:c.currentId,currentIndex:c.currentIndex,previousId:c.previousId,previousIndex:c.previousIndex,direction:c.direction,history:[...c.history],data:$(c.data),stepData:$(c.stepData),loading:c.loading,busyAction:c.busyAction,error:c.error,version:c.version}),ee=e=>{(0,n.flushSync)(()=>{c.currentId=e.currentId,c.currentIndex=e.currentIndex,c.previousId=e.previousId,c.previousIndex=e.previousIndex,c.direction=e.direction,c.history.splice(0,c.history.length,...e.history),b(c.data,e.data),b(c.stepData,e.stepData),c.loading=!0,c.busyAction=e.busyAction,c.error=e.error,c.version=e.version+1})},te=e=>{if(typeof e==`number`){if(!r[e])throw Error(`Flow.goTo target is out of range.`);return e}let t=i.get(e);if(t==null)throw Error(`Flow.goTo target "${e}" does not exist.`);return t},M=async(e,r,a,o)=>{let s=v(),u=j();try{if(a&&x(o.id,a,{silent:!0}),o.canLeave&&await T(o.canLeave,[E({direction:r,targetId:e.id})])===!1)throw Error(`Flow: step "${o.id}" blocked leaving.`);if(e.canEnter&&await T(e.canEnter,[E({direction:r,fromId:o.id,step:e})])===!1)throw Error(`Flow: step "${e.id}" blocked entering.`);await T(o.onLeave,[E({direction:r,step:o,targetId:e.id})]);let t=c.currentId,l=c.currentIndex;(0,n.flushSync)(()=>{c.previousId=t,c.previousIndex=l,c.currentId=e.id,c.currentIndex=i.get(e.id)??0,c.direction=r,r===`back`?c.history.pop():c.history.push(e.id),c.error=null,c.version+=1}),await T(e.onEnter,[E({direction:r,fromId:t,step:e})]),y(s)}catch(e){throw l.destroyed?e:(t.rollbackOnError&&ee(u),D(e,s),e)}},N=async(e,n,r,i)=>{let a=e===`back`?n.onBack:n.onNext,o=e===`back`?t.onBack:t.onNext,s=E({payload:r,targetId:i});return await T(a,[s])??await T(o,[s])??i},ne=e=>{let t=v();return{flow:p,snapshot:t,state:c,steps:r.map(_),currentStep:t.currentStep,currentData:t.currentData,data:t.data,fallback:e,next:e=>p.next(e),back:e=>p.back(e),goTo:(e,t,n)=>p.goTo(e,t,n),reset:()=>p.reset()}},P=(e,n)=>{let r=t[e];return r===!1?null:typeof r==`function`?()=>c.version>=0?r(ne(n)):null:n()},F=()=>{let e=h().content;return typeof e==`function`?e(E()):e??``},I=()=>Q({name:`FlowView`,props:{},state:c,view:()=>(0,n.jsx)(`div`,{className:t.className.root,id:t.id,role:`group`,"data-flow":`root`,"aria-busy":()=>c.loading?`true`:`false`,children:[(0,n.jsx)(`div`,{className:t.className.header,"data-flow-header":``,children:P(`renderHeader`,()=>(0,n.jsx)(`ol`,{className:t.className.steps,"data-flow-steps":``,role:`list`,"aria-label":`Flow steps`,children:r.map((e,r)=>(0,n.jsx)(`li`,{className:()=>[t.className.step,r===c.currentIndex?t.className.active:``,r<c.currentIndex?t.className.complete:``].filter(Boolean).join(` `),"data-flow-step":e.id,"data-flow-step-index":String(r),"aria-current":()=>r===c.currentIndex?`step`:null,children:(0,n.jsx)(`button`,{type:`button`,className:t.className.stepButton,disabled:()=>t.linear&&r>c.currentIndex,"aria-current":()=>r===c.currentIndex?`step`:null,onClick:()=>{r!==c.currentIndex&&p.goTo(r)},children:[(0,n.jsx)(`span`,{className:t.className.stepIndex,"data-flow-step-number":``,children:r+1}),(0,n.jsx)(`span`,{className:t.className.stepTitle,"data-flow-step-title":``,children:e.title||e.id})]})}))}))}),(0,n.jsx)(`div`,{className:t.className.body,"data-flow-body":``,role:`region`,"aria-live":`polite`,"aria-busy":()=>c.loading?`true`:`false`,children:P(`renderBody`,()=>()=>c.version>=0?F():null)}),(0,n.jsx)(`div`,{className:t.className.footer,"data-flow-footer":``,children:P(`renderFooter`,()=>[t.showReset?(0,n.jsx)(`button`,{type:`button`,className:[t.className.button,t.className.reset].filter(Boolean).join(` `),"data-action":`reset`,onClick:()=>p.reset(),disabled:()=>c.loading,children:t.text.reset}):null,t.showBack?(0,n.jsx)(`button`,{type:`button`,className:[t.className.button,t.className.back].filter(Boolean).join(` `),"data-action":`back`,onClick:()=>void p.back(),disabled:()=>!p.canBack,children:t.text.back}):null,t.showNext?(0,n.jsx)(`button`,{type:`button`,className:[t.className.button,t.className.next].filter(Boolean).join(` `),"data-action":`next`,onClick:()=>void p.next(),disabled:()=>c.loading,children:()=>p.isLast?t.text.finish:t.text.next}):null])})]})});return p={props:t,steps:r,state:c,runtime:l,get element(){return f?.element||null},get currentStep(){return h()},get currentData(){return g(c.currentId)},get canBack(){return c.currentIndex>0&&!c.loading},get canNext(){return c.currentIndex<r.length-1&&!c.loading},get isLast(){return c.currentIndex===r.length-1},build(){return m(`build`),l.built?p:(t.render&&(f||=I(),f.build()),l.built=!0,p)},mount(e){return m(`mount`),p.build(),f&&f.mount(e),l.mounted=!!f,p},unmount(){return m(`unmount`),f?.unmount(),l.mounted=!1,p},subscribe(e){if(m(`subscribe`),typeof e!=`function`)throw Error(`Flow.subscribe: handler expects a function.`);return u.add(e),e(v(),p,null),()=>u.delete(e)},snapshot:v,async next(e=null){return m(`next`),B(`payload`,e,xi,`Flow.next`),k(`next`)||A(`next`,async()=>{if(p.isLast)return e&&x(c.currentId,e),await T(t.onFinish,[v(),p]),v();let n=h(),i=r[c.currentIndex+1]?.id,a=wi(await N(`next`,n,e,i),i);return p.goTo(a.id,a.data??e,{direction:`next`,internal:!0})})},async back(e=null){return m(`back`),B(`payload`,e,xi,`Flow.back`),k(`back`)||(p.canBack?A(`back`,async()=>{let t=h(),n=r[c.currentIndex-1]?.id,i=wi(await N(`back`,t,e,n),n);return p.goTo(i.id,i.data??e,{direction:`back`,internal:!0})}):v())},async goTo(e,t=null,n={}){return m(`goTo`),B(`payload`,t,xi,`Flow.goTo`),(n.internal?null:k(`goTo`))||A(`goTo`,async()=>{let i=te(e),a=r[i],o=h();return a.id===c.currentId?(t&&x(c.currentId,t),v()):(await M(a,n.direction||`go`,t,o),v())},!!n.internal)},setData:S,setStepData:x,getStepData:g,reset(){return m(`reset`),(0,n.flushSync)(()=>{c.currentId=a,c.currentIndex=i.get(a)??0,c.previousId=null,c.previousIndex=null,c.direction=null,c.history.splice(0,c.history.length,a),b(c.data,$(s)),b(c.stepData,$(o)),c.loading=!1,c.busyAction=null,c.error=null,c.version+=1}),y(),p},async finish(e=null){return m(`finish`),B(`payload`,e,xi,`Flow.finish`),k(`finish`)||A(`finish`,async()=>(e&&x(c.currentId,e),await T(t.onFinish,[v(),p]),v()))},destroy(){if(!l.destroyed){l.destroyed=!0,l.actionController?.abort(),l.actionController=null,l.activeAction=null,f?.destroy(),f=null;for(let e of d)e();d.clear(),u.clear(),l.built=!1,l.mounted=!1,i.clear()}}},p}let Oi={layout:`j-popup-layout`,modal:`j-modal`,header:`modal-header`,body:`modal-body`,footer:`modal-footer`,title:`modal-title`,button:`j-button`,closeBtn:`is-icon is-sm is-ghost`,cancelBtn:`is-ghost`,confirmBtn:`is-primary`};function ki(e){return{...e,text:{...e.text},className:{...e.className}}}function Ai(e){return{content:e.content,loading:!1,processing:!1,visible:!1}}function ji(e){return!!e&&typeof e.then==`function`}function Mi(e){return Number.isFinite(e)?Math.max(0,e):0}let Ni={type:`renderable`},Pi={default:{},type:`object`,plain:!0,normalize:e=>{let t=L(e)?e:{};return{...t,title:typeof t.title==`string`?t.title:`Tip`,confirm:typeof t.confirm==`string`?t.confirm:`Confirm`,cancel:typeof t.cancel==`string`?t.cancel:`Cancel`}}},Fi={content:{default:``,...Ni},cache:{default:!1,type:`boolean`},ttl:{default:0,type:`number`},position:{default:`center`,type:`string`},showCancel:{default:!0,type:`boolean`},showClose:{default:!0,type:`boolean`},fullscreen:{default:!1,type:`boolean`},text:Pi,onShow:{default:null,types:[`function`,`null`]},onShown:{default:null,types:[`function`,`null`]},onHide:{default:null,types:[`function`,`null`]},onHidden:{default:null,types:[`function`,`null`]},onConfirm:{default:null,types:[`function`,`null`]},onCancel:{default:null,types:[`function`,`null`]},header:{default:!0,type:`boolean`},footer:{default:!0,type:`boolean`},id:{default:null,types:[`string`,`null`],normalize:e=>typeof e==`string`?e.trim()||q():e??q()},escClose:{default:!1,type:`boolean`},bgClose:{default:!1,type:`boolean`},className:{default:Oi,type:`object`,normalize:e=>({...Oi,...e&&typeof e==`object`?e:{}})}},Ii={content:Fi.content,loading:{default:!1,type:`boolean`},processing:{default:!1,type:`boolean`},visible:{default:!1,type:`boolean`}},Li={type:`plainObject`};function Ri(e){let t=V(e,Fi,`Modal`);return{content:t.content,cache:t.cache,ttl:Mi(t.ttl),position:t.position,showCancel:t.showCancel,showClose:t.showClose,fullscreen:t.fullscreen,text:t.text,onShow:t.onShow,onShown:t.onShown,onHide:t.onHide,onHidden:t.onHidden,onConfirm:t.onConfirm,onCancel:t.onCancel,header:t.header,footer:t.footer,id:t.id,escClose:t.escClose,bgClose:t.bgClose,className:t.className}}let zi=0,Bi=``;function Vi(e={}){let r=Ri(e),a=(0,n.createDeepStore)(Ai(r)),o={initial:ki(r),previousActiveElement:null,content:null,contentSource:null,hasContent:!1,updatedAt:0},s=new Map,[c,l]=(0,n.createSignal)(!1),[u,f]=(0,n.createSignal)({value:null}),p,m=null,h=null,_=!1,v=0,y=()=>a.processing,b=e=>{if(!r.cache||!o.hasContent||o.contentSource!==e)return!1;let t=Mi(r.ttl);return!t||Date.now()-o.updatedAt<=t},x=(e,t)=>{r.cache&&(o.content=t,o.contentSource=e,o.hasContent=!0,o.updatedAt=Date.now())},S=()=>{o.content=null,o.contentSource=null,o.hasContent=!1,o.updatedAt=0},C=()=>{for(let e of s.values())e();s.clear()},w=(e,t,n,r)=>{s.get(e)?.(),t.addEventListener(n,r),s.set(e,()=>t.removeEventListener(n,r))},T=()=>{_||=(zi===0&&(Bi=document.body.style.overflow,document.body.style.overflow=`hidden`),zi+=1,!0)},E=()=>{_&&=(zi=Math.max(0,zi-1),zi===0&&(document.body.style.overflow=Bi,Bi=``),!1)},D=()=>{let e=o.previousActiveElement;o.previousActiveElement=null,e&&document.contains(e)&&e.focus()},O=gn({elements:()=>[p.element,m],mount:()=>{p.mount(document.body),T()},activate:()=>l(!0),deactivate:()=>l(!1),motion:xt(wt(()=>p.element,{keyframes:[{opacity:0},{opacity:1}],options:{duration:220,easing:`ease`}}),wt(()=>m,{keyframes:[{opacity:0,transform:`scale(0.96)`},{opacity:1,transform:`scale(1)`}],options:{duration:220,easing:`ease`}})),unmount:()=>{p.unmount(),E(),D()}}),k=()=>{if(a.loading||a.processing){h||=Z(),m&&h.parentElement!==m&&m.append(h);return}h?.remove(),h=null},A=e=>{a.processing!==e&&(0,n.flushSync)(()=>{a.processing=e})},j=()=>{a.visible&&O.phase!==`leaving`&&A(!1)},ee=(e=a.content)=>{if(b(e)){v+=1,(0,n.flushSync)(()=>{f({value:o.content}),a.loading=!1});return}let t=++v;if(typeof e!=`function`){S(),(0,n.flushSync)(()=>{f({value:e}),a.loading=!1});return}let r;try{r=e(p)}catch(e){console.error(`Modal.content error:`,e),(0,n.flushSync)(()=>{f({value:null}),a.loading=!1});return}if(!ji(r)){x(e,r),(0,n.flushSync)(()=>{f({value:r}),a.loading=!1});return}(0,n.flushSync)(()=>{a.loading=!0,f({value:null})}),Promise.resolve(r).then(r=>{p.runtime.destroyed||t!==v||(x(e,r),(0,n.flushSync)(()=>{f({value:r})}))}).catch(e=>{p.runtime.destroyed||t!==v||(console.error(`Modal.content error:`,e),(0,n.flushSync)(()=>{f({value:null})}))}).finally(()=>{!p.runtime.destroyed&&t===v&&(0,n.flushSync)(()=>{a.loading=!1})})},te=()=>{if(y())return;let e;try{e=r.onConfirm?.(p)}catch(e){console.error(`Modal.onConfirm error:`,e);return}ji(e)&&(A(!0),Promise.resolve(e).catch(e=>{console.error(`Modal.onConfirm error:`,e)}).finally(()=>{p.runtime.destroyed||j()}))},M=()=>{if(y())return;let e;try{e=r.onCancel?.(p)}catch(e){console.error(`Modal.onCancel error:`,e);return}if(!ji(e)){p.hide();return}A(!0),Promise.resolve(e).then(()=>{p.runtime.destroyed||p.hide()}).catch(e=>{console.error(`Modal.onCancel error:`,e)}).finally(()=>{p.runtime.destroyed||j()})},N=e=>{if(!m)return;let t=G(`a[href], button:not([disabled]):not([data-action=close]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])`,m).filter(e=>e.offsetParent!==null||e===document.activeElement);if(!t.length){e.preventDefault(),m.focus();return}let n=t[0],r=t[t.length-1];e.shiftKey&&document.activeElement===n?(e.preventDefault(),r?.focus()):!e.shiftKey&&document.activeElement===r&&(e.preventDefault(),n?.focus())},ne=()=>{if(!m)return;let e=W(`input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]):not([data-action=close]), [tabindex]:not([tabindex="-1"])`,m);e?e.focus():(m.setAttribute(`tabindex`,`-1`),m.focus())},P=()=>{let e=p.element;!e||!m||(C(),w(`root`,e,`click`,t=>{r.bgClose&&!y()&&t.target===e&&p.hide()}),w(`dialog`,m,`click`,e=>{let t=(e.target instanceof Element?e.target:null)?.closest(`[data-action]`)?.dataset.action;t===`cancel`||t===`close`?M():t===`confirm`&&te()}),w(`keyboard`,document,`keydown`,e=>{!(e instanceof KeyboardEvent)||!a.visible||(e.key===`Escape`&&r.escClose&&!y()?(e.preventDefault(),p.hide()):e.key===`Tab`&&N(e))}))},F=()=>{if(O.phase===`visible`||O.phase===`entering`)return;if(!p.element)throw Error(`Modal.show: build() must be called before show().`);r.onShow?.(p),o.previousActiveElement=document.activeElement instanceof HTMLElement?document.activeElement:null;let e=O.enter();P(),ne(),e.then(e=>{e&&!p.runtime.destroyed&&r.onShown?.(p)})},I=()=>{O.phase!==`hidden`&&O.phase!==`leaving`&&(r.onHide?.(p),C(),v+=1,O.leave().then(e=>{e&&!p.runtime.destroyed&&((0,n.flushSync)(()=>{a.loading=!1,a.processing=!1,r.cache||f({value:null})}),r.onHidden?.(p))}))};return p=Q({name:`Modal`,props:r,state:a,actions:{show(){if(!p.runtime.built)throw Error(`Modal.show: build() must be called before show().`);return p.setState(`visible`,!0),p},hide(){return(0,n.flushSync)(()=>{a.visible=!1}),p},reset(){return p.setState({content:o.initial.content,loading:!1,processing:!1}),S(),f({value:null}),p}},normalizeStatePatch(e){return{...e}},validateStatePatch(e){B(`state`,e,Li,`Modal.setState`);for(let t of Object.keys(e)){if(!Object.hasOwn(Ii,t))throw Error(`Modal.setState: "${t}" is not a supported state key.`);B(t,e[t],Ii[t],`Modal.setState`)}},view:()=>{m=(0,n.jsx)(`div`,{className:g(r.className.modal,r.fullscreen?`is-fullscreen`:``),id:r.id,role:`document`,"data-modal-dialog":r.id,"data-mount":()=>c()?`true`:`false`,children:[(0,n.jsx)(`div`,{className:r.className.header,hidden:()=>!r.header||a.loading,children:()=>r.header&&!a.loading?[(0,n.jsx)(`div`,{className:r.className.title,id:`${r.id}_title`,"aria-label":r.text.title,children:r.text.title}),r.showClose?(0,n.jsx)(`button`,{type:`button`,className:g(r.className.button,r.className.closeBtn),"data-action":`close`,"aria-label":(0,t.t)(`Close`,i),disabled:y,children:d(`close`)}):null]:null}),(0,n.jsx)(`div`,{className:r.className.body,"data-modal-body":``,children:()=>u().value}),(0,n.jsx)(`div`,{className:r.className.footer,hidden:()=>!r.footer||a.loading,children:()=>r.footer&&!a.loading?[r.showCancel?(0,n.jsx)(`button`,{type:`button`,className:g(r.className.button,r.className.cancelBtn),"data-action":`cancel`,disabled:y,children:r.text.cancel}):null,(0,n.jsx)(`button`,{type:`button`,className:g(r.className.button,r.className.confirmBtn),"data-action":`confirm`,disabled:y,children:r.text.confirm})]:null})]});let e=yn({className:r.className.layout,position:r.position,component:`modal`,labelledby:r.header?`${r.id}_title`:``,content:m});return e.setAttribute(`data-mount`,`false`),r.header||e.setAttribute(`aria-label`,r.text.title||`Modal`),(0,n.createEffect)(()=>{e.setAttribute(`data-mount`,c()?`true`:`false`)}),(0,n.createEffect)(k),(0,n.createEffect)(()=>{let e=a.visible;(0,n.untrack)(()=>e?F():I())}),(0,n.createEffect)(()=>{let e=a.visible,t=a.content;(0,n.untrack)(()=>{e?ee(t):v+=1})}),e},onDestroy(){let e=O.phase!==`hidden`;e&&r.onHide?.(p),O.cancel(),C(),E(),D(),h?.remove(),h=null,m=null,e&&r.onHidden?.(p)}}),p}let Hi={root:`j-swiper`,wrapper:`swiper-wrapper`,slide:`swiper-slide`,image:`swiper-image`,title:`swiper-slide-title`,pagination:`swiper-pagination`,paginationHorizontal:`is-horizontal`,paginationClickable:`is-clickable`,paginationBulletGroup:`is-bullet`,indicator:`swiper-pagination-indicator`,bullet:`swiper-pagination-bullet`,navigation:`swiper-navigation`,prev:`is-prev`,next:`is-next`,active:`is-active`,disabled:`is-disabled`},Ui={id:{default:null,types:[`string`,`null`],nonEmpty:!0,normalize:e=>typeof e==`string`?e.trim():e},data:{default:[],types:[`array`,`function`]},loop:{default:!0,type:`boolean`},autoplay:{default:!0,type:`boolean`},delay:{default:3e3,type:`number`,min:0},lazyload:{default:!0,type:`boolean`},pagination:{default:!0,type:`boolean`},navigation:{default:!0,type:`boolean`},speed:{default:300,type:`number`,min:0},touchRatio:{default:1,type:`number`,greaterThan:0},touchAngle:{default:45,type:`number`,min:0,max:90},longSwipesMs:{default:300,type:`number`,min:0},longSwipesRatio:{default:.05,type:`number`,min:0,max:1},preventClick:{default:!0,type:`boolean`},className:{default:Hi,type:`object`,normalize:e=>({...Hi,...e&&typeof e==`object`?e:{}})}},Wi={type:`plainObject`,shape:{image:[`string`,`null`,`undefined`],url:[`string`,`null`,`undefined`],title:[`string`,`null`,`undefined`],sort:[`number`,`null`,`undefined`],blank:[`boolean`,`null`,`undefined`],children:`renderable`}},Gi={data:{type:`array`},loading:{type:`boolean`},index:{type:`number`},trackIndex:{type:`number`},transform:{type:`number`},animating:{type:`boolean`},width:{type:`number`}};function Ki(e){return e instanceof Element&&!!e.closest(`a, button, input, textarea, select, label, [data-swiper-ignore]`)}function qi(e,t=0){let n=Number(e);return Number.isFinite(n)?n:t}function Ji(e){return Array.isArray(e)?e.map(e=>({...e})):[]}function Yi(e){return Array.isArray(e)?Ji(e):e}function Xi(e={}){let t=V(e,Ui,`Swiper.props`);return{...t,id:t.id?.trim()||null,data:Yi(t.data),className:{...t.className}}}function Zi(e={}){let t=Xi(e),r=(0,n.createDeepStore)({data:Ji(Array.isArray(t.data)?t.data:[]),loading:!1,index:0,trackIndex:0,transform:0,animating:!1,width:0}),i=K(),a=new WeakMap,o=new Set,s,c=null,l=[],u=()=>[],f=()=>[],p=0,m=null,h=null,_=[],v=null,y=!1,b=!1,x=!1,S=!1,C=e=>(a.has(e)||a.set(e,q()),a.get(e)),w=e=>{let t=e.map((e,t)=>(B(String(t),e,Wi,`Swiper.state.data`),{...e,blank:e.blank!==!1,index:t,key:C(e)}));return t.some(e=>e.sort!=null)?t.sort((e,t)=>e.sort==null&&t.sort==null?e.index-t.index:e.sort==null?1:t.sort==null?-1:e.sort-t.sort||e.index-t.index):t},T=e=>{let n=e.map((e,t)=>({item:e,index:t,clone:null,key:`real:${e.key}:${!!e.url}`}));if(!t.loop||e.length<=1)return n;let r=e[0],i=e[e.length-1];return[{item:i,index:e.length-1,clone:`last`,key:`clone:last:${i.key}:${!!i.url}`},...n,{item:r,index:0,clone:`first`,key:`clone:first:${r.key}:${!!r.url}`}]},E=()=>u().length,D=()=>f().length,O=(e=r.trackIndex)=>{let n=E();return n?!t.loop||n<=1?Math.max(0,Math.min(e,n-1)):e===0?n-1:e===D()-1?0:e-1:0},k=e=>{let n=E();if(!n)return 0;let r=Math.max(0,Math.min(e,n-1));return t.loop&&n>1?r+1:r},A=()=>{l=c?G(`[data-swiper-slide]`,c):[]},j=()=>{for(let e of o)e();o.clear()},ee=()=>{let e=s.element;if(!e)return;let t=e.clientWidth||e.offsetWidth;(t>0||!e.isConnected||r.width===0)&&(0,n.flushSync)(()=>{r.width=t})},te=()=>!!s.element?.isConnected&&r.width>0,M=()=>(ee(),te()),N=(e,i=!0)=>{let a=qi(e),o=-a*r.width,s=i&&t.speed>0&&r.width>0&&r.transform!==o;(0,n.flushSync)(()=>{r.trackIndex=a,r.index=O(a),r.transform=o,r.animating=s})},ne=()=>{let e=[r.trackIndex];r.trackIndex>0&&e.push(r.trackIndex-1),r.trackIndex<l.length-1&&e.push(r.trackIndex+1);for(let t of e){let e=l[t]?W(`img[data-lazy]`,l[t]):null;if(!e)continue;let n=!!e.getAttribute(`src`);if(n&&!e.complete&&(e.onload||e.onerror))continue;e.dataset.status=`loading`;let r=()=>{e.onload=null,e.onerror=null,o.delete(r)};o.add(r);let i=()=>{e.dataset.status=`loaded`,r()},a=()=>{e.dataset.status=`error`,r()};e.onload=i,e.onerror=a,n||(e.src=e.dataset.lazy||``),e.complete&&(e.naturalWidth>0?i():a())}},P=()=>{m&&=(clearInterval(m),null)},F=()=>{s.runtime.destroyed||m||E()<=1||M()&&(m=setInterval(()=>s.next(),Math.max(t.delay,16)))},I=()=>{t.autoplay&&!m&&!s.runtime.destroyed&&F()},re=()=>{P(),t.autoplay&&F()},ie=e=>{_.push({x:e.pageX??e.clientX??0,y:e.pageY??e.clientY??0,time:Date.now()}),_.length>5&&_.shift()},L=()=>_.length?{x:_[_.length-1].x-_[0].x,y:_[_.length-1].y-_[0].y}:{x:0,y:0},R=(e=!0)=>{let t=-r.trackIndex*r.width,i=e&&r.transform!==t;y=!1,b=!1,x=!1,_=[],v=null,(0,n.flushSync)(()=>{r.transform=t,r.animating=i}),I()},ae=(e,t)=>{r.animating||!M()||(_=[],ie(e),v=t,y=!0,b=!1,x=!1,S=!1,P(),(0,n.flushSync)(()=>{r.animating=!1}))},oe=(e,i)=>{if(!y||b||r.animating)return;ie(e);let a=L(),o=Math.abs(a.x),s=Math.abs(a.y);if(!(o<6&&s<6)){if(!x)if(Math.atan2(s,o)*180/Math.PI<t.touchAngle)x=!0,S=Ki(v);else{b=!0,R(!0);return}i.preventDefault(),(0,n.flushSync)(()=>{r.transform=-r.trackIndex*r.width+a.x*t.touchRatio})}},se=()=>{if(!y)return;if(y=!1,!x||r.width<=0){R(!0);return}let e=_.length?_[_.length-1].time-_[0].time:0,n=L().x,i=Math.abs(n)/r.width,a=0;e>t.longSwipesMs?a=Math.ceil(i-t.longSwipesRatio):i>=t.longSwipesRatio&&(a=Math.max(1,Math.ceil(i-t.longSwipesRatio))),s.slideToTrack(r.trackIndex+a*(n>0?-1:1)),_=[],I()},ce=e=>{e.target!==c||!(`propertyName`in e)||e.propertyName!==`transform`||((0,n.flushSync)(()=>{r.animating=!1}),!(!t.loop||E()<=1)&&(r.trackIndex===0?N(E(),!1):r.trackIndex===D()-1&&N(1,!1)))},le=()=>{let e=s.element;!e||!c||(i.clear(),i.on(`touchstart`,c,`touchstart`,e=>{let t=e.touches[0];t&&ae(t,e.target)},{passive:!0}),i.on(`touchmove`,c,`touchmove`,e=>{let t=e.touches[0];t&&oe(t,e)},{passive:!1}),i.on(`touchend`,c,`touchend`,e=>{let t=e.changedTouches[0];t&&ie(t),se()}),i.on(`touchcancel`,window,`touchcancel`,()=>R(!0)),i.on(`mousedown`,c,`mousedown`,e=>{let t=e;t.button===0&&(ae(t,t.target),c?.style.setProperty(`cursor`,`grabbing`))}),i.on(`mousemove`,window,`mousemove`,e=>{let t=e;y&&t.buttons===1&&oe(t,e)}),i.on(`mouseup`,window,`mouseup`,e=>{y&&(c?.style.setProperty(`cursor`,`grab`),ie(e),se())}),i.on(`click`,c,`click`,e=>{!S||!t.preventClick||(e.preventDefault(),e.stopPropagation(),S=!1)},{capture:!0}),i.on(`dragstart`,c,`dragstart`,e=>e.preventDefault()),i.on(`transitionend`,c,`transitionend`,ce),i.on(`resize`,window,`resize`,ue),i.on(`mouseenter`,e,`mouseenter`,P),i.on(`mouseleave`,e,`mouseleave`,I),i.on(`controls`,e,`click`,t=>{if(!(t.target instanceof Element))return;let n=t.target.closest(`[data-action], [data-swiper-bullet]`);!n||!e.contains(n)||(n.dataset.action===`prev`?s.prev():n.dataset.action===`next`?s.next():n.dataset.swiperBullet!=null&&s.slideTo(Number(n.dataset.swiperBullet)))}))},ue=()=>{if(!s.runtime.built)return;P(),j(),A();let e=Math.min(r.index,Math.max(0,E()-1));ee(),N(k(e),!1),t.lazyload&&ne(),t.autoplay&&te()&&I()},de=$t(ue),fe=()=>{h==null&&typeof requestAnimationFrame==`function`&&(h=requestAnimationFrame(()=>{h=null,!s.runtime.destroyed&&s.element?.isConnected&&ue()}))},z=async()=>{if(typeof t.data!=`function`)return;let e=++p;(0,n.flushSync)(()=>{r.loading=!0});try{let i=await Promise.resolve(t.data(s));if(s.runtime.destroyed||e!==p)return;B(`data`,i,{type:`array`},`Swiper.data`);let a=Ji(i);w(a),(0,n.flushSync)(()=>{r.data=a})}finally{!s.runtime.destroyed&&e===p&&(0,n.flushSync)(()=>{r.loading=!1})}},pe=()=>{z().catch(e=>{s.runtime.destroyed||console.error(`Swiper.data error:`,e)})},me=e=>(0,n.jsx)(e().item.url?`a`:`div`,{className:t.className.slide,href:()=>e().item.url||void 0,target:()=>e().item.url?e().item.blank?`_blank`:`_self`:void 0,"data-swiper-slide":()=>String(e().index),"data-swiper-index":()=>e().clone?null:String(e().index),"data-clone":()=>e().clone,role:`group`,"aria-label":()=>`Slide ${e().index+1}`,children:()=>{let{item:r,index:i}=e(),a={swiper:s,item:r,index:i};return r.children==null?[r.image?(0,n.jsx)(`img`,{className:t.className.image,alt:r.title||``,loading:`lazy`,...t.lazyload?{"data-lazy":r.image}:{src:r.image}}):null,r.title?(0,n.jsx)(`span`,{className:t.className.title,children:r.title}):null]:typeof r.children==`function`?r.children(a):r.children}});return s=Q({name:`Swiper`,props:t,state:r,actions:{slideTo(e){s.slideToTrack(k(e))},slideToTrack(e){if(!s.runtime.built)throw Error(`Swiper.slideToTrack: call build() first.`);if(r.animating||!l.length||!M())return;let n=t.loop?Math.max(0,Math.min(e,l.length-1)):Math.max(0,Math.min(e,E()-1));N(n,!0),t.lazyload&&ne()},next(){r.animating||s.slideToTrack(r.trackIndex+1)},prev(){r.animating||s.slideToTrack(r.trackIndex-1)},play:F,pause:P,resume:I,restartAutoplay:re},normalizeStatePatch(e){return{...e,...Object.hasOwn(e,`data`)&&Array.isArray(e.data)?{data:Ji(e.data)}:{}}},validateStatePatch(e){B(`state`,e,{type:`plainObject`},`Swiper.setState`);for(let t of Object.keys(e)){if(!Object.hasOwn(Gi,t))throw Error(`Swiper.setState: "${t}" is not a supported state key.`);B(t,e[t],Gi[t],`Swiper.setState`)}Array.isArray(e.data)&&w(e.data)},view:()=>{u=(0,n.createMemo)(()=>w(r.data)),f=(0,n.createMemo)(()=>T(u()));let e=()=>{let e=Z();return e.setAttribute(`data-swiper-loading`,``),e};c=(0,n.jsx)(`div`,{className:t.className.wrapper,"data-swiper-wrapper":``,"aria-live":`polite`,children:()=>r.loading?e():(0,n.For)({each:f,key:e=>e.key,children:me})});let i=(0,n.jsx)(`div`,{id:t.id||q(),className:t.className.root,"data-swiper":`root`,"data-status":()=>r.loading?`loading`:`loaded`,children:[c,t.pagination?(0,n.jsx)(`div`,{className:g(t.className.pagination,t.className.paginationHorizontal,t.className.paginationClickable,t.className.paginationBulletGroup),"data-swiper-pagination":``,children:(0,n.For)({each:u,key:e=>e.key,children:(e,i)=>(0,n.jsx)(`button`,{type:`button`,className:()=>g(t.className.indicator,t.className.bullet,r.index===i()?t.className.active:``),"data-swiper-bullet":()=>String(i()),"aria-label":()=>`Go to slide ${i()+1}`,"aria-current":()=>r.index===i()?`true`:null})})}):null,t.navigation?(0,n.jsx)(`button`,{type:`button`,className:()=>g(t.className.navigation,t.className.prev,!t.loop&&r.index<=0?t.className.disabled:``),"data-action":`prev`,"data-swiper-navigation":`prev`,"aria-label":`Previous slide`,disabled:()=>!t.loop&&r.index<=0,children:d(`arrow-left`)}):null,t.navigation?(0,n.jsx)(`button`,{type:`button`,className:()=>g(t.className.navigation,t.className.next,!t.loop&&r.index>=E()-1?t.className.disabled:``),"data-action":`next`,"data-swiper-navigation":`next`,"aria-label":`Next slide`,disabled:()=>!t.loop&&r.index>=E()-1,children:d(`arrow-right`)}):null]});return(0,n.createEffect)(()=>{c?.style.setProperty(`transform`,`translate3d(${r.transform}px, 0, 0)`),c?.style.setProperty(`transition`,r.animating?`transform ${t.speed}ms cubic-bezier(0.25, 0.46, 0.45, 0.94)`:`none`),i.style.setProperty(`--swiper-slide-width`,`${r.width}px`)}),(0,n.createEffect)(()=>{(u().map(e=>`${e.key}:${e.sort??``}:${!!e.url}`).join(`|`)||r.data.length===0)&&de.schedule()}),i},onBuild(e){!e.element||!c||(c.setAttribute(`aria-live`,`polite`),A(),le(),ee(),N(k(r.index),!1),t.lazyload&&ne(),t.autoplay&&te()&&F(),e.own(()=>i.clear()),pe(),fe())},onMount(){ue(),fe()},onDestroy(){P(),de.dispose(),p+=1,j(),h!=null&&cancelAnimationFrame(h),h=null,c=null,l=[]}}),Object.defineProperties(s,{realCount:{enumerable:!0,get:E},realIndex:{enumerable:!0,get:()=>O()}}),s}let Qi={root:`j-tabs`,wrap:`tab-wrap`,list:`tab-list`,tab:`tab-item`,panelWrap:`panel-list`,panel:`panel-item`,dragging:`dragging`},$i={id:{default:null,types:[`string`,`null`],normalize:e=>typeof e==`string`?e.trim()||q():e??q()},direction:{default:`top`,type:`string`,enum:[`top`,`bottom`,`left`,`right`]},active:{default:0,types:[`number`,`string`]},disabled:{default:[],types:[`number`,`string`,`array`]},onChange:{default:null,types:[`function`,`null`]},data:{default:[],type:`array`},className:{default:Qi,type:`object`,normalize:e=>({...Qi,...e&&typeof e==`object`?e:{}})}},ea={type:`plainObject`,shape:{name:[`string`,`null`,`undefined`],title:`renderable`,content:`renderable`,cache:[`boolean`,`undefined`],ttl:[`number`,`undefined`]}},ta={data:$i.data,active:$i.active,disabled:$i.disabled};function na(e,t,n=`Tabs.data`){B(String(t),e,ea,n);let r=(typeof e.name==`string`?e.name.trim():``)||q();return{...e,name:r}}function ra(e,t=`Tabs.data`){B(`data`,e,ta.data,t);let n=new Set;return e.map((e,r)=>{let i=na(e,r,t),a=i.name;if(n.has(a))throw Error(`${t}: item name "${a}" must be unique.`);return n.add(a),i})}function ia(e){return Array.isArray(e)?[...e]:e}function aa(e){let t=V(e,$i,`Tabs.props`);return{id:t.id,direction:t.direction,active:t.active,disabled:ia(t.disabled),onChange:t.onChange,data:ra(t.data,`Tabs.props.data`),className:t.className}}function oa(e){return typeof e==`number`&&e>0?e:0}function sa(e={}){let t=aa(e),r=(0,n.createDeepStore)({data:t.data,active:t.active,disabled:t.disabled,draggable:!1,dragging:!1,loading:!1}),i=K(),a=an(),o=an(),s=on(),c=on(),l=new Map,u=new Map,d,f=0,p=!1,m=0,h=0,_=0,v=e=>typeof e==`number`?e:r.data.findIndex(t=>t.name===e),y=()=>{let e=v(r.active),t=r.data[e];return t?{index:e,name:t.name}:{index:-1,name:null}},b=()=>{if(typeof r.active==`string`)return r.active;let e=r.data[r.active];return e?e.name:null},x=()=>{let e=Array.isArray(r.disabled)?r.disabled:[r.disabled];return Array.from(new Set(e.map(e=>typeof e==`number`?r.data[e]?.name:e).filter(e=>typeof e==`string`)))},S=e=>x().includes(e),C=e=>b()===e,w=(0,n.createMemo)(()=>r.data),T=()=>{let e=a.current,i=o.current;if(!e||!i)return;let s=t.direction===`left`||t.direction===`right`?i.scrollHeight>e.clientHeight+5:i.scrollWidth>e.clientWidth+5;r.draggable!==s&&(0,n.flushSync)(()=>{r.draggable=s})},E=$t(T),D=()=>{let e=a.current;if(!e)return;let n=_,r=performance.now(),i=t.direction===`left`||t.direction===`right`,o=t=>{let a=t-r;r=t,n*=.92,!(Math.abs(n)<.3)&&(i?e.scrollTop+=n*a*.05:e.scrollLeft+=n*a*.05,m=requestAnimationFrame(o))};m=requestAnimationFrame(o)},O=()=>{let e=a.current,s=o.current;if(!e||!s)return;let c=0,l=0,u=0,d=!1,f=0,h=e=>{let n=t.direction===`left`||t.direction===`right`;if(`touches`in e){let t=e.touches[0]||e.changedTouches[0];return n?t.pageY:t.pageX}return n?e.pageY:e.pageX},g=i=>{r.draggable&&(!(i instanceof MouseEvent)&&!(i instanceof TouchEvent)||(p=!0,(0,n.flushSync)(()=>{r.dragging=!0}),c=h(i),u=c,l=t.direction===`left`||t.direction===`right`?e.scrollTop:e.scrollLeft,_=0,cancelAnimationFrame(m)))},v=n=>{if(!p||!(n instanceof MouseEvent)&&!(n instanceof TouchEvent))return;n.preventDefault();let r=h(n);f=c-r,_=u-r,u=r,!d&&(d=!0,requestAnimationFrame(()=>{d=!1,t.direction===`left`||t.direction===`right`?e.scrollTop=l+f:e.scrollLeft=l+f}))},y=()=>{p&&(p=!1,(0,n.flushSync)(()=>{r.dragging=!1}),D())};i.on(`drag:mousedown`,s,`mousedown`,g),i.on(`drag:touchstart`,s,`touchstart`,g,{passive:!0}),i.on(`drag:mousemove`,window,`mousemove`,v,{passive:!1}),i.on(`drag:touchmove`,window,`touchmove`,v,{passive:!1}),i.on(`drag:mouseup`,window,`mouseup`,y),i.on(`drag:touchend`,window,`touchend`,y)},k=async e=>{if(!d.runtime.built)throw Error(`Tabs.activate: call build() first.`);let i=v(e),a=r.data[i];if(!a)return;let o=a.name;S(o)||C(o)||((0,n.flushSync)(()=>{r.active=e}),await u.get(o)?.(),await Promise.resolve(t.onChange?.(i,o,s.get(o),c.get(o))))},A=(e,i)=>{let a=e().name,o=e().content,[s,p]=(0,n.createSignal)(typeof o==`function`?null:o),[m,h]=(0,n.createSignal)(!1),g=o,_=0,v=null,y=()=>({tabs:d,item:e(),index:i(),name:a}),b=async()=>{let t=e(),i=t.content;if(typeof i!=`function`){p(i);return}let o=t.cache?l.get(a):null,s=oa(t.ttl);if(o&&(!s||Date.now()-o.updatedAt<=s)){p(o.content);return}if(v)return v;let c=++_;f+=1;let u=f;h(!0),(0,n.flushSync)(()=>{r.loading=!0});let m=Promise.resolve().then(()=>i(y())).then(t=>{c!==_||d.runtime.destroyed||(e().cache&&l.set(a,{content:t,updatedAt:Date.now()}),p(t))}).finally(()=>{c===_&&h(!1),u===f&&!d.runtime.destroyed&&(0,n.flushSync)(()=>{r.loading=!1}),v===m&&(v=null)});return v=m,m};return u.set(a,b),(0,n.onCleanup)(()=>{l.delete(a),u.delete(a)}),(0,n.createEffect)(()=>{let t=e().content;t!==g&&(g=t,_+=1,v=null,l.delete(a),p(typeof t==`function`?null:t)),C(a)&&b()}),(0,n.jsx)(`div`,{className:t.className.panel,"data-tabs-panel":a,role:`tabpanel`,"aria-hidden":()=>C(a)?`false`:`true`,"aria-live":()=>typeof e().content==`function`?`polite`:null,"aria-busy":()=>String(m()),hidden:()=>!C(a),ref:c.bind(a),children:()=>{if(m())return Z(`flex-start`,`flex-start`);let e=s();return typeof e==`function`?e(y()):e}})},j=(e,r)=>{let i=e().name;return(0,n.jsx)(`div`,{className:t.className.tab,"data-tabs-tab":i,role:`tab`,"aria-selected":()=>C(i)?`true`:`false`,"aria-disabled":()=>S(i)?`true`:`false`,ref:s.bind(i),children:e().title})};return d=Q({name:`Tabs`,props:t,state:r,actions:{activate:k},normalizeStatePatch(e){return{...e,...Object.hasOwn(e,`data`)?{data:ra(e.data,`Tabs.setState.data`)}:{},...Object.hasOwn(e,`disabled`)&&Array.isArray(e.disabled)?{disabled:ia(e.disabled)}:{}}},validateStatePatch(e){B(`state`,e,{type:`plainObject`},`Tabs.setState`);for(let t of Object.keys(e)){if(!Object.hasOwn(ta,t))throw Error(`Tabs.setState: "${t}" is not a supported state key.`);let n=t;B(t,e[t],ta[n],`Tabs.setState`)}},view:()=>((0,n.createEffect)(()=>{let e=r.data.length;return E.schedule(),e}),(0,n.jsx)(`div`,{className:t.className.root,id:t.id,"data-tabs":`root`,"data-tabs-direction":t.direction,children:[(0,n.jsx)(`div`,{className:t.className.wrap,"data-tabs-wrap":``,ref:a.set,children:(0,n.jsx)(`nav`,{className:()=>g(t.className.list,r.dragging&&t.className.dragging),"data-tabs-list":``,ref:o.set,children:(0,n.For)({each:w,key:e=>e.name,children:(e,t)=>j(e,t)})})}),(0,n.jsx)(`div`,{className:t.className.panelWrap,"data-tabs-panel-wrap":``,children:(0,n.For)({each:w,key:e=>e.name,children:(e,t)=>A(e,t)})})]})),onBuild(e){let t=e.element;t&&(i.on(`click`,t,`click`,e=>{if(!(e.target instanceof Element))return;let t=e.target.closest(`[data-tabs-tab]`)?.dataset.tabsTab;t&&!S(t)&&k(t)}),i.on(`resize`,window,`resize`,()=>{cancelAnimationFrame(h),h=requestAnimationFrame(T)}),O(),e.own(()=>i.clear()),E.schedule(),u.get(y().name||``)?.())},onMount(){E.schedule()},onDestroy(){f+=1,E.dispose(),cancelAnimationFrame(m),cancelAnimationFrame(h),l.clear(),u.clear(),s.clear(),c.clear()}}),Object.defineProperties(d,{current:{enumerable:!0,get:y},activeIndex:{enumerable:!0,get:()=>y().index},disabledNames:{enumerable:!0,get:x}}),d}let ca={root:`j-offcanvas`,overlay:`j-offcanvas-overlay`,content:`offcanvas-content`},la={top:`translateY(-100%)`,right:`translateX(100%)`,bottom:`translateY(100%)`,left:`translateX(-100%)`},ua={content:{default:``,type:`renderable`},overlay:{default:!0,type:`boolean`},filter:{default:!0,type:`boolean`},bodyOverflow:{default:!0,type:`boolean`},cache:{default:!1,type:`boolean`},ttl:{default:0,type:`number`},direction:{default:`left`,type:`string`,enum:[`top`,`right`,`bottom`,`left`]},animate:{default:`slide`,type:`string`},bgClose:{default:!0,type:`boolean`},escClose:{default:!0,type:`boolean`},id:{default:null,types:[`string`,`null`],normalize:e=>typeof e==`string`?e.trim()||q():e??q()},className:{default:ca,type:`object`,normalize:e=>({...ca,...e&&typeof e==`object`?e:{}})},onShow:{default:null,types:[`function`,`null`]},onShown:{default:null,types:[`function`,`null`]},onHide:{default:null,types:[`function`,`null`]},onHidden:{default:null,types:[`function`,`null`]}},da={content:ua.content,resolvedContent:{type:`renderable`},visible:{type:`boolean`},loading:{type:`boolean`}};function fa(e){return e>0?e:0}function pa(e){let t=V(e,ua,`Offcanvas`);return{content:t.content,overlay:t.overlay,filter:t.filter,bodyOverflow:t.bodyOverflow,cache:t.cache,ttl:t.ttl,direction:t.direction,animate:t.animate,bgClose:t.bgClose,escClose:t.escClose,id:t.id,className:t.className,onShow:t.onShow,onShown:t.onShown,onHide:t.onHide,onHidden:t.onHidden}}let ma=0,ha=``;function ga(e){B(`state`,e,{type:`plainObject`},`Offcanvas.setState`);for(let t of Object.keys(e)){if(!Object.hasOwn(da,t))throw Error(`Offcanvas.setState: "${t}" is not a supported state key.`);let n=t;B(t,e[t],da[n],`Offcanvas.setState`)}}function _a(e={}){let t=pa(e),r=(0,n.createDeepStore)({content:t.content,resolvedContent:typeof t.content==`function`?null:t.content,visible:!1,loading:!1}),i={cache:{content:null,hasContent:!1,updatedAt:0},contentLoadId:0},a=K(),o=an(),s,c=!1,l=()=>{!t.bodyOverflow||c||(ma===0&&(ha=document.body.style.overflow,document.body.style.overflow=`hidden`),ma+=1,c=!0)},u=()=>{c&&=(ma=Math.max(0,ma-1),ma===0&&(document.body.style.overflow=ha,ha=``),!1)},d=wt(()=>s.element,{keyframes:[{transform:la[t.direction]},{transform:`translate(0, 0)`}],options:{duration:300,easing:`ease`}}),f=gn({elements:()=>[o.current,s.element],mount:()=>{let e=o.current;e&&!e.isConnected&&(0,n.insert)(document.body,e),s.mount(document.body),l()},activate:()=>{r.visible=!0},deactivate:()=>{r.visible=!1},motion:xt(...t.animate===`slide`?[d]:[],wt(()=>o.current,{keyframes:[{opacity:0},{opacity:1}],options:{duration:300,easing:`ease`}})),unmount:()=>{o.current?.remove(),s.unmount(),u()}}),p=()=>{i.cache={content:null,hasContent:!1,updatedAt:0}},m=()=>{if(!t.cache||!i.cache.hasContent)return!1;let e=fa(t.ttl);return!e||Date.now()-i.cache.updatedAt<=e},h=async()=>{let e=r.content;if(typeof e!=`function`){i.contentLoadId+=1,(0,n.flushSync)(()=>{r.resolvedContent=e,r.loading=!1});return}if(m()){i.contentLoadId+=1,(0,n.flushSync)(()=>{r.resolvedContent=i.cache.content,r.loading=!1});return}let a=++i.contentLoadId;(0,n.flushSync)(()=>{r.loading=!0,r.resolvedContent=null});try{let o=await Promise.resolve(e(s));if(s.runtime.destroyed||a!==i.contentLoadId)return;t.cache&&(i.cache={content:o,hasContent:!0,updatedAt:Date.now()}),(0,n.flushSync)(()=>{r.resolvedContent=o})}finally{!s.runtime.destroyed&&a===i.contentLoadId&&(0,n.flushSync)(()=>{r.loading=!1})}};return s=Q({name:`Offcanvas`,props:t,state:r,actions:{async show(){if(!s.runtime.built)throw Error(`Offcanvas.show: call build() first.`);if(r.visible)return;await Promise.resolve(t.onShow?.(s));let e=f.enter(),n=h();await e&&!s.runtime.destroyed&&t.onShown?.(s),await n},async hide(){if(!s.runtime.built)throw Error(`Offcanvas.hide: call build() first.`);if(!r.visible)return;let e=t.onHide?.(s);e&&await e,i.contentLoadId+=1,(0,n.flushSync)(()=>{r.loading=!1}),await f.leave()&&t.onHidden?.(s)}},validateStatePatch:ga,view(e){let a=t.overlay?(0,n.jsx)(`div`,{ref:o.set,className:t.className.overlay,"data-offcanvas-overlay":t.id,"data-mount":()=>r.visible?`true`:`false`,style:t.filter?{backdropFilter:`blur(2px)`}:{},onClick:()=>{t.bgClose&&s.hide()}}):null;return a&&e.own(()=>a.remove()),(0,n.createEffect)(()=>{let e=r.content;B(`content`,e,da.content,`Offcanvas.state`),p(),typeof e==`function`?(r.resolvedContent=null,(0,n.untrack)(()=>r.visible)&&h()):(i.contentLoadId+=1,r.resolvedContent=e,r.loading=!1)}),(0,n.jsx)(`div`,{className:t.className.root,id:t.id,role:`dialog`,"aria-modal":t.overlay?`true`:`false`,"aria-expanded":()=>String(r.visible),"data-mount":()=>r.visible?`true`:`false`,"data-offcanvas":`root`,"data-direction":t.direction,"data-animate":t.animate,onClick:e=>{if(!(e.target instanceof Element))return;let t=e.target.closest(`[data-action]`);(t?.dataset.action===`close`||t?.dataset.action===`cancel`)&&s.hide()},children:(0,n.jsx)(`div`,{className:t.className.content,"data-offcanvas-content":t.id,children:()=>r.loading?Z():typeof r.resolvedContent==`function`?r.resolvedContent(s):r.resolvedContent})})},onBuild(e){t.escClose&&a.on(`esc`,document,`keydown`,e=>{e instanceof KeyboardEvent&&e.key===`Escape`&&r.visible&&s.hide()}),e.own(()=>a.clear())},onDestroy(){f.cancel(),i.contentLoadId+=1,o.current?.remove(),u()}}),s}let va={size:10,current:1},ya={sibling:1,boundary:1},ba={root:`j-pagination`,list:`pagination`,item:`item`,more:`more`,button:`j-button is-icon is-ghost`,current:`j-button is-icon is-active`,loading:`animate-spin`},xa={default:0,type:`number`,finite:!0,min:0},Sa={type:`plainObject`,required:!0,shape:{size:{type:`number`,integer:!0,greaterThan:0},current:{type:`number`,integer:!0,greaterThan:0}}},Ca={type:`plainObject`,required:!0,shape:{sibling:{type:`number`,integer:!0,min:0},boundary:{type:`number`,integer:!0,min:0}}},wa={total:xa,page:{default:()=>({...va}),factory:!0,normalize:e=>({...va,...e&&typeof e==`object`?e:{}}),...Sa},count:{default:()=>({...ya}),factory:!0,normalize:e=>({...ya,...e&&typeof e==`object`?e:{}}),...Ca},lock:{default:!0,type:`boolean`},onChange:{default:null,types:[`function`,`null`]},className:{default:ba,type:`object`,normalize:e=>({...ba,...e&&typeof e==`object`?e:{}})}},Ta={total:xa,page:Sa,count:Ca,locked:{type:`boolean`}};function Ea(e,t,n){return Math.min(Math.max(e,t),n)}function Da(e,t){return Math.max(1,Math.ceil(e/t))}function Oa(e){return{size:e.size,current:e.current}}function ka(e){return{sibling:e.sibling,boundary:e.boundary}}function Aa(e={}){let t=V(e,wa,`Pagination.props`),n=Da(t.total,t.page.size);return{...t,page:{size:t.page.size,current:Ea(t.page.current,1,n)},count:ka(t.count),className:{...t.className}}}function ja(e){return{type:`more`,key:e}}function Ma(e){return{type:`page`,key:`page-${e}`,page:e}}function Na(e,t){let n=[];for(let r=e;r<=t;r++)n.push(r);return n}function Pa(e,t,n){if(t<=0)return[];let r=Math.max(0,n.boundary),i=Math.max(0,n.sibling);if(t<=r*2+i*2+3)return Na(1,t).map(Ma);let a=new Set;for(let e=1;e<=Math.min(r,t);e++)a.add(e);for(let n=Math.max(1,e-i);n<=Math.min(t,e+i);n++)a.add(n);for(let e=Math.max(1,t-r+1);e<=t;e++)a.add(e);let o=Array.from(a).sort((e,t)=>e-t),s=[];for(let e of o){let t=s[s.length-1];t?.type===`page`&&e-t.page>1&&s.push(e-t.page===2?Ma(t.page+1):ja(`more-${t.page}-${e}`)),s.push(Ma(e))}return s}function Fa(e){if(e.type!==`page`)throw Error(`Pagination.itemView: expects page item.`);return e}function Ia(e={}){let t=Aa(e),r=(0,n.createDeepStore)({total:t.total,page:Oa(t.page),count:ka(t.count),locked:!1}),i=0,a,o=(0,n.createMemo)(()=>Da(r.total,r.page.size)),s=()=>t.lock&&r.locked,c=()=>s()||r.page.current<=1,l=()=>s()||r.page.current>=o(),u=(0,n.createMemo)(()=>Pa(r.page.current,o(),r.count)),f=e=>{t.lock&&!a.runtime.destroyed&&e===i&&(0,n.flushSync)(()=>{r.locked=!1})},p=e=>{if(a.runtime.destroyed)throw Error(`Pagination.go: instance destroyed`);if(!a.runtime.built)throw Error(`Pagination.go: call build() first.`);if(B(`page`,e,{type:`number`,integer:!0},`Pagination.go`),s())return a;let c=Ea(e,1,o());if(c===r.page.current)return a;let l=t.lock&&typeof t.onChange==`function`,u=l?++i:i;if((0,n.flushSync)(()=>{r.page.current=c,l&&(r.locked=!0)}),t.onChange){let e;try{e=t.onChange(c,a)}catch(e){throw f(u),e}if(l&&e&&typeof e.then==`function`){let t=()=>f(u);Promise.resolve(e).then(t,t)}else f(u)}return a},m=e=>{let i=e===`prev`?c:l;return(0,n.jsx)(`li`,{className:t.className.item,"data-pagination-control":e,children:(0,n.jsx)(`button`,{className:t.className.button,type:`button`,"data-page-action":e,"aria-label":e===`prev`?`Go to previous page`:`Go to next page`,"aria-disabled":()=>i()?`true`:`false`,tabindex:()=>i()?`-1`:null,disabled:i,onClick:()=>{i()||p(r.page.current+(e===`prev`?-1:1))},children:d(e===`prev`?`arrow-left`:`arrow-right`)})})},h=e=>{if(e().type===`more`)return(0,n.jsx)(`li`,{className:()=>g(t.className.item,e().type===`more`?t.className.more:``),"data-pagination-more":()=>e().type===`more`?e().key:null,children:(0,n.jsx)(`span`,{className:t.className.button,children:d(`more`)})});let i=()=>Fa(e()).page,a=()=>i()===r.page.current;return(0,n.jsx)(`li`,{className:()=>g(t.className.item,e().type===`more`?t.className.more:``),"data-pagination-more":()=>e().type===`more`?e().key:null,"data-pagination-item":()=>{let t=e();return t.type===`page`?String(t.page):null},children:(0,n.jsx)(`button`,{className:()=>a()?t.className.current:t.className.button,type:`button`,"data-page":()=>String(i()),"data-current-page":()=>a()?String(i()):null,"aria-current":()=>a()?`page`:null,"aria-label":()=>a()?`Page ${i()}, current page`:`Go to page ${i()}`,"aria-disabled":()=>s()||a()?`true`:`false`,tabindex:()=>s()||a()?`-1`:null,disabled:()=>s()||a(),onClick:()=>{let e=i();!s()&&!a()&&p(e)},children:()=>s()&&a()?(0,n.jsx)(`i`,{className:t.className.loading,children:d(`loader`)}):String(i())})})};return a=Q({name:`Pagination`,props:t,state:r,actions:{go:p},normalizeStatePatch(e){let t={...e};return Object.hasOwn(t,`page`)&&L(t.page)&&(t.page={...r.page,...t.page}),Object.hasOwn(t,`count`)&&L(t.count)&&(t.count={...r.count,...t.count}),t},validateStatePatch(e){for(let t of Object.keys(e)){if(!Object.hasOwn(Ta,t))throw Error(`Pagination.setState: "${t}" is not supported.`);let n=t;B(t,e[t],Ta[n],`Pagination.setState`)}},view:()=>((0,n.createEffect)(()=>{let e=Ea(r.page.current,1,o());e!==r.page.current&&(r.page.current=e)}),(0,n.jsx)(`div`,{className:t.className.root,role:`navigation`,"aria-label":`Pagination`,"data-pagination":`root`,children:(0,n.jsx)(`ul`,{className:t.className.list,"data-pagination-list":``,"aria-live":`polite`,children:[m(`prev`),(0,n.For)({each:u,key:e=>e.key,children:e=>h(e)}),m(`next`)]})}))}),Object.defineProperty(a,"pageCount",{enumerable:!0,get:o}),a}let La={root:`j-menu`,list:`menu`,item:`menu-item`,hasChildren:`menu-item-has-children`,link:`menu-link`,subMenu:`sub-menu`,active:`is-active`,text:`menu-text`,backItem:`menu-item back`,backIcon:`el-icon el-prefix`},Ra={type:`object`,validate:Ka,message:`expects { title, id?, url?, target?, classes?, children? }.`},za={type:`array`,items:Ra},Ba={type:{default:void 0,types:[`string`,`undefined`]},id:{default:null,types:[`string`,`null`],normalize:e=>typeof e==`string`?e.trim()||q():e??q()},data:{default:[],type:`array`,normalize:qa,items:Ra},backText:{default:(0,t.t)(`b`,i),type:`string`},className:{default:La,type:`object`,normalize:e=>({...La,...e&&typeof e==`object`?e:{}})}},Va={data:za,activeKeys:{type:`array`,items:`string`}};function Ha(e={}){let t=V(e,Ba,`Menu.props`);return{...t,data:qa(t.data),className:{...t.className}}}function Ua(e){return e==null?[]:typeof e==`string`?e.trim().split(/\s+/).filter(Boolean):e.slice()}function Wa(e){return`menu-item-${e??q()}`}function Ga(e){return typeof e==`string`?e.trim():``}function Ka(e){if(!e||typeof e!=`object`||Array.isArray(e))return!1;let t=e;return(typeof t.title==`string`||typeof t.title==`number`)&&(t.id==null||typeof t.id==`string`||typeof t.id==`number`)&&(t.url==null||typeof t.url==`string`)&&(t.target==null||typeof t.target==`string`)&&(t.classes==null||typeof t.classes==`string`||Array.isArray(t.classes)&&t.classes.every(e=>typeof e==`string`))&&(t.children==null||Array.isArray(t.children)&&t.children.every(Ka))}function qa(e){return Array.isArray(e)?e.map(e=>{B(`item`,e,Ra,`Menu.data`);let t={...e};return Array.isArray(t.classes)&&(t.classes=t.classes.slice()),Array.isArray(t.children)&&(t.children=qa(t.children)),t}):[]}function Ja(e={}){let t=Ha(e),r=(0,n.createDeepStore)({data:qa(t.data),activeKeys:[]}),i=new WeakMap,a=K(),o,s=e=>e.id==null?(i.has(e)||i.set(e,q()),i.get(e)):String(e.id),c=e=>r.activeKeys.includes(e),l=e=>{(0,n.flushSync)(()=>{r.activeKeys=t.type===`bottom`?[e]:r.activeKeys.includes(e)?r.activeKeys:[...r.activeKeys,e]})},u=e=>{(0,n.flushSync)(()=>{r.activeKeys=r.activeKeys.filter(t=>t!==e)})},f=e=>{(0,n.flushSync)(()=>{r.activeKeys=c(e)?[]:[e]})},p=e=>(0,n.jsx)(`li`,{className:t.className.backItem,"data-menu-back":``,children:(0,n.jsx)(`a`,{className:t.className.link,href:``,"data-menu-link":``,onClick:t=>{t.preventDefault(),u(e)},children:[(0,n.jsx)(`span`,{className:t.className.backIcon,children:d(`arrow-left`)}),(0,n.jsx)(`span`,{className:t.className.text,children:t.backText})]})}),m=(e,r=!1,i)=>(0,n.jsx)(`ul`,{className:r?t.className.list:t.className.subMenu,...r?{id:t.id}:{},"data-menu-list":r?`root`:`sub`,children:[(0,n.For)({each:()=>t.type===`mobile`&&i&&c(i)?[i]:[],key:e=>e,children:e=>p(e())}),(0,n.For)({each:e,key:e=>s(e),children:e=>{let r=s(e());return(0,n.jsx)(`li`,{className:()=>{let n=e();return g(t.className.item,n.children?.length?t.className.hasChildren:``,...Ua(n.classes),c(r)?t.className.active:``)},id:()=>e().id==null?`menu-item-${r}`:Wa(e().id),"data-menu-item":()=>e().id==null?``:String(e().id),"data-menu-has-children":()=>e().children?.length?``:null,onClick:n=>{t.type===`mobile`&&n.target===n.currentTarget&&e().children?.length&&l(r)},children:[()=>{let i=e(),a=!!i.children?.length,o=Ga(i.url);return!a&&!o?(0,n.jsx)(`span`,{className:t.className.link,"data-menu-link":``,children:i.title}):(0,n.jsx)(`a`,{className:t.className.link,href:o,target:i.target,"data-menu-link":``,onClick:e=>{a&&(t.type===`mobile`||t.type===`bottom`)&&(e.preventDefault(),t.type===`bottom`?f(r):l(r))},children:i.title})},()=>e().children?.length?m(()=>e().children||[],!1,r):null]})}})]});return o=Q({name:`Menu`,props:t,state:r,normalizeStatePatch(e){let t={...e};return Object.hasOwn(t,`data`)&&(t.data=qa(t.data)),t},validateStatePatch(e){for(let t of Object.keys(e)){if(!Object.hasOwn(Va,t))throw Error(`Menu.setState: "${t}" is not supported.`);let n=t;B(t,e[t],Va[n],`Menu.setState`)}},view:()=>(B(`data`,r.data,za,`Menu`),(0,n.jsx)(`nav`,{className:t.className.root,"data-menu":`root`,"data-menu-type":t.type,children:m(()=>r.data,!0)})),onBuild(e){t.type===`bottom`&&(a.on(`outside`,document,`click`,t=>{let i=t.target;!(i instanceof Node)||e.element?.contains(i)||(0,n.flushSync)(()=>{r.activeKeys=[]})}),e.own(()=>a.clear()))}}),o}e.Toast=pt,e.addIcons=h,e.all=G,e.checkModernBrowser=vt,e.copy=ht,e.createAccordion=Yr,e.createCollapseTransition=Tt,e.createDrop=Tn,e.createElementRef=an,e.createEventManager=K,e.createFlow=Di,e.createForm=_i,e.createKeyedElementRefs=on,e.createLoading=Z,e.createMenu=Ja,e.createModal=Vi,e.createMotionGroup=xt,e.createOffcanvas=_a,e.createOwnedView=sn,e.createPagination=Ia,e.createParabola=Kn,e.createPopup=yn,e.createPresence=gn,e.createScheduledTask=$t,e.createStateSync=rn,e.createSticky=Qn,e.createSwiper=Zi,e.createTabs=sa,e.createTheme=Bn,e.createToc=Ir,e.createTooltip=An,e.createTransition=wt,e.createValidator=Er,e.debounce=Ut,e.defineComponent=Q,e.getRegistedIconPath=m,e.getStoreVersion=en,e.getType=ue,e.icon=d,e.iconHtml=f,e.iconMarkup=p,e.isDomElementValue=oe,e.isDomNodeValue=ae,e.isElement=H,e.isHtmlElementValue=se,e.isMobile=mt,e.isModernBrowser=_t,e.isNilValue=R,e.isNode=De,e.isPlainObject=L,e.isRenderableContent=Fe,e.isRenderablePrimitive=ce,e.isRenderableValue=le,e.lazyRender=Ie,e.listen=Ve,e.postJson=bt,e.q=W,e.randomId=q,e.removeComponentPlugin=kr,e.requireContainer=Pe,e.resolveContainer=Ne,e.resolveElement=U,e.resolveNode=Me,e.resolveNodeList=je,e.resolveProps=V,e.restUrl=yt,e.stateSnapshot=nn,e.throttle=Gt,e.timer=Ue,e.trackStoreVersion=tn,e.useComponentPlugin=Or,e.uuid=He,e.validateParam=B,e.waitForMotion=hn});
|