import{e as jh,r as Z,j as R,C as mt,T as kh,f as Ih,h as Kn,k as Nh,l as hs,L as Pl,g as $s,u as jp,a as Ol,m as kp,b as Ip,D as Np,c as Rp,S as $p,A as Fp,n as Dp}from"./index-DA_yf5GI.js";import{c as Tp,d as Mp,u as qp,r as Up,a as Lp,g as Vp,b as zp}from"./api-C0PIt_OP.js";function br(e,t,r={}){return new Promise((n,i)=>{e.emit(t,r,(s={})=>{if(s.error){i(new Error(s.error));return}n(s)})})}function Bp(e){return br(e,"identityAdmin:listUsers")}function jl(e,t){return br(e,"identityAdmin:getUser",{userId:t})}function Hp(e,t,r,n){return br(e,"identityAdmin:addSignal",{userId:t,type:r,value:n})}function Kp(e,t,r,n){return br(e,"identityAdmin:removeSignal",{userId:t,type:r,value:n})}function Gp(e,t,r){return br(e,"identityAdmin:setVerified",{userId:t,enabled:r})}function Wp(e,t,r,n){return br(e,"identityAdmin:setDeterrence",{userId:t,enabled:r,reason:n})}function Jp(e,t,r){return br(e,"identityAdmin:setMuted",{userId:t,enabled:r})}function Yp(e,t,r,n){return br(e,"identityAdmin:setPermission",{userId:t,permissionKey:r,enabled:n})}function Xp(e,t,r,n){return br(e,"identityAdmin:updateFeatureState",{userId:t,namespace:r,value:n})}function Zp(e,t,r){return br(e,"identityAdmin:deleteFeatureState",{userId:t,namespace:r})}const dc={cookieUserId:"Cookie keys",fingerprintId:"Fingerprints",nickname:"Nicknames",knownIp:"Known IPs"},Qp={cookieUserId:"cookieUserIds",fingerprintId:"fingerprintIds",nickname:"nicknames",knownIp:"knownIps"};function kl(e){const t=String(e||"").trim();return t?t.length<=14?t:`${t.slice(0,8)}...${t.slice(-6)}`:"n/a"}function Oa(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 ey(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(i=>i.key)].join(" ").toLowerCase().includes(r):!0}function ty(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 fc(e){return JSON.stringify(e??{},null,2)}function ry(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 ny=[{key:"all",label:"All"},{key:"verified",label:"Verified"},{key:"deterred",label:"Deterred"},{key:"muted",label:"Muted"},{key:"unverified",label:"Unverified"}];function go({active:e,children:t}){return R.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 sy({users:e,selectedUserId:t,query:r,filter:n,loading:i,onQuery:s,onFilter:a,onRefresh:o,onSelect:c}){const l=Z.useMemo(()=>e.filter(m=>ty(m,n)&&ey(m,r)),[n,r,e]),u=R.jsx("button",{type:"button",className:"button-dark text-xs",onClick:o,disabled:i,children:i?"Loading":"Refresh"});return R.jsxs(mt,{title:"Identity database",meta:l.length,actions:u,bodyClassName:"flex min-h-0 flex-col gap-0.5 p-0.5 text-sm",children:[R.jsxs("div",{className:"grid gap-0.5 md:grid-cols-[minmax(0,1fr)_10rem]",children:[R.jsx("input",{className:"field-input text-sm",type:"search",placeholder:"Search users, keys, fingerprints, IPs",value:r,onChange:m=>s(m.target.value)}),R.jsx("select",{className:"field-input text-sm",value:n,onChange:m=>a(m.target.value),children:ny.map(m=>R.jsx("option",{value:m.key,children:m.label},m.key))})]}),R.jsx("div",{className:"min-h-[18rem] flex-1 overflow-y-auto",children:l.length?l.map(m=>R.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:[R.jsxs("span",{className:"min-w-0",children:[R.jsx("span",{className:"block truncate text-sm font-semibold text-slate-100",children:m.nickname||"unknown user"}),R.jsx("span",{className:"block truncate font-mono text-[0.68rem] text-slate-400",children:m.id}),R.jsxs("span",{className:"block truncate text-[0.68rem] text-slate-400",children:[kl(m.cookieUserIds?.[0])," / ",kl(m.fingerprintIds?.[0])]})]}),R.jsxs("span",{className:"flex flex-col items-end gap-0.25",children:[R.jsx(go,{active:m.verified?.enabled,children:"verified"}),R.jsx(go,{active:m.deterrence?.enabled,children:"deterred"}),R.jsx(go,{active:m.deterrence?.muted,children:"muted"})]})]},m.id)):R.jsx("p",{className:"surface p-1 text-center text-xs text-slate-400",children:"No users match this view."})})]})}function iy({user:e}){return R.jsxs(mt,{title:"User details",bodyClassName:"grid gap-0.5 p-0.5 text-sm md:grid-cols-2",children:[R.jsxs("div",{className:"surface px-1 py-0.75",children:[R.jsx("p",{className:"text-xs text-slate-400",children:"Canonical user id"}),R.jsx("p",{className:"break-all font-mono text-xs text-lime-300",children:e.id})]}),R.jsxs("div",{className:"surface px-1 py-0.75",children:[R.jsx("p",{className:"text-xs text-slate-400",children:"Primary nickname"}),R.jsx("p",{className:"font-semibold text-slate-100",children:e.nickname||"unknown user"})]}),R.jsxs("div",{className:"surface px-1 py-0.75",children:[R.jsx("p",{className:"text-xs text-slate-400",children:"Created"}),R.jsx("p",{children:Oa(e.createdAt)})]}),R.jsxs("div",{className:"surface px-1 py-0.75",children:[R.jsx("p",{className:"text-xs text-slate-400",children:"Last seen"}),R.jsx("p",{children:Oa(e.lastSeenAt)})]})]})}function ay({user:e,type:t,onAdd:r,onRemove:n}){const[i,s]=Z.useState(""),a=e?.[Qp[t]]||[],o=async c=>{c.preventDefault();const l=i.trim();l&&(await r(t,l),s(""))};return R.jsxs("div",{className:"surface space-y-0.5 px-1 py-0.75",children:[R.jsx("p",{className:"text-xs font-semibold text-slate-200",children:dc[t]}),R.jsx("div",{className:"space-y-0.5",children:a.length?a.map(c=>R.jsxs("div",{className:"surface-muted grid grid-cols-[minmax(0,1fr)_auto] items-center gap-0.5 px-1 py-0.5",children:[R.jsx("span",{className:"min-w-0 break-all font-mono text-[0.7rem] text-slate-200",children:c}),R.jsx("button",{type:"button",className:"button-dark text-xs",onClick:()=>n(t,c),children:"Remove"})]},c)):R.jsx("p",{className:"text-xs text-slate-500",children:"No values."})}),R.jsxs("form",{className:"grid gap-0.5 md:grid-cols-[minmax(0,1fr)_auto]",onSubmit:o,children:[R.jsx("input",{className:"field-input text-xs",value:i,placeholder:`Add ${dc[t].toLowerCase()}`,onChange:c=>s(c.target.value)}),R.jsx("button",{type:"submit",className:"button-dark text-xs",disabled:!i.trim(),children:"Add"})]})]})}function oy({user:e,onAddSignal:t,onRemoveSignal:r}){return R.jsx(mt,{title:"Identity signals",bodyClassName:"grid gap-0.5 p-0.5 text-sm xl:grid-cols-2",children:Object.keys(dc).map(n=>R.jsx(ay,{user:e,type:n,onAdd:t,onRemove:r},n))})}function cy({user:e,onVerified:t,onDeterrence:r,onMuted:n}){const[i,s]=Z.useState(e?.deterrence?.reason||"");return R.jsxs(mt,{title:"Status",bodyClassName:"grid gap-0.5 p-0.5 text-sm md:grid-cols-2",children:[R.jsxs("div",{className:"surface space-y-0.5 px-1 py-0.75",children:[R.jsx("p",{className:"text-xs text-slate-400",children:"Verification"}),R.jsxs("label",{className:"flex items-center gap-0.5 text-slate-100",children:[R.jsx("input",{type:"checkbox",className:"h-3.5 w-3.5 accent-emerald-500",checked:!!e?.verified?.enabled,onChange:a=>t(a.target.checked)}),R.jsx("span",{children:"Verified"})]}),R.jsxs("p",{className:"text-xs text-slate-500",children:["Updated ",Oa(e?.verified?.at)]})]}),R.jsxs("div",{className:"surface space-y-0.5 px-1 py-0.75",children:[R.jsx("p",{className:"text-xs text-slate-400",children:"Deterrence"}),R.jsxs("label",{className:"flex items-center gap-0.5 text-slate-100",children:[R.jsx("input",{type:"checkbox",className:"h-3.5 w-3.5 accent-red-500",checked:!!e?.deterrence?.enabled,onChange:a=>r(a.target.checked,i)}),R.jsx("span",{children:"Deterred"})]}),R.jsx("textarea",{className:"field-input min-h-[4rem] w-full text-xs",value:i,placeholder:"Deterrence reason",onChange:a=>s(a.target.value)}),R.jsx("button",{type:"button",className:"button-dark text-xs",onClick:()=>r(!!e?.deterrence?.enabled,i),children:"Save Reason"}),R.jsxs("div",{className:"border-t border-slate-700/70 pt-0.5",children:[R.jsxs("label",{className:"flex items-center gap-0.5 text-slate-100",children:[R.jsx("input",{type:"checkbox",className:"h-3.5 w-3.5 accent-amber-500",checked:!!e?.deterrence?.muted,onChange:a=>n(a.target.checked)}),R.jsx("span",{children:"Muted"})]}),R.jsxs("p",{className:"text-xs text-slate-500",children:["Updated ",Oa(e?.deterrence?.mutedAt)]})]})]})]})}function ly({user:e,onSaveFeature:t,onDeleteFeature:r}){const n=Object.keys(e?.features||{}).sort(),i=n[0]||"",[s,a]=Z.useState(i),[o,c]=Z.useState(fc(i?e.features[i]:{})),[l,u]=Z.useState(""),m=async()=>{const v=s.trim();if(!v){u("Namespace required.");return}try{const S=ry(o);await t(v,S),u("")}catch(S){u(S.message||"Invalid JSON.")}},_=async()=>{const v=s.trim();v&&window.confirm(`Delete feature state "${v}" from ${e.id}?`)&&(await r(v),a(""),c("{}"),u(""))};return R.jsxs(mt,{title:"Feature state",bodyClassName:"space-y-0.5 p-0.5 text-sm",children:[R.jsxs("div",{className:"grid gap-0.5 md:grid-cols-[minmax(0,1fr)_auto_auto]",children:[R.jsx("input",{className:"field-input text-sm",value:s,placeholder:"Namespace",list:"identity-feature-namespaces",onChange:v=>{const S=v.target.value;a(S),c(fc(e.features?.[S]||{}))}}),R.jsx("datalist",{id:"identity-feature-namespaces",children:n.map(v=>R.jsx("option",{value:v},v))}),R.jsx("button",{type:"button",className:"button-dark text-xs",onClick:m,children:"Save"}),R.jsx("button",{type:"button",className:"button-dark text-xs",onClick:_,disabled:!s.trim(),children:"Delete"})]}),R.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?R.jsx("p",{className:"surface text-xs text-red-300",children:l}):null]})}function uy({user:e}){return R.jsx(mt,{title:"Raw record",bodyClassName:"p-0.5 text-xs",children:R.jsx("pre",{className:"surface max-h-[36rem] overflow-auto whitespace-pre-wrap break-words font-mono text-[0.7rem] text-lime-300",children:fc(e)})})}function dy({user:e,permissions:t,onPermission:r}){const n=new Set((e?.permissions||[]).map(i=>i.key));return R.jsx(mt,{title:"Permissions",bodyClassName:"grid gap-0.5 p-0.5 text-sm md:grid-cols-2",children:t.map(i=>R.jsxs("label",{className:"surface space-y-0.5 px-1 py-0.75 text-slate-100",children:[R.jsxs("span",{className:"flex items-center gap-0.5 font-semibold",children:[R.jsx("input",{type:"checkbox",className:"h-3.5 w-3.5 accent-emerald-500",checked:n.has(i.key),onChange:s=>r(i.key,s.target.checked)}),i.label]}),R.jsx("span",{className:"block text-xs text-slate-400",children:i.description}),R.jsx("code",{className:"block text-[0.68rem] text-lime-300",children:i.key})]},i.key))})}function fy(){const e=jh(),[t,r]=Z.useState([]),[n,i]=Z.useState([]),[s,a]=Z.useState(null),[o,c]=Z.useState(""),[l,u]=Z.useState("all"),[m,_]=Z.useState(!1),[v,S]=Z.useState(""),E=Z.useCallback(async()=>{_(!0);try{const q=await Bp(e);if(r(q.users||[]),i(q.permissions||[]),s?.id){const U=await jl(e,s.id);a(U.user||null)}S("")}catch(q){S(q.message||"Failed to load users.")}finally{_(!1)}},[s?.id,e]),g=Z.useCallback(async q=>{_(!0);try{const U=await jl(e,q);a(U.user||null),S("")}catch(U){S(U.message||"Failed to load user.")}finally{_(!1)}},[e]),y=Z.useCallback(q=>{a(q||null),q?.id&&r(U=>U.map(L=>L.id===q.id?{...L,...q}:L))},[]),f=Z.useCallback(async(q,U)=>{if(s?.id){_(!0);try{const L=await q(s.id);y(L.user),S(U||"Saved.")}catch(L){S(L.message||"Save failed.")}finally{_(!1)}}},[y,s?.id]);Z.useEffect(()=>{E()},[]);const C=(q,U)=>f(L=>Hp(e,L,q,U),"Signal added."),P=(q,U)=>f(L=>Kp(e,L,q,U),"Signal removed."),h=q=>f(U=>Gp(e,U,q),"Verification updated."),b=(q,U)=>f(L=>Wp(e,L,q,U),"Deterrence updated."),O=q=>f(U=>Jp(e,U,q),"Mute updated."),k=(q,U)=>f(L=>Yp(e,L,q,U),"Permission updated."),$=(q,U)=>f(L=>Xp(e,L,q,U),"Feature state saved."),M=q=>f(U=>Zp(e,U,q),"Feature state deleted.");return R.jsxs("div",{className:"grid min-h-0 flex-1 gap-0.5 lg:grid-cols-[24rem_minmax(0,1fr)]",children:[R.jsx(sy,{users:t,selectedUserId:s?.id||null,query:o,filter:l,loading:m,onQuery:c,onFilter:u,onRefresh:E,onSelect:g}),R.jsxs("div",{className:"min-h-0 space-y-0.5 overflow-y-auto",children:[v?R.jsx(mt,{title:"Status",bodyClassName:"p-0.5 text-sm text-slate-200",children:R.jsx("p",{children:v})}):null,s?R.jsxs(R.Fragment,{children:[R.jsx(iy,{user:s}),R.jsxs(kh,{defaultTab:"signals",children:[R.jsxs(Ih,{children:[R.jsx(Kn,{id:"signals",children:"Signals"}),R.jsx(Kn,{id:"status",children:"Status"}),R.jsx(Kn,{id:"permissions",children:"Permissions"}),R.jsx(Kn,{id:"features",children:"Feature state"}),R.jsx(Kn,{id:"raw",children:"Raw JSON"})]}),R.jsxs(Nh,{children:[R.jsx(hs,{id:"signals",children:R.jsx(oy,{user:s,onAddSignal:C,onRemoveSignal:P})}),R.jsx(hs,{id:"status",children:R.jsx(cy,{user:s,onVerified:h,onDeterrence:b,onMuted:O},`status-${s.id}`)}),R.jsx(hs,{id:"permissions",children:R.jsx(dy,{user:s,permissions:n,onPermission:k})}),R.jsx(hs,{id:"features",children:R.jsx(ly,{user:s,onSaveFeature:$,onDeleteFeature:M},`features-${s.id}`)}),R.jsx(hs,{id:"raw",children:R.jsx(uy,{user:s})})]})]})]}):R.jsx(mt,{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 hy({administrator:e,socket:t,runSensitive:r,onSnapshot:n}){const[i,s]=Z.useState({username:e.username,discordId:e.discordId,role:e.role,password:""}),[a,o]=Z.useState(!1),[c,l]=Z.useState("");Z.useEffect(()=>{s({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 R.jsxs("div",{className:"surface space-y-0.5 p-0.5",children:[R.jsxs("div",{className:"grid gap-0.5 md:grid-cols-4",children:[R.jsx("input",{className:"field-input",value:i.username,onChange:m=>s({...i,username:m.target.value})}),R.jsx("input",{className:"field-input",placeholder:"Discord id",value:i.discordId,onChange:m=>s({...i,discordId:m.target.value})}),R.jsxs("select",{className:"field-input",value:i.role,onChange:m=>s({...i,role:m.target.value}),children:[R.jsx("option",{value:"admin",children:"Administrator"}),R.jsx("option",{value:"lockdown",children:"Lockdown administrator"})]}),R.jsx("input",{className:"field-input",type:"password",autoComplete:"new-password",placeholder:"New password (optional)",value:i.password,onChange:m=>s({...i,password:m.target.value})})]}),c?R.jsx("p",{className:"text-xs text-red-300",children:c}):null,R.jsxs("div",{className:"flex justify-end gap-0.5",children:[R.jsx("button",{type:"button",className:"button-danger text-xs",disabled:a,onClick:()=>u(()=>Mp(t,e.id)),children:"Delete"}),R.jsx("button",{type:"button",className:"button-dark text-xs",disabled:a,onClick:()=>u(()=>qp(t,{id:e.id,...i})),children:"Save account"})]})]})}function my({administrators:e,socket:t,runSensitive:r,onSnapshot:n}){const[i,s]=Z.useState({username:"",discordId:"",role:"admin",password:""}),[a,o]=Z.useState(!1),[c,l]=Z.useState("");async function u(m){m.preventDefault(),o(!0),l("");try{const _=await r(()=>Tp(t,i));n(_.snapshot),s({username:"",discordId:"",role:"admin",password:""})}catch(_){l(_.message)}finally{o(!1)}}return R.jsxs(mt,{title:"Administrator accounts",meta:e.length,bodyClassName:"space-y-0.5 p-0.5 text-sm",children:[R.jsxs("form",{className:"surface grid gap-0.5 p-0.5 md:grid-cols-4",onSubmit:u,children:[R.jsx("input",{className:"field-input",placeholder:"Username",value:i.username,onChange:m=>s({...i,username:m.target.value})}),R.jsx("input",{className:"field-input",placeholder:"Discord id (optional)",value:i.discordId,onChange:m=>s({...i,discordId:m.target.value})}),R.jsxs("select",{className:"field-input",value:i.role,onChange:m=>s({...i,role:m.target.value}),children:[R.jsx("option",{value:"admin",children:"Administrator"}),R.jsx("option",{value:"lockdown",children:"Lockdown administrator"})]}),R.jsx("input",{className:"field-input",type:"password",autoComplete:"new-password",placeholder:"Password",value:i.password,onChange:m=>s({...i,password:m.target.value})}),c?R.jsx("p",{className:"text-xs text-red-300 md:col-span-3",children:c}):R.jsx("span",{className:"md:col-span-3"}),R.jsx("button",{className:"button-dark",type:"submit",disabled:a||!i.username||!i.password,children:a?"Creating…":"Create account"})]}),(e||[]).map(m=>R.jsx(hy,{administrator:m,socket:t,runSensitive:r,onSnapshot:n},m.id))]})}function vo(e){return Number.isFinite(Number(e))?new Date(Number(e)).toLocaleString():"unknown"}function py({snapshot:e,socket:t,runSensitive:r,onSnapshot:n}){const i=e.configuration;async function s(a){if(window.confirm(`Restore configuration revision ${a}? This creates a new active revision and requires a restart.`))try{const o=await r(()=>Up(t,{revision:a,expectedRevision:i.revision}));n(o.snapshot)}catch(o){window.alert(o.message)}}return R.jsxs("div",{className:"space-y-0.5",children:[R.jsxs(mt,{title:"Administration overview",meta:`revision ${i.revision}`,bodyClassName:"grid gap-0.5 p-0.5 md:grid-cols-3",children:[R.jsxs("div",{className:"surface p-1",children:[R.jsx("p",{className:"text-xs text-slate-400",children:"Active revision"}),R.jsx("p",{className:"text-xl font-semibold",children:i.revision})]}),R.jsxs("div",{className:"surface p-1",children:[R.jsx("p",{className:"text-xs text-slate-400",children:"Administrators"}),R.jsx("p",{className:"text-xl font-semibold",children:e.administrators.length})]}),R.jsxs("div",{className:"surface p-1",children:[R.jsx("p",{className:"text-xs text-slate-400",children:"Last configuration save"}),R.jsx("p",{className:"text-sm font-semibold",children:vo(i.createdAt)})]})]}),R.jsxs(mt,{title:"Existing administration surfaces",bodyClassName:"flex flex-wrap gap-0.5 p-0.5 text-sm",children:[R.jsx(Pl,{className:"button-dark",to:"/reports",children:"Open fleet reports"}),R.jsx(Pl,{className:"button-dark",to:"/",children:"Open driver application"})]}),R.jsx(mt,{title:"Configuration revisions",meta:e.revisions.length,bodyClassName:"max-h-64 overflow-y-auto p-0.5 text-xs",children:e.revisions.map(a=>R.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:[R.jsxs("span",{children:["#",a.revision]}),R.jsx("span",{children:vo(a.createdAt)}),R.jsx("span",{children:a.actor}),R.jsx("span",{children:a.source}),R.jsx("button",{type:"button",className:"button-dark text-xs",disabled:a.revision===i.revision,onClick:()=>s(a.revision),children:"Restore"})]},a.revision))}),R.jsx(mt,{title:"Persistent audit history",meta:e.auditEvents.length,bodyClassName:"max-h-96 overflow-y-auto p-0.5 text-xs",children:e.auditEvents.map(a=>R.jsxs("div",{className:"surface mb-0.5 grid gap-0.5 p-0.5 md:grid-cols-[10rem_10rem_1fr]",children:[R.jsx("span",{children:vo(a.createdAt)}),R.jsx("span",{children:a.actor}),R.jsx("span",{children:a.action})]},a.id))})]})}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 yy(e){return e.additionalItems===!0&&console.warn("additionalItems=true is currently not supported"),ue(e.additionalItems)}function Rh(e){const t=typeof navigator<"u"?navigator.languages:void 0;if(t)try{return new Intl.NumberFormat(t).formatToParts(1.1).find(i=>i.type==="decimal")?.value||"."}catch{}return"."}function Il(e){if(e==="")return;if(e===null)return null;const t=Rh(),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",Ne="anyOf",It="const",An="default",qc="dependencies",gy="enum",vt="__errors",Ue="$id",Uc="if",ns="items",vy="_$junk_option_schema_id$_",va="$name",Se="oneOf",hc="patternProperties",rt="properties",bo="readonly",$h="required",ja="submitButtonOptions",Je="$ref",ba=Symbol("__rjsf_ref"),Lc=Symbol("__rjsf_ref_cycle"),Es="$schema",Fh="root",Dh="_",by=["discriminator","propertyName"],Nl="formContext",_y="layoutGridLookupMap",Th="__rjsf",Vc=`${Th}_additionalProperties`,Mh=`${Th}_rootSchema`,Sy="ui:field",zc="ui:widget",Br="ui:options",mc="ui:globalOptions",wy="ui:definitions",Cy="https://json-schema.org/draft/2019-09/schema",_a="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 i=e[n];return n===zc&&ue(i)?(console.error("Setting options via ui:widget object is no longer supported, use ui:options instead"),r):n===Br&&ue(i)?{...r,...i}:{...r,[n.substring(3)]:i}},{...t}):{...t}}function Ey(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({...r,[i]:pc(n)}),t):Or(e)?Object.keys(e).reduce((r,n)=>({...r,[n]:pc(e[n])}),t):t}const{getOwnPropertyNames:Rl,getOwnPropertySymbols:Ay}=Object,{hasOwnProperty:xy}=Object.prototype;function ms(e,t){return function(n,i,s){return e(n,i,s)&&t(n,i,s)}}function ps(e){return function(r,n,i){if(!r||!n||typeof r!="object"||typeof n!="object")return e(r,n,i);const{cache:s}=i,a=s.get(r),o=s.get(n);if(a&&o)return a===n&&o===r;s.set(r,n),s.set(n,r);const c=e(r,n,i);return s.delete(r),s.delete(n),c}}function $l(e){const t=Ay(e);return t.length?Rl(e).concat(t):Rl(e)}const Py=Object.hasOwn||((e,t)=>xy.call(e,t)),Oy="__v",jy="__o",ky="_owner",Iy=typeof Float16Array<"u",{getOwnPropertyDescriptor:Fl,keys:Dl}=Object,Nn=Object.is||function(t,r){return t===r?t!==0||1/t===1/r:t!==t&&r!==r};function Ny(e,t){return e===t}function Ry(e,t){return e.byteLength===t.byteLength&&ka(new Uint8Array(e),new Uint8Array(t))}function $y(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 Fy(e,t){return e.byteLength===t.byteLength&&ka(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function Dy(e,t){return Nn(e.getTime(),t.getTime())}function Tl(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 Ml(e,t,r){const n=e.size;if(n!==t.size)return!1;if(!n)return!0;const i=new Uint8Array(n),s=e.entries();let a,o,c=0;for(;(a=s.next())&&!a.done;){const l=t.entries();let u=0,m=0;for(;(o=l.next())&&!o.done;){if(i[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=i[m]=1;break}m++}if(!u)return!1;c++}return!0}function ql(e,t,r){const n=Dl(e);let i=n.length;if(Dl(t).length!==i)return!1;for(;i-- >0;)if(!qh(e,t,r,n[i]))return!1;return!0}function qn(e,t,r){const n=$l(e);let i=n.length;if($l(t).length!==i)return!1;let s,a,o;for(;i-- >0;)if(s=n[i],!qh(e,t,r,s)||(a=Fl(e,s),o=Fl(t,s),(a||o)&&(!a||!o||a.configurable!==o.configurable||a.enumerable!==o.enumerable||a.writable!==o.writable)))return!1;return!0}function Ty(e,t){return Nn(e.valueOf(),t.valueOf())}function My(e,t){return e.source===t.source&&e.flags===t.flags}function Ul(e,t,r){const n=e.size;if(n!==t.size)return!1;if(!n)return!0;const i=new Uint8Array(n),s=e.values();let a,o;for(;(a=s.next())&&!a.done;){const c=t.values();let l=0,u=0;for(;(o=c.next())&&!o.done;){if(!i[u]&&r.equals(a.value,o.value,a.value,o.value,e,t,r)){l=i[u]=1;break}u++}if(!l)return!1}return!0}function ka(e,t){let r=e.length;if(t.length!==r||e.byteOffset!==t.byteOffset)return!1;if(e instanceof Float64Array||e instanceof Float32Array||Iy&&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 qy(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&&Uy(e.searchParams,t.searchParams)}function Uy(e,t){const r=e.toString(),n=t.toString();return r===n||Ll(r)===Ll(n)}function Ll(e){return e.split("&").sort().join("&")}function qh(e,t,r,n){return(n===ky||n===jy||n===Oy)&&(e.$$typeof||t.$$typeof)?!0:Py(t,n)&&r.equals(e[n],t[n],n,n,e,t,r)}const Ly=Object.prototype.toString;function Vy(e){const t=Ky(e),{areArraysEqual:r,areDatesEqual:n,areFunctionsEqual:i,areMapsEqual:s,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"?i(_,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 s(_,v,S);if(g===Set)return l(_,v,S);if(g===Promise)return!1;if(Array.isArray(_))return r(_,v,S);const y=Ly.call(_),f=t[y];if(f)return f(_,v,S);const C=u&&u(_,v,S,y);return C?C(_,v,S):!1}}function zy({circular:e,createCustomConfig:t,strict:r}){let n={areArrayBuffersEqual:Ry,areArraysEqual:r?qn:$y,areDataViewsEqual:Fy,areDatesEqual:Dy,areErrorsEqual:r?ms(Tl,qn):ms(Tl,ql),areFunctionsEqual:Ny,areMapsEqual:r?ms(Ml,qn):Ml,areNumbersEqual:Nn,areObjectsEqual:r?qn:ql,arePrimitiveWrappersEqual:Ty,areRegExpsEqual:My,areSetsEqual:r?ms(Ul,qn):Ul,areTypedArraysEqual:r?ms(ka,qn):ka,areUrlsEqual:qy,getUnsupportedCustomComparator:void 0};if(t&&(n=Object.assign({},n,t(n))),e){const i=ps(n.areArraysEqual),s=ps(n.areErrorsEqual),a=ps(n.areMapsEqual),o=ps(n.areObjectsEqual),c=ps(n.areSetsEqual);n=Object.assign({},n,{areArraysEqual:i,areErrorsEqual:s,areMapsEqual:a,areObjectsEqual:o,areSetsEqual:c})}return n}function By(e){return function(t,r,n,i,s,a,o){return e(t,r,o)}}function Hy({circular:e,comparator:t,createState:r,equals:n,strict:i}){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:i})};if(e)return function(o,c){return t(o,c,{cache:new WeakMap,equals:n,meta:void 0,strict:i})};const s={cache:void 0,equals:n,meta:void 0,strict:i};return function(o,c){return t(o,c,s)}}function Ky({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:r,areDatesEqual:n,areErrorsEqual:i,areFunctionsEqual:s,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]":s,"[object BigInt]":c,"[object BigInt64Array]":m,"[object BigUint64Array]":m,"[object Boolean]":c,"[object DataView]":r,"[object Date]":n,"[object Error]":i,"[object Float16Array]":m,"[object Float32Array]":m,"[object Float64Array]":m,"[object Function]":s,"[object GeneratorFunction]":s,"[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:()=>Nn});kr({strict:!0,createInternalComparator:()=>Nn});kr({circular:!0,createInternalComparator:()=>Nn});kr({circular:!0,createInternalComparator:()=>Nn,strict:!0});function kr(e={}){const{circular:t=!1,createInternalComparator:r,createState:n,strict:i=!1}=e,s=zy(e),a=Vy(s),o=r?r(a):By(a);return Hy({circular:t,comparator:a,createState:n,equals:o,strict:i})}const je=kr({circular:!0,createCustomConfig:()=>({areFunctionsEqual(e,t){return typeof t=="function"}})});var ys={exports:{}},_o,Vl;function Uh(){if(Vl)return _o;Vl=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),i=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),s=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=48&&x<=57||x>=65&&x<=70||x>=97&&x<=102))return"";d+=p[I];break}for(I+=1;I=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;dx&&(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=8)return;const z=T.slice(0,x.length);for(let H=F;H<8;H++)z.push("0");for(let H=x.length;Hb[I])}function M(p,d=!1){if(p.indexOf("%")===-1)return p;let x="";for(let I=0;I>4]+p[d&15]}function U(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 L(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;x57343)d+=L(T);else if(T<=56319&&x+1=56320&&F<=57343?(d+=L(65536+(T-55296<<10)+(F-56320)),x++):d+=L(65533)}else d+=L(65533)}}return d}function J(p,d=!1){let x="",I=d&&p[0]!=="/";for(let T=0;T57343)x+=L(z);else if(z<=56319&&T+1=56320&&H<=57343?(x+=L(65536+(z-55296<<10)+(H-56320)),T++):x+=L(65533)}else x+=L(65533)}}return x}function Y(p){let d="";for(let x=0;x57343)d+=L(T);else if(T<=56319&&x+1=56320&&F<=57343?(d+=L(65536+(T-55296<<10)+(F-56320)),x++):d+=L(65533)}else d+=L(65533)}}return d}function Q(p,d){let x="";for(let I=0;I57343)x+=L(F);else if(F<=56319&&I+1=56320&&z<=57343?(x+=L(65536+(F-55296<<10)+(z-56320)),I++):x+=L(65533)}else x+=L(65533)}}return x}function X(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;x57343)d+=L(T);else if(T<=56319&&x+1=56320&&F<=57343?(d+=L(65536+(T-55296<<10)+(F-56320)),x++):d+=L(65533)}else d+=L(65533)}return d}function j(p){const d=[];if(p.userinfo!==void 0&&(d.push(X(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 _o={BYTE_HEX:q,percentEncodeNonAscii:L,nonSimpleDomain:_,nonSimpleMailtoDomain:E,recomposeAuthority:j,reescapeHostDelimiters:$,normalizePercentEncoding:M,normalizePathEncoding:B,serializePathEncoding:J,normalizeQueryFragmentEncoding:Y,encodeUserinfo:X,encodeQuery:re,encodeFragment:A,escapePreservingEscapes:w,removeDotSegments:h,isIPv4:t,isUUID:e,normalizeIPv6:C,stringArrayToHexStripped:c},_o}var So,zl;function Gy(){if(zl)return So;zl=1;const{isUUID:e,BYTE_HEX:t,percentEncodeNonAscii:r,nonSimpleMailtoDomain:n}=Uh(),i=/^([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-./:;=@]|%[\da-f]{2})+)$/iu,s=["http","https","ws","wss","urn","urn:uuid","mailto"];function a(F){return s.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(i);if(H&&H[0]===F.path){const N=z.scheme||F.scheme||"urn";F.nid=H[1].toLowerCase(),F.nss=H[2];const D=`${N}:${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",N=F.nid.toLowerCase(),D=`${H}:${z.nid||N}`,V=T(D);V&&(F=V.serialize(F,z));const K=F,G=F.nss;return K.path=`${N||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=55296&&N<=56319&&H+1=56320&&D<=57343){z+=F[H]+F[H+1],H++;continue}}z+=N>=55296&&N<=57343?"�":F[H]}return z}function A(F,z){if(z.all.test(F))return F;const H=z.table;let N="";for(let D=0;D57343){N+=z.allowNonAscii?F[D]:r(V);continue}if(V<=56319&&D+1=56320&&K<=57343){N+=z.allowNonAscii?F[D]+F[D+1]:r(65536+(V-55296<<10)+(K-56320)),D++;continue}}N+=z.allowNonAscii?"�":r(65533)}return N}function w(F,z,H){const N=String(F).toLowerCase();if(J.test(N)||N!==""&&!n(N))return N;try{const D=new URL("http://"+N);if(D.username||D.password||D.port||D.pathname!=="/"||D.search||D.hash||!D.hostname)throw new Error(Y);return z&&z.unicodeSupport?N:D.hostname}catch{return H&&(H.error=H.error||Y),N}}function j(F,z){const H=z&&z.unicodeSupport?L:U;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 N=H.path,D=H.query;N&&Q.test(N)&&(N=re(N)),D&&Q.test(D)&&(D=re(D));const V=N?N.indexOf(",")===-1?[N]:N.split(","):[];if(H.path=void 0,D){let K=null,G=0;for(;G<=D.length;){let W=D.indexOf("&",G);W===-1&&(W=D.length);const te=D.slice(G,W);G=W+1;const ne=te.indexOf("=");if(ne!==te.lastIndexOf("=")){H.error=H.error||"URI mailto has malformed header fields.";continue}const ie=ne===-1?te:te.slice(0,ne),ce=ne===-1?"":te.slice(ne+1);if(ie==="to"){const he=ce.split(",");for(let le=0;le=0?W.slice(0,te):W,ie=te>=0?W.slice(te+1):"",ce=A(ne,M),he=X(ie),le=w(he,z);N[G]=ce+"@"+j(le,z)}H.path=N.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 So={wsIsSecure:o,SCHEMES:I,isValidSchemeName:a,getSchemeHandler:T},So}var Bl;function Wy(){if(Bl)return ys.exports;Bl=1;const{normalizeIPv6:e,removeDotSegments:t,recomposeAuthority:r,normalizePercentEncoding:n,normalizePathEncoding:i,serializePathEncoding:s,normalizeQueryFragmentEncoding:a,encodeQuery:o,encodeFragment:c,reescapeHostDelimiters:l,isIPv4:u,nonSimpleDomain:m}=Uh(),{SCHEMES:_,getSchemeHandler:v}=Gy(),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=J(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:N,malformedPercentEncoding:D,malformedSchemeSpecific:V,malformedHost:K,malformedScheme:G}=B(w,p);if(x||N||I||D||T||V||F||K||z||G)throw new Error(d.error||H.error||"URI is malformed.");const W=C(d,H,p,!0),te=v(j&&j.scheme||W.scheme),ne=W.host,ie=ne!==void 0&&ne!==""&&(u(ne)||e(ne).isIPV6);L(W,j||{},te,ie);const ce=ne&&ne.indexOf("%")!==-1&&!new RegExp("\\P{ASCII}","u").test(ne);if(W.error&&!ce)throw new Error(W.error);return p.skipEscape=!0,h(W,p)}function C(A,w,j,p){const d={};return p||(A=J(h(A,j),j),w=J(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=X(A,j),d=X(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=s(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=s(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 U(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 L(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 N=A.match(O);N!==null&&N[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 W=unescape(p.scheme);S.test(W)?p.scheme=W.toLowerCase():(p.error=p.error||E,z=!0)}x=U(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,ie=e(p.host);H=ie.isIPV6||ie.isIPVFuture===!0,F=ne&&(!te||ie.error===!0),p.host=H?ie.host:ie.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=L(p,j,G,H)),!G||G&&!G.skipNormalize){if(A.indexOf("%")!==-1&&p.host!==void 0&&!F){const W=H?p.host:n(p.host,!0);p.host=l(W,H)}p.path&&(p.path=i(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 J(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 X(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:J};return ys.exports=re,ys.exports.default=re,ys.exports.fastUri=re,ys.exports}var Jy=Wy();const Bc=$s(Jy);var gs={},Hl;function Yy(){if(Hl)return gs;Hl=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 i(l,u,m){for(var _,v,S=1,E=u.length;SS,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 s(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=s(u);var m=u.length;if(m===1)return l;for(var _=1;_ue(a)?yc(a,r):a)}:ue(s)&&(n={...n,[i]:yc(s,r)});return n}function Hc(e,t){const{[e]:r,...n}=t;return[n,r]}function Lh(e,t={},r=[],n=t[Ue]){const i=e||"";let s,a=n;if(i.startsWith("#")){const c=decodeURIComponent(i.substring(1));a===void 0||Ue in t&&t[Ue]===a?s=wo.get(t,c):t[Es]===_a&&(s=Ia(t,a.replace(/\/$/,"")),s!==void 0&&(s=wo.get(s,c)))}else if(t[Es]===_a){const c=a?Bc.resolve(a,i):i,[l,...u]=c.replace(/#\/?$/,"").split("#");s=Ia(t,l.replace(/\/$/,"")),s!==void 0&&(a=s[Ue],u.length>0&&(s=wo.get(s,decodeURIComponent(u.join("#")))))}if(s===void 0)throw new Error(`Could not find a definition for ${e}.`);const o=s[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=[..._,i,m].join(" -> ");throw new Error(`Definition for ${m} contains a circular reference through ${v}`)}const[c,l]=Hc(Je,s),u=Lh(l,t,[...r,i],a);return Object.keys(c).length>0?t[Es]===Cy||t[Es]===_a?{[yr]:[c,u]}:{...c,...u}:u}return s}function ks(e,t={},r=t[Ue]){return Lh(e,t,[],r)}const Zy=/^(?:0|[1-9]\d*)$/;function rr(e){return e.split(/[.[\]]+/).filter(Boolean)}function Qy(e){return Array.isArray(e)?e:[e]}function Kl(e){return e==="__proto__"}function eg(e){return typeof e=="number"?Number.isInteger(e)&&e>=0:Zy.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 i=0;i0}function tg(e,t){const r=Qy(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,by);return typeof r=="string"?t=r:r!==void 0&&console.warn(`Expecting discriminator to be a string, got "${typeof r}" instead`),t}function Is(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?Is(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((i,s)=>{const a=e?e[s]:{},o=t[s];return e&&s in e&&ue(o)?i[s]=jr(a,o):e&&t&&(Gt(e)==="object"||Gt(t)==="object")&&s===$h&&Array.isArray(a)&&Array.isArray(o)?i[s]=[...new Set([...a,...o])]:i[s]=o,i},r);for(const i of Object.getOwnPropertySymbols(t))n[i]=t[i];return n}function gr(e,t){return e?.[rt]?.[t]??{}}function Vh(e,t,r){if(e&&r){const n=me(e,r);if(n===void 0)return;for(let i=0;i({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 rg=Object.prototype;function As(e){for(const t in e)if(rg.hasOwnProperty.call(e,t))return!1;return!0}const ng=["array","boolean","integer","null","number","object","string"];new Set(ng);const sg=["$defs","definitions","properties","patternProperties","dependencies"];new Set(sg);const ig=["items","allOf","oneOf","anyOf"];new Set(ig);const ag=["items","additionalItems","additionalProperties","propertyNames","contains","if","then","else","not"];new Set(ag);function Sa(e){return typeof e=="object"}function ur(e){return Sa(e)?As(e):e===!0}function Yn(e,t){return et?1:0}function Co(e,t){const r=e.length;if(r===0)return t;let n=t.length;if(n===0)return e;if(rt.length){const i=e;e=t,t=i}const n=new Set(t);for(let i=0;i0;i++){const s=e[i];n.delete(s)&&r.push(s)}return r}function Gl(e){return e.length===0}function Eo(e){return(t,r)=>{const n=t.length-r.length;if(n!==0)return n;for(let i=0;i{const n=r.length;if(n===0)return r;if(n<=t){const a=[];let o=0;e:for(let c=0;c{const n=[];let i=t.length,s=r.length;if(i===0||s===0)return n;if(i>s){const u=t;t=r,r=u;const m=i;i=s,s=m}const a=[...t].sort(e),o=[...r].sort(e);let c=0,l=0;for(;c{if(e.has(r))return e.get(r);const n=t(r);return e.set(r,n),n}}const Wl=lg,Bh=()=>0,ug=e=>e===void 0,dg=e=>typeof e!="object",Jl={boolean:0,number:1,string:2};function fg(e,t){const r=typeof e,n=typeof t;return r===n?Yn(e,t):Jl[r]-Jl[n]}function hg(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 i=new Set(e),s=t.length;for(let a=0;ae(n)?e(i)?r(n,i):-1:e(i)?1:t(n,i)}function Gn(e){return Ba(ug,e)}function qr(e,t){return Ba(r=>r===void 0||e(r),t)}function Ao(e,t){return Ba(Array.isArray,e,t)}const ot=Gn(Yn),xo=qr(e=>e===0,(e,t)=>e-t);function mg({deduplicationCache:e=new WeakMap,sortedKeysCache:t=new WeakMap}={}){const r=Wl(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;hg(y(f),y(C))}const s=i(Yn);function a(E,g){if(Sa(E)){if(Sa(g)){const y=Object.keys(E),f=Object.keys(g),C=hg(y,f),P=C.length;for(let h=0;hE===!1,Bh),minLength:xo,minItems:xo,minProperties:xo,required:qr(Gl,s),enum:qr(Gl,i(l)),type:Gn((E,g)=>{const y=Array.isArray(E),f=Array.isArray(g);return!y&&!f?Yn(E,g):s(y?E:[E],f?g:[g])}),items:qr(E=>!Array.isArray(E)&&ur(E),Ao(a,Eo(a))),anyOf:_,allOf:_,oneOf:_,properties:m,patternProperties:m,additionalProperties:v,additionalItems:v,dependencies:qr(As,n(Gn(Ao(a,s))))};return{compareSchemaValues:l,compareSchemaDefinitions:a}}function Yl(e){return e}const Hh=(e,t)=>e?Hh(t%e,e):t,pg=(e,t)=>Math.abs(e*t)/Hh(e,t);function yg(e,t){return e===t?e:`(?=.*(?:${e}))(?=.*(?:${t}))`}function Po(e,t,r){const n=e.length,i=t.length;if(n>0&&i>0)for(let s=0;s{const n={...t},i=Object.keys(r),s=i.length;for(let a=0;a{if(!i(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:s})}}return t}const wg=[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 Cg({mergePatterns:e=yg,isSubRegExp:t=Object.is,intersectJson:r=og,deduplicateJsonSchemaDef:n=Yl,defaultMerger:i=Yl,assigners:s=[],checks:a=wg,mergers:o}={}){function c(P){const h=P.length;let b=P[0];for(let O=1;O0&&k!==!1)if($)Object.assign(P,h);else for(let q=0;q{const q=ur(O),U=ur(M);if(q&&U)return ln(P,"properties",f(h,k)),ln(P,"patternProperties",b&&$?f(b,$):b??$),delete P.additionalProperties,P;const L=y(O,M);ln(P,"additionalProperties",L);const B={},J=Object.keys(h),Y=J.length,[Q,X]=b?Zl(b):Ql,[re,A]=$?Zl($):Ql,w=[],j=new Set,p=U?void 0:M;for(let z=0;z0&&A.length>0&&Po(X,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,X,F,M,U),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[U,L,B]=h.length{tu(P,h);const O=tu({},b);return P.allOf===void 0?P.allOf=[O]:P.allOf=P.allOf.concat(O),P};function S(P,h){const b=[];if(Po(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=gg([[vg,m],[bg,_],[_g,v],...s]),g=Sg(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{if(P===h)return P;const b=Array.isArray(P),O=Array.isArray(h);if(!b&&!O){const k=jo(P,h);if(k!==void 0)return k}else if(b||O){const k=new Set;if(b&&O)Po(P,h,(M,q)=>{const U=jo(M,q);U!==void 0&&k.add(U)});else{const M=b?P:h,q=b?h:P,U=M.length;for(let L=0;L1)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:i,description:i,title:i,const:i,format:i,contentEncoding:i,contentMediaType:i,not:(P,h)=>{const b=n([P,h]);return b.length===1?b[0]:{anyOf:b}},pattern:e,readOnly:Oo,writeOnly:Oo,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:Xl((P,h)=>Array.isArray(P)?Array.isArray(h)?Co(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 Co(P,h)},multipleOf:(P,h)=>{let b=1;for(;!Number.isInteger(P)||!Number.isInteger(h);)b*=10,P*=10,h*=10;return pg(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:Oo,required:Co,...o};return{mergeSchemaDefinitions:y,mergeArrayOfSchemaDefinitions:c}}function Eg(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:i,...s}=n;t.push(s);for(let a=i.length-1;a>=0;a--)r.push(i[a])}return t}function Ag(e){return t=>e(Eg(t))}const{compareSchemaDefinitions:xg,compareSchemaValues:Pg}=mg(),{mergeArrayOfSchemaDefinitions:Og}=Cg({intersectJson:cg(Pg),deduplicateJsonSchemaDef:zh(xg)}),Kh=Ag(Og);function bt(e,t,r={},n,i,s=!1){return hr(e,t,r,n,void 0,void 0,i,s)[0]}function Gh(e){return typeof e!="boolean"?e:e?{}:{not:{}}}function jg(e,t,r,n,i,s,a){const{if:o,then:c,else:l,...u}=t,m=e.isValid(o,s||{},r);let _=[u],v=[];if(n){if(c&&typeof c!="boolean"){const S=c;v=v.concat(hr(e,S,r,s,n,i,a))}if(l&&typeof l!="boolean"){const S=l;v=v.concat(hr(e,S,r,s,n,i,a))}}else{const S=m?c:l;if(S!==void 0){const E=Gh(S);v=v.concat(hr(e,E,r,s,n,i,a))}}return v.length&&(_=v.map(S=>jr(u,S))),_.flatMap(S=>hr(e,S,r,s,n,i,a))}function Wh(e){return e.reduce((r,n)=>n.length>1?n.flatMap(i=>r.map(s=>[...s,i])):(r.forEach(i=>i.push(n[0])),r),[[]])}function Jh(e,t){const r=e.patternProperties??{};return Object.fromEntries(Object.entries(r).filter(([n])=>RegExp(n).test(t)))}function kg(e,t,r,n,i,s,a,o){const c=Yh(e,t,r,n,i,s,a,o);if(c.length>1||c[0]!==t)return c;if(qc in t)return Zh(e,t,r,n,i,s,a).flatMap(u=>hr(e,u,r,s,n,i,a));if(yr in t&&Array.isArray(t[yr])){const l=t.allOf.map(m=>hr(e,m,r,s,n,i,a));return Wh(l).map(m=>({...t,allOf:m}))}return[t]}function Yh(e,t,r,n,i,s,a,o){const c=Hr(t,r,i,void 0,o);return c!==t?hr(e,c,r,s,n,i,a,o):[t]}function Hr(e,t,r,n,i,s=!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 s?{...a,[Lc]:!0}:a;r.push(c),a={...ks(c,t,o),...l,[ba]:c},Ue in a&&(o=a[Ue])}if(rt in a){const c=[],l={};for(const[u,m]of Object.entries(a[rt]??{})){const _=[...r];l[u]=Hr(m,t,_,o,i,!i),c.push(_)}for(const u of new Set(c.flat()))r.includes(u)||r.push(u);a={...a,[rt]:l}}if(ns in a&&!Array.isArray(a.items)&&typeof a.items!="boolean"&&(a={...a,items:Hr(a.items,t,r,o,i)}),i){let c,l;Ne in e&&Array.isArray(e[Ne])?(c=Ne,l=a[Ne]):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,i))})}return je(e,a)?e:a}function Ig(e,t,r,n,i){const s={...t,properties:{...t.properties}},a=n&&ue(n)?n:{};return Object.keys(a).forEach(o=>{if(!(o in s.properties)){if(hc in s){const c=Jh(s,o);if(Object.keys(c).length>0){s.properties[o]=bt(e,{[yr]:Object.values(c)},r,a[o],i),s.properties[o][Sn]=!0;return}}if(Jn in s&&s.additionalProperties!==!1){let c;typeof s.additionalProperties!="boolean"?Je in s.additionalProperties?c=bt(e,{[Je]:s.additionalProperties[Je]},r,a[o],i):"type"in s.additionalProperties?c={...s.additionalProperties}:Ne in s.additionalProperties||Se in s.additionalProperties?c={type:"object",...s.additionalProperties}:c={type:Is(a[o])}:c={type:Is(a[o])},s.properties[o]=c,s.properties[o][Sn]=!0}else s.properties[o]={type:"null"},s.properties[o][Sn]=!0}}),s}function Ng(e){return Kh(e)}function hr(e,t,r,n,i=!1,s=[],a,o){return ue(t)?kg(e,t,r,i,s,n,a,o).flatMap(l=>{let u=l;if(Uc in u)return jg(e,u,r,i,s,n,a);if(yr in u){if(i){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):Ng(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 rt in u&&hc in u&&(u=Object.keys(u.properties).reduce((_,v)=>{const S=Jh(_,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}})),hc in u||Jn in u&&u.additionalProperties!==!1?Ig(e,u,r,n,a):u}):[{}]}function Rg(e,t,r,n,i){let s;const{oneOf:a,anyOf:o,...c}=t;if(Array.isArray(a)?s=a:Array.isArray(o)&&(s=o),s){const l=i===void 0&&n?{}:i,u=Kt(t);s=s.map(_=>Hr(_,r,[]));const m=Na(e,l,s,r,u);if(n){const _=Xh(s,!1,r);return Na(e,l,_,r,u),s.map(v=>jr(c,v))}return[jr(c,s[m])]}return[t]}function Xh(e,t=!1,r){return e.map(n=>{if(!ue(n))return Gh(n);const i=t&&r?Hr(n,r,[]):n;return i.additionalProperties===!1?{...i,additionalProperties:!0}:i})}function Zh(e,t,r,n,i,s,a){const{dependencies:o,...c}=t;return Rg(e,c,r,n,s).flatMap(u=>Qh(e,o,u,r,n,i,s,a))}function Qh(e,t,r,n,i,s,a,o){let c=[r];for(const l in t)if((i||me(a,l)!==void 0)&&(!r.properties||l in r.properties)){const[u,m]=Hc(l,t);return Array.isArray(m)?c[0]=$g(r,m):ue(m)&&(c=Fg(e,r,n,l,m,i,s,a,o)),c.flatMap(_=>Qh(e,u,_,n,i,s,a,o))}return c}function $g(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 Fg(e,t,r,n,i,s,a,o,c){return hr(e,i,r,o,s,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]:Yh(e,g,r,s,a,o));return Wh(S).flatMap(g=>Dg(e,v,r,n,g,s,a,o,c))})}function Dg(e,t,r,n,i,s,a,o,c){const l=i.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)||s}return!1});return!s&&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,[_]=Hc(n,m.properties),v={...m,properties:_};return hr(e,v,r,o,s,a,c).map(E=>jr(t,E))})}function xs(e,t,r,n,i,s={},a){if(Array.isArray(r[i])){const c=Kt(r)||n,l=r[i].map(m=>bt(e,m,t,s,a)),u=me(s,c);if(u!==void 0)return l.find(m=>je(me(m,[rt,c,An],me(m,[rt,c,It])),u))}}function em(e,t,r,n,i){let s=r;if(ct(r,Je)&&(s=bt(e,r,t,void 0,i)),n.length===0)return s;const a=Array.isArray(n)?[...n]:rr(n),[o,...c]=a;if(o!==void 0&&o!==""&&ct(s,o))return s=me(s,o),em(e,t,s,c,i)}function wa(e,t,r,n,i,s){const a=em(e,t,r,n,s);return a===void 0?i:a}const ru={title:"!@#$_UNKNOWN_$#@!"};function Tg(e,t,r,n,i={},s){const a=Array.isArray(n)?[...n]:n.split(".");let o=r;const c=a.pop(),l=String(c);a.length&&a.forEach(v=>{o=wa(e,t,o,[rt,v],{},s),ct(o,Se)?o=xs(e,t,o,l,Se,me(i,v),s):ct(o,Ne)&&(o=xs(e,t,o,l,Ne,me(i,v),s))}),ct(o,Se)?o=xs(e,t,o,l,Se,i,s):ct(o,Ne)&&(o=xs(e,t,o,l,Ne,i,s));let u=wa(e,t,o,[rt,c],ru,s);u===ru&&(u=void 0);const m=wa(e,t,o,$h,[],s);let _;return u&&Array.isArray(m)&&(_=m.includes(l)),{field:u,isRequired:_}}const Mg={type:"object",$id:vy,properties:{__not_really_there__:{type:"number"}}};function gc(e,t,r,n,i){let s=0;return r&&(ue(r.properties)?s+=Object.entries(r.properties).reduce((a,[o,c])=>{const l=n?.[o];if(typeof c=="boolean")return a;if(ct(c,Je)){const u=bt(e,c,t,l,i);return a+gc(e,t,u,l||{},i)}if((ct(c,Se)||ct(c,Ne))&&l){const u=ct(c,Se)?Se:Ne,m=Kt(c);return a+ss(e,t,l,me(c,u),-1,m,i)}if(c.type==="object")return a+(typeof l=="object"&&l!==null?1:0)+gc(e,t,c,l,i);if(c.type===Is(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===Is(n)&&(s+=1)),s}function ss(e,t,r,n,i=-1,s,a){const o=n.map(_=>Hr(_,t,[])),c=Vh(r,n,s);if(typeof c=="number")return c;const l=o.reduce((_,v,S)=>(Na(e,r,[Mg,v],t,s)===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=gc(e,t,E,r,a);return u.add(g),g>S?{bestIndex:v,bestScore:g}:_},{bestIndex:i,bestScore:0});return u.size===1&&i>=0?i:m}function tm(e){const t=e[It],r=Gt(e);return ue(t)&&typeof t?.$data=="string"&&r!=="object"&&r!=="array"}function rm(e){return Array.isArray(e.enum)&&e.enum.length===1||It in e}function Kc(e){return Array.isArray(e.items)&&e.items.every(t=>ue(t))}function Ns(e,t,r=!1,n=!1,i=!1){if(Array.isArray(t)){const s=Array.isArray(e)?e:[],a=i?s:t,o=i?t:s,c=a.map((l,u)=>o[u]!==void 0?Ns(s[u],t[u],r,n,i):l);return(r||i)&&c.length{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]=Ns(o?.[l],u,r,n,i&&(m||!_)),s)},s)}return n&&(e!==void 0&&t==null||typeof t=="number"&&Number.isNaN(t))||i&&t!=null?e:t}function Xr(e,t,r=!1){return Object.keys(t).reduce((n,i)=>{const s=e?e[i]:{},a=t[i];if(e&&i in e&&ue(a))n[i]=Xr(s,a,r);else if(r&&Array.isArray(s)&&Array.isArray(a)){let o=a;r==="preventDuplicates"&&(o=a.reduce((c,l)=>(s.includes(l)||c.push(l),c),[])),n[i]=s.concat(o)}else n[i]=a;return n},{...e})}function qg(e){if(gy in e&&Array.isArray(e.enum)&&e.enum.length===1)return e.enum[0];if(It in e)return e.const;throw new Error("schema cannot be inferred as a constant")}function Ug(e,t){const r=new Map(e.map(s=>[String(s.value),s])),n=new Set(t.filter(s=>s!=="*").map(String)),i=e.filter(s=>!n.has(String(s.value)));return t.flatMap(s=>{if(s==="*")return i;const a=r.get(String(s));return a?[a]:[]})}function xn(e,t){if(e.enum){let s,a;if(t){const{enumNames:c,enumOrder:l}=pe(t);s=c,a=l}let o=e.enum.map((c,l)=>({label:Array.isArray(s)?s[l]||String(c):s?.[String(c)]||String(c),value:c}));return a&&(o=Ug(o,a)),o}let r,n;e.anyOf?(r=e.anyOf,n=t?.anyOf):e.oneOf&&(r=e.oneOf,n=t?.oneOf);let i=Kt(e);if(t){const{optionsSchemaSelector:s=i}=pe(t);i=s}return r?.map((s,a)=>{const{title:o}=pe(n?.[a]),c=s;let l,u=o;if(i){const m=gr(c,i);l=me(m,An,me(m,It)),u=u??m?.title??c.title??String(l)}else l=qg(c),u=u??c.title??String(l);return{schema:c,label:u,value:l}})}function Ha(e,t,r={},n){const i=bt(e,t,r,void 0,n),s=i.oneOf||i.anyOf;return Array.isArray(i.enum)?!0:Array.isArray(s)?s.every(a=>typeof a!="boolean"&&rm(a)):!1}function Gc(e,t,r,n){return!t.uniqueItems||!t.items||typeof t.items=="boolean"?!1:Ha(e,t.items,r,n)}const Lg=["string","number","integer","boolean","null"];var is;(function(e){e[e.Ignore=0]="Ignore",e[e.Invert=1]="Invert",e[e.Fallback=2]="Fallback"})(is||(is={}));function ko(e,t=is.Ignore,r=-1){if(r>=0){if(Array.isArray(e.items)&&r0:typeof e=="object"&&e!==null?Object.keys(e).length>0:!1}function nm(e,t){const{default:r,type:n}=e;return Array.isArray(n)&&n.includes("null")&&!Vg(t)&&r===null?null:t}function nu(e,t,r,n,i,s=[],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=i===void 0?s.includes(t):i;ue(r)?l==="skipEmptyDefaults"?Object.keys(r).length>0&&(e[t]=r):(Object.keys(r).length>0||s.includes(t))&&(u||l!=="populateRequiredDefaults")&&(e[t]=r):r!==void 0&&(l==="populateAllDefaults"||l==="skipEmptyDefaults"||u&&s.includes(t))&&(e[t]=r)}}function Kr(e,t,r={}){const{parentDefaults:n,rawFormData:i,rootSchema:s={},includeUndefinedValues:a=!1,_recurseList:o=[],experimental_defaultFormStateBehavior:c,experimental_customMergeAllOf:l,required:u,shouldMergeDefaultsIntoFormData:m=!1,initialDefaultsGenerated:_}=r;let v=ue(i)?i:{};const S=ue(t)?t:{};let E=n;const g=E&&c?.nestedDefaultsPrecedence==="ancestorWins";let y=null,f=c,C=o;if(S[It]!==void 0&&c?.constAsDefaults!=="never"&&!tm(S))E=S[It];else if(ue(E)&&ue(S.default)&&!S[Ne]&&!S[Se]&&!S[Je])g?E=Xr(S.default,E):E=Xr(E,S.default);else if(An in S&&!g&&!S[Ne]&&!S[Se]&&!S[Je])E=S.default;else if(Je in S){const b=S[Je];o.includes(b)||(C=o.concat(b),y=ks(b,s));const O=i===void 0||ue(i)&&Object.keys(i).length===0;y&&!E&&O&&(E=S.default),m&&y&&!ue(i)&&(v=i)}else if(qc in S){const b={...su(e,S,r,E),...v};[y]=Zh(e,S,s,!1,[],b,l)}else if(Kc(S)&&!g)E=S.items.map((b,O)=>Kr(e,b,{rootSchema:s,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($)&&Lg.includes($)&&f?.constAsDefaults==="skipOneOf"&&(f={...f,constAsDefaults:"never"}),y=b[ss(e,s,i??S.default,b,0,k,l)],y=jr(O,y)}else if(Ne in S){const{anyOf:b,...O}=S;if(b.length===0)return;const k=Kt(S);y=b[ss(e,s,i??S.default,b,0,k,l)],y=jr(O,y)}if(y)return Kr(e,y,{rootSchema:s,includeUndefinedValues:a,_recurseList:C,experimental_defaultFormStateBehavior:f,experimental_customMergeAllOf:l,parentDefaults:E,rawFormData:i??v,required:u,shouldMergeDefaultsIntoFormData:m,initialDefaultsGenerated:_});E===void 0&&(E=S.default);let h=su(e,S,r,E)??E;if(m){const{arrayMinItems:b={}}=c||{},{mergeExtraDefaults:O}=b,k=Wc(e,S,s,i,c,l);(!ue(i)||yr in S)&&(h=Ns(h,k,O,!0))}return h}function Wc(e,t,r,n,i,s){const a=i?.allOf==="populateDefaults"&&yr in t,o=a?bt(e,t,r,n,s):t,c=!rm(o)&&Ha(e,o,r,s);let l=n;return c&&(l=xn(o)?.some(v=>je(v.value,n))?n:void 0),o[It]&&i?.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[_]=Wc(e,v,r,m[_],i,s)),m},{...l})),l}function zg(e,t,{rawFormData:r,rootSchema:n={},includeUndefinedValues:i=!1,_recurseList:s=[],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"&&Uc in v?bt(e,v,n,_,o):v,g=E[It],y=Object.keys(E.properties||{}).reduce((f,C)=>{const P=gr(E,C),h=ue(g)&&g[C]!==void 0,b=(ue(P)&&It in P||h)&&a?.constAsDefaults!=="never"&&!tm(P),O=Kr(e,P,{rootSchema:n,_recurseList:s,experimental_defaultFormStateBehavior:a,experimental_customMergeAllOf:o,includeUndefinedValues:i===!0,parentDefaults:me(m,C),rawFormData:me(_,C),required:E.required?.includes(C),shouldMergeDefaultsIntoFormData:l,initialDefaultsGenerated:u});return nu(f,C,O,i,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:s,experimental_defaultFormStateBehavior:a,experimental_customMergeAllOf:o,includeUndefinedValues:i===!0,parentDefaults:me(m,h),rawFormData:me(_,h),required:E.required?.includes(h),shouldMergeDefaultsIntoFormData:l,initialDefaultsGenerated:u});nu(y,h,b,i,c,P)})}return nm(t,y)}}function Bg(e,t,{rawFormData:r,rootSchema:n={},_recurseList:i=[],experimental_defaultFormStateBehavior:s,experimental_customMergeAllOf:a,required:o,requiredAsRoot:c=!1,shouldMergeDefaultsIntoFormData:l,initialDefaultsGenerated:u}={},m){let _=m;const v=t,S=s?.arrayMinItems??{},{populate:E,mergeExtraDefaults:g}=S,y=E==="never",f=E==="requiredOnly",C=E==="all"||!y&&!f,P=S?.computeSkipPopulate??(()=>!1),b=s?.emptyObjectFields==="skipEmptyDefaults"?void 0:[];if(Array.isArray(_)&&(_=_.map(($,M)=>{const q=ko(v,is.Fallback,M),U=Array.isArray(r)?r[M]:void 0;return Kr(e,q,{rootSchema:n,_recurseList:i,experimental_defaultFormStateBehavior:s,experimental_customMergeAllOf:a,parentDefaults:$,rawFormData:U,required:o,shouldMergeDefaultsIntoFormData:l,initialDefaultsGenerated:u})})),Array.isArray(r)){const $=ko(v);if(y)_=r;else{const M=r.map((U,L)=>Kr(e,$,{rootSchema:n,_recurseList:i,experimental_defaultFormStateBehavior:s,experimental_customMergeAllOf:a,rawFormData:U,parentDefaults:me(_,L),required:o,shouldMergeDefaultsIntoFormData:l,initialDefaultsGenerated:u}));_=Ns(_,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||Gc(e,v,n,a)||P(e,v,n)||v.minItems<=O)k=_||!o&&!c?_:b;else{const $=_||[],M=ko(v,is.Invert),q=M.default,U=Array.from({length:v.minItems-O},()=>Kr(e,M,{parentDefaults:q,rootSchema:n,_recurseList:i,experimental_defaultFormStateBehavior:s,experimental_customMergeAllOf:a,required:o,shouldMergeDefaultsIntoFormData:l}));k=$.concat(U)}return nm(t,k)}function su(e,t,r={},n){switch(Gt(t)){case"object":return zg(e,t,r,n);case"array":return Bg(e,t,r,n);case"boolean":return r.required&&n===void 0?!1:void 0;default:return}}function sm(e,t,r,n,i=!1,s,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:i,experimental_defaultFormStateBehavior:s,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}=s||{},m=u==="useDefaultIfFormDataUndefined",_=Wc(e,c,n??c,r,s,a);return Ns(l,_,!0,m,!0)}return l}function im(e={}){return"widget"in pe(e)&&pe(e).widget!=="hidden"}function am(e,t,r={},n,i){if(r[zc]==="files")return!0;if(t.items){const s=bt(e,t.items,n,void 0,i);return s.type==="string"&&s.format==="data-url"}return!1}function Hg(e,t,r={},n,i,s){const a=pe(r,i),{label:o=!0}=a;let c=!!o;if(c){const l=Gt(t),u=!!t[Sn];l==="array"&&(c=u||Gc(e,t,n,s)||am(e,t,r,n,s)||im(r)),l==="object"&&(c=u),l==="boolean"&&r&&!r[zc]&&(c=!1),r?.[Sy]&&(c=!1)}return c}function Kg(e,t){if(t.length===0&&typeof e!="object")return e;const r={};return t.forEach(n=>{const i=Array.isArray(n)?n:rr(n);ct(e,i)&&it(r,i,me(e,i))}),Array.isArray(e)?Object.keys(r).map(n=>r[n]):r}function Gg(e,t){const r=(i,s)=>typeof i!="object"||i===null?!0:(Array.isArray(i)?i.length===0:Object.keys(i).length===0)||s,n=(i,s=[],a=[[]])=>{const o=Object.keys(i);return o.forEach(c=>{const l=i[c];if(typeof l=="object"){const u=a.map(m=>[...m,c]);l[Vc]&&l[va]!==""?s.push(l[va]):n(l,s,u)}else c===va&&l!==""&&a.forEach(u=>{const m=me(t,u),_=o.length===1;(r(m,_)||Array.isArray(m)&&m.every(v=>r(v,_)))&&s.push(u)})}),s};return n(e)}function om(e){return e==null||e===""?!0:Array.isArray(e)?e.length===0:ue(e)?Object.values(e).every(om):!1}function Wg(e,t){return t?t(e):Kh(e)}function Jg(e,t,r={},n,i){function s(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 U=a(k)?k:{};U.$ref!==void 0&&(U=ks(U.$ref,r));const L=new Set(U.required??[]);if(Object.entries(q).every(([J,Y])=>!L.has(J)&&om(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(([U])=>U.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(;Pnew RegExp(q)):[];for(const q of Object.keys(O))!$.has(q)&&!M.some(U=>U.test(q))&&delete O[q]}return _(f,E,O)??(y?E:void 0)}return v(t,n)}const Lt=Symbol("no Value");function cm(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=>It in n?n[It]:Array.isArray(n.enum)&&n.enum.length===1?n.enum[0]:Lt).filter(n=>n!==Lt);return r.length>0?r:void 0}function Yg(e,t){const r=cm(e);if(!r||r.some(i=>je(i,t)))return Lt;const n=me(e,An,Lt);return n!==Lt&&r.some(i=>je(i,n))?n:r.length===1?r[0]:void 0}function vc(e,t,r,n,i={},s){let a;const o=r?.[rt];if(o){const c={},l=n?.[rt];l&&Object.keys(l).forEach(_=>{ct(i,_)&&(c[_]=void 0)});const u=Object.keys(o),m={};u.forEach(_=>{const v=i?.[_],S=!ct(n,[rt,_]);let E=gr(n,_),g=gr(r,_);ct(E,Je)&&(E=bt(e,E,t,v,s)),ct(g,Je)&&(g=bt(e,g,t,v,s));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=vc(e,t,g,S&&f==="array"?g:E,v,s);(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,It,Lt),b=me(E,It,Lt);if(h!==Lt&&h!==v&&(c[_]=b===v?h:void 0),ct(i,_)){const O=Yg(g,v);O!==Lt&&(c[_]=O)}}}),a={...typeof i=="string"||Array.isArray(i)?void 0:i,...c,...m}}else if(n?.type==="array"&&r?.type==="array"&&Array.isArray(i)){let c=n.items,l=r.items;if(typeof c=="object"&&typeof l=="object"&&!Array.isArray(c)&&!Array.isArray(l)){ct(c,Je)&&(c=bt(e,c,t,i,s)),ct(l,Je)&&(l=bt(e,l,t,i,s));const u=me(c,"type"),m=me(l,"type");if(!u||u===m){const _=r.maxItems??-1;if(m==="object")a=i.reduce((v,S)=>{const E=vc(e,t,l,c,S,s);return E!==void 0&&(_<0||v.length<_)&&v.push(E),v},[]);else{const v=cm(l),S=v?i.filter(E=>v.some(g=>je(g,E))):i;a=_>0&&S.length>_?S.slice(0,_):S}}}else typeof c=="boolean"&&typeof l=="boolean"&&c===l&&(a=i)}return a}function Ur(e,t,r,n,i,s=[],a){if(Je in t||qc in t||yr in t||Uc in t){const c=bt(e,t,n,i,a);if(s.findIndex(u=>je(u,c))===-1)return Ur(e,c,r,n,i,s.concat(c),a)}let o={[va]:r.replace(/^\./,"")};if(Se in t||Ne in t){const c=Se in t?t.oneOf:t.anyOf,l=Kt(t),u=ss(e,n,i,c,0,l,a),m=c[u];o={...o,...Ur(e,m,r,n,i,s,a)}}if(Jn in t&&t[Jn]!==!1){it(o,Vc,!0);const c=ue(t[Jn])?t[Jn]:{},l=t[rt]??{};for(const u of Object.keys(i??{}))u in l||(o[u]=Ur(e,c,`${r}.${u}`,n,me(i,u),s,a))}if(ns in t&&Array.isArray(i)){const{items:c,additionalItems:l}=t;Array.isArray(c)?i.forEach((u,m)=>{c[m]?o[m]=Ur(e,c[m],`${r}.${m}`,n,u,s,a):l?o[m]=Ur(e,l,`${r}.${m}`,n,u,s,a):console.warn(`Unable to generate path schema for "${r}.${m}". No schema defined for it`)}):i.forEach((u,m)=>{o[m]=Ur(e,c,`${r}.${m}`,n,u,s,a)})}else if(rt in t)for(const c in t.properties){const l=gr(t,c);o[c]=Ur(e,l,`${r}.${c}`,n,me(i,c),s,a)}return o}function Xg(e,t,r="",n,i,s){return Ur(e,t,r,n,i,void 0,s)}class Zg{rootSchema;validator;experimental_defaultFormStateBehavior;experimental_customMergeAllOf;constructor(t,r,n,i){r?.[Es]===_a?this.rootSchema=yc(r,r[Ue]??"#"):this.rootSchema=r,this.validator=t,this.experimental_defaultFormStateBehavior=n,this.experimental_customMergeAllOf=i}getRootSchema(){return this.rootSchema}getValidator(){return this.validator}doesSchemaUtilsDiffer(t,r,n={},i){return!t||!r?!1:this.validator!==t||!je(this.rootSchema,r)||!je(this.experimental_defaultFormStateBehavior,n)||this.experimental_customMergeAllOf!==i}findFieldInSchema(t,r,n){return Tg(this.validator,this.rootSchema,t,r,n,this.experimental_customMergeAllOf)}findSelectedOptionInXxxOf(t,r,n,i){return xs(this.validator,this.rootSchema,t,r,n,i,this.experimental_customMergeAllOf)}getDefaultFormState(t,r,n=!1,i){return sm(this.validator,t,r,this.rootSchema,n,this.experimental_defaultFormStateBehavior,this.experimental_customMergeAllOf,i)}getDisplayLabel(t,r,n){return Hg(this.validator,t,r,this.rootSchema,n,this.experimental_customMergeAllOf)}getClosestMatchingOption(t,r,n,i){return ss(this.validator,this.rootSchema,t,r,n,i,this.experimental_customMergeAllOf)}getFirstMatchingOption(t,r,n){return Na(this.validator,t,r,this.rootSchema,n)}getFromSchema(t,r,n){return wa(this.validator,this.rootSchema,t,r,n,this.experimental_customMergeAllOf)}isFilesArray(t,r){return am(this.validator,t,r,this.rootSchema,this.experimental_customMergeAllOf)}isMultiSelect(t){return Gc(this.validator,t,this.rootSchema,this.experimental_customMergeAllOf)}isSelect(t){return Ha(this.validator,t,this.rootSchema,this.experimental_customMergeAllOf)}omitExtraData(t,r){return Jg(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 vc(this.validator,this.rootSchema,t,r,n,this.experimental_customMergeAllOf)}toPathSchema(t,r,n){return Xg(this.validator,t,r,this.rootSchema,n,this.experimental_customMergeAllOf)}}function Qg(e,t,r={},n){return new Zg(e,t,r,n)}function e0(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,i]=r,[s,...a]=n.split(";"),o=s||"",c=decodeURI(a.map(l=>l.split("=")).find(([l])=>l==="name")?.[1]||"unknown");try{const l=atob(i),u=new Array(l.length);for(let _=0;_ 0, got one of each`);const i=new Date().getFullYear(),s=r?i+e:e,a=r?i+t:t;if(s>a)return lm(t,e).reverse();const o=[];for(let c=s;c<=a;c+=1)o.push({value:c,label:Lr(c,2)});return o}function t0(e,t){let r=e;if(Array.isArray(t)){const n=r.split(/(%\d)/);t.forEach((i,s)=>{const a=n.findIndex(o=>o===`%${s+1}`);a>=0&&(n[a]=i)}),r=n.join("")}return r}function r0(e,t){return t0(e,t)}function Ka(e,t=[],r){if(Array.isArray(e))return e.map(s=>Ka(s,t)).filter(s=>s!==void 0);const n=e===""||e===null?-1:Number(e),i=t[n];return i?i.value:r}function n0(e,t,r=[]){const n=Ka(e,r);return Array.isArray(t)?t.filter(i=>!je(i,n)):je(n,t)?void 0:t}function Ga(e,t){return Array.isArray(t)?t.some(r=>je(r,e)):je(t,e)}function um(e,t=[],r=!1){const n=t.map((i,s)=>Ga(i.value,e)?String(s):void 0).filter(i=>typeof i<"u");return r?n:n[0]}function s0(e,t,r,n="indexed",i){if(typeof e>"u"||r&&Array.isArray(e)&&e.length<1||!r&&e===i)return i;if(n==="realValue")return r?e.map(String):String(e);const a=um(e,t,r);return typeof a>"u"?i:a}function i0(e,t,r=[]){const n=Ka(e,r);if(n!=null){const i=r.findIndex(o=>n===o.value),s=r.map(({value:o})=>o);return t.slice(0,i).concat(n,t.slice(i)).sort((o,c)=>+(s.indexOf(o)>s.indexOf(c)))}return t}function iu(e,t,r){if(e===""||!Array.isArray(t))return r;const n=t.find(s=>String(s.value)===e);if(n)return n.value;const i=Number(e);return!Number.isNaN(i)&&i>=0&&iiu(i,t,n)):iu(e,t,n)}function Jc(e,t,r="indexed"){return r!=="realValue"?String(t):e==null?"":String(typeof e=="object"?t:e)}class dm{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={},it(this.errorSchema,r,n,!0)),n}resetAllErrors(t){return this.errorSchema=t?structuredClone(t):{},this}addErrors(t,r){const n=this.getOrCreateErrorBlock(r);let i=n[vt];return Array.isArray(i)||(i=[],n[vt]=i),Array.isArray(t)?n[vt]=[...new Set([...i,...t])]:n[vt]=[...new Set([...i,t])],this}setErrors(t,r){const n=this.getOrCreateErrorBlock(r),i=Array.isArray(t)?[...new Set([...t])]:[t];return n[vt]=i,this}clearErrors(t){const r=this.getOrCreateErrorBlock(t);return r[vt]=[],this}}function fm(e,t){return Or(e)&&Or(t)?Ca(e,t,!0):Array.isArray(e)&&Array.isArray(t)&&e.length===t.length?e.flatMap((r,n)=>{if(je(r,t[n]))return[];const i=fm(r,t[n]);return i.length?i.map(s=>`${n}.${s}`):[String(n)]}):[]}function Ca(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),i=new Set(n),s=n.filter(o=>!je(e[o],me(t,o))).flatMap(o=>{if(!r)return[o];const c=fm(e[o],me(t,o));return c.length?c.map(l=>`${o}.${l}`):[o]}),a=Object.keys(t).filter(o=>!i.has(o));return[...s,...a]}function a0(e,t,r=[1900,new Date().getFullYear()+2],n="YMD"){const{day:i,month:s,year:a,hour:o,minute:c,second:l}=e,u={type:"day",range:[1,31],value:i},m={type:"month",range:[1,12],value:s},_={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 o0(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 c0(e,t,r={},n=!0){const i={type:t||"text",...o0(e)};return r.inputType?i.type=r.inputType:t||(e.type==="number"?(i.type="number",n&&i.step===void 0&&(i.step="any")):e.type==="integer"&&(i.type="number",i.step===void 0&&(i.step=1))),["date","datetime-local","time","week","month"].includes(i.type)&&(e.formatMinimum!==void 0&&(i.min=e.formatMinimum),e.formatMaximum!==void 0&&(i.max=e.formatMaximum)),r.autocomplete&&(i.autoComplete=r.autocomplete),r.autocapitalize&&(i.autoCapitalize=r.autocapitalize),r.accept&&(i.accept=r.accept),i}function Yc(e){return e?.optionValueFormat??"indexed"}const au={props:{disabled:!1},submitText:"Submit",norender:!1};function l0(e={}){const t=pe(e);if(t?.[ja]){const r=t[ja];return{...au,...r}}return au}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 i=r[e];return n[i]}return r[e]||n[e]}let ou=0;function Xc(){if(me(globalThis,["process","env","NODE_ENV"])!=="test")return{};const e=new Map;return new Proxy({},{get(t,r){return e.has(r)||(ou+=1,e.set(r,`test-id-${ou}`)),e.get(r)}})}var Io={exports:{}},Be={};var cu;function u0(){if(cu)return Be;cu=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=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 i: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 s:return g;default:return y}}case t:return y}}}return Be.ContextConsumer=a,Be.ContextProvider=s,Be.Element=e,Be.ForwardRef=c,Be.Fragment=r,Be.Lazy=_,Be.Memo=m,Be.Portal=t,Be.Profiler=i,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)===s},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)===i},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===i||g===n||g===l||g===u||g===v||typeof g=="object"&&g!==null&&(g.$$typeof===_||g.$$typeof===m||g.$$typeof===s||g.$$typeof===a||g.$$typeof===c||g.$$typeof===S||g.getModuleId!==void 0)},Be.typeOf=E,Be}var lu;function d0(){return lu||(lu=1,Io.exports=u0()),Io.exports}var f0=d0();const uu=$s(f0),No={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 h0(e){let{MergedWidget:t}=e;if(!t){const r=e.defaultProps?.options||{};t=({options:n,...i})=>R.jsx(e,{options:{...r,...n},...i}),e.MergedWidget=t}return t}function vr(e,t,r={}){const n=Gt(e);if(typeof t=="function"||t&&uu.isForwardRef(Z.createElement(t))||uu.isMemo(t))return h0(t);if(typeof t!="string")throw new Error(`Unsupported widget definition: ${typeof t} in schema: ${JSON.stringify(e)}`);if(t in r){const i=r[t];return vr(e,i,r)}if(typeof n=="string"){if(!(n in No))throw new Error(`No widget for type '${n}' in schema: ${JSON.stringify(e)}`);if(t in No[n]){const i=r[No[n][t]];return vr(e,i,r)}}throw new Error(`No widget '${t}' for type '${n}' in schema: ${JSON.stringify(e)}`)}function hm(e){let t=0;for(let r=0;ri===void 0?"undefined":Ra(i)).join(",")}]`;if(e===null||typeof e!="object")return JSON.stringify(typeof e=="function"?null:e);const r=e;return`{${Object.keys(r).sort().filter(i=>t(r[i])).map(i=>`${JSON.stringify(i)}:${Ra(r[i])}`).join(",")}}`}function zt(e){return hm(Ra(e))}function m0(e){return hm(Ra(e))}function p0(e,t,r={}){try{return vr(e,t,r),!0}catch(n){const i=n;if(i.message&&(i.message.startsWith("No widget")||i.message.startsWith("Unsupported widget")))return!1;throw n}}function Rn(e,t){return`${typeof e=="string"?e:e[Ue]}__${t}`}function as(e){return Rn(e,"description")}function mm(e){return Rn(e,"error")}function Zc(e){return Rn(e,"examples")}function pm(e){return Rn(e,"help")}function Qc(e){return Rn(e,"title")}function $n(e,t=!1){const r=t?` ${Zc(e)}`:"";return`${mm(e)} ${as(e)} ${pm(e)}${r}`}function ym(e,t){return`${e}-${t}`}function _n(e,t){return Rn(e,t)}function Ro(e,t){return Rn(e,`optional${t}`)}function os(e){return e==null?!1:typeof e!="object"||Array.isArray(e)?!0:Object.keys(e).length>0}function y0(e,t){const{rootSchema:r,schemaUtils:n}=e;if(je(t,r))return!0;if(Je in r){const i=n.retrieveSchema(r);return je(t,i)}return!1}function g0(e,t,r){return t?r:e}function v0(e){return e?new Date(e).toJSON():void 0}function b0(e,t,r,n=!1){!n&&Array.isArray(r)&&t.default!==void 0&&um(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 el(e,t,r){const n=[_y];return ct(e,Nl)&&n.unshift(Nl),me(e,[...n,t],r)}function $o(){}function _0(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]}'`,i=r(e),s=t.filter(u=>u==="*"||i[u]),a=r(s),o=e.filter(u=>!a[u]),c=s.indexOf("*");if(c===-1){if(o.length)throw new Error(`uiSchema order list does not contain ${n(o)}`);return s}if(c!==s.lastIndexOf("*"))throw new Error("uiSchema order list contains more than one wildcard item");const l=[...s];return l.splice(c,1,...o),l}function Fo(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 S0(e,t,r){const n=e[ba]??e[Je],i=r.uiSchemaDefinitions,s=n&&i?i[n]:void 0;let a;if(s?!t||Object.keys(t).length===0?a={...s}:a=Xr(s,t):a=t||{},i){let o=e;if(n&&e[Je]&&!e[ba])try{o=ks(n,r.rootSchema)}catch(c){return console.warn(`could not resolve $ref in resolveUiSchema: `,c),a}for(const c of[Se,Ne]){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;vEa(r);return e.allOf.some(t)}return!1}function w0({hideLabel:e,id:t,multiple:r,options:n,registry:i,uiSchema:s,value:a}){if(r||e)return null;const{label:o=!0}=pe(s,i.globalUiOptions);if(!o)return null;const c=n.enumOptions?.find(({value:m})=>Ga(m,a)),l=c?.schema?.description;if(!l)return null;const u=_e("DescriptionFieldTemplate",i,n);return R.jsx(u,{id:as(t),description:l,schema:c.schema,uiSchema:s,registry:i})}function bc(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 i=0;iue(r)?Gt(r):void 0).flat().filter(r=>r!==void 0))];return t.length===1?t[0]:t}function Fs(e,t,r,n){const{enableOptionalDataFieldForType:i=[]}=pe(n,e.globalUiOptions);let s;return Ne in t&&Array.isArray(t[Ne])?s=du(t[Ne]):Se in t&&Array.isArray(t[Se])?s=du(t[Se]):s=Gt(t),!y0(e,t)&&!r&&!!s&&!Array.isArray(s)&&!!i.find(a=>a===s)}function fu(e,t=!0){const{year:r,month:n,day:i,hour:s=0,minute:a=0,second:o=0}=e,c=Date.UTC(r,n-1,i,s,a,o),l=new Date(c).toJSON();return t?l:l.slice(0,10)}function gm(e,t=[]){return e?vm(e,t):[]}function vm(e,t){const r=e[vt],n=`.${t.join(".")}`,i=Array.isArray(r)?r.map(s=>({property:n,message:s,stack:`${n} ${s}`})):[];return Object.keys(e).reduce((s,a)=>{const o=e[a];return a!==vt&&Or(o)?s.concat(vm(o,[...t,a])):s},i)}function E0(e){const t=new dm;return e.length&&e.forEach(r=>{const{property:n,message:i}=r,s=n?rr(n):[];i&&t.addErrors(i,s)}),t.ErrorSchema}function nr(e,t,r,n){const i=Array.isArray(r)?r:r?.path,s=e===""?[]:[e],a=i?i.concat(...s):s,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 A0(e){return bm(e)}function bm(e){return Object.keys(e).reduce((t,r)=>{if(r==="addError")return t;const n=e[r];return Or(n)?{...t,[r]:bm(n)}:{...t,[r]:n}},{})}function x0(e){return Object.values(e).every(t=>t!==-1)}function P0(e){const{className:t="form-control",type:r,range:n,value:i,select:s,rootId:a,name:o,disabled:c,readonly:l,autofocus:u,registry:m,onBlur:_,onFocus:v}=e,S=`${a}_${r}`,{SelectWidget:E}=m.widgets,g=Z.useCallback(y=>s(r,y),[s,r]);return R.jsx(E,{schema:{type:"integer"},id:S,name:o,className:t,options:{enumOptions:lm(n[0],n[1])},placeholder:r,value:i,disabled:c,readonly:l,autofocus:u,onChange:g,onBlur:_,onFocus:v,registry:m,label:"","aria-describedby":$n(a)})}function O0(e){const{time:t=!1,disabled:r=!1,readonly:n=!1,options:i,onChange:s,value:a}=e,[o,c]=Z.useState(Fo(a,t));Z.useEffect(()=>{c(Fo(a,t))},[t,a]);const l=Z.useCallback((v,S)=>{const E={...o,[v]:typeof S>"u"?-1:S};x0(E)?s(fu(E,t)):c(E)},[o,s,t]),u=Z.useCallback(v=>{v.preventDefault(),!(r||n)&&s(void 0)},[r,n,s]),m=Z.useCallback(v=>{if(v.preventDefault(),r||n)return;const S=Fo(new Date().toJSON(),t);s(fu(S,t))},[r,n,t,s]);return{elements:Z.useMemo(()=>a0(o,t,i.yearsRange,i.format),[o,t,i.yearsRange,i.format]),handleChange:l,handleClear:u,handleSetNow:m}}function cs(e){const t=Z.useRef(e);return je(e,t.current)||(t.current=e),t.current}function j0(e,t){return e.replace(";base64",`;name=${encodeURIComponent(t)};base64`)}async function k0(e){const{name:t,size:r,type:n}=e;return new Promise((i,s)=>{const a=new window.FileReader;a.onerror=s,a.onload=o=>{typeof o.target?.result=="string"?i({dataURL:j0(o.target.result,t),name:t,size:r,type:n}):i({dataURL:null,name:t,size:r,type:n})},a.readAsDataURL(e)})}async function I0(e){return Promise.all(Array.from(e).map(k0))}function hu(e){return e.reduce((t,r)=>{if(!r)return t;try{const{blob:n,name:i}=e0(r);return[...t,{dataURL:r,name:i,size:n.size,type:n.type}]}catch{return t}},[])}function N0(e,t,r=!1){const n=Z.useMemo(()=>r&&e?Array.isArray(e)?e:[e]:[],[e,r]),i=Z.useMemo(()=>Array.isArray(e)?hu(e):hu([e||""]),[e]),s=Z.useCallback(async o=>{const l=(await I0(o)).map(u=>u.dataURL||null);t(r?n.concat(...l):l[0])},[n,r,t]),a=Z.useCallback(o=>{if(r){const c=n.filter((l,u)=>u!==o);t(c)}else t(void 0)},[n,r,t]);return{filesInfo:i,handleChange:s,handleRemove:a}}function R0(e){if(!e)return"";const t=new Date(e),r=Lr(t.getFullYear(),4),n=Lr(t.getMonth()+1,2),i=Lr(t.getDate(),2),s=Lr(t.getHours(),2),a=Lr(t.getMinutes(),2),o=Lr(t.getSeconds(),2),c=Lr(t.getMilliseconds(),3);return`${r}-${n}-${i}T${s}:${a}:${o}.${c}`}function Ps(e,t,r=!1){if(!t)return e;const{errors:n,errorSchema:i}=e;let s=gm(t),a=t;return i&&Object.keys(i).length>0&&(a=Xr(i,t,r?"preventDuplicates":!0),s=[...n].concat(s)),{errorSchema:a,errors:s}}function $0(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]=Mh+n:t[r]=tl(n)}return e}function F0(e){return e.map(t=>tl(t))}function tl(e){return Array.isArray(e)?F0([...e]):ue(e)?$0({...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 mu=0;function _c(){return mu+=1,`rjsf-array-item-${mu}`}function pu(e){return Array.isArray(e)?e.map(t=>({key:_c(),item:t})):[]}function _m(e){return Array.isArray(e)?e.map(t=>t.item):[]}function D0(e){return Array.isArray(e.type)?!e.type.includes("null"):e.type!=="null"}function Sm(e,t,r,n){let{addable:i}=pe(n,e.globalUiOptions);return i!==!1&&(t.maxItems!==void 0?i=r.lengthB.retrieveSchema(S,E),[B,S,E]),A=Z.useMemo(()=>nr(r,X,y),[r,X,y]),w=J||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(W=>z[W]);const H=Z.useCallback(W=>{M(W,r+1)},[M,r]),N=Z.useCallback(W=>{q(W,r)},[q,r]),D=Z.useCallback(W=>{U(W,r)},[U,r]),V=Z.useCallback(W=>{L(W,r,r-1)},[L,r]),K=Z.useCallback(W=>{L(W,r,r+1)},[L,r]),G={children:R.jsx(w,{name:n,title:$,index:r,schema:re,uiSchema:g,formData:E,errorSchema:f,fieldPathId:A,required:D0(re),onChange:b,onBlur:P,onFocus:h,registry:o,disabled:i,readonly:a,hideError:s,autofocus:C,rawErrors:O}),buttonsProps:{fieldPathId:A,disabled:i,readonly:a,canAdd:u,hasCopy:z.copy,hasMoveUp:z.moveUp,hasMoveDown:z.moveDown,hasRemove:z.remove,index:r,totalItems:k,onAddItem:H,onCopyItem:N,onRemoveItem:D,onMoveUpItem:V,onMoveDownItem:K,registry:o,schema:re,uiSchema:g},itemKey:t,className:"rjsf-array-item",disabled:i,hasToolbar:z.toolbar,index:r,totalItems:k,readonly:a,registry:o,schema:re,uiSchema:g,parentUiSchema:l,displayLabel:p,hasDescription:x};return R.jsx(j,{...G})}const Cm=Z.memo(L0);function V0(e){const{schema:t,uiSchema:r={},errorSchema:n,fieldPathId:i,formData:s,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:U}=$,L=Z.useMemo(()=>pe(r,q),[r,q]),B=Z.useMemo(()=>ue(t.items)?t.items:{},[t.items]),J=Z.useMemo(()=>k.retrieveSchema(B),[k,B]),Y=Z.useMemo(()=>_m(f),[f]),Q=Fs(v,t,m,r),X=os(s),re=Z.useMemo(()=>Sm(v,t,Y,r)&&(!Q||X),[v,t,Y,r,Q,X]),A=X?f:[],w=Q?" rjsf-optional-array-field":"",j=e.childFieldPathId??i,p=Q?R.jsx(U,{...e,fieldPathId:j}):void 0,d={canAdd:re,items:A.map((I,T)=>{const{key:F,item:z}=I,H=z,N=n?n[T]:void 0,D=wm(r,z,T,M),V={itemKey:F,index:T,name:a&&`${a}-${T}`,registry:v,uiOptions:L,parentUiSchema:r,hideError:_,readonly:l,disabled:c,required:m,title:O?`${O}-${T+1}`:void 0,canAdd:re,canMoveUp:T>0,canMoveDown:Tpe(r,q),[r,q]),{OptionalDataControlsField:L}=$,B=Fs(v,t,m,r),J=os(n),Y=Z.useMemo(()=>Array.isArray(t.items)?t.items:[],[t.items]),Q=ue(t.additionalItems),X=e.childFieldPathId??s;O.length{const{key:T,item:F}=x,z=F,H=I>=Y.length,N=(H&&ue(t.additionalItems)?t.additionalItems:Y[I])||{};let D;H?D=r.additionalItems:Array.isArray(r.items)?D=r.items[I]:D=wm(r,F,I,M);const V=i?i[I]:void 0,K={index:I,itemKey:T,name:a&&`${a}-${I}`,registry:v,uiOptions:U,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&&Izt(e),[e]),[r,n]=Z.useState(()=>({formDataHash:t,keyedFormData:pu(e)}));let{keyedFormData:i,formDataHash:s}=r;if(t!==s){const o=Array.isArray(e)?e:[],c=i||[];i=o.length===c.length?c.map((l,u)=>({key:l.key,item:o[u]})):pu(o),s=t,n({formDataHash:s,keyedFormData:i})}const a=Z.useCallback(o=>{const c=_m(o),l=zt(c);return n({formDataHash:l,keyedFormData:o}),c},[]);return{keyedFormData:i,updateKeyedFormData:a}}function H0(e){const{schema:t,uiSchema:r,errorSchema:n,fieldPathId:i,registry:s,formData:a,onChange:o}=e,{globalFormOptions:c,schemaUtils:l,translateString:u}=s,{keyedFormData:m,updateKeyedFormData:_}=B0(a),v=Z.useRef(m);v.current=m;const S=Z.useRef(n);S.current=n;const E=e.childFieldPathId??i,g=Z.useCallback((k,$)=>{k&&k.preventDefault();let M;if(S.current){M={};for(const L of Object.keys(S.current)){const B=parseInt(L,10);$===void 0||B<$?it(M,B,S.current[B]):B>=$&&it(M,B+1,S.current[B])}}const q={key:_c(),item:T0(s,t)},U=[...v.current];$!==void 0?U.splice($,0,q):U.push(q),o(_(U),E.path,M)},[s,t,o,_,E]),y=Z.useCallback((k,$)=>{k&&k.preventDefault();let M;if(S.current){M={};for(const L of Object.keys(S.current)){const B=parseInt(L,10);B<=$?it(M,B,S.current[B]):B>$&&it(M,B+1,S.current[B])}}const q={key:_c(),item:structuredClone(v.current[$].item)},U=[...v.current];$!==void 0?U.splice($+1,0,q):U.push(q),o(_(U),E.path,M)},[o,_,E]),f=Z.useCallback((k,$)=>{k&&k.preventDefault();let M;if(S.current){M={};for(const U of Object.keys(S.current)){const L=parseInt(U,10);L<$?it(M,L,S.current[L]):L>$&&it(M,L-1,S.current[L])}}const q=v.current.filter((U,L)=>L!==$);o(_(q),E.path,M)},[o,_,E]),C=Z.useCallback((k,$,M)=>{k&&(k.preventDefault(),k.currentTarget.blur());let q;if(S.current){q={};for(const B of Object.keys(S.current)){const J=parseInt(B,10);J===$?it(q,M,S.current[$]):J===M?it(q,$,S.current[M]):it(q,B,S.current[J])}}function U(){const B=v.current.slice();return B.splice($,1),B.splice(M,0,v.current[$]),B}const L=U();o(_(L),E.path,q)},[o,_,E]),P=Z.useCallback((k,$,M,q)=>{const U=typeof $.at(-1)=="number";o(U&&k===void 0?null:k,$,M,q)},[o]),h=Z.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(!(ns in t)){if(!c.useFallbackUiForUnsupportedType){const $=pe(r),M=_e("UnsupportedFieldTemplate",s,$);return R.jsx(M,{schema:t,fieldPathId:i,reason:u($e.MissingItems),registry:s})}const k={...t,[ns]:{type:void 0}};b.schema=k,O.schema=k}return l.isMultiSelect(b.schema)?R.jsx(M0,{...b}):im(r)?R.jsx(q0,{...b}):Kc(b.schema)?R.jsx(z0,{...O}):l.isFilesArray(b.schema,r)?R.jsx(U0,{...b}):R.jsx(V0,{...O})}function K0(e){const{schema:t,name:r,uiSchema:n,fieldPathId:i,formData:s,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),U=C($e.NoLabel);let L;const B=b??y??_??r;if(Array.isArray(t.oneOf))L=xn({oneOf:t.oneOf.map(Y=>{if(ue(Y))return{...Y,title:Y.title||(Y.const===!0?q:U)}}).filter(Y=>Y)},n);else{const Y=t.enum??[!0,!1];!k&&Y.length===2&&Y.every(Q=>typeof Q=="boolean")?L=[{value:Y[0],label:Y[0]?q:U},{value:Y[1],label:Y[1]?q:U}]:L=xn({enum:Y},n)}const J=Z.useCallback((Y,Q,X)=>v(Y,i.path,Q,X),[v,i]);return R.jsx(M,{options:{...$,enumOptions:L},schema:t,uiSchema:n,id:i.$id,name:r,onChange:J,onFocus:S,onBlur:E,label:B,hideLabel:!O,value:s,required:o,disabled:c,readonly:l,hideError:u,registry:a,autofocus:m,rawErrors:g,htmlName:i.name})}function G0(e){const[t,r]=Z.useState(!1),{name:n,registry:i,schema:s,uiSchema:a,fieldPathId:o}=e,{globalUiOptions:c}=i,l=pe(a,c),u=_e("CyclicSchemaExpandTemplate",i,l);if(!t)return R.jsx(u,{registry:i,schema:s,uiSchema:a,name:n,fieldPathId:o,onExpand:()=>r(!0)});const{fields:m}=i,{SchemaField:_}=m;return R.jsx(_,{...e,schema:{...s,[Lc]:!1}})}function W0(e){return{type:"string",enum:["string","number","boolean","object","array"],default:"string",title:e}}function J0(e){const t=typeof e;return t==="string"||t==="number"||t==="boolean"?t:t==="object"?Array.isArray(e)?"array":"object":"string"}function Y0(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 X0(e){const{id:t,formData:r,displayLabel:n=!0,schema:i,name:s,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]=Z.useState(J0(r)),h=pe(a),b=cs(nr("__internal_type_selector",f,v)),O=g($e.Type),k=Z.useMemo(()=>W0(O),[O]),$=U=>{U!=null&&(P(U),S(Y0(r,U),v.path,E,t))};if(!f.useFallbackUiForUnsupportedType){const{reason:U=g($e.UnknownFieldType,[String(i.type)])}=e,L=_e("UnsupportedFieldTemplate",_,h);return R.jsx(L,{schema:i,fieldPathId:v,reason:U,registry:_})}const M=_e("FallbackFieldTemplate",_,h),{SchemaField:q}=y;return R.jsx(M,{schema:i,registry:_,typeSelector:R.jsx(q,{fieldPathId:b,name:`${s}__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:R.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 js;(function(e){e.ALL="all",e.SOME="some",e.NONE="none"})(js||(js={}));const Z0=/^\$lookup=(.+)/,Do="layoutGrid";function yu(e,t){return e??t}function Q0(e){return/^\d+?$/.test(e)}const Gr=Xc();function ev(e,t,r,n,i){const s=r?.[mc]??{},a=me(r,rr(e)),o={...a?.[Br]??{},...t,...s},c={...a};Object.keys(o).length>0&&(c[Br]=o),Object.keys(s).length>0&&(c[mc]=s);let{readonly:l}=pe(c);if(i===!0||l===void 0&&n===!0){l=!0;const u=c[Br];u&&bo in u?u[bo]=!0:c[`ui:${bo}`]=!0}return{fieldUiSchema:c,uiReadonly:l}}function tv(e,t,r="$0m3tH1nG Un3xP3cT3d"){const n=[t].flat().sort(),i=[r].flat().sort();switch(e){case js.ALL:return je(n,i);case js.SOME:return n.some(s=>i.includes(s));case js.NONE:return!n.some(s=>i.includes(s));default:return!1}}function Wa(e,t,r){let n={},i=e[t];if(Or(i)){const{children:s,className:a,...o}=i;if(i=s,a){const l=a.split(" ").map(u=>el(r,u,u)).join(" ");n={...o,className:l}}else n=o}if(!Array.isArray(i))throw new TypeError(`Expected array for "${t}" in ${JSON.stringify(e)}`);return{children:i,gridProps:n}}function gu(e,t,r){let n,i=t;if(Q0(r)&&e&&e?.type==="array"&&ns in e){const s=Number(r),a=e[ns];Array.isArray(a)?s>a.length?n=a.at(-1):n=a[s]:n=a,i={[Ue]:t[Ue],path:[...t.path.slice(0,t.path.length-1),s]}}return{rawSchema:n,fieldPathId:i}}function rv(e,t,r,n,i){const{schemaUtils:s,globalFormOptions:a}=e;let o=r,c=i;const l=t.split("."),u=l.pop();let m=s.retrieveSchema(o,n),_=n,v=m.readOnly;l.forEach(g=>{c=nr(g,a,c);const y=m?.[rt];if(y)o=y[g]??{};else if(m&&(Se in m||Ne in m)){const f=Se in m?Se:Ne,C=s.findSelectedOptionInXxxOf(m,g,f,_);o=gr(C,g)}else{const f=gu(m,c,g);o=f.rawSchema??{},c=f.fieldPathId}_=me(_,g,{}),m=s.retrieveSchema(o,_),v=yu(m.readOnly,v)});let S,E=!1;if((!m||Object.keys(m).length===0)&&(m=void 0),m&&u){if(m&&(Se in m||Ne in m)){const y=Se in m?Se:Ne;m=s.findSelectedOptionInXxxOf(m,u,y,_)}c=nr(u,a,c),E=m!==void 0&&Array.isArray(m.required)&&m.required.includes(u);const g=gu(m,c,u);if(g.rawSchema?(m=g.rawSchema,c=g.fieldPathId):(m=m?.[rt]?.[u],m=m&&s.retrieveSchema(m)),v=yu(m?.readOnly,v),m&&(Se in m||Ne in m)){const y=Se in m?Se:Ne,f=Kt(m);S={options:m[y],hasDiscriminator:!!f}}}return{schema:m,isRequired:E,isReadonly:v,optionsInfo:S,fieldPathId:c}}function nv(e,t){let r=e;return typeof r=="string"&&(r=el(t,r)),typeof r=="function"?r:null}function sv(e,t){let r,n=null,i={},s;if(typeof t=="string"||t===void 0)r=t??"";else{const{name:a="",render:o,...c}=t;r=a,i=c,Object.entries(i).forEach(([l,u])=>{if(typeof u=="string"){const m=Z0.exec(u);if(Array.isArray(m)&&m.length>1){const _=m[1];i[l]=el(e,_,_)}}}),n=nv(o,e),!a&&n&&(s=R.jsx(n,{...c,"data-testid":Gr.uiComponent}))}return{name:r,UIComponent:n,uiProps:i,rendered:s}}function Ja(e){const{childrenLayoutGridSchemaId:t,...r}=e,{registry:n,schema:i,formData:s}=r,{schemaUtils:a}=n,o=a.retrieveSchema(i,s);return t.map(c=>Z.createElement(rl,{...r,key:`layoutGrid-${zt(c)}`,schema:o,layoutGridSchema:c}))}function iv(e){const{layoutGridSchema:t,...r}=e,{formData:n,registry:i}=r,{children:s,gridProps:a}=Wa(t,mr.CONDITION,i),{operator:o,field:c="",value:l}=a,u=me(n,rr(c),null);return tv(o,u,l)?R.jsx(Ja,{...r,childrenLayoutGridSchemaId:s}):null}function av(e){const{layoutGridSchema:t,...r}=e,{registry:n,uiSchema:i}=r,{children:s,gridProps:a}=Wa(t,mr.COLUMN,n),o=pe(i),c=_e("GridTemplate",n,o);return R.jsx(c,{column:!0,"data-testid":Gr.col,...a,children:R.jsx(Ja,{...r,childrenLayoutGridSchemaId:s})})}function ov(e){const{layoutGridSchema:t,...r}=e,{registry:n,uiSchema:i}=r,{children:s,gridProps:a}=Wa(t,mr.COLUMNS,n),o=pe(i),c=_e("GridTemplate",n,o);return s.map(l=>R.jsx(c,{column:!0,"data-testid":Gr.col,...a,children:R.jsx(Ja,{...r,childrenLayoutGridSchemaId:[l]})},`column-${zt(l)}`))}function cv(e){const{layoutGridSchema:t,...r}=e,{registry:n,uiSchema:i}=r,{children:s,gridProps:a}=Wa(t,mr.ROW,n),o=pe(i),c=_e("GridTemplate",n,o);return R.jsx(c,{...a,"data-testid":Gr.row,children:R.jsx(Ja,{...r,childrenLayoutGridSchemaId:s})})}function lv(e){const{gridSchema:t,schema:r,uiSchema:n,errorSchema:i,fieldPathId:s,onBlur:a,onFocus:o,formData:c,readonly:l,registry:u,layoutGridSchema:m,..._}=e,{onChange:v}=_,{fields:S}=u,{SchemaField:E,LayoutMultiSchemaField:g}=S,y=sv(u,t),{name:f,UIComponent:C,uiProps:P}=y,{schema:h,isRequired:b,isReadonly:O,optionsInfo:k,fieldPathId:$}=rv(u,f,r,c,s),M=cs($);if(y.rendered)return y.rendered;if(h){const q=k?.hasDiscriminator?g:E,{fieldUiSchema:U,uiReadonly:L}=ev(f,P,n,O,l),B=rr(f);return R.jsx(q,{"data-testid":k?.hasDiscriminator?Gr.layoutMultiSchemaField:Gr.field,..._,name:f,required:b,readonly:L,schema:h,uiSchema:U,errorSchema:me(i,B),fieldPathId:M,formData:me(c,B),onChange:v,onBlur:a,onFocus:o,options:k?.options,registry:u})}return C?R.jsx(C,{"data-testid":Gr.uiComponent,..._,name:f,required:b,formData:c,readOnly:!!O||l,errorSchema:i,uiSchema:n,schema:r,fieldPathId:s,onBlur:a,onFocus:o,registry:u,...P}):null}function rl(e){const{uiSchema:t}=e;let{layoutGridSchema:r}=e;const n=pe(t);if(!r&&Do in n&&ue(n[Do])&&(r=n[Do]),ue(r)){if(mr.ROW in r)return R.jsx(cv,{...e,layoutGridSchema:r});if(mr.COLUMN in r)return R.jsx(av,{...e,layoutGridSchema:r});if(mr.COLUMNS in r)return R.jsx(ov,{...e,layoutGridSchema:r});if(mr.CONDITION in r)return R.jsx(iv,{...e,layoutGridSchema:r})}return R.jsx(lv,{...e,gridSchema:r})}rl.TEST_IDS=Gr;function uv(e){const{fieldPathId:t,title:r,schema:n,uiSchema:i,required:s,registry:a,name:o}=e,c=pe(i,a.globalUiOptions),{title:l}=c,{title:u}=n,m=l||r||u||o;if(!m)return null;const _=_e("TitleFieldTemplate",a,c);return R.jsx(_,{id:Qc(t),title:m,required:s,schema:n,uiSchema:i,registry:a})}function To(e,t,r){const n="!@#!@$@#$!@$#";return e.map(({schema:s})=>s).find(s=>{const a=s[rt]?.[t];return me(a,An,me(a,It,n))===r})}function vu(e,t,r,n,i){const s=t.map(c=>r.retrieveSchema(c,i));let a=e;Se in e?a={...e,[Se]:s}:Ne in e&&(a={...e,[Ne]:s});const o=xn(a,n);if(!o)throw new Error(`No enumOptions were computed from the schema ${JSON.stringify(a)}`);return o}function dv(e){const{name:t,baseType:r,disabled:n=!1,formData:i,fieldPathId:s,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]=Z.useState(vu(_,c,C,m,i)),O=s[Ue],k=Kt(_),$=_e("FieldErrorTemplate",u,c),M=_e("FieldTemplate",u,c),q=zt(_),U=zt(c),L=m?zt(m):"",B=i?zt(i):"";Z.useEffect(()=>{b(vu(_,c,C,m,i))},[q,U,C,L,B]);const{widget:J=k?"radio":"select",title:Y="",placeholder:Q="",optionsSchemaSelector:X=k,hideError:re,...A}=pe(m);if(!X)throw new Error("No selector field provided for the LayoutMultiSchemaField");const w=me(i,X);let j=gr(h[0]?.schema,X);const p=To(h,X,w);j=j?.type?j:{...j,type:p?.type||r};const d=vr(j,J,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=To(h,X,D),K=To(h,X,w);let G=C.sanitizeDataForNewSchema(V,K,i);G&&V&&(G=C.getDefaultFormState(V,G,"excludeObjectChildren")),G&&it(G,X,D),o(G,s.path,void 0,O)},H={enumOptions:h,...A},N=!x&&I.length>0?R.jsx($,{fieldPathId:s,schema:_,errors:I,registry:u}):void 0;return R.jsx(M,{fieldPathId:s,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:N,onChange:o,onKeyRename:$o,onKeyRenameBlur:$o,onRemoveProperty:$o,children:R.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:s.name})})}function bu(e){const{name:t,disabled:r=!1,errorSchema:n,formData:i,fieldPathId:s,onBlur:a,onChange:o,onFocus:c,options:l,readonly:u,registry:m,required:_=!1,schema:v,uiSchema:S}=e,{schemaUtils:E}=m,g=zt(i??null),y=Z.useMemo(()=>l.map(W=>E.retrieveSchema(W,i)),[l,E,g]),[f,C]=Z.useState(()=>{const W=Kt(v);return E.getClosestMatchingOption(i,y,0,W)}),P=Z.useRef(!1),h=Z.useRef(i),b=Z.useRef(s.$id);Z.useEffect(()=>{const W=h.current,te=b.current;if(h.current=i,b.current=s.$id,!je(i,W)&&s.$id===te){if(P.current){P.current=!1;return}const ne=Kt(v),ie=E.getClosestMatchingOption(i,y,f,ne);ie!==f&&C(ie)}});const O=`${s.$id}${v.oneOf?"__oneof_select":"__anyof_select"}`,k=Z.useCallback(W=>{if(r||u)return;const te=W!==void 0?parseInt(W,10):-1;if(te===f)return;const ne=te>=0?y[te]:void 0,ie=f>=0?y[f]:void 0;let ce=E.sanitizeDataForNewSchema(ne,ie,i);ne&&(ce=E.getDefaultFormState(ne,ce,"excludeObjectChildren")),C(te),P.current=!0,o(ce,s.path,void 0,O)},[f,y,r,u,E,i,s,o,O]),{widgets:$,fields:M,translateString:q,globalUiOptions:U}=m,{SchemaField:L}=M,B=_e("MultiSchemaFieldTemplate",m,U),J=Fs(m,v,_,S),Y=os(i),{widget:Q="select",placeholder:X,autofocus:re,autocomplete:A,title:w=v.title,...j}=pe(S,U),p=vr({type:"number"},Q,$),d=n?.[vt]??[],x={...n};delete x[vt];const I=E.getDisplayLabel(v,S,U),T=f>=0&&y[f]||null;let F;if(T){const{required:W,type:te}=v,ne={};W&&(ne.required=W),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}"`):Ne in v&&S&&Ne in S&&(Array.isArray(S[Ne])?z=S[Ne]:console.warn(`uiSchema.anyOf is not an array for "${w||t}"`));let H=S;f>=0&&z.length>f&&(H=z[f]);const N=w?$e.TitleOptionPrefix:$e.OptionPrefix,D=w?[w]:[],V=y.map((W,te)=>{const{title:ne=W.title}=pe(z[te]);return{label:ne||q(N,D.concat(String(te+1))),value:te}}),K=!J||Y?R.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:X,autocomplete:A,autofocus:re,label:w??t,hideLabel:!I,readonly:u}):void 0,G=F&&F.type!=="null"&&R.jsx(L,{...e,schema:F,uiSchema:H})||null;return R.jsx(B,{schema:v,registry:m,uiSchema:S,selector:K,optionSchemaField:G})}function fv(e){const{formData:t,onChange:r,fieldPathId:n}=e;return Z.useEffect(()=>{t===void 0&&r(null,n.path)},[n,t,r]),null}const hv=/\.([0-9]*0)*$/,mv=/[0.]0*$/;function pv(e){const{registry:t,onChange:r,formData:n,value:i}=e,[s,a]=Z.useState(i),{StringField:o}=t.fields,c=Rh(),l=c==="."?"\\.":c;let u=n;const m=Z.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"&&hv.exec(f)?Il(f.replace(mv,"")):Il(f);r(C,S,E,g)},[r,c]);if(typeof s=="string"&&typeof u=="number"){const v=new RegExp(`^(${String(u).replace(".",l)})?${l}?0*$`);s.match(v)&&(u=s)}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 R.jsx(o,{...e,formData:_,onChange:m})}var Hs;function yv(e){if(!Hs){if(typeof document>"u")return;Hs=document.createElement("textarea")}var t=`&${e};`;Hs.innerHTML=t;var r=Hs.value;return r===t?void 0:r}var se=32,ae=9,Zr=13,de=10,Le=96,lt=126,et=91,Ir=94,Pe=62,Wt=35,Sc=37,we=45,Bt=61,ht=92,nt=42,Ze=95,He=60,Em=64,sr=93,Nt=33,Ya=38,Ct=58,wc=70,Pn=102,$a=104,En=119,es=116,Cc=112,Am=115,gv=160,vv=12,bv=44,Fa=59,ls=63,Ht=46,Qe=47,On=39,jn=34,Qr=43,ft=124,kn=123,nl=125,er=40,tr=41,_v=78,Sv=110,wv=79,Cv=111,xm=120,Pm=88,Ec=30,Ae=48,xe=57,ve=65,be=90,ze=97,Xe=122,Xa=128,Qt=32,Ev={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=Ev;function Av(e){if(!Su(e,"---"))return null;let t=3;for(;t=e.length||e[t]!==` `)return null;t++;let r=!1;for(;t=e.length)break;let i=t;if(e[t]==="\r"&&t++,t=ze&&a<=Xe||a>=ve&&a<=be||a>=Ae&&a<=xe||a===Ze){for(s++;s=ze&&a<=Xe||a>=ve&&a<=be||a>=Ae&&a<=xe||a===Ze||a===we||a===Ht);)s++;s=i?r=!0:(a=e.charCodeAt(s),(a===se||a===ae)&&(r=!0)))}}}}return null}var xv=/&([a-zA-Z0-9]+|#[0-9]{1,7}|#x[0-9a-fA-F]{1,6});/gi,Pv={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"},Ov={};function Om(e){if(!e)return Ov;var t={};for(var r in e){var n=r.toLowerCase(),i=Pv[n];if(i)t[i]=e[r];else{var s=r.indexOf(":");s===-1?t[r]=e[r]:t[r.slice(0,s)+r[s+1].toUpperCase()+r.slice(s+2)]=e[r]}}return t}var jv=/(\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(xv,(t,r)=>{var n=yv(r);if(n)return n;if(r[0]==="#"){var i=r[1]==="x"||r[1]==="X"?Number.parseInt(r.slice(2),16):Number.parseInt(r.slice(1),10);return i===0||i>=55296&&i<=57343||i>1114111?"�":i<=65535?String.fromCharCode(i):String.fromCharCode(55296+(i-65536>>10),56320+(i-65536&1023))}return t})}var _u=/(javascript|vbscript|data(?!:image)):/i;function Pr(e){if(_u.test(e))return null;if(e.indexOf("%")===-1)return e;try{let t=decodeURIComponent(e).replace(/[^A-Za-z0-9/:]/g,"");if(_u.test(t))return null}catch{return null}return e}var wt={},jt,ut;for(jt=[192,193,194,195,196,197,224,225,226,227,228,229,230,198],ut=0;ut=ze&&s<=Xe||s>=Ae&&s<=xe){r<0&&(r=i);continue}if(s>=ve&&s<=be){r>=0&&(t+=e.slice(r,i),r=-1),t+=String.fromCharCode(s+Qt);continue}if(s===se||s===we){r>=0&&(t+=e.slice(r,i),r=-1),t+="-";continue}r>=0&&(t+=e.slice(r,i),r=-1);var a=wt[s];a&&(t+=a)}return r>=0&&(t+=e.slice(r)),t}function Su(e,t,r){return e.startsWith(t,r)}var wu=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 Ds(e){let t=e.toLowerCase();if(wu.has(t))return!0;let r=t.indexOf(":");return r!==-1?(t=t.slice(r+1),wu.has(t)):!1}var bn=1,Cu=2,Xn=4,Eu=8,kv=16,Yt=32,Fr=64,Iv=(()=>{var e=new Uint8Array(128),t;for(e[ae]=bn,e[de]=bn|Cu,e[vv]=bn,e[Zr]=bn|Cu,e[se]=bn,t=Nt;t<=Qe;t++)e[t]=Xn;for(t=Ct;t<=Em;t++)e[t]=Xn;for(t=et;t<=Le;t++)e[t]=Xn;for(t=kn;t<=lt;t++)e[t]=Xn;for(t=Ae;t<=xe;t++)e[t]=kv;for(t=ve;t<=be;t++)e[t]=Eu;for(t=ze;t<=Xe;t++)e[t]=Eu;return e})(),Nv=/[\p{P}\p{S}]/u,Rv=new RegExp("\\p{Zs}","u"),dn=[];function $v(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 i=0,s=0;for(t===-1?s=r:r===-1?s=t:s=t\s+<").replace(/\n+/g," ").trim()}function Dv(e,t,r){let n=r??e.length;for(;t0&&(e[t-1]===` `||e[t-1]==="\r");)t--;return`${e.slice(0,t).replace(Mv,"")} `}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 km(e){for(var t=0;t`,a=i.toLowerCase().indexOf(s);if(a!==-1){var o=i.slice(a+s.length).replace(/<\/[a-z][a-z0-9-]*\s*>/gi,"");o.trim()&&(n=!0)}}n||(r.c=!1)}"children"in e[t]&&e[t].children&&km(e[t].children)}}function Uv(e,t){for(var r=0;r0&&o.push({type:ee.paragraph,children:i.slice(0,s)});var c=[];if(s+1!(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 Lv(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 Au(e,t,r,n){var i;return t===void 0?i=Lv(r):i=t.length>0&&t.charCodeAt(0)>se?` ${t}`:t,`<${e}${i}${n}`}function xu(e){var t=e.tag,r=e.type===ee.htmlSelfClosing,n=e,i=n.b,s=``;if(!r&&n.a)return{kind:"literal",literal:(n.h||s)+(n.e||"")};if(r){var a=e;return a.a?{kind:"literal",literal:a.h||s}:a.m?{kind:"literal",literal:a.m}:{kind:"literal",literal:Au(t,i,e.attrs," />")}}var o=Au(t,i,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:s}:{kind:"literal",literal:n.j};if(n.c&&!l)return{kind:"literal",literal:o+(n.e||"")+(n.h||s)};if(c!=null&&c.length>0){for(var u="",m=0;m0&&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 zv(e,t,r,n){var i=t(e,r,n);return i===null?null:Hv(i)}function Bv(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 Ac(e,t,r){if(t.indexOf(".")===-1)return e?.[t]||r;for(var n=e,i=t.split("."),s=0;s=123){t=!0;break}}if(!t)return e;for(var i="",r=0;r=Ae&&s<=xe||s>=ve&&s<=wc||s>=ze&&s<=Pn)&&(a>=Ae&&a<=xe||a>=ve&&a<=wc||a>=ze&&a<=Pn)){i+=e[r]+e[r+1]+e[r+2],r+=2;continue}}if(n>=55296&&n<=57343){if(n<=56319&&r+1=56320&&o<=57343){i+=encodeURI(e[r]+e[r+1]),r++;continue}}i+=e[r];continue}i+=encodeURI(e[r])}return i}function Kv(...e){return e.filter(Boolean).join(" ")}var Gv=new Set(["title","textarea","style","xmp","iframe","noembed","noframes","script","plaintext"]),Da=/<(\/?)(title|textarea|style|xmp|iframe|noembed|noframes|script|plaintext)(\s|>|\/)/gi;function Pu(e){return Gv.has(e.toLowerCase())}function Wv(e){return Da.lastIndex=0,Da.test(e)}function Ou(e){return Da.lastIndex=0,e.replace(Da,(t,r,n,i)=>`<${r}${n}${i}`)}function sl(e,t){var r=e||{},n=r.slugify,i;if(n){var s=n;i=a=>s(a,In)}else i=In;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:i,tagfilter:Wn(r)}}var Jv=/^<([a-zA-Z][a-zA-Z0-9-]*)\s[^>]*>/,Yv=/^<[A-Z]/,xc=["script","pre","style","textarea"],Ts=new Set(xc),Xv=/<(?:pre|script|style|textarea)\b/i,ju=/<(?:pre|script|style|textarea)\b/iy,Mo=/^(\s{0,3}#[#\s]|\s{0,3}[-*+]\s|\s{0,3}\d+\.\s|\s{0,3}>\s|\s{0,3}```)/m,ku=/^<([a-z][^ >/\n\r]*) ?([^>]*?)>/im,Im=new Uint8Array(128);(()=>{for(var e=[Le,nt,Ze,lt,Bt,et,Nt,He,ht,Ya,de,$a,En,Pn],t=0;t=i)return!1;e.charCodeAt(n)===ft&&n++;for(var s=0;n=i)break;if(e.charCodeAt(n)===ft&&s>0){for(var a=n+1;a=i)return!0}if(e.charCodeAt(n)===Ct&&n++,n>=i||e.charCodeAt(n)!==we)return!1;for(;n0}var eb=/[\u0000-\u001F\u007F]/g,tb={action:1,background:1,cite:1,data:1,formaction:1,href:1,longdesc:1,poster:1,src:1,"xlink:href":1},rb=/&#(x[0-9a-f]+|[0-9]+);?/gi;function nb(e){return e.indexOf("&#")===-1?e:e.replace(rb,(t,r)=>{var n=r.charCodeAt(0)===xm||r.charCodeAt(0)===Pm?Number.parseInt(r.slice(1),16):Number.parseInt(r,10);return n>0&&n<=1114111?String.fromCodePoint(n):t})}function sb(e,t,r){if(r&&t.charCodeAt(0)===kn)return!1;var n=e.charCodeAt(0),i=e.charCodeAt(1);if((n===Cv||n===wv)&&(i===Sv||i===_v))return!(r&&t==="");var s=e.toLowerCase();if(s==="srcdoc")return!0;if(s==="style")return/url\s*\(\s*(javascript|vbscript|data:(?!image\/))/i.test(t);if(tb[s]===1){var a=nb(Wr(t));if(Pr(a)===null)return!0;var o=a.replace(eb,"");return o!==a&&Pr(o)===null}return!1}function Pc(e){return"<"+(e.f?"/":"")+e.tag+e.g+e.b+(e.n?e.r?" />":"/>":">")}function Nu(e,t,r,n){for(var i=[],s=t,a=0;as){var c=e.slice(s,o).trim();c&&i.push(c)}s=n[a+1]}if(s=ze&&a<=Xe||a>=ve&&a<=be))return null;for(;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(s,r);if(!o)return null;let c=o.charCodeAt(0),l=c>=ve&&c<=be||o.indexOf("-")!==-1,u=r;for(;rv&&e.charCodeAt(r-1)===se;let B=g?Nu(e,v,r,g):e.slice(v,r);return{r:E,u:l,f:i,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===Ze||f===Ct))return null;for(r++;r=ze&&C<=Xe||C>=ve&&C<=be||C>=Ae&&C<=xe||C===Ze||C===Ht||C===Ct||C===we)r++;else break}for(var P=e.slice(y,r),h=r;r=n)return null;if(b=e.slice($,r),r++,r0;){var C=e.charCodeAt(r);C===kn?q++:C===nl&&q--,r++}b=e.slice($,r),O=r}else{for(var $=r;r=c){s=!1,n=o<0?i:o+1;continue}if(u<4){var m=e.charCodeAt(l);if(m===Le||m===lt){for(var _=m,v=0,S=l;S=3){var E=!0;if(_===Le){for(var g=S;g=v){for(;f=i||e.charCodeAt(f)===de){n=f>=i?i:f+1;break}}}for(;y=i&&(n=i,a=!0);continue}}}}for(var b=l;b=4)break;s=!1}if(!s&&u<4&&b=3&&M>=c)}else s=!0;n=o<0?i:o+1}return a}function Rm(e,t,r){let n=e.length;if(e.charCodeAt(t)!==et)return null;let i=t+1n||e.charCodeAt(s-1)!==sr)return null;let o=e.slice(t+1,s-1);if(o.length>999)return null;let c=Aa(o);if(!c||s>=n||e.charCodeAt(s)!==Ct)return null;s++;let l=!1;for(;s=n||e.charCodeAt(s)!==Pe)return null;u=e.slice(m,s),s++;for(var _=e.indexOf(` `,s),v=_<0?n:_,S=s;S=n||e.charCodeAt(U)===de)&&(C=e.slice(M,$),P=!0,h=U0,i=0;i126||s>=ve&&s<=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 il(e){return e?@[\\\]^_`{|}~])/g,"$1")}var Oc=null,jc=-1,xa=-1;function Ve(e,t){if(t>=jc&&t<=xa&&e===Oc)return xa;var r=e.indexOf(` `,t),n=r<0?e.length:r;return Oc=e,jc=t,xa=n,n}function Ie(e,t){let r=Ve(e,t);return r=r}function ab(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 i=n+1,s=`${e}-${i}`;r[s]!==void 0;)i++,s=`${e}-${i}`;return r[e]=i,r[s]=0,s}function ob(e,t,r,n){let i=Ve(e,t);if(at(e,t,i),qe>3)return null;let s=t+De;if(e.charCodeAt(s)!==Wt)return null;let a=en(e,s,i,35);if(a<1||a>6||(s+=a,ss&&e.charCodeAt(o-1)===se;)o--;for(var c=o;o>s&&e.charCodeAt(o-1)===Wt;)o--;if(os&&e.charCodeAt(o-1)===se;)o--;else o=c;let l=e.slice(s,o),u=rs(l,!1,r,n);return{node:{type:ee.heading,level:a,children:u,id:""},end:Ie(e,i)}}function cb(e,t,r){var n=e.charCodeAt(t);if(n!==Bt&&n!==we)return!1;for(var i=t;i=r}function Jr(e,t){let r=Ve(e,t);if(at(e,t,r),qe>3)return null;let n=t+De,i=e.charCodeAt(n);if(i!==we&&i!==nt&&i!==Ze)return null;let s=0;for(;n3)return null;let i=qe,s=t+De,a=e.charCodeAt(s);if(a!==Le&&a!==lt)return null;let o=en(e,s,n,a);if(o<3)return null;s+=o;let c=Rs(e,s,n),l=n;if(a===Le){for(let B=c;Bc&&(e.charCodeAt(l-1)===se||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=ts(m);var S;if(_){Iu.lastIndex=0;for(var E;(E=Iu.exec(_))!=null;)S||(S={}),S[E[1]]=E[2]===void 0?E[3]:E[2]}let g=Ie(e,n),y=e.length,f=e.length;var C;a===Fu&&o===Du?C=Tu:(C=String.fromCharCode(a).repeat(o),Fu=a,Du=o,Tu=C);for(var P=g;P0&&O<4&&e.charCodeAt(b-1)===se;)b--,O++;if(O<=3&&(b===0||e.charCodeAt(b-1)===de)){for(var k=h+o;kg&&e.charCodeAt(y-1)===de?e.slice(g,y-1):e.slice(g,y);else{M="";for(var q=g;q0&&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 Mu(e,t,r){for(var n=0,i=t;i=4&&(n+=s,i=a);break}if(i!==a)break;continue}if(qe<4)break;let v=0,S=0;var c=0;for(let E=i;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;m0&&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:i}:null}function db(e,t,r,n){let i=Ve(e,t);if(at(e,t,i),qe>3)return null;let s=t+De;if(e.charCodeAt(s)!==Pe)return null;let a="",o=t,c,l=!1,u=!1,m=!1;for(;o0,o=Ie(e,Y)}else if(a&&!kt(e,o,Y)&&u){if(qe<4){var $=o+De,M=$=Ae&&M<=xe){for(var q=$;q=Ae&&e.charCodeAt(q)<=xe;)q++;if(q3)return null;var n=t+De;if(n>=r)return null;var i=e.charCodeAt(n),s=qe,a=n,o=n;if(i===we||i===nt||i===Qr){if(a=n+1,a=Ae&&i<=xe){for(;oxe)break;o++}if(o>n&&o=r)return{ordered:i>=Ae&&i<=xe,marker:i>=Ae&&i<=xe?e[o]:e[n],start:i>=Ae&&i<=xe?Number.parseInt(e.slice(n,o),10):void 0,contentStart:u,contentCol:m+1,markerCol:s,isEmpty:!0};for(;v=r,y=S-m;return g||y>4?(S=m+1,v=u+1,_=1):_===0&&(S=m+1,v=u,_=1),{ordered:i>=Ae&&i<=xe,marker:i>=Ae&&i<=xe?e[o]:e[n],start:i>=Ae&&i<=xe?Number.parseInt(e.slice(n,o),10):void 0,contentStart:v,contentCol:S,markerCol:s,isEmpty:g}}var Qn=0;function qu(e,t,r,n){var i=0,s=t;for(Qn=0;sn){Qn=i+o-n,s++,i=n;break}i+=o}else if(a===se)i++;else break;s++}return s}function Uu(e,t,r,n){var i=Ve(e,t),s=Dr(e,t,i);if(!s)return null;var a=[],o=t,c=s.contentCol,l="",u=s.isEmpty,m=!1,_=!1;if(!s.isEmpty){for(var v=!1,S=s.contentStart;S0)for(var f=0;f0||$=c){var A=qu(e,o,b,c);if(Qn>0){for(var w="",j=c,p=0;p=Ae&&N<=xe&&Dr(e,o,b)!=null;if(!D){l+=`${e.slice(H,b)} `,o=Ie(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=ge&&Ye.slice(ye).trim()===""&&(he=!1),te=fe=0?ce=!0:ne&&(ie=!0),te=fe=0){if(qe>=Fe){te=fe=3){if(ie&&ne){V=!0;break}he=!0,le=ke,ge=Et,ne=!0,te=fe0&&Rt.charCodeAt(_t-1)===de;)_t--;var xt=_t=3&&xt.charCodeAt(0)===et){var Nr=xt[1];(Nr===" "||Nr==="x"||Nr==="X")&&xt.charCodeAt(2)===sr&&(sn={type:ee.gfmTask,completed:Nr==="x"||Nr==="X"},xt=xt.slice(3))}var st;if(At.isEmpty&&xt.trim()==="")st=[];else if(V){var an=r.inList;r.inList=!0;var qs=r.i;r.i=qs||pt!==a.length-1,st=Yr(xt,r,n),r.i=qs,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{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)===nl){var i=o.slice(1,-1);if(i.length>0){var s=i.charCodeAt(0);if(s===et||s===kn)try{n[a]=JSON.parse(i);continue}catch{}}if(i==="true"){n[a]=!0;continue}if(i==="false"){n[a]=!1;continue}if(r?.evalUnserializableExpressions)try{n[a]=(0,eval)(`(${i})`);continue}catch{}n[a]=i}else n[a]=o}return n}function zr(e,t,r){let n=t.length;if(n===0)return r;var i=t.charCodeAt(0),s=i>=ve&&i<=be||i>=ze&&i<=Xe;if(!s){for(var a=String.fromCharCode(i),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=ve&&_<=be&&(_+=Qt),v>=ve&&v<=be&&(v+=Qt),_!==v){u=!1;break}}if(u)return l;c=l+1}return-1}i>=ve&&i<=be&&(i+=Qt);for(let E=r;E<=e.length-n;E++){var S=e.charCodeAt(E);if(S>=ve&&S<=be&&(S+=Qt),S!==i)continue;let g=!0;for(let y=1;y=ve&&f<=be&&(f+=Qt),C>=ve&&C<=be&&(C+=Qt),f!==C){g=!1;break}}if(g)return E}return-1}function fb(e,t,r){let n=t.length;var i=t.charCodeAt(0);i>=ve&&i<=be&&(i+=Qt);for(let a=Math.min(r,e.length-n);a>=0;a--){var s=e.charCodeAt(a);if(s>=ve&&s<=be&&(s+=Qt),s!==i)continue;let o=!0;for(let c=1;c=ve&&l<=be&&(l+=Qt),u>=ve&&u<=be&&(u+=Qt),l!==u){o=!1;break}}if(o)return a}return-1}var Ma=-1;function kc(e,t,r){let n=r.toLowerCase(),i=`<${n}`,s=`0;){let m=zr(e,i,o),_=zr(e,s,o);if(_===-1)return-1;if(m!==-1&&m<_){let v=fr(e,m);v?(v.tag.toLowerCase()===n&&!v.f&&!v.n&&!Ds(v.tag)&&a++,o=v.end):o=m+1}else{var l=_+s.length,u=l3&&!r.inHTML)return null;var s=t+De;if(e.charCodeAt(s)!==He)return null;var a=e.indexOf(">",s+1);if(a!==-1&&a=1&&c<=5){var l=e.length;if(c===1){for(var u=e.length,m=0;m`,s);_>=0&&_",u);l=v>=0?Ie(e,v+1):e.length}}else{var S=c===2?"-->":c===3?"?>":c===4?">":"]]>",E=e.indexOf(S,s);E>=0&&(l=Ie(e,E+S.length))}var g=e.slice(s,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,s),P={},h;C&&!C.f&&(P=dr(C.attrs,y,n),h=C.g+C.b);var b=[],O=y.toLowerCase(),k=`0&&B.charCodeAt(B.length-1)===de;)B=B.slice(0,-1);B&&(U=qt(B))}else if(C&&!C.f){var J=C.end-s;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=J;g.charCodeAt(Q)===de&&Q++;for(var X=$;X>Q;){var re=g.charCodeAt(X-1);if(re!==se&&re!==ae&&re!==de&&re!==Zr)break;X--}var A=g.slice(Q,X);A&&(U=qt(A));for(var w=g.slice($);w.length>0&&w.charCodeAt(w.length-1)===de;)w=w.slice(0,-1);L=qt(w),M=g.slice(J,$).trim()}}var j=C?C.f:!1;return{node:{type:ee.htmlBlock,tag:y,attrs:P,b:h,children:b,e:U,h:L,j:q,text:M,c:!0,a:j},end:l}}if(c===6||c===7){var p=$u(e,t),d=p0;){var he=zr(V,`<${z}`,ce),le=zr(V,te,ce);if(le===-1)break;if(he!==-1&&he=2&&xt===He)){tt=!0;break}if(Rt=!1,xt===He){var sn=e.charCodeAt(_t+1)|32;if((sn===Cc||sn===Am||sn===es)&&(ju.lastIndex=_t,ju.test(e))){Ke=!0;break}}_t++}}if(Et&&!tt&&!Ke){var Nr=Ve(e,oe);d=Nr,I=Ie(e,Nr),V=e.slice(s,d),x=e.slice(s,d),K=dt-s,G=oe-s,W=!0}}}}var st=T.b.indexOf(` `)!==-1||T.g.indexOf(` `)!==-1,an=!1;if(K!==-1){var qs=V.slice(G).trim();an=qs.length===0}var _r=!1,on=d,Rr=I;if(K!==-1){var or=s+G,$t=Ve(e,or-1);if(or<$t){for(var cr=or;cr<$t&&(e.charCodeAt(cr)===se||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=Ie(e,$t);if(cn=2&&Dt.charCodeAt(0)===de&&Dt.charCodeAt(Dt.length-1)===de&&!ml;up&&!pl&&!oo?Dn=[{type:ee.text,text:Tn}]:lp||oo?(r.inline=!1,Dn=Yr(Dt,r,n)):(r.inline=!0,Dn=rs(Tn,!1,r,n))}r.inline=ip,r.inHTML=ap,r.d=op}}var yl=!1;if(c===6&&K!==-1&&!r.inHTML&&!st){var dp=/<[a-zA-Z][^>]*>/.test(Dt),fp=Dt.indexOf(` `)!==-1||Mo.test(Dt);dp&&!fp&&(yl=!0)}var hp=!W&&(r.inHTML||c===7||st||!an||yl);if(hp){var us,lr,gl=!1;if(K!==-1&&_r){var vl=!1;if(r.inHTML&&G1&&co.charCodeAt(0)===He&&co.charCodeAt(1)!==Qe}lr=vl?V.slice(T.end-s):Dt,gl=!0}else(c===7||r.inHTML)&&K!==-1?(lr=V.slice(T.end-s),lr.charCodeAt(0)===de&&(lr=lr.slice(1))):_r?us=e.slice(s,on):st?us=x:(lr=V.slice(T.end-s),lr.charCodeAt(0)===de&&(lr=lr.slice(1)));var bl=us!==void 0,lo=qt(us===void 0?lr||"":us),_l={type:ee.htmlBlock,tag:F,attrs:dr(T.attrs,F,n),b:T.g+T.b,children:Dn,e:bl?void 0:lo,j:bl?lo:void 0,text:lo,c:!0,a:!1};return gl&&(_l.x=!0),{node:_l,end:Rr}}var Sl=qt(Dt);return{node:{type:ee.htmlBlock,tag:F,attrs:dr(T.attrs,F,n),b:T.g+T.b,children:Dn,e:W?void 0:Sl,text:Sl,c:!1,a:!1},end:Rr}}var Ls=x.match(/^<(\/?)([a-zA-Z][a-zA-Z0-9-]*)/),mp=Ls?Ls[2]:"div",uo=Ls?Ls[1]==="/":!1,fo,wl,Cl,Vs="";if(uo){var ho=x.indexOf(">");ho===-1?fo=x:(fo=x.slice(0,ho+1),Vs=x.slice(ho+1),Vs&&(wl=qt(Vs)))}else Cl=qt(x);return{node:{type:ee.htmlBlock,tag:mp,attrs:{},children:[],e:wl,h:fo,j:Cl,text:uo?Vs:x,c:!0,a:uo},end:I}}var St=fr(e,s);if(!St)return null;var $r=St.tag,mo=$r.toLowerCase(),El=$r.charCodeAt(0),po=El>=ve&&El<=be;if(!(po||Ta.has(mo)||Ts.has(mo)||mo.includes("-")))return null;if(St.f)return{node:{type:ee.htmlSelfClosing,tag:$r,attrs:{},h:e.slice(s,St.end),a:!0},end:St.end};var Mn=kc(e,St.end,$r),ds=[];if(Mn!==-1){var pp=Ma,zs=e.slice(St.end,pp),Bs=zs.trim();if(Bs){var yp=zs.indexOf(` `)!==-1,gp=Mo.test(Bs),vp=ku.test(Bs),bp=r.inline,_p=r.inHTML,Sp=r.d;r.inHTML=!0,r.d=(r.d||0)+1,yp||gp||vp?(r.inline=!1,ds=Yr(zs,r,n)):(r.inline=!0,ds=rs(Bs,!1,r,n)),r.inline=bp,r.inHTML=_p,r.d=Sp}var wp=Ve(e,Mn),Cp=e.slice(Mn,wp).trim(),Al=Cp?Mn:Ie(e,Mn),xl=po?e.slice(s,Mn):e.slice(s,Al);return{node:{type:ee.htmlBlock,tag:$r,attrs:dr(St.attrs,$r,n),b:St.g+St.b,children:ds,j:qt(xl),text:po?zs:xl,c:!0,a:!1},end:Al}}var fs=$u(e,St.end),Ep=fs=ve&&i<=be)return 4;if(e.slice(r+1,r+8)==="[CDATA[")return 5}for(var s=e.charCodeAt(r)===Qe,a=s?r+1:r,o=a;o=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(Ts.has(l.toLowerCase())){if(s)return 0;var u=e.charCodeAt(o);return u===se||u===ae||u===Pe||u===de||o>=n?1:0}if(Ta.has(l.toLowerCase())){if(s){for(var m=o;mn&&(e.charCodeAt(i-1)===se||e.charCodeAt(i-1)===ae);)i--;nn&&e.charCodeAt(i-1)===ft&&(i-2{var y=g.indexOf("\\|")===-1?g:g.replace(/\\\|/g,"|");return y?rs(y,!1,t,r):[]})}function Vu(e,t,r,n){let i=Ve(e,t);var s=e.indexOf("|",t);if(s<0||s>=i)return null;let a=Ie(e,i);if(a>=e.length)return null;let o=Ve(e,a);if(!Nm(e,a,o))return null;let c=e.slice(t,i),l=e.slice(a,o);for(var u=[],m=0,_=l.length;m<_&&(l.charCodeAt(m)===se||l.charCodeAt(m)===ae);)m++;for(m<_&&l.charCodeAt(m)===ft&&m++;m<_;){for(;m<_&&(l.charCodeAt(m)===se||l.charCodeAt(m)===ae);)m++;if(m>=_||l.charCodeAt(m)===ft)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)===se||l.charCodeAt(m)===ae);)m++;m<_&&l.charCodeAt(m)===ft&&m++}let E=Lu(c,r,n);if(u.length!==E.length)return null;let g=[],y=Ie(e,o);for(;y=3)break}}g.push(Lu(k,r,n)),y=Ie(e,O)}if(n.optimizeForStreaming&&g.length===0)return null;for(var h=E.length,b=0;bh&&(g[b].length=h);return{node:{type:ee.table,header:E,cells:g,align:u},end:y}}function mb(e,t,r){var n=Ve(e,t);if(at(e,t,n),qe>3)return null;var i=t+De;if(e.charCodeAt(i)!==et)return null;if(i+1=n||e.charCodeAt(t+1)!==Ir)return null;for(var i=t+2,s=i;i=n)return null;var a=`^${e.slice(s,i)}`.toLowerCase();if(i++,i>=n||e.charCodeAt(i)!==Ct)return null;for(i++;i=2&&!kt(e,l,u))c+=` ${e.slice(l,u)}`,l=Ie(e,u);else if(kt(e,l,u)){var m=Ie(e,u);if(m=2){c+=` `,l=Ie(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 yb(e,t,r,n){let i=t,s=0,a=0,o=-1;for(;i=0?o:Ve(e,i);if(o=-1,kt(e,i,L))break;if(at(e,i,L),qe<4&&a>0&&!r.l){let J=e.charCodeAt(i+De);if(J===Bt||J===we){let Y=i+De;for(;Y=L){s=J===Bt?1:2,i=Ie(e,L);break}}}a=L;let B=Ie(e,L);if(B=1&&u<=6&&(l>=J||e.charCodeAt(l)===se||e.charCodeAt(l)===ae)){i=B;break}}if(Y===Le||Y===lt){for(var m=B+De,_=0;m=3){i=B;break}}if(Y===He){var v=B+De+1,S=v=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=Ta.has(e.slice(g,y).toLowerCase()))}else if(!E){for(var f=v;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=Ta.has(C)||Ts.has(C)}}if(E&&Fm(e,B,r,n)){i=B;break}}if(Y===we||Y===nt||Y===Qr){let Q=B+De+1;if(Q=Ae&&Y<=xe){let Q=B+De;for(;Q=Ae&&e.charCodeAt(Q)<=xe;)Q++;if(Qt&&(e.charCodeAt(O-1)===de||e.charCodeAt(O-1)===Zr||e.charCodeAt(O-1)===se||e.charCodeAt(O-1)===ae);)O--;for(var k=t;k=O)return null;for(var $=!1,M=k;M=r)return null;let a=en(e,s,r,96);if(a===n){let o=e.slice(t+n,s);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:s+a}}i=s+a}return null}function al(e,t,r){if(e.charCodeAt(t)!==Le)return t;let n=en(e,t,r,96),i=t+n;for(;i=r)return t;let a=en(e,s,r,96);if(a===n)return s+a;i=s+a}return t}function vb(e,t,r){if(e.charCodeAt(t)!==He)return t;if(t+1",t+4);return l>=0?l+3:t}let n=t+1,i=n;for(;n=ve&&l<=be||l>=ze&&l<=Xe||l>=Ae&&l<=xe||l===we)n++;else break}if(n===i)return t;let s=e.slice(i,n).toLowerCase(),a=!1;for(;n0;)if(e.charCodeAt(n)===He)if(n+1=ve&&e.charCodeAt(u)<=be||e.charCodeAt(u)>=ze&&e.charCodeAt(u)<=Xe);)u++;if(e.slice(l,u).toLowerCase()===s){for(;u=ve&&e.charCodeAt(u)<=be||e.charCodeAt(u)>=ze&&e.charCodeAt(u)<=Xe);)u++;e.slice(l,u).toLowerCase()===s&&c++,n++}else n++;return n}function bb(e,t,r,n,i){if(e.charCodeAt(t)!==lt||t+1>=r||e.charCodeAt(t+1)!==lt)return null;let s=t+2;for(;s+1s){s=o;continue}}if(a===lt&&e.charCodeAt(s+1)===lt){let o=e.slice(t+2,s),c=pr(o,0,o.length,n,i);return{node:{type:ee.textFormatted,tag:"del",children:c},end:s+2}}a===ht&&s+1=r||e.charCodeAt(t+1)!==Bt)return null;let s=t+2;for(;s+1s){s=o;continue}}if(a===Bt&&e.charCodeAt(s+1)===Bt&&s>t+2){let o=e.slice(t+2,s),c=pr(o,0,o.length,n,i);return{node:{type:ee.textFormatted,tag:"mark",children:c},end:s+2}}a===ht&&s+10?e.charCodeAt(t-1):32,a=t+i0?zu(s,e,t-1):!1,u=t+if;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,U=M.node;q.text=q.text.slice(0,q.text.length-k),U.text=U.text.slice(k);for(var L=[],B=$.next;B&&B!==M;)L.push(B.node),B=B.next;var J={type:ee.textFormatted,tag:O?"strong":"em",children:L},Y={node:J,prev:$,next:M};$.next=Y,M.prev=Y;for(var Q=C+1;Q0&&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 Gs(e,t,r,n){return t(e,r,n)===null?null:e}var Hu=0,Ic=0,Ku=0,Nc=0,Gu=0,Rc=0,qo=0,Vt=0;function Cb(){return qo===2147483647&&(Ic=0,Nc=0,Rc=0,Pa=0,qo=0),++qo}var Uo=null,Pa=0,Ws=[],Lo=256;function Wu(e,t,r,n,i){let s=e.charCodeAt(t)===Nt,a=s?t+1:t;if(e.charCodeAt(a)!==et||Nc===Vt&&a>=Ku)return null;var o=Pa===Vt?Uo: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 Ku=a,Nc=Vt,null;l=a+1;var m=0;Ws[m++]=a;for(var _=r-a>=Lo;l0;){var v=e.charCodeAt(l);if(v===ht&&l+1l){l=S;continue}}if(v===He){var E=Dm(e,l,r);if(E){l=E.end;continue}var g=vb(e,l,r);if(g>l){l=g;continue}}if(v===et)Ws[m++]=l;else if(v===sr){var y=Ws[--m];o===null&&_&&l-a>=Lo&&(o=Uo=new Int32Array(r),Pa=Vt),o!==null&&(o[y]=l+1)}l++}if(m>0){if(o===null&&_&&l-a>=Lo&&(o=Uo=new Int32Array(r),Pa=Vt),o!==null)for(;m>0;)o[Ws[--m]]=-1;return null}}var f=l-1,C=e.slice(a+1,f),P=l=r||e.charCodeAt(k)!==Pe)&&(b=!1),b&&(O=e.slice(l,k),k++)}else if(b){var $=Ic===Vt?Hu:-1;if($>=0&&l>=$)b=!1;else{for(var M=0,q=!1;k=r&&!q&&($<0||l<$)&&(Hu=l,Ic=Vt),O=e.slice(l,k)}}if(b){for(l=k;l=r?b=!1:(L=e.slice(Y,l),l++)}}if(b){for(;l=r||e.charCodeAt(l)!==tr)&&(b=!1)}}if(b){if(l++,O=Wr(ts(O)),L!==void 0&&(L=Wr(ts(L))),s){var Q=pr(C,0,C.length,n,i),X=qa(Q);return{node:{type:ee.image,target:Gs(O,i?.sanitizer||Pr,"img","src"),alt:X,title:L},end:l}}var re=n.inAnchor;n.inAnchor=!0;var T=re?[{type:ee.text,text:C}]:pr(C,0,C.length,n,i);return n.inAnchor=re,!n.inAnchor&&$c(T)?null:{node:{type:ee.link,target:Gs(O,i?.sanitizer||Pr,"a","href"),title:L,children:T},end:l}}l=f+1,h=!0}var A="",w=l;if(!h&&P===et){var j=l+1;w=j;for(var p=!1;w=r)return null;var d=e.slice(j,w);if(d.trim())A=Aa(d);else{if(Ru(C))return null;A=Aa(C)}w+=1}else{if(Ru(C))return null;A=Aa(C)}var x=n.refs?.[A];if(!x)return null;if(s)return{node:{type:ee.image,target:Gs(x.target,i?.sanitizer||Pr,"img","src"),alt:qa(pr(C,0,C.length,n,i)),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,i);return n.inAnchor=I,!n.inAnchor&&$c(T)?null:{node:{type:ee.link,target:Gs(x.target,i?.sanitizer||Pr,"a","href"),title:x.title,children:T},end:w}}function Dm(e,t,r){if(e.charCodeAt(t)!==He)return null;for(var n=t+1;n=r||e.charCodeAt(n)!==Pe)return null;var s=e.slice(t+1,n),a=s.match(/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^\x00-\x20]*)$/);return a?{node:{type:ee.link,target:s,title:void 0,children:[{type:ee.text,text:s}]},end:n+1}:s.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(s)?{node:{type:ee.link,target:`mailto:${s}`,title:void 0,children:[{type:ee.text,text:s}]},end:n+1}:null}function Eb(e,t,r,n){if(e.charCodeAt(t)!==et||t+1>=r||e.charCodeAt(t+1)!==Ir||Rc===Vt&&t>=Gu)return null;let i=t+2;for(;i=r)return Gu=t,Rc=Vt,null;if(e.charCodeAt(i)!==sr)return null;let s=e.slice(t+2,i);return s?{node:{type:ee.footnoteReference,target:`#${In(s)}`,text:s},end:i+1}:null}function Ab(e,t,r,n){if(n.disableBareUrls)return null;var i="",s=!1,a=e.charCodeAt(t);if(a===$a||a===72?t+8<=r&&e.charCodeAt(t+1)===es&&e.charCodeAt(t+2)===es&&e.charCodeAt(t+3)===Cc&&(e.charCodeAt(t+4)===Am&&e.charCodeAt(t+5)===Ct&&e.charCodeAt(t+6)===Qe&&e.charCodeAt(t+7)===Qe?i="https://":e.charCodeAt(t+4)===Ct&&e.charCodeAt(t+5)===Qe&&e.charCodeAt(t+6)===Qe&&(i="http://")):a===Pn||a===70?t+6<=r&&e.charCodeAt(t+1)===es&&e.charCodeAt(t+2)===Cc&&e.charCodeAt(t+3)===Ct&&e.charCodeAt(t+4)===Qe&&e.charCodeAt(t+5)===Qe&&(i="ftp://"):(a===En||a===87)&&t+4<=r&&e.charCodeAt(t+1)===En&&e.charCodeAt(t+2)===En&&e.charCodeAt(t+3)===Ht&&(i="www.",s=!0),!i)return null;let o=t+i.length;for(;ot+i.length;){let b=e.charCodeAt(_-1);if(b===Ht||b===bv||b===Ct||b===Nt||b===ls||b===tr||b===nt||b===Ze||b===lt){if(b===tr){if(c>=l)break;l--}_--}else if(b===Fa){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)===Ya?_=v:_--}else break}if(_<=t+i.length)return null;var S=t+(s?4:i.length),E=e.indexOf("/",S);if((E<0||E>_)&&(E=_),s&&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=ve&&a<=be||a>=ze&&a<=Xe||a>=Ae&&a<=xe||a===Ht||a===Nt||a===Wt||a===36||a===Sc||a===Ya||a===On||a===nt||a===Qr||a===Qe||a===Bt||a===ls||a===Ir||a===Ze||a===Le||a===kn||a===ft||a===nl||a===lt||a===we)i++;else break}if(i===s||i>=r||e.charCodeAt(i)!==Em)return null;i++;for(var o=i,c=-1,l=i;i=ve&&a<=be||a>=ze&&a<=Xe||a>=Ae&&a<=xe)i++;else if((a===we||a===Ze)&&i>o)i++;else if(a===Ht){if(i===o)break;var u=e.charCodeAt(i-1);if(u===we||u===Ze||i-l>63)break;if(i+1=ve&&m<=be||m>=ze&&m<=Xe||m>=Ae&&m<=xe)c=i,l=i+1,i++;else break}else break}else break}if(i-l>63||c<0)return null;var _=e.charCodeAt(i-1);if(!(_>=ve&&_<=be||_>=ze&&_<=Xe||_>=Ae&&_<=xe)||i<=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=r)return-1;if(e.charCodeAt(n)===Wt){n++;var i=n=Ae&&o<=xe||i&&(o>=ve&&o<=wc||o>=ze&&o<=Pn);if(!c)break;n++}return n===s||n-s>a?-1:n=ve&&u<=be||u>=ze&&u<=Xe||u>=Ae&&u<=xe){n++;continue}break}return n===l?-1:n=r)return null;var a=e.charCodeAt(s);if(a===Nt&&s+1",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===ls){var l=e.indexOf("?>",s+1);return l!==-1&&l",s+8);return m!==-1&&m=ve&&u<=be){var _=e.indexOf(">",s+2);return _!==-1&&_=r)return null;var S=e.charCodeAt(v);if(!(S>=ve&&S<=be||S>=ze&&S<=Xe))return null;for(v++;v=ve&&E<=be||E>=ze&&E<=Xe||E>=Ae&&E<=xe||E===we)v++;else break}for(;v=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||Ds(f))return{node:{type:ee.htmlSelfClosing,tag:f,attrs:dr(y.attrs,f,i),m:y.q?Pc(y):e.slice(t,y.end),a:!1},end:y.end};var h=Ts.has(C),b=kc(e.slice(0,r),y.end,f);if(b===-1)return{node:{type:ee.htmlSelfClosing,tag:f,attrs:dr(y.attrs,f,i),m:y.q?Pc(y):e.slice(t,y.end),a:!1},end:y.end};var O=fb(e,`jb)return Os--,[{type:ee.text,text:e.slice(t,r)}];var s=Vt;Vt=Cb();let a=n;if(i.optimizeForStreaming){let ye=function(tt,pt){for(var At=1,Rt=pt+1;Rt=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((tt,pt)=>pt[0]-tt[0]);for(var P=0;P0&&oe.charCodeAt(U-1)===Nt,J=B?U-1:U,Y=ye(oe,U);if(Y===-1)k=J,q=B,$=U+1,M=oe.length;else{var Q=Y+1;if(Q>=oe.length)k=J,q=B,$=U+1,M=Y;else if(oe.charCodeAt(Q)===er){var X=oe.indexOf(")",Q+1);X===-1?(k=J,q=B,$=U+1,M=Y,U=oe.length):U=X}else if(oe.charCodeAt(Q)===et){var re=oe.indexOf("]",Q+1);re===-1?(k=J,q=B,$=U+1,M=Y,U=oe.length):U=re}else U=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)===Qe;if(!j){for(var p=!1,d=0,x=0;x=r&&(H=-1);tF)&&(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===lt)oe=bb(e,t,r,a,i);else if(ye===Bt)oe=_b(e,t,r,a,i);else if(ye===et)t+1=0&&H-t<=64&&!a.inAnchor&&!i.disableAutoLink&&!i.disableBareUrls&&(ye>=ve&&ye<=be||ye>=ze&&ye<=Xe||ye>=Ae&&ye<=xe)&&(oe=xb(e,t,r,i),!oe&&t>=H&&(H=e.indexOf("@",t+1),H>=r&&(H=-1))),ye===de&&a.k){var ie=!1,ce=0;if(t>F&&e.charCodeAt(t-1)===ht)ie=!0,ce=1;else{for(var he=0,le=t-1;le>=F&&e.charCodeAt(le)===se;)he++,le--;he>=2&&(ie=!0,ce=he)}if(ie){for((z||t-ce>F)&&(I.push(fn(z+e.slice(F,t-ce))),z=""),I.push({type:ee.breakLine}),t++;tF&&e.charCodeAt(t-1)===se,Fe=t+1F&&e.charCodeAt(fe-1)===se;)fe--;for(z+=`${e.slice(F,fe)} `,t++;tF)&&(I.push(fn(z+e.slice(F,t))),z=""),I.push(oe.node),t=oe.end,F=t;else{if(ye===ht&&t+1F)&&(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=0&&H-t<=64);){var Ye=e.charCodeAt(t);if(YeF)&&(I.push(fn(z+e.slice(F,r))),z=""),T.length>0&&wb(I,T),Vt=s,Os--,I}var kb=500;function Yr(e,t,r){var n=t.o||0;if(n>kb)return[{type:ee.text,text:e}];if(t.o=n+1,r.optimizeForStreaming&&!(t.i||t.w)){for(var i=e.length;i>0&&e.charCodeAt(i-1)===de;)i--;for(var s=i;s>0&&e.charCodeAt(s-1)!==de;)s--;if(i>s&&e.charCodeAt(s)===ft){for(var a=!1,o=s+1;o0;){for(var S=v;S>0&&e.charCodeAt(S-1)!==de;)S--;if(e.charCodeAt(S)!==ft)break;_=S;for(var E=!0,g=!1,y=S;y0?e.slice(0,s).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=ve&&k<=be||k>=ze&&k<=Xe,M=k===Qe&&O+2=ve&&e.charCodeAt(O+2)<=be||e.charCodeAt(O+2)>=ze&&e.charCodeAt(O+2)<=Xe),q=k===Nt||k===ls,U=e.length;U>O+1&&e.charCodeAt(U-1)===de;)U--;var L=O+1>=U;if($||M||q||L){var B=O+1;if((M||$)&&(B=O+2),$||M)for(;B=ve&&J<=be||J>=ze&&J<=Xe||J>=Ae&&J<=xe)B++;else break}for(var Y=$||M?B:O+2;Y=e.length)C=O,b=!0;else if(($||M)&&e.charCodeAt(Y-1)!==Qe){for(var Q=!1,X=Y+1;X=0){for(var re=0,A=0;A0&&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;d0&&d0&&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,N=F,D=H,V=0;D=N||e.charCodeAt(W)===se||e.charCodeAt(W)===ae){for(var te=W;te=N&&(G=!0)}}else if(K>=Ae&&K<=xe){for(var ne=D;ne=Ae&&e.charCodeAt(ne)<=xe;)ne++;if(ne=N||e.charCodeAt(ie)===se||e.charCodeAt(ie)===ae){for(var ce=ie;ce=N&&(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=Av(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)break;var Ye=e.charCodeAt(le)===Ec;at(e,le,fe);let ke=null;if(Oc=e,jc=le,xa=fe,!Ye&&qe>=4&&!t.inHTML)ke=ub(e,le);else if(!Ye){let Et=le+De,Ke=e.charCodeAt(Et);Ke===Wt?ke=ob(e,le,t,r):Ke===Pe?ke=db(e,le,t,r):Ke===Le||Ke===lt?ke=lb(e,le):Ke===we||Ke===nt||Ke===Ze?(ke=Jr(e,le),!ke&&(ke=Uu(e,le,t,r))):Ke===Qr||Ke>=Ae&&Ke<=xe?ke=Uu(e,le,t,r):Ke===He?ke=Fm(e,le,t,r):Ke===ft?ke=Vu(e,le,t,r):Ke===et&&(ke=mb(e,le,t))}if(!ke){for(var ye=!1,oe=le;oe"u"?void 0:Z.createContext(void 0);function Yu(e,t,r,n,i,s,a,o,c){switch(e.type){case ee.blockQuote:{let y={key:r.key};return e.alert&&(y.className=`markdown-alert-${s(e.alert.toLowerCase(),In)}`,e.children.unshift(Tv(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?Om(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:i(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)&&Pu(y.tag)){var u=xu(y);return u.kind==="literal"?n("span",{key:r.key},u.literal):n("span",{key:r.key},...Vv(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=Zv(h),O=y.children,k=O!=null&&O.length>0;if(b){let J=C?f:y.e||"",Y=Wn(o)?Ou(J):J;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)&&Wv(P))return c(e.tag,Ut(r.key,e.attrs),t(O,r));if(Qv(P)){let J=Wn(o)?Ou(P):P;var _=Ut(r.key,e.attrs);return _.dangerouslySetInnerHTML={__html:J},c(e.tag,_)}let M=sl({slugify:o.slugify,sanitizer:i,tagfilter:!0}),q=Fv(P);if(new RegExp(`^<${y.tag}(\\s[^>]*)?>(\\s*)?$`,"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 U=ol(q,{inline:!1,refs:a,inHTML:!1},M);km(U);let L=y.tag.toLowerCase(),B=C;if(B&&k)return c(e.tag,Ut(r.key,e.attrs),t(O,r));if(B)return t(U.flatMap(Zn),r);var v=Uv(U,L);if(v.found&&v.afterClose.length>0){var S=v.beforeClose.flatMap(Zn),E=v.afterClose.flatMap(Zn);return Tc(Z.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(U.flatMap(Zn),r))}return Ds(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)&&Pu(y.tag)){var g=xu(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:i(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=zv(e.target,i,"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 Nb=(e,t,r,n,i,s,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{let r=Ac(t,e,void 0);return r?typeof r=="function"||typeof r=="object"&&"render"in r?r:Ac(t,`${e}.component`,e):e};function $b(e,t){let r={...t||{}};r.overrides=r.overrides||{};let n=r.slugify||In,i=r.sanitizer||Pr,s=r.createElement,a=jm(r.overrides),o=C=>Mc(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&&(Jv.test(h)||Yv.test(h)||Ib(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=Ac(r.overrides,`${C}.props`,{});O=Rb(C,r.overrides),b={...b,...k,className:Kv(b.className,k.className)||void 0}}if(!s){var $=b.key;return $!=null&&delete b.key,h.length===1?b.children=h[0]:h.length>1&&(b.children=h),Tc(O,b,$)}return s(O,b,...h)}function u(C,P,...h){return P&&c(P),l(C,P,...h)}let m=sl(r,r.forceInline),_=e[0]&&e[0].type===ee.refCollection?e[0].refs:{},v=Nb(r.renderRule,l,i,n,_,r,u),S=v(e,{inline:r.forceInline,refs:_}),E=Bv(_);if(E.length>0&&S.push(l("footer",{key:"footer"},E.map(function(C){let P=C.identifier.charCodeAt(0)===Ir?C.identifier.slice(1):C.identifier,h=ol(C.footnote,{inline:!0,refs:_},m);return l("div",{id:n(P,In),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,Tc(g,f,"outer")}function Mc(e="",t={}){let r={...t||{}};r.overrides=r.overrides||{},r.slugify,r.sanitizer;function n(s){let a=r.forceInline||!(r.forceBlock||jv.test(s)),o=sl(r,a),c=a?s:qv(s),l=ol(c,{inline:a,refs:i},o);return $b(l,{...r,forceInline:a})}let i={};return n(e)}function Fb(e){let t=Z.useRef(e),r=t.current;if(r!==e){var n=!0,i=0;for(var s in e)if(i++,!Object.is(r[s],e[s])){n=!1;break}if(n){var a=0;for(var o in r)a++;n=a===i}n||(t.current=e)}return t.current}var Ms=({children:e,options:t,...r})=>{if(!(typeof Z.useContext<"u")){let o={...t,overrides:{...t?.overrides},wrapperProps:{...t?.wrapperProps,...r}};return Mc(e??"",o)}let n=Ju?Z.useContext(Ju):void 0,i=Fb(r),s=Z.useMemo(()=>({...n,...t,overrides:{...n?.overrides,...t?.overrides},wrapperProps:{...n?.wrapperProps,...t?.wrapperProps,...i}}),[n,t,i]),a=e??"";return Z.useMemo(()=>Mc(a,s),[a,s])};const Tm=Symbol("remove-this-key"),Xu=Symbol("reset");function Db(e,t){return Array.isArray(e.required)&&e.required.includes(t)}function Tb(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 Mm(e){return!!e?.[Sn]}function Zu(e){return Object.keys(e).filter(t=>Mm(e[t]))}function Mb(e){const{fieldPathId:t,schema:r,registry:n,uiSchema:i,errorSchema:s,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]=Z.useState(!1),{globalFormOptions:P,fields:h}=n,{SchemaField:b}=h,O=cs(nr(S,P,t.path)),k=Z.useCallback((U,L,B,J)=>{let Y=U;U===void 0&&y&&je(L,O.path)&&(Y=""),o(Y,L,B,J)},[o,y,O]),$=Z.useCallback(U=>{S!==U&&C(!0),E(S,U)},[S,E]),M=Z.useCallback(U=>{const{target:{value:L}}=U;$(L)},[$]),q=Z.useCallback(()=>{g(S)},[S,g]);return R.jsx(b,{name:S,required:_,schema:r,uiSchema:i,errorSchema:s,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 qb=Z.memo(Mb);function Ub(e){const{schema:t,uiSchema:r={},formData:n,errorSchema:i,fieldPathId:s,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=Z.useRef(n);h.current=n;const b=Z.useMemo(()=>y.retrieveSchema(t,n,!0),[y,t,n]),O=Z.useMemo(()=>pe(r,C),[r,C]),k=Z.useMemo(()=>b.properties??{},[b.properties]),$=e.childFieldPathId??s,M=Z.useRef({previousKey:"",currentKey:void 0}),[q,U]=Z.useState(()=>Zu(k)),L=Z.useMemo(()=>{const T=new Set(Zu(k));return Object.keys(k).filter(F=>!T.has(F))},[k]),B=O.title??b.title??E??a,J=O.description??b.description,Y=Fs(S,b,o,r),Q=os(n);let X=[];const re=Z.useCallback((T,F)=>{const{duplicateKeySuffixSeparator:z="-"}=pe(r,C);let H=0,N=T;for(;ct(F,N);)H+=1,N=`${T}${z}${H}`;return N},[r,C]),A=Z.useCallback(()=>{if(!(b.additionalProperties||b.patternProperties))return;const T={...n},F=re("newKey",T);if(b.patternProperties)it(T,F,null);else{let z,H,N;if(ue(b.additionalProperties)){z=b.additionalProperties.type,H=b.additionalProperties.const,N=b.additionalProperties.default;let V=b.additionalProperties;Je in V&&(V=y.retrieveSchema({[Je]:V[Je]},n),z=V.type,H=V.const,N=y.getDefaultFormState(V,N)),!z&&(Ne in V||Se in V)&&(z="object")}const D=H??N??Tb(f,z);it(T,F,D)}M.current.previousKey===F&&(M.current.currentKey=F,M.current.previousKey=re(F,T)),U(z=>[...z,F]),v(T,$.path)},[n,v,f,y,$,re,b]),w=Z.useCallback((T,F)=>{if(T!==F){const z=h.current,H=re(F,z),N={...z},D={[T]:H},V=Object.keys(N).map(G=>({[Object.hasOwn(D,G)?D[G]:G]:N[G]})),K=Object.assign({},...V);h.current=K,T!==M.current.currentKey&&(M.current.previousKey=T),M.current.currentKey=H,U(G=>G.map(W=>W===T?H:W)),v(K,$.path)}},[v,$,re]),j=Z.useCallback(T=>{U(F=>F.filter(z=>z!==T)),v(Tm,[...$.path,T])},[v,$]),p=Z.useCallback(T=>M.current.currentKey===T?M.current.previousKey:T,[]);if(!Y||Q)try{const T=new Set(L),F=q.filter(z=>Object.hasOwn(k,z)&&!T.has(z));X=_0([...L,...F],O.order)}catch(T){return R.jsxs("div",{children:[R.jsx("p",{className:"rjsf-config-error",style:{color:"red"},children:R.jsx(Ms,{options:{disableParsingRawHTML:!0},children:f($e.InvalidObjectField,[a||"root",T.message])})}),R.jsx("pre",{children:JSON.stringify(b)})]})}const d=_e("ObjectFieldTemplate",S,O),x=Y?R.jsx(P,{...e,fieldPathId:$,schema:b}):void 0,I={title:O.label===!1?"":B,description:O.label===!1?void 0:J,properties:X.map(T=>{const F=Mm(b.properties?.[T]),z=F?r.additionalProperties:r[T],H=pe(z).widget==="hidden";return{content:R.jsx(qb,{propertyName:T,required:Db(b,T),schema:gr(b,T),uiSchema:z,errorSchema:me(i,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:s,uiSchema:r,errorSchema:i,schema:b,formData:n,registry:S,optionalDataControl:x,className:Y?"rjsf-optional-object-field":void 0};return R.jsx(d,{...I,onAddProperty:A})}function Lb(e){const{schema:t,uiSchema:r={},formData:n,disabled:i=!1,readonly:s=!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=os(n);let g,y,f,C;if(i||s)g=Ro(c,"Msg"),y=E?void 0:_($e.OptionalObjectEmptyMsg);else{const P=E?$e.OptionalObjectRemove:$e.OptionalObjectAdd;y=_(P),E?(g=Ro(c,"Remove"),C=()=>a(void 0,c.path,o)):(g=Ro(c,"Add"),f=()=>{let h=m.getDefaultFormState(t,n,"excludeObjectChildren");h===void 0&&(h=Gt(t)==="array"?[]:{}),a(h,c.path,o)})}return y&&R.jsx(S,{id:g,registry:l,schema:t,uiSchema:r,label:y,onAddClick:f,onRemoveClick:C})}const Vb={array:"ArrayField",boolean:"BooleanField",integer:"NumberField",number:"NumberField",object:"ObjectField",string:"StringField",null:"NullField"};function zb(e,t,r){const{field:n}=t,{fields:i,schemaUtils:s}=r;if(typeof n=="function")return n;if(typeof n=="string"&&n in i)return i[n];const a=Gt(e),o=Array.isArray(a)?a[0]:a||"",c=e.$id;let l=Vb[o];return c&&c in i&&(l=c),(e.anyOf||e.oneOf)&&!s.isSelect(e)&&l!=="ObjectField"?()=>null:l in i?i[l]:i.FallbackField}function Bb(e){const{schema:t,fieldPathId:r,uiSchema:n,formData:i,errorSchema:s,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=Z.useCallback((ge,Fe,fe,Ye)=>o(ge,Fe,fe,Ye||h),[h,o]);if(t[Lc])return R.jsx(P,{...e});const O=S0(t,n,_),k=pe(O,g),$=_e("FieldTemplate",_,k),M=_e("DescriptionFieldTemplate",_,k),q=_e("FieldHelpTemplate",_,k),U=_e("FieldErrorTemplate",_,k),L=S.retrieveSchema(t,i),B=zb(L,k,_),Y=!!L.deprecated?k.deprecatedHandling??"label":void 0,Q=!!(k.disabled??e.disabled)||Y==="disable",X=!!(k.readonly??(e.readonly||e.schema.readOnly||L.readOnly)),re=k.hideError,A=re===void 0?e.hideError:!!re,w=!!(k.autofocus??e.autofocus);if(Object.keys(L).length===0)return null;let j=S.getDisplayLabel(L,O,g);const p=k.field&&k.fieldReplacesAnyOrOneOf===!0;let d,x,I={fieldPathId:r};if((Ne in L||Se in L)&&!p&&!S.isSelect(L)){L[Ne]?(d=f,x=L[Ne].map(fe=>S.retrieveSchema(ue(fe)?fe:{},i))):L[Se]&&(d=C,x=L[Se].map(fe=>S.retrieveSchema(ue(fe)?fe:{},i)));const ge=Fs(_,L,m,O),Fe=os(i);j=j&&(!ge||Fe),I={childFieldPathId:r,fieldPathId:nr("XxxOf",E,r)}}const{__errors:T,...F}=s||{},{"ui:classNames":z,classNames:H,"ui:style":N,...D}=O;if(Br in D){const{classNames:ge,style:Fe,...fe}=D[Br];D[Br]=fe}const V=R.jsx(B,{...e,onChange:b,...I,schema:L,uiSchema:D,disabled:Q,readonly:X,hideError:A,autofocus:w,errorSchema:F,rawErrors:T}),K=r[Ue];let G;v?G=a:G=Sn in L?a:k.title||e.schema.title||L.title||e.title||a,Y==="label"&&(G=_.translateString($e.DeprecatedLabel,[G]));const W=k.description||e.schema.description||L.description||"",{help:te}=k,ne=k.widget==="hidden"||Y==="hide",ie=["rjsf-field",`rjsf-field-${Gt(L)}`];!A&&T&&T.length>0&&ie.push("rjsf-field-error"),k.classNames&&ie.push(k.classNames);const ce=R.jsx(q,{help:te,fieldPathId:r,schema:L,uiSchema:O,hasErrors:!A&&T&&T.length>0,registry:_}),he=A||d&&!S.isSelect(L)?void 0:R.jsx(U,{errors:T,errorSchema:s,fieldPathId:r,schema:L,uiSchema:O,registry:_}),le={description:R.jsx(M,{id:as(K),description:W,schema:L,uiSchema:O,registry:_}),rawDescription:W,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:X,hideError:A,displayLabel:j,classNames:ie.join(" ").trim(),style:k.style,formData:i,schema:L,uiSchema:O,registry:_};return R.jsx($,{...le,children:R.jsxs(R.Fragment,{children:[V,d&&R.jsx(d,{name:a,disabled:Q,readonly:X,hideError:A,errorSchema:s,formData:i,fieldPathId:r,onBlur:e.onBlur,onChange:e.onChange,onFocus:e.onFocus,options:x,registry:_,required:m,schema:L,uiSchema:O})]})})}const Hb=Z.memo(Bb,(e,t)=>{const{experimental_componentUpdateStrategy:r="customDeep"}=t.registry.globalFormOptions;return r==="always"?!1:r==="shallow"?bc(e,t):je(e,t)});function Kb(e){const{schema:t,name:r,uiSchema:n,fieldPathId:i,formData:s,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&&p0(t,f,C)&&(O=f);const{widget:k=O,placeholder:$="",title:M,...q}=pe(n),U=P.getDisplayLabel(t,n,h),L=M??g??y??r,B=vr(t,k,C),J=Z.useCallback((Y,Q,X)=>u(Y,i.path,Q,X),[u,i]);return R.jsx(B,{options:{...q,enumOptions:b},schema:t,uiSchema:n,id:i.$id,name:r,label:L,hideLabel:!U,hideError:E,value:s,onChange:J,onBlur:m,onFocus:_,required:a,disabled:o,readonly:c,autofocus:l,registry:v,placeholder:$,rawErrors:S,htmlName:i.name})}function Gb(){return{AnyOfField:bu,ArrayField:H0,BooleanField:K0,CyclicSchemaField:G0,FallbackField:X0,LayoutGridField:rl,LayoutHeaderField:uv,LayoutMultiSchemaField:dv,NumberField:pv,ObjectField:Ub,OneOfField:bu,OptionalDataControlsField:Lb,SchemaField:Hb,StringField:Kb,NullField:fv}}function Wb(e){const{fieldPathId:t,description:r,registry:n,schema:i,uiSchema:s}=e,a=pe(s,n.globalUiOptions),{label:o=!0}=a;if(!r||!o)return null;const c=_e("DescriptionFieldTemplate",n,a);return R.jsx(c,{id:as(t),description:r,schema:i,uiSchema:s,registry:n})}function Jb(e){const{disabled:t,hasCopy:r,hasMoveDown:n,hasMoveUp:i,hasRemove:s,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 R.jsxs(R.Fragment,{children:[(i||n)&&R.jsx(g,{id:_n(a,"moveUp"),className:"rjsf-array-item-move-up",disabled:t||m||!i,onClick:u,uiSchema:v,registry:_}),(i||n)&&R.jsx(E,{id:_n(a,"moveDown"),className:"rjsf-array-item-move-down",disabled:t||m||!n,onClick:l,uiSchema:v,registry:_}),r&&R.jsx(S,{id:_n(a,"copy"),className:"rjsf-array-item-copy",disabled:t||m,onClick:o,uiSchema:v,registry:_}),s&&R.jsx(y,{id:_n(a,"remove"),className:"rjsf-array-item-remove",disabled:t||m,onClick:c,uiSchema:v,registry:_})]})}function Yb(e){const{children:t,className:r,buttonsProps:n,displayLabel:i,hasDescription:s,hasToolbar:a,registry:o,uiSchema:c}=e,l=pe(c),u=_e("ArrayFieldItemButtonsTemplate",o,l),m={flex:1,paddingLeft:6,paddingRight:6,fontWeight:"bold"},_=s?31:9,v={display:"flex",alignItems:i?"center":"baseline"},S={display:"flex",justifyContent:"flex-end",marginTop:i?`${_}px`:0};return R.jsxs("div",{className:r,style:v,children:[R.jsx("div",{className:a?"col-xs-9 col-md-10 col-xl-11":"col-xs-12",children:t}),a&&R.jsx("div",{className:"col-xs-3 col-md-2 col-xl-1 array-item-toolbox",children:R.jsx("div",{className:"btn-group",style:S,children:R.jsx(u,{...n,style:m})})})]})}function Xb(e){const{canAdd:t,className:r,disabled:n,fieldPathId:i,uiSchema:s,items:a,optionalDataControl:o,onAddClick:c,readonly:l,registry:u,required:m,schema:_,title:v}=e,S=pe(s),E=_e("ArrayFieldDescriptionTemplate",u,S),g=_e("ArrayFieldTitleTemplate",u,S),y=!l&&!n,{ButtonTemplates:{AddButton:f}}=u.templates;return R.jsxs("fieldset",{className:r,id:i.$id,children:[R.jsx(g,{fieldPathId:i,title:S.title||v,required:m,schema:_,uiSchema:s,registry:u,optionalDataControl:y?o:void 0}),R.jsx(E,{fieldPathId:i,description:S.description||_.description,schema:_,uiSchema:s,registry:u}),y?void 0:o,R.jsx("div",{className:"row array-item-list",children:a}),t&&R.jsx(f,{id:_n(i,"add"),className:"rjsf-array-item-add",onClick:c,disabled:n||l,uiSchema:s,registry:u})]})}function Zb(e){const{fieldPathId:t,title:r,schema:n,uiSchema:i,required:s,registry:a,optionalDataControl:o}=e,c=pe(i,a.globalUiOptions),{label:l=!0}=c;if(!r||!l)return null;const u=_e("TitleFieldTemplate",a,c);return R.jsx(u,{id:Qc(t),title:r,required:s,schema:n,uiSchema:i,registry:a,optionalDataControl:o})}function Qb(e){const{id:t,schema:r}=e,{examples:n,default:i}=r;return Array.isArray(n)?R.jsx("datalist",{id:Zc(t),children:n.concat(i!==void 0&&!n.map(String).includes(String(i))?[i]:[]).map(s=>R.jsx("option",{value:s},String(s)))},`datalist_${t}`):null}function e_(e){const{id:t,name:r,htmlName:n,value:i,readonly:s,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,...c0(v,y,_)};let O;b.type==="number"||b.type==="integer"?O=i||i===0?i:"":O=i??"";const k=Z.useCallback(({target:{value:U}})=>u(U===""?_.emptyValue:U),[u,_]),$=Z.useCallback(({target:U})=>c(t,U?.value),[c,t]),M=Z.useCallback(({target:U})=>l(t,U?.value),[l,t]),q=Z.useCallback(U=>{U.preventDefault(),U.stopPropagation(),u(_.emptyValue)},[u,_.emptyValue]);return R.jsxs(R.Fragment,{children:[R.jsx("input",{id:t,name:n||t,className:"form-control",readOnly:s,disabled:a,autoFocus:o,value:O,...b,list:v.examples?Zc(t):void 0,onChange:m||k,onBlur:$,onFocus:M,"aria-describedby":$n(t,!!v.examples)}),_.allowClearTextInputs&&!s&&!a&&O&&R.jsx(h,{registry:E,onClick:q}),R.jsx(Qb,{id:t,schema:v})]})}function t_(e){const{iconType:t="default",icon:r,className:n,uiSchema:i,registry:s,...a}=e;return R.jsx("button",{type:"button",className:`btn btn-${t} ${n}`,...a,children:R.jsx("i",{className:`glyphicon glyphicon-${r}`})})}const tn=Z.memo(t_);function r_(e){const{registry:{translateString:t}}=e;return R.jsx(tn,{title:t($e.CopyButton),...e,icon:"copy"})}const n_=Z.memo(r_);function s_(e){const{registry:{translateString:t}}=e;return R.jsx(tn,{title:t($e.MoveDownButton),...e,icon:"arrow-down"})}const i_=Z.memo(s_);function a_(e){const{registry:{translateString:t}}=e;return R.jsx(tn,{title:t($e.MoveUpButton),...e,icon:"arrow-up"})}const o_=Z.memo(a_);function c_(e){const{registry:{translateString:t}}=e;return R.jsx(tn,{title:t($e.RemoveButton),...e,iconType:"danger",icon:"remove"})}const l_=Z.memo(c_);function u_({id:e,className:t,onClick:r,disabled:n,registry:i,...s}){const{translateString:a}=i;return R.jsx(tn,{id:e,iconType:"default",icon:"remove",className:"btn-clear col-xs-12",title:a($e.ClearButton),onClick:r,disabled:n,registry:i,...s})}const d_=Z.memo(u_);function f_({id:e,className:t,onClick:r,disabled:n,registry:i}){const{translateString:s}=i;return R.jsx("div",{className:"row",children:R.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:R.jsx(tn,{id:e,iconType:"info",icon:"plus",className:"btn-add col-xs-12",title:s($e.AddButton),onClick:r,disabled:n,registry:i})})})}function h_({uiSchema:e}){const{submitText:t,norender:r,props:n={}}=l0(e);return r?null:R.jsx("div",{children:R.jsx("button",{type:"submit",...n,className:`btn btn-info ${n.className||""}`,children:t})})}function m_(){return{SubmitButton:h_,AddButton:f_,CopyButton:n_,MoveDownButton:i_,MoveUpButton:o_,RemoveButton:l_,ClearButton:d_}}function p_(e){const{name:t,fieldPathId:r,registry:n,onExpand:i}=e,{translateString:s}=n,a=`${r[Ue]}-button`;return R.jsxs("div",{style:{marginTop:"1rem"},children:[R.jsx("div",{className:"text-danger",children:s($e.CycleDetected,[t])}),R.jsxs("div",{children:[R.jsx("button",{id:a,type:"button",className:"btn btn-sm btn-warning",onClick:()=>i(r[Ue]),children:s($e.ExpandButton)})," "]})]})}const qm=Xc();function Um({description:e,registry:t,uiSchema:r={}}){const{globalUiOptions:n}=t;return pe(r,n).enableMarkdownInDescription&&typeof e=="string"?R.jsx(Ms,{options:{disableParsingRawHTML:!0},"data-testid":qm.markdown,children:e}):e}Um.TEST_IDS=qm;function y_(e){const{id:t,description:r,registry:n,uiSchema:i}=e;return r?R.jsx("div",{id:t,className:"field-description",children:R.jsx(Um,{description:r,registry:n,uiSchema:i})}):null}function g_({errors:e,registry:t}){const{translateString:r}=t;return R.jsxs("div",{className:"panel panel-danger errors",children:[R.jsx("div",{className:"panel-heading",children:R.jsx("h3",{className:"panel-title",children:r($e.ErrorsLabel)})}),R.jsx("ul",{className:"list-group",children:e.map((n,i)=>R.jsx("li",{className:"list-group-item text-danger",children:n.stack},i))})]})}function v_(e){const{schema:t,registry:r,typeSelector:n,schemaField:i}=e,s=_e("MultiSchemaFieldTemplate",r);return R.jsx(s,{selector:n,optionSchemaField:i,schema:t,registry:r})}function b_(e){const{errors:t=[],fieldPathId:r}=e;if(t.length===0)return null;const n=mm(r);return R.jsx("div",{children:R.jsx("ul",{id:n,className:"error-detail bs-callout bs-callout-info",children:t.filter(i=>!!i).map((i,s)=>R.jsx("li",{className:"text-danger",children:i},s))})})}const Lm=Xc();function Vm({help:e,registry:t,uiSchema:r={}}){const{globalUiOptions:n}=t;return pe(r,n).enableMarkdownInHelp&&typeof e=="string"?R.jsx(Ms,{options:{disableParsingRawHTML:!0},"data-testid":Lm.markdown,children:e}):e}Vm.TEST_IDS=Lm;function __(e){const{fieldPathId:t,help:r,uiSchema:n,registry:i}=e;return r?R.jsx("div",{id:pm(t),className:"help-block",children:R.jsx(Vm,{help:r,registry:i,uiSchema:n})}):null}const S_="*";function zm(e){const{label:t,required:r,id:n}=e;return t?R.jsxs("label",{className:"control-label",htmlFor:n,children:[t,r&&R.jsx("span",{className:"required",children:S_})]}):null}function w_(e){const{id:t,label:r,children:n,errors:i,help:s,description:a,hidden:o,required:c,displayLabel:l,registry:u,uiSchema:m}=e,_=pe(m),v=_e("WrapIfAdditionalTemplate",u,_);if(o)return R.jsx("div",{className:"hidden",children:n});const S=_.widget==="checkbox";return R.jsxs(v,{...e,children:[l&&!S&&R.jsx(zm,{label:r,required:c,id:t}),l&&a?a:null,n,i,s]})}function C_(e){const{children:t,column:r,className:n,...i}=e;return R.jsx("div",{className:n,...i,children:t})}function E_(e){const{selector:t,optionSchemaField:r}=e;return R.jsxs("div",{className:"panel panel-default panel-body",children:[R.jsx("div",{className:"form-group",children:t}),r]})}function A_(e){const{className:t,description:r,disabled:n,formData:i,fieldPathId:s,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 R.jsxs("fieldset",{className:t,id:s.$id,children:[v&&R.jsx(g,{id:Qc(s),title:v,required:m,schema:_,uiSchema:S,registry:u,optionalDataControl:C?o:void 0}),r&&R.jsx(y,{id:as(s),description:r,schema:_,uiSchema:S,registry:u}),C?void 0:o,c.map(h=>h.content),Ey(_,S,i)&&R.jsx(P,{id:_n(s,"add"),className:"rjsf-object-property-expand",onClick:a,disabled:n||l,uiSchema:S,registry:u})]})}function x_(e){const{id:t,registry:r,label:n,onAddClick:i,onRemoveClick:s}=e;return i?R.jsx(tn,{id:t,registry:r,icon:"plus",className:"rjsf-add-optional-data btn-sm",onClick:i,title:n}):s?R.jsx(tn,{id:t,registry:r,icon:"remove",className:"rjsf-remove-optional-data btn-sm",onClick:s,title:n}):R.jsx("em",{id:t,children:n})}const P_="*";function O_(e){const{id:t,title:r,required:n,optionalDataControl:i}=e;return R.jsxs("legend",{id:t,children:[r,n&&R.jsx("span",{className:"required",children:P_}),i&&R.jsx("span",{className:"pull-right",style:{marginBottom:"2px"},children:i})]})}function j_(e){const{schema:t,fieldPathId:r,reason:n,registry:i}=e,{translateString:s}=i;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)),R.jsxs("div",{className:"unsupported-field",children:[R.jsx("p",{children:R.jsx(Ms,{options:{disableParsingRawHTML:!0},children:s(a,o)})}),t&&R.jsx("pre",{children:JSON.stringify(t,null,2)})]})}function k_(e){const{id:t,classNames:r,style:n,disabled:i,displayLabel:s,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 R.jsx("div",{className:$,style:n,children:E});const M=O?46:26;return R.jsx("div",{className:$,style:n,children:R.jsxs("div",{className:"row",children:[R.jsx("div",{className:"col-xs-5 form-additional",children:R.jsxs("div",{className:"form-group",children:[s&&R.jsx(zm,{label:h,required:m,id:`${t}-key`}),s&&l&&R.jsx("div",{children:" "}),R.jsx("input",{className:"form-control",type:"text",id:`${t}-key`,onBlur:o,defaultValue:a},a)]})}),R.jsx("div",{className:"form-additional form-group col-xs-5",children:E}),R.jsx("div",{className:"col-xs-2",style:{marginTop:s?`${M}px`:void 0},children:R.jsx(P,{id:_n(t,"remove"),className:"rjsf-object-property-remove btn-block",style:{border:"0"},disabled:i||u,onClick:c,uiSchema:g,registry:y})})]})})}function I_(){return{ArrayFieldDescriptionTemplate:Wb,ArrayFieldItemTemplate:Yb,ArrayFieldItemButtonsTemplate:Jb,ArrayFieldTemplate:Xb,ArrayFieldTitleTemplate:Zb,ButtonTemplates:m_(),BaseInputTemplate:e_,CyclicSchemaExpandTemplate:p_,DescriptionFieldTemplate:y_,ErrorListTemplate:g_,FallbackFieldTemplate:v_,FieldTemplate:w_,FieldErrorTemplate:b_,FieldHelpTemplate:__,GridTemplate:C_,MultiSchemaFieldTemplate:E_,ObjectFieldTemplate:A_,OptionalDataControlsTemplate:x_,TitleFieldTemplate:O_,UnsupportedFieldTemplate:j_,WrapIfAdditionalTemplate:k_}}function N_({time:e=!0,...t}){const{AltDateWidget:r}=t.registry.widgets;return R.jsx(r,{time:e,...t})}function R_(e){const{disabled:t=!1,readonly:r=!1,autofocus:n=!1,options:i,id:s,name:a,registry:o,onBlur:c,onFocus:l}=e,{translateString:u}=o,{elements:m,handleChange:_,handleClear:v,handleSetNow:S}=O0(e);return R.jsxs("ul",{className:"list-inline",children:[m.map((E,g)=>R.jsx("li",{className:"list-inline-item",children:R.jsx(P0,{rootId:s,name:a,select:_,...E,disabled:t,readonly:r,registry:o,onBlur:c,onFocus:l,autofocus:n&&g===0})},g)),(i.hideNowButton!=="undefined"?!i.hideNowButton:!0)&&R.jsx("li",{className:"list-inline-item",children:R.jsx("button",{type:"button",className:"btn btn-info btn-now",onClick:S,children:u($e.NowLabel)})}),(i.hideClearButton!=="undefined"?!i.hideClearButton:!0)&&R.jsx("li",{className:"list-inline-item",children:R.jsx("button",{type:"button",className:"btn btn-warning btn-clear",onClick:v,children:u($e.ClearLabel)})})]})}function $_({id:e,disabled:t,options:r,value:n,autofocus:i=!1,readonly:s,onChange:a,onBlur:o,onFocus:c,htmlName:l}){const{inline:u=!1,enumOptions:m,enumDisabled:_,emptyValue:v}=r,S=Yc(r),E=Array.isArray(n)?n:[n],g=Z.useCallback(({target:f})=>o(e,Cn(f?.value,m,S,v)),[o,e,m,v,S]),y=Z.useCallback(({target:f})=>c(e,Cn(f?.value,m,S,v)),[c,e,m,v,S]);return R.jsx("div",{className:"checkboxes",id:e,children:Array.isArray(m)&&m.map((f,C)=>{const P=Ga(f.value,E),h=Array.isArray(_)&&_.includes(f.value),b=t||h||s?"disabled":"",O=$=>{$.target.checked?a(i0(C,E,m)):a(n0(C,E,m))},k=R.jsxs("span",{children:[R.jsx("input",{type:"checkbox",id:ym(e,C),name:l||e,checked:P,value:Jc(f.value,C,S),disabled:t||h||s,autoFocus:i&&C===0,onChange:O,onBlur:g,onFocus:y,"aria-describedby":$n(e)}),R.jsx("span",{children:f.label})]});return u?R.jsx("label",{className:`checkbox-inline ${b}`,children:k},String(f.value)):R.jsx("div",{className:`checkbox ${b}`,children:R.jsx("label",{children:k})},String(f.value))})})}function F_({schema:e,uiSchema:t,options:r,id:n,value:i,disabled:s,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=Ea(e)&&E,f=Z.useCallback(k=>_(k.target.checked),[_]),C=Z.useCallback(k=>u(n,k.target.checked),[u,n]),P=Z.useCallback(k=>m(n,k.target.checked),[m,n]),O=pe(t).widget==="checkbox"?void 0:r.description??e.description;return R.jsxs("div",{className:`checkbox ${s||a?"disabled":""}`,children:[!c&&O&&R.jsx(g,{id:as(n),description:O,schema:e,uiSchema:t,registry:v}),R.jsxs("label",{children:[R.jsx("input",{type:"checkbox",id:n,name:S||n,checked:typeof i>"u"?!1:i,required:E,disabled:s||a,autoFocus:l,onChange:f,onBlur:C,onFocus:P,"aria-describedby":$n(n)}),g0(R.jsxs("span",{children:[o,y&&R.jsx("span",{className:"required",children:"*"})]}),c)]})]})}function D_(e){const{disabled:t,readonly:r,options:n,registry:i}=e,s=_e("BaseInputTemplate",i,n);return R.jsx(s,{type:"color",...e,disabled:t||r})}function T_(e){const{onChange:t,value:r,options:n,registry:i}=e,s=_e("BaseInputTemplate",i,n);return R.jsx(s,{type:"datetime-local",...e,value:R0(r),onChange:a=>t(v0(a))})}function M_(e){const{onChange:t,options:r,registry:n}=e,i=_e("BaseInputTemplate",n,r),s=Z.useCallback(a=>t(a||void 0),[t]);return R.jsx(i,{type:"date",...e,onChange:s})}function q_(e){const{options:t,registry:r}=e,n=_e("BaseInputTemplate",r,t);return R.jsx(n,{type:"email",...e})}function U_({fileInfo:e,registry:t}){const{translateString:r}=t,{dataURL:n,type:i,name:s}=e;if(!n)return null;const a=r($e.PreviewLabel);return["image/jpeg","image/png"].includes(i)?R.jsx("img",{src:n,alt:a,style:{maxWidth:"100%"},className:"file-preview"}):R.jsxs(R.Fragment,{children:[" ",R.jsx("a",{download:`preview-${s}`,href:n,className:"file-download",children:a})]})}function L_({filesInfo:e,registry:t,preview:r,onRemove:n,options:i}){if(e.length===0)return null;const{translateString:s}=t,{RemoveButton:a}=_e("ButtonTemplates",t,i);return R.jsx("ul",{className:"file-info",children:e.map((o,c)=>{const{name:l,size:u,type:m}=o,_=()=>n(c);return R.jsxs("li",{children:[R.jsx(Ms,{children:s($e.FilesInfo,[l,m,String(u)])}),r&&R.jsx(U_,{fileInfo:o,registry:t}),R.jsx(a,{onClick:_,registry:t})]},c)})})}function V_(e){const{disabled:t,readonly:r,required:n,multiple:i,onChange:s,value:a,options:o,registry:c}=e,{filesInfo:l,handleChange:u,handleRemove:m}=N0(a,s,i),_=_e("BaseInputTemplate",c,o),v=S=>{S.target.files&&u(S.target.files)};return R.jsxs("div",{children:[R.jsx(_,{...e,disabled:t||r,type:"file",required:a?!1:n,onChangeOverride:v,value:"",accept:o.accept?String(o.accept):void 0}),R.jsx(L_,{filesInfo:l,onRemove:m,registry:c,preview:o.filePreview,options:o})]})}function z_({id:e,value:t,htmlName:r}){return R.jsx("input",{type:"hidden",id:e,name:r||e,value:typeof t>"u"?"":t})}function B_(e){const{options:t,registry:r}=e,n=_e("BaseInputTemplate",r,t);return R.jsx(n,{type:"password",...e})}function H_({options:e,value:t,required:r,disabled:n,readonly:i,autofocus:s=!1,onBlur:a,onFocus:o,onChange:c,id:l,htmlName:u}){const{enumOptions:m,enumDisabled:_,inline:v,emptyValue:S}=e,E=Yc(e),g=Z.useCallback(({target:f})=>a(l,Cn(f?.value,m,E,S)),[a,m,S,l,E]),y=Z.useCallback(({target:f})=>o(l,Cn(f?.value,m,E,S)),[o,m,S,l,E]);return R.jsx("div",{className:"field-radio-group",id:l,role:"radiogroup",children:Array.isArray(m)&&m.map((f,C)=>{const P=Ga(f.value,t),h=Array.isArray(_)&&_.includes(f.value),b=n||h||i?"disabled":"",O=()=>c(f.value),k=R.jsxs("span",{children:[R.jsx("input",{type:"radio",id:ym(l,C),checked:P,name:u||l,required:r,value:Jc(f.value,C,E),disabled:n||h||i,autoFocus:s&&C===0,onChange:O,onBlur:g,onFocus:y,"aria-describedby":$n(l)}),R.jsx("span",{children:f.label})]});return v?R.jsx("label",{className:`radio-inline ${b}`,children:k},String(f.value)):R.jsx("div",{className:`radio ${b}`,children:R.jsx("label",{children:k})},String(f.value))})})}function K_(e){const{value:t,registry:{templates:{BaseInputTemplate:r}}}=e;return R.jsxs("div",{className:"field-range-wrapper",children:[R.jsx(r,{type:"range",...e}),R.jsx("span",{className:"range-view",children:t})]})}function G_({id:e,value:t,required:r,disabled:n,readonly:i,onChange:s,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=Z.useCallback(C=>{!n&&!i&&s(C)},[s,n,i]),g=Z.useCallback(C=>{if(a){const P=Number(C.target.dataset.value);a(e,P)}},[a,e]),y=Z.useCallback(C=>{if(o){const P=Number(C.target.dataset.value);o(e,P)}},[o,e]),f=C=>_==="heart"?C?"♥":"♡":C?"★":"☆";return R.jsxs("div",{className:"rating-widget",style:{display:"inline-flex",fontSize:"1.5rem",cursor:n||i?"default":"pointer"},children:[[...Array(v)].map((C,P)=>{const h=S+P,b=h<=t;return R.jsx("span",{onClick:()=>E(h),onKeyDown:O=>(O.key==="Enter"||O.key===" ")&&E(h),onFocus:g,onBlur:y,"data-value":h,tabIndex:n||i?-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)}),R.jsx("input",{type:"hidden",id:e,name:u||e,value:t||"",required:r,disabled:n||i,"aria-hidden":"true"})]})}function Vo(e,t){return t?Array.from(e.target.options).slice().filter(r=>r.selected).map(r=>r.value):e.target.value}function W_({schema:e,id:t,options:r,value:n,required:i,disabled:s,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=Yc(r),h=Z.useCallback(M=>{const q=Vo(M,o);return m(t,Cn(q,g,P,f))},[m,t,o,g,f,P]),b=Z.useCallback(M=>{const q=Vo(M,o);return u(t,Cn(q,g,P,f))},[u,t,o,g,f,P]),O=Z.useCallback(M=>{const q=Vo(M,o);return l(Cn(q,g,P,f))},[l,o,g,f,P]),k=s0(n,g,o,P,C),$=!o&&e.default===void 0;return b0(t,e,g,o),R.jsxs(R.Fragment,{children:[R.jsx(w0,{id:t,multiple:o,options:r,registry:S,uiSchema:E,value:n}),R.jsxs("select",{id:t,name:v||t,multiple:o,className:"form-control",value:k,required:i,disabled:s||a,autoFocus:c,onBlur:b,onFocus:h,onChange:O,"aria-describedby":$n(t),children:[$&&R.jsx("option",{value:"",children:_}),Array.isArray(g)&&g.map(({value:M,label:q},U)=>{const L=y&&y.includes(M);return R.jsx("option",{value:Jc(M,U,P),disabled:L,children:q},String(M))})]})]})}function J_({id:e,options:t,placeholder:r,value:n,required:i,disabled:s,readonly:a,autofocus:o=!1,onChange:c,onBlur:l,onFocus:u,htmlName:m}){const _=Z.useCallback(({target:{value:E}})=>c(E===""?t.emptyValue:E),[c,t.emptyValue]),v=Z.useCallback(({target:E})=>l(e,E?.value),[l,e]),S=Z.useCallback(({target:E})=>u(e,E?.value),[e,u]);return R.jsx("textarea",{id:e,name:m||e,className:"form-control",value:n||"",placeholder:r,required:i,disabled:s,readOnly:a,autoFocus:o,rows:t.rows,onBlur:v,onFocus:S,onChange:_,"aria-describedby":$n(e)})}function Y_(e){const{options:t,registry:r}=e,n=_e("BaseInputTemplate",r,t);return R.jsx(n,{...e})}function X_(e){const{onChange:t,options:r,registry:n,schema:i,value:s}=e,a=_e("BaseInputTemplate",n,r),o=typeof i.multipleOf=="number"&&Number.isFinite(i.multipleOf)&&i.multipleOf<60,c=Z.useCallback(u=>{t(u?o?u:`${u}:00`:void 0)},[o,t]),l=typeof s=="string"&&!o&&/^\d{2}:\d{2}:00$/.test(s)?s.slice(0,-3):s;return R.jsx(a,{type:"time",...e,value:l,onChange:c})}function Z_(e){const{options:t,registry:r}=e,n=_e("BaseInputTemplate",r,t);return R.jsx(n,{type:"number",...e})}function Q_(e){const{options:t,registry:r}=e,n=_e("BaseInputTemplate",r,t);return R.jsx(n,{type:"url",...e})}function eS(){return{AltDateWidget:R_,AltDateTimeWidget:N_,CheckboxWidget:F_,CheckboxesWidget:$_,ColorWidget:D_,DateWidget:M_,DateTimeWidget:T_,EmailWidget:q_,FileWidget:V_,HiddenWidget:z_,PasswordWidget:B_,RadioWidget:H_,RangeWidget:K_,RatingWidget:G_,SelectWidget:W_,TextWidget:Y_,TextareaWidget:J_,TimeWidget:X_,UpDownWidget:Z_,URLWidget:Q_}}function tS(){return{fields:Gb(),templates:I_(),widgets:eS(),rootSchema:{},formContext:{},translateString:r0,globalFormOptions:{idPrefix:Fh,idSeparator:Dh,useFallbackUiForUnsupportedType:!1}}}function Ln(e,t){const{schema:r,uiSchema:n,fieldPathId:i,schemaUtils:s,formData:a,edit:o,errors:c,errorSchema:l}=e;return{schema:r,uiSchema:n,fieldPathId:i,schemaUtils:s,formData:a,edit:o,errors:c,errorSchema:l,...t!==void 0&&{status:t}}}class Vr extends Z.Component{formElement;pendingChanges=[];isProcessingUserChange=!1;static getDerivedStateFromProps(t,r){if(t.extraErrors!==r.prevExtraErrors){const n={errors:r.schemaValidationErrors||[],errorSchema:r.schemaValidationErrorSchema||{}};let{errors:i,errorSchema:s}=n;return t.extraErrors&&({errors:i,errorSchema:s}=Ps(n,t.extraErrors)),r.customErrors&&({errors:i,errorSchema:s}=Ps({errors:i,errorSchema:s},r.customErrors.ErrorSchema,!0)),{prevExtraErrors:t.extraErrors,errors:i,errorSchema:s}}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:i}=t,s=r??n;this.state={...this.getStateFromProps(t,s,void 0,void 0,void 0,!0),prevExtraErrors:t.extraErrors},i&&!je(this.state.formData,s)&&i(Ln(this.state)),this.formElement=Z.createRef()}getSnapshotBeforeUpdate(t,r){if(!je(this.props,t)){const n=Ca(this.props.formData,t.formData),i=Ca(this.props.formData,this.state.formData),s=!je(t.schema,this.props.schema),a=n.length>0||!je(t.formData,this.props.formData),o=i.length>0||!je(this.state.formData,this.props.formData),c=this.getStateFromProps(this.props,this.props.formData,s||a?void 0:this.state.retrievedSchema,s,()=>Ca(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:i}=n,s=!je(i.formData,this.props.formData),a=this.isProcessingUserChange;if(this.isProcessingUserChange=!1,a&&s)return;s&&!je(i.formData,r.formData)&&this.props.onChange&&this.props.onChange(Ln(i)),this.setState(i)}}getStateFromProps(t,r,n,i=!1,s=()=>[],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=Qg(u,l,g,y));const C=f.getRootSchema();let P=r;r===Xu?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 X=o?zt({formData:h}):"";if(b=this.updateRetrievedSchema(n??f.retrieveSchema(C,h)),o&&!k.includes(X)&&!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(X)}else O=!1}while(O);const $=()=>t.noValidate||i?{errors:[],errorSchema:{}}:t.liveValidate?{errors:c.errors||[],errorSchema:c.errorSchema||{}}:{errors:c.schemaValidationErrors||[],errorSchema:c.schemaValidationErrorSchema||{}};let M,q,{schemaValidationErrors:U,schemaValidationErrorSchema:L}=c;if(E&&!a){const X=this.liveValidate(C,f,c.errorSchema,h,void 0,c.customErrors,n,n!==void 0);M=X.errors,q=X.errorSchema,U=X.schemaValidationErrors,L=X.schemaValidationErrorSchema}else{const X=$();if(M=X.errors,q=X.errorSchema,!E){const A=s();if(A.length>0){const w=A.reduce((j,p)=>{const d=rr(p);for(let x=1;xKg(t,r);getFieldNames=(t,r)=>Gg(t,r);omitExtraData=t=>{const{schema:r,schemaUtils:n}=this.state;return n.omitExtraData(r,t)};setFieldValue=(t,r)=>{const{registry:n}=this.state,i=Array.isArray(t)?t:t.split("."),s=nr("",n.globalFormOptions,i);this.onChange(r,i,void 0,s[Ue])};onChange=(t,r,n,i)=>{this.pendingChanges.push({newValue:t,path:r,newErrorSchema:n,id:i}),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:i}=this.pendingChanges[0],{extraErrors:s,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(J=>J===void 0),M=v==null,q=$&&M?void 0:k;if(ue(k)||Array.isArray(k)){let J=!1;if(t===Tm)tg(k,r);else if(!O){let X=t;if(t===void 0)if(typeof r[r.length-1]=="number")X=null;else{const{field:A}=S.findFieldInSchema(E,r,v),w=A;!(w&&(Se in w||Ne in w))&&w!==void 0&&(J=!0)}J?it(k,r,void 0):it(k,r,X)}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,J&&k&&it(k,r,void 0)}const U=!c&&(l===!0||l==="onChange");let L={formData:k,retrievedSchema:P},B=k;if(a===!0&&(o===!0||o==="onChange")&&(B=this.omitExtraData(k),L={...L,formData:B}),i){const J=O?y:me(y,r);if(J&&Object.keys(J).length>0)O?h=i:(h=structuredClone(y),it(h,r,i,!0));else if(C||(C=new dm),O){const Y=i[vt];Y&&C.setErrors(Y)}else it(C.ErrorSchema,r,i,!0)}else C&&me(C.ErrorSchema,[...r,vt])&&C.clearErrors(r);if(U&&this.pendingChanges.length===1){const J=this.liveValidate(E,S,h,B,s,C,P);L={...L,formData:B,...J,customErrors:C}}else if(!c&&i){const J=Vr.mergeErrors({errorSchema:h,errors:f},s,C);L={...L,formData:B,...J,customErrors:C}}this.setState(L,()=>{u&&u(Ln({...this.state,...L}),n),this.pendingChanges.shift(),this.processPendingChange()})}updateRetrievedSchema(t){return je(t,this.state?.retrievedSchema)?this.state.retrievedSchema:t}reset=()=>{const{formData:t,initialFormData:r=Xu,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:i,liveOmit:s,liveValidate:a}=this.props;if(n&&n(t,r),i===!0&&s==="onBlur"||a==="onBlur"){const{onChange:o,extraErrors:c}=this.props,{formData:l}=this.state;let u=l,m={formData:u};if(i===!0&&s==="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:i,onSubmit:s}=this.props;let{formData:a}=this.state;if(r===!0&&(a=this.omitExtraData(a)),i||this.validateFormWithFormData(a)){const o=n||{},c=n?gm(n):[];this.setState({formData:a,errors:c,errorSchema:o,schemaValidationErrors:[],schemaValidationErrorSchema:{}},()=>{s&&s(Ln({...this.state,formData:a},"submitted"),t)})}};static getGlobalFormOptions(t){const{uiSchema:r={},experimental_componentUpdateStrategy:n,idSeparator:i=Dh,idPrefix:s=Fh,nameGenerator:a,useFallbackUiForUnsupportedType:o=!1}=t;return{idPrefix:r["ui:rootFieldId"]||s,idSeparator:i,useFallbackUiForUnsupportedType:o,...n!==void 0&&{experimental_componentUpdateStrategy:n},...a!==void 0&&{nameGenerator:a}}}static getRegistry(t,r,n){const{translateString:i,uiSchema:s={}}=t,{fields:a,templates:o,widgets:c,formContext:l,translateString:u}=tS();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:i||u,globalUiOptions:s[mc],globalFormOptions:Vr.getGlobalFormOptions(t),uiSchemaDefinitions:s[wy]??{}}}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:i}=t,s=rr(i??"");s.unshift(r);const a=s.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:i,onError:s}=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?(i&&(typeof i=="function"?i(c[0]):this.focusOnError(c[0])),this.setState({errors:c,errorSchema:l,schemaValidationErrors:o.errors,schemaValidationErrorSchema:o.errorSchema},()=>{s?s(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:i,name:s,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?i:void 0,M=g||i||"form";let{[ja]:q={}}=pe(f);v&&(q={...q,props:{...q.props,disabled:!0}});const U={[Br]:{[ja]:q}};return R.jsxs(M,{className:n||"rjsf",id:r,name:s,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),R.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||R.jsx(k,{uiSchema:U,registry:b}),E==="bottom"&&this.renderErrors(b)]})}}function rS(e,t="none"){return t==="all"?e:e.reduce((r,n)=>{const{message:i,schemaPath:s}=n,a=t!=="anyOf"?s?.indexOf(`/${Ne}/`):void 0,o=t!=="oneOf"?s?.indexOf(`/${Se}/`):void 0;let c;return a&&a>=0?c=s?.substring(0,a):o&&o>=0&&(c=s?.substring(0,o)),(c?r.find(u=>u.message===i&&u.schemaPath?.startsWith(c)):void 0)||r.push(n),r},[])}function nS(e=[],t,r,n){const i=e.map(s=>{const{instancePath:a,keyword:o,params:c,schemaPath:l,parentSchema:u,...m}=s;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,[rt,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(rt,k);b.push(rt,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 rS(i,r)}function sS(e,t,r,n,i,s,a,o){const{validationError:c}=t;let l=nS(t.errors,a,o,n);c&&(l=[...l,{stack:c.message}]),typeof s=="function"&&(l=s(l,a));let u=E0(l);if(c&&(u={...u,$schema:{__errors:[c.message]}}),typeof i!="function")return{errors:l,errorSchema:u};const m=sm(e,n,r,n,!0),_=i(m,pc(m),a,u),v=A0(_);return Ps({errors:l,errorSchema:u},v)}var Js={exports:{}},zo={},Sr={},hn={},Bo={},Ho={},Ko={},Qu;function Ua(){return Qu||(Qu=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 i(y,...f){const C=[y[0]];let P=0;for(;P{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})(Go)),Go}var rd;function Re(){return rd||(rd=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=Ua(),r=td();var n=Ua();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 i=td();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return i.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return i.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return i.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return i.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 s{optimizeNodes(){return this}optimizeNames(d,x){return this}}class a extends s{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 s{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 L(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 s{constructor(d){super(),this.label=d,this.names={}}render({_n:d}){return`${this.label}:`+d}}class u extends s{constructor(d){super(),this.label=d,this.names={}}render({_n:d}){return`break${this.label?` ${this.label}`:""};`+d}}class m extends s{constructor(d){super(),this.error=d}render({_n:d}){return`throw ${this.error};`+d}get names(){return this.error.names}}class _ extends s{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 s{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)||(J(d,F.names),I.splice(T,1))}return I.length>0?this:void 0}get names(){return this.nodes.reduce((d,x)=>U(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 L(d,this.condition),this.else&&U(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 U(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=L(super.names,this.from);return L(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 U(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&&U(d,this.catch.names),this.finally&&U(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 U(p,d){for(const x in d)p[x]=(p[x]||0)+(d[x]||0);return p}function L(p,d){return d instanceof t._CodeOrName?U(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 J(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 X(...p){return p.reduce(Q)}e.and=X;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})`}})(Ho)),Ho}var Ce={},nd;function Te(){if(nd)return Ce;nd=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=Ua();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:(i(h,b),!s(b,h.self.RULES.all))}Ce.alwaysValidSchema=n;function i(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=i;function s(h,b){if(typeof h=="boolean")return!h;for(const O in h)if(b[O])return!0;return!1}Ce.schemaHasRules=s;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,U)=>{const L=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 U===e.Name&&!(L instanceof e.Name)?k($,L):L}}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 Ys={},sd;function rn(){if(sd)return Ys;sd=1,Object.defineProperty(Ys,"__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 Ys.default=t,Ys}var id;function Za(){return id||(id=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 i(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=i;function s(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=s;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,$])}})(Bo)),Bo}var ad;function iS(){if(ad)return hn;ad=1,Object.defineProperty(hn,"__esModule",{value:!0}),hn.boolOrEmptySchema=hn.topBoolOrEmptySchema=void 0;const e=Za(),t=Re(),r=rn(),n={message:"boolean schema is false"};function i(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=i;function s(o,c){const{gen:l,schema:u}=o;u===!1?(l.var(c,!1),a(o)):l.var(c,!0)}hn.boolOrEmptySchema=s;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={},od;function Bm(){if(od)return mn;od=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(i){return typeof i=="string"&&t.has(i)}mn.isJSONType=r;function n(){const i={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...i,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},i.number,i.string,i.array,i.object],post:{rules:[]},all:{},keywords:{}}}return mn.getRules=n,mn}var wr={},cd;function Hm(){if(cd)return wr;cd=1,Object.defineProperty(wr,"__esModule",{value:!0}),wr.shouldUseRule=wr.shouldUseGroup=wr.schemaHasRulesForType=void 0;function e({schema:n,self:i},s){const a=i.RULES.types[s];return a&&a!==!0&&t(n,a)}wr.schemaHasRulesForType=e;function t(n,i){return i.rules.some(s=>r(n,s))}wr.shouldUseGroup=t;function r(n,i){var s;return n[i.keyword]!==void 0||((s=i.definition.implements)===null||s===void 0?void 0:s.some(a=>n[a]!==void 0))}return wr.shouldUseRule=r,wr}var ld;function La(){if(ld)return yt;ld=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=Bm(),t=Hm(),r=Za(),n=Re(),i=Te();var s;(function(f){f[f.Correct=0]="Correct",f[f.Wrong=1]="Wrong"})(s||(yt.DataType=s={}));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,s.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=s.Correct){const b=h===s.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===s.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,i.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,i.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 vs={},ud;function aS(){if(ud)return vs;ud=1,Object.defineProperty(vs,"__esModule",{value:!0}),vs.assignDefaults=void 0;const e=Re(),t=Te();function r(i,s){const{properties:a,items:o}=i.schema;if(s==="object"&&a)for(const c in a)n(i,c,a[c].default);else s==="array"&&Array.isArray(o)&&o.forEach((c,l)=>n(i,l,c.default))}vs.assignDefaults=r;function n(i,s,a){const{gen:o,compositeRule:c,data:l,opts:u}=i;if(a===void 0)return;const m=(0,e._)`${l}${(0,e.getProperty)(s)}`;if(c){(0,t.checkStrictMode)(i,`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 vs}var Xt={},Ge={},dd;function ir(){if(dd)return Ge;dd=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 i(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=i;function s({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=s;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 U=q?(0,e._)`${f}, ${C}, ${h}${b}`:C,L=[[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&&L.push([r.default.dynamicAnchors,r.default.dynamicAnchors]);const B=(0,e._)`${U}, ${P.object(...L)}`;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 U=f.subschema({keyword:h,schemaProp:q,compositeRule:!0},$);C.assign(k,(0,e._)`${k} || ${$}`),f.mergeValidEvaluated(U,$)||C.if((0,e.not)(k))})),f.result(k,()=>f.reset(),()=>f.error(!0))}return Ge.validateUnion=y,Ge}var fd;function oS(){if(fd)return Xt;fd=1,Object.defineProperty(Xt,"__esModule",{value:!0}),Xt.validateKeywordUsage=Xt.validSchemaType=Xt.funcKeywordCode=Xt.macroKeywordCode=void 0;const e=Re(),t=rn(),r=ir(),n=Za();function i(_,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=i;function s(_,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(_),U(()=>_.error());else{const L=v.async?$():M();v.modifying&&a(_),U(()=>o(_,L))}}function $(){const L=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(L,(0,e._)`${B}.errors`),()=>E.throw(B))),L}function M(){const L=(0,e._)`${b}.errors`;return E.assign(L,null),q(e.nil),L}function q(L=v.async?(0,e._)`await `:e.nil){const B=P.opts.passContext?t.default.this:t.default.self,J=!("compile"in v&&!C||v.schema===!1);E.assign(O,(0,e._)`${L}${(0,r.callValidateCode)(_,b,B,J)}`,v.modifying)}function U(L){var B;E.if((0,e.not)((B=v.valid)!==null&&B!==void 0?B:O),L)}}Xt.funcKeywordCode=s;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={},hd;function cS(){if(hd)return Cr;hd=1,Object.defineProperty(Cr,"__esModule",{value:!0}),Cr.extendSubschemaMode=Cr.extendSubschemaData=Cr.getSubschema=void 0;const e=Re(),t=Te();function r(s,{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 _=s.schema[a];return o===void 0?{schema:_,schemaPath:(0,e._)`${s.schemaPath}${(0,e.getProperty)(a)}`,errSchemaPath:`${s.errSchemaPath}/${a}`}:{schema:_[o],schemaPath:(0,e._)`${s.schemaPath}${(0,e.getProperty)(a)}${(0,e.getProperty)(o)}`,errSchemaPath:`${s.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(s,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),s.errorPath=(0,e.str)`${S}${(0,t.getErrorPath)(o,c,g.jsPropertySyntax)}`,s.parentDataProperty=(0,e._)`${o}`,s.dataPathArr=[...E,s.parentDataProperty]}if(l!==void 0){const S=l instanceof e.Name?l:_.let("data",l,!0);v(S),m!==void 0&&(s.propertyName=m)}u&&(s.dataTypes=u);function v(S){s.data=S,s.dataLevel=a.dataLevel+1,s.dataTypes=[],a.definedProperties=new Set,s.parentData=a.data,s.dataNames=[...a.dataNames,S]}}Cr.extendSubschemaData=n;function i(s,{jtdDiscriminator:a,jtdMetadata:o,compositeRule:c,createErrors:l,allErrors:u}){c!==void 0&&(s.compositeRule=c),l!==void 0&&(s.createErrors=l),u!==void 0&&(s.allErrors=u),s.jtdDiscriminator=a,s.jtdMetadata=o}return Cr.extendSubschemaMode=i,Cr}var Pt={},Wo,md;function Qa(){return md||(md=1,Wo=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,i,s;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(i=n;i--!==0;)if(!e(t[i],r[i]))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(s=Object.keys(t),n=s.length,n!==Object.keys(r).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(r,s[i]))return!1;for(i=n;i--!==0;){var a=s[i];if(!e(t[a],r[a]))return!1}return!0}return t!==t&&r!==r}),Wo}var Jo={exports:{}},pd;function lS(){if(pd)return Jo.exports;pd=1;var e=Jo.exports=function(n,i,s){typeof i=="function"&&(s=i,i={}),s=i.cb||s;var a=typeof s=="function"?s:s.pre||function(){},o=s.post||function(){};t(i,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,i,s,a,o,c,l,u,m,_){if(a&&typeof a=="object"&&!Array.isArray(a)){i(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;Eg+=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,U,L)=>{if(L===void 0)return;const B=h+q;let J=P[L];typeof M[y]=="string"&&(J=Y.call(this,M[y])),Q.call(this,M.$anchor),Q.call(this,M.$dynamicAnchor),P[q]=J;function Y(X){const re=this.opts.uriResolver.resolve;if(X=m(J?re(J,X):X),O.has(X))throw $(X);O.add(X);let A=this.refs[X];return typeof A=="string"&&(A=this.refs[A]),typeof A=="object"?k(M,A.schema,X):X!==m(B)&&(X[0]==="#"?(k(M,b[X],X),b[X]=M):this.refs[X]=B),X}function Q(X){if(typeof X=="string"){if(!v.test(X))throw new Error(`invalid anchor "${X}"`);Y.call(this,`#${X}`)}}}),b;function k(M,q,U){if(q!==void 0&&!t(M,q))throw $(U)}function $(M){return new Error(`reference "${M}" resolves to more than one schema`)}}return Pt.getSchemaRefs=S,Pt}var gd;function to(){if(gd)return Sr;gd=1,Object.defineProperty(Sr,"__esModule",{value:!0}),Sr.getData=Sr.KeywordCxt=Sr.validateFunctionCode=void 0;const e=iS(),t=La(),r=Hm(),n=La(),i=aS(),s=oS(),a=cS(),o=Re(),c=rn(),l=eo(),u=Te(),m=Za();function _(N){if(h(N)&&(O(N),P(N))){g(N);return}v(N,()=>(0,e.topBoolOrEmptySchema)(N))}Sr.validateFunctionCode=_;function v({gen:N,validateName:D,schema:V,schemaEnv:K,opts:G},W){G.code.es5?N.func(D,(0,o._)`${c.default.data}, ${c.default.valCxt}`,K.$async,()=>{N.code((0,o._)`"use strict"; ${f(V,G)}`),E(N,G),N.code(W)}):N.func(D,(0,o._)`${c.default.data}, ${S(G)}`,K.$async,()=>N.code(f(V,G)).code(W))}function S(N){return(0,o._)`{${c.default.instancePath}="", ${c.default.parentData}, ${c.default.parentDataProperty}, ${c.default.rootData}=${c.default.data}${N.dynamicRef?(0,o._)`, ${c.default.dynamicAnchors}={}`:o.nil}}={}`}function E(N,D){N.if(c.default.valCxt,()=>{N.var(c.default.instancePath,(0,o._)`${c.default.valCxt}.${c.default.instancePath}`),N.var(c.default.parentData,(0,o._)`${c.default.valCxt}.${c.default.parentData}`),N.var(c.default.parentDataProperty,(0,o._)`${c.default.valCxt}.${c.default.parentDataProperty}`),N.var(c.default.rootData,(0,o._)`${c.default.valCxt}.${c.default.rootData}`),D.dynamicRef&&N.var(c.default.dynamicAnchors,(0,o._)`${c.default.valCxt}.${c.default.dynamicAnchors}`)},()=>{N.var(c.default.instancePath,(0,o._)`""`),N.var(c.default.parentData,(0,o._)`undefined`),N.var(c.default.parentDataProperty,(0,o._)`undefined`),N.var(c.default.rootData,c.default.data),D.dynamicRef&&N.var(c.default.dynamicAnchors,(0,o._)`{}`)})}function g(N){const{schema:D,opts:V,gen:K}=N;v(N,()=>{V.$comment&&D.$comment&&L(N),M(N),K.let(c.default.vErrors,null),K.let(c.default.errors,0),V.unevaluated&&y(N),k(N),B(N)})}function y(N){const{gen:D,validateName:V}=N;N.evaluated=D.const("evaluated",(0,o._)`${V}.evaluated`),D.if((0,o._)`${N.evaluated}.dynamicProps`,()=>D.assign((0,o._)`${N.evaluated}.props`,(0,o._)`undefined`)),D.if((0,o._)`${N.evaluated}.dynamicItems`,()=>D.assign((0,o._)`${N.evaluated}.items`,(0,o._)`undefined`))}function f(N,D){const V=typeof N=="object"&&N[D.schemaId];return V&&(D.code.source||D.code.process)?(0,o._)`/*# sourceURL=${V} */`:o.nil}function C(N,D){if(h(N)&&(O(N),P(N))){b(N,D);return}(0,e.boolOrEmptySchema)(N,D)}function P({schema:N,self:D}){if(typeof N=="boolean")return!N;for(const V in N)if(D.RULES.all[V])return!0;return!1}function h(N){return typeof N.schema!="boolean"}function b(N,D){const{schema:V,gen:K,opts:G}=N;G.$comment&&V.$comment&&L(N),q(N),U(N);const W=K.const("_errs",c.default.errors);k(N,W),K.var(D,(0,o._)`${W} === ${c.default.errors}`)}function O(N){(0,u.checkUnknownRules)(N),$(N)}function k(N,D){if(N.opts.jtd)return Y(N,[],!1,D);const V=(0,t.getSchemaTypes)(N.schema),K=(0,t.coerceAndCheckDataType)(N,V);Y(N,V,!K,D)}function $(N){const{schema:D,errSchemaPath:V,opts:K,self:G}=N;D.$ref&&K.ignoreKeywordsWithRef&&(0,u.schemaHasRulesButRef)(D,G.RULES)&&G.logger.warn(`$ref: keywords ignored in schema at path "${V}"`)}function M(N){const{schema:D,opts:V}=N;D.default!==void 0&&V.useDefaults&&V.strictSchema&&(0,u.checkStrictMode)(N,"default is ignored in the schema root")}function q(N){const D=N.schema[N.opts.schemaId];D&&(N.baseId=(0,l.resolveUrl)(N.opts.uriResolver,N.baseId,D))}function U(N){if(N.schema.$async&&!N.schemaEnv.$async)throw new Error("async schema in sync schema")}function L({gen:N,schemaEnv:D,schema:V,errSchemaPath:K,opts:G}){const W=V.$comment;if(G.$comment===!0)N.code((0,o._)`${c.default.self}.logger.log(${W})`);else if(typeof G.$comment=="function"){const te=(0,o.str)`${K}/$comment`,ne=N.scopeValue("root",{ref:D.root});N.code((0,o._)`${c.default.self}.opts.$comment(${W}, ${te}, ${ne}.schema)`)}}function B(N){const{gen:D,schemaEnv:V,validateName:K,ValidationError:G,opts:W}=N;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),W.unevaluated&&J(N),D.return((0,o._)`${c.default.errors} === 0`))}function J({gen:N,evaluated:D,props:V,items:K}){V instanceof o.Name&&N.assign((0,o._)`${D}.props`,V),K instanceof o.Name&&N.assign((0,o._)`${D}.items`,K)}function Y(N,D,V,K){const{gen:G,schema:W,data:te,allErrors:ne,opts:ie,self:ce}=N,{RULES:he}=ce;if(W.$ref&&(ie.ignoreKeywordsWithRef||!(0,u.schemaHasRulesButRef)(W,he))){G.block(()=>T(N,"$ref",he.all.$ref.definition));return}ie.jtd||X(N,D),G.block(()=>{for(const ge of he.rules)le(ge);le(he.post)});function le(ge){(0,r.shouldUseGroup)(W,ge)&&(ge.type?(G.if((0,n.checkDataType)(ge.type,te,ie.strictNumbers)),Q(N,ge),D.length===1&&D[0]===ge.type&&V&&(G.else(),(0,n.reportTypeError)(N)),G.endIf()):Q(N,ge),ne||G.if((0,o._)`${c.default.errors} === ${K||0}`))}}function Q(N,D){const{gen:V,schema:K,opts:{useDefaults:G}}=N;G&&(0,i.assignDefaults)(N,D.type),V.block(()=>{for(const W of D.rules)(0,r.shouldUseRule)(K,W)&&T(N,W.keyword,W.definition,D.type)})}function X(N,D){N.schemaEnv.meta||!N.opts.strictTypes||(re(N,D),N.opts.allowUnionTypes||A(N,D),w(N,N.dataTypes))}function re(N,D){if(D.length){if(!N.dataTypes.length){N.dataTypes=D;return}D.forEach(V=>{p(N.dataTypes,V)||x(N,`type "${V}" not allowed by context "${N.dataTypes.join(",")}"`)}),d(N,D)}}function A(N,D){D.length>1&&!(D.length===2&&D.includes("null"))&&x(N,"use allowUnionTypes to allow union type keyword")}function w(N,D){const V=N.self.RULES.all;for(const K in V){const G=V[K];if(typeof G=="object"&&(0,r.shouldUseRule)(N.schema,G)){const{type:W}=G.definition;W.length&&!W.some(te=>j(D,te))&&x(N,`missing type "${W.join(",")}" for keyword "${K}"`)}}}function j(N,D){return N.includes(D)||D==="number"&&N.includes("integer")}function p(N,D){return N.includes(D)||D==="integer"&&N.includes("number")}function d(N,D){const V=[];for(const K of N.dataTypes)p(D,K)?V.push(K):D.includes("integer")&&K==="number"&&V.push("integer");N.dataTypes=V}function x(N,D){const V=N.schemaEnv.baseId+N.errSchemaPath;D+=` at "${V}" (strictTypes)`,(0,u.checkStrictMode)(N,D,N.opts.strictTypes)}class I{constructor(D,V,K){if((0,s.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,s.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:W,def:te}=this;K.if((0,o.or)((0,o._)`${G} === undefined`,V)),D!==o.nil&&K.assign(D,!0),(W.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:W}=this;return(0,o.or)(te(),ne());function te(){if(K.length){if(!(V instanceof o.Name))throw new Error("ajv implementation error");const ie=Array.isArray(K)?K:[K];return(0,o._)`${(0,n.checkDataTypes)(ie,V,W.opts.strictNumbers,n.DataType.Wrong)}`}return o.nil}function ne(){if(G.validateSchema){const ie=D.scopeValue("validate$data",{ref:G.validateSchema});return(0,o._)`!${ie}(${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(N,D,V,K){const G=new I(N,V,D);"code"in V?V.code(G,K):G.$data&&V.validate?(0,s.funcKeywordCode)(G,V):"macro"in V?(0,s.macroKeywordCode)(G,V):(V.compile||V.validate)&&(0,s.funcKeywordCode)(G,V)}const F=/^\/(?:[^~]|~0|~1)*$/,z=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function H(N,{dataLevel:D,dataNames:V,dataPathArr:K}){let G,W;if(N==="")return c.default.rootData;if(N[0]==="/"){if(!F.test(N))throw new Error(`Invalid JSON-pointer: ${N}`);G=N,W=c.default.rootData}else{const ce=z.exec(N);if(!ce)throw new Error(`Invalid JSON-pointer: ${N}`);const he=+ce[1];if(G=ce[2],G==="#"){if(he>=D)throw new Error(ie("property/index",he));return K[D-he]}if(he>D)throw new Error(ie("data",he));if(W=V[D-he],!G)return W}let te=W;const ne=G.split("/");for(const ce of ne)ce&&(W=(0,o._)`${W}${(0,o.getProperty)((0,u.unescapeJsonPointer)(ce))}`,te=(0,o._)`${te} && ${W}`);return te;function ie(ce,he){return`Cannot access ${ce} ${he} levels up, current level is ${D}`}}return Sr.getData=H,Sr}var Xs={},vd;function cl(){if(vd)return Xs;vd=1,Object.defineProperty(Xs,"__esModule",{value:!0});class e extends Error{constructor(r){super("validation failed"),this.errors=r,this.ajv=this.validation=!0}}return Xs.default=e,Xs}var Zs={},bd;function ro(){if(bd)return Zs;bd=1,Object.defineProperty(Zs,"__esModule",{value:!0});const e=eo();class t extends Error{constructor(n,i,s,a){super(a||`can't resolve reference ${s} from id ${i}`),this.missingRef=(0,e.resolveUrl)(n,i,s),this.missingSchema=(0,e.normalizeId)((0,e.getFullPath)(n,this.missingRef))}}return Zs.default=t,Zs}var Tt={},_d;function ll(){if(_d)return Tt;_d=1,Object.defineProperty(Tt,"__esModule",{value:!0}),Tt.resolveSchema=Tt.getCompilingSchema=Tt.resolveRef=Tt.compileSchema=Tt.SchemaEnv=void 0;const e=Re(),t=cl(),r=rn(),n=eo(),i=Te(),s=to();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,s.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 L=new Function(`${r.default.self}`,`${r.default.scope}`,M)(this,this.scope.get());if(this.scope.value(k,{ref:L}),L.errors=null,L.schema=g.schema,L.schemaEnv=g,g.$async&&(L.$async=!0),this.opts.code.source===!0&&(L.source={validateName:k,validateCode:q,scopeValues:b._values}),this.opts.unevaluated){const{props:B,items:J}=$;L.evaluated={props:B instanceof e.Name?void 0:B,items:J instanceof e.Name?void 0:J,dynamicProps:B instanceof e.Name,dynamicItems:J instanceof e.Name},L.source&&(L.source.evaluated=(0,e.stringify)(L.evaluated))}return g.validate=L,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,i.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,i.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 uS="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",dS="Meta-schema for $data reference (JSON AnySchema extension proposal)",fS="object",hS=["$data"],mS={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},pS=!1,yS={$id:uS,description:dS,type:fS,required:hS,properties:mS,additionalProperties:pS};var Qs={},bs={exports:{}},Yo,Sd;function Km(){if(Sd)return Yo;Sd=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),i=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),s=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=48&&j<=57||j>=65&&j<=70||j>=97&&j<=102))return"";w+=A[p];break}for(p+=1;p=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;wj&&(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=8)return;const I=d.slice(0,j.length);for(let T=x;T<8;T++)I.push("0");for(let T=j.length;Th[p])}function $(A,w=!1){if(A.indexOf("%")===-1)return A;let j="";for(let p=0;p57343)w+=l(d);else if(d<=56319&&j+1=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;d57343)j+=l(I);else if(I<=56319&&d+1=56320&&T<=57343?(j+=l(65536+(I-55296<<10)+(T-56320)),d++):j+=l(65533)}else j+=l(65533)}}return j}function U(A,w){let j="";for(let p=0;p57343)j+=l(x);else if(x<=56319&&p+1=56320&&I<=57343?(j+=l(65536+(x-55296<<10)+(I-56320)),p++):j+=l(65533)}else j+=l(65533)}}return j}function L(A){return U(A,o)}function B(A){return U(A,a)}function J(A){return U(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;j57343)w+=l(d);else if(d<=56319&&j+1=56320&&x<=57343?(w+=l(65536+(d-55296<<10)+(x-56320)),j++):w+=l(65533)}else w+=l(65533)}}return w}function X(A){let w="";for(let j=0;j65535))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 U(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 L(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 N=A.match(O);N!==null&&N[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 W=unescape(p.scheme);S.test(W)?p.scheme=W.toLowerCase():(p.error=p.error||E,z=!0)}x=U(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,ie=e(p.host);H=ie.isIPV6||ie.isIPVFuture===!0,F=ne&&(!te||ie.error===!0),p.host=H?ie.host:ie.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=L(p,j,G,H)),!G||G&&!G.skipNormalize){if(A.indexOf("%")!==-1&&p.host!==void 0&&!F){const W=H?p.host:n(p.host,!0);p.host=l(W,H)}p.path&&(p.path=i(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 J(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 X(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:J};return bs.exports=re,bs.exports.default=re,bs.exports.fastUri=re,bs.exports}var Ed;function bS(){if(Ed)return Qs;Ed=1,Object.defineProperty(Qs,"__esModule",{value:!0});const e=vS();return e.code='require("ajv/dist/runtime/uri").default',Qs.default=e,Qs}var Ad;function _S(){return Ad||(Ad=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=to();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=cl(),i=ro(),s=Bm(),a=ll(),o=Re(),c=eo(),l=La(),u=Te(),m=yS,_=bS(),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,N,D,V,K,G,W,te,ne,ie,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,dt=(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=(N=A.strictTuples)!==null&&N!==void 0?N: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:dt}:{optimize:oe,regExp:dt},loopRequired:(G=A.loopRequired)!==null&&G!==void 0?G:f,loopEnum:(W=A.loopEnum)!==null&&W!==void 0?W:f,meta:(te=A.meta)!==null&&te!==void 0?te:!0,messages:(ne=A.messages)!==null&&ne!==void 0?ne:!0,inlineRefs:(ie=A.inlineRefs)!==null&&ie!==void 0?ie:!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=U(w.logger);const d=w.validateFormats;w.validateFormats=!1,this.RULES=(0,s.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,N){await x.call(this,H.$schema);const D=this._addSchema(H,N);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(N){if(!(N instanceof i.default))throw N;return T.call(this,N),await F.call(this,N.missingSchema),I.call(this,H)}}function T({missingSchema:H,missingRef:N}){if(this.refs[H])throw new Error(`AnySchema ${H} is loaded but ${N} cannot be resolved`)}async function F(H){const N=await z.call(this,H);this.refs[H]||await x.call(this,N.$schema),this.refs[H]||this.addSchema(N,H,j)}async function z(H){const N=this._loading[H];if(N)return N;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=>J.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=>J.call(this,x,d):x=>d.type.forEach(I=>J.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=i.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 U(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 L=/^[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(!L.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 J(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 X={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function re(A){return{anyOf:[A,X]}}})(zo)),zo}var ei={},ti={},ri={},xd;function SS(){if(xd)return ri;xd=1,Object.defineProperty(ri,"__esModule",{value:!0});const e={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};return ri.default=e,ri}var Tr={},Pd;function wS(){if(Pd)return Tr;Pd=1,Object.defineProperty(Tr,"__esModule",{value:!0}),Tr.callRef=Tr.getValidate=void 0;const e=ro(),t=ir(),r=Re(),n=rn(),i=ll(),s=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=i.resolveRef.call(y,f,v,m);if(C===void 0)throw new e.default(_.opts.uriResolver,v,m);if(C instanceof i.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=s.mergeEvaluated.props(v,$.props,S.props));else{const M=v.var("props",(0,r._)`${O}.evaluated.props`);S.props=s.mergeEvaluated.props(v,M,S.props,r.Name)}if(S.items!==!0)if($&&!$.dynamicItems)$.items!==void 0&&(S.items=s.mergeEvaluated.items(v,$.items,S.items));else{const M=v.var("items",(0,r._)`${O}.evaluated.items`);S.items=s.mergeEvaluated.items(v,M,S.items,r.Name)}}}return Tr.callRef=c,Tr.default=a,Tr}var Od;function CS(){if(Od)return ti;Od=1,Object.defineProperty(ti,"__esModule",{value:!0});const e=SS(),t=wS(),r=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",e.default,t.default];return ti.default=r,ti}var ni={},si={},jd;function ES(){if(jd)return si;jd=1,Object.defineProperty(si,"__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:s,schemaCode:a})=>(0,e.str)`must be ${r[s].okStr} ${a}`,params:({keyword:s,schemaCode:a})=>(0,e._)`{comparison: ${r[s].okStr}, limit: ${a}}`},i={keyword:Object.keys(r),type:"number",schemaType:"number",$data:!0,error:n,code(s){const{keyword:a,data:o,schemaCode:c}=s;s.fail$data((0,e._)`${o} ${r[a].fail} ${c} || isNaN(${o})`)}};return si.default=i,si}var ii={},kd;function AS(){if(kd)return ii;kd=1,Object.defineProperty(ii,"__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:i,data:s,schemaCode:a,it:o}=n,c=o.opts.multipleOfPrecision,l=i.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} = ${s}/${a}, ${u}))`)}};return ii.default=r,ii}var ai={},oi={},Id;function xS(){if(Id)return oi;Id=1,Object.defineProperty(oi,"__esModule",{value:!0});function e(t){const r=t.length;let n=0,i=0,s;for(;i=55296&&s<=56319&&i(0,e._)`{limit: ${s}}`},code(s){const{keyword:a,data:o,schemaCode:c,it:l}=s,u=a==="maxLength"?e.operators.GT:e.operators.LT,m=l.opts.unicode===!1?(0,e._)`${o}.length`:(0,e._)`${(0,t.useFunc)(s.gen,r.default)}(${o})`;s.fail$data((0,e._)`${m} ${u} ${c}`)}};return ai.default=i,ai}var ci={},Rd;function OS(){if(Rd)return ci;Rd=1,Object.defineProperty(ci,"__esModule",{value:!0});const e=ir(),t=Te(),r=Re(),i={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:s})=>(0,r.str)`must match pattern "${s}"`,params:({schemaCode:s})=>(0,r._)`{pattern: ${s}}`},code(s){const{gen:a,data:o,$data:c,schema:l,schemaCode:u,it:m}=s,_=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)),s.fail$data((0,r._)`!${E}`)}else{const v=(0,e.usePattern)(s,l);s.fail$data((0,r._)`!${v}.test(${o})`)}}};return ci.default=i,ci}var li={},$d;function jS(){if($d)return li;$d=1,Object.defineProperty(li,"__esModule",{value:!0});const e=Re(),r={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:n,schemaCode:i}){const s=n==="maxProperties"?"more":"fewer";return(0,e.str)`must NOT have ${s} than ${i} properties`},params:({schemaCode:n})=>(0,e._)`{limit: ${n}}`},code(n){const{keyword:i,data:s,schemaCode:a}=n,o=i==="maxProperties"?e.operators.GT:e.operators.LT;n.fail$data((0,e._)`Object.keys(${s}).length ${o} ${a}`)}};return li.default=r,li}var ui={},Fd;function kS(){if(Fd)return ui;Fd=1,Object.defineProperty(ui,"__esModule",{value:!0});const e=ir(),t=Re(),r=Te(),i={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:s}})=>(0,t.str)`must have required property '${s}'`,params:({params:{missingProperty:s}})=>(0,t._)`{missingProperty: ${s}}`},code(s){const{gen:a,schema:o,schemaCode:c,data:l,$data:u,it:m}=s,{opts:_}=m;if(!u&&o.length===0)return;const v=o.length>=_.loopRequired;if(m.allErrors?S():E(),_.strictRequired){const f=s.parentSchema.properties,{definedProperties:C}=s.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)s.block$data(t.nil,g);else for(const f of o)(0,e.checkReportMissingProp)(s,f)}function E(){const f=a.let("missing");if(v||u){const C=a.let("valid",!0);s.block$data(C,()=>y(f,C)),s.ok(C)}else a.if((0,e.checkMissingProp)(s,o,f)),(0,e.reportMissingProp)(s,f),a.else()}function g(){a.forOf("prop",c,f=>{s.setParams({missingProperty:f}),a.if((0,e.noPropertyInData)(a,l,f,_.ownProperties),()=>s.error())})}function y(f,C){s.setParams({missingProperty:f}),a.forOf(f,c,()=>{a.assign(C,(0,e.propertyInData)(a,l,f,_.ownProperties)),a.if((0,t.not)(C),()=>{s.error(),a.break()})},t.nil)}}};return ui.default=i,ui}var di={},Dd;function IS(){if(Dd)return di;Dd=1,Object.defineProperty(di,"__esModule",{value:!0});const e=Re(),r={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:n,schemaCode:i}){const s=n==="maxItems"?"more":"fewer";return(0,e.str)`must NOT have ${s} than ${i} items`},params:({schemaCode:n})=>(0,e._)`{limit: ${n}}`},code(n){const{keyword:i,data:s,schemaCode:a}=n,o=i==="maxItems"?e.operators.GT:e.operators.LT;n.fail$data((0,e._)`${s}.length ${o} ${a}`)}};return di.default=r,di}var fi={},hi={},Td;function ul(){if(Td)return hi;Td=1,Object.defineProperty(hi,"__esModule",{value:!0});const e=Qa();return e.code='require("ajv/dist/runtime/equal").default',hi.default=e,hi}var Md;function NS(){if(Md)return fi;Md=1,Object.defineProperty(fi,"__esModule",{value:!0});const e=La(),t=Re(),r=Te(),n=ul(),s={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 fi.default=s,fi}var mi={},qd;function RS(){if(qd)return mi;qd=1,Object.defineProperty(mi,"__esModule",{value:!0});const e=Re(),t=Te(),r=ul(),i={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:s})=>(0,e._)`{allowedValue: ${s}}`},code(s){const{gen:a,data:o,$data:c,schemaCode:l,schema:u}=s;c||u&&typeof u=="object"?s.fail$data((0,e._)`!${(0,t.useFunc)(a,r.default)}(${o}, ${l})`):s.fail((0,e._)`${u} !== ${o}`)}};return mi.default=i,mi}var pi={},Ud;function $S(){if(Ud)return pi;Ud=1,Object.defineProperty(pi,"__esModule",{value:!0});const e=Re(),t=Te(),r=ul(),i={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:s})=>(0,e._)`{allowedValues: ${s}}`},code(s){const{gen:a,data:o,$data:c,schema:l,schemaCode:u,it:m}=s;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"),s.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)))}s.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 pi.default=i,pi}var Ld;function FS(){if(Ld)return ni;Ld=1,Object.defineProperty(ni,"__esModule",{value:!0});const e=ES(),t=AS(),r=PS(),n=OS(),i=jS(),s=kS(),a=IS(),o=NS(),c=RS(),l=$S(),u=[e.default,t.default,r.default,n.default,i.default,s.default,a.default,o.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},c.default,l.default];return ni.default=u,ni}var yi={},Vn={},Vd;function Gm(){if(Vd)return Vn;Vd=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:s}})=>(0,e.str)`must NOT have more than ${s} items`,params:({params:{len:s}})=>(0,e._)`{limit: ${s}}`},code(s){const{parentSchema:a,it:o}=s,{items:c}=a;if(!Array.isArray(c)){(0,t.checkStrictMode)(o,'"additionalItems" is ignored when "items" is not an array of schemas');return}i(s,c)}};function i(s,a){const{gen:o,schema:c,data:l,keyword:u,it:m}=s;m.items=!0;const _=o.const("len",(0,e._)`${l}.length`);if(c===!1)s.setParams({len:a.length}),s.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)),s.ok(S)}function v(S){o.forRange("i",a.length,_,E=>{s.subschema({keyword:u,dataProp:E,dataPropType:t.Type.Num},S),m.allErrors||o.if((0,e.not)(S),()=>o.break())})}}return Vn.validateAdditionalItems=i,Vn.default=n,Vn}var gi={},zn={},zd;function Wm(){if(zd)return zn;zd=1,Object.defineProperty(zn,"__esModule",{value:!0}),zn.validateTuple=void 0;const e=Re(),t=Te(),r=ir(),n={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(s){const{schema:a,it:o}=s;if(Array.isArray(a))return i(s,"additionalItems",a);o.items=!0,!(0,t.alwaysValidSchema)(o,a)&&s.ok((0,r.validateArray)(s))}};function i(s,a,o=s.schema){const{gen:c,parentSchema:l,data:u,keyword:m,it:_}=s;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}`,()=>s.subschema({keyword:m,schemaProp:y,dataProp:y},v)),s.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=i,zn.default=n,zn}var Bd;function DS(){if(Bd)return gi;Bd=1,Object.defineProperty(gi,"__esModule",{value:!0});const e=Wm(),t={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:r=>(0,e.validateTuple)(r,"items")};return gi.default=t,gi}var vi={},Hd;function TS(){if(Hd)return vi;Hd=1,Object.defineProperty(vi,"__esModule",{value:!0});const e=Re(),t=Te(),r=ir(),n=Gm(),s={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 vi.default=s,vi}var bi={},Kd;function MS(){if(Kd)return bi;Kd=1,Object.defineProperty(bi,"__esModule",{value:!0});const e=Re(),t=Te(),n={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:i,max:s}})=>s===void 0?(0,e.str)`must contain at least ${i} valid item(s)`:(0,e.str)`must contain at least ${i} and no more than ${s} valid item(s)`,params:({params:{min:i,max:s}})=>s===void 0?(0,e._)`{minContains: ${i}}`:(0,e._)`{minContains: ${i}, maxContains: ${s}}`},code(i){const{gen:s,schema:a,parentSchema:o,data:c,it:l}=i;let u,m;const{minContains:_,maxContains:v}=o;l.opts.next?(u=_===void 0?1:_,m=v):u=1;const S=s.const("len",(0,e._)`${c}.length`);if(i.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'),i.fail();return}if((0,t.alwaysValidSchema)(l,a)){let C=(0,e._)`${S} >= ${u}`;m!==void 0&&(C=(0,e._)`${C} && ${S} <= ${m}`),i.pass(C);return}l.items=!0;const E=s.name("valid");m===void 0&&u===1?y(E,()=>s.if(E,()=>s.break())):u===0?(s.let(E,!0),m!==void 0&&s.if((0,e._)`${c}.length > 0`,g)):(s.let(E,!1),g()),i.result(E,()=>i.reset());function g(){const C=s.name("_valid"),P=s.let("count",0);y(C,()=>s.if(C,()=>f(P)))}function y(C,P){s.forRange("i",0,S,h=>{i.subschema({keyword:"contains",dataProp:h,dataPropType:t.Type.Num,compositeRule:!0},C),P()})}function f(C){s.code((0,e._)`${C}++`),m===void 0?s.if((0,e._)`${C} >= ${u}`,()=>s.assign(E,!0).break()):(s.if((0,e._)`${C} > ${m}`,()=>s.assign(E,!1).break()),u===1?s.assign(E,!0):s.if((0,e._)`${C} >= ${u}`,()=>s.assign(E,!0)))}}};return bi.default=n,bi}var Zo={},Gd;function qS(){return Gd||(Gd=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=Re(),r=Te(),n=ir();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 i={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(c){const[l,u]=s(c);a(c,l),o(c,u)}};function s({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=i})(Zo)),Zo}var _i={},Wd;function US(){if(Wd)return _i;Wd=1,Object.defineProperty(_i,"__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:i})=>(0,e._)`{propertyName: ${i.propertyName}}`},code(i){const{gen:s,schema:a,data:o,it:c}=i;if((0,t.alwaysValidSchema)(c,a))return;const l=s.name("valid");s.forIn("key",o,u=>{i.setParams({propertyName:u}),i.subschema({keyword:"propertyNames",data:u,dataTypes:["string"],propertyName:u,compositeRule:!0},l),s.if((0,e.not)(l),()=>{i.error(!0),c.allErrors||s.break()})}),i.ok(l)}};return _i.default=n,_i}var Si={},Jd;function Jm(){if(Jd)return Si;Jd=1,Object.defineProperty(Si,"__esModule",{value:!0});const e=ir(),t=Re(),r=rn(),n=Te(),s={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 Si.default=s,Si}var wi={},Yd;function LS(){if(Yd)return wi;Yd=1,Object.defineProperty(wi,"__esModule",{value:!0});const e=to(),t=ir(),r=Te(),n=Jm(),i={keyword:"properties",type:"object",schemaType:"object",code(s){const{gen:a,schema:o,parentSchema:c,data:l,it:u}=s;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()),s.it.definedProperties.add(g),s.ok(v);function S(g){return u.opts.useDefaults&&!u.compositeRule&&o[g].default!==void 0}function E(g){s.subschema({keyword:"properties",schemaProp:g,dataProp:g},v)}}};return wi.default=i,wi}var Ci={},Xd;function VS(){if(Xd)return Ci;Xd=1,Object.defineProperty(Ci,"__esModule",{value:!0});const e=ir(),t=Re(),r=Te(),n=Te(),i={keyword:"patternProperties",type:"object",schemaType:"object",code(s){const{gen:a,schema:o,data:c,parentSchema:l,it:u}=s,{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)(s,P)}.test(${h})`,()=>{const b=v.includes(P);b||s.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 Ci.default=i,Ci}var Ei={},Zd;function zS(){if(Zd)return Ei;Zd=1,Object.defineProperty(Ei,"__esModule",{value:!0});const e=Te(),t={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(r){const{gen:n,schema:i,it:s}=r;if((0,e.alwaysValidSchema)(s,i)){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 Ei.default=t,Ei}var Ai={},Qd;function BS(){if(Qd)return Ai;Qd=1,Object.defineProperty(Ai,"__esModule",{value:!0});const t={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:ir().validateUnion,error:{message:"must match a schema in anyOf"}};return Ai.default=t,Ai}var xi={},ef;function HS(){if(ef)return xi;ef=1,Object.defineProperty(xi,"__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:i})=>(0,e._)`{passingSchemas: ${i.passing}}`},code(i){const{gen:s,schema:a,parentSchema:o,it:c}=i;if(!Array.isArray(a))throw new Error("ajv implementation error");if(c.opts.discriminator&&o.discriminator)return;const l=a,u=s.let("valid",!1),m=s.let("passing",null),_=s.name("_valid");i.setParams({passing:m}),s.block(v),i.result(u,()=>i.reset(),()=>i.error(!0));function v(){l.forEach((S,E)=>{let g;(0,t.alwaysValidSchema)(c,S)?s.var(_,!0):g=i.subschema({keyword:"oneOf",schemaProp:E,compositeRule:!0},_),E>0&&s.if((0,e._)`${_} && ${u}`).assign(u,!1).assign(m,(0,e._)`[${m}, ${E}]`).else(),s.if(_,()=>{s.assign(u,!0),s.assign(m,E),g&&i.mergeEvaluated(g,e.Name)})})}}};return xi.default=n,xi}var Pi={},tf;function KS(){if(tf)return Pi;tf=1,Object.defineProperty(Pi,"__esModule",{value:!0});const e=Te(),t={keyword:"allOf",schemaType:"array",code(r){const{gen:n,schema:i,it:s}=r;if(!Array.isArray(i))throw new Error("ajv implementation error");const a=n.name("valid");i.forEach((o,c)=>{if((0,e.alwaysValidSchema)(s,o))return;const l=r.subschema({keyword:"allOf",schemaProp:c},a);r.ok(a),r.mergeEvaluated(l)})}};return Pi.default=t,Pi}var Oi={},rf;function GS(){if(rf)return Oi;rf=1,Object.defineProperty(Oi,"__esModule",{value:!0});const e=Re(),t=Te(),n={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:s})=>(0,e.str)`must match "${s.ifClause}" schema`,params:({params:s})=>(0,e._)`{failingKeyword: ${s.ifClause}}`},code(s){const{gen:a,parentSchema:o,it:c}=s;o.then===void 0&&o.else===void 0&&(0,t.checkStrictMode)(c,'"if" without "then" and "else" is ignored');const l=i(c,"then"),u=i(c,"else");if(!l&&!u)return;const m=a.let("valid",!0),_=a.name("_valid");if(v(),s.reset(),l&&u){const E=a.let("ifClause");s.setParams({ifClause:E}),a.if(_,S("then",E),S("else",E))}else l?a.if(_,S("then")):a.if((0,e.not)(_),S("else"));s.pass(m,()=>s.error(!0));function v(){const E=s.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},_);s.mergeEvaluated(E)}function S(E,g){return()=>{const y=s.subschema({keyword:E},_);a.assign(m,_),s.mergeValidEvaluated(y,m),g?a.assign(g,(0,e._)`${E}`):s.setParams({ifClause:E})}}}};function i(s,a){const o=s.schema[a];return o!==void 0&&!(0,t.alwaysValidSchema)(s,o)}return Oi.default=n,Oi}var ji={},nf;function WS(){if(nf)return ji;nf=1,Object.defineProperty(ji,"__esModule",{value:!0});const e=Te(),t={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:r,parentSchema:n,it:i}){n.if===void 0&&(0,e.checkStrictMode)(i,`"${r}" without "if" is ignored`)}};return ji.default=t,ji}var sf;function JS(){if(sf)return yi;sf=1,Object.defineProperty(yi,"__esModule",{value:!0});const e=Gm(),t=DS(),r=Wm(),n=TS(),i=MS(),s=qS(),a=US(),o=Jm(),c=LS(),l=VS(),u=zS(),m=BS(),_=HS(),v=KS(),S=GS(),E=WS();function g(y=!1){const f=[u.default,m.default,_.default,v.default,S.default,E.default,a.default,o.default,s.default,c.default,l.default];return y?f.push(t.default,n.default):f.push(e.default,r.default),f.push(i.default),f}return yi.default=g,yi}var ki={},Ii={},af;function YS(){if(af)return Ii;af=1,Object.defineProperty(Ii,"__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,i){const{gen:s,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=s.scopeValue("formats",{ref:S.formats,code:m.code.formats}),f=s.const("fDef",(0,e._)`${y}[${l}]`),C=s.let("fType"),P=s.let("format");s.if((0,e._)`typeof ${f} == "object" && !(${f} instanceof RegExp)`,()=>s.assign(C,(0,e._)`${f}.type || "string"`).assign(P,(0,e._)`${f}.validate`),()=>s.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} === ${i} && !${k}`}}function g(){const y=S.formats[c];if(!y){h();return}if(y===!0)return;const[f,C,P]=b(y);f===i&&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=s.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 Ii.default=r,Ii}var of;function XS(){if(of)return ki;of=1,Object.defineProperty(ki,"__esModule",{value:!0});const t=[YS().default];return ki.default=t,ki}var pn={},cf;function ZS(){return cf||(cf=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 lf;function QS(){if(lf)return ei;lf=1,Object.defineProperty(ei,"__esModule",{value:!0});const e=CS(),t=FS(),r=JS(),n=XS(),i=ZS(),s=[e.default,t.default,(0,r.default)(),n.default,i.metadataVocabulary,i.contentVocabulary];return ei.default=s,ei}var Ni={},_s={},uf;function e1(){if(uf)return _s;uf=1,Object.defineProperty(_s,"__esModule",{value:!0}),_s.DiscrError=void 0;var e;return(function(t){t.Tag="tag",t.Mapping="mapping"})(e||(_s.DiscrError=e={})),_s}var df;function t1(){if(df)return Ni;df=1,Object.defineProperty(Ni,"__esModule",{value:!0});const e=Re(),t=e1(),r=ll(),n=ro(),i=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;qthis.addVocabulary(S)),this.opts.discriminator&&this.addKeyword(i.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const S=this.opts.$data?this.$dataMetaSchema(s,a):s;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=to();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=cl();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return m.default}});var _=ro();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return _.default}})})(Js,Js.exports)),Js.exports}var u1=l1();const d1=$s(u1);var Ri={exports:{}},Qo={},hf;function f1(){return hf||(hf=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(s,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)$/,i=[0,31,28,31,30,31,30,31,31,30,31,30,31];function s($){const M=n.exec($);if(!M)return!1;const q=+M[1],U=+M[2],L=+M[3];return U>=1&&U<=12&&L>=1&&L<=(U===2&&r(q)?29:i[U])}function a($,M){if($&&M)return $>M?1:$M?1:$=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}}})(Qo)),Qo}var ec={},$i={exports:{}},tc={},Er={},yn={},rc={},nc={},sc={},mf;function Va(){return mf||(mf=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 i(y,...f){const C=[y[0]];let P=0;for(;P{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})(ic)),ic}var gf;function Oe(){return gf||(gf=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=Va(),r=yf();var n=Va();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 i=yf();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return i.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return i.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return i.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return i.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 s{optimizeNodes(){return this}optimizeNames(d,x){return this}}class a extends s{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 s{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 L(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 s{constructor(d){super(),this.label=d,this.names={}}render({_n:d}){return`${this.label}:`+d}}class u extends s{constructor(d){super(),this.label=d,this.names={}}render({_n:d}){return`break${this.label?` ${this.label}`:""};`+d}}class m extends s{constructor(d){super(),this.error=d}render({_n:d}){return`throw ${this.error};`+d}get names(){return this.error.names}}class _ extends s{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 s{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)||(J(d,F.names),I.splice(T,1))}return I.length>0?this:void 0}get names(){return this.nodes.reduce((d,x)=>U(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 L(d,this.condition),this.else&&U(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 U(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=L(super.names,this.from);return L(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 U(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&&U(d,this.catch.names),this.finally&&U(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 U(p,d){for(const x in d)p[x]=(p[x]||0)+(d[x]||0);return p}function L(p,d){return d instanceof t._CodeOrName?U(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 J(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 X(...p){return p.reduce(Q)}e.and=X;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})`}})(nc)),nc}var Ee={},vf;function Me(){if(vf)return Ee;vf=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=Va();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:(i(h,b),!s(b,h.self.RULES.all))}Ee.alwaysValidSchema=n;function i(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=i;function s(h,b){if(typeof h=="boolean")return!h;for(const O in h)if(b[O])return!0;return!1}Ee.schemaHasRules=s;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,U)=>{const L=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 U===e.Name&&!(L instanceof e.Name)?k($,L):L}}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 Fi={},bf;function nn(){if(bf)return Fi;bf=1,Object.defineProperty(Fi,"__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 Fi.default=t,Fi}var _f;function no(){return _f||(_f=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 i(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=i;function s(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=s;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,$])}})(rc)),rc}var Sf;function h1(){if(Sf)return yn;Sf=1,Object.defineProperty(yn,"__esModule",{value:!0}),yn.boolOrEmptySchema=yn.topBoolOrEmptySchema=void 0;const e=no(),t=Oe(),r=nn(),n={message:"boolean schema is false"};function i(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=i;function s(o,c){const{gen:l,schema:u}=o;u===!1?(l.var(c,!1),a(o)):l.var(c,!0)}yn.boolOrEmptySchema=s;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={},wf;function Ym(){if(wf)return gn;wf=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(i){return typeof i=="string"&&t.has(i)}gn.isJSONType=r;function n(){const i={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...i,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},i.number,i.string,i.array,i.object],post:{rules:[]},all:{},keywords:{}}}return gn.getRules=n,gn}var Ar={},Cf;function Xm(){if(Cf)return Ar;Cf=1,Object.defineProperty(Ar,"__esModule",{value:!0}),Ar.shouldUseRule=Ar.shouldUseGroup=Ar.schemaHasRulesForType=void 0;function e({schema:n,self:i},s){const a=i.RULES.types[s];return a&&a!==!0&&t(n,a)}Ar.schemaHasRulesForType=e;function t(n,i){return i.rules.some(s=>r(n,s))}Ar.shouldUseGroup=t;function r(n,i){var s;return n[i.keyword]!==void 0||((s=i.definition.implements)===null||s===void 0?void 0:s.some(a=>n[a]!==void 0))}return Ar.shouldUseRule=r,Ar}var Ef;function za(){if(Ef)return gt;Ef=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=Ym(),t=Xm(),r=no(),n=Oe(),i=Me();var s;(function(f){f[f.Correct=0]="Correct",f[f.Wrong=1]="Wrong"})(s||(gt.DataType=s={}));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,s.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=s.Correct){const b=h===s.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===s.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,i.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,i.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 Ss={},Af;function m1(){if(Af)return Ss;Af=1,Object.defineProperty(Ss,"__esModule",{value:!0}),Ss.assignDefaults=void 0;const e=Oe(),t=Me();function r(i,s){const{properties:a,items:o}=i.schema;if(s==="object"&&a)for(const c in a)n(i,c,a[c].default);else s==="array"&&Array.isArray(o)&&o.forEach((c,l)=>n(i,l,c.default))}Ss.assignDefaults=r;function n(i,s,a){const{gen:o,compositeRule:c,data:l,opts:u}=i;if(a===void 0)return;const m=(0,e._)`${l}${(0,e.getProperty)(s)}`;if(c){(0,t.checkStrictMode)(i,`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 Ss}var Zt={},We={},xf;function ar(){if(xf)return We;xf=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 i(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=i;function s({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=s;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 U=q?(0,e._)`${f}, ${C}, ${h}${b}`:C,L=[[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&&L.push([r.default.dynamicAnchors,r.default.dynamicAnchors]);const B=(0,e._)`${U}, ${P.object(...L)}`;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 U=f.subschema({keyword:h,schemaProp:q,compositeRule:!0},$);C.assign(k,(0,e._)`${k} || ${$}`),f.mergeValidEvaluated(U,$)||C.if((0,e.not)(k))})),f.result(k,()=>f.reset(),()=>f.error(!0))}return We.validateUnion=y,We}var Pf;function p1(){if(Pf)return Zt;Pf=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=no();function i(_,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=i;function s(_,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(_),U(()=>_.error());else{const L=v.async?$():M();v.modifying&&a(_),U(()=>o(_,L))}}function $(){const L=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(L,(0,e._)`${B}.errors`),()=>E.throw(B))),L}function M(){const L=(0,e._)`${b}.errors`;return E.assign(L,null),q(e.nil),L}function q(L=v.async?(0,e._)`await `:e.nil){const B=P.opts.passContext?t.default.this:t.default.self,J=!("compile"in v&&!C||v.schema===!1);E.assign(O,(0,e._)`${L}${(0,r.callValidateCode)(_,b,B,J)}`,v.modifying)}function U(L){var B;E.if((0,e.not)((B=v.valid)!==null&&B!==void 0?B:O),L)}}Zt.funcKeywordCode=s;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={},Of;function y1(){if(Of)return xr;Of=1,Object.defineProperty(xr,"__esModule",{value:!0}),xr.extendSubschemaMode=xr.extendSubschemaData=xr.getSubschema=void 0;const e=Oe(),t=Me();function r(s,{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 _=s.schema[a];return o===void 0?{schema:_,schemaPath:(0,e._)`${s.schemaPath}${(0,e.getProperty)(a)}`,errSchemaPath:`${s.errSchemaPath}/${a}`}:{schema:_[o],schemaPath:(0,e._)`${s.schemaPath}${(0,e.getProperty)(a)}${(0,e.getProperty)(o)}`,errSchemaPath:`${s.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(s,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),s.errorPath=(0,e.str)`${S}${(0,t.getErrorPath)(o,c,g.jsPropertySyntax)}`,s.parentDataProperty=(0,e._)`${o}`,s.dataPathArr=[...E,s.parentDataProperty]}if(l!==void 0){const S=l instanceof e.Name?l:_.let("data",l,!0);v(S),m!==void 0&&(s.propertyName=m)}u&&(s.dataTypes=u);function v(S){s.data=S,s.dataLevel=a.dataLevel+1,s.dataTypes=[],a.definedProperties=new Set,s.parentData=a.data,s.dataNames=[...a.dataNames,S]}}xr.extendSubschemaData=n;function i(s,{jtdDiscriminator:a,jtdMetadata:o,compositeRule:c,createErrors:l,allErrors:u}){c!==void 0&&(s.compositeRule=c),l!==void 0&&(s.createErrors=l),u!==void 0&&(s.allErrors=u),s.jtdDiscriminator=a,s.jtdMetadata=o}return xr.extendSubschemaMode=i,xr}var Ot={},ac={exports:{}},jf;function g1(){if(jf)return ac.exports;jf=1;var e=ac.exports=function(n,i,s){typeof i=="function"&&(s=i,i={}),s=i.cb||s;var a=typeof s=="function"?s:s.pre||function(){},o=s.post||function(){};t(i,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,i,s,a,o,c,l,u,m,_){if(a&&typeof a=="object"&&!Array.isArray(a)){i(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;Eg+=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,U,L)=>{if(L===void 0)return;const B=h+q;let J=P[L];typeof M[y]=="string"&&(J=Y.call(this,M[y])),Q.call(this,M.$anchor),Q.call(this,M.$dynamicAnchor),P[q]=J;function Y(X){const re=this.opts.uriResolver.resolve;if(X=m(J?re(J,X):X),O.has(X))throw $(X);O.add(X);let A=this.refs[X];return typeof A=="string"&&(A=this.refs[A]),typeof A=="object"?k(M,A.schema,X):X!==m(B)&&(X[0]==="#"?(k(M,b[X],X),b[X]=M):this.refs[X]=B),X}function Q(X){if(typeof X=="string"){if(!v.test(X))throw new Error(`invalid anchor "${X}"`);Y.call(this,`#${X}`)}}}),b;function k(M,q,U){if(q!==void 0&&!t(M,q))throw $(U)}function $(M){return new Error(`reference "${M}" resolves to more than one schema`)}}return Ot.getSchemaRefs=S,Ot}var If;function io(){if(If)return Er;If=1,Object.defineProperty(Er,"__esModule",{value:!0}),Er.getData=Er.KeywordCxt=Er.validateFunctionCode=void 0;const e=h1(),t=za(),r=Xm(),n=za(),i=m1(),s=p1(),a=y1(),o=Oe(),c=nn(),l=so(),u=Me(),m=no();function _(N){if(h(N)&&(O(N),P(N))){g(N);return}v(N,()=>(0,e.topBoolOrEmptySchema)(N))}Er.validateFunctionCode=_;function v({gen:N,validateName:D,schema:V,schemaEnv:K,opts:G},W){G.code.es5?N.func(D,(0,o._)`${c.default.data}, ${c.default.valCxt}`,K.$async,()=>{N.code((0,o._)`"use strict"; ${f(V,G)}`),E(N,G),N.code(W)}):N.func(D,(0,o._)`${c.default.data}, ${S(G)}`,K.$async,()=>N.code(f(V,G)).code(W))}function S(N){return(0,o._)`{${c.default.instancePath}="", ${c.default.parentData}, ${c.default.parentDataProperty}, ${c.default.rootData}=${c.default.data}${N.dynamicRef?(0,o._)`, ${c.default.dynamicAnchors}={}`:o.nil}}={}`}function E(N,D){N.if(c.default.valCxt,()=>{N.var(c.default.instancePath,(0,o._)`${c.default.valCxt}.${c.default.instancePath}`),N.var(c.default.parentData,(0,o._)`${c.default.valCxt}.${c.default.parentData}`),N.var(c.default.parentDataProperty,(0,o._)`${c.default.valCxt}.${c.default.parentDataProperty}`),N.var(c.default.rootData,(0,o._)`${c.default.valCxt}.${c.default.rootData}`),D.dynamicRef&&N.var(c.default.dynamicAnchors,(0,o._)`${c.default.valCxt}.${c.default.dynamicAnchors}`)},()=>{N.var(c.default.instancePath,(0,o._)`""`),N.var(c.default.parentData,(0,o._)`undefined`),N.var(c.default.parentDataProperty,(0,o._)`undefined`),N.var(c.default.rootData,c.default.data),D.dynamicRef&&N.var(c.default.dynamicAnchors,(0,o._)`{}`)})}function g(N){const{schema:D,opts:V,gen:K}=N;v(N,()=>{V.$comment&&D.$comment&&L(N),M(N),K.let(c.default.vErrors,null),K.let(c.default.errors,0),V.unevaluated&&y(N),k(N),B(N)})}function y(N){const{gen:D,validateName:V}=N;N.evaluated=D.const("evaluated",(0,o._)`${V}.evaluated`),D.if((0,o._)`${N.evaluated}.dynamicProps`,()=>D.assign((0,o._)`${N.evaluated}.props`,(0,o._)`undefined`)),D.if((0,o._)`${N.evaluated}.dynamicItems`,()=>D.assign((0,o._)`${N.evaluated}.items`,(0,o._)`undefined`))}function f(N,D){const V=typeof N=="object"&&N[D.schemaId];return V&&(D.code.source||D.code.process)?(0,o._)`/*# sourceURL=${V} */`:o.nil}function C(N,D){if(h(N)&&(O(N),P(N))){b(N,D);return}(0,e.boolOrEmptySchema)(N,D)}function P({schema:N,self:D}){if(typeof N=="boolean")return!N;for(const V in N)if(D.RULES.all[V])return!0;return!1}function h(N){return typeof N.schema!="boolean"}function b(N,D){const{schema:V,gen:K,opts:G}=N;G.$comment&&V.$comment&&L(N),q(N),U(N);const W=K.const("_errs",c.default.errors);k(N,W),K.var(D,(0,o._)`${W} === ${c.default.errors}`)}function O(N){(0,u.checkUnknownRules)(N),$(N)}function k(N,D){if(N.opts.jtd)return Y(N,[],!1,D);const V=(0,t.getSchemaTypes)(N.schema),K=(0,t.coerceAndCheckDataType)(N,V);Y(N,V,!K,D)}function $(N){const{schema:D,errSchemaPath:V,opts:K,self:G}=N;D.$ref&&K.ignoreKeywordsWithRef&&(0,u.schemaHasRulesButRef)(D,G.RULES)&&G.logger.warn(`$ref: keywords ignored in schema at path "${V}"`)}function M(N){const{schema:D,opts:V}=N;D.default!==void 0&&V.useDefaults&&V.strictSchema&&(0,u.checkStrictMode)(N,"default is ignored in the schema root")}function q(N){const D=N.schema[N.opts.schemaId];D&&(N.baseId=(0,l.resolveUrl)(N.opts.uriResolver,N.baseId,D))}function U(N){if(N.schema.$async&&!N.schemaEnv.$async)throw new Error("async schema in sync schema")}function L({gen:N,schemaEnv:D,schema:V,errSchemaPath:K,opts:G}){const W=V.$comment;if(G.$comment===!0)N.code((0,o._)`${c.default.self}.logger.log(${W})`);else if(typeof G.$comment=="function"){const te=(0,o.str)`${K}/$comment`,ne=N.scopeValue("root",{ref:D.root});N.code((0,o._)`${c.default.self}.opts.$comment(${W}, ${te}, ${ne}.schema)`)}}function B(N){const{gen:D,schemaEnv:V,validateName:K,ValidationError:G,opts:W}=N;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),W.unevaluated&&J(N),D.return((0,o._)`${c.default.errors} === 0`))}function J({gen:N,evaluated:D,props:V,items:K}){V instanceof o.Name&&N.assign((0,o._)`${D}.props`,V),K instanceof o.Name&&N.assign((0,o._)`${D}.items`,K)}function Y(N,D,V,K){const{gen:G,schema:W,data:te,allErrors:ne,opts:ie,self:ce}=N,{RULES:he}=ce;if(W.$ref&&(ie.ignoreKeywordsWithRef||!(0,u.schemaHasRulesButRef)(W,he))){G.block(()=>T(N,"$ref",he.all.$ref.definition));return}ie.jtd||X(N,D),G.block(()=>{for(const ge of he.rules)le(ge);le(he.post)});function le(ge){(0,r.shouldUseGroup)(W,ge)&&(ge.type?(G.if((0,n.checkDataType)(ge.type,te,ie.strictNumbers)),Q(N,ge),D.length===1&&D[0]===ge.type&&V&&(G.else(),(0,n.reportTypeError)(N)),G.endIf()):Q(N,ge),ne||G.if((0,o._)`${c.default.errors} === ${K||0}`))}}function Q(N,D){const{gen:V,schema:K,opts:{useDefaults:G}}=N;G&&(0,i.assignDefaults)(N,D.type),V.block(()=>{for(const W of D.rules)(0,r.shouldUseRule)(K,W)&&T(N,W.keyword,W.definition,D.type)})}function X(N,D){N.schemaEnv.meta||!N.opts.strictTypes||(re(N,D),N.opts.allowUnionTypes||A(N,D),w(N,N.dataTypes))}function re(N,D){if(D.length){if(!N.dataTypes.length){N.dataTypes=D;return}D.forEach(V=>{p(N.dataTypes,V)||x(N,`type "${V}" not allowed by context "${N.dataTypes.join(",")}"`)}),d(N,D)}}function A(N,D){D.length>1&&!(D.length===2&&D.includes("null"))&&x(N,"use allowUnionTypes to allow union type keyword")}function w(N,D){const V=N.self.RULES.all;for(const K in V){const G=V[K];if(typeof G=="object"&&(0,r.shouldUseRule)(N.schema,G)){const{type:W}=G.definition;W.length&&!W.some(te=>j(D,te))&&x(N,`missing type "${W.join(",")}" for keyword "${K}"`)}}}function j(N,D){return N.includes(D)||D==="number"&&N.includes("integer")}function p(N,D){return N.includes(D)||D==="integer"&&N.includes("number")}function d(N,D){const V=[];for(const K of N.dataTypes)p(D,K)?V.push(K):D.includes("integer")&&K==="number"&&V.push("integer");N.dataTypes=V}function x(N,D){const V=N.schemaEnv.baseId+N.errSchemaPath;D+=` at "${V}" (strictTypes)`,(0,u.checkStrictMode)(N,D,N.opts.strictTypes)}class I{constructor(D,V,K){if((0,s.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,s.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:W,def:te}=this;K.if((0,o.or)((0,o._)`${G} === undefined`,V)),D!==o.nil&&K.assign(D,!0),(W.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:W}=this;return(0,o.or)(te(),ne());function te(){if(K.length){if(!(V instanceof o.Name))throw new Error("ajv implementation error");const ie=Array.isArray(K)?K:[K];return(0,o._)`${(0,n.checkDataTypes)(ie,V,W.opts.strictNumbers,n.DataType.Wrong)}`}return o.nil}function ne(){if(G.validateSchema){const ie=D.scopeValue("validate$data",{ref:G.validateSchema});return(0,o._)`!${ie}(${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(N,D,V,K){const G=new I(N,V,D);"code"in V?V.code(G,K):G.$data&&V.validate?(0,s.funcKeywordCode)(G,V):"macro"in V?(0,s.macroKeywordCode)(G,V):(V.compile||V.validate)&&(0,s.funcKeywordCode)(G,V)}const F=/^\/(?:[^~]|~0|~1)*$/,z=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function H(N,{dataLevel:D,dataNames:V,dataPathArr:K}){let G,W;if(N==="")return c.default.rootData;if(N[0]==="/"){if(!F.test(N))throw new Error(`Invalid JSON-pointer: ${N}`);G=N,W=c.default.rootData}else{const ce=z.exec(N);if(!ce)throw new Error(`Invalid JSON-pointer: ${N}`);const he=+ce[1];if(G=ce[2],G==="#"){if(he>=D)throw new Error(ie("property/index",he));return K[D-he]}if(he>D)throw new Error(ie("data",he));if(W=V[D-he],!G)return W}let te=W;const ne=G.split("/");for(const ce of ne)ce&&(W=(0,o._)`${W}${(0,o.getProperty)((0,u.unescapeJsonPointer)(ce))}`,te=(0,o._)`${te} && ${W}`);return te;function ie(ce,he){return`Cannot access ${ce} ${he} levels up, current level is ${D}`}}return Er.getData=H,Er}var Di={},Nf;function dl(){if(Nf)return Di;Nf=1,Object.defineProperty(Di,"__esModule",{value:!0});class e extends Error{constructor(r){super("validation failed"),this.errors=r,this.ajv=this.validation=!0}}return Di.default=e,Di}var Ti={},Rf;function ao(){if(Rf)return Ti;Rf=1,Object.defineProperty(Ti,"__esModule",{value:!0});const e=so();class t extends Error{constructor(n,i,s,a){super(a||`can't resolve reference ${s} from id ${i}`),this.missingRef=(0,e.resolveUrl)(n,i,s),this.missingSchema=(0,e.normalizeId)((0,e.getFullPath)(n,this.missingRef))}}return Ti.default=t,Ti}var Mt={},$f;function fl(){if($f)return Mt;$f=1,Object.defineProperty(Mt,"__esModule",{value:!0}),Mt.resolveSchema=Mt.getCompilingSchema=Mt.resolveRef=Mt.compileSchema=Mt.SchemaEnv=void 0;const e=Oe(),t=dl(),r=nn(),n=so(),i=Me(),s=io();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,s.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 L=new Function(`${r.default.self}`,`${r.default.scope}`,M)(this,this.scope.get());if(this.scope.value(k,{ref:L}),L.errors=null,L.schema=g.schema,L.schemaEnv=g,g.$async&&(L.$async=!0),this.opts.code.source===!0&&(L.source={validateName:k,validateCode:q,scopeValues:b._values}),this.opts.unevaluated){const{props:B,items:J}=$;L.evaluated={props:B instanceof e.Name?void 0:B,items:J instanceof e.Name?void 0:J,dynamicProps:B instanceof e.Name,dynamicItems:J instanceof e.Name},L.source&&(L.source.evaluated=(0,e.stringify)(L.evaluated))}return g.validate=L,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,i.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,i.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 v1="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",b1="Meta-schema for $data reference (JSON AnySchema extension proposal)",_1="object",S1=["$data"],w1={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},C1=!1,E1={$id:v1,description:b1,type:_1,required:S1,properties:w1,additionalProperties:C1};var Mi={},ws={exports:{}},oc,Ff;function Zm(){if(Ff)return oc;Ff=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),i=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),s=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=48&&j<=57||j>=65&&j<=70||j>=97&&j<=102))return"";w+=A[p];break}for(p+=1;p=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;wj&&(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=8)return;const I=d.slice(0,j.length);for(let T=x;T<8;T++)I.push("0");for(let T=j.length;Th[p])}function $(A,w=!1){if(A.indexOf("%")===-1)return A;let j="";for(let p=0;p57343)w+=l(d);else if(d<=56319&&j+1=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;d57343)j+=l(I);else if(I<=56319&&d+1=56320&&T<=57343?(j+=l(65536+(I-55296<<10)+(T-56320)),d++):j+=l(65533)}else j+=l(65533)}}return j}function U(A,w){let j="";for(let p=0;p57343)j+=l(x);else if(x<=56319&&p+1=56320&&I<=57343?(j+=l(65536+(x-55296<<10)+(I-56320)),p++):j+=l(65533)}else j+=l(65533)}}return j}function L(A){return U(A,o)}function B(A){return U(A,a)}function J(A){return U(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;j57343)w+=l(d);else if(d<=56319&&j+1=56320&&x<=57343?(w+=l(65536+(d-55296<<10)+(x-56320)),j++):w+=l(65533)}else w+=l(65533)}}return w}function X(A){let w="";for(let j=0;j65535))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 U(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 L(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 N=A.match(O);N!==null&&N[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 W=unescape(p.scheme);S.test(W)?p.scheme=W.toLowerCase():(p.error=p.error||E,z=!0)}x=U(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,ie=e(p.host);H=ie.isIPV6||ie.isIPVFuture===!0,F=ne&&(!te||ie.error===!0),p.host=H?ie.host:ie.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=L(p,j,G,H)),!G||G&&!G.skipNormalize){if(A.indexOf("%")!==-1&&p.host!==void 0&&!F){const W=H?p.host:n(p.host,!0);p.host=l(W,H)}p.path&&(p.path=i(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 J(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 X(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:J};return ws.exports=re,ws.exports.default=re,ws.exports.fastUri=re,ws.exports}var Mf;function P1(){if(Mf)return Mi;Mf=1,Object.defineProperty(Mi,"__esModule",{value:!0});const e=x1();return e.code='require("ajv/dist/runtime/uri").default',Mi.default=e,Mi}var qf;function O1(){return qf||(qf=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=io();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=dl(),i=ao(),s=Ym(),a=fl(),o=Oe(),c=so(),l=za(),u=Me(),m=E1,_=P1(),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,N,D,V,K,G,W,te,ne,ie,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,dt=(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=(N=A.strictTuples)!==null&&N!==void 0?N: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:dt}:{optimize:oe,regExp:dt},loopRequired:(G=A.loopRequired)!==null&&G!==void 0?G:f,loopEnum:(W=A.loopEnum)!==null&&W!==void 0?W:f,meta:(te=A.meta)!==null&&te!==void 0?te:!0,messages:(ne=A.messages)!==null&&ne!==void 0?ne:!0,inlineRefs:(ie=A.inlineRefs)!==null&&ie!==void 0?ie:!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=U(w.logger);const d=w.validateFormats;w.validateFormats=!1,this.RULES=(0,s.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,N){await x.call(this,H.$schema);const D=this._addSchema(H,N);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(N){if(!(N instanceof i.default))throw N;return T.call(this,N),await F.call(this,N.missingSchema),I.call(this,H)}}function T({missingSchema:H,missingRef:N}){if(this.refs[H])throw new Error(`AnySchema ${H} is loaded but ${N} cannot be resolved`)}async function F(H){const N=await z.call(this,H);this.refs[H]||await x.call(this,N.$schema),this.refs[H]||this.addSchema(N,H,j)}async function z(H){const N=this._loading[H];if(N)return N;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=>J.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=>J.call(this,x,d):x=>d.type.forEach(I=>J.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=i.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 U(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 L=/^[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(!L.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 J(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 X={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function re(A){return{anyOf:[A,X]}}})(tc)),tc}var qi={},Ui={},Li={},Uf;function j1(){if(Uf)return Li;Uf=1,Object.defineProperty(Li,"__esModule",{value:!0});const e={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};return Li.default=e,Li}var Mr={},Lf;function k1(){if(Lf)return Mr;Lf=1,Object.defineProperty(Mr,"__esModule",{value:!0}),Mr.callRef=Mr.getValidate=void 0;const e=ao(),t=ar(),r=Oe(),n=nn(),i=fl(),s=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=i.resolveRef.call(y,f,v,m);if(C===void 0)throw new e.default(_.opts.uriResolver,v,m);if(C instanceof i.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=s.mergeEvaluated.props(v,$.props,S.props));else{const M=v.var("props",(0,r._)`${O}.evaluated.props`);S.props=s.mergeEvaluated.props(v,M,S.props,r.Name)}if(S.items!==!0)if($&&!$.dynamicItems)$.items!==void 0&&(S.items=s.mergeEvaluated.items(v,$.items,S.items));else{const M=v.var("items",(0,r._)`${O}.evaluated.items`);S.items=s.mergeEvaluated.items(v,M,S.items,r.Name)}}}return Mr.callRef=c,Mr.default=a,Mr}var Vf;function I1(){if(Vf)return Ui;Vf=1,Object.defineProperty(Ui,"__esModule",{value:!0});const e=j1(),t=k1(),r=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",e.default,t.default];return Ui.default=r,Ui}var Vi={},zi={},zf;function N1(){if(zf)return zi;zf=1,Object.defineProperty(zi,"__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:s,schemaCode:a})=>(0,e.str)`must be ${r[s].okStr} ${a}`,params:({keyword:s,schemaCode:a})=>(0,e._)`{comparison: ${r[s].okStr}, limit: ${a}}`},i={keyword:Object.keys(r),type:"number",schemaType:"number",$data:!0,error:n,code(s){const{keyword:a,data:o,schemaCode:c}=s;s.fail$data((0,e._)`${o} ${r[a].fail} ${c} || isNaN(${o})`)}};return zi.default=i,zi}var Bi={},Bf;function R1(){if(Bf)return Bi;Bf=1,Object.defineProperty(Bi,"__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:i,data:s,schemaCode:a,it:o}=n,c=o.opts.multipleOfPrecision,l=i.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} = ${s}/${a}, ${u}))`)}};return Bi.default=r,Bi}var Hi={},Ki={},Hf;function $1(){if(Hf)return Ki;Hf=1,Object.defineProperty(Ki,"__esModule",{value:!0});function e(t){const r=t.length;let n=0,i=0,s;for(;i=55296&&s<=56319&&i(0,e._)`{limit: ${s}}`},code(s){const{keyword:a,data:o,schemaCode:c,it:l}=s,u=a==="maxLength"?e.operators.GT:e.operators.LT,m=l.opts.unicode===!1?(0,e._)`${o}.length`:(0,e._)`${(0,t.useFunc)(s.gen,r.default)}(${o})`;s.fail$data((0,e._)`${m} ${u} ${c}`)}};return Hi.default=i,Hi}var Gi={},Gf;function D1(){if(Gf)return Gi;Gf=1,Object.defineProperty(Gi,"__esModule",{value:!0});const e=ar(),t=Me(),r=Oe(),i={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:s})=>(0,r.str)`must match pattern "${s}"`,params:({schemaCode:s})=>(0,r._)`{pattern: ${s}}`},code(s){const{gen:a,data:o,$data:c,schema:l,schemaCode:u,it:m}=s,_=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)),s.fail$data((0,r._)`!${E}`)}else{const v=(0,e.usePattern)(s,l);s.fail$data((0,r._)`!${v}.test(${o})`)}}};return Gi.default=i,Gi}var Wi={},Wf;function T1(){if(Wf)return Wi;Wf=1,Object.defineProperty(Wi,"__esModule",{value:!0});const e=Oe(),r={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:n,schemaCode:i}){const s=n==="maxProperties"?"more":"fewer";return(0,e.str)`must NOT have ${s} than ${i} properties`},params:({schemaCode:n})=>(0,e._)`{limit: ${n}}`},code(n){const{keyword:i,data:s,schemaCode:a}=n,o=i==="maxProperties"?e.operators.GT:e.operators.LT;n.fail$data((0,e._)`Object.keys(${s}).length ${o} ${a}`)}};return Wi.default=r,Wi}var Ji={},Jf;function M1(){if(Jf)return Ji;Jf=1,Object.defineProperty(Ji,"__esModule",{value:!0});const e=ar(),t=Oe(),r=Me(),i={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:s}})=>(0,t.str)`must have required property '${s}'`,params:({params:{missingProperty:s}})=>(0,t._)`{missingProperty: ${s}}`},code(s){const{gen:a,schema:o,schemaCode:c,data:l,$data:u,it:m}=s,{opts:_}=m;if(!u&&o.length===0)return;const v=o.length>=_.loopRequired;if(m.allErrors?S():E(),_.strictRequired){const f=s.parentSchema.properties,{definedProperties:C}=s.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)s.block$data(t.nil,g);else for(const f of o)(0,e.checkReportMissingProp)(s,f)}function E(){const f=a.let("missing");if(v||u){const C=a.let("valid",!0);s.block$data(C,()=>y(f,C)),s.ok(C)}else a.if((0,e.checkMissingProp)(s,o,f)),(0,e.reportMissingProp)(s,f),a.else()}function g(){a.forOf("prop",c,f=>{s.setParams({missingProperty:f}),a.if((0,e.noPropertyInData)(a,l,f,_.ownProperties),()=>s.error())})}function y(f,C){s.setParams({missingProperty:f}),a.forOf(f,c,()=>{a.assign(C,(0,e.propertyInData)(a,l,f,_.ownProperties)),a.if((0,t.not)(C),()=>{s.error(),a.break()})},t.nil)}}};return Ji.default=i,Ji}var Yi={},Yf;function q1(){if(Yf)return Yi;Yf=1,Object.defineProperty(Yi,"__esModule",{value:!0});const e=Oe(),r={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:n,schemaCode:i}){const s=n==="maxItems"?"more":"fewer";return(0,e.str)`must NOT have ${s} than ${i} items`},params:({schemaCode:n})=>(0,e._)`{limit: ${n}}`},code(n){const{keyword:i,data:s,schemaCode:a}=n,o=i==="maxItems"?e.operators.GT:e.operators.LT;n.fail$data((0,e._)`${s}.length ${o} ${a}`)}};return Yi.default=r,Yi}var Xi={},Zi={},Xf;function hl(){if(Xf)return Zi;Xf=1,Object.defineProperty(Zi,"__esModule",{value:!0});const e=Qa();return e.code='require("ajv/dist/runtime/equal").default',Zi.default=e,Zi}var Zf;function U1(){if(Zf)return Xi;Zf=1,Object.defineProperty(Xi,"__esModule",{value:!0});const e=za(),t=Oe(),r=Me(),n=hl(),s={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 Xi.default=s,Xi}var Qi={},Qf;function L1(){if(Qf)return Qi;Qf=1,Object.defineProperty(Qi,"__esModule",{value:!0});const e=Oe(),t=Me(),r=hl(),i={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:s})=>(0,e._)`{allowedValue: ${s}}`},code(s){const{gen:a,data:o,$data:c,schemaCode:l,schema:u}=s;c||u&&typeof u=="object"?s.fail$data((0,e._)`!${(0,t.useFunc)(a,r.default)}(${o}, ${l})`):s.fail((0,e._)`${u} !== ${o}`)}};return Qi.default=i,Qi}var ea={},eh;function V1(){if(eh)return ea;eh=1,Object.defineProperty(ea,"__esModule",{value:!0});const e=Oe(),t=Me(),r=hl(),i={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:s})=>(0,e._)`{allowedValues: ${s}}`},code(s){const{gen:a,data:o,$data:c,schema:l,schemaCode:u,it:m}=s;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"),s.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)))}s.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 ea.default=i,ea}var th;function z1(){if(th)return Vi;th=1,Object.defineProperty(Vi,"__esModule",{value:!0});const e=N1(),t=R1(),r=F1(),n=D1(),i=T1(),s=M1(),a=q1(),o=U1(),c=L1(),l=V1(),u=[e.default,t.default,r.default,n.default,i.default,s.default,a.default,o.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},c.default,l.default];return Vi.default=u,Vi}var ta={},Bn={},rh;function Qm(){if(rh)return Bn;rh=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:s}})=>(0,e.str)`must NOT have more than ${s} items`,params:({params:{len:s}})=>(0,e._)`{limit: ${s}}`},code(s){const{parentSchema:a,it:o}=s,{items:c}=a;if(!Array.isArray(c)){(0,t.checkStrictMode)(o,'"additionalItems" is ignored when "items" is not an array of schemas');return}i(s,c)}};function i(s,a){const{gen:o,schema:c,data:l,keyword:u,it:m}=s;m.items=!0;const _=o.const("len",(0,e._)`${l}.length`);if(c===!1)s.setParams({len:a.length}),s.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)),s.ok(S)}function v(S){o.forRange("i",a.length,_,E=>{s.subschema({keyword:u,dataProp:E,dataPropType:t.Type.Num},S),m.allErrors||o.if((0,e.not)(S),()=>o.break())})}}return Bn.validateAdditionalItems=i,Bn.default=n,Bn}var ra={},Hn={},nh;function ep(){if(nh)return Hn;nh=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(s){const{schema:a,it:o}=s;if(Array.isArray(a))return i(s,"additionalItems",a);o.items=!0,!(0,t.alwaysValidSchema)(o,a)&&s.ok((0,r.validateArray)(s))}};function i(s,a,o=s.schema){const{gen:c,parentSchema:l,data:u,keyword:m,it:_}=s;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}`,()=>s.subschema({keyword:m,schemaProp:y,dataProp:y},v)),s.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=i,Hn.default=n,Hn}var sh;function B1(){if(sh)return ra;sh=1,Object.defineProperty(ra,"__esModule",{value:!0});const e=ep(),t={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:r=>(0,e.validateTuple)(r,"items")};return ra.default=t,ra}var na={},ih;function H1(){if(ih)return na;ih=1,Object.defineProperty(na,"__esModule",{value:!0});const e=Oe(),t=Me(),r=ar(),n=Qm(),s={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 na.default=s,na}var sa={},ah;function K1(){if(ah)return sa;ah=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:i,max:s}})=>s===void 0?(0,e.str)`must contain at least ${i} valid item(s)`:(0,e.str)`must contain at least ${i} and no more than ${s} valid item(s)`,params:({params:{min:i,max:s}})=>s===void 0?(0,e._)`{minContains: ${i}}`:(0,e._)`{minContains: ${i}, maxContains: ${s}}`},code(i){const{gen:s,schema:a,parentSchema:o,data:c,it:l}=i;let u,m;const{minContains:_,maxContains:v}=o;l.opts.next?(u=_===void 0?1:_,m=v):u=1;const S=s.const("len",(0,e._)`${c}.length`);if(i.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'),i.fail();return}if((0,t.alwaysValidSchema)(l,a)){let C=(0,e._)`${S} >= ${u}`;m!==void 0&&(C=(0,e._)`${C} && ${S} <= ${m}`),i.pass(C);return}l.items=!0;const E=s.name("valid");m===void 0&&u===1?y(E,()=>s.if(E,()=>s.break())):u===0?(s.let(E,!0),m!==void 0&&s.if((0,e._)`${c}.length > 0`,g)):(s.let(E,!1),g()),i.result(E,()=>i.reset());function g(){const C=s.name("_valid"),P=s.let("count",0);y(C,()=>s.if(C,()=>f(P)))}function y(C,P){s.forRange("i",0,S,h=>{i.subschema({keyword:"contains",dataProp:h,dataPropType:t.Type.Num,compositeRule:!0},C),P()})}function f(C){s.code((0,e._)`${C}++`),m===void 0?s.if((0,e._)`${C} >= ${u}`,()=>s.assign(E,!0).break()):(s.if((0,e._)`${C} > ${m}`,()=>s.assign(E,!1).break()),u===1?s.assign(E,!0):s.if((0,e._)`${C} >= ${u}`,()=>s.assign(E,!0)))}}};return sa.default=n,sa}var lc={},oh;function G1(){return oh||(oh=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 i={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(c){const[l,u]=s(c);a(c,l),o(c,u)}};function s({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=i})(lc)),lc}var ia={},ch;function W1(){if(ch)return ia;ch=1,Object.defineProperty(ia,"__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:i})=>(0,e._)`{propertyName: ${i.propertyName}}`},code(i){const{gen:s,schema:a,data:o,it:c}=i;if((0,t.alwaysValidSchema)(c,a))return;const l=s.name("valid");s.forIn("key",o,u=>{i.setParams({propertyName:u}),i.subschema({keyword:"propertyNames",data:u,dataTypes:["string"],propertyName:u,compositeRule:!0},l),s.if((0,e.not)(l),()=>{i.error(!0),c.allErrors||s.break()})}),i.ok(l)}};return ia.default=n,ia}var aa={},lh;function tp(){if(lh)return aa;lh=1,Object.defineProperty(aa,"__esModule",{value:!0});const e=ar(),t=Oe(),r=nn(),n=Me(),s={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 aa.default=s,aa}var oa={},uh;function J1(){if(uh)return oa;uh=1,Object.defineProperty(oa,"__esModule",{value:!0});const e=io(),t=ar(),r=Me(),n=tp(),i={keyword:"properties",type:"object",schemaType:"object",code(s){const{gen:a,schema:o,parentSchema:c,data:l,it:u}=s;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()),s.it.definedProperties.add(g),s.ok(v);function S(g){return u.opts.useDefaults&&!u.compositeRule&&o[g].default!==void 0}function E(g){s.subschema({keyword:"properties",schemaProp:g,dataProp:g},v)}}};return oa.default=i,oa}var ca={},dh;function Y1(){if(dh)return ca;dh=1,Object.defineProperty(ca,"__esModule",{value:!0});const e=ar(),t=Oe(),r=Me(),n=Me(),i={keyword:"patternProperties",type:"object",schemaType:"object",code(s){const{gen:a,schema:o,data:c,parentSchema:l,it:u}=s,{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)(s,P)}.test(${h})`,()=>{const b=v.includes(P);b||s.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 ca.default=i,ca}var la={},fh;function X1(){if(fh)return la;fh=1,Object.defineProperty(la,"__esModule",{value:!0});const e=Me(),t={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(r){const{gen:n,schema:i,it:s}=r;if((0,e.alwaysValidSchema)(s,i)){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 la.default=t,la}var ua={},hh;function Z1(){if(hh)return ua;hh=1,Object.defineProperty(ua,"__esModule",{value:!0});const t={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:ar().validateUnion,error:{message:"must match a schema in anyOf"}};return ua.default=t,ua}var da={},mh;function Q1(){if(mh)return da;mh=1,Object.defineProperty(da,"__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:i})=>(0,e._)`{passingSchemas: ${i.passing}}`},code(i){const{gen:s,schema:a,parentSchema:o,it:c}=i;if(!Array.isArray(a))throw new Error("ajv implementation error");if(c.opts.discriminator&&o.discriminator)return;const l=a,u=s.let("valid",!1),m=s.let("passing",null),_=s.name("_valid");i.setParams({passing:m}),s.block(v),i.result(u,()=>i.reset(),()=>i.error(!0));function v(){l.forEach((S,E)=>{let g;(0,t.alwaysValidSchema)(c,S)?s.var(_,!0):g=i.subschema({keyword:"oneOf",schemaProp:E,compositeRule:!0},_),E>0&&s.if((0,e._)`${_} && ${u}`).assign(u,!1).assign(m,(0,e._)`[${m}, ${E}]`).else(),s.if(_,()=>{s.assign(u,!0),s.assign(m,E),g&&i.mergeEvaluated(g,e.Name)})})}}};return da.default=n,da}var fa={},ph;function ew(){if(ph)return fa;ph=1,Object.defineProperty(fa,"__esModule",{value:!0});const e=Me(),t={keyword:"allOf",schemaType:"array",code(r){const{gen:n,schema:i,it:s}=r;if(!Array.isArray(i))throw new Error("ajv implementation error");const a=n.name("valid");i.forEach((o,c)=>{if((0,e.alwaysValidSchema)(s,o))return;const l=r.subschema({keyword:"allOf",schemaProp:c},a);r.ok(a),r.mergeEvaluated(l)})}};return fa.default=t,fa}var ha={},yh;function tw(){if(yh)return ha;yh=1,Object.defineProperty(ha,"__esModule",{value:!0});const e=Oe(),t=Me(),n={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:s})=>(0,e.str)`must match "${s.ifClause}" schema`,params:({params:s})=>(0,e._)`{failingKeyword: ${s.ifClause}}`},code(s){const{gen:a,parentSchema:o,it:c}=s;o.then===void 0&&o.else===void 0&&(0,t.checkStrictMode)(c,'"if" without "then" and "else" is ignored');const l=i(c,"then"),u=i(c,"else");if(!l&&!u)return;const m=a.let("valid",!0),_=a.name("_valid");if(v(),s.reset(),l&&u){const E=a.let("ifClause");s.setParams({ifClause:E}),a.if(_,S("then",E),S("else",E))}else l?a.if(_,S("then")):a.if((0,e.not)(_),S("else"));s.pass(m,()=>s.error(!0));function v(){const E=s.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},_);s.mergeEvaluated(E)}function S(E,g){return()=>{const y=s.subschema({keyword:E},_);a.assign(m,_),s.mergeValidEvaluated(y,m),g?a.assign(g,(0,e._)`${E}`):s.setParams({ifClause:E})}}}};function i(s,a){const o=s.schema[a];return o!==void 0&&!(0,t.alwaysValidSchema)(s,o)}return ha.default=n,ha}var ma={},gh;function rw(){if(gh)return ma;gh=1,Object.defineProperty(ma,"__esModule",{value:!0});const e=Me(),t={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:r,parentSchema:n,it:i}){n.if===void 0&&(0,e.checkStrictMode)(i,`"${r}" without "if" is ignored`)}};return ma.default=t,ma}var vh;function nw(){if(vh)return ta;vh=1,Object.defineProperty(ta,"__esModule",{value:!0});const e=Qm(),t=B1(),r=ep(),n=H1(),i=K1(),s=G1(),a=W1(),o=tp(),c=J1(),l=Y1(),u=X1(),m=Z1(),_=Q1(),v=ew(),S=tw(),E=rw();function g(y=!1){const f=[u.default,m.default,_.default,v.default,S.default,E.default,a.default,o.default,s.default,c.default,l.default];return y?f.push(t.default,n.default):f.push(e.default,r.default),f.push(i.default),f}return ta.default=g,ta}var pa={},ya={},bh;function sw(){if(bh)return ya;bh=1,Object.defineProperty(ya,"__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,i){const{gen:s,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=s.scopeValue("formats",{ref:S.formats,code:m.code.formats}),f=s.const("fDef",(0,e._)`${y}[${l}]`),C=s.let("fType"),P=s.let("format");s.if((0,e._)`typeof ${f} == "object" && !(${f} instanceof RegExp)`,()=>s.assign(C,(0,e._)`${f}.type || "string"`).assign(P,(0,e._)`${f}.validate`),()=>s.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} === ${i} && !${k}`}}function g(){const y=S.formats[c];if(!y){h();return}if(y===!0)return;const[f,C,P]=b(y);f===i&&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=s.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 ya.default=r,ya}var _h;function iw(){if(_h)return pa;_h=1,Object.defineProperty(pa,"__esModule",{value:!0});const t=[sw().default];return pa.default=t,pa}var vn={},Sh;function aw(){return Sh||(Sh=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 wh;function ow(){if(wh)return qi;wh=1,Object.defineProperty(qi,"__esModule",{value:!0});const e=I1(),t=z1(),r=nw(),n=iw(),i=aw(),s=[e.default,t.default,(0,r.default)(),n.default,i.metadataVocabulary,i.contentVocabulary];return qi.default=s,qi}var ga={},Cs={},Ch;function cw(){if(Ch)return Cs;Ch=1,Object.defineProperty(Cs,"__esModule",{value:!0}),Cs.DiscrError=void 0;var e;return(function(t){t.Tag="tag",t.Mapping="mapping"})(e||(Cs.DiscrError=e={})),Cs}var Eh;function lw(){if(Eh)return ga;Eh=1,Object.defineProperty(ga,"__esModule",{value:!0});const e=Oe(),t=cw(),r=fl(),n=ao(),i=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;qthis.addVocabulary(S)),this.opts.discriminator&&this.addKeyword(i.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const S=this.opts.$data?this.$dataMetaSchema(s,a):s;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=io();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=dl();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return m.default}});var _=ao();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return _.default}})})($i,$i.exports)),$i.exports}var xh;function vw(){return xh||(xh=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;const t=gw(),r=Oe(),n=r.operators,i={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}},s={message:({keyword:o,schemaCode:c})=>r.str`should be ${i[o].okStr} ${c}`,params:({keyword:o,schemaCode:c})=>r._`{comparison: ${i[o].okStr}, limit: ${c}}`};e.formatLimitDefinition={keyword:Object.keys(i),type:"string",schemaType:"string",$data:!0,error:s,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}) ${i[m].fail} 0`}},dependencies:["format"]};const a=o=>(o.addKeyword(e.formatLimitDefinition),o);e.default=a})(ec)),ec}var Ph;function bw(){return Ph||(Ph=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=f1(),n=vw(),i=Oe(),s=new i.Name("fullFormats"),a=new i.Name("fastFormats"),o=(l,u={keywords:!0})=>{if(Array.isArray(u))return c(l,u,r.fullFormats,s),l;const[m,_]=u.mode==="fast"?[r.fastFormats,a]:[r.fullFormats,s],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=i._`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})(Ri,Ri.exports)),Ri.exports}var _w=bw();const Oh=$s(_w),Sw={allErrors:!0,multipleOfPrecision:8,strict:!1,verbose:!0,discriminator:!1},ww=/^(#?([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*\)))$/,Cw=/^data:([a-z]+\/[a-z0-9-+.]+)?;(?:name=(.*);)?base64,(.*)$/;function Ew(e,t,r={},n,i=d1,s){let a=new i({...Sw,...r});return n?Oh(a,n):n!==!1&&Oh(a),a.addFormat("data-url",Cw),a.addFormat("color",ww),a.addKeyword(Vc),Array.isArray(e)&&a.addMetaSchema(e),ue(t)&&Object.keys(t).forEach(o=>{a.addFormat(o,t[o])}),s&&(a=s(a)),a}class Aw{ajv;localizer;suppressDuplicateFiltering;lastSeenRootSchema;hasRegisteredRootSchema=!1;constructor(t,r){const{additionalMetaSchemas:n,customFormats:i,ajvOptionsOverrides:s,ajvFormatOptions:a,AjvClass:o,extenderFn:c,suppressDuplicateFiltering:l}=t;this.ajv=Ew(n,i,s,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,i;try{t[Ue]&&(i=this.ajv.getSchema(t[Ue])),i===void 0&&(i=this.ajv.compile(t)),i(r)}catch(a){n=a,i===void 0&&this.ajv.removeSchema(t[Ue]!==void 0?t[Ue]:t)}let s;return i&&(typeof this.localizer=="function"&&((i.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(i.errors),(i.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(", "))})),s=i.errors||void 0,i.errors=null),{errors:s,validationError:n}}validateFormData(t,r,n,i,s){const a=this.rawValidation(r,t);return sS(this,a,t,r,n,i,s,this.suppressDuplicateFiltering)}handleSchemaUpdate(t){if(this.lastSeenRootSchema===t&&this.hasRegisteredRootSchema)return;const r=t[Ue]??Mh;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 i,s=!1;try{this.handleSchemaUpdate(n);const a=tl(t);i=a[Ue]??m0(a);let o;return o=this.ajv.getSchema(i),o===void 0&&(o=this.ajv.addSchema(a,i).getSchema(i)||this.ajv.compile(a)),s=!0,o(r)}catch(a){return console.warn("Error encountered compiling schema:",a),!s&&i!==void 0&&this.ajv.removeSchema(i),!1}}}function xw(e={},t){return new Aw(e,t)}const Pw=xw();function rp(e,t=""){return!e||typeof e!="object"?{}:e.writeOnly===!0?{"ui:widget":"SecretWidget","ui:options":{secretPath:t}}:e.type!=="object"||!e.properties?{}:Object.fromEntries(Object.entries(e.properties).map(([r,n])=>[r,rp(n,t?`${t}.${r}`:r)]))}function Ow({id:e,disabled:t,readonly:r,options:n,registry:i}){const s=n.secretPath,a=i.formContext||{},o=a.secretOperations?.[s],c=!!a.configuredSecrets?.[s],l=o?.action==="replace",u=o?.action==="clear",m=t||r;function _(v){m||a.setSecretOperation?.(s,v)}return R.jsxs("div",{className:"surface space-y-0.5 p-0.5",children:[R.jsxs("div",{className:"flex flex-wrap items-center gap-0.5",children:[R.jsx("span",{className:"text-[0.7rem] text-slate-500",children:u?"Will be cleared when saved":l?"Replacement pending":c?"Configured":"Not configured"}),R.jsxs("div",{className:"flex gap-0.5",children:[R.jsx("button",{type:"button",className:"button-dark text-xs",disabled:m,onClick:()=>_(l?null:{action:"replace",value:""}),children:l?"Cancel replace":"Replace"}),R.jsx("button",{type:"button",className:u?"button-dark text-xs":"button-danger text-xs",disabled:m,onClick:()=>_(u?null:{action:"clear"}),children:u?"Undo clear":"Clear"})]})]}),l?R.jsx("input",{id:e,className:"field-input w-full",type:"password",autoComplete:"new-password",value:o.value,placeholder:"Enter replacement value",disabled:m,onChange:v=>_({action:"replace",value:v.target.value})}):null]})}function jw({children:e,classNames:t,description:r,displayLabel:n,errors:i,help:s,hidden:a,id:o,label:c,required:l,schema:u,style:m}){return a?R.jsx("div",{className:"hidden",children:e}):u?.type==="object"||u?.type==="array"?R.jsxs("div",{className:t,style:m,children:[e,i,s]}):R.jsxs("div",{className:`${t||""} configuration-field surface p-1`,style:m,children:[n?R.jsxs("label",{htmlFor:o,className:"block text-xs font-semibold text-slate-100",children:[c,l?R.jsx("span",{className:"ml-0.25 text-sky-300",children:"*"}):null]}):null,n&&r?R.jsx("div",{className:"mt-0.25",children:r}):null,R.jsx("div",{className:n?"mt-0.5":"",children:e}),i,s]})}function kw({description:e,fieldPathId:t,properties:r,title:n}){const i=r.filter(a=>!a.hidden),s=R.jsx("div",{className:"configuration-property-grid grid gap-0.5 md:grid-cols-2 xl:grid-cols-3",children:i.map(a=>a.content)});return t.path.length===0?R.jsx("div",{className:"space-y-1",children:i.map(a=>a.content)}):typeof t.path.at(-1)=="number"?s:t.path.length===1?R.jsxs(mt,{title:n,clipOverflow:!1,bodyClassName:"space-y-0.5 p-0.5",children:[e?R.jsx("div",{className:"px-0.5 text-xs text-slate-400",children:e}):null,s]}):R.jsxs("section",{className:"configuration-object surface border border-neutral-500/60 p-0.5",children:[R.jsx("h3",{className:"mb-0.5 text-sm font-semibold text-slate-100",children:n}),e?R.jsx("div",{className:"mb-0.5 text-xs text-slate-400",children:e}):null,s]})}function Iw({buttonsProps:e,children:t,hasToolbar:r,index:n}){const i=e.disabled||e.readonly;return R.jsxs("article",{className:"surface-muted space-y-0.5 border border-neutral-500/60 p-0.5",children:[r?R.jsxs("header",{className:"flex flex-wrap items-center gap-0.5",children:[R.jsxs("span",{className:"mr-0.5 text-xs font-semibold text-slate-100",children:["Item ",n+1]}),e.hasMoveUp||e.hasMoveDown?R.jsx("button",{type:"button",className:"button-dark text-xs",disabled:i||!e.hasMoveUp,onClick:e.onMoveUpItem,children:"Move up"}):null,e.hasMoveUp||e.hasMoveDown?R.jsx("button",{type:"button",className:"button-dark text-xs",disabled:i||!e.hasMoveDown,onClick:e.onMoveDownItem,children:"Move down"}):null,e.hasCopy?R.jsx("button",{type:"button",className:"button-dark text-xs",disabled:i,onClick:e.onCopyItem,children:"Duplicate"}):null,e.hasRemove?R.jsx("button",{type:"button",className:"button-danger text-xs",disabled:i,onClick:e.onRemoveItem,children:"Remove"}):null]}):null,t]})}function Nw({canAdd:e,disabled:t,items:r,onAddClick:n,readonly:i,schema:s,title:a}){return R.jsxs("section",{className:"configuration-array surface space-y-0.5 border border-neutral-500/60 p-0.5",children:[R.jsxs("header",{className:"flex flex-wrap items-center gap-0.5",children:[R.jsx("h3",{className:"text-sm font-semibold text-slate-100",children:a}),R.jsxs("span",{className:"text-[0.7rem] text-slate-400",children:[r.length," ",r.length===1?"item":"items"]})]}),s.description?R.jsx("div",{className:"text-xs text-slate-400",children:s.description}):null,r.length?R.jsx("div",{className:"space-y-0.5",children:r}):R.jsx("p",{className:"text-xs text-slate-500",children:"No items configured."}),e?R.jsx("button",{type:"button",className:"button-dark text-xs",disabled:t||i,onClick:n,children:"Add item"}):null]})}function Rw({schema:e,value:t,onChange:r,configuredSecrets:n,secretOperations:i,setSecretOperation:s}){const a=Z.useMemo(()=>rp(e),[e]),o=Z.useMemo(()=>({SecretWidget:Ow}),[]),c=Z.useMemo(()=>({ArrayFieldItemTemplate:Iw,ArrayFieldTemplate:Nw,FieldTemplate:jw,ObjectFieldTemplate:kw}),[]),l=Z.useMemo(()=>({configuredSecrets:n,secretOperations:i,setSecretOperation:s}),[n,i,s]);return R.jsx("div",{className:"configuration-schema-form",children:R.jsx(Vr,{schema:e,uiSchema:a,formData:t,validator:Pw,widgets:o,templates:c,formContext:l,noHtml5Validate:!0,showErrorList:!1,onChange:({formData:u})=>r(u),children:R.jsx(R.Fragment,{})})})}function uc(e){return JSON.parse(JSON.stringify(e))}function $w({snapshot:e,socket:t,runSensitive:r,onSnapshot:n,onReload:i}){const s=e?.configuration?.config,a=e?.configuration?.schema,o=e?.configuration?.revision,[c,l]=Z.useState(()=>uc(s)),[u,m]=Z.useState({}),[_,v]=Z.useState(!1),[S,E]=Z.useState(""),[g,y]=Z.useState([]);Z.useEffect(()=>{l(uc(s)),m({}),E(""),y([])},[o,s]);const f=Z.useMemo(()=>JSON.stringify(c)!==JSON.stringify(s)||Object.keys(u).length>0,[c,u,s]);if(!s||!a)return R.jsx("p",{className:"surface p-1 text-sm text-red-200",children:"The configuration document is unavailable."});const C=(h,b)=>m(O=>{const k={...O};return b?k[h]=b:delete k[h],k});async function P(){v(!0),E(""),y([]);try{const h=await r(()=>Lp(t,{value:c,expectedRevision:o,secretOperations:u}));n(h.snapshot)}catch(h){E(h.message),y(h.validationErrors||[])}finally{v(!1)}}return R.jsxs("div",{className:"space-y-0.5",children:[R.jsxs(mt,{className:"sticky top-0 z-20 bg-neutral-900/95 backdrop-blur",title:"Configuration",meta:`revision ${o}`,bodyClassName:"space-y-0.5 p-0.5",children:[R.jsx("p",{className:"text-[0.7rem] text-slate-400",children:"Saved changes apply after an application restart."}),R.jsxs("div",{className:"flex flex-wrap gap-0.5",children:[R.jsx("button",{type:"button",className:"button-dark",disabled:_,onClick:i,children:"Reload"}),R.jsx("button",{type:"button",className:"button-dark",disabled:!f||_,onClick:()=>{l(uc(s)),m({})},children:"Reset"}),R.jsx("button",{type:"button",className:"button-dark",disabled:!f||_,onClick:P,children:_?"Saving…":"Save configuration"})]})]}),S?R.jsx("p",{className:"border border-red-500/60 bg-red-950/40 p-1 text-xs text-red-100",children:S}):null,g.length?R.jsxs("div",{className:"border border-red-500/60 bg-red-950/40 p-1 text-xs text-red-100",children:[R.jsx("p",{className:"font-semibold",children:"Configuration could not be saved"}),R.jsx("ul",{className:"mt-0.5 list-disc space-y-0.25 pl-4",children:g.map((h,b)=>R.jsxs("li",{children:[h.path,": ",h.message]},`${h.path}-${b}`))})]}):null,R.jsx(Rw,{schema:a,value:c,onChange:l,configuredSecrets:e.configuration.configuredSecrets,secretOperations:u,setSecretOperation:C})]})}function Fw({open:e,busy:t,error:r,onCancel:n,onConfirm:i}){const[s,a]=Z.useState("");if(!e)return null;async function o(l){l.preventDefault(),await i(s),a("")}function c(){a(""),n()}return R.jsx("div",{className:"fixed inset-0 z-[1000] flex items-center justify-center bg-black/75 p-2",children:R.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:[R.jsx("h2",{className:"text-base font-semibold",children:"Confirm password"}),R.jsx("p",{className:"mt-0.5 text-xs text-slate-400",children:"This sensitive action requires recent confirmation of your administrator password."}),R.jsx("input",{autoFocus:!0,autoComplete:"current-password",className:"field-input mt-1 w-full",type:"password",value:s,onChange:l=>a(l.target.value)}),r?R.jsx("p",{className:"mt-0.5 text-xs text-red-300",children:r}):null,R.jsxs("div",{className:"mt-1 flex justify-end gap-0.5",children:[R.jsx("button",{type:"button",className:"button-dark",disabled:t,onClick:c,children:"Cancel"}),R.jsx("button",{type:"submit",className:"button-dark",disabled:t||!s,children:t?"Confirming…":"Confirm"})]})]})})}const Dw=[{key:"overview",label:"Overview"},{key:"fleet",label:"Fleet operations"},{key:"users",label:"Users and administrators",lockdownOnly:!0},{key:"configuration",label:"Configuration",lockdownOnly:!0}];function qw(){jp({identitySurface:"passive"});const e=jh(),t=Ol(L=>L.session?.role||"user"),r=Ol(L=>L.connected),[n,i]=kp(),s=n.get("section")||"overview",[a,o]=Z.useState(null),[c,l]=Z.useState(""),u=Z.useRef(null),[m,_]=Z.useState(!1),[v,S]=Z.useState(!1),[E,g]=Z.useState(""),{value:y}=Ip("page",{backgroundTheme:Np}),f=Rp(y?.backgroundTheme),C=t==="admin"||t==="lockdown",P=t==="lockdown",h=Z.useCallback(async()=>{if(!P){o(null);return}l("");try{o(await Vp(e))}catch(L){l(L.message)}},[P,e]);Z.useEffect(()=>{h()},[h,r]);const b=Z.useCallback(async L=>{try{return await L()}catch(B){if(B.code!=="PASSWORD_CONFIRMATION_REQUIRED")throw B;return new Promise((J,Y)=>{u.current={operation:L,resolve:J,reject:Y},g(""),_(!0)})}},[]);async function O(L){S(!0),g("");try{await zp(e,L);const B=u.current;if(u.current=null,_(!1),B)try{B.resolve(await B.operation())}catch(J){B.reject(J)}}catch(B){g(B.message)}finally{S(!1)}}function k(){const L=u.current;u.current=null,_(!1),L&&L.reject(new Error("Sensitive action cancelled."))}function $(L){i(L==="overview"?{}:{section:L})}const M=Dw.filter(L=>!L.lockdownOnly||P),q=M.some(L=>L.key===s)?s:"overview";let U;return C?q==="fleet"?U=R.jsx(Dp,{}):P?a?q==="users"?U=R.jsxs("div",{className:"space-y-0.5",children:[R.jsx(my,{administrators:a.administrators,socket:e,runSensitive:b,onSnapshot:o}),R.jsx(fy,{})]}):q==="configuration"?U=R.jsx($w,{snapshot:a,socket:e,runSensitive:b,onSnapshot:o,onReload:h}):U=R.jsx(py,{snapshot:a,socket:e,runSensitive:b,onSnapshot:o}):U=R.jsx(mt,{title:"Loading administration",bodyClassName:"p-1 text-sm text-slate-300",children:R.jsx("p",{children:c||"Loading configuration and audit state…"})}):U=R.jsx(mt,{title:"Administrator access",bodyClassName:"p-1 text-sm text-slate-300",children:R.jsx("p",{children:"Routine fleet operations are available. Configuration, users, secrets, and system administration require a lockdown administrator."})}):U=R.jsx("div",{className:"mx-auto w-full max-w-md",children:R.jsx(Fp,{})}),R.jsxs("div",{className:`${f} min-h-screen text-slate-100`,children:[R.jsx($p,{}),R.jsx(Fw,{open:m,busy:v,error:E,onCancel:k,onConfirm:O}),R.jsxs("main",{className:"mx-auto min-h-screen w-full max-w-[100rem] p-1",children:[R.jsx(mt,{title:"MultiRover administration",meta:r?t:"offline",bodyClassName:"p-0.5 text-xs text-slate-400",children:R.jsx("p",{children:a?`Active configuration revision ${a.configuration.revision}.${a.restartRequired?" An application restart is required to apply saved changes.":" The running application has loaded this revision."}`:"Central server administration and configuration."})}),C?R.jsxs(kh,{currentTab:q,onTabChange:$,children:[R.jsx("nav",{"aria-label":"Administration sections",children:R.jsx(Ih,{className:"my-0.5",children:M.map(L=>R.jsx(Kn,{id:L.key,children:L.label},L.key))})}),R.jsx(Nh,{children:R.jsx("section",{className:"min-w-0",children:U})})]}):R.jsx("section",{className:"mt-0.5 min-w-0",children:U})]})]})}export{qw as default}; //# sourceMappingURL=AdminApp-CEwd2_4C.js.map