@alepha/devtools 0.13.7 → 0.14.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.
Files changed (43) hide show
  1. package/assets/devtools/asset.BZV40eAE.css +1 -0
  2. package/assets/devtools/asset.Bhpm0ujk.css +1 -0
  3. package/assets/devtools/chunk.4uk7i9-q.js +1 -0
  4. package/assets/devtools/chunk.69EpOqBb.js +1 -0
  5. package/assets/devtools/chunk.Ahe7TOrT.js +7 -0
  6. package/assets/devtools/chunk.BOmhpMQZ.js +1 -0
  7. package/assets/devtools/chunk.BPR3Fzfi.js +1 -0
  8. package/assets/devtools/chunk.BY1cUJeA.js +1 -0
  9. package/assets/devtools/chunk.BiZFFFTD.js +1 -0
  10. package/assets/devtools/chunk.BjFrJKj1.js +1 -0
  11. package/assets/devtools/chunk.BlqFPyLh.js +1 -0
  12. package/assets/devtools/chunk.Bmb3xtb6.js +1 -0
  13. package/assets/devtools/chunk.BumKuBFW.js +1 -0
  14. package/assets/devtools/chunk.BzgsKQoC.js +1 -0
  15. package/assets/devtools/chunk.C2hdXZn7.js +1 -0
  16. package/assets/devtools/chunk.CKmrGczh.js +1 -0
  17. package/assets/devtools/chunk.CLi65HO4.js +1 -0
  18. package/assets/devtools/chunk.CUTV1O_R.js +1 -0
  19. package/assets/devtools/chunk.CaPSIJzT.js +9 -0
  20. package/assets/devtools/chunk.ChHWktn9.js +1 -0
  21. package/assets/devtools/chunk.ChW-mtOy.js +1 -0
  22. package/assets/devtools/chunk.CkWIENRP.js +1 -0
  23. package/assets/devtools/chunk.CvqDfxXu.js +1 -0
  24. package/assets/devtools/chunk.CyVfOtMH.js +1 -0
  25. package/assets/devtools/chunk.D4LcKiGJ.js +1 -0
  26. package/assets/devtools/chunk.D4_B6m39.js +1 -0
  27. package/assets/devtools/chunk.D7T7GuJQ.js +1 -0
  28. package/assets/devtools/chunk.DD8gLmva.js +2 -0
  29. package/assets/devtools/chunk.DFYPFYhv.js +2 -0
  30. package/assets/devtools/chunk.DUAYORVN.js +1 -0
  31. package/assets/devtools/chunk.DXpU07Gr.js +1 -0
  32. package/assets/devtools/chunk.DknkYaMA.js +1 -0
  33. package/assets/devtools/chunk.K3IQQCLu.js +1 -0
  34. package/assets/devtools/chunk.KBmIO7L9.js +1 -0
  35. package/assets/devtools/chunk.RI-cVyH7.js +6 -0
  36. package/assets/devtools/chunk.humlEV7p.js +1 -0
  37. package/assets/devtools/chunk.iXAb6asG.js +1 -0
  38. package/assets/devtools/chunk.qynByvMI.js +1 -0
  39. package/assets/devtools/chunk.uyVen0u2.js +1 -0
  40. package/assets/devtools/entry.Bkwg306k.js +75 -0
  41. package/assets/devtools/index.html +11 -0
  42. package/dist/index.d.ts +31 -28
  43. package/package.json +15 -15
