@lattice-php/lattice 0.56.2 → 0.57.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/fragments/fragment.js +1 -1
- package/dist/fragments/fragment.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -3
- package/dist/inertia-navigation.d.ts +10 -0
- package/dist/inertia-navigation.js +18 -1
- package/dist/inertia-navigation.js.map +1 -1
- package/dist/layout/components/menu-item.js +3 -3
- package/dist/layout/components/menu-item.js.map +1 -1
- package/dist/layout/components/outlet.js +3 -4
- package/dist/layout/components/outlet.js.map +1 -1
- package/dist/layout/components/popover.js +4 -4
- package/dist/layout/components/popover.js.map +1 -1
- package/dist/layout/components/schema-layout.js +3 -3
- package/dist/layout/components/schema-layout.js.map +1 -1
- package/dist/layout/components/sidebar.js +4 -4
- package/dist/layout/components/sidebar.js.map +1 -1
- package/dist/layout/hooks/context.d.ts +5 -3
- package/dist/layout/hooks/context.js +13 -4
- package/dist/layout/hooks/context.js.map +1 -1
- package/dist/layout/index.d.ts +1 -1
- package/dist/layout/index.js +2 -2
- package/dist/notifications/components/notification-list.js +1 -1
- package/dist/notifications/components/notification-list.js.map +1 -1
- package/dist/notifications/components/notifications-sheet.d.ts +3 -0
- package/dist/notifications/components/notifications-sheet.js +59 -0
- package/dist/notifications/components/notifications-sheet.js.map +1 -0
- package/dist/notifications/components/notifications.js +23 -19
- package/dist/notifications/components/notifications.js.map +1 -1
- package/dist/notifications/context.d.ts +17 -0
- package/dist/notifications/context.js +36 -0
- package/dist/notifications/context.js.map +1 -0
- package/dist/notifications/store.d.ts +1 -1
- package/dist/notifications/store.js.map +1 -1
- package/dist/provider-base.js +9 -7
- package/dist/provider-base.js.map +1 -1
- package/dist/runtime.d.ts +7 -3
- package/dist/runtime.js +8 -5
- package/dist/types/generated.d.ts +1 -0
- package/dist-standalone/chunks/{chart-view-oULAY8WG.js → chart-view-eWW-pC-B.js} +6 -6
- package/dist-standalone/chunks/{date-picker-field-BtFIuqiR.js → date-picker-field-FY2OOgtu.js} +1 -1
- package/dist-standalone/chunks/{field-TNAMMeq0.js → field-DMXnzaJF.js} +1 -1
- package/dist-standalone/chunks/floating-ui.dom-CAMzcZKV.js +1 -0
- package/dist-standalone/chunks/{input-C-Wm1w0g.js → input-0lNoXsuO.js} +1 -1
- package/dist-standalone/chunks/registry-context-gXwNT8GJ.js +1 -0
- package/dist-standalone/chunks/{rich-editor-field-BAfgX13j.js → rich-editor-field-B0XwZGpp.js} +4 -4
- package/dist-standalone/chunks/runtime-BjRIrbqh.js +162 -0
- package/dist-standalone/chunks/{subscriptions-CPPj3zAw.js → subscriptions-CSh5RtT7.js} +1 -1
- package/dist-standalone/lattice.css +1 -1
- package/dist-standalone/lattice.js +1 -1
- package/dist-standalone/manifest.json +1 -1
- package/dist-standalone/runtime.js +1 -1
- package/package.json +6 -6
- package/dist-standalone/chunks/floating-ui.dom-DRSJZ5ii.js +0 -1
- package/dist-standalone/chunks/registry-context-Q5KtSmdi.js +0 -1
- package/dist-standalone/chunks/runtime-ckCQ5M2S.js +0 -162
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./date-picker-field-FY2OOgtu.js","./rolldown-runtime-hePW80VL.js","./react-CwJFpaho.js","./react-dom-Dl-LT-t1.js","./locale-BZOrJtMq.js","./jsx-runtime-NZYk81nU.js","./floating-ui.dom-CAMzcZKV.js","./clsx-CjueKrWZ.js","./input-0lNoXsuO.js","./field-DMXnzaJF.js","./instance-D6cXaqIT.js","./timezone-Ckl1gbqB.js","./dist-DAHNiLp2.js","./w3c-keyname-BOAvb0qz.js","./with-selector-Cse0iXU1.js","./rich-editor-field-B0XwZGpp.js","./registry-context-gXwNT8GJ.js","./notifications-echo-BLO9_g1w.js","./dist-D2qBbka0.js","./code-block-view-4IbUdTmO.js","./chart-view-eWW-pC-B.js","./materialize-CWqnSEHR.js","./color-CXV-Y5Qv.js","./subscriptions-CSh5RtT7.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{n as e,r as t,t as n}from"./rolldown-runtime-hePW80VL.js";import{t as r}from"./react-CwJFpaho.js";import{n as i,t as a}from"./materialize-CWqnSEHR.js";import{t as o}from"./react-dom-Dl-LT-t1.js";import{a as s,n as c,o as l,r as u,s as d}from"./locale-BZOrJtMq.js";import{t as f}from"./jsx-runtime-NZYk81nU.js";import{i as p,n as m,r as h,t as g}from"./registry-context-gXwNT8GJ.js";import{_,a as v,c as y,d as b,f as x,g as S,h as C,i as w,l as T,m as E,n as D,o as O,p as k,r as ee,s as A,t as j,u as M}from"./floating-ui.dom-CAMzcZKV.js";import{a as N,c as P,i as F,n as I,o as te,r as ne,s as re}from"./instance-D6cXaqIT.js";import{a as L,i as R,o as ie,r as ae,s as oe}from"./timezone-Ckl1gbqB.js";import{n as se,r as ce,t as le}from"./input-0lNoXsuO.js";import{i as ue,n as de,r as fe,t as pe}from"./color-CXV-Y5Qv.js";var z=t(r(),1),me=`modulepreload`,he=function(e,t){return new URL(e,t).href},ge={},_e=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=he(t,n),t=s(t),t in ge)return;ge[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:me,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})};function B(e){return{component:e,mode:`eager`}}var ve=[250,1e3,4e3];function ye(e){return async()=>{try{return await e()}catch(t){for(let t of ve){await new Promise(e=>setTimeout(e,t));try{return await e()}catch{continue}}throw t}}}function be(e){let t=ye(e);return{component:(0,z.lazy)(t),load:t,mode:`lazy`}}var xe=e=>_e(()=>import(e),[],import.meta.url);function Se(e){return e===void 0||a(e)&&Object.values(e).every(e=>a(e)&&(e.mode===`eager`&&typeof e.component==`function`||e.mode===`lazy`&&a(e.component)&&typeof e.load==`function`))}function Ce(e){return e===void 0||a(e)&&Object.values(e).every(e=>a(e))}function we(e,t){let n=a(e)?e.default:void 0;if(!a(n)||typeof n.name!=`string`||n.name.trim()===``||!Se(n.components)||!Ce(n.extensions)||n.i18n!==void 0&&(!a(n.i18n)||typeof n.i18n.namespace!=`string`||n.i18n.namespace.trim()===``))throw TypeError(`[lattice] Plugin module [${t}] must default export a Plugin object.`);return n}function Te(e,t=xe){return Promise.all(e.map(async e=>we(await t(e),e)))}function Ee(...e){let t={};for(let n of e)for(let[e,r]of Object.entries(n??{}))t[e]={...t[e],...r};return t}function De(...e){return e.reduce((e,t)=>({components:{...e.components,...t.components},extensions:Ee(e.extensions,t.extensions)}),{components:{},extensions:{}})}function Oe(e,...t){return De({name:`registry`,...e},...t)}var ke=typeof globalThis==`object`&&globalThis||typeof window==`object`&&window||typeof self==`object`&&self||typeof global==`object`&&global||(function(){return this})();function Ae(e,t,{signal:n,edges:r}={}){let i,a=null,o=r!=null&&r.includes(`leading`),s=r==null||r.includes(`trailing`),c=()=>{a!==null&&(e.apply(i,a),i=void 0,a=null)},l=()=>{s&&c(),p()},u=null,d=()=>{u!=null&&clearTimeout(u),u=setTimeout(()=>{u=null,l()},t)},f=()=>{u!==null&&(clearTimeout(u),u=null)},p=()=>{f(),i=void 0,a=null},m=()=>{c()},h=function(...e){if(n?.aborted)return;i=this,a=e;let t=u==null;d(),o&&t&&c()};return h.schedule=d,h.cancel=p,h.flush=m,n?.addEventListener(`abort`,p,{once:!0}),h}function je(){}function Me(e){return e==null||typeof e!=`object`&&typeof e!=`function`}function Ne(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Pe(e){if(Me(e))return e;if(Array.isArray(e)||Ne(e)||e instanceof ArrayBuffer||typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer)return e.slice(0);let t=Object.getPrototypeOf(e);if(t==null)return Object.assign(Object.create(t),e);let n=t.constructor;if(e instanceof Date||e instanceof Map||e instanceof Set)return new n(e);if(e instanceof RegExp){let t=new n(e);return t.lastIndex=e.lastIndex,t}if(e instanceof DataView)return new n(e.buffer.slice(0));if(e instanceof Error){let t;return t=e instanceof AggregateError?new n(e.errors,e.message,{cause:e.cause}):new n(e.message,{cause:e.cause}),t.stack=e.stack,Object.assign(t,e),t}return typeof File<`u`&&e instanceof File?new n([e],e.name,{type:e.type,lastModified:e.lastModified}):typeof e==`object`?Object.assign(Object.create(t),e):e}function Fe(e){return ke.Buffer!==void 0&&ke.Buffer.isBuffer(e)}function Ie(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function Le(e){return e==null?e===void 0?`[object Undefined]`:`[object Null]`:Object.prototype.toString.call(e)}var Re=`[object RegExp]`,ze=`[object String]`,Be=`[object Number]`,Ve=`[object Boolean]`,He=`[object Arguments]`,Ue=`[object Symbol]`,We=`[object Date]`,Ge=`[object Map]`,Ke=`[object Set]`,qe=`[object Array]`,Je=`[object Function]`,Ye=`[object ArrayBuffer]`,Xe=`[object Object]`,Ze=`[object Error]`,Qe=`[object DataView]`,$e=`[object Uint8Array]`,et=`[object Uint8ClampedArray]`,tt=`[object Uint16Array]`,nt=`[object Uint32Array]`,rt=`[object BigUint64Array]`,it=`[object Int8Array]`,at=`[object Int16Array]`,ot=`[object Int32Array]`,st=`[object BigInt64Array]`,ct=`[object Float32Array]`,lt=`[object Float64Array]`;function ut(e,t){return dt(e,void 0,e,new Map,t)}function dt(e,t,n,r=new Map,i=void 0){let a=i?.(e,t,n,r);if(a!==void 0)return a;if(Me(e))return e;if(r.has(e))return r.get(e);if(Array.isArray(e)){let t=Array(e.length);r.set(e,t);for(let a=0;a<e.length;a++)t[a]=dt(e[a],a,n,r,i);return Object.hasOwn(e,`index`)&&(t.index=e.index),Object.hasOwn(e,`input`)&&(t.input=e.input),t}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){let t=new RegExp(e.source,e.flags);return t.lastIndex=e.lastIndex,t}if(e instanceof Map){let t=new Map;r.set(e,t);for(let[a,o]of e)t.set(a,dt(o,a,n,r,i));return t}if(e instanceof Set){let t=new Set;r.set(e,t);for(let a of e)t.add(dt(a,void 0,n,r,i));return t}if(Fe(e))return e.subarray();if(Ne(e)){let t=new(Object.getPrototypeOf(e)).constructor(e.length);r.set(e,t);for(let a=0;a<e.length;a++)t[a]=dt(e[a],a,n,r,i);return t}if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){let t=new DataView(e.buffer.slice(0),e.byteOffset,e.byteLength);return r.set(e,t),ft(t,e,n,r,i),t}if(typeof File<`u`&&e instanceof File){let t=new File([e],e.name,{type:e.type});return r.set(e,t),ft(t,e,n,r,i),t}if(typeof Blob<`u`&&e instanceof Blob){let t=new Blob([e],{type:e.type});return r.set(e,t),ft(t,e,n,r,i),t}if(e instanceof Error){let t=structuredClone(e);return r.set(e,t),t.message=e.message,t.name=e.name,t.stack=e.stack,t.cause=e.cause,t.constructor=e.constructor,ft(t,e,n,r,i),t}if(e instanceof Boolean){let t=new Boolean(e.valueOf());return r.set(e,t),ft(t,e,n,r,i),t}if(e instanceof Number){let t=new Number(e.valueOf());return r.set(e,t),ft(t,e,n,r,i),t}if(e instanceof String){let t=new String(e.valueOf());return r.set(e,t),ft(t,e,n,r,i),t}if(typeof e==`object`&&pt(e)){let t=Object.create(Object.getPrototypeOf(e));return r.set(e,t),ft(t,e,n,r,i),t}return e}function ft(e,t,n=e,r,i){let a=[...Object.keys(t),...Ie(t)];for(let o=0;o<a.length;o++){let s=a[o],c=Object.getOwnPropertyDescriptor(e,s);(c==null||c.writable)&&(e[s]=dt(t[s],s,n,r,i))}}function pt(e){switch(Le(e)){case He:case qe:case Ye:case Qe:case Ve:case We:case ct:case lt:case it:case at:case ot:case Ge:case Be:case Xe:case Re:case Ke:case ze:case Ue:case $e:case et:case tt:case nt:return!0;default:return!1}}function mt(e){return dt(e,void 0,e,new Map,void 0)}function ht(e){if(!e||typeof e!=`object`)return!1;let t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null?!1:Object.prototype.toString.call(e)===`[object Object]`}function gt(e){return e===`__proto__`}function _t(e){if(typeof e!=`object`||!e)return!1;if(Object.getPrototypeOf(e)===null)return!0;if(Object.prototype.toString.call(e)!==`[object Object]`){let t=e[Symbol.toStringTag];return t==null||!Object.getOwnPropertyDescriptor(e,Symbol.toStringTag)?.writable?!1:e.toString()===`[object ${t}]`}let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function vt(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}function yt(e,t,n){return bt(e,t,void 0,void 0,void 0,void 0,n)}function bt(e,t,n,r,i,a,o){let s=o(e,t,n,r,i,a);if(s!==void 0)return s;if(typeof e==typeof t)switch(typeof e){case`bigint`:case`string`:case`boolean`:case`symbol`:case`undefined`:return e===t;case`number`:return e===t||Object.is(e,t);case`function`:return e===t;case`object`:return xt(e,t,a,o)}return xt(e,t,a,o)}function xt(e,t,n,r){if(Object.is(e,t))return!0;let i=Le(e),a=Le(t);if(i===`[object Arguments]`&&(i=Xe),a===`[object Arguments]`&&(a=Xe),i!==a)return!1;switch(i){case ze:return e.toString()===t.toString();case Be:return vt(e.valueOf(),t.valueOf());case Ve:case We:case Ue:return Object.is(e.valueOf(),t.valueOf());case Re:return e.source===t.source&&e.flags===t.flags;case Je:return e===t}n??=new Map;let o=n.get(e),s=n.get(t);if(o!=null&&s!=null)return o===t;n.set(e,t),n.set(t,e);try{switch(i){case Ge:if(e.size!==t.size)return!1;for(let[i,a]of e.entries())if(!t.has(i)||!bt(a,t.get(i),i,e,t,n,r))return!1;return!0;case Ke:{if(e.size!==t.size)return!1;let i=Array.from(e.values()),a=Array.from(t.values());for(let o=0;o<i.length;o++){let s=i[o],c=a.findIndex(i=>bt(s,i,void 0,e,t,n,r));if(c===-1)return!1;a.splice(c,1)}return!0}case qe:case $e:case et:case tt:case nt:case rt:case it:case at:case ot:case st:case ct:case lt:if(Fe(e)!==Fe(t)||e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(!bt(e[i],t[i],i,e,t,n,r))return!1;return!0;case Ye:return e.byteLength===t.byteLength&&xt(new Uint8Array(e),new Uint8Array(t),n,r);case Qe:return e.byteLength!==t.byteLength||e.byteOffset!==t.byteOffset?!1:xt(new Uint8Array(e),new Uint8Array(t),n,r);case Ze:return e.name===t.name&&e.message===t.message;case Xe:{if(!(xt(e.constructor,t.constructor,n,r)||ht(e)&&ht(t)))return!1;let i=[...Object.keys(e),...Ie(e)],a=[...Object.keys(t),...Ie(t)];if(i.length!==a.length)return!1;for(let a=0;a<i.length;a++){let o=i[a],s=e[o];if(!Object.hasOwn(t,o))return!1;let c=t[o];if(!bt(s,c,o,e,t,n,r))return!1}return!0}default:return!1}}finally{n.delete(e),n.delete(t)}}function St(e,t){return yt(e,t,je)}function Ct(e){return Number.isSafeInteger(e)&&e>=0}var wt={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`};function Tt(e){return e.replace(/[&<>"']/g,e=>wt[e])}function Et(e){return e!=null&&typeof e!=`function`&&Ct(e.length)}function Dt(e){if(e==null)return``;if(typeof e==`string`)return e;if(Array.isArray(e))return e.map(Dt).join(`,`);let t=String(e);return t===`0`&&Object.is(Number(e),-0)?`-0`:t}function Ot(e){return typeof e==`string`||typeof e==`symbol`?e:Object.is(e?.valueOf?.(),-0)?`-0`:String(e)}function kt(e){if(Array.isArray(e))return e.map(Ot);if(typeof e==`symbol`)return[e];e=Dt(e);let t=[],n=e.length;if(n===0)return t;let r=0,i=``,a=``,o=!1;for(e.charCodeAt(0)===46&&t.push(``);r<n;){let s=e[r];if(a)s===`\\`&&r+1<n?(r++,i+=e[r]):s===a?a=``:i+=s;else if(o)s===`"`||s===`'`?a=s:s===`]`?(o=!1,t.push(i),i=``):i+=s;else if(s===`[`)o=!0,i&&=(t.push(i),``);else if(s===`.`){i&&=(t.push(i),``);let n=e[r+1];(n===void 0||n===`.`)&&t.push(``)}else i+=s;r++}return i&&t.push(i),t}var At=/\.|(\[(?:[^[\]]*|(["'])(?:(?!\2)[^\\]|\\.)*?\2)\])/;function jt(e){switch(typeof e){case`number`:case`symbol`:return!1;case`string`:return e===``||e.startsWith(`.`)||e.endsWith(`.`)?!1:At.test(e);default:return!1}}function Mt(e,t,n){if(e==null)return n;switch(typeof t){case`string`:{if(gt(t))return n;let r=e[t];return r===void 0?jt(t)&&!Object.hasOwn(e,t)?Mt(e,kt(t),n):n:r}case`number`:case`symbol`:{typeof t==`number`&&(t=Ot(t));let r=e[t];return r===void 0?n:r}default:{if(Array.isArray(t))return Nt(e,t,n);if(t=Object.is(t?.valueOf(),-0)?`-0`:String(t),gt(t))return n;let r=e[t];return r===void 0?n:r}}}function Nt(e,t,n){if(t.length===0)return n;let r=e;for(let e=0;e<t.length;e++){if(r==null||gt(t[e]))return n;r=r[t[e]]}return r===void 0?n:r}function Pt(e){return e!==null&&(typeof e==`object`||typeof e==`function`)}function Ft(e,t){return ut(e,(n,r,i,a)=>{let o=t?.(n,r,i,a);if(o!==void 0)return o;if(typeof e==`object`){if(Le(e)===`[object Object]`&&typeof e.constructor!=`function`){let t={};return a.set(e,t),ft(t,e,i,a),t}switch(Object.prototype.toString.call(e)){case Be:case ze:case Ve:{let t=new e.constructor(e?.valueOf());return ft(t,e),t}case He:{let t={};return ft(t,e),t.length=e.length,t[Symbol.iterator]=e[Symbol.iterator],t}default:return}}})}function It(e){return Ft(e)}function Lt(e){return typeof e==`object`&&!!e&&Le(e)===`[object Arguments]`}var Rt=/^(?:0|[1-9]\d*)$/;function zt(e,t=2**53-1){switch(typeof e){case`number`:return Number.isInteger(e)&&e>=0&&e<t;case`symbol`:return!1;case`string`:return Rt.test(e)}}function Bt(e,t){let n;if(n=Array.isArray(t)?t:typeof t==`string`&&jt(t)&&!(t in Object(e))?kt(t):[t],n.length===0)return!1;let r=e;for(let e=0;e<n.length;e++){let t=n[e];if((r==null||!Object.hasOwn(r,t))&&!((Array.isArray(r)||Lt(r))&&zt(t)&&t<r.length))return!1;r=r[t]}return!0}function Vt(e){return typeof e==`object`&&!!e}function Ht(e){return Vt(e)&&Et(e)}function Ut(e){return typeof e==`symbol`||e instanceof Symbol}var Wt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Gt=/^\w*$/;function Kt(e,t){return Array.isArray(e)?!1:typeof e==`number`||typeof e==`boolean`||e==null||Ut(e)?!0:typeof e==`string`&&(Gt.test(e)||!Wt.test(e))||t!=null&&Object.hasOwn(t,e)}function qt(e){return Ne(e)}var Jt=(e,t,n)=>{let r=e[t];(!(Object.hasOwn(e,t)&&vt(r,n))||n===void 0&&!(t in e))&&(e[t]=n)};function Yt(e,t,n,r){if(e==null&&!Pt(e))return e;let i;i=Kt(t,e)?[t]:Array.isArray(t)?t:kt(t);let a=n(Mt(e,i)),o=e;for(let t=0;t<i.length&&o!=null;t++){let n=Ot(i[t]);if(gt(n))continue;let s;if(t===i.length-1)s=a;else{let a=o[n],c=r?.(a,n,e);s=c===void 0?Pt(a)?a:zt(i[t+1])?[]:{}:c}Jt(o,n,s),o=o[n]}return e}function Xt(e,t,n){return Yt(e,t,()=>n,()=>void 0)}function Zt(e,t=0,n={}){typeof n!=`object`&&(n={});let{leading:r=!1,trailing:i=!0,maxWait:a}=n,o=[,,];r&&(o[0]=`leading`),i&&(o[1]=`trailing`);let s,c=null,l=Ae(function(...t){s=e.apply(this,t),c=null},t,{edges:o}),u=function(...t){return a!=null&&(c===null&&(c=Date.now()),Date.now()-c>=a)?(s=e.apply(this,t),c=Date.now(),l.cancel(),l.schedule(),s):(l.apply(this,t),s)};return u.cancel=l.cancel,u.flush=()=>(l.flush(),s),u}function Qt(e,...t){let n=t.slice(0,-1),r=t[t.length-1],i=e;for(let e=0;e<n.length;e++){let t=n[e];i=$t(i,t,r,new Map)}return i}function $t(e,t,n,r){if(Me(e)&&(e=Object(e)),typeof t!=`object`||!t)return e;if(r.has(t))return Pe(r.get(t));if(r.set(t,e),Array.isArray(t)){t=t.slice();for(let e=0;e<t.length;e++)t[e]=t[e]??void 0}let i=[...Object.keys(t),...Ie(t)];for(let a=0;a<i.length;a++){let o=i[a];if(gt(o))continue;let s=t[o],c=e[o];if(Lt(s)&&(s={...s}),Lt(c)&&(c={...c}),Fe(s)&&(s=It(s)),Array.isArray(s))if(Array.isArray(c)){let e=[],t=Reflect.ownKeys(c);for(let n=0;n<t.length;n++){let r=t[n];e[r]=c[r]}c=e}else if(Ht(c)){let e=[];for(let t=0;t<c.length;t++)e[t]=c[t];c=e}else c=[];let l=n(c,s,o,e,t,r);l===void 0?Array.isArray(s)||Vt(c)&&Vt(s)&&(_t(c)||_t(s)||qt(c)||qt(s))?e[o]=$t(c,s,n,r):c==null&&_t(s)?e[o]=$t({},s,n,r):c==null&&qt(s)?e[o]=It(s):(c===void 0||s!==void 0)&&(e[o]=s):e[o]=l}return e}function en(e,...t){return Qt(e,...t,je)}function tn(e){return Tt(Dt(e))}var nn=e=>typeof File<`u`&&e instanceof File||e instanceof Blob||typeof FileList<`u`&&e instanceof FileList&&e.length>0,rn=e=>e instanceof FormData||nn(e)||typeof e==`object`&&!!e&&Object.values(e).some(e=>rn(e)),an=class extends Error{response;constructor(e){super(`HTTP error ${e.status}`),this.name=`HttpResponseError`,this.response=e}},on=class extends Error{constructor(e=`Request was cancelled`){super(e),this.name=`HttpCancelledError`}},sn=class extends Error{constructor(e=`Network error`){super(e),this.name=`HttpNetworkError`}};function cn(e){let t=new URLSearchParams;return Object.entries(e).forEach(([e,n])=>{n!=null&&(Array.isArray(n)?n.forEach(n=>t.append(`${e}[]`,String(n))):typeof n==`object`?t.append(e,JSON.stringify(n)):t.append(e,String(n)))}),t.toString()}function ln(e,t,n){if(t&&!e.startsWith(`http://`)&&!e.startsWith(`https://`)&&(e=t.replace(/\/$/,``)+`/`+e.replace(/^\//,``)),n&&Object.keys(n).length>0){let t=cn(n);t&&(e+=(e.includes(`?`)?`&`:`?`)+t)}return e}function un(){return typeof window>`u`?null:window.axios?.defaults?.headers?.common?.[`X-Requested-With`]??null}function dn(e,t=new FormData,n=null){for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&fn(t,n?`${n}[${r}]`:r,e[r]);return t}function fn(e,t,n){if(Array.isArray(n))return n.forEach((n,r)=>fn(e,`${t}[${r}]`,n));if(n instanceof Date)return e.append(t,n.toISOString());if(typeof File<`u`&&n instanceof File)return e.append(t,n,n.name);if(n instanceof Blob)return e.append(t,n);if(typeof n==`boolean`)return e.append(t,n?`1`:`0`);if(typeof n==`string`)return e.append(t,n);if(typeof n==`number`)return e.append(t,`${n}`);if(n==null)return e.append(t,``);dn(n,e,t)}function pn(e,t){if(e!=null)return e instanceof FormData?e:typeof e==`object`&&rn(e)?dn(e):typeof e==`object`||t[`Content-Type`]?.includes(`application/json`)?JSON.stringify(e):String(e)}function mn(e){let t={};return e.forEach((e,n)=>{t[n.toLowerCase()]=e}),t}function hn(e={}){let t=e.xsrfCookieName??`XSRF-TOKEN`,n=e.xsrfHeaderName??`X-XSRF-TOKEN`;function r(){if(typeof document>`u`)return null;let e=document.cookie.match(RegExp(`(^|;\\s*)`+t+`=([^;]*)`));return e?decodeURIComponent(e[2]):null}return{setXsrfCookieName(e){t=e},setXsrfHeaderName(e){n=e},async request(e){let t=ln(e.url,e.baseURL,e.params),i=e.method.toUpperCase(),a={},o=un();o&&(a[`X-Requested-With`]=o),e.data!==void 0&&![`GET`,`DELETE`].includes(i)&&!(e.data instanceof FormData)&&!rn(e.data)&&(a[`Content-Type`]=`application/json`),e.headers&&Object.entries(e.headers).forEach(([e,t])=>{t!==void 0&&(a[e]=String(t))});let s=r();s&&![`GET`,`HEAD`,`OPTIONS`].includes(i)&&(a[n]=s);let c=e.signal,l,u=e.timeout??3e4;if(u>0&&!c){let e=new AbortController;c=e.signal,l=setTimeout(()=>e.abort(),u)}let d=[`GET`,`DELETE`].includes(i)?void 0:pn(e.data,a);d instanceof FormData&&delete a[`Content-Type`];try{let n=await fetch(t,{method:i,headers:a,body:d,signal:c,credentials:e.credentials??`same-origin`});l&&clearTimeout(l);let r;r=n.headers.get(`content-type`)?.includes(`application/json`)?await n.json():await n.text();let o={status:n.status,data:r,headers:mn(n.headers)};if(!n.ok)throw new an(o);return o}catch(e){throw l&&clearTimeout(l),e instanceof an?e:e instanceof DOMException&&e.name===`AbortError`?new on:e instanceof TypeError?new sn(e.message):e}}}}var gn=hn(),_n=gn,vn=void 0,yn=void 0,bn=`same-origin`,xn=e=>`${e.method}:${e.baseURL??vn??``}${e.url}`,Sn=e=>e.status===204&&e.headers[`precognition-success`]===`true`,Cn={},wn={get:(e,t={},n={})=>En(Tn(`get`,e,t,n)),post:(e,t={},n={})=>En(Tn(`post`,e,t,n)),patch:(e,t={},n={})=>En(Tn(`patch`,e,t,n)),put:(e,t={},n={})=>En(Tn(`put`,e,t,n)),delete:(e,t={},n={})=>En(Tn(`delete`,e,t,n)),useHttpClient(e){return _n=e,wn},withBaseURL(e){return vn=e,wn},withTimeout(e){return yn=e,wn},withCredentials(e){return bn=typeof e==`string`?e:e?`include`:`omit`,wn},fingerprintRequestsUsing(e){return xn=e===null?()=>null:e,wn},determineSuccessUsing(e){return Sn=e,wn},withXsrfCookieName(e){return gn.setXsrfCookieName(e),wn},withXsrfHeaderName(e){return gn.setXsrfHeaderName(e),wn}},Tn=(e,t,n,r)=>({url:t,method:e,...r,...[`get`,`delete`].includes(e)?{params:en({},n,r?.params)}:{data:en({},n,r?.data)}}),En=(e={})=>{let t=[Dn,kn,An].reduce((e,t)=>t(e),e);return(t.onBefore??(()=>!0))()===!1?Promise.resolve(null):((t.onStart??(()=>null))(),_n.request({method:t.method,url:t.url,baseURL:t.baseURL??vn,data:t.data,params:t.params,headers:t.headers,signal:t.signal,timeout:t.timeout,credentials:bn}).then(async e=>{t.precognitive&&jn(e);let n=e.status,r=e;return t.precognitive&&t.onPrecognitionSuccess&&Sn(e)&&(r=await Promise.resolve(t.onPrecognitionSuccess(e)??r)),t.onSuccess&&On(n)&&(r=await Promise.resolve(t.onSuccess(r)??r)),(Nn(t,n)??(e=>e))(r)??r},e=>{if(Mn(e))return Promise.reject(e);let n=e;return t.precognitive&&jn(n.response),(Nn(t,n.response.status)??((e,t)=>Promise.reject(t)))(n.response,n)}).finally(t.onFinish??(()=>null)))},Dn=e=>{let t=e.only??e.validate;return{...e,timeout:e.timeout??yn,precognitive:e.precognitive!==!1,fingerprint:e.fingerprint===void 0?xn(e,_n):e.fingerprint,headers:{...e.headers,Accept:`application/json`,"Content-Type":Pn(e),...e.precognitive===!1?{}:{Precognition:!0},...t?{"Precognition-Validate-Only":Array.from(t).join()}:{}}}},On=e=>e>=200&&e<300,kn=e=>typeof e.fingerprint==`string`?(Cn[e.fingerprint]?.abort(),delete Cn[e.fingerprint],e):e,An=e=>typeof e.fingerprint!=`string`||e.signal||!e.precognitive?e:(Cn[e.fingerprint]=new AbortController,{...e,signal:Cn[e.fingerprint].signal}),jn=e=>{if(e.headers?.precognition!==`true`)throw Error(`Did not receive a Precognition response. Ensure you have the Precognition middleware in place for the route.`)},Mn=e=>!(e instanceof an)||typeof e.response?.status!=`number`,Nn=(e,t)=>({401:e.onUnauthorized,403:e.onForbidden,404:e.onNotFound,409:e.onConflict,422:e.onValidationError,423:e.onLocked})[t],Pn=e=>e.headers?.[`Content-Type`]??e.headers?.[`Content-type`]??e.headers?.[`content-type`]??(rn(e.data)?`multipart/form-data`:`application/json`),Fn=(e,t)=>{if(!e.includes(`*`))return[e];let n=e.split(`.`),r=[``];for(let e of n)if(e===`*`){let e=[];for(let n of r){let r=n?Mt(t,n):t;if(Array.isArray(r))for(let t=0;t<r.length;t++)e.push(n?`${n}.${t}`:String(t));else if(typeof r==`object`&&r)for(let t of Object.keys(r))e.push(n?`${n}.${t}`:t)}r=e}else r=r.map(t=>t?`${t}.${e}`:e);return r},In=(e,t)=>t.includes(`*`)?RegExp(`^`+t.replace(/\./g,`\\.`).replace(/\*/g,`[^.]+`)+`$`).test(e):e===t,Ln=(e,t)=>Object.fromEntries(Object.entries(e).filter(([e])=>!t.some(t=>In(e,t)))),Rn=(e,t={})=>{let n={errorsChanged:[],touchedChanged:[],validatingChanged:[],validatedChanged:[]},r=!1,i=!1,a=e=>e===i?[]:(i=e,n.validatingChanged),o=[],s=e=>{let t=[...new Set(e)];return o.length!==t.length||!t.every(e=>o.includes(e))?(o=t,n.validatedChanged):[]},c=()=>o.filter(e=>d[e]===void 0),l=[],u=e=>{let t=[...new Set(e)];return l.length!==t.length||!t.every(e=>l.includes(e))?(l=t,n.touchedChanged):[]},d={},f=e=>{let t=Bn(e);return St(d,t)?[]:(d=t,n.errorsChanged)},p=e=>{let t={...d};return delete t[Vn(e)],f(t)},m=()=>Object.keys(d).length>0,h=1500,g=e=>{h=e,S.cancel(),S=x()},_=t,v=null,y=[],b=null,x=()=>Zt(t=>{e({get:(e,n={},r={})=>wn.get(e,T(n),C(r,t,n)),post:(e,n={},r={})=>wn.post(e,T(n),C(r,t,n)),patch:(e,n={},r={})=>wn.patch(e,T(n),C(r,t,n)),put:(e,n={},r={})=>wn.put(e,T(n),C(r,t,n)),delete:(e,n={},r={})=>wn.delete(e,T(n),C(r,t,n))}).catch(e=>e instanceof on||e instanceof an&&e.response?.status===422?null:Promise.reject(e))},h,{leading:!0,trailing:!0}),S=x(),C=(e,t,n={})=>{let r={...e,...t},i=Array.from(r.only??r.validate??l);return{...t,...en({},e,t),only:i,timeout:r.timeout??5e3,onValidationError:(e,t)=>([...s([...o,...i]),...f(en(Ln({...d},i),e.data.errors))].forEach(e=>e()),r.onValidationError?r.onValidationError(e,t):Promise.reject(t)),onSuccess:e=>(s([...o,...i]).forEach(e=>e()),r.onSuccess?r.onSuccess(e):e),onPrecognitionSuccess:e=>([...s([...o,...i]),...f(Ln({...d},i))].forEach(e=>e()),r.onPrecognitionSuccess?r.onPrecognitionSuccess(e):e),onBefore:()=>{let e=l.some(e=>e.includes(`*`)),t=e?[...new Set(l.flatMap(e=>Fn(e,n)))]:l;return r.onBeforeValidation&&r.onBeforeValidation({data:n,touched:t},{data:_,touched:y})===!1||(r.onBefore||(()=>!0))()===!1?!1:(e&&u(t).forEach(e=>e()),b=l,v=n,!0)},onStart:()=>{a(!0).forEach(e=>e()),(r.onStart??(()=>null))()},onFinish:()=>{a(!1).forEach(e=>e()),y=b,_=v,b=v=null,(r.onFinish??(()=>null))()}}},w=(e,t,n)=>{if(e===void 0){let e=Array.from(n?.only??n?.validate??[]);u([...l,...e]).forEach(e=>e()),S(n??{});return}if(nn(t)&&!r){console.warn(`Precognition file validation is not active. Call the "validateFiles" function on your form to enable it.`);return}e=Vn(e),(e.includes(`*`)||Mt(_,e)!==t)&&(u([e,...l]).forEach(e=>e()),S(n??{}))},T=e=>r===!1?Hn(e):e,E={touched:()=>l,validate(e,t,n){return typeof e==`object`&&!(`target`in e)&&(n=e,e=t=void 0),w(e,t,n),E},touch(e){let t=Array.isArray(e)?e:[Vn(e)];return u([...l,...t]).forEach(e=>e()),E},validating:()=>i,valid:c,errors:()=>d,hasErrors:m,setErrors(e){return f(e).forEach(e=>e()),E},forgetError(e){return p(e).forEach(e=>e()),E},defaults(e){return t=e,_=e,E},reset(...e){if(e.length===0)u([]).forEach(e=>e());else{let n=[...l];e.forEach(e=>{n.includes(e)&&n.splice(n.indexOf(e),1),Xt(_,e,Mt(t,e))}),u(n).forEach(e=>e())}return E},setTimeout(e){return g(e),E},on(e,t){return n[e].push(t),E},validateFiles(){return r=!0,E},withoutFileValidation(){return r=!1,E}};return E},zn=e=>Object.keys(e).reduce((t,n)=>({...t,[n]:Array.isArray(e[n])?e[n][0]:e[n]}),{}),Bn=e=>Object.keys(e).reduce((t,n)=>({...t,[n]:typeof e[n]==`string`?[e[n]]:e[n]}),{}),Vn=e=>typeof e==`string`?e:e.target.name,Hn=e=>{let t={...e};return Object.keys(t).forEach(e=>{let n=t[e];if(n!==null){if(nn(n)){delete t[e];return}if(Array.isArray(n)){t[e]=Object.values(Hn({...n}));return}if(typeof n==`object`){t[e]=Hn(t[e]);return}}}),t},Un=new class{config={};defaults;constructor(e){this.defaults=e}extend(e){return e&&(this.defaults={...this.defaults,...e}),this}replace(e){this.config=e}get(e){return Bt(this.config,e)?Mt(this.config,e):Mt(this.defaults,e)}set(e,t){typeof e==`string`?Xt(this.config,e,t):Object.entries(e).forEach(([e,t])=>{Xt(this.config,e,t)})}}({form:{recentlySuccessfulDuration:2e3,forceIndicesArrayFormatInFormData:!0,withAllErrors:!1},prefetch:{cacheFor:3e4,hoverDelay:75}});function Wn(e,t){let n;return function(...r){clearTimeout(n),n=setTimeout(()=>e.apply(this,r),t)}}function Gn(e,t){return document.dispatchEvent(new CustomEvent(`inertia:${e}`,t))}var Kn=e=>Gn(`before`,{cancelable:!0,detail:{visit:e}}),qn=(e,{page:t,visitId:n}={})=>Gn(`error`,{detail:{errors:e,page:t,visitId:n}}),Jn=e=>Gn(`networkError`,{cancelable:!0,detail:{error:e}}),Yn=e=>Gn(`finish`,{detail:{visit:e}}),Xn=e=>Gn(`httpException`,{cancelable:!0,detail:{response:e}}),Zn=e=>Gn(`beforeUpdate`,{detail:{page:e}}),Qn=(e,{cached:t=!1,visitId:n}={})=>Gn(`navigate`,{detail:{page:e,cached:t,visitId:n}}),$n=(e,{replace:t,visitId:n})=>Gn(`clientVisit`,{detail:{page:e,replace:t,visitId:n}}),er=e=>Gn(`progress`,{detail:{progress:e}}),tr=e=>Gn(`start`,{detail:{visit:e}}),nr=(e,{visitId:t}={})=>Gn(`success`,{detail:{page:e,visitId:t}}),rr=(e,t)=>Gn(`prefetched`,{detail:{fetchedAt:Date.now(),response:e,visit:t}}),ir=e=>Gn(`prefetching`,{detail:{visit:e}}),ar=e=>Gn(`flash`,{detail:{flash:e}}),or=(e,t)=>Gn(`location`,{cancelable:!0,detail:{url:e,versionChange:t}}),sr=class{static locationVisitKey=`inertiaLocationVisit`;static set(e,t){typeof window<`u`&&window.sessionStorage.setItem(e,JSON.stringify(t))}static get(e){if(typeof window<`u`)return JSON.parse(window.sessionStorage.getItem(e)||`null`)}static merge(e,t){let n=this.get(e);n===null?this.set(e,t):this.set(e,{...n,...t})}static remove(e){typeof window<`u`&&window.sessionStorage.removeItem(e)}static removeNested(e,t){let n=this.get(e);n!==null&&(delete n[t],this.set(e,n))}static exists(e){try{return this.get(e)!==null}catch{return!1}}static clear(){typeof window<`u`&&window.sessionStorage.clear()}},cr=async e=>{if(typeof window>`u`)throw Error(`Unable to encrypt history`);let t=pr(),n=await gr(await _r());if(!n)throw Error(`Unable to encrypt history`);return await dr(t,n,e)},lr={key:`historyKey`,iv:`historyIv`},ur=async e=>{let t=pr(),n=await _r();if(!n)throw Error(`Unable to decrypt history`);return await fr(t,n,e)},dr=async(e,t,n)=>{if(typeof window>`u`)throw Error(`Unable to encrypt history`);if(window.crypto.subtle===void 0)return console.warn(`Encryption is not supported in this environment. SSL is required.`),Promise.resolve(n);let r=new TextEncoder,i=JSON.stringify(n),a=new Uint8Array(i.length*3),o=r.encodeInto(i,a);return window.crypto.subtle.encrypt({name:`AES-GCM`,iv:e},t,a.subarray(0,o.written))},fr=async(e,t,n)=>{if(window.crypto.subtle===void 0)return console.warn(`Decryption is not supported in this environment. SSL is required.`),Promise.resolve(n);let r=await window.crypto.subtle.decrypt({name:`AES-GCM`,iv:e},t,n);return JSON.parse(new TextDecoder().decode(r))},pr=()=>{let e=sr.get(lr.iv);if(e)return new Uint8Array(e);let t=window.crypto.getRandomValues(new Uint8Array(12));return sr.set(lr.iv,Array.from(t)),t},mr=async()=>window.crypto.subtle===void 0?(console.warn(`Encryption is not supported in this environment. SSL is required.`),Promise.resolve(null)):window.crypto.subtle.generateKey({name:`AES-GCM`,length:256},!0,[`encrypt`,`decrypt`]),hr=async e=>{if(window.crypto.subtle===void 0)return console.warn(`Encryption is not supported in this environment. SSL is required.`),Promise.resolve();let t=await window.crypto.subtle.exportKey(`raw`,e);sr.set(lr.key,Array.from(new Uint8Array(t)))},gr=async e=>{if(e)return e;let t=await mr();return t?(await hr(t),t):null},_r=async()=>{let e=sr.get(lr.key);return e?await window.crypto.subtle.importKey(`raw`,new Uint8Array(e),{name:`AES-GCM`,length:256},!0,[`encrypt`,`decrypt`]):null},vr=e=>{let t={};for(let n of Object.keys(e))e[n]!==void 0&&(t[n]=e[n]);return t},yr=(e,t,n)=>{if(e===t)return!0;for(let r in e)if(!n.includes(r)&&e[r]!==t[r]&&!br(e[r],t[r]))return!1;for(let r in t)if(!n.includes(r)&&!(r in e))return!1;return!0},br=(e,t)=>{switch(typeof e){case`object`:return yr(e,t,[]);case`function`:return e.toString()===t.toString();default:return e===t}},xr={ms:1,s:1e3,m:6e4,h:36e5,d:864e5},Sr=e=>{if(typeof e==`number`)return e;for(let[t,n]of Object.entries(xr))if(e.endsWith(t))return parseFloat(e)*n;return parseInt(e)},Cr=new class{cached=[];inFlightRequests=[];removalTimers=[];currentUseId=null;add(e,t,{cacheFor:n,cacheTags:r}){if(this.findInFlight(e))return Promise.resolve();let i=this.findCached(e);if(!e.fresh&&i&&i.staleTimestamp>Date.now())return Promise.resolve();let[a,o]=this.extractStaleValues(n),s=new Promise((n,r)=>{t({...e,onCancel:()=>{this.remove(e),e.onCancel(),r()},onError:t=>{this.remove(e),e.onError(t),r()},onPrefetching(t){e.onPrefetching(t)},onPrefetched(t,n){e.onPrefetched(t,n)},onPrefetchResponse(e){n(e)},onPrefetchError(t){Cr.removeFromInFlight(e),r(t)}})}).then(t=>{this.remove(e);let n=t.getPageResponse();V.mergeOncePropsIntoResponse(n),this.cached.push({params:{...e},staleTimestamp:Date.now()+a,expiresAt:Date.now()+o,response:s,singleUse:o===0,timestamp:Date.now(),inFlight:!1,tags:Array.isArray(r)?r:[r]});let i=this.getShortestOncePropTtl(n);return this.scheduleForRemoval(e,i?Math.min(o,i):o),this.removeFromInFlight(e),t.handlePrefetch(),t});return this.inFlightRequests.push({params:{...e},response:s,staleTimestamp:null,inFlight:!0}),s}removeAll(){this.cached=[],this.removalTimers.forEach(e=>{clearTimeout(e.timer)}),this.removalTimers=[]}removeByTags(e){this.cached=this.cached.filter(t=>!t.tags.some(t=>e.includes(t)))}remove(e){this.cached=this.cached.filter(t=>!this.paramsAreEqual(t.params,e)),this.clearTimer(e)}removeFromInFlight(e){this.inFlightRequests=this.inFlightRequests.filter(t=>!this.paramsAreEqual(t.params,e))}extractStaleValues(e){let[t,n]=this.cacheForToStaleAndExpires(e);return[Sr(t),Sr(n)]}cacheForToStaleAndExpires(e){if(!Array.isArray(e))return[e,e];switch(e.length){case 0:return[0,0];case 1:return[e[0],e[0]];default:return[e[0],e[1]]}}clearTimer(e){let t=this.removalTimers.find(t=>this.paramsAreEqual(t.params,e));t&&(clearTimeout(t.timer),this.removalTimers=this.removalTimers.filter(e=>e!==t))}scheduleForRemoval(e,t){if(!(typeof window>`u`)&&(this.clearTimer(e),t>0)){let n=window.setTimeout(()=>this.remove(e),t);this.removalTimers.push({params:e,timer:n})}}get(e){return this.findCached(e)||this.findInFlight(e)}use(e,t){let n=`${t.url.pathname}-${Date.now()}-${Math.random().toString(36).substring(7)}`;this.currentUseId=n;let r={...t,cached:!0};return e.response.then(e=>{if(this.currentUseId===n)return e.mergeParams({...r,onPrefetched:()=>{}}),this.removeSingleUseItems(t),e.handle()})}removeSingleUseItems(e){this.cached=this.cached.filter(t=>!this.paramsAreEqual(t.params,e)||!t.singleUse)}findCached(e){return this.cached.find(t=>this.paramsAreEqual(t.params,e))||null}findInFlight(e){return this.inFlightRequests.find(t=>this.paramsAreEqual(t.params,e))||null}withoutPurposePrefetchHeader(e){let t=mt(e);return t.headers.Purpose===`prefetch`&&delete t.headers.Purpose,t}paramsAreEqual(e,t){return yr(this.withoutPurposePrefetchHeader(e),this.withoutPurposePrefetchHeader(t),[`id`,`showProgress`,`replace`,`prefetch`,`preserveScroll`,`preserveState`,`onBefore`,`onBeforeUpdate`,`onStart`,`onProgress`,`onFinish`,`onCancel`,`onSuccess`,`onError`,`onFlash`,`onPrefetched`,`onCancelToken`,`onPrefetching`,`async`,`viewTransition`,`optimistic`,`component`,`pageProps`,`cached`])}updateCachedOncePropsFromCurrentPage(){this.cached.forEach(e=>{e.response.then(t=>{let n=t.getPageResponse();V.mergeOncePropsIntoResponse(n,{force:!0});for(let[e,t]of Object.entries(n.deferredProps??{})){let r=t.filter(e=>Mt(n.props,e)===void 0);r.length>0?n.deferredProps[e]=r:delete n.deferredProps[e]}let r=this.getShortestOncePropTtl(n);if(r===null)return;let i=e.expiresAt-Date.now(),a=Math.min(i,r);a>0?this.scheduleForRemoval(e.params,a):this.remove(e.params)})})}getShortestOncePropTtl(e){let t=Object.values(e.onceProps??{}).map(e=>e.expiresAt).filter(e=>!!e);return t.length===0?null:Math.min(...t)-Date.now()}},wr=e=>{if(e.offsetParent===null)return!1;let t=e.getBoundingClientRect(),n=t.top<window.innerHeight&&t.bottom>=0,r=t.left<window.innerWidth&&t.right>=0;return n&&r},Tr=e=>{let t=e=>{let t=window.getComputedStyle(e);return t.overflowY===`scroll`?!0:t.overflowY===`auto`?[`visible`,`clip`].includes(t.overflowX)?!0:r(t.maxHeight,e.style.height)||i(e,`height`):!1},n=e=>{let t=window.getComputedStyle(e);return t.overflowX===`scroll`?!0:t.overflowX===`auto`?[`visible`,`clip`].includes(t.overflowY)?!0:r(t.maxWidth,e.style.width)||i(e,`width`):!1},r=(e,t)=>!!(e&&e!==`none`&&e!==`0px`||t&&t!==`auto`&&t!==`0`),i=(e,t)=>{let n=e.parentElement;if(!n)return!1;let r=window.getComputedStyle(n);if([`flex`,`inline-flex`].includes(r.display)){let e=[`column`,`column-reverse`].includes(r.flexDirection);return t===`height`?e:!e}return[`grid`,`inline-grid`].includes(r.display)},a=e?.parentElement;for(;a;){let e=t(a)||n(a);if(window.getComputedStyle(a).display!==`contents`&&e)return a;a=a.parentElement}return null},Er=(e,t)=>{if(!t)return e.filter(e=>wr(e));let n=e.indexOf(t),r=[],i=[];for(let t=n;t>=0;t--){let n=e[t];if(wr(n))r.push(n);else break}for(let t=n+1;t<e.length;t++){let n=e[t];if(wr(n))i.push(n);else break}return[...r.reverse(),...i]},Dr=(e,t=1)=>{window.requestAnimationFrame(()=>{t>1?Dr(e,t-1):e()})},Or=e=>{if(typeof window>`u`)return null;let t=document.querySelector(`script[data-page="${e}"][type="application/json"]`);return t?.textContent?JSON.parse(t.textContent):null},kr=typeof window>`u`,Ar=!kr&&/Firefox/i.test(window.navigator.userAgent),jr=class{static save(){H.saveScrollPositions(this.getScrollRegions())}static getScrollRegions(){return Array.from(this.regions()).map(e=>({top:e.scrollTop,left:e.scrollLeft}))}static regions(){return document.querySelectorAll(`[scroll-region]`)}static scrollToTop(){if(Ar&&getComputedStyle(document.documentElement).scrollBehavior===`smooth`)return Dr(()=>window.scrollTo(0,0),2);window.scrollTo(0,0)}static reset(){!kr&&window.location.hash||this.scrollToTop(),this.regions().forEach(e=>{typeof e.scrollTo==`function`?e.scrollTo(0,0):(e.scrollTop=0,e.scrollLeft=0)}),this.save(),this.scrollToAnchor()}static scrollToAnchor(){let e=kr?null:window.location.hash;e&&setTimeout(()=>{let t=document.getElementById(e.slice(1));t?t.scrollIntoView():this.scrollToTop()})}static restore(e){kr||window.requestAnimationFrame(()=>{this.restoreDocument(),this.restoreScrollRegions(e)})}static restoreScrollRegions(e){kr||this.regions().forEach((t,n)=>{let r=e[n];r&&(typeof t.scrollTo==`function`?t.scrollTo(r.left,r.top):(t.scrollTop=r.top,t.scrollLeft=r.left))})}static restoreDocument(){let e=H.getDocumentScrollPosition();window.scrollTo(e.left,e.top)}static onScroll(e){let t=e.target;typeof t.hasAttribute==`function`&&t.hasAttribute(`scroll-region`)&&this.save()}static onWindowScroll(){H.saveDocumentScrollPosition({top:window.scrollY,left:window.scrollX})}},Mr=e=>typeof File<`u`&&e instanceof File||e instanceof Blob||typeof FileList<`u`&&e instanceof FileList&&e.length>0;function Nr(e){return Mr(e)||e instanceof FormData&&Array.from(e.values()).some(e=>Nr(e))||typeof e==`object`&&!!e&&Object.values(e).some(e=>Nr(e))}var Pr=e=>e instanceof FormData;function Fr(e,t=new FormData,n=null,r=`brackets`){e||={};for(let i in e)Object.prototype.hasOwnProperty.call(e,i)&&Lr(t,Ir(n,i,`indices`),e[i],r);return t}function Ir(e,t,n){return e?n===`brackets`?`${e}[]`:`${e}[${t}]`:t}function Lr(e,t,n,r){if(Array.isArray(n))return Array.from(n.keys()).forEach(i=>Lr(e,Ir(t,i.toString(),r),n[i],r));if(n instanceof Date)return e.append(t,n.toISOString());if(n instanceof File)return e.append(t,n,n.name);if(n instanceof Blob)return e.append(t,n);if(typeof n==`boolean`)return e.append(t,n?`1`:`0`);if(typeof n==`string`)return e.append(t,n);if(typeof n==`number`)return e.append(t,`${n}`);if(n==null)return e.append(t,``);Fr(n,e,t,r)}function Rr(e){return/\[\d+\]/.test(decodeURIComponent(e.search))}function zr(e){if(!e||e===`?`)return{};let t={};return e.replace(/^\?/,``).split(`&`).filter(Boolean).forEach(e=>{let[n,r]=Vr(e);Ur(t,Hr(n),Hr(r))}),t}function Br(e,t){let n=[];return Gr(e,``,n,t),n.length?`?`+n.join(`&`):``}function Vr(e){let t=e.indexOf(`=`);return t===-1?[e,``]:[e.substring(0,t),e.substring(t+1)]}function Hr(e){return decodeURIComponent(e.replace(/\+/g,` `))}function Ur(e,t,n){let r=Wr(t);if(r.some(e=>e===`__proto__`))return;let i=e;for(;r.length>1;){let e=r.shift(),t=r[0]===``;(typeof i[e]!=`object`||i[e]===null)&&(i[e]=t?[]:{}),i=i[e]}let a=r.shift();a===``&&Array.isArray(i)?i.push(n):i[a]=n}function Wr(e){let t=[],n=e.split(`[`)[0];n&&t.push(n);let r,i=/\[([^\]]*)\]/g;for(;(r=i.exec(e))!==null;)t.push(r[1]);return t}function Gr(e,t,n,r){if(e!==void 0){if(e===null){n.push(`${t}=`);return}if(Array.isArray(e)){e.forEach((e,i)=>{Gr(e,r===`indices`?`${t}[${i}]`:`${t}[]`,n,r)});return}if(typeof e==`object`){Object.keys(e).forEach(i=>{Gr(e[i],t?`${t}[${i}]`:i,n,r)});return}n.push(`${t}=${encodeURIComponent(String(e))}`)}}function Kr(e){return new URL(e.toString(),typeof window>`u`?void 0:window.location.toString())}var qr=(e,t,n,r,i)=>{let a=typeof e==`string`?Kr(e):e;if((Nr(t)||r)&&!Pr(t)&&(Un.get(`form.forceIndicesArrayFormatInFormData`)&&(i=`indices`),t=Fr(t,new FormData,null,i)),Pr(t))return[a,t];let[o,s]=Jr(n,a,t,i);return[Kr(o),s]};function Jr(e,t,n,r=`brackets`){let i=e===`get`&&!Pr(n)&&Object.keys(n).length>0,a=ti(t.toString()),o=a||t.toString().startsWith(`/`)||t.toString()===``,s=!o&&!t.toString().startsWith(`#`)&&!t.toString().startsWith(`?`),c=/^[.]{1,2}([/]|$)/.test(t.toString()),l=t.toString().includes(`?`)||i,u=t.toString().includes(`#`),d=new URL(t.toString(),typeof window>`u`?`http://localhost`:window.location.toString());if(i){let e=Rr(d)?`indices`:r;d.search=Br({...zr(d.search),...n},e)}return[[a?`${d.protocol}//${d.host}`:``,o?d.pathname:``,s?d.pathname.substring(+!c):``,l?d.search:``,u?d.hash:``].join(``),i?{}:n]}function Yr(e){return e=new URL(e.href),e.hash=``,e}var Xr=(e,t)=>{e.hash&&!t.hash&&Yr(e).href===t.href&&(t.hash=e.hash)},Zr=(e,t)=>Yr(e).href===Yr(t).href,Qr=(e,t)=>e.origin===t.origin&&e.pathname===t.pathname;function $r(e){return typeof e==`object`&&!!e&&e!==void 0&&`url`in e&&`method`in e}function ei(e){return e.component?typeof e.component==`string`?e.component:(console.error(`The "component" property on the URL method pair received multiple components (${Object.keys(e.component).join(`, `)}), but only a single component string is supported for instant visits. Use the withComponent() method to specify which component to use.`),null):null}function ti(e){return/^([a-z][a-z0-9+.-]*:)?\/\/[^/]/i.test(e)}function ni(e,t){let n=typeof e==`string`?Kr(e):e;return t?`${n.protocol}//${n.host}${n.pathname}${n.search}${n.hash}`:`${n.pathname}${n.search}${n.hash}`}var V=new class{page;swapComponent;resolveComponent;onFlashCallback;componentId={};listeners=[];isFirstPageLoad=!0;cleared=!1;pendingDeferredProps=null;historyQuotaExceeded=!1;optimisticBaseline={};pendingOptimistics=[];optimisticCounter=0;init({initialPage:e,swapComponent:t,resolveComponent:n,onFlash:r}){return this.page={...e,flash:e.flash??{},rescuedProps:e.rescuedProps??[]},this.swapComponent=t,this.resolveComponent=n,this.onFlashCallback=r,ci.on(`historyQuotaExceeded`,()=>{this.historyQuotaExceeded=!0}),this}set(e,{replace:t=!1,preserveScroll:n=!1,preserveState:r=!1,viewTransition:i=!1,cached:a=!1,visitId:o}={}){Object.keys(e.deferredProps||{}).length&&(this.pendingDeferredProps={deferredProps:e.deferredProps,component:e.component,url:e.url},e.initialDeferredProps===void 0&&(e.initialDeferredProps=e.deferredProps)),this.componentId={};let s=this.componentId;return e.clearHistory&&H.clear(),this.resolve(e.component,e).then(c=>{if(s!==this.componentId)return;e.rememberedState??={};let l=typeof window>`u`,u=l?new URL(e.url):window.location,d=!l&&n?jr.getScrollRegions():[];t||=Zr(Kr(e.url),u);let f={...e,flash:{}};return new Promise(e=>t?H.replaceState(f,e):H.pushState(f,e)).then(()=>{let s=!this.isTheSame(e);if(!s&&Object.keys(e.props.errors||{}).length>0&&(i=!1),this.page=e,this.cleared=!1,this.hasOnceProps()&&Cr.updateCachedOncePropsFromCurrentPage(),s&&this.fireEventsFor(`newComponent`),this.isFirstPageLoad&&this.fireEventsFor(`firstLoad`),this.isFirstPageLoad=!1,this.historyQuotaExceeded){this.historyQuotaExceeded=!1;return}return this.swap({component:c,page:e,preserveState:r,viewTransition:i}).then(()=>{n?window.requestAnimationFrame(()=>jr.restoreScrollRegions(d)):jr.reset(),this.pendingDeferredProps&&this.pendingDeferredProps.component===e.component&&this.pendingDeferredProps.url===e.url&&ci.fireInternalEvent(`loadDeferredProps`,this.pendingDeferredProps.deferredProps),this.pendingDeferredProps=null,t||Qn(e,{cached:a,visitId:o})})})})}setQuietly(e,{preserveState:t=!1}={}){return this.resolve(e.component,e).then(n=>(this.page=e,this.cleared=!1,H.setCurrent(e),this.swap({component:n,page:e,preserveState:t,viewTransition:!1})))}clear(){this.cleared=!0}isCleared(){return this.cleared}get(){return this.page}getWithoutFlashData(){return{...this.page,flash:{}}}hasOnceProps(){return Object.keys(this.page.onceProps??{}).length>0}merge(e){this.page={...this.page,...e}}setPropsQuietly(e){return this.page={...this.page,props:e},this.resolve(this.page.component,this.page).then(e=>this.swap({component:e,page:this.page,preserveState:!0,viewTransition:!1}))}setFlash(e){this.page={...this.page,flash:e},this.onFlashCallback?.(e)}setUrlHash(e){this.page.url.includes(e)||(this.page.url+=e)}remember(e){this.page.rememberedState=e}swap({component:e,page:t,preserveState:n,viewTransition:r}){let i=()=>this.swapComponent({component:e,page:t,preserveState:n});if(!r||!document?.startViewTransition||document.visibilityState===`hidden`)return i();let a=typeof r==`boolean`?()=>null:r;return new Promise(e=>{let t=document.startViewTransition(()=>i().then(e));t.ready.catch(()=>{}),a(t)})}resolve(e,t){return Promise.resolve(this.resolveComponent(e,t))}nextOptimisticId(){return++this.optimisticCounter}setBaseline(e,t){e in this.optimisticBaseline||(this.optimisticBaseline[e]=t)}updateBaseline(e,t){e in this.optimisticBaseline&&(this.optimisticBaseline[e]=t)}hasBaseline(e){return e in this.optimisticBaseline}registerOptimistic(e,t){this.pendingOptimistics.push({id:e,callback:t})}unregisterOptimistic(e){this.pendingOptimistics=this.pendingOptimistics.filter(t=>t.id!==e)}replayOptimistics(){let e=Object.keys(this.optimisticBaseline);if(e.length===0)return{};let t=mt(this.page.props);for(let n of e)t[n]=mt(this.optimisticBaseline[n]);for(let{callback:e}of this.pendingOptimistics){let n=e(mt(t));n&&Object.assign(t,n)}let n={};for(let r of e)n[r]=t[r];return n}pendingOptimisticCount(){return this.pendingOptimistics.length}clearOptimisticState(){this.optimisticBaseline={},this.pendingOptimistics=[]}isTheSame(e){return this.page.component===e.component}on(e,t){return this.listeners.push({event:e,callback:t}),()=>{this.listeners=this.listeners.filter(n=>n.event!==e&&n.callback!==t)}}fireEventsFor(e){this.listeners.filter(t=>t.event===e).forEach(e=>e.callback())}mergeOncePropsIntoResponse(e,{force:t=!1}={}){Object.entries(e.onceProps??{}).forEach(([n,r])=>{let i=this.page.onceProps?.[n];i!==void 0&&(t||Mt(e.props,r.prop)===void 0)&&(Xt(e.props,r.prop,Mt(this.page.props,i.prop)),e.onceProps[n].expiresAt=i.expiresAt)})}},ri=class{items=[];processingPromise=null;add(e){return this.items.push(e),this.process()}process(){return this.processingPromise??=this.processNext().finally(()=>{this.processingPromise=null}),this.processingPromise}processNext(){let e=this.items.shift();return e?Promise.resolve(e()).then(()=>this.processNext()):Promise.resolve()}},ii=typeof window>`u`,ai=new ri,oi=!ii&&/CriOS/.test(window.navigator.userAgent),si=class{rememberedState=`rememberedState`;scrollRegions=`scrollRegions`;preserveUrl=!1;current={};initialState=null;remember(e,t){this.replaceState({...V.getWithoutFlashData(),rememberedState:{...V.get()?.rememberedState??{},[t]:e}})}restore(e){if(!ii)return this.current[this.rememberedState]?.[e]===void 0?this.initialState?.[this.rememberedState]?.[e]:this.current[this.rememberedState]?.[e]}pushState(e,t=null){if(!ii){if(this.preserveUrl){t&&t();return}this.current=e,ai.add(()=>this.getPageData(e).then(n=>{let r=()=>this.doPushState({page:n},e.url).then(()=>t?.());return oi?new Promise(e=>{setTimeout(()=>r().then(e))}):r()}))}}clonePageProps(e){try{return structuredClone(e.props),e}catch{return{...e,props:mt(e.props)}}}getPageData(e){let t=this.clonePageProps(e);return new Promise(n=>e.encryptHistory?cr(t).then(n):n(t))}processQueue(){return ai.process()}decrypt(e=null){if(ii)return Promise.resolve(e??V.get());let t=e??window.history.state?.page;return this.decryptPageData(t).then(e=>{if(!e)throw Error(`Unable to decrypt history`);return this.initialState===null?this.initialState=e??void 0:this.current=e??{},e})}decryptPageData(e){return e instanceof ArrayBuffer?ur(e):Promise.resolve(e)}saveScrollPositions(e){ai.add(()=>Promise.resolve().then(()=>{if(window.history.state?.page&&!St(this.getScrollRegions(),e))return this.doReplaceState({page:window.history.state.page,scrollRegions:e})}))}saveDocumentScrollPosition(e){ai.add(()=>Promise.resolve().then(()=>{if(window.history.state?.page&&!St(this.getDocumentScrollPosition(),e))return this.doReplaceState({page:window.history.state.page,documentScrollPosition:e})}))}getScrollRegions(){return window.history.state?.scrollRegions||[]}getDocumentScrollPosition(){return window.history.state?.documentScrollPosition||{top:0,left:0}}replaceState(e,t=null){if(St(this.current,e)){t&&t();return}let{flash:n,...r}=e;if(V.merge(r),!ii){if(this.preserveUrl){t&&t();return}this.current=e,ai.add(()=>this.getPageData(e).then(n=>{let r=()=>this.doReplaceState({page:n},e.url).then(()=>t?.());return oi?new Promise(e=>{setTimeout(()=>r().then(e))}):r()}))}}isHistoryThrottleError(e){return e instanceof Error&&e.name===`SecurityError`&&(e.message.includes(`history.pushState`)||e.message.includes(`history.replaceState`))}isQuotaExceededError(e){return e instanceof Error&&e.name===`QuotaExceededError`}withThrottleProtection(e){return Promise.resolve().then(()=>{try{return e()}catch(e){if(!this.isHistoryThrottleError(e))throw e;console.error(e.message)}})}doReplaceState(e,t){return this.withThrottleProtection(()=>{window.history.replaceState({...e,scrollRegions:e.scrollRegions??window.history.state?.scrollRegions,documentScrollPosition:e.documentScrollPosition??window.history.state?.documentScrollPosition},``,t)})}doPushState(e,t){return this.withThrottleProtection(()=>{try{window.history.pushState(e,``,t)}catch(e){if(!this.isQuotaExceededError(e))throw e;ci.fireInternalEvent(`historyQuotaExceeded`,t)}})}getState(e,t){return this.current?.[e]??t}deleteState(e){this.current[e]!==void 0&&(delete this.current[e],this.replaceState(this.current))}clearInitialState(e){this.initialState&&this.initialState[e]!==void 0&&delete this.initialState[e]}browserHasHistoryEntry(){return!ii&&!!window.history.state?.page}clear(){sr.remove(lr.key),sr.remove(lr.iv)}setCurrent(e){this.current=e}isValidState(e){return!!e.page}getAllState(){return this.current}};typeof window<`u`&&window.history.scrollRestoration&&(window.history.scrollRestoration=`manual`);var H=new si,ci=new class{internalListeners=[];init(){typeof window<`u`&&(window.addEventListener(`popstate`,this.handlePopstateEvent.bind(this)),window.addEventListener(`pageshow`,this.handlePageshowEvent.bind(this)),window.addEventListener(`scroll`,Wn(jr.onWindowScroll.bind(jr),100),!0)),typeof document<`u`&&document.addEventListener(`scroll`,Wn(jr.onScroll.bind(jr),100),!0)}onGlobalEvent(e,t){return this.registerListener(`inertia:${e}`,(e=>{let n=t(e);e.cancelable&&!e.defaultPrevented&&n===!1&&e.preventDefault()}))}on(e,t){return this.internalListeners.push({event:e,listener:t}),()=>{this.internalListeners=this.internalListeners.filter(e=>e.listener!==t)}}onMissingHistoryItem(){V.clear(),this.fireInternalEvent(`missingHistoryItem`)}fireInternalEvent(e,...t){this.internalListeners.filter(t=>t.event===e).forEach(e=>e.listener(...t))}registerListener(e,t){return document.addEventListener(e,t),()=>document.removeEventListener(e,t)}handlePageshowEvent(e){e.persisted&&H.decrypt().catch(()=>this.onMissingHistoryItem())}handlePopstateEvent(e){let t=e.state||null;if(t===null){let e=Kr(V.get().url);e.hash=window.location.hash,H.replaceState({...V.getWithoutFlashData(),url:e.href}),jr.reset();return}if(!H.isValidState(t))return this.onMissingHistoryItem();H.decrypt(t.page).then(e=>{if(V.get().version!==e.version){this.onMissingHistoryItem();return}W.cancelAll({prefetch:!1}),V.setQuietly(e,{preserveState:!1}).then(()=>{jr.restore(H.getScrollRegions()),Qn(V.get());let t={},n=V.get().props;for(let[r,i]of Object.entries(e.initialDeferredProps??e.deferredProps??{})){let e=i.filter(e=>Mt(n,e)===void 0);e.length>0&&(t[r]=e)}Object.keys(t).length>0&&this.fireInternalEvent(`loadDeferredProps`,t)})}).catch(()=>{this.onMissingHistoryItem()})}},li=new class{type;constructor(){this.type=this.resolveType()}resolveType(){return typeof window>`u`?`navigate`:window.performance?.getEntriesByType(`navigation`)[0]?.type??`navigate`}get(){return this.type}isBackForward(){return this.type===`back_forward`}isReload(){return this.type===`reload`}};function ui(){let e=typeof window<`u`?window.crypto:void 0;if(e?.randomUUID)return e.randomUUID();let t=()=>e?.getRandomValues?e.getRandomValues(new Uint8Array(1))[0]:Math.floor(Math.random()*256);return`10000000-1000-4000-8000-100000000000`.replace(/[018]/g,e=>(e^t()&15>>e/4).toString(16))}var di=class{static handle(){this.clearRememberedStateOnReload(),[this.handleBackForward,this.handleLocation,this.handleDefault].find(e=>e.bind(this)())}static clearRememberedStateOnReload(){li.isReload()&&(H.deleteState(H.rememberedState),H.clearInitialState(H.rememberedState))}static handleBackForward(){if(!li.isBackForward()||!H.browserHasHistoryEntry())return!1;let e=H.getScrollRegions();return H.decrypt().then(t=>{let n=ui();V.set(t,{preserveScroll:!0,preserveState:!0,visitId:n}).then(()=>{jr.restore(e),Qn(V.get(),{visitId:n})})}).catch(()=>{ci.onMissingHistoryItem()}),!0}static handleLocation(){if(!sr.exists(sr.locationVisitKey))return!1;let e=sr.get(sr.locationVisitKey)||{};return sr.remove(sr.locationVisitKey),typeof window<`u`&&V.setUrlHash(window.location.hash),H.decrypt(V.get()).then(()=>{let t=ui(),n=H.getState(H.rememberedState,{}),r=H.getScrollRegions();V.remember(n),V.set(V.get(),{preserveScroll:e.preserveScroll,preserveState:!0,visitId:t}).then(()=>{e.preserveScroll&&jr.restore(r),this.fireInitialEvents(t)})}).catch(()=>{ci.onMissingHistoryItem()}),!0}static handleDefault(){typeof window<`u`&&V.setUrlHash(window.location.hash);let e=ui();V.set(V.get(),{preserveScroll:!0,preserveState:!0,visitId:e}).then(()=>{li.isReload()?jr.restore(H.getScrollRegions()):jr.scrollToAnchor(),this.fireInitialEvents(e)})}static fireInitialEvents(e){let t=V.get();Qn(t,{visitId:e}),Object.keys(t.flash).length>0&&queueMicrotask(()=>ar(t.flash))}},fi=class{intervalId=null;timeoutId=null;throttle=!1;keepAlive=!1;cb;interval;cbCount=0;mode;inFlight=!1;currentCancel=null;stopped=!0;instanceId=0;constructor(e,t,n){this.keepAlive=n.keepAlive??!1,this.mode=n.mode??`overlap`,this.cb=t,this.interval=e,(n.autoStart??!0)&&this.start()}stop(){this.stopped=!0,this.instanceId++,this.inFlight=!1,this.currentCancel=null,this.intervalId&&=(clearInterval(this.intervalId),null),this.timeoutId&&=(clearTimeout(this.timeoutId),null)}start(){if(!(typeof window>`u`)){if(this.stop(),this.stopped=!1,this.mode===`rest`){this.scheduleNext();return}this.intervalId=window.setInterval(()=>this.tick(),this.interval)}}isInBackground(e){this.throttle=!this.keepAlive&&e,this.throttle&&(this.cbCount=0)}scheduleNext(){this.stopped||(this.timeoutId=window.setTimeout(()=>{this.timeoutId=null,this.tick()},this.interval))}tick(){!this.throttle||this.cbCount%10==0?this.fire():this.mode===`rest`&&this.scheduleNext(),this.throttle&&this.cbCount++}fire(){this.inFlight&&this.mode===`cancel`&&this.currentCancel?.();let e=this.instanceId;this.cb({onStart:t=>{e===this.instanceId&&(this.inFlight=!0,this.currentCancel=t)},onFinish:()=>{e===this.instanceId&&(this.inFlight=!1,this.currentCancel=null,this.mode===`rest`&&this.scheduleNext())}})}},pi=new class{polls=[];constructor(){this.setupVisibilityListener()}get count(){return this.polls.length}add(e,t,n){let r=new fi(e,t,n);return this.polls.push(r),{stop:()=>r.stop(),start:()=>r.start(),destroy:()=>{r.stop(),this.polls=this.polls.filter(e=>e!==r)}}}clear(){this.polls.forEach(e=>e.stop()),this.polls=[]}setupVisibilityListener(){typeof document>`u`||document.addEventListener(`visibilitychange`,()=>{this.polls.forEach(e=>e.isInBackground(document.hidden))},!1)}},mi=new class{requestHandlers=[];responseHandlers=[];errorHandlers=[];onRequest(e){return this.requestHandlers.push(e),()=>{this.requestHandlers=this.requestHandlers.filter(t=>t!==e)}}onResponse(e){return this.responseHandlers.push(e),()=>{this.responseHandlers=this.responseHandlers.filter(t=>t!==e)}}onError(e){return this.errorHandlers.push(e),()=>{this.errorHandlers=this.errorHandlers.filter(t=>t!==e)}}async processRequest(e){let t=e;for(let e of this.requestHandlers)t=await e(t);return t}async processResponse(e){let t=e;for(let e of this.responseHandlers)t=await e(t);return t}async processError(e){for(let t of this.errorHandlers)await t(e)}},hi=class extends Error{code;url;constructor(e,t,n){super(n?`${e} (${n})`:e),this.name=`HttpError`,this.code=t,this.url=n}},gi=class extends hi{response;constructor(e,t,n){super(e,`ERR_HTTP_RESPONSE`,n),this.name=`HttpResponseError`,this.response=t}},_i=class extends hi{constructor(e=`Request was cancelled`,t){super(e,`ERR_CANCELLED`,t),this.name=`HttpCancelledError`}},vi=class extends hi{cause;constructor(e,t,n){super(e,`ERR_NETWORK`,t),this.name=`HttpNetworkError`,this.cause=n}};function yi(e){let t=document.cookie.match(RegExp(`(^|;\\s*)(`+e+`)=([^;]*)`));return t?decodeURIComponent(t[3]):null}function bi(e){let t={};return e.getAllResponseHeaders().split(`\r
|
|
3
|
+
`).forEach(e=>{let n=e.indexOf(`:`);n>0&&(t[e.slice(0,n).toLowerCase().trim()]=e.slice(n+1).trim())}),t}function xi(e){return typeof FormData<`u`&&e instanceof FormData}function Si(e){return typeof e==`string`||xi(e)||typeof Blob<`u`&&e instanceof Blob||typeof ArrayBuffer<`u`&&e instanceof ArrayBuffer||typeof ArrayBuffer<`u`&&ArrayBuffer.isView(e)||typeof URLSearchParams<`u`&&e instanceof URLSearchParams}function Ci(e,t){if(!t.headers)return;let n=xi(t.data);Object.entries(t.headers).forEach(([t,r])=>{(t.toLowerCase()!==`content-type`||!n)&&e.setRequestHeader(t,String(r))})}function wi(e,t){if(!t||Object.keys(t).length===0)return e;let[n]=Jr(`get`,e,t);return n}var Ti=class{xsrfCookieName;xsrfHeaderName;constructor(e={}){this.xsrfCookieName=e.xsrfCookieName??`XSRF-TOKEN`,this.xsrfHeaderName=e.xsrfHeaderName??`X-XSRF-TOKEN`}async request(e){let t=await mi.processRequest(e);try{let e=await this.doRequest(t);return await mi.processResponse(e)}catch(e){throw(e instanceof gi||e instanceof vi||e instanceof _i)&&await mi.processError(e),e}}doRequest(e){return new Promise((t,n)=>{let r=new XMLHttpRequest,i=wi(e.url,e.params);r.open(e.method.toUpperCase(),i,!0);let a=yi(this.xsrfCookieName);a&&r.setRequestHeader(this.xsrfHeaderName,a),Object.keys(e.headers??{}).some(e=>e.toLowerCase()===`x-requested-with`)||r.setRequestHeader(`X-Requested-With`,`XMLHttpRequest`);let o=null;e.data!==null&&e.data!==void 0&&(Si(e.data)?o=e.data:typeof e.data==`object`?(o=JSON.stringify(e.data),!e.headers?.[`Content-Type`]&&!e.headers?.[`content-type`]&&r.setRequestHeader(`Content-Type`,`application/json`)):o=String(e.data)),Ci(r,e),e.onUploadProgress&&(r.upload.onprogress=t=>{let n=t.lengthComputable?t.loaded/t.total:void 0;e.onUploadProgress({progress:n,percentage:n?Math.round(n*100):0,loaded:t.loaded,total:t.lengthComputable?t.total:void 0})}),e.signal&&e.signal.addEventListener(`abort`,()=>r.abort()),r.onabort=()=>n(new _i(`Request was cancelled`,e.url)),r.onerror=()=>n(new vi(`Network error`,e.url)),r.onload=()=>{let i={status:r.status,data:r.responseText,headers:bi(r)};r.status>=400?n(new gi(`Request failed with status ${r.status}`,i,e.url)):t(i)},r.send(o)})}},Ei=new Ti;function Di(e){return!(`request`in e)}var Oi={getClient(){return Ei},setClient(e){if(!Di(e)){Ei=e;return}Ei=new Ti(e),e.xsrfCookieName&&wn.withXsrfCookieName(e.xsrfCookieName),e.xsrfHeaderName&&wn.withXsrfHeaderName(e.xsrfHeaderName)},onRequest:mi.onRequest.bind(mi),onResponse:mi.onResponse.bind(mi),onError:mi.onError.bind(mi),processRequest:mi.processRequest.bind(mi),processResponse:mi.processResponse.bind(mi),processError:mi.processError.bind(mi)},ki=new class{requestHandlers=[];responseHandlers=[];onVisitRequest(e){return this.requestHandlers.push(e),()=>{this.requestHandlers=this.requestHandlers.filter(t=>t!==e)}}onVisitResponse(e){return this.responseHandlers.push(e),()=>{this.responseHandlers=this.responseHandlers.filter(t=>t!==e)}}async processRequest(e,t){let n=t;for(let t of this.requestHandlers)n=await t(e,n);return n}async processResponse(e,t){let n=t;for(let t of this.responseHandlers)n=await t(e,n);return n}};function U(){typeof window>`u`||(window.__inertia_interceptors__=ki)}var Ai=class e{callbacks=[];params;constructor(e){if(!e.prefetch)this.params=e;else{let t={onBefore:this.wrapCallback(e,`onBefore`),onBeforeUpdate:this.wrapCallback(e,`onBeforeUpdate`),onStart:this.wrapCallback(e,`onStart`),onProgress:this.wrapCallback(e,`onProgress`),onFinish:this.wrapCallback(e,`onFinish`),onCancel:this.wrapCallback(e,`onCancel`),onSuccess:this.wrapCallback(e,`onSuccess`),onError:this.wrapCallback(e,`onError`),onHttpException:this.wrapCallback(e,`onHttpException`),onNetworkError:this.wrapCallback(e,`onNetworkError`),onFlash:this.wrapCallback(e,`onFlash`),onCancelToken:this.wrapCallback(e,`onCancelToken`),onPrefetched:this.wrapCallback(e,`onPrefetched`),onPrefetching:this.wrapCallback(e,`onPrefetching`)};this.params={...e,...t,onPrefetchResponse:e.onPrefetchResponse||(()=>{}),onPrefetchError:e.onPrefetchError||(()=>{})}}}static create(t){return new e(t)}data(){return this.params.method===`get`?null:this.params.data}queryParams(){return this.params.method===`get`?this.params.data:{}}isPartial(){return this.params.only.length>0||this.params.except.length>0||this.params.reset.length>0}isPrefetch(){return this.params.prefetch===!0}isDeferredPropsRequest(){return this.params.deferredProps===!0}isPollRequest(){return this.params.poll===!0}onCancelToken(e){this.params.onCancelToken({cancel:e})}markAsFinished(){this.params.completed=!0,this.params.cancelled=!1,this.params.interrupted=!1}markAsCancelled({cancelled:e=!0,interrupted:t=!1}){this.params.onCancel(),this.params.completed=!1,this.params.cancelled=e,this.params.interrupted=t}wasCancelledAtAll(){return this.params.cancelled||this.params.interrupted}onFinish(){this.params.onFinish(this.params)}onStart(){this.params.onStart(this.params)}onPrefetching(){this.params.onPrefetching(this.params)}onPrefetchResponse(e){this.params.onPrefetchResponse&&this.params.onPrefetchResponse(e)}onPrefetchError(e){this.params.onPrefetchError&&this.params.onPrefetchError(e)}all(){return this.params}headers(){let e={...this.params.headers};this.isPartial()&&(e[`X-Inertia-Partial-Component`]=V.get().component);let t=this.params.only.concat(this.params.reset);return t.length>0&&(e[`X-Inertia-Partial-Data`]=t.join(`,`)),this.params.except.length>0&&(e[`X-Inertia-Partial-Except`]=this.params.except.join(`,`)),this.params.reset.length>0&&(e[`X-Inertia-Reset`]=this.params.reset.join(`,`)),this.params.errorBag&&this.params.errorBag.length>0&&(e[`X-Inertia-Error-Bag`]=this.params.errorBag),e}setPreserveOptions(t){this.params.preserveScroll=e.resolvePreserveOption(this.params.preserveScroll,t),this.params.preserveState=e.resolvePreserveOption(this.params.preserveState,t)}runCallbacks(){this.callbacks.forEach(({name:e,args:t})=>{this.params[e](...t)})}merge(e){this.params={...this.params,...e}}wrapCallback(e,t){return(...n)=>{this.recordCallback(t,n),e[t](...n)}}recordCallback(e,t){this.callbacks.push({name:e,args:t})}static resolvePreserveOption(e,t){return typeof e==`function`?e(t):e===`errors`?Object.keys(t.props.errors||{}).length>0:e}},ji={createIframeAndPage(e){typeof e==`object`&&(e=`All Inertia requests must receive a valid Inertia response, however a plain JSON response was received.<hr>${JSON.stringify(e)}`);let t=document.createElement(`html`);t.innerHTML=e,t.querySelectorAll(`a`).forEach(e=>e.setAttribute(`target`,`_top`));let n=document.createElement(`iframe`);return n.style.backgroundColor=`white`,n.style.borderRadius=`5px`,n.style.width=`100%`,n.style.height=`100%`,n.setAttribute(`sandbox`,`allow-scripts`),{iframe:n,page:t}},show(e){let{iframe:t,page:n}=this.createIframeAndPage(e);t.style.boxSizing=`border-box`,t.style.display=`block`;let r=document.createElement(`dialog`);r.id=`inertia-error-dialog`,Object.assign(r.style,{width:`calc(100vw - 100px)`,height:`calc(100vh - 100px)`,padding:`0`,margin:`auto`,border:`none`,backgroundColor:`transparent`});let i=document.createElement(`style`);i.textContent=`
|
|
4
|
+
dialog#inertia-error-dialog::backdrop {
|
|
5
|
+
background-color: rgba(0, 0, 0, 0.6);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
dialog#inertia-error-dialog:focus {
|
|
9
|
+
outline: none;
|
|
10
|
+
}
|
|
11
|
+
`;let a=Un.get(`nonce`);a&&(i.nonce=a),document.head.appendChild(i),r.addEventListener(`click`,e=>{e.target===r&&r.close()}),r.addEventListener(`close`,()=>{i.remove(),r.remove()}),r.appendChild(t),document.body.prepend(r),r.showModal(),r.focus(),t.srcdoc=n.outerHTML}},Mi=(e,t)=>e===t||e.startsWith(`${t}.`),Ni=(e,t)=>{let{only:n,except:r}=e;return!(n.length===0&&r.length===0||n.length>0&&!n.some(e=>Mi(t,e))||r.length>0&&r.some(e=>Mi(t,e)))},Pi=new ri,Fi=class e{constructor(e,t,n){this.requestParams=e,this.response=t,this.originatingPage=n}requestParams;response;originatingPage;wasPrefetched=!1;processed=!1;static create(t,n,r){return new e(t,n,r)}isProcessed(){return this.processed}async handlePrefetch(){Zr(this.requestParams.all().url,window.location)&&this.handle()}async handle(){return Pi.add(()=>this.process())}async process(){if(this.requestParams.all().prefetch)return this.wasPrefetched=!0,this.requestParams.all().prefetch=!1,this.requestParams.all().onPrefetched(this.response,this.requestParams.all()),rr(this.response,this.requestParams.all()),Promise.resolve();if(this.requestParams.runCallbacks(),this.processed=!0,!this.isInertiaResponse())return this.handleNonInertiaResponse();if(this.isHttpException()){let e={...this.response,data:this.getDataFromResponse(this.response.data)};if(this.requestParams.all().onHttpException(e)===!1||!Xn(e))return}await H.processQueue(),H.preserveUrl=this.requestParams.all().preserveUrl,await this.setPage();let{flash:e}=V.get();Object.keys(e).length>0&&!this.requestParams.isDeferredPropsRequest()&&(ar(e),this.requestParams.all().onFlash(e));let t=V.get().props.errors||{};if(Object.keys(t).length>0){let e=this.getScopedErrors(t);return qn(e,{page:V.get(),visitId:this.requestParams.all().id}),this.requestParams.all().onError(e)}W.flushByCacheTags(this.requestParams.all().invalidateCacheTags||[]),this.wasPrefetched||W.flush(V.get().url),nr(V.get(),{visitId:this.requestParams.all().id}),await this.requestParams.all().onSuccess(V.get()),H.preserveUrl=!1}mergeParams(e){this.requestParams.merge(e)}getPageResponse(){let e=this.getDataFromResponse(this.response.data);return typeof e==`object`?this.response.data={...e,flash:e.flash??{},rescuedProps:e.rescuedProps??[]}:this.response.data=e}async handleNonInertiaResponse(){if(this.isInertiaRedirect()){W.visit(this.getHeader(`x-inertia-redirect`),{...this.requestParams.all(),method:`get`,data:{}});return}if(this.isLocationVisit()){let e=Kr(this.getHeader(`x-inertia-location`));return Xr(this.requestParams.all().url,e),this.locationVisit(e)}let e={...this.response,data:this.getDataFromResponse(this.response.data)};if(this.requestParams.all().onHttpException(e)!==!1&&Xn(e))return ji.show(e.data)}isInertiaResponse(){return this.hasHeader(`x-inertia`)}isHttpException(){return this.response.status>=400}hasStatus(e){return this.response.status===e}getHeader(e){return this.response.headers[e]}hasHeader(e){return this.getHeader(e)!==void 0}isInertiaRedirect(){return this.hasStatus(409)&&this.hasHeader(`x-inertia-redirect`)}isLocationVisit(){return this.hasStatus(409)&&this.hasHeader(`x-inertia-location`)}locationVisit(e){try{if(typeof window>`u`)return;let t=this.getHeader(`x-inertia-version`),n=!!t&&t!==V.get().version;if(!or(e,n)||n&&this.requestParams.all().async)return;sr.set(sr.locationVisitKey,{preserveScroll:this.requestParams.all().preserveScroll===!0}),Zr(window.location,e)?window.location.reload():window.location.href=e.href}catch{return!1}}async setPage(){let e=this.getPageResponse();return this.shouldSetPage(e)?(this.response=await ki.processResponse(this.requestParams.all(),this.response),this.mergeProps(e),V.mergeOncePropsIntoResponse(e),this.preserveOptimisticProps(e),this.preserveEqualProps(e),await this.setRememberedState(e),this.requestParams.setPreserveOptions(e),e.url=H.preserveUrl?V.get().url:this.pageUrl(e),this.requestParams.all().onBeforeUpdate(e),Zn(e),V.set(e,{replace:this.requestParams.all().replace,preserveScroll:this.requestParams.all().preserveScroll,preserveState:this.requestParams.all().preserveState,viewTransition:this.requestParams.all().viewTransition,cached:this.requestParams.all().cached,visitId:this.requestParams.all().id})):Promise.resolve()}getDataFromResponse(e){if(typeof e!=`string`)return e;try{return JSON.parse(e)}catch{return e}}shouldSetPage(e){if(!this.requestParams.all().async||this.originatingPage.component!==e.component)return!0;if(this.originatingPage.component!==V.get().component)return!1;let t=Kr(this.originatingPage.url),n=Kr(V.get().url);return t.origin===n.origin&&t.pathname===n.pathname}pageUrl(e){let t=Kr(e.url);return e.preserveFragment?t.hash=this.requestParams.all().url.hash:Xr(this.requestParams.all().url,t),t.pathname+t.search+t.hash}preserveOptimisticProps(e){if(W.hasPendingOptimistic())for(let t of Object.keys(e.props))V.hasBaseline(t)&&(V.updateBaseline(t,e.props[t]),e.props[t]=V.get().props[t])}preserveEqualProps(e){if(e.component!==V.get().component)return;let t=V.get().props;Object.entries(e.props).forEach(([n,r])=>{St(r,t[n])&&(e.props[n]=t[n])})}mergeProps(e){if(!this.requestParams.isPartial()||e.component!==V.get().component)return;let t=e.mergeProps||[],n=e.prependProps||[],r=e.deepMergeProps||[],i=e.matchPropsOn||[],a=(t,n)=>{let r=Mt(V.get().props,t),a=Mt(e.props,t);if(Array.isArray(a)){let o=this.mergeOrMatchItems(r||[],a,t,i,n);Xt(e.props,t,o)}else if(typeof a==`object`&&a){let n={...r||{},...a};Xt(e.props,t,n)}};t.forEach(e=>a(e,!0)),n.forEach(e=>a(e,!1)),r.forEach(t=>{let n=Mt(V.get().props,t),r=Mt(e.props,t),a=(e,t,n)=>Array.isArray(t)?this.mergeOrMatchItems(e,t,n,i):typeof t==`object`&&t?Object.keys(t).reduce((r,i)=>(r[i]=a(e?e[i]:void 0,t[i],`${n}.${i}`),r),{...e}):t;Xt(e.props,t,a(n,r,t))});let o=new Set([...this.requestParams.all().only,...this.requestParams.all().except].filter(e=>e.includes(`.`)).map(e=>e.split(`.`)[0]));for(let t of o){let n=V.get().props[t];this.isObject(n)&&this.isObject(e.props[t])&&(e.props[t]=this.deepMergeObjects(n,e.props[t]))}e.props={...V.get().props,...e.props},this.shouldPreserveErrors(e)&&(e.props.errors=V.get().props.errors),V.get().scrollProps&&(e.scrollProps={...V.get().scrollProps||{},...e.scrollProps||{}}),V.hasOnceProps()&&(e.onceProps={...V.get().onceProps||{},...e.onceProps||{}}),this.requestParams.isDeferredPropsRequest()&&(e.flash={...V.get().flash});let s=V.get().initialDeferredProps;s&&Object.keys(s).length>0&&(e.initialDeferredProps=s),e.rescuedProps=this.mergeRescuedProps(e)}mergeRescuedProps(e){let t=V.get().rescuedProps??[],n=e.rescuedProps??[],r=new Set(t.filter(e=>!Ni(this.requestParams.all(),e)));return n.forEach(e=>r.add(e)),Array.from(r)}shouldPreserveErrors(e){if(!this.requestParams.all().preserveErrors)return!1;let t=V.get().props.errors;if(!t||Object.keys(t).length===0)return!1;let n=e.props.errors;return!(n&&Object.keys(n).length>0)}isObject(e){return e&&typeof e==`object`&&!Array.isArray(e)}deepMergeObjects(e,t){let n={...e};for(let r of Object.keys(t)){let i=e[r],a=t[r];n[r]=this.isObject(i)&&this.isObject(a)?this.deepMergeObjects(i,a):a}return n}mergeOrMatchItems(e,t,n,r,i=!0){let a=Array.isArray(e)?e:[],o=r.find(e=>e.split(`.`).slice(0,-1).join(`.`)===n);if(!o)return i?[...a,...t]:[...t,...a];let s=o.split(`.`).pop()||``,c=new Map;return t.forEach(e=>{this.hasUniqueProperty(e,s)&&c.set(e[s],e)}),i?this.appendWithMatching(a,t,c,s):this.prependWithMatching(a,t,c,s)}appendWithMatching(e,t,n,r){let i=e.map(e=>this.hasUniqueProperty(e,r)&&n.has(e[r])?n.get(e[r]):e),a=t.filter(t=>!this.hasUniqueProperty(t,r)||!e.some(e=>this.hasUniqueProperty(e,r)&&e[r]===t[r]));return[...i,...a]}prependWithMatching(e,t,n,r){let i=e.filter(e=>!this.hasUniqueProperty(e,r)||!n.has(e[r]));return[...t,...i]}hasUniqueProperty(e,t){return e&&typeof e==`object`&&t in e}async setRememberedState(e){let t=await H.getState(H.rememberedState,{});this.requestParams.all().preserveState&&t&&e.component===V.get().component&&(e.rememberedState=t)}getScopedErrors(e){return this.requestParams.all().errorBag?e[this.requestParams.all().errorBag||``]||{}:e}},Ii=class e{constructor(e,t,{optimistic:n=!1}={}){this.page=t,this.requestParams=Ai.create(e),this.cancelToken=new AbortController,this.optimistic=n}page;response;cancelToken;requestParams;requestHasFinished=!1;optimistic;static create(t,n,r){return new e(t,n,r)}isPrefetch(){return this.requestParams.isPrefetch()}isOptimistic(){return this.optimistic}isPendingOptimistic(){return this.isOptimistic()&&(!this.response||!this.response.isProcessed())}async send(){this.requestParams.onCancelToken(()=>this.cancel({cancelled:!0})),tr(this.requestParams.all()),this.requestParams.onStart(),this.requestParams.all().prefetch&&(this.requestParams.onPrefetching(),ir(this.requestParams.all()));let e=this.requestParams.all().prefetch,t={method:this.requestParams.all().method,url:Yr(this.requestParams.all().url).href,data:this.requestParams.data(),signal:this.cancelToken.signal,headers:this.getHeaders(),onUploadProgress:this.onProgress.bind(this)},n=await ki.processRequest(this.requestParams.all(),t);return Oi.getClient().request(n).then(e=>(this.response=Fi.create(this.requestParams,e,this.page),this.response.handle())).catch(e=>e instanceof gi?(this.response=Fi.create(this.requestParams,e.response,this.page),this.response.handle()):Promise.reject(e)).catch(t=>{if(!(t instanceof _i)&&this.requestParams.all().onNetworkError(t)!==!1&&Jn(t))return e&&this.requestParams.onPrefetchError(t),Promise.reject(t)}).finally(()=>{this.finish(),e&&this.response&&this.requestParams.onPrefetchResponse(this.response)})}finish(){this.requestParams.wasCancelledAtAll()||(this.requestParams.markAsFinished(),this.fireFinishEvents())}fireFinishEvents(){this.requestHasFinished||(this.requestHasFinished=!0,Yn(this.requestParams.all()),this.requestParams.onFinish())}cancel({cancelled:e=!1,interrupted:t=!1}){this.requestHasFinished||(this.cancelToken.abort(),this.requestParams.markAsCancelled({cancelled:e,interrupted:t}),this.fireFinishEvents())}onProgress(e){this.requestParams.data()instanceof FormData&&(er(e),this.requestParams.all().onProgress(e))}getHeaders(){let e={...this.requestParams.headers(),Accept:`text/html, application/xhtml+xml`,"X-Requested-With":`XMLHttpRequest`,"X-Inertia":!0},t=V.get();t.version&&(e[`X-Inertia-Version`]=t.version);let n=Object.entries(t.onceProps||{}).filter(([,e])=>Mt(t.props,e.prop)===void 0?!1:!e.expiresAt||e.expiresAt>Date.now()).map(([e])=>e);return n.length>0&&(e[`X-Inertia-Except-Once-Props`]=n.join(`,`)),e}},Li=class{requests=[];maxConcurrent;interruptible;constructor({maxConcurrent:e,interruptible:t}){this.maxConcurrent=e,this.interruptible=t}send(e){this.requests.push(e),e.send().finally(()=>{this.requests=this.requests.filter(t=>t!==e)})}interruptInFlight(){this.cancel({interrupted:!0},!1)}cancelInFlight({prefetch:e=!0,optimistic:t=!0}={}){this.requests.filter(t=>e||!t.isPrefetch()).filter(e=>t||!e.isOptimistic()).forEach(e=>e.cancel({cancelled:!0}))}cancel({cancelled:e=!1,interrupted:t=!1}={},n=!1){!n&&!this.shouldCancel()||this.requests.shift()?.cancel({cancelled:e,interrupted:t})}shouldCancel(){return this.interruptible&&this.requests.length>=this.maxConcurrent}hasPendingOptimistic(){return this.requests.some(e=>e.isPendingOptimistic())}},Ri=()=>{},zi=class{syncRequestStream=new Li({maxConcurrent:1,interruptible:!0});asyncRequestStream=new Li({maxConcurrent:1/0,interruptible:!1});clientVisitQueue=new ri;pendingOptimisticCallback=void 0;init({initialPage:e,resolveComponent:t,swapComponent:n,onFlash:r}){V.init({initialPage:e,resolveComponent:t,swapComponent:n,onFlash:r}),di.handle(),ci.init(),ci.on(`missingHistoryItem`,()=>{typeof window<`u`&&this.visit(window.location.href,{preserveState:!0,preserveScroll:!0,replace:!0})}),ci.on(`loadDeferredProps`,e=>{this.loadDeferredProps(e)}),ci.on(`historyQuotaExceeded`,e=>{window.location.href=e})}optimistic(e){return this.pendingOptimisticCallback=e,this}get(e,t={},n={}){return this.visit(e,{...n,method:`get`,data:t})}post(e,t={},n={}){return this.visit(e,{preserveState:!0,...n,method:`post`,data:t})}put(e,t={},n={}){return this.visit(e,{preserveState:!0,...n,method:`put`,data:t})}patch(e,t={},n={}){return this.visit(e,{preserveState:!0,...n,method:`patch`,data:t})}delete(e,t={}){return this.visit(e,{preserveState:!0,...t,method:`delete`})}reload(e={}){return this.doReload(e)}doReload(e={}){if(!(typeof window>`u`))return this.visit(window.location.href,{...e,preserveScroll:!0,preserveState:!0,async:!0,headers:{...e.headers||{},"Cache-Control":`no-cache`}})}remember(e,t=`default`){H.remember(e,t)}restore(e=`default`){return H.restore(e)}on(e,t){return typeof window>`u`?()=>{}:ci.onGlobalEvent(e,t)}once(e,t){if(typeof window>`u`)return()=>{};let n=this.on(e,e=>(n(),t(e)));return n}hasPendingOptimistic(){return this.asyncRequestStream.hasPendingOptimistic()}get activePolls(){return pi.count}cancelAll({async:e=!0,prefetch:t=!0,sync:n=!0}={}){e&&this.asyncRequestStream.cancelInFlight({prefetch:t}),n&&this.syncRequestStream.cancelInFlight()}poll(e,t={},n={}){return pi.add(e,({onStart:e,onFinish:n})=>{let r=typeof t==`function`?t():t;this.doReload({poll:!0,preserveErrors:!0,...r,onCancelToken:t=>{e(t.cancel),r.onCancelToken?.(t)},onFinish:e=>{n(),r.onFinish?.(e)}})},{autoStart:n.autoStart??!0,keepAlive:n.keepAlive??!1,mode:n.mode})}visit(e,t={}){t.optimistic=t.optimistic??this.pendingOptimisticCallback,this.pendingOptimisticCallback=void 0,t.optimistic&&(t.async=t.async??!0);let n=this.getPendingVisit(e,{...t,showProgress:t.showProgress??(!t.async||!!t.optimistic)}),r=this.getVisitEvents(t);if(r.onBefore(n)===!1||!Kn(n))return;let i=Kr(V.get().url);(n.only.length>0||n.except.length>0||n.reset.length>0?Qr(n.url,i):Zr(n.url,i))||this.asyncRequestStream.cancelInFlight({prefetch:!1,optimistic:!1}),n.async||this.syncRequestStream.interruptInFlight(),t.optimistic&&this.applyOptimisticUpdate(t.optimistic,r),!V.isCleared()&&!n.preserveUrl&&jr.save();let a={...n,...r},o=()=>{let e=Cr.get(a);e?(Ka.reveal(e.inFlight),Cr.use(e,a)):(Ka.reveal(!0),(n.async?this.asyncRequestStream:this.syncRequestStream).send(Ii.create(a,V.get(),{optimistic:!!t.optimistic})))};Array.isArray(n.component)&&(console.error(`The "component" prop received an array of components (${n.component.join(`, `)}), but only a single component string is supported for instant visits. Pass an explicit component name instead.`),n.component=null),n.component?H.processQueue().then(()=>{this.performInstantSwap(n).then(()=>{a.preserveScroll=!0,a.preserveState=!0,a.replace=!0,a.viewTransition=!1,o()})}):o()}getCached(e,t={}){return Cr.findCached(this.getPrefetchParams(e,t))}flush(e,t={}){Cr.remove(this.getPrefetchParams(e,t))}flushAll(){Cr.removeAll()}flushByCacheTags(e){Cr.removeByTags(Array.isArray(e)?e:[e])}getPrefetching(e,t={}){return Cr.findInFlight(this.getPrefetchParams(e,t))}prefetch(e,t={},n={}){if((t.method??($r(e)?e.method:`get`))!==`get`)throw Error(`Prefetch requests must use the GET method`);let r=this.getPendingVisit(e,{...t,async:!0,showProgress:!1,prefetch:!0,viewTransition:!1});if(r.url.origin+r.url.pathname+r.url.search===window.location.origin+window.location.pathname+window.location.search)return;let i=this.getVisitEvents(t);if(i.onBefore(r)===!1||!Kn(r))return;Ka.hide(),this.asyncRequestStream.interruptInFlight();let a={...r,...i};new Promise(e=>{let t=()=>{V.get()?e():setTimeout(t,50)};t()}).then(()=>{Cr.add(a,e=>{this.asyncRequestStream.send(Ii.create(e,V.get()))},{cacheFor:Un.get(`prefetch.cacheFor`),cacheTags:[],...n})})}clearHistory(){H.clear()}decryptHistory(){return H.decrypt()}resolveComponent(e,t){return V.resolve(e,t)}replace(e){this.clientVisit(e,{replace:!0})}replaceProp(e,t,n){this.replace({preserveScroll:!0,preserveState:!0,props(n){let r=typeof t==`function`?t(Mt(n,e),n):t;return Xt(mt(n),e,r)},...n||{}})}appendToProp(e,t,n){this.replaceProp(e,(e,n)=>{let r=typeof t==`function`?t(e,n):t;return Array.isArray(e)||(e=e===void 0?[]:[e]),[...e,r]},n)}prependToProp(e,t,n){this.replaceProp(e,(e,n)=>{let r=typeof t==`function`?t(e,n):t;return Array.isArray(e)||(e=e===void 0?[]:[e]),[r,...e]},n)}push(e){this.clientVisit(e)}flash(e,t){let n=V.get().flash,r;if(typeof e==`function`)r=e(n);else if(typeof e==`string`)r={...n,[e]:t};else if(e&&Object.keys(e).length)r={...n,...e};else return;V.setFlash(r),Object.keys(r).length&&ar(r)}clientVisit(e,{replace:t=!1}={}){this.clientVisitQueue.add(()=>this.performClientVisit(e,{replace:t}))}performClientVisit(e,{replace:t=!1}={}){let n=V.get(),r=typeof e.props==`function`?Object.fromEntries(Object.values(n.onceProps??{}).map(e=>[e.prop,Mt(n.props,e.prop)])):{},i=typeof e.props==`function`?e.props(n.props,r):e.props??n.props,a=typeof e.flash==`function`?e.flash(n.flash):e.flash,{viewTransition:o,onError:s,onFinish:c,onFlash:l,onSuccess:u,...d}=e,f={...n,...d,flash:a??{},props:i},p=Ai.resolvePreserveOption(e.preserveScroll??!1,f),m=Ai.resolvePreserveOption(e.preserveState??!1,f),h=this.createVisitId();return V.set(f,{replace:t,preserveScroll:p,preserveState:m,viewTransition:o,visitId:h}).then(()=>{$n(V.get(),{replace:t,visitId:h});let n=V.get().flash;Object.keys(n).length>0&&(ar(n),l?.(n));let r=V.get().props.errors||{};if(Object.keys(r).length===0){u?.(V.get());return}let i=e.errorBag?r[e.errorBag||``]||{}:r;s?.(i)}).finally(()=>c?.(e))}performInstantSwap(e){let t=V.get(),n=Object.fromEntries((t.sharedProps??[]).filter(e=>e in t.props).map(e=>[e,t.props[e]])),r=typeof e.pageProps==`function`?e.pageProps(mt(t.props),mt(n)):e.pageProps,i=r===null?{...n}:{...r},a={component:e.component,url:e.url.pathname+e.url.search+e.url.hash,version:t.version,props:{...i,errors:{}},flash:{},rescuedProps:[],clearHistory:!1,encryptHistory:t.encryptHistory,sharedProps:t.sharedProps,rememberedState:{}};return V.set(a,{replace:e.replace,preserveScroll:Ai.resolvePreserveOption(e.preserveScroll,a),preserveState:!1,viewTransition:e.viewTransition,visitId:e.id})}getPrefetchParams(e,t){return{...this.getPendingVisit(e,{...t,async:!0,showProgress:!1,prefetch:!0,viewTransition:!1}),...this.getVisitEvents(t)}}createVisitId(){return ui()}getPendingVisit(e,t){if($r(e)){let n=e;e=n.url,t.method=t.method??n.method}let n=Un.get(`visitOptions`),r=n&&n(e.toString(),mt(t))||{},i={method:`get`,data:{},replace:!1,preserveScroll:!1,preserveState:!1,only:[],except:[],headers:{},errorBag:``,forceFormData:!1,queryStringArrayFormat:`brackets`,async:!1,showProgress:!0,fresh:!1,reset:[],preserveUrl:!1,preserveErrors:!1,prefetch:!1,invalidateCacheTags:[],viewTransition:!1,component:null,pageProps:null,cached:!1,...vr(t),...vr(r)},[a,o]=qr(e,i.data,i.method,i.forceFormData,i.queryStringArrayFormat),s={id:this.createVisitId(),cancelled:!1,completed:!1,interrupted:!1,...i,url:a,data:o};return s.prefetch&&(s.headers.Purpose=`prefetch`),s}getVisitEvents(e){return{onCancelToken:e.onCancelToken||Ri,onBefore:e.onBefore||Ri,onBeforeUpdate:e.onBeforeUpdate||Ri,onStart:e.onStart||Ri,onProgress:e.onProgress||Ri,onFinish:e.onFinish||Ri,onCancel:e.onCancel||Ri,onSuccess:e.onSuccess||Ri,onError:e.onError||Ri,onHttpException:e.onHttpException||Ri,onNetworkError:e.onNetworkError||Ri,onFlash:e.onFlash||Ri,onPrefetched:e.onPrefetched||Ri,onPrefetching:e.onPrefetching||Ri}}applyOptimisticUpdate(e,t){let n=V.get().props,r=e(mt(n));if(!r)return;let i=[];for(let e of Object.keys(r))St(n[e],r[e])||i.push(e);if(i.length===0)return;let a=V.nextOptimisticId(),o=V.get().component;for(let e of i)V.setBaseline(e,mt(n[e]));V.registerOptimistic(a,e),V.setPropsQuietly({...n,...r});let s=!0,c=t.onSuccess;t.onSuccess=e=>(s=!1,c(e));let l=t.onFinish;t.onFinish=e=>{if(V.unregisterOptimistic(a),s&&V.get().component===o){let e=V.replayOptimistics();Object.keys(e).length>0&&V.setPropsQuietly({...V.get().props,...e})}return V.pendingOptimisticCount()===0&&V.clearOptimisticState(),l(e)}}loadDeferredProps(e){e&&Object.values(e).forEach(e=>{this.doReload({only:e,deferredProps:!0,preserveErrors:!0})})}},Bi=class{static createWayfinderCallback(...e){return()=>e.length===1?$r(e[0])?e[0]:e[0]():{method:typeof e[0]==`function`?e[0]():e[0],url:typeof e[1]==`function`?e[1]():e[1]}}static parseUseFormArguments(...e){return e.length===0?{rememberKey:null,data:{},precognitionEndpoint:null}:e.length===1?{rememberKey:null,data:e[0],precognitionEndpoint:null}:e.length===2?typeof e[0]==`string`?{rememberKey:e[0],data:e[1],precognitionEndpoint:null}:{rememberKey:null,data:e[1],precognitionEndpoint:this.createWayfinderCallback(e[0])}:{rememberKey:null,data:e[2],precognitionEndpoint:this.createWayfinderCallback(e[0],e[1])}}static parseSubmitArguments(e,t){return e.length===3||e.length===2&&typeof e[0]==`string`?{method:e[0],url:e[1],options:e[2]??{}}:$r(e[0])?{...e[0],options:e[1]??{}}:{...t(),options:e[0]??{}}}static mergeHeadersForValidation(e,t,n){let r=e=>(e.headers={...n??{},...e.headers??{}},e);return e&&typeof e==`object`&&!(`target`in e)?e=r(e):t&&typeof t==`object`?t=r(t):typeof e==`string`?t=r(t??{}):e=r(e??{}),[e,t]}};function Vi(e){return e.includes(`.`)?e.replace(/\\\./g,`__ESCAPED_DOT__`).split(/(\[[^\]]*\])/).filter(Boolean).map(e=>e.startsWith(`[`)&&e.endsWith(`]`)?e:e.split(`.`).reduce((e,t,n)=>n===0?t:`${e}[${t}]`)).join(``).replace(/__ESCAPED_DOT__/g,`.`):e}function Hi(e){let t=[],n=/([^\[\]]+)|\[(\d*)\]/g,r;for(;(r=n.exec(e))!==null;)r[1]===void 0?r[2]!==void 0&&t.push(r[2]===``?``:Number(r[2])):t.push(r[1]);return t}function Ui(e,t,n){let r=e;for(let e=0;e<t.length-1;e++)t[e]in r||(r[t[e]]={}),r=r[t[e]];r[t[t.length-1]]=n}function Wi(e){let t=Object.keys(e),n=t.filter(e=>/^\d+$/.test(e)).map(Number).sort((e,t)=>e-t);return t.length===n.length&&n.length>0&&n[0]===0&&n.every((e,t)=>e===t)}function Gi(e){if(Array.isArray(e))return e.map(Gi);if(typeof e!=`object`||!e||Mr(e))return e;if(Wi(e)){let t=[];for(let n=0;n<Object.keys(e).length;n++)t[n]=Gi(e[n]);return t}let t={};for(let n in e)t[n]=Gi(e[n]);return t}function Ki(e){let t={};for(let[n,r]of e.entries()){if(r instanceof File&&r.size===0&&r.name===``)continue;let e=Hi(Vi(n));if(e[e.length-1]===``){let n=e.slice(0,-1),i=Mt(t,n);if(Array.isArray(i))i.push(r);else if(i&&typeof i==`object`&&!Mr(i)){let e=Object.keys(i).filter(e=>/^\d+$/.test(e)).map(Number).sort((e,t)=>e-t);Xt(t,n,e.length>0?[...e.map(e=>i[e]),r]:[r])}else Xt(t,n,[r]);continue}Ui(t,e.map(String),r)}return Gi(t)}var qi=`server`;function Ji(e,t){return e.match(/\sdata-inertia(=|\s|>)/)?e:e.replace(/^<([a-zA-Z][^\s/>]*)/,`<$1 data-inertia="server-head-${t}"`)}function Yi(e,t){if(!t)return[];let n=typeof t==`function`?t(e):e.props[t===!0?`head`:t];return Array.isArray(n)?n.map(e=>typeof e==`string`?e.trim():e).filter(e=>typeof e==`string`&&e.length>0).map(Ji):[]}var Xi={buildDOMElement(e){let t=document.createElement(`template`);t.innerHTML=e;let n=t.content.firstChild;if(!e.startsWith(`<script `))return n;let r=document.createElement(`script`);return r.innerHTML=n.innerHTML,n.getAttributeNames().forEach(e=>{r.setAttribute(e,n.getAttribute(e)||``)}),r},isInertiaManagedElement(e){return e.nodeType===Node.ELEMENT_NODE&&e.getAttribute(`data-inertia`)!==null},findMatchingElementIndex(e,t){let n=e.getAttribute(`data-inertia`);return n===null?-1:t.findIndex(e=>e.getAttribute(`data-inertia`)===n)},update:Wn(function(e){let t=e.map(e=>this.buildDOMElement(e)),n=Array.from(document.head.childNodes).filter(e=>this.isInertiaManagedElement(e));t.some(e=>e instanceof HTMLTitleElement)&&document.head.querySelectorAll(`title:not([data-inertia])`).forEach(e=>e.remove()),n.forEach(e=>{let n=this.findMatchingElementIndex(e,t);if(n===-1){e.remove();return}let r=t.splice(n,1)[0];r&&!e.isEqualNode(r)&&e.replaceWith(r)}),t.forEach(e=>{document.head.appendChild(e)})},1)};function Zi(e,t,n,r=[]){let i=r.length?{[qi]:r}:{},a=0;function o(){let e=a+=1;return i[e]=[],e.toString()}function s(e){e!==null&&Object.keys(i).indexOf(e)!==-1&&(delete i[e],f())}function c(e){Object.keys(i).indexOf(e)===-1&&(i[e]=[])}function l(e,t=[]){e!==null&&Object.keys(i).indexOf(e)>-1&&(i[e]=t),f()}function u(e=[]){e.length?i[qi]=e:delete i[qi],f()}function d(){let e=t(``),n=i[qi]||[],r=Object.keys(i).filter(e=>e!==qi).flatMap(e=>i[e]),a={...e?{title:`<title data-inertia="">${e}</title>`}:{}},o=n.concat(r).reduce((e,n)=>{if(n.indexOf(`<`)===-1)return e;if(n.indexOf(`<title `)===0){let r=n.match(/(<title [^>]+>)(.*?)(<\/title>)/s);return e.title=r?`${r[1]}${t(r[2])}${r[3]}`:n,e}let r=n.match(/ data-inertia=(["'])[^"']+\1/);return r?e[r[0]]=n:e[Object.keys(e).length]=n,e},a);return Object.values(o)}function f(){e?n(d()):Xi.update(d())}return f(),{forceUpdate:f,updateServerHead:u,createProvider:function(){let e=o();return{reconnect:()=>c(e),update:t=>l(e,t),disconnect:()=>s(e)}}}}var Qi=`X-Inertia-Infinite-Scroll-Merge-Intent`,$i=e=>{let t=()=>{let t=V.get().scrollProps?.[e.getPropName()];if(t)return t;throw Error(`The page object does not contain a scroll prop named "${e.getPropName()}".`)},n={component:null,loading:!1,previousPage:null,nextPage:null,lastLoadedPage:null,requestCount:0},r=()=>{let e=t();n.component=V.get().component,n.loading=!1,n.previousPage=e.previousPage,n.nextPage=e.nextPage,n.lastLoadedPage=e.currentPage,n.requestCount=0},i=()=>`inertia:infinite-scroll-data:${e.getPropName()}`;if(typeof window<`u`){r();let e=W.restore(i());e&&typeof e==`object`&&e.lastLoadedPage===t().currentPage&&(n.previousPage=e.previousPage,n.nextPage=e.nextPage,n.lastLoadedPage=e.lastLoadedPage,n.requestCount=e.requestCount||0)}let a=W.on(`success`,i=>{n.component===i.detail.page.component&&t().reset&&(r(),e.onReset?.())}),o=e=>e===`next`?`nextPage`:`previousPage`,s=e=>{let t=o(e);return n[t]},c=e=>{let r=t(),a=o(e);n.lastLoadedPage=r.currentPage,n[a]=r[a],n.requestCount+=1,W.remember({previousPage:n.previousPage,nextPage:n.nextPage,lastLoadedPage:n.lastLoadedPage,requestCount:n.requestCount},i())},l=()=>t().pageName,u=()=>n.requestCount,d=(t,r={})=>{let i=s(t);n.loading||i===null||(n.loading=!0,W.reload({preserveErrors:!0,...r,data:{...r.data||{},[l()]:i},only:[...r.only||[],e.getPropName()],preserveUrl:!0,headers:{[Qi]:t===`previous`?`prepend`:`append`,...r.headers},onBefore:n=>{t===`next`?e.onBeforeNextRequest():e.onBeforePreviousRequest(),r.onBefore?.(n)},onBeforeUpdate:t=>{e.onBeforeUpdate(),r.onBeforeUpdate?.(t)},onSuccess:e=>{c(t),r.onSuccess?.(e)},onFinish:i=>{n.loading=!1;let a=i.completed,o=a?n.lastLoadedPage:null;t===`next`?e.onCompleteNextRequest(o,{page:o,completed:a}):e.onCompletePreviousRequest(o,{page:o,completed:a}),r.onFinish?.(i)}}))};return{getLastLoadedPage:()=>n.lastLoadedPage,getPageName:l,getRequestCount:u,hasPrevious:()=>!!n.previousPage,hasNext:()=>!!n.nextPage,fetchNext:e=>d(`next`,e),fetchPrevious:e=>d(`previous`,e),removeEventListener:a}},ea=()=>{let e=[];return{new:(t,n={})=>{let r=new IntersectionObserver(e=>{for(let n of e)n.isIntersecting&&t(n)},n);return e.push(r),r},flushAll:()=>{e.forEach(e=>e.disconnect()),e.length=0}}},ta=`infiniteScrollPage`,na=`infiniteScrollIgnore`,ra=e=>e.dataset[ta],ia=e=>{let t=ea(),n,r,i,a,o=!1,s=()=>{a=new MutationObserver(e=>{e.forEach(e=>{e.addedNodes.forEach(e=>{e.nodeType===Node.ELEMENT_NODE&&f.add(e)})}),b()}),a.observe(e.getItemsElement(),{childList:!0}),n=t.new(t=>e.onItemIntersected(t.target));let o={root:e.getScrollableParent(),rootMargin:`${Math.max(1,e.getTriggerMargin())}px`};r=t.new(e.onPreviousTriggered,o),i=t.new(e.onNextTriggered,o)},c=()=>{o&&l();let t=e.getStartElement(),n=e.getEndElement();t&&e.shouldFetchPrevious()&&r.observe(t),n&&e.shouldFetchNext()&&i.observe(n),o=!0},l=()=>{o&&=(r.disconnect(),i.disconnect(),!1)},u=()=>{o&&c()},d=()=>{l(),t.flushAll(),a?.disconnect()},f=new Set,p=e=>!(ta in e.dataset)&&!(na in e.dataset),m=()=>{Array.from(f).forEach(e=>{p(e)&&(e.dataset[na]=`true`),n.observe(e)}),f.clear()},h=e=>Array.from(e.querySelectorAll(`:scope > *:not([data-infinite-scroll-page]):not([data-infinite-scroll-ignore])`)),g=!1,_=t=>{!g&&(g=!0,x())||(h(e.getItemsElement()).forEach(e=>{p(e)&&(e.dataset[ta]=t?.toString()||`1`),n.observe(e)}),y())},v=()=>`inertia:infinite-scroll-elements:${e.getPropName()}`,y=()=>{let t={},n=e.getItemsElement().childNodes;for(let e=0;e<n.length;e++){let r=n[e];if(r.nodeType!==Node.ELEMENT_NODE)continue;let i=ra(r);i!==void 0&&(i in t?t[i].to=e:t[i]={from:e,to:e})}W.remember(t,v())},b=Wn(y,250),x=()=>{let t=W.restore(v());if(!t||typeof t!=`object`)return!1;let r=e.getItemsElement().childNodes;for(let e=0;e<r.length;e++){let i=r[e];if(i.nodeType!==Node.ELEMENT_NODE)continue;let a=i,o;for(let[n,r]of Object.entries(t))if(e>=r.from&&e<=r.to){o=n;break}if(o)a.dataset[ta]=o;else if(p(a))a.dataset[na]=`true`;else continue;n.observe(a)}return!0};return{setupObservers:s,enableTriggers:c,disableTriggers:l,refreshTriggers:u,flushAll:d,processManuallyAddedElements:m,processServerLoadedElements:_}},aa=new ri,oa,sa,ca=null,la=e=>{let t=!0,n=n=>{aa.add(()=>new Promise(r=>{if(!t)return oa=sa=null,r();if(!oa||!sa){let e=V.get().url;oa=Kr(e),sa=Kr(e),ca=ti(e)}let i=e.getPageName(),a=sa.searchParams;n===`1`?a.delete(i):a.set(i,n),setTimeout(()=>r())})).finally(()=>{t&&oa&&sa&&oa.href!==sa.href&&ca!==null&&W.replace({url:ni(sa,ca),preserveScroll:!0,preserveState:!0}),oa=sa=ca=null})};return{onItemIntersected:Wn(r=>{let i=e.getItemsElement();if(!t||e.shouldPreserveUrl()||!r||!i)return;let a=new Map;Er([...i.children],r).forEach(e=>{let t=ra(e)??`1`;a.has(t)?a.set(t,a.get(t)+1):a.set(t,1)});let o=Array.from(a.entries()).sort((e,t)=>t[1]-e[1])[0]?.[0];o!==void 0&&n(o)},250),cancel:()=>t=!1}},ua=e=>({createCallbacks:()=>{let t,n=null,r=0;return{captureScrollPosition:()=>{let i=e.getScrollableParent(),a=e.getItemsElement();t=i?.scrollTop||window.scrollY;let o=Er([...a.children]);if(o.length>0){n=o[0];let e=i?.getBoundingClientRect()||{top:0},t=i?e.top:0;r=n.getBoundingClientRect().top-t}},restoreScrollPosition:()=>{if(!n)return;let i=0,a=!1,o=()=>{if(i++,a||i>10)return!1;let s=e.getScrollableParent(),c=s?.getBoundingClientRect()||{top:0},l=s?c.top:0,u=n.getBoundingClientRect().top-l-r;if(u===0){window.requestAnimationFrame(o);return}s?s.scrollTo({top:t+u}):window.scrollTo(0,window.scrollY+u),a=!0};window.requestAnimationFrame(o)}}}});function da(e){let t=la({...e,getPageName:()=>i.getPageName()}),n=ua(e),r=ia({...e,onItemIntersected:t.onItemIntersected,onPreviousTriggered:()=>i.fetchPrevious(),onNextTriggered:()=>i.fetchNext()}),i=$i({...e,onBeforeUpdate:r.processManuallyAddedElements,onCompletePreviousRequest:(t,n)=>{e.onCompletePreviousRequest(n),n.completed&&Dr(()=>r.processServerLoadedElements(n.page),2)},onCompleteNextRequest:(t,n)=>{e.onCompleteNextRequest(n),n.completed&&Dr(()=>r.processServerLoadedElements(n.page),2)},onReset:e.onDataReset}),a=e=>{let{captureScrollPosition:t,restoreScrollPosition:r}=n.createCallbacks(),i=e.onBeforeUpdate||(()=>{}),a=e.onSuccess||(()=>{});return e.onBeforeUpdate=e=>{i(e),t()},e.onSuccess=e=>{a(e),r()},e},o=i.fetchNext;i.fetchNext=(t={})=>{t={...e.getReloadOptions?.(),...t},e.inReverseMode()&&(t=a(t)),o(t)};let s=i.fetchPrevious;i.fetchPrevious=(t={})=>{t={...e.getReloadOptions?.(),...t},e.inReverseMode()||(t=a(t)),s(t)};let c=W.on(`success`,()=>Dr(r.refreshTriggers,2));return{dataManager:i,elementManager:r,flush:()=>{c(),i.removeEventListener(),r.flushAll(),t.cancel()}}}function fa(){let e={},t={},n={shared:e,named:t},r=new Set,i=!1,a=()=>{n={shared:e,named:t}},o=()=>{i||(i=!0,queueMicrotask(()=>{i=!1,r.forEach(e=>e())}))};return{set(t){let n={...e,...t};St(e,n)||(e=n,a(),o())},setFor(e,n){let r=t[e]||{},i={...r,...n};St(r,i)||(t={...t,[e]:i},a(),o())},reset(){e={},t={},a(),o()},subscribe(e){return r.add(e),()=>r.delete(e)},get:()=>n}}function pa(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function ma(e){return pa(e)&&`component`in e}function ha(e,t){return`component`in e&&t(e.component)}function ga(e,t){return!pa(e)||t(e)||ha(e,t)?!1:Object.values(e).every(e=>t(e)||Array.isArray(e)&&t(e[0])||ma(e)&&t(e.component))}function _a(e,t){return pa(e)&&!t(e)&&!ha(e,t)&&!ga(e,t)}function va(e,t){if(_a(e,t))return!0;if(!pa(e)||t(e)||ha(e,t))return!1;let n=Object.values(e);return n.length>0&&n.every(e=>typeof e==`function`)}function ya(e,t){return Array.isArray(e)&&e.length===2&&t(e[0])&&pa(e[1])&&!t(e[1])}function ba(e,t){if(Array.isArray(e)&&t(e[0]))return{component:e[0],props:e[1]??{}};if(ma(e)&&t(e.component))return{component:e.component,props:e.props??{}};if(t(e))return{component:e,props:{}};throw Error(`Invalid layout definition: received ${typeof e}`)}function xa(e,t,n){return!e||n&&n(e)?[]:ga(e,t)?Object.entries(e).map(([e,n])=>({...ba(n,t),name:e})):ya(e,t)?[{component:e[0],props:e[1]??{}}]:Array.isArray(e)?e.map(e=>ba(e,t)):ma(e)&&t(e.component)?[{component:e.component,props:e.props??{}}]:t(e)?[{component:e,props:{}}]:[]}function Sa(e){return e.target instanceof HTMLElement&&e.target.isContentEditable||e.defaultPrevented}function Ca(e){let t=e.currentTarget.tagName.toLowerCase()===`a`,n=t?e.currentTarget.target:``;return!(Sa(e)||t&&e.altKey||t&&e.ctrlKey||t&&e.metaKey||t&&e.shiftKey||t&&n!==``&&n!==`_self`||t&&`button`in e&&e.button!==0)}function wa(e){let t=e.currentTarget.tagName.toLowerCase()===`button`;return!Sa(e)&&(e.key===`Enter`||t&&e.key===` `)}var Ta=`nprogress`,Ea,Da,Oa={minimum:.08,easing:`linear`,speed:200,trickle:!0,trickleSpeed:200,showSpinner:!0,barSelector:`.bar, [role="bar"]`,spinnerSelector:`.spinner, [role="spinner"]`,parent:`body`,color:`#29d`,includeCSS:!0,popover:null,template:[`<div class="bar">`,`<div class="peg"></div>`,`</div>`,`<div class="spinner">`,`<div class="spinner-icon"></div>`,`</div>`].join(``)},ka=null,Aa=!1,ja=e=>{Object.assign(Oa,e),Ea=Oa.popover??`popover`in HTMLElement.prototype,Oa.includeCSS&&Wa(Oa.color),Da=document.createElement(`div`),Da.id=Ta,Da.setAttribute(`aria-hidden`,`true`),Da.innerHTML=Oa.template,Ea&&(Da.popover=`manual`)},Ma=e=>{let t=Na();e=Va(e,Oa.minimum,1),ka=e===1?null:e;let n=La(!t),r=n.querySelector(Oa.barSelector),i=Oa.speed,a=Oa.easing;n.offsetWidth,Ua(t=>{let o={transition:`all ${i}ms ${a}`,transform:`translate3d(${Ha(e)}%,0,0)`};for(let e in o)r.style[e]=o[e];if(e!==1)return setTimeout(t,i);n.style.transition=`none`,n.style.opacity=`1`,n.offsetWidth,setTimeout(()=>{n.style.transition=`all ${i}ms linear`,n.style.opacity=`0`,setTimeout(()=>{za(),n.style.transition=``,n.style.opacity=``,t()},i)},i)})},Na=()=>typeof ka==`number`,Pa=()=>{ka||Ma(0);let e=function(){setTimeout(function(){ka&&(Ia(),e())},Oa.trickleSpeed)};Oa.trickle&&e()},Fa=e=>{!e&&!ka||(Ia(.3+.5*Math.random()),Ma(1))},Ia=e=>{let t=ka;if(t===null)return Pa();if(!(t>1))return e=typeof e==`number`?e:(()=>{let e={.1:[0,.2],.04:[.2,.5],.02:[.5,.8],.005:[.8,.99]};for(let n in e)if(t>=e[n][0]&&t<e[n][1])return parseFloat(n);return 0})(),Ma(Va(t+e,0,.994))},La=e=>{if(Ba())return document.getElementById(Ta);document.documentElement.classList.add(`${Ta}-busy`);let t=Da.querySelector(Oa.barSelector),n=e?`-100`:Ha(ka||0);if(t.style.transition=`all 0 linear`,t.style.transform=`translate3d(${n}%,0,0)`,Oa.showSpinner||Da.querySelector(Oa.spinnerSelector)?.remove(),Ea)document.body.appendChild(Da),Aa||Da.showPopover();else{let e=Ra();e!==document.body&&e.classList.add(`${Ta}-custom-parent`),e.appendChild(Da),Aa&&(Da.style.display=`none`)}return Da},Ra=()=>document.querySelector(Oa.parent),za=()=>{if(document.documentElement.classList.remove(`${Ta}-busy`),Ea&&Da?.isConnected)try{Da.hidePopover()}catch{}Ea||Ra().classList.remove(`${Ta}-custom-parent`),Da?.remove()},Ba=()=>document.getElementById(Ta)!==null;function Va(e,t,n){return e<t?t:e>n?n:e}var Ha=e=>(-1+e)*100,Ua=(()=>{let e=[],t=()=>{let n=e.shift();n&&n(t)};return n=>{e.push(n),e.length===1&&t()}})(),Wa=e=>{let t=document.createElement(`style`),n=Un.get(`nonce`);n&&(t.nonce=n),t.textContent=`
|
|
12
|
+
#${Ta} {
|
|
13
|
+
pointer-events: none;
|
|
14
|
+
background: none;
|
|
15
|
+
border: none;
|
|
16
|
+
margin: 0;
|
|
17
|
+
padding: 0;
|
|
18
|
+
overflow: visible;
|
|
19
|
+
inset: unset;
|
|
20
|
+
width: 100%;
|
|
21
|
+
height: 0;
|
|
22
|
+
position: fixed;
|
|
23
|
+
top: 0;
|
|
24
|
+
left: 0;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
#${Ta}::backdrop {
|
|
28
|
+
display: none;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
#${Ta} .bar {
|
|
32
|
+
background: ${e};
|
|
33
|
+
|
|
34
|
+
position: fixed;
|
|
35
|
+
z-index: 1031;
|
|
36
|
+
top: 0;
|
|
37
|
+
left: 0;
|
|
38
|
+
|
|
39
|
+
width: 100%;
|
|
40
|
+
height: 2px;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
#${Ta} .peg {
|
|
44
|
+
display: block;
|
|
45
|
+
position: absolute;
|
|
46
|
+
right: 0px;
|
|
47
|
+
width: 100px;
|
|
48
|
+
height: 100%;
|
|
49
|
+
box-shadow: 0 0 10px ${e}, 0 0 5px ${e};
|
|
50
|
+
opacity: 1.0;
|
|
51
|
+
|
|
52
|
+
transform: rotate(3deg) translate(0px, -4px);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
#${Ta} .spinner {
|
|
56
|
+
display: block;
|
|
57
|
+
position: fixed;
|
|
58
|
+
z-index: 1031;
|
|
59
|
+
top: 15px;
|
|
60
|
+
right: 15px;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
#${Ta} .spinner-icon {
|
|
64
|
+
width: 18px;
|
|
65
|
+
height: 18px;
|
|
66
|
+
box-sizing: border-box;
|
|
67
|
+
|
|
68
|
+
border: solid 2px transparent;
|
|
69
|
+
border-top-color: ${e};
|
|
70
|
+
border-left-color: ${e};
|
|
71
|
+
border-radius: 50%;
|
|
72
|
+
|
|
73
|
+
animation: ${Ta}-spinner 400ms linear infinite;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.${Ta}-custom-parent {
|
|
77
|
+
overflow: hidden;
|
|
78
|
+
position: relative;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.${Ta}-custom-parent #${Ta} .spinner,
|
|
82
|
+
.${Ta}-custom-parent #${Ta} .bar {
|
|
83
|
+
position: absolute;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
@keyframes ${Ta}-spinner {
|
|
87
|
+
0% { transform: rotate(0deg); }
|
|
88
|
+
100% { transform: rotate(360deg); }
|
|
89
|
+
}
|
|
90
|
+
`,document.head.appendChild(t)},Ga={configure:ja,isStarted:Na,done:Fa,set:Ma,remove:za,start:Pa,status:ka,show:()=>{if(Aa=!1,Da?.isConnected)if(Ea)try{Da.showPopover()}catch{}else Da.style.display=``},hide:()=>{if(Aa=!0,Da?.isConnected)if(Ea)try{Da.hidePopover()}catch{}else Da.style.display=`none`}},Ka=new class{hideCount=0;start(){Ga.start()}reveal(e=!1){this.hideCount=Math.max(0,this.hideCount-1),(e||this.hideCount===0)&&Ga.show()}hide(){this.hideCount++,Ga.hide()}set(e){Ga.set(Math.max(0,Math.min(1,e)))}finish(){Ga.done()}reset(){Ga.set(0)}remove(){Ga.done(),Ga.remove()}isStarted(){return Ga.isStarted()}getStatus(){return Ga.status}};function qa(e){document.addEventListener(`inertia:start`,t=>Ja(t,e)),document.addEventListener(`inertia:progress`,Ya)}function Ja(e,t){e.detail.visit.showProgress||Ka.hide();let n=setTimeout(()=>Ka.start(),t);document.addEventListener(`inertia:finish`,e=>Xa(e,n),{once:!0})}function Ya(e){Ka.isStarted()&&e.detail.progress?.percentage&&Ka.set(Math.max(Ka.getStatus(),e.detail.progress.percentage/100*.9))}function Xa(e,t){clearTimeout(t),Ka.isStarted()&&(e.detail.visit.completed?Ka.finish():e.detail.visit.interrupted?Ka.reset():e.detail.visit.cancelled&&Ka.remove())}function Za({delay:e=250,color:t=`#29d`,includeCSS:n=!0,showSpinner:r=!1,popover:i=null}={}){qa(e),Ga.configure({showSpinner:r,includeCSS:n,color:t,popover:i})}var Qa=Symbol(`FormComponentReset`);function $a(e){return e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement}function eo(e,t){let n=e.value,r=e.checked;switch(e.type.toLowerCase()){case`checkbox`:e.checked=t.includes(e.value);break;case`radio`:e.checked=t[0]===e.value;break;case`file`:e.value=``;break;case`button`:case`submit`:case`reset`:case`image`:break;default:e.value=t[0]!==null&&t[0]!==void 0?String(t[0]):``}return e.value!==n||e.checked!==r}function to(e,t){let n=e.value,r=Array.from(e.selectedOptions).map(e=>e.value);if(e.multiple){let n=t.map(e=>String(e));Array.from(e.options).forEach(e=>{e.selected=n.includes(e.value)})}else e.value=t[0]===void 0?``:String(t[0]);let i=Array.from(e.selectedOptions).map(e=>e.value);return e.multiple?JSON.stringify(r.sort())!==JSON.stringify(i.sort()):e.value!==n}function no(e,t){if(e.disabled){if(e instanceof HTMLInputElement){let t=e.value,n=e.checked;switch(e.type.toLowerCase()){case`checkbox`:case`radio`:return e.checked=e.defaultChecked,e.checked!==n;case`file`:return e.value=``,t!==``;case`button`:case`submit`:case`reset`:case`image`:return!1;default:return e.value=e.defaultValue,e.value!==t}}else if(e instanceof HTMLSelectElement){let t=Array.from(e.selectedOptions).map(e=>e.value);Array.from(e.options).forEach(e=>{e.selected=e.defaultSelected});let n=Array.from(e.selectedOptions).map(e=>e.value);return JSON.stringify(t.sort())!==JSON.stringify(n.sort())}else if(e instanceof HTMLTextAreaElement){let t=e.value;return e.value=e.defaultValue,e.value!==t}return!1}if(e instanceof HTMLInputElement)return eo(e,t);if(e instanceof HTMLSelectElement)return to(e,t);if(e instanceof HTMLTextAreaElement){let n=e.value;return e.value=t[0]===void 0?``:String(t[0]),e.value!==n}return!1}function ro(e,t){let n=!1;return e instanceof RadioNodeList||e instanceof HTMLCollection?Array.from(e).forEach((e,r)=>{e instanceof Element&&$a(e)&&(e instanceof HTMLInputElement&&[`checkbox`,`radio`].includes(e.type.toLowerCase())?no(e,t)&&(n=!0):no(e,t[r]===void 0?[t[0]??null].filter(Boolean):[t[r]])&&(n=!0))}):$a(e)&&(n=no(e,t)),n}function io(e,t,n){if(!e)return;let r=!n||n.length===0;if(r){let r=new FormData(e),i=Array.from(e.elements).map(e=>$a(e)?e.name:``).filter(Boolean);n=[...new Set([...t.keys(),...r.keys(),...i])]}let i=!1;n.forEach(n=>{let r=e.elements.namedItem(n);r&&ro(r,t.getAll(n))&&(i=!0)}),i&&r&&e.dispatchEvent(new CustomEvent(`reset`,{bubbles:!0,cancelable:!0,detail:{[Qa]:!0}}))}function ao(e,t,n){return`<script data-page="${e}" type="application/json">${JSON.stringify(t).replace(/\//g,`\\/`)}<\/script><div data-server-rendered="true" id="${e}">${n}</div>`}var W=new zi,oo=n((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&A(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&A(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,ee=k.port2;k.port1.onmessage=D,O=function(){ee.postMessage(null)}}else O=function(){_(D,0)};function A(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,A(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),so=n(((e,t)=>{t.exports=oo()})),G=n((e=>{var t=so(),n=r(),i=o();function a(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function s(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function c(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function l(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function u(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function d(e){if(c(e)!==e)throw Error(a(188))}function f(e){var t=e.alternate;if(!t){if(t=c(e),t===null)throw Error(a(188));return t===e?e:null}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var o=i.alternate;if(o===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return d(i),e;if(o===r)return d(i),t;o=o.sibling}throw Error(a(188))}if(n.return!==r.return)n=i,r=o;else{for(var s=!1,l=i.child;l;){if(l===n){s=!0,n=i,r=o;break}if(l===r){s=!0,r=i,n=o;break}l=l.sibling}if(!s){for(l=o.child;l;){if(l===n){s=!0,n=o,r=i;break}if(l===r){s=!0,r=o,n=i;break}l=l.sibling}if(!s)throw Error(a(189))}}if(n.alternate!==r)throw Error(a(190))}if(n.tag!==3)throw Error(a(188));return n.stateNode.current===n?e:t}function p(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=p(e),t!==null)return t;e=e.sibling}return null}var m=Object.assign,h=Symbol.for(`react.element`),g=Symbol.for(`react.transitional.element`),_=Symbol.for(`react.portal`),v=Symbol.for(`react.fragment`),y=Symbol.for(`react.strict_mode`),b=Symbol.for(`react.profiler`),x=Symbol.for(`react.consumer`),S=Symbol.for(`react.context`),C=Symbol.for(`react.forward_ref`),w=Symbol.for(`react.suspense`),T=Symbol.for(`react.suspense_list`),E=Symbol.for(`react.memo`),D=Symbol.for(`react.lazy`),O=Symbol.for(`react.activity`),k=Symbol.for(`react.memo_cache_sentinel`),ee=Symbol.iterator;function A(e){return typeof e!=`object`||!e?null:(e=ee&&e[ee]||e[`@@iterator`],typeof e==`function`?e:null)}var j=Symbol.for(`react.client.reference`);function M(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===j?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case v:return`Fragment`;case b:return`Profiler`;case y:return`StrictMode`;case w:return`Suspense`;case T:return`SuspenseList`;case O:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case _:return`Portal`;case S:return e.displayName||`Context`;case x:return(e._context.displayName||`Context`)+`.Consumer`;case C:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case E:return t=e.displayName||null,t===null?M(e.type)||`Memo`:t;case D:t=e._payload,e=e._init;try{return M(e(t))}catch{}}return null}var N=Array.isArray,P=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I={pending:!1,data:null,method:null,action:null},te=[],ne=-1;function re(e){return{current:e}}function L(e){0>ne||(e.current=te[ne],te[ne]=null,ne--)}function R(e,t){ne++,te[ne]=e.current,e.current=t}var ie=re(null),ae=re(null),oe=re(null),se=re(null);function ce(e,t){switch(R(oe,t),R(ae,e),R(ie,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Vd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Vd(t),e=Hd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}L(ie),R(ie,e)}function le(){L(ie),L(ae),L(oe)}function ue(e){e.memoizedState!==null&&R(se,e);var t=ie.current,n=Hd(t,e.type);t!==n&&(R(ae,e),R(ie,n))}function de(e){ae.current===e&&(L(ie),L(ae)),se.current===e&&(L(se),Qf._currentValue=I)}var fe,pe;function z(e){if(fe===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);fe=t&&t[1]||``,pe=-1<e.stack.indexOf(`
|
|
91
|
+
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
92
|
+
`+fe+e+pe}var me=!1;function he(e,t){if(!e||me)return``;me=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
|
|
93
|
+
`),l=s.split(`
|
|
94
|
+
`);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
|
|
95
|
+
`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{me=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?z(n):``}function ge(e,t){switch(e.tag){case 26:case 27:case 5:return z(e.type);case 16:return z(`Lazy`);case 13:return e.child!==t&&t!==null?z(`Suspense Fallback`):z(`Suspense`);case 19:return z(`SuspenseList`);case 0:case 15:return he(e.type,!1);case 11:return he(e.type.render,!1);case 1:return he(e.type,!0);case 31:return z(`Activity`);default:return``}}function _e(e){try{var t=``,n=null;do t+=ge(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
96
|
+
Error generating stack: `+e.message+`
|
|
97
|
+
`+e.stack}}var B=Object.prototype.hasOwnProperty,ve=t.unstable_scheduleCallback,ye=t.unstable_cancelCallback,be=t.unstable_shouldYield,xe=t.unstable_requestPaint,Se=t.unstable_now,Ce=t.unstable_getCurrentPriorityLevel,we=t.unstable_ImmediatePriority,Te=t.unstable_UserBlockingPriority,Ee=t.unstable_NormalPriority,De=t.unstable_LowPriority,Oe=t.unstable_IdlePriority,ke=t.log,Ae=t.unstable_setDisableYieldValue,je=null,Me=null;function Ne(e){if(typeof ke==`function`&&Ae(e),Me&&typeof Me.setStrictMode==`function`)try{Me.setStrictMode(je,e)}catch{}}var Pe=Math.clz32?Math.clz32:Le,Fe=Math.log,Ie=Math.LN2;function Le(e){return e>>>=0,e===0?32:31-(Fe(e)/Ie|0)|0}var Re=256,ze=262144,Be=4194304;function Ve(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function He(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=Ve(n))):i=Ve(o):i=Ve(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Ve(n))):i=Ve(o)):i=Ve(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function Ue(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function We(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ge(){var e=Be;return Be<<=1,!(Be&62914560)&&(Be=4194304),e}function Ke(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function qe(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Je(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Pe(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&Ye(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function Ye(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Pe(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function Xe(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Pe(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function Ze(e,t){var n=t&-t;return n=n&42?1:Qe(n),(n&(e.suspendedLanes|t))===0?n:0}function Qe(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function $e(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function et(){var e=F.p;return e===0?(e=window.event,e===void 0?32:mp(e.type)):e}function tt(e,t){var n=F.p;try{return F.p=e,t()}finally{F.p=n}}var nt=Math.random().toString(36).slice(2),rt=`__reactFiber$`+nt,it=`__reactProps$`+nt,at=`__reactContainer$`+nt,ot=`__reactEvents$`+nt,st=`__reactListeners$`+nt,ct=`__reactHandles$`+nt,lt=`__reactResources$`+nt,ut=`__reactMarker$`+nt;function dt(e){delete e[rt],delete e[it],delete e[ot],delete e[st],delete e[ct]}function ft(e){var t=e[rt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[at]||n[rt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=df(e);e!==null;){if(n=e[rt])return n;e=df(e)}return t}e=n,n=e.parentNode}return null}function pt(e){if(e=e[rt]||e[at]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function mt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(a(33))}function ht(e){var t=e[lt];return t||=e[lt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function gt(e){e[ut]=!0}var _t=new Set,vt={};function yt(e,t){bt(e,t),bt(e+`Capture`,t)}function bt(e,t){for(vt[e]=t,e=0;e<t.length;e++)_t.add(t[e])}var xt=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),St={},Ct={};function wt(e){return B.call(Ct,e)?!0:B.call(St,e)?!1:xt.test(e)?Ct[e]=!0:(St[e]=!0,!1)}function Tt(e,t,n){if(wt(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}function Et(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,``+n)}}function Dt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function Ot(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function kt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function At(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function jt(e){if(!e._valueTracker){var t=kt(e)?`checked`:`value`;e._valueTracker=At(e,t,``+e[t])}}function Mt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=kt(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}function Nt(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var Pt=/[\n"\\]/g;function Ft(e){return e.replace(Pt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function It(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Ot(t)):e.value!==``+Ot(t)&&(e.value=``+Ot(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Rt(e,o,Ot(n)):Rt(e,o,Ot(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Ot(s):e.removeAttribute(`name`)}function Lt(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){jt(e);return}n=n==null?``:``+Ot(n),t=t==null?n:``+Ot(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),jt(e)}function Rt(e,t,n){t===`number`&&Nt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function zt(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Ot(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Bt(e,t,n){if(t!=null&&(t=``+Ot(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Ot(n)}function Vt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(a(92));if(N(r)){if(1<r.length)throw Error(a(93));r=r[0]}n=r}n??=``,t=n}n=Ot(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),jt(e)}function Ht(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ut=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function Wt(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||Ut.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Gt(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(a(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var i in t)r=t[i],t.hasOwnProperty(i)&&n[i]!==r&&Wt(e,i,r)}else for(var o in t)t.hasOwnProperty(o)&&Wt(e,o,t[o])}function Kt(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var qt=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),Jt=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Yt(e){return Jt.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function Xt(){}var Zt=null;function Qt(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var $t=null,en=null;function tn(e){var t=pt(e);if(t&&(e=t.stateNode)){var n=e[it]||null;a:switch(e=t.stateNode,t.type){case`input`:if(It(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+Ft(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=r[it]||null;if(!i)throw Error(a(90));It(r,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Mt(r)}break a;case`textarea`:Bt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&zt(e,!!n.multiple,t,!1)}}}var nn=!1;function rn(e,t,n){if(nn)return e(t,n);nn=!0;try{return e(t)}finally{if(nn=!1,($t!==null||en!==null)&&(vu(),$t&&(t=$t,e=en,en=$t=null,tn(t),e)))for(t=0;t<e.length;t++)tn(e[t])}}function an(e,t){var n=e.stateNode;if(n===null)return null;var r=n[it]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=e!==`button`&&e!==`input`&&e!==`select`&&e!==`textarea`),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(a(231,t,typeof n));return n}var on=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),sn=!1;if(on)try{var cn={};Object.defineProperty(cn,"passive",{get:function(){sn=!0}}),window.addEventListener(`test`,cn,cn),window.removeEventListener(`test`,cn,cn)}catch{sn=!1}var ln=null,un=null,dn=null;function fn(){if(dn)return dn;var e,t=un,n=t.length,r,i=`value`in ln?ln.value:ln.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return dn=i.slice(e,1<r?1-r:void 0)}function pn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function mn(){return!0}function hn(){return!1}function gn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?mn:hn,this.isPropagationStopped=hn,this}return m(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=mn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=mn)},persist:function(){},isPersistent:mn}),t}var _n={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},vn=gn(_n),yn=m({},_n,{view:0,detail:0}),bn=gn(yn),xn,Sn,Cn,wn=m({},yn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Fn,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==Cn&&(Cn&&e.type===`mousemove`?(xn=e.screenX-Cn.screenX,Sn=e.screenY-Cn.screenY):Sn=xn=0,Cn=e),xn)},movementY:function(e){return`movementY`in e?e.movementY:Sn}}),Tn=gn(wn),En=gn(m({},wn,{dataTransfer:0})),Dn=gn(m({},yn,{relatedTarget:0})),On=gn(m({},_n,{animationName:0,elapsedTime:0,pseudoElement:0})),kn=gn(m({},_n,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),An=gn(m({},_n,{data:0})),jn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Mn={8:`Backspace`,9:`Tab`,12:`Clear`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,19:`Pause`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,45:`Insert`,46:`Delete`,112:`F1`,113:`F2`,114:`F3`,115:`F4`,116:`F5`,117:`F6`,118:`F7`,119:`F8`,120:`F9`,121:`F10`,122:`F11`,123:`F12`,144:`NumLock`,145:`ScrollLock`,224:`Meta`},Nn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Pn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Nn[e])?!!t[e]:!1}function Fn(){return Pn}var In=gn(m({},yn,{key:function(e){if(e.key){var t=jn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=pn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Mn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Fn,charCode:function(e){return e.type===`keypress`?pn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?pn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Ln=gn(m({},wn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Rn=gn(m({},yn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Fn})),zn=gn(m({},_n,{propertyName:0,elapsedTime:0,pseudoElement:0})),Bn=gn(m({},wn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),Vn=gn(m({},_n,{newState:0,oldState:0})),Hn=[9,13,27,32],Un=on&&`CompositionEvent`in window,Wn=null;on&&`documentMode`in document&&(Wn=document.documentMode);var Gn=on&&`TextEvent`in window&&!Wn,Kn=on&&(!Un||Wn&&8<Wn&&11>=Wn),qn=` `,Jn=!1;function Yn(e,t){switch(e){case`keyup`:return Hn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Xn(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Zn=!1;function Qn(e,t){switch(e){case`compositionend`:return Xn(t);case`keypress`:return t.which===32?(Jn=!0,qn):null;case`textInput`:return e=t.data,e===qn&&Jn?null:e;default:return null}}function $n(e,t){if(Zn)return e===`compositionend`||!Un&&Yn(e,t)?(e=fn(),dn=un=ln=null,Zn=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return Kn&&t.locale!==`ko`?null:t.data;default:return null}}var er={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function tr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!er[e.type]:t===`textarea`}function nr(e,t,n,r){$t?en?en.push(r):en=[r]:$t=r,t=Td(t,`onChange`),0<t.length&&(n=new vn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var rr=null,ir=null;function ar(e){vd(e,0)}function or(e){if(Mt(mt(e)))return e}function sr(e,t){if(e===`change`)return t}var cr=!1;if(on){var lr;if(on){var ur=`oninput`in document;if(!ur){var dr=document.createElement(`div`);dr.setAttribute(`oninput`,`return;`),ur=typeof dr.oninput==`function`}lr=ur}else lr=!1;cr=lr&&(!document.documentMode||9<document.documentMode)}function fr(){rr&&(rr.detachEvent(`onpropertychange`,pr),ir=rr=null)}function pr(e){if(e.propertyName===`value`&&or(ir)){var t=[];nr(t,ir,e,Qt(e)),rn(ar,t)}}function mr(e,t,n){e===`focusin`?(fr(),rr=t,ir=n,rr.attachEvent(`onpropertychange`,pr)):e===`focusout`&&fr()}function hr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return or(ir)}function gr(e,t){if(e===`click`)return or(t)}function _r(e,t){if(e===`input`||e===`change`)return or(t)}function vr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var yr=typeof Object.is==`function`?Object.is:vr;function br(e,t){if(yr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!B.call(t,i)||!yr(e[i],t[i]))return!1}return!0}function xr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Sr(e,t){var n=xr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=xr(n)}}function Cr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Cr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function wr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Nt(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Nt(e.document)}return t}function Tr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Er=on&&`documentMode`in document&&11>=document.documentMode,Dr=null,Or=null,kr=null,Ar=!1;function jr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ar||Dr==null||Dr!==Nt(r)||(r=Dr,`selectionStart`in r&&Tr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),kr&&br(kr,r)||(kr=r,r=Td(Or,`onSelect`),0<r.length&&(t=new vn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Dr)))}function Mr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Nr={animationend:Mr(`Animation`,`AnimationEnd`),animationiteration:Mr(`Animation`,`AnimationIteration`),animationstart:Mr(`Animation`,`AnimationStart`),transitionrun:Mr(`Transition`,`TransitionRun`),transitionstart:Mr(`Transition`,`TransitionStart`),transitioncancel:Mr(`Transition`,`TransitionCancel`),transitionend:Mr(`Transition`,`TransitionEnd`)},Pr={},Fr={};on&&(Fr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Nr.animationend.animation,delete Nr.animationiteration.animation,delete Nr.animationstart.animation),`TransitionEvent`in window||delete Nr.transitionend.transition);function Ir(e){if(Pr[e])return Pr[e];if(!Nr[e])return e;var t=Nr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Fr)return Pr[e]=t[n];return e}var Lr=Ir(`animationend`),Rr=Ir(`animationiteration`),zr=Ir(`animationstart`),Br=Ir(`transitionrun`),Vr=Ir(`transitionstart`),Hr=Ir(`transitioncancel`),Ur=Ir(`transitionend`),Wr=new Map,Gr=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);Gr.push(`scrollEnd`);function Kr(e,t){Wr.set(e,t),yt(t,[e])}var qr=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},Jr=[],Yr=0,Xr=0;function Zr(){for(var e=Yr,t=Xr=Yr=0;t<e;){var n=Jr[t];Jr[t++]=null;var r=Jr[t];Jr[t++]=null;var i=Jr[t];Jr[t++]=null;var a=Jr[t];if(Jr[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&ti(n,i,a)}}function Qr(e,t,n,r){Jr[Yr++]=e,Jr[Yr++]=t,Jr[Yr++]=n,Jr[Yr++]=r,Xr|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function $r(e,t,n,r){return Qr(e,t,n,r),ni(e)}function ei(e,t){return Qr(e,null,null,t),ni(e)}function ti(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-Pe(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function ni(e){if(50<lu)throw lu=0,uu=null,Error(a(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var V={};function ri(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ii(e,t,n,r){return new ri(e,t,n,r)}function ai(e){return e=e.prototype,!(!e||!e.isReactComponent)}function oi(e,t){var n=e.alternate;return n===null?(n=ii(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function si(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function H(e,t,n,r,i,o){var s=0;if(r=e,typeof e==`function`)ai(e)&&(s=1);else if(typeof e==`string`)s=Uf(e,n,ie.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case O:return e=ii(31,n,t,i),e.elementType=O,e.lanes=o,e;case v:return ci(n.children,i,o,t);case y:s=8,i|=24;break;case b:return e=ii(12,n,t,i|2),e.elementType=b,e.lanes=o,e;case w:return e=ii(13,n,t,i),e.elementType=w,e.lanes=o,e;case T:return e=ii(19,n,t,i),e.elementType=T,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case S:s=10;break a;case x:s=9;break a;case C:s=11;break a;case E:s=14;break a;case D:s=16,r=null;break a}s=29,n=Error(a(130,e===null?`null`:typeof e,``)),r=null}return t=ii(s,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function ci(e,t,n,r){return e=ii(7,e,r,t),e.lanes=n,e}function li(e,t,n){return e=ii(6,e,null,t),e.lanes=n,e}function ui(e){var t=ii(18,null,null,0);return t.stateNode=e,t}function di(e,t,n){return t=ii(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var fi=new WeakMap;function pi(e,t){if(typeof e==`object`&&e){var n=fi.get(e);return n===void 0?(t={value:e,source:t,stack:_e(t)},fi.set(e,t),t):n}return{value:e,source:t,stack:_e(t)}}var mi=[],hi=0,gi=null,_i=0,vi=[],yi=0,bi=null,xi=1,Si=``;function Ci(e,t){mi[hi++]=_i,mi[hi++]=gi,gi=e,_i=t}function wi(e,t,n){vi[yi++]=xi,vi[yi++]=Si,vi[yi++]=bi,bi=e;var r=xi;e=Si;var i=32-Pe(r)-1;r&=~(1<<i),n+=1;var a=32-Pe(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,xi=1<<32-Pe(t)+i|n<<i|r,Si=a+e}else xi=1<<a|n<<i|r,Si=e}function Ti(e){e.return!==null&&(Ci(e,1),wi(e,1,0))}function Ei(e){for(;e===gi;)gi=mi[--hi],mi[hi]=null,_i=mi[--hi],mi[hi]=null;for(;e===bi;)bi=vi[--yi],vi[yi]=null,Si=vi[--yi],vi[yi]=null,xi=vi[--yi],vi[yi]=null}function Di(e,t){vi[yi++]=xi,vi[yi++]=Si,vi[yi++]=bi,xi=t.id,Si=t.overflow,bi=e}var Oi=null,ki=null,U=!1,Ai=null,ji=!1,Mi=Error(a(519));function Ni(e){throw zi(pi(Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Mi}function Pi(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[rt]=e,t[it]=r,n){case`dialog`:$(`cancel`,t),$(`close`,t);break;case`iframe`:case`object`:case`embed`:$(`load`,t);break;case`video`:case`audio`:for(n=0;n<gd.length;n++)$(gd[n],t);break;case`source`:$(`error`,t);break;case`img`:case`image`:case`link`:$(`error`,t),$(`load`,t);break;case`details`:$(`toggle`,t);break;case`input`:$(`invalid`,t),Lt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:$(`invalid`,t);break;case`textarea`:$(`invalid`,t),Vt(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||jd(t.textContent,n)?(r.popover!=null&&($(`beforetoggle`,t),$(`toggle`,t)),r.onScroll!=null&&$(`scroll`,t),r.onScrollEnd!=null&&$(`scrollend`,t),r.onClick!=null&&(t.onclick=Xt),t=!0):t=!1,t||Ni(e,!0)}function Fi(e){for(Oi=e.return;Oi;)switch(Oi.tag){case 5:case 31:case 13:ji=!1;return;case 27:case 3:ji=!0;return;default:Oi=Oi.return}}function Ii(e){if(e!==Oi)return!1;if(!U)return Fi(e),U=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||Ud(e.type,e.memoizedProps)),n=!n),n&&ki&&Ni(e),Fi(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(317));ki=uf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(317));ki=uf(e)}else t===27?(t=ki,Zd(e.type)?(e=lf,lf=null,ki=e):ki=t):ki=Oi?cf(e.stateNode.nextSibling):null;return!0}function Li(){ki=Oi=null,U=!1}function Ri(){var e=Ai;return e!==null&&(Yl===null?Yl=e:Yl.push.apply(Yl,e),Ai=null),e}function zi(e){Ai===null?Ai=[e]:Ai.push(e)}var Bi=re(null),Vi=null,Hi=null;function Ui(e,t,n){R(Bi,t._currentValue),t._currentValue=n}function Wi(e){e._currentValue=Bi.current,L(Bi)}function Gi(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function Ki(e,t,n,r){var i=e.child;for(i!==null&&(i.return=e);i!==null;){var o=i.dependencies;if(o!==null){var s=i.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=i;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Gi(o.return,n,e),r||(s=null);break a}o=c.next}}else if(i.tag===18){if(s=i.return,s===null)throw Error(a(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),Gi(s,n,e),s=null}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===e){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}}function qi(e,t,n,r){e=null;for(var i=t,o=!1;i!==null;){if(!o){if(i.flags&524288)o=!0;else if(i.flags&262144)break}if(i.tag===10){var s=i.alternate;if(s===null)throw Error(a(387));if(s=s.memoizedProps,s!==null){var c=i.type;yr(i.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(i===se.current){if(s=i.alternate,s===null)throw Error(a(387));s.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e===null?e=[Qf]:e.push(Qf))}i=i.return}e!==null&&Ki(t,e,n,r),t.flags|=262144}function Ji(e){for(e=e.firstContext;e!==null;){if(!yr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Yi(e){Vi=e,Hi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Xi(e){return Qi(Vi,e)}function Zi(e,t){return Vi===null&&Yi(e),Qi(e,t)}function Qi(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Hi===null){if(e===null)throw Error(a(308));Hi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Hi=Hi.next=t;return n}var $i=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},ea=t.unstable_scheduleCallback,ta=t.unstable_NormalPriority,na={$$typeof:S,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ra(){return{controller:new $i,data:new Map,refCount:0}}function ia(e){e.refCount--,e.refCount===0&&ea(ta,function(){e.controller.abort()})}var aa=null,oa=0,sa=0,ca=null;function la(e,t){if(aa===null){var n=aa=[];oa=0,sa=ud(),ca={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return oa++,t.then(ua,ua),t}function ua(){if(--oa===0&&aa!==null){ca!==null&&(ca.status=`fulfilled`);var e=aa;aa=null,sa=0,ca=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function da(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var fa=P.S;P.S=function(e,t){Ql=Se(),typeof t==`object`&&t&&typeof t.then==`function`&&la(e,t),fa!==null&&fa(e,t)};var pa=re(null);function ma(){var e=pa.current;return e===null?Il.pooledCache:e}function ha(e,t){t===null?R(pa,pa.current):R(pa,t.pool)}function ga(){var e=ma();return e===null?null:{parent:na._currentValue,pool:e}}var _a=Error(a(460)),va=Error(a(474)),ya=Error(a(542)),ba={then:function(){}};function xa(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Sa(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Xt,Xt),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Ea(e),e;default:if(typeof t.status==`string`)t.then(Xt,Xt);else{if(e=Il,e!==null&&100<e.shellSuspendCounter)throw Error(a(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Ea(e),e}throw wa=t,_a}}function Ca(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(wa=e,_a):e}}var wa=null;function Ta(){if(wa===null)throw Error(a(459));var e=wa;return wa=null,e}function Ea(e){if(e===_a||e===ya)throw Error(a(483))}var Da=null,Oa=0;function ka(e){var t=Oa;return Oa+=1,Da===null&&(Da=[]),Sa(Da,e,t)}function Aa(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function ja(e,t){throw t.$$typeof===h?Error(a(525)):(e=Object.prototype.toString.call(t),Error(a(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Ma(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function i(e,t){return e=oi(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=li(n,e.mode,r),t.return=e,t):(t=i(t,n),t.return=e,t)}function l(e,t,n,r){var a=n.type;return a===v?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===a||typeof a==`object`&&a&&a.$$typeof===D&&Ca(a)===t.type)?(t=i(t,n.props),Aa(t,n),t.return=e,t):(t=H(n.type,n.key,n.props,null,e.mode,r),Aa(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=di(n,e.mode,r),t.return=e,t):(t=i(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,a){return t===null||t.tag!==7?(t=ci(n,e.mode,r,a),t.return=e,t):(t=i(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=li(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case g:return n=H(t.type,t.key,t.props,null,e.mode,n),Aa(n,t),n.return=e,n;case _:return t=di(t,e.mode,n),t.return=e,t;case D:return t=Ca(t),f(e,t,n)}if(N(t)||A(t))return t=ci(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,ka(t),n);if(t.$$typeof===S)return f(e,Zi(e,t),n);ja(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case g:return n.key===i?l(e,t,n,r):null;case _:return n.key===i?u(e,t,n,r):null;case D:return n=Ca(n),p(e,t,n,r)}if(N(n)||A(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,ka(n),r);if(n.$$typeof===S)return p(e,t,Zi(e,n),r);ja(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case g:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case _:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case D:return r=Ca(r),m(e,t,n,r,i)}if(N(r)||A(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,ka(r),i);if(r.$$typeof===S)return m(e,t,n,Zi(t,r),i);ja(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),U&&Ci(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return U&&Ci(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),U&&Ci(i,h),l}function y(i,s,c,l){if(c==null)throw Error(a(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(i,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(i,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(i,h),U&&Ci(i,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(i,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return U&&Ci(i,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,i,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(i,e)}),U&&Ci(i,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===v&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case g:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===v){if(r.tag===7){n(e,r.sibling),c=i(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===D&&Ca(l)===r.type){n(e,r.sibling),c=i(r,o.props),Aa(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===v?(c=ci(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=H(o.type,o.key,o.props,null,e.mode,c),Aa(c,o),c.return=e,e=c)}return s(e);case _:a:{for(l=o.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=i(r,o.children||[]),c.return=e,e=c;break a}else{n(e,r);break}t(e,r),r=r.sibling}c=di(o,e.mode,c),c.return=e,e=c}return s(e);case D:return o=Ca(o),b(e,r,o,c)}if(N(o))return h(e,r,o,c);if(A(o)){if(l=A(o),typeof l!=`function`)throw Error(a(150));return o=l.call(o),y(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,ka(o),c);if(o.$$typeof===S)return b(e,r,Zi(e,o),c);ja(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=i(r,o),c.return=e,e=c):(n(e,r),c=li(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Oa=0;var i=b(e,t,n,r);return Da=null,i}catch(t){if(t===_a||t===ya)throw t;var a=ii(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Na=Ma(!0),Pa=Ma(!1),Fa=!1;function Ia(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function La(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ra(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function za(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Fl&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ni(e),ti(e,null,n),t}return Qr(e,r,t,n),ni(e)}function Ba(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Xe(e,n)}}function Va(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ha=!1;function Ua(){if(Ha){var e=ca;if(e!==null)throw e}}function Wa(e,t,n,r){Ha=!1;var i=e.updateQueue;Fa=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(Z&f)===f:(r&f)===f){f!==0&&f===sa&&(Ha=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,f);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,f=typeof h==`function`?h.call(_,d,f):h,f==null)break a;d=m({},d,f);break a;case 2:Fa=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),Ul|=o,e.lanes=o,e.memoizedState=d}}function Ga(e,t){if(typeof e!=`function`)throw Error(a(191,e));e.call(t)}function Ka(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Ga(n[e],t)}var qa=re(null),Ja=re(0);function Ya(e,t){e=Vl,R(Ja,e),R(qa,t),Vl=e|t.baseLanes}function Xa(){R(Ja,Vl),R(qa,qa.current)}function Za(){Vl=Ja.current,L(qa),L(Ja)}var Qa=re(null),$a=null;function eo(e){var t=e.alternate;R(ao,ao.current&1),R(Qa,e),$a===null&&(t===null||qa.current!==null||t.memoizedState!==null)&&($a=e)}function to(e){R(ao,ao.current),R(Qa,e),$a===null&&($a=e)}function no(e){e.tag===22?(R(ao,ao.current),R(Qa,e),$a===null&&($a=e)):ro(e)}function ro(){R(ao,ao.current),R(Qa,Qa.current)}function io(e){L(Qa),$a===e&&($a=null),L(ao)}var ao=re(0);function W(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||af(n)||of(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var oo=0,G=null,co=null,lo=null,uo=!1,fo=!1,po=!1,mo=0,ho=0,go=null,_o=0;function vo(){throw Error(a(321))}function yo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!yr(e[n],t[n]))return!1;return!0}function bo(e,t,n,r,i,a){return oo=a,G=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,P.H=e===null||e.memoizedState===null?Is:Ls,po=!1,a=n(r,i),po=!1,fo&&(a=So(t,n,r,i)),xo(e),a}function xo(e){P.H=Fs;var t=co!==null&&co.next!==null;if(oo=0,lo=co=G=null,uo=!1,ho=0,go=null,t)throw Error(a(300));e===null||q||(e=e.dependencies,e!==null&&Ji(e)&&(q=!0))}function So(e,t,n,r){G=e;var i=0;do{if(fo&&(go=null),ho=0,fo=!1,25<=i)throw Error(a(301));if(i+=1,lo=co=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}P.H=Rs,o=t(n,r)}while(fo);return o}function Co(){var e=P.H,t=e.useState()[0];return t=typeof t.then==`function`?Ao(t):t,e=e.useState()[0],(co===null?null:co.memoizedState)!==e&&(G.flags|=1024),t}function wo(){var e=mo!==0;return mo=0,e}function To(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Eo(e){if(uo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}uo=!1}oo=0,lo=co=G=null,fo=!1,ho=mo=0,go=null}function Do(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return lo===null?G.memoizedState=lo=e:lo=lo.next=e,lo}function Oo(){if(co===null){var e=G.alternate;e=e===null?null:e.memoizedState}else e=co.next;var t=lo===null?G.memoizedState:lo.next;if(t!==null)lo=t,co=e;else{if(e===null)throw G.alternate===null?Error(a(467)):Error(a(310));co=e,e={memoizedState:co.memoizedState,baseState:co.baseState,baseQueue:co.baseQueue,queue:co.queue,next:null},lo===null?G.memoizedState=lo=e:lo=lo.next=e}return lo}function ko(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ao(e){var t=ho;return ho+=1,go===null&&(go=[]),e=Sa(go,e,t),t=G,(lo===null?t.memoizedState:lo.next)===null&&(t=t.alternate,P.H=t===null||t.memoizedState===null?Is:Ls),e}function jo(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return Ao(e);if(e.$$typeof===S)return Xi(e)}throw Error(a(438,String(e)))}function Mo(e){var t=null,n=G.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=G.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=ko(),G.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=k;return t.index++,n}function No(e,t){return typeof t==`function`?t(e):t}function Po(e){return Fo(Oo(),co,e)}function Fo(e,t,n){var r=e.queue;if(r===null)throw Error(a(311));r.lastRenderedReducer=n;var i=e.baseQueue,o=r.pending;if(o!==null){if(i!==null){var s=i.next;i.next=o.next,o.next=s}t.baseQueue=i=o,r.pending=null}if(o=e.baseState,i===null)e.memoizedState=o;else{t=i.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(oo&f)===f:(Z&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===sa&&(d=!0);else if((oo&p)===p){u=u.next,p===sa&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,G.lanes|=p,Ul|=p;f=u.action,po&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,G.lanes|=f,Ul|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!yr(o,e.memoizedState)&&(q=!0,d&&(n=ca,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return i===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Io(e){var t=Oo(),n=t.queue;if(n===null)throw Error(a(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,o=t.memoizedState;if(i!==null){n.pending=null;var s=i=i.next;do o=e(o,s.action),s=s.next;while(s!==i);yr(o,t.memoizedState)||(q=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Lo(e,t,n){var r=G,i=Oo(),o=U;if(o){if(n===void 0)throw Error(a(407));n=n()}else n=t();var s=!yr((co||i).memoizedState,n);if(s&&(i.memoizedState=n,q=!0),i=i.queue,ss(Bo.bind(null,r,i,e),[e]),i.getSnapshot!==t||s||lo!==null&&lo.memoizedState.tag&1){if(r.flags|=2048,ns(9,{destroy:void 0},zo.bind(null,r,i,n,t),null),Il===null)throw Error(a(349));o||oo&127||Ro(r,t,n)}return n}function Ro(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=G.updateQueue,t===null?(t=ko(),G.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function zo(e,t,n,r){t.value=n,t.getSnapshot=r,Vo(t)&&Ho(e)}function Bo(e,t,n){return n(function(){Vo(t)&&Ho(e)})}function Vo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!yr(e,n)}catch{return!0}}function Ho(e){var t=ei(e,2);t!==null&&pu(t,e,2)}function Uo(e){var t=Do();if(typeof e==`function`){var n=e;if(e=n(),po){Ne(!0);try{n()}finally{Ne(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:No,lastRenderedState:e},t}function K(e,t,n,r){return e.baseState=n,Fo(e,co,typeof r==`function`?r:No)}function Wo(e,t,n,r,i){if(Ms(e))throw Error(a(485));if(e=t.action,e!==null){var o={payload:i,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};P.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Go(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Go(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=P.T,o={};P.T=o;try{var s=n(i,r),c=P.S;c!==null&&c(o,s),Ko(e,t,s)}catch(n){Jo(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),P.T=a}}else try{a=n(i,r),Ko(e,t,a)}catch(n){Jo(e,t,n)}}function Ko(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){qo(e,t,n)},function(n){return Jo(e,t,n)}):qo(e,t,n)}function qo(e,t,n){t.status=`fulfilled`,t.value=n,Yo(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Go(e,n)))}function Jo(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Yo(t),t=t.next;while(t!==r)}e.action=null}function Yo(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Xo(e,t){return t}function Zo(e,t){if(U){var n=Il.formState;if(n!==null){a:{var r=G;if(U){if(ki){b:{for(var i=ki,a=ji;i.nodeType!==8;){if(!a){i=null;break b}if(i=cf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){ki=cf(i.nextSibling),r=i.data===`F!`;break a}}Ni(r)}r=!1}r&&(t=n[0])}}return n=Do(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Xo,lastRenderedState:t},n.queue=r,n=ks.bind(null,G,r),r.dispatch=n,r=Uo(!1),a=js.bind(null,G,!1,r.queue),r=Do(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Wo.bind(null,G,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Qo(e){return $o(Oo(),co,e)}function $o(e,t,n){if(t=Fo(e,t,Xo)[0],e=Po(No)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=Ao(t)}catch(e){throw e===_a?ya:e}else r=t;t=Oo();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(G.flags|=2048,ns(9,{destroy:void 0},es.bind(null,i,n),null)),[r,a,e]}function es(e,t){e.action=t}function ts(e){var t=Oo(),n=co;if(n!==null)return $o(t,n,e);Oo(),t=t.memoizedState,n=Oo();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function ns(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=G.updateQueue,t===null&&(t=ko(),G.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function rs(){return Oo().memoizedState}function is(e,t,n,r){var i=Do();G.flags|=e,i.memoizedState=ns(1|t,{destroy:void 0},n,r===void 0?null:r)}function as(e,t,n,r){var i=Oo();r=r===void 0?null:r;var a=i.memoizedState.inst;co!==null&&r!==null&&yo(r,co.memoizedState.deps)?i.memoizedState=ns(t,a,n,r):(G.flags|=e,i.memoizedState=ns(1|t,a,n,r))}function os(e,t){is(8390656,8,e,t)}function ss(e,t){as(2048,8,e,t)}function cs(e){G.flags|=4;var t=G.updateQueue;if(t===null)t=ko(),G.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function ls(e){var t=Oo().memoizedState;return cs({ref:t,nextImpl:e}),function(){if(Fl&2)throw Error(a(440));return t.impl.apply(void 0,arguments)}}function us(e,t){return as(4,2,e,t)}function ds(e,t){return as(4,4,e,t)}function fs(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function ps(e,t,n){n=n==null?null:n.concat([e]),as(4,4,fs.bind(null,t,e),n)}function ms(){}function hs(e,t){var n=Oo();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&yo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function gs(e,t){var n=Oo();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&yo(t,r[1]))return r[0];if(r=e(),po){Ne(!0);try{e()}finally{Ne(!1)}}return n.memoizedState=[r,t],r}function _s(e,t,n){return n===void 0||oo&1073741824&&!(Z&261930)?e.memoizedState=t:(e.memoizedState=n,e=fu(),G.lanes|=e,Ul|=e,n)}function vs(e,t,n,r){return yr(n,t)?n:qa.current===null?!(oo&42)||oo&1073741824&&!(Z&261930)?(q=!0,e.memoizedState=n):(e=fu(),G.lanes|=e,Ul|=e,t):(e=_s(e,n,r),yr(e,t)||(q=!0),e)}function ys(e,t,n,r,i){var a=F.p;F.p=a!==0&&8>a?a:8;var o=P.T,s={};P.T=s,js(e,!1,t,n);try{var c=i(),l=P.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?As(e,t,da(c,r),du(e)):As(e,t,r,du(e))}catch(n){As(e,t,{then:function(){},status:`rejected`,reason:n},du())}finally{F.p=a,o!==null&&s.types!==null&&(o.types=s.types),P.T=o}}function bs(){}function xs(e,t,n,r){if(e.tag!==5)throw Error(a(476));var i=Ss(e).queue;ys(e,i,t,I,n===null?bs:function(){return Cs(e),n(r)})}function Ss(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:I,baseState:I,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:No,lastRenderedState:I},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:No,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Cs(e){var t=Ss(e);t.next===null&&(t=e.alternate.memoizedState),As(e,t.next.queue,{},du())}function ws(){return Xi(Qf)}function Ts(){return Oo().memoizedState}function Es(){return Oo().memoizedState}function Ds(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=du();e=Ra(n);var r=za(t,e,n);r!==null&&(pu(r,t,n),Ba(r,t,n)),t={cache:ra()},e.payload=t;return}t=t.return}}function Os(e,t,n){var r=du();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Ms(e)?Ns(t,n):(n=$r(e,t,n,r),n!==null&&(pu(n,e,r),Ps(n,t,r)))}function ks(e,t,n){As(e,t,n,du())}function As(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ms(e))Ns(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,yr(s,o))return Qr(e,t,i,0),Il===null&&Zr(),!1}catch{}if(n=$r(e,t,i,r),n!==null)return pu(n,e,r),Ps(n,t,r),!0}return!1}function js(e,t,n,r){if(r={lane:2,revertLane:ud(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Ms(e)){if(t)throw Error(a(479))}else t=$r(e,n,r,2),t!==null&&pu(t,e,2)}function Ms(e){var t=e.alternate;return e===G||t!==null&&t===G}function Ns(e,t){fo=uo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ps(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Xe(e,n)}}var Fs={readContext:Xi,use:jo,useCallback:vo,useContext:vo,useEffect:vo,useImperativeHandle:vo,useLayoutEffect:vo,useInsertionEffect:vo,useMemo:vo,useReducer:vo,useRef:vo,useState:vo,useDebugValue:vo,useDeferredValue:vo,useTransition:vo,useSyncExternalStore:vo,useId:vo,useHostTransitionStatus:vo,useFormState:vo,useActionState:vo,useOptimistic:vo,useMemoCache:vo,useCacheRefresh:vo};Fs.useEffectEvent=vo;var Is={readContext:Xi,use:jo,useCallback:function(e,t){return Do().memoizedState=[e,t===void 0?null:t],e},useContext:Xi,useEffect:os,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),is(4194308,4,fs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return is(4194308,4,e,t)},useInsertionEffect:function(e,t){is(4,2,e,t)},useMemo:function(e,t){var n=Do();t=t===void 0?null:t;var r=e();if(po){Ne(!0);try{e()}finally{Ne(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Do();if(n!==void 0){var i=n(t);if(po){Ne(!0);try{n(t)}finally{Ne(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=Os.bind(null,G,e),[r.memoizedState,e]},useRef:function(e){var t=Do();return e={current:e},t.memoizedState=e},useState:function(e){e=Uo(e);var t=e.queue,n=ks.bind(null,G,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:ms,useDeferredValue:function(e,t){return _s(Do(),e,t)},useTransition:function(){var e=Uo(!1);return e=ys.bind(null,G,e.queue,!0,!1),Do().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=G,i=Do();if(U){if(n===void 0)throw Error(a(407));n=n()}else{if(n=t(),Il===null)throw Error(a(349));Z&127||Ro(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,os(Bo.bind(null,r,o,e),[e]),r.flags|=2048,ns(9,{destroy:void 0},zo.bind(null,r,o,n,t),null),n},useId:function(){var e=Do(),t=Il.identifierPrefix;if(U){var n=Si,r=xi;n=(r&~(1<<32-Pe(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=mo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=_o++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:ws,useFormState:Zo,useActionState:Zo,useOptimistic:function(e){var t=Do();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=js.bind(null,G,!0,n),n.dispatch=t,[e,t]},useMemoCache:Mo,useCacheRefresh:function(){return Do().memoizedState=Ds.bind(null,G)},useEffectEvent:function(e){var t=Do(),n={impl:e};return t.memoizedState=n,function(){if(Fl&2)throw Error(a(440));return n.impl.apply(void 0,arguments)}}},Ls={readContext:Xi,use:jo,useCallback:hs,useContext:Xi,useEffect:ss,useImperativeHandle:ps,useInsertionEffect:us,useLayoutEffect:ds,useMemo:gs,useReducer:Po,useRef:rs,useState:function(){return Po(No)},useDebugValue:ms,useDeferredValue:function(e,t){return vs(Oo(),co.memoizedState,e,t)},useTransition:function(){var e=Po(No)[0],t=Oo().memoizedState;return[typeof e==`boolean`?e:Ao(e),t]},useSyncExternalStore:Lo,useId:Ts,useHostTransitionStatus:ws,useFormState:Qo,useActionState:Qo,useOptimistic:function(e,t){return K(Oo(),co,e,t)},useMemoCache:Mo,useCacheRefresh:Es};Ls.useEffectEvent=ls;var Rs={readContext:Xi,use:jo,useCallback:hs,useContext:Xi,useEffect:ss,useImperativeHandle:ps,useInsertionEffect:us,useLayoutEffect:ds,useMemo:gs,useReducer:Io,useRef:rs,useState:function(){return Io(No)},useDebugValue:ms,useDeferredValue:function(e,t){var n=Oo();return co===null?_s(n,e,t):vs(n,co.memoizedState,e,t)},useTransition:function(){var e=Io(No)[0],t=Oo().memoizedState;return[typeof e==`boolean`?e:Ao(e),t]},useSyncExternalStore:Lo,useId:Ts,useHostTransitionStatus:ws,useFormState:ts,useActionState:ts,useOptimistic:function(e,t){var n=Oo();return co===null?(n.baseState=e,[e,n.queue.dispatch]):K(n,co,e,t)},useMemoCache:Mo,useCacheRefresh:Es};Rs.useEffectEvent=ls;function zs(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:m({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Bs={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=du(),i=Ra(r);i.payload=t,n!=null&&(i.callback=n),t=za(e,i,r),t!==null&&(pu(t,e,r),Ba(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=du(),i=Ra(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=za(e,i,r),t!==null&&(pu(t,e,r),Ba(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=du(),r=Ra(n);r.tag=2,t!=null&&(r.callback=t),t=za(e,r,n),t!==null&&(pu(t,e,n),Ba(t,e,n))}};function Vs(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!br(n,r)||!br(i,a):!0}function Hs(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Bs.enqueueReplaceState(t,t.state,null)}function Us(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=m({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Ws(e){qr(e)}function Gs(e){console.error(e)}function Ks(e){qr(e)}function qs(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Js(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Ys(e,t,n){return n=Ra(n),n.tag=3,n.payload={element:null},n.callback=function(){qs(e,t)},n}function Xs(e){return e=Ra(e),e.tag=3,e}function Zs(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Js(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Js(t,n,r),typeof i!=`function`&&(tu===null?tu=new Set([this]):tu.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Qs(e,t,n,r,i){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&qi(t,n,i,!0),n=Qa.current,n!==null){switch(n.tag){case 31:case 13:return $a===null?Tu():n.alternate===null&&Hl===0&&(Hl=3),n.flags&=-257,n.flags|=65536,n.lanes=i,r===ba?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Wu(e,r,i)),!1;case 22:return n.flags|=65536,r===ba?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),Wu(e,r,i)),!1}throw Error(a(435,n.tag))}return Wu(e,r,i),Tu(),!1}if(U)return t=Qa.current,t===null?(r!==Mi&&(t=Error(a(423),{cause:r}),zi(pi(t,n))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,r=pi(r,n),i=Ys(e.stateNode,r,i),Va(e,i),Hl!==4&&(Hl=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=i,r!==Mi&&(e=Error(a(422),{cause:r}),zi(pi(e,n)))),!1;var o=Error(a(520),{cause:r});if(o=pi(o,n),Jl===null?Jl=[o]:Jl.push(o),Hl!==4&&(Hl=2),t===null)return!0;r=pi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=i&-i,n.lanes|=e,e=Ys(n.stateNode,r,e),Va(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(tu===null||!tu.has(o))))return n.flags|=65536,i&=-i,n.lanes|=i,i=Xs(i),Zs(i,e,n,r),Va(n,i),!1}n=n.return}while(n!==null);return!1}var $s=Error(a(461)),q=!1;function J(e,t,n,r){t.child=e===null?Pa(t,null,n,r):Na(t,e.child,n,r)}function ec(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return Yi(t),r=bo(e,t,n,o,a,i),s=wo(),e!==null&&!q?(To(e,t,i),wc(e,t,i)):(U&&s&&Ti(t),t.flags|=1,J(e,t,r,i),t.child)}function tc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ai(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,nc(e,t,a,r,i)):(e=H(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Tc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?br:n,n(o,r)&&e.ref===t.ref)return wc(e,t,i)}return t.flags|=1,e=oi(a,r),e.ref=t.ref,e.return=t,t.child=e}function nc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(br(a,r)&&e.ref===t.ref)if(q=!1,t.pendingProps=r=a,Tc(e,i))e.flags&131072&&(q=!0);else return t.lanes=e.lanes,wc(e,t,i)}return uc(e,t,n,r,i)}function rc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return ac(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ha(t,a===null?null:a.cachePool),a===null?Xa():Ya(t,a),no(t);else return r=t.lanes=536870912,ac(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&ha(t,null),Xa(),ro(t)):(ha(t,a.cachePool),Ya(t,a),ro(t),t.memoizedState=null);return J(e,t,i,n),t.child}function ic(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function ac(e,t,n,r,i){var a=ma();return a=a===null?null:{parent:na._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&ha(t,null),Xa(),no(t),e!==null&&qi(e,t,r,!0),t.childLanes=i,null}function oc(e,t){return t=yc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function sc(e,t,n){return Na(t,e.child,null,n),e=oc(t,t.pendingProps),e.flags|=2,io(t),t.memoizedState=null,e}function cc(e,t,n){var r=t.pendingProps,i=!!(t.flags&128);if(t.flags&=-129,e===null){if(U){if(r.mode===`hidden`)return e=oc(t,r),t.lanes=536870912,ic(null,e);if(to(t),(e=ki)?(e=rf(e,ji),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:bi===null?null:{id:xi,overflow:Si},retryLane:536870912,hydrationErrors:null},n=ui(e),n.return=t,t.child=n,Oi=t,ki=null)):e=null,e===null)throw Ni(t);return t.lanes=536870912,null}return oc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(to(t),i)if(t.flags&256)t.flags&=-257,t=sc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(a(558));else if(q||qi(e,t,n,!1),i=(n&e.childLanes)!==0,q||i){if(r=Il,r!==null&&(s=Ze(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,ei(e,s),pu(r,e,s),$s;Tu(),t=sc(e,t,n)}else e=o.treeContext,ki=cf(s.nextSibling),Oi=t,U=!0,Ai=null,ji=!1,e!==null&&Di(t,e),t=oc(t,r),t.flags|=4096;return t}return e=oi(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function lc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(a(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function uc(e,t,n,r,i){return Yi(t),n=bo(e,t,n,r,void 0,i),r=wo(),e!==null&&!q?(To(e,t,i),wc(e,t,i)):(U&&r&&Ti(t),t.flags|=1,J(e,t,n,i),t.child)}function dc(e,t,n,r,i,a){return Yi(t),t.updateQueue=null,n=So(t,r,n,i),xo(e),r=wo(),e!==null&&!q?(To(e,t,a),wc(e,t,a)):(U&&r&&Ti(t),t.flags|=1,J(e,t,n,a),t.child)}function fc(e,t,n,r,i){if(Yi(t),t.stateNode===null){var a=V,o=n.contextType;typeof o==`object`&&o&&(a=Xi(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Bs,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Ia(t),o=n.contextType,a.context=typeof o==`object`&&o?Xi(o):V,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(zs(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&Bs.enqueueReplaceState(a,a.state,null),Wa(t,r,a,i),Ua(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Us(n,s);a.props=c;var l=a.context,u=n.contextType;o=V,typeof u==`object`&&u&&(o=Xi(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Hs(t,a,r,o),Fa=!1;var f=t.memoizedState;a.state=f,Wa(t,r,a,i),Ua(),l=t.memoizedState,s||f!==l||Fa?(typeof d==`function`&&(zs(t,n,d,r),l=t.memoizedState),(c=Fa||Vs(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,La(e,t),o=t.memoizedProps,u=Us(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=V,typeof l==`object`&&l&&(c=Xi(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Hs(t,a,r,c),Fa=!1,f=t.memoizedState,a.state=f,Wa(t,r,a,i),Ua();var p=t.memoizedState;o!==d||f!==p||Fa||e!==null&&e.dependencies!==null&&Ji(e.dependencies)?(typeof s==`function`&&(zs(t,n,s,r),p=t.memoizedState),(u=Fa||Vs(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Ji(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,lc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Na(t,e.child,null,i),t.child=Na(t,null,n,i)):J(e,t,n,i),t.memoizedState=a.state,e=t.child):e=wc(e,t,i),e}function pc(e,t,n,r){return Li(),t.flags|=256,J(e,t,n,r),t.child}var mc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function hc(e){return{baseLanes:e,cachePool:ga()}}function gc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=Kl),e}function _c(e,t,n){var r=t.pendingProps,i=!1,o=!!(t.flags&128),s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:!!(ao.current&2)),s&&(i=!0,t.flags&=-129),s=!!(t.flags&32),t.flags&=-33,e===null){if(U){if(i?eo(t):ro(t),(e=ki)?(e=rf(e,ji),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:bi===null?null:{id:xi,overflow:Si},retryLane:536870912,hydrationErrors:null},n=ui(e),n.return=t,t.child=n,Oi=t,ki=null)):e=null,e===null)throw Ni(t);return of(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,i?(ro(t),i=t.mode,c=yc({mode:`hidden`,children:c},i),r=ci(r,i,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=hc(n),r.childLanes=gc(e,s,n),t.memoizedState=mc,ic(null,r)):(eo(t),vc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(eo(t),t.flags&=-257,t=bc(e,t,n)):t.memoizedState===null?(ro(t),c=r.fallback,i=t.mode,r=yc({mode:`visible`,children:r.children},i),c=ci(c,i,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Na(t,e.child,null,n),r=t.child,r.memoizedState=hc(n),r.childLanes=gc(e,s,n),t.memoizedState=mc,t=ic(null,r)):(ro(t),t.child=e.child,t.flags|=128,t=null);else if(eo(t),of(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(a(419)),r.stack=``,r.digest=s,zi({value:r,source:null,stack:null}),t=bc(e,t,n)}else if(q||qi(e,t,n,!1),s=(n&e.childLanes)!==0,q||s){if(s=Il,s!==null&&(r=Ze(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,ei(e,r),pu(s,e,r),$s;af(c)||Tu(),t=bc(e,t,n)}else af(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,ki=cf(c.nextSibling),Oi=t,U=!0,Ai=null,ji=!1,e!==null&&Di(t,e),t=vc(t,r.children),t.flags|=4096);return t}return i?(ro(t),c=r.fallback,i=t.mode,l=e.child,u=l.sibling,r=oi(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=ci(c,i,n,null),c.flags|=2):c=oi(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,ic(null,r),r=t.child,c=e.child.memoizedState,c===null?c=hc(n):(i=c.cachePool,i===null?i=ga():(l=na._currentValue,i=i.parent===l?i:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:i}),r.memoizedState=c,r.childLanes=gc(e,s,n),t.memoizedState=mc,ic(e.child,r)):(eo(t),n=e.child,e=n.sibling,n=oi(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function vc(e,t){return t=yc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function yc(e,t){return e=ii(22,e,null,t),e.lanes=0,e}function bc(e,t,n){return Na(t,e.child,null,n),e=vc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function xc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Gi(e.return,t,n)}function Sc(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function Cc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=ao.current,s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,R(ao,o),J(e,t,r,n),r=U?_i:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&xc(e,n,t);else if(e.tag===19)xc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&W(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Sc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&W(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Sc(t,!0,n,null,a,r);break;case`together`:Sc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function wc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Ul|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(qi(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(a(153));if(t.child!==null){for(e=t.child,n=oi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=oi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Tc(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&Ji(e)))}function Ec(e,t,n){switch(t.tag){case 3:ce(t,t.stateNode.containerInfo),Ui(t,na,e.memoizedState.cache),Li();break;case 27:case 5:ue(t);break;case 4:ce(t,t.stateNode.containerInfo);break;case 10:Ui(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,to(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(eo(t),e=wc(e,t,n),e===null?null:e.sibling):_c(e,t,n):(eo(t),t.flags|=128,null);eo(t);break;case 19:var i=!!(e.flags&128);if(r=(n&t.childLanes)!==0,r||=(qi(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return Cc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),R(ao,ao.current),r)break;return null;case 22:return t.lanes=0,rc(e,t,n,t.pendingProps);case 24:Ui(t,na,e.memoizedState.cache)}return wc(e,t,n)}function Dc(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)q=!0;else{if(!Tc(e,n)&&!(t.flags&128))return q=!1,Ec(e,t,n);q=!!(e.flags&131072)}else q=!1,U&&t.flags&1048576&&wi(t,_i,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Ca(t.elementType),t.type=e,typeof e==`function`)ai(e)?(r=Us(e,r),t.tag=1,t=fc(null,t,e,r,n)):(t.tag=0,t=uc(null,t,e,r,n));else{if(e!=null){var i=e.$$typeof;if(i===C){t.tag=11,t=ec(null,t,e,r,n);break a}if(i===E){t.tag=14,t=tc(null,t,e,r,n);break a}}throw t=M(e)||e,Error(a(306,t,``))}}return t;case 0:return uc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,i=Us(r,t.pendingProps),fc(e,t,r,i,n);case 3:a:{if(ce(t,t.stateNode.containerInfo),e===null)throw Error(a(387));r=t.pendingProps;var o=t.memoizedState;i=o.element,La(e,t),Wa(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Ui(t,na,r),r!==o.cache&&Ki(t,[na],n,!0),Ua(),r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=pc(e,t,r,n);break a}else if(r!==i){i=pi(Error(a(424)),t),zi(i),t=pc(e,t,r,n);break a}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(ki=cf(e.firstChild),Oi=t,U=!0,Ai=null,ji=!0,n=Pa(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Li(),r===i){t=wc(e,t,n);break a}J(e,t,r,n)}t=t.child}return t;case 26:return lc(e,t),e===null?(n=kf(t.type,null,t.pendingProps,null))?t.memoizedState=n:U||(n=t.type,e=t.pendingProps,r=Bd(oe.current).createElement(n),r[rt]=t,r[it]=e,Pd(r,n,e),gt(r),t.stateNode=r):t.memoizedState=kf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ue(t),e===null&&U&&(r=t.stateNode=ff(t.type,t.pendingProps,oe.current),Oi=t,ji=!0,i=ki,Zd(t.type)?(lf=i,ki=cf(r.firstChild)):ki=i),J(e,t,t.pendingProps.children,n),lc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&U&&((i=r=ki)&&(r=tf(r,t.type,t.pendingProps,ji),r===null?i=!1:(t.stateNode=r,Oi=t,ki=cf(r.firstChild),ji=!1,i=!0)),i||Ni(t)),ue(t),i=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Ud(i,o)?r=null:s!==null&&Ud(i,s)&&(t.flags|=32),t.memoizedState!==null&&(i=bo(e,t,Co,null,null,n),Qf._currentValue=i),lc(e,t),J(e,t,r,n),t.child;case 6:return e===null&&U&&((e=n=ki)&&(n=nf(n,t.pendingProps,ji),n===null?e=!1:(t.stateNode=n,Oi=t,ki=null,e=!0)),e||Ni(t)),null;case 13:return _c(e,t,n);case 4:return ce(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Na(t,null,r,n):J(e,t,r,n),t.child;case 11:return ec(e,t,t.type,t.pendingProps,n);case 7:return J(e,t,t.pendingProps,n),t.child;case 8:return J(e,t,t.pendingProps.children,n),t.child;case 12:return J(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Ui(t,t.type,r.value),J(e,t,r.children,n),t.child;case 9:return i=t.type._context,r=t.pendingProps.children,Yi(t),i=Xi(i),r=r(i),t.flags|=1,J(e,t,r,n),t.child;case 14:return tc(e,t,t.type,t.pendingProps,n);case 15:return nc(e,t,t.type,t.pendingProps,n);case 19:return Cc(e,t,n);case 31:return cc(e,t,n);case 22:return rc(e,t,n,t.pendingProps);case 24:return Yi(t),r=Xi(na),e===null?(i=ma(),i===null&&(i=Il,o=ra(),i.pooledCache=o,o.refCount++,o!==null&&(i.pooledCacheLanes|=n),i=o),t.memoizedState={parent:r,cache:i},Ia(t),Ui(t,na,i)):((e.lanes&n)!==0&&(La(e,t),Wa(t,null,null,n),Ua()),i=e.memoizedState,o=t.memoizedState,i.parent===r?(r=o.cache,Ui(t,na,r),r!==i.cache&&Ki(t,[na],n,!0)):(i={parent:r,cache:r},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),Ui(t,na,r))),J(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(a(156,t.tag))}function Oc(e){e.flags|=4}function kc(e,t,n,r,i){if((t=!!(e.mode&32))&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(Su())e.flags|=8192;else throw wa=ba,va}else e.flags&=-16777217}function Ac(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Wf(t))if(Su())e.flags|=8192;else throw wa=ba,va}function jc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:Ge(),e.lanes|=t,ql|=t)}function Mc(e,t){if(!U)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Nc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Pc(e,t,n){var r=t.pendingProps;switch(Ei(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Nc(t),null;case 1:return Nc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Wi(na),le(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Ii(t)?Oc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ri())),Nc(t),null;case 26:var i=t.type,o=t.memoizedState;return e===null?(Oc(t),o===null?(Nc(t),kc(t,i,null,r,n)):(Nc(t),Ac(t,o))):o?o===e.memoizedState?(Nc(t),t.flags&=-16777217):(Oc(t),Nc(t),Ac(t,o)):(e=e.memoizedProps,e!==r&&Oc(t),Nc(t),kc(t,i,e,r,n)),null;case 27:if(de(t),n=oe.current,i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Oc(t);else{if(!r){if(t.stateNode===null)throw Error(a(166));return Nc(t),null}e=ie.current,Ii(t)?Pi(t,e):(e=ff(i,r,n),t.stateNode=e,Oc(t))}return Nc(t),null;case 5:if(de(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Oc(t);else{if(!r){if(t.stateNode===null)throw Error(a(166));return Nc(t),null}if(o=ie.current,Ii(t))Pi(t,o);else{var s=Bd(oe.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,i);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,i);break;default:switch(i){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,i);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,i);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(i,{is:r.is}):s.createElement(i)}}o[rt]=t,o[it]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Pd(o,i,r),i){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Oc(t)}}return Nc(t),kc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Oc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(a(166));if(e=oe.current,Ii(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,i=Oi,i!==null)switch(i.tag){case 27:case 5:r=i.memoizedProps}e[rt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||jd(e.nodeValue,n)),e||Ni(t,!0)}else e=Bd(e).createTextNode(r),e[rt]=t,t.stateNode=e}return Nc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Ii(t),n!==null){if(e===null){if(!r)throw Error(a(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(557));e[rt]=t}else Li(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Nc(t),e=!1}else n=Ri(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(io(t),t):(io(t),null);if(t.flags&128)throw Error(a(558))}return Nc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=Ii(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(a(318));if(i=t.memoizedState,i=i===null?null:i.dehydrated,!i)throw Error(a(317));i[rt]=t}else Li(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Nc(t),i=!1}else i=Ri(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(io(t),t):(io(t),null)}return io(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,i=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(i=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==i&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),jc(t,t.updateQueue),Nc(t),null);case 4:return le(),e===null&&xd(t.stateNode.containerInfo),Nc(t),null;case 10:return Wi(t.type),Nc(t),null;case 19:if(L(ao),r=t.memoizedState,r===null)return Nc(t),null;if(i=!!(t.flags&128),o=r.rendering,o===null)if(i)Mc(r,!1);else{if(Hl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=W(e),o!==null){for(t.flags|=128,Mc(r,!1),e=o.updateQueue,t.updateQueue=e,jc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)si(n,e),n=n.sibling;return R(ao,ao.current&1|2),U&&Ci(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Se()>$l&&(t.flags|=128,i=!0,Mc(r,!1),t.lanes=4194304)}else{if(!i)if(e=W(o),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,jc(t,e),Mc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!U)return Nc(t),null}else 2*Se()-r.renderingStartTime>$l&&n!==536870912&&(t.flags|=128,i=!0,Mc(r,!1),t.lanes=4194304);r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(Nc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Se(),e.sibling=null,n=ao.current,R(ao,i?n&1|2:n&1),U&&Ci(t,r.treeForkCount),e);case 22:case 23:return io(t),Za(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Nc(t),t.subtreeFlags&6&&(t.flags|=8192)):Nc(t),n=t.updateQueue,n!==null&&jc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&L(pa),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Wi(na),Nc(t),null;case 25:return null;case 30:return null}throw Error(a(156,t.tag))}function Fc(e,t){switch(Ei(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Wi(na),le(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return de(t),null;case 31:if(t.memoizedState!==null){if(io(t),t.alternate===null)throw Error(a(340));Li()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(io(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(a(340));Li()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return L(ao),null;case 4:return le(),null;case 10:return Wi(t.type),null;case 22:case 23:return io(t),Za(),e!==null&&L(pa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Wi(na),null;case 25:return null;default:return null}}function Ic(e,t){switch(Ei(t),t.tag){case 3:Wi(na),le();break;case 26:case 27:case 5:de(t);break;case 4:le();break;case 31:t.memoizedState!==null&&io(t);break;case 13:io(t);break;case 19:L(ao);break;case 10:Wi(t.type);break;case 22:case 23:io(t),Za(),e!==null&&L(pa);break;case 24:Wi(na)}}function Lc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Uu(t,t.return,e)}}function Rc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Uu(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Uu(t,t.return,e)}}function zc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Ka(t,n)}catch(t){Uu(e,e.return,t)}}}function Bc(e,t,n){n.props=Us(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Uu(e,t,n)}}function Vc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Uu(e,t,n)}}function Hc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){Uu(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Uu(e,t,n)}else n.current=null}function Uc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Uu(e,e.return,t)}}function Wc(e,t,n){try{var r=e.stateNode;Fd(r,e.type,n,t),r[it]=t}catch(t){Uu(e,e.return,t)}}function Gc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Zd(e.type)||e.tag===4}function Kc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Gc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Zd(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function qc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Xt));else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(qc(e,t,n),e=e.sibling;e!==null;)qc(e,t,n),e=e.sibling}function Jc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Jc(e,t,n),e=e.sibling;e!==null;)Jc(e,t,n),e=e.sibling}function Yc(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Pd(t,r,n),t[rt]=e,t[it]=n}catch(t){Uu(e,e.return,t)}}var Xc=!1,Y=!1,Zc=!1,Qc=typeof WeakSet==`function`?WeakSet:Set,$c=null;function el(e,t){if(e=e.containerInfo,Rd=sp,e=wr(e),Tr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||i!==0&&f.nodeType!==3||(c=s+i),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===i&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(zd={focusedElem:e,selectionRange:n},sp=!1,$c=t;$c!==null;)if(t=$c,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,$c=e;else for(;$c!==null;){switch(t=$c,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)i=e[n],i.ref.impl=i.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,i=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=Us(n.type,i);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Uu(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)ef(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:ef(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(a(163))}if(e=t.sibling,e!==null){e.return=t.return,$c=e;break}$c=t.return}}function tl(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:gl(e,n),r&4&&Lc(5,n);break;case 1:if(gl(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Uu(n,n.return,e)}else{var i=Us(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Uu(n,n.return,e)}}r&64&&zc(n),r&512&&Vc(n,n.return);break;case 3:if(gl(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Ka(e,t)}catch(e){Uu(n,n.return,e)}}break;case 27:t===null&&r&4&&Yc(n);case 26:case 5:gl(e,n),t===null&&r&4&&Uc(n),r&512&&Vc(n,n.return);break;case 12:gl(e,n);break;case 31:gl(e,n),r&4&&sl(e,n);break;case 13:gl(e,n),r&4&&cl(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=qu.bind(null,n),sf(e,n))));break;case 22:if(r=n.memoizedState!==null||Xc,!r){t=t!==null&&t.memoizedState!==null||Y,i=Xc;var a=Y;Xc=r,(Y=t)&&!a?vl(e,n,!!(n.subtreeFlags&8772)):gl(e,n),Xc=i,Y=a}break;case 30:break;default:gl(e,n)}}function nl(e){var t=e.alternate;t!==null&&(e.alternate=null,nl(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&dt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var rl=null,il=!1;function al(e,t,n){for(n=n.child;n!==null;)ol(e,t,n),n=n.sibling}function ol(e,t,n){if(Me&&typeof Me.onCommitFiberUnmount==`function`)try{Me.onCommitFiberUnmount(je,n)}catch{}switch(n.tag){case 26:Y||Hc(n,t),al(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Y||Hc(n,t);var r=rl,i=il;Zd(n.type)&&(rl=n.stateNode,il=!1),al(e,t,n),pf(n.stateNode),rl=r,il=i;break;case 5:Y||Hc(n,t);case 6:if(r=rl,i=il,rl=null,al(e,t,n),rl=r,il=i,rl!==null)if(il)try{(rl.nodeType===9?rl.body:rl.nodeName===`HTML`?rl.ownerDocument.body:rl).removeChild(n.stateNode)}catch(e){Uu(n,t,e)}else try{rl.removeChild(n.stateNode)}catch(e){Uu(n,t,e)}break;case 18:rl!==null&&(il?(e=rl,Qd(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Np(e)):Qd(rl,n.stateNode));break;case 4:r=rl,i=il,rl=n.stateNode.containerInfo,il=!0,al(e,t,n),rl=r,il=i;break;case 0:case 11:case 14:case 15:Rc(2,n,t),Y||Rc(4,n,t),al(e,t,n);break;case 1:Y||(Hc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Bc(n,t,r)),al(e,t,n);break;case 21:al(e,t,n);break;case 22:Y=(r=Y)||n.memoizedState!==null,al(e,t,n),Y=r;break;default:al(e,t,n)}}function sl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Np(e)}catch(e){Uu(t,t.return,e)}}}function cl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Np(e)}catch(e){Uu(t,t.return,e)}}function ll(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Qc),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Qc),t;default:throw Error(a(435,e.tag))}}function ul(e,t){var n=ll(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Ju.bind(null,e,t);t.then(r,r)}})}function dl(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(Zd(c.type)){rl=c.stateNode,il=!1;break a}break;case 5:rl=c.stateNode,il=!1;break a;case 3:case 4:rl=c.stateNode.containerInfo,il=!0;break a}c=c.return}if(rl===null)throw Error(a(160));ol(o,s,i),rl=null,il=!1,o=i.alternate,o!==null&&(o.return=null),i.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)pl(t,e),t=t.sibling}var fl=null;function pl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:dl(t,e),ml(e),r&4&&(Rc(3,e,e.return),Lc(3,e),Rc(5,e,e.return));break;case 1:dl(t,e),ml(e),r&512&&(Y||n===null||Hc(n,n.return)),r&64&&Xc&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var i=fl;if(dl(t,e),ml(e),r&512&&(Y||n===null||Hc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,i=i.ownerDocument||i;b:switch(r){case`title`:o=i.getElementsByTagName(`title`)[0],(!o||o[ut]||o[rt]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=i.createElement(r),i.head.insertBefore(o,i.querySelector(`head > title`))),Pd(o,r,n),o[rt]=e,gt(o),r=o;break a;case`link`:var s=Vf(`link`,`href`,i).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=i.createElement(r),Pd(o,r,n),i.head.appendChild(o);break;case`meta`:if(s=Vf(`meta`,`content`,i).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=i.createElement(r),Pd(o,r,n),i.head.appendChild(o);break;default:throw Error(a(468,r))}o[rt]=e,gt(o),r=o}e.stateNode=r}else Hf(i,e.type,e.stateNode);else e.stateNode=If(i,r,e.memoizedProps);else o===r?r===null&&e.stateNode!==null&&Wc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Hf(i,e.type,e.stateNode):If(i,r,e.memoizedProps))}break;case 27:dl(t,e),ml(e),r&512&&(Y||n===null||Hc(n,n.return)),n!==null&&r&4&&Wc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(dl(t,e),ml(e),r&512&&(Y||n===null||Hc(n,n.return)),e.flags&32){i=e.stateNode;try{Ht(i,``)}catch(t){Uu(e,e.return,t)}}r&4&&e.stateNode!=null&&(i=e.memoizedProps,Wc(e,i,n===null?i:n.memoizedProps)),r&1024&&(Zc=!0);break;case 6:if(dl(t,e),ml(e),r&4){if(e.stateNode===null)throw Error(a(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Uu(e,e.return,t)}}break;case 3:if(Bf=null,i=fl,fl=gf(t.containerInfo),dl(t,e),fl=i,ml(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Np(t.containerInfo)}catch(t){Uu(e,e.return,t)}Zc&&(Zc=!1,hl(e));break;case 4:r=fl,fl=gf(e.stateNode.containerInfo),dl(t,e),ml(e),fl=r;break;case 12:dl(t,e),ml(e);break;case 31:dl(t,e),ml(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ul(e,r)));break;case 13:dl(t,e),ml(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Zl=Se()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ul(e,r)));break;case 22:i=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=Xc,d=Y;if(Xc=u||i,Y=d||l,dl(t,e),Y=d,Xc=u,ml(e),r&8192)a:for(t=e.stateNode,t._visibility=i?t._visibility&-2:t._visibility|1,i&&(n===null||l||Xc||Y||_l(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,i)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){Uu(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=i?``:l.memoizedProps}catch(e){Uu(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;i?$d(m,!0):$d(l.stateNode,!1)}catch(e){Uu(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,ul(e,n))));break;case 19:dl(t,e),ml(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ul(e,r)));break;case 30:break;case 21:break;default:dl(t,e),ml(e)}}function ml(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Gc(r)){n=r;break}r=r.return}if(n==null)throw Error(a(160));switch(n.tag){case 27:var i=n.stateNode;Jc(e,Kc(e),i);break;case 5:var o=n.stateNode;n.flags&32&&(Ht(o,``),n.flags&=-33),Jc(e,Kc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;qc(e,Kc(e),s);break;default:throw Error(a(161))}}catch(t){Uu(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function hl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;hl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function gl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)tl(e,t.alternate,t),t=t.sibling}function _l(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Rc(4,t,t.return),_l(t);break;case 1:Hc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Bc(t,t.return,n),_l(t);break;case 27:pf(t.stateNode);case 26:case 5:Hc(t,t.return),_l(t);break;case 22:t.memoizedState===null&&_l(t);break;case 30:_l(t);break;default:_l(t)}e=e.sibling}}function vl(e,t,n){for(n&&=!!(t.subtreeFlags&8772),t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:vl(i,a,n),Lc(4,a);break;case 1:if(vl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Uu(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)Ga(c[i],s)}catch(e){Uu(r,r.return,e)}}n&&o&64&&zc(a),Vc(a,a.return);break;case 27:Yc(a);case 26:case 5:vl(i,a,n),n&&r===null&&o&4&&Uc(a),Vc(a,a.return);break;case 12:vl(i,a,n);break;case 31:vl(i,a,n),n&&o&4&&sl(i,a);break;case 13:vl(i,a,n),n&&o&4&&cl(i,a);break;case 22:a.memoizedState===null&&vl(i,a,n),Vc(a,a.return);break;case 30:break;default:vl(i,a,n)}t=t.sibling}}function yl(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&ia(n))}function bl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ia(e))}function xl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Sl(e,t,n,r),t=t.sibling}function Sl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:xl(e,t,n,r),i&2048&&Lc(9,t);break;case 1:xl(e,t,n,r);break;case 3:xl(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ia(e)));break;case 12:if(i&2048){xl(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){Uu(t,t.return,e)}}else xl(e,t,n,r);break;case 31:xl(e,t,n,r);break;case 13:xl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?xl(e,t,n,r):(a._visibility|=2,Cl(e,t,n,r,!!(t.subtreeFlags&10256)||!1)):a._visibility&2?xl(e,t,n,r):wl(e,t),i&2048&&yl(o,t);break;case 24:xl(e,t,n,r),i&2048&&bl(t.alternate,t);break;default:xl(e,t,n,r)}}function Cl(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Cl(a,o,s,c,i),Lc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Cl(a,o,s,c,i)):u._visibility&2?Cl(a,o,s,c,i):wl(a,o),i&&l&2048&&yl(o.alternate,o);break;case 24:Cl(a,o,s,c,i),i&&l&2048&&bl(o.alternate,o);break;default:Cl(a,o,s,c,i)}t=t.sibling}}function wl(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:wl(n,r),i&2048&&yl(r.alternate,r);break;case 24:wl(n,r),i&2048&&bl(r.alternate,r);break;default:wl(n,r)}t=t.sibling}}var Tl=8192;function El(e,t,n){if(e.subtreeFlags&Tl)for(e=e.child;e!==null;)Dl(e,t,n),e=e.sibling}function Dl(e,t,n){switch(e.tag){case 26:El(e,t,n),e.flags&Tl&&e.memoizedState!==null&&Gf(n,fl,e.memoizedState,e.memoizedProps);break;case 5:El(e,t,n);break;case 3:case 4:var r=fl;fl=gf(e.stateNode.containerInfo),El(e,t,n),fl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Tl,Tl=16777216,El(e,t,n),Tl=r):El(e,t,n));break;default:El(e,t,n)}}function Ol(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function kl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];$c=r,Ml(r,e)}Ol(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Al(e),e=e.sibling}function Al(e){switch(e.tag){case 0:case 11:case 15:kl(e),e.flags&2048&&Rc(9,e,e.return);break;case 3:kl(e);break;case 12:kl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,jl(e)):kl(e);break;default:kl(e)}}function jl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];$c=r,Ml(r,e)}Ol(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Rc(8,t,t.return),jl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,jl(t));break;default:jl(t)}e=e.sibling}}function Ml(e,t){for(;$c!==null;){var n=$c;switch(n.tag){case 0:case 11:case 15:Rc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:ia(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,$c=r;else a:for(n=e;$c!==null;){r=$c;var i=r.sibling,a=r.return;if(nl(r),r===n){$c=null;break a}if(i!==null){i.return=a,$c=i;break a}$c=a}}}var Nl={getCacheForType:function(e){var t=Xi(na),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Xi(na).controller.signal}},Pl=typeof WeakMap==`function`?WeakMap:Map,Fl=0,Il=null,X=null,Z=0,Ll=0,Q=null,Rl=!1,zl=!1,Bl=!1,Vl=0,Hl=0,Ul=0,Wl=0,Gl=0,Kl=0,ql=0,Jl=null,Yl=null,Xl=!1,Zl=0,Ql=0,$l=1/0,eu=null,tu=null,nu=0,ru=null,iu=null,au=0,ou=0,su=null,cu=null,lu=0,uu=null;function du(){return Fl&2&&Z!==0?Z&-Z:P.T===null?et():ud()}function fu(){if(Kl===0)if(!(Z&536870912)||U){var e=ze;ze<<=1,!(ze&3932160)&&(ze=262144),Kl=e}else Kl=536870912;return e=Qa.current,e!==null&&(e.flags|=32),Kl}function pu(e,t,n){(e===Il&&(Ll===2||Ll===9)||e.cancelPendingCommit!==null)&&(bu(e,0),_u(e,Z,Kl,!1)),qe(e,n),(!(Fl&2)||e!==Il)&&(e===Il&&(!(Fl&2)&&(Wl|=n),Hl===4&&_u(e,Z,Kl,!1)),nd(e))}function mu(e,t,n){if(Fl&6)throw Error(a(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||Ue(e,t),i=r?Ou(e,t):Eu(e,t,!0),o=r;do{if(i===0){zl&&!r&&_u(e,t,0,!1);break}if(n=e.current.alternate,o&&!gu(n)){i=Eu(e,t,!1),o=!1;continue}if(i===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;i=Jl;var l=c.current.memoizedState.isDehydrated;if(l&&(bu(c,s).flags|=256),s=Eu(c,s,!1),s!==2){if(Bl&&!l){c.errorRecoveryDisabledLanes|=o,Wl|=o,i=4;break a}o=Yl,Yl=i,o!==null&&(Yl===null?Yl=o:Yl.push.apply(Yl,o))}i=s}if(o=!1,i!==2)continue}}if(i===1){bu(e,0),_u(e,t,0,!0);break}a:{switch(r=e,o=i,o){case 0:case 1:throw Error(a(345));case 4:if((t&4194048)!==t)break;case 6:_u(r,t,Kl,!Rl);break a;case 2:Yl=null;break;case 3:case 5:break;default:throw Error(a(329))}if((t&62914560)===t&&(i=Zl+300-Se(),10<i)){if(_u(r,t,Kl,!Rl),He(r,0,!0)!==0)break a;au=t,r.timeoutHandle=Kd(hu.bind(null,r,n,Yl,eu,Xl,t,Kl,Wl,ql,Rl,o,`Throttled`,-0,0),i);break a}hu(r,n,Yl,eu,Xl,t,Kl,Wl,ql,Rl,o,null,-0,0)}break}while(1);nd(e)}function hu(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Xt},Dl(t,a,d);var m=(a&62914560)===a?Zl-Se():(a&4194048)===a?Ql-Se():0;if(m=qf(d,m),m!==null){au=a,e.cancelPendingCommit=m(Fu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),_u(e,a,o,!l);return}}Fu(e,t,a,n,r,i,o,s,c)}function gu(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!yr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function _u(e,t,n,r){t&=~Gl,t&=~Wl,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Pe(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&Ye(e,n,t)}function vu(){return Fl&6?!0:(rd(0,!1),!1)}function yu(){if(X!==null){if(Ll===0)var e=X.return;else e=X,Hi=Vi=null,Eo(e),Da=null,Oa=0,e=X;for(;e!==null;)Ic(e.alternate,e),e=e.return;X=null}}function bu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,qd(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),au=0,yu(),Il=e,X=n=oi(e.current,null),Z=t,Ll=0,Q=null,Rl=!1,zl=Ue(e,t),Bl=!1,ql=Kl=Gl=Wl=Ul=Hl=0,Yl=Jl=null,Xl=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Pe(r),a=1<<i;t|=e[i],r&=~a}return Vl=t,Zr(),n}function xu(e,t){G=null,P.H=Fs,t===_a||t===ya?(t=Ta(),Ll=3):t===va?(t=Ta(),Ll=4):Ll=t===$s?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Q=t,X===null&&(Hl=1,qs(e,pi(t,e.current)))}function Su(){var e=Qa.current;return e===null?!0:(Z&4194048)===Z?$a===null:(Z&62914560)===Z||Z&536870912?e===$a:!1}function Cu(){var e=P.H;return P.H=Fs,e===null?Fs:e}function wu(){var e=P.A;return P.A=Nl,e}function Tu(){Hl=4,Rl||(Z&4194048)!==Z&&Qa.current!==null||(zl=!0),!(Ul&134217727)&&!(Wl&134217727)||Il===null||_u(Il,Z,Kl,!1)}function Eu(e,t,n){var r=Fl;Fl|=2;var i=Cu(),a=wu();(Il!==e||Z!==t)&&(eu=null,bu(e,t)),t=!1;var o=Hl;a:do try{if(Ll!==0&&X!==null){var s=X,c=Q;switch(Ll){case 8:yu(),o=6;break a;case 3:case 2:case 9:case 6:Qa.current===null&&(t=!0);var l=Ll;if(Ll=0,Q=null,Mu(e,s,c,l),n&&zl){o=0;break a}break;default:l=Ll,Ll=0,Q=null,Mu(e,s,c,l)}}Du(),o=Hl;break}catch(t){xu(e,t)}while(1);return t&&e.shellSuspendCounter++,Hi=Vi=null,Fl=r,P.H=i,P.A=a,X===null&&(Il=null,Z=0,Zr()),o}function Du(){for(;X!==null;)Au(X)}function Ou(e,t){var n=Fl;Fl|=2;var r=Cu(),i=wu();Il!==e||Z!==t?(eu=null,$l=Se()+500,bu(e,t)):zl=Ue(e,t);a:do try{if(Ll!==0&&X!==null){t=X;var o=Q;b:switch(Ll){case 1:Ll=0,Q=null,Mu(e,t,o,1);break;case 2:case 9:if(xa(o)){Ll=0,Q=null,ju(t);break}t=function(){Ll!==2&&Ll!==9||Il!==e||(Ll=7),nd(e)},o.then(t,t);break a;case 3:Ll=7;break a;case 4:Ll=5;break a;case 7:xa(o)?(Ll=0,Q=null,ju(t)):(Ll=0,Q=null,Mu(e,t,o,7));break;case 5:var s=null;switch(X.tag){case 26:s=X.memoizedState;case 5:case 27:var c=X;if(s?Wf(s):c.stateNode.complete){Ll=0,Q=null;var l=c.sibling;if(l!==null)X=l;else{var u=c.return;u===null?X=null:(X=u,Nu(u))}break b}}Ll=0,Q=null,Mu(e,t,o,5);break;case 6:Ll=0,Q=null,Mu(e,t,o,6);break;case 8:yu(),Hl=6;break a;default:throw Error(a(462))}}ku();break}catch(t){xu(e,t)}while(1);return Hi=Vi=null,P.H=r,P.A=i,Fl=n,X===null?(Il=null,Z=0,Zr(),Hl):0}function ku(){for(;X!==null&&!be();)Au(X)}function Au(e){var t=Dc(e.alternate,e,Vl);e.memoizedProps=e.pendingProps,t===null?Nu(e):X=t}function ju(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=dc(n,t,t.pendingProps,t.type,void 0,Z);break;case 11:t=dc(n,t,t.pendingProps,t.type.render,t.ref,Z);break;case 5:Eo(t);default:Ic(n,t),t=X=si(t,Vl),t=Dc(n,t,Vl)}e.memoizedProps=e.pendingProps,t===null?Nu(e):X=t}function Mu(e,t,n,r){Hi=Vi=null,Eo(t),Da=null,Oa=0;var i=t.return;try{if(Qs(e,i,t,n,Z)){Hl=1,qs(e,pi(n,e.current)),X=null;return}}catch(t){if(i!==null)throw X=i,t;Hl=1,qs(e,pi(n,e.current)),X=null;return}t.flags&32768?(U||r===1?e=!0:zl||Z&536870912?e=!1:(Rl=e=!0,(r===2||r===9||r===3||r===6)&&(r=Qa.current,r!==null&&r.tag===13&&(r.flags|=16384))),Pu(t,e)):Nu(t)}function Nu(e){var t=e;do{if(t.flags&32768){Pu(t,Rl);return}e=t.return;var n=Pc(t.alternate,t,Vl);if(n!==null){X=n;return}if(t=t.sibling,t!==null){X=t;return}X=t=e}while(t!==null);Hl===0&&(Hl=5)}function Pu(e,t){do{var n=Fc(e.alternate,e);if(n!==null){n.flags&=32767,X=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){X=e;return}X=e=n}while(e!==null);Hl=6,X=null}function Fu(e,t,n,r,i,o,s,c,l){e.cancelPendingCommit=null;do Bu();while(nu!==0);if(Fl&6)throw Error(a(327));if(t!==null){if(t===e.current)throw Error(a(177));if(o=t.lanes|t.childLanes,o|=Xr,Je(e,n,o,s,c,l),e===Il&&(X=Il=null,Z=0),iu=t,ru=e,au=n,ou=o,su=i,cu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,Yu(Ee,function(){return Vu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=P.T,P.T=null,i=F.p,F.p=2,s=Fl,Fl|=4;try{el(e,t,n)}finally{Fl=s,F.p=i,P.T=r}}nu=1,Iu(),Lu(),Ru()}}function Iu(){if(nu===1){nu=0;var e=ru,t=iu,n=!!(t.flags&13878);if(t.subtreeFlags&13878||n){n=P.T,P.T=null;var r=F.p;F.p=2;var i=Fl;Fl|=4;try{pl(t,e);var a=zd,o=wr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&Cr(s.ownerDocument.documentElement,s)){if(c!==null&&Tr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=Sr(s,h),v=Sr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}sp=!!Rd,zd=Rd=null}finally{Fl=i,F.p=r,P.T=n}}e.current=t,nu=2}}function Lu(){if(nu===2){nu=0;var e=ru,t=iu,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=P.T,P.T=null;var r=F.p;F.p=2;var i=Fl;Fl|=4;try{tl(e,t.alternate,t)}finally{Fl=i,F.p=r,P.T=n}}nu=3}}function Ru(){if(nu===4||nu===3){nu=0,xe();var e=ru,t=iu,n=au,r=cu;t.subtreeFlags&10256||t.flags&10256?nu=5:(nu=0,iu=ru=null,zu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(tu=null),$e(n),t=t.stateNode,Me&&typeof Me.onCommitFiberRoot==`function`)try{Me.onCommitFiberRoot(je,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=P.T,i=F.p,F.p=2,P.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{P.T=t,F.p=i}}au&3&&Bu(),nd(e),i=e.pendingLanes,n&261930&&i&42?e===uu?lu++:(lu=0,uu=e):lu=0,rd(0,!1)}}function zu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ia(t)))}function Bu(){return Iu(),Lu(),Ru(),Vu()}function Vu(){if(nu!==5)return!1;var e=ru,t=ou;ou=0;var n=$e(au),r=P.T,i=F.p;try{F.p=32>n?32:n,P.T=null,n=su,su=null;var o=ru,s=au;if(nu=0,iu=ru=null,au=0,Fl&6)throw Error(a(331));var c=Fl;if(Fl|=4,Al(o.current),Sl(o,o.current,s,n),Fl=c,rd(0,!1),Me&&typeof Me.onPostCommitFiberRoot==`function`)try{Me.onPostCommitFiberRoot(je,o)}catch{}return!0}finally{F.p=i,P.T=r,zu(e,t)}}function Hu(e,t,n){t=pi(n,t),t=Ys(e.stateNode,t,2),e=za(e,t,2),e!==null&&(qe(e,2),nd(e))}function Uu(e,t,n){if(e.tag===3)Hu(e,e,n);else for(;t!==null;){if(t.tag===3){Hu(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(tu===null||!tu.has(r))){e=pi(n,e),n=Xs(2),r=za(t,n,2),r!==null&&(Zs(n,r,t,e),qe(r,2),nd(r));break}}t=t.return}}function Wu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Pl;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Bl=!0,i.add(n),e=Gu.bind(null,e,t,n),t.then(e,e))}function Gu(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Il===e&&(Z&n)===n&&(Hl===4||Hl===3&&(Z&62914560)===Z&&300>Se()-Zl?!(Fl&2)&&bu(e,0):Gl|=n,ql===Z&&(ql=0)),nd(e)}function Ku(e,t){t===0&&(t=Ge()),e=ei(e,t),e!==null&&(qe(e,t),nd(e))}function qu(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Ku(e,n)}function Ju(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(a(314))}r!==null&&r.delete(t),Ku(e,n)}function Yu(e,t){return ve(e,t)}var Xu=null,Zu=null,Qu=!1,$u=!1,ed=!1,td=0;function nd(e){e!==Zu&&e.next===null&&(Zu===null?Xu=Zu=e:Zu=Zu.next=e),$u=!0,Qu||(Qu=!0,ld())}function rd(e,t){if(!ed&&$u){ed=!0;do for(var n=!1,r=Xu;r!==null;){if(!t)if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Pe(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,cd(r,a))}else a=Z,a=He(r,r===Il?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Ue(r,a)||(n=!0,cd(r,a));r=r.next}while(n);ed=!1}}function id(){ad()}function ad(){$u=Qu=!1;var e=0;td!==0&&Gd()&&(e=td);for(var t=Se(),n=null,r=Xu;r!==null;){var i=r.next,a=od(r,t);a===0?(r.next=null,n===null?Xu=i:n.next=i,i===null&&(Zu=n)):(n=r,(e!==0||a&3)&&($u=!0)),r=i}nu!==0&&nu!==5||rd(e,!1),td!==0&&(td=0)}function od(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Pe(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=We(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Il,n=Z,n=He(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Ll===2||Ll===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&ye(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Ue(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&ye(r),$e(n)){case 2:case 8:n=Te;break;case 32:n=Ee;break;case 268435456:n=Oe;break;default:n=Ee}return r=sd.bind(null,e),n=ve(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&ye(r),e.callbackPriority=2,e.callbackNode=null,2}function sd(e,t){if(nu!==0&&nu!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Bu()&&e.callbackNode!==n)return null;var r=Z;return r=He(e,e===Il?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(mu(e,r,t),od(e,Se()),e.callbackNode!=null&&e.callbackNode===n?sd.bind(null,e):null)}function cd(e,t){if(Bu())return null;mu(e,t,!0)}function ld(){Yd(function(){Fl&6?ve(we,id):ad()})}function ud(){if(td===0){var e=sa;e===0&&(e=Re,Re<<=1,!(Re&261888)&&(Re=256)),td=e}return td}function dd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:Yt(``+e)}function fd(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function pd(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=dd((i[it]||null).action),o=r.submitter;o&&(t=(t=o[it]||null)?dd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new vn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(td!==0){var e=o?fd(i,o):new FormData(i);xs(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?fd(i,o):new FormData(i),xs(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var md=0;md<Gr.length;md++){var hd=Gr[md];Kr(hd.toLowerCase(),`on`+(hd[0].toUpperCase()+hd.slice(1)))}Kr(Lr,`onAnimationEnd`),Kr(Rr,`onAnimationIteration`),Kr(zr,`onAnimationStart`),Kr(`dblclick`,`onDoubleClick`),Kr(`focusin`,`onFocus`),Kr(`focusout`,`onBlur`),Kr(Br,`onTransitionRun`),Kr(Vr,`onTransitionStart`),Kr(Hr,`onTransitionCancel`),Kr(Ur,`onTransitionEnd`),bt(`onMouseEnter`,[`mouseout`,`mouseover`]),bt(`onMouseLeave`,[`mouseout`,`mouseover`]),bt(`onPointerEnter`,[`pointerout`,`pointerover`]),bt(`onPointerLeave`,[`pointerout`,`pointerover`]),yt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),yt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),yt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),yt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),yt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),yt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var gd=`abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting`.split(` `),_d=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(gd));function vd(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){qr(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){qr(e)}i.currentTarget=null,a=c}}}}function $(e,t){var n=t[ot];n===void 0&&(n=t[ot]=new Set);var r=e+`__bubble`;n.has(r)||(Sd(t,e,2,!1),n.add(r))}function yd(e,t,n){var r=0;t&&(r|=4),Sd(n,e,r,t)}var bd=`_reactListening`+Math.random().toString(36).slice(2);function xd(e){if(!e[bd]){e[bd]=!0,_t.forEach(function(t){t!==`selectionchange`&&(_d.has(t)||yd(t,!1,e),yd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[bd]||(t[bd]=!0,yd(`selectionchange`,!1,t))}}function Sd(e,t,n,r){switch(mp(t)){case 2:var i=cp;break;case 8:i=lp;break;default:i=up}n=i.bind(null,t,n,e),i=void 0,!sn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Cd(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var s=r.stateNode.containerInfo;if(s===i)break;if(o===4)for(o=r.return;o!==null;){var l=o.tag;if((l===3||l===4)&&o.stateNode.containerInfo===i)return;o=o.return}for(;s!==null;){if(o=ft(s),o===null)return;if(l=o.tag,l===5||l===6||l===26||l===27){r=a=o;continue a}s=s.parentNode}}r=r.return}rn(function(){var r=a,i=Qt(n),o=[];a:{var s=Wr.get(e);if(s!==void 0){var l=vn,u=e;switch(e){case`keypress`:if(pn(n)===0)break a;case`keydown`:case`keyup`:l=In;break;case`focusin`:u=`focus`,l=Dn;break;case`focusout`:u=`blur`,l=Dn;break;case`beforeblur`:case`afterblur`:l=Dn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=Tn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=En;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Rn;break;case Lr:case Rr:case zr:l=On;break;case Ur:l=zn;break;case`scroll`:case`scrollend`:l=bn;break;case`wheel`:l=Bn;break;case`copy`:case`cut`:case`paste`:l=kn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Ln;break;case`toggle`:case`beforetoggle`:l=Vn}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?s===null?null:s+`Capture`:s;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=an(m,p),g!=null&&d.push(wd(m,g,h))),f)break;m=m.return}0<d.length&&(s=new l(s,u,null,n,i),o.push({event:s,listeners:d}))}}if(!(t&7)){a:{if(s=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,s&&n!==Zt&&(u=n.relatedTarget||n.fromElement)&&(ft(u)||u[at]))break a;if((l||s)&&(s=i.window===i?i:(s=i.ownerDocument)?s.defaultView||s.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?ft(u):null,u!==null&&(f=c(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=Tn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Ln,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?s:mt(l),h=u==null?s:mt(u),s=new d(g,m+`leave`,l,n,i),s.target=f,s.relatedTarget=h,g=null,ft(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=Ed,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&Dd(o,s,l,d,!1),u!==null&&f!==null&&Dd(o,f,u,d,!0)}}a:{if(s=r?mt(r):window,l=s.nodeName&&s.nodeName.toLowerCase(),l===`select`||l===`input`&&s.type===`file`)var v=sr;else if(tr(s))if(cr)v=_r;else{v=hr;var y=mr}else l=s.nodeName,!l||l.toLowerCase()!==`input`||s.type!==`checkbox`&&s.type!==`radio`?r&&Kt(r.elementType)&&(v=sr):v=gr;if(v&&=v(e,r)){nr(o,v,n,i);break a}y&&y(e,s,r),e===`focusout`&&r&&s.type===`number`&&r.memoizedProps.value!=null&&Rt(s,`number`,s.value)}switch(y=r?mt(r):window,e){case`focusin`:(tr(y)||y.contentEditable===`true`)&&(Dr=y,Or=r,kr=null);break;case`focusout`:kr=Or=Dr=null;break;case`mousedown`:Ar=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Ar=!1,jr(o,n,i);break;case`selectionchange`:if(Er)break;case`keydown`:case`keyup`:jr(o,n,i)}var b;if(Un)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else Zn?Yn(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Kn&&n.locale!==`ko`&&(Zn||x!==`onCompositionStart`?x===`onCompositionEnd`&&Zn&&(b=fn()):(ln=i,un=`value`in ln?ln.value:ln.textContent,Zn=!0)),y=Td(r,x),0<y.length&&(x=new An(x,e,null,n,i),o.push({event:x,listeners:y}),b?x.data=b:(b=Xn(n),b!==null&&(x.data=b)))),(b=Gn?Qn(e,n):$n(e,n))&&(x=Td(r,`onBeforeInput`),0<x.length&&(y=new An(`onBeforeInput`,`beforeinput`,null,n,i),o.push({event:y,listeners:x}),y.data=b)),pd(o,e,r,n,i)}vd(o,t)})}function wd(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Td(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=an(e,n),i!=null&&r.unshift(wd(e,i,a)),i=an(e,t),i!=null&&r.push(wd(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Ed(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Dd(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=an(n,a),l!=null&&o.unshift(wd(n,l,c))):i||(l=an(n,a),l!=null&&o.push(wd(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Od=/\r\n?/g,kd=/\u0000|\uFFFD/g;function Ad(e){return(typeof e==`string`?e:``+e).replace(Od,`
|
|
98
|
+
`).replace(kd,``)}function jd(e,t){return t=Ad(t),Ad(e)===t}function Md(e,t,n,r,i,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Ht(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Ht(e,``+r);break;case`className`:Et(e,`class`,r);break;case`tabIndex`:Et(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Et(e,n,r);break;case`style`:Gt(e,r,o);break;case`data`:if(t!==`object`){Et(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Yt(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&Md(e,t,`name`,i.name,i,null),Md(e,t,`formEncType`,i.formEncType,i,null),Md(e,t,`formMethod`,i.formMethod,i,null),Md(e,t,`formTarget`,i.formTarget,i,null)):(Md(e,t,`encType`,i.encType,i,null),Md(e,t,`method`,i.method,i,null),Md(e,t,`target`,i.target,i,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Yt(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=Xt);break;case`onScroll`:r!=null&&$(`scroll`,e);break;case`onScrollEnd`:r!=null&&$(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(a(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(a(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=Yt(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:$(`beforetoggle`,e),$(`toggle`,e),Tt(e,`popover`,r);break;case`xlinkActuate`:Dt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Dt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Dt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Dt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Dt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Dt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Dt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Dt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Dt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Tt(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=qt.get(n)||n,Tt(e,n,r))}}function Nd(e,t,n,r,i,o){switch(n){case`style`:Gt(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(a(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(a(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?Ht(e,r):(typeof r==`number`||typeof r==`bigint`)&&Ht(e,``+r);break;case`onScroll`:r!=null&&$(`scroll`,e);break;case`onScrollEnd`:r!=null&&$(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=Xt);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!vt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(i=n.endsWith(`Capture`),t=n.slice(2,i?n.length-7:void 0),o=e[it]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,i),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,i);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):Tt(e,n,r)}}}function Pd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:$(`error`,e),$(`load`,e);var r=!1,i=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:i=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(a(137,t));default:Md(e,t,o,s,n,null)}}i&&Md(e,t,`srcSet`,n.srcSet,n,null),r&&Md(e,t,`src`,n.src,n,null);return;case`input`:$(`invalid`,e);var c=o=s=i=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:i=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(a(137,t));break;default:Md(e,t,r,d,n,null)}}Lt(e,o,c,l,u,s,i,!1);return;case`select`:for(i in $(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(i)&&(c=n[i],c!=null))switch(i){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:Md(e,t,i,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&zt(e,!!r,n,!0):zt(e,!!r,t,!1);return;case`textarea`:for(s in $(`invalid`,e),o=i=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:i=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(a(91));break;default:Md(e,t,s,c,n,null)}Vt(e,r,i,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:Md(e,t,l,r,n,null)}return;case`dialog`:$(`beforetoggle`,e),$(`toggle`,e),$(`cancel`,e),$(`close`,e);break;case`iframe`:case`object`:$(`load`,e);break;case`video`:case`audio`:for(r=0;r<gd.length;r++)$(gd[r],e);break;case`image`:$(`error`,e),$(`load`,e);break;case`details`:$(`toggle`,e);break;case`embed`:case`source`:case`link`:$(`error`,e),$(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(a(137,t));default:Md(e,t,u,r,n,null)}return;default:if(Kt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Nd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Md(e,t,c,r,n,null))}function Fd(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var i=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||Md(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:i=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(a(137,t));break;default:m!==f&&Md(e,t,p,m,r,f)}}It(e,s,c,l,u,d,o,i);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||Md(e,t,o,null,r,l)}for(i in r)if(o=r[i],l=n[i],r.hasOwnProperty(i)&&(o!=null||l!=null))switch(i){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Md(e,t,i,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?zt(e,!!n,n?[]:``,!1):zt(e,!!n,t,!0)):zt(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(i=n[c],n.hasOwnProperty(c)&&i!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:Md(e,t,c,null,r,i)}for(s in r)if(i=r[s],o=n[s],r.hasOwnProperty(s)&&(i!=null||o!=null))switch(s){case`value`:p=i;break;case`defaultValue`:m=i;break;case`children`:break;case`dangerouslySetInnerHTML`:if(i!=null)throw Error(a(91));break;default:i!==o&&Md(e,t,s,i,r,o)}Bt(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:Md(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Md(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&Md(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(a(137,t));break;default:Md(e,t,u,p,r,m)}return;default:if(Kt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Nd(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||Nd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Md(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||Md(e,t,f,p,r,m)}function Id(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Ld(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Id(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Id(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var Rd=null,zd=null;function Bd(e){return e.nodeType===9?e:e.ownerDocument}function Vd(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function Hd(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function Ud(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Wd=null;function Gd(){var e=window.event;return e&&e.type===`popstate`?e!==Wd&&(Wd=e,!0):(Wd=null,!1)}var Kd=typeof setTimeout==`function`?setTimeout:void 0,qd=typeof clearTimeout==`function`?clearTimeout:void 0,Jd=typeof Promise==`function`?Promise:void 0,Yd=typeof queueMicrotask==`function`?queueMicrotask:Jd===void 0?Kd:function(e){return Jd.resolve(null).then(e).catch(Xd)};function Xd(e){setTimeout(function(){throw e})}function Zd(e){return e===`head`}function Qd(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Np(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)pf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,pf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[ut]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&pf(e.ownerDocument.body);n=i}while(n);Np(t)}function $d(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8)if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++;n=r}while(n)}function ef(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:ef(n),dt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function tf(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r)if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e;else if(!e[ut])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=cf(e.nextSibling),e===null)break}return null}function nf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=cf(e.nextSibling),e===null))return null;return e}function rf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=cf(e.nextSibling),e===null))return null;return e}function af(e){return e.data===`$?`||e.data===`$~`}function of(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function sf(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function cf(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var lf=null;function uf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return cf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function df(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function ff(e,t,n){switch(t=Bd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(a(452));return e;case`head`:if(e=t.head,!e)throw Error(a(453));return e;case`body`:if(e=t.body,!e)throw Error(a(454));return e;default:throw Error(a(451))}}function pf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);dt(e)}var mf=new Map,hf=new Set;function gf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var _f=F.d;F.d={f:vf,r:yf,D:Sf,C:Cf,L:wf,m:Tf,X:Df,S:Ef,M:Of};function vf(){var e=_f.f(),t=vu();return e||t}function yf(e){var t=pt(e);t!==null&&t.tag===5&&t.type===`form`?Cs(t):_f.r(e)}var bf=typeof document>`u`?null:document;function xf(e,t,n){var r=bf;if(r&&typeof t==`string`&&t){var i=Ft(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),hf.has(i)||(hf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Pd(t,`link`,e),gt(t),r.head.appendChild(t)))}}function Sf(e){_f.D(e),xf(`dns-prefetch`,e,null)}function Cf(e,t){_f.C(e,t),xf(`preconnect`,e,t)}function wf(e,t,n){_f.L(e,t,n);var r=bf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Ft(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Ft(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Ft(n.imageSizes)+`"]`)):i+=`[href="`+Ft(e)+`"]`;var a=i;switch(t){case`style`:a=Af(e);break;case`script`:a=Pf(e)}mf.has(a)||(e=m({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),mf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(jf(a))||t===`script`&&r.querySelector(Ff(a))||(t=r.createElement(`link`),Pd(t,`link`,e),gt(t),r.head.appendChild(t)))}}function Tf(e,t){_f.m(e,t);var n=bf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Ft(r)+`"][href="`+Ft(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Pf(e)}if(!mf.has(a)&&(e=m({rel:`modulepreload`,href:e},t),mf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Ff(a)))return}r=n.createElement(`link`),Pd(r,`link`,e),gt(r),n.head.appendChild(r)}}}function Ef(e,t,n){_f.S(e,t,n);var r=bf;if(r&&e){var i=ht(r).hoistableStyles,a=Af(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(jf(a)))s.loading=5;else{e=m({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=mf.get(a))&&Rf(e,n);var c=o=r.createElement(`link`);gt(c),Pd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Lf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Df(e,t){_f.X(e,t);var n=bf;if(n&&e){var r=ht(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=m({src:e,async:!0},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),gt(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Of(e,t){_f.M(e,t);var n=bf;if(n&&e){var r=ht(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=m({src:e,async:!0,type:`module`},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),gt(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function kf(e,t,n,r){var i=(i=oe.current)?gf(i):null;if(!i)throw Error(a(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Af(n.href),n=ht(i).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Af(n.href);var o=ht(i).hoistableStyles,s=o.get(e);if(s||(i=i.ownerDocument||i,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=i.querySelector(jf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),mf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},mf.set(e,n),o||Nf(i,e,n,s.state))),t&&r===null)throw Error(a(528,``));return s}if(t&&r!==null)throw Error(a(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Pf(n),n=ht(i).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(a(444,e))}}function Af(e){return`href="`+Ft(e)+`"`}function jf(e){return`link[rel="stylesheet"][`+e+`]`}function Mf(e){return m({},e,{"data-precedence":e.precedence,precedence:null})}function Nf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Pd(t,`link`,n),gt(t),e.head.appendChild(t))}function Pf(e){return`[src="`+Ft(e)+`"]`}function Ff(e){return`script[async]`+e}function If(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Ft(n.href)+`"]`);if(r)return t.instance=r,gt(r),r;var i=m({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),gt(r),Pd(r,`style`,i),Lf(r,n.precedence,e),t.instance=r;case`stylesheet`:i=Af(n.href);var o=e.querySelector(jf(i));if(o)return t.state.loading|=4,t.instance=o,gt(o),o;r=Mf(n),(i=mf.get(i))&&Rf(r,i),o=(e.ownerDocument||e).createElement(`link`),gt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Pd(o,`link`,r),t.state.loading|=4,Lf(o,n.precedence,e),t.instance=o;case`script`:return o=Pf(n.src),(i=e.querySelector(Ff(o)))?(t.instance=i,gt(i),i):(r=n,(i=mf.get(o))&&(r=m({},n),zf(r,i)),e=e.ownerDocument||e,i=e.createElement(`script`),gt(i),Pd(i,`link`,r),e.head.appendChild(i),t.instance=i);case`void`:return null;default:throw Error(a(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Lf(r,n.precedence,e));return t.instance}function Lf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Rf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function zf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Bf=null;function Vf(e,t,n){if(Bf===null){var r=new Map,i=Bf=new Map;i.set(n,r)}else i=Bf,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[ut]||a[rt]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Hf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Uf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Wf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Gf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Af(r.href),a=t.querySelector(jf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Jf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,gt(a);return}a=t.ownerDocument||t,r=Mf(r),(i=mf.get(i))&&Rf(r,i),a=a.createElement(`link`),gt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Pd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=Jf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Kf=0;function qf(e,t){return e.stylesheets&&e.count===0&&Xf(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&Xf(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Kf===0&&(Kf=62500*Ld());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Xf(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Kf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Jf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Xf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Yf=null;function Xf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Yf=new Map,t.forEach(Zf,e),Yf=null,Jf.call(e))}function Zf(e,t){if(!(t.state.loading&4)){var n=Yf.get(e);if(n)var r=n.get(null);else{n=new Map,Yf.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=Jf.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var Qf={$$typeof:S,Provider:null,Consumer:null,_currentValue:I,_currentValue2:I,_threadCount:0};function $f(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ke(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ke(0),this.hiddenUpdates=Ke(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function ep(e,t,n,r,i,a,o,s,c,l,u,d){return e=new $f(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=ii(3,null,null,t),e.current=a,a.stateNode=e,t=ra(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Ia(a),e}function tp(e){return e?(e=V,e):V}function np(e,t,n,r,i,a){i=tp(i),r.context===null?r.context=i:r.pendingContext=i,r=Ra(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=za(e,r,t),n!==null&&(pu(n,e,t),Ba(n,e,t))}function rp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ip(e,t){rp(e,t),(e=e.alternate)&&rp(e,t)}function ap(e){if(e.tag===13||e.tag===31){var t=ei(e,67108864);t!==null&&pu(t,e,67108864),ip(e,67108864)}}function op(e){if(e.tag===13||e.tag===31){var t=du();t=Qe(t);var n=ei(e,t);n!==null&&pu(n,e,t),ip(e,t)}}var sp=!0;function cp(e,t,n,r){var i=P.T;P.T=null;var a=F.p;try{F.p=2,up(e,t,n,r)}finally{F.p=a,P.T=i}}function lp(e,t,n,r){var i=P.T;P.T=null;var a=F.p;try{F.p=8,up(e,t,n,r)}finally{F.p=a,P.T=i}}function up(e,t,n,r){if(sp){var i=dp(r);if(i===null)Cd(e,t,r,fp,n),Cp(e,r);else if(Tp(i,e,t,n,r))r.stopPropagation();else if(Cp(e,r),t&4&&-1<Sp.indexOf(e)){for(;i!==null;){var a=pt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Ve(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Pe(o);s.entanglements[1]|=c,o&=~c}nd(a),!(Fl&6)&&($l=Se()+500,rd(0,!1))}}break;case 31:case 13:s=ei(a,2),s!==null&&pu(s,a,2),vu(),ip(a,2)}if(a=dp(r),a===null&&Cd(e,t,r,fp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Cd(e,t,r,null,n)}}function dp(e){return e=Qt(e),pp(e)}var fp=null;function pp(e){if(fp=null,e=ft(e),e!==null){var t=c(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=l(t),e!==null)return e;e=null}else if(n===31){if(e=u(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return fp=e,null}function mp(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`resize`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Ce()){case we:return 2;case Te:return 8;case Ee:case De:return 32;case Oe:return 268435456;default:return 32}default:return 32}}var hp=!1,gp=null,_p=null,vp=null,yp=new Map,bp=new Map,xp=[],Sp=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function Cp(e,t){switch(e){case`focusin`:case`focusout`:gp=null;break;case`dragenter`:case`dragleave`:_p=null;break;case`mouseover`:case`mouseout`:vp=null;break;case`pointerover`:case`pointerout`:yp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:bp.delete(t.pointerId)}}function wp(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=pt(t),t!==null&&ap(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Tp(e,t,n,r,i){switch(t){case`focusin`:return gp=wp(gp,e,t,n,r,i),!0;case`dragenter`:return _p=wp(_p,e,t,n,r,i),!0;case`mouseover`:return vp=wp(vp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return yp.set(a,wp(yp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,bp.set(a,wp(bp.get(a)||null,e,t,n,r,i)),!0}return!1}function Ep(e){var t=ft(e.target);if(t!==null){var n=c(t);if(n!==null){if(t=n.tag,t===13){if(t=l(n),t!==null){e.blockedOn=t,tt(e.priority,function(){op(n)});return}}else if(t===31){if(t=u(n),t!==null){e.blockedOn=t,tt(e.priority,function(){op(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Dp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=dp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Zt=r,n.target.dispatchEvent(r),Zt=null}else return t=pt(n),t!==null&&ap(t),e.blockedOn=n,!1;t.shift()}return!0}function Op(e,t,n){Dp(e)&&n.delete(t)}function kp(){hp=!1,gp!==null&&Dp(gp)&&(gp=null),_p!==null&&Dp(_p)&&(_p=null),vp!==null&&Dp(vp)&&(vp=null),yp.forEach(Op),bp.forEach(Op)}function Ap(e,n){e.blockedOn===n&&(e.blockedOn=null,hp||(hp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,kp)))}var jp=null;function Mp(e){jp!==e&&(jp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){jp===e&&(jp=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(pp(r||n)===null)continue;break}var a=pt(n);a!==null&&(e.splice(t,3),t-=3,xs(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Np(e){function t(t){return Ap(t,e)}gp!==null&&Ap(gp,e),_p!==null&&Ap(_p,e),vp!==null&&Ap(vp,e),yp.forEach(t),bp.forEach(t);for(var n=0;n<xp.length;n++){var r=xp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<xp.length&&(n=xp[0],n.blockedOn===null);)Ep(n),n.blockedOn===null&&xp.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[it]||null;if(typeof a==`function`)o||Mp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[it]||null)s=o.formAction;else if(pp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Mp(n)}}}function Pp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Fp(e){this._internalRoot=e}Ip.prototype.render=Fp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(a(409));var n=t.current;np(n,du(),e,t,null,null)},Ip.prototype.unmount=Fp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;np(e.current,2,null,e,null,null),vu(),t[at]=null}};function Ip(e){this._internalRoot=e}Ip.prototype.unstable_scheduleHydration=function(e){if(e){var t=et();e={blockedOn:null,target:e,priority:t};for(var n=0;n<xp.length&&t!==0&&t<xp[n].priority;n++);xp.splice(n,0,e),n===0&&Ep(e)}};var Lp=n.version;if(Lp!==`19.2.8`)throw Error(a(527,Lp,`19.2.8`));F.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(a(188)):(e=Object.keys(e).join(`,`),Error(a(268,e)));return e=f(t),e=e===null?null:p(e),e=e===null?null:e.stateNode,e};var Rp={bundleType:0,version:`19.2.8`,rendererPackageName:`react-dom`,currentDispatcherRef:P,reconcilerVersion:`19.2.8`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var zp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!zp.isDisabled&&zp.supportsFiber)try{je=zp.inject(Rp),Me=zp}catch{}}e.createRoot=function(e,t){if(!s(e))throw Error(a(299));var n=!1,r=``,i=Ws,o=Gs,c=Ks;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(o=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=ep(e,1,!1,null,null,n,r,null,i,o,c,Pp),e[at]=t.current,xd(e),new Fp(t)},e.hydrateRoot=function(e,t,n){if(!s(e))throw Error(a(299));var r=!1,i=``,o=Ws,c=Gs,l=Ks,u=null;return n!=null&&(!0===n.unstable_strictMode&&(r=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onUncaughtError!==void 0&&(o=n.onUncaughtError),n.onCaughtError!==void 0&&(c=n.onCaughtError),n.onRecoverableError!==void 0&&(l=n.onRecoverableError),n.formState!==void 0&&(u=n.formState)),t=ep(e,1,!0,t,n??null,r,i,u,o,c,l,Pp),t.context=tp(null),n=t.current,r=du(),r=Qe(r),i=Ra(r),i.callback=null,za(n,i,r),n=r,t.current.lanes=n,qe(t,n),nd(t),e[at]=t.current,xd(e),new Ip(t)}})),co=n(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=G()})),lo=t(o(),1),uo=co(),fo=(0,z.createContext)(null);fo.displayName=`InertiaHeadContext`;var po=fo,mo=fa();function ho(){mo.reset()}var go=(0,z.createContext)(null);go.displayName=`InertiaPageContext`;var _o=go;function vo(e){return typeof e==`function`||typeof e==`object`&&!!e&&`$$typeof`in e}function yo(e){if(typeof e!=`function`)return!1;let t=e;return t.length===1&&t.prototype===void 0}function bo(e){return typeof e==`function`&&e.length<=1&&e.prototype===void 0}var xo=!0,So=!1,Co=async()=>{xo=!1},wo={shared:{},named:{}};function To({children:e,initialPage:t,initialComponent:n,resolveComponent:r,titleCallback:i,onHeadUpdate:a,defaultLayout:o,serverHead:s}){let[c,l]=(0,z.useState)({component:n||null,page:{...t,flash:t.flash??{}},key:null}),u=(0,z.useRef)(c.page);u.current=c.page;let d=(0,z.useMemo)(()=>Zi(typeof window>`u`,e=>i?i(e,u.current):e,a||(()=>{}),Yi(t,s)),[]),f=(0,z.useSyncExternalStore)(mo.subscribe,mo.get,()=>wo);if(So||=(W.init({initialPage:t,resolveComponent:r,swapComponent:async e=>Co(e),onFlash:e=>{l(t=>({...t,page:{...t.page,flash:e}}))}}),!0),(0,z.useEffect)(()=>{Co=async({component:e,page:t,preserveState:n})=>{if(xo){xo=!1;return}n||ho(),(0,lo.flushSync)(()=>l(r=>({component:e,page:t,key:n?r.key:Date.now()})))};let e=e=>{d.updateServerHead(Yi(e.detail.page,s))},t=W.on(`navigate`,e),n=W.on(`clientVisit`,e);return()=>{t(),n()}},[]),!c.component)return(0,z.createElement)(po.Provider,{value:d},(0,z.createElement)(_o.Provider,{value:c.page},null));let p=e||(({Component:e,props:t,key:n})=>{let r=(0,z.createElement)(e,{key:n,...t}),i,a=null,s=e.layout;if(bo(s)){let e=s(t);if((0,z.isValidElement)(e))return s(r);va(e,vo)?(i=o?.(c.page.component,c.page),a=e):i=e}else _a(s,vo)?(i=o?.(c.page.component,c.page),a=s):i=s??o?.(c.page.component,c.page);let l=xa(i,vo,s&&!a?yo:void 0);return a&&(l=l.map(e=>({...e,props:{...e.props,...a}}))),l.length>0?l.reduceRight((e,n)=>(0,z.createElement)(n.component,{...t,...n.props,...f.shared,...n.name&&f.named[n.name]||{}},e),r):r});return(0,z.createElement)(po.Provider,{value:d},(0,z.createElement)(_o.Provider,{value:c.page},p({Component:c.component,key:c.key,props:c.page.props})))}To.displayName=`Inertia`;async function Eo({id:e=`app`,resolve:t,setup:n,title:r,progress:i={},page:a,render:o,defaults:s={},nonce:c,http:l,layout:u,serverHead:d,strictMode:f=!1,withApp:p,dev:m=!1}={}){Uo.replace(s),c&&Uo.set(`nonce`,c),l&&Oi.setClient(l),m&&U();let h=typeof window>`u`,g=e=>f?(0,z.createElement)(z.StrictMode,null,e):e,_=(e,n)=>Promise.resolve(t(e,n)).then(e=>e.default||e);if(h&&!a&&!o)return async(t,i)=>{let a=[],o={initialPage:t,initialComponent:await _(t.component,t),resolveComponent:_,titleCallback:r,onHeadUpdate:e=>a=e,defaultLayout:u,serverHead:d},s;n?s=n({el:null,App:To,props:o}):(s=g((0,z.createElement)(To,o)),p&&(s=p(s,{ssr:!0,page:t})));let c=ao(e,t,i(s));return{head:a,body:c}};let v=a||Or(e),y=[],b=await Promise.all([_(v.component,v),W.decryptHistory().catch(()=>{})]).then(([t])=>{let i={initialPage:v,initialComponent:t,resolveComponent:_,titleCallback:r,onHeadUpdate:h?e=>y=e:void 0,defaultLayout:u,serverHead:d};if(h)return n({el:null,App:To,props:i});let a=document.getElementById(e);if(n)return n({el:a,App:To,props:i});let o=g((0,z.createElement)(To,i));p&&(o=p(o,{ssr:!1,page:v})),a.hasAttribute(`data-server-rendered`)?(0,uo.hydrateRoot)(a,o):(0,uo.createRoot)(a).render(o)});if(!h&&i&&Za(i),h&&o&&b){let t=ao(e,v,o(b));return{head:y,body:t}}}function Do(){let e=(0,z.use)(_o);if(!e)throw Error(`usePage must be used within the Inertia component`);return e}function Oo(e){let{data:t,useDataState:n,useErrorsState:r}=e,i=typeof t==`function`,a=()=>i?t():t,o=mt(a()),s=(0,z.useRef)(!1),c=(0,z.useRef)(e.precognitionEndpoint??null),[l,u]=(0,z.useState)(mt(o)),[d,f]=n?n():(0,z.useState)(mt(o)),[p,m]=r?r():(0,z.useState)({}),[h,g]=(0,z.useState)(!1),[_,v]=(0,z.useState)(null),[y,b]=(0,z.useState)(!1),[x,S]=(0,z.useState)(!1),C=(0,z.useRef)(void 0),w=(0,z.useRef)(e=>e),T=(0,z.useRef)(!1),E=(0,z.useRef)(null),[D,O]=(0,z.useState)(!1),[k,ee]=(0,z.useState)([]),[A,j]=(0,z.useState)([]),M=(0,z.useRef)(null),N=()=>M.current??Uo.get(`form.withAllErrors`),P=(0,z.useRef)(d);(0,z.useEffect)(()=>{P.current=d}),(0,z.useEffect)(()=>(s.current=!0,()=>{s.current=!1}),[]);let F=(0,z.useCallback)(e=>{P.current=e,f(e)},[f]),I=(0,z.useCallback)((e,t)=>{F(typeof e==`string`?Xt(mt(P.current),e,t):typeof e==`function`?e(P.current):e)},[F]),te=(0,z.useCallback)((e,t)=>{if(i)throw Error("You cannot call `defaults()` when using a function to define your form data.");T.current=!0;let n={};e===void 0?(n={...P.current},u(P.current)):u(r=>(n=typeof e==`string`?Xt(mt(r),e,t):Object.assign(mt(r),e),n)),E.current?.defaults(n)},[u]),ne=(0,z.useCallback)((...e)=>{let t=mt(i?mt(a()):l);if(e.length===0)i&&u(t),F(t);else{i&&u(n=>{let r=mt(n);return e.filter(e=>Bt(t,e)).forEach(e=>{Xt(r,e,Mt(t,e))}),r});let n=e.filter(e=>Bt(t,e)).reduce((e,n)=>Xt(e,n,Mt(t,n)),{...P.current});F(n)}E.current?.reset(...e)},[F,l]),re=(0,z.useCallback)((e,t)=>{m(n=>{let r={...n,...typeof e==`string`?{[e]:t}:e};return E.current?.setErrors(r),r})},[m]),L=(0,z.useCallback)((...e)=>{m(t=>{let n=Object.keys(t).reduce((n,r)=>({...n,...e.length>0&&!e.includes(r)?{[r]:t[r]}:{}}),{});return E.current&&(e.length===0?E.current.setErrors({}):e.forEach(E.current.forgetError)),n})},[m]),R=(0,z.useCallback)((...e)=>{ne(...e),L(...e)},[ne,L]),ie=(0,z.useCallback)(()=>{L(),b(!0),S(!0),C.current=window.setTimeout(()=>{s.current&&S(!1)},Uo.get(`form.recentlySuccessfulDuration`))},[L,b,S]),ae=(0,z.useCallback)(()=>{b(!1),S(!1),clearTimeout(C.current)},[b,S]),oe=(0,z.useCallback)(()=>{g(!1),v(null)},[g,v]),se=(0,z.useCallback)(e=>{w.current=e},[]),ce=(e,t)=>(t(e),e),le=(0,z.useCallback)(e=>A.includes(e),[A]),ue=(0,z.useCallback)(e=>e in p,[p]),de=(0,z.useCallback)(e=>typeof e==`string`?k.includes(e):k.length>0,[k]),fe={data:d,isDirty:!St(d,l),errors:p,hasErrors:Object.keys(p).length>0,processing:h,progress:_,wasSuccessful:y,recentlySuccessful:x,setData:I,transform:se,setDefaults:te,reset:ne,setError:re,clearErrors:L,resetAndClearErrors:R},pe=(e,t)=>{if(typeof e==`object`&&!(`target`in e)&&(t=e,e=void 0),e===void 0)E.current.validate(t);else{let n=Vn(e),r=w.current(P.current);E.current.validate(n,Mt(r,n),t)}return fe};return fe.withPrecognition=(...e)=>{if(c.current=Bi.createWayfinderCallback(...e),!E.current){let e=Rn(e=>{let{method:t,url:n}=c.current(),r=P.current,i=w.current(r);return e[t](n,i)},mt(l));E.current=e,e.on(`validatingChanged`,()=>{O(e.validating())}).on(`validatedChanged`,()=>{j(e.valid())}).on(`touchedChanged`,()=>{ee(e.touched())}).on(`errorsChanged`,()=>{let t=N()?e.errors():zn(e.errors());m(t),j(e.valid())})}let t=Object.assign(fe,{validating:D,validator:()=>E.current,valid:le,invalid:ue,touched:de,withoutFileValidation:()=>ce(t,()=>E.current?.withoutFileValidation()),touch:(e,...n)=>(Array.isArray(e)?E.current?.touch(e):typeof e==`string`?E.current?.touch([e,...n]):E.current?.touch(e),t),withAllErrors:()=>ce(t,()=>M.current=!0),setValidationTimeout:e=>ce(t,()=>E.current?.setTimeout(e)),validateFiles:()=>ce(t,()=>E.current?.validateFiles()),validate:pe,setErrors:e=>ce(t,()=>fe.setError(e)),forgetError:e=>ce(t,()=>fe.clearErrors(Vn(e)))});return t},c.current&&fe.withPrecognition(c.current),{form:fe,setDefaultsState:u,transformRef:w,precognitionEndpointRef:c,dataRef:P,isMounted:s,setProcessing:g,setProgress:v,markAsSuccessful:ie,clearErrors:L,setError:re,defaultsCalledInOnSuccessRef:T,resetBeforeSubmit:ae,finishProcessing:oe,withAllErrors:{enabled:N,enable:()=>{M.current=!0}}}}function ko(e,t,n){let[r,i]=(0,z.useState)(()=>{let n=W.restore(t);return n===void 0?e:n});return(0,z.useEffect)(()=>{let e=n?.current;if(e&&e.length>0&&typeof r==`object`&&r){let n={...r};e.forEach(e=>delete n[e]),W.remember(n,t)}else W.remember(r,t)},[r,t]),[r,i]}function Ao(...e){let{rememberKey:t,data:n,precognitionEndpoint:r}=Bi.parseUseFormArguments(...e),i=mt(typeof n==`function`?n():n),a=(0,z.useRef)(null),o=(0,z.useRef)([]),s=(0,z.useRef)(null),{form:c,setDefaultsState:l,transformRef:u,precognitionEndpointRef:d,dataRef:f,isMounted:p,setProcessing:m,setProgress:h,markAsSuccessful:g,clearErrors:_,setError:v,defaultsCalledInOnSuccessRef:y,resetBeforeSubmit:b,finishProcessing:x}=Oo({data:n,precognitionEndpoint:r,useDataState:t?()=>ko(i,`${t}:data`,o):void 0,useErrorsState:t?()=>ko({},`${t}:errors`):void 0}),S=(0,z.useCallback)((...e)=>{let{method:t,url:n,options:r}=Bi.parseSubmitArguments(e,d.current);y.current=!1;let i={...r,onCancelToken:e=>(a.current=e,r.onCancelToken?.(e)),onBefore:e=>(b(),r.onBefore?.(e)),onStart:e=>(m(!0),r.onStart?.(e)),onProgress:e=>(h(e||null),r.onProgress?.(e)),onSuccess:async e=>{p.current&&g();let t=r.onSuccess?await r.onSuccess(e):null;return p.current&&!y.current&&c.setData(e=>(l(mt(e)),e)),t},onError:e=>(p.current&&(_(),v(e)),r.onError?.(e)),onCancel:()=>r.onCancel?.(),onFinish:e=>(p.current&&x(),a.current=null,r.onFinish?.(e))};i.optimistic=i.optimistic??s.current??void 0,s.current=null;let o=u.current(f.current);t===`delete`?W.delete(n,{...i,data:o}):W[t](n,o,i)},[_,v,u]),C=(0,z.useCallback)(()=>{a.current&&a.current.cancel()},[]),w=(0,z.useMemo)(()=>({get:(e,t={})=>S(`get`,e,t),post:(e,t={})=>S(`post`,e,t),put:(e,t={})=>S(`put`,e,t),patch:(e,t={})=>S(`patch`,e,t),delete:(e,t={})=>S(`delete`,e,t)}),[S]);Object.assign(c,{submit:S,...w,cancel:C,dontRemember:(...e)=>(o.current=e,T),optimistic:e=>(s.current=e,T)});let T=c,E=c.withPrecognition;return T.withPrecognition=(...e)=>(E(...e),T),d.current,T}var jo=e=>{typeof z.startTransition==`function`?z.startTransition(e):setTimeout(e,0)},Mo=()=>void 0,No=(0,z.createContext)(void 0),Po=(0,z.forwardRef)(({action:e=``,method:t=`get`,headers:n={},queryStringArrayFormat:r=`brackets`,errorBag:i=null,showProgress:a=!0,transform:o=e=>e,optimistic:s,options:c={},onStart:l=Mo,onProgress:u=Mo,onFinish:d=Mo,onBefore:f=Mo,onCancel:p=Mo,onSuccess:m=Mo,onError:h=Mo,onCancelToken:g=Mo,onSubmitComplete:_=Mo,disableWhileProcessing:v=!1,resetOnError:y=!1,resetOnSuccess:b=!1,setDefaultsOnSuccess:x=!1,invalidateCacheTags:S=[],validateFiles:C=!1,validationTimeout:w=1500,withAllErrors:T=null,component:E=null,instant:D=!1,children:O,...k},ee)=>{let A=()=>{let[e,t]=L();return o(t)},j=Ao({}).withPrecognition(()=>N,()=>L()[0]).setValidationTimeout(w);C&&j.validateFiles(),(T??Un.get(`form.withAllErrors`))&&j.withAllErrors(),j.transform(A);let M=(0,z.useRef)(void 0),N=(0,z.useMemo)(()=>$r(e)?e.method:t.toLowerCase(),[e,t]),P=(0,z.useMemo)(()=>E||(D&&$r(e)?ei(e):null),[E,D,e]),[F,I]=(0,z.useState)(!1),te=(0,z.useRef)(new FormData),ne=e=>new FormData(M.current,e),re=e=>Ki(ne(e)),L=t=>Jr(N,$r(e)?e.url:e,re(t),r),R=e=>{e.type===`reset`&&e.detail?.[Qa]&&e.preventDefault(),jo(()=>I(e.type!==`reset`&&!St(re(),Ki(te.current))))},ie=(...e)=>(j.clearErrors(...e),j);(0,z.useEffect)(()=>{te.current=ne(),j.setDefaults(re());let e=[`input`,`change`,`reset`];return e.forEach(e=>M.current.addEventListener(e,R)),()=>{e.forEach(e=>M.current?.removeEventListener(e,R))}},[]),(0,z.useEffect)(()=>{j.setValidationTimeout(w)},[w]),(0,z.useEffect)(()=>{C?j.validateFiles():j.withoutFileValidation()},[C]);let ae=(...e)=>{M.current&&io(M.current,te.current,e),j.reset(...e)},oe=(...e)=>{ie(...e),ae(...e)},se=e=>{e&&(e===!0?ae():e.length>0&&ae(...e))},ce=e=>{let[t,v]=L(e);if(e?.getAttribute(`formtarget`)===`_blank`&&N===`get`){window.open(t,`_blank`);return}let C={headers:n,queryStringArrayFormat:r,errorBag:i,showProgress:a,invalidateCacheTags:S,component:P,optimistic:s?e=>s(e,v):void 0,onCancelToken:g,onBefore:f,onStart:l,onProgress:u,onFinish:d,onCancel:p,onSuccess:async(...e)=>{let t=await m(...e);return _({reset:ae,defaults:le}),se(b),x===!0&&le(),t},onError(...e){h(...e),se(y)},...c};j.transform(()=>o(v)),j.submit(N,t,C),j.transform(A)},le=()=>{te.current=ne(),I(!1)},ue={errors:j.errors,hasErrors:j.hasErrors,processing:j.processing,progress:j.progress,wasSuccessful:j.wasSuccessful,recentlySuccessful:j.recentlySuccessful,isDirty:F,clearErrors:ie,resetAndClearErrors:oe,setError:j.setError,reset:ae,submit:ce,defaults:le,getData:re,getFormData:ne,validator:()=>j.validator(),validating:j.validating,valid:j.valid,invalid:j.invalid,validate:(e,t)=>j.validate(...Bi.mergeHeadersForValidation(e,t,n)),touch:j.touch,touched:j.touched};(0,z.useImperativeHandle)(ee,()=>ue,[j,F,ce]);let de=(0,z.createElement)(`form`,{...k,ref:M,action:$r(e)?e.url:e,method:N,onSubmit:e=>{e.preventDefault(),ce(e.nativeEvent.submitter)},inert:v&&j.processing},typeof O==`function`?O(ue):O);return(0,z.createElement)(No.Provider,{value:ue},de)});Po.displayName=`InertiaForm`;var Fo=Po,Io=function({children:e,title:t}){let n=(0,z.use)(po),r=(0,z.useMemo)(()=>n.createProvider(),[n]),i=typeof window>`u`;(0,z.useEffect)(()=>(r.reconnect(),r.update(d(e)),()=>{r.disconnect()}),[r,e,t]);function a(e){return typeof e.type==`string`&&[`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`].indexOf(e.type)>-1}function o(e){let t=Object.keys(e.props).reduce((t,n)=>{if([`head-key`,`children`,`dangerouslySetInnerHTML`].includes(n))return t;let r=String(e.props[n]);return r===``?t+` ${n}`:t+` ${n}="${tn(r)}"`},``);return`<${String(e.type)}${t}>`}function s(e){let{children:t}=e.props;return typeof t==`string`?t:Array.isArray(t)?t.reduce((e,t)=>e+c(t),``):``}function c(e){let t=o(e);return e.props.children&&(t+=s(e)),e.props.dangerouslySetInnerHTML&&(t+=e.props.dangerouslySetInnerHTML.__html),a(e)||(t+=`</${String(e.type)}>`),t}function l(e){return z.cloneElement(e,{"data-inertia":e.props[`head-key`]===void 0?``:e.props[`head-key`]})}function u(e){return c(l(e))}function d(e){let n=z.Children.toArray(e).filter(e=>e).map(e=>u(e));return t&&!n.find(e=>e.startsWith(`<title`))&&n.push(`<title data-inertia="">${tn(t)}</title>`),n}return i&&r.update(d(e)),null},Lo=(e,t)=>e?e&&typeof e==`object`&&`current`in e?e.current:typeof e==`string`?document.querySelector(e):t:t,Ro=(e,t,n=null)=>e?typeof e==`function`?e(t):e:n,zo=(0,z.forwardRef)(({data:e,buffer:t=0,as:n=`div`,manual:r=!1,manualAfter:i=0,preserveUrl:a=!1,reverse:o=!1,autoScroll:s,children:c,startElement:l,endElement:u,itemsElement:d,previous:f,next:p,loading:m,params:h={},onlyNext:g=!1,onlyPrevious:_=!1,...v},y)=>{let[b,x]=(0,z.useState)(null),S=(0,z.useCallback)(e=>x(e),[]),[C,w]=(0,z.useState)(null),T=(0,z.useCallback)(e=>w(e),[]),[E,D]=(0,z.useState)(null),O=(0,z.useCallback)(e=>D(e),[]),k=Do().scrollProps?.[e],[ee,A]=(0,z.useState)(!1),[j,M]=(0,z.useState)(!1),[N,P]=(0,z.useState)(0),[F,I]=(0,z.useState)(!!k?.previousPage),[te,ne]=(0,z.useState)(!!k?.nextPage),[re,L]=(0,z.useState)(null),[R,ie]=(0,z.useState)(null),[ae,oe]=(0,z.useState)(null);(0,z.useEffect)(()=>{let e=l?Lo(l,b):b;L(e)},[l,b]),(0,z.useEffect)(()=>{let e=u?Lo(u,C):C;ie(e)},[u,C]),(0,z.useEffect)(()=>{let e=d?Lo(d,E):E;oe(e)},[d,E]);let se=(0,z.useMemo)(()=>Tr(ae),[ae]),ce=(0,z.useRef)({buffer:t,onlyNext:g,onlyPrevious:_,reverse:o,preserveUrl:a,params:h});ce.current={buffer:t,onlyNext:g,onlyPrevious:_,reverse:o,preserveUrl:a,params:h};let[le,ue]=(0,z.useState)(null),de=(0,z.useMemo)(()=>le?.dataManager,[le]),fe=(0,z.useMemo)(()=>le?.elementManager,[le]),pe=(0,z.useCallback)(()=>{se?se.scrollTo({top:se.scrollHeight,behavior:`instant`}):window.scrollTo({top:document.body.scrollHeight,behavior:`instant`})},[se]);(0,z.useEffect)(()=>{if(!ae)return;function t(){P(n.dataManager.getRequestCount()),I(n.dataManager.hasPrevious()),ne(n.dataManager.hasNext())}let n=da({getPropName:()=>e,inReverseMode:()=>ce.current.reverse,shouldFetchNext:()=>!ce.current.onlyPrevious,shouldFetchPrevious:()=>!ce.current.onlyNext,shouldPreserveUrl:()=>ce.current.preserveUrl,getReloadOptions:()=>ce.current.params,getTriggerMargin:()=>ce.current.buffer,getStartElement:()=>re,getEndElement:()=>R,getItemsElement:()=>ae,getScrollableParent:()=>se,onBeforePreviousRequest:()=>A(!0),onBeforeNextRequest:()=>M(!0),onCompletePreviousRequest:({completed:e})=>{A(!1),e&&t()},onCompleteNextRequest:({completed:e})=>{M(!1),e&&t()},onDataReset:t});ue(n);let{dataManager:r,elementManager:i}=n;return t(),i.setupObservers(),i.processServerLoadedElements(r.getLastLoadedPage()),he&&i.enableTriggers(),()=>{n.flush(),ue(null)}},[e,ae,re,R,se]);let me=(0,z.useMemo)(()=>r||i>0&&N>=i,[r,i,N]),he=(0,z.useMemo)(()=>!me,[me]);(0,z.useEffect)(()=>{he?fe?.enableTriggers():fe?.disableTriggers()},[he,g,_,re,R]),(0,z.useEffect)(()=>{(s===void 0?o:s)&&pe()},[se]),(0,z.useImperativeHandle)(y,()=>({fetchNext:de?.fetchNext||(()=>{}),fetchPrevious:de?.fetchPrevious||(()=>{}),hasPrevious:de?.hasPrevious||(()=>!1),hasNext:de?.hasNext||(()=>!1)}),[de]);let ge=he&&!g,_e=he&&!_,B={loadingPrevious:ee,loadingNext:j,hasPrevious:F,hasNext:te},ve={loading:ee,fetch:de?.fetchPrevious??(()=>{}),autoMode:ge,manualMode:!ge,hasMore:F,...B},ye={loading:j,fetch:de?.fetchNext??(()=>{}),autoMode:_e,manualMode:!_e,hasMore:te,...B},be={loading:ee||j,loadingPrevious:ee,loadingNext:j},xe=[];return l||xe.push((0,z.createElement)(`div`,{ref:S},Ro(f,ve,ee?Ro(m,ve):null))),xe.push((0,z.createElement)(n,{...v,ref:O},typeof c==`function`?c(be):c)),u||xe.push((0,z.createElement)(`div`,{ref:T},Ro(p,ye,j?Ro(m,ye):null))),(0,z.createElement)(z.Fragment,{},...o?[...xe].reverse():xe)});zo.displayName=`InertiaInfiniteScroll`;var Bo=()=>void 0,Vo=(0,z.forwardRef)(({children:e,as:t=`a`,data:n={},href:r=``,method:i=`get`,preserveScroll:a=!1,preserveState:o=null,preserveUrl:s=!1,replace:c=!1,only:l=[],except:u=[],headers:d={},queryStringArrayFormat:f=`brackets`,async:p=!1,onClick:m=Bo,onCancelToken:h=Bo,onBefore:g=Bo,onStart:_=Bo,onProgress:v=Bo,onFinish:y=Bo,onCancel:b=Bo,onSuccess:x=Bo,onError:S=Bo,onPrefetching:C=Bo,onPrefetched:w=Bo,prefetch:T=!1,cacheFor:E=0,cacheTags:D=[],viewTransition:O=!1,component:k=null,instant:ee=!1,pageProps:A=null,...j},M)=>{let[N,P]=(0,z.useState)(0),F=(0,z.useRef)(void 0),I=(0,z.useMemo)(()=>$r(r)?r.method:i.toLowerCase(),[r,i]),te=(0,z.useMemo)(()=>k||(ee&&$r(r)?ei(r):null),[k,ee,r]),ne=(0,z.useMemo)(()=>typeof t!=`string`||t.toLowerCase()!==`a`?t:I===`get`?t.toLowerCase():`button`,[t,I]),re=(0,z.useMemo)(()=>Jr(I,$r(r)?r.url:r,n,f),[r,I,n,f]),L=(0,z.useMemo)(()=>re[0],[re]),R=(0,z.useMemo)(()=>re[1],[re]),ie=(0,z.useMemo)(()=>({data:R,method:I,preserveScroll:a,preserveState:o??I!==`get`,preserveUrl:s,replace:c,only:l,except:u,headers:d,async:p,component:te,pageProps:A}),[R,I,a,o,s,c,l,u,d,p,te,A]),ae=(0,z.useMemo)(()=>({...ie,viewTransition:O,onCancelToken:h,onBefore:g,onStart(e){P(e=>e+1),_(e)},onProgress:v,onFinish(e){P(e=>e-1),y(e)},onCancel:b,onSuccess:x,onError:S}),[ie,O,h,g,_,v,y,b,x,S]),oe=(0,z.useMemo)(()=>T===!0?[`hover`]:T===!1?[]:Array.isArray(T)?T:[T],Array.isArray(T)?T:[T]),se=(0,z.useMemo)(()=>E===0?oe.length===1&&oe[0]===`click`?0:Uo.get(`prefetch.cacheFor`):E,[E,oe]),ce=(0,z.useMemo)(()=>()=>{W.prefetch(L,{...ie,onPrefetching:C,onPrefetched:w},{cacheFor:se,cacheTags:D})},[L,ie,C,w,se,D]);(0,z.useEffect)(()=>()=>{clearTimeout(F.current)},[]),(0,z.useEffect)(()=>{oe.includes(`mount`)&&setTimeout(()=>ce())},oe);let le={onClick:e=>{m(e),Ca(e)&&(e.preventDefault(),W.visit(L,ae))}},ue={onMouseEnter:()=>{F.current=window.setTimeout(()=>{ce()},Uo.get(`prefetch.hoverDelay`))},onMouseLeave:()=>{clearTimeout(F.current)},onClick:le.onClick},de={onMouseDown:e=>{Ca(e)&&(e.preventDefault(),ce())},onKeyDown:e=>{wa(e)&&(e.preventDefault(),ce())},onMouseUp:e=>{Ca(e)&&(e.preventDefault(),W.visit(L,ae))},onKeyUp:e=>{wa(e)&&(e.preventDefault(),W.visit(L,ae))},onClick:e=>{m(e),Ca(e)&&e.preventDefault()}},fe=(0,z.useMemo)(()=>ne===`button`?{type:`button`}:ne===`a`||typeof ne!=`string`?{href:L}:{},[ne,L]);return(0,z.createElement)(ne,{...j,...fe,ref:M,...oe.includes(`hover`)?ue:oe.includes(`click`)?de:le,"data-loading":N>0?``:void 0},e)});Vo.displayName=`InertiaLink`;var Ho=Vo,Uo=Un.extend(),K=t(f(),1),Wo=`effects`;function Go(){return p(Wo)}function Ko(e,t){return t}function qo(e){let t=document.createElement(`a`);t.href=e,t.rel=`noopener`,document.body.appendChild(t),t.click(),t.remove()}function Jo(e){return t=>window.dispatchEvent(new CustomEvent(e,{detail:t.props}))}var Yo={"reload-page":()=>window.location.reload(),redirect:e=>window.location.assign(e.props.url),download:e=>qo(e.props.url),"locale-change":e=>u(e.props.locale),toast:Jo(d.toast),callout:Jo(d.callout),"retract-callout":Jo(d.retractCallout),"reload-component":Jo(d.reloadComponent),"open-modal":Jo(d.openModal),"close-modal":Jo(d.closeModal),"reset-form":Jo(d.resetForm),"toggle-sidebar":Jo(d.toggleSidebar)};function Xo(...e){return Object.assign({},...e)}function Zo({href:e,method:t=`get`,children:n,...r}){return(0,K.jsx)(Ho,{href:e,method:t,...r,children:n})}var Qo={Link:Zo,visit:(e,t)=>W.visit(e,t),reload:()=>W.reload()};function $o(){window.dispatchEvent(new CustomEvent(d.closeModal,{detail:{modal:null}}))}function es(){(0,z.useEffect)(()=>W.on(`navigate`,$o),[])}var ts={name:`lattice/navigation`,extensions:{effects:{redirect:Ko(`redirect`,e=>W.visit(e.props.url)),"reload-page":Ko(`reload-page`,e=>e.props.full?window.location.reload():W.reload())}}},ns=(0,z.createContext)([]);function rs({children:e,renderer:t}){let n=(0,z.useContext)(ns),r=(0,z.useMemo)(()=>[t,...n],[n,t]);return(0,K.jsx)(ns.Provider,{value:r,children:e})}function is({className:e,icon:t}){let n=(0,z.useContext)(ns),{ids:r}=x();for(let r of n){let n=r({className:e,icon:t});if(n!=null&&n!==!1)return n}return r&&!r.includes(t)?(0,K.jsx)(as,{className:e}):(0,K.jsx)(M,{className:e,name:t})}function as({className:e}){return(0,K.jsxs)(`svg`,{"aria-hidden":`true`,className:k(`size-lt-icon-md text-lt-muted-fg`,e),"data-lattice-missing-icon":``,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`2`,viewBox:`0 0 24 24`,children:[(0,K.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,K.jsx)(`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`}),(0,K.jsx)(`path`,{d:`M12 17h.01`})]})}var os=E(`inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-lt-sm text-base font-medium transition-[color,box-shadow] disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-lt-icon-md [&_svg]:shrink-0 outline-none focus-visible:border-lt-ring focus-visible:ring-lt-ring/50 focus-visible:ring-[length:var(--lt-ring-width)] aria-invalid:ring-lt-danger/20 dark:aria-invalid:ring-lt-danger/40 aria-invalid:border-lt-danger`,{variants:{emphasis:{solid:`shadow-lt-xs disabled:bg-lt-disabled disabled:text-lt-disabled-fg disabled:shadow-none`,outline:`border border-lt-input bg-lt-bg shadow-lt-xs hover:bg-lt-accent hover:text-lt-accent-fg disabled:bg-lt-disabled disabled:text-lt-disabled-fg disabled:border-transparent disabled:shadow-none`,ghost:`hover:bg-lt-accent hover:text-lt-accent-fg disabled:text-lt-disabled-fg`,link:`underline-offset-4 hover:underline disabled:text-lt-disabled-fg disabled:no-underline`},variant:{primary:``,secondary:``,success:``,info:``,warning:``,danger:``},size:{md:`h-lt-control-md px-4 py-2 has-[>svg]:px-3`,sm:`h-lt-control-sm rounded-lt-sm px-3 has-[>svg]:px-2.5`,lg:`h-lt-control-lg rounded-lt-sm px-6 has-[>svg]:px-4`,icon:`size-lt-control-md`}},compoundVariants:[{emphasis:`solid`,variant:`primary`,class:`bg-lt-primary text-lt-primary-fg hover:bg-lt-primary-hover active:bg-lt-primary-active`},{emphasis:`solid`,variant:`secondary`,class:`bg-lt-secondary text-lt-secondary-fg hover:bg-lt-secondary-hover active:bg-lt-secondary-active`},{emphasis:`solid`,variant:`success`,class:`bg-lt-success text-lt-success-fg hover:bg-lt-success-hover active:bg-lt-success-active`},{emphasis:`solid`,variant:`info`,class:`bg-lt-info text-lt-info-fg hover:bg-lt-info-hover active:bg-lt-info-active`},{emphasis:`solid`,variant:`warning`,class:`bg-lt-warning text-lt-warning-fg hover:bg-lt-warning-hover active:bg-lt-warning-active`},{emphasis:`solid`,variant:`danger`,class:`bg-lt-danger text-lt-danger-fg hover:bg-lt-danger-hover active:bg-lt-danger-active focus-visible:ring-lt-danger/20 dark:focus-visible:ring-lt-danger/40`},{emphasis:`outline`,variant:`primary`,class:`border-lt-primary/40 text-lt-primary hover:bg-lt-primary/10 hover:text-lt-primary`},{emphasis:`outline`,variant:`secondary`,class:`border-lt-secondary text-lt-secondary-fg hover:bg-lt-secondary hover:text-lt-secondary-fg`},{emphasis:`outline`,variant:`success`,class:`border-lt-success/40 text-lt-success hover:bg-lt-success/10 hover:text-lt-success`},{emphasis:`outline`,variant:`info`,class:`border-lt-info/40 text-lt-info hover:bg-lt-info/10 hover:text-lt-info`},{emphasis:`outline`,variant:`warning`,class:`border-lt-warning/40 text-lt-warning hover:bg-lt-warning/10 hover:text-lt-warning`},{emphasis:`outline`,variant:`danger`,class:`border-lt-danger/40 text-lt-danger hover:bg-lt-danger/10 hover:text-lt-danger`},{emphasis:`ghost`,variant:`primary`,class:`text-lt-primary hover:bg-lt-primary/10 hover:text-lt-primary`},{emphasis:`ghost`,variant:`secondary`,class:`text-lt-secondary-fg hover:bg-lt-secondary hover:text-lt-secondary-fg`},{emphasis:`ghost`,variant:`success`,class:`text-lt-success hover:bg-lt-success/10 hover:text-lt-success`},{emphasis:`ghost`,variant:`info`,class:`text-lt-info hover:bg-lt-info/10 hover:text-lt-info`},{emphasis:`ghost`,variant:`warning`,class:`text-lt-warning hover:bg-lt-warning/10 hover:text-lt-warning`},{emphasis:`ghost`,variant:`danger`,class:`text-lt-danger hover:bg-lt-danger/10 hover:text-lt-danger`},{emphasis:`link`,variant:`primary`,class:`text-lt-primary`},{emphasis:`link`,variant:`secondary`,class:`text-lt-secondary-fg`},{emphasis:`link`,variant:`success`,class:`text-lt-success`},{emphasis:`link`,variant:`info`,class:`text-lt-info`},{emphasis:`link`,variant:`warning`,class:`text-lt-warning`},{emphasis:`link`,variant:`danger`,class:`text-lt-danger`}],defaultVariants:{emphasis:`solid`,size:`md`}});function ss(e,t){return t||((e??`solid`)===`solid`||e===`link`?`primary`:void 0)}function cs({className:e,variant:t,emphasis:n,size:r,asChild:i=!1,icon:a,children:o,...s}){let c=i?C:`button`,l=a&&!i?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(M,{name:a,"aria-hidden":`true`}),o]}):o;return(0,K.jsx)(c,{"data-slot":`button`,className:k(os({emphasis:n,variant:ss(n,t),size:r,className:e})),...s,children:l})}var ls=[];ls.forEach,ls.slice;var us=[`__proto__`,`constructor`,`prototype`];function ds(e){return!(typeof e!=`string`||e.length===0||e.length>128||us.indexOf(e)>-1||e.indexOf(`..`)>-1||e.indexOf(`\\`)>-1||/[?#%\s]/.test(e)||/[\x00-\x1F\x7F]/.test(e))}function fs(e){return!(!ds(e)||e.indexOf(`/`)>-1||e.indexOf(`@`)>-1)}function ps(e){return ds(e)}var ms={lng:fs,ns:ps};function hs(e){return typeof e==`string`?e.replace(/[\r\n\x00-\x1F\x7F]/g,` `):e}function gs(e){if(typeof e!=`string`||e.length===0)return e;try{let t=new URL(e);return t.username||t.password?(t.username=``,t.password=``,t.toString()):e}catch{return e.replace(/(\/\/)[^/@\s]+@/g,`$1`)}}function _s(){return typeof XMLHttpRequest==`function`||typeof XMLHttpRequest==`object`}function vs(e){return!!e&&typeof e.then==`function`}function ys(e){return vs(e)?e:Promise.resolve(e)}var bs=/\{\{(.+?)\}\}/g;function xs(e,t){let n=!1,r=e.replace(bs,(e,r)=>{let i=r.trim();if(us.indexOf(i)>-1)return e;let a=t[i];if(a==null)return e;let o=ms[i]||fs,s=String(a).split(`+`);for(let t of s)if(!o(t))return n=!0,e;return s.join(`+`)});return n?null:r}var Ss=typeof globalThis<`u`?globalThis:typeof global<`u`?global:typeof window<`u`?window:void 0,Cs;typeof fetch==`function`?Cs=fetch:Ss&&typeof Ss.fetch==`function`&&(Cs=Ss.fetch);var ws=_s()&&Ss?Ss.XMLHttpRequest:void 0,Ts=typeof ActiveXObject==`function`&&Ss?Ss.ActiveXObject:void 0,Es=[`__proto__`,`constructor`,`prototype`],Ds=(e,t)=>{if(t&&typeof t==`object`){let n=``;for(let e of Object.keys(t))Es.indexOf(e)>-1||(n+=`&`+encodeURIComponent(e)+`=`+encodeURIComponent(t[e]));if(!n)return e;e=e+(e.indexOf(`?`)===-1?`?`:`&`)+n.slice(1)}return e},Os=(e,t,n,r)=>{let i=e=>{if(!e.ok)return n(e.statusText||`Error`,{status:e.status});e.text().then(t=>{n(null,{status:e.status,data:t})}).catch(n)};if(r){let a=r(e,t);if(a instanceof Promise){a.then(i).catch(n);return}}typeof fetch==`function`?fetch(e,t).then(i).catch(n):Cs(e,t).then(i).catch(n)},ks=(e,t,n,r)=>{e.queryStringParams&&(t=Ds(t,e.queryStringParams));let i={...typeof e.customHeaders==`function`?e.customHeaders():e.customHeaders};typeof window>`u`&&typeof global<`u`&&global.process!==void 0&&global.process.versions&&global.process.versions.node&&(i[`User-Agent`]=`i18next-http-backend (node/${global.process.version}; ${global.process.platform} ${global.process.arch})`),n&&(i[`Content-Type`]=`application/json`);let a=typeof e.requestOptions==`function`?e.requestOptions(n):e.requestOptions,o={method:n?`POST`:`GET`,body:n?e.stringify(n):void 0,headers:i,...e._omitFetchOptions?{}:a},s=typeof e.alternateFetch==`function`&&e.alternateFetch.length>=1?e.alternateFetch:void 0;try{Os(t,o,r,s)}catch(n){if(!a||Object.keys(a).length===0||!n.message||n.message.indexOf(`not implemented`)<0)return r(n);try{Object.keys(a).forEach(e=>{delete o[e]}),Os(t,o,r,s),e._omitFetchOptions=!0}catch(e){r(e)}}},As=(e,t,n,r)=>{n&&typeof n==`object`&&(n=Ds(``,n).slice(1)),e.queryStringParams&&(t=Ds(t,e.queryStringParams));try{let i=ws?new ws:new Ts(`MSXML2.XMLHTTP.3.0`);i.open(n?`POST`:`GET`,t,1),e.crossDomain||i.setRequestHeader(`X-Requested-With`,`XMLHttpRequest`),i.withCredentials=!!e.withCredentials,n&&i.setRequestHeader(`Content-Type`,`application/x-www-form-urlencoded`),i.overrideMimeType&&i.overrideMimeType(`application/json`);let a=e.customHeaders;if(a=typeof a==`function`?a():a,a)for(let e of Object.keys(a))Es.indexOf(e)>-1||i.setRequestHeader(e,a[e]);i.onreadystatechange=()=>{i.readyState>3&&r(i.status>=400?i.statusText:null,{status:i.status,data:i.responseText})},i.send(n)}catch(e){console&&console.log(e)}},js=(e,t,n,r)=>{if(typeof n==`function`&&(r=n,n=void 0),r||=(()=>{}),Cs&&t.indexOf(`file:`)!==0)return ks(e,t,n,r);if(_s()||typeof ActiveXObject==`function`)return As(e,t,n,r);r(Error(`No fetch and no xhr implementation found!`))},Ms=()=>({loadPath:`/locales/{{lng}}/{{ns}}.json`,addPath:`/locales/add/{{lng}}/{{ns}}`,parse:e=>JSON.parse(e),stringify:JSON.stringify,parsePayload:(e,t,n)=>({[t]:n||``}),parseLoadPayload:(e,t)=>void 0,request:js,reloadInterval:typeof window<`u`?!1:36e5,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:`cors`,credentials:`same-origin`,cache:`default`}}),Ns=class{constructor(e,t={},n={}){this.services=e,this.options=t,this.allOptions=n,this.type=`backend`,this.init(e,t,n)}init(e,t={},n={}){if(this.services=e,this.options={...Ms(),...this.options||{},...t},this.allOptions=n,this.services&&this.options.reloadInterval){let e=setInterval(()=>this.reload(),this.options.reloadInterval);typeof e==`object`&&typeof e.unref==`function`&&e.unref()}}readMulti(e,t,n){this._readAny(e,e,t,t,n)}read(e,t,n){this._readAny([e],e,[t],t,n)}_readAny(e,t,n,r,i){let a=this.options.loadPath;typeof this.options.loadPath==`function`&&(a=this.options.loadPath(e,n)),a=ys(a),a.then(a=>{if(!a)return i(null,{});let o=xs(a,{lng:e.join(`+`),ns:n.join(`+`)});if(o==null){let t=e.map(hs).join(`, `),r=n.map(hs).join(`, `);return i(Error(`i18next-http-backend: unsafe lng/ns value — refusing to build request URL for languages=[`+t+`] namespaces=[`+r+`]`),!1)}this.loadUrl(o,i,t,r)})}loadUrl(e,t,n,r){let i=typeof n==`string`?[n]:n,a=typeof r==`string`?[r]:r,o=this.options.parseLoadPayload(i,a),s=hs(gs(e));this.options.request(this.options,e,o,(e,i)=>{if(i&&(i.status>=500&&i.status<600||!i.status))return t(`failed loading `+s+`; status code: `+i.status,!0);if(i&&i.status>=400&&i.status<500)return t(`failed loading `+s+`; status code: `+i.status,!1);if(!i&&e&&e.message){let n=e.message.toLowerCase();if([`failed`,`fetch`,`network`,`load`].find(e=>n.indexOf(e)>-1))return t(`failed loading `+s+`: `+hs(e.message),!0)}if(e)return t(e,!1);let a,o;try{a=typeof i.data==`string`?this.options.parse(i.data,n,r):i.data}catch{o=`failed parsing `+s+` to json`}if(o)return t(o,!1);t(null,a)})}create(e,t,n,r,i){if(!this.options.addPath)return;typeof e==`string`&&(e=[e]);let a=this.options.parsePayload(t,n,r),o=0,s=[],c=[];e.forEach(n=>{let r=this.options.addPath;typeof this.options.addPath==`function`&&(r=this.options.addPath(n,t));let l=xs(r,{lng:n,ns:t});if(l==null){o+=1,i&&o===e.length&&i(s,c);return}this.options.request(this.options,l,a,(t,n)=>{o+=1,s.push(t),c.push(n),o===e.length&&typeof i==`function`&&i(s,c)})})}reload(){let{backendConnector:e,languageUtils:t,logger:n}=this.services,r=e.language;if(r&&r.toLowerCase()===`cimode`)return;let i=[],a=e=>{t.toResolveHierarchy(e).forEach(e=>{i.indexOf(e)<0&&i.push(e)})};a(r),this.allOptions.preload&&this.allOptions.preload.forEach(e=>a(e)),i.forEach(t=>{this.allOptions.ns.forEach(r=>{e.read(t,r,`read`,null,null,(i,a)=>{i&&n.warn(`loading namespace ${r} for language ${t} failed`,i),!i&&a&&n.log(`loaded namespace ${r} for language ${t}`,a),e.loaded(`${t}|${r}`,i,a)})})})}};Ns.type=`backend`;var Ps=`/locales/{{lng}}/{{ns}}.json`,Fs=`/locales/add/{{lng}}/{{ns}}`;async function Is(e,t={}){if(oe(e),!e?.enabled){await ne(e=>({...e,ns:t.namespaces??e.ns}));return}await Ls({saveMissing:e.saveMissing,namespaces:t.namespaces}),te(e.preloadLocales)}async function Ls(e={}){let{namespaces:t,loadPath:n=Ps,addPath:r=Fs,saveMissing:i=!1,customHeaders:a}=e,o=()=>({...c(),...a?.()});N.use(Ns),await ne(e=>({...e,ns:t??e.ns,partialBundledLanguages:!0,saveMissing:i,backend:{loadPath:n,addPath:r,customHeaders:o,withCredentials:!0}}))}function Rs(e,t,n={}){let{enabled:r=!0}=n,i=(0,z.useRef)(t);i.current=t,(0,z.useEffect)(()=>{if(!r||typeof window>`u`)return;let t=e=>i.current(e);return window.addEventListener(e,t),()=>window.removeEventListener(e,t)},[e,r])}function zs({href:e,method:t,...n}){return(0,K.jsx)(`a`,{href:e,...n})}var Bs={Link:zs,visit:e=>window.location.assign(e),reload:()=>window.location.reload()},Vs=(0,z.createContext)(Bs);function Hs({adapter:e,children:t}){return(0,K.jsx)(Vs.Provider,{value:e,children:t})}function Us(){return(0,z.useContext)(Vs)}function Ws({preserveScroll:e=!0,preserveState:t=!0}){let{visit:n}=Us();return Rs(d.localeChange,r=>{let i=r.detail?.locale;typeof i==`string`&&i!==``&&n(window.location.href,{preserveScroll:e,preserveState:t})}),null}function Gs({namespace:e=`lattice`,label:t}={}){let{t:n,locale:r,locales:i,setLocale:a}=P(e),o=i.length>0?i:[r],s=t??(e=>n(`language.${e}`,e));return{locale:r,locales:o,options:o.map(e=>({value:e,label:s(e),active:e===r})),setLocale:a}}function Ks(e){return Array.isArray(e)&&e.every(e=>typeof e==`string`)}function qs(e){return a(e)&&typeof e.enabled==`boolean`&&typeof e.saveMissing==`boolean`&&Ks(e.locales)&&Ks(e.preloadLocales)&&(e.timezone===void 0||e.timezone===null||typeof e.timezone==`string`)}function Js(e){if(!a(e))return;let t=e.lattice,n=a(t)?t.i18n:void 0;return qs(n)?n:void 0}var Ys=e({configureI18nFromPageProps:()=>Xs,i18nConfigFromPageProps:()=>Js});function Xs(e,t={}){return Is(Js(e),t)}function Zs({value:e,dateStyle:t=`medium`,timeStyle:n=`short`}){let{locale:r}=s(),{timezone:i}=ae();if(e==null||e===``)return null;let a={locale:r,timeZone:i},o=R(e,{dateStyle:t,timeStyle:n},a),c=Qs(e),l=L(e,a);return(0,K.jsx)(`time`,{dateTime:c??void 0,title:l||void 0,children:o})}function Qs(e){return ie(e)?.toISOString()??null}function $s({className:e,...t}){let{t:n}=P(I);return(0,K.jsx)(M,{name:`loader-2`,role:`status`,"aria-label":n(`common.loading`,`Loading`),"aria-hidden":!1,className:k(`animate-spin`,e),...t})}function q(e){return e==null||e===``?void 0:e}function J(e){return q(e.key)??q(e.id)}function ec(e){return q(e)?.split(`.`).at(-1)}function tc(e,t){let n=ec(t);return n?`${e}-${n}`:void 0}function nc(e,t){return tc(e,J(t))}var rc=(0,z.createContext)(!1),ic=`flex h-lt-control-sm w-full items-center justify-start gap-2 rounded-lt-sm px-2.5 text-left text-sm font-normal text-lt-popover-fg no-underline decoration-transparent shadow-none transition-colors hover:bg-lt-accent/70 hover:text-lt-popover-fg focus-visible:bg-lt-accent/70 focus-visible:text-lt-popover-fg focus-visible:ring-0 focus-visible:outline-none disabled:pointer-events-none disabled:text-lt-disabled-fg [&_svg]:size-lt-icon-sm [&_svg]:text-lt-muted-fg`;function ac({children:e}){return(0,K.jsx)(rc.Provider,{value:!0,children:e})}function oc(){return(0,z.useContext)(rc)}var sc=`X-Lattice-Ref`,cc=new Map;function lc(e){return cc.get(e)??e}function uc(e,t){cc.set(e,t)}function dc(e){let t=lc(e);return t?{[sc]:t}:{}}var fc=()=>({});function pc(e){fc=e}function mc(e={}){return{...fc(),...e}}function hc(e=``,t={}){return{...mc(),...dc(e),...t}}var gc=class extends Error{response;constructor(e){super(`HTTP ${e.status}`),this.response=e}};function _c(){let e=document.cookie.match(/XSRF-TOKEN=([^;]+)/);return e?decodeURIComponent(e[1]):``}var vc=1e4,yc=new Map,bc=new Map;function xc(e){return e===void 0||e===`GET`||e===`HEAD`?{Accept:`application/json`}:{Accept:`application/json`,"Content-Type":`application/json`,"X-Requested-With":`XMLHttpRequest`,"X-XSRF-TOKEN":_c()}}var Sc=`/lattice/refs/refresh`;function Cc(e){Sc=e}var wc=new Map;async function Tc(e){let t=wc.get(e);if(t)return t;let n=Dc(Sc,{method:`POST`,body:JSON.stringify({ref:lc(e)})}).then(t=>(uc(e,t.ref),t.ref)).catch(()=>null).finally(()=>{wc.delete(e)});return wc.set(e,n),n}async function Ec(e,t={}){let{ref:n=``,headers:r,throwOnError:i=!0,method:a,...o}=t,s=a?.toUpperCase(),c=()=>fetch(e,{credentials:`same-origin`,...o,method:s,headers:hc(n,{...xc(s),...r})}),l=await c();if(n!==``&&l.status===403&&await Tc(n)!==null&&(l=await c()),i&&!l.ok)throw new gc(l);return l}async function Dc(e,t){return(await Ec(e,t)).json()}function Oc(e){return[e.source,e.audience,[...e.scopes].sort().join(` `)].join(``)}function kc(e){yc.delete(Oc(e))}async function Ac(e){let t=Oc(e),n=yc.get(t);if(n&&n.expiresAt>Date.now()+vc)return n.token;let r=bc.get(t);if(r)return r;let i=Dc(e.tokenEndpoint,{method:`POST`,ref:e.ref,body:JSON.stringify({nodeId:e.nodeId,nodeType:e.nodeType,audience:e.audience,scopes:e.scopes})}).then(e=>(yc.set(t,{token:e,expiresAt:Date.now()+Math.max(0,e.expiresIn)*1e3}),e)).finally(()=>{bc.delete(t)});return bc.set(t,i),i}function jc(e){return e.status===401||e.status===403}async function Mc(e,t,n){let{headers:r,...i}=t;return fetch(e,{...i,credentials:`omit`,headers:mc({Accept:`application/json`,...r,Authorization:`${n.tokenType} ${n.accessToken}`})})}async function Nc(e,t){let{remote:n,throwOnError:r=!0,...i}=t,a=await Ac(n),o=await Mc(e,i,a);if(jc(o)&&(kc(n),a=await Ac(n),o=await Mc(e,i,a)),r&&!o.ok)throw new gc(o);return o}async function Pc(e,t){return(await Nc(e,t)).json()}function Fc(e,t=Yo){if(!(typeof window>`u`))for(let n of e){let e=t[n.type];if(e===void 0){console.warn(`[lattice] No handler registered for effect type "${n.type}".`);continue}e(n)}}function Ic(e){typeof window>`u`||window.dispatchEvent(new CustomEvent(d.actionError,{detail:{error:e}}))}function Lc(e){return Array.isArray(e)?e.filter(Rc):[]}function Rc(e){return typeof e==`object`&&!!e&&`type`in e&&typeof e.type==`string`}function zc(){let e=Go(),t=(0,z.useMemo)(()=>Xo(Yo,e),[e]);return(0,z.useCallback)(e=>Fc(e,t),[t])}function Bc(e){return Array.isArray(e)?e.filter(e=>typeof e==`object`&&!!e&&`type`in e&&typeof e.type==`string`):[]}function Vc(e,t){return e.key??e.id??`${e.type}-${t}`}var Hc=(0,z.createContext)(!1);function Uc({collapsed:e,children:t}){return(0,K.jsx)(Hc.Provider,{value:e,children:t})}function Wc(){return(0,z.useContext)(Hc)}var Gc={sm:`sm:hidden`,md:`md:hidden`,lg:`lg:hidden`,xl:`xl:hidden`,"2xl":`2xl:hidden`},Kc={sm:`sm:contents`,md:`md:contents`,lg:`lg:contents`,xl:`xl:contents`,"2xl":`2xl:contents`};function qc(e){let t=Gc[e?.hiddenFrom??``],n=Kc[e?.visibleFrom??``];return n&&t?`hidden ${n} ${t}`:n?`hidden ${n}`:t?`contents ${t}`:null}function Jc(){return(0,K.jsxs)(`svg`,{"aria-hidden":`true`,className:`size-lt-icon-md shrink-0`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`2`,viewBox:`0 0 24 24`,children:[(0,K.jsx)(`rect`,{height:`18`,rx:`2`,strokeDasharray:`4 3`,width:`18`,x:`3`,y:`3`}),(0,K.jsx)(`path`,{d:`M12 8v4`}),(0,K.jsx)(`path`,{d:`M12 16h.01`})]})}function Yc({node:e}){e.type;let t=`Missing component: ${e.type}`;return(0,K.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 align-middle text-lt-muted-fg`,"data-lattice-missing-component":e.type,title:t,children:[(0,K.jsx)(Jc,{}),(0,K.jsx)(`span`,{className:`sr-only`,children:t})]})}function Xc({nodes:e}){return e.map((e,t)=>(0,K.jsx)(Zc,{node:e},Vc(e,t)))}function Y({node:e}){return(0,K.jsx)(Zc,{node:e})}var Zc=(0,z.memo)(function({node:e}){let t=Wc(),n=h()[e.type];if(t&&e.props?.hideWhenCollapsed===!0)return null;if(!n)return(0,K.jsx)(Yc,{node:e});let r=n.component,i=e.schema?.length?(0,K.jsx)(Xc,{nodes:e.schema}):null,a=(0,K.jsx)(r,{node:e,children:i});n.mode===`lazy`&&(a=(0,K.jsx)(z.Suspense,{fallback:null,children:a}));let o=qc(e.props);return o?(0,K.jsx)(`span`,{className:o,children:a}):a}),Qc=`Embedded modals require a ModalProvider.`,$c=(0,z.createContext)(null);function el(){return(0,z.useContext)($c)}var tl=(0,z.createContext)(null);function nl(){return(0,z.useContext)(tl)}function rl(){let e=nl();if(!e)throw Error(Qc);return e}function il({children:e}){let[t,n]=(0,z.useState)([]),r=(0,z.useRef)(t),i=(0,z.useRef)(0),a=(0,z.useRef)(new Map),o=(0,z.useCallback)(e=>{let t=e(r.current);return r.current=t,n(t),t},[]),s=(0,z.useCallback)(e=>{o(t=>{let n=t.findIndex(t=>t.key===e);if(n===-1||!t[n].open)return t;let r=[...t];return r[n]={...r[n],open:!1},r})},[o]),c=(0,z.useCallback)(e=>{let t=(0,z.isValidElement)(e)?null:e.id??null,n=document.activeElement instanceof HTMLElement?document.activeElement:null,r=-1;return o(a=>{if(t!==null){let n=a.findIndex(e=>e.nodeId===t&&e.open);if(n!==-1){r=a[n].key;let t=[...a];return t[n]={...t[n],content:e},t}}return r=i.current++,[...a,{key:r,content:e,nodeId:t,open:!0,opener:n}]}),{close:()=>s(r)}},[s,o]);(0,z.useEffect)(()=>{function e(e){let t=e.detail?.node;t&&c(t)}function t(e){let t=e.detail?.modal;o(e=>{if(t==null)return e.map(e=>e.open?{...e,open:!1}:e);let n=e.findIndex(e=>e.nodeId===t);if(n===-1)return e;let r=[...e];return r[n]={...r[n],open:!1},r})}return window.addEventListener(d.openModal,e),window.addEventListener(d.closeModal,t),()=>{window.removeEventListener(d.openModal,e),window.removeEventListener(d.closeModal,t)}},[c,o]);let l=(0,z.useCallback)(e=>{let t=a.current.get(e);return t||(t={onOpenChange:t=>{t||s(e)},onExited:t=>{o(n=>{let r=n.find(t=>t.key===e)?.opener??null;return r?.isConnected&&(t.preventDefault(),requestAnimationFrame(()=>r.focus())),n.filter(t=>t.key!==e)}),a.current.delete(e)}},a.current.set(e,t),t)},[s,o]),u=(0,z.useMemo)(()=>({open:c}),[c]);return(0,K.jsxs)(tl.Provider,{value:u,children:[e,t.map(e=>{let t={open:e.open,...l(e.key)};return(0,K.jsx)($c.Provider,{value:t,children:(0,z.isValidElement)(e.content)?e.content:(0,K.jsx)(Y,{node:e.content})},e.key)})]})}async function al(e,t){try{let n=await e();return t(Lc((await n.json().catch(()=>({}))).effects)),n.ok}catch(e){return Ic(e),!1}}var ol=Object.defineProperty,sl=(e,t)=>ol(e,`name`,{value:t,configurable:!0}),cl=!!(typeof window<`u`&&window.document&&window.document.createElement);function ll(e,t,{checkForDefaultPrevented:n=!0}={}){return sl(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}sl(ll,`composeEventHandlers`);function ul(e){if(!cl)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}sl(ul,`getOwnerWindow`);function dl(e){if(!cl)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}sl(dl,`getOwnerDocument`);function fl(e,t=!1){let{activeElement:n}=dl(e);if(!n?.nodeName)return null;if(pl(n)&&n.contentDocument)return fl(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=dl(n).getElementById(e);if(t)return t}}return n}sl(fl,`getActiveElement`);function pl(e){return e.tagName===`IFRAME`}sl(pl,`isFrame`);var ml=Object.defineProperty,hl=(e,t)=>ml(e,`name`,{value:t,configurable:!0});function gl(e,t){let n=z.createContext(t);n.displayName=e+`Context`;let r=hl(e=>{let{children:t,...r}=e,i=z.useMemo(()=>r,Object.values(r));return(0,K.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=z.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return hl(i,`useContext`),[r,i]}hl(gl,`createContext`);function _l(e,t=[]){let n=[];function r(t,r){let i=z.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=hl(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=z.useMemo(()=>o,Object.values(o));return(0,K.jsx)(s.Provider,{value:c,children:r})},`Provider`);o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:c=!1}=s,l=o?.[e]?.[a]||i,u=z.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return hl(s,`useContext`),[o,s]}hl(r,`createContext`);let i=hl(()=>{let t=n.map(e=>z.createContext(e));return hl(function(n){let r=n?.[e]||t;return z.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,vl(i,...t)]}hl(_l,`createContextScope`);function vl(...e){let t=e[0];if(e.length===1)return t;let n=hl(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return hl(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return z.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}hl(vl,`composeContextScopes`);var yl=globalThis?.document?z.useLayoutEffect:()=>{},bl=Object.defineProperty,xl=(e,t)=>bl(e,`name`,{value:t,configurable:!0}),Sl=z.useId||(()=>void 0),Cl=0;function wl(e){let[t,n]=z.useState(Sl());return yl(()=>{e||n(e=>e??String(Cl++))},[e]),e||(t?`radix-${t}`:``)}xl(wl,`useId`);var Tl=Object.defineProperty,El=(e,t)=>Tl(e,`name`,{value:t,configurable:!0}),Dl=z.useEffectEvent,Ol=z.useInsertionEffect;function kl(e){if(typeof Dl==`function`)return Dl(e);let t=z.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof Ol==`function`?Ol(()=>{t.current=e}):yl(()=>{t.current=e}),z.useMemo(()=>((...e)=>t.current?.(...e)),[])}El(kl,`useEffectEvent`);var Al=Object.defineProperty,jl=(e,t)=>Al(e,`name`,{value:t,configurable:!0}),Ml=z.useInsertionEffect||yl;function Nl({prop:e,defaultProp:t,onChange:n=jl(()=>{},`onChange`),caller:r}){let[i,a,o]=Pl({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,z.useCallback(t=>{if(s){let n=Fl(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}jl(Nl,`useControllableState`);function Pl({defaultProp:e,onChange:t}){let[n,r]=z.useState(e),i=z.useRef(n),a=z.useRef(t);return Ml(()=>{a.current=t},[t]),z.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}jl(Pl,`useUncontrolledState`);function Fl(e){return typeof e==`function`}jl(Fl,`isFunction`);var Il=Symbol(`RADIX:SYNC_STATE`);function X(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=kl(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=z.useReducer((t,n)=>{if(n.type===Il)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...u),p=d.state,m=z.useRef(p);z.useEffect(()=>{m.current!==p&&(m.current=p,c||l(p))},[p,m,c]);let h=z.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return z.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:Il,state:i})},[i,d.state,c]),[h,f]}jl(X,`useControllableStateReducer`);var Z=Object.defineProperty,Ll=(e,t)=>Z(e,`name`,{value:t,configurable:!0}),Q=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=S(`Primitive.${t}`),r=z.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,K.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Rl(e,t){e&&lo.flushSync(()=>e.dispatchEvent(t))}Ll(Rl,`dispatchDiscreteCustomEvent`);var zl=Object.defineProperty,Bl=(e,t)=>zl(e,`name`,{value:t,configurable:!0});function Vl(e){let t=z.useRef(e);return z.useEffect(()=>{t.current=e}),z.useMemo(()=>((...e)=>t.current?.(...e)),[])}Bl(Vl,`useCallbackRef`);var Hl=Object.defineProperty,Ul=(e,t)=>Hl(e,`name`,{value:t,configurable:!0}),Wl=`dismissableLayer.update`,Gl=`dismissableLayer.pointerDownOutside`,Kl=`dismissableLayer.focusOutside`,ql,Jl=z.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Yl=z.forwardRef(Ul(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=z.useContext(Jl),[d,f]=z.useState(null),p=d?.ownerDocument??globalThis?.document,[,m]=z.useState({}),h=_(t,f),g=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=v?g.indexOf(v):-1,b=d?g.indexOf(d):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,S=b>=y,C=z.useRef(!1),w=$l(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:C,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:z.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return S&&!t},[u.branches,S])}),T=eu(e=>{if(r&&C.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},p),E=d?b===g.length-1:!1,D=Vl(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return z.useEffect(()=>{if(E)return p.addEventListener(`keydown`,D,{capture:!0}),()=>p.removeEventListener(`keydown`,D,{capture:!0})},[p,E,D]),z.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(ql=p.body.style.pointerEvents,p.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),tu(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=ql))}},[d,p,n,u]),z.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),tu())},[d,u]),z.useEffect(()=>{let e=Ul(()=>m({}),`handleUpdate`);return document.addEventListener(Wl,e),()=>document.removeEventListener(Wl,e)},[]),(0,K.jsx)(Q.div,{...l,ref:h,style:{pointerEvents:x?S?`auto`:`none`:void 0,...e.style},onFocusCapture:ll(e.onFocusCapture,T.onFocusCapture),onBlurCapture:ll(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:ll(e.onPointerDownCapture,w.onPointerDownCapture)})},`DismissableLayer`)),Xl=z.forwardRef(Ul(function(e,t){let n=z.useContext(Jl),r=z.useRef(null),i=_(t,r);return z.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,K.jsx)(Q.div,{...e,ref:i})},`DismissableLayerBranch`));function Zl(){let e=z.useContext(Jl),[t,n]=z.useState(null);return z.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}Ul(Zl,`useDismissableLayerSurface`);var Ql=Ul(()=>!0,`IS_TRUE`);function $l(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=Ql}=t,s=Vl(e),c=z.useRef(!1),l=z.useRef(!1),u=z.useRef(new Map),d=z.useRef(()=>{});return z.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}Ul(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}Ul(t,`isOutsideInteractionIntercepted`);function f(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||u.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&d.current()},0)}Ul(f,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}Ul(p,`handleInteractionBubble`);let m=Ul(a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||nu(Gl,s,p,{discrete:!0})};if(Ul(f,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,d.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,u.current.clear(),!r||a.button!==0?f():(n.removeEventListener(`click`,d.current),d.current=f,n.addEventListener(`click`,d.current,{once:!0}))}else n.removeEventListener(`click`,d.current),e();c.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,f,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,d.current);for(let e of h)n.removeEventListener(e,f,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:Ul(()=>c.current=!0,`onPointerDownCapture`)}}Ul($l,`usePointerDownOutside`);function eu(e,t=globalThis?.document){let n=Vl(e),r=z.useRef(!1);return z.useEffect(()=>{let e=Ul(e=>{e.target&&!r.current&&nu(Kl,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:Ul(()=>r.current=!0,`onFocusCapture`),onBlurCapture:Ul(()=>r.current=!1,`onBlurCapture`)}}Ul(eu,`useFocusOutside`);function tu(){let e=new CustomEvent(Wl);document.dispatchEvent(e)}Ul(tu,`dispatchUpdate`);function nu(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Rl(i,a):i.dispatchEvent(a)}Ul(nu,`handleAndDispatchCustomEvent`);var ru=Yl,iu=Xl,au=Object.defineProperty,ou=(e,t)=>au(e,`name`,{value:t,configurable:!0}),su=`focusScope.autoFocusOnMount`,cu=`focusScope.autoFocusOnUnmount`,lu={bubbles:!1,cancelable:!0},uu=z.forwardRef(ou(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=z.useState(null),l=Vl(i),u=Vl(a),d=z.useRef(null),f=_(t,c),p=z.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;z.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:_u(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||_u(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&_u(s)};ou(e,`handleFocusIn`),ou(t,`handleFocusOut`),ou(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),z.useEffect(()=>{if(s){vu.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(su,lu);s.addEventListener(su,l),s.dispatchEvent(t),t.defaultPrevented||(du(xu(pu(s)),{select:!0}),document.activeElement===e&&_u(s))}return()=>{s.removeEventListener(su,l),setTimeout(()=>{let t=new CustomEvent(cu,lu);s.addEventListener(cu,u),s.dispatchEvent(t),t.defaultPrevented||_u(e??document.body,{select:!0}),s.removeEventListener(cu,u),vu.remove(p)},0)}}},[s,l,u,p]);let m=z.useCallback(e=>{if(!n&&!r||p.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=fu(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&_u(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&_u(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,K.jsx)(Q.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})},`FocusScope`));function du(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(_u(r,{select:t}),document.activeElement!==n)return}ou(du,`focusFirst`);function fu(e){let t=pu(e);return[mu(t,e),mu(t.reverse(),e)]}ou(fu,`getTabbableEdges`);function pu(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:ou(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}ou(pu,`getTabbableCandidates`);function mu(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):hu(r,{upTo:t})))return r}ou(mu,`findVisible`);function hu(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}ou(hu,`isHidden`);function gu(e){return e instanceof HTMLInputElement&&`select`in e}ou(gu,`isSelectableInput`);function _u(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&gu(e)&&t&&e.select()}}ou(_u,`focus`);var vu=yu();function yu(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=bu(e,t),e.unshift(t)},remove(t){e=bu(e,t),e[0]?.resume()}}}ou(yu,`createFocusScopesStack`);function bu(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}ou(bu,`arrayRemove`);function xu(e){return e.filter(e=>e.tagName!==`A`)}ou(xu,`removeLinks`);var Su=Object.defineProperty,Cu=z.forwardRef(((e,t)=>Su(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=z.useState(!1);yl(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?lo.createPortal((0,K.jsx)(Q.div,{...r,ref:t}),o):null},`Portal`)),wu=Object.defineProperty,Tu=(e,t)=>wu(e,`name`,{value:t,configurable:!0});function Eu(e,t){return z.useReducer((e,n)=>t[e][n]??e,e)}Tu(Eu,`useStateMachine`);var Du=Tu(e=>{let{present:t,children:n}=e,r=Ou(t),i=typeof n==`function`?n({present:r.isPresent}):z.Children.only(n),a=Au(r.ref,Mu(i));return typeof n==`function`||r.isPresent?z.cloneElement(i,{ref:a}):null},`Presence`);function Ou(e){let[t,n]=z.useState(),r=z.useRef(null),i=z.useRef(e),a=z.useRef(`none`),o=z.useRef(void 0),[s,c]=Eu(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return z.useEffect(()=>{s===`mounted`?(a.current=o.current??ju(r.current),o.current=void 0):a.current=`none`},[s]),yl(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=ju(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),yl(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=Tu(a=>{let o=ju(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=Tu(e=>{e.target===t&&(a.current=ju(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:z.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=ju(t)}else r.current=null;n(e)},[])}}Tu(Ou,`usePresence`);function ku(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}Tu(ku,`setRef`);function Au(...e){let t=z.useRef(e);return t.current=e,z.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=ku(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():ku(n[e],null)}}},[])}Tu(Au,`useStableComposedRefs`);function ju(e){return e?.animationName||`none`}Tu(ju,`getAnimationName`);function Mu(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}Tu(Mu,`getElementRef`);var Nu=Object.defineProperty,Pu=(e,t)=>Nu(e,`name`,{value:t,configurable:!0}),Fu=0,Iu=null;function Lu(e){return Ru(),e.children}Pu(Lu,`FocusGuards`);function Ru(){z.useEffect(()=>{Iu||={start:zu(),end:zu()};let{start:e,end:t}=Iu;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),Fu++,()=>{Fu===1&&(Iu?.start.remove(),Iu?.end.remove(),Iu=null),Fu=Math.max(0,Fu-1)}},[])}Pu(Ru,`useFocusGuards`);function zu(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}Pu(zu,`createFocusGuard`);var Bu=function(){return Bu=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Bu.apply(this,arguments)};function Vu(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Hu(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var Uu=`right-scroll-bar-position`,Wu=`width-before-scroll-bar`,Gu=`with-scroll-bars-hidden`,Ku=`--removed-body-scroll-bar-size`;function qu(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Ju(e,t){var n=(0,z.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var Yu=typeof window<`u`?z.useLayoutEffect:z.useEffect,Xu=new WeakMap;function Zu(e,t){var n=Ju(t||null,function(t){return e.forEach(function(e){return qu(e,t)})});return Yu(function(){var t=Xu.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||qu(e,null)}),i.forEach(function(e){r.has(e)||qu(e,a)})}Xu.set(n,e)},[e]),n}function Qu(e){return e}function $u(e,t){t===void 0&&(t=Qu);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function ed(e){e===void 0&&(e={});var t=$u(null);return t.options=Bu({async:!0,ssr:!1},e),t}var td=function(e){var t=e.sideCar,n=Vu(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return z.createElement(r,Bu({},n))};td.isSideCarExport=!0;function nd(e,t){return e.useMedium(t),td}var rd=ed(),id=function(){},ad=z.forwardRef(function(e,t){var n=z.useRef(null),r=z.useState({onScrollCapture:id,onWheelCapture:id,onTouchMoveCapture:id}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,y=e.gapMode,b=Vu(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=Zu([n,t]),C=Bu(Bu({},b),i);return z.createElement(z.Fragment,null,u&&z.createElement(x,{sideCar:rd,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?z.cloneElement(z.Children.only(s),Bu(Bu({},C),{ref:S})):z.createElement(v,Bu({},C,{className:c,ref:S}),s))});ad.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},ad.classNames={fullWidth:Wu,zeroRight:Uu};var od,sd=function(){if(od)return od;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function cd(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=sd();return t&&e.setAttribute(`nonce`,t),e}function ld(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function ud(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var dd=function(){var e=0,t=null;return{add:function(n){e==0&&(t=cd())&&(ld(t,n),ud(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},fd=function(){var e=dd();return function(t,n){z.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},pd=function(){var e=fd();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},md={left:0,top:0,right:0,gap:0},hd=function(e){return parseInt(e||``,10)||0},gd=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[hd(n),hd(r),hd(i)]},_d=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return md;var t=gd(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},vd=pd(),$=`data-scroll-locked`,yd=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
99
|
+
.${Gu} {
|
|
100
|
+
overflow: hidden ${r};
|
|
101
|
+
padding-right: ${s}px ${r};
|
|
102
|
+
}
|
|
103
|
+
body[${$}] {
|
|
104
|
+
overflow: hidden ${r};
|
|
105
|
+
overscroll-behavior: contain;
|
|
106
|
+
${[t&&`position: relative ${r};`,n===`margin`&&`
|
|
107
|
+
padding-left: ${i}px;
|
|
108
|
+
padding-top: ${a}px;
|
|
109
|
+
padding-right: ${o}px;
|
|
110
|
+
margin-left:0;
|
|
111
|
+
margin-top:0;
|
|
112
|
+
margin-right: ${s}px ${r};
|
|
113
|
+
`,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.${Uu} {
|
|
117
|
+
right: ${s}px ${r};
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.${Wu} {
|
|
121
|
+
margin-right: ${s}px ${r};
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.${Uu} .${Uu} {
|
|
125
|
+
right: 0 ${r};
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.${Wu} .${Wu} {
|
|
129
|
+
margin-right: 0 ${r};
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
body[${$}] {
|
|
133
|
+
${Ku}: ${s}px;
|
|
134
|
+
}
|
|
135
|
+
`},bd=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},xd=function(){z.useEffect(function(){return document.body.setAttribute($,(bd()+1).toString()),function(){var e=bd()-1;e<=0?document.body.removeAttribute($):document.body.setAttribute($,e.toString())}},[])},Sd=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;xd();var a=z.useMemo(function(){return _d(i)},[i]);return z.createElement(vd,{styles:yd(a,!t,i,n?``:`!important`)})},Cd=!1;if(typeof window<`u`)try{var wd=Object.defineProperty({},"passive",{get:function(){return Cd=!0,!0}});window.addEventListener(`test`,wd,wd),window.removeEventListener(`test`,wd,wd)}catch{Cd=!1}var Td=Cd?{passive:!1}:!1,Ed=function(e){return e.tagName===`TEXTAREA`},Dd=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!Ed(e)&&n[t]===`visible`)},Od=function(e){return Dd(e,`overflowY`)},kd=function(e){return Dd(e,`overflowX`)},Ad=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),Nd(e,r)){var i=Pd(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},jd=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},Md=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},Nd=function(e,t){return e===`v`?Od(t):kd(t)},Pd=function(e,t){return e===`v`?jd(t):Md(t)},Fd=function(e,t){return e===`h`&&t===`rtl`?-1:1},Id=function(e,t,n,r,i){var a=Fd(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=Pd(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&Nd(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},Ld=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Rd=function(e){return[e.deltaX,e.deltaY]},zd=function(e){return e&&`current`in e?e.current:e},Bd=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Vd=function(e){return`
|
|
136
|
+
.block-interactivity-${e} {pointer-events: none;}
|
|
137
|
+
.allow-interactivity-${e} {pointer-events: all;}
|
|
138
|
+
`},Hd=0,Ud=[];function Wd(e){var t=z.useRef([]),n=z.useRef([0,0]),r=z.useRef(),i=z.useState(Hd++)[0],a=z.useState(pd)[0],o=z.useRef(e);z.useEffect(function(){o.current=e},[e]),z.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=Hu([e.lockRef.current],(e.shards||[]).map(zd),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=z.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=Ld(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=Ad(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=Ad(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return Id(h,t,e,h===`h`?s:c,!0)},[]),c=z.useCallback(function(e){var n=e;if(!(!Ud.length||Ud[Ud.length-1]!==a)){var r=`deltaY`in n?Rd(n):Ld(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Bd(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(zd).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=z.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:Gd(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=z.useCallback(function(e){n.current=Ld(e),r.current=void 0},[]),d=z.useCallback(function(t){l(t.type,Rd(t),t.target,s(t,e.lockRef.current))},[]),f=z.useCallback(function(t){l(t.type,Ld(t),t.target,s(t,e.lockRef.current))},[]);z.useEffect(function(){return Ud.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,Td),document.addEventListener(`touchmove`,c,Td),document.addEventListener(`touchstart`,u,Td),function(){Ud=Ud.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,Td),document.removeEventListener(`touchmove`,c,Td),document.removeEventListener(`touchstart`,u,Td)}},[]);var p=e.removeScrollBar,m=e.inert;return z.createElement(z.Fragment,null,m?z.createElement(a,{styles:Vd(i)}):null,p?z.createElement(Sd,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Gd(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Kd=nd(rd,Wd),qd=z.forwardRef(function(e,t){return z.createElement(ad,Bu({},e,{ref:t,sideCar:Kd}))});qd.classNames=ad.classNames;var Jd=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Yd=new WeakMap,Xd=new WeakMap,Zd={},Qd=0,$d=function(e){return e&&(e.host||$d(e.parentNode))},ef=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=$d(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},tf=function(e,t,n,r){var i=ef(t,Array.isArray(e)?e:[e]);Zd[n]||(Zd[n]=new WeakMap);var a=Zd[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(Yd.get(e)||0)+1,l=(a.get(e)||0)+1;Yd.set(e,c),a.set(e,l),o.push(e),c===1&&i&&Xd.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),Qd++,function(){o.forEach(function(e){var t=Yd.get(e)-1,i=a.get(e)-1;Yd.set(e,t),a.set(e,i),t||(Xd.has(e)||e.removeAttribute(r),Xd.delete(e)),i||e.removeAttribute(n)}),Qd--,Qd||(Yd=new WeakMap,Yd=new WeakMap,Xd=new WeakMap,Zd={})}},nf=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||Jd(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),tf(r,i,n,`aria-hidden`)):function(){return null}},rf=Object.defineProperty,af=(e,t)=>rf(e,`name`,{value:t,configurable:!0}),of=`Dialog`,[sf,cf]=_l(of),[lf,uf]=sf(of),df=af(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=z.useRef(null),c=z.useRef(null),[l,u]=Nl({prop:r,defaultProp:i??!1,onChange:a,caller:of}),[d,f]=z.useState(0),[p,m]=z.useState(0);return(0,K.jsx)(lf,{scope:t,triggerRef:s,contentRef:c,contentId:wl(),titleId:wl(),descriptionId:wl(),titlePresent:d>0,descriptionPresent:p>0,setTitleCount:f,setDescriptionCount:m,open:l,onOpenChange:u,onOpenToggle:z.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})},`Dialog`),ff=`DialogTrigger`,pf=z.forwardRef(af(function(e,t){let{__scopeDialog:n,...r}=e,i=uf(ff,n),a=_(t,i.triggerRef);return(0,K.jsx)(Q.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":Nf(i.open),...r,ref:a,onClick:ll(e.onClick,i.onOpenToggle)})},`DialogTrigger`)),mf=`DialogPortal`,[hf,gf]=sf(mf,{forceMount:void 0}),_f=af(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=uf(mf,t);return(0,K.jsx)(hf,{scope:t,forceMount:n,children:z.Children.map(r,e=>(0,K.jsx)(Du,{present:n||a.open,children:(0,K.jsx)(Cu,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),vf=`DialogOverlay`,yf=z.forwardRef(af(function(e,t){let n=gf(vf,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=uf(vf,e.__scopeDialog);return a.modal?(0,K.jsx)(Du,{present:r||a.open,children:(0,K.jsx)(xf,{...i,ref:t})}):null},`DialogOverlay`)),bf=S(`DialogOverlay.RemoveScroll`),xf=z.forwardRef(af(function(e,t){let{__scopeDialog:n,...r}=e,i=uf(vf,n),a=Zl(),o=_(t,a);return(0,K.jsx)(qd,{as:bf,allowPinchZoom:!0,shards:[i.contentRef],children:(0,K.jsx)(Q.div,{"data-state":Nf(i.open),...r,ref:o,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),Sf=`DialogContent`,Cf=z.forwardRef(af(function(e,t){let n=gf(Sf,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=uf(Sf,e.__scopeDialog);return(0,K.jsx)(Du,{present:r||a.open,children:a.modal?(0,K.jsx)(wf,{...i,ref:t}):(0,K.jsx)(Tf,{...i,ref:t})})},`DialogContent`)),wf=z.forwardRef(af(function(e,t){let n=uf(Sf,e.__scopeDialog),r=z.useRef(null),i=_(t,n.contentRef,r);return z.useEffect(()=>{let e=r.current;if(e)return nf(e)},[]),(0,K.jsx)(Ef,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:ll(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:ll(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:ll(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),Tf=z.forwardRef(af(function(e,t){let n=uf(Sf,e.__scopeDialog),r=z.useRef(!1),i=z.useRef(!1);return(0,K.jsx)(Ef,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`DialogContentNonModal`)),Ef=z.forwardRef(af(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=uf(Sf,n);return Ru(),(0,K.jsx)(K.Fragment,{children:(0,K.jsx)(uu,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,K.jsx)(Yl,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionPresent?s.descriptionId:void 0,"aria-labelledby":s.titlePresent?s.titleId:void 0,"data-state":Nf(s.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>s.onOpenChange(!1)})})})},`DialogContentImpl`)),Df=`DialogTitle`,Of=z.forwardRef(af(function(e,t){let{__scopeDialog:n,...r}=e,i=uf(Df,n),{setTitleCount:a}=i;return yl(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,K.jsx)(Q.h2,{id:i.titleId,...r,ref:t})},`DialogTitle`)),kf=`DialogDescription`,Af=z.forwardRef(af(function(e,t){let{__scopeDialog:n,...r}=e,i=uf(kf,n),{setDescriptionCount:a}=i;return yl(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,K.jsx)(Q.p,{id:i.descriptionId,...r,ref:t})},`DialogDescription`)),jf=`DialogClose`,Mf=z.forwardRef(af(function(e,t){let{__scopeDialog:n,...r}=e,i=uf(jf,n);return(0,K.jsx)(Q.button,{type:`button`,...r,ref:t,onClick:ll(e.onClick,()=>i.onOpenChange(!1))})},`DialogClose`));function Nf(e){return e?`open`:`closed`}af(Nf,`getState`);var Pf=E(`fixed z-lt-modal w-full overflow-y-auto bg-lt-bg p-6 shadow-lt-lg`,{variants:{placement:{center:`left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 rounded-lt border border-lt-border data-[state=open]:animate-lt-dialog-in data-[state=closed]:animate-lt-dialog-out`,start:`inset-y-0 start-0 border-e border-lt-border data-[state=open]:animate-lt-sheet-in-start data-[state=closed]:animate-lt-sheet-out-start`,end:`inset-y-0 end-0 border-s border-lt-border data-[state=open]:animate-lt-sheet-in-end data-[state=closed]:animate-lt-sheet-out-end`},width:{sm:`max-w-sm`,md:`max-w-md`,lg:`max-w-lg`,xl:`max-w-xl`,"2xl":`max-w-2xl`,"3xl":`max-w-3xl`},height:{sm:``,md:``,lg:``,xl:``,"2xl":``,"3xl":``}},compoundVariants:[{placement:`center`,height:`sm`,class:`max-h-[min(480px,calc(100vh-2rem))]`},{placement:`center`,height:`md`,class:`max-h-[min(600px,calc(100vh-2rem))]`},{placement:`center`,height:`lg`,class:`max-h-[min(680px,calc(100vh-2rem))]`},{placement:`center`,height:`xl`,class:`max-h-[min(820px,calc(100vh-2rem))]`},{placement:`center`,height:`2xl`,class:`max-h-[min(920px,calc(100vh-2rem))]`},{placement:`center`,height:`3xl`,class:`max-h-[min(1040px,calc(100vh-2rem))]`}],defaultVariants:{placement:`center`,width:`lg`,height:`lg`}});function Ff(e){return(0,K.jsx)(df,{"data-slot":`dialog`,...e})}function If(e){return(0,K.jsx)(Mf,{"data-slot":`dialog-close`,...e})}function Lf(e){return(0,K.jsx)(pf,{"data-slot":`dialog-trigger`,...e})}function Rf({className:e,...t}){return(0,K.jsx)(Of,{className:k(`text-lg font-semibold leading-none tracking-tight`,e),"data-slot":`dialog-title`,...t})}function zf({className:e,...t}){return(0,K.jsx)(Af,{className:k(`text-sm text-lt-muted-fg`,e),"data-slot":`dialog-description`,...t})}function Bf({children:e,className:t,placement:n=`center`,width:r=`lg`,height:i=`lg`,...a}){return(0,K.jsxs)(_f,{children:[(0,K.jsx)(yf,{className:`fixed inset-0 z-lt-overlay bg-lt-overlay data-[state=open]:animate-lt-fade-in data-[state=closed]:animate-lt-fade-out`,"data-slot":`dialog-overlay`}),(0,K.jsx)(Cf,{className:k(Pf({placement:n,width:r,height:i}),t),"data-slot":`dialog-content`,...a,children:e})]})}function Vf({closeLabel:e,description:t,title:n}){return(0,K.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,K.jsxs)(`div`,{className:`grid gap-2`,children:[(0,K.jsx)(Rf,{children:n}),t?(0,K.jsx)(zf,{children:t}):null]}),(0,K.jsx)(If,{asChild:!0,children:(0,K.jsx)(cs,{"aria-label":e,"data-test":`dialog-close`,size:`icon`,emphasis:`ghost`,children:(0,K.jsx)(M,{name:`x`,"aria-hidden":`true`,className:`size-lt-icon-md`})})})]})}function Hf({open:e,title:t,description:n,confirmLabel:r,cancelLabel:i=`Cancel`,confirmVariant:a=null,confirmEmphasis:o=null,processing:s=!1,confirmDisabled:c=!1,onConfirm:l,onCancel:u,onExited:d}){let f=e=>{s&&e.preventDefault()};return(0,K.jsx)(Ff,{open:e,onOpenChange:e=>{e||u()},children:(0,K.jsxs)(Bf,{...n?{}:{"aria-describedby":void 0},width:`md`,onCloseAutoFocus:d,onEscapeKeyDown:f,onInteractOutside:f,children:[(0,K.jsxs)(`div`,{className:`grid gap-2`,children:[(0,K.jsx)(Rf,{children:t}),n&&(0,K.jsx)(zf,{children:n})]}),(0,K.jsxs)(`div`,{className:`mt-6 flex justify-end gap-2`,children:[(0,K.jsx)(cs,{type:`button`,emphasis:`outline`,"data-test":`confirm-cancel`,disabled:s,onClick:u,children:i}),(0,K.jsxs)(cs,{type:`button`,emphasis:o,variant:a,"data-test":`confirm-accept`,disabled:s||c,onClick:l,children:[s&&(0,K.jsx)($s,{}),r]})]})]})})}function Uf(e){return e.props.label??re(`lattice`,`common.action.run`,`Run action`)}function Wf(e){let t=Uf(e),n=e.props.confirmation;return{title:n?.title??t,description:n?.description??void 0,confirmLabel:n?.confirmLabel??t,cancelLabel:n?.cancelLabel??re(`lattice`,`common.cancel`,`Cancel`)}}function Gf({node:e,extraData:t,onSuccess:n}){let r=el();if(!r)throw Error(Qc);let i=e.props.endpoint??``,a=e.props.ref??``,o=e.props.method??`post`,{variant:s,emphasis:c}=e.props,l=Wf(e),[u,d]=(0,z.useState)(!1),f=zc(),p=async()=>{if(!i)return;if(o===`get`){W.visit(i,{headers:hc(a)}),r.onOpenChange(!1);return}d(!0);let e=await al(()=>Ec(i,{method:o,ref:a,body:t?JSON.stringify(t):void 0,throwOnError:!1}),f);d(!1),e&&(r.onOpenChange(!1),n?.())};return(0,K.jsx)(Hf,{open:r.open,onExited:r.onExited,title:l.title,description:l.description,confirmLabel:l.confirmLabel,cancelLabel:l.cancelLabel,confirmVariant:s,confirmEmphasis:c,processing:u,confirmDisabled:!i,onConfirm:()=>void p(),onCancel:()=>r.onOpenChange(!1)})}function Kf({className:e,...t}){return(0,K.jsx)(`div`,{"aria-hidden":`true`,className:k(`animate-pulse rounded-lt-sm bg-lt-muted`,e),"data-slot":`skeleton`,...t})}var qf=(0,z.createContext)({action:`#`,clearErrors:()=>{},componentId:void 0,componentRef:``,errors:{},fieldIdPrefix:void 0,fieldLabels:{},precognitive:!1,processing:!1,touch:()=>{},validate:()=>{},validateFields:()=>{},validating:!1});function Jf({children:e,value:t}){return(0,K.jsx)(qf.Provider,{value:t,children:e})}function Yf(){return(0,z.useContext)(qf)}var Xf=(0,z.createContext)(null),Zf=Xf.Provider;function Qf(){return(0,z.useContext)(Xf)}var $f=new Set([`field.builder`,`field.repeater`]);function ep(e){return e.props}function tp(e,t){for(let n of e??[])t(ep(n),n),tp(n.schema,t)}function np(e){return e.split(`.`).filter(e=>e!==``)}function rp(e,...t){let n=t.map(String).filter(e=>e!==``);return[e??``,...n].filter(e=>e!==``).join(`.`)}function ip(e){let[t,...n]=np(e);return n.reduce((e,t)=>`${e}[${t}]`,t??``)}function ap(e,t){let n=e;for(let e of np(t)){if(n==null)return;n=n[e]}return n}function op(e){return e!==void 0&&/^\d+$/.test(e)?[]:{}}function sp(e,t,n){let r=np(t);if(r.length===0)return e;let i=(e,t)=>{let a=r[t],o=t===r.length-1,s=e&&typeof e==`object`?e:op(r[t+1]),c=Array.isArray(s)?[...s]:{...s};return c[a]=o?n:i(s[a],t+1),c};return i(e,0)}var cp=`rowId`;function lp(e){return e.rowId?e:{...e,[cp]:crypto.randomUUID()}}function up(e){return e.every(e=>!!e.rowId)?e:e.map(lp)}function dp(e,t){return Array.isArray(e)&&e.length>0?e.map(e=>e&&typeof e==`object`?{...e}:{}):Array.from({length:Math.max(0,t)},()=>({}))}function fp(e){return[...e,{}]}function pp(e,t){return e.filter((e,n)=>n!==t)}function mp(e,t){let n=e[t];if(!n)return e;let{[cp]:r,...i}=n;return[...e.slice(0,t+1),lp(i),...e.slice(t+1)]}function hp(e,t,n){let r=[...e],[i]=r.splice(t,1);return r.splice(n,0,i),r}function gp(e){return typeof e.rowId==`string`?e[cp]:null}function _p(e,t,n,r){return`${e}.${t??String(n)}.${r}`}var vp=(0,z.createContext)(null);function yp(e,t){if(!t)return e;let n=e.startsWith(`${t.path}.`)?e.slice(t.path.length+1):e;return rp(t.identityPath,n)}function bp({base:e,index:t,row:n,onChange:r,children:i}){let a=(0,z.useContext)(vp),o=(0,z.useMemo)(()=>{let i=n??{},o=gp(i),s=rp(e,t),c=yp(e,a),l=rp(c,o??t);return{row:i,rowId:o,path:s,values:a?{...a.values,...i}:i,identityPath:l,getValue:e=>ap(i,e),setValue:r,scopedName:e=>ip(rp(s,e)),errorKey:e=>rp(s,e),overrideKey:e=>_p(c,o,t,e)}},[e,t,n,r,a]);return(0,K.jsx)(vp.Provider,{value:o,children:i})}function xp(){return(0,z.useContext)(vp)}var Sp=(0,z.createContext)({});function Cp({nodes:e,children:t}){return(0,K.jsx)(Sp.Provider,{value:e,children:t})}function wp(e){let t=(0,z.useContext)(Sp),n=ep(e).name??``,r=xp(),i=n&&r?r.errorKey(n):n;return i&&t[i]||n&&t[n]||e}var Tp={},Ep={},Dp=(0,z.createContext)(null),Op=(0,z.createContext)(()=>{});function kp(e,t){if(Object.is(e,t))return!0;if(!e||!t||typeof e!=`object`||typeof t!=`object`)return!1;if(Array.isArray(e)||Array.isArray(t))return Array.isArray(e)&&Array.isArray(t)&&e.length===t.length&&e.every((e,n)=>kp(e,t[n]));let n=Object.entries(e),r=t;return n.length===Object.keys(r).length&&n.every(([e,t])=>kp(t,r[e]))}function Ap(e){return e.split(`.`).filter(e=>e!==``).join(`.`)}function jp(e,t){return e===``||t===``||e===t||e.startsWith(`${t}.`)||t.startsWith(`${e}.`)}function Mp(e){let t=e,n=e,r=new Set,i=new Map,a=new Map,o=e=>{for(let e of r)e();let t=Ap(e);for(let[e,n]of i)if(jp(e,t))for(let e of n)e()},s=(e,t)=>{Object.is(n,e)||(n=e,a.clear(),o(t))},c=(e,t)=>{let n=Ap(e),r=i.get(n)??new Set;return r.add(t),i.set(n,r),()=>{r.delete(t),r.size===0&&i.delete(n)}};return{getPathSnapshot:e=>ap(n,e),getPathsSnapshot:e=>{if(e.length===0)return Ep;let t=e.map(Ap),r=JSON.stringify(e),i=t.map(e=>ap(n,e)),o=a.get(r);if(o&&o.values.length===i.length&&i.every((e,t)=>Object.is(e,o.values[t])))return o.snapshot;let s=Object.fromEntries(e.map((e,t)=>[e,i[t]]));return a.set(r,{snapshot:s,values:i}),s},getSnapshot:()=>n,replaceInitial:e=>{kp(t,e)||(t=e,s(e,``))},reset:e=>{if(e===void 0){s(t,``);return}let r=e.reduce((e,n)=>sp(e,n,ap(t,n)),n);s(r,``)},setValue:(e,t)=>{let r=ap(n,e),i=typeof t==`function`?t(r):t;Object.is(r,i)||s(sp(n,e,i),e)},subscribe:e=>(r.add(e),()=>r.delete(e)),subscribePath:c,subscribePaths:(e,t)=>{let n=Array.from(new Set(e.map(Ap))).map(e=>c(e,t));return()=>{for(let e of n)e()}}}}var Np=Mp(Tp);function Pp({initial:e,children:t}){let n=(0,z.useRef)(null);return n.current===null&&(n.current=Mp(e)),(0,z.useEffect)(()=>{n.current?.replaceInitial(e)},[e]),(0,K.jsx)(Dp.Provider,{value:n.current,children:(0,K.jsx)(Op.Provider,{value:n.current.setValue,children:t})})}function Fp(){return(0,z.useContext)(Dp)??Np}function Ip(){let e=Fp();return(0,z.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot)}function Lp(e){let t=Fp(),n=(0,z.useCallback)(n=>t.subscribePath(e,n),[e,t]),r=(0,z.useCallback)(()=>t.getPathSnapshot(e),[e,t]);return(0,z.useSyncExternalStore)(n,r,r)}function Rp(e){let t=Fp(),n=JSON.stringify(e),r=(0,z.useMemo)(()=>JSON.parse(n),[n]),i=(0,z.useCallback)(e=>t.subscribePaths(r,e),[r,t]),a=(0,z.useCallback)(()=>t.getPathsSnapshot(r),[r,t]);return(0,z.useSyncExternalStore)(i,a,a)}function zp(){return(0,z.useContext)(Op)}function Bp(){let e=Fp();return(0,z.useCallback)(t=>e.reset(t),[e])}var Vp=(0,z.createContext)(null);function Hp({children:e,value:t}){return(0,z.createElement)(Vp.Provider,{value:t},e)}function Up(){let e=(0,z.useContext)(Vp),{clearErrors:t,precognitive:n,validate:r}=Yf(),i=zp(),a=xp(),o=Qf();if(e)return e;let s=(e,t)=>{a?a.setValue(e,t):i(e,t),o?.markUserEdit(a?a.overrideKey(e):e)},c=e=>a?a.errorKey(e):e;return{commit(e,i){s(e,i),n?r(c(e)):t(c(e))},change(e,n){s(e,n),t(c(e))},blur(e){n&&r(c(e))}}}var Wp=(0,z.createContext)(!1);function Gp({children:e}){return(0,K.jsx)(Wp.Provider,{value:!0,children:e})}function Kp(){return(0,z.useContext)(Wp)}var qp=typeof window>`u`?z.useEffect:z.useLayoutEffect;function Jp(e,t,n,r){return Ec(e,{method:`POST`,ref:t,signal:r,body:JSON.stringify(n),throwOnError:!1}).then(e=>e.ok?e.json():null)}function Yp(e){let t=e.props.templates;return t?.length?t:void 0}function Xp(e,t){let n=Yp(e);return n?n.find(e=>e.type===t.type)?.schema??[]:e.schema??[]}function Zp(e,t){return e.startsWith(`@`)?e.slice(1):t===null?e:rp(t,e)}function Qp(e,t,n,r=0,i={}){let a=ep(e);if(!a.editablePrefill||!a.name)return null;let o=gp(i);return{path:t===null?a.name:rp(t,a.name),overrideKey:n===null?a.name:_p(n,o,r,a.name),resetOn:(a.prefillResetOn??[]).map(e=>Zp(e,t)),refreshOn:(a.prefillRefreshOn??[]).map(e=>Zp(e,t))}}function $p(e,t){let n=[],r=(e,i=null,a=null,o=null,s=0,c={})=>{for(let l of e??[]){if($f.has(l.type)){let e=ep(l).name;if(e){let n=rp(i,e),o=rp(a,e),s=ap(t,n);(Array.isArray(s)?s:[]).forEach((e,t)=>{r(Xp(l,e),rp(n,t),rp(o,gp(e)??t),o,t,e)})}continue}let e=Qp(l,i,o,s,c);e&&n.push(e),r(l.schema,i,a,o,s,c)}};return r(e),n}function em(e,t){let n=new Map(e.targets.map(e=>[e.overrideKey,e]));return t.targets.filter(r=>{let i=n.get(r.overrideKey);return r.resetOn.some((n,r)=>{let a=i?.resetOn[r]??n;return!Object.is(ap(e.values,a),ap(t.values,n))})}).map(e=>e.overrideKey)}function tm(e,t){return e.filter(e=>{let n=ap(t,e.path);return n!=null&&n!==``}).map(e=>e.overrideKey)}function nm(e,t){let n=new Set(t.map(e=>e.overrideKey));return new Set([...e].filter(e=>n.has(e)))}function rm(e,t,n){let r=Ip(),i=zp(),[a,o]=(0,z.useState)({}),s=(0,z.useMemo)(()=>$p(n,r),[n,r]),c=(0,z.useRef)(new Set),l=(0,z.useRef)(new Set),u=(0,z.useRef)(r),d=(0,z.useRef)(s),f=(0,z.useRef)(s);f.current=s,qp(()=>{let e=new Set(s.map(e=>e.overrideKey));l.current=new Set([...l.current].filter(t=>e.has(t)));let t=s.filter(e=>!l.current.has(e.overrideKey));for(let e of tm(t,r))c.current.add(e);for(let e of t)l.current.add(e.overrideKey)},[s,r]);let p=(0,z.useCallback)(e=>{c.current.add(e)},[]),m=(0,z.useMemo)(()=>{let e=new Set,t=!1;return tp(n,n=>{if(Array.isArray(n.dependsOnKeys))for(let t of n.dependsOnKeys)e.add(String(t));n.dependsOnAny&&(t=!0)}),{keys:[...e],any:t}},[n]),h=(0,z.useMemo)(()=>{let e=new Set(m.keys);for(let t of s){for(let n of t.resetOn)e.add(n);for(let n of t.refreshOn)e.add(n)}return[...e]},[m.keys,s]),g=m.any?r:JSON.stringify(h.map(e=>ap(r,e)));return(0,z.useEffect)(()=>{if(h.length===0&&!m.any)return;let n=u.current;u.current=r;for(let e of em({targets:d.current,values:n},{targets:f.current,values:r}))c.current.delete(e);d.current=f.current,c.current=nm(c.current,f.current);let a=new AbortController,s=window.setTimeout(()=>{Jp(e,t,{_sub:`resolve`,...r},a.signal).then(e=>{if(!e)return;for(let[t,n]of Object.entries(e.values??{}))i(t,n);let t=new Map(f.current.map(e=>[e.path,e]));for(let[n,r]of Object.entries(e.prefill??{})){let e=t.get(n);e&&!c.current.has(e.overrideKey)&&i(n,r)}e.fields&&o(e.fields)}).catch(()=>{})},250);return()=>{window.clearTimeout(s),a.abort()}},[g,e,t,m.any,i]),{nodes:a,markUserEdit:p}}function im(e){let t={labels:{},values:{}};return tp(e,e=>{e.name&&(e.label&&(t.labels[e.name]=e.label),e.value!==void 0&&(t.values[e.name]=e.value))}),t}function am(e,t){return e===t||e.startsWith(`${t}.`)}function om(e){let t={};for(let[n,r]of Object.entries(e??{}))t[n]=Array.isArray(r)?r[0]:r;return t}function sm(e,t){let n=(0,z.useRef)(e);n.current=e;let r=(0,z.useRef)(null),i=(0,z.useCallback)(()=>{r.current!==null&&(clearTimeout(r.current),r.current=null)},[]);return(0,z.useEffect)(()=>i,[i]),(0,z.useMemo)(()=>{let e=(...e)=>{i(),r.current=setTimeout(()=>{r.current=null,n.current(...e)},t)};return e.cancel=i,e},[i,t])}function cm(e,t,n,r){let[i,a]=(0,z.useState)(null);return(0,z.useEffect)(()=>{if(!n){a(null);return}let i=new AbortController;return Ec(e,{body:JSON.stringify({_sub:`schema`,...r}),ref:t,method:`POST`,signal:i.signal,throwOnError:!1}).then(e=>e.ok?e.json():null).then(e=>a(e)).catch(()=>{}),()=>i.abort()},[n,e,t]),i}function lm(){return(0,K.jsxs)(`div`,{className:`space-y-4`,"data-lattice-action-form-loading":!0,children:[(0,K.jsx)(Kf,{className:`h-4 w-24`}),(0,K.jsx)(Kf,{className:`h-10 w-full`}),(0,K.jsx)(Kf,{className:`h-10 w-full`})]})}function um({cancelLabel:e,componentRef:t,endpoint:n,extraData:r,fieldLabels:i,formNode:a,method:o,onClose:s,onSuccess:c,precognitive:l,submitLabel:u}){let d=Ip(),f=(0,z.useRef)(d);f.current=d;let p=(0,z.useRef)(r);p.current=r;let{nodes:m,markUserEdit:h}=rm(n,t,a.schema),g=zc(),[_,v]=(0,z.useState)({}),[y,b]=(0,z.useState)(!1),[x,S]=(0,z.useState)(!1),C=(0,z.useCallback)(e=>Ec(n,{body:JSON.stringify({...f.current,...p.current}),method:o,ref:t,headers:e,throwOnError:!1}),[t,n,o]),w=(0,z.useCallback)(e=>{v(t=>t[e]===void 0?t:{...t,[e]:void 0})},[]),T=sm(e=>{C({Precognition:`true`,"Precognition-Validate-Only":e}).then(async t=>{if(t.status===422){let e=await t.json();v(t=>({...t,...om(e.errors)}));return}w(e)}).catch(()=>{})},250),E=(0,z.useCallback)(e=>{l&&T(e)},[l,T]),D=(0,z.useCallback)(()=>{},[]),O=(0,z.useCallback)((e,t)=>{S(!0),C({Precognition:`true`,"Precognition-Validate-Only":e.join(`,`)}).then(async n=>{if(n.status===422){let e=await n.json();v(t=>({...t,...om(e.errors)})),t?.onValidationError?.();return}if(!n.ok){t?.onValidationError?.();return}let r=e.filter(e=>!e.includes(`*`));v(e=>Object.fromEntries(Object.entries(e).filter(([e])=>!r.some(t=>am(e,t))))),t?.onSuccess?.()}).catch(()=>t?.onValidationError?.()).finally(()=>S(!1))},[C]),k=(0,z.useCallback)(()=>{b(!0),C().then(async e=>{let t=await e.json().catch(()=>({}));if(g(Lc(t.effects)),e.status===422&&t.errors){v(om(t.errors));return}e.ok&&c(t)}).catch(e=>Ic(e)).finally(()=>b(!1))},[g,c,C]),ee=(0,z.useMemo)(()=>({action:n,clearErrors:w,componentRef:t,errors:_,fieldLabels:i,precognitive:l,processing:y,touch:D,validate:E,validateFields:O,validating:x}),[w,t,n,_,i,l,y,D,E,O,x]);return(0,K.jsx)(Jf,{value:ee,children:(0,K.jsxs)(`form`,{className:`flex flex-col gap-6`,onSubmit:e=>{e.preventDefault(),k()},children:[(0,K.jsx)(Zf,{value:{markUserEdit:h},children:(0,K.jsx)(Cp,{nodes:m,children:(0,K.jsx)(Xc,{nodes:a.schema??[]})})}),(0,K.jsxs)(`div`,{className:`flex justify-end gap-3`,children:[(0,K.jsx)(cs,{"data-test":`action-form-cancel`,disabled:y,onClick:s,type:`button`,emphasis:`ghost`,children:e}),a.props?.submitButton!==!1&&(0,K.jsxs)(cs,{"data-test":`action-form-submit`,disabled:y,type:`submit`,children:[y&&(0,K.jsx)($s,{}),u]})]})]})})}function dm({formNode:e,...t}){let n=!!e.props?.precognitive,{labels:r,values:i}=(0,z.useMemo)(()=>{let{labels:t,values:n}=im(e.schema);return{labels:t,values:{...n,...e.props?.state}}},[e]);return(0,K.jsx)(Pp,{initial:i,children:(0,K.jsx)(um,{fieldLabels:r,formNode:e,precognitive:n,...t})})}function fm({description:e,formNode:t,onClose:n,onExited:r,open:i,placement:a,title:o,width:s,...c}){let{t:l}=P(`lattice`);return(0,K.jsx)(Ff,{open:i,onOpenChange:e=>{e||n()},children:(0,K.jsxs)(Bf,{...e?{}:{"aria-describedby":void 0},onCloseAutoFocus:r,placement:a,width:s,children:[(0,K.jsx)(Vf,{closeLabel:l(`common.close`,`Close`),description:e,title:o}),(0,K.jsx)(`div`,{className:`mt-6`,children:t?(0,K.jsx)(dm,{formNode:t,onClose:n,...c}):(0,K.jsx)(lm,{})})]})})}function pm({node:e,extraData:t,onSuccess:n}){let r=el();if(!r)throw Error(Qc);let i=e.props.endpoint??``,a=e.props.ref??``,o=e.props.method??`post`,s=e.props.lazyForm===!0,c=cm(i,a,s,t),l=s?c:e.props.form,u=Wf(e);return(0,K.jsx)(fm,{open:r.open,onExited:r.onExited,cancelLabel:u.cancelLabel,componentRef:a,description:u.description,endpoint:i,extraData:t,formNode:l,method:o,onClose:()=>r.onOpenChange(!1),onSuccess:()=>{r.onOpenChange(!1),n?.()},placement:e.props.modalSide??`center`,submitLabel:u.confirmLabel,title:u.title,width:e.props.modalWidth??void 0})}function mm(e,t){let n=e.props.endpoint??``,r=e.props.ref??``,i=e.props.method??`post`,a=e.props.confirmation,o=e.props.form,s=e.props.lazyForm===!0,c=!!o||s,[l,u]=(0,z.useState)(!1),d=zc(),f=nl(),p=async()=>{if(!n)return;let e=t?.extraData?.();if(i===`get`){W.visit(n,{headers:hc(r)});return}u(!0);let a=await al(()=>Ec(n,{method:i,ref:r,body:e?JSON.stringify(e):void 0,throwOnError:!1}),d);u(!1),a&&t?.onSuccess?.()};return{processing:l,requestSubmit:()=>{if(c){if(!f)throw Error(Qc);f.open((0,K.jsx)(pm,{node:e,extraData:t?.extraData?.(),onSuccess:t?.onSuccess}));return}if(a){if(!f)throw Error(Qc);f.open((0,K.jsx)(Gf,{node:e,extraData:t?.extraData?.(),onSuccess:t?.onSuccess}));return}p()}}}var hm=({node:e})=>{let t=e.props.endpoint??``,n=e.props.icon,r=Uf(e),i=oc(),{variant:a,emphasis:o}=e.props,{processing:s,requestSubmit:c}=mm(e),l=e.key??tc(`action`,e.id);return(0,K.jsxs)(cs,{className:i?ic:void 0,"data-lattice-component":e.id,"data-test":l,disabled:s||!t,onClick:c,type:`button`,emphasis:i?`ghost`:o,variant:i?null:a,children:[s?(0,K.jsx)($s,{className:i?`size-lt-icon-sm`:void 0}):n&&(0,K.jsx)(is,{className:i?`size-lt-icon-sm`:`size-lt-icon-md`,icon:n}),r]})},gm=typeof document<`u`?z.useLayoutEffect:function(){};function _m(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!_m(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!_m(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function vm(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ym(e,t){let n=vm(e);return Math.round(t*n)/n}function bm(e){let t=z.useRef(e);return gm(()=>{t.current=e}),t}function xm(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=z.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=z.useState(r);_m(f,r)||p(r);let[m,h]=z.useState(null),[g,_]=z.useState(null),v=z.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=z.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=z.useRef(null),C=z.useRef(null),w=z.useRef(u),T=c!=null,E=bm(c),D=bm(i),O=bm(l),k=z.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),ee(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};A.current&&!_m(w.current,t)&&(w.current=t,lo.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);gm(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=z.useRef(!1);gm(()=>(A.current=!0,()=>{A.current=!1}),[]),gm(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,k);k()}},[b,x,k,E,T]);let j=z.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),M=z.useMemo(()=>({reference:b,floating:x}),[b,x]),N=z.useMemo(()=>{let e={position:n,left:0,top:0};if(!M.floating)return e;let t=ym(M.floating,u.x),r=ym(M.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...vm(M.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,M.floating,u.x,u.y]);return z.useMemo(()=>({...u,update:k,refs:j,elements:M,floatingStyles:N}),[u,k,j,M,N])}var Sm=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:j({element:r.current,padding:i}).fn(n):r?j({element:r,padding:i}).fn(n):{}}}},Cm=(e,t)=>{let n=A(e);return{name:n.name,fn:n.fn,options:[e,t]}},wm=(e,t)=>{let n=y(e);return{name:n.name,fn:n.fn,options:[e,t]}},Tm=(e,t)=>({fn:O(e).fn,options:[e,t]}),Em=(e,t)=>{let n=w(e);return{name:n.name,fn:n.fn,options:[e,t]}},Dm=(e,t)=>{let n=T(e);return{name:n.name,fn:n.fn,options:[e,t]}},Om=(e,t)=>{let n=v(e);return{name:n.name,fn:n.fn,options:[e,t]}},km=(e,t)=>{let n=Sm(e);return{name:n.name,fn:n.fn,options:[e,t]}},Am=Object.defineProperty,jm=(e,t)=>Am(e,`name`,{value:t,configurable:!0});function Mm(e){let[t,n]=z.useState(void 0);return yl(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}n(void 0)},[e]),t}jm(Mm,`useSize`);var Nm=Object.defineProperty,Pm=(e,t)=>Nm(e,`name`,{value:t,configurable:!0}),Fm=`Popper`,[Im,Lm]=_l(Fm),[Rm,zm]=Im(Fm),Bm=Pm(e=>{let{__scopePopper:t,children:n}=e,[r,i]=z.useState(null),[a,o]=z.useState(void 0);return(0,K.jsx)(Rm,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),Vm=`PopperAnchor`,Hm=z.forwardRef(Pm(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=zm(Vm,n),o=z.useRef(null),s=a.onAnchorChange,c=z.useCallback(e=>{o.current=e,e&&s(e)},[s]),l=_(t,c),u=z.useRef(null);z.useEffect(()=>{if(!r)return;let e=u.current;u.current=r.current,e!==u.current&&s(u.current)});let d=a.placementState&&Ym(a.placementState),f=d?.[0],p=d?.[1];return r?null:(0,K.jsx)(Q.div,{"data-radix-popper-side":f,"data-radix-popper-align":p,...i,ref:l})},`PopperAnchor`)),Um=`PopperContent`,[Wm,Gm]=Im(Um),Km=z.forwardRef(Pm(function(e,t){let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=`partial`,hideWhenDetached:f=!1,updatePositionStrategy:p=`optimized`,onPlaced:m,...h}=e,g=zm(Um,n),[v,y]=z.useState(null),b=_(t,y),[x,S]=z.useState(null),C=Mm(x),w=C?.width??0,T=C?.height??0,E=r+(a===`center`?``:`-`+a),O=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},k=Array.isArray(l)?l:[l],ee=k.length>0,A={padding:O,boundary:k.filter(qm),altBoundary:ee},{refs:j,floatingStyles:M,placement:N,isPositioned:P,middlewareData:F}=xm({strategy:`fixed`,placement:E,whileElementsMounted:Pm((...e)=>D(...e,{animationFrame:p===`always`}),`whileElementsMounted`),elements:{reference:g.anchor},middleware:[Cm({mainAxis:i+T,alignmentAxis:o}),c&&wm({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?Tm():void 0,...A}),c&&Em({...A}),Dm({...A,apply:Pm(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)},`apply`)}),x&&km({element:x,padding:s}),Jm({arrowWidth:w,arrowHeight:T}),f&&Om({strategy:`referenceHidden`,...A,boundary:ee?A.boundary:void 0})]}),I=g.setPlacementState;yl(()=>(I(N),()=>{I(void 0)}),[N,I]);let[te,ne]=Ym(N),re=Vl(m);yl(()=>{P&&re?.()},[P,re]);let L=F.arrow?.x,R=F.arrow?.y,ie=F.arrow?.centerOffset!==0,[ae,oe]=z.useState();return yl(()=>{v&&oe(window.getComputedStyle(v).zIndex)},[v]),(0,K.jsx)(`div`,{ref:j.setFloating,"data-radix-popper-content-wrapper":``,style:{...M,transform:P?M.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:ae,"--radix-popper-transform-origin":[F.transformOrigin?.x,F.transformOrigin?.y].join(` `),...F.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,K.jsx)(Wm,{scope:n,placedSide:te,placedAlign:ne,onArrowChange:S,arrowX:L,arrowY:R,shouldHideArrow:ie,children:(0,K.jsx)(Q.div,{"data-side":te,"data-align":ne,...h,ref:b,style:{...h.style,animation:P?h.style?.animation:`none`}})})})},`PopperContent`));function qm(e){return e!==null}Pm(qm,`isNotNull`);var Jm=Pm(e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=Ym(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}),`transformOrigin`);function Ym(e){let[t,n=`center`]=e.split(`-`);return[t,n]}Pm(Ym,`getSideAndAlignFromPlacement`);var Xm=Bm,Zm=Hm,Qm=Km,$m=Object.defineProperty,eh=(e,t)=>$m(e,`name`,{value:t,configurable:!0}),th=`Popover`,[nh,rh]=_l(th,[Lm]),ih=Lm(),[ah,oh]=nh(th),sh=eh(e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=ih(t),c=z.useRef(null),[l,u]=z.useState(!1),[d,f]=Nl({prop:r,defaultProp:i??!1,onChange:a,caller:th});return(0,K.jsx)(Xm,{...s,children:(0,K.jsx)(ah,{scope:t,contentId:wl(),triggerRef:c,open:d,onOpenChange:f,onOpenToggle:z.useCallback(()=>f(e=>!e),[f]),hasCustomAnchor:l,onCustomAnchorAdd:z.useCallback(()=>u(!0),[]),onCustomAnchorRemove:z.useCallback(()=>u(!1),[]),modal:o,children:n})})},`Popover`),ch=`PopoverTrigger`,lh=z.forwardRef(eh(function(e,t){let{__scopePopover:n,...r}=e,i=oh(ch,n),a=ih(n),o=_(t,i.triggerRef),s=(0,K.jsx)(Q.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":Sh(i.open),...r,ref:o,onClick:ll(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,K.jsx)(Zm,{asChild:!0,...a,children:s})},`PopoverTrigger`)),uh=`PopoverPortal`,[dh,fh]=nh(uh,{forceMount:void 0}),ph=eh(e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=oh(uh,t);return(0,K.jsx)(dh,{scope:t,forceMount:n,children:(0,K.jsx)(Du,{present:n||a.open,children:(0,K.jsx)(Cu,{asChild:!0,container:i,children:r})})})},`PopoverPortal`),mh=`PopoverContent`,hh=z.forwardRef(eh(function(e,t){let n=fh(mh,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=oh(mh,e.__scopePopover);return(0,K.jsx)(Du,{present:r||a.open,children:a.modal?(0,K.jsx)(_h,{...i,ref:t}):(0,K.jsx)(vh,{...i,ref:t})})},`PopoverContent`)),gh=S(`PopoverContent.RemoveScroll`),_h=z.forwardRef(eh(function(e,t){let n=oh(mh,e.__scopePopover),r=z.useRef(null),i=_(t,r),a=z.useRef(!1);return z.useEffect(()=>{let e=r.current;if(e)return nf(e)},[]),(0,K.jsx)(qd,{as:gh,allowPinchZoom:!0,children:(0,K.jsx)(yh,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ll(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:ll(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;a.current=r},{checkForDefaultPrevented:!1}),onFocusOutside:ll(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})},`PopoverContentModal`)),vh=z.forwardRef(eh(function(e,t){let n=oh(mh,e.__scopePopover),r=z.useRef(!1),i=z.useRef(!1);return(0,K.jsx)(yh,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`PopoverContentNonModal`)),yh=z.forwardRef(eh(function(e,t){let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...d}=e,f=oh(mh,n),p=ih(n);return Ru(),(0,K.jsx)(uu,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,K.jsx)(Yl,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>f.onOpenChange(!1),deferPointerDownOutside:!0,children:(0,K.jsx)(Qm,{"data-state":Sh(f.open),role:`dialog`,id:f.contentId,...p,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})},`PopoverContentImpl`)),bh=`PopoverClose`,xh=z.forwardRef(eh(function(e,t){let{__scopePopover:n,...r}=e,i=oh(bh,n);return(0,K.jsx)(Q.button,{type:`button`,...r,ref:t,onClick:ll(e.onClick,()=>i.onOpenChange(!1))})},`PopoverClose`));function Sh(e){return e?`open`:`closed`}eh(Sh,`getState`);var Ch=sh,wh=lh,Th=ph,Eh=hh,Dh=xh,Oh=`z-lt-popover rounded-lt-sm border border-lt-border bg-lt-popover text-lt-popover-fg shadow-lt-md`;function kh(e){return(0,K.jsx)(Ch,{"data-slot":`popover`,...e})}function Ah(e){return(0,K.jsx)(wh,{"data-slot":`popover-trigger`,...e})}function jh(e){return(0,K.jsx)(Dh,{"data-slot":`popover-close`,...e})}function Mh({align:e=`start`,className:t,sideOffset:n=4,...r}){return(0,K.jsx)(Th,{children:(0,K.jsx)(Eh,{align:e,className:k(Oh,t),"data-slot":`popover-content`,sideOffset:n,...r})})}function Nh(e){return(0,K.jsx)(kh,{...e})}function Ph(e){return(0,K.jsx)(Ah,{...e})}function Fh({className:e,...t}){return(0,K.jsx)(Mh,{className:k(`grid min-w-40 gap-1 p-1`,e),role:`menu`,...t})}function Ih({children:e,className:t,danger:n=!1,icon:r,...i}){return(0,K.jsx)(jh,{asChild:!0,children:(0,K.jsxs)(`button`,{type:`button`,role:`menuitem`,className:k(`flex w-full items-center gap-2 rounded-lt-sm px-3 py-1.5 text-left text-sm [&_svg]:size-lt-icon-sm`,n?`text-lt-danger hover:bg-lt-danger/10`:`hover:bg-lt-accent hover:text-lt-accent-fg`,t),...i,children:[r?(0,K.jsx)(M,{name:r,"aria-hidden":`true`}):null,e]})})}var Lh={components:{action:B(hm),"action.group":B(({children:e,node:t})=>{let{t:n}=P(`lattice`),r=t.props.label??n(`common.action-group.label`,`Actions`),i=t.props.orientation;return i?(0,K.jsx)(`div`,{"aria-label":r,className:k(`inline-flex max-w-full gap-1`,i===`vertical`?`flex-col items-stretch`:`flex-row flex-wrap items-center`),"data-lattice-component":t.id,role:`group`,children:e}):(0,K.jsx)(`div`,{className:`inline-flex`,"data-lattice-component":t.id,children:(0,K.jsxs)(Nh,{children:[(0,K.jsx)(Ph,{asChild:!0,children:(0,K.jsx)(cs,{"aria-label":r,className:`size-lt-control-sm text-lt-muted-fg shadow-none hover:text-lt-fg`,"data-test":J(t),size:`icon`,type:`button`,emphasis:`ghost`,children:(0,K.jsx)(M,{name:`more-horizontal`,"aria-hidden":`true`,className:`size-lt-icon-md`})})}),(0,K.jsx)(Fh,{align:`end`,"aria-label":r,className:`min-w-44 gap-0.5 p-1.5`,sideOffset:8,children:(0,K.jsx)(ac,{children:e})})]})})})},name:`lattice/action`};function Rh({message:e,className:t=``,...n}){return e?(0,K.jsx)(`p`,{...n,className:k(`text-sm text-lt-danger`,t),children:e}):null}function zh({content:e}){let{t}=P(I);return e?(0,K.jsxs)(kh,{children:[(0,K.jsx)(Ah,{type:`button`,"aria-label":t(`common.more-info`,`More information`),className:`ml-1 inline-flex rounded-lt-sm text-lt-muted-fg outline-none hover:text-lt-fg focus-visible:text-lt-fg focus-visible:ring-lt-ring/50 focus-visible:ring-[length:var(--lt-ring-width)]`,children:(0,K.jsx)(M,{name:`info`,className:`size-lt-icon-sm`})}),(0,K.jsx)(Mh,{align:`start`,className:`max-w-xs p-3 text-sm [&_a]:underline`,dangerouslySetInnerHTML:{__html:e}})]}):null}var Bh=Object.defineProperty,Vh=z.forwardRef(((e,t)=>Bh(e,`name`,{value:t,configurable:!0}))(function(e,t){return(0,K.jsx)(Q.label,{...e,ref:t,onMouseDown:t=>{t.target.closest(`button, input, select, textarea`)||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},`Label`));function Hh({className:e,...t}){return(0,K.jsx)(Vh,{"data-slot":`label`,className:k(`text-base leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:text-lt-disabled-fg peer-disabled:cursor-not-allowed peer-disabled:text-lt-disabled-fg`,e),...t})}function Uh({children:e,className:t,error:n,helperText:r,id:i,label:a,labelAction:o,required:s,tooltip:c,...l}){let u=Kp(),d=`${i}-label`,f=!u&&r?`${i}-helper`:void 0,p=n?`${i}-error`:void 0,m=e({id:i,"aria-describedby":[f,p].filter(Boolean).join(` `)||void 0,"aria-invalid":n?!0:void 0,"aria-labelledby":a?d:void 0,"aria-required":s||void 0});return u?(0,K.jsxs)(`div`,{...l,className:k(`grid gap-1`,t),children:[(0,K.jsx)(Hh,{id:d,htmlFor:i,className:`sr-only`,children:a}),m,(0,K.jsx)(Rh,{id:p,message:n})]}):(0,K.jsxs)(`div`,{...l,className:k(`grid gap-2`,t),children:[(0,K.jsxs)(`div`,{className:`flex min-h-5 items-center`,children:[(0,K.jsx)(Hh,{id:d,htmlFor:i,children:a}),s&&(0,K.jsx)(`span`,{"aria-hidden":`true`,className:`ml-0.5 leading-none text-lt-danger`,children:`*`}),(0,K.jsx)(zh,{content:c}),o&&(0,K.jsx)(`span`,{className:`ml-auto text-sm`,children:o})]}),m,r&&(0,K.jsx)(`p`,{id:f,className:`text-sm text-lt-muted-fg`,children:r}),(0,K.jsx)(Rh,{id:p,message:n})]})}function Wh(e){return e?(0,K.jsx)(Y,{node:e}):void 0}function Gh(e){let t=new Set;for(let n of[e?.visible,e?.required,e?.readOnly,e?.disabled])for(let e of n??[])t.add(e.field);return Array.from(t)}var Kh=new Set([`1`,`true`,`on`,`yes`]);function qh(e){return typeof e==`boolean`?e:typeof e==`number`?e===1:Kh.has(String(e).toLowerCase())}function Jh(e,t){return typeof t==`boolean`?qh(e)===t:String(e??``)===String(t??``)}function Yh(e,t){return(Array.isArray(t)?t:[t]).map(e=>String(e)).includes(String(e??``))}function Xh(e){return e==null||String(e).trim()===``}function Zh(e,t){let n=Date.parse(String(e)),r=Date.parse(String(t));return Number.isNaN(n)||Number.isNaN(r)?null:n===r?0:n<r?-1:1}function Qh(e){return!0}function $h(e,t,n){switch(e){case`eq`:return Jh(t,n);case`neq`:return!Jh(t,n);case`gt`:return Number(t)>Number(n);case`lt`:return Number(t)<Number(n);case`gte`:return Number(t)>=Number(n);case`lte`:return Number(t)<=Number(n);case`contains`:return String(t??``).includes(String(n??``));case`starts_with`:return String(t??``).startsWith(String(n??``));case`ends_with`:return String(t??``).endsWith(String(n??``));case`in`:return Yh(t,n);case`not_in`:return!Yh(t,n);case`before`:return Zh(t,n)===-1;case`after`:return Zh(t,n)===1;case`empty`:return Xh(t);case`filled`:return!Xh(t);default:return Qh(e)}}function eg(e,t){return e.every(e=>$h(e.operator,t[e.field],e.value))}function tg(e,t){return!!e?.some(e=>$h(e.operator,t[e.field],e.value))}function ng(e,t,n){let r=!e?.visible?.length||eg(e.visible,t);return{hidden:!!n.hidden||!r,required:!!n.required||tg(e?.required,t),readOnly:!!n.readOnly||tg(e?.readOnly,t),disabled:!!n.disabled||tg(e?.disabled,t)}}function rg(e){let t=xp(),n=ep(e),r=Rp((0,z.useMemo)(()=>Gh(n.conditions),[n.conditions])),i=t?{...r,...t.values}:r;return ng(n.conditions??void 0,i,{required:n.required??!1,readOnly:n.readOnly??!1,disabled:n.disabled??!1})}function ig({addLabel:e,options:t,onSelect:n}){return(0,K.jsxs)(Nh,{children:[(0,K.jsx)(Ph,{asChild:!0,children:(0,K.jsxs)(`button`,{type:`button`,"data-test":`builder-add`,className:`inline-flex items-center gap-1.5 self-start rounded-lt-sm border border-lt-border px-3 py-1.5 text-sm hover:bg-lt-accent [&_svg]:size-lt-icon-sm`,children:[(0,K.jsx)(M,{name:`plus`}),e]})}),(0,K.jsx)(Fh,{align:`start`,className:`min-w-[12rem]`,children:t.map(e=>(0,K.jsx)(Ih,{"data-test":`builder-add-${e.type}`,onClick:()=>n(e.type),children:e.label},e.type))})]})}var ag={duplicate:{key:`table.row-actions.duplicate`,fallback:`Duplicate`,icon:`copy`},remove:{key:`table.row-actions.remove`,fallback:`Remove`,icon:`trash-2`}};function og(e,t){return(e??sg(t.removable)).map(e=>cg(e,t)).filter(e=>e!==null)}function sg(e){return e?[{type:`remove`,key:`remove`,label:null,icon:null,danger:!0}]:[]}function cg(e,t){if(e.type===`duplicate`){let n=ag.duplicate;return{key:e.key,label:e.label??t.t(n.key,n.fallback),icon:e.icon??n.icon,danger:e.danger,onClick:()=>t.onDuplicate(t.index)}}if(e.type===`remove`){if(!t.removable)return null;let n=ag.remove;return{key:e.key,label:e.label??t.t(n.key,n.fallback),icon:e.icon??n.icon,danger:e.danger,onClick:()=>t.onRemove(t.index)}}return null}function lg(e){return e?`text-lt-danger hover:text-lt-danger [&_svg]:size-lt-icon-sm`:`text-lt-muted-fg hover:text-lt-fg [&_svg]:size-lt-icon-sm`}function ug({actions:e}){let{t}=P(`lattice`);if(e.length===0)return null;if(e.length===1){let t=e[0];return(0,K.jsx)(`button`,{type:`button`,"aria-label":t.label,"data-test":`row-action-${t.key}`,className:lg(t.danger),onClick:t.onClick,children:(0,K.jsx)(M,{name:t.icon})})}return(0,K.jsxs)(Nh,{children:[(0,K.jsx)(Ph,{asChild:!0,children:(0,K.jsx)(`button`,{type:`button`,"aria-label":t(`common.action-group.label`,`Actions`),"data-test":`row-actions-menu`,className:`text-lt-muted-fg hover:text-lt-fg [&_svg]:size-lt-icon-sm`,children:(0,K.jsx)(M,{name:`more-horizontal`})})}),(0,K.jsx)(Fh,{align:`end`,className:`min-w-[10rem]`,children:e.map(e=>(0,K.jsx)(Ih,{"data-test":`row-action-${e.key}`,danger:e.danger,icon:e.icon,onClick:e.onClick,children:e.label},e.key))})]})}function dg({path:e,rows:t,rowKey:n}){return(0,K.jsx)(K.Fragment,{children:t.map((t,r)=>(0,K.jsx)(`input`,{type:`hidden`,name:ip(rp(e,r,n)),value:String(t[n]??``)},String(t.rowId??r)))})}function fg({label:e,testId:t,onClick:n,children:r}){return(0,K.jsx)(`button`,{type:`button`,"aria-label":e,"data-test":t,className:`text-lt-muted-fg hover:text-lt-fg`,onClick:n,children:r})}var pg=(0,z.memo)(function({base:e,index:t,row:n,template:r,heading:i,reorderable:a,isFirst:o,isLast:s,removable:c,rowActions:l,onField:u,onRemove:d,onMove:f,onDuplicate:p}){let{t:m}=P(`lattice`);return(0,K.jsxs)(`div`,{"data-test":`repeater-${e}-row-${t}`,className:`rounded-lt border border-lt-border bg-lt-surface p-4`,children:[(0,K.jsxs)(`div`,{className:`mb-2 flex items-center justify-between`,children:[(0,K.jsx)(`span`,{className:`text-sm font-medium text-lt-muted-fg`,children:i}),(0,K.jsxs)(`div`,{className:`flex items-center gap-1 [&_svg]:size-lt-icon-sm`,children:[a&&!o&&(0,K.jsx)(fg,{label:`Move up`,testId:`repeater-${e}-up-${t}`,onClick:()=>f(t,-1),children:(0,K.jsx)(M,{name:`arrow-up`})}),a&&!s&&(0,K.jsx)(fg,{label:`Move down`,testId:`repeater-${e}-down-${t}`,onClick:()=>f(t,1),children:(0,K.jsx)(M,{name:`arrow-down`})}),(0,K.jsx)(ug,{actions:og(l,{index:t,removable:c,onRemove:d,onDuplicate:p,t:m})})]})]}),(0,K.jsx)(bp,{base:e,index:t,row:n,onChange:(e,n)=>u(t,e,n),children:(0,K.jsx)(`div`,{className:`flex flex-col gap-4`,children:r.map((e,t)=>(0,K.jsx)(Y,{node:e},Vc(e,t)))})})]})}),mg={xs:{track:`minmax(4rem, 0.35fr)`,minPx:64,defaultPx:96},sm:{track:`minmax(6rem, 0.5fr)`,minPx:96,defaultPx:128},md:{track:`minmax(8rem, 1fr)`,minPx:128,defaultPx:176},lg:{track:`minmax(12rem, 1.5fr)`,minPx:192,defaultPx:240},xl:{track:`minmax(16rem, 2fr)`,minPx:256,defaultPx:320}},hg=1024;function gg(e){return mg[e].track}function _g(e){return mg[e.width].minPx}function vg(e){return mg[e.width].defaultPx}function yg({columns:e,leadingTracks:t=[],trailingTracks:n=[],overrides:r={}}){return[...t,...e.map(e=>{let t=r[e.key];return t===void 0?gg(e.width):`${Math.min(hg,Math.max(_g(e),t))}px`}),...n].join(` `)}function bg(e,t,n={}){let{enabled:r=!0,parse:i,serialize:a}=n,o=()=>typeof t==`function`?t():t,[s,c]=(0,z.useState)(()=>{if(!r||typeof window>`u`)return o();let t;try{t=window.localStorage.getItem(e)}catch{return o()}if(t===null)return o();try{return i?i(t):JSON.parse(t)}catch{try{window.localStorage.removeItem(e)}catch{return o()}return o()}}),l=(0,z.useRef)(s);l.current=s;let u=(0,z.useRef)({enabled:r,key:e,serialize:a});return u.current={enabled:r,key:e,serialize:a},[s,(0,z.useCallback)(e=>{let t=typeof e==`function`?e(l.current):e;l.current=t,c(t);let{enabled:n,key:r,serialize:i}=u.current;if(!(!n||typeof window>`u`))try{let e=i?i(t):JSON.stringify(t);e===null?window.localStorage.removeItem(r):window.localStorage.setItem(r,e)}catch{return}},[])]}var xg=[];function Sg({columnGapPx:e=0,columns:t,enabled:n,leadingTracks:r=xg,showIndicator:i=!1,storageKey:a,trailingTracks:o=xg}){let s=(0,z.useMemo)(()=>t.map(e=>e.key),[t]),[c,l]=bg(a??``,{},{enabled:!!a,parse:e=>wg(e,t),serialize:e=>Tg(e,s)}),u=(0,z.useRef)(c),d=(0,z.useRef)(null),f=(0,z.useRef)(null),p=(0,z.useCallback)(e=>yg({columns:t,leadingTracks:r,trailingTracks:o,overrides:n?e:{}}),[t,n,r,o]),m=(0,z.useMemo)(()=>p(c),[c,p]),h=(0,z.useCallback)(e=>{let t=f.current;t&&(t.style.gridTemplateColumns=e,t.style.setProperty(`--lattice-table-columns`,e))},[]),g=(0,z.useCallback)(e=>{u.current=e,l(e),h(p(e))},[h,l,p]),_=(0,z.useCallback)((e,t,n,r)=>({...e,[t.key]:Math.min(r??1024,Math.max(_g(t),n))}),[]),v=(0,z.useCallback)((e,t,n)=>{g(_(u.current,e,t,n))},[g,_]),y=(0,z.useCallback)(e=>{let t={...u.current};delete t[e.key],g(t)},[g]),b=(0,z.useCallback)(()=>{g({})},[g]),x=n&&Object.values(c).some(e=>typeof e==`number`),S=(0,z.useCallback)(e=>u.current[e.key]??vg(e),[]);return{getResizeHandleProps:(0,z.useCallback)(a=>{let s=hg,c=_g(a),l=S(a),m=a.label??a.key,b=i?`after:bg-lt-border`:`after:bg-transparent`,x=n=>Cg({column:a,columnGapPx:e,columns:t,grid:f.current??n.parentElement?.parentElement,leadingTracks:r,trailingTracks:o}),C=(e,t)=>v(a,l+t,x(e)),w=(e,t)=>{let n=d.current;n?.key===a.key&&(d.current=null,n.overrides!==null&&g(n.overrides),t&&e.currentTarget.releasePointerCapture?.(e.pointerId))};return{"aria-label":`Resize ${m}`,"aria-orientation":`vertical`,"aria-valuemax":s,"aria-valuemin":c,"aria-valuenow":l,className:`absolute inset-y-0 right-0 hidden w-2 cursor-col-resize touch-none items-stretch justify-center md:flex after:my-1 after:w-px ${b} hover:after:bg-lt-border focus-visible:outline-none focus-visible:after:bg-lt-ring`,onDoubleClick:()=>y(a),onKeyDown:e=>{if(!n)return;let t=e.shiftKey?32:8;if(e.key===`ArrowLeft`&&(e.preventDefault(),C(e.currentTarget,-t)),e.key===`ArrowRight`&&(e.preventDefault(),C(e.currentTarget,t)),e.key===`Home`&&(e.preventDefault(),v(a,c)),e.key===`End`){e.preventDefault();let t=x(e.currentTarget);v(a,t,t)}(e.key===`Enter`||e.key===`Escape`)&&(e.preventDefault(),y(a))},onPointerDown:e=>{if(!n)return;let t=e.currentTarget.parentElement?.getBoundingClientRect().width??0;d.current={key:a.key,maxWidth:x(e.currentTarget),overrides:null,startWidth:t>0?t:l,startX:e.clientX},e.currentTarget.setPointerCapture?.(e.pointerId),e.preventDefault()},onPointerMove:e=>{let t=d.current;if(!n||t?.key!==a.key)return;let r=_(u.current,a,t.startWidth+e.clientX-t.startX,t.maxWidth);t.overrides=r,u.current=r,h(p(r))},onPointerUp:e=>{w(e,!0)},onPointerCancel:e=>{w(e,!0)},onLostPointerCapture:e=>{w(e,!1)},role:`separator`,tabIndex:0}},[e,t,S,n,r,h,g,_,y,v,i,p,o]),gridTemplateColumns:m,hasOverrides:x,resizeRootRef:f,resetColumns:b,resetColumnWidth:y}}function Cg({column:e,columnGapPx:t,columns:n,grid:r,leadingTracks:i,trailingTracks:a}){let o=r?.getBoundingClientRect().width??0;if(o<=0)return hg;let s=[...i,...a].reduce((e,t)=>e+Dg(t),0),c=n.reduce((t,n)=>n.key===e.key?t:t+_g(n),0),l=n.length+i.length+a.length,u=Math.max(0,l-1)*t,d=o-s-c-u;return Math.min(hg,Math.max(_g(e),d))}function wg(e,t){let n=JSON.parse(e)?.overrides;if(typeof n!=`object`||!n||Array.isArray(n))throw Error(`unexpected stored column widths shape`);let r=Eg(n,t);if(Object.keys(r).length===0)throw Error(`stored column widths hold no usable overrides`);return r}function Tg(e,t){let n={},r=new Set(t);for(let[t,i]of Object.entries(e))r.has(t)&&typeof i==`number`&&Number.isFinite(i)&&(n[t]=i);return Object.keys(n).length===0?null:JSON.stringify({overrides:n})}function Eg(e,t){let n={};for(let r of t){let t=e[r.key];typeof t!=`number`||!Number.isFinite(t)||(n[r.key]=Math.min(hg,Math.max(_g(r),t)))}return n}function Dg(e){let t=e.trim(),n=t.match(/^([0-9.]+)px$/);if(n)return Number.parseFloat(n[1]);let r=t.match(/^([0-9.]+)rem$/);return r?Number.parseFloat(r[1])*Og():0}function Og(){if(typeof window>`u`)return 16;let e=Number.parseFloat(window.getComputedStyle(document.documentElement).fontSize);return Number.isFinite(e)&&e>0?e:16}function kg(e,t){return typeof window>`u`||typeof window.matchMedia!=`function`?t:window.matchMedia(e).matches}function Ag(e,t=!1){let[n,r]=(0,z.useState)(()=>kg(e,t));return(0,z.useEffect)(()=>{if(typeof window>`u`||typeof window.matchMedia!=`function`)return;let t=window.matchMedia(e),n=()=>r(t.matches);return n(),t.addEventListener(`change`,n),()=>t.removeEventListener(`change`,n)},[e]),n}var jg=`3rem`,Mg=`3rem`,Ng=[jg],Pg=[Mg],Fg=`(min-width: 768px)`;function Ig(){return Ag(Fg,!0)}function Lg(e){return e.map(e=>{let t=e.props;return{name:String(t.name),label:String(t.label??t.name),columnWidth:t.columnWidth??`md`}})}var Rg=(0,z.memo)(function({base:e,index:t,row:n,template:r,span:i,isFirst:a,isLast:o,columnCount:s,flipKey:c,reorderable:l,removable:u,rowActions:d,onField:f,onMove:p,onRemove:m,onDuplicate:h,registerRow:g}){let{t:_}=P(`lattice`);return(0,K.jsxs)(`div`,{ref:e=>g?.(c,e),"data-flip-key":c,"data-test":`table-row-${e}-${t}`,className:`grid grid-cols-[var(--lattice-table-columns)] items-start gap-x-3`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-1 [&_svg]:size-lt-icon-sm`,children:[l&&!a&&(0,K.jsx)(fg,{label:`Move up`,testId:`table-${e}-up-${t}`,onClick:()=>p(t,-1),children:(0,K.jsx)(M,{name:`arrow-up`})}),l&&!o&&(0,K.jsx)(fg,{label:`Move down`,testId:`table-${e}-down-${t}`,onClick:()=>p(t,1),children:(0,K.jsx)(M,{name:`arrow-down`})})]}),(0,K.jsx)(bp,{base:e,index:t,row:n,onChange:(e,n)=>f(t,e,n),children:(0,K.jsx)(Gp,{children:i?(0,K.jsx)(`div`,{"data-test":`table-row-${e}-${t}-span`,className:`flex flex-col gap-2`,style:{gridColumn:`span ${s}`},children:r.map((e,t)=>(0,K.jsx)(Y,{node:e},Vc(e,t)))}):r.map((e,t)=>(0,K.jsx)(`div`,{children:(0,K.jsx)(Y,{node:e})},Vc(e,t)))})}),(0,K.jsx)(`div`,{className:`flex items-center`,children:(0,K.jsx)(ug,{actions:og(d,{index:t,removable:u,onRemove:m,onDuplicate:h,t:_})})})]})});function zg({base:e,columns:t,rows:n,reorderable:r,removable:i,rowActions:a,onField:o,onMove:s,onRemove:c,onDuplicate:l,registerRow:u,resizableColumns:d=!1,resizeIndicator:f=!1}){let{t:p}=P(`lattice`),m=Ig(),h=(0,z.useMemo)(()=>t.map(e=>({key:e.name,label:e.label,width:e.columnWidth})),[t]),{getResizeHandleProps:g,gridTemplateColumns:_,hasOverrides:v,resizeRootRef:y,resetColumns:b}=Sg({columns:h,enabled:d,columnGapPx:12,leadingTracks:Ng,showIndicator:f,storageKey:d?`lattice:table-columns:form:${e}`:void 0,trailingTracks:Pg});return m?(0,K.jsxs)(`div`,{className:`relative`,children:[v&&(0,K.jsx)(`button`,{"aria-label":p(`table.reset-column-widths`,`Reset column widths`),className:`absolute right-1 top-1 z-10 hidden rounded-lt-sm p-1 text-lt-muted-fg hover:text-lt-fg md:inline-flex`,"data-test":`table-reset-columns`,onClick:b,title:p(`table.reset-column-widths`,`Reset column widths`),type:`button`,children:(0,K.jsx)(M,{name:`rotate-ccw`,className:`size-lt-icon-sm`})}),(0,K.jsx)(`div`,{className:`overflow-x-auto`,children:(0,K.jsxs)(`div`,{ref:y,className:`flex min-w-max flex-col gap-2`,style:{"--lattice-table-columns":_},children:[(0,K.jsxs)(`div`,{className:`grid grid-cols-[var(--lattice-table-columns)] items-center gap-x-3`,children:[(0,K.jsx)(`div`,{}),t.map((e,t)=>(0,K.jsxs)(`div`,{className:`relative min-w-0 pr-3 text-xs font-medium text-lt-muted-fg`,children:[e.label,d&&(0,K.jsx)(`div`,{...g(h[t])})]},e.name)),(0,K.jsx)(`div`,{})]}),n.map(d=>(0,K.jsx)(Rg,{base:e,index:d.index,row:d.row,template:d.template,span:d.span,isFirst:d.index===0,isLast:d.index===n.length-1,columnCount:t.length,flipKey:d.key,reorderable:r,removable:i(d.index),rowActions:a,onField:o,onMove:s,onRemove:c,onDuplicate:l,registerRow:u},d.key))]})})]}):(0,K.jsx)(`div`,{className:`flex flex-col gap-3`,children:n.map(t=>(0,K.jsx)(`div`,{ref:e=>u?.(t.key,e),"data-flip-key":t.key,children:(0,K.jsx)(pg,{base:e,index:t.index,row:t.row,template:t.template,heading:t.heading??`#${t.index+1}`,reorderable:r,isFirst:t.index===0,isLast:t.index===n.length-1,removable:i(t.index),rowActions:a,onField:o,onRemove:c,onMove:s,onDuplicate:l})},t.key))})}var Bg=180;function Vg(){return typeof matchMedia==`function`&&matchMedia(`(prefers-reduced-motion: reduce)`).matches}function Hg(e){let t=(0,z.useRef)(new Map),n=(0,z.useRef)(new Map),r=(0,z.useCallback)((e,n)=>{n?t.current.set(e,n):t.current.delete(e)},[]);return qp(()=>{let e=[],r=new Map;return t.current.forEach((e,t)=>{e.style.transition=``,e.style.transform=``,r.set(t,e.getBoundingClientRect())}),Vg()||t.current.forEach((t,i)=>{let a=n.current.get(i),o=r.get(i);if(a&&o){let n=a.top-o.top;n&&(t.style.transform=`translateY(${n}px)`,e.push(requestAnimationFrame(()=>{t.style.transition=`transform ${Bg}ms ease-out`,t.style.transform=``})))}}),n.current=r,()=>{for(let t of e)cancelAnimationFrame(t)}},[e]),r}function Ug(e,t){let n=xp(),r=n?n.errorKey(e):e,i=zp(),a=Lp(r),o=Array.isArray(a)?a:dp(a,t),s=up(o);qp(()=>{s!==o&&i(r,s)},[o,s,i,r]);let c=(0,z.useCallback)(e=>{i(r,n=>e(Array.isArray(n)?n:dp(n,t)))},[i,r,t]);return{path:r,rows:s,onField:(0,z.useCallback)((e,t,n)=>c(r=>r.map((r,i)=>i===e?{...r,[t]:n}:r)),[c]),onRemove:(0,z.useCallback)(e=>c(t=>pp(t,e)),[c]),onMove:(0,z.useCallback)((e,t)=>c(n=>hp(n,e,e+t)),[c]),onDuplicate:(0,z.useCallback)(e=>c(t=>mp(t,e)),[c]),append:(0,z.useCallback)(e=>c(t=>[...t,lp(e)]),[c])}}var Wg=[],Gg=({node:e})=>{let t=e.props,n=t.name,r=t.templates,{errors:i}=Yf(),{hidden:a,required:o}=rg(e),{path:s,rows:c,onField:l,onRemove:u,onMove:d,onDuplicate:f,append:p}=Ug(n,t.defaultItems??0),{t:m}=P(`lattice`),h=Hg(c.map(e=>String(e.rowId??``)).join(`,`)),g=t.maxItems!=null&&c.length>=t.maxItems,_=t.minItems!=null&&c.length<=t.minItems,v=t.layout===`table`,y=e=>r.find(t=>t.type===e),b=r.map(e=>({type:e.type,label:e.label}));if(a)return null;let x=r[0],S=c.map((e,t)=>{let n=y(e.type),r=!!n&&!!x&&n.type===x.type;return{key:String(e.rowId??t),index:t,row:e,template:n?.schema??Wg,span:!r,heading:n?.label??`Unknown block: ${String(e.type)}`}});return(0,K.jsx)(Uh,{error:i[s],helperText:t.helperText??void 0,tooltip:t.tooltip??void 0,labelAction:Wh(t.labelAction),label:t.label??``,id:s,required:o,children:e=>(0,K.jsxs)(`div`,{...e,className:`flex flex-col gap-3`,role:`group`,children:[(0,K.jsx)(dg,{path:s,rows:c,rowKey:cp}),(0,K.jsx)(dg,{path:s,rows:c,rowKey:`type`}),v?(0,K.jsx)(K.Fragment,{children:(0,K.jsx)(zg,{base:s,columns:Lg(x?.schema??[]),rows:S,reorderable:t.reorderable??!1,removable:()=>!_,rowActions:t.rowActions,onField:l,onMove:d,onRemove:u,onDuplicate:f,registerRow:h,resizableColumns:t.resizableColumns===!0,resizeIndicator:t.resizeIndicator===!0})}):c.map((e,r)=>{let i=y(e.type),a=String(e.rowId??r);return(0,K.jsx)(`div`,{ref:e=>h(a,e),"data-flip-key":a,children:i?(0,K.jsx)(pg,{base:s,index:r,row:e,template:i.schema??Wg,heading:i.label,reorderable:t.reorderable??!1,isFirst:r===0,isLast:r===c.length-1,removable:!_,rowActions:t.rowActions,onField:l,onRemove:u,onMove:d,onDuplicate:f}):(0,K.jsxs)(`div`,{"data-test":`repeater-${n}-row-${r}`,className:`flex items-center justify-between rounded-lt border border-dashed border-lt-border p-4 text-sm text-lt-muted-fg`,children:[(0,K.jsxs)(`span`,{children:[`Unknown block: `,String(e.type)]}),(0,K.jsx)(ug,{actions:og(t.rowActions,{index:r,removable:!_,onRemove:u,onDuplicate:f,t:m})})]})},a)}),!g&&(0,K.jsx)(ig,{addLabel:t.addLabel??`Add`,options:b,onSelect:e=>p({type:e})})]})})},Kg=Object.defineProperty,qg=(e,t)=>Kg(e,`name`,{value:t,configurable:!0}),Jg=`Checkbox`,[Yg,Xg]=_l(Jg),[Zg,Qg]=Yg(Jg);function $g(e){let{__scopeCheckbox:t,checked:n,children:r,defaultChecked:i,disabled:a,form:o,name:s,onCheckedChange:c,required:l,value:u=`on`,internal_do_not_use_render:d}=e,[f,p]=Nl({prop:n,defaultProp:i??!1,onChange:c,caller:Jg}),[m,h]=z.useState(null),[g,_]=z.useState(null),v=z.useRef(!1),[y,b]=z.useReducer(e=>e+1,0),x=!m||!!o||!!m.closest(`form`),S={checked:f,disabled:a,setChecked:p,control:m,setControl:h,name:s,form:o,value:u,hasConsumerStoppedPropagationRef:v,userInteractionCount:y,onUserInteraction:b,required:l,defaultChecked:!c_(i)&&i,isFormControl:x,bubbleInput:g,setBubbleInput:_};return(0,K.jsx)(Zg,{scope:t,...S,children:s_(d)?d(S):r})}qg($g,`CheckboxProvider`);var e_=`CheckboxTrigger`,t_=z.forwardRef(qg(function({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},i){let{control:a,value:o,disabled:s,checked:c,required:l,setControl:u,setChecked:d,hasConsumerStoppedPropagationRef:f,onUserInteraction:p,isFormControl:m,bubbleInput:h}=Qg(e_,e),g=_(i,u),v=z.useRef(c);return z.useEffect(()=>{let e=a?.form;if(e){let t=qg(()=>d(v.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[a,d]),(0,K.jsx)(Q.button,{type:`button`,role:`checkbox`,"aria-checked":c_(c)?`mixed`:c,"aria-required":l,"data-state":l_(c),"data-disabled":s?``:void 0,disabled:s,value:o,...r,ref:g,onKeyDown:ll(t,e=>{e.key===`Enter`&&e.preventDefault()}),onClick:ll(n,e=>{p(),d(e=>c_(e)?!0:!e),h&&m&&(f.current=e.isPropagationStopped(),f.current||e.stopPropagation())})})},`CheckboxTrigger`)),n_=z.forwardRef(qg(function(e,t){let{__scopeCheckbox:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,K.jsx)($g,{__scopeCheckbox:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(t_,{...d,ref:t,__scopeCheckbox:n}),e&&(0,K.jsx)(o_,{__scopeCheckbox:n})]})})},`Checkbox`)),r_=`CheckboxIndicator`,i_=z.forwardRef(qg(function(e,t){let{__scopeCheckbox:n,forceMount:r,...i}=e,a=Qg(r_,n);return(0,K.jsx)(Du,{present:r||c_(a.checked)||a.checked===!0,children:(0,K.jsx)(Q.span,{"data-state":l_(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:t,style:{pointerEvents:`none`,...e.style}})})},`CheckboxIndicator`)),a_=`CheckboxBubbleInput`,o_=z.forwardRef(qg(function({__scopeCheckbox:e,onClick:t,...n},r){let{control:i,hasConsumerStoppedPropagationRef:a,userInteractionCount:o,checked:s,defaultChecked:c,required:l,disabled:u,name:d,value:f,form:p,bubbleInput:m,setBubbleInput:h}=Qg(a_,e),g=_(r,h),v=Mm(i),y=z.useRef(!1),b=z.useRef(s),x=z.useRef(o);z.useEffect(()=>{let e=m;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=o!==x.current;x.current=o;let i=b.current!==s;b.current=s;let c=!(r&&a.current);if(i&&n){y.current=!r;let t=new Event(`click`,{bubbles:c});e.indeterminate=c_(s),n.call(e,!c_(s)&&s),e.dispatchEvent(t),y.current=!1}},[m,s,a,o]);let S=z.useRef(!c_(s)&&s);return(0,K.jsx)(Q.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:c??S.current,required:l,disabled:u,name:d,value:f,form:p,...n,tabIndex:-1,ref:g,onClick:ll(t,e=>{y.current&&e.stopPropagation()}),style:{...n.style,...v,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`CheckboxBubbleInput`));function s_(e){return typeof e==`function`}qg(s_,`isFunction`);function c_(e){return e===`indeterminate`}qg(c_,`isIndeterminate`);function l_(e){return c_(e)?`indeterminate`:e?`checked`:`unchecked`}qg(l_,`getState`);function u_({className:e,...t}){return(0,K.jsx)(n_,{"data-slot":`checkbox`,className:k(`peer border-lt-input data-[state=checked]:bg-lt-primary data-[state=checked]:text-lt-primary-fg data-[state=checked]:border-lt-primary focus-visible:border-lt-ring focus-visible:ring-lt-ring/50 aria-invalid:ring-lt-danger/20 dark:aria-invalid:ring-lt-danger/40 aria-invalid:border-lt-danger size-4 shrink-0 rounded-lt-xs border shadow-lt-xs transition-shadow outline-none focus-visible:ring-[length:var(--lt-ring-width)] disabled:cursor-not-allowed disabled:bg-lt-disabled disabled:text-lt-disabled-fg disabled:data-[state=checked]:bg-lt-disabled disabled:data-[state=checked]:text-lt-disabled-fg disabled:data-[state=checked]:border-lt-disabled`,e),...t,children:(0,K.jsx)(i_,{"data-slot":`checkbox-indicator`,className:`flex items-center justify-center text-current transition-none`,children:(0,K.jsx)(M,{name:`check`,className:`size-lt-icon-sm`})})})}function d_(e,t){if(!t)return e;let n=e.replace(/[^A-Za-z0-9_-]+/g,`-`).replace(/^-+|-+$/g,``);return n?`${t}-${n}`:t}function f_(e,t){let n=xp(),r=Lp(e),i=n?n.getValue(e):r,a=zp();(0,z.useEffect)(()=>{i==null&&t!==void 0&&(n?n.setValue(e,t):a(e,t))},[e,t,i,a,n])}var p_=({node:e})=>{let{hidden:t,readOnly:n,disabled:r}=rg(e),i=e.props.name,a=xp(),{fieldIdPrefix:o}=Yf(),s=d_(a?a.scopedName(i):i,o),c=Lp(i),l=a?a.getValue(i):c,{commit:u}=Up(),d=qh(e.props.value),f=l===void 0?d:qh(l);return f_(i,d),t?null:(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`div`,{className:`flex items-center space-x-3`,children:[(0,K.jsx)(u_,{autoFocus:e.props.autoFocus??void 0,checked:f,"data-test":q(i),disabled:n||r,id:s,name:s,onCheckedChange:e=>{u(i,e===!0)},tabIndex:e.props.tabIndex??void 0}),(0,K.jsx)(Hh,{htmlFor:s,children:e.props.label})]}),e.props.helperText&&(0,K.jsx)(`p`,{className:`mt-1 pl-7 text-sm text-lt-muted-fg`,children:e.props.helperText})]})},m_=new Set([`ArrowUp`,`ArrowLeft`]),h_=new Set([`ArrowDown`,`ArrowRight`]);function g_({ariaLabel:e,autoFocus:t=!1,className:n,disabled:r=!1,name:a,onSelect:o,optionSchema:s,options:c,tabIndex:l,value:u,...d}){let f=(0,z.useRef)(null),p=c.some(e=>e.value===u);(0,z.useEffect)(()=>{if(!t)return;let e=f.current;(e?.querySelector(`button[aria-checked="true"]`)??e?.querySelector(`button`))?.focus()},[t]);let m=e=>{if(r||c.length===0)return;let t=h_.has(e.key)?1:m_.has(e.key)?-1:0;if(t===0)return;e.preventDefault();let n=c[(c.findIndex(e=>e.value===u)+t+c.length)%c.length];n&&(o(n.value),f.current?.querySelector(`[data-test="${a}-${n.value}"]`)?.focus())};return(0,K.jsx)(`div`,{...d,"aria-label":e,className:k(`grid w-full gap-2`,n),onKeyDown:m,ref:f,role:`radiogroup`,children:c.map((e,t)=>{let n=u===e.value,c=n||!p&&t===0;return(0,K.jsx)(`button`,{"aria-checked":n,className:k(`rounded-lt border p-4 text-left transition-colors`,n?`border-lt-primary bg-lt-accent text-lt-accent-fg`:`border-lt-border hover:border-lt-input`,r&&`cursor-not-allowed opacity-60`),"data-test":`${a}-${e.value}`,disabled:r,onClick:()=>o(e.value),role:`radio`,tabIndex:c?l??0:-1,type:`button`,children:(0,K.jsx)(Xc,{nodes:i(s,{...e.data,label:e.label,value:e.value})})},e.value)})})}function __(e){return k(`whitespace-nowrap rounded-lt-sm px-3 py-1.5 text-sm font-medium transition-colors`,e?`bg-lt-bg text-lt-fg shadow-lt-xs`:`text-lt-muted-fg hover:bg-lt-bg/60 hover:text-lt-fg`)}function v_({"aria-label":e,autoFocus:t=!1,className:n,defaultValue:r,disabled:i=!1,name:a,onValueChange:o,options:s,tabIndex:c,value:l,...u}){let d=(0,z.useRef)(null),[f,p]=(0,z.useState)(r??s[0]?.value??``),m=l??f;if((0,z.useEffect)(()=>{if(!t)return;let e=d.current;(e?.querySelector(`button[aria-checked="true"]`)??e?.querySelector(`button`))?.focus()},[t]),s.length===0)return null;function h(e){l===void 0&&p(e),o?.(e)}return(0,K.jsx)(`div`,{...u,"aria-label":e,className:k(`inline-flex w-fit max-w-full gap-1 overflow-x-auto rounded-lt bg-lt-muted p-1`,n),ref:d,role:`radiogroup`,children:s.map(e=>{let t=m===e.value;return(0,K.jsx)(`button`,{"aria-checked":t,"data-test":a?`${a}-${e.value}`:void 0,className:k(__(t),i&&`cursor-not-allowed opacity-60`),disabled:i,onClick:()=>h(e.value),role:`radio`,tabIndex:c,type:`button`,children:e.label},e.value)})})}function y_(e){let{errors:t,fieldIdPrefix:n}=Yf(),r=xp(),i=rg(e),a=ep(e),o=a.name??``,s=Lp(o),c=r?r.getValue(o):s,l=c===void 0?a.value:c,u=typeof l==`string`||typeof l==`number`?String(l):``,d=d_(r?r.scopedName(o):o,n),f=r?r.errorKey(o):o,{commit:p,change:m,blur:h}=Up(),g=e=>p(o,e),_=e=>m(o,e),v=()=>h(o);return{...i,localName:o,name:d,testId:q(o),value:u,error:t[f],commit:g,change:_,blur:v}}var b_=({node:e})=>{let t=wp(e),{localName:n,name:r,testId:i,value:a,error:o,hidden:s,required:c,readOnly:l,disabled:u,commit:d}=y_(e),f=(0,z.useMemo)(()=>t.props.options??[],[t.props]),p=t.props.optionSchema,m=f[0]?.value??``,h=a||m;return f_(n,h||void 0),s||f.length===0?null:(0,K.jsx)(Uh,{error:o,helperText:e.props.helperText??void 0,tooltip:e.props.tooltip??void 0,labelAction:Wh(e.props.labelAction),label:e.props.label??``,id:r,required:c,children:t=>(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`input`,{name:r,type:`hidden`,value:h}),p?.length?(0,K.jsx)(g_,{...t,ariaLabel:e.props.label??void 0,autoFocus:e.props.autoFocus??void 0,disabled:l||u,name:i??`choice`,onSelect:d,optionSchema:p,options:f,tabIndex:e.props.tabIndex??void 0,value:h}):(0,K.jsx)(v_,{...t,"aria-label":e.props.label??void 0,autoFocus:e.props.autoFocus??void 0,disabled:l||u,name:i??`segment`,onValueChange:d,options:f,tabIndex:e.props.tabIndex??void 0,value:h})]})})};function x_(){return(x_=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function S_(e,t){if(e==null)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)t.indexOf(n=a[r])>=0||(i[n]=e[n]);return i}function C_(e){var t=(0,z.useRef)(e),n=(0,z.useRef)(function(e){t.current&&t.current(e)});return t.current=e,n.current}var w_=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e<t?t:e},T_=function(e){return`touches`in e},E_=function(e){return e&&e.ownerDocument.defaultView||self},D_=function(e,t,n){var r=e.getBoundingClientRect(),i=T_(t)?function(e,t){for(var n=0;n<e.length;n++)if(e[n].identifier===t)return e[n];return e[0]}(t.touches,n):t;return{left:w_((i.pageX-(r.left+E_(e).pageXOffset))/r.width),top:w_((i.pageY-(r.top+E_(e).pageYOffset))/r.height)}},O_=function(e){!T_(e)&&e.preventDefault()},k_=z.memo(function(e){var t=e.onMove,n=e.onKey,r=e.onEnd,i=S_(e,[`onMove`,`onKey`,`onEnd`]),a=(0,z.useRef)(null),o=C_(t),s=C_(n),c=C_(r),l=(0,z.useRef)(null),u=(0,z.useRef)(!1),d=(0,z.useMemo)(function(){var e=function(e){O_(e),(T_(e)?e.touches.length>0:e.buttons>0)&&a.current?o(D_(a.current,e,l.current)):(n(!1),c())},t=function(){n(!1),c()};function n(n){var r=u.current,i=E_(a.current),o=n?i.addEventListener:i.removeEventListener;o(r?`touchmove`:`mousemove`,e),o(r?`touchend`:`mouseup`,t)}return[function(e){var t=e.nativeEvent,r=a.current;if(r&&(O_(t),!function(e,t){return t&&!T_(e)}(t,u.current)&&r)){if(T_(t)){u.current=!0;var i=t.changedTouches||[];i.length&&(l.current=i[0].identifier)}r.focus(),o(D_(r,t,l.current)),n(!0)}},function(e){var t=e.which||e.keyCode;t<37||t>40||(e.preventDefault(),s({left:t===39?.05:t===37?-.05:0,top:t===40?.05:t===38?-.05:0}))},function(e){var t=e.which||e.keyCode;t>=37&&t<=40&&c()},n]},[s,o,c]),f=d[0],p=d[1],m=d[2],h=d[3];return(0,z.useEffect)(function(){return h},[h]),z.createElement(`div`,x_({},i,{onTouchStart:f,onMouseDown:f,className:`react-colorful__interactive`,ref:a,onKeyDown:p,onKeyUp:m,tabIndex:0,role:`slider`}))}),A_=function(e){return e.filter(Boolean).join(` `)},j_=function(e){var t=e.color,n=e.left,r=e.top,i=r===void 0?.5:r,a=A_([`react-colorful__pointer`,e.className]);return z.createElement(`div`,{className:a,style:{top:100*i+`%`,left:100*n+`%`}},z.createElement(`div`,{className:`react-colorful__pointer-fill`,style:{backgroundColor:t}}))},M_=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=10**t),Math.round(n*e)/n};360/(2*Math.PI);var N_=function(e){return V_(P_(e))},P_=function(e){return e[0]===`#`&&(e=e.substring(1)),e.length<6?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:e.length===4?M_(parseInt(e[3]+e[3],16)/255,2):1}:{r:parseInt(e.substring(0,2),16),g:parseInt(e.substring(2,4),16),b:parseInt(e.substring(4,6),16),a:e.length===8?M_(parseInt(e.substring(6,8),16)/255,2):1}},F_=function(e){return B_(R_(e))},I_=function(e){var t=e.s,n=e.v,r=e.a,i=(200-t)*n/100;return{h:M_(e.h),s:M_(i>0&&i<200?t*n/100/(i<=100?i:200-i)*100:0),l:M_(i/2),a:M_(r,2)}},L_=function(e){var t=I_(e);return`hsl(`+t.h+`, `+t.s+`%, `+t.l+`%)`},R_=function(e){var t=e.h,n=e.s,r=e.v,i=e.a;t=t/360*6,n/=100,r/=100;var a=Math.floor(t),o=r*(1-n),s=r*(1-(t-a)*n),c=r*(1-(1-t+a)*n),l=a%6;return{r:M_(255*[r,s,o,o,c,r][l]),g:M_(255*[c,r,r,s,o,o][l]),b:M_(255*[o,o,c,r,r,s][l]),a:M_(i,2)}},z_=function(e){var t=e.toString(16);return t.length<2?`0`+t:t},B_=function(e){var t=e.r,n=e.g,r=e.b,i=e.a,a=i<1?z_(M_(255*i)):``;return`#`+z_(t)+z_(n)+z_(r)+a},V_=function(e){var t=e.r,n=e.g,r=e.b,i=e.a,a=Math.max(t,n,r),o=a-Math.min(t,n,r),s=o?a===t?(n-r)/o:a===n?2+(r-t)/o:4+(t-n)/o:0;return{h:M_(60*(s<0?s+6:s)),s:M_(a?o/a*100:0),v:M_(a/255*100),a:i}},H_=z.memo(function(e){var t=e.hue,n=e.onChange,r=e.onChangeEnd,i=A_([`react-colorful__hue`,e.className]);return z.createElement(`div`,{className:i},z.createElement(k_,{onMove:function(e){n({h:360*e.left})},onKey:function(e){n({h:w_(t+360*e.left,0,360)})},onEnd:r,"aria-label":`Hue`,"aria-valuenow":M_(t),"aria-valuemax":`360`,"aria-valuemin":`0`},z.createElement(j_,{className:`react-colorful__hue-pointer`,left:t/360,color:L_({h:t,s:100,v:100,a:1})})))}),U_=z.memo(function(e){var t=e.hsva,n=e.onChange,r=e.onChangeEnd,i={backgroundColor:L_({h:t.h,s:100,v:100,a:1})};return z.createElement(`div`,{className:`react-colorful__saturation`,style:i},z.createElement(k_,{onMove:function(e){n({s:100*e.left,v:100-100*e.top})},onKey:function(e){n({s:w_(t.s+100*e.left,0,100),v:w_(t.v-100*e.top,0,100)})},onEnd:r,"aria-label":`Color`,"aria-valuetext":`Saturation `+M_(t.s)+`%, Brightness `+M_(t.v)+`%`},z.createElement(j_,{className:`react-colorful__saturation-pointer`,top:1-t.v/100,left:t.s/100,color:L_(t)})))}),W_=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0},G_=function(e,t){return e.toLowerCase()===t.toLowerCase()||W_(P_(e),P_(t))};function K_(e,t,n,r){var i=C_(n),a=C_(r),o=(0,z.useState)(function(){return e.toHsva(t)}),s=o[0],c=o[1],l=(0,z.useRef)({color:t,hsva:s}),u=(0,z.useRef)(!1);return(0,z.useEffect)(function(){if(!e.equal(t,l.current.color)){var n=e.toHsva(t);l.current={hsva:n,color:t},c(n),u.current=!1}},[t,e]),(0,z.useEffect)(function(){var t;W_(s,l.current.hsva)||e.equal(t=e.fromHsva(s),l.current.color)||(l.current={hsva:s,color:t},i(t),u.current=!0)},[s,e,i]),[s,(0,z.useCallback)(function(e){c(function(t){return Object.assign({},t,e)})},[]),(0,z.useCallback)(function(){u.current&&(u.current=!1,a(l.current.color))},[a])]}var q_,J_=typeof window<`u`?z.useLayoutEffect:z.useEffect,Y_=function(){return q_||(typeof __webpack_nonce__<`u`?__webpack_nonce__:void 0)},X_=new WeakMap,Z_=function(e){J_(function(){var t=e.current;if(typeof document<`u`&&t){var n=t.getRootNode?t.getRootNode():t.ownerDocument,r=n&&(`head`in n||`host`in n)?n:t.ownerDocument;if(!X_.has(r)){var i=`head`in r?r.head:r,a=(i.ownerDocument||document).createElement(`style`);a.innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><path d="M8 0h8v8H8zM0 8h8v8H0z"/></svg>')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`;var o=Y_();o&&a.setAttribute(`nonce`,o),X_.set(r,a),i.appendChild(a)}}},[])},Q_=function(e){var t=e.className,n=e.colorModel,r=e.color,i=r===void 0?n.defaultColor:r,a=e.onChange,o=e.onChangeEnd,s=S_(e,[`className`,`colorModel`,`color`,`onChange`,`onChangeEnd`]),c=(0,z.useRef)(null);Z_(c);var l=K_(n,i,a,o),u=l[0],d=l[1],f=l[2],p=A_([`react-colorful`,t]);return z.createElement(`div`,x_({},s,{ref:c,className:p}),z.createElement(U_,{hsva:u,onChange:d,onChangeEnd:f}),z.createElement(H_,{hue:u.h,onChange:d,onChangeEnd:f,className:`react-colorful__last-control`}))},$_={defaultColor:`000`,toHsva:N_,fromHsva:function(e){return F_({h:e.h,s:e.s,v:e.v,a:1})},equal:G_},ev=function(e){return z.createElement(Q_,x_({},e,{colorModel:$_}))};function tv(e){let t=e.trim().replace(/^#/,``).toLowerCase();return/^[0-9a-f]{6}$/.test(t)?`#${t}`:/^[0-9a-f]{3}$/.test(t)?`#${t[0]}${t[0]}${t[1]}${t[1]}${t[2]}${t[2]}`:null}function nv({value:e,onChange:t,palette:n,hexLabel:r=`Hex color`,paletteLabel:i=`Color palette`}){let[a,o]=(0,z.useState)(null),s=tv(e)??`#6b7280`;return(0,K.jsxs)(`div`,{className:`flex w-56 flex-col gap-3`,"data-slot":`color-picker`,children:[(0,K.jsx)(ev,{className:`!w-full`,color:s,onChange:t}),n.length>0&&(0,K.jsx)(`div`,{"aria-label":i,className:`flex flex-wrap gap-1.5`,role:`listbox`,children:n.map(e=>{let n=tv(e)??e;return(0,K.jsx)(`button`,{"aria-label":n,"aria-selected":n===s,className:k(`size-6 shrink-0 rounded-full border border-lt-border`,n===s&&`ring-2 ring-lt-ring ring-offset-1`),onClick:()=>t(n),role:`option`,style:{background:e},type:`button`},e)})}),(0,K.jsx)(le,{"aria-label":r,onBlur:()=>o(null),onChange:e=>{let n=e.target.value,r=tv(n);o(n),r!==null&&t(r)},value:a??s})]})}function rv({node:e,label:t,children:n}){let r=y_(e);return r.hidden?null:(0,K.jsx)(Uh,{error:r.error,helperText:ep(e).helperText??void 0,tooltip:ep(e).tooltip??void 0,labelAction:Wh(ep(e).labelAction),label:t,id:r.name,required:r.required,children:e=>n(r,e)})}var iv=({node:e})=>{let t=e.props;return(0,K.jsx)(rv,{node:e,label:t.label??``,children:({name:e,value:n,readOnly:r,disabled:i,commit:a},o)=>{let s=tv(n);return(0,K.jsxs)(kh,{children:[(0,K.jsx)(`input`,{name:e,type:`hidden`,value:s??``}),(0,K.jsx)(Ah,{asChild:!0,children:(0,K.jsx)(`button`,{...o,className:k(ce(),`flex items-center gap-2 text-left`),"data-test":`color-picker-${e}`,disabled:i||r,type:`button`,children:s?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`span`,{"aria-hidden":`true`,className:`size-4 shrink-0 rounded-full border border-lt-border`,style:{background:s}}),(0,K.jsx)(`span`,{className:`tabular-nums`,children:s})]}):(0,K.jsx)(`span`,{className:`text-lt-muted-fg`,children:t.placeholder??``})})}),(0,K.jsx)(Mh,{className:`p-3`,children:(0,K.jsx)(nv,{onChange:e=>a(e),palette:t.palette,value:s??`#6b7280`})})]})}})},av=(0,z.lazy)(async()=>{let{DatePickerField:e}=await _e(async()=>{let{DatePickerField:e}=await import(`./date-picker-field-FY2OOgtu.js`);return{DatePickerField:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8]),import.meta.url);return{default:e}});function ov(e){return(0,K.jsx)(z.Suspense,{fallback:null,children:(0,K.jsx)(av,{...e})})}var sv=({node:e})=>{let t=e.props;return(0,K.jsx)(rv,{node:e,label:t.label??``,children:({name:e,testId:n,value:r,readOnly:i,disabled:a,change:o,blur:s},c)=>(0,K.jsx)(ov,{controlProps:c,autoFocus:t.autoFocus??!1,disabled:a,label:t.label??t.name,max:t.max||void 0,min:t.min||void 0,mode:`date`,name:e,onBlur:s,onChange:o,readOnly:i,tabIndex:t.tabIndex??void 0,testId:n??t.name,value:r})})},cv=({node:e})=>{let t=e.props,{timezone:n}=ae();return(0,K.jsx)(rv,{node:e,label:t.label??``,children:({name:e,testId:r,value:i,readOnly:a,disabled:o,change:s,blur:c},l)=>(0,K.jsx)(ov,{controlProps:l,autoFocus:t.autoFocus??!1,disabled:o,label:t.label??t.name,max:t.max,min:t.min,mode:`date-time`,name:e,onBlur:c,onChange:s,readOnly:a,step:t.step,tabIndex:t.tabIndex??void 0,testId:r??t.name,timezone:n,value:i})})};function lv({url:e,method:t,body:n,headers:r,onProgress:i}){return new Promise((a,o)=>{let s=new XMLHttpRequest;s.open(t,e,!0),Object.entries(r).forEach(([e,t])=>s.setRequestHeader(e,String(t))),s.upload.onprogress=e=>{e.lengthComputable&&i?.(Math.round(e.loaded/e.total*100))},s.onload=()=>{try{a(new Response(s.responseText||null,{status:s.status||500}))}catch{o(Error(`Upload to ${e} returned an unusable response`))}},s.onerror=()=>o(Error(`Upload to ${e} failed`)),s.send(n)})}function uv(e,{ref:t,target:n,filename:r,contentType:i,values:a}){return Ec(e,{method:`POST`,ref:t,body:JSON.stringify({...a,_sub:`upload`,_target:n,filename:r,contentType:i}),throwOnError:!1})}var dv=E(k(`relative inline-flex shrink-0 items-center justify-center rounded-lt-sm transition-colors`,`outline-none focus-visible:ring-[length:var(--lt-ring-width)] focus-visible:ring-lt-ring/50`,`disabled:pointer-events-none disabled:bg-lt-disabled disabled:text-lt-disabled-fg`),{variants:{emphasis:{ghost:k(`text-lt-muted-fg hover:bg-lt-accent hover:text-lt-accent-fg`,`data-[state=open]:bg-lt-accent data-[state=open]:text-lt-accent-fg`,`aria-pressed:bg-lt-accent aria-pressed:text-lt-accent-fg`),segmented:k(`-ml-px rounded-l-none border border-lt-input text-lt-muted-fg hover:bg-lt-accent hover:text-lt-accent-fg`,`data-[state=open]:z-10 data-[state=open]:border-lt-primary data-[state=open]:text-lt-fg`)},size:{xs:`size-5 [&_svg]:size-lt-icon-sm`,sm:`size-7 [&_svg]:size-lt-icon-md`,md:`size-lt-control-md [&_svg]:size-lt-icon-md`}},defaultVariants:{emphasis:`ghost`,size:`sm`}});function fv({icon:e,label:t,active:n,size:r,emphasis:i,className:a,children:o,ref:s,...c}){return(0,K.jsxs)(`button`,{ref:s,type:`button`,"aria-label":t,"aria-pressed":n,className:k(dv({emphasis:i,size:r}),a),...c,children:[e?(0,K.jsx)(M,{name:e,"aria-hidden":`true`}):null,o]})}function pv(e,t){return Array.isArray(t)?Array.isArray(e)&&e.length===t.length&&e.every((e,n)=>e===t[n]):e===t}var mv=({node:e})=>{let{t}=P(`lattice`),n=e.props,{hidden:r,required:i,readOnly:a,disabled:o}=rg(e),{action:s,componentRef:c,errors:l}=Yf(),u=n.name,d=xp(),f=d?d.scopedName(u):u,p=d?d.errorKey(u):u,m=p,h=Ip(),g=zp(),_=(0,z.useId)(),v=(0,z.useRef)(null),y=(0,z.useRef)(new Set),b=a||o,x=n.signed,S=n.multiple,C=S?`${f}[]`:f,w=(0,z.useMemo)(()=>(n.files??[]).map(e=>({id:crypto.randomUUID(),name:e.name,size:e.size,status:`ready`,progress:100,key:e.key,url:e.url,token:e.token,existing:!0})),[n.files]),[T,E]=(0,z.useState)(w),[D,O]=(0,z.useState)([]);(0,z.useEffect)(()=>{if(!x)return;let e=T.filter(e=>!e.existing&&e.key&&e.status===`ready`).map(e=>e.key),t=S?e:e[0]??``;if(d){pv(d.getValue(u),t)||d.setValue(u,t);return}g(u,t)},[T,S,u,d,g,x]),(0,z.useEffect)(()=>{!x||d||g(`${u}__removed`,D)},[u,D,d,g,x]),(0,z.useEffect)(()=>()=>{y.current.forEach(e=>URL.revokeObjectURL(e)),y.current.clear()},[]);let k=(0,z.useMemo)(()=>T.filter(e=>e.file&&!e.existing).map(e=>e.file),[T]);(0,z.useEffect)(()=>{if(x||!v.current)return;let e=new DataTransfer;k.forEach(t=>e.items.add(t)),v.current.files=e.files},[k,x]);function ee(e){if(!n.image)return;let t=URL.createObjectURL(e);return y.current.add(t),t}function A(e){!e.url||!y.current.has(e.url)||(URL.revokeObjectURL(e.url),y.current.delete(e.url))}async function j(e,t){let n=()=>{E(t=>t.map(t=>t.id===e.id?{...t,status:`error`}:t))},r=await uv(s,{ref:c,target:m,filename:t.name,contentType:t.type,values:h});if(!r.ok){n();return}let i=await r.json();try{let n=await lv({url:i.url,method:i.method.toUpperCase(),body:t,headers:i.headers,onProgress:t=>E(n=>n.map(n=>n.id===e.id?{...n,progress:t}:n))});E(t=>t.map(t=>t.id===e.id?{...t,status:n.ok?`ready`:`error`,key:i.key,progress:100}:t))}catch{n()}}function M(e){if(!e||b)return;let t=Array.from(e),n=t.map(e=>({id:crypto.randomUUID(),name:e.name,size:e.size,status:x?`uploading`:`ready`,progress:0,file:e,url:ee(e),existing:!1}));if(!S&&(T.forEach(A),!d)){let e=T.filter(e=>e.existing&&e.token).map(e=>e.token);e.length>0&&O(t=>[...t,...e])}E(e=>S?[...e,...n]:n),x&&n.forEach((e,n)=>void j(e,t[n]))}function N(e){let t=T.find(t=>t.id===e);t&&A(t),t?.existing&&t.token&&!d&&O(e=>[...e,t.token]),E(t=>t.filter(t=>t.id!==e))}return r?null:(0,K.jsx)(Uh,{error:l[p],helperText:n.helperText??void 0,tooltip:n.tooltip??void 0,labelAction:Wh(n.labelAction),label:n.label??``,id:_,required:i,children:e=>(0,K.jsxs)(`div`,{className:`flex flex-col gap-3 rounded-lt-sm border border-dashed border-lt-border bg-lt-surface px-4 py-6`,"data-test":q(u),onDragOver:e=>e.preventDefault(),onDrop:e=>{e.preventDefault(),M(e.dataTransfer.files)},children:[(0,K.jsx)(`button`,{className:`text-sm text-lt-muted-fg`,disabled:b,onClick:()=>v.current?.click(),type:`button`,children:t(`form.file-upload.dropzone`,`Drop files here or click to browse`)}),(0,K.jsx)(`ul`,{className:n.image?`grid grid-cols-1 gap-3 sm:grid-cols-2`:`flex flex-col gap-2`,children:T.map(e=>(0,K.jsxs)(`li`,{className:n.image?`flex min-w-0 items-center gap-3 rounded-lt-sm border border-lt-border bg-lt-bg p-2 text-sm`:`flex items-center justify-between gap-3 text-sm`,children:[n.image&&e.url?(0,K.jsx)(`img`,{alt:e.name,className:`size-16 shrink-0 rounded-lt-sm border border-lt-border object-cover`,"data-test":q(`${u}-preview`),src:e.url}):null,(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsx)(`span`,{className:`block truncate`,"data-test":q(`${u}-item`),children:e.name}),e.status===`uploading`&&(0,K.jsxs)(`span`,{className:`text-xs text-lt-muted-fg`,children:[e.progress,`%`]}),e.status===`error`&&(0,K.jsx)(`span`,{className:`text-xs text-lt-danger`,children:t(`form.file-upload.failed`,`Failed`)})]}),(!e.existing||!d)&&(0,K.jsx)(fv,{size:`sm`,icon:`x`,label:t(`form.file-upload.remove`,`Remove {{name}}`,{name:e.name}),"data-test":q(e.existing?`${u}-remove-existing`:`${u}-remove`),disabled:b,onClick:()=>N(e.id)}),x&&!e.existing&&e.key&&e.status===`ready`&&(0,K.jsx)(`input`,{"data-test":q(`${u}-uploaded`),name:C,type:`hidden`,value:e.key})]},e.id))}),!d&&D.map(e=>(0,K.jsx)(`input`,{name:`${u}__removed[]`,type:`hidden`,value:e},e)),(0,K.jsx)(`input`,{...e,accept:n.accept??void 0,"aria-label":n.label??u,className:`sr-only`,"data-test":q(`${u}-input`),multiple:S,name:x?void 0:C,onChange:e=>{M(e.target.files),x&&(e.target.value=``)},ref:v,type:`file`})]})})};function hv({label:e,summaryLabel:t,variant:n,emphasis:r}){let{componentId:i,errors:a,fieldLabels:o,processing:s}=Yf(),c=Object.entries(a).filter(([,e])=>!!e).map(([e,t])=>({label:o[e]??e,message:t})),l=c.length>0;return(0,K.jsxs)(`span`,{className:`group relative inline-flex flex-col`,children:[(0,K.jsxs)(cs,{"data-lattice-form":i,"data-test":`form-submit`,disabled:s||l,emphasis:r,type:`submit`,variant:n,children:[s&&(0,K.jsx)($s,{}),e]}),l&&(0,K.jsxs)(`div`,{className:`pointer-events-none absolute bottom-full left-1/2 z-lt-popover mb-2 w-max max-w-xs -translate-x-1/2 rounded-lt border border-lt-border bg-lt-surface p-3 text-left text-sm opacity-0 shadow-lt-md transition-opacity group-hover:opacity-100`,role:`tooltip`,children:[(0,K.jsx)(`p`,{className:`mb-1 font-medium text-lt-fg`,children:t}),(0,K.jsx)(`ul`,{className:`space-y-1`,children:c.map(e=>(0,K.jsxs)(`li`,{className:`text-lt-muted-fg`,children:[(0,K.jsx)(`span`,{className:`font-medium text-lt-fg`,children:e.label}),` — `,e.message]},e.label))})]})]})}var gv={start:`justify-start`,center:`justify-center`,end:`justify-end`,between:`justify-between`,around:`justify-around`,evenly:`justify-evenly`};function _v({componentId:e,reset:t}){let n=Bp();return Rs(d.resetForm,r=>{let i=r.detail;(!i?.form||i.form===e)&&(t(),n())}),null}function vv({action:e,children:t,componentRef:n,nodes:r,shouldRenderSubmitButton:i,submitButtons:a,submitEmphasis:o,submitJustify:s,submitLabel:c,submitVariant:l,summaryLabel:u}){let{nodes:d,markUserEdit:f}=rm(e,n,r),p=(0,z.useMemo)(()=>({markUserEdit:f}),[f]);return(0,K.jsx)(Zf,{value:p,children:(0,K.jsx)(Cp,{nodes:d,children:(0,K.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[t,i&&(0,K.jsx)(`div`,{className:`flex gap-3 ${gv[s??`end`]}`,children:a?.length?a.map((e,t)=>e.props.buttonType===`submit`?(0,K.jsx)(hv,{emphasis:e.props.emphasis??o,label:e.props.label??c,summaryLabel:u,variant:e.props.variant??l},Vc(e,t)):(0,K.jsx)(Y,{node:e},Vc(e,t))):(0,K.jsx)(hv,{emphasis:o,label:c,summaryLabel:u,variant:l})})]})})})}function yv(e){return!e||Array.isArray(e)&&e.length===0?!1:Array.isArray(e)?e:void 0}var bv=({children:e,node:t})=>{let n=(0,z.useMemo)(()=>({...im(t.schema).values,...t.props.state}),[t.schema,t.props.state]);return(0,K.jsx)(Pp,{initial:n,children:(0,K.jsx)(xv,{node:t,children:e})})};function xv({children:e,node:t}){let{t:n}=P(`lattice`),r=t.props,i=r.action??`#`,a=r.errorBag,o=r.ref??``,s=r.method??`post`,c=r.precognitive,l=r.resetOnError??!1,u=r.resetOnSuccess??[],d=(0,z.useMemo)(()=>im(t.schema).labels,[t.schema]),f=r.submitButton,p=r.submitButtons??void 0,m=r.submitJustify??void 0,h=r.submitLabel??n(`form.submit`,`Submit`),g=r.submitVariant??void 0,_=r.submitEmphasis??void 0,v=r.validationSummaryLabel,y=r.validationTimeout??void 0,b=Bp(),x=e=>{let t=yv(e);t!==!1&&b(t)},S=(0,z.useRef)(null),C=(0,z.useRef)(`idle`),[w,T]=(0,z.useState)(0);return(0,z.useEffect)(()=>{w>0&&C.current===`renewing`&&S.current?.submit()},[w]),(0,K.jsx)(Fo,{ref:S,action:i,"data-slot":`form`,"data-lattice-component":t.id,errorBag:a,method:s,resetOnError:l,resetOnSuccess:u,validationTimeout:c?y:void 0,headers:hc(o),className:`flex w-full flex-col gap-6`,onStart:()=>{C.current=C.current===`renewing`?`retried`:`idle`},onSuccess:()=>x(u),onError:()=>x(l),onHttpException:e=>{if(e.status===403&&o!==``&&C.current!==`retried`)return C.current=`renewing`,Tc(o).finally(()=>T(e=>e+1)),!1},children:({clearErrors:n,errors:a,processing:s,reset:l,touch:u,validate:y,validating:b})=>(0,K.jsxs)(Jf,{value:{action:i,clearErrors:e=>n(e),componentId:t.id,componentRef:o,errors:a,fieldLabels:d,precognitive:c,processing:s,touch:e=>u(...e),validate:e=>y(e),validateFields:(e,t)=>y({only:e,...t}),validating:b},children:[(0,K.jsx)(_v,{componentId:t.id,reset:l}),r.status&&(0,K.jsx)(`div`,{className:`text-center text-sm font-medium text-lt-success`,children:r.status}),(0,K.jsx)(vv,{action:i,componentRef:o,nodes:t.schema,shouldRenderSubmitButton:f,submitButtons:p,submitEmphasis:_,submitJustify:m,submitLabel:h,submitVariant:g,summaryLabel:v,children:e})]})})}var Sv=({node:e})=>{let t=xp(),n=e.props.name,r=t?t.getValue(n):e.props.value;return(0,K.jsx)(`input`,{defaultValue:typeof r==`string`?r:``,name:t?t.scopedName(n):n,type:`hidden`})};function Cv({affix:e,side:t,squared:n=!1}){return(0,K.jsx)(`span`,{"data-slot":`affix-${t}`,className:k(`inline-flex h-lt-control-md shrink-0 items-center border border-lt-input bg-lt-muted px-3 text-base whitespace-nowrap text-lt-muted-fg`,`group-has-[:focus-visible]:border-lt-ring`,t===`start`?`rounded-l-lt-sm border-r-0`:`rounded-r-lt-sm border-l-0`,n&&`rounded-r-none border-r-0`),children:e.icon?(0,K.jsx)(is,{className:`size-lt-icon-md`,icon:e.icon}):e.text})}function wv({prefix:e,suffix:t,end:n,children:r}){return!e&&!t&&!n?r(``):(0,K.jsxs)(`div`,{className:`group flex w-full rounded-lt-sm transition-[color,box-shadow] has-[:focus-visible]:ring-[length:var(--lt-ring-width)] has-[:focus-visible]:ring-lt-ring/50`,"data-slot":`affix-group`,children:[e?(0,K.jsx)(Cv,{affix:e,side:`start`}):null,(0,K.jsx)(`div`,{className:`min-w-0 flex-1`,children:r(k(`focus-visible:ring-0`,e&&`rounded-l-none`,(t||n)&&`rounded-r-none`))}),t?(0,K.jsx)(Cv,{affix:t,side:`end`,squared:!!n}):null,n]})}var Tv=({node:e})=>{let t=e.props;return(0,K.jsx)(rv,{node:e,label:t.label??``,children:({name:e,testId:n,value:r,readOnly:i,disabled:a,commit:o},s)=>{let c=e=>o(e.target.value);return t.slider?(0,K.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,K.jsx)(`input`,{...s,"aria-label":t.label??``,className:`h-2 w-full cursor-pointer appearance-none rounded-lt-sm bg-lt-muted accent-lt-primary disabled:cursor-not-allowed disabled:accent-lt-disabled`,"data-test":n,disabled:a||i,max:t.max??void 0,min:t.min??void 0,name:e,onChange:c,step:t.step??void 0,tabIndex:t.tabIndex??void 0,type:`range`,value:r}),(0,K.jsx)(`output`,{className:`w-10 shrink-0 text-right text-sm tabular-nums text-lt-fg`,children:r})]}):(0,K.jsx)(wv,{prefix:t.prefix,suffix:t.suffix,children:o=>(0,K.jsx)(le,{...s,autoFocus:t.autoFocus??!1,className:o,"data-test":n,disabled:a,max:t.max??void 0,min:t.min??void 0,name:e,onChange:c,placeholder:t.placeholder??``,readOnly:i,step:t.step??void 0,tabIndex:t.tabIndex??void 0,type:`number`,value:r})})}})},Ev=Object.defineProperty,Dv=Object.defineProperties,Ov=Object.getOwnPropertyDescriptors,kv=Object.getOwnPropertySymbols,Av=Object.prototype.hasOwnProperty,jv=Object.prototype.propertyIsEnumerable,Mv=(e,t,n)=>t in e?Ev(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Nv=(e,t)=>{for(var n in t||={})Av.call(t,n)&&Mv(e,n,t[n]);if(kv)for(var n of kv(t))jv.call(t,n)&&Mv(e,n,t[n]);return e},Pv=(e,t)=>Dv(e,Ov(t)),Fv=(e,t)=>{var n={};for(var r in e)Av.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&kv)for(var r of kv(e))t.indexOf(r)<0&&jv.call(e,r)&&(n[r]=e[r]);return n};function Iv(e){return[setTimeout(e,0),setTimeout(e,10),setTimeout(e,50)]}function Lv(e){let t=z.useRef();return z.useEffect(()=>{t.current=e}),t.current}var Rv=18,zv=40,Bv=`${zv}px`,Vv=[`[data-lastpass-icon-root]`,`com-1password-button`,`[data-dashlanecreated]`,`[style$="2147483647 !important;"]`].join(`,`);function Hv({containerRef:e,inputRef:t,pushPasswordManagerStrategy:n,isFocused:r}){let[i,a]=z.useState(!1),[o,s]=z.useState(!1),[c,l]=z.useState(!1),u=z.useMemo(()=>n!==`none`&&(n===`increase-width`||n===`experimental-no-flickering`)&&i&&o,[i,o,n]),d=z.useCallback(()=>{let r=e.current,i=t.current;if(!r||!i||c||n===`none`)return;let o=r,s=o.getBoundingClientRect().left+o.offsetWidth,u=o.getBoundingClientRect().top+o.offsetHeight/2,d=s-Rv,f=u;document.querySelectorAll(Vv).length===0&&document.elementFromPoint(d,f)===r||(a(!0),l(!0))},[e,t,c,n]);return z.useEffect(()=>{let t=e.current;if(!t||n===`none`)return;function r(){let e=window.innerWidth-t.getBoundingClientRect().right;s(e>=zv)}r();let i=setInterval(r,1e3);return()=>{clearInterval(i)}},[e,n]),z.useEffect(()=>{let e=r||document.activeElement===t.current;if(n===`none`||!e)return;let i=setTimeout(d,0),a=setTimeout(d,2e3),o=setTimeout(d,5e3),s=setTimeout(()=>{l(!0)},6e3);return()=>{clearTimeout(i),clearTimeout(a),clearTimeout(o),clearTimeout(s)}},[t,r,n,d]),{hasPWMBadge:i,willPushPWMBadge:u,PWM_BADGE_SPACE_WIDTH:Bv}}var Uv=z.createContext({}),Wv=z.forwardRef((e,t)=>{var n=e,{value:r,onChange:i,maxLength:a,textAlign:o=`left`,pattern:s,placeholder:c,inputMode:l=`numeric`,onComplete:u,pushPasswordManagerStrategy:d=`increase-width`,pasteTransformer:f,containerClassName:p,noScriptCSSFallback:m=Kv,render:h,children:g}=n,_=Fv(n,[`value`,`onChange`,`maxLength`,`textAlign`,`pattern`,`placeholder`,`inputMode`,`onComplete`,`pushPasswordManagerStrategy`,`pasteTransformer`,`containerClassName`,`noScriptCSSFallback`,`render`,`children`]),v;let[y,b]=z.useState(typeof _.defaultValue==`string`?_.defaultValue:``),x=r??y,S=Lv(x),C=z.useCallback(e=>{i?.(e),b(e)},[i]),w=z.useMemo(()=>s?typeof s==`string`?new RegExp(s):s:null,[s]),T=z.useRef(null),E=z.useRef(null),D=z.useRef({value:x,onChange:C,isIOS:typeof window<`u`&&((v=window==null?void 0:window.CSS)?.supports)?.call(v,`-webkit-touch-callout`,`none`)}),O=z.useRef({prev:[T.current?.selectionStart,T.current?.selectionEnd,T.current?.selectionDirection]});z.useImperativeHandle(t,()=>T.current,[]),z.useEffect(()=>{let e=T.current,t=E.current;if(!e||!t)return;D.current.value!==e.value&&D.current.onChange(e.value),O.current.prev=[e.selectionStart,e.selectionEnd,e.selectionDirection];function n(){if(document.activeElement!==e){N(null),F(null);return}let t=e.selectionStart,n=e.selectionEnd,r=e.selectionDirection,i=e.maxLength,a=e.value,o=O.current.prev,s=-1,c=-1,l;if(a.length!==0&&t!==null&&n!==null){let e=t===n,r=t===a.length&&a.length<i;if(e&&!r){let e=t;if(e===0)s=0,c=1,l=`forward`;else if(e===i)s=e-1,c=e,l=`backward`;else if(i>1&&a.length>1){let t=0;if(o[0]!==null&&o[1]!==null){l=e<o[1]?`backward`:`forward`;let n=o[0]===o[1]&&o[0]<i;l===`backward`&&!n&&(t=-1)}s=t+e,c=t+e+1}}s!==-1&&c!==-1&&s!==c&&T.current.setSelectionRange(s,c,l)}let u=s===-1?t:s,d=c===-1?n:c,f=l??r;N(u),F(d),O.current.prev=[u,d,f]}if(document.addEventListener(`selectionchange`,n,{capture:!0}),n(),document.activeElement===e&&j(!0),!document.getElementById(`input-otp-style`)){let e=document.createElement(`style`);if(e.id=`input-otp-style`,document.head.appendChild(e),e.sheet){let t=`background: transparent !important; color: transparent !important; border-color: transparent !important; opacity: 0 !important; box-shadow: none !important; -webkit-box-shadow: none !important; -webkit-text-fill-color: transparent !important;`;Gv(e.sheet,`[data-input-otp]::selection { background: transparent !important; color: transparent !important; }`),Gv(e.sheet,`[data-input-otp]:autofill { ${t} }`),Gv(e.sheet,`[data-input-otp]:-webkit-autofill { ${t} }`),Gv(e.sheet,`@supports (-webkit-touch-callout: none) { [data-input-otp] { letter-spacing: -.6em !important; font-weight: 100 !important; font-stretch: ultra-condensed; font-optical-sizing: none !important; left: -1px !important; right: 1px !important; } }`),Gv(e.sheet,`[data-input-otp] + * { pointer-events: all !important; }`)}}let r=()=>{t&&t.style.setProperty(`--root-height`,`${e.clientHeight}px`)};r();let i=new ResizeObserver(r);return i.observe(e),()=>{document.removeEventListener(`selectionchange`,n,{capture:!0}),i.disconnect()}},[]);let[k,ee]=z.useState(!1),[A,j]=z.useState(!1),[M,N]=z.useState(null),[P,F]=z.useState(null);z.useEffect(()=>{Iv(()=>{var e;(e=T.current)==null||e.dispatchEvent(new Event(`input`));let t=T.current?.selectionStart,n=T.current?.selectionEnd,r=T.current?.selectionDirection;t!==null&&n!==null&&(N(t),F(n),O.current.prev=[t,n,r])})},[x,A]),z.useEffect(()=>{S!==void 0&&x!==S&&S.length<a&&x.length===a&&u?.(x)},[a,u,S,x]);let I=Hv({containerRef:E,inputRef:T,pushPasswordManagerStrategy:d,isFocused:A}),te=z.useCallback(e=>{let t=e.currentTarget.value.slice(0,a);if(t.length>0&&w&&!w.test(t)){e.preventDefault();return}typeof S==`string`&&t.length<S.length&&document.dispatchEvent(new Event(`selectionchange`)),C(t)},[a,C,S,w]),ne=z.useCallback(()=>{var e;if(T.current){let t=Math.min(T.current.value.length,a-1),n=T.current.value.length;(e=T.current)==null||e.setSelectionRange(t,n),N(t),F(n)}j(!0)},[a]),re=z.useCallback(e=>{let t=T.current;if(!f&&(!D.current.isIOS||!e.clipboardData||!t))return;let n=e.clipboardData.getData(`text/plain`),r=f?f(n):n;e.preventDefault();let i=T.current?.selectionStart,o=T.current?.selectionEnd,s=(i===o?x.slice(0,i)+r+x.slice(i):x.slice(0,i)+r+x.slice(o)).slice(0,a);if(s.length>0&&w&&!w.test(s))return;t.value=s,C(s);let c=Math.min(s.length,a-1),l=s.length;t.setSelectionRange(c,l),N(c),F(l)},[a,C,w,x]),L=z.useMemo(()=>({position:`relative`,cursor:_.disabled?`default`:`text`,userSelect:`none`,WebkitUserSelect:`none`,pointerEvents:`none`}),[_.disabled]),R=z.useMemo(()=>({position:`absolute`,inset:0,width:I.willPushPWMBadge?`calc(100% + ${I.PWM_BADGE_SPACE_WIDTH})`:`100%`,clipPath:I.willPushPWMBadge?`inset(0 ${I.PWM_BADGE_SPACE_WIDTH} 0 0)`:void 0,height:`100%`,display:`flex`,textAlign:o,opacity:`1`,color:`transparent`,pointerEvents:`all`,background:`transparent`,caretColor:`transparent`,border:`0 solid transparent`,outline:`0 solid transparent`,boxShadow:`none`,lineHeight:`1`,letterSpacing:`-.5em`,fontSize:`var(--root-height)`,fontFamily:`monospace`,fontVariantNumeric:`tabular-nums`}),[I.PWM_BADGE_SPACE_WIDTH,I.willPushPWMBadge,o]),ie=z.useMemo(()=>z.createElement(`input`,Pv(Nv({autoComplete:_.autoComplete||`one-time-code`},_),{"data-input-otp":!0,"data-input-otp-placeholder-shown":x.length===0||void 0,"data-input-otp-mss":M,"data-input-otp-mse":P,inputMode:l,pattern:w?.source,"aria-placeholder":c,style:R,maxLength:a,value:x,ref:T,onPaste:e=>{var t;re(e),(t=_.onPaste)==null||t.call(_,e)},onChange:te,onMouseOver:e=>{var t;ee(!0),(t=_.onMouseOver)==null||t.call(_,e)},onMouseLeave:e=>{var t;ee(!1),(t=_.onMouseLeave)==null||t.call(_,e)},onFocus:e=>{var t;ne(),(t=_.onFocus)==null||t.call(_,e)},onBlur:e=>{var t;j(!1),(t=_.onBlur)==null||t.call(_,e)}})),[te,ne,re,l,R,a,P,M,_,w?.source,x]),ae=z.useMemo(()=>({slots:Array.from({length:a}).map((e,t)=>{let n=A&&M!==null&&P!==null&&(M===P&&t===M||t>=M&&t<P),r=x[t]===void 0?null:x[t];return{char:r,placeholderChar:x[0]===void 0?c?.[t]??null:null,isActive:n,hasFakeCaret:n&&r===null}}),isFocused:A,isHovering:!_.disabled&&k}),[A,k,a,P,M,_.disabled,x]),oe=z.useMemo(()=>h?h(ae):z.createElement(Uv.Provider,{value:ae},g),[g,ae,h]);return z.createElement(z.Fragment,null,m!==null&&z.createElement(`noscript`,null,z.createElement(`style`,null,m)),z.createElement(`div`,{ref:E,"data-input-otp-container":!0,style:L,className:p},oe,z.createElement(`div`,{style:{position:`absolute`,inset:0,pointerEvents:`none`}},ie)))});Wv.displayName=`Input`;function Gv(e,t){try{e.insertRule(t)}catch{console.error(`input-otp could not insert CSS rule:`,t)}}var Kv=`
|
|
139
|
+
[data-input-otp] {
|
|
140
|
+
--nojs-bg: white !important;
|
|
141
|
+
--nojs-fg: black !important;
|
|
142
|
+
|
|
143
|
+
background-color: var(--nojs-bg) !important;
|
|
144
|
+
color: var(--nojs-fg) !important;
|
|
145
|
+
caret-color: var(--nojs-fg) !important;
|
|
146
|
+
letter-spacing: .25em !important;
|
|
147
|
+
text-align: center !important;
|
|
148
|
+
border: 1px solid var(--nojs-fg) !important;
|
|
149
|
+
border-radius: 4px !important;
|
|
150
|
+
width: 100% !important;
|
|
151
|
+
}
|
|
152
|
+
@media (prefers-color-scheme: dark) {
|
|
153
|
+
[data-input-otp] {
|
|
154
|
+
--nojs-bg: black !important;
|
|
155
|
+
--nojs-fg: white !important;
|
|
156
|
+
}
|
|
157
|
+
}`,qv=`^\\d+$`;function Jv({char:e,hasFakeCaret:t,isActive:n}){return(0,K.jsxs)(`div`,{className:k(`relative flex h-lt-control-md w-10 items-center justify-center border-y border-r border-lt-input text-base shadow-lt-xs transition-all first:rounded-l-lt-sm first:border-l last:rounded-r-lt-sm`,n&&`z-10 border-lt-ring ring-lt-ring/50 ring-[length:var(--lt-ring-width)]`),children:[e,t?(0,K.jsx)(`div`,{className:`pointer-events-none absolute inset-0 flex items-center justify-center`,children:(0,K.jsx)(`div`,{className:`bg-lt-fg h-5 w-px animate-pulse`})}):null]})}function Yv({length:e,containerClassName:t,pattern:n=qv,...r}){return(0,K.jsx)(Wv,{maxLength:e,pattern:n,containerClassName:k(`flex items-center gap-2 has-[:disabled]:opacity-50`,t),render:({slots:e})=>(0,K.jsx)(`div`,{className:`flex items-center`,children:e.map((e,t)=>(0,K.jsx)(Jv,{...e},t))}),...r})}var Xv=({node:e})=>{let t=e.props;return(0,K.jsx)(rv,{node:e,label:t.label??``,children:({name:e,testId:n,value:r,readOnly:i,disabled:a,commit:o},s)=>(0,K.jsx)(Yv,{...s,autoFocus:t.autoFocus??!1,"data-test":n,disabled:a||i,length:t.length,name:e,onChange:e=>o(e),value:r})})};function Zv({className:e,ref:t,...n}){let[r,i]=(0,z.useState)(!1);return(0,K.jsxs)(`div`,{className:`relative`,children:[(0,K.jsx)(le,{type:r?`text`:`password`,className:k(`pr-10`,e),ref:t,...n}),(0,K.jsx)(`button`,{type:`button`,"data-test":typeof n.name==`string`?`${n.name}-visibility`:`password-visibility`,onClick:()=>i(e=>!e),className:`absolute inset-y-0 right-0 flex items-center rounded-r-lt-sm px-3 text-lt-muted-fg hover:text-lt-fg focus-visible:ring-[length:var(--lt-ring-width)] focus-visible:ring-lt-ring/50 focus-visible:outline-none`,"aria-label":r?`Hide password`:`Show password`,tabIndex:-1,children:r?(0,K.jsx)(M,{name:`eye-off`,className:`size-lt-icon-md`}):(0,K.jsx)(M,{name:`eye`,className:`size-lt-icon-md`})})]})}var Qv=({node:e})=>{let t=e.props,{errors:n}=Yf(),r=y_(e),{commit:i}=Up(),a=xp(),o=t.confirmation,s=o?.name??`${r.localName}_confirmation`,c=a?a.scopedName(s):s,l=a?a.errorKey(s):s,u=(t.passwordRules??``)||void 0;return r.hidden?null:(0,K.jsxs)(`div`,{className:`grid gap-6`,children:[(0,K.jsx)(Uh,{error:r.error,helperText:t.helperText??void 0,tooltip:t.tooltip??void 0,label:t.label??``,labelAction:Wh(t.labelAction),id:r.name,required:r.required,children:e=>(0,K.jsx)(wv,{prefix:t.prefix,suffix:t.suffix,children:n=>(0,K.jsx)(Zv,{...e,autoComplete:t.autoComplete??``,autoFocus:t.autoFocus??!1,className:n,"data-test":r.testId,disabled:r.disabled,name:r.name,onChange:e=>{r.commit(e.target.value)},placeholder:t.placeholder??``,passwordrules:u,readOnly:r.readOnly,tabIndex:t.tabIndex??void 0,value:r.value})})}),o&&(0,K.jsx)(Uh,{error:n[l],label:o.label??`Confirm password`,id:c,required:r.required,children:e=>(0,K.jsx)(Zv,{...e,autoComplete:`new-password`,"data-test":q(s),disabled:r.disabled,name:c,onChange:e=>{i(s,e.target.value)},placeholder:o.placeholder??o.label??`Confirm password`,passwordrules:u,readOnly:r.readOnly,tabIndex:t.tabIndex??void 0})})]})},$v=[],ey=({node:e})=>{let t=e.props,n=t.name,{errors:r}=Yf(),{hidden:i,required:a}=rg(e),{path:o,rows:s,onField:c,onRemove:l,onMove:u,onDuplicate:d,append:f}=Ug(n,t.defaultItems??1),p=e.schema??$v,m=Hg(s.map(e=>String(e.rowId??``)).join(`,`)),h=t.maxItems!=null&&s.length>=t.maxItems,g=t.minItems!=null&&s.length<=t.minItems,_=t.layout===`table`,v=t.itemLabels,y=e=>{let n=v?.[e];return typeof n==`string`&&n!==``?n:t.itemLabel?`${t.itemLabel} ${e+1}`:`#${e+1}`};if(i)return null;let b=s.map((e,t)=>({key:String(e.rowId??t),index:t,row:e,template:p,span:!1,heading:y(t)}));return(0,K.jsx)(Uh,{error:r[o],helperText:t.helperText??void 0,tooltip:t.tooltip??void 0,labelAction:Wh(t.labelAction),label:t.label??``,id:o,required:a,children:e=>(0,K.jsxs)(`div`,{...e,className:`flex flex-col gap-3`,role:`group`,children:[(0,K.jsx)(dg,{path:o,rows:s,rowKey:cp}),_?(0,K.jsx)(zg,{base:o,columns:Lg(p),rows:b,reorderable:t.reorderable??!1,removable:()=>!g,rowActions:t.rowActions,onField:c,onMove:u,onRemove:l,onDuplicate:d,registerRow:m,resizableColumns:t.resizableColumns===!0,resizeIndicator:t.resizeIndicator===!0}):s.map((e,n)=>{let r=String(e.rowId??n);return(0,K.jsx)(`div`,{ref:e=>m(r,e),"data-flip-key":r,children:(0,K.jsx)(pg,{base:o,index:n,row:e,template:p,heading:y(n),reorderable:t.reorderable??!1,isFirst:n===0,isLast:n===s.length-1,removable:!g,rowActions:t.rowActions,onField:c,onRemove:l,onMove:u,onDuplicate:d})},r)}),!h&&(0,K.jsxs)(`button`,{type:`button`,"data-test":`repeater-${n}-add`,className:`inline-flex items-center gap-1.5 self-start rounded-lt-sm border border-lt-border px-3 py-1.5 text-sm hover:bg-lt-accent [&_svg]:size-lt-icon-sm`,onClick:()=>f({}),children:[(0,K.jsx)(M,{name:`plus`}),t.addLabel??`Add`]})]})})},ty=250;function ny({contentClassName:e,creatable:t=!1,emptyLabel:n,loading:r=!1,multiple:i=!1,onCommit:a,onCreate:o,onSearch:s,onSelect:c,open:l,onOpenChange:u,options:d,renderOption:f,searchLabel:p,searchPlaceholder:m,selected:h,showSearch:g=!0,testId:_,trigger:v,triggerClassName:y,triggerProps:b}){let{t:x}=P(`lattice`),[S,C]=(0,z.useState)(``),w=(0,z.useRef)(null),[T,E]=(0,z.useState)(!1);(0,z.useLayoutEffect)(()=>{E(!!w.current?.closest(`[role="dialog"]`))},[]);function D(e){let t=e.split(`,`).map(e=>e.trim()).filter(Boolean);for(let e of t){let t=d.find(t=>t.label.toLowerCase()===e.toLowerCase());t?(a??c)(t.value):o?.(e)}i?C(``):j()}let O=d.some(e=>e.label.toLowerCase()===S.trim().toLowerCase()),ee=sm(e=>s?.(e),ty);(0,z.useEffect)(()=>{if(!(!s||!l))return ee(S),()=>ee.cancel()},[S,s,l,ee]);let A=s?d:d.filter(e=>e.label.toLowerCase().includes(S.toLowerCase()));function j(){C(``),u(!1)}function N(e){c(e),i||j()}return(0,K.jsxs)(kh,{modal:T,open:l,onOpenChange:e=>e?u(!0):j(),children:[(0,K.jsx)(Ah,{asChild:!0,children:(0,K.jsx)(`button`,{type:`button`,className:y,ref:w,...b,children:v})}),(0,K.jsxs)(Mh,{align:`start`,className:k(`w-[var(--radix-popover-trigger-width)] overflow-hidden p-0`,e),children:[g&&(0,K.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-lt-border px-3 py-2`,children:[(0,K.jsx)(`input`,{"aria-label":p??x(`form.search-options`,`Search options`),"data-slot":`combobox-search`,"data-test":_?`${_}-search`:void 0,className:`w-full bg-transparent text-sm outline-none placeholder:text-lt-muted-fg`,onChange:e=>{let n=e.target.value;if(t&&n.includes(`,`)){D(n);return}C(n)},onKeyDown:e=>{t&&e.key===`Enter`&&S.trim()!==``&&(e.preventDefault(),D(S))},placeholder:m,value:S}),r&&(0,K.jsx)(M,{name:`loader-2`,"aria-hidden":`true`,className:`size-lt-icon-md shrink-0 animate-spin text-lt-muted-fg`})]}),(0,K.jsxs)(`div`,{className:`max-h-60 overflow-y-auto p-1`,role:`listbox`,children:[t&&S.trim()!==``&&!O&&(0,K.jsxs)(`button`,{className:`flex w-full items-center gap-2 rounded-lt-sm px-3 py-1.5 text-left text-sm transition-colors hover:bg-lt-accent hover:text-lt-accent-fg`,"data-test":_?`${_}-create`:void 0,onClick:()=>D(S),type:`button`,children:[(0,K.jsx)(M,{name:`plus`,"aria-hidden":`true`,className:`size-lt-icon-md shrink-0`}),x(`form.create-option`,`Create "{{label}}"`,{label:S.trim()})]}),A.length===0&&!(t&&S.trim()!==``&&!O)?(0,K.jsx)(`p`,{className:`px-3 py-2 text-sm text-lt-muted-fg`,children:n}):A.map(e=>{let t=h.includes(e.value);return(0,K.jsxs)(`button`,{"aria-label":f?e.label:void 0,"aria-selected":t,className:k(`flex w-full items-center justify-between gap-2 rounded-lt-sm px-3 py-1.5 text-left text-sm transition-colors hover:bg-lt-accent hover:text-lt-accent-fg`,t&&`bg-lt-accent/60`),"data-slot":`combobox-option`,"data-test":_?`${_}-option-${e.value}`:void 0,"data-value":e.value,onClick:()=>N(e.value),role:`option`,type:`button`,children:[f?(0,K.jsx)(`span`,{className:`flex min-w-0 flex-1 items-center gap-2`,children:f(e)}):e.label,t&&(0,K.jsx)(M,{name:`check`,"aria-hidden":`true`,className:`size-lt-icon-md shrink-0`})]},e.value)})]})]})]})}function ry(e,t){let n=e??t;return Array.isArray(n)?n.map(String):n==null||n===``?[]:[String(n)]}var iy=({node:e})=>{let{t}=P(`lattice`),n=e.props,{action:r,componentRef:a,errors:o,fieldIdPrefix:s,searchOptions:c}=Yf(),{hidden:l,required:u,readOnly:d,disabled:f}=rg(e),{change:p,blur:m}=Up(),h=wp(e),g=n.name,_=xp(),v=d_(_?_.scopedName(g):g,s),y=_?_.errorKey(g):g,b=y,x=n.placeholder||`Select…`,S=n.multiple,C=n.searchable,w=n.creatable,T=(0,z.useMemo)(()=>h.props.options,[h.props]),E=h.props.optionSchema,D=Lp(g),O=Ip(),ee=(0,z.useRef)(O);ee.current=O;let A=_?_.getValue(g):D,j=(0,z.useMemo)(()=>ry(A,n.value),[A,n.value]),N=(0,z.useRef)(j);N.current=j;let[F,I]=(0,z.useState)(!1),[te,ne]=(0,z.useState)(null),[re,L]=(0,z.useState)(!1),R=(0,z.useRef)(null),ie=(0,z.useMemo)(()=>{let e=new Map;for(let t of[...T,...te??[]])e.set(t.value,t);return e},[T,te]),ae=e=>ie.get(e)?.label??e,oe=e=>pe(ie.get(e)?.data?.color),se=d||f,le=(0,z.useCallback)(e=>{if(R.current?.abort(),e.trim()===``){ne(null),L(!1);return}let t=new AbortController;if(R.current=t,L(!0),c){c(b,e,ee.current,t.signal).then(e=>{ne(e),L(!1)}).catch(()=>{});return}Jp(r,a,{...ee.current,_sub:`search`,_target:b,_q:e},t.signal).then(e=>{ne(e?.options??[]),L(!1)}).catch(()=>{})},[r,a,b,c]);function ue(e){p(g,S?e:e[0]??``)}function fe(e){if(S){let t=N.current.includes(e)?N.current.filter(t=>t!==e):[...N.current,e];N.current=t,ue(t);return}N.current=[e],ue([e])}function me(e){ue(j.filter(t=>t!==e))}function he(e){if(!S){N.current=[e],ue([e]);return}if(!N.current.includes(e)){let t=[...N.current,e];N.current=t,ue(t)}}if(l)return null;let ge=C?te??T:T,_e=E?.length?e=>(0,K.jsx)(Xc,{nodes:i(E,{...e.data,label:e.label,value:e.value})}):void 0;return(0,K.jsx)(Uh,{error:o[y],helperText:n.helperText??void 0,tooltip:n.tooltip??void 0,labelAction:Wh(n.labelAction),label:n.label??``,id:v,required:u,children:e=>(0,K.jsxs)(K.Fragment,{children:[S?j.map(e=>(0,K.jsx)(`input`,{name:`${v}[]`,type:`hidden`,value:e},e)):(0,K.jsx)(`input`,{name:v,type:`hidden`,value:j[0]??``}),(0,K.jsxs)(`div`,{children:[S&&j.length>0&&(0,K.jsx)(`div`,{className:`mb-1.5 flex flex-wrap gap-1`,children:j.map(e=>{let n=oe(e);return(0,K.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-lt-sm bg-lt-muted px-2 py-0.5 text-xs`,children:[n&&(0,K.jsx)(`span`,{"aria-hidden":`true`,className:`size-2 shrink-0 rounded-full`,style:{background:de(n)}}),ae(e),!se&&(0,K.jsx)(`button`,{"aria-label":t(`form.remove-option`,`Remove {{label}}`,{label:ae(e)}),"data-test":`select-${g}-remove-${e}`,className:`text-lt-muted-fg hover:text-lt-fg [&_svg]:size-lt-icon-xs`,onClick:()=>me(e),type:`button`,children:(0,K.jsx)(M,{name:`x`})})]},e)})}),(0,K.jsx)(ny,{creatable:w,emptyLabel:n.emptyLabel??void 0,loading:re,multiple:S,onCommit:he,onCreate:he,onSearch:C?le:void 0,onSelect:fe,open:F&&!se,onOpenChange:e=>{I(e),e||m(g)},options:ge,renderOption:_e,searchPlaceholder:n.searchPlaceholder??void 0,showSearch:!!(C||w),selected:j,testId:`select-${g}`,trigger:(0,K.jsxs)(K.Fragment,{children:[!S&&j.length>0?(0,K.jsx)(`span`,{children:ae(j[0])}):(0,K.jsx)(`span`,{className:`text-lt-muted-fg`,children:x}),(0,K.jsx)(M,{name:`chevrons-up-down`,className:`size-lt-icon-md shrink-0 text-lt-muted-fg`})]}),triggerClassName:k(ce(),`flex items-center justify-between gap-2 text-left`,se&&`cursor-not-allowed opacity-60`),triggerProps:{...e,"aria-haspopup":`listbox`,autoFocus:n.autoFocus??void 0,"data-test":`select-${g}`,disabled:se,tabIndex:n.tabIndex??void 0}})]})]})})};function ay({className:e,...t}){return(0,K.jsx)(`textarea`,{"data-slot":`textarea`,className:k(`border-lt-input placeholder:text-lt-muted-fg flex field-sizing-content min-h-16 w-full rounded-lt-sm border bg-transparent px-3 py-2 text-base shadow-lt-xs transition-[color,box-shadow] outline-none disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-lt-disabled disabled:text-lt-disabled-fg`,se,`aria-invalid:ring-lt-danger/20 dark:aria-invalid:ring-lt-danger/40 aria-invalid:border-lt-danger`,e),...t})}var oy=({node:e})=>{let t=e.props;return(0,K.jsx)(rv,{node:e,label:t.label??``,children:({name:e,testId:n,value:r,readOnly:i,disabled:a,commit:o},s)=>(0,K.jsx)(ay,{...s,autoFocus:t.autoFocus??!1,"data-test":n,disabled:a,name:e,onChange:e=>o(e.target.value),placeholder:t.placeholder??``,readOnly:i,rows:t.rows??void 0,tabIndex:t.tabIndex??void 0,value:r})})};async function sy(e){if(!navigator?.clipboard)return!1;try{return await navigator.clipboard.writeText(e),!0}catch{return!1}}function cy({value:e,label:t,testId:n,className:r,iconOnly:i=!1,children:a}){let{t:o}=P(I),[s,c]=(0,z.useState)(!1);(0,z.useEffect)(()=>{if(!s)return;let e=window.setTimeout(()=>c(!1),1500);return()=>window.clearTimeout(e)},[s]);async function l(){await sy(e)&&c(!0)}let u=s?o(`common.copied-value`,`Copied {{label}}`,{label:t}):o(`common.copy-value`,`Copy {{label}}`,{label:t});return i?(0,K.jsx)(fv,{icon:s?`check`:`copy`,label:u,"data-test":n,className:r,onClick:()=>void l()}):(0,K.jsx)(cs,{type:`button`,size:`sm`,emphasis:`outline`,icon:s?`check`:`copy`,"data-test":n,className:r,"aria-label":u,onClick:()=>void l(),children:s?o(`common.copied`,`Copied`):a??o(`common.copy`,`Copy`)})}function ly({value:e,label:t,testId:n,children:r}){return(0,K.jsxs)(`div`,{className:`inline-flex items-center gap-2`,children:[r??e,(0,K.jsx)(cy,{value:e,label:t,testId:n})]})}var uy=({node:e})=>{let t=e.props;return(0,K.jsx)(rv,{node:e,label:t.label??``,children:({name:e,testId:n,value:r,readOnly:i,disabled:a,commit:o},s)=>(0,K.jsx)(wv,{prefix:t.prefix,suffix:t.suffix,end:t.copyable?(0,K.jsx)(cy,{className:`h-lt-control-md gap-1.5 rounded-l-none rounded-r-lt-sm border-l-0 border-lt-input px-3 group-has-[:focus-visible]:border-lt-ring`,label:t.label??e,testId:`${n}-copy`,value:r}):null,children:c=>(0,K.jsx)(le,{...s,autoComplete:t.autoComplete??``,autoFocus:t.autoFocus??!1,className:c,"data-test":n,disabled:a,name:e,onChange:e=>o(e.target.value),placeholder:t.placeholder??``,readOnly:i,tabIndex:t.tabIndex??void 0,type:t.type??`text`,value:r})})})},dy=/^(\d{1,2}):(\d{2})(?::(\d{2}))?$/;function fy(e){if(typeof e!=`string`)return null;let t=dy.exec(e.trim());if(!t)return null;let n=Number(t[1]),r=Number(t[2]),i=t[3]?Number(t[3]):0;return n>23||r>59||i>59?null:{hour:n,minute:r,second:i}}function py(e,t){let n=[by(e.hour),by(e.minute)];return t&&n.push(by(e.second)),n.join(`:`)}function my(e){return e!=null&&e<60}function hy(e,t={}){let{min:n,max:r,current:i}=t,a=_y(n),o=_y(r),s=e==null||e<60?1:e%60==0?e/60:1;return{hours:yy(0,23,1).map(e=>({value:e,label:by(e),disabled:a!=null&&e<a.hour||o!=null&&e>o.hour})),minutes:vy(yy(0,59,s),i?.minute).map(e=>({value:e,label:by(e),disabled:gy(e,i,a,o)})),seconds:my(e)?yy(0,59,1).map(e=>({value:e,label:by(e),disabled:!1})):null}}function gy(e,t,n,r){return t?n!=null&&t.hour===n.hour&&e<n.minute||r!=null&&t.hour===r.hour&&e>r.minute:!1}function _y(e){let t=fy(e);return t?{hour:t.hour,minute:t.minute}:null}function vy(e,t){return t==null||e.includes(t)?e:[...e,t].sort((e,t)=>e-t)}function yy(e,t,n){let r=[];for(let i=e;i<=t;i+=n)r.push(i);return r}function by(e){return String(e).padStart(2,`0`)}function xy({value:e,onChange:t,step:n,min:r,max:i,disabled:a=!1,readOnly:o=!1,labels:s,testId:c}){let l=(0,z.useRef)(null),u=hy(n,{min:r,max:i,current:e}),d=e??{hour:0,minute:0,second:0},f=!a&&!o,p=[{key:`hour`,label:s?.hour??`Hour`,options:u.hours,selected:d.hour},{key:`minute`,label:s?.minute??`Minute`,options:u.minutes,selected:d.minute},...u.seconds?[{key:`second`,label:s?.second??`Second`,options:u.seconds,selected:d.second}]:[]];function m(e){let t=l.current?.querySelectorAll(`[role="listbox"]`)?.[e];t&&(t.querySelector(`[data-active="true"]`)??t.querySelector(`[role="option"]`))?.focus()}return(0,K.jsx)(`div`,{ref:l,className:`flex gap-1`,"data-test":c,children:p.map((n,r)=>(0,K.jsx)(Sy,{label:n.label,options:n.options,selected:e?n.selected:null,disabled:!f,onSelect:e=>f&&t({...d,[n.key]:e}),onHorizontal:e=>m(r+e)},n.key))})}function Sy({label:e,options:t,selected:n,disabled:r,onSelect:i,onHorizontal:a}){let o=(0,z.useRef)(null),s=t.filter(e=>!e.disabled).map(e=>e.value),c=n??s[0]??t[0]?.value??0;(0,z.useEffect)(()=>{(o.current?.querySelector(`[data-active="true"]`))?.scrollIntoView?.({block:`nearest`})},[n]);function l(e){e!=null&&(o.current?.querySelector(`[data-value="${e}"]`)?.focus(),i(e))}function u(e){if(r)return;let t=s.indexOf(c);switch(e.key){case`ArrowDown`:e.preventDefault(),l(s[Math.min(t+1,s.length-1)]);break;case`ArrowUp`:e.preventDefault(),l(s[Math.max(t-1,0)]);break;case`Home`:e.preventDefault(),l(s[0]);break;case`End`:e.preventDefault(),l(s[s.length-1]);break;case`ArrowRight`:e.preventDefault(),a(1);break;case`ArrowLeft`:e.preventDefault(),a(-1)}}return(0,K.jsx)(`div`,{ref:o,role:`listbox`,"aria-label":e,"aria-orientation":`vertical`,tabIndex:-1,className:`flex max-h-40 w-14 flex-col overflow-y-auto`,onKeyDown:u,children:t.map(t=>{let a=n===t.value;return(0,K.jsx)(`button`,{type:`button`,role:`option`,"aria-selected":a,"aria-label":`${e} ${t.label}`,"data-value":t.value,"data-active":c===t.value,disabled:r||t.disabled,tabIndex:c===t.value?0:-1,onClick:()=>i(t.value),className:k(`shrink-0 rounded-lt-sm px-2 py-1 text-sm text-lt-fg hover:bg-lt-muted`,a&&`bg-lt-primary text-lt-primary-fg`,(r||t.disabled)&&`cursor-not-allowed opacity-40`),children:t.label},t.value)})})}var Cy=({node:e})=>{let t=e.props,n=my(t.step),r=t.label??t.name;return(0,K.jsx)(rv,{node:e,label:t.label??``,children:({name:e,testId:i,value:a,readOnly:o,disabled:s,commit:c,blur:l},u)=>(0,K.jsxs)(`div`,{className:`flex gap-2`,children:[(0,K.jsx)(le,{...u,"aria-label":r,autoFocus:t.autoFocus??!1,"data-test":i,disabled:s,name:e,onBlur:()=>{let e=fy(a);e&&c(py(e,n)),l()},onChange:e=>c(e.target.value),readOnly:o,tabIndex:t.tabIndex??void 0,type:`text`,value:a}),(0,K.jsxs)(kh,{children:[(0,K.jsx)(Ah,{asChild:!0,children:(0,K.jsx)(cs,{"aria-label":`Open ${r} time picker`,disabled:s||o,size:`icon`,type:`button`,variant:`secondary`,children:(0,K.jsx)(M,{name:`clock`,className:`size-lt-icon-md`,"aria-hidden":`true`})})}),(0,K.jsx)(Mh,{className:`p-2`,children:(0,K.jsx)(xy,{value:fy(a),onChange:e=>c(py(e,n)),step:t.step,min:t.min,max:t.max,disabled:s,readOnly:o,testId:`${i}-picker`})})]})]})})},wy=({node:e})=>{let{hidden:t,required:n,readOnly:r,disabled:i}=rg(e),a=e.props,o=a.name,s=xp(),{errors:c,fieldIdPrefix:l}=Yf(),u=d_(s?s.scopedName(o):o,l),d=s?s.errorKey(o):o,f=Lp(o),p=s?s.getValue(o):f,m=qh(a.value),h=p===void 0?m:qh(p),g=r||i,{commit:_}=Up();return f_(o,m),t?null:(0,K.jsx)(Uh,{error:c[d],helperText:a.helperText??void 0,tooltip:a.tooltip??void 0,labelAction:Wh(a.labelAction),label:a.label??``,id:u,required:n,children:e=>(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`input`,{disabled:g,name:u,type:`hidden`,value:h?`1`:`0`}),(0,K.jsx)(`button`,{...e,"aria-checked":h,"aria-label":a.label??o,autoFocus:a.autoFocus??!1,className:k(`inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border border-transparent bg-lt-muted p-0.5 shadow-lt-xs transition-colors outline-none focus-visible:border-lt-ring focus-visible:ring-[length:var(--lt-ring-width)] focus-visible:ring-lt-ring/50 disabled:cursor-not-allowed disabled:bg-lt-disabled data-[state=checked]:bg-lt-primary disabled:data-[state=checked]:bg-lt-disabled`),"data-state":h?`checked`:`unchecked`,"data-test":q(o),disabled:g,name:u,onClick:()=>_(o,!h),role:`switch`,tabIndex:a.tabIndex??void 0,type:`button`,children:(0,K.jsx)(`span`,{className:`size-5 rounded-full bg-lt-bg shadow-lt-sm transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0`,"data-state":h?`checked`:`unchecked`})})]})})};function Ty(e){let t=[],n=e=>{let r=ep(e).name;if(r&&t.push(r),!(r&&$f.has(e.type)))for(let t of e.schema??[])n(t)};for(let t of e.schema??[])n(t);return t}function Ey(e){let t=[],n=e=>{let r=ep(e).name;if(r&&t.push(r,`${r}.*`),r&&$f.has(e.type)){for(let n of Ty(e))t.push(`${r}.*.${n}`);return}for(let t of e.schema??[])n(t)};for(let t of e.schema??[])n(t);return t}function Dy(e,t){let n=Object.keys(t).filter(e=>!!t[e]),r=new Set;return e.forEach((e,t)=>{n.some(t=>e.some(e=>am(t,e)))&&r.add(t)}),r}function Oy(e,t){let n=Dy(e,t);return n.size>0?Math.min(...n):null}var ky={center:`justify-center`,left:`justify-start`,start:`justify-start`,stretch:`justify-stretch`},Ay=(0,z.createContext)({activeName:``});function jy(e){let t=(e.schema??[]).filter(e=>e.type===`wizard-step`);return{items:t.map(e=>e.props),nodes:t}}var My=({children:e,node:t})=>{let{t:n}=P(`lattice`),{errors:r,processing:i,touch:a,validateFields:o,validating:s}=Yf(),{items:c,nodes:l}=(0,z.useMemo)(()=>jy(t),[t]),u=(0,z.useMemo)(()=>l.map(e=>Ty(e)),[l]),d=t.props.orientation===`vertical`,[f,p]=(0,z.useState)(0),[m,h]=(0,z.useState)(()=>new Set([0])),[g,_]=(0,z.useState)(()=>new Set),v=(0,z.useMemo)(()=>Dy(u,r),[u,r]),y=f===c.length-1,b=e=>{p(e),h(t=>new Set(t).add(e))},x=()=>{_(e=>new Set(e).add(f)),y||b(f+1)},S=()=>{let e=l[f],t=e?Ey(e):[];if(t.length===0){x();return}a(t),o(t,{onSuccess:x})},C=(0,z.useRef)(!1);(0,z.useEffect)(()=>{if(C.current&&!i){let e=Oy(u,r);e!==null&&e!==f&&b(e)}C.current=i},[i,r,u,f]);let w=(0,z.useMemo)(()=>({activeName:c[f]?.name??``}),[c,f]);return(0,K.jsx)(Ay.Provider,{value:w,children:(0,K.jsxs)(`div`,{className:k(`gap-6`,d?`flex`:`grid`),"data-slot":`wizard`,children:[(0,K.jsx)(`ol`,{"aria-label":n(`form.wizard.steps`,`Steps`),className:k(`gap-1`,d?`flex w-56 shrink-0 flex-col`:`flex flex-wrap`,!d&&ky[t.props.align??`start`]),children:c.map((e,t)=>{let n=t===f,r=g.has(t),i=v.has(t);return(0,K.jsx)(`li`,{children:(0,K.jsxs)(`button`,{"aria-current":n?`step`:void 0,className:k(`flex w-full items-center gap-2 rounded-lt px-3 py-2 text-left text-sm`,n?`bg-lt-muted font-medium text-lt-fg`:`text-lt-muted-fg`,!m.has(t)&&`cursor-not-allowed opacity-60`),"data-error":i||void 0,"data-test":`wizard-rail-${e.name}`,disabled:!m.has(t),id:`wizard-step-${e.name}-trigger`,onClick:()=>b(t),type:`button`,children:[(0,K.jsx)(`span`,{className:k(`flex size-5 shrink-0 items-center justify-center rounded-full border text-xs`,i?`border-lt-danger text-lt-danger`:r?`border-lt-primary bg-lt-primary text-lt-primary-fg`:`border-lt-border`),children:r&&!i?(0,K.jsx)(M,{className:`size-lt-icon-sm`,name:`check`}):t+1}),(0,K.jsxs)(`span`,{className:`min-w-0`,children:[(0,K.jsx)(`span`,{className:`block truncate`,children:e.label}),d&&e.description&&(0,K.jsx)(`span`,{className:`block truncate text-xs text-lt-muted-fg`,children:e.description})]})]})},e.name)})}),(0,K.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-6`,children:[e,(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,K.jsx)(cs,{"data-test":`wizard-back`,disabled:f===0||i,onClick:()=>b(f-1),type:`button`,emphasis:`outline`,children:n(`form.wizard.back`,`Back`)}),y?(0,K.jsxs)(cs,{"data-test":`wizard-finish`,disabled:i,type:`submit`,children:[i&&(0,K.jsx)($s,{}),n(`form.wizard.finish`,`Finish`)]}):(0,K.jsxs)(cs,{"data-test":`wizard-next`,disabled:i||s,onClick:S,type:`button`,children:[s&&(0,K.jsx)($s,{}),n(`form.wizard.next`,`Next`)]})]})]})]})})},Ny=({children:e,node:t})=>{let{activeName:n}=(0,z.useContext)(Ay),r=t.props.name,i=n===r,[a,o]=(0,z.useState)(i);return(0,z.useEffect)(()=>{i&&o(!0)},[i]),(0,K.jsx)(`section`,{"aria-labelledby":`wizard-step-${r}-trigger`,className:k(`space-y-8`,!i&&`hidden`),hidden:!i,id:`wizard-step-${r}-panel`,children:a?e:null})},Py=(0,z.lazy)(()=>_e(()=>import(`./field-DMXnzaJF.js`),__vite__mapDeps([9,1,2,5,6,7,10,4,11,8,12,3,13,14]),import.meta.url)),Fy=({children:e,node:t})=>(0,K.jsx)(z.Suspense,{fallback:null,children:(0,K.jsx)(Py,{node:t,children:e})}),Iy=(0,z.lazy)(()=>_e(()=>import(`./rich-editor-field-B0XwZGpp.js`),__vite__mapDeps([15,1,2,5,16,6,7,10,4,11,12,3,13,14]),import.meta.url)),Ly={components:{form:B(bv),"field.builder":B(Gg),"field.checkbox":B(p_),"field.choice":B(b_),"field.color-picker":B(iv),"field.date-input":B(sv),"field.date-time-input":B(cv),"field.file-upload":B(mv),"field.hidden-input":B(Sv),"field.number-input":B(Tv),"field.otp":B(Xv),"field.password-input":B(Qv),"field.pattern-input":B(Fy),"field.repeater":B(ey),"field.rich-editor":B(({children:e,node:t})=>(0,K.jsx)(z.Suspense,{fallback:null,children:(0,K.jsx)(Iy,{node:t,children:e})})),"field.select":B(iy),"field.textarea":B(oy),"field.text-input":B(uy),"field.time-input":B(Cy),"field.toggle":B(wy),wizard:B(My),"wizard-step":B(Ny)},name:`lattice/form`},Ry={lg:320,md:64,sm:40,xl:384,xs:32,"2xl":448,"3xl":512,"4xl":576},zy={components:{fragment:B(({node:e})=>{let t=e.props.endpoint??``,n=e.props.lazy===!0,r=e.props.ref??``,i=Ry[e.props.size],[a,o]=(0,z.useState)(()=>e.schema??[]),[s,c]=(0,z.useState)(!n),[l,u]=(0,z.useState)(n&&t!==``),f=(0,z.useCallback)(async()=>{if(t){u(!0);try{let e=await Dc(t,{ref:r});o(Bc(e.schema)),c(!0)}finally{u(!1)}}},[t,r]);return(0,z.useEffect)(()=>{!n||s||f()},[s,n,f]),(0,z.useEffect)(()=>{function t(t){t.detail?.component===e.id&&f()}return window.addEventListener(d.reloadComponent,t),()=>window.removeEventListener(d.reloadComponent,t)},[f,e.id]),(0,z.useEffect)(()=>{function e(){s&&f()}return window.addEventListener(d.localeChange,e),()=>window.removeEventListener(d.localeChange,e)},[s,f]),(0,K.jsx)(`div`,{"data-lattice-fragment":e.id,style:l&&a.length===0?{minHeight:i}:void 0,children:l&&a.length===0?(0,K.jsx)(Kf,{className:`w-full`,style:{height:i}}):(0,K.jsx)(Xc,{nodes:a})})})},name:`lattice/fragments`},By=({node:e})=>{let{t}=P(`lattice`),n=Do().props.lattice?.breadcrumbs??[];return n.length===0?null:(0,K.jsx)(`nav`,{"aria-label":t(`common.breadcrumb`,`Breadcrumb`),className:`min-w-0 flex-1`,"data-lattice-component":J(e),children:(0,K.jsx)(`ol`,{className:`flex items-center gap-2 text-sm text-lt-muted-fg`,children:n.map((e,t)=>{let r=t===n.length-1;return(0,K.jsxs)(z.Fragment,{children:[(0,K.jsx)(`li`,{className:`min-w-0`,children:r?(0,K.jsx)(`span`,{"aria-current":`page`,className:`block truncate text-lt-fg`,children:e.title}):(0,K.jsx)(Ho,{className:`block truncate hover:text-lt-fg`,href:e.href,children:e.title})}),r?null:(0,K.jsx)(`li`,{"aria-hidden":`true`,children:`/`})]},e.href)})})})};function Vy(e){return typeof e==`object`&&!!e&&typeof e.key==`string`}function Hy(e,t){return t.split(`.`).reduce((e,t)=>{if(typeof e==`object`&&e)return e[t]},e)}function Uy(e,t){return Vy(e)?Wy(e,{},t):e}function Wy(e,t,n){let r={};for(let[n,i]of Object.entries(e.payload)){let e=Hy(t,i);r[n]=e===void 0?``:e}return n(e.key,e.key,{...e.replacements,...r})}var Gy=[`primary`,`secondary`,`success`,`info`,`warning`,`danger`];function Ky(e){return Gy.some(t=>t===e)}function qy(e){let t=typeof e==`string`||Vy(e)?e:null;return t===``?null:t}function Jy(e,t,n){let r=e=>{let r=t(e.detail);r!==null&&n(r)};return window.addEventListener(e,r),()=>window.removeEventListener(e,r)}function Yy(e){if(typeof e!=`object`||!e)return null;let t=e,n=qy(t.message);return n===null?null:{action:t.action??null,dismissible:t.dismissible!==!1,duration:typeof t.duration==`number`?t.duration:null,message:n,persistent:t.persistent===!0,variant:Ky(t.variant)?t.variant:`success`}}function Xy(e){return Jy(d.toast,Yy,e)}function Zy(e){if(typeof e!=`object`||!e)return null;let t=e,n=qy(t.message);return n===null?null:{action:t.action??null,dismissible:t.dismissible!==!1,message:n,title:typeof t.title==`string`||Vy(t.title)?t.title:null,unique:typeof t.unique==`string`?t.unique:null,variant:Ky(t.variant)?t.variant:`info`}}function Qy(e){return Jy(d.callout,Zy,e)}function $y(e){return Jy(d.retractCallout,e=>{let t=e?.unique;return typeof t==`string`?t:null},e)}var eb=Object.defineProperty,tb=(e,t)=>eb(e,`name`,{value:t,configurable:!0});function nb(e){let t=e+`CollectionProvider`,[n,r]=_l(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=tb(e=>{let{scope:t,children:n}=e,r=z.useRef(null),a=z.useRef(new Map).current;return(0,K.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})},`CollectionProvider`);o.displayName=t;let s=e+`CollectionSlot`,c=S(s),l=z.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=a(s,n),o=_(t,i.collectionRef);return(0,K.jsx)(c,{ref:o,children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=S(u),p=z.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=z.useRef(null),s=_(t,o),c=a(u,n);return z.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,K.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return z.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return tb(m,`useCollection`),[{Provider:o,Slot:l,ItemSlot:p},m,r]}tb(nb,`createCollection`);var rb=new WeakMap,ib=class e extends Map{static{tb(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],rb.set(this,!0)}set(e,t){return rb.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,n){let r=this.has(t),i=this.#e.length,a=sb(e),o=a>=0?a:i+a,s=o<0||o>=i?-1:o;if(s===this.size||r&&s===this.size-1||s===-1)return this.set(t,n),this;let c=this.size+ +!r;a<0&&o++;let l=[...this.#e],u,d=!1;for(let e=o;e<c;e++)if(o===e){let i=l[e];l[e]===t&&(i=l[e+1]),r&&this.delete(t),u=this.get(i),this.set(t,n)}else{!d&&l[e-1]===t&&(d=!0);let n=l[d?e:e-1],r=u;u=this.get(n),this.delete(n),this.set(n,r)}return this}with(t,n,r){let i=new e(this);return i.insert(t,n,r),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r,t,n)}after(e){let t=this.#e.indexOf(e);if(t=t===-1||t===this.size-1?-1:t+1,t!==-1)return this.entryAt(t)}setAfter(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r+1,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return t!==void 0&&this.delete(t)}at(e){let t=ab(this.#e,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=ab(this.#e,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return ab(this.#e,e)}from(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return-1}filter(t,n){let r=[],i=0;for(let e of this)Reflect.apply(t,n,[e,i,this])&&r.push(e),i++;return new e(r)}map(t,n){let r=[],i=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,i,this])]),i++;return new e(r)}reduce(...e){let[t,n]=e,r=0,i=n??this.at(0);for(let n of this)i=r===0&&e.length===1?n:Reflect.apply(t,this,[i,n,r,this]),r++;return i}reduceRight(...e){let[t,n]=e,r=n??this.at(-1);for(let n=this.size-1;n>=0;n--){let i=this.at(n);r=n===this.size-1&&e.length===1?i:Reflect.apply(t,this,[r,i,n,this])}return r}toSorted(t){let n=[...this.entries()].sort(t);return new e(n)}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e,i=this.size-1;if(t===void 0)return r;t<0&&(t+=this.size),n!==void 0&&n>0&&(i=n-1);for(let e=t;e<=i;e++){let t=this.keyAt(e),n=this.get(t);r.set(t,n)}return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}};function ab(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=ob(e,t);return n===-1?void 0:e[n]}tb(ab,`at`);function ob(e,t){let n=e.length,r=sb(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}tb(ob,`toSafeIndex`);function sb(e){return e!==e||e===0?0:Math.trunc(e)}tb(sb,`toSafeInteger`);function cb(e){let t=e+`CollectionProvider`,[n,r]=_l(t),[i,a]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new ib,setItemMap:tb(()=>void 0,`setItemMap`)}),o=tb(({state:e,...t})=>e?(0,K.jsx)(c,{...t,state:e}):(0,K.jsx)(s,{...t}),`CollectionProvider`);o.displayName=t;let s=tb(e=>{let t=h();return(0,K.jsx)(c,{...e,state:t})},`CollectionInit`);s.displayName=t+`Init`;let c=tb(e=>{let{scope:t,children:n,state:r}=e,a=z.useRef(null),[o,s]=z.useState(null),c=_(a,s),[l,u]=r;return z.useEffect(()=>{if(!o)return;let e=fb(()=>{});return e.observe(o,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[o]),(0,K.jsx)(i,{scope:t,itemMap:l,setItemMap:u,collectionRef:c,collectionRefObject:a,collectionElement:o,children:n})},`CollectionProviderImpl`);c.displayName=t+`Impl`;let l=e+`CollectionSlot`,u=S(l),d=z.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=a(l,n),o=_(t,i.collectionRef);return(0,K.jsx)(u,{ref:o,children:r})});d.displayName=l;let f=e+`CollectionItemSlot`,p=S(f),m=z.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=z.useRef(null),[s,c]=z.useState(null),l=_(t,o,c),{setItemMap:u}=a(f,n),d=z.useRef(i);lb(d.current,i)||(d.current=i);let m=d.current;return z.useEffect(()=>{let e=m;return u(t=>s?t.has(s)?t.set(s,{...e,element:s}).toSorted(db):(t.set(s,{...e,element:s}),t.toSorted(db)):t),()=>{u(e=>!s||!e.has(s)?e:(e.delete(s),new ib(e)))}},[s,m,u]),(0,K.jsx)(p,{"data-radix-collection-item":``,ref:l,children:r})});m.displayName=f;function h(){return z.useState(new ib)}tb(h,`useInitCollection`);function g(t){let{itemMap:n}=a(e+`CollectionConsumer`,t);return n}return tb(g,`useCollection`),[{Provider:o,Slot:d,ItemSlot:m},{createCollectionScope:r,useCollection:g,useInitCollection:h}]}tb(cb,`createCollection`);function lb(e,t){if(e===t)return!0;if(typeof e!=`object`||typeof t!=`object`||e==null||t==null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}tb(lb,`shallowEqual`);function ub(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}tb(ub,`isElementPreceding`);function db(e,t){return!e[1].element||!t[1].element?0:ub(e[1].element,t[1].element)?-1:1}tb(db,`sortByDocumentPosition`);function fb(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}tb(fb,`getChildListObserver`);var pb=Object.defineProperty,mb=(e,t)=>pb(e,`name`,{value:t,configurable:!0}),hb=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),gb=z.forwardRef(mb(function(e,t){return(0,K.jsx)(Q.span,{...e,ref:t,style:{...hb,...e.style}})},`VisuallyHidden`)),_b=Object.defineProperty,vb=(e,t)=>_b(e,`name`,{value:t,configurable:!0}),yb=`ToastProvider`,[bb,xb,Sb]=nb(`Toast`),[Cb,wb]=_l(`Toast`,[Sb]),[Tb,Eb]=Cb(yb),Db=vb(e=>{let{__scopeToast:t,label:n=`Notification`,duration:r=5e3,swipeDirection:i=`right`,swipeThreshold:a=50,announcerContainer:o,children:s}=e,[c,l]=z.useState(null),[u,d]=z.useState(0),f=z.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${yb}\`. Expected non-empty \`string\`.`),(0,K.jsx)(bb.Provider,{scope:t,children:(0,K.jsx)(Tb,{scope:t,label:n,duration:r,swipeDirection:i,swipeThreshold:a,toastCount:u,viewport:c,onViewportChange:l,onToastAdd:z.useCallback(()=>d(e=>e+1),[]),onToastRemove:z.useCallback(()=>d(e=>e-1),[]),isClosePausedRef:f,announcerContainer:o,children:s})})},`ToastProvider`),Ob=`ToastViewport`,kb=[`F8`],Ab=`toast.viewportPause`,jb=`toast.viewportResume`,Mb=z.forwardRef(vb(function(e,t){let{__scopeToast:n,hotkey:r=kb,label:i=`Notifications ({hotkey})`,...a}=e,o=Eb(Ob,n),s=xb(n),c=z.useRef(null),l=z.useRef(null),u=z.useRef(null),d=z.useRef(null),f=_(t,d,o.onViewportChange),p=r.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),m=o.toastCount>0;z.useEffect(()=>{let e=vb(e=>{r.length!==0&&r.every(t=>e[t]||e.code===t)&&d.current?.focus()},`handleKeyDown`);return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[r]),z.useEffect(()=>{let e=c.current,t=d.current;if(m&&e&&t){let n=vb(()=>{if(!o.isClosePausedRef.current){let e=new CustomEvent(Ab);t.dispatchEvent(e),o.isClosePausedRef.current=!0}},`handlePause`),r=vb(()=>{if(o.isClosePausedRef.current){let e=new CustomEvent(jb);t.dispatchEvent(e),o.isClosePausedRef.current=!1}},`handleResume`),i=vb(t=>{e.contains(t.relatedTarget)||r()},`handleFocusOutResume`),a=vb(()=>{e.contains(document.activeElement)||r()},`handlePointerLeaveResume`);return e.addEventListener(`focusin`,n),e.addEventListener(`focusout`,i),e.addEventListener(`pointermove`,n),e.addEventListener(`pointerleave`,a),window.addEventListener(`blur`,n),window.addEventListener(`focus`,r),()=>{e.removeEventListener(`focusin`,n),e.removeEventListener(`focusout`,i),e.removeEventListener(`pointermove`,n),e.removeEventListener(`pointerleave`,a),window.removeEventListener(`blur`,n),window.removeEventListener(`focus`,r)}}},[m,o.isClosePausedRef]);let h=z.useCallback(({tabbingDirection:e})=>{let t=s().map(t=>{let n=t.ref.current,r=[n,...ex(n)];return e===`forwards`?r:r.reverse()});return(e===`forwards`?t.reverse():t).flat()},[s]);return z.useEffect(()=>{let e=d.current;if(e){let t=vb(t=>{let n=t.altKey||t.ctrlKey||t.metaKey;if(t.key===`Tab`&&!n){let n=document.activeElement,r=t.shiftKey;if(t.target===e&&r){l.current?.focus();return}let i=h({tabbingDirection:r?`backwards`:`forwards`}),a=i.findIndex(e=>e===n);tx(i.slice(a+1))?t.preventDefault():r?l.current?.focus():u.current?.focus()}},`handleKeyDown`);return e.addEventListener(`keydown`,t),()=>e.removeEventListener(`keydown`,t)}},[s,h]),(0,K.jsxs)(iu,{ref:c,role:`region`,"aria-label":i.replace(`{hotkey}`,p),tabIndex:-1,style:{pointerEvents:m?void 0:`none`},children:[m&&(0,K.jsx)(Pb,{ref:l,onFocusFromOutsideViewport:()=>{tx(h({tabbingDirection:`forwards`}))}}),(0,K.jsx)(bb.Slot,{scope:n,children:(0,K.jsx)(Q.ol,{tabIndex:-1,...a,ref:f})}),m&&(0,K.jsx)(Pb,{ref:u,onFocusFromOutsideViewport:()=>{tx(h({tabbingDirection:`backwards`}))}})]})},`ToastViewport`)),Nb=`ToastFocusProxy`,Pb=z.forwardRef(vb(function(e,t){let{__scopeToast:n,onFocusFromOutsideViewport:r,...i}=e,a=Eb(Nb,n);return(0,K.jsx)(gb,{tabIndex:0,...i,ref:t,style:{position:`fixed`},onFocus:e=>{let t=e.relatedTarget;a.viewport?.contains(t)||r()}})},`ToastFocusProxy`)),Fb=`Toast`,Ib=`toast.swipeStart`,Lb=`toast.swipeMove`,Rb=`toast.swipeCancel`,zb=`toast.swipeEnd`,Bb=z.forwardRef(vb(function(e,t){let{forceMount:n,open:r,defaultOpen:i,onOpenChange:a,...o}=e,[s,c]=Nl({prop:r,defaultProp:i??!0,onChange:a,caller:Fb});return(0,K.jsx)(Du,{present:n||s,children:(0,K.jsx)(Ub,{open:s,...o,ref:t,onClose:()=>c(!1),onPause:Vl(e.onPause),onResume:Vl(e.onResume),onSwipeStart:ll(e.onSwipeStart,e=>{e.currentTarget.setAttribute(`data-swipe`,`start`)}),onSwipeMove:ll(e.onSwipeMove,e=>{let{x:t,y:n}=e.detail.delta;e.currentTarget.setAttribute(`data-swipe`,`move`),e.currentTarget.style.setProperty(`--radix-toast-swipe-move-x`,`${t}px`),e.currentTarget.style.setProperty(`--radix-toast-swipe-move-y`,`${n}px`)}),onSwipeCancel:ll(e.onSwipeCancel,e=>{e.currentTarget.setAttribute(`data-swipe`,`cancel`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-y`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-end-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-end-y`)}),onSwipeEnd:ll(e.onSwipeEnd,e=>{let{x:t,y:n}=e.detail.delta;e.currentTarget.setAttribute(`data-swipe`,`end`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-y`),e.currentTarget.style.setProperty(`--radix-toast-swipe-end-x`,`${t}px`),e.currentTarget.style.setProperty(`--radix-toast-swipe-end-y`,`${n}px`),c(!1)})})})},`Toast`)),[Vb,Hb]=Cb(Fb,{onClose(){}}),Ub=z.forwardRef(vb(function(e,t){let{__scopeToast:n,type:r=`foreground`,duration:i,open:a,onClose:o,onEscapeKeyDown:s,onPause:c,onResume:l,onSwipeStart:u,onSwipeMove:d,onSwipeCancel:f,onSwipeEnd:p,...m}=e,h=Eb(Fb,n),g=xb(n),[v,y]=z.useState(null),b=_(t,y),x=z.useRef(null),S=z.useRef(null),C=i||h.duration,w=z.useRef(0),T=z.useRef(C),E=z.useRef(0),{onToastAdd:D,onToastRemove:O}=h,k=Vl(()=>{v?.contains(document.activeElement)&&h.viewport?.focus(),o()}),ee=z.useCallback(e=>{!e||e===1/0||(window.clearTimeout(E.current),w.current=new Date().getTime(),E.current=window.setTimeout(k,e))},[k]);z.useEffect(()=>{let e=h.viewport;if(e){let t=vb(()=>{ee(T.current),l?.()},`handleResume`),n=vb(()=>{let e=new Date().getTime()-w.current;T.current-=e,window.clearTimeout(E.current),c?.()},`handlePause`);return e.addEventListener(Ab,n),e.addEventListener(jb,t),()=>{e.removeEventListener(Ab,n),e.removeEventListener(jb,t)}}},[h.viewport,C,c,l,ee]),z.useEffect(()=>{a&&!h.isClosePausedRef.current&&ee(C)},[a,C,h.isClosePausedRef,ee]),z.useEffect(()=>()=>{window.clearTimeout(E.current)},[]),z.useEffect(()=>(D(),()=>O()),[D,O]);let A=z.useMemo(()=>v?Yb(v):null,[v]);return h.viewport?(0,K.jsxs)(K.Fragment,{children:[A&&(0,K.jsx)(Wb,{__scopeToast:n,role:`status`,"aria-live":r===`foreground`?`assertive`:`polite`,children:A}),(0,K.jsx)(Vb,{scope:n,onClose:k,children:lo.createPortal((0,K.jsx)(bb.ItemSlot,{scope:n,children:(0,K.jsx)(ru,{asChild:!0,onEscapeKeyDown:ll(s,e=>{g().some(t=>t.ref.current?.contains(e.target))||k()}),children:(0,K.jsx)(Q.li,{tabIndex:0,"data-state":a?`open`:`closed`,"data-swipe-direction":h.swipeDirection,...m,ref:b,style:{userSelect:`none`,touchAction:`none`,...e.style},onKeyDown:ll(e.onKeyDown,e=>{e.key===`Escape`&&(s?.(e.nativeEvent),e.nativeEvent.defaultPrevented||k())}),onPointerDown:ll(e.onPointerDown,e=>{e.button===0&&(x.current={x:e.clientX,y:e.clientY})}),onPointerMove:ll(e.onPointerMove,e=>{if(!x.current)return;let t=e.clientX-x.current.x,n=e.clientY-x.current.y,r=!!S.current,i=[`left`,`right`].includes(h.swipeDirection),a=[`left`,`up`].includes(h.swipeDirection)?Math.min:Math.max,o=i?a(0,t):0,s=i?0:a(0,n),c=e.pointerType===`touch`?10:2,l={x:o,y:s},f={originalEvent:e,delta:l};r?(S.current=l,Xb(Lb,d,f,{discrete:!1})):Zb(l,h.swipeDirection,c)?(S.current=l,Xb(Ib,u,f,{discrete:!1}),e.target.setPointerCapture(e.pointerId)):(Math.abs(t)>c||Math.abs(n)>c)&&(x.current=null)}),onPointerUp:ll(e.onPointerUp,e=>{let t=S.current,n=e.target;if(n.hasPointerCapture(e.pointerId)&&n.releasePointerCapture(e.pointerId),S.current=null,x.current=null,t){let n=e.currentTarget,r={originalEvent:e,delta:t};Zb(t,h.swipeDirection,h.swipeThreshold)?Xb(zb,p,r,{discrete:!0}):Xb(Rb,f,r,{discrete:!0}),n.addEventListener(`click`,e=>e.preventDefault(),{once:!0})}})})})}),h.viewport)})]}):null},`ToastImpl`)),Wb=vb(e=>{let{__scopeToast:t,children:n,...r}=e,i=Eb(Fb,t),[a,o]=z.useState(!1),[s,c]=z.useState(!1);return Qb(()=>o(!0)),z.useEffect(()=>{let e=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(e)},[]),s?null:(0,K.jsx)(Cu,{asChild:!0,container:i.announcerContainer||void 0,children:(0,K.jsx)(gb,{...r,children:a&&(0,K.jsxs)(K.Fragment,{children:[i.label,` `,n]})})})},`ToastAnnounce`),Gb=z.forwardRef(vb(function(e,t){let{__scopeToast:n,...r}=e;return(0,K.jsx)(Q.div,{...r,ref:t})},`ToastTitle`)),Kb=`ToastClose`,qb=z.forwardRef(vb(function(e,t){let{__scopeToast:n,...r}=e,i=Hb(Kb,n);return(0,K.jsx)(Jb,{asChild:!0,children:(0,K.jsx)(Q.button,{type:`button`,...r,ref:t,onClick:ll(e.onClick,i.onClose)})})},`ToastClose`)),Jb=z.forwardRef(vb(function(e,t){let{__scopeToast:n,altText:r,...i}=e;return(0,K.jsx)(Q.div,{"data-radix-toast-announce-exclude":``,"data-radix-toast-announce-alt":r||void 0,...i,ref:t})},`ToastAnnounceExclude`));function Yb(e){let t=[];return Array.from(e.childNodes).forEach(e=>{if(e.nodeType===e.TEXT_NODE&&e.textContent&&t.push(e.textContent),$b(e)){let n=e.ariaHidden||e.hidden||e.style.display===`none`,r=e.dataset.radixToastAnnounceExclude===``;if(!n)if(r){let n=e.dataset.radixToastAnnounceAlt;n&&t.push(n)}else t.push(...Yb(e))}}),t}vb(Yb,`getAnnounceTextContent`);function Xb(e,t,n,{discrete:r}){let i=n.originalEvent.currentTarget,a=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Rl(i,a):i.dispatchEvent(a)}vb(Xb,`handleAndDispatchCustomEvent`);var Zb=vb((e,t,n=0)=>{let r=Math.abs(e.x),i=Math.abs(e.y),a=r>i;return t===`left`||t===`right`?a&&r>n:!a&&i>n},`isDeltaInDirection`);function Qb(e=()=>{}){let t=Vl(e);yl(()=>{let e=0,n=0;return e=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(e),window.cancelAnimationFrame(n)}},[t])}vb(Qb,`useNextFrame`);function $b(e){return e.nodeType===e.ELEMENT_NODE}vb($b,`isHTMLElement`);function ex(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:vb(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}vb(ex,`getTabbableCandidates`);function tx(e){let t=document.activeElement;return e.some(e=>e===t||(e.focus(),document.activeElement!==t))}vb(tx,`focusFirst`);var nx=Db,rx=Mb,ix=Bb,ax=Gb,ox=qb,sx={primary:{accent:`border-l-lt-primary`,icon:(0,K.jsx)(M,{name:`info`,className:`size-lt-icon-lg shrink-0 text-lt-primary`})},secondary:{accent:`border-l-lt-secondary`,icon:(0,K.jsx)(M,{name:`info`,className:`size-lt-icon-lg shrink-0 text-lt-muted-fg`})},success:{accent:`border-l-lt-success`,icon:(0,K.jsx)(M,{name:`circle-check`,className:`size-lt-icon-lg shrink-0 text-lt-success`})},info:{accent:`border-l-lt-info`,icon:(0,K.jsx)(M,{name:`info`,className:`size-lt-icon-lg shrink-0 text-lt-info`})},warning:{accent:`border-l-lt-warning`,icon:(0,K.jsx)(M,{name:`circle-alert`,className:`size-lt-icon-lg shrink-0 text-lt-warning`})},danger:{accent:`border-l-lt-danger`,icon:(0,K.jsx)(M,{name:`circle-x`,className:`size-lt-icon-lg shrink-0 text-lt-danger`})}},cx=0;function lx({duration:e=4e3}){let{t}=P(`lattice`),[n,r]=(0,z.useState)([]);function i(e){r(t=>t.filter(t=>t.id!==e))}return(0,z.useEffect)(()=>Xy(e=>{r(t=>[...t,{...e,id:cx++}])}),[]),(0,K.jsxs)(nx,{duration:e,swipeDirection:`down`,children:[n.map(n=>(0,K.jsxs)(ix,{className:k(`flex items-start gap-3 rounded-lt border border-l-4 border-lt-border bg-lt-popover p-4 text-lt-popover-fg shadow-lt-lg`,sx[n.variant].accent,`data-[state=open]:animate-lt-toast-in data-[state=closed]:animate-lt-toast-out`,`data-[swipe=move]:translate-y-[var(--radix-toast-swipe-move-y)] data-[swipe=cancel]:translate-y-0 data-[swipe=cancel]:transition-transform`),"data-test":`toast-${n.variant}`,duration:n.persistent?1/0:n.duration??e,onOpenChange:e=>{e||i(n.id)},children:[sx[n.variant].icon,(0,K.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-2`,children:[(0,K.jsx)(ax,{className:`text-sm text-lt-fg`,children:Uy(n.message,t)}),n.action?(0,K.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:(0,K.jsx)(Y,{node:n.action})}):null]}),n.dismissible?(0,K.jsx)(ox,{"aria-label":t(`common.dismiss`,`Dismiss`),className:`shrink-0 rounded-lt-sm p-1 text-lt-muted-fg transition-colors hover:bg-lt-muted hover:text-lt-fg`,"data-test":`toast-dismiss`,children:(0,K.jsx)(M,{name:`x`,className:`size-lt-icon-md`})}):null]},n.id)),(0,K.jsx)(rx,{className:`fixed inset-x-0 bottom-0 z-lt-toast mx-auto flex w-full max-w-sm flex-col gap-2 p-4 outline-none`})]})}var ux=0,dx=()=>{let{t:e}=P(`lattice`),[t,n]=(0,z.useState)([]);(0,z.useEffect)(()=>Qy(e=>{n(t=>[...e.unique?t.filter(t=>t.unique!==e.unique):t,{...e,id:ux++}])}),[]),(0,z.useEffect)(()=>W.on(`navigate`,()=>{n(e=>e.filter(e=>!e.unique))}),[]),(0,z.useEffect)(()=>$y(e=>{n(t=>t.filter(t=>t.unique!==e))}),[]);function r(e){n(t=>t.filter(t=>t.id!==e))}return t.length===0?null:(0,K.jsx)(`div`,{className:`flex w-full flex-col gap-2`,children:t.map(t=>(0,K.jsxs)(`div`,{role:`status`,"data-test":`callout-${t.variant}`,className:k(`flex items-start gap-3 rounded-lt border border-l-4 border-lt-border bg-lt-popover p-4 text-lt-popover-fg`,sx[t.variant].accent),children:[sx[t.variant].icon,(0,K.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-2`,children:[t.title?(0,K.jsx)(`p`,{className:`text-sm font-medium text-lt-fg`,children:Uy(t.title,e)}):null,(0,K.jsx)(`p`,{className:`text-sm text-lt-fg`,children:Uy(t.message,e)}),t.action?(0,K.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:(0,K.jsx)(Y,{node:t.action})}):null]}),t.dismissible?(0,K.jsx)(`button`,{type:`button`,"aria-label":e(`common.dismiss`,`Dismiss`),"data-test":`callout-dismiss`,className:`shrink-0 rounded-lt-sm p-1 text-lt-muted-fg transition-colors hover:bg-lt-muted hover:text-lt-fg`,onClick:()=>r(t.id),children:(0,K.jsx)(M,{name:`x`,className:`size-lt-icon-md`})}):null]},t.id))})};function fx({align:e=`start`,children:t,className:n,placement:r=`bottom`,testId:i,trigger:a,triggerClassName:o,triggerLabel:s}){let[c,l]=(0,z.useState)(!1),u=Do().url;return(0,z.useEffect)(()=>l(!1),[u]),(0,K.jsxs)(kh,{open:c,onOpenChange:l,children:[(0,K.jsx)(Ah,{asChild:!0,children:(0,K.jsx)(`button`,{"aria-label":s,className:k(`w-full`,o),"data-test":i,title:s,type:`button`,children:a})}),(0,K.jsx)(Mh,{align:e,className:k(`min-w-56 p-1`,n),role:`menu`,side:r,children:(0,K.jsx)(Uc,{collapsed:!1,children:t})})]})}var px=({children:e,node:t})=>{let n=t.key??`dropdown`;return(0,K.jsx)(fx,{placement:t.props.placement,testId:n,triggerClassName:`w-auto`,trigger:(0,K.jsx)(`span`,{className:`flex min-w-0 items-center rounded-lt-sm px-2 py-1.5 text-sm hover:bg-lt-muted`,children:t.props.trigger.map((e,t)=>(0,K.jsx)(Y,{node:e},e.key??`${e.type}-${t}`))}),children:(0,K.jsx)(`ul`,{className:`flex flex-col gap-1`,children:e})})},mx=({children:e,node:t})=>(0,K.jsx)(`nav`,{"data-lattice-component":J(t),children:(0,K.jsx)(`ul`,{className:`flex flex-col gap-1`,children:e})}),hx=(0,z.createContext)(null);function gx(e){return e.type===`action`||e.type===`action.bulk`}function _x({children:e,render:t}){return(0,K.jsx)(hx.Provider,{value:t,children:e})}function vx(){return(0,z.useContext)(hx)}function yx({action:e,children:t,options:n}){let r=vx();if(!r)throw Error(`Action triggers require an ActionTriggerProvider.`);return(0,K.jsx)(K.Fragment,{children:r({action:e,children:t,options:n})})}function bx(e){let t=zc(),n=nl(),r=e.action??null,i=e.effects??[],a=e.modal??null;if(a)return{kind:`modal`,onClick:()=>{if(!n)throw Error(Qc);n.open(a)}};if(r){if(!gx(r))throw Error(`Clickable action nodes must have type [action] or [action.bulk].`);return{kind:`action`,action:r}}return i.length>0?{kind:`effects`,onClick:()=>t(Lc(i))}:e.href!=null&&e.href!==``?{kind:`navigate`,href:e.href,method:e.method??`get`}:{kind:`none`}}var xx=`flex items-center gap-2 rounded-lt-sm px-3 py-2 text-base font-medium text-lt-fg transition-colors hover:bg-lt-muted`;function Sx({affix:e,className:t}){return e.icon?(0,K.jsx)(is,{className:k(`size-lt-icon-md shrink-0`,t),icon:e.icon}):(0,K.jsx)(`span`,{className:k(`shrink-0 text-sm text-lt-muted-fg`,t),children:e.text})}function Cx(e,t){return(e??[]).some(e=>e.props?.href===t||Cx(e.schema,t))}var wx=({children:e,node:t})=>{let n=Wc(),{icon:r,label:i,prefix:a,suffix:o}=t.props,s=i??``,c=!!r,l=r??a?.icon??null,u=Do().url.split(`?`)[0],d=nc(`menu`,t),f=bx(t.props),p=r?(0,K.jsx)(is,{className:`size-lt-icon-md shrink-0`,icon:r}):(0,K.jsxs)(K.Fragment,{children:[a?(0,K.jsx)(Sx,{affix:a}):null,n?(0,K.jsx)(`span`,{className:`pointer-events-none absolute top-1/2 left-full z-lt-popover ml-2 hidden -translate-y-1/2 rounded-lt-sm border border-lt-border bg-lt-popover px-2 py-1 text-sm whitespace-nowrap text-lt-popover-fg shadow-lt-md group-hover:block`,role:`tooltip`,children:s}):(0,K.jsx)(`span`,{children:s}),o?(0,K.jsx)(Sx,{affix:o,className:`ml-auto`}):null]}),m=k(xx,`w-full`,n&&`group relative justify-center`,c&&`justify-center`),h=({onClick:e,processing:t})=>(0,K.jsx)(`button`,{"aria-label":n||c?s:void 0,className:m,"data-test":d,disabled:t,onClick:e,type:`button`,children:p});if(f.kind===`action`)return(0,K.jsx)(`li`,{children:(0,K.jsx)(yx,{action:f.action,children:h})});if(f.kind===`effects`||f.kind===`modal`)return(0,K.jsx)(`li`,{children:h({onClick:f.onClick,processing:!1})});if(f.kind===`navigate`){let e=u===f.href;return(0,K.jsx)(`li`,{children:(0,K.jsx)(Ho,{"aria-current":e?`page`:void 0,"aria-label":n||c?s:void 0,as:f.method===`get`?void 0:`button`,className:k(m,e&&`bg-lt-muted font-medium`),"data-test":d,href:f.href,method:f.method,children:p})})}return e?n?(0,K.jsx)(Ex,{icon:l,label:s,testId:d,children:e}):(0,K.jsx)(Tx,{content:p,defaultOpen:Cx(t.schema,u),testId:d,children:e}):n?null:(0,K.jsx)(`li`,{children:(0,K.jsx)(`span`,{className:`flex items-center gap-2 px-3 py-2 text-xs font-semibold tracking-wide text-lt-muted-fg uppercase`,children:p})})};function Tx({children:e,content:t,defaultOpen:n,testId:r}){let[i,a]=(0,z.useState)(n);return(0,K.jsxs)(`li`,{children:[(0,K.jsxs)(`button`,{"aria-expanded":i,className:k(xx,`w-full`),"data-test":r,onClick:()=>a(e=>!e),type:`button`,children:[t,(0,K.jsx)(M,{name:`chevron-right`,className:k(`ml-auto size-lt-icon-md shrink-0 transition-transform`,i&&`rotate-90`)})]}),i?(0,K.jsx)(`ul`,{className:`mt-1 flex flex-col gap-1 pl-3`,children:e}):null]})}function Ex({children:e,icon:t,label:n,testId:r}){return(0,K.jsx)(`li`,{children:(0,K.jsx)(fx,{className:`min-w-48`,placement:`right`,testId:r,trigger:t?(0,K.jsx)(is,{className:`size-lt-icon-md shrink-0`,icon:t}):(0,K.jsx)(`span`,{children:n}),triggerClassName:k(xx,`justify-center`),triggerLabel:n,children:(0,K.jsxs)(`ul`,{className:`flex flex-col gap-1`,children:[(0,K.jsx)(`li`,{className:`px-3 py-1.5 text-xs font-semibold tracking-wide text-lt-muted-fg uppercase`,children:n}),e]})})})}var Dx=(0,z.createContext)(null);function Ox({outlet:e,children:t}){return(0,K.jsx)(Dx.Provider,{value:e,children:t})}function kx(){return(0,z.useContext)(Dx)}var Ax=()=>(0,K.jsx)(K.Fragment,{children:kx()});function jx(e,t,n){let[r,i]=bg(e,t,{enabled:n,parse:e=>e===`true`,serialize:String});return[r,(0,z.useCallback)(()=>i(e=>!e),[i])]}var Mx=`(min-width: 768px)`;function Nx(e,t){let n=e.detail?.target;return n==null||n===t}var Px={components:{breadcrumbs:B(By),callouts:B(dx),dropdown:B(px),menu:B(mx),"menu-item":B(wx),outlet:B(Ax),sidebar:B(({children:e,node:t})=>{let n=t.props.collapsible,r=t.props.rememberState,i=J(t),a=`lattice:sidebar:${i??`default`}`,o=Ag(Mx,!0),[s,c]=jx(a,!1,n&&r),[l,u]=(0,z.useState)(!1);Rs(d.toggleSidebar,e=>{Nx(e,i)&&(window.matchMedia?.(Mx).matches??!0?n&&c():u(e=>!e))}),(0,z.useEffect)(()=>W.on(`navigate`,()=>u(!1)),[]),Rs(`keydown`,e=>{e.key===`Escape`&&u(!1)},{enabled:l});let f=n&&s&&o;return(0,K.jsxs)(Uc,{collapsed:f,children:[l?(0,K.jsx)(`div`,{"aria-hidden":`true`,className:`fixed inset-0 z-lt-overlay bg-lt-overlay md:hidden`,"data-test":`sidebar-backdrop`,onClick:()=>u(!1)}):null,(0,K.jsx)(`aside`,{className:k(`fixed inset-y-0 left-0 z-lt-modal flex h-svh w-72 max-w-[80vw] shrink-0 flex-col gap-4 border-r border-lt-border bg-lt-bg p-4 transition-transform`,`md:sticky md:top-0 md:z-auto md:max-w-none md:translate-x-0 md:transition-[width]`,l?`translate-x-0`:`-translate-x-full`,f?`md:w-16 md:overflow-visible`:`md:w-64 md:overflow-x-hidden md:overflow-y-auto`),"data-collapsed":f?`true`:`false`,"data-lattice-component":i,"data-test":`sidebar`,children:e})]})}),"sidebar.footer":B(({children:e,node:t})=>(0,K.jsx)(`div`,{className:`mt-auto flex flex-col gap-4`,"data-lattice-component":J(t),children:e})),topbar:B(({children:e,node:t})=>{let n=t.props.sticky;return(0,K.jsx)(`header`,{"data-lattice-component":J(t),className:k(`flex h-14 w-full items-center gap-2 border-b border-lt-border bg-lt-bg px-4 text-lt-fg`,n&&`sticky top-0 z-lt-sticky`),children:e})})},name:`lattice/layout`};function Fx(e,t=1){return Dc(`${e}?page=${t}`)}function Ix(e,t){return Dc(`${e}/${t}/read`,{method:`PATCH`})}function Lx(e){return Dc(`${e}/read-all`,{method:`POST`})}function Rx(e,t){return Dc(`${e}/${t}`,{method:`DELETE`})}function zx(e){return Dc(e,{method:`DELETE`})}function Bx(e,t){return e.some(e=>e.id===t.id)?e:[t,...e]}function Vx(e,t){return e.map(e=>e.id===t?{...e,isRead:!0}:e)}function Hx(e,t){return e.filter(e=>e.id!==t)}function Ux({endpoint:e,pollingInterval:t}){let[n,r]=(0,z.useState)([]),[i,a]=(0,z.useState)(0),[o,s]=(0,z.useState)(`loading`),[c,l]=(0,z.useState)(!1),[u,d]=(0,z.useState)(!1),f=(0,z.useRef)(1),p=(0,z.useRef)(c);p.current=c;let m=(0,z.useRef)(!1),h=(0,z.useCallback)(async()=>{try{let t=await Fx(e,1);f.current=1,r(t.notifications),a(t.unreadCount),l(t.hasMore),s(`idle`)}catch{s(`error`)}},[e]);return(0,z.useEffect)(()=>{h()},[h]),(0,z.useEffect)(()=>{if(!t||t<=0)return;let e=setInterval(()=>void h(),t*1e3);return()=>clearInterval(e)},[h,t]),{notifications:n,unreadCount:i,status:o,hasMore:c,open:u,setOpen:d,loadMore:(0,z.useCallback)(()=>{if(m.current||!p.current)return;m.current=!0;let t=f.current+1;Fx(e,t).then(e=>{f.current=t,r(t=>[...t,...e.notifications]),l(e.hasMore)}).catch(()=>void h()).finally(()=>{m.current=!1})},[e,h]),markRead:(0,z.useCallback)(t=>{r(e=>Vx(e,t)),a(e=>Math.max(0,e-1)),Ix(e,t).then(e=>a(e.unreadCount)).catch(()=>void h())},[e,h]),markAllRead:(0,z.useCallback)(()=>{r(e=>e.map(e=>({...e,isRead:!0}))),a(0),Lx(e).then(e=>a(e.unreadCount)).catch(()=>void h())},[e,h]),dismiss:(0,z.useCallback)(t=>{r(e=>Hx(e,t)),Rx(e,t).then(e=>a(e.unreadCount)).catch(()=>void h())},[e,h]),clearAll:(0,z.useCallback)(()=>{r([]),a(0),zx(e).then(e=>a(e.unreadCount)).catch(()=>void h())},[e,h]),receive:(0,z.useCallback)(e=>{r(t=>{let n=Bx(t,e);return n!==t&&a(e=>e+1),n})},[])}}function Wx(e){let t=e,n=new Set;return{publish(e){t=e,n.forEach(e=>e())},subscribe(e){return n.add(e),()=>n.delete(e)},getSnapshot:()=>t}}var Gx=(0,z.createContext)(null),Kx=Gx.Provider;function qx(){let e=(0,z.useContext)(Gx);if(!e)throw Error(`useLiveNotifications must be used within a NotificationsBridgeProvider.`);return(0,z.useSyncExternalStore)(e.subscribe,e.getSnapshot)}function Jx(){let{t:e}=P(`lattice`);return(0,K.jsxs)(`div`,{className:`flex flex-col items-center gap-2 px-4 py-10 text-lt-muted-fg`,children:[(0,K.jsx)(M,{name:`bell`,className:`size-lt-icon-lg`}),(0,K.jsx)(`p`,{className:`text-sm`,children:e(`notifications.empty`,`No notifications yet`)})]})}var Yx={primary:`text-lt-primary`,secondary:`text-lt-muted-fg`,success:`text-lt-success`,info:`text-lt-info`,warning:`text-lt-warning`,danger:`text-lt-danger`};function Xx({notification:e,onMarkRead:t,onDismiss:n}){let{t:r}=P(`lattice`),i=Uy(e.title,r),a=Uy(e.body,r),o=(0,K.jsxs)(K.Fragment,{children:[i?(0,K.jsx)(`p`,{className:`truncate text-sm font-medium text-lt-fg`,children:i}):null,a?(0,K.jsx)(`p`,{className:`text-sm text-lt-muted-fg`,children:a}):null]});return(0,K.jsxs)(`li`,{className:k(`flex gap-3 px-3 py-3`,!e.isRead&&`bg-lt-muted/40`),"data-test":`notification`,children:[e.icon?(0,K.jsx)(is,{icon:e.icon,className:k(`mt-0.5 size-lt-icon-md`,e.variant?Yx[e.variant]:void 0)}):null,(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[e.href?(0,K.jsx)(Ho,{href:e.href,className:`block`,"data-test":`notification-link`,onClick:()=>t(e.id),children:o}):o,e.actions.length>0?(0,K.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-2`,children:e.actions.map((e,t)=>(0,K.jsx)(Y,{node:e},e.key??e.id??`action-${t}`))}):null]}),(0,K.jsxs)(`div`,{className:`flex shrink-0 flex-col gap-1`,children:[e.isRead?null:(0,K.jsx)(`button`,{type:`button`,className:`text-xs text-lt-muted-fg hover:text-lt-fg`,onClick:()=>t(e.id),children:r(`notifications.mark-read`,`Mark read`)}),(0,K.jsx)(`button`,{type:`button`,"aria-label":r(`notifications.dismiss`,`Dismiss`),className:`text-xs text-lt-muted-fg hover:text-lt-fg`,onClick:()=>n(e.id),children:r(`notifications.dismiss`,`Dismiss`)})]})]})}function Zx({notifications:e,status:t,hasMore:n,onMarkRead:r,onDismiss:i,onLoadMore:a}){let{t:o}=P(`lattice`);return t===`loading`&&e.length===0?(0,K.jsxs)(`div`,{className:`space-y-2 p-3`,children:[(0,K.jsx)(Kf,{className:`h-12 w-full`}),(0,K.jsx)(Kf,{className:`h-12 w-full`}),(0,K.jsx)(Kf,{className:`h-12 w-full`})]}):e.length===0?(0,K.jsx)(Jx,{}):(0,K.jsxs)(`div`,{className:`max-h-96 overflow-y-auto`,children:[(0,K.jsx)(`ul`,{className:`divide-y divide-lt-border`,children:e.map(e=>(0,K.jsx)(Xx,{notification:e,onMarkRead:r,onDismiss:i},e.id))}),n?(0,K.jsx)(`button`,{type:`button`,className:`w-full py-2 text-sm text-lt-muted-fg hover:text-lt-fg`,onClick:a,children:o(`notifications.load-more`,`Load more`)}):null]})}function Qx({onClosed:e}){let t=el();if(!t)throw Error(Qc);let n=qx(),{t:r}=P(`lattice`),i=r(`notifications.label`,`Notifications`),a=r(`notifications.heading`,`Notifications`);return(0,K.jsx)(Ff,{open:t.open,onOpenChange:t.onOpenChange,children:(0,K.jsxs)(Bf,{"aria-describedby":void 0,className:`p-0`,onCloseAutoFocus:n=>{t.onExited(n),e()},placement:`end`,width:`sm`,children:[(0,K.jsx)(Rf,{className:`sr-only`,children:i}),(0,K.jsxs)(`div`,{className:`w-full`,"data-test":`notifications-panel`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between border-b border-lt-border px-3 py-2`,children:[(0,K.jsx)(`span`,{className:`text-sm font-medium`,children:a}),n.unreadCount>0?(0,K.jsx)(`button`,{type:`button`,className:`text-xs text-lt-muted-fg hover:text-lt-fg`,onClick:n.markAllRead,children:r(`notifications.mark-all-read`,`Mark all read`)}):null]}),(0,K.jsx)(Zx,{notifications:n.notifications,status:n.status,hasMore:n.hasMore,onMarkRead:n.markRead,onDismiss:n.dismiss,onLoadMore:n.loadMore})]})]})})}var $x=(0,z.lazy)(()=>_e(()=>import(`./notifications-echo-BLO9_g1w.js`).then(e=>({default:e.NotificationsEcho})),__vite__mapDeps([17,18,1,2]),import.meta.url)),eS=class extends z.Component{state={failed:!1};static getDerivedStateFromError(){return{failed:!0}}componentDidCatch(){console.warn(`[lattice] The notifications bell declares a realtime channel but Echo is unavailable. Install @laravel/echo-react and call configureEcho().`)}render(){return this.state.failed?null:this.props.children}},tS={name:`lattice/notifications`,components:{notifications:B(({node:e})=>{let{t}=P(`lattice`),n=Ux({endpoint:e.props.endpoint,pollingInterval:e.props.pollingInterval}),r=rl(),i=(0,z.useRef)(null),[a]=(0,z.useState)(()=>Wx(n));(0,z.useEffect)(()=>{a.publish(n)},[a,n]);let o=t(`notifications.label`,`Notifications`),s=(0,z.useCallback)(()=>{i.current||=r.open((0,K.jsx)(Kx,{value:a,children:(0,K.jsx)(Qx,{onClosed:()=>{i.current=null}})}))},[a,r]),c=(0,K.jsxs)(`span`,{className:`relative inline-flex items-center justify-center rounded-lt-sm p-2 hover:bg-lt-muted`,children:[(0,K.jsx)(M,{name:`bell`,className:`size-lt-icon-md`}),n.unreadCount>0?(0,K.jsx)(`span`,{"data-test":`notifications-badge`,className:`absolute -right-0.5 -top-0.5 inline-flex min-w-4 items-center justify-center rounded-lt-full bg-lt-danger px-1 py-0 text-[10px] font-medium text-lt-danger-fg`,children:n.unreadCount}):null]}),l=(0,K.jsxs)(`div`,{className:`w-80`,"data-test":`notifications-panel`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between border-b border-lt-border px-3 py-2`,children:[(0,K.jsx)(`span`,{className:`text-sm font-medium`,children:t(`notifications.heading`,`Notifications`)}),n.unreadCount>0?(0,K.jsx)(`button`,{type:`button`,className:`text-xs text-lt-muted-fg hover:text-lt-fg`,onClick:n.markAllRead,children:t(`notifications.mark-all-read`,`Mark all read`)}):null]}),(0,K.jsx)(Zx,{notifications:n.notifications,status:n.status,hasMore:n.hasMore,onMarkRead:n.markRead,onDismiss:n.dismiss,onLoadMore:n.loadMore})]});return(0,K.jsxs)(K.Fragment,{children:[e.props.channel?(0,K.jsx)(eS,{children:(0,K.jsx)(z.Suspense,{fallback:null,children:(0,K.jsx)($x,{channel:e.props.channel,onReceive:e=>n.receive(e)})})}):null,e.props.slideOut?(0,K.jsx)(`button`,{type:`button`,"aria-label":o,"data-test":`notifications-trigger`,onClick:s,children:c}):(0,K.jsxs)(kh,{open:n.open,onOpenChange:n.setOpen,children:[(0,K.jsx)(Ah,{asChild:!0,children:(0,K.jsx)(`button`,{type:`button`,"aria-label":o,"data-test":`notifications-trigger`,children:c})}),(0,K.jsx)(Mh,{align:`end`,className:`p-0`,children:l})]})]})})}};function nS(e){return e==null?``:String(e)}function rS({props:e}){let{t}=P(`lattice`),[n,r]=(0,z.useState)([]),[a,o]=(0,z.useState)(null),[s,c]=(0,z.useState)(!1);return(0,z.useEffect)(()=>{if(!e.remote||!e.dataEndpoint){r([]),c(!1);return}let t=!1;return o(null),c(!0),Pc(e.dataEndpoint,{remote:e.remote}).then(e=>{t||r(e.data??[])}).catch(e=>{t||o(e instanceof Error?e.message:String(e))}).finally(()=>{t||c(!1)}),()=>{t=!0}},[e.dataEndpoint,e.remote]),a?(0,K.jsx)(`div`,{className:`rounded-lt border border-lt-danger/40 p-3 text-sm`,children:a}):s||!e.remote?(0,K.jsx)(`div`,{className:`rounded-lt border border-lt-border p-3 text-sm`,children:t(`common.remote.data-list.loading`,`Loading...`)}):(0,K.jsxs)(`div`,{className:`rounded-lt border border-lt-border bg-lt-bg`,children:[(0,K.jsx)(`div`,{className:`border-b border-lt-border px-3 py-2 text-sm font-medium`,children:t(`common.remote.data-list.title`,`Remote data`)}),(0,K.jsxs)(`div`,{className:`divide-y divide-lt-border`,children:[n.map((t,n)=>(0,K.jsx)(`div`,{className:`px-3 py-2`,children:(0,K.jsx)(Xc,{nodes:i(e.schema,t)})},nS(t.id)||n)),n.length===0?(0,K.jsx)(`div`,{className:`px-3 py-2 text-sm text-lt-muted-fg`,children:e.emptyLabel??t(`common.remote.data-list.empty`,`No data`)}):null]})]})}var iS={components:{"remote.data-list":B(({node:e})=>(0,K.jsx)(rS,{props:{...e.props,schema:e.schema}}))},name:`lattice/remote`};function aS(e){return e==null||e===``}function oS(e){return aS(e)?!0:Array.isArray(e)?e.every(oS):typeof e==`object`&&e?Object.values(e).every(oS):!1}function sS(e){return!oS(e)}function cS(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function lS(e){return cS(e)?e:{}}function uS(e){return Array.isArray(e)?e.filter(e=>typeof e==`object`&&!!e&&typeof e.field==`string`&&typeof e.operator==`string`&&typeof e.value==`string`):[]}function dS(e){return Array.isArray(e)?e.filter(e=>typeof e==`object`&&!!e&&`key`in e&&`props`in e&&typeof e.key==`string`&&typeof e.props==`object`&&e.props!==null&&typeof e.props.label==`string`):[]}function fS(e){return Array.isArray(e)?e.filter(e=>typeof e==`object`&&!!e&&!Array.isArray(e)):[]}var pS={mode:`none`,currentPage:null,lastPage:null,perPage:null,total:null,from:null,to:null,hasMore:!1,nextPage:null};function mS(e){return typeof e!=`object`||!e||Array.isArray(e)?pS:e}function hS(e){if(typeof e!=`object`||!e||Array.isArray(e))return{filters:[],sorts:[],page:1,perPage:25,tableFilters:{},tableFilterIndicators:[],search:``,mode:null};let t=e;return{filters:uS(t.filters),sorts:Array.isArray(t.sorts)?t.sorts:[],page:typeof t.page==`number`?t.page:1,perPage:typeof t.perPage==`number`?t.perPage:25,tableFilters:yS(t.tableFilters),tableFilterIndicators:bS(t.tableFilterIndicators),search:typeof t.search==`string`?t.search:``,mode:_S(t.mode)}}var gS=new Set([`none`,`simple`,`table`,`infinite`]);function _S(e){return typeof e==`string`&&gS.has(e)?e:null}function vS(e){return Array.isArray(e)?e.filter(e=>typeof e==`number`||e===`infinite`):[]}function yS(e){return typeof e!=`object`||!e||Array.isArray(e)?{}:Object.fromEntries(Object.entries(e).filter(e=>typeof e[1]==`object`&&e[1]!==null&&!Array.isArray(e[1])))}function bS(e){return Array.isArray(e)?e.filter(e=>typeof e==`object`&&!!e&&typeof e.filter==`string`&&typeof e.label==`string`&&typeof e.value==`string`):[]}function xS(e,t){let n=e.id??e.uuid??e.key??t;return String(n)}function SS(e){return Array.isArray(e.actions)?e.actions:[]}function CS(e){let t=e.detail;return typeof t==`object`&&t&&!Array.isArray(t)?t:null}function wS(e,t){return e.sorts.find(e=>e.key===t.key)}function TS(e){if(e?.direction===`asc`)return`ascending`;if(e?.direction===`desc`)return`descending`}function ES(e,t){let n=new URL(e,window.location.origin);return t.filters.length>0&&n.searchParams.set(`filter`,NS(t)),t.sorts.length>0&&n.searchParams.set(`sort`,PS(t)),t.search!==``&&n.searchParams.set(`q`,t.search),DS(n,t.tableFilters),n.searchParams.set(`page`,String(t.page)),n.searchParams.set(`per_page`,String(t.perPage)),t.mode!=null&&n.searchParams.set(`mode`,t.mode),`${n.pathname}${n.search}`}function DS(e,t){for(let[n,r]of Object.entries(OS(t)))jS(e,`tf[${n}]`,r)}function OS(e){let t={};for(let[n,r]of Object.entries(e)){let e=kS(r);e!==void 0&&(t[n]=e)}return t}function kS(e){if(aS(e)||Array.isArray(e)||typeof e!=`object`)return;let t=Object.entries(e).map(([e,t])=>[e,AS(t)]).filter(e=>e[1]!==void 0);return t.length>0?Object.fromEntries(t):void 0}function AS(e){if(!aS(e)){if(Array.isArray(e)){let t=e.map(AS).filter(e=>e!==void 0);return t.length>0?t:void 0}if(typeof e==`object`){if(e===null)return;let t=Object.entries(e).map(([e,t])=>[e,AS(t)]).filter(e=>e[1]!==void 0);return t.length>0?Object.fromEntries(t):void 0}return String(e)}}function jS(e,t,n){if(Array.isArray(n)){for(let r of n)jS(e,`${t}[]`,r);return}if(typeof n==`object`&&n){for(let[r,i]of Object.entries(n))jS(e,`${t}[${r}]`,i);return}e.searchParams.append(t,String(n))}function MS(e){let t={};e.filters.length>0&&(t.filter=NS(e)),e.sorts.length>0&&(t.sort=PS(e));let n=OS(e.tableFilters);return Object.keys(n).length>0&&(t.tf=n),e.search!==``&&(t.q=e.search),t}function NS(e){return e.filters.map(e=>`${e.field}:${e.operator}:${encodeURIComponent(e.value)}`).join(`,`)}function PS(e){return e.sorts.map(e=>e.direction===`desc`?`-${e.key}`:e.key).join(`,`)}var FS={contains:`contains`,starts_with:`starts with`,ends_with:`ends with`,eq:`equals`,neq:`not equals`,gt:`>`,gte:`≥`,lt:`<`,lte:`≤`,in:`in`,not_in:`not in`,before:`before`,after:`after`,empty:`is empty`,filled:`is not empty`},IS=new Set([`empty`,`filled`]);function LS(e){return re(`lattice`,`table.operators.${e}`,FS[e]??e)}function RS(e){return e===`desc`?`descending`:`ascending`}function zS(e,t){if(!t.props.sortable)return e;let n=e.find(e=>e.key===t.key),r=e.filter(e=>e.key!==t.key);return n?n.direction===`asc`?[...r,{key:t.key,direction:`desc`}]:r:[...e,{key:t.key,direction:`asc`}]}function BS(e,t){if(t<=5)return Array.from({length:t},(e,t)=>t+1);let n=Math.max(1,Math.min(e-2,t-4));return Array.from({length:5},(e,t)=>n+t)}function VS(e){return e.map(e=>({key:e.key,label:e.props.label,width:HS(e)}))}function HS(e){return e.props.width??`md`}function US(e,t,n=!1){return{leadingTracks:[...n?[`2.5rem`]:[],...t?[`3rem`]:[]],trailingTracks:e?[`10rem`]:[]}}function WS(e){let t=(0,z.useMemo)(()=>dS(e.props?.columns),[e.props?.columns]),n=typeof e.props?.endpoint==`string`?e.props.endpoint:null,r=typeof e.props?.ref==`string`?e.props.ref:``,i=e.props?.lazy===!0,a=(0,z.useMemo)(()=>hS(e.props?.query),[e.props?.query]),o=(0,z.useMemo)(()=>fS(e.props?.data),[e.props?.data]),s=(0,z.useMemo)(()=>mS(e.props?.pagination),[e.props?.pagination]),[c,l]=(0,z.useState)(o),[u,f]=(0,z.useState)(s),[p,m]=(0,z.useState)(a),[h,g]=(0,z.useState)(i),[_,v]=(0,z.useState)(!i),y=(0,z.useRef)(null),b=u.currentPage??p.page,x=(u.mode??`table`)===`infinite`,S=(0,z.useCallback)(async(e,t=!1)=>{if(n){g(!0);try{let i=await Dc(ES(n,e),{ref:r}),a=hS(i.query),o=fS(i.data);l(e=>t?[...e,...o]:o),f(mS(i.pagination)),m(a),v(!0)}finally{g(!1)}}},[n,r]);function C(e){S({...p,page:1,sorts:zS(p.sorts,e)})}function w(e){S({...p,page:1,sorts:p.sorts.filter(t=>t.key!==e.key)})}function T(e){let t={...p,filters:e,page:1};m(t),S(t)}function E(e){T([...p.filters,e])}function D(e,t){T(p.filters.map((n,r)=>r===e?t:n))}function O(e){T(p.filters.filter((t,n)=>n!==e))}function k(e,t){T([...p.filters.filter(t=>t.field!==e),...t])}function ee(e,t){let n={...p.tableFilters};oS(t)||!cS(t)?delete n[e]:n[e]=t;let r={...p,tableFilters:n,tableFilterIndicators:p.tableFilterIndicators.filter(t=>t.filter!==e),page:1};m(r),S(r)}function A(){let e={...p,filters:[],tableFilters:{},tableFilterIndicators:[],search:``,page:1};m(e),S(e)}function j(e){let t={...p,search:e,page:1};m(t),S(t)}let M=(0,z.useCallback)(async(e,t,i)=>{if(!n)return[];let a=new URL(n,window.location.origin);a.searchParams.set(`_sub`,`search`),a.searchParams.set(`_target`,e),a.searchParams.set(`_q`,t);let o=await Ec(`${a.pathname}${a.search}`,{ref:r,signal:i,throwOnError:!1});return o.ok?(await o.json()).options??[]:[]},[n,r]);function N(e){S({...p,page:e})}function P(e){let t=s.mode??`table`,n={...p,perPage:e===`infinite`?p.perPage:e,mode:e===`infinite`?`infinite`:t===`infinite`?`table`:null,page:1};m(n),S(n)}let F=(0,z.useCallback)(()=>{h||!u.hasMore||S({...p,page:u.nextPage??b+1},!0)},[b,S,u.hasMore,u.nextPage,h,p]);return(0,z.useEffect)(()=>{l(o),f(s),m(a),g(i),v(!i)},[o,s,a,i]),(0,z.useEffect)(()=>{!i||_||S(p)},[_,i,S,p]),Rs(d.reloadComponent,t=>{t.detail?.component===e.id&&S(p)}),(0,z.useEffect)(()=>{if(!x||!u.hasMore||h||!y.current||typeof IntersectionObserver>`u`)return;let e=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&F()},{rootMargin:`240px`});return e.observe(y.current),()=>e.disconnect()},[x,F,u.hasMore,h]),{columns:t,rows:c,pagination:u,query:p,filters:p.filters,tableFilters:p.tableFilters,search:p.search,addFilter:E,updateFilter:D,removeFilter:O,replaceColumnFilters:k,setTableFilter:ee,resetFilters:A,setSearch:j,searchFilterOptions:M,processing:h,hasLoaded:_,infiniteLoaderRef:y,sort:C,clearSort:w,goToPage:N,setPerPage:P,loadMore:F}}function GS(e){let[t,n]=(0,z.useState)(()=>new Set),[r,i]=(0,z.useState)(!1),a=e.join(` `);(0,z.useEffect)(()=>{n(new Set),i(!1)},[a]);let o=(0,z.useCallback)(e=>{i(!1),n(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),s=(0,z.useCallback)(()=>{i(!1),n(t=>t.size===e.length?new Set:new Set(e))},[e]),c=(0,z.useCallback)(()=>i(!0),[]),l=(0,z.useCallback)(()=>{i(!1),n(new Set)},[]),u=e.filter(e=>t.has(e)),d=e.length>0&&u.length===e.length;return{selectedKeys:u,allMatching:r,allVisibleSelected:d,allSelected:r||d,active:r||u.length>0,isSelected:e=>r||t.has(e),toggle:o,toggleAll:s,selectAllMatching:c,clear:l}}function KS({columns:e,storageKey:t}){let n=(0,z.useMemo)(()=>e.filter(e=>e.props.toggleable),[e]),r=(0,z.useMemo)(()=>n.map(e=>e.key),[n]),[i,a]=bg(t??``,{},{enabled:!!t,parse:e=>JS(e,r),serialize:e=>YS(e,r)}),o=(0,z.useCallback)(e=>e.props.toggleable?i[e.key]??!e.props.hiddenByDefault:!0,[i]),s=(0,z.useMemo)(()=>e.filter(e=>o(e)),[e,o]),c=(0,z.useCallback)((e,t)=>{a(n=>({...n,[e]:t}))},[a]),l=(0,z.useCallback)(()=>a({}),[a]),u=n.length>0;return{hasHidden:n.some(e=>!o(e)),hasToggleableColumns:u,isVisible:o,resetVisibility:l,setColumnVisible:c,toggleableColumns:n,visibleColumns:s}}function qS(e,t){let n=new Set(t),r={};for(let[t,i]of Object.entries(e))n.has(t)&&typeof i==`boolean`&&(r[t]=i);return r}function JS(e,t){let n=JSON.parse(e)?.overrides;if(typeof n!=`object`||!n||Array.isArray(n))throw Error(`unexpected stored column visibility shape`);return qS(n,t)}function YS(e,t){let n=qS(e,t);return Object.keys(n).length===0?null:JSON.stringify({overrides:n})}function XS(){let[e,t]=(0,z.useState)(()=>new Set);return{isExpanded:(0,z.useCallback)(t=>e.has(t),[e]),toggle:(0,z.useCallback)(e=>{t(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[])}}var ZS={start:`text-start`,center:`text-center`,end:`text-end`},QS={start:`justify-start`,center:`justify-center`,end:`justify-end`},$S={start:`justify-items-start`,center:`justify-items-center`,end:`justify-items-end`},eC=e=>ZS[e],tC=e=>QS[e],nC=e=>$S[e];function rC(e){return Array.isArray(e)?e.flatMap(e=>e.type!==`action`&&e.type!==`action.bulk`||!e.props?.endpoint?[]:[e]):[]}function iC({actions:e,selectedKeys:t,allMatching:n,total:r,query:i,canSelectAllMatching:a,onSelectAllMatching:o,onCompleted:s}){let{t:c}=P(`lattice`),l=()=>n?{allMatching:!0,...i}:{selected:t},u=n?r??t.length:t.length;return(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 border-b border-lt-border bg-lt-muted/50 p-4 text-sm`,children:[(0,K.jsx)(`span`,{className:`font-medium`,children:n?c(`table.bulk.all-selected`,`All {{count}} selected`,{count:u}):c(`table.bulk.selected`,`{{count}} selected`,{count:u})}),a&&(0,K.jsx)(`button`,{type:`button`,"data-test":`bulk-select-all-matching`,className:`font-medium text-lt-primary underline underline-offset-2`,onClick:o,children:c(`table.bulk.select-all-matching`,`Select all {{total}} matching`,{total:r})}),(0,K.jsx)(`div`,{className:`flex flex-wrap items-center gap-2`,children:e.map((e,t)=>(0,K.jsx)(yx,{action:e,options:{extraData:l,onSuccess:s},children:({onClick:t,processing:n})=>(0,K.jsxs)(cs,{type:`button`,"data-test":tc(`bulk-action`,e.id),variant:e.props.variant,emphasis:e.props.emphasis,disabled:n,onClick:t,children:[n&&(0,K.jsx)($s,{}),e.props.label]})},e.key??e.id??t))})]})}function aC({className:e,density:t,children:n,ref:r,...i}){return(0,K.jsx)(`select`,{ref:r,"data-slot":`native-select`,className:k(ce({density:t}),`cursor-pointer`,e),...i,children:n})}function oC(e){return e===!0||e===1||e===`1`||e===`true`}function sC({filter:e,value:t,processing:n,bare:r=!1,onChange:i,onSearch:a}){let{t:o}=P(`lattice`),s=e.schema??[];return s.length===0?(0,K.jsx)(uC,{filter:e,value:t,processing:n,onChange:i}):(0,K.jsxs)(`div`,{className:`flex items-end gap-2`,children:[(0,K.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,K.jsx)(cC,{filter:e,schema:s,value:t,processing:n,bare:r,onChange:i,onSearch:a})}),sS(t)&&(0,K.jsx)(fv,{size:`md`,icon:`x`,label:o(`table.filter.clear`,`Clear {{label}} filter`,{label:e.props.label}),disabled:n,onClick:()=>i(void 0)})]})}function cC({filter:e,schema:t,value:n,processing:r,bare:i,onChange:a,onSearch:o}){let s=(0,z.useMemo)(()=>lS(n),[n]),c=(0,z.useMemo)(()=>({action:`#`,clearErrors:()=>{},componentId:`table-filter-${e.key}`,componentRef:``,errors:{},fieldIdPrefix:`table-filter-${e.key}`,fieldLabels:{},precognitive:!1,processing:r,searchOptions:(e,t,n,r)=>o?o(e,t,r):Promise.resolve([]),touch:()=>{},validate:()=>{},validateFields:()=>{},validating:!1}),[e.key,o,r]),l=(0,K.jsx)(`div`,{"aria-disabled":r,className:k(`grid gap-3`,r&&`pointer-events-none opacity-60`),children:(0,K.jsx)(Xc,{nodes:t})});return(0,K.jsx)(Jf,{value:c,children:(0,K.jsx)(Zf,{value:{markUserEdit:()=>{}},children:(0,K.jsx)(Cp,{nodes:{},children:(0,K.jsx)(Pp,{initial:s,children:(0,K.jsx)(lC,{onChange:a,children:i?(0,K.jsx)(Gp,{children:l}):l})})})})})}function lC({children:e,onChange:t}){let n=Ip(),r=zp(),i=(0,z.useRef)(n);i.current=n;let a=(0,z.useCallback)((e,n)=>{let a=typeof n==`function`?n(ap(i.current,e)):n,o=sp(i.current,e,a);i.current=o,r(e,a),t(o)},[t,r]),o=(0,z.useMemo)(()=>({blur:()=>{},change:a,commit:a}),[a]);return(0,K.jsx)(Hp,{value:o,children:e})}function uC({filter:e,value:t,processing:n,onChange:r}){let i=oC(lS(t).value);return(0,K.jsxs)(`label`,{className:`flex h-lt-control-md cursor-pointer items-center gap-2 text-sm`,children:[(0,K.jsx)(u_,{"aria-label":e.props.label,"data-test":`table-filter-${e.key}`,checked:i,disabled:n,onCheckedChange:e=>r(e===!0?{value:`1`}:void 0)}),(0,K.jsx)(`span`,{children:e.props.label})]})}function dC({type:e,label:t,value:n,processing:r,withSearchIcon:i=!1,grouped:a=!1,ariaLabel:o,testId:s,onCommit:c,onClear:l}){let{t:u}=P(`lattice`),[d,f]=(0,z.useState)(n),p=o??u(`table.filter.filter-by`,`Filter {{label}}`,{label:t}),m=a?`rounded-r-none`:``;return(0,z.useEffect)(()=>{f(n)},[n]),e===`boolean`?(0,K.jsxs)(aC,{density:`compact`,"aria-label":p,"data-test":s,className:m,disabled:r,value:n,onChange:e=>c(e.target.value),children:[(0,K.jsx)(`option`,{value:``,children:u(`table.filter.all`,`All`)}),(0,K.jsx)(`option`,{value:`true`,children:u(`table.filter.true`,`True`)}),(0,K.jsx)(`option`,{value:`false`,children:u(`table.filter.false`,`False`)})]}):e===`date`?(0,K.jsx)(le,{type:`date`,density:`compact`,"aria-label":p,"data-test":s,className:m,disabled:r,value:d,onChange:e=>{f(e.target.value),c(e.target.value)}}):(0,K.jsxs)(`div`,{className:`relative flex w-full min-w-0 items-center`,children:[i&&(0,K.jsx)(M,{name:`search`,"aria-hidden":`true`,className:`pointer-events-none absolute left-2 size-lt-icon-md text-lt-muted-fg`}),(0,K.jsx)(le,{type:e===`number`?`number`:`text`,density:`compact`,"aria-label":p,"data-test":s,className:k(m,i&&`pl-8`,l&&`pr-8`),disabled:r,value:d,onChange:e=>f(e.target.value),onKeyDown:e=>{e.key===`Enter`&&c(d)},onBlur:()=>{d!==n&&c(d)}}),l&&d!==``&&(0,K.jsx)(fv,{size:`xs`,icon:`x`,label:u(`table.filter.clear`,`Clear {{label}} filter`,{label:t}),"data-test":s?`${s}-clear`:void 0,className:`absolute right-1 size-6`,disabled:r,onClick:l})]})}function fC({column:e,clauses:t,processing:n,onAdd:r,onUpdate:i,onRemove:a,onReplace:o,onSearch:s}){let{t:c}=P(`lattice`),{filter:l,label:u}=e.props,d=u??e.key;if(!l)return null;if(l.control===`filter.select`)return(0,K.jsx)(mC,{column:e,clauses:t,processing:n,onReplace:o,onSearch:s});let f=l.type??`text`,p=l.operators??[],m=l.defaultOperator??p[0]??`eq`,h=t.find(e=>e.clause.operator===m)??t[0];function g(t){if(t===``){h&&a(h.index);return}h?i(h.index,{...h.clause,value:t}):r({field:e.key,operator:m,value:t})}return(0,K.jsxs)(`div`,{className:`flex min-w-0 max-w-80 items-stretch`,children:[(0,K.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,K.jsx)(dC,{type:f,label:d,value:h?.clause.value??``,processing:n,withSearchIcon:f===`text`||f===`number`,grouped:!0,testId:`filter-${e.key}-value`,onCommit:g,onClear:h?()=>a(h.index):void 0})}),(0,K.jsxs)(kh,{children:[(0,K.jsx)(Ah,{asChild:!0,children:(0,K.jsx)(fv,{emphasis:`segmented`,size:`md`,icon:`filter`,label:c(`table.filter.column-filters`,`{{label}} filters`,{label:d}),"data-test":`filter-${e.key}`,disabled:n,children:t.length>0&&(0,K.jsx)(`span`,{className:`absolute -right-1.5 -top-1.5 inline-flex size-4 items-center justify-center rounded-full bg-lt-primary text-xs font-medium text-lt-primary-fg`,children:t.length})})}),(0,K.jsx)(Mh,{align:`start`,className:`w-80 p-4`,children:(0,K.jsx)(vC,{column:e,clauses:t,operators:p,defaultOperator:m,processing:n,onAdd:r,onUpdate:i,onRemove:a})})]})]})}function pC(e){return Array.isArray(e)?e.join(`,`):typeof e==`string`?e:``}function mC({column:e,clauses:t,processing:n,onReplace:r,onSearch:i}){let{filter:a,label:o}=e.props,s=o??e.key;if(!a)return null;let c=a.multiple,l=a.defaultOperator,u=a.clauseOptions??[],d=gC(t.map(e=>e.clause),u),f=t.find(e=>e.clause.operator===l)??t[0],p=d?d.value:c?f?.clause.value?f.clause.value.split(`,`):[]:f?.clause.value??``,m={key:e.key,type:`filter.select`,props:{label:s,options:a.options,multiple:c,searchable:a.searchable,placeholder:null},schema:[{type:`field.select`,key:e.key,props:{name:`value`,label:s,options:a.options,multiple:c,searchable:a.searchable,placeholder:null}}]};function h(t){let n=pC(lS(t).value);if(n===``){r(e.key,[]);return}let i=u.find(e=>e.value===n);if(i){r(e.key,hC(e.key,i));return}r(e.key,[{field:e.key,operator:l,value:n}])}return(0,K.jsx)(sC,{filter:m,value:{value:p},processing:n,bare:!0,onChange:h,onSearch:i?(e,t,n)=>i(t,n):void 0})}function hC(e,t){return t.clauses.map(t=>({field:e,operator:t.operator,value:t.value}))}function gC(e,t){return t.find(t=>_C(e,hC(``,t)))}function _C(e,t){return e.length===t.length&&t.every(t=>e.some(e=>e.operator===t.operator&&e.value===t.value))}function vC({column:e,clauses:t,operators:n,defaultOperator:r,processing:i,onAdd:a,onUpdate:o,onRemove:s}){let{t:c}=P(`lattice`),l=e.props.filter?.type??`text`,[u,d]=(0,z.useState)(r),[f,p]=(0,z.useState)(t.length===0);return(0,K.jsxs)(`div`,{className:`grid gap-3`,children:[t.map(t=>(0,K.jsx)(yC,{column:e,type:l,operators:n,clause:t.clause,processing:i,onOperator:e=>o(t.index,{...t.clause,operator:e}),onValue:e=>e===``?s(t.index):o(t.index,{...t.clause,value:e}),onRemove:()=>s(t.index)},t.index)),f&&(0,K.jsx)(yC,{column:e,type:l,operators:n,clause:{field:e.key,operator:u,value:``},processing:i,onOperator:t=>{if(IS.has(t)){a({field:e.key,operator:t,value:``}),d(r),p(!1);return}d(t)},onValue:t=>{t!==``&&(a({field:e.key,operator:u,value:t}),d(r),p(!1))},onRemove:()=>p(!1)}),(0,K.jsx)(`div`,{className:`border-t border-lt-border pt-3`,children:(0,K.jsx)(cs,{variant:`secondary`,icon:`plus`,"data-test":`filter-${e.key}-add`,className:`w-full`,disabled:i,onClick:()=>p(!0),children:c(`table.filter.add`,`Add filter`)})})]})}function yC({column:e,type:t,operators:n,clause:r,processing:i,onOperator:a,onValue:o,onRemove:s}){let{t:c}=P(`lattice`),l=e.props.label??e.key,u=IS.has(r.operator);return(0,K.jsxs)(`div`,{className:`grid gap-2`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[n.length>1?(0,K.jsx)(aC,{density:`compact`,"aria-label":c(`table.filter.operator`,`{{label}} operator`,{label:l}),"data-test":`filter-${e.key}-operator`,className:`flex-1`,disabled:i,value:r.operator,onChange:e=>a(e.target.value),children:n.map(e=>(0,K.jsx)(`option`,{value:e,children:LS(e)},e))}):(0,K.jsx)(`span`,{className:`flex-1 text-sm font-medium`,children:LS(r.operator)}),(0,K.jsx)(cs,{emphasis:`outline`,size:`icon`,icon:`trash-2`,"aria-label":c(`table.filter.remove`,`Remove {{label}} filter`,{label:l}),"data-test":`filter-${e.key}-remove`,disabled:i,onClick:s})]}),!u&&(0,K.jsx)(dC,{type:t,label:l,ariaLabel:c(`table.filter.value`,`{{label}} filter value`,{label:l}),value:r.value,processing:i,onCommit:o,onClear:()=>o(``)})]})}function bC({sort:e}){return e?.direction===`asc`?(0,K.jsx)(M,{name:`arrow-up`,"aria-hidden":`true`,className:`size-lt-icon-sm shrink-0`}):e?.direction===`desc`?(0,K.jsx)(M,{name:`arrow-down`,"aria-hidden":`true`,className:`size-lt-icon-sm shrink-0`}):(0,K.jsx)(M,{name:`chevrons-up-down`,"aria-hidden":`true`,className:`size-lt-icon-sm shrink-0 opacity-50`})}function xC({bottomBordered:e,column:t,processing:n,resizeHandleProps:r,sort:i,query:a}){let o=wS(a,t),{t:s}=P(`lattice`),{align:c,label:l,sortable:u}=t.props;return(0,K.jsxs)(`div`,{"aria-sort":TS(o),className:k(`relative min-w-0 bg-lt-muted/50 px-4 py-3 pr-5 align-middle font-semibold text-lt-fg`,e&&`border-b border-lt-border`,eC(c)),role:`columnheader`,children:[u?(0,K.jsxs)(`button`,{type:`button`,"aria-label":s(`table.sort.column`,`Sort {{label}}`,{label:l}),className:k(`flex w-full items-center gap-1.5 font-semibold`,tC(c)),"data-test":`sort-${t.key}`,disabled:n,onClick:()=>i(t),children:[(0,K.jsx)(`span`,{className:k(`min-w-0 flex-1 truncate`,eC(c)),children:l}),(0,K.jsx)(bC,{sort:o})]}):(0,K.jsx)(`span`,{className:k(`block truncate`,eC(c)),children:l}),r&&(0,K.jsx)(`div`,{...r})]})}function SC({columns:e,hasHidden:t,isVisible:n,onReset:r,onToggle:i,processing:a,visibleColumnCount:o}){let{t:s}=P(`lattice`),c=s(`table.columns.label`,`Columns`);return(0,K.jsxs)(kh,{children:[(0,K.jsx)(Ah,{asChild:!0,children:(0,K.jsx)(fv,{size:`sm`,icon:`columns-3`,label:c,"data-test":`table-columns-menu`,disabled:a})}),(0,K.jsx)(Mh,{align:`end`,className:`w-64 p-4`,children:(0,K.jsxs)(`div`,{className:`grid gap-3`,children:[e.map(e=>{let t=n(e),r=t&&o<=1;return(0,K.jsxs)(`label`,{className:`flex items-center gap-2 text-base text-lt-fg`,children:[(0,K.jsx)(u_,{"data-test":`table-column-toggle-${e.key}`,checked:t,disabled:r,onCheckedChange:t=>i(e.key,t===!0)}),(0,K.jsx)(`span`,{children:e.props.label??e.key})]},e.key)}),t&&(0,K.jsx)(`button`,{type:`button`,"data-test":`table-columns-reset`,className:`mt-1 justify-self-start text-sm text-lt-muted-fg hover:text-lt-fg`,onClick:r,children:s(`table.columns.reset`,`Reset`)})]})})]})}function CC({clauses:e,columnsByKey:t,indicators:n,processing:r,onRemoveClause:i,onChange:a,onReset:o}){let{t:s}=P(`lattice`);return e.length===0&&n.length===0?null:(0,K.jsx)(`div`,{className:`border-b border-lt-border px-4 py-3`,children:(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-sm`,children:[e.map((e,n)=>{let a=t.get(e.field)?.props.label??e.field,o=IS.has(e.operator);return(0,K.jsx)(wC,{label:`${a} ${LS(e.operator)}`,value:o?``:e.value,removeTestId:`filter-chip-${e.field}-remove`,removeLabel:s(`table.filter.remove`,`Remove {{label}} filter`,{label:a}),processing:r,onRemove:()=>i(n)},`${e.field}-${e.operator}-${n}`)}),n.map(e=>(0,K.jsx)(wC,{label:e.label,value:e.value,removeTestId:`table-filter-chip-${e.filter}-remove`,removeLabel:s(`table.filter.remove`,`Remove {{label}} filter`,{label:e.label}),processing:r,onRemove:()=>a(e.filter,void 0)},`${e.filter}:${e.label}:${e.value}`)),(0,K.jsx)(`button`,{type:`button`,"data-test":`table-filters-reset`,className:`text-lt-muted-fg underline-offset-2 hover:underline disabled:text-lt-disabled-fg`,disabled:r,onClick:o,children:s(`table.filter.reset-all`,`Reset all`)})]})})}function wC({label:e,value:t,removeTestId:n,removeLabel:r,processing:i,onRemove:a}){return(0,K.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 rounded-lt-sm bg-lt-muted px-2 py-1`,children:[(0,K.jsx)(`span`,{children:t===``?(0,K.jsx)(`span`,{className:`font-semibold`,children:e}):(0,K.jsxs)(K.Fragment,{children:[`${e}: `,(0,K.jsx)(`span`,{className:`font-semibold`,children:t})]})}),(0,K.jsx)(fv,{size:`xs`,icon:`x`,label:r,"data-test":n,disabled:i,onClick:a})]})}function TC({filters:e,values:t,processing:n,onChange:r,onSearch:i}){let{t:a}=P(`lattice`),o=e.filter(e=>sS(t[e.key])),s=a(`table.filter.filters`,`Filters`);return(0,K.jsxs)(kh,{children:[(0,K.jsx)(Ah,{asChild:!0,children:(0,K.jsx)(fv,{size:`sm`,icon:`filter`,label:s,"data-test":`table-filters-menu`,disabled:n,children:o.length>0&&(0,K.jsx)(`span`,{className:`absolute -right-1 -top-1 inline-flex size-3.5 items-center justify-center rounded-full bg-lt-primary text-[10px] font-medium leading-none text-lt-primary-fg`,children:o.length})})}),(0,K.jsx)(Mh,{align:`end`,className:`w-80 p-4`,children:(0,K.jsx)(`div`,{className:`grid gap-3`,children:e.map(e=>(0,K.jsx)(`div`,{className:`grid gap-1`,children:(0,K.jsx)(sC,{filter:e,value:t[e.key],processing:n,onChange:t=>r(e.key,t),onSearch:i?(t,n,r)=>i(`filter:${e.key}.${t}`,n,r):void 0})},e.key))})})]})}function EC({pagination:e,currentPage:t,processing:n,mode:r,hasNextPage:i,visiblePages:a,infiniteLoaderRef:o,perPageOptions:s,perPageValue:c,onPerPage:l,onPage:u,onLoadMore:d}){let{t:f}=P(`lattice`);return(0,K.jsxs)(`div`,{"data-slot":`table-pagination`,className:`flex items-center justify-between gap-3 border-t border-lt-border p-4 text-sm`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,K.jsx)(`span`,{children:e.total==null?f(`table.pagination.page`,`Page {{page}}`,{page:t}):f(`table.pagination.showing`,`Showing {{from}}-{{to}} of {{total}}`,{from:e.from??0,to:e.to??0,total:e.total})}),s.length>0&&r!==`none`&&(0,K.jsxs)(`label`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`text-lt-muted-fg`,children:f(`table.pagination.per-page`,`Rows per page`)}),(0,K.jsx)(aC,{"data-test":`pagination-per-page`,disabled:n,value:String(c),onChange:e=>l(e.target.value===`infinite`?`infinite`:Number(e.target.value)),children:s.map(e=>(0,K.jsx)(`option`,{value:String(e),children:e===`infinite`?f(`table.pagination.infinite`,`Infinite`):e},String(e)))})]})]}),r===`infinite`?(0,K.jsx)(`div`,{ref:o,className:`flex items-center gap-2`,children:e.hasMore?(0,K.jsx)(cs,{emphasis:`outline`,"data-test":`pagination-load-more`,disabled:n,onClick:d,children:n?f(`table.pagination.loading`,`Loading...`):f(`table.pagination.load-more`,`Load more`)}):(0,K.jsx)(`span`,{className:`text-lt-muted-fg`,children:f(`table.pagination.all-loaded`,`All rows loaded`)})}):r===`simple`?(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(cs,{emphasis:`outline`,"data-test":`pagination-previous`,disabled:n||t<=1,onClick:()=>u(t-1),children:f(`table.pagination.previous`,`Previous`)}),(0,K.jsx)(cs,{emphasis:`outline`,"data-test":`pagination-next`,disabled:n||!i,onClick:()=>u(t+1),children:f(`table.pagination.next`,`Next`)})]}):r===`table`?(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(cs,{emphasis:`outline`,"data-test":`pagination-previous`,disabled:n||t<=1,onClick:()=>u(t-1),children:f(`table.pagination.previous`,`Previous`)}),a.map(e=>(0,K.jsx)(cs,{emphasis:`outline`,size:`icon`,"data-test":`pagination-page-${e}`,disabled:n||e===t,"aria-current":e===t?`page`:void 0,"aria-label":f(`table.pagination.page`,`Page {{page}}`,{page:e}),onClick:()=>u(e),children:e},e)),(0,K.jsx)(cs,{emphasis:`outline`,"data-test":`pagination-next`,disabled:n||!i,onClick:()=>u(t+1),children:f(`table.pagination.next`,`Next`)})]}):null]})}function DC({columnsByKey:e,query:t,processing:n,onClear:r}){let{t:i}=P(`lattice`);return(0,K.jsx)(`div`,{className:`flex flex-wrap items-center gap-4 border-b border-lt-border px-4 py-2.5 text-sm`,children:t.sorts.map((t,a)=>{let o=e.get(t.key)?.props.label??t.key,s=t.direction===`desc`?`arrow-down`:`arrow-up`;return(0,K.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,K.jsx)(`span`,{className:`font-medium`,children:`${a+1}. ${o}`}),(0,K.jsx)(M,{name:s,role:`img`,"aria-hidden":!1,"aria-label":RS(t.direction),className:`size-lt-icon-sm text-lt-muted-fg`}),(0,K.jsx)(fv,{size:`xs`,icon:`x`,label:i(`table.sort.clear`,`Clear {{label}} sort`,{label:o}),"data-test":`clear-${t.key}-sort`,disabled:n,onClick:()=>r(t)})]},t.key)})})}var OC=300;function kC({value:e,onSearch:t}){let{t:n}=P(`lattice`),[r,i]=(0,z.useState)(e),a=(0,z.useRef)(e);(0,z.useEffect)(()=>{e!==a.current&&(a.current=e,i(e))},[e]);function o(e){a.current=e,t(e)}let s=sm(o,OC);function c(e){i(e),s(e)}function l(){s.cancel(),i(``),o(``)}let u=n(`table.search.placeholder`,`Search`);return(0,K.jsxs)(`div`,{className:`relative w-full max-w-xs`,children:[(0,K.jsx)(M,{name:`search`,"aria-hidden":`true`,className:`pointer-events-none absolute left-2.5 top-1/2 size-lt-icon-sm -translate-y-1/2 text-lt-muted-fg`}),(0,K.jsx)(le,{type:`search`,"data-test":`table-search`,value:r,placeholder:u,"aria-label":u,onChange:e=>c(e.target.value),className:k(`px-8`,`[&::-webkit-search-cancel-button]:hidden`)}),r!==``&&(0,K.jsx)(fv,{size:`xs`,icon:`x`,label:n(`table.search.clear`,`Clear search`),"data-test":`table-search-clear`,className:`absolute right-1.5 top-1/2 -translate-y-1/2`,onClick:l})]})}var AC=`table.columns`;function jC(){return p(AC)}function MC(e){return e}function NC({color:e,className:t,style:n,...r}){let i=ue(pe(e??void 0)??fe(`gray`));return(0,K.jsx)(`span`,{"data-slot":`badge`,className:k(`lt-badge`,i.className,t),style:{...i.style,...n},...r})}function PC(e,t,n){if(e==null)return``;let r=t?.props?.date;if(r)return R(e,r,n);let i=(t?.props)?.options?.find(t=>t.value===String(e))?.label;return i===void 0?typeof e==`string`||typeof e==`number`||typeof e==`boolean`?String(e):JSON.stringify(e):i}function FC(e,t,n){let r=e.props.link;if(!r)return null;let i=r.href??String(n??``);return i===``?null:i.replace(/\{([^}]+)\}/g,(e,r)=>encodeURIComponent(String(r===`value`?n??``:t[r]??``)))}var IC=({column:e,props:t,value:n})=>{let r=PC(n,e);return r===``?null:(0,K.jsx)(NC,{color:t.colors?.[String(n)],children:r})},LC=({value:e})=>{let{t}=P(`lattice`),n=oC(e);return(0,K.jsx)(`span`,{"aria-label":n?t(`common.yes`,`Yes`):t(`common.no`,`No`),role:`img`,children:(0,K.jsx)(M,{name:n?`check`:`x`,className:k(`size-lt-icon-md`,n?`text-lt-success`:`text-lt-muted-fg`)})})},RC=({props:e,value:t})=>{let n=e.icons?.[String(t)]??e.icon??void 0;if(!n)return null;let r=pe(e.colors?.[String(t)]),i=r?ue(r):void 0;return(0,K.jsx)(`span`,{"aria-label":String(t),className:k(`lt-cell-icon`,i?.className),style:i?.style,children:(0,K.jsx)(is,{className:`size-lt-icon-md`,icon:n})})};function zC({src:e,alt:t,previewable:n,width:r,height:i,className:a,style:o,testId:s,...c}){let{t:l}=P(I),[u,d]=(0,z.useState)(!1),f=(0,K.jsx)(`img`,{...c,alt:t,src:e,width:r,height:i,className:a,style:r?{...o,width:r,height:i}:o});if(!n)return f;let p=l(`common.image.open-preview`,`View image`);return(0,K.jsxs)(Ff,{open:u,onOpenChange:d,children:[(0,K.jsx)(Lf,{asChild:!0,children:(0,K.jsx)(`button`,{type:`button`,"data-test":s,className:`cursor-zoom-in`,"aria-label":p,children:f})}),(0,K.jsxs)(Bf,{"aria-describedby":void 0,className:`max-h-[90vh] w-auto max-w-[90vw] border-none bg-transparent p-0 shadow-none`,children:[(0,K.jsx)(Rf,{className:`sr-only`,children:t||p}),(0,K.jsx)(`img`,{alt:t,src:e,"data-slot":`image-lightbox`,className:`max-h-[90vh] max-w-[90vw] rounded-lt object-contain`}),(0,K.jsx)(If,{asChild:!0,children:(0,K.jsx)(cs,{icon:`x`,"aria-label":l(`common.close`,`Close`),"data-test":`lightbox-close`,size:`icon`,emphasis:`ghost`,className:`absolute top-2 right-2 bg-lt-bg/80 hover:bg-lt-bg`})})]})]})}var BC=({column:e,props:t,value:n})=>{let r=typeof n==`string`?n:``;if(r===``)return null;let i=t.size??32;return(0,K.jsx)(zC,{alt:e.props.label??``,className:k(`object-cover`,t.circular?`rounded-full`:`rounded-lt-sm`),height:i,previewable:t.previewable,src:r,testId:`preview-${e.key}`,width:i})};function VC(e){let t=typeof e==`number`?e:Number(e);return e!=null&&e!==``&&!Number.isNaN(t)?t:null}function HC(e,t,n){let r=VC(e);if(r===null)return String(e??``);let i={notation:t.notation,minimumFractionDigits:t.minimumFractionDigits??void 0,maximumFractionDigits:t.maximumFractionDigits??void 0};return t.currency?(i.style=`currency`,i.currency=t.currency):t.unit&&(i.style=`unit`,i.unit=t.unit),new Intl.NumberFormat(n,i).format(r)}function UC({children:e,column:t,copyable:n,value:r}){return n?(0,K.jsx)(ly,{value:r,label:t.props.label??t.key,testId:`copy-${t.key}`,children:e}):e}function WC({column:e,copyable:t,format:n,value:r}){let{locale:i}=s();return VC(r)===null?(0,K.jsx)(`span`,{children:PC(r,e)}):(0,K.jsx)(UC,{column:e,copyable:t,value:String(r),children:(0,K.jsx)(`span`,{className:`tabular-nums`,children:HC(r,n,i)})})}var GC=({column:e,props:t,row:n,value:r})=>{let i=t.currencyField?n[t.currencyField]:void 0,a=t.currency??(typeof i==`string`?i:null);return(0,K.jsx)(WC,{column:e,copyable:t.copyable,value:r,format:{kind:`number`,notation:`standard`,minimumFractionDigits:t.minimumFractionDigits,maximumFractionDigits:t.maximumFractionDigits,currency:a,unit:null}})},KC=({column:e,props:t,value:n})=>(0,K.jsx)(WC,{column:e,copyable:t.copyable,value:n,format:{kind:`number`,notation:t.compact?`compact`:`standard`,minimumFractionDigits:t.minimumFractionDigits,maximumFractionDigits:t.maximumFractionDigits,currency:null,unit:t.unit}}),qC=({column:e,row:t})=>(0,K.jsx)(`div`,{className:`grid gap-1`,children:(0,K.jsx)(Xc,{nodes:i(e.schema,t)})}),JC=e=>e.props.multiple?(0,K.jsx)(XC,{...e}):e.props.badge?(0,K.jsx)(ZC,{...e}):(0,K.jsx)(QC,{...e});function YC({label:e,color:t}){return e===``?null:(0,K.jsx)(NC,{color:t,children:e})}function XC({column:e,props:t,value:n}){let r=Array.isArray(n)?n:[];return r.length===0?null:t.badge?(0,K.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:r.map((t,n)=>{let r=t;return(0,K.jsx)(YC,{label:PC(r.value,e),color:r.color},n)})}):(0,K.jsx)(`span`,{children:r.map(t=>PC(t,e)).join(`, `)})}function ZC({column:e,props:t,row:n,value:r}){let i=t.badge.colorKey;return(0,K.jsx)(YC,{label:PC(r,e),color:String(n[i]??``)})}function QC({column:e,props:t,row:n,value:r}){let i=e.props.date,a=FC(e,n,r),o=PC(r,e),s=a?(0,K.jsx)(`a`,{className:`underline underline-offset-2`,href:a,rel:t.link?.external?`noreferrer`:void 0,target:t.link?.external?`_blank`:void 0,children:o}):o;return i&&!a&&!t.copyable&&r!=null?(0,K.jsx)(Zs,{value:r,dateStyle:i.dateStyle,timeStyle:i.timeStyle}):(0,K.jsx)(UC,{column:e,copyable:t.copyable,value:o,children:s})}var $C={"column.badge":MC(IC),"column.boolean":MC(LC),"column.icon":MC(RC),"column.image":MC(BC),"column.money":MC(GC),"column.number":MC(KC),"column.stack":MC(qC),"column.text":MC(JC)};function ew({column:e,row:t}){let n=jC()[e.type]??$C[e.type]??$C[`column.text`];return(0,K.jsx)(n,{column:e,props:e.props,row:t,value:t[e.key]})}var tw={components:{table:B(({node:e})=>{let{t}=P(`lattice`),{columns:n,rows:r,pagination:i,query:a,filters:o,tableFilters:s,search:c,addFilter:l,updateFilter:u,removeFilter:d,replaceColumnFilters:f,setTableFilter:p,resetFilters:m,setSearch:h,searchFilterOptions:g,processing:_,hasLoaded:v,infiniteLoaderRef:y,sort:b,clearSort:x,goToPage:S,setPerPage:C,loadMore:w}=WS(e),T=(0,z.useMemo)(()=>rC(e.props?.bulkActions),[e.props?.bulkActions]),E=T.length>0,D=(0,z.useMemo)(()=>r.map((e,t)=>({row:e,actions:SS(e),detail:CS(e),key:xS(e,t)})),[r]),O=GS(D.map(e=>e.key)),{isExpanded:ee,toggle:A}=XS(),j=D.some(e=>e.detail!=null),N=(0,z.useMemo)(()=>new Map(n.map(e=>[e.key,e])),[n]),F=J(e),{hasToggleableColumns:I,hasHidden:te,isVisible:ne,resetVisibility:re,setColumnVisible:L,toggleableColumns:R,visibleColumns:ie}=KS({columns:n,storageKey:F?`lattice:table-column-visibility:${F}`:void 0}),ae=i.currentPage??a.page,oe=i.lastPage??ae,se=i.mode??`table`,ce=(0,z.useMemo)(()=>vS(e.props?.perPageOptions),[e.props?.perPageOptions]),le=BS(ae,oe),ue=i.hasMore??ae<oe,de=D.some(e=>e.actions.length>0),fe=e.props?.striped===!0,pe=ie.some(e=>e.props.filter!=null),me=o.map((e,t)=>({clause:e,index:t})),he=(0,z.useMemo)(()=>Array.isArray(e.props?.filters)?e.props.filters:[],[e.props?.filters]),ge=he.length>0,_e=de,B=(0,z.useMemo)(()=>Array.isArray(e.props?.toolbar)?e.props.toolbar:[],[e.props?.toolbar]),ve=(0,z.useMemo)(()=>VS(ie),[ie]),ye=(0,z.useMemo)(()=>US(_e,E,j),[_e,E,j]),be=e.props?.resizableColumns===!0,xe=J(e),{getResizeHandleProps:Se,gridTemplateColumns:Ce,hasOverrides:we,resizeRootRef:Te,resetColumns:Ee}=Sg({columns:ve,enabled:be,leadingTracks:ye.leadingTracks,showIndicator:e.props?.resizeIndicator===!0,storageKey:be&&xe?`lattice:table-columns:${xe}`:void 0,trailingTracks:ye.trailingTracks}),De=e.props?.searchable===!0||B.length>0||ge||I||we;return(0,K.jsx)(`div`,{"data-slot":`table`,"data-lattice-component":e.id,className:`relative min-w-0`,children:(0,K.jsxs)(`div`,{"data-slot":`table-scroll`,className:`rounded-lt-sm border border-lt-border`,children:[De&&(0,K.jsxs)(`div`,{"data-slot":`table-toolbar`,className:`flex items-center gap-2 border-b border-lt-border px-4 py-2`,children:[e.props?.searchable&&(0,K.jsx)(kC,{value:c,onSearch:h}),(0,K.jsxs)(`div`,{className:`ms-auto flex items-center gap-1`,children:[ge&&(0,K.jsx)(TC,{filters:he,values:s,processing:_,onChange:p,onSearch:g}),I&&(0,K.jsx)(SC,{columns:R,isVisible:ne,visibleColumnCount:ie.length,hasHidden:te,onToggle:L,onReset:re,processing:_}),we&&(0,K.jsx)(`button`,{"aria-label":t(`table.reset-column-widths`,`Reset column widths`),className:`hidden rounded-lt-sm p-1 text-lt-muted-fg hover:text-lt-fg md:inline-flex`,"data-test":`table-reset-columns`,onClick:Ee,title:t(`table.reset-column-widths`,`Reset column widths`),type:`button`,children:(0,K.jsx)(M,{name:`rotate-ccw`,className:`size-lt-icon-sm`})}),B.map((e,t)=>(0,K.jsx)(Y,{node:e},e.key??e.id??t))]})]}),(0,K.jsx)(CC,{clauses:o,columnsByKey:N,indicators:a.tableFilterIndicators,processing:_,onRemoveClause:d,onChange:p,onReset:m}),E&&O.active&&(0,K.jsx)(iC,{actions:T,selectedKeys:O.selectedKeys,allMatching:O.allMatching,total:i.total??void 0,query:MS(a),canSelectAllMatching:O.allVisibleSelected&&!O.allMatching&&i.total!=null&&i.total>O.selectedKeys.length,onSelectAllMatching:O.selectAllMatching,onCompleted:O.clear}),a.sorts.length>0&&(0,K.jsx)(DC,{columnsByKey:N,query:a,processing:_,onClear:x}),(0,K.jsx)(`div`,{"data-slot":`table-grid-scroll`,className:`relative overflow-x-auto`,children:(0,K.jsxs)(`div`,{ref:Te,className:`min-w-full text-base`,role:`table`,style:{"--lattice-table-columns":Ce},children:[(0,K.jsxs)(`div`,{"data-slot":`table-header`,role:`rowgroup`,children:[(0,K.jsxs)(`div`,{className:`hidden min-w-full md:grid md:grid-cols-[var(--lattice-table-columns)]`,role:`row`,children:[j&&(0,K.jsx)(`div`,{className:k(`bg-lt-muted/50 px-2 py-3`,!pe&&`border-b border-lt-border`),role:`columnheader`,"aria-hidden":`true`}),E&&(0,K.jsx)(`div`,{className:k(`flex items-center bg-lt-muted/50 px-4 py-3`,!pe&&`border-b border-lt-border`),role:`columnheader`,children:(0,K.jsx)(u_,{"aria-label":t(`table.select-all-rows`,`Select all rows`),"data-test":`select-all`,checked:O.allSelected,onCheckedChange:()=>O.toggleAll()})}),ie.map((e,t)=>(0,K.jsx)(xC,{column:e,processing:_,resizeHandleProps:be?Se(ve[t]):void 0,sort:b,query:a,bottomBordered:!pe},e.key)),_e&&(0,K.jsx)(`div`,{className:k(`flex items-center justify-end gap-2 bg-lt-muted/50 px-4 py-2 align-middle font-semibold text-lt-fg`,!pe&&`border-b border-lt-border`),role:`columnheader`,children:(0,K.jsx)(`span`,{className:`sr-only`,children:e.props?.actionsLabel??t(`table.actions`,`Actions`)})})]}),pe&&(0,K.jsxs)(`div`,{className:`hidden min-w-full md:grid md:grid-cols-[var(--lattice-table-columns)]`,role:`row`,children:[j&&(0,K.jsx)(`div`,{className:`border-t border-b border-lt-border bg-lt-muted/50 px-2 py-2`,role:`cell`}),E&&(0,K.jsx)(`div`,{className:`border-t border-b border-lt-border bg-lt-muted/50 px-4 py-2`,role:`cell`}),ie.map(e=>(0,K.jsx)(`div`,{className:`min-w-0 border-t border-b border-lt-border bg-lt-muted/50 px-2 py-2`,role:`cell`,children:e.props.filter!=null&&(0,K.jsx)(fC,{column:e,clauses:me.filter(t=>t.clause.field===e.key),processing:_,onAdd:l,onUpdate:u,onRemove:d,onReplace:f,onSearch:(t,n)=>g(`column:${e.key}`,t,n)})},e.key)),_e&&(0,K.jsx)(`div`,{className:`border-t border-b border-lt-border bg-lt-muted/50 px-4 py-2`,role:`cell`})]})]}),(0,K.jsx)(`div`,{role:`rowgroup`,children:v?D.length===0?(0,K.jsx)(`div`,{"data-slot":`table-empty`,className:`p-8 text-center text-lt-muted-fg`,role:`row`,children:(0,K.jsx)(`div`,{role:`cell`,children:e.props?.emptyLabel??t(`table.empty`,`No results`)})}):D.map(({row:n,actions:r,detail:i,key:a})=>{let o=i!=null&&ee(a),s=`${J(e)??`table`}-row-detail-${a}`;return(0,K.jsxs)(z.Fragment,{children:[(0,K.jsxs)(`div`,{"data-slot":`table-row`,className:`grid grid-cols-1 border-b border-lt-border last:border-b-0 md:grid-cols-[var(--lattice-table-columns)] ${fe?`odd:bg-lt-muted/30`:``}`,role:`row`,children:[j&&(0,K.jsx)(`div`,{className:`flex items-center px-2 py-lt-cell-y`,role:`cell`,children:i&&(0,K.jsx)(`button`,{type:`button`,"data-test":`row-expand-${a}`,"aria-expanded":o,"aria-controls":s,"aria-label":t(`table.row-detail.toggle`,`Toggle detail`),className:`inline-flex size-6 items-center justify-center rounded-lt-sm text-lt-muted-fg hover:bg-lt-muted hover:text-lt-fg`,onClick:()=>A(a),children:(0,K.jsx)(M,{name:`chevron-down`,"aria-hidden":`true`,className:k(`size-lt-icon-md transition-transform`,!o&&`-rotate-90`)})})}),E&&(0,K.jsx)(`div`,{className:`flex items-center px-lt-cell-x py-lt-cell-y`,role:`cell`,children:(0,K.jsx)(u_,{"aria-label":t(`table.select-row`,`Select row {{key}}`,{key:a}),"data-test":`select-row-${a}`,checked:O.isSelected(a),onCheckedChange:()=>O.toggle(a)})}),ie.map(e=>(0,K.jsxs)(`div`,{"data-slot":`table-cell`,className:k(`grid min-w-0 content-center gap-1 overflow-hidden px-lt-cell-x py-lt-cell-y`,eC(e.props.align),nC(e.props.align)),role:`cell`,children:[(0,K.jsx)(`span`,{"aria-hidden":`true`,className:`text-xs font-medium text-lt-muted-fg md:hidden`,children:e.props.label}),(0,K.jsx)(`div`,{"data-slot":`table-cell-content`,className:`min-w-0 max-w-full overflow-hidden truncate`,children:(0,K.jsx)(ew,{column:e,row:n})})]},e.key)),_e&&(0,K.jsx)(`div`,{className:k(`items-center justify-start gap-2 px-lt-cell-x py-lt-cell-y md:justify-end`,r.length>0?`flex`:`hidden md:flex`),role:`cell`,children:r.map((e,t)=>(0,K.jsx)(Y,{node:e},e.key??e.id??t))})]}),o&&i&&(0,K.jsx)(`div`,{id:s,role:`region`,"data-slot":`table-row-detail`,className:`border-b border-lt-border bg-lt-muted/20 px-lt-cell-x py-lt-cell-y`,children:(0,K.jsx)(Xc,{nodes:[i]})})]},a)}):(0,K.jsx)(`div`,{className:`p-4 text-lt-muted-fg`,role:`row`,children:(0,K.jsx)(`div`,{role:`cell`,children:t(`table.loading`,`Loading rows...`)})})})]})}),v&&(0,K.jsx)(EC,{pagination:i,currentPage:ae,processing:_,mode:se,hasNextPage:ue,visiblePages:le,infiniteLoaderRef:y,perPageOptions:ce,perPageValue:se===`infinite`?`infinite`:a.perPage,onPerPage:C,onPage:S,onLoadMore:w})]})})})},name:`lattice/table`},nw={xs:`size-6 text-[0.5rem]`,sm:`size-8 text-xs`,md:`size-10 text-sm`,lg:`size-12 text-base`,xl:`size-16 text-lg`,"2xl":`size-20 text-xl`,"3xl":`size-24 text-2xl`,"4xl":`size-32 text-3xl`};function rw({className:e,name:t,shape:n=`circle`,size:r=`md`,src:i,...a}){let o=t??void 0;return(0,K.jsx)(`span`,{"data-slot":`avatar`,role:i?void 0:`img`,"aria-label":i?void 0:o,className:k(`inline-flex shrink-0 items-center justify-center overflow-hidden bg-lt-muted font-medium text-lt-muted-fg select-none`,n===`rounded`?`rounded-lt`:`rounded-full`,nw[r],e),...a,children:i?(0,K.jsx)(`img`,{src:i,alt:o??``,className:`size-full object-cover`}):t?iw(t):(0,K.jsx)(aw,{})})}function iw(e){return e.trim().split(/\s+/).slice(0,2).map(e=>e.charAt(0).toUpperCase()).join(``)}function aw(){return(0,K.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,className:`size-[60%]`,children:[(0,K.jsx)(`path`,{d:`M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2`}),(0,K.jsx)(`circle`,{cx:`12`,cy:`7`,r:`4`})]})}function ow({children:e,className:t,defaultOpen:n,onOpenChange:r,open:i,storageKey:a,tooltip:o,trigger:s,triggerProps:c,...l}){let u=(0,z.useId)(),[d,f]=jx(a??``,n??!1,i===void 0&&a!==void 0),p=i??d,{className:m,onClick:h,onKeyDown:g,..._}=c??{};function v(e){i===void 0&&e!==d&&f(),r?.(e)}function y(e){h?.(e),!(e.defaultPrevented||sw(e.target,e.currentTarget))&&v(!p)}function b(e){g?.(e),!(e.defaultPrevented||e.target!==e.currentTarget)&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),v(!p))}return(0,K.jsxs)(`div`,{"data-slot":`collapsible`,"data-state":p?`open`:`closed`,className:t,...l,children:[(0,K.jsxs)(`div`,{..._,"aria-controls":u,"aria-expanded":p,"data-slot":`collapsible-trigger`,className:k(`flex min-h-11 w-full cursor-pointer items-center justify-between gap-4 rounded-lt-sm py-2 text-left text-lt-fg transition-colors select-none hover:bg-lt-muted focus-visible:ring-[length:var(--lt-ring-width)] focus-visible:ring-lt-ring/50 focus-visible:outline-none`,m),onClick:y,onKeyDown:b,role:`button`,tabIndex:0,children:[(0,K.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-2`,children:[s,o?(0,K.jsx)(zh,{content:o}):null]}),(0,K.jsx)(M,{name:`chevron-down`,className:k(`size-lt-icon-md shrink-0 text-lt-muted-fg transition-transform motion-reduce:transition-none`,!p&&`-rotate-90`)})]}),p&&e!=null?(0,K.jsx)(`div`,{id:u,"data-slot":`collapsible-content`,className:`flex flex-col gap-4 pt-2`,children:e}):null]})}function sw(e,t){if(!(e instanceof Element))return!1;let n=e.closest(`a[href], button, input, select, textarea, [contenteditable="true"], [role="button"]`);return n!==null&&n!==t}var cw=(0,z.createContext)(`description-list`),lw=cw.Provider;function uw(){return(0,z.useContext)(cw)}function dw({bleed:e=!1,children:t,className:n,divided:r=!1,emptyLabel:i,semantic:a=`description-list`,...o}){let s=a===`description-list`,c=k(`w-full`,r&&`divide-y divide-lt-border`,e&&`-mx-lt-gutter w-auto`,n),l=t??(i?(0,K.jsx)(`p`,{className:`px-lt-gutter py-3 text-sm text-lt-muted-fg`,children:i}):null);return(0,K.jsx)(lw,{value:a,children:s?(0,K.jsx)(`dl`,{...o,className:c,"data-slot":`description-list`,children:l}):(0,K.jsx)(`div`,{...o,className:c,"data-slot":`description-list`,role:`list`,children:l})})}function fw({"aria-label":e,children:t,className:n,defaultOpen:r=!1,offset:i=16,onOpenChange:a,open:o,placement:s=`bottom-end`,role:c,style:l,trigger:u,triggerProps:d,...f}){let[p,m]=(0,z.useState)(r),h=o??p,{className:g,onClick:_,...v}=d??{},y=pw(s,Math.max(0,i));if(u==null)return(0,K.jsx)(`div`,{"aria-label":e,className:k(`fixed z-lt-popover max-w-[calc(100vw-2rem)] rounded-lt border border-lt-border bg-lt-popover p-1 text-lt-popover-fg shadow-lt-md`,n),role:e?c??`group`:c,...f,style:{...y,...l},children:t});let b=s===`bottom-start`||s===`bottom-end`,x=s===`top-start`||s===`bottom-start`;function S(e){if(_?.(e),e.defaultPrevented)return;let t=!h;o===void 0&&m(t),a?.(t)}return(0,K.jsx)(`div`,{"aria-label":e,className:k(`fixed z-lt-popover max-w-[calc(100vw-2rem)]`,n),role:e?c??`group`:c,...f,style:{...y,...l},children:(0,K.jsxs)(`div`,{className:k(`flex w-fit gap-2`,b?`flex-col-reverse`:`flex-col`),children:[(0,K.jsx)(`button`,{...v,"aria-expanded":h,className:k(`inline-flex items-center gap-2 rounded-lt border border-lt-border bg-lt-popover px-3 py-1.5 text-sm font-medium text-lt-popover-fg shadow-lt-md hover:bg-lt-muted`,x?`self-start`:`self-end`,g),onClick:S,type:`button`,children:u}),(0,K.jsx)(`div`,{className:h?`block`:`hidden`,children:t})]})})}function pw(e,t){return e===`top-start`?{left:t,top:t}:e===`top-end`?{right:t,top:t}:e===`bottom-start`?{bottom:t,left:t}:{bottom:t,right:t}}function mw(e,t,n){let r=Object.entries(e??{});if(r.length!==0)return Object.fromEntries(r.map(([e,r])=>[`${t}-${e}`,n(r)]))}var hw=e=>typeof e==`number`?`repeat(${e}, minmax(0, 1fr))`:e,gw=e=>e===`full`?`1 / -1`:`span ${e} / span ${e}`;function _w({className:e,columns:t,style:n,...r}){return(0,K.jsx)(`div`,{"data-slot":`grid`,className:k(`lt-grid grid gap-x-4 gap-y-6`,e),style:{...n,...mw(t,`--lt-grid-cols`,hw)},...r})}function vw({className:e,columnSpan:t,style:n,...r}){return(0,K.jsx)(`div`,{"data-slot":`grid-item`,className:e,style:{...n,...mw(t,`--lt-col-span`,gw)},...r})}function yw({children:e,className:t,copyable:n=!1,copyLabel:r,copyValue:i,level:a=1,tooltip:o,...s}){let c=Math.min(Math.max(a,1),6),l=bw(c),u=(0,K.jsxs)(l,{"data-slot":`heading`,className:k(`font-semibold tracking-normal text-balance text-lt-fg`,c===1&&`text-2xl font-bold leading-tight`,c===2&&`text-xl`,c>2&&`text-base`,t),...s,children:[e,(0,K.jsx)(zh,{content:o})]}),d=i??(typeof e==`string`?e:void 0);return!n||d===void 0?u:(0,K.jsx)(ly,{value:d,label:r??d,children:u})}function bw(e){switch(e){case 1:return`h1`;case 2:return`h2`;case 3:return`h3`;case 4:return`h4`;case 5:return`h5`;default:return`h6`}}function xw({alt:e,circular:t=!1,className:n,height:r,previewable:i=!1,size:a,width:o,...s}){return(0,K.jsx)(zC,{...s,alt:e??``,className:k(`object-cover`,t?`rounded-full`:`rounded-lt-sm`,n),height:a??r,previewable:i,width:a??o})}var Sw={xs:`h-1`,sm:`h-1.5`,md:`h-2.5`,lg:`h-3`,xl:`h-4`,"2xl":`h-5`,"3xl":`h-6`,"4xl":`h-8`},Cw={xs:24,sm:32,md:40,lg:48,xl:64,"2xl":80,"3xl":96,"4xl":128},ww={xs:`text-[0.5rem]`,sm:`text-[0.625rem]`,md:`text-xs`,lg:`text-sm`,xl:`text-base`,"2xl":`text-lg`,"3xl":`text-xl`,"4xl":`text-2xl`};function Tw({"aria-label":e,className:t,color:n,locale:r,max:i=100,shape:a=`bar`,showValue:o=!1,size:c=`md`,value:l,...u}){let{locale:d}=s(),f=de(pe(n)??fe(`primary`)),p=i>0?Math.min(Math.max(l,0),i):0,m=i>0?p/i:0,h=new Intl.NumberFormat(r??d,{maximumFractionDigits:0,style:`percent`}).format(m),g={"aria-label":e,"aria-valuemax":i,"aria-valuemin":0,"aria-valuenow":p,"aria-valuetext":h,role:`progressbar`};if(a===`circle`){let e=Cw[c],n=Math.max(3,e/10),r=(e-n)/2,i=2*Math.PI*r;return(0,K.jsxs)(`div`,{...u,...g,className:k(`relative inline-flex`,t),"data-lattice-progress":`circle`,children:[(0,K.jsxs)(`svg`,{className:`-rotate-90`,height:e,width:e,children:[(0,K.jsx)(`circle`,{className:`text-lt-muted`,cx:e/2,cy:e/2,fill:`none`,r,stroke:`currentColor`,strokeWidth:n}),(0,K.jsx)(`circle`,{cx:e/2,cy:e/2,fill:`none`,r,stroke:`currentColor`,strokeDasharray:i,strokeDashoffset:i*(1-m),strokeLinecap:`round`,strokeWidth:n,style:{color:f}})]}),o?(0,K.jsx)(`span`,{className:k(`absolute inset-0 flex items-center justify-center font-medium text-lt-fg tabular-nums`,ww[c]),children:h}):null]})}return(0,K.jsxs)(`div`,{...u,className:k(`flex w-full items-center gap-2`,t),"data-lattice-progress":`bar`,children:[(0,K.jsx)(`div`,{...g,className:k(`w-full overflow-hidden rounded-full bg-lt-muted`,Sw[c]),children:(0,K.jsx)(`div`,{className:`h-full rounded-full`,style:{background:f,width:`${m*100}%`}})}),o?(0,K.jsx)(`span`,{className:`shrink-0 text-lt-muted-fg text-sm tabular-nums`,children:h}):null]})}function Ew({children:e,className:t,collapsed:n,collapsible:r=!1,collapseLabel:i=`Collapse section`,defaultCollapsed:a=!1,description:o,expandLabel:s=`Expand section`,headerActions:c,onCollapsedChange:l,storageKey:u,title:d,toggleProps:f,tooltip:p,...m}){let[h,g]=jx(u??``,a,r&&n===void 0&&u!==void 0),_=r&&(n??h),v=Dw(d),y=Dw(o),b=Dw(c),x=v||y||b||r,{className:S,onClick:C,...w}=f??{};function T(e){if(C?.(e),e.defaultPrevented)return;let t=!_;n===void 0&&g(),l?.(t)}return(0,K.jsxs)(`section`,{...m,"data-slot":`section`,className:k(`flex flex-col gap-6 rounded-lt border border-lt-border bg-lt-surface py-lt-gutter text-lt-surface-fg shadow-lt-sm`,t),children:[x?(0,K.jsxs)(`div`,{className:`flex items-start justify-between gap-4 px-lt-gutter`,children:[(0,K.jsxs)(`div`,{className:`flex min-w-0 items-start gap-2`,children:[r?(0,K.jsx)(`button`,{...w,"aria-expanded":!_,"aria-label":_?s:i,className:k(`mt-0.5 inline-flex shrink-0 items-center rounded-lt-sm p-0.5 text-lt-muted-fg transition-colors hover:bg-lt-muted hover:text-lt-fg`,S),onClick:T,type:`button`,children:(0,K.jsx)(M,{name:`chevron-down`,className:k(`size-lt-icon-md transition-transform`,_&&`-rotate-90`)})}):null,(0,K.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1.5`,children:[v?(0,K.jsxs)(`div`,{className:`flex items-center`,children:[(0,K.jsx)(`div`,{className:`font-semibold leading-none`,children:d}),(0,K.jsx)(zh,{content:p})]}):null,y?(0,K.jsxs)(`div`,{className:`flex items-center`,children:[(0,K.jsx)(`div`,{className:`text-sm text-lt-muted-fg`,children:o}),v?null:(0,K.jsx)(zh,{content:p})]}):null]})]}),b?(0,K.jsx)(`div`,{className:`flex shrink-0 items-center gap-2`,children:c}):null]}):null,!_&&Dw(e)?(0,K.jsx)(`div`,{className:`flex flex-col gap-6 px-lt-gutter`,children:e}):null]})}function Dw(e){return e!=null&&e!==!1&&e!==``}function Ow({bleed:e=!1,className:t,orientation:n=`horizontal`,...r}){let i=n===`horizontal`;return(0,K.jsx)(`div`,{...r,role:`separator`,"aria-orientation":n,"data-bleed":e?``:void 0,"data-slot":`separator`,className:k(`shrink-0 bg-lt-border`,i?`h-px w-full`:`h-full w-px self-stretch`,e&&(i?`-mx-lt-gutter w-auto`:`-my-lt-gutter h-auto`),t)})}var kw={center:`justify-items-center text-center`,start:`justify-items-start text-left`,stretch:`justify-items-stretch`},Aw={center:`items-center text-center`,start:`items-center text-left`,stretch:`items-stretch justify-stretch`},jw={none:`gap-0`,xs:`gap-1`,sm:`gap-2`,md:`gap-4`,lg:`gap-6`,xl:`gap-8`},Mw={full:`w-full`,auto:`w-auto`,sm:`mx-auto w-full max-w-md`,md:`mx-auto w-full max-w-2xl`,lg:`mx-auto w-full max-w-4xl`,fill:`min-w-0 flex-1`},Nw={start:`justify-start`,center:`justify-center`,end:`justify-end`,between:`justify-between`,around:`justify-around`,evenly:`justify-evenly`},Pw={full:`h-full`,screen:`min-h-screen`},Fw={start:`mr-auto`,end:`ml-auto`};function Iw({align:e=`stretch`,className:t,direction:n=`column`,float:r,gap:i=`md`,height:a,justify:o,width:s=`full`,...c}){let l=n===`row`||o!==void 0;return(0,K.jsx)(`div`,{"data-slot":`stack`,className:k(l?k(`flex`,n===`row`?`flex-wrap`:`flex-col`):`grid content-start`,l?Aw[e]??Aw.stretch:kw[e]??kw.stretch,jw[i],Mw[s],o?Nw[o]:null,a?Pw[a]:null,r?Fw[r]:null,t),...c})}var Lw=(0,z.createContext)(null),Rw=3;function zw(){return(0,z.useContext)(Lw)??{activeValue:``,hasTablist:!0}}function Bw({"aria-label":e=`Tabs`,alignment:t=`stretch`,children:n,className:r,defaultValue:i,items:a,onValueChange:o,orientation:s=`horizontal`,value:c,...l}){let u=Hw(n),d=a??u.map(({props:e})=>e),f=d[0]?.value??``,[p,m]=(0,z.useState)(()=>i||f),h=c??p,g=(0,z.useRef)(null),_=s===`vertical`,v=!_&&t===`stretch`,y=!Ag(`(min-width: 768px)`,!0)&&(_||d.length>Rw),b=(0,z.useMemo)(()=>({activeValue:h,hasTablist:!y}),[h,y]);function x(e){d.some(t=>t.value===e)&&(c===void 0&&m(e),o?.(e))}function S(e){let t=_?`ArrowDown`:`ArrowRight`,n=_?`ArrowUp`:`ArrowLeft`;if(e.key!==t&&e.key!==n&&e.key!==`Home`&&e.key!==`End`)return;let r=Array.from(g.current?.querySelectorAll(`[role="tab"]`)??[]);if(r.length===0)return;e.preventDefault();let i=r.indexOf(document.activeElement),a;if(e.key===`Home`)a=0;else if(e.key===`End`)a=r.length-1;else{let n=e.key===t?1:-1;a=((i<0?0:i)+n+r.length)%r.length}r[a]?.focus()}return(0,K.jsx)(Lw.Provider,{value:b,children:(0,K.jsxs)(`div`,{...l,className:k(`gap-6`,_&&!y?k(`flex`,t===`end`&&`flex-row-reverse`):`grid`,r),children:[y?(0,K.jsx)(aC,{"aria-label":e,"data-test":`tabs-select`,onChange:e=>x(e.target.value),value:h,children:d.map(e=>(0,K.jsx)(`option`,{value:e.value,children:e.selectLabel??Uw(e.label,e.value)},e.value))}):(0,K.jsx)(`div`,{"aria-label":e,"aria-orientation":s,className:k(`gap-1`,_?`flex w-44 shrink-0 flex-col self-start`:`rounded-lt bg-lt-muted p-1`,v&&`flex w-full`,!_&&!v&&k(`inline-flex w-fit max-w-full overflow-x-auto`,{"justify-self-center":t===`center`,"justify-self-end":t===`end`})),ref:g,role:`tablist`,children:d.map(e=>{let t=h===e.value;return(0,K.jsx)(`button`,{"aria-controls":`${e.value}-panel`,"aria-selected":t,"data-test":`tab-${e.value}`,className:k(_?Ww(t):__(t),v&&`flex-1`),id:`${e.value}-tab`,onClick:()=>x(e.value),onKeyDown:S,role:`tab`,tabIndex:t?0:-1,type:`button`,children:e.label},e.value)})}),(0,K.jsx)(`div`,{className:k(`min-w-0`,_&&!y&&`flex-1`),children:n})]})})}function Vw({"aria-label":e,children:t,className:n,label:r,selectLabel:i,value:a,...o}){let{activeValue:s,hasTablist:c}=zw(),l=s===a,[u,d]=(0,z.useState)(l);return(0,z.useEffect)(()=>{l&&d(!0)},[l]),(0,K.jsx)(`section`,{...o,"aria-label":c?void 0:e??i??Uw(r,a),"aria-labelledby":c?`${a}-tab`:void 0,className:k(`space-y-8`,!l&&`hidden`,n),hidden:!l,id:`${a}-panel`,role:`tabpanel`,tabIndex:0,children:u?t:null})}function Hw(e){let t=[];return z.Children.forEach(e,e=>{if((0,z.isValidElement)(e)){if(e.type===Vw){t.push(e);return}e.type===z.Fragment&&t.push(...Hw(e.props.children))}}),t}function Uw(e,t){return typeof e==`string`||typeof e==`number`||typeof e==`bigint`?String(e):(0,z.isValidElement)(e)?Uw(e.props.children,t):Array.isArray(e)&&e.map(e=>Uw(e,``)).join(``)||t}function Ww(e){return k(`relative rounded-lt-sm px-3 py-2.5 text-left text-sm font-medium transition-colors`,e?`bg-lt-muted text-lt-fg before:absolute before:inset-y-2 before:left-0 before:w-1 before:rounded-full before:bg-lt-primary`:`text-lt-muted-fg hover:bg-lt-muted/60 hover:text-lt-fg`)}var Gw={center:`text-center`,left:`text-left`},Kw={xs:`text-xs leading-5`,sm:`text-sm leading-6`,md:`text-base leading-7`,lg:`text-lg leading-8`,xl:`text-xl leading-8`,"2xl":`text-2xl leading-9`,"3xl":`text-3xl leading-10`,"4xl":`text-4xl leading-none`};function qw({align:e=`left`,children:t,className:n,color:r,copyable:i=!1,copyLabel:a,copyValue:o,size:s=`md`,style:c,...l}){let u=de(pe(r)??fe(`muted`)),d=(0,K.jsx)(`p`,{"data-slot":`text`,className:k(`m-0`,Gw[e],Kw[s],n),style:{color:u,...c},...l,children:t}),f=o??(typeof t==`string`?t:void 0);return!i||f===void 0?d:(0,K.jsx)(ly,{value:f,label:a??f,children:d})}function Jw({"aria-label":e,content:t,trigger:n}){let{t:r}=P(I);if(!Yw(t))return null;let i=Yw(n);return(0,K.jsxs)(kh,{children:[(0,K.jsx)(Ah,{type:`button`,"aria-label":e??(i?void 0:r(`common.more-info`,`More information`)),className:i?`inline-flex items-center rounded-lt-sm outline-none focus-visible:ring-lt-ring/50 focus-visible:ring-[length:var(--lt-ring-width)]`:`ml-1 inline-flex rounded-lt-sm text-lt-muted-fg outline-none hover:text-lt-fg focus-visible:text-lt-fg focus-visible:ring-lt-ring/50 focus-visible:ring-[length:var(--lt-ring-width)]`,children:i?n:(0,K.jsx)(M,{name:`info`,className:`size-lt-icon-sm`})}),(0,K.jsx)(Mh,{align:`start`,className:`max-w-xs p-3 text-sm [&_a]:underline`,children:t})]})}function Yw(e){return e!=null&&e!==!1&&e!==``}function Xw({children:e,className:t,description:n,headerActions:r,title:i,tooltip:a,...o}){let s=tT(i),c=tT(n),l=tT(r),u=s||c||l;return(0,K.jsxs)(`article`,{...o,"data-slot":`card`,className:k(`flex flex-col gap-6 rounded-lt border border-lt-border bg-lt-surface py-lt-gutter text-lt-surface-fg shadow-lt-sm`,t),children:[u?(0,K.jsxs)(Zw,{children:[s||l?(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,K.jsxs)(`div`,{className:`flex items-center`,children:[s?(0,K.jsx)(Qw,{children:i}):null,s?(0,K.jsx)(Jw,{content:a}):null]}),l?(0,K.jsx)(`div`,{className:`flex items-center gap-2`,children:r}):null]}):null,c?(0,K.jsxs)(`div`,{className:`flex items-center`,children:[(0,K.jsx)($w,{children:n}),s?null:(0,K.jsx)(Jw,{content:a})]}):null]}):null,tT(e)?(0,K.jsx)(eT,{className:`flex flex-col gap-6`,children:e}):null]})}function Zw({className:e,...t}){return(0,K.jsx)(`div`,{"data-slot":`card-header`,className:k(`flex flex-col gap-1.5 px-lt-gutter`,e),...t})}function Qw({className:e,...t}){return(0,K.jsx)(`div`,{"data-slot":`card-title`,className:k(`font-semibold leading-none`,e),...t})}function $w({className:e,...t}){return(0,K.jsx)(`div`,{"data-slot":`card-description`,className:k(`text-sm text-lt-muted-fg`,e),...t})}function eT({className:e,...t}){return(0,K.jsx)(`div`,{"data-slot":`card-content`,className:k(`px-lt-gutter`,e),...t})}function tT(e){return e!=null&&e!==!1&&e!==``}var nT=(0,z.lazy)(()=>_e(()=>import(`./code-block-view-4IbUdTmO.js`),__vite__mapDeps([19,1,2,5,13]),import.meta.url));function rT({"aria-label":e,children:t,className:n,copyable:r=!1,language:i=`text`,lineNumbers:a=!1,maxHeight:o=null,role:s=e?`region`:void 0,wrap:c=!1,...l}){let u=(0,K.jsx)(`pre`,{className:k(`max-w-full overflow-auto p-3 font-lt-mono text-xs`,c&&`whitespace-pre-wrap wrap-anywhere`),style:{maxHeight:o??void 0},children:a?(0,K.jsx)(`code`,{className:`grid grid-cols-[auto_1fr]`,children:t.split(`
|
|
158
|
+
`).map((e,t)=>(0,K.jsxs)(z.Fragment,{children:[(0,K.jsx)(`span`,{"aria-hidden":`true`,className:`mr-3 border-r border-lt-border pr-3 text-right text-lt-muted-fg select-none`,children:t+1}),(0,K.jsx)(`span`,{children:e||``})]},t))}):t});return(0,K.jsxs)(`div`,{"data-slot":`code-block`,"aria-label":e,role:s,...l,className:k(`relative max-w-full overflow-hidden rounded-lt-sm bg-lt-muted text-lt-fg`,n),children:[r?(0,K.jsx)(cy,{value:t,label:e??`code`,iconOnly:!0,className:`absolute top-3 right-6 z-10 bg-lt-bg/80 hover:bg-lt-bg`}):null,(0,K.jsx)(z.Suspense,{fallback:u,children:(0,K.jsx)(nT,{language:i,lineNumbers:a,maxHeight:o,wrap:c,children:t})})]})}function iT({className:e=``,children:t,...n}){let{Link:r}=Us();return(0,K.jsx)(r,{className:k(`text-lt-fg underline decoration-lt-border underline-offset-4 transition-colors duration-300 ease-out hover:decoration-current! dark:decoration-lt-border`,e),...n,children:t})}function aT(){let{locale:e}=s(),{timezone:t}=ae();return(0,z.useMemo)(()=>({locale:e,timezone:t}),[e,t])}function oT(e){return e.kind===`date`}function sT(e,t,n){return t===null?String(e??``):oT(t)?R(e,t,{locale:n.locale,timeZone:n.timezone}):HC(e,t,n.locale)}var cT=({node:e})=>(0,K.jsx)(rw,{"data-lattice-component":J(e),name:e.props.name,shape:e.props.shape,size:e.props.size,src:e.props.src}),lT=({node:e})=>(0,K.jsx)(NC,{color:e.props.color,children:e.props.label}),uT=({node:e})=>{let{label:t,icon:n}=e.props,r=e.props.variant??null,i=e.props.emphasis??`solid`,a=J(e),o=bx(e.props),{Link:s}=Us(),c=n?`icon`:`md`,l=n?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(is,{className:`size-lt-icon-md`,icon:n}),t?(0,K.jsx)(`span`,{className:`sr-only`,children:t}):null]}):t,u=({onClick:e,processing:t})=>(0,K.jsx)(cs,{"data-test":a,disabled:t,emphasis:i,onClick:e,size:c,variant:r,children:l});return o.kind===`navigate`?(0,K.jsx)(cs,{asChild:!0,"data-test":a,emphasis:i,variant:r,size:c,children:(0,K.jsx)(s,{href:o.href,method:o.method??void 0,children:l})}):o.kind===`action`?(0,K.jsx)(yx,{action:o.action,children:u}):o.kind===`effects`||o.kind===`modal`?u({onClick:o.onClick,processing:!1}):(0,K.jsx)(cs,{"data-test":a,emphasis:i,size:c,type:e.props.buttonType,variant:r,children:l})},dT=({children:e,node:t})=>{let n=Bc(t.props.headerActions),r=t.props.tooltip;return(0,K.jsx)(Xw,{"data-lattice-component":J(t),description:t.props.description,headerActions:n.length>0?(0,K.jsx)(Xc,{nodes:n}):null,title:t.props.title,tooltip:r?(0,K.jsx)(`div`,{dangerouslySetInnerHTML:{__html:r}}):null,children:e})},fT=(0,z.lazy)(()=>_e(()=>import(`./chart-view-eWW-pC-B.js`),__vite__mapDeps([20,1,2,21,3,5,7,22,14]),import.meta.url)),pT=({children:e,node:t})=>(0,K.jsx)(z.Suspense,{fallback:null,children:(0,K.jsx)(fT,{node:t,children:e})}),mT=({node:e})=>(0,K.jsx)(rT,{copyable:e.props.copyable,language:e.props.language,lineNumbers:e.props.lineNumbers,maxHeight:e.props.maxHeight,wrap:e.props.wrap,children:e.props.code}),hT=({children:e,node:t})=>{let n=t.props.rememberState!==!1,r=Bc(t.props.trigger),i=J(t);return(0,K.jsx)(ow,{...n?{storageKey:`lattice:collapsible:${i??`default`}`}:{},"data-lattice-component":i,defaultOpen:t.props.collapsed===!1,tooltip:t.props.tooltip,trigger:(0,K.jsx)(Xc,{nodes:r}),triggerProps:{"data-test":tc(`collapsible-toggle`,i)??`collapsible-toggle-default`},children:e})},gT=({children:e,node:t})=>(0,K.jsx)(dw,{bleed:t.props.bleed,"data-lattice-component":J(t),divided:t.props.divided,emptyLabel:t.props.emptyLabel,semantic:t.props.semantic===`list`?`list`:`description-list`,children:e}),_T=({children:e,node:t})=>{let n=Bc(t.props.trigger),r=J(t);return(0,K.jsx)(fw,{"aria-label":t.props.label??void 0,"data-lattice-component":r,offset:t.props.offset??16,placement:t.props.placement??`bottom-end`,trigger:n.length>0?(0,K.jsx)(Xc,{nodes:n}):void 0,triggerProps:{"data-test":r?`${r}-trigger`:void 0},children:e})},vT=({node:e})=>(0,K.jsx)(_w,{columns:e.props.columns??void 0,"data-lattice-component":J(e),children:(e.schema??[]).map((e,t)=>(0,K.jsx)(vw,{columnSpan:e.props?.columnSpan,children:(0,K.jsx)(Y,{node:e})},Vc(e,t)))}),yT=({node:e})=>(0,K.jsx)(yw,{copyable:e.props.copyable,copyLabel:e.props.text,copyValue:e.props.text,"data-lattice-component":J(e),level:e.props.level,tooltip:e.props.tooltip,children:e.props.text}),bT={xs:`size-lt-icon-xs`,sm:`size-lt-icon-sm`,md:`size-lt-icon-md`,lg:`size-lt-icon-lg`,xl:`size-lt-icon-xl`,"2xl":`size-lt-icon-2xl`,"3xl":`size-lt-icon-3xl`,"4xl":`size-lt-icon-4xl`},xT=({node:e})=>{let{name:t,size:n,color:r,class:i}=e.props,a=(0,K.jsx)(is,{icon:t,className:k(bT[n],i)}),o=pe(r);return o?(0,K.jsx)(`span`,{className:`contents`,style:{color:de(o)},children:a}):a},ST=({node:e})=>(0,K.jsx)(xw,{alt:e.props.alt,circular:e.props.circular,"data-lattice-component":J(e),previewable:e.props.previewable,size:e.props.size,src:e.props.src,testId:J(e)}),CT=`text-lt-fg underline decoration-lt-border underline-offset-4 transition-colors duration-300 ease-out hover:decoration-current! dark:decoration-lt-border`;function wT({affix:e,className:t}){return e.icon?(0,K.jsx)(is,{className:k(`size-lt-icon-md shrink-0`,t),icon:e.icon}):(0,K.jsx)(`span`,{className:k(`shrink-0 text-sm text-lt-muted-fg`,t),children:e.text})}function TT({icon:e,isMenuItem:t,label:n,prefix:r,suffix:i}){return e?(0,K.jsx)(is,{className:`size-lt-icon-md shrink-0`,icon:e}):t?(0,K.jsxs)(K.Fragment,{children:[r?(0,K.jsx)(wT,{affix:r}):null,(0,K.jsx)(`span`,{children:n}),i?(0,K.jsx)(wT,{affix:i,className:`ml-auto`}):null]}):r||i?(0,K.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 align-baseline`,children:[r?(0,K.jsx)(wT,{affix:r}):null,(0,K.jsx)(`span`,{children:n}),i?(0,K.jsx)(wT,{affix:i}):null]}):n}function ET(e,t,n){if(!(!t?.text&&!n?.text))return[t?.text,e,n?.text].filter(e=>!!e).join(` `)}var DT=({node:e})=>{let t=oc(),{icon:n,label:r,prefix:i,suffix:a}=e.props,o=r??``,s=bx(e.props),c=t?ic:void 0,l=J(e),u=(0,K.jsx)(TT,{icon:n,isMenuItem:t,label:o,prefix:i,suffix:a}),d=n?o:ET(o,i,a),f=({onClick:e,processing:t})=>(0,K.jsx)(`button`,{"aria-label":d,className:k(CT,c),"data-test":l,disabled:t,onClick:e,type:`button`,children:u});return s.kind===`action`?(0,K.jsx)(yx,{action:s.action,children:f}):s.kind===`effects`||s.kind===`modal`?f({onClick:s.onClick,processing:!1}):(0,K.jsx)(iT,{"aria-label":d,className:c,"data-test":l,href:s.kind===`navigate`?s.href:`#`,method:s.kind===`navigate`?s.method:`get`,tabIndex:e.props.tabIndex??void 0,children:u})},OT=({children:e,node:t})=>{let{t:n}=P(I),r=el();if(!r)return null;let i=t.props.title??n(`common.dialog`,`Dialog`),a=t.props.description,o=t.props.closeLabel;return(0,K.jsx)(Ff,{open:r.open,onOpenChange:r.onOpenChange,children:(0,K.jsxs)(Bf,{...a?{}:{"aria-describedby":void 0},onCloseAutoFocus:r.onExited,placement:t.props.side??`center`,width:t.props.width,height:t.props.height,children:[(0,K.jsx)(Vf,{closeLabel:o,description:a,title:i}),(0,K.jsx)(`div`,{className:`mt-6 space-y-6`,children:e})]})})},kT=({node:e})=>(0,K.jsx)(Tw,{color:e.props.color,max:e.props.max,shape:e.props.shape,showValue:e.props.showValue,size:e.props.size,value:e.props.value}),AT=({node:e})=>(0,K.jsx)(`span`,{style:{display:`contents`},dangerouslySetInnerHTML:{__html:e.props.html}}),jT=({children:e,node:t})=>{let n=t.props.collapsible===!0,r=Bc(t.props.headerActions),i=J(t),a=t.props.rememberState!==!1;return(0,K.jsx)(Ew,{...n&&a?{storageKey:`lattice:section:${i??`default`}`}:{},collapsible:n,"data-lattice-component":i,defaultCollapsed:t.props.collapsed===!0,description:t.props.description,headerActions:r.length>0?(0,K.jsx)(Xc,{nodes:r}):null,title:t.props.title,toggleProps:{"data-test":tc(`section-toggle`,i)??`section-toggle-default`},tooltip:t.props.tooltip,children:e})},MT=({node:e})=>{let{emits:t,name:n,options:r}=e.props;function i(e){t&&window.dispatchEvent(new CustomEvent(t,{detail:{name:n,value:e}}))}return(0,K.jsx)(v_,{"aria-label":e.props.label??void 0,defaultValue:e.props.value||void 0,name:n,onValueChange:i,options:r})},NT=({node:e})=>(0,K.jsx)(Ow,{bleed:e.props.bleed,"data-lattice-component":J(e),orientation:e.props.orientation}),PT=({children:e,node:t})=>(0,K.jsx)(Iw,{align:t.props.align??void 0,"data-lattice-component":J(t),direction:t.props.direction??void 0,float:t.props.float??void 0,gap:t.props.gap??void 0,height:t.props.height??void 0,justify:t.props.justify??void 0,width:t.props.width??void 0,children:e}),FT=({children:e,node:t})=>{let{t:n}=P(I),r=(0,z.useMemo)(()=>LT(t),[t]),i=r[0]?.value??``,a=t.props.queryKey,{visit:o}=Us(),s=t.props.activeValue,c=t.props.defaultValue??i,[l,u]=(0,z.useState)(()=>s||(RT(a,r)??c)||i),d=(0,z.useCallback)(e=>{let t=r.find(t=>t.value===e);if(t){if(t.confirm?.required){o(BT(a,e),{preserveScroll:!0});return}u(e),zT(a,e)}},[a,r,o]);return(0,K.jsx)(Bw,{"aria-label":n(`common.tabs`,`Tabs`),alignment:t.props.alignment,"data-lattice-component":J(t),items:r.map(e=>({label:e.label,value:e.value})),onValueChange:d,orientation:t.props.orientation,value:l,children:e})},IT=({children:e,node:t})=>(0,K.jsx)(Vw,{label:t.props.label,value:t.props.value,children:e});function LT(e){return(e.schema??[]).filter(e=>e.type===`tab`).map(e=>e.props).filter(e=>e.value!==``)}function RT(e,t){if(typeof window>`u`)return null;let n=new URLSearchParams(window.location.search).get(e);return!n||!t.some(e=>e.value===n)?null:n}function zT(e,t){if(typeof window>`u`)return;let n=new URL(window.location.href);n.searchParams.set(e,t),window.history.replaceState(window.history.state,``,`${n.pathname}${n.search}${n.hash}`)}function BT(e,t){if(typeof window>`u`)return``;let n=new URL(window.location.href);return n.searchParams.set(e,t),`${n.pathname}${n.search}${n.hash}`}var VT=({node:e})=>(0,K.jsx)(qw,{align:e.props.align===`center`?`center`:`left`,color:e.props.color,copyable:e.props.copyable,copyLabel:e.props.text,copyValue:e.props.text,"data-lattice-component":J(e),size:e.props.size,children:e.props.text}),HT=({node:e})=>{let t=e.props.content,n=Bc(e.props.trigger);return(0,K.jsx)(Jw,{content:t?(0,K.jsx)(`div`,{dangerouslySetInnerHTML:{__html:t}}):null,trigger:n.length>0?(0,K.jsx)(Xc,{nodes:n}):null})},UT=`flex flex-wrap items-center justify-between gap-x-4 gap-y-1 px-lt-gutter py-3`,WT=`text-sm text-lt-muted-fg`,GT=`min-w-0 text-lt-fg`;function KT({children:e,description:t,disclosure:n,identity:r,label:i}){let a=uw(),o=`${r??`entry`}-panel`,[s,c]=jx(`lattice:entry:${r??`default`}`,!1,!1),l=(0,K.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,K.jsx)(`span`,{children:i}),t&&(0,K.jsx)(`span`,{className:`text-xs text-lt-muted-fg`,children:t})]});return n?(0,K.jsxs)(`div`,{"data-lattice-component":r,role:`listitem`,children:[(0,K.jsxs)(`button`,{"aria-controls":o,"aria-expanded":s,className:k(UT,`w-full cursor-pointer text-left transition-colors hover:bg-lt-muted`),onClick:c,type:`button`,children:[(0,K.jsx)(`span`,{className:WT,children:l}),(0,K.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,K.jsx)(`span`,{className:GT,children:e}),(0,K.jsx)(M,{name:`chevron-down`,className:k(`size-lt-icon-md shrink-0 text-lt-muted-fg transition-transform`,!s&&`-rotate-90`)})]})]}),s&&(0,K.jsx)(`div`,{className:`px-lt-gutter pt-2 pb-4`,id:o,children:n})]}):a===`list`?(0,K.jsxs)(`div`,{className:UT,"data-lattice-component":r,role:`listitem`,children:[(0,K.jsx)(`span`,{className:WT,children:l}),(0,K.jsx)(`span`,{className:GT,children:e})]}):(0,K.jsxs)(`div`,{className:UT,"data-lattice-component":r,children:[(0,K.jsx)(`dt`,{className:WT,children:l}),(0,K.jsx)(`dd`,{className:GT,children:e})]})}function qT(e,t){return(t.schema??[]).length>0?e:void 0}var JT=De({components:{avatar:B(cT),badge:B(lT),button:B(uT),card:B(dT),chart:B(pT),"code-block":B(mT),collapsible:B(hT),"description-list":B(gT),"entry.badge":B(({children:e,node:t})=>{let{value:n,color:r,label:i,description:a}=t.props,o=n==null||n===``?null:String(n);return(0,K.jsx)(KT,{description:a,disclosure:qT(e,t),identity:J(t),label:i,children:o===null?(0,K.jsx)(`span`,{className:`text-lt-muted-fg`,children:`—`}):(0,K.jsx)(NC,{color:r,children:o})})}),"entry.boolean":B(({children:e,node:t})=>{let{value:n,trueIcon:r,falseIcon:i,label:a,description:o}=t.props,{t:s}=P(`lattice`),c=oC(n);return(0,K.jsx)(KT,{description:o,disclosure:qT(e,t),identity:J(t),label:a,children:(0,K.jsx)(`span`,{"aria-label":c?s(`common.yes`,`Yes`):s(`common.no`,`No`),role:`img`,children:(0,K.jsx)(M,{name:c?r:i,className:k(`size-lt-icon-md`,c?`text-lt-success`:`text-lt-muted-fg`)})})})}),"entry.component":B(({children:e,node:t})=>(0,K.jsx)(KT,{description:t.props.description,disclosure:qT(e,t),identity:J(t),label:t.props.label,children:(0,K.jsx)(Xc,{nodes:Bc(t.props.value)})})),"entry.date":B(({children:e,node:t})=>{let{value:n,format:r,label:i,description:a}=t.props,o=aT();return(0,K.jsx)(KT,{description:a,disclosure:qT(e,t),identity:J(t),label:i,children:(0,K.jsx)(`span`,{children:n==null?`—`:sT(n,r,o)})})}),"entry.text":B(({children:e,node:t})=>{let{value:n,placeholder:r,copyable:i,label:a,description:o}=t.props,s=n==null||n===``?null:String(n);return(0,K.jsx)(KT,{description:o,disclosure:qT(e,t),identity:J(t),label:a,children:s===null?(0,K.jsx)(`span`,{className:`text-lt-muted-fg`,children:r??`—`}):i?(0,K.jsx)(ly,{label:s,value:s,children:(0,K.jsx)(`span`,{children:s})}):(0,K.jsx)(`span`,{children:s})})}),"floating-panel":B(_T),grid:B(vT),heading:B(yT),icon:B(xT),image:B(ST),link:B(DT),modal:B(OT),progress:B(kT),"raw-block":B(AT),section:B(jT),"segmented-control":B(MT),separator:B(NT),stack:B(PT),tab:B(IT),tabs:B(FT),text:B(VT),tooltip:B(HT)},i18n:{namespace:I},name:`lattice/ui`},zy,Lh,Ly,Px,tw,tS,iS,ts),YT=[`light`,`dark`,`system`],{subscribe:XT,notify:ZT}=l(),QT=`system`,$T=`system`;function eE(e){tE(e)&&($T=e)}function tE(e){return YT.some(t=>t===e)}var nE=()=>typeof window>`u`?!1:window.matchMedia(`(prefers-color-scheme: dark)`).matches,rE=(e,t,n=365)=>{if(typeof document>`u`)return;let r=n*24*60*60;document.cookie=`${e}=${t};path=/;max-age=${r};SameSite=Lax`},iE=()=>{if(typeof window>`u`)return`system`;let e=localStorage.getItem(`appearance`);return tE(e)?e:`system`},aE=e=>e===`dark`||e===`system`&&nE(),oE=()=>nE()?`dark`:`light`,sE=e=>{if(typeof document>`u`)return;let t=aE(e);document.documentElement.classList.toggle(`dark`,t),document.documentElement.style.colorScheme=t?`dark`:`light`},cE=()=>typeof window>`u`?null:window.matchMedia(`(prefers-color-scheme: dark)`),lE=()=>{sE(QT),ZT()};function uE(e){QT=e,localStorage.setItem(`appearance`,e),rE(`appearance`,e),sE(e),ZT()}function dE(){typeof window>`u`||(localStorage.getItem(`appearance`)||(localStorage.setItem(`appearance`,`system`),rE(`appearance`,`system`)),QT=iE(),sE(QT),cE()?.addEventListener(`change`,lE))}function fE(){let e=(0,z.useSyncExternalStore)(XT,()=>QT,()=>$T),t=(0,z.useSyncExternalStore)(XT,oE,()=>`light`);return{appearance:e,resolvedAppearance:e===`system`?t:e,updateAppearance:uE}}function pE({children:e}){let t=Do().props.lattice.layout;return t?(0,K.jsx)(Ox,{outlet:e,children:(0,K.jsx)(Xc,{nodes:t.schema})}):(0,K.jsx)(K.Fragment,{children:e})}var mE=(0,z.lazy)(()=>_e(()=>import(`./subscriptions-CSh5RtT7.js`),__vite__mapDeps([23,1,2,5,10,4,11,18]),import.meta.url)),hE=class extends z.Component{state={failed:!1};static getDerivedStateFromError(){return{failed:!0}}componentDidCatch(){console.warn(`[lattice] Real-time listeners are declared but Echo is unavailable. Install @laravel/echo-react and call configureEcho().`)}render(){return this.state.failed?null:this.props.children}};function gE({listeners:e}){return e.length===0?null:(0,K.jsx)(hE,{children:(0,K.jsx)(z.Suspense,{fallback:null,children:(0,K.jsx)(mE,{listeners:e})})})}var _E={full:`max-w-none`,lg:`max-w-4xl`,md:`max-w-2xl`,sm:`max-w-md`};function vE({lattice:e}){return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(Io,{title:e.title??void 0}),(0,K.jsx)(gE,{listeners:e.listeners}),(0,K.jsx)(`div`,{"data-test":`lattice-page-container`,"data-page-width":e.width,className:k(`mx-auto w-full px-4 py-6 sm:px-6 lg:px-8`,_E[e.width]??_E.full),children:(0,K.jsx)(Xc,{nodes:e.schema})})]})}var yE=`lattice/page`;function bE(e){return t=>{if(t===`lattice/page`)return{default:vE};let n=e[`./Pages/${t}.tsx`]??e[`./pages/${t}.tsx`];if(n)return n();throw Error(`Page not found: ${t}`)}}function xE({defaultLayout:e}={}){return(t,n)=>t===`lattice/page`?n.props.lattice?.layout?pE:null:e?.(t,n)??null}function SE(e,t){return{...t,headers:hc(``,t.headers)}}var CE=!1;function wE(){CE||(CE=!0,Oi.onRequest(e=>{let t=e.headers?.[sc];return e.headers&&typeof t==`string`&&t!==``&&(e.headers[sc]=lc(t)),e}))}function TE({action:e,children:t,options:n}){let{processing:r,requestSubmit:i}=mm(e,n);return t({onClick:i,processing:r})}function EE({children:e}){return(0,K.jsx)(_x,{render:e=>(0,K.jsx)(TE,{action:e.action,options:e.options,children:e.children}),children:e})}function DE(){let e=zc();(0,z.useEffect)(()=>W.on(`flash`,t=>{let n=Lc(t.detail?.flash?.latticeEffects);n.length>0&&e(n)}),[e])}function OE({onAppearanceChange:e}){return Rs(d.appearanceChange,t=>{let n=t.detail?.value;tE(n)&&e?.(n)},{enabled:!!e}),null}var kE={href:``};function AE({children:e,registry:t,sprite:n=kE,toaster:r=!0}){return DE(),es(),(0,K.jsx)(g,{registry:t,children:(0,K.jsx)(Hs,{adapter:Qo,children:(0,K.jsx)(EE,{children:(0,K.jsx)(b,{sprite:n,children:(0,K.jsxs)(il,{children:[e,(0,K.jsx)(OE,{onAppearanceChange:uE}),r?(0,K.jsx)(lx,{}):null]})})})})})}function jE(e,t){let n=new Set([...e.namespaces??[`lattice`,`lattice-ui`],...t.map(e=>e.namespace)]);return{...e,namespaces:[...n]}}function ME({ready:e,children:t}){let[n,r]=(0,z.useState)(!1);return(0,z.useEffect)(()=>{let t=!0,n=()=>{t&&r(!0)};return e.then(n,n),()=>{t=!1}},[e]),n?t:null}function NE({registry:e,plugins:t,sprite:n,pages:r={},defaultLayout:i,strictMode:o=!0,i18n:s,boot:l,wrap:u,...d}={}){let f=e??JT,p=t&&t.length>0?Oe(f,...t):f;m(p),pc(c),wE();let h=s!==!1,g=t?.flatMap(e=>e.i18n?[e.i18n]:[])??[],_=h?jE(s??{},g):{},v=d.defaults?.visitOptions,y=h?{...d.defaults,visitOptions:(e,t)=>SE(e,v?.(e,t)??t)}:d.defaults,b=Eo({...d,defaults:y,strictMode:o,resolve:bE(r),layout:xE({defaultLayout:i}),withApp:(e,{ssr:t,page:r})=>{let i=[],o=r.props.lattice,s=!1;if(a(o)&&eE(o.appearance),!t){s=document.getElementById(d.id??`app`)?.hasAttribute(`data-server-rendered`)===!0,a(o)&&a(o.urls)&&typeof o.urls.refreshRef==`string`&&Cc(o.urls.refreshRef),h&&Js(r.props)!==void 0&&i.push(_e(()=>Promise.resolve().then(()=>Ys).then(e=>e.configureI18nFromPageProps(r.props,_)),void 0,import.meta.url));let e=l?.({page:r});e&&i.push(e)}let c=(0,K.jsxs)(K.Fragment,{children:[e,h?(0,K.jsx)(Ws,{}):null]}),f=(0,K.jsx)(AE,{registry:p,sprite:n,children:u?u(c):c});return i.length===0?f:s?(F(Promise.all(i)),f):(0,K.jsx)(ME,{ready:Promise.all(i),children:f})}});return dE(),b}m(JT);function PE({registry:e=JT,...t}){return(0,K.jsx)(AE,{...t,registry:e})}function FE(e){if(typeof e!=`object`||!e)return{};let{data:t}=e;return typeof t==`object`&&t&&!Array.isArray(t)?t:{}}async function IE(e,t,n){let r=e.props.endpoint,i={data:{},ok:!0,status:0};return r&&(i.ok=await al(async()=>{let n=await Ec(r,{body:JSON.stringify(t),method:e.props.method??`post`,ref:e.props.ref??``,throwOnError:!1});return i.status=n.status,i.data=FE(await n.clone().json().catch(()=>({}))),n},n)),i}function LE(){let e=zc();return(0,z.useCallback)((t,n)=>IE(t,n,e),[e])}var RE=`form.rich-editor`;function zE(e,t){let n=[];for(let r of e){let e=t[r.type];e&&n.push({type:r.type,props:r.props,definition:e,group:e.group??r.type})}return n}var BE={blockquote:!1,bold:!1,bulletList:!1,code:!1,codeBlock:!1,heading:!1,horizontalRule:!1,italic:!1,link:!1,listItem:!1,orderedList:!1,strike:!1,underline:!1};function VE(e){return e.reduce((e,t)=>({...e,...t.definition.starterKit?.(t.props)}),{...BE})}function HE(e){return e.flatMap(e=>e.definition.extensions?.(e.props)??[])}function UE(e){let t=[],n=null;for(let r of e){let e=r.definition.toolbar?.(r.props)??[];e.length!==0&&(n!==null&&n!==r.group&&t.push(`separator`),t.push(...e),n=r.group)}return t}function WE({active:e=!1,icon:t,label:n,testId:r,...i}){return(0,K.jsx)(fv,{size:`sm`,icon:t,label:n,title:n,active:e,"data-test":r,...i,onMouseDown:e=>{e.preventDefault(),i.onMouseDown?.(e)}})}function GE(e){if(Array.isArray(e))return e}function KE(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function qE(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function JE(e,t){if(e){if(typeof e==`string`)return qE(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?qE(e,t):void 0}}function YE(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
159
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function XE(e,t){return GE(e)||KE(e,t)||JE(e,t)||YE()}var ZE=n((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.bind=void 0;function t(e,t){var n=t.type,r=t.listener,i=t.options;return e.addEventListener(n,r,i),function(){e.removeEventListener(n,r,i)}}e.bind=t})),QE=n((e=>{var t=e&&e.__assign||function(){return t=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},t.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.bindAll=void 0;var n=ZE();function r(e){if(e!==void 0)return typeof e==`boolean`?{capture:e}:e}function i(e,n){return n==null?e:t(t({},e),{options:t(t({},r(n)),r(e.options))})}function a(e,t,r){var a=t.map(function(t){var a=i(t,r);return(0,n.bind)(e,a)});return function(){a.forEach(function(e){return e()})}}e.bindAll=a})),$E=n((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.bindAll=e.bind=void 0;var t=ZE();Object.defineProperty(e,"bind",{enumerable:!0,get:function(){return t.bind}});var n=QE();Object.defineProperty(e,"bindAll",{enumerable:!0,get:function(){return n.bindAll}})}))(),eD=`data-pdnd-honey-pot`;function tD(e){return e instanceof Element&&e.hasAttribute(`data-pdnd-honey-pot`)}function nD(e){var t=XE(document.elementsFromPoint(e.x,e.y),2),n=t[0],r=t[1];return n?tD(n)?r??null:n:null}function rD(e){"@babel/helpers - typeof";return rD=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},rD(e)}function iD(e,t){if(rD(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(rD(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function aD(e){var t=iD(e,`string`);return rD(t)==`symbol`?t:t+``}function oD(e,t,n){return(t=aD(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var sD=2147483647,cD={inset:`unset`,border:`none`,padding:0,margin:0,overflow:`visible`,color:`inherit`,background:`transparent`,width:`auto`,height:`auto`};function lD(e){var t=null;return function(){if(!t){var n=[...arguments];t={result:e.apply(this,n)}}return t.result}}var uD=lD(function(){return typeof HTMLElement<`u`&&typeof HTMLElement.prototype.showPopover==`function`});function dD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function fD(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?dD(Object(n),!0).forEach(function(t){oD(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dD(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var pD=2,mD=pD/2;function hD(e){return{x:Math.floor(e.x),y:Math.floor(e.y)}}function gD(e){return{x:e.x-mD,y:e.y-mD}}function _D(e){return{x:Math.max(e.x,0),y:Math.max(e.y,0)}}function vD(e){return{x:Math.min(e.x,window.innerWidth-pD),y:Math.min(e.y,window.innerHeight-pD)}}function yD(e){var t=e.client,n=vD(_D(gD(hD(t))));return DOMRect.fromRect({x:n.x,y:n.y,width:pD,height:pD})}function bD(e){var t=e.clientRect;return{left:`${t.left}px`,top:`${t.top}px`,width:`${t.width}px`,height:`${t.height}px`}}function xD(e){var t=e.client,n=e.clientRect;return t.x>=n.x&&t.x<=n.x+n.width&&t.y>=n.y&&t.y<=n.y+n.height}function SD(e){var t=e.initial,n=document.createElement(`div`);n.setAttribute(eD,`true`),uD()&&n.setAttribute(`popover`,`manual`);var r=yD({client:t});Object.assign(n.style,fD(fD({position:`fixed`},uD()?cD:{zIndex:sD}),{},{backgroundColor:`transparent`,padding:0,margin:0,boxSizing:`border-box`,pointerEvents:`auto`},bD({clientRect:r}))),document.body.appendChild(n),uD()&&n.showPopover();var i=(0,$E.bind)(window,{type:`pointermove`,listener:function(e){r=yD({client:{x:e.clientX,y:e.clientY}}),Object.assign(n.style,bD({clientRect:r}))},options:{capture:!0}});return function(e){var t=e.current;if(i(),xD({client:t,clientRect:r})){n.remove();return}function a(){o(),n.remove()}var o=(0,$E.bindAll)(window,[{type:`pointerdown`,listener:a},{type:`pointermove`,listener:a},{type:`focusin`,listener:a},{type:`focusout`,listener:a},{type:`dragstart`,listener:a},{type:`dragenter`,listener:a},{type:`dragover`,listener:a}],{capture:!0})}}function CD(){var e=null;function t(){return e=null,(0,$E.bind)(window,{type:`pointermove`,listener:function(t){e={x:t.clientX,y:t.clientY}},options:{capture:!0}})}function n(){var t=null;return function(n){var r=n.eventName,i=n.payload;if(r===`onDragStart`){var a=i.location.initial.input;t=SD({initial:e??{x:a.clientX,y:a.clientY}})}if(r===`onDrop`){var o,s=i.location.current.input;(o=t)==null||o({current:{x:s.clientX,y:s.clientY}}),t=null,e=null}}}return{bindEvents:t,getOnPostDispatch:n}}function wD(e){if(Array.isArray(e))return qE(e)}function TD(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function ED(){throw TypeError(`Invalid attempt to spread non-iterable instance.
|
|
160
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function DD(e){return wD(e)||TD(e)||JE(e)||ED()}var OD=lD(function(){return navigator.userAgent.includes(`Firefox`)}),kD=lD(function(){var e=navigator.userAgent;return e.includes(`AppleWebKit`)&&!e.includes(`Chrome`)}),AD={isLeavingWindow:Symbol(`leaving`),isEnteringWindow:Symbol(`entering`)};function jD(e){var t=e.dragLeave;return kD()?t.hasOwnProperty(AD.isLeavingWindow):!1}(function(){if(typeof window>`u`||!kD())return;function e(){return{enterCount:0,isOverWindow:!1}}var t=e();function n(){t=e()}(0,$E.bindAll)(window,[{type:`dragstart`,listener:function(){t.enterCount=0,t.isOverWindow=!0}},{type:`drop`,listener:n},{type:`dragend`,listener:n},{type:`dragenter`,listener:function(e){!t.isOverWindow&&t.enterCount===0&&(e[AD.isEnteringWindow]=!0),t.isOverWindow=!0,t.enterCount++}},{type:`dragleave`,listener:function(e){t.enterCount--,t.isOverWindow&&t.enterCount===0&&(e[AD.isLeavingWindow]=!0,t.isOverWindow=!1)}}],{capture:!0})})();function MD(e){return`nodeName`in e}function ND(e){return MD(e)&&e.ownerDocument!==document}function PD(e){var t=e.dragLeave,n=t.type,r=t.relatedTarget;return n===`dragleave`?kD()?jD({dragLeave:t}):r==null?!0:OD()?ND(r):r instanceof HTMLIFrameElement:!1}function FD(e){var t=e.onDragEnd;return[{type:`pointermove`,listener:function(){var e=0;return function(){if(e<20){e++;return}t()}}()},{type:`pointerdown`,listener:t}]}function ID(e){return{altKey:e.altKey,button:e.button,buttons:e.buttons,ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey,clientX:e.clientX,clientY:e.clientY,pageX:e.pageX,pageY:e.pageY}}var LD=function(e){var t=[],n=null,r=function(){t=[...arguments],!n&&(n=requestAnimationFrame(function(){n=null,e.apply(void 0,t)}))};return r.cancel=function(){n&&=(cancelAnimationFrame(n),null)},r}(function(e){return e()}),RD=function(){var e=null;function t(t){e={frameId:requestAnimationFrame(function(){e=null,t()}),fn:t}}function n(){e&&=(cancelAnimationFrame(e.frameId),e.fn(),null)}return{schedule:t,flush:n}}();function zD(e){var t=e.source,n=e.initial,r=e.dispatchEvent,i={dropTargets:[]};function a(e){r(e),i={dropTargets:e.payload.location.current.dropTargets}}return{start:function(e){var r=e.nativeSetDragImage,o={current:n,previous:i,initial:n};a({eventName:`onGenerateDragPreview`,payload:{source:t,location:o,nativeSetDragImage:r}}),RD.schedule(function(){a({eventName:`onDragStart`,payload:{source:t,location:o}})})},dragUpdate:function(e){var r=e.current;RD.flush(),LD.cancel(),a({eventName:`onDropTargetChange`,payload:{source:t,location:{initial:n,previous:i,current:r}}})},drag:function(e){var r=e.current;LD(function(){RD.flush(),a({eventName:`onDrag`,payload:{source:t,location:{initial:n,previous:i,current:r}}})})},drop:function(e){var r=e.current,o=e.updatedSourcePayload;RD.flush(),LD.cancel(),a({eventName:`onDrop`,payload:{source:o??t,location:{current:r,previous:i,initial:n}}})}}}var BD={isActive:!1};function VD(){return!BD.isActive}function HD(e){return e.dataTransfer?e.dataTransfer.setDragImage.bind(e.dataTransfer):null}function UD(e){var t=e.current,n=e.next;if(t.length!==n.length)return!0;for(var r=0;r<t.length;r++)if(t[r].element!==n[r].element)return!0;return!1}function WD(e){var t=e.event,n=e.dragType,r=e.getDropTargetsOver,i=e.dispatchEvent;if(!VD())return;var a=KD({event:t,dragType:n,getDropTargetsOver:r});BD.isActive=!0;var o={current:a};GD({event:t,current:a.dropTargets});var s=zD({source:n.payload,dispatchEvent:i,initial:a});function c(e){var t=UD({current:o.current.dropTargets,next:e.dropTargets});o.current=e,t&&s.dragUpdate({current:o.current})}function l(e){var t=ID(e),i=r({target:tD(e.target)?nD({x:t.clientX,y:t.clientY}):e.target,input:t,source:n.payload,current:o.current.dropTargets});i.length&&(e.preventDefault(),GD({event:e,current:i})),c({dropTargets:i,input:t})}function u(){o.current.dropTargets.length&&c({dropTargets:[],input:o.current.input}),s.drop({current:o.current,updatedSourcePayload:null}),d()}function d(){BD.isActive=!1,f()}var f=(0,$E.bindAll)(window,[{type:`dragover`,listener:function(e){l(e),s.drag({current:o.current})}},{type:`dragenter`,listener:l},{type:`dragleave`,listener:function(e){PD({dragLeave:e})&&(c({input:o.current.input,dropTargets:[]}),n.startedFrom===`external`&&u())}},{type:`drop`,listener:function(e){if(o.current={dropTargets:o.current.dropTargets,input:ID(e)},!o.current.dropTargets.length){u();return}e.preventDefault(),GD({event:e,current:o.current.dropTargets}),s.drop({current:o.current,updatedSourcePayload:n.type===`external`?n.getDropPayload(e):null}),d()}},{type:`dragend`,listener:function(e){o.current={dropTargets:o.current.dropTargets,input:ID(e)},u()}}].concat(DD(FD({onDragEnd:u}))),{capture:!0});s.start({nativeSetDragImage:HD(t)})}function GD(e){var t=e.event,n=e.current[0]?.dropEffect;n!=null&&t.dataTransfer&&(t.dataTransfer.dropEffect=n)}function KD(e){var t=e.event,n=e.dragType,r=e.getDropTargetsOver,i=ID(t);return n.startedFrom===`external`?{input:i,dropTargets:[]}:{input:i,dropTargets:r({input:i,source:n.payload,target:t.target,current:[]})}}var qD={canStart:VD,start:WD},JD=new Map;function YD(e){var t=e.typeKey,n=e.mount,r=JD.get(t);if(r)return r.usageCount++,r;var i={typeKey:t,unmount:n(),usageCount:1};return JD.set(t,i),i}function XD(e){var t=YD(e);return function(){t.usageCount--,!(t.usageCount>0)&&(t.unmount(),JD.delete(e.typeKey))}}function ZD(){var e=[...arguments];return function(){e.forEach(function(e){return e()})}}function QD(e,t){var n=t.attribute,r=t.value;return e.setAttribute(n,r),function(){return e.removeAttribute(n)}}function $D(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function eO(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?$D(Object(n),!0).forEach(function(t){oD(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$D(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function tO(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(!n){if(Array.isArray(e)||(n=nO(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
161
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||n.return==null||n.return()}finally{if(s)throw a}}}}function nO(e,t){if(e){if(typeof e==`string`)return rO(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?rO(e,t):void 0}}function rO(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function iO(e){return e.slice(0).reverse()}function aO(e){var t=e.typeKey,n=e.defaultDropEffect,r=new WeakMap,i=`data-drop-target-for-${t}`,a=`[${i}]`;function o(e){return r.set(e.element,e),function(){return r.delete(e.element)}}function s(e){return lD(ZD(QD(e.element,{attribute:i,value:`true`}),o(e)))}function c(e){var t=e.source,i=e.target,o=e.input,s=e.result,l=s===void 0?[]:s;if(i==null)return l;if(!(i instanceof Element))return i instanceof Node?c({source:t,target:i.parentElement,input:o,result:l}):l;var u=i.closest(a);if(u==null)return l;var d=r.get(u);if(d==null)return l;var f={input:o,source:t,element:d.element};if(d.canDrop&&!d.canDrop(f))return c({source:t,target:d.element.parentElement,input:o,result:l});var p=d.getData?.call(d,f)??{},m=d.getDropEffect?.call(d,f)??n,h={data:p,element:d.element,dropEffect:m,isActiveDueToStickiness:!1};return c({source:t,target:d.element.parentElement,input:o,result:[].concat(DD(l),[h])})}function l(e){var t=e.eventName,n=e.payload,i=tO(n.location.current.dropTargets),a;try{for(i.s();!(a=i.n()).done;){var o,s=a.value,c=r.get(s.element),l=eO(eO({},n),{},{self:s});c==null||(o=c[t])==null||o.call(c,l)}}catch(e){i.e(e)}finally{i.f()}}var u={onGenerateDragPreview:l,onDrag:l,onDragStart:l,onDrop:l,onDropTargetChange:function(e){var t=e.payload,n=new Set(t.location.current.dropTargets.map(function(e){return e.element})),i=new Set,a=tO(t.location.previous.dropTargets),o;try{for(a.s();!(o=a.n()).done;){var s,c=o.value;i.add(c.element);var l=r.get(c.element),u=n.has(c.element),d=eO(eO({},t),{},{self:c});if(l==null||(s=l.onDropTargetChange)==null||s.call(l,d),!u){var f;l==null||(f=l.onDragLeave)==null||f.call(l,d)}}}catch(e){a.e(e)}finally{a.f()}var p=tO(t.location.current.dropTargets),m;try{for(p.s();!(m=p.n()).done;){var h,g,_=m.value;if(!i.has(_.element)){var v=eO(eO({},t),{},{self:_}),y=r.get(_.element);y==null||(h=y.onDropTargetChange)==null||h.call(y,v),y==null||(g=y.onDragEnter)==null||g.call(y,v)}}}catch(e){p.e(e)}finally{p.f()}}};function d(e){u[e.eventName](e)}function f(e){var t=e.source,n=e.target,i=e.input,a=e.current,o=c({source:t,target:n,input:i});if(o.length>=a.length)return o;for(var s=iO(a),l=iO(o),u=[],d=0;d<s.length;d++){var f,p=s[d],m=l[d];if(m!=null){u.push(m);continue}var h=u[d-1],g=s[d-1];if(h?.element!==g?.element)break;var _=r.get(p.element);if(!_)break;var v={input:i,source:t,element:_.element};if(_.canDrop&&!_.canDrop(v)||!((f=_.getIsSticky)!=null&&f.call(_,v)))break;u.push(eO(eO({},p),{},{isActiveDueToStickiness:!0}))}return iO(u)}return{dropTargetForConsumers:s,getIsOver:f,dispatchEvent:d}}function oO(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(!n){if(Array.isArray(e)||(n=sO(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
162
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||n.return==null||n.return()}finally{if(s)throw a}}}}function sO(e,t){if(e){if(typeof e==`string`)return cO(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?cO(e,t):void 0}}function cO(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function lO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function uO(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?lO(Object(n),!0).forEach(function(t){oD(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lO(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function dO(){var e=new Set,t=null;function n(e){t&&(!e.canMonitor||e.canMonitor(t.canMonitorArgs))&&t.active.add(e)}function r(r){var i=uO({},r);e.add(i),n(i);function a(){e.delete(i),t&&t.active.delete(i)}return lD(a)}function i(r){var i=r.eventName,a=r.payload;if(i===`onGenerateDragPreview`){t={canMonitorArgs:{initial:a.location.initial,source:a.source},active:new Set};var o=oO(e),s;try{for(o.s();!(s=o.n()).done;){var c=s.value;n(c)}}catch(e){o.e(e)}finally{o.f()}}if(t){for(var l=Array.from(t.active),u=0,d=l;u<d.length;u++){var f=d[u];if(t.active.has(f)){var p;(p=f[i])==null||p.call(f,a)}}i===`onDrop`&&(t.active.clear(),t=null)}}return{dispatchEvent:i,monitorForConsumers:r}}function fO(e){var t=e.typeKey,n=e.mount,r=e.dispatchEventToSource,i=e.onPostDispatch,a=e.defaultDropEffect,o=dO(),s=aO({typeKey:t,defaultDropEffect:a});function c(e){r?.(e),s.dispatchEvent(e),o.dispatchEvent(e),i?.(e)}function l(e){var t=e.event,n=e.dragType;qD.start({event:t,dragType:n,getDropTargetsOver:s.getIsOver,dispatchEvent:c})}function u(){function e(){return n({canStart:qD.canStart,start:l})}return XD({typeKey:t,mount:e})}return{registerUsage:u,dropTarget:s.dropTargetForConsumers,monitor:o.monitorForConsumers}}var pO=lD(function(){return navigator.userAgent.toLocaleLowerCase().includes(`android`)}),mO=`pdnd:android-fallback`,hO=`text/plain`,gO=`application/vnd.pdnd`,_O=new WeakMap;function vO(e){return _O.set(e.element,e),function(){_O.delete(e.element)}}var yO=CD(),bO=fO({typeKey:`element`,defaultDropEffect:`move`,mount:function(e){return ZD(yO.bindEvents(),(0,$E.bind)(document,{type:`dragstart`,listener:function(t){if(e.canStart(t)&&!t.defaultPrevented&&t.dataTransfer){var n=t.target;if(n instanceof HTMLElement){var r=_O.get(n);if(r){var i=ID(t),a={element:r.element,dragHandle:r.dragHandle??null,input:i};if(r.canDrag&&!r.canDrag(a)){t.preventDefault();return}if(r.dragHandle){var o=nD({x:i.clientX,y:i.clientY});if(!r.dragHandle.contains(o)){t.preventDefault();return}}var s=r.getInitialDataForExternal?.call(r,a)??null;if(s)for(var c=0,l=Object.entries(s);c<l.length;c++){var u=XE(l[c],2),d=u[0],f=u[1];t.dataTransfer.setData(d,f??``)}pO()&&!t.dataTransfer.types.includes(`text/plain`)&&!t.dataTransfer.types.includes(`text/uri-list`)&&t.dataTransfer.setData(hO,mO),t.dataTransfer.setData(gO,``);var p={type:`element`,payload:{element:r.element,dragHandle:r.dragHandle??null,data:r.getInitialData?.call(r,a)??{}},startedFrom:`internal`};e.start({event:t,dragType:p})}}}}}))},dispatchEventToSource:function(e){var t,n,r=e.eventName,i=e.payload;(t=_O.get(i.source.element))==null||(n=t[r])==null||n.call(t,i)},onPostDispatch:yO.getOnPostDispatch()}),xO=bO.dropTarget;bO.monitor;function SO(e){return lD(ZD(bO.registerUsage(),vO(e),QD(e.element,{attribute:`draggable`,value:`true`})))}function CO(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function wO(e,t){if(e==null)return{};var n,r,i=CO(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function TO(e,t){var n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every(function(n){return Object.is(e[n],t[n])})}function EO(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:TO,t=null;return function(n){return t&&e(t.value,n)||(t={value:n}),t.value}}var DO=[`block`];function OO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function kO(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?OO(Object(n),!0).forEach(function(t){oD(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):OO(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var AO=Symbol(`tree-item-instruction`);function jO(e){return{x:(e.right+e.left)/2,y:(e.bottom+e.top)/2}}function MO(e){var t=e.client,n=e.borderBox,r=n.height/4;return t.y<=n.top+r?`reorder-above`:t.y>=n.bottom-r?`reorder-below`:`make-child`}function NO(e){var t=e.element,n=e.input,r=e.currentLevel,i=e.indentPerLevel,a=e.mode,o={x:n.clientX,y:n.clientY},s=t.getBoundingClientRect();if(a===`standard`)return{type:MO({borderBox:s,client:o}),indentPerLevel:i,currentLevel:r};var c=jO(s);if(a===`expanded`){var l=MO({borderBox:s,client:o});return{type:l===`reorder-above`?l:`make-child`,indentPerLevel:i,currentLevel:r}}var u=i*r;if(o.x<s.left+u){if(o.y<c.y)return{type:`reorder-above`,indentPerLevel:i,currentLevel:r};var d=(o.x-s.left)/i;return{type:`reparent`,desiredLevel:Math.max(Math.floor(d),0),indentPerLevel:i,currentLevel:r}}return{type:MO({borderBox:s,client:o}),indentPerLevel:i,currentLevel:r}}function PO(e,t){return e.type===t.type?e.type===`instruction-blocked`&&t.type===`instruction-blocked`?PO(e.desired,t.desired):TO(e,t):!1}var FO=EO(PO);function IO(e){var t=e.desired,n=e.block;return n!=null&&n.includes(t.type)&&t.type!==`instruction-blocked`?{type:`instruction-blocked`,desired:t}:t}function LO(e,t){var n=t.block,r=FO(IO({desired:NO(wO(t,DO)),block:n}));return kO(kO({},e),{},oD({},AO,r))}function RO(e){return e[AO]??null}var zO=1e3,BO=null,VO=`1px`,HO={width:VO,height:VO,padding:`0`,position:`absolute`,border:`0`,clip:`rect(${VO}, ${VO}, ${VO}, ${VO})`,overflow:`hidden`,whiteSpace:`nowrap`,marginTop:`-${VO}`,pointerEvents:`none`};function UO(){var e=document.createElement(`div`);return e.setAttribute(`role`,`status`),Object.assign(e.style,HO),document.body.append(e),e}function WO(){return BO===null&&(BO=UO()),BO}var GO=null;function KO(){GO!==null&&clearTimeout(GO),GO=null}function qO(e){WO(),KO(),GO=setTimeout(function(){GO=null;var t=WO();t.textContent=e},zO)}export{ay as $,mt as $n,Rf as $t,rT as A,cs as An,zp as At,Px as B,Kt as Bn,lp as Bt,pE as C,Gs as Cn,mm as Ct,JT as D,Us as Dn,Up as Dt,fE as E,Bs as En,Yp as Et,jC as F,Yo as Fn,mp as Ft,Qy as G,It as Gn,ep as Gt,kx as H,Ht as Hn,ap as Ht,aC as I,Ko as In,up as It,Wy as J,kt as Jn,Gf as Jt,Xy as K,Pt as Kn,tp as Kt,rC as L,Xo as Ln,hp as Lt,zC as M,rs as Mn,xp as Mt,NC as N,Qo as Nn,cp as Nt,sT as O,Is as On,Lp as Ot,MC as P,ts as Pn,fp as Pt,sy as Q,vt as Qn,Vf as Qt,GS as R,W as Rn,pp as Rt,gE as S,Js as Sn,Ah as St,uE as T,Hs as Tn,Xp as Tt,dx as U,Bt as Un,sp as Ut,Ox as V,Ut as Vn,rp as Vt,lx as W,zt as Wn,ip as Wt,fy as X,Et as Xn,Ff as Xt,xy as Y,Ot as Yn,Hf as Yt,cy as Z,St as Zn,Bf as Zt,OE as _,dc as _n,Fh as _t,xO as a,Xc as an,Te as ar,v_ as at,yE as b,Zs as bn,kh as bt,RE as c,Fc as cn,bg as ct,UE as d,Ec as dn,rg as dt,al as en,Me as er,ny as et,zE as f,Dc as fn,Wh as ft,NE as g,sc as gn,Nh as gt,PE as h,hc as hn,zh as ht,SO as i,Y as in,be as ir,rv as it,VC as j,is as jn,bp as jt,aT as k,Ls as kn,Ip as kt,VE as l,Lc as ln,dg as lt,IE as m,_c as mn,Hh as mt,LO as n,el as nn,B as nr,uv as nt,ZD as o,zc as on,_e as or,u_ as ot,LE as p,Cc as pn,Uh as pt,Vy as q,Mt as qn,Yf as qt,RO as r,rl as rn,Oe as rr,lv as rt,WE as s,Ic as sn,Ug as st,qO as t,Qc as tn,De as tr,fv as tt,HE as u,Rc as un,ig as ut,xE as v,J as vn,Ih as vt,dE as w,Ws as wn,sm as wt,SE as x,Xs as xn,Mh as xt,bE as y,$s as yn,Ph as yt,WS as z,Zt as zn,dp as zt};
|