Files
MultiRoombaRover/server/public/assets/AdminApp-Dcx9Tr8a.js
T
2026-09-14 19:09:02 -04:00

67 lines
527 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import{e as Rh,r as X,j as N,C as Ze,T as $h,f as Fh,h as Kn,k as Dh,l as hi,L as kl,g as Fi,u as Ip,a as Nl,m as Rp,b as $p,D as Fp,c as Dp,S as Tp,A as Mp,n as qp}from"./index-ClagM2Tt.js";import{c as Up,d as Lp,u as Vp,r as zp,a as Bp,g as Hp,b as Kp,e as Gp,f as Wp,h as Jp,i as Yp,j as Xp,k as Zp}from"./api-BVIrbPAA.js";function br(e,t,r={}){return new Promise((n,s)=>{e.emit(t,r,(i={})=>{if(i.error){s(new Error(i.error));return}n(i)})})}function Qp(e){return br(e,"identityAdmin:listUsers")}function Il(e,t){return br(e,"identityAdmin:getUser",{userId:t})}function ey(e,t,r,n){return br(e,"identityAdmin:addSignal",{userId:t,type:r,value:n})}function ty(e,t,r,n){return br(e,"identityAdmin:removeSignal",{userId:t,type:r,value:n})}function ry(e,t,r){return br(e,"identityAdmin:setVerified",{userId:t,enabled:r})}function ny(e,t,r,n){return br(e,"identityAdmin:setDeterrence",{userId:t,enabled:r,reason:n})}function iy(e,t,r){return br(e,"identityAdmin:setMuted",{userId:t,enabled:r})}function sy(e,t,r,n){return br(e,"identityAdmin:setPermission",{userId:t,permissionKey:r,enabled:n})}function ay(e,t,r,n){return br(e,"identityAdmin:updateFeatureState",{userId:t,namespace:r,value:n})}function oy(e,t,r){return br(e,"identityAdmin:deleteFeatureState",{userId:t,namespace:r})}const fc={cookieUserId:"Cookie keys",fingerprintId:"Fingerprints",nickname:"Nicknames",knownIp:"Known IPs"},cy={cookieUserId:"cookieUserIds",fingerprintId:"fingerprintIds",nickname:"nicknames",knownIp:"knownIps"};function Rl(e){const t=String(e||"").trim();return t?t.length<=14?t:`${t.slice(0,8)}...${t.slice(-6)}`:"n/a"}function ja(e){const t=Number(e||0);if(!Number.isFinite(t)||t<=0)return"never";try{return new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}).format(new Date(t))}catch{return new Date(t).toLocaleString()}}function ly(e,t){const r=String(t||"").trim().toLowerCase();return r?[e?.id,e?.nickname,...e?.cookieUserIds||[],...e?.fingerprintIds||[],...e?.nicknames||[],...e?.knownIps||[],...e?.featureNamespaces||[],...(e?.permissions||[]).map(s=>s.key)].join(" ").toLowerCase().includes(r):!0}function uy(e,t){return t==="verified"?!!e?.verified?.enabled:t==="deterred"?!!e?.deterrence?.enabled:t==="muted"?!!e?.deterrence?.muted:t==="unverified"?!e?.verified?.enabled:!0}function hc(e){return JSON.stringify(e??{},null,2)}function dy(e){const t=JSON.parse(String(e||"").trim()||"{}");if(!t||typeof t!="object")throw new Error("JSON must be an object or array.");return t}const fy=[{key:"all",label:"All"},{key:"verified",label:"Verified"},{key:"deterred",label:"Deterred"},{key:"muted",label:"Muted"},{key:"unverified",label:"Unverified"}];function vo({active:e,children:t}){return N.jsx("span",{className:`rounded px-1 py-0.25 text-[0.68rem] font-semibold ${e?"bg-emerald-700 text-emerald-50":"bg-neutral-800 text-neutral-300"}`,children:t})}function hy({users:e,selectedUserId:t,query:r,filter:n,loading:s,onQuery:i,onFilter:a,onRefresh:o,onSelect:c}){const l=X.useMemo(()=>e.filter(m=>uy(m,n)&&ly(m,r)),[n,r,e]),u=N.jsx("button",{type:"button",className:"button-dark text-xs",onClick:o,disabled:s,children:s?"Loading":"Refresh"});return N.jsxs(Ze,{title:"Identity database",meta:l.length,actions:u,bodyClassName:"flex min-h-0 flex-col gap-0.5 p-0.5 text-sm",children:[N.jsxs("div",{className:"grid gap-0.5 md:grid-cols-[minmax(0,1fr)_10rem]",children:[N.jsx("input",{className:"field-input text-sm",type:"search",placeholder:"Search users, keys, fingerprints, IPs",value:r,onChange:m=>i(m.target.value)}),N.jsx("select",{className:"field-input text-sm",value:n,onChange:m=>a(m.target.value),children:fy.map(m=>N.jsx("option",{value:m.key,children:m.label},m.key))})]}),N.jsx("div",{className:"min-h-[18rem] flex-1 overflow-y-auto",children:l.length?l.map(m=>N.jsxs("button",{type:"button",className:`surface mb-0.5 grid w-full grid-cols-[minmax(0,1fr)_auto] gap-0.5 px-1 py-0.75 text-left text-xs ${t===m.id?"border border-sky-400/70":""}`,onClick:()=>c(m.id),children:[N.jsxs("span",{className:"min-w-0",children:[N.jsx("span",{className:"block truncate text-sm font-semibold text-slate-100",children:m.nickname||"unknown user"}),N.jsx("span",{className:"block truncate font-mono text-[0.68rem] text-slate-400",children:m.id}),N.jsxs("span",{className:"block truncate text-[0.68rem] text-slate-400",children:[Rl(m.cookieUserIds?.[0])," / ",Rl(m.fingerprintIds?.[0])]})]}),N.jsxs("span",{className:"flex flex-col items-end gap-0.25",children:[N.jsx(vo,{active:m.verified?.enabled,children:"verified"}),N.jsx(vo,{active:m.deterrence?.enabled,children:"deterred"}),N.jsx(vo,{active:m.deterrence?.muted,children:"muted"})]})]},m.id)):N.jsx("p",{className:"surface p-1 text-center text-xs text-slate-400",children:"No users match this view."})})]})}function my({user:e}){return N.jsxs(Ze,{title:"User details",bodyClassName:"grid gap-0.5 p-0.5 text-sm md:grid-cols-2",children:[N.jsxs("div",{className:"surface px-1 py-0.75",children:[N.jsx("p",{className:"text-xs text-slate-400",children:"Canonical user id"}),N.jsx("p",{className:"break-all font-mono text-xs text-lime-300",children:e.id})]}),N.jsxs("div",{className:"surface px-1 py-0.75",children:[N.jsx("p",{className:"text-xs text-slate-400",children:"Primary nickname"}),N.jsx("p",{className:"font-semibold text-slate-100",children:e.nickname||"unknown user"})]}),N.jsxs("div",{className:"surface px-1 py-0.75",children:[N.jsx("p",{className:"text-xs text-slate-400",children:"Created"}),N.jsx("p",{children:ja(e.createdAt)})]}),N.jsxs("div",{className:"surface px-1 py-0.75",children:[N.jsx("p",{className:"text-xs text-slate-400",children:"Last seen"}),N.jsx("p",{children:ja(e.lastSeenAt)})]})]})}function py({user:e,type:t,onAdd:r,onRemove:n}){const[s,i]=X.useState(""),a=e?.[cy[t]]||[],o=async c=>{c.preventDefault();const l=s.trim();l&&(await r(t,l),i(""))};return N.jsxs("div",{className:"surface space-y-0.5 px-1 py-0.75",children:[N.jsx("p",{className:"text-xs font-semibold text-slate-200",children:fc[t]}),N.jsx("div",{className:"space-y-0.5",children:a.length?a.map(c=>N.jsxs("div",{className:"surface-muted grid grid-cols-[minmax(0,1fr)_auto] items-center gap-0.5 px-1 py-0.5",children:[N.jsx("span",{className:"min-w-0 break-all font-mono text-[0.7rem] text-slate-200",children:c}),N.jsx("button",{type:"button",className:"button-dark text-xs",onClick:()=>n(t,c),children:"Remove"})]},c)):N.jsx("p",{className:"text-xs text-slate-500",children:"No values."})}),N.jsxs("form",{className:"grid gap-0.5 md:grid-cols-[minmax(0,1fr)_auto]",onSubmit:o,children:[N.jsx("input",{className:"field-input text-xs",value:s,placeholder:`Add ${fc[t].toLowerCase()}`,onChange:c=>i(c.target.value)}),N.jsx("button",{type:"submit",className:"button-dark text-xs",disabled:!s.trim(),children:"Add"})]})]})}function yy({user:e,onAddSignal:t,onRemoveSignal:r}){return N.jsx(Ze,{title:"Identity signals",bodyClassName:"grid gap-0.5 p-0.5 text-sm xl:grid-cols-2",children:Object.keys(fc).map(n=>N.jsx(py,{user:e,type:n,onAdd:t,onRemove:r},n))})}function gy({user:e,onVerified:t,onDeterrence:r,onMuted:n}){const[s,i]=X.useState(e?.deterrence?.reason||"");return N.jsxs(Ze,{title:"Status",bodyClassName:"grid gap-0.5 p-0.5 text-sm md:grid-cols-2",children:[N.jsxs("div",{className:"surface space-y-0.5 px-1 py-0.75",children:[N.jsx("p",{className:"text-xs text-slate-400",children:"Verification"}),N.jsxs("label",{className:"flex items-center gap-0.5 text-slate-100",children:[N.jsx("input",{type:"checkbox",className:"h-3.5 w-3.5 accent-emerald-500",checked:!!e?.verified?.enabled,onChange:a=>t(a.target.checked)}),N.jsx("span",{children:"Verified"})]}),N.jsxs("p",{className:"text-xs text-slate-500",children:["Updated ",ja(e?.verified?.at)]})]}),N.jsxs("div",{className:"surface space-y-0.5 px-1 py-0.75",children:[N.jsx("p",{className:"text-xs text-slate-400",children:"Deterrence"}),N.jsxs("label",{className:"flex items-center gap-0.5 text-slate-100",children:[N.jsx("input",{type:"checkbox",className:"h-3.5 w-3.5 accent-red-500",checked:!!e?.deterrence?.enabled,onChange:a=>r(a.target.checked,s)}),N.jsx("span",{children:"Deterred"})]}),N.jsx("textarea",{className:"field-input min-h-[4rem] w-full text-xs",value:s,placeholder:"Deterrence reason",onChange:a=>i(a.target.value)}),N.jsx("button",{type:"button",className:"button-dark text-xs",onClick:()=>r(!!e?.deterrence?.enabled,s),children:"Save Reason"}),N.jsxs("div",{className:"border-t border-slate-700/70 pt-0.5",children:[N.jsxs("label",{className:"flex items-center gap-0.5 text-slate-100",children:[N.jsx("input",{type:"checkbox",className:"h-3.5 w-3.5 accent-amber-500",checked:!!e?.deterrence?.muted,onChange:a=>n(a.target.checked)}),N.jsx("span",{children:"Muted"})]}),N.jsxs("p",{className:"text-xs text-slate-500",children:["Updated ",ja(e?.deterrence?.mutedAt)]})]})]})]})}function vy({user:e,onSaveFeature:t,onDeleteFeature:r}){const n=Object.keys(e?.features||{}).sort(),s=n[0]||"",[i,a]=X.useState(s),[o,c]=X.useState(hc(s?e.features[s]:{})),[l,u]=X.useState(""),m=async()=>{const v=i.trim();if(!v){u("Namespace required.");return}try{const S=dy(o);await t(v,S),u("")}catch(S){u(S.message||"Invalid JSON.")}},_=async()=>{const v=i.trim();v&&window.confirm(`Delete feature state "${v}" from ${e.id}?`)&&(await r(v),a(""),c("{}"),u(""))};return N.jsxs(Ze,{title:"Feature state",bodyClassName:"space-y-0.5 p-0.5 text-sm",children:[N.jsxs("div",{className:"grid gap-0.5 md:grid-cols-[minmax(0,1fr)_auto_auto]",children:[N.jsx("input",{className:"field-input text-sm",value:i,placeholder:"Namespace",list:"identity-feature-namespaces",onChange:v=>{const S=v.target.value;a(S),c(hc(e.features?.[S]||{}))}}),N.jsx("datalist",{id:"identity-feature-namespaces",children:n.map(v=>N.jsx("option",{value:v},v))}),N.jsx("button",{type:"button",className:"button-dark text-xs",onClick:m,children:"Save"}),N.jsx("button",{type:"button",className:"button-dark text-xs",onClick:_,disabled:!i.trim(),children:"Delete"})]}),N.jsx("textarea",{className:"field-input min-h-[18rem] w-full font-mono text-xs",value:o,spellCheck:!1,onChange:v=>c(v.target.value)}),l?N.jsx("p",{className:"surface text-xs text-red-300",children:l}):null]})}function by({user:e}){return N.jsx(Ze,{title:"Raw record",bodyClassName:"p-0.5 text-xs",children:N.jsx("pre",{className:"surface max-h-[36rem] overflow-auto whitespace-pre-wrap break-words font-mono text-[0.7rem] text-lime-300",children:hc(e)})})}function _y({user:e,permissions:t,onPermission:r}){const n=new Set((e?.permissions||[]).map(s=>s.key));return N.jsx(Ze,{title:"Permissions",bodyClassName:"grid gap-0.5 p-0.5 text-sm md:grid-cols-2",children:t.map(s=>N.jsxs("label",{className:"surface space-y-0.5 px-1 py-0.75 text-slate-100",children:[N.jsxs("span",{className:"flex items-center gap-0.5 font-semibold",children:[N.jsx("input",{type:"checkbox",className:"h-3.5 w-3.5 accent-emerald-500",checked:n.has(s.key),onChange:i=>r(s.key,i.target.checked)}),s.label]}),N.jsx("span",{className:"block text-xs text-slate-400",children:s.description}),N.jsx("code",{className:"block text-[0.68rem] text-lime-300",children:s.key})]},s.key))})}function Sy(){const e=Rh(),[t,r]=X.useState([]),[n,s]=X.useState([]),[i,a]=X.useState(null),[o,c]=X.useState(""),[l,u]=X.useState("all"),[m,_]=X.useState(!1),[v,S]=X.useState(""),E=X.useCallback(async()=>{_(!0);try{const q=await Qp(e);if(r(q.users||[]),s(q.permissions||[]),i?.id){const L=await Il(e,i.id);a(L.user||null)}S("")}catch(q){S(q.message||"Failed to load users.")}finally{_(!1)}},[i?.id,e]),g=X.useCallback(async q=>{_(!0);try{const L=await Il(e,q);a(L.user||null),S("")}catch(L){S(L.message||"Failed to load user.")}finally{_(!1)}},[e]),y=X.useCallback(q=>{a(q||null),q?.id&&r(L=>L.map(U=>U.id===q.id?{...U,...q}:U))},[]),f=X.useCallback(async(q,L)=>{if(i?.id){_(!0);try{const U=await q(i.id);y(U.user),S(L||"Saved.")}catch(U){S(U.message||"Save failed.")}finally{_(!1)}}},[y,i?.id]);X.useEffect(()=>{E()},[]);const C=(q,L)=>f(U=>ey(e,U,q,L),"Signal added."),P=(q,L)=>f(U=>ty(e,U,q,L),"Signal removed."),h=q=>f(L=>ry(e,L,q),"Verification updated."),b=(q,L)=>f(U=>ny(e,U,q,L),"Deterrence updated."),O=q=>f(L=>iy(e,L,q),"Mute updated."),k=(q,L)=>f(U=>sy(e,U,q,L),"Permission updated."),$=(q,L)=>f(U=>ay(e,U,q,L),"Feature state saved."),M=q=>f(L=>oy(e,L,q),"Feature state deleted.");return N.jsxs("div",{className:"grid min-h-0 flex-1 gap-0.5 lg:grid-cols-[24rem_minmax(0,1fr)]",children:[N.jsx(hy,{users:t,selectedUserId:i?.id||null,query:o,filter:l,loading:m,onQuery:c,onFilter:u,onRefresh:E,onSelect:g}),N.jsxs("div",{className:"min-h-0 space-y-0.5 overflow-y-auto",children:[v?N.jsx(Ze,{title:"Status",bodyClassName:"p-0.5 text-sm text-slate-200",children:N.jsx("p",{children:v})}):null,i?N.jsxs(N.Fragment,{children:[N.jsx(my,{user:i}),N.jsxs($h,{defaultTab:"signals",children:[N.jsxs(Fh,{children:[N.jsx(Kn,{id:"signals",children:"Signals"}),N.jsx(Kn,{id:"status",children:"Status"}),N.jsx(Kn,{id:"permissions",children:"Permissions"}),N.jsx(Kn,{id:"features",children:"Feature state"}),N.jsx(Kn,{id:"raw",children:"Raw JSON"})]}),N.jsxs(Dh,{children:[N.jsx(hi,{id:"signals",children:N.jsx(yy,{user:i,onAddSignal:C,onRemoveSignal:P})}),N.jsx(hi,{id:"status",children:N.jsx(gy,{user:i,onVerified:h,onDeterrence:b,onMuted:O},`status-${i.id}`)}),N.jsx(hi,{id:"permissions",children:N.jsx(_y,{user:i,permissions:n,onPermission:k})}),N.jsx(hi,{id:"features",children:N.jsx(vy,{user:i,onSaveFeature:$,onDeleteFeature:M},`features-${i.id}`)}),N.jsx(hi,{id:"raw",children:N.jsx(by,{user:i})})]})]})]}):N.jsx(Ze,{title:"User details",bodyClassName:"p-1 text-center text-sm text-slate-400",children:"Select a user to inspect and edit the identity record."})]})]})}function wy({administrator:e,socket:t,runSensitive:r,onSnapshot:n}){const[s,i]=X.useState({username:e.username,discordId:e.discordId,role:e.role,password:""}),[a,o]=X.useState(!1),[c,l]=X.useState("");X.useEffect(()=>{i({username:e.username,discordId:e.discordId,role:e.role,password:""})},[e]);async function u(m){o(!0),l("");try{const _=await r(m);n(_.snapshot)}catch(_){l(_.message)}finally{o(!1)}}return N.jsxs("div",{className:"surface space-y-0.5 p-0.5",children:[N.jsxs("div",{className:"grid gap-0.5 md:grid-cols-4",children:[N.jsx("input",{className:"field-input",value:s.username,onChange:m=>i({...s,username:m.target.value})}),N.jsx("input",{className:"field-input",placeholder:"Discord id",value:s.discordId,onChange:m=>i({...s,discordId:m.target.value})}),N.jsxs("select",{className:"field-input",value:s.role,onChange:m=>i({...s,role:m.target.value}),children:[N.jsx("option",{value:"admin",children:"Administrator"}),N.jsx("option",{value:"lockdown",children:"Lockdown administrator"})]}),N.jsx("input",{className:"field-input",type:"password",autoComplete:"new-password",placeholder:"New password (optional)",value:s.password,onChange:m=>i({...s,password:m.target.value})})]}),c?N.jsx("p",{className:"text-xs text-red-300",children:c}):null,N.jsxs("div",{className:"flex justify-end gap-0.5",children:[N.jsx("button",{type:"button",className:"button-danger text-xs",disabled:a,onClick:()=>u(()=>Lp(t,e.id)),children:"Delete"}),N.jsx("button",{type:"button",className:"button-dark text-xs",disabled:a,onClick:()=>u(()=>Vp(t,{id:e.id,...s})),children:"Save account"})]})]})}function Cy({administrators:e,socket:t,runSensitive:r,onSnapshot:n}){const[s,i]=X.useState({username:"",discordId:"",role:"admin",password:""}),[a,o]=X.useState(!1),[c,l]=X.useState("");async function u(m){m.preventDefault(),o(!0),l("");try{const _=await r(()=>Up(t,s));n(_.snapshot),i({username:"",discordId:"",role:"admin",password:""})}catch(_){l(_.message)}finally{o(!1)}}return N.jsxs(Ze,{title:"Administrator accounts",meta:e.length,bodyClassName:"space-y-0.5 p-0.5 text-sm",children:[N.jsxs("form",{className:"surface grid gap-0.5 p-0.5 md:grid-cols-4",onSubmit:u,children:[N.jsx("input",{className:"field-input",placeholder:"Username",value:s.username,onChange:m=>i({...s,username:m.target.value})}),N.jsx("input",{className:"field-input",placeholder:"Discord id (optional)",value:s.discordId,onChange:m=>i({...s,discordId:m.target.value})}),N.jsxs("select",{className:"field-input",value:s.role,onChange:m=>i({...s,role:m.target.value}),children:[N.jsx("option",{value:"admin",children:"Administrator"}),N.jsx("option",{value:"lockdown",children:"Lockdown administrator"})]}),N.jsx("input",{className:"field-input",type:"password",autoComplete:"new-password",placeholder:"Password",value:s.password,onChange:m=>i({...s,password:m.target.value})}),c?N.jsx("p",{className:"text-xs text-red-300 md:col-span-3",children:c}):N.jsx("span",{className:"md:col-span-3"}),N.jsx("button",{className:"button-dark",type:"submit",disabled:a||!s.username||!s.password,children:a?"Creating…":"Create account"})]}),(e||[]).map(m=>N.jsx(wy,{administrator:m,socket:t,runSensitive:r,onSnapshot:n},m.id))]})}function bo(e){return Number.isFinite(Number(e))?new Date(Number(e)).toLocaleString():"unknown"}function Ey({snapshot:e,socket:t,runSensitive:r,onSnapshot:n}){const s=e.configuration,[i,a]=X.useState(!1);X.useEffect(()=>{if(!i)return;const l=()=>a(!1);return t.once("connect",l),()=>t.off("connect",l)},[i,t]);async function o(l){if(window.confirm(`Restore configuration revision ${l}? This creates and immediately applies a new active revision.`))try{const u=await r(()=>zp(t,{revision:l,expectedRevision:s.revision}));n(u.snapshot)}catch(u){window.alert(u.message)}}async function c(){if(window.confirm("Restart the MultiRover application now? Connected rovers and browsers will disconnect briefly; the server host will not reboot.")){a(!0);try{await r(()=>Bp(t))}catch(l){a(!1),window.alert(l.message)}}}return N.jsxs("div",{className:"space-y-0.5",children:[N.jsxs(Ze,{title:"Administration overview",meta:`revision ${s.revision}`,bodyClassName:"grid gap-0.5 p-0.5 md:grid-cols-3",children:[N.jsxs("div",{className:"surface p-1",children:[N.jsx("p",{className:"text-xs text-slate-400",children:"Active revision"}),N.jsx("p",{className:"text-xl font-semibold",children:s.revision})]}),N.jsxs("div",{className:"surface p-1",children:[N.jsx("p",{className:"text-xs text-slate-400",children:"Administrators"}),N.jsx("p",{className:"text-xl font-semibold",children:e.administrators.length})]}),N.jsxs("div",{className:"surface p-1",children:[N.jsx("p",{className:"text-xs text-slate-400",children:"Last configuration save"}),N.jsx("p",{className:"text-sm font-semibold",children:bo(s.createdAt)})]})]}),N.jsxs(Ze,{title:"Existing administration surfaces",bodyClassName:"flex flex-wrap gap-0.5 p-0.5 text-sm",children:[N.jsx(kl,{className:"button-dark",to:"/reports",children:"Open fleet reports"}),N.jsx(kl,{className:"button-dark",to:"/",children:"Open driver application"})]}),N.jsxs(Ze,{title:"Application",bodyClassName:"space-y-0.5 p-1 text-sm",children:[N.jsx("p",{className:"text-slate-300",children:"Restart only the MultiRover application. The process supervisor starts it again automatically without rebooting the host."}),N.jsx("button",{type:"button",className:"button-danger",disabled:i,onClick:c,children:i?"Waiting for application…":"Restart application"})]}),N.jsx(Ze,{title:"Configuration revisions",meta:e.revisions.length,bodyClassName:"max-h-64 overflow-y-auto p-0.5 text-xs",children:e.revisions.map(l=>N.jsxs("div",{className:"surface mb-0.5 grid items-center gap-0.5 p-0.5 md:grid-cols-[5rem_1fr_1fr_1fr_auto]",children:[N.jsxs("span",{children:["#",l.revision]}),N.jsx("span",{children:bo(l.createdAt)}),N.jsx("span",{children:l.actor}),N.jsx("span",{children:l.source}),N.jsx("button",{type:"button",className:"button-dark text-xs",disabled:l.revision===s.revision,onClick:()=>o(l.revision),children:"Restore"})]},l.revision))}),N.jsx(Ze,{title:"Persistent audit history",meta:e.auditEvents.length,bodyClassName:"max-h-96 overflow-y-auto p-0.5 text-xs",children:e.auditEvents.map(l=>N.jsxs("div",{className:"surface mb-0.5 grid gap-0.5 p-0.5 md:grid-cols-[10rem_10rem_1fr]",children:[N.jsx("span",{children:bo(l.createdAt)}),N.jsx("span",{children:l.actor}),N.jsx("span",{children:l.action})]},l.id))})]})}function Ay(e){const t=Number(e)||0;if(t<1024)return`${t} B`;const r=["KiB","MiB","GiB","TiB"];let n=t/1024,s=0;for(;n>=1024&&s<r.length-1;)n/=1024,s+=1;return`${n.toFixed(n>=10?1:2)} ${r[s]}`}function xy({socket:e,runSensitive:t}){const[r,n]=X.useState(!1),[s,i]=X.useState(!1),[a,o]=X.useState(null),[c,l]=X.useState(null),[u,m]=X.useState(null),[_,v]=X.useState("");X.useEffect(()=>{Hp(e).then(y=>m(y.lastRestore)).catch(y=>v(y.message))},[e]);async function S(){n(!0),v("Creating consistent database snapshots and copying server data…");try{const y=await t(()=>Kp(e)),f=document.createElement("a");f.href=y.downloadUrl,f.download="",document.body.appendChild(f),f.click(),f.remove();const C=y.skippedUnstableFiles?.length||0;v(`Backup download started with ${y.fileCount} files.${C?` ${C} actively changing file(s) were skipped.`:""}`)}catch(y){v(y.message)}finally{n(!1)}}async function E(){if(a){i(!0),l(null),v("Uploading and validating the selected backup…");try{const y=await t(()=>Gp(e)),f=await fetch(y.uploadUrl,{method:"PUT",headers:{"Content-Type":"application/gzip"},body:a}),C=await f.json();if(!f.ok||C.error)throw new Error(C.error||"Restore upload failed.");l(C),v("Backup validated. Review the summary before replacing server data.")}catch(y){v(y.message)}finally{i(!1)}}}async function g(){if(!(!c||!window.confirm("Replace the complete server data folder with this backup and restart the application? Configuration, administrators, identities, history, and media will all be replaced."))){i(!0);try{await t(()=>Wp(e,c.restoreId)),v("Restore accepted. Waiting for the application to restart…")}catch(f){i(!1),v(f.message)}}}return N.jsxs("div",{className:"space-y-0.5",children:[N.jsxs(Ze,{title:"Full backup",bodyClassName:"space-y-0.5 p-1 text-sm",children:[N.jsx("p",{className:"text-slate-300",children:"Downloads configuration, administrator accounts, secrets, identities, history, snapshots, replays, and other durable server data. Keep the archive private because it contains credentials."}),N.jsx("button",{type:"button",className:"button-dark",disabled:r||s,onClick:S,children:r?"Creating backup…":"Download full backup"})]}),N.jsxs(Ze,{title:"Full restore",bodyClassName:"space-y-0.5 p-1 text-sm",children:[N.jsx("p",{className:"text-slate-300",children:"Upload a MultiRover full backup for validation. Nothing changes until the validated restore is confirmed."}),N.jsxs("div",{className:"flex max-w-3xl flex-col gap-0.5 md:flex-row",children:[N.jsx("input",{className:"field-input min-w-0 flex-1",type:"file",accept:".gz,.tgz,application/gzip",disabled:s||r,onChange:y=>{o(y.target.files?.[0]||null),l(null)}}),N.jsx("button",{type:"button",className:"button-dark",disabled:!a||s||r,onClick:E,children:s&&!c?"Validating…":"Validate backup"})]}),c?N.jsxs("div",{className:"surface max-w-3xl space-y-0.5 p-1",children:[N.jsxs("p",{children:[c.summary.fileCount," files, ",Ay(c.summary.totalBytes)]}),N.jsxs("p",{children:["Created ",new Date(c.summary.createdAt).toLocaleString()," by application version ",c.summary.applicationVersion]}),N.jsx("button",{type:"button",className:"button-danger",disabled:s,onClick:g,children:"Replace data and restart"})]}):null]}),_?N.jsx(Ze,{title:"Backup and restore status",bodyClassName:"p-1 text-sm text-slate-200",children:N.jsx("p",{children:_})}):null,u?N.jsx(Ze,{title:"Last restore",meta:u.status,bodyClassName:"p-1 text-sm text-slate-300",children:N.jsxs("p",{children:[u.completedAt?new Date(u.completedAt).toLocaleString():"Completion time unavailable",u.error?` — ${u.error}`:""]})}):null]})}function ue(e){return typeof e!="object"||e===null||"lastModified"in e&&typeof e.lastModified=="number"&&typeof File<"u"&&e instanceof File||"getMonth"in e&&typeof e.getMonth=="function"&&typeof Date<"u"&&e instanceof Date?!1:!Array.isArray(e)}function Py(e){return e.additionalItems===!0&&console.warn("additionalItems=true is currently not supported"),ue(e.additionalItems)}function Th(e){const t=typeof navigator<"u"?navigator.languages:void 0;if(t)try{return new Intl.NumberFormat(t).formatToParts(1.1).find(s=>s.type==="decimal")?.value||"."}catch{}return"."}function $l(e){if(e==="")return;if(e===null)return null;const t=Th(),r=typeof e=="string"&&t!=="."?e.replace(t,"."):e;if(/\.$/.test(r)||/\.0$/.test(r)||/\.\d*0$/.test(r))return e;const n=Number(r);return typeof n=="number"&&!Number.isNaN(n)?n:e}const Sn=Symbol("__additional_property"),Jn="additionalProperties",yr="allOf",Ie="anyOf",Nt="const",An="default",Lc="dependencies",Oy="enum",vt="__errors",Ue="$id",Vc="if",ni="items",jy="_$junk_option_schema_id$_",ba="$name",Se="oneOf",mc="patternProperties",nt="properties",_o="readonly",Mh="required",ka="submitButtonOptions",Je="$ref",_a=Symbol("__rjsf_ref"),zc=Symbol("__rjsf_ref_cycle"),Ei="$schema",qh="root",Uh="_",ky=["discriminator","propertyName"],Fl="formContext",Ny="layoutGridLookupMap",Lh="__rjsf",Bc=`${Lh}_additionalProperties`,Vh=`${Lh}_rootSchema`,Iy="ui:field",Hc="ui:widget",Br="ui:options",pc="ui:globalOptions",Ry="ui:definitions",$y="https://json-schema.org/draft/2019-09/schema",Sa="https://json-schema.org/draft/2020-12/schema";function pe(e={},t={}){return e?Object.keys(e).filter(r=>r.startsWith("ui:")).reduce((r,n)=>{const s=e[n];return n===Hc&&ue(s)?(console.error("Setting options via ui:widget object is no longer supported, use ui:options instead"),r):n===Br&&ue(s)?{...r,...s}:{...r,[n.substring(3)]:s}},{...t}):{...t}}function Fy(e,t={},r){if(!(e.additionalProperties||e.patternProperties))return!1;const{expandable:n=!0}=pe(t);return n===!1?n:e.maxProperties!==void 0&&r?Object.keys(r).length<e.maxProperties:!0}function Or(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function yc(e){const t={[vt]:[],addError(r){this[vt].push(r)}};return Array.isArray(e)?e.reduce((r,n,s)=>({...r,[s]:yc(n)}),t):Or(e)?Object.keys(e).reduce((r,n)=>({...r,[n]:yc(e[n])}),t):t}const{getOwnPropertyNames:Dl,getOwnPropertySymbols:Dy}=Object,{hasOwnProperty:Ty}=Object.prototype;function mi(e,t){return function(n,s,i){return e(n,s,i)&&t(n,s,i)}}function pi(e){return function(r,n,s){if(!r||!n||typeof r!="object"||typeof n!="object")return e(r,n,s);const{cache:i}=s,a=i.get(r),o=i.get(n);if(a&&o)return a===n&&o===r;i.set(r,n),i.set(n,r);const c=e(r,n,s);return i.delete(r),i.delete(n),c}}function Tl(e){const t=Dy(e);return t.length?Dl(e).concat(t):Dl(e)}const My=Object.hasOwn||((e,t)=>Ty.call(e,t)),qy="__v",Uy="__o",Ly="_owner",Vy=typeof Float16Array<"u",{getOwnPropertyDescriptor:Ml,keys:ql}=Object,In=Object.is||function(t,r){return t===r?t!==0||1/t===1/r:t!==t&&r!==r};function zy(e,t){return e===t}function By(e,t){return e.byteLength===t.byteLength&&Na(new Uint8Array(e),new Uint8Array(t))}function Hy(e,t,r){let n=e.length;if(t.length!==n)return!1;for(;n-- >0;)if(!r.equals(e[n],t[n],n,n,e,t,r))return!1;return!0}function Ky(e,t){return e.byteLength===t.byteLength&&Na(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function Gy(e,t){return In(e.getTime(),t.getTime())}function Ul(e,t,r){return e.name===t.name&&e.message===t.message&&e.stack===t.stack&&r.equals(e.cause,t.cause,"cause","cause",e,t,r)}function Ll(e,t,r){const n=e.size;if(n!==t.size)return!1;if(!n)return!0;const s=new Uint8Array(n),i=e.entries();let a,o,c=0;for(;(a=i.next())&&!a.done;){const l=t.entries();let u=0,m=0;for(;(o=l.next())&&!o.done;){if(s[m]){m++;continue}const _=a.value,v=o.value;if(r.equals(_[0],v[0],c,m,e,t,r)&&r.equals(_[1],v[1],_[0],v[0],e,t,r)){u=s[m]=1;break}m++}if(!u)return!1;c++}return!0}function Vl(e,t,r){const n=ql(e);let s=n.length;if(ql(t).length!==s)return!1;for(;s-- >0;)if(!zh(e,t,r,n[s]))return!1;return!0}function qn(e,t,r){const n=Tl(e);let s=n.length;if(Tl(t).length!==s)return!1;let i,a,o;for(;s-- >0;)if(i=n[s],!zh(e,t,r,i)||(a=Ml(e,i),o=Ml(t,i),(a||o)&&(!a||!o||a.configurable!==o.configurable||a.enumerable!==o.enumerable||a.writable!==o.writable)))return!1;return!0}function Wy(e,t){return In(e.valueOf(),t.valueOf())}function Jy(e,t){return e.source===t.source&&e.flags===t.flags}function zl(e,t,r){const n=e.size;if(n!==t.size)return!1;if(!n)return!0;const s=new Uint8Array(n),i=e.values();let a,o;for(;(a=i.next())&&!a.done;){const c=t.values();let l=0,u=0;for(;(o=c.next())&&!o.done;){if(!s[u]&&r.equals(a.value,o.value,a.value,o.value,e,t,r)){l=s[u]=1;break}u++}if(!l)return!1}return!0}function Na(e,t){let r=e.length;if(t.length!==r||e.byteOffset!==t.byteOffset)return!1;if(e instanceof Float64Array||e instanceof Float32Array||Vy&&e instanceof Float16Array){for(;r-- >0;)if(e[r]!==t[r]&&(e[r]===e[r]||t[r]===t[r]))return!1;return!0}for(;r-- >0;)if(e[r]!==t[r])return!1;return!0}function Yy(e,t){return e.href===t.href?!0:e.protocol===t.protocol&&e.username===t.username&&e.password===t.password&&e.host===t.host&&e.pathname===t.pathname&&e.hash===t.hash&&Xy(e.searchParams,t.searchParams)}function Xy(e,t){const r=e.toString(),n=t.toString();return r===n||Bl(r)===Bl(n)}function Bl(e){return e.split("&").sort().join("&")}function zh(e,t,r,n){return(n===Ly||n===Uy||n===qy)&&(e.$$typeof||t.$$typeof)?!0:My(t,n)&&r.equals(e[n],t[n],n,n,e,t,r)}const Zy=Object.prototype.toString;function Qy(e){const t=ng(e),{areArraysEqual:r,areDatesEqual:n,areFunctionsEqual:s,areMapsEqual:i,areNumbersEqual:a,areObjectsEqual:o,areRegExpsEqual:c,areSetsEqual:l,getUnsupportedCustomComparator:u}=e;return function(_,v,S){if(_===v)return!0;if(_==null||v==null)return!1;const E=typeof _;if(E!==typeof v)return!1;if(E!=="object")return E==="number"||E==="bigint"?a(_,v,S):E==="function"?s(_,v,S):!1;const g=_.constructor;if(g!==v.constructor)return!1;if(g===Object)return o(_,v,S);if(g===Array)return r(_,v,S);if(g===Date)return n(_,v,S);if(g===RegExp)return c(_,v,S);if(g===Map)return i(_,v,S);if(g===Set)return l(_,v,S);if(g===Promise)return!1;if(Array.isArray(_))return r(_,v,S);const y=Zy.call(_),f=t[y];if(f)return f(_,v,S);const C=u&&u(_,v,S,y);return C?C(_,v,S):!1}}function eg({circular:e,createCustomConfig:t,strict:r}){let n={areArrayBuffersEqual:By,areArraysEqual:r?qn:Hy,areDataViewsEqual:Ky,areDatesEqual:Gy,areErrorsEqual:r?mi(Ul,qn):mi(Ul,Vl),areFunctionsEqual:zy,areMapsEqual:r?mi(Ll,qn):Ll,areNumbersEqual:In,areObjectsEqual:r?qn:Vl,arePrimitiveWrappersEqual:Wy,areRegExpsEqual:Jy,areSetsEqual:r?mi(zl,qn):zl,areTypedArraysEqual:r?mi(Na,qn):Na,areUrlsEqual:Yy,getUnsupportedCustomComparator:void 0};if(t&&(n=Object.assign({},n,t(n))),e){const s=pi(n.areArraysEqual),i=pi(n.areErrorsEqual),a=pi(n.areMapsEqual),o=pi(n.areObjectsEqual),c=pi(n.areSetsEqual);n=Object.assign({},n,{areArraysEqual:s,areErrorsEqual:i,areMapsEqual:a,areObjectsEqual:o,areSetsEqual:c})}return n}function tg(e){return function(t,r,n,s,i,a,o){return e(t,r,o)}}function rg({circular:e,comparator:t,createState:r,equals:n,strict:s}){if(r)return function(o,c){const{cache:l=e?new WeakMap:void 0,meta:u}=r();return t(o,c,{cache:l,equals:n,meta:u,strict:s})};if(e)return function(o,c){return t(o,c,{cache:new WeakMap,equals:n,meta:void 0,strict:s})};const i={cache:void 0,equals:n,meta:void 0,strict:s};return function(o,c){return t(o,c,i)}}function ng({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:r,areDatesEqual:n,areErrorsEqual:s,areFunctionsEqual:i,areMapsEqual:a,areObjectsEqual:o,arePrimitiveWrappersEqual:c,areRegExpsEqual:l,areSetsEqual:u,areTypedArraysEqual:m,areUrlsEqual:_}){return{"[object Arguments]":o,"[object Array]":t,"[object ArrayBuffer]":e,"[object AsyncGeneratorFunction]":i,"[object BigInt]":c,"[object BigInt64Array]":m,"[object BigUint64Array]":m,"[object Boolean]":c,"[object DataView]":r,"[object Date]":n,"[object Error]":s,"[object Float16Array]":m,"[object Float32Array]":m,"[object Float64Array]":m,"[object Function]":i,"[object GeneratorFunction]":i,"[object Int8Array]":m,"[object Int16Array]":m,"[object Int32Array]":m,"[object Map]":a,"[object Number]":c,"[object Object]":(v,S,E)=>typeof v.then!="function"&&typeof S.then!="function"&&o(v,S,E),"[object RegExp]":l,"[object Set]":u,"[object String]":c,"[object URL]":_,"[object Uint8Array]":m,"[object Uint8ClampedArray]":m,"[object Uint16Array]":m,"[object Uint32Array]":m}}kr();kr({strict:!0});kr({circular:!0});kr({circular:!0,strict:!0});kr({createInternalComparator:()=>In});kr({strict:!0,createInternalComparator:()=>In});kr({circular:!0,createInternalComparator:()=>In});kr({circular:!0,createInternalComparator:()=>In,strict:!0});function kr(e={}){const{circular:t=!1,createInternalComparator:r,createState:n,strict:s=!1}=e,i=eg(e),a=Qy(i),o=r?r(a):tg(a);return rg({circular:t,comparator:a,createState:n,equals:o,strict:s})}const je=kr({circular:!0,createCustomConfig:()=>({areFunctionsEqual(e,t){return typeof t=="function"}})});var yi={exports:{}},So,Hl;function Bh(){if(Hl)return So;Hl=1;const e=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),t=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),r=RegExp.prototype.test.bind(/^\d*$/u),n=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),s=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),i=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/]$/u),a=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/?]$/u),o=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:]$/u);function c(p){let d="",x=0,I=0;for(I=0;I<p.length;I++)if(x=p[I].charCodeAt(0),x!==48){if(!(x>=48&&x<=57||x>=65&&x<=70||x>=97&&x<=102))return"";d+=p[I];break}for(I+=1;I<p.length;I++){if(x=p[I].charCodeAt(0),!(x>=48&&x<=57||x>=65&&x<=70||x>=97&&x<=102))return"";d+=p[I]}return d}const l=RegExp.prototype.test.bind(/^[\dA-Fa-f]{1,4}$/),u=RegExp.prototype.test.bind(/^[vV][\dA-Fa-f]+\.[A-Za-z\d\-._~!$&'()*+,;=:]+$/),m=RegExp.prototype.test.bind(/^[A-Za-z\d\-._~]$/),_=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u),v=RegExp.prototype.test.bind(/[^\d!"$&'()*+,\-.;=_`a-z{}~]/u),S=RegExp.prototype.test.bind(/(?:^|\.)\d+$/u);function E(p){return v(p)||S(p)}function g(p){if(p.length===0)return!1;for(let d=0;d<p.length;d++)if(!m(p[d])){if(p[d]==="%"&&d+2<p.length&&n(p.slice(d+1,d+3))){d+=2;continue}return!1}return!0}function y(p){let d=-1,x=0,I=-1,T=0;for(let H=0;H<p.length;H++)p[H]==="0"?(I===-1&&(I=H),T++,T>x&&(x=T,d=I)):(I=-1,T=0);if(x<2)return p.join(":");const F=p.slice(0,d).join(":"),z=p.slice(d+x).join(":");return F+"::"+z}function f(p){const d=p.indexOf("::");if(d!==-1&&p.indexOf("::",d+1)!==-1)return;const x=d===-1?p.split(":"):p.slice(0,d).split(":"),I=d===-1?[]:p.slice(d+2).split(":");d!==-1&&(x.length===1&&x[0]===""&&(x.length=0),I.length===1&&I[0]===""&&(I.length=0));const T=x.concat(I);let F=0;for(let H=0;H<T.length;H++){const R=T[H];if(R==="")return;if(R.indexOf(".")!==-1){if(H!==T.length-1||d!==-1&&I.length===0||!t(R))return;F+=2;continue}if(!l(R))return;T[H]=parseInt(R,16).toString(16),F++}if(d===-1)return F!==8?void 0:y(T);if(F>=8)return;const z=T.slice(0,x.length);for(let H=F;H<8;H++)z.push("0");for(let H=x.length;H<T.length;H++)z.push(T[H]);return y(z)}function C(p){const d=p[0]==="["&&p[p.length-1]==="]";if((p[0]==="["||p[p.length-1]==="]")&&!d)return{host:p,isIPV6:!1,error:!0};let I=d?p.slice(1,-1):p;if(d&&u(I))return I=I.toLowerCase(),{host:`[${I}]`,escapedHost:I,isIPV6:!1,isIPVFuture:!0};if(P(I,":")<2)return{host:p,isIPV6:!1,error:d};let T="";const F=I.indexOf("%");if(F!==-1){const H=I.slice(F,F+3).toLowerCase()==="%25"?3:1;if(T=I.slice(F+H),!g(T))return{host:p,isIPV6:!1,error:!0};I=I.slice(0,F)}const z=f(I);return z===void 0?{host:p,isIPV6:!1,error:!0}:{host:z+(T?"%"+T:""),escapedHost:z+(T?"%25"+T:""),isIPV6:!0}}function P(p,d){let x=0;for(let I=0;I<p.length;I++)p[I]===d&&x++;return x}function h(p){let d=p;const x=[];let I=-1,T=0;for(;T=d.length;){if(T===1){if(d===".")break;if(d==="/"){x.push("/");break}else{x.push(d);break}}else if(T===2){if(d[0]==="."){if(d[1]===".")break;if(d[1]==="/"){d=d.slice(2);continue}}else if(d[0]==="/"&&d[1]==="."){x.push("/");break}}else if(T===3&&d==="/.."){x.length!==0&&x.pop(),x.push("/");break}if(d[0]==="."){if(d[1]==="."){if(d[2]==="/"){d=d.slice(3);continue}}else if(d[1]==="/"){d=d.slice(2);continue}}else if(d[0]==="/"&&d[1]==="."){if(d[2]==="/"){d=d.slice(2);continue}else if(d[2]==="."&&d[3]==="/"){d=d.slice(3),x.length!==0&&x.pop();continue}}if((I=d.indexOf("/",1))===-1){x.push(d);break}else x.push(d.slice(0,I)),d=d.slice(I)}return x.join("")}const b={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},O=/[@/?#:]/g,k=/[@/?#]/g;function $(p,d){const x=d?k:O;return x.lastIndex=0,p.replace(x,I=>b[I])}function M(p,d=!1){if(p.indexOf("%")===-1)return p;let x="";for(let I=0;I<p.length;I++){if(p[I]==="%"&&I+2<p.length){const T=p.slice(I+1,I+3);if(n(T)){const F=T.toUpperCase(),z=String.fromCharCode(parseInt(F,16));d&&s(z)?x+=z:x+="%"+F,I+=2;continue}}x+=p[I]}return x}const q=new Array(256);{const p="0123456789ABCDEF";for(let d=0;d<256;d++)q[d]="%"+p[d>>4]+p[d&15]}function L(p){return p>=48&&p<=57||p>=65&&p<=90||p>=97&&p<=122||p===42||p===43||p===45||p===46||p===47||p===64||p===95}function U(p){return p<2048?q[192|p>>6]+q[128|p&63]:p<65536?q[224|p>>12]+q[128|p>>6&63]+q[128|p&63]:q[240|p>>18]+q[128|p>>12&63]+q[128|p>>6&63]+q[128|p&63]}function B(p){let d="";for(let x=0;x<p.length;x++){const I=p[x];if(I==="%"&&x+2<p.length){const T=p.slice(x+1,x+3);if(n(T)){const F=T.toUpperCase(),z=String.fromCharCode(parseInt(F,16));z!=="."&&s(z)?d+=z:d+="%"+F,x+=2;continue}}if(i(I))d+=I;else{const T=p.charCodeAt(x);if(T<128)d+=L(T)?I:q[T];else if(T<55296||T>57343)d+=U(T);else if(T<=56319&&x+1<p.length){const F=p.charCodeAt(x+1);F>=56320&&F<=57343?(d+=U(65536+(T-55296<<10)+(F-56320)),x++):d+=U(65533)}else d+=U(65533)}}return d}function W(p,d=!1){let x="",I=d&&p[0]!=="/";for(let T=0;T<p.length;T++){const F=p[T];if(F==="%"&&T+2<p.length){const z=p.slice(T+1,T+3);if(n(z)){x+="%"+z.toUpperCase(),T+=2;continue}}if(F==="/"&&(I=!1),i(F)&&(F!==":"||!I))x+=F;else{const z=p.charCodeAt(T);if(z<128)x+=q[z];else if(z<55296||z>57343)x+=U(z);else if(z<=56319&&T+1<p.length){const H=p.charCodeAt(T+1);H>=56320&&H<=57343?(x+=U(65536+(z-55296<<10)+(H-56320)),T++):x+=U(65533)}else x+=U(65533)}}return x}function Y(p){let d="";for(let x=0;x<p.length;x++){const I=p[x];if(I==="%"&&x+2<p.length){const T=p.slice(x+1,x+3);if(n(T)){const F=T.toUpperCase(),z=String.fromCharCode(parseInt(F,16));s(z)?d+=z:d+="%"+F,x+=2;continue}}if(a(I))d+=I;else{const T=p.charCodeAt(x);if(T<128)d+=L(T)?I:q[T];else if(T<55296||T>57343)d+=U(T);else if(T<=56319&&x+1<p.length){const F=p.charCodeAt(x+1);F>=56320&&F<=57343?(d+=U(65536+(T-55296<<10)+(F-56320)),x++):d+=U(65533)}else d+=U(65533)}}return d}function Q(p,d){let x="";for(let I=0;I<p.length;I++){const T=p[I];if(T==="%"&&I+2<p.length){const F=p.slice(I+1,I+3);if(n(F)){x+="%"+F.toUpperCase(),I+=2;continue}}if(d(T))x+=T;else{const F=p.charCodeAt(I);if(F<128)x+=q[F];else if(F<55296||F>57343)x+=U(F);else if(F<=56319&&I+1<p.length){const z=p.charCodeAt(I+1);z>=56320&&z<=57343?(x+=U(65536+(F-55296<<10)+(z-56320)),I++):x+=U(65533)}else x+=U(65533)}}return x}function Z(p){return Q(p,o)}function re(p){return Q(p,a)}function A(p){return Q(p,a)}function w(p){let d="";for(let x=0;x<p.length;x++){const I=p[x];if(I==="%"&&x+2<p.length){const F=p.slice(x+1,x+3);if(n(F)){d+="%"+F.toUpperCase(),x+=2;continue}}const T=p.charCodeAt(x);if(T<128)d+=L(T)?I:q[T];else if(T<55296||T>57343)d+=U(T);else if(T<=56319&&x+1<p.length){const F=p.charCodeAt(x+1);F>=56320&&F<=57343?(d+=U(65536+(T-55296<<10)+(F-56320)),x++):d+=U(65533)}else d+=U(65533)}return d}function j(p){const d=[];if(p.userinfo!==void 0&&(d.push(Z(p.userinfo)),d.push("@")),p.host!==void 0){let x=p.host;if(!t(x)){let I=C(x);I.isIPV6!==!0&&I.isIPVFuture!==!0&&(x=M(x,!0),I=C(x)),I.isIPV6===!0||I.isIPVFuture===!0?x=`[${I.escapedHost}]`:x=$(x,!1)}d.push(x)}if(typeof p.port=="number"||typeof p.port=="string"){const x=String(p.port);if(!r(x))throw new TypeError("URI port is malformed.");d.push(":"),d.push(x)}return d.length?d.join(""):void 0}return So={BYTE_HEX:q,percentEncodeNonAscii:U,nonSimpleDomain:_,nonSimpleMailtoDomain:E,recomposeAuthority:j,reescapeHostDelimiters:$,normalizePercentEncoding:M,normalizePathEncoding:B,serializePathEncoding:W,normalizeQueryFragmentEncoding:Y,encodeUserinfo:Z,encodeQuery:re,encodeFragment:A,escapePreservingEscapes:w,removeDotSegments:h,isIPv4:t,isUUID:e,normalizeIPv6:C,stringArrayToHexStripped:c},So}var wo,Kl;function ig(){if(Kl)return wo;Kl=1;const{isUUID:e,BYTE_HEX:t,percentEncodeNonAscii:r,nonSimpleMailtoDomain:n}=Bh(),s=/^([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-./:;=@]|%[\da-f]{2})+)$/iu,i=["http","https","ws","wss","urn","urn:uuid","mailto"];function a(F){return i.indexOf(F)!==-1}function o(F){return F.secure===!0?!0:F.secure===!1?!1:F.scheme?F.scheme.length===3&&(F.scheme[0]==="w"||F.scheme[0]==="W")&&(F.scheme[1]==="s"||F.scheme[1]==="S")&&(F.scheme[2]==="s"||F.scheme[2]==="S"):!1}function c(F){return F.host||(F.error=F.error||"HTTP URIs must have a host."),F}function l(F){const z=String(F.scheme).toLowerCase()==="https";return(F.port===(z?443:80)||F.port==="")&&(F.port=void 0),F.path||(F.path="/"),F}function u(F){return F.secure=o(F),F.resourceName=(F.path||"/")+(F.query?"?"+F.query:""),F.path=void 0,F.query=void 0,F}function m(F){if((F.port===(o(F)?443:80)||F.port==="")&&(F.port=void 0),typeof F.secure=="boolean"&&(F.scheme=F.secure?"wss":"ws",F.secure=void 0),F.resourceName){const z=F.resourceName.indexOf("?"),H=z===-1?F.resourceName:F.resourceName.slice(0,z);F.path=H&&H!=="/"?H:void 0,F.query=z===-1?void 0:F.resourceName.slice(z+1),F.resourceName=void 0}return F.fragment=void 0,F}function _(F,z){if(!F.path)return F.error="URN can not be parsed",F;const H=F.path.match(s);if(H&&H[0]===F.path){const R=z.scheme||F.scheme||"urn";F.nid=H[1].toLowerCase(),F.nss=H[2];const D=`${R}:${z.nid||F.nid}`,V=T(D);F.path=void 0,V&&(F=V.parse(F,z))}else F.error=F.error||"URN can not be parsed.";return F}function v(F,z){if(F.nid===void 0)throw new Error("URN without nid cannot be serialized");const H=z.scheme||F.scheme||"urn",R=F.nid.toLowerCase(),D=`${H}:${z.nid||R}`,V=T(D);V&&(F=V.serialize(F,z));const K=F,G=F.nss;return K.path=`${R||z.nid}:${G}`,z.skipEscape=!0,K}function S(F,z){const H=F;return H.uuid=H.nss,H.nss=void 0,!z.tolerant&&(!H.uuid||!e(H.uuid))&&(H.error=H.error||"UUID is not valid."),H}function E(F){const z=F;return z.nss=(F.uuid||"").toLowerCase(),z}const g={scheme:"http",domainHost:!0,parse:c,serialize:l},y={scheme:"https",domainHost:g.domainHost,parse:c,serialize:l},f={scheme:"ws",domainHost:!0,parse:u,serialize:m},C={scheme:"wss",domainHost:f.domainHost,parse:f.parse,serialize:f.serialize},P={scheme:"urn",parse:_,serialize:v,skipNormalize:!0},h={scheme:"urn:uuid",parse:S,serialize:E,skipNormalize:!0},b="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~!$'()*+=",O="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~!$'()*+,;:@",k="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~!$'()*+;:";function $(F,z=!1){const H=new Uint8Array(128);for(let V=0;V<F.length;V++)H[F.charCodeAt(V)]=1;const R=F.replace(/[\\\]^-]/gu,"\\$&"),D=z?`[${R}]|[^\\0-\\x7F\\uD800-\\uDFFF]`:`[${R}]`;return{all:new RegExp(`^(?:${D})*$`,"u"),table:H,allowNonAscii:z}}const M=$(b),q=$(O),L=$(k),U=$(k,!0),B=/^[\da-f]{2}$/iu,W=/^\[[\x21-\x5A\x5E-\x7E]*\]$/u,Y="URI mailto has an invalid recipient domain.",Q=/[\uD800-\uDFFF]/u;function Z(F){if(typeof F!="string"||F.indexOf("%")===-1)return F;try{return decodeURIComponent(F)}catch{return F}}function re(F){let z="";for(let H=0;H<F.length;H++){const R=F.charCodeAt(H);if(R>=55296&&R<=56319&&H+1<F.length){const D=F.charCodeAt(H+1);if(D>=56320&&D<=57343){z+=F[H]+F[H+1],H++;continue}}z+=R>=55296&&R<=57343?"":F[H]}return z}function A(F,z){if(z.all.test(F))return F;const H=z.table;let R="";for(let D=0;D<F.length;D++){const V=F.charCodeAt(D);if(V<128){H[V]===1?R+=F[D]:V===37&&D+2<F.length&&B.test(F.slice(D+1,D+3))?(R+="%"+F.slice(D+1,D+3).toUpperCase(),D+=2):R+=t[V];continue}if(V<55296||V>57343){R+=z.allowNonAscii?F[D]:r(V);continue}if(V<=56319&&D+1<F.length){const K=F.charCodeAt(D+1);if(K>=56320&&K<=57343){R+=z.allowNonAscii?F[D]+F[D+1]:r(65536+(V-55296<<10)+(K-56320)),D++;continue}}R+=z.allowNonAscii?"":r(65533)}return R}function w(F,z,H){const R=String(F).toLowerCase();if(W.test(R)||R!==""&&!n(R))return R;try{const D=new URL("http://"+R);if(D.username||D.password||D.port||D.pathname!=="/"||D.search||D.hash||!D.hostname)throw new Error(Y);return z&&z.unicodeSupport?R:D.hostname}catch{return H&&(H.error=H.error||Y),R}}function j(F,z){const H=z&&z.unicodeSupport?U:L;return F.length>1&&F[0]==="["&&F[F.length-1]==="]"?"["+A(F.slice(1,-1),H)+"]":A(F,H)}function p(F,z){const H=F;let R=H.path,D=H.query;R&&Q.test(R)&&(R=re(R)),D&&Q.test(D)&&(D=re(D));const V=R?R.indexOf(",")===-1?[R]:R.split(","):[];if(H.path=void 0,D){let K=null,G=0;for(;G<=D.length;){let J=D.indexOf("&",G);J===-1&&(J=D.length);const te=D.slice(G,J);G=J+1;const ne=te.indexOf("=");if(ne!==te.lastIndexOf("=")){H.error=H.error||"URI mailto has malformed header fields.";continue}const se=ne===-1?te:te.slice(0,ne),ce=ne===-1?"":te.slice(ne+1);if(se==="to"){const he=ce.split(",");for(let le=0;le<he.length;le++)V.push(he[le]);continue}if(se==="subject"){H.subject=Z(ce);continue}if(se==="body"){H.body=Z(ce);continue}K===null&&(K=Object.create(null)),K[Z(se)]=Z(ce)}K!==null&&(H.headers=K)}H.query=void 0;for(let K=0;K<V.length;K++){const G=V[K],J=G.lastIndexOf("@");if(J<0){H.error=H.error||Y,V[K]=Z(G);continue}const te=Z(G.slice(0,J)),ne=w(Z(G.slice(J+1)),z,H);V[K]=te+"@"+ne}return V.length&&(H.to=V),H}function d(F,z){const H=F,R=Array.isArray(H.to)?H.to.slice():[];if(R.length){for(let G=0;G<R.length;G++){const J=String(R[G]),te=J.lastIndexOf("@"),ne=te>=0?J.slice(0,te):J,se=te>=0?J.slice(te+1):"",ce=A(ne,M),he=Z(se),le=w(he,z);R[G]=ce+"@"+j(le,z)}H.path=R.join(","),z.skipEscape=!0}else H.path=void 0;const D=H.headers&&typeof H.headers=="object"?Object.assign(Object.create(null),H.headers):Object.create(null);H.subject&&(D.subject=H.subject),H.body&&(D.body=H.body),H.headers=D;let V="",K=0;for(const G in D)K++!==0&&(V+="&"),V+=A(G,q)+"="+A(String(D[G]),q);return K!==0?H.query=V:H.headers=void 0,H}const I={http:g,https:y,ws:f,wss:C,urn:P,"urn:uuid":h,mailto:{scheme:"mailto",parse:p,serialize:d,domainHost:!1,unicodeSupport:!0,skipNormalize:!0,absolutePath:!0}};Object.setPrototypeOf(I,null);function T(F){return F&&(I[F]||I[F.toLowerCase()])||void 0}return wo={wsIsSecure:o,SCHEMES:I,isValidSchemeName:a,getSchemeHandler:T},wo}var Gl;function sg(){if(Gl)return yi.exports;Gl=1;const{normalizeIPv6:e,removeDotSegments:t,recomposeAuthority:r,normalizePercentEncoding:n,normalizePathEncoding:s,serializePathEncoding:i,normalizeQueryFragmentEncoding:a,encodeQuery:o,encodeFragment:c,reescapeHostDelimiters:l,isIPv4:u,nonSimpleDomain:m}=Bh(),{SCHEMES:_,getSchemeHandler:v}=ig(),S=/^[A-Za-z][A-Za-z0-9+.-]*$/u,E="URI scheme is malformed.";function g(A){const w=unescape(String(A));if(!S.test(w))throw new TypeError(E);return w}function y(A,w){return typeof A=="string"?A=Y(A,w):typeof A=="object"&&(A=W(h(A,w),w)),A}function f(A,w,j){const p=j?Object.assign({scheme:"null"},j):{scheme:"null"},{parsed:d,malformedAuthorityOrPort:x,malformedPercentEncoding:I,malformedSchemeSpecific:T,malformedHost:F,malformedScheme:z}=B(A,p),{parsed:H,malformedAuthorityOrPort:R,malformedPercentEncoding:D,malformedSchemeSpecific:V,malformedHost:K,malformedScheme:G}=B(w,p);if(x||R||I||D||T||V||F||K||z||G)throw new Error(d.error||H.error||"URI is malformed.");const J=C(d,H,p,!0),te=v(j&&j.scheme||J.scheme),ne=J.host,se=ne!==void 0&&ne!==""&&(u(ne)||e(ne).isIPV6);U(J,j||{},te,se);const ce=ne&&ne.indexOf("%")!==-1&&!new RegExp("\\P{ASCII}","u").test(ne);if(J.error&&!ce)throw new Error(J.error);return p.skipEscape=!0,h(J,p)}function C(A,w,j,p){const d={};return p||(A=W(h(A,j),j),w=W(h(w,j),j)),j=j||{},!j.tolerant&&w.scheme?(d.scheme=w.scheme,d.userinfo=w.userinfo,d.host=w.host,d.port=w.port,d.path=t(w.path||""),d.query=w.query):(w.userinfo!==void 0||w.host!==void 0||w.port!==void 0?(d.userinfo=w.userinfo,d.host=w.host,d.port=w.port,d.path=t(w.path||""),d.query=w.query):(w.path?(w.path[0]==="/"?d.path=t(w.path):((A.userinfo!==void 0||A.host!==void 0||A.port!==void 0)&&!A.path?d.path="/"+w.path:A.path?d.path=A.path.slice(0,A.path.lastIndexOf("/")+1)+w.path:d.path=w.path,d.path=t(d.path)),d.query=w.query):(d.path=A.path,w.query!==void 0?d.query=w.query:d.query=A.query),d.userinfo=A.userinfo,d.host=A.host,d.port=A.port),d.scheme=A.scheme),d.fragment=w.fragment,d}function P(A,w,j){const p=Z(A,j),d=Z(w,j);return p!==void 0&&d!==void 0&&p===d}function h(A,w){const j={host:A.host,scheme:A.scheme,userinfo:A.userinfo,port:A.port,path:A.path,query:A.query,nid:A.nid,nss:A.nss,uuid:A.uuid,fragment:A.fragment,reference:A.reference,resourceName:A.resourceName,secure:A.secure,to:A.to,subject:A.subject,body:A.body,headers:A.headers,error:""},p=Object.assign({},w),d=[];j.scheme&&(j.scheme=g(j.scheme));const x=v(p.scheme||j.scheme);x&&x.serialize&&x.serialize(j,p);const I=j.userinfo!==void 0||j.host!==void 0||j.port!==void 0,T=!p.skipEscape&&j.scheme===void 0&&!I;j.path!==void 0&&(p.skipEscape?j.path=n(j.path):j.path=i(j.path,T)),p.reference!=="suffix"&&j.scheme&&(j.scheme=g(j.scheme),d.push(j.scheme,":"));const F=r(j);if(F!==void 0&&(p.reference!=="suffix"&&d.push("//"),d.push(F),j.path&&j.path[0]!=="/"&&d.push("/")),j.path!==void 0){let z=j.path;!p.absolutePath&&(!x||!x.absolutePath)&&(z=t(z)),T&&(z=i(z,!0)),F===void 0&&z[0]==="/"&&z[1]==="/"&&(z="/%2F"+z.slice(2)),d.push(z)}return j.query!==void 0&&d.push("?",o(j.query)),j.fragment!==void 0&&d.push("#",c(j.fragment)),d.join("")}const b=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u,O=/^(?:[^#/:?]+:)?\/\/([^/?#]*)/,k=/^(?:[^#/:?]+:)?([/\\\t\n\r]*)/;function $(A,w){if(w[2]!==void 0&&A.path&&A.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof A.port=="number"&&(A.port<0||A.port>65535))return"URI port is malformed."}function M(A){if(A===void 0)return!1;let w=A.indexOf("%");for(;w!==-1;){if(w+2>=A.length||!/^[\da-f]{2}$/iu.test(A.slice(w+1,w+3)))return!0;w=A.indexOf("%",w+3)}return!1}function q(A){return A[0]==="["&&A[A.length-1]==="]"}function L(A){const w=A[4];return M(A[3])||w!==void 0&&!q(w)&&M(w)||M(A[6])||M(A[7])||M(A[8])}function U(A,w,j,p){const d=A.host&&A.host[0]==="["&&A.host[A.host.length-1]==="]";if(!w.unicodeSupport&&(!j||!j.unicodeSupport)&&A.host&&!q(A.host)&&(w.domainHost||j&&j.domainHost)&&p===!1&&!d&&m(A.host))try{A.host=new URL("http://"+A.host).hostname}catch(x){return A.error=A.error||"Host's domain name can not be converted to ASCII: "+x,!0}return!1}function B(A,w){const j=Object.assign({},w),p={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0};let d=!1,x=!1,I=!1,T=!1,F=!1,z=!1,H=!1;j.reference==="suffix"&&(j.scheme?A=j.scheme+":"+A:A="//"+A);const R=A.match(O);R!==null&&R[1].indexOf("\\")!==-1&&(p.error="URI authority must not contain a literal backslash.",d=!0);const D=A.match(k);if(D!==null){const K=D[1],G=K.replace(/[\t\n\r]/g,"");G.length>=2&&(G.slice(0,2)!=="//"?(p.error=p.error||"URI authority must not contain a literal backslash.",d=!0):K.length!==G.length&&(p.error=p.error||"URI authority introducer must not contain whitespace.",d=!0))}const V=A.match(b);if(V){if(p.scheme=V[1],p.userinfo=V[3],p.host=V[4],p.port=parseInt(V[5],10),p.path=V[6]||"",p.query=V[7],p.fragment=V[8],p.scheme!==void 0){const J=unescape(p.scheme);S.test(J)?p.scheme=J.toLowerCase():(p.error=p.error||E,z=!0)}x=L(V),x&&(p.error=p.error||"URI contains malformed percent-encoding."),isNaN(p.port)&&(p.port=V[5]);const K=$(p,V);if(K!==void 0&&(p.error=p.error||K,d=!0),p.host)if(u(p.host)===!1){const te=q(p.host),ne=p.host.indexOf("[")!==-1||p.host.indexOf("]")!==-1,se=e(p.host);H=se.isIPV6||se.isIPVFuture===!0,F=ne&&(!te||se.error===!0),p.host=H?se.host:se.host.toLowerCase(),F&&(p.error=p.error||"URI host is malformed.",d=!0)}else H=!0;p.scheme===void 0&&p.userinfo===void 0&&p.host===void 0&&p.port===void 0&&p.query===void 0&&!p.path?p.reference="same-document":p.scheme===void 0?p.reference="relative":p.fragment===void 0?p.reference="absolute":p.reference="uri",j.reference&&j.reference!=="suffix"&&j.reference!==p.reference&&(p.error=p.error||"URI is not a "+j.reference+" reference.");const G=v(j.scheme||p.scheme);if(F||(T=U(p,j,G,H)),!G||G&&!G.skipNormalize){if(A.indexOf("%")!==-1&&p.host!==void 0&&!F){const J=H?p.host:n(p.host,!0);p.host=l(J,H)}p.path&&(p.path=s(p.path)),p.query&&(p.query=a(p.query)),p.fragment&&(p.fragment=a(p.fragment))}G&&G.parse&&(G.parse(p,j),G===_.urn&&p.nid===void 0&&(I=!0))}else p.error=p.error||"URI can not be parsed.";return{parsed:p,malformedAuthorityOrPort:d,malformedPercentEncoding:x,malformedSchemeSpecific:I,malformedHost:T,malformedScheme:z}}function W(A,w){return B(A,w).parsed}function Y(A,w){return Q(A,w).normalized}function Q(A,w){const{parsed:j,malformedAuthorityOrPort:p,malformedPercentEncoding:d,malformedSchemeSpecific:x,malformedHost:I,malformedScheme:T}=B(A,w);return{normalized:p||d||x||I||T?A:h(j,w),malformedAuthorityOrPort:p,malformedPercentEncoding:d,malformedSchemeSpecific:x,malformedHost:I,malformedScheme:T}}function Z(A,w){if(typeof A!="string"&&typeof A!="object")return;let j;try{j=typeof A=="string"?A:h(A,w)}catch{return}const{normalized:p,malformedAuthorityOrPort:d,malformedPercentEncoding:x,malformedSchemeSpecific:I,malformedHost:T,malformedScheme:F}=Q(j,w);return d||x||I||T||F?void 0:p}const re={SCHEMES:_,normalize:y,resolve:f,resolveComponent:C,equal:P,serialize:h,parse:W};return yi.exports=re,yi.exports.default=re,yi.exports.fastUri=re,yi.exports}var ag=sg();const Kc=Fi(ag);var gi={},Wl;function og(){if(Wl)return gi;Wl=1;var e=/~/,t=/~[01]/g;function r(l){switch(l){case"~1":return"/";case"~0":return"~"}throw new Error("Invalid tilde escape: "+l)}function n(l){return e.test(l)?l.replace(t,r):l}function s(l,u,m){for(var _,v,S=1,E=u.length;S<E;){if(u[S]==="constructor"||u[S]==="prototype"||u[S]==="__proto__")return l;if(_=n(u[S++]),v=E>S,typeof l[_]>"u"&&(Array.isArray(l)&&_==="-"&&(_=l.length),v&&(u[S]!==""&&u[S]<1/0||u[S]==="-"?l[_]=[]:l[_]={})),!v)break;l=l[_]}var g=l[_];return m===void 0?delete l[_]:l[_]=m,g}function i(l){if(typeof l=="string"){if(l=l.split("/"),l[0]==="")return l;throw new Error("Invalid JSON pointer.")}else if(Array.isArray(l)){for(const u of l)if(typeof u!="string"&&typeof u!="number")throw new Error("Invalid JSON pointer. Must be of type string or number.");return l}throw new Error("Invalid JSON pointer.")}function a(l,u){if(typeof l!="object")throw new Error("Invalid input object.");u=i(u);var m=u.length;if(m===1)return l;for(var _=1;_<m;){if(l=l[n(u[_++])],m===_)return l;if(typeof l!="object"||l===null)return}}function o(l,u,m){if(typeof l!="object")throw new Error("Invalid input object.");if(u=i(u),u.length===0)throw new Error("Invalid JSON pointer for set.");return s(l,u,m)}function c(l){var u=i(l);return{get:function(m){return a(m,u)},set:function(m,_){return o(m,u,_)}}}return gi.get=a,gi.set=o,gi.compile=c,gi}var cg=og();const Co=Fi(cg);function Ia(e,t){if(Ue in e&&Kc.equal(e[Ue],t))return e;for(const r of Object.values(e))if(Array.isArray(r)){for(const n of r)if(ue(n)){const s=Ia(n,t);if(s!==void 0)return s}}else if(ue(r)){const n=Ia(r,t);if(n!==void 0)return n}}function gc(e,t){const r=e[Ue]??t;let n=e;Je in n&&(n={...n,[Je]:Kc.resolve(r,n[Je])});for(const[s,i]of Object.entries(n))Array.isArray(i)?n={...n,[s]:i.map(a=>ue(a)?gc(a,r):a)}:ue(i)&&(n={...n,[s]:gc(i,r)});return n}function Gc(e,t){const{[e]:r,...n}=t;return[n,r]}function Hh(e,t={},r=[],n=t[Ue]){const s=e||"";let i,a=n;if(s.startsWith("#")){const c=decodeURIComponent(s.substring(1));a===void 0||Ue in t&&t[Ue]===a?i=Co.get(t,c):t[Ei]===Sa&&(i=Ia(t,a.replace(/\/$/,"")),i!==void 0&&(i=Co.get(i,c)))}else if(t[Ei]===Sa){const c=a?Kc.resolve(a,s):s,[l,...u]=c.replace(/#\/?$/,"").split("#");i=Ia(t,l.replace(/\/$/,"")),i!==void 0&&(a=i[Ue],u.length>0&&(i=Co.get(i,decodeURIComponent(u.join("#")))))}if(i===void 0)throw new Error(`Could not find a definition for ${e}.`);const o=i[Je];if(o){if(r.includes(o)){if(r.length===1)throw new Error(`Definition for ${e} is a circular reference`);const[m,..._]=r,v=[..._,s,m].join(" -> ");throw new Error(`Definition for ${m} contains a circular reference through ${v}`)}const[c,l]=Gc(Je,i),u=Hh(l,t,[...r,s],a);return Object.keys(c).length>0?t[Ei]===$y||t[Ei]===Sa?{[yr]:[c,u]}:{...c,...u}:u}return i}function ki(e,t={},r=t[Ue]){return Hh(e,t,[],r)}const lg=/^(?:0|[1-9]\d*)$/;function rr(e){return e.split(/[.[\]]+/).filter(Boolean)}function ug(e){return Array.isArray(e)?e:[e]}function Jl(e){return e==="__proto__"}function dg(e){return typeof e=="number"?Number.isInteger(e)&&e>=0:lg.test(e)}function wn(e){return e!=null&&(typeof e=="object"||typeof e=="function")}function me(e,t,r){let n;if(!Array.isArray(t))n=wn(e)&&Object.hasOwn(e,t)?e[t]:void 0;else if(t.length===0)n=void 0;else{n=e;for(let s=0;s<t.length;s++){const i=t[s];if(!wn(n)||!Object.hasOwn(n,i)){n=void 0;break}n=n[i]}}return n===void 0?r:n}function at(e,t,r,n=!1){if(!wn(e))return e;if(!Array.isArray(t)){if(!Jl(t)){const a=e;a[t]=r}return e}const s=t;if(s.some(Jl))return e;let i=e;for(let a=0;a<s.length;a++){const o=s[a];if(a===s.length-1)i[o]=r;else{const c=Object.hasOwn(i,o)?i[o]:void 0;if(wn(c))i=c;else{const l=n||!dg(s[a+1])?{}:[];i[o]=l,wn(l)&&(i=l)}}}return e}function lt(e,t){if(!Array.isArray(t))return wn(e)&&Object.hasOwn(e,t);let r=e;for(let n=0;n<t.length;n++){if(!wn(r)||!Object.hasOwn(r,t[n]))return!1;r=r[t[n]]}return t.length>0}function fg(e,t){const r=ug(t);if(r.length===0)return!0;const n=r.length>1?me(e,r.slice(0,-1)):e;if(n==null)return!0;try{return Reflect.deleteProperty(n,r[r.length-1])}catch{return!1}}function Kt(e){let t;const r=me(e,ky);return typeof r=="string"?t=r:r!==void 0&&console.warn(`Expecting discriminator to be a string, got "${typeof r}" instead`),t}function Ni(e){return Array.isArray(e)?"array":typeof e=="string"?"string":e==null?"null":typeof e=="boolean"?"boolean":typeof e=="number"&&!Number.isNaN(e)?"number":typeof e=="object"?"object":"string"}function Gt(e){let{type:t}=e;return!t&&e.const?Ni(e.const):!t&&e.enum?"string":!t&&(e.properties||e.additionalProperties||e.patternProperties)?"object":(Array.isArray(t)&&(t.length===2&&t.includes("null")?t=t.find(r=>r!=="null"):t=t[0]),t)}function jr(e,t){const r={...e},n=Object.keys(t).reduce((s,i)=>{const a=e?e[i]:{},o=t[i];return e&&i in e&&ue(o)?s[i]=jr(a,o):e&&t&&(Gt(e)==="object"||Gt(t)==="object")&&i===Mh&&Array.isArray(a)&&Array.isArray(o)?s[i]=[...new Set([...a,...o])]:s[i]=o,s},r);for(const s of Object.getOwnPropertySymbols(t))n[s]=t[s];return n}function gr(e,t){return e?.[nt]?.[t]??{}}function Kh(e,t,r){if(e&&r){const n=me(e,r);if(n===void 0)return;for(let s=0;s<t.length;s+=1){const i=t[s],a=gr(i,r);if(a.type!=="object"&&a.type!=="array"&&(a.const===n||a.enum?.includes(n)))return s}}}function Ra(e,t,r,n,s){if(t===void 0)return 0;const i=Kh(t,r,s);if(typeof i=="number")return i;for(let a=0;a<r.length;a+=1){const o=r[a],c=s?o[nt]?.[s]:void 0;if(s&&c!==void 0){const l=me(t,s);if(e.isValid(c,l,n))return a}else if(o[nt]){const l={anyOf:Object.keys(o[nt]).map(m=>({required:[m]}))};let u;if(o.anyOf){const{...m}=o;m.allOf?m.allOf=m.allOf.slice():m.allOf=[],m.allOf.push(l),u=m}else u={...o,...l};if(delete u.required,e.isValid(u,t,n))return a}else if(e.isValid(o,t,n))return a}return 0}const hg=Object.prototype;function Ai(e){for(const t in e)if(hg.hasOwnProperty.call(e,t))return!1;return!0}const mg=["array","boolean","integer","null","number","object","string"];new Set(mg);const pg=["$defs","definitions","properties","patternProperties","dependencies"];new Set(pg);const yg=["items","allOf","oneOf","anyOf"];new Set(yg);const gg=["items","additionalItems","additionalProperties","propertyNames","contains","if","then","else","not"];new Set(gg);function wa(e){return typeof e=="object"}function ur(e){return wa(e)?Ai(e):e===!0}function Yn(e,t){return e<t?-1:e>t?1:0}function Eo(e,t){const r=e.length;if(r===0)return t;let n=t.length;if(n===0)return e;if(r<n){const i=e;e=t,t=i,n=r}const s=new Set(e);for(let i=0;i<n;i++)s.add(t[i]);return Array.from(s)}function vg(e,t){const r=[];if(e.length===0||t.length===0)return r;if(e.length>t.length){const s=e;e=t,t=s}const n=new Set(t);for(let s=0;s<e.length&&n.size>0;s++){const i=e[s];n.delete(i)&&r.push(i)}return r}function Yl(e){return e.length===0}function Ao(e){return(t,r)=>{const n=t.length-r.length;if(n!==0)return n;for(let s=0;s<t.length;s++)if(t[s]!==r[s]){const i=e(t[s],r[s]);if(i!==0)return i}return 0}}function Gh(e,{threshold:t=12}={}){return r=>{const n=r.length;if(n===0)return r;if(n<=t){const a=[];let o=0;e:for(let c=0;c<n;c++){const l=r[c];for(let u=0;u<o;u++)if(e(l,a[u])===0)continue e;o=a.push(l)}return a}const s=r.slice().sort(e);let i=0;for(let a=1;a<n;a++)e(s[i],s[a])!==0&&++i!==a&&(s[i]=s[a]);return s.length=i+1,s}}function bg(e){return(t,r)=>{const n=[];let s=t.length,i=r.length;if(s===0||i===0)return n;if(s>i){const u=t;t=r,r=u;const m=s;s=i,i=m}const a=[...t].sort(e),o=[...r].sort(e);let c=0,l=0;for(;c<s&&l<i;){const u=e(a[c],o[l]);u===0?((n.length===0||e(n[n.length-1],a[c])!==0)&&n.push(a[c]),c++,l++):u<0?c++:l++}return n}}function _g(e,t){return r=>{if(e.has(r))return e.get(r);const n=t(r);return e.set(r,n),n}}const Xl=_g,Wh=()=>0,Sg=e=>e===void 0,wg=e=>typeof e!="object",Zl={boolean:0,number:1,string:2};function Cg(e,t){const r=typeof e,n=typeof t;return r===n?Yn(e,t):Zl[r]-Zl[n]}function Eg(e,t){const r=e.length;if(r===0)return t;const n=t.length;if(n===0)return e;if(n>r){const a=e;e=t,t=a}const s=new Set(e),i=t.length;for(let a=0;a<i;a++){const o=t[a];s.has(o)||e.push(o)}return e}function Ha(e,t,r=Wh){return(n,s)=>e(n)?e(s)?r(n,s):-1:e(s)?1:t(n,s)}function Gn(e){return Ha(Sg,e)}function qr(e,t){return Ha(r=>r===void 0||e(r),t)}function xo(e,t){return Ha(Array.isArray,e,t)}const ct=Gn(Yn),Po=qr(e=>e===0,(e,t)=>e-t);function Ag({deduplicationCache:e=new WeakMap,sortedKeysCache:t=new WeakMap}={}){const r=Xl(t,E=>Object.keys(E).sort());function n(E){return(g,y)=>{const f=r(g),C=r(y),P=Math.min(f.length,C.length);for(let h=0;h<P;h++){const b=Yn(f[h],C[h]);if(b!==0)return b}if(f.length!==C.length)return f.length-C.length;for(let h=0;h<P;h++){const b=f[h],O=E(g[b],y[b]);if(O!==0)return O}return 0}}function s(E){const g=Ao(E),y=Xl(e,Gh(E,{threshold:0}));return(f,C)=>g(y(f),y(C))}const i=s(Yn);function a(E,g){if(wa(E)){if(wa(g)){const y=Object.keys(E),f=Object.keys(g),C=Eg(y,f),P=C.length;for(let h=0;h<P;h++){const b=C[h];if(E[b]===g[b])continue;const k=(S[b]??o)(E[b],g[b]);if(k!==0)return k}return 0}return g===!0&&Ai(E)?0:1}return wa(g)?E===!0&&Ai(g)?0:-1:Yn(E,g)}const o=Gn(l),c=Ha(wg,xo(n(o),Ao(l)),Cg);function l(E,g){return E===null?-1:g===null?1:c(E,g)}const u=Gn(a),m=qr(Ai,n(u)),_=Gn(s(a)),v=qr(ur,a),S={$id:ct,$comment:ct,$defs:m,$ref:ct,$schema:ct,const:o,contains:u,contentEncoding:ct,contentMediaType:ct,default:o,definitions:m,description:ct,else:u,examples:o,exclusiveMaximum:ct,exclusiveMinimum:ct,format:ct,if:u,maximum:ct,maxItems:ct,maxLength:ct,maxProperties:ct,minimum:ct,multipleOf:ct,not:u,pattern:ct,propertyNames:u,readOnly:ct,then:u,title:ct,writeOnly:ct,uniqueItems:qr(E=>E===!1,Wh),minLength:Po,minItems:Po,minProperties:Po,required:qr(Yl,i),enum:qr(Yl,s(l)),type:Gn((E,g)=>{const y=Array.isArray(E),f=Array.isArray(g);return!y&&!f?Yn(E,g):i(y?E:[E],f?g:[g])}),items:qr(E=>!Array.isArray(E)&&ur(E),xo(a,Ao(a))),anyOf:_,allOf:_,oneOf:_,properties:m,patternProperties:m,additionalProperties:v,additionalItems:v,dependencies:qr(Ai,n(Gn(xo(a,i))))};return{compareSchemaValues:l,compareSchemaDefinitions:a}}function Ql(e){return e}const Jh=(e,t)=>e?Jh(t%e,e):t,xg=(e,t)=>Math.abs(e*t)/Jh(e,t);function Pg(e,t){return e===t?e:`(?=.*(?:${e}))(?=.*(?:${t}))`}function Oo(e,t,r){const n=e.length,s=t.length;if(n>0&&s>0)for(let i=0;i<n;i++){const a=e[i];for(let o=0;o<s;o++)r(a,t[o])}}function jo(e,t){return e||t}function eu(e){return(t,r)=>{const n={...t},s=Object.keys(r),i=s.length;for(let a=0;a<i;a++){const o=s[a];n[o]=t[o]===void 0?r[o]:e(t[o],r[o])}return n}}function Og(e){const t=new Map;for(const r of e)for(const n of r[0])t.set(n,r[1]);return t}function ln(e,t,r){r===void 0||ur(r)?delete e[t]:e[t]=r}const jg=["properties","patternProperties","additionalProperties"];function tu(e){const t=Object.keys(e),r=t.length,n=[];for(let s=0;s<r;s++){const i=t[s];n.push({regExp:new RegExp(i),schema:e[i]})}return[n,t]}const ru=[[],[]];function nu(e,t,r){const n=r.length;for(let s=0;s<n;s++){const i=r[s];if(!i.regExp.test(t))continue;const a=i.schema;if(a===!1)return!0;e.push(a)}return!1}const kg=["items","additionalItems"],Ng=["if","then","else"];function iu(e,t){return t.if!==void 0&&(e.if=t.if),t.then!==void 0&&(e.then=t.then),t.else!==void 0&&(e.else=t.else),e}function ko(e,t){if(e===t)return e;switch(e){case"number":if(t==="integer")return"integer";case"integer":if(t==="number")return"integer";default:return}}function un(e,t,r){return[e,t,r]}function Ig(e){const t=new Map;for(const[r,n,s]of e){const i=a=>{if(!s(a))throw new Error(`Schema keys '${r}' and '${n}' are conflicting (${r}: ${JSON.stringify(a[r])}, ${n}: ${JSON.stringify(a[n])})`)};for(const a of[[r,n],[n,r]]){let o=t.get(a[0]);o===void 0&&(o=[],t.set(a[0],o)),o.push({oppositeKey:a[1],check:i})}}return t}const Rg=[un("minimum","maximum",e=>e.maximum>=e.minimum),un("exclusiveMinimum","maximum",e=>e.maximum>e.exclusiveMinimum),un("minimum","exclusiveMaximum",e=>e.exclusiveMaximum>e.minimum),un("exclusiveMinimum","exclusiveMaximum",e=>e.exclusiveMaximum>e.exclusiveMinimum),un("minLength","maxLength",e=>e.maxLength>=e.minLength),un("minItems","maxItems",e=>e.maxItems>=e.minItems),un("minProperties","maxProperties",e=>e.maxProperties>=e.minProperties)];function $g({mergePatterns:e=Pg,isSubRegExp:t=Object.is,intersectJson:r=vg,deduplicateJsonSchemaDef:n=Ql,defaultMerger:s=Ql,assigners:i=[],checks:a=Rg,mergers:o}={}){function c(P){const h=P.length;let b=P[0];for(let O=1;O<h;O++){const k=y(b,P[O]);if(k===!1)return!1;ur(k)||(b=k)}return b}function l(P,h,b,O,k,$,M){if(P.length=0,b===!1)return!1;if(P.push(b),k!==void 0){if(k===!1)return!1;P.push(k)}if(nu(P,h,$))return!1;const L=P.length<2;if(M===!1){if(L)return;if(nu(P,h,O))return!1}else L&&M!==void 0&&P.push(M);return P.length===1?P[0]:c(P)}function u(P,h,b,O,k,$){const M=b.length;if(M>0&&k!==!1)if($)Object.assign(P,h);else for(let q=0;q<M;q++){const L=b[q];O.has(L)||(P[L]=y(h[L],k))}return P}const m=(P,{properties:h={},patternProperties:b,additionalProperties:O=!0},{properties:k={},patternProperties:$,additionalProperties:M=!0})=>{const q=ur(O),L=ur(M);if(q&&L)return ln(P,"properties",f(h,k)),ln(P,"patternProperties",b&&$?f(b,$):b??$),delete P.additionalProperties,P;const U=y(O,M);ln(P,"additionalProperties",U);const B={},W=Object.keys(h),Y=W.length,[Q,Z]=b?tu(b):ru,[re,A]=$?tu($):ru,w=[],j=new Set,p=L?void 0:M;for(let z=0;z<Y;z++){const H=W[z];j.add(H);const R=l(w,H,h[H],Q,k[H],re,p);R!==void 0&&(B[H]=R)}const d=Object.keys(k),x=d.length,I=q?void 0:O;for(let z=0;z<x;z++){const H=d[z];if(j.has(H))continue;const R=l(w,H,k[H],re,void 0,Q,I);R!==void 0&&(B[H]=R)}ln(P,"properties",B);let T={};const F=new Set;return Z.length>0&&A.length>0&&Oo(Z,A,(z,H)=>{t(z,H)&&F.add(z),t(H,z)&&F.add(H),T[e(z,H)]=y(b[z],$[H])}),T=u(T,b,Z,F,M,L),T=u(T,$,A,F,O,q),ln(P,"patternProperties",T),P},_=(P,{items:h=[],additionalItems:b},{items:O=[],additionalItems:k})=>{const $=Array.isArray(h),M=Array.isArray(O),q=[];if(P.items=q,$&&M){const[L,U,B]=h.length<O.length?[h.length,b,O]:[O.length,k,h];let W=0;for(;W<L;W++)q.push(y(h[W],O[W]));if(U===!1)P.additionalItems=!1;else{const Y=U===void 0||ur(U);for(;W<B.length;W++)q.push(Y?B[W]:y(B[W],U));ln(P,"additionalItems",b!==void 0&&k!==void 0?y(b,k):b??k)}}else if($||M){const[L,U,B]=$?[h,O,b]:[O,h,k];ln(P,"additionalItems",B&&y(B,U));for(let W=0;W<L.length;W++)q.push(y(L[W],U))}else delete P.additionalItems,P.items=y(h,O);return P},v=(P,h,b)=>{iu(P,h);const O=iu({},b);return P.allOf===void 0?P.allOf=[O]:P.allOf=P.allOf.concat(O),P};function S(P,h){const b=[];if(Oo(P,h,(O,k)=>{try{b.push(y(O,k))}catch{}}),b.length===0)throw new Error(`No valid schema combinations could be produced for "${JSON.stringify(P)}" and "${JSON.stringify(h)}"; the merged result is empty`);return n(b)}const E=Og([[jg,m],[kg,_],[Ng,v],...i]),g=Ig(a);function y(P,h){if(P===!1||h===!1)return!1;if(ur(P))return ur(h)?!0:h;if(ur(h))return P;let b={...P};const O=new Set,k=new Set,$=Reflect.ownKeys(h),M=$.length;for(let q=0;q<M;q++){const L=$[q],U=h[L];if(U===void 0)continue;const B=g.get(L);if(B!==void 0){const Z=B.length;for(let re=0;re<Z;re++){const A=B[re];P[A.oppositeKey]!==void 0&&k.add(A.check)}}const W=P[L];if(W===void 0){b[L]=U;continue}const Y=E.get(L);if(Y){O.add(Y);continue}const Q=C[L]??s;b[L]=Q(W,U)}for(const q of O)b=q(b,P,h);for(const q of k)q(b);return b}const f=eu(y),C={$id:s,$ref:s,$schema:s,$comment:s,$defs:f,definitions:f,type:(P,h)=>{if(P===h)return P;const b=Array.isArray(P),O=Array.isArray(h);if(!b&&!O){const k=ko(P,h);if(k!==void 0)return k}else if(b||O){const k=new Set;if(b&&O)Oo(P,h,(M,q)=>{const L=ko(M,q);L!==void 0&&k.add(L)});else{const M=b?P:h,q=b?h:P,L=M.length;for(let U=0;U<L;U++){const B=ko(q,M[U]);B!==void 0&&k.add(B)}}const $=k.size;if($===1)return k.values().next().value;if($>1)return Array.from(k)}throw new Error(`It is not possible to create an intersection of the following incompatible types: ${P.toString()}, ${h.toString()}`)},default:s,description:s,title:s,const:s,format:s,contentEncoding:s,contentMediaType:s,not:(P,h)=>{const b=n([P,h]);return b.length===1?b[0]:{anyOf:b}},pattern:e,readOnly:jo,writeOnly:jo,enum:(P,h)=>{const b=r(P,h);if(b.length===0)throw new Error(`Intersection of the following enums is empty: "${JSON.stringify(P)}", "${JSON.stringify(h)}"`);return b},anyOf:S,oneOf:S,allOf:(P,h)=>n(P.concat(h)),propertyNames:y,contains:y,dependencies:eu((P,h)=>Array.isArray(P)?Array.isArray(h)?Eo(P,h):y(h,{required:P}):Array.isArray(h)?y(P,{required:h}):y(P,h)),examples:(P,h)=>{if(!Array.isArray(P)||!Array.isArray(h))throw new Error(`Value of the 'examples' field should be an array, but got "${JSON.stringify(P)}" and "${JSON.stringify(h)}"`);return Eo(P,h)},multipleOf:(P,h)=>{let b=1;for(;!Number.isInteger(P)||!Number.isInteger(h);)b*=10,P*=10,h*=10;return xg(P,h)/b},exclusiveMaximum:Math.min,maximum:Math.min,maxItems:Math.min,maxLength:Math.min,maxProperties:Math.min,exclusiveMinimum:Math.max,minimum:Math.max,minItems:Math.max,minLength:Math.max,minProperties:Math.max,uniqueItems:jo,required:Eo,...o};return{mergeSchemaDefinitions:y,mergeArrayOfSchemaDefinitions:c}}function Fg(e){const t=[],r=[e];for(;r.length>0;){const n=r.pop();if(typeof n=="boolean"||n.allOf===void 0){t.push(n);continue}const{allOf:s,...i}=n;t.push(i);for(let a=s.length-1;a>=0;a--)r.push(s[a])}return t}function Dg(e){return t=>e(Fg(t))}const{compareSchemaDefinitions:Tg,compareSchemaValues:Mg}=Ag(),{mergeArrayOfSchemaDefinitions:qg}=$g({intersectJson:bg(Mg),deduplicateJsonSchemaDef:Gh(Tg)}),Yh=Dg(qg);function bt(e,t,r={},n,s,i=!1){return hr(e,t,r,n,void 0,void 0,s,i)[0]}function Xh(e){return typeof e!="boolean"?e:e?{}:{not:{}}}function Ug(e,t,r,n,s,i,a){const{if:o,then:c,else:l,...u}=t,m=e.isValid(o,i||{},r);let _=[u],v=[];if(n){if(c&&typeof c!="boolean"){const S=c;v=v.concat(hr(e,S,r,i,n,s,a))}if(l&&typeof l!="boolean"){const S=l;v=v.concat(hr(e,S,r,i,n,s,a))}}else{const S=m?c:l;if(S!==void 0){const E=Xh(S);v=v.concat(hr(e,E,r,i,n,s,a))}}return v.length&&(_=v.map(S=>jr(u,S))),_.flatMap(S=>hr(e,S,r,i,n,s,a))}function Zh(e){return e.reduce((r,n)=>n.length>1?n.flatMap(s=>r.map(i=>[...i,s])):(r.forEach(s=>s.push(n[0])),r),[[]])}function Qh(e,t){const r=e.patternProperties??{};return Object.fromEntries(Object.entries(r).filter(([n])=>RegExp(n).test(t)))}function Lg(e,t,r,n,s,i,a,o){const c=em(e,t,r,n,s,i,a,o);if(c.length>1||c[0]!==t)return c;if(Lc in t)return rm(e,t,r,n,s,i,a).flatMap(u=>hr(e,u,r,i,n,s,a));if(yr in t&&Array.isArray(t[yr])){const l=t.allOf.map(m=>hr(e,m,r,i,n,s,a));return Zh(l).map(m=>({...t,allOf:m}))}return[t]}function em(e,t,r,n,s,i,a,o){const c=Hr(t,r,s,void 0,o);return c!==t?hr(e,c,r,i,n,s,a,o):[t]}function Hr(e,t,r,n,s,i=!1){if(!ue(e))return e;let a=e,o=n;if(Je in a){const{$ref:c,...l}=a;if(r.includes(c))return i?{...a,[zc]:!0}:a;r.push(c),a={...ki(c,t,o),...l,[_a]:c},Ue in a&&(o=a[Ue])}if(nt in a){const c=[],l={};for(const[u,m]of Object.entries(a[nt]??{})){const _=[...r];l[u]=Hr(m,t,_,o,s,!s),c.push(_)}for(const u of new Set(c.flat()))r.includes(u)||r.push(u);a={...a,[nt]:l}}if(ni in a&&!Array.isArray(a.items)&&typeof a.items!="boolean"&&(a={...a,items:Hr(a.items,t,r,o,s)}),s){let c,l;Ie in e&&Array.isArray(e[Ie])?(c=Ie,l=a[Ie]):Se in e&&Array.isArray(e[Se])&&(c=Se,l=a[Se]),c&&l&&(a={...a,[c]:l.map(u=>Hr(u,t,r,o,s))})}return je(e,a)?e:a}function Vg(e,t,r,n,s){const i={...t,properties:{...t.properties}},a=n&&ue(n)?n:{};return Object.keys(a).forEach(o=>{if(!(o in i.properties)){if(mc in i){const c=Qh(i,o);if(Object.keys(c).length>0){i.properties[o]=bt(e,{[yr]:Object.values(c)},r,a[o],s),i.properties[o][Sn]=!0;return}}if(Jn in i&&i.additionalProperties!==!1){let c;typeof i.additionalProperties!="boolean"?Je in i.additionalProperties?c=bt(e,{[Je]:i.additionalProperties[Je]},r,a[o],s):"type"in i.additionalProperties?c={...i.additionalProperties}:Ie in i.additionalProperties||Se in i.additionalProperties?c={type:"object",...i.additionalProperties}:c={type:Ni(a[o])}:c={type:Ni(a[o])},i.properties[o]=c,i.properties[o][Sn]=!0}else i.properties[o]={type:"null"},i.properties[o][Sn]=!0}}),i}function zg(e){return Yh(e)}function hr(e,t,r,n,s=!1,i=[],a,o){return ue(t)?Lg(e,t,r,s,i,n,a,o).flatMap(l=>{let u=l;if(Vc in u)return Ug(e,u,r,s,i,n,a);if(yr in u){if(s){const{allOf:_,...v}=u;return[..._,v]}try{const _=[],v=[],S={};u.allOf?.forEach(E=>{if(typeof E=="object"&&E.contains)_.push(E);else{v.push(E);for(const g of Object.getOwnPropertySymbols(E))g in S||(S[g]=E[g])}}),_.length&&(u={...u,allOf:v}),u=a?a(u):zg(u);for(const E of Object.getOwnPropertySymbols(S))u[E]=S[E];_.length&&(u.allOf=_)}catch(_){console.warn(`could not merge subschemas in allOf:
`,_);const{allOf:v,...S}=u;return S}}return nt in u&&mc in u&&(u=Object.keys(u.properties).reduce((_,v)=>{const S=Qh(_,v);return Object.keys(S).length>0&&(_.properties[v]=bt(e,{allOf:[_.properties[v],...Object.values(S)]},r,me(n,v),a)),_},{...u,properties:{...u.properties}})),mc in u||Jn in u&&u.additionalProperties!==!1?Vg(e,u,r,n,a):u}):[{}]}function Bg(e,t,r,n,s){let i;const{oneOf:a,anyOf:o,...c}=t;if(Array.isArray(a)?i=a:Array.isArray(o)&&(i=o),i){const l=s===void 0&&n?{}:s,u=Kt(t);i=i.map(_=>Hr(_,r,[]));const m=Ra(e,l,i,r,u);if(n){const _=tm(i,!1,r);return Ra(e,l,_,r,u),i.map(v=>jr(c,v))}return[jr(c,i[m])]}return[t]}function tm(e,t=!1,r){return e.map(n=>{if(!ue(n))return Xh(n);const s=t&&r?Hr(n,r,[]):n;return s.additionalProperties===!1?{...s,additionalProperties:!0}:s})}function rm(e,t,r,n,s,i,a){const{dependencies:o,...c}=t;return Bg(e,c,r,n,i).flatMap(u=>nm(e,o,u,r,n,s,i,a))}function nm(e,t,r,n,s,i,a,o){let c=[r];for(const l in t)if((s||me(a,l)!==void 0)&&(!r.properties||l in r.properties)){const[u,m]=Gc(l,t);return Array.isArray(m)?c[0]=Hg(r,m):ue(m)&&(c=Kg(e,r,n,l,m,s,i,a,o)),c.flatMap(_=>nm(e,u,_,n,s,i,a,o))}return c}function Hg(e,t){if(!t)return e;const r=Array.isArray(e.required)?Array.from(new Set([...e.required,...t])):t;return{...e,required:r}}function Kg(e,t,r,n,s,i,a,o,c){return hr(e,s,r,o,i,a,c).flatMap(u=>{const{oneOf:m,..._}=u,v=jr(t,_);if(m===void 0)return v;const S=m.map(g=>typeof g=="boolean"||!(Je in g)?[g]:em(e,g,r,i,a,o));return Zh(S).flatMap(g=>Gg(e,v,r,n,g,i,a,o,c))})}function Gg(e,t,r,n,s,i,a,o,c){const l=s.filter(u=>{if(typeof u=="boolean"||!u?.properties)return!1;const{[n]:m}=u.properties;if(m){const _={type:"object",properties:{[n]:m}};return e.isValid(_,o,r)||i}return!1});return!i&&l.length!==1?(console.warn("ignoring oneOf in dependencies because there isn't exactly one subschema that is valid"),[t]):l.flatMap(u=>{const m=u,[_]=Gc(n,m.properties),v={...m,properties:_};return hr(e,v,r,o,i,a,c).map(E=>jr(t,E))})}function xi(e,t,r,n,s,i={},a){if(Array.isArray(r[s])){const c=Kt(r)||n,l=r[s].map(m=>bt(e,m,t,i,a)),u=me(i,c);if(u!==void 0)return l.find(m=>je(me(m,[nt,c,An],me(m,[nt,c,Nt])),u))}}function im(e,t,r,n,s){let i=r;if(lt(r,Je)&&(i=bt(e,r,t,void 0,s)),n.length===0)return i;const a=Array.isArray(n)?[...n]:rr(n),[o,...c]=a;if(o!==void 0&&o!==""&&lt(i,o))return i=me(i,o),im(e,t,i,c,s)}function Ca(e,t,r,n,s,i){const a=im(e,t,r,n,i);return a===void 0?s:a}const su={title:"!@#$_UNKNOWN_$#@!"};function Wg(e,t,r,n,s={},i){const a=Array.isArray(n)?[...n]:n.split(".");let o=r;const c=a.pop(),l=String(c);a.length&&a.forEach(v=>{o=Ca(e,t,o,[nt,v],{},i),lt(o,Se)?o=xi(e,t,o,l,Se,me(s,v),i):lt(o,Ie)&&(o=xi(e,t,o,l,Ie,me(s,v),i))}),lt(o,Se)?o=xi(e,t,o,l,Se,s,i):lt(o,Ie)&&(o=xi(e,t,o,l,Ie,s,i));let u=Ca(e,t,o,[nt,c],su,i);u===su&&(u=void 0);const m=Ca(e,t,o,Mh,[],i);let _;return u&&Array.isArray(m)&&(_=m.includes(l)),{field:u,isRequired:_}}const Jg={type:"object",$id:jy,properties:{__not_really_there__:{type:"number"}}};function vc(e,t,r,n,s){let i=0;return r&&(ue(r.properties)?i+=Object.entries(r.properties).reduce((a,[o,c])=>{const l=n?.[o];if(typeof c=="boolean")return a;if(lt(c,Je)){const u=bt(e,c,t,l,s);return a+vc(e,t,u,l||{},s)}if((lt(c,Se)||lt(c,Ie))&&l){const u=lt(c,Se)?Se:Ie,m=Kt(c);return a+ii(e,t,l,me(c,u),-1,m,s)}if(c.type==="object")return a+(typeof l=="object"&&l!==null?1:0)+vc(e,t,c,l,s);if(c.type===Ni(l)){let u=a+1;return c.default?u+=l===c.default?1:-1:c.const&&(u+=l===c.const?1:-1),u}return a},0):typeof r.type=="string"&&r.type===Ni(n)&&(i+=1)),i}function ii(e,t,r,n,s=-1,i,a){const o=n.map(_=>Hr(_,t,[])),c=Kh(r,n,i);if(typeof c=="number")return c;const l=o.reduce((_,v,S)=>(Ra(e,r,[Jg,v],t,i)===1&&_.push(S),_),[]);if(l.length===1)return l[0];l.length||l.push(...o.keys());const u=new Set,{bestIndex:m}=l.reduce((_,v)=>{const{bestScore:S}=_,E=o[v],g=vc(e,t,E,r,a);return u.add(g),g>S?{bestIndex:v,bestScore:g}:_},{bestIndex:s,bestScore:0});return u.size===1&&s>=0?s:m}function sm(e){const t=e[Nt],r=Gt(e);return ue(t)&&typeof t?.$data=="string"&&r!=="object"&&r!=="array"}function am(e){return Array.isArray(e.enum)&&e.enum.length===1||Nt in e}function Wc(e){return Array.isArray(e.items)&&e.items.every(t=>ue(t))}function Ii(e,t,r=!1,n=!1,s=!1){if(Array.isArray(t)){const i=Array.isArray(e)?e:[],a=s?i:t,o=s?t:i,c=a.map((l,u)=>o[u]!==void 0?Ii(i[u],t[u],r,n,s):l);return(r||s)&&c.length<o.length&&c.push(...o.slice(c.length)),c}if(ue(t)){const i=Object.assign({},e),a=t,o=ue(e)?e:void 0;return Object.keys(a).reduce((c,l)=>{const u=a[l],m=o!==void 0&&l in o,_=l in a,v=o?.[l]??{},S=m&&ue(v)&&Object.values(v).some(y=>ue(y)||Array.isArray(y)),E=m&&ue(o?.[l]),g=_&&ue(u);return E&&g&&!S?(c[l]={...o?.[l],...u},c):(c[l]=Ii(o?.[l],u,r,n,s&&(m||!_)),i)},i)}return n&&(e!==void 0&&t==null||typeof t=="number"&&Number.isNaN(t))||s&&t!=null?e:t}function Xr(e,t,r=!1){return Object.keys(t).reduce((n,s)=>{const i=e?e[s]:{},a=t[s];if(e&&s in e&&ue(a))n[s]=Xr(i,a,r);else if(r&&Array.isArray(i)&&Array.isArray(a)){let o=a;r==="preventDuplicates"&&(o=a.reduce((c,l)=>(i.includes(l)||c.push(l),c),[])),n[s]=i.concat(o)}else n[s]=a;return n},{...e})}function Yg(e){if(Oy in e&&Array.isArray(e.enum)&&e.enum.length===1)return e.enum[0];if(Nt in e)return e.const;throw new Error("schema cannot be inferred as a constant")}function Xg(e,t){const r=new Map(e.map(i=>[String(i.value),i])),n=new Set(t.filter(i=>i!=="*").map(String)),s=e.filter(i=>!n.has(String(i.value)));return t.flatMap(i=>{if(i==="*")return s;const a=r.get(String(i));return a?[a]:[]})}function xn(e,t){if(e.enum){let i,a;if(t){const{enumNames:c,enumOrder:l}=pe(t);i=c,a=l}let o=e.enum.map((c,l)=>({label:Array.isArray(i)?i[l]||String(c):i?.[String(c)]||String(c),value:c}));return a&&(o=Xg(o,a)),o}let r,n;e.anyOf?(r=e.anyOf,n=t?.anyOf):e.oneOf&&(r=e.oneOf,n=t?.oneOf);let s=Kt(e);if(t){const{optionsSchemaSelector:i=s}=pe(t);s=i}return r?.map((i,a)=>{const{title:o}=pe(n?.[a]),c=i;let l,u=o;if(s){const m=gr(c,s);l=me(m,An,me(m,Nt)),u=u??m?.title??c.title??String(l)}else l=Yg(c),u=u??c.title??String(l);return{schema:c,label:u,value:l}})}function Ka(e,t,r={},n){const s=bt(e,t,r,void 0,n),i=s.oneOf||s.anyOf;return Array.isArray(s.enum)?!0:Array.isArray(i)?i.every(a=>typeof a!="boolean"&&am(a)):!1}function Jc(e,t,r,n){return!t.uniqueItems||!t.items||typeof t.items=="boolean"?!1:Ka(e,t.items,r,n)}const Zg=["string","number","integer","boolean","null"];var si;(function(e){e[e.Ignore=0]="Ignore",e[e.Invert=1]="Invert",e[e.Fallback=2]="Fallback"})(si||(si={}));function No(e,t=si.Ignore,r=-1){if(r>=0){if(Array.isArray(e.items)&&r<e.items.length){const n=e.items[r];if(typeof n!="boolean")return n}}else if(e.items&&!Array.isArray(e.items)&&typeof e.items!="boolean")return e.items;return t!==si.Ignore&&ue(e.additionalItems)?e.additionalItems:{}}function Qg(e){return typeof e=="string"||Array.isArray(e)?e.length>0:typeof e=="object"&&e!==null?Object.keys(e).length>0:!1}function om(e,t){const{default:r,type:n}=e;return Array.isArray(n)&&n.includes("null")&&!Qg(t)&&r===null?null:t}function au(e,t,r,n,s,i=[],a={},o=!1,c=!1){const{emptyObjectFields:l="populateAllDefaults"}=a;if(n===!0||o)e[t]=r;else if(n==="excludeObjectChildren")(c&&r!==void 0||!ue(r)||Object.keys(r).length>0)&&(e[t]=r);else if(l!=="skipDefaults"){const u=s===void 0?i.includes(t):s;ue(r)?l==="skipEmptyDefaults"?Object.keys(r).length>0&&(e[t]=r):(Object.keys(r).length>0||i.includes(t))&&(u||l!=="populateRequiredDefaults")&&(e[t]=r):r!==void 0&&(l==="populateAllDefaults"||l==="skipEmptyDefaults"||u&&i.includes(t))&&(e[t]=r)}}function Kr(e,t,r={}){const{parentDefaults:n,rawFormData:s,rootSchema:i={},includeUndefinedValues:a=!1,_recurseList:o=[],experimental_defaultFormStateBehavior:c,experimental_customMergeAllOf:l,required:u,shouldMergeDefaultsIntoFormData:m=!1,initialDefaultsGenerated:_}=r;let v=ue(s)?s:{};const S=ue(t)?t:{};let E=n;const g=E&&c?.nestedDefaultsPrecedence==="ancestorWins";let y=null,f=c,C=o;if(S[Nt]!==void 0&&c?.constAsDefaults!=="never"&&!sm(S))E=S[Nt];else if(ue(E)&&ue(S.default)&&!S[Ie]&&!S[Se]&&!S[Je])g?E=Xr(S.default,E):E=Xr(E,S.default);else if(An in S&&!g&&!S[Ie]&&!S[Se]&&!S[Je])E=S.default;else if(Je in S){const b=S[Je];o.includes(b)||(C=o.concat(b),y=ki(b,i));const O=s===void 0||ue(s)&&Object.keys(s).length===0;y&&!E&&O&&(E=S.default),m&&y&&!ue(s)&&(v=s)}else if(Lc in S){const b={...ou(e,S,r,E),...v};[y]=rm(e,S,i,!1,[],b,l)}else if(Wc(S)&&!g)E=S.items.map((b,O)=>Kr(e,b,{rootSchema:i,includeUndefinedValues:a,_recurseList:o,experimental_defaultFormStateBehavior:c,experimental_customMergeAllOf:l,parentDefaults:Array.isArray(n)?n[O]:void 0,rawFormData:v,required:u,shouldMergeDefaultsIntoFormData:m}));else if(Se in S){const{oneOf:b,...O}=S;if(b.length===0)return;const k=Kt(S),{type:$="null"}=O;!Array.isArray($)&&Zg.includes($)&&f?.constAsDefaults==="skipOneOf"&&(f={...f,constAsDefaults:"never"}),y=b[ii(e,i,s??S.default,b,0,k,l)],y=jr(O,y)}else if(Ie in S){const{anyOf:b,...O}=S;if(b.length===0)return;const k=Kt(S);y=b[ii(e,i,s??S.default,b,0,k,l)],y=jr(O,y)}if(y)return Kr(e,y,{rootSchema:i,includeUndefinedValues:a,_recurseList:C,experimental_defaultFormStateBehavior:f,experimental_customMergeAllOf:l,parentDefaults:E,rawFormData:s??v,required:u,shouldMergeDefaultsIntoFormData:m,initialDefaultsGenerated:_});E===void 0&&(E=S.default);let h=ou(e,S,r,E)??E;if(m){const{arrayMinItems:b={}}=c||{},{mergeExtraDefaults:O}=b,k=Yc(e,S,i,s,c,l);(!ue(s)||yr in S)&&(h=Ii(h,k,O,!0))}return h}function Yc(e,t,r,n,s,i){const a=s?.allOf==="populateDefaults"&&yr in t,o=a?bt(e,t,r,n,i):t,c=!am(o)&&Ka(e,o,r,i);let l=n;return c&&(l=xn(o)?.some(v=>je(v.value,n))?n:void 0),o[Nt]&&s?.constAsDefaults==="always"?l=o.const:ue(l)&&ue(o.properties)&&(l=Object.keys(o.properties).reduce((m,_)=>{const v=gr(o,_);return _ in m&&(a||ue(v)&&yr in v)&&(m[_]=Yc(e,v,r,m[_],s,i)),m},{...l})),l}function e0(e,t,{rawFormData:r,rootSchema:n={},includeUndefinedValues:s=!1,_recurseList:i=[],experimental_defaultFormStateBehavior:a,experimental_customMergeAllOf:o,required:c,shouldMergeDefaultsIntoFormData:l,initialDefaultsGenerated:u}={},m){{const _=ue(r)?r:{},v=t,E=a?.allOf==="populateDefaults"&&yr in v||a?.emptyObjectFields!=="skipEmptyDefaults"&&Vc in v?bt(e,v,n,_,o):v,g=E[Nt],y=Object.keys(E.properties||{}).reduce((f,C)=>{const P=gr(E,C),h=ue(g)&&g[C]!==void 0,b=(ue(P)&&Nt in P||h)&&a?.constAsDefaults!=="never"&&!sm(P),O=Kr(e,P,{rootSchema:n,_recurseList:i,experimental_defaultFormStateBehavior:a,experimental_customMergeAllOf:o,includeUndefinedValues:s===!0,parentDefaults:me(m,C),rawFormData:me(_,C),required:E.required?.includes(C),shouldMergeDefaultsIntoFormData:l,initialDefaultsGenerated:u});return au(f,C,O,s,c,E.required,a,b,P?.type==="null"),f},{});if(E.additionalProperties&&!u){const f=ue(E.additionalProperties)?E.additionalProperties:{},C=new Set,P=[];Object.keys(_).filter(h=>!E.properties||!E.properties[h]).forEach(h=>{C.add(h),P.push(h)}),ue(m)&&P.length===0&&Object.keys(m).filter(h=>!E.properties||!E.properties[h]).forEach(h=>C.add(h)),C.forEach(h=>{const b=Kr(e,f,{rootSchema:n,_recurseList:i,experimental_defaultFormStateBehavior:a,experimental_customMergeAllOf:o,includeUndefinedValues:s===!0,parentDefaults:me(m,h),rawFormData:me(_,h),required:E.required?.includes(h),shouldMergeDefaultsIntoFormData:l,initialDefaultsGenerated:u});au(y,h,b,s,c,P)})}return om(t,y)}}function t0(e,t,{rawFormData:r,rootSchema:n={},_recurseList:s=[],experimental_defaultFormStateBehavior:i,experimental_customMergeAllOf:a,required:o,requiredAsRoot:c=!1,shouldMergeDefaultsIntoFormData:l,initialDefaultsGenerated:u}={},m){let _=m;const v=t,S=i?.arrayMinItems??{},{populate:E,mergeExtraDefaults:g}=S,y=E==="never",f=E==="requiredOnly",C=E==="all"||!y&&!f,P=S?.computeSkipPopulate??(()=>!1),b=i?.emptyObjectFields==="skipEmptyDefaults"?void 0:[];if(Array.isArray(_)&&(_=_.map(($,M)=>{const q=No(v,si.Fallback,M),L=Array.isArray(r)?r[M]:void 0;return Kr(e,q,{rootSchema:n,_recurseList:s,experimental_defaultFormStateBehavior:i,experimental_customMergeAllOf:a,parentDefaults:$,rawFormData:L,required:o,shouldMergeDefaultsIntoFormData:l,initialDefaultsGenerated:u})})),Array.isArray(r)){const $=No(v);if(y)_=r;else{const M=r.map((L,U)=>Kr(e,$,{rootSchema:n,_recurseList:s,experimental_defaultFormStateBehavior:i,experimental_customMergeAllOf:a,rawFormData:L,parentDefaults:me(_,U),required:o,shouldMergeDefaultsIntoFormData:l,initialDefaultsGenerated:u}));_=Ii(_,M,(f&&o||C)&&g)}}const O=Array.isArray(_)?_.length:0;if(y)return l&&!o?_:_??b;if(f&&!o)return _||void 0;let k;if(!v.minItems||Jc(e,v,n,a)||P(e,v,n)||v.minItems<=O)k=_||!o&&!c?_:b;else{const $=_||[],M=No(v,si.Invert),q=M.default,L=Array.from({length:v.minItems-O},()=>Kr(e,M,{parentDefaults:q,rootSchema:n,_recurseList:s,experimental_defaultFormStateBehavior:i,experimental_customMergeAllOf:a,required:o,shouldMergeDefaultsIntoFormData:l}));k=$.concat(L)}return om(t,k)}function ou(e,t,r={},n){switch(Gt(t)){case"object":return e0(e,t,r,n);case"array":return t0(e,t,r,n);case"boolean":return r.required&&n===void 0?!1:void 0;default:return}}function cm(e,t,r,n,s=!1,i,a,o){if(!ue(t))throw new Error(`Invalid schema: ${t}`);const c=bt(e,t,n,r,a),l=Kr(e,c,{rootSchema:n,includeUndefinedValues:s,experimental_defaultFormStateBehavior:i,experimental_customMergeAllOf:a,rawFormData:r,shouldMergeDefaultsIntoFormData:!0,initialDefaultsGenerated:o,requiredAsRoot:!0});if(c.type!=="object"&&ue(c.default))return{...l,...r};if(ue(r)||Array.isArray(r)){const{mergeDefaultsIntoFormData:u}=i||{},m=u==="useDefaultIfFormDataUndefined",_=Yc(e,c,n??c,r,i,a);return Ii(l,_,!0,m,!0)}return l}function lm(e={}){return"widget"in pe(e)&&pe(e).widget!=="hidden"}function um(e,t,r={},n,s){if(r[Hc]==="files")return!0;if(t.items){const i=bt(e,t.items,n,void 0,s);return i.type==="string"&&i.format==="data-url"}return!1}function r0(e,t,r={},n,s,i){const a=pe(r,s),{label:o=!0}=a;let c=!!o;if(c){const l=Gt(t),u=!!t[Sn];l==="array"&&(c=u||Jc(e,t,n,i)||um(e,t,r,n,i)||lm(r)),l==="object"&&(c=u),l==="boolean"&&r&&!r[Hc]&&(c=!1),r?.[Iy]&&(c=!1)}return c}function n0(e,t){if(t.length===0&&typeof e!="object")return e;const r={};return t.forEach(n=>{const s=Array.isArray(n)?n:rr(n);lt(e,s)&&at(r,s,me(e,s))}),Array.isArray(e)?Object.keys(r).map(n=>r[n]):r}function i0(e,t){const r=(s,i)=>typeof s!="object"||s===null?!0:(Array.isArray(s)?s.length===0:Object.keys(s).length===0)||i,n=(s,i=[],a=[[]])=>{const o=Object.keys(s);return o.forEach(c=>{const l=s[c];if(typeof l=="object"){const u=a.map(m=>[...m,c]);l[Bc]&&l[ba]!==""?i.push(l[ba]):n(l,i,u)}else c===ba&&l!==""&&a.forEach(u=>{const m=me(t,u),_=o.length===1;(r(m,_)||Array.isArray(m)&&m.every(v=>r(v,_)))&&i.push(u)})}),i};return n(e)}function dm(e){return e==null||e===""?!0:Array.isArray(e)?e.length===0:ue(e)?Object.values(e).every(dm):!1}function s0(e,t){return t?t(e):Yh(e)}function a0(e,t,r={},n,s){function i(S){return ue(S)}function a(S){return ue(S)}function o(S,E,g){const{properties:y,additionalProperties:f,patternProperties:C}=S,P=new Set(S.required??[]);function h(O,k,$,M=!1){const q=v(k,$,g[O]);if(!M&&ue(q)){let L=a(k)?k:{};L.$ref!==void 0&&(L=ki(L.$ref,r));const U=new Set(L.required??[]);if(Object.entries(q).every(([W,Y])=>!U.has(W)&&dm(Y)))return}q!==void 0&&(g[O]=q)}if(y!==void 0)for(const[O,k]of Object.entries(y))h(O,k,E[O],P.has(O));let b;if(C!==void 0){b=[];const O=Object.entries(C).map(([$,M])=>[new RegExp($),M]),k=new Set(Object.keys(y??{}));for(const[$,M]of Object.entries(E))if(!k.has($)){const q=O.find(([L])=>L.test($));q===void 0?b.push($):h($,q[1],M)}}if(f!==void 0&&f!==!1){const O=f;if(b!==void 0)for(const k of b)h(k,O,E[k]);else{const k=new Set(Object.keys(y??{}));for(const[$,M]of Object.entries(E))k.has($)||h($,O,M)}}return g}function c(S,E,g){const{items:y,additionalItems:f}=S;if(Array.isArray(y)){const C=Math.min(y.length,E.length);let P=0;for(;P<C;P+=1)g[P]=v(y[P],E[P]);if(!f)return g.length=C,g;for(;P<E.length;P+=1)g[P]=v(f,E[P])}else for(let C=0;C<E.length;C+=1)g[C]=v(y,E[C]);return g.length=E.length,g}function l(S,E,g){const{if:y,then:f,else:C}=S;if(y===void 0)return g;const h=(a(y)?e.isValid(y,E,r):y)?f:C;return h===void 0?g:v(h,E,g,!1)}function u(S,E,g,y){if(!Array.isArray(S)||Ka(e,E,r,s))return y;const f=tm(S,!0,r),C=ii(e,r,g,f,0,Kt(E),s),P=S[C],h=ue(P)?Hr(P,r,[]):f[C];return v(h,g,y,!1)}function m(S,E,g){const{anyOf:y}=S;if(!Array.isArray(y))return g;if(E===void 0||Array.isArray(E)&&E.length===0||ue(E)&&Object.keys(E).length===0){let f=g;for(const C of y)f=v(C,E,f,!1);return f}return u(y,S,E,g)}function _(S,E,g){const{dependencies:y}=S;if(y===void 0||!i(E))return g;let f=g;for(const[C,P]of Object.entries(y))C in E&&!Array.isArray(P)&&(f=v(P,E,f,!1));return f}function v(S,E,g,y=!0){if(E===void 0||S===!1)return;if(S===!0||!S||Object.keys(S).length===0)return g??(y?E:void 0);let f=S;const{$ref:C,allOf:P}=f;if(C!==void 0)return v(ki(C,r),E,g,y);if(P){f=s0(f,s);const $=f.allOf;if($)for(let M=0;M<$.length;M++)g=v($[M],E,g,!1)}let h=m(f,E,u(f.oneOf,f,E,g));const b=Gt(f);if(b==="object"){if(!i(E))return;h=o(f,E,i(h)?h:{})}else if(b==="array"){if(!Array.isArray(E))return;f.items!==void 0&&(h=c(f,E,Array.isArray(h)?h:[]))}const O=l(f,E,h);if(f.additionalProperties===!1&&i(O)){const $=new Set(Object.keys(f.properties??{})),M=f.patternProperties?Object.keys(f.patternProperties).map(q=>new RegExp(q)):[];for(const q of Object.keys(O))!$.has(q)&&!M.some(L=>L.test(q))&&delete O[q]}return _(f,E,O)??(y?E:void 0)}return v(t,n)}const Lt=Symbol("no Value");function fm(e){if(Array.isArray(e.enum))return e.enum;const t=e.oneOf||e.anyOf;if(!Array.isArray(t))return;const r=t.map(n=>Nt in n?n[Nt]:Array.isArray(n.enum)&&n.enum.length===1?n.enum[0]:Lt).filter(n=>n!==Lt);return r.length>0?r:void 0}function o0(e,t){const r=fm(e);if(!r||r.some(s=>je(s,t)))return Lt;const n=me(e,An,Lt);return n!==Lt&&r.some(s=>je(s,n))?n:r.length===1?r[0]:void 0}function bc(e,t,r,n,s={},i){let a;const o=r?.[nt];if(o){const c={},l=n?.[nt];l&&Object.keys(l).forEach(_=>{lt(s,_)&&(c[_]=void 0)});const u=Object.keys(o),m={};u.forEach(_=>{const v=s?.[_],S=!lt(n,[nt,_]);let E=gr(n,_),g=gr(r,_);lt(E,Je)&&(E=bt(e,E,t,v,i)),lt(g,Je)&&(g=bt(e,g,t,v,i));const y=E.type,f=g.type;if(!y||y===f)if(_ in c&&delete c[_],f==="object"||f==="array"&&Array.isArray(v)){const C=bc(e,t,g,S&&f==="array"?g:E,v,i);(C!==void 0||f==="array")&&(m[_]=C)}else{const C=me(g,An,Lt),P=me(E,An,Lt);C!==Lt&&C!==v&&(S&&v===void 0||P===v?c[_]=C:g.readOnly===!0&&(c[_]=void 0));const h=me(g,Nt,Lt),b=me(E,Nt,Lt);if(h!==Lt&&h!==v&&(c[_]=b===v?h:void 0),lt(s,_)){const O=o0(g,v);O!==Lt&&(c[_]=O)}}}),a={...typeof s=="string"||Array.isArray(s)?void 0:s,...c,...m}}else if(n?.type==="array"&&r?.type==="array"&&Array.isArray(s)){let c=n.items,l=r.items;if(typeof c=="object"&&typeof l=="object"&&!Array.isArray(c)&&!Array.isArray(l)){lt(c,Je)&&(c=bt(e,c,t,s,i)),lt(l,Je)&&(l=bt(e,l,t,s,i));const u=me(c,"type"),m=me(l,"type");if(!u||u===m){const _=r.maxItems??-1;if(m==="object")a=s.reduce((v,S)=>{const E=bc(e,t,l,c,S,i);return E!==void 0&&(_<0||v.length<_)&&v.push(E),v},[]);else{const v=fm(l),S=v?s.filter(E=>v.some(g=>je(g,E))):s;a=_>0&&S.length>_?S.slice(0,_):S}}}else typeof c=="boolean"&&typeof l=="boolean"&&c===l&&(a=s)}return a}function Ur(e,t,r,n,s,i=[],a){if(Je in t||Lc in t||yr in t||Vc in t){const c=bt(e,t,n,s,a);if(i.findIndex(u=>je(u,c))===-1)return Ur(e,c,r,n,s,i.concat(c),a)}let o={[ba]:r.replace(/^\./,"")};if(Se in t||Ie in t){const c=Se in t?t.oneOf:t.anyOf,l=Kt(t),u=ii(e,n,s,c,0,l,a),m=c[u];o={...o,...Ur(e,m,r,n,s,i,a)}}if(Jn in t&&t[Jn]!==!1){at(o,Bc,!0);const c=ue(t[Jn])?t[Jn]:{},l=t[nt]??{};for(const u of Object.keys(s??{}))u in l||(o[u]=Ur(e,c,`${r}.${u}`,n,me(s,u),i,a))}if(ni in t&&Array.isArray(s)){const{items:c,additionalItems:l}=t;Array.isArray(c)?s.forEach((u,m)=>{c[m]?o[m]=Ur(e,c[m],`${r}.${m}`,n,u,i,a):l?o[m]=Ur(e,l,`${r}.${m}`,n,u,i,a):console.warn(`Unable to generate path schema for "${r}.${m}". No schema defined for it`)}):s.forEach((u,m)=>{o[m]=Ur(e,c,`${r}.${m}`,n,u,i,a)})}else if(nt in t)for(const c in t.properties){const l=gr(t,c);o[c]=Ur(e,l,`${r}.${c}`,n,me(s,c),i,a)}return o}function c0(e,t,r="",n,s,i){return Ur(e,t,r,n,s,void 0,i)}class l0{rootSchema;validator;experimental_defaultFormStateBehavior;experimental_customMergeAllOf;constructor(t,r,n,s){r?.[Ei]===Sa?this.rootSchema=gc(r,r[Ue]??"#"):this.rootSchema=r,this.validator=t,this.experimental_defaultFormStateBehavior=n,this.experimental_customMergeAllOf=s}getRootSchema(){return this.rootSchema}getValidator(){return this.validator}doesSchemaUtilsDiffer(t,r,n={},s){return!t||!r?!1:this.validator!==t||!je(this.rootSchema,r)||!je(this.experimental_defaultFormStateBehavior,n)||this.experimental_customMergeAllOf!==s}findFieldInSchema(t,r,n){return Wg(this.validator,this.rootSchema,t,r,n,this.experimental_customMergeAllOf)}findSelectedOptionInXxxOf(t,r,n,s){return xi(this.validator,this.rootSchema,t,r,n,s,this.experimental_customMergeAllOf)}getDefaultFormState(t,r,n=!1,s){return cm(this.validator,t,r,this.rootSchema,n,this.experimental_defaultFormStateBehavior,this.experimental_customMergeAllOf,s)}getDisplayLabel(t,r,n){return r0(this.validator,t,r,this.rootSchema,n,this.experimental_customMergeAllOf)}getClosestMatchingOption(t,r,n,s){return ii(this.validator,this.rootSchema,t,r,n,s,this.experimental_customMergeAllOf)}getFirstMatchingOption(t,r,n){return Ra(this.validator,t,r,this.rootSchema,n)}getFromSchema(t,r,n){return Ca(this.validator,this.rootSchema,t,r,n,this.experimental_customMergeAllOf)}isFilesArray(t,r){return um(this.validator,t,r,this.rootSchema,this.experimental_customMergeAllOf)}isMultiSelect(t){return Jc(this.validator,t,this.rootSchema,this.experimental_customMergeAllOf)}isSelect(t){return Ka(this.validator,t,this.rootSchema,this.experimental_customMergeAllOf)}omitExtraData(t,r){return a0(this.validator,t,this.rootSchema,r)}retrieveSchema(t,r,n){return bt(this.validator,t,this.rootSchema,r,this.experimental_customMergeAllOf,n)}sanitizeDataForNewSchema(t,r,n){return bc(this.validator,this.rootSchema,t,r,n,this.experimental_customMergeAllOf)}toPathSchema(t,r,n){return c0(this.validator,t,r,this.rootSchema,n,this.experimental_customMergeAllOf)}}function u0(e,t,r={},n){return new l0(e,t,r,n)}function d0(e){if(!e.includes("data:"))throw new Error("File is invalid: URI must be a dataURI");const r=e.slice(5).split(";base64,");if(r.length!==2)throw new Error("File is invalid: dataURI must be base64");const[n,s]=r,[i,...a]=n.split(";"),o=i||"",c=decodeURI(a.map(l=>l.split("=")).find(([l])=>l==="name")?.[1]||"unknown");try{const l=atob(s),u=new Array(l.length);for(let _=0;_<l.length;_+=1)u[_]=l.charCodeAt(_);return{blob:new window.Blob([new Uint8Array(u)],{type:o}),name:c}}catch(l){throw new Error(`File is invalid: ${l.message}`)}}function Lr(e,t){let r=String(e);for(;r.length<t;)r=`0${r}`;return r}function hm(e,t){const r=e<=0&&t<=0,n=e<0||t<0;if(!r&&n)throw new Error(`Both start (${e}) and stop (${t}) must both be <= 0 or > 0, got one of each`);const s=new Date().getFullYear(),i=r?s+e:e,a=r?s+t:t;if(i>a)return hm(t,e).reverse();const o=[];for(let c=i;c<=a;c+=1)o.push({value:c,label:Lr(c,2)});return o}function f0(e,t){let r=e;if(Array.isArray(t)){const n=r.split(/(%\d)/);t.forEach((s,i)=>{const a=n.findIndex(o=>o===`%${i+1}`);a>=0&&(n[a]=s)}),r=n.join("")}return r}function h0(e,t){return f0(e,t)}function Ga(e,t=[],r){if(Array.isArray(e))return e.map(i=>Ga(i,t)).filter(i=>i!==void 0);const n=e===""||e===null?-1:Number(e),s=t[n];return s?s.value:r}function m0(e,t,r=[]){const n=Ga(e,r);return Array.isArray(t)?t.filter(s=>!je(s,n)):je(n,t)?void 0:t}function Wa(e,t){return Array.isArray(t)?t.some(r=>je(r,e)):je(t,e)}function mm(e,t=[],r=!1){const n=t.map((s,i)=>Wa(s.value,e)?String(i):void 0).filter(s=>typeof s<"u");return r?n:n[0]}function p0(e,t,r,n="indexed",s){if(typeof e>"u"||r&&Array.isArray(e)&&e.length<1||!r&&e===s)return s;if(n==="realValue")return r?e.map(String):String(e);const a=mm(e,t,r);return typeof a>"u"?s:a}function y0(e,t,r=[]){const n=Ga(e,r);if(n!=null){const s=r.findIndex(o=>n===o.value),i=r.map(({value:o})=>o);return t.slice(0,s).concat(n,t.slice(s)).sort((o,c)=>+(i.indexOf(o)>i.indexOf(c)))}return t}function cu(e,t,r){if(e===""||!Array.isArray(t))return r;const n=t.find(i=>String(i.value)===e);if(n)return n.value;const s=Number(e);return!Number.isNaN(s)&&s>=0&&s<t.length?t[s].value:r}function Cn(e,t,r="indexed",n){return r!=="realValue"?Ga(e,t,n):Array.isArray(e)?e.map(s=>cu(s,t,n)):cu(e,t,n)}function Xc(e,t,r="indexed"){return r!=="realValue"?String(t):e==null?"":String(typeof e=="object"?t:e)}class pm{errorSchema={};constructor(t){this.resetAllErrors(t)}get ErrorSchema(){return this.errorSchema}getOrCreateErrorBlock(t){const r=typeof t=="string"?rr(t):t??[];if(r.length===0)return this.errorSchema;let n=me(this.errorSchema,r);return n||(n={},at(this.errorSchema,r,n,!0)),n}resetAllErrors(t){return this.errorSchema=t?structuredClone(t):{},this}addErrors(t,r){const n=this.getOrCreateErrorBlock(r);let s=n[vt];return Array.isArray(s)||(s=[],n[vt]=s),Array.isArray(t)?n[vt]=[...new Set([...s,...t])]:n[vt]=[...new Set([...s,t])],this}setErrors(t,r){const n=this.getOrCreateErrorBlock(r),s=Array.isArray(t)?[...new Set([...t])]:[t];return n[vt]=s,this}clearErrors(t){const r=this.getOrCreateErrorBlock(t);return r[vt]=[],this}}function ym(e,t){return Or(e)&&Or(t)?Ea(e,t,!0):Array.isArray(e)&&Array.isArray(t)&&e.length===t.length?e.flatMap((r,n)=>{if(je(r,t[n]))return[];const s=ym(r,t[n]);return s.length?s.map(i=>`${n}.${i}`):[String(n)]}):[]}function Ea(e,t,r=!1){if(e===t)return[];if(!Or(e))return Or(t)?Object.keys(t):[];if(!Or(t))return Object.keys(e);const n=Object.keys(e),s=new Set(n),i=n.filter(o=>!je(e[o],me(t,o))).flatMap(o=>{if(!r)return[o];const c=ym(e[o],me(t,o));return c.length?c.map(l=>`${o}.${l}`):[o]}),a=Object.keys(t).filter(o=>!s.has(o));return[...i,...a]}function g0(e,t,r=[1900,new Date().getFullYear()+2],n="YMD"){const{day:s,month:i,year:a,hour:o,minute:c,second:l}=e,u={type:"day",range:[1,31],value:s},m={type:"month",range:[1,12],value:i},_={type:"year",range:r,value:a},v=[];switch(n){case"MDY":v.push(m,u,_);break;case"DMY":v.push(u,m,_);break;case"YMD":default:v.push(_,m,u)}return t&&v.push({type:"hour",range:[0,23],value:o},{type:"minute",range:[0,59],value:c},{type:"second",range:[0,59],value:l}),v}function v0(e){const t={};return e.multipleOf&&(t.step=e.multipleOf),(e.minimum||e.minimum===0)&&(t.min=e.minimum),(e.maximum||e.maximum===0)&&(t.max=e.maximum),t}function b0(e,t,r={},n=!0){const s={type:t||"text",...v0(e)};return r.inputType?s.type=r.inputType:t||(e.type==="number"?(s.type="number",n&&s.step===void 0&&(s.step="any")):e.type==="integer"&&(s.type="number",s.step===void 0&&(s.step=1))),["date","datetime-local","time","week","month"].includes(s.type)&&(e.formatMinimum!==void 0&&(s.min=e.formatMinimum),e.formatMaximum!==void 0&&(s.max=e.formatMaximum)),r.autocomplete&&(s.autoComplete=r.autocomplete),r.autocapitalize&&(s.autoCapitalize=r.autocapitalize),r.accept&&(s.accept=r.accept),s}function Zc(e){return e?.optionValueFormat??"indexed"}const lu={props:{disabled:!1},submitText:"Submit",norender:!1};function _0(e={}){const t=pe(e);if(t?.[ka]){const r=t[ka];return{...lu,...r}}return lu}function _e(e,t,r={}){const{templates:n}=t;if(e==="ButtonTemplates")return n[e];if(Object.hasOwn(r,e)&&typeof r[e]=="string"&&Object.hasOwn(n,r[e])){const s=r[e];return n[s]}return r[e]||n[e]}let uu=0;function Qc(){if(me(globalThis,["process","env","NODE_ENV"])!=="test")return{};const e=new Map;return new Proxy({},{get(t,r){return e.has(r)||(uu+=1,e.set(r,`test-id-${uu}`)),e.get(r)}})}var Io={exports:{}},Be={};var du;function S0(){if(du)return Be;du=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),a=Symbol.for("react.context"),o=Symbol.for("react.server_context"),c=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),m=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),v=Symbol.for("react.offscreen"),S;S=Symbol.for("react.module.reference");function E(g){if(typeof g=="object"&&g!==null){var y=g.$$typeof;switch(y){case e:switch(g=g.type,g){case r:case s:case n:case l:case u:return g;default:switch(g=g&&g.$$typeof,g){case o:case a:case c:case _:case m:case i:return g;default:return y}}case t:return y}}}return Be.ContextConsumer=a,Be.ContextProvider=i,Be.Element=e,Be.ForwardRef=c,Be.Fragment=r,Be.Lazy=_,Be.Memo=m,Be.Portal=t,Be.Profiler=s,Be.StrictMode=n,Be.Suspense=l,Be.SuspenseList=u,Be.isAsyncMode=function(){return!1},Be.isConcurrentMode=function(){return!1},Be.isContextConsumer=function(g){return E(g)===a},Be.isContextProvider=function(g){return E(g)===i},Be.isElement=function(g){return typeof g=="object"&&g!==null&&g.$$typeof===e},Be.isForwardRef=function(g){return E(g)===c},Be.isFragment=function(g){return E(g)===r},Be.isLazy=function(g){return E(g)===_},Be.isMemo=function(g){return E(g)===m},Be.isPortal=function(g){return E(g)===t},Be.isProfiler=function(g){return E(g)===s},Be.isStrictMode=function(g){return E(g)===n},Be.isSuspense=function(g){return E(g)===l},Be.isSuspenseList=function(g){return E(g)===u},Be.isValidElementType=function(g){return typeof g=="string"||typeof g=="function"||g===r||g===s||g===n||g===l||g===u||g===v||typeof g=="object"&&g!==null&&(g.$$typeof===_||g.$$typeof===m||g.$$typeof===i||g.$$typeof===a||g.$$typeof===c||g.$$typeof===S||g.getModuleId!==void 0)},Be.typeOf=E,Be}var fu;function w0(){return fu||(fu=1,Io.exports=S0()),Io.exports}var C0=w0();const hu=Fi(C0),Ro={boolean:{checkbox:"CheckboxWidget",radio:"RadioWidget",select:"SelectWidget",hidden:"HiddenWidget"},string:{text:"TextWidget",password:"PasswordWidget",email:"EmailWidget",hostname:"TextWidget",ipv4:"TextWidget",ipv6:"TextWidget",uri:"URLWidget","data-url":"FileWidget",radio:"RadioWidget",select:"SelectWidget",textarea:"TextareaWidget",hidden:"HiddenWidget",date:"DateWidget",datetime:"DateTimeWidget","date-time":"DateTimeWidget","alt-date":"AltDateWidget","alt-datetime":"AltDateTimeWidget",time:"TimeWidget",color:"ColorWidget",file:"FileWidget"},number:{text:"TextWidget",select:"SelectWidget",updown:"UpDownWidget",range:"RangeWidget",radio:"RadioWidget",hidden:"HiddenWidget"},integer:{text:"TextWidget",select:"SelectWidget",updown:"UpDownWidget",range:"RangeWidget",radio:"RadioWidget",hidden:"HiddenWidget"},array:{select:"SelectWidget",checkboxes:"CheckboxesWidget",files:"FileWidget",hidden:"HiddenWidget"}};function E0(e){let{MergedWidget:t}=e;if(!t){const r=e.defaultProps?.options||{};t=({options:n,...s})=>N.jsx(e,{options:{...r,...n},...s}),e.MergedWidget=t}return t}function vr(e,t,r={}){const n=Gt(e);if(typeof t=="function"||t&&hu.isForwardRef(X.createElement(t))||hu.isMemo(t))return E0(t);if(typeof t!="string")throw new Error(`Unsupported widget definition: ${typeof t} in schema: ${JSON.stringify(e)}`);if(t in r){const s=r[t];return vr(e,s,r)}if(typeof n=="string"){if(!(n in Ro))throw new Error(`No widget for type '${n}' in schema: ${JSON.stringify(e)}`);if(t in Ro[n]){const s=r[Ro[n][t]];return vr(e,s,r)}}throw new Error(`No widget '${t}' for type '${n}' in schema: ${JSON.stringify(e)}`)}function gm(e){let t=0;for(let r=0;r<e.length;r++){const n=e.charCodeAt(r);t=(t<<5)-t+n,t&=t}return t.toString(16)}function $a(e){function t(s){return s!==void 0&&typeof s!="function"&&typeof s!="symbol"}if(Array.isArray(e))return`[${e.map(s=>s===void 0?"undefined":$a(s)).join(",")}]`;if(e===null||typeof e!="object")return JSON.stringify(typeof e=="function"?null:e);const r=e;return`{${Object.keys(r).sort().filter(s=>t(r[s])).map(s=>`${JSON.stringify(s)}:${$a(r[s])}`).join(",")}}`}function zt(e){return gm($a(e))}function A0(e){return gm($a(e))}function x0(e,t,r={}){try{return vr(e,t,r),!0}catch(n){const s=n;if(s.message&&(s.message.startsWith("No widget")||s.message.startsWith("Unsupported widget")))return!1;throw n}}function Rn(e,t){return`${typeof e=="string"?e:e[Ue]}__${t}`}function ai(e){return Rn(e,"description")}function vm(e){return Rn(e,"error")}function el(e){return Rn(e,"examples")}function bm(e){return Rn(e,"help")}function tl(e){return Rn(e,"title")}function $n(e,t=!1){const r=t?` ${el(e)}`:"";return`${vm(e)} ${ai(e)} ${bm(e)}${r}`}function _m(e,t){return`${e}-${t}`}function _n(e,t){return Rn(e,t)}function $o(e,t){return Rn(e,`optional${t}`)}function oi(e){return e==null?!1:typeof e!="object"||Array.isArray(e)?!0:Object.keys(e).length>0}function P0(e,t){const{rootSchema:r,schemaUtils:n}=e;if(je(t,r))return!0;if(Je in r){const s=n.retrieveSchema(r);return je(t,s)}return!1}function O0(e,t,r){return t?r:e}function j0(e){return e?new Date(e).toJSON():void 0}function k0(e,t,r,n=!1){!n&&Array.isArray(r)&&t.default!==void 0&&mm(t.default,r,n)===void 0&&console.error(`The schema default value "${t.default}" is not one of the values in the enum options for "${e}"`)}function rl(e,t,r){const n=[Ny];return lt(e,Fl)&&n.unshift(Fl),me(e,[...n,t],r)}function Fo(){}function N0(e,t){if(!Array.isArray(t))return e;const r=u=>u.reduce((m,_)=>(m[_]=!0,m),{}),n=u=>u.length>1?`properties '${u.join("', '")}'`:`property '${u[0]}'`,s=r(e),i=t.filter(u=>u==="*"||s[u]),a=r(i),o=e.filter(u=>!a[u]),c=i.indexOf("*");if(c===-1){if(o.length)throw new Error(`uiSchema order list does not contain ${n(o)}`);return i}if(c!==i.lastIndexOf("*"))throw new Error("uiSchema order list contains more than one wildcard item");const l=[...i];return l.splice(c,1,...o),l}function Do(e,t=!0){if(!e)return{year:-1,month:-1,day:-1,hour:t?-1:0,minute:t?-1:0,second:t?-1:0};const r=new Date(e);if(Number.isNaN(r.getTime()))throw new Error(`Unable to parse date ${e}`);return{year:r.getUTCFullYear(),month:r.getUTCMonth()+1,day:r.getUTCDate(),hour:t?r.getUTCHours():0,minute:t?r.getUTCMinutes():0,second:t?r.getUTCSeconds():0}}function I0(e,t,r){const n=e[_a]??e[Je],s=r.uiSchemaDefinitions,i=n&&s?s[n]:void 0;let a;if(i?!t||Object.keys(t).length===0?a={...i}:a=Xr(i,t):a=t||{},s){let o=e;if(n&&e[Je]&&!e[_a])try{o=ki(n,r.rootSchema)}catch(c){return console.warn(`could not resolve $ref in resolveUiSchema:
`,c),a}for(const c of[Se,Ie]){const l=o[c];if(Array.isArray(l)&&l.length>0){const u=a[c],m=Array.isArray(u)?[...u]:[];let _=!1;for(let v=0;v<l.length;v++){const S=l[v],E=S?.[_a]??S?.[Je];if(E&&E in s){const g=m[v]||{};m[v]=Xr(s[E],g),_=!0}}_&&(a[c]=m)}}}return a}function Aa(e){if(e.const||e.enum?.length===1&&e.enum[0]===!0)return!0;if(e.anyOf?.length===1)return Aa(e.anyOf[0]);if(e.oneOf?.length===1)return Aa(e.oneOf[0]);if(e.allOf){const t=r=>Aa(r);return e.allOf.some(t)}return!1}function R0({hideLabel:e,id:t,multiple:r,options:n,registry:s,uiSchema:i,value:a}){if(r||e)return null;const{label:o=!0}=pe(i,s.globalUiOptions);if(!o)return null;const c=n.enumOptions?.find(({value:m})=>Wa(m,a)),l=c?.schema?.description;if(!l)return null;const u=_e("DescriptionFieldTemplate",s,n);return N.jsx(u,{id:ai(t),description:l,schema:c.schema,uiSchema:i,registry:s})}function _c(e,t){if(Object.is(e,t))return!0;if(e==null||t==null||typeof e!="object"||typeof t!="object")return!1;const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(let s=0;s<r.length;s+=1){const i=r[s];if(!Object.hasOwn(t,i)||!Object.is(e[i],t[i]))return!1}return!0}function $0(e,t,r,n="customDeep"){if(n==="always")return!0;if(n==="shallow"){const{props:a,state:o}=e;return!_c(a,t)||!_c(o,r)}const{props:s,state:i}=e;return!je(s,t)||!je(i,r)}function mu(e){const t=[...new Set(e.map(r=>ue(r)?Gt(r):void 0).flat().filter(r=>r!==void 0))];return t.length===1?t[0]:t}function Di(e,t,r,n){const{enableOptionalDataFieldForType:s=[]}=pe(n,e.globalUiOptions);let i;return Ie in t&&Array.isArray(t[Ie])?i=mu(t[Ie]):Se in t&&Array.isArray(t[Se])?i=mu(t[Se]):i=Gt(t),!P0(e,t)&&!r&&!!i&&!Array.isArray(i)&&!!s.find(a=>a===i)}function pu(e,t=!0){const{year:r,month:n,day:s,hour:i=0,minute:a=0,second:o=0}=e,c=Date.UTC(r,n-1,s,i,a,o),l=new Date(c).toJSON();return t?l:l.slice(0,10)}function Sm(e,t=[]){return e?wm(e,t):[]}function wm(e,t){const r=e[vt],n=`.${t.join(".")}`,s=Array.isArray(r)?r.map(i=>({property:n,message:i,stack:`${n} ${i}`})):[];return Object.keys(e).reduce((i,a)=>{const o=e[a];return a!==vt&&Or(o)?i.concat(wm(o,[...t,a])):i},s)}function F0(e){const t=new pm;return e.length&&e.forEach(r=>{const{property:n,message:s}=r,i=n?rr(n):[];s&&t.addErrors(s,i)}),t.ErrorSchema}function nr(e,t,r,n){const s=Array.isArray(r)?r:r?.path,i=e===""?[]:[e],a=s?s.concat(...i):i,o=[t.idPrefix,...a].join(t.idSeparator);let c;return t.nameGenerator&&a.length>0&&(c=t.nameGenerator(a,t.idPrefix,n)),{path:a,[Ue]:o,...c!==void 0&&{name:c}}}function D0(e){return Cm(e)}function Cm(e){return Object.keys(e).reduce((t,r)=>{if(r==="addError")return t;const n=e[r];return Or(n)?{...t,[r]:Cm(n)}:{...t,[r]:n}},{})}function T0(e){return Object.values(e).every(t=>t!==-1)}function M0(e){const{className:t="form-control",type:r,range:n,value:s,select:i,rootId:a,name:o,disabled:c,readonly:l,autofocus:u,registry:m,onBlur:_,onFocus:v}=e,S=`${a}_${r}`,{SelectWidget:E}=m.widgets,g=X.useCallback(y=>i(r,y),[i,r]);return N.jsx(E,{schema:{type:"integer"},id:S,name:o,className:t,options:{enumOptions:hm(n[0],n[1])},placeholder:r,value:s,disabled:c,readonly:l,autofocus:u,onChange:g,onBlur:_,onFocus:v,registry:m,label:"","aria-describedby":$n(a)})}function q0(e){const{time:t=!1,disabled:r=!1,readonly:n=!1,options:s,onChange:i,value:a}=e,[o,c]=X.useState(Do(a,t));X.useEffect(()=>{c(Do(a,t))},[t,a]);const l=X.useCallback((v,S)=>{const E={...o,[v]:typeof S>"u"?-1:S};T0(E)?i(pu(E,t)):c(E)},[o,i,t]),u=X.useCallback(v=>{v.preventDefault(),!(r||n)&&i(void 0)},[r,n,i]),m=X.useCallback(v=>{if(v.preventDefault(),r||n)return;const S=Do(new Date().toJSON(),t);i(pu(S,t))},[r,n,t,i]);return{elements:X.useMemo(()=>g0(o,t,s.yearsRange,s.format),[o,t,s.yearsRange,s.format]),handleChange:l,handleClear:u,handleSetNow:m}}function ci(e){const t=X.useRef(e);return je(e,t.current)||(t.current=e),t.current}function U0(e,t){return e.replace(";base64",`;name=${encodeURIComponent(t)};base64`)}async function L0(e){const{name:t,size:r,type:n}=e;return new Promise((s,i)=>{const a=new window.FileReader;a.onerror=i,a.onload=o=>{typeof o.target?.result=="string"?s({dataURL:U0(o.target.result,t),name:t,size:r,type:n}):s({dataURL:null,name:t,size:r,type:n})},a.readAsDataURL(e)})}async function V0(e){return Promise.all(Array.from(e).map(L0))}function yu(e){return e.reduce((t,r)=>{if(!r)return t;try{const{blob:n,name:s}=d0(r);return[...t,{dataURL:r,name:s,size:n.size,type:n.type}]}catch{return t}},[])}function z0(e,t,r=!1){const n=X.useMemo(()=>r&&e?Array.isArray(e)?e:[e]:[],[e,r]),s=X.useMemo(()=>Array.isArray(e)?yu(e):yu([e||""]),[e]),i=X.useCallback(async o=>{const l=(await V0(o)).map(u=>u.dataURL||null);t(r?n.concat(...l):l[0])},[n,r,t]),a=X.useCallback(o=>{if(r){const c=n.filter((l,u)=>u!==o);t(c)}else t(void 0)},[n,r,t]);return{filesInfo:s,handleChange:i,handleRemove:a}}function B0(e){if(!e)return"";const t=new Date(e),r=Lr(t.getFullYear(),4),n=Lr(t.getMonth()+1,2),s=Lr(t.getDate(),2),i=Lr(t.getHours(),2),a=Lr(t.getMinutes(),2),o=Lr(t.getSeconds(),2),c=Lr(t.getMilliseconds(),3);return`${r}-${n}-${s}T${i}:${a}:${o}.${c}`}function Pi(e,t,r=!1){if(!t)return e;const{errors:n,errorSchema:s}=e;let i=Sm(t),a=t;return s&&Object.keys(s).length>0&&(a=Xr(s,t,r?"preventDuplicates":!0),i=[...n].concat(i)),{errorSchema:a,errors:i}}function H0(e){const t=e;for(const r in t)if(Object.hasOwn(t,r)){const n=t[r];r===Je&&typeof n=="string"&&n.startsWith("#")?t[r]=Vh+n:t[r]=nl(n)}return e}function K0(e){return e.map(t=>nl(t))}function nl(e){return Array.isArray(e)?K0([...e]):ue(e)?H0({...e}):e}var $e;(function(e){e.ArrayItemTitle="Item",e.MissingItems="Missing items definition",e.EmptyArray="No items yet. Use the button below to add some.",e.YesLabel="Yes",e.NoLabel="No",e.CloseLabel="Close",e.ErrorsLabel="Errors",e.NewStringDefault="New Value",e.AddButton="Add",e.AddItemButton="Add Item",e.CopyButton="Copy",e.ExpandButton="Expand Cycle",e.MoveDownButton="Move down",e.MoveUpButton="Move up",e.RemoveButton="Remove",e.NowLabel="Now",e.ClearLabel="Clear",e.AriaDateLabel="Select a date",e.PreviewLabel="Preview",e.DecrementAriaLabel="Decrease value by 1",e.IncrementAriaLabel="Increase value by 1",e.OptionalObjectAdd="Add data for optional field",e.OptionalObjectRemove="Remove data for optional field",e.OptionalObjectEmptyMsg="No data for optional field",e.Type="Type",e.Value="Value",e.ClearButton="clear input",e.UnknownFieldType="Unknown field type %1",e.OptionPrefix="Option %1",e.TitleOptionPrefix="%1 option %2",e.KeyLabel="%1 Key",e.DeprecatedLabel="%1 (deprecated)",e.CycleDetected='Circular reference ($ref cycle) detected for field "%1". You may choose to expand to the next cycle break',e.InvalidObjectField='Invalid "%1" object field configuration: _%2_.',e.UnsupportedField="Unsupported field schema.",e.UnsupportedFieldWithId="Unsupported field schema for field `%1`.",e.UnsupportedFieldWithReason="Unsupported field schema: _%1_.",e.UnsupportedFieldWithIdAndReason="Unsupported field schema for field `%1`: _%2_.",e.FilesInfo="**%1** (%2, %3 bytes)"})($e||($e={}));let gu=0;function Sc(){return gu+=1,`rjsf-array-item-${gu}`}function vu(e){return Array.isArray(e)?e.map(t=>({key:Sc(),item:t})):[]}function Em(e){return Array.isArray(e)?e.map(t=>t.item):[]}function G0(e){return Array.isArray(e.type)?!e.type.includes("null"):e.type!=="null"}function Am(e,t,r,n){let{addable:s}=pe(n,e.globalUiOptions);return s!==!1&&(t.maxItems!==void 0?s=r.length<t.maxItems:s=!0),s}function xm(e,t,r,n){if(typeof e.items=="function")try{return e.items(t,r,n)}catch(s){console.error(`Error executing dynamic uiSchema.items function for item at index ${r}:`,s);return}else return e.items}function W0(e,t){const{schemaUtils:r,globalFormOptions:n}=e;let s=t.items;return n.useFallbackUiForUnsupportedType&&!s?s={}:Wc(t)&&Py(t)&&(s=t.additionalItems),r.getDefaultFormState(s)}function J0(e){const{schema:t,fieldPathId:r,uiSchema:n,formData:s=[],disabled:i=!1,readonly:a=!1,autofocus:o=!1,required:c=!1,placeholder:l,onBlur:u,onFocus:m,registry:_,rawErrors:v,name:S,onSelectChange:E}=e,{widgets:g,schemaUtils:y,globalFormOptions:f,globalUiOptions:C}=_,P=y.retrieveSchema(t.items,s),h=n?.items??n,b=xn(P,h),{widget:O="select",title:k,...$}=pe(n,C),M=vr(t,O,g),q=k??t.title??S,L=y.getDisplayLabel(t,n,C),U=ci(nr("",f,r,!0));return N.jsx(M,{id:U[Ue],name:S,multiple:!0,onChange:E,onBlur:u,onFocus:m,options:{...$,enumOptions:b},schema:t,uiSchema:n,registry:_,value:s,disabled:i,readonly:a,required:c,label:q,hideLabel:!L,placeholder:l,autofocus:o,rawErrors:v,htmlName:U.name})}function Y0(e){const{schema:t,fieldPathId:r,uiSchema:n,disabled:s=!1,readonly:i=!1,autofocus:a=!1,required:o=!1,hideError:c,placeholder:l,onBlur:u,onFocus:m,formData:_=[],registry:v,rawErrors:S,name:E,onSelectChange:g}=e,{widgets:y,schemaUtils:f,globalFormOptions:C,globalUiOptions:P}=v,{widget:h,title:b,...O}=pe(n,P),k=vr(t,h,y),$=b??t.title??E,M=f.getDisplayLabel(t,n,P),q=ci(nr("",C,r,!0));return N.jsx(k,{id:q[Ue],name:E,multiple:!0,onChange:g,onBlur:u,onFocus:m,options:O,schema:t,uiSchema:n,registry:v,value:_,disabled:s,readonly:i,hideError:c,required:o,label:$,hideLabel:!M,placeholder:l,autofocus:a,rawErrors:S,htmlName:q.name})}function X0(e){const{schema:t,uiSchema:r,fieldPathId:n,name:s,disabled:i=!1,readonly:a=!1,autofocus:o=!1,required:c=!1,onBlur:l,onFocus:u,registry:m,formData:_=[],rawErrors:v,onSelectChange:S}=e,{widgets:E,schemaUtils:g,globalFormOptions:y,globalUiOptions:f}=m,{widget:C="files",title:P,...h}=pe(r,f),b=vr(t,C,E),O=P??t.title??s,k=g.getDisplayLabel(t,r,f),$=ci(nr("",y,n,!0));return N.jsx(b,{options:h,id:$[Ue],name:s,multiple:!0,onChange:S,onBlur:l,onFocus:u,schema:t,uiSchema:r,value:_,disabled:i,readonly:a,required:c,registry:m,autofocus:o,rawErrors:v,label:O,hideLabel:!k,htmlName:$.name})}function Z0(e){const{itemKey:t,index:r,name:n,disabled:s,hideError:i,readonly:a,registry:o,uiOptions:c,parentUiSchema:l,canAdd:u,canRemove:m=!0,canMoveUp:_,canMoveDown:v,rawItemSchema:S,itemData:E,itemUiSchema:g,parentFieldPathId:y,itemErrorSchema:f,autofocus:C,onBlur:P,onFocus:h,onChange:b,rawErrors:O,totalItems:k,title:$,handleAddItem:M,handleCopyItem:q,handleRemoveItem:L,handleReorderItems:U}=e,{schemaUtils:B,fields:{ArraySchemaField:W,SchemaField:Y},globalUiOptions:Q,globalFormOptions:Z}=o,re=X.useMemo(()=>B.retrieveSchema(S,E),[B,S,E]),A=X.useMemo(()=>nr(r,Z,y),[r,Z,y]),w=W||Y,j=_e("ArrayFieldItemTemplate",o,c),p=B.getDisplayLabel(re,g,Q),{description:d}=pe(g),x=!!d||!!re.description,{orderable:I=!0,removable:T=!0,copyable:F=!1}=c,z={moveUp:I&&_,moveDown:I&&v,copy:F&&u,remove:T&&m,toolbar:!1};z.toolbar=Object.keys(z).some(J=>z[J]);const H=X.useCallback(J=>{M(J,r+1)},[M,r]),R=X.useCallback(J=>{q(J,r)},[q,r]),D=X.useCallback(J=>{L(J,r)},[L,r]),V=X.useCallback(J=>{U(J,r,r-1)},[U,r]),K=X.useCallback(J=>{U(J,r,r+1)},[U,r]),G={children:N.jsx(w,{name:n,title:$,index:r,schema:re,uiSchema:g,formData:E,errorSchema:f,fieldPathId:A,required:G0(re),onChange:b,onBlur:P,onFocus:h,registry:o,disabled:s,readonly:a,hideError:i,autofocus:C,rawErrors:O}),buttonsProps:{fieldPathId:A,disabled:s,readonly:a,canAdd:u,hasCopy:z.copy,hasMoveUp:z.moveUp,hasMoveDown:z.moveDown,hasRemove:z.remove,index:r,totalItems:k,onAddItem:H,onCopyItem:R,onRemoveItem:D,onMoveUpItem:V,onMoveDownItem:K,registry:o,schema:re,uiSchema:g},itemKey:t,className:"rjsf-array-item",disabled:s,hasToolbar:z.toolbar,index:r,totalItems:k,readonly:a,registry:o,schema:re,uiSchema:g,parentUiSchema:l,displayLabel:p,hasDescription:x};return N.jsx(j,{...G})}const Pm=X.memo(Z0);function Q0(e){const{schema:t,uiSchema:r={},errorSchema:n,fieldPathId:s,formData:i,name:a,title:o,disabled:c=!1,readonly:l=!1,autofocus:u=!1,required:m=!1,hideError:_=!1,registry:v,onBlur:S,onFocus:E,rawErrors:g,onChange:y,keyedFormData:f,handleAddItem:C,handleCopyItem:P,handleRemoveItem:h,handleReorderItems:b}=e,O=t.title||o||a,{schemaUtils:k,fields:$,formContext:M,globalUiOptions:q}=v,{OptionalDataControlsField:L}=$,U=X.useMemo(()=>pe(r,q),[r,q]),B=X.useMemo(()=>ue(t.items)?t.items:{},[t.items]),W=X.useMemo(()=>k.retrieveSchema(B),[k,B]),Y=X.useMemo(()=>Em(f),[f]),Q=Di(v,t,m,r),Z=oi(i),re=X.useMemo(()=>Am(v,t,Y,r)&&(!Q||Z),[v,t,Y,r,Q,Z]),A=Z?f:[],w=Q?" rjsf-optional-array-field":"",j=e.childFieldPathId??s,p=Q?N.jsx(L,{...e,fieldPathId:j}):void 0,d={canAdd:re,items:A.map((I,T)=>{const{key:F,item:z}=I,H=z,R=n?n[T]:void 0,D=xm(r,z,T,M),V={itemKey:F,index:T,name:a&&`${a}-${T}`,registry:v,uiOptions:U,parentUiSchema:r,hideError:_,readonly:l,disabled:c,required:m,title:O?`${O}-${T+1}`:void 0,canAdd:re,canMoveUp:T>0,canMoveDown:T<Y.length-1,rawItemSchema:B,parentFieldPathId:j,itemErrorSchema:R,itemData:H,itemUiSchema:D,autofocus:u&&T===0,onBlur:S,onFocus:E,rawErrors:g,totalItems:f.length,handleAddItem:C,handleCopyItem:P,handleRemoveItem:h,handleReorderItems:b,onChange:y};return N.jsx(Pm,{...V},F)}),className:`rjsf-field rjsf-field-array rjsf-field-array-of-${W.type}${w}`,disabled:c,fieldPathId:s,uiSchema:r,onAddClick:C,readonly:l,required:m,schema:t,title:O,formData:Y,rawErrors:g,registry:v,optionalDataControl:p},x=_e("ArrayFieldTemplate",v,U);return N.jsx(x,{...d})}function ev(e){const{schema:t,uiSchema:r={},formData:n,errorSchema:s,fieldPathId:i,name:a,title:o,disabled:c=!1,readonly:l=!1,autofocus:u=!1,required:m=!1,hideError:_=!1,registry:v,onBlur:S,onFocus:E,rawErrors:g,keyedFormData:y,onChange:f,handleAddItem:C,handleCopyItem:P,handleRemoveItem:h,handleReorderItems:b}=e;let{formData:O=[]}=e;const k=t.title||o||a,{fields:$,formContext:M,globalUiOptions:q}=v,L=X.useMemo(()=>pe(r,q),[r,q]),{OptionalDataControlsField:U}=$,B=Di(v,t,m,r),W=oi(n),Y=X.useMemo(()=>Array.isArray(t.items)?t.items:[],[t.items]),Q=ue(t.additionalItems),Z=e.childFieldPathId??i;O.length<Y.length&&(O=O.concat(new Array(Y.length-O.length)));const re=W?y:[],A=B?" rjsf-optional-array-field":"",w=B?N.jsx(U,{...e,fieldPathId:Z}):void 0,j=Am(v,t,O,r)&&Q&&(!B||W),p={canAdd:j,className:`rjsf-field rjsf-field-array rjsf-field-array-fixed-items${A}`,disabled:c,fieldPathId:i,formData:n,items:re.map((x,I)=>{const{key:T,item:F}=x,z=F,H=I>=Y.length,R=(H&&ue(t.additionalItems)?t.additionalItems:Y[I])||{};let D;H?D=r.additionalItems:Array.isArray(r.items)?D=r.items[I]:D=xm(r,F,I,M);const V=s?s[I]:void 0,K={index:I,itemKey:T,name:a&&`${a}-${I}`,registry:v,uiOptions:L,parentUiSchema:r,hideError:_,readonly:l,disabled:c,required:m,title:k?`${k}-${I+1}`:void 0,canAdd:j,canRemove:H,canMoveUp:I>=Y.length+1,canMoveDown:H&&I<O.length-1,rawItemSchema:R,itemData:z,itemUiSchema:D,parentFieldPathId:Z,itemErrorSchema:V,autofocus:u&&I===0,onBlur:S,onFocus:E,rawErrors:g,totalItems:y.length,onChange:f,handleAddItem:C,handleCopyItem:P,handleRemoveItem:h,handleReorderItems:b};return N.jsx(Pm,{...K},T)}),onAddClick:C,readonly:l,required:m,registry:v,schema:t,uiSchema:r,title:k,errorSchema:s,rawErrors:g,optionalDataControl:w},d=_e("ArrayFieldTemplate",v,L);return N.jsx(d,{...p})}function tv(e=[]){const t=X.useMemo(()=>zt(e),[e]),[r,n]=X.useState(()=>({formDataHash:t,keyedFormData:vu(e)}));let{keyedFormData:s,formDataHash:i}=r;if(t!==i){const o=Array.isArray(e)?e:[],c=s||[];s=o.length===c.length?c.map((l,u)=>({key:l.key,item:o[u]})):vu(o),i=t,n({formDataHash:i,keyedFormData:s})}const a=X.useCallback(o=>{const c=Em(o),l=zt(c);return n({formDataHash:l,keyedFormData:o}),c},[]);return{keyedFormData:s,updateKeyedFormData:a}}function rv(e){const{schema:t,uiSchema:r,errorSchema:n,fieldPathId:s,registry:i,formData:a,onChange:o}=e,{globalFormOptions:c,schemaUtils:l,translateString:u}=i,{keyedFormData:m,updateKeyedFormData:_}=tv(a),v=X.useRef(m);v.current=m;const S=X.useRef(n);S.current=n;const E=e.childFieldPathId??s,g=X.useCallback((k,$)=>{k&&k.preventDefault();let M;if(S.current){M={};for(const U of Object.keys(S.current)){const B=parseInt(U,10);$===void 0||B<$?at(M,B,S.current[B]):B>=$&&at(M,B+1,S.current[B])}}const q={key:Sc(),item:W0(i,t)},L=[...v.current];$!==void 0?L.splice($,0,q):L.push(q),o(_(L),E.path,M)},[i,t,o,_,E]),y=X.useCallback((k,$)=>{k&&k.preventDefault();let M;if(S.current){M={};for(const U of Object.keys(S.current)){const B=parseInt(U,10);B<=$?at(M,B,S.current[B]):B>$&&at(M,B+1,S.current[B])}}const q={key:Sc(),item:structuredClone(v.current[$].item)},L=[...v.current];$!==void 0?L.splice($+1,0,q):L.push(q),o(_(L),E.path,M)},[o,_,E]),f=X.useCallback((k,$)=>{k&&k.preventDefault();let M;if(S.current){M={};for(const L of Object.keys(S.current)){const U=parseInt(L,10);U<$?at(M,U,S.current[U]):U>$&&at(M,U-1,S.current[U])}}const q=v.current.filter((L,U)=>U!==$);o(_(q),E.path,M)},[o,_,E]),C=X.useCallback((k,$,M)=>{k&&(k.preventDefault(),k.currentTarget.blur());let q;if(S.current){q={};for(const B of Object.keys(S.current)){const W=parseInt(B,10);W===$?at(q,M,S.current[$]):W===M?at(q,$,S.current[M]):at(q,B,S.current[W])}}function L(){const B=v.current.slice();return B.splice($,1),B.splice(M,0,v.current[$]),B}const U=L();o(_(U),E.path,q)},[o,_,E]),P=X.useCallback((k,$,M,q)=>{const L=typeof $.at(-1)=="number";o(L&&k===void 0?null:k,$,M,q)},[o]),h=X.useCallback(k=>{o(k,E.path,void 0,E?.[Ue])},[o,E]),b={...e,formData:a,fieldPathId:E,onSelectChange:h},O={...e,handleAddItem:g,handleCopyItem:y,handleRemoveItem:f,handleReorderItems:C,keyedFormData:m,onChange:P};if(!(ni in t)){if(!c.useFallbackUiForUnsupportedType){const $=pe(r),M=_e("UnsupportedFieldTemplate",i,$);return N.jsx(M,{schema:t,fieldPathId:s,reason:u($e.MissingItems),registry:i})}const k={...t,[ni]:{type:void 0}};b.schema=k,O.schema=k}return l.isMultiSelect(b.schema)?N.jsx(J0,{...b}):lm(r)?N.jsx(Y0,{...b}):Wc(b.schema)?N.jsx(ev,{...O}):l.isFilesArray(b.schema,r)?N.jsx(X0,{...b}):N.jsx(Q0,{...O})}function nv(e){const{schema:t,name:r,uiSchema:n,fieldPathId:s,formData:i,registry:a,required:o,disabled:c,readonly:l,hideError:u,autofocus:m,title:_,onChange:v,onFocus:S,onBlur:E,rawErrors:g}=e,{title:y}=t,{widgets:f,translateString:C,globalUiOptions:P}=a,{widget:h="checkbox",title:b,label:O=!0,enumNames:k,...$}=pe(n,P),M=vr(t,h,f),q=C($e.YesLabel),L=C($e.NoLabel);let U;const B=b??y??_??r;if(Array.isArray(t.oneOf))U=xn({oneOf:t.oneOf.map(Y=>{if(ue(Y))return{...Y,title:Y.title||(Y.const===!0?q:L)}}).filter(Y=>Y)},n);else{const Y=t.enum??[!0,!1];!k&&Y.length===2&&Y.every(Q=>typeof Q=="boolean")?U=[{value:Y[0],label:Y[0]?q:L},{value:Y[1],label:Y[1]?q:L}]:U=xn({enum:Y},n)}const W=X.useCallback((Y,Q,Z)=>v(Y,s.path,Q,Z),[v,s]);return N.jsx(M,{options:{...$,enumOptions:U},schema:t,uiSchema:n,id:s.$id,name:r,onChange:W,onFocus:S,onBlur:E,label:B,hideLabel:!O,value:i,required:o,disabled:c,readonly:l,hideError:u,registry:a,autofocus:m,rawErrors:g,htmlName:s.name})}function iv(e){const[t,r]=X.useState(!1),{name:n,registry:s,schema:i,uiSchema:a,fieldPathId:o}=e,{globalUiOptions:c}=s,l=pe(a,c),u=_e("CyclicSchemaExpandTemplate",s,l);if(!t)return N.jsx(u,{registry:s,schema:i,uiSchema:a,name:n,fieldPathId:o,onExpand:()=>r(!0)});const{fields:m}=s,{SchemaField:_}=m;return N.jsx(_,{...e,schema:{...i,[zc]:!1}})}function sv(e){return{type:"string",enum:["string","number","boolean","object","array"],default:"string",title:e}}function av(e){const t=typeof e;return t==="string"||t==="number"||t==="boolean"?t:t==="object"?Array.isArray(e)?"array":"object":"string"}function ov(e,t){switch(t){case"string":return String(e);case"number":{const r=Number(e);return Number.isNaN(r)?0:r}case"boolean":return!!e;default:return e}}function cv(e){const{id:t,formData:r,displayLabel:n=!0,schema:s,name:i,uiSchema:a,required:o,disabled:c=!1,readonly:l=!1,onBlur:u,onFocus:m,registry:_,fieldPathId:v,onChange:S,errorSchema:E}=e,{translateString:g,fields:y,globalFormOptions:f}=_,[C,P]=X.useState(av(r)),h=pe(a),b=ci(nr("__internal_type_selector",f,v)),O=g($e.Type),k=X.useMemo(()=>sv(O),[O]),$=L=>{L!=null&&(P(L),S(ov(r,L),v.path,E,t))};if(!f.useFallbackUiForUnsupportedType){const{reason:L=g($e.UnknownFieldType,[String(s.type)])}=e,U=_e("UnsupportedFieldTemplate",_,h);return N.jsx(U,{schema:s,fieldPathId:v,reason:L,registry:_})}const M=_e("FallbackFieldTemplate",_,h),{SchemaField:q}=y;return N.jsx(M,{schema:s,registry:_,typeSelector:N.jsx(q,{fieldPathId:b,name:`${i}__fallback_type`,schema:k,formData:C,onChange:$,onBlur:u,onFocus:m,registry:_,hideLabel:!n,disabled:c,readonly:l,required:o},r?zt(r):"__empty__"),schemaField:N.jsx(q,{...e,schema:{type:C,title:g($e.Value),...C==="object"&&{additionalProperties:!0}}})})}var mr;(function(e){e.ROW="ui:row",e.COLUMN="ui:col",e.COLUMNS="ui:columns",e.CONDITION="ui:condition"})(mr||(mr={}));var ji;(function(e){e.ALL="all",e.SOME="some",e.NONE="none"})(ji||(ji={}));const lv=/^\$lookup=(.+)/,To="layoutGrid";function bu(e,t){return e??t}function uv(e){return/^\d+?$/.test(e)}const Gr=Qc();function dv(e,t,r,n,s){const i=r?.[pc]??{},a=me(r,rr(e)),o={...a?.[Br]??{},...t,...i},c={...a};Object.keys(o).length>0&&(c[Br]=o),Object.keys(i).length>0&&(c[pc]=i);let{readonly:l}=pe(c);if(s===!0||l===void 0&&n===!0){l=!0;const u=c[Br];u&&_o in u?u[_o]=!0:c[`ui:${_o}`]=!0}return{fieldUiSchema:c,uiReadonly:l}}function fv(e,t,r="$0m3tH1nG Un3xP3cT3d"){const n=[t].flat().sort(),s=[r].flat().sort();switch(e){case ji.ALL:return je(n,s);case ji.SOME:return n.some(i=>s.includes(i));case ji.NONE:return!n.some(i=>s.includes(i));default:return!1}}function Ja(e,t,r){let n={},s=e[t];if(Or(s)){const{children:i,className:a,...o}=s;if(s=i,a){const l=a.split(" ").map(u=>rl(r,u,u)).join(" ");n={...o,className:l}}else n=o}if(!Array.isArray(s))throw new TypeError(`Expected array for "${t}" in ${JSON.stringify(e)}`);return{children:s,gridProps:n}}function _u(e,t,r){let n,s=t;if(uv(r)&&e&&e?.type==="array"&&ni in e){const i=Number(r),a=e[ni];Array.isArray(a)?i>a.length?n=a.at(-1):n=a[i]:n=a,s={[Ue]:t[Ue],path:[...t.path.slice(0,t.path.length-1),i]}}return{rawSchema:n,fieldPathId:s}}function hv(e,t,r,n,s){const{schemaUtils:i,globalFormOptions:a}=e;let o=r,c=s;const l=t.split("."),u=l.pop();let m=i.retrieveSchema(o,n),_=n,v=m.readOnly;l.forEach(g=>{c=nr(g,a,c);const y=m?.[nt];if(y)o=y[g]??{};else if(m&&(Se in m||Ie in m)){const f=Se in m?Se:Ie,C=i.findSelectedOptionInXxxOf(m,g,f,_);o=gr(C,g)}else{const f=_u(m,c,g);o=f.rawSchema??{},c=f.fieldPathId}_=me(_,g,{}),m=i.retrieveSchema(o,_),v=bu(m.readOnly,v)});let S,E=!1;if((!m||Object.keys(m).length===0)&&(m=void 0),m&&u){if(m&&(Se in m||Ie in m)){const y=Se in m?Se:Ie;m=i.findSelectedOptionInXxxOf(m,u,y,_)}c=nr(u,a,c),E=m!==void 0&&Array.isArray(m.required)&&m.required.includes(u);const g=_u(m,c,u);if(g.rawSchema?(m=g.rawSchema,c=g.fieldPathId):(m=m?.[nt]?.[u],m=m&&i.retrieveSchema(m)),v=bu(m?.readOnly,v),m&&(Se in m||Ie in m)){const y=Se in m?Se:Ie,f=Kt(m);S={options:m[y],hasDiscriminator:!!f}}}return{schema:m,isRequired:E,isReadonly:v,optionsInfo:S,fieldPathId:c}}function mv(e,t){let r=e;return typeof r=="string"&&(r=rl(t,r)),typeof r=="function"?r:null}function pv(e,t){let r,n=null,s={},i;if(typeof t=="string"||t===void 0)r=t??"";else{const{name:a="",render:o,...c}=t;r=a,s=c,Object.entries(s).forEach(([l,u])=>{if(typeof u=="string"){const m=lv.exec(u);if(Array.isArray(m)&&m.length>1){const _=m[1];s[l]=rl(e,_,_)}}}),n=mv(o,e),!a&&n&&(i=N.jsx(n,{...c,"data-testid":Gr.uiComponent}))}return{name:r,UIComponent:n,uiProps:s,rendered:i}}function Ya(e){const{childrenLayoutGridSchemaId:t,...r}=e,{registry:n,schema:s,formData:i}=r,{schemaUtils:a}=n,o=a.retrieveSchema(s,i);return t.map(c=>X.createElement(il,{...r,key:`layoutGrid-${zt(c)}`,schema:o,layoutGridSchema:c}))}function yv(e){const{layoutGridSchema:t,...r}=e,{formData:n,registry:s}=r,{children:i,gridProps:a}=Ja(t,mr.CONDITION,s),{operator:o,field:c="",value:l}=a,u=me(n,rr(c),null);return fv(o,u,l)?N.jsx(Ya,{...r,childrenLayoutGridSchemaId:i}):null}function gv(e){const{layoutGridSchema:t,...r}=e,{registry:n,uiSchema:s}=r,{children:i,gridProps:a}=Ja(t,mr.COLUMN,n),o=pe(s),c=_e("GridTemplate",n,o);return N.jsx(c,{column:!0,"data-testid":Gr.col,...a,children:N.jsx(Ya,{...r,childrenLayoutGridSchemaId:i})})}function vv(e){const{layoutGridSchema:t,...r}=e,{registry:n,uiSchema:s}=r,{children:i,gridProps:a}=Ja(t,mr.COLUMNS,n),o=pe(s),c=_e("GridTemplate",n,o);return i.map(l=>N.jsx(c,{column:!0,"data-testid":Gr.col,...a,children:N.jsx(Ya,{...r,childrenLayoutGridSchemaId:[l]})},`column-${zt(l)}`))}function bv(e){const{layoutGridSchema:t,...r}=e,{registry:n,uiSchema:s}=r,{children:i,gridProps:a}=Ja(t,mr.ROW,n),o=pe(s),c=_e("GridTemplate",n,o);return N.jsx(c,{...a,"data-testid":Gr.row,children:N.jsx(Ya,{...r,childrenLayoutGridSchemaId:i})})}function _v(e){const{gridSchema:t,schema:r,uiSchema:n,errorSchema:s,fieldPathId:i,onBlur:a,onFocus:o,formData:c,readonly:l,registry:u,layoutGridSchema:m,..._}=e,{onChange:v}=_,{fields:S}=u,{SchemaField:E,LayoutMultiSchemaField:g}=S,y=pv(u,t),{name:f,UIComponent:C,uiProps:P}=y,{schema:h,isRequired:b,isReadonly:O,optionsInfo:k,fieldPathId:$}=hv(u,f,r,c,i),M=ci($);if(y.rendered)return y.rendered;if(h){const q=k?.hasDiscriminator?g:E,{fieldUiSchema:L,uiReadonly:U}=dv(f,P,n,O,l),B=rr(f);return N.jsx(q,{"data-testid":k?.hasDiscriminator?Gr.layoutMultiSchemaField:Gr.field,..._,name:f,required:b,readonly:U,schema:h,uiSchema:L,errorSchema:me(s,B),fieldPathId:M,formData:me(c,B),onChange:v,onBlur:a,onFocus:o,options:k?.options,registry:u})}return C?N.jsx(C,{"data-testid":Gr.uiComponent,..._,name:f,required:b,formData:c,readOnly:!!O||l,errorSchema:s,uiSchema:n,schema:r,fieldPathId:i,onBlur:a,onFocus:o,registry:u,...P}):null}function il(e){const{uiSchema:t}=e;let{layoutGridSchema:r}=e;const n=pe(t);if(!r&&To in n&&ue(n[To])&&(r=n[To]),ue(r)){if(mr.ROW in r)return N.jsx(bv,{...e,layoutGridSchema:r});if(mr.COLUMN in r)return N.jsx(gv,{...e,layoutGridSchema:r});if(mr.COLUMNS in r)return N.jsx(vv,{...e,layoutGridSchema:r});if(mr.CONDITION in r)return N.jsx(yv,{...e,layoutGridSchema:r})}return N.jsx(_v,{...e,gridSchema:r})}il.TEST_IDS=Gr;function Sv(e){const{fieldPathId:t,title:r,schema:n,uiSchema:s,required:i,registry:a,name:o}=e,c=pe(s,a.globalUiOptions),{title:l}=c,{title:u}=n,m=l||r||u||o;if(!m)return null;const _=_e("TitleFieldTemplate",a,c);return N.jsx(_,{id:tl(t),title:m,required:i,schema:n,uiSchema:s,registry:a})}function Mo(e,t,r){const n="!@#!@$@#$!@$#";return e.map(({schema:i})=>i).find(i=>{const a=i[nt]?.[t];return me(a,An,me(a,Nt,n))===r})}function Su(e,t,r,n,s){const i=t.map(c=>r.retrieveSchema(c,s));let a=e;Se in e?a={...e,[Se]:i}:Ie in e&&(a={...e,[Ie]:i});const o=xn(a,n);if(!o)throw new Error(`No enumOptions were computed from the schema ${JSON.stringify(a)}`);return o}function wv(e){const{name:t,baseType:r,disabled:n=!1,formData:s,fieldPathId:i,onBlur:a,onChange:o,options:c,onFocus:l,registry:u,uiSchema:m,schema:_,autofocus:v,readonly:S,required:E,errorSchema:g,hideError:y=!1}=e,{widgets:f,schemaUtils:C,globalUiOptions:P}=u,[h,b]=X.useState(Su(_,c,C,m,s)),O=i[Ue],k=Kt(_),$=_e("FieldErrorTemplate",u,c),M=_e("FieldTemplate",u,c),q=zt(_),L=zt(c),U=m?zt(m):"",B=s?zt(s):"";X.useEffect(()=>{b(Su(_,c,C,m,s))},[q,L,C,U,B]);const{widget:W=k?"radio":"select",title:Y="",placeholder:Q="",optionsSchemaSelector:Z=k,hideError:re,...A}=pe(m);if(!Z)throw new Error("No selector field provided for the LayoutMultiSchemaField");const w=me(s,Z);let j=gr(h[0]?.schema,Z);const p=Mo(h,Z,w);j=j?.type?j:{...j,type:p?.type||r};const d=vr(j,W,f),x=re===void 0?y:!!re,I=g?.[vt]??[],T={...g};delete T[vt];const F=C.getDisplayLabel(_,m,P),z=D=>{if(n||S)return;const V=Mo(h,Z,D),K=Mo(h,Z,w);let G=C.sanitizeDataForNewSchema(V,K,s);G&&V&&(G=C.getDefaultFormState(V,G,"excludeObjectChildren")),G&&at(G,Z,D),o(G,i.path,void 0,O)},H={enumOptions:h,...A},R=!x&&I.length>0?N.jsx($,{fieldPathId:i,schema:_,errors:I,registry:u}):void 0;return N.jsx(M,{fieldPathId:i,id:O,schema:_,label:(Y||_.title)??"",disabled:n||Array.isArray(h)&&h.length===0,uiSchema:m,required:E,readonly:!!S,registry:u,displayLabel:F,errors:R,onChange:o,onKeyRename:Fo,onKeyRenameBlur:Fo,onRemoveProperty:Fo,children:N.jsx(d,{id:O,name:t,schema:_,label:(Y||_.title)??"",disabled:n||Array.isArray(h)&&h.length===0,uiSchema:m,autofocus:v,readonly:S,required:E,registry:u,multiple:!1,rawErrors:I,hideError:x,hideLabel:!F,errorSchema:T,placeholder:Q,onChange:z,onBlur:a,onFocus:l,value:w,options:H,htmlName:i.name})})}function wu(e){const{name:t,disabled:r=!1,errorSchema:n,formData:s,fieldPathId:i,onBlur:a,onChange:o,onFocus:c,options:l,readonly:u,registry:m,required:_=!1,schema:v,uiSchema:S}=e,{schemaUtils:E}=m,g=zt(s??null),y=X.useMemo(()=>l.map(J=>E.retrieveSchema(J,s)),[l,E,g]),[f,C]=X.useState(()=>{const J=Kt(v);return E.getClosestMatchingOption(s,y,0,J)}),P=X.useRef(!1),h=X.useRef(s),b=X.useRef(i.$id);X.useEffect(()=>{const J=h.current,te=b.current;if(h.current=s,b.current=i.$id,!je(s,J)&&i.$id===te){if(P.current){P.current=!1;return}const ne=Kt(v),se=E.getClosestMatchingOption(s,y,f,ne);se!==f&&C(se)}});const O=`${i.$id}${v.oneOf?"__oneof_select":"__anyof_select"}`,k=X.useCallback(J=>{if(r||u)return;const te=J!==void 0?parseInt(J,10):-1;if(te===f)return;const ne=te>=0?y[te]:void 0,se=f>=0?y[f]:void 0;let ce=E.sanitizeDataForNewSchema(ne,se,s);ne&&(ce=E.getDefaultFormState(ne,ce,"excludeObjectChildren")),C(te),P.current=!0,o(ce,i.path,void 0,O)},[f,y,r,u,E,s,i,o,O]),{widgets:$,fields:M,translateString:q,globalUiOptions:L}=m,{SchemaField:U}=M,B=_e("MultiSchemaFieldTemplate",m,L),W=Di(m,v,_,S),Y=oi(s),{widget:Q="select",placeholder:Z,autofocus:re,autocomplete:A,title:w=v.title,...j}=pe(S,L),p=vr({type:"number"},Q,$),d=n?.[vt]??[],x={...n};delete x[vt];const I=E.getDisplayLabel(v,S,L),T=f>=0&&y[f]||null;let F;if(T){const{required:J,type:te}=v,ne={};J&&(ne.required=J),te!==void 0&&!("type"in T)&&(ne.type=te),F=Object.keys(ne).length>0?jr(ne,T):T}let z=[];Se in v&&S&&Se in S?Array.isArray(S[Se])?z=S[Se]:console.warn(`uiSchema.oneOf is not an array for "${w||t}"`):Ie in v&&S&&Ie in S&&(Array.isArray(S[Ie])?z=S[Ie]:console.warn(`uiSchema.anyOf is not an array for "${w||t}"`));let H=S;f>=0&&z.length>f&&(H=z[f]);const R=w?$e.TitleOptionPrefix:$e.OptionPrefix,D=w?[w]:[],V=y.map((J,te)=>{const{title:ne=J.title}=pe(z[te]);return{label:ne||q(R,D.concat(String(te+1))),value:te}}),K=!W||Y?N.jsx(p,{id:O,name:`${t}${v.oneOf?"__oneof_select":"__anyof_select"}`,schema:{type:"number",default:0},onChange:k,onBlur:a,onFocus:c,disabled:r||V.length===0,multiple:!1,rawErrors:d,errorSchema:x,value:f>=0?f:void 0,options:{enumOptions:V,...j},registry:m,placeholder:Z,autocomplete:A,autofocus:re,label:w??t,hideLabel:!I,readonly:u}):void 0,G=F&&F.type!=="null"&&N.jsx(U,{...e,schema:F,uiSchema:H})||null;return N.jsx(B,{schema:v,registry:m,uiSchema:S,selector:K,optionSchemaField:G})}function Cv(e){const{formData:t,onChange:r,fieldPathId:n}=e;return X.useEffect(()=>{t===void 0&&r(null,n.path)},[n,t,r]),null}const Ev=/\.([0-9]*0)*$/,Av=/[0.]0*$/;function xv(e){const{registry:t,onChange:r,formData:n,value:s}=e,[i,a]=X.useState(s),{StringField:o}=t.fields,c=Th(),l=c==="."?"\\.":c;let u=n;const m=X.useCallback((v,S,E,g)=>{a(v);const y=typeof v=="string"?v.replace(c,"."):v,f=`${y}`.startsWith(".")?`0${y}`:y,C=typeof f=="string"&&Ev.exec(f)?$l(f.replace(Av,"")):$l(f);r(C,S,E,g)},[r,c]);if(typeof i=="string"&&typeof u=="number"){const v=new RegExp(`^(${String(u).replace(".",l)})?${l}?0*$`);i.match(v)&&(u=i)}let _=u;if(typeof u=="number"&&c!=="."){const{schema:v,uiSchema:S}=e,{schemaUtils:E}=t,y=(E.isSelect(v)?xn(v,S):void 0)?"select":"text",{widget:f=y}=pe(S);f!=="radio"&&f!=="select"&&f!=="hidden"&&(_=String(u).replace(".",c))}return N.jsx(o,{...e,formData:_,onChange:m})}var Ki;function Pv(e){if(!Ki){if(typeof document>"u")return;Ki=document.createElement("textarea")}var t=`&${e};`;Ki.innerHTML=t;var r=Ki.value;return r===t?void 0:r}var ie=32,ae=9,Zr=13,de=10,Le=96,ut=126,tt=91,Nr=94,Pe=62,Wt=35,wc=37,we=45,Bt=61,mt=92,it=42,Qe=95,He=60,Om=64,ir=93,It=33,Xa=38,Ct=58,Cc=70,Pn=102,Fa=104,En=119,ei=116,Ec=112,jm=115,Ov=160,jv=12,kv=44,Da=59,li=63,Ht=46,et=47,On=39,jn=34,Qr=43,ht=124,kn=123,sl=125,er=40,tr=41,Nv=78,Iv=110,Rv=79,$v=111,km=120,Nm=88,Ac=30,Ae=48,xe=57,ve=65,be=90,ze=97,Xe=122,Za=128,Qt=32,Fv={blockQuote:0,breakLine:1,breakThematic:2,codeBlock:3,codeInline:4,footnote:5,footnoteReference:6,frontmatter:7,gfmTask:8,heading:9,htmlBlock:10,htmlComment:11,htmlSelfClosing:12,image:13,link:14,orderedList:15,paragraph:16,ref:17,refCollection:18,table:19,text:20,textFormatted:21,unorderedList:22},ee=Fv;function Dv(e){if(!Eu(e,"---"))return null;let t=3;for(;t<e.length&&(e[t]===" "||e[t]===" ");)t++;if(t<e.length&&e[t]==="\r"&&t++,t>=e.length||e[t]!==`
`)return null;t++;let r=!1;for(;t<e.length;){let n=t;for(;t<e.length&&e[t]!==`
`&&e[t]!=="\r";)t++;if(t>=e.length)break;let s=t;if(e[t]==="\r"&&t++,t<e.length&&e[t]===`
`&&t++,Eu(e,"---",n))return{endPos:t,hasValidYaml:r};if(!r){let i=Gv(e,n,s);if(i<s){let a=e.charCodeAt(i);if(a>=ze&&a<=Xe||a>=ve&&a<=be||a>=Ae&&a<=xe||a===Qe){for(i++;i<s&&(a=e.charCodeAt(i),a>=ze&&a<=Xe||a>=ve&&a<=be||a>=Ae&&a<=xe||a===Qe||a===we||a===Ht);)i++;i<s&&e.charCodeAt(i)===Ct&&(i++,i>=s?r=!0:(a=e.charCodeAt(i),(a===ie||a===ae)&&(r=!0)))}}}}return null}var Tv=/&([a-zA-Z0-9]+|#[0-9]{1,7}|#x[0-9a-fA-F]{1,6});/gi,Mv={class:"className",for:"htmlFor",allowfullscreen:"allowFullScreen",allowtransparency:"allowTransparency",autocomplete:"autoComplete",autofocus:"autoFocus",autoplay:"autoPlay",cellpadding:"cellPadding",cellspacing:"cellSpacing",charset:"charSet",classid:"classId",colspan:"colSpan",contenteditable:"contentEditable",contextmenu:"contextMenu",crossorigin:"crossOrigin",enctype:"encType",formaction:"formAction",formenctype:"formEncType",formmethod:"formMethod",formnovalidate:"formNoValidate",formtarget:"formTarget",frameborder:"frameBorder",hreflang:"hrefLang",inputmode:"inputMode",keyparams:"keyParams",keytype:"keyType",marginheight:"marginHeight",marginwidth:"marginWidth",maxlength:"maxLength",mediagroup:"mediaGroup",minlength:"minLength",novalidate:"noValidate",radiogroup:"radioGroup",readonly:"readOnly",rowspan:"rowSpan",spellcheck:"spellCheck",srcdoc:"srcDoc",srclang:"srcLang",srcset:"srcSet",tabindex:"tabIndex",usemap:"useMap",viewbox:"viewBox"},qv={};function Im(e){if(!e)return qv;var t={};for(var r in e){var n=r.toLowerCase(),s=Mv[n];if(s)t[s]=e[r];else{var i=r.indexOf(":");i===-1?t[r]=e[r]:t[r.slice(0,i)+r[i+1].toUpperCase()+r.slice(i+2)]=e[r]}}return t}var Uv=/(\n|^[-*]\s|^#|^ {2,}|^-{2,}|^>\s|^<(div|p|h[1-6]|ul|ol|li|blockquote|pre|table|thead|tbody|tr|td|th|dl|dt|dd|hr|address|article|aside|details|dialog|figure|figcaption|footer|form|header|main|menu|nav|section|summary|textarea|fieldset|legend|center|dir|hgroup|marquee|search|output|template)\b)/i;function Wr(e){return e.indexOf("&")===-1?e:e.replace(Tv,(t,r)=>{var n=Pv(r);if(n)return n;if(r[0]==="#"){var s=r[1]==="x"||r[1]==="X"?Number.parseInt(r.slice(2),16):Number.parseInt(r.slice(1),10);return s===0||s>=55296&&s<=57343||s>1114111?"":s<=65535?String.fromCharCode(s):String.fromCharCode(55296+(s-65536>>10),56320+(s-65536&1023))}return t})}var Cu=/(javascript|vbscript|data(?!:image)):/i;function Pr(e){if(Cu.test(e))return null;if(e.indexOf("%")===-1)return e;try{let t=decodeURIComponent(e).replace(/[^A-Za-z0-9/:]/g,"");if(Cu.test(t))return null}catch{return null}return e}var wt={},jt,dt;for(jt=[192,193,194,195,196,197,224,225,226,227,228,229,230,198],dt=0;dt<jt.length;dt++)wt[jt[dt]]="a";for(wt[231]=wt[199]="c",wt[240]=wt[208]="d",jt=[200,201,202,203,233,232,234,235],dt=0;dt<jt.length;dt++)wt[jt[dt]]="e";for(jt=[207,239,206,238,205,237,204,236],dt=0;dt<jt.length;dt++)wt[jt[dt]]="i";for(wt[209]=wt[241]="n",jt=[248,216,339,338,213,245,212,244,211,243,210,242],dt=0;dt<jt.length;dt++)wt[jt[dt]]="o";for(jt=[220,252,219,251,218,250,217,249],dt=0;dt<jt.length;dt++)wt[jt[dt]]="u";wt[376]=wt[255]=wt[221]=wt[253]="y";function Nn(e){for(var t="",r=-1,n=e.length,s=0;s<n;s++){var i=e.charCodeAt(s);if(i>=ze&&i<=Xe||i>=Ae&&i<=xe){r<0&&(r=s);continue}if(i>=ve&&i<=be){r>=0&&(t+=e.slice(r,s),r=-1),t+=String.fromCharCode(i+Qt);continue}if(i===ie||i===we){r>=0&&(t+=e.slice(r,s),r=-1),t+="-";continue}r>=0&&(t+=e.slice(r,s),r=-1);var a=wt[i];a&&(t+=a)}return r>=0&&(t+=e.slice(r)),t}function Eu(e,t,r){return e.startsWith(t,r)}var Au=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr","circle","ellipse","line","path","polygon","polyline","rect","use","stop","animate","set"]);function Ti(e){let t=e.toLowerCase();if(Au.has(t))return!0;let r=t.indexOf(":");return r!==-1?(t=t.slice(r+1),Au.has(t)):!1}var bn=1,xu=2,Xn=4,Pu=8,Lv=16,Yt=32,Fr=64,Vv=(()=>{var e=new Uint8Array(128),t;for(e[ae]=bn,e[de]=bn|xu,e[jv]=bn,e[Zr]=bn|xu,e[ie]=bn,t=It;t<=et;t++)e[t]=Xn;for(t=Ct;t<=Om;t++)e[t]=Xn;for(t=tt;t<=Le;t++)e[t]=Xn;for(t=kn;t<=ut;t++)e[t]=Xn;for(t=Ae;t<=xe;t++)e[t]=Lv;for(t=ve;t<=be;t++)e[t]=Pu;for(t=ze;t<=Xe;t++)e[t]=Pu;return e})(),zv=/[\p{P}\p{S}]/u,Bv=new RegExp("\\p{Zs}","u"),dn=[];function Hv(e){var t=e.indexOf("\r"),r=e.indexOf("\0");if(t===-1&&r===-1)return e;var n=e.length;dn.length=0;var s=0,i=0;for(t===-1?i=r:r===-1?i=t:i=t<r?t:r;i<n;i++){var a=e.charCodeAt(i);a===Zr?(s<i&&dn.push(e.slice(s,i)),i+1<n&&e.charCodeAt(i+1)===de&&i++,dn.push(`
`),s=i+1):a===0&&(s<i&&dn.push(e.slice(s,i)),dn.push(""),s=i+1)}return s<n&&dn.push(e.slice(s)),dn.join("")}function Kv(e){return e.replace(/>\s+</g,"><").replace(/\n+/g," ").trim()}function Gv(e,t,r){let n=r??e.length;for(;t<n&&(e[t]===" "||e[t]===" ");)t++;return t}function Rm(e){if(!e)return!1;for(var t in e)return!0;return!1}function Wv(e){return{attrs:{},children:[{type:ee.text,text:e}],c:!0,type:ee.htmlBlock,tag:"header"}}var Jv=/^\n+/;function Yv(e){for(var t=e.length;t>0&&(e[t-1]===`
`||e[t-1]==="\r");)t--;return`${e.slice(0,t).replace(Jv,"")}
`}function Zn(e){if((e.type===ee.htmlSelfClosing||e.type===ee.htmlBlock)&&e.a)return[];if(e.type===ee.paragraph){var t=e.children;return t?t.flatMap(Zn):[]}return e.type===ee.text?e.text?.trim()?[e]:[]:e.type===ee.htmlBlock&&e.children?[{...e,children:e.children?.flatMap(Zn)}]:[e]}function $m(e){for(var t=0;t<e.length;t++){if(e[t].type===ee.htmlBlock){var r=e[t],n=!1;if(r.c&&t===e.length-1){var s=r.j===void 0?r.a?r.e||"":(r.e||"")+(r.h||""):r.j,i=`</${String(r.tag).toLowerCase()}>`,a=s.toLowerCase().indexOf(i);if(a!==-1){var o=s.slice(a+i.length).replace(/<\/[a-z][a-z0-9-]*\s*>/gi,"");o.trim()&&(n=!0)}}n||(r.c=!1)}"children"in e[t]&&e[t].children&&$m(e[t].children)}}function Xv(e,t){for(var r=0;r<e.length;r++){var n=e[r];if(n.type===ee.paragraph&&n.children)for(var s=n.children,i=0;i<s.length;i++){var a=s[i];if(a.type===ee.htmlSelfClosing&&a.a&&a.tag.toLowerCase()===t){var o=e.slice(0,r);i>0&&o.push({type:ee.paragraph,children:s.slice(0,i)});var c=[];if(i+1<s.length){var l=s.slice(i+1).filter(u=>!(u.type===ee.htmlSelfClosing&&u.a));l.length>0&&(c=l)}return c=c.concat(e.slice(r+1)),{found:!0,beforeClose:o,afterClose:c}}}if((n.type===ee.htmlSelfClosing||n.type===ee.htmlBlock)&&n.a&&n.tag.toLowerCase()===t)return{found:!0,beforeClose:e.slice(0,r),afterClose:e.slice(r+1)}}return{found:!1,beforeClose:e,afterClose:[]}}function Zv(e){var t="";for(var r in e){var n=e[r];n===!0?t+=` ${r}`:n!==void 0&&n!=null&&n!==!1&&(t+=` ${r}="${String(n)}"`)}return t}function Ou(e,t,r,n){var s;return t===void 0?s=Zv(r):s=t.length>0&&t.charCodeAt(0)>ie?` ${t}`:t,`<${e}${s}${n}`}function ju(e){var t=e.tag,r=e.type===ee.htmlSelfClosing,n=e,s=n.b,i=`</${t}>`;if(!r&&n.a)return{kind:"literal",literal:(n.h||i)+(n.e||"")};if(r){var a=e;return a.a?{kind:"literal",literal:a.h||i}:a.m?{kind:"literal",literal:a.m}:{kind:"literal",literal:Ou(t,s,e.attrs," />")}}var o=Ou(t,s,e.attrs,">"),c=n.children,l=c!=null&&c.length>0;if(n.c&&n.j!==void 0)return l?{kind:"sandwich",open:o,close:i}:{kind:"literal",literal:n.j};if(n.c&&!l)return{kind:"literal",literal:o+(n.e||"")+(n.h||i)};if(c!=null&&c.length>0){for(var u="",m=0;m<c.length;m++){var _=c[m];if(_.type!==ee.text)return{kind:"sandwich",open:o,close:i};u+=_.text}return{kind:"literal",literal:o+u+i}}var v=n.e||"";return v&&v.indexOf(i)!==-1?{kind:"literal",literal:o+v}:{kind:"literal",literal:o+v+i}}function Qv(e,t,r){var n=[],s=e,i=r;if(s&&n.push(s),Array.isArray(t))for(var a=0;a<t.length;a++)n.push(t[a]);else t!=null&&n.push(t);i&&n.push(i);for(var o=[],c=0;c<n.length;c++){var l=n[c];typeof l=="string"&&o.length>0&&typeof o.at(-1)=="string"?o[o.length-1]=o.at(-1)+l:o.push(l)}return o}function Wn(e){return e==null||e.tagfilter!==!1}function eb(e,t,r,n){var s=t(e,r,n);return s===null?null:rb(s)}function tb(e){var t=[];if(!e)return t;for(var r in e)r.charCodeAt(0)===94&&t.push({identifier:r,footnote:e[r].target});return t}function xc(e,t,r){if(t.indexOf(".")===-1)return e?.[t]||r;for(var n=e,s=t.split("."),i=0;i<s.length&&(n=n?.[s[i]],n!==void 0);)i++;return n||r}function rb(e){for(var t=!1,r=0;r<e.length;r++){var n=e.charCodeAt(r);if(n<=ie||n===jn||n===wc||n===He||n===Pe||n===tt||n===mt||n===ir||n===Nr||n===Le||n>=123){t=!0;break}}if(!t)return e;for(var s="",r=0;r<e.length;r++){var n=e.charCodeAt(r);if(n===wc&&r+2<e.length){var i=e.charCodeAt(r+1),a=e.charCodeAt(r+2);if((i>=Ae&&i<=xe||i>=ve&&i<=Cc||i>=ze&&i<=Pn)&&(a>=Ae&&a<=xe||a>=ve&&a<=Cc||a>=ze&&a<=Pn)){s+=e[r]+e[r+1]+e[r+2],r+=2;continue}}if(n>=55296&&n<=57343){if(n<=56319&&r+1<e.length){var o=e.charCodeAt(r+1);if(o>=56320&&o<=57343){s+=encodeURI(e[r]+e[r+1]),r++;continue}}s+=e[r];continue}s+=encodeURI(e[r])}return s}function nb(...e){return e.filter(Boolean).join(" ")}var ib=new Set(["title","textarea","style","xmp","iframe","noembed","noframes","script","plaintext"]),Ta=/<(\/?)(title|textarea|style|xmp|iframe|noembed|noframes|script|plaintext)(\s|>|\/)/gi;function ku(e){return ib.has(e.toLowerCase())}function sb(e){return Ta.lastIndex=0,Ta.test(e)}function Nu(e){return Ta.lastIndex=0,e.replace(Ta,(t,r,n,s)=>`&lt;${r}${n}${s}`)}function al(e,t){var r=e||{},n=r.slugify,s;if(n){var i=n;s=a=>i(a,Nn)}else s=Nn;return{disableAutoLink:r.disableAutoLink,disableFrontmatter:r.disableFrontmatter,disableParsingRawHTML:r.disableParsingRawHTML,enforceAtxHeadings:r.enforceAtxHeadings,evalUnserializableExpressions:r.evalUnserializableExpressions,forceBlock:r.forceBlock,forceInline:t===void 0?r.forceInline:t,ignoreHTMLBlocks:r.ignoreHTMLBlocks,optimizeForStreaming:r.optimizeForStreaming,preserveFrontmatter:r.preserveFrontmatter,sanitizer:r.sanitizer||Pr,slugify:s,tagfilter:Wn(r)}}var ab=/^<([a-zA-Z][a-zA-Z0-9-]*)\s[^>]*>/,ob=/^<[A-Z]/,Pc=["script","pre","style","textarea"],Mi=new Set(Pc),cb=/<(?:pre|script|style|textarea)\b/i,Iu=/<(?:pre|script|style|textarea)\b/iy,qo=/^(\s{0,3}#[#\s]|\s{0,3}[-*+]\s|\s{0,3}\d+\.\s|\s{0,3}>\s|\s{0,3}```)/m,Ru=/^<([a-z][^ >/\n\r]*) ?([^>]*?)>/im,Fm=new Uint8Array(128);(()=>{for(var e=[Le,it,Qe,ut,Bt,tt,It,He,mt,Xa,de,Fa,En,Pn],t=0;t<e.length;t++)Fm[e[t]]=1})();var $u=/([a-zA-Z_][a-zA-Z0-9_-]*)=(?:"([^"]*)"|'([^']*)')/g;function lb(e){return Mi.has(e)}function ub(e){return cb.test(e)}function Dm(e,t,r){for(var n=t,s=r;n<s&&(e.charCodeAt(n)===ie||e.charCodeAt(n)===ae);)n++;if(n>=s)return!1;e.charCodeAt(n)===ht&&n++;for(var i=0;n<s;){for(;n<s&&(e.charCodeAt(n)===ie||e.charCodeAt(n)===ae);)n++;if(n>=s)break;if(e.charCodeAt(n)===ht&&i>0){for(var a=n+1;a<s&&(e.charCodeAt(a)===ie||e.charCodeAt(a)===ae);)a++;if(a>=s)return!0}if(e.charCodeAt(n)===Ct&&n++,n>=s||e.charCodeAt(n)!==we)return!1;for(;n<s&&e.charCodeAt(n)===we;)n++;for(n<s&&e.charCodeAt(n)===Ct&&n++,i++;n<s&&(e.charCodeAt(n)===ie||e.charCodeAt(n)===ae);)n++;if(n<s)if(e.charCodeAt(n)===ht)n++;else return!1}return i>0}var db=/[\u0000-\u001F\u007F]/g,fb={action:1,background:1,cite:1,data:1,formaction:1,href:1,longdesc:1,poster:1,src:1,"xlink:href":1},hb=/&#(x[0-9a-f]+|[0-9]+);?/gi;function mb(e){return e.indexOf("&#")===-1?e:e.replace(hb,(t,r)=>{var n=r.charCodeAt(0)===km||r.charCodeAt(0)===Nm?Number.parseInt(r.slice(1),16):Number.parseInt(r,10);return n>0&&n<=1114111?String.fromCodePoint(n):t})}function pb(e,t,r){if(r&&t.charCodeAt(0)===kn)return!1;var n=e.charCodeAt(0),s=e.charCodeAt(1);if((n===$v||n===Rv)&&(s===Iv||s===Nv))return!(r&&t==="");var i=e.toLowerCase();if(i==="srcdoc")return!0;if(i==="style")return/url\s*\(\s*(javascript|vbscript|data:(?!image\/))/i.test(t);if(fb[i]===1){var a=mb(Wr(t));if(Pr(a)===null)return!0;var o=a.replace(db,"");return o!==a&&Pr(o)===null}return!1}function Oc(e){return"<"+(e.f?"/":"")+e.tag+e.g+e.b+(e.n?e.r?" />":"/>":">")}function Fu(e,t,r,n){for(var s=[],i=t,a=0;a<n.length;a+=2){var o=n[a];if(o>i){var c=e.slice(i,o).trim();c&&s.push(c)}i=n[a+1]}if(i<r){var l=e.slice(i,r).trim();l&&s.push(l)}return s.join(" ")}function fr(e,t){if(e.charCodeAt(t)!==He)return null;let r=t+1,n=e.length,s=!1;e.charCodeAt(r)===et&&(r++,s=!0);let i=r,a=e.charCodeAt(r);if(!(a>=ze&&a<=Xe||a>=ve&&a<=be))return null;for(;r<n&&(e.charCodeAt(r)>=ze&&e.charCodeAt(r)<=Xe||e.charCodeAt(r)>=ve&&e.charCodeAt(r)<=be||e.charCodeAt(r)>=Ae&&e.charCodeAt(r)<=xe||e.charCodeAt(r)===we);)r++;let o=e.slice(i,r);if(!o)return null;let c=o.charCodeAt(0),l=c>=ve&&c<=be||o.indexOf("-")!==-1,u=r;for(;r<n&&(e.charCodeAt(r)===ie||e.charCodeAt(r)===ae||e.charCodeAt(r)===de);)r++;let m=e.slice(u,r);if(r===u&&r<n){var _=e.charCodeAt(r);if(_!==Pe&&_!==et)return null}let v=r,S={},E=!1;for(var g=null;r<n;){let U=e.charCodeAt(r);if(U===Pe){let B=g?Fu(e,v,r,g):e.slice(v,r);return{r:E,u:l,f:s,b:B,q:g!=null,n:!1,g:m,attrs:S,end:r+1,tag:o}}if(U===ie||U===ae||U===de){r++;continue}if(U===et&&r+1<n&&e.charCodeAt(r+1)===Pe){E=r>v&&e.charCodeAt(r-1)===ie;let B=g?Fu(e,v,r,g):e.slice(v,r);return{r:E,u:l,f:s,b:B,q:g!=null,n:!0,g:m,attrs:S,end:r+2,tag:o}}var y=r,f=e.charCodeAt(r);if(!(f>=ze&&f<=Xe||f>=ve&&f<=be||f===Qe||f===Ct))return null;for(r++;r<n;){var C=e.charCodeAt(r);if(C>=ze&&C<=Xe||C>=ve&&C<=be||C>=Ae&&C<=xe||C===Qe||C===Ht||C===Ct||C===we)r++;else break}for(var P=e.slice(y,r),h=r;r<n&&(e.charCodeAt(r)===ie||e.charCodeAt(r)===ae);)r++;var b,O;if(e.charCodeAt(r)===Bt){for(r++;r<n&&(e.charCodeAt(r)===ie||e.charCodeAt(r)===ae);)r++;var k=e.charCodeAt(r);if(k===jn||k===On){r++;for(var $=r;r<n&&e.charCodeAt(r)!==k;)r++;if(r>=n)return null;if(b=e.slice($,r),r++,r<n){var M=e.charCodeAt(r);if(M!==ie&&M!==ae&&M!==de&&M!==Pe&&M!==et)return null}O=r}else if(k===kn){var q=1,$=r;for(r++;r<n&&q>0;){var C=e.charCodeAt(r);C===kn?q++:C===sl&&q--,r++}b=e.slice($,r),O=r}else{for(var $=r;r<n;){var L=e.charCodeAt(r);if(L===ie||L===ae||L===Pe||L===de||L===jn||L===On||L===Bt||L===He||L===Le)break;r++}if(r===$)return null;b=e.slice($,r),O=r}}else b="",O=h;pb(P,b,l)?(g===null&&(g=[]),g.push(y,O)):S[P]=b}return null}function qt(e){var t=e.indexOf("<");if(t===-1)return e;for(var r="",n=0,s=!1;t!==-1;){var i=fr(e,t);i?(i.q&&(r+=e.slice(n,t)+Oc(i),n=i.end,s=!0),t=e.indexOf("<",i.end)):t=e.indexOf("<",t+1)}return s?r+e.slice(n):e}function yb(e,t,r){if(!r.optimizeForStreaming&&e.indexOf("[")===-1)return!1;for(var n=0,s=e.length,i=!1,a=!1;n<s;){for(var o=e.indexOf(`
`,n),c=o<0?s:o,l=n,u=0;l<c&&u<4;)if(e.charCodeAt(l)===ie)u++,l++;else if(e.charCodeAt(l)===ae)u+=4,l++;else break;if(l>=c){i=!1,n=o<0?s:o+1;continue}if(u<4){var m=e.charCodeAt(l);if(m===Le||m===ut){for(var _=m,v=0,S=l;S<c&&e.charCodeAt(S)===_;)v++,S++;if(v>=3){var E=!0;if(_===Le){for(var g=S;g<c;g++)if(e.charCodeAt(g)===Le){E=!1;break}}if(E){i=!1;for(var y=o<0?s:o+1;y<s;){for(var f=y,C=0;f<s&&C<4;){var P=e.charCodeAt(f);if(P===ie)C++,f++;else if(P===ae)C+=4,f++;else break}if(C<4&&f<s&&e.charCodeAt(f)===_){for(var h=0;f<s&&e.charCodeAt(f)===_;)h++,f++;if(h>=v){for(;f<s&&(e.charCodeAt(f)===ie||e.charCodeAt(f)===ae);)f++;if(f>=s||e.charCodeAt(f)===de){n=f>=s?s:f+1;break}}}for(;y<s&&e.charCodeAt(y)!==de;)y++;y<s&&y++}y>=s&&(n=s,a=!0);continue}}}}for(var b=l;b<c&&e.charCodeAt(b)===Pe;){b++,b<c&&e.charCodeAt(b)===ie&&b++;for(var O=0;b<c&&O<4;)if(e.charCodeAt(b)===ie)O++,b++;else if(e.charCodeAt(b)===ae)O+=4,b++;else break;if(O>=4)break;i=!1}if(!i&&u<4&&b<c&&e.charCodeAt(b)===tt&&!(b+1<s&&e.charCodeAt(b+1)===Nr)){var k=Tm(e,b,t);if(k){n=k,i=!1;continue}}var $=e.charCodeAt(l);if($===Wt&&u<4)i=!1;else if(u<4&&($===we||$===it||$===Qe)){for(var M=l,q=0;M<c;){var L=e.charCodeAt(M);if(L===$)q++;else if(L!==ie&&L!==ae)break;M++}i=!(q>=3&&M>=c)}else i=!0;n=o<0?s:o+1}return a}function Tm(e,t,r){let n=e.length;if(e.charCodeAt(t)!==tt)return null;let s=t+1<n&&e.charCodeAt(t+1)===Nr,i=t+1;for(;i<n;){var a=e.charCodeAt(i);if(a===ir){i++;break}if(a===tt)return null;a===mt&&i+1<n&&i++,i++}if(i>n||e.charCodeAt(i-1)!==ir)return null;let o=e.slice(t+1,i-1);if(o.length>999)return null;let c=xa(o);if(!c||i>=n||e.charCodeAt(i)!==Ct)return null;i++;let l=!1;for(;i<n;){let U=e.charCodeAt(i);if(U===ie||U===ae)i++;else if(U===de&&!l)l=!0,i++;else break}if(s){let U=e.indexOf(`
`,i),B=U<0?n:U,W=e.slice(i,B).trim();return r[c]={target:W,title:void 0},U<0?n:U+1}var u;if(i<n&&e.charCodeAt(i)===He){i++;for(var m=i;i<n&&e.charCodeAt(i)!==Pe&&e.charCodeAt(i)!==de;)e.charCodeAt(i)===mt&&i+1<n&&i++,i++;if(i>=n||e.charCodeAt(i)!==Pe)return null;u=e.slice(m,i),i++;for(var _=e.indexOf(`
`,i),v=_<0?n:_,S=i;S<v&&(e.charCodeAt(S)===ie||e.charCodeAt(S)===ae);)S++;if(S<v){if(S===i)return null;var E=e.charCodeAt(S);if(E!==jn&&E!==On&&E!==er)return null}}else{for(var m=i,g=0;i<n;){var a=e.charCodeAt(i);if(a===er)g++;else if(a===tr){if(g===0)break;g--}else{if(a===ie||a===ae||a===de)break;a===mt&&i+1<n&&i++}i++}if(u=e.slice(m,i),!u)return null}for(;i<n&&(e.charCodeAt(i)===ie||e.charCodeAt(i)===ae);)i++;var y=e.indexOf(`
`,i),f=y<0?n:y,C,P=!1,h=i,b=i;if(i===f&&i<n)for(b=i+1;b<n&&(e.charCodeAt(b)===ie||e.charCodeAt(b)===ae);)b++;if(b<n){var O=e.charCodeAt(b);if(O===jn||O===On||O===er){for(var k=O===er?41:O,$=b+1,M=$;$<n;){var q=e.charCodeAt($);if(q===k){for(var L=$+1;L<n&&(e.charCodeAt(L)===ie||e.charCodeAt(L)===ae);)L++;(L>=n||e.charCodeAt(L)===de)&&(C=e.slice(M,$),P=!0,h=L<n?L+1:n);break}if(q===mt&&$+1<n){$+=2;continue}if(q===de&&$+1<n&&e.charCodeAt($+1)===de)break;$++}if(!P&&b===i)return null}}if(P)return r[c]||(r[c]={target:Wr(ti(u)),title:C===void 0?C:Wr(ti(C))}),h;for(;i<f&&(e.charCodeAt(i)===ie||e.charCodeAt(i)===ae);)i++;return i<f?null:(r[c]||(r[c]={target:Wr(ti(u)),title:C}),y<0?n:y+1)}var Ft=new Uint8Array(Vv);for(Ft[Wt]|=Yt,Ft[Pe]|=Yt,Ft[we]|=Yt|Fr,Ft[Qr]|=Yt,Ft[it]|=Yt|Fr,Ft[Qe]|=Yt|Fr,Ft[Le]|=Yt|Fr,Ft[ut]|=Yt|Fr,Ft[He]|=Yt|Fr,Ft[tt]|=Fr,Ft[It]|=Fr,Ft[ht]|=Yt,Gi=Ae;Gi<=xe;Gi++)Ft[Gi]|=Yt;var Gi;function Du(e){if(e.indexOf("[")<0&&e.indexOf("]")<0)return!1;for(var t=0;t<e.length;t++){if(e.charCodeAt(t)===mt){t++;continue}if(e.charCodeAt(t)===tt||e.charCodeAt(t)===ir)return!0}return!1}function xa(e){for(var t=e.length,r=!0,n=t>0,s=0;s<t;s++){var i=e.charCodeAt(s);if(i===ie){if(r){n=!1;break}r=!0}else if(i<33||i>126||i>=ve&&i<=be){n=!1;break}else r=!1}if(n&&!r)return e;var a=e.replace(/\s+/g," ").trim();return a.indexOf("ẞ")!==-1?a.replace(/\u1E9E/g,"ss").toLowerCase():a.toLowerCase()}function ol(e){return e<Za?Ft[e]:e===Ov?bn:0}function ti(e){return e.indexOf("\\")===-1?e:e.replace(/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,"$1")}var jc=null,kc=-1,Pa=-1;function Ve(e,t){if(t>=kc&&t<=Pa&&e===jc)return Pa;var r=e.indexOf(`
`,t),n=r<0?e.length:r;return jc=e,kc=t,Pa=n,n}function Ne(e,t){let r=Ve(e,t);return r<e.length?r+1:r}function Ri(e,t,r){for(;t<r;){let n=e.charCodeAt(t);if(n!==ie&&n!==ae)break;t++}return t}function Tu(e,t){let r=Ne(e,t);for(;r<e.length;){let n=Ve(e,r);if(kt(e,r,n))return r;r=Ne(e,r)}return e.length}function en(e,t,r,n){let s=0;for(;t+s<r&&e.charCodeAt(t+s)===n;)s++;return s}var qe=0,De=0;function ot(e,t,r){for(qe=0,De=0;t+De<r;){let n=e.charCodeAt(t+De);if(n===ae)qe+=4-qe%4;else if(n===ie)qe++;else break;De++}}function kt(e,t,r){return Ri(e,t,r)>=r}function gb(e,t){if(!e)return e;var r=t.v||(t.v=Object.create(null)),n=r[e];if(n===void 0)return r[e]=0,e;for(var s=n+1,i=`${e}-${s}`;r[i]!==void 0;)s++,i=`${e}-${s}`;return r[e]=s,r[i]=0,i}function vb(e,t,r,n){let s=Ve(e,t);if(ot(e,t,s),qe>3)return null;let i=t+De;if(e.charCodeAt(i)!==Wt)return null;let a=en(e,i,s,35);if(a<1||a>6||(i+=a,i<s&&e.charCodeAt(i)!==ie&&e.charCodeAt(i)!==ae))return null;i=Ri(e,i,s);for(var o=s;o>i&&e.charCodeAt(o-1)===ie;)o--;for(var c=o;o>i&&e.charCodeAt(o-1)===Wt;)o--;if(o<c)if(o===i||e.charCodeAt(o-1)===ie)for(;o>i&&e.charCodeAt(o-1)===ie;)o--;else o=c;let l=e.slice(i,o),u=ri(l,!1,r,n);return{node:{type:ee.heading,level:a,children:u,id:""},end:Ne(e,s)}}function bb(e,t,r){var n=e.charCodeAt(t);if(n!==Bt&&n!==we)return!1;for(var s=t;s<r&&e.charCodeAt(s)===n;)s++;for(;s<r&&(e.charCodeAt(s)===ie||e.charCodeAt(s)===ae);)s++;return s>=r}function Jr(e,t){let r=Ve(e,t);if(ot(e,t,r),qe>3)return null;let n=t+De,s=e.charCodeAt(n);if(s!==we&&s!==it&&s!==Qe)return null;let i=0;for(;n<r;){let a=e.charCodeAt(n);if(a===s)i++;else if(a!==ie&&a!==ae)return null;n++}return i<3?null:{node:{type:ee.breakThematic},end:Ne(e,r)}}var Mu=0,qu=0,Uu="";function _b(e,t,r){let n=Ve(e,t);if(ot(e,t,n),qe>3)return null;let s=qe,i=t+De,a=e.charCodeAt(i);if(a!==Le&&a!==ut)return null;let o=en(e,i,n,a);if(o<3)return null;i+=o;let c=Ri(e,i,n),l=n;if(a===Le){for(let B=c;B<n;B++)if(e.charCodeAt(B)===Le)return null}for(;l>c&&(e.charCodeAt(l-1)===ie||e.charCodeAt(l-1)===ae);)l--;let u=e.slice(c,l),m="",_="",v=u.indexOf(" ");v===-1?m=u:(m=u.slice(0,v),_=u.slice(v+1).trim()),m=ti(m);var S;if(_){$u.lastIndex=0;for(var E;(E=$u.exec(_))!=null;)S||(S={}),S[E[1]]=E[2]===void 0?E[3]:E[2]}let g=Ne(e,n),y=e.length,f=e.length;var C;a===Mu&&o===qu?C=Uu:(C=String.fromCharCode(a).repeat(o),Mu=a,qu=o,Uu=C);for(var P=g;P<e.length;){var h=e.indexOf(C,P);if(h===-1)break;for(var b=h,O=0;b>0&&O<4&&e.charCodeAt(b-1)===ie;)b--,O++;if(O<=3&&(b===0||e.charCodeAt(b-1)===de)){for(var k=h+o;k<e.length&&e.charCodeAt(k)===a;)k++;var $=Ve(e,k);if(kt(e,k,$)){y=b,f=Ne(e,$);break}}P=h+1}var M;if(s===0)M=y>g&&e.charCodeAt(y-1)===de?e.slice(g,y-1):e.slice(g,y);else{M="";for(var q=g;q<y;){var L=Ve(e,q);ot(e,q,L);var U=Math.min(De,s);M+=`${e.slice(q+U,L)}
`,q=Ne(e,L)}M.length>0&&M.charCodeAt(M.length-1)===de&&(M=M.slice(0,-1))}return{node:{type:ee.codeBlock,lang:m||void 0,text:M,infoString:_||void 0,attrs:S},end:f}}function Lu(e,t,r){for(var n=0,s=t;s<r&&n<4;)e.charCodeAt(s)===ae?n+=4-n%4:n++,s++;if(n<4)return"";for(var i="",a=4;a<n;a++)i+=" ";return i+e.slice(s,r)}function Sb(e,t){let r=Ve(e,t);if(ot(e,t,r),qe<4)return null;let n="",s=t;for(;s<e.length;){let _=Ve(e,s);if(ot(e,s,_),kt(e,s,_)){for(var i=`${Lu(e,s,_)}
`,a=Ne(e,_);a<e.length;){var o=Ve(e,a);if(kt(e,a,o)){i+=`${Lu(e,a,o)}
`,a=Ne(e,o);continue}ot(e,a,o),qe>=4&&(n+=i,s=a);break}if(s!==a)break;continue}if(qe<4)break;let v=0,S=0;var c=0;for(let E=s;E<_&&S<4;E++){if(e.charCodeAt(E)===ae){var l=4-S%4;S+l>4&&(c=S+l-4),S+=l}else S++;v++}var u="";if(c>0)for(var m=0;m<c;m++)u+=" ";u+=e.slice(s+v,_),n+=`${u}
`,s=Ne(e,_)}for(;n.length>0&&n.charCodeAt(n.length-1)===de;)n=n.slice(0,-1);return n?{node:{type:ee.codeBlock,lang:void 0,text:n,infoString:void 0,attrs:void 0},end:s}:null}function wb(e,t,r,n){let s=Ve(e,t);if(ot(e,t,s),qe>3)return null;let i=t+De;if(e.charCodeAt(i)!==Pe)return null;let a="",o=t,c,l=!1,u=!1,m=!1;for(;o<e.length;){let Y=Ve(e,o);ot(e,o,Y);let Q=o+De;if(e.charCodeAt(Q)===Pe){let Z=Q+1;var _=qe+1,v=!1;if(Z<Y){var S=e.charCodeAt(Z);S===ie?(Z++,_++,v=!0):S===ae&&(v=!0)}for(var E="",g=!1,y=Z;y<Y;y++)if(e.charCodeAt(y)===ae){g=!0;break}if(g){var f=_;if(v&&Z<Y&&e.charCodeAt(Z)===ae){for(var C=4-f%4,P=0;P<C-1;P++)E+=" ";f+=C,Z++}for(var h=Z;h<Y;h++)if(e.charCodeAt(h)===ae){for(var b=4-f%4,O=0;O<b;O++)E+=" ";f+=b}else E+=e[h],f++}else E=e.slice(Z,Y);if(!(a||c)){let re=E.match(/^\[!([A-Za-z]+)\]\s*$/);if(re){c=re[1].toUpperCase(),o=Ne(e,Y);continue}}a+=`${E}
`;var k=E.trimStart();k.startsWith("```")||k.startsWith("~~~")?m=!m:(E.startsWith(" ")||E.startsWith(" "))&&(m=!0),u=k.length>0,o=Ne(e,Y)}else if(a&&!kt(e,o,Y)&&u){if(qe<4){var $=o+De,M=$<Y?e.charCodeAt($):0;if(M===Wt||M===Pe||M===Le||M===ut||M===He||(M===we||M===it||M===Qe)&&Jr(e,o)||(M===we||M===it||M===Qr)&&$+1<Y&&(e.charCodeAt($+1)===ie||e.charCodeAt($+1)===ae))break;if(M>=Ae&&M<=xe){for(var q=$;q<Y&&e.charCodeAt(q)>=Ae&&e.charCodeAt(q)<=xe;)q++;if(q<Y&&(e.charCodeAt(q)===Ht||e.charCodeAt(q)===tr))break}}if(m)break;a+=`${e.slice(o,Y)}
`,l=!0,o=Ne(e,Y)}else break}if(!(a||c))return null;var{inBlockQuote:L,l:U}=r;r.inBlockQuote=!0,l&&(r.l=!0);var B=r.i;r.i=B||!kt(e,o,e.length);let W=Yr(a||"",r,n);return r.i=B,r.inBlockQuote=L,r.l=U,{node:{type:ee.blockQuote,children:W,alert:c||void 0},end:o}}function Mm(e,t,r){for(var n=0,s=t;s<r;s++)e.charCodeAt(s)===ae?n+=4-n%4:n++;return n}function Dr(e,t,r){if(ot(e,t,r),qe>3)return null;var n=t+De;if(n>=r)return null;var s=e.charCodeAt(n),i=qe,a=n,o=n;if(s===we||s===it||s===Qr){if(a=n+1,a<r&&e.charCodeAt(a)!==ie&&e.charCodeAt(a)!==ae&&e.charCodeAt(a)!==de)return null}else if(s>=Ae&&s<=xe){for(;o<r&&o-n<9;){var c=e.charCodeAt(o);if(c<Ae||c>xe)break;o++}if(o>n&&o<r){var l=e.charCodeAt(o);if(l===Ht||l===tr){if(a=o+1,a<r&&e.charCodeAt(a)!==ie&&e.charCodeAt(a)!==ae&&e.charCodeAt(a)!==de)return null}else return null}else return null}else return null;var u=a,m=Mm(e,t,a),_=0,v=u,S=m;if(u>=r)return{ordered:s>=Ae&&s<=xe,marker:s>=Ae&&s<=xe?e[o]:e[n],start:s>=Ae&&s<=xe?Number.parseInt(e.slice(n,o),10):void 0,contentStart:u,contentCol:m+1,markerCol:i,isEmpty:!0};for(;v<r&&(e.charCodeAt(v)===ie||e.charCodeAt(v)===ae);){if(e.charCodeAt(v)===ae){var E=4-S%4;S+=E}else S++;v++,_++}var g=v>=r,y=S-m;return g||y>4?(S=m+1,v=u+1,_=1):_===0&&(S=m+1,v=u,_=1),{ordered:s>=Ae&&s<=xe,marker:s>=Ae&&s<=xe?e[o]:e[n],start:s>=Ae&&s<=xe?Number.parseInt(e.slice(n,o),10):void 0,contentStart:v,contentCol:S,markerCol:i,isEmpty:g}}var Qn=0;function Vu(e,t,r,n){var s=0,i=t;for(Qn=0;i<r&&s<n;){var a=e.charCodeAt(i);if(a===ae){var o=4-s%4;if(s+o>n){Qn=s+o-n,i++,s=n;break}s+=o}else if(a===ie)s++;else break;i++}return i}function zu(e,t,r,n){var s=Ve(e,t),i=Dr(e,t,s);if(!i)return null;var a=[],o=t,c=i.contentCol,l="",u=i.isEmpty,m=!1,_=!1;if(!i.isEmpty){for(var v=!1,S=i.contentStart;S<s;S++)if(e.charCodeAt(S)===ae){v=!0;break}if(v){var E="",g=Mm(e,t,i.contentStart),y=g-i.contentCol;if(y>0)for(var f=0;f<y;f++)E+=" ";for(var C=i.contentStart;C<s;C++)if(e.charCodeAt(C)===ae){for(var P=4-g%4,h=0;h<P;h++)E+=" ";g+=P}else E+=e[C],g++;l=`${E}
`}else l=`${e.slice(i.contentStart,s)}
`}for(o=Ne(e,s);o<e.length;){var b=Ve(e,o);ot(e,o,b);var O=e.charCodeAt(o+De);if(qe<c&&(O===we||O===it||O===Qe)&&qe<=3&&Jr(e,o))break;var k=Dr(e,o,b);if(k&&k.ordered===i.ordered&&k.marker===i.marker&&k.markerCol<c){a.push({contentCol:c,raw:l,hasBlankAfter:m,isEmpty:u}),m&&(_=!0),c=k.contentCol,u=k.isEmpty,m=!1,l=k.isEmpty?"":`${e.slice(k.contentStart,b)}
`,o=Ne(e,b);continue}if(kt(e,o,b)){var $=Vu(e,o,b,c);if(Qn>0||$<b){for(var M="",q=0;q<Qn;q++)M+=" ";l+=`${M+e.slice($,b)}
`}else l+=`
`;o=Ne(e,b);for(var L=!1,U=0;U<l.length;U++){var B=l.charCodeAt(U);if(B!==de&&B!==Zr&&B!==ie&&B!==ae){L=!0;break}}if(u&&!L)if(o<e.length){var W=Ve(e,o),Y=Dr(e,o,W);if(!Y||Y.ordered!==i.ordered||Y.marker!==i.marker)break;m=!0}else break;if(o<e.length){var Q=Ve(e,o);ot(e,o,Q);var Z=e.charCodeAt(o+De);if((Z===we||Z===it||Z===Qe)&&qe<=3&&Jr(e,o))break;var re=Dr(e,o,Q);if(re&&re.ordered===i.ordered&&re.marker===i.marker&&re.markerCol<c){m=!0;continue}if(!kt(e,o,Q)&&qe<c)break}continue}if(qe>=c){var A=Vu(e,o,b,c);if(Qn>0){for(var w="",j=c,p=0;p<Qn;p++)w+=" ",j++;for(var d=A;d<b;d++)if(e.charCodeAt(d)===ae){for(var x=4-j%4,I=0;I<x;I++)w+=" ";j+=x}else w+=e[d],j++;l+=`${w}
`}else l+=`${e.slice(A,b)}
`;o=Ne(e,b);continue}for(var T=!1,F=0;F<l.length;F++){var z=l.charCodeAt(F);if(z!==de&&z!==Zr&&z!==ie&&z!==ae){T=!0;break}}if(!m&&T&&!u){var H=o+De,R=e.charCodeAt(H),D=R===Wt||R===Pe||R===He||R===Le||R===ut||(R===we||R===it||R===Qe||R===Qr)&&(Jr(e,o)!=null||Dr(e,o,b)!=null)||R>=Ae&&R<=xe&&Dr(e,o,b)!=null;if(!D){l+=`${e.slice(H,b)}
`,o=Ne(e,b);continue}}break}if(a.push({contentCol:c,raw:l,hasBlankAfter:m,isEmpty:u}),a.length===0)return null;var V=_;if(!V)for(var K=0;K<a.length;K++){if(a[K].hasBlankAfter&&K<a.length-1){V=!0;break}if(!a[K].isEmpty){for(var G=a[K].raw,J=G.length,te=0,ne=!1,se=!1,ce=!1,he=!1,le=0,ge=0,Fe=-1;te<J;){var fe=G.indexOf(`
`,te);if(fe<0&&(fe=J),he){ot(G,te,fe);for(var Ye=G.slice(te+De,fe),ye=0;ye<Ye.length&&Ye.charCodeAt(ye)===le;)ye++;ye>=ge&&Ye.slice(ye).trim()===""&&(he=!1),te=fe<J?fe+1:J;continue}if(kt(G,te,fe)){Fe>=0?ce=!0:ne&&(se=!0),te=fe<J?fe+1:J;continue}if(ot(G,te,fe),Fe>=0){if(qe>=Fe){te=fe<J?fe+1:J;continue}var oe=Dr(G,te,fe);if(oe&&oe.markerCol<Fe&&oe.contentCol<=Fe){te=fe<J?fe+1:J;continue}if(oe){te=fe<J?fe+1:J;continue}Fe=-1,ce&&(se=!0,ce=!1)}var ft=G.slice(te+De,fe),ke=ft.charCodeAt(0);if((ke===Le||ke===ut)&&qe<=3){for(var Et=0;Et<ft.length&&ft.charCodeAt(Et)===ke;)Et++;if(Et>=3){if(se&&ne){V=!0;break}he=!0,le=ke,ge=Et,ne=!0,te=fe<J?fe+1:J;continue}}var Ke=qe<=3?Dr(G,te,fe):null;if(Ke&&ne){if(se){V=!0;break}Fe=Ke.contentCol,ce=!1,te=fe<J?fe+1:J,ne=!0;continue}if(se){V=!0;break}ne=!0,te=fe<J?fe+1:J}if(V)break}}for(var rt=[],pt=0;pt<a.length;pt++){for(var At=a[pt],Rt=At.raw,_t=Rt.length;_t>0&&Rt.charCodeAt(_t-1)===de;)_t--;var xt=_t<Rt.length?Rt.slice(0,_t):Rt,sn=null;if(xt.length>=3&&xt.charCodeAt(0)===tt){var Ir=xt[1];(Ir===" "||Ir==="x"||Ir==="X")&&xt.charCodeAt(2)===ir&&(sn={type:ee.gfmTask,completed:Ir==="x"||Ir==="X"},xt=xt.slice(3))}var st;if(At.isEmpty&&xt.trim()==="")st=[];else if(V){var an=r.inList;r.inList=!0;var Ui=r.i;r.i=Ui||pt!==a.length-1,st=Yr(xt,r,n),r.i=Ui,r.inList=an}else{var _r=r.inList;r.inList=!0;var on=r.i;if(r.i=on||pt!==a.length-1,st=Yr(xt,r,n),r.i=on,r.inList=_r,st.length===1&&st[0].type===ee.paragraph)st=st[0].children;else if(r.p){var Rr=[];r.p.push({src:st,dest:Rr,unwrap:!0}),st=Rr}else{for(var or=[],$t=0;$t<st.length;$t++)if(st[$t].type===ee.paragraph)for(var cr=st[$t].children,Fn=0;Fn<cr.length;Fn++)or.push(cr[Fn]);else or.push(st[$t]);st=or}}if(sn){var cn=[sn,{type:ee.text,text:" "}];if(r.p)r.p.push({src:st,dest:cn,unwrap:!1});else for(var Jt=0;Jt<st.length;Jt++)cn.push(st[Jt]);rt.push(cn)}else rt.push(st)}return{node:{type:i.ordered?ee.orderedList:ee.unorderedList,start:i.ordered?i.start:void 0,items:rt},end:o}}var Ma=new Set(["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"]);function dr(e,t,r){let n={};for(let[a,o]of Object.entries(e)){let c=a.toLowerCase();if(c==="style"&&typeof o=="string"){let l={},u=[],m=0,_=0;for(let S=0;S<o.length;S++){let E=o.charCodeAt(S);E===er?m++:E===tr?m--:E===Da&&m===0&&(u.push(o.slice(_,S)),_=S+1)}_<o.length&&u.push(o.slice(_));let v=!1;u.forEach(S=>{let E=S.indexOf(":");if(E===-1)return;let g=S.slice(0,E).trim(),y=S.slice(E+1).trim();if(g&&y){if(/url\s*\(\s*(javascript|vbscript|data:(?!image\/))/i.test(y)){v=!0;return}let f=g.indexOf("-")===-1?g:g.replace(/-([a-z])/g,(C,P)=>P.toUpperCase());l[f]=y}}),!v&&Object.keys(l).length>0&&(n[a]=l)}else if((c==="href"||c==="src")&&r?.sanitizer){let l=r.sanitizer(o,t,c);l!=null&&(n[a]=l)}else if(o==="")n[a]=!0;else if(o.length>=2&&o.charCodeAt(0)===kn&&o.charCodeAt(o.length-1)===sl){var s=o.slice(1,-1);if(s.length>0){var i=s.charCodeAt(0);if(i===tt||i===kn)try{n[a]=JSON.parse(s);continue}catch{}}if(s==="true"){n[a]=!0;continue}if(s==="false"){n[a]=!1;continue}if(r?.evalUnserializableExpressions)try{n[a]=(0,eval)(`(${s})`);continue}catch{}n[a]=s}else n[a]=o}return n}function zr(e,t,r){let n=t.length;if(n===0)return r;var s=t.charCodeAt(0),i=s>=ve&&s<=be||s>=ze&&s<=Xe;if(!i){for(var a=String.fromCharCode(s),o=e.length-n,c=r;c<=o;){var l=e.indexOf(a,c);if(l===-1||l>o)return-1;for(var u=!0,m=1;m<n;m++){var _=e.charCodeAt(l+m),v=t.charCodeAt(m);if(_>=ve&&_<=be&&(_+=Qt),v>=ve&&v<=be&&(v+=Qt),_!==v){u=!1;break}}if(u)return l;c=l+1}return-1}s>=ve&&s<=be&&(s+=Qt);for(let E=r;E<=e.length-n;E++){var S=e.charCodeAt(E);if(S>=ve&&S<=be&&(S+=Qt),S!==s)continue;let g=!0;for(let y=1;y<n;y++){let f=e.charCodeAt(E+y),C=t.charCodeAt(y);if(f>=ve&&f<=be&&(f+=Qt),C>=ve&&C<=be&&(C+=Qt),f!==C){g=!1;break}}if(g)return E}return-1}function Cb(e,t,r){let n=t.length;var s=t.charCodeAt(0);s>=ve&&s<=be&&(s+=Qt);for(let a=Math.min(r,e.length-n);a>=0;a--){var i=e.charCodeAt(a);if(i>=ve&&i<=be&&(i+=Qt),i!==s)continue;let o=!0;for(let c=1;c<n;c++){let l=e.charCodeAt(a+c),u=t.charCodeAt(c);if(l>=ve&&l<=be&&(l+=Qt),u>=ve&&u<=be&&(u+=Qt),l!==u){o=!1;break}}if(o)return a}return-1}var qa=-1;function Nc(e,t,r){let n=r.toLowerCase(),s=`<${n}`,i=`</${n}`,a=1,o=t,c=e.length;for(qa=-1;o<c&&a>0;){let m=zr(e,s,o),_=zr(e,i,o);if(_===-1)return-1;if(m!==-1&&m<_){let v=fr(e,m);v?(v.tag.toLowerCase()===n&&!v.f&&!v.n&&!Ti(v.tag)&&a++,o=v.end):o=m+1}else{var l=_+i.length,u=l<c?e.charCodeAt(l):62;if((u===Pe||u===ie||u===ae||u===de)&&(a--,a===0)){qa=_;let v=_+i.length;for(;v<c&&e.charCodeAt(v)!==Pe;)v++;return v+1}o=_+1}}return-1}function qm(e,t,r,n){if(n.ignoreHTMLBlocks||n.disableParsingRawHTML)return null;var s=Ve(e,t);if(ot(e,t,s),qe>3&&!r.inHTML)return null;var i=t+De;if(e.charCodeAt(i)!==He)return null;var a=e.indexOf(">",i+1);if(a!==-1&&a<s){var o=e.slice(i+1,a);if(/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(o)||/^[^\s@]+@[^\s@]+$/.test(o))return null}var c=Eb(e,i);if(c>=1&&c<=5){var l=e.length;if(c===1){for(var u=e.length,m=0;m<Pc.length;m++){var _=zr(e,`</${Pc[m]}>`,i);_>=0&&_<u&&(u=_)}if(u<e.length){var v=e.indexOf(">",u);l=v>=0?Ne(e,v+1):e.length}}else{var S=c===2?"-->":c===3?"?>":c===4?">":"]]>",E=e.indexOf(S,i);E>=0&&(l=Ne(e,E+S.length))}var g=e.slice(i,l);if(c>=2)return{node:{type:ee.htmlComment,text:g,s:!1,raw:!0},end:l};var y="div",f=g.match(/^<\/?([a-zA-Z][a-zA-Z0-9-]*)/);f&&(y=f[1]);var C=fr(e,i),P={},h;C&&!C.f&&(P=dr(C.attrs,y,n),h=C.g+C.b);var b=[],O=y.toLowerCase(),k=`</${O}`,$=zr(g,k,0),M="",q,L,U;if(C?.f){U=g.slice(0,C.end-i);for(var B=g.slice(C.end-i);B.length>0&&B.charCodeAt(B.length-1)===de;)B=B.slice(0,-1);B&&(L=qt(B))}else if(C&&!C.f){var W=C.end-i;if($===-1){for(var Y=g;Y.length>0&&Y.charCodeAt(Y.length-1)===de;)Y=Y.slice(0,-1);q=qt(Y)}else{var Q=W;g.charCodeAt(Q)===de&&Q++;for(var Z=$;Z>Q;){var re=g.charCodeAt(Z-1);if(re!==ie&&re!==ae&&re!==de&&re!==Zr)break;Z--}var A=g.slice(Q,Z);A&&(L=qt(A));for(var w=g.slice($);w.length>0&&w.charCodeAt(w.length-1)===de;)w=w.slice(0,-1);U=qt(w),M=g.slice(W,$).trim()}}var j=C?C.f:!1;return{node:{type:ee.htmlBlock,tag:y,attrs:P,b:h,children:b,e:L,h:U,j:q,text:M,c:!0,a:j},end:l}}if(c===6||c===7){var p=Tu(e,t),d=p<e.length?p:e.length,x=e.slice(i,d),I=p<e.length?Ne(e,p):e.length,T=fr(e,i);if(T){var F=T.tag,z=F.toLowerCase(),H=T.f;if(H){var R=e.slice(T.end,d);return{node:{type:ee.htmlBlock,tag:F,attrs:{},children:[],h:e.slice(i,T.end),e:R?qt(R):void 0,text:R,c:!0,a:!0},end:I}}if(T.n||Ti(F))return{node:{type:ee.htmlBlock,tag:F,attrs:dr(T.attrs,F,n),b:T.g+T.b,children:[],text:"",c:!1,a:!1},end:T.end<e.length&&e.charCodeAt(T.end)===de?T.end+1:T.end};var D=r.d||0,V=e.slice(i,d),K=-1,G=-1,J=!1;if(D<10){for(var te=`</${z}`,ne=T.end-i,se=1,ce=ne;ce<V.length&&se>0;){var he=zr(V,`<${z}`,ce),le=zr(V,te,ce);if(le===-1)break;if(he!==-1&&he<le){var ge=he+z.length+1;if(ge<V.length){var Fe=V.charCodeAt(ge);(Fe===ie||Fe===ae||Fe===de||Fe===Pe||Fe===et)&&se++}ce=he+1}else{var fe=le+te.length;if(fe<V.length){var Ye=V.charCodeAt(fe);if((Ye===Pe||Ye===ie||Ye===ae||Ye===de)&&(se--,se===0)){K=le;for(var ye=fe;ye<V.length&&V.charCodeAt(ye)!==Pe;)ye++;G=ye+1;break}}else if(se--,se===0){K=le,G=V.length;break}ce=le+1}}if(K===-1&&!T.f&&(c===6||T.u)){var oe=Nc(e,T.end,z);if(oe!==-1){for(var ft=qa,ke=T.end,Et=!1,Ke=!1,rt=!1,pt=0,At=!1,Rt=!1,_t=ke;_t<ft;){var xt=e.charCodeAt(_t);if(xt===de)Rt&&(Et=!0),At||pt++,Rt=!0,_t++;else if(xt===ie||xt===ae)_t++;else{if(!At&&(At=!0,pt>=2&&xt===He)){rt=!0;break}if(Rt=!1,xt===He){var sn=e.charCodeAt(_t+1)|32;if((sn===Ec||sn===jm||sn===ei)&&(Iu.lastIndex=_t,Iu.test(e))){Ke=!0;break}}_t++}}if(Et&&!rt&&!Ke){var Ir=Ve(e,oe);d=Ir,I=Ne(e,Ir),V=e.slice(i,d),x=e.slice(i,d),K=ft-i,G=oe-i,J=!0}}}}var st=T.b.indexOf(`
`)!==-1||T.g.indexOf(`
`)!==-1,an=!1;if(K!==-1){var Ui=V.slice(G).trim();an=Ui.length===0}var _r=!1,on=d,Rr=I;if(K!==-1){var or=i+G,$t=Ve(e,or-1);if(or<$t){for(var cr=or;cr<$t&&(e.charCodeAt(cr)===ie||e.charCodeAt(cr)===ae);)cr++;if(cr<$t&&e.charCodeAt(cr)===He){var Fn=fr(e,cr);Fn&&!Fn.f&&(_r=!0,on=or,Rr=or,an=!0)}}if(!_r){var cn=Ne(e,$t);if(cn<d){for(var Jt=cn;Jt<d&&(e.charCodeAt(Jt)===ie||e.charCodeAt(Jt)===ae);)Jt++;if(Jt<d&&e.charCodeAt(Jt)===He){var ap=fr(e,Jt);ap&&(_r=!0,on=$t,Rr=cn,an=!0)}}}if(!_r&&r.inHTML){_r=!0,on=$t,Rr=Ne(e,$t);var op=e.slice(or,$t).trim();an=op.length===0}}var Dn=[],Dt="";if(K!==-1){Dt=V.slice(T.end-i,K);var Tn=Dt.trim();if(Tn){var{inline:cp,inHTML:lp,d:up}=r;r.inHTML=!0,r.d=D+1;var dp=z==="p";if(dp)r.inline=!0,Dn=ri(Tn,!1,r,n);else{var gl=Dt.indexOf(`
`)!==-1,vl=qo.test(Tn),co=Ru.test(Tn),fp=gl||vl||r.inHTML&&co,hp=Dt.length>=2&&Dt.charCodeAt(0)===de&&Dt.charCodeAt(Dt.length-1)===de&&!gl;hp&&!vl&&!co?Dn=[{type:ee.text,text:Tn}]:fp||co?(r.inline=!1,Dn=Yr(Dt,r,n)):(r.inline=!0,Dn=ri(Tn,!1,r,n))}r.inline=cp,r.inHTML=lp,r.d=up}}var bl=!1;if(c===6&&K!==-1&&!r.inHTML&&!st){var mp=/<[a-zA-Z][^>]*>/.test(Dt),pp=Dt.indexOf(`
`)!==-1||qo.test(Dt);mp&&!pp&&(bl=!0)}var yp=!J&&(r.inHTML||c===7||st||!an||bl);if(yp){var ui,lr,_l=!1;if(K!==-1&&_r){var Sl=!1;if(r.inHTML&&G<V.length){for(var Li=G;Li<V.length&&V.charCodeAt(Li)!==de;)Li++;var lo=V.slice(G,Li).trim();Sl=lo.length>1&&lo.charCodeAt(0)===He&&lo.charCodeAt(1)!==et}lr=Sl?V.slice(T.end-i):Dt,_l=!0}else(c===7||r.inHTML)&&K!==-1?(lr=V.slice(T.end-i),lr.charCodeAt(0)===de&&(lr=lr.slice(1))):_r?ui=e.slice(i,on):st?ui=x:(lr=V.slice(T.end-i),lr.charCodeAt(0)===de&&(lr=lr.slice(1)));var wl=ui!==void 0,uo=qt(ui===void 0?lr||"":ui),Cl={type:ee.htmlBlock,tag:F,attrs:dr(T.attrs,F,n),b:T.g+T.b,children:Dn,e:wl?void 0:uo,j:wl?uo:void 0,text:uo,c:!0,a:!1};return _l&&(Cl.x=!0),{node:Cl,end:Rr}}var El=qt(Dt);return{node:{type:ee.htmlBlock,tag:F,attrs:dr(T.attrs,F,n),b:T.g+T.b,children:Dn,e:J?void 0:El,text:El,c:!1,a:!1},end:Rr}}var Vi=x.match(/^<(\/?)([a-zA-Z][a-zA-Z0-9-]*)/),gp=Vi?Vi[2]:"div",fo=Vi?Vi[1]==="/":!1,ho,Al,xl,zi="";if(fo){var mo=x.indexOf(">");mo===-1?ho=x:(ho=x.slice(0,mo+1),zi=x.slice(mo+1),zi&&(Al=qt(zi)))}else xl=qt(x);return{node:{type:ee.htmlBlock,tag:gp,attrs:{},children:[],e:Al,h:ho,j:xl,text:fo?zi:x,c:!0,a:fo},end:I}}var St=fr(e,i);if(!St)return null;var $r=St.tag,po=$r.toLowerCase(),Pl=$r.charCodeAt(0),yo=Pl>=ve&&Pl<=be;if(!(yo||Ma.has(po)||Mi.has(po)||po.includes("-")))return null;if(St.f)return{node:{type:ee.htmlSelfClosing,tag:$r,attrs:{},h:e.slice(i,St.end),a:!0},end:St.end};var Mn=Nc(e,St.end,$r),di=[];if(Mn!==-1){var vp=qa,Bi=e.slice(St.end,vp),Hi=Bi.trim();if(Hi){var bp=Bi.indexOf(`
`)!==-1,_p=qo.test(Hi),Sp=Ru.test(Hi),wp=r.inline,Cp=r.inHTML,Ep=r.d;r.inHTML=!0,r.d=(r.d||0)+1,bp||_p||Sp?(r.inline=!1,di=Yr(Bi,r,n)):(r.inline=!0,di=ri(Hi,!1,r,n)),r.inline=wp,r.inHTML=Cp,r.d=Ep}var Ap=Ve(e,Mn),xp=e.slice(Mn,Ap).trim(),Ol=xp?Mn:Ne(e,Mn),jl=yo?e.slice(i,Mn):e.slice(i,Ol);return{node:{type:ee.htmlBlock,tag:$r,attrs:dr(St.attrs,$r,n),b:St.g+St.b,children:di,j:qt(jl),text:yo?Bi:jl,c:!0,a:!1},end:Ol}}var fi=Tu(e,St.end),Pp=fi<e.length?Ne(e,fi):fi,go=e.slice(St.end,fi);if(go.trim()){var{inline:Op,inHTML:jp,d:kp}=r;r.inline=!1,r.inHTML=!0,r.d=(r.d||0)+1,di=Yr(go,r,n),r.inline=Op,r.inHTML=jp,r.d=kp}var Np=e.slice(St.end,fi);return{node:{type:ee.htmlBlock,tag:$r,attrs:dr(St.attrs,$r,n),b:St.g+St.b,children:di,e:qt(Np),text:go,c:!0,a:!1},end:Pp}}function Eb(e,t){if(e.charCodeAt(t)!==He)return 0;var r=t+1,n=e.length;if(e.charCodeAt(r)===It&&e.charCodeAt(r+1)===we&&e.charCodeAt(r+2)===we)return 2;if(e.charCodeAt(r)===li)return 3;if(e.charCodeAt(r)===It){var s=e.charCodeAt(r+1);if(s>=ve&&s<=be)return 4;if(e.slice(r+1,r+8)==="[CDATA[")return 5}for(var i=e.charCodeAt(r)===et,a=i?r+1:r,o=a;o<n;){var c=e.charCodeAt(o);if(c>=ve&&c<=be||c>=ze&&c<=Xe||c>=Ae&&c<=xe||c===we)o++;else break}if(o===a)return 0;var l=e.slice(a,o);if(Mi.has(l.toLowerCase())){if(i)return 0;var u=e.charCodeAt(o);return u===ie||u===ae||u===Pe||u===de||o>=n?1:0}if(Ma.has(l.toLowerCase())){if(i){for(var m=o;m<n&&(e.charCodeAt(m)===ie||e.charCodeAt(m)===ae);)m++;return m<n&&e.charCodeAt(m)===Pe?6:0}var _=o<n?e.charCodeAt(o):-1;return _===ie||_===ae||_===Pe||_===de||_===et||_===-1?6:0}if(i){for(var v=o;v<n&&(e.charCodeAt(v)===ie||e.charCodeAt(v)===ae);)v++;if(v<n&&e.charCodeAt(v)===Pe){var S=Ve(e,t),E=e.slice(v+1,S).trim();if(E==="")return 7}}else{var g=Ve(e,t),y=fr(e,t);if(y&&y.end<=g){var f=e.slice(y.end,g).trim();if(f==="")return 7}}return 0}function Bu(e,t,r){for(var n=0,s=e.length;n<s&&(e.charCodeAt(n)===ie||e.charCodeAt(n)===ae);)n++;for(;s>n&&(e.charCodeAt(s-1)===ie||e.charCodeAt(s-1)===ae);)s--;n<s&&e.charCodeAt(n)===ht&&n++,s>n&&e.charCodeAt(s-1)===ht&&(s-2<n||e.charCodeAt(s-2)!==mt)&&s--;for(var i=[],a=n,o=!1,c=[],l=n;l<s;){var u=e.charCodeAt(l);if(u===mt&&l+1<s){e.charCodeAt(l+1)===ht?(o||(o=!0,c=[]),c.push(e.slice(a,l)),c.push("|"),l+=2,a=l):l+=2;continue}if(u===Le){for(var m=0;l<s&&e.charCodeAt(l)===Le;)m++,l++;for(var _=!1;l<s&&!_;){for(var v=0;l<s&&e.charCodeAt(l)===Le;)v++,l++;v===m?_=!0:v===0&&l++}continue}if(u===ht){var S=o?(c.push(e.slice(a,l)),c.join("")):e.slice(a,l);i.push(S.trim()),l++,a=l,o=!1,c=[];continue}l++}var E=o?(c.push(e.slice(a,s)),c.join("")):e.slice(a,s);return i.push(E.trim()),i.map(g=>{var y=g.indexOf("\\|")===-1?g:g.replace(/\\\|/g,"|");return y?ri(y,!1,t,r):[]})}function Hu(e,t,r,n){let s=Ve(e,t);var i=e.indexOf("|",t);if(i<0||i>=s)return null;let a=Ne(e,s);if(a>=e.length)return null;let o=Ve(e,a);if(!Dm(e,a,o))return null;let c=e.slice(t,s),l=e.slice(a,o);for(var u=[],m=0,_=l.length;m<_&&(l.charCodeAt(m)===ie||l.charCodeAt(m)===ae);)m++;for(m<_&&l.charCodeAt(m)===ht&&m++;m<_;){for(;m<_&&(l.charCodeAt(m)===ie||l.charCodeAt(m)===ae);)m++;if(m>=_||l.charCodeAt(m)===ht)break;var v=l.charCodeAt(m)===Ct;for(v&&m++;m<_&&l.charCodeAt(m)===we;)m++;var S=m<_&&l.charCodeAt(m)===Ct;for(S&&m++,u.push(v&&S?"center":S?"right":v?"left":null);m<_&&(l.charCodeAt(m)===ie||l.charCodeAt(m)===ae);)m++;m<_&&l.charCodeAt(m)===ht&&m++}let E=Bu(c,r,n);if(u.length!==E.length)return null;let g=[],y=Ne(e,o);for(;y<e.length;){let O=Ve(e,y),k=e.slice(y,O);if(kt(e,y,O))break;if(ot(e,y,O),qe<4){var f=e.charCodeAt(y+De);if(f===Pe||f===Wt||(f===we||f===it||f===Qe)&&Jr(e,y))break;if(f===Le||f===ut){for(var C=y+De,P=0;C<O&&e.charCodeAt(C)===f;)P++,C++;if(P>=3)break}}g.push(Bu(k,r,n)),y=Ne(e,O)}if(n.optimizeForStreaming&&g.length===0)return null;for(var h=E.length,b=0;b<g.length;b++)if(g[b].length<h)for(;g[b].length<h;)g[b].push([]);else g[b].length>h&&(g[b].length=h);return{node:{type:ee.table,header:E,cells:g,align:u},end:y}}function Ab(e,t,r){var n=Ve(e,t);if(ot(e,t,n),qe>3)return null;var s=t+De;if(e.charCodeAt(s)!==tt)return null;if(s+1<e.length&&e.charCodeAt(s+1)===Nr){var i=xb(e,s,r);return i||null}r.refs||(r.refs={});var a=Tm(e,s,r.refs);return a===null?null:{node:{type:ee.refCollection},end:a}}function xb(e,t,r){var n=e.length;if(e.charCodeAt(t)!==tt||t+1>=n||e.charCodeAt(t+1)!==Nr)return null;for(var s=t+2,i=s;s<n&&e.charCodeAt(s)!==ir;){if(e.charCodeAt(s)===de)return null;s++}if(s>=n)return null;var a=`^${e.slice(i,s)}`.toLowerCase();if(s++,s>=n||e.charCodeAt(s)!==Ct)return null;for(s++;s<n&&(e.charCodeAt(s)===ie||e.charCodeAt(s)===ae);)s++;if(s<n&&e.charCodeAt(s)===de)for(s++;s<n&&(e.charCodeAt(s)===ie||e.charCodeAt(s)===ae);)s++;var o=e.indexOf(`
`,s);o<0&&(o=n);for(var c=e.slice(s,o).trim(),l=o<n?o+1:n;l<n;){var u=Ve(e,l);if(ot(e,l,u),qe>=2&&!kt(e,l,u))c+=`
${e.slice(l,u)}`,l=Ne(e,u);else if(kt(e,l,u)){var m=Ne(e,u);if(m<n){var _=Ve(e,m);if(ot(e,m,_),qe>=2){c+=`
`,l=Ne(e,u);continue}}break}else break}var v=r.refs;return v&&!v[a]&&(v[a]={target:c,title:void 0}),{node:{type:ee.footnote},end:l}}function Pb(e,t,r,n){let s=t,i=0,a=0,o=-1;for(;s<e.length;){let U=o>=0?o:Ve(e,s);if(o=-1,kt(e,s,U))break;if(ot(e,s,U),qe<4&&a>0&&!r.l){let W=e.charCodeAt(s+De);if(W===Bt||W===we){let Y=s+De;for(;Y<U&&e.charCodeAt(Y)===W;)Y++;for(;Y<U&&(e.charCodeAt(Y)===ie||e.charCodeAt(Y)===ae);)Y++;if(Y>=U){i=W===Bt?1:2,s=Ne(e,U);break}}}a=U;let B=Ne(e,U);if(B<e.length){if(e.charCodeAt(B)===Ac){var c=Ve(e,B);s=Ne(e,c),a=c;continue}let W=Ve(e,B);if(o=W,ot(e,B,W),qe<4){let Y=e.charCodeAt(B+De);if(Y===Pe){s=B;break}if(Y===Wt){for(var l=B+De,u=0;l<W&&e.charCodeAt(l)===Wt&&u<=6;)u++,l++;if(u>=1&&u<=6&&(l>=W||e.charCodeAt(l)===ie||e.charCodeAt(l)===ae)){s=B;break}}if(Y===Le||Y===ut){for(var m=B+De,_=0;m<W&&e.charCodeAt(m)===Y;)_++,m++;if(_>=3){s=B;break}}if(Y===He){var v=B+De+1,S=v<W?e.charCodeAt(v):0,E=S===It||S===li;if(!E&&S===et){for(var g=v+1,y=g;y<W&&(e.charCodeAt(y)>=ve&&e.charCodeAt(y)<=be||e.charCodeAt(y)>=ze&&e.charCodeAt(y)<=Xe||e.charCodeAt(y)>=Ae&&e.charCodeAt(y)<=xe||e.charCodeAt(y)===we);)y++;y>g&&(E=Ma.has(e.slice(g,y).toLowerCase()))}else if(!E){for(var f=v;f<W&&(e.charCodeAt(f)>=ve&&e.charCodeAt(f)<=be||e.charCodeAt(f)>=ze&&e.charCodeAt(f)<=Xe||e.charCodeAt(f)>=Ae&&e.charCodeAt(f)<=xe||e.charCodeAt(f)===we);)f++;if(f>v){var C=e.slice(v,f).toLowerCase();E=Ma.has(C)||Mi.has(C)}}if(E&&qm(e,B,r,n)){s=B;break}}if(Y===we||Y===it||Y===Qr){let Q=B+De+1;if(Q<W&&(e.charCodeAt(Q)===ie||e.charCodeAt(Q)===ae)){var P=Ri(e,Q,W);if(P<W&&!Jr(e,B)){s=B;break}}}if(Y>=Ae&&Y<=xe){let Q=B+De;for(;Q<W&&e.charCodeAt(Q)>=Ae&&e.charCodeAt(Q)<=xe;)Q++;if(Q<W&&(e.charCodeAt(Q)===Ht||e.charCodeAt(Q)===tr)&&Q-(B+De)===1&&e.charCodeAt(B+De)===49){var h=Q+1;if(h<W&&(e.charCodeAt(h)===ie||e.charCodeAt(h)===ae)){var b=Ri(e,h,W);if(b<W){s=B;break}}}}if(Y===ht){let Q=Ne(e,W);if(Q<e.length){let Z=Ve(e,Q);if(Dm(e,Q,Z)){s=B;break}}}if((Y===we||Y===it||Y===Qe)&&Jr(e,B)){if(Y!==we){s=B;break}let Q=B+De;for(;Q<W&&e.charCodeAt(Q)===we;)Q++;for(;Q<W&&(e.charCodeAt(Q)===ie||e.charCodeAt(Q)===ae);)Q++;if(Q<W){s=B;break}}}}s=Ne(e,U)}for(var O=i?a:s;O>t&&(e.charCodeAt(O-1)===de||e.charCodeAt(O-1)===Zr||e.charCodeAt(O-1)===ie||e.charCodeAt(O-1)===ae);)O--;for(var k=t;k<O&&(e.charCodeAt(k)===ie||e.charCodeAt(k)===ae);)k++;if(k>=O)return null;for(var $=!1,M=k;M<O;M++)if(e.charCodeAt(M)===Ac){$=!0;break}var q=$?e.slice(k,O).replace(/\u001E/g,""):e.slice(k,O);if(!q)return null;let L=ri(q,!0,r,n);return i?{node:{type:ee.heading,level:i,children:L,id:""},end:s}:{node:{type:ee.paragraph,children:L},end:s}}function ri(e,t,r,n){var s=r.t;if(!s){var i=r.k;r.k=t;var a=pr(e,0,e.length,r,n);return r.k=i,a}var o=[];return s.push({dest:o,text:e,breaks:t,inline:r.inline,inAnchor:r.inAnchor,inHTML:r.inHTML,htmlDepth:r.d,inList:r.inList,inBlockQuote:r.inBlockQuote,noSetext:r.l,depth:r.o}),o}function Ob(e,t,r){if(e.charCodeAt(t)!==Le)return null;let n=en(e,t,r,96),s=t+n;for(;s<r;){let i=e.indexOf("`",s);if(i<0||i>=r)return null;let a=en(e,i,r,96);if(a===n){let o=e.slice(t+n,i);return o.indexOf(`
`)!==-1&&(o=o.replace(/\n/g," ")),o.length>0&&o[0]===" "&&o.at(-1)===" "&&o.trim().length>0&&(o=o.slice(1,-1)),{node:{type:ee.codeInline,text:o},end:i+a}}s=i+a}return null}function cl(e,t,r){if(e.charCodeAt(t)!==Le)return t;let n=en(e,t,r,96),s=t+n;for(;s<r;){let i=e.indexOf("`",s);if(i<0||i>=r)return t;let a=en(e,i,r,96);if(a===n)return i+a;s=i+a}return t}function jb(e,t,r){if(e.charCodeAt(t)!==He)return t;if(t+1<r&&e.charCodeAt(t+1)===et){let l=t+2;for(;l<r&&e.charCodeAt(l)!==Pe;)l++;return l<r?l+1:t}if(t+3<r&&e.charCodeAt(t+1)===It&&e.charCodeAt(t+2)===we&&e.charCodeAt(t+3)===we){let l=e.indexOf("-->",t+4);return l>=0?l+3:t}let n=t+1,s=n;for(;n<r;){let l=e.charCodeAt(n);if(l>=ve&&l<=be||l>=ze&&l<=Xe||l>=Ae&&l<=xe||l===we)n++;else break}if(n===s)return t;let i=e.slice(s,n).toLowerCase(),a=!1;for(;n<r;){let l=e.charCodeAt(n);if(l===Pe){n++;break}if(l===et&&n+1<r&&e.charCodeAt(n+1)===Pe){n+=2,a=!0;break}if(l===jn||l===On){var o=l;for(n++;n<r&&e.charCodeAt(n)!==o;)n++;n<r&&n++;continue}if(l===de)return t;n++}if(a||Ti(i))return n;let c=1;for(;n<r&&c>0;)if(e.charCodeAt(n)===He)if(n+1<r&&e.charCodeAt(n+1)===et){let l=n+2,u=l;for(;u<r&&(e.charCodeAt(u)>=ve&&e.charCodeAt(u)<=be||e.charCodeAt(u)>=ze&&e.charCodeAt(u)<=Xe);)u++;if(e.slice(l,u).toLowerCase()===i){for(;u<r&&e.charCodeAt(u)!==Pe;)u++;if(u<r&&u++,c--,c===0)return u}n=u}else{let l=n+1,u=l;for(;u<r&&(e.charCodeAt(u)>=ve&&e.charCodeAt(u)<=be||e.charCodeAt(u)>=ze&&e.charCodeAt(u)<=Xe);)u++;e.slice(l,u).toLowerCase()===i&&c++,n++}else n++;return n}function kb(e,t,r,n,s){if(e.charCodeAt(t)!==ut||t+1>=r||e.charCodeAt(t+1)!==ut)return null;let i=t+2;for(;i+1<r;){let a=e.charCodeAt(i);if(a===Le){let o=cl(e,i,r);if(o>i){i=o;continue}}if(a===ut&&e.charCodeAt(i+1)===ut){let o=e.slice(t+2,i),c=pr(o,0,o.length,n,s);return{node:{type:ee.textFormatted,tag:"del",children:c},end:i+2}}a===mt&&i+1<r&&i++,i++}return null}function Nb(e,t,r,n,s){if(e.charCodeAt(t)!==Bt||t+1>=r||e.charCodeAt(t+1)!==Bt)return null;let i=t+2;for(;i+1<r;){let a=e.charCodeAt(i);if(a===Le){let o=cl(e,i,r);if(o>i){i=o;continue}}if(a===Bt&&e.charCodeAt(i+1)===Bt&&i>t+2){let o=e.slice(t+2,i),c=pr(o,0,o.length,n,s);return{node:{type:ee.textFormatted,tag:"mark",children:c},end:i+2}}a===mt&&i+1<r&&i++,i++}return null}function Ku(e,t,r){return e<Za?!!(ol(e)&Xn):zv.test(t[r])}function Gu(e,t,r){return e<Za?!!(ol(e)&bn):Bv.test(t[r])}function Ib(e,t,r){var n=e.charCodeAt(t);if(n!==it&&n!==Qe)return null;var s=en(e,t,r,n);if(s===0)return null;var i=t>0?e.charCodeAt(t-1):32,a=t+s<r?e.charCodeAt(t+s):32,o=Gu(i,e,t-1),c=Gu(a,e,t+s),l=t>0?Ku(i,e,t-1):!1,u=t+s<r?Ku(a,e,t+s):!1,m=!c&&(!u||o||l),_=!o&&(!l||c||u),v,S;return n===it?(v=m,S=_):(v=m&&(!_||l),S=_&&(!m||u)),{len:s,canOpen:v,canClose:S}}function Rb(e,t,r,n){if(t.length!==0){for(var s=e.length,i=Array(s),a=null,o=null,c=0;c<s;c++){var l={node:e[c],prev:o,next:null};o?o.next=l:a=l,i[c]=l,o=l}for(var u=Array(t.length),m=0;m<t.length;m++)u[m]=i[t[m].idx];for(var _=[],v=0;v<12;v++)_[v]=-1;for(var S=0;S<t.length;){var E=t[S];if(!(E.active&&E.canClose)){S++;continue}for(var g=E.ch===it?0:1,y=g*6+E.len%3*2+(E.canOpen?1:0),f=_[y]===void 0?-1:_[y],C=-1,P=S-1;P>f;P--){var h=t[P];if(!(!h.active||h.ch!==E.ch||!h.canOpen)&&!((E.canOpen||h.canClose)&&(h.len+E.len)%3===0&&h.len%3!==0)){C=P;break}}if(C<0){_[y]=S-1,!E.canOpen&&(E.active=!1),S++;continue}var b=t[C],O=b.len>=2&&E.len>=2,k=O?2:1;b.len-=k,E.len-=k;var $=u[C],M=u[S],q=$.node,L=M.node;q.text=q.text.slice(0,q.text.length-k),L.text=L.text.slice(k);for(var U=[],B=$.next;B&&B!==M;)U.push(B.node),B=B.next;var W={type:ee.textFormatted,tag:O?"strong":"em",children:U},Y={node:W,prev:$,next:M};$.next=Y,M.prev=Y;for(var Q=C+1;Q<S;Q++)t[Q].active=!1;if(b.len===0&&(b.active=!1,q.text==="")){var Z=$.prev;Y.prev=Z,Z?Z.next=Y:a=Y}if(E.len===0){if(E.active=!1,L.text===""){var re=M.next;Y.next=re,re&&(re.prev=Y)}}else continue;S++}for(var A=0,w=a;w;){var j=w.node;if(j.type===ee.text){var p=j;if(p.text===""){w=w.next;continue}if(A>0&&e[A-1].type===ee.text){e[A-1].text+=p.text,w=w.next;continue}}e[A++]=j,w=w.next}e.length=A}}function Wi(e,t,r,n){return t(e,r,n)===null?null:e}var Wu=0,Ic=0,Ju=0,Rc=0,Yu=0,$c=0,Uo=0,Vt=0;function $b(){return Uo===2147483647&&(Ic=0,Rc=0,$c=0,Oa=0,Uo=0),++Uo}var Lo=null,Oa=0,Ji=[],Vo=256;function Xu(e,t,r,n,s){let i=e.charCodeAt(t)===It,a=i?t+1:t;if(e.charCodeAt(a)!==tt||Rc===Vt&&a>=Ju)return null;var o=Oa===Vt?Lo:null,c=o===null?0:o[a];if(c<0)return null;var l=c;if(c===0){var u=e.indexOf("]",a+1);if(u<0||u>=r)return Ju=a,Rc=Vt,null;l=a+1;var m=0;Ji[m++]=a;for(var _=r-a>=Vo;l<r&&m>0;){var v=e.charCodeAt(l);if(v===mt&&l+1<r){l+=2;continue}if(v===Le){var S=cl(e,l,r);if(S>l){l=S;continue}}if(v===He){var E=Um(e,l,r);if(E){l=E.end;continue}var g=jb(e,l,r);if(g>l){l=g;continue}}if(v===tt)Ji[m++]=l;else if(v===ir){var y=Ji[--m];o===null&&_&&l-a>=Vo&&(o=Lo=new Int32Array(r),Oa=Vt),o!==null&&(o[y]=l+1)}l++}if(m>0){if(o===null&&_&&l-a>=Vo&&(o=Lo=new Int32Array(r),Oa=Vt),o!==null)for(;m>0;)o[Ji[--m]]=-1;return null}}var f=l-1,C=e.slice(a+1,f),P=l<r?e.charCodeAt(l):0,h=!1;if(P===er){var b=!0;for(l++;l<r&&(e.charCodeAt(l)===ie||e.charCodeAt(l)===de);)l++;var O="",k=l;if(l<r&&e.charCodeAt(l)===He){for(l++,k=l;k<r&&e.charCodeAt(k)!==Pe;){if(e.charCodeAt(k)===mt&&k+1<r){k+=2;continue}if(e.charCodeAt(k)===de){b=!1;break}k++}b&&(k>=r||e.charCodeAt(k)!==Pe)&&(b=!1),b&&(O=e.slice(l,k),k++)}else if(b){var $=Ic===Vt?Wu:-1;if($>=0&&l>=$)b=!1;else{for(var M=0,q=!1;k<r;){var L=e.charCodeAt(k);if(L===mt&&k+1<r){k+=2;continue}if(L===er)M++;else if(L===tr){if(q=!0,M===0)break;M--}else if(L===ie||L===de)break;k++}k>=r&&!q&&($<0||l<$)&&(Wu=l,Ic=Vt),O=e.slice(l,k)}}if(b){for(l=k;l<r&&(e.charCodeAt(l)===ie||e.charCodeAt(l)===de);)l++;var U;if(l<r){var B=e.charCodeAt(l);if(B===jn||B===On||B===er){var W=B===er?41:B;l++;for(var Y=l;l<r&&e.charCodeAt(l)!==W;)e.charCodeAt(l)===mt&&l+1<r&&l++,l++;l>=r?b=!1:(U=e.slice(Y,l),l++)}}if(b){for(;l<r&&(e.charCodeAt(l)===ie||e.charCodeAt(l)===de);)l++;(l>=r||e.charCodeAt(l)!==tr)&&(b=!1)}}if(b){if(l++,O=Wr(ti(O)),U!==void 0&&(U=Wr(ti(U))),i){var Q=pr(C,0,C.length,n,s),Z=Ua(Q);return{node:{type:ee.image,target:Wi(O,s?.sanitizer||Pr,"img","src"),alt:Z,title:U},end:l}}var re=n.inAnchor;n.inAnchor=!0;var T=re?[{type:ee.text,text:C}]:pr(C,0,C.length,n,s);return n.inAnchor=re,!n.inAnchor&&Fc(T)?null:{node:{type:ee.link,target:Wi(O,s?.sanitizer||Pr,"a","href"),title:U,children:T},end:l}}l=f+1,h=!0}var A="",w=l;if(!h&&P===tt){var j=l+1;w=j;for(var p=!1;w<r&&e.charCodeAt(w)!==ir;){if(e.charCodeAt(w)===mt&&w+1<r){w+=2;continue}if(e.charCodeAt(w)===tt){p=!0;break}w++}if(p||w>=r)return null;var d=e.slice(j,w);if(d.trim())A=xa(d);else{if(Du(C))return null;A=xa(C)}w+=1}else{if(Du(C))return null;A=xa(C)}var x=n.refs?.[A];if(!x)return null;if(i)return{node:{type:ee.image,target:Wi(x.target,s?.sanitizer||Pr,"img","src"),alt:Ua(pr(C,0,C.length,n,s)),title:x.title},end:w};var I=n.inAnchor;n.inAnchor=!0;var T=I?[{type:ee.text,text:C}]:pr(C,0,C.length,n,s);return n.inAnchor=I,!n.inAnchor&&Fc(T)?null:{node:{type:ee.link,target:Wi(x.target,s?.sanitizer||Pr,"a","href"),title:x.title,children:T},end:w}}function Um(e,t,r){if(e.charCodeAt(t)!==He)return null;for(var n=t+1;n<r;){var s=e.charCodeAt(n);if(s===Pe)break;if(s===ie||s===de||s===Zr||s===He)return null;n++}if(n>=r||e.charCodeAt(n)!==Pe)return null;var i=e.slice(t+1,n),a=i.match(/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^\x00-\x20]*)$/);return a?{node:{type:ee.link,target:i,title:void 0,children:[{type:ee.text,text:i}]},end:n+1}:i.indexOf("@")!==-1&&/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(i)?{node:{type:ee.link,target:`mailto:${i}`,title:void 0,children:[{type:ee.text,text:i}]},end:n+1}:null}function Fb(e,t,r,n){if(e.charCodeAt(t)!==tt||t+1>=r||e.charCodeAt(t+1)!==Nr||$c===Vt&&t>=Yu)return null;let s=t+2;for(;s<r&&e.charCodeAt(s)!==ir&&e.charCodeAt(s)!==de;)s++;if(s>=r)return Yu=t,$c=Vt,null;if(e.charCodeAt(s)!==ir)return null;let i=e.slice(t+2,s);return i?{node:{type:ee.footnoteReference,target:`#${Nn(i)}`,text:i},end:s+1}:null}function Db(e,t,r,n){if(n.disableBareUrls)return null;var s="",i=!1,a=e.charCodeAt(t);if(a===Fa||a===72?t+8<=r&&e.charCodeAt(t+1)===ei&&e.charCodeAt(t+2)===ei&&e.charCodeAt(t+3)===Ec&&(e.charCodeAt(t+4)===jm&&e.charCodeAt(t+5)===Ct&&e.charCodeAt(t+6)===et&&e.charCodeAt(t+7)===et?s="https://":e.charCodeAt(t+4)===Ct&&e.charCodeAt(t+5)===et&&e.charCodeAt(t+6)===et&&(s="http://")):a===Pn||a===70?t+6<=r&&e.charCodeAt(t+1)===ei&&e.charCodeAt(t+2)===Ec&&e.charCodeAt(t+3)===Ct&&e.charCodeAt(t+4)===et&&e.charCodeAt(t+5)===et&&(s="ftp://"):(a===En||a===87)&&t+4<=r&&e.charCodeAt(t+1)===En&&e.charCodeAt(t+2)===En&&e.charCodeAt(t+3)===Ht&&(s="www.",i=!0),!s)return null;let o=t+s.length;for(;o<r;){let b=e.charCodeAt(o);if(b===ie||b===de||b===ae||b===Zr||b===He||b===Pe)break;o++}for(var c=0,l=0,u=t;u<o;u++){var m=e.charCodeAt(u);m===er?c++:m===tr&&l++}let _=o;for(;_>t+s.length;){let b=e.charCodeAt(_-1);if(b===Ht||b===kv||b===Ct||b===It||b===li||b===tr||b===it||b===Qe||b===ut){if(b===tr){if(c>=l)break;l--}_--}else if(b===Da){for(var v=_-2;v>t&&(e.charCodeAt(v)>=ve&&e.charCodeAt(v)<=be||e.charCodeAt(v)>=ze&&e.charCodeAt(v)<=Xe||e.charCodeAt(v)>=Ae&&e.charCodeAt(v)<=xe);)v--;v>=t&&e.charCodeAt(v)===Xa?_=v:_--}else break}if(_<=t+s.length)return null;var S=t+(i?4:s.length),E=e.indexOf("/",S);if((E<0||E>_)&&(E=_),i&&e.indexOf(".",S)===-1)return null;for(var g=-1,y=-1,f=E-1;f>=S;f--)if(e.charCodeAt(f)===Ht)if(g<0)g=f;else{y=f;break}for(var C=y>=0?y+1:S,f=C;f<E;f++)if(e.charCodeAt(f)===Qe)return null;var P=e.slice(t,_),h=i?`http://${P}`:P;return{node:{type:ee.link,target:h,title:void 0,children:[{type:ee.text,text:P}]},end:_}}function Tb(e,t,r,n){if(n.disableBareUrls)return null;for(var s=t,i=s;s<r;){var a=e.charCodeAt(s);if(a>=ve&&a<=be||a>=ze&&a<=Xe||a>=Ae&&a<=xe||a===Ht||a===It||a===Wt||a===36||a===wc||a===Xa||a===On||a===it||a===Qr||a===et||a===Bt||a===li||a===Nr||a===Qe||a===Le||a===kn||a===ht||a===sl||a===ut||a===we)s++;else break}if(s===i||s>=r||e.charCodeAt(s)!==Om)return null;s++;for(var o=s,c=-1,l=s;s<r;){var a=e.charCodeAt(s);if(a>=ve&&a<=be||a>=ze&&a<=Xe||a>=Ae&&a<=xe)s++;else if((a===we||a===Qe)&&s>o)s++;else if(a===Ht){if(s===o)break;var u=e.charCodeAt(s-1);if(u===we||u===Qe||s-l>63)break;if(s+1<r){var m=e.charCodeAt(s+1);if(m>=ve&&m<=be||m>=ze&&m<=Xe||m>=Ae&&m<=xe)c=s,l=s+1,s++;else break}else break}else break}if(s-l>63||c<0)return null;var _=e.charCodeAt(s-1);if(!(_>=ve&&_<=be||_>=ze&&_<=Xe||_>=Ae&&_<=xe)||s<=c+1)return null;for(var v=-1,S=c-1;S>=o;S--)if(e.charCodeAt(S)===Ht){v=S;break}for(var E=v>=0?v+1:o,S=E;S<s;S++)if(e.charCodeAt(S)===Qe)return null;var g=e.slice(t,s);return{node:{type:ee.link,target:`mailto:${g}`,title:void 0,children:[{type:ee.text,text:g}]},end:s}}function Fc(e){for(var t=0;t<e.length;t++)if(e[t].type===ee.link||"children"in e[t]&&Array.isArray(e[t].children)&&Fc(e[t].children))return!0;return!1}function Ua(e,t){for(var r="",n=0;n<e.length;n++){var s=e[n];s.type===ee.text?r+=s.text:s.type===ee.breakLine?r+=" ":s.type===ee.codeInline||s.type===ee.footnoteReference?r+=s.text:"children"in s&&Array.isArray(s.children)?r+=Ua(s.children,t):!t&&s.type===ee.image&&(r+=s.alt||"")}return r}function Dc(e,t,r){for(var n=0;n<e.length;n++){var s=e[n];if(s.type===ee.heading){var i=s;i.id=gb(r(Ua(i.children,!0)),t)}if("children"in s){var a=s.children;Array.isArray(a)&&Dc(a,t,r)}if((s.type===ee.orderedList||s.type===ee.unorderedList)&&Array.isArray(s.items))for(var o=s.items,c=0;c<o.length;c++)Dc(o[c],t,r)}}function fn(e){return{type:ee.text,text:e}}function Mb(e,t,r){var n=t+1;if(n>=r)return-1;if(e.charCodeAt(n)===Wt){n++;var s=n<r&&(e.charCodeAt(n)===km||e.charCodeAt(n)===Nm);s&&n++;for(var i=n,a=s?6:7;n<r&&n-i<=a;){var o=e.charCodeAt(n),c=o>=Ae&&o<=xe||s&&(o>=ve&&o<=Cc||o>=ze&&o<=Pn);if(!c)break;n++}return n===i||n-i>a?-1:n<r&&e.charCodeAt(n)===Da?n+1:-1}for(var l=n;n<r&&n-l<48;){var u=e.charCodeAt(n);if(u>=ve&&u<=be||u>=ze&&u<=Xe||u>=Ae&&u<=xe){n++;continue}break}return n===l?-1:n<r&&e.charCodeAt(n)===Da?n+1:-1}function qb(e,t,r,n,s){if(e.charCodeAt(t)!==He)return null;var i=t+1;if(i>=r)return null;var a=e.charCodeAt(i);if(a===It&&i+1<r&&e.charCodeAt(i+1)===we&&i+2<r&&e.charCodeAt(i+2)===we){var o=i+3;if(o<r&&e.charCodeAt(o)===Pe)return{node:{type:ee.htmlComment,text:"",s:!0},end:o+1};if(o+1<r&&e.charCodeAt(o)===we&&e.charCodeAt(o+1)===Pe)return{node:{type:ee.htmlComment,text:"-",s:!0},end:o+2};var c=e.indexOf("-->",o);return c!==-1&&c<=r-3?{node:{type:ee.htmlComment,text:e.slice(t+4,c),s:!1},end:c+3}:null}if(a===li){var l=e.indexOf("?>",i+1);return l!==-1&&l<r?{node:{type:ee.htmlSelfClosing,tag:"?",attrs:{},m:e.slice(t,l+2),a:!1},end:l+2}:null}if(a===It&&i+1<r){var u=e.charCodeAt(i+1);if(u===tt&&e.slice(i+1,i+8)==="[CDATA["){var m=e.indexOf("]]>",i+8);return m!==-1&&m<r?{node:{type:ee.htmlSelfClosing,tag:"![CDATA[",attrs:{},m:e.slice(t,m+3),a:!1},end:m+3}:null}if(u>=ve&&u<=be){var _=e.indexOf(">",i+2);return _!==-1&&_<r?{node:{type:ee.htmlSelfClosing,tag:`!${e.slice(i+1,_)}`,attrs:{},m:e.slice(t,_+1),a:!1},end:_+1}:null}}if(a===et){var v=i+1;if(v>=r)return null;var S=e.charCodeAt(v);if(!(S>=ve&&S<=be||S>=ze&&S<=Xe))return null;for(v++;v<r;){var E=e.charCodeAt(v);if(E>=ve&&E<=be||E>=ze&&E<=Xe||E>=Ae&&E<=xe||E===we)v++;else break}for(;v<r&&(e.charCodeAt(v)===ie||e.charCodeAt(v)===ae||e.charCodeAt(v)===de);)v++;if(v<r&&e.charCodeAt(v)===Pe){var g=e.slice(i+1,v).trim();return{node:{type:ee.htmlSelfClosing,tag:g,attrs:{},h:e.slice(t,v+1),a:!0},end:v+1}}return null}if(!(a>=ve&&a<=be||a>=ze&&a<=Xe))return null;var y=fr(e,t);if(!y)return null;var f=y.tag,C=f.toLowerCase(),P=y.n;if(P||Ti(f))return{node:{type:ee.htmlSelfClosing,tag:f,attrs:dr(y.attrs,f,s),m:y.q?Oc(y):e.slice(t,y.end),a:!1},end:y.end};var h=Mi.has(C),b=Nc(e.slice(0,r),y.end,f);if(b===-1)return{node:{type:ee.htmlSelfClosing,tag:f,attrs:dr(y.attrs,f,s),m:y.q?Oc(y):e.slice(t,y.end),a:!1},end:y.end};var O=Cb(e,`</${C}`,b),k=e.slice(y.end,O);if(h){var $=qt(k);return{node:{type:ee.htmlBlock,tag:f,attrs:dr(y.attrs,f,s),b:y.g+y.b,children:[],e:$||void 0,h:e.slice(O,b),text:$,c:!0,a:!1},end:b}}var M=[],q=k.trim();if(q){var{inAnchor:L,inline:U,k:B}=n;C==="a"&&(n.inAnchor=!0),n.k=!1;var W=q.indexOf(`
`)!==-1||/^#{1,6}\s/.test(q);W?(n.inline=!1,M=Yr(q,n,s)):M=pr(q,0,q.length,n,s),n.inAnchor=L,n.inline=U,n.k=B}return{node:{type:ee.htmlBlock,tag:f,attrs:dr(y.attrs,f,s),b:y.b,children:M,text:qt(k),c:!1,a:!1},end:b}}var Ub=200,Oi=0;function pr(e,t,r,n,s){if(Oi++,Oi>Ub)return Oi--,[{type:ee.text,text:e.slice(t,r)}];var i=Vt;Vt=$b();let a=n;if(s.optimizeForStreaming){let ye=function(rt,pt){for(var At=1,Rt=pt+1;Rt<rt.length;Rt++){var _t=rt.charCodeAt(Rt);if(_t===tt)At++;else if(_t===ir&&(At--,At===0))return Rt}return-1},oe=e.slice(t,r),ft=oe;for(var o=0,c=0,l=0,u=0,m=0,_=-1,v=-1,S=-1,E=-1,g=-1,y=0;y<oe.length;y++){var f=oe.charCodeAt(y);f===it?y+1<oe.length&&oe.charCodeAt(y+1)===it?(o++,_=y,y++):(c++,v=y):f===Qe?y+1<oe.length&&oe.charCodeAt(y+1)===Qe?(l++,S=y,y++):(u++,E=y):f===ut&&y+1<oe.length&&oe.charCodeAt(y+1)===ut&&(m++,g=y,y++)}var C=[];m%2===1&&g>=0&&C.push([g,2]),l%2===1&&S>=0&&C.push([S,2]),u%2===1&&E>=0&&C.push([E,1]),o%2===1&&_>=0&&C.push([_,2]),c%2===1&&v>=0&&C.push([v,1]),C.sort((rt,pt)=>pt[0]-rt[0]);for(var P=0;P<C.length;P++){var h=C[P][0],b=C[P][1];oe=oe.slice(0,h)+oe.slice(h+b)}let ke=0,Et=-1;for(let rt=0;rt<oe.length;rt++)oe.charCodeAt(rt)===Le&&(ke++,Et=rt);if(ke%2===1&&Et!==-1){let rt=!1,pt=-1,At=0;for(;At<oe.length;)oe.charCodeAt(At)===Le&&(rt?(rt=!1,pt=-1):(pt=At,rt=!0)),At++;rt&&pt!==-1&&(oe=oe.slice(0,pt))}for(var O=!0;O;){O=!1;for(var k=-1,$=-1,M=-1,q=!1,L=0;L<oe.length;L++){var U=oe.charCodeAt(L);if(U===tt&&(L===0||oe.charCodeAt(L-1)!==mt)){var B=L>0&&oe.charCodeAt(L-1)===It,W=B?L-1:L,Y=ye(oe,L);if(Y===-1)k=W,q=B,$=L+1,M=oe.length;else{var Q=Y+1;if(Q>=oe.length)k=W,q=B,$=L+1,M=Y;else if(oe.charCodeAt(Q)===er){var Z=oe.indexOf(")",Q+1);Z===-1?(k=W,q=B,$=L+1,M=Y,L=oe.length):L=Z}else if(oe.charCodeAt(Q)===tt){var re=oe.indexOf("]",Q+1);re===-1?(k=W,q=B,$=L+1,M=Y,L=oe.length):L=re}else L=Y}}}if(k>=0){var A=q?"":oe.slice($,M);oe=oe.slice(0,k)+A,O=!0}}let Ke=oe.match(/<([A-Z][A-Za-z0-9]*)(?:\s[^>]*)?>([^<]*)$/);if(Ke&&Ke.index!==void 0){var w=Ke[0].length-Ke[2].length,j=w>=2&&Ke[0].charCodeAt(w-2)===et;if(!j){for(var p=!1,d=0,x=0;x<Ke.index;x++)oe.charCodeAt(x)===Le&&d++;if(p=d%2===1,!p){let rt=Ke[1];zr(oe,`</${rt}`,0)===-1&&(oe=oe.slice(0,Ke.index)+Ke[2])}}}oe!==ft&&(e=e.slice(0,t)+oe,r=t+oe.length)}let I=[];var T=[];let F=t;var z="",H=s.disableAutoLink||s.disableBareUrls||a.inAnchor?-1:e.indexOf("@",t);for(H>=r&&(H=-1);t<r;){let ye=e.charCodeAt(t),oe=null;if(ye===Le){if(oe=Ob(e,t,r),!oe){var R=en(e,t,r,Le);t+=R-1}}else if(ye===it||ye===Qe){var D=Ib(e,t,r);if(D){if(D.canOpen||D.canClose){(z||t>F)&&(I.push(fn(z+e.slice(F,t))),z="");var V=e.slice(t,t+D.len),K=fn(V);T.push({idx:I.length,ch:ye,len:D.len,canOpen:D.canOpen,canClose:D.canClose,active:!0}),I.push(K),t+=D.len,F=t;continue}t+=D.len-1}}else if(ye===ut)oe=kb(e,t,r,a,s);else if(ye===Bt)oe=Nb(e,t,r,a,s);else if(ye===tt)t+1<r&&e.charCodeAt(t+1)===Nr&&(oe=Fb(e,t,r)),oe||(oe=Xu(e,t,r,a,s));else if(ye===It&&t+1<r&&e.charCodeAt(t+1)===tt)oe=Xu(e,t,r,a,s);else if(ye===He)oe=Um(e,t,r),!(oe||s.disableParsingRawHTML||s.ignoreHTMLBlocks)&&(oe=qb(e,t,r,a,s));else if(ye===Xa){var G=Mb(e,t,r);if(G!==-1){var J=e.slice(t,G),te=Wr(J);if(te!==J){z=z+e.slice(F,t)+te,t=G,F=G;continue}}}else if((ye===Fa||ye===En||ye===Pn)&&!a.inAnchor&&!s.disableAutoLink&&(t===0||e.charCodeAt(t-1)!==He)){var ne=t+1<r?e.charCodeAt(t+1):0;(ye===Fa&&ne===ei||ye===Pn&&ne===ei||ye===En&&ne===En)&&(oe=Db(e,t,r,s))}if(!oe&&H>=0&&H-t<=64&&!a.inAnchor&&!s.disableAutoLink&&!s.disableBareUrls&&(ye>=ve&&ye<=be||ye>=ze&&ye<=Xe||ye>=Ae&&ye<=xe)&&(oe=Tb(e,t,r,s),!oe&&t>=H&&(H=e.indexOf("@",t+1),H>=r&&(H=-1))),ye===de&&a.k){var se=!1,ce=0;if(t>F&&e.charCodeAt(t-1)===mt)se=!0,ce=1;else{for(var he=0,le=t-1;le>=F&&e.charCodeAt(le)===ie;)he++,le--;he>=2&&(se=!0,ce=he)}if(se){for((z||t-ce>F)&&(I.push(fn(z+e.slice(F,t-ce))),z=""),I.push({type:ee.breakLine}),t++;t<r&&e.charCodeAt(t)===ie;)t++;F=t;continue}var ge=t>F&&e.charCodeAt(t-1)===ie,Fe=t+1<r&&e.charCodeAt(t+1)===ie;if(ge||Fe){for(var fe=t;fe>F&&e.charCodeAt(fe-1)===ie;)fe--;for(z+=`${e.slice(F,fe)}
`,t++;t<r&&e.charCodeAt(t)===ie;)t++;F=t;continue}}if(oe)(z||t>F)&&(I.push(fn(z+e.slice(F,t))),z=""),I.push(oe.node),t=oe.end,F=t;else{if(ye===mt&&t+1<r){let ft=e.charCodeAt(t+1);if(ol(ft)&Xn){(z||t>F)&&(I.push(fn(z+e.slice(F,t))),z=""),I.push(fn(e[t+1])),t+=2,F=t;continue}}if(t++,H<0||H-t>64)for(;t<r&&!(H>=0&&H-t<=64);){var Ye=e.charCodeAt(t);if(Ye<Za&&!Fm[Ye])t++;else break}}}return(z||r>F)&&(I.push(fn(z+e.slice(F,r))),z=""),T.length>0&&Rb(I,T),Vt=i,Oi--,I}var Lb=500;function Yr(e,t,r){var n=t.o||0;if(n>Lb)return[{type:ee.text,text:e}];if(t.o=n+1,r.optimizeForStreaming&&!(t.i||t.w)){for(var s=e.length;s>0&&e.charCodeAt(s-1)===de;)s--;for(var i=s;i>0&&e.charCodeAt(i-1)!==de;)i--;if(s>i&&e.charCodeAt(i)===ht){for(var a=!1,o=i+1;o<s;o++){var c=e.charCodeAt(o);if(c!==ie&&c!==ae&&c!==ht&&c!==Ct&&c!==we){a=!0;break}}for(var l=!1,u=!1,m=0,_=i,v=i-1;v>0;){for(var S=v;S>0&&e.charCodeAt(S-1)!==de;)S--;if(e.charCodeAt(S)!==ht)break;_=S;for(var E=!0,g=!1,y=S;y<v;y++){var f=e.charCodeAt(y);if(f===we)g=!0;else if(f!==ie&&f!==ae&&f!==Ct&&f!==ht){E=!1;break}}E&&g?(l=!0,u=!0):u||m++,v=S-1}a?l||(e=e.slice(0,i).trimEnd()):e=l&&m>0?e.slice(0,i).trimEnd():e.slice(0,_).trimEnd()}for(var C=-1,P=-1,h=-1,b=!1,O=e.length-1;O>=0;O--)if(e.charCodeAt(O)===He){for(var k=O+1<e.length?e.charCodeAt(O+1):0,$=k>=ve&&k<=be||k>=ze&&k<=Xe,M=k===et&&O+2<e.length&&(e.charCodeAt(O+2)>=ve&&e.charCodeAt(O+2)<=be||e.charCodeAt(O+2)>=ze&&e.charCodeAt(O+2)<=Xe),q=k===It||k===li,L=e.length;L>O+1&&e.charCodeAt(L-1)===de;)L--;var U=O+1>=L;if($||M||q||U){var B=O+1;if((M||$)&&(B=O+2),$||M)for(;B<e.length;){var W=e.charCodeAt(B);if(W>=ve&&W<=be||W>=ze&&W<=Xe||W>=Ae&&W<=xe)B++;else break}for(var Y=$||M?B:O+2;Y<e.length&&e.charCodeAt(Y)!==Pe;)Y++;if(Y>=e.length)C=O,b=!0;else if(($||M)&&e.charCodeAt(Y-1)!==et){for(var Q=!1,Z=Y+1;Z<e.length;Z++)if(e.charCodeAt(Z)===He){Q=!0;break}Q||(C=O,P=B,h=Y+1)}}break}if(C>=0){for(var re=0,A=0;A<C;A++)e.charCodeAt(A)===Le&&re++;if(re%2===0)if(b)e=e.slice(0,C);else{var w=e.slice(C+1,P);zr(e,`</${w}`,0)===-1&&(e=e.slice(0,C)+e.slice(h))}}for(var j=e.length;j>0&&e.charCodeAt(j-1)===de;)j--;if(j>0){for(var p=j;p>0&&e.charCodeAt(p-1)!==de;)p--;for(var d=p,x=0;d<j&&e.charCodeAt(d)===ie&&x<3;)d++,x++;if(p>0&&d<j&&bb(e,d,j)){for(var I=p-1,T=I;T>0&&e.charCodeAt(T-1)!==de;)T--;kt(e,T,I)||(e=e.slice(0,p).trimEnd())}}var F=e.length;if(F>0){for(var z=e.lastIndexOf(`
`),H=z===-1?0:z+1,R=F,D=H,V=0;D<R&&e.charCodeAt(D)===ie&&V<3;)D++,V++;if(D<R){var K=e.charCodeAt(D),G=!1;if(K===it||K===we||K===Qr){var J=D+1;if(J>=R||e.charCodeAt(J)===ie||e.charCodeAt(J)===ae){for(var te=J;te<R&&(e.charCodeAt(te)===ie||e.charCodeAt(te)===ae);)te++;te>=R&&(G=!0)}}else if(K>=Ae&&K<=xe){for(var ne=D;ne<R&&e.charCodeAt(ne)>=Ae&&e.charCodeAt(ne)<=xe;)ne++;if(ne<R&&(e.charCodeAt(ne)===Ht||e.charCodeAt(ne)===tr)){var se=ne+1;if(se>=R||e.charCodeAt(se)===ie||e.charCodeAt(se)===ae){for(var ce=se;ce<R&&(e.charCodeAt(ce)===ie||e.charCodeAt(ce)===ae);)ce++;ce>=R&&(G=!0)}}}G&&(e=e.slice(0,H).trimEnd())}}}if(t.inline)return pr(e,0,e.length,t,r);let he=[],le=0,ge=e.length;if(le===0&&!r.disableFrontmatter&&e.startsWith("---")){let ke=Dv(e);if(ke?.hasValidYaml){if(r.preserveFrontmatter!==!1){let Et=e.slice(0,ke.endPos).trimEnd();he.push({type:ee.frontmatter,text:Et})}le=ke.endPos}}for(;le<ge;){for(var Fe=e.indexOf(`
`,le),fe=Fe<0?ge:Fe;le<ge&&kt(e,le,fe);)le=fe<ge?fe+1:fe,le<ge&&(Fe=e.indexOf(`
`,le),fe=Fe<0?ge:Fe);if(le>=ge)break;var Ye=e.charCodeAt(le)===Ac;ot(e,le,fe);let ke=null;if(jc=e,kc=le,Pa=fe,!Ye&&qe>=4&&!t.inHTML)ke=Sb(e,le);else if(!Ye){let Et=le+De,Ke=e.charCodeAt(Et);Ke===Wt?ke=vb(e,le,t,r):Ke===Pe?ke=wb(e,le,t,r):Ke===Le||Ke===ut?ke=_b(e,le):Ke===we||Ke===it||Ke===Qe?(ke=Jr(e,le),!ke&&(ke=zu(e,le,t,r))):Ke===Qr||Ke>=Ae&&Ke<=xe?ke=zu(e,le,t,r):Ke===He?ke=qm(e,le,t,r):Ke===ht?ke=Hu(e,le,t,r):Ke===tt&&(ke=Ab(e,le,t))}if(!ke){for(var ye=!1,oe=le;oe<fe;oe++)if(e.charCodeAt(oe)===ht){ye=!0;break}ye&&(ke=Hu(e,le,t,r))}if(ke||(ke=Pb(e,le,t,r)),ke)ke.node.type!==ee.refCollection&&he.push(ke.node),le=ke.end;else{var ft=e.indexOf(`
`,le);le=ft<0?ge:ft+1}}return t.o=n,he}function Vb(e,t,r,n){var s=fr(e,t);return s?{tagName:s.tag,tagLower:s.tag.toLowerCase(),attrs:s.b,whitespaceBeforeAttrs:s.g,isSelfClosing:s.n,hasSpaceBeforeSlash:s.r,isClosing:s.f,hasNewline:s.g.includes(`
`)||s.b.includes(`
`),endPos:s.end}:null}function ll(e,t,r){Oi=0,e=Hv(e),!t.refs&&(t.refs={}),(r.optimizeForStreaming||t.inline)&&(t.w=yb(e,t.refs,r));var n,s;t.t||(t.t=n=[],t.p=s=[]);let i=Yr(e,t,r);if(n&&s){for(var a=n,o={inline:t.inline,inAnchor:t.inAnchor,inHTML:t.inHTML,htmlDepth:t.d,inList:t.inList,inBlockQuote:t.inBlockQuote,noSetext:t.l,depth:t.o},c=0;c<a.length;c++){var l=a[c];t.inline=l.inline,t.inAnchor=l.inAnchor,t.inHTML=l.inHTML,t.d=l.htmlDepth,t.inList=l.inList,t.inBlockQuote=l.inBlockQuote,t.l=l.noSetext,t.o=l.depth,t.k=l.breaks;var u=pr(l.text,0,l.text.length,t,r);t.k=!1;for(var m=0;m<u.length;m++)l.dest.push(u[m])}t.inline=o.inline,t.inAnchor=o.inAnchor,t.inHTML=o.inHTML,t.d=o.htmlDepth,t.inList=o.inList,t.inBlockQuote=o.inBlockQuote,t.l=o.noSetext,t.o=o.depth;for(var _=s,v=0;v<_.length;v++)for(var S=_[v],E=0;E<S.src.length;E++){var g=S.src[E];if(S.unwrap&&g.type===ee.paragraph)for(var y=g.children,f=0;f<y.length;f++)S.dest.push(y[f]);else S.dest.push(g)}t.t=void 0,t.p=void 0,Dc(i,t,r.slugify)}return Rm(t.refs)?[{type:ee.refCollection,refs:t.refs},...i]:i}var Tc;try{Un=X.createElement("div"),Tc=Un!=null&&typeof Un=="object"&&"$$typeof"in Un&&typeof Un.$$typeof=="symbol"?Un.$$typeof:Symbol.for("react.transitional.element")}catch{Tc=Symbol.for("react.transitional.element")}var Un;function Mc(e,t,r){return{$$typeof:Tc,type:e,key:r==null?null:String(r),ref:null,props:t,_owner:null,_store:{},_debugStack:null,_debugTask:null}}function Ut(e,t){var r={key:e};if(t){var n=Im(t);for(var s in n)r[s]=n[s]}return r}var Zu=typeof X.createContext>"u"?void 0:X.createContext(void 0);function Qu(e,t,r,n,s,i,a,o,c){switch(e.type){case ee.blockQuote:{let y={key:r.key};return e.alert&&(y.className=`markdown-alert-${i(e.alert.toLowerCase(),Nn)}`,e.children.unshift(Wv(e.alert))),n("blockquote",y,t(e.children,r))}case ee.breakLine:return n("br",{key:r.key});case ee.breakThematic:return n("hr",{key:r.key});case ee.frontmatter:return o.preserveFrontmatter?n("pre",{key:r.key},e.text):null;case ee.codeBlock:{let y=e.lang?Wr(e.lang):"";var l=e.attrs?Im(e.attrs):{};return l.className=y?`language-${y} lang-${y}`:"",n("pre",{key:r.key},n("code",l,e.text))}case ee.codeInline:return n("code",{key:r.key},e.text);case ee.footnoteReference:return n("a",{key:r.key,href:s(e.target,"a","href")||void 0},n("sup",null,e.text));case ee.gfmTask:return n("input",{checked:e.completed,key:r.key,readOnly:!0,type:"checkbox"});case ee.heading:return n(`h${e.level}`,{id:e.id,key:r.key},t(e.children,r));case ee.htmlBlock:{let y=e;if(Wn(o)&&ku(y.tag)){var u=ju(y);return u.kind==="literal"?n("span",{key:r.key},u.literal):n("span",{key:r.key},...Qv(u.open,y.children?t(y.children,r):null,u.close))}let f=y.j,C=f!==void 0,P=C?f:y.a?y.e||"":(y.e||"")+(y.h||"");if(P&&y.c){let h=y.tag.toLowerCase(),b=lb(h),O=y.children,k=O!=null&&O.length>0;if(b){let W=C?f:y.e||"",Y=Wn(o)?Nu(W):W;if(/<[a-z][^>]{0,100}>/i.test(P)){var m=Ut(r.key,e.attrs);return m.dangerouslySetInnerHTML={__html:Y},c(e.tag,m)}return c(e.tag,Ut(r.key,e.attrs),Y)}let $=new RegExp(`^<${y.tag}(\\s|>)`,"i");if(k&&!$.test(P)&&Wn(o)&&sb(P))return c(e.tag,Ut(r.key,e.attrs),t(O,r));if(ub(P)){let W=Wn(o)?Nu(P):P;var _=Ut(r.key,e.attrs);return _.dangerouslySetInnerHTML={__html:W},c(e.tag,_)}let M=al({slugify:o.slugify,sanitizer:s,tagfilter:!0}),q=Kv(P);if(new RegExp(`^<${y.tag}(\\s[^>]*)?>(\\s*</${y.tag}>)?$`,"i").test(q))return y.children&&y.children.length>0?c(e.tag,Ut(r.key,e.attrs),t(y.children,r)):c(e.tag,Ut(r.key,e.attrs));let L=ll(q,{inline:!1,refs:a,inHTML:!1},M);$m(L);let U=y.tag.toLowerCase(),B=C;if(B&&k)return c(e.tag,Ut(r.key,e.attrs),t(O,r));if(B)return t(L.flatMap(Zn),r);var v=Xv(L,U);if(v.found&&v.afterClose.length>0){var S=v.beforeClose.flatMap(Zn),E=v.afterClose.flatMap(Zn);return Mc(X.Fragment,{children:[c(e.tag,Ut(r.key,e.attrs),t(S,r)),t(E,r)]},r.key)}return c(e.tag,Ut(r.key,e.attrs),t(L.flatMap(Zn),r))}return Ti(e.tag)?c(e.tag,Ut(r.key,e.attrs)):c(e.tag,Ut(r.key,e.attrs),e.children?t(e.children,r):"")}case ee.htmlSelfClosing:{let y=e;if(Wn(o)&&ku(y.tag)){var g=ju(y);return n("span",{key:r.key},g.kind==="literal"?g.literal:g.open+(g.close||""))}return c(e.tag,Ut(r.key,e.attrs))}case ee.image:{let y=e.target===null?null:s(e.target,"img","src");return n("img",{key:r.key,alt:e.alt&&e.alt.length>0?e.alt:void 0,title:e.title||void 0,src:y||void 0})}case ee.link:{let y={key:r.key};if(e.target!=null){let f=eb(e.target,s,"a","href");f!=null&&(y.href=f)}return e.title&&(y.title=e.title),n("a",y,t(e.children,r))}case ee.table:{let y=e;return n("table",{key:r.key},n("thead",{key:"thead"},n("tr",null,y.header.map(function(f,C){return n("th",{key:C,style:y.align[C]===null?{}:{textAlign:y.align[C]}},t(f,r))}))),y.cells.length>0&&n("tbody",{key:"tbody"},y.cells.map(function(f,C){return n("tr",{key:C},f.map(function(P,h){return n("td",{key:h,style:y.align[h]===null?{}:{textAlign:y.align[h]}},t(P,r))}))})))}case ee.text:return e.text;case ee.textFormatted:return n(e.tag,{key:r.key},t(e.children,r));case ee.orderedList:case ee.unorderedList:{let y=e.type===ee.orderedList?"ol":"ul";return n(y,{key:r.key,start:e.type===ee.orderedList?e.start:void 0},e.items.map(function(f,C){return n("li",{key:C},t(f,r))}))}case ee.paragraph:return n("p",{key:r.key},t(e.children,r));case ee.ref:return null;default:return null}}var zb=(e,t,r,n,s,i,a)=>{var o=l=>l.map(u=>"text"in u?u.text:""),c=(l,u={})=>{var m=Array.isArray(l)?l:[l],_=(u.renderDepth||0)+1;if(_>2500)return o(m);u.renderDepth=_;for(var v=u.key,S=[],E=!1,g=0;g<m.length;g++){u.key=g;var y;if(e){var f=Qu.bind(null,m[g],c,u,t,r,n,s,i,a);y=e(f,m[g],c,u)}else y=Qu(m[g],c,u,t,r,n,s,i,a);var C=typeof y=="string";if(E&&typeof y=="string"){var P=S.at(-1);S[S.length-1]=(typeof P=="string"?P:"")+y}else if(y!=null)if(Array.isArray(y))for(var h=0;h<y.length;h++)S.push(y[h]);else S.push(y);E=C}return u.key=v,u.renderDepth=_-1,S};return c},Bb=(e,t)=>{let r=xc(t,e,void 0);return r?typeof r=="function"||typeof r=="object"&&"render"in r?r:xc(t,`${e}.component`,e):e};function Hb(e,t){let r={...t||{}};r.overrides=r.overrides||{};let n=r.slugify||Nn,s=r.sanitizer||Pr,i=r.createElement,a=Rm(r.overrides),o=C=>qc(C,{...r,wrapper:null});function c(C){for(var P in C){var h=C[P];if(typeof h=="string"&&h.length>0&&h.charCodeAt(0)===He&&(ab.test(h)||ob.test(h)||Vb(h,0))){var b=o(h.trim());C[P]=P==="innerHTML"&&Array.isArray(b)?b[0]:b}}}function l(C,P,...h){var b=P||{},O=C;if(a){var k=xc(r.overrides,`${C}.props`,{});O=Bb(C,r.overrides),b={...b,...k,className:nb(b.className,k.className)||void 0}}if(!i){var $=b.key;return $!=null&&delete b.key,h.length===1?b.children=h[0]:h.length>1&&(b.children=h),Mc(O,b,$)}return i(O,b,...h)}function u(C,P,...h){return P&&c(P),l(C,P,...h)}let m=al(r,r.forceInline),_=e[0]&&e[0].type===ee.refCollection?e[0].refs:{},v=zb(r.renderRule,l,s,n,_,r,u),S=v(e,{inline:r.forceInline,refs:_}),E=tb(_);if(E.length>0&&S.push(l("footer",{key:"footer"},E.map(function(C){let P=C.identifier.charCodeAt(0)===Nr?C.identifier.slice(1):C.identifier,h=ll(C.footnote,{inline:!0,refs:_},m);return l("div",{id:n(P,Nn),key:C.identifier},`${P}: `,v(h,{inline:!0,refs:_}))}))),r.wrapper===null)return S;let g=r.wrapper||(r.forceInline?"span":"div"),y;if(S.length>1||r.forceWrapper)y=S;else return S.length===1?S[0]:null;var f=r.wrapperProps?{...r.wrapperProps}:{};return f.children=y,Mc(g,f,"outer")}function qc(e="",t={}){let r={...t||{}};r.overrides=r.overrides||{},r.slugify,r.sanitizer;function n(i){let a=r.forceInline||!(r.forceBlock||Uv.test(i)),o=al(r,a),c=a?i:Yv(i),l=ll(c,{inline:a,refs:s},o);return Hb(l,{...r,forceInline:a})}let s={};return n(e)}function Kb(e){let t=X.useRef(e),r=t.current;if(r!==e){var n=!0,s=0;for(var i in e)if(s++,!Object.is(r[i],e[i])){n=!1;break}if(n){var a=0;for(var o in r)a++;n=a===s}n||(t.current=e)}return t.current}var qi=({children:e,options:t,...r})=>{if(!(typeof X.useContext<"u")){let o={...t,overrides:{...t?.overrides},wrapperProps:{...t?.wrapperProps,...r}};return qc(e??"",o)}let n=Zu?X.useContext(Zu):void 0,s=Kb(r),i=X.useMemo(()=>({...n,...t,overrides:{...n?.overrides,...t?.overrides},wrapperProps:{...n?.wrapperProps,...t?.wrapperProps,...s}}),[n,t,s]),a=e??"";return X.useMemo(()=>qc(a,i),[a,i])};const Lm=Symbol("remove-this-key"),ed=Symbol("reset");function Gb(e,t){return Array.isArray(e.required)&&e.required.includes(t)}function Wb(e,t){switch(t){case"array":return[];case"boolean":return!1;case"null":return null;case"number":return 0;case"object":return{};case"string":default:return e($e.NewStringDefault)}}function Vm(e){return!!e?.[Sn]}function td(e){return Object.keys(e).filter(t=>Vm(e[t]))}function Jb(e){const{fieldPathId:t,schema:r,registry:n,uiSchema:s,errorSchema:i,formData:a,onChange:o,onBlur:c,onFocus:l,disabled:u,readonly:m,required:_,hideError:v,propertyName:S,handleKeyRename:E,handleRemoveProperty:g,addedByAdditionalProperties:y}=e,[f,C]=X.useState(!1),{globalFormOptions:P,fields:h}=n,{SchemaField:b}=h,O=ci(nr(S,P,t.path)),k=X.useCallback((L,U,B,W)=>{let Y=L;L===void 0&&y&&je(U,O.path)&&(Y=""),o(Y,U,B,W)},[o,y,O]),$=X.useCallback(L=>{S!==L&&C(!0),E(S,L)},[S,E]),M=X.useCallback(L=>{const{target:{value:U}}=L;$(U)},[$]),q=X.useCallback(()=>{g(S)},[S,g]);return N.jsx(b,{name:S,required:_,schema:r,uiSchema:s,errorSchema:i,fieldPathId:O,formData:a,wasPropertyKeyModified:f,onKeyRename:$,onKeyRenameBlur:M,onRemoveProperty:q,onChange:k,onBlur:c,onFocus:l,registry:n,disabled:u,readonly:m,hideError:v})}const Yb=X.memo(Jb);function Xb(e){const{schema:t,uiSchema:r={},formData:n,errorSchema:s,fieldPathId:i,name:a,required:o=!1,disabled:c,readonly:l,hideError:u,onBlur:m,onFocus:_,onChange:v,registry:S,title:E}=e,{fields:g,schemaUtils:y,translateString:f,globalUiOptions:C}=S,{OptionalDataControlsField:P}=g,h=X.useRef(n);h.current=n;const b=X.useMemo(()=>y.retrieveSchema(t,n,!0),[y,t,n]),O=X.useMemo(()=>pe(r,C),[r,C]),k=X.useMemo(()=>b.properties??{},[b.properties]),$=e.childFieldPathId??i,M=X.useRef({previousKey:"",currentKey:void 0}),[q,L]=X.useState(()=>td(k)),U=X.useMemo(()=>{const T=new Set(td(k));return Object.keys(k).filter(F=>!T.has(F))},[k]),B=O.title??b.title??E??a,W=O.description??b.description,Y=Di(S,b,o,r),Q=oi(n);let Z=[];const re=X.useCallback((T,F)=>{const{duplicateKeySuffixSeparator:z="-"}=pe(r,C);let H=0,R=T;for(;lt(F,R);)H+=1,R=`${T}${z}${H}`;return R},[r,C]),A=X.useCallback(()=>{if(!(b.additionalProperties||b.patternProperties))return;const T={...n},F=re("newKey",T);if(b.patternProperties)at(T,F,null);else{let z,H,R;if(ue(b.additionalProperties)){z=b.additionalProperties.type,H=b.additionalProperties.const,R=b.additionalProperties.default;let V=b.additionalProperties;Je in V&&(V=y.retrieveSchema({[Je]:V[Je]},n),z=V.type,H=V.const,R=y.getDefaultFormState(V,R)),!z&&(Ie in V||Se in V)&&(z="object")}const D=H??R??Wb(f,z);at(T,F,D)}M.current.previousKey===F&&(M.current.currentKey=F,M.current.previousKey=re(F,T)),L(z=>[...z,F]),v(T,$.path)},[n,v,f,y,$,re,b]),w=X.useCallback((T,F)=>{if(T!==F){const z=h.current,H=re(F,z),R={...z},D={[T]:H},V=Object.keys(R).map(G=>({[Object.hasOwn(D,G)?D[G]:G]:R[G]})),K=Object.assign({},...V);h.current=K,T!==M.current.currentKey&&(M.current.previousKey=T),M.current.currentKey=H,L(G=>G.map(J=>J===T?H:J)),v(K,$.path)}},[v,$,re]),j=X.useCallback(T=>{L(F=>F.filter(z=>z!==T)),v(Lm,[...$.path,T])},[v,$]),p=X.useCallback(T=>M.current.currentKey===T?M.current.previousKey:T,[]);if(!Y||Q)try{const T=new Set(U),F=q.filter(z=>Object.hasOwn(k,z)&&!T.has(z));Z=N0([...U,...F],O.order)}catch(T){return N.jsxs("div",{children:[N.jsx("p",{className:"rjsf-config-error",style:{color:"red"},children:N.jsx(qi,{options:{disableParsingRawHTML:!0},children:f($e.InvalidObjectField,[a||"root",T.message])})}),N.jsx("pre",{children:JSON.stringify(b)})]})}const d=_e("ObjectFieldTemplate",S,O),x=Y?N.jsx(P,{...e,fieldPathId:$,schema:b}):void 0,I={title:O.label===!1?"":B,description:O.label===!1?void 0:W,properties:Z.map(T=>{const F=Vm(b.properties?.[T]),z=F?r.additionalProperties:r[T],H=pe(z).widget==="hidden";return{content:N.jsx(Yb,{propertyName:T,required:Gb(b,T),schema:gr(b,T),uiSchema:z,errorSchema:me(s,T),fieldPathId:$,formData:me(n,T),handleKeyRename:w,handleRemoveProperty:j,addedByAdditionalProperties:F,onChange:v,onBlur:m,onFocus:_,registry:S,disabled:c,readonly:l,hideError:u},p(T)),name:T,readonly:l,disabled:c,required:o,hidden:H}}),readonly:l,disabled:c,required:o,fieldPathId:i,uiSchema:r,errorSchema:s,schema:b,formData:n,registry:S,optionalDataControl:x,className:Y?"rjsf-optional-object-field":void 0};return N.jsx(d,{...I,onAddProperty:A})}function Zb(e){const{schema:t,uiSchema:r={},formData:n,disabled:s=!1,readonly:i=!1,onChange:a,errorSchema:o,fieldPathId:c,registry:l}=e,{globalUiOptions:u={},schemaUtils:m,translateString:_}=l,v=pe(r,u),S=_e("OptionalDataControlsTemplate",l,v),E=oi(n);let g,y,f,C;if(s||i)g=$o(c,"Msg"),y=E?void 0:_($e.OptionalObjectEmptyMsg);else{const P=E?$e.OptionalObjectRemove:$e.OptionalObjectAdd;y=_(P),E?(g=$o(c,"Remove"),C=()=>a(void 0,c.path,o)):(g=$o(c,"Add"),f=()=>{let h=m.getDefaultFormState(t,n,"excludeObjectChildren");h===void 0&&(h=Gt(t)==="array"?[]:{}),a(h,c.path,o)})}return y&&N.jsx(S,{id:g,registry:l,schema:t,uiSchema:r,label:y,onAddClick:f,onRemoveClick:C})}const Qb={array:"ArrayField",boolean:"BooleanField",integer:"NumberField",number:"NumberField",object:"ObjectField",string:"StringField",null:"NullField"};function e_(e,t,r){const{field:n}=t,{fields:s,schemaUtils:i}=r;if(typeof n=="function")return n;if(typeof n=="string"&&n in s)return s[n];const a=Gt(e),o=Array.isArray(a)?a[0]:a||"",c=e.$id;let l=Qb[o];return c&&c in s&&(l=c),(e.anyOf||e.oneOf)&&!i.isSelect(e)&&l!=="ObjectField"?()=>null:l in s?s[l]:s.FallbackField}function t_(e){const{schema:t,fieldPathId:r,uiSchema:n,formData:s,errorSchema:i,name:a,onChange:o,onKeyRename:c,onKeyRenameBlur:l,onRemoveProperty:u,required:m=!1,registry:_,wasPropertyKeyModified:v=!1}=e,{schemaUtils:S,globalFormOptions:E,globalUiOptions:g,fields:y}=_,{AnyOfField:f,OneOfField:C,CyclicSchemaField:P}=y,h=r[Ue],b=X.useCallback((ge,Fe,fe,Ye)=>o(ge,Fe,fe,Ye||h),[h,o]);if(t[zc])return N.jsx(P,{...e});const O=I0(t,n,_),k=pe(O,g),$=_e("FieldTemplate",_,k),M=_e("DescriptionFieldTemplate",_,k),q=_e("FieldHelpTemplate",_,k),L=_e("FieldErrorTemplate",_,k),U=S.retrieveSchema(t,s),B=e_(U,k,_),Y=!!U.deprecated?k.deprecatedHandling??"label":void 0,Q=!!(k.disabled??e.disabled)||Y==="disable",Z=!!(k.readonly??(e.readonly||e.schema.readOnly||U.readOnly)),re=k.hideError,A=re===void 0?e.hideError:!!re,w=!!(k.autofocus??e.autofocus);if(Object.keys(U).length===0)return null;let j=S.getDisplayLabel(U,O,g);const p=k.field&&k.fieldReplacesAnyOrOneOf===!0;let d,x,I={fieldPathId:r};if((Ie in U||Se in U)&&!p&&!S.isSelect(U)){U[Ie]?(d=f,x=U[Ie].map(fe=>S.retrieveSchema(ue(fe)?fe:{},s))):U[Se]&&(d=C,x=U[Se].map(fe=>S.retrieveSchema(ue(fe)?fe:{},s)));const ge=Di(_,U,m,O),Fe=oi(s);j=j&&(!ge||Fe),I={childFieldPathId:r,fieldPathId:nr("XxxOf",E,r)}}const{__errors:T,...F}=i||{},{"ui:classNames":z,classNames:H,"ui:style":R,...D}=O;if(Br in D){const{classNames:ge,style:Fe,...fe}=D[Br];D[Br]=fe}const V=N.jsx(B,{...e,onChange:b,...I,schema:U,uiSchema:D,disabled:Q,readonly:Z,hideError:A,autofocus:w,errorSchema:F,rawErrors:T}),K=r[Ue];let G;v?G=a:G=Sn in U?a:k.title||e.schema.title||U.title||e.title||a,Y==="label"&&(G=_.translateString($e.DeprecatedLabel,[G]));const J=k.description||e.schema.description||U.description||"",{help:te}=k,ne=k.widget==="hidden"||Y==="hide",se=["rjsf-field",`rjsf-field-${Gt(U)}`];!A&&T&&T.length>0&&se.push("rjsf-field-error"),k.classNames&&se.push(k.classNames);const ce=N.jsx(q,{help:te,fieldPathId:r,schema:U,uiSchema:O,hasErrors:!A&&T&&T.length>0,registry:_}),he=A||d&&!S.isSelect(U)?void 0:N.jsx(L,{errors:T,errorSchema:i,fieldPathId:r,schema:U,uiSchema:O,registry:_}),le={description:N.jsx(M,{id:ai(K),description:J,schema:U,uiSchema:O,registry:_}),rawDescription:J,help:ce,rawHelp:typeof te=="string"?te:void 0,errors:he,rawErrors:A?void 0:T,fieldPathId:r,id:K,label:G,hidden:ne,onChange:o,onKeyRename:c,onKeyRenameBlur:l,onRemoveProperty:u,required:m,disabled:Q,readonly:Z,hideError:A,displayLabel:j,classNames:se.join(" ").trim(),style:k.style,formData:s,schema:U,uiSchema:O,registry:_};return N.jsx($,{...le,children:N.jsxs(N.Fragment,{children:[V,d&&N.jsx(d,{name:a,disabled:Q,readonly:Z,hideError:A,errorSchema:i,formData:s,fieldPathId:r,onBlur:e.onBlur,onChange:e.onChange,onFocus:e.onFocus,options:x,registry:_,required:m,schema:U,uiSchema:O})]})})}const r_=X.memo(t_,(e,t)=>{const{experimental_componentUpdateStrategy:r="customDeep"}=t.registry.globalFormOptions;return r==="always"?!1:r==="shallow"?_c(e,t):je(e,t)});function n_(e){const{schema:t,name:r,uiSchema:n,fieldPathId:s,formData:i,required:a,disabled:o=!1,readonly:c=!1,autofocus:l=!1,onChange:u,onBlur:m,onFocus:_,registry:v,rawErrors:S,hideError:E,title:g}=e,{title:y,format:f}=t,{widgets:C,schemaUtils:P,globalUiOptions:h}=v,b=P.isSelect(t)?xn(t,n):void 0;let O=b?"select":"text";f&&x0(t,f,C)&&(O=f);const{widget:k=O,placeholder:$="",title:M,...q}=pe(n),L=P.getDisplayLabel(t,n,h),U=M??g??y??r,B=vr(t,k,C),W=X.useCallback((Y,Q,Z)=>u(Y,s.path,Q,Z),[u,s]);return N.jsx(B,{options:{...q,enumOptions:b},schema:t,uiSchema:n,id:s.$id,name:r,label:U,hideLabel:!L,hideError:E,value:i,onChange:W,onBlur:m,onFocus:_,required:a,disabled:o,readonly:c,autofocus:l,registry:v,placeholder:$,rawErrors:S,htmlName:s.name})}function i_(){return{AnyOfField:wu,ArrayField:rv,BooleanField:nv,CyclicSchemaField:iv,FallbackField:cv,LayoutGridField:il,LayoutHeaderField:Sv,LayoutMultiSchemaField:wv,NumberField:xv,ObjectField:Xb,OneOfField:wu,OptionalDataControlsField:Zb,SchemaField:r_,StringField:n_,NullField:Cv}}function s_(e){const{fieldPathId:t,description:r,registry:n,schema:s,uiSchema:i}=e,a=pe(i,n.globalUiOptions),{label:o=!0}=a;if(!r||!o)return null;const c=_e("DescriptionFieldTemplate",n,a);return N.jsx(c,{id:ai(t),description:r,schema:s,uiSchema:i,registry:n})}function a_(e){const{disabled:t,hasCopy:r,hasMoveDown:n,hasMoveUp:s,hasRemove:i,fieldPathId:a,onCopyItem:o,onRemoveItem:c,onMoveDownItem:l,onMoveUpItem:u,readonly:m,registry:_,uiSchema:v}=e,{CopyButton:S,MoveDownButton:E,MoveUpButton:g,RemoveButton:y}=_.templates.ButtonTemplates;return N.jsxs(N.Fragment,{children:[(s||n)&&N.jsx(g,{id:_n(a,"moveUp"),className:"rjsf-array-item-move-up",disabled:t||m||!s,onClick:u,uiSchema:v,registry:_}),(s||n)&&N.jsx(E,{id:_n(a,"moveDown"),className:"rjsf-array-item-move-down",disabled:t||m||!n,onClick:l,uiSchema:v,registry:_}),r&&N.jsx(S,{id:_n(a,"copy"),className:"rjsf-array-item-copy",disabled:t||m,onClick:o,uiSchema:v,registry:_}),i&&N.jsx(y,{id:_n(a,"remove"),className:"rjsf-array-item-remove",disabled:t||m,onClick:c,uiSchema:v,registry:_})]})}function o_(e){const{children:t,className:r,buttonsProps:n,displayLabel:s,hasDescription:i,hasToolbar:a,registry:o,uiSchema:c}=e,l=pe(c),u=_e("ArrayFieldItemButtonsTemplate",o,l),m={flex:1,paddingLeft:6,paddingRight:6,fontWeight:"bold"},_=i?31:9,v={display:"flex",alignItems:s?"center":"baseline"},S={display:"flex",justifyContent:"flex-end",marginTop:s?`${_}px`:0};return N.jsxs("div",{className:r,style:v,children:[N.jsx("div",{className:a?"col-xs-9 col-md-10 col-xl-11":"col-xs-12",children:t}),a&&N.jsx("div",{className:"col-xs-3 col-md-2 col-xl-1 array-item-toolbox",children:N.jsx("div",{className:"btn-group",style:S,children:N.jsx(u,{...n,style:m})})})]})}function c_(e){const{canAdd:t,className:r,disabled:n,fieldPathId:s,uiSchema:i,items:a,optionalDataControl:o,onAddClick:c,readonly:l,registry:u,required:m,schema:_,title:v}=e,S=pe(i),E=_e("ArrayFieldDescriptionTemplate",u,S),g=_e("ArrayFieldTitleTemplate",u,S),y=!l&&!n,{ButtonTemplates:{AddButton:f}}=u.templates;return N.jsxs("fieldset",{className:r,id:s.$id,children:[N.jsx(g,{fieldPathId:s,title:S.title||v,required:m,schema:_,uiSchema:i,registry:u,optionalDataControl:y?o:void 0}),N.jsx(E,{fieldPathId:s,description:S.description||_.description,schema:_,uiSchema:i,registry:u}),y?void 0:o,N.jsx("div",{className:"row array-item-list",children:a}),t&&N.jsx(f,{id:_n(s,"add"),className:"rjsf-array-item-add",onClick:c,disabled:n||l,uiSchema:i,registry:u})]})}function l_(e){const{fieldPathId:t,title:r,schema:n,uiSchema:s,required:i,registry:a,optionalDataControl:o}=e,c=pe(s,a.globalUiOptions),{label:l=!0}=c;if(!r||!l)return null;const u=_e("TitleFieldTemplate",a,c);return N.jsx(u,{id:tl(t),title:r,required:i,schema:n,uiSchema:s,registry:a,optionalDataControl:o})}function u_(e){const{id:t,schema:r}=e,{examples:n,default:s}=r;return Array.isArray(n)?N.jsx("datalist",{id:el(t),children:n.concat(s!==void 0&&!n.map(String).includes(String(s))?[s]:[]).map(i=>N.jsx("option",{value:i},String(i)))},`datalist_${t}`):null}function d_(e){const{id:t,name:r,htmlName:n,value:s,readonly:i,disabled:a,autofocus:o,onBlur:c,onFocus:l,onChange:u,onChangeOverride:m,options:_,schema:v,uiSchema:S,registry:E,rawErrors:g,type:y,hideLabel:f,hideError:C,...P}=e,{ClearButton:h}=E.templates.ButtonTemplates;if(!t)throw console.log("No id for",e),new Error(`no id for props ${JSON.stringify(e)}`);const b={...P,...b0(v,y,_)};let O;b.type==="number"||b.type==="integer"?O=s||s===0?s:"":O=s??"";const k=X.useCallback(({target:{value:L}})=>u(L===""?_.emptyValue:L),[u,_]),$=X.useCallback(({target:L})=>c(t,L?.value),[c,t]),M=X.useCallback(({target:L})=>l(t,L?.value),[l,t]),q=X.useCallback(L=>{L.preventDefault(),L.stopPropagation(),u(_.emptyValue)},[u,_.emptyValue]);return N.jsxs(N.Fragment,{children:[N.jsx("input",{id:t,name:n||t,className:"form-control",readOnly:i,disabled:a,autoFocus:o,value:O,...b,list:v.examples?el(t):void 0,onChange:m||k,onBlur:$,onFocus:M,"aria-describedby":$n(t,!!v.examples)}),_.allowClearTextInputs&&!i&&!a&&O&&N.jsx(h,{registry:E,onClick:q}),N.jsx(u_,{id:t,schema:v})]})}function f_(e){const{iconType:t="default",icon:r,className:n,uiSchema:s,registry:i,...a}=e;return N.jsx("button",{type:"button",className:`btn btn-${t} ${n}`,...a,children:N.jsx("i",{className:`glyphicon glyphicon-${r}`})})}const tn=X.memo(f_);function h_(e){const{registry:{translateString:t}}=e;return N.jsx(tn,{title:t($e.CopyButton),...e,icon:"copy"})}const m_=X.memo(h_);function p_(e){const{registry:{translateString:t}}=e;return N.jsx(tn,{title:t($e.MoveDownButton),...e,icon:"arrow-down"})}const y_=X.memo(p_);function g_(e){const{registry:{translateString:t}}=e;return N.jsx(tn,{title:t($e.MoveUpButton),...e,icon:"arrow-up"})}const v_=X.memo(g_);function b_(e){const{registry:{translateString:t}}=e;return N.jsx(tn,{title:t($e.RemoveButton),...e,iconType:"danger",icon:"remove"})}const __=X.memo(b_);function S_({id:e,className:t,onClick:r,disabled:n,registry:s,...i}){const{translateString:a}=s;return N.jsx(tn,{id:e,iconType:"default",icon:"remove",className:"btn-clear col-xs-12",title:a($e.ClearButton),onClick:r,disabled:n,registry:s,...i})}const w_=X.memo(S_);function C_({id:e,className:t,onClick:r,disabled:n,registry:s}){const{translateString:i}=s;return N.jsx("div",{className:"row",children:N.jsx("p",{className:`col-xs-4 col-sm-2 col-lg-1 col-xs-offset-8 col-sm-offset-10 col-lg-offset-11 text-right ${t}`,children:N.jsx(tn,{id:e,iconType:"info",icon:"plus",className:"btn-add col-xs-12",title:i($e.AddButton),onClick:r,disabled:n,registry:s})})})}function E_({uiSchema:e}){const{submitText:t,norender:r,props:n={}}=_0(e);return r?null:N.jsx("div",{children:N.jsx("button",{type:"submit",...n,className:`btn btn-info ${n.className||""}`,children:t})})}function A_(){return{SubmitButton:E_,AddButton:C_,CopyButton:m_,MoveDownButton:y_,MoveUpButton:v_,RemoveButton:__,ClearButton:w_}}function x_(e){const{name:t,fieldPathId:r,registry:n,onExpand:s}=e,{translateString:i}=n,a=`${r[Ue]}-button`;return N.jsxs("div",{style:{marginTop:"1rem"},children:[N.jsx("div",{className:"text-danger",children:i($e.CycleDetected,[t])}),N.jsxs("div",{children:[N.jsx("button",{id:a,type:"button",className:"btn btn-sm btn-warning",onClick:()=>s(r[Ue]),children:i($e.ExpandButton)})," "]})]})}const zm=Qc();function Bm({description:e,registry:t,uiSchema:r={}}){const{globalUiOptions:n}=t;return pe(r,n).enableMarkdownInDescription&&typeof e=="string"?N.jsx(qi,{options:{disableParsingRawHTML:!0},"data-testid":zm.markdown,children:e}):e}Bm.TEST_IDS=zm;function P_(e){const{id:t,description:r,registry:n,uiSchema:s}=e;return r?N.jsx("div",{id:t,className:"field-description",children:N.jsx(Bm,{description:r,registry:n,uiSchema:s})}):null}function O_({errors:e,registry:t}){const{translateString:r}=t;return N.jsxs("div",{className:"panel panel-danger errors",children:[N.jsx("div",{className:"panel-heading",children:N.jsx("h3",{className:"panel-title",children:r($e.ErrorsLabel)})}),N.jsx("ul",{className:"list-group",children:e.map((n,s)=>N.jsx("li",{className:"list-group-item text-danger",children:n.stack},s))})]})}function j_(e){const{schema:t,registry:r,typeSelector:n,schemaField:s}=e,i=_e("MultiSchemaFieldTemplate",r);return N.jsx(i,{selector:n,optionSchemaField:s,schema:t,registry:r})}function k_(e){const{errors:t=[],fieldPathId:r}=e;if(t.length===0)return null;const n=vm(r);return N.jsx("div",{children:N.jsx("ul",{id:n,className:"error-detail bs-callout bs-callout-info",children:t.filter(s=>!!s).map((s,i)=>N.jsx("li",{className:"text-danger",children:s},i))})})}const Hm=Qc();function Km({help:e,registry:t,uiSchema:r={}}){const{globalUiOptions:n}=t;return pe(r,n).enableMarkdownInHelp&&typeof e=="string"?N.jsx(qi,{options:{disableParsingRawHTML:!0},"data-testid":Hm.markdown,children:e}):e}Km.TEST_IDS=Hm;function N_(e){const{fieldPathId:t,help:r,uiSchema:n,registry:s}=e;return r?N.jsx("div",{id:bm(t),className:"help-block",children:N.jsx(Km,{help:r,registry:s,uiSchema:n})}):null}const I_="*";function Gm(e){const{label:t,required:r,id:n}=e;return t?N.jsxs("label",{className:"control-label",htmlFor:n,children:[t,r&&N.jsx("span",{className:"required",children:I_})]}):null}function R_(e){const{id:t,label:r,children:n,errors:s,help:i,description:a,hidden:o,required:c,displayLabel:l,registry:u,uiSchema:m}=e,_=pe(m),v=_e("WrapIfAdditionalTemplate",u,_);if(o)return N.jsx("div",{className:"hidden",children:n});const S=_.widget==="checkbox";return N.jsxs(v,{...e,children:[l&&!S&&N.jsx(Gm,{label:r,required:c,id:t}),l&&a?a:null,n,s,i]})}function $_(e){const{children:t,column:r,className:n,...s}=e;return N.jsx("div",{className:n,...s,children:t})}function F_(e){const{selector:t,optionSchemaField:r}=e;return N.jsxs("div",{className:"panel panel-default panel-body",children:[N.jsx("div",{className:"form-group",children:t}),r]})}function D_(e){const{className:t,description:r,disabled:n,formData:s,fieldPathId:i,onAddProperty:a,optionalDataControl:o,properties:c,readonly:l,registry:u,required:m,schema:_,title:v,uiSchema:S}=e,E=pe(S),g=_e("TitleFieldTemplate",u,E),y=_e("DescriptionFieldTemplate",u,E);if((_.oneOf||_.anyOf)&&!_.properties&&c.length===0)return null;const C=!l&&!n,{ButtonTemplates:{AddButton:P}}=u.templates;return N.jsxs("fieldset",{className:t,id:i.$id,children:[v&&N.jsx(g,{id:tl(i),title:v,required:m,schema:_,uiSchema:S,registry:u,optionalDataControl:C?o:void 0}),r&&N.jsx(y,{id:ai(i),description:r,schema:_,uiSchema:S,registry:u}),C?void 0:o,c.map(h=>h.content),Fy(_,S,s)&&N.jsx(P,{id:_n(i,"add"),className:"rjsf-object-property-expand",onClick:a,disabled:n||l,uiSchema:S,registry:u})]})}function T_(e){const{id:t,registry:r,label:n,onAddClick:s,onRemoveClick:i}=e;return s?N.jsx(tn,{id:t,registry:r,icon:"plus",className:"rjsf-add-optional-data btn-sm",onClick:s,title:n}):i?N.jsx(tn,{id:t,registry:r,icon:"remove",className:"rjsf-remove-optional-data btn-sm",onClick:i,title:n}):N.jsx("em",{id:t,children:n})}const M_="*";function q_(e){const{id:t,title:r,required:n,optionalDataControl:s}=e;return N.jsxs("legend",{id:t,children:[r,n&&N.jsx("span",{className:"required",children:M_}),s&&N.jsx("span",{className:"pull-right",style:{marginBottom:"2px"},children:s})]})}function U_(e){const{schema:t,fieldPathId:r,reason:n,registry:s}=e,{translateString:i}=s;let a=$e.UnsupportedField;const o=[];return r?.$id&&(a=$e.UnsupportedFieldWithId,o.push(r.$id)),n&&(a=a===$e.UnsupportedField?$e.UnsupportedFieldWithReason:$e.UnsupportedFieldWithIdAndReason,o.push(n)),N.jsxs("div",{className:"unsupported-field",children:[N.jsx("p",{children:N.jsx(qi,{options:{disableParsingRawHTML:!0},children:i(a,o)})}),t&&N.jsx("pre",{children:JSON.stringify(t,null,2)})]})}function L_(e){const{id:t,classNames:r,style:n,disabled:s,displayLabel:i,label:a,onKeyRenameBlur:o,onRemoveProperty:c,rawDescription:l,readonly:u,required:m,schema:_,hideError:v,rawErrors:S,children:E,uiSchema:g,registry:y}=e,{templates:f,translateString:C}=y,{RemoveButton:P}=f.ButtonTemplates,h=C($e.KeyLabel,[a]),b=Sn in _,O=!!l,k=["form-group",r];!v&&S&&S.length>0&&k.push("has-error has-danger");const $=k.join(" ").trim();if(!b)return N.jsx("div",{className:$,style:n,children:E});const M=O?46:26;return N.jsx("div",{className:$,style:n,children:N.jsxs("div",{className:"row",children:[N.jsx("div",{className:"col-xs-5 form-additional",children:N.jsxs("div",{className:"form-group",children:[i&&N.jsx(Gm,{label:h,required:m,id:`${t}-key`}),i&&l&&N.jsx("div",{children:" "}),N.jsx("input",{className:"form-control",type:"text",id:`${t}-key`,onBlur:o,defaultValue:a},a)]})}),N.jsx("div",{className:"form-additional form-group col-xs-5",children:E}),N.jsx("div",{className:"col-xs-2",style:{marginTop:i?`${M}px`:void 0},children:N.jsx(P,{id:_n(t,"remove"),className:"rjsf-object-property-remove btn-block",style:{border:"0"},disabled:s||u,onClick:c,uiSchema:g,registry:y})})]})})}function V_(){return{ArrayFieldDescriptionTemplate:s_,ArrayFieldItemTemplate:o_,ArrayFieldItemButtonsTemplate:a_,ArrayFieldTemplate:c_,ArrayFieldTitleTemplate:l_,ButtonTemplates:A_(),BaseInputTemplate:d_,CyclicSchemaExpandTemplate:x_,DescriptionFieldTemplate:P_,ErrorListTemplate:O_,FallbackFieldTemplate:j_,FieldTemplate:R_,FieldErrorTemplate:k_,FieldHelpTemplate:N_,GridTemplate:$_,MultiSchemaFieldTemplate:F_,ObjectFieldTemplate:D_,OptionalDataControlsTemplate:T_,TitleFieldTemplate:q_,UnsupportedFieldTemplate:U_,WrapIfAdditionalTemplate:L_}}function z_({time:e=!0,...t}){const{AltDateWidget:r}=t.registry.widgets;return N.jsx(r,{time:e,...t})}function B_(e){const{disabled:t=!1,readonly:r=!1,autofocus:n=!1,options:s,id:i,name:a,registry:o,onBlur:c,onFocus:l}=e,{translateString:u}=o,{elements:m,handleChange:_,handleClear:v,handleSetNow:S}=q0(e);return N.jsxs("ul",{className:"list-inline",children:[m.map((E,g)=>N.jsx("li",{className:"list-inline-item",children:N.jsx(M0,{rootId:i,name:a,select:_,...E,disabled:t,readonly:r,registry:o,onBlur:c,onFocus:l,autofocus:n&&g===0})},g)),(s.hideNowButton!=="undefined"?!s.hideNowButton:!0)&&N.jsx("li",{className:"list-inline-item",children:N.jsx("button",{type:"button",className:"btn btn-info btn-now",onClick:S,children:u($e.NowLabel)})}),(s.hideClearButton!=="undefined"?!s.hideClearButton:!0)&&N.jsx("li",{className:"list-inline-item",children:N.jsx("button",{type:"button",className:"btn btn-warning btn-clear",onClick:v,children:u($e.ClearLabel)})})]})}function H_({id:e,disabled:t,options:r,value:n,autofocus:s=!1,readonly:i,onChange:a,onBlur:o,onFocus:c,htmlName:l}){const{inline:u=!1,enumOptions:m,enumDisabled:_,emptyValue:v}=r,S=Zc(r),E=Array.isArray(n)?n:[n],g=X.useCallback(({target:f})=>o(e,Cn(f?.value,m,S,v)),[o,e,m,v,S]),y=X.useCallback(({target:f})=>c(e,Cn(f?.value,m,S,v)),[c,e,m,v,S]);return N.jsx("div",{className:"checkboxes",id:e,children:Array.isArray(m)&&m.map((f,C)=>{const P=Wa(f.value,E),h=Array.isArray(_)&&_.includes(f.value),b=t||h||i?"disabled":"",O=$=>{$.target.checked?a(y0(C,E,m)):a(m0(C,E,m))},k=N.jsxs("span",{children:[N.jsx("input",{type:"checkbox",id:_m(e,C),name:l||e,checked:P,value:Xc(f.value,C,S),disabled:t||h||i,autoFocus:s&&C===0,onChange:O,onBlur:g,onFocus:y,"aria-describedby":$n(e)}),N.jsx("span",{children:f.label})]});return u?N.jsx("label",{className:`checkbox-inline ${b}`,children:k},String(f.value)):N.jsx("div",{className:`checkbox ${b}`,children:N.jsx("label",{children:k})},String(f.value))})})}function K_({schema:e,uiSchema:t,options:r,id:n,value:s,disabled:i,readonly:a,label:o,hideLabel:c,autofocus:l=!1,onBlur:u,onFocus:m,onChange:_,registry:v,htmlName:S,required:E}){const g=_e("DescriptionFieldTemplate",v,r),y=Aa(e)&&E,f=X.useCallback(k=>_(k.target.checked),[_]),C=X.useCallback(k=>u(n,k.target.checked),[u,n]),P=X.useCallback(k=>m(n,k.target.checked),[m,n]),O=pe(t).widget==="checkbox"?void 0:r.description??e.description;return N.jsxs("div",{className:`checkbox ${i||a?"disabled":""}`,children:[!c&&O&&N.jsx(g,{id:ai(n),description:O,schema:e,uiSchema:t,registry:v}),N.jsxs("label",{children:[N.jsx("input",{type:"checkbox",id:n,name:S||n,checked:typeof s>"u"?!1:s,required:E,disabled:i||a,autoFocus:l,onChange:f,onBlur:C,onFocus:P,"aria-describedby":$n(n)}),O0(N.jsxs("span",{children:[o,y&&N.jsx("span",{className:"required",children:"*"})]}),c)]})]})}function G_(e){const{disabled:t,readonly:r,options:n,registry:s}=e,i=_e("BaseInputTemplate",s,n);return N.jsx(i,{type:"color",...e,disabled:t||r})}function W_(e){const{onChange:t,value:r,options:n,registry:s}=e,i=_e("BaseInputTemplate",s,n);return N.jsx(i,{type:"datetime-local",...e,value:B0(r),onChange:a=>t(j0(a))})}function J_(e){const{onChange:t,options:r,registry:n}=e,s=_e("BaseInputTemplate",n,r),i=X.useCallback(a=>t(a||void 0),[t]);return N.jsx(s,{type:"date",...e,onChange:i})}function Y_(e){const{options:t,registry:r}=e,n=_e("BaseInputTemplate",r,t);return N.jsx(n,{type:"email",...e})}function X_({fileInfo:e,registry:t}){const{translateString:r}=t,{dataURL:n,type:s,name:i}=e;if(!n)return null;const a=r($e.PreviewLabel);return["image/jpeg","image/png"].includes(s)?N.jsx("img",{src:n,alt:a,style:{maxWidth:"100%"},className:"file-preview"}):N.jsxs(N.Fragment,{children:[" ",N.jsx("a",{download:`preview-${i}`,href:n,className:"file-download",children:a})]})}function Z_({filesInfo:e,registry:t,preview:r,onRemove:n,options:s}){if(e.length===0)return null;const{translateString:i}=t,{RemoveButton:a}=_e("ButtonTemplates",t,s);return N.jsx("ul",{className:"file-info",children:e.map((o,c)=>{const{name:l,size:u,type:m}=o,_=()=>n(c);return N.jsxs("li",{children:[N.jsx(qi,{children:i($e.FilesInfo,[l,m,String(u)])}),r&&N.jsx(X_,{fileInfo:o,registry:t}),N.jsx(a,{onClick:_,registry:t})]},c)})})}function Q_(e){const{disabled:t,readonly:r,required:n,multiple:s,onChange:i,value:a,options:o,registry:c}=e,{filesInfo:l,handleChange:u,handleRemove:m}=z0(a,i,s),_=_e("BaseInputTemplate",c,o),v=S=>{S.target.files&&u(S.target.files)};return N.jsxs("div",{children:[N.jsx(_,{...e,disabled:t||r,type:"file",required:a?!1:n,onChangeOverride:v,value:"",accept:o.accept?String(o.accept):void 0}),N.jsx(Z_,{filesInfo:l,onRemove:m,registry:c,preview:o.filePreview,options:o})]})}function eS({id:e,value:t,htmlName:r}){return N.jsx("input",{type:"hidden",id:e,name:r||e,value:typeof t>"u"?"":t})}function tS(e){const{options:t,registry:r}=e,n=_e("BaseInputTemplate",r,t);return N.jsx(n,{type:"password",...e})}function rS({options:e,value:t,required:r,disabled:n,readonly:s,autofocus:i=!1,onBlur:a,onFocus:o,onChange:c,id:l,htmlName:u}){const{enumOptions:m,enumDisabled:_,inline:v,emptyValue:S}=e,E=Zc(e),g=X.useCallback(({target:f})=>a(l,Cn(f?.value,m,E,S)),[a,m,S,l,E]),y=X.useCallback(({target:f})=>o(l,Cn(f?.value,m,E,S)),[o,m,S,l,E]);return N.jsx("div",{className:"field-radio-group",id:l,role:"radiogroup",children:Array.isArray(m)&&m.map((f,C)=>{const P=Wa(f.value,t),h=Array.isArray(_)&&_.includes(f.value),b=n||h||s?"disabled":"",O=()=>c(f.value),k=N.jsxs("span",{children:[N.jsx("input",{type:"radio",id:_m(l,C),checked:P,name:u||l,required:r,value:Xc(f.value,C,E),disabled:n||h||s,autoFocus:i&&C===0,onChange:O,onBlur:g,onFocus:y,"aria-describedby":$n(l)}),N.jsx("span",{children:f.label})]});return v?N.jsx("label",{className:`radio-inline ${b}`,children:k},String(f.value)):N.jsx("div",{className:`radio ${b}`,children:N.jsx("label",{children:k})},String(f.value))})})}function nS(e){const{value:t,registry:{templates:{BaseInputTemplate:r}}}=e;return N.jsxs("div",{className:"field-range-wrapper",children:[N.jsx(r,{type:"range",...e}),N.jsx("span",{className:"range-view",children:t})]})}function iS({id:e,value:t,required:r,disabled:n,readonly:s,onChange:i,onFocus:a,onBlur:o,schema:c,options:l,htmlName:u}){const{stars:m=5,shape:_="star"}=l,v=c.maximum?Math.min(c.maximum,5):Math.min(Math.max(m,1),5),S=c.minimum||0,E=X.useCallback(C=>{!n&&!s&&i(C)},[i,n,s]),g=X.useCallback(C=>{if(a){const P=Number(C.target.dataset.value);a(e,P)}},[a,e]),y=X.useCallback(C=>{if(o){const P=Number(C.target.dataset.value);o(e,P)}},[o,e]),f=C=>_==="heart"?C?"♥":"♡":C?"★":"☆";return N.jsxs("div",{className:"rating-widget",style:{display:"inline-flex",fontSize:"1.5rem",cursor:n||s?"default":"pointer"},children:[[...Array(v)].map((C,P)=>{const h=S+P,b=h<=t;return N.jsx("span",{onClick:()=>E(h),onKeyDown:O=>(O.key==="Enter"||O.key===" ")&&E(h),onFocus:g,onBlur:y,"data-value":h,tabIndex:n||s?-1:0,role:"radio","aria-checked":h===t,"aria-label":`${h} ${_==="heart"?"heart":"star"}${h===1?"":"s"}`,style:{color:b?"#FFD700":"#ccc",padding:"0 0.2rem",transition:"color 0.2s",userSelect:"none"},children:f(b)},P)}),N.jsx("input",{type:"hidden",id:e,name:u||e,value:t||"",required:r,disabled:n||s,"aria-hidden":"true"})]})}function zo(e,t){return t?Array.from(e.target.options).slice().filter(r=>r.selected).map(r=>r.value):e.target.value}function sS({schema:e,id:t,options:r,value:n,required:s,disabled:i,readonly:a,multiple:o=!1,autofocus:c=!1,onChange:l,onBlur:u,onFocus:m,placeholder:_,htmlName:v,registry:S,uiSchema:E}){const{enumOptions:g,enumDisabled:y,emptyValue:f}=r,C=o?[]:"",P=Zc(r),h=X.useCallback(M=>{const q=zo(M,o);return m(t,Cn(q,g,P,f))},[m,t,o,g,f,P]),b=X.useCallback(M=>{const q=zo(M,o);return u(t,Cn(q,g,P,f))},[u,t,o,g,f,P]),O=X.useCallback(M=>{const q=zo(M,o);return l(Cn(q,g,P,f))},[l,o,g,f,P]),k=p0(n,g,o,P,C),$=!o&&e.default===void 0;return k0(t,e,g,o),N.jsxs(N.Fragment,{children:[N.jsx(R0,{id:t,multiple:o,options:r,registry:S,uiSchema:E,value:n}),N.jsxs("select",{id:t,name:v||t,multiple:o,className:"form-control",value:k,required:s,disabled:i||a,autoFocus:c,onBlur:b,onFocus:h,onChange:O,"aria-describedby":$n(t),children:[$&&N.jsx("option",{value:"",children:_}),Array.isArray(g)&&g.map(({value:M,label:q},L)=>{const U=y&&y.includes(M);return N.jsx("option",{value:Xc(M,L,P),disabled:U,children:q},String(M))})]})]})}function aS({id:e,options:t,placeholder:r,value:n,required:s,disabled:i,readonly:a,autofocus:o=!1,onChange:c,onBlur:l,onFocus:u,htmlName:m}){const _=X.useCallback(({target:{value:E}})=>c(E===""?t.emptyValue:E),[c,t.emptyValue]),v=X.useCallback(({target:E})=>l(e,E?.value),[l,e]),S=X.useCallback(({target:E})=>u(e,E?.value),[e,u]);return N.jsx("textarea",{id:e,name:m||e,className:"form-control",value:n||"",placeholder:r,required:s,disabled:i,readOnly:a,autoFocus:o,rows:t.rows,onBlur:v,onFocus:S,onChange:_,"aria-describedby":$n(e)})}function oS(e){const{options:t,registry:r}=e,n=_e("BaseInputTemplate",r,t);return N.jsx(n,{...e})}function cS(e){const{onChange:t,options:r,registry:n,schema:s,value:i}=e,a=_e("BaseInputTemplate",n,r),o=typeof s.multipleOf=="number"&&Number.isFinite(s.multipleOf)&&s.multipleOf<60,c=X.useCallback(u=>{t(u?o?u:`${u}:00`:void 0)},[o,t]),l=typeof i=="string"&&!o&&/^\d{2}:\d{2}:00$/.test(i)?i.slice(0,-3):i;return N.jsx(a,{type:"time",...e,value:l,onChange:c})}function lS(e){const{options:t,registry:r}=e,n=_e("BaseInputTemplate",r,t);return N.jsx(n,{type:"number",...e})}function uS(e){const{options:t,registry:r}=e,n=_e("BaseInputTemplate",r,t);return N.jsx(n,{type:"url",...e})}function dS(){return{AltDateWidget:B_,AltDateTimeWidget:z_,CheckboxWidget:K_,CheckboxesWidget:H_,ColorWidget:G_,DateWidget:J_,DateTimeWidget:W_,EmailWidget:Y_,FileWidget:Q_,HiddenWidget:eS,PasswordWidget:tS,RadioWidget:rS,RangeWidget:nS,RatingWidget:iS,SelectWidget:sS,TextWidget:oS,TextareaWidget:aS,TimeWidget:cS,UpDownWidget:lS,URLWidget:uS}}function fS(){return{fields:i_(),templates:V_(),widgets:dS(),rootSchema:{},formContext:{},translateString:h0,globalFormOptions:{idPrefix:qh,idSeparator:Uh,useFallbackUiForUnsupportedType:!1}}}function Ln(e,t){const{schema:r,uiSchema:n,fieldPathId:s,schemaUtils:i,formData:a,edit:o,errors:c,errorSchema:l}=e;return{schema:r,uiSchema:n,fieldPathId:s,schemaUtils:i,formData:a,edit:o,errors:c,errorSchema:l,...t!==void 0&&{status:t}}}class Vr extends X.Component{formElement;pendingChanges=[];isProcessingUserChange=!1;static getDerivedStateFromProps(t,r){if(t.extraErrors!==r.prevExtraErrors){const n={errors:r.schemaValidationErrors||[],errorSchema:r.schemaValidationErrorSchema||{}};let{errors:s,errorSchema:i}=n;return t.extraErrors&&({errors:s,errorSchema:i}=Pi(n,t.extraErrors)),r.customErrors&&({errors:s,errorSchema:i}=Pi({errors:s,errorSchema:i},r.customErrors.ErrorSchema,!0)),{prevExtraErrors:t.extraErrors,errors:s,errorSchema:i}}return null}constructor(t){if(super(t),!t.validator)throw new Error("A validator is required for Form functionality to work");const{formData:r,initialFormData:n,onChange:s}=t,i=r??n;this.state={...this.getStateFromProps(t,i,void 0,void 0,void 0,!0),prevExtraErrors:t.extraErrors},s&&!je(this.state.formData,i)&&s(Ln(this.state)),this.formElement=X.createRef()}getSnapshotBeforeUpdate(t,r){if(!je(this.props,t)){const n=Ea(this.props.formData,t.formData),s=Ea(this.props.formData,this.state.formData),i=!je(t.schema,this.props.schema),a=n.length>0||!je(t.formData,this.props.formData),o=s.length>0||!je(this.state.formData,this.props.formData),c=this.getStateFromProps(this.props,this.props.formData,i||a?void 0:this.state.retrievedSchema,i,()=>Ea(this.props.formData,t.formData,!0),!o),l=!je(c,r);return{nextState:c,shouldUpdate:l}}return{shouldUpdate:!1}}componentDidUpdate(t,r,n){if(n.shouldUpdate){const{nextState:s}=n,i=!je(s.formData,this.props.formData),a=this.isProcessingUserChange;if(this.isProcessingUserChange=!1,a&&i)return;i&&!je(s.formData,r.formData)&&this.props.onChange&&this.props.onChange(Ln(s)),this.setState(s)}}getStateFromProps(t,r,n,s=!1,i=()=>[],a=!1,o=!1){const c=this.state||{},l="schema"in t?t.schema:this.props.schema,u="validator"in t?t.validator:this.props.validator,m=("uiSchema"in t?t.uiSchema:this.props.uiSchema)||{},_=t.formData===void 0&&this.props.formData===void 0,v=typeof r<"u",S="liveValidate"in t?t.liveValidate:this.props.liveValidate,E=v&&!t.noValidate&&S,g="experimental_defaultFormStateBehavior"in t?t.experimental_defaultFormStateBehavior:this.props.experimental_defaultFormStateBehavior,y="experimental_customMergeAllOf"in t?t.experimental_customMergeAllOf:this.props.experimental_customMergeAllOf;let{schemaUtils:f}=c;(!f||f.doesSchemaUtilsDiffer(u,l,g,y))&&(f=u0(u,l,g,y));const C=f.getRootSchema();let P=r;r===ed?P=void 0:r===void 0&&_&&(P=c.formData);let h,b,O=!1;const k=[];do{h=f.getDefaultFormState(C,P,!1,c.initialDefaultsGenerated);const Z=o?zt({formData:h}):"";if(b=this.updateRetrievedSchema(n??f.retrieveSchema(C,h)),o&&!k.includes(Z)&&!je(b,c.retrievedSchema)){const re=f.sanitizeDataForNewSchema(b,c.retrievedSchema,h);if(O=!je(re,h),O){h=re,P=re;const A=zt({formData:re});O=!k.includes(A),k.push(A)}k.push(Z)}else O=!1}while(O);const $=()=>t.noValidate||s?{errors:[],errorSchema:{}}:t.liveValidate?{errors:c.errors||[],errorSchema:c.errorSchema||{}}:{errors:c.schemaValidationErrors||[],errorSchema:c.schemaValidationErrorSchema||{}};let M,q,{schemaValidationErrors:L,schemaValidationErrorSchema:U}=c;if(E&&!a){const Z=this.liveValidate(C,f,c.errorSchema,h,void 0,c.customErrors,n,n!==void 0);M=Z.errors,q=Z.errorSchema,L=Z.schemaValidationErrors,U=Z.schemaValidationErrorSchema}else{const Z=$();if(M=Z.errors,q=Z.errorSchema,!E){const A=i();if(A.length>0){const w=A.reduce((j,p)=>{const d=rr(p);for(let x=1;x<d.length;x++)at(j,[...d.slice(0,x),vt],void 0,!0);return at(j,d,void 0,!0)},{});U=Xr(Z.errorSchema,w,"preventDuplicates"),q=U}}const re=Vr.mergeErrors({errorSchema:q,errors:M},t.extraErrors,c.customErrors);M=re.errors,q=re.errorSchema}const B=Vr.getRegistry(t,C,f),W=je(c.registry,B)?c.registry:B,Y=c.fieldPathId&&c.fieldPathId?.[Ue]===W.globalFormOptions.idPrefix?c.fieldPathId:nr("",W.globalFormOptions);return{schemaUtils:f,schema:C,uiSchema:m,fieldPathId:Y,formData:h,edit:v,errors:M,errorSchema:q,schemaValidationErrors:L,schemaValidationErrorSchema:U,retrievedSchema:b,initialDefaultsGenerated:!0,registry:W}}shouldComponentUpdate(t,r){const{experimental_componentUpdateStrategy:n="customDeep"}=this.props;return $0(this,t,r,n)}validate(t,r=this.state.schema,n,s){const i=n||this.state.schemaUtils,{customValidate:a,transformErrors:o,uiSchema:c}=this.props,l=s??r,u=t?JSON.parse(JSON.stringify(t)):void 0;return i.getValidator().validateFormData(u,l,a,o,c)}renderErrors(t){const{errors:r,errorSchema:n,schema:s,uiSchema:i}=this.state,a=pe(i),o=_e("ErrorListTemplate",t,a);return r?.length?N.jsx(o,{errors:r,errorSchema:n||{},schema:s,uiSchema:i,registry:t}):null}static mergeErrors(t,r,n){let{errorSchema:s,errors:i}=t;if(r){const a=Pi(t,r);s=a.errorSchema,i=a.errors}if(n){const a=Pi({errors:i,errorSchema:s},n.ErrorSchema,!0);s=a.errorSchema,i=a.errors}return{errors:i,errorSchema:s}}liveValidate(t,r,n,s,i,a,o,c=!1){const l=this.validate(s,t,r,o),{errors:u}=l;let{errorSchema:m}=l;c&&(m=Xr(n,l.errorSchema,"preventDuplicates"));const _=u,v=m;return{...Vr.mergeErrors({errorSchema:m,errors:u},i,a),schemaValidationErrors:_,schemaValidationErrorSchema:v}}getUsedFormData=(t,r)=>n0(t,r);getFieldNames=(t,r)=>i0(t,r);omitExtraData=t=>{const{schema:r,schemaUtils:n}=this.state;return n.omitExtraData(r,t)};setFieldValue=(t,r)=>{const{registry:n}=this.state,s=Array.isArray(t)?t:t.split("."),i=nr("",n.globalFormOptions,s);this.onChange(r,s,void 0,i[Ue])};onChange=(t,r,n,s)=>{this.pendingChanges.push({newValue:t,path:r,newErrorSchema:n,id:s}),this.pendingChanges.length===1&&this.processPendingChange()};processPendingChange(){if(this.pendingChanges.length===0)return;this.isProcessingUserChange=!0;const{newValue:t,path:r,id:n}=this.pendingChanges[0],{newErrorSchema:s}=this.pendingChanges[0],{extraErrors:i,omitExtraData:a,liveOmit:o,noValidate:c,liveValidate:l,onChange:u,disabled:m,readonly:_}=this.props,{formData:v,schemaUtils:S,schema:E,fieldPathId:g,schemaValidationErrorSchema:y,errors:f}=this.state;let{customErrors:C,retrievedSchema:P}=this.state,h=y;const b=g.path[0]||"",O=!r||r.length===0||r.length===1&&r[0]===b;let k=O?t:structuredClone(v);const $=ue(k)&&Object.keys(k).length>0&&Object.values(k).every(W=>W===void 0),M=v==null,q=$&&M?void 0:k;if(ue(k)||Array.isArray(k)){let W=!1;if(t===Lm)fg(k,r);else if(!O){let Z=t;if(t===void 0)if(typeof r[r.length-1]=="number")Z=null;else{const{field:A}=S.findFieldInSchema(E,r,v),w=A;!(w&&(Se in w||Ie in w))&&w!==void 0&&(W=!0)}W?at(k,r,void 0):at(k,r,Z)}const Y=P&&!O&&!ue(t)&&!Array.isArray(t)&&!m&&!_,Q=this.getStateFromProps(this.props,q,void 0,void 0,void 0,!0,Y);k=Q.formData,P=Q.retrievedSchema,W&&k&&at(k,r,void 0)}const L=!c&&(l===!0||l==="onChange");let U={formData:k,retrievedSchema:P},B=k;if(a===!0&&(o===!0||o==="onChange")&&(B=this.omitExtraData(k),U={...U,formData:B}),s){const W=O?y:me(y,r);if(W&&Object.keys(W).length>0)O?h=s:(h=structuredClone(y),at(h,r,s,!0));else if(C||(C=new pm),O){const Y=s[vt];Y&&C.setErrors(Y)}else at(C.ErrorSchema,r,s,!0)}else C&&me(C.ErrorSchema,[...r,vt])&&C.clearErrors(r);if(L&&this.pendingChanges.length===1){const W=this.liveValidate(E,S,h,B,i,C,P);U={...U,formData:B,...W,customErrors:C}}else if(!c&&s){const W=Vr.mergeErrors({errorSchema:h,errors:f},i,C);U={...U,formData:B,...W,customErrors:C}}this.setState(U,()=>{u&&u(Ln({...this.state,...U}),n),this.pendingChanges.shift(),this.processPendingChange()})}updateRetrievedSchema(t){return je(t,this.state?.retrievedSchema)?this.state.retrievedSchema:t}reset=()=>{const{formData:t,initialFormData:r=ed,onChange:n}=this.props,a={formData:this.getStateFromProps(this.props,t??r,void 0,void 0,void 0,!0).formData,errorSchema:{},errors:[],schemaValidationErrors:[],schemaValidationErrorSchema:{},initialDefaultsGenerated:!1,customErrors:void 0};this.setState(a,()=>n?.(Ln({...this.state,...a})))};onBlur=(t,r)=>{const{onBlur:n,omitExtraData:s,liveOmit:i,liveValidate:a}=this.props;if(n&&n(t,r),s===!0&&i==="onBlur"||a==="onBlur"){const{onChange:o,extraErrors:c}=this.props,{formData:l}=this.state;let u=l,m={formData:u};if(s===!0&&i==="onBlur"&&(u=this.omitExtraData(l),m={formData:u}),a==="onBlur"){const{schema:v,schemaUtils:S,errorSchema:E,customErrors:g,retrievedSchema:y}=this.state,f=this.liveValidate(v,S,E,u,c,g,y);m={formData:u,...f,customErrors:g}}const _=Object.keys(m).filter(v=>!v.startsWith("schemaValidation")).some(v=>{const S=this.state[v],E=m[v];return!je(S,E)});this.setState(m,()=>{o&&_&&o(Ln({...this.state,...m}),t)})}};onFocus=(t,r)=>{const{onFocus:n}=this.props;n&&n(t,r)};onSubmit=t=>{if(t.preventDefault(),t.target!==t.currentTarget)return;t.persist();const{omitExtraData:r,extraErrors:n,noValidate:s,onSubmit:i}=this.props;let{formData:a}=this.state;if(r===!0&&(a=this.omitExtraData(a)),s||this.validateFormWithFormData(a)){const o=n||{},c=n?Sm(n):[];this.setState({formData:a,errors:c,errorSchema:o,schemaValidationErrors:[],schemaValidationErrorSchema:{}},()=>{i&&i(Ln({...this.state,formData:a},"submitted"),t)})}};static getGlobalFormOptions(t){const{uiSchema:r={},experimental_componentUpdateStrategy:n,idSeparator:s=Uh,idPrefix:i=qh,nameGenerator:a,useFallbackUiForUnsupportedType:o=!1}=t;return{idPrefix:r["ui:rootFieldId"]||i,idSeparator:s,useFallbackUiForUnsupportedType:o,...n!==void 0&&{experimental_componentUpdateStrategy:n},...a!==void 0&&{nameGenerator:a}}}static getRegistry(t,r,n){const{translateString:s,uiSchema:i={}}=t,{fields:a,templates:o,widgets:c,formContext:l,translateString:u}=fS();return{fields:{...a,...t.fields},templates:{...o,...t.templates,ButtonTemplates:{...o.ButtonTemplates,...t.templates?.ButtonTemplates}},widgets:{...c,...t.widgets},rootSchema:r,formContext:t.formContext||l,schemaUtils:n,translateString:s||u,globalUiOptions:i[pc],globalFormOptions:Vr.getGlobalFormOptions(t),uiSchemaDefinitions:i[Ry]??{}}}submit=()=>{if(this.formElement.current){const t=new CustomEvent("submit",{cancelable:!0});t.preventDefault(),this.formElement.current.dispatchEvent(t),this.formElement.current.requestSubmit()}};focusOnError(t){const{idPrefix:r="root",idSeparator:n="_"}=this.props,{property:s}=t,i=rr(s??"");i.unshift(r);const a=i.join(n);let o=this.formElement.current.elements[a];o||(o=this.formElement.current.querySelector(`input[id^="${a}"], button[id^="${a}"]`)),o?.length&&(o=o[0]),o&&o.focus()}validateFormWithFormData=t=>{const{extraErrors:r,extraErrorsBlockSubmit:n,focusOnFirstError:s,onError:i}=this.props,{errors:a}=this.state,o=this.validate(t),{errors:c,errorSchema:l}=r?Vr.mergeErrors(o,r):o,u=o.errors.length>0||r&&n;return u?(s&&(typeof s=="function"?s(c[0]):this.focusOnError(c[0])),this.setState({errors:c,errorSchema:l,schemaValidationErrors:o.errors,schemaValidationErrorSchema:o.errorSchema},()=>{i?i(c):console.error("Form validation failed",c)})):c.length>0?this.setState({errors:c,errorSchema:l,schemaValidationErrors:[],schemaValidationErrorSchema:{}}):a.length>0&&this.setState({errors:[],errorSchema:{},schemaValidationErrors:[],schemaValidationErrorSchema:{}}),!u};validateForm(){const{omitExtraData:t}=this.props;let{formData:r}=this.state;return t===!0&&(r=this.omitExtraData(r)),this.validateFormWithFormData(r)}render(){const{children:t,id:r,className:n="",tagName:s,name:i,method:a,target:o,action:c,autoComplete:l,enctype:u,acceptCharset:m,noHtml5Validate:_=!1,disabled:v,readonly:S,showErrorList:E="top",_internalFormWrapper:g}=this.props,{schema:y,uiSchema:f,formData:C,errorSchema:P,fieldPathId:h,registry:b}=this.state,{SchemaField:O}=b.fields,{SubmitButton:k}=b.templates.ButtonTemplates,$=g?s:void 0,M=g||s||"form";let{[ka]:q={}}=pe(f);v&&(q={...q,props:{...q.props,disabled:!0}});const L={[Br]:{[ka]:q}};return N.jsxs(M,{className:n||"rjsf",id:r,name:i,method:a,target:o,action:c,autoComplete:l,encType:u,acceptCharset:m,noValidate:_,onSubmit:this.onSubmit,as:$,ref:this.formElement,children:[E==="top"&&this.renderErrors(b),N.jsx(O,{name:"",schema:y,uiSchema:f,errorSchema:P,fieldPathId:h,formData:C,onChange:this.onChange,onBlur:this.onBlur,onFocus:this.onFocus,registry:b,disabled:v,readonly:S}),t||N.jsx(k,{uiSchema:L,registry:b}),E==="bottom"&&this.renderErrors(b)]})}}function hS(e,t="none"){return t==="all"?e:e.reduce((r,n)=>{const{message:s,schemaPath:i}=n,a=t!=="anyOf"?i?.indexOf(`/${Ie}/`):void 0,o=t!=="oneOf"?i?.indexOf(`/${Se}/`):void 0;let c;return a&&a>=0?c=i?.substring(0,a):o&&o>=0&&(c=i?.substring(0,o)),(c?r.find(u=>u.message===s&&u.schemaPath?.startsWith(c)):void 0)||r.push(n),r},[])}function mS(e=[],t,r,n){const s=e.map(i=>{const{instancePath:a,keyword:o,params:c,schemaPath:l,parentSchema:u,...m}=i;let{message:_=""}=m,v=a.replace(/\//g,"."),S=`${v} ${_}`.trim(),E="";const g=[...c.deps?.split(", ")||[],c.missingProperty,c.property].filter(y=>y);if(g.length>0)g.forEach(y=>{const f=v?`${v}.${y}`:y;let C=pe(me(t,rr(f))).title;if(C===void 0){const P=l.replace(/\/properties\//g,"/").split("/").slice(1,-1).concat([y]);C=pe(me(t,P)).title}if(C===void 0){const P=v.replace(/^\./,"").split(".").filter(Boolean);C=me(t,[...P,y,"title"])}if(C)_=_.replace(`'${y}'`,`'${C}'`),E=C;else{const P=me(u,[nt,y,"title"]);if(P)_=_.replace(`'${y}'`,`'${P}'`),E=P;else if(n){const h=v.replace(/^\./,"").split(".").filter(Boolean),b=[];for(const k of h)b.push(nt,k);b.push(nt,y,"title");const O=me(n,b);O&&(_=_.replace(`'${y}'`,`'${O}'`),E=O)}}}),S=_;else{const y=pe(me(t,rr(v))).title;if(y)S=`'${y}' ${_}`.trim(),E=y;else{const f=u?.title;f&&(S=`'${f}' ${_}`.trim(),E=f)}}return"missingProperty"in c&&(v=v?`${v}.${c.missingProperty}`:c.missingProperty),{name:o,property:v,message:_,params:c,stack:S,schemaPath:l,title:E}});return hS(s,r)}function pS(e,t,r,n,s,i,a,o){const{validationError:c}=t;let l=mS(t.errors,a,o,n);c&&(l=[...l,{stack:c.message}]),typeof i=="function"&&(l=i(l,a));let u=F0(l);if(c&&(u={...u,$schema:{__errors:[c.message]}}),typeof s!="function")return{errors:l,errorSchema:u};const m=cm(e,n,r,n,!0),_=s(m,yc(m),a,u),v=D0(_);return Pi({errors:l,errorSchema:u},v)}var Yi={exports:{}},Bo={},Sr={},hn={},Ho={},Ko={},Go={},rd;function La(){return rd||(rd=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;class t{}e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class r extends t{constructor(f){if(super(),!e.IDENTIFIER.test(f))throw new Error("CodeGen: name must be a valid identifier");this.str=f}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=r;class n extends t{constructor(f){super(),this._items=typeof f=="string"?[f]:f}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const f=this._items[0];return f===""||f==='""'}get str(){var f;return(f=this._str)!==null&&f!==void 0?f:this._str=this._items.reduce((C,P)=>`${C}${P}`,"")}get names(){var f;return(f=this._names)!==null&&f!==void 0?f:this._names=this._items.reduce((C,P)=>(P instanceof r&&(C[P.str]=(C[P.str]||0)+1),C),{})}}e._Code=n,e.nil=new n("");function s(y,...f){const C=[y[0]];let P=0;for(;P<f.length;)o(C,f[P]),C.push(y[++P]);return new n(C)}e._=s;const i=new n("+");function a(y,...f){const C=[v(y[0])];let P=0;for(;P<f.length;)C.push(i),o(C,f[P]),C.push(i,v(y[++P]));return c(C),new n(C)}e.str=a;function o(y,f){f instanceof n?y.push(...f._items):f instanceof r?y.push(f):y.push(m(f))}e.addCodeArg=o;function c(y){let f=1;for(;f<y.length-1;){if(y[f]===i){const C=l(y[f-1],y[f+1]);if(C!==void 0){y.splice(f-1,3,C);continue}y[f++]="+"}f++}}function l(y,f){if(f==='""')return y;if(y==='""')return f;if(typeof y=="string")return f instanceof r||y[y.length-1]!=='"'?void 0:typeof f!="string"?`${y.slice(0,-1)}${f}"`:f[0]==='"'?y.slice(0,-1)+f.slice(1):void 0;if(typeof f=="string"&&f[0]==='"'&&!(y instanceof r))return`"${y}${f.slice(1)}`}function u(y,f){return f.emptyStr()?y:y.emptyStr()?f:a`${y}${f}`}e.strConcat=u;function m(y){return typeof y=="number"||typeof y=="boolean"||y===null?y:v(Array.isArray(y)?y.join(","):y)}function _(y){return new n(v(y))}e.stringify=_;function v(y){return JSON.stringify(y).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=v;function S(y){return typeof y=="string"&&e.IDENTIFIER.test(y)?new n(`.${y}`):s`[${y}]`}e.getProperty=S;function E(y){if(typeof y=="string"&&e.IDENTIFIER.test(y))return new n(`${y}`);throw new Error(`CodeGen: invalid export name: ${y}, use explicit $id name mapping`)}e.getEsmExportName=E;function g(y){return new n(y.toString())}e.regexpCode=g})(Go)),Go}var Wo={},nd;function id(){return nd||(nd=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const t=La();class r extends Error{constructor(l){super(`CodeGen: "code" for ${l} not defined`),this.value=l.value}}var n;(function(c){c[c.Started=0]="Started",c[c.Completed=1]="Completed"})(n||(e.UsedValueState=n={})),e.varKinds={const:new t.Name("const"),let:new t.Name("let"),var:new t.Name("var")};class s{constructor({prefixes:l,parent:u}={}){this._names={},this._prefixes=l,this._parent=u}toName(l){return l instanceof t.Name?l:this.name(l)}name(l){return new t.Name(this._newName(l))}_newName(l){const u=this._names[l]||this._nameGroup(l);return`${l}${u.index++}`}_nameGroup(l){var u,m;if(!((m=(u=this._parent)===null||u===void 0?void 0:u._prefixes)===null||m===void 0)&&m.has(l)||this._prefixes&&!this._prefixes.has(l))throw new Error(`CodeGen: prefix "${l}" is not allowed in this scope`);return this._names[l]={prefix:l,index:0}}}e.Scope=s;class i extends t.Name{constructor(l,u){super(u),this.prefix=l}setValue(l,{property:u,itemIndex:m}){this.value=l,this.scopePath=(0,t._)`.${new t.Name(u)}[${m}]`}}e.ValueScopeName=i;const a=(0,t._)`\n`;class o extends s{constructor(l){super(l),this._values={},this._scope=l.scope,this.opts={...l,_n:l.lines?a:t.nil}}get(){return this._scope}name(l){return new i(l,this._newName(l))}value(l,u){var m;if(u.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const _=this.toName(l),{prefix:v}=_,S=(m=u.key)!==null&&m!==void 0?m:u.ref;let E=this._values[v];if(E){const f=E.get(S);if(f)return f}else E=this._values[v]=new Map;E.set(S,_);const g=this._scope[v]||(this._scope[v]=[]),y=g.length;return g[y]=u.ref,_.setValue(u,{property:v,itemIndex:y}),_}getValue(l,u){const m=this._values[l];if(m)return m.get(u)}scopeRefs(l,u=this._values){return this._reduceValues(u,m=>{if(m.scopePath===void 0)throw new Error(`CodeGen: name "${m}" has no value`);return(0,t._)`${l}${m.scopePath}`})}scopeCode(l=this._values,u,m){return this._reduceValues(l,_=>{if(_.value===void 0)throw new Error(`CodeGen: name "${_}" has no value`);return _.value.code},u,m)}_reduceValues(l,u,m={},_){let v=t.nil;for(const S in l){const E=l[S];if(!E)continue;const g=m[S]=m[S]||new Map;E.forEach(y=>{if(g.has(y))return;g.set(y,n.Started);let f=u(y);if(f){const C=this.opts.es5?e.varKinds.var:e.varKinds.const;v=(0,t._)`${v}${C} ${y} = ${f};${this.opts._n}`}else if(f=_?.(y))v=(0,t._)`${v}${f}${this.opts._n}`;else throw new r(y);g.set(y,n.Completed)})}return v}}e.ValueScope=o})(Wo)),Wo}var sd;function Re(){return sd||(sd=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;const t=La(),r=id();var n=La();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return n.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return n.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return n.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return n.Name}});var s=id();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return s.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return s.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return s.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return s.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};class i{optimizeNodes(){return this}optimizeNames(d,x){return this}}class a extends i{constructor(d,x,I){super(),this.varKind=d,this.name=x,this.rhs=I}render({es5:d,_n:x}){const I=d?r.varKinds.var:this.varKind,T=this.rhs===void 0?"":` = ${this.rhs}`;return`${I} ${this.name}${T};`+x}optimizeNames(d,x){if(d[this.name.str])return this.rhs&&(this.rhs=B(this.rhs,d,x)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class o extends i{constructor(d,x,I){super(),this.lhs=d,this.rhs=x,this.sideEffects=I}render({_n:d}){return`${this.lhs} = ${this.rhs};`+d}optimizeNames(d,x){if(!(this.lhs instanceof t.Name&&!d[this.lhs.str]&&!this.sideEffects))return this.rhs=B(this.rhs,d,x),this}get names(){const d=this.lhs instanceof t.Name?{}:{...this.lhs.names};return U(d,this.rhs)}}class c extends o{constructor(d,x,I,T){super(d,I,T),this.op=x}render({_n:d}){return`${this.lhs} ${this.op}= ${this.rhs};`+d}}class l extends i{constructor(d){super(),this.label=d,this.names={}}render({_n:d}){return`${this.label}:`+d}}class u extends i{constructor(d){super(),this.label=d,this.names={}}render({_n:d}){return`break${this.label?` ${this.label}`:""};`+d}}class m extends i{constructor(d){super(),this.error=d}render({_n:d}){return`throw ${this.error};`+d}get names(){return this.error.names}}class _ extends i{constructor(d){super(),this.code=d}render({_n:d}){return`${this.code};`+d}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(d,x){return this.code=B(this.code,d,x),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class v extends i{constructor(d=[]){super(),this.nodes=d}render(d){return this.nodes.reduce((x,I)=>x+I.render(d),"")}optimizeNodes(){const{nodes:d}=this;let x=d.length;for(;x--;){const I=d[x].optimizeNodes();Array.isArray(I)?d.splice(x,1,...I):I?d[x]=I:d.splice(x,1)}return d.length>0?this:void 0}optimizeNames(d,x){const{nodes:I}=this;let T=I.length;for(;T--;){const F=I[T];F.optimizeNames(d,x)||(W(d,F.names),I.splice(T,1))}return I.length>0?this:void 0}get names(){return this.nodes.reduce((d,x)=>L(d,x.names),{})}}class S extends v{render(d){return"{"+d._n+super.render(d)+"}"+d._n}}class E extends v{}class g extends S{}g.kind="else";class y extends S{constructor(d,x){super(x),this.condition=d}render(d){let x=`if(${this.condition})`+super.render(d);return this.else&&(x+="else "+this.else.render(d)),x}optimizeNodes(){super.optimizeNodes();const d=this.condition;if(d===!0)return this.nodes;let x=this.else;if(x){const I=x.optimizeNodes();x=this.else=Array.isArray(I)?new g(I):I}if(x)return d===!1?x instanceof y?x:x.nodes:this.nodes.length?this:new y(Y(d),x instanceof y?[x]:x.nodes);if(!(d===!1||!this.nodes.length))return this}optimizeNames(d,x){var I;if(this.else=(I=this.else)===null||I===void 0?void 0:I.optimizeNames(d,x),!!(super.optimizeNames(d,x)||this.else))return this.condition=B(this.condition,d,x),this}get names(){const d=super.names;return U(d,this.condition),this.else&&L(d,this.else.names),d}}y.kind="if";class f extends S{}f.kind="for";class C extends f{constructor(d){super(),this.iteration=d}render(d){return`for(${this.iteration})`+super.render(d)}optimizeNames(d,x){if(super.optimizeNames(d,x))return this.iteration=B(this.iteration,d,x),this}get names(){return L(super.names,this.iteration.names)}}class P extends f{constructor(d,x,I,T){super(),this.varKind=d,this.name=x,this.from=I,this.to=T}render(d){const x=d.es5?r.varKinds.var:this.varKind,{name:I,from:T,to:F}=this;return`for(${x} ${I}=${T}; ${I}<${F}; ${I}++)`+super.render(d)}get names(){const d=U(super.names,this.from);return U(d,this.to)}}class h extends f{constructor(d,x,I,T){super(),this.loop=d,this.varKind=x,this.name=I,this.iterable=T}render(d){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(d)}optimizeNames(d,x){if(super.optimizeNames(d,x))return this.iterable=B(this.iterable,d,x),this}get names(){return L(super.names,this.iterable.names)}}class b extends S{constructor(d,x,I){super(),this.name=d,this.args=x,this.async=I}render(d){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(d)}}b.kind="func";class O extends v{render(d){return"return "+super.render(d)}}O.kind="return";class k extends S{render(d){let x="try"+super.render(d);return this.catch&&(x+=this.catch.render(d)),this.finally&&(x+=this.finally.render(d)),x}optimizeNodes(){var d,x;return super.optimizeNodes(),(d=this.catch)===null||d===void 0||d.optimizeNodes(),(x=this.finally)===null||x===void 0||x.optimizeNodes(),this}optimizeNames(d,x){var I,T;return super.optimizeNames(d,x),(I=this.catch)===null||I===void 0||I.optimizeNames(d,x),(T=this.finally)===null||T===void 0||T.optimizeNames(d,x),this}get names(){const d=super.names;return this.catch&&L(d,this.catch.names),this.finally&&L(d,this.finally.names),d}}class $ extends S{constructor(d){super(),this.error=d}render(d){return`catch(${this.error})`+super.render(d)}}$.kind="catch";class M extends S{render(d){return"finally"+super.render(d)}}M.kind="finally";class q{constructor(d,x={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...x,_n:x.lines?`
`:""},this._extScope=d,this._scope=new r.Scope({parent:d}),this._nodes=[new E]}toString(){return this._root.render(this.opts)}name(d){return this._scope.name(d)}scopeName(d){return this._extScope.name(d)}scopeValue(d,x){const I=this._extScope.value(d,x);return(this._values[I.prefix]||(this._values[I.prefix]=new Set)).add(I),I}getScopeValue(d,x){return this._extScope.getValue(d,x)}scopeRefs(d){return this._extScope.scopeRefs(d,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(d,x,I,T){const F=this._scope.toName(x);return I!==void 0&&T&&(this._constants[F.str]=I),this._leafNode(new a(d,F,I)),F}const(d,x,I){return this._def(r.varKinds.const,d,x,I)}let(d,x,I){return this._def(r.varKinds.let,d,x,I)}var(d,x,I){return this._def(r.varKinds.var,d,x,I)}assign(d,x,I){return this._leafNode(new o(d,x,I))}add(d,x){return this._leafNode(new c(d,e.operators.ADD,x))}code(d){return typeof d=="function"?d():d!==t.nil&&this._leafNode(new _(d)),this}object(...d){const x=["{"];for(const[I,T]of d)x.length>1&&x.push(","),x.push(I),(I!==T||this.opts.es5)&&(x.push(":"),(0,t.addCodeArg)(x,T));return x.push("}"),new t._Code(x)}if(d,x,I){if(this._blockNode(new y(d)),x&&I)this.code(x).else().code(I).endIf();else if(x)this.code(x).endIf();else if(I)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(d){return this._elseNode(new y(d))}else(){return this._elseNode(new g)}endIf(){return this._endBlockNode(y,g)}_for(d,x){return this._blockNode(d),x&&this.code(x).endFor(),this}for(d,x){return this._for(new C(d),x)}forRange(d,x,I,T,F=this.opts.es5?r.varKinds.var:r.varKinds.let){const z=this._scope.toName(d);return this._for(new P(F,z,x,I),()=>T(z))}forOf(d,x,I,T=r.varKinds.const){const F=this._scope.toName(d);if(this.opts.es5){const z=x instanceof t.Name?x:this.var("_arr",x);return this.forRange("_i",0,(0,t._)`${z}.length`,H=>{this.var(F,(0,t._)`${z}[${H}]`),I(F)})}return this._for(new h("of",T,F,x),()=>I(F))}forIn(d,x,I,T=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf(d,(0,t._)`Object.keys(${x})`,I);const F=this._scope.toName(d);return this._for(new h("in",T,F,x),()=>I(F))}endFor(){return this._endBlockNode(f)}label(d){return this._leafNode(new l(d))}break(d){return this._leafNode(new u(d))}return(d){const x=new O;if(this._blockNode(x),this.code(d),x.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(O)}try(d,x,I){if(!x&&!I)throw new Error('CodeGen: "try" without "catch" and "finally"');const T=new k;if(this._blockNode(T),this.code(d),x){const F=this.name("e");this._currNode=T.catch=new $(F),x(F)}return I&&(this._currNode=T.finally=new M,this.code(I)),this._endBlockNode($,M)}throw(d){return this._leafNode(new m(d))}block(d,x){return this._blockStarts.push(this._nodes.length),d&&this.code(d).endBlock(x),this}endBlock(d){const x=this._blockStarts.pop();if(x===void 0)throw new Error("CodeGen: not in self-balancing block");const I=this._nodes.length-x;if(I<0||d!==void 0&&I!==d)throw new Error(`CodeGen: wrong number of nodes: ${I} vs ${d} expected`);return this._nodes.length=x,this}func(d,x=t.nil,I,T){return this._blockNode(new b(d,x,I)),T&&this.code(T).endFunc(),this}endFunc(){return this._endBlockNode(b)}optimize(d=1){for(;d-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(d){return this._currNode.nodes.push(d),this}_blockNode(d){this._currNode.nodes.push(d),this._nodes.push(d)}_endBlockNode(d,x){const I=this._currNode;if(I instanceof d||x&&I instanceof x)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${x?`${d.kind}/${x.kind}`:d.kind}"`)}_elseNode(d){const x=this._currNode;if(!(x instanceof y))throw new Error('CodeGen: "else" without "if"');return this._currNode=x.else=d,this}get _root(){return this._nodes[0]}get _currNode(){const d=this._nodes;return d[d.length-1]}set _currNode(d){const x=this._nodes;x[x.length-1]=d}}e.CodeGen=q;function L(p,d){for(const x in d)p[x]=(p[x]||0)+(d[x]||0);return p}function U(p,d){return d instanceof t._CodeOrName?L(p,d.names):p}function B(p,d,x){if(p instanceof t.Name)return I(p);if(!T(p))return p;return new t._Code(p._items.reduce((F,z)=>(z instanceof t.Name&&(z=I(z)),z instanceof t._Code?F.push(...z._items):F.push(z),F),[]));function I(F){const z=x[F.str];return z===void 0||d[F.str]!==1?F:(delete d[F.str],z)}function T(F){return F instanceof t._Code&&F._items.some(z=>z instanceof t.Name&&d[z.str]===1&&x[z.str]!==void 0)}}function W(p,d){for(const x in d)p[x]=(p[x]||0)-(d[x]||0)}function Y(p){return typeof p=="boolean"||typeof p=="number"||p===null?!p:(0,t._)`!${j(p)}`}e.not=Y;const Q=w(e.operators.AND);function Z(...p){return p.reduce(Q)}e.and=Z;const re=w(e.operators.OR);function A(...p){return p.reduce(re)}e.or=A;function w(p){return(d,x)=>d===t.nil?x:x===t.nil?d:(0,t._)`${j(d)} ${p} ${j(x)}`}function j(p){return p instanceof t.Name?p:(0,t._)`(${p})`}})(Ko)),Ko}var Ce={},ad;function Te(){if(ad)return Ce;ad=1,Object.defineProperty(Ce,"__esModule",{value:!0}),Ce.checkStrictMode=Ce.getErrorPath=Ce.Type=Ce.useFunc=Ce.setEvaluated=Ce.evaluatedPropsToName=Ce.mergeEvaluated=Ce.eachItem=Ce.unescapeJsonPointer=Ce.escapeJsonPointer=Ce.escapeFragment=Ce.unescapeFragment=Ce.schemaRefOrVal=Ce.schemaHasRulesButRef=Ce.schemaHasRules=Ce.checkUnknownRules=Ce.alwaysValidSchema=Ce.toHash=void 0;const e=Re(),t=La();function r(h){const b={};for(const O of h)b[O]=!0;return b}Ce.toHash=r;function n(h,b){return typeof b=="boolean"?b:Object.keys(b).length===0?!0:(s(h,b),!i(b,h.self.RULES.all))}Ce.alwaysValidSchema=n;function s(h,b=h.schema){const{opts:O,self:k}=h;if(!O.strictSchema||typeof b=="boolean")return;const $=k.RULES.keywords;for(const M in b)$[M]||P(h,`unknown keyword: "${M}"`)}Ce.checkUnknownRules=s;function i(h,b){if(typeof h=="boolean")return!h;for(const O in h)if(b[O])return!0;return!1}Ce.schemaHasRules=i;function a(h,b){if(typeof h=="boolean")return!h;for(const O in h)if(O!=="$ref"&&b.all[O])return!0;return!1}Ce.schemaHasRulesButRef=a;function o({topSchemaRef:h,schemaPath:b},O,k,$){if(!$){if(typeof O=="number"||typeof O=="boolean")return O;if(typeof O=="string")return(0,e._)`${O}`}return(0,e._)`${h}${b}${(0,e.getProperty)(k)}`}Ce.schemaRefOrVal=o;function c(h){return m(decodeURIComponent(h))}Ce.unescapeFragment=c;function l(h){return encodeURIComponent(u(h))}Ce.escapeFragment=l;function u(h){return typeof h=="number"?`${h}`:h.replace(/~/g,"~0").replace(/\//g,"~1")}Ce.escapeJsonPointer=u;function m(h){return h.replace(/~1/g,"/").replace(/~0/g,"~")}Ce.unescapeJsonPointer=m;function _(h,b){if(Array.isArray(h))for(const O of h)b(O);else b(h)}Ce.eachItem=_;function v({mergeNames:h,mergeToName:b,mergeValues:O,resultToName:k}){return($,M,q,L)=>{const U=q===void 0?M:q instanceof e.Name?(M instanceof e.Name?h($,M,q):b($,M,q),q):M instanceof e.Name?(b($,q,M),M):O(M,q);return L===e.Name&&!(U instanceof e.Name)?k($,U):U}}Ce.mergeEvaluated={props:v({mergeNames:(h,b,O)=>h.if((0,e._)`${O} !== true && ${b} !== undefined`,()=>{h.if((0,e._)`${b} === true`,()=>h.assign(O,!0),()=>h.assign(O,(0,e._)`${O} || {}`).code((0,e._)`Object.assign(${O}, ${b})`))}),mergeToName:(h,b,O)=>h.if((0,e._)`${O} !== true`,()=>{b===!0?h.assign(O,!0):(h.assign(O,(0,e._)`${O} || {}`),E(h,O,b))}),mergeValues:(h,b)=>h===!0?!0:{...h,...b},resultToName:S}),items:v({mergeNames:(h,b,O)=>h.if((0,e._)`${O} !== true && ${b} !== undefined`,()=>h.assign(O,(0,e._)`${b} === true ? true : ${O} > ${b} ? ${O} : ${b}`)),mergeToName:(h,b,O)=>h.if((0,e._)`${O} !== true`,()=>h.assign(O,b===!0?!0:(0,e._)`${O} > ${b} ? ${O} : ${b}`)),mergeValues:(h,b)=>h===!0?!0:Math.max(h,b),resultToName:(h,b)=>h.var("items",b)})};function S(h,b){if(b===!0)return h.var("props",!0);const O=h.var("props",(0,e._)`{}`);return b!==void 0&&E(h,O,b),O}Ce.evaluatedPropsToName=S;function E(h,b,O){Object.keys(O).forEach(k=>h.assign((0,e._)`${b}${(0,e.getProperty)(k)}`,!0))}Ce.setEvaluated=E;const g={};function y(h,b){return h.scopeValue("func",{ref:b,code:g[b.code]||(g[b.code]=new t._Code(b.code))})}Ce.useFunc=y;var f;(function(h){h[h.Num=0]="Num",h[h.Str=1]="Str"})(f||(Ce.Type=f={}));function C(h,b,O){if(h instanceof e.Name){const k=b===f.Num;return O?k?(0,e._)`"[" + ${h} + "]"`:(0,e._)`"['" + ${h} + "']"`:k?(0,e._)`"/" + ${h}`:(0,e._)`"/" + ${h}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return O?(0,e.getProperty)(h).toString():"/"+u(h)}Ce.getErrorPath=C;function P(h,b,O=h.opts.strictSchema){if(O){if(b=`strict mode: ${b}`,O===!0)throw new Error(b);h.self.logger.warn(b)}}return Ce.checkStrictMode=P,Ce}var Xi={},od;function rn(){if(od)return Xi;od=1,Object.defineProperty(Xi,"__esModule",{value:!0});const e=Re(),t={data:new e.Name("data"),valCxt:new e.Name("valCxt"),instancePath:new e.Name("instancePath"),parentData:new e.Name("parentData"),parentDataProperty:new e.Name("parentDataProperty"),rootData:new e.Name("rootData"),dynamicAnchors:new e.Name("dynamicAnchors"),vErrors:new e.Name("vErrors"),errors:new e.Name("errors"),this:new e.Name("this"),self:new e.Name("self"),scope:new e.Name("scope"),json:new e.Name("json"),jsonPos:new e.Name("jsonPos"),jsonLen:new e.Name("jsonLen"),jsonPart:new e.Name("jsonPart")};return Xi.default=t,Xi}var cd;function Qa(){return cd||(cd=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;const t=Re(),r=Te(),n=rn();e.keywordError={message:({keyword:g})=>(0,t.str)`must pass "${g}" keyword validation`},e.keyword$DataError={message:({keyword:g,schemaType:y})=>y?(0,t.str)`"${g}" keyword must be ${y} ($data)`:(0,t.str)`"${g}" keyword is invalid ($data)`};function s(g,y=e.keywordError,f,C){const{it:P}=g,{gen:h,compositeRule:b,allErrors:O}=P,k=m(g,y,f);C??(b||O)?c(h,k):l(P,(0,t._)`[${k}]`)}e.reportError=s;function i(g,y=e.keywordError,f){const{it:C}=g,{gen:P,compositeRule:h,allErrors:b}=C,O=m(g,y,f);c(P,O),h||b||l(C,n.default.vErrors)}e.reportExtraError=i;function a(g,y){g.assign(n.default.errors,y),g.if((0,t._)`${n.default.vErrors} !== null`,()=>g.if(y,()=>g.assign((0,t._)`${n.default.vErrors}.length`,y),()=>g.assign(n.default.vErrors,null)))}e.resetErrorsCount=a;function o({gen:g,keyword:y,schemaValue:f,data:C,errsCount:P,it:h}){if(P===void 0)throw new Error("ajv implementation error");const b=g.name("err");g.forRange("i",P,n.default.errors,O=>{g.const(b,(0,t._)`${n.default.vErrors}[${O}]`),g.if((0,t._)`${b}.instancePath === undefined`,()=>g.assign((0,t._)`${b}.instancePath`,(0,t.strConcat)(n.default.instancePath,h.errorPath))),g.assign((0,t._)`${b}.schemaPath`,(0,t.str)`${h.errSchemaPath}/${y}`),h.opts.verbose&&(g.assign((0,t._)`${b}.schema`,f),g.assign((0,t._)`${b}.data`,C))})}e.extendErrors=o;function c(g,y){const f=g.const("err",y);g.if((0,t._)`${n.default.vErrors} === null`,()=>g.assign(n.default.vErrors,(0,t._)`[${f}]`),(0,t._)`${n.default.vErrors}.push(${f})`),g.code((0,t._)`${n.default.errors}++`)}function l(g,y){const{gen:f,validateName:C,schemaEnv:P}=g;P.$async?f.throw((0,t._)`new ${g.ValidationError}(${y})`):(f.assign((0,t._)`${C}.errors`,y),f.return(!1))}const u={keyword:new t.Name("keyword"),schemaPath:new t.Name("schemaPath"),params:new t.Name("params"),propertyName:new t.Name("propertyName"),message:new t.Name("message"),schema:new t.Name("schema"),parentSchema:new t.Name("parentSchema")};function m(g,y,f){const{createErrors:C}=g.it;return C===!1?(0,t._)`{}`:_(g,y,f)}function _(g,y,f={}){const{gen:C,it:P}=g,h=[v(P,f),S(g,f)];return E(g,y,h),C.object(...h)}function v({errorPath:g},{instancePath:y}){const f=y?(0,t.str)`${g}${(0,r.getErrorPath)(y,r.Type.Str)}`:g;return[n.default.instancePath,(0,t.strConcat)(n.default.instancePath,f)]}function S({keyword:g,it:{errSchemaPath:y}},{schemaPath:f,parentSchema:C}){let P=C?y:(0,t.str)`${y}/${g}`;return f&&(P=(0,t.str)`${P}${(0,r.getErrorPath)(f,r.Type.Str)}`),[u.schemaPath,P]}function E(g,{params:y,message:f},C){const{keyword:P,data:h,schemaValue:b,it:O}=g,{opts:k,propertyName:$,topSchemaRef:M,schemaPath:q}=O;C.push([u.keyword,P],[u.params,typeof y=="function"?y(g):y||(0,t._)`{}`]),k.messages&&C.push([u.message,typeof f=="function"?f(g):f]),k.verbose&&C.push([u.schema,b],[u.parentSchema,(0,t._)`${M}${q}`],[n.default.data,h]),$&&C.push([u.propertyName,$])}})(Ho)),Ho}var ld;function yS(){if(ld)return hn;ld=1,Object.defineProperty(hn,"__esModule",{value:!0}),hn.boolOrEmptySchema=hn.topBoolOrEmptySchema=void 0;const e=Qa(),t=Re(),r=rn(),n={message:"boolean schema is false"};function s(o){const{gen:c,schema:l,validateName:u}=o;l===!1?a(o,!1):typeof l=="object"&&l.$async===!0?c.return(r.default.data):(c.assign((0,t._)`${u}.errors`,null),c.return(!0))}hn.topBoolOrEmptySchema=s;function i(o,c){const{gen:l,schema:u}=o;u===!1?(l.var(c,!1),a(o)):l.var(c,!0)}hn.boolOrEmptySchema=i;function a(o,c){const{gen:l,data:u}=o,m={gen:l,keyword:"false schema",data:u,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:o};(0,e.reportError)(m,n,void 0,c)}return hn}var yt={},mn={},ud;function Wm(){if(ud)return mn;ud=1,Object.defineProperty(mn,"__esModule",{value:!0}),mn.getRules=mn.isJSONType=void 0;const e=["string","number","integer","boolean","null","object","array"],t=new Set(e);function r(s){return typeof s=="string"&&t.has(s)}mn.isJSONType=r;function n(){const s={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...s,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},s.number,s.string,s.array,s.object],post:{rules:[]},all:{},keywords:{}}}return mn.getRules=n,mn}var wr={},dd;function Jm(){if(dd)return wr;dd=1,Object.defineProperty(wr,"__esModule",{value:!0}),wr.shouldUseRule=wr.shouldUseGroup=wr.schemaHasRulesForType=void 0;function e({schema:n,self:s},i){const a=s.RULES.types[i];return a&&a!==!0&&t(n,a)}wr.schemaHasRulesForType=e;function t(n,s){return s.rules.some(i=>r(n,i))}wr.shouldUseGroup=t;function r(n,s){var i;return n[s.keyword]!==void 0||((i=s.definition.implements)===null||i===void 0?void 0:i.some(a=>n[a]!==void 0))}return wr.shouldUseRule=r,wr}var fd;function Va(){if(fd)return yt;fd=1,Object.defineProperty(yt,"__esModule",{value:!0}),yt.reportTypeError=yt.checkDataTypes=yt.checkDataType=yt.coerceAndCheckDataType=yt.getJSONTypes=yt.getSchemaTypes=yt.DataType=void 0;const e=Wm(),t=Jm(),r=Qa(),n=Re(),s=Te();var i;(function(f){f[f.Correct=0]="Correct",f[f.Wrong=1]="Wrong"})(i||(yt.DataType=i={}));function a(f){const C=o(f.type);if(C.includes("null")){if(f.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!C.length&&f.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');f.nullable===!0&&C.push("null")}return C}yt.getSchemaTypes=a;function o(f){const C=Array.isArray(f)?f:f?[f]:[];if(C.every(e.isJSONType))return C;throw new Error("type must be JSONType or JSONType[]: "+C.join(","))}yt.getJSONTypes=o;function c(f,C){const{gen:P,data:h,opts:b}=f,O=u(C,b.coerceTypes),k=C.length>0&&!(O.length===0&&C.length===1&&(0,t.schemaHasRulesForType)(f,C[0]));if(k){const $=S(C,h,b.strictNumbers,i.Wrong);P.if($,()=>{O.length?m(f,C,O):g(f)})}return k}yt.coerceAndCheckDataType=c;const l=new Set(["string","number","integer","boolean","null"]);function u(f,C){return C?f.filter(P=>l.has(P)||C==="array"&&P==="array"):[]}function m(f,C,P){const{gen:h,data:b,opts:O}=f,k=h.let("dataType",(0,n._)`typeof ${b}`),$=h.let("coerced",(0,n._)`undefined`);O.coerceTypes==="array"&&h.if((0,n._)`${k} == 'object' && Array.isArray(${b}) && ${b}.length == 1`,()=>h.assign(b,(0,n._)`${b}[0]`).assign(k,(0,n._)`typeof ${b}`).if(S(C,b,O.strictNumbers),()=>h.assign($,b))),h.if((0,n._)`${$} !== undefined`);for(const q of P)(l.has(q)||q==="array"&&O.coerceTypes==="array")&&M(q);h.else(),g(f),h.endIf(),h.if((0,n._)`${$} !== undefined`,()=>{h.assign(b,$),_(f,$)});function M(q){switch(q){case"string":h.elseIf((0,n._)`${k} == "number" || ${k} == "boolean"`).assign($,(0,n._)`"" + ${b}`).elseIf((0,n._)`${b} === null`).assign($,(0,n._)`""`);return;case"number":h.elseIf((0,n._)`${k} == "boolean" || ${b} === null
|| (${k} == "string" && ${b} && ${b} == +${b})`).assign($,(0,n._)`+${b}`);return;case"integer":h.elseIf((0,n._)`${k} === "boolean" || ${b} === null
|| (${k} === "string" && ${b} && ${b} == +${b} && !(${b} % 1))`).assign($,(0,n._)`+${b}`);return;case"boolean":h.elseIf((0,n._)`${b} === "false" || ${b} === 0 || ${b} === null`).assign($,!1).elseIf((0,n._)`${b} === "true" || ${b} === 1`).assign($,!0);return;case"null":h.elseIf((0,n._)`${b} === "" || ${b} === 0 || ${b} === false`),h.assign($,null);return;case"array":h.elseIf((0,n._)`${k} === "string" || ${k} === "number"
|| ${k} === "boolean" || ${b} === null`).assign($,(0,n._)`[${b}]`)}}}function _({gen:f,parentData:C,parentDataProperty:P},h){f.if((0,n._)`${C} !== undefined`,()=>f.assign((0,n._)`${C}[${P}]`,h))}function v(f,C,P,h=i.Correct){const b=h===i.Correct?n.operators.EQ:n.operators.NEQ;let O;switch(f){case"null":return(0,n._)`${C} ${b} null`;case"array":O=(0,n._)`Array.isArray(${C})`;break;case"object":O=(0,n._)`${C} && typeof ${C} == "object" && !Array.isArray(${C})`;break;case"integer":O=k((0,n._)`!(${C} % 1) && !isNaN(${C})`);break;case"number":O=k();break;default:return(0,n._)`typeof ${C} ${b} ${f}`}return h===i.Correct?O:(0,n.not)(O);function k($=n.nil){return(0,n.and)((0,n._)`typeof ${C} == "number"`,$,P?(0,n._)`isFinite(${C})`:n.nil)}}yt.checkDataType=v;function S(f,C,P,h){if(f.length===1)return v(f[0],C,P,h);let b;const O=(0,s.toHash)(f);if(O.array&&O.object){const k=(0,n._)`typeof ${C} != "object"`;b=O.null?k:(0,n._)`!${C} || ${k}`,delete O.null,delete O.array,delete O.object}else b=n.nil;O.number&&delete O.integer;for(const k in O)b=(0,n.and)(b,v(k,C,P,h));return b}yt.checkDataTypes=S;const E={message:({schema:f})=>`must be ${f}`,params:({schema:f,schemaValue:C})=>typeof f=="string"?(0,n._)`{type: ${f}}`:(0,n._)`{type: ${C}}`};function g(f){const C=y(f);(0,r.reportError)(C,E)}yt.reportTypeError=g;function y(f){const{gen:C,data:P,schema:h}=f,b=(0,s.schemaRefOrVal)(f,h,"type");return{gen:C,keyword:"type",data:P,schema:h.type,schemaCode:b,schemaValue:b,parentSchema:h,params:{},it:f}}return yt}var vi={},hd;function gS(){if(hd)return vi;hd=1,Object.defineProperty(vi,"__esModule",{value:!0}),vi.assignDefaults=void 0;const e=Re(),t=Te();function r(s,i){const{properties:a,items:o}=s.schema;if(i==="object"&&a)for(const c in a)n(s,c,a[c].default);else i==="array"&&Array.isArray(o)&&o.forEach((c,l)=>n(s,l,c.default))}vi.assignDefaults=r;function n(s,i,a){const{gen:o,compositeRule:c,data:l,opts:u}=s;if(a===void 0)return;const m=(0,e._)`${l}${(0,e.getProperty)(i)}`;if(c){(0,t.checkStrictMode)(s,`default is ignored for: ${m}`);return}let _=(0,e._)`${m} === undefined`;u.useDefaults==="empty"&&(_=(0,e._)`${_} || ${m} === null || ${m} === ""`),o.if(_,(0,e._)`${m} = ${(0,e.stringify)(a)}`)}return vi}var Xt={},Ge={},md;function sr(){if(md)return Ge;md=1,Object.defineProperty(Ge,"__esModule",{value:!0}),Ge.validateUnion=Ge.validateArray=Ge.usePattern=Ge.callValidateCode=Ge.schemaProperties=Ge.allSchemaProperties=Ge.noPropertyInData=Ge.propertyInData=Ge.isOwnProperty=Ge.hasPropFunc=Ge.reportMissingProp=Ge.checkMissingProp=Ge.checkReportMissingProp=void 0;const e=Re(),t=Te(),r=rn(),n=Te();function s(f,C){const{gen:P,data:h,it:b}=f;P.if(u(P,h,C,b.opts.ownProperties),()=>{f.setParams({missingProperty:(0,e._)`${C}`},!0),f.error()})}Ge.checkReportMissingProp=s;function i({gen:f,data:C,it:{opts:P}},h,b){return(0,e.or)(...h.map(O=>(0,e.and)(u(f,C,O,P.ownProperties),(0,e._)`${b} = ${O}`)))}Ge.checkMissingProp=i;function a(f,C){f.setParams({missingProperty:C},!0),f.error()}Ge.reportMissingProp=a;function o(f){return f.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,e._)`Object.prototype.hasOwnProperty`})}Ge.hasPropFunc=o;function c(f,C,P){return(0,e._)`${o(f)}.call(${C}, ${P})`}Ge.isOwnProperty=c;function l(f,C,P,h){const b=(0,e._)`${C}${(0,e.getProperty)(P)} !== undefined`;return h?(0,e._)`${b} && ${c(f,C,P)}`:b}Ge.propertyInData=l;function u(f,C,P,h){const b=(0,e._)`${C}${(0,e.getProperty)(P)} === undefined`;return h?(0,e.or)(b,(0,e.not)(c(f,C,P))):b}Ge.noPropertyInData=u;function m(f){return f?Object.keys(f).filter(C=>C!=="__proto__"):[]}Ge.allSchemaProperties=m;function _(f,C){return m(C).filter(P=>!(0,t.alwaysValidSchema)(f,C[P]))}Ge.schemaProperties=_;function v({schemaCode:f,data:C,it:{gen:P,topSchemaRef:h,schemaPath:b,errorPath:O},it:k},$,M,q){const L=q?(0,e._)`${f}, ${C}, ${h}${b}`:C,U=[[r.default.instancePath,(0,e.strConcat)(r.default.instancePath,O)],[r.default.parentData,k.parentData],[r.default.parentDataProperty,k.parentDataProperty],[r.default.rootData,r.default.rootData]];k.opts.dynamicRef&&U.push([r.default.dynamicAnchors,r.default.dynamicAnchors]);const B=(0,e._)`${L}, ${P.object(...U)}`;return M!==e.nil?(0,e._)`${$}.call(${M}, ${B})`:(0,e._)`${$}(${B})`}Ge.callValidateCode=v;const S=(0,e._)`new RegExp`;function E({gen:f,it:{opts:C}},P){const h=C.unicodeRegExp?"u":"",{regExp:b}=C.code,O=b(P,h);return f.scopeValue("pattern",{key:O.toString(),ref:O,code:(0,e._)`${b.code==="new RegExp"?S:(0,n.useFunc)(f,b)}(${P}, ${h})`})}Ge.usePattern=E;function g(f){const{gen:C,data:P,keyword:h,it:b}=f,O=C.name("valid");if(b.allErrors){const $=C.let("valid",!0);return k(()=>C.assign($,!1)),$}return C.var(O,!0),k(()=>C.break()),O;function k($){const M=C.const("len",(0,e._)`${P}.length`);C.forRange("i",0,M,q=>{f.subschema({keyword:h,dataProp:q,dataPropType:t.Type.Num},O),C.if((0,e.not)(O),$)})}}Ge.validateArray=g;function y(f){const{gen:C,schema:P,keyword:h,it:b}=f;if(!Array.isArray(P))throw new Error("ajv implementation error");if(P.some(M=>(0,t.alwaysValidSchema)(b,M))&&!b.opts.unevaluated)return;const k=C.let("valid",!1),$=C.name("_valid");C.block(()=>P.forEach((M,q)=>{const L=f.subschema({keyword:h,schemaProp:q,compositeRule:!0},$);C.assign(k,(0,e._)`${k} || ${$}`),f.mergeValidEvaluated(L,$)||C.if((0,e.not)(k))})),f.result(k,()=>f.reset(),()=>f.error(!0))}return Ge.validateUnion=y,Ge}var pd;function vS(){if(pd)return Xt;pd=1,Object.defineProperty(Xt,"__esModule",{value:!0}),Xt.validateKeywordUsage=Xt.validSchemaType=Xt.funcKeywordCode=Xt.macroKeywordCode=void 0;const e=Re(),t=rn(),r=sr(),n=Qa();function s(_,v){const{gen:S,keyword:E,schema:g,parentSchema:y,it:f}=_,C=v.macro.call(f.self,g,y,f),P=l(S,E,C);f.opts.validateSchema!==!1&&f.self.validateSchema(C,!0);const h=S.name("valid");_.subschema({schema:C,schemaPath:e.nil,errSchemaPath:`${f.errSchemaPath}/${E}`,topSchemaRef:P,compositeRule:!0},h),_.pass(h,()=>_.error(!0))}Xt.macroKeywordCode=s;function i(_,v){var S;const{gen:E,keyword:g,schema:y,parentSchema:f,$data:C,it:P}=_;c(P,v);const h=!C&&v.compile?v.compile.call(P.self,y,f,P):v.validate,b=l(E,g,h),O=E.let("valid");_.block$data(O,k),_.ok((S=v.valid)!==null&&S!==void 0?S:O);function k(){if(v.errors===!1)q(),v.modifying&&a(_),L(()=>_.error());else{const U=v.async?$():M();v.modifying&&a(_),L(()=>o(_,U))}}function $(){const U=E.let("ruleErrs",null);return E.try(()=>q((0,e._)`await `),B=>E.assign(O,!1).if((0,e._)`${B} instanceof ${P.ValidationError}`,()=>E.assign(U,(0,e._)`${B}.errors`),()=>E.throw(B))),U}function M(){const U=(0,e._)`${b}.errors`;return E.assign(U,null),q(e.nil),U}function q(U=v.async?(0,e._)`await `:e.nil){const B=P.opts.passContext?t.default.this:t.default.self,W=!("compile"in v&&!C||v.schema===!1);E.assign(O,(0,e._)`${U}${(0,r.callValidateCode)(_,b,B,W)}`,v.modifying)}function L(U){var B;E.if((0,e.not)((B=v.valid)!==null&&B!==void 0?B:O),U)}}Xt.funcKeywordCode=i;function a(_){const{gen:v,data:S,it:E}=_;v.if(E.parentData,()=>v.assign(S,(0,e._)`${E.parentData}[${E.parentDataProperty}]`))}function o(_,v){const{gen:S}=_;S.if((0,e._)`Array.isArray(${v})`,()=>{S.assign(t.default.vErrors,(0,e._)`${t.default.vErrors} === null ? ${v} : ${t.default.vErrors}.concat(${v})`).assign(t.default.errors,(0,e._)`${t.default.vErrors}.length`),(0,n.extendErrors)(_)},()=>_.error())}function c({schemaEnv:_},v){if(v.async&&!_.$async)throw new Error("async keyword in sync schema")}function l(_,v,S){if(S===void 0)throw new Error(`keyword "${v}" failed to compile`);return _.scopeValue("keyword",typeof S=="function"?{ref:S}:{ref:S,code:(0,e.stringify)(S)})}function u(_,v,S=!1){return!v.length||v.some(E=>E==="array"?Array.isArray(_):E==="object"?_&&typeof _=="object"&&!Array.isArray(_):typeof _==E||S&&typeof _>"u")}Xt.validSchemaType=u;function m({schema:_,opts:v,self:S,errSchemaPath:E},g,y){if(Array.isArray(g.keyword)?!g.keyword.includes(y):g.keyword!==y)throw new Error("ajv implementation error");const f=g.dependencies;if(f?.some(C=>!Object.prototype.hasOwnProperty.call(_,C)))throw new Error(`parent schema must have dependencies of ${y}: ${f.join(",")}`);if(g.validateSchema&&!g.validateSchema(_[y])){const P=`keyword "${y}" value is invalid at path "${E}": `+S.errorsText(g.validateSchema.errors);if(v.validateSchema==="log")S.logger.error(P);else throw new Error(P)}}return Xt.validateKeywordUsage=m,Xt}var Cr={},yd;function bS(){if(yd)return Cr;yd=1,Object.defineProperty(Cr,"__esModule",{value:!0}),Cr.extendSubschemaMode=Cr.extendSubschemaData=Cr.getSubschema=void 0;const e=Re(),t=Te();function r(i,{keyword:a,schemaProp:o,schema:c,schemaPath:l,errSchemaPath:u,topSchemaRef:m}){if(a!==void 0&&c!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(a!==void 0){const _=i.schema[a];return o===void 0?{schema:_,schemaPath:(0,e._)`${i.schemaPath}${(0,e.getProperty)(a)}`,errSchemaPath:`${i.errSchemaPath}/${a}`}:{schema:_[o],schemaPath:(0,e._)`${i.schemaPath}${(0,e.getProperty)(a)}${(0,e.getProperty)(o)}`,errSchemaPath:`${i.errSchemaPath}/${a}/${(0,t.escapeFragment)(o)}`}}if(c!==void 0){if(l===void 0||u===void 0||m===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:c,schemaPath:l,topSchemaRef:m,errSchemaPath:u}}throw new Error('either "keyword" or "schema" must be passed')}Cr.getSubschema=r;function n(i,a,{dataProp:o,dataPropType:c,data:l,dataTypes:u,propertyName:m}){if(l!==void 0&&o!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:_}=a;if(o!==void 0){const{errorPath:S,dataPathArr:E,opts:g}=a,y=_.let("data",(0,e._)`${a.data}${(0,e.getProperty)(o)}`,!0);v(y),i.errorPath=(0,e.str)`${S}${(0,t.getErrorPath)(o,c,g.jsPropertySyntax)}`,i.parentDataProperty=(0,e._)`${o}`,i.dataPathArr=[...E,i.parentDataProperty]}if(l!==void 0){const S=l instanceof e.Name?l:_.let("data",l,!0);v(S),m!==void 0&&(i.propertyName=m)}u&&(i.dataTypes=u);function v(S){i.data=S,i.dataLevel=a.dataLevel+1,i.dataTypes=[],a.definedProperties=new Set,i.parentData=a.data,i.dataNames=[...a.dataNames,S]}}Cr.extendSubschemaData=n;function s(i,{jtdDiscriminator:a,jtdMetadata:o,compositeRule:c,createErrors:l,allErrors:u}){c!==void 0&&(i.compositeRule=c),l!==void 0&&(i.createErrors=l),u!==void 0&&(i.allErrors=u),i.jtdDiscriminator=a,i.jtdMetadata=o}return Cr.extendSubschemaMode=s,Cr}var Pt={},Jo,gd;function eo(){return gd||(gd=1,Jo=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,s,i;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(s=n;s--!==0;)if(!e(t[s],r[s]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(i=Object.keys(t),n=i.length,n!==Object.keys(r).length)return!1;for(s=n;s--!==0;)if(!Object.prototype.hasOwnProperty.call(r,i[s]))return!1;for(s=n;s--!==0;){var a=i[s];if(!e(t[a],r[a]))return!1}return!0}return t!==t&&r!==r}),Jo}var Yo={exports:{}},vd;function _S(){if(vd)return Yo.exports;vd=1;var e=Yo.exports=function(n,s,i){typeof s=="function"&&(i=s,s={}),i=s.cb||i;var a=typeof i=="function"?i:i.pre||function(){},o=i.post||function(){};t(s,a,o,n,"",n)};e.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},e.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},e.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},e.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function t(n,s,i,a,o,c,l,u,m,_){if(a&&typeof a=="object"&&!Array.isArray(a)){s(a,o,c,l,u,m,_);for(var v in a){var S=a[v];if(Array.isArray(S)){if(v in e.arrayKeywords)for(var E=0;E<S.length;E++)t(n,s,i,S[E],o+"/"+v+"/"+E,c,o,v,a,E)}else if(v in e.propsKeywords){if(S&&typeof S=="object")for(var g in S)t(n,s,i,S[g],o+"/"+v+"/"+r(g),c,o,v,a,g)}else(v in e.keywords||n.allKeys&&!(v in e.skipKeywords))&&t(n,s,i,S,o+"/"+v,c,o,v,a)}i(a,o,c,l,u,m,_)}}function r(n){return n.replace(/~/g,"~0").replace(/\//g,"~1")}return Yo.exports}var bd;function to(){if(bd)return Pt;bd=1,Object.defineProperty(Pt,"__esModule",{value:!0}),Pt.getSchemaRefs=Pt.resolveUrl=Pt.normalizeId=Pt._getFullPath=Pt.getFullPath=Pt.inlineRef=void 0;const e=Te(),t=eo(),r=_S(),n=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function s(E,g=!0){return typeof E=="boolean"?!0:g===!0?!a(E):g?o(E)<=g:!1}Pt.inlineRef=s;const i=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function a(E){for(const g in E){if(i.has(g))return!0;const y=E[g];if(Array.isArray(y)&&y.some(a)||typeof y=="object"&&a(y))return!0}return!1}function o(E){let g=0;for(const y in E){if(y==="$ref")return 1/0;if(g++,!n.has(y)&&(typeof E[y]=="object"&&(0,e.eachItem)(E[y],f=>g+=o(f)),g===1/0))return 1/0}return g}function c(E,g="",y){y!==!1&&(g=m(g));const f=E.parse(g);return l(E,f)}Pt.getFullPath=c;function l(E,g){return E.serialize(g).split("#")[0]+"#"}Pt._getFullPath=l;const u=/#\/?$/;function m(E){return E?E.replace(u,""):""}Pt.normalizeId=m;function _(E,g,y){return y=m(y),E.resolve(g,y)}Pt.resolveUrl=_;const v=/^[a-z_][-a-z0-9._]*$/i;function S(E,g){if(typeof E=="boolean")return{};const{schemaId:y,uriResolver:f}=this.opts,C=m(E[y]||g),P={"":C},h=c(f,C,!1),b={},O=new Set;return r(E,{allKeys:!0},(M,q,L,U)=>{if(U===void 0)return;const B=h+q;let W=P[U];typeof M[y]=="string"&&(W=Y.call(this,M[y])),Q.call(this,M.$anchor),Q.call(this,M.$dynamicAnchor),P[q]=W;function Y(Z){const re=this.opts.uriResolver.resolve;if(Z=m(W?re(W,Z):Z),O.has(Z))throw $(Z);O.add(Z);let A=this.refs[Z];return typeof A=="string"&&(A=this.refs[A]),typeof A=="object"?k(M,A.schema,Z):Z!==m(B)&&(Z[0]==="#"?(k(M,b[Z],Z),b[Z]=M):this.refs[Z]=B),Z}function Q(Z){if(typeof Z=="string"){if(!v.test(Z))throw new Error(`invalid anchor "${Z}"`);Y.call(this,`#${Z}`)}}}),b;function k(M,q,L){if(q!==void 0&&!t(M,q))throw $(L)}function $(M){return new Error(`reference "${M}" resolves to more than one schema`)}}return Pt.getSchemaRefs=S,Pt}var _d;function ro(){if(_d)return Sr;_d=1,Object.defineProperty(Sr,"__esModule",{value:!0}),Sr.getData=Sr.KeywordCxt=Sr.validateFunctionCode=void 0;const e=yS(),t=Va(),r=Jm(),n=Va(),s=gS(),i=vS(),a=bS(),o=Re(),c=rn(),l=to(),u=Te(),m=Qa();function _(R){if(h(R)&&(O(R),P(R))){g(R);return}v(R,()=>(0,e.topBoolOrEmptySchema)(R))}Sr.validateFunctionCode=_;function v({gen:R,validateName:D,schema:V,schemaEnv:K,opts:G},J){G.code.es5?R.func(D,(0,o._)`${c.default.data}, ${c.default.valCxt}`,K.$async,()=>{R.code((0,o._)`"use strict"; ${f(V,G)}`),E(R,G),R.code(J)}):R.func(D,(0,o._)`${c.default.data}, ${S(G)}`,K.$async,()=>R.code(f(V,G)).code(J))}function S(R){return(0,o._)`{${c.default.instancePath}="", ${c.default.parentData}, ${c.default.parentDataProperty}, ${c.default.rootData}=${c.default.data}${R.dynamicRef?(0,o._)`, ${c.default.dynamicAnchors}={}`:o.nil}}={}`}function E(R,D){R.if(c.default.valCxt,()=>{R.var(c.default.instancePath,(0,o._)`${c.default.valCxt}.${c.default.instancePath}`),R.var(c.default.parentData,(0,o._)`${c.default.valCxt}.${c.default.parentData}`),R.var(c.default.parentDataProperty,(0,o._)`${c.default.valCxt}.${c.default.parentDataProperty}`),R.var(c.default.rootData,(0,o._)`${c.default.valCxt}.${c.default.rootData}`),D.dynamicRef&&R.var(c.default.dynamicAnchors,(0,o._)`${c.default.valCxt}.${c.default.dynamicAnchors}`)},()=>{R.var(c.default.instancePath,(0,o._)`""`),R.var(c.default.parentData,(0,o._)`undefined`),R.var(c.default.parentDataProperty,(0,o._)`undefined`),R.var(c.default.rootData,c.default.data),D.dynamicRef&&R.var(c.default.dynamicAnchors,(0,o._)`{}`)})}function g(R){const{schema:D,opts:V,gen:K}=R;v(R,()=>{V.$comment&&D.$comment&&U(R),M(R),K.let(c.default.vErrors,null),K.let(c.default.errors,0),V.unevaluated&&y(R),k(R),B(R)})}function y(R){const{gen:D,validateName:V}=R;R.evaluated=D.const("evaluated",(0,o._)`${V}.evaluated`),D.if((0,o._)`${R.evaluated}.dynamicProps`,()=>D.assign((0,o._)`${R.evaluated}.props`,(0,o._)`undefined`)),D.if((0,o._)`${R.evaluated}.dynamicItems`,()=>D.assign((0,o._)`${R.evaluated}.items`,(0,o._)`undefined`))}function f(R,D){const V=typeof R=="object"&&R[D.schemaId];return V&&(D.code.source||D.code.process)?(0,o._)`/*# sourceURL=${V} */`:o.nil}function C(R,D){if(h(R)&&(O(R),P(R))){b(R,D);return}(0,e.boolOrEmptySchema)(R,D)}function P({schema:R,self:D}){if(typeof R=="boolean")return!R;for(const V in R)if(D.RULES.all[V])return!0;return!1}function h(R){return typeof R.schema!="boolean"}function b(R,D){const{schema:V,gen:K,opts:G}=R;G.$comment&&V.$comment&&U(R),q(R),L(R);const J=K.const("_errs",c.default.errors);k(R,J),K.var(D,(0,o._)`${J} === ${c.default.errors}`)}function O(R){(0,u.checkUnknownRules)(R),$(R)}function k(R,D){if(R.opts.jtd)return Y(R,[],!1,D);const V=(0,t.getSchemaTypes)(R.schema),K=(0,t.coerceAndCheckDataType)(R,V);Y(R,V,!K,D)}function $(R){const{schema:D,errSchemaPath:V,opts:K,self:G}=R;D.$ref&&K.ignoreKeywordsWithRef&&(0,u.schemaHasRulesButRef)(D,G.RULES)&&G.logger.warn(`$ref: keywords ignored in schema at path "${V}"`)}function M(R){const{schema:D,opts:V}=R;D.default!==void 0&&V.useDefaults&&V.strictSchema&&(0,u.checkStrictMode)(R,"default is ignored in the schema root")}function q(R){const D=R.schema[R.opts.schemaId];D&&(R.baseId=(0,l.resolveUrl)(R.opts.uriResolver,R.baseId,D))}function L(R){if(R.schema.$async&&!R.schemaEnv.$async)throw new Error("async schema in sync schema")}function U({gen:R,schemaEnv:D,schema:V,errSchemaPath:K,opts:G}){const J=V.$comment;if(G.$comment===!0)R.code((0,o._)`${c.default.self}.logger.log(${J})`);else if(typeof G.$comment=="function"){const te=(0,o.str)`${K}/$comment`,ne=R.scopeValue("root",{ref:D.root});R.code((0,o._)`${c.default.self}.opts.$comment(${J}, ${te}, ${ne}.schema)`)}}function B(R){const{gen:D,schemaEnv:V,validateName:K,ValidationError:G,opts:J}=R;V.$async?D.if((0,o._)`${c.default.errors} === 0`,()=>D.return(c.default.data),()=>D.throw((0,o._)`new ${G}(${c.default.vErrors})`)):(D.assign((0,o._)`${K}.errors`,c.default.vErrors),J.unevaluated&&W(R),D.return((0,o._)`${c.default.errors} === 0`))}function W({gen:R,evaluated:D,props:V,items:K}){V instanceof o.Name&&R.assign((0,o._)`${D}.props`,V),K instanceof o.Name&&R.assign((0,o._)`${D}.items`,K)}function Y(R,D,V,K){const{gen:G,schema:J,data:te,allErrors:ne,opts:se,self:ce}=R,{RULES:he}=ce;if(J.$ref&&(se.ignoreKeywordsWithRef||!(0,u.schemaHasRulesButRef)(J,he))){G.block(()=>T(R,"$ref",he.all.$ref.definition));return}se.jtd||Z(R,D),G.block(()=>{for(const ge of he.rules)le(ge);le(he.post)});function le(ge){(0,r.shouldUseGroup)(J,ge)&&(ge.type?(G.if((0,n.checkDataType)(ge.type,te,se.strictNumbers)),Q(R,ge),D.length===1&&D[0]===ge.type&&V&&(G.else(),(0,n.reportTypeError)(R)),G.endIf()):Q(R,ge),ne||G.if((0,o._)`${c.default.errors} === ${K||0}`))}}function Q(R,D){const{gen:V,schema:K,opts:{useDefaults:G}}=R;G&&(0,s.assignDefaults)(R,D.type),V.block(()=>{for(const J of D.rules)(0,r.shouldUseRule)(K,J)&&T(R,J.keyword,J.definition,D.type)})}function Z(R,D){R.schemaEnv.meta||!R.opts.strictTypes||(re(R,D),R.opts.allowUnionTypes||A(R,D),w(R,R.dataTypes))}function re(R,D){if(D.length){if(!R.dataTypes.length){R.dataTypes=D;return}D.forEach(V=>{p(R.dataTypes,V)||x(R,`type "${V}" not allowed by context "${R.dataTypes.join(",")}"`)}),d(R,D)}}function A(R,D){D.length>1&&!(D.length===2&&D.includes("null"))&&x(R,"use allowUnionTypes to allow union type keyword")}function w(R,D){const V=R.self.RULES.all;for(const K in V){const G=V[K];if(typeof G=="object"&&(0,r.shouldUseRule)(R.schema,G)){const{type:J}=G.definition;J.length&&!J.some(te=>j(D,te))&&x(R,`missing type "${J.join(",")}" for keyword "${K}"`)}}}function j(R,D){return R.includes(D)||D==="number"&&R.includes("integer")}function p(R,D){return R.includes(D)||D==="integer"&&R.includes("number")}function d(R,D){const V=[];for(const K of R.dataTypes)p(D,K)?V.push(K):D.includes("integer")&&K==="number"&&V.push("integer");R.dataTypes=V}function x(R,D){const V=R.schemaEnv.baseId+R.errSchemaPath;D+=` at "${V}" (strictTypes)`,(0,u.checkStrictMode)(R,D,R.opts.strictTypes)}class I{constructor(D,V,K){if((0,i.validateKeywordUsage)(D,V,K),this.gen=D.gen,this.allErrors=D.allErrors,this.keyword=K,this.data=D.data,this.schema=D.schema[K],this.$data=V.$data&&D.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,u.schemaRefOrVal)(D,this.schema,K,this.$data),this.schemaType=V.schemaType,this.parentSchema=D.schema,this.params={},this.it=D,this.def=V,this.$data)this.schemaCode=D.gen.const("vSchema",H(this.$data,D));else if(this.schemaCode=this.schemaValue,!(0,i.validSchemaType)(this.schema,V.schemaType,V.allowUndefined))throw new Error(`${K} value must be ${JSON.stringify(V.schemaType)}`);("code"in V?V.trackErrors:V.errors!==!1)&&(this.errsCount=D.gen.const("_errs",c.default.errors))}result(D,V,K){this.failResult((0,o.not)(D),V,K)}failResult(D,V,K){this.gen.if(D),K?K():this.error(),V?(this.gen.else(),V(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(D,V){this.failResult((0,o.not)(D),void 0,V)}fail(D){if(D===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(D),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(D){if(!this.$data)return this.fail(D);const{schemaCode:V}=this;this.fail((0,o._)`${V} !== undefined && (${(0,o.or)(this.invalid$data(),D)})`)}error(D,V,K){if(V){this.setParams(V),this._error(D,K),this.setParams({});return}this._error(D,K)}_error(D,V){(D?m.reportExtraError:m.reportError)(this,this.def.error,V)}$dataError(){(0,m.reportError)(this,this.def.$dataError||m.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,m.resetErrorsCount)(this.gen,this.errsCount)}ok(D){this.allErrors||this.gen.if(D)}setParams(D,V){V?Object.assign(this.params,D):this.params=D}block$data(D,V,K=o.nil){this.gen.block(()=>{this.check$data(D,K),V()})}check$data(D=o.nil,V=o.nil){if(!this.$data)return;const{gen:K,schemaCode:G,schemaType:J,def:te}=this;K.if((0,o.or)((0,o._)`${G} === undefined`,V)),D!==o.nil&&K.assign(D,!0),(J.length||te.validateSchema)&&(K.elseIf(this.invalid$data()),this.$dataError(),D!==o.nil&&K.assign(D,!1)),K.else()}invalid$data(){const{gen:D,schemaCode:V,schemaType:K,def:G,it:J}=this;return(0,o.or)(te(),ne());function te(){if(K.length){if(!(V instanceof o.Name))throw new Error("ajv implementation error");const se=Array.isArray(K)?K:[K];return(0,o._)`${(0,n.checkDataTypes)(se,V,J.opts.strictNumbers,n.DataType.Wrong)}`}return o.nil}function ne(){if(G.validateSchema){const se=D.scopeValue("validate$data",{ref:G.validateSchema});return(0,o._)`!${se}(${V})`}return o.nil}}subschema(D,V){const K=(0,a.getSubschema)(this.it,D);(0,a.extendSubschemaData)(K,this.it,D),(0,a.extendSubschemaMode)(K,D);const G={...this.it,...K,items:void 0,props:void 0};return C(G,V),G}mergeEvaluated(D,V){const{it:K,gen:G}=this;K.opts.unevaluated&&(K.props!==!0&&D.props!==void 0&&(K.props=u.mergeEvaluated.props(G,D.props,K.props,V)),K.items!==!0&&D.items!==void 0&&(K.items=u.mergeEvaluated.items(G,D.items,K.items,V)))}mergeValidEvaluated(D,V){const{it:K,gen:G}=this;if(K.opts.unevaluated&&(K.props!==!0||K.items!==!0))return G.if(V,()=>this.mergeEvaluated(D,o.Name)),!0}}Sr.KeywordCxt=I;function T(R,D,V,K){const G=new I(R,V,D);"code"in V?V.code(G,K):G.$data&&V.validate?(0,i.funcKeywordCode)(G,V):"macro"in V?(0,i.macroKeywordCode)(G,V):(V.compile||V.validate)&&(0,i.funcKeywordCode)(G,V)}const F=/^\/(?:[^~]|~0|~1)*$/,z=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function H(R,{dataLevel:D,dataNames:V,dataPathArr:K}){let G,J;if(R==="")return c.default.rootData;if(R[0]==="/"){if(!F.test(R))throw new Error(`Invalid JSON-pointer: ${R}`);G=R,J=c.default.rootData}else{const ce=z.exec(R);if(!ce)throw new Error(`Invalid JSON-pointer: ${R}`);const he=+ce[1];if(G=ce[2],G==="#"){if(he>=D)throw new Error(se("property/index",he));return K[D-he]}if(he>D)throw new Error(se("data",he));if(J=V[D-he],!G)return J}let te=J;const ne=G.split("/");for(const ce of ne)ce&&(J=(0,o._)`${J}${(0,o.getProperty)((0,u.unescapeJsonPointer)(ce))}`,te=(0,o._)`${te} && ${J}`);return te;function se(ce,he){return`Cannot access ${ce} ${he} levels up, current level is ${D}`}}return Sr.getData=H,Sr}var Zi={},Sd;function ul(){if(Sd)return Zi;Sd=1,Object.defineProperty(Zi,"__esModule",{value:!0});class e extends Error{constructor(r){super("validation failed"),this.errors=r,this.ajv=this.validation=!0}}return Zi.default=e,Zi}var Qi={},wd;function no(){if(wd)return Qi;wd=1,Object.defineProperty(Qi,"__esModule",{value:!0});const e=to();class t extends Error{constructor(n,s,i,a){super(a||`can't resolve reference ${i} from id ${s}`),this.missingRef=(0,e.resolveUrl)(n,s,i),this.missingSchema=(0,e.normalizeId)((0,e.getFullPath)(n,this.missingRef))}}return Qi.default=t,Qi}var Tt={},Cd;function dl(){if(Cd)return Tt;Cd=1,Object.defineProperty(Tt,"__esModule",{value:!0}),Tt.resolveSchema=Tt.getCompilingSchema=Tt.resolveRef=Tt.compileSchema=Tt.SchemaEnv=void 0;const e=Re(),t=ul(),r=rn(),n=to(),s=Te(),i=ro();class a{constructor(y){var f;this.refs={},this.dynamicAnchors={};let C;typeof y.schema=="object"&&(C=y.schema),this.schema=y.schema,this.schemaId=y.schemaId,this.root=y.root||this,this.baseId=(f=y.baseId)!==null&&f!==void 0?f:(0,n.normalizeId)(C?.[y.schemaId||"$id"]),this.schemaPath=y.schemaPath,this.localRefs=y.localRefs,this.meta=y.meta,this.$async=C?.$async,this.refs={}}}Tt.SchemaEnv=a;function o(g){const y=u.call(this,g);if(y)return y;const f=(0,n.getFullPath)(this.opts.uriResolver,g.root.baseId),{es5:C,lines:P}=this.opts.code,{ownProperties:h}=this.opts,b=new e.CodeGen(this.scope,{es5:C,lines:P,ownProperties:h});let O;g.$async&&(O=b.scopeValue("Error",{ref:t.default,code:(0,e._)`require("ajv/dist/runtime/validation_error").default`}));const k=b.scopeName("validate");g.validateName=k;const $={gen:b,allErrors:this.opts.allErrors,data:r.default.data,parentData:r.default.parentData,parentDataProperty:r.default.parentDataProperty,dataNames:[r.default.data],dataPathArr:[e.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:b.scopeValue("schema",this.opts.code.source===!0?{ref:g.schema,code:(0,e.stringify)(g.schema)}:{ref:g.schema}),validateName:k,ValidationError:O,schema:g.schema,schemaEnv:g,rootId:f,baseId:g.baseId||f,schemaPath:e.nil,errSchemaPath:g.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,e._)`""`,opts:this.opts,self:this};let M;try{this._compilations.add(g),(0,i.validateFunctionCode)($),b.optimize(this.opts.code.optimize);const q=b.toString();M=`${b.scopeRefs(r.default.scope)}return ${q}`,this.opts.code.process&&(M=this.opts.code.process(M,g));const U=new Function(`${r.default.self}`,`${r.default.scope}`,M)(this,this.scope.get());if(this.scope.value(k,{ref:U}),U.errors=null,U.schema=g.schema,U.schemaEnv=g,g.$async&&(U.$async=!0),this.opts.code.source===!0&&(U.source={validateName:k,validateCode:q,scopeValues:b._values}),this.opts.unevaluated){const{props:B,items:W}=$;U.evaluated={props:B instanceof e.Name?void 0:B,items:W instanceof e.Name?void 0:W,dynamicProps:B instanceof e.Name,dynamicItems:W instanceof e.Name},U.source&&(U.source.evaluated=(0,e.stringify)(U.evaluated))}return g.validate=U,g}catch(q){throw delete g.validate,delete g.validateName,M&&this.logger.error("Error compiling schema, function code:",M),q}finally{this._compilations.delete(g)}}Tt.compileSchema=o;function c(g,y,f){var C;f=(0,n.resolveUrl)(this.opts.uriResolver,y,f);const P=g.refs[f];if(P)return P;let h=_.call(this,g,f);if(h===void 0){const b=(C=g.localRefs)===null||C===void 0?void 0:C[f],{schemaId:O}=this.opts;b&&(h=new a({schema:b,schemaId:O,root:g,baseId:y}))}if(h!==void 0)return g.refs[f]=l.call(this,h)}Tt.resolveRef=c;function l(g){return(0,n.inlineRef)(g.schema,this.opts.inlineRefs)?g.schema:g.validate?g:o.call(this,g)}function u(g){for(const y of this._compilations)if(m(y,g))return y}Tt.getCompilingSchema=u;function m(g,y){return g.schema===y.schema&&g.root===y.root&&g.baseId===y.baseId}function _(g,y){let f;for(;typeof(f=this.refs[y])=="string";)y=f;return f||this.schemas[y]||v.call(this,g,y)}function v(g,y){const f=this.opts.uriResolver.parse(y),C=(0,n._getFullPath)(this.opts.uriResolver,f);let P=(0,n.getFullPath)(this.opts.uriResolver,g.baseId,void 0);if(Object.keys(g.schema).length>0&&C===P)return E.call(this,f,g);const h=(0,n.normalizeId)(C),b=this.refs[h]||this.schemas[h];if(typeof b=="string"){const O=v.call(this,g,b);return typeof O?.schema!="object"?void 0:E.call(this,f,O)}if(typeof b?.schema=="object"){if(b.validate||o.call(this,b),h===(0,n.normalizeId)(y)){const{schema:O}=b,{schemaId:k}=this.opts,$=O[k];return $&&(P=(0,n.resolveUrl)(this.opts.uriResolver,P,$)),new a({schema:O,schemaId:k,root:g,baseId:P})}return E.call(this,f,b)}}Tt.resolveSchema=v;const S=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function E(g,{baseId:y,schema:f,root:C}){var P;if(((P=g.fragment)===null||P===void 0?void 0:P[0])!=="/")return;for(const O of g.fragment.slice(1).split("/")){if(typeof f=="boolean")return;const k=f[(0,s.unescapeFragment)(O)];if(k===void 0)return;f=k;const $=typeof f=="object"&&f[this.opts.schemaId];!S.has(O)&&$&&(y=(0,n.resolveUrl)(this.opts.uriResolver,y,$))}let h;if(typeof f!="boolean"&&f.$ref&&!(0,s.schemaHasRulesButRef)(f,this.RULES)){const O=(0,n.resolveUrl)(this.opts.uriResolver,y,f.$ref);h=v.call(this,C,O)}const{schemaId:b}=this.opts;if(h=h||new a({schema:f,schemaId:b,root:C,baseId:y}),h.schema!==h.root.schema)return h}return Tt}const SS="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",wS="Meta-schema for $data reference (JSON AnySchema extension proposal)",CS="object",ES=["$data"],AS={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},xS=!1,PS={$id:SS,description:wS,type:CS,required:ES,properties:AS,additionalProperties:xS};var es={},bi={exports:{}},Xo,Ed;function Ym(){if(Ed)return Xo;Ed=1;const e=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),t=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),r=RegExp.prototype.test.bind(/^\d*$/u),n=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),s=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),i=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/]$/u),a=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/?]$/u),o=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:]$/u),c=new Array(256);{const A="0123456789ABCDEF";for(let w=0;w<256;w++)c[w]="%"+A[w>>4]+A[w&15]}function l(A){return A<2048?c[192|A>>6]+c[128|A&63]:A<65536?c[224|A>>12]+c[128|A>>6&63]+c[128|A&63]:c[240|A>>18]+c[128|A>>12&63]+c[128|A>>6&63]+c[128|A&63]}function u(A){let w="",j=0,p=0;for(p=0;p<A.length;p++)if(j=A[p].charCodeAt(0),j!==48){if(!(j>=48&&j<=57||j>=65&&j<=70||j>=97&&j<=102))return"";w+=A[p];break}for(p+=1;p<A.length;p++){if(j=A[p].charCodeAt(0),!(j>=48&&j<=57||j>=65&&j<=70||j>=97&&j<=102))return"";w+=A[p]}return w}const m=RegExp.prototype.test.bind(/^[\dA-Fa-f]{1,4}$/),_=RegExp.prototype.test.bind(/^[vV][\dA-Fa-f]+\.[A-Za-z\d\-._~!$&'()*+,;=:]+$/),v=RegExp.prototype.test.bind(/^[A-Za-z\d\-._~]$/),S=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function E(A){if(A.length===0)return!1;for(let w=0;w<A.length;w++)if(!v(A[w])){if(A[w]==="%"&&w+2<A.length&&n(A.slice(w+1,w+3))){w+=2;continue}return!1}return!0}function g(A){let w=-1,j=0,p=-1,d=0;for(let T=0;T<A.length;T++)A[T]==="0"?(p===-1&&(p=T),d++,d>j&&(j=d,w=p)):(p=-1,d=0);if(j<2)return A.join(":");const x=A.slice(0,w).join(":"),I=A.slice(w+j).join(":");return x+"::"+I}function y(A){const w=A.indexOf("::");if(w!==-1&&A.indexOf("::",w+1)!==-1)return;const j=w===-1?A.split(":"):A.slice(0,w).split(":"),p=w===-1?[]:A.slice(w+2).split(":");w!==-1&&(j.length===1&&j[0]===""&&(j.length=0),p.length===1&&p[0]===""&&(p.length=0));const d=j.concat(p);let x=0;for(let T=0;T<d.length;T++){const F=d[T];if(F==="")return;if(F.indexOf(".")!==-1){if(T!==d.length-1||w!==-1&&p.length===0||!t(F))return;x+=2;continue}if(!m(F))return;d[T]=parseInt(F,16).toString(16),x++}if(w===-1)return x!==8?void 0:g(d);if(x>=8)return;const I=d.slice(0,j.length);for(let T=x;T<8;T++)I.push("0");for(let T=j.length;T<d.length;T++)I.push(d[T]);return g(I)}function f(A){const w=A[0]==="["&&A[A.length-1]==="]";if((A[0]==="["||A[A.length-1]==="]")&&!w)return{host:A,isIPV6:!1,error:!0};let p=w?A.slice(1,-1):A;if(w&&_(p))return p=p.toLowerCase(),{host:`[${p}]`,escapedHost:p,isIPV6:!1,isIPVFuture:!0};if(C(p,":")<2)return{host:A,isIPV6:!1,error:w};let d="";const x=p.indexOf("%");if(x!==-1){const T=p.slice(x,x+3).toLowerCase()==="%25"?3:1;if(d=p.slice(x+T),!E(d))return{host:A,isIPV6:!1,error:!0};p=p.slice(0,x)}const I=y(p);return I===void 0?{host:A,isIPV6:!1,error:!0}:{host:I+(d?"%"+d:""),escapedHost:I+(d?"%25"+d:""),isIPV6:!0}}function C(A,w){let j=0;for(let p=0;p<A.length;p++)A[p]===w&&j++;return j}function P(A){let w=A;const j=[];let p=-1,d=0;for(;d=w.length;){if(d===1){if(w===".")break;if(w==="/"){j.push("/");break}else{j.push(w);break}}else if(d===2){if(w[0]==="."){if(w[1]===".")break;if(w[1]==="/"){w=w.slice(2);continue}}else if(w[0]==="/"&&(w[1]==="."||w[1]==="/")){j.push("/");break}}else if(d===3&&w==="/.."){j.length!==0&&j.pop(),j.push("/");break}if(w[0]==="."){if(w[1]==="."){if(w[2]==="/"){w=w.slice(3);continue}}else if(w[1]==="/"){w=w.slice(2);continue}}else if(w[0]==="/"&&w[1]==="."){if(w[2]==="/"){w=w.slice(2);continue}else if(w[2]==="."&&w[3]==="/"){w=w.slice(3),j.length!==0&&j.pop();continue}}if((p=w.indexOf("/",1))===-1){j.push(w);break}else j.push(w.slice(0,p)),w=w.slice(p)}return j.join("")}const h={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},b=/[@/?#:]/g,O=/[@/?#]/g;function k(A,w){const j=w?O:b;return j.lastIndex=0,A.replace(j,p=>h[p])}function $(A,w=!1){if(A.indexOf("%")===-1)return A;let j="";for(let p=0;p<A.length;p++){if(A[p]==="%"&&p+2<A.length){const d=A.slice(p+1,p+3);if(n(d)){const x=d.toUpperCase(),I=String.fromCharCode(parseInt(x,16));w&&s(I)?j+=I:j+="%"+x,p+=2;continue}}j+=A[p]}return j}function M(A){let w="";for(let j=0;j<A.length;j++){const p=A[j];if(p==="%"&&j+2<A.length){const d=A.slice(j+1,j+3);if(n(d)){const x=d.toUpperCase(),I=String.fromCharCode(parseInt(x,16));I!=="."&&s(I)?w+=I:w+="%"+x,j+=2;continue}}if(i(p))w+=p;else{const d=A.charCodeAt(j);if(d<128)w+=Y(d)?p:c[d];else if(d<55296||d>57343)w+=l(d);else if(d<=56319&&j+1<A.length){const x=A.charCodeAt(j+1);x>=56320&&x<=57343?(w+=l(65536+(d-55296<<10)+(x-56320)),j++):w+=l(65533)}else w+=l(65533)}}return w}function q(A,w=!1){let j="",p=w&&A[0]!=="/";for(let d=0;d<A.length;d++){const x=A[d];if(x==="%"&&d+2<A.length){const I=A.slice(d+1,d+3);if(n(I)){j+="%"+I.toUpperCase(),d+=2;continue}}if(x==="/"&&(p=!1),i(x)&&(x!==":"||!p))j+=x;else{const I=A.charCodeAt(d);if(I<128)j+=c[I];else if(I<55296||I>57343)j+=l(I);else if(I<=56319&&d+1<A.length){const T=A.charCodeAt(d+1);T>=56320&&T<=57343?(j+=l(65536+(I-55296<<10)+(T-56320)),d++):j+=l(65533)}else j+=l(65533)}}return j}function L(A,w){let j="";for(let p=0;p<A.length;p++){const d=A[p];if(d==="%"&&p+2<A.length){const x=A.slice(p+1,p+3);if(n(x)){j+="%"+x.toUpperCase(),p+=2;continue}}if(w(d))j+=d;else{const x=A.charCodeAt(p);if(x<128)j+=c[x];else if(x<55296||x>57343)j+=l(x);else if(x<=56319&&p+1<A.length){const I=A.charCodeAt(p+1);I>=56320&&I<=57343?(j+=l(65536+(x-55296<<10)+(I-56320)),p++):j+=l(65533)}else j+=l(65533)}}return j}function U(A){return L(A,o)}function B(A){return L(A,a)}function W(A){return L(A,a)}function Y(A){return A>=48&&A<=57||A>=65&&A<=90||A>=97&&A<=122||A===42||A===43||A===45||A===46||A===47||A===64||A===95}function Q(A){let w="";for(let j=0;j<A.length;j++){const p=A[j];if(p==="%"&&j+2<A.length){const d=A.slice(j+1,j+3);if(n(d)){const x=d.toUpperCase(),I=String.fromCharCode(parseInt(x,16));s(I)?w+=I:w+="%"+x,j+=2;continue}}if(a(p))w+=p;else{const d=A.charCodeAt(j);if(d<128)w+=Y(d)?p:c[d];else if(d<55296||d>57343)w+=l(d);else if(d<=56319&&j+1<A.length){const x=A.charCodeAt(j+1);x>=56320&&x<=57343?(w+=l(65536+(d-55296<<10)+(x-56320)),j++):w+=l(65533)}else w+=l(65533)}}return w}function Z(A){let w="";for(let j=0;j<A.length;j++){if(A[j]==="%"&&j+2<A.length){const p=A.slice(j+1,j+3);if(n(p)){w+="%"+p.toUpperCase(),j+=2;continue}}w+=escape(A[j])}return w}function re(A){const w=[];if(A.userinfo!==void 0&&(w.push(U(A.userinfo)),w.push("@")),A.host!==void 0){let j=A.host;if(!t(j)){let p=f(j);p.isIPV6!==!0&&p.isIPVFuture!==!0&&(j=$(j,!0),p=f(j)),p.isIPV6===!0||p.isIPVFuture===!0?j=`[${p.escapedHost}]`:j=k(j,!1)}w.push(j)}if(typeof A.port=="number"||typeof A.port=="string"){const j=String(A.port);if(!r(j))throw new TypeError("URI port is malformed.");w.push(":"),w.push(j)}return w.length?w.join(""):void 0}return Xo={nonSimpleDomain:S,recomposeAuthority:re,reescapeHostDelimiters:k,normalizePercentEncoding:$,normalizePathEncoding:M,serializePathEncoding:q,normalizeQueryFragmentEncoding:Q,encodeUserinfo:U,encodeQuery:B,encodeFragment:W,escapePreservingEscapes:Z,removeDotSegments:P,isIPv4:t,isUUID:e,normalizeIPv6:f,stringArrayToHexStripped:u},Xo}var Zo,Ad;function OS(){if(Ad)return Zo;Ad=1;const{isUUID:e}=Ym(),t=/^([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-./:;=@]|%[\da-f]{2})+)$/iu,r=["http","https","ws","wss","urn","urn:uuid"];function n(h){return r.indexOf(h)!==-1}function s(h){return h.secure===!0?!0:h.secure===!1?!1:h.scheme?h.scheme.length===3&&(h.scheme[0]==="w"||h.scheme[0]==="W")&&(h.scheme[1]==="s"||h.scheme[1]==="S")&&(h.scheme[2]==="s"||h.scheme[2]==="S"):!1}function i(h){return h.host||(h.error=h.error||"HTTP URIs must have a host."),h}function a(h){const b=String(h.scheme).toLowerCase()==="https";return(h.port===(b?443:80)||h.port==="")&&(h.port=void 0),h.path||(h.path="/"),h}function o(h){return h.secure=s(h),h.resourceName=(h.path||"/")+(h.query?"?"+h.query:""),h.path=void 0,h.query=void 0,h}function c(h){if((h.port===(s(h)?443:80)||h.port==="")&&(h.port=void 0),typeof h.secure=="boolean"&&(h.scheme=h.secure?"wss":"ws",h.secure=void 0),h.resourceName){const b=h.resourceName.indexOf("?"),O=b===-1?h.resourceName:h.resourceName.slice(0,b);h.path=O&&O!=="/"?O:void 0,h.query=b===-1?void 0:h.resourceName.slice(b+1),h.resourceName=void 0}return h.fragment=void 0,h}function l(h,b){if(!h.path)return h.error="URN can not be parsed",h;const O=h.path.match(t);if(O&&O[0]===h.path){const k=b.scheme||h.scheme||"urn";h.nid=O[1].toLowerCase(),h.nss=O[2];const $=`${k}:${b.nid||h.nid}`,M=P($);h.path=void 0,M&&(h=M.parse(h,b))}else h.error=h.error||"URN can not be parsed.";return h}function u(h,b){if(h.nid===void 0)throw new Error("URN without nid cannot be serialized");const O=b.scheme||h.scheme||"urn",k=h.nid.toLowerCase(),$=`${O}:${b.nid||k}`,M=P($);M&&(h=M.serialize(h,b));const q=h,L=h.nss;return q.path=`${k||b.nid}:${L}`,b.skipEscape=!0,q}function m(h,b){const O=h;return O.uuid=O.nss,O.nss=void 0,!b.tolerant&&(!O.uuid||!e(O.uuid))&&(O.error=O.error||"UUID is not valid."),O}function _(h){const b=h;return b.nss=(h.uuid||"").toLowerCase(),b}const v={scheme:"http",domainHost:!0,parse:i,serialize:a},S={scheme:"https",domainHost:v.domainHost,parse:i,serialize:a},E={scheme:"ws",domainHost:!0,parse:o,serialize:c},g={scheme:"wss",domainHost:E.domainHost,parse:E.parse,serialize:E.serialize},C={http:v,https:S,ws:E,wss:g,urn:{scheme:"urn",parse:l,serialize:u,skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:m,serialize:_,skipNormalize:!0}};Object.setPrototypeOf(C,null);function P(h){return h&&(C[h]||C[h.toLowerCase()])||void 0}return Zo={wsIsSecure:s,SCHEMES:C,isValidSchemeName:n,getSchemeHandler:P},Zo}var xd;function jS(){if(xd)return bi.exports;xd=1;const{normalizeIPv6:e,removeDotSegments:t,recomposeAuthority:r,normalizePercentEncoding:n,normalizePathEncoding:s,serializePathEncoding:i,normalizeQueryFragmentEncoding:a,encodeQuery:o,encodeFragment:c,reescapeHostDelimiters:l,isIPv4:u,nonSimpleDomain:m}=Ym(),{SCHEMES:_,getSchemeHandler:v}=OS(),S=/^[A-Za-z][A-Za-z0-9+.-]*$/u,E="URI scheme is malformed.";function g(A){const w=unescape(String(A));if(!S.test(w))throw new TypeError(E);return w}function y(A,w){return typeof A=="string"?A=Y(A,w):typeof A=="object"&&(A=W(h(A,w),w)),A}function f(A,w,j){const p=j?Object.assign({scheme:"null"},j):{scheme:"null"},{parsed:d,malformedAuthorityOrPort:x,malformedPercentEncoding:I,malformedSchemeSpecific:T,malformedHost:F,malformedScheme:z}=B(A,p),{parsed:H,malformedAuthorityOrPort:R,malformedPercentEncoding:D,malformedSchemeSpecific:V,malformedHost:K,malformedScheme:G}=B(w,p);if(x||R||I||D||T||V||F||K||z||G)throw new Error(d.error||H.error||"URI is malformed.");const J=C(d,H,p,!0),te=v(j&&j.scheme||J.scheme),ne=J.host,se=ne!==void 0&&ne!==""&&(u(ne)||e(ne).isIPV6);U(J,j||{},te,se);const ce=ne&&ne.indexOf("%")!==-1&&!new RegExp("\\P{ASCII}","u").test(ne);if(J.error&&!ce)throw new Error(J.error);return p.skipEscape=!0,h(J,p)}function C(A,w,j,p){const d={};return p||(A=W(h(A,j),j),w=W(h(w,j),j)),j=j||{},!j.tolerant&&w.scheme?(d.scheme=w.scheme,d.userinfo=w.userinfo,d.host=w.host,d.port=w.port,d.path=t(w.path||""),d.query=w.query):(w.userinfo!==void 0||w.host!==void 0||w.port!==void 0?(d.userinfo=w.userinfo,d.host=w.host,d.port=w.port,d.path=t(w.path||""),d.query=w.query):(w.path?(w.path[0]==="/"?d.path=t(w.path):((A.userinfo!==void 0||A.host!==void 0||A.port!==void 0)&&!A.path?d.path="/"+w.path:A.path?d.path=A.path.slice(0,A.path.lastIndexOf("/")+1)+w.path:d.path=w.path,d.path=t(d.path)),d.query=w.query):(d.path=A.path,w.query!==void 0?d.query=w.query:d.query=A.query),d.userinfo=A.userinfo,d.host=A.host,d.port=A.port),d.scheme=A.scheme),d.fragment=w.fragment,d}function P(A,w,j){const p=Z(A,j),d=Z(w,j);return p!==void 0&&d!==void 0&&p===d}function h(A,w){const j={host:A.host,scheme:A.scheme,userinfo:A.userinfo,port:A.port,path:A.path,query:A.query,nid:A.nid,nss:A.nss,uuid:A.uuid,fragment:A.fragment,reference:A.reference,resourceName:A.resourceName,secure:A.secure,error:""},p=Object.assign({},w),d=[];j.scheme&&(j.scheme=g(j.scheme));const x=v(p.scheme||j.scheme);x&&x.serialize&&x.serialize(j,p);const I=j.userinfo!==void 0||j.host!==void 0||j.port!==void 0,T=!p.skipEscape&&j.scheme===void 0&&!I;j.path!==void 0&&(p.skipEscape?j.path=n(j.path):j.path=i(j.path,T)),p.reference!=="suffix"&&j.scheme&&(j.scheme=g(j.scheme),d.push(j.scheme,":"));const F=r(j);if(F!==void 0&&(p.reference!=="suffix"&&d.push("//"),d.push(F),j.path&&j.path[0]!=="/"&&d.push("/")),j.path!==void 0){let z=j.path;!p.absolutePath&&(!x||!x.absolutePath)&&(z=t(z)),T&&(z=i(z,!0)),F===void 0&&z[0]==="/"&&z[1]==="/"&&(z="/%2F"+z.slice(2)),d.push(z)}return j.query!==void 0&&d.push("?",o(j.query)),j.fragment!==void 0&&d.push("#",c(j.fragment)),d.join("")}const b=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u,O=/^(?:[^#/:?]+:)?\/\/([^/?#]*)/,k=/^(?:[^#/:?]+:)?([/\\\t\n\r]*)/;function $(A,w){if(w[2]!==void 0&&A.path&&A.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof A.port=="number"&&(A.port<0||A.port>65535))return"URI port is malformed."}function M(A){if(A===void 0)return!1;let w=A.indexOf("%");for(;w!==-1;){if(w+2>=A.length||!/^[\da-f]{2}$/iu.test(A.slice(w+1,w+3)))return!0;w=A.indexOf("%",w+3)}return!1}function q(A){return A[0]==="["&&A[A.length-1]==="]"}function L(A){const w=A[4];return M(A[3])||w!==void 0&&!q(w)&&M(w)||M(A[6])||M(A[7])||M(A[8])}function U(A,w,j,p){if(!w.unicodeSupport&&(!j||!j.unicodeSupport)&&A.host&&!q(A.host)&&(w.domainHost||j&&j.domainHost)&&p===!1&&m(A.host))try{A.host=new URL("http://"+A.host).hostname}catch(d){return A.error=A.error||"Host's domain name can not be converted to ASCII: "+d,!0}return!1}function B(A,w){const j=Object.assign({},w),p={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0};let d=!1,x=!1,I=!1,T=!1,F=!1,z=!1,H=!1;j.reference==="suffix"&&(j.scheme?A=j.scheme+":"+A:A="//"+A);const R=A.match(O);R!==null&&R[1].indexOf("\\")!==-1&&(p.error="URI authority must not contain a literal backslash.",d=!0);const D=A.match(k);if(D!==null){const K=D[1],G=K.replace(/[\t\n\r]/g,"");G.length>=2&&(G.slice(0,2)!=="//"?(p.error=p.error||"URI authority must not contain a literal backslash.",d=!0):K.length!==G.length&&(p.error=p.error||"URI authority introducer must not contain whitespace.",d=!0))}const V=A.match(b);if(V){if(p.scheme=V[1],p.userinfo=V[3],p.host=V[4],p.port=parseInt(V[5],10),p.path=V[6]||"",p.query=V[7],p.fragment=V[8],p.scheme!==void 0){const J=unescape(p.scheme);S.test(J)?p.scheme=J.toLowerCase():(p.error=p.error||E,z=!0)}x=L(V),x&&(p.error=p.error||"URI contains malformed percent-encoding."),isNaN(p.port)&&(p.port=V[5]);const K=$(p,V);if(K!==void 0&&(p.error=p.error||K,d=!0),p.host)if(u(p.host)===!1){const te=q(p.host),ne=p.host.indexOf("[")!==-1||p.host.indexOf("]")!==-1,se=e(p.host);H=se.isIPV6||se.isIPVFuture===!0,F=ne&&(!te||se.error===!0),p.host=H?se.host:se.host.toLowerCase(),F&&(p.error=p.error||"URI host is malformed.",d=!0)}else H=!0;p.scheme===void 0&&p.userinfo===void 0&&p.host===void 0&&p.port===void 0&&p.query===void 0&&!p.path?p.reference="same-document":p.scheme===void 0?p.reference="relative":p.fragment===void 0?p.reference="absolute":p.reference="uri",j.reference&&j.reference!=="suffix"&&j.reference!==p.reference&&(p.error=p.error||"URI is not a "+j.reference+" reference.");const G=v(j.scheme||p.scheme);if(F||(T=U(p,j,G,H)),!G||G&&!G.skipNormalize){if(A.indexOf("%")!==-1&&p.host!==void 0&&!F){const J=H?p.host:n(p.host,!0);p.host=l(J,H)}p.path&&(p.path=s(p.path)),p.query&&(p.query=a(p.query)),p.fragment&&(p.fragment=a(p.fragment))}G&&G.parse&&(G.parse(p,j),G===_.urn&&p.nid===void 0&&(I=!0))}else p.error=p.error||"URI can not be parsed.";return{parsed:p,malformedAuthorityOrPort:d,malformedPercentEncoding:x,malformedSchemeSpecific:I,malformedHost:T,malformedScheme:z}}function W(A,w){return B(A,w).parsed}function Y(A,w){return Q(A,w).normalized}function Q(A,w){const{parsed:j,malformedAuthorityOrPort:p,malformedPercentEncoding:d,malformedSchemeSpecific:x,malformedHost:I,malformedScheme:T}=B(A,w);return{normalized:p||d||x||I||T?A:h(j,w),malformedAuthorityOrPort:p,malformedPercentEncoding:d,malformedSchemeSpecific:x,malformedHost:I,malformedScheme:T}}function Z(A,w){if(typeof A!="string"&&typeof A!="object")return;let j;try{j=typeof A=="string"?A:h(A,w)}catch{return}const{normalized:p,malformedAuthorityOrPort:d,malformedPercentEncoding:x,malformedSchemeSpecific:I,malformedHost:T,malformedScheme:F}=Q(j,w);return d||x||I||T||F?void 0:p}const re={SCHEMES:_,normalize:y,resolve:f,resolveComponent:C,equal:P,serialize:h,parse:W};return bi.exports=re,bi.exports.default=re,bi.exports.fastUri=re,bi.exports}var Pd;function kS(){if(Pd)return es;Pd=1,Object.defineProperty(es,"__esModule",{value:!0});const e=jS();return e.code='require("ajv/dist/runtime/uri").default',es.default=e,es}var Od;function NS(){return Od||(Od=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var t=ro();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var r=Re();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return r.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return r.CodeGen}});const n=ul(),s=no(),i=Wm(),a=dl(),o=Re(),c=to(),l=Va(),u=Te(),m=PS,_=kS(),v=(A,w)=>new RegExp(A,w);v.code="new RegExp";const S=["removeAdditional","useDefaults","coerceTypes"],E=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),g={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},y={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},f=200;function C(A){var w,j,p,d,x,I,T,F,z,H,R,D,V,K,G,J,te,ne,se,ce,he,le,ge,Fe,fe;const Ye=A.strict,ye=(w=A.code)===null||w===void 0?void 0:w.optimize,oe=ye===!0||ye===void 0?1:ye||0,ft=(p=(j=A.code)===null||j===void 0?void 0:j.regExp)!==null&&p!==void 0?p:v,ke=(d=A.uriResolver)!==null&&d!==void 0?d:_.default;return{strictSchema:(I=(x=A.strictSchema)!==null&&x!==void 0?x:Ye)!==null&&I!==void 0?I:!0,strictNumbers:(F=(T=A.strictNumbers)!==null&&T!==void 0?T:Ye)!==null&&F!==void 0?F:!0,strictTypes:(H=(z=A.strictTypes)!==null&&z!==void 0?z:Ye)!==null&&H!==void 0?H:"log",strictTuples:(D=(R=A.strictTuples)!==null&&R!==void 0?R:Ye)!==null&&D!==void 0?D:"log",strictRequired:(K=(V=A.strictRequired)!==null&&V!==void 0?V:Ye)!==null&&K!==void 0?K:!1,code:A.code?{...A.code,optimize:oe,regExp:ft}:{optimize:oe,regExp:ft},loopRequired:(G=A.loopRequired)!==null&&G!==void 0?G:f,loopEnum:(J=A.loopEnum)!==null&&J!==void 0?J:f,meta:(te=A.meta)!==null&&te!==void 0?te:!0,messages:(ne=A.messages)!==null&&ne!==void 0?ne:!0,inlineRefs:(se=A.inlineRefs)!==null&&se!==void 0?se:!0,schemaId:(ce=A.schemaId)!==null&&ce!==void 0?ce:"$id",addUsedSchema:(he=A.addUsedSchema)!==null&&he!==void 0?he:!0,validateSchema:(le=A.validateSchema)!==null&&le!==void 0?le:!0,validateFormats:(ge=A.validateFormats)!==null&&ge!==void 0?ge:!0,unicodeRegExp:(Fe=A.unicodeRegExp)!==null&&Fe!==void 0?Fe:!0,int32range:(fe=A.int32range)!==null&&fe!==void 0?fe:!0,uriResolver:ke}}class P{constructor(w={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,w=this.opts={...w,...C(w)};const{es5:j,lines:p}=this.opts.code;this.scope=new o.ValueScope({scope:{},prefixes:E,es5:j,lines:p}),this.logger=L(w.logger);const d=w.validateFormats;w.validateFormats=!1,this.RULES=(0,i.getRules)(),h.call(this,g,w,"NOT SUPPORTED"),h.call(this,y,w,"DEPRECATED","warn"),this._metaOpts=M.call(this),w.formats&&k.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),w.keywords&&$.call(this,w.keywords),typeof w.meta=="object"&&this.addMetaSchema(w.meta),O.call(this),w.validateFormats=d}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:w,meta:j,schemaId:p}=this.opts;let d=m;p==="id"&&(d={...m},d.id=d.$id,delete d.$id),j&&w&&this.addMetaSchema(d,d[p],!1)}defaultMeta(){const{meta:w,schemaId:j}=this.opts;return this.opts.defaultMeta=typeof w=="object"?w[j]||w:void 0}validate(w,j){let p;if(typeof w=="string"){if(p=this.getSchema(w),!p)throw new Error(`no schema with key or ref "${w}"`)}else p=this.compile(w);const d=p(j);return"$async"in p||(this.errors=p.errors),d}compile(w,j){const p=this._addSchema(w,j);return p.validate||this._compileSchemaEnv(p)}compileAsync(w,j){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:p}=this.opts;return d.call(this,w,j);async function d(H,R){await x.call(this,H.$schema);const D=this._addSchema(H,R);return D.validate||I.call(this,D)}async function x(H){H&&!this.getSchema(H)&&await d.call(this,{$ref:H},!0)}async function I(H){try{return this._compileSchemaEnv(H)}catch(R){if(!(R instanceof s.default))throw R;return T.call(this,R),await F.call(this,R.missingSchema),I.call(this,H)}}function T({missingSchema:H,missingRef:R}){if(this.refs[H])throw new Error(`AnySchema ${H} is loaded but ${R} cannot be resolved`)}async function F(H){const R=await z.call(this,H);this.refs[H]||await x.call(this,R.$schema),this.refs[H]||this.addSchema(R,H,j)}async function z(H){const R=this._loading[H];if(R)return R;try{return await(this._loading[H]=p(H))}finally{delete this._loading[H]}}}addSchema(w,j,p,d=this.opts.validateSchema){if(Array.isArray(w)){for(const I of w)this.addSchema(I,void 0,p,d);return this}let x;if(typeof w=="object"){const{schemaId:I}=this.opts;if(x=w[I],x!==void 0&&typeof x!="string")throw new Error(`schema ${I} must be string`)}return j=(0,c.normalizeId)(j||x),this._checkUnique(j),this.schemas[j]=this._addSchema(w,p,j,d,!0),this}addMetaSchema(w,j,p=this.opts.validateSchema){return this.addSchema(w,j,!0,p),this}validateSchema(w,j){if(typeof w=="boolean")return!0;let p;if(p=w.$schema,p!==void 0&&typeof p!="string")throw new Error("$schema must be a string");if(p=p||this.opts.defaultMeta||this.defaultMeta(),!p)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const d=this.validate(p,w);if(!d&&j){const x="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(x);else throw new Error(x)}return d}getSchema(w){let j;for(;typeof(j=b.call(this,w))=="string";)w=j;if(j===void 0){const{schemaId:p}=this.opts,d=new a.SchemaEnv({schema:{},schemaId:p});if(j=a.resolveSchema.call(this,d,w),!j)return;this.refs[w]=j}return j.validate||this._compileSchemaEnv(j)}removeSchema(w){if(w instanceof RegExp)return this._removeAllSchemas(this.schemas,w),this._removeAllSchemas(this.refs,w),this;switch(typeof w){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const j=b.call(this,w);return typeof j=="object"&&this._cache.delete(j.schema),delete this.schemas[w],delete this.refs[w],this}case"object":{const j=w;this._cache.delete(j);let p=w[this.opts.schemaId];return p&&(p=(0,c.normalizeId)(p),delete this.schemas[p],delete this.refs[p]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(w){for(const j of w)this.addKeyword(j);return this}addKeyword(w,j){let p;if(typeof w=="string")p=w,typeof j=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),j.keyword=p);else if(typeof w=="object"&&j===void 0){if(j=w,p=j.keyword,Array.isArray(p)&&!p.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(B.call(this,p,j),!j)return(0,u.eachItem)(p,x=>W.call(this,x)),this;Q.call(this,j);const d={...j,type:(0,l.getJSONTypes)(j.type),schemaType:(0,l.getJSONTypes)(j.schemaType)};return(0,u.eachItem)(p,d.type.length===0?x=>W.call(this,x,d):x=>d.type.forEach(I=>W.call(this,x,d,I))),this}getKeyword(w){const j=this.RULES.all[w];return typeof j=="object"?j.definition:!!j}removeKeyword(w){const{RULES:j}=this;delete j.keywords[w],delete j.all[w];for(const p of j.rules){const d=p.rules.findIndex(x=>x.keyword===w);d>=0&&p.rules.splice(d,1)}return this}addFormat(w,j){return typeof j=="string"&&(j=new RegExp(j)),this.formats[w]=j,this}errorsText(w=this.errors,{separator:j=", ",dataVar:p="data"}={}){return!w||w.length===0?"No errors":w.map(d=>`${p}${d.instancePath} ${d.message}`).reduce((d,x)=>d+j+x)}$dataMetaSchema(w,j){const p=this.RULES.all;w=JSON.parse(JSON.stringify(w));for(const d of j){const x=d.split("/").slice(1);let I=w;for(const T of x)I=I[T];for(const T in p){const F=p[T];if(typeof F!="object")continue;const{$data:z}=F.definition,H=I[T];z&&H&&(I[T]=re(H))}}return w}_removeAllSchemas(w,j){for(const p in w){const d=w[p];(!j||j.test(p))&&(typeof d=="string"?delete w[p]:d&&!d.meta&&(this._cache.delete(d.schema),delete w[p]))}}_addSchema(w,j,p,d=this.opts.validateSchema,x=this.opts.addUsedSchema){let I;const{schemaId:T}=this.opts;if(typeof w=="object")I=w[T];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof w!="boolean")throw new Error("schema must be object or boolean")}let F=this._cache.get(w);if(F!==void 0)return F;p=(0,c.normalizeId)(I||p);const z=c.getSchemaRefs.call(this,w,p);return F=new a.SchemaEnv({schema:w,schemaId:T,meta:j,baseId:p,localRefs:z}),this._cache.set(F.schema,F),x&&!p.startsWith("#")&&(p&&this._checkUnique(p),this.refs[p]=F),d&&this.validateSchema(w,!0),F}_checkUnique(w){if(this.schemas[w]||this.refs[w])throw new Error(`schema with key or id "${w}" already exists`)}_compileSchemaEnv(w){if(w.meta?this._compileMetaSchema(w):a.compileSchema.call(this,w),!w.validate)throw new Error("ajv implementation error");return w.validate}_compileMetaSchema(w){const j=this.opts;this.opts=this._metaOpts;try{a.compileSchema.call(this,w)}finally{this.opts=j}}}P.ValidationError=n.default,P.MissingRefError=s.default,e.default=P;function h(A,w,j,p="error"){for(const d in A){const x=d;x in w&&this.logger[p](`${j}: option ${d}. ${A[x]}`)}}function b(A){return A=(0,c.normalizeId)(A),this.schemas[A]||this.refs[A]}function O(){const A=this.opts.schemas;if(A)if(Array.isArray(A))this.addSchema(A);else for(const w in A)this.addSchema(A[w],w)}function k(){for(const A in this.opts.formats){const w=this.opts.formats[A];w&&this.addFormat(A,w)}}function $(A){if(Array.isArray(A)){this.addVocabulary(A);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const w in A){const j=A[w];j.keyword||(j.keyword=w),this.addKeyword(j)}}function M(){const A={...this.opts};for(const w of S)delete A[w];return A}const q={log(){},warn(){},error(){}};function L(A){if(A===!1)return q;if(A===void 0)return console;if(A.log&&A.warn&&A.error)return A;throw new Error("logger must implement log, warn and error methods")}const U=/^[a-z_$][a-z0-9_$:-]*$/i;function B(A,w){const{RULES:j}=this;if((0,u.eachItem)(A,p=>{if(j.keywords[p])throw new Error(`Keyword ${p} is already defined`);if(!U.test(p))throw new Error(`Keyword ${p} has invalid name`)}),!!w&&w.$data&&!("code"in w||"validate"in w))throw new Error('$data keyword must have "code" or "validate" function')}function W(A,w,j){var p;const d=w?.post;if(j&&d)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:x}=this;let I=d?x.post:x.rules.find(({type:F})=>F===j);if(I||(I={type:j,rules:[]},x.rules.push(I)),x.keywords[A]=!0,!w)return;const T={keyword:A,definition:{...w,type:(0,l.getJSONTypes)(w.type),schemaType:(0,l.getJSONTypes)(w.schemaType)}};w.before?Y.call(this,I,T,w.before):I.rules.push(T),x.all[A]=T,(p=w.implements)===null||p===void 0||p.forEach(F=>this.addKeyword(F))}function Y(A,w,j){const p=A.rules.findIndex(d=>d.keyword===j);p>=0?A.rules.splice(p,0,w):(A.rules.push(w),this.logger.warn(`rule ${j} is not defined`))}function Q(A){let{metaSchema:w}=A;w!==void 0&&(A.$data&&this.opts.$data&&(w=re(w)),A.validateSchema=this.compile(w,!0))}const Z={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function re(A){return{anyOf:[A,Z]}}})(Bo)),Bo}var ts={},rs={},ns={},jd;function IS(){if(jd)return ns;jd=1,Object.defineProperty(ns,"__esModule",{value:!0});const e={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};return ns.default=e,ns}var Tr={},kd;function RS(){if(kd)return Tr;kd=1,Object.defineProperty(Tr,"__esModule",{value:!0}),Tr.callRef=Tr.getValidate=void 0;const e=no(),t=sr(),r=Re(),n=rn(),s=dl(),i=Te(),a={keyword:"$ref",schemaType:"string",code(l){const{gen:u,schema:m,it:_}=l,{baseId:v,schemaEnv:S,validateName:E,opts:g,self:y}=_,{root:f}=S;if((m==="#"||m==="#/")&&v===f.baseId)return P();const C=s.resolveRef.call(y,f,v,m);if(C===void 0)throw new e.default(_.opts.uriResolver,v,m);if(C instanceof s.SchemaEnv)return h(C);return b(C);function P(){if(S===f)return c(l,E,S,S.$async);const O=u.scopeValue("root",{ref:f});return c(l,(0,r._)`${O}.validate`,f,f.$async)}function h(O){const k=o(l,O);c(l,k,O,O.$async)}function b(O){const k=u.scopeValue("schema",g.code.source===!0?{ref:O,code:(0,r.stringify)(O)}:{ref:O}),$=u.name("valid"),M=l.subschema({schema:O,dataTypes:[],schemaPath:r.nil,topSchemaRef:k,errSchemaPath:m},$);l.mergeEvaluated(M),l.ok($)}}};function o(l,u){const{gen:m}=l;return u.validate?m.scopeValue("validate",{ref:u.validate}):(0,r._)`${m.scopeValue("wrapper",{ref:u})}.validate`}Tr.getValidate=o;function c(l,u,m,_){const{gen:v,it:S}=l,{allErrors:E,schemaEnv:g,opts:y}=S,f=y.passContext?n.default.this:r.nil;_?C():P();function C(){if(!g.$async)throw new Error("async schema referenced by sync schema");const O=v.let("valid");v.try(()=>{v.code((0,r._)`await ${(0,t.callValidateCode)(l,u,f)}`),b(u),E||v.assign(O,!0)},k=>{v.if((0,r._)`!(${k} instanceof ${S.ValidationError})`,()=>v.throw(k)),h(k),E||v.assign(O,!1)}),l.ok(O)}function P(){l.result((0,t.callValidateCode)(l,u,f),()=>b(u),()=>h(u))}function h(O){const k=(0,r._)`${O}.errors`;v.assign(n.default.vErrors,(0,r._)`${n.default.vErrors} === null ? ${k} : ${n.default.vErrors}.concat(${k})`),v.assign(n.default.errors,(0,r._)`${n.default.vErrors}.length`)}function b(O){var k;if(!S.opts.unevaluated)return;const $=(k=m?.validate)===null||k===void 0?void 0:k.evaluated;if(S.props!==!0)if($&&!$.dynamicProps)$.props!==void 0&&(S.props=i.mergeEvaluated.props(v,$.props,S.props));else{const M=v.var("props",(0,r._)`${O}.evaluated.props`);S.props=i.mergeEvaluated.props(v,M,S.props,r.Name)}if(S.items!==!0)if($&&!$.dynamicItems)$.items!==void 0&&(S.items=i.mergeEvaluated.items(v,$.items,S.items));else{const M=v.var("items",(0,r._)`${O}.evaluated.items`);S.items=i.mergeEvaluated.items(v,M,S.items,r.Name)}}}return Tr.callRef=c,Tr.default=a,Tr}var Nd;function $S(){if(Nd)return rs;Nd=1,Object.defineProperty(rs,"__esModule",{value:!0});const e=IS(),t=RS(),r=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",e.default,t.default];return rs.default=r,rs}var is={},ss={},Id;function FS(){if(Id)return ss;Id=1,Object.defineProperty(ss,"__esModule",{value:!0});const e=Re(),t=e.operators,r={maximum:{okStr:"<=",ok:t.LTE,fail:t.GT},minimum:{okStr:">=",ok:t.GTE,fail:t.LT},exclusiveMaximum:{okStr:"<",ok:t.LT,fail:t.GTE},exclusiveMinimum:{okStr:">",ok:t.GT,fail:t.LTE}},n={message:({keyword:i,schemaCode:a})=>(0,e.str)`must be ${r[i].okStr} ${a}`,params:({keyword:i,schemaCode:a})=>(0,e._)`{comparison: ${r[i].okStr}, limit: ${a}}`},s={keyword:Object.keys(r),type:"number",schemaType:"number",$data:!0,error:n,code(i){const{keyword:a,data:o,schemaCode:c}=i;i.fail$data((0,e._)`${o} ${r[a].fail} ${c} || isNaN(${o})`)}};return ss.default=s,ss}var as={},Rd;function DS(){if(Rd)return as;Rd=1,Object.defineProperty(as,"__esModule",{value:!0});const e=Re(),r={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:n})=>(0,e.str)`must be multiple of ${n}`,params:({schemaCode:n})=>(0,e._)`{multipleOf: ${n}}`},code(n){const{gen:s,data:i,schemaCode:a,it:o}=n,c=o.opts.multipleOfPrecision,l=s.let("res"),u=c?(0,e._)`Math.abs(Math.round(${l}) - ${l}) > 1e-${c}`:(0,e._)`${l} !== parseInt(${l})`;n.fail$data((0,e._)`(${a} === 0 || (${l} = ${i}/${a}, ${u}))`)}};return as.default=r,as}var os={},cs={},$d;function TS(){if($d)return cs;$d=1,Object.defineProperty(cs,"__esModule",{value:!0});function e(t){const r=t.length;let n=0,s=0,i;for(;s<r;)n++,i=t.charCodeAt(s++),i>=55296&&i<=56319&&s<r&&(i=t.charCodeAt(s),(i&64512)===56320&&s++);return n}return cs.default=e,e.code='require("ajv/dist/runtime/ucs2length").default',cs}var Fd;function MS(){if(Fd)return os;Fd=1,Object.defineProperty(os,"__esModule",{value:!0});const e=Re(),t=Te(),r=TS(),s={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:i,schemaCode:a}){const o=i==="maxLength"?"more":"fewer";return(0,e.str)`must NOT have ${o} than ${a} characters`},params:({schemaCode:i})=>(0,e._)`{limit: ${i}}`},code(i){const{keyword:a,data:o,schemaCode:c,it:l}=i,u=a==="maxLength"?e.operators.GT:e.operators.LT,m=l.opts.unicode===!1?(0,e._)`${o}.length`:(0,e._)`${(0,t.useFunc)(i.gen,r.default)}(${o})`;i.fail$data((0,e._)`${m} ${u} ${c}`)}};return os.default=s,os}var ls={},Dd;function qS(){if(Dd)return ls;Dd=1,Object.defineProperty(ls,"__esModule",{value:!0});const e=sr(),t=Te(),r=Re(),s={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:i})=>(0,r.str)`must match pattern "${i}"`,params:({schemaCode:i})=>(0,r._)`{pattern: ${i}}`},code(i){const{gen:a,data:o,$data:c,schema:l,schemaCode:u,it:m}=i,_=m.opts.unicodeRegExp?"u":"";if(c){const{regExp:v}=m.opts.code,S=v.code==="new RegExp"?(0,r._)`new RegExp`:(0,t.useFunc)(a,v),E=a.let("valid");a.try(()=>a.assign(E,(0,r._)`${S}(${u}, ${_}).test(${o})`),()=>a.assign(E,!1)),i.fail$data((0,r._)`!${E}`)}else{const v=(0,e.usePattern)(i,l);i.fail$data((0,r._)`!${v}.test(${o})`)}}};return ls.default=s,ls}var us={},Td;function US(){if(Td)return us;Td=1,Object.defineProperty(us,"__esModule",{value:!0});const e=Re(),r={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:n,schemaCode:s}){const i=n==="maxProperties"?"more":"fewer";return(0,e.str)`must NOT have ${i} than ${s} properties`},params:({schemaCode:n})=>(0,e._)`{limit: ${n}}`},code(n){const{keyword:s,data:i,schemaCode:a}=n,o=s==="maxProperties"?e.operators.GT:e.operators.LT;n.fail$data((0,e._)`Object.keys(${i}).length ${o} ${a}`)}};return us.default=r,us}var ds={},Md;function LS(){if(Md)return ds;Md=1,Object.defineProperty(ds,"__esModule",{value:!0});const e=sr(),t=Re(),r=Te(),s={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:i}})=>(0,t.str)`must have required property '${i}'`,params:({params:{missingProperty:i}})=>(0,t._)`{missingProperty: ${i}}`},code(i){const{gen:a,schema:o,schemaCode:c,data:l,$data:u,it:m}=i,{opts:_}=m;if(!u&&o.length===0)return;const v=o.length>=_.loopRequired;if(m.allErrors?S():E(),_.strictRequired){const f=i.parentSchema.properties,{definedProperties:C}=i.it;for(const P of o)if(f?.[P]===void 0&&!C.has(P)){const h=m.schemaEnv.baseId+m.errSchemaPath,b=`required property "${P}" is not defined at "${h}" (strictRequired)`;(0,r.checkStrictMode)(m,b,m.opts.strictRequired)}}function S(){if(v||u)i.block$data(t.nil,g);else for(const f of o)(0,e.checkReportMissingProp)(i,f)}function E(){const f=a.let("missing");if(v||u){const C=a.let("valid",!0);i.block$data(C,()=>y(f,C)),i.ok(C)}else a.if((0,e.checkMissingProp)(i,o,f)),(0,e.reportMissingProp)(i,f),a.else()}function g(){a.forOf("prop",c,f=>{i.setParams({missingProperty:f}),a.if((0,e.noPropertyInData)(a,l,f,_.ownProperties),()=>i.error())})}function y(f,C){i.setParams({missingProperty:f}),a.forOf(f,c,()=>{a.assign(C,(0,e.propertyInData)(a,l,f,_.ownProperties)),a.if((0,t.not)(C),()=>{i.error(),a.break()})},t.nil)}}};return ds.default=s,ds}var fs={},qd;function VS(){if(qd)return fs;qd=1,Object.defineProperty(fs,"__esModule",{value:!0});const e=Re(),r={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:n,schemaCode:s}){const i=n==="maxItems"?"more":"fewer";return(0,e.str)`must NOT have ${i} than ${s} items`},params:({schemaCode:n})=>(0,e._)`{limit: ${n}}`},code(n){const{keyword:s,data:i,schemaCode:a}=n,o=s==="maxItems"?e.operators.GT:e.operators.LT;n.fail$data((0,e._)`${i}.length ${o} ${a}`)}};return fs.default=r,fs}var hs={},ms={},Ud;function fl(){if(Ud)return ms;Ud=1,Object.defineProperty(ms,"__esModule",{value:!0});const e=eo();return e.code='require("ajv/dist/runtime/equal").default',ms.default=e,ms}var Ld;function zS(){if(Ld)return hs;Ld=1,Object.defineProperty(hs,"__esModule",{value:!0});const e=Va(),t=Re(),r=Te(),n=fl(),i={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:a,j:o}})=>(0,t.str)`must NOT have duplicate items (items ## ${o} and ${a} are identical)`,params:({params:{i:a,j:o}})=>(0,t._)`{i: ${a}, j: ${o}}`},code(a){const{gen:o,data:c,$data:l,schema:u,parentSchema:m,schemaCode:_,it:v}=a;if(!l&&!u)return;const S=o.let("valid"),E=m.items?(0,e.getSchemaTypes)(m.items):[];a.block$data(S,g,(0,t._)`${_} === false`),a.ok(S);function g(){const P=o.let("i",(0,t._)`${c}.length`),h=o.let("j");a.setParams({i:P,j:h}),o.assign(S,!0),o.if((0,t._)`${P} > 1`,()=>(y()?f:C)(P,h))}function y(){return E.length>0&&!E.some(P=>P==="object"||P==="array")}function f(P,h){const b=o.name("item"),O=(0,e.checkDataTypes)(E,b,v.opts.strictNumbers,e.DataType.Wrong),k=o.const("indices",(0,t._)`{}`);o.for((0,t._)`;${P}--;`,()=>{o.let(b,(0,t._)`${c}[${P}]`),o.if(O,(0,t._)`continue`),E.length>1&&o.if((0,t._)`typeof ${b} == "string"`,(0,t._)`${b} += "_"`),o.if((0,t._)`typeof ${k}[${b}] == "number"`,()=>{o.assign(h,(0,t._)`${k}[${b}]`),a.error(),o.assign(S,!1).break()}).code((0,t._)`${k}[${b}] = ${P}`)})}function C(P,h){const b=(0,r.useFunc)(o,n.default),O=o.name("outer");o.label(O).for((0,t._)`;${P}--;`,()=>o.for((0,t._)`${h} = ${P}; ${h}--;`,()=>o.if((0,t._)`${b}(${c}[${P}], ${c}[${h}])`,()=>{a.error(),o.assign(S,!1).break(O)})))}}};return hs.default=i,hs}var ps={},Vd;function BS(){if(Vd)return ps;Vd=1,Object.defineProperty(ps,"__esModule",{value:!0});const e=Re(),t=Te(),r=fl(),s={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:i})=>(0,e._)`{allowedValue: ${i}}`},code(i){const{gen:a,data:o,$data:c,schemaCode:l,schema:u}=i;c||u&&typeof u=="object"?i.fail$data((0,e._)`!${(0,t.useFunc)(a,r.default)}(${o}, ${l})`):i.fail((0,e._)`${u} !== ${o}`)}};return ps.default=s,ps}var ys={},zd;function HS(){if(zd)return ys;zd=1,Object.defineProperty(ys,"__esModule",{value:!0});const e=Re(),t=Te(),r=fl(),s={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:i})=>(0,e._)`{allowedValues: ${i}}`},code(i){const{gen:a,data:o,$data:c,schema:l,schemaCode:u,it:m}=i;if(!c&&l.length===0)throw new Error("enum must have non-empty array");const _=l.length>=m.opts.loopEnum;let v;const S=()=>v??(v=(0,t.useFunc)(a,r.default));let E;if(_||c)E=a.let("valid"),i.block$data(E,g);else{if(!Array.isArray(l))throw new Error("ajv implementation error");const f=a.const("vSchema",u);E=(0,e.or)(...l.map((C,P)=>y(f,P)))}i.pass(E);function g(){a.assign(E,!1),a.forOf("v",u,f=>a.if((0,e._)`${S()}(${o}, ${f})`,()=>a.assign(E,!0).break()))}function y(f,C){const P=l[C];return typeof P=="object"&&P!==null?(0,e._)`${S()}(${o}, ${f}[${C}])`:(0,e._)`${o} === ${P}`}}};return ys.default=s,ys}var Bd;function KS(){if(Bd)return is;Bd=1,Object.defineProperty(is,"__esModule",{value:!0});const e=FS(),t=DS(),r=MS(),n=qS(),s=US(),i=LS(),a=VS(),o=zS(),c=BS(),l=HS(),u=[e.default,t.default,r.default,n.default,s.default,i.default,a.default,o.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},c.default,l.default];return is.default=u,is}var gs={},Vn={},Hd;function Xm(){if(Hd)return Vn;Hd=1,Object.defineProperty(Vn,"__esModule",{value:!0}),Vn.validateAdditionalItems=void 0;const e=Re(),t=Te(),n={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:i}})=>(0,e.str)`must NOT have more than ${i} items`,params:({params:{len:i}})=>(0,e._)`{limit: ${i}}`},code(i){const{parentSchema:a,it:o}=i,{items:c}=a;if(!Array.isArray(c)){(0,t.checkStrictMode)(o,'"additionalItems" is ignored when "items" is not an array of schemas');return}s(i,c)}};function s(i,a){const{gen:o,schema:c,data:l,keyword:u,it:m}=i;m.items=!0;const _=o.const("len",(0,e._)`${l}.length`);if(c===!1)i.setParams({len:a.length}),i.pass((0,e._)`${_} <= ${a.length}`);else if(typeof c=="object"&&!(0,t.alwaysValidSchema)(m,c)){const S=o.var("valid",(0,e._)`${_} <= ${a.length}`);o.if((0,e.not)(S),()=>v(S)),i.ok(S)}function v(S){o.forRange("i",a.length,_,E=>{i.subschema({keyword:u,dataProp:E,dataPropType:t.Type.Num},S),m.allErrors||o.if((0,e.not)(S),()=>o.break())})}}return Vn.validateAdditionalItems=s,Vn.default=n,Vn}var vs={},zn={},Kd;function Zm(){if(Kd)return zn;Kd=1,Object.defineProperty(zn,"__esModule",{value:!0}),zn.validateTuple=void 0;const e=Re(),t=Te(),r=sr(),n={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(i){const{schema:a,it:o}=i;if(Array.isArray(a))return s(i,"additionalItems",a);o.items=!0,!(0,t.alwaysValidSchema)(o,a)&&i.ok((0,r.validateArray)(i))}};function s(i,a,o=i.schema){const{gen:c,parentSchema:l,data:u,keyword:m,it:_}=i;E(l),_.opts.unevaluated&&o.length&&_.items!==!0&&(_.items=t.mergeEvaluated.items(c,o.length,_.items));const v=c.name("valid"),S=c.const("len",(0,e._)`${u}.length`);o.forEach((g,y)=>{(0,t.alwaysValidSchema)(_,g)||(c.if((0,e._)`${S} > ${y}`,()=>i.subschema({keyword:m,schemaProp:y,dataProp:y},v)),i.ok(v))});function E(g){const{opts:y,errSchemaPath:f}=_,C=o.length,P=C===g.minItems&&(C===g.maxItems||g[a]===!1);if(y.strictTuples&&!P){const h=`"${m}" is ${C}-tuple, but minItems or maxItems/${a} are not specified or different at path "${f}"`;(0,t.checkStrictMode)(_,h,y.strictTuples)}}}return zn.validateTuple=s,zn.default=n,zn}var Gd;function GS(){if(Gd)return vs;Gd=1,Object.defineProperty(vs,"__esModule",{value:!0});const e=Zm(),t={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:r=>(0,e.validateTuple)(r,"items")};return vs.default=t,vs}var bs={},Wd;function WS(){if(Wd)return bs;Wd=1,Object.defineProperty(bs,"__esModule",{value:!0});const e=Re(),t=Te(),r=sr(),n=Xm(),i={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:a}})=>(0,e.str)`must NOT have more than ${a} items`,params:({params:{len:a}})=>(0,e._)`{limit: ${a}}`},code(a){const{schema:o,parentSchema:c,it:l}=a,{prefixItems:u}=c;l.items=!0,!(0,t.alwaysValidSchema)(l,o)&&(u?(0,n.validateAdditionalItems)(a,u):a.ok((0,r.validateArray)(a)))}};return bs.default=i,bs}var _s={},Jd;function JS(){if(Jd)return _s;Jd=1,Object.defineProperty(_s,"__esModule",{value:!0});const e=Re(),t=Te(),n={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:s,max:i}})=>i===void 0?(0,e.str)`must contain at least ${s} valid item(s)`:(0,e.str)`must contain at least ${s} and no more than ${i} valid item(s)`,params:({params:{min:s,max:i}})=>i===void 0?(0,e._)`{minContains: ${s}}`:(0,e._)`{minContains: ${s}, maxContains: ${i}}`},code(s){const{gen:i,schema:a,parentSchema:o,data:c,it:l}=s;let u,m;const{minContains:_,maxContains:v}=o;l.opts.next?(u=_===void 0?1:_,m=v):u=1;const S=i.const("len",(0,e._)`${c}.length`);if(s.setParams({min:u,max:m}),m===void 0&&u===0){(0,t.checkStrictMode)(l,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(m!==void 0&&u>m){(0,t.checkStrictMode)(l,'"minContains" > "maxContains" is always invalid'),s.fail();return}if((0,t.alwaysValidSchema)(l,a)){let C=(0,e._)`${S} >= ${u}`;m!==void 0&&(C=(0,e._)`${C} && ${S} <= ${m}`),s.pass(C);return}l.items=!0;const E=i.name("valid");m===void 0&&u===1?y(E,()=>i.if(E,()=>i.break())):u===0?(i.let(E,!0),m!==void 0&&i.if((0,e._)`${c}.length > 0`,g)):(i.let(E,!1),g()),s.result(E,()=>s.reset());function g(){const C=i.name("_valid"),P=i.let("count",0);y(C,()=>i.if(C,()=>f(P)))}function y(C,P){i.forRange("i",0,S,h=>{s.subschema({keyword:"contains",dataProp:h,dataPropType:t.Type.Num,compositeRule:!0},C),P()})}function f(C){i.code((0,e._)`${C}++`),m===void 0?i.if((0,e._)`${C} >= ${u}`,()=>i.assign(E,!0).break()):(i.if((0,e._)`${C} > ${m}`,()=>i.assign(E,!1).break()),u===1?i.assign(E,!0):i.if((0,e._)`${C} >= ${u}`,()=>i.assign(E,!0)))}}};return _s.default=n,_s}var Qo={},Yd;function YS(){return Yd||(Yd=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=Re(),r=Te(),n=sr();e.error={message:({params:{property:c,depsCount:l,deps:u}})=>{const m=l===1?"property":"properties";return(0,t.str)`must have ${m} ${u} when property ${c} is present`},params:({params:{property:c,depsCount:l,deps:u,missingProperty:m}})=>(0,t._)`{property: ${c},
missingProperty: ${m},
depsCount: ${l},
deps: ${u}}`};const s={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(c){const[l,u]=i(c);a(c,l),o(c,u)}};function i({schema:c}){const l={},u={};for(const m in c){if(m==="__proto__")continue;const _=Array.isArray(c[m])?l:u;_[m]=c[m]}return[l,u]}function a(c,l=c.schema){const{gen:u,data:m,it:_}=c;if(Object.keys(l).length===0)return;const v=u.let("missing");for(const S in l){const E=l[S];if(E.length===0)continue;const g=(0,n.propertyInData)(u,m,S,_.opts.ownProperties);c.setParams({property:S,depsCount:E.length,deps:E.join(", ")}),_.allErrors?u.if(g,()=>{for(const y of E)(0,n.checkReportMissingProp)(c,y)}):(u.if((0,t._)`${g} && (${(0,n.checkMissingProp)(c,E,v)})`),(0,n.reportMissingProp)(c,v),u.else())}}e.validatePropertyDeps=a;function o(c,l=c.schema){const{gen:u,data:m,keyword:_,it:v}=c,S=u.name("valid");for(const E in l)(0,r.alwaysValidSchema)(v,l[E])||(u.if((0,n.propertyInData)(u,m,E,v.opts.ownProperties),()=>{const g=c.subschema({keyword:_,schemaProp:E},S);c.mergeValidEvaluated(g,S)},()=>u.var(S,!0)),c.ok(S))}e.validateSchemaDeps=o,e.default=s})(Qo)),Qo}var Ss={},Xd;function XS(){if(Xd)return Ss;Xd=1,Object.defineProperty(Ss,"__esModule",{value:!0});const e=Re(),t=Te(),n={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:s})=>(0,e._)`{propertyName: ${s.propertyName}}`},code(s){const{gen:i,schema:a,data:o,it:c}=s;if((0,t.alwaysValidSchema)(c,a))return;const l=i.name("valid");i.forIn("key",o,u=>{s.setParams({propertyName:u}),s.subschema({keyword:"propertyNames",data:u,dataTypes:["string"],propertyName:u,compositeRule:!0},l),i.if((0,e.not)(l),()=>{s.error(!0),c.allErrors||i.break()})}),s.ok(l)}};return Ss.default=n,Ss}var ws={},Zd;function Qm(){if(Zd)return ws;Zd=1,Object.defineProperty(ws,"__esModule",{value:!0});const e=sr(),t=Re(),r=rn(),n=Te(),i={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:a})=>(0,t._)`{additionalProperty: ${a.additionalProperty}}`},code(a){const{gen:o,schema:c,parentSchema:l,data:u,errsCount:m,it:_}=a;if(!m)throw new Error("ajv implementation error");const{allErrors:v,opts:S}=_;if(_.props=!0,S.removeAdditional!=="all"&&(0,n.alwaysValidSchema)(_,c))return;const E=(0,e.allSchemaProperties)(l.properties),g=(0,e.allSchemaProperties)(l.patternProperties);y(),a.ok((0,t._)`${m} === ${r.default.errors}`);function y(){o.forIn("key",u,b=>{!E.length&&!g.length?P(b):o.if(f(b),()=>P(b))})}function f(b){let O;if(E.length>8){const k=(0,n.schemaRefOrVal)(_,l.properties,"properties");O=(0,e.isOwnProperty)(o,k,b)}else E.length?O=(0,t.or)(...E.map(k=>(0,t._)`${b} === ${k}`)):O=t.nil;return g.length&&(O=(0,t.or)(O,...g.map(k=>(0,t._)`${(0,e.usePattern)(a,k)}.test(${b})`))),(0,t.not)(O)}function C(b){o.code((0,t._)`delete ${u}[${b}]`)}function P(b){if(S.removeAdditional==="all"||S.removeAdditional&&c===!1){C(b);return}if(c===!1){a.setParams({additionalProperty:b}),a.error(),v||o.break();return}if(typeof c=="object"&&!(0,n.alwaysValidSchema)(_,c)){const O=o.name("valid");S.removeAdditional==="failing"?(h(b,O,!1),o.if((0,t.not)(O),()=>{a.reset(),C(b)})):(h(b,O),v||o.if((0,t.not)(O),()=>o.break()))}}function h(b,O,k){const $={keyword:"additionalProperties",dataProp:b,dataPropType:n.Type.Str};k===!1&&Object.assign($,{compositeRule:!0,createErrors:!1,allErrors:!1}),a.subschema($,O)}}};return ws.default=i,ws}var Cs={},Qd;function ZS(){if(Qd)return Cs;Qd=1,Object.defineProperty(Cs,"__esModule",{value:!0});const e=ro(),t=sr(),r=Te(),n=Qm(),s={keyword:"properties",type:"object",schemaType:"object",code(i){const{gen:a,schema:o,parentSchema:c,data:l,it:u}=i;u.opts.removeAdditional==="all"&&c.additionalProperties===void 0&&n.default.code(new e.KeywordCxt(u,n.default,"additionalProperties"));const m=(0,t.allSchemaProperties)(o);for(const g of m)u.definedProperties.add(g);u.opts.unevaluated&&m.length&&u.props!==!0&&(u.props=r.mergeEvaluated.props(a,(0,r.toHash)(m),u.props));const _=m.filter(g=>!(0,r.alwaysValidSchema)(u,o[g]));if(_.length===0)return;const v=a.name("valid");for(const g of _)S(g)?E(g):(a.if((0,t.propertyInData)(a,l,g,u.opts.ownProperties)),E(g),u.allErrors||a.else().var(v,!0),a.endIf()),i.it.definedProperties.add(g),i.ok(v);function S(g){return u.opts.useDefaults&&!u.compositeRule&&o[g].default!==void 0}function E(g){i.subschema({keyword:"properties",schemaProp:g,dataProp:g},v)}}};return Cs.default=s,Cs}var Es={},ef;function QS(){if(ef)return Es;ef=1,Object.defineProperty(Es,"__esModule",{value:!0});const e=sr(),t=Re(),r=Te(),n=Te(),s={keyword:"patternProperties",type:"object",schemaType:"object",code(i){const{gen:a,schema:o,data:c,parentSchema:l,it:u}=i,{opts:m}=u,_=(0,e.allSchemaProperties)(o),v=_.filter(P=>(0,r.alwaysValidSchema)(u,o[P]));if(_.length===0||v.length===_.length&&(!u.opts.unevaluated||u.props===!0))return;const S=m.strictSchema&&!m.allowMatchingProperties&&l.properties,E=a.name("valid");u.props!==!0&&!(u.props instanceof t.Name)&&(u.props=(0,n.evaluatedPropsToName)(a,u.props));const{props:g}=u;y();function y(){for(const P of _)S&&f(P),u.allErrors?C(P):(a.var(E,!0),C(P),a.if(E))}function f(P){for(const h in S)new RegExp(P).test(h)&&(0,r.checkStrictMode)(u,`property ${h} matches pattern ${P} (use allowMatchingProperties)`)}function C(P){a.forIn("key",c,h=>{a.if((0,t._)`${(0,e.usePattern)(i,P)}.test(${h})`,()=>{const b=v.includes(P);b||i.subschema({keyword:"patternProperties",schemaProp:P,dataProp:h,dataPropType:n.Type.Str},E),u.opts.unevaluated&&g!==!0?a.assign((0,t._)`${g}[${h}]`,!0):!b&&!u.allErrors&&a.if((0,t.not)(E),()=>a.break())})})}}};return Es.default=s,Es}var As={},tf;function ew(){if(tf)return As;tf=1,Object.defineProperty(As,"__esModule",{value:!0});const e=Te(),t={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(r){const{gen:n,schema:s,it:i}=r;if((0,e.alwaysValidSchema)(i,s)){r.fail();return}const a=n.name("valid");r.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},a),r.failResult(a,()=>r.reset(),()=>r.error())},error:{message:"must NOT be valid"}};return As.default=t,As}var xs={},rf;function tw(){if(rf)return xs;rf=1,Object.defineProperty(xs,"__esModule",{value:!0});const t={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:sr().validateUnion,error:{message:"must match a schema in anyOf"}};return xs.default=t,xs}var Ps={},nf;function rw(){if(nf)return Ps;nf=1,Object.defineProperty(Ps,"__esModule",{value:!0});const e=Re(),t=Te(),n={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:s})=>(0,e._)`{passingSchemas: ${s.passing}}`},code(s){const{gen:i,schema:a,parentSchema:o,it:c}=s;if(!Array.isArray(a))throw new Error("ajv implementation error");if(c.opts.discriminator&&o.discriminator)return;const l=a,u=i.let("valid",!1),m=i.let("passing",null),_=i.name("_valid");s.setParams({passing:m}),i.block(v),s.result(u,()=>s.reset(),()=>s.error(!0));function v(){l.forEach((S,E)=>{let g;(0,t.alwaysValidSchema)(c,S)?i.var(_,!0):g=s.subschema({keyword:"oneOf",schemaProp:E,compositeRule:!0},_),E>0&&i.if((0,e._)`${_} && ${u}`).assign(u,!1).assign(m,(0,e._)`[${m}, ${E}]`).else(),i.if(_,()=>{i.assign(u,!0),i.assign(m,E),g&&s.mergeEvaluated(g,e.Name)})})}}};return Ps.default=n,Ps}var Os={},sf;function nw(){if(sf)return Os;sf=1,Object.defineProperty(Os,"__esModule",{value:!0});const e=Te(),t={keyword:"allOf",schemaType:"array",code(r){const{gen:n,schema:s,it:i}=r;if(!Array.isArray(s))throw new Error("ajv implementation error");const a=n.name("valid");s.forEach((o,c)=>{if((0,e.alwaysValidSchema)(i,o))return;const l=r.subschema({keyword:"allOf",schemaProp:c},a);r.ok(a),r.mergeEvaluated(l)})}};return Os.default=t,Os}var js={},af;function iw(){if(af)return js;af=1,Object.defineProperty(js,"__esModule",{value:!0});const e=Re(),t=Te(),n={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:i})=>(0,e.str)`must match "${i.ifClause}" schema`,params:({params:i})=>(0,e._)`{failingKeyword: ${i.ifClause}}`},code(i){const{gen:a,parentSchema:o,it:c}=i;o.then===void 0&&o.else===void 0&&(0,t.checkStrictMode)(c,'"if" without "then" and "else" is ignored');const l=s(c,"then"),u=s(c,"else");if(!l&&!u)return;const m=a.let("valid",!0),_=a.name("_valid");if(v(),i.reset(),l&&u){const E=a.let("ifClause");i.setParams({ifClause:E}),a.if(_,S("then",E),S("else",E))}else l?a.if(_,S("then")):a.if((0,e.not)(_),S("else"));i.pass(m,()=>i.error(!0));function v(){const E=i.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},_);i.mergeEvaluated(E)}function S(E,g){return()=>{const y=i.subschema({keyword:E},_);a.assign(m,_),i.mergeValidEvaluated(y,m),g?a.assign(g,(0,e._)`${E}`):i.setParams({ifClause:E})}}}};function s(i,a){const o=i.schema[a];return o!==void 0&&!(0,t.alwaysValidSchema)(i,o)}return js.default=n,js}var ks={},of;function sw(){if(of)return ks;of=1,Object.defineProperty(ks,"__esModule",{value:!0});const e=Te(),t={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:r,parentSchema:n,it:s}){n.if===void 0&&(0,e.checkStrictMode)(s,`"${r}" without "if" is ignored`)}};return ks.default=t,ks}var cf;function aw(){if(cf)return gs;cf=1,Object.defineProperty(gs,"__esModule",{value:!0});const e=Xm(),t=GS(),r=Zm(),n=WS(),s=JS(),i=YS(),a=XS(),o=Qm(),c=ZS(),l=QS(),u=ew(),m=tw(),_=rw(),v=nw(),S=iw(),E=sw();function g(y=!1){const f=[u.default,m.default,_.default,v.default,S.default,E.default,a.default,o.default,i.default,c.default,l.default];return y?f.push(t.default,n.default):f.push(e.default,r.default),f.push(s.default),f}return gs.default=g,gs}var Ns={},Is={},lf;function ow(){if(lf)return Is;lf=1,Object.defineProperty(Is,"__esModule",{value:!0});const e=Re(),r={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:n})=>(0,e.str)`must match format "${n}"`,params:({schemaCode:n})=>(0,e._)`{format: ${n}}`},code(n,s){const{gen:i,data:a,$data:o,schema:c,schemaCode:l,it:u}=n,{opts:m,errSchemaPath:_,schemaEnv:v,self:S}=u;if(!m.validateFormats)return;o?E():g();function E(){const y=i.scopeValue("formats",{ref:S.formats,code:m.code.formats}),f=i.const("fDef",(0,e._)`${y}[${l}]`),C=i.let("fType"),P=i.let("format");i.if((0,e._)`typeof ${f} == "object" && !(${f} instanceof RegExp)`,()=>i.assign(C,(0,e._)`${f}.type || "string"`).assign(P,(0,e._)`${f}.validate`),()=>i.assign(C,(0,e._)`"string"`).assign(P,f)),n.fail$data((0,e.or)(h(),b()));function h(){return m.strictSchema===!1?e.nil:(0,e._)`${l} && !${P}`}function b(){const O=v.$async?(0,e._)`(${f}.async ? await ${P}(${a}) : ${P}(${a}))`:(0,e._)`${P}(${a})`,k=(0,e._)`(typeof ${P} == "function" ? ${O} : ${P}.test(${a}))`;return(0,e._)`${P} && ${P} !== true && ${C} === ${s} && !${k}`}}function g(){const y=S.formats[c];if(!y){h();return}if(y===!0)return;const[f,C,P]=b(y);f===s&&n.pass(O());function h(){if(m.strictSchema===!1){S.logger.warn(k());return}throw new Error(k());function k(){return`unknown format "${c}" ignored in schema at path "${_}"`}}function b(k){const $=k instanceof RegExp?(0,e.regexpCode)(k):m.code.formats?(0,e._)`${m.code.formats}${(0,e.getProperty)(c)}`:void 0,M=i.scopeValue("formats",{key:c,ref:k,code:$});return typeof k=="object"&&!(k instanceof RegExp)?[k.type||"string",k.validate,(0,e._)`${M}.validate`]:["string",k,M]}function O(){if(typeof y=="object"&&!(y instanceof RegExp)&&y.async){if(!v.$async)throw new Error("async format in sync schema");return(0,e._)`await ${P}(${a})`}return typeof C=="function"?(0,e._)`${P}(${a})`:(0,e._)`${P}.test(${a})`}}}};return Is.default=r,Is}var uf;function cw(){if(uf)return Ns;uf=1,Object.defineProperty(Ns,"__esModule",{value:!0});const t=[ow().default];return Ns.default=t,Ns}var pn={},df;function lw(){return df||(df=1,Object.defineProperty(pn,"__esModule",{value:!0}),pn.contentVocabulary=pn.metadataVocabulary=void 0,pn.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],pn.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]),pn}var ff;function uw(){if(ff)return ts;ff=1,Object.defineProperty(ts,"__esModule",{value:!0});const e=$S(),t=KS(),r=aw(),n=cw(),s=lw(),i=[e.default,t.default,(0,r.default)(),n.default,s.metadataVocabulary,s.contentVocabulary];return ts.default=i,ts}var Rs={},_i={},hf;function dw(){if(hf)return _i;hf=1,Object.defineProperty(_i,"__esModule",{value:!0}),_i.DiscrError=void 0;var e;return(function(t){t.Tag="tag",t.Mapping="mapping"})(e||(_i.DiscrError=e={})),_i}var mf;function fw(){if(mf)return Rs;mf=1,Object.defineProperty(Rs,"__esModule",{value:!0});const e=Re(),t=dw(),r=dl(),n=no(),s=Te(),a={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:o,tagName:c}})=>o===t.DiscrError.Tag?`tag "${c}" must be string`:`value of tag "${c}" must be in oneOf`,params:({params:{discrError:o,tag:c,tagName:l}})=>(0,e._)`{error: ${o}, tag: ${l}, tagValue: ${c}}`},code(o){const{gen:c,data:l,schema:u,parentSchema:m,it:_}=o,{oneOf:v}=m;if(!_.opts.discriminator)throw new Error("discriminator: requires discriminator option");const S=u.propertyName;if(typeof S!="string")throw new Error("discriminator: requires propertyName");if(u.mapping)throw new Error("discriminator: mapping is not supported");if(!v)throw new Error("discriminator: requires oneOf keyword");const E=c.let("valid",!1),g=c.const("tag",(0,e._)`${l}${(0,e.getProperty)(S)}`);c.if((0,e._)`typeof ${g} == "string"`,()=>y(),()=>o.error(!1,{discrError:t.DiscrError.Tag,tag:g,tagName:S})),o.ok(E);function y(){const P=C();c.if(!1);for(const h in P)c.elseIf((0,e._)`${g} === ${h}`),c.assign(E,f(P[h]));c.else(),o.error(!1,{discrError:t.DiscrError.Mapping,tag:g,tagName:S}),c.endIf()}function f(P){const h=c.name("valid"),b=o.subschema({keyword:"oneOf",schemaProp:P},h);return o.mergeEvaluated(b,e.Name),h}function C(){var P;const h={},b=k(m);let O=!0;for(let q=0;q<v.length;q++){let L=v[q];if(L?.$ref&&!(0,s.schemaHasRulesButRef)(L,_.self.RULES)){const B=L.$ref;if(L=r.resolveRef.call(_.self,_.schemaEnv.root,_.baseId,B),L instanceof r.SchemaEnv&&(L=L.schema),L===void 0)throw new n.default(_.opts.uriResolver,_.baseId,B)}const U=(P=L?.properties)===null||P===void 0?void 0:P[S];if(typeof U!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${S}"`);O=O&&(b||k(L)),$(U,q)}if(!O)throw new Error(`discriminator: "${S}" must be required`);return h;function k({required:q}){return Array.isArray(q)&&q.includes(S)}function $(q,L){if(q.const)M(q.const,L);else if(q.enum)for(const U of q.enum)M(U,L);else throw new Error(`discriminator: "properties/${S}" must have "const" or "enum"`)}function M(q,L){if(typeof q!="string"||q in h)throw new Error(`discriminator: "${S}" values must be unique strings`);h[q]=L}}}};return Rs.default=a,Rs}const hw="http://json-schema.org/draft-07/schema#",mw="http://json-schema.org/draft-07/schema#",pw="Core schema meta-schema",yw={schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},gw=["object","boolean"],vw={$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},bw={$schema:hw,$id:mw,title:pw,definitions:yw,type:gw,properties:vw,default:!0};var pf;function _w(){return pf||(pf=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;const r=NS(),n=uw(),s=fw(),i=bw,a=["/properties"],o="http://json-schema.org/draft-07/schema";class c extends r.default{_addVocabularies(){super._addVocabularies(),n.default.forEach(S=>this.addVocabulary(S)),this.opts.discriminator&&this.addKeyword(s.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const S=this.opts.$data?this.$dataMetaSchema(i,a):i;this.addMetaSchema(S,o,!1),this.refs["http://json-schema.org/schema"]=o}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(o)?o:void 0)}}t.Ajv=c,e.exports=t=c,e.exports.Ajv=c,Object.defineProperty(t,"__esModule",{value:!0}),t.default=c;var l=ro();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return l.KeywordCxt}});var u=Re();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return u._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return u.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return u.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return u.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return u.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return u.CodeGen}});var m=ul();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return m.default}});var _=no();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return _.default}})})(Yi,Yi.exports)),Yi.exports}var Sw=_w();const ww=Fi(Sw);var $s={exports:{}},ec={},yf;function Cw(){return yf||(yf=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0;function t($,M){return{validate:$,compare:M}}e.fullFormats={date:t(i,a),time:t(c,l),"date-time":t(m,_),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:E,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:k,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:y,int32:{type:"number",validate:P},int64:{type:"number",validate:h},float:{type:"number",validate:b},double:{type:"number",validate:b},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,a),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,l),"date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,_),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},e.formatNames=Object.keys(e.fullFormats);function r($){return $%4===0&&($%100!==0||$%400===0)}const n=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,s=[0,31,28,31,30,31,30,31,31,30,31,30,31];function i($){const M=n.exec($);if(!M)return!1;const q=+M[1],L=+M[2],U=+M[3];return L>=1&&L<=12&&U>=1&&U<=(L===2&&r(q)?29:s[L])}function a($,M){if($&&M)return $>M?1:$<M?-1:0}const o=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i;function c($,M){const q=o.exec($);if(!q)return!1;const L=+q[1],U=+q[2],B=+q[3],W=q[5];return(L<=23&&U<=59&&B<=59||L===23&&U===59&&B===60)&&(!M||W!=="")}function l($,M){if(!($&&M))return;const q=o.exec($),L=o.exec(M);if(q&&L)return $=q[1]+q[2]+q[3]+(q[4]||""),M=L[1]+L[2]+L[3]+(L[4]||""),$>M?1:$<M?-1:0}const u=/t|\s/i;function m($){const M=$.split(u);return M.length===2&&i(M[0])&&c(M[1],!0)}function _($,M){if(!($&&M))return;const[q,L]=$.split(u),[U,B]=M.split(u),W=a(q,U);if(W!==void 0)return W||l(L,B)}const v=/\/|:/,S=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function E($){return v.test($)&&S.test($)}const g=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function y($){return g.lastIndex=0,g.test($)}const f=-2147483648,C=2**31-1;function P($){return Number.isInteger($)&&$<=C&&$>=f}function h($){return Number.isInteger($)}function b(){return!0}const O=/[^\\]\\Z/;function k($){if(O.test($))return!1;try{return new RegExp($),!0}catch{return!1}}})(ec)),ec}var tc={},Fs={exports:{}},rc={},Er={},yn={},nc={},ic={},sc={},gf;function za(){return gf||(gf=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;class t{}e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class r extends t{constructor(f){if(super(),!e.IDENTIFIER.test(f))throw new Error("CodeGen: name must be a valid identifier");this.str=f}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=r;class n extends t{constructor(f){super(),this._items=typeof f=="string"?[f]:f}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const f=this._items[0];return f===""||f==='""'}get str(){var f;return(f=this._str)!==null&&f!==void 0?f:this._str=this._items.reduce((C,P)=>`${C}${P}`,"")}get names(){var f;return(f=this._names)!==null&&f!==void 0?f:this._names=this._items.reduce((C,P)=>(P instanceof r&&(C[P.str]=(C[P.str]||0)+1),C),{})}}e._Code=n,e.nil=new n("");function s(y,...f){const C=[y[0]];let P=0;for(;P<f.length;)o(C,f[P]),C.push(y[++P]);return new n(C)}e._=s;const i=new n("+");function a(y,...f){const C=[v(y[0])];let P=0;for(;P<f.length;)C.push(i),o(C,f[P]),C.push(i,v(y[++P]));return c(C),new n(C)}e.str=a;function o(y,f){f instanceof n?y.push(...f._items):f instanceof r?y.push(f):y.push(m(f))}e.addCodeArg=o;function c(y){let f=1;for(;f<y.length-1;){if(y[f]===i){const C=l(y[f-1],y[f+1]);if(C!==void 0){y.splice(f-1,3,C);continue}y[f++]="+"}f++}}function l(y,f){if(f==='""')return y;if(y==='""')return f;if(typeof y=="string")return f instanceof r||y[y.length-1]!=='"'?void 0:typeof f!="string"?`${y.slice(0,-1)}${f}"`:f[0]==='"'?y.slice(0,-1)+f.slice(1):void 0;if(typeof f=="string"&&f[0]==='"'&&!(y instanceof r))return`"${y}${f.slice(1)}`}function u(y,f){return f.emptyStr()?y:y.emptyStr()?f:a`${y}${f}`}e.strConcat=u;function m(y){return typeof y=="number"||typeof y=="boolean"||y===null?y:v(Array.isArray(y)?y.join(","):y)}function _(y){return new n(v(y))}e.stringify=_;function v(y){return JSON.stringify(y).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=v;function S(y){return typeof y=="string"&&e.IDENTIFIER.test(y)?new n(`.${y}`):s`[${y}]`}e.getProperty=S;function E(y){if(typeof y=="string"&&e.IDENTIFIER.test(y))return new n(`${y}`);throw new Error(`CodeGen: invalid export name: ${y}, use explicit $id name mapping`)}e.getEsmExportName=E;function g(y){return new n(y.toString())}e.regexpCode=g})(sc)),sc}var ac={},vf;function bf(){return vf||(vf=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const t=za();class r extends Error{constructor(l){super(`CodeGen: "code" for ${l} not defined`),this.value=l.value}}var n;(function(c){c[c.Started=0]="Started",c[c.Completed=1]="Completed"})(n||(e.UsedValueState=n={})),e.varKinds={const:new t.Name("const"),let:new t.Name("let"),var:new t.Name("var")};class s{constructor({prefixes:l,parent:u}={}){this._names={},this._prefixes=l,this._parent=u}toName(l){return l instanceof t.Name?l:this.name(l)}name(l){return new t.Name(this._newName(l))}_newName(l){const u=this._names[l]||this._nameGroup(l);return`${l}${u.index++}`}_nameGroup(l){var u,m;if(!((m=(u=this._parent)===null||u===void 0?void 0:u._prefixes)===null||m===void 0)&&m.has(l)||this._prefixes&&!this._prefixes.has(l))throw new Error(`CodeGen: prefix "${l}" is not allowed in this scope`);return this._names[l]={prefix:l,index:0}}}e.Scope=s;class i extends t.Name{constructor(l,u){super(u),this.prefix=l}setValue(l,{property:u,itemIndex:m}){this.value=l,this.scopePath=(0,t._)`.${new t.Name(u)}[${m}]`}}e.ValueScopeName=i;const a=(0,t._)`\n`;class o extends s{constructor(l){super(l),this._values={},this._scope=l.scope,this.opts={...l,_n:l.lines?a:t.nil}}get(){return this._scope}name(l){return new i(l,this._newName(l))}value(l,u){var m;if(u.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const _=this.toName(l),{prefix:v}=_,S=(m=u.key)!==null&&m!==void 0?m:u.ref;let E=this._values[v];if(E){const f=E.get(S);if(f)return f}else E=this._values[v]=new Map;E.set(S,_);const g=this._scope[v]||(this._scope[v]=[]),y=g.length;return g[y]=u.ref,_.setValue(u,{property:v,itemIndex:y}),_}getValue(l,u){const m=this._values[l];if(m)return m.get(u)}scopeRefs(l,u=this._values){return this._reduceValues(u,m=>{if(m.scopePath===void 0)throw new Error(`CodeGen: name "${m}" has no value`);return(0,t._)`${l}${m.scopePath}`})}scopeCode(l=this._values,u,m){return this._reduceValues(l,_=>{if(_.value===void 0)throw new Error(`CodeGen: name "${_}" has no value`);return _.value.code},u,m)}_reduceValues(l,u,m={},_){let v=t.nil;for(const S in l){const E=l[S];if(!E)continue;const g=m[S]=m[S]||new Map;E.forEach(y=>{if(g.has(y))return;g.set(y,n.Started);let f=u(y);if(f){const C=this.opts.es5?e.varKinds.var:e.varKinds.const;v=(0,t._)`${v}${C} ${y} = ${f};${this.opts._n}`}else if(f=_?.(y))v=(0,t._)`${v}${f}${this.opts._n}`;else throw new r(y);g.set(y,n.Completed)})}return v}}e.ValueScope=o})(ac)),ac}var _f;function Oe(){return _f||(_f=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;const t=za(),r=bf();var n=za();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return n.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return n.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return n.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return n.Name}});var s=bf();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return s.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return s.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return s.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return s.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};class i{optimizeNodes(){return this}optimizeNames(d,x){return this}}class a extends i{constructor(d,x,I){super(),this.varKind=d,this.name=x,this.rhs=I}render({es5:d,_n:x}){const I=d?r.varKinds.var:this.varKind,T=this.rhs===void 0?"":` = ${this.rhs}`;return`${I} ${this.name}${T};`+x}optimizeNames(d,x){if(d[this.name.str])return this.rhs&&(this.rhs=B(this.rhs,d,x)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class o extends i{constructor(d,x,I){super(),this.lhs=d,this.rhs=x,this.sideEffects=I}render({_n:d}){return`${this.lhs} = ${this.rhs};`+d}optimizeNames(d,x){if(!(this.lhs instanceof t.Name&&!d[this.lhs.str]&&!this.sideEffects))return this.rhs=B(this.rhs,d,x),this}get names(){const d=this.lhs instanceof t.Name?{}:{...this.lhs.names};return U(d,this.rhs)}}class c extends o{constructor(d,x,I,T){super(d,I,T),this.op=x}render({_n:d}){return`${this.lhs} ${this.op}= ${this.rhs};`+d}}class l extends i{constructor(d){super(),this.label=d,this.names={}}render({_n:d}){return`${this.label}:`+d}}class u extends i{constructor(d){super(),this.label=d,this.names={}}render({_n:d}){return`break${this.label?` ${this.label}`:""};`+d}}class m extends i{constructor(d){super(),this.error=d}render({_n:d}){return`throw ${this.error};`+d}get names(){return this.error.names}}class _ extends i{constructor(d){super(),this.code=d}render({_n:d}){return`${this.code};`+d}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(d,x){return this.code=B(this.code,d,x),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class v extends i{constructor(d=[]){super(),this.nodes=d}render(d){return this.nodes.reduce((x,I)=>x+I.render(d),"")}optimizeNodes(){const{nodes:d}=this;let x=d.length;for(;x--;){const I=d[x].optimizeNodes();Array.isArray(I)?d.splice(x,1,...I):I?d[x]=I:d.splice(x,1)}return d.length>0?this:void 0}optimizeNames(d,x){const{nodes:I}=this;let T=I.length;for(;T--;){const F=I[T];F.optimizeNames(d,x)||(W(d,F.names),I.splice(T,1))}return I.length>0?this:void 0}get names(){return this.nodes.reduce((d,x)=>L(d,x.names),{})}}class S extends v{render(d){return"{"+d._n+super.render(d)+"}"+d._n}}class E extends v{}class g extends S{}g.kind="else";class y extends S{constructor(d,x){super(x),this.condition=d}render(d){let x=`if(${this.condition})`+super.render(d);return this.else&&(x+="else "+this.else.render(d)),x}optimizeNodes(){super.optimizeNodes();const d=this.condition;if(d===!0)return this.nodes;let x=this.else;if(x){const I=x.optimizeNodes();x=this.else=Array.isArray(I)?new g(I):I}if(x)return d===!1?x instanceof y?x:x.nodes:this.nodes.length?this:new y(Y(d),x instanceof y?[x]:x.nodes);if(!(d===!1||!this.nodes.length))return this}optimizeNames(d,x){var I;if(this.else=(I=this.else)===null||I===void 0?void 0:I.optimizeNames(d,x),!!(super.optimizeNames(d,x)||this.else))return this.condition=B(this.condition,d,x),this}get names(){const d=super.names;return U(d,this.condition),this.else&&L(d,this.else.names),d}}y.kind="if";class f extends S{}f.kind="for";class C extends f{constructor(d){super(),this.iteration=d}render(d){return`for(${this.iteration})`+super.render(d)}optimizeNames(d,x){if(super.optimizeNames(d,x))return this.iteration=B(this.iteration,d,x),this}get names(){return L(super.names,this.iteration.names)}}class P extends f{constructor(d,x,I,T){super(),this.varKind=d,this.name=x,this.from=I,this.to=T}render(d){const x=d.es5?r.varKinds.var:this.varKind,{name:I,from:T,to:F}=this;return`for(${x} ${I}=${T}; ${I}<${F}; ${I}++)`+super.render(d)}get names(){const d=U(super.names,this.from);return U(d,this.to)}}class h extends f{constructor(d,x,I,T){super(),this.loop=d,this.varKind=x,this.name=I,this.iterable=T}render(d){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(d)}optimizeNames(d,x){if(super.optimizeNames(d,x))return this.iterable=B(this.iterable,d,x),this}get names(){return L(super.names,this.iterable.names)}}class b extends S{constructor(d,x,I){super(),this.name=d,this.args=x,this.async=I}render(d){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(d)}}b.kind="func";class O extends v{render(d){return"return "+super.render(d)}}O.kind="return";class k extends S{render(d){let x="try"+super.render(d);return this.catch&&(x+=this.catch.render(d)),this.finally&&(x+=this.finally.render(d)),x}optimizeNodes(){var d,x;return super.optimizeNodes(),(d=this.catch)===null||d===void 0||d.optimizeNodes(),(x=this.finally)===null||x===void 0||x.optimizeNodes(),this}optimizeNames(d,x){var I,T;return super.optimizeNames(d,x),(I=this.catch)===null||I===void 0||I.optimizeNames(d,x),(T=this.finally)===null||T===void 0||T.optimizeNames(d,x),this}get names(){const d=super.names;return this.catch&&L(d,this.catch.names),this.finally&&L(d,this.finally.names),d}}class $ extends S{constructor(d){super(),this.error=d}render(d){return`catch(${this.error})`+super.render(d)}}$.kind="catch";class M extends S{render(d){return"finally"+super.render(d)}}M.kind="finally";class q{constructor(d,x={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...x,_n:x.lines?`
`:""},this._extScope=d,this._scope=new r.Scope({parent:d}),this._nodes=[new E]}toString(){return this._root.render(this.opts)}name(d){return this._scope.name(d)}scopeName(d){return this._extScope.name(d)}scopeValue(d,x){const I=this._extScope.value(d,x);return(this._values[I.prefix]||(this._values[I.prefix]=new Set)).add(I),I}getScopeValue(d,x){return this._extScope.getValue(d,x)}scopeRefs(d){return this._extScope.scopeRefs(d,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(d,x,I,T){const F=this._scope.toName(x);return I!==void 0&&T&&(this._constants[F.str]=I),this._leafNode(new a(d,F,I)),F}const(d,x,I){return this._def(r.varKinds.const,d,x,I)}let(d,x,I){return this._def(r.varKinds.let,d,x,I)}var(d,x,I){return this._def(r.varKinds.var,d,x,I)}assign(d,x,I){return this._leafNode(new o(d,x,I))}add(d,x){return this._leafNode(new c(d,e.operators.ADD,x))}code(d){return typeof d=="function"?d():d!==t.nil&&this._leafNode(new _(d)),this}object(...d){const x=["{"];for(const[I,T]of d)x.length>1&&x.push(","),x.push(I),(I!==T||this.opts.es5)&&(x.push(":"),(0,t.addCodeArg)(x,T));return x.push("}"),new t._Code(x)}if(d,x,I){if(this._blockNode(new y(d)),x&&I)this.code(x).else().code(I).endIf();else if(x)this.code(x).endIf();else if(I)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(d){return this._elseNode(new y(d))}else(){return this._elseNode(new g)}endIf(){return this._endBlockNode(y,g)}_for(d,x){return this._blockNode(d),x&&this.code(x).endFor(),this}for(d,x){return this._for(new C(d),x)}forRange(d,x,I,T,F=this.opts.es5?r.varKinds.var:r.varKinds.let){const z=this._scope.toName(d);return this._for(new P(F,z,x,I),()=>T(z))}forOf(d,x,I,T=r.varKinds.const){const F=this._scope.toName(d);if(this.opts.es5){const z=x instanceof t.Name?x:this.var("_arr",x);return this.forRange("_i",0,(0,t._)`${z}.length`,H=>{this.var(F,(0,t._)`${z}[${H}]`),I(F)})}return this._for(new h("of",T,F,x),()=>I(F))}forIn(d,x,I,T=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf(d,(0,t._)`Object.keys(${x})`,I);const F=this._scope.toName(d);return this._for(new h("in",T,F,x),()=>I(F))}endFor(){return this._endBlockNode(f)}label(d){return this._leafNode(new l(d))}break(d){return this._leafNode(new u(d))}return(d){const x=new O;if(this._blockNode(x),this.code(d),x.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(O)}try(d,x,I){if(!x&&!I)throw new Error('CodeGen: "try" without "catch" and "finally"');const T=new k;if(this._blockNode(T),this.code(d),x){const F=this.name("e");this._currNode=T.catch=new $(F),x(F)}return I&&(this._currNode=T.finally=new M,this.code(I)),this._endBlockNode($,M)}throw(d){return this._leafNode(new m(d))}block(d,x){return this._blockStarts.push(this._nodes.length),d&&this.code(d).endBlock(x),this}endBlock(d){const x=this._blockStarts.pop();if(x===void 0)throw new Error("CodeGen: not in self-balancing block");const I=this._nodes.length-x;if(I<0||d!==void 0&&I!==d)throw new Error(`CodeGen: wrong number of nodes: ${I} vs ${d} expected`);return this._nodes.length=x,this}func(d,x=t.nil,I,T){return this._blockNode(new b(d,x,I)),T&&this.code(T).endFunc(),this}endFunc(){return this._endBlockNode(b)}optimize(d=1){for(;d-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(d){return this._currNode.nodes.push(d),this}_blockNode(d){this._currNode.nodes.push(d),this._nodes.push(d)}_endBlockNode(d,x){const I=this._currNode;if(I instanceof d||x&&I instanceof x)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${x?`${d.kind}/${x.kind}`:d.kind}"`)}_elseNode(d){const x=this._currNode;if(!(x instanceof y))throw new Error('CodeGen: "else" without "if"');return this._currNode=x.else=d,this}get _root(){return this._nodes[0]}get _currNode(){const d=this._nodes;return d[d.length-1]}set _currNode(d){const x=this._nodes;x[x.length-1]=d}}e.CodeGen=q;function L(p,d){for(const x in d)p[x]=(p[x]||0)+(d[x]||0);return p}function U(p,d){return d instanceof t._CodeOrName?L(p,d.names):p}function B(p,d,x){if(p instanceof t.Name)return I(p);if(!T(p))return p;return new t._Code(p._items.reduce((F,z)=>(z instanceof t.Name&&(z=I(z)),z instanceof t._Code?F.push(...z._items):F.push(z),F),[]));function I(F){const z=x[F.str];return z===void 0||d[F.str]!==1?F:(delete d[F.str],z)}function T(F){return F instanceof t._Code&&F._items.some(z=>z instanceof t.Name&&d[z.str]===1&&x[z.str]!==void 0)}}function W(p,d){for(const x in d)p[x]=(p[x]||0)-(d[x]||0)}function Y(p){return typeof p=="boolean"||typeof p=="number"||p===null?!p:(0,t._)`!${j(p)}`}e.not=Y;const Q=w(e.operators.AND);function Z(...p){return p.reduce(Q)}e.and=Z;const re=w(e.operators.OR);function A(...p){return p.reduce(re)}e.or=A;function w(p){return(d,x)=>d===t.nil?x:x===t.nil?d:(0,t._)`${j(d)} ${p} ${j(x)}`}function j(p){return p instanceof t.Name?p:(0,t._)`(${p})`}})(ic)),ic}var Ee={},Sf;function Me(){if(Sf)return Ee;Sf=1,Object.defineProperty(Ee,"__esModule",{value:!0}),Ee.checkStrictMode=Ee.getErrorPath=Ee.Type=Ee.useFunc=Ee.setEvaluated=Ee.evaluatedPropsToName=Ee.mergeEvaluated=Ee.eachItem=Ee.unescapeJsonPointer=Ee.escapeJsonPointer=Ee.escapeFragment=Ee.unescapeFragment=Ee.schemaRefOrVal=Ee.schemaHasRulesButRef=Ee.schemaHasRules=Ee.checkUnknownRules=Ee.alwaysValidSchema=Ee.toHash=void 0;const e=Oe(),t=za();function r(h){const b={};for(const O of h)b[O]=!0;return b}Ee.toHash=r;function n(h,b){return typeof b=="boolean"?b:Object.keys(b).length===0?!0:(s(h,b),!i(b,h.self.RULES.all))}Ee.alwaysValidSchema=n;function s(h,b=h.schema){const{opts:O,self:k}=h;if(!O.strictSchema||typeof b=="boolean")return;const $=k.RULES.keywords;for(const M in b)$[M]||P(h,`unknown keyword: "${M}"`)}Ee.checkUnknownRules=s;function i(h,b){if(typeof h=="boolean")return!h;for(const O in h)if(b[O])return!0;return!1}Ee.schemaHasRules=i;function a(h,b){if(typeof h=="boolean")return!h;for(const O in h)if(O!=="$ref"&&b.all[O])return!0;return!1}Ee.schemaHasRulesButRef=a;function o({topSchemaRef:h,schemaPath:b},O,k,$){if(!$){if(typeof O=="number"||typeof O=="boolean")return O;if(typeof O=="string")return(0,e._)`${O}`}return(0,e._)`${h}${b}${(0,e.getProperty)(k)}`}Ee.schemaRefOrVal=o;function c(h){return m(decodeURIComponent(h))}Ee.unescapeFragment=c;function l(h){return encodeURIComponent(u(h))}Ee.escapeFragment=l;function u(h){return typeof h=="number"?`${h}`:h.replace(/~/g,"~0").replace(/\//g,"~1")}Ee.escapeJsonPointer=u;function m(h){return h.replace(/~1/g,"/").replace(/~0/g,"~")}Ee.unescapeJsonPointer=m;function _(h,b){if(Array.isArray(h))for(const O of h)b(O);else b(h)}Ee.eachItem=_;function v({mergeNames:h,mergeToName:b,mergeValues:O,resultToName:k}){return($,M,q,L)=>{const U=q===void 0?M:q instanceof e.Name?(M instanceof e.Name?h($,M,q):b($,M,q),q):M instanceof e.Name?(b($,q,M),M):O(M,q);return L===e.Name&&!(U instanceof e.Name)?k($,U):U}}Ee.mergeEvaluated={props:v({mergeNames:(h,b,O)=>h.if((0,e._)`${O} !== true && ${b} !== undefined`,()=>{h.if((0,e._)`${b} === true`,()=>h.assign(O,!0),()=>h.assign(O,(0,e._)`${O} || {}`).code((0,e._)`Object.assign(${O}, ${b})`))}),mergeToName:(h,b,O)=>h.if((0,e._)`${O} !== true`,()=>{b===!0?h.assign(O,!0):(h.assign(O,(0,e._)`${O} || {}`),E(h,O,b))}),mergeValues:(h,b)=>h===!0?!0:{...h,...b},resultToName:S}),items:v({mergeNames:(h,b,O)=>h.if((0,e._)`${O} !== true && ${b} !== undefined`,()=>h.assign(O,(0,e._)`${b} === true ? true : ${O} > ${b} ? ${O} : ${b}`)),mergeToName:(h,b,O)=>h.if((0,e._)`${O} !== true`,()=>h.assign(O,b===!0?!0:(0,e._)`${O} > ${b} ? ${O} : ${b}`)),mergeValues:(h,b)=>h===!0?!0:Math.max(h,b),resultToName:(h,b)=>h.var("items",b)})};function S(h,b){if(b===!0)return h.var("props",!0);const O=h.var("props",(0,e._)`{}`);return b!==void 0&&E(h,O,b),O}Ee.evaluatedPropsToName=S;function E(h,b,O){Object.keys(O).forEach(k=>h.assign((0,e._)`${b}${(0,e.getProperty)(k)}`,!0))}Ee.setEvaluated=E;const g={};function y(h,b){return h.scopeValue("func",{ref:b,code:g[b.code]||(g[b.code]=new t._Code(b.code))})}Ee.useFunc=y;var f;(function(h){h[h.Num=0]="Num",h[h.Str=1]="Str"})(f||(Ee.Type=f={}));function C(h,b,O){if(h instanceof e.Name){const k=b===f.Num;return O?k?(0,e._)`"[" + ${h} + "]"`:(0,e._)`"['" + ${h} + "']"`:k?(0,e._)`"/" + ${h}`:(0,e._)`"/" + ${h}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return O?(0,e.getProperty)(h).toString():"/"+u(h)}Ee.getErrorPath=C;function P(h,b,O=h.opts.strictSchema){if(O){if(b=`strict mode: ${b}`,O===!0)throw new Error(b);h.self.logger.warn(b)}}return Ee.checkStrictMode=P,Ee}var Ds={},wf;function nn(){if(wf)return Ds;wf=1,Object.defineProperty(Ds,"__esModule",{value:!0});const e=Oe(),t={data:new e.Name("data"),valCxt:new e.Name("valCxt"),instancePath:new e.Name("instancePath"),parentData:new e.Name("parentData"),parentDataProperty:new e.Name("parentDataProperty"),rootData:new e.Name("rootData"),dynamicAnchors:new e.Name("dynamicAnchors"),vErrors:new e.Name("vErrors"),errors:new e.Name("errors"),this:new e.Name("this"),self:new e.Name("self"),scope:new e.Name("scope"),json:new e.Name("json"),jsonPos:new e.Name("jsonPos"),jsonLen:new e.Name("jsonLen"),jsonPart:new e.Name("jsonPart")};return Ds.default=t,Ds}var Cf;function io(){return Cf||(Cf=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;const t=Oe(),r=Me(),n=nn();e.keywordError={message:({keyword:g})=>(0,t.str)`must pass "${g}" keyword validation`},e.keyword$DataError={message:({keyword:g,schemaType:y})=>y?(0,t.str)`"${g}" keyword must be ${y} ($data)`:(0,t.str)`"${g}" keyword is invalid ($data)`};function s(g,y=e.keywordError,f,C){const{it:P}=g,{gen:h,compositeRule:b,allErrors:O}=P,k=m(g,y,f);C??(b||O)?c(h,k):l(P,(0,t._)`[${k}]`)}e.reportError=s;function i(g,y=e.keywordError,f){const{it:C}=g,{gen:P,compositeRule:h,allErrors:b}=C,O=m(g,y,f);c(P,O),h||b||l(C,n.default.vErrors)}e.reportExtraError=i;function a(g,y){g.assign(n.default.errors,y),g.if((0,t._)`${n.default.vErrors} !== null`,()=>g.if(y,()=>g.assign((0,t._)`${n.default.vErrors}.length`,y),()=>g.assign(n.default.vErrors,null)))}e.resetErrorsCount=a;function o({gen:g,keyword:y,schemaValue:f,data:C,errsCount:P,it:h}){if(P===void 0)throw new Error("ajv implementation error");const b=g.name("err");g.forRange("i",P,n.default.errors,O=>{g.const(b,(0,t._)`${n.default.vErrors}[${O}]`),g.if((0,t._)`${b}.instancePath === undefined`,()=>g.assign((0,t._)`${b}.instancePath`,(0,t.strConcat)(n.default.instancePath,h.errorPath))),g.assign((0,t._)`${b}.schemaPath`,(0,t.str)`${h.errSchemaPath}/${y}`),h.opts.verbose&&(g.assign((0,t._)`${b}.schema`,f),g.assign((0,t._)`${b}.data`,C))})}e.extendErrors=o;function c(g,y){const f=g.const("err",y);g.if((0,t._)`${n.default.vErrors} === null`,()=>g.assign(n.default.vErrors,(0,t._)`[${f}]`),(0,t._)`${n.default.vErrors}.push(${f})`),g.code((0,t._)`${n.default.errors}++`)}function l(g,y){const{gen:f,validateName:C,schemaEnv:P}=g;P.$async?f.throw((0,t._)`new ${g.ValidationError}(${y})`):(f.assign((0,t._)`${C}.errors`,y),f.return(!1))}const u={keyword:new t.Name("keyword"),schemaPath:new t.Name("schemaPath"),params:new t.Name("params"),propertyName:new t.Name("propertyName"),message:new t.Name("message"),schema:new t.Name("schema"),parentSchema:new t.Name("parentSchema")};function m(g,y,f){const{createErrors:C}=g.it;return C===!1?(0,t._)`{}`:_(g,y,f)}function _(g,y,f={}){const{gen:C,it:P}=g,h=[v(P,f),S(g,f)];return E(g,y,h),C.object(...h)}function v({errorPath:g},{instancePath:y}){const f=y?(0,t.str)`${g}${(0,r.getErrorPath)(y,r.Type.Str)}`:g;return[n.default.instancePath,(0,t.strConcat)(n.default.instancePath,f)]}function S({keyword:g,it:{errSchemaPath:y}},{schemaPath:f,parentSchema:C}){let P=C?y:(0,t.str)`${y}/${g}`;return f&&(P=(0,t.str)`${P}${(0,r.getErrorPath)(f,r.Type.Str)}`),[u.schemaPath,P]}function E(g,{params:y,message:f},C){const{keyword:P,data:h,schemaValue:b,it:O}=g,{opts:k,propertyName:$,topSchemaRef:M,schemaPath:q}=O;C.push([u.keyword,P],[u.params,typeof y=="function"?y(g):y||(0,t._)`{}`]),k.messages&&C.push([u.message,typeof f=="function"?f(g):f]),k.verbose&&C.push([u.schema,b],[u.parentSchema,(0,t._)`${M}${q}`],[n.default.data,h]),$&&C.push([u.propertyName,$])}})(nc)),nc}var Ef;function Ew(){if(Ef)return yn;Ef=1,Object.defineProperty(yn,"__esModule",{value:!0}),yn.boolOrEmptySchema=yn.topBoolOrEmptySchema=void 0;const e=io(),t=Oe(),r=nn(),n={message:"boolean schema is false"};function s(o){const{gen:c,schema:l,validateName:u}=o;l===!1?a(o,!1):typeof l=="object"&&l.$async===!0?c.return(r.default.data):(c.assign((0,t._)`${u}.errors`,null),c.return(!0))}yn.topBoolOrEmptySchema=s;function i(o,c){const{gen:l,schema:u}=o;u===!1?(l.var(c,!1),a(o)):l.var(c,!0)}yn.boolOrEmptySchema=i;function a(o,c){const{gen:l,data:u}=o,m={gen:l,keyword:"false schema",data:u,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:o};(0,e.reportError)(m,n,void 0,c)}return yn}var gt={},gn={},Af;function ep(){if(Af)return gn;Af=1,Object.defineProperty(gn,"__esModule",{value:!0}),gn.getRules=gn.isJSONType=void 0;const e=["string","number","integer","boolean","null","object","array"],t=new Set(e);function r(s){return typeof s=="string"&&t.has(s)}gn.isJSONType=r;function n(){const s={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...s,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},s.number,s.string,s.array,s.object],post:{rules:[]},all:{},keywords:{}}}return gn.getRules=n,gn}var Ar={},xf;function tp(){if(xf)return Ar;xf=1,Object.defineProperty(Ar,"__esModule",{value:!0}),Ar.shouldUseRule=Ar.shouldUseGroup=Ar.schemaHasRulesForType=void 0;function e({schema:n,self:s},i){const a=s.RULES.types[i];return a&&a!==!0&&t(n,a)}Ar.schemaHasRulesForType=e;function t(n,s){return s.rules.some(i=>r(n,i))}Ar.shouldUseGroup=t;function r(n,s){var i;return n[s.keyword]!==void 0||((i=s.definition.implements)===null||i===void 0?void 0:i.some(a=>n[a]!==void 0))}return Ar.shouldUseRule=r,Ar}var Pf;function Ba(){if(Pf)return gt;Pf=1,Object.defineProperty(gt,"__esModule",{value:!0}),gt.reportTypeError=gt.checkDataTypes=gt.checkDataType=gt.coerceAndCheckDataType=gt.getJSONTypes=gt.getSchemaTypes=gt.DataType=void 0;const e=ep(),t=tp(),r=io(),n=Oe(),s=Me();var i;(function(f){f[f.Correct=0]="Correct",f[f.Wrong=1]="Wrong"})(i||(gt.DataType=i={}));function a(f){const C=o(f.type);if(C.includes("null")){if(f.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!C.length&&f.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');f.nullable===!0&&C.push("null")}return C}gt.getSchemaTypes=a;function o(f){const C=Array.isArray(f)?f:f?[f]:[];if(C.every(e.isJSONType))return C;throw new Error("type must be JSONType or JSONType[]: "+C.join(","))}gt.getJSONTypes=o;function c(f,C){const{gen:P,data:h,opts:b}=f,O=u(C,b.coerceTypes),k=C.length>0&&!(O.length===0&&C.length===1&&(0,t.schemaHasRulesForType)(f,C[0]));if(k){const $=S(C,h,b.strictNumbers,i.Wrong);P.if($,()=>{O.length?m(f,C,O):g(f)})}return k}gt.coerceAndCheckDataType=c;const l=new Set(["string","number","integer","boolean","null"]);function u(f,C){return C?f.filter(P=>l.has(P)||C==="array"&&P==="array"):[]}function m(f,C,P){const{gen:h,data:b,opts:O}=f,k=h.let("dataType",(0,n._)`typeof ${b}`),$=h.let("coerced",(0,n._)`undefined`);O.coerceTypes==="array"&&h.if((0,n._)`${k} == 'object' && Array.isArray(${b}) && ${b}.length == 1`,()=>h.assign(b,(0,n._)`${b}[0]`).assign(k,(0,n._)`typeof ${b}`).if(S(C,b,O.strictNumbers),()=>h.assign($,b))),h.if((0,n._)`${$} !== undefined`);for(const q of P)(l.has(q)||q==="array"&&O.coerceTypes==="array")&&M(q);h.else(),g(f),h.endIf(),h.if((0,n._)`${$} !== undefined`,()=>{h.assign(b,$),_(f,$)});function M(q){switch(q){case"string":h.elseIf((0,n._)`${k} == "number" || ${k} == "boolean"`).assign($,(0,n._)`"" + ${b}`).elseIf((0,n._)`${b} === null`).assign($,(0,n._)`""`);return;case"number":h.elseIf((0,n._)`${k} == "boolean" || ${b} === null
|| (${k} == "string" && ${b} && ${b} == +${b})`).assign($,(0,n._)`+${b}`);return;case"integer":h.elseIf((0,n._)`${k} === "boolean" || ${b} === null
|| (${k} === "string" && ${b} && ${b} == +${b} && !(${b} % 1))`).assign($,(0,n._)`+${b}`);return;case"boolean":h.elseIf((0,n._)`${b} === "false" || ${b} === 0 || ${b} === null`).assign($,!1).elseIf((0,n._)`${b} === "true" || ${b} === 1`).assign($,!0);return;case"null":h.elseIf((0,n._)`${b} === "" || ${b} === 0 || ${b} === false`),h.assign($,null);return;case"array":h.elseIf((0,n._)`${k} === "string" || ${k} === "number"
|| ${k} === "boolean" || ${b} === null`).assign($,(0,n._)`[${b}]`)}}}function _({gen:f,parentData:C,parentDataProperty:P},h){f.if((0,n._)`${C} !== undefined`,()=>f.assign((0,n._)`${C}[${P}]`,h))}function v(f,C,P,h=i.Correct){const b=h===i.Correct?n.operators.EQ:n.operators.NEQ;let O;switch(f){case"null":return(0,n._)`${C} ${b} null`;case"array":O=(0,n._)`Array.isArray(${C})`;break;case"object":O=(0,n._)`${C} && typeof ${C} == "object" && !Array.isArray(${C})`;break;case"integer":O=k((0,n._)`!(${C} % 1) && !isNaN(${C})`);break;case"number":O=k();break;default:return(0,n._)`typeof ${C} ${b} ${f}`}return h===i.Correct?O:(0,n.not)(O);function k($=n.nil){return(0,n.and)((0,n._)`typeof ${C} == "number"`,$,P?(0,n._)`isFinite(${C})`:n.nil)}}gt.checkDataType=v;function S(f,C,P,h){if(f.length===1)return v(f[0],C,P,h);let b;const O=(0,s.toHash)(f);if(O.array&&O.object){const k=(0,n._)`typeof ${C} != "object"`;b=O.null?k:(0,n._)`!${C} || ${k}`,delete O.null,delete O.array,delete O.object}else b=n.nil;O.number&&delete O.integer;for(const k in O)b=(0,n.and)(b,v(k,C,P,h));return b}gt.checkDataTypes=S;const E={message:({schema:f})=>`must be ${f}`,params:({schema:f,schemaValue:C})=>typeof f=="string"?(0,n._)`{type: ${f}}`:(0,n._)`{type: ${C}}`};function g(f){const C=y(f);(0,r.reportError)(C,E)}gt.reportTypeError=g;function y(f){const{gen:C,data:P,schema:h}=f,b=(0,s.schemaRefOrVal)(f,h,"type");return{gen:C,keyword:"type",data:P,schema:h.type,schemaCode:b,schemaValue:b,parentSchema:h,params:{},it:f}}return gt}var Si={},Of;function Aw(){if(Of)return Si;Of=1,Object.defineProperty(Si,"__esModule",{value:!0}),Si.assignDefaults=void 0;const e=Oe(),t=Me();function r(s,i){const{properties:a,items:o}=s.schema;if(i==="object"&&a)for(const c in a)n(s,c,a[c].default);else i==="array"&&Array.isArray(o)&&o.forEach((c,l)=>n(s,l,c.default))}Si.assignDefaults=r;function n(s,i,a){const{gen:o,compositeRule:c,data:l,opts:u}=s;if(a===void 0)return;const m=(0,e._)`${l}${(0,e.getProperty)(i)}`;if(c){(0,t.checkStrictMode)(s,`default is ignored for: ${m}`);return}let _=(0,e._)`${m} === undefined`;u.useDefaults==="empty"&&(_=(0,e._)`${_} || ${m} === null || ${m} === ""`),o.if(_,(0,e._)`${m} = ${(0,e.stringify)(a)}`)}return Si}var Zt={},We={},jf;function ar(){if(jf)return We;jf=1,Object.defineProperty(We,"__esModule",{value:!0}),We.validateUnion=We.validateArray=We.usePattern=We.callValidateCode=We.schemaProperties=We.allSchemaProperties=We.noPropertyInData=We.propertyInData=We.isOwnProperty=We.hasPropFunc=We.reportMissingProp=We.checkMissingProp=We.checkReportMissingProp=void 0;const e=Oe(),t=Me(),r=nn(),n=Me();function s(f,C){const{gen:P,data:h,it:b}=f;P.if(u(P,h,C,b.opts.ownProperties),()=>{f.setParams({missingProperty:(0,e._)`${C}`},!0),f.error()})}We.checkReportMissingProp=s;function i({gen:f,data:C,it:{opts:P}},h,b){return(0,e.or)(...h.map(O=>(0,e.and)(u(f,C,O,P.ownProperties),(0,e._)`${b} = ${O}`)))}We.checkMissingProp=i;function a(f,C){f.setParams({missingProperty:C},!0),f.error()}We.reportMissingProp=a;function o(f){return f.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,e._)`Object.prototype.hasOwnProperty`})}We.hasPropFunc=o;function c(f,C,P){return(0,e._)`${o(f)}.call(${C}, ${P})`}We.isOwnProperty=c;function l(f,C,P,h){const b=(0,e._)`${C}${(0,e.getProperty)(P)} !== undefined`;return h?(0,e._)`${b} && ${c(f,C,P)}`:b}We.propertyInData=l;function u(f,C,P,h){const b=(0,e._)`${C}${(0,e.getProperty)(P)} === undefined`;return h?(0,e.or)(b,(0,e.not)(c(f,C,P))):b}We.noPropertyInData=u;function m(f){return f?Object.keys(f).filter(C=>C!=="__proto__"):[]}We.allSchemaProperties=m;function _(f,C){return m(C).filter(P=>!(0,t.alwaysValidSchema)(f,C[P]))}We.schemaProperties=_;function v({schemaCode:f,data:C,it:{gen:P,topSchemaRef:h,schemaPath:b,errorPath:O},it:k},$,M,q){const L=q?(0,e._)`${f}, ${C}, ${h}${b}`:C,U=[[r.default.instancePath,(0,e.strConcat)(r.default.instancePath,O)],[r.default.parentData,k.parentData],[r.default.parentDataProperty,k.parentDataProperty],[r.default.rootData,r.default.rootData]];k.opts.dynamicRef&&U.push([r.default.dynamicAnchors,r.default.dynamicAnchors]);const B=(0,e._)`${L}, ${P.object(...U)}`;return M!==e.nil?(0,e._)`${$}.call(${M}, ${B})`:(0,e._)`${$}(${B})`}We.callValidateCode=v;const S=(0,e._)`new RegExp`;function E({gen:f,it:{opts:C}},P){const h=C.unicodeRegExp?"u":"",{regExp:b}=C.code,O=b(P,h);return f.scopeValue("pattern",{key:O.toString(),ref:O,code:(0,e._)`${b.code==="new RegExp"?S:(0,n.useFunc)(f,b)}(${P}, ${h})`})}We.usePattern=E;function g(f){const{gen:C,data:P,keyword:h,it:b}=f,O=C.name("valid");if(b.allErrors){const $=C.let("valid",!0);return k(()=>C.assign($,!1)),$}return C.var(O,!0),k(()=>C.break()),O;function k($){const M=C.const("len",(0,e._)`${P}.length`);C.forRange("i",0,M,q=>{f.subschema({keyword:h,dataProp:q,dataPropType:t.Type.Num},O),C.if((0,e.not)(O),$)})}}We.validateArray=g;function y(f){const{gen:C,schema:P,keyword:h,it:b}=f;if(!Array.isArray(P))throw new Error("ajv implementation error");if(P.some(M=>(0,t.alwaysValidSchema)(b,M))&&!b.opts.unevaluated)return;const k=C.let("valid",!1),$=C.name("_valid");C.block(()=>P.forEach((M,q)=>{const L=f.subschema({keyword:h,schemaProp:q,compositeRule:!0},$);C.assign(k,(0,e._)`${k} || ${$}`),f.mergeValidEvaluated(L,$)||C.if((0,e.not)(k))})),f.result(k,()=>f.reset(),()=>f.error(!0))}return We.validateUnion=y,We}var kf;function xw(){if(kf)return Zt;kf=1,Object.defineProperty(Zt,"__esModule",{value:!0}),Zt.validateKeywordUsage=Zt.validSchemaType=Zt.funcKeywordCode=Zt.macroKeywordCode=void 0;const e=Oe(),t=nn(),r=ar(),n=io();function s(_,v){const{gen:S,keyword:E,schema:g,parentSchema:y,it:f}=_,C=v.macro.call(f.self,g,y,f),P=l(S,E,C);f.opts.validateSchema!==!1&&f.self.validateSchema(C,!0);const h=S.name("valid");_.subschema({schema:C,schemaPath:e.nil,errSchemaPath:`${f.errSchemaPath}/${E}`,topSchemaRef:P,compositeRule:!0},h),_.pass(h,()=>_.error(!0))}Zt.macroKeywordCode=s;function i(_,v){var S;const{gen:E,keyword:g,schema:y,parentSchema:f,$data:C,it:P}=_;c(P,v);const h=!C&&v.compile?v.compile.call(P.self,y,f,P):v.validate,b=l(E,g,h),O=E.let("valid");_.block$data(O,k),_.ok((S=v.valid)!==null&&S!==void 0?S:O);function k(){if(v.errors===!1)q(),v.modifying&&a(_),L(()=>_.error());else{const U=v.async?$():M();v.modifying&&a(_),L(()=>o(_,U))}}function $(){const U=E.let("ruleErrs",null);return E.try(()=>q((0,e._)`await `),B=>E.assign(O,!1).if((0,e._)`${B} instanceof ${P.ValidationError}`,()=>E.assign(U,(0,e._)`${B}.errors`),()=>E.throw(B))),U}function M(){const U=(0,e._)`${b}.errors`;return E.assign(U,null),q(e.nil),U}function q(U=v.async?(0,e._)`await `:e.nil){const B=P.opts.passContext?t.default.this:t.default.self,W=!("compile"in v&&!C||v.schema===!1);E.assign(O,(0,e._)`${U}${(0,r.callValidateCode)(_,b,B,W)}`,v.modifying)}function L(U){var B;E.if((0,e.not)((B=v.valid)!==null&&B!==void 0?B:O),U)}}Zt.funcKeywordCode=i;function a(_){const{gen:v,data:S,it:E}=_;v.if(E.parentData,()=>v.assign(S,(0,e._)`${E.parentData}[${E.parentDataProperty}]`))}function o(_,v){const{gen:S}=_;S.if((0,e._)`Array.isArray(${v})`,()=>{S.assign(t.default.vErrors,(0,e._)`${t.default.vErrors} === null ? ${v} : ${t.default.vErrors}.concat(${v})`).assign(t.default.errors,(0,e._)`${t.default.vErrors}.length`),(0,n.extendErrors)(_)},()=>_.error())}function c({schemaEnv:_},v){if(v.async&&!_.$async)throw new Error("async keyword in sync schema")}function l(_,v,S){if(S===void 0)throw new Error(`keyword "${v}" failed to compile`);return _.scopeValue("keyword",typeof S=="function"?{ref:S}:{ref:S,code:(0,e.stringify)(S)})}function u(_,v,S=!1){return!v.length||v.some(E=>E==="array"?Array.isArray(_):E==="object"?_&&typeof _=="object"&&!Array.isArray(_):typeof _==E||S&&typeof _>"u")}Zt.validSchemaType=u;function m({schema:_,opts:v,self:S,errSchemaPath:E},g,y){if(Array.isArray(g.keyword)?!g.keyword.includes(y):g.keyword!==y)throw new Error("ajv implementation error");const f=g.dependencies;if(f?.some(C=>!Object.prototype.hasOwnProperty.call(_,C)))throw new Error(`parent schema must have dependencies of ${y}: ${f.join(",")}`);if(g.validateSchema&&!g.validateSchema(_[y])){const P=`keyword "${y}" value is invalid at path "${E}": `+S.errorsText(g.validateSchema.errors);if(v.validateSchema==="log")S.logger.error(P);else throw new Error(P)}}return Zt.validateKeywordUsage=m,Zt}var xr={},Nf;function Pw(){if(Nf)return xr;Nf=1,Object.defineProperty(xr,"__esModule",{value:!0}),xr.extendSubschemaMode=xr.extendSubschemaData=xr.getSubschema=void 0;const e=Oe(),t=Me();function r(i,{keyword:a,schemaProp:o,schema:c,schemaPath:l,errSchemaPath:u,topSchemaRef:m}){if(a!==void 0&&c!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(a!==void 0){const _=i.schema[a];return o===void 0?{schema:_,schemaPath:(0,e._)`${i.schemaPath}${(0,e.getProperty)(a)}`,errSchemaPath:`${i.errSchemaPath}/${a}`}:{schema:_[o],schemaPath:(0,e._)`${i.schemaPath}${(0,e.getProperty)(a)}${(0,e.getProperty)(o)}`,errSchemaPath:`${i.errSchemaPath}/${a}/${(0,t.escapeFragment)(o)}`}}if(c!==void 0){if(l===void 0||u===void 0||m===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:c,schemaPath:l,topSchemaRef:m,errSchemaPath:u}}throw new Error('either "keyword" or "schema" must be passed')}xr.getSubschema=r;function n(i,a,{dataProp:o,dataPropType:c,data:l,dataTypes:u,propertyName:m}){if(l!==void 0&&o!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:_}=a;if(o!==void 0){const{errorPath:S,dataPathArr:E,opts:g}=a,y=_.let("data",(0,e._)`${a.data}${(0,e.getProperty)(o)}`,!0);v(y),i.errorPath=(0,e.str)`${S}${(0,t.getErrorPath)(o,c,g.jsPropertySyntax)}`,i.parentDataProperty=(0,e._)`${o}`,i.dataPathArr=[...E,i.parentDataProperty]}if(l!==void 0){const S=l instanceof e.Name?l:_.let("data",l,!0);v(S),m!==void 0&&(i.propertyName=m)}u&&(i.dataTypes=u);function v(S){i.data=S,i.dataLevel=a.dataLevel+1,i.dataTypes=[],a.definedProperties=new Set,i.parentData=a.data,i.dataNames=[...a.dataNames,S]}}xr.extendSubschemaData=n;function s(i,{jtdDiscriminator:a,jtdMetadata:o,compositeRule:c,createErrors:l,allErrors:u}){c!==void 0&&(i.compositeRule=c),l!==void 0&&(i.createErrors=l),u!==void 0&&(i.allErrors=u),i.jtdDiscriminator=a,i.jtdMetadata=o}return xr.extendSubschemaMode=s,xr}var Ot={},oc={exports:{}},If;function Ow(){if(If)return oc.exports;If=1;var e=oc.exports=function(n,s,i){typeof s=="function"&&(i=s,s={}),i=s.cb||i;var a=typeof i=="function"?i:i.pre||function(){},o=i.post||function(){};t(s,a,o,n,"",n)};e.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},e.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},e.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},e.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function t(n,s,i,a,o,c,l,u,m,_){if(a&&typeof a=="object"&&!Array.isArray(a)){s(a,o,c,l,u,m,_);for(var v in a){var S=a[v];if(Array.isArray(S)){if(v in e.arrayKeywords)for(var E=0;E<S.length;E++)t(n,s,i,S[E],o+"/"+v+"/"+E,c,o,v,a,E)}else if(v in e.propsKeywords){if(S&&typeof S=="object")for(var g in S)t(n,s,i,S[g],o+"/"+v+"/"+r(g),c,o,v,a,g)}else(v in e.keywords||n.allKeys&&!(v in e.skipKeywords))&&t(n,s,i,S,o+"/"+v,c,o,v,a)}i(a,o,c,l,u,m,_)}}function r(n){return n.replace(/~/g,"~0").replace(/\//g,"~1")}return oc.exports}var Rf;function so(){if(Rf)return Ot;Rf=1,Object.defineProperty(Ot,"__esModule",{value:!0}),Ot.getSchemaRefs=Ot.resolveUrl=Ot.normalizeId=Ot._getFullPath=Ot.getFullPath=Ot.inlineRef=void 0;const e=Me(),t=eo(),r=Ow(),n=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function s(E,g=!0){return typeof E=="boolean"?!0:g===!0?!a(E):g?o(E)<=g:!1}Ot.inlineRef=s;const i=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function a(E){for(const g in E){if(i.has(g))return!0;const y=E[g];if(Array.isArray(y)&&y.some(a)||typeof y=="object"&&a(y))return!0}return!1}function o(E){let g=0;for(const y in E){if(y==="$ref")return 1/0;if(g++,!n.has(y)&&(typeof E[y]=="object"&&(0,e.eachItem)(E[y],f=>g+=o(f)),g===1/0))return 1/0}return g}function c(E,g="",y){y!==!1&&(g=m(g));const f=E.parse(g);return l(E,f)}Ot.getFullPath=c;function l(E,g){return E.serialize(g).split("#")[0]+"#"}Ot._getFullPath=l;const u=/#\/?$/;function m(E){return E?E.replace(u,""):""}Ot.normalizeId=m;function _(E,g,y){return y=m(y),E.resolve(g,y)}Ot.resolveUrl=_;const v=/^[a-z_][-a-z0-9._]*$/i;function S(E,g){if(typeof E=="boolean")return{};const{schemaId:y,uriResolver:f}=this.opts,C=m(E[y]||g),P={"":C},h=c(f,C,!1),b={},O=new Set;return r(E,{allKeys:!0},(M,q,L,U)=>{if(U===void 0)return;const B=h+q;let W=P[U];typeof M[y]=="string"&&(W=Y.call(this,M[y])),Q.call(this,M.$anchor),Q.call(this,M.$dynamicAnchor),P[q]=W;function Y(Z){const re=this.opts.uriResolver.resolve;if(Z=m(W?re(W,Z):Z),O.has(Z))throw $(Z);O.add(Z);let A=this.refs[Z];return typeof A=="string"&&(A=this.refs[A]),typeof A=="object"?k(M,A.schema,Z):Z!==m(B)&&(Z[0]==="#"?(k(M,b[Z],Z),b[Z]=M):this.refs[Z]=B),Z}function Q(Z){if(typeof Z=="string"){if(!v.test(Z))throw new Error(`invalid anchor "${Z}"`);Y.call(this,`#${Z}`)}}}),b;function k(M,q,L){if(q!==void 0&&!t(M,q))throw $(L)}function $(M){return new Error(`reference "${M}" resolves to more than one schema`)}}return Ot.getSchemaRefs=S,Ot}var $f;function ao(){if($f)return Er;$f=1,Object.defineProperty(Er,"__esModule",{value:!0}),Er.getData=Er.KeywordCxt=Er.validateFunctionCode=void 0;const e=Ew(),t=Ba(),r=tp(),n=Ba(),s=Aw(),i=xw(),a=Pw(),o=Oe(),c=nn(),l=so(),u=Me(),m=io();function _(R){if(h(R)&&(O(R),P(R))){g(R);return}v(R,()=>(0,e.topBoolOrEmptySchema)(R))}Er.validateFunctionCode=_;function v({gen:R,validateName:D,schema:V,schemaEnv:K,opts:G},J){G.code.es5?R.func(D,(0,o._)`${c.default.data}, ${c.default.valCxt}`,K.$async,()=>{R.code((0,o._)`"use strict"; ${f(V,G)}`),E(R,G),R.code(J)}):R.func(D,(0,o._)`${c.default.data}, ${S(G)}`,K.$async,()=>R.code(f(V,G)).code(J))}function S(R){return(0,o._)`{${c.default.instancePath}="", ${c.default.parentData}, ${c.default.parentDataProperty}, ${c.default.rootData}=${c.default.data}${R.dynamicRef?(0,o._)`, ${c.default.dynamicAnchors}={}`:o.nil}}={}`}function E(R,D){R.if(c.default.valCxt,()=>{R.var(c.default.instancePath,(0,o._)`${c.default.valCxt}.${c.default.instancePath}`),R.var(c.default.parentData,(0,o._)`${c.default.valCxt}.${c.default.parentData}`),R.var(c.default.parentDataProperty,(0,o._)`${c.default.valCxt}.${c.default.parentDataProperty}`),R.var(c.default.rootData,(0,o._)`${c.default.valCxt}.${c.default.rootData}`),D.dynamicRef&&R.var(c.default.dynamicAnchors,(0,o._)`${c.default.valCxt}.${c.default.dynamicAnchors}`)},()=>{R.var(c.default.instancePath,(0,o._)`""`),R.var(c.default.parentData,(0,o._)`undefined`),R.var(c.default.parentDataProperty,(0,o._)`undefined`),R.var(c.default.rootData,c.default.data),D.dynamicRef&&R.var(c.default.dynamicAnchors,(0,o._)`{}`)})}function g(R){const{schema:D,opts:V,gen:K}=R;v(R,()=>{V.$comment&&D.$comment&&U(R),M(R),K.let(c.default.vErrors,null),K.let(c.default.errors,0),V.unevaluated&&y(R),k(R),B(R)})}function y(R){const{gen:D,validateName:V}=R;R.evaluated=D.const("evaluated",(0,o._)`${V}.evaluated`),D.if((0,o._)`${R.evaluated}.dynamicProps`,()=>D.assign((0,o._)`${R.evaluated}.props`,(0,o._)`undefined`)),D.if((0,o._)`${R.evaluated}.dynamicItems`,()=>D.assign((0,o._)`${R.evaluated}.items`,(0,o._)`undefined`))}function f(R,D){const V=typeof R=="object"&&R[D.schemaId];return V&&(D.code.source||D.code.process)?(0,o._)`/*# sourceURL=${V} */`:o.nil}function C(R,D){if(h(R)&&(O(R),P(R))){b(R,D);return}(0,e.boolOrEmptySchema)(R,D)}function P({schema:R,self:D}){if(typeof R=="boolean")return!R;for(const V in R)if(D.RULES.all[V])return!0;return!1}function h(R){return typeof R.schema!="boolean"}function b(R,D){const{schema:V,gen:K,opts:G}=R;G.$comment&&V.$comment&&U(R),q(R),L(R);const J=K.const("_errs",c.default.errors);k(R,J),K.var(D,(0,o._)`${J} === ${c.default.errors}`)}function O(R){(0,u.checkUnknownRules)(R),$(R)}function k(R,D){if(R.opts.jtd)return Y(R,[],!1,D);const V=(0,t.getSchemaTypes)(R.schema),K=(0,t.coerceAndCheckDataType)(R,V);Y(R,V,!K,D)}function $(R){const{schema:D,errSchemaPath:V,opts:K,self:G}=R;D.$ref&&K.ignoreKeywordsWithRef&&(0,u.schemaHasRulesButRef)(D,G.RULES)&&G.logger.warn(`$ref: keywords ignored in schema at path "${V}"`)}function M(R){const{schema:D,opts:V}=R;D.default!==void 0&&V.useDefaults&&V.strictSchema&&(0,u.checkStrictMode)(R,"default is ignored in the schema root")}function q(R){const D=R.schema[R.opts.schemaId];D&&(R.baseId=(0,l.resolveUrl)(R.opts.uriResolver,R.baseId,D))}function L(R){if(R.schema.$async&&!R.schemaEnv.$async)throw new Error("async schema in sync schema")}function U({gen:R,schemaEnv:D,schema:V,errSchemaPath:K,opts:G}){const J=V.$comment;if(G.$comment===!0)R.code((0,o._)`${c.default.self}.logger.log(${J})`);else if(typeof G.$comment=="function"){const te=(0,o.str)`${K}/$comment`,ne=R.scopeValue("root",{ref:D.root});R.code((0,o._)`${c.default.self}.opts.$comment(${J}, ${te}, ${ne}.schema)`)}}function B(R){const{gen:D,schemaEnv:V,validateName:K,ValidationError:G,opts:J}=R;V.$async?D.if((0,o._)`${c.default.errors} === 0`,()=>D.return(c.default.data),()=>D.throw((0,o._)`new ${G}(${c.default.vErrors})`)):(D.assign((0,o._)`${K}.errors`,c.default.vErrors),J.unevaluated&&W(R),D.return((0,o._)`${c.default.errors} === 0`))}function W({gen:R,evaluated:D,props:V,items:K}){V instanceof o.Name&&R.assign((0,o._)`${D}.props`,V),K instanceof o.Name&&R.assign((0,o._)`${D}.items`,K)}function Y(R,D,V,K){const{gen:G,schema:J,data:te,allErrors:ne,opts:se,self:ce}=R,{RULES:he}=ce;if(J.$ref&&(se.ignoreKeywordsWithRef||!(0,u.schemaHasRulesButRef)(J,he))){G.block(()=>T(R,"$ref",he.all.$ref.definition));return}se.jtd||Z(R,D),G.block(()=>{for(const ge of he.rules)le(ge);le(he.post)});function le(ge){(0,r.shouldUseGroup)(J,ge)&&(ge.type?(G.if((0,n.checkDataType)(ge.type,te,se.strictNumbers)),Q(R,ge),D.length===1&&D[0]===ge.type&&V&&(G.else(),(0,n.reportTypeError)(R)),G.endIf()):Q(R,ge),ne||G.if((0,o._)`${c.default.errors} === ${K||0}`))}}function Q(R,D){const{gen:V,schema:K,opts:{useDefaults:G}}=R;G&&(0,s.assignDefaults)(R,D.type),V.block(()=>{for(const J of D.rules)(0,r.shouldUseRule)(K,J)&&T(R,J.keyword,J.definition,D.type)})}function Z(R,D){R.schemaEnv.meta||!R.opts.strictTypes||(re(R,D),R.opts.allowUnionTypes||A(R,D),w(R,R.dataTypes))}function re(R,D){if(D.length){if(!R.dataTypes.length){R.dataTypes=D;return}D.forEach(V=>{p(R.dataTypes,V)||x(R,`type "${V}" not allowed by context "${R.dataTypes.join(",")}"`)}),d(R,D)}}function A(R,D){D.length>1&&!(D.length===2&&D.includes("null"))&&x(R,"use allowUnionTypes to allow union type keyword")}function w(R,D){const V=R.self.RULES.all;for(const K in V){const G=V[K];if(typeof G=="object"&&(0,r.shouldUseRule)(R.schema,G)){const{type:J}=G.definition;J.length&&!J.some(te=>j(D,te))&&x(R,`missing type "${J.join(",")}" for keyword "${K}"`)}}}function j(R,D){return R.includes(D)||D==="number"&&R.includes("integer")}function p(R,D){return R.includes(D)||D==="integer"&&R.includes("number")}function d(R,D){const V=[];for(const K of R.dataTypes)p(D,K)?V.push(K):D.includes("integer")&&K==="number"&&V.push("integer");R.dataTypes=V}function x(R,D){const V=R.schemaEnv.baseId+R.errSchemaPath;D+=` at "${V}" (strictTypes)`,(0,u.checkStrictMode)(R,D,R.opts.strictTypes)}class I{constructor(D,V,K){if((0,i.validateKeywordUsage)(D,V,K),this.gen=D.gen,this.allErrors=D.allErrors,this.keyword=K,this.data=D.data,this.schema=D.schema[K],this.$data=V.$data&&D.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,u.schemaRefOrVal)(D,this.schema,K,this.$data),this.schemaType=V.schemaType,this.parentSchema=D.schema,this.params={},this.it=D,this.def=V,this.$data)this.schemaCode=D.gen.const("vSchema",H(this.$data,D));else if(this.schemaCode=this.schemaValue,!(0,i.validSchemaType)(this.schema,V.schemaType,V.allowUndefined))throw new Error(`${K} value must be ${JSON.stringify(V.schemaType)}`);("code"in V?V.trackErrors:V.errors!==!1)&&(this.errsCount=D.gen.const("_errs",c.default.errors))}result(D,V,K){this.failResult((0,o.not)(D),V,K)}failResult(D,V,K){this.gen.if(D),K?K():this.error(),V?(this.gen.else(),V(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(D,V){this.failResult((0,o.not)(D),void 0,V)}fail(D){if(D===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(D),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(D){if(!this.$data)return this.fail(D);const{schemaCode:V}=this;this.fail((0,o._)`${V} !== undefined && (${(0,o.or)(this.invalid$data(),D)})`)}error(D,V,K){if(V){this.setParams(V),this._error(D,K),this.setParams({});return}this._error(D,K)}_error(D,V){(D?m.reportExtraError:m.reportError)(this,this.def.error,V)}$dataError(){(0,m.reportError)(this,this.def.$dataError||m.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,m.resetErrorsCount)(this.gen,this.errsCount)}ok(D){this.allErrors||this.gen.if(D)}setParams(D,V){V?Object.assign(this.params,D):this.params=D}block$data(D,V,K=o.nil){this.gen.block(()=>{this.check$data(D,K),V()})}check$data(D=o.nil,V=o.nil){if(!this.$data)return;const{gen:K,schemaCode:G,schemaType:J,def:te}=this;K.if((0,o.or)((0,o._)`${G} === undefined`,V)),D!==o.nil&&K.assign(D,!0),(J.length||te.validateSchema)&&(K.elseIf(this.invalid$data()),this.$dataError(),D!==o.nil&&K.assign(D,!1)),K.else()}invalid$data(){const{gen:D,schemaCode:V,schemaType:K,def:G,it:J}=this;return(0,o.or)(te(),ne());function te(){if(K.length){if(!(V instanceof o.Name))throw new Error("ajv implementation error");const se=Array.isArray(K)?K:[K];return(0,o._)`${(0,n.checkDataTypes)(se,V,J.opts.strictNumbers,n.DataType.Wrong)}`}return o.nil}function ne(){if(G.validateSchema){const se=D.scopeValue("validate$data",{ref:G.validateSchema});return(0,o._)`!${se}(${V})`}return o.nil}}subschema(D,V){const K=(0,a.getSubschema)(this.it,D);(0,a.extendSubschemaData)(K,this.it,D),(0,a.extendSubschemaMode)(K,D);const G={...this.it,...K,items:void 0,props:void 0};return C(G,V),G}mergeEvaluated(D,V){const{it:K,gen:G}=this;K.opts.unevaluated&&(K.props!==!0&&D.props!==void 0&&(K.props=u.mergeEvaluated.props(G,D.props,K.props,V)),K.items!==!0&&D.items!==void 0&&(K.items=u.mergeEvaluated.items(G,D.items,K.items,V)))}mergeValidEvaluated(D,V){const{it:K,gen:G}=this;if(K.opts.unevaluated&&(K.props!==!0||K.items!==!0))return G.if(V,()=>this.mergeEvaluated(D,o.Name)),!0}}Er.KeywordCxt=I;function T(R,D,V,K){const G=new I(R,V,D);"code"in V?V.code(G,K):G.$data&&V.validate?(0,i.funcKeywordCode)(G,V):"macro"in V?(0,i.macroKeywordCode)(G,V):(V.compile||V.validate)&&(0,i.funcKeywordCode)(G,V)}const F=/^\/(?:[^~]|~0|~1)*$/,z=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function H(R,{dataLevel:D,dataNames:V,dataPathArr:K}){let G,J;if(R==="")return c.default.rootData;if(R[0]==="/"){if(!F.test(R))throw new Error(`Invalid JSON-pointer: ${R}`);G=R,J=c.default.rootData}else{const ce=z.exec(R);if(!ce)throw new Error(`Invalid JSON-pointer: ${R}`);const he=+ce[1];if(G=ce[2],G==="#"){if(he>=D)throw new Error(se("property/index",he));return K[D-he]}if(he>D)throw new Error(se("data",he));if(J=V[D-he],!G)return J}let te=J;const ne=G.split("/");for(const ce of ne)ce&&(J=(0,o._)`${J}${(0,o.getProperty)((0,u.unescapeJsonPointer)(ce))}`,te=(0,o._)`${te} && ${J}`);return te;function se(ce,he){return`Cannot access ${ce} ${he} levels up, current level is ${D}`}}return Er.getData=H,Er}var Ts={},Ff;function hl(){if(Ff)return Ts;Ff=1,Object.defineProperty(Ts,"__esModule",{value:!0});class e extends Error{constructor(r){super("validation failed"),this.errors=r,this.ajv=this.validation=!0}}return Ts.default=e,Ts}var Ms={},Df;function oo(){if(Df)return Ms;Df=1,Object.defineProperty(Ms,"__esModule",{value:!0});const e=so();class t extends Error{constructor(n,s,i,a){super(a||`can't resolve reference ${i} from id ${s}`),this.missingRef=(0,e.resolveUrl)(n,s,i),this.missingSchema=(0,e.normalizeId)((0,e.getFullPath)(n,this.missingRef))}}return Ms.default=t,Ms}var Mt={},Tf;function ml(){if(Tf)return Mt;Tf=1,Object.defineProperty(Mt,"__esModule",{value:!0}),Mt.resolveSchema=Mt.getCompilingSchema=Mt.resolveRef=Mt.compileSchema=Mt.SchemaEnv=void 0;const e=Oe(),t=hl(),r=nn(),n=so(),s=Me(),i=ao();class a{constructor(y){var f;this.refs={},this.dynamicAnchors={};let C;typeof y.schema=="object"&&(C=y.schema),this.schema=y.schema,this.schemaId=y.schemaId,this.root=y.root||this,this.baseId=(f=y.baseId)!==null&&f!==void 0?f:(0,n.normalizeId)(C?.[y.schemaId||"$id"]),this.schemaPath=y.schemaPath,this.localRefs=y.localRefs,this.meta=y.meta,this.$async=C?.$async,this.refs={}}}Mt.SchemaEnv=a;function o(g){const y=u.call(this,g);if(y)return y;const f=(0,n.getFullPath)(this.opts.uriResolver,g.root.baseId),{es5:C,lines:P}=this.opts.code,{ownProperties:h}=this.opts,b=new e.CodeGen(this.scope,{es5:C,lines:P,ownProperties:h});let O;g.$async&&(O=b.scopeValue("Error",{ref:t.default,code:(0,e._)`require("ajv/dist/runtime/validation_error").default`}));const k=b.scopeName("validate");g.validateName=k;const $={gen:b,allErrors:this.opts.allErrors,data:r.default.data,parentData:r.default.parentData,parentDataProperty:r.default.parentDataProperty,dataNames:[r.default.data],dataPathArr:[e.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:b.scopeValue("schema",this.opts.code.source===!0?{ref:g.schema,code:(0,e.stringify)(g.schema)}:{ref:g.schema}),validateName:k,ValidationError:O,schema:g.schema,schemaEnv:g,rootId:f,baseId:g.baseId||f,schemaPath:e.nil,errSchemaPath:g.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,e._)`""`,opts:this.opts,self:this};let M;try{this._compilations.add(g),(0,i.validateFunctionCode)($),b.optimize(this.opts.code.optimize);const q=b.toString();M=`${b.scopeRefs(r.default.scope)}return ${q}`,this.opts.code.process&&(M=this.opts.code.process(M,g));const U=new Function(`${r.default.self}`,`${r.default.scope}`,M)(this,this.scope.get());if(this.scope.value(k,{ref:U}),U.errors=null,U.schema=g.schema,U.schemaEnv=g,g.$async&&(U.$async=!0),this.opts.code.source===!0&&(U.source={validateName:k,validateCode:q,scopeValues:b._values}),this.opts.unevaluated){const{props:B,items:W}=$;U.evaluated={props:B instanceof e.Name?void 0:B,items:W instanceof e.Name?void 0:W,dynamicProps:B instanceof e.Name,dynamicItems:W instanceof e.Name},U.source&&(U.source.evaluated=(0,e.stringify)(U.evaluated))}return g.validate=U,g}catch(q){throw delete g.validate,delete g.validateName,M&&this.logger.error("Error compiling schema, function code:",M),q}finally{this._compilations.delete(g)}}Mt.compileSchema=o;function c(g,y,f){var C;f=(0,n.resolveUrl)(this.opts.uriResolver,y,f);const P=g.refs[f];if(P)return P;let h=_.call(this,g,f);if(h===void 0){const b=(C=g.localRefs)===null||C===void 0?void 0:C[f],{schemaId:O}=this.opts;b&&(h=new a({schema:b,schemaId:O,root:g,baseId:y}))}if(h!==void 0)return g.refs[f]=l.call(this,h)}Mt.resolveRef=c;function l(g){return(0,n.inlineRef)(g.schema,this.opts.inlineRefs)?g.schema:g.validate?g:o.call(this,g)}function u(g){for(const y of this._compilations)if(m(y,g))return y}Mt.getCompilingSchema=u;function m(g,y){return g.schema===y.schema&&g.root===y.root&&g.baseId===y.baseId}function _(g,y){let f;for(;typeof(f=this.refs[y])=="string";)y=f;return f||this.schemas[y]||v.call(this,g,y)}function v(g,y){const f=this.opts.uriResolver.parse(y),C=(0,n._getFullPath)(this.opts.uriResolver,f);let P=(0,n.getFullPath)(this.opts.uriResolver,g.baseId,void 0);if(Object.keys(g.schema).length>0&&C===P)return E.call(this,f,g);const h=(0,n.normalizeId)(C),b=this.refs[h]||this.schemas[h];if(typeof b=="string"){const O=v.call(this,g,b);return typeof O?.schema!="object"?void 0:E.call(this,f,O)}if(typeof b?.schema=="object"){if(b.validate||o.call(this,b),h===(0,n.normalizeId)(y)){const{schema:O}=b,{schemaId:k}=this.opts,$=O[k];return $&&(P=(0,n.resolveUrl)(this.opts.uriResolver,P,$)),new a({schema:O,schemaId:k,root:g,baseId:P})}return E.call(this,f,b)}}Mt.resolveSchema=v;const S=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function E(g,{baseId:y,schema:f,root:C}){var P;if(((P=g.fragment)===null||P===void 0?void 0:P[0])!=="/")return;for(const O of g.fragment.slice(1).split("/")){if(typeof f=="boolean")return;const k=f[(0,s.unescapeFragment)(O)];if(k===void 0)return;f=k;const $=typeof f=="object"&&f[this.opts.schemaId];!S.has(O)&&$&&(y=(0,n.resolveUrl)(this.opts.uriResolver,y,$))}let h;if(typeof f!="boolean"&&f.$ref&&!(0,s.schemaHasRulesButRef)(f,this.RULES)){const O=(0,n.resolveUrl)(this.opts.uriResolver,y,f.$ref);h=v.call(this,C,O)}const{schemaId:b}=this.opts;if(h=h||new a({schema:f,schemaId:b,root:C,baseId:y}),h.schema!==h.root.schema)return h}return Mt}const jw="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",kw="Meta-schema for $data reference (JSON AnySchema extension proposal)",Nw="object",Iw=["$data"],Rw={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},$w=!1,Fw={$id:jw,description:kw,type:Nw,required:Iw,properties:Rw,additionalProperties:$w};var qs={},wi={exports:{}},cc,Mf;function rp(){if(Mf)return cc;Mf=1;const e=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),t=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),r=RegExp.prototype.test.bind(/^\d*$/u),n=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),s=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),i=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/]$/u),a=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/?]$/u),o=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:]$/u),c=new Array(256);{const A="0123456789ABCDEF";for(let w=0;w<256;w++)c[w]="%"+A[w>>4]+A[w&15]}function l(A){return A<2048?c[192|A>>6]+c[128|A&63]:A<65536?c[224|A>>12]+c[128|A>>6&63]+c[128|A&63]:c[240|A>>18]+c[128|A>>12&63]+c[128|A>>6&63]+c[128|A&63]}function u(A){let w="",j=0,p=0;for(p=0;p<A.length;p++)if(j=A[p].charCodeAt(0),j!==48){if(!(j>=48&&j<=57||j>=65&&j<=70||j>=97&&j<=102))return"";w+=A[p];break}for(p+=1;p<A.length;p++){if(j=A[p].charCodeAt(0),!(j>=48&&j<=57||j>=65&&j<=70||j>=97&&j<=102))return"";w+=A[p]}return w}const m=RegExp.prototype.test.bind(/^[\dA-Fa-f]{1,4}$/),_=RegExp.prototype.test.bind(/^[vV][\dA-Fa-f]+\.[A-Za-z\d\-._~!$&'()*+,;=:]+$/),v=RegExp.prototype.test.bind(/^[A-Za-z\d\-._~]$/),S=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function E(A){if(A.length===0)return!1;for(let w=0;w<A.length;w++)if(!v(A[w])){if(A[w]==="%"&&w+2<A.length&&n(A.slice(w+1,w+3))){w+=2;continue}return!1}return!0}function g(A){let w=-1,j=0,p=-1,d=0;for(let T=0;T<A.length;T++)A[T]==="0"?(p===-1&&(p=T),d++,d>j&&(j=d,w=p)):(p=-1,d=0);if(j<2)return A.join(":");const x=A.slice(0,w).join(":"),I=A.slice(w+j).join(":");return x+"::"+I}function y(A){const w=A.indexOf("::");if(w!==-1&&A.indexOf("::",w+1)!==-1)return;const j=w===-1?A.split(":"):A.slice(0,w).split(":"),p=w===-1?[]:A.slice(w+2).split(":");w!==-1&&(j.length===1&&j[0]===""&&(j.length=0),p.length===1&&p[0]===""&&(p.length=0));const d=j.concat(p);let x=0;for(let T=0;T<d.length;T++){const F=d[T];if(F==="")return;if(F.indexOf(".")!==-1){if(T!==d.length-1||w!==-1&&p.length===0||!t(F))return;x+=2;continue}if(!m(F))return;d[T]=parseInt(F,16).toString(16),x++}if(w===-1)return x!==8?void 0:g(d);if(x>=8)return;const I=d.slice(0,j.length);for(let T=x;T<8;T++)I.push("0");for(let T=j.length;T<d.length;T++)I.push(d[T]);return g(I)}function f(A){const w=A[0]==="["&&A[A.length-1]==="]";if((A[0]==="["||A[A.length-1]==="]")&&!w)return{host:A,isIPV6:!1,error:!0};let p=w?A.slice(1,-1):A;if(w&&_(p))return p=p.toLowerCase(),{host:`[${p}]`,escapedHost:p,isIPV6:!1,isIPVFuture:!0};if(C(p,":")<2)return{host:A,isIPV6:!1,error:w};let d="";const x=p.indexOf("%");if(x!==-1){const T=p.slice(x,x+3).toLowerCase()==="%25"?3:1;if(d=p.slice(x+T),!E(d))return{host:A,isIPV6:!1,error:!0};p=p.slice(0,x)}const I=y(p);return I===void 0?{host:A,isIPV6:!1,error:!0}:{host:I+(d?"%"+d:""),escapedHost:I+(d?"%25"+d:""),isIPV6:!0}}function C(A,w){let j=0;for(let p=0;p<A.length;p++)A[p]===w&&j++;return j}function P(A){let w=A;const j=[];let p=-1,d=0;for(;d=w.length;){if(d===1){if(w===".")break;if(w==="/"){j.push("/");break}else{j.push(w);break}}else if(d===2){if(w[0]==="."){if(w[1]===".")break;if(w[1]==="/"){w=w.slice(2);continue}}else if(w[0]==="/"&&(w[1]==="."||w[1]==="/")){j.push("/");break}}else if(d===3&&w==="/.."){j.length!==0&&j.pop(),j.push("/");break}if(w[0]==="."){if(w[1]==="."){if(w[2]==="/"){w=w.slice(3);continue}}else if(w[1]==="/"){w=w.slice(2);continue}}else if(w[0]==="/"&&w[1]==="."){if(w[2]==="/"){w=w.slice(2);continue}else if(w[2]==="."&&w[3]==="/"){w=w.slice(3),j.length!==0&&j.pop();continue}}if((p=w.indexOf("/",1))===-1){j.push(w);break}else j.push(w.slice(0,p)),w=w.slice(p)}return j.join("")}const h={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},b=/[@/?#:]/g,O=/[@/?#]/g;function k(A,w){const j=w?O:b;return j.lastIndex=0,A.replace(j,p=>h[p])}function $(A,w=!1){if(A.indexOf("%")===-1)return A;let j="";for(let p=0;p<A.length;p++){if(A[p]==="%"&&p+2<A.length){const d=A.slice(p+1,p+3);if(n(d)){const x=d.toUpperCase(),I=String.fromCharCode(parseInt(x,16));w&&s(I)?j+=I:j+="%"+x,p+=2;continue}}j+=A[p]}return j}function M(A){let w="";for(let j=0;j<A.length;j++){const p=A[j];if(p==="%"&&j+2<A.length){const d=A.slice(j+1,j+3);if(n(d)){const x=d.toUpperCase(),I=String.fromCharCode(parseInt(x,16));I!=="."&&s(I)?w+=I:w+="%"+x,j+=2;continue}}if(i(p))w+=p;else{const d=A.charCodeAt(j);if(d<128)w+=Y(d)?p:c[d];else if(d<55296||d>57343)w+=l(d);else if(d<=56319&&j+1<A.length){const x=A.charCodeAt(j+1);x>=56320&&x<=57343?(w+=l(65536+(d-55296<<10)+(x-56320)),j++):w+=l(65533)}else w+=l(65533)}}return w}function q(A,w=!1){let j="",p=w&&A[0]!=="/";for(let d=0;d<A.length;d++){const x=A[d];if(x==="%"&&d+2<A.length){const I=A.slice(d+1,d+3);if(n(I)){j+="%"+I.toUpperCase(),d+=2;continue}}if(x==="/"&&(p=!1),i(x)&&(x!==":"||!p))j+=x;else{const I=A.charCodeAt(d);if(I<128)j+=c[I];else if(I<55296||I>57343)j+=l(I);else if(I<=56319&&d+1<A.length){const T=A.charCodeAt(d+1);T>=56320&&T<=57343?(j+=l(65536+(I-55296<<10)+(T-56320)),d++):j+=l(65533)}else j+=l(65533)}}return j}function L(A,w){let j="";for(let p=0;p<A.length;p++){const d=A[p];if(d==="%"&&p+2<A.length){const x=A.slice(p+1,p+3);if(n(x)){j+="%"+x.toUpperCase(),p+=2;continue}}if(w(d))j+=d;else{const x=A.charCodeAt(p);if(x<128)j+=c[x];else if(x<55296||x>57343)j+=l(x);else if(x<=56319&&p+1<A.length){const I=A.charCodeAt(p+1);I>=56320&&I<=57343?(j+=l(65536+(x-55296<<10)+(I-56320)),p++):j+=l(65533)}else j+=l(65533)}}return j}function U(A){return L(A,o)}function B(A){return L(A,a)}function W(A){return L(A,a)}function Y(A){return A>=48&&A<=57||A>=65&&A<=90||A>=97&&A<=122||A===42||A===43||A===45||A===46||A===47||A===64||A===95}function Q(A){let w="";for(let j=0;j<A.length;j++){const p=A[j];if(p==="%"&&j+2<A.length){const d=A.slice(j+1,j+3);if(n(d)){const x=d.toUpperCase(),I=String.fromCharCode(parseInt(x,16));s(I)?w+=I:w+="%"+x,j+=2;continue}}if(a(p))w+=p;else{const d=A.charCodeAt(j);if(d<128)w+=Y(d)?p:c[d];else if(d<55296||d>57343)w+=l(d);else if(d<=56319&&j+1<A.length){const x=A.charCodeAt(j+1);x>=56320&&x<=57343?(w+=l(65536+(d-55296<<10)+(x-56320)),j++):w+=l(65533)}else w+=l(65533)}}return w}function Z(A){let w="";for(let j=0;j<A.length;j++){if(A[j]==="%"&&j+2<A.length){const p=A.slice(j+1,j+3);if(n(p)){w+="%"+p.toUpperCase(),j+=2;continue}}w+=escape(A[j])}return w}function re(A){const w=[];if(A.userinfo!==void 0&&(w.push(U(A.userinfo)),w.push("@")),A.host!==void 0){let j=A.host;if(!t(j)){let p=f(j);p.isIPV6!==!0&&p.isIPVFuture!==!0&&(j=$(j,!0),p=f(j)),p.isIPV6===!0||p.isIPVFuture===!0?j=`[${p.escapedHost}]`:j=k(j,!1)}w.push(j)}if(typeof A.port=="number"||typeof A.port=="string"){const j=String(A.port);if(!r(j))throw new TypeError("URI port is malformed.");w.push(":"),w.push(j)}return w.length?w.join(""):void 0}return cc={nonSimpleDomain:S,recomposeAuthority:re,reescapeHostDelimiters:k,normalizePercentEncoding:$,normalizePathEncoding:M,serializePathEncoding:q,normalizeQueryFragmentEncoding:Q,encodeUserinfo:U,encodeQuery:B,encodeFragment:W,escapePreservingEscapes:Z,removeDotSegments:P,isIPv4:t,isUUID:e,normalizeIPv6:f,stringArrayToHexStripped:u},cc}var lc,qf;function Dw(){if(qf)return lc;qf=1;const{isUUID:e}=rp(),t=/^([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-./:;=@]|%[\da-f]{2})+)$/iu,r=["http","https","ws","wss","urn","urn:uuid"];function n(h){return r.indexOf(h)!==-1}function s(h){return h.secure===!0?!0:h.secure===!1?!1:h.scheme?h.scheme.length===3&&(h.scheme[0]==="w"||h.scheme[0]==="W")&&(h.scheme[1]==="s"||h.scheme[1]==="S")&&(h.scheme[2]==="s"||h.scheme[2]==="S"):!1}function i(h){return h.host||(h.error=h.error||"HTTP URIs must have a host."),h}function a(h){const b=String(h.scheme).toLowerCase()==="https";return(h.port===(b?443:80)||h.port==="")&&(h.port=void 0),h.path||(h.path="/"),h}function o(h){return h.secure=s(h),h.resourceName=(h.path||"/")+(h.query?"?"+h.query:""),h.path=void 0,h.query=void 0,h}function c(h){if((h.port===(s(h)?443:80)||h.port==="")&&(h.port=void 0),typeof h.secure=="boolean"&&(h.scheme=h.secure?"wss":"ws",h.secure=void 0),h.resourceName){const b=h.resourceName.indexOf("?"),O=b===-1?h.resourceName:h.resourceName.slice(0,b);h.path=O&&O!=="/"?O:void 0,h.query=b===-1?void 0:h.resourceName.slice(b+1),h.resourceName=void 0}return h.fragment=void 0,h}function l(h,b){if(!h.path)return h.error="URN can not be parsed",h;const O=h.path.match(t);if(O&&O[0]===h.path){const k=b.scheme||h.scheme||"urn";h.nid=O[1].toLowerCase(),h.nss=O[2];const $=`${k}:${b.nid||h.nid}`,M=P($);h.path=void 0,M&&(h=M.parse(h,b))}else h.error=h.error||"URN can not be parsed.";return h}function u(h,b){if(h.nid===void 0)throw new Error("URN without nid cannot be serialized");const O=b.scheme||h.scheme||"urn",k=h.nid.toLowerCase(),$=`${O}:${b.nid||k}`,M=P($);M&&(h=M.serialize(h,b));const q=h,L=h.nss;return q.path=`${k||b.nid}:${L}`,b.skipEscape=!0,q}function m(h,b){const O=h;return O.uuid=O.nss,O.nss=void 0,!b.tolerant&&(!O.uuid||!e(O.uuid))&&(O.error=O.error||"UUID is not valid."),O}function _(h){const b=h;return b.nss=(h.uuid||"").toLowerCase(),b}const v={scheme:"http",domainHost:!0,parse:i,serialize:a},S={scheme:"https",domainHost:v.domainHost,parse:i,serialize:a},E={scheme:"ws",domainHost:!0,parse:o,serialize:c},g={scheme:"wss",domainHost:E.domainHost,parse:E.parse,serialize:E.serialize},C={http:v,https:S,ws:E,wss:g,urn:{scheme:"urn",parse:l,serialize:u,skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:m,serialize:_,skipNormalize:!0}};Object.setPrototypeOf(C,null);function P(h){return h&&(C[h]||C[h.toLowerCase()])||void 0}return lc={wsIsSecure:s,SCHEMES:C,isValidSchemeName:n,getSchemeHandler:P},lc}var Uf;function Tw(){if(Uf)return wi.exports;Uf=1;const{normalizeIPv6:e,removeDotSegments:t,recomposeAuthority:r,normalizePercentEncoding:n,normalizePathEncoding:s,serializePathEncoding:i,normalizeQueryFragmentEncoding:a,encodeQuery:o,encodeFragment:c,reescapeHostDelimiters:l,isIPv4:u,nonSimpleDomain:m}=rp(),{SCHEMES:_,getSchemeHandler:v}=Dw(),S=/^[A-Za-z][A-Za-z0-9+.-]*$/u,E="URI scheme is malformed.";function g(A){const w=unescape(String(A));if(!S.test(w))throw new TypeError(E);return w}function y(A,w){return typeof A=="string"?A=Y(A,w):typeof A=="object"&&(A=W(h(A,w),w)),A}function f(A,w,j){const p=j?Object.assign({scheme:"null"},j):{scheme:"null"},{parsed:d,malformedAuthorityOrPort:x,malformedPercentEncoding:I,malformedSchemeSpecific:T,malformedHost:F,malformedScheme:z}=B(A,p),{parsed:H,malformedAuthorityOrPort:R,malformedPercentEncoding:D,malformedSchemeSpecific:V,malformedHost:K,malformedScheme:G}=B(w,p);if(x||R||I||D||T||V||F||K||z||G)throw new Error(d.error||H.error||"URI is malformed.");const J=C(d,H,p,!0),te=v(j&&j.scheme||J.scheme),ne=J.host,se=ne!==void 0&&ne!==""&&(u(ne)||e(ne).isIPV6);U(J,j||{},te,se);const ce=ne&&ne.indexOf("%")!==-1&&!new RegExp("\\P{ASCII}","u").test(ne);if(J.error&&!ce)throw new Error(J.error);return p.skipEscape=!0,h(J,p)}function C(A,w,j,p){const d={};return p||(A=W(h(A,j),j),w=W(h(w,j),j)),j=j||{},!j.tolerant&&w.scheme?(d.scheme=w.scheme,d.userinfo=w.userinfo,d.host=w.host,d.port=w.port,d.path=t(w.path||""),d.query=w.query):(w.userinfo!==void 0||w.host!==void 0||w.port!==void 0?(d.userinfo=w.userinfo,d.host=w.host,d.port=w.port,d.path=t(w.path||""),d.query=w.query):(w.path?(w.path[0]==="/"?d.path=t(w.path):((A.userinfo!==void 0||A.host!==void 0||A.port!==void 0)&&!A.path?d.path="/"+w.path:A.path?d.path=A.path.slice(0,A.path.lastIndexOf("/")+1)+w.path:d.path=w.path,d.path=t(d.path)),d.query=w.query):(d.path=A.path,w.query!==void 0?d.query=w.query:d.query=A.query),d.userinfo=A.userinfo,d.host=A.host,d.port=A.port),d.scheme=A.scheme),d.fragment=w.fragment,d}function P(A,w,j){const p=Z(A,j),d=Z(w,j);return p!==void 0&&d!==void 0&&p===d}function h(A,w){const j={host:A.host,scheme:A.scheme,userinfo:A.userinfo,port:A.port,path:A.path,query:A.query,nid:A.nid,nss:A.nss,uuid:A.uuid,fragment:A.fragment,reference:A.reference,resourceName:A.resourceName,secure:A.secure,error:""},p=Object.assign({},w),d=[];j.scheme&&(j.scheme=g(j.scheme));const x=v(p.scheme||j.scheme);x&&x.serialize&&x.serialize(j,p);const I=j.userinfo!==void 0||j.host!==void 0||j.port!==void 0,T=!p.skipEscape&&j.scheme===void 0&&!I;j.path!==void 0&&(p.skipEscape?j.path=n(j.path):j.path=i(j.path,T)),p.reference!=="suffix"&&j.scheme&&(j.scheme=g(j.scheme),d.push(j.scheme,":"));const F=r(j);if(F!==void 0&&(p.reference!=="suffix"&&d.push("//"),d.push(F),j.path&&j.path[0]!=="/"&&d.push("/")),j.path!==void 0){let z=j.path;!p.absolutePath&&(!x||!x.absolutePath)&&(z=t(z)),T&&(z=i(z,!0)),F===void 0&&z[0]==="/"&&z[1]==="/"&&(z="/%2F"+z.slice(2)),d.push(z)}return j.query!==void 0&&d.push("?",o(j.query)),j.fragment!==void 0&&d.push("#",c(j.fragment)),d.join("")}const b=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u,O=/^(?:[^#/:?]+:)?\/\/([^/?#]*)/,k=/^(?:[^#/:?]+:)?([/\\\t\n\r]*)/;function $(A,w){if(w[2]!==void 0&&A.path&&A.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof A.port=="number"&&(A.port<0||A.port>65535))return"URI port is malformed."}function M(A){if(A===void 0)return!1;let w=A.indexOf("%");for(;w!==-1;){if(w+2>=A.length||!/^[\da-f]{2}$/iu.test(A.slice(w+1,w+3)))return!0;w=A.indexOf("%",w+3)}return!1}function q(A){return A[0]==="["&&A[A.length-1]==="]"}function L(A){const w=A[4];return M(A[3])||w!==void 0&&!q(w)&&M(w)||M(A[6])||M(A[7])||M(A[8])}function U(A,w,j,p){if(!w.unicodeSupport&&(!j||!j.unicodeSupport)&&A.host&&!q(A.host)&&(w.domainHost||j&&j.domainHost)&&p===!1&&m(A.host))try{A.host=new URL("http://"+A.host).hostname}catch(d){return A.error=A.error||"Host's domain name can not be converted to ASCII: "+d,!0}return!1}function B(A,w){const j=Object.assign({},w),p={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0};let d=!1,x=!1,I=!1,T=!1,F=!1,z=!1,H=!1;j.reference==="suffix"&&(j.scheme?A=j.scheme+":"+A:A="//"+A);const R=A.match(O);R!==null&&R[1].indexOf("\\")!==-1&&(p.error="URI authority must not contain a literal backslash.",d=!0);const D=A.match(k);if(D!==null){const K=D[1],G=K.replace(/[\t\n\r]/g,"");G.length>=2&&(G.slice(0,2)!=="//"?(p.error=p.error||"URI authority must not contain a literal backslash.",d=!0):K.length!==G.length&&(p.error=p.error||"URI authority introducer must not contain whitespace.",d=!0))}const V=A.match(b);if(V){if(p.scheme=V[1],p.userinfo=V[3],p.host=V[4],p.port=parseInt(V[5],10),p.path=V[6]||"",p.query=V[7],p.fragment=V[8],p.scheme!==void 0){const J=unescape(p.scheme);S.test(J)?p.scheme=J.toLowerCase():(p.error=p.error||E,z=!0)}x=L(V),x&&(p.error=p.error||"URI contains malformed percent-encoding."),isNaN(p.port)&&(p.port=V[5]);const K=$(p,V);if(K!==void 0&&(p.error=p.error||K,d=!0),p.host)if(u(p.host)===!1){const te=q(p.host),ne=p.host.indexOf("[")!==-1||p.host.indexOf("]")!==-1,se=e(p.host);H=se.isIPV6||se.isIPVFuture===!0,F=ne&&(!te||se.error===!0),p.host=H?se.host:se.host.toLowerCase(),F&&(p.error=p.error||"URI host is malformed.",d=!0)}else H=!0;p.scheme===void 0&&p.userinfo===void 0&&p.host===void 0&&p.port===void 0&&p.query===void 0&&!p.path?p.reference="same-document":p.scheme===void 0?p.reference="relative":p.fragment===void 0?p.reference="absolute":p.reference="uri",j.reference&&j.reference!=="suffix"&&j.reference!==p.reference&&(p.error=p.error||"URI is not a "+j.reference+" reference.");const G=v(j.scheme||p.scheme);if(F||(T=U(p,j,G,H)),!G||G&&!G.skipNormalize){if(A.indexOf("%")!==-1&&p.host!==void 0&&!F){const J=H?p.host:n(p.host,!0);p.host=l(J,H)}p.path&&(p.path=s(p.path)),p.query&&(p.query=a(p.query)),p.fragment&&(p.fragment=a(p.fragment))}G&&G.parse&&(G.parse(p,j),G===_.urn&&p.nid===void 0&&(I=!0))}else p.error=p.error||"URI can not be parsed.";return{parsed:p,malformedAuthorityOrPort:d,malformedPercentEncoding:x,malformedSchemeSpecific:I,malformedHost:T,malformedScheme:z}}function W(A,w){return B(A,w).parsed}function Y(A,w){return Q(A,w).normalized}function Q(A,w){const{parsed:j,malformedAuthorityOrPort:p,malformedPercentEncoding:d,malformedSchemeSpecific:x,malformedHost:I,malformedScheme:T}=B(A,w);return{normalized:p||d||x||I||T?A:h(j,w),malformedAuthorityOrPort:p,malformedPercentEncoding:d,malformedSchemeSpecific:x,malformedHost:I,malformedScheme:T}}function Z(A,w){if(typeof A!="string"&&typeof A!="object")return;let j;try{j=typeof A=="string"?A:h(A,w)}catch{return}const{normalized:p,malformedAuthorityOrPort:d,malformedPercentEncoding:x,malformedSchemeSpecific:I,malformedHost:T,malformedScheme:F}=Q(j,w);return d||x||I||T||F?void 0:p}const re={SCHEMES:_,normalize:y,resolve:f,resolveComponent:C,equal:P,serialize:h,parse:W};return wi.exports=re,wi.exports.default=re,wi.exports.fastUri=re,wi.exports}var Lf;function Mw(){if(Lf)return qs;Lf=1,Object.defineProperty(qs,"__esModule",{value:!0});const e=Tw();return e.code='require("ajv/dist/runtime/uri").default',qs.default=e,qs}var Vf;function qw(){return Vf||(Vf=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var t=ao();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var r=Oe();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return r.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return r.CodeGen}});const n=hl(),s=oo(),i=ep(),a=ml(),o=Oe(),c=so(),l=Ba(),u=Me(),m=Fw,_=Mw(),v=(A,w)=>new RegExp(A,w);v.code="new RegExp";const S=["removeAdditional","useDefaults","coerceTypes"],E=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),g={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},y={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},f=200;function C(A){var w,j,p,d,x,I,T,F,z,H,R,D,V,K,G,J,te,ne,se,ce,he,le,ge,Fe,fe;const Ye=A.strict,ye=(w=A.code)===null||w===void 0?void 0:w.optimize,oe=ye===!0||ye===void 0?1:ye||0,ft=(p=(j=A.code)===null||j===void 0?void 0:j.regExp)!==null&&p!==void 0?p:v,ke=(d=A.uriResolver)!==null&&d!==void 0?d:_.default;return{strictSchema:(I=(x=A.strictSchema)!==null&&x!==void 0?x:Ye)!==null&&I!==void 0?I:!0,strictNumbers:(F=(T=A.strictNumbers)!==null&&T!==void 0?T:Ye)!==null&&F!==void 0?F:!0,strictTypes:(H=(z=A.strictTypes)!==null&&z!==void 0?z:Ye)!==null&&H!==void 0?H:"log",strictTuples:(D=(R=A.strictTuples)!==null&&R!==void 0?R:Ye)!==null&&D!==void 0?D:"log",strictRequired:(K=(V=A.strictRequired)!==null&&V!==void 0?V:Ye)!==null&&K!==void 0?K:!1,code:A.code?{...A.code,optimize:oe,regExp:ft}:{optimize:oe,regExp:ft},loopRequired:(G=A.loopRequired)!==null&&G!==void 0?G:f,loopEnum:(J=A.loopEnum)!==null&&J!==void 0?J:f,meta:(te=A.meta)!==null&&te!==void 0?te:!0,messages:(ne=A.messages)!==null&&ne!==void 0?ne:!0,inlineRefs:(se=A.inlineRefs)!==null&&se!==void 0?se:!0,schemaId:(ce=A.schemaId)!==null&&ce!==void 0?ce:"$id",addUsedSchema:(he=A.addUsedSchema)!==null&&he!==void 0?he:!0,validateSchema:(le=A.validateSchema)!==null&&le!==void 0?le:!0,validateFormats:(ge=A.validateFormats)!==null&&ge!==void 0?ge:!0,unicodeRegExp:(Fe=A.unicodeRegExp)!==null&&Fe!==void 0?Fe:!0,int32range:(fe=A.int32range)!==null&&fe!==void 0?fe:!0,uriResolver:ke}}class P{constructor(w={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,w=this.opts={...w,...C(w)};const{es5:j,lines:p}=this.opts.code;this.scope=new o.ValueScope({scope:{},prefixes:E,es5:j,lines:p}),this.logger=L(w.logger);const d=w.validateFormats;w.validateFormats=!1,this.RULES=(0,i.getRules)(),h.call(this,g,w,"NOT SUPPORTED"),h.call(this,y,w,"DEPRECATED","warn"),this._metaOpts=M.call(this),w.formats&&k.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),w.keywords&&$.call(this,w.keywords),typeof w.meta=="object"&&this.addMetaSchema(w.meta),O.call(this),w.validateFormats=d}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:w,meta:j,schemaId:p}=this.opts;let d=m;p==="id"&&(d={...m},d.id=d.$id,delete d.$id),j&&w&&this.addMetaSchema(d,d[p],!1)}defaultMeta(){const{meta:w,schemaId:j}=this.opts;return this.opts.defaultMeta=typeof w=="object"?w[j]||w:void 0}validate(w,j){let p;if(typeof w=="string"){if(p=this.getSchema(w),!p)throw new Error(`no schema with key or ref "${w}"`)}else p=this.compile(w);const d=p(j);return"$async"in p||(this.errors=p.errors),d}compile(w,j){const p=this._addSchema(w,j);return p.validate||this._compileSchemaEnv(p)}compileAsync(w,j){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:p}=this.opts;return d.call(this,w,j);async function d(H,R){await x.call(this,H.$schema);const D=this._addSchema(H,R);return D.validate||I.call(this,D)}async function x(H){H&&!this.getSchema(H)&&await d.call(this,{$ref:H},!0)}async function I(H){try{return this._compileSchemaEnv(H)}catch(R){if(!(R instanceof s.default))throw R;return T.call(this,R),await F.call(this,R.missingSchema),I.call(this,H)}}function T({missingSchema:H,missingRef:R}){if(this.refs[H])throw new Error(`AnySchema ${H} is loaded but ${R} cannot be resolved`)}async function F(H){const R=await z.call(this,H);this.refs[H]||await x.call(this,R.$schema),this.refs[H]||this.addSchema(R,H,j)}async function z(H){const R=this._loading[H];if(R)return R;try{return await(this._loading[H]=p(H))}finally{delete this._loading[H]}}}addSchema(w,j,p,d=this.opts.validateSchema){if(Array.isArray(w)){for(const I of w)this.addSchema(I,void 0,p,d);return this}let x;if(typeof w=="object"){const{schemaId:I}=this.opts;if(x=w[I],x!==void 0&&typeof x!="string")throw new Error(`schema ${I} must be string`)}return j=(0,c.normalizeId)(j||x),this._checkUnique(j),this.schemas[j]=this._addSchema(w,p,j,d,!0),this}addMetaSchema(w,j,p=this.opts.validateSchema){return this.addSchema(w,j,!0,p),this}validateSchema(w,j){if(typeof w=="boolean")return!0;let p;if(p=w.$schema,p!==void 0&&typeof p!="string")throw new Error("$schema must be a string");if(p=p||this.opts.defaultMeta||this.defaultMeta(),!p)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const d=this.validate(p,w);if(!d&&j){const x="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(x);else throw new Error(x)}return d}getSchema(w){let j;for(;typeof(j=b.call(this,w))=="string";)w=j;if(j===void 0){const{schemaId:p}=this.opts,d=new a.SchemaEnv({schema:{},schemaId:p});if(j=a.resolveSchema.call(this,d,w),!j)return;this.refs[w]=j}return j.validate||this._compileSchemaEnv(j)}removeSchema(w){if(w instanceof RegExp)return this._removeAllSchemas(this.schemas,w),this._removeAllSchemas(this.refs,w),this;switch(typeof w){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const j=b.call(this,w);return typeof j=="object"&&this._cache.delete(j.schema),delete this.schemas[w],delete this.refs[w],this}case"object":{const j=w;this._cache.delete(j);let p=w[this.opts.schemaId];return p&&(p=(0,c.normalizeId)(p),delete this.schemas[p],delete this.refs[p]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(w){for(const j of w)this.addKeyword(j);return this}addKeyword(w,j){let p;if(typeof w=="string")p=w,typeof j=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),j.keyword=p);else if(typeof w=="object"&&j===void 0){if(j=w,p=j.keyword,Array.isArray(p)&&!p.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(B.call(this,p,j),!j)return(0,u.eachItem)(p,x=>W.call(this,x)),this;Q.call(this,j);const d={...j,type:(0,l.getJSONTypes)(j.type),schemaType:(0,l.getJSONTypes)(j.schemaType)};return(0,u.eachItem)(p,d.type.length===0?x=>W.call(this,x,d):x=>d.type.forEach(I=>W.call(this,x,d,I))),this}getKeyword(w){const j=this.RULES.all[w];return typeof j=="object"?j.definition:!!j}removeKeyword(w){const{RULES:j}=this;delete j.keywords[w],delete j.all[w];for(const p of j.rules){const d=p.rules.findIndex(x=>x.keyword===w);d>=0&&p.rules.splice(d,1)}return this}addFormat(w,j){return typeof j=="string"&&(j=new RegExp(j)),this.formats[w]=j,this}errorsText(w=this.errors,{separator:j=", ",dataVar:p="data"}={}){return!w||w.length===0?"No errors":w.map(d=>`${p}${d.instancePath} ${d.message}`).reduce((d,x)=>d+j+x)}$dataMetaSchema(w,j){const p=this.RULES.all;w=JSON.parse(JSON.stringify(w));for(const d of j){const x=d.split("/").slice(1);let I=w;for(const T of x)I=I[T];for(const T in p){const F=p[T];if(typeof F!="object")continue;const{$data:z}=F.definition,H=I[T];z&&H&&(I[T]=re(H))}}return w}_removeAllSchemas(w,j){for(const p in w){const d=w[p];(!j||j.test(p))&&(typeof d=="string"?delete w[p]:d&&!d.meta&&(this._cache.delete(d.schema),delete w[p]))}}_addSchema(w,j,p,d=this.opts.validateSchema,x=this.opts.addUsedSchema){let I;const{schemaId:T}=this.opts;if(typeof w=="object")I=w[T];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof w!="boolean")throw new Error("schema must be object or boolean")}let F=this._cache.get(w);if(F!==void 0)return F;p=(0,c.normalizeId)(I||p);const z=c.getSchemaRefs.call(this,w,p);return F=new a.SchemaEnv({schema:w,schemaId:T,meta:j,baseId:p,localRefs:z}),this._cache.set(F.schema,F),x&&!p.startsWith("#")&&(p&&this._checkUnique(p),this.refs[p]=F),d&&this.validateSchema(w,!0),F}_checkUnique(w){if(this.schemas[w]||this.refs[w])throw new Error(`schema with key or id "${w}" already exists`)}_compileSchemaEnv(w){if(w.meta?this._compileMetaSchema(w):a.compileSchema.call(this,w),!w.validate)throw new Error("ajv implementation error");return w.validate}_compileMetaSchema(w){const j=this.opts;this.opts=this._metaOpts;try{a.compileSchema.call(this,w)}finally{this.opts=j}}}P.ValidationError=n.default,P.MissingRefError=s.default,e.default=P;function h(A,w,j,p="error"){for(const d in A){const x=d;x in w&&this.logger[p](`${j}: option ${d}. ${A[x]}`)}}function b(A){return A=(0,c.normalizeId)(A),this.schemas[A]||this.refs[A]}function O(){const A=this.opts.schemas;if(A)if(Array.isArray(A))this.addSchema(A);else for(const w in A)this.addSchema(A[w],w)}function k(){for(const A in this.opts.formats){const w=this.opts.formats[A];w&&this.addFormat(A,w)}}function $(A){if(Array.isArray(A)){this.addVocabulary(A);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const w in A){const j=A[w];j.keyword||(j.keyword=w),this.addKeyword(j)}}function M(){const A={...this.opts};for(const w of S)delete A[w];return A}const q={log(){},warn(){},error(){}};function L(A){if(A===!1)return q;if(A===void 0)return console;if(A.log&&A.warn&&A.error)return A;throw new Error("logger must implement log, warn and error methods")}const U=/^[a-z_$][a-z0-9_$:-]*$/i;function B(A,w){const{RULES:j}=this;if((0,u.eachItem)(A,p=>{if(j.keywords[p])throw new Error(`Keyword ${p} is already defined`);if(!U.test(p))throw new Error(`Keyword ${p} has invalid name`)}),!!w&&w.$data&&!("code"in w||"validate"in w))throw new Error('$data keyword must have "code" or "validate" function')}function W(A,w,j){var p;const d=w?.post;if(j&&d)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:x}=this;let I=d?x.post:x.rules.find(({type:F})=>F===j);if(I||(I={type:j,rules:[]},x.rules.push(I)),x.keywords[A]=!0,!w)return;const T={keyword:A,definition:{...w,type:(0,l.getJSONTypes)(w.type),schemaType:(0,l.getJSONTypes)(w.schemaType)}};w.before?Y.call(this,I,T,w.before):I.rules.push(T),x.all[A]=T,(p=w.implements)===null||p===void 0||p.forEach(F=>this.addKeyword(F))}function Y(A,w,j){const p=A.rules.findIndex(d=>d.keyword===j);p>=0?A.rules.splice(p,0,w):(A.rules.push(w),this.logger.warn(`rule ${j} is not defined`))}function Q(A){let{metaSchema:w}=A;w!==void 0&&(A.$data&&this.opts.$data&&(w=re(w)),A.validateSchema=this.compile(w,!0))}const Z={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function re(A){return{anyOf:[A,Z]}}})(rc)),rc}var Us={},Ls={},Vs={},zf;function Uw(){if(zf)return Vs;zf=1,Object.defineProperty(Vs,"__esModule",{value:!0});const e={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};return Vs.default=e,Vs}var Mr={},Bf;function Lw(){if(Bf)return Mr;Bf=1,Object.defineProperty(Mr,"__esModule",{value:!0}),Mr.callRef=Mr.getValidate=void 0;const e=oo(),t=ar(),r=Oe(),n=nn(),s=ml(),i=Me(),a={keyword:"$ref",schemaType:"string",code(l){const{gen:u,schema:m,it:_}=l,{baseId:v,schemaEnv:S,validateName:E,opts:g,self:y}=_,{root:f}=S;if((m==="#"||m==="#/")&&v===f.baseId)return P();const C=s.resolveRef.call(y,f,v,m);if(C===void 0)throw new e.default(_.opts.uriResolver,v,m);if(C instanceof s.SchemaEnv)return h(C);return b(C);function P(){if(S===f)return c(l,E,S,S.$async);const O=u.scopeValue("root",{ref:f});return c(l,(0,r._)`${O}.validate`,f,f.$async)}function h(O){const k=o(l,O);c(l,k,O,O.$async)}function b(O){const k=u.scopeValue("schema",g.code.source===!0?{ref:O,code:(0,r.stringify)(O)}:{ref:O}),$=u.name("valid"),M=l.subschema({schema:O,dataTypes:[],schemaPath:r.nil,topSchemaRef:k,errSchemaPath:m},$);l.mergeEvaluated(M),l.ok($)}}};function o(l,u){const{gen:m}=l;return u.validate?m.scopeValue("validate",{ref:u.validate}):(0,r._)`${m.scopeValue("wrapper",{ref:u})}.validate`}Mr.getValidate=o;function c(l,u,m,_){const{gen:v,it:S}=l,{allErrors:E,schemaEnv:g,opts:y}=S,f=y.passContext?n.default.this:r.nil;_?C():P();function C(){if(!g.$async)throw new Error("async schema referenced by sync schema");const O=v.let("valid");v.try(()=>{v.code((0,r._)`await ${(0,t.callValidateCode)(l,u,f)}`),b(u),E||v.assign(O,!0)},k=>{v.if((0,r._)`!(${k} instanceof ${S.ValidationError})`,()=>v.throw(k)),h(k),E||v.assign(O,!1)}),l.ok(O)}function P(){l.result((0,t.callValidateCode)(l,u,f),()=>b(u),()=>h(u))}function h(O){const k=(0,r._)`${O}.errors`;v.assign(n.default.vErrors,(0,r._)`${n.default.vErrors} === null ? ${k} : ${n.default.vErrors}.concat(${k})`),v.assign(n.default.errors,(0,r._)`${n.default.vErrors}.length`)}function b(O){var k;if(!S.opts.unevaluated)return;const $=(k=m?.validate)===null||k===void 0?void 0:k.evaluated;if(S.props!==!0)if($&&!$.dynamicProps)$.props!==void 0&&(S.props=i.mergeEvaluated.props(v,$.props,S.props));else{const M=v.var("props",(0,r._)`${O}.evaluated.props`);S.props=i.mergeEvaluated.props(v,M,S.props,r.Name)}if(S.items!==!0)if($&&!$.dynamicItems)$.items!==void 0&&(S.items=i.mergeEvaluated.items(v,$.items,S.items));else{const M=v.var("items",(0,r._)`${O}.evaluated.items`);S.items=i.mergeEvaluated.items(v,M,S.items,r.Name)}}}return Mr.callRef=c,Mr.default=a,Mr}var Hf;function Vw(){if(Hf)return Ls;Hf=1,Object.defineProperty(Ls,"__esModule",{value:!0});const e=Uw(),t=Lw(),r=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",e.default,t.default];return Ls.default=r,Ls}var zs={},Bs={},Kf;function zw(){if(Kf)return Bs;Kf=1,Object.defineProperty(Bs,"__esModule",{value:!0});const e=Oe(),t=e.operators,r={maximum:{okStr:"<=",ok:t.LTE,fail:t.GT},minimum:{okStr:">=",ok:t.GTE,fail:t.LT},exclusiveMaximum:{okStr:"<",ok:t.LT,fail:t.GTE},exclusiveMinimum:{okStr:">",ok:t.GT,fail:t.LTE}},n={message:({keyword:i,schemaCode:a})=>(0,e.str)`must be ${r[i].okStr} ${a}`,params:({keyword:i,schemaCode:a})=>(0,e._)`{comparison: ${r[i].okStr}, limit: ${a}}`},s={keyword:Object.keys(r),type:"number",schemaType:"number",$data:!0,error:n,code(i){const{keyword:a,data:o,schemaCode:c}=i;i.fail$data((0,e._)`${o} ${r[a].fail} ${c} || isNaN(${o})`)}};return Bs.default=s,Bs}var Hs={},Gf;function Bw(){if(Gf)return Hs;Gf=1,Object.defineProperty(Hs,"__esModule",{value:!0});const e=Oe(),r={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:n})=>(0,e.str)`must be multiple of ${n}`,params:({schemaCode:n})=>(0,e._)`{multipleOf: ${n}}`},code(n){const{gen:s,data:i,schemaCode:a,it:o}=n,c=o.opts.multipleOfPrecision,l=s.let("res"),u=c?(0,e._)`Math.abs(Math.round(${l}) - ${l}) > 1e-${c}`:(0,e._)`${l} !== parseInt(${l})`;n.fail$data((0,e._)`(${a} === 0 || (${l} = ${i}/${a}, ${u}))`)}};return Hs.default=r,Hs}var Ks={},Gs={},Wf;function Hw(){if(Wf)return Gs;Wf=1,Object.defineProperty(Gs,"__esModule",{value:!0});function e(t){const r=t.length;let n=0,s=0,i;for(;s<r;)n++,i=t.charCodeAt(s++),i>=55296&&i<=56319&&s<r&&(i=t.charCodeAt(s),(i&64512)===56320&&s++);return n}return Gs.default=e,e.code='require("ajv/dist/runtime/ucs2length").default',Gs}var Jf;function Kw(){if(Jf)return Ks;Jf=1,Object.defineProperty(Ks,"__esModule",{value:!0});const e=Oe(),t=Me(),r=Hw(),s={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:i,schemaCode:a}){const o=i==="maxLength"?"more":"fewer";return(0,e.str)`must NOT have ${o} than ${a} characters`},params:({schemaCode:i})=>(0,e._)`{limit: ${i}}`},code(i){const{keyword:a,data:o,schemaCode:c,it:l}=i,u=a==="maxLength"?e.operators.GT:e.operators.LT,m=l.opts.unicode===!1?(0,e._)`${o}.length`:(0,e._)`${(0,t.useFunc)(i.gen,r.default)}(${o})`;i.fail$data((0,e._)`${m} ${u} ${c}`)}};return Ks.default=s,Ks}var Ws={},Yf;function Gw(){if(Yf)return Ws;Yf=1,Object.defineProperty(Ws,"__esModule",{value:!0});const e=ar(),t=Me(),r=Oe(),s={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:i})=>(0,r.str)`must match pattern "${i}"`,params:({schemaCode:i})=>(0,r._)`{pattern: ${i}}`},code(i){const{gen:a,data:o,$data:c,schema:l,schemaCode:u,it:m}=i,_=m.opts.unicodeRegExp?"u":"";if(c){const{regExp:v}=m.opts.code,S=v.code==="new RegExp"?(0,r._)`new RegExp`:(0,t.useFunc)(a,v),E=a.let("valid");a.try(()=>a.assign(E,(0,r._)`${S}(${u}, ${_}).test(${o})`),()=>a.assign(E,!1)),i.fail$data((0,r._)`!${E}`)}else{const v=(0,e.usePattern)(i,l);i.fail$data((0,r._)`!${v}.test(${o})`)}}};return Ws.default=s,Ws}var Js={},Xf;function Ww(){if(Xf)return Js;Xf=1,Object.defineProperty(Js,"__esModule",{value:!0});const e=Oe(),r={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:n,schemaCode:s}){const i=n==="maxProperties"?"more":"fewer";return(0,e.str)`must NOT have ${i} than ${s} properties`},params:({schemaCode:n})=>(0,e._)`{limit: ${n}}`},code(n){const{keyword:s,data:i,schemaCode:a}=n,o=s==="maxProperties"?e.operators.GT:e.operators.LT;n.fail$data((0,e._)`Object.keys(${i}).length ${o} ${a}`)}};return Js.default=r,Js}var Ys={},Zf;function Jw(){if(Zf)return Ys;Zf=1,Object.defineProperty(Ys,"__esModule",{value:!0});const e=ar(),t=Oe(),r=Me(),s={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:i}})=>(0,t.str)`must have required property '${i}'`,params:({params:{missingProperty:i}})=>(0,t._)`{missingProperty: ${i}}`},code(i){const{gen:a,schema:o,schemaCode:c,data:l,$data:u,it:m}=i,{opts:_}=m;if(!u&&o.length===0)return;const v=o.length>=_.loopRequired;if(m.allErrors?S():E(),_.strictRequired){const f=i.parentSchema.properties,{definedProperties:C}=i.it;for(const P of o)if(f?.[P]===void 0&&!C.has(P)){const h=m.schemaEnv.baseId+m.errSchemaPath,b=`required property "${P}" is not defined at "${h}" (strictRequired)`;(0,r.checkStrictMode)(m,b,m.opts.strictRequired)}}function S(){if(v||u)i.block$data(t.nil,g);else for(const f of o)(0,e.checkReportMissingProp)(i,f)}function E(){const f=a.let("missing");if(v||u){const C=a.let("valid",!0);i.block$data(C,()=>y(f,C)),i.ok(C)}else a.if((0,e.checkMissingProp)(i,o,f)),(0,e.reportMissingProp)(i,f),a.else()}function g(){a.forOf("prop",c,f=>{i.setParams({missingProperty:f}),a.if((0,e.noPropertyInData)(a,l,f,_.ownProperties),()=>i.error())})}function y(f,C){i.setParams({missingProperty:f}),a.forOf(f,c,()=>{a.assign(C,(0,e.propertyInData)(a,l,f,_.ownProperties)),a.if((0,t.not)(C),()=>{i.error(),a.break()})},t.nil)}}};return Ys.default=s,Ys}var Xs={},Qf;function Yw(){if(Qf)return Xs;Qf=1,Object.defineProperty(Xs,"__esModule",{value:!0});const e=Oe(),r={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:n,schemaCode:s}){const i=n==="maxItems"?"more":"fewer";return(0,e.str)`must NOT have ${i} than ${s} items`},params:({schemaCode:n})=>(0,e._)`{limit: ${n}}`},code(n){const{keyword:s,data:i,schemaCode:a}=n,o=s==="maxItems"?e.operators.GT:e.operators.LT;n.fail$data((0,e._)`${i}.length ${o} ${a}`)}};return Xs.default=r,Xs}var Zs={},Qs={},eh;function pl(){if(eh)return Qs;eh=1,Object.defineProperty(Qs,"__esModule",{value:!0});const e=eo();return e.code='require("ajv/dist/runtime/equal").default',Qs.default=e,Qs}var th;function Xw(){if(th)return Zs;th=1,Object.defineProperty(Zs,"__esModule",{value:!0});const e=Ba(),t=Oe(),r=Me(),n=pl(),i={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:a,j:o}})=>(0,t.str)`must NOT have duplicate items (items ## ${o} and ${a} are identical)`,params:({params:{i:a,j:o}})=>(0,t._)`{i: ${a}, j: ${o}}`},code(a){const{gen:o,data:c,$data:l,schema:u,parentSchema:m,schemaCode:_,it:v}=a;if(!l&&!u)return;const S=o.let("valid"),E=m.items?(0,e.getSchemaTypes)(m.items):[];a.block$data(S,g,(0,t._)`${_} === false`),a.ok(S);function g(){const P=o.let("i",(0,t._)`${c}.length`),h=o.let("j");a.setParams({i:P,j:h}),o.assign(S,!0),o.if((0,t._)`${P} > 1`,()=>(y()?f:C)(P,h))}function y(){return E.length>0&&!E.some(P=>P==="object"||P==="array")}function f(P,h){const b=o.name("item"),O=(0,e.checkDataTypes)(E,b,v.opts.strictNumbers,e.DataType.Wrong),k=o.const("indices",(0,t._)`{}`);o.for((0,t._)`;${P}--;`,()=>{o.let(b,(0,t._)`${c}[${P}]`),o.if(O,(0,t._)`continue`),E.length>1&&o.if((0,t._)`typeof ${b} == "string"`,(0,t._)`${b} += "_"`),o.if((0,t._)`typeof ${k}[${b}] == "number"`,()=>{o.assign(h,(0,t._)`${k}[${b}]`),a.error(),o.assign(S,!1).break()}).code((0,t._)`${k}[${b}] = ${P}`)})}function C(P,h){const b=(0,r.useFunc)(o,n.default),O=o.name("outer");o.label(O).for((0,t._)`;${P}--;`,()=>o.for((0,t._)`${h} = ${P}; ${h}--;`,()=>o.if((0,t._)`${b}(${c}[${P}], ${c}[${h}])`,()=>{a.error(),o.assign(S,!1).break(O)})))}}};return Zs.default=i,Zs}var ea={},rh;function Zw(){if(rh)return ea;rh=1,Object.defineProperty(ea,"__esModule",{value:!0});const e=Oe(),t=Me(),r=pl(),s={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:i})=>(0,e._)`{allowedValue: ${i}}`},code(i){const{gen:a,data:o,$data:c,schemaCode:l,schema:u}=i;c||u&&typeof u=="object"?i.fail$data((0,e._)`!${(0,t.useFunc)(a,r.default)}(${o}, ${l})`):i.fail((0,e._)`${u} !== ${o}`)}};return ea.default=s,ea}var ta={},nh;function Qw(){if(nh)return ta;nh=1,Object.defineProperty(ta,"__esModule",{value:!0});const e=Oe(),t=Me(),r=pl(),s={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:i})=>(0,e._)`{allowedValues: ${i}}`},code(i){const{gen:a,data:o,$data:c,schema:l,schemaCode:u,it:m}=i;if(!c&&l.length===0)throw new Error("enum must have non-empty array");const _=l.length>=m.opts.loopEnum;let v;const S=()=>v??(v=(0,t.useFunc)(a,r.default));let E;if(_||c)E=a.let("valid"),i.block$data(E,g);else{if(!Array.isArray(l))throw new Error("ajv implementation error");const f=a.const("vSchema",u);E=(0,e.or)(...l.map((C,P)=>y(f,P)))}i.pass(E);function g(){a.assign(E,!1),a.forOf("v",u,f=>a.if((0,e._)`${S()}(${o}, ${f})`,()=>a.assign(E,!0).break()))}function y(f,C){const P=l[C];return typeof P=="object"&&P!==null?(0,e._)`${S()}(${o}, ${f}[${C}])`:(0,e._)`${o} === ${P}`}}};return ta.default=s,ta}var ih;function e1(){if(ih)return zs;ih=1,Object.defineProperty(zs,"__esModule",{value:!0});const e=zw(),t=Bw(),r=Kw(),n=Gw(),s=Ww(),i=Jw(),a=Yw(),o=Xw(),c=Zw(),l=Qw(),u=[e.default,t.default,r.default,n.default,s.default,i.default,a.default,o.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},c.default,l.default];return zs.default=u,zs}var ra={},Bn={},sh;function np(){if(sh)return Bn;sh=1,Object.defineProperty(Bn,"__esModule",{value:!0}),Bn.validateAdditionalItems=void 0;const e=Oe(),t=Me(),n={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:i}})=>(0,e.str)`must NOT have more than ${i} items`,params:({params:{len:i}})=>(0,e._)`{limit: ${i}}`},code(i){const{parentSchema:a,it:o}=i,{items:c}=a;if(!Array.isArray(c)){(0,t.checkStrictMode)(o,'"additionalItems" is ignored when "items" is not an array of schemas');return}s(i,c)}};function s(i,a){const{gen:o,schema:c,data:l,keyword:u,it:m}=i;m.items=!0;const _=o.const("len",(0,e._)`${l}.length`);if(c===!1)i.setParams({len:a.length}),i.pass((0,e._)`${_} <= ${a.length}`);else if(typeof c=="object"&&!(0,t.alwaysValidSchema)(m,c)){const S=o.var("valid",(0,e._)`${_} <= ${a.length}`);o.if((0,e.not)(S),()=>v(S)),i.ok(S)}function v(S){o.forRange("i",a.length,_,E=>{i.subschema({keyword:u,dataProp:E,dataPropType:t.Type.Num},S),m.allErrors||o.if((0,e.not)(S),()=>o.break())})}}return Bn.validateAdditionalItems=s,Bn.default=n,Bn}var na={},Hn={},ah;function ip(){if(ah)return Hn;ah=1,Object.defineProperty(Hn,"__esModule",{value:!0}),Hn.validateTuple=void 0;const e=Oe(),t=Me(),r=ar(),n={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(i){const{schema:a,it:o}=i;if(Array.isArray(a))return s(i,"additionalItems",a);o.items=!0,!(0,t.alwaysValidSchema)(o,a)&&i.ok((0,r.validateArray)(i))}};function s(i,a,o=i.schema){const{gen:c,parentSchema:l,data:u,keyword:m,it:_}=i;E(l),_.opts.unevaluated&&o.length&&_.items!==!0&&(_.items=t.mergeEvaluated.items(c,o.length,_.items));const v=c.name("valid"),S=c.const("len",(0,e._)`${u}.length`);o.forEach((g,y)=>{(0,t.alwaysValidSchema)(_,g)||(c.if((0,e._)`${S} > ${y}`,()=>i.subschema({keyword:m,schemaProp:y,dataProp:y},v)),i.ok(v))});function E(g){const{opts:y,errSchemaPath:f}=_,C=o.length,P=C===g.minItems&&(C===g.maxItems||g[a]===!1);if(y.strictTuples&&!P){const h=`"${m}" is ${C}-tuple, but minItems or maxItems/${a} are not specified or different at path "${f}"`;(0,t.checkStrictMode)(_,h,y.strictTuples)}}}return Hn.validateTuple=s,Hn.default=n,Hn}var oh;function t1(){if(oh)return na;oh=1,Object.defineProperty(na,"__esModule",{value:!0});const e=ip(),t={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:r=>(0,e.validateTuple)(r,"items")};return na.default=t,na}var ia={},ch;function r1(){if(ch)return ia;ch=1,Object.defineProperty(ia,"__esModule",{value:!0});const e=Oe(),t=Me(),r=ar(),n=np(),i={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:a}})=>(0,e.str)`must NOT have more than ${a} items`,params:({params:{len:a}})=>(0,e._)`{limit: ${a}}`},code(a){const{schema:o,parentSchema:c,it:l}=a,{prefixItems:u}=c;l.items=!0,!(0,t.alwaysValidSchema)(l,o)&&(u?(0,n.validateAdditionalItems)(a,u):a.ok((0,r.validateArray)(a)))}};return ia.default=i,ia}var sa={},lh;function n1(){if(lh)return sa;lh=1,Object.defineProperty(sa,"__esModule",{value:!0});const e=Oe(),t=Me(),n={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:s,max:i}})=>i===void 0?(0,e.str)`must contain at least ${s} valid item(s)`:(0,e.str)`must contain at least ${s} and no more than ${i} valid item(s)`,params:({params:{min:s,max:i}})=>i===void 0?(0,e._)`{minContains: ${s}}`:(0,e._)`{minContains: ${s}, maxContains: ${i}}`},code(s){const{gen:i,schema:a,parentSchema:o,data:c,it:l}=s;let u,m;const{minContains:_,maxContains:v}=o;l.opts.next?(u=_===void 0?1:_,m=v):u=1;const S=i.const("len",(0,e._)`${c}.length`);if(s.setParams({min:u,max:m}),m===void 0&&u===0){(0,t.checkStrictMode)(l,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(m!==void 0&&u>m){(0,t.checkStrictMode)(l,'"minContains" > "maxContains" is always invalid'),s.fail();return}if((0,t.alwaysValidSchema)(l,a)){let C=(0,e._)`${S} >= ${u}`;m!==void 0&&(C=(0,e._)`${C} && ${S} <= ${m}`),s.pass(C);return}l.items=!0;const E=i.name("valid");m===void 0&&u===1?y(E,()=>i.if(E,()=>i.break())):u===0?(i.let(E,!0),m!==void 0&&i.if((0,e._)`${c}.length > 0`,g)):(i.let(E,!1),g()),s.result(E,()=>s.reset());function g(){const C=i.name("_valid"),P=i.let("count",0);y(C,()=>i.if(C,()=>f(P)))}function y(C,P){i.forRange("i",0,S,h=>{s.subschema({keyword:"contains",dataProp:h,dataPropType:t.Type.Num,compositeRule:!0},C),P()})}function f(C){i.code((0,e._)`${C}++`),m===void 0?i.if((0,e._)`${C} >= ${u}`,()=>i.assign(E,!0).break()):(i.if((0,e._)`${C} > ${m}`,()=>i.assign(E,!1).break()),u===1?i.assign(E,!0):i.if((0,e._)`${C} >= ${u}`,()=>i.assign(E,!0)))}}};return sa.default=n,sa}var uc={},uh;function i1(){return uh||(uh=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=Oe(),r=Me(),n=ar();e.error={message:({params:{property:c,depsCount:l,deps:u}})=>{const m=l===1?"property":"properties";return(0,t.str)`must have ${m} ${u} when property ${c} is present`},params:({params:{property:c,depsCount:l,deps:u,missingProperty:m}})=>(0,t._)`{property: ${c},
missingProperty: ${m},
depsCount: ${l},
deps: ${u}}`};const s={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(c){const[l,u]=i(c);a(c,l),o(c,u)}};function i({schema:c}){const l={},u={};for(const m in c){if(m==="__proto__")continue;const _=Array.isArray(c[m])?l:u;_[m]=c[m]}return[l,u]}function a(c,l=c.schema){const{gen:u,data:m,it:_}=c;if(Object.keys(l).length===0)return;const v=u.let("missing");for(const S in l){const E=l[S];if(E.length===0)continue;const g=(0,n.propertyInData)(u,m,S,_.opts.ownProperties);c.setParams({property:S,depsCount:E.length,deps:E.join(", ")}),_.allErrors?u.if(g,()=>{for(const y of E)(0,n.checkReportMissingProp)(c,y)}):(u.if((0,t._)`${g} && (${(0,n.checkMissingProp)(c,E,v)})`),(0,n.reportMissingProp)(c,v),u.else())}}e.validatePropertyDeps=a;function o(c,l=c.schema){const{gen:u,data:m,keyword:_,it:v}=c,S=u.name("valid");for(const E in l)(0,r.alwaysValidSchema)(v,l[E])||(u.if((0,n.propertyInData)(u,m,E,v.opts.ownProperties),()=>{const g=c.subschema({keyword:_,schemaProp:E},S);c.mergeValidEvaluated(g,S)},()=>u.var(S,!0)),c.ok(S))}e.validateSchemaDeps=o,e.default=s})(uc)),uc}var aa={},dh;function s1(){if(dh)return aa;dh=1,Object.defineProperty(aa,"__esModule",{value:!0});const e=Oe(),t=Me(),n={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:s})=>(0,e._)`{propertyName: ${s.propertyName}}`},code(s){const{gen:i,schema:a,data:o,it:c}=s;if((0,t.alwaysValidSchema)(c,a))return;const l=i.name("valid");i.forIn("key",o,u=>{s.setParams({propertyName:u}),s.subschema({keyword:"propertyNames",data:u,dataTypes:["string"],propertyName:u,compositeRule:!0},l),i.if((0,e.not)(l),()=>{s.error(!0),c.allErrors||i.break()})}),s.ok(l)}};return aa.default=n,aa}var oa={},fh;function sp(){if(fh)return oa;fh=1,Object.defineProperty(oa,"__esModule",{value:!0});const e=ar(),t=Oe(),r=nn(),n=Me(),i={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:a})=>(0,t._)`{additionalProperty: ${a.additionalProperty}}`},code(a){const{gen:o,schema:c,parentSchema:l,data:u,errsCount:m,it:_}=a;if(!m)throw new Error("ajv implementation error");const{allErrors:v,opts:S}=_;if(_.props=!0,S.removeAdditional!=="all"&&(0,n.alwaysValidSchema)(_,c))return;const E=(0,e.allSchemaProperties)(l.properties),g=(0,e.allSchemaProperties)(l.patternProperties);y(),a.ok((0,t._)`${m} === ${r.default.errors}`);function y(){o.forIn("key",u,b=>{!E.length&&!g.length?P(b):o.if(f(b),()=>P(b))})}function f(b){let O;if(E.length>8){const k=(0,n.schemaRefOrVal)(_,l.properties,"properties");O=(0,e.isOwnProperty)(o,k,b)}else E.length?O=(0,t.or)(...E.map(k=>(0,t._)`${b} === ${k}`)):O=t.nil;return g.length&&(O=(0,t.or)(O,...g.map(k=>(0,t._)`${(0,e.usePattern)(a,k)}.test(${b})`))),(0,t.not)(O)}function C(b){o.code((0,t._)`delete ${u}[${b}]`)}function P(b){if(S.removeAdditional==="all"||S.removeAdditional&&c===!1){C(b);return}if(c===!1){a.setParams({additionalProperty:b}),a.error(),v||o.break();return}if(typeof c=="object"&&!(0,n.alwaysValidSchema)(_,c)){const O=o.name("valid");S.removeAdditional==="failing"?(h(b,O,!1),o.if((0,t.not)(O),()=>{a.reset(),C(b)})):(h(b,O),v||o.if((0,t.not)(O),()=>o.break()))}}function h(b,O,k){const $={keyword:"additionalProperties",dataProp:b,dataPropType:n.Type.Str};k===!1&&Object.assign($,{compositeRule:!0,createErrors:!1,allErrors:!1}),a.subschema($,O)}}};return oa.default=i,oa}var ca={},hh;function a1(){if(hh)return ca;hh=1,Object.defineProperty(ca,"__esModule",{value:!0});const e=ao(),t=ar(),r=Me(),n=sp(),s={keyword:"properties",type:"object",schemaType:"object",code(i){const{gen:a,schema:o,parentSchema:c,data:l,it:u}=i;u.opts.removeAdditional==="all"&&c.additionalProperties===void 0&&n.default.code(new e.KeywordCxt(u,n.default,"additionalProperties"));const m=(0,t.allSchemaProperties)(o);for(const g of m)u.definedProperties.add(g);u.opts.unevaluated&&m.length&&u.props!==!0&&(u.props=r.mergeEvaluated.props(a,(0,r.toHash)(m),u.props));const _=m.filter(g=>!(0,r.alwaysValidSchema)(u,o[g]));if(_.length===0)return;const v=a.name("valid");for(const g of _)S(g)?E(g):(a.if((0,t.propertyInData)(a,l,g,u.opts.ownProperties)),E(g),u.allErrors||a.else().var(v,!0),a.endIf()),i.it.definedProperties.add(g),i.ok(v);function S(g){return u.opts.useDefaults&&!u.compositeRule&&o[g].default!==void 0}function E(g){i.subschema({keyword:"properties",schemaProp:g,dataProp:g},v)}}};return ca.default=s,ca}var la={},mh;function o1(){if(mh)return la;mh=1,Object.defineProperty(la,"__esModule",{value:!0});const e=ar(),t=Oe(),r=Me(),n=Me(),s={keyword:"patternProperties",type:"object",schemaType:"object",code(i){const{gen:a,schema:o,data:c,parentSchema:l,it:u}=i,{opts:m}=u,_=(0,e.allSchemaProperties)(o),v=_.filter(P=>(0,r.alwaysValidSchema)(u,o[P]));if(_.length===0||v.length===_.length&&(!u.opts.unevaluated||u.props===!0))return;const S=m.strictSchema&&!m.allowMatchingProperties&&l.properties,E=a.name("valid");u.props!==!0&&!(u.props instanceof t.Name)&&(u.props=(0,n.evaluatedPropsToName)(a,u.props));const{props:g}=u;y();function y(){for(const P of _)S&&f(P),u.allErrors?C(P):(a.var(E,!0),C(P),a.if(E))}function f(P){for(const h in S)new RegExp(P).test(h)&&(0,r.checkStrictMode)(u,`property ${h} matches pattern ${P} (use allowMatchingProperties)`)}function C(P){a.forIn("key",c,h=>{a.if((0,t._)`${(0,e.usePattern)(i,P)}.test(${h})`,()=>{const b=v.includes(P);b||i.subschema({keyword:"patternProperties",schemaProp:P,dataProp:h,dataPropType:n.Type.Str},E),u.opts.unevaluated&&g!==!0?a.assign((0,t._)`${g}[${h}]`,!0):!b&&!u.allErrors&&a.if((0,t.not)(E),()=>a.break())})})}}};return la.default=s,la}var ua={},ph;function c1(){if(ph)return ua;ph=1,Object.defineProperty(ua,"__esModule",{value:!0});const e=Me(),t={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(r){const{gen:n,schema:s,it:i}=r;if((0,e.alwaysValidSchema)(i,s)){r.fail();return}const a=n.name("valid");r.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},a),r.failResult(a,()=>r.reset(),()=>r.error())},error:{message:"must NOT be valid"}};return ua.default=t,ua}var da={},yh;function l1(){if(yh)return da;yh=1,Object.defineProperty(da,"__esModule",{value:!0});const t={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:ar().validateUnion,error:{message:"must match a schema in anyOf"}};return da.default=t,da}var fa={},gh;function u1(){if(gh)return fa;gh=1,Object.defineProperty(fa,"__esModule",{value:!0});const e=Oe(),t=Me(),n={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:s})=>(0,e._)`{passingSchemas: ${s.passing}}`},code(s){const{gen:i,schema:a,parentSchema:o,it:c}=s;if(!Array.isArray(a))throw new Error("ajv implementation error");if(c.opts.discriminator&&o.discriminator)return;const l=a,u=i.let("valid",!1),m=i.let("passing",null),_=i.name("_valid");s.setParams({passing:m}),i.block(v),s.result(u,()=>s.reset(),()=>s.error(!0));function v(){l.forEach((S,E)=>{let g;(0,t.alwaysValidSchema)(c,S)?i.var(_,!0):g=s.subschema({keyword:"oneOf",schemaProp:E,compositeRule:!0},_),E>0&&i.if((0,e._)`${_} && ${u}`).assign(u,!1).assign(m,(0,e._)`[${m}, ${E}]`).else(),i.if(_,()=>{i.assign(u,!0),i.assign(m,E),g&&s.mergeEvaluated(g,e.Name)})})}}};return fa.default=n,fa}var ha={},vh;function d1(){if(vh)return ha;vh=1,Object.defineProperty(ha,"__esModule",{value:!0});const e=Me(),t={keyword:"allOf",schemaType:"array",code(r){const{gen:n,schema:s,it:i}=r;if(!Array.isArray(s))throw new Error("ajv implementation error");const a=n.name("valid");s.forEach((o,c)=>{if((0,e.alwaysValidSchema)(i,o))return;const l=r.subschema({keyword:"allOf",schemaProp:c},a);r.ok(a),r.mergeEvaluated(l)})}};return ha.default=t,ha}var ma={},bh;function f1(){if(bh)return ma;bh=1,Object.defineProperty(ma,"__esModule",{value:!0});const e=Oe(),t=Me(),n={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:i})=>(0,e.str)`must match "${i.ifClause}" schema`,params:({params:i})=>(0,e._)`{failingKeyword: ${i.ifClause}}`},code(i){const{gen:a,parentSchema:o,it:c}=i;o.then===void 0&&o.else===void 0&&(0,t.checkStrictMode)(c,'"if" without "then" and "else" is ignored');const l=s(c,"then"),u=s(c,"else");if(!l&&!u)return;const m=a.let("valid",!0),_=a.name("_valid");if(v(),i.reset(),l&&u){const E=a.let("ifClause");i.setParams({ifClause:E}),a.if(_,S("then",E),S("else",E))}else l?a.if(_,S("then")):a.if((0,e.not)(_),S("else"));i.pass(m,()=>i.error(!0));function v(){const E=i.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},_);i.mergeEvaluated(E)}function S(E,g){return()=>{const y=i.subschema({keyword:E},_);a.assign(m,_),i.mergeValidEvaluated(y,m),g?a.assign(g,(0,e._)`${E}`):i.setParams({ifClause:E})}}}};function s(i,a){const o=i.schema[a];return o!==void 0&&!(0,t.alwaysValidSchema)(i,o)}return ma.default=n,ma}var pa={},_h;function h1(){if(_h)return pa;_h=1,Object.defineProperty(pa,"__esModule",{value:!0});const e=Me(),t={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:r,parentSchema:n,it:s}){n.if===void 0&&(0,e.checkStrictMode)(s,`"${r}" without "if" is ignored`)}};return pa.default=t,pa}var Sh;function m1(){if(Sh)return ra;Sh=1,Object.defineProperty(ra,"__esModule",{value:!0});const e=np(),t=t1(),r=ip(),n=r1(),s=n1(),i=i1(),a=s1(),o=sp(),c=a1(),l=o1(),u=c1(),m=l1(),_=u1(),v=d1(),S=f1(),E=h1();function g(y=!1){const f=[u.default,m.default,_.default,v.default,S.default,E.default,a.default,o.default,i.default,c.default,l.default];return y?f.push(t.default,n.default):f.push(e.default,r.default),f.push(s.default),f}return ra.default=g,ra}var ya={},ga={},wh;function p1(){if(wh)return ga;wh=1,Object.defineProperty(ga,"__esModule",{value:!0});const e=Oe(),r={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:n})=>(0,e.str)`must match format "${n}"`,params:({schemaCode:n})=>(0,e._)`{format: ${n}}`},code(n,s){const{gen:i,data:a,$data:o,schema:c,schemaCode:l,it:u}=n,{opts:m,errSchemaPath:_,schemaEnv:v,self:S}=u;if(!m.validateFormats)return;o?E():g();function E(){const y=i.scopeValue("formats",{ref:S.formats,code:m.code.formats}),f=i.const("fDef",(0,e._)`${y}[${l}]`),C=i.let("fType"),P=i.let("format");i.if((0,e._)`typeof ${f} == "object" && !(${f} instanceof RegExp)`,()=>i.assign(C,(0,e._)`${f}.type || "string"`).assign(P,(0,e._)`${f}.validate`),()=>i.assign(C,(0,e._)`"string"`).assign(P,f)),n.fail$data((0,e.or)(h(),b()));function h(){return m.strictSchema===!1?e.nil:(0,e._)`${l} && !${P}`}function b(){const O=v.$async?(0,e._)`(${f}.async ? await ${P}(${a}) : ${P}(${a}))`:(0,e._)`${P}(${a})`,k=(0,e._)`(typeof ${P} == "function" ? ${O} : ${P}.test(${a}))`;return(0,e._)`${P} && ${P} !== true && ${C} === ${s} && !${k}`}}function g(){const y=S.formats[c];if(!y){h();return}if(y===!0)return;const[f,C,P]=b(y);f===s&&n.pass(O());function h(){if(m.strictSchema===!1){S.logger.warn(k());return}throw new Error(k());function k(){return`unknown format "${c}" ignored in schema at path "${_}"`}}function b(k){const $=k instanceof RegExp?(0,e.regexpCode)(k):m.code.formats?(0,e._)`${m.code.formats}${(0,e.getProperty)(c)}`:void 0,M=i.scopeValue("formats",{key:c,ref:k,code:$});return typeof k=="object"&&!(k instanceof RegExp)?[k.type||"string",k.validate,(0,e._)`${M}.validate`]:["string",k,M]}function O(){if(typeof y=="object"&&!(y instanceof RegExp)&&y.async){if(!v.$async)throw new Error("async format in sync schema");return(0,e._)`await ${P}(${a})`}return typeof C=="function"?(0,e._)`${P}(${a})`:(0,e._)`${P}.test(${a})`}}}};return ga.default=r,ga}var Ch;function y1(){if(Ch)return ya;Ch=1,Object.defineProperty(ya,"__esModule",{value:!0});const t=[p1().default];return ya.default=t,ya}var vn={},Eh;function g1(){return Eh||(Eh=1,Object.defineProperty(vn,"__esModule",{value:!0}),vn.contentVocabulary=vn.metadataVocabulary=void 0,vn.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],vn.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]),vn}var Ah;function v1(){if(Ah)return Us;Ah=1,Object.defineProperty(Us,"__esModule",{value:!0});const e=Vw(),t=e1(),r=m1(),n=y1(),s=g1(),i=[e.default,t.default,(0,r.default)(),n.default,s.metadataVocabulary,s.contentVocabulary];return Us.default=i,Us}var va={},Ci={},xh;function b1(){if(xh)return Ci;xh=1,Object.defineProperty(Ci,"__esModule",{value:!0}),Ci.DiscrError=void 0;var e;return(function(t){t.Tag="tag",t.Mapping="mapping"})(e||(Ci.DiscrError=e={})),Ci}var Ph;function _1(){if(Ph)return va;Ph=1,Object.defineProperty(va,"__esModule",{value:!0});const e=Oe(),t=b1(),r=ml(),n=oo(),s=Me(),a={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:o,tagName:c}})=>o===t.DiscrError.Tag?`tag "${c}" must be string`:`value of tag "${c}" must be in oneOf`,params:({params:{discrError:o,tag:c,tagName:l}})=>(0,e._)`{error: ${o}, tag: ${l}, tagValue: ${c}}`},code(o){const{gen:c,data:l,schema:u,parentSchema:m,it:_}=o,{oneOf:v}=m;if(!_.opts.discriminator)throw new Error("discriminator: requires discriminator option");const S=u.propertyName;if(typeof S!="string")throw new Error("discriminator: requires propertyName");if(u.mapping)throw new Error("discriminator: mapping is not supported");if(!v)throw new Error("discriminator: requires oneOf keyword");const E=c.let("valid",!1),g=c.const("tag",(0,e._)`${l}${(0,e.getProperty)(S)}`);c.if((0,e._)`typeof ${g} == "string"`,()=>y(),()=>o.error(!1,{discrError:t.DiscrError.Tag,tag:g,tagName:S})),o.ok(E);function y(){const P=C();c.if(!1);for(const h in P)c.elseIf((0,e._)`${g} === ${h}`),c.assign(E,f(P[h]));c.else(),o.error(!1,{discrError:t.DiscrError.Mapping,tag:g,tagName:S}),c.endIf()}function f(P){const h=c.name("valid"),b=o.subschema({keyword:"oneOf",schemaProp:P},h);return o.mergeEvaluated(b,e.Name),h}function C(){var P;const h={},b=k(m);let O=!0;for(let q=0;q<v.length;q++){let L=v[q];if(L?.$ref&&!(0,s.schemaHasRulesButRef)(L,_.self.RULES)){const B=L.$ref;if(L=r.resolveRef.call(_.self,_.schemaEnv.root,_.baseId,B),L instanceof r.SchemaEnv&&(L=L.schema),L===void 0)throw new n.default(_.opts.uriResolver,_.baseId,B)}const U=(P=L?.properties)===null||P===void 0?void 0:P[S];if(typeof U!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${S}"`);O=O&&(b||k(L)),$(U,q)}if(!O)throw new Error(`discriminator: "${S}" must be required`);return h;function k({required:q}){return Array.isArray(q)&&q.includes(S)}function $(q,L){if(q.const)M(q.const,L);else if(q.enum)for(const U of q.enum)M(U,L);else throw new Error(`discriminator: "properties/${S}" must have "const" or "enum"`)}function M(q,L){if(typeof q!="string"||q in h)throw new Error(`discriminator: "${S}" values must be unique strings`);h[q]=L}}}};return va.default=a,va}const S1="http://json-schema.org/draft-07/schema#",w1="http://json-schema.org/draft-07/schema#",C1="Core schema meta-schema",E1={schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},A1=["object","boolean"],x1={$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},P1={$schema:S1,$id:w1,title:C1,definitions:E1,type:A1,properties:x1,default:!0};var Oh;function O1(){return Oh||(Oh=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;const r=qw(),n=v1(),s=_1(),i=P1,a=["/properties"],o="http://json-schema.org/draft-07/schema";class c extends r.default{_addVocabularies(){super._addVocabularies(),n.default.forEach(S=>this.addVocabulary(S)),this.opts.discriminator&&this.addKeyword(s.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const S=this.opts.$data?this.$dataMetaSchema(i,a):i;this.addMetaSchema(S,o,!1),this.refs["http://json-schema.org/schema"]=o}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(o)?o:void 0)}}t.Ajv=c,e.exports=t=c,e.exports.Ajv=c,Object.defineProperty(t,"__esModule",{value:!0}),t.default=c;var l=ao();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return l.KeywordCxt}});var u=Oe();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return u._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return u.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return u.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return u.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return u.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return u.CodeGen}});var m=hl();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return m.default}});var _=oo();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return _.default}})})(Fs,Fs.exports)),Fs.exports}var jh;function j1(){return jh||(jh=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;const t=O1(),r=Oe(),n=r.operators,s={formatMaximum:{okStr:"<=",ok:n.LTE,fail:n.GT},formatMinimum:{okStr:">=",ok:n.GTE,fail:n.LT},formatExclusiveMaximum:{okStr:"<",ok:n.LT,fail:n.GTE},formatExclusiveMinimum:{okStr:">",ok:n.GT,fail:n.LTE}},i={message:({keyword:o,schemaCode:c})=>r.str`should be ${s[o].okStr} ${c}`,params:({keyword:o,schemaCode:c})=>r._`{comparison: ${s[o].okStr}, limit: ${c}}`};e.formatLimitDefinition={keyword:Object.keys(s),type:"string",schemaType:"string",$data:!0,error:i,code(o){const{gen:c,data:l,schemaCode:u,keyword:m,it:_}=o,{opts:v,self:S}=_;if(!v.validateFormats)return;const E=new t.KeywordCxt(_,S.RULES.all.format.definition,"format");E.$data?g():y();function g(){const C=c.scopeValue("formats",{ref:S.formats,code:v.code.formats}),P=c.const("fmt",r._`${C}[${E.schemaCode}]`);o.fail$data(r.or(r._`typeof ${P} != "object"`,r._`${P} instanceof RegExp`,r._`typeof ${P}.compare != "function"`,f(P)))}function y(){const C=E.schema,P=S.formats[C];if(!P||P===!0)return;if(typeof P!="object"||P instanceof RegExp||typeof P.compare!="function")throw new Error(`"${m}": format "${C}" does not define "compare" function`);const h=c.scopeValue("formats",{key:C,ref:P,code:v.code.formats?r._`${v.code.formats}${r.getProperty(C)}`:void 0});o.fail$data(f(h))}function f(C){return r._`${C}.compare(${l}, ${u}) ${s[m].fail} 0`}},dependencies:["format"]};const a=o=>(o.addKeyword(e.formatLimitDefinition),o);e.default=a})(tc)),tc}var kh;function k1(){return kh||(kh=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=Cw(),n=j1(),s=Oe(),i=new s.Name("fullFormats"),a=new s.Name("fastFormats"),o=(l,u={keywords:!0})=>{if(Array.isArray(u))return c(l,u,r.fullFormats,i),l;const[m,_]=u.mode==="fast"?[r.fastFormats,a]:[r.fullFormats,i],v=u.formats||r.formatNames;return c(l,v,m,_),u.keywords&&n.default(l),l};o.get=(l,u="full")=>{const _=(u==="fast"?r.fastFormats:r.fullFormats)[l];if(!_)throw new Error(`Unknown format "${l}"`);return _};function c(l,u,m,_){var v,S;(v=(S=l.opts.code).formats)!==null&&v!==void 0||(S.formats=s._`require("ajv-formats/dist/formats").${_}`);for(const E of u)l.addFormat(E,m[E])}e.exports=t=o,Object.defineProperty(t,"__esModule",{value:!0}),t.default=o})($s,$s.exports)),$s.exports}var N1=k1();const Nh=Fi(N1),I1={allErrors:!0,multipleOfPrecision:8,strict:!1,verbose:!0,discriminator:!1},R1=/^(#?([0-9A-Fa-f]{3}){1,2}\b|aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow|(rgb\(\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*\))|(rgb\(\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*\)))$/,$1=/^data:([a-z]+\/[a-z0-9-+.]+)?;(?:name=(.*);)?base64,(.*)$/;function F1(e,t,r={},n,s=ww,i){let a=new s({...I1,...r});return n?Nh(a,n):n!==!1&&Nh(a),a.addFormat("data-url",$1),a.addFormat("color",R1),a.addKeyword(Bc),Array.isArray(e)&&a.addMetaSchema(e),ue(t)&&Object.keys(t).forEach(o=>{a.addFormat(o,t[o])}),i&&(a=i(a)),a}class D1{ajv;localizer;suppressDuplicateFiltering;lastSeenRootSchema;hasRegisteredRootSchema=!1;constructor(t,r){const{additionalMetaSchemas:n,customFormats:s,ajvOptionsOverrides:i,ajvFormatOptions:a,AjvClass:o,extenderFn:c,suppressDuplicateFiltering:l}=t;this.ajv=F1(n,s,i,a,o,c),this.localizer=r,this.suppressDuplicateFiltering=l}reset(){this.ajv.removeSchema(),this.lastSeenRootSchema=void 0,this.hasRegisteredRootSchema=!1}rawValidation(t,r){let n,s;try{t[Ue]&&(s=this.ajv.getSchema(t[Ue])),s===void 0&&(s=this.ajv.compile(t)),s(r)}catch(a){n=a,s===void 0&&this.ajv.removeSchema(t[Ue]!==void 0?t[Ue]:t)}let i;return s&&(typeof this.localizer=="function"&&((s.errors??[]).forEach(a=>{["missingProperty","property"].forEach(o=>{a.params?.[o]&&(a.params[o]=`'${a.params[o]}'`)}),a.params?.deps&&(a.params.deps=a.params.deps.split(", ").map(o=>`'${o}'`).join(", "))}),this.localizer(s.errors),(s.errors??[]).forEach(a=>{["missingProperty","property"].forEach(o=>{a.params?.[o]&&(a.params[o]=a.params[o].slice(1,-1))}),a.params?.deps&&(a.params.deps=a.params.deps.split(", ").map(o=>o.slice(1,-1)).join(", "))})),i=s.errors||void 0,s.errors=null),{errors:i,validationError:n}}validateFormData(t,r,n,s,i){const a=this.rawValidation(r,t);return pS(this,a,t,r,n,s,i,this.suppressDuplicateFiltering)}handleSchemaUpdate(t){if(this.lastSeenRootSchema===t&&this.hasRegisteredRootSchema)return;const r=t[Ue]??Vh;this.ajv.getSchema(r)===void 0?this.ajv.addSchema(t,r):je(t,this.ajv.getSchema(r)?.schema)||(this.ajv.removeSchema(r),this.ajv.addSchema(t,r)),this.lastSeenRootSchema=t,this.hasRegisteredRootSchema=!0}isValid(t,r,n){let s,i=!1;try{this.handleSchemaUpdate(n);const a=nl(t);s=a[Ue]??A0(a);let o;return o=this.ajv.getSchema(s),o===void 0&&(o=this.ajv.addSchema(a,s).getSchema(s)||this.ajv.compile(a)),i=!0,o(r)}catch(a){return console.warn("Error encountered compiling schema:",a),!i&&s!==void 0&&this.ajv.removeSchema(s),!1}}}function T1(e={},t){return new D1(e,t)}const M1=T1(),Ih=["#0ea5e9","#f97316","#22c55e","#a855f7","#ef4444","#eab308"],$i=X.createContext(0);function yl(){const e=X.useContext($i);return{color:Ih[e%Ih.length],depth:e}}function Uc(e,t=""){if(!e||typeof e!="object")return{};const r=Array.isArray(e.examples)?e.examples[0]:void 0,n=r===void 0?{}:{"ui:placeholder":String(r)};return e.writeOnly===!0?{"ui:widget":"SecretWidget","ui:options":{secretPath:t},...n}:e.type==="boolean"?{"ui:widget":"checkbox","ui:options":{label:!1}}:e.type==="array"&&e.items?{items:Uc(e.items,t?`${t}[]`:"[]")}:e.type!=="object"||!e.properties?n:Object.fromEntries(Object.entries(e.properties).map(([s,i])=>[s,Uc(i,t?`${t}.${s}`:s)]))}function q1({id:e,disabled:t,readonly:r,options:n,placeholder:s,registry:i}){const a=n.secretPath,o=i.formContext||{},c=o.secretOperations?.[a],l=!!o.configuredSecrets?.[a],u=c?.action==="replace",m=c?.action==="clear",_=t||r;function v(S){_||o.setSecretOperation?.(a,S)}return N.jsxs("div",{className:"configuration-secret space-y-0.5",children:[N.jsxs("div",{className:"flex flex-wrap items-center gap-0.5",children:[N.jsx("span",{className:"text-[0.7rem] text-slate-500",children:m?"Will be cleared when saved":u?"Replacement pending":l?"Configured":"Not configured"}),N.jsxs("div",{className:"flex gap-0.5",children:[N.jsx("button",{type:"button",className:"button-dark text-xs",disabled:_,onClick:()=>v(u?null:{action:"replace",value:""}),children:u?"Cancel replace":"Replace"}),N.jsx("button",{type:"button",className:m?"button-dark text-xs":"button-danger text-xs",disabled:_,onClick:()=>v(m?null:{action:"clear"}),children:m?"Undo clear":"Clear"})]})]}),u?N.jsx("input",{id:e,className:"field-input w-full",type:"password",autoComplete:"new-password",value:c.value,placeholder:s||"Enter replacement value",disabled:_,onChange:S=>v({action:"replace",value:S.target.value})}):null]})}function U1({children:e,classNames:t,description:r,errors:n,help:s,hidden:i,id:a,label:o,required:c,schema:l,style:u}){return i?N.jsx("div",{className:"hidden",children:e}):l?.type==="object"||l?.type==="array"?N.jsxs("div",{className:t,style:u,children:[e,n,s]}):N.jsxs("div",{className:`${t||""} configuration-line`,style:u,children:[N.jsx("div",{className:"configuration-key",children:N.jsxs("label",{htmlFor:a,className:"text-xs font-semibold text-slate-100",children:[o,c?N.jsx("span",{className:"ml-0.25 text-sky-300",children:"*"}):null]})}),N.jsxs("div",{className:"configuration-value",children:[r?N.jsx("div",{className:"configuration-value-description",children:r}):null,e,n,s]})]})}function L1({description:e,fieldPathId:t,properties:r,title:n}){const i=r.filter(c=>!c.hidden).map(c=>c.content),a=t.path.length===1,o=yl();return t.path.length===0?N.jsxs("div",{children:[e?N.jsx("div",{className:"configuration-root-description",children:e}):null,N.jsx($i.Provider,{value:0,children:N.jsx("div",{className:"configuration-tree",children:i})})]}):typeof t.path.at(-1)=="number"?N.jsxs("div",{children:[e?N.jsx("div",{className:"configuration-item-description",children:e}):null,i]}):N.jsxs(Ze,{title:n,color:o.color,clipOverflow:!1,className:`configuration-card${a?" configuration-top-level-card":""}`,bodyClassName:"configuration-card-body",children:[e?N.jsx("div",{className:"configuration-branch-description",children:e}):null,N.jsx($i.Provider,{value:o.depth+1,children:N.jsx("div",{className:"configuration-children",children:i})})]})}function V1({buttonsProps:e,children:t,hasToolbar:r,index:n}){const s=e.disabled||e.readonly,i=yl();return N.jsxs(Ze,{title:`Item ${n+1}`,color:i.color,clipOverflow:!1,className:"configuration-card configuration-array-item",bodyClassName:"configuration-card-body",children:[r?N.jsxs("div",{className:"configuration-item-actions",children:[e.hasMoveUp||e.hasMoveDown?N.jsx("button",{type:"button",className:"button-dark text-xs",disabled:s||!e.hasMoveUp,onClick:e.onMoveUpItem,children:"Move up"}):null,e.hasMoveUp||e.hasMoveDown?N.jsx("button",{type:"button",className:"button-dark text-xs",disabled:s||!e.hasMoveDown,onClick:e.onMoveDownItem,children:"Move down"}):null,e.hasCopy?N.jsx("button",{type:"button",className:"button-dark text-xs",disabled:s,onClick:e.onCopyItem,children:"Duplicate"}):null,e.hasRemove?N.jsx("button",{type:"button",className:"button-danger text-xs",disabled:s,onClick:e.onRemoveItem,children:"Remove"}):null]}):null,N.jsx($i.Provider,{value:i.depth+1,children:N.jsx("div",{className:"configuration-children",children:t})})]})}function z1({canAdd:e,disabled:t,fieldPathId:r,items:n,onAddClick:s,readonly:i,schema:a,title:o}){const c=r.path.length===1,l=yl();return N.jsxs(Ze,{title:o,meta:`${n.length} ${n.length===1?"item":"items"}`,color:l.color,clipOverflow:!1,className:`configuration-card configuration-array${c?" configuration-top-level-card":""}`,bodyClassName:"configuration-card-body",children:[a.description?N.jsx("div",{className:"configuration-branch-description",children:a.description}):null,e?N.jsx("div",{className:"configuration-array-actions",children:N.jsx("button",{type:"button",className:"button-dark text-xs",disabled:t||i,onClick:s,children:"Add item"})}):null,N.jsx($i.Provider,{value:l.depth+1,children:N.jsx("div",{className:"configuration-children",children:n.length?n:N.jsx("p",{className:"text-xs text-slate-500",children:"No items configured."})})})]})}function B1({schema:e,value:t,onChange:r,configuredSecrets:n,secretOperations:s,setSecretOperation:i}){const a=X.useMemo(()=>Uc(e),[e]),o=X.useMemo(()=>({SecretWidget:q1}),[]),c=X.useMemo(()=>({ArrayFieldItemTemplate:V1,ArrayFieldTemplate:z1,FieldTemplate:U1,ObjectFieldTemplate:L1}),[]),l=X.useMemo(()=>({configuredSecrets:n,secretOperations:s,setSecretOperation:i}),[n,s,i]);return N.jsx("div",{className:"configuration-schema-form",children:N.jsx(Vr,{schema:e,uiSchema:a,formData:t,validator:M1,widgets:o,templates:c,formContext:l,noHtml5Validate:!0,showErrorList:!1,onChange:({formData:u})=>r(u),children:N.jsx(N.Fragment,{})})})}function dc(e){return JSON.parse(JSON.stringify(e))}function H1({snapshot:e,socket:t,runSensitive:r,onSnapshot:n,onReload:s}){const i=e?.configuration?.config,a=e?.configuration?.schema,o=e?.configuration?.revision,[c,l]=X.useState(()=>dc(i)),[u,m]=X.useState({}),[_,v]=X.useState(!1),[S,E]=X.useState(!1),[g,y]=X.useState(null),[f,C]=X.useState(""),[P,h]=X.useState(""),[b,O]=X.useState([]);X.useEffect(()=>{l(dc(i)),m({}),h(""),y(null),O([])},[o,i]);const k=X.useMemo(()=>JSON.stringify(c)!==JSON.stringify(i)||Object.keys(u).length>0,[c,u,i]),$=_||S;if(!i||!a)return N.jsx("p",{className:"surface p-1 text-sm text-red-200",children:"The configuration document is unavailable."});const M=(U,B)=>m(W=>{const Y={...W};return B?Y[U]=B:delete Y[U],Y});async function q(){v(!0),h(""),O([]);try{const U=await r(()=>Jp(t,{value:c,expectedRevision:o,secretOperations:u}));n(U.snapshot)}catch(U){h(U.message),O(U.validationErrors||[])}finally{v(!1)}}async function L(){if(!(!g||!window.confirm("Replace the current configuration with this YAML file and apply it now? Any unsaved edits will be discarded. Administrator accounts in the file will be ignored."))){E(!0),h(""),C(""),O([]);try{const B=await g.text(),W=await r(()=>Yp(t,{fileName:g.name,yaml:B,expectedRevision:o}));n(W.snapshot),C(W.ignoredAdministratorCount>0?`Configuration imported and applied. ${W.ignoredAdministratorCount} administrator entr${W.ignoredAdministratorCount===1?"y was":"ies were"} ignored.`:"Configuration imported and applied.")}catch(B){h(B.message),O(B.validationErrors||[])}finally{E(!1)}}}return N.jsxs(Ze,{title:"Configuration",meta:`revision ${o}`,clipOverflow:!1,bodyClassName:"p-0.5",children:[N.jsxs("div",{className:"configuration-toolbar sticky top-0 z-20 mb-0.5 space-y-0.5 border border-neutral-500/60 bg-neutral-900/95 p-0.5 backdrop-blur",children:[N.jsx("p",{className:"text-xs text-slate-400",children:"Saving applies the complete revision immediately and reloads each affected service."}),N.jsxs("div",{className:"flex flex-wrap gap-0.5",children:[N.jsx("button",{type:"button",className:"button-dark",disabled:$,onClick:s,children:"Reload"}),N.jsx("button",{type:"button",className:"button-dark",disabled:!k||$,onClick:()=>{l(dc(i)),m({})},children:"Reset"}),N.jsx("button",{type:"button",className:"button-dark",disabled:!k||$,onClick:q,children:_?"Applying…":"Save configuration"})]})]}),N.jsxs(Ze,{title:"Import legacy YAML",bodyClassName:"space-y-0.5 p-1 text-sm",clipOverflow:!1,children:[N.jsx("p",{className:"text-sm text-slate-300",children:"Replace this configuration from an explicitly selected legacy file. Unknown old settings and administrator accounts are ignored; current settings are validated and applied immediately."}),N.jsxs("div",{className:"flex max-w-3xl flex-col gap-0.5 md:flex-row",children:[N.jsx("input",{className:"field-input min-w-0 flex-1",type:"file",accept:".yaml,.yml,text/yaml",disabled:$,onChange:U=>y(U.target.files?.[0]||null)},o),N.jsx("button",{type:"button",className:"button-dark",disabled:$||!g,onClick:L,children:S?"Importing…":"Import selected YAML"})]})]}),e.configurationApplication?.services?.some(U=>U.status==="failed")?N.jsxs("div",{className:"mb-0.5 border border-amber-500/60 bg-amber-950/40 p-1 text-xs text-amber-100",children:[N.jsx("p",{className:"font-semibold",children:"Configuration was saved, but some services could not reload"}),N.jsx("ul",{className:"mt-0.5 list-disc space-y-0.25 pl-4",children:e.configurationApplication.services.filter(U=>U.status==="failed").map((U,B)=>N.jsxs("li",{children:[U.section,": ",U.error]},`${U.section}-${B}`))})]}):null,P?N.jsx("p",{className:"border border-red-500/60 bg-red-950/40 p-1 text-xs text-red-100",children:P}):null,f?N.jsx("p",{className:"border border-emerald-500/60 bg-emerald-950/40 p-1 text-sm text-emerald-100",children:f}):null,b.length?N.jsxs("div",{className:"border border-red-500/60 bg-red-950/40 p-1 text-xs text-red-100",children:[N.jsx("p",{className:"font-semibold",children:"Configuration could not be saved"}),N.jsx("ul",{className:"mt-0.5 list-disc space-y-0.25 pl-4",children:b.map((U,B)=>N.jsxs("li",{children:[U.path,": ",U.message]},`${U.path}-${B}`))})]}):null,N.jsx(B1,{schema:a,value:c,onChange:l,configuredSecrets:e.configuration.configuredSecrets,secretOperations:u,setSecretOperation:M})]})}function K1({open:e,busy:t,error:r,onCancel:n,onConfirm:s}){const[i,a]=X.useState("");if(!e)return null;async function o(l){l.preventDefault(),await s(i),a("")}function c(){a(""),n()}return N.jsx("div",{className:"fixed inset-0 z-[1000] flex items-center justify-center bg-black/75 p-2",children:N.jsxs("form",{className:"w-full max-w-sm border border-neutral-500/70 bg-neutral-900 p-1 text-slate-100 shadow-2xl",onSubmit:o,children:[N.jsx("h2",{className:"text-base font-semibold",children:"Confirm password"}),N.jsx("p",{className:"mt-0.5 text-xs text-slate-400",children:"This sensitive action requires recent confirmation of your administrator password."}),N.jsx("input",{autoFocus:!0,autoComplete:"current-password",className:"field-input mt-1 w-full",type:"password",value:i,onChange:l=>a(l.target.value)}),r?N.jsx("p",{className:"mt-0.5 text-xs text-red-300",children:r}):null,N.jsxs("div",{className:"mt-1 flex justify-end gap-0.5",children:[N.jsx("button",{type:"button",className:"button-dark",disabled:t,onClick:c,children:"Cancel"}),N.jsx("button",{type:"submit",className:"button-dark",disabled:t||!i,children:t?"Confirming…":"Confirm"})]})]})})}const G1=[{key:"overview",label:"Overview"},{key:"fleet",label:"Fleet operations"},{key:"users",label:"Users and administrators",lockdownOnly:!0},{key:"configuration",label:"Configuration",lockdownOnly:!0},{key:"backup-restore",label:"Backup and restore",lockdownOnly:!0}];function Y1(){Ip({identitySurface:"passive"});const e=Rh(),t=Nl(U=>U.session?.role||"user"),r=Nl(U=>U.connected),[n,s]=Rp(),i=n.get("section")||"overview",[a,o]=X.useState(null),[c,l]=X.useState(""),u=X.useRef(null),[m,_]=X.useState(!1),[v,S]=X.useState(!1),[E,g]=X.useState(""),{value:y}=$p("page",{backgroundTheme:Fp}),f=Dp(y?.backgroundTheme),C=t==="admin"||t==="lockdown",P=t==="lockdown",h=X.useCallback(async()=>{if(!P){o(null);return}l("");try{o(await Xp(e))}catch(U){l(U.message)}},[P,e]);X.useEffect(()=>{h()},[h,r]);const b=X.useCallback(async U=>{try{return await U()}catch(B){if(B.code!=="PASSWORD_CONFIRMATION_REQUIRED")throw B;return new Promise((W,Y)=>{u.current={operation:U,resolve:W,reject:Y},g(""),_(!0)})}},[]);async function O(U){S(!0),g("");try{await Zp(e,U);const B=u.current;if(u.current=null,_(!1),B)try{B.resolve(await B.operation())}catch(W){B.reject(W)}}catch(B){g(B.message)}finally{S(!1)}}function k(){const U=u.current;u.current=null,_(!1),U&&U.reject(new Error("Sensitive action cancelled."))}function $(U){s(U==="overview"?{}:{section:U})}const M=G1.filter(U=>!U.lockdownOnly||P),q=M.some(U=>U.key===i)?i:"overview";let L;return C?q==="fleet"?L=N.jsx(qp,{}):P?a?q==="users"?L=N.jsxs("div",{className:"space-y-0.5",children:[N.jsx(Cy,{administrators:a.administrators,socket:e,runSensitive:b,onSnapshot:o}),N.jsx(Sy,{})]}):q==="configuration"?L=N.jsx(H1,{snapshot:a,socket:e,runSensitive:b,onSnapshot:o,onReload:h}):q==="backup-restore"?L=N.jsx(xy,{socket:e,runSensitive:b}):L=N.jsx(Ey,{snapshot:a,socket:e,runSensitive:b,onSnapshot:o}):L=N.jsx(Ze,{title:"Loading administration",bodyClassName:"p-1 text-sm text-slate-300",children:N.jsx("p",{children:c||"Loading configuration and audit state…"})}):L=N.jsx(Ze,{title:"Administrator access",bodyClassName:"p-1 text-sm text-slate-300",children:N.jsx("p",{children:"Routine fleet operations are available. Configuration, users, secrets, and system administration require a lockdown administrator."})}):L=N.jsx("div",{className:"mx-auto w-full max-w-md",children:N.jsx(Mp,{})}),N.jsxs("div",{className:`${f} min-h-screen text-slate-100`,children:[N.jsx(Tp,{}),N.jsx(K1,{open:m,busy:v,error:E,onCancel:k,onConfirm:O}),N.jsxs("main",{className:"mx-auto min-h-screen w-full max-w-[100rem] p-1",children:[N.jsx(Ze,{title:"MultiRover administration",meta:r?t:"offline",bodyClassName:"p-0.5 text-xs text-slate-400",children:N.jsx("p",{children:a?`Active configuration revision ${a.configuration.revision}. The running application has applied revision ${a.appliedRevision}.`:"Central server administration and configuration."})}),C?N.jsxs($h,{currentTab:q,onTabChange:$,children:[N.jsx("nav",{"aria-label":"Administration sections",children:N.jsx(Fh,{className:"my-0.5",children:M.map(U=>N.jsx(Kn,{id:U.key,children:U.label},U.key))})}),N.jsx(Dh,{children:N.jsx("section",{className:"min-w-0",children:L})})]}):N.jsx("section",{className:"mt-0.5 min-w-0",children:L})]})]})}export{Y1 as default};
//# sourceMappingURL=AdminApp-Dcx9Tr8a.js.map