@@ -0,0 +1 @@
1
+ import{w as C,Y as O,Z as R,r as x,j as e,F as m,T as i,B as c,H as j,ae as D,z as B,ac as z,O as S,E as F,G as _,af as w,ad as v,a5 as $,a9 as I}from"./entry.Bkwg306k.js";import{d as A}from"./chunk.4uk7i9-q.js";import{S as f,B as T}from"./chunk.DUAYORVN.js";import{I as H}from"./chunk.CUTV1O_R.js";import{T as g}from"./chunk.humlEV7p.js";import{I as J}from"./chunk.DknkYaMA.js";import{I as V,a as G}from"./chunk.iXAb6asG.js";import{T as Y}from"./chunk.BumKuBFW.js";import"./chunk.BlqFPyLh.js";import"./chunk.uyVen0u2.js";const Z=[["path",{d:"M5 19l2.757 -7.351a1 1 0 0 1 .936 -.649h12.307a1 1 0 0 1 .986 1.164l-.996 5.211a2 2 0 0 1 -1.964 1.625h-14.026a2 2 0 0 1 -2 -2v-11a2 2 0 0 1 2 -2h4l3 3h7a2 2 0 0 1 2 2v2",key:"svg-0"}]],q=C("outline","folder-open","FolderOpen",Z);const K=[["path",{d:"M5 4h4l3 3h7a2 2 0 0 1 2 2v8a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-11a2 2 0 0 1 2 -2",key:"svg-0"}]],Q=C("outline","folder","Folder",K);const U=[["path",{d:"M10 14l11 -11",key:"svg-0"}],["path",{d:"M21 3l-6.5 18a.55 .55 0 0 1 -1 0l-3.5 -7l-7 -3.5a.55 .55 0 0 1 0 -1l18 -6.5",key:"svg-1"}]],L=C("outline","send","Send",U),M={memory:"#69db7c",redis:"#ff6b6b",default:"#495057"},E=s=>M[s]??M.default,W=s=>{const o={name:"",fullPath:"",children:new Map};for(const p of s){const a=p.name.split(/[./]/);let l=o;for(let n=0;n<a.length;n++){const r=a[n],d=a.slice(0,n+1).join("/");l.children.has(r)||l.children.set(r,{name:r,fullPath:d,children:new Map}),l=l.children.get(r)}l.topic=p}return o},N=({node:s,depth:o,selectedTopic:p,onSelectTopic:a,expandedNodes:l,onToggleExpand:n})=>{const r=s.children.size>0,d=l.has(s.fullPath),b=s.topic&&p?.name===s.topic.name,t=s.topic?E(s.topic.provider):"#495057",u=()=>{s.topic&&a(s.topic),r&&n(s.fullPath)};return e.jsxs(c,{children:[e.jsxs(m,{align:"center",gap:4,px:"sm",py:4,onClick:u,style:{cursor:"pointer",paddingLeft:o*16+8,backgroundColor:b?`${t}15`:void 0,borderLeft:b?`2px solid ${t}`:"2px solid transparent",borderBottom:`1px solid ${j.colors.border}`},children:[r?d?e.jsx(F,{size:12,opacity:.5}):e.jsx(_,{size:12,opacity:.5}):e.jsx(c,{w:12}),r?d?e.jsx(q,{size:14,opacity:.5}):e.jsx(Q,{size:14,opacity:.5}):e.jsx(S,{size:14,opacity:.5}),e.jsx(i,{size:"sm",style:{flex:1},truncate:!0,fw:s.topic?500:400,children:s.name}),s.topic&&e.jsx(T,{size:"xs",variant:"light",color:s.topic.provider==="redis"?"red":"green",children:s.topic.provider})]}),r&&d&&e.jsx(c,{children:Array.from(s.children.values()).sort((h,y)=>{const P=h.children.size>0,k=y.children.size>0;return P&&!k?-1:!P&&k?1:h.name.localeCompare(y.name)}).map(h=>e.jsx(N,{node:h,depth:o+1,selectedTopic:p,onSelectTopic:a,expandedNodes:l,onToggleExpand:n},h.fullPath))})]})},X=({topics:s,selectedTopic:o,onSelectTopic:p,search:a,onSearchChange:l})=>{const[n,r]=x.useState(new Set),d=x.useMemo(()=>W(s),[s]);x.useEffect(()=>{const t=new Set,u=h=>{h.fullPath&&t.add(h.fullPath);for(const y of h.children.values())u(y)};u(d),r(t)},[d]);const b=x.useCallback(t=>{r(u=>{const h=new Set(u);return h.has(t)?h.delete(t):h.add(t),h})},[]);return e.jsxs(f,{gap:0,h:"100%",children:[e.jsx(c,{p:"sm",style:{borderBottom:`1px solid ${j.colors.border}`},children:e.jsx(D,{placeholder:"Search topics...",leftSection:e.jsx(B,{size:14}),size:"xs",value:a,onChange:t=>l(t.target.value)})}),e.jsx(z,{style:{flex:1},children:Array.from(d.children.values()).sort((t,u)=>t.name.localeCompare(u.name)).map(t=>e.jsx(N,{node:t,depth:0,selectedTopic:o,onSelectTopic:p,expandedNodes:n,onToggleExpand:b},t.fullPath))})]})},ee=({topic:s})=>e.jsx(z,{h:"100%",p:"md",children:e.jsxs(f,{gap:"lg",children:[e.jsxs(c,{children:[e.jsx(i,{size:"sm",fw:600,mb:"xs",children:"Topic Info"}),e.jsxs(f,{gap:"xs",children:[e.jsxs(m,{gap:"sm",children:[e.jsx(i,{size:"sm",c:"dimmed",w:100,children:"Name"}),e.jsx(i,{size:"sm",ff:"monospace",children:s.name})]}),e.jsxs(m,{gap:"sm",children:[e.jsx(i,{size:"sm",c:"dimmed",w:100,children:"Provider"}),e.jsx(T,{size:"xs",variant:"light",color:s.provider==="redis"?"red":"green",children:s.provider})]}),s.description&&e.jsxs(m,{gap:"sm",children:[e.jsx(i,{size:"sm",c:"dimmed",w:100,children:"Description"}),e.jsx(i,{size:"sm",children:s.description})]})]})]}),s.schema&&e.jsxs(c,{children:[e.jsx(i,{size:"sm",fw:600,mb:"xs",children:"Message Schema"}),e.jsx(c,{p:"sm",style:{border:`1px solid ${j.colors.border}`,borderRadius:8,backgroundColor:j.colors.surface},children:e.jsx(w,{data:s.schema,maxDepth:5,size:"xs"})})]})]})}),se=({topic:s})=>{const[o,p]=x.useState([]),[a,l]=x.useState(!1),n=x.useCallback(()=>{const r=s.schema?{example:"data",topic:s.name,timestamp:new Date().toISOString()}:{message:`Hello from ${s.name}`};p(d=>[{id:Math.random().toString(36).slice(2),timestamp:new Date,payload:r},...d.slice(0,49)])},[s]);return e.jsxs(m,{direction:"column",h:"100%",children:[e.jsx(c,{p:"sm",style:{borderBottom:`1px solid ${j.colors.border}`},children:e.jsxs(m,{gap:"sm",align:"center",justify:"space-between",children:[e.jsxs(m,{gap:"sm",align:"center",children:[e.jsx(v,{label:a?"Stop listening (coming soon)":"Start listening (coming soon)",children:e.jsx($,{size:"xs",variant:"light",color:a?"red":"green",leftSection:e.jsx(J,{size:14}),onClick:()=>l(!a),disabled:!0,children:a?"Stop":"Listen"})}),e.jsxs(i,{size:"xs",c:"dimmed",children:[o.length," messages"]})]}),e.jsxs(m,{gap:"sm",children:[e.jsx(v,{label:"Add fake message (for demo)",children:e.jsx(I,{size:"sm",variant:"light",onClick:n,children:e.jsx(L,{size:14})})}),e.jsx(v,{label:"Clear messages",children:e.jsx(I,{size:"sm",variant:"light",color:"gray",onClick:()=>p([]),children:e.jsx(V,{size:14})})})]})]})}),o.length===0?e.jsx(m,{align:"center",justify:"center",style:{flex:1},c:"dimmed",children:e.jsxs(f,{align:"center",gap:"xs",children:[e.jsx(S,{size:48,opacity:.3}),e.jsx(i,{size:"sm",children:"No messages yet"}),e.jsx(i,{size:"xs",c:"dimmed",children:"Click the send icon to add a fake message for demo"})]})}):e.jsx(z,{style:{flex:1},children:e.jsx(f,{gap:0,children:o.map(r=>e.jsxs(c,{p:"sm",style:{borderBottom:`1px solid ${j.colors.border}`},children:[e.jsxs(m,{align:"center",gap:"xs",mb:"xs",children:[e.jsx(G,{size:12,opacity:.5}),e.jsx(i,{size:"xs",c:"dimmed",children:r.timestamp.toLocaleTimeString()})]}),e.jsx(c,{p:"xs",style:{backgroundColor:j.colors.surface,borderRadius:4},children:e.jsx(w,{data:r.payload,maxDepth:3,size:"xs",copyable:!1})})]},r.id))})})]})},re=({topic:s})=>{const[o,p]=x.useState(JSON.stringify({message:"Hello",timestamp:new Date().toISOString()},null,2)),[a,l]=x.useState(null),n=()=>{try{JSON.parse(o),l(null),alert(`Message would be published to "${s.name}" (coming soon)`)}catch{l("Invalid JSON")}};return e.jsx(z,{h:"100%",p:"md",children:e.jsxs(f,{gap:"md",children:[e.jsxs(c,{children:[e.jsx(i,{size:"sm",fw:600,mb:"xs",children:"Publish Message"}),e.jsx(i,{size:"xs",c:"dimmed",mb:"sm",children:"Send a test message to this topic (coming soon)"})]}),e.jsxs(c,{children:[e.jsx(i,{size:"sm",c:"dimmed",mb:"xs",children:"Payload (JSON)"}),e.jsx(Y,{value:o,onChange:r=>p(r.target.value),minRows:8,maxRows:15,autosize:!0,ff:"monospace",size:"xs",error:a,styles:{input:{backgroundColor:j.colors.surface}}})]}),e.jsx(v,{label:"Publish message (coming soon)",children:e.jsx($,{size:"sm",variant:"light",leftSection:e.jsx(L,{size:16}),onClick:n,disabled:!0,children:"Publish"})}),s.schema&&e.jsxs(c,{children:[e.jsx(i,{size:"sm",c:"dimmed",mb:"xs",children:"Expected Schema"}),e.jsx(c,{p:"sm",style:{border:`1px solid ${j.colors.border}`,borderRadius:8,backgroundColor:j.colors.surface},children:e.jsx(w,{data:s.schema,maxDepth:3,size:"xs"})})]})]})})},ie=({topic:s})=>{const o=E(s.provider);return e.jsxs(m,{direction:"column",h:"100%",children:[e.jsxs(c,{px:"md",py:"sm",style:{borderBottom:`1px solid ${j.colors.border}`,backgroundColor:`${o}08`},children:[e.jsxs(m,{align:"center",gap:"sm",children:[e.jsx(S,{size:18,opacity:.7}),e.jsx(i,{size:"md",fw:600,ff:"monospace",children:s.name}),e.jsx(T,{size:"xs",variant:"light",color:s.provider==="redis"?"red":"green",children:s.provider})]}),s.description&&e.jsx(i,{size:"xs",c:"dimmed",mt:4,children:s.description})]}),e.jsxs(g,{defaultValue:"schema",style:{flex:1,display:"flex",flexDirection:"column"},children:[e.jsxs(g.List,{px:"md",children:[e.jsx(g.Tab,{value:"schema",children:"Schema"}),e.jsx(g.Tab,{value:"messages",children:"Messages"}),e.jsx(g.Tab,{value:"publish",children:"Publish"})]}),e.jsx(g.Panel,{value:"schema",style:{flex:1,overflow:"hidden"},children:e.jsx(ee,{topic:s})}),e.jsx(g.Panel,{value:"messages",style:{flex:1,overflow:"hidden"},children:e.jsx(se,{topic:s})}),e.jsx(g.Panel,{value:"publish",style:{flex:1,overflow:"hidden"},children:e.jsx(re,{topic:s})})]})]})},oe=()=>e.jsx(m,{align:"center",justify:"center",h:"100%",c:"dimmed",children:e.jsxs(f,{align:"center",gap:"xs",children:[e.jsx(S,{size:48,opacity:.3}),e.jsx(i,{size:"sm",children:"Select a topic to view details"})]})}),te=()=>e.jsx(m,{align:"center",justify:"center",h:"100%",c:"dimmed",children:e.jsxs(f,{align:"center",gap:"xs",children:[e.jsx(H,{size:48,opacity:.3}),e.jsx(i,{children:"No topics found"}),e.jsx(i,{size:"sm",c:"dimmed",children:"Add topics using $topic primitive to see them here"})]})}),ue=()=>{const s=O(R),[o,p]=x.useState([]),[a,l]=x.useState(!0),[n,r]=x.useState(null),[d,b]=x.useState("");x.useEffect(()=>{s.fetch("/devtools/api/metadata",{schema:{response:A}}).then(u=>{p(u.data.topics),l(!1)})},[]);const t=x.useMemo(()=>{if(!d)return o;const u=d.toLowerCase();return o.filter(h=>h.name.toLowerCase().includes(u))},[o,d]);return a?e.jsx(m,{align:"center",justify:"center",h:"100%",children:e.jsx(i,{c:"dimmed",children:"Loading..."})}):o.length===0?e.jsx(te,{}):e.jsxs(m,{h:"100%",style:{overflow:"hidden"},children:[e.jsx(c,{w:280,style:{borderRight:`1px solid ${j.colors.border}`,backgroundColor:j.colors.surface},children:e.jsx(X,{topics:t,selectedTopic:n,onSelectTopic:r,search:d,onSearchChange:b})}),e.jsx(c,{style:{flex:1,overflow:"hidden"},children:n?e.jsx(ie,{topic:n}):e.jsx(oe,{})})]})};export{ue as DevTopicsViewer,ue as default};
@@ -0,0 +1 @@
1
+ import{aq as To,ar as $o,as as Cr,ap as K,at as Oo,r as P,au as Ue,a0 as Ke,n as Ao,f as ae,b as ne,$ as Zt,av as Qe,j as n,a3 as Xe,c as Qt,p as nn,B as de,q as ve,s as Me,a7 as Vo,g as Kt,e as He,a1 as Xt,aw as rn,i as on,ax as bt,ay as st,az as Fo,t as De,aA as an,a9 as At,aB as Fe,aC as Eo,ak as ln,aD as wr,k as Ot,I as Sr,aE as jr,d as ys,aF as Yo,aG as cn,U as nt,aH as zo,ai as Bo,v as Pr,aI as Nt,aj as Ho,a4 as lt,aJ as Wo,ah as Go,w as Ne,H as Ge,aK as Ko,D as un,T as ye,F as fe,aL as L,ac as qt,am as qo,aM as Uo,aN as Dr,aO as ge,aP as it,aQ as _t,aR as zt,aS as Zo,aT as Qo,aU as Xo,aV as Jo,aW as ea,aX as ta,aY as sa,ae as _r,ag as kr,a5 as ms,aZ as na,Y as Qs,a_ as ra,a$ as oa,b0 as aa,Z as ia,b1 as la,b2 as Gn,b3 as ca}from"./entry.Bkwg306k.js";import{c as os,a as ua,b as vs,A as Ae,u as da}from"./chunk.CLi65HO4.js";import{I as Kn}from"./chunk.BY1cUJeA.js";import{a as qn,I as pa}from"./chunk.iXAb6asG.js";import{S as We,B as Mr}from"./chunk.DUAYORVN.js";import{a as Nr}from"./chunk.69EpOqBb.js";import{g as Ht,S as Lr}from"./chunk.BiZFFFTD.js";import{g as dn,c as pn,u as mn,d as Ie,O as hn,e as Ir,i as Rr,b as ma,S as Tr,C as hs,a as ha,I as fa}from"./chunk.CvqDfxXu.js";import{A as Un}from"./chunk.D4_B6m39.js";import{P as Pe,u as ga,D as Xs}from"./chunk.CkWIENRP.js";import{N as ya,S as va,I as xa}from"./chunk.CaPSIJzT.js";import{S as ba}from"./chunk.BPR3Fzfi.js";import{T as Ca}from"./chunk.BumKuBFW.js";import{T as ut}from"./chunk.Bmb3xtb6.js";import"./chunk.CKmrGczh.js";import"./chunk.BlqFPyLh.js";import"./chunk.KBmIO7L9.js";import"./chunk.BjFrJKj1.js";import"./chunk.uyVen0u2.js";class wa{constructor(t,s){this.id=t,this.options=s,this.options=s,s.initialValues&&(this.values=this.alepha.codec.decode(s.schema,s.initialValues)),this.input=this.createProxyFromSchema(s,s.schema,{store:this.values,parent:""})}log=To();alepha=$o(Cr);values={};submitInProgress=!1;input;get submitting(){return this.submitInProgress}get element(){return window.document.getElementById(this.id)}get currentValues(){return this.restructureValues(this.values)}get props(){return{id:this.id,noValidate:!0,onSubmit:t=>{t?.preventDefault?.(),this.submit()},onReset:t=>this.reset(t)}}reset=t=>{for(const s in this.values)delete this.values[s];return this.options.onReset?.(),this.alepha.events.emit("form:reset",{id:this.id,values:this.values},{catch:!0})};submit=async()=>{if(this.submitInProgress){this.log.warn("Form submission already in progress, ignoring duplicate submit.");return}await this.alepha.events.emit("react:action:begin",{type:"form",id:this.id}),await this.alepha.events.emit("form:submit:begin",{id:this.id}),this.submitInProgress=!0;const t=this.options,r={form:this.element};try{let o=this.restructureValues(this.values);K.schema.isSchema(t.schema)&&(o=this.alepha.codec.decode(t.schema,o)),await t.handler(o,r),await this.alepha.events.emit("react:action:success",{type:"form",id:this.id}),await this.alepha.events.emit("form:submit:success",{id:this.id,values:o})}catch(o){this.log.error("Form submission error:",o),t.onError?.(o,r),await this.alepha.events.emit("react:action:error",{type:"form",id:this.id,error:o}),await this.alepha.events.emit("form:submit:error",{error:o,id:this.id})}finally{this.submitInProgress=!1}await this.alepha.events.emit("react:action:end",{type:"form",id:this.id}),await this.alepha.events.emit("form:submit:end",{id:this.id})};restructureValues(t){const s={};for(const[r,o]of Object.entries(t))r.includes(".")?this.restructureNestedValue(s,r,o):s[r]=o;return s}restructureNestedValue(t,s,r){const o=s.split("."),i=o.pop();if(!i)return;let l=t;for(const a of o)l[a]??={},l=l[a];l[i]=r}createProxyFromSchema(t,s,r){return r.parent,new Proxy({},{get:(o,i)=>{if(!t.schema||!K.schema.isObject(s))return{};if(i in s.properties)return this.createInputFromSchema(i,t,s,s.required?.includes(i)||!1,r)}})}createInputFromSchema(t,s,r,o,i){const l=i.parent||"",a=r.properties?.[t];if(!a)return{path:"",required:o,props:{},schema:r,set:()=>{},form:this};const u=r.required?.includes(t)??!1,d=l?`${l}.${t}`:t,c=`/${d.replaceAll(".","/")}`,p=(h,m=!0)=>{const S=this.getValueFromInput(h,a);if(i.store[d],i.store[d]=S,s.onChange&&s.onChange(d,S,i.store),this.alepha.events.emit("form:change",{id:this.id,path:c,value:S},{catch:!0}),m){const v=window.document.querySelector(`[data-path="${c}"]`);v instanceof HTMLInputElement&&(K.schema.isBoolean(a)?(v.value=h,v.checked=!!h):v.value=h)}},f={name:d,autoComplete:"off",onChange:h=>{if(typeof h=="string"){p(h,!1);return}if(typeof h=="number"){p(h,!1);return}K.schema.isBoolean(a)?h.target.value==="true"?p(!0,!1):h.target.value==="false"?p(!1,!1):h.target.value===""?p(void 0,!1):p(h.target.checked,!1):p(h.target.value,!1)}};if(f["data-path"]=c,s.id&&(f.id=`${s.id}-${d}`,f["data-testid"]=f.id),K.schema.isString(a)&&(a.maxLength!=null&&(f.maxLength=Number(a.maxLength)),a.minLength!=null&&(f.minLength=Number(a.minLength))),s.initialValues?.[t]!=null?f.defaultValue=this.valueToInputEntry(s.initialValues[t]):"default"in a&&a.default!=null&&(f.defaultValue=this.valueToInputEntry(a.default)),u&&(f.required=!0),"description"in a&&typeof a.description=="string"&&(f["aria-label"]=a.description),K.schema.isInteger(a)||K.schema.isNumber(a)?f.type="number":t==="password"?f.type="password":t==="email"?f.type="email":t==="url"?f.type="url":K.schema.isString(a)?a.format==="binary"?f.type="file":a.format==="date"?f.type="date":a.format==="time"?f.type="time":a.format==="date-time"?f.type="datetime-local":f.type="text":K.schema.isBoolean(a)&&(f.type="checkbox"),s.onCreateField){const h=s.onCreateField(t,a);Object.assign(f,h)}return K.schema.isObject(a)?{path:c,props:f,schema:a,set:p,form:this,required:o,items:this.createProxyFromSchema(s,a,{parent:d,store:i.store})}:K.schema.isArray(a)?{path:c,props:f,schema:a,set:p,form:this,required:o,items:[]}:{path:c,props:f,schema:a,set:p,form:this,required:o}}getValueFromInput(t,s){if(t instanceof File)return K.schema.isString(s)&&s.format==="binary"?t:null;if(K.schema.isBoolean(s))return!!t;if(K.schema.isNumber(s)){const r=Number(t);return Number.isNaN(r)?null:r}return K.schema.isString(s)?s.format==="date"?new Date(t).toISOString().slice(0,10):s.format==="time"?new Date(`1970-01-01T${t}`).toISOString().slice(11,16):s.format==="date-time"?new Date(t).toISOString():String(t):t}valueToInputEntry(t){return t==null?"":typeof t=="boolean"||typeof t=="number"||typeof t=="string"?t:t instanceof Date?t.toISOString().slice(0,16):t}}const Sa=(e,t=[])=>{const s=Oo(),r=P.useId();return P.useMemo(()=>s.inject(wa,{lifetime:"transient",args:[e.id||r,e]}),t)};function $r(e){return{x:Ue(e.x,0,1),y:Ue(e.y,0,1)}}function fn(e,t,s="ltr"){const r=P.useRef(!1),o=P.useRef(!1),i=P.useRef(0),[l,a]=P.useState(!1),u=P.useRef(null);return P.useEffect(()=>{r.current=!0},[]),{ref:P.useCallback(c=>{if(u.current&&(u.current(),u.current=null),!c)return;const p=({x:b,y})=>{cancelAnimationFrame(i.current),i.current=requestAnimationFrame(()=>{if(r.current&&c){c.style.userSelect="none";const D=c.getBoundingClientRect();if(D.width&&D.height){const M=Ue((b-D.left)/D.width,0,1);e({x:s==="ltr"?M:1-M,y:Ue((y-D.top)/D.height,0,1)})}}})},f=()=>{document.addEventListener("mousemove",w),document.addEventListener("mouseup",S),document.addEventListener("touchmove",g,{passive:!1}),document.addEventListener("touchend",S)},h=()=>{document.removeEventListener("mousemove",w),document.removeEventListener("mouseup",S),document.removeEventListener("touchmove",g),document.removeEventListener("touchend",S)},m=()=>{!o.current&&r.current&&(o.current=!0,typeof t?.onScrubStart=="function"&&t.onScrubStart(),a(!0),f())},S=()=>{o.current&&r.current&&(o.current=!1,a(!1),h(),setTimeout(()=>{typeof t?.onScrubEnd=="function"&&t.onScrubEnd()},0))},v=b=>{m(),b.preventDefault(),w(b)},w=b=>p({x:b.clientX,y:b.clientY}),x=b=>{b.cancelable&&b.preventDefault(),m(),g(b)},g=b=>{b.cancelable&&b.preventDefault(),p({x:b.changedTouches[0].clientX,y:b.changedTouches[0].clientY})};c.addEventListener("mousedown",v),c.addEventListener("touchstart",x,{passive:!1}),u.current=()=>{c.removeEventListener("mousedown",v),c.removeEventListener("touchstart",x)}},[s,e]),active:l}}function xt(e,t){const s=t-e+1;return Array.from({length:s},(r,o)=>o+e)}const as="dots";function ja({total:e,siblings:t=1,boundaries:s=1,page:r,initialPage:o=1,onChange:i}){const l=Math.max(Math.trunc(e),0),[a,u]=Ke({value:r,onChange:i,defaultValue:o,finalValue:o}),d=S=>{S<=0?u(1):S>l?u(l):u(S)},c=()=>d(a+1),p=()=>d(a-1),f=()=>d(1),h=()=>d(l);return{range:P.useMemo(()=>{if(t*2+3+s*2>=l)return xt(1,l);const v=Math.max(a-t,s),w=Math.min(a+t,l-s),x=v>s+2,g=w<l-(s+1);if(!x&&g){const b=t*2+s+2;return[...xt(1,b),as,...xt(l-(s-1),l)]}if(x&&!g){const b=s+1+2*t;return[...xt(1,s),as,...xt(l-b,l)]}return[...xt(1,s),as,...xt(v,w),as,...xt(l-s+1,l)]},[l,t,a]),active:a,setPage:d,next:c,previous:p,first:f,last:h}}function Pa(){const[e,t]=P.useState(!1);Ao(()=>{t(typeof window<"u"&&!Da()&&"EyeDropper"in window)},[]);const s=P.useCallback((r={})=>e?new window.EyeDropper().open(r):Promise.resolve(void 0),[e]);return{supported:e,open:s}}function Da(){return navigator.userAgent.includes("OPR")}function Zn(e,t){return t.length===0?e:t.reduce((s,r)=>Math.abs(r-e)<Math.abs(s-e)?r:s)}const gn=ae((e,t)=>{const s=ne("Autocomplete",null,e),{classNames:r,styles:o,unstyled:i,vars:l,dropdownOpened:a,defaultDropdownOpened:u,onDropdownClose:d,onDropdownOpen:c,onFocus:p,onBlur:f,onClick:h,onChange:m,data:S,value:v,defaultValue:w,selectFirstOptionOnChange:x,onOptionSubmit:g,comboboxProps:b,readOnly:y,disabled:D,filter:M,limit:$,withScrollArea:O,maxDropdownHeight:z,size:A,id:Y,renderOption:B,autoComplete:I,scrollAreaProps:F,onClear:E,clearButtonProps:H,error:R,clearable:T,rightSection:j,autoSelectOnBlur:C,attributes:_,...k}=s,N=Zt(Y),W=dn(S),G=pn(W),[ee,oe]=Ke({value:v,defaultValue:w,finalValue:"",onChange:m}),re=mn({opened:a,defaultOpened:u,onDropdownOpen:c,onDropdownClose:()=>{d?.(),setTimeout(re.resetSelectedOption,0)}}),q=J=>{oe(J),re.resetSelectedOption()},{resolvedClassNames:te,resolvedStyles:X}=Qe({props:s,styles:o,classNames:r});P.useEffect(()=>{x&&re.selectFirstOption()},[x,ee]);const le=n.jsx(Ie.ClearButton,{...H,onClear:()=>{q(""),E?.()}});return n.jsxs(Ie,{store:re,__staticSelector:"Autocomplete",classNames:te,styles:X,unstyled:i,readOnly:y,size:A,attributes:_,keepMounted:C,onOptionSubmit:J=>{g?.(J),q(G[J].label),re.closeDropdown()},...b,children:[n.jsx(Ie.Target,{autoComplete:I,children:n.jsx(Xe,{ref:t,...k,size:A,__staticSelector:"Autocomplete",__clearSection:le,__clearable:T&&!!ee&&!D&&!y,rightSection:j,disabled:D,readOnly:y,value:ee,error:R,onChange:J=>{q(J.currentTarget.value),re.openDropdown(),x&&re.selectFirstOption()},onFocus:J=>{re.openDropdown(),p?.(J)},onBlur:J=>{C&&re.clickSelectedOption(),re.closeDropdown(),f?.(J)},onClick:J=>{re.openDropdown(),h?.(J)},classNames:te,styles:X,unstyled:i,attributes:_,id:N})}),n.jsx(hn,{data:W,hidden:y||D,filter:M,search:ee,limit:$,hiddenWhenEmpty:!0,withScrollArea:O,maxDropdownHeight:z,unstyled:i,labelId:k.label?`${N}-label`:void 0,"aria-label":k.label?void 0:k["aria-label"],renderOption:B,scrollAreaProps:F})]})});gn.classes={...Xe.classes,...Ie.classes};gn.displayName="@mantine/core/Autocomplete";const[_a,ka]=Qt("Card component was not found in tree");var yn={root:"m_e615b15f",section:"m_599a2148"};const xs=nn((e,t)=>{const s=ne("CardSection",null,e),{classNames:r,className:o,style:i,styles:l,vars:a,withBorder:u,inheritPadding:d,mod:c,...p}=s,f=ka();return n.jsx(de,{ref:t,mod:[{"with-border":u,"inherit-padding":d},c],...f.getStyles("section",{className:o,style:i,styles:l,classNames:r}),...p})});xs.classes=yn;xs.displayName="@mantine/core/CardSection";const Ma=Me((e,{padding:t})=>({root:{"--card-padding":Kt(t)}})),bs=nn((e,t)=>{const s=ne("Card",null,e),{classNames:r,className:o,style:i,styles:l,unstyled:a,vars:u,children:d,padding:c,attributes:p,...f}=s,h=ve({name:"Card",props:s,classes:yn,className:o,style:i,classNames:r,styles:l,unstyled:a,attributes:p,vars:u,varsResolver:Ma}),m=P.Children.toArray(d),S=m.map((v,w)=>typeof v=="object"&&v&&"type"in v&&v.type===xs?P.cloneElement(v,{"data-first-section":w===0||void 0,"data-last-section":w===m.length-1||void 0}):v);return n.jsx(_a,{value:{getStyles:h},children:n.jsx(Vo,{ref:t,unstyled:a,...h("root"),...f,children:S})})});bs.classes=yn;bs.displayName="@mantine/core/Card";bs.Section=xs;var Or={root:"m_de3d2490",colorOverlay:"m_862f3d1b",shadowOverlay:"m_98ae7f22",alphaOverlay:"m_95709ac0",childrenOverlay:"m_93e74e3"};const Qn={withShadow:!0},Na=Me((e,{radius:t,size:s})=>({root:{"--cs-radius":t===void 0?void 0:Xt(t),"--cs-size":He(s)}})),Jt=nn((e,t)=>{const s=ne("ColorSwatch",Qn,e),{classNames:r,className:o,style:i,styles:l,unstyled:a,vars:u,color:d,size:c,radius:p,withShadow:f,children:h,variant:m,attributes:S,...v}=ne("ColorSwatch",Qn,s),w=ve({name:"ColorSwatch",props:s,classes:Or,className:o,style:i,classNames:r,styles:l,unstyled:a,attributes:S,vars:u,varsResolver:Na});return n.jsxs(de,{ref:t,variant:m,size:c,...w("root",{focusable:!0}),...v,children:[n.jsx("span",{...w("alphaOverlay")}),f&&n.jsx("span",{...w("shadowOverlay")}),n.jsx("span",{...w("colorOverlay",{style:{backgroundColor:d}})}),n.jsx("span",{...w("childrenOverlay"),children:h})]})});Jt.classes=Or;Jt.displayName="@mantine/core/ColorSwatch";const[La,vn]=rn(null),xn=P.forwardRef(({position:e,...t},s)=>n.jsx(de,{ref:s,__vars:{"--thumb-y-offset":`${e.y*100}%`,"--thumb-x-offset":`${e.x*100}%`},...t}));xn.displayName="@mantine/core/ColorPickerThumb";var bn={wrapper:"m_fee9c77",preview:"m_9dddfbac",body:"m_bffecc3e",sliders:"m_3283bb96",thumb:"m_40d572ba",swatch:"m_d8ee6fd8",swatches:"m_5711e686",saturation:"m_202a296e",saturationOverlay:"m_11b3db02",slider:"m_d856d47d",sliderOverlay:"m_8f327113"};const Cn=ae((e,t)=>{const s=ne("ColorSlider",null,e),{classNames:r,className:o,style:i,styles:l,unstyled:a,vars:u,onChange:d,onChangeEnd:c,maxValue:p,round:f,size:h="md",focusable:m=!0,value:S,overlays:v,thumbColor:w="transparent",onScrubStart:x,onScrubEnd:g,__staticSelector:b="ColorPicker",attributes:y,...D}=s,M=ve({name:b,classes:bn,props:s,className:o,style:i,classNames:r,styles:l,unstyled:a,attributes:y}),O=vn()?.getStyles||M,z=on(),[A,Y]=P.useState({y:0,x:S/p}),B=P.useRef(A),I=T=>f?Math.round(T*p):T*p,{ref:F}=fn(({x:T,y:j})=>{B.current={x:T,y:j},d?.(I(T))},{onScrubEnd:()=>{const{x:T}=B.current;c?.(I(T)),g?.()},onScrubStart:x});bt(()=>{Y({y:0,x:S/p})},[S]);const E=(T,j)=>{T.preventDefault();const C=$r(j);d?.(I(C.x)),c?.(I(C.x))},H=T=>{switch(T.key){case"ArrowRight":{E(T,{x:A.x+.05,y:A.y});break}case"ArrowLeft":{E(T,{x:A.x-.05,y:A.y});break}}},R=v.map((T,j)=>P.createElement("div",{...O("sliderOverlay"),style:T,key:j}));return n.jsxs(de,{...D,ref:st(F,t),...O("slider"),role:"slider","aria-valuenow":S,"aria-valuemax":p,"aria-valuemin":0,tabIndex:m?0:-1,onKeyDown:H,"data-focus-ring":z.focusRing,__vars:{"--cp-thumb-size":`var(--cp-thumb-size-${h})`},children:[R,n.jsx(xn,{position:A,...O("thumb",{style:{top:He(1),background:w}})})]})});Cn.displayName="@mantine/core/ColorSlider";function Ze(e,t=0,s=10**t){return Math.round(s*e)/s}function Ia({h:e,s:t,l:s,a:r}){const o=t*((s<50?s:100-s)/100);return{h:e,s:o>0?2*o/(s+o)*100:0,v:s+o,a:r}}const Ra={grad:360/400,turn:360,rad:360/(Math.PI*2)};function Ta(e,t="deg"){return Number(e)*(Ra[t]||1)}const $a=/hsla?\(?\s*(-?\d*\.?\d+)(deg|rad|grad|turn)?[,\s]+(-?\d*\.?\d+)%?[,\s]+(-?\d*\.?\d+)%?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i;function Xn(e){const t=$a.exec(e);return t?Ia({h:Ta(t[1],t[2]),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)}):{h:0,s:0,v:0,a:1}}function Js({r:e,g:t,b:s,a:r}){const o=Math.max(e,t,s),i=o-Math.min(e,t,s),l=i?o===e?(t-s)/i:o===t?2+(s-e)/i:4+(e-t)/i:0;return{h:Ze(60*(l<0?l+6:l),3),s:Ze(o?i/o*100:0,3),v:Ze(o/255*100,3),a:r}}function en(e){const t=e[0]==="#"?e.slice(1):e;return t.length===3?Js({r:parseInt(t[0]+t[0],16),g:parseInt(t[1]+t[1],16),b:parseInt(t[2]+t[2],16),a:1}):Js({r:parseInt(t.slice(0,2),16),g:parseInt(t.slice(2,4),16),b:parseInt(t.slice(4,6),16),a:1})}function Oa(e){const t=e[0]==="#"?e.slice(1):e,s=l=>Ze(parseInt(l,16)/255,3);if(t.length===4){const l=t.slice(0,3),a=s(t[3]+t[3]);return{...en(l),a}}const r=t.slice(0,6),o=s(t.slice(6,8));return{...en(r),a:o}}const Aa=/rgba?\(?\s*(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i;function Jn(e){const t=Aa.exec(e);return t?Js({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:t[7]===void 0?1:Number(t[7])/(t[8]?100:1)}):{h:0,s:0,v:0,a:1}}const Ar={hex:/^#?([0-9A-F]{3}){1,2}$/i,hexa:/^#?([0-9A-F]{4}){1,2}$/i,rgb:/^rgb\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/i,rgba:/^rgba\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/i,hsl:/hsl\(\s*(\d+)\s*,\s*(\d+(?:\.\d+)?%)\s*,\s*(\d+(?:\.\d+)?%)\)/i,hsla:/^hsla\((\d+),\s*([\d.]+)%,\s*([\d.]+)%,\s*(\d*(?:\.\d+)?)\)$/i},Va={hex:en,hexa:Oa,rgb:Jn,rgba:Jn,hsl:Xn,hsla:Xn};function Wt(e){for(const[,t]of Object.entries(Ar))if(t.test(e))return!0;return!1}function kt(e){if(typeof e!="string")return{h:0,s:0,v:0,a:1};if(e==="transparent")return{h:0,s:0,v:0,a:0};const t=e.trim();for(const[s,r]of Object.entries(Ar))if(r.test(t))return Va[s](t);return{h:0,s:0,v:0,a:1}}const Vr=P.forwardRef((e,t)=>{const{value:s,onChange:r,onChangeEnd:o,color:i,...l}=ne("AlphaSlider",null,e);return n.jsx(Cn,{...l,ref:t,value:s,onChange:a=>r?.(Ze(a,2)),onChangeEnd:a=>o?.(Ze(a,2)),maxValue:1,round:!1,"data-alpha":!0,overlays:[{backgroundImage:"linear-gradient(45deg, var(--slider-checkers) 25%, transparent 25%), linear-gradient(-45deg, var(--slider-checkers) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, var(--slider-checkers) 75%), linear-gradient(-45deg, var(--mantine-color-body) 75%, var(--slider-checkers) 75%)",backgroundSize:`${He(8)} ${He(8)}`,backgroundPosition:`0 0, 0 ${He(4)}, ${He(4)} ${He(-4)}, ${He(-4)} 0`},{backgroundImage:`linear-gradient(90deg, transparent, ${i})`},{boxShadow:`rgba(0, 0, 0, .1) 0 0 0 ${He(1)} inset, rgb(0, 0, 0, .15) 0 0 ${He(4)} inset`}]})});Vr.displayName="@mantine/core/AlphaSlider";function Fr({h:e,s:t,v:s,a:r}){const o=e/360*6,i=t/100,l=s/100,a=Math.floor(o),u=l*(1-i),d=l*(1-(o-a)*i),c=l*(1-(1-o+a)*i),p=a%6;return{r:Ze([l,d,u,u,c,l][p]*255),g:Ze([c,l,l,d,u,u][p]*255),b:Ze([u,u,c,l,l,d][p]*255),a:Ze(r,2)}}function er(e,t){const{r:s,g:r,b:o,a:i}=Fr(e);return t?`rgba(${s}, ${r}, ${o}, ${Ze(i,2)})`:`rgb(${s}, ${r}, ${o})`}function tr({h:e,s:t,v:s,a:r},o){const i=(200-t)*s/100,l={h:Math.round(e),s:Math.round(i>0&&i<200?t*s/100/(i<=100?i:200-i)*100:0),l:Math.round(i/2)};return o?`hsla(${l.h}, ${l.s}%, ${l.l}%, ${Ze(r,2)})`:`hsl(${l.h}, ${l.s}%, ${l.l}%)`}function ls(e){const t=e.toString(16);return t.length<2?`0${t}`:t}function Er(e){const{r:t,g:s,b:r}=Fr(e);return`#${ls(t)}${ls(s)}${ls(r)}`}function Fa(e){const t=Math.round(e.a*255);return`${Er(e)}${ls(t)}`}const Hs={hex:Er,hexa:e=>Fa(e),rgb:e=>er(e,!1),rgba:e=>er(e,!0),hsl:e=>tr(e,!1),hsla:e=>tr(e,!0)};function tt(e,t){return t?e in Hs?Hs[e](t):Hs.hex(t):"#000000"}const Yr=P.forwardRef((e,t)=>{const{value:s,onChange:r,onChangeEnd:o,color:i,...l}=ne("HueSlider",{},e);return n.jsx(Cn,{...l,ref:t,value:s,onChange:r,onChangeEnd:o,maxValue:360,thumbColor:`hsl(${s}, 100%, 50%)`,round:!0,"data-hue":!0,overlays:[{backgroundImage:"linear-gradient(to right,hsl(0,100%,50%),hsl(60,100%,50%),hsl(120,100%,50%),hsl(170,100%,50%),hsl(240,100%,50%),hsl(300,100%,50%),hsl(360,100%,50%))"},{boxShadow:`rgba(0, 0, 0, .1) 0 0 0 ${He(1)} inset, rgb(0, 0, 0, .15) 0 0 ${He(4)} inset`}]})});Yr.displayName="@mantine/core/HueSlider";function zr({className:e,onChange:t,onChangeEnd:s,value:r,saturationLabel:o,focusable:i=!0,size:l,color:a,onScrubStart:u,onScrubEnd:d,...c}){const{getStyles:p}=vn(),[f,h]=P.useState({x:r.s/100,y:1-r.v/100}),m=P.useRef(f),{ref:S}=fn(({x,y:g})=>{m.current={x,y:g},t({s:Math.round(x*100),v:Math.round((1-g)*100)})},{onScrubEnd:()=>{const{x,y:g}=m.current;s({s:Math.round(x*100),v:Math.round((1-g)*100)}),d?.()},onScrubStart:u});P.useEffect(()=>{h({x:r.s/100,y:1-r.v/100})},[r.s,r.v]);const v=(x,g)=>{x.preventDefault();const b=$r(g);t({s:Math.round(b.x*100),v:Math.round((1-b.y)*100)}),s({s:Math.round(b.x*100),v:Math.round((1-b.y)*100)})},w=x=>{switch(x.key){case"ArrowUp":{v(x,{y:f.y-.05,x:f.x});break}case"ArrowDown":{v(x,{y:f.y+.05,x:f.x});break}case"ArrowRight":{v(x,{x:f.x+.05,y:f.y});break}case"ArrowLeft":{v(x,{x:f.x-.05,y:f.y});break}}};return n.jsxs(de,{...p("saturation"),ref:S,...c,role:"slider","aria-label":o,"aria-valuenow":f.x,"aria-valuetext":tt("rgba",r),tabIndex:i?0:-1,onKeyDown:w,children:[n.jsx("div",{...p("saturationOverlay",{style:{backgroundColor:`hsl(${r.h}, 100%, 50%)`}})}),n.jsx("div",{...p("saturationOverlay",{style:{backgroundImage:"linear-gradient(90deg, #fff, transparent)"}})}),n.jsx("div",{...p("saturationOverlay",{style:{backgroundImage:"linear-gradient(0deg, #000, transparent)"}})}),n.jsx(xn,{position:f,...p("thumb",{style:{backgroundColor:a}})})]})}zr.displayName="@mantine/core/Saturation";const Br=P.forwardRef(({className:e,datatype:t,setValue:s,onChangeEnd:r,size:o,focusable:i,data:l,swatchesPerRow:a,value:u,...d},c)=>{const p=vn(),f=l.map((h,m)=>P.createElement(Jt,{...p.getStyles("swatch"),unstyled:p.unstyled,component:"button",type:"button",color:h,key:m,radius:"sm",onClick:()=>{s(h),r?.(h)},"aria-label":h,tabIndex:i?0:-1,"data-swatch":!0},u===h&&n.jsx(Ir,{size:"35%",color:Fo(h)<.5?"white":"black"})));return n.jsx(de,{...p.getStyles("swatches"),ref:c,...d,children:f})});Br.displayName="@mantine/core/Swatches";const Ea={swatchesPerRow:7,withPicker:!0,focusable:!0,size:"md",__staticSelector:"ColorPicker"},Ya=Me((e,{size:t,swatchesPerRow:s})=>({wrapper:{"--cp-preview-size":De(t,"cp-preview-size"),"--cp-width":De(t,"cp-width"),"--cp-body-spacing":Kt(t),"--cp-swatch-size":`${100/s}%`,"--cp-thumb-size":De(t,"cp-thumb-size"),"--cp-saturation-height":De(t,"cp-saturation-height")}})),wn=ae((e,t)=>{const s=ne("ColorPicker",Ea,e),{classNames:r,className:o,style:i,styles:l,unstyled:a,vars:u,format:d="hex",value:c,defaultValue:p,onChange:f,onChangeEnd:h,withPicker:m,size:S,saturationLabel:v,hueLabel:w,alphaLabel:x,focusable:g,swatches:b,swatchesPerRow:y,fullWidth:D,onColorSwatchClick:M,__staticSelector:$,mod:O,attributes:z,...A}=s,Y=ve({name:$,props:s,classes:bn,className:o,style:i,classNames:r,styles:l,unstyled:a,attributes:z,rootSelector:"wrapper",vars:u,varsResolver:Ya}),B=P.useRef(d||"hex"),I=P.useRef(""),F=P.useRef(-1),E=P.useRef(!1),H=d==="hexa"||d==="rgba"||d==="hsla",[R,T,j]=Ke({value:c,defaultValue:p,finalValue:"#FFFFFF",onChange:f}),[C,_]=P.useState(kt(R)),k=()=>{window.clearTimeout(F.current),E.current=!0},N=()=>{window.clearTimeout(F.current),F.current=window.setTimeout(()=>{E.current=!1},200)},W=G=>{_(ee=>{const oe={...ee,...G};return I.current=tt(B.current,oe),oe}),T(I.current)};return bt(()=>{typeof c=="string"&&Wt(c)&&!E.current&&_(kt(c))},[c]),bt(()=>{B.current=d||"hex",T(tt(B.current,C))},[d]),n.jsx(La,{value:{getStyles:Y,unstyled:a},children:n.jsxs(de,{ref:t,...Y("wrapper"),size:S,mod:[{"full-width":D},O],...A,children:[m&&n.jsxs(n.Fragment,{children:[n.jsx(zr,{value:C,onChange:W,onChangeEnd:({s:G,v:ee})=>h?.(tt(B.current,{...C,s:G,v:ee})),color:R,size:S,focusable:g,saturationLabel:v,onScrubStart:k,onScrubEnd:N}),n.jsxs("div",{...Y("body"),children:[n.jsxs("div",{...Y("sliders"),children:[n.jsx(Yr,{value:C.h,onChange:G=>W({h:G}),onChangeEnd:G=>h?.(tt(B.current,{...C,h:G})),size:S,focusable:g,"aria-label":w,onScrubStart:k,onScrubEnd:N}),H&&n.jsx(Vr,{value:C.a,onChange:G=>W({a:G}),onChangeEnd:G=>{h?.(tt(B.current,{...C,a:G}))},size:S,color:tt("hex",C),focusable:g,"aria-label":x,onScrubStart:k,onScrubEnd:N})]}),H&&n.jsx(Jt,{color:R,radius:"sm",size:"var(--cp-preview-size)",...Y("preview")})]})]}),Array.isArray(b)&&n.jsx(Br,{data:b,swatchesPerRow:y,focusable:g,setValue:T,value:R,onChangeEnd:G=>{const ee=tt(d,kt(G));M?.(ee),h?.(ee),j||_(kt(G))}})]})})});wn.classes=bn;wn.displayName="@mantine/core/ColorPicker";function za({style:e,...t}){return n.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",style:{width:"var(--ci-eye-dropper-icon-size)",height:"var(--ci-eye-dropper-icon-size)",...e},viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",...t,children:[n.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),n.jsx("path",{d:"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"}),n.jsx("path",{d:"M12 3l0 4"}),n.jsx("path",{d:"M12 21l0 -3"}),n.jsx("path",{d:"M3 12l4 0"}),n.jsx("path",{d:"M21 12l-3 0"}),n.jsx("path",{d:"M12 12l0 .01"})]})}var sr={eyeDropperIcon:"m_b077c2bc",eyeDropperButton:"m_66a028b5",colorPreview:"m_c5ccdcab",dropdown:"m_5ece2cd7"};const nr={format:"hex",fixOnBlur:!0,withPreview:!0,swatchesPerRow:7,withPicker:!0,popoverProps:{transitionProps:{transition:"fade",duration:0}},withEyeDropper:!0,size:"sm"},Ba=Me((e,{size:t})=>({eyeDropperIcon:{"--ci-eye-dropper-icon-size":De(t,"ci-eye-dropper-icon-size")},eyeDropperButton:{"--ci-button-size":De(t,"ci-button-size")},colorPreview:{"--ci-preview-size":De(t,"ci-preview-size")}})),Sn=ae((e,t)=>{const s=ne("ColorInput",nr,e),{classNames:r,styles:o,unstyled:i,disallowInput:l,fixOnBlur:a,popoverProps:u,withPreview:d,withEyeDropper:c,eyeDropperIcon:p,closeOnColorSwatchClick:f,eyeDropperButtonProps:h,value:m,defaultValue:S,onChange:v,onChangeEnd:w,onClick:x,onFocus:g,onBlur:b,inputProps:y,format:D="hex",wrapperProps:M,readOnly:$,withPicker:O,swatches:z,disabled:A,leftSection:Y,rightSection:B,swatchesPerRow:I,...F}=an("ColorInput",nr,e),E=ve({name:"ColorInput",props:s,classes:sr,classNames:r,styles:o,unstyled:i,rootSelector:"wrapper",vars:s.vars,varsResolver:Ba}),{resolvedClassNames:H,resolvedStyles:R}=Qe({classNames:r,styles:o,props:s}),[T,j]=P.useState(!1),[C,_]=P.useState(""),[k,N]=Ke({value:m,defaultValue:S,finalValue:"",onChange:v}),{supported:W,open:G}=Pa(),ee=n.jsx(At,{...h,...E("eyeDropperButton",{className:h?.className,style:h?.style}),variant:"subtle",color:"gray",unstyled:i,onClick:()=>G().then(te=>{if(te?.sRGBHex){const X=tt(D,kt(te.sRGBHex));N(X),w?.(X)}}).catch(()=>{}),children:p||n.jsx(za,{...E("eyeDropperIcon")})}),oe=te=>{g?.(te),j(!0)},re=te=>{a&&N(C),b?.(te),j(!1)},q=te=>{x?.(te),j(!0)};return P.useEffect(()=>{(Wt(k)||k.trim()==="")&&_(k)},[k]),bt(()=>{Wt(k)&&N(tt(D,kt(k)))},[D]),n.jsx(Fe.Wrapper,{...M,classNames:H,styles:R,__staticSelector:"ColorInput",children:n.jsxs(Pe,{__staticSelector:"ColorInput",position:"bottom-start",offset:5,opened:T,...u,classNames:H,styles:R,unstyled:i,withRoles:!1,disabled:$||O===!1&&(!Array.isArray(z)||z.length===0),children:[n.jsx(Pe.Target,{children:n.jsx(Fe,{autoComplete:"off",...F,...y,classNames:H,styles:R,disabled:A,ref:t,__staticSelector:"ColorInput",onFocus:oe,onBlur:re,onClick:q,spellCheck:!1,value:k,onChange:te=>{const X=te.currentTarget.value;N(X),Wt(X)&&w?.(tt(D,kt(X)))},leftSection:Y||(d?n.jsx(Jt,{color:Wt(k)?k:"#fff",size:"var(--ci-preview-size)",...E("colorPreview")}):null),readOnly:l||$,pointer:l,unstyled:i,rightSection:B||(c&&!A&&!$&&W?ee:null)})}),n.jsx(Pe.Dropdown,{onMouseDown:te=>te.preventDefault(),className:sr.dropdown,children:n.jsx(wn,{__staticSelector:"ColorInput",value:k,onChange:N,onChangeEnd:w,format:D,swatches:z,swatchesPerRow:I,withPicker:O,size:y.size,focusable:!1,unstyled:i,styles:R,classNames:H,onColorSwatchClick:()=>f&&j(!1),attributes:M.attributes})})]})})});Sn.classes=Xe.classes;Sn.displayName="@mantine/core/ColorInput";var Hr={root:"m_e9408a47","root--default":"m_84c9523a","root--filled":"m_ef274e49","root--unstyled":"m_eda993d3",legend:"m_90794832","legend--unstyled":"m_74ca27fe"};const Ha={variant:"default"},Wa=Me((e,{radius:t})=>({root:{"--fieldset-radius":t===void 0?void 0:Xt(t)}})),Cs=ae((e,t)=>{const s=ne("Fieldset",Ha,e),{classNames:r,className:o,style:i,styles:l,unstyled:a,vars:u,legend:d,variant:c,children:p,attributes:f,...h}=s,m=ve({name:"Fieldset",classes:Hr,props:s,className:o,style:i,classNames:r,styles:l,unstyled:a,attributes:f,vars:u,varsResolver:Wa});return n.jsxs(de,{component:"fieldset",ref:t,variant:c,...m("root",{variant:c}),...h,children:[d&&n.jsx("legend",{...m("legend",{variant:c}),children:d}),p]})});Cs.classes=Hr;Cs.displayName="@mantine/core/Fieldset";const Ga={multiple:!1},Wr=P.forwardRef((e,t)=>{const{onChange:s,children:r,multiple:o,accept:i,name:l,form:a,resetRef:u,disabled:d,capture:c,inputProps:p,...f}=ne("FileButton",Ga,e),h=P.useRef(null),m=()=>{!d&&h.current?.click()},S=w=>{if(w.currentTarget.files===null)return s(o?[]:null);s(o?Array.from(w.currentTarget.files):w.currentTarget.files[0]||null)};return Eo(u,()=>{h.current&&(h.current.value="")}),n.jsxs(n.Fragment,{children:[n.jsx("input",{style:{display:"none"},type:"file",accept:i,multiple:o,onChange:S,ref:st(t,h),name:l,form:a,capture:c,...p}),r({onClick:m,...f})]})});Wr.displayName="@mantine/core/FileButton";const Ka=({value:e})=>n.jsx("div",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:Array.isArray(e)?e.map(t=>t.name).join(", "):e?.name}),qa={valueComponent:Ka},jn=ae((e,t)=>{const s=ne("FileInput",qa,e),{unstyled:r,vars:o,onChange:i,value:l,defaultValue:a,multiple:u,accept:d,name:c,form:p,valueComponent:f,clearable:h,clearButtonProps:m,readOnly:S,capture:v,fileInputProps:w,rightSection:x,size:g,placeholder:b,component:y,resetRef:D,classNames:M,styles:$,attributes:O,...z}=s,A=P.useRef(null),{resolvedClassNames:Y,resolvedStyles:B}=Qe({classNames:M,styles:$,props:s}),[I,F]=Ke({value:l,defaultValue:a,onChange:i,finalValue:u?[]:null}),E=Array.isArray(I)?I.length!==0:I!==null,H=x||(h&&E&&!S?n.jsx(ln,{...m,variant:"subtle",onClick:()=>F(u?[]:null),size:g,unstyled:r}):null);return P.useEffect(()=>{(Array.isArray(I)&&I.length===0||I===null)&&A.current?.()},[I]),n.jsx(Wr,{onChange:F,multiple:u,accept:d,name:c,form:p,resetRef:st(A,D),disabled:S,capture:v,inputProps:w,children:R=>n.jsx(Xe,{component:y||"button",ref:t,rightSection:H,...R,...z,__staticSelector:"FileInput",multiline:!0,type:"button",pointer:!0,__stylesApiProps:s,unstyled:r,size:g,classNames:M,styles:$,attributes:O,children:E?n.jsx(f,{value:I}):n.jsx(Fe.Placeholder,{__staticSelector:"FileInput",classNames:Y,styles:B,attributes:O,children:b})})})});jn.classes=Xe.classes;jn.displayName="@mantine/core/FileInput";const Ua=jn,[rr,Gr]=Qt("Grid component was not found in tree"),tn=(e,t)=>e==="content"?"auto":e==="auto"?"0rem":e?`${100/(t/e)}%`:void 0,or=(e,t,s)=>s||e==="auto"?"100%":e==="content"?"unset":tn(e,t),ar=(e,t)=>{if(e)return e==="auto"||t?"1":"auto"},ir=(e,t)=>e===0?"0":e?`${100/(t/e)}%`:void 0;function Za({span:e,order:t,offset:s,selector:r}){const o=on(),i=Gr(),l=i.breakpoints||o.breakpoints,u=Ht(e)===void 0?12:Ht(e),d=wr({"--col-order":Ht(t)?.toString(),"--col-flex-grow":ar(u,i.grow),"--col-flex-basis":tn(u,i.columns),"--col-width":u==="content"?"auto":void 0,"--col-max-width":or(u,i.columns,i.grow),"--col-offset":ir(Ht(s),i.columns)}),c=Ot(l).reduce((h,m)=>(h[m]||(h[m]={}),typeof t=="object"&&t[m]!==void 0&&(h[m]["--col-order"]=t[m]?.toString()),typeof e=="object"&&e[m]!==void 0&&(h[m]["--col-flex-grow"]=ar(e[m],i.grow),h[m]["--col-flex-basis"]=tn(e[m],i.columns),h[m]["--col-width"]=e[m]==="content"?"auto":void 0,h[m]["--col-max-width"]=or(e[m],i.columns,i.grow)),typeof s=="object"&&s[m]!==void 0&&(h[m]["--col-offset"]=ir(s[m],i.columns)),h),{}),f=Nr(Ot(c),l).filter(h=>Ot(c[h.value]).length>0).map(h=>({query:i.type==="container"?`mantine-grid (min-width: ${l[h.value]})`:`(min-width: ${l[h.value]})`,styles:c[h.value]}));return n.jsx(Sr,{styles:d,media:i.type==="container"?void 0:f,container:i.type==="container"?f:void 0,selector:r})}var Pn={container:"m_8478a6da",root:"m_410352e9",inner:"m_dee7bd2f",col:"m_96bdd299"};const Qa={span:12},Dn=ae((e,t)=>{const s=ne("GridCol",Qa,e),{classNames:r,className:o,style:i,styles:l,vars:a,span:u,order:d,offset:c,...p}=s,f=Gr(),h=jr();return n.jsxs(n.Fragment,{children:[n.jsx(Za,{selector:`.${h}`,span:u,order:d,offset:c}),n.jsx(de,{ref:t,...f.getStyles("col",{className:ys(o,h),style:i,classNames:r,styles:l}),...p})]})});Dn.classes=Pn;Dn.displayName="@mantine/core/GridCol";function lr({gutter:e,selector:t,breakpoints:s,type:r}){const o=on(),i=s||o.breakpoints,l=wr({"--grid-gutter":Kt(Ht(e))}),a=Ot(i).reduce((c,p)=>(c[p]||(c[p]={}),typeof e=="object"&&e[p]!==void 0&&(c[p]["--grid-gutter"]=Kt(e[p])),c),{}),d=Nr(Ot(a),i).filter(c=>Ot(a[c.value]).length>0).map(c=>({query:r==="container"?`mantine-grid (min-width: ${i[c.value]})`:`(min-width: ${i[c.value]})`,styles:a[c.value]}));return n.jsx(Sr,{styles:l,media:r==="container"?void 0:d,container:r==="container"?d:void 0,selector:t})}const Xa={gutter:"md",grow:!1,columns:12},Ja=Me((e,{justify:t,align:s,overflow:r})=>({root:{"--grid-justify":t,"--grid-align":s,"--grid-overflow":r}})),dt=ae((e,t)=>{const s=ne("Grid",Xa,e),{classNames:r,className:o,style:i,styles:l,unstyled:a,vars:u,grow:d,gutter:c,columns:p,align:f,justify:h,children:m,breakpoints:S,type:v,attributes:w,...x}=s,g=ve({name:"Grid",classes:Pn,props:s,className:o,style:i,classNames:r,styles:l,unstyled:a,attributes:w,vars:u,varsResolver:Ja}),b=jr();return v==="container"&&S?n.jsxs(rr,{value:{getStyles:g,grow:d,columns:p,breakpoints:S,type:v},children:[n.jsx(lr,{selector:`.${b}`,...s}),n.jsx("div",{...g("container"),children:n.jsx(de,{ref:t,...g("root",{className:b}),...x,children:n.jsx("div",{...g("inner"),children:m})})})]}):n.jsxs(rr,{value:{getStyles:g,grow:d,columns:p,breakpoints:S,type:v},children:[n.jsx(lr,{selector:`.${b}`,...s}),n.jsx(de,{ref:t,...g("root",{className:b}),...x,children:n.jsx("div",{...g("inner"),children:m})})]})});dt.classes=Pn;dt.displayName="@mantine/core/Grid";dt.Col=Dn;const[ei,_n]=rn(),[ti,si]=rn();var ws={root:"m_7cda1cd6","root--default":"m_44da308b","root--contrast":"m_e3a01f8",label:"m_1e0e6180",remove:"m_ae386778",group:"m_1dcfd90b"};const ni=Me((e,{gap:t},{size:s})=>({group:{"--pg-gap":t!==void 0?De(t):De(s,"pg-gap")}})),kn=ae((e,t)=>{const s=ne("PillGroup",null,e),{classNames:r,className:o,style:i,styles:l,unstyled:a,vars:u,size:d,disabled:c,attributes:p,...f}=s,m=_n()?.size||d||void 0,S=ve({name:"PillGroup",classes:ws,props:s,className:o,style:i,classNames:r,styles:l,unstyled:a,attributes:p,vars:u,varsResolver:ni,stylesCtx:{size:m},rootSelector:"group"});return n.jsx(ti,{value:{size:m,disabled:c},children:n.jsx(de,{ref:t,size:m,...S("group"),...f})})});kn.classes=ws;kn.displayName="@mantine/core/PillGroup";const ri={variant:"default"},oi=Me((e,{radius:t},{size:s})=>({root:{"--pill-fz":De(s,"pill-fz"),"--pill-height":De(s,"pill-height"),"--pill-radius":t===void 0?void 0:Xt(t)}})),Mt=ae((e,t)=>{const s=ne("Pill",ri,e),{classNames:r,className:o,style:i,styles:l,unstyled:a,vars:u,variant:d,children:c,withRemoveButton:p,onRemove:f,removeButtonProps:h,radius:m,size:S,disabled:v,mod:w,attributes:x,...g}=s,b=si(),y=_n(),D=S||b?.size||void 0,M=y?.variant==="filled"?"contrast":d||"default",$=ve({name:"Pill",classes:ws,props:s,className:o,style:i,classNames:r,styles:l,unstyled:a,attributes:x,vars:u,varsResolver:oi,stylesCtx:{size:D}});return n.jsxs(de,{component:"span",ref:t,variant:M,size:D,...$("root",{variant:M}),mod:[{"with-remove":p&&!v,disabled:v||b?.disabled},w],...g,children:[n.jsx("span",{...$("label"),children:c}),p&&n.jsx(ln,{variant:"transparent",radius:m,tabIndex:-1,"aria-hidden":!0,unstyled:a,...h,...$("remove",{className:h?.className,style:h?.style}),onMouseDown:O=>{O.preventDefault(),O.stopPropagation(),h?.onMouseDown?.(O)},onClick:O=>{O.stopPropagation(),f?.(),h?.onClick?.(O)}})]})});Mt.classes=ws;Mt.displayName="@mantine/core/Pill";Mt.Group=kn;var Kr={field:"m_45c4369d"};const ai={type:"visible"},Mn=ae((e,t)=>{const s=ne("PillsInputField",ai,e),{classNames:r,className:o,style:i,styles:l,unstyled:a,vars:u,type:d,disabled:c,id:p,pointer:f,mod:h,attributes:m,...S}=s,v=_n(),w=Yo(),x=ve({name:"PillsInputField",classes:Kr,props:s,className:o,style:i,classNames:r,styles:l,unstyled:a,attributes:m,rootSelector:"field"}),g=c||v?.disabled;return n.jsx(de,{component:"input",ref:st(t,v?.fieldRef),"data-type":d,disabled:g,mod:[{disabled:g,pointer:f},h],...x("field"),...S,id:w?.inputId||p,"aria-invalid":v?.hasError,"aria-describedby":w?.describedBy,type:"text",onMouseDown:b=>!f&&b.stopPropagation()})});Mn.classes=Kr;Mn.displayName="@mantine/core/PillsInputField";const ii={size:"sm"},Vt=ae((e,t)=>{const s=ne("PillsInput",ii,e),{children:r,onMouseDown:o,onClick:i,size:l,disabled:a,__staticSelector:u,error:d,variant:c,...p}=s,f=P.useRef(null);return n.jsx(ei,{value:{fieldRef:f,size:l,disabled:a,hasError:!!d,variant:c},children:n.jsx(Xe,{size:l,error:d,variant:c,component:"div",ref:t,"data-no-overflow":!0,onMouseDown:h=>{h.preventDefault(),o?.(h),f.current?.focus()},onClick:h=>{h.preventDefault(),h.currentTarget.closest("fieldset")?.disabled||(f.current?.focus(),i?.(h))},...p,multiline:!0,disabled:a,__staticSelector:u||"PillsInput",withAria:!1,children:r})})});Vt.displayName="@mantine/core/PillsInput";Vt.Field=Mn;function li({data:e,value:t}){const s=t.map(o=>o.trim().toLowerCase());return e.reduce((o,i)=>(Rr(i)?o.push({group:i.group,items:i.items.filter(l=>s.indexOf(l.value.toLowerCase().trim())===-1)}):s.indexOf(i.value.toLowerCase().trim())===-1&&o.push(i),o),[])}const ci={maxValues:1/0,withCheckIcon:!0,checkIconPosition:"left",hiddenInputValuesDivider:",",clearSearchOnChange:!0,size:"sm"},Nn=ae((e,t)=>{const s=ne("MultiSelect",ci,e),{classNames:r,className:o,style:i,styles:l,unstyled:a,vars:u,size:d,value:c,defaultValue:p,onChange:f,onKeyDown:h,variant:m,data:S,dropdownOpened:v,defaultDropdownOpened:w,onDropdownOpen:x,onDropdownClose:g,selectFirstOptionOnChange:b,onOptionSubmit:y,comboboxProps:D,filter:M,limit:$,withScrollArea:O,maxDropdownHeight:z,searchValue:A,defaultSearchValue:Y,onSearchChange:B,readOnly:I,disabled:F,onFocus:E,onBlur:H,radius:R,rightSection:T,rightSectionWidth:j,rightSectionPointerEvents:C,rightSectionProps:_,leftSection:k,leftSectionWidth:N,leftSectionPointerEvents:W,leftSectionProps:G,inputContainer:ee,inputWrapperOrder:oe,withAsterisk:re,labelProps:q,descriptionProps:te,errorProps:X,wrapperProps:le,description:J,label:pe,error:se,maxValues:we,searchable:Z,nothingFoundMessage:me,withCheckIcon:Ye,withAlignedLabels:he,checkIconPosition:ue,hidePickedOptions:xe,withErrorStyles:Je,name:ct,form:Re,id:V,clearable:Te,clearButtonProps:_e,hiddenInputProps:mt,placeholder:ht,hiddenInputValuesDivider:ft,required:ot,mod:St,renderOption:qe,onRemove:Le,onClear:gt,scrollAreaProps:Q,chevronColor:Be,attributes:Se,clearSearchOnChange:at,...It}=s,$e=Zt(V),jt=dn(S),je=pn(jt),yt=P.useRef({}),ke=mn({opened:v,defaultOpened:w,onDropdownOpen:x,onDropdownClose:()=>{g?.(),ke.resetSelectedOption()}}),{styleProps:Pt,rest:{type:Rt,autoComplete:be,...et}}=cn(It),[U,Ce]=Ke({value:c,defaultValue:p,finalValue:[],onChange:f}),[Oe,vt]=Ke({value:A,defaultValue:Y,finalValue:"",onChange:B}),Dt=ie=>{vt(ie),ke.resetSelectedOption()},Tt=ve({name:"MultiSelect",classes:{},props:s,classNames:r,styles:l,unstyled:a,attributes:Se}),{resolvedClassNames:Yt,resolvedStyles:ns}=Qe({props:s,styles:l,classNames:r}),Ys=ie=>{h?.(ie),ie.key===" "&&!Z&&(ie.preventDefault(),ke.toggleDropdown()),ie.key==="Backspace"&&Oe.length===0&&U.length>0&&(Le?.(U[U.length-1]),Ce(U.slice(0,U.length-1)))},zs=U.map((ie,rs)=>{const Io=je[ie]||yt.current[ie];return n.jsx(Mt,{withRemoveButton:!I&&!je[ie]?.disabled,onRemove:()=>{Ce(U.filter(Ro=>ie!==Ro)),Le?.(ie)},unstyled:a,disabled:F,...Tt("pill"),children:Io?.label||ie},`${ie}-${rs}`)});P.useEffect(()=>{b&&ke.selectFirstOption()},[b,Oe]),P.useEffect(()=>{U.forEach(ie=>{ie in je&&(yt.current[ie]=je[ie])})},[je,U]);const Bs=n.jsx(Ie.ClearButton,{..._e,onClear:()=>{gt?.(),Ce([]),Dt("")}}),ce=li({data:jt,value:U}),ze=Te&&U.length>0&&!F&&!I;return n.jsxs(n.Fragment,{children:[n.jsxs(Ie,{store:ke,classNames:Yt,styles:ns,unstyled:a,size:d,readOnly:I,__staticSelector:"MultiSelect",attributes:Se,onOptionSubmit:ie=>{y?.(ie),at&&Dt(""),ke.updateSelectedOptionIndex("selected"),U.includes(je[ie].value)?(Ce(U.filter(rs=>rs!==je[ie].value)),Le?.(je[ie].value)):U.length<we&&Ce([...U,je[ie].value])},...D,children:[n.jsx(Ie.DropdownTarget,{children:n.jsx(Vt,{...Pt,__staticSelector:"MultiSelect",classNames:Yt,styles:ns,unstyled:a,size:d,className:o,style:i,variant:m,disabled:F,radius:R,__defaultRightSection:n.jsx(Ie.Chevron,{size:d,error:se,unstyled:a,color:Be}),__clearSection:Bs,__clearable:ze,rightSection:T,rightSectionPointerEvents:C||"none",rightSectionWidth:j,rightSectionProps:_,leftSection:k,leftSectionWidth:N,leftSectionPointerEvents:W,leftSectionProps:G,inputContainer:ee,inputWrapperOrder:oe,withAsterisk:re,labelProps:q,descriptionProps:te,errorProps:X,wrapperProps:le,description:J,label:pe,error:se,withErrorStyles:Je,__stylesApiProps:{...s,rightSectionPointerEvents:C||(ze?"all":"none"),multiline:!0},pointer:!Z,onClick:()=>Z?ke.openDropdown():ke.toggleDropdown(),"data-expanded":ke.dropdownOpened||void 0,id:$e,required:ot,mod:St,attributes:Se,children:n.jsxs(Mt.Group,{attributes:Se,disabled:F,unstyled:a,...Tt("pillsList"),children:[zs,n.jsx(Ie.EventsTarget,{autoComplete:be,children:n.jsx(Vt.Field,{...et,ref:t,id:$e,placeholder:ht,type:!Z&&!ht?"hidden":"visible",...Tt("inputField"),unstyled:a,onFocus:ie=>{E?.(ie),Z&&ke.openDropdown()},onBlur:ie=>{H?.(ie),ke.closeDropdown(),Dt("")},onKeyDown:Ys,value:Oe,onChange:ie=>{Dt(ie.currentTarget.value),Z&&ke.openDropdown(),b&&ke.selectFirstOption()},disabled:F,readOnly:I||!Z,pointer:!Z})})]})})}),n.jsx(hn,{data:xe?ce:jt,hidden:I||F,filter:M,search:Oe,limit:$,hiddenWhenEmpty:!me,withScrollArea:O,maxDropdownHeight:z,filterOptions:Z,value:U,checkIconPosition:ue,withCheckIcon:Ye,withAlignedLabels:he,nothingFoundMessage:me,unstyled:a,labelId:pe?`${$e}-label`:void 0,"aria-label":pe?void 0:It["aria-label"],renderOption:qe,scrollAreaProps:Q})]}),n.jsx(Ie.HiddenInput,{name:ct,valuesDivider:ft,value:U,form:Re,disabled:F,...mt})]})});Nn.classes={...Xe.classes,...Ie.classes};Nn.displayName="@mantine/core/MultiSelect";const[ui,Ss]=Qt("Pagination.Root component was not found in tree");var es={root:"m_4addd315",control:"m_326d024a",dots:"m_4ad7767d"};const di={withPadding:!0},ts=ae((e,t)=>{const s=ne("PaginationControl",di,e),{classNames:r,className:o,style:i,styles:l,vars:a,active:u,disabled:d,withPadding:c,mod:p,...f}=s,h=Ss(),m=d||h.disabled;return n.jsx(nt,{ref:t,disabled:m,mod:[{active:u,disabled:m,"with-padding":c},p],...h.getStyles("control",{className:o,style:i,classNames:r,styles:l,active:!m}),...f})});ts.classes=es;ts.displayName="@mantine/core/PaginationControl";function ss({style:e,children:t,path:s,...r}){return n.jsx("svg",{viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",style:{width:"calc(var(--pagination-control-size) / 1.8)",height:"calc(var(--pagination-control-size) / 1.8)",...e},...r,children:n.jsx("path",{d:s,fill:"currentColor"})})}const pi=e=>n.jsx(ss,{...e,path:"M8.781 8l-3.3-3.3.943-.943L10.667 8l-4.243 4.243-.943-.943 3.3-3.3z"}),mi=e=>n.jsx(ss,{...e,path:"M7.219 8l3.3 3.3-.943.943L5.333 8l4.243-4.243.943.943-3.3 3.3z"}),hi=e=>n.jsx(ss,{...e,path:"M6.85355 3.85355C7.04882 3.65829 7.04882 3.34171 6.85355 3.14645C6.65829 2.95118 6.34171 2.95118 6.14645 3.14645L2.14645 7.14645C1.95118 7.34171 1.95118 7.65829 2.14645 7.85355L6.14645 11.8536C6.34171 12.0488 6.65829 12.0488 6.85355 11.8536C7.04882 11.6583 7.04882 11.3417 6.85355 11.1464L3.20711 7.5L6.85355 3.85355ZM12.8536 3.85355C13.0488 3.65829 13.0488 3.34171 12.8536 3.14645C12.6583 2.95118 12.3417 2.95118 12.1464 3.14645L8.14645 7.14645C7.95118 7.34171 7.95118 7.65829 8.14645 7.85355L12.1464 11.8536C12.3417 12.0488 12.6583 12.0488 12.8536 11.8536C13.0488 11.6583 13.0488 11.3417 12.8536 11.1464L9.20711 7.5L12.8536 3.85355Z"}),fi=e=>n.jsx(ss,{...e,path:"M2.14645 11.1464C1.95118 11.3417 1.95118 11.6583 2.14645 11.8536C2.34171 12.0488 2.65829 12.0488 2.85355 11.8536L6.85355 7.85355C7.04882 7.65829 7.04882 7.34171 6.85355 7.14645L2.85355 3.14645C2.65829 2.95118 2.34171 2.95118 2.14645 3.14645C1.95118 3.34171 1.95118 3.65829 2.14645 3.85355L5.79289 7.5L2.14645 11.1464ZM8.14645 11.1464C7.95118 11.3417 7.95118 11.6583 8.14645 11.8536C8.34171 12.0488 8.65829 12.0488 8.85355 11.8536L12.8536 7.85355C13.0488 7.65829 13.0488 7.34171 12.8536 7.14645L8.85355 3.14645C8.65829 2.95118 8.34171 2.95118 8.14645 3.14645C7.95118 3.34171 7.95118 3.65829 8.14645 3.85355L11.7929 7.5L8.14645 11.1464Z"}),gi=e=>n.jsx(ss,{...e,path:"M2 8c0-.733.6-1.333 1.333-1.333.734 0 1.334.6 1.334 1.333s-.6 1.333-1.334 1.333C2.6 9.333 2 8.733 2 8zm9.333 0c0-.733.6-1.333 1.334-1.333C13.4 6.667 14 7.267 14 8s-.6 1.333-1.333 1.333c-.734 0-1.334-.6-1.334-1.333zM6.667 8c0-.733.6-1.333 1.333-1.333s1.333.6 1.333 1.333S8.733 9.333 8 9.333 6.667 8.733 6.667 8z"}),yi={icon:gi},js=ae((e,t)=>{const s=ne("PaginationDots",yi,e),{classNames:r,className:o,style:i,styles:l,vars:a,icon:u,...d}=s,c=Ss();return n.jsx(de,{ref:t,...c.getStyles("dots",{className:o,style:i,styles:l,classNames:r}),...d,children:n.jsx(u,{style:{width:"calc(var(--pagination-control-size) / 1.8)",height:"calc(var(--pagination-control-size) / 1.8)"}})})});js.classes=es;js.displayName="@mantine/core/PaginationDots";function Ps({icon:e,name:t,action:s,type:r}){const o={icon:e},i=P.forwardRef((l,a)=>{const{icon:u,...d}=ne(t,o,l),c=Ss(),p=r==="next"?c.active===c.total:c.active===1;return n.jsx(ts,{disabled:c.disabled||p,ref:a,onClick:c[s],withPadding:!1,...d,children:n.jsx(u,{className:"mantine-rotate-rtl",style:{width:"calc(var(--pagination-control-size) / 1.8)",height:"calc(var(--pagination-control-size) / 1.8)"}})})});return i.displayName=`@mantine/core/${t}`,zo(i)}const qr=Ps({icon:pi,name:"PaginationNext",action:"onNext",type:"next"}),Ur=Ps({icon:mi,name:"PaginationPrevious",action:"onPrevious",type:"previous"}),Zr=Ps({icon:hi,name:"PaginationFirst",action:"onFirst",type:"previous"}),Qr=Ps({icon:fi,name:"PaginationLast",action:"onLast",type:"next"});function Ln({dotsIcon:e}){const t=Ss(),s=t.range.map((r,o)=>r==="dots"?n.jsx(js,{icon:e},o):n.jsx(ts,{active:r===t.active,"aria-current":r===t.active?"page":void 0,onClick:()=>t.onChange(r),disabled:t.disabled,...t.getItemProps?.(r),children:t.getItemProps?.(r)?.children??r},o));return n.jsx(n.Fragment,{children:s})}Ln.displayName="@mantine/core/PaginationItems";const vi={siblings:1,boundaries:1},xi=Me((e,{size:t,radius:s,color:r,autoContrast:o})=>({root:{"--pagination-control-radius":s===void 0?void 0:Xt(s),"--pagination-control-size":De(t,"pagination-control-size"),"--pagination-control-fz":Nt(t),"--pagination-active-bg":r?Pr(r,e):void 0,"--pagination-active-color":Ho(o,e)?Bo({color:r,theme:e,autoContrast:o}):void 0}})),Ds=ae((e,t)=>{const s=ne("PaginationRoot",vi,e),{classNames:r,className:o,style:i,styles:l,unstyled:a,vars:u,total:d,value:c,defaultValue:p,onChange:f,disabled:h,siblings:m,boundaries:S,color:v,radius:w,onNextPage:x,onPreviousPage:g,onFirstPage:b,onLastPage:y,getItemProps:D,autoContrast:M,attributes:$,...O}=s,z=ve({name:"Pagination",classes:es,props:s,className:o,style:i,classNames:r,styles:l,unstyled:a,attributes:$,vars:u,varsResolver:xi}),{range:A,setPage:Y,next:B,previous:I,active:F,first:E,last:H}=ja({page:c,initialPage:p,onChange:f,total:d,siblings:m,boundaries:S}),R=os(x,B),T=os(g,I),j=os(b,E),C=os(y,H);return n.jsx(ui,{value:{total:d,range:A,active:F,disabled:h,getItemProps:D,onChange:Y,onNext:R,onPrevious:T,onFirst:j,onLast:C,getStyles:z},children:n.jsx(de,{ref:t,...z("root"),...O})})});Ds.classes=es;Ds.displayName="@mantine/core/PaginationRoot";const bi={withControls:!0,withPages:!0,siblings:1,boundaries:1,gap:8},rt=ae((e,t)=>{const s=ne("Pagination",bi,e),{withEdges:r,withControls:o,getControlProps:i,nextIcon:l,previousIcon:a,lastIcon:u,firstIcon:d,dotsIcon:c,total:p,gap:f,hideWithOnePage:h,withPages:m,...S}=s;return p<=0||h&&p===1?null:n.jsx(Ds,{ref:t,total:p,...S,children:n.jsxs(lt,{gap:f,children:[r&&n.jsx(Zr,{icon:d,...i?.("first")}),o&&n.jsx(Ur,{icon:a,...i?.("previous")}),m&&n.jsx(Ln,{dotsIcon:c}),o&&n.jsx(qr,{icon:l,...i?.("next")}),r&&n.jsx(Qr,{icon:u,...i?.("last")})]})})});rt.classes=es;rt.displayName="@mantine/core/Pagination";rt.Root=Ds;rt.Control=ts;rt.Dots=js;rt.First=Zr;rt.Last=Qr;rt.Next=qr;rt.Previous=Ur;rt.Items=Ln;const Ci=({reveal:e})=>n.jsx("svg",{viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{width:"var(--psi-icon-size)",height:"var(--psi-icon-size)"},children:n.jsx("path",{d:e?"M13.3536 2.35355C13.5488 2.15829 13.5488 1.84171 13.3536 1.64645C13.1583 1.45118 12.8417 1.45118 12.6464 1.64645L10.6828 3.61012C9.70652 3.21671 8.63759 3 7.5 3C4.30786 3 1.65639 4.70638 0.0760002 7.23501C-0.0253338 7.39715 -0.0253334 7.60288 0.0760014 7.76501C0.902945 9.08812 2.02314 10.1861 3.36061 10.9323L1.64645 12.6464C1.45118 12.8417 1.45118 13.1583 1.64645 13.3536C1.84171 13.5488 2.15829 13.5488 2.35355 13.3536L4.31723 11.3899C5.29348 11.7833 6.36241 12 7.5 12C10.6921 12 13.3436 10.2936 14.924 7.76501C15.0253 7.60288 15.0253 7.39715 14.924 7.23501C14.0971 5.9119 12.9769 4.81391 11.6394 4.06771L13.3536 2.35355ZM9.90428 4.38861C9.15332 4.1361 8.34759 4 7.5 4C4.80285 4 2.52952 5.37816 1.09622 7.50001C1.87284 8.6497 2.89609 9.58106 4.09974 10.1931L9.90428 4.38861ZM5.09572 10.6114L10.9003 4.80685C12.1039 5.41894 13.1272 6.35031 13.9038 7.50001C12.4705 9.62183 10.1971 11 7.5 11C6.65241 11 5.84668 10.8639 5.09572 10.6114Z":"M7.5 11C4.80285 11 2.52952 9.62184 1.09622 7.50001C2.52952 5.37816 4.80285 4 7.5 4C10.1971 4 12.4705 5.37816 13.9038 7.50001C12.4705 9.62183 10.1971 11 7.5 11ZM7.5 3C4.30786 3 1.65639 4.70638 0.0760002 7.23501C-0.0253338 7.39715 -0.0253334 7.60288 0.0760014 7.76501C1.65639 10.2936 4.30786 12 7.5 12C10.6921 12 13.3436 10.2936 14.924 7.76501C15.0253 7.60288 15.0253 7.39715 14.924 7.23501C13.3436 4.70638 10.6921 3 7.5 3ZM7.5 9.5C8.60457 9.5 9.5 8.60457 9.5 7.5C9.5 6.39543 8.60457 5.5 7.5 5.5C6.39543 5.5 5.5 6.39543 5.5 7.5C5.5 8.60457 6.39543 9.5 7.5 9.5Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})});var sn={root:"m_f61ca620",input:"m_ccf8da4c",innerInput:"m_f2d85dd2",visibilityToggle:"m_b1072d44"};const wi={visibilityToggleIcon:Ci},Si=Me((e,{size:t})=>({root:{"--psi-icon-size":De(t,"psi-icon-size"),"--psi-button-size":De(t,"psi-button-size")}})),In=ae((e,t)=>{const s=ne("PasswordInput",wi,e),{classNames:r,className:o,style:i,styles:l,unstyled:a,vars:u,required:d,error:c,leftSection:p,disabled:f,id:h,variant:m,inputContainer:S,description:v,label:w,size:x,errorProps:g,descriptionProps:b,labelProps:y,withAsterisk:D,inputWrapperOrder:M,wrapperProps:$,radius:O,rightSection:z,rightSectionWidth:A,rightSectionPointerEvents:Y,leftSectionWidth:B,visible:I,defaultVisible:F,onVisibilityChange:E,visibilityToggleIcon:H,visibilityToggleButtonProps:R,rightSectionProps:T,leftSectionProps:j,leftSectionPointerEvents:C,withErrorStyles:_,mod:k,attributes:N,...W}=s,G=Zt(h),[ee,oe]=Ke({value:I,defaultValue:F,finalValue:!1,onChange:E}),re=()=>oe(!ee),q=ve({name:"PasswordInput",classes:sn,props:s,className:o,style:i,classNames:r,styles:l,unstyled:a,attributes:N,vars:u,varsResolver:Si}),{resolvedClassNames:te,resolvedStyles:X}=Qe({classNames:r,styles:l,props:s}),{styleProps:le,rest:J}=cn(W),pe=g?.id||`${G}-error`,se=b?.id||`${G}-description`,me=`${!!c&&typeof c!="boolean"?pe:""} ${!!v?se:""}`,Ye=me.trim().length>0?me.trim():void 0,he=n.jsx(At,{...q("visibilityToggle"),disabled:f,radius:O,"aria-hidden":!R,"aria-pressed":ee,tabIndex:-1,...R,variant:R?.variant??"subtle",color:"gray",unstyled:a,onTouchEnd:ue=>{ue.preventDefault(),R?.onTouchEnd?.(ue),re()},onMouseDown:ue=>{ue.preventDefault(),R?.onMouseDown?.(ue),re()},onKeyDown:ue=>{R?.onKeyDown?.(ue),ue.key===" "&&(ue.preventDefault(),re())},children:n.jsx(H,{reveal:ee})});return n.jsx(Fe.Wrapper,{required:d,id:G,label:w,error:c,description:v,size:x,classNames:te,styles:X,__staticSelector:"PasswordInput",unstyled:a,withAsterisk:D,inputWrapperOrder:M,inputContainer:S,variant:m,labelProps:{...y,htmlFor:G},descriptionProps:{...b,id:se},errorProps:{...g,id:pe},mod:k,attributes:N,...q("root"),...le,...$,children:n.jsx(Fe,{component:"div",error:c,leftSection:p,size:x,classNames:{...te,input:ys(sn.input,te.input)},styles:X,radius:O,disabled:f,__staticSelector:"PasswordInput",rightSectionWidth:A,rightSection:z??he,variant:m,unstyled:a,leftSectionWidth:B,rightSectionPointerEvents:Y||"all",rightSectionProps:T,leftSectionProps:j,leftSectionPointerEvents:C,withAria:!1,withErrorStyles:_,attributes:N,children:n.jsx("input",{required:d,"data-invalid":!!c||void 0,"data-with-left-section":!!p||void 0,...q("innerInput"),disabled:f,id:G,ref:t,...J,"aria-describedby":Ye,autoComplete:J.autoComplete||"off",type:ee?"text":"password"})})})});In.classes={...Xe.classes,...sn};In.displayName="@mantine/core/PasswordInput";const[ji,_s]=Qt("SliderProvider was not found in tree"),Xr=P.forwardRef(({size:e,disabled:t,variant:s,color:r,thumbSize:o,radius:i,...l},a)=>{const{getStyles:u}=_s();return n.jsx(de,{tabIndex:-1,variant:s,size:e,ref:a,...u("root"),...l})});Xr.displayName="@mantine/core/SliderRoot";const Jr=P.forwardRef(({max:e,min:t,value:s,position:r,label:o,dragging:i,onMouseDown:l,onKeyDownCapture:a,labelTransitionProps:u,labelAlwaysOn:d,thumbLabel:c,onFocus:p,onBlur:f,showLabelOnHover:h,isHovered:m,children:S=null,disabled:v},w)=>{const{getStyles:x}=_s(),[g,b]=P.useState(!1),y=d||i||g||h&&m;return n.jsxs(de,{tabIndex:0,role:"slider","aria-label":c,"aria-valuemax":e,"aria-valuemin":t,"aria-valuenow":s,ref:w,__vars:{"--slider-thumb-offset":`${r}%`},...x("thumb",{focusable:!0}),mod:{dragging:i,disabled:v},onFocus:D=>{b(!0),typeof p=="function"&&p(D)},onBlur:D=>{b(!1),typeof f=="function"&&f(D)},onTouchStart:l,onMouseDown:l,onKeyDownCapture:a,onClick:D=>D.stopPropagation(),children:[S,n.jsx(Wo,{mounted:o!=null&&!!y,transition:"fade",duration:0,...u,children:D=>n.jsx("div",{...x("label",{style:D}),children:o})})]})});Jr.displayName="@mantine/core/SliderThumb";function eo({value:e,min:t,max:s}){const r=(e-t)/(s-t)*100;return Math.min(Math.max(r,0),100)}function Pi({mark:e,offset:t,value:s,inverted:r=!1}){return r?typeof t=="number"&&e.value<=t||e.value>=s:typeof t=="number"?e.value>=t&&e.value<=s:e.value<=s}function to({marks:e,min:t,max:s,disabled:r,value:o,offset:i,inverted:l}){const{getStyles:a}=_s();if(!e)return null;const u=e.map((d,c)=>P.createElement(de,{...a("markWrapper"),__vars:{"--mark-offset":`${eo({value:d.value,min:t,max:s})}%`},key:c},n.jsx(de,{...a("mark"),mod:{filled:Pi({mark:d,value:o,offset:i,inverted:l}),disabled:r}}),d.label&&n.jsx("div",{...a("markLabel"),children:d.label})));return n.jsx("div",{children:u})}to.displayName="@mantine/core/SliderMarks";function so({filled:e,children:t,offset:s,disabled:r,marksOffset:o,inverted:i,containerProps:l,...a}){const{getStyles:u}=_s();return n.jsx(de,{...u("trackContainer"),mod:{disabled:r},...l,children:n.jsxs(de,{...u("track"),mod:{inverted:i,disabled:r},children:[n.jsx(de,{mod:{inverted:i,disabled:r},__vars:{"--slider-bar-width":`calc(${e}% + 2 * var(--slider-size))`,"--slider-bar-offset":`calc(${s}% - var(--slider-size))`},...u("bar")}),t,n.jsx(to,{...a,offset:o,disabled:r,inverted:i})]})})}so.displayName="@mantine/core/SliderTrack";function Di({value:e,containerWidth:t,min:s,max:r,step:o,precision:i}){const a=(t?Math.min(Math.max(e,0),t)/t:e)*(r-s),u=(a!==0?Math.round(a/o)*o:0)+s,d=Math.max(u,s);return i!==void 0?Number(d.toFixed(i)):d}function is(e,t){return parseFloat(e.toFixed(t))}function _i(e){if(!e)return 0;const t=e.toString().split(".");return t.length>1?t[1].length:0}function Ws(e,t){const r=[...t].sort((o,i)=>o.value-i.value).find(o=>o.value>e);return r?r.value:e}function Gs(e,t){const r=[...t].sort((o,i)=>i.value-o.value).find(o=>o.value<e);return r?r.value:e}function cr(e){const t=[...e].sort((s,r)=>s.value-r.value);return t.length>0?t[0].value:0}function ur(e){const t=[...e].sort((s,r)=>s.value-r.value);return t.length>0?t[t.length-1].value:100}var no={root:"m_dd36362e",label:"m_c9357328",thumb:"m_c9a9a60a",trackContainer:"m_a8645c2",track:"m_c9ade57f",bar:"m_38aeed47",markWrapper:"m_b7b0423a",mark:"m_dd33bc19",markLabel:"m_68c77a5b"};const ki={radius:"xl",min:0,max:100,step:1,marks:[],label:e=>e,labelTransitionProps:{transition:"fade",duration:0},thumbLabel:"",showLabelOnHover:!0,scale:e=>e,size:"md"},Mi=Me((e,{size:t,color:s,thumbSize:r,radius:o})=>({root:{"--slider-size":De(t,"slider-size"),"--slider-color":s?Pr(s,e):void 0,"--slider-radius":o===void 0?void 0:Xt(o),"--slider-thumb-size":r!==void 0?He(r):"calc(var(--slider-size) * 2)"}})),Rn=ae((e,t)=>{const s=ne("Slider",ki,e),{classNames:r,styles:o,value:i,onChange:l,onChangeEnd:a,size:u,min:d,max:c,domain:p,step:f,precision:h,defaultValue:m,name:S,marks:v,label:w,labelTransitionProps:x,labelAlwaysOn:g,thumbLabel:b,showLabelOnHover:y,thumbChildren:D,disabled:M,unstyled:$,scale:O,inverted:z,className:A,style:Y,vars:B,hiddenInputProps:I,restrictToMarks:F,thumbProps:E,attributes:H,...R}=s,T=ve({name:"Slider",props:s,classes:no,classNames:r,className:A,styles:o,style:Y,attributes:H,vars:B,varsResolver:Mi,unstyled:$}),{dir:j}=Go(),[C,_]=P.useState(!1),[k,N]=Ke({value:typeof i=="number"?Ue(i,d,c):i,defaultValue:typeof m=="number"?Ue(m,d,c):m,finalValue:Ue(0,d,c),onChange:l}),W=P.useRef(k),G=P.useRef(a);P.useEffect(()=>{G.current=a},[a]);const ee=P.useRef(null),oe=P.useRef(null),[re,q]=p||[d,c],te=eo({value:k,min:re,max:q}),X=O(k),le=typeof w=="function"?w(X):w,J=h??_i(f),pe=P.useCallback(({x:he})=>{if(!M){const ue=Di({value:he,min:re,max:q,step:f,precision:J}),xe=Ue(ue,d,c);N(F&&v?.length?Zn(xe,v.map(Je=>Je.value)):xe),W.current=xe}},[M,d,c,re,q,f,J,N,v,F]),se=P.useCallback(()=>{if(!M&&G.current){const he=F&&v?.length?Zn(W.current,v.map(ue=>ue.value)):W.current;G.current(he)}},[M,v,F]),{ref:we,active:Z}=fn(pe,{onScrubEnd:se},j),me=P.useCallback(he=>{!M&&G.current&&G.current(he)},[M]),Ye=he=>{if(!M)switch(he.key){case"ArrowUp":{if(he.preventDefault(),oe.current?.focus(),F&&v){const xe=Ws(k,v);N(xe),me(xe);break}const ue=is(Math.min(Math.max(k+f,d),c),J);N(ue),me(ue);break}case"ArrowRight":{if(he.preventDefault(),oe.current?.focus(),F&&v){const xe=j==="rtl"?Gs(k,v):Ws(k,v);N(xe),me(xe);break}const ue=is(Math.min(Math.max(j==="rtl"?k-f:k+f,d),c),J);N(ue),me(ue);break}case"ArrowDown":{if(he.preventDefault(),oe.current?.focus(),F&&v){const xe=Gs(k,v);N(xe),me(xe);break}const ue=is(Math.min(Math.max(k-f,d),c),J);N(ue),me(ue);break}case"ArrowLeft":{if(he.preventDefault(),oe.current?.focus(),F&&v){const xe=j==="rtl"?Ws(k,v):Gs(k,v);N(xe),me(xe);break}const ue=is(Math.min(Math.max(j==="rtl"?k+f:k-f,d),c),J);N(ue),me(ue);break}case"Home":{if(he.preventDefault(),oe.current?.focus(),F&&v){N(cr(v)),me(cr(v));break}N(d),me(d);break}case"End":{if(he.preventDefault(),oe.current?.focus(),F&&v){N(ur(v)),me(ur(v));break}N(c),me(c);break}}};return n.jsx(ji,{value:{getStyles:T},children:n.jsxs(Xr,{...R,ref:st(t,ee),onKeyDownCapture:Ye,onMouseDownCapture:()=>ee.current?.focus(),size:u,disabled:M,children:[n.jsx(so,{inverted:z,offset:0,filled:te,marks:v,min:re,max:q,value:X,disabled:M,containerProps:{ref:we,onMouseEnter:y?()=>_(!0):void 0,onMouseLeave:y?()=>_(!1):void 0},children:n.jsx(Jr,{max:q,min:re,value:X,position:te,dragging:Z,label:le,ref:oe,labelTransitionProps:x,labelAlwaysOn:g,thumbLabel:b,showLabelOnHover:y,isHovered:C,disabled:M,...E,children:D})}),n.jsx("input",{type:"hidden",name:S,value:X,...I})]})})});Rn.classes=no;Rn.displayName="@mantine/core/Slider";function Ni({data:e,value:t}){const s=t.map(o=>o.trim().toLowerCase());return e.reduce((o,i)=>(Rr(i)?o.push({group:i.group,items:i.items.filter(l=>s.indexOf(l.label.toLowerCase().trim())===-1)}):s.indexOf(i.label.toLowerCase().trim())===-1&&o.push(i),o),[])}function Li(e,t){return e?t.split(new RegExp(`[${e.join("")}]`)).map(s=>s.trim()).filter(s=>s!==""):[t]}function dr({splitChars:e,allowDuplicates:t,maxTags:s,value:r,currentTags:o}){const i=Li(e,r),l=t?[...o,...i]:[...new Set([...o,...i])];return s?l.slice(0,s):l}const Ii={maxTags:1/0,acceptValueOnBlur:!0,splitChars:[","],hiddenInputValuesDivider:",",size:"sm"},Tn=ae((e,t)=>{const s=ne("TagsInput",Ii,e),{classNames:r,className:o,style:i,styles:l,unstyled:a,vars:u,size:d,value:c,defaultValue:p,onChange:f,onKeyDown:h,maxTags:m,allowDuplicates:S,onDuplicate:v,variant:w,data:x,dropdownOpened:g,defaultDropdownOpened:b,onDropdownOpen:y,onDropdownClose:D,selectFirstOptionOnChange:M,onOptionSubmit:$,comboboxProps:O,filter:z,limit:A,withScrollArea:Y,maxDropdownHeight:B,searchValue:I,defaultSearchValue:F,onSearchChange:E,readOnly:H,disabled:R,splitChars:T,onFocus:j,onBlur:C,onPaste:_,radius:k,rightSection:N,rightSectionWidth:W,rightSectionPointerEvents:G,rightSectionProps:ee,leftSection:oe,leftSectionWidth:re,leftSectionPointerEvents:q,leftSectionProps:te,inputContainer:X,inputWrapperOrder:le,withAsterisk:J,required:pe,labelProps:se,descriptionProps:we,errorProps:Z,wrapperProps:me,description:Ye,label:he,error:ue,withErrorStyles:xe,name:Je,form:ct,id:Re,clearable:V,clearButtonProps:Te,hiddenInputProps:_e,hiddenInputValuesDivider:mt,mod:ht,renderOption:ft,onRemove:ot,onClear:St,scrollAreaProps:qe,acceptValueOnBlur:Le,isDuplicate:gt,attributes:Q,...Be}=s,Se=Zt(Re),at=dn(x),It=pn(at),$e=P.useRef(null),jt=st($e,t),je=mn({opened:g,defaultOpened:b,onDropdownOpen:y,onDropdownClose:()=>{D?.(),je.resetSelectedOption()}}),{styleProps:yt,rest:{type:ke,autoComplete:Pt,...Rt}}=cn(Be),[be,et]=Ke({value:c,defaultValue:p,finalValue:[],onChange:f}),[U,Ce]=Ke({value:I,defaultValue:F,finalValue:"",onChange:E}),Oe=ce=>{Ce(ce),je.resetSelectedOption()},vt=ve({name:"TagsInput",classes:{},props:s,classNames:r,styles:l,unstyled:a}),{resolvedClassNames:Dt,resolvedStyles:Tt}=Qe({props:s,styles:l,classNames:r}),Yt=ce=>{const ze=gt?gt(ce,be):be.some(ie=>ie.toLowerCase()===ce.toLowerCase());ze&&v?.(ce),(!ze||ze&&S)&&be.length<m&&($?.(ce),Oe(""),ce.length>0&&et([...be,ce]))},ns=ce=>{if(h?.(ce),ce.isPropagationStopped())return;const ze=U.trim(),{length:ie}=ze;if(T.includes(ce.key)&&ie>0&&(et(dr({splitChars:T,allowDuplicates:S,maxTags:m,value:U,currentTags:be})),Oe(""),ce.preventDefault()),ce.key==="Enter"&&ie>0&&!ce.nativeEvent.isComposing){if(ce.preventDefault(),!!document.querySelector(`#${je.listId} [data-combobox-option][data-combobox-selected]`))return;Yt(ze)}ce.key==="Backspace"&&ie===0&&be.length>0&&!ce.nativeEvent.isComposing&&!H&&(ot?.(be[be.length-1]),et(be.slice(0,be.length-1)))},Ys=ce=>{if(_?.(ce),ce.preventDefault(),ce.clipboardData){const ze=ce.clipboardData.getData("text/plain");et(dr({splitChars:T,allowDuplicates:S,maxTags:m,value:`${U}${ze}`,currentTags:be})),Oe("")}},zs=be.map((ce,ze)=>n.jsx(Mt,{withRemoveButton:!H,onRemove:()=>{const ie=be.slice();ie.splice(ze,1),et(ie),ot?.(ce)},unstyled:a,disabled:R,attributes:Q,...vt("pill"),children:ce},`${ce}-${ze}`));P.useEffect(()=>{M&&je.selectFirstOption()},[M,be,U]);const Bs=n.jsx(Ie.ClearButton,{...Te,onClear:()=>{et([]),Oe(""),$e.current?.focus(),je.openDropdown(),St?.()}});return n.jsxs(n.Fragment,{children:[n.jsxs(Ie,{store:je,classNames:Dt,styles:Tt,unstyled:a,size:d,readOnly:H,__staticSelector:"TagsInput",attributes:Q,onOptionSubmit:ce=>{$?.(ce),Oe(""),be.length<m&&et([...be,It[ce].label]),je.resetSelectedOption()},...O,children:[n.jsx(Ie.DropdownTarget,{children:n.jsx(Vt,{...yt,__staticSelector:"TagsInput",classNames:Dt,styles:Tt,unstyled:a,size:d,className:o,style:i,variant:w,disabled:R,radius:k,rightSection:N,__clearSection:Bs,__clearable:V&&be.length>0&&!R&&!H,rightSectionWidth:W,rightSectionPointerEvents:G,rightSectionProps:ee,leftSection:oe,leftSectionWidth:re,leftSectionPointerEvents:q,leftSectionProps:te,inputContainer:X,inputWrapperOrder:le,withAsterisk:J,required:pe,labelProps:se,descriptionProps:we,errorProps:Z,wrapperProps:me,description:Ye,label:he,error:ue,withErrorStyles:xe,__stylesApiProps:{...s,multiline:!0},id:Se,mod:ht,attributes:Q,children:n.jsxs(Mt.Group,{disabled:R,unstyled:a,...vt("pillsList"),children:[zs,n.jsx(Ie.EventsTarget,{autoComplete:Pt,children:n.jsx(Vt.Field,{...Rt,ref:jt,...vt("inputField"),unstyled:a,onKeyDown:ns,onFocus:ce=>{j?.(ce),je.openDropdown()},onBlur:ce=>{C?.(ce),Le&&Yt(U),je.closeDropdown()},onPaste:Ys,value:U,onChange:ce=>Oe(ce.currentTarget.value),required:pe&&be.length===0,disabled:R,readOnly:H,id:Se})})]})})}),n.jsx(hn,{data:Ni({data:at,value:be}),hidden:H||R,filter:z,search:U,limit:A,hiddenWhenEmpty:!0,withScrollArea:Y,maxDropdownHeight:B,unstyled:a,labelId:he?`${Se}-label`:void 0,"aria-label":he?void 0:Be["aria-label"],renderOption:ft,scrollAreaProps:qe})]}),n.jsx(Ie.HiddenInput,{name:Je,form:ct,value:be,valuesDivider:mt,disabled:R,..._e})]})});Tn.classes={...Xe.classes,...Ie.classes};Tn.displayName="@mantine/core/TagsInput";const Ri=[["path",{d:"M3 9l4 -4l4 4m-4 -4v14",key:"svg-0"}],["path",{d:"M21 15l-4 4l-4 -4m4 4v-14",key:"svg-1"}]],Ti=Ne("outline","arrows-sort","ArrowsSort",Ri);const $i=[["path",{d:"M12 12m-4 0a4 4 0 1 0 8 0a4 4 0 1 0 -8 0",key:"svg-0"}],["path",{d:"M16 12v1.5a2.5 2.5 0 0 0 5 0v-1.5a9 9 0 1 0 -5.5 8.28",key:"svg-1"}]],Oi=Ne("outline","at","At",$i);const Ai=[["path",{d:"M4 7a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12z",key:"svg-0"}],["path",{d:"M16 3v4",key:"svg-1"}],["path",{d:"M8 3v4",key:"svg-2"}],["path",{d:"M4 11h16",key:"svg-3"}],["path",{d:"M11 15h1",key:"svg-4"}],["path",{d:"M12 15v3",key:"svg-5"}]],Ks=Ne("outline","calendar","Calendar",Ai);const Vi=[["path",{d:"M11 7l6 6",key:"svg-0"}],["path",{d:"M4 16l11.7 -11.7a1 1 0 0 1 1.4 0l2.6 2.6a1 1 0 0 1 0 1.4l-11.7 11.7h-4v-4z",key:"svg-1"}]],Fi=Ne("outline","color-picker","ColorPicker",Vi);const Ei=[["path",{d:"M4 6l5.5 0",key:"svg-0"}],["path",{d:"M4 10l5.5 0",key:"svg-1"}],["path",{d:"M4 14l5.5 0",key:"svg-2"}],["path",{d:"M4 18l5.5 0",key:"svg-3"}],["path",{d:"M14.5 6l5.5 0",key:"svg-4"}],["path",{d:"M14.5 10l5.5 0",key:"svg-5"}],["path",{d:"M14.5 14l5.5 0",key:"svg-6"}],["path",{d:"M14.5 18l5.5 0",key:"svg-7"}]],Yi=Ne("outline","columns","Columns",Ei);const zi=[["path",{d:"M14 3v4a1 1 0 0 0 1 1h4",key:"svg-0"}],["path",{d:"M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z",key:"svg-1"}]],Bi=Ne("outline","file","File",zi);const Hi=[["path",{d:"M4 4h16v2.172a2 2 0 0 1 -.586 1.414l-4.414 4.414v7l-6 2v-8.5l-4.48 -4.928a2 2 0 0 1 -.52 -1.345v-2.227z",key:"svg-0"}]],ro=Ne("outline","filter","Filter",Hi);const Wi=[["path",{d:"M9 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-0"}],["path",{d:"M9 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-1"}],["path",{d:"M9 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-2"}],["path",{d:"M15 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-3"}],["path",{d:"M15 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-4"}],["path",{d:"M15 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-5"}]],Gi=Ne("outline","grip-vertical","GripVertical",Wi);const Ki=[["path",{d:"M5 9l14 0",key:"svg-0"}],["path",{d:"M5 15l14 0",key:"svg-1"}],["path",{d:"M11 4l-4 16",key:"svg-2"}],["path",{d:"M17 4l-4 16",key:"svg-3"}]],qi=Ne("outline","hash","Hash",Ki);const Ui=[["path",{d:"M10.363 3.591l-8.106 13.534a1.914 1.914 0 0 0 1.636 2.871h16.214a1.914 1.914 0 0 0 1.636 -2.87l-8.106 -13.536a1.914 1.914 0 0 0 -3.274 0z",key:"svg-0"}],["path",{d:"M12 9h.01",key:"svg-1"}],["path",{d:"M11 12h1v4h1",key:"svg-2"}]],Zi=Ne("outline","info-triangle","InfoTriangle",Ui);const Qi=[["path",{d:"M17.5 15.5m-3.5 0a3.5 3.5 0 1 0 7 0a3.5 3.5 0 1 0 -7 0",key:"svg-0"}],["path",{d:"M3 19v-10.5a3.5 3.5 0 0 1 7 0v10.5",key:"svg-1"}],["path",{d:"M3 13h7",key:"svg-2"}],["path",{d:"M21 12v7",key:"svg-3"}]],Xi=Ne("outline","letter-case","LetterCase",Qi);const Ji=[["path",{d:"M9 15l6 -6",key:"svg-0"}],["path",{d:"M11 6l.463 -.536a5 5 0 0 1 7.071 7.072l-.534 .464",key:"svg-1"}],["path",{d:"M13 18l-.397 .534a5.068 5.068 0 0 1 -7.127 0a4.972 4.972 0 0 1 0 -7.071l.524 -.463",key:"svg-2"}]],pr=Ne("outline","link","Link",Ji);const el=[["path",{d:"M9 6l11 0",key:"svg-0"}],["path",{d:"M9 12l11 0",key:"svg-1"}],["path",{d:"M9 18l11 0",key:"svg-2"}],["path",{d:"M5 6l0 .01",key:"svg-3"}],["path",{d:"M5 12l0 .01",key:"svg-4"}],["path",{d:"M5 18l0 .01",key:"svg-5"}]],tl=Ne("outline","list","List",el);const sl=[["path",{d:"M3 7a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-10z",key:"svg-0"}],["path",{d:"M3 7l9 6l9 -6",key:"svg-1"}]],mr=Ne("outline","mail","Mail",sl);const nl=[["path",{d:"M12 21a9 9 0 0 1 0 -18c4.97 0 9 3.582 9 8c0 1.06 -.474 2.078 -1.318 2.828c-.844 .75 -1.989 1.172 -3.182 1.172h-2.5a2 2 0 0 0 -1 3.75a1.3 1.3 0 0 1 -1 2.25",key:"svg-0"}],["path",{d:"M8.5 10.5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-1"}],["path",{d:"M12.5 7.5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-2"}],["path",{d:"M16.5 10.5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-3"}]],rl=Ne("outline","palette","Palette",nl);const ol=[["path",{d:"M5 4h4l2 5l-2.5 1.5a11 11 0 0 0 5 5l1.5 -2.5l5 2v4a2 2 0 0 1 -2 2a16 16 0 0 1 -15 -15a2 2 0 0 1 2 -2",key:"svg-0"}]],hr=Ne("outline","phone","Phone",ol);const al=[["path",{d:"M8 9l4 -4l4 4",key:"svg-0"}],["path",{d:"M16 15l-4 4l-4 -4",key:"svg-1"}]],il=Ne("outline","selector","Selector",al);const ll=[["path",{d:"M8 12m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-0"}],["path",{d:"M2 6m0 6a6 6 0 0 1 6 -6h8a6 6 0 0 1 6 6v0a6 6 0 0 1 -6 6h-8a6 6 0 0 1 -6 -6z",key:"svg-1"}]],cl=Ne("outline","toggle-left","ToggleLeft",ll),ul=e=>{const{type:t,format:s,name:r,isEnum:o,isArray:i,size:l="sm"}=e,a=Ge.sizes.icon[l];if(s)switch(s){case"email":return n.jsx(mr,{size:a});case"url":case"uri":return n.jsx(pr,{size:a});case"tel":case"phone":return n.jsx(hr,{size:a});case"date":return n.jsx(Ks,{size:a});case"date-time":return n.jsx(Ks,{size:a});case"time":return n.jsx(qn,{size:a});case"color":return n.jsx(Fi,{size:a});case"uuid":return n.jsx(Kn,{size:a})}if(r){const u=r.toLowerCase();if(u.includes("password")||u.includes("secret"))return n.jsx(Kn,{size:a});if(u.includes("email")||u.includes("mail"))return n.jsx(mr,{size:a});if(u.includes("url")||u.includes("link"))return n.jsx(pr,{size:a});if(u.includes("phone")||u.includes("tel"))return n.jsx(hr,{size:a});if(u.includes("color"))return n.jsx(rl,{size:a});if(u.includes("file")||u.includes("upload"))return n.jsx(Bi,{size:a});if(u.includes("date"))return n.jsx(Ks,{size:a});if(u.includes("time"))return n.jsx(qn,{size:a})}if(o||i)return n.jsx(il,{size:a});if(t)switch(t){case"boolean":return n.jsx(cl,{size:a});case"number":case"integer":return n.jsx(qi,{size:a});case"array":return n.jsx(tl,{size:a});case"string":return n.jsx(Xi,{size:a})}return n.jsx(Oi,{size:a})},dl=e=>e.charAt(0).toUpperCase()+e.slice(1),pl=e=>dl(e.replaceAll("/","")),Ft=(e,t)=>{const r=e.input.props.id,o=e.title??("title"in e.input.schema&&typeof e.input.schema.title=="string"?e.input.schema.title:void 0)??pl(e.input.path),i=e.description??("description"in e.input.schema&&typeof e.input.schema.description=="string"?e.input.schema.description:void 0),l=t.error&&t.error instanceof Ko?t.error.value.message:void 0,a=e.icon?P.isValidElement(e.icon)?e.icon:P.createElement(e.icon,{size:Ge.sizes.icon.md}):ul({type:e.input.schema&&"type"in e.input.schema?String(e.input.schema.type):void 0,format:e.input.schema&&"format"in e.input.schema&&typeof e.input.schema.format=="string"?e.input.schema.format:void 0,name:e.input.props.name,isEnum:e.input.schema&&"enum"in e.input.schema&&!!e.input.schema.enum,isArray:e.input.schema&&"type"in e.input.schema&&e.input.schema.type==="array"}),u=e.input.schema&&"format"in e.input.schema&&typeof e.input.schema.format=="string"?e.input.schema.format:void 0,d=e.input.required,c=e.input.schema,p={label:o,description:i,error:l,required:d,disabled:!1};return"minLength"in c&&typeof c.minLength=="number"&&(p.minLength=c.minLength),"maxLength"in c&&typeof c.maxLength=="number"&&(p.maxLength=c.maxLength),"minimum"in c&&typeof c.minimum=="number"&&(p.minimum=c.minimum),"maximum"in c&&typeof c.maximum=="number"&&(p.maximum=c.maximum),{id:r,icon:a,format:u,schema:e.input.schema,inputProps:p}},ml=e=>{const{inputProps:t}=Ft(e,{}),s=P.useRef(0),[r,o]=P.useState(()=>{const g=e.input?.props?.defaultValue;return Array.isArray(g)?g.map(b=>({key:s.current++,value:b})):[]});if(un({"form:reset":g=>{if(g.id===e.input?.form?.id){const b=e.input?.props?.defaultValue;Array.isArray(b)?(s.current=0,o(b.map(y=>({key:s.current++,value:y})))):o([])}}},[e.input]),!e.input?.props)return null;const i=e.input.schema;if(!i||!("items"in i))return null;const l=i.items,a=l&&"properties"in l,{min:u=0,max:d=Number.POSITIVE_INFINITY,columns:c=1}=e,p=g=>{e.input.set(g.map(b=>b.value))},f=()=>{if(r.length>=d)return;let g;if(a){g={};const y=l;for(const[D,M]of Object.entries(y.properties))"default"in M&&(g[D]=M.default)}else g="";const b=[...r,{key:s.current++,value:g}];o(b),p(b)},h=g=>{if(r.length<=u)return;const b=r.filter((y,D)=>D!==g);o(b),p(b)},m=(g,b)=>{const y=[...r];y[g]={...y[g],value:b},o(y),p(y)},S=(g,b,y)=>{const D=[...r];D[g]={...D[g],value:{...D[g].value,[b]:y}},o(D),p(D)},v=12/c,w=a?Object.keys(l.properties):[],x=()=>n.jsxs(We,{gap:"sm",children:[r.map((g,b)=>n.jsxs(fe,{gap:"sm",align:"flex-start",p:"xs",bg:Ge.colors.surface,style:{borderRadius:"var(--mantine-radius-sm)"},children:[e.sortable&&n.jsx(At,{variant:"subtle",color:"gray",style:{cursor:"grab"},children:n.jsx(Gi,{size:16})}),a?n.jsx(dt,{style:{flex:1},gutter:"sm",children:w.map(y=>{const D=l.properties[y],M=e.controlProps?.[y]??{},$={schema:D,props:{id:`${e.input.props.id}-${g.key}-${y}`,name:`${e.input.props.name}[${b}].${y}`,defaultValue:g.value?.[y]},path:`${e.input.path}/${b}/${y}`,required:l.required?.includes(y)??!1,form:e.input.form,set:O=>S(b,y,O)};return n.jsx(dt.Col,{span:v,children:n.jsx(gs,{input:$,...M})},y)})}):n.jsx(fe,{style:{flex:1},children:n.jsx(gs,{input:{schema:l,props:{id:`${e.input.props.id}-${g.key}`,name:`${e.input.props.name}[${b}]`,defaultValue:g.value},path:`${e.input.path}/${b}`,required:!1,form:e.input.form,set:y=>m(b,y)},...e.itemControlProps})}),n.jsx(At,{variant:"subtle",color:"red",onClick:()=>h(b),disabled:r.length<=u,children:n.jsx(pa,{size:16})})]},g.key)),n.jsxs(nt,{onClick:f,disabled:r.length>=d,style:{display:"flex",alignItems:"center",justifyContent:"center",gap:6,padding:"8px 12px",borderRadius:"var(--mantine-radius-sm)",border:"1px dashed var(--mantine-color-dimmed)",color:"var(--mantine-color-dimmed)",fontSize:"var(--mantine-font-size-sm)",cursor:r.length>=d?"not-allowed":"pointer",opacity:r.length>=d?.5:1,transition:"all 150ms ease"},onMouseEnter:g=>{r.length<d&&(g.currentTarget.style.borderColor="var(--mantine-color-blue-filled)",g.currentTarget.style.color="var(--mantine-color-blue-filled)",g.currentTarget.style.background="var(--mantine-color-blue-light)")},onMouseLeave:g=>{g.currentTarget.style.borderColor="var(--mantine-color-dimmed)",g.currentTarget.style.color="var(--mantine-color-dimmed)",g.currentTarget.style.background="transparent"},children:[n.jsx(ma,{size:14}),e.addLabel??"Add"]})]});return e.variant==="plain"?n.jsxs(We,{gap:"xs",children:[t.label&&n.jsx(ye,{size:"sm",fw:500,children:t.label}),t.description&&n.jsx(ye,{size:"sm",c:"dimmed",children:t.description}),x(),t.error&&n.jsx(ye,{size:"sm",c:"red",children:t.error})]}):n.jsx(Cs,{legend:t.label,children:n.jsxs(We,{gap:"xs",children:[t.description&&n.jsx(ye,{size:"sm",c:"dimmed",children:t.description}),x(),t.error&&n.jsx(ye,{size:"sm",c:"red",children:t.error})]})})};function hl({direction:e,levelIndex:t,rowIndex:s,cellIndex:r,size:o}){switch(e){case"up":return t===0&&s===0?null:s===0?{levelIndex:t-1,rowIndex:r<=o[t-1][o[t-1].length-1]-1?o[t-1].length-1:o[t-1].length-2,cellIndex:r}:{levelIndex:t,rowIndex:s-1,cellIndex:r};case"down":return s===o[t].length-1?{levelIndex:t+1,rowIndex:0,cellIndex:r}:s===o[t].length-2&&r>=o[t][o[t].length-1]?{levelIndex:t+1,rowIndex:0,cellIndex:r}:{levelIndex:t,rowIndex:s+1,cellIndex:r};case"left":return t===0&&s===0&&r===0?null:s===0&&r===0?{levelIndex:t-1,rowIndex:o[t-1].length-1,cellIndex:o[t-1][o[t-1].length-1]-1}:r===0?{levelIndex:t,rowIndex:s-1,cellIndex:o[t][s-1]-1}:{levelIndex:t,rowIndex:s,cellIndex:r-1};case"right":return s===o[t].length-1&&r===o[t][s]-1?{levelIndex:t+1,rowIndex:0,cellIndex:0}:r===o[t][s]-1?{levelIndex:t,rowIndex:s+1,cellIndex:0}:{levelIndex:t,rowIndex:s,cellIndex:r+1};default:return{levelIndex:t,rowIndex:s,cellIndex:r}}}function oo({controlsRef:e,direction:t,levelIndex:s,rowIndex:r,cellIndex:o,size:i}){const l=hl({direction:t,size:i,rowIndex:r,cellIndex:o,levelIndex:s});if(!l)return;const a=e.current?.[l.levelIndex]?.[l.rowIndex]?.[l.cellIndex];a&&(a.disabled||a.getAttribute("data-hidden")||a.getAttribute("data-outside")?oo({controlsRef:e,direction:t,levelIndex:l.levelIndex,cellIndex:l.cellIndex,rowIndex:l.rowIndex,size:i}):a.focus())}function fl(e){switch(e){case"ArrowDown":return"down";case"ArrowUp":return"up";case"ArrowRight":return"right";case"ArrowLeft":return"left";default:return null}}function gl(e){return e.current?.map(t=>t.map(s=>s.length))}function $n({controlsRef:e,levelIndex:t,rowIndex:s,cellIndex:r,event:o}){const i=fl(o.key);if(i){o.preventDefault();const l=gl(e);oo({controlsRef:e,direction:i,levelIndex:t,rowIndex:s,cellIndex:r,size:l})}}function fr(e,t){let s=e?L(e):L();if(t==="")return s.format("YYYY-MM-DD HH:mm:ss");const[r,o,i=0]=t.split(":").map(Number);return s=s.set("hour",r),s=s.set("minute",o),s=s.set("second",i),s=s.set("millisecond",0),s.format("YYYY-MM-DD HH:mm:ss")}function Ee(e){return e==null||e===""?e:L(e).format("YYYY-MM-DD")}function $t(e){return e==null||e===""?e:L(e).format("YYYY-MM-DD HH:mm:ss")}function yl({minDate:e,maxDate:t}){const s=L();return!e&&!t?Ee(s):e&&L(s).isBefore(e)?Ee(e):t&&L(s).isAfter(t)?Ee(t):Ee(s)}function qs(e,t,s){return!e&&!t?$t(s):e&&L(s).isBefore(e)?$t(e):t&&L(s).isAfter(t)?$t(t):$t(s)}const vl={locale:"en",firstDayOfWeek:1,weekendDays:[0,6],labelSeparator:"–",consistentWeeks:!1},xl=P.createContext(vl);function pt(){const e=P.useContext(xl),t=P.useCallback(i=>i||e.locale,[e.locale]),s=P.useCallback(i=>typeof i=="number"?i:e.firstDayOfWeek,[e.firstDayOfWeek]),r=P.useCallback(i=>Array.isArray(i)?i:e.weekendDays,[e.weekendDays]),o=P.useCallback(i=>typeof i=="string"?i:e.labelSeparator,[e.labelSeparator]);return{...e,getLocale:t,getFirstDayOfWeek:s,getWeekendDays:r,getLabelSeparator:o}}function bl({value:e,type:t,withTime:s}){const r=s?$t:Ee;if(t==="range"&&Array.isArray(e)){const o=r(e[0]),i=r(e[1]);return o?i?`${o} – ${i}`:`${o} –`:""}return t==="multiple"&&Array.isArray(e)?e.filter(Boolean).join(", "):!Array.isArray(e)&&e?r(e):""}function On({value:e,type:t,name:s,form:r,withTime:o=!1}){return n.jsx("input",{type:"hidden",value:bl({value:e,type:t,withTime:o}),name:s,form:r})}On.displayName="@mantine/dates/HiddenDatesInput";var Cl={input:"m_468e7eda"};const An=ae((e,t)=>{const s=ne("TimeInput",null,e),{classNames:r,styles:o,unstyled:i,vars:l,withSeconds:a,minTime:u,maxTime:d,value:c,onChange:p,step:f,...h}=s,{resolvedClassNames:m,resolvedStyles:S}=Qe({classNames:r,styles:o,props:s}),v=x=>{if(u!==void 0||d!==void 0){const[g,b,y]=x.split(":").map(Number);if(u){const[D,M,$]=u.split(":").map(Number);if(g<D||g===D&&b<M||a&&g===D&&b===M&&y<$)return-1}if(d){const[D,M,$]=d.split(":").map(Number);if(g>D||g===D&&b>M||a&&g===D&&b===M&&y>$)return 1}}return 0},w=x=>{if(s.onBlur?.(x),u!==void 0||d!==void 0){const g=x.currentTarget.value;if(g){const b=v(g);b===1?(d&&(x.currentTarget.value=d),s.onChange?.(x)):b===-1&&(u&&(x.currentTarget.value=u),s.onChange?.(x))}}};return n.jsx(Xe,{classNames:{...m,input:ys(Cl.input,m?.input)},styles:S,unstyled:i,ref:t,value:c,step:f??(a?1:60),...h,onChange:p,onBlur:w,type:"time",__staticSelector:"TimeInput"})});An.classes=Xe.classes;An.displayName="@mantine/dates/TimeInput";function Ve(e){return e<10?`0${e}`:`${e}`}const wl=e=>Number(e.toFixed(0)[0]),cs=P.forwardRef(({value:e,min:t,max:s,onChange:r,focusable:o,step:i,onNextInput:l,onPreviousInput:a,onFocus:u,readOnly:d,allowTemporaryZero:c=!1,placeholder:p="--",...f},h)=>{const m=wl(s),S=s+1-i,v=x=>{if(d)return;const g=x.replace(/\D/g,"");if(g!==""){const b=parseInt(g,10),y=c&&b===0&&t>0?0:Ue(b,t,s);r(y),(y>m||x.startsWith("00"))&&l?.()}},w=x=>{if(!d){if((x.key==="0"||x.key==="Num0")&&e===0&&(x.preventDefault(),l?.()),x.key==="Home"&&(x.preventDefault(),r(t)),x.key==="End"&&(x.preventDefault(),r(s)),(x.key==="Backspace"||x.key==="Delete")&&(x.preventDefault(),e!==null?r(null):a?.()),x.key==="ArrowRight"&&(x.preventDefault(),l?.()),x.key==="ArrowLeft"&&(x.preventDefault(),a?.()),x.key==="ArrowUp"){x.preventDefault();const g=e===null?t:Ue(e+i,t,S);r(g)}if(x.key==="ArrowDown"){x.preventDefault();const g=e===null?S:Ue(e-i,t,S);r(g)}}};return n.jsx("input",{ref:h,type:"text",role:"spinbutton","aria-valuemin":t,"aria-valuemax":s,"aria-valuenow":e===null?0:e,"data-empty":e===null||void 0,inputMode:"numeric",placeholder:p,value:e===null?"":Ve(e),onChange:x=>v(x.currentTarget.value),onKeyDown:w,onFocus:x=>{x.currentTarget.select(),u?.(x)},onClick:x=>{x.stopPropagation(),x.currentTarget.select()},onMouseDown:x=>x.stopPropagation(),...f})});cs.displayName="@mantine/dates/SpinInput";const[Sl,Lt]=Qt("TimeInput component was not found in the component tree"),ao=P.forwardRef(({labels:e,value:t,onChange:s,className:r,style:o,onPreviousInput:i,readOnly:l,onMouseDown:a,onTouchStart:u,inputType:d,...c},p)=>{const f=Lt(),h=m=>{l||(m.key==="Home"&&(m.preventDefault(),s(e.am)),m.key==="End"&&(m.preventDefault(),s(e.pm)),(m.key==="Backspace"||m.key==="Delete")&&(m.preventDefault(),t===null?i?.():s(null)),m.key==="ArrowLeft"&&(m.preventDefault(),i?.()),(m.key==="ArrowUp"||m.key==="ArrowDown")&&(m.preventDefault(),s(t===e.am?e.pm:e.am)),m.code==="KeyA"&&(m.preventDefault(),s(e.am)),m.code==="KeyP"&&(m.preventDefault(),s(e.pm)))};if(d==="input"){const m=t||"--",S=m.length+1;return n.jsx("input",{...f.getStyles("field",{className:r,style:o}),ref:p,value:m,size:S,onChange:v=>!l&&s(v.target.value||null),onClick:(v=>v.stopPropagation()),onKeyDown:h,onMouseDown:v=>{v.stopPropagation(),a?.(v)},"data-am-pm":!0,...c})}return n.jsxs("select",{...f.getStyles("field",{className:r,style:o}),ref:p,value:t||"",onChange:m=>!l&&s(m.target.value||null),onClick:m=>m.stopPropagation(),onKeyDown:h,onMouseDown:m=>{m.stopPropagation(),a?.(m)},"data-am-pm":!0,...c,children:[n.jsx("option",{value:"",children:"--"}),n.jsx("option",{value:e.am,children:e.am}),n.jsx("option",{value:e.pm,children:e.pm})]})});ao.displayName="@mantine/dates/AmPmInput";function Vn({value:e,active:t,onSelect:s}){const r=Lt();return n.jsx(nt,{mod:{active:t},onClick:()=>s(e),onMouseDown:o=>o.preventDefault(),"data-value":e,tabIndex:-1,...r.getStyles("control"),children:typeof e=="number"?Ve(e):e})}Vn.displayName="@mantine/dates/TimeControl";function io({labels:e,value:t,onSelect:s}){const r=Lt(),o=[e.am,e.pm].map(i=>n.jsx(Vn,{value:i,active:t===i,onSelect:s},i));return n.jsx("div",{...r.getStyles("controlsList"),children:o})}io.displayName="@mantine/dates/AmPmControlsList";function jl(e,t){if(!e||!t)return!1;const s=e.getBoundingClientRect(),r=t.getBoundingClientRect();return s.top>=r.top&&s.bottom<=r.bottom&&s.left>=r.left&&s.right<=r.right}function Pl(e,t,s){const r=[];for(let o=e;o<=t;o+=s)r.push(o);return r}function us({min:e,max:t,step:s,value:r,onSelect:o,reversed:i}){const l=Lt(),a=P.useRef(null),u=Pl(e,t,s),d=(i?u.reverse():u).map(c=>n.jsx(Vn,{value:c,active:r===c,onSelect:o},c));return P.useEffect(()=>{r!==null&&requestAnimationFrame(()=>{const p=a.current?.querySelector(`[data-value="${r}"]`);jl(p,a.current)||p?.scrollIntoView({block:"nearest"})})},[r]),n.jsx(qt,{h:l.maxDropdownContentHeight,type:"never",viewportRef:a,...l.getStyles("scrollarea"),...l.scrollAreaProps,children:n.jsx("div",{...l.getStyles("controlsList"),children:d})})}us.displayName="@mantine/dates/TimeControlsList";function fs(e){const[t=null,s=null,r=null]=e.split(":").map(Number);return{hours:t,minutes:s,seconds:r}}function lo({time:e,compare:t,withSeconds:s}){const r=fs(e),o=fs(t);return s?r.hours===o.hours&&r.minutes===o.minutes&&r.seconds===o.seconds:r.hours===o.hours&&r.minutes===o.minutes}function Dl(e,t){return`${e.getHours()}:${e.getMinutes()}${t?`:${e.getSeconds()}`:""}`}function _l({value:e,format:t,amPmLabels:s,withSeconds:r}){const o=fs(typeof e=="string"?e:Dl(e,r));if(o.hours===null||o.minutes===null)return null;if(t==="24h")return`${Ve(o.hours)}:${Ve(o.minutes)}${r?`:${Ve(o.seconds||0)}`:""}`;const i=o.hours>=12;return`${o.hours%12===0?12:o.hours%12}:${Ve(o.minutes)}${r?`:${Ve(o.seconds||0)}`:""} ${i?s.pm:s.am}`}function co({value:e,format:t="24h",amPmLabels:s={am:"AM",pm:"PM"},withSeconds:r=!1}){return n.jsx(n.Fragment,{children:_l({value:e,format:t,amPmLabels:s,withSeconds:r})})}co.displayName="@mantine/dates/TimeValue";function Fn({value:e,active:t,onChange:s,format:r,amPmLabels:o,withSeconds:i}){const l=Lt();return n.jsx(nt,{mod:{active:t},onClick:()=>s(e),...l.getStyles("presetControl"),children:n.jsx(co,{withSeconds:i,value:e,format:r,amPmLabels:o})})}Fn.displayName="@mantine/dates/TimePresetControl";function uo({value:e,data:t,onChange:s,format:r,amPmLabels:o,withSeconds:i}){const l=Lt(),a=t.values.map(u=>n.jsx(Fn,{value:u,format:r,amPmLabels:o,withSeconds:i,active:lo({time:u,compare:e,withSeconds:i}),onChange:s},u));return n.jsxs("div",{...l.getStyles("presetsGroup"),children:[n.jsx("div",{...l.getStyles("presetsGroupLabel"),children:t.label}),n.jsx(Lr,{cols:i?2:3,spacing:4,children:a})]})}uo.displayName="@mantine/dates/TimePresetGroup";function po({presets:e,format:t,amPmLabels:s,withSeconds:r,value:o,onChange:i}){const l=Lt();if(e.length===0)return null;if(typeof e[0]=="string"){const u=e.map(d=>n.jsx(Fn,{value:d,format:t,amPmLabels:s,withSeconds:r,active:lo({time:d,compare:o,withSeconds:r}),onChange:i},d));return n.jsx(qt.Autosize,{mah:l.maxDropdownContentHeight,type:"never",...l.getStyles("scrollarea"),...l.scrollAreaProps,children:n.jsx("div",{...l.getStyles("presetsRoot"),children:n.jsx(Lr,{cols:r?2:3,spacing:4,children:u})})})}const a=e.map((u,d)=>n.jsx(uo,{data:u,value:o,format:t,amPmLabels:s,withSeconds:r,onChange:i},d));return n.jsx(qt.Autosize,{mah:l.maxDropdownContentHeight,type:"never",...l.getStyles("scrollarea"),...l.scrollAreaProps,children:n.jsx("div",{...l.getStyles("presetsRoot"),children:a})})}po.displayName="@mantine/dates/TimePresets";function Us(e){const[t=0,s=0,r=0]=e.split(":").map(Number);return t*3600+s*60+r}function kl(e){const t=Math.floor(e/3600),s=Math.floor(e%3600/60),r=e%60;return{timeString:`${Ve(t)}:${Ve(s)}:${Ve(r)}`,hours:t,minutes:s,seconds:r}}function mo(e,t,s){const r=Us(e),o=t?Us(t):-1/0,i=s?Us(s):1/0,l=Math.max(o,Math.min(r,i));return kl(l)}function Ml({hours:e,minutes:t,seconds:s,amPmLabels:r}){if(e===null)return{hours:null,minutes:null,seconds:null,amPm:null};const o=e>=12?r.pm:r.am;return{hours:e%12===0?12:e%12,minutes:typeof t=="number"?t:null,seconds:typeof s=="number"?s:null,amPm:o}}function Gt({time:e,format:t,amPmLabels:s}){if(e==="")return{hours:null,minutes:null,seconds:null,amPm:null};const{hours:r,minutes:o,seconds:i}=fs(e),l={hours:r,minutes:o,seconds:i};return t==="12h"?Ml({...l,amPmLabels:s}):{...l,amPm:null}}function Nl({hours:e,minutes:t,seconds:s,amPm:r,amPmLabels:o,withSeconds:i}){let l=e;return r===o.pm&&e!==12?l+=12:r===o.am&&e===12&&(l=0),`${Ve(l)}:${Ve(t)}${i?`:${Ve(s||0)}`:""}`}function ds({hours:e,minutes:t,seconds:s,format:r,withSeconds:o,amPm:i,amPmLabels:l}){return e===null||t===null?{valid:!1,value:""}:o&&s===null?{valid:!1,value:""}:r==="24h"?{valid:!0,value:`${Ve(e)}:${Ve(t)}${o?`:${Ve(s)}`:""}`}:i===null?{valid:!1,value:""}:{valid:!0,value:Nl({hours:e,minutes:t,seconds:s,amPm:i,amPmLabels:l,withSeconds:o})}}function Ll({value:e,defaultValue:t,onChange:s,format:r,amPmLabels:o,withSeconds:i=!1,min:l,max:a,clearable:u,readOnly:d,disabled:c,pasteSplit:p}){const f=Gt({time:e||t||"",amPmLabels:o,format:r}),h=P.useRef(!0),[m,S]=P.useState(f.hours),[v,w]=P.useState(f.minutes),[x,g]=P.useState(f.seconds),[b,y]=P.useState(f.amPm),D=u&&!d&&!c&&(m!==null||v!==null||x!==null||b!==null),M=P.useRef(null),$=P.useRef(null),O=P.useRef(null),z=P.useRef(null),A=C=>{C==="hours"&&M.current?.focus(),C==="minutes"&&$.current?.focus(),C==="seconds"&&O.current?.focus(),C==="amPm"&&z.current?.focus()},Y=(C,_)=>{const k={hours:m,minutes:v,seconds:x,amPm:b,[C]:_},N=ds({...k,format:r,withSeconds:i,amPmLabels:o});N.valid?(h.current=!1,C==="hours"&&S(_),C==="minutes"&&w(_),C==="seconds"&&g(_),C==="amPm"&&y(_),s?.(N.value)):(h.current=!1,typeof e=="string"&&e!==""&&s?.(""))},B=C=>{h.current=!1;const _=Gt({time:C,amPmLabels:o,format:r});S(_.hours),w(_.minutes),g(_.seconds),y(_.amPm),s?.(C)},I=C=>{let _=C;r==="12h"&&typeof C=="number"&&C>12&&(_=(C-1)%12+1),S(_),Y("hours",_),A("hours")},F=C=>{w(C),Y("minutes",C),A("minutes")},E=C=>{g(C),Y("seconds",C),A("seconds")},H=C=>{y(C),Y("amPm",C),A("amPm")},R=()=>{h.current=!1,S(null),w(null),g(null),y(null),s?.(""),A("hours")},T=C=>{C.preventDefault();const _=C.clipboardData.getData("text"),k=(p||Gt)({time:_,format:r,amPmLabels:o}),N=ds({...k,format:r,withSeconds:i,amPmLabels:o});if(N.valid){h.current=!1;const W=mo(N.value,l||"00:00:00",a||"23:59:59");s?.(W.timeString),S(k.hours),w(k.minutes),g(k.seconds),y(k.amPm)}},j=ds({hours:m,minutes:v,seconds:x,format:r,withSeconds:i,amPm:b,amPmLabels:o});return bt(()=>{if(e===""){h.current=!1,S(null),w(null),g(null),y(null),h.current=!0;return}if(h.current&&typeof e=="string"){const C=Gt({time:e||"",amPmLabels:o,format:r});S(C.hours),w(C.minutes),g(C.seconds),y(C.amPm)}h.current=!0},[e]),{refs:{hours:M,minutes:$,seconds:O,amPm:z},values:{hours:m,minutes:v,seconds:x,amPm:b},setHours:I,setMinutes:F,setSeconds:E,setAmPm:H,focus:A,clear:R,onPaste:T,setTimeString:B,isClearable:D,hiddenInputValue:j.value}}var ho={fieldsRoot:"m_7a8f1e6d",fieldsGroup:"m_d6bb0a54",controlsList:"m_b97ecb26",controlsListGroup:"m_31fe42f9",dropdown:"m_9c4817c3",control:"m_154c536b",presetControl:"m_7be09d0c",presetsGroup:"m_7d00001d",presetsGroupLabel:"m_d8d918d7",field:"m_6b43ba88"};const Il={hoursStep:1,minutesStep:1,secondsStep:1,format:"24h",amPmLabels:{am:"AM",pm:"PM"},pasteSplit:Gt,maxDropdownContentHeight:200,hoursPlaceholder:"--",minutesPlaceholder:"--",secondsPlaceholder:"--"},Rl=Me((e,{size:t})=>({dropdown:{"--control-font-size":Nt(t)}})),En=ae((e,t)=>{const s=ne("TimePicker",Il,e),{classNames:r,className:o,style:i,styles:l,unstyled:a,vars:u,onClick:d,format:c,value:p,defaultValue:f,onChange:h,hoursStep:m,minutesStep:S,secondsStep:v,withSeconds:w,hoursInputLabel:x,minutesInputLabel:g,secondsInputLabel:b,amPmInputLabel:y,amPmLabels:D,clearable:M,onMouseDown:$,onFocusCapture:O,onBlurCapture:z,min:A,max:Y,popoverProps:B,withDropdown:I,rightSection:F,onFocus:E,onBlur:H,clearButtonProps:R,hoursInputProps:T,minutesInputProps:j,secondsInputProps:C,amPmSelectProps:_,readOnly:k,disabled:N,size:W,name:G,form:ee,hiddenInputProps:oe,labelProps:re,pasteSplit:q,hoursRef:te,minutesRef:X,secondsRef:le,amPmRef:J,presets:pe,maxDropdownContentHeight:se,scrollAreaProps:we,attributes:Z,reverseTimeControlsList:me,hoursPlaceholder:Ye,minutesPlaceholder:he,secondsPlaceholder:ue,...xe}=s,{resolvedClassNames:Je,resolvedStyles:ct}=Qe({classNames:r,styles:l,props:s}),Re=ve({name:"TimePicker",classes:ho,props:s,className:o,style:i,classNames:r,styles:l,unstyled:a,attributes:Z,vars:u,varsResolver:Rl}),V=Ll({value:p,defaultValue:f,onChange:h,format:c,amPmLabels:D,withSeconds:w,min:A,max:Y,clearable:M,disabled:N,readOnly:k,pasteSplit:q}),Te=st(V.refs.hours,te),_e=st(V.refs.minutes,X),mt=st(V.refs.seconds,le),ht=st(V.refs.amPm,J),ft=Zt(),ot=P.useRef(!1),[St,qe]=P.useState(!1),Le=Q=>{ot.current||(ot.current=!0,E?.(Q))},gt=Q=>{if(!Q.currentTarget.contains(Q.relatedTarget)){const Be=V.values,Se=ds({...Be,format:c,amPmLabels:D,withSeconds:!!w});if(Se.valid&&(A||Y)){const at=mo(Se.value,A,Y);at.timeString!==Se.value&&V.setTimeString(at.timeString)}ot.current=!1,H?.(Q)}};return n.jsx(Sl,{value:{getStyles:Re,scrollAreaProps:we,maxDropdownContentHeight:se},children:n.jsxs(Pe,{opened:St,transitionProps:{duration:0},position:"bottom-start",withRoles:!1,disabled:N||k||!I,...B,children:[n.jsx(Pe.Target,{children:n.jsxs(Xe,{component:"div",size:W,disabled:N,ref:t,onClick:Q=>{d?.(Q),V.focus("hours")},onMouseDown:Q=>{Q.preventDefault(),$?.(Q)},onFocusCapture:Q=>{qe(!0),O?.(Q)},onBlurCapture:Q=>{qe(!1),z?.(Q)},rightSection:F||V.isClearable&&n.jsx(ln,{...R,size:W,onClick:Q=>{V.clear(),R?.onClick?.(Q)},onMouseDown:Q=>{Q.preventDefault(),R?.onMouseDown?.(Q)}}),labelProps:{htmlFor:ft,...re},style:i,className:o,classNames:Je,styles:ct,__staticSelector:"TimePicker",...xe,children:[n.jsx("div",{...Re("fieldsRoot"),dir:"ltr",children:n.jsxs("div",{...Re("fieldsGroup"),onBlur:gt,children:[n.jsx(cs,{id:ft,...T,...Re("field",{className:T?.className,style:T?.style}),value:V.values.hours,onChange:V.setHours,onNextInput:()=>V.focus("minutes"),min:c==="12h"?1:0,max:c==="12h"?12:23,allowTemporaryZero:c==="12h",focusable:!0,step:m,ref:Te,"aria-label":x,readOnly:k,disabled:N,onPaste:V.onPaste,onFocus:Q=>{Le(Q),T?.onFocus?.(Q)},onBlur:Q=>{const Be=Q.currentTarget.value,Se=Be?parseInt(Be,10):null;c==="12h"&&Se===0&&V.setHours(12),T?.onBlur?.(Q)},placeholder:Ye}),n.jsx("span",{children:":"}),n.jsx(cs,{...j,...Re("field",{className:j?.className,style:j?.style}),value:V.values.minutes,onChange:V.setMinutes,min:0,max:59,focusable:!0,step:S,ref:_e,onPreviousInput:()=>V.focus("hours"),onNextInput:()=>w?V.focus("seconds"):V.focus("amPm"),"aria-label":g,tabIndex:-1,readOnly:k,disabled:N,onPaste:V.onPaste,onFocus:Q=>{Le(Q),j?.onFocus?.(Q)},placeholder:he}),w&&n.jsxs(n.Fragment,{children:[n.jsx("span",{children:":"}),n.jsx(cs,{...C,...Re("field",{className:C?.className,style:C?.style}),value:V.values.seconds,onChange:V.setSeconds,min:0,max:59,focusable:!0,step:v,ref:mt,onPreviousInput:()=>V.focus("minutes"),onNextInput:()=>V.focus("amPm"),"aria-label":b,tabIndex:-1,readOnly:k,disabled:N,onPaste:V.onPaste,onFocus:Q=>{Le(Q),C?.onFocus?.(Q)},placeholder:ue})]}),c==="12h"&&n.jsx(ao,{..._,inputType:I?"input":"select",labels:D,value:V.values.amPm,onChange:V.setAmPm,ref:ht,"aria-label":y,onPreviousInput:()=>w?V.focus("seconds"):V.focus("minutes"),readOnly:k,disabled:N,tabIndex:-1,onPaste:V.onPaste,onFocus:Q=>{Le(Q),_?.onFocus?.(Q)}})]})}),n.jsx("input",{type:"hidden",name:G,form:ee,value:V.hiddenInputValue,...oe})]})}),n.jsx(Pe.Dropdown,{...Re("dropdown"),onMouseDown:Q=>Q.preventDefault(),children:pe?n.jsx(po,{value:V.hiddenInputValue,onChange:V.setTimeString,format:c,presets:pe,amPmLabels:D,withSeconds:w||!1}):n.jsxs("div",{...Re("controlsListGroup"),children:[n.jsx(us,{min:c==="12h"?1:0,max:c==="12h"?12:23,step:m,value:V.values.hours,onSelect:V.setHours,reversed:me}),n.jsx(us,{min:0,max:59,step:S,value:V.values.minutes,onSelect:V.setMinutes,reversed:me}),w&&n.jsx(us,{min:0,max:59,step:v,value:V.values.seconds,onSelect:V.setSeconds,reversed:me}),c==="12h"&&n.jsx(io,{labels:D,value:V.values.amPm,onSelect:V.setAmPm})]})})]})})});En.displayName="@mantine/dates/TimePicker";En.classes=ho;var fo={day:"m_396ce5cb"};const Tl=Me((e,{size:t})=>({day:{"--day-size":De(t,"day-size")}})),Yn=ae((e,t)=>{const s=ne("Day",null,e),{classNames:r,className:o,style:i,styles:l,unstyled:a,vars:u,date:d,disabled:c,__staticSelector:p,weekend:f,outside:h,selected:m,renderDay:S,inRange:v,firstInRange:w,lastInRange:x,hidden:g,static:b,highlightToday:y,attributes:D,...M}=s,$=ve({name:p||"Day",classes:fo,props:s,className:o,style:i,classNames:r,styles:l,unstyled:a,attributes:D,vars:u,varsResolver:Tl,rootSelector:"day"});return n.jsx(nt,{...$("day",{style:g?{display:"none"}:void 0}),component:b?"div":"button",ref:t,disabled:c,"data-today":L(d).isSame(new Date,"day")||void 0,"data-hidden":g||void 0,"data-highlight-today":y||void 0,"data-disabled":c||void 0,"data-weekend":!c&&!h&&f||void 0,"data-outside":!c&&h||void 0,"data-selected":!c&&m||void 0,"data-in-range":v&&!c||void 0,"data-first-in-range":w&&!c||void 0,"data-last-in-range":x&&!c||void 0,"data-static":b||void 0,unstyled:a,...M,children:S?.(d)||L(d).date()})});Yn.classes=fo;Yn.displayName="@mantine/dates/Day";function $l({locale:e,format:t="dd",firstDayOfWeek:s=1}){const r=L().day(s),o=[];for(let i=0;i<7;i+=1)typeof t=="string"?o.push(L(r).add(i,"days").locale(e).format(t)):o.push(t(L(r).add(i,"days").format("YYYY-MM-DD")));return o}var go={weekday:"m_18a3eca"};const Ol=Me((e,{size:t})=>({weekdaysRow:{"--wr-fz":Nt(t),"--wr-spacing":Kt(t)}})),zn=ae((e,t)=>{const s=ne("WeekdaysRow",null,e),{classNames:r,className:o,style:i,styles:l,unstyled:a,vars:u,locale:d,firstDayOfWeek:c,weekdayFormat:p,cellComponent:f="th",__staticSelector:h,withWeekNumbers:m,attributes:S,...v}=s,w=ve({name:h||"WeekdaysRow",classes:go,props:s,className:o,style:i,classNames:r,styles:l,unstyled:a,attributes:S,vars:u,varsResolver:Ol,rootSelector:"weekdaysRow"}),x=pt(),g=$l({locale:x.getLocale(d),format:p,firstDayOfWeek:x.getFirstDayOfWeek(c)}).map((b,y)=>n.jsx(f,{...w("weekday"),children:b},y));return n.jsxs(de,{component:"tr",ref:t,...w("weekdaysRow"),...v,children:[m&&n.jsx(f,{...w("weekday"),children:"#"}),g]})});zn.classes=go;zn.displayName="@mantine/dates/WeekdaysRow";function Al(e,t=1){let s=L(e);if(!s.isValid())return s;const r=t===0?6:t-1;for(;s.day()!==r;)s=s.add(1,"day");return s.format("YYYY-MM-DD")}function Vl(e,t=1){let s=L(e);for(;s.day()!==t;)s=s.subtract(1,"day");return s.format("YYYY-MM-DD")}function Fl({month:e,firstDayOfWeek:t=1,consistentWeeks:s}){const r=L(e).subtract(L(e).date()-1,"day"),o=L(r.format("YYYY-M-D")),i=o.format("YYYY-MM-DD"),l=o.add(+o.daysInMonth()-1,"day").format("YYYY-MM-DD"),a=Al(l,t),u=[];let d=L(Vl(i,t));for(;L(d).isBefore(a,"day");){const c=[];for(let p=0;p<7;p+=1)c.push(d.format("YYYY-MM-DD")),d=d.add(1,"day");u.push(c)}if(s&&u.length<6){const c=u[u.length-1],p=c[c.length-1];let f=L(p).add(1,"day");for(;u.length<6;){const h=[];for(let m=0;m<7;m+=1)h.push(f.format("YYYY-MM-DD")),f=f.add(1,"day");u.push(h)}}return u}function ks(e,t){return L(e).format("YYYY-MM")===L(t).format("YYYY-MM")}function yo(e,t){return t?L(e).isAfter(L(t).subtract(1,"day"),"day"):!0}function vo(e,t){return t?L(e).isBefore(L(t).add(1,"day"),"day"):!0}function El({dates:e,minDate:t,maxDate:s,getDayProps:r,excludeDate:o,hideOutsideDates:i,month:l}){const a=e.flat().filter(c=>vo(c,s)&&yo(c,t)&&!o?.(c)&&!r?.(c)?.disabled&&(!i||ks(c,l))),u=a.find(c=>r?.(c)?.selected);if(u)return u;const d=a.find(c=>L().isSame(c,"date"));return d||a[0]}var ps={exports:{}},Yl=ps.exports,gr;function zl(){return gr||(gr=1,(function(e,t){(function(s,r){e.exports=r()})(Yl,(function(){var s="day";return function(r,o,i){var l=function(d){return d.add(4-d.isoWeekday(),s)},a=o.prototype;a.isoWeekYear=function(){return l(this).year()},a.isoWeek=function(d){if(!this.$utils().u(d))return this.add(7*(d-this.isoWeek()),s);var c,p,f,h,m=l(this),S=(c=this.isoWeekYear(),p=this.$u,f=(p?i.utc:i)().year(c).startOf("year"),h=4-f.isoWeekday(),f.isoWeekday()>4&&(h+=7),f.add(h,s));return m.diff(S,"week")+1},a.isoWeekday=function(d){return this.$utils().u(d)?this.day()||7:this.day(this.day()%7?d:d-7)};var u=a.startOf;a.startOf=function(d,c){var p=this.$utils(),f=!!p.u(c)||c;return p.p(d)==="isoweek"?f?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):u.bind(this)(d,c)}}}))})(ps)),ps.exports}var Bl=zl();const Hl=qo(Bl);L.extend(Hl);function Wl(e){const t=e.find(s=>L(s).day()===1);return L(t).isoWeek()}var xo={month:"m_cc9820d3",monthCell:"m_8f457cd5",weekNumber:"m_6cff9dea"};const Gl={withCellSpacing:!0},Kl=Me((e,{size:t})=>({weekNumber:{"--wn-fz":Nt(t),"--wn-size":De(t,"wn-size")}})),Ms=ae((e,t)=>{const s=ne("Month",Gl,e),{classNames:r,className:o,style:i,styles:l,unstyled:a,vars:u,__staticSelector:d,locale:c,firstDayOfWeek:p,weekdayFormat:f,month:h,weekendDays:m,getDayProps:S,excludeDate:v,minDate:w,maxDate:x,renderDay:g,hideOutsideDates:b,hideWeekdays:y,getDayAriaLabel:D,static:M,__getDayRef:$,__onDayKeyDown:O,__onDayClick:z,__onDayMouseEnter:A,__preventFocus:Y,__stopPropagation:B,withCellSpacing:I,size:F,highlightToday:E,withWeekNumbers:H,attributes:R,...T}=s,j=ve({name:d||"Month",classes:xo,props:s,className:o,style:i,classNames:r,styles:l,unstyled:a,attributes:R,vars:u,varsResolver:Kl,rootSelector:"month"}),C=pt(),_=Fl({month:h,firstDayOfWeek:C.getFirstDayOfWeek(p),consistentWeeks:C.consistentWeeks}),k=El({dates:_,minDate:Ee(w),maxDate:Ee(x),getDayProps:S,excludeDate:v,hideOutsideDates:b,month:h}),{resolvedClassNames:N,resolvedStyles:W}=Qe({classNames:r,styles:l,props:s}),G=_.map((ee,oe)=>{const re=ee.map((q,te)=>{const X=!ks(q,h),le=D?.(q)||L(q).locale(c||C.locale).format("D MMMM YYYY"),J=S?.(q),pe=L(q).isSame(k,"date");return n.jsx("td",{...j("monthCell"),"data-with-spacing":I||void 0,children:n.jsx(Yn,{__staticSelector:d||"Month",classNames:N,styles:W,unstyled:a,"data-mantine-stop-propagation":B||void 0,highlightToday:E,renderDay:g,date:q,size:F,weekend:C.getWeekendDays(m).includes(L(q).get("day")),outside:X,hidden:b?X:!1,"aria-label":le,static:M,disabled:v?.(q)||!vo(q,Ee(x))||!yo(q,Ee(w)),ref:se=>{se&&$?.(oe,te,se)},...J,onKeyDown:se=>{J?.onKeyDown?.(se),O?.(se,{rowIndex:oe,cellIndex:te,date:q})},onMouseEnter:se=>{J?.onMouseEnter?.(se),A?.(se,q)},onClick:se=>{J?.onClick?.(se),z?.(se,q)},onMouseDown:se=>{J?.onMouseDown?.(se),Y&&se.preventDefault()},tabIndex:Y||!pe?-1:0})},q.toString())});return n.jsxs("tr",{...j("monthRow"),children:[H&&n.jsx("td",{...j("weekNumber"),children:Wl(ee)}),re]},oe)});return n.jsxs(de,{component:"table",...j("month"),size:F,ref:t,...T,children:[!y&&n.jsx("thead",{...j("monthThead"),children:n.jsx(zn,{__staticSelector:d||"Month",locale:c,firstDayOfWeek:p,weekdayFormat:f,size:F,classNames:N,styles:W,unstyled:a,withWeekNumbers:H})}),n.jsx("tbody",{...j("monthTbody"),children:G})]})});Ms.classes=xo;Ms.displayName="@mantine/dates/Month";var bo={pickerControl:"m_dc6a3c71"};const ql=Me((e,{size:t})=>({pickerControl:{"--dpc-fz":Nt(t),"--dpc-size":De(t,"dpc-size")}})),Ns=ae((e,t)=>{const s=ne("PickerControl",null,e),{classNames:r,className:o,style:i,styles:l,unstyled:a,vars:u,firstInRange:d,lastInRange:c,inRange:p,__staticSelector:f,selected:h,disabled:m,attributes:S,...v}=s,w=ve({name:f||"PickerControl",classes:bo,props:s,className:o,style:i,classNames:r,styles:l,unstyled:a,attributes:S,vars:u,varsResolver:ql,rootSelector:"pickerControl"});return n.jsx(nt,{...w("pickerControl"),ref:t,unstyled:a,"data-picker-control":!0,"data-selected":h&&!m||void 0,"data-disabled":m||void 0,"data-in-range":p&&!m&&!h||void 0,"data-first-in-range":d&&!m||void 0,"data-last-in-range":c&&!m||void 0,disabled:m,...v})});Ns.classes=bo;Ns.displayName="@mantine/dates/PickerControl";function Co({year:e,minDate:t,maxDate:s}){return!t&&!s?!1:!!(t&&L(e).isBefore(t,"year")||s&&L(e).isAfter(s,"year"))}function Ul({years:e,minDate:t,maxDate:s,getYearControlProps:r}){const o=e.flat().filter(a=>!Co({year:a,minDate:t,maxDate:s})&&!r?.(a)?.disabled),i=o.find(a=>r?.(a)?.selected);if(i)return i;const l=o.find(a=>L().isSame(a,"year"));return l||o[0]}function wo(e){const t=L(e).year(),s=t-t%10;let r=0;const o=[[],[],[],[]];for(let i=0;i<4;i+=1){const l=i===3?1:3;for(let a=0;a<l;a+=1)o[i].push(L(new Date(s+r,0)).format("YYYY-MM-DD")),r+=1}return o}var So={yearsList:"m_9206547b",yearsListCell:"m_c5a19c7d"};const Zl={yearsListFormat:"YYYY",withCellSpacing:!0},Ls=ae((e,t)=>{const s=ne("YearsList",Zl,e),{classNames:r,className:o,style:i,styles:l,unstyled:a,vars:u,decade:d,yearsListFormat:c,locale:p,minDate:f,maxDate:h,getYearControlProps:m,__staticSelector:S,__getControlRef:v,__onControlKeyDown:w,__onControlClick:x,__onControlMouseEnter:g,__preventFocus:b,__stopPropagation:y,withCellSpacing:D,size:M,attributes:$,...O}=s,z=ve({name:S||"YearsList",classes:So,props:s,className:o,style:i,classNames:r,styles:l,unstyled:a,attributes:$,vars:u,rootSelector:"yearsList"}),A=pt(),Y=wo(d),B=Ul({years:Y,minDate:f,maxDate:h,getYearControlProps:m}),I=Y.map((F,E)=>{const H=F.map((R,T)=>{const j=m?.(R),C=L(R).isSame(B,"year");return n.jsx("td",{...z("yearsListCell"),"data-with-spacing":D||void 0,children:n.jsx(Ns,{...z("yearsListControl"),size:M,unstyled:a,"data-mantine-stop-propagation":y||void 0,disabled:Co({year:R,minDate:f,maxDate:h}),ref:_=>{_&&v?.(E,T,_)},...j,onKeyDown:_=>{j?.onKeyDown?.(_),w?.(_,{rowIndex:E,cellIndex:T,date:R})},onClick:_=>{j?.onClick?.(_),x?.(_,R)},onMouseEnter:_=>{j?.onMouseEnter?.(_),g?.(_,R)},onMouseDown:_=>{j?.onMouseDown?.(_),b&&_.preventDefault()},tabIndex:b||!C?-1:0,children:j?.children??L(R).locale(A.getLocale(p)).format(c)})},T)});return n.jsx("tr",{...z("yearsListRow"),children:H},E)});return n.jsx(de,{component:"table",ref:t,size:M,...z("yearsList"),...O,children:n.jsx("tbody",{children:I})})});Ls.classes=So;Ls.displayName="@mantine/dates/YearsList";function jo({month:e,minDate:t,maxDate:s}){return!t&&!s?!1:!!(t&&L(e).isBefore(t,"month")||s&&L(e).isAfter(s,"month"))}function Ql({months:e,minDate:t,maxDate:s,getMonthControlProps:r}){const o=e.flat().filter(a=>!jo({month:a,minDate:t,maxDate:s})&&!r?.(a)?.disabled),i=o.find(a=>r?.(a)?.selected);if(i)return i;const l=o.find(a=>L().isSame(a,"month"));return l||o[0]}function Xl(e){const t=L(e).startOf("year").toDate(),s=[[],[],[],[]];let r=0;for(let o=0;o<4;o+=1)for(let i=0;i<3;i+=1)s[o].push(L(t).add(r,"months").format("YYYY-MM-DD")),r+=1;return s}var Po={monthsList:"m_2a6c32d",monthsListCell:"m_fe27622f"};const Jl={monthsListFormat:"MMM",withCellSpacing:!0},Is=ae((e,t)=>{const s=ne("MonthsList",Jl,e),{classNames:r,className:o,style:i,styles:l,unstyled:a,vars:u,__staticSelector:d,year:c,monthsListFormat:p,locale:f,minDate:h,maxDate:m,getMonthControlProps:S,__getControlRef:v,__onControlKeyDown:w,__onControlClick:x,__onControlMouseEnter:g,__preventFocus:b,__stopPropagation:y,withCellSpacing:D,size:M,attributes:$,...O}=s,z=ve({name:d||"MonthsList",classes:Po,props:s,className:o,style:i,classNames:r,styles:l,unstyled:a,attributes:$,vars:u,rootSelector:"monthsList"}),A=pt(),Y=Xl(c),B=Ql({months:Y,minDate:Ee(h),maxDate:Ee(m),getMonthControlProps:S}),I=Y.map((F,E)=>{const H=F.map((R,T)=>{const j=S?.(R),C=L(R).isSame(B,"month");return n.jsx("td",{...z("monthsListCell"),"data-with-spacing":D||void 0,children:n.jsx(Ns,{...z("monthsListControl"),size:M,unstyled:a,__staticSelector:d||"MonthsList","data-mantine-stop-propagation":y||void 0,disabled:jo({month:R,minDate:Ee(h),maxDate:Ee(m)}),ref:_=>{_&&v?.(E,T,_)},...j,onKeyDown:_=>{j?.onKeyDown?.(_),w?.(_,{rowIndex:E,cellIndex:T,date:R})},onClick:_=>{j?.onClick?.(_),x?.(_,R)},onMouseEnter:_=>{j?.onMouseEnter?.(_),g?.(_,R)},onMouseDown:_=>{j?.onMouseDown?.(_),b&&_.preventDefault()},tabIndex:b||!C?-1:0,children:j?.children??L(R).locale(A.getLocale(f)).format(p)})},T)});return n.jsx("tr",{...z("monthsListRow"),children:H},E)});return n.jsx(de,{component:"table",ref:t,size:M,...z("monthsList"),...O,children:n.jsx("tbody",{children:I})})});Is.classes=Po;Is.displayName="@mantine/dates/MonthsList";var Do={calendarHeader:"m_730a79ed",calendarHeaderLevel:"m_f6645d97",calendarHeaderControl:"m_2351eeb0",calendarHeaderControlIcon:"m_367dc749"};const ec={hasNextLevel:!0,withNext:!0,withPrevious:!0,headerControlsOrder:["previous","level","next"]},tc=Me((e,{size:t})=>({calendarHeader:{"--dch-control-size":De(t,"dch-control-size"),"--dch-fz":Nt(t)}})),Ct=ae((e,t)=>{const s=ne("CalendarHeader",ec,e),{classNames:r,className:o,style:i,styles:l,unstyled:a,vars:u,nextIcon:d,previousIcon:c,nextLabel:p,previousLabel:f,onNext:h,onPrevious:m,onLevelClick:S,label:v,nextDisabled:w,previousDisabled:x,hasNextLevel:g,levelControlAriaLabel:b,withNext:y,withPrevious:D,headerControlsOrder:M,__staticSelector:$,__preventFocus:O,__stopPropagation:z,attributes:A,...Y}=s,B=ve({name:$||"CalendarHeader",classes:Do,props:s,className:o,style:i,classNames:r,styles:l,unstyled:a,attributes:A,vars:u,varsResolver:tc,rootSelector:"calendarHeader"}),I=O?T=>T.preventDefault():void 0,F=D&&P.createElement(nt,{...B("calendarHeaderControl"),key:"previous","data-direction":"previous","aria-label":f,onClick:m,unstyled:a,onMouseDown:I,disabled:x,"data-disabled":x||void 0,tabIndex:O||x?-1:0,"data-mantine-stop-propagation":z||void 0},c||n.jsx(Un,{...B("calendarHeaderControlIcon"),"data-direction":"previous",size:"45%"})),E=P.createElement(nt,{component:g?"button":"div",...B("calendarHeaderLevel"),key:"level",onClick:g?S:void 0,unstyled:a,onMouseDown:g?I:void 0,disabled:!g,"data-static":!g||void 0,"aria-label":b,tabIndex:O||!g?-1:0,"data-mantine-stop-propagation":z||void 0},v),H=y&&P.createElement(nt,{...B("calendarHeaderControl"),key:"next","data-direction":"next","aria-label":p,onClick:h,unstyled:a,onMouseDown:I,disabled:w,"data-disabled":w||void 0,tabIndex:O||w?-1:0,"data-mantine-stop-propagation":z||void 0},d||n.jsx(Un,{...B("calendarHeaderControlIcon"),"data-direction":"next",size:"45%"})),R=M.map(T=>T==="previous"?F:T==="level"?E:T==="next"?H:null);return n.jsx(de,{...B("calendarHeader"),ref:t,...Y,children:R})});Ct.classes=Do;Ct.displayName="@mantine/dates/CalendarHeader";function sc(e){const t=wo(e);return[t[0][0],t[3][0]]}const nc={decadeLabelFormat:"YYYY"},Rs=ae((e,t)=>{const s=ne("DecadeLevel",nc,e),{decade:r,locale:o,minDate:i,maxDate:l,yearsListFormat:a,getYearControlProps:u,__getControlRef:d,__onControlKeyDown:c,__onControlClick:p,__onControlMouseEnter:f,withCellSpacing:h,__preventFocus:m,nextIcon:S,previousIcon:v,nextLabel:w,previousLabel:x,onNext:g,onPrevious:b,nextDisabled:y,previousDisabled:D,levelControlAriaLabel:M,withNext:$,withPrevious:O,headerControlsOrder:z,decadeLabelFormat:A,classNames:Y,styles:B,unstyled:I,__staticSelector:F,__stopPropagation:E,size:H,attributes:R,...T}=s,j=pt(),[C,_]=sc(r),k={__staticSelector:F||"DecadeLevel",classNames:Y,styles:B,unstyled:I,size:H,attributes:R},N=typeof y=="boolean"?y:l?!L(_).endOf("year").isBefore(l):!1,W=typeof D=="boolean"?D:i?!L(C).startOf("year").isAfter(i):!1,G=(ee,oe)=>L(ee).locale(o||j.locale).format(oe);return n.jsxs(de,{"data-decade-level":!0,size:H,ref:t,...T,children:[n.jsx(Ct,{label:typeof A=="function"?A(C,_):`${G(C,A)} – ${G(_,A)}`,__preventFocus:m,__stopPropagation:E,nextIcon:S,previousIcon:v,nextLabel:w,previousLabel:x,onNext:g,onPrevious:b,nextDisabled:N,previousDisabled:W,hasNextLevel:!1,levelControlAriaLabel:M,withNext:$,withPrevious:O,headerControlsOrder:z,...k}),n.jsx(Ls,{decade:r,locale:o,minDate:i,maxDate:l,yearsListFormat:a,getYearControlProps:u,__getControlRef:d,__onControlKeyDown:c,__onControlClick:p,__onControlMouseEnter:f,__preventFocus:m,__stopPropagation:E,withCellSpacing:h,...k})]})});Rs.classes={...Ls.classes,...Ct.classes};Rs.displayName="@mantine/dates/DecadeLevel";const rc={yearLabelFormat:"YYYY"},Ts=ae((e,t)=>{const s=ne("YearLevel",rc,e),{year:r,locale:o,minDate:i,maxDate:l,monthsListFormat:a,getMonthControlProps:u,__getControlRef:d,__onControlKeyDown:c,__onControlClick:p,__onControlMouseEnter:f,withCellSpacing:h,__preventFocus:m,nextIcon:S,previousIcon:v,nextLabel:w,previousLabel:x,onNext:g,onPrevious:b,onLevelClick:y,nextDisabled:D,previousDisabled:M,hasNextLevel:$,levelControlAriaLabel:O,withNext:z,withPrevious:A,headerControlsOrder:Y,yearLabelFormat:B,__staticSelector:I,__stopPropagation:F,size:E,classNames:H,styles:R,unstyled:T,attributes:j,...C}=s,_=pt(),k={__staticSelector:I||"YearLevel",classNames:H,styles:R,unstyled:T,size:E,attributes:j},N=typeof D=="boolean"?D:l?!L(r).endOf("year").isBefore(l):!1,W=typeof M=="boolean"?M:i?!L(r).startOf("year").isAfter(i):!1;return n.jsxs(de,{"data-year-level":!0,size:E,ref:t,...C,children:[n.jsx(Ct,{label:typeof B=="function"?B(r):L(r).locale(o||_.locale).format(B),__preventFocus:m,__stopPropagation:F,nextIcon:S,previousIcon:v,nextLabel:w,previousLabel:x,onNext:g,onPrevious:b,onLevelClick:y,nextDisabled:N,previousDisabled:W,hasNextLevel:$,levelControlAriaLabel:O,withNext:z,withPrevious:A,headerControlsOrder:Y,...k}),n.jsx(Is,{year:r,locale:o,minDate:i,maxDate:l,monthsListFormat:a,getMonthControlProps:u,__getControlRef:d,__onControlKeyDown:c,__onControlClick:p,__onControlMouseEnter:f,__preventFocus:m,__stopPropagation:F,withCellSpacing:h,...k})]})});Ts.classes={...Ct.classes,...Is.classes};Ts.displayName="@mantine/dates/YearLevel";const oc={monthLabelFormat:"MMMM YYYY"},$s=ae((e,t)=>{const s=ne("MonthLevel",oc,e),{month:r,locale:o,firstDayOfWeek:i,weekdayFormat:l,weekendDays:a,getDayProps:u,excludeDate:d,minDate:c,maxDate:p,renderDay:f,hideOutsideDates:h,hideWeekdays:m,getDayAriaLabel:S,__getDayRef:v,__onDayKeyDown:w,__onDayClick:x,__onDayMouseEnter:g,withCellSpacing:b,highlightToday:y,withWeekNumbers:D,__preventFocus:M,__stopPropagation:$,nextIcon:O,previousIcon:z,nextLabel:A,previousLabel:Y,onNext:B,onPrevious:I,onLevelClick:F,nextDisabled:E,previousDisabled:H,hasNextLevel:R,levelControlAriaLabel:T,withNext:j,withPrevious:C,headerControlsOrder:_,monthLabelFormat:k,classNames:N,styles:W,unstyled:G,__staticSelector:ee,size:oe,static:re,attributes:q,...te}=s,X=pt(),le={__staticSelector:ee||"MonthLevel",classNames:N,styles:W,unstyled:G,size:oe,attributes:q},J=typeof E=="boolean"?E:p?!L(r).endOf("month").isBefore(p):!1,pe=typeof H=="boolean"?H:c?!L(r).startOf("month").isAfter(c):!1;return n.jsxs(de,{"data-month-level":!0,size:oe,ref:t,...te,children:[n.jsx(Ct,{label:typeof k=="function"?k(r):L(r).locale(o||X.locale).format(k),__preventFocus:M,__stopPropagation:$,nextIcon:O,previousIcon:z,nextLabel:A,previousLabel:Y,onNext:B,onPrevious:I,onLevelClick:F,nextDisabled:J,previousDisabled:pe,hasNextLevel:R,levelControlAriaLabel:T,withNext:j,withPrevious:C,headerControlsOrder:_,...le}),n.jsx(Ms,{month:r,locale:o,firstDayOfWeek:i,weekdayFormat:l,weekendDays:a,getDayProps:u,excludeDate:d,minDate:c,maxDate:p,renderDay:f,hideOutsideDates:h,hideWeekdays:m,getDayAriaLabel:S,__getDayRef:v,__onDayKeyDown:w,__onDayClick:x,__onDayMouseEnter:g,__preventFocus:M,__stopPropagation:$,static:re,withCellSpacing:b,highlightToday:y,withWeekNumbers:D,...le})]})});$s.classes={...Ms.classes,...Ct.classes};$s.displayName="@mantine/dates/MonthLevel";var _o={levelsGroup:"m_30b26e33"};const wt=ae((e,t)=>{const s=ne("LevelsGroup",null,e),{classNames:r,className:o,style:i,styles:l,unstyled:a,vars:u,__staticSelector:d,attributes:c,...p}=s,f=ve({name:d||"LevelsGroup",classes:_o,props:s,className:o,style:i,classNames:r,styles:l,unstyled:a,attributes:c,vars:u,rootSelector:"levelsGroup"});return n.jsx(de,{ref:t,...f("levelsGroup"),...p})});wt.classes=_o;wt.displayName="@mantine/dates/LevelsGroup";const ac={numberOfColumns:1},Os=ae((e,t)=>{const s=ne("DecadeLevelGroup",ac,e),{decade:r,locale:o,minDate:i,maxDate:l,yearsListFormat:a,getYearControlProps:u,__onControlClick:d,__onControlMouseEnter:c,withCellSpacing:p,__preventFocus:f,nextIcon:h,previousIcon:m,nextLabel:S,previousLabel:v,onNext:w,onPrevious:x,nextDisabled:g,previousDisabled:b,headerControlsOrder:y,classNames:D,styles:M,unstyled:$,__staticSelector:O,__stopPropagation:z,numberOfColumns:A,levelControlAriaLabel:Y,decadeLabelFormat:B,size:I,vars:F,attributes:E,...H}=s,R=P.useRef([]),T=Array(A).fill(0).map((j,C)=>{const _=L(r).add(C*10,"years").format("YYYY-MM-DD");return n.jsx(Rs,{size:I,yearsListFormat:a,decade:_,withNext:C===A-1,withPrevious:C===0,decadeLabelFormat:B,__onControlClick:d,__onControlMouseEnter:c,__onControlKeyDown:(k,N)=>$n({levelIndex:C,rowIndex:N.rowIndex,cellIndex:N.cellIndex,event:k,controlsRef:R}),__getControlRef:(k,N,W)=>{Array.isArray(R.current[C])||(R.current[C]=[]),Array.isArray(R.current[C][k])||(R.current[C][k]=[]),R.current[C][k][N]=W},levelControlAriaLabel:typeof Y=="function"?Y(_):Y,locale:o,minDate:i,maxDate:l,__preventFocus:f,__stopPropagation:z,nextIcon:h,previousIcon:m,nextLabel:S,previousLabel:v,onNext:w,onPrevious:x,nextDisabled:g,previousDisabled:b,getYearControlProps:u,__staticSelector:O||"DecadeLevelGroup",classNames:D,styles:M,unstyled:$,withCellSpacing:p,headerControlsOrder:y,attributes:E},C)});return n.jsx(wt,{classNames:D,styles:M,__staticSelector:O||"DecadeLevelGroup",ref:t,size:I,unstyled:$,attributes:E,...H,children:T})});Os.classes={...wt.classes,...Rs.classes};Os.displayName="@mantine/dates/DecadeLevelGroup";const ic={numberOfColumns:1},As=ae((e,t)=>{const s=ne("YearLevelGroup",ic,e),{year:r,locale:o,minDate:i,maxDate:l,monthsListFormat:a,getMonthControlProps:u,__onControlClick:d,__onControlMouseEnter:c,withCellSpacing:p,__preventFocus:f,nextIcon:h,previousIcon:m,nextLabel:S,previousLabel:v,onNext:w,onPrevious:x,onLevelClick:g,nextDisabled:b,previousDisabled:y,hasNextLevel:D,headerControlsOrder:M,classNames:$,styles:O,unstyled:z,__staticSelector:A,__stopPropagation:Y,numberOfColumns:B,levelControlAriaLabel:I,yearLabelFormat:F,size:E,vars:H,attributes:R,...T}=s,j=P.useRef([]),C=Array(B).fill(0).map((_,k)=>{const N=L(r).add(k,"years").format("YYYY-MM-DD");return n.jsx(Ts,{size:E,monthsListFormat:a,year:N,withNext:k===B-1,withPrevious:k===0,yearLabelFormat:F,__stopPropagation:Y,__onControlClick:d,__onControlMouseEnter:c,__onControlKeyDown:(W,G)=>$n({levelIndex:k,rowIndex:G.rowIndex,cellIndex:G.cellIndex,event:W,controlsRef:j}),__getControlRef:(W,G,ee)=>{Array.isArray(j.current[k])||(j.current[k]=[]),Array.isArray(j.current[k][W])||(j.current[k][W]=[]),j.current[k][W][G]=ee},levelControlAriaLabel:typeof I=="function"?I(N):I,locale:o,minDate:i,maxDate:l,__preventFocus:f,nextIcon:h,previousIcon:m,nextLabel:S,previousLabel:v,onNext:w,onPrevious:x,onLevelClick:g,nextDisabled:b,previousDisabled:y,hasNextLevel:D,getMonthControlProps:u,classNames:$,styles:O,unstyled:z,__staticSelector:A||"YearLevelGroup",withCellSpacing:p,headerControlsOrder:M,attributes:R},k)});return n.jsx(wt,{classNames:$,styles:O,__staticSelector:A||"YearLevelGroup",ref:t,size:E,unstyled:z,attributes:R,...T,children:C})});As.classes={...Ts.classes,...wt.classes};As.displayName="@mantine/dates/YearLevelGroup";const lc={numberOfColumns:1},Vs=ae((e,t)=>{const s=ne("MonthLevelGroup",lc,e),{month:r,locale:o,firstDayOfWeek:i,weekdayFormat:l,weekendDays:a,getDayProps:u,excludeDate:d,minDate:c,maxDate:p,renderDay:f,hideOutsideDates:h,hideWeekdays:m,getDayAriaLabel:S,__onDayClick:v,__onDayMouseEnter:w,withCellSpacing:x,highlightToday:g,withWeekNumbers:b,__preventFocus:y,nextIcon:D,previousIcon:M,nextLabel:$,previousLabel:O,onNext:z,onPrevious:A,onLevelClick:Y,nextDisabled:B,previousDisabled:I,hasNextLevel:F,headerControlsOrder:E,classNames:H,styles:R,unstyled:T,numberOfColumns:j,levelControlAriaLabel:C,monthLabelFormat:_,__staticSelector:k,__stopPropagation:N,size:W,static:G,vars:ee,attributes:oe,...re}=s,q=P.useRef([]),te=Array(j).fill(0).map((X,le)=>{const J=L(r).add(le,"months").format("YYYY-MM-DD");return n.jsx($s,{month:J,withNext:le===j-1,withPrevious:le===0,monthLabelFormat:_,__stopPropagation:N,__onDayClick:v,__onDayMouseEnter:w,__onDayKeyDown:(pe,se)=>$n({levelIndex:le,rowIndex:se.rowIndex,cellIndex:se.cellIndex,event:pe,controlsRef:q}),__getDayRef:(pe,se,we)=>{Array.isArray(q.current[le])||(q.current[le]=[]),Array.isArray(q.current[le][pe])||(q.current[le][pe]=[]),q.current[le][pe][se]=we},levelControlAriaLabel:typeof C=="function"?C(J):C,locale:o,firstDayOfWeek:i,weekdayFormat:l,weekendDays:a,getDayProps:u,excludeDate:d,minDate:c,maxDate:p,renderDay:f,hideOutsideDates:h,hideWeekdays:m,getDayAriaLabel:S,__preventFocus:y,nextIcon:D,previousIcon:M,nextLabel:$,previousLabel:O,onNext:z,onPrevious:A,onLevelClick:Y,nextDisabled:B,previousDisabled:I,hasNextLevel:F,classNames:H,styles:R,unstyled:T,__staticSelector:k||"MonthLevelGroup",size:W,static:G,withCellSpacing:x,highlightToday:g,withWeekNumbers:b,headerControlsOrder:E,attributes:oe},le)});return n.jsx(wt,{classNames:H,styles:R,__staticSelector:k||"MonthLevelGroup",ref:t,size:W,attributes:oe,...re,children:te})});Vs.classes={...wt.classes,...$s.classes};Vs.displayName="@mantine/dates/MonthLevelGroup";var ko={input:"m_6fa5e2aa"};const Fs=ae((e,t)=>{const{inputProps:s,wrapperProps:r,placeholder:o,classNames:i,styles:l,unstyled:a,popoverProps:u,modalProps:d,dropdownType:c,children:p,formattedValue:f,dropdownHandlers:h,dropdownOpened:m,onClick:S,clearable:v,onClear:w,clearButtonProps:x,rightSection:g,shouldClear:b,readOnly:y,disabled:D,value:M,name:$,form:O,type:z,onDropdownClose:A,withTime:Y,...B}=an("PickerInputBase",{size:"sm"},e),I=n.jsx(Fe.ClearButton,{onClick:w,unstyled:a,...x}),F=()=>{z==="range"&&Array.isArray(M)&&M[0]&&!M[1]&&w(),h.close()};return n.jsxs(n.Fragment,{children:[c==="modal"&&!y&&n.jsx(Uo,{opened:m,onClose:F,withCloseButton:!1,size:"auto","data-dates-modal":!0,unstyled:a,...d,children:p}),n.jsx(Fe.Wrapper,{...r,children:n.jsxs(Pe,{position:"bottom-start",opened:m,trapFocus:!0,returnFocus:!1,unstyled:a,onClose:A,...u,disabled:u?.disabled||c==="modal"||y,onChange:E=>{E||(u?.onClose?.(),F())},children:[n.jsx(Pe.Target,{children:n.jsx(Fe,{"data-dates-input":!0,"data-read-only":y||void 0,disabled:D,component:"button",type:"button",multiline:!0,onClick:E=>{S?.(E),h.toggle()},__clearSection:I,__clearable:v&&b&&!y&&!D,rightSection:g,...s,ref:t,classNames:{...i,input:ys(ko.input,i?.input)},...B,children:f||n.jsx(Fe.Placeholder,{error:s.error,unstyled:a,classNames:i,styles:l,__staticSelector:s.__staticSelector,children:o})})}),n.jsx(Pe.Dropdown,{"data-dates-dropdown":!0,children:p})]})}),n.jsx(On,{value:M,name:$,form:O,type:z,withTime:Y})]})});Fs.classes=ko;Fs.displayName="@mantine/dates/PickerInputBase";const yr=e=>e==="range"?[null,null]:e==="multiple"?[]:null,vr=(e,t)=>{const s=t?$t:Ee;return Array.isArray(e)?e.map(s):s(e)};function Ut({type:e,value:t,defaultValue:s,onChange:r,withTime:o=!1}){const i=P.useRef(e),[l,a,u]=Ke({value:vr(t,o),defaultValue:vr(s,o),finalValue:yr(e),onChange:r});let d=l;return i.current!==e&&(i.current=e,t===void 0&&(d=s!==void 0?s:yr(e),a(d))),[d,a,u]}function Zs(e,t){return e?e==="month"?0:e==="year"?1:2:t||0}function cc(e){return e===0?"month":e===1?"year":"decade"}function Bt(e,t,s){return cc(Ue(Zs(e,0),Zs(t,0),Zs(s,2)))}const uc={maxLevel:"decade",minLevel:"month",__updateDateOnYearSelect:!0,__updateDateOnMonthSelect:!0,enableKeyboardNavigation:!0},Et=ae((e,t)=>{const s=ne("Calendar",uc,e),{vars:r,maxLevel:o,minLevel:i,defaultLevel:l,level:a,onLevelChange:u,date:d,defaultDate:c,onDateChange:p,numberOfColumns:f,columnsToScroll:h,ariaLabels:m,nextLabel:S,previousLabel:v,onYearSelect:w,onMonthSelect:x,onYearMouseEnter:g,onMonthMouseEnter:b,headerControlsOrder:y,__updateDateOnYearSelect:D,__updateDateOnMonthSelect:M,__setDateRef:$,__setLevelRef:O,firstDayOfWeek:z,weekdayFormat:A,weekendDays:Y,getDayProps:B,excludeDate:I,renderDay:F,hideOutsideDates:E,hideWeekdays:H,getDayAriaLabel:R,monthLabelFormat:T,nextIcon:j,previousIcon:C,__onDayClick:_,__onDayMouseEnter:k,withCellSpacing:N,highlightToday:W,withWeekNumbers:G,monthsListFormat:ee,getMonthControlProps:oe,yearLabelFormat:re,yearsListFormat:q,getYearControlProps:te,decadeLabelFormat:X,classNames:le,styles:J,unstyled:pe,minDate:se,maxDate:we,locale:Z,__staticSelector:me,size:Ye,__preventFocus:he,__stopPropagation:ue,onNextDecade:xe,onPreviousDecade:Je,onNextYear:ct,onPreviousYear:Re,onNextMonth:V,onPreviousMonth:Te,static:_e,enableKeyboardNavigation:mt,attributes:ht,...ft}=s,{resolvedClassNames:ot,resolvedStyles:St}=Qe({classNames:le,styles:J,props:s}),[qe,Le]=Ke({value:a?Bt(a,i,o):void 0,defaultValue:l?Bt(l,i,o):void 0,finalValue:Bt(void 0,i,o),onChange:u}),[gt,Q]=Ut({type:"default",value:Ee(d),defaultValue:Ee(c),onChange:p});P.useImperativeHandle($,()=>U=>{Q(U)}),P.useImperativeHandle(O,()=>U=>{Le(U)});const Be={__staticSelector:me||"Calendar",styles:St,classNames:ot,unstyled:pe,size:Ye,attributes:ht},Se=h||f||1,at=new Date,It=se&&L(at).isAfter(se)?se:L(at).format("YYYY-MM-DD"),$e=gt||It,jt=()=>{const U=L($e).add(Se,"month").format("YYYY-MM-DD");V?.(U),Q(U)},je=()=>{const U=L($e).subtract(Se,"month").format("YYYY-MM-DD");Te?.(U),Q(U)},yt=()=>{const U=L($e).add(Se,"year").format("YYYY-MM-DD");ct?.(U),Q(U)},ke=()=>{const U=L($e).subtract(Se,"year").format("YYYY-MM-DD");Re?.(U),Q(U)},Pt=()=>{const U=L($e).add(10*Se,"year").format("YYYY-MM-DD");xe?.(U),Q(U)},Rt=()=>{const U=L($e).subtract(10*Se,"year").format("YYYY-MM-DD");Je?.(U),Q(U)},be=P.useRef(null);P.useEffect(()=>{if(!mt||_e)return;const U=Ce=>{if(!be.current?.contains(document.activeElement))return;const Oe=Ce.ctrlKey||Ce.metaKey,vt=Ce.shiftKey;switch(Ce.key){case"ArrowUp":Oe&&vt?(Ce.preventDefault(),Rt()):Oe&&(Ce.preventDefault(),ke());break;case"ArrowDown":Oe&&vt?(Ce.preventDefault(),Pt()):Oe&&(Ce.preventDefault(),yt());break;case"y":case"Y":qe==="month"&&(Ce.preventDefault(),Le("year"));break}};return document.addEventListener("keydown",U),()=>{document.removeEventListener("keydown",U)}},[mt,_e,qe,yt,ke,Pt,Rt]);const et=U=>{be.current=U,typeof t=="function"?t(U):t&&(t.current=U)};return n.jsxs(de,{ref:et,size:Ye,"data-calendar":!0,...ft,children:[qe==="month"&&n.jsx(Vs,{month:$e,minDate:se,maxDate:we,firstDayOfWeek:z,weekdayFormat:A,weekendDays:Y,getDayProps:B,excludeDate:I,renderDay:F,hideOutsideDates:E,hideWeekdays:H,getDayAriaLabel:R,onNext:jt,onPrevious:je,hasNextLevel:o!=="month",onLevelClick:()=>Le("year"),numberOfColumns:f,locale:Z,levelControlAriaLabel:m?.monthLevelControl,nextLabel:m?.nextMonth??S,nextIcon:j,previousLabel:m?.previousMonth??v,previousIcon:C,monthLabelFormat:T,__onDayClick:_,__onDayMouseEnter:k,__preventFocus:he,__stopPropagation:ue,static:_e,withCellSpacing:N,highlightToday:W,withWeekNumbers:G,headerControlsOrder:y,...Be}),qe==="year"&&n.jsx(As,{year:$e,numberOfColumns:f,minDate:se,maxDate:we,monthsListFormat:ee,getMonthControlProps:oe,locale:Z,onNext:yt,onPrevious:ke,hasNextLevel:o!=="month"&&o!=="year",onLevelClick:()=>Le("decade"),levelControlAriaLabel:m?.yearLevelControl,nextLabel:m?.nextYear??S,nextIcon:j,previousLabel:m?.previousYear??v,previousIcon:C,yearLabelFormat:re,__onControlMouseEnter:b,__onControlClick:(U,Ce)=>{M&&Q(Ce),Le(Bt("month",i,o)),x?.(Ce)},__preventFocus:he,__stopPropagation:ue,withCellSpacing:N,headerControlsOrder:y,...Be}),qe==="decade"&&n.jsx(Os,{decade:$e,minDate:se,maxDate:we,yearsListFormat:q,getYearControlProps:te,locale:Z,onNext:Pt,onPrevious:Rt,numberOfColumns:f,nextLabel:m?.nextDecade??S,nextIcon:j,previousLabel:m?.previousDecade??v,previousIcon:C,decadeLabelFormat:X,__onControlMouseEnter:g,__onControlClick:(U,Ce)=>{D&&Q(Ce),Le(Bt("year",i,o)),w?.(Ce)},__preventFocus:he,__stopPropagation:ue,withCellSpacing:N,headerControlsOrder:y,...Be})]})});Et.classes={...Os.classes,...As.classes,...Vs.classes};Et.displayName="@mantine/dates/Calendar";function Bn(e){const{maxLevel:t,minLevel:s,defaultLevel:r,level:o,onLevelChange:i,nextIcon:l,previousIcon:a,date:u,defaultDate:d,onDateChange:c,numberOfColumns:p,columnsToScroll:f,ariaLabels:h,nextLabel:m,previousLabel:S,onYearSelect:v,onMonthSelect:w,onYearMouseEnter:x,onMonthMouseEnter:g,onNextMonth:b,onPreviousMonth:y,onNextYear:D,onPreviousYear:M,onNextDecade:$,onPreviousDecade:O,withCellSpacing:z,highlightToday:A,__updateDateOnYearSelect:Y,__updateDateOnMonthSelect:B,__setDateRef:I,__setLevelRef:F,withWeekNumbers:E,headerControlsOrder:H,firstDayOfWeek:R,weekdayFormat:T,weekendDays:j,getDayProps:C,excludeDate:_,renderDay:k,hideOutsideDates:N,hideWeekdays:W,getDayAriaLabel:G,monthLabelFormat:ee,monthsListFormat:oe,getMonthControlProps:re,yearLabelFormat:q,yearsListFormat:te,getYearControlProps:X,decadeLabelFormat:le,allowSingleDateInRange:J,allowDeselect:pe,minDate:se,maxDate:we,locale:Z,...me}=e;return{calendarProps:{maxLevel:t,minLevel:s,defaultLevel:r,level:o,onLevelChange:i,nextIcon:l,previousIcon:a,date:u,defaultDate:d,onDateChange:c,numberOfColumns:p,columnsToScroll:f,ariaLabels:h,nextLabel:m,previousLabel:S,onYearSelect:v,onMonthSelect:w,onYearMouseEnter:x,onMonthMouseEnter:g,onNextMonth:b,onPreviousMonth:y,onNextYear:D,onPreviousYear:M,onNextDecade:$,onPreviousDecade:O,withCellSpacing:z,highlightToday:A,__updateDateOnYearSelect:Y,__updateDateOnMonthSelect:B,__setDateRef:I,withWeekNumbers:E,headerControlsOrder:H,firstDayOfWeek:R,weekdayFormat:T,weekendDays:j,getDayProps:C,excludeDate:_,renderDay:k,hideOutsideDates:N,hideWeekdays:W,getDayAriaLabel:G,monthLabelFormat:ee,monthsListFormat:oe,getMonthControlProps:re,yearLabelFormat:q,yearsListFormat:te,getYearControlProps:X,decadeLabelFormat:le,allowSingleDateInRange:J,allowDeselect:pe,minDate:se,maxDate:we,locale:Z},others:me}}function xr(e,t){const s=[...t].sort((r,o)=>L(r).isAfter(L(o))?1:-1);return L(s[0]).startOf("day").subtract(1,"ms").isBefore(e)&&L(s[1]).endOf("day").add(1,"ms").isAfter(e)}function dc({type:e,level:t,value:s,defaultValue:r,onChange:o,allowSingleDateInRange:i,allowDeselect:l,onMouseLeave:a}){const[u,d]=Ut({type:e,value:s,defaultValue:r,onChange:o}),[c,p]=P.useState(e==="range"&&u[0]&&!u[1]?u[0]:null),[f,h]=P.useState(null),m=y=>{if(e==="range"){if(c&&!u[1]){if(L(y).isSame(c,t)&&!i){p(null),h(null),d([null,null]);return}const D=[y,c];D.sort((M,$)=>L(M).isAfter(L($))?1:-1),d(D),h(null),p(null);return}if(u[0]&&!u[1]&&L(y).isSame(u[0],t)&&!i){p(null),h(null),d([null,null]);return}d([y,null]),h(null),p(y);return}if(e==="multiple"){u.some(D=>L(D).isSame(y,t))?d(u.filter(D=>!L(D).isSame(y,t))):d([...u,y]);return}u&&l&&L(y).isSame(u,t)?d(null):d(y)},S=y=>c&&f?xr(y,[f,c]):u[0]&&u[1]?xr(y,u):!1,v=e==="range"?y=>{a?.(y),h(null)}:a,w=y=>u[0]&&L(y).isSame(u[0],t)?!(f&&L(f).isBefore(u[0])):!1,x=y=>u[1]?L(y).isSame(u[1],t):!u[0]||!f?!1:L(f).isBefore(u[0])&&L(y).isSame(u[0],t),g=y=>{if(e==="range")return{selected:u.some(M=>M&&L(M).isSame(y,t)),inRange:S(y),firstInRange:w(y),lastInRange:x(y),"data-autofocus":!!u[0]&&L(u[0]).isSame(y,t)||void 0};if(e==="multiple")return{selected:u.some(M=>M&&L(M).isSame(y,t)),"data-autofocus":!!u[0]&&L(u[0]).isSame(y,t)||void 0};const D=L(u).isSame(y,t);return{selected:D,"data-autofocus":D||void 0}},b=e==="range"&&c?h:()=>{};return P.useEffect(()=>{if(e==="range")if(u[0]&&!u[1])p(u[0]);else{const y=u[0]==null&&u[1]==null,D=u[0]!=null&&u[1]!=null;(y||D)&&(p(null),h(null))}},[u]),{onDateChange:m,onRootMouseLeave:v,onHoveredDateChange:b,getControlProps:g,_value:u,setValue:d}}var pc={datePickerRoot:"m_765a40cf",presetsList:"m_d6a681e1",presetButton:"m_acd30b22"};const mc=Me((e,{size:t})=>({datePickerRoot:{"--preset-font-size":Nt(t)}})),hc={type:"default",defaultLevel:"month",numberOfColumns:1,size:"sm"},Es=ae((e,t)=>{const s=ne("DatePicker",hc,e),{allowDeselect:r,allowSingleDateInRange:o,value:i,defaultValue:l,onChange:a,onMouseLeave:u,classNames:d,styles:c,__staticSelector:p,__onDayClick:f,__onDayMouseEnter:h,__onPresetSelect:m,__stopPropagation:S,presets:v,className:w,style:x,unstyled:g,size:b,vars:y,attributes:D,...M}=s,{calendarProps:$,others:O}=Bn(M),z=P.useRef(null),A=P.useRef(null),Y=ve({name:p||"DatePicker",classes:pc,props:s,className:w,style:x,classNames:d,styles:c,unstyled:g,attributes:D,rootSelector:v?"datePickerRoot":void 0,varsResolver:mc,vars:y}),{onDateChange:B,onRootMouseLeave:I,onHoveredDateChange:F,getControlProps:E,_value:H,setValue:R}=dc({type:O.type,level:"day",allowDeselect:r,allowSingleDateInRange:o,value:i,defaultValue:l,onChange:a,onMouseLeave:u}),{resolvedClassNames:T,resolvedStyles:j}=Qe({classNames:d,styles:c,props:s}),C=n.jsx(Et,{ref:t,classNames:T,styles:j,__staticSelector:p||"DatePicker",onMouseLeave:I,size:b,...$,...v?{}:O,__stopPropagation:S,__setDateRef:z,__setLevelRef:A,minLevel:$.minLevel||"month",__onDayMouseEnter:(N,W)=>{F(W),h?.(N,W)},__onDayClick:(N,W)=>{B(W),f?.(N,W)},getDayProps:N=>({...E(N),...$.getDayProps?.(N)}),getMonthControlProps:N=>({selected:typeof H=="string"?ks(N,H):!1,...$.getMonthControlProps?.(N)}),getYearControlProps:N=>({selected:typeof H=="string"?L(N).isSame(H,"year"):!1,...$.getYearControlProps?.(N)}),hideOutsideDates:$.hideOutsideDates??$.numberOfColumns!==1,...v?{}:{className:w,style:x,attributes:D}});if(!v)return C;const _=N=>{const W=Array.isArray(N)?N[0]:N;W!==void 0&&(z.current?.(W),A.current?.("month"),m?m(W):R(N))},k=v.map((N,W)=>n.jsx(nt,{...Y("presetButton"),onClick:()=>_(N.value),onMouseDown:G=>G.preventDefault(),"data-mantine-stop-propagation":S||void 0,children:N.label},W));return n.jsxs(de,{...Y("datePickerRoot"),size:b,...O,children:[n.jsx("div",{...Y("presetsList"),children:k}),C]})});Es.classes=Et.classes;Es.displayName="@mantine/dates/DatePicker";function fc(e){if(e===null)return null;const t=new Date(e);return Number.isNaN(t.getTime())||!e?null:L(t).format("YYYY-MM-DD")}function gc({date:e,maxDate:t,minDate:s}){return!(e==null||Number.isNaN(new Date(e).getTime())||t&&L(e).isAfter(t,"date")||s&&L(e).isBefore(s,"date"))}const yc={valueFormat:"MMMM D, YYYY",fixOnBlur:!0,size:"sm"},Hn=ae((e,t)=>{const s=an("DateInput",yc,e),{inputProps:r,wrapperProps:o,value:i,defaultValue:l,onChange:a,clearable:u,clearButtonProps:d,popoverProps:c,getDayProps:p,locale:f,valueFormat:h,dateParser:m,minDate:S,maxDate:v,fixOnBlur:w,onFocus:x,onBlur:g,onClick:b,onKeyDown:y,readOnly:D,name:M,form:$,rightSection:O,unstyled:z,classNames:A,styles:Y,allowDeselect:B,date:I,defaultDate:F,onDateChange:E,getMonthControlProps:H,getYearControlProps:R,disabled:T,...j}=s,C=P.useRef(null),_=P.useRef(null),[k,N]=P.useState(!1),{calendarProps:W,others:G}=Bn(j),ee=pt(),re=m||(V=>{const Te=L(V,h,ee.getLocale(f)).toDate();return Number.isNaN(Te.getTime())?fc(V):L(Te).format("YYYY-MM-DD")}),q=B!==void 0?B:u,te=V=>V?L(V).locale(ee.getLocale(f)).format(h):"",[X,le,J]=Ut({type:"default",value:i,defaultValue:l,onChange:a}),[pe,se]=Ut({type:"default",value:I,defaultValue:l||F,onChange:E});P.useEffect(()=>{J&&i!==null&&se(i)},[J,i]);const[we,Z]=P.useState(te(X));P.useEffect(()=>{Z(te(X))},[ee.getLocale(f)]);const me=V=>{const Te=V.currentTarget.value;if(Z(Te),N(!0),Te.trim()===""&&(B||u))le(null);else{const _e=re(Te);_e&&gc({date:_e,minDate:S,maxDate:v})&&(le(_e),se(_e))}},Ye=V=>{g?.(V),N(!1),w&&Z(te(X))},he=V=>{x?.(V),N(!0)},ue=V=>{b?.(V),N(!0)},xe=V=>{V.key==="Escape"&&N(!1),y?.(V)},Je=V=>({...p?.(V),selected:L(X).isSame(V,"day"),onClick:Te=>{p?.(V).onClick?.(Te);const _e=q&&L(X).isSame(V,"day")?null:V;le(_e),!J&&_e&&Z(te(_e)),N(!1)}}),ct=n.jsx(Fe.ClearButton,{onClick:()=>{le(null),!J&&Z(""),N(!1)},unstyled:z,...d}),Re=u&&!!X&&!D&&!T;return bt(()=>{X!==void 0&&!k&&Z(te(X))},[X]),ga(()=>N(!1),void 0,[C.current,_.current]),n.jsxs(n.Fragment,{children:[n.jsx(Fe.Wrapper,{...o,__staticSelector:"DateInput",ref:C,children:n.jsxs(Pe,{opened:k,trapFocus:!1,position:"bottom-start",disabled:D||T,withRoles:!1,unstyled:z,...c,children:[n.jsx(Pe.Target,{children:n.jsx(Fe,{"data-dates-input":!0,"data-read-only":D||void 0,autoComplete:"off",ref:t,value:we,onChange:me,onBlur:Ye,onFocus:he,onClick:ue,onKeyDown:xe,readOnly:D,rightSection:O,__clearSection:ct,__clearable:Re,...r,...G,disabled:T,__staticSelector:"DateInput"})}),n.jsx(Pe.Dropdown,{onMouseDown:V=>V.preventDefault(),"data-dates-dropdown":!0,ref:_,children:n.jsx(Et,{__staticSelector:"DateInput",...W,classNames:A,styles:Y,unstyled:z,__preventFocus:!0,minDate:S,maxDate:v,locale:f,getDayProps:Je,size:r.size,date:pe,onDateChange:se,getMonthControlProps:V=>({selected:typeof X=="string"?ks(V,X):!1,...H?.(V)}),getYearControlProps:V=>({selected:typeof X=="string"?L(V).isSame(X,"year"):!1,...R?.(V)}),attributes:o.attributes})})]})}),n.jsx(On,{name:M,form:$,value:X,type:"default"})]})});Hn.classes={...Fe.classes,...Et.classes};Hn.displayName="@mantine/dates/DateInput";function vc({minDate:e,value:t}){const s=e?L(e).format("HH:mm:ss"):null;return t&&e&&t===e?s??void 0:void 0}function xc({maxDate:e,value:t}){const s=e?L(e).format("HH:mm:ss"):null;return t&&e&&t===e?s??void 0:void 0}var Mo={timeWrapper:"m_208d2562",timeInput:"m_62ee059"};const bc={dropdownType:"popover",size:"sm"},Wn=ae((e,t)=>{const s=ne("DateTimePicker",bc,e),{value:r,defaultValue:o,onChange:i,valueFormat:l,locale:a,classNames:u,styles:d,unstyled:c,timePickerProps:p,submitButtonProps:f,withSeconds:h,level:m,defaultLevel:S,size:v,variant:w,dropdownType:x,vars:g,minDate:b,maxDate:y,defaultDate:D,defaultTimeValue:M,presets:$,attributes:O,onDropdownClose:z,...A}=s,Y=ve({name:"DateTimePicker",classes:Mo,props:s,classNames:u,styles:d,unstyled:c,attributes:O,vars:g}),{resolvedClassNames:B,resolvedStyles:I}=Qe({classNames:u,styles:d,props:s}),F=l||(h?"DD/MM/YYYY HH:mm:ss":"DD/MM/YYYY HH:mm"),E=P.useRef(null),H=st(E,p?.hoursRef),{calendarProps:{allowSingleDateInRange:R,...T},others:j}=Bn(A),C=pt(),[_,k]=Ut({type:"default",value:r,defaultValue:o,onChange:i,withTime:!0}),N=D||_,W=Z=>Z?L(Z).format(h?"HH:mm:ss":"HH:mm"):"",[G,ee]=P.useState(M||W(_)),[oe,re]=P.useState(m||S||"month"),[q,te]=ua(!1),X=_?L(_).locale(C.getLocale(a)).format(F):"",le=Z=>{p?.onChange?.(Z),ee(Z),Z&&k(fr(_,Z))},J=Z=>{Z&&k(fr(qs(b,y,Z),G||M||"")),E.current?.focus()},pe=Z=>{Z.key==="Enter"&&(Z.preventDefault(),te.close())};bt(()=>{q||ee(W(_))},[_,q]),bt(()=>{q&&re("month")},[q]);const se=x==="popover",we=()=>{const Z=qs(b,y,_);_&&_!==Z&&k(qs(b,y,_)),z?.()};return n.jsxs(Fs,{formattedValue:X,dropdownOpened:A.disabled?!1:q,dropdownHandlers:te,classNames:B,styles:I,unstyled:c,ref:t,onClear:()=>k(null),shouldClear:!!_,value:_,size:v,variant:w,dropdownType:x,...j,type:"default",__staticSelector:"DateTimePicker",onDropdownClose:we,withTime:!0,attributes:O,children:[n.jsx(Es,{...T,maxDate:y,minDate:b,size:v,variant:w,type:"default",value:_,defaultDate:N||yl({maxDate:y,minDate:b}),onChange:J,locale:a,classNames:B,styles:I,unstyled:c,__staticSelector:"DateTimePicker",__stopPropagation:se,level:m,defaultLevel:S,onLevelChange:Z=>{re(Z),T.onLevelChange?.(Z)},presets:$,__onPresetSelect:Z=>{k(Z),Z&&ee(W(Z))},attributes:O}),oe==="month"&&n.jsxs("div",{...Y("timeWrapper"),children:[n.jsx(En,{value:G,withSeconds:h,unstyled:c,min:vc({minDate:b,value:_}),max:xc({maxDate:y,value:_}),...p,...Y("timeInput",{className:p?.className,style:p?.style}),onChange:le,onKeyDown:pe,size:v,"data-mantine-stop-propagation":se||void 0,hoursRef:H,attributes:O}),n.jsx(At,{variant:"default",size:`input-${v||"sm"}`,...Y("submitButton",{className:f?.className,style:f?.style}),unstyled:c,"data-mantine-stop-propagation":se||void 0,children:n.jsx(Ir,{size:"30%"}),...f,onClick:Z=>{f?.onClick?.(Z),te.close(),we()}})]})]})});Wn.classes={...Mo,...Fs.classes,...Es.classes};Wn.displayName="@mantine/dates/DateTimePicker";const Cc=e=>{const t=vs(e.input),{inputProps:s,id:r,icon:o,format:i}=Ft(e,t);if(!e.input?.props)return null;if(e.datetime||i==="date-time"){const l=typeof e.datetime=="object"?e.datetime:{};return n.jsx(Wn,{...s,id:r,leftSection:o,defaultValue:e.input.props.defaultValue?new Date(e.input.props.defaultValue):void 0,onChange:a=>{e.input.set(a?new Date(a).toISOString():void 0)},...l})}if(e.date||i==="date"){const l=typeof e.date=="object"?e.date:{};return n.jsx(Hn,{...s,id:r,leftSection:o,defaultValue:e.input.props.defaultValue?new Date(e.input.props.defaultValue):void 0,onChange:a=>{e.input.set(a?new Date(a).toISOString().slice(0,10):void 0)},...l})}if(e.time||i==="time"){const l=typeof e.time=="object"?e.time:{};return n.jsx(An,{...s,id:r,leftSection:o,defaultValue:e.input.props.defaultValue,onChange:a=>{e.input.set(a.currentTarget.value)},...l})}return null},wc=e=>{const t=vs(e.input),{inputProps:s,id:r,icon:o}=Ft(e,t),i=P.useRef(null),[l,a]=P.useState(e.input.props.defaultValue);if(un({"form:reset":c=>{c.id===e.input?.form.id&&i.current&&a(e.input.props.defaultValue)}},[e.input]),!e.input?.props)return null;const{type:u,...d}=e.input.props;return e.sliderProps?n.jsx(Fe.Wrapper,{...s,children:n.jsx("div",{style:{height:32,padding:8},children:n.jsx(Rn,{...s,ref:i,id:r,...d,...e.sliderProps,value:l,onChange:c=>{a(c),e.input.set(c)}})})}):n.jsx(ya,{...s,ref:i,id:r,leftSection:o,...d,...e.numberInputProps,value:l??"",onChange:c=>{const p=c!==null?Number(c):void 0;a(p),e.input.set(p)}})},Sc=e=>{const{inputProps:t}=Ft(e,{});if(!e.input?.props)return null;const s=e.input.schema;if(!s?.properties)return null;const r=Object.keys(s.properties),i=12/(e.columns??1),a=e.input.items,u=()=>n.jsx(dt,{children:r.map(d=>{const c=e.controlProps?.[d]??{},p=a?.[d];return p?n.jsx(dt.Col,{span:i,children:n.jsx(gs,{input:p,...c})},d):null})});return e.variant==="plain"?u():n.jsx(Cs,{legend:t.label,children:n.jsxs(We,{gap:"xs",children:[t.description&&n.jsx(ye,{size:"sm",c:"dimmed",children:t.description}),u(),t.error&&n.jsx(ye,{size:"sm",c:"red",children:t.error})]})})};function jc(e){return!e||e.trim()===""?{}:new Pc(e).parse()}class Pc{pos=0;query;constructor(t){this.query=t.trim()}parse(){return this.parseExpression()}parseExpression(){return this.parseOr()}parseOr(){const t=this.parseAnd();if(this.peek()==="|"){const s=[t];for(;this.peek()==="|";)this.consume("|"),s.push(this.parseAnd());return{or:s}}return t}parseAnd(){const t=this.parsePrimary();if(this.peek()==="&"){const s=[t];for(;this.peek()==="&";)this.consume("&"),s.push(this.parsePrimary());return{and:s}}return t}parsePrimary(){if(this.skipWhitespace(),this.peek()==="("){this.consume("(");const t=this.parseExpression();return this.consume(")"),t}return this.parseCondition()}parseCondition(){const t=this.parseFieldPath();this.skipWhitespace();const s=this.parseOperator();this.skipWhitespace();const r=this.parseValue();if(r==="")throw new Dr(`Expected value for field '${t.join(".")}'`);return this.buildCondition(t,s,r)}parseFieldPath(){const t=[];let s="";for(;this.pos<this.query.length;){const r=this.query[this.pos];if(r==="."&&s){t.push(s),s="",this.pos++;continue}if(r==="="||r==="!"||r===">"||r==="<"||r===" ")break;s+=r,this.pos++}return s&&t.push(s),t}parseOperator(){this.skipWhitespace();const t=this.query.slice(this.pos);if(t.startsWith(">="))return this.pos+=2,">=";if(t.startsWith("<="))return this.pos+=2,"<=";if(t.startsWith("!="))return this.pos+=2,"!=";const s=this.query[this.pos];if(s==="="||s===">"||s==="<")return this.pos++,s;throw new Error(`Expected operator at position ${this.pos}`)}parseValue(){if(this.skipWhitespace(),this.query.slice(this.pos,this.pos+4).toLowerCase()==="null")return this.pos+=4,null;if(this.query[this.pos]==="[")return this.parseArray();if(this.query[this.pos]==='"'||this.query[this.pos]==="'")return this.parseQuotedString();let t="";for(;this.pos<this.query.length;){const s=this.query[this.pos];if(s==="&"||s==="|"||s===")")break;t+=s,this.pos++}return this.coerceValue(t.trim())}parseArray(){this.consume("[");const t=[];for(;this.pos<this.query.length&&this.query[this.pos]!=="]";){if(this.skipWhitespace(),this.query[this.pos]==='"'||this.query[this.pos]==="'")t.push(this.parseQuotedString());else{let s="";for(;this.pos<this.query.length&&this.query[this.pos]!==","&&this.query[this.pos]!=="]";)s+=this.query[this.pos],this.pos++;t.push(this.coerceValue(s.trim()))}this.skipWhitespace(),this.query[this.pos]===","&&this.pos++}return this.consume("]"),t}parseQuotedString(){const t=this.query[this.pos];this.pos++;let s="",r=!1;for(;this.pos<this.query.length;){const o=this.query[this.pos];if(r){s+=o,r=!1,this.pos++;continue}if(o==="\\"){r=!0,this.pos++;continue}if(o===t){this.pos++;break}s+=o,this.pos++}return s}coerceValue(t){return/^-?\d+$/.test(t)?parseInt(t,10):/^-?\d+\.\d+$/.test(t)?parseFloat(t):t.toLowerCase()==="true"?!0:t.toLowerCase()==="false"?!1:t}buildCondition(t,s,r){let o;if(s==="=")if(r===null)o={isNull:!0};else if(Array.isArray(r))o={inArray:r};else if(typeof r=="string"&&r.includes("*")){const l=r.startsWith("*"),a=r.endsWith("*"),u=r.replace(/^\*|\*$/g,"");l&&a?o={contains:u}:l?o={endsWith:u}:a?o={startsWith:u}:o={eq:r}}else o={eq:r};else if(s==="!=")r===null?o={isNotNull:!0}:o={ne:r};else if(s===">")o={gt:r};else if(s===">=")o={gte:r};else if(s==="<")o={lt:r};else if(s==="<=")o={lte:r};else throw new Error(`Unsupported operator: ${s}`);if(t.length===1)return{[t[0]]:o};let i=o;for(let l=t.length-1;l>=0;l--)i={[t[l]]:i};return i}peek(){return this.skipWhitespace(),this.query[this.pos]||""}consume(t){if(this.skipWhitespace(),this.query[this.pos]!==t)throw new Error(`Expected '${t}' at position ${this.pos}, got '${this.query[this.pos]}'`);this.pos++}skipWhitespace(){for(;this.pos<this.query.length&&/\s/.test(this.query[this.pos]);)this.pos++}}class Dc{attr=ge;identityPrimaryKey=(t,s)=>ge(ge(ge(K.integer(s),_t),zt,t),it);bigIdentityPrimaryKey=(t,s)=>ge(ge(ge(K.int64(s),_t),zt,t),it);uuidPrimaryKey=()=>ge(ge(K.uuid(),_t),it);primaryKey(t,s,r){if(!t||K.schema.isInteger(t))return ge(ge(ge(K.integer(s),_t),zt,r),it);if(K.schema.isString(t)&&t.format==="uuid")return ge(ge(K.uuid(),_t),it);if(K.schema.isNumber(t)&&t.format==="int64")return ge(ge(ge(K.number(s),_t),zt,r),it);if(K.schema.isBigInt(t))return ge(ge(ge(K.bigint(s),_t),zt,r),it);throw new Dr(`Unsupported type for primary key: ${t}`)}default=(t,s)=>(s!=null&&Object.assign(t,{default:s}),this.attr(t,it));version=(t={})=>this.default(ge(K.integer(t),Zo),0);createdAt=t=>ge(ge(K.datetime(t),Qo),it);updatedAt=t=>ge(ge(K.datetime(t),Xo),it);deletedAt=t=>ge(K.optional(K.datetime(t)),Jo);enum=(t,s,r)=>ge(K.enum(t,{description:s?.description,...r}),ea,s);ref=(t,s,r)=>{const o=r??{onDelete:K.schema.isOptional(t)?"set null":"cascade"};return this.attr(t,ta,{ref:s,actions:o})};page=(t,s)=>sa(t,s)}const _c=new Dc;function No(e,t=""){const s=[];if(!e||typeof e!="object")return s;const r="properties"in e?e.properties:e;if(!r||typeof r!="object")return s;for(const[o,i]of Object.entries(r)){if(typeof i!="object"||i===null)continue;const l=i,a=t?`${t}.${o}`:o,u="format"in l?l.format:void 0;let c="type"in l?l.type:"object";u==="date-time"?c="datetime":u==="date"?c="date":u==="time"?c="time":u==="duration"&&(c="duration");const p={name:o,path:a,type:c,format:u,description:"description"in l?l.description:void 0};"enum"in l&&l.enum&&(p.enum=l.enum,p.type="enum"),"type"in l&&l.type==="object"&&"properties"in l&&typeof l.properties=="object"&&(p.nested=No(l.properties,a)),s.push(p),p.nested&&s.push(...p.nested)}return s}const kc={eq:{symbol:"=",label:"equals",example:"name=John"},ne:{symbol:"!=",label:"not equals",example:"status!=archived"},gt:{symbol:">",label:"greater than",example:"age>18"},gte:{symbol:">=",label:"greater or equal",example:"age>=18"},lt:{symbol:"<",label:"less than",example:"age<65"},lte:{symbol:"<=",label:"less or equal",example:"age<=65"},null:{symbol:"=null",label:"is null",example:"deletedAt=null"},notNull:{symbol:"!=null",label:"is not null",example:"email!=null"},in:{symbol:"[...]",label:"in array",example:"status=[active,pending]"}},Mc=({schema:e,value:t="",onChange:s,placeholder:r="Enter query or click for assistance...",...o})=>{const[i,l]=P.useState(!1),[a,u]=P.useState(t),d=P.useRef(null),c=e?No(e):[],[p,f]=P.useState(null),h=w=>{try{jc(w.trim())}catch(x){return f(x.message),!1}return f(null),!0},m=w=>{u(w),h(w)&&s?.(w)},S=()=>{u(""),s?.(""),h("")},v=w=>{const x=a?`${a}${w} `:`${w} `;u(x),h(x)&&s?.(x),setTimeout(()=>{d.current?.focus();const g=d.current?.value.length||0;d.current?.setSelectionRange(g,g)},0)};return un({"form:change":w=>{w.id===d.current?.form?.id&&w.path===o["data-path"]&&u(w.value??"")}},[]),n.jsxs(Pe,{width:800,position:"bottom-start",shadow:"md",opened:i,onChange:l,closeOnClickOutside:!0,closeOnEscape:!0,transitionProps:{transition:"fade-up",duration:200,timingFunction:"ease"},children:[n.jsx(Pe.Target,{children:n.jsx(_r,{ref:d,placeholder:r,value:a,onChange:w=>m(w.currentTarget.value),onFocus:()=>l(!0),leftSection:p?n.jsx(Zi,{size:16}):n.jsx(ro,{size:16}),rightSection:a&&n.jsx(At,{size:"sm",variant:"subtle",color:"gray",onClick:S,children:n.jsx(kr,{size:14})}),...o})}),n.jsx(Pe.Dropdown,{bg:"transparent",p:"xs",bd:`1px solid ${Ge.colors.border}`,style:{backdropFilter:"blur(20px)"},children:n.jsx(Nc,{fields:c,onInsert:v})})]})};function Nc({fields:e,onInsert:t}){return n.jsxs(lt,{gap:"md",align:"flex-start",wrap:"nowrap",bg:Ge.colors.surface,p:"sm",bdrs:"sm",children:[n.jsxs(We,{gap:"md",style:{flex:1},children:[n.jsxs(We,{gap:"xs",children:[n.jsx(ye,{size:"sm",fw:600,children:"Operators"}),n.jsx(We,{gap:4,children:Object.entries(kc).map(([s,r])=>n.jsxs(lt,{gap:"xs",wrap:"nowrap",children:[n.jsx(Ae,{px:"xs",size:"xs",h:24,variant:"default",justify:"center",miw:48,onClick:()=>t(r.symbol),children:r.symbol}),n.jsx(ye,{size:"xs",c:"dimmed",style:{flex:1},children:r.label})]},s))})]}),n.jsx(Xs,{}),n.jsxs(We,{gap:"xs",children:[n.jsx(ye,{size:"sm",fw:600,children:"Logic"}),n.jsxs(We,{gap:4,children:[n.jsxs(lt,{gap:"xs",wrap:"nowrap",children:[n.jsx(Ae,{px:"xs",size:"xs",h:24,variant:"default",justify:"center",miw:48,onClick:()=>t("&"),children:"&"}),n.jsx(ye,{size:"xs",c:"dimmed",children:"AND"})]}),n.jsxs(lt,{gap:"xs",wrap:"nowrap",children:[n.jsx(Ae,{px:"xs",size:"xs",h:24,variant:"default",justify:"center",miw:48,onClick:()=>t("|"),children:"|"}),n.jsx(ye,{size:"xs",c:"dimmed",children:"OR"})]})]})]})]}),e.length>0&&n.jsx(Xs,{orientation:"vertical"}),e.length>0&&n.jsxs(fe,{direction:"column",gap:"xs",style:{flex:2},children:[n.jsx(ye,{size:"sm",fw:600,children:"Fields"}),n.jsx(fe,{direction:"column",gap:4,style:{maxHeight:300,overflowY:"auto"},children:e.map(s=>n.jsxs(fe,{gap:"xs",wrap:"nowrap",align:"flex-start",children:[n.jsx(Ae,{px:"xs",size:"xs",h:24,variant:"default",justify:"end",miw:120,onClick:()=>t(s.path),children:s.path}),n.jsxs(fe,{mt:3,direction:"column",gap:2,style:{flex:1,minWidth:0},children:[n.jsx(ye,{size:"xs",c:"dimmed",lineClamp:1,children:s.description||s.type}),s.enum&&n.jsx(lt,{gap:0,wrap:"wrap",children:s.enum.map(r=>n.jsx(Ae,{px:"xs",size:"xs",h:24,onClick:()=>t(r),children:r},r))})]}),n.jsx(Mr,{size:"xs",variant:"light",style:{flexShrink:0},children:s.type})]},s.path))})]})]})}const br=e=>{const t=vs(e.input),{inputProps:s,id:r,icon:o}=Ft(e,t),i=e.input.schema&&"type"in e.input.schema&&e.input.schema.type==="array";let l;if(i&&"items"in e.input.schema&&e.input.schema.items){const p=e.input.schema.items;"enum"in p&&Array.isArray(p.enum)&&(l=p.enum)}const a=e.input.schema&&"enum"in e.input.schema&&Array.isArray(e.input.schema.enum)?e.input.schema.enum:[],[u,d]=P.useState([]);if(P.useEffect(()=>{e.input?.props&&(e.loader?e.loader().then(d):d(a))},[e.input,e.loader]),!e.input?.props)return null;if(e.segmented){const p=typeof e.segmented=="object"?e.segmented:{};return n.jsx(Fe.Wrapper,{...s,children:n.jsx(fe,{children:n.jsx(ba,{disabled:s.disabled,defaultValue:String(e.input.props.defaultValue),...p,onChange:f=>{e.input.set(f)},data:u.slice(0,10)})})})}if(e.autocomplete){const p=typeof e.autocomplete=="object"?e.autocomplete:{};return n.jsx(gn,{...s,id:r,leftSection:o,data:u,...e.input.props,...p})}if(i&&!l||e.tags){const p=typeof e.tags=="object"?e.tags:{};return n.jsx(Tn,{...s,id:r,leftSection:o,defaultValue:Array.isArray(e.input.props.defaultValue)?e.input.props.defaultValue:[],onChange:f=>{e.input.set(f)},...p})}if(i&&l||e.multi){const p=l?.map(h=>({value:h,label:h}))||[],f=typeof e.multi=="object"?e.multi:{};return n.jsx(Nn,{...s,id:r,leftSection:o,data:p,defaultValue:Array.isArray(e.input.props.defaultValue)?e.input.props.defaultValue:[],onChange:h=>{e.input.set(h)},...f})}const c=typeof e.select=="object"?e.select:{};return n.jsx(Tr,{...s,id:r,leftSection:o,data:u,...e.input.props,...c})},gs=e=>{const t=vs(e.input,["error"]);if(!e.input?.props)return null;const{inputProps:s,id:r,icon:o,format:i,schema:l}=Ft(e,t),a={...e,...l.$control};if(a.query)return n.jsx(Mc,{...a.input.props,...s,schema:a.query,value:a.input.props.value,onChange:m=>{a.input.set(m)}});if(a.custom){const m=a.custom;return n.jsx(Fe.Wrapper,{...s,children:n.jsx(fe,{flex:1,mt:"calc(var(--mantine-spacing-xs) / 2)",children:n.jsx(m,{defaultValue:a.input.props.defaultValue,onChange:S=>{a.input.set(S)}})})})}const u=a.input.schema&&"type"in a.input.schema&&a.input.schema.type==="object"&&"properties"in a.input.schema;if(a.object||u){const m=typeof a.object=="object"?a.object:{};return n.jsx(Sc,{input:a.input,title:a.title,description:a.description,...m})}const d=a.input.schema&&"type"in a.input.schema&&a.input.schema.type==="array",c=d&&"items"in a.input.schema&&a.input.schema.items&&typeof a.input.schema.items=="object"&&"properties"in a.input.schema.items;if(a.array||c){const m=typeof a.array=="object"?a.array:{};return n.jsx(ml,{input:a.input,title:a.title,description:a.description,...m})}if(a.number||a.input.schema&&"type"in a.input.schema&&(a.input.schema.type==="number"||a.input.schema.type==="integer")){const m=typeof a.number=="object"?a.number:{};return n.jsx(wc,{input:a.input,title:a.title,description:a.description,icon:o,...m})}if(a.file){const m=typeof a.file=="object"?a.file:{};return n.jsx(Ua,{...s,id:r,leftSection:o,onChange:S=>{a.input.set(S)},...m})}if(a.color||i==="color"){const m=typeof a.color=="object"?a.color:{};return n.jsx(Sn,{...s,id:r,leftSection:o,...a.input.props,...m})}if(a.input.schema&&"enum"in a.input.schema&&a.input.schema.enum||d&&!c||a.select){const m=typeof a.select=="object"?a.select:{};return n.jsx(br,{input:a.input,title:a.title,description:a.description,icon:o,...m})}if(a.input.schema&&"type"in a.input.schema&&a.input.schema.type==="boolean"){if(a.switch){const S=typeof a.switch=="object"?a.switch:{};return n.jsx(va,{...s,id:r,color:"blue",defaultChecked:a.input.props.defaultValue,...a.input.props,...S})}const m={loader:async()=>[{value:"true",label:"Yes"},{value:"false",label:"No"},{value:"",label:""}],...a.input.props};return n.jsx(br,{input:a.input,title:a.title,description:a.description,icon:o,...m})}if(a.password||a.input.props.name?.includes("password")){const m=typeof a.password=="object"?a.password:{};return n.jsx(In,{...s,id:r,leftSection:o,...a.input.props,...m})}if(a.area){const m=typeof a.area=="object"?a.area:{};return n.jsx(Ca,{...s,id:r,leftSection:o,...a.input.props,...m})}if(a.date||a.datetime||a.time||i==="date"||i==="date-time"||i==="time")return n.jsx(Cc,{input:a.input,title:a.title,description:a.description,icon:o,date:a.date,datetime:a.datetime,time:a.time});const f=typeof a.text=="object"?a.text:{},h=()=>{switch(i){case"email":return"email";case"url":case"uri":return"url";case"tel":case"phone":return"tel";default:return}};return n.jsx(_r,{...s,id:r,leftSection:o,type:h(),...a.input.props,...f,inputWrapperOrder:["label","input","description","error"]})},Lc=e=>{const{form:t,columns:s=3,children:r,controlProps:o,fieldControlProps:i,skipFormElement:l=!1,skipSubmitButton:a=!1,submitButtonProps:u}=e,d=e.schema||t.options.schema;if(!d?.properties)return null;const p=Object.keys(d.properties),f=typeof s=="number"?{xs:12,sm:6,lg:12/s}:{base:s.base?12/s.base:void 0,xs:s.xs?12/s.xs:12,sm:s.sm?12/s.sm:6,md:s.md?12/s.md:void 0,lg:s.lg?12/s.lg:4,xl:s.xl?12/s.xl:void 0},h=()=>r?n.jsx(n.Fragment,{children:r(t.input)}):n.jsx(dt,{children:p.map(S=>{const v=t.input[S],w=d.properties[S];if(!v||!w)return null;const x=w&&"type"in w&&w.type==="object",g=w&&"type"in w&&w.type==="array"&&"items"in w&&w.items&&"properties"in w.items,b=x||g?12:f,y={...o,...i?.[S]};return n.jsx(dt.Col,{span:b,children:n.jsx(gs,{input:v,...y})},S)})}),m=n.jsxs(fe,{direction:"column",gap:"sm",flex:e.fill?1:void 0,...e.flexProps,children:[n.jsx(fe,{direction:"column",gap:"sm",flex:1,children:h()}),!a&&n.jsx(bs,{w:"100%",withBorder:!0,children:n.jsxs(fe,{gap:"sm",flex:1,children:[n.jsx(fe,{}),n.jsx(fe,{flex:1}),n.jsxs(fe,{gap:"sm",children:[n.jsx(Ae,{variant:"subtle",type:"reset",children:"Reset"}),n.jsx(Ae,{intent:"primary",form:t,...u,children:u?.children??"Submit"})]})]})})]});return l?m:n.jsx(fe,{component:"form",flex:e.fill?1:void 0,...t.props,...e.flexProps,children:m})},Ic=({schema:e,form:t,typeFormProps:s,filterVisibility:r})=>{const o=P.useMemo(()=>{const i=Object.keys(e.properties).filter(a=>r[a]!==!1);if(i.length===0)return null;const l=i.reduce((a,u)=>(a[u]=e.properties[u],a),{});return K.object(l)},[e,r]);return o?n.jsx(fe,{w:"100%",p:"xs",bg:Ge.colors.surface,style:{borderBottom:"1px solid var(--alepha-border)"},children:n.jsx(Lc,{...s,skipSubmitButton:!0,fill:!0,form:t,schema:o})}):null},Rc=({page:e,size:t,totalPages:s,onPageChange:r,onSizeChange:o})=>n.jsxs(fe,{align:"center",justify:"end",gap:"md",p:"xs",style:{borderTop:"1px solid var(--alepha-border)"},children:[n.jsx(fe,{children:n.jsx(Tr,{w:96,variant:"default",value:t,onChange:i=>{i&&o(Number(i))},data:[{value:"5",label:"5"},{value:"10",label:"10"},{value:"25",label:"25"},{value:"50",label:"50"},{value:"100",label:"100"}]})}),n.jsx(fe,{children:n.jsx(rt,{withEdges:!0,total:s,value:e,onChange:r})})]}),Tc=({columns:e,visibility:t,onVisibilityChange:s})=>{const[r,o]=P.useState(!1),i=Object.entries(e),l=()=>{const c=i.reduce((p,[f])=>({...p,[f]:!0}),{});s(c)},a=()=>{const c=i.reduce((p,[f])=>({...p,[f]:!1}),{});s(c)},u=(c,p)=>{s({...t,[c]:p})},d=i.filter(([c])=>t[c]!==!1).length;return n.jsxs(Pe,{width:280,position:"bottom-start",shadow:"md",opened:r,onChange:o,closeOnClickOutside:!0,closeOnEscape:!0,transitionProps:{transition:"fade-up",duration:200,timingFunction:"ease"},children:[n.jsx(Pe.Target,{children:n.jsx(Ae,{variant:"subtle",icon:Yi})}),n.jsx(Pe.Dropdown,{bg:"transparent",p:"xs",bd:`1px solid ${Ge.colors.border}`,style:{backdropFilter:"blur(20px)"},children:n.jsxs(We,{gap:"xs",bg:Ge.colors.surface,p:"sm",bdrs:"sm",children:[n.jsxs(lt,{justify:"space-between",children:[n.jsxs(ye,{size:"sm",fw:500,children:["Columns (",d,"/",i.length,")"]}),n.jsxs(lt,{gap:4,children:[n.jsx(ms,{size:"compact-xs",variant:"subtle",onClick:l,children:"All"}),n.jsx(ms,{size:"compact-xs",variant:"subtle",onClick:a,children:"None"})]})]}),n.jsx(qt.Autosize,{mah:300,children:n.jsx(We,{gap:4,children:i.map(([c,p])=>n.jsx(hs,{label:p.label,checked:t[c]!==!1,onChange:f=>u(c,f.currentTarget.checked),size:"sm"},c))})})]})})]})},$c=(e,t)=>{const s=e.properties[t];return s&&typeof s=="object"&&"title"in s&&s.title?s.title:t.replace(/([A-Z])/g," $1").replace(/^./,r=>r.toUpperCase()).trim()},Oc=({schema:e,visibility:t,onVisibilityChange:s})=>{const[r,o]=P.useState(!1),i=Object.keys(e.properties),l=()=>{const c=i.reduce((p,f)=>({...p,[f]:!0}),{});s(c)},a=()=>{const c=i.reduce((p,f)=>({...p,[f]:!1}),{});s(c)},u=(c,p)=>{s({...t,[c]:p})},d=i.filter(c=>t[c]!==!1).length;return n.jsxs(Pe,{width:280,position:"bottom-start",shadow:"md",opened:r,onChange:o,closeOnClickOutside:!0,closeOnEscape:!0,transitionProps:{transition:"fade-up",duration:200,timingFunction:"ease"},children:[n.jsx(Pe.Target,{children:n.jsx(Ae,{variant:"subtle",icon:ro})}),n.jsx(Pe.Dropdown,{bg:"transparent",p:"xs",bd:`1px solid ${Ge.colors.border}`,style:{backdropFilter:"blur(20px)"},children:n.jsxs(We,{gap:"xs",bg:Ge.colors.surface,p:"sm",bdrs:"sm",children:[n.jsxs(lt,{justify:"space-between",children:[n.jsxs(ye,{size:"sm",fw:500,children:["Filters (",d,"/",i.length,")"]}),n.jsxs(lt,{gap:4,children:[n.jsx(ms,{size:"compact-xs",variant:"subtle",onClick:l,children:"All"}),n.jsx(ms,{size:"compact-xs",variant:"subtle",onClick:a,children:"None"})]})]}),n.jsx(qt.Autosize,{mah:300,children:n.jsx(We,{gap:4,children:i.map(c=>n.jsx(hs,{label:$c(e,c),checked:t[c]!==!1,onChange:p=>u(c,p.currentTarget.checked),size:"sm"},c))})})]})})]})},Ac=({columns:e,filters:t,columnVisibility:s,filterVisibility:r,onColumnVisibilityChange:o,onFilterVisibilityChange:i,actions:l,onRefresh:a,selectedItems:u=[],checkboxActions:d,onClearSelection:c})=>{const p=u.length>0,f=async h=>{const m={selectedItems:u,clearSelection:c||(()=>{})};await h.onClick(m)};return n.jsxs(fe,{p:"xs",style:{borderBottom:"1px solid var(--alepha-border)"},children:[n.jsxs(fe,{gap:4,align:"center",children:[t&&n.jsx(Oc,{schema:t,visibility:r,onVisibilityChange:i}),n.jsx(Tc,{columns:e,visibility:s,onVisibilityChange:o}),p&&n.jsxs(n.Fragment,{children:[n.jsx(Xs,{orientation:"vertical",mx:"xs"}),n.jsxs(Mr,{variant:"light",size:"lg",children:[u.length," selected"]}),n.jsx(Ae,{variant:"subtle",size:"compact-sm",icon:kr,onClick:c,children:"Clear"}),d?.map((h,m)=>n.jsx(Ae,{variant:"light",size:"compact-sm",intent:h.intent,icon:h.icon&&na(h.icon)?h.icon:void 0,onClick:()=>f(h),children:h.label},m))]})]}),n.jsx(fe,{flex:1}),n.jsxs(fe,{gap:"xs",children:[l?.map((h,m)=>P.isValidElement(h)?h:n.jsx(Ae,{...h,children:h.label},m)),n.jsx(Ae,{icon:xa,onClick:a,children:"Refresh"})]})]})},Vc=10,Lo=(e,t)=>{if(!e)return null;const s=e.split(",").map(r=>r.trim());for(const r of s){if(r===t)return"asc";if(r===`-${t}`)return"desc"}return null},Fc=(e,t)=>{const s=Lo(e,t),r=(e||"").split(",").map(o=>o.trim()).filter(o=>o&&o!==t&&o!==`-${t}`);return s===null?r.unshift(t):s==="asc"&&r.unshift(`-${t}`),r.length>0?r.join(","):void 0},Ec=e=>{const[t,s]=P.useState(typeof e.items=="function"?{content:[]}:e.items),r=e.infinityScroll?100:e.defaultSize||10,[o,i]=P.useState(1),[l,a]=P.useState(String(r)),[u,d]=P.useState(0),c=Qs(Cr),[p,f]=P.useState(()=>{if(e.defaultColumnVisibility)return e.defaultColumnVisibility;const j=Object.keys(e.columns),C=e.defaultVisibleColumnCount??Vc;return j.reduce((_,k,N)=>({..._,[k]:N<C}),{})}),[h,m]=P.useState(()=>e.defaultFilterVisibility?e.defaultFilterVisibility:e.filters?.properties?Object.keys(e.filters.properties).reduce((j,C)=>({...j,[C]:!0}),{}):{}),S=j=>{f(j),e.onColumnVisibilityChange?.(j)},v=j=>{m(j),e.onFilterVisibilityChange?.(j)},w=P.useMemo(()=>Object.entries(e.columns).filter(([j])=>p[j]!==!1),[e.columns,p]),[x,g]=P.useState(void 0),b=(j,C)=>{const k=Fc(x,C||j);g(k),I.input.sort.set(k),I.input.page.set(0)},[y,D]=P.useState(new Set),M=P.useCallback(j=>e.getItemKey?e.getItemKey(j):JSON.stringify(j),[e.getItemKey]),$=P.useMemo(()=>e.withCheckbox?t.content.filter(j=>y.has(M(j))):[],[t.content,y,M,e.withCheckbox]),O=P.useMemo(()=>t.content.length===0?!1:t.content.every(j=>y.has(M(j))),[t.content,y,M]),z=P.useMemo(()=>{if(t.content.length===0)return!1;const j=t.content.filter(C=>y.has(M(C))).length;return j>0&&j<t.content.length},[t.content,y,M]),A=P.useCallback(j=>{const C=M(j);D(_=>{const k=new Set(_);return k.has(C)?k.delete(C):k.add(C),k})},[M]),Y=P.useCallback(()=>{D(O?j=>{const C=new Set(j);for(const _ of t.content)C.delete(M(_));return C}:j=>{const C=new Set(j);for(const _ of t.content)C.add(M(_));return C})},[O,t.content,M]),B=P.useCallback(()=>{D(new Set)},[]),I=Sa({schema:K.object({...e.filters?e.filters.properties:{},page:K.number({default:0}),size:K.number({default:r}),sort:K.optional(K.string())}),handler:async j=>{if(typeof e.items=="function"){const C=await e.items(j,{items:t.content});e.infinityScroll&&j.page>0?s(_=>({...C,content:[..._.content,...C.content]})):s(C),d(j.page)}},onReset:async()=>{i(1),a("10"),await I.submit()},onChange:async(j,C)=>{if(j==="page"){i(C+1),await I.submit();return}if(j==="size"){a(String(C)),I.input.page.set(0);return}e.onFilterChange?.(j,C,I)}},[t]);ra(()=>I.submit(),{delay:800});const F=Qs(oa);P.useEffect(()=>{if(e.submitOnInit&&I.submit(),e.submitEvery){const j=F.createInterval(()=>{I.submit()},e.submitEvery);return()=>F.clearInterval(j)}},[]),P.useEffect(()=>{typeof e.items!="function"&&s(e.items)},[e.items]),P.useEffect(()=>{if(!e.infinityScroll||typeof e.items!="function")return;const j=()=>{if(I.submitting)return;const C=window.scrollY,_=window.innerHeight,k=document.documentElement.scrollHeight;if(C+_>=k-300){const W=t.page?.totalPages??1;u+1<W&&I.input.page.set(u+1)}};return window.addEventListener("scroll",j),()=>window.removeEventListener("scroll",j)},[e.infinityScroll,I.submitting,t.page?.totalPages,u,I]);const E=e.withCheckbox?n.jsx(ut.Th,{style:{width:40},children:n.jsx(hs,{checked:O,indeterminate:z,onChange:Y,"aria-label":"Select all"})}):null,H=w.map(([j,C])=>{const _=C.sortKey||j,k=C.sortable?Lo(x,_):null,N=n.jsxs(fe,{align:"center",gap:4,children:[n.jsx(ye,{size:"xs",children:C.label}),C.sortable&&n.jsxs(fe,{c:"dimmed",children:[k==="asc"&&n.jsx(ha,{size:Ge.sizes.icon.sm}),k==="desc"&&n.jsx(fa,{size:Ge.sizes.icon.sm}),k===null&&n.jsx(Ti,{size:Ge.sizes.icon.sm})]})]});return n.jsx(ut.Th,{style:{...C.fit?{}:{},...C.sortable?{cursor:"pointer"}:{}},children:C.sortable?n.jsx(nt,{onClick:()=>b(j,C.sortKey),children:N}):N},j)}),R=t.content.map((j,C)=>{const _=e.tableTrProps?e.tableTrProps(j):{},k=M(j),N=y.has(k);return n.jsxs(ut.Tr,{..._,children:[e.withCheckbox&&n.jsx(ut.Td,{style:{width:40},children:n.jsx(hs,{checked:N,onChange:()=>A(j),"aria-label":"Select row"})}),w.map(([W,G])=>n.jsx(ut.Td,{children:G.value(j,{index:C,form:I,alepha:c})},W))]},k)}),T=P.useMemo(()=>e.filters?K.omit(I.options.schema,["page","size","sort"]):null,[e.filters,I.options.schema]);return n.jsxs(fe,{flex:1,p:0,bg:"var(--alepha-elevated)",bdrs:"sm",bd:"1px solid var(--alepha-border)",direction:"column",children:[n.jsx(Ac,{columns:e.columns,filters:e.filters,columnVisibility:p,filterVisibility:h,onColumnVisibilityChange:S,onFilterVisibilityChange:v,actions:e.actions,onRefresh:()=>I.submit(),selectedItems:$,checkboxActions:e.checkboxActions,onClearSelection:B}),T&&e.filters&&n.jsx(Ic,{schema:T,form:I,typeFormProps:e.typeFormProps,filterVisibility:h}),n.jsx(fe,{className:"overflow-auto",children:n.jsxs(ut,{withColumnBorders:!0,withRowBorders:!0,...e.tableProps,children:[n.jsx(ut.Thead,{children:n.jsxs(ut.Tr,{children:[E,H]})}),n.jsx(ut.Tbody,{children:R})]})}),!e.infinityScroll&&n.jsx(Rc,{page:o,size:l,totalPages:t.page?.totalPages??1,onPageChange:j=>{I.input.page.set(j-1)},onSizeChange:j=>{I.input.size.set(j)}})]})},Yc=aa({name:"logs",schema:K.object({id:_c.primaryKey(),level:K.enum(["TRACE","DEBUG","INFO","WARN","ERROR"]),message:K.text({size:"rich"}),service:K.text(),module:K.text(),context:K.optional(K.text()),app:K.optional(K.text()),data:K.optional(K.json()),timestamp:K.integer()})}),iu=()=>{const e=Qs(ia),{l:t}=da(),s=o=>{switch(o.toLowerCase()){case"error":return n.jsx(ye,{ff:"monospace",c:"red",children:o.slice(0,5)});case"warn":return n.jsx(ye,{ff:"monospace",c:"orange",children:o.slice(0,5)});case"info":return n.jsx(ye,{ff:"monospace",c:"green",children:o.slice(0,5)});case"debug":return n.jsx(ye,{ff:"monospace",c:"grape",children:o.slice(0,5)});case"trace":return n.jsx(ye,{ff:"monospace",c:"dimmed",children:o.slice(0,5)});default:return n.jsx(ye,{children:o})}},r=K.object({search:K.optional(K.string({$control:{query:K.omit(Yc.schema,["id"])}})),level:K.optional(K.array(K.enum(["TRACE","DEBUG","INFO","WARN","ERROR"],{$control:{}})))});return n.jsx(Ec,{submitOnInit:!0,infinityScroll:!0,submitEvery:[10,"seconds"],defaultSize:20,typeFormProps:{skipSubmitButton:!0,columns:2},tableProps:{horizontalSpacing:"xs",verticalSpacing:0},onFilterChange:(o,i,l)=>{if(o==="search"||o==="level")return l.submit()},filters:r,tableTrProps:o=>o.level.toLowerCase()==="error"?{bg:"rgba(255,0,0,0.1)"}:o.level.toLowerCase()==="warn"?{bg:"rgba(255,153,0,0.1)"}:{},items:async(o,i)=>{if(o.search&&(o.search=o.search.replace("now()",new Date().toISOString())),o.page&&o.page>0){const u=`timestamp < ${i.items[0].timestamp}`;o.search?o.search+=`& ${u}`:o.search=u}if(o.level){const u=o.level.map(d=>`level = ${d}`).join(" | ");o.search?o.search+=`& (${u})`:o.search=u}const l=new URLSearchParams(o).toString();return(await e.fetch(`/devtools/api/logs?${l}`,{schema:{response:K.page(ca)}})).data},columns:{timestamp:{label:"timestamp",value:(o,{form:i})=>n.jsx(Ae,{intent:"none",variant:"transparent",h:20,size:"xs",tooltip:t(o.timestamp,{date:"DD MMM YYYY HH:mm:ss.SSS"}),onClick:()=>{const l=Gn(o.timestamp).subtract(1,"minute"),a=Gn(o.timestamp).add(1,"minute");i.input.search.set(`timestamp >= ${l.toISOString()} & timestamp <= ${a.toISOString()}`)},children:t(o.timestamp,{date:"HH:mm:ss.SSS"})})},level:{label:"level",value:o=>s(o.level)},app:{label:"app",value:o=>o.app},context:{fit:!0,label:"context",value:(o,{form:i})=>o.context&&n.jsx(Ae,{intent:"none",variant:"transparent",h:20,size:"xs",onClick:()=>{i.input.search.set(`context = ${o.context}`)},children:n.jsx(ye,{ff:"monospace",size:"xs",children:o.context.replaceAll("-","").slice(0,10)})})},service:{fit:!0,label:"service",value:o=>n.jsxs(fe,{align:"center",justify:"end",children:[o.module&&n.jsxs(ye,{c:"dimmed",size:"xs",children:[o.module,"."]}),n.jsx(ye,{size:"sm",children:o.service})]})},message:{label:"message",value:o=>o.data?.ms&&o.data.status?`${o.message} - ${o.data.status} [${o.data.ms}ms]`:o.data?.path&&o.data.method?`${o.message} - ${o.data.method} ${o.data.path}`:o.message},data:{label:"more",value:(o,{alepha:i})=>{if(o.data&&Object.keys(o.data).length!==0)return n.jsx(Ae,{opacity:.5,h:20,px:4,size:"xs",fw:"bold",onClick:()=>i.inject(la).json(o.data),children:"{ ... }"})}}}})};export{iu as default};
@@ -0,0 +1 @@
1
+ import{f as p,b as y,q as b,s as g,j as x,B as R,a1 as T,t as f}from"./entry.Bkwg306k.js";var c={root:"m_7341320d"};const I=g((e,{size:a,radius:t,variant:s,gradient:i,color:o,autoContrast:l})=>{const r=e.variantColorResolver({color:o||e.primaryColor,theme:e,gradient:i,variant:s||"filled",autoContrast:l});return{root:{"--ti-size":f(a,"ti-size"),"--ti-radius":t===void 0?void 0:T(t),"--ti-bg":o||s?r.background:void 0,"--ti-color":o||s?r.color:void 0,"--ti-bd":o||s?r.border:void 0}}}),n=p((e,a)=>{const t=y("ThemeIcon",null,e),{classNames:s,className:i,style:o,styles:l,unstyled:r,vars:d,autoContrast:h,attributes:m,...u}=t,v=b({name:"ThemeIcon",classes:c,props:t,className:i,style:o,classNames:s,styles:l,unstyled:r,attributes:m,vars:d,varsResolver:I});return x.jsx(R,{ref:a,...v("root"),...u})});n.classes=c;n.displayName="@mantine/core/ThemeIcon";export{n as T};
@@ -0,0 +1 @@
1
+ import{at as oe,Y as re,a$ as De,r as f,A as z,b4 as je,aK as ke,x as Ie,b5 as Te,p as H,b as M,j as s,T as Ae,d as Pe,c as Ee,f as B,B as se,ay as K,aw as Ne,i as q,ah as ie,b6 as ae,U as ce,b7 as Re,$ as Le,b8 as Fe,q as Oe,a0 as _e,av as Be,a2 as Ke,aZ as $e,H as Ve,F as te,ad as ze,a5 as R,G as He,aa as qe}from"./entry.Bkwg306k.js";import{T as le}from"./chunk.CKmrGczh.js";import{f as Ue,c as ue}from"./chunk.BlqFPyLh.js";import{P as L}from"./chunk.CkWIENRP.js";import{A as Ge}from"./chunk.D4_B6m39.js";function de(t,o){const n=oe(),r=re(De),[a,i]=f.useState(!1),[e,c]=f.useState(),l=f.useRef(!1),u=f.useRef(void 0),d=f.useRef(void 0),y=f.useRef(!0),m=f.useRef(void 0);f.useEffect(()=>()=>{y.current=!1,u.current&&(r.clearTimeout(u.current),u.current=void 0),m.current&&(r.clearInterval(m.current),m.current=void 0),d.current&&(d.current.abort(),d.current=void 0)},[]);const v=f.useCallback(async(...g)=>{if(l.current)return;d.current&&d.current.abort();const b=new AbortController;d.current=b,l.current=!0,i(!0),c(void 0),await n.events.emit("react:action:begin",{type:"custom",id:t.id});try{const x=await t.handler(...g,{signal:b.signal});return!y.current||b.signal.aborted?void 0:(await n.events.emit("react:action:success",{type:"custom",id:t.id}),t.onSuccess&&await t.onSuccess(x),x)}catch(x){if(x instanceof Error&&x.name==="AbortError"||!y.current)return;const p=x;if(c(p),await n.events.emit("react:action:error",{type:"custom",id:t.id,error:p}),t.onError)await t.onError(p);else throw p}finally{l.current=!1,i(!1),await n.events.emit("react:action:end",{type:"custom",id:t.id}),d.current===b&&(d.current=void 0)}},[...o,t.id,t.onError,t.onSuccess]),w=f.useCallback(async(...g)=>t.debounce?(u.current&&r.clearTimeout(u.current),new Promise(b=>{u.current=r.createTimeout(async()=>{const x=await v(...g);b(x)},t.debounce??0)})):v(...g),[v,t.debounce]),h=f.useCallback(()=>{u.current&&(r.clearTimeout(u.current),u.current=void 0),d.current&&(d.current.abort(),d.current=void 0),y.current&&(l.current=!1,i(!1))},[]);return f.useEffect(()=>{t.runOnInit&&w()},o),f.useEffect(()=>{if(t.runEvery)return m.current=r.createInterval(()=>w(),t.runEvery,!0),()=>{m.current&&(r.clearInterval(m.current),m.current=void 0)}},[w,t.runEvery]),{run:w,loading:a,error:e,cancel:h}}const We=t=>{const o=z(),[n,r]=f.useState(!1);je().url.pathname;const i=typeof t=="string"?{href:t}:{...t,href:t.href},e=i.href,c=o.isActive(e,i);return{isPending:n,isActive:c,anchorProps:{href:o.base(e),onClick:async l=>{if(l?.stopPropagation(),l?.preventDefault(),!c&&!n){r(!0);try{await o.go(e)}finally{r(!1)}}}}}},me=(t,o=["loading","dirty","error"])=>{const n=oe(),r=o,[a,i]=f.useState(!1),[e,c]=f.useState(!1),[l,u]=f.useState(void 0),[d,y]=f.useState(void 0),m="form"in t?t.form:t,v="path"in t?t.path:void 0,w=r.includes("values"),h=r.includes("error"),g=r.includes("dirty"),b=r.includes("loading");return f.useEffect(()=>{const x=[];return(h||w||g)&&x.push(n.events.on("form:change",p=>{p.id===m.id&&((!v||p.path===v)&&(g&&i(!0),h&&u(void 0)),w&&y(m.currentValues))})),w&&x.push(n.events.on("form:reset",p=>{p.id===m.id&&y(p.values)})),b&&x.push(n.events.on("form:submit:begin",p=>{p.id===m.id&&c(!0)}),n.events.on("form:submit:end",p=>{p.id===m.id&&c(!1)})),(w||g)&&x.push(n.events.on("form:submit:success",p=>{p.id===m.id&&(w&&y(p.values),g&&i(!1))})),h&&x.push(n.events.on("form:submit:error",p=>{p.id===m.id&&(!v||p.error instanceof ke&&p.error.value.path===v)&&u(p.error)})),()=>{for(const p of x)p()}},[]),{dirty:a,loading:e,error:l,values:d}},ht=()=>(Ie("alepha.react.i18n.lang"),re(Te));function C(t,o){return n=>{t?.(n),o?.(n)}}function Ye(t,o,n){return n?Array.from(Ue(n,o)?.querySelectorAll(t)||[]).findIndex(r=>r===n):null}function Ze(t=!1,o={}){const[n,r]=f.useState(t),a=f.useCallback(()=>{r(c=>c||(o.onOpen?.(),!0))},[o.onOpen]),i=f.useCallback(()=>{r(c=>c&&(o.onClose?.(),!1))},[o.onClose]),e=f.useCallback(()=>{n?i():a()},[i,a,n]);return[n,{open:a,close:i,toggle:e}]}function fe({open:t,close:o,openDelay:n,closeDelay:r}){const a=f.useRef(-1),i=f.useRef(-1),e=()=>{window.clearTimeout(a.current),window.clearTimeout(i.current)},c=()=>{e(),n===0||n===void 0?t():a.current=window.setTimeout(t,n)},l=()=>{e(),r===0||r===void 0?o():i.current=window.setTimeout(o,r)};return f.useEffect(()=>e,[]),{openDropdown:c,closeDropdown:l}}var he={root:"m_849cf0da"};const Je={underline:"hover"},U=H((t,o)=>{const{underline:n,className:r,unstyled:a,mod:i,...e}=M("Anchor",Je,t);return s.jsx(Ae,{component:"a",ref:o,className:Pe({[he.root]:!a},r),...e,mod:[{underline:n},i],__staticSelector:"Anchor",unstyled:a})});U.classes=he;U.displayName="@mantine/core/Anchor";const[Qe,k]=Ee("Menu component was not found in the tree");var I={dropdown:"m_dc9b7c9f",label:"m_9bfac126",divider:"m_efdf90cb",item:"m_99ac2aa1",itemLabel:"m_5476e0d3",itemSection:"m_8b75e504",chevron:"m_b85b0bed"};const G=B((t,o)=>{const{classNames:n,className:r,style:a,styles:i,vars:e,...c}=M("MenuDivider",null,t),l=k();return s.jsx(se,{ref:o,...l.getStyles("divider",{className:r,style:a,styles:i,classNames:n}),...c})});G.classes=I;G.displayName="@mantine/core/MenuDivider";const W=B((t,o)=>{const{classNames:n,className:r,style:a,styles:i,vars:e,onMouseEnter:c,onMouseLeave:l,onKeyDown:u,children:d,...y}=M("MenuDropdown",null,t),m=f.useRef(null),v=k(),w=C(u,b=>{(b.key==="ArrowUp"||b.key==="ArrowDown")&&(b.preventDefault(),m.current?.querySelectorAll("[data-menu-item]:not(:disabled)")[0]?.focus())}),h=C(c,()=>(v.trigger==="hover"||v.trigger==="click-hover")&&v.openDropdown()),g=C(l,()=>(v.trigger==="hover"||v.trigger==="click-hover")&&v.closeDropdown());return s.jsxs(L.Dropdown,{...y,onMouseEnter:h,onMouseLeave:g,role:"menu","aria-orientation":"vertical",ref:K(o,m),...v.getStyles("dropdown",{className:r,style:a,styles:i,classNames:n,withStaticClass:!1}),tabIndex:-1,"data-menu-dropdown":!0,onKeyDown:w,children:[v.withInitialFocusPlaceholder&&s.jsx("div",{tabIndex:-1,"data-autofocus":!0,"data-mantine-stop-propagation":!0,style:{outline:0}}),d]})});W.classes=I;W.displayName="@mantine/core/MenuDropdown";const[Xe,$]=Ne(),Y=H((t,o)=>{const{classNames:n,className:r,style:a,styles:i,vars:e,color:c,closeMenuOnClick:l,leftSection:u,rightSection:d,children:y,disabled:m,"data-disabled":v,...w}=M("MenuItem",null,t),h=k(),g=$(),b=q(),{dir:x}=ie(),p=f.useRef(null),D=w,T=C(D.onClick,()=>{v||(typeof l=="boolean"?l&&h.closeDropdownImmediately():h.closeOnItemClick&&h.closeDropdownImmediately())}),j=c?b.variantColorResolver({color:c,theme:b,variant:"light"}):void 0,A=c?ae({color:c,theme:b}):null,O=C(D.onKeyDown,P=>{P.key==="ArrowLeft"&&g&&(g.close(),g.focusParentItem())});return s.jsxs(ce,{onMouseDown:P=>P.preventDefault(),...w,unstyled:h.unstyled,tabIndex:h.menuItemTabIndex,...h.getStyles("item",{className:r,style:a,styles:i,classNames:n}),ref:K(p,o),role:"menuitem",disabled:m,"data-menu-item":!0,"data-disabled":m||v||void 0,"data-mantine-stop-propagation":!0,onClick:T,onKeyDown:ue({siblingSelector:"[data-menu-item]:not([data-disabled])",parentSelector:"[data-menu-dropdown]",activateOnFocus:!1,loop:h.loop,dir:x,orientation:"vertical",onKeyDown:O}),__vars:{"--menu-item-color":A?.isThemeColor&&A?.shade===void 0?`var(--mantine-color-${A.color}-6)`:j?.color,"--menu-item-hover":j?.hover},children:[u&&s.jsx("div",{...h.getStyles("itemSection",{styles:i,classNames:n}),"data-position":"left",children:u}),y&&s.jsx("div",{...h.getStyles("itemLabel",{styles:i,classNames:n}),children:y}),d&&s.jsx("div",{...h.getStyles("itemSection",{styles:i,classNames:n}),"data-position":"right",children:d})]})});Y.classes=I;Y.displayName="@mantine/core/MenuItem";const Z=B((t,o)=>{const{classNames:n,className:r,style:a,styles:i,vars:e,...c}=M("MenuLabel",null,t),l=k();return s.jsx(se,{ref:o,...l.getStyles("label",{className:r,style:a,styles:i,classNames:n}),...c})});Z.classes=I;Z.displayName="@mantine/core/MenuLabel";const J=B((t,o)=>{const{classNames:n,className:r,style:a,styles:i,vars:e,onMouseEnter:c,onMouseLeave:l,onKeyDown:u,children:d,...y}=M("MenuSubDropdown",null,t),m=f.useRef(null),v=k(),w=$(),h=C(c,w?.open),g=C(l,w?.close);return s.jsx(L.Dropdown,{...y,onMouseEnter:h,onMouseLeave:g,role:"menu","aria-orientation":"vertical",ref:K(o,m),...v.getStyles("dropdown",{className:r,style:a,styles:i,classNames:n,withStaticClass:!1}),tabIndex:-1,"data-menu-dropdown":!0,children:d})});J.classes=I;J.displayName="@mantine/core/MenuSubDropdown";const Q=H((t,o)=>{const{classNames:n,className:r,style:a,styles:i,vars:e,color:c,leftSection:l,rightSection:u,children:d,disabled:y,"data-disabled":m,closeMenuOnClick:v,...w}=M("MenuSubItem",null,t),h=k(),g=$(),b=q(),{dir:x}=ie(),p=f.useRef(null),D=w,T=c?b.variantColorResolver({color:c,theme:b,variant:"light"}):void 0,j=c?ae({color:c,theme:b}):null,A=C(D.onKeyDown,N=>{N.key==="ArrowRight"&&(g?.open(),g?.focusFirstItem()),N.key==="ArrowLeft"&&g?.parentContext&&(g.parentContext.close(),g.parentContext.focusParentItem())}),O=C(D.onClick,()=>{!m&&v&&h.closeDropdownImmediately()}),P=C(D.onMouseEnter,g?.open),E=C(D.onMouseLeave,g?.close);return s.jsxs(ce,{onMouseDown:N=>N.preventDefault(),...w,unstyled:h.unstyled,tabIndex:h.menuItemTabIndex,...h.getStyles("item",{className:r,style:a,styles:i,classNames:n}),ref:K(p,o),role:"menuitem",disabled:y,"data-menu-item":!0,"data-sub-menu-item":!0,"data-disabled":y||m||void 0,"data-mantine-stop-propagation":!0,onMouseEnter:P,onMouseLeave:E,onClick:O,onKeyDown:ue({siblingSelector:"[data-menu-item]:not([data-disabled])",parentSelector:"[data-menu-dropdown]",activateOnFocus:!1,loop:h.loop,dir:x,orientation:"vertical",onKeyDown:A}),__vars:{"--menu-item-color":j?.isThemeColor&&j?.shade===void 0?`var(--mantine-color-${j.color}-6)`:T?.color,"--menu-item-hover":T?.hover},children:[l&&s.jsx("div",{...h.getStyles("itemSection",{styles:i,classNames:n}),"data-position":"left",children:l}),d&&s.jsx("div",{...h.getStyles("itemLabel",{styles:i,classNames:n}),children:d}),s.jsx("div",{...h.getStyles("itemSection",{styles:i,classNames:n}),"data-position":"right",children:u||s.jsx(Ge,{...h.getStyles("chevron"),size:14})})]})});Q.classes=I;Q.displayName="@mantine/core/MenuSubItem";function pe({children:t,refProp:o}){if(!Re(t))throw new Error("Menu.Sub.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");return k(),s.jsx(L.Target,{refProp:o,popupType:"menu",children:t})}pe.displayName="@mantine/core/MenuSubTarget";const et={offset:0,position:"right-start",transitionProps:{duration:0},openDelay:0,middlewares:{shift:{crossAxis:!0}}};function F(t){const{children:o,closeDelay:n,openDelay:r,...a}=M("MenuSub",et,t),i=Le(),[e,{open:c,close:l}]=Ze(!1),u=$(),{openDropdown:d,closeDropdown:y}=fe({open:c,close:l,closeDelay:n,openDelay:r}),m=()=>window.setTimeout(()=>{document.getElementById(`${i}-dropdown`)?.querySelectorAll("[data-menu-item]:not([data-disabled])")[0]?.focus()},16),v=()=>window.setTimeout(()=>{document.getElementById(`${i}-target`)?.focus()},16);return s.jsx(Xe,{value:{opened:e,close:y,open:d,focusFirstItem:m,focusParentItem:v,parentContext:u},children:s.jsx(L,{opened:e,withinPortal:!1,withArrow:!1,id:i,...a,children:o})})}F.extend=t=>t;F.displayName="@mantine/core/MenuSub";F.Target=pe;F.Dropdown=J;F.Item=Q;const tt={refProp:"ref"},ve=f.forwardRef((t,o)=>{const{children:n,refProp:r,...a}=M("MenuTarget",tt,t),i=Fe(n);if(!i)throw new Error("Menu.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");const e=k(),c=i.props,l=C(c.onClick,()=>{e.trigger==="click"?e.toggleDropdown():e.trigger==="click-hover"&&(e.setOpenedViaClick(!0),e.opened||e.openDropdown())}),u=C(c.onMouseEnter,()=>(e.trigger==="hover"||e.trigger==="click-hover")&&e.openDropdown()),d=C(c.onMouseLeave,()=>{(e.trigger==="hover"||e.trigger==="click-hover"&&!e.openedViaClick)&&e.closeDropdown()});return s.jsx(L.Target,{refProp:r,popupType:"menu",ref:o,...a,children:f.cloneElement(i,{onClick:l,onMouseEnter:u,onMouseLeave:d,"data-expanded":e.opened?!0:void 0})})});ve.displayName="@mantine/core/MenuTarget";const nt={trapFocus:!0,closeOnItemClick:!0,withInitialFocusPlaceholder:!0,clickOutsideEvents:["mousedown","touchstart","keydown"],loop:!0,trigger:"click",openDelay:0,closeDelay:100,menuItemTabIndex:-1};function S(t){const o=M("Menu",nt,t),{children:n,onOpen:r,onClose:a,opened:i,defaultOpened:e,trapFocus:c,onChange:l,closeOnItemClick:u,loop:d,closeOnEscape:y,trigger:m,openDelay:v,closeDelay:w,classNames:h,styles:g,unstyled:b,variant:x,vars:p,menuItemTabIndex:D,keepMounted:T,withInitialFocusPlaceholder:j,attributes:A,...O}=o,P=Oe({name:"Menu",classes:I,props:o,classNames:h,styles:g,unstyled:b,attributes:A}),[E,N]=_e({value:i,defaultValue:e,finalValue:!1,onChange:l}),[ye,X]=f.useState(!1),_=()=>{N(!1),X(!1),E&&a?.()},V=()=>{N(!0),!E&&r?.()},ee=()=>{E?_():V()},{openDropdown:be,closeDropdown:we}=fe({open:V,close:_,closeDelay:w,openDelay:v}),xe=Me=>Ye("[data-menu-item]","[data-menu-dropdown]",Me),{resolvedClassNames:Se,resolvedStyles:Ce}=Be({classNames:h,styles:g,props:o});return s.jsx(Qe,{value:{getStyles:P,opened:E,toggleDropdown:ee,getItemIndex:xe,openedViaClick:ye,setOpenedViaClick:X,closeOnItemClick:u,closeDropdown:m==="click"?_:we,openDropdown:m==="click"?V:be,closeDropdownImmediately:_,loop:d,trigger:m,unstyled:b,menuItemTabIndex:D,withInitialFocusPlaceholder:j},children:s.jsx(L,{returnFocus:!0,...O,opened:E,onChange:ee,defaultOpened:e,trapFocus:T?!1:c,closeOnEscape:y,__staticSelector:"Menu",classNames:Se,styles:Ce,unstyled:b,variant:x,keepMounted:T,children:n})})}S.extend=t=>t;S.withProps=Ke(S);S.classes=I;S.displayName="@mantine/core/Menu";S.Item=Y;S.Label=Z;S.Dropdown=W;S.Target=ve;S.Divider=G;S.Sub=F;const ge=t=>{const{item:o,index:n}=t,r=z(),a=de({handler:async e=>{await o.onClick?.()}},[o.onClick]);if(o.type==="divider")return s.jsx(S.Divider,{},n);if(o.type==="label")return s.jsx(S.Label,{children:o.label},n);if(o.children&&o.children.length>0)return s.jsxs(S,{trigger:"hover",position:"right-start",offset:2,children:[s.jsx(S.Target,{children:s.jsx(S.Item,{leftSection:o.icon,rightSection:s.jsx(He,{size:14}),children:o.label})}),s.jsx(S.Dropdown,{children:o.children.map((e,c)=>s.jsx(ge,{item:e,index:c},c))})]},n);const i={};return t.item.onClick?i.onClick=a.run:t.item.href&&Object.assign(i,r.anchor(t.item.href)),s.jsx(S.Item,{leftSection:o.icon,onClick:o.onClick,color:o.color,rightSection:o.active?s.jsx(le,{size:"xs",variant:"transparent",children:s.jsx(qe,{})}):void 0,...i,children:o.label},n)},ne=t=>{const o=q(),n={...t},{tooltip:r,menu:a,icon:i,...e}=n;if(n.variant==="subtle"&&(e.c??="var(--mantine-color-text)",e.color??="gray"),n.intent&&(n.intent==="none"?(e.c??="var(--mantine-color-text)",e.color??="gray"):n.intent==="primary"?(e.c??="white",e.color??=o.primaryColor):n.intent==="success"?(e.c??="white",e.color??="green"):n.intent==="danger"?(e.c??="white",e.color??="red"):n.intent==="warning"?(e.c??="var(--mantine-color-text)",e.color??="yellow"):n.intent==="info"&&(e.c??="white",e.color??="blue")),n.icon){const u=$e(n.icon)?s.jsx(n.icon,{size:Ve.sizes.icon.md}):s.jsx(le,{w:24,variant:"transparent",size:"sm",c:"var(--mantine-color-text)",...n.themeIconProps,children:n.icon});n.children?e.leftSection=u:(e.children=f.Children.only(u),e.px??="xs")}if(n.leftSection&&!n.children&&(e.px??="xs"),n.textVisibleFrom){const{children:u,textVisibleFrom:d,leftSection:y,...m}=e;return s.jsxs(s.Fragment,{children:[s.jsx(te,{w:"100%",visibleFrom:d,children:s.jsx(ne,{flex:1,...m,leftSection:y,tooltip:r,menu:a,children:u})}),s.jsx(te,{w:"100%",hiddenFrom:d,children:s.jsx(ne,{px:"xs",...m,tooltip:r,menu:a,children:y})})]})}let l="href"in e&&e.href?e.href.startsWith("http")||e.target?s.jsx(ct,{...e,href:e.href,children:e.children}):s.jsx(at,{...e,href:e.href,children:e.children}):(delete e.classNameActive,delete e.variantActive,"action"in e&&e.action?s.jsx(st,{...e,action:e.action,children:e.children}):"onClick"in e&&e.onClick?s.jsx(it,{...e,onClick:e.onClick,children:e.children}):"form"in e&&e.form?e.type==="reset"?s.jsx(rt,{...e,form:e.form,children:e.children}):s.jsx(ot,{...e,form:e.form,children:e.children}):s.jsx(R,{...e,children:e.children}));if(a&&(l=s.jsxs(S,{position:a.position||"bottom-start",width:a.width||200,shadow:a.shadow||"md",trigger:a.on==="hover"?"hover":"click",...a.menuProps,children:[s.jsx(S.Target,{...a.targetProps,children:l}),s.jsx(S.Dropdown,{children:a.items.map((u,d)=>s.jsx(ge,{item:u,index:d},d))})]})),r){const u={openDelay:1e3},d=typeof r=="string"||typeof r=="number"?{...u,label:r,children:l}:{...u,...r,children:l};return s.jsx(ze,{...d})}return l},ot=t=>{const{form:o,...n}=t,r=me(o);return s.jsx(R,{...n,loading:r.loading,disabled:r.loading,type:"submit",children:t.children})},rt=t=>{const{form:o,...n}=t,r=me(o);return s.jsx(R,{...n,disabled:r.loading,type:"reset",children:t.children})},st=t=>{const{action:o,...n}=t;return s.jsx(R,{...n,disabled:o.loading||t.disabled,loading:o.loading,onClick:()=>o.run(),children:t.children})},it=t=>{const o=de({handler:async n=>{await t.onClick(n)}},[t.onClick]);return s.jsx(R,{...t,disabled:o.loading||t.disabled,loading:o.loading,onClick:o.run,children:t.children})},at=t=>{const{active:o,classNameActive:n,variantActive:r,routerGoOptions:a,...i}=t,e=z(),{isPending:c,isActive:l}=We(o?{href:t.href,...o}:{href:t.href}),u=e.anchor(t.href,a),d=i.className||"";return l&&o!==!1&&n&&(i.className=`${d} ${n}`.trim()),t.anchorProps?s.jsx(U,{component:"a",...u,...t.anchorProps,children:t.children}):s.jsx(R,{component:"a",loading:c,...i,...u,variant:l&&o!==!1?r??"filled":i.variant??"subtle",children:t.children})},ct=t=>{const{active:o,classNameActive:n,variantActive:r,routerGoOptions:a,target:i,...e}=t;return s.jsx(R,{component:"a",target:i,...e,children:t.children})};export{ne as A,Ze as a,me as b,C as c,ht as u};
@@ -0,0 +1 @@
1
+ import{w as e}from"./entry.Bkwg306k.js";const a=[["path",{d:"M3 4m0 3a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v2a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3z",key:"svg-0"}],["path",{d:"M3 12m0 3a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v2a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3z",key:"svg-1"}],["path",{d:"M7 8l0 .01",key:"svg-2"}],["path",{d:"M7 16l0 .01",key:"svg-3"}]],o=e("outline","server","Server",a);export{o as I};