vanilla-jui 1.6.6 → 1.7.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/dist/index.d.ts +25 -1
- package/dist/index.js +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/css/themes/default/menu.css +12 -6
- package/src/utilities/id.ts +191 -0
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{For as e,access as t,bindAttr as n,bindClass as r,createDeepStore as i,createEffect as a,createMemo as o,createRoot as s,createSignal as c,createWatch as l,flushSync as u,insert as d,jsx as f,onCleanup as p,untrack as m,unwrap as h}from"vanilla-signal";import{t as g}from"vanilla-signal-i18n";import{createStorage as _}from"vanilla-create-storage";var v={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:`自动`,Tip:`提示`,Close:`关闭`,Confirm:`确认`,Cancel:`取消`,Upgrade:`升级`,wn:`您的浏览器版本过低,存在安全风险。请升级浏览器后再访问本站。`,Submit:`提交`,Reset:`重置`,"Loading...":`加载中...`,"Go to previous page":`访问上一页`,"Go to next page":`访问下一页`,Next:`下一步`,Finish:`完成`}};function y(e){return g(e,v)}var b={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>`,like:`<path d="M12.001 4.52853C14.35 2.42 17.98 2.49 20.2426 4.75736C22.5053 7.02472 22.583 10.637 20.4786 12.993L11.9999 21.485L3.52138 12.993C1.41705 10.637 1.49571 7.01901 3.75736 4.75736C6.02157 2.49315 9.64519 2.41687 12.001 4.52853ZM18.827 6.1701C17.3279 4.66794 14.9076 4.60701 13.337 6.01687L12.0019 7.21524L10.6661 6.01781C9.09098 4.60597 6.67506 4.66808 5.17157 6.17157C3.68183 7.66131 3.60704 10.0473 4.97993 11.6232L11.9999 18.6543L19.0201 11.6232C20.3935 10.0467 20.319 7.66525 18.827 6.1701Z"></path>`,dislike:`<path d="M2.80777 1.3934L21.1925 19.7782L19.7783 21.1924L16.0316 17.4454L12 21.485L3.52154 12.993C1.48186 10.7094 1.49309 7.24014 3.55524 4.96959L1.39355 2.80762L2.80777 1.3934ZM4.98009 11.6232L12 18.6543L14.6176 16.0314L4.97206 6.38623C3.67816 7.88265 3.67138 10.121 4.98009 11.6232ZM20.2428 4.75736C22.5054 7.02472 22.5831 10.637 20.4788 12.993L18.8442 14.629L17.4302 13.215L19.0202 11.6232C20.3937 10.0467 20.3191 7.66525 18.8271 6.1701C17.3281 4.66794 14.9078 4.60702 13.3371 6.01688L12.0021 7.21524L10.6662 6.01781C10.3163 5.70415 9.92487 5.46325 9.51117 5.29473L7.2604 3.04551C8.92926 2.83935 10.6682 3.33369 12.0011 4.52853C14.3502 2.42 17.9802 2.49 20.2428 4.75736Z"></path>`,"thumb-up":`<path d="M14.5998 8.00033H21C22.1046 8.00033 23 8.89576 23 10.0003V12.1047C23 12.3659 22.9488 12.6246 22.8494 12.8662L19.755 20.3811C19.6007 20.7558 19.2355 21.0003 18.8303 21.0003H2C1.44772 21.0003 1 20.5526 1 20.0003V10.0003C1 9.44804 1.44772 9.00033 2 9.00033H5.48184C5.80677 9.00033 6.11143 8.84246 6.29881 8.57701L11.7522 0.851355C11.8947 0.649486 12.1633 0.581978 12.3843 0.692483L14.1984 1.59951C15.25 2.12534 15.7931 3.31292 15.5031 4.45235L14.5998 8.00033ZM7 10.5878V19.0003H18.1606L21 12.1047V10.0003H14.5998C13.2951 10.0003 12.3398 8.77128 12.6616 7.50691L13.5649 3.95894C13.6229 3.73105 13.5143 3.49353 13.3039 3.38837L12.6428 3.0578L7.93275 9.73038C7.68285 10.0844 7.36341 10.3746 7 10.5878ZM5 11.0003H3V19.0003H5V11.0003Z"></path>`,"thumb-down":`<path d="M9.40017 16H3C1.89543 16 1 15.1046 1 14V11.8957C1 11.6344 1.05118 11.3757 1.15064 11.1342L4.24501 3.61925C4.3993 3.24455 4.76447 3 5.16969 3H22C22.5523 3 23 3.44772 23 4V14C23 14.5523 22.5523 15 22 15H18.5182C18.1932 15 17.8886 15.1579 17.7012 15.4233L12.2478 23.149C12.1053 23.3508 11.8367 23.4184 11.6157 23.3078L9.80163 22.4008C8.74998 21.875 8.20687 20.6874 8.49694 19.548L9.40017 16ZM17 13.4125V5H5.83939L3 11.8957V14H9.40017C10.7049 14 11.6602 15.229 11.3384 16.4934L10.4351 20.0414C10.3771 20.2693 10.4857 20.5068 10.6961 20.612L11.3572 20.9425L16.0673 14.27C16.3172 13.9159 16.6366 13.6257 17 13.4125ZM19 13H21V5H19V13Z"></path>`};const x=`http://www.w3.org/2000/svg`,S=b;function C(e){if(!(e in S))throw Error(`Icon "${e}" not found.`)}function w(e){return C(e),`<svg xmlns="${x}" viewBox="0 0 24 24" fill="currentColor">${S[e]}</svg>`}function T(e){return e!==null&&e.namespaceURI===x}function E(e,t={}){let n=document.createElement(`template`);n.innerHTML=w(e);let r=n.content.firstElementChild;if(!T(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 D(e){return w(e)}const O=D;function k(){return{...S}}function A(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 j(e=`center`,t=`center`){let n=E(`loader`,{width:24});return requestAnimationFrame(()=>{typeof n.animate==`function`&&n.animate([{transform:`rotate(0deg)`},{transform:`rotate(360deg)`}],{duration:1e3,iterations:1/0,easing:`linear`})}),f(`div`,{"aria-live":`polite`,style:{display:`flex`,justifyContent:e,alignItems:t,position:`absolute`,width:`100%`,height:`100%`,borderRadius:`inherit`,backdropFilter:`blur(4px)`},children:n})}const M=Function.prototype.toString.call(Object);function N(e){if(typeof e!=`object`||!e||Object.prototype.toString.call(e)!==`[object Object]`)return!1;let t=Object.getPrototypeOf(e);if(t===null)return!0;let n=Object.prototype.hasOwnProperty.call(t,`constructor`)&&t.constructor;return typeof n==`function`&&Function.prototype.toString.call(n)===M}function P(e){return e==null}function F(e){return typeof Node<`u`&&e instanceof Node}function I(e){return typeof Element<`u`&&e instanceof Element}function L(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function R(e){return typeof e==`string`||typeof e==`number`||typeof e==`boolean`}function z(e){return P(e)||R(e)||typeof e==`function`||Array.isArray(e)||F(e)}const B=e=>e===null?`null`:Array.isArray(e)?`array`:L(e)?`HTMLElement`:F(e)?`Node`:typeof e;function ee(e){return Array.isArray(e)?e.slice():N(e)?{...e}:e}function V(e={}){return typeof e==`string`||Array.isArray(e)?{type:e}:!e||typeof e!=`object`?{}:e}function H(e,t){throw Error(`Validator: ${e} ${t}`)}function te(e){return typeof e==`string`?e:String(e)}function ne(e){return typeof e==`string`?`string`:`array`}function re(e,t,n){if(P(t)||typeof t!=`string`&&!Array.isArray(t))return;let r=ne(t);n.nonEmpty&&t.length===0&&H(e,`expects a non-empty ${r}.`),typeof n.minLength==`number`&&t.length<n.minLength&&H(e,`expects ${r} length to be at least ${n.minLength}.`),typeof n.maxLength==`number`&&t.length>n.maxLength&&H(e,`expects ${r} length to be at most ${n.maxLength}.`)}function U(e,t,n){P(t)||typeof t!=`number`||(n.finite&&!Number.isFinite(t)&&H(e,`expects a finite number.`),n.integer&&!Number.isInteger(t)&&H(e,`expects an integer.`),typeof n.min==`number`&&t<n.min&&H(e,`expects a number greater than or equal to ${n.min}.`),typeof n.max==`number`&&t>n.max&&H(e,`expects a number less than or equal to ${n.max}.`),typeof n.greaterThan==`number`&&t<=n.greaterThan&&H(e,`expects a number greater than ${n.greaterThan}.`),typeof n.lessThan==`number`&&t>=n.lessThan&&H(e,`expects a number less than ${n.lessThan}.`))}function ie(e,t,n){!n.plain||P(t)||N(t)||H(e,`expects an object.`)}function ae(e,t,n){!n.items||P(t)||(Array.isArray(t)||H(e,`expects array.`),t.forEach((t,r)=>{W(String(r),t,n.items,e)}))}function oe(e,t,n){if(!n.shape||P(t))return;(!t||typeof t!=`object`||Array.isArray(t))&&H(e,`expects object.`);let r=t;for(let[t,i]of Object.entries(n.shape))W(t,r[t],i,e)}function se(e,t){return t===`renderable`?z(e):t===`Node`?F(e):t===`Element`?I(e):t===`HTMLElement`?L(e):t===`plainObject`?N(e):B(e)===t}function ce(e){return N(e)?`object`:B(e)}function le(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)||H(e,i)}}function ue(e,t){return e?`${e}.${t}`:t}function W(e,t,n={},r=``){let i=V(n),a=ue(r,e),o=Object.hasOwn(i,`types`)?i.types:i.type;if(i.required&&P(t)&&H(a,`is required.`),o!==void 0){let e=Array.isArray(o)?o:[o],n=ce(t);e.some(e=>se(t,e))||H(a,`expects ${e.join(`, `)}, but got ${n}.`)}return Array.isArray(i.enum)&&!i.enum.includes(t)&&H(a,`expects one of ${i.enum.map(te).join(`, `)}.`),re(a,t,i),U(a,t,i),ie(a,t,i),ae(a,t,i),oe(a,t,i),le(a,t,i.conditions),typeof i.validate==`function`&&(i.validate(t)||H(a,i.message||`does not satisfy the required condition.`)),t}function G(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=V(t);a[e]=Object.hasOwn(i,e)?i[e]:de(n)}for(let[e,n]of o){let r=V(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)W(e,a[e],t,n);return a}function de(e){if(!Object.hasOwn(e,`default`))return;let t=e.default;return ee(e.factory&&typeof t==`function`?t():t)}function K(e){return e}function q(...e){return e.filter(Boolean).join(` `)}const fe=[`node`,`element`,`array`];function pe(e){return fe.includes(e)}function me(e){return F(e)}function he(e){return I(e)}function ge(e){return typeof e==`string`||he(e)||me(e)||Array.isArray(e)}function _e(e){return e.find(he)||null}function ve(e,t=[]){for(let n of e){if(Array.isArray(n)){if(!ve(n,t))return null;continue}if(me(n)){t.push(n);continue}return null}return t}function ye(e){if(e===!1||e==null)return null;if(typeof e==`string`){let t=Y(e);return t.length>0?t:null}if(Array.isArray(e)){let t=ve(e,[]);return t&&t.length>0?t:null}return me(e)?[e]:null}function be(e){return he(e)||me(e)?e:typeof e==`string`?document.querySelector(e):Array.isArray(e)&&(ye(e)||[])[0]||null}function xe(e){if(!ge(e))return null;if(typeof e==`string`){let t=document.querySelector(e);return he(t)?t:null}if(Array.isArray(e)){let t=ye(e);return Array.isArray(t)?_e(t):null}return he(e)?e:null}function Se(e,t=`Component`,n=`element`){if(!pe(n))throw Error(`${t}: expect must be one of 'node', 'element', 'array'.`);return ge(e)?n===`array`?ye(e):n===`node`?be(e):xe(e):null}function Ce(e,t=`Component`,n=`element`){let r=Se(e,t,n);if(r==null)throw Error(`${t}: container not found.`);return r}function we(e){return z(e)}function J(e,t=document){return t.querySelector(e)}function Y(e,t=document){return Array.from(t.querySelectorAll(e))}function Te(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(!De(e))return console.warn(`lazyRender: target 必须是 CSS 选择器字符串或 DOM 元素`),Ee;let c=Ee,l=Oe(e);if(l&&document.body.contains(l))return c=ke(l,t,s),c;if(!o||typeof MutationObserver>`u`)return t(),c;let u=new MutationObserver(()=>{let n=Oe(e);!n||!document.body.contains(n)||(l=n,u.disconnect(),c=ke(l,t,s))});return u.observe(document.documentElement,{childList:!0,subtree:!0}),()=>{u.disconnect(),c()}}function Ee(){}function De(e){return typeof e==`string`||he(e)}function Oe(e){return typeof e==`string`?J(e):e}function ke(e,t,n){if(typeof window>`u`||window.IntersectionObserver===void 0)return t(),Ee;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 Ae(e,t,n,r){let i=!0;return e.addEventListener(t,n,r),()=>{i&&(i=!1,e.removeEventListener(t,n,r))}}function je(){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=Ae(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 Me(){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 X(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,`_`)}const Ne={},Pe={timers:Ne,start(e,t,n){Ne[e]&&clearTimeout(Ne[e]),Ne[e]=setTimeout(()=>{n(),delete Ne[e]},t)},cancel(e){Ne[e]&&(clearTimeout(Ne[e]),delete Ne[e])}},Fe={container:`j-toast-container`,toast:`j-toast`,icon:`el-icon`,message:`el-text`,lite:`j-toast-lite`,confirm:`j-toast is-confirm`,buttons:`toast-buttons`,button:`j-button is-sm`,closeBtn:`is-ghost`,confirmBtn:`is-outline`,info:`is-info`,primary:`is-primary`,success:`is-success`,warning:`is-warning`,error:`is-error`},Ie={type:`string`,enum:[`info`,`success`,`warning`,`error`,`primary`]},Le={type:`number`,min:0},Re={type:`number`,greaterThan:0},ze=new Set,Be=new Map,Z=new Map,Ve=new Map,He=new Map;let Ue=Fe;function We(e){return{...Fe,...e}}function Ge(e){return We({...Ue,...e?.className})}function Ke(e,t){let n=Be.get(e);Be.set(e,()=>{n?.(),t()})}function qe(e){let t=He.get(e);return t?!t.isConnected||t.getAttribute(`data-mount`)===`false`?(He.delete(e),null):t:null}function Je(e,t,n){n&&He.set(e,t)}function Ye(e){for(let[t,n]of He)n===e&&He.delete(t)}function Xe(e){return!!t(e.loading??!1)}function Ze(e){return e===`primary`?`info`:e}function Qe(e){return Xe(e)?{position:`relative`,display:`inline-flex`,alignItems:`center`,justifyContent:`center`,width:`var(--toast-icon-size, 1em)`,height:`var(--toast-icon-size, 1em)`,flex:`0 0 auto`}:{}}function $e(e,t){return Xe(t)?j():E(Ze(e))}function et(e,t){return Xe(t)?t.text?.loading||y(`Loading...`):e}async function tt(e,t){let n=Xe(t);ft(e),n&&await t.onCancel?.(),await t.onClose?.()}function nt(e,t,n,r,i,o,c=0){let l=e.dataset.toast||X();Ke(e,s(s=>(d(t,()=>$e(i,o)),d(n,()=>et(r,o)),a(()=>{at(l),c>0&&!Xe(o)&&it(l,`hide`,()=>ft(e),c)}),s)))}function rt(e){let t=J(`[data-toast-container]`);return t?t.className=e.container:(t=f(`div`,{className:e.container,"data-toast-container":``}),d(document.body,t)),t}function it(e,t,n,r){let i=`${e}-${t}`;return ze.add(i),Pe.start(i,r,()=>{ze.delete(i),n()}),i}function at(e){for(let t of Array.from(ze))t.startsWith(`${e}-`)&&(Pe.cancel(t),ze.delete(t))}function ot(e){Z.get(e)?.cancel(),Z.delete(e),Ve.delete(e),e.remove(),Be.get(e)?.(),Be.delete(e),Ye(e);let t=J(`[data-toast-container]`);t&&t.children.length===0&&t.remove()}function st(e,t,n){return{duration:e.ownerDocument.defaultView?.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches?0:t,easing:n,fill:`both`}}function ct(e){return e.finished.then(()=>void 0,()=>void 0)}function lt(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 ut(e,t){let n=(Ve.get(e)||0)+1;if(Ve.set(e,n),Z.get(e)?.cancel(),Z.delete(e),typeof e.animate!=`function`)return;let r=e.hasAttribute(`data-toast-lite`),i=e.animate(lt(e,t),st(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)`));Z.set(e,i),await ct(i),Ve.get(e)===n&&Z.get(e)===i&&Z.delete(e)}function dt(e,t,n,r){e.removeAttribute(`data-mount`),e.setAttribute(`aria-live`,n),t(),e.getBoundingClientRect(),ut(e,`enter`).then(()=>{!e.isConnected||e.dataset.mount===`false`||r?.()})}function ft(e){e&&e.getAttribute(`data-mount`)!==`false`&&(Be.get(e)?.(),Be.delete(e),at(e.dataset.toast||X()),e.removeAttribute(`aria-live`),e.setAttribute(`data-mount`,`false`),ut(e,`leave`).then(()=>{e.dataset.mount===`false`&&ot(e)}))}function pt(e=``,t={}){let n=t.once??!1;if(n){let e=qe(`show`);if(e)return e}W(`message`,e,`string`,`Toast.show`);let r=t.duration??3e3,i=t.theme||`info`;W(`once`,n,`boolean`,`Toast.show`),W(`duration`,r,Le,`Toast.show`),W(`theme`,i,Ie,`Toast.show`);let a=Ge(t),o=X(),s=f(`span`,{className:a.icon,"data-toast-icon":o,style:()=>Qe(t)}),c=f(`span`,{className:a.message,"data-toast-message":o}),l=f(`div`,{className:q(a.toast,a[i]),"data-toast":o,role:`alert`,"aria-atomic":`true`,children:[s,c]});return nt(l,s,c,e,i,t,r),dt(l,()=>d(rt(a),l),i===`error`?`assertive`:`polite`),Je(`show`,l,n),Ke(l,Ae(l,`click`,()=>void tt(l,t))),l}function mt(e=``,t=2e3,n){W(`message`,e,`string`,`Toast.lite`),W(`duration`,t,Re,`Toast.lite`);let r=We({...Ue,...n}),i=J(`[data-toast-lite]`);i&&(at(i.dataset.toast||``),Z.get(i)?.cancel(),ot(i));let a=X(),o=f(`div`,{className:r.lite,"data-toast":a,"data-toast-lite":``,children:e});return dt(o,()=>d(document.body,o),`polite`),it(a,`hide`,()=>ft(o),t),o}function ht(e=``,t={}){let n=t.once??!0;if(n){let e=qe(`confirm`);if(e)return e}W(`message`,e,`string`,`Toast.confirm`);let r=t.text?.close||y(`Close`),i=t.text?.confirm||y(`Confirm`),a=t.theme||`info`;W(`once`,n,`boolean`,`Toast.confirm`),W(`theme`,a,Ie,`Toast.confirm`);let o=Ge(t),s=X(),c=f(`div`,{className:q(o.confirm,o[a]),"data-toast":s,"data-toast-confirm":``,children:[f(`div`,{className:o.message,"data-toast-message":s,children:e}),f(`div`,{className:o.buttons,"data-toast-buttons":s,children:[f(`button`,{className:q(o.button,o.closeBtn),children:r,"data-toast-button":`close`,"aria-label":r,onClick:async()=>{await t.onClose?.(),ft(c)}}),f(`button`,{className:q(o.button,o.confirmBtn),children:i,"data-toast-button":`confirm`,"aria-label":i,onClick:async()=>{await t.onConfirm?.(),ft(c)}})]})]});return dt(c,()=>d(rt(o),c),`polite`,()=>{J(`[data-toast-button="confirm"]`,c)?.focus()}),Je(`confirm`,c,n),c}function gt(){for(let e of ze)Pe.cancel(e);ze.clear();for(let e of Be.values())e();Be.clear();for(let e of Z.values())e.cancel();Z.clear(),Ve.clear(),He.clear(),J(`[data-toast-container]`)?.remove(),J(`[data-toast-lite]`)?.remove()}const _t={timers:ze,disposers:Be,configure(e={}){return Ue=We(e.className),{className:Ue}},show:pt,success:(e=``,t={})=>pt(e,{...t,theme:`success`}),info:(e=``,t={})=>pt(e,{...t,theme:`info`}),primary:(e=``,t={})=>pt(e,{...t,theme:`primary`}),warning:(e=``,t={})=>pt(e,{...t,theme:`warning`}),error:(e=``,t={})=>pt(e,{...t,theme:`error`}),hide:ft,lite:mt,confirm:ht,clearAll:gt,destroyAll:gt};function vt(){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 yt(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 bt(t)}return bt(t)}function bt(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 xt(){try{return typeof Object.hasOwn==`function`&&typeof[].at==`function`}catch{return!1}}function St(){return xt()?!0:(_t.confirm(y(`wn`),{theme:`error`,onConfirm:()=>{window.open(`https://www.google.cn/chrome/fallback/`,`_blank`)},className:{confirmBtn:`j-button is-sm is-danger`}}),!1)}const Ct=typeof window<`u`?`${window.location.origin}/wp-json`:``;async function wt(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 Tt=null,Et=null,Dt=!1;function Ot(e){if(typeof queueMicrotask==`function`){queueMicrotask(e);return}Promise.resolve().then(e)}function kt(){Dt||(Dt=!0,Ot(jt))}function At(e){e.enqueued=!0,Et?Et.next=e:Tt=e,Et=e,kt()}function jt(){Dt=!1;let e=Tt;Tt=null,Et=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 Mt(e){let t={queued:!1,enqueued:!1,disposed:!1,next:null,run:e};return{schedule(){t.disposed||t.queued||(t.queued=!0,t.enqueued||At(t))},flush(){t.disposed||(t.queued=!1,t.run())},cancel(){t.queued=!1},dispose(){t.disposed=!0,t.queued=!1}}}function Nt(e){if(e&&typeof e==`object`){let t=e.__version__;return typeof t==`number`?t:0}return 0}function Pt(e){return Nt(e),e}function Ft(e){return h(e)}function It(e,t,{deferInitial:n=!0,flushInitial:r=!1,flush:i=`microtask`}={}){let a=!1,o=!1,s,c=Mt(()=>{o&&(o=!1,m(()=>t(s)))}),u=l(e,e=>{let t=!a;if(a=!0,s=e,o=!0,t&&r||i===`sync`){c.flush();return}c.schedule()},{defer:n});return()=>{c.dispose(),u.dispose()}}function Lt(){let e=null;return{get current(){return e},set(t){e=t},clear(){e=null}}}function Rt(){let e=new Map;return{elements:e,get(t){return e.get(t)},bind(t){return n=>{e.set(t,n),p(()=>{e.get(t)===n&&e.delete(t)})}},delete(t){e.delete(t)},clear(){e.clear()}}}const zt={help:`help-block`},Bt={rules:{default:{},type:`object`},messages:{default:{},type:`object`},vanilla:{default:!1,type:`boolean`},className:{default:zt,type:`object`,normalize:e=>Vt(e)},onSubmit:{default:null,types:[`function`,`null`]}};function Vt(e){return{...zt,...N(e)?e:{}}}function Ht(e){let t=G(e,Bt,`Validator.props`);return{rules:t.rules,messages:t.messages,vanilla:t.vanilla,className:t.className,onSubmit:t.onSubmit}}function Ut(e){return e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement}function Wt(e){if(!e)return null;if(e instanceof Element)return Ut(e)?e:null;for(let t of Array.from(e))if(t instanceof Element&&Ut(t))return t;return null}function Gt(){return{valid:!0,error:!1,message:``,destroyed:!1}}function Kt(e){return e.closest(`[data-field-control]`)||e.parentElement}function qt(e){return Array.from(e.selectedOptions).map(e=>e.value.trim())}function Jt(e){return e instanceof HTMLInputElement&&e.type===`file`}function Yt(e){return!!e.files&&e.files.length>0}function Xt(e,t){return t===!0?e instanceof HTMLSelectElement?qt(e).some(e=>e.length>0):e.value.trim().length>=1:!0}function Zt(e,t){return typeof t!=`number`||e.value.length>=t}function Qt(e,t){return typeof t!=`number`||e.value.length<=t}function $t(e){return/^([\w-.]+@([\w-]+\.)+[\w-]{2,4})?$/.test(e.value)}function en(e,t,n){if(!e||typeof n!=`string`)return!0;let r=Wt(e.elements.namedItem(n));if(!r)throw Error(`Validator: target element "${n}" not found.`);return t.value===r.value}function tn(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 nn(e,t){if(!(e instanceof HTMLSelectElement))throw Error(`Validator: element expects a select element, but ${e.tagName.toLowerCase()} given.`);return t!==!0||qt(e).some(e=>e.length>0)}function rn(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 an(e,t){if(!e||!(t instanceof HTMLInputElement)||t.type!==`checkbox`)return[];let n=Array.from(e.elements).filter(e=>e instanceof HTMLInputElement&&e.type===`checkbox`&&e.name===t.name&&!e.closest(`[data-field-switch]`));return n.length>1||t.closest(`[data-choice-type="checkbox"], [data-field-choice-group]`)?n:[]}function on(e,t){let n=an(e,t);return n.length===0?null:n.filter(e=>e.checked).length}function sn(e,t,n){if(typeof n!=`number`)return!0;if(t instanceof HTMLSelectElement)return t.selectedOptions.length>=n;let r=on(e,t);return r===null||r>=n}function cn(e,t,n){if(typeof n!=`number`)return!0;if(t instanceof HTMLSelectElement)return t.selectedOptions.length<=n;let r=on(e,t);return r===null||r<=n}function ln(e,t){return!/\s/.test(e.value)||t!==!0}function un(e,t){return typeof t==`string`||t instanceof RegExp?new RegExp(t).test(e.value):!0}function dn(e,t){return!Jt(e)||t!==!0||Yt(e)}function fn(e,t){return!Jt(e)||!Yt(e)||typeof t!=`number`||e.files[0].size>=t}function pn(e,t){return!Jt(e)||!Yt(e)||typeof t!=`number`||e.files[0].size<=t}function mn(e,t){if(!Jt(e)||!Yt(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 hn(e,t,n,r,i,a=``){n.dataset.valid=`false`;let o=a||e?.messages[r]?.[i]||``;if(!o)return;t.message=o;let s=Kt(n);if(!s)return;let c=Y(`[data-validator-help]`,s).find(e=>e.dataset.validatorHelp===r)||null;c||(c=f(`div`,{"data-valid":`false`,"data-validator-help":r}),s.appendChild(c)),c.className=q(e?.className.help),c.dataset.valid=`false`,c.textContent=o}function gn(e){let t=Kt(e);if(t)for(let n of Y(`[data-validator-help]`,t))n.dataset.validatorHelp===e.name&&n.remove();e.removeAttribute(`data-valid`)}function _n(e,t={},n=!1){W(`bindEvents`,n,`boolean`,`Validator`);let r=xe(e);if(!(r instanceof HTMLFormElement))throw Error(`Validator.element expects a form element.`);let i=r,a=Ht(t),o=i.noValidate,s=Gt(),c=je(),l=new Set,u,d=()=>{i&&(i.noValidate=a?.vanilla===!1)},f=(e,t)=>{if(typeof t!=`function`)return!0;let n=t(e,u);return typeof n==`string`?n:!!n},p=(e,t)=>{let n=a?.rules[t];if(!n)return!0;for(let r of Object.keys(n)){let o=n[r],c=``;switch(r){case`required`:s.valid=Xt(e,o);break;case`minLength`:s.valid=Zt(e,o);break;case`maxLength`:s.valid=Qt(e,o);break;case`equalTo`:s.valid=en(i,e,o);break;case`email`:s.valid=$t(e);break;case`checked`:s.valid=tn(e,o);break;case`selected`:s.valid=nn(e,o);break;case`multiple`:s.valid=rn(e,o);break;case`min`:s.valid=sn(i,e,o);break;case`max`:s.valid=cn(i,e,o);break;case`noSpace`:s.valid=ln(e,o);break;case`noChinese`:s.valid=!/[\u4e00-\u9fa5]/.test(e.value);break;case`noSpecial`:s.valid=!/[@#$%^&*]+/g.test(e.value);break;case`pattern`:s.valid=un(e,o);break;case`file`:s.valid=dn(e,o);break;case`minSize`:s.valid=fn(e,o);break;case`maxSize`:s.valid=pn(e,o);break;case`accept`:s.valid=mn(e,o);break;case`validate`:{let t=f(e,o);s.valid=t===!0,c=typeof t==`string`?t:``;break}}if(!s.valid){s.error=!0,l.add(t),hn(a,s,e,t,r,c);break}gn(e)}return s.valid&&l.delete(t),s.valid},m=e=>{if(!a||s.destroyed||!e.name||!a.rules[e.name])return!0;let t=p(e,e.name);return t&&l.size===0&&(s.valid=!0,s.error=!1,s.message=``),t},h=()=>{if(!i||!a||s.destroyed)return!1;s.valid=!0,s.error=!1,s.message=``,l.clear();for(let e of Array.from(i.elements))if(!(!Ut(e)||!e.name)&&a.rules[e.name]&&(s.valid=p(e,e.name),!s.valid))break;return s.valid&&a.onSubmit?.(u),s.valid},g=e=>{if(!s.error)return;let t=e.target;!(t instanceof Element)||!Ut(t)||!t.name||!l.has(t.name)||m(t)},_=({native:e=!0}={})=>{if(i){e&&i.reset();for(let e of Array.from(i.elements))Ut(e)&&e.removeAttribute(`data-valid`);for(let e of Y(`[data-validator-help]`,i))e.remove();s.valid=!0,s.error=!1,s.message=``,l.clear()}};return u={get element(){return i},get props(){return a},set props(e){a=e,d()},runtime:s,validate:h,reset:_,destroy:()=>{s.destroyed||(s.destroyed=!0,c.clear(),_({native:!1}),i&&(i.noValidate=o),i=null,a=null,s.valid=!1,s.error=!1,s.message=``,l.clear())}},n&&(c.on(`submit`,i,`submit`,e=>{e.preventDefault(),h()}),c.on(`reset`,i,`reset`,()=>_({native:!1}))),c.on(`input`,i,`input`,g),c.on(`change`,i,`change`,g),d(),u}let vn=null;function yn(e){let t=e.split(`,`),n=t[0].match(/:(.*?);/);if(!n)return;let r=n[1],i=atob(t[1]),a=i.length,o=new Uint8Array(a);for(let e=0;e<a;e++)o[e]=i.charCodeAt(e);return new Blob([o],{type:r})}function bn(e){let{quality:t=.7,width:n,height:r}=e??{},i={quality:t,width:n,height:r};return{canvasDataURL(e,t){let n=new Image;n.src=e,n.onload=e=>{let n=e.target,{width:r,height:a}=n,o=r/a,s=i.width??r,c=i.height??s/o,l=document.createElement(`canvas`),u=l.getContext(`2d`);l.width=s,l.height=c,u?.drawImage(n,0,0,s,c),t(l.toDataURL(`image/jpeg`,i.quality))}},photoCompress(e,t){let n=new FileReader;n.readAsDataURL(e),n.onload=e=>{let n=e.target?.result;this.canvasDataURL(n,t)}},convertBase64UrlToBlob:yn}}function xn(e,t=!0){if(t&&vn)return vn;let n=bn(e);return t&&(vn=n),n}function Sn(e){return vn||=bn(e),vn}function Cn(){vn=null}function wn(e,t={}){let n,r=t.removeOnDispose!==!1,i=s(t=>(n=m(e),r&&p(()=>n.remove()),t));return{element:n,dispose:i}}function Tn(...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 En(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 Dn(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 On(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),Dn(o,t)),await En(n,a),a?.aborted)};return{enter:e=>a(1,e),leave:e=>a(-1,e),cancel(){n?.cancel(),n=null}}}function kn(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=Dn(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 En(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 An(e){return e.filter(e=>e!=null&&e.isConnected)}function jn(e){e[0]?.getBoundingClientRect()}function Mn(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 Nn(e){return e.split(`,`).map(e=>{let t=Number.parseFloat(e);return Number.isFinite(t)?t:0})}function Pn(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 Fn(e){let t=e.ownerDocument.defaultView;if(!t)return 0;let n=t.getComputedStyle(e),r=Pn(Mn(n.transitionDuration),Mn(n.transitionDelay),[1],n.transitionProperty.split(`,`).map(e=>e.trim()!==`none`)),i=Pn(Mn(n.animationDuration),Mn(n.animationDelay),Nn(n.animationIterationCount),n.animationName.split(`,`).map(e=>e.trim()!==`none`));return Math.max(r,i)}function In(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 Ln(e,t){let n=new Set,r=0;for(let t of e){if(typeof t.getAnimations!=`function`){r=Math.max(r,Fn(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(In(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 Rn(e){let t=`hidden`,n=0,r=null,i=null,a=null,o=()=>(a?.abort(),a=new AbortController,a.signal);return{get phase(){return t},enter:()=>{if(t===`visible`)return Promise.resolve(!1);if(t===`entering`&&r)return r;let i=++n,a=o();return t=`entering`,r=(async()=>{e.mount();let r=An(e.elements());return jn(r),u(e.activate),e.motion?await e.motion.enter(a):await Ln(r,a),i===n&&(t=`visible`,!0)})(),r},leave:()=>{if(t===`hidden`)return Promise.resolve(!1);if(t===`leaving`&&i)return i;let r=++n,a=o();return t=`leaving`,i=(async()=>{u(e.deactivate);let i=An(e.elements());return e.motion?await e.motion.leave(a):await Ln(i,a),r===n&&(e.unmount(),t=`hidden`,!0)})(),i},cancel(){n+=1,a?.abort(),a=null,e.motion?.cancel(),t=`hidden`,r=null,i=null}}}const zn={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 Bn(e){let t=G(e,zn,`Popup`);return{className:t.className,position:t.position,component:t.component,labelledby:t.labelledby,content:t.content}}function Vn(e={}){let{className:t,position:n,component:r,labelledby:i,content:a}=Bn(e),o={className:`${t} is-${n}`,role:`dialog`,children:K(a)};return r&&(o[`data-${r}`]=`root`,o[`aria-${r}`]=`true`),i&&(o[`aria-labelledby`]=i),f(`div`,o)}const Hn={root:`j-drop`,container:`drop-container`},Un={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:0,type:`number`,min:0},content:{default:``,type:`renderable`},cache:{default:!1,type:`boolean`},ttl:{default:0,type:`number`,min:0},className:{default:Hn,type:`object`,normalize:e=>({...Hn,...e&&typeof e==`object`?e:{}})},id:{default:null,types:[`string`,`null`],normalize:e=>typeof e==`string`?e.trim()||X():e??X()},delay:{default:0,types:[`number`,`object`]},hoverIntent:{default:!0,type:`boolean`},onShown:{default:null,types:[`function`,`null`]},onHidden:{default:null,types:[`function`,`null`]}};function Wn(e){let t=G(e,Un,`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 Gn(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 Kn(e){return typeof e==`number`&&e>0?e:0}function qn(e,t={}){let n=xe(e),r=Wn(t),i=je(),a=Gn(r.delay),o={show:null,hide:null},l={x:0,y:0,lastMoveTime:0},u=0,p=0,m=!1,h=!1,g,_=null,v=null,y=0,b=()=>{},[x,S]=c(typeof r.content==`function`?null:r.content),[C,w]=c(!1),T=()=>{if(C())return j();let e=x();return typeof e==`function`?e(g):e},{root:E}=s(e=>{b=e;let t=f(`div`,{className:r.className.container,"data-drop-container":r.name||r.id,"aria-live":()=>typeof r.content==`function`?`polite`:null,"aria-busy":()=>String(C()),children:()=>K(T())});return{root:f(`div`,{className:r.className.root,id:r.id,"data-drop":r.name||X(),"aria-expanded":`false`,children:t})}}),D=e=>{o[e]&&clearTimeout(o[e]),o[e]=null},O=async()=>{let e=r.content;if(typeof e!=`function`){S(e);return}let t=Kn(r.ttl);if(r.cache&&_&&(!t||Date.now()-_.updatedAt<=t)){S(_.content);return}if(v)return v;let n=++y;w(!0);let i=Promise.resolve().then(()=>e(g)).then(e=>{h||n!==y||(r.cache&&(_={content:e,updatedAt:Date.now()}),S(e))}).finally(()=>{n===y&&!h&&w(!1),v===i&&(v=null)});return v=i,i},k=()=>{if(!n)return;let e=n.getBoundingClientRect(),{offset:t,position:i}=r;E.style.visibility=`hidden`,E.style.display=`block`;let a=E.getBoundingClientRect(),o=0,s=0,c=i;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}o=Math.max(8,Math.min(o,window.innerHeight-a.height-8)),s=Math.max(8,Math.min(s,window.innerWidth-a.width-8)),E.style.top=`${o+window.scrollY}px`,E.style.left=`${s+window.scrollX}px`,E.style.visibility=``,E.style.display=``},A=e=>{h||m===e||(e?(E.parentNode||d(document.body,E),k(),O().then(()=>{m&&!h&&k()})):(y+=1,v=null,w(!1),E.style.top=``,E.style.left=``,E.remove()),E.setAttribute(`aria-expanded`,e?`true`:`false`),m=e,e?r.onShown?.(g):r.onHidden?.(g))},M=e=>{e.target instanceof Node&&n&&!E.contains(e.target)&&!n.contains(e.target)&&g.hide()},N=e=>{e instanceof MouseEvent&&(u=e.clientX,p=e.clientY,l.lastMoveTime=Date.now(),l.x=e.clientX,l.y=e.clientY)},P=()=>{i.on(`document:mousemove`,document,`mousemove`,N),D(`show`),o.show=setTimeout(()=>{let e=Date.now()-l.lastMoveTime;Math.abs(l.x-u)+Math.abs(l.y-p)<5||e>100?(g.show(!1),i.off(`document:mousemove`)):P()},a.show)};return g={get target(){return n},props:r,get element(){return h?null:E},get isVisible(){return m},delayShow:a.show,delayHide:a.hide,show(e=!0){D(`hide`),!(m||h)&&(e&&a.show>0?(D(`show`),o.show=setTimeout(()=>A(!0),a.show)):A(!0))},hide(e=!0){D(`show`),!(!m||h)&&(e&&a.hide>0?(D(`hide`),o.hide=setTimeout(()=>A(!1),a.hide)):A(!1))},toggle(){m?g.hide():g.show()},destroy(){h||(h=!0,D(`show`),D(`hide`),i.clear(),y+=1,v=null,w(!1),E.remove(),b(),n=null,m=!1)}},n&&(r.mode===`hover`?(i.on(`target:enter`,n,`mouseenter`,()=>{r.hoverIntent?P():g.show()}),i.on(`target:leave`,n,`mouseleave`,()=>{D(`show`),i.off(`document:mousemove`),g.hide()}),i.on(`root:enter`,E,`mouseenter`,()=>g.show()),i.on(`root:leave`,E,`mouseleave`,()=>g.hide())):(i.on(`target:click`,n,`click`,()=>g.toggle()),i.on(`document:click`,document,`click`,M))),g}const Jn={container:`j-tooltip`,message:`el-text`,ui:{reverse:`is-reverse`,primary:`is-primary`,success:`is-success`,warning:`is-warning`,error:`is-error`}};function Yn(e){let t=e&&typeof e==`object`?e:{},n=`ui`in t&&t.ui&&typeof t.ui==`object`?t.ui:{};return{...Jn,...t,ui:{...Jn.ui,...n}}}const Xn={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:0,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:Jn,type:`object`,normalize:Yn},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 Zn(e){let t=G(e,Xn,`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 Qn(e,t={}){let n=Zn(t),r=f(`div`,{className:q(n.className.container,n.theme&&n.className.ui[n.theme]),"data-tooltip":n.name||n.id||``,children:f(`div`,{className:n.className.message,"data-tooltip-message":``,children:n.message})}),i=qn(e,{name:n.name,mode:n.mode,position:n.position,offset:n.offset,cache:n.cache,ttl:n.ttl,id:n.id,delay:n.delay,hoverIntent:n.hoverIntent,onShown:n.onShown,onHidden:n.onHidden,content:r});return{get element(){return i?.element||null},get drop(){return i},show(e=!0){i?.show(e)},hide(e=!0){i?.hide(e)},toggle(){i?.toggle()},destroy(){i?.destroy(),i=null}}}const $n={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`},er={mode:`dark`,theme:`indigo`,radius:`sm`,shadow:`sm`,font:`sm`,key:`ui-theme`,className:$n},tr={theme:`j-theme-`,radius:`j-radius-`,shadow:`j-shadow-`,font:`j-font-`};function nr(e){return{...$n,...e}}function rr(e={}){return{...er,...e,className:nr(e.className)}}function ir(e){return e===`mode`||e===`theme`||e===`radius`||e===`shadow`||e===`font`}function ar(){return _({driver:`cookie`,codec:`json`,namespace:``,keySeparator:``,driverOptions:{path:`/`,sameSite:`Lax`,secure:typeof location<`u`&&location.protocol===`https:`},ttl:6048e5})}function or(e){if(!N(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 sr(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 cr(e={}){let t=i(rr(e)),a={configVersion:0,destroyed:!1},o=ar(),c=new Set,l=je(),d=()=>window.matchMedia?.(`(prefers-color-scheme: dark)`).matches?`dark`:`light`,p=()=>{let{mode:e,theme:n,radius:r,shadow:i,font:a}=t,s={mode:e,theme:n,radius:r,shadow:i,font:a,render:e===`auto`?d():e};o.set(t.key,s).catch(()=>{})},m=e=>{let i=s(i=>{for(let i of Y(`[data-theme-group]`,e)){let e=i.dataset.themeGroup;if(ir(e))for(let a of Y(`[data-theme-button]`,i)){let i=()=>a.dataset.themeValue===String(t[e]);r(a,t.className.active,i),n(a,`aria-selected`,()=>i()?`true`:null)}}return i});c.add(i)},h=(e=null,n=null)=>{let r=t.className,i=n||sr(y),a=f(`div`,{className:e||r.panel,"data-theme-palette":`root`,children:[f(`h3`,{className:r.title,"data-theme-title":``,style:{margin:`0 0 1rem`},children:y(`t`)}),f(`div`,{className:r.container,"data-theme-container":``,children:i.map(e=>f(`div`,{className:r.item,"data-theme-group":e.type,children:[f(`div`,{className:r.itemTitle,"data-theme-group-title":e.type,children:e.title}),f(`div`,{className:r.items,"data-theme-items":e.type,children:e.buttons.map(([n,i])=>{let a=String(t[e.type])===String(n);return f(`button`,{className:q(r.button,a&&r.active),"data-action":`customTheme`,"data-theme-button":e.type,"data-theme-value":n,"aria-selected":a?`true`:null,children:[e.type===`theme`?f(`span`,{className:q(r.prefix,r.swatch),"data-theme-swatch":n,style:{backgroundColor:`var(--ui-${n})`}}):null,f(`span`,{className:r.buttonText,"data-theme-button-text":n,children:i})]})})})]}))})]});return m(a),a},g=e=>{a.configVersion+=1,u(()=>{Object.assign(t,e,{className:nr({...t.className,...e.className})})}),p()},_=()=>{if(!a.destroyed){a.destroyed=!0,l.clear();for(let e of c)e();c.clear(),o.close().catch(()=>{})}};l.on(`palette`,document.body,`click`,e=>{if(!(e.target instanceof Element))return;let n=e.target.closest(`[data-theme-button]`),r=(n?.closest(`[data-theme-group]`))?.dataset.themeGroup,i=n?.dataset.themeValue;if(!n||!ir(r)||!i||n.classList.contains(t.className.active))return;let o=t[r];a.configVersion+=1,u(()=>{t[r]=i});let s=document.documentElement;if(r===`mode`)s.classList.remove(`light`,`dark`,o),s.classList.add(i===`auto`?d():i);else{let e=tr[r],t=Array.from(s.classList).filter(t=>t.startsWith(e));t.length&&s.classList.remove(...t),s.classList.add(`${e}${i}`)}p()});let v=a.configVersion;return o.get(t.key).then(e=>{if(a.destroyed||a.configVersion!==v)return;let n=or(e);n&&u(()=>{Object.assign(t,n)})}).catch(()=>{}),{props:t,createPanel:h,setConfig:g,destroy:_}}const lr={color:`var(--tone-solid)`,size:`12px`},ur={ball:`parabola-ball`},dr={types:[`string`,`Node`,`array`,`null`,`undefined`]},fr={ball:{default:lr,type:`plainObject`,normalize:e=>({...lr,...e&&typeof e==`object`?e:{}}),shape:{color:`string`,size:`string`}},className:{default:ur,type:`object`,normalize:e=>({...ur,...e&&typeof e==`object`?e:{}})},from:{default:null,...dr},to:{default:null,...dr},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 pr(e){let t=G(e,fr,`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 mr(e={}){let t=pr(e),n={destroyed:!1},r=new Set,i=new Map,a=new Map,o=null,s=xe(t.from),c=xe(t.to),l,u=()=>{if(!n.destroyed){if(o){o.isConnected||d(document.body,o);return}o=f(`div`,{"data-parabola":`root`,style:{position:`fixed`,inset:`0`,pointerEvents:`none`,zIndex:`9999`}}),d(document.body,o)}},p=()=>{r.size>0||(o?.remove(),o=null)},m=(e,n)=>{if(!r.has(e))return;let i=a.get(e);i!==void 0&&cancelAnimationFrame(i),a.delete(e),e.remove(),r.delete(e),n&&t.onHidden?.(l),p()},h=e=>{if(n.destroyed||(u(),!o))return null;let{color:i,size:a}=t.ball,s=f(`div`,{className:t.className.ball,"data-parabola":`ball`,style:{backgroundColor:i,width:a,height:a,position:`fixed`,borderRadius:`50%`,transform:`translate(-50%, -50%)`,pointerEvents:`none`,zIndex:`9999`,opacity:`1`,left:`${e.startX}px`,top:`${e.startY}px`}});return d(o,s),r.add(s),s},g=()=>{let e=s?.getBoundingClientRect(),n=c?.getBoundingClientRect();if(!e||!n)return null;let{left:r,top:i,width:a,height:o}=e,{left:l,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=l+d/2,g=u+f/2;return{startX:p,startY:m,endX:h,endY:g}},_=(e,t,r,i,o,s=800)=>{if(!e.isConnected)return;let c=performance.now(),l=i-t,u=o-r,d=i=>{if(n.destroyed||!e.isConnected){a.delete(e);return}let o=i-c,f=Math.min(o/s,1),p=1-(1-f)**3,h=t+l*p,g=r+-100*Math.sin(Math.PI*p)+u*p,_=1-f;e.style.left=`${h}px`,e.style.top=`${g}px`,e.style.opacity=`${_}`,e.style.transform=`translate(-50%, -50%) scale(${1-p*.3})`,f<1?a.set(e,requestAnimationFrame(d)):(a.delete(e),m(e,!0))};a.set(e,requestAnimationFrame(d))},v=(e,n)=>{let r=`parabola-show-${X()}`;i.set(r,n),Pe.start(r,t.showDelay,()=>{i.delete(r),e()})},y=()=>{for(let[e,t]of i)Pe.cancel(e),t();i.clear()};return l={props:t,runtime:n,get element(){return o},show(){return n.destroyed?Promise.resolve(!1):new Promise(e=>{v(()=>{if(n.destroyed){e(!1);return}s=xe(t.from),c=xe(t.to);let r=g();if(!r){e(!1);return}let i=h(r);if(!i){e(!1);return}t.onShow?.(l),_(i,r.startX,r.startY,r.endX,r.endY),e(!0)},()=>e(!1))})},destroy(){if(!n.destroyed){y(),s=null,c=null,n.destroyed=!0;for(let e of r)m(e,!1);a.clear(),p()}}},l}const hr={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 gr(e){let t=G(e,hr,`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 _r(e){let t=e.filter(e=>e instanceof HTMLElement);return Array.from(new Set(t))}function vr(e){return e===!1||e==null?null:Ce(e,`Sticky.parent`,`element`)}function yr(e,t){if(e===!1||e==null)return[];if(typeof e==`string`){if(!t)return _r(Ce(e,`Sticky.target`,`array`));let n=_r(Y(e,t));if(n.length===0)throw Error(`Sticky.target: target not found.`);return n}let n=_r(Ce(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 br(e={}){let t=gr(e),n=i({items:[]}),r={built:!1,destroyed:!1,reBuilding:!1,reBuildFrameId:0},a={originalStyles:new Map,keys:new WeakMap},o=null,s=[],c=null,l,d=e=>e.length<=t.max?e:t.overflow===`ignore`?[]:e.slice(-t.max),f=()=>{for(let e of a.originalStyles.values())p(e)},p=e=>{e.element.style.position=e.originalPosition,e.element.style.top=e.originalTop,e.element.style.zIndex=e.originalZIndex},m=(e,t)=>{if(e.id)return e.id;let n=a.keys.get(e);if(n)return n;let r=`sticky-${X()}-${t}`;return a.keys.set(e,r),r},h=e=>{a.originalStyles.has(e)||a.originalStyles.set(e,{element:e,originalPosition:e.style.position,originalTop:e.style.top,originalZIndex:e.style.zIndex})},g=()=>d(yr(t.target,o)),_=(e=t.top)=>{let r=e,i=[],o=new Set(s);for(let[e,t]of a.originalStyles)o.has(e)||(p(t),a.originalStyles.delete(e));return s.forEach((e,n)=>{h(e),e.style.position=`sticky`,e.style.top=`${r}px`,i.push({key:m(e,n),index:n,top:r}),r+=e.offsetHeight+t.gap}),u(()=>{n.items=i}),t.onReBuild?.(l),r},v=()=>{if(c?.disconnect(),c=null,!t.reactive)return;let e=o||document.body;c=new MutationObserver(()=>{r.reBuilding||r.destroyed||!r.built||(r.reBuilding=!0,r.reBuildFrameId=requestAnimationFrame(()=>{r.reBuilding=!1,r.reBuildFrameId=0,l.reBuild()}))}),c.observe(e,{childList:!0,subtree:!0})};return l={props:t,state:n,runtime:r,build:()=>{if(r.destroyed)throw Error(`Sticky.build: instance destroyed`);return r.built?l:(o=vr(t.parent),s=g(),r.built=!0,v(),s.length===0?(u(()=>{n.items=[]}),l):(_(),l))},reBuild:()=>(!r.destroyed&&r.built&&(s=g(),_()),l),destroy:()=>{r.destroyed||(r.reBuildFrameId&&cancelAnimationFrame(r.reBuildFrameId),c?.disconnect(),c=null,f(),r.destroyed=!0,r.built=!1,r.reBuilding=!1,r.reBuildFrameId=0,a.originalStyles.clear(),s=[],o=null)}},l}const xr=new Map;function Sr(e,t){!e||!t||xr.set(e,t)}function Cr(e){xr.delete(e)}function wr(e){typeof e==`function`?e():e&&typeof e.destroy==`function`&&e.destroy()}function Q(e){let t={built:!1,mounted:!1,destroyed:!1},n=new Map,r=new Set,i=new Map,a=null,o=null,s,c=n=>{if(t.destroyed)throw Error(`${e.name}.${n}: instance destroyed`)},l=(e,...t)=>{for(let r of n.get(e)||[])try{r(...t)}catch{}},d={props:e.props,state:e.state,runtime:t,get element(){return a},own(e){e&&r.add(e)},assertActive:c,emit:l},f={props:e.props,state:e.state,runtime:t,get element(){return a},build(){if(c(`build`),t.built)return s;let n=wn(()=>e.view(d),{removeOnDispose:e.ownsElement});return a=n.element,o=n.dispose,t.built=!0,e.onBuild?.(d),l(`build`,s),s},mount(n){if(c(`mount`),t.built||s.build(),!a)throw Error(`${e.name}.mount: view did not create an element.`);return a.parentNode!==n&&n.appendChild(a),t.mounted=!0,e.onMount?.(d),l(`mount`,s,n),s},unmount(){return c(`unmount`),!t.mounted&&!a?.parentNode?s:(e.onUnmount?.(d),e.ownsElement!==!1&&a?.remove(),t.mounted=!1,l(`unmount`,s),s)},setState(t={},n){c(`setState`);let r=typeof t==`string`&&arguments.length>1?{[t]:n}:t;if(!N(r))throw Error(`${e.name}.setState: expects a plain object patch.`);let i=e.normalizeStatePatch?e.normalizeStatePatch(r):r;if(!N(i))throw Error(`${e.name}.setState: expects a plain object patch.`);if(e.validateStatePatch)e.validateStatePatch(i,e.state);else for(let t of Object.keys(i))if(!Object.hasOwn(e.state,t))throw Error(`${e.name}.setState: "${t}" is not a supported state key.`);return u(()=>{Object.assign(e.state,i)}),s},own(e){return e&&r.add(e),s},use(e,t){if(!e)return s;let n=typeof e==`function`?e(s,t):e.install(s,t);return i.set(e,n),s},on(e,t){if(!e||typeof t!=`function`)return s;let r=n.get(e);return r||(r=new Set,n.set(e,r)),r.add(t),s},off(e,t){return n.get(e)?.delete(t),s},emit(e,...t){return l(e,...t),s},destroy(){if(!t.destroyed){t.destroyed=!0,e.onDestroy?.(d),l(`destroy`,s);for(let e of r)try{wr(e)}catch{}r.clear();for(let e of i.values())try{wr(e)}catch{}i.clear(),o?.(),o=null,e.ownsElement!==!1&&a?.remove(),a=null,t.built=!1,t.mounted=!1,n.clear()}}};s=Object.assign(f,e.actions||{});for(let e of xr.values())s.use(e);return s}const Tr={toc:`j-toc`,list:`toc-list`,link:`toc-link`,active:`is-active`,levelPrefix:`is-level-`},Er={target:{default:`.j-content`},headings:{default:`h2, h3`,type:`string`},offset:{default:80,type:`number`,min:0},reactive:{default:!1,type:`boolean`},className:{default:Tr,type:`object`,normalize:e=>({...Tr,...e&&typeof e==`object`?e:{}})},onChange:{default:null,types:[`function`,`null`]}};function Dr(e){let t=G(e,Er,`Toc.props`);return{target:t.target,headings:t.headings,offset:t.offset,reactive:t.reactive,className:t.className,onChange:t.onChange}}function Or(e){let t=/^H([1-6])$/.exec(e.tagName);return t?Number(t[1]):1}function kr(e,t){return e.id||=`toc-${X()}-${t}`,{id:e.id,text:e.textContent||``,level:Or(e)}}function Ar(t={}){let n=Dr(t),r=i({items:[],current:{index:-1,item:null}}),a={ticking:!1,frameId:0,refreshing:!1,refreshFrameId:0},s=je(),c=null,l=[],d=null,p,m=o(()=>r.items),h=e=>{if(e===r.current.index)return;let t=r.items[e]||null;u(()=>{r.current={index:e,item:t}}),n.onChange?.(t,e,p)},g=()=>{if(!p.runtime.built)return;let e=-1,t=n.offset+1;for(let n=l.length-1;n>=0;n--)if(l[n].getBoundingClientRect().top<=t){e=n;break}h(e)},_=()=>{a.ticking||(a.ticking=!0,a.frameId=requestAnimationFrame(()=>{a.ticking=!1,a.frameId=0,g()}))},v=()=>{a.refreshing||(a.refreshing=!0,a.refreshFrameId=requestAnimationFrame(()=>{a.refreshing=!1,a.refreshFrameId=0,b()}))},y=(e,{activeIndex:t=-1,updateHash:r=!1}={})=>{let i=l.find(t=>t.id===e.id);if(!i)return;let a=window.scrollY||window.pageYOffset||0,o=Math.max(0,i.getBoundingClientRect().top+a-n.offset);window.scrollTo({top:o,behavior:`smooth`}),t>=0&&h(t),r&&window.history?.pushState&&window.history.pushState(null,``,`#${e.id}`)},b=()=>{if(p.runtime.destroyed||!p.runtime.built||!c)return;l=Y(n.headings,c);let e=l.map(kr);u(()=>{r.items=e,r.current={index:-1,item:null}}),g()};return p=Q({name:`Toc`,props:n,state:r,actions:{activate:e=>(p.runtime.built&&Number.isInteger(e)&&e>=0&&e<r.items.length&&y(r.items[e]),p)},view:()=>f(`nav`,{className:n.className.toc,"data-toc":`root`,children:f(`div`,{className:n.className.list,"data-toc-list":`root`,children:e({each:m,key:e=>e.id,children:(e,t)=>f(`a`,{className:()=>{let i=e();return q(n.className.link,`${n.className.levelPrefix}${i.level}`,r.current.index===t()?n.className.active:``)},href:()=>`#${e().id}`,"data-toc-index":()=>String(t()),"data-toc-target":()=>e().id,"data-active":()=>r.current.index===t()?`1`:`0`,onClick:n=>{n.preventDefault(),y(e(),{activeIndex:t(),updateHash:!0})},children:()=>e().text})})})}),onBuild(e){c=Ce(n.target,`Toc.target`),s.on(`scroll`,window,`scroll`,_,{passive:!0}),e.own(()=>s.clear()),b(),n.reactive&&(d=new MutationObserver(v),d.observe(c,{childList:!0,subtree:!0,characterData:!0}),e.own(()=>{d?.disconnect(),d=null}))},onDestroy(){a.frameId&&cancelAnimationFrame(a.frameId),a.refreshFrameId&&cancelAnimationFrame(a.refreshFrameId),a.frameId=0,a.refreshFrameId=0,a.ticking=!1,a.refreshing=!1,d?.disconnect(),d=null,c=null,l=[]}}),p}const jr={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`},Mr={type:`plainObject`,shape:{name:[`string`,`null`,`undefined`],title:`renderable`,content:`renderable`,cache:[`boolean`,`undefined`],ttl:[`number`,`undefined`]}},Nr={type:`array`,nonEmpty:!0,items:Mr},Pr={id:{default:null,types:[`string`,`null`],normalize:e=>typeof e==`string`?e.trim()||X():e??X()},active:{default:0,types:[`number`,`string`,`array`,`null`],validate:e=>e==null?!0:Array.isArray(e)?e.every(Fr):Fr(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:jr,type:`object`,normalize:e=>({...jr,...e&&typeof e==`object`?e:{}})},onChange:{default:null,types:[`function`,`null`]},data:{default:[],...Nr}};function Fr(e){return typeof e==`number`?Number.isInteger(e)&&e>=0:typeof e==`string`&&e.trim().length>0}function Ir(e){let t=G(e,Pr,`Accordion.props`);return{id:t.id,active:t.active,collapsible:t.collapsible,multiple:t.multiple,direction:t.direction,className:t.className,data:Rr(t.data,!1),onChange:t.onChange}}function Lr(e,t,n=!0){n&&W(String(t),e,Mr,`Accordion.data`);let r=e,i=typeof r.name==`string`?r.name.trim():``;return{...r,name:i||X()}}function Rr(e,t=!0){t&&W(`data`,e,Nr,`Accordion`);let n=new Set;return e.map((e,t)=>{let r=Lr(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 zr(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 Br(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 Vr(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 Hr(e){return typeof e==`number`&&e>0?e:0}function Ur(t){let n=Ir(t),r=zr(n.active,n.data,n.multiple),o=i({data:n.data,activeNames:r,loading:!1}),s=new WeakMap,l=Rt(),d=Rt(),m=new Map,h=new Map,g=new Map,_=new Set(r),v=Promise.resolve(),y=0,b=0,x=!1,S,C=e=>(typeof e.name==`string`?e.name.trim():``)||(s.has(e)||s.set(e,X()),s.get(e)),w=()=>{let e=o.data.map(e=>({...e,name:C(e)}));return Vr(Br(o.activeNames,e,n.multiple),e)},T=e=>o.activeNames.includes(e),D=()=>{b+=1,!x&&!S.runtime.destroyed&&(x=!0,u(()=>{o.loading=!0}))},O=()=>{b=Math.max(0,b-1),b===0&&x&&!S.runtime.destroyed&&(x=!1,u(()=>{o.loading=!1}))},k=e=>typeof e==`number`?e:typeof e==`string`?o.data.findIndex(t=>C(t)===e):-1,A=e=>{let t=new Set(e),n=new Set([..._,...t]),r=[];for(let e of n){let n=_.has(e),i=t.has(e);if(n===i)continue;let a=d.get(e);a&&(a.inert=!i);let o=m.get(e);o&&r.push(i?o.enter():o.leave())}return _=t,r.length>0&&(v=Promise.all(r).then(()=>void 0)),v},M=e=>t=>{d.bind(e)(t),m.get(e)?.cancel();let r=kn(()=>d.get(e),{axis:n.direction,options:{duration:250,easing:`ease`}});m.set(e,r);let i=T(e);t.inert=!i,r.setExpanded(i),p(()=>{m.get(e)===r&&(r.cancel(),m.delete(e),_.delete(e),o.activeNames.includes(e)&&u(()=>{o.activeNames=o.activeNames.filter(t=>t!==e)}))})},N=async e=>{if(S.runtime.destroyed)throw Error(`Accordion.activate: instance destroyed`);if(!S.runtime.built)throw Error(`Accordion.activate: call build() first.`);let t=k(e),r=o.data[t];if(!r)return;let i=C(r),a=T(i);if(a&&!n.multiple&&!n.collapsible)return;let s;if(n.multiple){if(a){let e=o.activeNames.filter(e=>e!==i);s=!n.collapsible&&e.length===0?[...o.activeNames]:e}else s=[...o.activeNames,i]}else s=a?n.collapsible?[]:[...o.activeNames]:[i];u(()=>{o.activeNames=s});let c=A(s),f=s.includes(i)&&g.get(i)?.()||Promise.resolve(),p=l.get(i),m=d.get(i),h=n.onChange&&p&&m?f.then(()=>n.onChange?.(t,i,p,m,S)):Promise.resolve();await Promise.all([c,h])},P=(e,t,n)=>{let r=C(e);return{accordion:S,item:e,index:t,type:n,active:T(r)}},F=(e,t,n)=>typeof e==`function`?e(P(t,n,`title`)):e,I=(e,t,n)=>{let r=e().content,[i,o]=c(typeof r==`function`?null:r),[s,l]=c(!1),u=r,d=0,f=null,m=()=>P(e(),t(),`content`),_=async()=>{let t=e(),r=t.content;if(typeof r!=`function`){o(r);return}let i=t.cache?h.get(n):null,a=Hr(t.ttl);if(i&&(!a||Date.now()-i.updatedAt<=a)){o(i.content);return}if(f)return f;let s=++d;y+=1;let c=y;l(!0),D();let u=Promise.resolve().then(()=>r(m())).then(t=>{s!==d||S.runtime.destroyed||(e().cache&&h.set(n,{content:t,updatedAt:Date.now()}),o(t))}).finally(()=>{s===d&&!S.runtime.destroyed&&l(!1),c<=y&&O(),f===u&&(f=null)});return f=u,u};return g.set(n,_),p(()=>{d+=1,h.delete(n),g.delete(n),f=null}),a(()=>{let t=e().content;t!==u&&(u=t,d+=1,f=null,h.delete(n),o(typeof t==`function`?null:t)),T(n)&&_()}),{loading:s,isAsync:()=>typeof e().content==`function`,render:()=>{if(s())return j(`flex-start`,`flex-start`);let e=i();return typeof e==`function`?e(m()):e}}},L=(e,t)=>{let r=C(e()),i=I(e,t,r),a=`${n.id}_header_${r}`,o=`${n.id}_panel_${r}`;return[f(`div`,{className:n.className.header,id:a,"data-accordion-header":r,role:`button`,tabindex:`0`,"aria-controls":o,"aria-expanded":()=>T(r)?`true`:`false`,ref:l.bind(r),onClick:()=>void N(r),onKeyDown:e=>{e instanceof KeyboardEvent&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),N(r))},children:[f(`span`,{className:n.className.title,"data-accordion-title":r,role:`heading`,children:()=>{let n=e();return K(F(n.title,n,t()))}}),f(`span`,{className:n.className.arrow,"data-accordion-arrow":r,children:E(`arrow-down`)})]}),f(`div`,{className:n.className.panel,"data-accordion-panel":r,id:o,role:`region`,"aria-labelledby":a,"aria-hidden":()=>T(r)?`false`:`true`,"aria-live":()=>i.isAsync()?`polite`:null,"aria-busy":()=>String(i.loading()),"data-state":()=>T(r)?`open`:`closed`,ref:M(r),children:f(`div`,{className:n.className.content,"data-accordion-content":r,children:()=>K(i.render())})})]};return S=Q({name:`Accordion`,props:n,state:o,actions:{isActive:T,getIndex:k,activate:N},normalizeStatePatch(e){return{...e,...Object.hasOwn(e,`data`)?{data:Rr(e.data)}:{}}},view:()=>{let t=f(`div`,{className:n.className.root,id:n.id,"data-accordion":`root`,"data-direction":n.direction,children:e({each:()=>o.data,key:e=>C(e),children:(e,t)=>L(e,t)})});return _=new Set(o.activeNames),a(()=>{A([...o.activeNames])}),t},onDestroy(){y+=1,b=0,x=!1,h.clear(),g.clear();for(let e of m.values())e.cancel();m.clear(),l.clear(),d.clear()}}),Object.defineProperty(S,"current",{enumerable:!0,get:w}),S}const Wr={form:`j-form`,vertical:`is-vertical`,horizontal:`is-horizontal`,itemVertical:`is-item-vertical`,itemHorizontal:`is-item-horizontal`,item:`form-field`,label:`field-legend`,required:`is-required`,control:`field-control`,helpInvalid:`is-invalid`,buttons:`form-buttons`,button:`j-button`,submitBtn:`is-primary`,resetBtn:`is-ghost`,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 is-default`,switchSlider:`switch-slider`},Gr={submit:y(`Submit`),reset:y(`Reset`)},Kr={id:{default:null,types:[`string`,`null`],normalize:e=>typeof e==`string`?e.trim()?e.trim():X():e??X()},vertical:{default:!0,type:`boolean`},itemVertical:{default:!0,type:`boolean`},size:{default:`md`,type:`string`},style:{default:``,types:[`string`,`object`,`null`]},fields:{default:[],type:`array`},buttons:{default:!0,types:[`boolean`,`string`]},buttonsPosition:{default:`start`,type:`string`},text:{default:Gr,type:`object`,normalize:e=>ri(e)},className:{default:Wr,type:`object`,normalize:e=>ni(e)},validator:{default:{},type:`object`},onSubmit:{default:null,types:[`function`,`null`]},onReset:{default:null,types:[`function`,`null`]}};function qr(e){return Array.isArray(e)?e.map(e=>e&&typeof e==`object`?{...e}:e):[]}function Jr(e){return{...e,options:qr(e.options)}}function Yr(e){return{...e.id?{id:e.id}:{},type:e.type,payload:Jr(e.payload),next:e.next||null}}function Xr(e){return Array.isArray(e)?e.map(e=>Yr(e)):[]}function Zr(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 Qr(e){return e&&typeof e==`object`?e:{value:e,text:String(e)}}function $r(e){return e==null?``:typeof e==`string`?e:typeof e==`number`||typeof e==`boolean`?String(e):e instanceof File?e.name:``}function ei(e){return e==null||Array.isArray(e)?``:typeof e==`string`||typeof e==`number`||typeof e==`boolean`?String(e):e instanceof File?e.name:``}function ti(e,t){return e.name?!!e.required||!!t?.[e.name]?.required:!!e.required}function ni(e){return{...Wr,...N(e)?e:{}}}function ri(e){return{...Gr,...N(e)?e:{}}}function ii(e,t){return typeof e==`function`?e(t):e}function ai(e,t){if(e.removeAttribute(`style`),!t)return;if(typeof t==`string`){e.style.cssText=t;return}if(!N(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 oi(e){return e===`center`?e:`flex-${e}`}function si(e){let t=N(e)?e:{};return{...t,vanilla:t.vanilla===!0,rules:N(t.rules)?t.rules:{},messages:N(t.messages)?t.messages:{}}}function ci(e){let t=G(e,Kr,`Form.props`),n=Xr(t.fields);return{...t,id:String(t.id),vertical:!!t.vertical,itemVertical:!!t.itemVertical,size:t.size,style:t.style,fields:n,buttons:t.buttons,buttonsPosition:t.buttonsPosition,text:ri(t.text),className:ni(t.className),validator:si(t.validator),onSubmit:t.onSubmit,onReset:t.onReset}}function li(e){return e===`password`?`current-password`:e===`email`?`email`:`on`}function ui(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null}function di(e,t,r){n(e,t,()=>ui(r()))}function fi(e,t){return Array.isArray(e)?e.map(e=>$r(e)).includes($r(t)):e==t}function pi(e,t,n){return n===void 0?Array.isArray(e)?e.map(e=>$r(e)).includes($r(t)):typeof e!=`string`&&typeof e!=`boolean`&&!(e instanceof File)?!1:e===!0||$r(e)===$r(t):n}function mi(e){return e instanceof RadioNodeList?Array.from(e):[e]}function hi(t={}){let n=ci(t),r=i({fields:Xr(n.fields),submitting:!1}),a={fieldIds:new Map},s=new WeakMap,[l,d]=c(0),p=new WeakMap,m=null,h,g=e=>{if(r.fields.includes(e))return e;let t=p.get(e);if(t)return t;let n=i(Yr(e));return p.set(e,n),n},_=o(()=>(l(),Zr(r.fields,g))),v=e=>e.id?`id:${e.id}`:e.name?`name:${e.name}`:(s.has(e)||s.set(e,X()),s.get(e)),y=(e,t)=>{if(e.id)return`item:${e.id}`;let n=e.payload;return n&&typeof n==`object`?`${v(n)}:${e.type}`:`item:${e.type}:${t}`},b=(e,t)=>{if(e.id)return e.id;let r=e.name||t;return a.fieldIds.has(r)||a.fieldIds.set(r,`${n.id}_field_${t}`),a.fieldIds.get(r)},x=()=>{let e=h.element;if(!e)return;let t={...n.validator,onSubmit:null};if(m?.element===e){m.props=t;return}m?.destroy(),m=_n(e,t,!1)},S=()=>m?.validate()??!0,C=()=>{let e=h.element;if(e){for(let t of Array.from(e.elements))t.classList.remove(`is-valid`,`is-invalid`),t.removeAttribute(`data-valid`);for(let t of Y(`[data-field-help], [data-validator-help]`,e))(t.dataset.validatorHelp||t.classList.contains(`is-invalid`))&&t.remove()}},w=()=>{let e={};if(!h.element)return e;for(let[t,n]of new FormData(h.element).entries())e[t]=Object.hasOwn(e,t)?Array.isArray(e[t])?[...e[t],n]:[e[t],n]:n;return e},T=async e=>{if(e.preventDefault(),r.submitting||!S())return;let t=w();u(()=>{r.submitting=!0});try{await Promise.resolve(n.onSubmit?.(t,h))}finally{h.runtime.destroyed||u(()=>{r.submitting=!1})}},E=e=>{if(!e.name||!h.element)return[];let t=h.element.elements.namedItem(e.name);return t?mi(t).filter(e=>e instanceof Element):[]},D=(e,t,n=`text`)=>{u(()=>{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(n===`switch`){e.checked=t.checked,e.value=t.checked?t.value:``;return}if(n===`radio`){t.checked&&(e.value=t.value);return}if(n===`checkbox`){if(Array.isArray(e.options)){e.value=E(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)}),d(e=>e+1)},O=(e,t,n)=>({...n,name:()=>e().name,id:t,required:()=>!!e().required,disabled:()=>r.submitting||!!e().disabled,"data-field-item":()=>e().name||t}),k=()=>n.size?`is-${n.size}`:``,A=e=>{let t=e.size||n.size;return t?`is-${t}`:``},M=(e,t)=>q(e.className||t,A(e)),N=(e,t,i)=>f(`div`,{className:()=>{let t=e(),r=t.vertical?`vertical`:`horizontal`,a=n.className;return q(i===`radio`?a.radio:a.checkbox,r===`vertical`?a.choiceVertical:a.choiceHorizontal,t.group?a.choiceGroup:``,t.size?`is-${t.size}`:``)},"data-field-choice-group":()=>e().name||t,"data-choice-type":i,"data-choice-layout":()=>e().vertical?`vertical`:`horizontal`,children:()=>(e().options||[]).map((a,o)=>{let s=Qr(a),c=`${t}_${o}`;return f(`label`,{className:()=>i===`radio`?n.className.radioLabel:``,"data-field-choice":()=>e().name||t,for:c,children:[f(`input`,{type:i,id:c,name:()=>e().name,value:s.value??``,checked:()=>i===`radio`?fi(e().value,s.value):pi(e().value,s.value,s.checked),disabled:()=>r.submitting||!!s.disabled||!!e().disabled,required:()=>!!e().required,onChange:t=>{let n=t.currentTarget;n instanceof HTMLInputElement&&D(e(),n,i)}}),f(`span`,{className:()=>i===`radio`?n.className.radioText:``,"data-field-choice-text":``,children:K(s.text??s.label??$r(s.value))})]})})}),P=(e,t,i,a)=>{let o=e().type;if(o===`textarea`)return f(`textarea`,O(t,i,{className:()=>t().className||n.className.textarea,placeholder:()=>t().placeholder||``,readonly:()=>!!t().readonly,ref:e=>di(e,`autocomplete`,()=>t().autocomplete),value:()=>ei(t().value),onInput:e=>{let n=e.currentTarget;n instanceof HTMLTextAreaElement&&D(t(),n,`textarea`)}}));if(o===`select`)return f(`select`,O(t,i,{className:()=>M(t(),n.className.select),ref:e=>di(e,`autocomplete`,()=>t().autocomplete),multiple:()=>!!t().multiple,value:()=>t().multiple?void 0:ei(t().value),onChange:e=>{let n=e.currentTarget;n instanceof HTMLSelectElement&&D(t(),n,`select`)},children:()=>(t().options||[]).map(e=>{let n=Qr(e);return f(`option`,{value:n.value??``,disabled:!!n.disabled,selected:()=>fi(t().value,n.value),children:K(n.text??n.label??$r(n.value))})})}));if(o===`radio`)return N(t,i,`radio`);if(o===`checkbox`&&Array.isArray(t().options))return N(t,i,`checkbox`);if(o===`switch`)return f(`label`,{className:()=>{let e=n.className;return q(e.switch,A(t()))},"data-field-switch":()=>t().name||i,for:i,children:[f(`input`,{type:`checkbox`,id:i,name:()=>t().name,value:()=>t().value??`1`,checked:()=>!!t().checked,disabled:()=>r.submitting||!!t().disabled,required:()=>!!t().required,onChange:e=>{let n=e.currentTarget;n instanceof HTMLInputElement&&D(t(),n,`switch`)}}),f(`span`,{className:()=>n.className.switchSlider,"data-field-switch-slider":``})]});if(o===`custom`){let n=t();return typeof n.content==`function`?n.content({form:h,field:n,index:a(),item:e()}):n.content}let s=o||`text`;return f(`input`,{...O(t,i,{type:s,className:()=>M(t(),n.className.input),placeholder:()=>t().placeholder||``,readonly:()=>!!t().readonly,autocomplete:()=>t().autocomplete||li(s),value:()=>t().value??``,onInput:e=>{let n=e.currentTarget;n instanceof HTMLInputElement&&D(t(),n,s)}}),checked:()=>{let e=t().checked;return e===void 0?void 0:!!e}})},F=(e,t)=>{let r=()=>e().payload,i=b(r(),t()),a=()=>{let t=e().type;return t===`custom`||t===`radio`||t===`checkbox`&&Array.isArray(r().options)},o=()=>{let e=r().label;return e!==!1&&e!==void 0};return f(`fieldset`,{className:()=>n.className.item,"data-form-field":()=>r().name||String(t()),style:()=>({display:e().type===`hidden`?`none`:``}),children:[()=>{if(!o())return null;let e={className:()=>q(n.className.label,ti(r(),n.validator.rules)?n.className.required:``),"data-field-label":()=>r().name||i,children:()=>K(r().label)};return a()?f(`legend`,e):f(`label`,{...e,for:i})},()=>f(`div`,{className:()=>n.className.control,"data-field-control":()=>r().name||String(t()),children:[K(P(e,r,i,t)),()=>r().help?f(`div`,{className:`help-block`,"data-field-help":()=>r().name||String(t()),children:()=>K(r().help)}):null]})]})},I=(e,t)=>F(e,t),L=()=>f(`button`,{type:`submit`,className:()=>q(n.className.button,n.className.submitBtn,k()),"data-action":`submit`,disabled:()=>r.submitting,children:()=>{let e=K(ii(n.text.submit,h));return r.submitting?[j(),e]:e}}),R=()=>f(`button`,{type:`reset`,className:()=>q(n.className.button,n.className.resetBtn,k()),"data-action":`reset`,disabled:()=>r.submitting,children:()=>K(ii(n.text.reset,h))}),z=()=>f(`div`,{className:n.className.buttons,style:{justifyContent:oi(n.buttonsPosition)},"data-field-buttons":``,children:n.buttons===`reverse`?[R(),L()]:[L(),R()]});return h=Q({name:`Form`,props:n,state:r,actions:{validate:S,reset(){return m?.reset(),h},collectData:w,requestSubmit(){let e=h.element;return e&&(typeof e.requestSubmit==`function`?e.requestSubmit():e.dispatchEvent(new Event(`submit`,{bubbles:!0,cancelable:!0}))),h},setFields(e){return W(`fields`,e,`array`,`Form.setFields`),a.fieldIds.clear(),p=new WeakMap,u(()=>{r.fields=Xr(e)}),h},resetFields(){return a.fieldIds.clear(),p=new WeakMap,u(()=>{r.fields=Xr(n.fields)}),h}},normalizeStatePatch(e){return{...e,...Object.hasOwn(e,`fields`)?{fields:Xr(e.fields)}:{}}},view:()=>{let t=f(`form`,{className:q(n.className.form,n.vertical?n.className.vertical:n.className.horizontal,n.itemVertical?n.className.itemVertical:n.className.itemHorizontal,k()),id:n.id,novalidate:n.validator.vanilla===!1,"data-form":`root`,"data-form-layout":n.vertical?`vertical`:`horizontal`,"data-form-field-layout":n.itemVertical?`vertical`:`horizontal`,onSubmit:e=>void T(e),onReset:e=>{C(),n.onReset?.(e,h)},children:[e({each:_,key:y,children:I}),n.buttons===!1?null:z()]});return ai(t,n.style),t},onBuild(){x()},onDestroy(){m?.destroy(),m=null,a.fieldIds.clear(),p=new WeakMap}}),h}const gi={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`},_i={type:`plainObject`,shape:{id:{type:`string`,nonEmpty:!0}}},vi={type:`renderable`},yi={types:[`plainObject`,`null`,`undefined`]};function $(e){return N(e)?{...e}:{}}function bi(e){let t={};for(let n of Object.keys(e))t[n]=$(e[n]);return t}function xi(e){return{...e,history:[...e.history],data:$(e.data),stepData:bi(e.stepData),currentData:$(e.currentData),currentStep:e.currentStep?{...e.currentStep}:null}}function Si(e){return Array.isArray(e)?e.map(e=>{let t={...e};return delete t.description,delete t.view,{...t,data:$(t.data)}}):[]}function Ci(e){return typeof e==`string`?{...gi,root:[gi.root,e.trim()].filter(Boolean).join(` `)}:{...gi,...N(e)?e:{}}}function wi(e,t){if(typeof e==`string`)return{id:e};if(!N(e))return{id:t};let n=e;return typeof n.id==`string`?{id:n.id,data:N(n.data)||n.data==null?n.data:void 0}:{id:t,data:e}}const Ti={id:{default:null,types:[`string`,`null`],normalize:e=>typeof e==`string`&&e.trim()||X()},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=N(e)?e:{};return{back:typeof t.back==`string`?t.back:y(`b`),next:typeof t.next==`string`?t.next:y(`Next`),finish:typeof t.finish==`string`?t.finish:y(`Finish`),reset:typeof t.reset==`string`?t.reset:y(`Reset`)}}},className:{default:gi,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=G(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),n=t.steps,r=new Map;for(let[e,t]of n.entries()){if(W(String(e),t,_i,`Flow.props.steps`),W(`content`,t.content??null,vi,`Flow.props.steps.${e}`),r.has(t.id))throw Error(`Flow.props.steps: duplicated step id "${t.id}".`);r.set(t.id,e)}let a=(()=>{if(typeof t.initial==`number`){let e=n[t.initial];if(!e)throw Error(`Flow.props.initial index is out of range.`);return e.id}if(typeof t.initial==`string`){if(!r.has(t.initial))throw Error(`Flow.props.initial step "${t.initial}" does not exist.`);return t.initial}return n[0].id})(),s={},c={};for(let e of n)s[e.id]=$(e.data),Object.assign(c,s[e.id]);let l=i({id:t.id,currentId:a,currentIndex:r.get(a)??0,previousId:null,previousIndex:null,direction:null,history:[a],data:$(c),stepData:bi(s),loading:!1,error:null,busyAction:null,version:0}),d={built:!1,mounted:!1,destroyed:!1,activeAction:null,actionController:null},p=new Set,m=new Set,h=new Set,g=0,_=null,v=null,y,b=e=>{if(d.destroyed)throw Error(`Flow.${e}: instance has been destroyed.`)},x=e=>{if(!e)return null;let{onEnter:t,onLeave:n,onNext:r,onBack:i,canEnter:a,canLeave:o,...s}=e;return s},S=o(()=>n[l.currentIndex]),C=o(()=>l.version>=0?$(l.stepData[l.currentId]):{}),w=o(()=>x(S())),T=o(()=>n.map(x)),E=o(()=>l.currentIndex>0&&!l.loading),D=o(()=>l.currentIndex<n.length-1&&!l.loading),O=o(()=>l.currentIndex===n.length-1),k=o(()=>({id:l.id,currentId:l.currentId,currentIndex:l.currentIndex,previousId:l.previousId,previousIndex:l.previousIndex,direction:l.direction,history:[...l.history],data:$(l.data),stepData:bi(l.stepData),currentData:C(),currentStep:w(),canBack:E(),canNext:D(),isLast:O(),loading:l.loading,busyAction:l.busyAction,error:l.error})),A=()=>S(),j=e=>$(l.stepData[e]),M=()=>xi(k()),N=(e=null)=>{let n=M();for(let t of p)t(n,y,e);t.onChange?.(n,y,e)},P=(e,t)=>{for(let t of Object.keys(e))delete e[t];Object.assign(e,t)},F=(e,n,i={})=>{if(b(`setStepData`),W(`stepId`,e,{type:`string`},`Flow.setStepData`),W(`data`,n,yi,`Flow.setStepData`),!r.has(e))throw Error(`Flow.setStepData: step "${e}" does not exist.`);return n?(u(()=>{l.stepData[e]={...$(l.stepData[e]),...n},t.cache&&Object.assign(l.data,n),l.version+=1}),i.silent||N(),y):y},I=e=>(b(`setData`),W(`data`,e,yi,`Flow.setData`),e?(u(()=>{Object.assign(l.data,e),l.version+=1}),N(),y):y),L=e=>{if(typeof e!=`function`)throw Error(`Flow.addCleanup: cleanup expects a function.`);return d.destroyed?(e(),()=>{}):(m.add(e),()=>m.delete(e))},R=()=>{let e=Error(`Flow: active action was aborted.`);return e.code=`FLOW_ABORTED`,e},z=e=>e instanceof Error&&e.code===`FLOW_ABORTED`,B=e=>{if(d.destroyed||e!=null&&h.has(e))throw R()},ee=()=>{let e=_;e!=null&&h.add(e),d.actionController?.abort(),d.actionController=null,d.activeAction=null,_=null},V=async(e,t,n=_)=>{if(typeof e!=`function`)return;let r=await e(...t);return B(n),r},H=(e={})=>{let t=e.step||A();return{...e,flow:y,step:t,state:l,signal:d.actionController?.signal||null,snapshot:M(),data:$(l.data),currentData:j(t.id),setData:I,setStepData:(e,t)=>F(e,t),getStepData:j,next:e=>y.next(e),back:e=>y.back(e),goTo:(e,t,n)=>y.goTo(e,t,n),addCleanup:L}},te=(e,n=null)=>{u(()=>{l.error=e,l.version+=1}),t.onError?.(e,M(),y,n)},ne=(e,t)=>{let n=M();(l.loading!==e||l.busyAction!==t)&&(u(()=>{l.loading=e,l.busyAction=e?t:null,l.version+=1}),N(n))},re=e=>{if(!l.loading)return null;let n=Error(`Flow: action "${e}" ignored while loading.`);if(n.code=`FLOW_BUSY`,t.onBusy?.(e,M(),y),t.busyStrategy===`throw`)throw n;return M()},U=async(e,t,n=!1)=>{let r=!n&&!l.loading,i=r?++g:_;r&&(d.actionController=new AbortController,d.activeAction=e,_=i,ne(!0,e));try{B(i);let e=await t(i);return B(i),e}catch(e){if(d.destroyed||z(e))return null;throw l.error!==e&&te(e),e}finally{i!=null&&h.delete(i),r&&!d.destroyed&&_===i&&(ne(!1,null),d.activeAction=null,d.actionController=null,_=null)}},ie=()=>({currentId:l.currentId,currentIndex:l.currentIndex,previousId:l.previousId,previousIndex:l.previousIndex,direction:l.direction,history:[...l.history],data:$(l.data),stepData:bi(l.stepData),loading:l.loading,busyAction:l.busyAction,error:l.error,version:l.version}),ae=e=>{u(()=>{l.currentId=e.currentId,l.currentIndex=e.currentIndex,l.previousId=e.previousId,l.previousIndex=e.previousIndex,l.direction=e.direction,l.history.splice(0,l.history.length,...e.history),P(l.data,e.data),P(l.stepData,e.stepData),l.loading=e.loading,l.busyAction=e.busyAction,l.error=e.error,l.version=e.version+1})},oe=e=>{if(typeof e==`number`){if(!n[e])throw Error(`Flow.goTo target is out of range.`);return e}let t=r.get(e);if(t==null)throw Error(`Flow.goTo target "${e}" does not exist.`);return t},se=async(e,n,i,a,o)=>{let s=M(),c=ie();try{if(i&&F(a.id,i,{silent:!0}),a.canLeave&&await V(a.canLeave,[H({direction:n,targetId:e.id})],o)===!1)throw Error(`Flow: step "${a.id}" blocked leaving.`);if(e.canEnter&&await V(e.canEnter,[H({direction:n,fromId:a.id,step:e})],o)===!1)throw Error(`Flow: step "${e.id}" blocked entering.`);await V(a.onLeave,[H({direction:n,step:a,targetId:e.id})],o),B(o);let t=l.currentId,c=l.currentIndex;u(()=>{l.previousId=t,l.previousIndex=c,l.currentId=e.id,l.currentIndex=r.get(e.id)??0,l.direction=n,n===`back`?l.history.pop():l.history.push(e.id),l.error=null,l.version+=1}),await V(e.onEnter,[H({direction:n,fromId:t,step:e})],o),B(o),N(s)}catch(e){throw d.destroyed||z(e)?e:(t.rollbackOnError&&ae(c),te(e,s),e)}},ce=async(e,n,r,i,a)=>{let o=e===`back`?n.onBack:n.onNext,s=e===`back`?t.onBack:t.onNext,c=H({payload:r,targetId:i});return await V(o,[c],a)??await V(s,[c],a)??i},le=async(e,t,r={})=>U(`goTo`,async i=>{let a=oe(e),o=n[a],s=A();return o.id===l.currentId?(t&&F(l.currentId,t),M()):(await se(o,r.direction||`go`,t,s,i),M())},!!r.internal),ue=e=>{let t=M();return{flow:y,snapshot:t,state:l,steps:T(),currentStep:t.currentStep,currentData:t.currentData,data:t.data,fallback:e,next:e=>y.next(e),back:e=>y.back(e),goTo:(e,t,n)=>y.goTo(e,t,n),reset:()=>y.reset()}},G=(e,n)=>{let r=t[e];return r===!1?null:typeof r==`function`?()=>l.version>=0?r(ue(n)):null:n()},de=()=>{let e=A().content;return typeof e==`function`?e(H()):e??``},q=()=>Q({name:`FlowView`,props:{},state:l,view:()=>f(`div`,{className:t.className.root,id:t.id,role:`group`,"data-flow":`root`,"aria-busy":()=>l.loading?`true`:`false`,children:[f(`div`,{className:t.className.header,"data-flow-header":``,children:K(G(`renderHeader`,()=>f(`ol`,{className:t.className.steps,"data-flow-steps":``,role:`list`,"aria-label":`Flow steps`,children:n.map((e,n)=>f(`li`,{className:()=>[t.className.step,n===l.currentIndex?t.className.active:``,n<l.currentIndex?t.className.complete:``].filter(Boolean).join(` `),"data-flow-step":e.id,"data-flow-step-index":String(n),"aria-current":()=>n===l.currentIndex?`step`:null,children:f(`button`,{type:`button`,className:t.className.stepButton,disabled:()=>t.linear&&n>l.currentIndex,"aria-current":()=>n===l.currentIndex?`step`:null,onClick:()=>{n!==l.currentIndex&&y.goTo(n)},children:[f(`span`,{className:t.className.stepIndex,"data-flow-step-number":``,children:n+1}),f(`span`,{className:t.className.stepTitle,"data-flow-step-title":``,children:e.title||e.id})]})}))})))}),f(`div`,{className:t.className.body,"data-flow-body":``,role:`region`,"aria-live":`polite`,"aria-busy":()=>l.loading?`true`:`false`,children:K(G(`renderBody`,()=>()=>l.version>=0?de():null))}),f(`div`,{className:t.className.footer,"data-flow-footer":``,children:K(G(`renderFooter`,()=>[t.showReset?f(`button`,{type:`button`,className:[t.className.button,t.className.reset].filter(Boolean).join(` `),"data-action":`reset`,onClick:()=>y.reset(),disabled:()=>l.loading,children:t.text.reset}):null,t.showBack?f(`button`,{type:`button`,className:[t.className.button,t.className.back].filter(Boolean).join(` `),"data-action":`back`,onClick:()=>void y.back(),disabled:()=>!y.canBack,children:t.text.back}):null,t.showNext?f(`button`,{type:`button`,className:[t.className.button,t.className.next].filter(Boolean).join(` `),"data-action":`next`,onClick:()=>void y.next(),disabled:()=>l.loading,children:()=>y.isLast?t.text.finish:t.text.next}):null]))})]})});return y={props:t,steps:n,state:l,runtime:d,get element(){return v?.element||null},get currentStep(){return A()},get currentData(){return $(C())},get canBack(){return E()},get canNext(){return D()},get isLast(){return O()},build(){return b(`build`),d.built?y:(t.render&&(v||=q(),v.build()),d.built=!0,y)},mount(e){return b(`mount`),y.build(),v&&v.mount(e),d.mounted=!!v,y},unmount(){return b(`unmount`),v?.unmount(),d.mounted=!1,y},subscribe(e){if(b(`subscribe`),typeof e!=`function`)throw Error(`Flow.subscribe: handler expects a function.`);return p.add(e),e(M(),y,null),()=>p.delete(e)},snapshot:M,async next(e=null){return b(`next`),W(`payload`,e,yi,`Flow.next`),re(`next`)||U(`next`,async r=>{if(y.isLast)return e&&F(l.currentId,e),await V(t.onFinish,[M(),y],r),M();let i=A(),a=n[l.currentIndex+1]?.id,o=wi(await ce(`next`,i,e,a,r),a);return le(o.id,o.data??e,{direction:`next`,internal:!0})})},async back(e=null){return b(`back`),W(`payload`,e,yi,`Flow.back`),re(`back`)||(y.canBack?U(`back`,async t=>{let r=A(),i=n[l.currentIndex-1]?.id,a=wi(await ce(`back`,r,e,i,t),i);return le(a.id,a.data??e,{direction:`back`,internal:!0})}):M())},async goTo(e,t=null,n={}){return b(`goTo`),W(`payload`,t,yi,`Flow.goTo`),re(`goTo`)||le(e,t,{direction:n.direction})},setData:I,setStepData:F,getStepData:j,reset(){b(`reset`);let e=M();return ee(),u(()=>{l.currentId=a,l.currentIndex=r.get(a)??0,l.previousId=null,l.previousIndex=null,l.direction=null,l.history.splice(0,l.history.length,a),P(l.data,$(c)),P(l.stepData,bi(s)),l.loading=!1,l.busyAction=null,l.error=null,l.version+=1}),N(e),y},async finish(e=null){return b(`finish`),W(`payload`,e,yi,`Flow.finish`),re(`finish`)||U(`finish`,async n=>(e&&F(l.currentId,e),await V(t.onFinish,[M(),y],n),M()))},destroy(){if(!d.destroyed){d.destroyed=!0,ee(),v?.destroy(),v=null;for(let e of m)e();m.clear(),p.clear(),d.built=!1,d.mounted=!1,r.clear()}}},y}const 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}const Ni={type:`renderable`},Pi={default:{},type:`object`,plain:!0,normalize:e=>{let t=N(e)?e:{};return{...t,title:typeof t.title==`string`?t.title:y(`Tip`),confirm:typeof t.confirm==`string`?t.confirm:y(`Confirm`),cancel:typeof t.cancel==`string`?t.cancel:y(`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()||X():e??X()},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=G(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,style:t.style}}let zi=0,Bi=``;function Vi(e={}){let t=Ri(e),n=i(Ai(t)),r={initial:ki(t),previousActiveElement:null,content:null,contentSource:null,hasContent:!1,updatedAt:0},o=new Map,[s,l]=c(!1),[d,p]=c({value:null}),h,g=null,_=null,v=!1,b=0,x=()=>n.processing,S=e=>{if(!t.cache||!r.hasContent||r.contentSource!==e)return!1;let n=Mi(t.ttl);return!n||Date.now()-r.updatedAt<=n},C=(e,n)=>{t.cache&&(r.content=n,r.contentSource=e,r.hasContent=!0,r.updatedAt=Date.now())},w=()=>{r.content=null,r.contentSource=null,r.hasContent=!1,r.updatedAt=0},T=()=>{for(let e of o.values())e();o.clear()},D=(e,t,n,r)=>{o.get(e)?.(),t.addEventListener(n,r),o.set(e,()=>t.removeEventListener(n,r))},O=()=>{v||=(zi===0&&(Bi=document.body.style.overflow,document.body.style.overflow=`hidden`),zi+=1,!0)},k=()=>{v&&=(zi=Math.max(0,zi-1),zi===0&&(document.body.style.overflow=Bi,Bi=``),!1)},A=()=>{let e=r.previousActiveElement;r.previousActiveElement=null,e&&document.contains(e)&&e.focus()},M=Rn({elements:()=>[h.element,g],mount:()=>{h.mount(document.body),O()},activate:()=>l(!0),deactivate:()=>l(!1),motion:Tn(On(()=>h.element,{keyframes:[{opacity:0},{opacity:1}],options:{duration:220,easing:`ease`}}),On(()=>g,{keyframes:[{opacity:0,transform:`scale(0.96)`},{opacity:1,transform:`scale(1)`}],options:{duration:220,easing:`ease`}})),unmount:()=>{h.unmount(),k(),A()}}),N=()=>{if(n.loading||n.processing){_||=j(),g&&_.parentElement!==g&&g.append(_);return}_?.remove(),_=null},P=e=>{n.processing!==e&&u(()=>{n.processing=e})},F=()=>{n.visible&&M.phase!==`leaving`&&P(!1)},I=(e=n.content)=>{if(S(e)){b+=1,u(()=>{p({value:r.content}),n.loading=!1});return}let t=++b;if(typeof e!=`function`){w(),u(()=>{p({value:e}),n.loading=!1});return}let i;try{i=e(h)}catch(e){console.error(`Modal.content error:`,e),u(()=>{p({value:null}),n.loading=!1});return}if(!ji(i)){C(e,i),u(()=>{p({value:i}),n.loading=!1});return}u(()=>{n.loading=!0,p({value:null})}),Promise.resolve(i).then(n=>{h.runtime.destroyed||t!==b||(C(e,n),u(()=>{p({value:n})}))}).catch(e=>{h.runtime.destroyed||t!==b||(console.error(`Modal.content error:`,e),u(()=>{p({value:null})}))}).finally(()=>{!h.runtime.destroyed&&t===b&&u(()=>{n.loading=!1})})},L=()=>{if(x())return;let e;try{e=t.onConfirm?.(h)}catch(e){console.error(`Modal.onConfirm error:`,e);return}ji(e)&&(P(!0),Promise.resolve(e).catch(e=>{console.error(`Modal.onConfirm error:`,e)}).finally(()=>{h.runtime.destroyed||F()}))},R=()=>{if(x())return;let e;try{e=t.onCancel?.(h)}catch(e){console.error(`Modal.onCancel error:`,e);return}if(!ji(e)){h.hide();return}P(!0),Promise.resolve(e).then(()=>{h.runtime.destroyed||h.hide()}).catch(e=>{console.error(`Modal.onCancel error:`,e)}).finally(()=>{h.runtime.destroyed||F()})},z=e=>{if(!g)return;let t=Y(`a[href], button:not([disabled]):not([data-action=close]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])`,g).filter(e=>e.offsetParent!==null||e===document.activeElement);if(!t.length){e.preventDefault(),g.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())},B=()=>{if(!g)return;let e=J(`input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]):not([data-action=close]), [tabindex]:not([tabindex="-1"])`,g);e?e.focus():(g.setAttribute(`tabindex`,`-1`),g.focus())},ee=()=>{let e=h.element;!e||!g||(T(),D(`root`,e,`click`,n=>{t.bgClose&&!x()&&n.target===e&&h.hide()}),D(`dialog`,g,`click`,e=>{let t=(e.target instanceof Element?e.target:null)?.closest(`[data-action]`)?.dataset.action;t===`cancel`||t===`close`?R():t===`confirm`&&L()}),D(`keyboard`,document,`keydown`,e=>{!(e instanceof KeyboardEvent)||!n.visible||(e.key===`Escape`&&t.escClose&&!x()?(e.preventDefault(),h.hide()):e.key===`Tab`&&z(e))}))},V=()=>{if(M.phase===`visible`||M.phase===`entering`)return;if(!h.element)throw Error(`Modal.show: build() must be called before show().`);t.onShow?.(h),r.previousActiveElement=document.activeElement instanceof HTMLElement?document.activeElement:null;let e=M.enter();ee(),B(),e.then(e=>{e&&!h.runtime.destroyed&&t.onShown?.(h)})},H=()=>{M.phase!==`hidden`&&M.phase!==`leaving`&&(t.onHide?.(h),T(),b+=1,M.leave().then(e=>{e&&!h.runtime.destroyed&&(u(()=>{n.loading=!1,n.processing=!1,t.cache||p({value:null})}),t.onHidden?.(h))}))};return h=Q({name:`Modal`,props:t,state:n,actions:{show(){if(!h.runtime.built)throw Error(`Modal.show: build() must be called before show().`);return h.setState(`visible`,!0),h},hide(){return u(()=>{n.visible=!1}),h},reset(){return h.setState({content:r.initial.content,loading:!1,processing:!1}),w(),p({value:null}),h}},normalizeStatePatch(e){return{...e}},validateStatePatch(e){W(`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.`);W(t,e[t],Ii[t],`Modal.setState`)}},view:()=>{g=f(`div`,{className:q(t.className.modal,t.fullscreen?`is-fullscreen`:``),id:t.id,role:`document`,"data-modal-dialog":t.id,...t.style?{style:t.style}:{},"data-mount":()=>s()?`true`:`false`,children:[t.header?f(`div`,{className:t.className.header,children:()=>n.loading?null:[f(`div`,{className:t.className.title,id:`${t.id}_title`,"aria-label":t.text.title,children:t.text.title}),t.showClose?f(`button`,{type:`button`,className:q(t.className.button,t.className.closeBtn),"data-action":`close`,"aria-label":y(`Close`),disabled:x,children:E(`close`)}):null]}):null,f(`div`,{className:t.className.body,"data-modal-body":``,children:()=>K(d().value)}),t.footer?f(`div`,{className:t.className.footer,children:()=>n.loading?null:[t.showCancel?f(`button`,{type:`button`,className:q(t.className.button,t.className.cancelBtn),"data-action":`cancel`,disabled:x,children:t.text.cancel}):null,f(`button`,{type:`button`,className:q(t.className.button,t.className.confirmBtn),"data-action":`confirm`,disabled:x,children:t.text.confirm})]}):null]});let e=Vn({className:t.className.layout,position:t.position,component:`modal`,labelledby:t.header?`${t.id}_title`:``,content:g});return e.setAttribute(`data-mount`,`false`),t.header||e.setAttribute(`aria-label`,t.text.title||`Modal`),a(()=>{e.setAttribute(`data-mount`,s()?`true`:`false`)}),a(N),a(()=>{let e=n.visible;m(()=>e?V():H())}),a(()=>{let e=n.visible,t=n.content;m(()=>{e?I(t):b+=1})}),e},onDestroy(){let e=M.phase!==`hidden`;e&&t.onHide?.(h),M.cancel(),T(),k(),A(),_?.remove(),_=null,g=null,e&&t.onHidden?.(h)}}),h}const 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=G(e,Ui,`Swiper.props`);return{...t,id:t.id?.trim()||null,data:Yi(t.data),className:{...t.className}}}function Zi(t={}){let n=Xi(t),r=Array.isArray(n.data)?n.data:[],s=i({data:Ji(r),loading:!1,index:0,trackIndex:0,transform:0,animating:!1,width:0}),c=je(),l=new WeakMap,d=new Map,p=new Map,m=new Set,h,g=null,_=[],v=()=>[],y=()=>[],b=0,x=null,S=null,C=[],w=null,T=!1,D=!1,O=!1,k=!1,A=e=>(l.has(e)||l.set(e,X()),l.get(e)),M=e=>{let t=Object.keys(e);return{keys:t,values:t.map(t=>e[t])}},N=(e,t,n)=>{if(!e||e.keys.length!==t.length)return!1;for(let r=0;r<t.length;r+=1)if(e.keys[r]!==t[r]||!Object.is(e.values[r],n[r]))return!1;return!0},P=e=>{let t=new Set,n=e.map((e,n)=>{W(String(n),e,Wi,`Swiper.state.data`);let r=A(e);t.add(r);let{keys:i,values:a}=M(e),o=d.get(r);if(o&&N(o,i,a))return o.item.index=n,o.item;let s={...e,blank:e.blank!==!1,index:n,key:r};return d.set(r,{item:s,keys:i,values:a}),s});for(let e of d.keys())t.has(e)||d.delete(e);return n.some(e=>e.sort!=null)?n.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):n},F=(e,t,n)=>{let r=n===null?`real:${e.key}:${!!e.url}`:`clone:${n}:${e.key}:${!!e.url}`,i=p.get(r);if(i&&i.item===e&&i.clone===n)return i.index=t,i;let a={item:e,index:t,clone:n,key:r};return p.set(r,a),a},I=e=>{let t=new Set,r=e.map((e,n)=>{let r=F(e,n,null);return t.add(r.key),r});if(!n.loop||e.length<=1){for(let e of p.keys())t.has(e)||p.delete(e);return r}let i=e[0],a=e[e.length-1],o=F(a,e.length-1,`last`),s=F(i,0,`first`);t.add(o.key),t.add(s.key);for(let e of p.keys())t.has(e)||p.delete(e);return[o,...r,s]},L=()=>v().length,R=()=>y().length,z=(e=s.trackIndex)=>{let t=L();return t?!n.loop||t<=1?Math.max(0,Math.min(e,t-1)):e===0?t-1:e===R()-1?0:e-1:0},B=e=>n.loop?z(e):Math.max(0,e),ee=e=>{let t=L();if(!t)return 0;let r=Math.max(0,Math.min(e,t-1));return n.loop&&t>1?r+1:r},V=()=>{_=g?Y(`[data-swiper-slide]`,g):[]},H=()=>{for(let e of m)e();m.clear()},te=()=>{let e=h.element;if(!e)return;let t=e.clientWidth||e.offsetWidth;(t>0||!e.isConnected||s.width===0)&&u(()=>{s.width=t})},ne=()=>!!h.element?.isConnected&&s.width>0,re=()=>(te(),ne()),U=(e,t=!0)=>{let r=qi(e),i=-r*s.width,a=t&&n.speed>0&&s.width>0&&s.transform!==i;u(()=>{s.trackIndex=r,s.index=z(r),s.transform=i,s.animating=a})},ie=()=>{let e=[s.trackIndex];s.trackIndex>0&&e.push(s.trackIndex-1),s.trackIndex<_.length-1&&e.push(s.trackIndex+1);for(let t of e){let e=_[t]?J(`img[data-lazy]`,_[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,m.delete(r)};m.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())}},ae=()=>{x&&=(clearInterval(x),null)},oe=()=>{h.runtime.destroyed||x||L()<=1||re()&&(x=setInterval(()=>h.next(),Math.max(n.delay,16)))},se=()=>{n.autoplay&&!x&&!h.runtime.destroyed&&oe()},ce=()=>{ae(),n.autoplay&&oe()},le=e=>{C.push({x:e.pageX??e.clientX??0,y:e.pageY??e.clientY??0,time:Date.now()}),C.length>5&&C.shift()},ue=()=>C.length?{x:C[C.length-1].x-C[0].x,y:C[C.length-1].y-C[0].y}:{x:0,y:0},G=(e=!0)=>{let t=-s.trackIndex*s.width,n=e&&s.transform!==t;T=!1,D=!1,O=!1,C=[],w=null,u(()=>{s.transform=t,s.animating=n}),se()},de=(e,t)=>{s.animating||!re()||(C=[],le(e),w=t,T=!0,D=!1,O=!1,k=!1,ae(),u(()=>{s.animating=!1}))},fe=(e,t)=>{if(!T||D||s.animating)return;le(e);let r=ue(),i=Math.abs(r.x),a=Math.abs(r.y);if(!(i<6&&a<6)){if(!O){if(Math.atan2(a,i)*180/Math.PI<n.touchAngle)O=!0,k=Ki(w);else{D=!0,G(!0);return}}t.preventDefault(),u(()=>{s.transform=-s.trackIndex*s.width+r.x*n.touchRatio})}},pe=()=>{if(!T)return;if(T=!1,!O||s.width<=0){G(!0);return}let e=C.length?C[C.length-1].time-C[0].time:0,t=ue().x,r=Math.abs(t)/s.width,i=0;e>n.longSwipesMs?i=Math.ceil(r-n.longSwipesRatio):r>=n.longSwipesRatio&&(i=Math.max(1,Math.ceil(r-n.longSwipesRatio))),h.slideToTrack(s.trackIndex+i*(t>0?-1:1)),C=[],se()},me=e=>{e.target!==g||!(`propertyName`in e)||e.propertyName!==`transform`||(u(()=>{s.animating=!1}),!(!n.loop||L()<=1)&&(s.trackIndex===0?U(L(),!1):s.trackIndex===R()-1&&U(1,!1)))},he=()=>{let e=h.element;!e||!g||(c.clear(),c.on(`touchstart`,g,`touchstart`,e=>{let t=e.touches[0];t&&de(t,e.target)},{passive:!0}),c.on(`touchmove`,g,`touchmove`,e=>{let t=e.touches[0];t&&fe(t,e)},{passive:!1}),c.on(`touchend`,g,`touchend`,e=>{let t=e.changedTouches[0];t&&le(t),pe()}),c.on(`touchcancel`,window,`touchcancel`,()=>G(!0)),c.on(`mousedown`,g,`mousedown`,e=>{let t=e;t.button===0&&(de(t,t.target),g?.style.setProperty(`cursor`,`grabbing`))}),c.on(`mousemove`,window,`mousemove`,e=>{let t=e;T&&t.buttons===1&&fe(t,e)}),c.on(`mouseup`,window,`mouseup`,e=>{T&&(g?.style.setProperty(`cursor`,`grab`),le(e),pe())}),c.on(`click`,g,`click`,e=>{!k||!n.preventClick||(e.preventDefault(),e.stopPropagation(),k=!1)},{capture:!0}),c.on(`dragstart`,g,`dragstart`,e=>e.preventDefault()),c.on(`transitionend`,g,`transitionend`,me),c.on(`resize`,window,`resize`,ge),c.on(`mouseenter`,e,`mouseenter`,ae),c.on(`mouseleave`,e,`mouseleave`,se),c.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`?h.prev():n.dataset.action===`next`?h.next():n.dataset.swiperBullet!=null&&h.slideTo(Number(n.dataset.swiperBullet)))}))},ge=()=>{if(!h.runtime.built)return;ae(),H(),V();let e=Math.min(s.index,Math.max(0,L()-1));te(),U(ee(e),!1),n.lazyload&&ie(),n.autoplay&&ne()&&se()},_e=Mt(ge),ve=()=>{S==null&&typeof requestAnimationFrame==`function`&&(S=requestAnimationFrame(()=>{S=null,!h.runtime.destroyed&&h.element?.isConnected&&ge()}))},ye=async()=>{if(typeof n.data!=`function`)return;let e=++b;u(()=>{s.loading=!0});try{let t=await Promise.resolve(n.data(h));if(h.runtime.destroyed||e!==b)return;W(`data`,t,{type:`array`},`Swiper.data`);let r=Ji(t);P(r),u(()=>{s.data=r})}finally{!h.runtime.destroyed&&e===b&&u(()=>{s.loading=!1})}},be=()=>{ye().catch(e=>{h.runtime.destroyed||console.error(`Swiper.data error:`,e)})},xe=(e,t)=>{let r=()=>B(t()),i={className:n.className.slide,"data-swiper-slide":()=>String(r()),"data-swiper-index":()=>e().clone?null:String(r()),"data-clone":()=>e().clone,role:`group`,"aria-label":()=>`Slide ${r()+1}`,children:()=>{let{item:t}=e();if(t.children!=null){let e={swiper:h,item:t,get index(){return r()}};return K(typeof t.children==`function`?t.children(e):t.children)}return[t.image?f(`img`,{className:n.className.image,alt:t.title||``,loading:`lazy`,...n.lazyload?{"data-lazy":t.image}:{src:t.image}}):null,t.title?f(`span`,{className:n.className.title,children:t.title}):null]}};return e().item.url?f(`a`,{...i,href:()=>e().item.url||``,target:()=>e().item.blank?`_blank`:`_self`}):f(`div`,i)};return h=Q({name:`Swiper`,props:n,state:s,actions:{slideTo(e){h.slideToTrack(ee(e))},slideToTrack(e){if(!h.runtime.built)throw Error(`Swiper.slideToTrack: call build() first.`);if(s.animating||!_.length||!re())return;let t=n.loop?Math.max(0,Math.min(e,_.length-1)):Math.max(0,Math.min(e,L()-1));U(t,!0),n.lazyload&&ie()},next(){s.animating||h.slideToTrack(s.trackIndex+1)},prev(){s.animating||h.slideToTrack(s.trackIndex-1)},play:oe,pause:ae,resume:se,restartAutoplay:ce},normalizeStatePatch(e){return{...e,...Object.hasOwn(e,`data`)&&Array.isArray(e.data)?{data:Ji(e.data)}:{}}},validateStatePatch(e){W(`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.`);W(t,e[t],Gi[t],`Swiper.setState`)}Array.isArray(e.data)&&P(e.data)},view:()=>{v=o(()=>P(s.data)),y=o(()=>I(v()));let t=()=>{let e=j();return e.setAttribute(`data-swiper-loading`,``),e};g=f(`div`,{className:n.className.wrapper,"data-swiper-wrapper":``,"aria-live":`polite`,children:()=>s.loading?t():e({each:y,key:e=>e.key,children:xe})});let r=f(`div`,{id:n.id||X(),className:n.className.root,"data-swiper":`root`,"data-status":()=>s.loading?`loading`:`loaded`,children:[g,n.pagination?f(`div`,{className:q(n.className.pagination,n.className.paginationHorizontal,n.className.paginationClickable,n.className.paginationBulletGroup),"data-swiper-pagination":``,children:e({each:v,key:e=>e.key,children:(e,t)=>f(`button`,{type:`button`,className:()=>q(n.className.indicator,n.className.bullet,s.index===t()?n.className.active:``),"data-swiper-bullet":()=>String(t()),"aria-label":()=>`Go to slide ${t()+1}`,"aria-current":()=>s.index===t()?`true`:null})})}):null,n.navigation?f(`button`,{type:`button`,className:()=>q(n.className.navigation,n.className.prev,!n.loop&&s.index<=0?n.className.disabled:``),"data-action":`prev`,"data-swiper-navigation":`prev`,"aria-label":`Previous slide`,disabled:()=>!n.loop&&s.index<=0,children:E(`arrow-left`)}):null,n.navigation?f(`button`,{type:`button`,className:()=>q(n.className.navigation,n.className.next,!n.loop&&s.index>=L()-1?n.className.disabled:``),"data-action":`next`,"data-swiper-navigation":`next`,"aria-label":`Next slide`,disabled:()=>!n.loop&&s.index>=L()-1,children:E(`arrow-right`)}):null]});return a(()=>{g?.style.setProperty(`transform`,`translate3d(${s.transform}px, 0, 0)`),g?.style.setProperty(`transition`,s.animating?`transform ${n.speed}ms cubic-bezier(0.25, 0.46, 0.45, 0.94)`:`none`),r.style.setProperty(`--swiper-slide-width`,`${s.width}px`)}),a(()=>{(v().map(e=>`${e.key}:${e.sort??``}:${!!e.url}`).join(`|`)||s.data.length===0)&&_e.schedule()}),r},onBuild(e){!e.element||!g||(g.setAttribute(`aria-live`,`polite`),V(),he(),te(),U(ee(s.index),!1),n.lazyload&&ie(),n.autoplay&&ne()&&oe(),e.own(()=>c.clear()),be(),ve())},onMount(){ge(),ve()},onDestroy(){ae(),_e.dispose(),b+=1,H(),S!=null&&cancelAnimationFrame(S),S=null,g=null,_=[]}}),Object.defineProperties(h,{realCount:{enumerable:!0,get:L},realIndex:{enumerable:!0,get:()=>z()}}),h}const 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()||X():e??X()},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`){W(String(t),e,ea,n);let r=(typeof e.name==`string`?e.name.trim():``)||X();return{...e,name:r}}function ra(e,t=`Tabs.data`){W(`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=G(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(t={}){let n=aa(t),r=i({data:n.data,active:n.active,disabled:n.disabled,draggable:!1,dragging:!1,loading:!1}),s=je(),l=Lt(),d=Lt(),m=Rt(),h=Rt(),g=new Map,_=new Map,v,y=0,b=!1,x=0,S=0,C=0,w=e=>typeof e==`number`?e:r.data.findIndex(t=>t.name===e),T=()=>{let e=w(r.active),t=r.data[e];return t?{index:e,name:t.name}:{index:-1,name:null}},E=()=>{if(typeof r.active==`string`)return r.active;let e=r.data[r.active];return e?e.name:null},D=()=>{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`)))},O=e=>D().includes(e),k=e=>E()===e,A=o(()=>r.data),M=()=>{let e=l.current,t=d.current;if(!e||!t)return;let i=n.direction===`left`||n.direction===`right`?t.scrollHeight>e.clientHeight+5:t.scrollWidth>e.clientWidth+5;r.draggable!==i&&u(()=>{r.draggable=i})},N=Mt(M),P=()=>{let e=l.current;if(!e)return;let t=C,r=performance.now(),i=n.direction===`left`||n.direction===`right`,a=n=>{let o=n-r;r=n,t*=.92,!(Math.abs(t)<.3)&&(i?e.scrollTop+=t*o*.05:e.scrollLeft+=t*o*.05,x=requestAnimationFrame(a))};x=requestAnimationFrame(a)},F=()=>{let e=l.current,t=d.current;if(!e||!t)return;let i=0,a=0,o=0,c=!1,f=0,p=e=>{let t=n.direction===`left`||n.direction===`right`;if(`touches`in e){let n=e.touches[0]||e.changedTouches[0];return t?n.pageY:n.pageX}return t?e.pageY:e.pageX},m=t=>{r.draggable&&(!(t instanceof MouseEvent)&&!(t instanceof TouchEvent)||(b=!0,u(()=>{r.dragging=!0}),i=p(t),o=i,a=n.direction===`left`||n.direction===`right`?e.scrollTop:e.scrollLeft,C=0,cancelAnimationFrame(x)))},h=t=>{if(!b||!(t instanceof MouseEvent)&&!(t instanceof TouchEvent))return;t.preventDefault();let r=p(t);f=i-r,C=o-r,o=r,!c&&(c=!0,requestAnimationFrame(()=>{c=!1,n.direction===`left`||n.direction===`right`?e.scrollTop=a+f:e.scrollLeft=a+f}))},g=()=>{b&&(b=!1,u(()=>{r.dragging=!1}),P())};s.on(`drag:mousedown`,t,`mousedown`,m),s.on(`drag:touchstart`,t,`touchstart`,m,{passive:!0}),s.on(`drag:mousemove`,window,`mousemove`,h,{passive:!1}),s.on(`drag:touchmove`,window,`touchmove`,h,{passive:!1}),s.on(`drag:mouseup`,window,`mouseup`,g),s.on(`drag:touchend`,window,`touchend`,g)},I=async e=>{if(!v.runtime.built)throw Error(`Tabs.activate: call build() first.`);let t=w(e),i=r.data[t];if(!i)return;let a=i.name;O(a)||k(a)||(u(()=>{r.active=e}),await _.get(a)?.(),await Promise.resolve(n.onChange?.(t,a,m.get(a),h.get(a))))},L=(e,t)=>{let i=e().name,o=e().content,[s,l]=c(typeof o==`function`?null:o),[d,m]=c(!1),b=o,x=0,S=null,C=()=>({tabs:v,item:e(),index:t(),name:i}),w=async()=>{let t=e(),n=t.content;if(typeof n!=`function`){l(n);return}let a=t.cache?g.get(i):null,o=oa(t.ttl);if(a&&(!o||Date.now()-a.updatedAt<=o)){l(a.content);return}if(S)return S;let s=++x;y+=1;let c=y;m(!0),u(()=>{r.loading=!0});let d=Promise.resolve().then(()=>n(C())).then(t=>{s!==x||v.runtime.destroyed||(e().cache&&g.set(i,{content:t,updatedAt:Date.now()}),l(t))}).finally(()=>{s===x&&m(!1),c===y&&!v.runtime.destroyed&&u(()=>{r.loading=!1}),S===d&&(S=null)});return S=d,d};_.set(i,w),p(()=>{g.delete(i),_.delete(i)}),a(()=>{let t=e().content;t!==b&&(b=t,x+=1,S=null,g.delete(i),l(typeof t==`function`?null:t)),k(i)&&w()});let T=()=>{if(d())return j(`flex-start`,`flex-start`);let e=s();return typeof e==`function`?e(C()):e};return f(`div`,{className:n.className.panel,"data-tabs-panel":i,role:`tabpanel`,"aria-hidden":()=>k(i)?`false`:`true`,"aria-live":()=>typeof e().content==`function`?`polite`:null,"aria-busy":()=>String(d()),hidden:()=>!k(i),ref:h.bind(i),children:()=>K(T())})},R=(e,t)=>{let r=e().name,i=()=>{let n=e().title,i={tabs:v,item:e(),index:t(),name:r};return typeof n==`function`?n(i):n};return f(`div`,{className:n.className.tab,"data-tabs-tab":r,role:`tab`,"aria-selected":()=>k(r)?`true`:`false`,"aria-disabled":()=>O(r)?`true`:`false`,ref:m.bind(r),children:()=>K(i())})};return v=Q({name:`Tabs`,props:n,state:r,actions:{activate:I},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){W(`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;W(t,e[t],ta[n],`Tabs.setState`)}},view:()=>(a(()=>{let e=r.data.length;return N.schedule(),e}),f(`div`,{className:n.className.root,id:n.id,"data-tabs":`root`,"data-tabs-direction":n.direction,children:[f(`div`,{className:n.className.wrap,"data-tabs-wrap":``,ref:l.set,children:f(`nav`,{className:()=>q(n.className.list,r.dragging&&n.className.dragging),"data-tabs-list":``,ref:d.set,children:e({each:A,key:e=>e.name,children:(e,t)=>R(e,t)})})}),f(`div`,{className:n.className.panelWrap,"data-tabs-panel-wrap":``,children:e({each:A,key:e=>e.name,children:(e,t)=>L(e,t)})})]})),onBuild(e){let t=e.element;t&&(s.on(`click`,t,`click`,e=>{if(!(e.target instanceof Element))return;let t=e.target.closest(`[data-tabs-tab]`)?.dataset.tabsTab;t&&!O(t)&&I(t)}),s.on(`resize`,window,`resize`,()=>{cancelAnimationFrame(S),S=requestAnimationFrame(M)}),F(),e.own(()=>s.clear()),N.schedule(),_.get(T().name||``)?.())},onMount(){N.schedule()},onDestroy(){y+=1,N.dispose(),cancelAnimationFrame(x),cancelAnimationFrame(S),g.clear(),_.clear(),m.clear(),h.clear()}}),Object.defineProperties(v,{current:{enumerable:!0,get:T}}),v}const 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()||X():e??X()},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,visible:{type:`boolean`},loading:{type:`boolean`}};function fa(e){return e>0?e:0}function pa(e){let t=G(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){W(`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;W(t,e[t],da[n],`Offcanvas.setState`)}}function _a(e={}){let t=pa(e),n=i({content:t.content,visible:!1,loading:!1}),[r,o]=c({value:typeof t.content==`function`?null:t.content}),s={cache:{content:null,hasContent:!1,updatedAt:0},contentLoadId:0},l=je(),p=Lt(),h,g=!1,_=()=>{!t.bodyOverflow||g||(ma===0&&(ha=document.body.style.overflow,document.body.style.overflow=`hidden`),ma+=1,g=!0)},v=()=>{g&&=(ma=Math.max(0,ma-1),ma===0&&(document.body.style.overflow=ha,ha=``),!1)},y=On(()=>h.element,{keyframes:[{transform:la[t.direction]},{transform:`translate(0, 0)`}],options:{duration:300,easing:`ease`}}),b=Rn({elements:()=>[p.current,h.element],mount:()=>{let e=p.current;e&&!e.isConnected&&d(document.body,e),h.mount(document.body),_()},activate:()=>{n.visible=!0},deactivate:()=>{n.visible=!1},motion:Tn(...t.animate===`slide`?[y]:[],On(()=>p.current,{keyframes:[{opacity:0},{opacity:1}],options:{duration:300,easing:`ease`}})),unmount:()=>{p.current?.remove(),h.unmount(),v()}}),x=()=>{s.cache={content:null,hasContent:!1,updatedAt:0}},S=()=>{if(!t.cache||!s.cache.hasContent)return!1;let e=fa(t.ttl);return!e||Date.now()-s.cache.updatedAt<=e},C=()=>{let e=r().value;return typeof e==`function`?e(h):e},w=async()=>{let e=n.content;if(typeof e!=`function`){s.contentLoadId+=1,u(()=>{o({value:e}),n.loading=!1});return}if(S()){s.contentLoadId+=1,u(()=>{o({value:s.cache.content}),n.loading=!1});return}let r=++s.contentLoadId;u(()=>{n.loading=!0,o({value:null})});try{let n=await Promise.resolve(e(h));if(h.runtime.destroyed||r!==s.contentLoadId)return;t.cache&&(s.cache={content:n,hasContent:!0,updatedAt:Date.now()}),u(()=>{o({value:n})})}finally{!h.runtime.destroyed&&r===s.contentLoadId&&u(()=>{n.loading=!1})}};return h=Q({name:`Offcanvas`,props:t,state:n,actions:{async show(){if(!h.runtime.built)throw Error(`Offcanvas.show: call build() first.`);if(n.visible)return;await Promise.resolve(t.onShow?.(h));let e=b.enter(),r=w();await e&&!h.runtime.destroyed&&t.onShown?.(h),await r},async hide(){if(!h.runtime.built)throw Error(`Offcanvas.hide: call build() first.`);if(!n.visible)return;let e=t.onHide?.(h);e&&await e,s.contentLoadId+=1,u(()=>{n.loading=!1}),await b.leave()&&t.onHidden?.(h)}},validateStatePatch:ga,view(e){let r=t.overlay?f(`div`,{ref:p.set,className:t.className.overlay,"data-offcanvas-overlay":t.id,"data-mount":()=>n.visible?`true`:`false`,style:t.filter?{backdropFilter:`blur(2px)`}:{},onClick:()=>{t.bgClose&&h.hide()}}):null;return r&&e.own(()=>r.remove()),a(()=>{let e=n.content;W(`content`,e,da.content,`Offcanvas.state`),x(),typeof e==`function`?(o({value:null}),m(()=>n.visible)&&w()):(s.contentLoadId+=1,o({value:e}),n.loading=!1)}),f(`div`,{className:t.className.root,id:t.id,role:`dialog`,"aria-modal":t.overlay?`true`:`false`,"aria-expanded":()=>String(n.visible),"data-mount":()=>n.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`)&&h.hide()},children:f(`div`,{className:t.className.content,"data-offcanvas-content":t.id,children:()=>K(n.loading?j():C())})})},onBuild(e){t.escClose&&l.on(`esc`,document,`keydown`,e=>{e instanceof KeyboardEvent&&e.key===`Escape`&&n.visible&&h.hide()}),e.own(()=>l.clear())},onDestroy(){b.cancel(),s.contentLoadId+=1,p.current?.remove(),v()}}),h}const va={size:10,current:1},ya={sibling:1,boundary:1},ba={root:`j-pagination`,list:`pagination`,item:`item`,button:`j-button is-ghost is-icon`,currentBtn:`j-button is-outline is-icon is-active`,moreBtn:`j-button is-ghost is-icon`,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=G(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(t={}){let n=Aa(t),r=i({total:n.total,page:Oa(n.page),count:ka(n.count),locked:!1}),s=0,c,l=o(()=>Da(r.total,r.page.size)),d=()=>n.lock&&r.locked,p=()=>d()||r.page.current<=1,m=()=>d()||r.page.current>=l(),h=o(()=>Pa(r.page.current,l(),r.count)),g=e=>{n.lock&&!c.runtime.destroyed&&e===s&&u(()=>{r.locked=!1})},_=e=>{if(c.runtime.destroyed)throw Error(`Pagination.go: instance destroyed`);if(!c.runtime.built)throw Error(`Pagination.go: call build() first.`);if(W(`page`,e,{type:`number`,integer:!0},`Pagination.go`),d())return c;let t=Ea(e,1,l());if(t===r.page.current)return c;let i=n.lock&&typeof n.onChange==`function`,a=i?++s:s;if(u(()=>{r.page.current=t,i&&(r.locked=!0)}),n.onChange){let e;try{e=n.onChange(t,c)}catch(e){throw g(a),e}if(i&&e&&typeof e.then==`function`){let t=()=>g(a);Promise.resolve(e).then(t,t)}else g(a)}return c},v=e=>{let t=e===`prev`?p:m;return f(`li`,{className:n.className.item,"data-pagination-control":e,children:f(`button`,{className:n.className.button,type:`button`,"data-page-action":e,"aria-label":y(e===`prev`?`Go to previous page`:`Go to next page`),"aria-disabled":()=>t()?`true`:`false`,tabindex:()=>t()?`-1`:null,disabled:t,onClick:()=>{t()||_(r.page.current+(e===`prev`?-1:1))},children:E(e===`prev`?`arrow-left`:`arrow-right`)})})},b=e=>{if(e().type===`more`)return f(`li`,{className:n.className.item,"data-pagination-more":()=>e().type===`more`?e().key:null,children:f(`span`,{className:n.className.moreBtn,"aria-disabled":!0,disabled:``,children:E(`more`)})});let t=()=>Fa(e()).page,i=()=>t()===r.page.current;return f(`li`,{className:n.className.item,"data-pagination-more":()=>e().type===`more`?e().key:null,"data-pagination-item":()=>{let t=e();return t.type===`page`?String(t.page):null},children:f(`button`,{className:()=>i()?n.className.currentBtn:n.className.button,type:`button`,"data-page":()=>String(t()),"data-current-page":()=>i()?String(t()):null,"aria-current":()=>i()?`page`:null,"aria-label":()=>i()?`Page ${t()}, current page`:`Go to page ${t()}`,"aria-disabled":()=>d()||i()?`true`:`false`,tabindex:()=>d()||i()?`-1`:null,disabled:()=>d()||i(),onClick:()=>{let e=t();!d()&&!i()&&_(e)},children:()=>d()&&i()?j():String(t())})})};return c=Q({name:`Pagination`,props:n,state:r,actions:{go:_},normalizeStatePatch(e){let t={...e};return Object.hasOwn(t,`page`)&&N(t.page)&&(t.page={...r.page,...t.page}),Object.hasOwn(t,`count`)&&N(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;W(t,e[t],Ta[n],`Pagination.setState`)}},view:()=>(a(()=>{let e=Ea(r.page.current,1,l());e!==r.page.current&&(r.page.current=e)}),f(`div`,{className:n.className.root,role:`navigation`,"aria-label":`Pagination`,"data-pagination":`root`,children:f(`ul`,{className:n.className.list,"data-pagination-list":``,"aria-live":`polite`,children:[v(`prev`),e({each:h,key:e=>e.key,children:e=>b(e)}),v(`next`)]})}))}),Object.defineProperty(c,"pageCount",{enumerable:!0,get:l}),c}const 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?, type?, url?, target?, classes?, children? }.`},za={type:`array`,items:Ra},Ba={type:{default:void 0,types:[`string`,`undefined`]},user:{default:0,types:[`number`,`function`]},id:{default:null,types:[`string`,`null`],normalize:e=>typeof e==`string`?e.trim()||X():e??X()},data:{default:[],types:[`array`,`function`]},backText:{default:y(`b`),type:`string`},className:{default:La,type:`object`,normalize:e=>({...La,...e&&typeof e==`object`?e:{}})}},Va={user:{type:`number`},data:za,activeKeys:{type:`array`,items:`string`}};function Ha(e={}){let t=G(e,Ba,`Menu.props`);return{...t,user:t.user,data: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??X()}`}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.type==null||t.type===0||t.type===1||t.type===2)&&(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=>{W(`item`,e,Ra,`Menu.data`);let t={...e};return t.type=t.type??0,Array.isArray(t.classes)&&(t.classes=t.classes.slice()),Array.isArray(t.children)&&(t.children=qa(t.children)),t}):[]}function Ja(e){let n=t(e??0);return W(`user`,n,`number`,`Menu.props`),n}function Ya(e){let n=t(e??[]);return W(`data`,n,za,`Menu.props`),qa(n)}function Xa(t={}){let n=Ha(t),r=i({user:Ja(n.user),data:Ya(n.data),activeKeys:[]}),s=new WeakMap,c=je(),l,d=e=>e.id==null?(s.has(e)||s.set(e,X()),s.get(e)):String(e.id),p=e=>r.activeKeys.includes(e),m=()=>r.user>0,h=e=>e.type===1?m():e.type!==2||!m(),g=e=>Array.isArray(e)?e.filter(h):[],_=e=>{u(()=>{r.activeKeys=n.type===`bottom`?[e]:r.activeKeys.includes(e)?r.activeKeys:[...r.activeKeys,e]})},v=e=>{u(()=>{r.activeKeys=r.activeKeys.filter(t=>t!==e)})},y=e=>{u(()=>{r.activeKeys=p(e)?[]:[e]})},b=e=>f(`li`,{className:n.className.backItem,"data-menu-back":``,children:f(`a`,{className:n.className.link,href:``,"data-menu-link":``,onClick:t=>{t.preventDefault(),v(e)},children:[f(`span`,{className:n.className.backIcon,children:E(`arrow-left`)}),f(`span`,{className:n.className.text,children:n.backText})]})}),x=(t,r=!1,i)=>f(`ul`,{className:r?n.className.list:n.className.subMenu,...r?{id:n.id}:{},"data-menu-list":r?`root`:`sub`,children:[e({each:()=>n.type===`mobile`&&i&&p(i)?[i]:[],key:e=>e,children:e=>b(e())}),e({each:t,key:e=>d(e),children:e=>{let t=d(e()),r=o(()=>g(e().children)),i=()=>r().length>0;return f(`li`,{className:()=>{let r=e();return q(n.className.item,i()?n.className.hasChildren:``,...Ua(r.classes),p(t)?n.className.active:``)},id:()=>e().id==null?`menu-item-${t}`:Wa(e().id),"data-menu-item":()=>e().id==null?``:String(e().id),"data-menu-has-children":()=>i()?``:null,onClick:e=>{n.type===`mobile`&&e.target===e.currentTarget&&i()&&_(t)},children:[()=>{let r=e(),a=i(),o=Ga(r.url);return!a&&!o?f(`span`,{className:n.className.link,"data-menu-link":``,children:r.title}):f(`a`,{className:n.className.link,href:o,target:r.target,"data-menu-link":``,onClick:e=>{a&&(n.type===`mobile`||n.type===`bottom`)&&(e.preventDefault(),n.type===`bottom`?y(t):_(t))},children:r.title})},()=>i()?x(r,!1,t):null]})}})]});return l=Q({name:`Menu`,props:n,state:r,normalizeStatePatch(e){let t={...e};return Object.hasOwn(t,`user`)&&(t.user=Ja(t.user)),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;W(t,e[t],Va[n],`Menu.setState`)}},view:()=>{let e=o(()=>g(r.data));return a(()=>{r.user=Ja(n.user),r.data=Ya(n.data)}),a(()=>W(`data`,r.data,za,`Menu`)),f(`nav`,{className:n.className.root,"data-menu":`root`,"data-menu-type":n.type,children:x(e,!0)})},onBuild(e){n.type===`bottom`&&(c.on(`outside`,document,`click`,t=>{let n=t.target;!(n instanceof Node)||e.element?.contains(n)||u(()=>{r.activeKeys=[]})}),e.own(()=>c.clear()))}}),l}export{_t as Toast,A as addIcons,Y as all,K as asRenderable,St as checkModernBrowser,yt as copy,Ur as createAccordion,kn as createCollapseTransition,qn as createDrop,Lt as createElementRef,je as createEventManager,Di as createFlow,hi as createForm,xn as createImgCompress,Rt as createKeyedElementRefs,j as createLoading,Xa as createMenu,Vi as createModal,Tn as createMotionGroup,_a as createOffcanvas,wn as createOwnedView,Ia as createPagination,mr as createParabola,Vn as createPopup,Rn as createPresence,Mt as createScheduledTask,It as createStateSync,br as createSticky,Zi as createSwiper,sa as createTabs,cr as createTheme,Ar as createToc,Qn as createTooltip,On as createTransition,_n as createValidator,Q as defineComponent,Sn as getImgCompressInstance,k as getRegistedIconPath,Nt as getStoreVersion,B as getType,E as icon,D as iconHtml,O as iconMarkup,I as isDomElementValue,F as isDomNodeValue,he as isElement,L as isHtmlElementValue,vt as isMobile,xt as isModernBrowser,P as isNilValue,me as isNode,N as isPlainObject,we as isRenderableContent,R as isRenderablePrimitive,z as isRenderableValue,q as joinClasses,Te as lazyRender,Ae as listen,wt as postJson,J as q,X as randomId,Cr as removeComponentPlugin,Ce as requireContainer,Cn as resetImgCompressInstance,Se as resolveContainer,xe as resolveElement,be as resolveNode,ye as resolveNodeList,G as resolveProps,Ct as restUrl,Ft as stateSnapshot,Pe as timer,Pt as trackStoreVersion,y as translate,Sr as useComponentPlugin,Me as uuid,W as validateParam,Ln as waitForMotion};
|
|
1
|
+
import{For as e,access as t,bindAttr as n,bindClass as r,createDeepStore as i,createEffect as a,createMemo as o,createRoot as s,createSignal as c,createWatch as l,flushSync as u,insert as d,jsx as f,onCleanup as p,untrack as m,unwrap as h}from"vanilla-signal";import{t as g}from"vanilla-signal-i18n";import{createStorage as _}from"vanilla-create-storage";var v={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:`自动`,Tip:`提示`,Close:`关闭`,Confirm:`确认`,Cancel:`取消`,Upgrade:`升级`,wn:`您的浏览器版本过低,存在安全风险。请升级浏览器后再访问本站。`,Submit:`提交`,Reset:`重置`,"Loading...":`加载中...`,"Go to previous page":`访问上一页`,"Go to next page":`访问下一页`,Next:`下一步`,Finish:`完成`}};function y(e){return g(e,v)}var b={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>`,like:`<path d="M12.001 4.52853C14.35 2.42 17.98 2.49 20.2426 4.75736C22.5053 7.02472 22.583 10.637 20.4786 12.993L11.9999 21.485L3.52138 12.993C1.41705 10.637 1.49571 7.01901 3.75736 4.75736C6.02157 2.49315 9.64519 2.41687 12.001 4.52853ZM18.827 6.1701C17.3279 4.66794 14.9076 4.60701 13.337 6.01687L12.0019 7.21524L10.6661 6.01781C9.09098 4.60597 6.67506 4.66808 5.17157 6.17157C3.68183 7.66131 3.60704 10.0473 4.97993 11.6232L11.9999 18.6543L19.0201 11.6232C20.3935 10.0467 20.319 7.66525 18.827 6.1701Z"></path>`,dislike:`<path d="M2.80777 1.3934L21.1925 19.7782L19.7783 21.1924L16.0316 17.4454L12 21.485L3.52154 12.993C1.48186 10.7094 1.49309 7.24014 3.55524 4.96959L1.39355 2.80762L2.80777 1.3934ZM4.98009 11.6232L12 18.6543L14.6176 16.0314L4.97206 6.38623C3.67816 7.88265 3.67138 10.121 4.98009 11.6232ZM20.2428 4.75736C22.5054 7.02472 22.5831 10.637 20.4788 12.993L18.8442 14.629L17.4302 13.215L19.0202 11.6232C20.3937 10.0467 20.3191 7.66525 18.8271 6.1701C17.3281 4.66794 14.9078 4.60702 13.3371 6.01688L12.0021 7.21524L10.6662 6.01781C10.3163 5.70415 9.92487 5.46325 9.51117 5.29473L7.2604 3.04551C8.92926 2.83935 10.6682 3.33369 12.0011 4.52853C14.3502 2.42 17.9802 2.49 20.2428 4.75736Z"></path>`,"thumb-up":`<path d="M14.5998 8.00033H21C22.1046 8.00033 23 8.89576 23 10.0003V12.1047C23 12.3659 22.9488 12.6246 22.8494 12.8662L19.755 20.3811C19.6007 20.7558 19.2355 21.0003 18.8303 21.0003H2C1.44772 21.0003 1 20.5526 1 20.0003V10.0003C1 9.44804 1.44772 9.00033 2 9.00033H5.48184C5.80677 9.00033 6.11143 8.84246 6.29881 8.57701L11.7522 0.851355C11.8947 0.649486 12.1633 0.581978 12.3843 0.692483L14.1984 1.59951C15.25 2.12534 15.7931 3.31292 15.5031 4.45235L14.5998 8.00033ZM7 10.5878V19.0003H18.1606L21 12.1047V10.0003H14.5998C13.2951 10.0003 12.3398 8.77128 12.6616 7.50691L13.5649 3.95894C13.6229 3.73105 13.5143 3.49353 13.3039 3.38837L12.6428 3.0578L7.93275 9.73038C7.68285 10.0844 7.36341 10.3746 7 10.5878ZM5 11.0003H3V19.0003H5V11.0003Z"></path>`,"thumb-down":`<path d="M9.40017 16H3C1.89543 16 1 15.1046 1 14V11.8957C1 11.6344 1.05118 11.3757 1.15064 11.1342L4.24501 3.61925C4.3993 3.24455 4.76447 3 5.16969 3H22C22.5523 3 23 3.44772 23 4V14C23 14.5523 22.5523 15 22 15H18.5182C18.1932 15 17.8886 15.1579 17.7012 15.4233L12.2478 23.149C12.1053 23.3508 11.8367 23.4184 11.6157 23.3078L9.80163 22.4008C8.74998 21.875 8.20687 20.6874 8.49694 19.548L9.40017 16ZM17 13.4125V5H5.83939L3 11.8957V14H9.40017C10.7049 14 11.6602 15.229 11.3384 16.4934L10.4351 20.0414C10.3771 20.2693 10.4857 20.5068 10.6961 20.612L11.3572 20.9425L16.0673 14.27C16.3172 13.9159 16.6366 13.6257 17 13.4125ZM19 13H21V5H19V13Z"></path>`};const x=`http://www.w3.org/2000/svg`,S=b;function C(e){if(!(e in S))throw Error(`Icon "${e}" not found.`)}function w(e){return C(e),`<svg xmlns="${x}" viewBox="0 0 24 24" fill="currentColor">${S[e]}</svg>`}function T(e){return e!==null&&e.namespaceURI===x}function E(e,t={}){let n=document.createElement(`template`);n.innerHTML=w(e);let r=n.content.firstElementChild;if(!T(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 D(e){return w(e)}const O=D;function k(){return{...S}}function A(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 j(e=`center`,t=`center`){let n=E(`loader`,{width:24});return requestAnimationFrame(()=>{typeof n.animate==`function`&&n.animate([{transform:`rotate(0deg)`},{transform:`rotate(360deg)`}],{duration:1e3,iterations:1/0,easing:`linear`})}),f(`div`,{"aria-live":`polite`,style:{display:`flex`,justifyContent:e,alignItems:t,position:`absolute`,width:`100%`,height:`100%`,borderRadius:`inherit`,backdropFilter:`blur(4px)`},children:n})}const M=Function.prototype.toString.call(Object);function N(e){if(typeof e!=`object`||!e||Object.prototype.toString.call(e)!==`[object Object]`)return!1;let t=Object.getPrototypeOf(e);if(t===null)return!0;let n=Object.prototype.hasOwnProperty.call(t,`constructor`)&&t.constructor;return typeof n==`function`&&Function.prototype.toString.call(n)===M}function P(e){return e==null}function F(e){return typeof Node<`u`&&e instanceof Node}function I(e){return typeof Element<`u`&&e instanceof Element}function L(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function ee(e){return typeof e==`string`||typeof e==`number`||typeof e==`boolean`}function R(e){return P(e)||ee(e)||typeof e==`function`||Array.isArray(e)||F(e)}const z=e=>e===null?`null`:Array.isArray(e)?`array`:L(e)?`HTMLElement`:F(e)?`Node`:typeof e;function te(e){return Array.isArray(e)?e.slice():N(e)?{...e}:e}function B(e={}){return typeof e==`string`||Array.isArray(e)?{type:e}:!e||typeof e!=`object`?{}:e}function V(e,t){throw Error(`Validator: ${e} ${t}`)}function ne(e){return typeof e==`string`?e:String(e)}function re(e){return typeof e==`string`?`string`:`array`}function ie(e,t,n){if(P(t)||typeof t!=`string`&&!Array.isArray(t))return;let r=re(t);n.nonEmpty&&t.length===0&&V(e,`expects a non-empty ${r}.`),typeof n.minLength==`number`&&t.length<n.minLength&&V(e,`expects ${r} length to be at least ${n.minLength}.`),typeof n.maxLength==`number`&&t.length>n.maxLength&&V(e,`expects ${r} length to be at most ${n.maxLength}.`)}function H(e,t,n){P(t)||typeof t!=`number`||(n.finite&&!Number.isFinite(t)&&V(e,`expects a finite number.`),n.integer&&!Number.isInteger(t)&&V(e,`expects an integer.`),typeof n.min==`number`&&t<n.min&&V(e,`expects a number greater than or equal to ${n.min}.`),typeof n.max==`number`&&t>n.max&&V(e,`expects a number less than or equal to ${n.max}.`),typeof n.greaterThan==`number`&&t<=n.greaterThan&&V(e,`expects a number greater than ${n.greaterThan}.`),typeof n.lessThan==`number`&&t>=n.lessThan&&V(e,`expects a number less than ${n.lessThan}.`))}function ae(e,t,n){!n.plain||P(t)||N(t)||V(e,`expects an object.`)}function oe(e,t,n){!n.items||P(t)||(Array.isArray(t)||V(e,`expects array.`),t.forEach((t,r)=>{U(String(r),t,n.items,e)}))}function se(e,t,n){if(!n.shape||P(t))return;(!t||typeof t!=`object`||Array.isArray(t))&&V(e,`expects object.`);let r=t;for(let[t,i]of Object.entries(n.shape))U(t,r[t],i,e)}function ce(e,t){return t===`renderable`?R(e):t===`Node`?F(e):t===`Element`?I(e):t===`HTMLElement`?L(e):t===`plainObject`?N(e):z(e)===t}function le(e){return N(e)?`object`:z(e)}function ue(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)||V(e,i)}}function de(e,t){return e?`${e}.${t}`:t}function U(e,t,n={},r=``){let i=B(n),a=de(r,e),o=Object.hasOwn(i,`types`)?i.types:i.type;if(i.required&&P(t)&&V(a,`is required.`),o!==void 0){let e=Array.isArray(o)?o:[o],n=le(t);e.some(e=>ce(t,e))||V(a,`expects ${e.join(`, `)}, but got ${n}.`)}return Array.isArray(i.enum)&&!i.enum.includes(t)&&V(a,`expects one of ${i.enum.map(ne).join(`, `)}.`),ie(a,t,i),H(a,t,i),ae(a,t,i),oe(a,t,i),se(a,t,i),ue(a,t,i.conditions),typeof i.validate==`function`&&(i.validate(t)||V(a,i.message||`does not satisfy the required condition.`)),t}function W(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=B(t);a[e]=Object.hasOwn(i,e)?i[e]:fe(n)}for(let[e,n]of o){let r=B(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)U(e,a[e],t,n);return a}function fe(e){if(!Object.hasOwn(e,`default`))return;let t=e.default;return te(e.factory&&typeof t==`function`?t():t)}function G(e){return e}function K(...e){return e.filter(Boolean).join(` `)}const pe=[`node`,`element`,`array`];function me(e){return pe.includes(e)}function he(e){return F(e)}function ge(e){return I(e)}function _e(e){return typeof e==`string`||ge(e)||he(e)||Array.isArray(e)}function ve(e){return e.find(ge)||null}function ye(e,t=[]){for(let n of e){if(Array.isArray(n)){if(!ye(n,t))return null;continue}if(he(n)){t.push(n);continue}return null}return t}function be(e){if(e===!1||e==null)return null;if(typeof e==`string`){let t=J(e);return t.length>0?t:null}if(Array.isArray(e)){let t=ye(e,[]);return t&&t.length>0?t:null}return he(e)?[e]:null}function xe(e){return ge(e)||he(e)?e:typeof e==`string`?document.querySelector(e):Array.isArray(e)&&(be(e)||[])[0]||null}function Se(e){if(!_e(e))return null;if(typeof e==`string`){let t=document.querySelector(e);return ge(t)?t:null}if(Array.isArray(e)){let t=be(e);return Array.isArray(t)?ve(t):null}return ge(e)?e:null}function Ce(e,t=`Component`,n=`element`){if(!me(n))throw Error(`${t}: expect must be one of 'node', 'element', 'array'.`);return _e(e)?n===`array`?be(e):n===`node`?xe(e):Se(e):null}function we(e,t=`Component`,n=`element`){let r=Ce(e,t,n);if(r==null)throw Error(`${t}: container not found.`);return r}function Te(e){return R(e)}function q(e,t=document){return t.querySelector(e)}function J(e,t=document){return Array.from(t.querySelectorAll(e))}function Ee(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(!Oe(e))return console.warn(`lazyRender: target 必须是 CSS 选择器字符串或 DOM 元素`),De;let c=De,l=ke(e);if(l&&document.body.contains(l))return c=Ae(l,t,s),c;if(!o||typeof MutationObserver>`u`)return t(),c;let u=new MutationObserver(()=>{let n=ke(e);!n||!document.body.contains(n)||(l=n,u.disconnect(),c=Ae(l,t,s))});return u.observe(document.documentElement,{childList:!0,subtree:!0}),()=>{u.disconnect(),c()}}function De(){}function Oe(e){return typeof e==`string`||ge(e)}function ke(e){return typeof e==`string`?q(e):e}function Ae(e,t,n){if(typeof window>`u`||window.IntersectionObserver===void 0)return t(),De;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 je(e,t,n,r){let i=!0;return e.addEventListener(t,n,r),()=>{i&&(i=!1,e.removeEventListener(t,n,r))}}function Me(){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=je(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 Ne(){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 Y(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,`_`)}const Pe=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Fe=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]);function X(e,t){return e>>>t|e<<32-t}function Ie(e){let t=new Uint8Array(Math.ceil((e.length+9)/64)*64);t.set(e),t[e.length]=128;let n=BigInt(e.length)*8n;for(let e=0;e<8;e+=1)t[t.length-1-e]=Number(n>>BigInt(e*8)&255n);let r=new Uint32Array(Fe),i=new Uint32Array(64);for(let e=0;e<t.length;e+=64){for(let n=0;n<16;n+=1){let r=e+n*4;i[n]=(t[r]<<24|t[r+1]<<16|t[r+2]<<8|t[r+3])>>>0}for(let e=16;e<64;e+=1){let t=X(i[e-15],7)^X(i[e-15],18)^i[e-15]>>>3,n=X(i[e-2],17)^X(i[e-2],19)^i[e-2]>>>10;i[e]=i[e-16]+t+i[e-7]+n>>>0}let n=r[0],a=r[1],o=r[2],s=r[3],c=r[4],l=r[5],u=r[6],d=r[7];for(let e=0;e<64;e+=1){let t=X(c,6)^X(c,11)^X(c,25),r=c&l^~c&u,f=d+t+r+Pe[e]+i[e]>>>0,p=(X(n,2)^X(n,13)^X(n,22))+(n&a^n&o^a&o)>>>0;d=u,u=l,l=c,c=s+f>>>0,s=o,o=a,a=n,n=f+p>>>0}r[0]=r[0]+n>>>0,r[1]=r[1]+a>>>0,r[2]=r[2]+o>>>0,r[3]=r[3]+s>>>0,r[4]=r[4]+c>>>0,r[5]=r[5]+l>>>0,r[6]=r[6]+u>>>0,r[7]=r[7]+d>>>0}let a=new Uint8Array(32);for(let e=0;e<r.length;e+=1)a[e*4]=r[e]>>>24,a[e*4+1]=r[e]>>>16,a[e*4+2]=r[e]>>>8,a[e*4+3]=r[e];return a}async function Le(e){let t=globalThis.crypto?.subtle;if(t&&typeof t.digest==`function`){let n=new ArrayBuffer(e.byteLength);return new Uint8Array(n).set(e),new Uint8Array(await t.digest(`SHA-256`,n))}return Ie(e)}async function Re(e,t=8){if(typeof e!=`object`||!e)throw TypeError(`params must be a non-null object`);if(t<1||t>32)throw RangeError(`bytes must be between 1 and 32`);let n={},r=Object.keys(e).sort();for(let t of r){let r=e[t];n[t]=typeof r==`string`?r.trim():r}let i=JSON.stringify(n),a=await Le(new TextEncoder().encode(i)),o=Math.min(t,a.byteLength),s=a.subarray(0,o),c=0n;for(let e of s)c=c<<8n|BigInt(e);return c.toString(36)}const ze={},Be={timers:ze,start(e,t,n){ze[e]&&clearTimeout(ze[e]),ze[e]=setTimeout(()=>{n(),delete ze[e]},t)},cancel(e){ze[e]&&(clearTimeout(ze[e]),delete ze[e])}},Ve={container:`j-toast-container`,toast:`j-toast`,icon:`el-icon`,message:`el-text`,lite:`j-toast-lite`,confirm:`j-toast is-confirm`,buttons:`toast-buttons`,button:`j-button is-sm`,closeBtn:`is-ghost`,confirmBtn:`is-outline`,info:`is-info`,primary:`is-primary`,success:`is-success`,warning:`is-warning`,error:`is-error`},He={type:`string`,enum:[`info`,`success`,`warning`,`error`,`primary`]},Ue={type:`number`,min:0},We={type:`number`,greaterThan:0},Ge=new Set,Ke=new Map,Z=new Map,qe=new Map,Je=new Map;let Ye=Ve;function Xe(e){return{...Ve,...e}}function Ze(e){return Xe({...Ye,...e?.className})}function Qe(e,t){let n=Ke.get(e);Ke.set(e,()=>{n?.(),t()})}function $e(e){let t=Je.get(e);return t?!t.isConnected||t.getAttribute(`data-mount`)===`false`?(Je.delete(e),null):t:null}function et(e,t,n){n&&Je.set(e,t)}function tt(e){for(let[t,n]of Je)n===e&&Je.delete(t)}function nt(e){return!!t(e.loading??!1)}function rt(e){return e===`primary`?`info`:e}function it(e){return nt(e)?{position:`relative`,display:`inline-flex`,alignItems:`center`,justifyContent:`center`,width:`var(--toast-icon-size, 1em)`,height:`var(--toast-icon-size, 1em)`,flex:`0 0 auto`}:{}}function at(e,t){return nt(t)?j():E(rt(e))}function ot(e,t){return nt(t)?t.text?.loading||y(`Loading...`):e}async function st(e,t){let n=nt(t);vt(e),n&&await t.onCancel?.(),await t.onClose?.()}function ct(e,t,n,r,i,o,c=0){let l=e.dataset.toast||Y();Qe(e,s(s=>(d(t,()=>at(i,o)),d(n,()=>ot(r,o)),a(()=>{dt(l),c>0&&!nt(o)&&ut(l,`hide`,()=>vt(e),c)}),s)))}function lt(e){let t=q(`[data-toast-container]`);return t?t.className=e.container:(t=f(`div`,{className:e.container,"data-toast-container":``}),d(document.body,t)),t}function ut(e,t,n,r){let i=`${e}-${t}`;return Ge.add(i),Be.start(i,r,()=>{Ge.delete(i),n()}),i}function dt(e){for(let t of Array.from(Ge))t.startsWith(`${e}-`)&&(Be.cancel(t),Ge.delete(t))}function ft(e){Z.get(e)?.cancel(),Z.delete(e),qe.delete(e),e.remove(),Ke.get(e)?.(),Ke.delete(e),tt(e);let t=q(`[data-toast-container]`);t&&t.children.length===0&&t.remove()}function pt(e,t,n){return{duration:e.ownerDocument.defaultView?.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches?0:t,easing:n,fill:`both`}}function mt(e){return e.finished.then(()=>void 0,()=>void 0)}function ht(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 gt(e,t){let n=(qe.get(e)||0)+1;if(qe.set(e,n),Z.get(e)?.cancel(),Z.delete(e),typeof e.animate!=`function`)return;let r=e.hasAttribute(`data-toast-lite`),i=e.animate(ht(e,t),pt(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)`));Z.set(e,i),await mt(i),qe.get(e)===n&&Z.get(e)===i&&Z.delete(e)}function _t(e,t,n,r){e.removeAttribute(`data-mount`),e.setAttribute(`aria-live`,n),t(),e.getBoundingClientRect(),gt(e,`enter`).then(()=>{!e.isConnected||e.dataset.mount===`false`||r?.()})}function vt(e){e&&e.getAttribute(`data-mount`)!==`false`&&(Ke.get(e)?.(),Ke.delete(e),dt(e.dataset.toast||Y()),e.removeAttribute(`aria-live`),e.setAttribute(`data-mount`,`false`),gt(e,`leave`).then(()=>{e.dataset.mount===`false`&&ft(e)}))}function yt(e=``,t={}){let n=t.once??!1;if(n){let e=$e(`show`);if(e)return e}U(`message`,e,`string`,`Toast.show`);let r=t.duration??3e3,i=t.theme||`info`;U(`once`,n,`boolean`,`Toast.show`),U(`duration`,r,Ue,`Toast.show`),U(`theme`,i,He,`Toast.show`);let a=Ze(t),o=Y(),s=f(`span`,{className:a.icon,"data-toast-icon":o,style:()=>it(t)}),c=f(`span`,{className:a.message,"data-toast-message":o}),l=f(`div`,{className:K(a.toast,a[i]),"data-toast":o,role:`alert`,"aria-atomic":`true`,children:[s,c]});return ct(l,s,c,e,i,t,r),_t(l,()=>d(lt(a),l),i===`error`?`assertive`:`polite`),et(`show`,l,n),Qe(l,je(l,`click`,()=>void st(l,t))),l}function bt(e=``,t=2e3,n){U(`message`,e,`string`,`Toast.lite`),U(`duration`,t,We,`Toast.lite`);let r=Xe({...Ye,...n}),i=q(`[data-toast-lite]`);i&&(dt(i.dataset.toast||``),Z.get(i)?.cancel(),ft(i));let a=Y(),o=f(`div`,{className:r.lite,"data-toast":a,"data-toast-lite":``,children:e});return _t(o,()=>d(document.body,o),`polite`),ut(a,`hide`,()=>vt(o),t),o}function xt(e=``,t={}){let n=t.once??!0;if(n){let e=$e(`confirm`);if(e)return e}U(`message`,e,`string`,`Toast.confirm`);let r=t.text?.close||y(`Close`),i=t.text?.confirm||y(`Confirm`),a=t.theme||`info`;U(`once`,n,`boolean`,`Toast.confirm`),U(`theme`,a,He,`Toast.confirm`);let o=Ze(t),s=Y(),c=f(`div`,{className:K(o.confirm,o[a]),"data-toast":s,"data-toast-confirm":``,children:[f(`div`,{className:o.message,"data-toast-message":s,children:e}),f(`div`,{className:o.buttons,"data-toast-buttons":s,children:[f(`button`,{className:K(o.button,o.closeBtn),children:r,"data-toast-button":`close`,"aria-label":r,onClick:async()=>{await t.onClose?.(),vt(c)}}),f(`button`,{className:K(o.button,o.confirmBtn),children:i,"data-toast-button":`confirm`,"aria-label":i,onClick:async()=>{await t.onConfirm?.(),vt(c)}})]})]});return _t(c,()=>d(lt(o),c),`polite`,()=>{q(`[data-toast-button="confirm"]`,c)?.focus()}),et(`confirm`,c,n),c}function St(){for(let e of Ge)Be.cancel(e);Ge.clear();for(let e of Ke.values())e();Ke.clear();for(let e of Z.values())e.cancel();Z.clear(),qe.clear(),Je.clear(),q(`[data-toast-container]`)?.remove(),q(`[data-toast-lite]`)?.remove()}const Ct={timers:Ge,disposers:Ke,configure(e={}){return Ye=Xe(e.className),{className:Ye}},show:yt,success:(e=``,t={})=>yt(e,{...t,theme:`success`}),info:(e=``,t={})=>yt(e,{...t,theme:`info`}),primary:(e=``,t={})=>yt(e,{...t,theme:`primary`}),warning:(e=``,t={})=>yt(e,{...t,theme:`warning`}),error:(e=``,t={})=>yt(e,{...t,theme:`error`}),hide:vt,lite:bt,confirm:xt,clearAll:St,destroyAll:St};function wt(){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 Tt(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 Et(t)}return Et(t)}function Et(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 Dt(){try{return typeof Object.hasOwn==`function`&&typeof[].at==`function`}catch{return!1}}function Ot(){return Dt()?!0:(Ct.confirm(y(`wn`),{theme:`error`,onConfirm:()=>{window.open(`https://www.google.cn/chrome/fallback/`,`_blank`)},className:{confirmBtn:`j-button is-sm is-danger`}}),!1)}const kt=typeof window<`u`?`${window.location.origin}/wp-json`:``;async function At(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 jt=null,Mt=null,Nt=!1;function Pt(e){if(typeof queueMicrotask==`function`){queueMicrotask(e);return}Promise.resolve().then(e)}function Ft(){Nt||(Nt=!0,Pt(Lt))}function It(e){e.enqueued=!0,Mt?Mt.next=e:jt=e,Mt=e,Ft()}function Lt(){Nt=!1;let e=jt;jt=null,Mt=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 Rt(e){let t={queued:!1,enqueued:!1,disposed:!1,next:null,run:e};return{schedule(){t.disposed||t.queued||(t.queued=!0,t.enqueued||It(t))},flush(){t.disposed||(t.queued=!1,t.run())},cancel(){t.queued=!1},dispose(){t.disposed=!0,t.queued=!1}}}function zt(e){if(e&&typeof e==`object`){let t=e.__version__;return typeof t==`number`?t:0}return 0}function Bt(e){return zt(e),e}function Vt(e){return h(e)}function Ht(e,t,{deferInitial:n=!0,flushInitial:r=!1,flush:i=`microtask`}={}){let a=!1,o=!1,s,c=Rt(()=>{o&&(o=!1,m(()=>t(s)))}),u=l(e,e=>{let t=!a;if(a=!0,s=e,o=!0,t&&r||i===`sync`){c.flush();return}c.schedule()},{defer:n});return()=>{c.dispose(),u.dispose()}}function Ut(){let e=null;return{get current(){return e},set(t){e=t},clear(){e=null}}}function Wt(){let e=new Map;return{elements:e,get(t){return e.get(t)},bind(t){return n=>{e.set(t,n),p(()=>{e.get(t)===n&&e.delete(t)})}},delete(t){e.delete(t)},clear(){e.clear()}}}const Gt={help:`help-block`},Kt={rules:{default:{},type:`object`},messages:{default:{},type:`object`},vanilla:{default:!1,type:`boolean`},className:{default:Gt,type:`object`,normalize:e=>qt(e)},onSubmit:{default:null,types:[`function`,`null`]}};function qt(e){return{...Gt,...N(e)?e:{}}}function Jt(e){let t=W(e,Kt,`Validator.props`);return{rules:t.rules,messages:t.messages,vanilla:t.vanilla,className:t.className,onSubmit:t.onSubmit}}function Yt(e){return e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement}function Xt(e){if(!e)return null;if(e instanceof Element)return Yt(e)?e:null;for(let t of Array.from(e))if(t instanceof Element&&Yt(t))return t;return null}function Zt(){return{valid:!0,error:!1,message:``,destroyed:!1}}function Qt(e){return e.closest(`[data-field-control]`)||e.parentElement}function $t(e){return Array.from(e.selectedOptions).map(e=>e.value.trim())}function en(e){return e instanceof HTMLInputElement&&e.type===`file`}function tn(e){return!!e.files&&e.files.length>0}function nn(e,t){return t===!0?e instanceof HTMLSelectElement?$t(e).some(e=>e.length>0):e.value.trim().length>=1:!0}function rn(e,t){return typeof t!=`number`||e.value.length>=t}function an(e,t){return typeof t!=`number`||e.value.length<=t}function on(e){return/^([\w-.]+@([\w-]+\.)+[\w-]{2,4})?$/.test(e.value)}function sn(e,t,n){if(!e||typeof n!=`string`)return!0;let r=Xt(e.elements.namedItem(n));if(!r)throw Error(`Validator: target element "${n}" not found.`);return t.value===r.value}function cn(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 ln(e,t){if(!(e instanceof HTMLSelectElement))throw Error(`Validator: element expects a select element, but ${e.tagName.toLowerCase()} given.`);return t!==!0||$t(e).some(e=>e.length>0)}function un(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 dn(e,t){if(!e||!(t instanceof HTMLInputElement)||t.type!==`checkbox`)return[];let n=Array.from(e.elements).filter(e=>e instanceof HTMLInputElement&&e.type===`checkbox`&&e.name===t.name&&!e.closest(`[data-field-switch]`));return n.length>1||t.closest(`[data-choice-type="checkbox"], [data-field-choice-group]`)?n:[]}function fn(e,t){let n=dn(e,t);return n.length===0?null:n.filter(e=>e.checked).length}function pn(e,t,n){if(typeof n!=`number`)return!0;if(t instanceof HTMLSelectElement)return t.selectedOptions.length>=n;let r=fn(e,t);return r===null||r>=n}function mn(e,t,n){if(typeof n!=`number`)return!0;if(t instanceof HTMLSelectElement)return t.selectedOptions.length<=n;let r=fn(e,t);return r===null||r<=n}function hn(e,t){return!/\s/.test(e.value)||t!==!0}function gn(e,t){return typeof t==`string`||t instanceof RegExp?new RegExp(t).test(e.value):!0}function _n(e,t){return!en(e)||t!==!0||tn(e)}function vn(e,t){return!en(e)||!tn(e)||typeof t!=`number`||e.files[0].size>=t}function yn(e,t){return!en(e)||!tn(e)||typeof t!=`number`||e.files[0].size<=t}function bn(e,t){if(!en(e)||!tn(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 xn(e,t,n,r,i,a=``){n.dataset.valid=`false`;let o=a||e?.messages[r]?.[i]||``;if(!o)return;t.message=o;let s=Qt(n);if(!s)return;let c=J(`[data-validator-help]`,s).find(e=>e.dataset.validatorHelp===r)||null;c||(c=f(`div`,{"data-valid":`false`,"data-validator-help":r}),s.appendChild(c)),c.className=K(e?.className.help),c.dataset.valid=`false`,c.textContent=o}function Sn(e){let t=Qt(e);if(t)for(let n of J(`[data-validator-help]`,t))n.dataset.validatorHelp===e.name&&n.remove();e.removeAttribute(`data-valid`)}function Cn(e,t={},n=!1){U(`bindEvents`,n,`boolean`,`Validator`);let r=Se(e);if(!(r instanceof HTMLFormElement))throw Error(`Validator.element expects a form element.`);let i=r,a=Jt(t),o=i.noValidate,s=Zt(),c=Me(),l=new Set,u,d=()=>{i&&(i.noValidate=a?.vanilla===!1)},f=(e,t)=>{if(typeof t!=`function`)return!0;let n=t(e,u);return typeof n==`string`?n:!!n},p=(e,t)=>{let n=a?.rules[t];if(!n)return!0;for(let r of Object.keys(n)){let o=n[r],c=``;switch(r){case`required`:s.valid=nn(e,o);break;case`minLength`:s.valid=rn(e,o);break;case`maxLength`:s.valid=an(e,o);break;case`equalTo`:s.valid=sn(i,e,o);break;case`email`:s.valid=on(e);break;case`checked`:s.valid=cn(e,o);break;case`selected`:s.valid=ln(e,o);break;case`multiple`:s.valid=un(e,o);break;case`min`:s.valid=pn(i,e,o);break;case`max`:s.valid=mn(i,e,o);break;case`noSpace`:s.valid=hn(e,o);break;case`noChinese`:s.valid=!/[\u4e00-\u9fa5]/.test(e.value);break;case`noSpecial`:s.valid=!/[@#$%^&*]+/g.test(e.value);break;case`pattern`:s.valid=gn(e,o);break;case`file`:s.valid=_n(e,o);break;case`minSize`:s.valid=vn(e,o);break;case`maxSize`:s.valid=yn(e,o);break;case`accept`:s.valid=bn(e,o);break;case`validate`:{let t=f(e,o);s.valid=t===!0,c=typeof t==`string`?t:``;break}}if(!s.valid){s.error=!0,l.add(t),xn(a,s,e,t,r,c);break}Sn(e)}return s.valid&&l.delete(t),s.valid},m=e=>{if(!a||s.destroyed||!e.name||!a.rules[e.name])return!0;let t=p(e,e.name);return t&&l.size===0&&(s.valid=!0,s.error=!1,s.message=``),t},h=()=>{if(!i||!a||s.destroyed)return!1;s.valid=!0,s.error=!1,s.message=``,l.clear();for(let e of Array.from(i.elements))if(!(!Yt(e)||!e.name)&&a.rules[e.name]&&(s.valid=p(e,e.name),!s.valid))break;return s.valid&&a.onSubmit?.(u),s.valid},g=e=>{if(!s.error)return;let t=e.target;!(t instanceof Element)||!Yt(t)||!t.name||!l.has(t.name)||m(t)},_=({native:e=!0}={})=>{if(i){e&&i.reset();for(let e of Array.from(i.elements))Yt(e)&&e.removeAttribute(`data-valid`);for(let e of J(`[data-validator-help]`,i))e.remove();s.valid=!0,s.error=!1,s.message=``,l.clear()}};return u={get element(){return i},get props(){return a},set props(e){a=e,d()},runtime:s,validate:h,reset:_,destroy:()=>{s.destroyed||(s.destroyed=!0,c.clear(),_({native:!1}),i&&(i.noValidate=o),i=null,a=null,s.valid=!1,s.error=!1,s.message=``,l.clear())}},n&&(c.on(`submit`,i,`submit`,e=>{e.preventDefault(),h()}),c.on(`reset`,i,`reset`,()=>_({native:!1}))),c.on(`input`,i,`input`,g),c.on(`change`,i,`change`,g),d(),u}let wn=null;function Tn(e){let t=e.split(`,`),n=t[0].match(/:(.*?);/);if(!n)return;let r=n[1],i=atob(t[1]),a=i.length,o=new Uint8Array(a);for(let e=0;e<a;e++)o[e]=i.charCodeAt(e);return new Blob([o],{type:r})}function En(e){let{quality:t=.7,width:n,height:r}=e??{},i={quality:t,width:n,height:r};return{canvasDataURL(e,t){let n=new Image;n.src=e,n.onload=e=>{let n=e.target,{width:r,height:a}=n,o=r/a,s=i.width??r,c=i.height??s/o,l=document.createElement(`canvas`),u=l.getContext(`2d`);l.width=s,l.height=c,u?.drawImage(n,0,0,s,c),t(l.toDataURL(`image/jpeg`,i.quality))}},photoCompress(e,t){let n=new FileReader;n.readAsDataURL(e),n.onload=e=>{let n=e.target?.result;this.canvasDataURL(n,t)}},convertBase64UrlToBlob:Tn}}function Dn(e,t=!0){if(t&&wn)return wn;let n=En(e);return t&&(wn=n),n}function On(e){return wn||=En(e),wn}function kn(){wn=null}function An(e,t={}){let n,r=t.removeOnDispose!==!1,i=s(t=>(n=m(e),r&&p(()=>n.remove()),t));return{element:n,dispose:i}}function jn(...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 Mn(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 Nn(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 Pn(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),Nn(o,t)),await Mn(n,a),a?.aborted)};return{enter:e=>a(1,e),leave:e=>a(-1,e),cancel(){n?.cancel(),n=null}}}function Fn(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=Nn(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 Mn(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 In(e){return e.filter(e=>e!=null&&e.isConnected)}function Ln(e){e[0]?.getBoundingClientRect()}function Rn(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 zn(e){return e.split(`,`).map(e=>{let t=Number.parseFloat(e);return Number.isFinite(t)?t:0})}function Bn(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 Vn(e){let t=e.ownerDocument.defaultView;if(!t)return 0;let n=t.getComputedStyle(e),r=Bn(Rn(n.transitionDuration),Rn(n.transitionDelay),[1],n.transitionProperty.split(`,`).map(e=>e.trim()!==`none`)),i=Bn(Rn(n.animationDuration),Rn(n.animationDelay),zn(n.animationIterationCount),n.animationName.split(`,`).map(e=>e.trim()!==`none`));return Math.max(r,i)}function Hn(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 Un(e,t){let n=new Set,r=0;for(let t of e){if(typeof t.getAnimations!=`function`){r=Math.max(r,Vn(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(Hn(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 Wn(e){let t=`hidden`,n=0,r=null,i=null,a=null,o=()=>(a?.abort(),a=new AbortController,a.signal);return{get phase(){return t},enter:()=>{if(t===`visible`)return Promise.resolve(!1);if(t===`entering`&&r)return r;let i=++n,a=o();return t=`entering`,r=(async()=>{e.mount();let r=In(e.elements());return Ln(r),u(e.activate),e.motion?await e.motion.enter(a):await Un(r,a),i===n&&(t=`visible`,!0)})(),r},leave:()=>{if(t===`hidden`)return Promise.resolve(!1);if(t===`leaving`&&i)return i;let r=++n,a=o();return t=`leaving`,i=(async()=>{u(e.deactivate);let i=In(e.elements());return e.motion?await e.motion.leave(a):await Un(i,a),r===n&&(e.unmount(),t=`hidden`,!0)})(),i},cancel(){n+=1,a?.abort(),a=null,e.motion?.cancel(),t=`hidden`,r=null,i=null}}}const Gn={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 Kn(e){let t=W(e,Gn,`Popup`);return{className:t.className,position:t.position,component:t.component,labelledby:t.labelledby,content:t.content}}function qn(e={}){let{className:t,position:n,component:r,labelledby:i,content:a}=Kn(e),o={className:`${t} is-${n}`,role:`dialog`,children:G(a)};return r&&(o[`data-${r}`]=`root`,o[`aria-${r}`]=`true`),i&&(o[`aria-labelledby`]=i),f(`div`,o)}const Jn={root:`j-drop`,container:`drop-container`},Yn={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:0,type:`number`,min:0},content:{default:``,type:`renderable`},cache:{default:!1,type:`boolean`},ttl:{default:0,type:`number`,min:0},className:{default:Jn,type:`object`,normalize:e=>({...Jn,...e&&typeof e==`object`?e:{}})},id:{default:null,types:[`string`,`null`],normalize:e=>typeof e==`string`?e.trim()||Y():e??Y()},delay:{default:0,types:[`number`,`object`]},hoverIntent:{default:!0,type:`boolean`},onShown:{default:null,types:[`function`,`null`]},onHidden:{default:null,types:[`function`,`null`]}};function Xn(e){let t=W(e,Yn,`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 Zn(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 Qn(e){return typeof e==`number`&&e>0?e:0}function $n(e,t={}){let n=Se(e),r=Xn(t),i=Me(),a=Zn(r.delay),o={show:null,hide:null},l={x:0,y:0,lastMoveTime:0},u=0,p=0,m=!1,h=!1,g,_=null,v=null,y=0,b=()=>{},[x,S]=c(typeof r.content==`function`?null:r.content),[C,w]=c(!1),T=()=>{if(C())return j();let e=x();return typeof e==`function`?e(g):e},{root:E}=s(e=>{b=e;let t=f(`div`,{className:r.className.container,"data-drop-container":r.name||r.id,"aria-live":()=>typeof r.content==`function`?`polite`:null,"aria-busy":()=>String(C()),children:()=>G(T())});return{root:f(`div`,{className:r.className.root,id:r.id,"data-drop":r.name||Y(),"aria-expanded":`false`,children:t})}}),D=e=>{o[e]&&clearTimeout(o[e]),o[e]=null},O=async()=>{let e=r.content;if(typeof e!=`function`){S(e);return}let t=Qn(r.ttl);if(r.cache&&_&&(!t||Date.now()-_.updatedAt<=t)){S(_.content);return}if(v)return v;let n=++y;w(!0);let i=Promise.resolve().then(()=>e(g)).then(e=>{h||n!==y||(r.cache&&(_={content:e,updatedAt:Date.now()}),S(e))}).finally(()=>{n===y&&!h&&w(!1),v===i&&(v=null)});return v=i,i},k=()=>{if(!n)return;let e=n.getBoundingClientRect(),{offset:t,position:i}=r;E.style.visibility=`hidden`,E.style.display=`block`;let a=E.getBoundingClientRect(),o=0,s=0,c=i;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}o=Math.max(8,Math.min(o,window.innerHeight-a.height-8)),s=Math.max(8,Math.min(s,window.innerWidth-a.width-8)),E.style.top=`${o+window.scrollY}px`,E.style.left=`${s+window.scrollX}px`,E.style.visibility=``,E.style.display=``},A=e=>{h||m===e||(e?(E.parentNode||d(document.body,E),k(),O().then(()=>{m&&!h&&k()})):(y+=1,v=null,w(!1),E.style.top=``,E.style.left=``,E.remove()),E.setAttribute(`aria-expanded`,e?`true`:`false`),m=e,e?r.onShown?.(g):r.onHidden?.(g))},M=e=>{e.target instanceof Node&&n&&!E.contains(e.target)&&!n.contains(e.target)&&g.hide()},N=e=>{e instanceof MouseEvent&&(u=e.clientX,p=e.clientY,l.lastMoveTime=Date.now(),l.x=e.clientX,l.y=e.clientY)},P=()=>{i.on(`document:mousemove`,document,`mousemove`,N),D(`show`),o.show=setTimeout(()=>{let e=Date.now()-l.lastMoveTime;Math.abs(l.x-u)+Math.abs(l.y-p)<5||e>100?(g.show(!1),i.off(`document:mousemove`)):P()},a.show)};return g={get target(){return n},props:r,get element(){return h?null:E},get isVisible(){return m},delayShow:a.show,delayHide:a.hide,show(e=!0){D(`hide`),!(m||h)&&(e&&a.show>0?(D(`show`),o.show=setTimeout(()=>A(!0),a.show)):A(!0))},hide(e=!0){D(`show`),!(!m||h)&&(e&&a.hide>0?(D(`hide`),o.hide=setTimeout(()=>A(!1),a.hide)):A(!1))},toggle(){m?g.hide():g.show()},destroy(){h||(h=!0,D(`show`),D(`hide`),i.clear(),y+=1,v=null,w(!1),E.remove(),b(),n=null,m=!1)}},n&&(r.mode===`hover`?(i.on(`target:enter`,n,`mouseenter`,()=>{r.hoverIntent?P():g.show()}),i.on(`target:leave`,n,`mouseleave`,()=>{D(`show`),i.off(`document:mousemove`),g.hide()}),i.on(`root:enter`,E,`mouseenter`,()=>g.show()),i.on(`root:leave`,E,`mouseleave`,()=>g.hide())):(i.on(`target:click`,n,`click`,()=>g.toggle()),i.on(`document:click`,document,`click`,M))),g}const er={container:`j-tooltip`,message:`el-text`,ui:{reverse:`is-reverse`,primary:`is-primary`,success:`is-success`,warning:`is-warning`,error:`is-error`}};function tr(e){let t=e&&typeof e==`object`?e:{},n=`ui`in t&&t.ui&&typeof t.ui==`object`?t.ui:{};return{...er,...t,ui:{...er.ui,...n}}}const nr={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:0,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:er,type:`object`,normalize:tr},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 rr(e){let t=W(e,nr,`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 ir(e,t={}){let n=rr(t),r=f(`div`,{className:K(n.className.container,n.theme&&n.className.ui[n.theme]),"data-tooltip":n.name||n.id||``,children:f(`div`,{className:n.className.message,"data-tooltip-message":``,children:n.message})}),i=$n(e,{name:n.name,mode:n.mode,position:n.position,offset:n.offset,cache:n.cache,ttl:n.ttl,id:n.id,delay:n.delay,hoverIntent:n.hoverIntent,onShown:n.onShown,onHidden:n.onHidden,content:r});return{get element(){return i?.element||null},get drop(){return i},show(e=!0){i?.show(e)},hide(e=!0){i?.hide(e)},toggle(){i?.toggle()},destroy(){i?.destroy(),i=null}}}const ar={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`},or={mode:`dark`,theme:`indigo`,radius:`sm`,shadow:`sm`,font:`sm`,key:`ui-theme`,className:ar},sr={theme:`j-theme-`,radius:`j-radius-`,shadow:`j-shadow-`,font:`j-font-`};function cr(e){return{...ar,...e}}function lr(e={}){return{...or,...e,className:cr(e.className)}}function ur(e){return e===`mode`||e===`theme`||e===`radius`||e===`shadow`||e===`font`}function dr(){return _({driver:`cookie`,codec:`json`,namespace:``,keySeparator:``,driverOptions:{path:`/`,sameSite:`Lax`,secure:typeof location<`u`&&location.protocol===`https:`},ttl:6048e5})}function fr(e){if(!N(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 pr(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 mr(e={}){let t=i(lr(e)),a={configVersion:0,destroyed:!1},o=dr(),c=new Set,l=Me(),d=()=>window.matchMedia?.(`(prefers-color-scheme: dark)`).matches?`dark`:`light`,p=()=>{let{mode:e,theme:n,radius:r,shadow:i,font:a}=t,s={mode:e,theme:n,radius:r,shadow:i,font:a,render:e===`auto`?d():e};o.set(t.key,s).catch(()=>{})},m=e=>{let i=s(i=>{for(let i of J(`[data-theme-group]`,e)){let e=i.dataset.themeGroup;if(ur(e))for(let a of J(`[data-theme-button]`,i)){let i=()=>a.dataset.themeValue===String(t[e]);r(a,t.className.active,i),n(a,`aria-selected`,()=>i()?`true`:null)}}return i});c.add(i)},h=(e=null,n=null)=>{let r=t.className,i=n||pr(y),a=f(`div`,{className:e||r.panel,"data-theme-palette":`root`,children:[f(`h3`,{className:r.title,"data-theme-title":``,style:{margin:`0 0 1rem`},children:y(`t`)}),f(`div`,{className:r.container,"data-theme-container":``,children:i.map(e=>f(`div`,{className:r.item,"data-theme-group":e.type,children:[f(`div`,{className:r.itemTitle,"data-theme-group-title":e.type,children:e.title}),f(`div`,{className:r.items,"data-theme-items":e.type,children:e.buttons.map(([n,i])=>{let a=String(t[e.type])===String(n);return f(`button`,{className:K(r.button,a&&r.active),"data-action":`customTheme`,"data-theme-button":e.type,"data-theme-value":n,"aria-selected":a?`true`:null,children:[e.type===`theme`?f(`span`,{className:K(r.prefix,r.swatch),"data-theme-swatch":n,style:{backgroundColor:`var(--ui-${n})`}}):null,f(`span`,{className:r.buttonText,"data-theme-button-text":n,children:i})]})})})]}))})]});return m(a),a},g=e=>{a.configVersion+=1,u(()=>{Object.assign(t,e,{className:cr({...t.className,...e.className})})}),p()},_=()=>{if(!a.destroyed){a.destroyed=!0,l.clear();for(let e of c)e();c.clear(),o.close().catch(()=>{})}};l.on(`palette`,document.body,`click`,e=>{if(!(e.target instanceof Element))return;let n=e.target.closest(`[data-theme-button]`),r=(n?.closest(`[data-theme-group]`))?.dataset.themeGroup,i=n?.dataset.themeValue;if(!n||!ur(r)||!i||n.classList.contains(t.className.active))return;let o=t[r];a.configVersion+=1,u(()=>{t[r]=i});let s=document.documentElement;if(r===`mode`)s.classList.remove(`light`,`dark`,o),s.classList.add(i===`auto`?d():i);else{let e=sr[r],t=Array.from(s.classList).filter(t=>t.startsWith(e));t.length&&s.classList.remove(...t),s.classList.add(`${e}${i}`)}p()});let v=a.configVersion;return o.get(t.key).then(e=>{if(a.destroyed||a.configVersion!==v)return;let n=fr(e);n&&u(()=>{Object.assign(t,n)})}).catch(()=>{}),{props:t,createPanel:h,setConfig:g,destroy:_}}const hr={color:`var(--tone-solid)`,size:`12px`},gr={ball:`parabola-ball`},_r={types:[`string`,`Node`,`array`,`null`,`undefined`]},vr={ball:{default:hr,type:`plainObject`,normalize:e=>({...hr,...e&&typeof e==`object`?e:{}}),shape:{color:`string`,size:`string`}},className:{default:gr,type:`object`,normalize:e=>({...gr,...e&&typeof e==`object`?e:{}})},from:{default:null,..._r},to:{default:null,..._r},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 yr(e){let t=W(e,vr,`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 br(e={}){let t=yr(e),n={destroyed:!1},r=new Set,i=new Map,a=new Map,o=null,s=Se(t.from),c=Se(t.to),l,u=()=>{if(!n.destroyed){if(o){o.isConnected||d(document.body,o);return}o=f(`div`,{"data-parabola":`root`,style:{position:`fixed`,inset:`0`,pointerEvents:`none`,zIndex:`9999`}}),d(document.body,o)}},p=()=>{r.size>0||(o?.remove(),o=null)},m=(e,n)=>{if(!r.has(e))return;let i=a.get(e);i!==void 0&&cancelAnimationFrame(i),a.delete(e),e.remove(),r.delete(e),n&&t.onHidden?.(l),p()},h=e=>{if(n.destroyed||(u(),!o))return null;let{color:i,size:a}=t.ball,s=f(`div`,{className:t.className.ball,"data-parabola":`ball`,style:{backgroundColor:i,width:a,height:a,position:`fixed`,borderRadius:`50%`,transform:`translate(-50%, -50%)`,pointerEvents:`none`,zIndex:`9999`,opacity:`1`,left:`${e.startX}px`,top:`${e.startY}px`}});return d(o,s),r.add(s),s},g=()=>{let e=s?.getBoundingClientRect(),n=c?.getBoundingClientRect();if(!e||!n)return null;let{left:r,top:i,width:a,height:o}=e,{left:l,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=l+d/2,g=u+f/2;return{startX:p,startY:m,endX:h,endY:g}},_=(e,t,r,i,o,s=800)=>{if(!e.isConnected)return;let c=performance.now(),l=i-t,u=o-r,d=i=>{if(n.destroyed||!e.isConnected){a.delete(e);return}let o=i-c,f=Math.min(o/s,1),p=1-(1-f)**3,h=t+l*p,g=r+-100*Math.sin(Math.PI*p)+u*p,_=1-f;e.style.left=`${h}px`,e.style.top=`${g}px`,e.style.opacity=`${_}`,e.style.transform=`translate(-50%, -50%) scale(${1-p*.3})`,f<1?a.set(e,requestAnimationFrame(d)):(a.delete(e),m(e,!0))};a.set(e,requestAnimationFrame(d))},v=(e,n)=>{let r=`parabola-show-${Y()}`;i.set(r,n),Be.start(r,t.showDelay,()=>{i.delete(r),e()})},y=()=>{for(let[e,t]of i)Be.cancel(e),t();i.clear()};return l={props:t,runtime:n,get element(){return o},show(){return n.destroyed?Promise.resolve(!1):new Promise(e=>{v(()=>{if(n.destroyed){e(!1);return}s=Se(t.from),c=Se(t.to);let r=g();if(!r){e(!1);return}let i=h(r);if(!i){e(!1);return}t.onShow?.(l),_(i,r.startX,r.startY,r.endX,r.endY),e(!0)},()=>e(!1))})},destroy(){if(!n.destroyed){y(),s=null,c=null,n.destroyed=!0;for(let e of r)m(e,!1);a.clear(),p()}}},l}const xr={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 Sr(e){let t=W(e,xr,`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 Cr(e){let t=e.filter(e=>e instanceof HTMLElement);return Array.from(new Set(t))}function wr(e){return e===!1||e==null?null:we(e,`Sticky.parent`,`element`)}function Tr(e,t){if(e===!1||e==null)return[];if(typeof e==`string`){if(!t)return Cr(we(e,`Sticky.target`,`array`));let n=Cr(J(e,t));if(n.length===0)throw Error(`Sticky.target: target not found.`);return n}let n=Cr(we(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 Er(e={}){let t=Sr(e),n=i({items:[]}),r={built:!1,destroyed:!1,reBuilding:!1,reBuildFrameId:0},a={originalStyles:new Map,keys:new WeakMap},o=null,s=[],c=null,l,d=e=>e.length<=t.max?e:t.overflow===`ignore`?[]:e.slice(-t.max),f=()=>{for(let e of a.originalStyles.values())p(e)},p=e=>{e.element.style.position=e.originalPosition,e.element.style.top=e.originalTop,e.element.style.zIndex=e.originalZIndex},m=(e,t)=>{if(e.id)return e.id;let n=a.keys.get(e);if(n)return n;let r=`sticky-${Y()}-${t}`;return a.keys.set(e,r),r},h=e=>{a.originalStyles.has(e)||a.originalStyles.set(e,{element:e,originalPosition:e.style.position,originalTop:e.style.top,originalZIndex:e.style.zIndex})},g=()=>d(Tr(t.target,o)),_=(e=t.top)=>{let r=e,i=[],o=new Set(s);for(let[e,t]of a.originalStyles)o.has(e)||(p(t),a.originalStyles.delete(e));return s.forEach((e,n)=>{h(e),e.style.position=`sticky`,e.style.top=`${r}px`,i.push({key:m(e,n),index:n,top:r}),r+=e.offsetHeight+t.gap}),u(()=>{n.items=i}),t.onReBuild?.(l),r},v=()=>{if(c?.disconnect(),c=null,!t.reactive)return;let e=o||document.body;c=new MutationObserver(()=>{r.reBuilding||r.destroyed||!r.built||(r.reBuilding=!0,r.reBuildFrameId=requestAnimationFrame(()=>{r.reBuilding=!1,r.reBuildFrameId=0,l.reBuild()}))}),c.observe(e,{childList:!0,subtree:!0})};return l={props:t,state:n,runtime:r,build:()=>{if(r.destroyed)throw Error(`Sticky.build: instance destroyed`);return r.built?l:(o=wr(t.parent),s=g(),r.built=!0,v(),s.length===0?(u(()=>{n.items=[]}),l):(_(),l))},reBuild:()=>(!r.destroyed&&r.built&&(s=g(),_()),l),destroy:()=>{r.destroyed||(r.reBuildFrameId&&cancelAnimationFrame(r.reBuildFrameId),c?.disconnect(),c=null,f(),r.destroyed=!0,r.built=!1,r.reBuilding=!1,r.reBuildFrameId=0,a.originalStyles.clear(),s=[],o=null)}},l}const 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},n=new Map,r=new Set,i=new Map,a=null,o=null,s,c=n=>{if(t.destroyed)throw Error(`${e.name}.${n}: instance destroyed`)},l=(e,...t)=>{for(let r of n.get(e)||[])try{r(...t)}catch{}},d={props:e.props,state:e.state,runtime:t,get element(){return a},own(e){e&&r.add(e)},assertActive:c,emit:l},f={props:e.props,state:e.state,runtime:t,get element(){return a},build(){if(c(`build`),t.built)return s;let n=An(()=>e.view(d),{removeOnDispose:e.ownsElement});return a=n.element,o=n.dispose,t.built=!0,e.onBuild?.(d),l(`build`,s),s},mount(n){if(c(`mount`),t.built||s.build(),!a)throw Error(`${e.name}.mount: view did not create an element.`);return a.parentNode!==n&&n.appendChild(a),t.mounted=!0,e.onMount?.(d),l(`mount`,s,n),s},unmount(){return c(`unmount`),!t.mounted&&!a?.parentNode?s:(e.onUnmount?.(d),e.ownsElement!==!1&&a?.remove(),t.mounted=!1,l(`unmount`,s),s)},setState(t={},n){c(`setState`);let r=typeof t==`string`&&arguments.length>1?{[t]:n}:t;if(!N(r))throw Error(`${e.name}.setState: expects a plain object patch.`);let i=e.normalizeStatePatch?e.normalizeStatePatch(r):r;if(!N(i))throw Error(`${e.name}.setState: expects a plain object patch.`);if(e.validateStatePatch)e.validateStatePatch(i,e.state);else for(let t of Object.keys(i))if(!Object.hasOwn(e.state,t))throw Error(`${e.name}.setState: "${t}" is not a supported state key.`);return u(()=>{Object.assign(e.state,i)}),s},own(e){return e&&r.add(e),s},use(e,t){if(!e)return s;let n=typeof e==`function`?e(s,t):e.install(s,t);return i.set(e,n),s},on(e,t){if(!e||typeof t!=`function`)return s;let r=n.get(e);return r||(r=new Set,n.set(e,r)),r.add(t),s},off(e,t){return n.get(e)?.delete(t),s},emit(e,...t){return l(e,...t),s},destroy(){if(!t.destroyed){t.destroyed=!0,e.onDestroy?.(d),l(`destroy`,s);for(let e of r)try{Ar(e)}catch{}r.clear();for(let e of i.values())try{Ar(e)}catch{}i.clear(),o?.(),o=null,e.ownsElement!==!1&&a?.remove(),a=null,t.built=!1,t.mounted=!1,n.clear()}}};s=Object.assign(f,e.actions||{});for(let e of Dr.values())s.use(e);return s}const 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=W(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-${Y()}-${t}`,{id:e.id,text:e.textContent||``,level:Pr(e)}}function Ir(t={}){let n=Nr(t),r=i({items:[],current:{index:-1,item:null}}),a={ticking:!1,frameId:0,refreshing:!1,refreshFrameId:0},s=Me(),c=null,l=[],d=null,p,m=o(()=>r.items),h=e=>{if(e===r.current.index)return;let t=r.items[e]||null;u(()=>{r.current={index:e,item:t}}),n.onChange?.(t,e,p)},g=()=>{if(!p.runtime.built)return;let e=-1,t=n.offset+1;for(let n=l.length-1;n>=0;n--)if(l[n].getBoundingClientRect().top<=t){e=n;break}h(e)},_=()=>{a.ticking||(a.ticking=!0,a.frameId=requestAnimationFrame(()=>{a.ticking=!1,a.frameId=0,g()}))},v=()=>{a.refreshing||(a.refreshing=!0,a.refreshFrameId=requestAnimationFrame(()=>{a.refreshing=!1,a.refreshFrameId=0,b()}))},y=(e,{activeIndex:t=-1,updateHash:r=!1}={})=>{let i=l.find(t=>t.id===e.id);if(!i)return;let a=window.scrollY||window.pageYOffset||0,o=Math.max(0,i.getBoundingClientRect().top+a-n.offset);window.scrollTo({top:o,behavior:`smooth`}),t>=0&&h(t),r&&window.history?.pushState&&window.history.pushState(null,``,`#${e.id}`)},b=()=>{if(p.runtime.destroyed||!p.runtime.built||!c)return;l=J(n.headings,c);let e=l.map(Fr);u(()=>{r.items=e,r.current={index:-1,item:null}}),g()};return p=Q({name:`Toc`,props:n,state:r,actions:{activate:e=>(p.runtime.built&&Number.isInteger(e)&&e>=0&&e<r.items.length&&y(r.items[e]),p)},view:()=>f(`nav`,{className:n.className.toc,"data-toc":`root`,children:f(`div`,{className:n.className.list,"data-toc-list":`root`,children:e({each:m,key:e=>e.id,children:(e,t)=>f(`a`,{className:()=>{let i=e();return K(n.className.link,`${n.className.levelPrefix}${i.level}`,r.current.index===t()?n.className.active:``)},href:()=>`#${e().id}`,"data-toc-index":()=>String(t()),"data-toc-target":()=>e().id,"data-active":()=>r.current.index===t()?`1`:`0`,onClick:n=>{n.preventDefault(),y(e(),{activeIndex:t(),updateHash:!0})},children:()=>e().text})})})}),onBuild(e){c=we(n.target,`Toc.target`),s.on(`scroll`,window,`scroll`,_,{passive:!0}),e.own(()=>s.clear()),b(),n.reactive&&(d=new MutationObserver(v),d.observe(c,{childList:!0,subtree:!0,characterData:!0}),e.own(()=>{d?.disconnect(),d=null}))},onDestroy(){a.frameId&&cancelAnimationFrame(a.frameId),a.refreshFrameId&&cancelAnimationFrame(a.refreshFrameId),a.frameId=0,a.refreshFrameId=0,a.ticking=!1,a.refreshing=!1,d?.disconnect(),d=null,c=null,l=[]}}),p}const 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()||Y():e??Y()},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=W(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&&U(String(t),e,Rr,`Accordion.data`);let r=e,i=typeof r.name==`string`?r.name.trim():``;return{...r,name:i||Y()}}function Wr(e,t=!0){t&&U(`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(t){let n=Hr(t),r=Gr(n.active,n.data,n.multiple),o=i({data:n.data,activeNames:r,loading:!1}),s=new WeakMap,l=Wt(),d=Wt(),m=new Map,h=new Map,g=new Map,_=new Set(r),v=Promise.resolve(),y=0,b=0,x=!1,S,C=e=>(typeof e.name==`string`?e.name.trim():``)||(s.has(e)||s.set(e,Y()),s.get(e)),w=()=>{let e=o.data.map(e=>({...e,name:C(e)}));return qr(Kr(o.activeNames,e,n.multiple),e)},T=e=>o.activeNames.includes(e),D=()=>{b+=1,!x&&!S.runtime.destroyed&&(x=!0,u(()=>{o.loading=!0}))},O=()=>{b=Math.max(0,b-1),b===0&&x&&!S.runtime.destroyed&&(x=!1,u(()=>{o.loading=!1}))},k=e=>typeof e==`number`?e:typeof e==`string`?o.data.findIndex(t=>C(t)===e):-1,A=e=>{let t=new Set(e),n=new Set([..._,...t]),r=[];for(let e of n){let n=_.has(e),i=t.has(e);if(n===i)continue;let a=d.get(e);a&&(a.inert=!i);let o=m.get(e);o&&r.push(i?o.enter():o.leave())}return _=t,r.length>0&&(v=Promise.all(r).then(()=>void 0)),v},M=e=>t=>{d.bind(e)(t),m.get(e)?.cancel();let r=Fn(()=>d.get(e),{axis:n.direction,options:{duration:250,easing:`ease`}});m.set(e,r);let i=T(e);t.inert=!i,r.setExpanded(i),p(()=>{m.get(e)===r&&(r.cancel(),m.delete(e),_.delete(e),o.activeNames.includes(e)&&u(()=>{o.activeNames=o.activeNames.filter(t=>t!==e)}))})},N=async e=>{if(S.runtime.destroyed)throw Error(`Accordion.activate: instance destroyed`);if(!S.runtime.built)throw Error(`Accordion.activate: call build() first.`);let t=k(e),r=o.data[t];if(!r)return;let i=C(r),a=T(i);if(a&&!n.multiple&&!n.collapsible)return;let s;if(n.multiple){if(a){let e=o.activeNames.filter(e=>e!==i);s=!n.collapsible&&e.length===0?[...o.activeNames]:e}else s=[...o.activeNames,i]}else s=a?n.collapsible?[]:[...o.activeNames]:[i];u(()=>{o.activeNames=s});let c=A(s),f=s.includes(i)&&g.get(i)?.()||Promise.resolve(),p=l.get(i),m=d.get(i),h=n.onChange&&p&&m?f.then(()=>n.onChange?.(t,i,p,m,S)):Promise.resolve();await Promise.all([c,h])},P=(e,t,n)=>{let r=C(e);return{accordion:S,item:e,index:t,type:n,active:T(r)}},F=(e,t,n)=>typeof e==`function`?e(P(t,n,`title`)):e,I=(e,t,n)=>{let r=e().content,[i,o]=c(typeof r==`function`?null:r),[s,l]=c(!1),u=r,d=0,f=null,m=()=>P(e(),t(),`content`),_=async()=>{let t=e(),r=t.content;if(typeof r!=`function`){o(r);return}let i=t.cache?h.get(n):null,a=Jr(t.ttl);if(i&&(!a||Date.now()-i.updatedAt<=a)){o(i.content);return}if(f)return f;let s=++d;y+=1;let c=y;l(!0),D();let u=Promise.resolve().then(()=>r(m())).then(t=>{s!==d||S.runtime.destroyed||(e().cache&&h.set(n,{content:t,updatedAt:Date.now()}),o(t))}).finally(()=>{s===d&&!S.runtime.destroyed&&l(!1),c<=y&&O(),f===u&&(f=null)});return f=u,u};return g.set(n,_),p(()=>{d+=1,h.delete(n),g.delete(n),f=null}),a(()=>{let t=e().content;t!==u&&(u=t,d+=1,f=null,h.delete(n),o(typeof t==`function`?null:t)),T(n)&&_()}),{loading:s,isAsync:()=>typeof e().content==`function`,render:()=>{if(s())return j(`flex-start`,`flex-start`);let e=i();return typeof e==`function`?e(m()):e}}},L=(e,t)=>{let r=C(e()),i=I(e,t,r),a=`${n.id}_header_${r}`,o=`${n.id}_panel_${r}`;return[f(`div`,{className:n.className.header,id:a,"data-accordion-header":r,role:`button`,tabindex:`0`,"aria-controls":o,"aria-expanded":()=>T(r)?`true`:`false`,ref:l.bind(r),onClick:()=>void N(r),onKeyDown:e=>{e instanceof KeyboardEvent&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),N(r))},children:[f(`span`,{className:n.className.title,"data-accordion-title":r,role:`heading`,children:()=>{let n=e();return G(F(n.title,n,t()))}}),f(`span`,{className:n.className.arrow,"data-accordion-arrow":r,children:E(`arrow-down`)})]}),f(`div`,{className:n.className.panel,"data-accordion-panel":r,id:o,role:`region`,"aria-labelledby":a,"aria-hidden":()=>T(r)?`false`:`true`,"aria-live":()=>i.isAsync()?`polite`:null,"aria-busy":()=>String(i.loading()),"data-state":()=>T(r)?`open`:`closed`,ref:M(r),children:f(`div`,{className:n.className.content,"data-accordion-content":r,children:()=>G(i.render())})})]};return S=Q({name:`Accordion`,props:n,state:o,actions:{isActive:T,getIndex:k,activate:N},normalizeStatePatch(e){return{...e,...Object.hasOwn(e,`data`)?{data:Wr(e.data)}:{}}},view:()=>{let t=f(`div`,{className:n.className.root,id:n.id,"data-accordion":`root`,"data-direction":n.direction,children:e({each:()=>o.data,key:e=>C(e),children:(e,t)=>L(e,t)})});return _=new Set(o.activeNames),a(()=>{A([...o.activeNames])}),t},onDestroy(){y+=1,b=0,x=!1,h.clear(),g.clear();for(let e of m.values())e.cancel();m.clear(),l.clear(),d.clear()}}),Object.defineProperty(S,"current",{enumerable:!0,get:w}),S}const Xr={form:`j-form`,vertical:`is-vertical`,horizontal:`is-horizontal`,itemVertical:`is-item-vertical`,itemHorizontal:`is-item-horizontal`,item:`form-field`,label:`field-legend`,required:`is-required`,control:`field-control`,helpInvalid:`is-invalid`,buttons:`form-buttons`,button:`j-button`,submitBtn:`is-primary`,resetBtn:`is-ghost`,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 is-default`,switchSlider:`switch-slider`},Zr={submit:y(`Submit`),reset:y(`Reset`)},Qr={id:{default:null,types:[`string`,`null`],normalize:e=>typeof e==`string`?e.trim()?e.trim():Y():e??Y()},vertical:{default:!0,type:`boolean`},itemVertical:{default:!0,type:`boolean`},size:{default:`md`,type:`string`},style:{default:``,types:[`string`,`object`,`null`]},fields:{default:[],type:`array`},buttons:{default:!0,types:[`boolean`,`string`]},buttonsPosition:{default:`start`,type:`string`},text:{default:Zr,type:`object`,normalize:e=>li(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,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 ii(e){return e&&typeof e==`object`?e:{value:e,text:String(e)}}function ai(e){return e==null?``:typeof e==`string`?e:typeof e==`number`||typeof e==`boolean`?String(e):e instanceof File?e.name:``}function oi(e){return e==null||Array.isArray(e)?``:typeof e==`string`||typeof e==`number`||typeof e==`boolean`?String(e):e instanceof File?e.name:``}function si(e,t){return e.name?!!e.required||!!t?.[e.name]?.required:!!e.required}function ci(e){return{...Xr,...N(e)?e:{}}}function li(e){return{...Zr,...N(e)?e:{}}}function ui(e,t){return typeof e==`function`?e(t):e}function di(e,t){if(e.removeAttribute(`style`),!t)return;if(typeof t==`string`){e.style.cssText=t;return}if(!N(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 fi(e){return e===`center`?e:`flex-${e}`}function pi(e){let t=N(e)?e:{};return{...t,vanilla:t.vanilla===!0,rules:N(t.rules)?t.rules:{},messages:N(t.messages)?t.messages:{}}}function mi(e){let t=W(e,Qr,`Form.props`),n=ni(t.fields);return{...t,id:String(t.id),vertical:!!t.vertical,itemVertical:!!t.itemVertical,size:t.size,style:t.style,fields:n,buttons:t.buttons,buttonsPosition:t.buttonsPosition,text:li(t.text),className:ci(t.className),validator:pi(t.validator),onSubmit:t.onSubmit,onReset:t.onReset}}function hi(e){return e===`password`?`current-password`:e===`email`?`email`:`on`}function gi(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null}function _i(e,t,r){n(e,t,()=>gi(r()))}function vi(e,t){return Array.isArray(e)?e.map(e=>ai(e)).includes(ai(t)):e==t}function yi(e,t,n){return n===void 0?Array.isArray(e)?e.map(e=>ai(e)).includes(ai(t)):typeof e!=`string`&&typeof e!=`boolean`&&!(e instanceof File)?!1:e===!0||ai(e)===ai(t):n}function bi(e){return e instanceof RadioNodeList?Array.from(e):[e]}function xi(t={}){let n=mi(t),r=i({fields:ni(n.fields),submitting:!1}),a={fieldIds:new Map},s=new WeakMap,[l,d]=c(0),p=new WeakMap,m=null,h,g=e=>{if(r.fields.includes(e))return e;let t=p.get(e);if(t)return t;let n=i(ti(e));return p.set(e,n),n},_=o(()=>(l(),ri(r.fields,g))),v=e=>e.id?`id:${e.id}`:e.name?`name:${e.name}`:(s.has(e)||s.set(e,Y()),s.get(e)),y=(e,t)=>{if(e.id)return`item:${e.id}`;let n=e.payload;return n&&typeof n==`object`?`${v(n)}:${e.type}`:`item:${e.type}:${t}`},b=(e,t)=>{if(e.id)return e.id;let r=e.name||t;return a.fieldIds.has(r)||a.fieldIds.set(r,`${n.id}_field_${t}`),a.fieldIds.get(r)},x=()=>{let e=h.element;if(!e)return;let t={...n.validator,onSubmit:null};if(m?.element===e){m.props=t;return}m?.destroy(),m=Cn(e,t,!1)},S=()=>m?.validate()??!0,C=()=>{let e=h.element;if(e){for(let t of Array.from(e.elements))t.classList.remove(`is-valid`,`is-invalid`),t.removeAttribute(`data-valid`);for(let t of J(`[data-field-help], [data-validator-help]`,e))(t.dataset.validatorHelp||t.classList.contains(`is-invalid`))&&t.remove()}},w=()=>{let e={};if(!h.element)return e;for(let[t,n]of new FormData(h.element).entries())e[t]=Object.hasOwn(e,t)?Array.isArray(e[t])?[...e[t],n]:[e[t],n]:n;return e},T=async e=>{if(e.preventDefault(),r.submitting||!S())return;let t=w();u(()=>{r.submitting=!0});try{await Promise.resolve(n.onSubmit?.(t,h))}finally{h.runtime.destroyed||u(()=>{r.submitting=!1})}},E=e=>{if(!e.name||!h.element)return[];let t=h.element.elements.namedItem(e.name);return t?bi(t).filter(e=>e instanceof Element):[]},D=(e,t,n=`text`)=>{u(()=>{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(n===`switch`){e.checked=t.checked,e.value=t.checked?t.value:``;return}if(n===`radio`){t.checked&&(e.value=t.value);return}if(n===`checkbox`){if(Array.isArray(e.options)){e.value=E(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)}),d(e=>e+1)},O=(e,t,n)=>({...n,name:()=>e().name,id:t,required:()=>!!e().required,disabled:()=>r.submitting||!!e().disabled,"data-field-item":()=>e().name||t}),k=()=>n.size?`is-${n.size}`:``,A=e=>{let t=e.size||n.size;return t?`is-${t}`:``},M=(e,t)=>K(e.className||t,A(e)),N=(e,t,i)=>f(`div`,{className:()=>{let t=e(),r=t.vertical?`vertical`:`horizontal`,a=n.className;return K(i===`radio`?a.radio:a.checkbox,r===`vertical`?a.choiceVertical:a.choiceHorizontal,t.group?a.choiceGroup:``,t.size?`is-${t.size}`:``)},"data-field-choice-group":()=>e().name||t,"data-choice-type":i,"data-choice-layout":()=>e().vertical?`vertical`:`horizontal`,children:()=>(e().options||[]).map((a,o)=>{let s=ii(a),c=`${t}_${o}`;return f(`label`,{className:()=>i===`radio`?n.className.radioLabel:``,"data-field-choice":()=>e().name||t,for:c,children:[f(`input`,{type:i,id:c,name:()=>e().name,value:s.value??``,checked:()=>i===`radio`?vi(e().value,s.value):yi(e().value,s.value,s.checked),disabled:()=>r.submitting||!!s.disabled||!!e().disabled,required:()=>!!e().required,onChange:t=>{let n=t.currentTarget;n instanceof HTMLInputElement&&D(e(),n,i)}}),f(`span`,{className:()=>i===`radio`?n.className.radioText:``,"data-field-choice-text":``,children:G(s.text??s.label??ai(s.value))})]})})}),P=(e,t,i,a)=>{let o=e().type;if(o===`textarea`)return f(`textarea`,O(t,i,{className:()=>t().className||n.className.textarea,placeholder:()=>t().placeholder||``,readonly:()=>!!t().readonly,ref:e=>_i(e,`autocomplete`,()=>t().autocomplete),value:()=>oi(t().value),onInput:e=>{let n=e.currentTarget;n instanceof HTMLTextAreaElement&&D(t(),n,`textarea`)}}));if(o===`select`)return f(`select`,O(t,i,{className:()=>M(t(),n.className.select),ref:e=>_i(e,`autocomplete`,()=>t().autocomplete),multiple:()=>!!t().multiple,value:()=>t().multiple?void 0:oi(t().value),onChange:e=>{let n=e.currentTarget;n instanceof HTMLSelectElement&&D(t(),n,`select`)},children:()=>(t().options||[]).map(e=>{let n=ii(e);return f(`option`,{value:n.value??``,disabled:!!n.disabled,selected:()=>vi(t().value,n.value),children:G(n.text??n.label??ai(n.value))})})}));if(o===`radio`)return N(t,i,`radio`);if(o===`checkbox`&&Array.isArray(t().options))return N(t,i,`checkbox`);if(o===`switch`)return f(`label`,{className:()=>{let e=n.className;return K(e.switch,A(t()))},"data-field-switch":()=>t().name||i,for:i,children:[f(`input`,{type:`checkbox`,id:i,name:()=>t().name,value:()=>t().value??`1`,checked:()=>!!t().checked,disabled:()=>r.submitting||!!t().disabled,required:()=>!!t().required,onChange:e=>{let n=e.currentTarget;n instanceof HTMLInputElement&&D(t(),n,`switch`)}}),f(`span`,{className:()=>n.className.switchSlider,"data-field-switch-slider":``})]});if(o===`custom`){let n=t();return typeof n.content==`function`?n.content({form:h,field:n,index:a(),item:e()}):n.content}let s=o||`text`;return f(`input`,{...O(t,i,{type:s,className:()=>M(t(),n.className.input),placeholder:()=>t().placeholder||``,readonly:()=>!!t().readonly,autocomplete:()=>t().autocomplete||hi(s),value:()=>t().value??``,onInput:e=>{let n=e.currentTarget;n instanceof HTMLInputElement&&D(t(),n,s)}}),checked:()=>{let e=t().checked;return e===void 0?void 0:!!e}})},F=(e,t)=>{let r=()=>e().payload,i=b(r(),t()),a=()=>{let t=e().type;return t===`custom`||t===`radio`||t===`checkbox`&&Array.isArray(r().options)},o=()=>{let e=r().label;return e!==!1&&e!==void 0};return f(`fieldset`,{className:()=>n.className.item,"data-form-field":()=>r().name||String(t()),style:()=>({display:e().type===`hidden`?`none`:``}),children:[()=>{if(!o())return null;let e={className:()=>K(n.className.label,si(r(),n.validator.rules)?n.className.required:``),"data-field-label":()=>r().name||i,children:()=>G(r().label)};return a()?f(`legend`,e):f(`label`,{...e,for:i})},()=>f(`div`,{className:()=>n.className.control,"data-field-control":()=>r().name||String(t()),children:[G(P(e,r,i,t)),()=>r().help?f(`div`,{className:`help-block`,"data-field-help":()=>r().name||String(t()),children:()=>G(r().help)}):null]})]})},I=(e,t)=>F(e,t),L=()=>f(`button`,{type:`submit`,className:()=>K(n.className.button,n.className.submitBtn,k()),"data-action":`submit`,disabled:()=>r.submitting,children:()=>{let e=G(ui(n.text.submit,h));return r.submitting?[j(),e]:e}}),ee=()=>f(`button`,{type:`reset`,className:()=>K(n.className.button,n.className.resetBtn,k()),"data-action":`reset`,disabled:()=>r.submitting,children:()=>G(ui(n.text.reset,h))}),R=()=>f(`div`,{className:n.className.buttons,style:{justifyContent:fi(n.buttonsPosition)},"data-field-buttons":``,children:n.buttons===`reverse`?[ee(),L()]:[L(),ee()]});return h=Q({name:`Form`,props:n,state:r,actions:{validate:S,reset(){return m?.reset(),h},collectData:w,requestSubmit(){let e=h.element;return e&&(typeof e.requestSubmit==`function`?e.requestSubmit():e.dispatchEvent(new Event(`submit`,{bubbles:!0,cancelable:!0}))),h},setFields(e){return U(`fields`,e,`array`,`Form.setFields`),a.fieldIds.clear(),p=new WeakMap,u(()=>{r.fields=ni(e)}),h},resetFields(){return a.fieldIds.clear(),p=new WeakMap,u(()=>{r.fields=ni(n.fields)}),h}},normalizeStatePatch(e){return{...e,...Object.hasOwn(e,`fields`)?{fields:ni(e.fields)}:{}}},view:()=>{let t=f(`form`,{className:K(n.className.form,n.vertical?n.className.vertical:n.className.horizontal,n.itemVertical?n.className.itemVertical:n.className.itemHorizontal,k()),id:n.id,novalidate:n.validator.vanilla===!1,"data-form":`root`,"data-form-layout":n.vertical?`vertical`:`horizontal`,"data-form-field-layout":n.itemVertical?`vertical`:`horizontal`,onSubmit:e=>void T(e),onReset:e=>{C(),n.onReset?.(e,h)},children:[e({each:_,key:y,children:I}),n.buttons===!1?null:R()]});return di(t,n.style),t},onBuild(){x()},onDestroy(){m?.destroy(),m=null,a.fieldIds.clear(),p=new WeakMap}}),h}const Si={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`},Ci={type:`plainObject`,shape:{id:{type:`string`,nonEmpty:!0}}},wi={type:`renderable`},Ti={types:[`plainObject`,`null`,`undefined`]};function $(e){return N(e)?{...e}:{}}function Ei(e){let t={};for(let n of Object.keys(e))t[n]=$(e[n]);return t}function Di(e){return{...e,history:[...e.history],data:$(e.data),stepData:Ei(e.stepData),currentData:$(e.currentData),currentStep:e.currentStep?{...e.currentStep}:null}}function Oi(e){return Array.isArray(e)?e.map(e=>{let t={...e};return delete t.description,delete t.view,{...t,data:$(t.data)}}):[]}function ki(e){return typeof e==`string`?{...Si,root:[Si.root,e.trim()].filter(Boolean).join(` `)}:{...Si,...N(e)?e:{}}}function Ai(e,t){if(typeof e==`string`)return{id:e};if(!N(e))return{id:t};let n=e;return typeof n.id==`string`?{id:n.id,data:N(n.data)||n.data==null?n.data:void 0}:{id:t,data:e}}const ji={id:{default:null,types:[`string`,`null`],normalize:e=>typeof e==`string`&&e.trim()||Y()},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=N(e)?e:{};return{back:typeof t.back==`string`?t.back:y(`b`),next:typeof t.next==`string`?t.next:y(`Next`),finish:typeof t.finish==`string`?t.finish:y(`Finish`),reset:typeof t.reset==`string`?t.reset:y(`Reset`)}}},className:{default:Si,types:[`object`,`string`],normalize:ki},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 Mi(e){let t=W(e,ji,`Flow.props`);return{id:t.id,steps:Oi(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 Ni(e={}){let t=Mi(e),n=t.steps,r=new Map;for(let[e,t]of n.entries()){if(U(String(e),t,Ci,`Flow.props.steps`),U(`content`,t.content??null,wi,`Flow.props.steps.${e}`),r.has(t.id))throw Error(`Flow.props.steps: duplicated step id "${t.id}".`);r.set(t.id,e)}let a=(()=>{if(typeof t.initial==`number`){let e=n[t.initial];if(!e)throw Error(`Flow.props.initial index is out of range.`);return e.id}if(typeof t.initial==`string`){if(!r.has(t.initial))throw Error(`Flow.props.initial step "${t.initial}" does not exist.`);return t.initial}return n[0].id})(),s={},c={};for(let e of n)s[e.id]=$(e.data),Object.assign(c,s[e.id]);let l=i({id:t.id,currentId:a,currentIndex:r.get(a)??0,previousId:null,previousIndex:null,direction:null,history:[a],data:$(c),stepData:Ei(s),loading:!1,error:null,busyAction:null,version:0}),d={built:!1,mounted:!1,destroyed:!1,activeAction:null,actionController:null},p=new Set,m=new Set,h=new Set,g=0,_=null,v=null,y,b=e=>{if(d.destroyed)throw Error(`Flow.${e}: instance has been destroyed.`)},x=e=>{if(!e)return null;let{onEnter:t,onLeave:n,onNext:r,onBack:i,canEnter:a,canLeave:o,...s}=e;return s},S=o(()=>n[l.currentIndex]),C=o(()=>l.version>=0?$(l.stepData[l.currentId]):{}),w=o(()=>x(S())),T=o(()=>n.map(x)),E=o(()=>l.currentIndex>0&&!l.loading),D=o(()=>l.currentIndex<n.length-1&&!l.loading),O=o(()=>l.currentIndex===n.length-1),k=o(()=>({id:l.id,currentId:l.currentId,currentIndex:l.currentIndex,previousId:l.previousId,previousIndex:l.previousIndex,direction:l.direction,history:[...l.history],data:$(l.data),stepData:Ei(l.stepData),currentData:C(),currentStep:w(),canBack:E(),canNext:D(),isLast:O(),loading:l.loading,busyAction:l.busyAction,error:l.error})),A=()=>S(),j=e=>$(l.stepData[e]),M=()=>Di(k()),N=(e=null)=>{let n=M();for(let t of p)t(n,y,e);t.onChange?.(n,y,e)},P=(e,t)=>{for(let t of Object.keys(e))delete e[t];Object.assign(e,t)},F=(e,n,i={})=>{if(b(`setStepData`),U(`stepId`,e,{type:`string`},`Flow.setStepData`),U(`data`,n,Ti,`Flow.setStepData`),!r.has(e))throw Error(`Flow.setStepData: step "${e}" does not exist.`);return n?(u(()=>{l.stepData[e]={...$(l.stepData[e]),...n},t.cache&&Object.assign(l.data,n),l.version+=1}),i.silent||N(),y):y},I=e=>(b(`setData`),U(`data`,e,Ti,`Flow.setData`),e?(u(()=>{Object.assign(l.data,e),l.version+=1}),N(),y):y),L=e=>{if(typeof e!=`function`)throw Error(`Flow.addCleanup: cleanup expects a function.`);return d.destroyed?(e(),()=>{}):(m.add(e),()=>m.delete(e))},ee=()=>{let e=Error(`Flow: active action was aborted.`);return e.code=`FLOW_ABORTED`,e},R=e=>e instanceof Error&&e.code===`FLOW_ABORTED`,z=e=>{if(d.destroyed||e!=null&&h.has(e))throw ee()},te=()=>{let e=_;e!=null&&h.add(e),d.actionController?.abort(),d.actionController=null,d.activeAction=null,_=null},B=async(e,t,n=_)=>{if(typeof e!=`function`)return;let r=await e(...t);return z(n),r},V=(e={})=>{let t=e.step||A();return{...e,flow:y,step:t,state:l,signal:d.actionController?.signal||null,snapshot:M(),data:$(l.data),currentData:j(t.id),setData:I,setStepData:(e,t)=>F(e,t),getStepData:j,next:e=>y.next(e),back:e=>y.back(e),goTo:(e,t,n)=>y.goTo(e,t,n),addCleanup:L}},ne=(e,n=null)=>{u(()=>{l.error=e,l.version+=1}),t.onError?.(e,M(),y,n)},re=(e,t)=>{let n=M();(l.loading!==e||l.busyAction!==t)&&(u(()=>{l.loading=e,l.busyAction=e?t:null,l.version+=1}),N(n))},ie=e=>{if(!l.loading)return null;let n=Error(`Flow: action "${e}" ignored while loading.`);if(n.code=`FLOW_BUSY`,t.onBusy?.(e,M(),y),t.busyStrategy===`throw`)throw n;return M()},H=async(e,t,n=!1)=>{let r=!n&&!l.loading,i=r?++g:_;r&&(d.actionController=new AbortController,d.activeAction=e,_=i,re(!0,e));try{z(i);let e=await t(i);return z(i),e}catch(e){if(d.destroyed||R(e))return null;throw l.error!==e&&ne(e),e}finally{i!=null&&h.delete(i),r&&!d.destroyed&&_===i&&(re(!1,null),d.activeAction=null,d.actionController=null,_=null)}},ae=()=>({currentId:l.currentId,currentIndex:l.currentIndex,previousId:l.previousId,previousIndex:l.previousIndex,direction:l.direction,history:[...l.history],data:$(l.data),stepData:Ei(l.stepData),loading:l.loading,busyAction:l.busyAction,error:l.error,version:l.version}),oe=e=>{u(()=>{l.currentId=e.currentId,l.currentIndex=e.currentIndex,l.previousId=e.previousId,l.previousIndex=e.previousIndex,l.direction=e.direction,l.history.splice(0,l.history.length,...e.history),P(l.data,e.data),P(l.stepData,e.stepData),l.loading=e.loading,l.busyAction=e.busyAction,l.error=e.error,l.version=e.version+1})},se=e=>{if(typeof e==`number`){if(!n[e])throw Error(`Flow.goTo target is out of range.`);return e}let t=r.get(e);if(t==null)throw Error(`Flow.goTo target "${e}" does not exist.`);return t},ce=async(e,n,i,a,o)=>{let s=M(),c=ae();try{if(i&&F(a.id,i,{silent:!0}),a.canLeave&&await B(a.canLeave,[V({direction:n,targetId:e.id})],o)===!1)throw Error(`Flow: step "${a.id}" blocked leaving.`);if(e.canEnter&&await B(e.canEnter,[V({direction:n,fromId:a.id,step:e})],o)===!1)throw Error(`Flow: step "${e.id}" blocked entering.`);await B(a.onLeave,[V({direction:n,step:a,targetId:e.id})],o),z(o);let t=l.currentId,c=l.currentIndex;u(()=>{l.previousId=t,l.previousIndex=c,l.currentId=e.id,l.currentIndex=r.get(e.id)??0,l.direction=n,n===`back`?l.history.pop():l.history.push(e.id),l.error=null,l.version+=1}),await B(e.onEnter,[V({direction:n,fromId:t,step:e})],o),z(o),N(s)}catch(e){throw d.destroyed||R(e)?e:(t.rollbackOnError&&oe(c),ne(e,s),e)}},le=async(e,n,r,i,a)=>{let o=e===`back`?n.onBack:n.onNext,s=e===`back`?t.onBack:t.onNext,c=V({payload:r,targetId:i});return await B(o,[c],a)??await B(s,[c],a)??i},ue=async(e,t,r={})=>H(`goTo`,async i=>{let a=se(e),o=n[a],s=A();return o.id===l.currentId?(t&&F(l.currentId,t),M()):(await ce(o,r.direction||`go`,t,s,i),M())},!!r.internal),de=e=>{let t=M();return{flow:y,snapshot:t,state:l,steps:T(),currentStep:t.currentStep,currentData:t.currentData,data:t.data,fallback:e,next:e=>y.next(e),back:e=>y.back(e),goTo:(e,t,n)=>y.goTo(e,t,n),reset:()=>y.reset()}},W=(e,n)=>{let r=t[e];return r===!1?null:typeof r==`function`?()=>l.version>=0?r(de(n)):null:n()},fe=()=>{let e=A().content;return typeof e==`function`?e(V()):e??``},K=()=>Q({name:`FlowView`,props:{},state:l,view:()=>f(`div`,{className:t.className.root,id:t.id,role:`group`,"data-flow":`root`,"aria-busy":()=>l.loading?`true`:`false`,children:[f(`div`,{className:t.className.header,"data-flow-header":``,children:G(W(`renderHeader`,()=>f(`ol`,{className:t.className.steps,"data-flow-steps":``,role:`list`,"aria-label":`Flow steps`,children:n.map((e,n)=>f(`li`,{className:()=>[t.className.step,n===l.currentIndex?t.className.active:``,n<l.currentIndex?t.className.complete:``].filter(Boolean).join(` `),"data-flow-step":e.id,"data-flow-step-index":String(n),"aria-current":()=>n===l.currentIndex?`step`:null,children:f(`button`,{type:`button`,className:t.className.stepButton,disabled:()=>t.linear&&n>l.currentIndex,"aria-current":()=>n===l.currentIndex?`step`:null,onClick:()=>{n!==l.currentIndex&&y.goTo(n)},children:[f(`span`,{className:t.className.stepIndex,"data-flow-step-number":``,children:n+1}),f(`span`,{className:t.className.stepTitle,"data-flow-step-title":``,children:e.title||e.id})]})}))})))}),f(`div`,{className:t.className.body,"data-flow-body":``,role:`region`,"aria-live":`polite`,"aria-busy":()=>l.loading?`true`:`false`,children:G(W(`renderBody`,()=>()=>l.version>=0?fe():null))}),f(`div`,{className:t.className.footer,"data-flow-footer":``,children:G(W(`renderFooter`,()=>[t.showReset?f(`button`,{type:`button`,className:[t.className.button,t.className.reset].filter(Boolean).join(` `),"data-action":`reset`,onClick:()=>y.reset(),disabled:()=>l.loading,children:t.text.reset}):null,t.showBack?f(`button`,{type:`button`,className:[t.className.button,t.className.back].filter(Boolean).join(` `),"data-action":`back`,onClick:()=>void y.back(),disabled:()=>!y.canBack,children:t.text.back}):null,t.showNext?f(`button`,{type:`button`,className:[t.className.button,t.className.next].filter(Boolean).join(` `),"data-action":`next`,onClick:()=>void y.next(),disabled:()=>l.loading,children:()=>y.isLast?t.text.finish:t.text.next}):null]))})]})});return y={props:t,steps:n,state:l,runtime:d,get element(){return v?.element||null},get currentStep(){return A()},get currentData(){return $(C())},get canBack(){return E()},get canNext(){return D()},get isLast(){return O()},build(){return b(`build`),d.built?y:(t.render&&(v||=K(),v.build()),d.built=!0,y)},mount(e){return b(`mount`),y.build(),v&&v.mount(e),d.mounted=!!v,y},unmount(){return b(`unmount`),v?.unmount(),d.mounted=!1,y},subscribe(e){if(b(`subscribe`),typeof e!=`function`)throw Error(`Flow.subscribe: handler expects a function.`);return p.add(e),e(M(),y,null),()=>p.delete(e)},snapshot:M,async next(e=null){return b(`next`),U(`payload`,e,Ti,`Flow.next`),ie(`next`)||H(`next`,async r=>{if(y.isLast)return e&&F(l.currentId,e),await B(t.onFinish,[M(),y],r),M();let i=A(),a=n[l.currentIndex+1]?.id,o=Ai(await le(`next`,i,e,a,r),a);return ue(o.id,o.data??e,{direction:`next`,internal:!0})})},async back(e=null){return b(`back`),U(`payload`,e,Ti,`Flow.back`),ie(`back`)||(y.canBack?H(`back`,async t=>{let r=A(),i=n[l.currentIndex-1]?.id,a=Ai(await le(`back`,r,e,i,t),i);return ue(a.id,a.data??e,{direction:`back`,internal:!0})}):M())},async goTo(e,t=null,n={}){return b(`goTo`),U(`payload`,t,Ti,`Flow.goTo`),ie(`goTo`)||ue(e,t,{direction:n.direction})},setData:I,setStepData:F,getStepData:j,reset(){b(`reset`);let e=M();return te(),u(()=>{l.currentId=a,l.currentIndex=r.get(a)??0,l.previousId=null,l.previousIndex=null,l.direction=null,l.history.splice(0,l.history.length,a),P(l.data,$(c)),P(l.stepData,Ei(s)),l.loading=!1,l.busyAction=null,l.error=null,l.version+=1}),N(e),y},async finish(e=null){return b(`finish`),U(`payload`,e,Ti,`Flow.finish`),ie(`finish`)||H(`finish`,async n=>(e&&F(l.currentId,e),await B(t.onFinish,[M(),y],n),M()))},destroy(){if(!d.destroyed){d.destroyed=!0,te(),v?.destroy(),v=null;for(let e of m)e();m.clear(),p.clear(),d.built=!1,d.mounted=!1,r.clear()}}},y}const Pi={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 Fi(e){return{...e,text:{...e.text},className:{...e.className}}}function Ii(e){return{content:e.content,loading:!1,processing:!1,visible:!1}}function Li(e){return!!e&&typeof e.then==`function`}function Ri(e){return Number.isFinite(e)?Math.max(0,e):0}const zi={type:`renderable`},Bi={default:{},type:`object`,plain:!0,normalize:e=>{let t=N(e)?e:{};return{...t,title:typeof t.title==`string`?t.title:y(`Tip`),confirm:typeof t.confirm==`string`?t.confirm:y(`Confirm`),cancel:typeof t.cancel==`string`?t.cancel:y(`Cancel`)}}},Vi={content:{default:``,...zi},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:Bi,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()||Y():e??Y()},escClose:{default:!1,type:`boolean`},bgClose:{default:!1,type:`boolean`},className:{default:Pi,type:`object`,normalize:e=>({...Pi,...e&&typeof e==`object`?e:{}})}},Hi={content:Vi.content,loading:{default:!1,type:`boolean`},processing:{default:!1,type:`boolean`},visible:{default:!1,type:`boolean`}},Ui={type:`plainObject`};function Wi(e){let t=W(e,Vi,`Modal`);return{content:t.content,cache:t.cache,ttl:Ri(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,style:t.style}}let Gi=0,Ki=``;function qi(e={}){let t=Wi(e),n=i(Ii(t)),r={initial:Fi(t),previousActiveElement:null,content:null,contentSource:null,hasContent:!1,updatedAt:0},o=new Map,[s,l]=c(!1),[d,p]=c({value:null}),h,g=null,_=null,v=!1,b=0,x=()=>n.processing,S=e=>{if(!t.cache||!r.hasContent||r.contentSource!==e)return!1;let n=Ri(t.ttl);return!n||Date.now()-r.updatedAt<=n},C=(e,n)=>{t.cache&&(r.content=n,r.contentSource=e,r.hasContent=!0,r.updatedAt=Date.now())},w=()=>{r.content=null,r.contentSource=null,r.hasContent=!1,r.updatedAt=0},T=()=>{for(let e of o.values())e();o.clear()},D=(e,t,n,r)=>{o.get(e)?.(),t.addEventListener(n,r),o.set(e,()=>t.removeEventListener(n,r))},O=()=>{v||=(Gi===0&&(Ki=document.body.style.overflow,document.body.style.overflow=`hidden`),Gi+=1,!0)},k=()=>{v&&=(Gi=Math.max(0,Gi-1),Gi===0&&(document.body.style.overflow=Ki,Ki=``),!1)},A=()=>{let e=r.previousActiveElement;r.previousActiveElement=null,e&&document.contains(e)&&e.focus()},M=Wn({elements:()=>[h.element,g],mount:()=>{h.mount(document.body),O()},activate:()=>l(!0),deactivate:()=>l(!1),motion:jn(Pn(()=>h.element,{keyframes:[{opacity:0},{opacity:1}],options:{duration:220,easing:`ease`}}),Pn(()=>g,{keyframes:[{opacity:0,transform:`scale(0.96)`},{opacity:1,transform:`scale(1)`}],options:{duration:220,easing:`ease`}})),unmount:()=>{h.unmount(),k(),A()}}),N=()=>{if(n.loading||n.processing){_||=j(),g&&_.parentElement!==g&&g.append(_);return}_?.remove(),_=null},P=e=>{n.processing!==e&&u(()=>{n.processing=e})},F=()=>{n.visible&&M.phase!==`leaving`&&P(!1)},I=(e=n.content)=>{if(S(e)){b+=1,u(()=>{p({value:r.content}),n.loading=!1});return}let t=++b;if(typeof e!=`function`){w(),u(()=>{p({value:e}),n.loading=!1});return}let i;try{i=e(h)}catch(e){console.error(`Modal.content error:`,e),u(()=>{p({value:null}),n.loading=!1});return}if(!Li(i)){C(e,i),u(()=>{p({value:i}),n.loading=!1});return}u(()=>{n.loading=!0,p({value:null})}),Promise.resolve(i).then(n=>{h.runtime.destroyed||t!==b||(C(e,n),u(()=>{p({value:n})}))}).catch(e=>{h.runtime.destroyed||t!==b||(console.error(`Modal.content error:`,e),u(()=>{p({value:null})}))}).finally(()=>{!h.runtime.destroyed&&t===b&&u(()=>{n.loading=!1})})},L=()=>{if(x())return;let e;try{e=t.onConfirm?.(h)}catch(e){console.error(`Modal.onConfirm error:`,e);return}Li(e)&&(P(!0),Promise.resolve(e).catch(e=>{console.error(`Modal.onConfirm error:`,e)}).finally(()=>{h.runtime.destroyed||F()}))},ee=()=>{if(x())return;let e;try{e=t.onCancel?.(h)}catch(e){console.error(`Modal.onCancel error:`,e);return}if(!Li(e)){h.hide();return}P(!0),Promise.resolve(e).then(()=>{h.runtime.destroyed||h.hide()}).catch(e=>{console.error(`Modal.onCancel error:`,e)}).finally(()=>{h.runtime.destroyed||F()})},R=e=>{if(!g)return;let t=J(`a[href], button:not([disabled]):not([data-action=close]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])`,g).filter(e=>e.offsetParent!==null||e===document.activeElement);if(!t.length){e.preventDefault(),g.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())},z=()=>{if(!g)return;let e=q(`input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]):not([data-action=close]), [tabindex]:not([tabindex="-1"])`,g);e?e.focus():(g.setAttribute(`tabindex`,`-1`),g.focus())},te=()=>{let e=h.element;!e||!g||(T(),D(`root`,e,`click`,n=>{t.bgClose&&!x()&&n.target===e&&h.hide()}),D(`dialog`,g,`click`,e=>{let t=(e.target instanceof Element?e.target:null)?.closest(`[data-action]`)?.dataset.action;t===`cancel`||t===`close`?ee():t===`confirm`&&L()}),D(`keyboard`,document,`keydown`,e=>{!(e instanceof KeyboardEvent)||!n.visible||(e.key===`Escape`&&t.escClose&&!x()?(e.preventDefault(),h.hide()):e.key===`Tab`&&R(e))}))},B=()=>{if(M.phase===`visible`||M.phase===`entering`)return;if(!h.element)throw Error(`Modal.show: build() must be called before show().`);t.onShow?.(h),r.previousActiveElement=document.activeElement instanceof HTMLElement?document.activeElement:null;let e=M.enter();te(),z(),e.then(e=>{e&&!h.runtime.destroyed&&t.onShown?.(h)})},V=()=>{M.phase!==`hidden`&&M.phase!==`leaving`&&(t.onHide?.(h),T(),b+=1,M.leave().then(e=>{e&&!h.runtime.destroyed&&(u(()=>{n.loading=!1,n.processing=!1,t.cache||p({value:null})}),t.onHidden?.(h))}))};return h=Q({name:`Modal`,props:t,state:n,actions:{show(){if(!h.runtime.built)throw Error(`Modal.show: build() must be called before show().`);return h.setState(`visible`,!0),h},hide(){return u(()=>{n.visible=!1}),h},reset(){return h.setState({content:r.initial.content,loading:!1,processing:!1}),w(),p({value:null}),h}},normalizeStatePatch(e){return{...e}},validateStatePatch(e){U(`state`,e,Ui,`Modal.setState`);for(let t of Object.keys(e)){if(!Object.hasOwn(Hi,t))throw Error(`Modal.setState: "${t}" is not a supported state key.`);U(t,e[t],Hi[t],`Modal.setState`)}},view:()=>{g=f(`div`,{className:K(t.className.modal,t.fullscreen?`is-fullscreen`:``),id:t.id,role:`document`,"data-modal-dialog":t.id,...t.style?{style:t.style}:{},"data-mount":()=>s()?`true`:`false`,children:[t.header?f(`div`,{className:t.className.header,children:()=>n.loading?null:[f(`div`,{className:t.className.title,id:`${t.id}_title`,"aria-label":t.text.title,children:t.text.title}),t.showClose?f(`button`,{type:`button`,className:K(t.className.button,t.className.closeBtn),"data-action":`close`,"aria-label":y(`Close`),disabled:x,children:E(`close`)}):null]}):null,f(`div`,{className:t.className.body,"data-modal-body":``,children:()=>G(d().value)}),t.footer?f(`div`,{className:t.className.footer,children:()=>n.loading?null:[t.showCancel?f(`button`,{type:`button`,className:K(t.className.button,t.className.cancelBtn),"data-action":`cancel`,disabled:x,children:t.text.cancel}):null,f(`button`,{type:`button`,className:K(t.className.button,t.className.confirmBtn),"data-action":`confirm`,disabled:x,children:t.text.confirm})]}):null]});let e=qn({className:t.className.layout,position:t.position,component:`modal`,labelledby:t.header?`${t.id}_title`:``,content:g});return e.setAttribute(`data-mount`,`false`),t.header||e.setAttribute(`aria-label`,t.text.title||`Modal`),a(()=>{e.setAttribute(`data-mount`,s()?`true`:`false`)}),a(N),a(()=>{let e=n.visible;m(()=>e?B():V())}),a(()=>{let e=n.visible,t=n.content;m(()=>{e?I(t):b+=1})}),e},onDestroy(){let e=M.phase!==`hidden`;e&&t.onHide?.(h),M.cancel(),T(),k(),A(),_?.remove(),_=null,g=null,e&&t.onHidden?.(h)}}),h}const Ji={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`},Yi={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:Ji,type:`object`,normalize:e=>({...Ji,...e&&typeof e==`object`?e:{}})}},Xi={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`}},Zi={data:{type:`array`},loading:{type:`boolean`},index:{type:`number`},trackIndex:{type:`number`},transform:{type:`number`},animating:{type:`boolean`},width:{type:`number`}};function Qi(e){return e instanceof Element&&!!e.closest(`a, button, input, textarea, select, label, [data-swiper-ignore]`)}function $i(e,t=0){let n=Number(e);return Number.isFinite(n)?n:t}function ea(e){return Array.isArray(e)?e.map(e=>({...e})):[]}function ta(e){return Array.isArray(e)?ea(e):e}function na(e={}){let t=W(e,Yi,`Swiper.props`);return{...t,id:t.id?.trim()||null,data:ta(t.data),className:{...t.className}}}function ra(t={}){let n=na(t),r=Array.isArray(n.data)?n.data:[],s=i({data:ea(r),loading:!1,index:0,trackIndex:0,transform:0,animating:!1,width:0}),c=Me(),l=new WeakMap,d=new Map,p=new Map,m=new Set,h,g=null,_=[],v=()=>[],y=()=>[],b=0,x=null,S=null,C=[],w=null,T=!1,D=!1,O=!1,k=!1,A=e=>(l.has(e)||l.set(e,Y()),l.get(e)),M=e=>{let t=Object.keys(e);return{keys:t,values:t.map(t=>e[t])}},N=(e,t,n)=>{if(!e||e.keys.length!==t.length)return!1;for(let r=0;r<t.length;r+=1)if(e.keys[r]!==t[r]||!Object.is(e.values[r],n[r]))return!1;return!0},P=e=>{let t=new Set,n=e.map((e,n)=>{U(String(n),e,Xi,`Swiper.state.data`);let r=A(e);t.add(r);let{keys:i,values:a}=M(e),o=d.get(r);if(o&&N(o,i,a))return o.item.index=n,o.item;let s={...e,blank:e.blank!==!1,index:n,key:r};return d.set(r,{item:s,keys:i,values:a}),s});for(let e of d.keys())t.has(e)||d.delete(e);return n.some(e=>e.sort!=null)?n.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):n},F=(e,t,n)=>{let r=n===null?`real:${e.key}:${!!e.url}`:`clone:${n}:${e.key}:${!!e.url}`,i=p.get(r);if(i&&i.item===e&&i.clone===n)return i.index=t,i;let a={item:e,index:t,clone:n,key:r};return p.set(r,a),a},I=e=>{let t=new Set,r=e.map((e,n)=>{let r=F(e,n,null);return t.add(r.key),r});if(!n.loop||e.length<=1){for(let e of p.keys())t.has(e)||p.delete(e);return r}let i=e[0],a=e[e.length-1],o=F(a,e.length-1,`last`),s=F(i,0,`first`);t.add(o.key),t.add(s.key);for(let e of p.keys())t.has(e)||p.delete(e);return[o,...r,s]},L=()=>v().length,ee=()=>y().length,R=(e=s.trackIndex)=>{let t=L();return t?!n.loop||t<=1?Math.max(0,Math.min(e,t-1)):e===0?t-1:e===ee()-1?0:e-1:0},z=e=>n.loop?R(e):Math.max(0,e),te=e=>{let t=L();if(!t)return 0;let r=Math.max(0,Math.min(e,t-1));return n.loop&&t>1?r+1:r},B=()=>{_=g?J(`[data-swiper-slide]`,g):[]},V=()=>{for(let e of m)e();m.clear()},ne=()=>{let e=h.element;if(!e)return;let t=e.clientWidth||e.offsetWidth;(t>0||!e.isConnected||s.width===0)&&u(()=>{s.width=t})},re=()=>!!h.element?.isConnected&&s.width>0,ie=()=>(ne(),re()),H=(e,t=!0)=>{let r=$i(e),i=-r*s.width,a=t&&n.speed>0&&s.width>0&&s.transform!==i;u(()=>{s.trackIndex=r,s.index=R(r),s.transform=i,s.animating=a})},ae=()=>{let e=[s.trackIndex];s.trackIndex>0&&e.push(s.trackIndex-1),s.trackIndex<_.length-1&&e.push(s.trackIndex+1);for(let t of e){let e=_[t]?q(`img[data-lazy]`,_[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,m.delete(r)};m.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())}},oe=()=>{x&&=(clearInterval(x),null)},se=()=>{h.runtime.destroyed||x||L()<=1||ie()&&(x=setInterval(()=>h.next(),Math.max(n.delay,16)))},ce=()=>{n.autoplay&&!x&&!h.runtime.destroyed&&se()},le=()=>{oe(),n.autoplay&&se()},ue=e=>{C.push({x:e.pageX??e.clientX??0,y:e.pageY??e.clientY??0,time:Date.now()}),C.length>5&&C.shift()},de=()=>C.length?{x:C[C.length-1].x-C[0].x,y:C[C.length-1].y-C[0].y}:{x:0,y:0},W=(e=!0)=>{let t=-s.trackIndex*s.width,n=e&&s.transform!==t;T=!1,D=!1,O=!1,C=[],w=null,u(()=>{s.transform=t,s.animating=n}),ce()},fe=(e,t)=>{s.animating||!ie()||(C=[],ue(e),w=t,T=!0,D=!1,O=!1,k=!1,oe(),u(()=>{s.animating=!1}))},pe=(e,t)=>{if(!T||D||s.animating)return;ue(e);let r=de(),i=Math.abs(r.x),a=Math.abs(r.y);if(!(i<6&&a<6)){if(!O){if(Math.atan2(a,i)*180/Math.PI<n.touchAngle)O=!0,k=Qi(w);else{D=!0,W(!0);return}}t.preventDefault(),u(()=>{s.transform=-s.trackIndex*s.width+r.x*n.touchRatio})}},me=()=>{if(!T)return;if(T=!1,!O||s.width<=0){W(!0);return}let e=C.length?C[C.length-1].time-C[0].time:0,t=de().x,r=Math.abs(t)/s.width,i=0;e>n.longSwipesMs?i=Math.ceil(r-n.longSwipesRatio):r>=n.longSwipesRatio&&(i=Math.max(1,Math.ceil(r-n.longSwipesRatio))),h.slideToTrack(s.trackIndex+i*(t>0?-1:1)),C=[],ce()},he=e=>{e.target!==g||!(`propertyName`in e)||e.propertyName!==`transform`||(u(()=>{s.animating=!1}),!(!n.loop||L()<=1)&&(s.trackIndex===0?H(L(),!1):s.trackIndex===ee()-1&&H(1,!1)))},ge=()=>{let e=h.element;!e||!g||(c.clear(),c.on(`touchstart`,g,`touchstart`,e=>{let t=e.touches[0];t&&fe(t,e.target)},{passive:!0}),c.on(`touchmove`,g,`touchmove`,e=>{let t=e.touches[0];t&&pe(t,e)},{passive:!1}),c.on(`touchend`,g,`touchend`,e=>{let t=e.changedTouches[0];t&&ue(t),me()}),c.on(`touchcancel`,window,`touchcancel`,()=>W(!0)),c.on(`mousedown`,g,`mousedown`,e=>{let t=e;t.button===0&&(fe(t,t.target),g?.style.setProperty(`cursor`,`grabbing`))}),c.on(`mousemove`,window,`mousemove`,e=>{let t=e;T&&t.buttons===1&&pe(t,e)}),c.on(`mouseup`,window,`mouseup`,e=>{T&&(g?.style.setProperty(`cursor`,`grab`),ue(e),me())}),c.on(`click`,g,`click`,e=>{!k||!n.preventClick||(e.preventDefault(),e.stopPropagation(),k=!1)},{capture:!0}),c.on(`dragstart`,g,`dragstart`,e=>e.preventDefault()),c.on(`transitionend`,g,`transitionend`,he),c.on(`resize`,window,`resize`,_e),c.on(`mouseenter`,e,`mouseenter`,oe),c.on(`mouseleave`,e,`mouseleave`,ce),c.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`?h.prev():n.dataset.action===`next`?h.next():n.dataset.swiperBullet!=null&&h.slideTo(Number(n.dataset.swiperBullet)))}))},_e=()=>{if(!h.runtime.built)return;oe(),V(),B();let e=Math.min(s.index,Math.max(0,L()-1));ne(),H(te(e),!1),n.lazyload&&ae(),n.autoplay&&re()&&ce()},ve=Rt(_e),ye=()=>{S==null&&typeof requestAnimationFrame==`function`&&(S=requestAnimationFrame(()=>{S=null,!h.runtime.destroyed&&h.element?.isConnected&&_e()}))},be=async()=>{if(typeof n.data!=`function`)return;let e=++b;u(()=>{s.loading=!0});try{let t=await Promise.resolve(n.data(h));if(h.runtime.destroyed||e!==b)return;U(`data`,t,{type:`array`},`Swiper.data`);let r=ea(t);P(r),u(()=>{s.data=r})}finally{!h.runtime.destroyed&&e===b&&u(()=>{s.loading=!1})}},xe=()=>{be().catch(e=>{h.runtime.destroyed||console.error(`Swiper.data error:`,e)})},Se=(e,t)=>{let r=()=>z(t()),i={className:n.className.slide,"data-swiper-slide":()=>String(r()),"data-swiper-index":()=>e().clone?null:String(r()),"data-clone":()=>e().clone,role:`group`,"aria-label":()=>`Slide ${r()+1}`,children:()=>{let{item:t}=e();if(t.children!=null){let e={swiper:h,item:t,get index(){return r()}};return G(typeof t.children==`function`?t.children(e):t.children)}return[t.image?f(`img`,{className:n.className.image,alt:t.title||``,loading:`lazy`,...n.lazyload?{"data-lazy":t.image}:{src:t.image}}):null,t.title?f(`span`,{className:n.className.title,children:t.title}):null]}};return e().item.url?f(`a`,{...i,href:()=>e().item.url||``,target:()=>e().item.blank?`_blank`:`_self`}):f(`div`,i)};return h=Q({name:`Swiper`,props:n,state:s,actions:{slideTo(e){h.slideToTrack(te(e))},slideToTrack(e){if(!h.runtime.built)throw Error(`Swiper.slideToTrack: call build() first.`);if(s.animating||!_.length||!ie())return;let t=n.loop?Math.max(0,Math.min(e,_.length-1)):Math.max(0,Math.min(e,L()-1));H(t,!0),n.lazyload&&ae()},next(){s.animating||h.slideToTrack(s.trackIndex+1)},prev(){s.animating||h.slideToTrack(s.trackIndex-1)},play:se,pause:oe,resume:ce,restartAutoplay:le},normalizeStatePatch(e){return{...e,...Object.hasOwn(e,`data`)&&Array.isArray(e.data)?{data:ea(e.data)}:{}}},validateStatePatch(e){U(`state`,e,{type:`plainObject`},`Swiper.setState`);for(let t of Object.keys(e)){if(!Object.hasOwn(Zi,t))throw Error(`Swiper.setState: "${t}" is not a supported state key.`);U(t,e[t],Zi[t],`Swiper.setState`)}Array.isArray(e.data)&&P(e.data)},view:()=>{v=o(()=>P(s.data)),y=o(()=>I(v()));let t=()=>{let e=j();return e.setAttribute(`data-swiper-loading`,``),e};g=f(`div`,{className:n.className.wrapper,"data-swiper-wrapper":``,"aria-live":`polite`,children:()=>s.loading?t():e({each:y,key:e=>e.key,children:Se})});let r=f(`div`,{id:n.id||Y(),className:n.className.root,"data-swiper":`root`,"data-status":()=>s.loading?`loading`:`loaded`,children:[g,n.pagination?f(`div`,{className:K(n.className.pagination,n.className.paginationHorizontal,n.className.paginationClickable,n.className.paginationBulletGroup),"data-swiper-pagination":``,children:e({each:v,key:e=>e.key,children:(e,t)=>f(`button`,{type:`button`,className:()=>K(n.className.indicator,n.className.bullet,s.index===t()?n.className.active:``),"data-swiper-bullet":()=>String(t()),"aria-label":()=>`Go to slide ${t()+1}`,"aria-current":()=>s.index===t()?`true`:null})})}):null,n.navigation?f(`button`,{type:`button`,className:()=>K(n.className.navigation,n.className.prev,!n.loop&&s.index<=0?n.className.disabled:``),"data-action":`prev`,"data-swiper-navigation":`prev`,"aria-label":`Previous slide`,disabled:()=>!n.loop&&s.index<=0,children:E(`arrow-left`)}):null,n.navigation?f(`button`,{type:`button`,className:()=>K(n.className.navigation,n.className.next,!n.loop&&s.index>=L()-1?n.className.disabled:``),"data-action":`next`,"data-swiper-navigation":`next`,"aria-label":`Next slide`,disabled:()=>!n.loop&&s.index>=L()-1,children:E(`arrow-right`)}):null]});return a(()=>{g?.style.setProperty(`transform`,`translate3d(${s.transform}px, 0, 0)`),g?.style.setProperty(`transition`,s.animating?`transform ${n.speed}ms cubic-bezier(0.25, 0.46, 0.45, 0.94)`:`none`),r.style.setProperty(`--swiper-slide-width`,`${s.width}px`)}),a(()=>{(v().map(e=>`${e.key}:${e.sort??``}:${!!e.url}`).join(`|`)||s.data.length===0)&&ve.schedule()}),r},onBuild(e){!e.element||!g||(g.setAttribute(`aria-live`,`polite`),B(),ge(),ne(),H(te(s.index),!1),n.lazyload&&ae(),n.autoplay&&re()&&se(),e.own(()=>c.clear()),xe(),ye())},onMount(){_e(),ye()},onDestroy(){oe(),ve.dispose(),b+=1,V(),S!=null&&cancelAnimationFrame(S),S=null,g=null,_=[]}}),Object.defineProperties(h,{realCount:{enumerable:!0,get:L},realIndex:{enumerable:!0,get:()=>R()}}),h}const ia={root:`j-tabs`,wrap:`tab-wrap`,list:`tab-list`,tab:`tab-item`,panelWrap:`panel-list`,panel:`panel-item`,dragging:`dragging`},aa={id:{default:null,types:[`string`,`null`],normalize:e=>typeof e==`string`?e.trim()||Y():e??Y()},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:ia,type:`object`,normalize:e=>({...ia,...e&&typeof e==`object`?e:{}})}},oa={type:`plainObject`,shape:{name:[`string`,`null`,`undefined`],title:`renderable`,content:`renderable`,cache:[`boolean`,`undefined`],ttl:[`number`,`undefined`]}},sa={data:aa.data,active:aa.active,disabled:aa.disabled};function ca(e,t,n=`Tabs.data`){U(String(t),e,oa,n);let r=(typeof e.name==`string`?e.name.trim():``)||Y();return{...e,name:r}}function la(e,t=`Tabs.data`){U(`data`,e,sa.data,t);let n=new Set;return e.map((e,r)=>{let i=ca(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 ua(e){return Array.isArray(e)?[...e]:e}function da(e){let t=W(e,aa,`Tabs.props`);return{id:t.id,direction:t.direction,active:t.active,disabled:ua(t.disabled),onChange:t.onChange,data:la(t.data,`Tabs.props.data`),className:t.className}}function fa(e){return typeof e==`number`&&e>0?e:0}function pa(t={}){let n=da(t),r=i({data:n.data,active:n.active,disabled:n.disabled,draggable:!1,dragging:!1,loading:!1}),s=Me(),l=Ut(),d=Ut(),m=Wt(),h=Wt(),g=new Map,_=new Map,v,y=0,b=!1,x=0,S=0,C=0,w=e=>typeof e==`number`?e:r.data.findIndex(t=>t.name===e),T=()=>{let e=w(r.active),t=r.data[e];return t?{index:e,name:t.name}:{index:-1,name:null}},E=()=>{if(typeof r.active==`string`)return r.active;let e=r.data[r.active];return e?e.name:null},D=()=>{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`)))},O=e=>D().includes(e),k=e=>E()===e,A=o(()=>r.data),M=()=>{let e=l.current,t=d.current;if(!e||!t)return;let i=n.direction===`left`||n.direction===`right`?t.scrollHeight>e.clientHeight+5:t.scrollWidth>e.clientWidth+5;r.draggable!==i&&u(()=>{r.draggable=i})},N=Rt(M),P=()=>{let e=l.current;if(!e)return;let t=C,r=performance.now(),i=n.direction===`left`||n.direction===`right`,a=n=>{let o=n-r;r=n,t*=.92,!(Math.abs(t)<.3)&&(i?e.scrollTop+=t*o*.05:e.scrollLeft+=t*o*.05,x=requestAnimationFrame(a))};x=requestAnimationFrame(a)},F=()=>{let e=l.current,t=d.current;if(!e||!t)return;let i=0,a=0,o=0,c=!1,f=0,p=e=>{let t=n.direction===`left`||n.direction===`right`;if(`touches`in e){let n=e.touches[0]||e.changedTouches[0];return t?n.pageY:n.pageX}return t?e.pageY:e.pageX},m=t=>{r.draggable&&(!(t instanceof MouseEvent)&&!(t instanceof TouchEvent)||(b=!0,u(()=>{r.dragging=!0}),i=p(t),o=i,a=n.direction===`left`||n.direction===`right`?e.scrollTop:e.scrollLeft,C=0,cancelAnimationFrame(x)))},h=t=>{if(!b||!(t instanceof MouseEvent)&&!(t instanceof TouchEvent))return;t.preventDefault();let r=p(t);f=i-r,C=o-r,o=r,!c&&(c=!0,requestAnimationFrame(()=>{c=!1,n.direction===`left`||n.direction===`right`?e.scrollTop=a+f:e.scrollLeft=a+f}))},g=()=>{b&&(b=!1,u(()=>{r.dragging=!1}),P())};s.on(`drag:mousedown`,t,`mousedown`,m),s.on(`drag:touchstart`,t,`touchstart`,m,{passive:!0}),s.on(`drag:mousemove`,window,`mousemove`,h,{passive:!1}),s.on(`drag:touchmove`,window,`touchmove`,h,{passive:!1}),s.on(`drag:mouseup`,window,`mouseup`,g),s.on(`drag:touchend`,window,`touchend`,g)},I=async e=>{if(!v.runtime.built)throw Error(`Tabs.activate: call build() first.`);let t=w(e),i=r.data[t];if(!i)return;let a=i.name;O(a)||k(a)||(u(()=>{r.active=e}),await _.get(a)?.(),await Promise.resolve(n.onChange?.(t,a,m.get(a),h.get(a))))},L=(e,t)=>{let i=e().name,o=e().content,[s,l]=c(typeof o==`function`?null:o),[d,m]=c(!1),b=o,x=0,S=null,C=()=>({tabs:v,item:e(),index:t(),name:i}),w=async()=>{let t=e(),n=t.content;if(typeof n!=`function`){l(n);return}let a=t.cache?g.get(i):null,o=fa(t.ttl);if(a&&(!o||Date.now()-a.updatedAt<=o)){l(a.content);return}if(S)return S;let s=++x;y+=1;let c=y;m(!0),u(()=>{r.loading=!0});let d=Promise.resolve().then(()=>n(C())).then(t=>{s!==x||v.runtime.destroyed||(e().cache&&g.set(i,{content:t,updatedAt:Date.now()}),l(t))}).finally(()=>{s===x&&m(!1),c===y&&!v.runtime.destroyed&&u(()=>{r.loading=!1}),S===d&&(S=null)});return S=d,d};_.set(i,w),p(()=>{g.delete(i),_.delete(i)}),a(()=>{let t=e().content;t!==b&&(b=t,x+=1,S=null,g.delete(i),l(typeof t==`function`?null:t)),k(i)&&w()});let T=()=>{if(d())return j(`flex-start`,`flex-start`);let e=s();return typeof e==`function`?e(C()):e};return f(`div`,{className:n.className.panel,"data-tabs-panel":i,role:`tabpanel`,"aria-hidden":()=>k(i)?`false`:`true`,"aria-live":()=>typeof e().content==`function`?`polite`:null,"aria-busy":()=>String(d()),hidden:()=>!k(i),ref:h.bind(i),children:()=>G(T())})},ee=(e,t)=>{let r=e().name,i=()=>{let n=e().title,i={tabs:v,item:e(),index:t(),name:r};return typeof n==`function`?n(i):n};return f(`div`,{className:n.className.tab,"data-tabs-tab":r,role:`tab`,"aria-selected":()=>k(r)?`true`:`false`,"aria-disabled":()=>O(r)?`true`:`false`,ref:m.bind(r),children:()=>G(i())})};return v=Q({name:`Tabs`,props:n,state:r,actions:{activate:I},normalizeStatePatch(e){return{...e,...Object.hasOwn(e,`data`)?{data:la(e.data,`Tabs.setState.data`)}:{},...Object.hasOwn(e,`disabled`)&&Array.isArray(e.disabled)?{disabled:ua(e.disabled)}:{}}},validateStatePatch(e){U(`state`,e,{type:`plainObject`},`Tabs.setState`);for(let t of Object.keys(e)){if(!Object.hasOwn(sa,t))throw Error(`Tabs.setState: "${t}" is not a supported state key.`);let n=t;U(t,e[t],sa[n],`Tabs.setState`)}},view:()=>(a(()=>{let e=r.data.length;return N.schedule(),e}),f(`div`,{className:n.className.root,id:n.id,"data-tabs":`root`,"data-tabs-direction":n.direction,children:[f(`div`,{className:n.className.wrap,"data-tabs-wrap":``,ref:l.set,children:f(`nav`,{className:()=>K(n.className.list,r.dragging&&n.className.dragging),"data-tabs-list":``,ref:d.set,children:e({each:A,key:e=>e.name,children:(e,t)=>ee(e,t)})})}),f(`div`,{className:n.className.panelWrap,"data-tabs-panel-wrap":``,children:e({each:A,key:e=>e.name,children:(e,t)=>L(e,t)})})]})),onBuild(e){let t=e.element;t&&(s.on(`click`,t,`click`,e=>{if(!(e.target instanceof Element))return;let t=e.target.closest(`[data-tabs-tab]`)?.dataset.tabsTab;t&&!O(t)&&I(t)}),s.on(`resize`,window,`resize`,()=>{cancelAnimationFrame(S),S=requestAnimationFrame(M)}),F(),e.own(()=>s.clear()),N.schedule(),_.get(T().name||``)?.())},onMount(){N.schedule()},onDestroy(){y+=1,N.dispose(),cancelAnimationFrame(x),cancelAnimationFrame(S),g.clear(),_.clear(),m.clear(),h.clear()}}),Object.defineProperties(v,{current:{enumerable:!0,get:T}}),v}const ma={root:`j-offcanvas`,overlay:`j-offcanvas-overlay`,content:`offcanvas-content`},ha={top:`translateY(-100%)`,right:`translateX(100%)`,bottom:`translateY(100%)`,left:`translateX(-100%)`},ga={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()||Y():e??Y()},className:{default:ma,type:`object`,normalize:e=>({...ma,...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`]}},_a={content:ga.content,visible:{type:`boolean`},loading:{type:`boolean`}};function va(e){return e>0?e:0}function ya(e){let t=W(e,ga,`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 ba=0,xa=``;function Sa(e){U(`state`,e,{type:`plainObject`},`Offcanvas.setState`);for(let t of Object.keys(e)){if(!Object.hasOwn(_a,t))throw Error(`Offcanvas.setState: "${t}" is not a supported state key.`);let n=t;U(t,e[t],_a[n],`Offcanvas.setState`)}}function Ca(e={}){let t=ya(e),n=i({content:t.content,visible:!1,loading:!1}),[r,o]=c({value:typeof t.content==`function`?null:t.content}),s={cache:{content:null,hasContent:!1,updatedAt:0},contentLoadId:0},l=Me(),p=Ut(),h,g=!1,_=()=>{!t.bodyOverflow||g||(ba===0&&(xa=document.body.style.overflow,document.body.style.overflow=`hidden`),ba+=1,g=!0)},v=()=>{g&&=(ba=Math.max(0,ba-1),ba===0&&(document.body.style.overflow=xa,xa=``),!1)},y=Pn(()=>h.element,{keyframes:[{transform:ha[t.direction]},{transform:`translate(0, 0)`}],options:{duration:300,easing:`ease`}}),b=Wn({elements:()=>[p.current,h.element],mount:()=>{let e=p.current;e&&!e.isConnected&&d(document.body,e),h.mount(document.body),_()},activate:()=>{n.visible=!0},deactivate:()=>{n.visible=!1},motion:jn(...t.animate===`slide`?[y]:[],Pn(()=>p.current,{keyframes:[{opacity:0},{opacity:1}],options:{duration:300,easing:`ease`}})),unmount:()=>{p.current?.remove(),h.unmount(),v()}}),x=()=>{s.cache={content:null,hasContent:!1,updatedAt:0}},S=()=>{if(!t.cache||!s.cache.hasContent)return!1;let e=va(t.ttl);return!e||Date.now()-s.cache.updatedAt<=e},C=()=>{let e=r().value;return typeof e==`function`?e(h):e},w=async()=>{let e=n.content;if(typeof e!=`function`){s.contentLoadId+=1,u(()=>{o({value:e}),n.loading=!1});return}if(S()){s.contentLoadId+=1,u(()=>{o({value:s.cache.content}),n.loading=!1});return}let r=++s.contentLoadId;u(()=>{n.loading=!0,o({value:null})});try{let n=await Promise.resolve(e(h));if(h.runtime.destroyed||r!==s.contentLoadId)return;t.cache&&(s.cache={content:n,hasContent:!0,updatedAt:Date.now()}),u(()=>{o({value:n})})}finally{!h.runtime.destroyed&&r===s.contentLoadId&&u(()=>{n.loading=!1})}};return h=Q({name:`Offcanvas`,props:t,state:n,actions:{async show(){if(!h.runtime.built)throw Error(`Offcanvas.show: call build() first.`);if(n.visible)return;await Promise.resolve(t.onShow?.(h));let e=b.enter(),r=w();await e&&!h.runtime.destroyed&&t.onShown?.(h),await r},async hide(){if(!h.runtime.built)throw Error(`Offcanvas.hide: call build() first.`);if(!n.visible)return;let e=t.onHide?.(h);e&&await e,s.contentLoadId+=1,u(()=>{n.loading=!1}),await b.leave()&&t.onHidden?.(h)}},validateStatePatch:Sa,view(e){let r=t.overlay?f(`div`,{ref:p.set,className:t.className.overlay,"data-offcanvas-overlay":t.id,"data-mount":()=>n.visible?`true`:`false`,style:t.filter?{backdropFilter:`blur(2px)`}:{},onClick:()=>{t.bgClose&&h.hide()}}):null;return r&&e.own(()=>r.remove()),a(()=>{let e=n.content;U(`content`,e,_a.content,`Offcanvas.state`),x(),typeof e==`function`?(o({value:null}),m(()=>n.visible)&&w()):(s.contentLoadId+=1,o({value:e}),n.loading=!1)}),f(`div`,{className:t.className.root,id:t.id,role:`dialog`,"aria-modal":t.overlay?`true`:`false`,"aria-expanded":()=>String(n.visible),"data-mount":()=>n.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`)&&h.hide()},children:f(`div`,{className:t.className.content,"data-offcanvas-content":t.id,children:()=>G(n.loading?j():C())})})},onBuild(e){t.escClose&&l.on(`esc`,document,`keydown`,e=>{e instanceof KeyboardEvent&&e.key===`Escape`&&n.visible&&h.hide()}),e.own(()=>l.clear())},onDestroy(){b.cancel(),s.contentLoadId+=1,p.current?.remove(),v()}}),h}const wa={size:10,current:1},Ta={sibling:1,boundary:1},Ea={root:`j-pagination`,list:`pagination`,item:`item`,button:`j-button is-ghost is-icon`,currentBtn:`j-button is-outline is-icon is-active`,moreBtn:`j-button is-ghost is-icon`,loading:`animate-spin`},Da={default:0,type:`number`,finite:!0,min:0},Oa={type:`plainObject`,required:!0,shape:{size:{type:`number`,integer:!0,greaterThan:0},current:{type:`number`,integer:!0,greaterThan:0}}},ka={type:`plainObject`,required:!0,shape:{sibling:{type:`number`,integer:!0,min:0},boundary:{type:`number`,integer:!0,min:0}}},Aa={total:Da,page:{default:()=>({...wa}),factory:!0,normalize:e=>({...wa,...e&&typeof e==`object`?e:{}}),...Oa},count:{default:()=>({...Ta}),factory:!0,normalize:e=>({...Ta,...e&&typeof e==`object`?e:{}}),...ka},lock:{default:!0,type:`boolean`},onChange:{default:null,types:[`function`,`null`]},className:{default:Ea,type:`object`,normalize:e=>({...Ea,...e&&typeof e==`object`?e:{}})}},ja={total:Da,page:Oa,count:ka,locked:{type:`boolean`}};function Ma(e,t,n){return Math.min(Math.max(e,t),n)}function Na(e,t){return Math.max(1,Math.ceil(e/t))}function Pa(e){return{size:e.size,current:e.current}}function Fa(e){return{sibling:e.sibling,boundary:e.boundary}}function Ia(e={}){let t=W(e,Aa,`Pagination.props`),n=Na(t.total,t.page.size);return{...t,page:{size:t.page.size,current:Ma(t.page.current,1,n)},count:Fa(t.count),className:{...t.className}}}function La(e){return{type:`more`,key:e}}function Ra(e){return{type:`page`,key:`page-${e}`,page:e}}function za(e,t){let n=[];for(let r=e;r<=t;r++)n.push(r);return n}function Ba(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 za(1,t).map(Ra);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?Ra(t.page+1):La(`more-${t.page}-${e}`)),s.push(Ra(e))}return s}function Va(e){if(e.type!==`page`)throw Error(`Pagination.itemView: expects page item.`);return e}function Ha(t={}){let n=Ia(t),r=i({total:n.total,page:Pa(n.page),count:Fa(n.count),locked:!1}),s=0,c,l=o(()=>Na(r.total,r.page.size)),d=()=>n.lock&&r.locked,p=()=>d()||r.page.current<=1,m=()=>d()||r.page.current>=l(),h=o(()=>Ba(r.page.current,l(),r.count)),g=e=>{n.lock&&!c.runtime.destroyed&&e===s&&u(()=>{r.locked=!1})},_=e=>{if(c.runtime.destroyed)throw Error(`Pagination.go: instance destroyed`);if(!c.runtime.built)throw Error(`Pagination.go: call build() first.`);if(U(`page`,e,{type:`number`,integer:!0},`Pagination.go`),d())return c;let t=Ma(e,1,l());if(t===r.page.current)return c;let i=n.lock&&typeof n.onChange==`function`,a=i?++s:s;if(u(()=>{r.page.current=t,i&&(r.locked=!0)}),n.onChange){let e;try{e=n.onChange(t,c)}catch(e){throw g(a),e}if(i&&e&&typeof e.then==`function`){let t=()=>g(a);Promise.resolve(e).then(t,t)}else g(a)}return c},v=e=>{let t=e===`prev`?p:m;return f(`li`,{className:n.className.item,"data-pagination-control":e,children:f(`button`,{className:n.className.button,type:`button`,"data-page-action":e,"aria-label":y(e===`prev`?`Go to previous page`:`Go to next page`),"aria-disabled":()=>t()?`true`:`false`,tabindex:()=>t()?`-1`:null,disabled:t,onClick:()=>{t()||_(r.page.current+(e===`prev`?-1:1))},children:E(e===`prev`?`arrow-left`:`arrow-right`)})})},b=e=>{if(e().type===`more`)return f(`li`,{className:n.className.item,"data-pagination-more":()=>e().type===`more`?e().key:null,children:f(`span`,{className:n.className.moreBtn,"aria-disabled":!0,disabled:``,children:E(`more`)})});let t=()=>Va(e()).page,i=()=>t()===r.page.current;return f(`li`,{className:n.className.item,"data-pagination-more":()=>e().type===`more`?e().key:null,"data-pagination-item":()=>{let t=e();return t.type===`page`?String(t.page):null},children:f(`button`,{className:()=>i()?n.className.currentBtn:n.className.button,type:`button`,"data-page":()=>String(t()),"data-current-page":()=>i()?String(t()):null,"aria-current":()=>i()?`page`:null,"aria-label":()=>i()?`Page ${t()}, current page`:`Go to page ${t()}`,"aria-disabled":()=>d()||i()?`true`:`false`,tabindex:()=>d()||i()?`-1`:null,disabled:()=>d()||i(),onClick:()=>{let e=t();!d()&&!i()&&_(e)},children:()=>d()&&i()?j():String(t())})})};return c=Q({name:`Pagination`,props:n,state:r,actions:{go:_},normalizeStatePatch(e){let t={...e};return Object.hasOwn(t,`page`)&&N(t.page)&&(t.page={...r.page,...t.page}),Object.hasOwn(t,`count`)&&N(t.count)&&(t.count={...r.count,...t.count}),t},validateStatePatch(e){for(let t of Object.keys(e)){if(!Object.hasOwn(ja,t))throw Error(`Pagination.setState: "${t}" is not supported.`);let n=t;U(t,e[t],ja[n],`Pagination.setState`)}},view:()=>(a(()=>{let e=Ma(r.page.current,1,l());e!==r.page.current&&(r.page.current=e)}),f(`div`,{className:n.className.root,role:`navigation`,"aria-label":`Pagination`,"data-pagination":`root`,children:f(`ul`,{className:n.className.list,"data-pagination-list":``,"aria-live":`polite`,children:[v(`prev`),e({each:h,key:e=>e.key,children:e=>b(e)}),v(`next`)]})}))}),Object.defineProperty(c,"pageCount",{enumerable:!0,get:l}),c}const Ua={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`},Wa={type:`object`,validate:Qa,message:`expects { title, id?, type?, url?, target?, classes?, children? }.`},Ga={type:`array`,items:Wa},Ka={type:{default:void 0,types:[`string`,`undefined`]},user:{default:0,types:[`number`,`function`]},id:{default:null,types:[`string`,`null`],normalize:e=>typeof e==`string`?e.trim()||Y():e??Y()},data:{default:[],types:[`array`,`function`]},backText:{default:y(`b`),type:`string`},className:{default:Ua,type:`object`,normalize:e=>({...Ua,...e&&typeof e==`object`?e:{}})}},qa={user:{type:`number`},data:Ga,activeKeys:{type:`array`,items:`string`}};function Ja(e={}){let t=W(e,Ka,`Menu.props`);return{...t,user:t.user,data:t.data,className:{...t.className}}}function Ya(e){return e==null?[]:typeof e==`string`?e.trim().split(/\s+/).filter(Boolean):e.slice()}function Xa(e){return`menu-item-${e??Y()}`}function Za(e){return typeof e==`string`?e.trim():``}function Qa(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.type==null||t.type===0||t.type===1||t.type===2)&&(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(Qa))}function $a(e){return Array.isArray(e)?e.map(e=>{U(`item`,e,Wa,`Menu.data`);let t={...e};return t.type=t.type??0,Array.isArray(t.classes)&&(t.classes=t.classes.slice()),Array.isArray(t.children)&&(t.children=$a(t.children)),t}):[]}function eo(e){let n=t(e??0);return U(`user`,n,`number`,`Menu.props`),n}function to(e){let n=t(e??[]);return U(`data`,n,Ga,`Menu.props`),$a(n)}function no(t={}){let n=Ja(t),r=i({user:eo(n.user),data:to(n.data),activeKeys:[]}),s=new WeakMap,c=Me(),l,d=e=>e.id==null?(s.has(e)||s.set(e,Y()),s.get(e)):String(e.id),p=e=>r.activeKeys.includes(e),m=()=>r.user>0,h=e=>e.type===1?m():e.type!==2||!m(),g=e=>Array.isArray(e)?e.filter(h):[],_=e=>{u(()=>{r.activeKeys=n.type===`bottom`?[e]:r.activeKeys.includes(e)?r.activeKeys:[...r.activeKeys,e]})},v=e=>{u(()=>{r.activeKeys=r.activeKeys.filter(t=>t!==e)})},y=e=>{u(()=>{r.activeKeys=p(e)?[]:[e]})},b=e=>f(`li`,{className:n.className.backItem,"data-menu-back":``,children:f(`a`,{className:n.className.link,href:``,"data-menu-link":``,onClick:t=>{t.preventDefault(),v(e)},children:[f(`span`,{className:n.className.backIcon,children:E(`arrow-left`)}),f(`span`,{className:n.className.text,children:n.backText})]})}),x=(t,r=!1,i)=>f(`ul`,{className:r?n.className.list:n.className.subMenu,...r?{id:n.id}:{},"data-menu-list":r?`root`:`sub`,children:[e({each:()=>n.type===`mobile`&&i&&p(i)?[i]:[],key:e=>e,children:e=>b(e())}),e({each:t,key:e=>d(e),children:e=>{let t=d(e()),r=o(()=>g(e().children)),i=()=>r().length>0;return f(`li`,{className:()=>{let r=e();return K(n.className.item,i()?n.className.hasChildren:``,...Ya(r.classes),p(t)?n.className.active:``)},id:()=>e().id==null?`menu-item-${t}`:Xa(e().id),"data-menu-item":()=>e().id==null?``:String(e().id),"data-menu-has-children":()=>i()?``:null,onClick:e=>{n.type===`mobile`&&e.target===e.currentTarget&&i()&&_(t)},children:[()=>{let r=e(),a=i(),o=Za(r.url);return!a&&!o?f(`span`,{className:n.className.link,"data-menu-link":``,children:r.title}):f(`a`,{className:n.className.link,href:o,target:r.target,"data-menu-link":``,onClick:e=>{a&&(n.type===`mobile`||n.type===`bottom`)&&(e.preventDefault(),n.type===`bottom`?y(t):_(t))},children:r.title})},()=>i()?x(r,!1,t):null]})}})]});return l=Q({name:`Menu`,props:n,state:r,normalizeStatePatch(e){let t={...e};return Object.hasOwn(t,`user`)&&(t.user=eo(t.user)),Object.hasOwn(t,`data`)&&(t.data=$a(t.data)),t},validateStatePatch(e){for(let t of Object.keys(e)){if(!Object.hasOwn(qa,t))throw Error(`Menu.setState: "${t}" is not supported.`);let n=t;U(t,e[t],qa[n],`Menu.setState`)}},view:()=>{let e=o(()=>g(r.data));return a(()=>{r.user=eo(n.user),r.data=to(n.data)}),a(()=>U(`data`,r.data,Ga,`Menu`)),f(`nav`,{className:n.className.root,"data-menu":`root`,"data-menu-type":n.type,children:x(e,!0)})},onBuild(e){n.type===`bottom`&&(c.on(`outside`,document,`click`,t=>{let n=t.target;!(n instanceof Node)||e.element?.contains(n)||u(()=>{r.activeKeys=[]})}),e.own(()=>c.clear()))}}),l}export{Ct as Toast,A as addIcons,J as all,G as asRenderable,Ot as checkModernBrowser,Tt as copy,Yr as createAccordion,Fn as createCollapseTransition,$n as createDrop,Ut as createElementRef,Me as createEventManager,Ni as createFlow,xi as createForm,Dn as createImgCompress,Wt as createKeyedElementRefs,j as createLoading,no as createMenu,qi as createModal,jn as createMotionGroup,Ca as createOffcanvas,An as createOwnedView,Ha as createPagination,br as createParabola,qn as createPopup,Wn as createPresence,Rt as createScheduledTask,Ht as createStateSync,Er as createSticky,ra as createSwiper,pa as createTabs,mr as createTheme,Ir as createToc,ir as createTooltip,Pn as createTransition,Cn as createValidator,Q as defineComponent,On as getImgCompressInstance,k as getRegistedIconPath,zt as getStoreVersion,z as getType,Re as hashQueryParams,E as icon,D as iconHtml,O as iconMarkup,I as isDomElementValue,F as isDomNodeValue,ge as isElement,L as isHtmlElementValue,wt as isMobile,Dt as isModernBrowser,P as isNilValue,he as isNode,N as isPlainObject,Te as isRenderableContent,ee as isRenderablePrimitive,R as isRenderableValue,K as joinClasses,Ee as lazyRender,je as listen,At as postJson,q,Y as randomId,kr as removeComponentPlugin,we as requireContainer,kn as resetImgCompressInstance,Ce as resolveContainer,Se as resolveElement,xe as resolveNode,be as resolveNodeList,W as resolveProps,kt as restUrl,Vt as stateSnapshot,Be as timer,Bt as trackStoreVersion,y as translate,Or as useComponentPlugin,Ne as uuid,U as validateParam,Un as waitForMotion};
|