@decocms/mesh 2.24.0 → 2.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-CV_2Ske6.js → AlertCircle-Boj76jQH.js} +1 -1
- package/dist/client/assets/{ArrowLeft-BahOAMyC.js → ArrowLeft-BTICYmOF.js} +1 -1
- package/dist/client/assets/{ArrowUp-D7M3SswO.js → ArrowUp-HjoDlZqE.js} +1 -1
- package/dist/client/assets/{Check-Cl1DPN8W.js → Check-CTW7R50X.js} +1 -1
- package/dist/client/assets/{ChevronDown-QptcKPPq.js → ChevronDown-HeHHvdAJ.js} +1 -1
- package/dist/client/assets/{Code01-CSoaiT62.js → Code01-vxLA-aYr.js} +1 -1
- package/dist/client/assets/{Copy01-DsZYv9_9.js → Copy01-lNTIiCNm.js} +1 -1
- package/dist/client/assets/{DotsHorizontal-Aoyfmqeo.js → DotsHorizontal-BNX6_V13.js} +1 -1
- package/dist/client/assets/{DotsVertical-DqzXFrVL.js → DotsVertical-De3HfSYp.js} +1 -1
- package/dist/client/assets/{Download01-DWGjnFFr.js → Download01-DxmKLd6b.js} +1 -1
- package/dist/client/assets/{Edit01-BfNte4_5.js → Edit01-2gMw94kx.js} +1 -1
- package/dist/client/assets/{File06-MyNxuf_W.js → File06-DZffLvEY.js} +1 -1
- package/dist/client/assets/{FilterLines-D3Q31BkI.js → FilterLines-CRPPV9uJ.js} +1 -1
- package/dist/client/assets/{FlipBackward-vsVFh-C6.js → FlipBackward-BxNU9_QP.js} +1 -1
- package/dist/client/assets/{GitBranch01-BqcP5DIB.js → GitBranch01-lDIVlGo4.js} +1 -1
- package/dist/client/assets/{Grid01-yvEs5TWW.js → Grid01-DPl7Hdtr.js} +1 -1
- package/dist/client/assets/{Home02-DjFn6K-r.js → Home02-DBWacsCD.js} +1 -1
- package/dist/client/assets/{Image01-CYYkJQ3k.js → Image01-GhNrLN_o.js} +1 -1
- package/dist/client/assets/{Inbox01-BhCAhDsN.js → Inbox01-Bz1paVJY.js} +1 -1
- package/dist/client/assets/{InfoCircle-D-tECwtz.js → InfoCircle-BbYzxP40.js} +1 -1
- package/dist/client/assets/{Key01-Yka-P-CN.js → Key01-CVOksW38.js} +1 -1
- package/dist/client/assets/{LinkExternal01-DgUNNdya.js → LinkExternal01-C6sS8-Dh.js} +1 -1
- package/dist/client/assets/{List-BwQLP7Xm.js → List-Cd5FrKez.js} +1 -1
- package/dist/client/assets/{Loading01-BEWxFOsJ.js → Loading01-CE1tPVnH.js} +1 -1
- package/dist/client/assets/{Lock01-BhAPWcE3.js → Lock01-BMAl_X3b.js} +1 -1
- package/dist/client/assets/{Play-CekdqE6r.js → Play-DRtw-ZLY.js} +1 -1
- package/dist/client/assets/{Plus-CnFAGbmk.js → Plus-DS0QMjNS.js} +1 -1
- package/dist/client/assets/{SearchMd-fJfE7iLY.js → SearchMd-DwZ1Uewr.js} +1 -1
- package/dist/client/assets/{Terminal-ejweaysv.js → Terminal-BGn35Hrh.js} +1 -1
- package/dist/client/assets/{Trash01-uhyK-8nB.js → Trash01-BspHke6m.js} +1 -1
- package/dist/client/assets/{Upload01-BsNcOyJi.js → Upload01-Be9A57c7.js} +1 -1
- package/dist/client/assets/{X-CxYkZpBQ.js → X-A9y1T0lz.js} +1 -1
- package/dist/client/assets/{XClose-Y6oe-mwV.js → XClose-CI6rgB8F.js} +1 -1
- package/dist/client/assets/{agent-detail-BwHpiO3s.js → agent-detail-D-HdWQgm.js} +1 -1
- package/dist/client/assets/{agents-BHGOj2hY.js → agents-BW9FgFlJ.js} +1 -1
- package/dist/client/assets/{alert-dialog-t9YTjfeS.js → alert-dialog-l6IBCD_g.js} +1 -1
- package/dist/client/assets/{auth-catchall-BeIbwmpd.js → auth-catchall-EiefGJkC.js} +1 -1
- package/dist/client/assets/{avatar-63HLGHa6.js → avatar-C1-OS7tz.js} +1 -1
- package/dist/client/assets/{badge-H3tu3alI.js → badge-BDT5rriT.js} +1 -1
- package/dist/client/assets/{binder-h-DAIqZk.js → binder-4aB10nPM.js} +1 -1
- package/dist/client/assets/{button-BY0U_trB.js → button-DgJewvnk.js} +1 -1
- package/dist/client/assets/{card-BgqGJlKn.js → card-VbBkGSHG.js} +1 -1
- package/dist/client/assets/{checkbox-B49kYNJ-.js → checkbox-BT-kiYse.js} +1 -1
- package/dist/client/assets/{collection-detail-BEvt6SJv.js → collection-detail-DulG-46F.js} +1 -1
- package/dist/client/assets/{collection-display-button-CKAn8RZK.js → collection-display-button-CPWNBzZz.js} +1 -1
- package/dist/client/assets/{collection-header-BCxNcaP0.js → collection-header-Dh-TC0ET.js} +1 -1
- package/dist/client/assets/{collection-page-4ehGOEaI.js → collection-page-CtMspF20.js} +1 -1
- package/dist/client/assets/{collection-search-DtIPt7nm.js → collection-search-L_JghakB.js} +1 -1
- package/dist/client/assets/{collection-tab-DaIWakkn.js → collection-tab-B12-V7lv.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-BajIguAD.js → collection-table-wrapper-DYV0KLLC.js} +1 -1
- package/dist/client/assets/{connection-B9wsQJ4x.js → connection-Byxo_DeQ.js} +1 -1
- package/dist/client/assets/{connection-card-kOCwfSqa.js → connection-card-B0OuYrZZ.js} +1 -1
- package/dist/client/assets/{connection-detail-CeIMKRLP.js → connection-detail-CSWioyLQ.js} +1 -1
- package/dist/client/assets/{connections-CoWwPPSP.js → connections-CS3LHfU3.js} +1 -1
- package/dist/client/assets/constants-B5fsCpvW.js +1 -0
- package/dist/client/assets/{create-organization-dialog-CO6Jpf4A.js → create-organization-dialog-CHy0EWEL.js} +1 -1
- package/dist/client/assets/{dialog-iJAwIjfK.js → dialog-D4Z11dI6.js} +1 -1
- package/dist/client/assets/{dropdown-menu-DG1GIIwU.js → dropdown-menu-N-z7LuJ5.js} +1 -1
- package/dist/client/assets/{dynamic-plugin-layout-DGRod1Lg.js → dynamic-plugin-layout-Cr1oWoCB.js} +1 -1
- package/dist/client/assets/{empty-state-CgGQoUxw.js → empty-state-6P2NW0kn.js} +1 -1
- package/dist/client/assets/{empty-state-BTtikpWV.js → empty-state-BEQc84s3.js} +1 -1
- package/dist/client/assets/{env-vars-editor-5qNLK4j_.js → env-vars-editor-DWqHCY6l.js} +1 -1
- package/dist/client/assets/{error-boundary-Wp2wTq0T.js → error-boundary-BT3Mebg5.js} +1 -1
- package/dist/client/assets/{extract-connection-data-BvlzvR4m.js → extract-connection-data-D1x0qOyh.js} +1 -1
- package/dist/client/assets/{file-browser-DwREbCtv.js → file-browser-BA4Fit03.js} +2 -2
- package/dist/client/assets/{form-C12U5i4A.js → form-MQmvJnlF.js} +1 -1
- package/dist/client/assets/{grid-view-Dy0_lFLB.js → grid-view-Bmsbo8El.js} +1 -1
- package/dist/client/assets/{home-CTE_1w5Z.js → home-Do3AvDKR.js} +1 -1
- package/dist/client/assets/{index-C7jbdfWM.js → index-BIRWa1W2.js} +1 -1
- package/dist/client/assets/{index-xvNq1s6k.js → index-C9OplJzd.js} +1 -1
- package/dist/client/assets/index-CRKvJygs.js +25 -0
- package/dist/client/assets/{index-C62W55Yo.js → index-CgBWAlIR.js} +1 -1
- package/dist/client/assets/{index-BF36lrM0.js → index-D_yiV8TC.js} +2 -2
- package/dist/client/assets/index-Dvb3XANN.css +1 -0
- package/dist/client/assets/{infiniteQueryObserver-Cqhltp2W.js → infiniteQueryObserver-BQE0oyQO.js} +1 -1
- package/dist/client/assets/{input-CpdDHW2j.js → input-CsfP4B4p.js} +1 -1
- package/dist/client/assets/{layout-BLmqRDQz.js → layout-BfSbLiA5.js} +1 -1
- package/dist/client/assets/{localstorage-keys-DrYwgV-b.js → localstorage-keys-DsHtX4Jw.js} +1 -1
- package/dist/client/assets/{login-BleXV37s.js → login-Cjxw0cFa.js} +1 -1
- package/dist/client/assets/{mcp-oauth-CMNXgXw9.js → mcp-oauth-Dvs3O_Op.js} +1 -1
- package/dist/client/assets/{mcp-server-card-CLD0MlHi.js → mcp-server-card-6ibrMQ8U.js} +1 -1
- package/dist/client/assets/{mcp-server-detail-C8nn-cjk.js → mcp-server-detail-BA0KnCSI.js} +1 -1
- package/dist/client/assets/{members-BJsU2IDJ.js → members-BVTRo-7X.js} +1 -1
- package/dist/client/assets/{monaco-editor-CqsxwMR1.js → monaco-editor-D8njkMiZ.js} +1 -1
- package/dist/client/assets/{monitoring-DI2F2-gW.js → monitoring-DFlGViEd.js} +1 -1
- package/dist/client/assets/{oauth-callback-BG19emHo.js → oauth-callback-BUnnsAFp.js} +1 -1
- package/dist/client/assets/{page-Dt-xJ0t7.js → page-Clo7Ovdx.js} +1 -1
- package/dist/client/assets/{page-D3Fotx0f.js → page-D1PLSsqR.js} +1 -1
- package/dist/client/assets/{pin-to-sidebar-button-D-6-fLPf.js → pin-to-sidebar-button-CxaNNClv.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-BvctpTEE.js → plugin-empty-state-iPofL9QM.js} +1 -1
- package/dist/client/assets/{plugin-header-D41UNBLt.js → plugin-header-B9k1OsMP.js} +1 -1
- package/dist/client/assets/{plugins-C8gEzMs6.js → plugins-Cj5hb3FX.js} +1 -1
- package/dist/client/assets/{popover-BeoKBBM1.js → popover-9EmjWmbB.js} +1 -1
- package/dist/client/assets/{project-context-provider-DzsB7M-_.js → project-context-provider-DKV25A4C.js} +1 -1
- package/dist/client/assets/{registry-utils-Bvv1buXq.js → registry-utils-CjLSWVEm.js} +1 -1
- package/dist/client/assets/{resizable-_8uWIPP-.js → resizable-JjtuHF73.js} +1 -1
- package/dist/client/assets/{resource-tabs-BLyBe1s2.js → resource-tabs-D_iZqwk7.js} +1 -1
- package/dist/client/assets/{select-BIz3vvEQ.js → select-DjeJmILl.js} +1 -1
- package/dist/client/assets/{settings-lkeLq0lX.js → settings-CUQYUdNO.js} +1 -1
- package/dist/client/assets/{shell-layout-DlLuXMY5.js → shell-layout-5dQxdh2B.js} +1 -1
- package/dist/client/assets/{spinner-CTVrJwKL.js → spinner-C7W5-5hg.js} +1 -1
- package/dist/client/assets/{switch-Dy4gwRqa.js → switch-DDjZhTdN.js} +1 -1
- package/dist/client/assets/{textarea-t5B3OM9P.js → textarea-CXN3Js-4.js} +1 -1
- package/dist/client/assets/{tool-set-selector-ByauUXgY.js → tool-set-selector-CVBBVhTA.js} +1 -1
- package/dist/client/assets/{tools-list-BeACAG3i.js → tools-list-BueW_H_K.js} +1 -1
- package/dist/client/assets/{tooltip-BK_1J9C_.js → tooltip-Cl3M2P7a.js} +1 -1
- package/dist/client/assets/{typewriter-title-Cg14Kxt7.js → typewriter-title-CPJFZpo0.js} +1 -1
- package/dist/client/assets/{use-binding-Dye-n-yU.js → use-binding-CauWbFwn.js} +1 -1
- package/dist/client/assets/{use-collections-Ckty0ghF.js → use-collections-DIzFS7Fj.js} +1 -1
- package/dist/client/assets/{use-connection-DhKqHtbu.js → use-connection-BWMRs4Bt.js} +1 -1
- package/dist/client/assets/{use-connection-resources-AvDNzmBV.js → use-connection-resources-DlxiG1--.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-CRFUmT7b.js → use-create-virtual-mcp-DL4zGzFl.js} +1 -1
- package/dist/client/assets/{use-list-state-TtAnvO_b.js → use-list-state-BfjO2CO2.js} +1 -1
- package/dist/client/assets/{use-mcp-CpX9yUli.js → use-mcp-lSZX114m.js} +1 -1
- package/dist/client/assets/{use-members-TfLkqobx.js → use-members-CXyjrj2s.js} +1 -1
- package/dist/client/assets/{use-mobile-hytGZ4u1.js → use-mobile-BYMqewSV.js} +1 -1
- package/dist/client/assets/{use-organization-settings-1IcqHHyX.js → use-organization-settings-B1efjG2L.js} +1 -1
- package/dist/client/assets/{use-tool-call-BL77c1ZY.js → use-tool-call-CmGXFIVD.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-DkhKq3Hu.js → use-virtual-mcp-CcuyRJmi.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-system-prompt-_ZIF4JTa.js → use-virtual-mcp-system-prompt-CUyXD7ZM.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-Czf6Kd3z.js +1 -0
- package/dist/client/assets/{useMutation-CwqnnhnA.js → useMutation-rgwX4wnS.js} +1 -1
- package/dist/client/assets/useQuery-CrubtpmP.js +1 -0
- package/dist/client/assets/{value-DHIwgTGn.js → value-BLmCvXPB.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-iqfK1oLC.js → view-mode-toggle-wGzGYu8G.js} +1 -1
- package/dist/client/assets/{workflow-Dx5p2iNU.js → workflow-D4k0joOp.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/cli.js +167 -161
- package/dist/server/server.js +163 -157
- package/package.json +1 -1
- package/dist/client/assets/constants-CQNxHBLU.js +0 -1
- package/dist/client/assets/index-BOoYPbIt.css +0 -1
- package/dist/client/assets/index-CezFL9px.js +0 -25
- package/dist/client/assets/useInfiniteQuery-V_LiOKxm.js +0 -1
- package/dist/client/assets/useQuery-Dx7rylpD.js +0 -1
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import{V as Fc,c as xe,K as fi,v as Pc,j as c,f as Go,M as Ec,at as us,u as Ic,a as Dc,t as wt,X as mi,au as $c,r as P,av as kc,aw as Ho,ax as Mc,ay as Rc,Y as Bc,i as Yo,h as hi,l as Uc,az as Lc,aA as Wc,aB as Vc,aa as zc,a5 as qc,ar as Kc,a8 as Ut,a6 as Nn,a3 as Yt,a4 as Gc,aC as Hc,aD as Yc,y as Xo,J as Xc,I as ds,z as Ae,_ as Jc,aE as Zc,x as Qc,k as eu,E as tu,B as nu}from"./index-D_yiV8TC.js";import{i as ru,a as iu}from"./mcp-oauth-Dvs3O_Op.js";import{c as pi}from"./connection-Byxo_DeQ.js";import{E as su,i as ou,r as au,e as Jo}from"./env-vars-editor-DWqHCY6l.js";import{I as lu,n as cu,E as uu}from"./empty-state-6P2NW0kn.js";import{E as du}from"./error-boundary-BT3Mebg5.js";import{u as gi,a as Zo}from"./use-connection-BWMRs4Bt.js";import{u as Qo,b as ea}from"./use-binding-CauWbFwn.js";import{u as fu}from"./use-tool-call-CmGXFIVD.js";import{P as mu}from"./pin-to-sidebar-button-CxaNNClv.js";import{B as Ot,c as hu}from"./button-DgJewvnk.js";import{I as Qe}from"./input-CsfP4B4p.js";import{F as ke,a as pu,b as Me,d as Re,f as Be,c as st,e as xr,L as gu}from"./form-MQmvJnlF.js";import{i as Kr,e as yu}from"./extract-connection-data-D1x0qOyh.js";import{a as xu}from"./Copy01-lNTIiCNm.js";import{i as bu}from"./File06-DZffLvEY.js";import{i as vu}from"./Key01-CVOksW38.js";import{i as yn}from"./Loading01-CE1tPVnH.js";import{V as Su}from"./layout-BfSbLiA5.js";import{u as yi}from"./project-context-provider-DKV25A4C.js";import{B as fs}from"./badge-BDT5rriT.js";import{S as ta,a as na,b as ra,c as ia,d as Rt,e as sa}from"./select-DjeJmILl.js";import{s as br,f as oa,e as wu}from"./registry-utils-CjLSWVEm.js";import{i as ju}from"./Terminal-BGn35Hrh.js";import{u as Ou,a as Au,i as aa}from"./use-virtual-mcp-CcuyRJmi.js";import{i as Cu}from"./Grid01-DPl7Hdtr.js";import{s as la}from"./Plus-DS0QMjNS.js";import{u as _u,R as Nu,I as Tu,a as Fu}from"./index-CgBWAlIR.js";import{M as Pu}from"./constants-B5fsCpvW.js";import{R as ms,_ as Nt}from"./index-BIRWa1W2.js";import{V as Eu,M as Iu}from"./index-C9OplJzd.js";function Du(t,e){return _u({...t,queries:t.queries.map(n=>({...n,suspense:!0,throwOnError:Fc,enabled:!0,placeholderData:void 0}))},e)}function zw(t){const e=xe.c(9),{connectionId:n}=t;let r,i,s;e[0]!==n?(r=new URL(`/mcp/${n}`,window.location.origin),s=Pc,i=fi.isMCPAuthenticated(r.href,null),e[0]=n,e[1]=r,e[2]=i,e[3]=s):(r=e[1],i=e[2],s=e[3]);let o;e[4]!==r?(o=()=>ru({url:r.href,token:null}),e[4]=r,e[5]=o):o=e[5];let a;e[6]!==i||e[7]!==o?(a={queryKey:i,queryFn:o},e[6]=i,e[7]=o,e[8]=a):a=e[8];const{data:l}=s(a);return l}const Bn=43200,hs=1440,ps=Symbol.for("constructDateFrom");function xi(t,e){return typeof t=="function"?t(e):t&&typeof t=="object"&&ps in t?t[ps](e):t instanceof Date?new t.constructor(e):new Date(e)}function ht(t,e){return xi(t,t)}let $u={};function ku(){return $u}function gs(t){const e=ht(t),n=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return n.setUTCFullYear(e.getFullYear()),+t-+n}function bi(t,...e){const n=xi.bind(null,t||e.find(r=>typeof r=="object"));return e.map(n)}function zn(t,e){const n=+ht(t)-+ht(e);return n<0?-1:n>0?1:n}function Mu(t){return xi(t,Date.now())}function Ru(t,e,n){const[r,i]=bi(n?.in,t,e),s=r.getFullYear()-i.getFullYear(),o=r.getMonth()-i.getMonth();return s*12+o}function Bu(t){return e=>{const r=(t?Math[t]:Math.trunc)(e);return r===0?0:r}}function Uu(t,e){return+ht(t)-+ht(e)}function Lu(t,e){const n=ht(t);return n.setHours(23,59,59,999),n}function Wu(t,e){const n=ht(t),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function Vu(t,e){const n=ht(t);return+Lu(n)==+Wu(n)}function zu(t,e,n){const[r,i,s]=bi(n?.in,t,t,e),o=zn(i,s),a=Math.abs(Ru(i,s));if(a<1)return 0;i.getMonth()===1&&i.getDate()>27&&i.setDate(30),i.setMonth(i.getMonth()-o*a);let l=zn(i,s)===-o;Vu(r)&&a===1&&zn(r,s)===1&&(l=!1);const d=o*(a-+l);return d===0?0:d}function qu(t,e,n){const r=Uu(t,e)/1e3;return Bu(n?.roundingMethod)(r)}const Ku={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Gu=(t,e,n)=>{let r;const i=Ku[t];return typeof i=="string"?r=i:e===1?r=i.one:r=i.other.replace("{{count}}",e.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function vr(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const Hu={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Yu={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Xu={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Ju={date:vr({formats:Hu,defaultWidth:"full"}),time:vr({formats:Yu,defaultWidth:"full"}),dateTime:vr({formats:Xu,defaultWidth:"full"})},Zu={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Qu=(t,e,n,r)=>Zu[t];function rn(t){return(e,n)=>{const r=n?.context?String(n.context):"standalone";let i;if(r==="formatting"&&t.formattingValues){const o=t.defaultFormattingWidth||t.defaultWidth,a=n?.width?String(n.width):o;i=t.formattingValues[a]||t.formattingValues[o]}else{const o=t.defaultWidth,a=n?.width?String(n.width):t.defaultWidth;i=t.values[a]||t.values[o]}const s=t.argumentCallback?t.argumentCallback(e):e;return i[s]}}const ed={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},td={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},nd={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},rd={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},id={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},sd={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},od=(t,e)=>{const n=Number(t),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},ad={ordinalNumber:od,era:rn({values:ed,defaultWidth:"wide"}),quarter:rn({values:td,defaultWidth:"wide",argumentCallback:t=>t-1}),month:rn({values:nd,defaultWidth:"wide"}),day:rn({values:rd,defaultWidth:"wide"}),dayPeriod:rn({values:id,defaultWidth:"wide",formattingValues:sd,defaultFormattingWidth:"wide"})};function sn(t){return(e,n={})=>{const r=n.width,i=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],s=e.match(i);if(!s)return null;const o=s[0],a=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],l=Array.isArray(a)?cd(a,u=>u.test(o)):ld(a,u=>u.test(o));let d;d=t.valueCallback?t.valueCallback(l):l,d=n.valueCallback?n.valueCallback(d):d;const f=e.slice(o.length);return{value:d,rest:f}}}function ld(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function cd(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return n}function ud(t){return(e,n={})=>{const r=e.match(t.matchPattern);if(!r)return null;const i=r[0],s=e.match(t.parsePattern);if(!s)return null;let o=t.valueCallback?t.valueCallback(s[0]):s[0];o=n.valueCallback?n.valueCallback(o):o;const a=e.slice(i.length);return{value:o,rest:a}}}const dd=/^(\d+)(th|st|nd|rd)?/i,fd=/\d+/i,md={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},hd={any:[/^b/i,/^(a|c)/i]},pd={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},gd={any:[/1/i,/2/i,/3/i,/4/i]},yd={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},xd={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},bd={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},vd={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Sd={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},wd={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},jd={ordinalNumber:ud({matchPattern:dd,parsePattern:fd,valueCallback:t=>parseInt(t,10)}),era:sn({matchPatterns:md,defaultMatchWidth:"wide",parsePatterns:hd,defaultParseWidth:"any"}),quarter:sn({matchPatterns:pd,defaultMatchWidth:"wide",parsePatterns:gd,defaultParseWidth:"any",valueCallback:t=>t+1}),month:sn({matchPatterns:yd,defaultMatchWidth:"wide",parsePatterns:xd,defaultParseWidth:"any"}),day:sn({matchPatterns:bd,defaultMatchWidth:"wide",parsePatterns:vd,defaultParseWidth:"any"}),dayPeriod:sn({matchPatterns:Sd,defaultMatchWidth:"any",parsePatterns:wd,defaultParseWidth:"any"})},Od={code:"en-US",formatDistance:Gu,formatLong:Ju,formatRelative:Qu,localize:ad,match:jd,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Ad(t,e,n){const r=ku(),i=n?.locale??r.locale??Od,s=2520,o=zn(t,e);if(isNaN(o))throw new RangeError("Invalid time value");const a=Object.assign({},n,{addSuffix:n?.addSuffix,comparison:o}),[l,d]=bi(n?.in,...o>0?[e,t]:[t,e]),f=qu(d,l),u=(gs(d)-gs(l))/1e3,h=Math.round((f-u)/60);let g;if(h<2)return n?.includeSeconds?f<5?i.formatDistance("lessThanXSeconds",5,a):f<10?i.formatDistance("lessThanXSeconds",10,a):f<20?i.formatDistance("lessThanXSeconds",20,a):f<40?i.formatDistance("halfAMinute",0,a):f<60?i.formatDistance("lessThanXMinutes",1,a):i.formatDistance("xMinutes",1,a):h===0?i.formatDistance("lessThanXMinutes",1,a):i.formatDistance("xMinutes",h,a);if(h<45)return i.formatDistance("xMinutes",h,a);if(h<90)return i.formatDistance("aboutXHours",1,a);if(h<hs){const m=Math.round(h/60);return i.formatDistance("aboutXHours",m,a)}else{if(h<s)return i.formatDistance("xDays",1,a);if(h<Bn){const m=Math.round(h/hs);return i.formatDistance("xDays",m,a)}else if(h<Bn*2)return g=Math.round(h/Bn),i.formatDistance("aboutXMonths",g,a)}if(g=zu(d,l),g<12){const m=Math.round(h/Bn);return i.formatDistance("xMonths",m,a)}else{const m=g%12,p=Math.trunc(g/12);return m<3?i.formatDistance("aboutXYears",p,a):m<9?i.formatDistance("overXYears",p,a):i.formatDistance("almostXYears",p+1,a)}}function Cd(t,e){return Ad(t,Mu(t),e)}function _d(t){const e=xe.c(13),{virtualMcp:n,org:r}=t;let i;e[0]!==r||e[1]!==n.id?(i={org:r,agentId:n.id},e[0]=r,e[1]=n.id,e[2]=i):i=e[2];let s;e[3]!==n.icon||e[4]!==n.title?(s=n.icon?c.jsx("img",{src:n.icon,alt:n.title,className:"w-8 h-8 rounded-md object-cover shrink-0"}):c.jsx("div",{className:"w-8 h-8 rounded-md bg-primary/10 flex items-center justify-center shrink-0",children:c.jsx(aa,{size:16,className:"text-primary"})}),e[3]=n.icon,e[4]=n.title,e[5]=s):s=e[5];let o;e[6]!==n.title?(o=c.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:n.title}),e[6]=n.title,e[7]=o):o=e[7];let a;e[8]===Symbol.for("react.memo_cache_sentinel")?(a=c.jsx(Cu,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[8]=a):a=e[8];let l;return e[9]!==i||e[10]!==s||e[11]!==o?(l=c.jsxs(Ec,{to:"/$org/agents/$agentId",params:i,className:"flex items-center gap-3 p-3 rounded-lg border border-border hover:bg-muted/50 transition-colors group",children:[s,o,a]}),e[9]=i,e[10]=s,e[11]=o,e[12]=l):l=e[12],l}function ys(t){const e=xe.c(20),{connectionId:n,connectionTitle:r,connectionDescription:i,connectionIcon:s,org:o,hasExistingVirtualMcps:a}=t,l=Go(),d=Au();let f;e[0]!==d.create||e[1]!==i||e[2]!==s||e[3]!==n||e[4]!==r||e[5]!==l||e[6]!==o?(f=async()=>{const m=await d.create.mutateAsync({title:`${r} Agent`,description:i??null,icon:s??null,status:"active",tool_selection_mode:"inclusion",connections:[{connection_id:n,selected_tools:null,selected_resources:null,selected_prompts:null}]});l({to:"/$org/agents/$agentId",params:{org:o,agentId:m.id}})},e[0]=d.create,e[1]=i,e[2]=s,e[3]=n,e[4]=r,e[5]=l,e[6]=o,e[7]=f):f=e[7];const u=f;if(a){let m;e[8]!==d.create.isPending?(m=d.create.isPending?c.jsx(yn,{size:16,className:"animate-spin"}):c.jsx(la,{size:16}),e[8]=d.create.isPending,e[9]=m):m=e[9];let p;return e[10]!==d.create.isPending||e[11]!==u||e[12]!==m?(p=c.jsxs(Ot,{variant:"outline",size:"sm",className:"gap-1.5",onClick:u,disabled:d.create.isPending,children:[m,"Create another Agent"]}),e[10]=d.create.isPending,e[11]=u,e[12]=m,e[13]=p):p=e[13],p}let h;e[14]!==d.create.isPending?(h=d.create.isPending?c.jsx(yn,{size:20,className:"animate-spin"}):c.jsx(aa,{size:20}),e[14]=d.create.isPending,e[15]=h):h=e[15];let g;return e[16]!==d.create.isPending||e[17]!==u||e[18]!==h?(g=c.jsxs(Ot,{size:"lg",className:"gap-2 w-full",onClick:u,disabled:d.create.isPending,children:[h,"Create an agent"]}),e[16]=d.create.isPending,e[17]=u,e[18]=h,e[19]=g):g=e[19],g}function Nd(t){const e=xe.c(26),{connectionId:n,connectionTitle:r,connectionDescription:i,connectionIcon:s,org:o}=t;let a;e[0]!==n?(a={filters:[{column:"connection_id",value:n}]},e[0]=n,e[1]=a):a=e[1];const l=Ou(a);if(!(l.length>0)){let p;e[2]===Symbol.for("react.memo_cache_sentinel")?(p=c.jsxs("div",{className:"flex flex-col gap-1",children:[c.jsx("h4",{className:"text-sm font-medium text-foreground",children:"Use in your IDE"}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"Expose this connection via an Agent to use it in Cursor, VS Code, Claude Desktop, and other MCP-compatible tools."})]}),e[2]=p):p=e[2];let y;return e[3]!==i||e[4]!==s||e[5]!==n||e[6]!==r||e[7]!==o?(y=c.jsxs("div",{className:"p-5 flex flex-col gap-3",children:[p,c.jsx(ys,{connectionId:n,connectionTitle:r,connectionDescription:i,connectionIcon:s,org:o,hasExistingVirtualMcps:!1})]}),e[3]=i,e[4]=s,e[5]=n,e[6]=r,e[7]=o,e[8]=y):y=e[8],y}let f;e[9]===Symbol.for("react.memo_cache_sentinel")?(f=c.jsxs("div",{className:"flex flex-col gap-1",children:[c.jsx("h4",{className:"text-sm font-medium text-foreground",children:"Agents"}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"This connection is used on the following agents."})]}),e[9]=f):f=e[9];let u;if(e[10]!==o||e[11]!==l){let p;e[13]!==o?(p=y=>c.jsx(_d,{virtualMcp:y,org:o},y.id),e[13]=o,e[14]=p):p=e[14],u=l.map(p),e[10]=o,e[11]=l,e[12]=u}else u=e[12];let h;e[15]!==u?(h=c.jsx("div",{className:"flex flex-col gap-2",children:u}),e[15]=u,e[16]=h):h=e[16];let g;e[17]!==i||e[18]!==s||e[19]!==n||e[20]!==r||e[21]!==o?(g=c.jsx(ys,{connectionId:n,connectionTitle:r,connectionDescription:i,connectionIcon:s,org:o,hasExistingVirtualMcps:!0}),e[17]=i,e[18]=s,e[19]=n,e[20]=r,e[21]=o,e[22]=g):g=e[22];let m;return e[23]!==h||e[24]!==g?(m=c.jsxs("div",{className:"p-5 flex flex-col gap-3",children:[f,h,g]}),e[23]=h,e[24]=g,e[25]=m):m=e[25],m}function Td({form:t,connection:e,hasOAuthToken:n}){const r=us({control:t.control,name:"ui_type"}),i=us({control:t.control,name:"connection_url"}),{stdioEnabled:s}=Ic(),o=(()=>{if(typeof i!="string"||!i)return!1;try{const l=new URL(i);return l.hostname==="api.githubcopilot.com"&&l.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),a=s||e.connection_type==="STDIO";return c.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[c.jsx(ke,{control:t.control,name:"ui_type",render:({field:l})=>c.jsxs(Me,{className:"flex flex-col gap-2",children:[c.jsx(st,{className:"text-sm font-medium",children:"Type"}),c.jsxs(ta,{value:l.value,onValueChange:l.onChange,children:[c.jsx(Re,{children:c.jsx(na,{children:c.jsx(ra,{})})}),c.jsxs(ia,{children:[c.jsx(Rt,{value:"HTTP",children:c.jsxs("span",{className:"flex items-center gap-2",children:[c.jsx(br,{className:"w-4 h-4"}),"HTTP"]})}),c.jsx(Rt,{value:"SSE",children:c.jsxs("span",{className:"flex items-center gap-2",children:[c.jsx(br,{className:"w-4 h-4"}),"SSE"]})}),c.jsx(Rt,{value:"Websocket",children:c.jsxs("span",{className:"flex items-center gap-2",children:[c.jsx(br,{className:"w-4 h-4"}),"Websocket"]})}),a&&c.jsxs(c.Fragment,{children:[c.jsx(Rt,{value:"NPX",children:c.jsxs("span",{className:"flex items-center gap-2",children:[c.jsx(cu,{className:"w-4 h-4"}),"NPX Package"]})}),c.jsx(Rt,{value:"STDIO",children:c.jsxs("span",{className:"flex items-center gap-2",children:[c.jsx(ju,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),c.jsx(Be,{})]})}),r==="NPX"&&c.jsx(ke,{control:t.control,name:"npx_package",render:({field:l})=>c.jsxs(Me,{className:"flex flex-col gap-2",children:[c.jsx(st,{className:"text-sm font-medium",children:"NPM Package"}),c.jsx(Re,{children:c.jsx(Qe,{placeholder:"@perplexity-ai/mcp-server",...l,value:l.value||"",className:"h-10 rounded-lg"})}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"The npm package to run with npx"}),c.jsx(Be,{})]})}),r==="STDIO"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[c.jsx(ke,{control:t.control,name:"stdio_command",render:({field:l})=>c.jsxs(Me,{className:"flex flex-col gap-2",children:[c.jsx(st,{className:"text-sm font-medium",children:"Command"}),c.jsx(Re,{children:c.jsx(Qe,{placeholder:"node, bun, python...",...l,value:l.value||"",className:"h-10 rounded-lg"})}),c.jsx(Be,{})]})}),c.jsx(ke,{control:t.control,name:"stdio_args",render:({field:l})=>c.jsxs(Me,{className:"flex flex-col gap-2",children:[c.jsx(st,{className:"text-sm font-medium",children:"Arguments"}),c.jsx(Re,{children:c.jsx(Qe,{placeholder:"arg1 arg2 --flag value",...l,value:l.value||"",className:"h-10 rounded-lg"})}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"Space-separated arguments (no quotes needed)"}),c.jsx(Be,{})]})})]}),c.jsx(ke,{control:t.control,name:"stdio_cwd",render:({field:l})=>c.jsxs(Me,{className:"flex flex-col gap-2",children:[c.jsx(st,{className:"text-sm font-medium",children:"Working Directory"}),c.jsx(Re,{children:c.jsx(Qe,{placeholder:"/path/to/project (optional)",...l,value:l.value||"",className:"h-10 rounded-lg"})}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),c.jsx(Be,{})]})})]}),(r==="NPX"||r==="STDIO")&&c.jsx(ke,{control:t.control,name:"env_vars",render:({field:l})=>c.jsxs(Me,{className:"flex flex-col gap-2",children:[c.jsx(st,{className:"text-sm font-medium",children:"Environment Variables"}),c.jsx(Re,{children:c.jsx(su,{value:l.value??[],onChange:l.onChange})}),c.jsx(Be,{})]})}),r!=="NPX"&&r!=="STDIO"&&c.jsxs(c.Fragment,{children:[c.jsx(ke,{control:t.control,name:"connection_url",render:({field:l})=>c.jsxs(Me,{className:"flex flex-col gap-2",children:[c.jsx(st,{className:"text-sm font-medium",children:"URL"}),c.jsx(Re,{children:c.jsx(Qe,{placeholder:"https://example.com/mcp",...l,value:l.value??"",className:"h-10 rounded-lg"})}),c.jsx(Be,{})]})}),n?c.jsx("div",{className:"flex items-center",children:c.jsxs(fs,{variant:"success",className:"gap-1.5",children:[c.jsx(Kr,{size:12}),"Authenticated via OAuth"]})}):e.connection_token?c.jsx("div",{className:"flex items-center",children:c.jsxs(fs,{variant:"secondary",className:"gap-1.5",children:[c.jsx(Kr,{size:12}),"Token saved"]})}):null,c.jsx(ke,{control:t.control,name:"connection_token",render:({field:l})=>c.jsxs(Me,{className:"flex flex-col gap-2",children:[c.jsx(st,{className:"text-sm font-medium",children:o?"GitHub Personal Access Token":"Token"}),c.jsx(Re,{children:c.jsx(Qe,{type:"password",placeholder:e.connection_token?"Enter new token to replace...":o?"Paste your GitHub PAT (no 'Bearer' prefix)":"Enter access token...",...l,value:l.value||"",className:"h-10 rounded-lg",disabled:n})}),n?c.jsx(xr,{children:"This connection uses OAuth for authentication. Manage access in the MCP Configuration panel."}):e.connection_token?c.jsx(xr,{children:"A token is already saved. Enter a new token to replace it."}):o?c.jsxs(xr,{children:["(!) GitHub's hosted MCP at"," ",c.jsx("code",{children:"api.githubcopilot.com/mcp"})," currently requires a Personal Access Token (PAT). Create one at"," ",c.jsx("a",{href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"github.com/settings/personal-access-tokens"}),". Mesh will send it as"," ",c.jsx("code",{children:"Authorization: Bearer <PAT>"}),"."]}):null,c.jsx(Be,{})]})})]})]})}function Fd(t){const e=xe.c(31),{form:n,connection:r,hasOAuthToken:i}=t,{org:s}=yi();let o;e[0]!==r.icon||e[1]!==r.title?(o=c.jsx(lu,{icon:r.icon,name:r.title,size:"lg",className:"shadow-sm"}),e[0]=r.icon,e[1]=r.title,e[2]=o):o=e[2];let a;e[3]!==n.control?(a=c.jsxs("div",{className:"flex flex-col",children:[c.jsx(ke,{control:n.control,name:"title",render:Ed}),c.jsx(ke,{control:n.control,name:"description",render:Pd})]}),e[3]=n.control,e[4]=a):a=e[4];let l;e[5]!==o||e[6]!==a?(l=c.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[o,a]}),e[5]=o,e[6]=a,e[7]=l):l=e[7];let d;e[8]!==r||e[9]!==n||e[10]!==i?(d=c.jsx(Td,{form:n,connection:r,hasOAuthToken:i}),e[8]=r,e[9]=n,e[10]=i,e[11]=d):d=e[11];let f;e[12]===Symbol.for("react.memo_cache_sentinel")?(f=c.jsx("span",{className:"flex-1 text-sm text-foreground",children:"Last Updated"}),e[12]=f):f=e[12];let u;e[13]!==r.updated_at?(u=r.updated_at?Cd(new Date(r.updated_at),{addSuffix:!1}):"Unknown",e[13]=r.updated_at,e[14]=u):u=e[14];let h;e[15]!==u?(h=c.jsxs("div",{className:"flex items-center gap-4 p-5 border-b border-border",children:[f,c.jsx("span",{className:"text-muted-foreground uppercase text-xs",children:u})]}),e[15]=u,e[16]=h):h=e[16];let g;e[17]!==r.description||e[18]!==r.icon||e[19]!==r.id||e[20]!==r.title||e[21]!==s.slug?(g=c.jsx(Nd,{connectionId:r.id,connectionTitle:r.title,connectionDescription:r.description,connectionIcon:r.icon,org:s.slug}),e[17]=r.description,e[18]=r.icon,e[19]=r.id,e[20]=r.title,e[21]=s.slug,e[22]=g):g=e[22];let m;e[23]!==l||e[24]!==d||e[25]!==h||e[26]!==g?(m=c.jsxs("div",{className:"flex flex-col",children:[l,d,h,g]}),e[23]=l,e[24]=d,e[25]=h,e[26]=g,e[27]=m):m=e[27];let p;return e[28]!==n||e[29]!==m?(p=c.jsx(pu,{...n,children:m}),e[28]=n,e[29]=m,e[30]=p):p=e[30],p}function Pd(t){const{field:e}=t;return c.jsxs(Me,{className:"w-full space-y-0",children:[c.jsx(Re,{children:c.jsx(Qe,{...e,value:e.value||"",className:"h-auto text-base text-muted-foreground leading-6 px-0 border-transparent hover:border-input focus:border-input bg-transparent transition-all",placeholder:"Add a description..."})}),c.jsx(Be,{})]})}function Ed(t){const{field:e}=t;return c.jsxs(Me,{className:"w-full space-y-0",children:[c.jsx("div",{className:"flex items-center gap-2.5",children:c.jsx(Re,{children:c.jsx(Qe,{...e,className:"h-auto text-lg! font-medium leading-7 px-0 border-transparent hover:border-input focus:border-input bg-transparent transition-all",placeholder:"Connection Name"})})}),c.jsx(Be,{})]})}function Id(t){return t.startsWith("@")?t:`@${t}`}function Dd(t){const e=t._meta?.[Pu]?.tools;if(!(!e||e.length===0))return e.map(n=>({name:n.name,inputSchema:n.inputSchema??void 0,outputSchema:n.outputSchema??void 0}))}function $d(t){const e=gi(),n=Qo(e),r=t?Id(t):"",i=r?{where:{appName:r},includeTools:!0}:{},o=Du({queries:n.map(l=>{const d=l.id,f=oa(l.tools)||"",u=pi(d),h=JSON.stringify(i);return{queryKey:fi.toolCall(d,f,h),queryFn:async()=>{if(!f||!r)return null;try{return(await u(f,i))?.items?.[0]??null}catch{return null}},staleTime:300*1e3}})}).map(l=>l.data).find(l=>l!==null);return{bindingSchema:o?Dd(o):void 0}}function kd(t){return t.startsWith("@")?t:`@${t}`}function Md(){const{org:t}=yi(),{data:e}=Dc.useSession(),n=Zo(),r=gi(),i=Qo(r);return{installByBinding:async o=>{if(!t||!e?.user?.id){wt.error("Not authenticated");return}const a=kd(o),d=(await Promise.all(i.map(async m=>{const p=oa(m.tools);if(!p)return null;const y=pi(m.id);try{const x=await y(p,{where:{appName:a}});return wu(x??[])[0]??null}catch{return null}}))).find(m=>m!==null);if(!d){wt.error(`MCP Server not found in registry: ${o}`);return}const f=yu(d,t.id,e.user.id),u=f.connection_type==="STDIO",h=!!f.connection_url,g=u&&f.connection_headers&&typeof f.connection_headers=="object"&&"command"in f.connection_headers;if(!h&&!g){wt.error("This MCP Server cannot be connected: no connection method available");return}return await n.create.mutateAsync(f),{id:f.id,connection:f}},isInstalling:n.create.isPending}}function Y(t){return typeof t!="object"||t===null||typeof t.lastModified=="number"&&typeof File<"u"&&t instanceof File||typeof t.getMonth=="function"&&typeof Date<"u"&&t instanceof Date?!1:!Array.isArray(t)}function Rd(t){return t.additionalItems===!0&&console.warn("additionalItems=true is currently not supported"),Y(t.additionalItems)}function xs(t){if(t==="")return;if(t===null)return null;if(/\.$/.test(t)||/\.0$/.test(t)||/\.\d*0$/.test(t))return t;const e=Number(t);return typeof e=="number"&&!Number.isNaN(e)?e:t}const et="__additional_property",Zn="additionalProperties",pt="allOf",J="anyOf",_e="const",ir="default",vi="dependencies",Bd="enum",be="__errors",oe="$id",Si="if",zt="items",Ud="_$junk_option_schema_id$_",qn="$name",q="oneOf",Gr="patternProperties",te="properties",Sr="readonly",ca="required",Qn="submitButtonOptions",ce="$ref",cn="$schema",ua="root",da="_",Ld=["discriminator","propertyName"],bs="formContext",Wd="layoutGridLookupMap",wi="__rjsf_additionalProperties",fa="__rjsf_rootSchema",Vd="ui:field",ji="ui:widget",ut="ui:options",Hr="ui:globalOptions",zd="https://json-schema.org/draft/2019-09/schema",Kn="https://json-schema.org/draft/2020-12/schema";function U(t={},e={}){return t?Object.keys(t).filter(n=>n.indexOf("ui:")===0).reduce((n,r)=>{const i=t[r];return r===ji&&Y(i)?(console.error("Setting options via ui:widget object is no longer supported, use ui:options instead"),n):r===ut&&Y(i)?{...n,...i}:{...n,[r.substring(3)]:i}},{...e}):{...e}}function ma(t,e={},n){if(!(t.additionalProperties||t.patternProperties))return!1;const{expandable:r=!0}=U(e);return r===!1?r:t.maxProperties!==void 0&&n?Object.keys(n).length<t.maxProperties:!0}var ha=typeof global=="object"&&global&&global.Object===Object&&global,qd=typeof self=="object"&&self&&self.Object===Object&&self,Ye=ha||qd||Function("return this")(),Ne=Ye.Symbol,pa=Object.prototype,Kd=pa.hasOwnProperty,Gd=pa.toString,on=Ne?Ne.toStringTag:void 0;function Hd(t){var e=Kd.call(t,on),n=t[on];try{t[on]=void 0;var r=!0}catch{}var i=Gd.call(t);return r&&(e?t[on]=n:delete t[on]),i}var Yd=Object.prototype,Xd=Yd.toString;function Jd(t){return Xd.call(t)}var Zd="[object Null]",Qd="[object Undefined]",vs=Ne?Ne.toStringTag:void 0;function nt(t){return t==null?t===void 0?Qd:Zd:vs&&vs in Object(t)?Hd(t):Jd(t)}function ga(t,e){return function(n){return t(e(n))}}var sr=ga(Object.getPrototypeOf,Object);function Te(t){return t!=null&&typeof t=="object"}var ef="[object Object]",tf=Function.prototype,nf=Object.prototype,ya=tf.toString,rf=nf.hasOwnProperty,sf=ya.call(Object);function gt(t){if(!Te(t)||nt(t)!=ef)return!1;var e=sr(t);if(e===null)return!0;var n=rf.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&ya.call(n)==sf}function Yr(t){const e={[be]:[],addError(n){this[be].push(n)}};if(Array.isArray(t))return t.reduce((n,r,i)=>({...n,[i]:Yr(r)}),e);if(gt(t)){const n=t;return Object.keys(n).reduce((r,i)=>({...r,[i]:Yr(n[i])}),e)}return e}function of(){this.__data__=[],this.size=0}function Tn(t,e){return t===e||t!==t&&e!==e}function or(t,e){for(var n=t.length;n--;)if(Tn(t[n][0],e))return n;return-1}var af=Array.prototype,lf=af.splice;function cf(t){var e=this.__data__,n=or(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():lf.call(e,n,1),--this.size,!0}function uf(t){var e=this.__data__,n=or(e,t);return n<0?void 0:e[n][1]}function df(t){return or(this.__data__,t)>-1}function ff(t,e){var n=this.__data__,r=or(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}function rt(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}rt.prototype.clear=of;rt.prototype.delete=cf;rt.prototype.get=uf;rt.prototype.has=df;rt.prototype.set=ff;function mf(){this.__data__=new rt,this.size=0}function hf(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}function pf(t){return this.__data__.get(t)}function gf(t){return this.__data__.has(t)}function Z(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var yf="[object AsyncFunction]",xf="[object Function]",bf="[object GeneratorFunction]",vf="[object Proxy]";function Fn(t){if(!Z(t))return!1;var e=nt(t);return e==xf||e==bf||e==yf||e==vf}var wr=Ye["__core-js_shared__"],Ss=(function(){var t=/[^.]+$/.exec(wr&&wr.keys&&wr.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();function Sf(t){return!!Ss&&Ss in t}var wf=Function.prototype,jf=wf.toString;function Tt(t){if(t!=null){try{return jf.call(t)}catch{}try{return t+""}catch{}}return""}var Of=/[\\^$.*+?()[\]{}|]/g,Af=/^\[object .+?Constructor\]$/,Cf=Function.prototype,_f=Object.prototype,Nf=Cf.toString,Tf=_f.hasOwnProperty,Ff=RegExp("^"+Nf.call(Tf).replace(Of,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Pf(t){if(!Z(t)||Sf(t))return!1;var e=Fn(t)?Ff:Af;return e.test(Tt(t))}function Ef(t,e){return t?.[e]}function Ft(t,e){var n=Ef(t,e);return Pf(n)?n:void 0}var xn=Ft(Ye,"Map"),bn=Ft(Object,"create");function If(){this.__data__=bn?bn(null):{},this.size=0}function Df(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var $f="__lodash_hash_undefined__",kf=Object.prototype,Mf=kf.hasOwnProperty;function Rf(t){var e=this.__data__;if(bn){var n=e[t];return n===$f?void 0:n}return Mf.call(e,t)?e[t]:void 0}var Bf=Object.prototype,Uf=Bf.hasOwnProperty;function Lf(t){var e=this.__data__;return bn?e[t]!==void 0:Uf.call(e,t)}var Wf="__lodash_hash_undefined__";function Vf(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=bn&&e===void 0?Wf:e,this}function At(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}At.prototype.clear=If;At.prototype.delete=Df;At.prototype.get=Rf;At.prototype.has=Lf;At.prototype.set=Vf;function zf(){this.size=0,this.__data__={hash:new At,map:new(xn||rt),string:new At}}function qf(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function ar(t,e){var n=t.__data__;return qf(e)?n[typeof e=="string"?"string":"hash"]:n.map}function Kf(t){var e=ar(this,t).delete(t);return this.size-=e?1:0,e}function Gf(t){return ar(this,t).get(t)}function Hf(t){return ar(this,t).has(t)}function Yf(t,e){var n=ar(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}function it(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}it.prototype.clear=zf;it.prototype.delete=Kf;it.prototype.get=Gf;it.prototype.has=Hf;it.prototype.set=Yf;var Xf=200;function Jf(t,e){var n=this.__data__;if(n instanceof rt){var r=n.__data__;if(!xn||r.length<Xf-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new it(r)}return n.set(t,e),this.size=n.size,this}function Ee(t){var e=this.__data__=new rt(t);this.size=e.size}Ee.prototype.clear=mf;Ee.prototype.delete=hf;Ee.prototype.get=pf;Ee.prototype.has=gf;Ee.prototype.set=Jf;var Zf="__lodash_hash_undefined__";function Qf(t){return this.__data__.set(t,Zf),this}function em(t){return this.__data__.has(t)}function Ct(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new it;++e<n;)this.add(t[e])}Ct.prototype.add=Ct.prototype.push=Qf;Ct.prototype.has=em;function tm(t,e){for(var n=-1,r=t==null?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}function vn(t,e){return t.has(e)}var nm=1,rm=2;function xa(t,e,n,r,i,s){var o=n&nm,a=t.length,l=e.length;if(a!=l&&!(o&&l>a))return!1;var d=s.get(t),f=s.get(e);if(d&&f)return d==e&&f==t;var u=-1,h=!0,g=n&rm?new Ct:void 0;for(s.set(t,e),s.set(e,t);++u<a;){var m=t[u],p=e[u];if(r)var y=o?r(p,m,u,e,t,s):r(m,p,u,t,e,s);if(y!==void 0){if(y)continue;h=!1;break}if(g){if(!tm(e,function(x,S){if(!vn(g,S)&&(m===x||i(m,x,n,r,s)))return g.push(S)})){h=!1;break}}else if(!(m===p||i(m,p,n,r,s))){h=!1;break}}return s.delete(t),s.delete(e),h}var er=Ye.Uint8Array;function im(t){var e=-1,n=Array(t.size);return t.forEach(function(r,i){n[++e]=[i,r]}),n}function Oi(t){var e=-1,n=Array(t.size);return t.forEach(function(r){n[++e]=r}),n}var sm=1,om=2,am="[object Boolean]",lm="[object Date]",cm="[object Error]",um="[object Map]",dm="[object Number]",fm="[object RegExp]",mm="[object Set]",hm="[object String]",pm="[object Symbol]",gm="[object ArrayBuffer]",ym="[object DataView]",ws=Ne?Ne.prototype:void 0,jr=ws?ws.valueOf:void 0;function xm(t,e,n,r,i,s,o){switch(n){case ym:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case gm:return!(t.byteLength!=e.byteLength||!s(new er(t),new er(e)));case am:case lm:case dm:return Tn(+t,+e);case cm:return t.name==e.name&&t.message==e.message;case fm:case hm:return t==e+"";case um:var a=im;case mm:var l=r&sm;if(a||(a=Oi),t.size!=e.size&&!l)return!1;var d=o.get(t);if(d)return d==e;r|=om,o.set(t,e);var f=xa(a(t),a(e),r,i,s,o);return o.delete(t),f;case pm:if(jr)return jr.call(t)==jr.call(e)}return!1}function Ai(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}var ye=Array.isArray;function ba(t,e,n){var r=e(t);return ye(t)?r:Ai(r,n(t))}function bm(t,e){for(var n=-1,r=t==null?0:t.length,i=0,s=[];++n<r;){var o=t[n];e(o,n,t)&&(s[i++]=o)}return s}function va(){return[]}var vm=Object.prototype,Sm=vm.propertyIsEnumerable,js=Object.getOwnPropertySymbols,Ci=js?function(t){return t==null?[]:(t=Object(t),bm(js(t),function(e){return Sm.call(t,e)}))}:va;function Sa(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}var wm="[object Arguments]";function Os(t){return Te(t)&&nt(t)==wm}var wa=Object.prototype,jm=wa.hasOwnProperty,Om=wa.propertyIsEnumerable,qt=Os((function(){return arguments})())?Os:function(t){return Te(t)&&jm.call(t,"callee")&&!Om.call(t,"callee")};function Am(){return!1}var ja=typeof exports=="object"&&exports&&!exports.nodeType&&exports,As=ja&&typeof module=="object"&&module&&!module.nodeType&&module,Cm=As&&As.exports===ja,Cs=Cm?Ye.Buffer:void 0,_m=Cs?Cs.isBuffer:void 0,_t=_m||Am,Nm=9007199254740991,Tm=/^(?:0|[1-9]\d*)$/;function lr(t,e){var n=typeof t;return e=e??Nm,!!e&&(n=="number"||n!="symbol"&&Tm.test(t))&&t>-1&&t%1==0&&t<e}var Fm=9007199254740991;function _i(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Fm}var Pm="[object Arguments]",Em="[object Array]",Im="[object Boolean]",Dm="[object Date]",$m="[object Error]",km="[object Function]",Mm="[object Map]",Rm="[object Number]",Bm="[object Object]",Um="[object RegExp]",Lm="[object Set]",Wm="[object String]",Vm="[object WeakMap]",zm="[object ArrayBuffer]",qm="[object DataView]",Km="[object Float32Array]",Gm="[object Float64Array]",Hm="[object Int8Array]",Ym="[object Int16Array]",Xm="[object Int32Array]",Jm="[object Uint8Array]",Zm="[object Uint8ClampedArray]",Qm="[object Uint16Array]",eh="[object Uint32Array]",ue={};ue[Km]=ue[Gm]=ue[Hm]=ue[Ym]=ue[Xm]=ue[Jm]=ue[Zm]=ue[Qm]=ue[eh]=!0;ue[Pm]=ue[Em]=ue[zm]=ue[Im]=ue[qm]=ue[Dm]=ue[$m]=ue[km]=ue[Mm]=ue[Rm]=ue[Bm]=ue[Um]=ue[Lm]=ue[Wm]=ue[Vm]=!1;function th(t){return Te(t)&&_i(t.length)&&!!ue[nt(t)]}function Ni(t){return function(e){return t(e)}}var Oa=typeof exports=="object"&&exports&&!exports.nodeType&&exports,fn=Oa&&typeof module=="object"&&module&&!module.nodeType&&module,nh=fn&&fn.exports===Oa,Or=nh&&ha.process,Kt=(function(){try{var t=fn&&fn.require&&fn.require("util").types;return t||Or&&Or.binding&&Or.binding("util")}catch{}})(),_s=Kt&&Kt.isTypedArray,Pn=_s?Ni(_s):th,rh=Object.prototype,ih=rh.hasOwnProperty;function Aa(t,e){var n=ye(t),r=!n&&qt(t),i=!n&&!r&&_t(t),s=!n&&!r&&!i&&Pn(t),o=n||r||i||s,a=o?Sa(t.length,String):[],l=a.length;for(var d in t)(e||ih.call(t,d))&&!(o&&(d=="length"||i&&(d=="offset"||d=="parent")||s&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||lr(d,l)))&&a.push(d);return a}var sh=Object.prototype;function cr(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||sh;return t===n}var oh=ga(Object.keys,Object),ah=Object.prototype,lh=ah.hasOwnProperty;function Ca(t){if(!cr(t))return oh(t);var e=[];for(var n in Object(t))lh.call(t,n)&&n!="constructor"&&e.push(n);return e}function Pt(t){return t!=null&&_i(t.length)&&!Fn(t)}function Pe(t){return Pt(t)?Aa(t):Ca(t)}function Xr(t){return ba(t,Pe,Ci)}var ch=1,uh=Object.prototype,dh=uh.hasOwnProperty;function fh(t,e,n,r,i,s){var o=n&ch,a=Xr(t),l=a.length,d=Xr(e),f=d.length;if(l!=f&&!o)return!1;for(var u=l;u--;){var h=a[u];if(!(o?h in e:dh.call(e,h)))return!1}var g=s.get(t),m=s.get(e);if(g&&m)return g==e&&m==t;var p=!0;s.set(t,e),s.set(e,t);for(var y=o;++u<l;){h=a[u];var x=t[h],S=e[h];if(r)var O=o?r(S,x,h,e,t,s):r(x,S,h,t,e,s);if(!(O===void 0?x===S||i(x,S,n,r,s):O)){p=!1;break}y||(y=h=="constructor")}if(p&&!y){var b=t.constructor,v=e.constructor;b!=v&&"constructor"in t&&"constructor"in e&&!(typeof b=="function"&&b instanceof b&&typeof v=="function"&&v instanceof v)&&(p=!1)}return s.delete(t),s.delete(e),p}var Jr=Ft(Ye,"DataView"),Zr=Ft(Ye,"Promise"),Wt=Ft(Ye,"Set"),Qr=Ft(Ye,"WeakMap"),Ns="[object Map]",mh="[object Object]",Ts="[object Promise]",Fs="[object Set]",Ps="[object WeakMap]",Es="[object DataView]",hh=Tt(Jr),ph=Tt(xn),gh=Tt(Zr),yh=Tt(Wt),xh=Tt(Qr),Ce=nt;(Jr&&Ce(new Jr(new ArrayBuffer(1)))!=Es||xn&&Ce(new xn)!=Ns||Zr&&Ce(Zr.resolve())!=Ts||Wt&&Ce(new Wt)!=Fs||Qr&&Ce(new Qr)!=Ps)&&(Ce=function(t){var e=nt(t),n=e==mh?t.constructor:void 0,r=n?Tt(n):"";if(r)switch(r){case hh:return Es;case ph:return Ns;case gh:return Ts;case yh:return Fs;case xh:return Ps}return e});var bh=1,Is="[object Arguments]",Ds="[object Array]",Un="[object Object]",vh=Object.prototype,$s=vh.hasOwnProperty;function Sh(t,e,n,r,i,s){var o=ye(t),a=ye(e),l=o?Ds:Ce(t),d=a?Ds:Ce(e);l=l==Is?Un:l,d=d==Is?Un:d;var f=l==Un,u=d==Un,h=l==d;if(h&&_t(t)){if(!_t(e))return!1;o=!0,f=!1}if(h&&!f)return s||(s=new Ee),o||Pn(t)?xa(t,e,n,r,i,s):xm(t,e,l,n,r,i,s);if(!(n&bh)){var g=f&&$s.call(t,"__wrapped__"),m=u&&$s.call(e,"__wrapped__");if(g||m){var p=g?t.value():t,y=m?e.value():e;return s||(s=new Ee),i(p,y,n,r,s)}}return h?(s||(s=new Ee),fh(t,e,n,r,i,s)):!1}function En(t,e,n,r,i){return t===e?!0:t==null||e==null||!Te(t)&&!Te(e)?t!==t&&e!==e:Sh(t,e,n,r,En,i)}function wh(t,e,n){n=typeof n=="function"?n:void 0;var r=n?n(t,e):void 0;return r===void 0?En(t,e,void 0,n):!!r}function le(t,e){return wh(t,e,(n,r)=>{if(typeof n=="function"&&typeof r=="function")return!0})}var jh="[object Symbol]";function In(t){return typeof t=="symbol"||Te(t)&&nt(t)==jh}var Oh=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ah=/^\w*$/;function Ti(t,e){if(ye(t))return!1;var n=typeof t;return n=="number"||n=="symbol"||n=="boolean"||t==null||In(t)?!0:Ah.test(t)||!Oh.test(t)||e!=null&&t in Object(e)}var Ch="Expected a function";function Fi(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(Ch);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],s=n.cache;if(s.has(i))return s.get(i);var o=t.apply(this,r);return n.cache=s.set(i,o)||s,o};return n.cache=new(Fi.Cache||it),n}Fi.Cache=it;var _h=500;function Nh(t){var e=Fi(t,function(r){return n.size===_h&&n.clear(),r}),n=e.cache;return e}var Th=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Fh=/\\(\\)?/g,_a=Nh(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(Th,function(n,r,i,s){e.push(i?s.replace(Fh,"$1"):r||n)}),e});function Xt(t,e){for(var n=-1,r=t==null?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}var ks=Ne?Ne.prototype:void 0,Ms=ks?ks.toString:void 0;function Na(t){if(typeof t=="string")return t;if(ye(t))return Xt(t,Na)+"";if(In(t))return Ms?Ms.call(t):"";var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}function Pi(t){return t==null?"":Na(t)}function Jt(t,e){return ye(t)?t:Ti(t,e)?[t]:_a(Pi(t))}function Et(t){if(typeof t=="string"||In(t))return t;var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}function ur(t,e){e=Jt(e,t);for(var n=0,r=e.length;t!=null&&n<r;)t=t[Et(e[n++])];return n&&n==r?t:void 0}function I(t,e,n){var r=t==null?void 0:ur(t,e);return r===void 0?n:r}var Ph=Object.prototype,Eh=Ph.hasOwnProperty;function Ih(t,e){return t!=null&&Eh.call(t,e)}function Ta(t,e,n){e=Jt(e,t);for(var r=-1,i=e.length,s=!1;++r<i;){var o=Et(e[r]);if(!(s=t!=null&&n(t,o)))break;t=t[o]}return s||++r!=i?s:(i=t==null?0:t.length,!!i&&_i(i)&&lr(o,i)&&(ye(t)||qt(t)))}function X(t,e){return t!=null&&Ta(t,e,Ih)}function dt(t,e){return En(t,e)}var tr=(function(){try{var t=Ft(Object,"defineProperty");return t({},"",{}),t}catch{}})();function Ei(t,e,n){e=="__proto__"&&tr?tr(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}var Dh=Object.prototype,$h=Dh.hasOwnProperty;function Ii(t,e,n){var r=t[e];(!($h.call(t,e)&&Tn(r,n))||n===void 0&&!(e in t))&&Ei(t,e,n)}function Di(t,e,n,r){if(!Z(t))return t;e=Jt(e,t);for(var i=-1,s=e.length,o=s-1,a=t;a!=null&&++i<s;){var l=Et(e[i]),d=n;if(l==="__proto__"||l==="constructor"||l==="prototype")return t;if(i!=o){var f=a[l];d=r?r(f,l,a):void 0,d===void 0&&(d=Z(f)?f:lr(e[i+1])?[]:{})}Ii(a,l,d),a=a[l]}return t}function se(t,e,n){return t==null?t:Di(t,e,n)}function dr(t){return t}function Fa(t){return typeof t=="function"?t:dr}var kh=/\s/;function Mh(t){for(var e=t.length;e--&&kh.test(t.charAt(e)););return e}var Rh=/^\s+/;function Bh(t){return t&&t.slice(0,Mh(t)+1).replace(Rh,"")}var Rs=NaN,Uh=/^[-+]0x[0-9a-f]+$/i,Lh=/^0b[01]+$/i,Wh=/^0o[0-7]+$/i,Vh=parseInt;function zh(t){if(typeof t=="number")return t;if(In(t))return Rs;if(Z(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Z(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=Bh(t);var n=Lh.test(t);return n||Wh.test(t)?Vh(t.slice(2),n?2:8):Uh.test(t)?Rs:+t}var Bs=1/0,qh=17976931348623157e292;function Kh(t){if(!t)return t===0?t:0;if(t=zh(t),t===Bs||t===-Bs){var e=t<0?-1:1;return e*qh}return t===t?t:0}function Pa(t){var e=Kh(t),n=e%1;return e===e?n?e-n:e:0}var Gh=9007199254740991,Ar=4294967295,Hh=Math.min;function Ea(t,e){if(t=Pa(t),t<1||t>Gh)return[];var n=Ar,r=Hh(t,Ar);e=Fa(e),t-=Ar;for(var i=Sa(r,e);++n<t;)e(n);return i}function $i(t,e){for(var n=-1,r=t==null?0:t.length;++n<r&&e(t[n],n,t)!==!1;);return t}var Us=Object.create,Ia=(function(){function t(){}return function(e){if(!Z(e))return{};if(Us)return Us(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}})();function Yh(t){return function(e,n,r){for(var i=-1,s=Object(e),o=r(e),a=o.length;a--;){var l=o[++i];if(n(s[l],l,s)===!1)break}return e}}var Da=Yh();function $a(t,e){return t&&Da(t,e,Pe)}var Xh=1,Jh=2;function Zh(t,e,n,r){var i=n.length,s=i;if(t==null)return!s;for(t=Object(t);i--;){var o=n[i];if(o[2]?o[1]!==t[o[0]]:!(o[0]in t))return!1}for(;++i<s;){o=n[i];var a=o[0],l=t[a],d=o[1];if(o[2]){if(l===void 0&&!(a in t))return!1}else{var f=new Ee,u;if(!(u===void 0?En(d,l,Xh|Jh,r,f):u))return!1}}return!0}function ka(t){return t===t&&!Z(t)}function Qh(t){for(var e=Pe(t),n=e.length;n--;){var r=e[n],i=t[r];e[n]=[r,i,ka(i)]}return e}function Ma(t,e){return function(n){return n==null?!1:n[t]===e&&(e!==void 0||t in Object(n))}}function ep(t){var e=Qh(t);return e.length==1&&e[0][2]?Ma(e[0][0],e[0][1]):function(n){return n===t||Zh(n,t,e)}}function tp(t,e){return t!=null&&e in Object(t)}function Ra(t,e){return t!=null&&Ta(t,e,tp)}var np=1,rp=2;function ip(t,e){return Ti(t)&&ka(e)?Ma(Et(t),e):function(n){var r=I(n,t);return r===void 0&&r===e?Ra(n,t):En(e,r,np|rp)}}function sp(t){return function(e){return e?.[t]}}function op(t){return function(e){return ur(e,t)}}function ap(t){return Ti(t)?sp(Et(t)):op(t)}function ki(t){return typeof t=="function"?t:t==null?dr:typeof t=="object"?ye(t)?ip(t[0],t[1]):ep(t):ap(t)}function lp(t,e,n){var r=ye(t),i=r||_t(t)||Pn(t);if(e=ki(e),n==null){var s=t&&t.constructor;i?n=r?new s:[]:Z(t)?n=Fn(s)?Ia(sr(t)):{}:n={}}return(i?$i:$a)(t,function(o,a,l){return e(n,o,a,l)}),n}function ei(t,e,n){(n!==void 0&&!Tn(t[e],n)||n===void 0&&!(e in t))&&Ei(t,e,n)}var Ba=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Ls=Ba&&typeof module=="object"&&module&&!module.nodeType&&module,cp=Ls&&Ls.exports===Ba,Ws=cp?Ye.Buffer:void 0,Vs=Ws?Ws.allocUnsafe:void 0;function Ua(t,e){if(e)return t.slice();var n=t.length,r=Vs?Vs(n):new t.constructor(n);return t.copy(r),r}function Mi(t){var e=new t.constructor(t.byteLength);return new er(e).set(new er(t)),e}function La(t,e){var n=e?Mi(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function Ri(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}function Wa(t){return typeof t.constructor=="function"&&!cr(t)?Ia(sr(t)):{}}function Sn(t){return Te(t)&&Pt(t)}function ti(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function Zt(t,e,n,r){var i=!n;n||(n={});for(var s=-1,o=e.length;++s<o;){var a=e[s],l=void 0;l===void 0&&(l=t[a]),i?Ei(n,a,l):Ii(n,a,l)}return n}function up(t){var e=[];if(t!=null)for(var n in Object(t))e.push(n);return e}var dp=Object.prototype,fp=dp.hasOwnProperty;function mp(t){if(!Z(t))return up(t);var e=cr(t),n=[];for(var r in t)r=="constructor"&&(e||!fp.call(t,r))||n.push(r);return n}function Dn(t){return Pt(t)?Aa(t,!0):mp(t)}function hp(t){return Zt(t,Dn(t))}function pp(t,e,n,r,i,s,o){var a=ti(t,n),l=ti(e,n),d=o.get(l);if(d){ei(t,n,d);return}var f=s?s(a,l,n+"",t,e,o):void 0,u=f===void 0;if(u){var h=ye(l),g=!h&&_t(l),m=!h&&!g&&Pn(l);f=l,h||g||m?ye(a)?f=a:Sn(a)?f=Ri(a):g?(u=!1,f=Ua(l,!0)):m?(u=!1,f=La(l,!0)):f=[]:gt(l)||qt(l)?(f=a,qt(a)?f=hp(a):(!Z(a)||Fn(a))&&(f=Wa(l))):u=!1}u&&(o.set(l,f),i(f,l,r,s,o),o.delete(l)),ei(t,n,f)}function Va(t,e,n,r,i){t!==e&&Da(e,function(s,o){if(i||(i=new Ee),Z(s))pp(t,e,o,n,Va,r,i);else{var a=r?r(ti(t,o),s,o+"",t,e,i):void 0;a===void 0&&(a=s),ei(t,o,a)}},Dn)}function gp(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}var zs=Math.max;function za(t,e,n){return e=zs(e===void 0?t.length-1:e,0),function(){for(var r=arguments,i=-1,s=zs(r.length-e,0),o=Array(s);++i<s;)o[i]=r[e+i];i=-1;for(var a=Array(e+1);++i<e;)a[i]=r[i];return a[e]=n(o),gp(t,this,a)}}function yp(t){return function(){return t}}var xp=tr?function(t,e){return tr(t,"toString",{configurable:!0,enumerable:!1,value:yp(e),writable:!0})}:dr,bp=800,vp=16,Sp=Date.now;function wp(t){var e=0,n=0;return function(){var r=Sp(),i=vp-(r-n);if(n=r,i>0){if(++e>=bp)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var qa=wp(xp);function fr(t,e){return qa(za(t,e,dr),t+"")}function jp(t,e,n){if(!Z(n))return!1;var r=typeof e;return(r=="number"?Pt(n)&&lr(e,n.length):r=="string"&&e in n)?Tn(n[e],t):!1}function Op(t){return fr(function(e,n){var r=-1,i=n.length,s=i>1?n[i-1]:void 0,o=i>2?n[2]:void 0;for(s=t.length>3&&typeof s=="function"?(i--,s):void 0,o&&jp(n[0],n[1],o)&&(s=i<3?void 0:s,i=1),e=Object(e);++r<i;){var a=n[r];a&&t(e,a,r,s)}return e})}var Ap=Op(function(t,e,n){Va(t,e,n)}),qs=Ne?Ne.isConcatSpreadable:void 0;function Cp(t){return ye(t)||qt(t)||!!(qs&&t&&t[qs])}function $n(t,e,n,r,i){var s=-1,o=t.length;for(n||(n=Cp),i||(i=[]);++s<o;){var a=t[s];e>0&&n(a)?e>1?$n(a,e-1,n,r,i):Ai(i,a):r||(i[i.length]=a)}return i}var _p=1/0;function Np(t){var e=t==null?0:t.length;return e?$n(t,_p):[]}function Tp(t,e,n,r){for(var i=t.length,s=n+-1;++s<i;)if(e(t[s],s,t))return s;return-1}function Fp(t){return t!==t}function Pp(t,e,n){for(var r=n-1,i=t.length;++r<i;)if(t[r]===e)return r;return-1}function Ka(t,e,n){return e===e?Pp(t,e,n):Tp(t,Fp,n)}function Bi(t,e){var n=t==null?0:t.length;return!!n&&Ka(t,e,0)>-1}function Gn(){}var Ep=1/0,Ip=Wt&&1/Oi(new Wt([,-0]))[1]==Ep?function(t){return new Wt(t)}:Gn,Dp=200;function Ga(t,e,n){var r=-1,i=Bi,s=t.length,o=!0,a=[],l=a;if(s>=Dp){var d=Ip(t);if(d)return Oi(d);o=!1,i=vn,l=new Ct}else l=a;e:for(;++r<s;){var f=t[r],u=f;if(f=f!==0?f:0,o&&u===u){for(var h=l.length;h--;)if(l[h]===u)continue e;a.push(f)}else i(l,u,n)||(l!==a&&l.push(u),a.push(f))}return a}function Ha(t){return t&&t.length?Ga(t):[]}var $p="[object Map]",kp="[object Set]",Mp=Object.prototype,Rp=Mp.hasOwnProperty;function me(t){if(t==null)return!0;if(Pt(t)&&(ye(t)||typeof t=="string"||typeof t.splice=="function"||_t(t)||Pn(t)||qt(t)))return!t.length;var e=Ce(t);if(e==$p||e==kp)return!t.size;if(cr(t))return!Ca(t).length;for(var n in t)if(Rp.call(t,n))return!1;return!0}const Bp=Object.prototype;function un(t){for(const e in t)if(Bp.hasOwnProperty.call(t,e))return!1;return!0}const Up=["array","boolean","integer","null","number","object","string"];new Set(Up);const Lp=["$defs","definitions","properties","patternProperties","dependencies"];new Set(Lp);const Wp=["items","allOf","oneOf","anyOf"];new Set(Wp);const Vp=["items","additionalItems","additionalProperties","propertyNames","contains","if","then","else","not"];new Set(Vp);function Hn(t){return typeof t=="object"}function Le(t){return Hn(t)?un(t):t===!0}function Lt(t,e){return t<e?-1:t>e?1:0}function Cr(t,e){const n=t.length;if(n===0)return e;let r=e.length;if(r===0)return t;if(n<r){const s=t;t=e,e=s,r=n}const i=new Set(t);for(let s=0;s<r;s++)i.add(e[s]);return Array.from(i)}function zp(t,e){const n=[];if(t.length===0||e.length===0)return n;if(t.length>e.length){const i=t;t=e,e=i}const r=new Set(e);for(let i=0;i<t.length&&r.size>0;i++){const s=t[i];r.delete(s)&&n.push(s)}return n}function Ks(t){return t.length===0}function _r(t){return(e,n)=>{const r=e.length-n.length;if(r!==0)return r;for(let i=0;i<e.length;i++)if(e[i]!==n[i]){const s=t(e[i],n[i]);if(s!==0)return s}return 0}}function Ya(t,{threshold:e=12}={}){return n=>{const r=n.length;if(r===0)return n;if(r<=e){const o=[];let a=0;e:for(let l=0;l<r;l++){const d=n[l];for(let f=0;f<a;f++)if(t(d,o[f])===0)continue e;a=o.push(d)}return o}const i=n.slice().sort(t);let s=0;for(let o=1;o<r;o++)t(i[s],i[o])!==0&&++s!==o&&(i[s]=i[o]);return i.length=s+1,i}}function qp(t){return(e,n)=>{const r=[];let i=e.length,s=n.length;if(i===0||s===0)return r;if(i>s){const f=e;e=n,n=f;const u=i;i=s,s=u}const o=[...e].sort(t),a=[...n].sort(t);let l=0,d=0;for(;l<i&&d<s;){const f=t(o[l],a[d]);f===0?((r.length===0||t(r[r.length-1],o[l])!==0)&&r.push(o[l]),l++,d++):f<0?l++:d++}return r}}function Kp(t,e){return n=>{if(t.has(n))return t.get(n);const r=e(n);return t.set(n,r),r}}const Gs=Kp,Xa=()=>0,Gp=t=>t===void 0,Hp=t=>typeof t!="object",Hs={boolean:0,number:1,string:2};function Yp(t,e){const n=typeof t,r=typeof e;return n===r?Lt(t,e):Hs[n]-Hs[r]}function Xp(t,e){const n=t.length;if(n===0)return e;const r=e.length;if(r===0)return t;if(r>n){const o=t;t=e,e=o}const i=new Set(t),s=e.length;for(let o=0;o<s;o++){const a=e[o];i.has(a)||t.push(a)}return t}function mr(t,e,n=Xa){return(r,i)=>t(r)?t(i)?n(r,i):-1:t(i)?1:e(r,i)}function Bt(t){return mr(Gp,t)}function at(t,e){return mr(n=>n===void 0||t(n),e)}function Nr(t,e){return mr(Array.isArray,t,e)}const he=Bt(Lt),Tr=at(t=>t===0,(t,e)=>t-e);function Jp({deduplicationCache:t=new WeakMap,sortedKeysCache:e=new WeakMap}={}){const n=Gs(e,p=>Object.keys(p).sort());function r(p){return(y,x)=>{const S=n(y),O=n(x),b=Math.min(S.length,O.length);for(let v=0;v<b;v++){const w=Lt(S[v],O[v]);if(w!==0)return w}if(S.length!==O.length)return S.length-O.length;for(let v=0;v<b;v++){const w=S[v],j=p(y[w],x[w]);if(j!==0)return j}return 0}}function i(p){const y=_r(p),x=Gs(t,Ya(p,{threshold:0}));return(S,O)=>y(x(S),x(O))}const s=i(Lt);function o(p,y){if(Hn(p)){if(Hn(y)){const x=Object.keys(p),S=Object.keys(y),O=Xp(x,S),b=O.length;for(let v=0;v<b;v++){const w=O[v];if(p[w]===y[w])continue;const A=(m[w]??a)(p[w],y[w]);if(A!==0)return A}return 0}return y===!0&&un(p)?0:1}return Hn(y)?p===!0&&un(y)?0:-1:Lt(p,y)}const a=Bt(d),l=mr(Hp,Nr(r(a),_r(d)),Yp);function d(p,y){return p===null?-1:y===null?1:l(p,y)}const f=Bt(o),u=at(un,r(f)),h=Bt(i(o)),g=at(Le,o),m={$id:he,$comment:he,$defs:u,$ref:he,$schema:he,const:a,contains:f,contentEncoding:he,contentMediaType:he,default:a,definitions:u,description:he,else:f,examples:a,exclusiveMaximum:he,exclusiveMinimum:he,format:he,if:f,maximum:he,maxItems:he,maxLength:he,maxProperties:he,minimum:he,multipleOf:he,not:f,pattern:he,propertyNames:f,readOnly:he,then:f,title:he,writeOnly:he,uniqueItems:at(p=>p===!1,Xa),minLength:Tr,minItems:Tr,minProperties:Tr,required:at(Ks,s),enum:at(Ks,i(d)),type:Bt((p,y)=>{const x=Array.isArray(p),S=Array.isArray(y);return!x&&!S?Lt(p,y):s(x?p:[p],S?y:[y])}),items:at(p=>!Array.isArray(p)&&Le(p),Nr(o,_r(o))),anyOf:h,allOf:h,oneOf:h,properties:u,patternProperties:u,additionalProperties:g,additionalItems:g,dependencies:at(un,r(Bt(Nr(o,s))))};return{compareSchemaValues:d,compareSchemaDefinitions:o}}function Ys(t){return t}const Ja=(t,e)=>t?Ja(e%t,t):e,Zp=(t,e)=>Math.abs(t*e)/Ja(t,e);function Qp(t,e){return t===e?t:`^(?=.*(?:${t}))(?=.*(?:${e})).*$`}function*Fr(t,e,n){const r=t.length,i=e.length;if(r>0&&i>0)for(let s=0;s<r;s++){const o=t[s];for(let a=0;a<i;a++)yield n(o,e[a])}}function Pr(t,e){return t||e}function Xs(t){return(e,n)=>{const r={...e},i=Object.keys(n),s=i.length;for(let o=0;o<s;o++){const a=i[o];r[a]=e[a]===void 0?n[a]:t(e[a],n[a])}return r}}function eg(t){const e=new Map;for(const n of t)for(const r of n[0])e.set(r,n[1]);return e}function bt(t,e,n){n===void 0||Le(n)?delete t[e]:t[e]=n}const tg=["properties","patternProperties","additionalProperties"];function Js(t){const e=Object.keys(t),n=e.length,r=[];for(let i=0;i<n;i++){const s=e[i];r.push({regExp:new RegExp(s),schema:t[s]})}return[r,e]}const Zs=[[],[]];function Qs(t,e,n){const r=n.length;for(let i=0;i<r;i++){const s=n[i];if(!s.regExp.test(e))continue;const o=s.schema;if(o===!1)return!0;t.push(o)}return!1}const ng=["items","additionalItems"],rg=["if","then","else"];function eo(t,e){return e.if!==void 0&&(t.if=e.if),e.then!==void 0&&(t.then=e.then),e.else!==void 0&&(t.else=e.else),t}function Er(t,e){if(t===e)return t;switch(t){case"number":if(e==="integer")return"integer";case"integer":if(e==="number")return"integer";default:return}}function vt(t,e,n){return[t,e,n]}function ig(t){const e=new Map;for(const[n,r,i]of t){const s=o=>{if(!i(o))throw new Error(`Schema keys '${n}' and '${r}' are conflicting (${n}: ${JSON.stringify(o[n])}, ${r}: ${JSON.stringify(o[r])})`)};for(const o of[[n,r],[r,n]]){let a=e.get(o[0]);a===void 0&&(a=[],e.set(o[0],a)),a.push({oppositeKey:o[1],check:s})}}return e}const sg=[vt("minimum","maximum",t=>t.maximum>=t.minimum),vt("exclusiveMinimum","maximum",t=>t.maximum>t.exclusiveMinimum),vt("minimum","exclusiveMaximum",t=>t.exclusiveMaximum>t.minimum),vt("exclusiveMinimum","exclusiveMaximum",t=>t.exclusiveMaximum>t.exclusiveMinimum),vt("minLength","maxLength",t=>t.maxLength>=t.minLength),vt("minItems","maxItems",t=>t.maxItems>=t.minItems),vt("minProperties","maxProperties",t=>t.maxProperties>=t.minProperties)];function og({mergePatterns:t=Qp,isSubRegExp:e=Object.is,intersectJson:n=zp,deduplicateJsonSchemaDef:r=Ys,defaultMerger:i=Ys,assigners:s=[],checks:o=sg,mergers:a}={}){function l(b){const v=b.length;let w=b[0];for(let j=1;j<v;j++){const A=x(w,b[j]);if(A===!1)return!1;Le(A)||(w=A)}return w}function d(b,v,w,j,A,C,T){if(b.length=0,w===!1)return!1;if(b.push(w),A!==void 0){if(A===!1)return!1;b.push(A)}if(Qs(b,v,C))return!1;const _=b.length<2;if(T===!1){if(_)return;if(Qs(b,v,j))return!1}else _&&T!==void 0&&b.push(T);return b.length===1?b[0]:l(b)}function f(b,v,w,j,A,C){const T=w.length;if(T>0&&A!==!1)if(C)Object.assign(b,v);else for(let N=0;N<T;N++){const _=w[N];j.has(_)||(b[_]=x(v[_],A))}return b}const u=(b,{properties:v={},patternProperties:w,additionalProperties:j=!0},{properties:A={},patternProperties:C,additionalProperties:T=!0})=>{const N=Le(j),_=Le(T);if(N&&_)return bt(b,"properties",S(v,A)),bt(b,"patternProperties",w&&C?S(w,C):w??C),delete b.additionalProperties,b;const F=x(j,T);bt(b,"additionalProperties",F);const $={},E=Object.keys(v),D=E.length,[M,k]=w?Js(w):Zs,[B,V]=C?Js(C):Zs,R=[],W=new Set,Q=_?void 0:T;for(let H=0;H<D;H++){const re=E[H];W.add(re);const fe=d(R,re,v[re],M,A[re],B,Q);fe!==void 0&&($[re]=fe)}const ne=Object.keys(A),ie=ne.length,de=N?void 0:j;for(let H=0;H<ie;H++){const re=ne[H];if(W.has(re))continue;const fe=d(R,re,A[re],B,void 0,M,de);fe!==void 0&&($[re]=fe)}bt(b,"properties",$);let ee={};const z=new Set;if(k.length>0&&V.length>0){const H=Fr(k,V,(re,fe)=>{e(re,fe)&&z.add(re),e(fe,re)&&z.add(fe),ee[t(re,fe)]=x(w[re],C[fe])});for(;!H.next().done;);}return ee=f(ee,w,k,z,T,_),ee=f(ee,C,V,z,j,N),bt(b,"patternProperties",ee),b},h=(b,{items:v=[],additionalItems:w},{items:j=[],additionalItems:A})=>{const C=Array.isArray(v),T=Array.isArray(j),N=[];if(b.items=N,C&&T){const[_,F,$]=v.length<j.length?[v.length,w,j]:[j.length,A,v];let E=0;for(;E<_;E++)N.push(x(v[E],j[E]));if(F===!1)b.additionalItems=!1;else{const D=F===void 0||Le(F);for(;E<$.length;E++)N.push(D?$[E]:x($[E],F));bt(b,"additionalItems",w!==void 0&&A!==void 0?x(w,A):w??A)}}else if(C||T){const[_,F,$]=C?[v,j,w]:[j,v,A];bt(b,"additionalItems",$&&x($,F));for(let E=0;E<_.length;E++)N.push(x(_[E],F))}else delete b.additionalItems,b.items=x(v,j);return b},g=(b,v,w)=>{eo(b,v);const j=eo({},w);return b.allOf===void 0?b.allOf=[j]:b.allOf=b.allOf.concat(j),b};function m(b,v){return r(Array.from(Fr(b,v,x)))}const p=eg([[tg,u],[ng,h],[rg,g],...s]),y=ig(o);function x(b,v){if(b===!1||v===!1)return!1;if(Le(b))return Le(v)?!0:v;if(Le(v))return b;let w={...b};const j=new Set,A=new Set,C=Object.keys(v),T=C.length;for(let N=0;N<T;N++){const _=C[N],F=v[_];if(F===void 0)continue;const $=y.get(_);if($!==void 0){const k=$.length;for(let B=0;B<k;B++){const V=$[B];b[V.oppositeKey]!==void 0&&A.add(V.check)}}const E=b[_];if(E===void 0){w[_]=F;continue}const D=p.get(_);if(D){j.add(D);continue}const M=O[_]??i;w[_]=M(E,F)}for(const N of j)w=N(w,b,v);for(const N of A)N(w);return w}const S=Xs(x),O={$id:i,$ref:i,$schema:i,$comment:i,$defs:S,definitions:S,type:(b,v)=>{if(b===v)return b;const w=Array.isArray(b),j=Array.isArray(v);if(!w&&!j){const A=Er(b,v);if(A!==void 0)return A}else if(w||j){const A=new Set;if(w&&j)for(const T of Fr(b,v,Er))T!==void 0&&A.add(T);else{const T=w?b:v,N=w?v:b,_=T.length;for(let F=0;F<_;F++){const $=Er(N,T[F]);$!==void 0&&A.add($)}}const C=A.size;if(C===1)return A.values().next().value;if(C>1)return Array.from(A)}throw new Error(`It is not possible to create an intersection of the following incompatible types: ${b.toString()}, ${v.toString()}`)},default:i,description:i,title:i,const:i,format:i,contentEncoding:i,contentMediaType:i,not:(b,v)=>{const w=r([b,v]);return w.length===1?w[0]:{anyOf:w}},pattern:t,readOnly:Pr,writeOnly:Pr,enum:(b,v)=>{const w=n(b,v);if(w.length===0)throw new Error(`Intersection of the following enums is empty: "${JSON.stringify(b)}", "${JSON.stringify(v)}"`);return w},anyOf:m,oneOf:m,allOf:(b,v)=>r(b.concat(v)),propertyNames:x,contains:x,dependencies:Xs((b,v)=>Array.isArray(b)?Array.isArray(v)?Cr(b,v):x(v,{required:b}):Array.isArray(v)?x(b,{required:v}):x(b,v)),examples:(b,v)=>{if(!Array.isArray(b)||!Array.isArray(v))throw new Error(`Value of the 'examples' field should be an array, but got "${JSON.stringify(b)}" and "${JSON.stringify(v)}"`);return Cr(b,v)},multipleOf:(b,v)=>{let w=1;for(;!Number.isInteger(b)||!Number.isInteger(v);)w*=10,b*=10,v*=10;return Zp(b,v)/w},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:Pr,required:Cr,...a};return{mergeSchemaDefinitions:x,mergeArrayOfSchemaDefinitions:l}}function ag(t){const e=[],n=[t];for(;n.length>0;){const r=n.pop();if(typeof r=="boolean"||r.allOf===void 0){e.push(r);continue}const{allOf:i,...s}=r;e.push(s);for(let o=i.length-1;o>=0;o--)n.push(i[o])}return e}function lg(t){return e=>t(ag(e))}var an={},to;function cg(){if(to)return an;to=1;var t=/~/,e=/~[01]/g;function n(d){switch(d){case"~1":return"/";case"~0":return"~"}throw new Error("Invalid tilde escape: "+d)}function r(d){return t.test(d)?d.replace(e,n):d}function i(d,f,u){for(var h,g,m=1,p=f.length;m<p;){if(f[m]==="constructor"||f[m]==="prototype"||f[m]==="__proto__")return d;if(h=r(f[m++]),g=p>m,typeof d[h]>"u"&&(Array.isArray(d)&&h==="-"&&(h=d.length),g&&(f[m]!==""&&f[m]<1/0||f[m]==="-"?d[h]=[]:d[h]={})),!g)break;d=d[h]}var y=d[h];return u===void 0?delete d[h]:d[h]=u,y}function s(d){if(typeof d=="string"){if(d=d.split("/"),d[0]==="")return d;throw new Error("Invalid JSON pointer.")}else if(Array.isArray(d)){for(const f of d)if(typeof f!="string"&&typeof f!="number")throw new Error("Invalid JSON pointer. Must be of type string or number.");return d}throw new Error("Invalid JSON pointer.")}function o(d,f){if(typeof d!="object")throw new Error("Invalid input object.");f=s(f);var u=f.length;if(u===1)return d;for(var h=1;h<u;){if(d=d[r(f[h++])],u===h)return d;if(typeof d!="object"||d===null)return}}function a(d,f,u){if(typeof d!="object")throw new Error("Invalid input object.");if(f=s(f),f.length===0)throw new Error("Invalid JSON pointer for set.");return i(d,f,u)}function l(d){var f=s(d);return{get:function(u){return o(u,f)},set:function(u,h){return a(u,f,h)}}}return an.get=o,an.set=a,an.compile=l,an}var ug=cg();const Ir=mi(ug);function dg(t,e){return t&&Zt(e,Pe(e),t)}function fg(t,e){return t&&Zt(e,Dn(e),t)}function mg(t,e){return Zt(t,Ci(t),e)}var hg=Object.getOwnPropertySymbols,Za=hg?function(t){for(var e=[];t;)Ai(e,Ci(t)),t=sr(t);return e}:va;function pg(t,e){return Zt(t,Za(t),e)}function Ui(t){return ba(t,Dn,Za)}var gg=Object.prototype,yg=gg.hasOwnProperty;function xg(t){var e=t.length,n=new t.constructor(e);return e&&typeof t[0]=="string"&&yg.call(t,"index")&&(n.index=t.index,n.input=t.input),n}function bg(t,e){var n=e?Mi(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}var vg=/\w*$/;function Sg(t){var e=new t.constructor(t.source,vg.exec(t));return e.lastIndex=t.lastIndex,e}var no=Ne?Ne.prototype:void 0,ro=no?no.valueOf:void 0;function wg(t){return ro?Object(ro.call(t)):{}}var jg="[object Boolean]",Og="[object Date]",Ag="[object Map]",Cg="[object Number]",_g="[object RegExp]",Ng="[object Set]",Tg="[object String]",Fg="[object Symbol]",Pg="[object ArrayBuffer]",Eg="[object DataView]",Ig="[object Float32Array]",Dg="[object Float64Array]",$g="[object Int8Array]",kg="[object Int16Array]",Mg="[object Int32Array]",Rg="[object Uint8Array]",Bg="[object Uint8ClampedArray]",Ug="[object Uint16Array]",Lg="[object Uint32Array]";function Wg(t,e,n){var r=t.constructor;switch(e){case Pg:return Mi(t);case jg:case Og:return new r(+t);case Eg:return bg(t,n);case Ig:case Dg:case $g:case kg:case Mg:case Rg:case Bg:case Ug:case Lg:return La(t,n);case Ag:return new r;case Cg:case Tg:return new r(t);case _g:return Sg(t);case Ng:return new r;case Fg:return wg(t)}}var Vg="[object Map]";function zg(t){return Te(t)&&Ce(t)==Vg}var io=Kt&&Kt.isMap,qg=io?Ni(io):zg,Kg="[object Set]";function Gg(t){return Te(t)&&Ce(t)==Kg}var so=Kt&&Kt.isSet,Hg=so?Ni(so):Gg,Yg=1,Xg=2,Jg=4,Qa="[object Arguments]",Zg="[object Array]",Qg="[object Boolean]",ey="[object Date]",ty="[object Error]",el="[object Function]",ny="[object GeneratorFunction]",ry="[object Map]",iy="[object Number]",tl="[object Object]",sy="[object RegExp]",oy="[object Set]",ay="[object String]",ly="[object Symbol]",cy="[object WeakMap]",uy="[object ArrayBuffer]",dy="[object DataView]",fy="[object Float32Array]",my="[object Float64Array]",hy="[object Int8Array]",py="[object Int16Array]",gy="[object Int32Array]",yy="[object Uint8Array]",xy="[object Uint8ClampedArray]",by="[object Uint16Array]",vy="[object Uint32Array]",ae={};ae[Qa]=ae[Zg]=ae[uy]=ae[dy]=ae[Qg]=ae[ey]=ae[fy]=ae[my]=ae[hy]=ae[py]=ae[gy]=ae[ry]=ae[iy]=ae[tl]=ae[sy]=ae[oy]=ae[ay]=ae[ly]=ae[yy]=ae[xy]=ae[by]=ae[vy]=!0;ae[ty]=ae[el]=ae[cy]=!1;function mn(t,e,n,r,i,s){var o,a=e&Yg,l=e&Xg,d=e&Jg;if(n&&(o=i?n(t,r,i,s):n(t)),o!==void 0)return o;if(!Z(t))return t;var f=ye(t);if(f){if(o=xg(t),!a)return Ri(t,o)}else{var u=Ce(t),h=u==el||u==ny;if(_t(t))return Ua(t,a);if(u==tl||u==Qa||h&&!i){if(o=l||h?{}:Wa(t),!a)return l?pg(t,fg(o,t)):mg(t,dg(o,t))}else{if(!ae[u])return i?t:{};o=Wg(t,u,a)}}s||(s=new Ee);var g=s.get(t);if(g)return g;s.set(t,o),Hg(t)?t.forEach(function(y){o.add(mn(y,e,n,y,t,s))}):qg(t)&&t.forEach(function(y,x){o.set(x,mn(y,e,n,x,t,s))});var m=d?l?Ui:Xr:l?Dn:Pe,p=f?void 0:m(t);return $i(p||t,function(y,x){p&&(x=y,y=t[x]),Ii(o,x,mn(y,e,n,x,t,s))}),o}function nl(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}function Sy(t,e,n){var r=-1,i=t.length;e<0&&(e=-e>i?0:i+e),n=n>i?i:n,n<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var s=Array(i);++r<i;)s[r]=t[r+e];return s}function wy(t,e){return e.length<2?t:ur(t,Sy(e,0,-1))}var jy=Object.prototype,Oy=jy.hasOwnProperty;function rl(t,e){e=Jt(e,t);var n=-1,r=e.length;if(!r)return!0;for(var i=t==null||typeof t!="object"&&typeof t!="function";++n<r;){var s=e[n];if(typeof s=="string"){if(s==="__proto__"&&!Oy.call(t,"__proto__"))return!1;if(s==="constructor"&&n+1<r&&typeof e[n+1]=="string"&&e[n+1]==="prototype"){if(i&&n===0)continue;return!1}}}var o=wy(t,e);return o==null||delete o[Et(nl(e))]}function Ay(t){return gt(t)?void 0:t}function ni(t){var e=t==null?0:t.length;return e?$n(t,1):[]}function il(t){return qa(za(t,void 0,ni),t+"")}var Cy=1,_y=2,Ny=4,wn=il(function(t,e){var n={};if(t==null)return n;var r=!1;e=Xt(e,function(s){return s=Jt(s,t),r||(r=s.length>1),s}),Zt(t,Ui(t),n),r&&(n=mn(n,Cy|_y|Ny,Ay));for(var i=e.length;i--;)rl(n,e[i]);return n}),Ty=$c();const Li=mi(Ty);function nr(t,e){if(oe in t&&Li.equal(t[oe],e))return t;for(const n of Object.values(t))if(Array.isArray(n)){for(const r of n)if(Z(r)){const i=nr(r,e);if(i!==void 0)return i}}else if(Z(n)){const r=nr(n,e);if(r!==void 0)return r}}function ri(t,e){const n=I(t,oe,e);ce in t&&(t={...t,[ce]:Li.resolve(n,t[ce])});for(const[r,i]of Object.entries(t))Array.isArray(i)?t={...t,[r]:i.map(s=>Z(s)?ri(s,n):s)}:Z(i)&&(t={...t,[r]:ri(i,n)});return t}function Wi(t,e){const n=e[t];return[wn(e,[t]),n]}function sl(t,e={},n=[],r=I(e,[oe])){const i=t||"";let s;if(i.startsWith("#")){const a=decodeURIComponent(i.substring(1));r===void 0||oe in e&&e[oe]===r?s=Ir.get(e,a):e[cn]===Kn&&(s=nr(e,r.replace(/\/$/,"")),s!==void 0&&(s=Ir.get(s,a)))}else if(e[cn]===Kn){const a=r?Li.resolve(r,i):i,[l,...d]=a.replace(/#\/?$/,"").split("#");s=nr(e,l.replace(/\/$/,"")),s!==void 0&&(r=s[oe],me(d)||(s=Ir.get(s,decodeURIComponent(d.join("#")))))}if(s===void 0)throw new Error(`Could not find a definition for ${t}.`);const o=s[ce];if(o){if(n.includes(o)){if(n.length===1)throw new Error(`Definition for ${t} is a circular reference`);const[f,...u]=n,h=[...u,i,f].join(" -> ");throw new Error(`Definition for ${f} contains a circular reference through ${h}`)}const[a,l]=Wi(ce,s),d=sl(l,e,[...n,i],r);return Object.keys(a).length>0?e[cn]===zd||e[cn]===Kn?{[pt]:[a,d]}:{...a,...d}:d}return s}function ol(t,e={},n=I(e,[oe])){return sl(t,e,[],n)}var Fy="[object String]";function yt(t){return typeof t=="string"||!ye(t)&&Te(t)&&nt(t)==Fy}function Ge(t){let e;const n=I(t,Ld);return yt(n)?e=n:n!==void 0&&console.warn(`Expecting discriminator to be a string, got "${typeof n}" instead`),e}function jn(t){return Array.isArray(t)?"array":typeof t=="string"?"string":t==null?"null":typeof t=="boolean"?"boolean":isNaN(t)?typeof t=="object"?"object":"string":"number"}var Py=fr(function(t){return Ga($n(t,1,Sn,!0))});function Ie(t){let{type:e}=t;return!e&&t.const?jn(t.const):!e&&t.enum?"string":!e&&(t.properties||t.additionalProperties||t.patternProperties)?"object":(Array.isArray(e)&&(e.length===2&&e.includes("null")?e=e.find(n=>n!=="null"):e=e[0]),e)}function tt(t,e){const n=Object.assign({},t);return Object.keys(e).reduce((r,i)=>{const s=t?t[i]:{},o=e[i];return t&&i in t&&Y(o)?r[i]=tt(s,o):t&&e&&(Ie(t)==="object"||Ie(e)==="object")&&i===ca&&Array.isArray(s)&&Array.isArray(o)?r[i]=Py(s,o):r[i]=o,r},n)}var Ey="[object Number]";function al(t){return typeof t=="number"||Te(t)&&nt(t)==Ey}function ll(t,e,n){var r;if(t&&n){const i=I(t,n);if(i===void 0)return;for(let s=0;s<e.length;s++){const o=e[s],a=I(o,[te,n],{});if(!(a.type==="object"||a.type==="array")&&(a.const===i||!((r=a.enum)===null||r===void 0)&&r.includes(i)))return s}}}function Vi(t,e,n,r,i){if(e===void 0)return 0;const s=ll(e,n,i);if(al(s))return s;for(let o=0;o<n.length;o++){const a=n[o];if(i&&X(a,[te,i])){const l=I(e,i),d=I(a,[te,i],{});if(t.isValid(d,l,r))return o}else if(a[te]){const l={anyOf:Object.keys(a[te]).map(f=>({required:[f]}))};let d;if(a.anyOf){const{...f}=a;f.allOf?f.allOf=f.allOf.slice():f.allOf=[],f.allOf.push(l),d=f}else d=Object.assign({},a,l);if(delete d.required,t.isValid(d,e,r))return o}else if(t.isValid(a,e,r))return o}return 0}function ve(t,e,n={},r,i,s=!1){return Ve(t,e,n,r,void 0,void 0,i,s)[0]}function Iy(t,e,n,r,i,s,o){const{if:a,then:l,else:d,...f}=e,u=t.isValid(a,s||{},n);let h=[f],g=[];if(r)l&&typeof l!="boolean"&&(g=g.concat(Ve(t,l,n,s,r,i,o))),d&&typeof d!="boolean"&&(g=g.concat(Ve(t,d,n,s,r,i,o)));else{const m=u?l:d;m&&typeof m!="boolean"&&(g=g.concat(Ve(t,m,n,s,r,i,o)))}return g.length&&(h=g.map(m=>tt(f,m))),h.flatMap(m=>Ve(t,m,n,s,r,i,o))}function cl(t){return t.reduce((n,r)=>r.length>1?r.flatMap(i=>Ea(n.length,s=>[...n[s]].concat(i))):(n.forEach(i=>i.push(r[0])),n),[[]])}function ul(t,e){return Object.keys(t.patternProperties).filter(n=>RegExp(n).test(e)).reduce((n,r)=>(se(n,[r],t.patternProperties[r]),n),{})}function Dy(t,e,n,r,i,s,o,a){const l=dl(t,e,n,r,i,s,o,a);if(l.length>1||l[0]!==e)return l;if(vi in e)return fl(t,e,n,r,i,s,o).flatMap(f=>Ve(t,f,n,s,r,i,o));if(pt in e&&Array.isArray(e[pt])){const d=e.allOf.map(u=>Ve(t,u,n,s,r,i,o));return cl(d).map(u=>({...e,allOf:u}))}return[e]}function dl(t,e,n,r,i,s,o,a){const l=Vt(e,n,i,void 0,a);return l!==e?Ve(t,l,n,s,r,i,o,a):[e]}function Vt(t,e,n,r,i){if(!Y(t))return t;let s=t;if(ce in s){const{$ref:o,...a}=s;if(n.includes(o))return s;n.push(o),s={...ol(o,e,r),...a},oe in s&&(r=s[oe])}if(te in s){const o=[],a=lp(s[te],(l,d,f)=>{const u=[...n];l[f]=Vt(d,e,u,r,i),o.push(u)},{});Ap(n,Ha(Np(o))),s={...s,[te]:a}}if(zt in s&&!Array.isArray(s.items)&&typeof s.items!="boolean"&&(s={...s,items:Vt(s.items,e,n,r,i)}),i){let o,a;J in t&&Array.isArray(t[J])?(o=J,a=s[J]):q in t&&Array.isArray(t[q])&&(o=q,a=s[q]),o&&a&&(s={...s,[o]:a.map(l=>Vt(l,e,n,r,i))})}return le(t,s)?t:s}function $y(t,e,n,r,i){const s={...e,properties:{...e.properties}},o=r&&Y(r)?r:{};return Object.keys(o).forEach(a=>{if(!(a in s.properties)){if(Gr in s){const l=ul(s,a);if(!me(l)){s.properties[a]=ve(t,{[pt]:Object.values(l)},n,I(o,[a]),i),se(s.properties,[a,et],!0);return}}if(Zn in s&&s.additionalProperties!==!1){let l;typeof s.additionalProperties!="boolean"?ce in s.additionalProperties?l=ve(t,{[ce]:I(s.additionalProperties,[ce])},n,o,i):"type"in s.additionalProperties?l={...s.additionalProperties}:J in s.additionalProperties||q in s.additionalProperties?l={type:"object",...s.additionalProperties}:l={type:jn(I(o,[a]))}:l={type:jn(I(o,[a]))},s.properties[a]=l,se(s.properties,[a,et],!0)}else s.properties[a]={type:"null"},se(s.properties,[a,et],!0)}}),s}const{compareSchemaDefinitions:ky,compareSchemaValues:My}=Jp(),{mergeArrayOfSchemaDefinitions:Ry}=og({intersectJson:qp(My),deduplicateJsonSchemaDef:Ya(ky)}),By=lg(Ry);function Uy(t){return By(t)}function Ve(t,e,n,r,i=!1,s=[],o,a){return Y(e)?Dy(t,e,n,i,s,r,o,a).flatMap(d=>{var f;let u=d;if(Si in u)return Iy(t,u,n,i,s,r,o);if(pt in u){if(i){const{allOf:g,...m}=u;return[...g,m]}try{const g=[],m=[];(f=u.allOf)===null||f===void 0||f.forEach(p=>{typeof p=="object"&&p.contains?g.push(p):m.push(p)}),g.length&&(u={...u,allOf:m}),u=o?o(u):Uy(u),g.length&&(u.allOf=g)}catch(g){console.warn(`could not merge subschemas in allOf:
|
|
2
|
+
`,g);const{allOf:m,...p}=u;return p}}return te in u&&Gr in u&&(u=Object.keys(u.properties).reduce((g,m)=>{const p=ul(g,m);return me(p)||(g.properties[m]=ve(t,{allOf:[g.properties[m],...Object.values(p)]},n,I(r,[m]),o)),g},{...u,properties:{...u.properties}})),Gr in u||Zn in u&&u.additionalProperties!==!1?$y(t,u,n,r,o):u}):[{}]}function Ly(t,e,n,r,i){let s;const{oneOf:o,anyOf:a,...l}=e;if(Array.isArray(o)?s=o:Array.isArray(a)&&(s=a),s){const d=i===void 0&&r?{}:i,f=Ge(e);s=s.map(h=>Vt(h,n,[]));const u=Vi(t,d,s,n,f);if(r)return s.map(h=>tt(l,h));e=tt(l,s[u])}return[e]}function fl(t,e,n,r,i,s,o){const{dependencies:a,...l}=e;return Ly(t,l,n,r,s).flatMap(f=>ml(t,a,f,n,r,i,s,o))}function ml(t,e,n,r,i,s,o,a){let l=[n];for(const d in e){if(!i&&I(o,[d])===void 0||n.properties&&!(d in n.properties))continue;const[f,u]=Wi(d,e);return Array.isArray(u)?l[0]=Wy(n,u):Y(u)&&(l=Vy(t,n,r,d,u,i,s,o,a)),l.flatMap(h=>ml(t,f,h,r,i,s,o,a))}return l}function Wy(t,e){if(!e)return t;const n=Array.isArray(t.required)?Array.from(new Set([...t.required,...e])):e;return{...t,required:n}}function Vy(t,e,n,r,i,s,o,a,l){return Ve(t,i,n,a,s,o,l).flatMap(f=>{const{oneOf:u,...h}=f;if(e=tt(e,h),u===void 0)return e;const g=u.map(p=>typeof p=="boolean"||!(ce in p)?[p]:dl(t,p,n,s,o,a));return cl(g).flatMap(p=>zy(t,e,n,r,p,s,o,a,l))})}function zy(t,e,n,r,i,s,o,a,l){const d=i.filter(f=>{if(typeof f=="boolean"||!f||!f.properties)return!1;const{[r]:u}=f.properties;if(u){const h={type:"object",properties:{[r]:u}};return t.isValid(h,a,n)||s}return!1});return!s&&d.length!==1?(console.warn("ignoring oneOf in dependencies because there isn't exactly one subschema that is valid"),[e]):d.flatMap(f=>{const u=f,[h]=Wi(r,u.properties),g={...u,properties:h};return Ve(t,g,n,a,s,o,l).map(p=>tt(e,p))})}function dn(t,e,n,r,i,s={},o){if(Array.isArray(n[i])){const l=Ge(n)||r,d=n[i].map(u=>ve(t,u,e,s,o)),f=I(s,l);if(f!==void 0)return d.find(u=>dt(I(u,[te,l,ir],I(u,[te,l,_e])),f))}}function hl(t,e,n,r,i){let s=n;if(X(n,ce)&&(s=ve(t,n,e,void 0,i)),me(r))return s;const o=Array.isArray(r)?r:r.split("."),[a,...l]=o;if(a&&X(s,a))return s=I(s,a),hl(t,e,s,l,i)}function Yn(t,e,n,r,i,s){const o=hl(t,e,n,r,s);return o===void 0?i:o}const oo={title:"!@#$_UNKNOWN_$#@!"};function qy(t,e,n,r,i={},s){const o=Array.isArray(r)?[...r]:r.split(".");let a=n;const l=o.pop();o.length&&o.forEach(h=>{a=Yn(t,e,a,[te,h],{},s),X(a,q)?a=dn(t,e,a,l,q,I(i,h),s):X(a,J)&&(a=dn(t,e,a,l,J,I(i,h),s))}),X(a,q)?a=dn(t,e,a,l,q,i,s):X(a,J)&&(a=dn(t,e,a,l,J,i,s));let d=Yn(t,e,a,[te,l],oo,s);d===oo&&(d=void 0);const f=Yn(t,e,a,ca,[],s);let u;return d&&Array.isArray(f)&&(u=f.includes(l)),{field:d,isRequired:u}}function Ky(t,e,n,r){var i=-1,s=t==null?0:t.length;for(r&&s&&(n=t[++i]);++i<s;)n=e(n,t[i],i,t);return n}function Gy(t,e){return function(n,r){if(n==null)return n;if(!Pt(n))return t(n,r);for(var i=n.length,s=-1,o=Object(n);++s<i&&r(o[s],s,o)!==!1;);return n}}var pl=Gy($a);function Hy(t,e,n,r,i){return i(t,function(s,o,a){n=r?(r=!1,s):e(n,s,o,a)}),n}function Yy(t,e,n){var r=ye(t)?Ky:Hy,i=arguments.length<3;return r(t,ki(e),n,i,pl)}const Xy={type:"object",$id:Ud,properties:{__not_really_there__:{type:"number"}}};function ii(t,e,n,r,i){let s=0;return n&&(Z(n.properties)?s+=Yy(n.properties,(o,a,l)=>{const d=I(r,l);if(typeof a=="boolean")return o;if(X(a,ce)){const f=ve(t,a,e,d,i);return o+ii(t,e,f,d||{},i)}if((X(a,q)||X(a,J))&&d){const f=X(a,q)?q:J,u=Ge(a);return o+On(t,e,d,I(a,f),-1,u,i)}if(a.type==="object")return Z(d)&&(o+=1),o+ii(t,e,a,d,i);if(a.type===jn(d)){let f=o+1;return a.default?f+=d===a.default?1:-1:a.const&&(f+=d===a.const?1:-1),f}return o},0):yt(n.type)&&n.type===jn(r)&&(s+=1)),s}function On(t,e,n,r,i=-1,s,o){const a=r.map(h=>Vt(h,e,[])),l=ll(n,r,s);if(al(l))return l;const d=a.reduce((h,g,m)=>(Vi(t,n,[Xy,g],e,s)===1&&h.push(m),h),[]);if(d.length===1)return d[0];d.length||Ea(a.length,h=>d.push(h));const f=new Set,{bestIndex:u}=d.reduce((h,g)=>{const{bestScore:m}=h,p=a[g],y=ii(t,e,p,n,o);return f.add(y),y>m?{bestIndex:g,bestScore:y}:h},{bestIndex:i,bestScore:0});return f.size===1&&i>=0?i:u}function zi(t){return Array.isArray(t.items)&&t.items.length>0&&t.items.every(e=>Y(e))}function rr(t){return t==null}function An(t,e,n=!1,r=!1,i=!1){if(Array.isArray(e)){const s=Array.isArray(t)?t:[],o=i?s:e,a=i?e:s,l=o.map((d,f)=>a[f]!==void 0?An(s[f],e[f],n,r,i):d);return(n||i)&&l.length<a.length&&l.push(...a.slice(l.length)),l}if(Y(e)){const s=Object.assign({},t);return Object.keys(e).reduce((o,a)=>{var l;const d=I(e,a),f=Y(t)&&a in t,u=a in e,h=(l=I(t,a))!==null&&l!==void 0?l:{},g=f&&Object.entries(h).some(([,y])=>Y(y)),m=f&&Y(I(t,a)),p=u&&Y(d);return m&&p&&!g?(o[a]={...I(t,a),...d},o):(o[a]=An(I(t,a),d,n,r,i&&(f||!u)),o)},s)}return r&&(t!==void 0&&rr(e)||typeof e=="number"&&isNaN(e))||i&&!rr(e)?t:e}function Cn(t,e,n=!1){return Object.keys(e).reduce((r,i)=>{const s=t?t[i]:{},o=e[i];if(t&&i in t&&Y(o))r[i]=Cn(s,o,n);else if(n&&Array.isArray(s)&&Array.isArray(o)){let a=o;n==="preventDuplicates"&&(a=o.reduce((l,d)=>(s.includes(d)||l.push(d),l),[])),r[i]=s.concat(a)}else r[i]=o;return r},Object.assign({},t))}function gl(t){return Array.isArray(t.enum)&&t.enum.length===1||_e in t}function qi(t,e,n={},r){const i=ve(t,e,n,void 0,r),s=i.oneOf||i.anyOf;return Array.isArray(i.enum)?!0:Array.isArray(s)?s.every(o=>typeof o!="boolean"&&gl(o)):!1}function Ki(t,e,n,r){return!e.uniqueItems||!e.items||typeof e.items=="boolean"?!1:qi(t,e.items,n,r)}function yl(t){const e=t[_e],n=Ie(t);return Y(e)&&yt(e?.$data)&&n!=="object"&&n!=="array"}function Jy(t){if(Bd in t&&Array.isArray(t.enum)&&t.enum.length===1)return t.enum[0];if(_e in t)return t.const;throw new Error("schema cannot be inferred as a constant")}function Gt(t,e){if(t.enum){let s;if(e){const{enumNames:o}=U(e);s=o}return t.enum.map((o,a)=>({label:s?.[a]||String(o),value:o}))}let n,r;t.anyOf?(n=t.anyOf,r=e?.anyOf):t.oneOf&&(n=t.oneOf,r=e?.oneOf);let i=Ge(t);if(e){const{optionsSchemaSelector:s=i}=U(e);i=s}return n&&n.map((s,o)=>{const{title:a}=U(r?.[o]),l=s;let d,f=a;if(i){const u=I(l,[te,i],{});d=I(u,ir,I(u,_e)),f=f||u?.title||l.title||String(d)}else d=Jy(l),f=f||l.title||String(d);return{schema:l,label:f,value:d}})}const Zy=["string","number","integer","boolean","null"];var Ht;(function(t){t[t.Ignore=0]="Ignore",t[t.Invert=1]="Invert",t[t.Fallback=2]="Fallback"})(Ht||(Ht={}));function Dr(t,e=Ht.Ignore,n=-1){if(n>=0){if(Array.isArray(t.items)&&n<t.items.length){const r=t.items[n];if(typeof r!="boolean")return r}}else if(t.items&&!Array.isArray(t.items)&&typeof t.items!="boolean")return t.items;return e!==Ht.Ignore&&Y(t.additionalItems)?t.additionalItems:{}}function xl(t,e){const{default:n,type:r}=t;return Array.isArray(r)&&r.includes("null")&&me(e)&&n===null?null:e}function ao(t,e,n,r,i,s=[],o={},a=!1,l=!1){const{emptyObjectFields:d="populateAllDefaults"}=o;if(r===!0||a)t[e]=n;else if(r==="excludeObjectChildren")(l&&n!==void 0||!Y(n)||!me(n))&&(t[e]=n);else if(d!=="skipDefaults"){const f=i===void 0?s.includes(e):i;Y(n)?d==="skipEmptyDefaults"?me(n)||(t[e]=n):(!me(n)||s.includes(e))&&(f||d!=="populateRequiredDefaults")&&(t[e]=n):n!==void 0&&(d==="populateAllDefaults"||d==="skipEmptyDefaults"||f&&s.includes(e))&&(t[e]=n)}}function ft(t,e,n={}){const{parentDefaults:r,rawFormData:i,rootSchema:s={},includeUndefinedValues:o=!1,_recurseList:a=[],experimental_defaultFormStateBehavior:l=void 0,experimental_customMergeAllOf:d=void 0,required:f,shouldMergeDefaultsIntoFormData:u=!1,initialDefaultsGenerated:h}=n;let g=Y(i)?i:{};const m=Y(e)?e:{};let p=r,y=null,x=l,S=a;if(m[_e]!==void 0&&l?.constAsDefaults!=="never"&&!yl(m))p=m[_e];else if(Y(p)&&Y(m.default)&&!m[J]&&!m[q]&&!m[ce])p=Cn(p,m.default);else if(ir in m&&!m[J]&&!m[q]&&!m[ce])p=m.default;else if(ce in m){const v=m[ce];a.includes(v)||(S=a.concat(v),y=ol(v,s));const w=i===void 0||Y(i)&&me(i);y&&!p&&w&&(p=m.default),u&&y&&!Y(i)&&(g=i)}else if(vi in m){const v={...lo(t,m,n,p),...g};y=fl(t,m,s,!1,[],v,d)[0]}else if(zi(m))p=m.items.map((v,w)=>ft(t,v,{rootSchema:s,includeUndefinedValues:o,_recurseList:a,experimental_defaultFormStateBehavior:l,experimental_customMergeAllOf:d,parentDefaults:Array.isArray(r)?r[w]:void 0,rawFormData:g,required:f,shouldMergeDefaultsIntoFormData:u}));else if(q in m){const{oneOf:v,...w}=m;if(v.length===0)return;const j=Ge(m),{type:A="null"}=w;!Array.isArray(A)&&Zy.includes(A)&&x?.constAsDefaults==="skipOneOf"&&(x={...x,constAsDefaults:"never"}),y=v[On(t,s,i??m.default,v,0,j,d)],y=tt(w,y)}else if(J in m){const{anyOf:v,...w}=m;if(v.length===0)return;const j=Ge(m);y=v[On(t,s,i??m.default,v,0,j,d)],y=tt(w,y)}if(y)return ft(t,y,{rootSchema:s,includeUndefinedValues:o,_recurseList:S,experimental_defaultFormStateBehavior:x,experimental_customMergeAllOf:d,parentDefaults:p,rawFormData:i??g,required:f,shouldMergeDefaultsIntoFormData:u,initialDefaultsGenerated:h});p===void 0&&(p=m.default);const O=lo(t,m,n,p);let b=O??p;if(u){const{arrayMinItems:v={}}=l||{},{mergeExtraDefaults:w}=v,j=Qy(t,m,s,i,l,d);(!Y(i)||pt in m)&&(b=An(b,j,w,!0))}return b}function Qy(t,e,n,r,i,s){const o=!gl(e)&&qi(t,e,n,s);let a=r;if(o){const d=Gt(e);a=d?.some(u=>le(u.value,r))?r:void 0}return e[_e]&&i?.constAsDefaults==="always"&&(a=e.const),a}function ex(t,e,{rawFormData:n,rootSchema:r={},includeUndefinedValues:i=!1,_recurseList:s=[],experimental_defaultFormStateBehavior:o=void 0,experimental_customMergeAllOf:a=void 0,required:l,shouldMergeDefaultsIntoFormData:d,initialDefaultsGenerated:f}={},u){{const h=Y(n)?n:{},g=e,p=o?.allOf==="populateDefaults"&&pt in g||o?.emptyObjectFields!=="skipEmptyDefaults"&&Si in g?ve(t,g,r,h,a):g,y=p[_e],x=Object.keys(p.properties||{}).reduce((S,O)=>{var b;const v=I(p,[te,O],{}),w=Y(y)&&y[O]!==void 0,j=(Y(v)&&_e in v||w)&&o?.constAsDefaults!=="never"&&!yl(v),A=ft(t,v,{rootSchema:r,_recurseList:s,experimental_defaultFormStateBehavior:o,experimental_customMergeAllOf:a,includeUndefinedValues:i===!0,parentDefaults:I(u,[O]),rawFormData:I(h,[O]),required:(b=p.required)===null||b===void 0?void 0:b.includes(O),shouldMergeDefaultsIntoFormData:d,initialDefaultsGenerated:f});return ao(S,O,A,i,l,p.required,o,j,v?.type==="null"),S},{});if(p.additionalProperties&&!f){const S=Y(p.additionalProperties)?p.additionalProperties:{},O=new Set;Y(u)&&Object.keys(u).filter(v=>!p.properties||!p.properties[v]).forEach(v=>O.add(v));const b=[];Object.keys(h).filter(v=>!p.properties||!p.properties[v]).forEach(v=>{O.add(v),b.push(v)}),O.forEach(v=>{var w;const j=ft(t,S,{rootSchema:r,_recurseList:s,experimental_defaultFormStateBehavior:o,experimental_customMergeAllOf:a,includeUndefinedValues:i===!0,parentDefaults:I(u,[v]),rawFormData:I(h,[v]),required:(w=p.required)===null||w===void 0?void 0:w.includes(v),shouldMergeDefaultsIntoFormData:d,initialDefaultsGenerated:f});ao(x,v,j,i,l,b)})}return xl(e,x)}}function tx(t,e,{rawFormData:n,rootSchema:r={},_recurseList:i=[],experimental_defaultFormStateBehavior:s=void 0,experimental_customMergeAllOf:o=void 0,required:a,requiredAsRoot:l=!1,shouldMergeDefaultsIntoFormData:d,initialDefaultsGenerated:f}={},u){var h,g;const m=e,p=(h=s?.arrayMinItems)!==null&&h!==void 0?h:{},{populate:y,mergeExtraDefaults:x}=p,S=y==="never",O=y==="requiredOnly",b=y==="all"||!S&&!O,v=(g=p?.computeSkipPopulate)!==null&&g!==void 0?g:(()=>!1),j=s?.emptyObjectFields==="skipEmptyDefaults"?void 0:[];if(Array.isArray(u)&&(u=u.map((N,_)=>{const F=Dr(m,Ht.Fallback,_),$=Array.isArray(n)?n[_]:void 0;return ft(t,F,{rootSchema:r,_recurseList:i,experimental_defaultFormStateBehavior:s,experimental_customMergeAllOf:o,parentDefaults:N,rawFormData:$,required:a,shouldMergeDefaultsIntoFormData:d,initialDefaultsGenerated:f})})),Array.isArray(n)){const N=Dr(m);if(S)u=n;else{const _=n.map(($,E)=>ft(t,N,{rootSchema:r,_recurseList:i,experimental_defaultFormStateBehavior:s,experimental_customMergeAllOf:o,rawFormData:$,parentDefaults:I(u,[E]),required:a,shouldMergeDefaultsIntoFormData:d,initialDefaultsGenerated:f}));u=An(u,_,(O&&a||b)&&x)}}if((Y(m)&&_e in m&&s?.constAsDefaults!=="never")===!1){if(S)return u??j;if(O&&!a)return u||void 0}let C;const T=Array.isArray(u)?u.length:0;if(!m.minItems||Ki(t,m,r,o)||v(t,m,r)||m.minItems<=T)C=u||!a&&!l?u:j;else{const N=u||[],_=Dr(m,Ht.Invert),F=_.default,$=Array.from({length:m.minItems-T},()=>ft(t,_,{parentDefaults:F,rootSchema:r,_recurseList:i,experimental_defaultFormStateBehavior:s,experimental_customMergeAllOf:o,required:a,shouldMergeDefaultsIntoFormData:d}));C=N.concat($)}return xl(e,C)}function lo(t,e,n={},r){switch(Ie(e)){case"object":return ex(t,e,n,r);case"array":return tx(t,e,n,r)}}function bl(t,e,n,r,i=!1,s,o,a){if(!Y(e))throw new Error("Invalid schema: "+e);const l=ve(t,e,r,n,o),d=ft(t,l,{rootSchema:r,includeUndefinedValues:i,experimental_defaultFormStateBehavior:s,experimental_customMergeAllOf:o,rawFormData:n,shouldMergeDefaultsIntoFormData:!0,initialDefaultsGenerated:a,requiredAsRoot:!0});if(l.type!=="object"&&Y(l.default))return{...d,...n};if(Y(n)||Array.isArray(n)){const{mergeDefaultsIntoFormData:f}=s||{};return An(d,n,!0,f==="useDefaultIfFormDataUndefined",!0)}return d}function vl(t={}){return"widget"in U(t)&&U(t).widget!=="hidden"}function Sl(t,e,n={},r,i){if(n[ji]==="files")return!0;if(e.items){const s=ve(t,e.items,r,void 0,i);return s.type==="string"&&s.format==="data-url"}return!1}function nx(t,e,n={},r,i,s){const o=U(n,i),{label:a=!0}=o;let l=!!a;if(l){const d=Ie(e),f=I(e,et,!1);d==="array"&&(l=f||Ki(t,e,r,s)||Sl(t,e,n,r,s)||vl(n)),d==="object"&&(l=f),d==="boolean"&&n&&!n[ji]&&(l=!1),n&&n[Vd]&&(l=!1)}return l}function wl(t,e,n){for(var r=-1,i=e.length,s={};++r<i;){var o=e[r],a=ur(t,o);n(a,o)&&Di(s,Jt(o,t),a)}return s}function rx(t,e){return wl(t,e,function(n,r){return Ra(t,r)})}var Gi=il(function(t,e){return t==null?{}:rx(t,e)});function St(t,e,n,r,i,s=[],o){if(ce in e||vi in e||pt in e||Si in e){const l=ve(t,e,r,i,o);if(s.findIndex(f=>le(f,l))===-1)return St(t,l,n,r,i,s.concat(l),o)}let a={[qn]:n.replace(/^\./,"")};if(q in e||J in e){const l=q in e?e.oneOf:e.anyOf,d=Ge(e),f=On(t,r,i,l,0,d,o),u=l[f];a={...a,...St(t,u,n,r,i,s,o)}}if(Zn in e&&e[Zn]!==!1&&se(a,wi,!0),zt in e&&Array.isArray(i)){const{items:l,additionalItems:d}=e;Array.isArray(l)?i.forEach((f,u)=>{l[u]?a[u]=St(t,l[u],`${n}.${u}`,r,f,s,o):d?a[u]=St(t,d,`${n}.${u}`,r,f,s,o):console.warn(`Unable to generate path schema for "${n}.${u}". No schema defined for it`)}):i.forEach((f,u)=>{a[u]=St(t,l,`${n}.${u}`,r,f,s,o)})}else if(te in e)for(const l in e.properties){const d=I(e,[te,l],{});a[l]=St(t,d,`${n}.${l}`,r,I(i,[l]),s,o)}return a}function jl(t,e,n="",r,i,s){return St(t,e,n,r,i,void 0,s)}function Ol(t,e){if(e.length===0&&typeof t!="object")return t;const n=Gi(t,e);return Array.isArray(t)?Object.keys(n).map(r=>n[r]):n}function Al(t,e){const n=(i,s)=>typeof i!="object"||me(i)||s&&!me(i),r=(i,s=[],o=[[]])=>{const a=Object.keys(i);return a.forEach(l=>{const d=i[l];if(typeof d=="object"){const f=o.map(u=>[...u,l]);d[wi]&&d[qn]!==""?s.push(d[qn]):r(d,s,f)}else l===qn&&d!==""&&o.forEach(f=>{const u=I(e,f),h=a.length===1;(n(u,h)||Array.isArray(u)&&u.every(g=>n(g,h)))&&s.push(f)})}),s};return r(t)}function ix(t,e,n={},r){const i=ve(t,e,n,r),s=jl(t,i,"",n,r),a=Al(s,r).map(l=>Array.isArray(l)?l.join("."):l);return Ol(r,a)}const kt=Symbol("no Value");function si(t,e,n,r,i={},s){let o;if(X(n,te)){const a={};if(X(r,te)){const f=I(r,te,{});Object.keys(f).forEach(u=>{X(i,u)&&(a[u]=void 0)})}const l=Object.keys(I(n,te,{})),d={};l.forEach(f=>{const u=I(i,f);let h=I(r,[te,f],{}),g=I(n,[te,f],{});X(h,ce)&&(h=ve(t,h,e,u,s)),X(g,ce)&&(g=ve(t,g,e,u,s));const m=I(h,"type"),p=I(g,"type");if(!m||m===p)if(X(a,f)&&delete a[f],p==="object"||p==="array"&&Array.isArray(u)){const y=si(t,e,g,h,u,s);(y!==void 0||p==="array")&&(d[f]=y)}else{const y=I(g,"default",kt),x=I(h,"default",kt);y!==kt&&y!==u&&(x===u?a[f]=y:I(g,"readOnly")===!0&&(a[f]=void 0));const S=I(g,"const",kt),O=I(h,"const",kt);S!==kt&&S!==u&&(a[f]=O===u?S:void 0)}}),o={...typeof i=="string"||Array.isArray(i)?void 0:i,...a,...d}}else if(I(r,"type")==="array"&&I(n,"type")==="array"&&Array.isArray(i)){let a=I(r,"items"),l=I(n,"items");if(typeof a=="object"&&typeof l=="object"&&!Array.isArray(a)&&!Array.isArray(l)){X(a,ce)&&(a=ve(t,a,e,i,s)),X(l,ce)&&(l=ve(t,l,e,i,s));const d=I(a,"type"),f=I(l,"type");if(!d||d===f){const u=I(n,"maxItems",-1);f==="object"?o=i.reduce((h,g)=>{const m=si(t,e,l,a,g,s);return m!==void 0&&(u<0||h.length<u)&&h.push(m),h},[]):o=u>0&&i.length>u?i.slice(0,u):i}}else typeof a=="boolean"&&typeof l=="boolean"&&a===l&&(o=i)}return o}class sx{constructor(e,n,r,i){n&&n[cn]===Kn?this.rootSchema=ri(n,I(n,oe,"#")):this.rootSchema=n,this.validator=e,this.experimental_defaultFormStateBehavior=r,this.experimental_customMergeAllOf=i}getRootSchema(){return this.rootSchema}getValidator(){return this.validator}doesSchemaUtilsDiffer(e,n,r={},i){return!e||!n?!1:this.validator!==e||!le(this.rootSchema,n)||!le(this.experimental_defaultFormStateBehavior,r)||this.experimental_customMergeAllOf!==i}findFieldInSchema(e,n,r){return qy(this.validator,this.rootSchema,e,n,r,this.experimental_customMergeAllOf)}findSelectedOptionInXxxOf(e,n,r,i){return dn(this.validator,this.rootSchema,e,n,r,i,this.experimental_customMergeAllOf)}getDefaultFormState(e,n,r=!1,i){return bl(this.validator,e,n,this.rootSchema,r,this.experimental_defaultFormStateBehavior,this.experimental_customMergeAllOf,i)}getDisplayLabel(e,n,r){return nx(this.validator,e,n,this.rootSchema,r,this.experimental_customMergeAllOf)}getClosestMatchingOption(e,n,r,i){return On(this.validator,this.rootSchema,e,n,r,i,this.experimental_customMergeAllOf)}getFirstMatchingOption(e,n,r){return Vi(this.validator,e,n,this.rootSchema,r)}getFromSchema(e,n,r){return Yn(this.validator,this.rootSchema,e,n,r,this.experimental_customMergeAllOf)}isFilesArray(e,n){return Sl(this.validator,e,n,this.rootSchema,this.experimental_customMergeAllOf)}isMultiSelect(e){return Ki(this.validator,e,this.rootSchema,this.experimental_customMergeAllOf)}isSelect(e){return qi(this.validator,e,this.rootSchema,this.experimental_customMergeAllOf)}omitExtraData(e,n){return ix(this.validator,e,this.rootSchema,n)}retrieveSchema(e,n,r){return ve(this.validator,e,this.rootSchema,n,this.experimental_customMergeAllOf,r)}sanitizeDataForNewSchema(e,n,r){return si(this.validator,this.rootSchema,e,n,r,this.experimental_customMergeAllOf)}toPathSchema(e,n,r){return jl(this.validator,e,n,this.rootSchema,r,this.experimental_customMergeAllOf)}}function ox(t,e,n={},r){return new sx(t,e,n,r)}function ax(t){var e;if(t.indexOf("data:")===-1)throw new Error("File is invalid: URI must be a dataURI");const r=t.slice(5).split(";base64,");if(r.length!==2)throw new Error("File is invalid: dataURI must be base64");const[i,s]=r,[o,...a]=i.split(";"),l=o||"",d=decodeURI(((e=a.map(f=>f.split("=")).find(([f])=>f==="name"))===null||e===void 0?void 0:e[1])||"unknown");try{const f=atob(s),u=new Array(f.length);for(let g=0;g<f.length;g++)u[g]=f.charCodeAt(g);return{blob:new window.Blob([new Uint8Array(u)],{type:l}),name:d}}catch(f){throw new Error("File is invalid: "+f.message)}}function lt(t,e){let n=String(t);for(;n.length<e;)n="0"+n;return n}function Cl(t,e){if(t<=0&&e<=0)t=new Date().getFullYear()+t,e=new Date().getFullYear()+e;else if(t<0||e<0)throw new Error(`Both start (${t}) and stop (${e}) must both be <= 0 or > 0, got one of each`);if(t>e)return Cl(e,t).reverse();const n=[];for(let r=t;r<=e;r++)n.push({value:r,label:lt(r,2)});return n}function co(t,e){if(Object.is(t,e))return!0;if(t==null||e==null||typeof t!="object"||typeof e!="object")return!1;const n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(let i=0;i<n.length;i++){const s=n[i];if(!Object.prototype.hasOwnProperty.call(e,s)||!Object.is(t[s],e[s]))return!1}return!0}function lx(t,e){let n=t;if(Array.isArray(e)){const r=n.split(/(%\d)/);e.forEach((i,s)=>{const o=r.findIndex(a=>a===`%${s+1}`);o>=0&&(r[o]=i)}),n=r.join("")}return n}function cx(t,e){return lx(t,e)}function ge(t,e=[],n){if(Array.isArray(t))return t.map(s=>ge(s,e)).filter(s=>s!==n);const r=t===""||t===null?-1:Number(t),i=e[r];return i?i.value:n}function _l(t,e,n=[]){const r=ge(t,n);return Array.isArray(e)?e.filter(i=>!le(i,r)):le(r,e)?void 0:e}function kn(t,e){return Array.isArray(e)?e.some(n=>le(n,t)):le(e,t)}function Nl(t,e=[],n=!1){const r=e.map((i,s)=>kn(i.value,t)?String(s):void 0).filter(i=>typeof i<"u");return n?r:r[0]}function Tl(t,e,n=[]){const r=ge(t,n);if(!rr(r)){const i=n.findIndex(a=>r===a.value),s=n.map(({value:a})=>a);return e.slice(0,i).concat(r,e.slice(i)).sort((a,l)=>+(s.indexOf(a)>s.indexOf(l)))}return e}var ux=1,dx=4;function Hi(t){return mn(t,ux|dx)}function fx(t,e,n,r){return r=typeof r=="function"?r:void 0,t==null?t:Di(t,e,n,r)}class Fl{constructor(e){this.errorSchema={},this.resetAllErrors(e)}get ErrorSchema(){return this.errorSchema}getOrCreateErrorBlock(e){let r=Array.isArray(e)&&e.length>0||typeof e=="string"?I(this.errorSchema,e):this.errorSchema;return!r&&e&&(r={},fx(this.errorSchema,e,r,Object)),r}resetAllErrors(e){return this.errorSchema=e?Hi(e):{},this}addErrors(e,n){const r=this.getOrCreateErrorBlock(n);let i=I(r,be);return Array.isArray(i)||(i=[],r[be]=i),Array.isArray(e)?se(r,be,[...new Set([...i,...e])]):se(r,be,[...new Set([...i,e])]),this}setErrors(e,n){const r=this.getOrCreateErrorBlock(n),i=Array.isArray(e)?[...new Set([...e])]:[e];return se(r,be,i),this}clearErrors(e){const n=this.getOrCreateErrorBlock(e);return se(n,be,[]),this}}function mx(t,e){if(t==null)return{};var n=Xt(Ui(t),function(r){return[r]});return e=ki(e),wl(t,n,function(r,i){return e(r,i[0])})}var hx=200;function px(t,e,n,r){var i=-1,s=Bi,o=!0,a=t.length,l=[],d=e.length;if(!a)return l;e.length>=hx&&(s=vn,o=!1,e=new Ct(e));e:for(;++i<a;){var f=t[i],u=f;if(f=f!==0?f:0,o&&u===u){for(var h=d;h--;)if(e[h]===u)continue e;l.push(f)}else s(e,u,r)||l.push(f)}return l}var gx=fr(function(t,e){return Sn(t)?px(t,$n(e,1,Sn,!0)):[]});function uo(t,e){const n=gt(t),r=gt(e);if(t===e||!n&&!r)return[];if(n&&!r)return Pe(t);if(!n&&r)return Pe(e);{const i=Pe(mx(t,(o,a)=>!le(o,I(e,a)))),s=gx(Pe(e),Pe(t));return[...i,...s]}}function yx(t,e,n=[1900,new Date().getFullYear()+2],r="YMD"){const{day:i,month:s,year:o,hour:a,minute:l,second:d}=t,f={type:"day",range:[1,31],value:i},u={type:"month",range:[1,12],value:s},h={type:"year",range:n,value:o},g=[];switch(r){case"MDY":g.push(u,f,h);break;case"DMY":g.push(f,u,h);break;default:g.push(h,u,f)}return e&&g.push({type:"hour",range:[0,23],value:a},{type:"minute",range:[0,59],value:l},{type:"second",range:[0,59],value:d}),g}function Pl(t){const e={};return t.multipleOf&&(e.step=t.multipleOf),(t.minimum||t.minimum===0)&&(e.min=t.minimum),(t.maximum||t.maximum===0)&&(e.max=t.maximum),e}function El(t,e,n={},r=!0){const i={type:e||"text",...Pl(t)};return n.inputType?i.type=n.inputType:e||(t.type==="number"?(i.type="number",r&&i.step===void 0&&(i.step="any")):t.type==="integer"&&(i.type="number",i.step===void 0&&(i.step=1))),n.autocomplete&&(i.autoComplete=n.autocomplete),n.accept&&(i.accept=n.accept),i}const fo={props:{disabled:!1},submitText:"Submit",norender:!1};function Il(t={}){const e=U(t);if(e&&e[Qn]){const n=e[Qn];return{...fo,...n}}return fo}function L(t,e,n={}){const{templates:r}=e;if(t==="ButtonTemplates")return r[t];if(Object.hasOwn(n,t)&&typeof n[t]=="string"&&Object.hasOwn(r,n[t])){const i=n[t];return r[i]}return n[t]||r[t]}var xx=0;function Dl(t){var e=++xx;return Pi(t)+e}function Yi(){if(typeof process>"u"||I(process,"env.NODE_ENV")!=="test")return{};const t=new Map;return new Proxy({},{get(e,n){return t.has(n)||t.set(n,Dl("test-id-")),t.get(n)}})}const $r={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 bx(t){let e=I(t,"MergedWidget");if(!e){const n=t.defaultProps&&t.defaultProps.options||{};e=({options:r,...i})=>c.jsx(t,{options:{...n,...r},...i}),se(t,"MergedWidget",e)}return e}function He(t,e,n={}){const r=Ie(t);if(typeof e=="function"||e&&ms.isForwardRef(P.createElement(e))||ms.isMemo(e))return bx(e);if(typeof e!="string")throw new Error(`Unsupported widget definition: ${typeof e} in schema: ${JSON.stringify(t)}`);if(e in n){const i=n[e];return He(t,i,n)}if(typeof r=="string"){if(!(r in $r))throw new Error(`No widget for type '${r}' in schema: ${JSON.stringify(t)}`);if(e in $r[r]){const i=n[$r[r][e]];return He(t,i,n)}}throw new Error(`No widget '${e}' for type '${r}' in schema: ${JSON.stringify(t)}`)}function vx(t){let e=0;for(let n=0;n<t.length;n+=1){const r=t.charCodeAt(n);e=(e<<5)-e+r,e=e&e}return e.toString(16)}function Sx(t){const e=new Set;return JSON.stringify(t,(n,r)=>(e.add(n),r)),JSON.stringify(t,Array.from(e).sort())}function ze(t){return vx(Sx(t))}function wx(t){return ze(t)}function jx(t,e,n={}){try{return He(t,e,n),!0}catch(r){const i=r;if(i.message&&(i.message.startsWith("No widget")||i.message.startsWith("Unsupported widget")))return!1;throw r}}function It(t,e){return`${yt(t)?t:t[oe]}__${e}`}function Dt(t){return It(t,"description")}function Xi(t){return It(t,"error")}function _n(t){return It(t,"examples")}function Ji(t){return It(t,"help")}function hr(t){return It(t,"title")}function we(t,e=!1){const n=e?` ${_n(t)}`:"";return`${Xi(t)} ${Dt(t)} ${Ji(t)}${n}`}function jt(t,e){return`${t}-${e}`}function qe(t,e){return It(t,e)}function kr(t,e){return It(t,`optional${e}`)}function Qt(t){return!rr(t)&&(!Z(t)||Array.isArray(t)||!me(t))}function Ox(t,e){const{rootSchema:n,schemaUtils:r}=t;if(dt(e,n))return!0;if(ce in n){const i=r.retrieveSchema(n);return dt(e,i)}return!1}function $l(t,e,n){return e?n:t}function Ax(t){return t?new Date(t).toJSON():void 0}function Zi(t,e,n){const r=[Wd];return X(t,bs)&&r.unshift(bs),I(t,[...r,e],n)}function Cx(t,e){if(!Array.isArray(e))return t;const n=f=>f.reduce((u,h)=>(u[h]=!0,u),{}),r=f=>f.length>1?`properties '${f.join("', '")}'`:`property '${f[0]}'`,i=n(t),s=e.filter(f=>f==="*"||i[f]),o=n(s),a=t.filter(f=>!o[f]),l=s.indexOf("*");if(l===-1){if(a.length)throw new Error(`uiSchema order list does not contain ${r(a)}`);return s}if(l!==s.lastIndexOf("*"))throw new Error("uiSchema order list contains more than one wildcard item");const d=[...s];return d.splice(l,1,...a),d}function Mr(t,e=!0){if(!t)return{year:-1,month:-1,day:-1,hour:e?-1:0,minute:e?-1:0,second:e?-1:0};const n=new Date(t);if(Number.isNaN(n.getTime()))throw new Error("Unable to parse date "+t);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:e?n.getUTCHours():0,minute:e?n.getUTCMinutes():0,second:e?n.getUTCSeconds():0}}function hn(t){if(t.const||t.enum&&t.enum.length===1&&t.enum[0]===!0)return!0;if(t.anyOf&&t.anyOf.length===1)return hn(t.anyOf[0]);if(t.oneOf&&t.oneOf.length===1)return hn(t.oneOf[0]);if(t.allOf){const e=n=>hn(n);return t.allOf.some(e)}return!1}function kl(t,e,n,r="customDeep"){if(r==="always")return!0;if(r==="shallow"){const{props:o,state:a}=t;return!co(o,e)||!co(a,n)}const{props:i,state:s}=t;return!le(i,e)||!le(s,n)}function mo(t){const e=Ha(t.map(n=>Z(n)?Ie(n):void 0).flat().filter(n=>n!==void 0));return e.length===1?e[0]:e}function Mn(t,e,n,r){const{enableOptionalDataFieldForType:i=[]}=U(r,t.globalUiOptions);let s;return J in e&&Array.isArray(e[J])?s=mo(e[J]):q in e&&Array.isArray(e[q])?s=mo(e[q]):s=Ie(e),!Ox(t,e)&&!n&&!!s&&!Array.isArray(s)&&!!i.find(o=>o===s)}function ho(t,e=!0){const{year:n,month:r,day:i,hour:s=0,minute:o=0,second:a=0}=t,l=Date.UTC(n,r-1,i,s,o,a),d=new Date(l).toJSON();return e?d:d.slice(0,10)}function Qi(t,e=[]){if(!t)return[];let n=[];return be in t&&(n=n.concat(t[be].map(r=>{const i=`.${e.join(".")}`;return{property:i,message:r,stack:`${i} ${r}`}}))),Object.keys(t).reduce((r,i)=>{if(i!==be){const s=t[i];gt(s)&&(r=r.concat(Qi(s,[...e,i])))}return r},n)}function Ml(t){return ye(t)?Xt(t,Et):In(t)?[t]:Ri(_a(Pi(t)))}function _x(t){const e=new Fl;return t.length&&t.forEach(n=>{const{property:r,message:i}=n,s=r==="."?[]:Ml(r);s.length>0&&s[0]===""&&s.splice(0,1),i&&e.addErrors(i,s)}),e.ErrorSchema}function Fe(t,e,n,r){const i=Array.isArray(n)?n:n?.path,s=t===""?[]:[t],o=i?i.concat(...s):s,a=[e.idPrefix,...o].join(e.idSeparator);let l;return e.nameGenerator&&o.length>0&&(l=e.nameGenerator(o,e.idPrefix,r)),{path:o,[oe]:a,...l!==void 0&&{name:l}}}function Rl(t){return Object.keys(t).reduce((e,n)=>{if(n==="addError")return e;{const r=t[n];return gt(r)?{...e,[n]:Rl(r)}:{...e,[n]:r}}},{})}function Nx(t){return Object.values(t).every(e=>e!==-1)}function Tx(t){const{className:e="form-control",type:n,range:r,value:i,select:s,rootId:o,name:a,disabled:l,readonly:d,autofocus:f,registry:u,onBlur:h,onFocus:g}=t,m=`${o}_${n}`,{SelectWidget:p}=u.widgets,y=P.useCallback(x=>s(n,x),[s,n]);return c.jsx(p,{schema:{type:"integer"},id:m,name:a,className:e,options:{enumOptions:Cl(r[0],r[1])},placeholder:n,value:i,disabled:l,readonly:d,autofocus:f,onChange:y,onBlur:h,onFocus:g,registry:u,label:"","aria-describedby":we(o)})}function Fx(t){const{time:e=!1,disabled:n=!1,readonly:r=!1,options:i,onChange:s,value:o}=t,[a,l]=P.useState(Mr(o,e));P.useEffect(()=>{l(Mr(o,e))},[e,o]);const d=P.useCallback((g,m)=>{const p={...a,[g]:typeof m>"u"?-1:m};Nx(p)?s(ho(p,e)):l(p)},[a,s,e]),f=P.useCallback(g=>{g.preventDefault(),!(n||r)&&s(void 0)},[n,r,s]),u=P.useCallback(g=>{if(g.preventDefault(),n||r)return;const m=Mr(new Date().toJSON(),e);s(ho(m,e))},[n,r,e,s]);return{elements:P.useMemo(()=>yx(a,e,i.yearsRange,i.format),[a,e,i.yearsRange,i.format]),handleChange:d,handleClear:f,handleSetNow:u}}function $t(t){const e=P.useRef(t);return dt(t,e.current)||(e.current=t),e.current}function Px(t,e){return t.replace(";base64",`;name=${encodeURIComponent(e)};base64`)}function Ex(t){const{name:e,size:n,type:r}=t;return new Promise((i,s)=>{const o=new window.FileReader;o.onerror=s,o.onload=a=>{var l;typeof((l=a.target)===null||l===void 0?void 0:l.result)=="string"?i({dataURL:Px(a.target.result,e),name:e,size:n,type:r}):i({dataURL:null,name:e,size:n,type:r})},o.readAsDataURL(t)})}function Ix(t){return Promise.all(Array.from(t).map(Ex))}function po(t){return t.reduce((e,n)=>{if(!n)return e;try{const{blob:r,name:i}=ax(n);return[...e,{dataURL:n,name:i,size:r.size,type:r.type}]}catch{return e}},[])}function Dx(t,e,n=!1){const r=P.useMemo(()=>n&&t?Array.isArray(t)?t:[t]:[],[t,n]),i=P.useMemo(()=>Array.isArray(t)?po(t):po([t||""]),[t]),s=P.useCallback(a=>{Ix(a).then(l=>{const d=l.map(f=>f.dataURL||null);e(n?r.concat(...d):d[0])})},[r,n,e]),o=P.useCallback(a=>{if(n){const l=r.filter((d,f)=>f!==a);e(l)}else e(void 0)},[r,n,e]);return{filesInfo:i,handleChange:s,handleRemove:o}}function $x(t){if(!t)return"";const e=new Date(t),n=lt(e.getFullYear(),4),r=lt(e.getMonth()+1,2),i=lt(e.getDate(),2),s=lt(e.getHours(),2),o=lt(e.getMinutes(),2),a=lt(e.getSeconds(),2),l=lt(e.getMilliseconds(),3);return`${n}-${r}-${i}T${s}:${o}:${a}.${l}`}function Xn(t,e,n=!1){if(!e)return t;const{errors:r,errorSchema:i}=t;let s=Qi(e),o=e;return me(i)||(o=Cn(i,e,n?"preventDuplicates":!0),s=[...r].concat(s)),{errorSchema:o,errors:s}}function kx(t){for(const e in t){const n=t,r=n[e];e===ce&&typeof r=="string"&&r.startsWith("#")?n[e]=fa+r:n[e]=es(r)}return t}function Mx(t){for(let e=0;e<t.length;e++)t[e]=es(t[e]);return t}function es(t){return Array.isArray(t)?Mx([...t]):Z(t)?kx({...t}):t}var K;(function(t){t.ArrayItemTitle="Item",t.MissingItems="Missing items definition",t.EmptyArray="No items yet. Use the button below to add some.",t.YesLabel="Yes",t.NoLabel="No",t.CloseLabel="Close",t.ErrorsLabel="Errors",t.NewStringDefault="New Value",t.AddButton="Add",t.AddItemButton="Add Item",t.CopyButton="Copy",t.MoveDownButton="Move down",t.MoveUpButton="Move up",t.RemoveButton="Remove",t.NowLabel="Now",t.ClearLabel="Clear",t.AriaDateLabel="Select a date",t.PreviewLabel="Preview",t.DecrementAriaLabel="Decrease value by 1",t.IncrementAriaLabel="Increase value by 1",t.OptionalObjectAdd="Add data for optional field",t.OptionalObjectRemove="Remove data for optional field",t.OptionalObjectEmptyMsg="No data for optional field",t.Type="Type",t.Value="Value",t.ClearButton="clear input",t.UnknownFieldType="Unknown field type %1",t.OptionPrefix="Option %1",t.TitleOptionPrefix="%1 option %2",t.KeyLabel="%1 Key",t.InvalidObjectField='Invalid "%1" object field configuration: _%2_.',t.UnsupportedField="Unsupported field schema.",t.UnsupportedFieldWithId="Unsupported field schema for field `%1`.",t.UnsupportedFieldWithReason="Unsupported field schema: _%1_.",t.UnsupportedFieldWithIdAndReason="Unsupported field schema for field `%1`: _%2_.",t.FilesInfo="**%1** (%2, %3 bytes)"})(K||(K={}));function Rx(t,e){var n=ye(t)?$i:pl;return n(t,Fa(e))}function Bx(t,e){return t==null?!0:rl(t,e)}function oi(){return Dl("rjsf-array-item-")}function go(t){return Array.isArray(t)?t.map(e=>({key:oi(),item:e})):[]}function Bl(t){return Array.isArray(t)?t.map(e=>e.item):[]}function Ux(t){return Array.isArray(t.type)?!t.type.includes("null"):t.type!=="null"}function Ul(t,e,n,r){let{addable:i}=U(r,t.globalUiOptions);return i!==!1&&(e.maxItems!==void 0?i=n.length<e.maxItems:i=!0),i}function Ll(t,e,n,r){if(typeof t.items=="function")try{return t.items(e,n,r)}catch(i){console.error(`Error executing dynamic uiSchema.items function for item at index ${n}:`,i);return}else return t.items}function Lx(t,e){const{schemaUtils:n,globalFormOptions:r}=t;let i=e.items;return r.useFallbackUiForUnsupportedType&&!i?i={}:zi(e)&&Rd(e)&&(i=e.additionalItems),n.getDefaultFormState(i)}function Wx(t){const{schema:e,fieldPathId:n,uiSchema:r,formData:i=[],disabled:s=!1,readonly:o=!1,autofocus:a=!1,required:l=!1,placeholder:d,onBlur:f,onFocus:u,registry:h,rawErrors:g,name:m,onSelectChange:p}=t,{widgets:y,schemaUtils:x,globalFormOptions:S,globalUiOptions:O}=h,b=x.retrieveSchema(e.items,i),v=Gt(b,r),{widget:w="select",title:j,...A}=U(r,O),C=He(e,w,y),T=j??e.title??m,N=x.getDisplayLabel(e,r,O),_=$t(Fe("",S,n,!0));return c.jsx(C,{id:_[oe],name:m,multiple:!0,onChange:p,onBlur:f,onFocus:u,options:{...A,enumOptions:v},schema:e,uiSchema:r,registry:h,value:i,disabled:s,readonly:o,required:l,label:T,hideLabel:!N,placeholder:d,autofocus:a,rawErrors:g,htmlName:_.name})}function Vx(t){const{schema:e,fieldPathId:n,uiSchema:r,disabled:i=!1,readonly:s=!1,autofocus:o=!1,required:a=!1,hideError:l,placeholder:d,onBlur:f,onFocus:u,formData:h=[],registry:g,rawErrors:m,name:p,onSelectChange:y}=t,{widgets:x,schemaUtils:S,globalFormOptions:O,globalUiOptions:b}=g,{widget:v,title:w,...j}=U(r,b),A=He(e,v,x),C=w??e.title??p,T=S.getDisplayLabel(e,r,b),N=$t(Fe("",O,n,!0));return c.jsx(A,{id:N[oe],name:p,multiple:!0,onChange:y,onBlur:f,onFocus:u,options:j,schema:e,uiSchema:r,registry:g,value:h,disabled:i,readonly:s,hideError:l,required:a,label:C,hideLabel:!T,placeholder:d,autofocus:o,rawErrors:m,htmlName:N.name})}function zx(t){const{schema:e,uiSchema:n,fieldPathId:r,name:i,disabled:s=!1,readonly:o=!1,autofocus:a=!1,required:l=!1,onBlur:d,onFocus:f,registry:u,formData:h=[],rawErrors:g,onSelectChange:m}=t,{widgets:p,schemaUtils:y,globalFormOptions:x,globalUiOptions:S}=u,{widget:O="files",title:b,...v}=U(n,S),w=He(e,O,p),j=b??e.title??i,A=y.getDisplayLabel(e,n,S),C=$t(Fe("",x,r,!0));return c.jsx(w,{options:v,id:C[oe],name:i,multiple:!0,onChange:m,onBlur:d,onFocus:f,schema:e,uiSchema:n,value:h,disabled:s,readonly:o,required:l,registry:u,autofocus:a,rawErrors:g,label:j,hideLabel:!A,htmlName:C.name})}function Wl(t){const{itemKey:e,index:n,name:r,disabled:i,hideError:s,readonly:o,registry:a,uiOptions:l,parentUiSchema:d,canAdd:f,canRemove:u=!0,canMoveUp:h,canMoveDown:g,itemSchema:m,itemData:p,itemUiSchema:y,itemFieldPathId:x,itemErrorSchema:S,autofocus:O,onBlur:b,onFocus:v,onChange:w,rawErrors:j,totalItems:A,title:C,handleAddItem:T,handleCopyItem:N,handleRemoveItem:_,handleReorderItems:F}=t,{schemaUtils:$,fields:{ArraySchemaField:E,SchemaField:D},globalUiOptions:M}=a,k=$t(x),B=E||D,V=L("ArrayFieldItemTemplate",a,l),R=$.getDisplayLabel(m,y,M),{description:W}=U(y),Q=!!W||!!m.description,{orderable:ne=!0,removable:ie=!0,copyable:de=!1}=l,ee={moveUp:ne&&h,moveDown:ne&&g,copy:de&&f,remove:ie&&u,toolbar:!1};ee.toolbar=Object.keys(ee).some(pe=>ee[pe]);const z=P.useCallback(pe=>{T(pe,n+1)},[T,n]),H=P.useCallback(pe=>{N(pe,n)},[N,n]),re=P.useCallback(pe=>{_(pe,n)},[_,n]),fe=P.useCallback(pe=>{F(pe,n,n-1)},[F,n]),je=P.useCallback(pe=>{F(pe,n,n+1)},[F,n]),Se={children:c.jsx(B,{name:r,title:C,index:n,schema:m,uiSchema:y,formData:p,errorSchema:S,fieldPathId:k,required:Ux(m),onChange:w,onBlur:b,onFocus:v,registry:a,disabled:i,readonly:o,hideError:s,autofocus:O,rawErrors:j}),buttonsProps:{fieldPathId:k,disabled:i,readonly:o,canAdd:f,hasCopy:ee.copy,hasMoveUp:ee.moveUp,hasMoveDown:ee.moveDown,hasRemove:ee.remove,index:n,totalItems:A,onAddItem:z,onCopyItem:H,onRemoveItem:re,onMoveUpItem:fe,onMoveDownItem:je,registry:a,schema:m,uiSchema:y},itemKey:e,className:"rjsf-array-item",disabled:i,hasToolbar:ee.toolbar,index:n,totalItems:A,readonly:o,registry:a,schema:m,uiSchema:y,parentUiSchema:d,displayLabel:R,hasDescription:Q};return c.jsx(V,{...Se})}function qx(t){const{schema:e,uiSchema:n={},errorSchema:r,fieldPathId:i,formData:s,name:o,title:a,disabled:l=!1,readonly:d=!1,autofocus:f=!1,required:u=!1,hideError:h=!1,registry:g,onBlur:m,onFocus:p,rawErrors:y,onChange:x,keyedFormData:S,handleAddItem:O,handleCopyItem:b,handleRemoveItem:v,handleReorderItems:w}=t,j=e.title||a||o,{schemaUtils:A,fields:C,formContext:T,globalFormOptions:N,globalUiOptions:_}=g,{OptionalDataControlsField:F}=C,$=U(n,_),E=Z(e.items)?e.items:{},D=A.retrieveSchema(E),M=Bl(S),k=Mn(g,e,u,n),B=Qt(s),V=Ul(g,e,M,n)&&(!k||B),R=B?S:[],W=k?" rjsf-optional-array-field":"",Q=t.childFieldPathId??i,ne=k?c.jsx(F,{...t,fieldPathId:Q}):void 0,ie={canAdd:V,items:R.map((ee,z)=>{const{key:H,item:re}=ee,fe=re,je=A.retrieveSchema(E,fe),Se=r?r[z]:void 0,pe=Fe(z,N,Q),Oe=Ll(n,re,z,T),De={itemKey:H,index:z,name:o&&`${o}-${z}`,registry:g,uiOptions:$,hideError:h,readonly:d,disabled:l,required:u,title:j?`${j}-${z+1}`:void 0,canAdd:V,canMoveUp:z>0,canMoveDown:z<M.length-1,itemSchema:je,itemFieldPathId:pe,itemErrorSchema:Se,itemData:fe,itemUiSchema:Oe,autofocus:f&&z===0,onBlur:m,onFocus:p,rawErrors:y,totalItems:S.length,handleAddItem:O,handleCopyItem:b,handleRemoveItem:v,handleReorderItems:w,onChange:x};return c.jsx(Wl,{...De},H)}),className:`rjsf-field rjsf-field-array rjsf-field-array-of-${D.type}${W}`,disabled:l,fieldPathId:i,uiSchema:n,onAddClick:O,readonly:d,required:u,schema:e,title:j,formData:M,rawErrors:y,registry:g,optionalDataControl:ne},de=L("ArrayFieldTemplate",g,$);return c.jsx(de,{...ie})}function Kx(t){const{schema:e,uiSchema:n={},formData:r,errorSchema:i,fieldPathId:s,name:o,title:a,disabled:l=!1,readonly:d=!1,autofocus:f=!1,required:u=!1,hideError:h=!1,registry:g,onBlur:m,onFocus:p,rawErrors:y,keyedFormData:x,onChange:S,handleAddItem:O,handleCopyItem:b,handleRemoveItem:v,handleReorderItems:w}=t;let{formData:j=[]}=t;const A=e.title||a||o,{schemaUtils:C,fields:T,formContext:N,globalFormOptions:_,globalUiOptions:F}=g,$=U(n,F),{OptionalDataControlsField:E}=T,D=Mn(g,e,u,n),M=Qt(r),B=(Z(e.items)?e.items:[]).map((z,H)=>C.retrieveSchema(z,j[H])),V=Z(e.additionalItems)?C.retrieveSchema(e.additionalItems,r):null,R=t.childFieldPathId??s;j.length<B.length&&(j=j.concat(new Array(B.length-j.length)));const W=M?x:[],Q=D?" rjsf-optional-array-field":"",ne=D?c.jsx(E,{...t,fieldPathId:R}):void 0,ie=Ul(g,e,j,n)&&!!V&&(!D||M),de={canAdd:ie,className:`rjsf-field rjsf-field-array rjsf-field-array-fixed-items${Q}`,disabled:l,fieldPathId:s,formData:r,items:W.map((z,H)=>{const{key:re,item:fe}=z,je=fe,Se=H>=B.length,pe=(Se&&Z(e.additionalItems)?C.retrieveSchema(e.additionalItems,je):B[H])||{},Oe=Fe(H,_,R);let De;Se?De=n.additionalItems:Array.isArray(n.items)?De=n.items[H]:De=Ll(n,fe,H,N);const nn=i?i[H]:void 0,Je={index:H,itemKey:re,name:o&&`${o}-${H}`,registry:g,uiOptions:$,hideError:h,readonly:d,disabled:l,required:u,title:A?`${A}-${H+1}`:void 0,canAdd:ie,canRemove:Se,canMoveUp:H>=B.length+1,canMoveDown:Se&&H<j.length-1,itemSchema:pe,itemData:je,itemUiSchema:De,itemFieldPathId:Oe,itemErrorSchema:nn,autofocus:f&&H===0,onBlur:m,onFocus:p,rawErrors:y,totalItems:x.length,onChange:S,handleAddItem:O,handleCopyItem:b,handleRemoveItem:v,handleReorderItems:w};return c.jsx(Wl,{...Je},re)}),onAddClick:O,readonly:d,required:u,registry:g,schema:e,uiSchema:n,title:A,errorSchema:i,rawErrors:y,optionalDataControl:ne},ee=L("ArrayFieldTemplate",g,$);return c.jsx(ee,{...de})}function Gx(t=[]){const e=P.useMemo(()=>ze(t),[t]),[n,r]=P.useState(()=>({formDataHash:e,keyedFormData:go(t)}));let{keyedFormData:i,formDataHash:s}=n;if(e!==s){const a=Array.isArray(t)?t:[],l=i||[];i=a.length===l.length?l.map((d,f)=>({key:d.key,item:a[f]})):go(a),s=e,r({formDataHash:s,keyedFormData:i})}const o=P.useCallback(a=>{const l=Bl(a),d=ze(l);return r({formDataHash:d,keyedFormData:a}),l},[]);return{keyedFormData:i,updateKeyedFormData:o}}function Hx(t){const{schema:e,uiSchema:n,errorSchema:r,fieldPathId:i,registry:s,formData:o,onChange:a}=t,{globalFormOptions:l,schemaUtils:d,translateString:f}=s,{keyedFormData:u,updateKeyedFormData:h}=Gx(o),g=t.childFieldPathId??i,m=P.useCallback((w,j)=>{w&&w.preventDefault();let A;if(r){A={};for(const N in r){const _=parseInt(N);j===void 0||_<j?se(A,[_],r[N]):_>=j&&se(A,[_+1],r[N])}}const C={key:oi(),item:Lx(s,e)},T=[...u];j!==void 0?T.splice(j,0,C):T.push(C),a(h(T),g.path,A)},[u,s,e,a,h,r,g]),p=P.useCallback((w,j)=>{w&&w.preventDefault();let A;if(r){A={};for(const N in r){const _=parseInt(N);_<=j?se(A,[_],r[N]):_>j&&se(A,[_+1],r[N])}}const C={key:oi(),item:Hi(u[j].item)},T=[...u];j!==void 0?T.splice(j+1,0,C):T.push(C),a(h(T),g.path,A)},[u,a,h,r,g]),y=P.useCallback((w,j)=>{w&&w.preventDefault();let A;if(r){A={};for(const T in r){const N=parseInt(T);N<j?se(A,[N],r[T]):N>j&&se(A,[N-1],r[T])}}const C=u.filter((T,N)=>N!==j);a(h(C),g.path,A)},[u,a,h,r,g]),x=P.useCallback((w,j,A)=>{w&&(w.preventDefault(),w.currentTarget.blur());let C;if(r){C={};for(const _ in r){const F=parseInt(_);F==j?se(C,[A],r[j]):F==A?se(C,[j],r[A]):se(C,[_],r[F])}}function T(){const _=u.slice();return _.splice(j,1),_.splice(A,0,u[j]),_}const N=T();a(h(N),g.path,C)},[u,a,h,r,g]),S=P.useCallback((w,j,A,C)=>{a(w===void 0?null:w,j,A,C)},[a]),O=P.useCallback(w=>{a(w,g.path,void 0,g?.[oe])},[a,g]),b={...t,formData:o,fieldPathId:g,onSelectChange:O},v={...t,handleAddItem:m,handleCopyItem:p,handleRemoveItem:y,handleReorderItems:x,keyedFormData:u,onChange:S};if(!(zt in e)){if(!l.useFallbackUiForUnsupportedType){const j=U(n),A=L("UnsupportedFieldTemplate",s,j);return c.jsx(A,{schema:e,fieldPathId:i,reason:f(K.MissingItems),registry:s})}const w={...e,[zt]:{type:void 0}};b.schema=w,v.schema=w}return d.isMultiSelect(b.schema)?c.jsx(Wx,{...b}):vl(n)?c.jsx(Vx,{...b}):zi(b.schema)?c.jsx(Kx,{...v}):d.isFilesArray(b.schema,n)?c.jsx(zx,{...b}):c.jsx(qx,{...v})}function Yx(t){const{schema:e,name:n,uiSchema:r,fieldPathId:i,formData:s,registry:o,required:a,disabled:l,readonly:d,hideError:f,autofocus:u,title:h,onChange:g,onFocus:m,onBlur:p,rawErrors:y}=t,{title:x}=e,{widgets:S,translateString:O,globalUiOptions:b}=o,{widget:v="checkbox",title:w,label:j=!0,enumNames:A,...C}=U(r,b),T=He(e,v,S),N=O(K.YesLabel),_=O(K.NoLabel);let F;const $=w??x??h??n;if(Array.isArray(e.oneOf))F=Gt({oneOf:e.oneOf.map(D=>{if(Z(D))return{...D,title:D.title||(D.const===!0?N:_)}}).filter(D=>D)},r);else{const D=e.enum??[!0,!1];!A&&D.length===2&&D.every(M=>typeof M=="boolean")?F=[{value:D[0],label:D[0]?N:_},{value:D[1],label:D[1]?N:_}]:F=Gt({enum:D},r)}const E=P.useCallback((D,M,k)=>g(D,i.path,M,k),[g,i]);return c.jsx(T,{options:{...C,enumOptions:F},schema:e,uiSchema:r,id:i.$id,name:n,onChange:E,onFocus:m,onBlur:p,label:$,hideLabel:!j,value:s,required:a,disabled:l,readonly:d,hideError:f,registry:o,autofocus:u,rawErrors:y,htmlName:i.name})}function Xx(t){return{type:"string",enum:["string","number","boolean","object","array"],default:"string",title:t}}function Jx(t){const e=typeof t;return e==="string"||e==="number"||e==="boolean"?e:e==="object"?Array.isArray(t)?"array":"object":"string"}function Zx(t,e){switch(e){case"string":return String(t);case"number":{const n=Number(t);return isNaN(n)?0:n}case"boolean":return!!t;default:return t}}function Qx(t){const{id:e,formData:n,displayLabel:r=!0,schema:i,name:s,uiSchema:o,required:a,disabled:l=!1,readonly:d=!1,onBlur:f,onFocus:u,registry:h,fieldPathId:g,onChange:m,errorSchema:p}=t,{translateString:y,fields:x,globalFormOptions:S}=h,[O,b]=P.useState(Jx(n)),v=U(o),w=$t(Fe("__internal_type_selector",S,g)),j=y(K.Type),A=P.useMemo(()=>Xx(j),[j]),C=_=>{_!=null&&(b(_),m(Zx(n,_),g.path,p,e))};if(!S.useFallbackUiForUnsupportedType){const{reason:_=y(K.UnknownFieldType,[String(i.type)])}=t,F=L("UnsupportedFieldTemplate",h,v);return c.jsx(F,{schema:i,fieldPathId:g,reason:_,registry:h})}const T=L("FallbackFieldTemplate",h,v),{SchemaField:N}=x;return c.jsx(T,{schema:i,registry:h,typeSelector:c.jsx(N,{fieldPathId:w,name:`${s}__fallback_type`,schema:A,formData:O,onChange:C,onBlur:f,onFocus:u,registry:h,hideLabel:!r,disabled:l,readonly:d,required:a},n?ze(n):"__empty__"),schemaField:c.jsx(N,{...t,schema:{type:O,title:y(K.Value),...O==="object"&&{additionalProperties:!0}}})})}function eb(t,e){return Xt(e,function(n){return t[n]})}function tb(t){return t==null?[]:eb(t,Pe(t))}var nb=Math.max;function rb(t,e,n,r){t=Pt(t)?t:tb(t),n=n?Pa(n):0;var i=t.length;return n<0&&(n=nb(i+n,0)),yt(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&Ka(t,e,n)>-1}var ib=Math.min;function sb(t,e,n){for(var r=Bi,i=t[0].length,s=t.length,o=s,a=Array(s),l=1/0,d=[];o--;){var f=t[o];l=ib(f.length,l),a[o]=i>=120&&f.length>=120?new Ct(o&&f):void 0}f=t[0];var u=-1,h=a[0];e:for(;++u<i&&d.length<l;){var g=f[u],m=g;if(g=g!==0?g:0,!(h?vn(h,m):r(d,m))){for(o=s;--o;){var p=a[o];if(!(p?vn(p,m):r(t[o],m)))continue e}h&&h.push(m),d.push(g)}}return d}function ob(t){return Sn(t)?t:[]}var yo=fr(function(t){var e=Xt(t,ob);return e.length&&e[0]===t[0]?sb(e):[]});function Vl(t){return t===void 0}var Ke;(function(t){t.ROW="ui:row",t.COLUMN="ui:col",t.COLUMNS="ui:columns",t.CONDITION="ui:condition"})(Ke||(Ke={}));var pn;(function(t){t.ALL="all",t.SOME="some",t.NONE="none"})(pn||(pn={}));const ab=/^\$lookup=(.+)/,Rr="layoutGrid";function xo(t,e){return t??e}function lb(t){return/^\d+?$/.test(t)}const mt=Yi();function cb(t,e,n,r,i){const s=I(n,[Hr],{}),o=I(n,t),a={...I(o,[ut],{}),...e,...s},l={...o};me(a)||se(l,[ut],a),me(s)||se(l,[Hr],s);let{readonly:d}=U(l);return(i===!0||Vl(d)&&r===!0)&&(d=!0,X(a,Sr)?se(l,[ut,Sr],!0):se(l,`ui:${Sr}`,!0)),{fieldUiSchema:l,uiReadonly:d}}function ub(t,e,n="$0m3tH1nG Un3xP3cT3d"){const r=ni([e]).sort(),i=ni([n]).sort();switch(t){case pn.ALL:return dt(r,i);case pn.SOME:return yo(r,i).length>0;case pn.NONE:return yo(r,i).length===0;default:return!1}}function pr(t,e,n){let r={},i=t[e];if(gt(i)){const{children:s,className:o,...a}=i;if(i=s,o){const d=o.split(" ").map(f=>Zi(n,f,f)).join(" ");r={...a,className:d}}else r=a}if(!Array.isArray(i))throw new TypeError(`Expected array for "${e}" in ${JSON.stringify(t)}`);return{children:i,gridProps:r}}function bo(t,e,n){let r;if(lb(n)&&t&&t?.type==="array"&&X(t,zt)){const i=Number(n),s=t[zt];Array.isArray(s)?i>s.length?r=nl(s):r=s[i]:r=s,e={[oe]:e[oe],path:[...e.path.slice(0,e.path.length-1),i]}}return{rawSchema:r,fieldPathId:e}}function db(t,e,n,r,i){const{schemaUtils:s,globalFormOptions:o}=t;let a=n,l=i;const d=e.split("."),f=d.pop();let u=s.retrieveSchema(a,r),h=r,g=u.readOnly;d.forEach(y=>{if(l=Fe(y,o,l),X(u,te))a=I(u,[te,y],{});else if(u&&(X(u,q)||X(u,J))){const x=X(u,q)?q:J,S=s.findSelectedOptionInXxxOf(u,y,x,h);a=I(S,[te,y],{})}else{const x=bo(u,l,y);a=x.rawSchema??{},l=x.fieldPathId}h=I(h,y,{}),u=s.retrieveSchema(a,h),g=xo(u.readOnly,g)});let m,p=!1;if(me(u)&&(u=void 0),u&&f){if(u&&(X(u,q)||X(u,J))){const x=X(u,q)?q:J;u=s.findSelectedOptionInXxxOf(u,f,x,h)}l=Fe(f,o,l),p=u!==void 0&&Array.isArray(u.required)&&rb(u.required,f);const y=bo(u,l,f);if(y.rawSchema?(u=y.rawSchema,l=y.fieldPathId):(u=I(u,[te,f]),u=u&&s.retrieveSchema(u)),g=xo(u?.readOnly,g),u&&(X(u,q)||X(u,J))){const x=X(u,q)?q:J,S=Ge(u);m={options:u[x],hasDiscriminator:!!S}}}return{schema:u,isRequired:p,isReadonly:g,optionsInfo:m,fieldPathId:l}}function fb(t,e){let n=t;return yt(n)&&(n=Zi(e,n)),Fn(n)?n:null}function mb(t,e){let n,r=null,i={},s;if(yt(e)||Vl(e))n=e??"";else{const{name:o="",render:a,...l}=e;n=o,i=l,me(i)||Rx(i,(d,f)=>{if(yt(d)){const u=ab.exec(d);if(Array.isArray(u)&&u.length>1){const h=u[1];i[f]=Zi(t,h,h)}}}),r=fb(a,t),!o&&r&&(s=c.jsx(r,{...l,"data-testid":mt.uiComponent}))}return{name:n,UIComponent:r,uiProps:i,rendered:s}}function gr(t){const{childrenLayoutGridSchemaId:e,...n}=t,{registry:r,schema:i,formData:s}=n,{schemaUtils:o}=r,a=o.retrieveSchema(i,s);return e.map(l=>P.createElement(ts,{...n,key:`layoutGrid-${ze(l)}`,schema:a,layoutGridSchema:l}))}function hb(t){const{layoutGridSchema:e,...n}=t,{formData:r,registry:i}=n,{children:s,gridProps:o}=pr(e,Ke.CONDITION,i),{operator:a,field:l="",value:d}=o,f=I(r,l,null);return ub(a,f,d)?c.jsx(gr,{...n,childrenLayoutGridSchemaId:s}):null}function pb(t){const{layoutGridSchema:e,...n}=t,{registry:r,uiSchema:i}=n,{children:s,gridProps:o}=pr(e,Ke.COLUMN,r),a=U(i),l=L("GridTemplate",r,a);return c.jsx(l,{column:!0,"data-testid":mt.col,...o,children:c.jsx(gr,{...n,childrenLayoutGridSchemaId:s})})}function gb(t){const{layoutGridSchema:e,...n}=t,{registry:r,uiSchema:i}=n,{children:s,gridProps:o}=pr(e,Ke.COLUMNS,r),a=U(i),l=L("GridTemplate",r,a);return s.map(d=>c.jsx(l,{column:!0,"data-testid":mt.col,...o,children:c.jsx(gr,{...n,childrenLayoutGridSchemaId:[d]})},`column-${ze(d)}`))}function yb(t){const{layoutGridSchema:e,...n}=t,{registry:r,uiSchema:i}=n,{children:s,gridProps:o}=pr(e,Ke.ROW,r),a=U(i),l=L("GridTemplate",r,a);return c.jsx(l,{...o,"data-testid":mt.row,children:c.jsx(gr,{...n,childrenLayoutGridSchemaId:s})})}function xb(t){const{gridSchema:e,schema:n,uiSchema:r,errorSchema:i,fieldPathId:s,onBlur:o,onFocus:a,formData:l,readonly:d,registry:f,layoutGridSchema:u,...h}=t,{onChange:g}=h,{fields:m}=f,{SchemaField:p,LayoutMultiSchemaField:y}=m,x=mb(f,e),{name:S,UIComponent:O,uiProps:b}=x,{schema:v,isRequired:w,isReadonly:j,optionsInfo:A,fieldPathId:C}=db(f,S,n,l,s),T=$t(C);if(x.rendered)return x.rendered;if(v){const N=A?.hasDiscriminator?y:p,{fieldUiSchema:_,uiReadonly:F}=cb(S,b,r,j,d);return c.jsx(N,{"data-testid":A?.hasDiscriminator?mt.layoutMultiSchemaField:mt.field,...h,name:S,required:w,readonly:F,schema:v,uiSchema:_,errorSchema:I(i,S),fieldPathId:T,formData:I(l,S),onChange:g,onBlur:o,onFocus:a,options:A?.options,registry:f})}return O?c.jsx(O,{"data-testid":mt.uiComponent,...h,name:S,required:w,formData:l,readOnly:!!j||d,errorSchema:i,uiSchema:r,schema:n,fieldPathId:s,onBlur:o,onFocus:a,registry:f,...b}):null}function ts(t){const{uiSchema:e}=t;let{layoutGridSchema:n}=t;const r=U(e);if(!n&&Rr in r&&Z(r[Rr])&&(n=r[Rr]),Z(n)){if(Ke.ROW in n)return c.jsx(yb,{...t,layoutGridSchema:n});if(Ke.COLUMN in n)return c.jsx(pb,{...t,layoutGridSchema:n});if(Ke.COLUMNS in n)return c.jsx(gb,{...t,layoutGridSchema:n});if(Ke.CONDITION in n)return c.jsx(hb,{...t,layoutGridSchema:n})}return c.jsx(xb,{...t,gridSchema:n})}ts.TEST_IDS=mt;function bb(t){const{fieldPathId:e,title:n,schema:r,uiSchema:i,required:s,registry:o,name:a}=t,l=U(i,o.globalUiOptions),{title:d}=l,{title:f}=r,u=d||n||f||a;if(!u)return null;const h=L("TitleFieldTemplate",o,l);return c.jsx(h,{id:hr(e),title:u,required:s,schema:r,uiSchema:i,registry:o})}function Br(t,e,n){const r="!@#!@$@#$!@$#";return t.map(({schema:s})=>s).find(s=>{const o=I(s,[te,e]);return I(o,ir,I(o,_e,r))===n})}function vo(t,e,n,r,i){const s=e.map(l=>n.retrieveSchema(l,i));let o=t;X(t,q)?o={...t,[q]:s}:X(t,J)&&(o={...t,[J]:s});const a=Gt(o,r);if(!a)throw new Error(`No enumOptions were computed from the schema ${JSON.stringify(o)}`);return a}function vb(t){const{name:e,baseType:n,disabled:r=!1,formData:i,fieldPathId:s,onBlur:o,onChange:a,options:l,onFocus:d,registry:f,uiSchema:u,schema:h,autofocus:g,readonly:m,required:p,errorSchema:y,hideError:x=!1}=t,{widgets:S,schemaUtils:O,globalUiOptions:b}=f,[v,w]=P.useState(vo(h,l,O,u,i)),j=I(s,oe),A=Ge(h),C=L("FieldErrorTemplate",f,l),T=L("FieldTemplate",f,l),N=ze(h),_=ze(l),F=u?ze(u):"",$=i?ze(i):"";P.useEffect(()=>{w(vo(h,l,O,u,i))},[N,_,O,F,$]);const{widget:E=A?"radio":"select",title:D="",placeholder:M="",optionsSchemaSelector:k=A,hideError:B,...V}=U(u);if(!k)throw new Error("No selector field provided for the LayoutMultiSchemaField");const R=I(i,k);let W=I(v[0]?.schema,[te,k],{});const Q=Br(v,k,R);W=W?.type?W:{...W,type:Q?.type||n};const ne=He(W,E,S),ie=B===void 0?x:!!B,de=I(y,[be],[]),ee=wn(y,[be]),z=O.getDisplayLabel(h,u,b),H=je=>{const Se=Br(v,k,je),pe=Br(v,k,R);let Oe=O.sanitizeDataForNewSchema(Se,pe,i);Oe&&Se&&(Oe=O.getDefaultFormState(Se,Oe,"excludeObjectChildren")),Oe&&se(Oe,k,je),a(Oe,s.path,void 0,j)},re={enumOptions:v,...V},fe=!ie&&de.length>0?c.jsx(C,{fieldPathId:s,schema:h,errors:de,registry:f}):void 0;return c.jsx(T,{fieldPathId:s,id:j,schema:h,label:(D||h.title)??"",disabled:r||Array.isArray(v)&&me(v),uiSchema:u,required:p,readonly:!!m,registry:f,displayLabel:z,errors:fe,onChange:a,onKeyRename:Gn,onKeyRenameBlur:Gn,onRemoveProperty:Gn,children:c.jsx(ne,{id:j,name:e,schema:h,label:(D||h.title)??"",disabled:r||Array.isArray(v)&&me(v),uiSchema:u,autofocus:g,readonly:m,required:p,registry:f,multiple:!1,rawErrors:de,hideError:ie,hideLabel:!z,errorSchema:ee,placeholder:M,onChange:H,onBlur:o,onFocus:d,value:R,options:re,htmlName:s.name})})}class So extends P.Component{constructor(e){super(e);const{formData:n,options:r,registry:{schemaUtils:i}}=this.props,s=r.map(o=>i.retrieveSchema(o,n));this.state={retrievedOptions:s,selectedOption:this.getMatchingOption(0,n,s)}}componentDidUpdate(e,n){const{formData:r,options:i,fieldPathId:s}=this.props,{selectedOption:o}=this.state;let a=this.state;if(!le(e.options,i)){const{registry:{schemaUtils:l}}=this.props,d=i.map(f=>l.retrieveSchema(f,r));a={selectedOption:o,retrievedOptions:d}}if(!le(r,e.formData)&&s.$id===e.fieldPathId.$id){const{retrievedOptions:l}=a,d=this.getMatchingOption(o,r,l);n&&d!==o&&(a={selectedOption:d,retrievedOptions:l})}a!==this.state&&this.setState(a)}getMatchingOption(e,n,r){const{schema:i,registry:{schemaUtils:s}}=this.props,o=Ge(i);return s.getClosestMatchingOption(n,r,e,o)}onOptionChange=e=>{const{selectedOption:n,retrievedOptions:r}=this.state,{formData:i,onChange:s,registry:o,fieldPathId:a}=this.props,{schemaUtils:l}=o,d=e!==void 0?parseInt(e,10):-1;if(d===n)return;const f=d>=0?r[d]:void 0,u=n>=0?r[n]:void 0;let h=l.sanitizeDataForNewSchema(f,u,i);f&&(h=l.getDefaultFormState(f,h,"excludeObjectChildren")),this.setState({selectedOption:d},()=>{s(h,a.path,void 0,this.getFieldId())})};getFieldId(){const{fieldPathId:e,schema:n}=this.props;return`${e.$id}${n.oneOf?"__oneof_select":"__anyof_select"}`}render(){const{name:e,disabled:n=!1,errorSchema:r={},formData:i,onBlur:s,onFocus:o,readonly:a,required:l=!1,registry:d,schema:f,uiSchema:u}=this.props,{widgets:h,fields:g,translateString:m,globalUiOptions:p,schemaUtils:y}=d,{SchemaField:x}=g,S=L("MultiSchemaFieldTemplate",d,p),O=Mn(d,f,l,u),b=Qt(i),{selectedOption:v,retrievedOptions:w}=this.state,{widget:j="select",placeholder:A,autofocus:C,autocomplete:T,title:N=f.title,..._}=U(u,p),F=He({type:"number"},j,h),$=I(r,be,[]),E=wn(r,[be]),D=y.getDisplayLabel(f,u,p),M=v>=0&&w[v]||null;let k;if(M){const{required:de}=f;k=de?tt({required:de},M):M}let B=[];q in f&&u&&q in u?Array.isArray(u[q])?B=u[q]:console.warn(`uiSchema.oneOf is not an array for "${N||e}"`):J in f&&u&&J in u&&(Array.isArray(u[J])?B=u[J]:console.warn(`uiSchema.anyOf is not an array for "${N||e}"`));let V=u;v>=0&&B.length>v&&(V=B[v]);const R=N?K.TitleOptionPrefix:K.OptionPrefix,W=N?[N]:[],Q=w.map((de,ee)=>{const{title:z=de.title}=U(B[ee]);return{label:z||m(R,W.concat(String(ee+1))),value:ee}}),ne=!O||b?c.jsx(F,{id:this.getFieldId(),name:`${e}${f.oneOf?"__oneof_select":"__anyof_select"}`,schema:{type:"number",default:0},onChange:this.onOptionChange,onBlur:s,onFocus:o,disabled:n||me(Q),multiple:!1,rawErrors:$,errorSchema:E,value:v>=0?v:void 0,options:{enumOptions:Q,..._},registry:d,placeholder:A,autocomplete:T,autofocus:C,label:N??e,hideLabel:!D,readonly:a}):void 0,ie=k&&k.type!=="null"&&c.jsx(x,{...this.props,schema:k,uiSchema:V})||null;return c.jsx(S,{schema:f,registry:d,uiSchema:u,selector:ne,optionSchemaField:ie})}}const Sb=/\.([0-9]*0)*$/,wb=/[0.]0*$/;function jb(t){const{registry:e,onChange:n,formData:r,value:i}=t,[s,o]=P.useState(i),{StringField:a}=e.fields;let l=r;const d=P.useCallback((f,u,h,g)=>{o(f),`${f}`.charAt(0)==="."&&(f=`0${f}`);const m=typeof f=="string"&&f.match(Sb)?xs(f.replace(wb,"")):xs(f);n(m,u,h,g)},[n]);if(typeof s=="string"&&typeof l=="number"){const f=new RegExp(`^(${String(l).replace(".","\\.")})?\\.?0*$`);s.match(f)&&(l=s)}return c.jsx(a,{...t,formData:l,onChange:d})}function We(){return We=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},We.apply(null,arguments)}const Ln=["strong","em","del","mark"],wo=[["**",Ln[0]],["__",Ln[0]],["~~",Ln[2]],["==",Ln[3]],["*","em"],["_","em"]];function Ob(t,e){for(var n=1,r=e+1;r<t.length&&n>0;)t[r]!=="\\"?(t[r]==="["&&n++,t[r]==="]"&&n--,r++):r+=2;if(n===0&&r<t.length&&(t[r]==="("||t[r]==="[")){var i=t[r]==="("?")":"]",s=1;for(r++;r<t.length&&s>0;)t[r]!=="\\"?(t[r]==="("&&i===")"&&s++,t[r]===i&&s--,r++):r+=2;if(s===0)return r}return-1}function Ab(t,e){if(!e||!e.inline&&!e.simple)return null;var n=t[0];if(n!=="*"&&n!=="_"&&n!=="~"&&n!=="=")return null;for(var r="",i=0,s="",o=0;o<6;o++){var a=wo[o][0];if(t.startsWith(a)&&t.length>=2*a.length){r=a,i=a.length,s=wo[o][1];break}}if(!r)return null;for(var l=i,d=!1,f=!1,u="",h=0,g="",m=!1,p="";l<t.length;){var y=t[l];if(m)g+=y,m=!1,p=y,l++;else if(y!=="\\")if(y!=="`"||h!==0){if(y==="["&&!d&&h===0){var x=Ob(t,l);if(x!==-1){g+=t.slice(l,x),l=x,p=t[x-1];continue}}if(f)g+=y,u?y===u&&(u=""):y==='"'||y==="'"?u=y:y===">"&&(f=!1),p=y,l++;else if(y!=="<"||d){if(y===`
|
|
3
|
+
`&&p===`
|
|
4
|
+
`&&!d&&h===0)return null;if(!d&&h===0){for(var S=0;l+S<t.length&&t[l+S]===r[0];)S++;if(S>=i&&(i!==1||r!=="*"&&r!=="_"||t[l-1]!==r&&t[l+1]!==r)){var O=[t.slice(0,l+S),s,g+t.slice(l+i,l+S)];return O.index=0,O.input=t,O}}g+=y,p=y,l++}else{var b=t[l+1],v=t.indexOf(">",l);if(v!==-1){var w=t.slice(l,v+1).endsWith("/>");b==="/"?h=Math.max(0,h-1):w||h++}f=!0,g+=y,p=y,l++}}else d=!d,g+=y,p=y,l++;else g+=y,m=!0,p=y,l++}return null}const Cb=["children","options"],jo=["allowFullScreen","allowTransparency","autoComplete","autoFocus","autoPlay","cellPadding","cellSpacing","charSet","classId","colSpan","contentEditable","contextMenu","crossOrigin","encType","formAction","formEncType","formMethod","formNoValidate","formTarget","frameBorder","hrefLang","inputMode","keyParams","keyType","marginHeight","marginWidth","maxLength","mediaGroup","minLength","noValidate","radioGroup","readOnly","rowSpan","spellCheck","srcDoc","srcLang","srcSet","tabIndex","useMap"].reduce((t,e)=>(t[e.toLowerCase()]=e,t),{class:"className",for:"htmlFor"}),Oo={amp:"&",apos:"'",gt:">",lt:"<",nbsp:" ",quot:"“"},_b=["style","script","pre"],Nb=["src","href","data","formAction","srcDoc","action"],Tb=/([-A-Z0-9_:]+)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|(?:\{((?:\\.|{[^}]*?}|[^}])*)\})))?/gi,Fb=/\n{2,}$/,Ao=/^(\s*>[\s\S]*?)(?=\n\n|$)/,Pb=/^ *> ?/gm,Eb=/^(?:\[!([^\]]*)\]\n)?([\s\S]*)/,Ib=/^ {2,}\n/,Db=/^(?:([-*_])( *\1){2,}) *(?:\n *)+\n/,Co=/^(?: {1,3})?(`{3,}|~{3,}) *(\S+)? *([^\n]*?)?\n([\s\S]*?)(?:\1\n?|$)/,_o=/^(?: {4}[^\n]+\n*)+(?:\n *)+\n?/,$b=/^(`+)((?:\\`|(?!\1)`|[^`])+)\1/,kb=/^(?:\n *)*\n/,Mb=/\r\n?/g,Rb=/^\[\^([^\]]+)](:(.*)((\n+ {4,}.*)|(\n(?!\[\^).+))*)/,Bb=/^\[\^([^\]]+)]/,Ub=/\f/g,Lb=/^---[ \t]*\n(.|\n)*\n---[ \t]*\n/,Wb=/^\[(x|\s)\]/,No=/^(#{1,6}) *([^\n]+?)(?: +#*)?(?:\n *)*(?:\n|$)/,To=/^ *(#{1,6}) +([^\n]+?)(?: +#*)?(?:\n *)*(?:\n|$)/,Fo=/^([^\n]+)\n *(=|-)\2{2,} *\n/,ns=/^<([a-z][^ >/]*) ?((?:[^>]*[^/])?)>/i;function Vb(t){const e=ns.exec(t);if(!e)return null;const n=e[1],r=n.toLowerCase(),i=r.length+1;let s=e[0].length;t[s]===`
|
|
5
|
+
`&&s++;const o=s;let a=s,l=1;const d=t.length;for(;l>0;){const u=t.indexOf("<",s);if(u===-1)return null;let h=-1,g=-1;if(t[u+1]==="/")g=u;else if(t[u+1]===r[0]||t[u+1]===n[0]){let m=!0;for(let p=0;p<r.length;p++){const y=t[u+1+p];if(y!==r[p]&&y!==n[p]){m=!1;break}}!m||t[u+i]!==" "&&t[u+i]!==">"||(h=u)}if(h!==-1||g!==-1)if(h!==-1&&(g===-1||h<g))s=h+i+1,l++;else{let m=g+2;for(;m<d;){const y=t[m];if(y!==" "&&y!==" "&&y!==`
|
|
6
|
+
`&&y!=="\r")break;m++}if(m+r.length>d)return null;let p=!0;for(let y=0;y<r.length;y++){const x=t[m+y];if(x!==r[y]&&x!==n[y]){p=!1;break}}if(!p){s=m;continue}for(m+=r.length;m<d;){const y=t[m];if(y!==" "&&y!==" "&&y!==`
|
|
7
|
+
`&&y!=="\r")break;m++}if(m>=d||t[m]!==">"){s=m;continue}a=g,s=m+1,l--}else s=u+1}let f=0;for(;s+f<d&&t[s+f]===`
|
|
8
|
+
`;)f++;return[t.slice(0,s+f),n,e[2],t.slice(o,a)]}const zb=/&([a-z0-9]+|#[0-9]{1,6}|#x[0-9a-fA-F]{1,6});/gi,Po=/^<!--[\s\S]*?(?:-->)/,qb=/^(data|aria|x)-[a-z_][a-z\d_.-]*$/,ai=/^ *<([a-z][a-z0-9:]*)(?:\s+((?:<.*?>|[^>])*))?\/?>(?!<\/\1>)(\s*\n)?/i,Kb=/^\{.*\}$/,Gb=/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,Hb=/^<([^ >]+[:@\/][^ >]+)>/,Yb=/-([a-z])?/gi,Eo=/^(\|.*)\n(?: *(\|? *[-:]+ *\|[-| :]*)\n((?:.*\|.*\n)*))?\n?/,Xb=/^[^\n]+(?: \n|\n{2,})/,Jb=/^\[([^\]]*)\]:\s+<?([^\s>]+)>?\s*("([^"]*)")?/,Zb=/^!\[([^\]]*)\] ?\[([^\]]*)\]/,Qb=/^\[([^\]]*)\] ?\[([^\]]*)\]/,e0=/(\n|^[-*]\s|^#|^ {2,}|^-{2,}|^>\s)/,t0=/\t/g,n0=/(^ *\||\| *$)/g,r0=/^ *:-+: *$/,i0=/^ *:-+ *$/,s0=/^ *-+: *$/,o0=/^(:[a-zA-Z0-9-_]+:)/,a0=/^\\([^0-9A-Za-z\s])/,l0=/\\([^0-9A-Za-z\s])/g,c0=/^[\s\S](?:(?! \n|[0-9]\.|http)[^=*_~\-\n:<`\\\[!])*/,u0=/^\n+/,d0=/^([ \t]*)/,f0=/(?:^|\n)( *)$/,rs="(?:\\d+\\.)",is="(?:[*+-])";function zl(t){return"( *)("+(t===1?rs:is)+") +"}const ql=zl(1),Kl=zl(2);function Gl(t){return RegExp("^"+(t===1?ql:Kl))}const m0=Gl(1),h0=Gl(2);function Hl(t){return RegExp("^"+(t===1?ql:Kl)+"[^\\n]*(?:\\n(?!\\1"+(t===1?rs:is)+" )[^\\n]*)*(\\n|$)","gm")}const p0=Hl(1),g0=Hl(2);function Yl(t){const e=t===1?rs:is;return RegExp("^( *)("+e+") [\\s\\S]+?(?:\\n{2,}(?! )(?!\\1"+e+" (?!"+e+" ))\\n*|\\s*\\n*$)")}const Xl=Yl(1),Jl=Yl(2);function Io(t,e){const n=e===1,r=n?Xl:Jl,i=n?p0:g0,s=n?m0:h0;return{t:o=>s.test(o),o:ct(function(o,a){const l=f0.exec(a.prevCapture);return l&&(a.list||!a.inline&&!a.simple)?r.exec(o=l[1]+o):null}),u:1,i(o,a,l){const d=n?+o[2]:void 0,f=o[0].replace(Fb,`
|
|
9
|
+
`).match(i),u=s.exec(f[0]),h=RegExp("^ {1,"+(u?u[0].length:0)+"}","gm");let g=!1;return{items:f.map(function(m,p){const y=m.replace(h,"").replace(s,""),x=p===f.length-1,S=$e(y,`
|
|
10
|
+
|
|
11
|
+
`)||x&&g;g=S;const O=l.inline,b=l.list;let v;l.list=!0,S?(l.inline=!1,v=gn(y)+`
|
|
12
|
+
|
|
13
|
+
`):(l.inline=!0,v=gn(y));const w=a(v,l);return l.inline=O,l.list=b,w}),ordered:n,start:d}}}}const y0=RegExp(`^\\[((?:\\[[^\\[\\]]*(?:\\[[^\\[\\]]*\\][^\\[\\]]*)*\\]|[^\\[\\]])*)\\]\\(\\s*<?((?:\\([^)]*\\)|[^\\s\\\\]|\\\\.)*?)>?(?:\\s+['"]([\\s\\S]*?)['"])?\\s*\\)`),x0=/^!\[(.*?)\]\( *((?:\([^)]*\)|[^() ])*) *"?([^)"]*)?"?\)/;function Do(t){return typeof t=="string"}function gn(t){let e=t.length;for(;e>0&&t[e-1]<=" ";)e--;return t.slice(0,e)}function li(t,e){return t.startsWith(e)}function $e(t,e){return t.indexOf(e)!==-1}function b0(t,e,n){if(Array.isArray(n)){for(let r=0;r<n.length;r++)if(li(t,n[r]))return!0;return!1}return n(t,e)}function ln(t){return t.replace(/[ÀÁÂÃÄÅàáâãä忯]/g,"a").replace(/[çÇ]/g,"c").replace(/[ðÐ]/g,"d").replace(/[ÈÉÊËéèêë]/g,"e").replace(/[ÏïÎîÍíÌì]/g,"i").replace(/[Ññ]/g,"n").replace(/[øØœŒÕõÔôÓóÒò]/g,"o").replace(/[ÜüÛûÚúÙù]/g,"u").replace(/[ŸÿÝý]/g,"y").replace(/[^a-z0-9- ]/gi,"").replace(/ /gi,"-").toLowerCase()}function v0(t){return s0.test(t)?"right":r0.test(t)?"center":i0.test(t)?"left":null}function $o(t,e,n,r){const i=n.inTable;n.inTable=!0;let s=[[]],o="";function a(){if(!o)return;const l=s[s.length-1];l.push.apply(l,e(o,n)),o=""}return t.trim().split(/(`[^`]*`|\\\||\|)/).filter(Boolean).forEach((l,d,f)=>{l.trim()==="|"&&(a(),r)?d!==0&&d!==f.length-1&&s.push([]):o+=l}),a(),n.inTable=i,s}function S0(t,e,n){n.inline=!0;const r=t[2]?t[2].replace(n0,"").split("|").map(v0):[],i=t[3]?(function(o,a,l){return o.trim().split(`
|
|
14
|
+
`).map(function(d){return $o(d,a,l,!0)})})(t[3],e,n):[],s=$o(t[1],e,n,!!i.length);return n.inline=!1,i.length?{align:r,cells:i,header:s,type:"25"}:{children:s,type:"21"}}function ko(t,e){return t.align[e]==null?{}:{textAlign:t.align[e]}}function ct(t){return t.inline=1,t}function ot(t){return ct(function(e,n){return n.inline?t.exec(e):null})}function Wn(t){return ct(function(e,n){return n.inline||n.simple?t.exec(e):null})}function Ze(t){return function(e,n){return n.inline||n.simple?null:t.exec(e)}}function Mo(t){return ct(function(e){return t.exec(e)})}const w0=/(javascript|vbscript|data(?!:image)):/i;function j0(t){try{const e=decodeURIComponent(t).replace(/[^A-Za-z0-9/:]/g,"");if(w0.test(e))return null}catch{return null}return t}function Ue(t){return t&&t.replace(l0,"$1")}function Jn(t,e,n){const r=n.inline||!1,i=n.simple||!1;n.inline=!0,n.simple=!0;const s=t(e,n);return n.inline=r,n.simple=i,s}function O0(t,e,n){const r=n.inline||!1,i=n.simple||!1;n.inline=!1,n.simple=!0;const s=t(e,n);return n.inline=r,n.simple=i,s}function A0(t,e,n){const r=n.inline||!1;n.inline=!1;const i=t(e,n);return n.inline=r,i}const C0=(t,e,n)=>({children:Jn(e,t[2],n)});function Ur(){return{}}function _0(...t){return t.filter(Boolean).join(" ")}function Lr(t,e,n){let r=t;const i=e.split(".");for(;i.length&&(r=r[i[0]],r!==void 0);)i.shift();return r||n}function Wr(t,e,n,r){if(!e||!e.trim())return null;const i=e.match(Tb);return i?i.reduce(function(s,o){const a=o.indexOf("=");if(a!==-1){const l=(function(u){return u.indexOf("-")!==-1&&u.match(qb)===null&&(u=u.replace(Yb,function(h,g){return g.toUpperCase()})),u})(o.slice(0,a)).trim(),d=jo[l]||l;if(d==="ref")return s;const f=s[d]=(function(u,h,g,m){return h==="style"?(function(p){const y=[];if(!p)return y;let x="",S=0,O="";for(let v=0;v<p.length;v++){const w=p[v];if(w==='"'||w==="'")O?w===O&&(O="",S--):(O=w,S++);else if(w==="("&&x.endsWith("url"))S++;else if(w===")"&&S>0)S--;else if(w===";"&&S===0){const j=x.indexOf(":");j>0&&y.push([x.slice(0,j).trim(),x.slice(j+1).trim()]),x="";continue}x+=w}const b=x.indexOf(":");return b>0&&y.push([x.slice(0,b).trim(),x.slice(b+1).trim()]),y})(g).reduce(function(p,[y,x]){return p[y.replace(/(-[a-z])/g,S=>S[1].toUpperCase())]=m(x,u,y),p},{}):Nb.indexOf(h)!==-1?m(Ue(g),u,h):(g.match(Kb)&&(g=Ue(g.slice(1,g.length-1))),g==="true"||g!=="false"&&g)})(t,l,(function(u){const h=u[0];return(h==='"'||h==="'")&&u.length>=2&&u[u.length-1]===h?u.slice(1,-1):u})(o.slice(a+1).trim()),n);typeof f=="string"&&(ns.test(f)||ai.test(f))&&(s[d]=r(f.trim()))}else o!=="style"&&(s[jo[o]||o]=!0);return s},{}):null}function Ro(t,e){for(let n=0;n<t.length;n++)if(t[n].test(e))return!0;return!1}function N0(t="",e={}){e.overrides=e.overrides||{},e.namedCodesToUnicode=e.namedCodesToUnicode?We({},Oo,e.namedCodesToUnicode):Oo;const n=e.slugify||ln,r=e.sanitizer||j0,i=e.createElement||P.createElement,s=[Ao,Co,_o,e.enforceAtxHeadings?To:No,Fo,Eo,Xl,Jl],o=[...s,Xb,ns,Po,ai];function a(m,p,...y){const x=Lr(e.overrides,m+".props",{});return i((function(S,O){const b=Lr(O,S);return b?typeof b=="function"||typeof b=="object"&&"render"in b?b:Lr(O,S+".component",S):S})(m,e.overrides),We({},p,x,{className:_0(p?.className,x.className)||void 0}),...y)}function l(m){m=m.replace(Lb,"");let p=!1;e.forceInline?p=!0:e.forceBlock||(p=e0.test(m)===!1);const y=h(p?m:gn(m).replace(u0,"")+`
|
|
15
|
+
|
|
16
|
+
`,{inline:p});if(e.ast)return y;const x=g(y);for(;Do(x[x.length-1])&&!x[x.length-1].trim();)x.pop();if(d.length&&x.push(a("footer",{key:"footer"},d.map(function(b){return a("div",{id:n(b.identifier,ln),key:b.identifier},b.identifier,g(h(b.footnote,{inline:!0})))}))),e.wrapper===null)return x;const S=e.wrapper||(p?"span":"div");let O;if(x.length>1||e.forceWrapper)O=x;else{if(x.length===1)return O=x[0],typeof O=="string"?a("span",{key:"outer"},O):O;O=null}return i(S,We({key:"outer"},e.wrapperProps),O)}const d=[],f={},u={0:{t:[">"],o:Ze(Ao),u:1,i(m,p,y){const[,x,S]=m[0].replace(Pb,"").match(Eb);return{alert:x,children:p(S,y)}}},1:{t:[" "],o:ot(Ib),u:1,i:Ur},2:{t:function(m,p){if(p.inline||p.simple)return!1;var y=m[0];return y==="-"||y==="*"||y==="_"},o:Ze(Db),u:1,i:Ur},3:{t:[" "],o:Ze(_o),u:0,i:m=>({lang:void 0,text:Ue(gn(m[0].replace(/^ {4}/gm,"")))})},4:{t:["```","~~~"],o:Ze(Co),u:0,i:m=>({attrs:Wr("code",m[3]||"",r,l),lang:m[2]||void 0,text:m[4],type:"3"})},5:{t:["`"],o:Wn($b),u:3,i:m=>({text:Ue(m[2])})},6:{t:["[^"],o:Ze(Rb),u:0,i:m=>(d.push({footnote:m[2],identifier:m[1]}),{})},7:{t:["[^"],o:ot(Bb),u:1,i:m=>({target:"#"+n(m[1],ln),text:m[1]})},8:{t:["[ ]","[x]"],o:ot(Wb),u:1,i:m=>({completed:m[1].toLowerCase()==="x"})},9:{t:["#"],o:Ze(e.enforceAtxHeadings?To:No),u:1,i:(m,p,y)=>({children:Jn(p,m[2],y),id:n(m[2],ln),level:m[1].length})},10:{t:m=>{const p=m.indexOf(`
|
|
17
|
+
`);return p>0&&p<m.length-1&&(m[p+1]==="="||m[p+1]==="-")},o:Ze(Fo),u:1,i:(m,p,y)=>({children:Jn(p,m[1],y),level:m[2]==="="?1:2,type:"9"})},11:{t:["<"],o:ct(Vb),u:1,i(m,p,y){const[,x]=m[3].match(d0),S=RegExp("^"+x,"gm"),O=m[3].replace(S,""),b=Ro(o,O)?A0:Jn,v=m[1].toLowerCase(),w=_b.indexOf(v)!==-1,j=(w?v:m[1]).trim(),A={attrs:Wr(j,m[2],r,l),noInnerParse:w,tag:j};if(y.inAnchor=y.inAnchor||v==="a",w)A.text=m[3];else{const C=y.inHTML;y.inHTML=!0,A.children=b(p,O,y),y.inHTML=C}return y.inAnchor=!1,A}},13:{t:["<"],o:Mo(ai),u:1,i(m){const p=m[1].trim();return{attrs:Wr(p,m[2]||"",r,l),tag:p}}},12:{t:["<!--"],o:Mo(Po),u:1,i:()=>({})},14:{t:["!["],o:Wn(x0),u:1,i:m=>({alt:Ue(m[1]),target:Ue(m[2]),title:Ue(m[3])})},15:{t:["["],o:ot(y0),u:3,i:(m,p,y)=>({children:O0(p,m[1],y),target:Ue(m[2]),title:Ue(m[3])})},16:{t:function(m,p){return!(!p.inline||p.inAnchor)&&m[0]==="<"&&($e(m,":")||$e(m,"@")||$e(m,"/"))},o:ot(Hb),u:0,i(m){let p=m[1],y=!1;return $e(p,"@")&&!$e(p,"//")&&(y=!0,p=p.replace("mailto:","")),{children:[{text:p,type:"27"}],target:y?"mailto:"+p:p,type:"15"}}},17:{t:(m,p)=>!p.inAnchor&&!e.disableAutoLink&&li(m,"http"),o:ot(Gb),u:0,i:m=>({children:[{text:m[1],type:"27"}],target:m[1],title:void 0,type:"15"})},20:Io(0,1),30:Io(0,2),19:{t:[`
|
|
18
|
+
`],o:Ze(kb),u:3,i:Ur},21:{t:function(m,p){return!p.inline&&!p.simple},o:ct(function(m,p){if(p.inline||p.simple||p.inHTML&&!$e(m,`
|
|
19
|
+
|
|
20
|
+
`)&&!$e(p.prevCapture,`
|
|
21
|
+
|
|
22
|
+
`))return null;let y="",x=0;for(;;){const O=m.indexOf(`
|
|
23
|
+
`,x),b=m.slice(x,O===-1?void 0:O+1),v=m[x];if((v===">"||v==="#"||v==="|"||v==="`"||v==="~"||v==="*"||v==="-"||v==="_"||v===" ")&&Ro(s,b)||(y+=b,O===-1||!b.trim()))break;x=O+1}const S=gn(y);return S===""?null:[y,,S]}),u:3,i:C0},22:{t:["["],o:ot(Jb),u:0,i:m=>(f[m[1]]={target:m[2],title:m[4]},{})},23:{t:["!["],o:Wn(Zb),u:0,i:m=>({alt:m[1]?Ue(m[1]):void 0,ref:m[2]})},24:{t:m=>m[0]==="["&&!$e(m,"]("),o:ot(Qb),u:0,i:(m,p,y)=>({children:p(m[1],y),fallbackChildren:m[0],ref:m[2]})},25:{t:["|"],o:Ze(Eo),u:1,i:S0},27:{o:ct(function(m,p){let y;return li(m,":")&&(y=o0.exec(m)),y||c0.exec(m)}),u:4,i(m){const p=m[0];return{text:$e(p,"&")?p.replace(zb,(y,x)=>e.namedCodesToUnicode[x]||y):p}}},34:{t:["*","_","~","="],o:ct(Ab),u:2,i:(m,p,y)=>({children:p(m[2],y),tag:m[1]})},28:{t:["\\"],o:Wn(a0),u:1,i:m=>({text:m[1],type:"27"})}};e.disableParsingRawHTML===!0&&(delete u[11],delete u[13]);const h=(function(m){var p=Object.keys(m);function y(x,S){var O=[];if(S.prevCapture=S.prevCapture||"",x.trim())for(;x;)for(var b=0;b<p.length;){var v=p[b],w=m[v];if(!w.t||b0(x,S,w.t)){var j=w.o(x,S);if(j&&j[0]){x=x.substring(j[0].length);var A=w.i(j,y,S);S.prevCapture+=j[0],A.type||(A.type=v),O.push(A);break}b++}else b++}return S.prevCapture="",O}return p.sort(function(x,S){return m[x].u-m[S].u||(x<S?-1:1)}),function(x,S){return y((function(O){return O.replace(Mb,`
|
|
24
|
+
`).replace(Ub,"").replace(t0," ")})(x),S)}})(u),g=(function(m,p,y,x,S){function O(b){return Array.isArray(b)?b.map(v=>"text"in v?v.text:""):"text"in b?b.text:""}return function b(v,w={}){const j=(w.renderDepth||0)+1;if(j>2500)return O(v);w.renderDepth=j;try{if(Array.isArray(v)){const C=w.key,T=[];let N=!1;for(let _=0;_<v.length;_++){w.key=_;const F=b(v[_],w),$=Do(F);$&&N?T[T.length-1]+=F:F!==null&&T.push(F),N=$}return w.key=C,w.renderDepth=j-1,T}const A=(function(C,T,N){const _=()=>(function(F,$,E,D,M,k,B){switch(F.type){case"0":{const V={key:E.key};return F.alert&&(V.className="markdown-alert-"+k(F.alert.toLowerCase(),ln),F.children.unshift({attrs:{},children:[{type:"27",text:F.alert}],noInnerParse:!0,type:"11",tag:"header"})),D("blockquote",V,$(F.children,E))}case"1":return D("br",{key:E.key});case"2":return D("hr",{key:E.key});case"3":return D("pre",{key:E.key},D("code",We({},F.attrs,{className:F.lang?"lang-"+F.lang:""}),F.text));case"5":return D("code",{key:E.key},F.text);case"7":return D("a",{key:E.key,href:M(F.target,"a","href")},D("sup",{key:E.key},F.text));case"8":return D("input",{checked:F.completed,key:E.key,readOnly:!0,type:"checkbox"});case"9":return D("h"+F.level,{id:F.id,key:E.key},$(F.children,E));case"11":return D(F.tag,We({key:E.key},F.attrs),F.text||(F.children?$(F.children,E):""));case"13":return D(F.tag,We({},F.attrs,{key:E.key}));case"14":return D("img",{key:E.key,alt:F.alt||void 0,title:F.title||void 0,src:M(F.target,"img","src")});case"15":return D("a",{key:E.key,href:M(F.target,"a","href"),title:F.title},$(F.children,E));case"23":return B[F.ref]?D("img",{key:E.key,alt:F.alt,src:M(B[F.ref].target,"img","src"),title:B[F.ref].title}):null;case"24":return B[F.ref]?D("a",{key:E.key,href:M(B[F.ref].target,"a","href"),title:B[F.ref].title},$(F.children,E)):D("span",{key:E.key},F.fallbackChildren);case"25":{const V=F;return D("table",{key:E.key},D("thead",null,D("tr",null,V.header.map(function(R,W){return D("th",{key:W,style:ko(V,W)},$(R,E))}))),D("tbody",null,V.cells.map(function(R,W){return D("tr",{key:W},R.map(function(Q,ne){return D("td",{key:ne,style:ko(V,ne)},$(Q,E))}))})))}case"27":return F.text;case"34":return D(F.tag,{key:E.key},$(F.children,E));case"20":case"30":return D(F.ordered?"ol":"ul",{key:E.key,start:F.type==="20"?F.start:void 0},F.items.map(function(V,R){return D("li",{key:R},$(V,E))}));case"19":return`
|
|
25
|
+
`;case"21":return D("p",{key:E.key},$(F.children,E));default:return null}})(C,T,N,p,y,x,S);return m?m(_,C,T,N):_()})(v,b,w);return w.renderDepth=j-1,A}catch(A){if(A instanceof RangeError&&A.message.includes("Maximum call stack"))return O(v);throw A}}})(e.renderRule,a,r,n,f);return l(t)}const Rn=t=>{let{children:e,options:n}=t,r=(function(i,s){if(i==null)return{};var o={};for(var a in i)if({}.hasOwnProperty.call(i,a)){if(s.indexOf(a)!==-1)continue;o[a]=i[a]}return o})(t,Cb);return N0(e??"",We({},n,{wrapperProps:We({},n?.wrapperProps,r)}))},Zl=Symbol("remove-this-key"),Bo=Symbol("reset");function T0(t,e){return Array.isArray(t.required)&&t.required.indexOf(e)!==-1}function F0(t,e){switch(e){case"array":return[];case"boolean":return!1;case"null":return null;case"number":return 0;case"object":return{};default:return t(K.NewStringDefault)}}function P0(t){const{fieldPathId:e,schema:n,registry:r,uiSchema:i,errorSchema:s,formData:o,onChange:a,onBlur:l,onFocus:d,disabled:f,readonly:u,required:h,hideError:g,propertyName:m,handleKeyRename:p,handleRemoveProperty:y,addedByAdditionalProperties:x}=t,[S,O]=P.useState(!1),{globalFormOptions:b,fields:v}=r,{SchemaField:w}=v,j=$t(Fe(m,b,e.path)),A=P.useCallback((_,F,$,E)=>{_===void 0&&x&&(_=""),a(_,F,$,E)},[a,x]),C=P.useCallback(_=>{m!==_&&O(!0),p(m,_)},[m,p]),T=P.useCallback(_=>{const{target:{value:F}}=_;C(F)},[C]),N=P.useCallback(()=>{y(m)},[m,y]);return c.jsx(w,{name:m,required:h,schema:n,uiSchema:i,errorSchema:s,fieldPathId:j,formData:o,wasPropertyKeyModified:S,onKeyRename:C,onKeyRenameBlur:T,onRemoveProperty:N,onChange:A,onBlur:l,onFocus:d,registry:r,disabled:f,readonly:u,hideError:g})}function E0(t){const{schema:e,uiSchema:n={},formData:r,errorSchema:i,fieldPathId:s,name:o,required:a=!1,disabled:l,readonly:d,hideError:f,onBlur:u,onFocus:h,onChange:g,registry:m,title:p}=t,{fields:y,schemaUtils:x,translateString:S,globalUiOptions:O}=m,{OptionalDataControlsField:b}=y,v=x.retrieveSchema(e,r,!0),w=U(n,O),{properties:j={}}=v,A=t.childFieldPathId??s,C=w.title??v.title??p??o,T=w.description??v.description,N=Mn(m,v,a,n),_=Qt(r);let F=[];const $=P.useCallback((R,W)=>{const{duplicateKeySuffixSeparator:Q="-"}=U(n,O);let ne=0,ie=R;for(;X(W,ie);)ie=`${R}${Q}${++ne}`;return ie},[n,O]),E=P.useCallback(()=>{if(!(v.additionalProperties||v.patternProperties))return;const{translateString:R}=m,W={...r},Q=$("newKey",W);if(v.patternProperties)se(W,Q,null);else{let ne,ie,de;if(Z(v.additionalProperties)){ne=v.additionalProperties.type,ie=v.additionalProperties.const,de=v.additionalProperties.default;let z=v.additionalProperties;if(ce in z){const{schemaUtils:H}=m;z=H.retrieveSchema({[ce]:z[ce]},r),ne=z.type,ie=z.const,de=z.default}!ne&&(J in z||q in z)&&(ne="object")}const ee=ie??de??F0(R,ne);se(W,Q,ee)}g(W,A.path)},[r,g,m,A,$,v]),D=P.useCallback((R,W)=>{if(R!==W){const Q=$(W,r),ne={...r},ie={[R]:Q},de=Object.keys(ne).map(z=>({[ie[z]||z]:ne[z]})),ee=Object.assign({},...de);g(ee,A.path)}},[r,g,A,$]),M=P.useCallback(R=>{g(Zl,[...A.path,R])},[g,A]);if(!N||_)try{const R=Object.keys(j);F=Cx(R,w.order)}catch(R){return c.jsxs("div",{children:[c.jsx("p",{className:"rjsf-config-error",style:{color:"red"},children:c.jsx(Rn,{options:{disableParsingRawHTML:!0},children:S(K.InvalidObjectField,[o||"root",R.message])})}),c.jsx("pre",{children:JSON.stringify(v)})]})}const k=L("ObjectFieldTemplate",m,w),B=N?c.jsx(b,{...t,fieldPathId:A,schema:v}):void 0,V={title:w.label===!1?"":C,description:w.label===!1?void 0:T,properties:F.map(R=>{const W=X(v,[te,R,et]),Q=W?n.additionalProperties:n[R],ne=U(Q).widget==="hidden";return{content:c.jsx(P0,{propertyName:R,required:T0(v,R),schema:I(v,[te,R],{}),uiSchema:Q,errorSchema:I(i,[R]),fieldPathId:A,formData:I(r,[R]),handleKeyRename:D,handleRemoveProperty:M,addedByAdditionalProperties:W,onChange:g,onBlur:u,onFocus:h,registry:m,disabled:l,readonly:d,hideError:f},R),name:R,readonly:d,disabled:l,required:a,hidden:ne}}),readonly:d,disabled:l,required:a,fieldPathId:s,uiSchema:n,errorSchema:i,schema:v,formData:r,registry:m,optionalDataControl:B,className:N?"rjsf-optional-object-field":void 0};return c.jsx(k,{...V,onAddProperty:E})}function I0(t){const{schema:e,uiSchema:n={},formData:r,disabled:i=!1,readonly:s=!1,onChange:o,errorSchema:a,fieldPathId:l,registry:d}=t,{globalUiOptions:f={},schemaUtils:u,translateString:h}=d,g=U(n,f),m=L("OptionalDataControlsTemplate",d,g),p=Qt(r);let y,x,S,O;if(i||s)y=kr(l,"Msg"),x=p?void 0:h(K.OptionalObjectEmptyMsg);else{const b=p?K.OptionalObjectRemove:K.OptionalObjectAdd;x=h(b),p?(y=kr(l,"Remove"),O=()=>o(void 0,l.path,a)):(y=kr(l,"Add"),S=()=>{let v=u.getDefaultFormState(e,r,"excludeObjectChildren");v===void 0&&(v=Ie(e)==="array"?[]:{}),o(v,l.path,a)})}return x&&c.jsx(m,{id:y,registry:d,schema:e,uiSchema:n,label:x,onAddClick:S,onRemoveClick:O})}const D0={array:"ArrayField",boolean:"BooleanField",integer:"NumberField",number:"NumberField",object:"ObjectField",string:"StringField",null:"NullField"};function $0(t,e,n){const r=e.field,{fields:i}=n;if(typeof r=="function")return r;if(typeof r=="string"&&r in i)return i[r];const s=Ie(t),o=Array.isArray(s)?s[0]:s||"",a=t.$id;let l=D0[o];return a&&a in i&&(l=a),!l&&(t.anyOf||t.oneOf)?()=>null:l in i?i[l]:i.FallbackField}function k0(t){const{schema:e,fieldPathId:n,uiSchema:r,formData:i,errorSchema:s,name:o,onChange:a,onKeyRename:l,onKeyRenameBlur:d,onRemoveProperty:f,required:u=!1,registry:h,wasPropertyKeyModified:g=!1}=t,{schemaUtils:m,globalFormOptions:p,globalUiOptions:y,fields:x}=h,{AnyOfField:S,OneOfField:O}=x,b=U(r,y),v=L("FieldTemplate",h,b),w=L("DescriptionFieldTemplate",h,b),j=L("FieldHelpTemplate",h,b),A=L("FieldErrorTemplate",h,b),C=m.retrieveSchema(e,i),T=n[oe],N=P.useCallback((De,nn,Je,Tc)=>a(De,nn,Je,Tc||T),[T,a]),_=$0(C,b,h),F=!!(b.disabled??t.disabled),$=!!(b.readonly??(t.readonly||t.schema.readOnly||C.readOnly)),E=b.hideError,D=E===void 0?t.hideError:!!E,M=!!(b.autofocus??t.autofocus);if(Object.keys(C).length===0)return null;let k=m.getDisplayLabel(C,r,y);const B=b.field&&b.fieldReplacesAnyOrOneOf===!0;let V,R,W={fieldPathId:n};if((J in C||q in C)&&!B&&!m.isSelect(C)){C[J]?(V=S,R=C[J].map(Je=>m.retrieveSchema(Z(Je)?Je:{},i))):C[q]&&(V=O,R=C[q].map(Je=>m.retrieveSchema(Z(Je)?Je:{},i)));const De=Mn(h,C,u,r),nn=Qt(i);k=k&&(!De||nn),W={childFieldPathId:n,fieldPathId:Fe("XxxOf",p,n)}}const{__errors:Q,...ne}=s||{},ie=wn(r,["ui:classNames","classNames","ui:style"]);ut in ie&&(ie[ut]=wn(ie[ut],["classNames","style"]));const de=c.jsx(_,{...t,onChange:N,...W,schema:C,uiSchema:ie,disabled:F,readonly:$,hideError:D,autofocus:M,errorSchema:ne,rawErrors:Q}),ee=n[oe];let z;g?z=o:z=et in C?o:b.title||t.schema.title||C.title||t.title||o;const H=b.description||t.schema.description||C.description||"",re=b.help,fe=b.widget==="hidden",je=["rjsf-field",`rjsf-field-${Ie(C)}`];!D&&Q&&Q.length>0&&je.push("rjsf-field-error"),b.classNames&&je.push(b.classNames);const Se=c.jsx(j,{help:re,fieldPathId:n,schema:C,uiSchema:r,hasErrors:!D&&Q&&Q.length>0,registry:h}),pe=D||V&&!m.isSelect(C)?void 0:c.jsx(A,{errors:Q,errorSchema:s,fieldPathId:n,schema:C,uiSchema:r,registry:h}),Oe={description:c.jsx(w,{id:Dt(ee),description:H,schema:C,uiSchema:r,registry:h}),rawDescription:H,help:Se,rawHelp:typeof re=="string"?re:void 0,errors:pe,rawErrors:D?void 0:Q,fieldPathId:n,id:ee,label:z,hidden:fe,onChange:a,onKeyRename:l,onKeyRenameBlur:d,onRemoveProperty:f,required:u,disabled:F,readonly:$,hideError:D,displayLabel:k,classNames:je.join(" ").trim(),style:b.style,formData:i,schema:C,uiSchema:r,registry:h};return c.jsx(v,{...Oe,children:c.jsxs(c.Fragment,{children:[de,V&&c.jsx(V,{name:o,disabled:F,readonly:$,hideError:D,errorSchema:s,formData:i,fieldPathId:n,onBlur:t.onBlur,onChange:t.onChange,onFocus:t.onFocus,options:R,registry:h,required:u,schema:C,uiSchema:r})]})})}class M0 extends P.Component{shouldComponentUpdate(e){const{registry:{globalFormOptions:n}}=this.props,{experimental_componentUpdateStrategy:r="customDeep"}=n;return kl(this,e,this.state,r)}render(){return c.jsx(k0,{...this.props})}}function R0(t){const{schema:e,name:n,uiSchema:r,fieldPathId:i,formData:s,required:o,disabled:a=!1,readonly:l=!1,autofocus:d=!1,onChange:f,onBlur:u,onFocus:h,registry:g,rawErrors:m,hideError:p,title:y}=t,{title:x,format:S}=e,{widgets:O,schemaUtils:b,globalUiOptions:v}=g,w=b.isSelect(e)?Gt(e,r):void 0;let j=w?"select":"text";S&&jx(e,S,O)&&(j=S);const{widget:A=j,placeholder:C="",title:T,...N}=U(r),_=b.getDisplayLabel(e,r,v),F=T??y??x??n,$=He(e,A,O),E=P.useCallback((D,M,k)=>f(D,i.path,M,k),[f,i]);return c.jsx($,{options:{...N,enumOptions:w},schema:e,uiSchema:r,id:i.$id,name:n,label:F,hideLabel:!_,hideError:p,value:s,onChange:E,onBlur:u,onFocus:h,required:o,disabled:a,readonly:l,autofocus:d,registry:g,placeholder:C,rawErrors:m,htmlName:i.name})}function B0(t){const{formData:e,onChange:n,fieldPathId:r}=t;return P.useEffect(()=>{e===void 0&&n(null,r.path)},[r,e,n]),null}function U0(){return{AnyOfField:So,ArrayField:Hx,BooleanField:Yx,FallbackField:Qx,LayoutGridField:ts,LayoutHeaderField:bb,LayoutMultiSchemaField:vb,NumberField:jb,ObjectField:E0,OneOfField:So,OptionalDataControlsField:I0,SchemaField:M0,StringField:R0,NullField:B0}}function L0(t){const{fieldPathId:e,description:n,registry:r,schema:i,uiSchema:s}=t,o=U(s,r.globalUiOptions),{label:a=!0}=o;if(!n||!a)return null;const l=L("DescriptionFieldTemplate",r,o);return c.jsx(l,{id:Dt(e),description:n,schema:i,uiSchema:s,registry:r})}function W0(t){const{children:e,className:n,buttonsProps:r,displayLabel:i,hasDescription:s,hasToolbar:o,registry:a,uiSchema:l}=t,d=U(l),f=L("ArrayFieldItemButtonsTemplate",a,d),u={flex:1,paddingLeft:6,paddingRight:6,fontWeight:"bold"},h=s?31:9,g={display:"flex",alignItems:i?"center":"baseline"},m={display:"flex",justifyContent:"flex-end",marginTop:i?`${h}px`:0};return c.jsxs("div",{className:n,style:g,children:[c.jsx("div",{className:o?"col-xs-9 col-md-10 col-xl-11":"col-xs-12",children:e}),o&&c.jsx("div",{className:"col-xs-3 col-md-2 col-xl-1 array-item-toolbox",children:c.jsx("div",{className:"btn-group",style:m,children:c.jsx(f,{...r,style:u})})})]})}function V0(t){const{disabled:e,hasCopy:n,hasMoveDown:r,hasMoveUp:i,hasRemove:s,fieldPathId:o,onCopyItem:a,onRemoveItem:l,onMoveDownItem:d,onMoveUpItem:f,readonly:u,registry:h,uiSchema:g}=t,{CopyButton:m,MoveDownButton:p,MoveUpButton:y,RemoveButton:x}=h.templates.ButtonTemplates;return c.jsxs(c.Fragment,{children:[(i||r)&&c.jsx(y,{id:qe(o,"moveUp"),className:"rjsf-array-item-move-up",disabled:e||u||!i,onClick:f,uiSchema:g,registry:h}),(i||r)&&c.jsx(p,{id:qe(o,"moveDown"),className:"rjsf-array-item-move-down",disabled:e||u||!r,onClick:d,uiSchema:g,registry:h}),n&&c.jsx(m,{id:qe(o,"copy"),className:"rjsf-array-item-copy",disabled:e||u,onClick:a,uiSchema:g,registry:h}),s&&c.jsx(x,{id:qe(o,"remove"),className:"rjsf-array-item-remove",disabled:e||u,onClick:l,uiSchema:g,registry:h})]})}function z0(t){const{canAdd:e,className:n,disabled:r,fieldPathId:i,uiSchema:s,items:o,optionalDataControl:a,onAddClick:l,readonly:d,registry:f,required:u,schema:h,title:g}=t,m=U(s),p=L("ArrayFieldDescriptionTemplate",f,m),y=L("ArrayFieldTitleTemplate",f,m),x=!d&&!r,{ButtonTemplates:{AddButton:S}}=f.templates;return c.jsxs("fieldset",{className:n,id:i.$id,children:[c.jsx(y,{fieldPathId:i,title:m.title||g,required:u,schema:h,uiSchema:s,registry:f,optionalDataControl:x?a:void 0}),c.jsx(p,{fieldPathId:i,description:m.description||h.description,schema:h,uiSchema:s,registry:f}),x?void 0:a,c.jsx("div",{className:"row array-item-list",children:o}),e&&c.jsx(S,{id:qe(i,"add"),className:"rjsf-array-item-add",onClick:l,disabled:r||d,uiSchema:s,registry:f})]})}function q0(t){const{fieldPathId:e,title:n,schema:r,uiSchema:i,required:s,registry:o,optionalDataControl:a}=t,l=U(i,o.globalUiOptions),{label:d=!0}=l;if(!n||!d)return null;const f=L("TitleFieldTemplate",o,l);return c.jsx(f,{id:hr(e),title:n,required:s,schema:r,uiSchema:i,registry:o,optionalDataControl:a})}function K0(t){const{id:e,name:n,htmlName:r,value:i,readonly:s,disabled:o,autofocus:a,onBlur:l,onFocus:d,onChange:f,onChangeOverride:u,options:h,schema:g,uiSchema:m,registry:p,rawErrors:y,type:x,hideLabel:S,hideError:O,...b}=t,{ClearButton:v}=p.templates.ButtonTemplates;if(!e)throw console.log("No id for",t),new Error(`no id for props ${JSON.stringify(t)}`);const w={...b,...El(g,x,h)};let j;w.type==="number"||w.type==="integer"?j=i||i===0?i:"":j=i??"";const A=P.useCallback(({target:{value:_}})=>f(_===""?h.emptyValue:_),[f,h]),C=P.useCallback(({target:_})=>l(e,_&&_.value),[l,e]),T=P.useCallback(({target:_})=>d(e,_&&_.value),[d,e]),N=P.useCallback(_=>{_.preventDefault(),_.stopPropagation(),f(h.emptyValue??"")},[f,h.emptyValue]);return c.jsxs(c.Fragment,{children:[c.jsx("input",{id:e,name:r||e,className:"form-control",readOnly:s,disabled:o,autoFocus:a,value:j,...w,list:g.examples?_n(e):void 0,onChange:u||A,onBlur:C,onFocus:T,"aria-describedby":we(e,!!g.examples)}),h.allowClearTextInputs&&!s&&!o&&j&&c.jsx(v,{registry:p,onClick:N}),Array.isArray(g.examples)&&c.jsx("datalist",{id:_n(e),children:g.examples.concat(g.default&&!g.examples.includes(g.default)?[g.default]:[]).map(_=>c.jsx("option",{value:_},_))},`datalist_${e}`)]})}function G0({uiSchema:t}){const{submitText:e,norender:n,props:r={}}=Il(t);return n?null:c.jsx("div",{children:c.jsx("button",{type:"submit",...r,className:`btn btn-info ${r.className||""}`,children:e})})}function xt(t){const{iconType:e="default",icon:n,className:r,uiSchema:i,registry:s,...o}=t;return c.jsx("button",{type:"button",className:`btn btn-${e} ${r}`,...o,children:c.jsx("i",{className:`glyphicon glyphicon-${n}`})})}function H0(t){const{registry:{translateString:e}}=t;return c.jsx(xt,{title:e(K.CopyButton),...t,icon:"copy"})}function Y0(t){const{registry:{translateString:e}}=t;return c.jsx(xt,{title:e(K.MoveDownButton),...t,icon:"arrow-down"})}function X0(t){const{registry:{translateString:e}}=t;return c.jsx(xt,{title:e(K.MoveUpButton),...t,icon:"arrow-up"})}function J0(t){const{registry:{translateString:e}}=t;return c.jsx(xt,{title:e(K.RemoveButton),...t,iconType:"danger",icon:"remove"})}function Z0({id:t,className:e,onClick:n,disabled:r,registry:i,...s}){const{translateString:o}=i;return c.jsx(xt,{id:t,iconType:"default",icon:"remove",className:"btn-clear col-xs-12",title:o(K.ClearButton),onClick:n,disabled:r,registry:i,...s})}function Q0({id:t,className:e,onClick:n,disabled:r,registry:i}){const{translateString:s}=i;return c.jsx("div",{className:"row",children:c.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 ${e}`,children:c.jsx(xt,{id:t,iconType:"info",icon:"plus",className:"btn-add col-xs-12",title:s(K.AddButton),onClick:n,disabled:r,registry:i})})})}function e1(){return{SubmitButton:G0,AddButton:Q0,CopyButton:H0,MoveDownButton:Y0,MoveUpButton:X0,RemoveButton:J0,ClearButton:Z0}}const Ql=Yi();function ss({description:t,registry:e,uiSchema:n={}}){const{globalUiOptions:r}=e;return U(n,r).enableMarkdownInDescription&&typeof t=="string"?c.jsx(Rn,{options:{disableParsingRawHTML:!0},"data-testid":Ql.markdown,children:t}):t}ss.TEST_IDS=Ql;function t1(t){const{id:e,description:n,registry:r,uiSchema:i}=t;return n?c.jsx("div",{id:e,className:"field-description",children:c.jsx(ss,{description:n,registry:r,uiSchema:i})}):null}function n1({errors:t,registry:e}){const{translateString:n}=e;return c.jsxs("div",{className:"panel panel-danger errors",children:[c.jsx("div",{className:"panel-heading",children:c.jsx("h3",{className:"panel-title",children:n(K.ErrorsLabel)})}),c.jsx("ul",{className:"list-group",children:t.map((r,i)=>c.jsx("li",{className:"list-group-item text-danger",children:r.stack},i))})]})}function r1(t){const{schema:e,registry:n,typeSelector:r,schemaField:i}=t,s=L("MultiSchemaFieldTemplate",n);return c.jsx(s,{selector:r,optionSchemaField:i,schema:e,registry:n})}const i1="*";function ec(t){const{label:e,required:n,id:r}=t;return e?c.jsxs("label",{className:"control-label",htmlFor:r,children:[e,n&&c.jsx("span",{className:"required",children:i1})]}):null}function s1(t){const{id:e,label:n,children:r,errors:i,help:s,description:o,hidden:a,required:l,displayLabel:d,registry:f,uiSchema:u}=t,h=U(u),g=L("WrapIfAdditionalTemplate",f,h);if(a)return c.jsx("div",{className:"hidden",children:r});const m=h.widget==="checkbox";return c.jsxs(g,{...t,children:[d&&!m&&c.jsx(ec,{label:n,required:l,id:e}),d&&o?o:null,r,i,s]})}function o1(t){const{errors:e=[],fieldPathId:n}=t;if(e.length===0)return null;const r=Xi(n);return c.jsx("div",{children:c.jsx("ul",{id:r,className:"error-detail bs-callout bs-callout-info",children:e.filter(i=>!!i).map((i,s)=>c.jsx("li",{className:"text-danger",children:i},s))})})}const tc=Yi();function os({help:t,registry:e,uiSchema:n={}}){const{globalUiOptions:r}=e;return U(n,r).enableMarkdownInHelp&&typeof t=="string"?c.jsx(Rn,{options:{disableParsingRawHTML:!0},"data-testid":tc.markdown,children:t}):t}os.TEST_IDS=tc;function a1(t){const{fieldPathId:e,help:n,uiSchema:r,registry:i}=t;return n?c.jsx("div",{id:Ji(e),className:"help-block",children:c.jsx(os,{help:n,registry:i,uiSchema:r})}):null}function l1(t){const{children:e,column:n,className:r,...i}=t;return c.jsx("div",{className:r,...i,children:e})}function c1(t){const{selector:e,optionSchemaField:n}=t;return c.jsxs("div",{className:"panel panel-default panel-body",children:[c.jsx("div",{className:"form-group",children:e}),n]})}function u1(t){const{className:e,description:n,disabled:r,formData:i,fieldPathId:s,onAddProperty:o,optionalDataControl:a,properties:l,readonly:d,registry:f,required:u,schema:h,title:g,uiSchema:m}=t,p=U(m),y=L("TitleFieldTemplate",f,p),x=L("DescriptionFieldTemplate",f,p);if((h.oneOf||h.anyOf)&&!h.properties&&l.length===0)return null;const O=!d&&!r,{ButtonTemplates:{AddButton:b}}=f.templates;return c.jsxs("fieldset",{className:e,id:s.$id,children:[g&&c.jsx(y,{id:hr(s),title:g,required:u,schema:h,uiSchema:m,registry:f,optionalDataControl:O?a:void 0}),n&&c.jsx(x,{id:Dt(s),description:n,schema:h,uiSchema:m,registry:f}),O?void 0:a,l.map(v=>v.content),ma(h,m,i)&&c.jsx(b,{id:qe(s,"add"),className:"rjsf-object-property-expand",onClick:o,disabled:r||d,uiSchema:m,registry:f})]})}function d1(t){const{id:e,registry:n,label:r,onAddClick:i,onRemoveClick:s}=t;return i?c.jsx(xt,{id:e,registry:n,icon:"plus",className:"rjsf-add-optional-data btn-sm",onClick:i,title:r}):s?c.jsx(xt,{id:e,registry:n,icon:"remove",className:"rjsf-remove-optional-data btn-sm",onClick:s,title:r}):c.jsx("em",{id:e,children:r})}const f1="*";function m1(t){const{id:e,title:n,required:r,optionalDataControl:i}=t;return c.jsxs("legend",{id:e,children:[n,r&&c.jsx("span",{className:"required",children:f1}),i&&c.jsx("span",{className:"pull-right",style:{marginBottom:"2px"},children:i})]})}function h1(t){const{schema:e,fieldPathId:n,reason:r,registry:i}=t,{translateString:s}=i;let o=K.UnsupportedField;const a=[];return n&&n.$id&&(o=K.UnsupportedFieldWithId,a.push(n.$id)),r&&(o=o===K.UnsupportedField?K.UnsupportedFieldWithReason:K.UnsupportedFieldWithIdAndReason,a.push(r)),c.jsxs("div",{className:"unsupported-field",children:[c.jsx("p",{children:c.jsx(Rn,{options:{disableParsingRawHTML:!0},children:s(o,a)})}),e&&c.jsx("pre",{children:JSON.stringify(e,null,2)})]})}function p1(t){const{id:e,classNames:n,style:r,disabled:i,displayLabel:s,label:o,onKeyRenameBlur:a,onRemoveProperty:l,rawDescription:d,readonly:f,required:u,schema:h,hideError:g,rawErrors:m,children:p,uiSchema:y,registry:x}=t,{templates:S,translateString:O}=x,{RemoveButton:b}=S.ButtonTemplates,v=O(K.KeyLabel,[o]),w=et in h,j=!!d,A=["form-group",n];!g&&m&&m.length>0&&A.push("has-error has-danger");const C=A.join(" ").trim();if(!w)return c.jsx("div",{className:C,style:r,children:p});const T=j?46:26;return c.jsx("div",{className:C,style:r,children:c.jsxs("div",{className:"row",children:[c.jsx("div",{className:"col-xs-5 form-additional",children:c.jsxs("div",{className:"form-group",children:[s&&c.jsx(ec,{label:v,required:u,id:`${e}-key`}),s&&d&&c.jsx("div",{children:" "}),c.jsx("input",{className:"form-control",type:"text",id:`${e}-key`,onBlur:a,defaultValue:o})]})}),c.jsx("div",{className:"form-additional form-group col-xs-5",children:p}),c.jsx("div",{className:"col-xs-2",style:{marginTop:s?`${T}px`:void 0},children:c.jsx(b,{id:qe(e,"remove"),className:"rjsf-object-property-remove btn-block",style:{border:"0"},disabled:i||f,onClick:l,uiSchema:y,registry:x})})]})})}function g1(){return{ArrayFieldDescriptionTemplate:L0,ArrayFieldItemTemplate:W0,ArrayFieldItemButtonsTemplate:V0,ArrayFieldTemplate:z0,ArrayFieldTitleTemplate:q0,ButtonTemplates:e1(),BaseInputTemplate:K0,DescriptionFieldTemplate:t1,ErrorListTemplate:n1,FallbackFieldTemplate:r1,FieldTemplate:s1,FieldErrorTemplate:o1,FieldHelpTemplate:a1,GridTemplate:l1,MultiSchemaFieldTemplate:c1,ObjectFieldTemplate:u1,OptionalDataControlsTemplate:d1,TitleFieldTemplate:m1,UnsupportedFieldTemplate:h1,WrapIfAdditionalTemplate:p1}}function y1(t){const{disabled:e=!1,readonly:n=!1,autofocus:r=!1,options:i,id:s,name:o,registry:a,onBlur:l,onFocus:d}=t,{translateString:f}=a,{elements:u,handleChange:h,handleClear:g,handleSetNow:m}=Fx(t);return c.jsxs("ul",{className:"list-inline",children:[u.map((p,y)=>c.jsx("li",{className:"list-inline-item",children:c.jsx(Tx,{rootId:s,name:o,select:h,...p,disabled:e,readonly:n,registry:a,onBlur:l,onFocus:d,autofocus:r&&y===0})},y)),(i.hideNowButton!=="undefined"?!i.hideNowButton:!0)&&c.jsx("li",{className:"list-inline-item",children:c.jsx("a",{href:"#",className:"btn btn-info btn-now",onClick:m,children:f(K.NowLabel)})}),(i.hideClearButton!=="undefined"?!i.hideClearButton:!0)&&c.jsx("li",{className:"list-inline-item",children:c.jsx("a",{href:"#",className:"btn btn-warning btn-clear",onClick:g,children:f(K.ClearLabel)})})]})}function x1({time:t=!0,...e}){const{AltDateWidget:n}=e.registry.widgets;return c.jsx(n,{time:t,...e})}function b1({schema:t,uiSchema:e,options:n,id:r,value:i,disabled:s,readonly:o,label:a,hideLabel:l,autofocus:d=!1,onBlur:f,onFocus:u,onChange:h,registry:g,htmlName:m}){const p=L("DescriptionFieldTemplate",g,n),y=hn(t),x=P.useCallback(j=>h(j.target.checked),[h]),S=P.useCallback(j=>f(r,j.target.checked),[f,r]),O=P.useCallback(j=>u(r,j.target.checked),[u,r]),w=U(e).widget==="checkbox"?void 0:n.description??t.description;return c.jsxs("div",{className:`checkbox ${s||o?"disabled":""}`,children:[!l&&w&&c.jsx(p,{id:Dt(r),description:w,schema:t,uiSchema:e,registry:g}),c.jsxs("label",{children:[c.jsx("input",{type:"checkbox",id:r,name:m||r,checked:typeof i>"u"?!1:i,required:y,disabled:s||o,autoFocus:d,onChange:x,onBlur:S,onFocus:O,"aria-describedby":we(r)}),$l(c.jsx("span",{children:a}),l)]})]})}function v1({id:t,disabled:e,options:{inline:n=!1,enumOptions:r,enumDisabled:i,emptyValue:s},value:o,autofocus:a=!1,readonly:l,onChange:d,onBlur:f,onFocus:u,htmlName:h}){const g=Array.isArray(o)?o:[o],m=P.useCallback(({target:y})=>f(t,ge(y&&y.value,r,s)),[f,t,r,s]),p=P.useCallback(({target:y})=>u(t,ge(y&&y.value,r,s)),[u,t,r,s]);return c.jsx("div",{className:"checkboxes",id:t,children:Array.isArray(r)&&r.map((y,x)=>{const S=kn(y.value,g),O=Array.isArray(i)&&i.indexOf(y.value)!==-1,b=e||O||l?"disabled":"",v=j=>{j.target.checked?d(Tl(x,g,r)):d(_l(x,g,r))},w=c.jsxs("span",{children:[c.jsx("input",{type:"checkbox",id:jt(t,x),name:h||t,checked:S,value:String(x),disabled:e||O||l,autoFocus:a&&x===0,onChange:v,onBlur:m,onFocus:p,"aria-describedby":we(t)}),c.jsx("span",{children:y.label})]});return n?c.jsx("label",{className:`checkbox-inline ${b}`,children:w},x):c.jsx("div",{className:`checkbox ${b}`,children:c.jsx("label",{children:w})},x)})})}function S1(t){const{disabled:e,readonly:n,options:r,registry:i}=t,s=L("BaseInputTemplate",i,r);return c.jsx(s,{type:"color",...t,disabled:e||n})}function w1(t){const{onChange:e,options:n,registry:r}=t,i=L("BaseInputTemplate",r,n),s=P.useCallback(o=>e(o||void 0),[e]);return c.jsx(i,{type:"date",...t,onChange:s})}function j1(t){const{onChange:e,value:n,options:r,registry:i}=t,s=L("BaseInputTemplate",i,r);return c.jsx(s,{type:"datetime-local",...t,value:$x(n),onChange:o=>e(Ax(o))})}function O1(t){const{options:e,registry:n}=t,r=L("BaseInputTemplate",n,e);return c.jsx(r,{type:"email",...t})}function A1({fileInfo:t,registry:e}){const{translateString:n}=e,{dataURL:r,type:i,name:s}=t;return r?["image/jpeg","image/png"].includes(i)?c.jsx("img",{src:r,style:{maxWidth:"100%"},className:"file-preview"}):c.jsxs(c.Fragment,{children:[" ",c.jsx("a",{download:`preview-${s}`,href:r,className:"file-download",children:n(K.PreviewLabel)})]}):null}function C1({filesInfo:t,registry:e,preview:n,onRemove:r,options:i}){if(t.length===0)return null;const{translateString:s}=e,{RemoveButton:o}=L("ButtonTemplates",e,i);return c.jsx("ul",{className:"file-info",children:t.map((a,l)=>{const{name:d,size:f,type:u}=a,h=()=>r(l);return c.jsxs("li",{children:[c.jsx(Rn,{children:s(K.FilesInfo,[d,u,String(f)])}),n&&c.jsx(A1,{fileInfo:a,registry:e}),c.jsx(o,{onClick:h,registry:e})]},l)})})}function _1(t){const{disabled:e,readonly:n,required:r,multiple:i,onChange:s,value:o,options:a,registry:l}=t,{filesInfo:d,handleChange:f,handleRemove:u}=Dx(o,s,i),h=L("BaseInputTemplate",l,a),g=m=>{m.target.files&&f(m.target.files)};return c.jsxs("div",{children:[c.jsx(h,{...t,disabled:e||n,type:"file",required:o?!1:r,onChangeOverride:g,value:"",accept:a.accept?String(a.accept):void 0}),c.jsx(C1,{filesInfo:d,onRemove:u,registry:l,preview:a.filePreview,options:a})]})}function N1({id:t,value:e,htmlName:n}){return c.jsx("input",{type:"hidden",id:t,name:n||t,value:typeof e>"u"?"":e})}function T1(t){const{options:e,registry:n}=t,r=L("BaseInputTemplate",n,e);return c.jsx(r,{type:"password",...t})}function F1({options:t,value:e,required:n,disabled:r,readonly:i,autofocus:s=!1,onBlur:o,onFocus:a,onChange:l,id:d,htmlName:f}){const{enumOptions:u,enumDisabled:h,inline:g,emptyValue:m}=t,p=P.useCallback(({target:x})=>o(d,ge(x&&x.value,u,m)),[o,u,m,d]),y=P.useCallback(({target:x})=>a(d,ge(x&&x.value,u,m)),[a,u,m,d]);return c.jsx("div",{className:"field-radio-group",id:d,role:"radiogroup",children:Array.isArray(u)&&u.map((x,S)=>{const O=kn(x.value,e),b=Array.isArray(h)&&h.indexOf(x.value)!==-1,v=r||b||i?"disabled":"",w=()=>l(x.value),j=c.jsxs("span",{children:[c.jsx("input",{type:"radio",id:jt(d,S),checked:O,name:f||d,required:n,value:String(S),disabled:r||b||i,autoFocus:s&&S===0,onChange:w,onBlur:p,onFocus:y,"aria-describedby":we(d)}),c.jsx("span",{children:x.label})]});return g?c.jsx("label",{className:`radio-inline ${v}`,children:j},S):c.jsx("div",{className:`radio ${v}`,children:c.jsx("label",{children:j})},S)})})}function P1(t){const{value:e,registry:{templates:{BaseInputTemplate:n}}}=t;return c.jsxs("div",{className:"field-range-wrapper",children:[c.jsx(n,{type:"range",...t}),c.jsx("span",{className:"range-view",children:e})]})}function E1({id:t,value:e,required:n,disabled:r,readonly:i,autofocus:s,onChange:o,onFocus:a,onBlur:l,schema:d,options:f,htmlName:u}){const{stars:h=5,shape:g="star"}=f,m=d.maximum?Math.min(d.maximum,5):Math.min(Math.max(h,1),5),p=d.minimum||0,y=P.useCallback(b=>{!r&&!i&&o(b)},[o,r,i]),x=P.useCallback(b=>{if(a){const v=Number(b.target.dataset.value);a(t,v)}},[a,t]),S=P.useCallback(b=>{if(l){const v=Number(b.target.dataset.value);l(t,v)}},[l,t]),O=b=>g==="heart"?b?"♥":"♡":b?"★":"☆";return c.jsx(c.Fragment,{children:c.jsxs("div",{className:"rating-widget",style:{display:"inline-flex",fontSize:"1.5rem",cursor:r||i?"default":"pointer"},children:[[...Array(m)].map((b,v)=>{const w=p+v,j=w<=e;return c.jsx("span",{onClick:()=>y(w),onFocus:x,onBlur:S,"data-value":w,tabIndex:r||i?-1:0,role:"radio","aria-checked":w===e,"aria-label":`${w} ${g==="heart"?"heart":"star"}${w===1?"":"s"}`,style:{color:j?"#FFD700":"#ccc",padding:"0 0.2rem",transition:"color 0.2s",userSelect:"none"},children:O(j)},v)}),c.jsx("input",{type:"hidden",id:t,name:u||t,value:e||"",required:n,disabled:r||i,"aria-hidden":"true"})]})})}function Vr(t,e){return e?Array.from(t.target.options).slice().filter(n=>n.selected).map(n=>n.value):t.target.value}function I1({schema:t,id:e,options:n,value:r,required:i,disabled:s,readonly:o,multiple:a=!1,autofocus:l=!1,onChange:d,onBlur:f,onFocus:u,placeholder:h,htmlName:g}){const{enumOptions:m,enumDisabled:p,emptyValue:y}=n,x=a?[]:"",S=P.useCallback(j=>{const A=Vr(j,a);return u(e,ge(A,m,y))},[u,e,a,m,y]),O=P.useCallback(j=>{const A=Vr(j,a);return f(e,ge(A,m,y))},[f,e,a,m,y]),b=P.useCallback(j=>{const A=Vr(j,a);return d(ge(A,m,y))},[d,a,m,y]),v=Nl(r,m,a),w=!a&&t.default===void 0;return c.jsxs("select",{id:e,name:g||e,multiple:a,role:"combobox",className:"form-control",value:typeof v>"u"?x:v,required:i,disabled:s||o,autoFocus:l,onBlur:O,onFocus:S,onChange:b,"aria-describedby":we(e),children:[w&&c.jsx("option",{value:"",children:h}),Array.isArray(m)&&m.map(({value:j,label:A},C)=>{const T=p&&p.indexOf(j)!==-1;return c.jsx("option",{value:String(C),disabled:T,children:A},C)})]})}function D1({id:t,options:e={},placeholder:n,value:r,required:i,disabled:s,readonly:o,autofocus:a=!1,onChange:l,onBlur:d,onFocus:f,htmlName:u}){const h=P.useCallback(({target:{value:p}})=>l(p===""?e.emptyValue:p),[l,e.emptyValue]),g=P.useCallback(({target:p})=>d(t,p&&p.value),[d,t]),m=P.useCallback(({target:p})=>f(t,p&&p.value),[t,f]);return c.jsx("textarea",{id:t,name:u||t,className:"form-control",value:r||"",placeholder:n,required:i,disabled:s,readOnly:o,autoFocus:a,rows:e.rows,onBlur:g,onFocus:m,onChange:h,"aria-describedby":we(t)})}function $1(t){const{options:e,registry:n}=t,r=L("BaseInputTemplate",n,e);return c.jsx(r,{...t})}function k1(t){const{onChange:e,options:n,registry:r}=t,i=L("BaseInputTemplate",r,n),s=P.useCallback(o=>e(o?`${o}:00`:void 0),[e]);return c.jsx(i,{type:"time",...t,onChange:s})}function M1(t){const{options:e,registry:n}=t,r=L("BaseInputTemplate",n,e);return c.jsx(r,{type:"url",...t})}function R1(t){const{options:e,registry:n}=t,r=L("BaseInputTemplate",n,e);return c.jsx(r,{type:"number",...t})}function B1(){return{AltDateWidget:y1,AltDateTimeWidget:x1,CheckboxWidget:b1,CheckboxesWidget:v1,ColorWidget:S1,DateWidget:w1,DateTimeWidget:j1,EmailWidget:O1,FileWidget:_1,HiddenWidget:N1,PasswordWidget:T1,RadioWidget:F1,RangeWidget:P1,RatingWidget:E1,SelectWidget:I1,TextWidget:$1,TextareaWidget:D1,TimeWidget:k1,UpDownWidget:R1,URLWidget:M1}}function U1(){return{fields:U0(),templates:g1(),widgets:B1(),rootSchema:{},formContext:{},translateString:cx,globalFormOptions:{idPrefix:ua,idSeparator:da,useFallbackUiForUnsupportedType:!1}}}function Mt(t,e){return{...Gi(t,["schema","uiSchema","fieldPathId","schemaUtils","formData","edit","errors","errorSchema"]),...e!==void 0&&{status:e}}}let L1=class extends P.Component{formElement;pendingChanges=[];_isProcessingUserChange=!1;constructor(e){if(super(e),!e.validator)throw new Error("A validator is required for Form functionality to work");const{formData:n,initialFormData:r,onChange:i}=e,s=n??r;this.state=this.getStateFromProps(e,s,void 0,void 0,void 0,!0),i&&!le(this.state.formData,s)&&i(Mt(this.state)),this.formElement=P.createRef()}getSnapshotBeforeUpdate(e,n){if(!le(this.props,e)){const r=uo(this.props.formData,e.formData),i=uo(this.props.formData,this.state.formData),s=!le(e.schema,this.props.schema),o=r.length>0||!le(e.formData,this.props.formData),a=i.length>0||!le(this.state.formData,this.props.formData),l=this.getStateFromProps(this.props,this.props.formData,s||o?void 0:this.state.retrievedSchema,s,r,!a),d=!le(l,n);return{nextState:l,shouldUpdate:d}}return{shouldUpdate:!1}}componentDidUpdate(e,n,r){if(r.shouldUpdate){const{nextState:i}=r,s=!le(i.formData,this.props.formData),o=this._isProcessingUserChange;if(this._isProcessingUserChange=!1,o&&s)return;s&&!le(i.formData,n.formData)&&this.props.onChange&&this.props.onChange(Mt(i)),this.setState(i)}}getStateFromProps(e,n,r,i=!1,s=[],o=!1){const a=this.state||{},l="schema"in e?e.schema:this.props.schema,d="validator"in e?e.validator:this.props.validator,f=("uiSchema"in e?e.uiSchema:this.props.uiSchema)||{},u=e.formData===void 0&&this.props.formData===void 0,h=typeof n<"u",g="liveValidate"in e?e.liveValidate:this.props.liveValidate,m=h&&!e.noValidate&&g,p="experimental_defaultFormStateBehavior"in e?e.experimental_defaultFormStateBehavior:this.props.experimental_defaultFormStateBehavior,y="experimental_customMergeAllOf"in e?e.experimental_customMergeAllOf:this.props.experimental_customMergeAllOf;let x=a.schemaUtils;(!x||x.doesSchemaUtilsDiffer(d,l,p,y))&&(x=ox(d,l,p,y));const S=x.getRootSchema();let O=n;n===Bo?O=void 0:n===void 0&&u&&(O=a.formData);const b=x.getDefaultFormState(S,O,!1,a.initialDefaultsGenerated),v=this.updateRetrievedSchema(r??x.retrieveSchema(S,b)),w=()=>e.noValidate||i?{errors:[],errorSchema:{}}:e.liveValidate?{errors:a.errors||[],errorSchema:a.errorSchema||{}}:{errors:a.schemaValidationErrors||[],errorSchema:a.schemaValidationErrorSchema||{}};let j,A,C=a.schemaValidationErrors,T=a.schemaValidationErrorSchema;if(m&&!o){const E=this.liveValidate(S,x,a.errorSchema,b,void 0,a.customErrors,r,r!==void 0);j=E.errors,A=E.errorSchema,C=E.schemaValidationErrors,T=E.schemaValidationErrorSchema}else{const E=w();if(j=E.errors,A=E.errorSchema,s.length>0&&!m){const M=s.reduce((k,B)=>(k[B]=void 0,k),{});A=T=Cn(E.errorSchema,M,"preventDuplicates")}const D=this.mergeErrors({errorSchema:A,errors:j},e.extraErrors,a.customErrors);j=D.errors,A=D.errorSchema}const N=this.getRegistry(e,S,x),_=le(a.registry,N)?a.registry:N,F=a.fieldPathId&&a.fieldPathId?.[oe]===_.globalFormOptions.idPrefix?a.fieldPathId:Fe("",_.globalFormOptions);return{schemaUtils:x,schema:S,uiSchema:f,fieldPathId:F,formData:b,edit:h,errors:j,errorSchema:A,schemaValidationErrors:C,schemaValidationErrorSchema:T,retrievedSchema:v,initialDefaultsGenerated:!0,registry:_}}shouldComponentUpdate(e,n){const{experimental_componentUpdateStrategy:r="customDeep"}=this.props;return kl(this,e,n,r)}validate(e,n=this.state.schema,r,i){const s=r||this.state.schemaUtils,{customValidate:o,transformErrors:a,uiSchema:l}=this.props,d=i??s.retrieveSchema(n,e);return s.getValidator().validateFormData(e,d,o,a,l)}renderErrors(e){const{errors:n,errorSchema:r,schema:i,uiSchema:s}=this.state,o=U(s),a=L("ErrorListTemplate",e,o);return n&&n.length?c.jsx(a,{errors:n,errorSchema:r||{},schema:i,uiSchema:s,registry:e}):null}mergeErrors(e,n,r){let i=e.errorSchema,s=e.errors;if(n){const o=Xn(e,n);i=o.errorSchema,s=o.errors}if(r){const o=Xn(e,r.ErrorSchema,!0);i=o.errorSchema,s=o.errors}return{errors:s,errorSchema:i}}liveValidate(e,n,r,i,s,o,a,l=!1){const d=this.validate(i,e,n,a),f=d.errors;let u=d.errorSchema;l&&(u=Cn(r,d.errorSchema,"preventDuplicates"));const h=f,g=u;return{...this.mergeErrors({errorSchema:u,errors:f},s,o),schemaValidationErrors:h,schemaValidationErrorSchema:g}}getUsedFormData=(e,n)=>Ol(e,n);getFieldNames=(e,n)=>Al(e,n);omitExtraData=e=>{const{schema:n,schemaUtils:r}=this.state;return r.omitExtraData(n,e)};setFieldValue=(e,n)=>{const{registry:r}=this.state,i=Array.isArray(e)?e:e.split("."),s=Fe("",r.globalFormOptions,i);this.onChange(n,i,void 0,s[oe])};onChange=(e,n,r,i)=>{this.pendingChanges.push({newValue:e,path:n,newErrorSchema:r,id:i}),this.pendingChanges.length===1&&this.processPendingChange()};processPendingChange(){if(this.pendingChanges.length===0)return;this._isProcessingUserChange=!0;const{newValue:e,path:n,id:r}=this.pendingChanges[0],{newErrorSchema:i}=this.pendingChanges[0],{extraErrors:s,omitExtraData:o,liveOmit:a,noValidate:l,liveValidate:d,onChange:f}=this.props,{formData:u,schemaUtils:h,schema:g,fieldPathId:m,schemaValidationErrorSchema:p,errors:y}=this.state;let{customErrors:x,errorSchema:S}=this.state;const O=m.path[0]||"",b=!n||n.length===0||n.length===1&&n[0]===O;let v=this.state.retrievedSchema,w=b?e:Hi(u);const j=Y(w)&&Object.keys(w).length>0&&Object.values(w).every(F=>F===void 0),A=u==null,C=j&&A?void 0:w;if(Y(w)||Array.isArray(w)){e===Zl?Bx(w,n):b||se(w,n,e);const F=this.getStateFromProps(this.props,C,void 0,void 0,void 0,!0);w=F.formData,v=F.retrievedSchema}const T=!l&&(d===!0||d==="onChange");let N={formData:w,schema:g},_=w;if(o===!0&&(a===!0||a==="onChange")&&(_=this.omitExtraData(w),N={formData:_}),i){const F=b?p:I(p,n);if(!me(F))b?S=i:se(S,n,i);else if(x||(x=new Fl),b){const $=I(i,be);$&&x.setErrors($)}else se(x.ErrorSchema,n,i)}else x&&I(x.ErrorSchema,[...n,be])&&x.clearErrors(n);if(T&&this.pendingChanges.length===1){const F=this.liveValidate(g,h,S,_,s,x,v);N={formData:_,...F,customErrors:x}}else if(!l&&i){const F=this.mergeErrors({errorSchema:S,errors:y},s,x);N={formData:_,...F,customErrors:x}}this.setState(N,()=>{f&&f(Mt({...this.state,...N}),r),this.pendingChanges.shift(),this.processPendingChange()})}updateRetrievedSchema(e){return le(e,this.state?.retrievedSchema)?this.state.retrievedSchema:e}reset=()=>{const{formData:e,initialFormData:n=Bo,onChange:r}=this.props,o={formData:this.getStateFromProps(this.props,e??n,void 0,void 0,void 0,!0).formData,errorSchema:{},errors:[],schemaValidationErrors:[],schemaValidationErrorSchema:{},initialDefaultsGenerated:!1,customErrors:void 0};this.setState(o,()=>r&&r(Mt({...this.state,...o})))};onBlur=(e,n)=>{const{onBlur:r,omitExtraData:i,liveOmit:s,liveValidate:o}=this.props;if(r&&r(e,n),i===!0&&s==="onBlur"||o==="onBlur"){const{onChange:a,extraErrors:l}=this.props,{formData:d}=this.state;let f=d,u={formData:f};if(i===!0&&s==="onBlur"&&(f=this.omitExtraData(d),u={formData:f}),o==="onBlur"){const{schema:g,schemaUtils:m,errorSchema:p,customErrors:y,retrievedSchema:x}=this.state,S=this.liveValidate(g,m,p,f,l,y,x);u={formData:f,...S,customErrors:y}}const h=Object.keys(u).filter(g=>!g.startsWith("schemaValidation")).some(g=>{const m=I(this.state,g),p=I(u,g);return!le(m,p)});this.setState(u,()=>{a&&h&&a(Mt({...this.state,...u}),e)})}};onFocus=(e,n)=>{const{onFocus:r}=this.props;r&&r(e,n)};onSubmit=e=>{if(e.preventDefault(),e.target!==e.currentTarget)return;e.persist();const{omitExtraData:n,extraErrors:r,noValidate:i,onSubmit:s}=this.props;let{formData:o}=this.state;if(n===!0&&(o=this.omitExtraData(o)),i||this.validateFormWithFormData(o)){const a=r||{},l=r?Qi(r):[];this.setState({formData:o,errors:l,errorSchema:a,schemaValidationErrors:[],schemaValidationErrorSchema:{}},()=>{s&&s(Mt({...this.state,formData:o},"submitted"),e)})}};getGlobalFormOptions(e){const{uiSchema:n={},experimental_componentUpdateStrategy:r,idSeparator:i=da,idPrefix:s=ua,nameGenerator:o,useFallbackUiForUnsupportedType:a=!1}=e;return{idPrefix:n["ui:rootFieldId"]||s,idSeparator:i,useFallbackUiForUnsupportedType:a,...r!==void 0&&{experimental_componentUpdateStrategy:r},...o!==void 0&&{nameGenerator:o}}}getRegistry(e,n,r){const{translateString:i,uiSchema:s={}}=e,{fields:o,templates:a,widgets:l,formContext:d,translateString:f}=U1();return{fields:{...o,...e.fields},templates:{...a,...e.templates,ButtonTemplates:{...a.ButtonTemplates,...e.templates?.ButtonTemplates}},widgets:{...l,...e.widgets},rootSchema:n,formContext:e.formContext||d,schemaUtils:r,translateString:i||f,globalUiOptions:s[Hr],globalFormOptions:this.getGlobalFormOptions(e)}}submit=()=>{if(this.formElement.current){const e=new CustomEvent("submit",{cancelable:!0});e.preventDefault(),this.formElement.current.dispatchEvent(e),this.formElement.current.requestSubmit()}};focusOnError(e){const{idPrefix:n="root",idSeparator:r="_"}=this.props,{property:i}=e,s=Ml(i);s[0]===""?s[0]=n:s.unshift(n);const o=s.join(r);let a=this.formElement.current.elements[o];a||(a=this.formElement.current.querySelector(`input[id^="${o}"`)),a&&a.length&&(a=a[0]),a&&a.focus()}validateFormWithFormData=e=>{const{extraErrors:n,extraErrorsBlockSubmit:r,focusOnFirstError:i,onError:s}=this.props,{errors:o}=this.state,a=this.validate(e);let l=a.errors,d=a.errorSchema;const f=l,u=d,h=l.length>0||n&&r;if(h){if(n){const g=Xn(a,n);d=g.errorSchema,l=g.errors}i&&(typeof i=="function"?i(l[0]):this.focusOnError(l[0])),this.setState({errors:l,errorSchema:d,schemaValidationErrors:f,schemaValidationErrorSchema:u},()=>{s?s(l):console.error("Form validation failed",l)})}else o.length>0&&this.setState({errors:[],errorSchema:{},schemaValidationErrors:[],schemaValidationErrorSchema:{}});return!h};validateForm(){const{omitExtraData:e}=this.props;let{formData:n}=this.state;return e===!0&&(n=this.omitExtraData(n)),this.validateFormWithFormData(n)}render(){const{children:e,id:n,className:r="",tagName:i,name:s,method:o,target:a,action:l,autoComplete:d,enctype:f,acceptCharset:u,noHtml5Validate:h=!1,disabled:g,readonly:m,showErrorList:p="top",_internalFormWrapper:y}=this.props,{schema:x,uiSchema:S,formData:O,errorSchema:b,fieldPathId:v,registry:w}=this.state,{SchemaField:j}=w.fields,{SubmitButton:A}=w.templates.ButtonTemplates,C=y?i:void 0,T=y||i||"form";let{[Qn]:N={}}=U(S);g&&(N={...N,props:{...N.props,disabled:!0}});const _={[ut]:{[Qn]:N}};return c.jsxs(T,{className:r||"rjsf",id:n,name:s,method:o,target:a,action:l,autoComplete:d,encType:f,acceptCharset:u,noValidate:h,onSubmit:this.onSubmit,as:C,ref:this.formElement,children:[p==="top"&&this.renderErrors(w),c.jsx(j,{name:"",schema:x,uiSchema:S,errorSchema:b,fieldPathId:v,formData:O,onChange:this.onChange,onBlur:this.onBlur,onFocus:this.onFocus,registry:w,disabled:g,readonly:m}),e||c.jsx(A,{uiSchema:_,registry:w}),p==="bottom"&&this.renderErrors(w)]})}};function W1(t){return P.forwardRef(({fields:e,widgets:n,templates:r,...i},s)=>(e={...t?.fields,...e},n={...t?.widgets,...n},r={...t?.templates,...r,ButtonTemplates:{...t?.templates?.ButtonTemplates,...r?.ButtonTemplates}},c.jsx(L1,{...t,...i,fields:e,widgets:n,templates:r,ref:s})))}var Vn={exports:{}},zr={},Uo;function V1(){return Uo||(Uo=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.formatNames=t.fastFormats=t.fullFormats=void 0;function e(C,T){return{validate:C,compare:T}}t.fullFormats={date:e(s,o),time:e(l,d),"date-time":e(u,h),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:p,"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:A,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:x,int32:{type:"number",validate:b},int64:{type:"number",validate:v},float:{type:"number",validate:w},double:{type:"number",validate:w},password:!0,binary:!0},t.fastFormats={...t.fullFormats,date:e(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,o),time:e(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,d),"date-time":e(/^\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,h),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},t.formatNames=Object.keys(t.fullFormats);function n(C){return C%4===0&&(C%100!==0||C%400===0)}const r=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,i=[0,31,28,31,30,31,30,31,31,30,31,30,31];function s(C){const T=r.exec(C);if(!T)return!1;const N=+T[1],_=+T[2],F=+T[3];return _>=1&&_<=12&&F>=1&&F<=(_===2&&n(N)?29:i[_])}function o(C,T){if(C&&T)return C>T?1:C<T?-1:0}const a=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i;function l(C,T){const N=a.exec(C);if(!N)return!1;const _=+N[1],F=+N[2],$=+N[3],E=N[5];return(_<=23&&F<=59&&$<=59||_===23&&F===59&&$===60)&&(!T||E!=="")}function d(C,T){if(!(C&&T))return;const N=a.exec(C),_=a.exec(T);if(N&&_)return C=N[1]+N[2]+N[3]+(N[4]||""),T=_[1]+_[2]+_[3]+(_[4]||""),C>T?1:C<T?-1:0}const f=/t|\s/i;function u(C){const T=C.split(f);return T.length===2&&s(T[0])&&l(T[1],!0)}function h(C,T){if(!(C&&T))return;const[N,_]=C.split(f),[F,$]=T.split(f),E=o(N,F);if(E!==void 0)return E||d(_,$)}const g=/\/|:/,m=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function p(C){return g.test(C)&&m.test(C)}const y=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function x(C){return y.lastIndex=0,y.test(C)}const S=-2147483648,O=2**31-1;function b(C){return Number.isInteger(C)&&C<=O&&C>=S}function v(C){return Number.isInteger(C)}function w(){return!0}const j=/[^\\]\\Z/;function A(C){if(j.test(C))return!1;try{return new RegExp(C),!0}catch{return!1}}})(zr)),zr}var qr={},Lo;function z1(){return Lo||(Lo=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.formatLimitDefinition=void 0;const e=kc(),n=Ho(),r=n.operators,i={formatMaximum:{okStr:"<=",ok:r.LTE,fail:r.GT},formatMinimum:{okStr:">=",ok:r.GTE,fail:r.LT},formatExclusiveMaximum:{okStr:"<",ok:r.LT,fail:r.GTE},formatExclusiveMinimum:{okStr:">",ok:r.GT,fail:r.LTE}},s={message:({keyword:a,schemaCode:l})=>n.str`should be ${i[a].okStr} ${l}`,params:({keyword:a,schemaCode:l})=>n._`{comparison: ${i[a].okStr}, limit: ${l}}`};t.formatLimitDefinition={keyword:Object.keys(i),type:"string",schemaType:"string",$data:!0,error:s,code(a){const{gen:l,data:d,schemaCode:f,keyword:u,it:h}=a,{opts:g,self:m}=h;if(!g.validateFormats)return;const p=new e.KeywordCxt(h,m.RULES.all.format.definition,"format");p.$data?y():x();function y(){const O=l.scopeValue("formats",{ref:m.formats,code:g.code.formats}),b=l.const("fmt",n._`${O}[${p.schemaCode}]`);a.fail$data(n.or(n._`typeof ${b} != "object"`,n._`${b} instanceof RegExp`,n._`typeof ${b}.compare != "function"`,S(b)))}function x(){const O=p.schema,b=m.formats[O];if(!b||b===!0)return;if(typeof b!="object"||b instanceof RegExp||typeof b.compare!="function")throw new Error(`"${u}": format "${O}" does not define "compare" function`);const v=l.scopeValue("formats",{key:O,ref:b,code:g.code.formats?n._`${g.code.formats}${n.getProperty(O)}`:void 0});a.fail$data(S(v))}function S(O){return n._`${O}.compare(${d}, ${f}) ${i[u].fail} 0`}},dependencies:["format"]};const o=a=>(a.addKeyword(t.formatLimitDefinition),a);t.default=o})(qr)),qr}var Wo;function q1(){return Wo||(Wo=1,(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});const n=V1(),r=z1(),i=Ho(),s=new i.Name("fullFormats"),o=new i.Name("fastFormats"),a=(d,f={keywords:!0})=>{if(Array.isArray(f))return l(d,f,n.fullFormats,s),d;const[u,h]=f.mode==="fast"?[n.fastFormats,o]:[n.fullFormats,s],g=f.formats||n.formatNames;return l(d,g,u,h),f.keywords&&r.default(d),d};a.get=(d,f="full")=>{const h=(f==="fast"?n.fastFormats:n.fullFormats)[d];if(!h)throw new Error(`Unknown format "${d}"`);return h};function l(d,f,u,h){var g,m;(g=(m=d.opts.code).formats)!==null&&g!==void 0||(m.formats=i._`require("ajv-formats/dist/formats").${h}`);for(const p of f)d.addFormat(p,u[p])}t.exports=e=a,Object.defineProperty(e,"__esModule",{value:!0}),e.default=a})(Vn,Vn.exports)),Vn.exports}var K1=q1();const Vo=mi(K1),G1={allErrors:!0,multipleOfPrecision:8,strict:!1,verbose:!0,discriminator:!1},H1=/^(#?([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*\)))$/,Y1=/^data:([a-z]+\/[a-z0-9-+.]+)?;(?:name=(.*);)?base64,(.*)$/;function X1(t,e,n={},r,i=Mc,s){let o=new i({...G1,...n});return r?Vo(o,r):r!==!1&&Vo(o),o.addFormat("data-url",Y1),o.addFormat("color",H1),o.addKeyword(et),o.addKeyword(wi),Array.isArray(t)&&o.addMetaSchema(t),Z(e)&&Object.keys(e).forEach(a=>{o.addFormat(a,e[a])}),s&&(o=s(o)),o}function J1(t=[],e){return t.map(r=>{var i;const{instancePath:s,keyword:o,params:a,schemaPath:l,parentSchema:d,...f}=r;let{message:u=""}=f,h=s.replace(/\//g,"."),g=`${h} ${u}`.trim(),m="";const p=[...((i=a.deps)===null||i===void 0?void 0:i.split(", "))||[],a.missingProperty,a.property].filter(y=>y);if(p.length>0)p.forEach(y=>{const x=h?`${h}.${y}`:y;let S=U(I(e,`${x.replace(/^\./,"")}`)).title;if(S===void 0){const O=l.replace(/\/properties\//g,"/").split("/").slice(1,-1).concat([y]);S=U(I(e,O)).title}if(S)u=u.replace(`'${y}'`,`'${S}'`),m=S;else{const O=I(d,[te,y,"title"]);O&&(u=u.replace(`'${y}'`,`'${O}'`),m=O)}}),g=u;else{const y=U(I(e,`${h.replace(/^\./,"")}`)).title;if(y)g=`'${y}' ${u}`.trim(),m=y;else{const x=d?.title;x&&(g=`'${x}' ${u}`.trim(),m=x)}}return"missingProperty"in a&&(h=h?`${h}.${a.missingProperty}`:a.missingProperty),{name:o,property:h,message:u,params:a,stack:g,schemaPath:l,title:m}}).reduce((r,i)=>{const{message:s,schemaPath:o}=i,a=o?.indexOf(`/${J}/`),l=o?.indexOf(`/${q}/`);let d;return a&&a>=0?d=o?.substring(0,a):l&&l>=0&&(d=o?.substring(0,l)),d&&r.find(u=>{var h;return u.message===s&&((h=u.schemaPath)===null||h===void 0?void 0:h.startsWith(d))})||r.push(i),r},[])}function Z1(t,e,n,r,i,s,o){const{validationError:a}=e;let l=J1(e.errors,o);a&&(l=[...l,{stack:a.message}]),typeof s=="function"&&(l=s(l,o));let d=_x(l);if(a&&(d={...d,$schema:{__errors:[a.message]}}),typeof i!="function")return{errors:l,errorSchema:d};const f=bl(t,r,n,r,!0),u=i(f,Yr(f),o,d),h=Rl(u);return Xn({errors:l,errorSchema:d},h)}class Q1{constructor(e,n){const{additionalMetaSchemas:r,customFormats:i,ajvOptionsOverrides:s,ajvFormatOptions:o,AjvClass:a,extenderFn:l}=e;this.ajv=X1(r,i,s,o,a,l),this.localizer=n}reset(){this.ajv.removeSchema()}rawValidation(e,n){var r,i;let s,o;try{e[oe]&&(o=this.ajv.getSchema(e[oe])),o===void 0&&(o=this.ajv.compile(e)),o(n)}catch(l){s=l}let a;return o&&(typeof this.localizer=="function"&&(((r=o.errors)!==null&&r!==void 0?r:[]).forEach(l=>{var d;["missingProperty","property"].forEach(f=>{var u;!((u=l.params)===null||u===void 0)&&u[f]&&(l.params[f]=`'${l.params[f]}'`)}),!((d=l.params)===null||d===void 0)&&d.deps&&(l.params.deps=l.params.deps.split(", ").map(f=>`'${f}'`).join(", "))}),this.localizer(o.errors),((i=o.errors)!==null&&i!==void 0?i:[]).forEach(l=>{var d;["missingProperty","property"].forEach(f=>{var u;!((u=l.params)===null||u===void 0)&&u[f]&&(l.params[f]=l.params[f].slice(1,-1))}),!((d=l.params)===null||d===void 0)&&d.deps&&(l.params.deps=l.params.deps.split(", ").map(f=>f.slice(1,-1)).join(", "))})),a=o.errors||void 0,o.errors=null),{errors:a,validationError:s}}validateFormData(e,n,r,i,s){const o=this.rawValidation(n,e);return Z1(this,o,e,n,r,i,s)}handleSchemaUpdate(e){var n,r;const i=(n=e[oe])!==null&&n!==void 0?n:fa;this.ajv.getSchema(i)===void 0?this.ajv.addSchema(e,i):le(e,(r=this.ajv.getSchema(i))===null||r===void 0?void 0:r.schema)||(this.ajv.removeSchema(i),this.ajv.addSchema(e,i))}isValid(e,n,r){var i;try{this.handleSchemaUpdate(r);const s=es(e),o=(i=s[oe])!==null&&i!==void 0?i:wx(s);let a;return a=this.ajv.getSchema(o),a===void 0&&(a=this.ajv.addSchema(s,o).getSchema(o)||this.ajv.compile(s)),a(n)}catch(s){return console.warn("Error encountered compiling schema:",s),!1}}}function ev(t={},e){return new Q1(t,e)}const tv=ev();const nv=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),rv=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,n,r)=>r?r.toUpperCase():n.toLowerCase()),zo=t=>{const e=rv(t);return e.charAt(0).toUpperCase()+e.slice(1)},nc=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim(),iv=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0};var sv={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const ov=P.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:s,iconNode:o,...a},l)=>P.createElement("svg",{ref:l,...sv,width:e,height:e,stroke:t,strokeWidth:r?Number(n)*24/Number(e):n,className:nc("lucide",i),...!s&&!iv(a)&&{"aria-hidden":"true"},...a},[...o.map(([d,f])=>P.createElement(d,f)),...Array.isArray(s)?s:[s]]));const Xe=(t,e)=>{const n=P.forwardRef(({className:r,...i},s)=>P.createElement(ov,{ref:s,iconNode:e,className:nc(`lucide-${nv(zo(t))}`,`lucide-${t}`,r),...i}));return n.displayName=zo(t),n};const av=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],lv=Xe("check",av);const cv=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],rc=Xe("chevron-down",cv);const uv=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],dv=Xe("chevron-up",uv);const fv=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],mv=Xe("circle-alert",fv);const hv=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]],ic=Xe("circle-plus",hv);const pv=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],gv=Xe("circle",pv);const yv=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],xv=Xe("copy",yv);const bv=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],vv=Xe("search",bv);const Sv=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],wv=Xe("trash-2",Sv);const jv=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],sc=Xe("x",jv);function G(...t){return Rc(Bc(t))}const Ov=hi("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",xs:"h-6 rounded-md gap-1 px-2 has-[>svg]:px-2",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function as({className:t,variant:e,size:n,asChild:r=!1,...i}){const s=r?Yo:"button";return c.jsx(s,{"data-slot":"button",className:G(Ov({variant:e,size:n,className:t})),...i})}function Av({uiSchema:t,registry:e,className:n,...r}){const{translateString:i}=e;return c.jsx("div",{className:"p-0 m-0",children:c.jsxs(as,{...r,className:G("w-fit gap-2",n),variant:"outline",type:"button",children:[c.jsx(ic,{size:16})," ",i(K.AddItemButton)]})})}function Cv(t){const{children:e,buttonsProps:n,displayLabel:r,hasDescription:i,hasToolbar:s,uiSchema:o,registry:a}=t,l=U(o),d=L("ArrayFieldItemButtonsTemplate",a,l),f=i?-6:22;return c.jsx("div",{children:c.jsxs("div",{className:"mb-2 flex flex-row flex-wrap items-center",children:[c.jsx("div",{className:"grow shrink",children:e}),c.jsx("div",{className:"flex items-end justify-end p-0.5",children:s&&c.jsx("div",{className:"flex gap-2",style:{marginLeft:"5px",marginTop:r?`${f}px`:void 0},children:c.jsx(d,{...n})})})]})})}function _v(t){const{canAdd:e,disabled:n,fieldPathId:r,uiSchema:i,items:s,optionalDataControl:o,onAddClick:a,readonly:l,registry:d,required:f,schema:u,title:h}=t,g=U(i),m=L("ArrayFieldDescriptionTemplate",d,g),p=L("ArrayFieldTitleTemplate",d,g),y=!l&&!n,{ButtonTemplates:{AddButton:x}}=d.templates;return c.jsx("div",{children:c.jsx("div",{className:"m-0 flex p-0",children:c.jsxs("div",{className:"m-0 w-full p-0",children:[c.jsx(p,{fieldPathId:r,title:g.title||h,schema:u,uiSchema:i,required:f,registry:d,optionalDataControl:y?o:void 0}),c.jsx(m,{fieldPathId:r,description:g.description||u.description,schema:u,uiSchema:i,registry:d}),c.jsxs("div",{className:"p-0 m-0 w-full mb-2",children:[y?void 0:o,s,e&&c.jsx("div",{className:"mt-2 flex justify-end",children:c.jsx(x,{id:qe(r,"add"),className:"rjsf-array-item-add",onClick:a,disabled:n||l,uiSchema:i,registry:d})})]},`array-item-list-${r.$id}`)]})})})}function oc({className:t,type:e,...n}){return c.jsx("input",{type:e,"data-slot":"input",className:G("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",t),...n})}function Nv({id:t,htmlName:e,placeholder:n,required:r,readonly:i,disabled:s,type:o,value:a,onChange:l,onChangeOverride:d,onBlur:f,onFocus:u,autofocus:h,options:g,schema:m,rawErrors:p=[],children:y,extraProps:x,className:S,registry:O}){const{ClearButton:b}=O.templates.ButtonTemplates,v={...x,...El(m,o,g)},w=({target:{value:T}})=>l(T===""?g.emptyValue:T),j=({target:T})=>f(t,T&&T.value),A=({target:T})=>u(t,T&&T.value),C=P.useCallback(T=>{var N;T.preventDefault(),T.stopPropagation(),l((N=g.emptyValue)!==null&&N!==void 0?N:"")},[l,g.emptyValue]);return c.jsxs("div",{className:"p-0.5",children:[c.jsx(oc,{id:t,name:e||t,type:o,placeholder:n,autoFocus:h,required:r,disabled:s,readOnly:i,className:G({"border-destructive focus-visible:ring-0":p.length>0},S),list:m.examples?_n(t):void 0,...v,value:a||a===0?a:"",onChange:d||w,onBlur:j,onFocus:A,"aria-describedby":we(t,!!m.examples)}),g.allowClearTextInputs&&!i&&!s&&a&&c.jsx(b,{onClick:C,registry:O}),y,Array.isArray(m.examples)?c.jsx("datalist",{id:_n(t),children:m.examples.concat(m.default&&!m.examples.includes(m.default)?[m.default]:[]).map(T=>c.jsx("option",{value:T},T))}):null]})}function Tv({id:t,description:e,registry:n,uiSchema:r}){return e?c.jsx("div",{children:c.jsx("div",{id:t,className:"text-sm text-muted-foreground",children:c.jsx(ss,{description:e,registry:n,uiSchema:r})})}):null}const Fv=hi("relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90"}},defaultVariants:{variant:"default"}});function Pv({className:t,variant:e,...n}){return c.jsx("div",{"data-slot":"alert",role:"alert",className:G(Fv({variant:e}),t),...n})}function Ev({className:t,...e}){return c.jsx("div",{"data-slot":"alert-title",className:G("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",t),...e})}function Iv({className:t,...e}){return c.jsx("div",{"data-slot":"alert-description",className:G("text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",t),...e})}function Dv({errors:t,registry:e}){const{translateString:n}=e;return c.jsxs(Pv,{variant:"destructive",className:"mb-2",children:[c.jsx(mv,{className:"h-4 w-4"}),c.jsx(Ev,{children:n(K.ErrorsLabel)}),c.jsx(Iv,{className:"flex flex-col gap-1",children:t.map((r,i)=>c.jsxs("span",{children:["• ",r.stack]},i))})]})}function $v(t){const{errors:e=[],fieldPathId:n}=t;if(e.length===0)return null;const r=Xi(n);return c.jsx("div",{className:"flex flex-col gap-1",id:r,children:e.map((i,s)=>c.jsx("span",{className:"text-xs font-medium text-destructive mb-1",children:i},s))})}function kv(t){const{fieldPathId:e,help:n,uiSchema:r,registry:i,hasErrors:s}=t;return n?c.jsx("span",{className:G("text-xs font-medium text-muted-foreground",{"text-destructive":s}),id:Ji(e),children:c.jsx(os,{help:n,registry:i,uiSchema:r})}):null}function Mv({id:t,children:e,displayLabel:n,rawErrors:r=[],errors:i,help:s,description:o,rawDescription:a,classNames:l,style:d,disabled:f,label:u,hidden:h,onKeyRename:g,onKeyRenameBlur:m,onRemoveProperty:p,readonly:y,required:x,schema:S,uiSchema:O,registry:b}){const v=U(O),w=L("WrapIfAdditionalTemplate",b,v);if(h)return c.jsx("div",{className:"hidden",children:e});const j=v.widget==="checkbox";return c.jsx(w,{classNames:l,style:d,disabled:f,id:t,label:u,displayLabel:n,onKeyRename:g,onKeyRenameBlur:m,onRemoveProperty:p,rawDescription:a,readonly:y,required:x,schema:S,uiSchema:O,registry:b,children:c.jsxs("div",{className:"flex flex-col gap-2",children:[n&&!j&&c.jsxs("label",{className:G("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",{" text-destructive":r.length>0}),htmlFor:t,children:[u,x?"*":null]}),e,n&&a&&!j&&c.jsx("span",{className:G("text-xs font-medium text-muted-foreground",{" text-destructive":r.length>0}),children:o}),i,s]})})}function Rv(t){const{children:e,column:n,className:r,...i}=t;return c.jsx("div",{className:G("grid gap-2",r),...i,children:e})}function en(t){const{icon:e,iconType:n,className:r,uiSchema:i,registry:s,...o}=t;return c.jsx(as,{size:"icon",variant:"outline",className:r,...o,type:"button",children:e})}function Bv(t){const{registry:{translateString:e}}=t;return c.jsx(en,{title:e(K.CopyButton),...t,icon:c.jsx(xv,{className:"h-4 w-4"})})}function Uv(t){const{registry:{translateString:e}}=t;return c.jsx(en,{title:e(K.MoveDownButton),...t,icon:c.jsx(rc,{className:"h-4 w-4"})})}function Lv(t){const{registry:{translateString:e}}=t;return c.jsx(en,{title:e(K.MoveUpButton),...t,icon:c.jsx(dv,{className:"h-4 w-4"})})}function ac(t){const{registry:{translateString:e}}=t;return c.jsx(en,{title:e(K.RemoveButton),...t,className:"border-destructive",icon:c.jsx(wv,{className:"h-4 w-4 stroke-destructive"})})}function Wv(t){const{registry:{translateString:e}}=t;return c.jsx(en,{title:e(K.ClearButton),...t,icon:c.jsx(sc,{})})}function Vv({selector:t,optionSchemaField:e}){return c.jsxs("div",{className:G("p-4 border rounded-md bg-background shadow-sm"),children:[c.jsx("div",{className:G("mb-4"),children:t}),e]})}function zv({description:t,title:e,properties:n,required:r,uiSchema:i,fieldPathId:s,schema:o,formData:a,optionalDataControl:l,onAddProperty:d,disabled:f,readonly:u,registry:h}){const g=U(i),m=L("TitleFieldTemplate",h,g),p=L("DescriptionFieldTemplate",h,g),y=!u&&!f,{ButtonTemplates:{AddButton:x}}=h.templates;return c.jsxs(c.Fragment,{children:[e&&c.jsx(m,{id:hr(s),title:e,required:r,schema:o,uiSchema:i,registry:h,optionalDataControl:y?l:void 0}),t&&c.jsx(p,{id:Dt(s),description:t,schema:o,uiSchema:i,registry:h}),c.jsxs("div",{className:"flex flex-col gap-2",children:[y?void 0:l,n.map((S,O)=>c.jsx("div",{className:`${S.hidden?"hidden":""} flex`,children:c.jsx("div",{className:"w-full",children:S.content})},O)),ma(o,i,a)?c.jsx("div",{className:"mt-2 flex justify-end",children:c.jsx(x,{id:qe(s,"add"),onClick:d,disabled:f||u,className:"rjsf-object-property-expand",uiSchema:i,registry:h})}):null]})]})}function qv(t){const{id:e,registry:n,label:r,onAddClick:i,onRemoveClick:s}=t;return i?c.jsx(en,{id:e,registry:n,className:"rjsf-add-optional-data",onClick:i,title:r,icon:c.jsx(ic,{}),size:"xs"}):s?c.jsx(ac,{id:e,registry:n,className:"rjsf-remove-optional-data",onClick:s,title:r,size:"xs"}):c.jsx("em",{id:e,children:r})}function Kv(t){const{submitText:e,norender:n,props:r}=Il(t.uiSchema);return n?null:c.jsx("div",{children:c.jsx(as,{type:"submit",...r,className:G("my-2",r?.className),children:e})})}function lc({className:t,orientation:e="horizontal",decorative:n=!0,...r}){return c.jsx(Uc,{"data-slot":"separator",decorative:n,orientation:e,className:G("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",t),...r})}function Gv({id:t,title:e,uiSchema:n,optionalDataControl:r}){const i=U(n);let s=c.jsx("h5",{children:i.title||e});return r&&(s=c.jsxs("div",{className:"flex flex-row",children:[c.jsx("div",{className:"flex-grow",children:s}),c.jsx("div",{className:"flex",children:r})]})),c.jsxs("div",{id:t,className:"my-1 flex flex-col gap-0.5",children:[s,c.jsx(lc,{dir:"horizontal",style:{height:"1px"},className:"my-1"})]})}function Hv({classNames:t,style:e,children:n,disabled:r,id:i,label:s,displayLabel:o,onRemoveProperty:a,onKeyRenameBlur:l,rawDescription:d,readonly:f,required:u,schema:h,uiSchema:g,registry:m}){const{templates:p,translateString:y}=m,{RemoveButton:x}=p.ButtonTemplates,S=y(K.KeyLabel,[s]);if(!(et in h))return c.jsx("div",{className:t,style:e,children:n});const v=o?22+(d?-28:0):0,w=`${i}-key`;return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:`grid grid-cols-12 col-span-12 items-center gap-2 ${t}`,style:e,children:[c.jsx("div",{className:"grid gap-2 col-span-5",children:c.jsxs("div",{className:"flex flex-col gap-2",children:[o&&c.jsx("label",{htmlFor:w,className:"text-sm font-medium text-muted-foreground leading-none",children:S}),c.jsx("div",{className:"pl-0.5",children:c.jsx(oc,{required:u,defaultValue:s,disabled:r||f,id:w,name:w,onBlur:f?void 0:l,type:"text",className:"w-full border shadow-sm"})}),!!d&&c.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:c.jsx("div",{className:"text-sm text-muted-foreground",children:" "})})]})}),c.jsx("div",{className:"grid gap-2 col-span-6 pr-0.5",children:n}),c.jsx("div",{className:"grid gap-2 col-span-1",style:{marginTop:`${v}px`},children:c.jsx(x,{id:qe(i,"remove"),iconType:"block",className:"rjsf-object-property-remove w-full",disabled:r||f,onClick:a,uiSchema:g,registry:m})})]}),c.jsx(lc,{dir:"horizontal",className:"mt-2"})]})}function Yv(){return{ArrayFieldItemTemplate:Cv,ArrayFieldTemplate:_v,BaseInputTemplate:Nv,ButtonTemplates:{AddButton:Av,CopyButton:Bv,MoveDownButton:Uv,MoveUpButton:Lv,RemoveButton:ac,SubmitButton:Kv,ClearButton:Wv},DescriptionFieldTemplate:Tv,ErrorListTemplate:Dv,FieldErrorTemplate:$v,FieldHelpTemplate:kv,FieldTemplate:Mv,GridTemplate:Rv,MultiSchemaFieldTemplate:Vv,ObjectFieldTemplate:zv,OptionalDataControlsTemplate:qv,TitleFieldTemplate:Gv,WrapIfAdditionalTemplate:Hv}}function Xv(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,s;for(s=0;s<r.length;s++)i=r[s],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}var Jv=["color"],Zv=P.forwardRef(function(t,e){var n=t.color,r=n===void 0?"currentColor":n,i=Xv(t,Jv);return P.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:e}),P.createElement("path",{d:"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))});function cc({className:t,...e}){return c.jsx(Lc,{"data-slot":"checkbox",className:G("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",t),...e,children:c.jsx(Wc,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:c.jsx(Zv,{className:"size-3.5"})})})}function ls({className:t,...e}){return c.jsx(Vc,{"data-slot":"label",className:G("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",t),...e})}function Qv(t){const{id:e,htmlName:n,value:r,disabled:i,readonly:s,label:o,hideLabel:a,schema:l,autofocus:d,options:f,onChange:u,onBlur:h,onFocus:g,registry:m,uiSchema:p,className:y}=t,x=hn(l),S=L("DescriptionFieldTemplate",m,f),O=j=>u(j),b=()=>h(e,r),v=()=>g(e,r),w=f.description||l.description;return c.jsxs("div",{className:`relative ${i||s?"cursor-not-allowed opacity-50":""}`,"aria-describedby":we(e),children:[!a&&w&&c.jsx(S,{id:Dt(e),description:w,schema:l,uiSchema:p,registry:m}),c.jsxs("div",{className:"flex items-center gap-2 my-2",children:[c.jsx(cc,{id:e,name:n||e,checked:typeof r>"u"?!1:!!r,required:x,disabled:i||s,autoFocus:d,onCheckedChange:O,onBlur:b,onFocus:v,className:y}),c.jsx(ls,{className:"leading-tight",htmlFor:e,children:$l(o,a||!o)})]})]})}function eS({id:t,htmlName:e,disabled:n,options:r,value:i,autofocus:s,readonly:o,required:a,onChange:l,onBlur:d,onFocus:f,className:u}){const{enumOptions:h,enumDisabled:g,inline:m,emptyValue:p}=r,y=Array.isArray(i)?i:[i],x=({target:O})=>d(t,ge(O&&O.value,h,p)),S=({target:O})=>f(t,ge(O&&O.value,h,p));return c.jsx("div",{className:G({"flex flex-col gap-2":!m,"flex flex-row gap-4 flex-wrap":m}),children:Array.isArray(h)&&h.map((O,b)=>{const v=kn(O.value,y),w=Array.isArray(g)&&g.indexOf(O.value)!==-1,j=jt(t,b);return c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(cc,{id:j,name:e||t,required:a,disabled:n||w||o,onCheckedChange:A=>{l(A?Tl(b,y,h):_l(b,y,h))},className:u,checked:v,autoFocus:s&&b===0,onBlur:x,onFocus:S,"aria-describedby":we(t)}),c.jsx(ls,{className:"leading-tight",htmlFor:jt(t,b),children:O.label})]},j)})})}function tS({className:t,...e}){return c.jsx(Nu,{"data-slot":"radio-group",className:G("grid gap-3",t),...e})}function nS({className:t,...e}){return c.jsx(Tu,{"data-slot":"radio-group-item",className:G("border-input text-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",t),...e,children:c.jsx(Fu,{"data-slot":"radio-group-indicator",className:"relative flex items-center justify-center",children:c.jsx(gv,{className:"fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2"})})})}function rS({id:t,options:e,value:n,required:r,disabled:i,readonly:s,onChange:o,onBlur:a,onFocus:l,className:d}){const{enumOptions:f,enumDisabled:u,emptyValue:h}=e,g=x=>o(ge(x,f,h)),m=({target:x})=>a(t,ge(x&&x.value,f,h)),p=({target:x})=>l(t,ge(x&&x.value,f,h)),y=!!(e&&e.inline);return c.jsx("div",{className:"mb-0",children:c.jsx(tS,{defaultValue:n?.toString(),required:r,disabled:i||s,onValueChange:x=>{g(x)},onBlur:m,onFocus:p,"aria-describedby":we(t),orientation:y?"horizontal":"vertical",className:G("flex flex-wrap",{"flex-col":!y},d),children:Array.isArray(f)&&f.map((x,S)=>{const O=Array.isArray(u)&&u.indexOf(x.value)!==-1,b=kn(x.value,n);return c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(nS,{checked:b,value:S.toString(),id:jt(t,S),disabled:O}),c.jsx(ls,{className:"leading-tight",htmlFor:jt(t,S),children:x.label})]},jt(t,S))})})})}var uc=["PageUp","PageDown"],dc=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],fc={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},tn="Slider",[ci,iS,sS]=Kc(tn),[mc]=qc(tn,[sS]),[oS,yr]=mc(tn),hc=P.forwardRef((t,e)=>{const{name:n,min:r=0,max:i=100,step:s=1,orientation:o="horizontal",disabled:a=!1,minStepsBetweenThumbs:l=0,defaultValue:d=[r],value:f,onValueChange:u=()=>{},onValueCommit:h=()=>{},inverted:g=!1,form:m,...p}=t,y=P.useRef(new Set),x=P.useRef(0),O=o==="horizontal"?aS:lS,[b=[],v]=zc({prop:f,defaultProp:d,onChange:N=>{[...y.current][x.current]?.focus(),u(N)}}),w=P.useRef(b);function j(N){const _=mS(b,N);T(N,_)}function A(N){T(N,x.current)}function C(){const N=w.current[x.current];b[x.current]!==N&&h(b)}function T(N,_,{commit:F}={commit:!1}){const $=yS(s),E=xS(Math.round((N-r)/s)*s+r,$),D=sa(E,[r,i]);v((M=[])=>{const k=dS(M,D,_);if(gS(k,l*s)){x.current=k.indexOf(D);const B=String(k)!==String(M);return B&&F&&h(k),B?k:M}else return M})}return c.jsx(oS,{scope:t.__scopeSlider,name:n,disabled:a,min:r,max:i,valueIndexToChangeRef:x,thumbs:y.current,values:b,orientation:o,form:m,children:c.jsx(ci.Provider,{scope:t.__scopeSlider,children:c.jsx(ci.Slot,{scope:t.__scopeSlider,children:c.jsx(O,{"aria-disabled":a,"data-disabled":a?"":void 0,...p,ref:e,onPointerDown:Ut(p.onPointerDown,()=>{a||(w.current=b)}),min:r,max:i,inverted:g,onSlideStart:a?void 0:j,onSlideMove:a?void 0:A,onSlideEnd:a?void 0:C,onHomeKeyDown:()=>!a&&T(r,0,{commit:!0}),onEndKeyDown:()=>!a&&T(i,b.length-1,{commit:!0}),onStepKeyDown:({event:N,direction:_})=>{if(!a){const E=uc.includes(N.key)||N.shiftKey&&dc.includes(N.key)?10:1,D=x.current,M=b[D],k=s*E*_;T(M+k,D,{commit:!0})}}})})})})});hc.displayName=tn;var[pc,gc]=mc(tn,{startEdge:"left",endEdge:"right",size:"width",direction:1}),aS=P.forwardRef((t,e)=>{const{min:n,max:r,dir:i,inverted:s,onSlideStart:o,onSlideMove:a,onSlideEnd:l,onStepKeyDown:d,...f}=t,[u,h]=P.useState(null),g=Yt(e,O=>h(O)),m=P.useRef(void 0),p=Gc(i),y=p==="ltr",x=y&&!s||!y&&s;function S(O){const b=m.current||u.getBoundingClientRect(),v=[0,b.width],j=cs(v,x?[n,r]:[r,n]);return m.current=b,j(O-b.left)}return c.jsx(pc,{scope:t.__scopeSlider,startEdge:x?"left":"right",endEdge:x?"right":"left",direction:x?1:-1,size:"width",children:c.jsx(yc,{dir:p,"data-orientation":"horizontal",...f,ref:g,style:{...f.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:O=>{const b=S(O.clientX);o?.(b)},onSlideMove:O=>{const b=S(O.clientX);a?.(b)},onSlideEnd:()=>{m.current=void 0,l?.()},onStepKeyDown:O=>{const v=fc[x?"from-left":"from-right"].includes(O.key);d?.({event:O,direction:v?-1:1})}})})}),lS=P.forwardRef((t,e)=>{const{min:n,max:r,inverted:i,onSlideStart:s,onSlideMove:o,onSlideEnd:a,onStepKeyDown:l,...d}=t,f=P.useRef(null),u=Yt(e,f),h=P.useRef(void 0),g=!i;function m(p){const y=h.current||f.current.getBoundingClientRect(),x=[0,y.height],O=cs(x,g?[r,n]:[n,r]);return h.current=y,O(p-y.top)}return c.jsx(pc,{scope:t.__scopeSlider,startEdge:g?"bottom":"top",endEdge:g?"top":"bottom",size:"height",direction:g?1:-1,children:c.jsx(yc,{"data-orientation":"vertical",...d,ref:u,style:{...d.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:p=>{const y=m(p.clientY);s?.(y)},onSlideMove:p=>{const y=m(p.clientY);o?.(y)},onSlideEnd:()=>{h.current=void 0,a?.()},onStepKeyDown:p=>{const x=fc[g?"from-bottom":"from-top"].includes(p.key);l?.({event:p,direction:x?-1:1})}})})}),yc=P.forwardRef((t,e)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:i,onSlideEnd:s,onHomeKeyDown:o,onEndKeyDown:a,onStepKeyDown:l,...d}=t,f=yr(tn,n);return c.jsx(Nn.span,{...d,ref:e,onKeyDown:Ut(t.onKeyDown,u=>{u.key==="Home"?(o(u),u.preventDefault()):u.key==="End"?(a(u),u.preventDefault()):uc.concat(dc).includes(u.key)&&(l(u),u.preventDefault())}),onPointerDown:Ut(t.onPointerDown,u=>{const h=u.target;h.setPointerCapture(u.pointerId),u.preventDefault(),f.thumbs.has(h)?h.focus():r(u)}),onPointerMove:Ut(t.onPointerMove,u=>{u.target.hasPointerCapture(u.pointerId)&&i(u)}),onPointerUp:Ut(t.onPointerUp,u=>{const h=u.target;h.hasPointerCapture(u.pointerId)&&(h.releasePointerCapture(u.pointerId),s(u))})})}),xc="SliderTrack",bc=P.forwardRef((t,e)=>{const{__scopeSlider:n,...r}=t,i=yr(xc,n);return c.jsx(Nn.span,{"data-disabled":i.disabled?"":void 0,"data-orientation":i.orientation,...r,ref:e})});bc.displayName=xc;var ui="SliderRange",vc=P.forwardRef((t,e)=>{const{__scopeSlider:n,...r}=t,i=yr(ui,n),s=gc(ui,n),o=P.useRef(null),a=Yt(e,o),l=i.values.length,d=i.values.map(h=>jc(h,i.min,i.max)),f=l>1?Math.min(...d):0,u=100-Math.max(...d);return c.jsx(Nn.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,...r,ref:a,style:{...t.style,[s.startEdge]:f+"%",[s.endEdge]:u+"%"}})});vc.displayName=ui;var di="SliderThumb",Sc=P.forwardRef((t,e)=>{const n=iS(t.__scopeSlider),[r,i]=P.useState(null),s=Yt(e,a=>i(a)),o=P.useMemo(()=>r?n().findIndex(a=>a.ref.current===r):-1,[n,r]);return c.jsx(cS,{...t,ref:s,index:o})}),cS=P.forwardRef((t,e)=>{const{__scopeSlider:n,index:r,name:i,...s}=t,o=yr(di,n),a=gc(di,n),[l,d]=P.useState(null),f=Yt(e,S=>d(S)),u=l?o.form||!!l.closest("form"):!0,h=Hc(l),g=o.values[r],m=g===void 0?0:jc(g,o.min,o.max),p=fS(r,o.values.length),y=h?.[a.size],x=y?hS(y,m,a.direction):0;return P.useEffect(()=>{if(l)return o.thumbs.add(l),()=>{o.thumbs.delete(l)}},[l,o.thumbs]),c.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[a.startEdge]:`calc(${m}% + ${x}px)`},children:[c.jsx(ci.ItemSlot,{scope:t.__scopeSlider,children:c.jsx(Nn.span,{role:"slider","aria-label":t["aria-label"]||p,"aria-valuemin":o.min,"aria-valuenow":g,"aria-valuemax":o.max,"aria-orientation":o.orientation,"data-orientation":o.orientation,"data-disabled":o.disabled?"":void 0,tabIndex:o.disabled?void 0:0,...s,ref:f,style:g===void 0?{display:"none"}:t.style,onFocus:Ut(t.onFocus,()=>{o.valueIndexToChangeRef.current=r})})}),u&&c.jsx(wc,{name:i??(o.name?o.name+(o.values.length>1?"[]":""):void 0),form:o.form,value:g},r)]})});Sc.displayName=di;var uS="RadioBubbleInput",wc=P.forwardRef(({__scopeSlider:t,value:e,...n},r)=>{const i=P.useRef(null),s=Yt(i,r),o=Yc(e);return P.useEffect(()=>{const a=i.current;if(!a)return;const l=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(l,"value").set;if(o!==e&&f){const u=new Event("input",{bubbles:!0});f.call(a,e),a.dispatchEvent(u)}},[o,e]),c.jsx(Nn.input,{style:{display:"none"},...n,ref:s,defaultValue:e})});wc.displayName=uS;function dS(t=[],e,n){const r=[...t];return r[n]=e,r.sort((i,s)=>i-s)}function jc(t,e,n){const s=100/(n-e)*(t-e);return sa(s,[0,100])}function fS(t,e){return e>2?`Value ${t+1} of ${e}`:e===2?["Minimum","Maximum"][t]:void 0}function mS(t,e){if(t.length===1)return 0;const n=t.map(i=>Math.abs(i-e)),r=Math.min(...n);return n.indexOf(r)}function hS(t,e,n){const r=t/2,s=cs([0,50],[0,r]);return(r-s(e)*n)*n}function pS(t){return t.slice(0,-1).map((e,n)=>t[n+1]-e)}function gS(t,e){if(e>0){const n=pS(t);return Math.min(...n)>=e}return!0}function cs(t,e){return n=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const r=(e[1]-e[0])/(t[1]-t[0]);return e[0]+r*(n-t[0])}}function yS(t){return(String(t).split(".")[1]||"").length}function xS(t,e){const n=Math.pow(10,e);return Math.round(t*n)/n}var bS=hc,vS=bc,SS=vc,wS=Sc;function jS({className:t,defaultValue:e,value:n,min:r=0,max:i=100,...s}){const o=P.useMemo(()=>Array.isArray(n)?n:Array.isArray(e)?e:[r,i],[n,e,r,i]);return c.jsxs(bS,{"data-slot":"slider",defaultValue:e,value:n,min:r,max:i,className:G("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",t),...s,children:[c.jsx(vS,{"data-slot":"slider-track",className:G("bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"),children:c.jsx(SS,{"data-slot":"slider-range",className:G("bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})}),Array.from({length:o.length},(a,l)=>c.jsx(wS,{"data-slot":"slider-thumb",className:"border-primary bg-background ring-ring/50 block size-4 shrink-0 rounded-full border shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"},l))]})}const OS=["name","min","max","step","orientation","disabled","defaultValue","value","onValueChange","className","dir","inverted","minStepsBetweenThumbs"];function AS({value:t,readonly:e,disabled:n,options:r,schema:i,onChange:s,label:o,id:a}){const l=u=>s(u[0]),d={...Pl(i)},f={id:a,...Gi(r.props||{},OS)};return c.jsxs(c.Fragment,{children:[c.jsx(jS,{disabled:n||e,min:d.min,max:d.max,step:d.step,value:[t],onValueChange:l,...f,"aria-describedby":we(a)}),t]})}const CS=hi("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function _S({className:t,variant:e,asChild:n=!1,...r}){const i=n?Yo:"span";return c.jsx(i,{"data-slot":"badge",className:G(CS({variant:e}),t),...r})}const Oc=P.forwardRef(({className:t,...e},n)=>c.jsx(Nt,{ref:n,"data-slot":"command",className:G("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",t),...e})),NS=P.forwardRef(({className:t,...e},n)=>c.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[c.jsx(vv,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),c.jsx(Nt.Input,{ref:n,className:G("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",t),...e})]}));NS.displayName=Nt.Input.displayName;function Ac({className:t,...e}){return c.jsx(Nt.List,{"data-slot":"command-list",className:G("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",t),...e})}function Cc({className:t,...e}){return c.jsx(Nt.Group,{"data-slot":"command-group",className:G("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",t),...e})}function _c({className:t,...e}){return c.jsx(Nt.Item,{"data-slot":"command-item",className:G("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...e})}function TS({multiple:t,items:e=[],selected:n,onValueChange:r,autoFocus:i=!1,disabled:s=!1,ariaDescribedby:o,ariaPlaceholder:a,onFocus:l,onBlur:d,className:f,id:u}){const h=P.useRef(null),[g,m]=P.useState(!1),[p,y]=P.useState(""),x=P.useMemo(()=>e.filter(j=>n.some(A=>dt(j.value,A))),[e,n]),S=P.useMemo(()=>e.filter(j=>!x.some(A=>dt(A.value,j.value))),[e,x]),O=P.useCallback(j=>{if(s)return;const A=x.filter(C=>!dt(C.value,j.value));r?.(A.map(C=>C.index))},[x,r,s]),b=P.useCallback(j=>{if(!(s||!h.current||h.current.value!==""))if(j.key==="Delete"||j.key==="Backspace"){const A=x.slice(0,-1);r?.(A.map(C=>C.index))}else j.key==="Escape"&&h.current.blur()},[x,r,s]),v=P.useCallback(j=>{if(s)return;y("");const A=t?[...x,j]:[j];r?.(A.map(C=>C.index))},[t,x,r,s]),w=P.useCallback(j=>{s||m(!0),l?.(j)},[s,l]);return c.jsxs(Oc,{onKeyDown:b,className:G("overflow-visible bg-transparent",f),autoFocus:i,"aria-disabled":s,onBlur:d,onFocus:w,"aria-describedby":o,"aria-placeholder":a,children:[c.jsx("div",{className:G("group border border-input px-3 py-2 text-sm ring-offset-background rounded-md focus-within:ring-1 focus-within:ring-ring focus-within:ring-offset-1",s&&"opacity-50 cursor-not-allowed"),children:c.jsxs("div",{className:"flex gap-1 flex-wrap",children:[x.map(j=>c.jsxs(_S,{variant:"secondary",children:[j.label,c.jsx("button",{type:"button",className:"rtl:mr-1 ltr:ml-1 ring-offset-background rounded-full outline-none focus:ring-1 focus:ring-ring focus:ring-offset-1",onKeyDown:A=>A.key==="Enter"&&!s&&O(j),onMouseDown:A=>{A.preventDefault(),A.stopPropagation()},onClick:()=>O(j),disabled:s,children:c.jsx(sc,{className:G("h-3 w-3 text-muted-foreground hover:text-foreground",s&&"pointer-events-none")})})]},j.value)),c.jsx(Nt.Input,{ref:h,value:p,onValueChange:y,onBlur:()=>m(!1),onFocus:()=>!s&&m(!0),placeholder:"Select ...",className:"rtl:mr-2 ltr:ml-2 bg-transparent outline-none placeholder:text-muted-foreground flex-1",disabled:s,"aria-controls":`command-item-input-${u}`,"aria-labelledby":`command-item-input-${u}`,id:`command-item-input-${u}`})]})}),g&&!s&&S.length>0&&c.jsx("div",{className:"relative mt-2",children:c.jsx("div",{className:"absolute w-full z-10 top-0 rounded-md border bg-popover text-popover-foreground shadow-md outline-none animate-in",children:c.jsx(Cc,{className:"h-full overflow-auto",children:c.jsx(Ac,{children:S.map(j=>c.jsx(_c,{disabled:j.disabled,onMouseDown:A=>{A.preventDefault(),A.stopPropagation()},"aria-controls":`${j.value}-command-item`,"aria-labelledby":`${j.value}-command-item`,id:`${j.value}-command-item`,onSelect:()=>v(j),className:"cursor-pointer",children:j.label},`${j.value}-command-item`))})})})})]})}function FS({items:t,selected:e,onValueChange:n,autoFocus:r=!1,disabled:i=!1,required:s=!1,placeholder:o="Select...",ariaDescribedby:a,ariaPlaceholder:l,onFocus:d,onBlur:f,className:u}){const[h,g]=P.useState(!1),m=t?.find(S=>S.value===e),p=P.useRef(null),y=P.useRef(null);P.useEffect(()=>{h&&p.current&&requestAnimationFrame(()=>{var S;(S=p.current)===null||S===void 0||S.scrollIntoView({block:"nearest"})})},[h]);const x=S=>{y.current&&!y.current.contains(S.relatedTarget)&&g(!1),f?.(S)};return c.jsxs(Oc,{ref:y,className:G("overflow-visible bg-transparent",u),autoFocus:r,"aria-disabled":i,onBlur:x,onFocus:d,"aria-describedby":a,"aria-placeholder":l,children:[c.jsxs("div",{onClick:()=>!i&&g(!h),className:G("flex h-9 w-full items-center justify-between gap-2 whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50",!m&&s&&"border-red-500",i&&"opacity-50 cursor-not-allowed",u),children:[c.jsx("span",{className:G("flex-1 line-clamp-1",!m&&"text-muted-foreground"),children:m?.label||o}),c.jsx(rc,{className:"h-4 w-4 opacity-50"})]}),c.jsx("div",{className:"relative",children:h&&t&&t.length>0?c.jsx("div",{style:{top:"0.5rem"},className:"absolute w-full z-10 rounded-md border bg-popover text-popover-foreground shadow-md outline-none",children:c.jsx(Cc,{className:"h-full overflow-auto",children:c.jsx(Ac,{children:t.map(S=>c.jsxs(_c,{ref:S.value===e?p:void 0,onMouseDown:O=>{O.preventDefault(),O.stopPropagation()},onSelect:()=>{S.disabled||(n?.(S.value),g(!1))},className:G("cursor-pointer relative flex items-center justify-between rounded-sm py-1.5 gap-2 rtl:flex-row-reverse",S.value===e&&"font-semibold",S.disabled&&"opacity-50 cursor-not-allowed"),children:[c.jsx("span",{children:S.label}),c.jsx("span",{className:"flex h-3.5 w-3.5 items-center justify-center",children:S.value===e&&c.jsx(lv,{className:"h-4 w-4"})})]},S.value))})})}):null})]})}function PS({id:t,options:e,required:n,disabled:r,readonly:i,value:s,multiple:o,autofocus:a,onChange:l,onBlur:d,onFocus:f,defaultValue:u,placeholder:h,rawErrors:g=[],className:m}){const{enumOptions:p,enumDisabled:y,emptyValue:x}=e,S=()=>{f(t,ge(s,p,x))},O=()=>{d(t,ge(s,p,x))},b=p?.map(({value:w,label:j},A)=>({value:o?w:A.toString(),label:j,index:A,disabled:Array.isArray(y)&&y.includes(w)})),v=G({"border-destructive":g.length>0},m);return c.jsx("div",{className:"p-0.5",children:o?c.jsx(TS,{id:t,autoFocus:a,disabled:r||i,multiple:!0,className:v,items:b,selected:s,onValueChange:w=>{l(ge(w,p,x))},onFocus:S,onBlur:O}):c.jsx(FS,{items:b,selected:Nl(s??u,p,!1),onValueChange:w=>{l(ge(w,p,x))},autoFocus:a,disabled:r||i,required:n,placeholder:h,className:v,onFocus:S,onBlur:O,ariaDescribedby:we(t)})})}function ES({className:t,...e}){return c.jsx("textarea",{"data-slot":"textarea",className:G("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t),...e})}function IS({id:t,htmlName:e,placeholder:n,value:r,required:i,disabled:s,autofocus:o,readonly:a,onBlur:l,onFocus:d,onChange:f,options:u,className:h}){const g=({target:{value:y}})=>f(y===""?u.emptyValue:y),m=({target:y})=>l(t,y&&y.value),p=({target:y})=>d(t,y&&y.value);return c.jsx("div",{className:"flex p-0.5",children:c.jsx(ES,{id:t,name:e||t,placeholder:n,disabled:s,readOnly:a,value:r??"",required:i,autoFocus:o,rows:u.rows||5,onChange:g,onBlur:m,onFocus:p,"aria-describedby":we(t),className:h})})}function DS(){return{CheckboxWidget:Qv,CheckboxesWidget:eS,RadioWidget:rS,RangeWidget:AS,SelectWidget:PS,TextareaWidget:IS}}function $S(){return{templates:Yv(),widgets:DS()}}function kS(){return W1($S())}const MS=kS();function RS(t){const e=t.properties;if(!e)return!1;const n=e.__type,r=e.__binding;return!!(n?.const||r?.const)}function BS(t){const e=t.properties;if(!e)return{};const n=e.__type,r=e.__binding;return{bindingType:n?.const,bindingSchema:r?.const}}function US(t){return t.replace(/^root_/,"").split("_")[0]||""}function qo(t){return typeof t!="string"?!1:(t.startsWith("@")?t.slice(1):t).includes("/")}function LS(t){const e=xe.c(8),{bindingSchema:n,bindingType:r,currentValue:i,onValueChange:s,placeholder:o,onAddNew:a,className:l}=t,d=qo(n),f=qo(r),u=d||f,h=d?n:f?r:void 0,{bindingSchema:g}=$d(h);let m;e:{if(u){m=g;break e}if(Array.isArray(n)){m=n;break e}if(typeof n=="string"){m=n;break e}m=void 0}const p=m;let y;return e[0]!==r||e[1]!==l||e[2]!==i||e[3]!==a||e[4]!==s||e[5]!==o||e[6]!==p?(y=c.jsx(WS,{value:i,onValueChange:s,placeholder:o,binding:p,bindingType:r,onAddNew:a,className:l}),e[0]=r,e[1]=l,e[2]=i,e[3]=a,e[4]=s,e[5]=o,e[6]=p,e[7]=y):y=e[7],y}function WS({value:t,onValueChange:e,placeholder:n="Select a connection...",binding:r,bindingType:i,onAddNew:s,className:o}){const[a,l]=P.useState(!1),{installByBinding:d,isInstalling:f}=Md(),u=a||f,h=gi(),g=ea({connections:h,binding:r}),m=(()=>{if(!i?.startsWith("@"))return null;const[S,O]=i.replace("@","").split("/");return S&&O?{scope:S,appName:O}:null})(),p=(()=>{let S=g;const O=Array.isArray(r)&&r.length>0;if(m&&!O&&(S=S.filter(b=>{const v=b.app_name,w=b.metadata?.scopeName;return v===m.appName&&w===m.scope})),t&&!S.some(b=>b.id===t)){const b=h?.find(v=>v.id===t);if(b)return[b,...S]}return S})(),y=i?.startsWith("@"),x=async()=>{if(y&&i){l(!0);try{const S=await d(i);S&&e(S.id)}catch(S){const O=S instanceof Error?S.message:String(S);wt.error(`Failed to connect MCP: ${O}`)}finally{l(!1)}return}s?.()};return c.jsxs(ta,{value:t,onValueChange:e,children:[c.jsx(na,{size:"sm",className:hu("w-[200px]",o),children:c.jsx(ra,{placeholder:n})}),c.jsxs(ia,{children:[p.length===0?c.jsx("div",{className:"px-2 py-4 text-center text-sm text-muted-foreground",children:"No connections found"}):p.map(S=>c.jsx(Rt,{value:S.id,children:c.jsxs("div",{className:"flex items-center gap-2",children:[S.icon?c.jsx("img",{src:S.icon,alt:S.title,className:"w-4 h-4 rounded"}):c.jsx("div",{className:"w-4 h-4 rounded bg-linear-to-br from-primary/20 to-primary/10 flex items-center justify-center text-xs font-semibold text-primary",children:S.title.slice(0,1).toUpperCase()}),c.jsx("span",{children:S.title})]})},S.id)),(s||y)&&c.jsx("div",{className:"border-t border-border",children:c.jsx(Ot,{onClick:S=>{S.preventDefault(),S.stopPropagation(),x()},disabled:u,variant:"ghost",className:"w-full justify-start gap-2 px-2 py-2 h-auto hover:bg-muted rounded-md text-sm disabled:opacity-50 disabled:cursor-not-allowed",type:"button",children:u?c.jsxs(c.Fragment,{children:[c.jsx(yn,{size:16,className:"animate-spin"}),c.jsx("span",{children:"Connecting..."})]}):c.jsxs(c.Fragment,{children:[c.jsx(la,{size:16}),c.jsx("span",{children:"Custom Connection"})]})})})]})]})}function VS(t){const e=xe.c(68),{schema:n,formData:r,title:i,description:s,registry:o}=t,a=o.formContext,l=t.properties[0]?.content?.key;let d;e[0]!==l||e[1]!==i?(d=i||(l?US(l):""),e[0]=l,e[1]=i,e[2]=d):d=e[2];const f=d;if(RS(n)){const g=n;let m;e[3]!==g?(m=BS(g),e[3]=g,e[4]=m):m=e[4];const{bindingType:p,bindingSchema:y}=m,x=r?.value||"";let S;e[5]!==p||e[6]!==f||e[7]!==a||e[8]!==r?(S=M=>{const k={...r,value:M,...p&&{__type:p}};a?.onFieldChange(f,k)},e[5]=p,e[6]=f,e[7]=a,e[8]=r,e[9]=S):S=e[9];const O=S;let b;e[10]!==p||e[11]!==f||e[12]!==a?(b=M=>{a?.onFieldChange(f,{__type:p,value:{id:M.id,connectionId:M.connectionId}})},e[10]=p,e[11]=f,e[12]=a,e[13]=b):b=e[13];const v=b,w=qS;let j;e[14]!==f||e[15]!==i?(j=w(i||f),e[14]=f,e[15]=i,e[16]=j):j=e[16];const A=j;if(p==="@deco/agent"){let M;e[17]!==A?(M=c.jsx("label",{className:"text-sm font-medium truncate block",children:A}),e[17]=A,e[18]=M):M=e[18];let k;e[19]!==s?(k=s&&c.jsx("p",{className:"text-xs text-muted-foreground truncate",children:s}),e[19]=s,e[20]=k):k=e[20];let B;e[21]!==M||e[22]!==k?(B=c.jsxs("div",{className:"flex-1 min-w-0",children:[M,k]}),e[21]=M,e[22]=k,e[23]=B):B=e[23];const V=x||void 0;let R;e[24]!==O||e[25]!==V?(R=c.jsx(Eu,{selectedVirtualMcpId:V,onVirtualMcpChange:O,variant:"bordered",placeholder:"Select Agent",className:"w-[200px] shrink-0"}),e[24]=O,e[25]=V,e[26]=R):R=e[26];let W;return e[27]!==R||e[28]!==B?(W=c.jsxs("div",{className:"flex items-center gap-3 justify-between",children:[B,R]}),e[27]=R,e[28]=B,e[29]=W):W=e[29],W}if(p==="@deco/language-model"){let M;e[30]!==A?(M=c.jsx("label",{className:"text-sm font-medium truncate block",children:A}),e[30]=A,e[31]=M):M=e[31];let k;e[32]!==s?(k=s&&c.jsx("p",{className:"text-xs text-muted-foreground truncate",children:s}),e[32]=s,e[33]=k):k=e[33];let B;e[34]!==M||e[35]!==k?(B=c.jsxs("div",{className:"flex-1 min-w-0",children:[M,k]}),e[34]=M,e[35]=k,e[36]=B):B=e[36];const V=x;let R;e[37]!==v||e[38]!==V?(R=c.jsx(Iu,{selectedModel:V,onModelChange:v,variant:"bordered",placeholder:"Select Language Model",className:"w-[200px] shrink-0"}),e[37]=v,e[38]=V,e[39]=R):R=e[39];let W;return e[40]!==R||e[41]!==B?(W=c.jsxs("div",{className:"flex items-center gap-3 justify-between",children:[B,R]}),e[40]=R,e[41]=B,e[42]=W):W=e[42],W}let C;e[43]!==A?(C=c.jsx("label",{className:"text-sm font-medium truncate block",children:A}),e[43]=A,e[44]=C):C=e[44];let T;e[45]!==s?(T=s&&c.jsx("p",{className:"text-xs text-muted-foreground truncate",children:s}),e[45]=s,e[46]=T):T=e[46];let N;e[47]!==C||e[48]!==T?(N=c.jsxs("div",{className:"flex-1 min-w-0",children:[C,T]}),e[47]=C,e[48]=T,e[49]=N):N=e[49];let _;e[50]!==A?(_=A.toLowerCase(),e[50]=A,e[51]=_):_=e[51];const F=`Select ${_}...`;let $;e[52]!==a?($=()=>a?.onAddNew(),e[52]=a,e[53]=$):$=e[53];let E;e[54]!==y||e[55]!==p||e[56]!==x||e[57]!==O||e[58]!==F||e[59]!==$?(E=c.jsx(LS,{bindingSchema:y,bindingType:p,currentValue:x,onValueChange:O,placeholder:F,onAddNew:$,className:"w-[200px] shrink-0"}),e[54]=y,e[55]=p,e[56]=x,e[57]=O,e[58]=F,e[59]=$,e[60]=E):E=e[60];let D;return e[61]!==E||e[62]!==N?(D=c.jsxs("div",{className:"flex items-center gap-3 justify-between",children:[N,E]}),e[61]=E,e[62]=N,e[63]=D):D=e[63],D}let u;e[64]!==t.properties?(u=t.properties.map(zS),e[64]=t.properties,e[65]=u):u=e[65];let h;return e[66]!==u?(h=c.jsx("div",{className:"flex flex-col gap-4",children:u}),e[66]=u,e[67]=h):h=e[67],h}function zS(t){return t.content}function qS(t){return t.toLowerCase().replace(/_/g," ").replace(/\b\w/g,KS)}function KS(t){return t.toUpperCase()}function GS(t){const e=xe.c(13),{label:n,children:r,description:i,id:s,schema:o}=t;if(s.includes("__type")||s.includes("__binding"))return null;if(o.type==="object")return r;let a;e[0]!==s||e[1]!==n?(a=n&&c.jsx("label",{className:"text-sm font-medium truncate block",htmlFor:s,children:n}),e[0]=s,e[1]=n,e[2]=a):a=e[2];let l;e[3]!==i?(l=i&&c.jsx("p",{className:"text-xs text-muted-foreground truncate",children:i}),e[3]=i,e[4]=l):l=e[4];let d;e[5]!==a||e[6]!==l?(d=c.jsxs("div",{className:"flex-1 min-w-0",children:[a,l]}),e[5]=a,e[6]=l,e[7]=d):d=e[7];let f;e[8]!==r?(f=c.jsx("div",{className:"w-[200px] shrink-0",children:r}),e[8]=r,e[9]=f):f=e[9];let u;return e[10]!==d||e[11]!==f?(u=c.jsxs("div",{className:"flex items-center gap-3 justify-between",children:[d,f]}),e[10]=d,e[11]=f,e[12]=u):u=e[12],u}const HS={ObjectFieldTemplate:VS,FieldTemplate:GS};function YS(t){const e=xe.c(18),{formState:n,onFormStateChange:r,stateSchema:i}=t,{org:s}=yi(),o=Go();let a;e[0]!==r?(a=x=>{x.formData&&r(x.formData)},e[0]=r,e[1]=a):a=e[1];const l=a;let d;e[2]!==n||e[3]!==r?(d=(x,S)=>{const O={...n,[x]:S};r(O)},e[2]=n,e[3]=r,e[4]=d):d=e[4];const f=d;let u;e[5]!==o||e[6]!==s?(u=()=>{o({to:"/$org/mcps",params:{org:s.slug},search:{action:"create"}})},e[5]=o,e[6]=s,e[7]=u):u=e[7];const h=u;let g;e[8]!==n||e[9]!==h||e[10]!==f?(g={onFieldChange:f,formData:n,onAddNew:h},e[8]=n,e[9]=h,e[10]=f,e[11]=g):g=e[11];const m=g;let p;e[12]===Symbol.for("react.memo_cache_sentinel")?(p=c.jsx(c.Fragment,{}),e[12]=p):p=e[12];let y;return e[13]!==m||e[14]!==n||e[15]!==l||e[16]!==i?(y=c.jsx("div",{className:"flex flex-col h-full overflow-auto p-5",children:c.jsx(MS,{schema:i,validator:tv,formData:n,onChange:l,formContext:m,liveValidate:!1,showErrorList:!1,templates:HS,children:p})}),e[13]=m,e[14]=n,e[15]=l,e[16]=i,e[17]=y):y=e[17],y}const XS=Xo({key:Ae().min(1,"Key is required"),value:Ae()}),JS=Xo({title:Ae().min(1,"Name is required"),description:Ae().nullable().optional(),ui_type:Jc(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:Ae().optional(),connection_token:Ae().nullable().optional(),npx_package:Ae().optional(),stdio_command:Ae().optional(),stdio_args:Ae().optional(),stdio_cwd:Ae().optional(),env_vars:ds(XS).optional(),configuration_scopes:ds(Ae()).nullable().optional(),configuration_state:Xc(Ae(),Zc()).nullable().optional()}).refine(t=>t.ui_type==="NPX"?!!t.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(t=>t.ui_type==="STDIO"?!!t.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(t=>t.ui_type==="HTTP"||t.ui_type==="SSE"||t.ui_type==="Websocket"?!!t.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]});function Ko(t){const e=xe.c(19),{connectionId:n,webhookType:r}=t,[i,s]=P.useState(!1),a=`${typeof window<"u"?window.location.origin:"https://mesh.deco.cx"}/webhooks/${n}`;let l;e[0]!==a?(l=async()=>{await navigator.clipboard.writeText(a),s(!0),wt.success("Webhook URL copied to clipboard"),setTimeout(()=>s(!1),2e3)},e[0]=a,e[1]=l):l=e[1];const d=l;let f,u;e[2]!==r?(f=c.jsxs(gu,{className:"text-sm font-medium",children:["Webhook URL (",r,")"]}),u=c.jsxs("p",{className:"text-xs text-muted-foreground",children:["Use this URL in your ",r," app's webhook/event subscription settings."]}),e[2]=r,e[3]=f,e[4]=u):(f=e[3],u=e[4]);let h;e[5]!==a?(h=c.jsx(Qe,{value:a,readOnly:!0,className:"font-mono text-sm bg-background"}),e[5]=a,e[6]=h):h=e[6];let g;e[7]!==i?(g=i?c.jsx(Kr,{size:16,className:"text-green-500"}):c.jsx(xu,{size:16}),e[7]=i,e[8]=g):g=e[8];let m;e[9]!==d||e[10]!==g?(m=c.jsx(Ot,{type:"button",variant:"outline",size:"icon",onClick:d,className:"shrink-0",children:g}),e[9]=d,e[10]=g,e[11]=m):m=e[11];let p;e[12]!==h||e[13]!==m?(p=c.jsxs("div",{className:"flex gap-2",children:[h,m]}),e[12]=h,e[13]=m,e[14]=p):p=e[14];let y;return e[15]!==f||e[16]!==u||e[17]!==p?(y=c.jsxs("div",{className:"flex flex-col gap-2 p-4 mb-4 bg-muted/50 rounded-lg border border-border",children:[f,u,p]}),e[15]=f,e[16]=u,e[17]=p,e[18]=y):y=e[18],y}function ZS(t){return t.command==="npx"}function QS(t){return t.args?.find(e=>!e.startsWith("-"))??""}function ew(t){return{command:t.command,args:t.args?.join(" ")??"",cwd:t.cwd??""}}function tw(t,e){const n={command:"npx",args:["-y",t]},r=Jo(e);return Object.keys(r).length>0&&(n.envVars=r),n}function nw(t,e,n,r){const i={command:t};e.trim()&&(i.args=e.trim().split(/\s+/)),n?.trim()&&(i.cwd=n.trim());const s=Jo(r);return Object.keys(s).length>0&&(i.envVars=s),i}function rw(t,e){const n={title:t.title,description:t.description??"",configuration_state:t.configuration_state??{},configuration_scopes:e||t.configuration_scopes||[]};if(t.connection_type==="STDIO"&&ou(t.connection_headers)){const r=t.connection_headers,i=au(r.envVars);if(ZS(r)){const o=QS(r);return{...n,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:o,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:i}}const s=ew(r);return{...n,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:s.command,stdio_args:s.args,stdio_cwd:s.cwd,env_vars:i}}return{...n,ui_type:t.connection_type,connection_url:t.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}function iw(t){let e,n=null,r=null,i=null;return t.ui_type==="NPX"?(e="STDIO",n="",i=tw(t.npx_package||"",t.env_vars||[])):t.ui_type==="STDIO"?(e="STDIO",n="",i=nw(t.stdio_command||"",t.stdio_args||"",t.stdio_cwd,t.env_vars||[])):(e=t.ui_type,n=t.connection_url||"",r=t.connection_token||null),{title:t.title,description:t.description||null,connection_type:e,connection_url:n,...r&&{connection_token:r},...i&&{connection_headers:i},configuration_state:t.configuration_state??null,configuration_scopes:t.configuration_scopes??null}}function sw(t){const e=xe.c(13);let n;e[0]!==t?(n=pi(t),e[0]=t,e[1]=n):n=e[1];const r=n;let i;e[2]===Symbol.for("react.memo_cache_sentinel")?(i={},e[2]=i):i=e[2];let s;e[3]!==t||e[4]!==r?(s={toolCaller:r,toolName:"MCP_CONFIGURATION",toolInputParams:i,scope:t},e[3]=t,e[4]=r,e[5]=s):s=e[5];const{data:o}=fu(s);let a;e[6]!==o.stateSchema?(a=o.stateSchema??{type:"object",properties:{}},e[6]=o.stateSchema,e[7]=a):a=e[7];const l=a;let d;e[8]!==o.scopes?(d=o.scopes??[],e[8]=o.scopes,e[9]=d):d=e[9];const f=d;let u;return e[10]!==f||e[11]!==l?(u={stateSchema:l,scopes:f},e[10]=f,e[11]=l,e[12]=u):u=e[12],u}function ow(t){const e=xe.c(4),{onAuthenticate:n,buttonText:r}=t,i=r===void 0?"Authenticate":r;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=c.jsxs("div",{className:"flex flex-col gap-2",children:[c.jsx("h3",{className:"text-lg font-semibold",children:"Authentication Required"}),c.jsx("p",{className:"text-sm text-muted-foreground max-w-md text-center",children:"This connection requires OAuth authentication to access resources."})]}),e[0]=s):s=e[0];let o;return e[1]!==i||e[2]!==n?(o=c.jsx("div",{className:"w-3/5 min-w-0 flex items-center justify-center",children:c.jsxs("div",{className:"flex flex-col items-center gap-4 max-w-md text-center",children:[s,c.jsx(Ot,{onClick:n,size:"lg",children:i})]})}),e[1]=i,e[2]=n,e[3]=o):o=e[3],o}function aw(t){const e=xe.c(7),{hasReadme:n,onViewReadme:r}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=c.jsx(vu,{size:48,className:"text-muted-foreground"}),e[0]=i):i=e[0];let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s=c.jsxs("div",{className:"flex flex-col gap-2",children:[c.jsx("h3",{className:"text-lg font-semibold",children:"Manual Authentication Required"}),c.jsx("p",{className:"text-sm text-muted-foreground max-w-md text-center",children:"This server requires an API key or token that must be configured manually. Check the server's documentation for instructions on obtaining credentials."})]}),e[1]=s):s=e[1];let o;e[2]!==n||e[3]!==r?(o=n&&r&&c.jsxs(Ot,{onClick:r,variant:"outline",size:"lg",children:[c.jsx(bu,{size:18,className:"mr-2"}),"View README"]}),e[2]=n,e[3]=r,e[4]=o):o=e[4];let a;return e[5]!==o?(a=c.jsx("div",{className:"w-3/5 min-w-0 flex items-center justify-center",children:c.jsxs("div",{className:"flex flex-col items-center gap-4 max-w-md text-center",children:[i,s,o]})}),e[5]=o,e[6]=a):a=e[6],a}function lw(){const t=xe.c(2);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=c.jsx("img",{src:"/empty-state-error.svg",alt:"",width:160,height:160,"aria-hidden":"true"}),t[0]=e):e=t[0];let n;return t[1]===Symbol.for("react.memo_cache_sentinel")?(n=c.jsx("div",{className:"w-3/5 min-w-0 flex items-center justify-center",children:c.jsxs("div",{className:"flex flex-col items-center gap-4 max-w-md text-center",children:[e,c.jsxs("div",{className:"flex flex-col gap-2",children:[c.jsx("h3",{className:"text-lg font-semibold",children:"Server Error"}),c.jsx("p",{className:"text-sm text-muted-foreground max-w-md text-center",children:"The MCP server is currently experiencing issues. Please try again later or check the server's status."})]})]})}),t[1]=n):n=t[1],n}function cw(t){const e=xe.c(3),n=sw(t.connection.id);let r;return e[0]!==n||e[1]!==t?(r=c.jsx(Nc,{...t,...n}),e[0]=n,e[1]=t,e[2]=r):r=e[2],r}function uw(t){const e=xe.c(2);let n;return e[0]!==t?(n=c.jsx(Nc,{...t}),e[0]=t,e[1]=n):n=e[1],n}function dw(t){const e=xe.c(24),{hasMcpBinding:n,stateSchema:r,formState:i,onFormStateChange:s,onAuthenticate:o,onViewReadme:a,isMCPAuthenticated:l,supportsOAuth:d,isServerError:f,hasReadme:u,connection:h}=t,g=r&&r.properties&&typeof r.properties=="object"&&Object.keys(r.properties).length>0,m=h.metadata?.webhookType;let p;e:{const w=h.title?.toLowerCase()??"",j=h.connection_url?.toLowerCase()??"";if(w.includes("slack")||j.includes("slack")){p="slack";break e}if(w.includes("whatsapp")||j.includes("whatsapp")){p="whatsapp";break e}if(w.includes("github")||j.includes("github")){p="github";break e}p=void 0}const x=m??p;if(!l){if(f){let j;return e[0]===Symbol.for("react.memo_cache_sentinel")?(j=c.jsx(lw,{}),e[0]=j):j=e[0],j}if(d){let j;return e[1]!==o?(j=c.jsx(ow,{onAuthenticate:o}),e[1]=o,e[2]=j):j=e[2],j}let w;return e[3]!==u||e[4]!==a?(w=c.jsx(aw,{hasReadme:u,onViewReadme:a}),e[3]=u,e[4]=a,e[5]=w):w=e[5],w}if(!n)return null;if(!g||!r){let w;e[6]!==h.id||e[7]!==x?(w=x&&c.jsx("div",{className:"p-5",children:c.jsx(Ko,{connectionId:h.id,webhookType:x})}),e[6]=h.id,e[7]=x,e[8]=w):w=e[8];let j;e[9]===Symbol.for("react.memo_cache_sentinel")?(j=c.jsx("div",{className:"flex-1 flex items-center justify-center",children:c.jsx(uu,{image:c.jsx("img",{src:"/empty-state-success-muted.svg",alt:"",width:220,height:200,"aria-hidden":"true"}),title:"This server is all set!",description:"No additional configuration is needed. Everything is ready to go."})}),e[9]=j):j=e[9];let A;return e[10]!==w?(A=c.jsxs("div",{className:"w-3/5 min-w-0 overflow-auto flex flex-col",children:[w,j]}),e[10]=w,e[11]=A):A=e[11],A}let S;e[12]!==h.id||e[13]!==x?(S=x&&c.jsx(Ko,{connectionId:h.id,webhookType:x}),e[12]=h.id,e[13]=x,e[14]=S):S=e[14];let O;e[15]!==i?(O=i??{},e[15]=i,e[16]=O):O=e[16];let b;e[17]!==s||e[18]!==r||e[19]!==O?(b=c.jsx(YS,{stateSchema:r,formState:O,onFormStateChange:s}),e[17]=s,e[18]=r,e[19]=O,e[20]=b):b=e[20];let v;return e[21]!==S||e[22]!==b?(v=c.jsxs("div",{className:"w-3/5 min-w-0 overflow-auto p-5",children:[S,b]}),e[21]=S,e[22]=b,e[23]=v):v=e[23],v}function Nc(t){const{connection:e,onUpdate:n,isUpdating:r,scopes:i,hasMcpBinding:s,stateSchema:o,onViewReadme:a}=t,l=Zo(),d=Qc(),u=eu().location.href,g=!!e?.metadata?.repository?.url,m=tu({resolver:nu(JS),values:rw(e,i)}),p=m.watch("configuration_state"),y=m.formState.isDirty,x=b=>{m.setValue("configuration_state",b,{shouldDirty:!0})},S=async()=>{if(!await m.trigger())return;const v=m.getValues(),w=iw(v);await n(w),m.reset(v)},O=async()=>{const{token:b,tokenInfo:v,error:w}=await iu({connectionId:e.id});if(w||!b){wt.error(`Authentication failed: ${w}`);return}if(v)try{const A=await fetch(`/api/connections/${e.id}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:v.accessToken,refreshToken:v.refreshToken,expiresIn:v.expiresIn,scope:v.scope,clientId:v.clientId,clientSecret:v.clientSecret,tokenEndpoint:v.tokenEndpoint})});if(!A.ok)console.error("Failed to save OAuth token:",await A.text()),await l.update.mutateAsync({id:e.id,data:{connection_token:b}});else try{await l.update.mutateAsync({id:e.id,data:{}})}catch(C){console.warn("Failed to refresh connection tools after OAuth:",C)}}catch(A){console.error("Error saving OAuth token:",A),await l.update.mutateAsync({id:e.id,data:{connection_token:b}})}else await l.update.mutateAsync({id:e.id,data:{connection_token:b}});const j=new URL(`/mcp/${e.id}`,window.location.origin);await d.invalidateQueries({queryKey:fi.isMCPAuthenticated(j.href,null)}),wt.success("Authentication successful")};return c.jsxs(c.Fragment,{children:[c.jsxs(Su,{children:[c.jsx(mu,{title:`${e.title}: Settings`,url:u,icon:e.icon??"settings"}),y&&c.jsxs(Ot,{onClick:S,disabled:r,size:"sm",className:"h-7",children:[r&&c.jsx(yn,{size:16,className:"mr-2 animate-spin"}),"Save Changes"]})]}),c.jsxs("div",{className:"flex h-full",children:[c.jsx("div",{className:"w-2/5 shrink-0 border-r border-border overflow-auto",children:c.jsx(Fd,{form:m,connection:e,hasOAuthToken:t.hasOAuthToken})}),c.jsx(du,{children:c.jsx(P.Suspense,{fallback:c.jsx("div",{className:"w-3/5 min-w-0 flex items-center justify-center",children:c.jsx(yn,{size:32,className:"animate-spin text-muted-foreground"})}),children:c.jsx(dw,{hasMcpBinding:s,stateSchema:o,formState:p??void 0,onFormStateChange:x,onAuthenticate:O,onViewReadme:a,isMCPAuthenticated:t.isMCPAuthenticated,supportsOAuth:t.supportsOAuth,isServerError:t.isServerError,hasReadme:g,connection:e})})})]})]})}function Kw(t){const e=xe.c(5);let n;e[0]!==t.connection?(n={connections:[t.connection],binding:"MCP"},e[0]=t.connection,e[1]=n):n=e[1];const i=ea(n).length>0;let s;return e[2]!==i||e[3]!==t?(s=c.jsx("div",{className:"flex-1",children:i?c.jsx(cw,{...t,hasMcpBinding:!0}):c.jsx(uw,{...t,hasMcpBinding:!1})}),e[2]=i,e[3]=t,e[4]=s):s=e[4],s}export{L1 as F,aw as M,ow as O,Kw as S,zw as u,tv as v};
|