@simoncomputing/mui-bueno-v2 0.19.4 → 0.19.6

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/index.cjs.js CHANGED
@@ -101,7 +101,7 @@ __p += '`),gt&&(Ee+=`' +
101
101
  function print() { __p += __j.call(arguments, '') }
102
102
  `:`;
103
103
  `)+Ee+`return __p
104
- }`;var at=dw(function(){return Ct(H,He+"return "+Ee).apply(n,K)});if(at.source=Ee,_m(at))throw at;return at}function d4(d){return Tt(d).toLowerCase()}function f4(d){return Tt(d).toUpperCase()}function p4(d,h,x){if(d=Tt(d),d&&(x||h===n))return xS(d);if(!d||!(h=xr(h)))return d;var k=eo(d),I=eo(h),H=SS(k,I),K=CS(k,I)+1;return Ti(k,H,K).join("")}function h4(d,h,x){if(d=Tt(d),d&&(x||h===n))return d.slice(0,TS(d)+1);if(!d||!(h=xr(h)))return d;var k=eo(d),I=CS(k,eo(h))+1;return Ti(k,0,I).join("")}function m4(d,h,x){if(d=Tt(d),d&&(x||h===n))return d.replace(_h,"");if(!d||!(h=xr(h)))return d;var k=eo(d),I=SS(k,eo(h));return Ti(k,I).join("")}function g4(d,h){var x=M,k=R;if(Qt(h)){var I="separator"in h?h.separator:I;x="length"in h?it(h.length):x,k="omission"in h?xr(h.omission):k}d=Tt(d);var H=d.length;if(aa(d)){var K=eo(d);H=K.length}if(x>=H)return d;var Q=x-la(k);if(Q<1)return k;var ie=K?Ti(K,0,Q).join(""):d.slice(0,Q);if(I===n)return ie+k;if(K&&(Q+=ie.length-Q),km(I)){if(d.slice(Q).search(I)){var we,Te=ie;for(I.global||(I=Vh(I.source,Tt(V1.exec(I))+"g")),I.lastIndex=0;we=I.exec(Te);)var Ee=we.index;ie=ie.slice(0,Ee===n?Q:Ee)}}else if(d.indexOf(xr(I),Q)!=Q){var De=ie.lastIndexOf(I);De>-1&&(ie=ie.slice(0,De))}return ie+k}function y4(d){return d=Tt(d),d&&$o.test(d)?d.replace(Gn,UL):d}var b4=ma(function(d,h,x){return d+(x?" ":"")+h.toUpperCase()}),Om=fC("toUpperCase");function uw(d,h,x){return d=Tt(d),h=x?n:h,h===n?zL(d)?GL(d):IL(d):d.match(h)||[]}var dw=ut(function(d,h){try{return br(d,n,h)}catch(x){return _m(x)?x:new nt(x)}}),v4=Wo(function(d,h){return Ar(h,function(x){x=vo(x),Vo(d,x,wm(d[x],d))}),d});function x4(d){var h=d==null?0:d.length,x=Ze();return d=h?Jt(d,function(k){if(typeof k[1]!="function")throw new Ir(s);return[x(k[0]),k[1]]}):[],ut(function(k){for(var I=-1;++I<h;){var H=d[I];if(br(H[0],this,k))return br(H[1],this,k)}})}function S4(d){return UF(Pr(d,p))}function Rm(d){return function(){return d}}function C4(d,h){return d==null||d!==d?h:d}var w4=hC(),T4=hC(!0);function cr(d){return d}function Am(d){return WS(typeof d=="function"?d:Pr(d,p))}function _4(d){return US(Pr(d,p))}function k4(d,h){return KS(d,Pr(h,p))}var E4=ut(function(d,h){return function(x){return Ml(x,d,h)}}),M4=ut(function(d,h){return function(x){return Ml(d,x,h)}});function Im(d,h,x){var k=Tn(h),I=Uu(h,k);x==null&&!(Qt(h)&&(I.length||!k.length))&&(x=h,h=d,d=this,I=Uu(h,Tn(h)));var H=!(Qt(x)&&"chain"in x)||!!x.chain,K=Uo(d);return Ar(I,function(Q){var ie=h[Q];d[Q]=ie,K&&(d.prototype[Q]=function(){var we=this.__chain__;if(H||we){var Te=d(this.__wrapped__),Ee=Te.__actions__=sr(this.__actions__);return Ee.push({func:ie,args:arguments,thisArg:d}),Te.__chain__=we,Te}return ie.apply(d,bi([this.value()],arguments))})}),d}function O4(){return Dn._===this&&(Dn._=tF),this}function Dm(){}function R4(d){return d=it(d),ut(function(h){return YS(h,d)})}var A4=um(Jt),I4=um(mS),D4=um(Nh);function fw(d){return ym(d)?jh(vo(d)):c$(d)}function P4(d){return function(h){return d==null?n:fs(d,h)}}var N4=gC(),j4=gC(!0);function Pm(){return[]}function Nm(){return!1}function L4(){return{}}function F4(){return""}function $4(){return!0}function B4(d,h){if(d=it(d),d<1||d>q)return[];var x=Z,k=Bn(d,Z);h=Ze(h),d-=Z;for(var I=$h(k,h);++x<d;)h(x);return I}function z4(d){return ot(d)?Jt(d,vo):Sr(d)?[d]:sr(IC(Tt(d)))}function V4(d){var h=++QL;return Tt(d)+h}var H4=Xu(function(d,h){return d+h},0),W4=dm("ceil"),q4=Xu(function(d,h){return d/h},1),U4=dm("floor");function K4(d){return d&&d.length?qu(d,cr,Jh):n}function Y4(d,h){return d&&d.length?qu(d,Ze(h,2),Jh):n}function G4(d){return bS(d,cr)}function J4(d,h){return bS(d,Ze(h,2))}function Z4(d){return d&&d.length?qu(d,cr,em):n}function X4(d,h){return d&&d.length?qu(d,Ze(h,2),em):n}var Q4=Xu(function(d,h){return d*h},1),ez=dm("round"),tz=Xu(function(d,h){return d-h},0);function nz(d){return d&&d.length?Fh(d,cr):0}function rz(d,h){return d&&d.length?Fh(d,Ze(h,2)):0}return V.after=_B,V.ary=HC,V.assign=f3,V.assignIn=rw,V.assignInWith=dd,V.assignWith=p3,V.at=h3,V.before=WC,V.bind=wm,V.bindAll=v4,V.bindKey=qC,V.castArray=LB,V.chain=BC,V.chunk=U$,V.compact=K$,V.concat=Y$,V.cond=x4,V.conforms=S4,V.constant=Rm,V.countBy=nB,V.create=m3,V.curry=UC,V.curryRight=KC,V.debounce=YC,V.defaults=g3,V.defaultsDeep=y3,V.defer=kB,V.delay=EB,V.difference=G$,V.differenceBy=J$,V.differenceWith=Z$,V.drop=X$,V.dropRight=Q$,V.dropRightWhile=e5,V.dropWhile=t5,V.fill=n5,V.filter=oB,V.flatMap=aB,V.flatMapDeep=lB,V.flatMapDepth=cB,V.flatten=jC,V.flattenDeep=r5,V.flattenDepth=o5,V.flip=MB,V.flow=w4,V.flowRight=T4,V.fromPairs=i5,V.functions=T3,V.functionsIn=_3,V.groupBy=uB,V.initial=a5,V.intersection=l5,V.intersectionBy=c5,V.intersectionWith=u5,V.invert=E3,V.invertBy=M3,V.invokeMap=fB,V.iteratee=Am,V.keyBy=pB,V.keys=Tn,V.keysIn=lr,V.map=id,V.mapKeys=R3,V.mapValues=A3,V.matches=_4,V.matchesProperty=k4,V.memoize=ad,V.merge=I3,V.mergeWith=ow,V.method=E4,V.methodOf=M4,V.mixin=Im,V.negate=ld,V.nthArg=R4,V.omit=D3,V.omitBy=P3,V.once=OB,V.orderBy=hB,V.over=A4,V.overArgs=RB,V.overEvery=I4,V.overSome=D4,V.partial=Tm,V.partialRight=GC,V.partition=mB,V.pick=N3,V.pickBy=iw,V.property=fw,V.propertyOf=P4,V.pull=h5,V.pullAll=FC,V.pullAllBy=m5,V.pullAllWith=g5,V.pullAt=y5,V.range=N4,V.rangeRight=j4,V.rearg=AB,V.reject=bB,V.remove=b5,V.rest=IB,V.reverse=Sm,V.sampleSize=xB,V.set=L3,V.setWith=F3,V.shuffle=SB,V.slice=v5,V.sortBy=TB,V.sortedUniq=k5,V.sortedUniqBy=E5,V.split=a4,V.spread=DB,V.tail=M5,V.take=O5,V.takeRight=R5,V.takeRightWhile=A5,V.takeWhile=I5,V.tap=K5,V.throttle=PB,V.thru=od,V.toArray=ew,V.toPairs=sw,V.toPairsIn=aw,V.toPath=z4,V.toPlainObject=nw,V.transform=$3,V.unary=NB,V.union=D5,V.unionBy=P5,V.unionWith=N5,V.uniq=j5,V.uniqBy=L5,V.uniqWith=F5,V.unset=B3,V.unzip=Cm,V.unzipWith=$C,V.update=z3,V.updateWith=V3,V.values=ba,V.valuesIn=H3,V.without=$5,V.words=uw,V.wrap=jB,V.xor=B5,V.xorBy=z5,V.xorWith=V5,V.zip=H5,V.zipObject=W5,V.zipObjectDeep=q5,V.zipWith=U5,V.entries=sw,V.entriesIn=aw,V.extend=rw,V.extendWith=dd,Im(V,V),V.add=H4,V.attempt=dw,V.camelCase=K3,V.capitalize=lw,V.ceil=W4,V.clamp=W3,V.clone=FB,V.cloneDeep=BB,V.cloneDeepWith=zB,V.cloneWith=$B,V.conformsTo=VB,V.deburr=cw,V.defaultTo=C4,V.divide=q4,V.endsWith=Y3,V.eq=no,V.escape=G3,V.escapeRegExp=J3,V.every=rB,V.find=iB,V.findIndex=PC,V.findKey=b3,V.findLast=sB,V.findLastIndex=NC,V.findLastKey=v3,V.floor=U4,V.forEach=zC,V.forEachRight=VC,V.forIn=x3,V.forInRight=S3,V.forOwn=C3,V.forOwnRight=w3,V.get=Em,V.gt=HB,V.gte=WB,V.has=k3,V.hasIn=Mm,V.head=LC,V.identity=cr,V.includes=dB,V.indexOf=s5,V.inRange=q3,V.invoke=O3,V.isArguments=ms,V.isArray=ot,V.isArrayBuffer=qB,V.isArrayLike=ar,V.isArrayLikeObject=dn,V.isBoolean=UB,V.isBuffer=_i,V.isDate=KB,V.isElement=YB,V.isEmpty=GB,V.isEqual=JB,V.isEqualWith=ZB,V.isError=_m,V.isFinite=XB,V.isFunction=Uo,V.isInteger=JC,V.isLength=cd,V.isMap=ZC,V.isMatch=QB,V.isMatchWith=e3,V.isNaN=t3,V.isNative=n3,V.isNil=o3,V.isNull=r3,V.isNumber=XC,V.isObject=Qt,V.isObjectLike=rn,V.isPlainObject=Pl,V.isRegExp=km,V.isSafeInteger=i3,V.isSet=QC,V.isString=ud,V.isSymbol=Sr,V.isTypedArray=ya,V.isUndefined=s3,V.isWeakMap=a3,V.isWeakSet=l3,V.join=d5,V.kebabCase=Z3,V.last=jr,V.lastIndexOf=f5,V.lowerCase=X3,V.lowerFirst=Q3,V.lt=c3,V.lte=u3,V.max=K4,V.maxBy=Y4,V.mean=G4,V.meanBy=J4,V.min=Z4,V.minBy=X4,V.stubArray=Pm,V.stubFalse=Nm,V.stubObject=L4,V.stubString=F4,V.stubTrue=$4,V.multiply=Q4,V.nth=p5,V.noConflict=O4,V.noop=Dm,V.now=sd,V.pad=e4,V.padEnd=t4,V.padStart=n4,V.parseInt=r4,V.random=U3,V.reduce=gB,V.reduceRight=yB,V.repeat=o4,V.replace=i4,V.result=j3,V.round=ez,V.runInContext=re,V.sample=vB,V.size=CB,V.snakeCase=s4,V.some=wB,V.sortedIndex=x5,V.sortedIndexBy=S5,V.sortedIndexOf=C5,V.sortedLastIndex=w5,V.sortedLastIndexBy=T5,V.sortedLastIndexOf=_5,V.startCase=l4,V.startsWith=c4,V.subtract=tz,V.sum=nz,V.sumBy=rz,V.template=u4,V.times=B4,V.toFinite=Ko,V.toInteger=it,V.toLength=tw,V.toLower=d4,V.toNumber=Lr,V.toSafeInteger=d3,V.toString=Tt,V.toUpper=f4,V.trim=p4,V.trimEnd=h4,V.trimStart=m4,V.truncate=g4,V.unescape=y4,V.uniqueId=V4,V.upperCase=b4,V.upperFirst=Om,V.each=zC,V.eachRight=VC,V.first=LC,Im(V,function(){var d={};return yo(V,function(h,x){Mt.call(V.prototype,x)||(d[x]=h)}),d}(),{chain:!1}),V.VERSION=r,Ar(["bind","bindKey","curry","curryRight","partial","partialRight"],function(d){V[d].placeholder=V}),Ar(["drop","take"],function(d,h){ht.prototype[d]=function(x){x=x===n?1:xn(it(x),0);var k=this.__filtered__&&!h?new ht(this):this.clone();return k.__filtered__?k.__takeCount__=Bn(x,k.__takeCount__):k.__views__.push({size:Bn(x,Z),type:d+(k.__dir__<0?"Right":"")}),k},ht.prototype[d+"Right"]=function(x){return this.reverse()[d](x).reverse()}}),Ar(["filter","map","takeWhile"],function(d,h){var x=h+1,k=x==$||x==L;ht.prototype[d]=function(I){var H=this.clone();return H.__iteratees__.push({iteratee:Ze(I,3),type:x}),H.__filtered__=H.__filtered__||k,H}}),Ar(["head","last"],function(d,h){var x="take"+(h?"Right":"");ht.prototype[d]=function(){return this[x](1).value()[0]}}),Ar(["initial","tail"],function(d,h){var x="drop"+(h?"":"Right");ht.prototype[d]=function(){return this.__filtered__?new ht(this):this[x](1)}}),ht.prototype.compact=function(){return this.filter(cr)},ht.prototype.find=function(d){return this.filter(d).head()},ht.prototype.findLast=function(d){return this.reverse().find(d)},ht.prototype.invokeMap=ut(function(d,h){return typeof d=="function"?new ht(this):this.map(function(x){return Ml(x,d,h)})}),ht.prototype.reject=function(d){return this.filter(ld(Ze(d)))},ht.prototype.slice=function(d,h){d=it(d);var x=this;return x.__filtered__&&(d>0||h<0)?new ht(x):(d<0?x=x.takeRight(-d):d&&(x=x.drop(d)),h!==n&&(h=it(h),x=h<0?x.dropRight(-h):x.take(h-d)),x)},ht.prototype.takeRightWhile=function(d){return this.reverse().takeWhile(d).reverse()},ht.prototype.toArray=function(){return this.take(Z)},yo(ht.prototype,function(d,h){var x=/^(?:filter|find|map|reject)|While$/.test(h),k=/^(?:head|last)$/.test(h),I=V[k?"take"+(h=="last"?"Right":""):h],H=k||/^find/.test(h);I&&(V.prototype[h]=function(){var K=this.__wrapped__,Q=k?[1]:arguments,ie=K instanceof ht,we=Q[0],Te=ie||ot(K),Ee=function(ft){var gt=I.apply(V,bi([ft],Q));return k&&De?gt[0]:gt};Te&&x&&typeof we=="function"&&we.length!=1&&(ie=Te=!1);var De=this.__chain__,He=!!this.__actions__.length,Xe=H&&!De,at=ie&&!He;if(!H&&Te){K=at?K:new ht(this);var Qe=d.apply(K,Q);return Qe.__actions__.push({func:od,args:[Ee],thisArg:n}),new Dr(Qe,De)}return Xe&&at?d.apply(this,Q):(Qe=this.thru(Ee),Xe?k?Qe.value()[0]:Qe.value():Qe)})}),Ar(["pop","push","shift","sort","splice","unshift"],function(d){var h=Ru[d],x=/^(?:push|sort|unshift)$/.test(d)?"tap":"thru",k=/^(?:pop|shift)$/.test(d);V.prototype[d]=function(){var I=arguments;if(k&&!this.__chain__){var H=this.value();return h.apply(ot(H)?H:[],I)}return this[x](function(K){return h.apply(ot(K)?K:[],I)})}}),yo(ht.prototype,function(d,h){var x=V[h];if(x){var k=x.name+"";Mt.call(fa,k)||(fa[k]=[]),fa[k].push({name:h,func:x})}}),fa[Zu(n,C).name]=[{name:"wrapper",func:n}],ht.prototype.clone=yF,ht.prototype.reverse=bF,ht.prototype.value=vF,V.prototype.at=Y5,V.prototype.chain=G5,V.prototype.commit=J5,V.prototype.next=Z5,V.prototype.plant=Q5,V.prototype.reverse=eB,V.prototype.toJSON=V.prototype.valueOf=V.prototype.value=tB,V.prototype.first=V.prototype.head,Sl&&(V.prototype[Sl]=X5),V},ca=JL();as?((as.exports=ca)._=ca,Ah._=ca):Dn._=ca}).call(dq)}(Zl,Zl.exports)),Zl.exports}var yf=fq();const pq=t=>{const{name:e,onInputChange:n,onChange:r,onFilter:o,onFilterError:i,fetchOnCount:s=1,preFilterMessage:a=s?"Start typing to see options...":t.noOptionsText,noOptionsText:l,filterOptions:u=P=>P,includeInputInList:f=!0,autoComplete:p=!0,...m}=t,[y,b,g]=qt.useField(e),{setValue:S}=g,[C,_]=X.useState(""),[T,w]=X.useState([]),[E,O]=X.useState(!1),N=yf.debounce(async(P,j)=>{try{O(!0);const M=await o(P.input);j(M)}catch(M){throw M}finally{O(!1)}},400);return X.useEffect(()=>{if(C===""){w(y.value?[y.value]:[]);return}C.length>=s&&N({input:C},P=>{let j=[];P?(j=P,y.value&&(j=[y.value,...P.filter(M=>JSON.stringify(M)!==JSON.stringify(y.value))])):y.value&&(j=[y.value]),w(j)})},[y.value,C]),v.jsx(RR,{name:e,loading:E,filterOptions:u,noOptionsText:C.length<s?a:l,options:T,autoComplete:p,includeInputInList:f,onChange:(P,j,M,R)=>{w(j?[j,...T]:T),S(j),r&&r(P,j,M,R)},onInputChange:(P,j,M)=>{_(j),n&&n(P,j,M)},...m})},hq=t=>{const{name:e,label:n=Mn(e),options:r=[],filterSelectedOptions:o=!0,variant:i="outlined",staticLabel:s=!1,staticLabelProps:a={fontSize:".9em",color:"#808080"},readOnly:l,margin:u="dense",fullWidth:f=!0,required:p,onChange:m,getOptionLabel:y=j=>typeof j=="string"?j:String(j),isOptionEqualToValue:b=(j,M)=>JSON.stringify(j)===JSON.stringify(M),useFieldAsValue:g,errorMode:S="normal",...C}=t,[_,T,w]=qt.useField(e),{setValue:E}=w,{error:O}=T,N={...er(C,["useFieldAsValue","errorMode"]),getOptionLabel:y,options:r,filterSelectedOptions:o,isOptionEqualToValue:b,renderInput:j=>v.jsx(D.TextField,{...j,variant:i,label:s?void 0:n,error:!!O,required:p}),onChange:(j,M,R,B)=>{E(g?M.map(F=>F[g]):M),m&&m(j,M,R,B)},fullWidth:!0,value:g?r.filter(j=>_.value.includes(j[g]))||[]:_.value,slotProps:{paper:{elevation:8,sx:{borderRadius:2}}}},P=()=>_.value.length===0?"":(g?r.filter(M=>_.value.includes(M[g]))||[]:_.value).map(M=>y(M)).join(", ");return v.jsxs(D.FormControl,{margin:u,fullWidth:f,required:p,children:[(s||l)&&v.jsx(D.Typography,{...a,children:n}),l?v.jsx(D.Typography,{children:P()}):v.jsxs(D.Box,{children:[v.jsx(D.Autocomplete,{...N,multiple:!0}),v.jsx(yr,{name:e,id:`${e}-err`,errorMode:S})]})]})},AR=t=>{const{name:e,label:n=Mn(e),helperText:r,required:o=!1,labelPlacement:i="end",labelAlignment:s=i==="end"||i==="start"?"top":"center",readOnly:a=!1,staticLabelProps:l={fontSize:".9em",color:"#808080"},onChange:u,errorMode:f="normal",...p}=t;s==="top"&&(i==="bottom"||i==="top")&&console.error(`Checkbox: Ignoring labelAlignment='top'. labelAlignment cannot be 'top' when labelPlacement=${i}`);const m=qt.useField({name:e}),y=m[0],b=m[2],g=r?v.jsxs("div",{children:[v.jsx("p",{style:{margin:0},children:n}),v.jsx(D.Typography,{variant:"caption",style:{fontSize:"0.85rem"},children:r})]}):n,S=s==="top"&&(i==="start"||i==="end");if(a)return y.value&&v.jsx(D.Typography,{...l,children:g});const C=v.jsx(D.FormControlLabel,{sx:{alignItems:S?"flex-start":"center"},label:v.jsx("span",{"data-testid":n,style:{display:"inline-block",marginTop:S?"10px":0},children:g}),required:o,labelPlacement:i,control:v.jsx(D.Checkbox,{"data-testid":"checkbox",...p,...y,onChange:(_,T)=>{b.setValue(_.target.checked),u&&u(_,T)},checked:y.value})});return v.jsxs(D.Box,{children:[C,v.jsx(yr,{name:e,id:`${e}-err`,errorMode:f})]})},Ps=t=>{const{name:e,label:n=Mn(e),format:r="",autoFormat:o=r,placeholder:i=n,staticLabel:s=!1,staticLabelProps:a={fontSize:".9em",color:"#808080"},readOnly:l=!1,startIcon:u,endIcon:f,margin:p="dense",noTrimOnBlur:m=!1,errorMode:y="normal"}=t,[b,g,S]=qt.useField({name:e}),{setValue:C}=S,{value:_}=b,{error:T}=g;_===void 0&&console.error(`Please set an initial value for ${e}`),!r&&o&&console.error("Can't auto format when there is no format");const w=O=>{if(o){const N=m6(O.target.value,r,_,O.target);C(N)}else C(O.target.value);t.onChange&&t.onChange(O)},E=["autoFormat","format","staticLabel","staticLabelProps","endIcon","startIcon","errorMode"];return v.jsxs(D.FormControl,{margin:p,fullWidth:!0,children:[(s||l)&&v.jsx(D.Typography,{...a,children:n}),l?v.jsx(D.Typography,{children:_}):v.jsxs(D.Box,{children:[v.jsx(D.TextField,{variant:"outlined",fullWidth:!0,...b,id:`${e}-tf`,error:!!T,placeholder:i,...er({...t},E),onChange:w,label:s?void 0:n,slotProps:{input:{endAdornment:f,startAdornment:u}},onBlur:O=>{m||C(O.target.value.trim()),t.onBlur&&t.onBlur(O)}}),v.jsx(yr,{name:e,id:`${e}-err`,errorMode:y})]})]})},mq=t=>{const{name:e,checkboxes:n=[],label:r=Mn(e),labelPlacement:o="end",labelAlignment:i=o==="end"||o==="start"?"top":"center",required:s=!1,disabled:a=!1,readOnly:l=!1,min:u=0,max:f=n.length,minMaxSubtitle:p="Please select between {min} and {max} options",maxSubtitle:m="Up to {max} max",minSubtitle:y="Please select {min} or more",margin:b="dense",staticLabelProps:g={fontSize:".9em",color:"#808080"},errorMode:S="normal"}=t,[C,_,T]=qt.useField({name:e}),{setValue:w}=T,{value:E}=C,{error:O}=_,{setFieldValue:N}=qt.useFormikContext();(u<0||u>=n.length)&&console.error(`CheckboxGroup: "min" cannot be ${u}. It must be a value between 0 and ${n.length-1}.`),(f<=1||f>n.length)&&console.error(`CheckboxGroup: "max" must be a value between 2 and ${n.length}.`),i==="top"&&(o==="bottom"||o==="top")&&console.error(`CheckboxGroup: Ignoring labelAlignment='top'. labelAlignment cannot be 'top' when labelPlacement=${o}`);const P=()=>t.labelPlacement=="start"?"right":t.labelPlacement=="top"||t.labelPlacement=="bottom"?"center":"left",j=F=>typeof F=="string"?F:!F.textField&&!F.helperText?F.label:v.jsxs(D.Box,{display:"flex",flexDirection:"row",justifyContent:"center",gap:"0.5rem",alignItems:"baseline",children:[v.jsxs(D.Box,{display:"flex",flexDirection:"column",justifyContent:"center",children:[v.jsx("p",{style:{margin:0},children:F.label}),F.helperText&&v.jsx(D.Typography,{variant:"caption",style:{fontSize:"0.85rem"},children:F.helperText})]}),F.textField&&v.jsx(Ps,{label:"",size:"small",margin:"none",sx:{"& .MuiInputBase-input":{height:14}},...F.textField})]}),M=n.map(F=>{const $=typeof F=="string"?F:F.label,z=i==="top"&&(o==="start"||o==="end");return v.jsx(D.FormControlLabel,{sx:{alignItems:z?"flex-start":"center"},value:$,control:v.jsx(D.Checkbox,{}),label:v.jsx("div",{"data-testid":typeof F=="string"?F:F.label,style:{marginTop:z?"10px":0},children:j(F)}),labelPlacement:o,checked:E.includes($),disabled:a||!E.includes($)&&E.length===f,style:{textAlign:P()}},`checkbox-group-${$}`)}),R=()=>{if(f<n.length&&u>0)return v.jsx(D.Typography,{variant:"subtitle2",children:p.replace("{min}",`${u}`).replace("{max}",`${f}`)});if(f<n.length)return v.jsx(D.Typography,{variant:"subtitle2",children:m.replace("{max}",`${f}`)});if(u>0)return v.jsx(D.Typography,{variant:"subtitle2",children:y.replace("{min}",`${u}`)})};return l?v.jsxs(D.Box,{children:[v.jsx(D.Typography,{...g,children:r}),E.join(", ")]}):v.jsxs(D.FormControl,{onChange:F=>{const $=F.target.value,z=F.target.checked,L=n.find(W=>typeof W=="string"?W===$:W.label===$);z?w([...E,$]):(L&&typeof L=="object"&&L.textField&&L.textField.name&&N(L.textField.name,""),w(E.filter(W=>W!=$)))},fullWidth:!0,margin:b,error:!!O,children:[v.jsx(D.FormLabel,{focused:t.focused,htmlFor:e,required:s,disabled:t.disableLabel,children:r}),R(),M,v.jsx(yr,{name:e,id:`${e}-err`,errorMode:S})]})},eT=Le(v.jsx("path",{d:"M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96M14 13v4h-4v-4H7l5-5 5 5z"}),"CloudUpload"),IR=t=>{const{name:e,multiple:n=!1,readOnly:r=!1,variant:o=n?"drag-and-drop":"button",duplicateFilesCallback:i,incorrectFileTypesCallback:s,staticLabelProps:a={fontSize:".9em",color:"#808080"},errorMode:l="normal"}=t,[u,f,p]=qt.useField({name:e}),{setValue:m}=p,y=u.value,b=t.fileType?Array.isArray(t.fileType)?t.fileType:[t.fileType]:[],g=t.subtitle??(b.length>0?`Allowed file extensions: ${b.join(", ")}`:""),S=j=>{_(Array.from(j.target.files??[]))},C=j=>{j.preventDefault(),_(Array.from(j.dataTransfer.files))},_=j=>{if(j&&j.length>0){const M=y?Array.isArray(y)?y:[y]:[],R=yf.partition(j,B=>M.find(F=>w(B,F)));if(j=R[1],i&&R[0].length>0&&i(R[0]),b.length>0){const B=yf.partition(j,F=>b.find($=>F.name.endsWith($)));j=B[0],s&&B[1].length>0&&s(B[1])}n?m([...T(),...j]):!Array.isArray(y)&&j.length>0&&m(j[0])}},T=()=>y?Array.isArray(y)?y:[y]:[],w=(j,M)=>j.lastModified===M.lastModified&&j.name===M.name&&j.type===M.type&&j.size===M.size,E=()=>T().map(j=>j.name).join(", "),O=v.jsx(yr,{name:e,id:`${e}-err`,errorMode:l});return r?v.jsx(D.Typography,{"data-testid":"fileupload-readonly",...a,children:E()}):o==="drag-and-drop"?v.jsxs("div",{style:{border:`4px dashed ${f.error?"red":"lightgray"}`,padding:"30px 10px",display:"flex",alignItems:"center",flexDirection:"column"},onDrop:C,onDragOver:j=>j.preventDefault(),"data-testid":"dropzone",children:[v.jsx(eT,{color:"primary",sx:{fontSize:"40px"}}),v.jsxs("div",{style:{display:"flex",flexDirection:"row",alignItems:"baseline"},children:[v.jsx(D.Typography,{children:"Drag and drop or"}),v.jsxs(D.Button,{component:"label",role:void 0,variant:"text",tabIndex:-1,sx:{textTransform:"none",fontSize:"16px",textDecoration:"underline"},children:["browse",v.jsx("input",{"data-testid":"file-input",id:e,hidden:!0,type:"file",onChange:S,multiple:!0,accept:b==null?void 0:b.toString()})]})]}),g&&v.jsx(D.Typography,{variant:"caption",children:g}),O]}):v.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[v.jsx("div",{style:{display:"flex",alignItems:"center",marginBottom:"4px"},children:v.jsxs(D.Button,{component:"label",role:void 0,variant:"contained",tabIndex:-1,startIcon:v.jsx(eT,{}),style:{whiteSpace:"nowrap"},children:["Select a file",v.jsx("input",{"data-testid":"file-input",id:e,hidden:!0,type:"file",onChange:S,accept:b==null?void 0:b.toString()})]})}),O]})},gq=Le(v.jsx("path",{d:"M15 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V7zM6 20V4h8v4h4v12zm10-10v5c0 2.21-1.79 4-4 4s-4-1.79-4-4V8.5c0-1.47 1.26-2.64 2.76-2.49 1.3.13 2.24 1.32 2.24 2.63V15h-2V8.5c0-.28-.22-.5-.5-.5s-.5.22-.5.5V15c0 1.1.9 2 2 2s2-.9 2-2v-5z"}),"FilePresent"),Zv=Le(v.jsx("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM19 4h-3.5l-1-1h-5l-1 1H5v2h14z"}),"Delete"),yq=t=>{const{name:e}=t,[n,,r]=qt.useField({name:e}),{setValue:o}=r,i=n.value;return v.jsx("div",{style:{width:"100%"},children:i.map(s=>v.jsx(D.Card,{sx:{margin:"10px 0px"},children:v.jsxs(D.CardContent,{style:{display:"flex",alignItems:"center",padding:"8px 12px"},children:[v.jsx(gq,{sx:{color:"gray",fontSize:"20px"}}),v.jsx(D.Typography,{sx:{padding:"8px",overflowWrap:"anywhere"},children:s.name}),v.jsx(D.IconButton,{"aria-label":"remove file",onClick:()=>o(i.filter(a=>a!==s)),edge:"end",style:{marginLeft:"auto",order:"2"},children:v.jsx(Zv,{})})]})},`${s.name}-${s.type}-${s.size}-${s.lastModified}`))})};var qm,tT;function hi(){if(tT)return qm;tT=1;function t(e){var n=typeof e;return e!=null&&(n=="object"||n=="function")}return qm=t,qm}var Um,nT;function DR(){if(nT)return Um;nT=1;var t=typeof ji=="object"&&ji&&ji.Object===Object&&ji;return Um=t,Um}var Km,rT;function po(){if(rT)return Km;rT=1;var t=DR(),e=typeof self=="object"&&self&&self.Object===Object&&self,n=t||e||Function("return this")();return Km=n,Km}var Ym,oT;function bq(){if(oT)return Ym;oT=1;var t=po(),e=function(){return t.Date.now()};return Ym=e,Ym}var Gm,iT;function vq(){if(iT)return Gm;iT=1;var t=/\s/;function e(n){for(var r=n.length;r--&&t.test(n.charAt(r)););return r}return Gm=e,Gm}var Jm,sT;function xq(){if(sT)return Jm;sT=1;var t=vq(),e=/^\s+/;function n(r){return r&&r.slice(0,t(r)+1).replace(e,"")}return Jm=n,Jm}var Zm,aT;function ou(){if(aT)return Zm;aT=1;var t=po(),e=t.Symbol;return Zm=e,Zm}var Xm,lT;function Sq(){if(lT)return Xm;lT=1;var t=ou(),e=Object.prototype,n=e.hasOwnProperty,r=e.toString,o=t?t.toStringTag:void 0;function i(s){var a=n.call(s,o),l=s[o];try{s[o]=void 0;var u=!0}catch{}var f=r.call(s);return u&&(a?s[o]=l:delete s[o]),f}return Xm=i,Xm}var Qm,cT;function Cq(){if(cT)return Qm;cT=1;var t=Object.prototype,e=t.toString;function n(r){return e.call(r)}return Qm=n,Qm}var eg,uT;function Js(){if(uT)return eg;uT=1;var t=ou(),e=Sq(),n=Cq(),r="[object Null]",o="[object Undefined]",i=t?t.toStringTag:void 0;function s(a){return a==null?a===void 0?o:r:i&&i in Object(a)?e(a):n(a)}return eg=s,eg}var tg,dT;function ts(){if(dT)return tg;dT=1;function t(e){return e!=null&&typeof e=="object"}return tg=t,tg}var ng,fT;function Ip(){if(fT)return ng;fT=1;var t=Js(),e=ts(),n="[object Symbol]";function r(o){return typeof o=="symbol"||e(o)&&t(o)==n}return ng=r,ng}var rg,pT;function PR(){if(pT)return rg;pT=1;var t=xq(),e=hi(),n=Ip(),r=NaN,o=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,s=/^0o[0-7]+$/i,a=parseInt;function l(u){if(typeof u=="number")return u;if(n(u))return r;if(e(u)){var f=typeof u.valueOf=="function"?u.valueOf():u;u=e(f)?f+"":f}if(typeof u!="string")return u===0?u:+u;u=t(u);var p=i.test(u);return p||s.test(u)?a(u.slice(2),p?2:8):o.test(u)?r:+u}return rg=l,rg}var og,hT;function NR(){if(hT)return og;hT=1;var t=hi(),e=bq(),n=PR(),r="Expected a function",o=Math.max,i=Math.min;function s(a,l,u){var f,p,m,y,b,g,S=0,C=!1,_=!1,T=!0;if(typeof a!="function")throw new TypeError(r);l=n(l)||0,t(u)&&(C=!!u.leading,_="maxWait"in u,m=_?o(n(u.maxWait)||0,l):m,T="trailing"in u?!!u.trailing:T);function w(F){var $=f,z=p;return f=p=void 0,S=F,y=a.apply(z,$),y}function E(F){return S=F,b=setTimeout(P,l),C?w(F):y}function O(F){var $=F-g,z=F-S,L=l-$;return _?i(L,m-z):L}function N(F){var $=F-g,z=F-S;return g===void 0||$>=l||$<0||_&&z>=m}function P(){var F=e();if(N(F))return j(F);b=setTimeout(P,O(F))}function j(F){return b=void 0,T&&f?w(F):(f=p=void 0,y)}function M(){b!==void 0&&clearTimeout(b),S=0,f=g=p=b=void 0}function R(){return b===void 0?y:j(e())}function B(){var F=e(),$=N(F);if(f=arguments,p=this,g=F,$){if(b===void 0)return E(g);if(_)return clearTimeout(b),b=setTimeout(P,l),w(g)}return b===void 0&&(b=setTimeout(P,l)),y}return B.cancel=M,B.flush=R,B}return og=s,og}var ig,mT;function wq(){if(mT)return ig;mT=1;var t=NR(),e=hi(),n="Expected a function";function r(o,i,s){var a=!0,l=!0;if(typeof o!="function")throw new TypeError(n);return e(s)&&(a="leading"in s?!!s.leading:a,l="trailing"in s?!!s.trailing:l),t(o,i,{leading:a,maxWait:i,trailing:l})}return ig=r,ig}var Tq=wq();const jR=or(Tq),_q=Le(v.jsx("path",{d:"M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7m0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5"}),"LocationOn");var Ud={exports:{}},kq=Ud.exports,gT;function Eq(){return gT||(gT=1,function(t,e){(function(n,r){t.exports=r()})(kq,()=>{return n={705:o=>{o.exports=function(i,s){const a=[];return s.length===0?a.push({text:i,highlight:!1}):s[0][0]>0&&a.push({text:i.slice(0,s[0][0]),highlight:!1}),s.forEach((l,u)=>{const f=l[0],p=l[1];a.push({text:i.slice(f,p),highlight:!0}),u===s.length-1?p<i.length&&a.push({text:i.slice(p,i.length),highlight:!1}):p<s[u+1][0]&&a.push({text:i.slice(p,s[u+1][0]),highlight:!1})}),a}}},r={},function o(i){var s=r[i];if(s!==void 0)return s.exports;var a=r[i]={exports:{}};return n[i](a,a.exports,o),a.exports}(705);var n,r})}(Ud)),Ud.exports}var Mq=Eq();const Oq=or(Mq),Rq=t=>{const{listItemProps:e,option:n,resultIcon:r,highlightMatches:o}=t,{main_text:i,secondary_text:s,main_text_matched_substrings:a}=n.structured_formatting,l=Oq(i,a.map(u=>[u.offset,u.offset+u.length]));return v.jsx("li",{...er({...e},["key"]),"data-testid":`loc-${n.place_id}`,children:v.jsxs(D.Box,{display:"flex",flexDirection:"row",alignItems:"center",children:[r?A.cloneElement(r):null,v.jsxs(D.Box,{children:[l.map(u=>{const f=o&&u.highlight?700:400;return v.jsx("span",{style:{fontWeight:f},children:u.text},`${n.place_id}_${u.text}`)}),v.jsx(D.Typography,{variant:"body2",color:"textSecondary",children:s})]})]})})};function Aq(t,e,n){if(!e)return;const r=document.createElement("script");r.setAttribute("async",""),r.setAttribute("id",n),r.src=t,r.onerror=()=>console.error(`Failed to load script: ${t}`),e.appendChild(r)}const Ll={current:null},Iq=t=>{const{name:e,label:n=Mn(e),resultIcon:r=v.jsx(_q,{}),apiKey:o,highlightMatches:i=!0,types:s,variant:a="outlined",staticLabel:l=!1,staticLabelProps:u={fontSize:".9em",color:"#808080"},readOnly:f=!1,margin:p="dense",errorMode:m="normal"}=t,[y,b]=A.useState(null),[g,S]=A.useState(""),[C,_]=A.useState([]),T=A.useRef(!1),[,w,E]=qt.useField(e),{setValue:O}=E,{error:N}=w;typeof window<"u"&&!T.current&&(document.querySelector("#google-maps")||Aq(`https://maps.googleapis.com/maps/api/js?key=${o}&libraries=places`,document.querySelector("head"),"google-maps"),T.current=!0);const P=A.useMemo(()=>jR((L,W)=>{Ll.current&&Ll.current.getPlacePredictions(L,W)},200),[]);A.useEffect(()=>{let L=!0;if(!Ll.current&&window.google&&(Ll.current=new window.google.maps.places.AutocompleteService),!Ll.current)return;if(g===""){_(y?[y]:[]);return}return P({input:g,types:s?[s]:[]},G=>{if(L){let U=[];y&&(U=[y]),G&&(U=[...U,...G]);const Z=U.filter((pe,ae,de)=>ae===de.findIndex(ee=>ee.place_id===pe.place_id));_(Z)}}),()=>{L=!1}},[y,g,P,s]);const j=A.useCallback(L=>{const q=(L?[L,...C]:C).filter((G,U,Z)=>U===Z.findIndex(pe=>pe.place_id===G.place_id));_(q),b(L),O(L?L.description:"")},[C,_,b,O]),M=L=>{S(L)},R=["name","apiKey","resultIcon","highlightMatches","variant","staticLabel","staticLabelProps","margin","errorMode"],B=L=>v.jsx(D.TextField,{margin:p,variant:a,...L,...er({...t},R),label:l?void 0:n,hiddenLabel:l,error:!!N}),F=L=>typeof L=="string"?L:L.description,$=(L,W)=>v.jsx(Rq,{listItemProps:L,option:W,resultIcon:r,highlightMatches:i},W.place_id);A.useEffect(()=>{const L=W=>{W.key==="Enter"&&C.length>0&&j(C[0])};return window.addEventListener("keydown",L),()=>{window.removeEventListener("keydown",L)}},[C,j]);const z=v.jsx(D.Autocomplete,{id:`${e}-loc`,"data-testid":"location-autocomplete",getOptionLabel:F,filterOptions:L=>L,options:C,autoComplete:!0,includeInputInList:!0,filterSelectedOptions:!0,value:y,onChange:(L,W)=>j(W),onInputChange:(L,W)=>M(W),disabled:t.disabled,renderOption:$,renderInput:B});return v.jsxs(D.FormControl,{margin:p,fullWidth:!0,children:[(l||f)&&v.jsx(D.Typography,{...u,children:n}),f?v.jsx(D.Typography,{children:y==null?void 0:y.description}):v.jsxs(D.Box,{children:[z,v.jsx(yr,{name:e,id:`${e}-err`,errorMode:m})]})]})},LR=t=>{const{name:e,radios:n=[],label:r=Mn(e),labelPlacement:o="end",labelAlignment:i=o==="end"||o==="start"?"top":"center",required:s=!1,disabled:a=!1,readOnly:l=!1,margin:u="dense",onChange:f,staticLabelProps:p={fontSize:".9em",color:"#808080"},errorMode:m="normal",helperText:y}=t;i==="top"&&(o==="bottom"||o==="top")&&console.error(`RadioGroup: Ignoring labelAlignment='top'. labelAlignment cannot be 'top' when labelPlacement=${o}`);const[b,g,S]=qt.useField({name:e}),{setValue:C}=S,{value:_}=b,{error:T}=g,w=["radioProps","labelPlacement","helperText"],E=["disableRedLabelOnError","disableLabel","sameButtonColor","labelPlacement","focused","margin","fullWidth","labelAlignment","errorMode","helperText"],O=()=>t.labelPlacement=="start"?"right":t.labelPlacement=="top"||t.labelPlacement=="bottom"?"center":"left",N=n.map((R,B)=>{const F=i==="top"&&(o==="start"||o==="end"),$=R.helperText?v.jsxs("div",{children:[v.jsx("p",{style:{margin:0},children:R.label}),v.jsx(D.Typography,{variant:"caption",style:{fontSize:"0.85rem"},children:R.helperText})]}):R.label;return v.jsx(D.FormControlLabel,{sx:{alignItems:F?"flex-start":"center"},value:B.toString(),control:v.jsx(D.Radio,{id:`${R.value}-rb`,color:t.sameButtonColor?t.sameButtonColor:R.color??"default",...er({...R},w)}),label:v.jsx("div",{style:{marginTop:F?"10px":0},children:$}),labelPlacement:o,disabled:R.disabled||a,style:{textAlign:O()}},`rb-${B}-${r}`)}),P=()=>{const R=n.find(B=>B.value===b.value);return v.jsxs(D.Box,{children:[v.jsx(D.Typography,{...p,children:r}),j(R)]})},j=R=>v.jsxs(D.Box,{children:[v.jsx(D.Typography,{children:R==null?void 0:R.label}),(R==null?void 0:R.helperText)&&v.jsx(D.Typography,{variant:"caption",style:{fontSize:"0.85rem"},children:R.helperText})]}),M=R=>{C(R.target.value),f&&f(R.target.value)};return l?P():v.jsxs(D.FormControl,{focused:t.focused,margin:u,fullWidth:t.fullWidth,error:!!T,children:[v.jsx(D.FormLabel,{htmlFor:e,required:s,disabled:t.disableLabel,children:r}),y&&v.jsx(D.FormHelperText,{children:y}),v.jsx(D.RadioGroup,{id:e,value:_??"",...er({...t},E),onChange:M,children:N}),v.jsx(yr,{name:e,id:`${e}-err`,errorMode:m})]})},Dq=t=>{const{name:e,label:n=Mn(e),min:r=0,max:o=100,step:i=1,readOnly:s,staticLabelProps:a={fontSize:".9em",color:"#808080"}}=t,l=qt.useField(e),{value:u}=l[0],{setValue:f}=l[2],p=["label"];return s?(()=>{let y;return Array.isArray(u)?y=s==="percent"?`${100*(u[0]??0)/o}% - ${100*(u[1]??0)/o}%`:`${u[0]??0} - ${u[1]??0}`:y=s==="percent"?`${100*(u??0)/o}%`:`${u??0}`,v.jsxs(D.Box,{children:[v.jsx(D.Typography,{...a,children:n}),v.jsx(D.Typography,{children:y})]})})():v.jsxs(D.FormControl,{fullWidth:!0,children:[v.jsx(D.Typography,{gutterBottom:!0,color:"textSecondary",children:n}),v.jsx(D.Slider,{...er({...t},p),id:t.name,value:u??0,onChange:(y,b)=>{f(b)},min:r,max:o,step:i})]})},Pq=t=>{const{name:e,options:n=[],label:r=Mn(e),selectedOptionIcon:o=void 0,staticLabel:i=!1,staticLabelProps:s={fontSize:".9em",color:"#808080"},variant:a="outlined",readOnly:l=!1,margin:u="dense",required:f,errorMode:p="normal"}=t,[m,y,b]=qt.useField({name:e}),{setValue:g}=b,{value:S}=m,{error:C}=y,_=A.useCallback(()=>{let B="";for(let F=0;F<n.length;F++)JSON.stringify(n[F].value)===JSON.stringify(S)&&(B=F.toString());return B},[n,S]),T=A.useCallback(()=>{const B=[],F=S.toString().split(",");for(const $ of F)for(let z=0;z<n.length;z++)n[z].value===$&&B.push(z);return B},[n,S]);A.useEffect(()=>{O(t.multiple?T():_())},[n,t.multiple,S,T,_]);const w=(B,F)=>t.multiple?!!S.toString().split(",").find($=>$===JSON.stringify(B.value)):F===n.findIndex($=>S===$.value),[E,O]=A.useState(t.multiple?T:_),N=n.map((B,F)=>{const $=o&&w(B,F)?o:void 0;return v.jsxs(D.MenuItem,{id:`select-${e}-option-${B.value}`,value:F,disabled:B.disabled,children:[o&&v.jsx(D.ListItemIcon,{children:$}),B.label]},F.toString())}),P=B=>{if(t.multiple){const F=[];B.target.value.forEach($=>{n[$].value&&F.push(n[$].value)}),g(F.join(","))}else g(n[B.target.value].value);O(B.target.value)},j=["name","options",i?"label":"","required","selectedOptionIcon","variant","staticLabel","staticLabelProps","errorMode"],M=()=>g6(n,S,t.multiple),R=t.renderValue??M;return v.jsxs(D.FormControl,{fullWidth:!0,variant:a,error:!!C,margin:u,required:f,children:[i||l?v.jsx(D.Typography,{...s,children:r}):v.jsx(D.InputLabel,{id:`${e}-select-label`,children:r}),l?v.jsx(D.Typography,{children:M()}):v.jsxs(D.Box,{children:[v.jsx(D.Select,{id:`${e}-sel`,labelId:`${e}-select-label`,label:i?void 0:r,...er({...t},j),name:e,value:E,fullWidth:!0,onChange:B=>P(B),displayEmpty:i,renderValue:R,children:N}),v.jsx(yr,{name:e,id:`${e}-err`,errorMode:p})]})]})},Nq=t=>{const{name:e,label:n=Mn(e),labelPlacement:r="end",readOnly:o,staticLabelProps:i={fontSize:".9em",color:"#808080"},onChange:s,color:a="primary",chipColor:l,activeValue:u=!0,inactiveValue:f=!1,errorMode:p="normal"}=t,[m,,y]=qt.useField({name:e}),{setValue:b}=y,{value:g}=m;g===void 0&&console.error(`Please set an initial value for ${e}`);const S=["labelPlacement","chipColor","activeValue","inactiveValue","errorMode"],C=_=>{if(typeof _!="boolean")return String(_);switch(o){case"YES_NO":return _===u?"Yes":"No";case"ON_OFF":return _===u?"On":"Off";default:return _===u?"True":"False"}};return o?v.jsxs(D.Box,{children:[v.jsx(D.Typography,{...i,children:n}),v.jsx(D.Typography,{children:C(g)})]}):v.jsxs(D.Box,{bgcolor:l??"inherit",sx:l?{display:"inline-flex",justifyContent:"center",alignItems:"center",borderRadius:"32px",padding:"2px 0px 2px 12px"}:{},children:[v.jsx(D.FormControlLabel,{label:n,sx:{"& .MuiFormControlLabel-label":{color:a}},labelPlacement:r,control:v.jsx(D.Switch,{...er({...t},S),id:e,...m,onChange:_=>{if(typeof u=="string"&&typeof f=="string"){const T=_.target.checked?u:f;b(T),s&&s(T)}else b(_.target.checked),s&&s(_.target.checked)},checked:g===u})}),v.jsx(yr,{name:e,id:`${e}-err`,errorMode:p})]})},jq=Le([v.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"},"0"),v.jsx("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"},"1")],"AccessTime"),Lq=Le(v.jsx("path",{d:"M13 7h-2v4H7v2h4v4h2v-4h4v-2h-4zm-1-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"}),"AddCircleOutline"),Fq=Le(v.jsx("path",{d:"M19 7v2.99s-1.99.01-2 0V7h-3s.01-1.99 0-2h3V2h2v3h3v2zm-3 4V8h-3V5H5c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-8zM5 19l3-4 2 3 3-4 4 5z"}),"AddPhotoAlternate"),$q=Le(v.jsx("path",{d:"m19 18 2 1V3c0-1.1-.9-2-2-2H8.99C7.89 1 7 1.9 7 3h10c1.1 0 2 .9 2 2zM15 5H5c-1.1 0-2 .9-2 2v16l7-3 7 3V7c0-1.1-.9-2-2-2"}),"Bookmarks"),Bq=Le(v.jsx("path",{d:"M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"}),"Check"),zq=Le(v.jsx("path",{d:"M22 7h-9v2h9zm0 8h-9v2h9zM5.54 11 2 7.46l1.41-1.41 2.12 2.12 4.24-4.24 1.41 1.41zm0 8L2 15.46l1.41-1.41 2.12 2.12 4.24-4.24 1.41 1.41z"}),"Checklist"),Dp=Le(v.jsx("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close"),Vq=Le(v.jsx("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"CloseOutlined"),Hq=Le(v.jsx("path",{d:"M9.4 16.6 4.8 12l4.6-4.6L8 6l-6 6 6 6zm5.2 0 4.6-4.6-4.6-4.6L16 6l6 6-6 6z"}),"Code"),FR=Le(v.jsx("path",{d:"M12 3c-4.97 0-9 4.03-9 9s4.03 9 9 9 9-4.03 9-9c0-.46-.04-.92-.1-1.36-.98 1.37-2.58 2.26-4.4 2.26-2.98 0-5.4-2.42-5.4-5.4 0-1.81.89-3.42 2.26-4.4-.44-.06-.9-.1-1.36-.1"}),"DarkMode"),yT=Le(v.jsx("path",{d:"M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8zm2 16H8v-2h8zm0-4H8v-2h8zm-3-5V3.5L18.5 9z"}),"Description"),Wq=Le(v.jsx("path",{d:"M5 20h14v-2H5zM19 9h-4V3H9v6H5l7 7z"}),"Download"),qq=Le(v.jsx("path",{d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.996.996 0 0 0-1.41 0l-1.83 1.83 3.75 3.75z"}),"Edit"),Uq=Le(v.jsx("path",{d:"M7 15v2h10v-2zm-4 6h18v-2H3zm0-8h18v-2H3zm4-6v2h10V7zM3 3v2h18V3z"}),"FormatAlignCenter"),Kq=Le(v.jsx("path",{d:"M3 21h18v-2H3zm0-4h18v-2H3zm0-4h18v-2H3zm0-4h18V7H3zm0-6v2h18V3z"}),"FormatAlignJustify"),Yq=Le(v.jsx("path",{d:"M15 15H3v2h12zm0-8H3v2h12zM3 13h18v-2H3zm0 8h18v-2H3zM3 3v2h18V3z"}),"FormatAlignLeft"),Gq=Le(v.jsx("path",{d:"M3 21h18v-2H3zm6-4h12v-2H9zm-6-4h18v-2H3zm6-4h12V7H9zM3 3v2h18V3z"}),"FormatAlignRight"),Jq=Le(v.jsx("path",{d:"M15.6 10.79c.97-.67 1.65-1.77 1.65-2.79 0-2.26-1.75-4-4-4H7v14h7.04c2.09 0 3.71-1.7 3.71-3.79 0-1.52-.86-2.82-2.15-3.42M10 6.5h3c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5h-3zm3.5 9H10v-3h3.5c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5"}),"FormatBold"),Zq=Le(v.jsx("path",{d:"M3.27 5 2 6.27l6.97 6.97L6.5 19h3l1.57-3.66L16.73 21 18 19.73 3.55 5.27zM6 5v.18L8.82 8h2.4l-.72 1.68 2.1 2.1L14.21 8H20V5z"}),"FormatClear"),Xq=Le(v.jsx("path",{d:"M16.56 8.94 7.62 0 6.21 1.41l2.38 2.38-5.15 5.15c-.59.59-.59 1.54 0 2.12l5.5 5.5c.29.29.68.44 1.06.44s.77-.15 1.06-.44l5.5-5.5c.59-.58.59-1.53 0-2.12M5.21 10 10 5.21 14.79 10zM19 11.5s-2 2.17-2 3.5c0 1.1.9 2 2 2s2-.9 2-2c0-1.33-2-3.5-2-3.5M2 20h20v4H2z"}),"FormatColorFill"),Qq=Le(v.jsx("path",{d:"M11 17h10v-2H11zm-8-5 4 4V8zm0 9h18v-2H3zM3 3v2h18V3zm8 6h10V7H11zm0 4h10v-2H11z"}),"FormatIndentDecrease"),e8=Le(v.jsx("path",{d:"M3 21h18v-2H3zM3 8v8l4-4zm8 9h10v-2H11zM3 3v2h18V3zm8 6h10V7H11zm0 4h10v-2H11z"}),"FormatIndentIncrease"),t8=Le(v.jsx("path",{d:"M10 4v3h2.21l-3.42 8H6v3h8v-3h-2.21l3.42-8H18V4z"}),"FormatItalic"),n8=Le(v.jsx("path",{d:"M4 10.5c-.83 0-1.5.67-1.5 1.5s.67 1.5 1.5 1.5 1.5-.67 1.5-1.5-.67-1.5-1.5-1.5m0-6c-.83 0-1.5.67-1.5 1.5S3.17 7.5 4 7.5 5.5 6.83 5.5 6 4.83 4.5 4 4.5m0 12c-.83 0-1.5.68-1.5 1.5s.68 1.5 1.5 1.5 1.5-.68 1.5-1.5-.67-1.5-1.5-1.5M7 19h14v-2H7zm0-6h14v-2H7zm0-8v2h14V5z"}),"FormatListBulleted"),r8=Le(v.jsx("path",{d:"M2 17h2v.5H3v1h1v.5H2v1h3v-4H2zm1-9h1V4H2v1h1zm-1 3h1.8L2 13.1v.9h3v-1H3.2L5 10.9V10H2zm5-6v2h14V5zm0 14h14v-2H7zm0-6h14v-2H7z"}),"FormatListNumbered"),o8=Le(v.jsx("path",{d:"M6 17h3l2-4V7H5v6h3zm8 0h3l2-4V7h-6v6h3z"}),"FormatQuote"),i8=Le(v.jsx("path",{d:"M9 4v3h5v12h3V7h5V4zm-6 8h3v7h3v-7h3V9H3z"}),"FormatSize"),s8=Le(v.jsx("path",{d:"M12 17c3.31 0 6-2.69 6-6V3h-2.5v8c0 1.93-1.57 3.5-3.5 3.5S8.5 12.93 8.5 11V3H6v8c0 3.31 2.69 6 6 6m-7 2v2h14v-2z"}),"FormatUnderlined"),a8=Le(v.jsx("path",{d:"M8 4v1.45l2 2V4h4v4h-3.45l2 2H14v1.45l2 2V10h4v4h-3.45l2 2H20v1.45l2 2V4c0-1.1-.9-2-2-2H4.55l2 2zm8 0h4v4h-4zM1.27 1.27 0 2.55l2 2V20c0 1.1.9 2 2 2h15.46l2 2 1.27-1.27zM10 12.55 11.45 14H10zm-6-6L5.45 8H4zM8 20H4v-4h4zm0-6H4v-4h3.45l.55.55zm6 6h-4v-4h3.45l.55.54zm2 0v-1.46L17.46 20z"}),"GridOff"),l8=Le(v.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 17h-2v-2h2zm2.07-7.75-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25"}),"Help"),c8=Le(v.jsx("path",{fillRule:"evenodd",d:"M4 11h16v2H4z"}),"HorizontalRule"),u8=Le(v.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-6h2zm0-8h-2V7h2z"}),"Info"),sg=Le(v.jsx("path",{d:"M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6z"}),"KeyboardArrowDown"),Kd=Le(v.jsx("path",{d:"M7.41 15.41 12 10.83l4.59 4.58L18 14l-6-6-6 6z"}),"KeyboardArrowUp"),$R=Le(v.jsx("path",{d:"M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3z"}),"Launch"),BR=Le(v.jsx("path",{d:"M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5M2 13h2c.55 0 1-.45 1-1s-.45-1-1-1H2c-.55 0-1 .45-1 1s.45 1 1 1m18 0h2c.55 0 1-.45 1-1s-.45-1-1-1h-2c-.55 0-1 .45-1 1s.45 1 1 1M11 2v2c0 .55.45 1 1 1s1-.45 1-1V2c0-.55-.45-1-1-1s-1 .45-1 1m0 18v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1M5.99 4.58c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0s.39-1.03 0-1.41zm12.37 12.37c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0 .39-.39.39-1.03 0-1.41zm1.06-10.96c.39-.39.39-1.03 0-1.41-.39-.39-1.03-.39-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0zM7.05 18.36c.39-.39.39-1.03 0-1.41-.39-.39-1.03-.39-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0z"}),"LightMode"),bf=Le(v.jsx("path",{d:"M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1M8 13h8v-2H8zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5"}),"Link"),d8=Le(v.jsx("path",{d:"m17 7-1.41 1.41L18.17 11H8v2h10.17l-2.58 2.58L17 17l5-5zM4 5h8V3H4c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h8v-2H4z"}),"Logout"),f8=Le(v.jsx("path",{d:"M3 18h18v-2H3zm0-5h18v-2H3zm0-7v2h18V6z"}),"Menu"),p8=Le(v.jsx("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}),"NavigateNext"),h8=Le(v.jsx("path",{d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4m0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4"}),"Person"),m8=Le(v.jsx("path",{d:"M18.4 10.6C16.55 8.99 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16c1.05-3.19 4.05-5.5 7.6-5.5 1.95 0 3.73.72 5.12 1.88L13 16h9V7z"}),"Redo"),g8=Le(v.jsx("path",{d:"M19 13H5v-2h14z"}),"Remove"),y8=Le(v.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m5 11H7v-2h10z"}),"RemoveCircle"),b8=Le(v.jsx("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14"}),"SearchOutlined"),v8=Le(v.jsx("path",{d:"M3 18h6v-2H3zM3 6v2h18V6zm0 7h12v-2H3z"}),"Sort"),x8=Le(v.jsx("path",{d:"M6.85 7.08C6.85 4.37 9.45 3 12.24 3c1.64 0 3 .49 3.9 1.28.77.65 1.46 1.73 1.46 3.24h-3.01c0-.31-.05-.59-.15-.85-.29-.86-1.2-1.28-2.25-1.28-1.86 0-2.34 1.02-2.34 1.7 0 .48.25.88.74 1.21.38.25.77.48 1.41.7H7.39c-.21-.34-.54-.89-.54-1.92M21 12v-2H3v2h9.62c1.15.45 1.96.75 1.96 1.97 0 1-.81 1.67-2.28 1.67-1.54 0-2.93-.54-2.93-2.51H6.4c0 .55.08 1.13.24 1.58.81 2.29 3.29 3.3 5.67 3.3 2.27 0 5.3-.89 5.3-4.05 0-.3-.01-1.16-.48-1.94H21z"}),"StrikethroughS"),S8=Le(v.jsx("path",{d:"M22 18h-2v1h3v1h-4v-2c0-.55.45-1 1-1h2v-1h-3v-1h3c.55 0 1 .45 1 1v1c0 .55-.45 1-1 1M5.88 18h2.66l3.4-5.42h.12l3.4 5.42h2.66l-4.65-7.27L17.81 4h-2.68l-3.07 4.99h-.12L8.85 4H6.19l4.32 6.73z"}),"Subscript"),C8=Le(v.jsx("path",{d:"M22 7h-2v1h3v1h-4V7c0-.55.45-1 1-1h2V5h-3V4h3c.55 0 1 .45 1 1v1c0 .55-.45 1-1 1M5.88 20h2.66l3.4-5.42h.12l3.4 5.42h2.66l-4.65-7.27L17.81 6h-2.68l-3.07 4.99h-.12L8.85 6H6.19l4.32 6.73z"}),"Superscript"),w8=Le(v.jsx("path",{d:"M12.5 8c-2.65 0-5.05.99-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8"}),"Undo"),T8=Le(v.jsx("path",{d:"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5M12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5m0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3"}),"Visibility"),_8=t=>{const{onSearch:e,initialValue:n="",lazySearch:r=!1}=t,[o,i]=X.useState(n),s=f=>{i(f.target.value),r||e(f.target.value)},a=f=>{f.key==="Enter"&&l()},l=()=>{e(o)},u=()=>{i(""),e("")};return v.jsx(D.TextField,{type:"text",placeholder:"Search...",value:o,onChange:s,onKeyDown:a,className:"search-bar",size:"small",fullWidth:!0,slotProps:{input:{startAdornment:v.jsx(D.InputAdornment,{position:"start",children:v.jsx(D.IconButton,{"data-testid":"search-button",style:{marginLeft:-10},onClick:l,children:v.jsx(b8,{})})}),endAdornment:o&&v.jsx(D.IconButton,{style:{marginRight:-10},"aria-label":"clear search","data-testid":"clear-search",onClick:u,children:v.jsx(Vq,{})})}}})};function ne(){return ne=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},ne.apply(null,arguments)}function rt(t,e){if(t==null)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.includes(r))continue;n[r]=t[r]}return n}function Ut({props:t,name:e}){return c9({props:t,name:e,defaultTheme:Ap,themeId:ru})}const k8=["localeText"],vf=A.createContext(null);process.env.NODE_ENV!=="production"&&(vf.displayName="MuiPickersAdapterContext");const Xv=function(e){const{localeText:n}=e,r=rt(e,k8),{utils:o,localeText:i}=A.useContext(vf)??{utils:void 0,localeText:void 0},s=Ut({props:r,name:"MuiLocalizationProvider"}),{children:a,dateAdapter:l,dateFormats:u,dateLibInstance:f,adapterLocale:p,localeText:m}=s,y=A.useMemo(()=>ne({},m,i,n),[m,i,n]),b=A.useMemo(()=>{if(!l)return o||null;const C=new l({locale:p,formats:u,instance:f});if(!C.isMUIAdapter)throw new Error(["MUI X: The date adapter should be imported from `@mui/x-date-pickers` or `@mui/x-date-pickers-pro`, not from `@date-io`","For example, `import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs'` instead of `import AdapterDayjs from '@date-io/dayjs'`","More information on the installation documentation: https://mui.com/x/react-date-pickers/getting-started/#installation"].join(`
104
+ }`;var at=dw(function(){return Ct(H,He+"return "+Ee).apply(n,K)});if(at.source=Ee,_m(at))throw at;return at}function d4(d){return Tt(d).toLowerCase()}function f4(d){return Tt(d).toUpperCase()}function p4(d,h,x){if(d=Tt(d),d&&(x||h===n))return xS(d);if(!d||!(h=xr(h)))return d;var k=eo(d),I=eo(h),H=SS(k,I),K=CS(k,I)+1;return Ti(k,H,K).join("")}function h4(d,h,x){if(d=Tt(d),d&&(x||h===n))return d.slice(0,TS(d)+1);if(!d||!(h=xr(h)))return d;var k=eo(d),I=CS(k,eo(h))+1;return Ti(k,0,I).join("")}function m4(d,h,x){if(d=Tt(d),d&&(x||h===n))return d.replace(_h,"");if(!d||!(h=xr(h)))return d;var k=eo(d),I=SS(k,eo(h));return Ti(k,I).join("")}function g4(d,h){var x=M,k=R;if(Qt(h)){var I="separator"in h?h.separator:I;x="length"in h?it(h.length):x,k="omission"in h?xr(h.omission):k}d=Tt(d);var H=d.length;if(aa(d)){var K=eo(d);H=K.length}if(x>=H)return d;var Q=x-la(k);if(Q<1)return k;var ie=K?Ti(K,0,Q).join(""):d.slice(0,Q);if(I===n)return ie+k;if(K&&(Q+=ie.length-Q),km(I)){if(d.slice(Q).search(I)){var we,Te=ie;for(I.global||(I=Vh(I.source,Tt(V1.exec(I))+"g")),I.lastIndex=0;we=I.exec(Te);)var Ee=we.index;ie=ie.slice(0,Ee===n?Q:Ee)}}else if(d.indexOf(xr(I),Q)!=Q){var De=ie.lastIndexOf(I);De>-1&&(ie=ie.slice(0,De))}return ie+k}function y4(d){return d=Tt(d),d&&$o.test(d)?d.replace(Gn,UL):d}var b4=ma(function(d,h,x){return d+(x?" ":"")+h.toUpperCase()}),Om=fC("toUpperCase");function uw(d,h,x){return d=Tt(d),h=x?n:h,h===n?zL(d)?GL(d):IL(d):d.match(h)||[]}var dw=ut(function(d,h){try{return br(d,n,h)}catch(x){return _m(x)?x:new nt(x)}}),v4=Wo(function(d,h){return Ar(h,function(x){x=vo(x),Vo(d,x,wm(d[x],d))}),d});function x4(d){var h=d==null?0:d.length,x=Ze();return d=h?Jt(d,function(k){if(typeof k[1]!="function")throw new Ir(s);return[x(k[0]),k[1]]}):[],ut(function(k){for(var I=-1;++I<h;){var H=d[I];if(br(H[0],this,k))return br(H[1],this,k)}})}function S4(d){return UF(Pr(d,p))}function Rm(d){return function(){return d}}function C4(d,h){return d==null||d!==d?h:d}var w4=hC(),T4=hC(!0);function cr(d){return d}function Am(d){return WS(typeof d=="function"?d:Pr(d,p))}function _4(d){return US(Pr(d,p))}function k4(d,h){return KS(d,Pr(h,p))}var E4=ut(function(d,h){return function(x){return Ml(x,d,h)}}),M4=ut(function(d,h){return function(x){return Ml(d,x,h)}});function Im(d,h,x){var k=Tn(h),I=Uu(h,k);x==null&&!(Qt(h)&&(I.length||!k.length))&&(x=h,h=d,d=this,I=Uu(h,Tn(h)));var H=!(Qt(x)&&"chain"in x)||!!x.chain,K=Uo(d);return Ar(I,function(Q){var ie=h[Q];d[Q]=ie,K&&(d.prototype[Q]=function(){var we=this.__chain__;if(H||we){var Te=d(this.__wrapped__),Ee=Te.__actions__=sr(this.__actions__);return Ee.push({func:ie,args:arguments,thisArg:d}),Te.__chain__=we,Te}return ie.apply(d,bi([this.value()],arguments))})}),d}function O4(){return Dn._===this&&(Dn._=tF),this}function Dm(){}function R4(d){return d=it(d),ut(function(h){return YS(h,d)})}var A4=um(Jt),I4=um(mS),D4=um(Nh);function fw(d){return ym(d)?jh(vo(d)):c$(d)}function P4(d){return function(h){return d==null?n:fs(d,h)}}var N4=gC(),j4=gC(!0);function Pm(){return[]}function Nm(){return!1}function L4(){return{}}function F4(){return""}function $4(){return!0}function B4(d,h){if(d=it(d),d<1||d>q)return[];var x=Z,k=Bn(d,Z);h=Ze(h),d-=Z;for(var I=$h(k,h);++x<d;)h(x);return I}function z4(d){return ot(d)?Jt(d,vo):Sr(d)?[d]:sr(IC(Tt(d)))}function V4(d){var h=++QL;return Tt(d)+h}var H4=Xu(function(d,h){return d+h},0),W4=dm("ceil"),q4=Xu(function(d,h){return d/h},1),U4=dm("floor");function K4(d){return d&&d.length?qu(d,cr,Jh):n}function Y4(d,h){return d&&d.length?qu(d,Ze(h,2),Jh):n}function G4(d){return bS(d,cr)}function J4(d,h){return bS(d,Ze(h,2))}function Z4(d){return d&&d.length?qu(d,cr,em):n}function X4(d,h){return d&&d.length?qu(d,Ze(h,2),em):n}var Q4=Xu(function(d,h){return d*h},1),ez=dm("round"),tz=Xu(function(d,h){return d-h},0);function nz(d){return d&&d.length?Fh(d,cr):0}function rz(d,h){return d&&d.length?Fh(d,Ze(h,2)):0}return V.after=_B,V.ary=HC,V.assign=f3,V.assignIn=rw,V.assignInWith=dd,V.assignWith=p3,V.at=h3,V.before=WC,V.bind=wm,V.bindAll=v4,V.bindKey=qC,V.castArray=LB,V.chain=BC,V.chunk=U$,V.compact=K$,V.concat=Y$,V.cond=x4,V.conforms=S4,V.constant=Rm,V.countBy=nB,V.create=m3,V.curry=UC,V.curryRight=KC,V.debounce=YC,V.defaults=g3,V.defaultsDeep=y3,V.defer=kB,V.delay=EB,V.difference=G$,V.differenceBy=J$,V.differenceWith=Z$,V.drop=X$,V.dropRight=Q$,V.dropRightWhile=e5,V.dropWhile=t5,V.fill=n5,V.filter=oB,V.flatMap=aB,V.flatMapDeep=lB,V.flatMapDepth=cB,V.flatten=jC,V.flattenDeep=r5,V.flattenDepth=o5,V.flip=MB,V.flow=w4,V.flowRight=T4,V.fromPairs=i5,V.functions=T3,V.functionsIn=_3,V.groupBy=uB,V.initial=a5,V.intersection=l5,V.intersectionBy=c5,V.intersectionWith=u5,V.invert=E3,V.invertBy=M3,V.invokeMap=fB,V.iteratee=Am,V.keyBy=pB,V.keys=Tn,V.keysIn=lr,V.map=id,V.mapKeys=R3,V.mapValues=A3,V.matches=_4,V.matchesProperty=k4,V.memoize=ad,V.merge=I3,V.mergeWith=ow,V.method=E4,V.methodOf=M4,V.mixin=Im,V.negate=ld,V.nthArg=R4,V.omit=D3,V.omitBy=P3,V.once=OB,V.orderBy=hB,V.over=A4,V.overArgs=RB,V.overEvery=I4,V.overSome=D4,V.partial=Tm,V.partialRight=GC,V.partition=mB,V.pick=N3,V.pickBy=iw,V.property=fw,V.propertyOf=P4,V.pull=h5,V.pullAll=FC,V.pullAllBy=m5,V.pullAllWith=g5,V.pullAt=y5,V.range=N4,V.rangeRight=j4,V.rearg=AB,V.reject=bB,V.remove=b5,V.rest=IB,V.reverse=Sm,V.sampleSize=xB,V.set=L3,V.setWith=F3,V.shuffle=SB,V.slice=v5,V.sortBy=TB,V.sortedUniq=k5,V.sortedUniqBy=E5,V.split=a4,V.spread=DB,V.tail=M5,V.take=O5,V.takeRight=R5,V.takeRightWhile=A5,V.takeWhile=I5,V.tap=K5,V.throttle=PB,V.thru=od,V.toArray=ew,V.toPairs=sw,V.toPairsIn=aw,V.toPath=z4,V.toPlainObject=nw,V.transform=$3,V.unary=NB,V.union=D5,V.unionBy=P5,V.unionWith=N5,V.uniq=j5,V.uniqBy=L5,V.uniqWith=F5,V.unset=B3,V.unzip=Cm,V.unzipWith=$C,V.update=z3,V.updateWith=V3,V.values=ba,V.valuesIn=H3,V.without=$5,V.words=uw,V.wrap=jB,V.xor=B5,V.xorBy=z5,V.xorWith=V5,V.zip=H5,V.zipObject=W5,V.zipObjectDeep=q5,V.zipWith=U5,V.entries=sw,V.entriesIn=aw,V.extend=rw,V.extendWith=dd,Im(V,V),V.add=H4,V.attempt=dw,V.camelCase=K3,V.capitalize=lw,V.ceil=W4,V.clamp=W3,V.clone=FB,V.cloneDeep=BB,V.cloneDeepWith=zB,V.cloneWith=$B,V.conformsTo=VB,V.deburr=cw,V.defaultTo=C4,V.divide=q4,V.endsWith=Y3,V.eq=no,V.escape=G3,V.escapeRegExp=J3,V.every=rB,V.find=iB,V.findIndex=PC,V.findKey=b3,V.findLast=sB,V.findLastIndex=NC,V.findLastKey=v3,V.floor=U4,V.forEach=zC,V.forEachRight=VC,V.forIn=x3,V.forInRight=S3,V.forOwn=C3,V.forOwnRight=w3,V.get=Em,V.gt=HB,V.gte=WB,V.has=k3,V.hasIn=Mm,V.head=LC,V.identity=cr,V.includes=dB,V.indexOf=s5,V.inRange=q3,V.invoke=O3,V.isArguments=ms,V.isArray=ot,V.isArrayBuffer=qB,V.isArrayLike=ar,V.isArrayLikeObject=dn,V.isBoolean=UB,V.isBuffer=_i,V.isDate=KB,V.isElement=YB,V.isEmpty=GB,V.isEqual=JB,V.isEqualWith=ZB,V.isError=_m,V.isFinite=XB,V.isFunction=Uo,V.isInteger=JC,V.isLength=cd,V.isMap=ZC,V.isMatch=QB,V.isMatchWith=e3,V.isNaN=t3,V.isNative=n3,V.isNil=o3,V.isNull=r3,V.isNumber=XC,V.isObject=Qt,V.isObjectLike=rn,V.isPlainObject=Pl,V.isRegExp=km,V.isSafeInteger=i3,V.isSet=QC,V.isString=ud,V.isSymbol=Sr,V.isTypedArray=ya,V.isUndefined=s3,V.isWeakMap=a3,V.isWeakSet=l3,V.join=d5,V.kebabCase=Z3,V.last=jr,V.lastIndexOf=f5,V.lowerCase=X3,V.lowerFirst=Q3,V.lt=c3,V.lte=u3,V.max=K4,V.maxBy=Y4,V.mean=G4,V.meanBy=J4,V.min=Z4,V.minBy=X4,V.stubArray=Pm,V.stubFalse=Nm,V.stubObject=L4,V.stubString=F4,V.stubTrue=$4,V.multiply=Q4,V.nth=p5,V.noConflict=O4,V.noop=Dm,V.now=sd,V.pad=e4,V.padEnd=t4,V.padStart=n4,V.parseInt=r4,V.random=U3,V.reduce=gB,V.reduceRight=yB,V.repeat=o4,V.replace=i4,V.result=j3,V.round=ez,V.runInContext=re,V.sample=vB,V.size=CB,V.snakeCase=s4,V.some=wB,V.sortedIndex=x5,V.sortedIndexBy=S5,V.sortedIndexOf=C5,V.sortedLastIndex=w5,V.sortedLastIndexBy=T5,V.sortedLastIndexOf=_5,V.startCase=l4,V.startsWith=c4,V.subtract=tz,V.sum=nz,V.sumBy=rz,V.template=u4,V.times=B4,V.toFinite=Ko,V.toInteger=it,V.toLength=tw,V.toLower=d4,V.toNumber=Lr,V.toSafeInteger=d3,V.toString=Tt,V.toUpper=f4,V.trim=p4,V.trimEnd=h4,V.trimStart=m4,V.truncate=g4,V.unescape=y4,V.uniqueId=V4,V.upperCase=b4,V.upperFirst=Om,V.each=zC,V.eachRight=VC,V.first=LC,Im(V,function(){var d={};return yo(V,function(h,x){Mt.call(V.prototype,x)||(d[x]=h)}),d}(),{chain:!1}),V.VERSION=r,Ar(["bind","bindKey","curry","curryRight","partial","partialRight"],function(d){V[d].placeholder=V}),Ar(["drop","take"],function(d,h){ht.prototype[d]=function(x){x=x===n?1:xn(it(x),0);var k=this.__filtered__&&!h?new ht(this):this.clone();return k.__filtered__?k.__takeCount__=Bn(x,k.__takeCount__):k.__views__.push({size:Bn(x,Z),type:d+(k.__dir__<0?"Right":"")}),k},ht.prototype[d+"Right"]=function(x){return this.reverse()[d](x).reverse()}}),Ar(["filter","map","takeWhile"],function(d,h){var x=h+1,k=x==$||x==L;ht.prototype[d]=function(I){var H=this.clone();return H.__iteratees__.push({iteratee:Ze(I,3),type:x}),H.__filtered__=H.__filtered__||k,H}}),Ar(["head","last"],function(d,h){var x="take"+(h?"Right":"");ht.prototype[d]=function(){return this[x](1).value()[0]}}),Ar(["initial","tail"],function(d,h){var x="drop"+(h?"":"Right");ht.prototype[d]=function(){return this.__filtered__?new ht(this):this[x](1)}}),ht.prototype.compact=function(){return this.filter(cr)},ht.prototype.find=function(d){return this.filter(d).head()},ht.prototype.findLast=function(d){return this.reverse().find(d)},ht.prototype.invokeMap=ut(function(d,h){return typeof d=="function"?new ht(this):this.map(function(x){return Ml(x,d,h)})}),ht.prototype.reject=function(d){return this.filter(ld(Ze(d)))},ht.prototype.slice=function(d,h){d=it(d);var x=this;return x.__filtered__&&(d>0||h<0)?new ht(x):(d<0?x=x.takeRight(-d):d&&(x=x.drop(d)),h!==n&&(h=it(h),x=h<0?x.dropRight(-h):x.take(h-d)),x)},ht.prototype.takeRightWhile=function(d){return this.reverse().takeWhile(d).reverse()},ht.prototype.toArray=function(){return this.take(Z)},yo(ht.prototype,function(d,h){var x=/^(?:filter|find|map|reject)|While$/.test(h),k=/^(?:head|last)$/.test(h),I=V[k?"take"+(h=="last"?"Right":""):h],H=k||/^find/.test(h);I&&(V.prototype[h]=function(){var K=this.__wrapped__,Q=k?[1]:arguments,ie=K instanceof ht,we=Q[0],Te=ie||ot(K),Ee=function(ft){var gt=I.apply(V,bi([ft],Q));return k&&De?gt[0]:gt};Te&&x&&typeof we=="function"&&we.length!=1&&(ie=Te=!1);var De=this.__chain__,He=!!this.__actions__.length,Xe=H&&!De,at=ie&&!He;if(!H&&Te){K=at?K:new ht(this);var Qe=d.apply(K,Q);return Qe.__actions__.push({func:od,args:[Ee],thisArg:n}),new Dr(Qe,De)}return Xe&&at?d.apply(this,Q):(Qe=this.thru(Ee),Xe?k?Qe.value()[0]:Qe.value():Qe)})}),Ar(["pop","push","shift","sort","splice","unshift"],function(d){var h=Ru[d],x=/^(?:push|sort|unshift)$/.test(d)?"tap":"thru",k=/^(?:pop|shift)$/.test(d);V.prototype[d]=function(){var I=arguments;if(k&&!this.__chain__){var H=this.value();return h.apply(ot(H)?H:[],I)}return this[x](function(K){return h.apply(ot(K)?K:[],I)})}}),yo(ht.prototype,function(d,h){var x=V[h];if(x){var k=x.name+"";Mt.call(fa,k)||(fa[k]=[]),fa[k].push({name:h,func:x})}}),fa[Zu(n,C).name]=[{name:"wrapper",func:n}],ht.prototype.clone=yF,ht.prototype.reverse=bF,ht.prototype.value=vF,V.prototype.at=Y5,V.prototype.chain=G5,V.prototype.commit=J5,V.prototype.next=Z5,V.prototype.plant=Q5,V.prototype.reverse=eB,V.prototype.toJSON=V.prototype.valueOf=V.prototype.value=tB,V.prototype.first=V.prototype.head,Sl&&(V.prototype[Sl]=X5),V},ca=JL();as?((as.exports=ca)._=ca,Ah._=ca):Dn._=ca}).call(dq)}(Zl,Zl.exports)),Zl.exports}var yf=fq();const pq=t=>{const{name:e,onInputChange:n,onChange:r,onFilter:o,onFilterError:i,fetchOnCount:s=1,preFilterMessage:a=s?"Start typing to see options...":t.noOptionsText,noOptionsText:l,filterOptions:u=P=>P,includeInputInList:f=!0,autoComplete:p=!0,...m}=t,[y,b,g]=qt.useField(e),{setValue:S}=g,[C,_]=X.useState(""),[T,w]=X.useState([]),[E,O]=X.useState(!1),N=yf.debounce(async(P,j)=>{try{O(!0);const M=await o(P.input);j(M)}catch(M){throw M}finally{O(!1)}},400);return X.useEffect(()=>{if(C===""){w(y.value?[y.value]:[]);return}C.length>=s&&N({input:C},P=>{let j=[];P?(j=P,y.value&&(j=[y.value,...P.filter(M=>JSON.stringify(M)!==JSON.stringify(y.value))])):y.value&&(j=[y.value]),w(j)})},[y.value,C]),v.jsx(RR,{name:e,loading:E,filterOptions:u,noOptionsText:C.length<s?a:l,options:T,autoComplete:p,includeInputInList:f,onChange:(P,j,M,R)=>{w(j?[j,...T]:T),S(j),r&&r(P,j,M,R)},onInputChange:(P,j,M)=>{_(j),n&&n(P,j,M)},...m})},hq=t=>{const{name:e,label:n=Mn(e),options:r=[],filterSelectedOptions:o=!0,variant:i="outlined",staticLabel:s=!1,staticLabelProps:a={fontSize:".9em",color:"#808080"},readOnly:l,margin:u="dense",fullWidth:f=!0,required:p,onChange:m,getOptionLabel:y=j=>typeof j=="string"?j:String(j),isOptionEqualToValue:b=(j,M)=>JSON.stringify(j)===JSON.stringify(M),useFieldAsValue:g,errorMode:S="normal",...C}=t,[_,T,w]=qt.useField(e),{setValue:E}=w,{error:O}=T;g&&t.freeSolo&&console.error("MultiAutocomplete: `freeSolo` with `useFieldAsValue` not currently supported");const N={...er(C,["useFieldAsValue","errorMode"]),getOptionLabel:y,options:r,filterSelectedOptions:o,isOptionEqualToValue:b,renderInput:j=>v.jsx(D.TextField,{...j,variant:i,label:s?void 0:n,error:!!O,required:p}),onChange:(j,M,R,B)=>{E(g?M.map(F=>F[g]):M),m&&m(j,M,R,B)},fullWidth:!0,value:g?r.filter(j=>_.value.includes(j[g]))||[]:_.value,slotProps:{paper:{elevation:8,sx:{borderRadius:2}}}},P=()=>_.value.length===0?"":(g?r.filter(M=>_.value.includes(M[g]))||[]:_.value).map(M=>y(M)).join(", ");return v.jsxs(D.FormControl,{margin:u,fullWidth:f,required:p,children:[(s||l)&&v.jsx(D.Typography,{...a,children:n}),l?v.jsx(D.Typography,{children:P()}):v.jsxs(D.Box,{children:[v.jsx(D.Autocomplete,{...N,multiple:!0}),v.jsx(yr,{name:e,id:`${e}-err`,errorMode:S})]})]})},AR=t=>{const{name:e,label:n=Mn(e),helperText:r,required:o=!1,labelPlacement:i="end",labelAlignment:s=i==="end"||i==="start"?"top":"center",readOnly:a=!1,staticLabelProps:l={fontSize:".9em",color:"#808080"},onChange:u,errorMode:f="normal",...p}=t;s==="top"&&(i==="bottom"||i==="top")&&console.error(`Checkbox: Ignoring labelAlignment='top'. labelAlignment cannot be 'top' when labelPlacement=${i}`);const m=qt.useField({name:e}),y=m[0],b=m[2],g=r?v.jsxs("div",{children:[v.jsx("p",{style:{margin:0},children:n}),v.jsx(D.Typography,{variant:"caption",style:{fontSize:"0.85rem"},children:r})]}):n,S=s==="top"&&(i==="start"||i==="end");if(a)return y.value&&v.jsx(D.Typography,{...l,children:g});const C=v.jsx(D.FormControlLabel,{sx:{alignItems:S?"flex-start":"center"},label:v.jsx("span",{"data-testid":n,style:{display:"inline-block",marginTop:S?"10px":0},children:g}),required:o,labelPlacement:i,control:v.jsx(D.Checkbox,{"data-testid":"checkbox",...p,...y,onChange:(_,T)=>{b.setValue(_.target.checked),u&&u(_,T)},checked:y.value})});return v.jsxs(D.Box,{children:[C,v.jsx(yr,{name:e,id:`${e}-err`,errorMode:f})]})},Ps=t=>{const{name:e,label:n=Mn(e),format:r="",autoFormat:o=r,placeholder:i=n,staticLabel:s=!1,staticLabelProps:a={fontSize:".9em",color:"#808080"},readOnly:l=!1,startIcon:u,endIcon:f,margin:p="dense",noTrimOnBlur:m=!1,errorMode:y="normal"}=t,[b,g,S]=qt.useField({name:e}),{setValue:C}=S,{value:_}=b,{error:T}=g;_===void 0&&console.error(`Please set an initial value for ${e}`),!r&&o&&console.error("Can't auto format when there is no format");const w=O=>{if(o){const N=m6(O.target.value,r,_,O.target);C(N)}else C(O.target.value);t.onChange&&t.onChange(O)},E=["autoFormat","format","staticLabel","staticLabelProps","endIcon","startIcon","errorMode"];return v.jsxs(D.FormControl,{margin:p,fullWidth:!0,children:[(s||l)&&v.jsx(D.Typography,{...a,children:n}),l?v.jsx(D.Typography,{children:_}):v.jsxs(D.Box,{children:[v.jsx(D.TextField,{variant:"outlined",fullWidth:!0,...b,id:`${e}-tf`,error:!!T,placeholder:i,...er({...t},E),onChange:w,label:s?void 0:n,slotProps:{input:{endAdornment:f,startAdornment:u}},onBlur:O=>{m||C(O.target.value.trim()),t.onBlur&&t.onBlur(O)}}),v.jsx(yr,{name:e,id:`${e}-err`,errorMode:y})]})]})},mq=t=>{const{name:e,checkboxes:n=[],label:r=Mn(e),labelPlacement:o="end",labelAlignment:i=o==="end"||o==="start"?"top":"center",required:s=!1,disabled:a=!1,readOnly:l=!1,min:u=0,max:f=n.length,minMaxSubtitle:p="Please select between {min} and {max} options",maxSubtitle:m="Up to {max} max",minSubtitle:y="Please select {min} or more",margin:b="dense",staticLabelProps:g={fontSize:".9em",color:"#808080"},errorMode:S="normal"}=t,[C,_,T]=qt.useField({name:e}),{setValue:w}=T,{value:E}=C,{error:O}=_,{setFieldValue:N}=qt.useFormikContext();(u<0||u>=n.length)&&console.error(`CheckboxGroup: "min" cannot be ${u}. It must be a value between 0 and ${n.length-1}.`),(f<=1||f>n.length)&&console.error(`CheckboxGroup: "max" must be a value between 2 and ${n.length}.`),i==="top"&&(o==="bottom"||o==="top")&&console.error(`CheckboxGroup: Ignoring labelAlignment='top'. labelAlignment cannot be 'top' when labelPlacement=${o}`);const P=()=>t.labelPlacement=="start"?"right":t.labelPlacement=="top"||t.labelPlacement=="bottom"?"center":"left",j=F=>typeof F=="string"?F:!F.textField&&!F.helperText?F.label:v.jsxs(D.Box,{display:"flex",flexDirection:"row",justifyContent:"center",gap:"0.5rem",alignItems:"baseline",children:[v.jsxs(D.Box,{display:"flex",flexDirection:"column",justifyContent:"center",children:[v.jsx("p",{style:{margin:0},children:F.label}),F.helperText&&v.jsx(D.Typography,{variant:"caption",style:{fontSize:"0.85rem"},children:F.helperText})]}),F.textField&&v.jsx(Ps,{label:"",size:"small",margin:"none",sx:{"& .MuiInputBase-input":{height:14}},...F.textField})]}),M=n.map(F=>{const $=typeof F=="string"?F:F.label,z=i==="top"&&(o==="start"||o==="end");return v.jsx(D.FormControlLabel,{sx:{alignItems:z?"flex-start":"center"},value:$,control:v.jsx(D.Checkbox,{}),label:v.jsx("div",{"data-testid":typeof F=="string"?F:F.label,style:{marginTop:z?"10px":0},children:j(F)}),labelPlacement:o,checked:E.includes($),disabled:a||!E.includes($)&&E.length===f,style:{textAlign:P()}},`checkbox-group-${$}`)}),R=()=>{if(f<n.length&&u>0)return v.jsx(D.Typography,{variant:"subtitle2",children:p.replace("{min}",`${u}`).replace("{max}",`${f}`)});if(f<n.length)return v.jsx(D.Typography,{variant:"subtitle2",children:m.replace("{max}",`${f}`)});if(u>0)return v.jsx(D.Typography,{variant:"subtitle2",children:y.replace("{min}",`${u}`)})};return l?v.jsxs(D.Box,{children:[v.jsx(D.Typography,{...g,children:r}),E.join(", ")]}):v.jsxs(D.FormControl,{onChange:F=>{const $=F.target.value,z=F.target.checked,L=n.find(W=>typeof W=="string"?W===$:W.label===$);z?w([...E,$]):(L&&typeof L=="object"&&L.textField&&L.textField.name&&N(L.textField.name,""),w(E.filter(W=>W!=$)))},fullWidth:!0,margin:b,error:!!O,children:[v.jsx(D.FormLabel,{focused:t.focused,htmlFor:e,required:s,disabled:t.disableLabel,children:r}),R(),M,v.jsx(yr,{name:e,id:`${e}-err`,errorMode:S})]})},eT=Le(v.jsx("path",{d:"M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96M14 13v4h-4v-4H7l5-5 5 5z"}),"CloudUpload"),IR=t=>{const{name:e,multiple:n=!1,readOnly:r=!1,variant:o=n?"drag-and-drop":"button",duplicateFilesCallback:i,incorrectFileTypesCallback:s,staticLabelProps:a={fontSize:".9em",color:"#808080"},errorMode:l="normal"}=t,[u,f,p]=qt.useField({name:e}),{setValue:m}=p,y=u.value,b=t.fileType?Array.isArray(t.fileType)?t.fileType:[t.fileType]:[],g=t.subtitle??(b.length>0?`Allowed file extensions: ${b.join(", ")}`:""),S=j=>{_(Array.from(j.target.files??[]))},C=j=>{j.preventDefault(),_(Array.from(j.dataTransfer.files))},_=j=>{if(j&&j.length>0){const M=y?Array.isArray(y)?y:[y]:[],R=yf.partition(j,B=>M.find(F=>w(B,F)));if(j=R[1],i&&R[0].length>0&&i(R[0]),b.length>0){const B=yf.partition(j,F=>b.find($=>F.name.endsWith($)));j=B[0],s&&B[1].length>0&&s(B[1])}n?m([...T(),...j]):!Array.isArray(y)&&j.length>0&&m(j[0])}},T=()=>y?Array.isArray(y)?y:[y]:[],w=(j,M)=>j.lastModified===M.lastModified&&j.name===M.name&&j.type===M.type&&j.size===M.size,E=()=>T().map(j=>j.name).join(", "),O=v.jsx(yr,{name:e,id:`${e}-err`,errorMode:l});return r?v.jsx(D.Typography,{"data-testid":"fileupload-readonly",...a,children:E()}):o==="drag-and-drop"?v.jsxs("div",{style:{border:`4px dashed ${f.error?"red":"lightgray"}`,padding:"30px 10px",display:"flex",alignItems:"center",flexDirection:"column"},onDrop:C,onDragOver:j=>j.preventDefault(),"data-testid":"dropzone",children:[v.jsx(eT,{color:"primary",sx:{fontSize:"40px"}}),v.jsxs("div",{style:{display:"flex",flexDirection:"row",alignItems:"baseline"},children:[v.jsx(D.Typography,{children:"Drag and drop or"}),v.jsxs(D.Button,{component:"label",role:void 0,variant:"text",tabIndex:-1,sx:{textTransform:"none",fontSize:"16px",textDecoration:"underline"},children:["browse",v.jsx("input",{"data-testid":"file-input",id:e,hidden:!0,type:"file",onChange:S,multiple:!0,accept:b==null?void 0:b.toString()})]})]}),g&&v.jsx(D.Typography,{variant:"caption",children:g}),O]}):v.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[v.jsx("div",{style:{display:"flex",alignItems:"center",marginBottom:"4px"},children:v.jsxs(D.Button,{component:"label",role:void 0,variant:"contained",tabIndex:-1,startIcon:v.jsx(eT,{}),style:{whiteSpace:"nowrap"},children:["Select a file",v.jsx("input",{"data-testid":"file-input",id:e,hidden:!0,type:"file",onChange:S,accept:b==null?void 0:b.toString()})]})}),O]})},gq=Le(v.jsx("path",{d:"M15 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V7zM6 20V4h8v4h4v12zm10-10v5c0 2.21-1.79 4-4 4s-4-1.79-4-4V8.5c0-1.47 1.26-2.64 2.76-2.49 1.3.13 2.24 1.32 2.24 2.63V15h-2V8.5c0-.28-.22-.5-.5-.5s-.5.22-.5.5V15c0 1.1.9 2 2 2s2-.9 2-2v-5z"}),"FilePresent"),Zv=Le(v.jsx("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM19 4h-3.5l-1-1h-5l-1 1H5v2h14z"}),"Delete"),yq=t=>{const{name:e}=t,[n,,r]=qt.useField({name:e}),{setValue:o}=r,i=n.value;return v.jsx("div",{style:{width:"100%"},children:i.map(s=>v.jsx(D.Card,{sx:{margin:"10px 0px"},children:v.jsxs(D.CardContent,{style:{display:"flex",alignItems:"center",padding:"8px 12px"},children:[v.jsx(gq,{sx:{color:"gray",fontSize:"20px"}}),v.jsx(D.Typography,{sx:{padding:"8px",overflowWrap:"anywhere"},children:s.name}),v.jsx(D.IconButton,{"aria-label":"remove file",onClick:()=>o(i.filter(a=>a!==s)),edge:"end",style:{marginLeft:"auto",order:"2"},children:v.jsx(Zv,{})})]})},`${s.name}-${s.type}-${s.size}-${s.lastModified}`))})};var qm,tT;function hi(){if(tT)return qm;tT=1;function t(e){var n=typeof e;return e!=null&&(n=="object"||n=="function")}return qm=t,qm}var Um,nT;function DR(){if(nT)return Um;nT=1;var t=typeof ji=="object"&&ji&&ji.Object===Object&&ji;return Um=t,Um}var Km,rT;function po(){if(rT)return Km;rT=1;var t=DR(),e=typeof self=="object"&&self&&self.Object===Object&&self,n=t||e||Function("return this")();return Km=n,Km}var Ym,oT;function bq(){if(oT)return Ym;oT=1;var t=po(),e=function(){return t.Date.now()};return Ym=e,Ym}var Gm,iT;function vq(){if(iT)return Gm;iT=1;var t=/\s/;function e(n){for(var r=n.length;r--&&t.test(n.charAt(r)););return r}return Gm=e,Gm}var Jm,sT;function xq(){if(sT)return Jm;sT=1;var t=vq(),e=/^\s+/;function n(r){return r&&r.slice(0,t(r)+1).replace(e,"")}return Jm=n,Jm}var Zm,aT;function ou(){if(aT)return Zm;aT=1;var t=po(),e=t.Symbol;return Zm=e,Zm}var Xm,lT;function Sq(){if(lT)return Xm;lT=1;var t=ou(),e=Object.prototype,n=e.hasOwnProperty,r=e.toString,o=t?t.toStringTag:void 0;function i(s){var a=n.call(s,o),l=s[o];try{s[o]=void 0;var u=!0}catch{}var f=r.call(s);return u&&(a?s[o]=l:delete s[o]),f}return Xm=i,Xm}var Qm,cT;function Cq(){if(cT)return Qm;cT=1;var t=Object.prototype,e=t.toString;function n(r){return e.call(r)}return Qm=n,Qm}var eg,uT;function Js(){if(uT)return eg;uT=1;var t=ou(),e=Sq(),n=Cq(),r="[object Null]",o="[object Undefined]",i=t?t.toStringTag:void 0;function s(a){return a==null?a===void 0?o:r:i&&i in Object(a)?e(a):n(a)}return eg=s,eg}var tg,dT;function ts(){if(dT)return tg;dT=1;function t(e){return e!=null&&typeof e=="object"}return tg=t,tg}var ng,fT;function Ip(){if(fT)return ng;fT=1;var t=Js(),e=ts(),n="[object Symbol]";function r(o){return typeof o=="symbol"||e(o)&&t(o)==n}return ng=r,ng}var rg,pT;function PR(){if(pT)return rg;pT=1;var t=xq(),e=hi(),n=Ip(),r=NaN,o=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,s=/^0o[0-7]+$/i,a=parseInt;function l(u){if(typeof u=="number")return u;if(n(u))return r;if(e(u)){var f=typeof u.valueOf=="function"?u.valueOf():u;u=e(f)?f+"":f}if(typeof u!="string")return u===0?u:+u;u=t(u);var p=i.test(u);return p||s.test(u)?a(u.slice(2),p?2:8):o.test(u)?r:+u}return rg=l,rg}var og,hT;function NR(){if(hT)return og;hT=1;var t=hi(),e=bq(),n=PR(),r="Expected a function",o=Math.max,i=Math.min;function s(a,l,u){var f,p,m,y,b,g,S=0,C=!1,_=!1,T=!0;if(typeof a!="function")throw new TypeError(r);l=n(l)||0,t(u)&&(C=!!u.leading,_="maxWait"in u,m=_?o(n(u.maxWait)||0,l):m,T="trailing"in u?!!u.trailing:T);function w(F){var $=f,z=p;return f=p=void 0,S=F,y=a.apply(z,$),y}function E(F){return S=F,b=setTimeout(P,l),C?w(F):y}function O(F){var $=F-g,z=F-S,L=l-$;return _?i(L,m-z):L}function N(F){var $=F-g,z=F-S;return g===void 0||$>=l||$<0||_&&z>=m}function P(){var F=e();if(N(F))return j(F);b=setTimeout(P,O(F))}function j(F){return b=void 0,T&&f?w(F):(f=p=void 0,y)}function M(){b!==void 0&&clearTimeout(b),S=0,f=g=p=b=void 0}function R(){return b===void 0?y:j(e())}function B(){var F=e(),$=N(F);if(f=arguments,p=this,g=F,$){if(b===void 0)return E(g);if(_)return clearTimeout(b),b=setTimeout(P,l),w(g)}return b===void 0&&(b=setTimeout(P,l)),y}return B.cancel=M,B.flush=R,B}return og=s,og}var ig,mT;function wq(){if(mT)return ig;mT=1;var t=NR(),e=hi(),n="Expected a function";function r(o,i,s){var a=!0,l=!0;if(typeof o!="function")throw new TypeError(n);return e(s)&&(a="leading"in s?!!s.leading:a,l="trailing"in s?!!s.trailing:l),t(o,i,{leading:a,maxWait:i,trailing:l})}return ig=r,ig}var Tq=wq();const jR=or(Tq),_q=Le(v.jsx("path",{d:"M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7m0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5"}),"LocationOn");var Ud={exports:{}},kq=Ud.exports,gT;function Eq(){return gT||(gT=1,function(t,e){(function(n,r){t.exports=r()})(kq,()=>{return n={705:o=>{o.exports=function(i,s){const a=[];return s.length===0?a.push({text:i,highlight:!1}):s[0][0]>0&&a.push({text:i.slice(0,s[0][0]),highlight:!1}),s.forEach((l,u)=>{const f=l[0],p=l[1];a.push({text:i.slice(f,p),highlight:!0}),u===s.length-1?p<i.length&&a.push({text:i.slice(p,i.length),highlight:!1}):p<s[u+1][0]&&a.push({text:i.slice(p,s[u+1][0]),highlight:!1})}),a}}},r={},function o(i){var s=r[i];if(s!==void 0)return s.exports;var a=r[i]={exports:{}};return n[i](a,a.exports,o),a.exports}(705);var n,r})}(Ud)),Ud.exports}var Mq=Eq();const Oq=or(Mq),Rq=t=>{const{listItemProps:e,option:n,resultIcon:r,highlightMatches:o}=t,{main_text:i,secondary_text:s,main_text_matched_substrings:a}=n.structured_formatting,l=Oq(i,a.map(u=>[u.offset,u.offset+u.length]));return v.jsx("li",{...er({...e},["key"]),"data-testid":`loc-${n.place_id}`,children:v.jsxs(D.Box,{display:"flex",flexDirection:"row",alignItems:"center",children:[r?A.cloneElement(r):null,v.jsxs(D.Box,{children:[l.map(u=>{const f=o&&u.highlight?700:400;return v.jsx("span",{style:{fontWeight:f},children:u.text},`${n.place_id}_${u.text}`)}),v.jsx(D.Typography,{variant:"body2",color:"textSecondary",children:s})]})]})})};function Aq(t,e,n){if(!e)return;const r=document.createElement("script");r.setAttribute("async",""),r.setAttribute("id",n),r.src=t,r.onerror=()=>console.error(`Failed to load script: ${t}`),e.appendChild(r)}const Ll={current:null},Iq=t=>{const{name:e,label:n=Mn(e),resultIcon:r=v.jsx(_q,{}),apiKey:o,highlightMatches:i=!0,types:s,variant:a="outlined",staticLabel:l=!1,staticLabelProps:u={fontSize:".9em",color:"#808080"},readOnly:f=!1,margin:p="dense",errorMode:m="normal"}=t,[y,b]=A.useState(null),[g,S]=A.useState(""),[C,_]=A.useState([]),T=A.useRef(!1),[,w,E]=qt.useField(e),{setValue:O}=E,{error:N}=w;typeof window<"u"&&!T.current&&(document.querySelector("#google-maps")||Aq(`https://maps.googleapis.com/maps/api/js?key=${o}&libraries=places`,document.querySelector("head"),"google-maps"),T.current=!0);const P=A.useMemo(()=>jR((L,W)=>{Ll.current&&Ll.current.getPlacePredictions(L,W)},200),[]);A.useEffect(()=>{let L=!0;if(!Ll.current&&window.google&&(Ll.current=new window.google.maps.places.AutocompleteService),!Ll.current)return;if(g===""){_(y?[y]:[]);return}return P({input:g,types:s?[s]:[]},G=>{if(L){let U=[];y&&(U=[y]),G&&(U=[...U,...G]);const Z=U.filter((pe,ae,de)=>ae===de.findIndex(ee=>ee.place_id===pe.place_id));_(Z)}}),()=>{L=!1}},[y,g,P,s]);const j=A.useCallback(L=>{const q=(L?[L,...C]:C).filter((G,U,Z)=>U===Z.findIndex(pe=>pe.place_id===G.place_id));_(q),b(L),O(L?L.description:"")},[C,_,b,O]),M=L=>{S(L)},R=["name","apiKey","resultIcon","highlightMatches","variant","staticLabel","staticLabelProps","margin","errorMode"],B=L=>v.jsx(D.TextField,{margin:p,variant:a,...L,...er({...t},R),label:l?void 0:n,hiddenLabel:l,error:!!N}),F=L=>typeof L=="string"?L:L.description,$=(L,W)=>v.jsx(Rq,{listItemProps:L,option:W,resultIcon:r,highlightMatches:i},W.place_id);A.useEffect(()=>{const L=W=>{W.key==="Enter"&&C.length>0&&j(C[0])};return window.addEventListener("keydown",L),()=>{window.removeEventListener("keydown",L)}},[C,j]);const z=v.jsx(D.Autocomplete,{id:`${e}-loc`,"data-testid":"location-autocomplete",getOptionLabel:F,filterOptions:L=>L,options:C,autoComplete:!0,includeInputInList:!0,filterSelectedOptions:!0,value:y,onChange:(L,W)=>j(W),onInputChange:(L,W)=>M(W),disabled:t.disabled,renderOption:$,renderInput:B});return v.jsxs(D.FormControl,{margin:p,fullWidth:!0,children:[(l||f)&&v.jsx(D.Typography,{...u,children:n}),f?v.jsx(D.Typography,{children:y==null?void 0:y.description}):v.jsxs(D.Box,{children:[z,v.jsx(yr,{name:e,id:`${e}-err`,errorMode:m})]})]})},LR=t=>{const{name:e,radios:n=[],label:r=Mn(e),labelPlacement:o="end",labelAlignment:i=o==="end"||o==="start"?"top":"center",required:s=!1,disabled:a=!1,readOnly:l=!1,margin:u="dense",onChange:f,staticLabelProps:p={fontSize:".9em",color:"#808080"},errorMode:m="normal",helperText:y}=t;i==="top"&&(o==="bottom"||o==="top")&&console.error(`RadioGroup: Ignoring labelAlignment='top'. labelAlignment cannot be 'top' when labelPlacement=${o}`);const[b,g,S]=qt.useField({name:e}),{setValue:C}=S,{value:_}=b,{error:T}=g,w=["radioProps","labelPlacement","helperText"],E=["disableRedLabelOnError","disableLabel","sameButtonColor","labelPlacement","focused","margin","fullWidth","labelAlignment","errorMode","helperText"],O=()=>t.labelPlacement=="start"?"right":t.labelPlacement=="top"||t.labelPlacement=="bottom"?"center":"left",N=n.map((R,B)=>{const F=i==="top"&&(o==="start"||o==="end"),$=R.helperText?v.jsxs("div",{children:[v.jsx("p",{style:{margin:0},children:R.label}),v.jsx(D.Typography,{variant:"caption",style:{fontSize:"0.85rem"},children:R.helperText})]}):R.label;return v.jsx(D.FormControlLabel,{sx:{alignItems:F?"flex-start":"center"},value:B.toString(),control:v.jsx(D.Radio,{id:`${R.value}-rb`,color:t.sameButtonColor?t.sameButtonColor:R.color??"default",...er({...R},w)}),label:v.jsx("div",{style:{marginTop:F?"10px":0},children:$}),labelPlacement:o,disabled:R.disabled||a,style:{textAlign:O()}},`rb-${B}-${r}`)}),P=()=>{const R=n.find(B=>B.value===b.value);return v.jsxs(D.Box,{children:[v.jsx(D.Typography,{...p,children:r}),j(R)]})},j=R=>v.jsxs(D.Box,{children:[v.jsx(D.Typography,{children:R==null?void 0:R.label}),(R==null?void 0:R.helperText)&&v.jsx(D.Typography,{variant:"caption",style:{fontSize:"0.85rem"},children:R.helperText})]}),M=R=>{C(R.target.value),f&&f(R.target.value)};return l?P():v.jsxs(D.FormControl,{focused:t.focused,margin:u,fullWidth:t.fullWidth,error:!!T,children:[v.jsx(D.FormLabel,{htmlFor:e,required:s,disabled:t.disableLabel,children:r}),y&&v.jsx(D.FormHelperText,{children:y}),v.jsx(D.RadioGroup,{id:e,value:_??"",...er({...t},E),onChange:M,children:N}),v.jsx(yr,{name:e,id:`${e}-err`,errorMode:m})]})},Dq=t=>{const{name:e,label:n=Mn(e),min:r=0,max:o=100,step:i=1,readOnly:s,staticLabelProps:a={fontSize:".9em",color:"#808080"}}=t,l=qt.useField(e),{value:u}=l[0],{setValue:f}=l[2],p=["label"];return s?(()=>{let y;return Array.isArray(u)?y=s==="percent"?`${100*(u[0]??0)/o}% - ${100*(u[1]??0)/o}%`:`${u[0]??0} - ${u[1]??0}`:y=s==="percent"?`${100*(u??0)/o}%`:`${u??0}`,v.jsxs(D.Box,{children:[v.jsx(D.Typography,{...a,children:n}),v.jsx(D.Typography,{children:y})]})})():v.jsxs(D.FormControl,{fullWidth:!0,children:[v.jsx(D.Typography,{gutterBottom:!0,color:"textSecondary",children:n}),v.jsx(D.Slider,{...er({...t},p),id:t.name,value:u??0,onChange:(y,b)=>{f(b)},min:r,max:o,step:i})]})},Pq=t=>{const{name:e,options:n=[],label:r=Mn(e),selectedOptionIcon:o=void 0,staticLabel:i=!1,staticLabelProps:s={fontSize:".9em",color:"#808080"},variant:a="outlined",readOnly:l=!1,margin:u="dense",required:f,errorMode:p="normal"}=t,[m,y,b]=qt.useField({name:e}),{setValue:g}=b,{value:S}=m,{error:C}=y,_=A.useCallback(()=>{let B="";for(let F=0;F<n.length;F++)JSON.stringify(n[F].value)===JSON.stringify(S)&&(B=F.toString());return B},[n,S]),T=A.useCallback(()=>{const B=[],F=S.toString().split(",");for(const $ of F)for(let z=0;z<n.length;z++)n[z].value===$&&B.push(z);return B},[n,S]);A.useEffect(()=>{O(t.multiple?T():_())},[n,t.multiple,S,T,_]);const w=(B,F)=>t.multiple?!!S.toString().split(",").find($=>$===JSON.stringify(B.value)):F===n.findIndex($=>S===$.value),[E,O]=A.useState(t.multiple?T:_),N=n.map((B,F)=>{const $=o&&w(B,F)?o:void 0;return v.jsxs(D.MenuItem,{id:`select-${e}-option-${B.value}`,value:F,disabled:B.disabled,children:[o&&v.jsx(D.ListItemIcon,{children:$}),B.label]},F.toString())}),P=B=>{if(t.multiple){const F=[];B.target.value.forEach($=>{n[$].value&&F.push(n[$].value)}),g(F.join(","))}else g(n[B.target.value].value);O(B.target.value)},j=["name","options",i?"label":"","required","selectedOptionIcon","variant","staticLabel","staticLabelProps","errorMode"],M=()=>g6(n,S,t.multiple),R=t.renderValue??M;return v.jsxs(D.FormControl,{fullWidth:!0,variant:a,error:!!C,margin:u,required:f,children:[i||l?v.jsx(D.Typography,{...s,children:r}):v.jsx(D.InputLabel,{id:`${e}-select-label`,children:r}),l?v.jsx(D.Typography,{children:M()}):v.jsxs(D.Box,{children:[v.jsx(D.Select,{id:`${e}-sel`,labelId:`${e}-select-label`,label:i?void 0:r,...er({...t},j),name:e,value:E,fullWidth:!0,onChange:B=>P(B),displayEmpty:i,renderValue:R,children:N}),v.jsx(yr,{name:e,id:`${e}-err`,errorMode:p})]})]})},Nq=t=>{const{name:e,label:n=Mn(e),labelPlacement:r="end",readOnly:o,staticLabelProps:i={fontSize:".9em",color:"#808080"},onChange:s,color:a="primary",chipColor:l,activeValue:u=!0,inactiveValue:f=!1,errorMode:p="normal"}=t,[m,,y]=qt.useField({name:e}),{setValue:b}=y,{value:g}=m;g===void 0&&console.error(`Please set an initial value for ${e}`);const S=["labelPlacement","chipColor","activeValue","inactiveValue","errorMode"],C=_=>{if(typeof _!="boolean")return String(_);switch(o){case"YES_NO":return _===u?"Yes":"No";case"ON_OFF":return _===u?"On":"Off";default:return _===u?"True":"False"}};return o?v.jsxs(D.Box,{children:[v.jsx(D.Typography,{...i,children:n}),v.jsx(D.Typography,{children:C(g)})]}):v.jsxs(D.Box,{bgcolor:l??"inherit",sx:l?{display:"inline-flex",justifyContent:"center",alignItems:"center",borderRadius:"32px",padding:"2px 0px 2px 12px"}:{},children:[v.jsx(D.FormControlLabel,{label:n,sx:{"& .MuiFormControlLabel-label":{color:a}},labelPlacement:r,control:v.jsx(D.Switch,{...er({...t},S),id:e,...m,onChange:_=>{if(typeof u=="string"&&typeof f=="string"){const T=_.target.checked?u:f;b(T),s&&s(T)}else b(_.target.checked),s&&s(_.target.checked)},checked:g===u})}),v.jsx(yr,{name:e,id:`${e}-err`,errorMode:p})]})},jq=Le([v.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"},"0"),v.jsx("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"},"1")],"AccessTime"),Lq=Le(v.jsx("path",{d:"M13 7h-2v4H7v2h4v4h2v-4h4v-2h-4zm-1-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"}),"AddCircleOutline"),Fq=Le(v.jsx("path",{d:"M19 7v2.99s-1.99.01-2 0V7h-3s.01-1.99 0-2h3V2h2v3h3v2zm-3 4V8h-3V5H5c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-8zM5 19l3-4 2 3 3-4 4 5z"}),"AddPhotoAlternate"),$q=Le(v.jsx("path",{d:"m19 18 2 1V3c0-1.1-.9-2-2-2H8.99C7.89 1 7 1.9 7 3h10c1.1 0 2 .9 2 2zM15 5H5c-1.1 0-2 .9-2 2v16l7-3 7 3V7c0-1.1-.9-2-2-2"}),"Bookmarks"),Bq=Le(v.jsx("path",{d:"M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"}),"Check"),zq=Le(v.jsx("path",{d:"M22 7h-9v2h9zm0 8h-9v2h9zM5.54 11 2 7.46l1.41-1.41 2.12 2.12 4.24-4.24 1.41 1.41zm0 8L2 15.46l1.41-1.41 2.12 2.12 4.24-4.24 1.41 1.41z"}),"Checklist"),Dp=Le(v.jsx("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close"),Vq=Le(v.jsx("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"CloseOutlined"),Hq=Le(v.jsx("path",{d:"M9.4 16.6 4.8 12l4.6-4.6L8 6l-6 6 6 6zm5.2 0 4.6-4.6-4.6-4.6L16 6l6 6-6 6z"}),"Code"),FR=Le(v.jsx("path",{d:"M12 3c-4.97 0-9 4.03-9 9s4.03 9 9 9 9-4.03 9-9c0-.46-.04-.92-.1-1.36-.98 1.37-2.58 2.26-4.4 2.26-2.98 0-5.4-2.42-5.4-5.4 0-1.81.89-3.42 2.26-4.4-.44-.06-.9-.1-1.36-.1"}),"DarkMode"),yT=Le(v.jsx("path",{d:"M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8zm2 16H8v-2h8zm0-4H8v-2h8zm-3-5V3.5L18.5 9z"}),"Description"),Wq=Le(v.jsx("path",{d:"M5 20h14v-2H5zM19 9h-4V3H9v6H5l7 7z"}),"Download"),qq=Le(v.jsx("path",{d:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.996.996 0 0 0-1.41 0l-1.83 1.83 3.75 3.75z"}),"Edit"),Uq=Le(v.jsx("path",{d:"M7 15v2h10v-2zm-4 6h18v-2H3zm0-8h18v-2H3zm4-6v2h10V7zM3 3v2h18V3z"}),"FormatAlignCenter"),Kq=Le(v.jsx("path",{d:"M3 21h18v-2H3zm0-4h18v-2H3zm0-4h18v-2H3zm0-4h18V7H3zm0-6v2h18V3z"}),"FormatAlignJustify"),Yq=Le(v.jsx("path",{d:"M15 15H3v2h12zm0-8H3v2h12zM3 13h18v-2H3zm0 8h18v-2H3zM3 3v2h18V3z"}),"FormatAlignLeft"),Gq=Le(v.jsx("path",{d:"M3 21h18v-2H3zm6-4h12v-2H9zm-6-4h18v-2H3zm6-4h12V7H9zM3 3v2h18V3z"}),"FormatAlignRight"),Jq=Le(v.jsx("path",{d:"M15.6 10.79c.97-.67 1.65-1.77 1.65-2.79 0-2.26-1.75-4-4-4H7v14h7.04c2.09 0 3.71-1.7 3.71-3.79 0-1.52-.86-2.82-2.15-3.42M10 6.5h3c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5h-3zm3.5 9H10v-3h3.5c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5"}),"FormatBold"),Zq=Le(v.jsx("path",{d:"M3.27 5 2 6.27l6.97 6.97L6.5 19h3l1.57-3.66L16.73 21 18 19.73 3.55 5.27zM6 5v.18L8.82 8h2.4l-.72 1.68 2.1 2.1L14.21 8H20V5z"}),"FormatClear"),Xq=Le(v.jsx("path",{d:"M16.56 8.94 7.62 0 6.21 1.41l2.38 2.38-5.15 5.15c-.59.59-.59 1.54 0 2.12l5.5 5.5c.29.29.68.44 1.06.44s.77-.15 1.06-.44l5.5-5.5c.59-.58.59-1.53 0-2.12M5.21 10 10 5.21 14.79 10zM19 11.5s-2 2.17-2 3.5c0 1.1.9 2 2 2s2-.9 2-2c0-1.33-2-3.5-2-3.5M2 20h20v4H2z"}),"FormatColorFill"),Qq=Le(v.jsx("path",{d:"M11 17h10v-2H11zm-8-5 4 4V8zm0 9h18v-2H3zM3 3v2h18V3zm8 6h10V7H11zm0 4h10v-2H11z"}),"FormatIndentDecrease"),e8=Le(v.jsx("path",{d:"M3 21h18v-2H3zM3 8v8l4-4zm8 9h10v-2H11zM3 3v2h18V3zm8 6h10V7H11zm0 4h10v-2H11z"}),"FormatIndentIncrease"),t8=Le(v.jsx("path",{d:"M10 4v3h2.21l-3.42 8H6v3h8v-3h-2.21l3.42-8H18V4z"}),"FormatItalic"),n8=Le(v.jsx("path",{d:"M4 10.5c-.83 0-1.5.67-1.5 1.5s.67 1.5 1.5 1.5 1.5-.67 1.5-1.5-.67-1.5-1.5-1.5m0-6c-.83 0-1.5.67-1.5 1.5S3.17 7.5 4 7.5 5.5 6.83 5.5 6 4.83 4.5 4 4.5m0 12c-.83 0-1.5.68-1.5 1.5s.68 1.5 1.5 1.5 1.5-.68 1.5-1.5-.67-1.5-1.5-1.5M7 19h14v-2H7zm0-6h14v-2H7zm0-8v2h14V5z"}),"FormatListBulleted"),r8=Le(v.jsx("path",{d:"M2 17h2v.5H3v1h1v.5H2v1h3v-4H2zm1-9h1V4H2v1h1zm-1 3h1.8L2 13.1v.9h3v-1H3.2L5 10.9V10H2zm5-6v2h14V5zm0 14h14v-2H7zm0-6h14v-2H7z"}),"FormatListNumbered"),o8=Le(v.jsx("path",{d:"M6 17h3l2-4V7H5v6h3zm8 0h3l2-4V7h-6v6h3z"}),"FormatQuote"),i8=Le(v.jsx("path",{d:"M9 4v3h5v12h3V7h5V4zm-6 8h3v7h3v-7h3V9H3z"}),"FormatSize"),s8=Le(v.jsx("path",{d:"M12 17c3.31 0 6-2.69 6-6V3h-2.5v8c0 1.93-1.57 3.5-3.5 3.5S8.5 12.93 8.5 11V3H6v8c0 3.31 2.69 6 6 6m-7 2v2h14v-2z"}),"FormatUnderlined"),a8=Le(v.jsx("path",{d:"M8 4v1.45l2 2V4h4v4h-3.45l2 2H14v1.45l2 2V10h4v4h-3.45l2 2H20v1.45l2 2V4c0-1.1-.9-2-2-2H4.55l2 2zm8 0h4v4h-4zM1.27 1.27 0 2.55l2 2V20c0 1.1.9 2 2 2h15.46l2 2 1.27-1.27zM10 12.55 11.45 14H10zm-6-6L5.45 8H4zM8 20H4v-4h4zm0-6H4v-4h3.45l.55.55zm6 6h-4v-4h3.45l.55.54zm2 0v-1.46L17.46 20z"}),"GridOff"),l8=Le(v.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 17h-2v-2h2zm2.07-7.75-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25"}),"Help"),c8=Le(v.jsx("path",{fillRule:"evenodd",d:"M4 11h16v2H4z"}),"HorizontalRule"),u8=Le(v.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-6h2zm0-8h-2V7h2z"}),"Info"),sg=Le(v.jsx("path",{d:"M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6z"}),"KeyboardArrowDown"),Kd=Le(v.jsx("path",{d:"M7.41 15.41 12 10.83l4.59 4.58L18 14l-6-6-6 6z"}),"KeyboardArrowUp"),$R=Le(v.jsx("path",{d:"M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3z"}),"Launch"),BR=Le(v.jsx("path",{d:"M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5M2 13h2c.55 0 1-.45 1-1s-.45-1-1-1H2c-.55 0-1 .45-1 1s.45 1 1 1m18 0h2c.55 0 1-.45 1-1s-.45-1-1-1h-2c-.55 0-1 .45-1 1s.45 1 1 1M11 2v2c0 .55.45 1 1 1s1-.45 1-1V2c0-.55-.45-1-1-1s-1 .45-1 1m0 18v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1M5.99 4.58c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0s.39-1.03 0-1.41zm12.37 12.37c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0 .39-.39.39-1.03 0-1.41zm1.06-10.96c.39-.39.39-1.03 0-1.41-.39-.39-1.03-.39-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0zM7.05 18.36c.39-.39.39-1.03 0-1.41-.39-.39-1.03-.39-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0z"}),"LightMode"),bf=Le(v.jsx("path",{d:"M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1M8 13h8v-2H8zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5"}),"Link"),d8=Le(v.jsx("path",{d:"m17 7-1.41 1.41L18.17 11H8v2h10.17l-2.58 2.58L17 17l5-5zM4 5h8V3H4c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h8v-2H4z"}),"Logout"),f8=Le(v.jsx("path",{d:"M3 18h18v-2H3zm0-5h18v-2H3zm0-7v2h18V6z"}),"Menu"),p8=Le(v.jsx("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}),"NavigateNext"),h8=Le(v.jsx("path",{d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4m0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4"}),"Person"),m8=Le(v.jsx("path",{d:"M18.4 10.6C16.55 8.99 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16c1.05-3.19 4.05-5.5 7.6-5.5 1.95 0 3.73.72 5.12 1.88L13 16h9V7z"}),"Redo"),g8=Le(v.jsx("path",{d:"M19 13H5v-2h14z"}),"Remove"),y8=Le(v.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m5 11H7v-2h10z"}),"RemoveCircle"),b8=Le(v.jsx("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14"}),"SearchOutlined"),v8=Le(v.jsx("path",{d:"M3 18h6v-2H3zM3 6v2h18V6zm0 7h12v-2H3z"}),"Sort"),x8=Le(v.jsx("path",{d:"M6.85 7.08C6.85 4.37 9.45 3 12.24 3c1.64 0 3 .49 3.9 1.28.77.65 1.46 1.73 1.46 3.24h-3.01c0-.31-.05-.59-.15-.85-.29-.86-1.2-1.28-2.25-1.28-1.86 0-2.34 1.02-2.34 1.7 0 .48.25.88.74 1.21.38.25.77.48 1.41.7H7.39c-.21-.34-.54-.89-.54-1.92M21 12v-2H3v2h9.62c1.15.45 1.96.75 1.96 1.97 0 1-.81 1.67-2.28 1.67-1.54 0-2.93-.54-2.93-2.51H6.4c0 .55.08 1.13.24 1.58.81 2.29 3.29 3.3 5.67 3.3 2.27 0 5.3-.89 5.3-4.05 0-.3-.01-1.16-.48-1.94H21z"}),"StrikethroughS"),S8=Le(v.jsx("path",{d:"M22 18h-2v1h3v1h-4v-2c0-.55.45-1 1-1h2v-1h-3v-1h3c.55 0 1 .45 1 1v1c0 .55-.45 1-1 1M5.88 18h2.66l3.4-5.42h.12l3.4 5.42h2.66l-4.65-7.27L17.81 4h-2.68l-3.07 4.99h-.12L8.85 4H6.19l4.32 6.73z"}),"Subscript"),C8=Le(v.jsx("path",{d:"M22 7h-2v1h3v1h-4V7c0-.55.45-1 1-1h2V5h-3V4h3c.55 0 1 .45 1 1v1c0 .55-.45 1-1 1M5.88 20h2.66l3.4-5.42h.12l3.4 5.42h2.66l-4.65-7.27L17.81 6h-2.68l-3.07 4.99h-.12L8.85 6H6.19l4.32 6.73z"}),"Superscript"),w8=Le(v.jsx("path",{d:"M12.5 8c-2.65 0-5.05.99-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8"}),"Undo"),T8=Le(v.jsx("path",{d:"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5M12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5m0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3"}),"Visibility"),_8=t=>{const{onSearch:e,initialValue:n="",lazySearch:r=!1}=t,[o,i]=X.useState(n),s=f=>{i(f.target.value),r||e(f.target.value)},a=f=>{f.key==="Enter"&&l()},l=()=>{e(o)},u=()=>{i(""),e("")};return v.jsx(D.TextField,{type:"text",placeholder:"Search...",value:o,onChange:s,onKeyDown:a,className:"search-bar",size:"small",fullWidth:!0,slotProps:{input:{startAdornment:v.jsx(D.InputAdornment,{position:"start",children:v.jsx(D.IconButton,{"data-testid":"search-button",style:{marginLeft:-10},onClick:l,children:v.jsx(b8,{})})}),endAdornment:o&&v.jsx(D.IconButton,{style:{marginRight:-10},"aria-label":"clear search","data-testid":"clear-search",onClick:u,children:v.jsx(Vq,{})})}}})};function ne(){return ne=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},ne.apply(null,arguments)}function rt(t,e){if(t==null)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.includes(r))continue;n[r]=t[r]}return n}function Ut({props:t,name:e}){return c9({props:t,name:e,defaultTheme:Ap,themeId:ru})}const k8=["localeText"],vf=A.createContext(null);process.env.NODE_ENV!=="production"&&(vf.displayName="MuiPickersAdapterContext");const Xv=function(e){const{localeText:n}=e,r=rt(e,k8),{utils:o,localeText:i}=A.useContext(vf)??{utils:void 0,localeText:void 0},s=Ut({props:r,name:"MuiLocalizationProvider"}),{children:a,dateAdapter:l,dateFormats:u,dateLibInstance:f,adapterLocale:p,localeText:m}=s,y=A.useMemo(()=>ne({},m,i,n),[m,i,n]),b=A.useMemo(()=>{if(!l)return o||null;const C=new l({locale:p,formats:u,instance:f});if(!C.isMUIAdapter)throw new Error(["MUI X: The date adapter should be imported from `@mui/x-date-pickers` or `@mui/x-date-pickers-pro`, not from `@date-io`","For example, `import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs'` instead of `import AdapterDayjs from '@date-io/dayjs'`","More information on the installation documentation: https://mui.com/x/react-date-pickers/getting-started/#installation"].join(`
105
105
  `));return C},[l,p,u,f,o]),g=A.useMemo(()=>b?{minDate:b.date("1900-01-01T00:00:00.000"),maxDate:b.date("2099-12-31T00:00:00.000")}:null,[b]),S=A.useMemo(()=>({utils:b,defaultDates:g,localeText:y}),[g,b,y]);return v.jsx(vf.Provider,{value:S,children:a})};process.env.NODE_ENV!=="production"&&(Xv.propTypes={adapterLocale:c.any,children:c.node,dateAdapter:c.func,dateFormats:c.shape({dayOfMonth:c.string,dayOfMonthFull:c.string,fullDate:c.string,fullTime:c.string,fullTime12h:c.string,fullTime24h:c.string,hours12h:c.string,hours24h:c.string,keyboardDate:c.string,keyboardDateTime:c.string,keyboardDateTime12h:c.string,keyboardDateTime24h:c.string,meridiem:c.string,minutes:c.string,month:c.string,monthShort:c.string,normalDate:c.string,normalDateWithWeekday:c.string,seconds:c.string,shortDate:c.string,weekday:c.string,weekdayShort:c.string,year:c.string}),dateLibInstance:c.any,localeText:c.object});var Yd={exports:{}},E8=Yd.exports,bT;function M8(){return bT||(bT=1,function(t,e){(function(n,r){t.exports=r()})(E8,function(){var n=1e3,r=6e4,o=36e5,i="millisecond",s="second",a="minute",l="hour",u="day",f="week",p="month",m="quarter",y="year",b="date",g="Invalid Date",S=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,C=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,_={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function($){var z=["th","st","nd","rd"],L=$%100;return"["+$+(z[(L-20)%10]||z[L]||z[0])+"]"}},T=function($,z,L){var W=String($);return!W||W.length>=z?$:""+Array(z+1-W.length).join(L)+$},w={s:T,z:function($){var z=-$.utcOffset(),L=Math.abs(z),W=Math.floor(L/60),q=L%60;return(z<=0?"+":"-")+T(W,2,"0")+":"+T(q,2,"0")},m:function $(z,L){if(z.date()<L.date())return-$(L,z);var W=12*(L.year()-z.year())+(L.month()-z.month()),q=z.clone().add(W,p),G=L-q<0,U=z.clone().add(W+(G?-1:1),p);return+(-(W+(L-q)/(G?q-U:U-q))||0)},a:function($){return $<0?Math.ceil($)||0:Math.floor($)},p:function($){return{M:p,y,w:f,d:u,D:b,h:l,m:a,s,ms:i,Q:m}[$]||String($||"").toLowerCase().replace(/s$/,"")},u:function($){return $===void 0}},E="en",O={};O[E]=_;var N="$isDayjsObject",P=function($){return $ instanceof B||!(!$||!$[N])},j=function $(z,L,W){var q;if(!z)return E;if(typeof z=="string"){var G=z.toLowerCase();O[G]&&(q=G),L&&(O[G]=L,q=G);var U=z.split("-");if(!q&&U.length>1)return $(U[0])}else{var Z=z.name;O[Z]=z,q=Z}return!W&&q&&(E=q),q||!W&&E},M=function($,z){if(P($))return $.clone();var L=typeof z=="object"?z:{};return L.date=$,L.args=arguments,new B(L)},R=w;R.l=j,R.i=P,R.w=function($,z){return M($,{locale:z.$L,utc:z.$u,x:z.$x,$offset:z.$offset})};var B=function(){function $(L){this.$L=j(L.locale,null,!0),this.parse(L),this.$x=this.$x||L.x||{},this[N]=!0}var z=$.prototype;return z.parse=function(L){this.$d=function(W){var q=W.date,G=W.utc;if(q===null)return new Date(NaN);if(R.u(q))return new Date;if(q instanceof Date)return new Date(q);if(typeof q=="string"&&!/Z$/i.test(q)){var U=q.match(S);if(U){var Z=U[2]-1||0,pe=(U[7]||"0").substring(0,3);return G?new Date(Date.UTC(U[1],Z,U[3]||1,U[4]||0,U[5]||0,U[6]||0,pe)):new Date(U[1],Z,U[3]||1,U[4]||0,U[5]||0,U[6]||0,pe)}}return new Date(q)}(L),this.init()},z.init=function(){var L=this.$d;this.$y=L.getFullYear(),this.$M=L.getMonth(),this.$D=L.getDate(),this.$W=L.getDay(),this.$H=L.getHours(),this.$m=L.getMinutes(),this.$s=L.getSeconds(),this.$ms=L.getMilliseconds()},z.$utils=function(){return R},z.isValid=function(){return this.$d.toString()!==g},z.isSame=function(L,W){var q=M(L);return this.startOf(W)<=q&&q<=this.endOf(W)},z.isAfter=function(L,W){return M(L)<this.startOf(W)},z.isBefore=function(L,W){return this.endOf(W)<M(L)},z.$g=function(L,W,q){return R.u(L)?this[W]:this.set(q,L)},z.unix=function(){return Math.floor(this.valueOf()/1e3)},z.valueOf=function(){return this.$d.getTime()},z.startOf=function(L,W){var q=this,G=!!R.u(W)||W,U=R.p(L),Z=function(oe,ce){var ge=R.w(q.$u?Date.UTC(q.$y,ce,oe):new Date(q.$y,ce,oe),q);return G?ge:ge.endOf(u)},pe=function(oe,ce){return R.w(q.toDate()[oe].apply(q.toDate("s"),(G?[0,0,0,0]:[23,59,59,999]).slice(ce)),q)},ae=this.$W,de=this.$M,ee=this.$D,he="set"+(this.$u?"UTC":"");switch(U){case y:return G?Z(1,0):Z(31,11);case p:return G?Z(1,de):Z(0,de+1);case f:var fe=this.$locale().weekStart||0,se=(ae<fe?ae+7:ae)-fe;return Z(G?ee-se:ee+(6-se),de);case u:case b:return pe(he+"Hours",0);case l:return pe(he+"Minutes",1);case a:return pe(he+"Seconds",2);case s:return pe(he+"Milliseconds",3);default:return this.clone()}},z.endOf=function(L){return this.startOf(L,!1)},z.$set=function(L,W){var q,G=R.p(L),U="set"+(this.$u?"UTC":""),Z=(q={},q[u]=U+"Date",q[b]=U+"Date",q[p]=U+"Month",q[y]=U+"FullYear",q[l]=U+"Hours",q[a]=U+"Minutes",q[s]=U+"Seconds",q[i]=U+"Milliseconds",q)[G],pe=G===u?this.$D+(W-this.$W):W;if(G===p||G===y){var ae=this.clone().set(b,1);ae.$d[Z](pe),ae.init(),this.$d=ae.set(b,Math.min(this.$D,ae.daysInMonth())).$d}else Z&&this.$d[Z](pe);return this.init(),this},z.set=function(L,W){return this.clone().$set(L,W)},z.get=function(L){return this[R.p(L)]()},z.add=function(L,W){var q,G=this;L=Number(L);var U=R.p(W),Z=function(de){var ee=M(G);return R.w(ee.date(ee.date()+Math.round(de*L)),G)};if(U===p)return this.set(p,this.$M+L);if(U===y)return this.set(y,this.$y+L);if(U===u)return Z(1);if(U===f)return Z(7);var pe=(q={},q[a]=r,q[l]=o,q[s]=n,q)[U]||1,ae=this.$d.getTime()+L*pe;return R.w(ae,this)},z.subtract=function(L,W){return this.add(-1*L,W)},z.format=function(L){var W=this,q=this.$locale();if(!this.isValid())return q.invalidDate||g;var G=L||"YYYY-MM-DDTHH:mm:ssZ",U=R.z(this),Z=this.$H,pe=this.$m,ae=this.$M,de=q.weekdays,ee=q.months,he=q.meridiem,fe=function(ce,ge,J,te){return ce&&(ce[ge]||ce(W,G))||J[ge].slice(0,te)},se=function(ce){return R.s(Z%12||12,ce,"0")},oe=he||function(ce,ge,J){var te=ce<12?"AM":"PM";return J?te.toLowerCase():te};return G.replace(C,function(ce,ge){return ge||function(J){switch(J){case"YY":return String(W.$y).slice(-2);case"YYYY":return R.s(W.$y,4,"0");case"M":return ae+1;case"MM":return R.s(ae+1,2,"0");case"MMM":return fe(q.monthsShort,ae,ee,3);case"MMMM":return fe(ee,ae);case"D":return W.$D;case"DD":return R.s(W.$D,2,"0");case"d":return String(W.$W);case"dd":return fe(q.weekdaysMin,W.$W,de,2);case"ddd":return fe(q.weekdaysShort,W.$W,de,3);case"dddd":return de[W.$W];case"H":return String(Z);case"HH":return R.s(Z,2,"0");case"h":return se(1);case"hh":return se(2);case"a":return oe(Z,pe,!0);case"A":return oe(Z,pe,!1);case"m":return String(pe);case"mm":return R.s(pe,2,"0");case"s":return String(W.$s);case"ss":return R.s(W.$s,2,"0");case"SSS":return R.s(W.$ms,3,"0");case"Z":return U}return null}(ce)||U.replace(":","")})},z.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},z.diff=function(L,W,q){var G,U=this,Z=R.p(W),pe=M(L),ae=(pe.utcOffset()-this.utcOffset())*r,de=this-pe,ee=function(){return R.m(U,pe)};switch(Z){case y:G=ee()/12;break;case p:G=ee();break;case m:G=ee()/3;break;case f:G=(de-ae)/6048e5;break;case u:G=(de-ae)/864e5;break;case l:G=de/o;break;case a:G=de/r;break;case s:G=de/n;break;default:G=de}return q?G:R.a(G)},z.daysInMonth=function(){return this.endOf(p).$D},z.$locale=function(){return O[this.$L]},z.locale=function(L,W){if(!L)return this.$L;var q=this.clone(),G=j(L,W,!0);return G&&(q.$L=G),q},z.clone=function(){return R.w(this.$d,this)},z.toDate=function(){return new Date(this.valueOf())},z.toJSON=function(){return this.isValid()?this.toISOString():null},z.toISOString=function(){return this.$d.toISOString()},z.toString=function(){return this.$d.toUTCString()},$}(),F=B.prototype;return M.prototype=F,[["$ms",i],["$s",s],["$m",a],["$H",l],["$W",u],["$M",p],["$y",y],["$D",b]].forEach(function($){F[$[1]]=function(z){return this.$g(z,$[0],$[1])}}),M.extend=function($,z){return $.$i||($(z,B,M),$.$i=!0),M},M.locale=j,M.isDayjs=P,M.unix=function($){return M(1e3*$)},M.en=O[E],M.Ls=O,M.p={},M})}(Yd)),Yd.exports}var O8=M8();const pn=or(O8);var Gd={exports:{}},R8=Gd.exports,vT;function A8(){return vT||(vT=1,function(t,e){(function(n,r){t.exports=r()})(R8,function(){var n="week",r="year";return function(o,i,s){var a=i.prototype;a.week=function(l){if(l===void 0&&(l=null),l!==null)return this.add(7*(l-this.week()),"day");var u=this.$locale().yearStart||1;if(this.month()===11&&this.date()>25){var f=s(this).startOf(r).add(1,r).date(u),p=s(this).endOf(n);if(f.isBefore(p))return 1}var m=s(this).startOf(r).date(u).startOf(n).subtract(1,"millisecond"),y=this.diff(m,n,!0);return y<0?s(this).startOf("week").week():Math.ceil(y)},a.weeks=function(l){return l===void 0&&(l=null),this.week(l)}}})}(Gd)),Gd.exports}var I8=A8();const D8=or(I8);var Jd={exports:{}},P8=Jd.exports,xT;function N8(){return xT||(xT=1,function(t,e){(function(n,r){t.exports=r()})(P8,function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},r=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,o=/\d/,i=/\d\d/,s=/\d\d?/,a=/\d*[^-_:/,()\s\d]+/,l={},u=function(S){return(S=+S)+(S>68?1900:2e3)},f=function(S){return function(C){this[S]=+C}},p=[/[+-]\d\d:?(\d\d)?|Z/,function(S){(this.zone||(this.zone={})).offset=function(C){if(!C||C==="Z")return 0;var _=C.match(/([+-]|\d\d)/g),T=60*_[1]+(+_[2]||0);return T===0?0:_[0]==="+"?-T:T}(S)}],m=function(S){var C=l[S];return C&&(C.indexOf?C:C.s.concat(C.f))},y=function(S,C){var _,T=l.meridiem;if(T){for(var w=1;w<=24;w+=1)if(S.indexOf(T(w,0,C))>-1){_=w>12;break}}else _=S===(C?"pm":"PM");return _},b={A:[a,function(S){this.afternoon=y(S,!1)}],a:[a,function(S){this.afternoon=y(S,!0)}],Q:[o,function(S){this.month=3*(S-1)+1}],S:[o,function(S){this.milliseconds=100*+S}],SS:[i,function(S){this.milliseconds=10*+S}],SSS:[/\d{3}/,function(S){this.milliseconds=+S}],s:[s,f("seconds")],ss:[s,f("seconds")],m:[s,f("minutes")],mm:[s,f("minutes")],H:[s,f("hours")],h:[s,f("hours")],HH:[s,f("hours")],hh:[s,f("hours")],D:[s,f("day")],DD:[i,f("day")],Do:[a,function(S){var C=l.ordinal,_=S.match(/\d+/);if(this.day=_[0],C)for(var T=1;T<=31;T+=1)C(T).replace(/\[|\]/g,"")===S&&(this.day=T)}],w:[s,f("week")],ww:[i,f("week")],M:[s,f("month")],MM:[i,f("month")],MMM:[a,function(S){var C=m("months"),_=(m("monthsShort")||C.map(function(T){return T.slice(0,3)})).indexOf(S)+1;if(_<1)throw new Error;this.month=_%12||_}],MMMM:[a,function(S){var C=m("months").indexOf(S)+1;if(C<1)throw new Error;this.month=C%12||C}],Y:[/[+-]?\d+/,f("year")],YY:[i,function(S){this.year=u(S)}],YYYY:[/\d{4}/,f("year")],Z:p,ZZ:p};function g(S){var C,_;C=S,_=l&&l.formats;for(var T=(S=C.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(M,R,B){var F=B&&B.toUpperCase();return R||_[B]||n[B]||_[F].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function($,z,L){return z||L.slice(1)})})).match(r),w=T.length,E=0;E<w;E+=1){var O=T[E],N=b[O],P=N&&N[0],j=N&&N[1];T[E]=j?{regex:P,parser:j}:O.replace(/^\[|\]$/g,"")}return function(M){for(var R={},B=0,F=0;B<w;B+=1){var $=T[B];if(typeof $=="string")F+=$.length;else{var z=$.regex,L=$.parser,W=M.slice(F),q=z.exec(W)[0];L.call(R,q),M=M.replace(q,"")}}return function(G){var U=G.afternoon;if(U!==void 0){var Z=G.hours;U?Z<12&&(G.hours+=12):Z===12&&(G.hours=0),delete G.afternoon}}(R),R}}return function(S,C,_){_.p.customParseFormat=!0,S&&S.parseTwoDigitYear&&(u=S.parseTwoDigitYear);var T=C.prototype,w=T.parse;T.parse=function(E){var O=E.date,N=E.utc,P=E.args;this.$u=N;var j=P[1];if(typeof j=="string"){var M=P[2]===!0,R=P[3]===!0,B=M||R,F=P[2];R&&(F=P[2]),l=this.$locale(),!M&&F&&(l=_.Ls[F]),this.$d=function(W,q,G,U){try{if(["x","X"].indexOf(q)>-1)return new Date((q==="X"?1e3:1)*W);var Z=g(q)(W),pe=Z.year,ae=Z.month,de=Z.day,ee=Z.hours,he=Z.minutes,fe=Z.seconds,se=Z.milliseconds,oe=Z.zone,ce=Z.week,ge=new Date,J=de||(pe||ae?1:ge.getDate()),te=pe||ge.getFullYear(),Y=0;pe&&!ae||(Y=ae>0?ae-1:ge.getMonth());var le,be=ee||0,Ce=he||0,Me=fe||0,Ne=se||0;return oe?new Date(Date.UTC(te,Y,J,be,Ce,Me,Ne+60*oe.offset*1e3)):G?new Date(Date.UTC(te,Y,J,be,Ce,Me,Ne)):(le=new Date(te,Y,J,be,Ce,Me,Ne),ce&&(le=U(le).week(ce).toDate()),le)}catch{return new Date("")}}(O,j,N,_),this.init(),F&&F!==!0&&(this.$L=this.locale(F).$L),B&&O!=this.format(j)&&(this.$d=new Date("")),l={}}else if(j instanceof Array)for(var $=j.length,z=1;z<=$;z+=1){P[1]=j[z-1];var L=_.apply(this,P);if(L.isValid()){this.$d=L.$d,this.$L=L.$L,this.init();break}z===$&&(this.$d=new Date(""))}else w.call(this,E)}}})}(Jd)),Jd.exports}var j8=N8();const L8=or(j8);var Zd={exports:{}},F8=Zd.exports,ST;function $8(){return ST||(ST=1,function(t,e){(function(n,r){t.exports=r()})(F8,function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};return function(r,o,i){var s=o.prototype,a=s.format;i.en.formats=n,s.format=function(l){l===void 0&&(l="YYYY-MM-DDTHH:mm:ssZ");var u=this.$locale().formats,f=function(p,m){return p.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(y,b,g){var S=g&&g.toUpperCase();return b||m[g]||n[g]||m[S].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(C,_,T){return _||T.slice(1)})})}(l,u===void 0?{}:u);return a.call(this,f)}}})}(Zd)),Zd.exports}var B8=$8();const z8=or(B8);var Xd={exports:{}},V8=Xd.exports,CT;function H8(){return CT||(CT=1,function(t,e){(function(n,r){t.exports=r()})(V8,function(){return function(n,r,o){r.prototype.isBetween=function(i,s,a,l){var u=o(i),f=o(s),p=(l=l||"()")[0]==="(",m=l[1]===")";return(p?this.isAfter(u,a):!this.isBefore(u,a))&&(m?this.isBefore(f,a):!this.isAfter(f,a))||(p?this.isBefore(u,a):!this.isAfter(u,a))&&(m?this.isAfter(f,a):!this.isBefore(f,a))}}})}(Xd)),Xd.exports}var W8=H8();const q8=or(W8);var Qd={exports:{}},U8=Qd.exports,wT;function K8(){return wT||(wT=1,function(t,e){(function(n,r){t.exports=r()})(U8,function(){return function(n,r){var o=r.prototype,i=o.format;o.format=function(s){var a=this,l=this.$locale();if(!this.isValid())return i.bind(this)(s);var u=this.$utils(),f=(s||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,function(p){switch(p){case"Q":return Math.ceil((a.$M+1)/3);case"Do":return l.ordinal(a.$D);case"gggg":return a.weekYear();case"GGGG":return a.isoWeekYear();case"wo":return l.ordinal(a.week(),"W");case"w":case"ww":return u.s(a.week(),p==="w"?1:2,"0");case"W":case"WW":return u.s(a.isoWeek(),p==="W"?1:2,"0");case"k":case"kk":return u.s(String(a.$H===0?24:a.$H),p==="k"?1:2,"0");case"X":return Math.floor(a.$d.getTime()/1e3);case"x":return a.$d.getTime();case"z":return"["+a.offsetName()+"]";case"zzz":return"["+a.offsetName("long")+"]";default:return p}});return i.bind(this)(f)}}})}(Qd)),Qd.exports}var Y8=K8();const G8=or(Y8),TT=new Set;function zR(t,e="warning"){if(process.env.NODE_ENV==="production")return;const n=Array.isArray(t)?t.join(`
106
106
  `):t;TT.has(n)||(TT.add(n),e==="error"?console.error(n):console.warn(n))}pn.extend(z8);pn.extend(D8);pn.extend(q8);pn.extend(G8);const J8={YY:"year",YYYY:{sectionType:"year",contentType:"digit",maxLength:4},M:{sectionType:"month",contentType:"digit",maxLength:2},MM:"month",MMM:{sectionType:"month",contentType:"letter"},MMMM:{sectionType:"month",contentType:"letter"},D:{sectionType:"day",contentType:"digit",maxLength:2},DD:"day",Do:{sectionType:"day",contentType:"digit-with-letter"},d:{sectionType:"weekDay",contentType:"digit",maxLength:2},dd:{sectionType:"weekDay",contentType:"letter"},ddd:{sectionType:"weekDay",contentType:"letter"},dddd:{sectionType:"weekDay",contentType:"letter"},A:"meridiem",a:"meridiem",H:{sectionType:"hours",contentType:"digit",maxLength:2},HH:"hours",h:{sectionType:"hours",contentType:"digit",maxLength:2},hh:"hours",m:{sectionType:"minutes",contentType:"digit",maxLength:2},mm:"minutes",s:{sectionType:"seconds",contentType:"digit",maxLength:2},ss:"seconds"},Z8={year:"YYYY",month:"MMMM",monthShort:"MMM",dayOfMonth:"D",dayOfMonthFull:"Do",weekday:"dddd",weekdayShort:"dd",hours24h:"HH",hours12h:"hh",meridiem:"A",minutes:"mm",seconds:"ss",fullDate:"ll",keyboardDate:"L",shortDate:"MMM D",normalDate:"D MMMM",normalDateWithWeekday:"ddd, MMM D",fullTime:"LT",fullTime12h:"hh:mm A",fullTime24h:"HH:mm",keyboardDateTime:"L LT",keyboardDateTime12h:"L hh:mm A",keyboardDateTime24h:"L HH:mm"},ag=["Missing UTC plugin","To be able to use UTC or timezones, you have to enable the `utc` plugin","Find more information on https://mui.com/x/react-date-pickers/timezone/#day-js-and-utc"].join(`
107
107
  `),_T=["Missing timezone plugin","To be able to use timezones, you have to enable both the `utc` and the `timezone` plugin","Find more information on https://mui.com/x/react-date-pickers/timezone/#day-js-and-timezone"].join(`
@@ -399,4 +399,4 @@ img.ProseMirror-separator {
399
399
  3. "-" cannot repeat`);Wt.customSchemes.push([t,e])}function qde(){Wt.scanner=Lde(Wt.customSchemes);for(let t=0;t<Wt.tokenQueue.length;t++)Wt.tokenQueue[t][1]({scanner:Wt.scanner});Wt.parser=Bde(Wt.scanner.tokens);for(let t=0;t<Wt.pluginQueue.length;t++)Wt.pluginQueue[t][1]({scanner:Wt.scanner,parser:Wt.parser});return Wt.initialized=!0,Wt}function $1(t){return Wt.initialized||qde(),zde(Wt.parser.start,t,ZN(Wt.scanner.start,t))}$1.scan=ZN;function QN(t,e=null,n=null){if(e&&typeof e=="object"){if(n)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);n=e,e=null}const r=new F1(n),o=$1(t),i=[];for(let s=0;s<o.length;s++){const a=o[s];a.isLink&&(!e||a.t===e)&&r.check(a)&&i.push(a.toFormattedObject(r))}return i}function Ude(t){return t.length===1?t[0].isLink:t.length===3&&t[1].isLink?["()","[]"].includes(t[0].value+t[2].value):!1}function Kde(t){return new tn({key:new yn("autolink"),appendTransaction:(e,n,r)=>{const o=e.some(u=>u.docChanged)&&!n.doc.eq(r.doc),i=e.some(u=>u.getMeta("preventAutolink"));if(!o||i)return;const{tr:s}=r,a=Zre(n.doc,[...e]);if(roe(a).forEach(({newRange:u})=>{const f=Qre(r.doc,u,y=>y.isTextblock);let p,m;if(f.length>1?(p=f[0],m=r.doc.textBetween(p.pos,p.pos+p.node.nodeSize,void 0," ")):f.length&&r.doc.textBetween(u.from,u.to," "," ").endsWith(" ")&&(p=f[0],m=r.doc.textBetween(p.pos,u.to,void 0," ")),p&&m){const y=m.split(" ").filter(C=>C!=="");if(y.length<=0)return!1;const b=y[y.length-1],g=p.pos+m.lastIndexOf(b);if(!b)return!1;const S=$1(b).map(C=>C.toObject(t.defaultProtocol));if(!Ude(S))return!1;S.filter(C=>C.isLink).map(C=>({...C,from:g+C.start+1,to:g+C.end+1})).filter(C=>r.schema.marks.code?!r.doc.rangeHasMark(C.from,C.to,r.schema.marks.code):!0).filter(C=>t.validate(C.value)).filter(C=>t.shouldAutoLink(C.value)).forEach(C=>{r1(C.from,C.to,r.doc).some(_=>_.mark.type===t.type)||s.addMark(C.from,C.to,t.type.create({href:C.href}))})}}),!!s.steps.length)return s}})}function Yde(t){return new tn({key:new yn("handleClickLink"),props:{handleClick:(e,n,r)=>{var o,i;if(r.button!==0||!e.editable)return!1;let s=r.target;const a=[];for(;s.nodeName!=="DIV";)a.push(s),s=s.parentNode;if(!a.find(m=>m.nodeName==="A"))return!1;const l=n1(e.state,t.type.name),u=r.target,f=(o=u==null?void 0:u.href)!==null&&o!==void 0?o:l.href,p=(i=u==null?void 0:u.target)!==null&&i!==void 0?i:l.target;return u&&f?(window.open(f,p),!0):!1}}})}function Gde(t){return new tn({key:new yn("handlePasteLink"),props:{handlePaste:(e,n,r)=>{const{state:o}=e,{selection:i}=o,{empty:s}=i;if(s)return!1;let a="";r.content.forEach(u=>{a+=u.textContent});const l=QN(a,{defaultProtocol:t.defaultProtocol}).find(u=>u.isLink&&u.value===a);return!a||!l?!1:t.editor.commands.setMark(t.type,{href:l.href})}}})}const Jde=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g;function Ss(t,e){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(r=>{const o=typeof r=="string"?r:r.scheme;o&&n.push(o)}),!t||t.replace(Jde,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}const Zde=gr.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(t=>{if(typeof t=="string"){r2(t);return}r2(t.scheme,t.optionalSlashes)})},onDestroy(){Wde()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(t,e)=>!!Ss(t,e.protocols),validate:t=>!!t,shouldAutoLink:t=>!!t}},addAttributes(){return{href:{default:null,parseHTML(t){return t.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:t=>{const e=t.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:n=>!!Ss(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:t}){return this.options.isAllowedUri(t.href,{defaultValidate:e=>!!Ss(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",bt(this.options.HTMLAttributes,t),0]:["a",bt(this.options.HTMLAttributes,{...t,href:""}),0]},addCommands(){return{setLink:t=>({chain:e})=>{const{href:n}=t;return this.options.isAllowedUri(n,{defaultValidate:r=>!!Ss(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,t).setMeta("preventAutolink",!0).run():!1},toggleLink:t=>({chain:e})=>{const{href:n}=t;return this.options.isAllowedUri(n,{defaultValidate:r=>!!Ss(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run():!1},unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[Ji({find:t=>{const e=[];if(t){const{protocols:n,defaultProtocol:r}=this.options,o=QN(t).filter(i=>i.isLink&&this.options.isAllowedUri(i.value,{defaultValidate:s=>!!Ss(s,n),protocols:n,defaultProtocol:r}));o.length&&o.forEach(i=>e.push({text:i.value,data:{href:i.href},index:i.start}))}return e},type:this.type,getAttributes:t=>{var e;return{href:(e=t.data)===null||e===void 0?void 0:e.href}}})]},addProseMirrorPlugins(){const t=[],{protocols:e,defaultProtocol:n}=this.options;return this.options.autolink&&t.push(Kde({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:o=>!!Ss(o,e),protocols:e,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),this.options.openOnClick===!0&&t.push(Yde({type:this.type})),this.options.linkOnPaste&&t.push(Gde({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),t}}),ej=en.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",bt(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}});function Xde(t){var e;const{char:n,allowSpaces:r,allowToIncludeChar:o,allowedPrefixes:i,startOfLine:s,$position:a}=t,l=r&&!o,u=Loe(n),f=new RegExp(`\\s${u}$`),p=s?"^":"",m=o?"":u,y=l?new RegExp(`${p}${u}.*?(?=\\s${m}|$)`,"gm"):new RegExp(`${p}(?:^)?${u}[^\\s${m}]*`,"gm"),b=((e=a.nodeBefore)===null||e===void 0?void 0:e.isText)&&a.nodeBefore.text;if(!b)return null;const g=a.pos-b.length,S=Array.from(b.matchAll(y)).pop();if(!S||S.input===void 0||S.index===void 0)return null;const C=S.input.slice(Math.max(0,S.index-1),S.index),_=new RegExp(`^[${i==null?void 0:i.join("")}\0]?$`).test(C);if(i!==null&&!_)return null;const T=g+S.index;let w=T+S[0].length;return l&&f.test(b.slice(w-1,w+1))&&(S[0]+=" ",w+=1),T<a.pos&&w>=a.pos?{range:{from:T,to:w},query:S[0].slice(n.length),text:S[0]}:null}const Qde=new yn("suggestion");function efe({pluginKey:t=Qde,editor:e,char:n="@",allowSpaces:r=!1,allowToIncludeChar:o=!1,allowedPrefixes:i=[" "],startOfLine:s=!1,decorationTag:a="span",decorationClass:l="suggestion",command:u=()=>null,items:f=()=>[],render:p=()=>({}),allow:m=()=>!0,findSuggestionMatch:y=Xde}){let b;const g=p==null?void 0:p(),S=new tn({key:t,view(){return{update:async(C,_)=>{var T,w,E,O,N,P,j;const M=(T=this.key)===null||T===void 0?void 0:T.getState(_),R=(w=this.key)===null||w===void 0?void 0:w.getState(C.state),B=M.active&&R.active&&M.range.from!==R.range.from,F=!M.active&&R.active,$=M.active&&!R.active,z=!F&&!$&&M.query!==R.query,L=F||B&&z,W=z||B,q=$||B&&z;if(!L&&!W&&!q)return;const G=q&&!L?M:R,U=C.dom.querySelector(`[data-decoration-id="${G.decorationId}"]`);b={editor:e,range:G.range,query:G.query,text:G.text,items:[],command:Z=>u({editor:e,range:G.range,props:Z}),decorationNode:U,clientRect:U?()=>{var Z;const{decorationId:pe}=(Z=this.key)===null||Z===void 0?void 0:Z.getState(e.state),ae=C.dom.querySelector(`[data-decoration-id="${pe}"]`);return(ae==null?void 0:ae.getBoundingClientRect())||null}:null},L&&((E=g==null?void 0:g.onBeforeStart)===null||E===void 0||E.call(g,b)),W&&((O=g==null?void 0:g.onBeforeUpdate)===null||O===void 0||O.call(g,b)),(W||L)&&(b.items=await f({editor:e,query:G.query})),q&&((N=g==null?void 0:g.onExit)===null||N===void 0||N.call(g,b)),W&&((P=g==null?void 0:g.onUpdate)===null||P===void 0||P.call(g,b)),L&&((j=g==null?void 0:g.onStart)===null||j===void 0||j.call(g,b))},destroy:()=>{var C;b&&((C=g==null?void 0:g.onExit)===null||C===void 0||C.call(g,b))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(C,_,T,w){const{isEditable:E}=e,{composing:O}=e.view,{selection:N}=C,{empty:P,from:j}=N,M={..._};if(M.composing=O,E&&(P||e.view.composing)){(j<_.range.from||j>_.range.to)&&!O&&!_.composing&&(M.active=!1);const R=y({char:n,allowSpaces:r,allowToIncludeChar:o,allowedPrefixes:i,startOfLine:s,$position:N.$from}),B=`id_${Math.floor(Math.random()*4294967295)}`;R&&m({editor:e,state:w,range:R.range,isActive:_.active})?(M.active=!0,M.decorationId=_.decorationId?_.decorationId:B,M.range=R.range,M.query=R.query,M.text=R.text):M.active=!1}else M.active=!1;return M.active||(M.decorationId=null,M.range={from:0,to:0},M.query=null,M.text=null),M}},props:{handleKeyDown(C,_){var T;const{active:w,range:E}=S.getState(C.state);return w&&((T=g==null?void 0:g.onKeyDown)===null||T===void 0?void 0:T.call(g,{view:C,event:_,range:E}))||!1},decorations(C){const{active:_,range:T,decorationId:w}=S.getState(C);return _?Xt.create(C.doc,[Fn.inline(T.from,T.to,{nodeName:a,class:l,"data-decoration-id":w})]):null}}});return S}const tfe=new yn("mention"),nfe=en.create({name:"mention",priority:101,addOptions(){return{HTMLAttributes:{},renderText({options:t,node:e}){var n;return`${t.suggestion.char}${(n=e.attrs.label)!==null&&n!==void 0?n:e.attrs.id}`},deleteTriggerWithBackspace:!1,renderHTML({options:t,node:e}){var n;return["span",bt(this.HTMLAttributes,t.HTMLAttributes),`${t.suggestion.char}${(n=e.attrs.label)!==null&&n!==void 0?n:e.attrs.id}`]},suggestion:{char:"@",pluginKey:tfe,command:({editor:t,range:e,props:n})=>{var r,o,i;const s=t.view.state.selection.$to.nodeAfter;((r=s==null?void 0:s.text)===null||r===void 0?void 0:r.startsWith(" "))&&(e.to+=1),t.chain().focus().insertContentAt(e,[{type:this.name,attrs:n},{type:"text",text:" "}]).run(),(i=(o=t.view.dom.ownerDocument.defaultView)===null||o===void 0?void 0:o.getSelection())===null||i===void 0||i.collapseToEnd()},allow:({state:t,range:e})=>{const n=t.doc.resolve(e.from),r=t.schema.nodes[this.name];return!!n.parent.type.contentMatch.matchType(r)}}}},group:"inline",inline:!0,selectable:!1,atom:!0,addAttributes(){return{id:{default:null,parseHTML:t=>t.getAttribute("data-id"),renderHTML:t=>t.id?{"data-id":t.id}:{}},label:{default:null,parseHTML:t=>t.getAttribute("data-label"),renderHTML:t=>t.label?{"data-label":t.label}:{}}}},parseHTML(){return[{tag:`span[data-type="${this.name}"]`}]},renderHTML({node:t,HTMLAttributes:e}){if(this.options.renderLabel!==void 0)return console.warn("renderLabel is deprecated use renderText and renderHTML instead"),["span",bt({"data-type":this.name},this.options.HTMLAttributes,e),this.options.renderLabel({options:this.options,node:t})];const n={...this.options};n.HTMLAttributes=bt({"data-type":this.name},this.options.HTMLAttributes,e);const r=this.options.renderHTML({options:n,node:t});return typeof r=="string"?["span",bt({"data-type":this.name},this.options.HTMLAttributes,e),r]:r},renderText({node:t}){return this.options.renderLabel!==void 0?(console.warn("renderLabel is deprecated use renderText and renderHTML instead"),this.options.renderLabel({options:this.options,node:t})):this.options.renderText({options:this.options,node:t})},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command(({tr:t,state:e})=>{let n=!1;const{selection:r}=e,{empty:o,anchor:i}=r;return o?(e.doc.nodesBetween(i-1,i,(s,a)=>{if(s.type.name===this.name)return n=!0,t.insertText(this.options.deleteTriggerWithBackspace?"":this.options.suggestion.char||"",a,a+s.nodeSize),!1}),n):!1})}},addProseMirrorPlugins(){return[efe({editor:this.editor,...this.options.suggestion})]}}),rfe="listItem",o2="textStyle",i2=/^(\d+)\.\s$/,tj=en.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1},type:{default:null,parseHTML:t=>t.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){const{start:e,...n}=t;return e===1?["ol",bt(this.options.HTMLAttributes,n),0]:["ol",bt(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(rfe,this.editor.getAttributes(o2)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=cl({find:i2,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=cl({find:i2,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(o2)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}}),nj=en.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",bt(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),rj=un.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new tn({key:new yn("placeholder"),props:{decorations:({doc:t,selection:e})=>{const n=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=e,o=[];if(!n)return null;const i=this.editor.isEmpty;return t.descendants((s,a)=>{const l=r>=a&&r<=a+s.nodeSize,u=!s.isLeaf&&ch(s);if((l||!this.options.showOnlyCurrent)&&u){const f=[this.options.emptyNodeClass];i&&f.push(this.options.emptyEditorClass);const p=Fn.node(a,a+s.nodeSize,{class:f.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:s,pos:a,hasAnchor:l}):this.options.placeholder});o.push(p)}return this.options.includeChildren}),Xt.create(t,o)}}})]}}),ofe=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,ife=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,oj=gr.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["s",bt(this.options.HTMLAttributes,t),0]},addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[Ys({find:ofe,type:this.type})]},addPasteRules(){return[Ji({find:ife,type:this.type})]}}),sfe=gr.create({name:"subscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sub"},{style:"vertical-align",getAttrs(t){return t!=="sub"?!1:null}}]},renderHTML({HTMLAttributes:t}){return["sub",bt(this.options.HTMLAttributes,t),0]},addCommands(){return{setSubscript:()=>({commands:t})=>t.setMark(this.name),toggleSubscript:()=>({commands:t})=>t.toggleMark(this.name),unsetSubscript:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-,":()=>this.editor.commands.toggleSubscript()}}}),afe=gr.create({name:"superscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sup"},{style:"vertical-align",getAttrs(t){return t!=="super"?!1:null}}]},renderHTML({HTMLAttributes:t}){return["sup",bt(this.options.HTMLAttributes,t),0]},addCommands(){return{setSuperscript:()=>({commands:t})=>t.setMark(this.name),toggleSuperscript:()=>({commands:t})=>t.toggleMark(this.name),unsetSuperscript:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-.":()=>this.editor.commands.toggleSuperscript()}}}),lfe=en.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:t=>{const e=t.getAttribute("colwidth");return e?e.split(",").map(r=>parseInt(r,10)):null}}}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td"}]},renderHTML({HTMLAttributes:t}){return["td",bt(this.options.HTMLAttributes,t),0]}}),cfe=en.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:t=>{const e=t.getAttribute("colwidth");return e?e.split(",").map(r=>parseInt(r,10)):null}}}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th"}]},renderHTML({HTMLAttributes:t}){return["th",bt(this.options.HTMLAttributes,t),0]}}),ufe=en.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:t}){return["tr",bt(this.options.HTMLAttributes,t),0]}}),dfe=/^\s*(\[([( |x])?\])\s$/,ffe=en.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList"}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:t=>{const e=t.getAttribute("data-checked");return e===""||e==="true"},renderHTML:t=>({"data-checked":t.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:t,HTMLAttributes:e}){return["li",bt(this.options.HTMLAttributes,e,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:t.attrs.checked?"checked":null}],["span"]],["div",0]]},addKeyboardShortcuts(){const t={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...t,Tab:()=>this.editor.commands.sinkListItem(this.name)}:t},addNodeView(){return({node:t,HTMLAttributes:e,getPos:n,editor:r})=>{const o=document.createElement("li"),i=document.createElement("label"),s=document.createElement("span"),a=document.createElement("input"),l=document.createElement("div");return i.contentEditable="false",a.type="checkbox",a.addEventListener("mousedown",u=>u.preventDefault()),a.addEventListener("change",u=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){a.checked=!a.checked;return}const{checked:f}=u.target;r.isEditable&&typeof n=="function"&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:p})=>{const m=n();if(typeof m!="number")return!1;const y=p.doc.nodeAt(m);return p.setNodeMarkup(m,void 0,{...y==null?void 0:y.attrs,checked:f}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(t,f)||(a.checked=!a.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([u,f])=>{o.setAttribute(u,f)}),o.dataset.checked=t.attrs.checked,a.checked=t.attrs.checked,i.append(a,s),o.append(i,l),Object.entries(e).forEach(([u,f])=>{o.setAttribute(u,f)}),{dom:o,contentDOM:l,update:u=>u.type!==this.type?!1:(o.dataset.checked=u.attrs.checked,a.checked=u.attrs.checked,!0)}}},addInputRules(){return[cl({find:dfe,type:this.type,getAttributes:t=>({checked:t[t.length-1]==="x"})})]}}),pfe=en.create({name:"taskList",addOptions(){return{itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:t}){return["ul",bt(this.options.HTMLAttributes,t,{"data-type":this.name}),0]},addCommands(){return{toggleTaskList:()=>({commands:t})=>t.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}}),ij=en.create({name:"text",group:"inline"}),hfe=un.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:null}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:t=>{const e=t.style.textAlign;return this.options.alignments.includes(e)?e:this.options.defaultAlignment},renderHTML:t=>t.textAlign?{style:`text-align: ${t.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:t=>({commands:e})=>this.options.alignments.includes(t)?this.options.types.map(n=>e.updateAttributes(n,{textAlign:t})).every(n=>n):!1,unsetTextAlign:()=>({commands:t})=>this.options.types.map(e=>t.resetAttributes(e,"textAlign")).every(e=>e)}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}}),mfe=gr.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["u",bt(this.options.HTMLAttributes,t),0]},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),sj=X.forwardRef((t,e)=>{const[n,r]=X.useState(0),o=l=>{if(l>=t.items.length)return;const u=t.items[l],f={id:u.id,label:u.mentionLabel};t.command(f)},i=()=>{r((n+t.items.length-1)%t.items.length)},s=()=>{r((n+1)%t.items.length)},a=()=>{o(n)};return X.useEffect(()=>r(0),[t.items]),X.useImperativeHandle(e,()=>({onKeyDown:({event:l})=>l.key==="ArrowUp"?(i(),!0):l.key==="ArrowDown"?(s(),!0):l.key==="Enter"?(a(),!0):!1})),t.items.length>0?v.jsx(D.Paper,{elevation:5,children:v.jsx(D.List,{dense:!0,sx:{overflow:"hidden"},children:t.items.map((l,u)=>v.jsx(D.ListItem,{disablePadding:!0,children:v.jsx(D.ListItemButton,{selected:u===n,onClick:()=>o(u),children:l.mentionLabel})},l.id))})}):null});sj.displayName="SuggestionList";const s2={bottom:0,height:0,left:0,right:0,top:0,width:0,x:0,y:0,toJSON(){return{}}},gfe={items:async({query:t})=>Promise.resolve(["Lea Thompson","Cyndi Lauper","Tom Cruise","Madonna","Jerry Hall","Joan Collins","Winona Ryder","Christina Applegate","Alyssa Milano","Molly Ringwald","Ally Sheedy","Debbie Harry","Olivia Newton-John","Elton John","Michael J. Fox","Axl Rose","Emilio Estevez","Ralph Macchio","Rob Lowe","Jennifer Grey","Mickey Rourke","John Cusack","Matthew Broderick","Justine Bateman","Lisa Bonet","Benicio Monserrate Rafael del Toro Sánchez"].map((e,n)=>({mentionLabel:e,id:n.toString()})).filter(e=>e.mentionLabel.toLowerCase().startsWith(t.toLowerCase())).slice(0,5)),render:()=>{let t,e;return{onStart:n=>{t=new qP(sj,{props:n,editor:n.editor}),e=bu("body",{getReferenceClientRect:()=>{var r;return((r=n.clientRect)==null?void 0:r.call(n))??s2},appendTo:()=>document.body,content:t.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start"})[0]},onUpdate(n){t==null||t.updateProps(n),e==null||e.setProps({getReferenceClientRect:()=>{var r;return((r=n.clientRect)==null?void 0:r.call(n))??s2}})},onKeyDown(n){return n.event.key==="Escape"?(e==null||e.hide(),!0):t!=null&&t.ref?t.ref.onKeyDown(n):!1},onExit(){e==null||e.destroy(),t==null||t.destroy(),e=void 0,t=void 0}}}},yfe=Zde.extend({inclusive:!1}),bfe=sfe.extend({excludes:"superscript"}),vfe=afe.extend({excludes:"subscript"});function xfe({placeholder:t}={}){return X.useMemo(()=>[Vue.configure({resizable:!0}),ufe,cfe,lfe,AN,DN,PN,LN,ej,tj,nj,bfe,vfe,ij,RN,ON,IN,WN,mfe,oj,yfe.configure({autolink:!0,linkOnPaste:!0,openOnClick:!1}),jse,jN,Dce,hfe.configure({types:["heading","paragraph","image"]}),tde,nde,ide,Ace,mde.configure({multicolor:!0}),HN,Bce,NN,pfe,ffe.configure({nested:!0}),nfe.configure({suggestion:gfe}),rj.configure({placeholder:t}),VN],[t])}function a2(t){return Array.from(t).filter(e=>(e.type||"").toLowerCase().startsWith("image/"))}const Sfe=t=>{const e=xfe({placeholder:"Add your own content here..."});if(t.renderContentOnly)return v.jsx(cle,{content:t.renderContentOnly,extensions:e});const{name:n,label:r,labelProps:o={fontSize:"0.9em",color:"#808080",fontWeight:"400"},onUploadFiles:i,readOnly:s=!1}=t,[a,l,u]=qt.useField({name:n}),{setValue:f}=u,{value:p}=a;X.useEffect(()=>{var C,_,T;(T=(_=(C=m==null?void 0:m.current)==null?void 0:C.editor)==null?void 0:_.commands)==null||T.setContent(p)},[p]);const m=X.useRef(null),y=X.useCallback((C,_)=>{var w;const T=(w=m.current)==null?void 0:w.editor;if(!(!T||!i))if(i instanceof Promise)i(C).then(E=>{Tv({images:E,editor:T,position:_})});else{const E=i(C);Tv({images:E,editor:T,position:_})}},[]),b=X.useCallback((C,_,T,w)=>{var O;if(!(_ instanceof DragEvent)||!_.dataTransfer)return!1;const E=a2(_.dataTransfer.files);if(E.length>0){const N=(O=C.posAtCoords({left:_.clientX,top:_.clientY}))==null?void 0:O.pos;return y(E,N),_.preventDefault(),!0}return!1},[y]),g=X.useCallback((C,_,T)=>{if(!_.clipboardData)return!1;const w=a2(_.clipboardData.files);return w.length>0?(y(w),!0):!1},[y]),S=v.jsx(D.Box,{sx:{"& .ProseMirror":{"& h1, & h2, & h3, & h4, & h5, & h6":{scrollMarginTop:s?0:50}}},children:v.jsx(ZP,{ref:m,extensions:e,content:p,editable:!s,editorProps:{handleDrop:b,handlePaste:g},renderControls:s?void 0:()=>v.jsx(Hue,{onUploadFiles:i}),onBlur:()=>{var C,_;return f(((_=(C=m.current)==null?void 0:C.editor)==null?void 0:_.getHTML())??"")},RichTextFieldProps:{variant:"outlined",MenuBarProps:{hide:s}},children:()=>v.jsxs(v.Fragment,{children:[v.jsx(OP,{}),v.jsx(XP,{})]})})});return v.jsxs(D.Box,{display:"flex",flexDirection:"column",children:[r&&v.jsx(D.Typography,{...o,children:r}),S]})},$v=t=>{const{title:e="Loading...",message:n}=t;return v.jsxs(D.Box,{className:"loading-page",sx:{gap:2},"data-testid":"loading-page",children:[v.jsxs(D.Box,{className:"text-content",children:[v.jsx(D.Typography,{variant:"h1","data-testid":"title",children:e}),n&&v.jsx(D.Typography,{"data-testid":"message",children:n})]}),v.jsx(D.CircularProgress,{size:75,"data-testid":"loading-spinner"})]})},l2=t=>{const{colSpan:e,isExpanded:n,renderExpand:r,obj:o,asMobileCard:i=!1,reRenderExpand:s=!1}=t,[a,l]=X.useState(!1),[u,f]=X.useState(void 0);X.useEffect(()=>{n&&(!a||s)&&(l(!0),f(r(o)))},[n,o]);const p={"&:last-child td":{borderBottom:"unset"}};return i?v.jsx(D.Collapse,{in:n,children:u}):v.jsx(D.TableRow,{sx:p,children:v.jsx(D.TableCell,{sx:{paddingBottom:0,paddingTop:0},colSpan:e,children:v.jsx(D.Collapse,{in:n,children:u})})})},aj=t=>{const{id:e,getRowKey:n=Y=>"id"in Y&&(typeof Y.id=="string"||typeof Y.id=="number")?Y.id:(console.warn(`Table: "id: string | number" not found in ${JSON.stringify(Y)}. Please implement the Table.getRowKey prop so Table knows how to uniquely identify this row.`),JSON.stringify(Y)),columns:r,data:o=[],onRowClick:i,renderExpand:s,hideColumnsOnMobile:a=[],sortField:l,sortOrder:u,onSortChange:f,allowSortCols:p,fixedLayout:m=!1,className:y,emptyTableMsg:b="No items to display",errorTableMsg:g,retryCallback:S,isLoading:C=!1,disableMobileCards:_=!1,highlightSelectedRow:T=!1,headerRowStyle:w={},stickyHeader:E,reRenderExpand:O=!1,tooltipColor:N,...P}=t,{palette:j}=D.useTheme(),[M,R]=X.useState(void 0),[B,F]=X.useState(void 0);Array.isArray(m)&&(!s&&m.length!==r.length&&console.warn('Table component: Length of "fixedLayout" is not equal to the length of "columns".'),s&&m.length!==r.length+1&&console.warn(`Table component: Length of "fixedLayout" is not equal to the length of "columns"+1. Make sure you're including a percentage for the expand/collapse column AND each column in "columns".`)),s&&i&&console.warn("Table component: renderExpand & onRowClick are both defined. Only one should be defined at a time.");const $=Y=>{Y!==l?f&&f(Y,"asc"):f&&f(l,u==="asc"?"desc":"asc")},z=Y=>l===Y?u:null,L=D.useMediaQuery(D.useTheme().breakpoints.down("sm")),W=L&&a?r.filter(Y=>!(a.includes(Y.fieldName)||Y.hideCol)):r.filter(Y=>!Y.hideCol);s&&!L&&W.unshift({key:"MBv2_Expandable_Column",fieldName:"id",label:"",render:Y=>{const le=M===Y;return v.jsx(D.IconButton,{"data-testid":"expand-collapse-btn","aria-label":le?"collapse row":"expand row",size:"small",onClick:()=>se(Y),children:le?v.jsx(Kd,{"data-testid":"collapse-up"}):v.jsx(sg,{"data-testid":"expand-down"})})}});const q=(Y,le)=>le.split(".").reduce((be,Ce)=>{if(be&&typeof be=="object")return be[Ce]},Y),G=(Y,le)=>{const be=q(le,Y.fieldName);return Y.render?Y.render(be,le,L):be},U=f!==void 0,Z=Y=>U?p?p.includes(Y):!0:!1,pe=v.jsxs(D.Box,{display:"flex",justifyContent:"center",alignItems:"center",flexDirection:"row",children:[v.jsx(u8,{})," ",b]}),ae=v.jsxs(D.Box,{"data-testid":"table-fetch-error-msg",display:"flex",justifyContent:"center",alignItems:"center",flexDirection:"row",children:[v.jsx(OR,{color:"error"})," ",g,S&&v.jsx(D.Button,{variant:"text",onClick:S,children:"Retry?"})]}),de=()=>{if(C)return v.jsx(D.TableRow,{children:v.jsx(D.TableCell,{colSpan:r.length,align:"center",children:v.jsx(D.Box,{display:"flex",justifyContent:"center",alignItems:"center",flexDirection:"row",children:v.jsx($v,{})})})});if(g)return v.jsx(D.TableRow,{children:v.jsx(D.TableCell,{colSpan:r.length,align:"center",children:ae})});if(o.length===0)return v.jsx(D.TableRow,{children:v.jsx(D.TableCell,{colSpan:r.length,align:"center",children:pe})})},ee=()=>{if(C)return v.jsx($v,{});if(g)return ae;if(o.length===0)return pe},he=Y=>{T&&F(Y)},fe=Y=>{i&&(i(Y),he(Y))},se=Y=>{const le=M===Y?void 0:Y;R(le),he(le)},oe=Y=>{if(!s)return;const le=M===n(Y);return v.jsxs(v.Fragment,{children:[v.jsxs(D.Button,{"data-testid":"show-more-less-btn",variant:"text",onClick:()=>se(n(Y)),children:[le?v.jsx(Kd,{}):v.jsx(sg,{})," Show"," ",le?"Less":"More"]}),v.jsx(l2,{colSpan:r.length,isExpanded:n(Y)===M,obj:Y,renderExpand:be=>s(be),asMobileCard:!0})]})},ce=typeof T=="string"?T:j.grey[j.mode=="dark"?600:50],ge=Y=>{const le=B===n(Y)?ce:"inherit";return{cursor:i?"pointer":"default",backgroundColor:le,...s?{"& > td":{borderBottom:"unset"}}:{"&:last-child td":{borderBottom:"unset"}},...i&&{"&:hover":{backgroundColor:le===ce?Za(le,.1):ce}}}},J=j.grey[j.mode==="dark"?600:400],te=Y=>Y&&v.jsx(D.Tooltip,{title:Y,children:v.jsx(l8,{"data-testid":"MBv2_table-tooltip",fontSize:"small",sx:{color:N??J}})});return L&&!_?v.jsxs("div",{...e?{id:`mobile-table-${e}`}:{},className:y,"data-testid":"mui-table-mobile",children:[U&&v.jsxs(v.Fragment,{children:[v.jsxs(D.Box,{display:"flex",className:"MBv2_Table_Stack_Sort",children:[v.jsx(D.TextField,{select:!0,sx:{flexGrow:1},id:"demo-simple-select",size:"small",value:l??"",label:"Sort By...",onChange:Y=>$(Y.target.value),fullWidth:!0,children:W.map(Y=>{if(Z(Y.fieldName))return v.jsx(D.MenuItem,{value:Y.sortName??Y.fieldName,children:Y.label??Mn(Y.fieldName)},`${Y.key??"rowHeader"}-${Y.fieldName}`)})}),v.jsx(D.IconButton,{onClick:()=>{l&&$(l)},children:v.jsx(v8,{className:`sort-icon-${u}`})})]}),v.jsx(D.Divider,{sx:{margin:"10px 0"}})]}),ee()??o.map(Y=>v.jsxs(D.Card,{className:"MBv2_Table_Stack_Container",sx:{margin:"5px 0",padding:"5px",overflowX:"auto",...ge(Y)},onClick:()=>fe(n(Y)),"data-testid":`card-${n(Y)}`,children:[v.jsx("table",{className:"MBv2_Table_Stack",children:v.jsx("tbody",{className:"MBv2_Table_Stack_Body",children:W.map(le=>v.jsxs("tr",{className:"MBv2_Table_Stack_Row",children:[v.jsxs("td",{className:`MBv2_Table_Stack_Cell_Label MBv2_Table_Stack_Col_${le.fieldName}`,style:{textWrap:"nowrap"},children:[le.label??Mn(le.fieldName),te(le.tooltip)]}),v.jsx("td",{className:`MBv2_Table_Stack_Cell_Value MBv2_Table_Stack_Val_${le.fieldName}`,style:{paddingLeft:"10px"},children:G(le,Y)})]},`${le.key??"row"}-${n(Y)}-${le.fieldName}`))})}),oe(Y)]},n(Y)))]}):v.jsx(D.TableContainer,{component:D.Card,"data-testid":"mui-table",...e?{id:`table-${e}`}:{},className:y,style:E?{maxHeight:E,overflow:"auto"}:{},children:v.jsxs(D.Table,{stickyHeader:E!=="undefined",style:{tableLayout:m?"fixed":"auto"},className:"MBv2_Table",sx:w?{"& .MuiTableCell-head":{...w}}:{},...P,children:[v.jsx(D.TableHead,{className:"MBv2_Table_Head",children:v.jsx(D.TableRow,{className:"MBv2_Table_Head_Row",children:W.map((Y,le)=>{const be=Z(Y.fieldName);return v.jsx(D.TableCell,{width:Array.isArray(m)?m[le]:"auto",sx:Y.tableCellSx??{},children:v.jsx(D.Box,{style:{display:"flex",alignItems:"center"},children:v.jsxs(D.Box,{sx:[be&&{"&:hover":{cursor:"pointer",backgroundColor:j.mode==="dark"?"#222222":"#ededed",borderRadius:2}}],style:{display:"flex",alignItems:"center",padding:"5px",paddingLeft:"6px",marginLeft:"-6px"},onClick:be?()=>$(Y.sortName??Y.fieldName):void 0,children:[v.jsx("strong",{className:"MBv2_Table_Col_Label",style:{wordBreak:"normal"},children:Y.label??Mn(Y.fieldName)}),te(Y.tooltip),be&&z(Y.fieldName)==="asc"&&v.jsx(Kd,{style:{marginLeft:"5px"}}),be&&z(Y.fieldName)==="desc"&&v.jsx(sg,{style:{marginLeft:"5px"}}),be&&z(Y.fieldName)!=="asc"&&z(Y.fieldName)!=="desc"&&v.jsx(g8,{style:{marginLeft:"5px"}})]})})},`${Y.key??"rowHeader"}-${Y.fieldName}`)})})}),v.jsx(D.TableBody,{className:"MBv2_Table_Body",children:de()??o.map(Y=>v.jsxs(X.Fragment,{children:[v.jsx(D.TableRow,{"data-testid":`row-${n(Y)}`,className:"MBv2_Table_Body_Row",onClick:()=>fe(n(Y)),sx:ge(Y),children:W.map(le=>v.jsx(D.TableCell,{className:`MBv2_Table_Body_Cell MBv2_Table_Body_Col_${le.fieldName}`,children:G(le,Y)},`${le.key??"row"}-${n(Y)}-${le.fieldName}`))}),s&&v.jsx(l2,{colSpan:W.length,isExpanded:n(Y)===M,obj:Y,renderExpand:le=>s(le),reRenderExpand:O})]},n(Y)))})]})})},lj=t=>{const{paginationState:e,onPageChange:n,onRowsPerPageChange:r,hidePaginationControls:o=!1,rowsPerPageOptions:i=[5,10,25],...s}=t,{pageNo:a,pageSize:l,totalCount:u,sortField:f,sortOrder:p}=e,m=S=>{n(S)},y=S=>{r(parseInt(S.target.value,10))},b=D.useMediaQuery(D.useTheme().breakpoints.down("sm")),g=!t.data||t.data&&t.data.length===0;return v.jsxs(D.Box,{children:[v.jsx(aj,{sortOrder:p,sortField:f,...s}),!o&&!g&&v.jsx(D.TablePagination,{"data-testid":"pagination-controls",component:"div",rowsPerPageOptions:b?[]:i,count:u,rowsPerPage:l,page:a,onPageChange:(S,C)=>m(C),onRowsPerPageChange:y,sx:{flexGrow:1,marginRight:{xs:0,md:15}}})]})},c2=()=>({height:window.innerHeight,width:window.innerWidth}),cj=()=>{const[t,e]=X.useState(c2());return X.useEffect(()=>{const n=()=>{e(c2())};return window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[]),t},qr=t=>{const{name:e="button",color:n="primary",fullWidthOnMobile:r=!0,type:o="button",variant:i="contained"}=t,{width:s}=cj(),a=["locationInBar","closeDialog","fullWidthOnMobile"],l=r&&s<600;return v.jsx(D.Button,{role:"button",name:e,color:n,variant:i,type:o,fullWidth:t.fullWidth?!0:l,...er({...t},a)})},Cfe=t=>{const{citation:e,anchorEl:n,onClose:r}=t;return v.jsx(D.Popper,{open:e!==null,anchorEl:n,placement:"bottom-end",style:{zIndex:1300},children:e&&v.jsxs(D.Box,{component:D.Paper,p:1,display:"flex",gap:1,boxShadow:9,"data-testid":`citation-table_launch-link-prompt-${e.id}`,flexDirection:"column",alignItems:"end",children:[v.jsxs(D.Typography,{variant:"body2",sx:{wordBreak:"break-all",maxWidth:"350px"},children:["Are you sure you want to go to ",v.jsx("br",{}),v.jsx("b",{children:e.url}),"?"]}),v.jsxs(D.Box,{display:"flex",flexDirection:"row",children:[v.jsx(qr,{size:"small",variant:"text",onClick:r,"data-testid":`citation-table_launch-prompt-${e.id}-noBtn`,children:"No"}),v.jsx(qr,{size:"small",startIcon:v.jsx($R,{}),onClick:()=>{window.open(e.url,"_blank","noopener,noreferrer"),r()},"data-testid":`citation-table_launch-prompt-${e.id}-yesBtn`,children:"Yes"})]})]})})},wfe=t=>{const{citation:e,anchorEl:n,onDeleteCitation:r,onClose:o}=t;if(r)return v.jsx(D.Popper,{open:e!==null,anchorEl:n,placement:"bottom-end",style:{zIndex:1300},children:e&&v.jsxs(D.Box,{component:D.Paper,p:1,display:"flex",gap:1,boxShadow:9,"data-testid":`citation-table_delete-prompt-${e.id}`,children:[v.jsxs(D.Typography,{variant:"body2",children:["Are you sure you want to delete this ",e.fileName?"attachment":"citation","?"]}),v.jsxs(D.Box,{display:"flex",flexDirection:"row",children:[v.jsx(qr,{size:"small",variant:"text",onClick:o,"data-testid":`citation-table_delete-prompt-${e.id}-noBtn`,children:"No"}),v.jsx(qr,{size:"small",color:"error",startIcon:v.jsx(Zv,{}),onClick:()=>r(e.id).finally(o),"data-testid":`citation-table_delete-prompt-${e.id}-yesBtn`,children:"Yes"})]})]})})},Tfe=t=>{const{refreshKey:e,title:n,onCancel:r,onNewCitation:o,onNewAttachment:i,onEditCitation:s,onEditAttachment:a,onDeleteCitation:l,onDownloadAttachment:u,onSelect:f,getCitationsPaginated:p,selectedIds:m,setSelectedIds:y,onError:b=()=>{},condenseTable:g=!1,canSelect:S=!1,canLaunchUrl:C,addlActions:_,readOnly:T=!1,showCloseBtn:w=!1}=t,E=!!t.canCreate&&!T,O=!!t.canEdit&&!T,N=!!t.canDelete&&!T,{palette:P}=D.useTheme(),[j,M]=X.useState([]),[R,B]=X.useState(!1),[F,$]=X.useState(!0),[z,L]=X.useState(null),[W,q]=X.useState(null),[G,U]=X.useState(null),[Z,pe]=X.useState({pageNo:0,pageSize:g?5:10,totalCount:0}),ae=()=>{B(!1),$(!0),p({pageNo:Z.pageNo,pageSize:Z.pageSize}).then(J=>(M(J.data),pe({...Z,totalCount:J.totalCount}),J)).catch(J=>{b(J),B(!0),M([])}).finally(()=>$(!1))};X.useEffect(ae,[Z.pageNo,Z.pageSize,e]);const de=()=>{q(null),U(null),L(null)},ee=v.jsx(qr,{variant:S?"outlined":"contained",size:S?"small":"medium",onClick:o,startIcon:v.jsx(bf,{}),children:"Add Citation"}),he=v.jsx(qr,{variant:S?"outlined":"contained",size:S?"small":"medium",onClick:i,startIcon:v.jsx(yT,{}),children:"Add Attachment"}),fe=J=>{if(!(!O&&!T)&&!(T&&!g))return v.jsx(D.Tooltip,{title:T?"View":"Edit",children:v.jsx(D.IconButton,{color:"primary",onClick:()=>J.fileName?a(J):s(J),"data-testid":`citation-table_edit-btn-${J.id}`,children:T?v.jsx(T8,{}):v.jsx(qq,{})})})},se=J=>{if(!(!N||T))return v.jsx(D.Tooltip,{title:"Delete",children:v.jsx(D.IconButton,{color:"error",onClick:te=>{q(J),L(te.currentTarget)},"data-testid":`citation-table_delete-btn-${J.id}`,children:v.jsx(Zv,{})})})},oe=J=>!u&&!C?void 0:J.fileName?v.jsx(D.Tooltip,{title:"Download",children:v.jsx(D.IconButton,{color:"primary",onClick:()=>u==null?void 0:u(J),"data-testid":`citation-table_download-btn-${J.id}`,sx:{visibility:u?"visible":"hidden"},children:v.jsx(Wq,{})})}):v.jsx(D.Tooltip,{title:"Open URL",children:v.jsx(D.IconButton,{color:"primary",onClick:Y=>{L(Y.currentTarget),U(J)},"data-testid":`citation-table_launch-link-btn-${J.id}`,sx:{visibility:C!=null&&C(J)?"visible":"hidden"},children:v.jsx($R,{})})}),ge=[{fieldName:"id",key:"select",label:"",hideCol:!S,render:(J,te)=>v.jsx(D.Checkbox,{"data-testid":`citation-table_checkbox-${J}`,onChange:()=>{const Y=m.includes(te.id);y(Y?m.filter(le=>le!==te.id):[...m,te.id])},checked:m.includes(J),disabled:T})},{fieldName:"fileName",key:"CitationOrAttachment",label:"Type",render:(J,te)=>v.jsx(D.Tooltip,{title:J?"Attachment":"URL",children:J?v.jsx(yT,{sx:{color:P.grey[500],marginTop:"4px"},"data-testid":`attachment-icon-${te.id}`}):v.jsx(bf,{sx:{color:P.grey[500],marginTop:"6px"},"data-testid":`url-icon-${te.id}`})})},{fieldName:"title",tableCellSx:{width:g?"100%":"auto"}},{fieldName:"fileName",key:"URL/File Name",label:"URL/File Name",hideCol:g,render:(J,te)=>v.jsx("span",{style:{wordBreak:"break-all"},children:J||te.url})},{fieldName:"source",hideCol:g},{fieldName:"accessedAt",hideCol:g,render:(J,te)=>{if(!te.fileName)return(J==null?void 0:J.slice(0,10))??""}},{fieldName:"classification",hideCol:g},{fieldName:"id",key:"Action",label:"Action",hideCol:!(T||O||N||C||u||_),render:(J,te)=>v.jsxs(D.Box,{display:"flex",flexDirection:"row",children:[oe(te),fe(te),se(te),_==null?void 0:_(te)]})}];return v.jsxs(v.Fragment,{children:[v.jsxs(D.Box,{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingBottom:"10px",children:[v.jsx(D.Typography,{variant:g?"h6":"h2",children:n}),!S&&E&&v.jsxs(D.Box,{display:"flex",flexDirection:"row",gap:1,children:[ee,he]}),w&&v.jsx(D.IconButton,{onClick:r,children:v.jsx(Dp,{})})]}),v.jsx(lj,{"data-testid":"citation-table",size:g?"x-small":"medium",isLoading:F,columns:ge,data:j,paginationState:Z,onPageChange:J=>pe({...Z,pageNo:J}),onRowsPerPageChange:J=>pe({...Z,pageSize:J,pageNo:0}),errorTableMsg:R?"Failed to load citations.":void 0,retryCallback:ae}),S&&v.jsxs(D.Box,{display:"flex",flexDirection:"row",justifyContent:"space-between",marginTop:"20px",children:[v.jsx(D.Box,{display:"flex",flexDirection:"row",gap:".25rem",children:E&&v.jsxs(v.Fragment,{children:[ee,he]})}),!T&&v.jsxs(D.Box,{display:"flex",flexDirection:"row",gap:".25rem",children:[v.jsx(qr,{variant:"outlined",size:"small",onClick:r,children:"Cancel"}),v.jsxs(qr,{variant:"contained",size:"small",onClick:()=>f(m),children:["Select",m.length>0&&` (${m.length})`]})]})]}),v.jsx(Cfe,{citation:G,anchorEl:z,onClose:de}),v.jsx(wfe,{citation:W,anchorEl:z,onDeleteCitation:l,onClose:de})]})},B1=t=>{const{loading:e=!1,type:n="submit",size:r="medium",...o}=t,s={small:16,medium:20,large:24}[r];return v.jsx(qr,{type:n,disabled:e,size:r,startIcon:e?v.jsx(D.CircularProgress,{size:s,color:"inherit"}):null,...o})},_fe=t=>{const{title:e,onSave:n,onCancel:r,modifyCitation:o,readOnly:i=!1,showCloseBtn:s=!1}=t,a=X.useRef(null),[l,u]=X.useState(!1),[f,p]=X.useState({type:"Url",source:"",title:"",accessedAt:null,url:"",classification:""});X.useEffect(()=>{o&&p({...o,type:"Url"})},[]);const m=()=>{var b,g,S;const y=(g=(b=a==null?void 0:a.current)==null?void 0:b.values)==null?void 0:g.url;y&&((S=a==null?void 0:a.current)==null||S.setFieldValue("url",EP(y)))};return v.jsxs(v.Fragment,{children:[v.jsxs(D.Box,{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",children:[v.jsx(D.Typography,{variant:"h6",margin:"10px 0",children:e}),s&&v.jsx(D.IconButton,{onClick:r,children:v.jsx(Dp,{})})]}),v.jsx(qt.Formik,{innerRef:a,enableReinitialize:!0,initialValues:f,onSubmit:async y=>{u(!0),n(y).catch(b=>{throw u(!1),b}).finally(()=>u(!1))},children:v.jsxs(qt.Form,{autoComplete:"off",children:[v.jsxs(D.Box,{display:"flex",flexDirection:"column",gap:i?1:0,children:[v.jsx(Ps,{name:"source",disabled:l,required:!0,margin:"none",readOnly:i}),v.jsx(Ps,{name:"title",disabled:l,required:!0,margin:"none",readOnly:i}),v.jsx(Ef,{name:"accessedAt",disabled:l,required:!0,margin:"none",isDatePicker:!0,readOnly:i}),v.jsx(Ps,{name:"url",disabled:l,required:!0,onBlur:m,margin:"none",readOnly:i}),v.jsx(LR,{row:!0,name:"classification",required:!0,radios:[{label:"Public Source",value:"Public Source",helperText:"URL is accessible to anyone from any location without special permissions. You can safely access this URL on any computer, including public or shared devices."},{label:"Proprietary Source",value:"Proprietary Source",helperText:"For private, sensitive, or access-controlled content. Use a VPN, or take extra precautions, when accessing to protect your privacy."}],margin:"none",readOnly:i})]}),v.jsx(D.DialogActions,{sx:{px:0},children:i?v.jsx(D.Button,{onClick:r,size:"small",variant:"contained",children:"Back to Table"}):v.jsxs(v.Fragment,{children:[v.jsx(D.Button,{onClick:r,variant:"outlined",size:"small",children:"Cancel"}),v.jsx(B1,{size:"small",loading:l,children:o?"Update Citation":"Add New Citation"})]})})]})})]})};var I0,u2;function kfe(){if(u2)return I0;u2=1;function t(C){this._maxSize=C,this.clear()}t.prototype.clear=function(){this._size=0,this._values=Object.create(null)},t.prototype.get=function(C){return this._values[C]},t.prototype.set=function(C,_){return this._size>=this._maxSize&&this.clear(),C in this._values||this._size++,this._values[C]=_};var e=/[^.^\]^[]+|(?=\[\]|\.\.)/g,n=/^\d+$/,r=/^\d/,o=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,i=/^\s*(['"]?)(.*?)(\1)\s*$/,s=512,a=new t(s),l=new t(s),u=new t(s);I0={Cache:t,split:p,normalizePath:f,setter:function(C){var _=f(C);return l.get(C)||l.set(C,function(w,E){for(var O=0,N=_.length,P=w;O<N-1;){var j=_[O];if(j==="__proto__"||j==="constructor"||j==="prototype")return w;P=P[_[O++]]}P[_[O]]=E})},getter:function(C,_){var T=f(C);return u.get(C)||u.set(C,function(E){for(var O=0,N=T.length;O<N;)if(E!=null||!_)E=E[T[O++]];else return;return E})},join:function(C){return C.reduce(function(_,T){return _+(y(T)||n.test(T)?"["+T+"]":(_?".":"")+T)},"")},forEach:function(C,_,T){m(Array.isArray(C)?C:p(C),_,T)}};function f(C){return a.get(C)||a.set(C,p(C).map(function(_){return _.replace(i,"$2")}))}function p(C){return C.match(e)||[""]}function m(C,_,T){var w=C.length,E,O,N,P;for(O=0;O<w;O++)E=C[O],E&&(S(E)&&(E='"'+E+'"'),P=y(E),N=!P&&/^\d+$/.test(E),_.call(T,E,P,N,O,C))}function y(C){return typeof C=="string"&&C&&["'",'"'].indexOf(C.charAt(0))!==-1}function b(C){return C.match(r)&&!C.match(n)}function g(C){return o.test(C)}function S(C){return!y(C)&&(b(C)||g(C))}return I0}var zs=kfe(),D0,d2;function Efe(){if(d2)return D0;d2=1;const t=/[A-Z\xc0-\xd6\xd8-\xde]?[a-z\xdf-\xf6\xf8-\xff]+(?:['’](?:d|ll|m|re|s|t|ve))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde]|$)|(?:[A-Z\xc0-\xd6\xd8-\xde]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde](?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])|$)|[A-Z\xc0-\xd6\xd8-\xde]?(?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:d|ll|m|re|s|t|ve))?|[A-Z\xc0-\xd6\xd8-\xde]+(?:['’](?:D|LL|M|RE|S|T|VE))?|\d*(?:1ST|2ND|3RD|(?![123])\dTH)(?=\b|[a-z_])|\d*(?:1st|2nd|3rd|(?![123])\dth)(?=\b|[A-Z_])|\d+|(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?)*/g,e=f=>f.match(t)||[],n=f=>f[0].toUpperCase()+f.slice(1),r=(f,p)=>e(f).join(p).toLowerCase(),o=f=>e(f).reduce((p,m)=>`${p}${p?m[0].toUpperCase()+m.slice(1).toLowerCase():m.toLowerCase()}`,"");return D0={words:e,upperFirst:n,camelCase:o,pascalCase:f=>n(o(f)),snakeCase:f=>r(f,"_"),kebabCase:f=>r(f,"-"),sentenceCase:f=>n(r(f," ")),titleCase:f=>e(f).map(n).join(" ")},D0}var P0=Efe(),Vd={exports:{}},f2;function Mfe(){if(f2)return Vd.exports;f2=1,Vd.exports=function(o){return t(e(o),o)},Vd.exports.array=t;function t(o,i){var s=o.length,a=new Array(s),l={},u=s,f=n(i),p=r(o);for(i.forEach(function(y){if(!p.has(y[0])||!p.has(y[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});u--;)l[u]||m(o[u],u,new Set);return a;function m(y,b,g){if(g.has(y)){var S;try{S=", node was:"+JSON.stringify(y)}catch{S=""}throw new Error("Cyclic dependency"+S)}if(!p.has(y))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(y));if(!l[b]){l[b]=!0;var C=f.get(y)||new Set;if(C=Array.from(C),b=C.length){g.add(y);do{var _=C[--b];m(_,p.get(_),g)}while(b);g.delete(y)}a[--s]=y}}}function e(o){for(var i=new Set,s=0,a=o.length;s<a;s++){var l=o[s];i.add(l[0]),i.add(l[1])}return Array.from(i)}function n(o){for(var i=new Map,s=0,a=o.length;s<a;s++){var l=o[s];i.has(l[0])||i.set(l[0],new Set),i.has(l[1])||i.set(l[1],new Set),i.get(l[0]).add(l[1])}return i}function r(o){for(var i=new Map,s=0,a=o.length;s<a;s++)i.set(o[s],s);return i}return Vd.exports}var Ofe=Mfe();const Rfe=or(Ofe),Afe=Object.prototype.toString,Ife=Error.prototype.toString,Dfe=RegExp.prototype.toString,Pfe=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",Nfe=/^Symbol\((.*)\)(.*)$/;function jfe(t){return t!=+t?"NaN":t===0&&1/t<0?"-0":""+t}function p2(t,e=!1){if(t==null||t===!0||t===!1)return""+t;const n=typeof t;if(n==="number")return jfe(t);if(n==="string")return e?`"${t}"`:t;if(n==="function")return"[Function "+(t.name||"anonymous")+"]";if(n==="symbol")return Pfe.call(t).replace(Nfe,"Symbol($1)");const r=Afe.call(t).slice(8,-1);return r==="Date"?isNaN(t.getTime())?""+t:t.toISOString(t):r==="Error"||t instanceof Error?"["+Ife.call(t)+"]":r==="RegExp"?Dfe.call(t):null}function Ui(t,e){let n=p2(t,e);return n!==null?n:JSON.stringify(t,function(r,o){let i=p2(this[r],e);return i!==null?i:o},2)}function uj(t){return t==null?[]:[].concat(t)}let dj,fj,pj,Lfe=/\$\{\s*(\w+)\s*\}/g;dj=Symbol.toStringTag;class h2{constructor(e,n,r,o){this.name=void 0,this.message=void 0,this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=void 0,this.inner=void 0,this[dj]="Error",this.name="ValidationError",this.value=n,this.path=r,this.type=o,this.errors=[],this.inner=[],uj(e).forEach(i=>{if(fr.isError(i)){this.errors.push(...i.errors);const s=i.inner.length?i.inner:[i];this.inner.push(...s)}else this.errors.push(i)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0]}}fj=Symbol.hasInstance;pj=Symbol.toStringTag;class fr extends Error{static formatError(e,n){const r=n.label||n.path||"this";return n=Object.assign({},n,{path:r,originalPath:n.path}),typeof e=="string"?e.replace(Lfe,(o,i)=>Ui(n[i])):typeof e=="function"?e(n):e}static isError(e){return e&&e.name==="ValidationError"}constructor(e,n,r,o,i){const s=new h2(e,n,r,o);if(i)return s;super(),this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=[],this.inner=[],this[pj]="Error",this.name=s.name,this.message=s.message,this.type=s.type,this.value=s.value,this.path=s.path,this.errors=s.errors,this.inner=s.inner,Error.captureStackTrace&&Error.captureStackTrace(this,fr)}static[fj](e){return h2[Symbol.hasInstance](e)||super[Symbol.hasInstance](e)}}let _o={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:t,type:e,value:n,originalValue:r})=>{const o=r!=null&&r!==n?` (cast from the value \`${Ui(r,!0)}\`).`:".";return e!=="mixed"?`${t} must be a \`${e}\` type, but the final value was: \`${Ui(n,!0)}\``+o:`${t} must match the configured type. The validated value was: \`${Ui(n,!0)}\``+o}},ur={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",datetime:"${path} must be a valid ISO date-time",datetime_precision:"${path} must be a valid ISO date-time with a sub-second precision of exactly ${precision} digits",datetime_offset:'${path} must be a valid ISO date-time with UTC "Z" timezone',trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},Ffe={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},Bv={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},$fe={isValue:"${path} field must be ${value}"},ff={noUnknown:"${path} field has unspecified keys: ${unknown}",exact:"${path} object contains unknown properties: ${properties}"},Bfe={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"},zfe={notType:t=>{const{path:e,value:n,spec:r}=t,o=r.types.length;if(Array.isArray(n)){if(n.length<o)return`${e} tuple value has too few items, expected a length of ${o} but got ${n.length} for value: \`${Ui(n,!0)}\``;if(n.length>o)return`${e} tuple value has too many items, expected a length of ${o} but got ${n.length} for value: \`${Ui(n,!0)}\``}return fr.formatError(_o.notType,t)}};Object.assign(Object.create(null),{mixed:_o,string:ur,number:Ffe,date:Bv,object:ff,array:Bfe,boolean:$fe,tuple:zfe});const z1=t=>t&&t.__isYupSchema__;class yp{static fromOptions(e,n){if(!n.then&&!n.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:r,then:o,otherwise:i}=n,s=typeof r=="function"?r:(...a)=>a.every(l=>l===r);return new yp(e,(a,l)=>{var u;let f=s(...a)?o:i;return(u=f==null?void 0:f(l))!=null?u:l})}constructor(e,n){this.fn=void 0,this.refs=e,this.refs=e,this.fn=n}resolve(e,n){let r=this.refs.map(i=>i.getValue(n==null?void 0:n.value,n==null?void 0:n.parent,n==null?void 0:n.context)),o=this.fn(r,e,n);if(o===void 0||o===e)return e;if(!z1(o))throw new TypeError("conditions must return a schema object");return o.resolve(n)}}const Hd={context:"$",value:"."};class na{constructor(e,n={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,typeof e!="string")throw new TypeError("ref must be a string, got: "+e);if(this.key=e.trim(),e==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===Hd.context,this.isValue=this.key[0]===Hd.value,this.isSibling=!this.isContext&&!this.isValue;let r=this.isContext?Hd.context:this.isValue?Hd.value:"";this.path=this.key.slice(r.length),this.getter=this.path&&zs.getter(this.path,!0),this.map=n.map}getValue(e,n,r){let o=this.isContext?r:this.isValue?e:n;return this.getter&&(o=this.getter(o||{})),this.map&&(o=this.map(o)),o}cast(e,n){return this.getValue(e,n==null?void 0:n.parent,n==null?void 0:n.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(e){return e&&e.__isYupRef}}na.prototype.__isYupRef=!0;const Ds=t=>t==null;function Ia(t){function e({value:n,path:r="",options:o,originalValue:i,schema:s},a,l){const{name:u,test:f,params:p,message:m,skipAbsent:y}=t;let{parent:b,context:g,abortEarly:S=s.spec.abortEarly,disableStackTrace:C=s.spec.disableStackTrace}=o;function _(R){return na.isRef(R)?R.getValue(n,b,g):R}function T(R={}){const B=Object.assign({value:n,originalValue:i,label:s.spec.label,path:R.path||r,spec:s.spec,disableStackTrace:R.disableStackTrace||C},p,R.params);for(const $ of Object.keys(B))B[$]=_(B[$]);const F=new fr(fr.formatError(R.message||m,B),n,B.path,R.type||u,B.disableStackTrace);return F.params=B,F}const w=S?a:l;let E={path:r,parent:b,type:u,from:o.from,createError:T,resolve:_,options:o,originalValue:i,schema:s};const O=R=>{fr.isError(R)?w(R):R?l(null):w(T())},N=R=>{fr.isError(R)?w(R):a(R)};if(y&&Ds(n))return O(!0);let j;try{var M;if(j=f.call(E,n,E),typeof((M=j)==null?void 0:M.then)=="function"){if(o.sync)throw new Error(`Validation test of type: "${E.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(j).then(O,N)}}catch(R){N(R);return}O(j)}return e.OPTIONS=t,e}function Vfe(t,e,n,r=n){let o,i,s;return e?(zs.forEach(e,(a,l,u)=>{let f=l?a.slice(1,a.length-1):a;t=t.resolve({context:r,parent:o,value:n});let p=t.type==="tuple",m=u?parseInt(f,10):0;if(t.innerType||p){if(p&&!u)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${s}" must contain an index to the tuple element, e.g. "${s}[0]"`);if(n&&m>=n.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${a}, in the path: ${e}. because there is no value at that index. `);o=n,n=n&&n[m],t=p?t.spec.types[m]:t.innerType}if(!u){if(!t.fields||!t.fields[f])throw new Error(`The schema does not contain the path: ${e}. (failed at: ${s} which is a type: "${t.type}")`);o=n,n=n&&n[f],t=t.fields[f]}i=f,s=l?"["+a+"]":"."+a}),{schema:t,parent:o,parentPath:i}):{parent:o,parentPath:e,schema:t}}class bp extends Set{describe(){const e=[];for(const n of this.values())e.push(na.isRef(n)?n.describe():n);return e}resolveAll(e){let n=[];for(const r of this.values())n.push(e(r));return n}clone(){return new bp(this.values())}merge(e,n){const r=this.clone();return e.forEach(o=>r.add(o)),n.forEach(o=>r.delete(o)),r}}function za(t,e=new Map){if(z1(t)||!t||typeof t!="object")return t;if(e.has(t))return e.get(t);let n;if(t instanceof Date)n=new Date(t.getTime()),e.set(t,n);else if(t instanceof RegExp)n=new RegExp(t),e.set(t,n);else if(Array.isArray(t)){n=new Array(t.length),e.set(t,n);for(let r=0;r<t.length;r++)n[r]=za(t[r],e)}else if(t instanceof Map){n=new Map,e.set(t,n);for(const[r,o]of t.entries())n.set(r,za(o,e))}else if(t instanceof Set){n=new Set,e.set(t,n);for(const r of t)n.add(za(r,e))}else if(t instanceof Object){n={},e.set(t,n);for(const[r,o]of Object.entries(t))n[r]=za(o,e)}else throw Error(`Unable to clone ${t}`);return n}class jo{constructor(e){this.type=void 0,this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this.internalTests={},this._whitelist=new bp,this._blacklist=new bp,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(_o.notType)}),this.type=e.type,this._typeCheck=e.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,disableStackTrace:!1,nullable:!1,optional:!0,coerce:!0},e==null?void 0:e.spec),this.withMutation(n=>{n.nonNullable()})}get _type(){return this.type}clone(e){if(this._mutate)return e&&Object.assign(this.spec,e),this;const n=Object.create(Object.getPrototypeOf(this));return n.type=this.type,n._typeCheck=this._typeCheck,n._whitelist=this._whitelist.clone(),n._blacklist=this._blacklist.clone(),n.internalTests=Object.assign({},this.internalTests),n.exclusiveTests=Object.assign({},this.exclusiveTests),n.deps=[...this.deps],n.conditions=[...this.conditions],n.tests=[...this.tests],n.transforms=[...this.transforms],n.spec=za(Object.assign({},this.spec,e)),n}label(e){let n=this.clone();return n.spec.label=e,n}meta(...e){if(e.length===0)return this.spec.meta;let n=this.clone();return n.spec.meta=Object.assign(n.spec.meta||{},e[0]),n}withMutation(e){let n=this._mutate;this._mutate=!0;let r=e(this);return this._mutate=n,r}concat(e){if(!e||e===this)return this;if(e.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${e.type}`);let n=this,r=e.clone();const o=Object.assign({},n.spec,r.spec);return r.spec=o,r.internalTests=Object.assign({},n.internalTests,r.internalTests),r._whitelist=n._whitelist.merge(e._whitelist,e._blacklist),r._blacklist=n._blacklist.merge(e._blacklist,e._whitelist),r.tests=n.tests,r.exclusiveTests=n.exclusiveTests,r.withMutation(i=>{e.tests.forEach(s=>{i.test(s.OPTIONS)})}),r.transforms=[...n.transforms,...r.transforms],r}isType(e){return e==null?!!(this.spec.nullable&&e===null||this.spec.optional&&e===void 0):this._typeCheck(e)}resolve(e){let n=this;if(n.conditions.length){let r=n.conditions;n=n.clone(),n.conditions=[],n=r.reduce((o,i)=>i.resolve(o,e),n),n=n.resolve(e)}return n}resolveOptions(e){var n,r,o,i;return Object.assign({},e,{from:e.from||[],strict:(n=e.strict)!=null?n:this.spec.strict,abortEarly:(r=e.abortEarly)!=null?r:this.spec.abortEarly,recursive:(o=e.recursive)!=null?o:this.spec.recursive,disableStackTrace:(i=e.disableStackTrace)!=null?i:this.spec.disableStackTrace})}cast(e,n={}){let r=this.resolve(Object.assign({value:e},n)),o=n.assert==="ignore-optionality",i=r._cast(e,n);if(n.assert!==!1&&!r.isType(i)){if(o&&Ds(i))return i;let s=Ui(e),a=Ui(i);throw new TypeError(`The value of ${n.path||"field"} could not be cast to a value that satisfies the schema type: "${r.type}".
400
400
 
401
401
  attempted value: ${s}
402
- `+(a!==s?`result of cast: ${a}`:""))}return i}_cast(e,n){let r=e===void 0?e:this.transforms.reduce((o,i)=>i.call(this,o,e,this),e);return r===void 0&&(r=this.getDefault(n)),r}_validate(e,n={},r,o){let{path:i,originalValue:s=e,strict:a=this.spec.strict}=n,l=e;a||(l=this._cast(l,Object.assign({assert:!1},n)));let u=[];for(let f of Object.values(this.internalTests))f&&u.push(f);this.runTests({path:i,value:l,originalValue:s,options:n,tests:u},r,f=>{if(f.length)return o(f,l);this.runTests({path:i,value:l,originalValue:s,options:n,tests:this.tests},r,o)})}runTests(e,n,r){let o=!1,{tests:i,value:s,originalValue:a,path:l,options:u}=e,f=g=>{o||(o=!0,n(g,s))},p=g=>{o||(o=!0,r(g,s))},m=i.length,y=[];if(!m)return p([]);let b={value:s,originalValue:a,path:l,options:u,schema:this};for(let g=0;g<i.length;g++){const S=i[g];S(b,f,function(_){_&&(Array.isArray(_)?y.push(..._):y.push(_)),--m<=0&&p(y)})}}asNestedTest({key:e,index:n,parent:r,parentPath:o,originalParent:i,options:s}){const a=e??n;if(a==null)throw TypeError("Must include `key` or `index` for nested validations");const l=typeof a=="number";let u=r[a];const f=Object.assign({},s,{strict:!0,parent:r,value:u,originalValue:i[a],key:void 0,[l?"index":"key"]:a,path:l||a.includes(".")?`${o||""}[${l?a:`"${a}"`}]`:(o?`${o}.`:"")+e});return(p,m,y)=>this.resolve(f)._validate(u,f,m,y)}validate(e,n){var r;let o=this.resolve(Object.assign({},n,{value:e})),i=(r=n==null?void 0:n.disableStackTrace)!=null?r:o.spec.disableStackTrace;return new Promise((s,a)=>o._validate(e,n,(l,u)=>{fr.isError(l)&&(l.value=u),a(l)},(l,u)=>{l.length?a(new fr(l,u,void 0,void 0,i)):s(u)}))}validateSync(e,n){var r;let o=this.resolve(Object.assign({},n,{value:e})),i,s=(r=n==null?void 0:n.disableStackTrace)!=null?r:o.spec.disableStackTrace;return o._validate(e,Object.assign({},n,{sync:!0}),(a,l)=>{throw fr.isError(a)&&(a.value=l),a},(a,l)=>{if(a.length)throw new fr(a,e,void 0,void 0,s);i=l}),i}isValid(e,n){return this.validate(e,n).then(()=>!0,r=>{if(fr.isError(r))return!1;throw r})}isValidSync(e,n){try{return this.validateSync(e,n),!0}catch(r){if(fr.isError(r))return!1;throw r}}_getDefault(e){let n=this.spec.default;return n==null?n:typeof n=="function"?n.call(this,e):za(n)}getDefault(e){return this.resolve(e||{})._getDefault(e)}default(e){return arguments.length===0?this._getDefault():this.clone({default:e})}strict(e=!0){return this.clone({strict:e})}nullability(e,n){const r=this.clone({nullable:e});return r.internalTests.nullable=Ia({message:n,name:"nullable",test(o){return o===null?this.schema.spec.nullable:!0}}),r}optionality(e,n){const r=this.clone({optional:e});return r.internalTests.optionality=Ia({message:n,name:"optionality",test(o){return o===void 0?this.schema.spec.optional:!0}}),r}optional(){return this.optionality(!0)}defined(e=_o.defined){return this.optionality(!1,e)}nullable(){return this.nullability(!0)}nonNullable(e=_o.notNull){return this.nullability(!1,e)}required(e=_o.required){return this.clone().withMutation(n=>n.nonNullable(e).defined(e))}notRequired(){return this.clone().withMutation(e=>e.nullable().optional())}transform(e){let n=this.clone();return n.transforms.push(e),n}test(...e){let n;if(e.length===1?typeof e[0]=="function"?n={test:e[0]}:n=e[0]:e.length===2?n={name:e[0],test:e[1]}:n={name:e[0],message:e[1],test:e[2]},n.message===void 0&&(n.message=_o.default),typeof n.test!="function")throw new TypeError("`test` is a required parameters");let r=this.clone(),o=Ia(n),i=n.exclusive||n.name&&r.exclusiveTests[n.name]===!0;if(n.exclusive&&!n.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return n.name&&(r.exclusiveTests[n.name]=!!n.exclusive),r.tests=r.tests.filter(s=>!(s.OPTIONS.name===n.name&&(i||s.OPTIONS.test===o.OPTIONS.test))),r.tests.push(o),r}when(e,n){!Array.isArray(e)&&typeof e!="string"&&(n=e,e=".");let r=this.clone(),o=uj(e).map(i=>new na(i));return o.forEach(i=>{i.isSibling&&r.deps.push(i.key)}),r.conditions.push(typeof n=="function"?new yp(o,n):yp.fromOptions(o,n)),r}typeError(e){let n=this.clone();return n.internalTests.typeError=Ia({message:e,name:"typeError",skipAbsent:!0,test(r){return this.schema._typeCheck(r)?!0:this.createError({params:{type:this.schema.type}})}}),n}oneOf(e,n=_o.oneOf){let r=this.clone();return e.forEach(o=>{r._whitelist.add(o),r._blacklist.delete(o)}),r.internalTests.whiteList=Ia({message:n,name:"oneOf",skipAbsent:!0,test(o){let i=this.schema._whitelist,s=i.resolveAll(this.resolve);return s.includes(o)?!0:this.createError({params:{values:Array.from(i).join(", "),resolved:s}})}}),r}notOneOf(e,n=_o.notOneOf){let r=this.clone();return e.forEach(o=>{r._blacklist.add(o),r._whitelist.delete(o)}),r.internalTests.blacklist=Ia({message:n,name:"notOneOf",test(o){let i=this.schema._blacklist,s=i.resolveAll(this.resolve);return s.includes(o)?this.createError({params:{values:Array.from(i).join(", "),resolved:s}}):!0}}),r}strip(e=!0){let n=this.clone();return n.spec.strip=e,n}describe(e){const n=(e?this.resolve(e):this).clone(),{label:r,meta:o,optional:i,nullable:s}=n.spec;return{meta:o,label:r,optional:i,nullable:s,default:n.getDefault(e),type:n.type,oneOf:n._whitelist.describe(),notOneOf:n._blacklist.describe(),tests:n.tests.map(l=>({name:l.OPTIONS.name,params:l.OPTIONS.params})).filter((l,u,f)=>f.findIndex(p=>p.name===l.name)===u)}}}jo.prototype.__isYupSchema__=!0;for(const t of["validate","validateSync"])jo.prototype[`${t}At`]=function(e,n,r={}){const{parent:o,parentPath:i,schema:s}=Vfe(this,e,n,r.context);return s[t](o&&o[i],Object.assign({},r,{parent:o,path:e}))};for(const t of["equals","is"])jo.prototype[t]=jo.prototype.oneOf;for(const t of["not","nope"])jo.prototype[t]=jo.prototype.notOneOf;const Hfe=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function Wfe(t){const e=zv(t);if(!e)return Date.parse?Date.parse(t):Number.NaN;if(e.z===void 0&&e.plusMinus===void 0)return new Date(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond).valueOf();let n=0;return e.z!=="Z"&&e.plusMinus!==void 0&&(n=e.hourOffset*60+e.minuteOffset,e.plusMinus==="+"&&(n=0-n)),Date.UTC(e.year,e.month,e.day,e.hour,e.minute+n,e.second,e.millisecond)}function zv(t){var e,n;const r=Hfe.exec(t);return r?{year:ei(r[1]),month:ei(r[2],1)-1,day:ei(r[3],1),hour:ei(r[4]),minute:ei(r[5]),second:ei(r[6]),millisecond:r[7]?ei(r[7].substring(0,3)):0,precision:(e=(n=r[7])==null?void 0:n.length)!=null?e:void 0,z:r[8]||void 0,plusMinus:r[9]||void 0,hourOffset:ei(r[10]),minuteOffset:ei(r[11])}:null}function ei(t,e=0){return Number(t)||e}let qfe=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Ufe=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,Kfe=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,Yfe="^\\d{4}-\\d{2}-\\d{2}",Gfe="\\d{2}:\\d{2}:\\d{2}",Jfe="(([+-]\\d{2}(:?\\d{2})?)|Z)",Zfe=new RegExp(`${Yfe}T${Gfe}(\\.\\d+)?${Jfe}$`),Xfe=t=>Ds(t)||t===t.trim(),Qfe={}.toString();function Vv(){return new hj}class hj extends jo{constructor(){super({type:"string",check(e){return e instanceof String&&(e=e.valueOf()),typeof e=="string"}}),this.withMutation(()=>{this.transform((e,n,r)=>{if(!r.spec.coerce||r.isType(e)||Array.isArray(e))return e;const o=e!=null&&e.toString?e.toString():e;return o===Qfe?e:o})})}required(e){return super.required(e).withMutation(n=>n.test({message:e||_o.required,name:"required",skipAbsent:!0,test:r=>!!r.length}))}notRequired(){return super.notRequired().withMutation(e=>(e.tests=e.tests.filter(n=>n.OPTIONS.name!=="required"),e))}length(e,n=ur.length){return this.test({message:n,name:"length",exclusive:!0,params:{length:e},skipAbsent:!0,test(r){return r.length===this.resolve(e)}})}min(e,n=ur.min){return this.test({message:n,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(r){return r.length>=this.resolve(e)}})}max(e,n=ur.max){return this.test({name:"max",exclusive:!0,message:n,params:{max:e},skipAbsent:!0,test(r){return r.length<=this.resolve(e)}})}matches(e,n){let r=!1,o,i;return n&&(typeof n=="object"?{excludeEmptyString:r=!1,message:o,name:i}=n:o=n),this.test({name:i||"matches",message:o||ur.matches,params:{regex:e},skipAbsent:!0,test:s=>s===""&&r||s.search(e)!==-1})}email(e=ur.email){return this.matches(qfe,{name:"email",message:e,excludeEmptyString:!0})}url(e=ur.url){return this.matches(Ufe,{name:"url",message:e,excludeEmptyString:!0})}uuid(e=ur.uuid){return this.matches(Kfe,{name:"uuid",message:e,excludeEmptyString:!1})}datetime(e){let n="",r,o;return e&&(typeof e=="object"?{message:n="",allowOffset:r=!1,precision:o=void 0}=e:n=e),this.matches(Zfe,{name:"datetime",message:n||ur.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:n||ur.datetime_offset,params:{allowOffset:r},skipAbsent:!0,test:i=>{if(!i||r)return!0;const s=zv(i);return s?!!s.z:!1}}).test({name:"datetime_precision",message:n||ur.datetime_precision,params:{precision:o},skipAbsent:!0,test:i=>{if(!i||o==null)return!0;const s=zv(i);return s?s.precision===o:!1}})}ensure(){return this.default("").transform(e=>e===null?"":e)}trim(e=ur.trim){return this.transform(n=>n!=null?n.trim():n).test({message:e,name:"trim",test:Xfe})}lowercase(e=ur.lowercase){return this.transform(n=>Ds(n)?n:n.toLowerCase()).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>Ds(n)||n===n.toLowerCase()})}uppercase(e=ur.uppercase){return this.transform(n=>Ds(n)?n:n.toUpperCase()).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>Ds(n)||n===n.toUpperCase()})}}Vv.prototype=hj.prototype;let epe=new Date(""),tpe=t=>Object.prototype.toString.call(t)==="[object Date]";class Ch extends jo{constructor(){super({type:"date",check(e){return tpe(e)&&!isNaN(e.getTime())}}),this.withMutation(()=>{this.transform((e,n,r)=>!r.spec.coerce||r.isType(e)||e===null?e:(e=Wfe(e),isNaN(e)?Ch.INVALID_DATE:new Date(e)))})}prepareParam(e,n){let r;if(na.isRef(e))r=e;else{let o=this.cast(e);if(!this._typeCheck(o))throw new TypeError(`\`${n}\` must be a Date or a value that can be \`cast()\` to a Date`);r=o}return r}min(e,n=Bv.min){let r=this.prepareParam(e,"min");return this.test({message:n,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(o){return o>=this.resolve(r)}})}max(e,n=Bv.max){let r=this.prepareParam(e,"max");return this.test({message:n,name:"max",exclusive:!0,params:{max:e},skipAbsent:!0,test(o){return o<=this.resolve(r)}})}}Ch.INVALID_DATE=epe;Ch.prototype;function npe(t,e=[]){let n=[],r=new Set,o=new Set(e.map(([s,a])=>`${s}-${a}`));function i(s,a){let l=zs.split(s)[0];r.add(l),o.has(`${a}-${l}`)||n.push([a,l])}for(const s of Object.keys(t)){let a=t[s];r.add(s),na.isRef(a)&&a.isSibling?i(a.path,s):z1(a)&&"deps"in a&&a.deps.forEach(l=>i(l,s))}return Rfe.array(Array.from(r),n).reverse()}function m2(t,e){let n=1/0;return t.some((r,o)=>{var i;if((i=e.path)!=null&&i.includes(r))return n=o,!0}),n}function mj(t){return(e,n)=>m2(t,e)-m2(t,n)}const rpe=(t,e,n)=>{if(typeof t!="string")return t;let r=t;try{r=JSON.parse(t)}catch{}return n.isType(r)?r:t};function pf(t){if("fields"in t){const e={};for(const[n,r]of Object.entries(t.fields))e[n]=pf(r);return t.setFields(e)}if(t.type==="array"){const e=t.optional();return e.innerType&&(e.innerType=pf(e.innerType)),e}return t.type==="tuple"?t.optional().clone({types:t.spec.types.map(pf)}):"optional"in t?t.optional():t}const ope=(t,e)=>{const n=[...zs.normalizePath(e)];if(n.length===1)return n[0]in t;let r=n.pop(),o=zs.getter(zs.join(n),!0)(t);return!!(o&&r in o)};let g2=t=>Object.prototype.toString.call(t)==="[object Object]";function y2(t,e){let n=Object.keys(t.fields);return Object.keys(e).filter(r=>n.indexOf(r)===-1)}const ipe=mj([]);function gj(t){return new yj(t)}class yj extends jo{constructor(e){super({type:"object",check(n){return g2(n)||typeof n=="function"}}),this.fields=Object.create(null),this._sortErrors=ipe,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{e&&this.shape(e)})}_cast(e,n={}){var r;let o=super._cast(e,n);if(o===void 0)return this.getDefault(n);if(!this._typeCheck(o))return o;let i=this.fields,s=(r=n.stripUnknown)!=null?r:this.spec.noUnknown,a=[].concat(this._nodes,Object.keys(o).filter(p=>!this._nodes.includes(p))),l={},u=Object.assign({},n,{parent:l,__validating:n.__validating||!1}),f=!1;for(const p of a){let m=i[p],y=p in o;if(m){let b,g=o[p];u.path=(n.path?`${n.path}.`:"")+p,m=m.resolve({value:g,context:n.context,parent:l});let S=m instanceof jo?m.spec:void 0,C=S==null?void 0:S.strict;if(S!=null&&S.strip){f=f||p in o;continue}b=!n.__validating||!C?m.cast(o[p],u):o[p],b!==void 0&&(l[p]=b)}else y&&!s&&(l[p]=o[p]);(y!==p in l||l[p]!==o[p])&&(f=!0)}return f?l:o}_validate(e,n={},r,o){let{from:i=[],originalValue:s=e,recursive:a=this.spec.recursive}=n;n.from=[{schema:this,value:s},...i],n.__validating=!0,n.originalValue=s,super._validate(e,n,r,(l,u)=>{if(!a||!g2(u)){o(l,u);return}s=s||u;let f=[];for(let p of this._nodes){let m=this.fields[p];!m||na.isRef(m)||f.push(m.asNestedTest({options:n,key:p,parent:u,parentPath:n.path,originalParent:s}))}this.runTests({tests:f,value:u,originalValue:s,options:n},r,p=>{o(p.sort(this._sortErrors).concat(l),u)})})}clone(e){const n=super.clone(e);return n.fields=Object.assign({},this.fields),n._nodes=this._nodes,n._excludedEdges=this._excludedEdges,n._sortErrors=this._sortErrors,n}concat(e){let n=super.concat(e),r=n.fields;for(let[o,i]of Object.entries(this.fields)){const s=r[o];r[o]=s===void 0?i:s}return n.withMutation(o=>o.setFields(r,[...this._excludedEdges,...e._excludedEdges]))}_getDefault(e){if("default"in this.spec)return super._getDefault(e);if(!this._nodes.length)return;let n={};return this._nodes.forEach(r=>{var o;const i=this.fields[r];let s=e;(o=s)!=null&&o.value&&(s=Object.assign({},s,{parent:s.value,value:s.value[r]})),n[r]=i&&"getDefault"in i?i.getDefault(s):void 0}),n}setFields(e,n){let r=this.clone();return r.fields=e,r._nodes=npe(e,n),r._sortErrors=mj(Object.keys(e)),n&&(r._excludedEdges=n),r}shape(e,n=[]){return this.clone().withMutation(r=>{let o=r._excludedEdges;return n.length&&(Array.isArray(n[0])||(n=[n]),o=[...r._excludedEdges,...n]),r.setFields(Object.assign(r.fields,e),o)})}partial(){const e={};for(const[n,r]of Object.entries(this.fields))e[n]="optional"in r&&r.optional instanceof Function?r.optional():r;return this.setFields(e)}deepPartial(){return pf(this)}pick(e){const n={};for(const r of e)this.fields[r]&&(n[r]=this.fields[r]);return this.setFields(n,this._excludedEdges.filter(([r,o])=>e.includes(r)&&e.includes(o)))}omit(e){const n=[];for(const r of Object.keys(this.fields))e.includes(r)||n.push(r);return this.pick(n)}from(e,n,r){let o=zs.getter(e,!0);return this.transform(i=>{if(!i)return i;let s=i;return ope(i,e)&&(s=Object.assign({},i),r||delete s[e],s[n]=o(i)),s})}json(){return this.transform(rpe)}exact(e){return this.test({name:"exact",exclusive:!0,message:e||ff.exact,test(n){if(n==null)return!0;const r=y2(this.schema,n);return r.length===0||this.createError({params:{properties:r.join(", ")}})}})}stripUnknown(){return this.clone({noUnknown:!0})}noUnknown(e=!0,n=ff.noUnknown){typeof e!="boolean"&&(n=e,e=!0);let r=this.test({name:"noUnknown",exclusive:!0,message:n,test(o){if(o==null)return!0;const i=y2(this.schema,o);return!e||i.length===0||this.createError({params:{unknown:i.join(", ")}})}});return r.spec.noUnknown=e,r}unknown(e=!0,n=ff.noUnknown){return this.noUnknown(!e,n)}transformKeys(e){return this.transform(n=>{if(!n)return n;const r={};for(const o of Object.keys(n))r[e(o)]=n[o];return r})}camelCase(){return this.transformKeys(P0.camelCase)}snakeCase(){return this.transformKeys(P0.snakeCase)}constantCase(){return this.transformKeys(e=>P0.snakeCase(e).toUpperCase())}describe(e){const n=(e?this.resolve(e):this).clone(),r=super.describe(e);r.fields={};for(const[i,s]of Object.entries(n.fields)){var o;let a=e;(o=a)!=null&&o.value&&(a=Object.assign({},a,{parent:a.value,value:a.value[i]})),r.fields[i]=s.describe(a)}return r}}gj.prototype=yj.prototype;const spe=t=>{const{title:e,onSave:n,onCancel:r,disableFileUpload:o=!1,modifyCitation:i,readOnly:s=!1,showCloseBtn:a=!1}=t,l=X.useRef(null),[u,f]=X.useState(!1),[p,m]=X.useState({type:"Attachment",title:"",file:void 0,fileName:""});return X.useEffect(()=>{i&&m({...i,type:"Attachment",file:void 0})},[]),v.jsxs(v.Fragment,{children:[v.jsxs(D.Box,{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",children:[v.jsx(D.Typography,{variant:"h6",margin:"10px 0",children:e}),a&&v.jsx(D.IconButton,{onClick:r,children:v.jsx(Dp,{})})]}),v.jsx(qt.Formik,{innerRef:l,enableReinitialize:!0,initialValues:p,validationSchema:gj().shape({title:Vv().required("Title is required"),fileName:Vv().required("A file is required")}),onSubmit:async y=>{f(!0),n(y).catch(b=>{throw f(!1),b}).finally(()=>f(!1))},children:({values:y,setFieldValue:b})=>{var g;return X.useEffect(()=>{var S,C;(S=y.file)!=null&&S.name&&b("fileName",(C=y.file)==null?void 0:C.name)},[(g=y.file)==null?void 0:g.name]),v.jsxs(qt.Form,{autoComplete:"off",children:[v.jsx(Ps,{name:"title",disabled:u,required:!0,margin:"none",readOnly:s}),v.jsxs(D.Box,{marginTop:o||s?0:1,children:[v.jsxs(D.Box,{display:"flex",flexDirection:"row",alignItems:"flex-start",children:[!o&&!s&&v.jsx(IR,{name:"file",errorMode:"hidden"}),v.jsx(Ps,{readOnly:!0,name:"fileName",label:s||o?"File Name":""})]}),v.jsx(yr,{name:"fileName"})]}),v.jsx(D.DialogActions,{sx:{px:0},children:s?v.jsx(D.Button,{onClick:r,size:"small",variant:"contained",children:"Back to Table"}):v.jsxs(v.Fragment,{children:[v.jsx(D.Button,{onClick:r,variant:"outlined",size:"small",children:"Cancel"}),v.jsx(B1,{size:"small",loading:u,children:i?"Update Attachment":"Upload Attachment"})]})})]})}})]})},Su=t=>{const{open:e=!1,onClose:n,title:r,children:o,actions:i,closeBtnLabel:s,closeButtonPosition:a,closeButtonProps:l={},disableDismiss:u=!1,...f}=t;if(!e)return null;const p=a==="bottom"||a==="top-and-bottom",m=a==="top"||a==="top-and-bottom",y=()=>{if(s&&p)return v.jsx(D.Button,{className:"MBv2_Modal_Close",onClick:t.onClose,...l,children:s})},b=()=>{if(i)return v.jsx(D.DialogActions,{className:"MBv2_Modal_Actions",children:v.jsxs(D.Box,{display:"flex",flexDirection:"row",justifyContent:"space-between",width:"100%",gap:"0.25rem",children:[v.jsx(D.Box,{children:y()}),v.jsxs(D.Box,{display:"flex",gap:".25rem",children:[...i]})]})});if(s&&p)return v.jsx(D.DialogActions,{className:"MBv2_Modal_Actions",children:v.jsx(D.Box,{children:y()})})};return v.jsxs(D.Dialog,{className:"MBv2_Modal",open:e,onClose:()=>{u||n==null||n()},...f,children:[typeof r=="string"?v.jsx(D.DialogTitle,{className:"MBv2_Modal_Title",children:v.jsxs(D.Box,{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",children:[r,m&&v.jsx(D.IconButton,{"data-testid":"modal-header-close-btn",onClick:n,children:v.jsx(Dp,{})})]})}):r,o&&(typeof o=="string"?v.jsx(D.DialogContent,{className:"MBv2_Modal_Content",children:v.jsx(D.DialogContentText,{className:"MBv2_Modal_Content_Text",children:o})}):o),b()]})};function ape(t){return Ye("MuiAlert",t)}const b2=We("MuiAlert",["root","action","icon","message","filled","colorSuccess","colorInfo","colorWarning","colorError","filledSuccess","filledInfo","filledWarning","filledError","outlined","outlinedSuccess","outlinedInfo","outlinedWarning","outlinedError","standard","standardSuccess","standardInfo","standardWarning","standardError"]),lpe=Le(v.jsx("path",{d:"M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2, 4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0, 0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"}),"SuccessOutlined"),cpe=Le(v.jsx("path",{d:"M12 5.99L19.53 19H4.47L12 5.99M12 2L1 21h22L12 2zm1 14h-2v2h2v-2zm0-6h-2v4h2v-4z"}),"ReportProblemOutlined"),upe=Le(v.jsx("path",{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),"ErrorOutline"),dpe=Le(v.jsx("path",{d:"M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20, 12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10, 10 0 0,0 12,2M11,17H13V11H11V17Z"}),"InfoOutlined"),fpe=Le(v.jsx("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close"),ppe=t=>{const{variant:e,color:n,severity:r,classes:o}=t,i={root:["root",`color${Re(n||r)}`,`${e}${Re(n||r)}`,`${e}`],icon:["icon"],message:["message"],action:["action"]};return Ke(i,ape,o)},hpe=ve(pl,{name:"MuiAlert",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[n.variant],e[`${n.variant}${Re(n.color||n.severity)}`]]}})(It(({theme:t})=>{const e=t.palette.mode==="light"?Za:Mc,n=t.palette.mode==="light"?Mc:Za;return{...t.typography.body2,backgroundColor:"transparent",display:"flex",padding:"6px 16px",variants:[...Object.entries(t.palette).filter(Hn(["light"])).map(([r])=>({props:{colorSeverity:r,variant:"standard"},style:{color:t.vars?t.vars.palette.Alert[`${r}Color`]:e(t.palette[r].light,.6),backgroundColor:t.vars?t.vars.palette.Alert[`${r}StandardBg`]:n(t.palette[r].light,.9),[`& .${b2.icon}`]:t.vars?{color:t.vars.palette.Alert[`${r}IconColor`]}:{color:t.palette[r].main}}})),...Object.entries(t.palette).filter(Hn(["light"])).map(([r])=>({props:{colorSeverity:r,variant:"outlined"},style:{color:t.vars?t.vars.palette.Alert[`${r}Color`]:e(t.palette[r].light,.6),border:`1px solid ${(t.vars||t).palette[r].light}`,[`& .${b2.icon}`]:t.vars?{color:t.vars.palette.Alert[`${r}IconColor`]}:{color:t.palette[r].main}}})),...Object.entries(t.palette).filter(Hn(["dark"])).map(([r])=>({props:{colorSeverity:r,variant:"filled"},style:{fontWeight:t.typography.fontWeightMedium,...t.vars?{color:t.vars.palette.Alert[`${r}FilledColor`],backgroundColor:t.vars.palette.Alert[`${r}FilledBg`]}:{backgroundColor:t.palette.mode==="dark"?t.palette[r].dark:t.palette[r].main,color:t.palette.getContrastText(t.palette[r].main)}}}))]}})),mpe=ve("div",{name:"MuiAlert",slot:"Icon",overridesResolver:(t,e)=>e.icon})({marginRight:12,padding:"7px 0",display:"flex",fontSize:22,opacity:.9}),gpe=ve("div",{name:"MuiAlert",slot:"Message",overridesResolver:(t,e)=>e.message})({padding:"8px 0",minWidth:0,overflow:"auto"}),ype=ve("div",{name:"MuiAlert",slot:"Action",overridesResolver:(t,e)=>e.action})({display:"flex",alignItems:"flex-start",padding:"4px 0 0 16px",marginLeft:"auto",marginRight:-8}),v2={success:v.jsx(lpe,{fontSize:"inherit"}),warning:v.jsx(cpe,{fontSize:"inherit"}),error:v.jsx(upe,{fontSize:"inherit"}),info:v.jsx(dpe,{fontSize:"inherit"})},bj=A.forwardRef(function(e,n){const r=St({props:e,name:"MuiAlert"}),{action:o,children:i,className:s,closeText:a="Close",color:l,components:u={},componentsProps:f={},icon:p,iconMapping:m=v2,onClose:y,role:b="alert",severity:g="success",slotProps:S={},slots:C={},variant:_="standard",...T}=r,w={...r,color:l,severity:g,variant:_,colorSeverity:l||g},E=ppe(w),O={slots:{closeButton:u.CloseButton,closeIcon:u.CloseIcon,...C},slotProps:{...f,...S}},[N,P]=Bt("root",{ref:n,shouldForwardComponentProp:!0,className:Pe(E.root,s),elementType:hpe,externalForwardedProps:{...O,...T},ownerState:w,additionalProps:{role:b,elevation:0}}),[j,M]=Bt("icon",{className:E.icon,elementType:mpe,externalForwardedProps:O,ownerState:w}),[R,B]=Bt("message",{className:E.message,elementType:gpe,externalForwardedProps:O,ownerState:w}),[F,$]=Bt("action",{className:E.action,elementType:ype,externalForwardedProps:O,ownerState:w}),[z,L]=Bt("closeButton",{elementType:hl,externalForwardedProps:O,ownerState:w}),[W,q]=Bt("closeIcon",{elementType:fpe,externalForwardedProps:O,ownerState:w});return v.jsxs(N,{...P,children:[p!==!1?v.jsx(j,{...M,children:p||m[g]||v2[g]}):null,v.jsx(R,{...B,children:i}),o!=null?v.jsx(F,{...$,children:o}):null,o==null&&y?v.jsx(F,{...$,children:v.jsx(z,{size:"small","aria-label":a,title:a,color:"inherit",onClick:y,...L,children:v.jsx(W,{fontSize:"small",...q})})}):null]})});process.env.NODE_ENV!=="production"&&(bj.propTypes={action:c.node,children:c.node,classes:c.object,className:c.string,closeText:c.string,color:c.oneOfType([c.oneOf(["error","info","success","warning"]),c.string]),components:c.shape({CloseButton:c.elementType,CloseIcon:c.elementType}),componentsProps:c.shape({closeButton:c.object,closeIcon:c.object}),icon:c.node,iconMapping:c.shape({error:c.node,info:c.node,success:c.node,warning:c.node}),onClose:c.func,role:c.string,severity:c.oneOfType([c.oneOf(["error","info","success","warning"]),c.string]),slotProps:c.shape({action:c.oneOfType([c.func,c.object]),closeButton:c.oneOfType([c.func,c.object]),closeIcon:c.oneOfType([c.func,c.object]),icon:c.oneOfType([c.func,c.object]),message:c.oneOfType([c.func,c.object]),root:c.oneOfType([c.func,c.object])}),slots:c.shape({action:c.elementType,closeButton:c.elementType,closeIcon:c.elementType,icon:c.elementType,message:c.elementType,root:c.elementType}),sx:c.oneOfType([c.arrayOf(c.oneOfType([c.func,c.object,c.bool])),c.func,c.object]),variant:c.oneOfType([c.oneOf(["filled","outlined","standard"]),c.string])});const Cu=t=>{var y;const{noIcon:e=!1,children:n,severity:r="success",variant:o="leftBorder",sx:i,title:s,...a}=t,{palette:l}=D.useTheme(),u=e?{icon:!1}:{},f=o==="leftBorder"?"standard":o,p=o==="leftBorder"?{...i,borderLeft:`4px solid ${(y=l[r])==null?void 0:y.main}`}:i,m=s?{icon:{sx:{mt:"6px"}}}:{};return v.jsxs(bj,{severity:r,variant:f,sx:p,slotProps:m,...u,...a,children:[s&&v.jsx(D.Typography,{variant:"h3",children:s}),n]})},vj=t=>v.jsx(Cu,{severity:"error",...t}),xj=t=>v.jsx(Cu,{severity:"success",...t}),bpe=t=>{const{alert:e,setAlert:n}=t,r=()=>n(void 0);return v.jsxs(v.Fragment,{children:[(e==null?void 0:e.type)==="Error"&&v.jsx(vj,{"data-testid":"citation-menu-error",onClose:r,title:e.title,children:e.message.toString()}),(e==null?void 0:e.type)==="Success"&&v.jsx(xj,{"data-testid":"citation-menu-success",onClose:r,children:e.message})]})};function Sj({getCitationsPaginated:t,onCreateCitation:e,onUpdateCitation:n,onDeleteCitation:r,getCitationById:o,onDownloadAttachment:i,onSelectCitations:s,onCancel:a,initialSelectedIds:l=[],onContentChange:u,onError:f=()=>{},renderAsSelectablePopup:p=!1,addlActions:m,canLaunchUrl:y,readOnly:b}){const[g,S]=X.useState("Insert Citation/Attachment(s)"),[C,_]=X.useState(l),[T,w]=X.useState(void 0),[E,O]=X.useState(void 0),N=ae=>{O(void 0),S(ae)},[P,j]=X.useState(0);X.useEffect(()=>{u==null||u()},[g,E,u]);const M=(ae=!1)=>{(!p||ae)&&j(de=>de+1)},R=(ae,de)=>{var se;const ee=typeof((se=de.response)==null?void 0:se.data)=="string"&&de.response.data,he=typeof de.message=="string"&&de.message;O({type:"Error",title:ae,message:ee??he}),f(de)},B=ae=>O({type:"Success",title:"",message:ae}),F=async ae=>{if(g==="Insert Citation/Attachment(s)")throw Error("onSave called with invalid state");if(g==="Edit Citation"||g==="Edit Attachment"){if(ae.id===void 0)throw Error("Failed to update citation. Citation is missing id");await(n==null?void 0:n(ae).then(()=>{N("Insert Citation/Attachment(s)"),M()}).catch(ee=>{R("Failed to update",ee)}))}else await(e==null?void 0:e(ae).then(ee=>{_([...C,ee.id]),N("Insert Citation/Attachment(s)"),M()}).catch(ee=>{R("Failed to create",ee)}))},$=r&&(async ae=>r(ae).then(()=>{M(!0),_(C.filter(de=>de!==ae)),B("Successfully deleted")}).catch(de=>R("Failed to delete",de))),z=(ae,de)=>{o(ae.id).then(ee=>{w(ee),N(de)}).catch(ee=>{R("Failed to load",ee)})},L=i&&(async ae=>i(ae).catch(de=>{R(`Failed to download ${ae.fileName}`,de)})),W=v.jsx(Tfe,{refreshKey:P,getCitationsPaginated:ae=>t(ae).then(de=>(u==null||u(),de)),onCancel:a,onNewCitation:()=>{w(void 0),N("Add Citation")},onNewAttachment:()=>{w(void 0),N("Add Attachment")},onEditCitation:ae=>z(ae,b?"View Citation":"Edit Citation"),onEditAttachment:ae=>z(ae,b?"View Attachment":"Edit Attachment"),onDeleteCitation:$,onDownloadAttachment:L,onSelect:s,setSelectedIds:_,selectedIds:C,onError:f,condenseTable:p,canSelect:p,title:p&&!b?g:"Attachments & Citations",addlActions:m,canCreate:!!e,canEdit:!!n,canDelete:!!$,canLaunchUrl:y,readOnly:b,showCloseBtn:p}),q=v.jsx(_fe,{modifyCitation:T,onSave:F,onCancel:()=>N("Insert Citation/Attachment(s)"),title:g,readOnly:g==="View Citation",showCloseBtn:p}),G=v.jsx(spe,{onSave:F,onCancel:()=>N("Insert Citation/Attachment(s)"),modifyCitation:T,disableFileUpload:g==="Edit Attachment",title:g,readOnly:g==="View Attachment",showCloseBtn:p}),U=v.jsx(bpe,{alert:E,setAlert:O}),Z=g==="Add Citation"||g==="Edit Citation"||g==="View Citation",pe=g==="Add Attachment"||g==="Edit Attachment"||g==="View Attachment";if(p){let ae=null;return!p||g==="Insert Citation/Attachment(s)"?ae=W:Z?ae=q:pe&&(ae=G),v.jsxs(D.Box,{width:"500px",children:[U,v.jsx(D.Box,{paddingTop:"8px",children:ae})]})}return v.jsxs(D.Box,{width:"100%",children:[g==="Insert Citation/Attachment(s)"&&U,v.jsx(D.Box,{paddingTop:"8px",children:W}),v.jsx(Su,{open:Z||pe,children:v.jsxs(D.Box,{padding:"10px 20px",minWidth:"400px","data-testid":"citation-form-modal",children:[U,Z?q:G]})})]})}function Cj({...t}){return v.jsx(Sj,{renderAsSelectablePopup:!0,...t})}const vpe=Yt({name:{CitationBubbleMenuTipTap:wj}})(t=>({content:{padding:t.spacing(1.5,2,.5),backgroundColor:"#f9f9f9"}}));function wj({getCitationsPaginated:t,onCreateCitation:e,onUpdateCitation:n,onDeleteCitation:r,getCitationById:o,onDownloadAttachment:i,canLaunchUrl:s,readOnly:a,...l}){const{classes:u}=vpe(),f=vt();if(f&&!("citationBubbleMenuHandler"in(f==null?void 0:f.storage)))throw new Error("You must add the CitationBubbleMenuHandler extension to the useEditor `extensions` array in order to use this component!");const p=f==null?void 0:f.storage.citationBubbleMenuHandler,m=p.isOpen,y=p.selectedIds,b=p.selectedNodePos,g=T=>{f&&(T.length===0?f.commands.deleteCitation(b):y.length===0?f.commands.insertCitation({ids:T}):f.commands.updateCitation({ids:T},b))},S=T=>{g(T),f==null||f.commands.closeCitationBubbleMenu()},C=()=>{g(y),f==null||f.commands.closeCitationBubbleMenu()},_=X.useCallback(()=>{requestAnimationFrame(()=>{f!=null&&f.view&&f.view.dispatch(f.view.state.tr)})},[f]);return f?v.jsx(gh,{editor:f,open:m,...p.bubbleMenuOptions,...l,children:v.jsx("div",{className:u.content,children:v.jsx(Cj,{getCitationsPaginated:t,onCreateCitation:e,onUpdateCitation:n,onDeleteCitation:r,getCitationById:o,onDownloadAttachment:i,onSelectCitations:S,onCancel:C,initialSelectedIds:y,onContentChange:_,canLaunchUrl:s,readOnly:a})})}):null}const xpe=un.create({name:"starterKit",addExtensions(){const t=[];return this.options.bold!==!1&&t.push(RN.configure(this.options.bold)),this.options.blockquote!==!1&&t.push(ON.configure(this.options.blockquote)),this.options.bulletList!==!1&&t.push(AN.configure(this.options.bulletList)),this.options.code!==!1&&t.push(IN.configure(this.options.code)),this.options.codeBlock!==!1&&t.push(DN.configure(this.options.codeBlock)),this.options.document!==!1&&t.push(PN.configure(this.options.document)),this.options.dropcursor!==!1&&t.push(NN.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&t.push(jN.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&t.push(LN.configure(this.options.hardBreak)),this.options.heading!==!1&&t.push(hN.configure(this.options.heading)),this.options.history!==!1&&t.push(VN.configure(this.options.history)),this.options.horizontalRule!==!1&&t.push(HN.configure(this.options.horizontalRule)),this.options.italic!==!1&&t.push(WN.configure(this.options.italic)),this.options.listItem!==!1&&t.push(ej.configure(this.options.listItem)),this.options.orderedList!==!1&&t.push(tj.configure(this.options.orderedList)),this.options.paragraph!==!1&&t.push(nj.configure(this.options.paragraph)),this.options.strike!==!1&&t.push(oj.configure(this.options.strike)),this.options.text!==!1&&t.push(ij.configure(this.options.text)),t}}),Spe=()=>un.create({name:"citationBubbleMenuHandler",addStorage(){return{isOpen:!1,selectedIds:[],bubbleMenuOptions:void 0,selectedNodePos:0}},addCommands(){return{openCitationBubbleMenu:(t={},e)=>({editor:n,dispatch:r})=>{var a;const{doc:o}=n.state,i=o.nodeAt(e??0),s=((a=i==null?void 0:i.attrs)==null?void 0:a.ids)??[];return r&&(this.storage.isOpen=!0,this.storage.selectedIds=s,this.storage.bubbleMenuOptions=t,this.storage.selectedNodePos=e??0),!0},closeCitationBubbleMenu:()=>({commands:t,dispatch:e})=>this.storage.isOpen?(t.focus(),e&&(this.storage.isOpen=!1,this.storage.selectedIds=[],this.storage.selectedNodePos=0),!0):!1}},onSelectionUpdate(){this.storage.isOpen&&!this.editor.isActive("citation")&&this.editor.commands.closeCitationBubbleMenu()},addKeyboardShortcuts(){return{"Mod-Shift-c":()=>(this.editor.commands.openCitationBubbleMenu(),!0)}}});function Cpe(t){const e=vt(),n=X.useRef(null);return v.jsx(mt,{buttonRef:n,tooltipLabel:"Insert Citation/Attachment",tooltipShortcutKeys:["mod","Shift","C"],disabled:!(e!=null&&e.isEditable),onClick:()=>e==null?void 0:e.commands.openCitationBubbleMenu({anchorEl:n.current,placement:"bottom"}),...t,children:v.jsxs(D.Box,{display:"flex",flexDirection:"row",gap:"4px",alignItems:"center",children:[v.jsx($q,{fontSize:"small"}),v.jsx(D.Typography,{variant:"body2",children:"Insert Citation/Attachment"})]})})}const Tj=X.createContext(void 0),_j=()=>{const t=X.useContext(Tj);if(!t)throw new Error("useSync must be used inside CitationFieldProvider");return t},wpe=({node:t,HTMLAttributes:e,selected:n,extension:r,updateAttributes:o,deleteNode:i})=>{const s=t.attrs.ids||[],{citations:a,isLoaded:l}=_j(),[u,f]=X.useState(String(s)),[p,m]=X.useState([]),y=r.options.citationMaxLength;if(X.useEffect(()=>{if(!l)return;const b=a.filter(C=>s.includes(C.id)),g=b.map(C=>yf.truncate(C.title,{length:y,omission:"..."})).join(", ");f(g),m(b);const S=b.map(C=>C.id);S.length===0?setTimeout(i,0):S.length!==s.length&&setTimeout(()=>o({ids:b.map(C=>C.id)}),0)},[a,s,l]),p.length!==0)return v.jsx(x1,{as:"span",...e,"data-testid":"citation-node-component",children:v.jsx(D.Tooltip,{title:v.jsx(D.Box,{className:"citation-tooltip",children:p.map((b,g)=>{var C;const S=[b.source,b.title,b.fileName,b.url,(C=b.accessedAt)==null?void 0:C.slice(0,10),b.classification];return v.jsxs(D.Typography,{variant:"subtitle2",children:[S.filter(Boolean).join(" | "),g<p.length-1&&v.jsx(D.Divider,{className:"citation-tooltip-divider"})]},b.id)})}),slotProps:{tooltip:{sx:{maxWidth:500}}},children:v.jsx("a",{href:"#",onClick:b=>{b.preventDefault(),b.stopPropagation()},className:n?"selected-citation-link":"citation-link",children:u})})})},Tpe=en.create({name:"citation",group:"inline",inline:!0,atom:!0,selectable:!0,addAttributes(){return{ids:{default:[],parseHTML:t=>{const e=t.getAttribute("ids");return e?e.split(",").map(n=>parseInt(n.trim(),10)).filter(n=>!isNaN(n)):[]},renderHTML:t=>({ids:Array.isArray(t.ids)?t.ids.join(","):""})}}},parseHTML(){return[{tag:"citation"}]},renderHTML({HTMLAttributes:t}){return["citation",bt(t)]},addNodeView(){return S1(wpe)},addProseMirrorPlugins(){return[new tn({props:{handleClickOn:(t,e,n,r,o,i)=>n&&n.type.name==="citation"?(this.editor.commands.openCitationBubbleMenu({},r),!0):!1}})]},addCommands(){return{insertCitation:t=>({commands:e})=>e.insertContent({type:"citation",attrs:t}),updateCitation:(t,e)=>({state:n,dispatch:r,tr:o})=>{const i=n.doc.nodeAt(e);return!i||i.type.name!=="citation"?!1:(o.setNodeMarkup(e,void 0,t),r&&r(o),!0)},deleteCitation:t=>({tr:e,dispatch:n})=>{if(typeof t!="number")return!1;const r=t,o=t+1;return n&&n(e.delete(r,o)),!0}}}}),kj=t=>v.jsx(AR,{name:t.name,label:"Not Applicable",errorMode:"hidden"}),_pe=t=>{const{name:e,label:n=Mn(e),hideLabel:r=!1,required:o=!1,readOnly:i=!1,margin:s="dense",citationMaxLength:a=24,getCitationsPaginated:l,onCreateCitation:u,onUpdateCitation:f,onDeleteCitation:p,getCitationById:m,onDownloadAttachment:y,onError:b=()=>{},placeholder:g="Start typing here...",notApplicableName:S,errorMode:C="normal",canLaunchUrl:_}=t,T=[xpe,rj.configure({placeholder:g}),Spe(),Tpe.configure({citationMaxLength:a})],[w,E,O]=qt.useField({name:e}),{setValue:N}=O,{value:P}=w,{addUpdateCitation:j,deleteCitation:M,batchUpdate:R}=_j();X.useEffect(()=>{var q;const L=(q=B==null?void 0:B.current)==null?void 0:q.editor;if(!L)return;L.getHTML()!==P&&setTimeout(()=>{L.commands.setContent(P)},0)},[P]);const B=X.useRef(null),F={normal:{marginTop:"16px",marginBottom:"8px"},dense:{marginTop:"8px",marginBottom:"4px"},none:{margin:0}},$=()=>{var q,G;const L=((G=(q=B.current)==null?void 0:q.editor)==null?void 0:G.getHTML())??"",W=!L.replace(/<\/?p>|<br>/g,"").trim();N(W?"":L)},z=v.jsxs(D.Box,{id:`citation-field_${e}`,sx:{"& .ProseMirror":{"& h1, & h2, & h3, & h4, & h5, & h6":{scrollMarginTop:i?0:50}}},...F[s],children:[v.jsx(ZP,{ref:B,extensions:T,content:P,editable:!i,renderControls:i?void 0:()=>v.jsx(bh,{children:v.jsx(Cpe,{})}),onBlur:$,RichTextFieldProps:{variant:"outlined",MenuBarProps:{hide:i}},children:()=>v.jsx(wj,{getCitationsPaginated:L=>l(L).then(W=>(R(W.data),W)),onCreateCitation:u&&(L=>u(L).then(W=>(j(W),W))),onUpdateCitation:f&&(L=>f(L).then(W=>(j(W),W))),onDeleteCitation:p&&(L=>p(L).then(()=>M(L))),getCitationById:m,onDownloadAttachment:y,onError:b,canLaunchUrl:_,readOnly:i})}),v.jsx(yr,{name:e,id:`${e}-err`,errorMode:C})]});return v.jsxs(D.Box,{display:"flex",flexDirection:"column",width:"100%",children:[v.jsxs(D.Box,{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",children:[!r&&v.jsx(D.InputLabel,{htmlFor:`citation-field_${e}`,required:o,children:n}),S&&v.jsx(kj,{name:S})]}),z]})},kpe=t=>{const{name:e="submit"}=t;return v.jsx(qr,{name:e,type:"submit",...t})},Epe=t=>{const{label:e="Return to Top",icon:n=Kd,scrollThresholdPx:r=100}=t,o=D.useScrollTrigger({threshold:r}),i=X.useCallback(()=>{window.scrollTo({top:0,behavior:"smooth"})},[]);return v.jsx(D.Zoom,{in:o,children:v.jsx(D.Box,{sx:{position:"fixed",bottom:32,right:32,zIndex:1},children:v.jsxs(D.Fab,{onClick:i,color:"primary",size:"small",variant:"extended","aria-label":"Scroll back to top",children:[v.jsx(n,{fontSize:"medium"}),e]})})})},Mpe=()=>{const{values:t,errors:e,status:n}=qt.useFormikContext(),{palette:r}=D.useTheme();return v.jsx(D.Paper,{style:{backgroundColor:r.mode==="dark"?"#303030":"#f0f0f0",margin:"10px 0"},children:v.jsxs(D.List,{children:[v.jsxs(D.ListItem,{children:[v.jsx(D.Typography,{display:"block",variant:"h6",children:"Values"}),v.jsx("br",{}),v.jsx(D.Divider,{variant:"inset"}),v.jsx("pre",{children:JSON.stringify(t,null,2)})]}),v.jsx(D.Divider,{variant:"inset",component:"li"}),v.jsxs(D.ListItem,{id:"testing",children:[v.jsx(D.Typography,{display:"block",variant:"h6",children:"Errors"}),v.jsx("br",{}),v.jsx(D.Divider,{variant:"inset"}),v.jsx("pre",{children:JSON.stringify(e,null,2)})]}),v.jsxs(D.ListItem,{children:[v.jsx(D.Typography,{display:"block",variant:"h6",children:"Status"}),v.jsx("br",{}),v.jsx(D.Divider,{variant:"inset"}),v.jsx("pre",{children:JSON.stringify(n,null,2)})]})]})})},Ope=t=>{const{steps:e,orientation:n,inlineLabel:r=n=="vertical",isResponsive:o=!1}=t,{width:i}=cj();let s=!r,a=n;o&&(n&&console.warn("Stepper: Ignoring orientation. isResponsive is set to true, so the orientation is determined automatically based on the window size."),a=i<600?"vertical":"horizontal",a=="vertical"?s=!1:s=!r),n=="vertical"&&!r&&(console.warn("Stepper: ignoring inlineLabel={false}. Must use inline labels when orientation is vertical"),s=!1);const l=["steps","inlineLabel","orientation","isResponsive"],u={alternativeLabel:s,orientation:a,...er({...t},l)};return v.jsx(D.Stepper,{...u,children:e.map(f=>v.jsx(D.Step,{children:v.jsx(D.StepLabel,{children:f})},f))})},Rpe=t=>{const{name:e,label:n=Mn(e),labelProps:r={fontSize:"1.1em",color:"#808080",fontWeight:"600"},initialState:o,renderFormGroup:i,addButtonContent:s="Add Another",removeButtonContent:a=t.removePosition==="right"?v.jsx(y8,{}):"Remove",variant:l="card",addButtonSx:u,removeButtonSx:f,allowRemoveAll:p=!1,readOnly:m=!1,emptyListMsg:y="None",showDivider:b=!1,removePosition:g="bottom"}=t,[S]=qt.useField({name:e}),{value:C}=S,_=T=>({display:"flex",flexDirection:T==="bottom"?"column":"row",alignItems:T==="bottom"?"flex-start":"center"});return v.jsxs(D.FormControl,{fullWidth:!0,children:[v.jsx(D.Typography,{...r,children:n}),m&&S.value.length===0?v.jsx(D.Typography,{children:y}):v.jsx(qt.FieldArray,{name:e,render:T=>v.jsxs("div",{children:[C.map((w,E)=>v.jsx(X.Fragment,{children:v.jsx(Ape,{variant:l,content:v.jsxs(D.Box,{"data-testid":"form-group-container",sx:typeof g=="string"?_(g):{...g},children:[v.jsxs(D.Box,{width:"100%",children:[i(`${e}.${E}`,E),b&&E!==C.length-1&&v.jsx(D.Divider,{"data-testid":"divider"})]}),!m&&C.length>(p?0:1)&&v.jsx(D.Button,{"data-testid":"repeatable-form-group_remove-btn",sx:f,onClick:()=>T.remove(E),children:a})]})})},`${e}-${E}`)),!m&&v.jsx(D.Button,{"data-testid":"repeatable-form-group_add-btn",onClick:()=>T.push(o),sx:u,children:s})]})})]})},Ape=({variant:t,content:e})=>{switch(t){case"card":return v.jsx(D.Card,{"data-testid":"repeatable-form-group_card",sx:{padding:"8px",marginBottom:"8px"},children:v.jsx(D.CardContent,{children:e})});case"elevatedCard":return v.jsx(D.Card,{"data-testid":"repeatable-form-group_elevated-card",elevation:4,sx:{border:"unset",padding:"8px",marginBottom:"8px"},children:v.jsx(D.CardContent,{children:e})});case"none":return e}},Ipe=t=>{const{confirmBtnLabel:e,onConfirm:n,confirmButtonProps:r={color:"primary",variant:"contained"},closeBtnLabel:o="Cancel",closeButtonPosition:i="bottom",...s}=t;return v.jsx(Su,{actions:[v.jsx(D.Button,{className:"MBv2_ConfirmationModal_ConfirmBtn",onClick:n,...r,children:e})],closeBtnLabel:o,closeButtonPosition:i,...s})},Dpe=t=>{const{closeBtnLabel:e="OK",closeButtonPosition:n="bottom",closeButtonProps:r={color:"primary",variant:"contained"},...o}=t;return v.jsx(Su,{closeBtnLabel:e,closeButtonPosition:n,closeButtonProps:r,...o})},Ppe=t=>{const{primaryBtnLabel:e,onPrimaryAction:n,primaryActionProps:r={color:"primary",variant:"contained"},secondaryBtnLabel:o,onSecondaryAction:i,secondaryActionProps:s={color:"primary",variant:"outlined"},closeBtnLabel:a="Cancel",closeButtonPosition:l="bottom",...u}=t;return v.jsx(Su,{actions:[v.jsx(D.Button,{className:"MBv2_DecisionModal_SecondaryAction",onClick:i,...s,children:o}),v.jsx(D.Button,{className:"MBv2_DecisionModal_PrimaryAction",onClick:n,...r,children:e})],closeBtnLabel:a,closeButtonPosition:l,...u})},Npe=t=>{const{featureMenuOptions:e=[],copyright:n,logo:r,sx:o={},fontColor:i="primary"}=t,{palette:s}=D.useTheme(),a=ao.useNavigate();return v.jsxs(D.Box,{className:"MBv2_Footer",sx:{backgroundColor:s.mode==="dark"?"#222222":"#ededed",padding:"25px 30px",...o},children:[v.jsx(D.Box,{className:"MBv2_Footer_Logo",sx:{display:"flex",gap:2,alignItems:"center",paddingBottom:1},children:typeof r=="string"?v.jsx("img",{draggable:"false",src:r,style:{width:"200px"},alt:"logo"}):r}),v.jsxs(D.Box,{display:"flex",justifyContent:"space-between",flexWrap:"wrap",className:"MBv2_Footer_Nav_Links_Container",gap:2,children:[v.jsx(D.Box,{sx:{flexGrow:1},className:"MBv2_Footer_Nav_Links",display:"flex",flexDirection:"row",justifyContent:"flex-start",gap:3,children:e==null?void 0:e.map(l=>v.jsx(D.Link,{"data-testid":l.label,sx:{cursor:"pointer",fontSize:15},color:i,...Zc(l,a),children:l.label},l.label))}),n&&v.jsx(D.Typography,{style:{fontSize:15},"data-testid":"copyright",className:"MBv2_Footer_Copyright",color:i,children:n})]})]})},Ej=t=>{const{menuOptionLists:e,anchor:n="left",children:r}=t,{pathname:o}=ao.useLocation(),i=ao.useNavigate(),[s,a]=X.useState(!1),l=(m,y)=>v.jsx(D.MenuList,{children:m.map(b=>v.jsxs(D.MenuItem,{...Zc(b,i,()=>a(!1)),children:[b.icon&&v.jsx(D.ListItemIcon,{children:b.icon}),v.jsx(D.ListItemText,{primary:b.label})]},`mobile-drawer-group-${y}-item-${b.path}`))}),f=(()=>{if(e){const m=e.filter(y=>y&&y.length>0);return m.length===0?null:m.map((y,b)=>v.jsxs(X.Fragment,{children:[l(y,b),b<m.length-1&&v.jsx(D.Divider,{})]},`mobile-drawer-group-${b}`))}return r?v.jsx(D.Box,{role:"presentation",onClick:()=>a(!1),children:r}):null})(),p=f??!1;return X.useEffect(()=>{a(!1)},[o]),p&&v.jsxs(v.Fragment,{children:[v.jsx(D.IconButton,{onClick:()=>a(!0),color:"inherit",title:"Menu",children:v.jsx(f8,{})}),v.jsx(D.Drawer,{"data-testid":"mobile-drawer",anchor:n,open:s,onClose:()=>a(!1),children:v.jsx(D.Box,{sx:{width:300},display:"flex",flexDirection:"column",justifyContent:"space-between",children:v.jsx(D.Box,{display:"flex",justifyContent:"start",flexDirection:"column",children:f})})})]})},Mj=t=>{const{env:e,isProd:n}=t;return n?null:v.jsx(D.Paper,{sx:{borderRadius:0,display:"flex",alignItems:"center",justifyContent:"center"},children:v.jsxs(D.Typography,{variant:"h6",color:"error",children:[e," Environment - Test Data Only"]})})},Oj=t=>{const{label:e,menuOptions:n=[],icon:r}=t,o=ao.useNavigate(),[i,s]=A.useState(null),a=!!i,l=f=>{s(f.currentTarget)},u=()=>{s(null)};return n.length===0?null:v.jsxs(v.Fragment,{children:[v.jsx(D.Button,{startIcon:r,variant:"outlined",color:"inherit",sx:{minWidth:0,padding:1},onClick:l,children:e}),v.jsx(D.Menu,{anchorEl:i,open:a,onClick:u,children:n.map(f=>v.jsxs(D.MenuItem,{...Zc(f,o),children:[f.icon&&v.jsx(D.ListItemIcon,{children:f.icon}),v.jsx(D.ListItemText,{primary:f.label})]},f.label))})]})},Rj=t=>{const{displayName:e,userMenuOptions:n}=t;return v.jsx(Oj,{label:e,menuOptions:n,icon:v.jsx(h8,{})})},wh=t=>{const{menuOptions:e,orientation:n="horizontal",activeTabIdx:r,sx:o=n=="vertical"?{"& .MuiTabs-indicator":{left:0}}:void 0,slotProps:i={indicator:{sx:n=="horizontal"?{height:4}:{width:4}}}}=t,{palette:s}=D.useTheme(),a=ao.useNavigate();return v.jsx(D.Tabs,{orientation:n,value:r??!1,sx:o,slotProps:i,children:e.map((l,u)=>v.jsx(D.Tab,{icon:l.icon,label:l.label,value:u,...Zc(l,a),sx:{alignItems:n=="vertical"?"flex-start":void 0,borderBottom:n=="vertical"?"1px solid":void 0,borderColor:"divider","&.Mui-selected":{backgroundColor:n=="vertical"?s.grey[s.mode=="dark"?800:50]:void 0,color:"inherit"}}},l.label))})},Aj=t=>{const{featureMenuOptions:e=[],activeTabIdx:n,sx:r}=t;return e.length>0&&v.jsx(D.Paper,{sx:{pl:4,pr:4,borderRadius:0},"data-testid":"navBar",children:v.jsx(wh,{menuOptions:e,activeTabIdx:n,sx:r})})},Ij=t=>{const{onToggle:e}=t,{palette:n}=D.useTheme(),r=n.mode==="dark";return v.jsx(D.IconButton,{onClick:e,color:"inherit",title:"Dark Mode Toggle",children:r?v.jsx(BR,{}):v.jsx(FR,{})})},jpe=t=>{const{envInfo:e,headerRef:n,logo:r,featureMenuOptions:o=[],userMenuOptions:i=[],onToggleDarkMode:s,quickLinks:a=[],displayName:l,banner:u,position:f="fixed",children:p,sx:m,navBarSx:y}=t,b=ao.useNavigate(),g=D.useMediaQuery(D.useTheme().breakpoints.down("sm")),{palette:S}=D.useTheme(),{pathname:C}=ao.useLocation(),_=S.mode==="dark",[T,w]=A.useState(void 0);A.useEffect(()=>{const N=o.findIndex(P=>P.path&&C.startsWith(P.path));w(N>=0?N:void 0)},[C,o]);const E=s&&v.jsx(Ij,{onToggle:s}),O=s&&(g||!g&&l)?[{icon:_?v.jsx(BR,{}):v.jsx(FR,{}),label:`Switch to ${_?"Light":"Dark"} mode`,onClick:s},...i]:i;return v.jsxs(D.AppBar,{ref:n,position:f,sx:m,elevation:4,children:[e&&v.jsx(Mj,{...e}),u,v.jsxs(D.Toolbar,{sx:{color:"white",display:"flex",justifyContent:"space-between",gap:2},children:[v.jsx(D.Button,{disableRipple:!0,component:ao.Link,to:"/",children:r&&typeof r=="string"?v.jsx("img",{draggable:"false",src:r,style:{width:"200px",filter:"brightness(0) invert(1)"},alt:"logo"}):r}),v.jsxs(D.Box,{display:"flex",gap:2,alignItems:"center",children:[!l&&!g&&E,g&&v.jsx(Ej,{menuOptionLists:[o,a,O],anchor:"right"}),!g&&v.jsxs(v.Fragment,{children:[v.jsx(D.Box,{display:"flex",gap:0,children:a==null?void 0:a.map((N,P)=>v.jsxs(D.Box,{display:"flex",alignItems:"center",children:[P>0&&v.jsx(D.Typography,{className:"quickLink-divider",color:S.primary.contrastText,children:"|"}),v.jsx(D.Button,{variant:"text",sx:{color:"white"},...Zc(N,b),children:v.jsxs(D.Box,{display:"flex",gap:"3px",alignItems:"center",children:[N.icon,N.label]})})]},N.label))}),p,l&&v.jsx(Rj,{displayName:l,userMenuOptions:O})]})]})]}),!g&&v.jsx(Aj,{featureMenuOptions:o,activeTabIdx:T,sx:y})]})},Lpe=t=>{const{sx:e,menuOptions:n=[]}=t,{pathname:r}=ao.useLocation(),o=D.useMediaQuery(D.useTheme().breakpoints.down("sm")),[i,s]=X.useState(void 0);return X.useEffect(()=>{const a=n.findIndex(l=>l.path&&r.startsWith(l.path))??-1;s(a>=0?a:void 0)},[r,n]),!o&&n.length>0&&v.jsx(D.Box,{sx:e,children:v.jsx(D.Card,{sx:{height:"100%",width:200},children:v.jsx(wh,{orientation:"vertical",menuOptions:n,activeTabIdx:i})})})},Fpe=t=>{const{featureMenuOptions:e=[],activeTabIdx:n,sx:r}=t,{palette:o}=D.useTheme();return e.length>0&&v.jsx(wh,{menuOptions:e,activeTabIdx:n,sx:{margin:"8px",backgroundColor:o.primary.dark,borderRadius:"8px","& .MuiTab-root":{color:o.secondary.light,flexDirection:"row",gap:"2px","& .MuiTab-icon":{marginBottom:"unset"},minHeight:"58px"},"& .MuiTab-root.Mui-selected":{color:o.primary.contrastText,fontSize:"120%"},"& .MuiTabs-indicator":{display:"none"},...r}})},$pe=t=>v.jsx(Cu,{severity:"info",...t}),Bpe=t=>v.jsx(Cu,{severity:"warning",...t}),Dj=t=>{const{crumbInfo:e}=t,n=ao.useNavigate();return v.jsx(D.Breadcrumbs,{"aria-label":"breadcrumb",separator:v.jsx(p8,{color:"primary"}),sx:{marginBottom:2},children:e.map(({label:r,path:o},i)=>o&&i<e.length-1?v.jsx(D.Link,{color:"primary",sx:{cursor:"pointer"},onClick:()=>n(o),children:r},r):v.jsx(D.Typography,{color:"primary",children:r},r))})},zpe=t=>{const{title:e,message:n,type:r,onClose:o,autoHideDuration:i=8e3,variant:s="leftBorder",elevation:a=6}=t,l=Vpe(r);return v.jsx(D.Snackbar,{"data-testid":"message-snackbar",anchorOrigin:{vertical:"bottom",horizontal:"right"},open:!0,onClose:u=>{u==null&&o()},autoHideDuration:i,children:v.jsx(Cu,{"data-testid":"message-snackbar-alert",severity:l,iconMapping:{info:x2(r),warning:x2(r)},onClose:o,elevation:a,variant:s,children:n?v.jsxs(v.Fragment,{children:[v.jsx(D.AlertTitle,{"data-testid":"alertTitle",sx:{fontWeight:"bold"},children:e}),n]}):e})})},Vpe=t=>t=="logout"?"info":t=="timeout"?"warning":t,x2=t=>{if(t=="timeout")return v.jsx(jq,{});if(t=="logout")return v.jsx(d8,{})},Hpe=t=>{const{title:e,createButtonLabel:n,showAddButton:r=!1,onAdd:o=()=>alert("Not implemented yet"),breadcrumbs:i=[],children:s,sx:a}=t,l=D.useMediaQuery(D.useTheme().breakpoints.down("sm"));return r&&o.toString()==='() => alert("Not implemented yet")'&&console.warn('PageHeader: "showAddButton" is true but "onAdd" is not defined.'),v.jsxs(D.Box,{sx:a,children:[i.length>0&&v.jsx(Dj,{crumbInfo:i}),v.jsxs(D.Box,{className:"MBv2_PageHeader_Header",display:"flex",flexDirection:l?"column":"row",justifyContent:"space-between",alignItems:"center",gap:1,children:[v.jsxs(D.Box,{className:"MBv2_PageHeader_TitleAndCreateBtn",display:"flex",flexDirection:"row",justifyContent:l||!s?"space-between":"start",alignItems:"center",width:"100%",gap:1,children:[typeof e=="string"?v.jsx(D.Typography,{className:"MBv2_PageHeader_Title",variant:"h2",children:e}):e,r&&v.jsxs(qr,{className:"MBv2_PageHeader_CreateBtn",onClick:()=>o(),children:[v.jsx(Lq,{style:{marginRight:"0.5rem"}}),n]})]}),s&&v.jsx(D.Box,{width:l?"100%":"50%",children:s})]})]})},Wpe=t=>{const{title:e,titleIcon:n,fullWidthIcon:r=!1,children:o,actionLabel:i,action:s,sx:a}=t,l=D.useMediaQuery(D.useTheme().breakpoints.down("sm"));return v.jsxs(D.Card,{sx:a||{padding:"30px 40px",display:"flex",flexDirection:"column",gap:"1rem"},children:[n&&v.jsx(D.Box,{className:"MBv2_SingleActionCard_Img",sx:[r?{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",gap:"20px",marginBottom:"10px"}:{display:"inline"}],children:n}),v.jsx(D.Typography,{variant:"h1",display:"inline",fontSize:"calc(20px + .9vw)",className:"MBv2_SingleActionCard_Title",children:e}),o,v.jsx(D.Button,{variant:"contained",color:"primary",onClick:s,fullWidth:l,className:"MBv2_SingleActionCard_ActionButton",children:i})]})};function qpe({...t}){return v.jsx(Sj,{onSelectCitations:()=>{},onCancel:()=>{},renderAsSelectablePopup:!1,...t})}const Upe=({children:t,getCitations:e})=>{const[n,r]=X.useState([]),[o,i]=X.useState(!1);X.useEffect(()=>{(async()=>e().then(f=>{r(p=>{const m=new Set(p.map(b=>b.id));return[...p.filter(b=>!m.has(b.id)),...f]}),i(!0)}).catch(f=>{console.error(`Error fetching citations: ${f==null?void 0:f.toString()}`)}))()},[]);const s=X.useCallback(u=>{r(f=>{const p=f.map(b=>{const g=u.find(S=>S.id===b.id);return g||b}),m=new Set(f.map(b=>b.id)),y=u.filter(b=>!m.has(b.id));return[...p,...y]})},[]),a=X.useCallback(u=>{const f=n.findIndex(p=>p.id===u.id);r(f!==-1?p=>{const m=[...p];return m[f]=u,m}:[...n,u])},[n]),l=X.useCallback(u=>r(n.filter(f=>f.id!==u)),[n]);return v.jsx(Tj.Provider,{value:{citations:n,isLoaded:o,addUpdateCitation:a,deleteCitation:l,batchUpdate:s},children:t})},Kpe=t=>{const{size:e="small"}=t;let n=`${e}px`;switch(e){case"x-small":n="6px";break;case"small":n="10px";break;case"medium":n="14px";break;case"large":n="18px";break;case"x-large":n="22px";break}return v.jsx(D.Box,{height:n})};exports.AlertModal=Dpe;exports.Autocomplete=RR;exports.Breadcrumbs=Dj;exports.Button=qr;exports.Checkbox=AR;exports.CheckboxGroup=mq;exports.CitationField=_pe;exports.CitationFieldProvider=Upe;exports.CitationManager=qpe;exports.ConfirmationModal=Ipe;exports.DarkModeToggle=Ij;exports.DateField=Ef;exports.DateRangeField=FQ;exports.DecisionModal=Ppe;exports.Drawer=Ej;exports.DynamicAutocomplete=pq;exports.EnvironmentBanner=Mj;exports.ErrorAlert=vj;exports.FileList=yq;exports.FileUpload=IR;exports.FloatingNavBar=Fpe;exports.Footer=Npe;exports.FormDebugger=Mpe;exports.Header=jpe;exports.InfoAlert=$pe;exports.LoadingButton=B1;exports.LoadingIndicator=$v;exports.Location=Iq;exports.MenuButton=Oj;exports.Modal=Su;exports.MultiAutocomplete=hq;exports.NavBar=Aj;exports.NotApplicableCheckbox=kj;exports.PageHeader=Hpe;exports.PaginatedTable=lj;exports.ProfileMenu=Rj;exports.RadioGroup=LR;exports.RangeSlider=Dq;exports.RepeatableFormGroup=Rpe;exports.RichTextField=Sfe;exports.ScrollToTop=Epe;exports.SearchField=_8;exports.Select=Pq;exports.SelectableCitationManager=Cj;exports.Sidebar=Lpe;exports.SingleActionCard=Wpe;exports.Snackbar=zpe;exports.Spacer=Kpe;exports.Stepper=Ope;exports.Submit=kpe;exports.SuccessAlert=xj;exports.Switch=Nq;exports.Table=aj;exports.Tabs=wh;exports.TextField=Ps;exports.ValidationError=yr;exports.WarningAlert=Bpe;exports.commonTheme=Sn;exports.darkTheme=p6;exports.lightTheme=f6;
402
+ `+(a!==s?`result of cast: ${a}`:""))}return i}_cast(e,n){let r=e===void 0?e:this.transforms.reduce((o,i)=>i.call(this,o,e,this),e);return r===void 0&&(r=this.getDefault(n)),r}_validate(e,n={},r,o){let{path:i,originalValue:s=e,strict:a=this.spec.strict}=n,l=e;a||(l=this._cast(l,Object.assign({assert:!1},n)));let u=[];for(let f of Object.values(this.internalTests))f&&u.push(f);this.runTests({path:i,value:l,originalValue:s,options:n,tests:u},r,f=>{if(f.length)return o(f,l);this.runTests({path:i,value:l,originalValue:s,options:n,tests:this.tests},r,o)})}runTests(e,n,r){let o=!1,{tests:i,value:s,originalValue:a,path:l,options:u}=e,f=g=>{o||(o=!0,n(g,s))},p=g=>{o||(o=!0,r(g,s))},m=i.length,y=[];if(!m)return p([]);let b={value:s,originalValue:a,path:l,options:u,schema:this};for(let g=0;g<i.length;g++){const S=i[g];S(b,f,function(_){_&&(Array.isArray(_)?y.push(..._):y.push(_)),--m<=0&&p(y)})}}asNestedTest({key:e,index:n,parent:r,parentPath:o,originalParent:i,options:s}){const a=e??n;if(a==null)throw TypeError("Must include `key` or `index` for nested validations");const l=typeof a=="number";let u=r[a];const f=Object.assign({},s,{strict:!0,parent:r,value:u,originalValue:i[a],key:void 0,[l?"index":"key"]:a,path:l||a.includes(".")?`${o||""}[${l?a:`"${a}"`}]`:(o?`${o}.`:"")+e});return(p,m,y)=>this.resolve(f)._validate(u,f,m,y)}validate(e,n){var r;let o=this.resolve(Object.assign({},n,{value:e})),i=(r=n==null?void 0:n.disableStackTrace)!=null?r:o.spec.disableStackTrace;return new Promise((s,a)=>o._validate(e,n,(l,u)=>{fr.isError(l)&&(l.value=u),a(l)},(l,u)=>{l.length?a(new fr(l,u,void 0,void 0,i)):s(u)}))}validateSync(e,n){var r;let o=this.resolve(Object.assign({},n,{value:e})),i,s=(r=n==null?void 0:n.disableStackTrace)!=null?r:o.spec.disableStackTrace;return o._validate(e,Object.assign({},n,{sync:!0}),(a,l)=>{throw fr.isError(a)&&(a.value=l),a},(a,l)=>{if(a.length)throw new fr(a,e,void 0,void 0,s);i=l}),i}isValid(e,n){return this.validate(e,n).then(()=>!0,r=>{if(fr.isError(r))return!1;throw r})}isValidSync(e,n){try{return this.validateSync(e,n),!0}catch(r){if(fr.isError(r))return!1;throw r}}_getDefault(e){let n=this.spec.default;return n==null?n:typeof n=="function"?n.call(this,e):za(n)}getDefault(e){return this.resolve(e||{})._getDefault(e)}default(e){return arguments.length===0?this._getDefault():this.clone({default:e})}strict(e=!0){return this.clone({strict:e})}nullability(e,n){const r=this.clone({nullable:e});return r.internalTests.nullable=Ia({message:n,name:"nullable",test(o){return o===null?this.schema.spec.nullable:!0}}),r}optionality(e,n){const r=this.clone({optional:e});return r.internalTests.optionality=Ia({message:n,name:"optionality",test(o){return o===void 0?this.schema.spec.optional:!0}}),r}optional(){return this.optionality(!0)}defined(e=_o.defined){return this.optionality(!1,e)}nullable(){return this.nullability(!0)}nonNullable(e=_o.notNull){return this.nullability(!1,e)}required(e=_o.required){return this.clone().withMutation(n=>n.nonNullable(e).defined(e))}notRequired(){return this.clone().withMutation(e=>e.nullable().optional())}transform(e){let n=this.clone();return n.transforms.push(e),n}test(...e){let n;if(e.length===1?typeof e[0]=="function"?n={test:e[0]}:n=e[0]:e.length===2?n={name:e[0],test:e[1]}:n={name:e[0],message:e[1],test:e[2]},n.message===void 0&&(n.message=_o.default),typeof n.test!="function")throw new TypeError("`test` is a required parameters");let r=this.clone(),o=Ia(n),i=n.exclusive||n.name&&r.exclusiveTests[n.name]===!0;if(n.exclusive&&!n.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return n.name&&(r.exclusiveTests[n.name]=!!n.exclusive),r.tests=r.tests.filter(s=>!(s.OPTIONS.name===n.name&&(i||s.OPTIONS.test===o.OPTIONS.test))),r.tests.push(o),r}when(e,n){!Array.isArray(e)&&typeof e!="string"&&(n=e,e=".");let r=this.clone(),o=uj(e).map(i=>new na(i));return o.forEach(i=>{i.isSibling&&r.deps.push(i.key)}),r.conditions.push(typeof n=="function"?new yp(o,n):yp.fromOptions(o,n)),r}typeError(e){let n=this.clone();return n.internalTests.typeError=Ia({message:e,name:"typeError",skipAbsent:!0,test(r){return this.schema._typeCheck(r)?!0:this.createError({params:{type:this.schema.type}})}}),n}oneOf(e,n=_o.oneOf){let r=this.clone();return e.forEach(o=>{r._whitelist.add(o),r._blacklist.delete(o)}),r.internalTests.whiteList=Ia({message:n,name:"oneOf",skipAbsent:!0,test(o){let i=this.schema._whitelist,s=i.resolveAll(this.resolve);return s.includes(o)?!0:this.createError({params:{values:Array.from(i).join(", "),resolved:s}})}}),r}notOneOf(e,n=_o.notOneOf){let r=this.clone();return e.forEach(o=>{r._blacklist.add(o),r._whitelist.delete(o)}),r.internalTests.blacklist=Ia({message:n,name:"notOneOf",test(o){let i=this.schema._blacklist,s=i.resolveAll(this.resolve);return s.includes(o)?this.createError({params:{values:Array.from(i).join(", "),resolved:s}}):!0}}),r}strip(e=!0){let n=this.clone();return n.spec.strip=e,n}describe(e){const n=(e?this.resolve(e):this).clone(),{label:r,meta:o,optional:i,nullable:s}=n.spec;return{meta:o,label:r,optional:i,nullable:s,default:n.getDefault(e),type:n.type,oneOf:n._whitelist.describe(),notOneOf:n._blacklist.describe(),tests:n.tests.map(l=>({name:l.OPTIONS.name,params:l.OPTIONS.params})).filter((l,u,f)=>f.findIndex(p=>p.name===l.name)===u)}}}jo.prototype.__isYupSchema__=!0;for(const t of["validate","validateSync"])jo.prototype[`${t}At`]=function(e,n,r={}){const{parent:o,parentPath:i,schema:s}=Vfe(this,e,n,r.context);return s[t](o&&o[i],Object.assign({},r,{parent:o,path:e}))};for(const t of["equals","is"])jo.prototype[t]=jo.prototype.oneOf;for(const t of["not","nope"])jo.prototype[t]=jo.prototype.notOneOf;const Hfe=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function Wfe(t){const e=zv(t);if(!e)return Date.parse?Date.parse(t):Number.NaN;if(e.z===void 0&&e.plusMinus===void 0)return new Date(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond).valueOf();let n=0;return e.z!=="Z"&&e.plusMinus!==void 0&&(n=e.hourOffset*60+e.minuteOffset,e.plusMinus==="+"&&(n=0-n)),Date.UTC(e.year,e.month,e.day,e.hour,e.minute+n,e.second,e.millisecond)}function zv(t){var e,n;const r=Hfe.exec(t);return r?{year:ei(r[1]),month:ei(r[2],1)-1,day:ei(r[3],1),hour:ei(r[4]),minute:ei(r[5]),second:ei(r[6]),millisecond:r[7]?ei(r[7].substring(0,3)):0,precision:(e=(n=r[7])==null?void 0:n.length)!=null?e:void 0,z:r[8]||void 0,plusMinus:r[9]||void 0,hourOffset:ei(r[10]),minuteOffset:ei(r[11])}:null}function ei(t,e=0){return Number(t)||e}let qfe=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Ufe=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,Kfe=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,Yfe="^\\d{4}-\\d{2}-\\d{2}",Gfe="\\d{2}:\\d{2}:\\d{2}",Jfe="(([+-]\\d{2}(:?\\d{2})?)|Z)",Zfe=new RegExp(`${Yfe}T${Gfe}(\\.\\d+)?${Jfe}$`),Xfe=t=>Ds(t)||t===t.trim(),Qfe={}.toString();function Vv(){return new hj}class hj extends jo{constructor(){super({type:"string",check(e){return e instanceof String&&(e=e.valueOf()),typeof e=="string"}}),this.withMutation(()=>{this.transform((e,n,r)=>{if(!r.spec.coerce||r.isType(e)||Array.isArray(e))return e;const o=e!=null&&e.toString?e.toString():e;return o===Qfe?e:o})})}required(e){return super.required(e).withMutation(n=>n.test({message:e||_o.required,name:"required",skipAbsent:!0,test:r=>!!r.length}))}notRequired(){return super.notRequired().withMutation(e=>(e.tests=e.tests.filter(n=>n.OPTIONS.name!=="required"),e))}length(e,n=ur.length){return this.test({message:n,name:"length",exclusive:!0,params:{length:e},skipAbsent:!0,test(r){return r.length===this.resolve(e)}})}min(e,n=ur.min){return this.test({message:n,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(r){return r.length>=this.resolve(e)}})}max(e,n=ur.max){return this.test({name:"max",exclusive:!0,message:n,params:{max:e},skipAbsent:!0,test(r){return r.length<=this.resolve(e)}})}matches(e,n){let r=!1,o,i;return n&&(typeof n=="object"?{excludeEmptyString:r=!1,message:o,name:i}=n:o=n),this.test({name:i||"matches",message:o||ur.matches,params:{regex:e},skipAbsent:!0,test:s=>s===""&&r||s.search(e)!==-1})}email(e=ur.email){return this.matches(qfe,{name:"email",message:e,excludeEmptyString:!0})}url(e=ur.url){return this.matches(Ufe,{name:"url",message:e,excludeEmptyString:!0})}uuid(e=ur.uuid){return this.matches(Kfe,{name:"uuid",message:e,excludeEmptyString:!1})}datetime(e){let n="",r,o;return e&&(typeof e=="object"?{message:n="",allowOffset:r=!1,precision:o=void 0}=e:n=e),this.matches(Zfe,{name:"datetime",message:n||ur.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:n||ur.datetime_offset,params:{allowOffset:r},skipAbsent:!0,test:i=>{if(!i||r)return!0;const s=zv(i);return s?!!s.z:!1}}).test({name:"datetime_precision",message:n||ur.datetime_precision,params:{precision:o},skipAbsent:!0,test:i=>{if(!i||o==null)return!0;const s=zv(i);return s?s.precision===o:!1}})}ensure(){return this.default("").transform(e=>e===null?"":e)}trim(e=ur.trim){return this.transform(n=>n!=null?n.trim():n).test({message:e,name:"trim",test:Xfe})}lowercase(e=ur.lowercase){return this.transform(n=>Ds(n)?n:n.toLowerCase()).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>Ds(n)||n===n.toLowerCase()})}uppercase(e=ur.uppercase){return this.transform(n=>Ds(n)?n:n.toUpperCase()).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>Ds(n)||n===n.toUpperCase()})}}Vv.prototype=hj.prototype;let epe=new Date(""),tpe=t=>Object.prototype.toString.call(t)==="[object Date]";class Ch extends jo{constructor(){super({type:"date",check(e){return tpe(e)&&!isNaN(e.getTime())}}),this.withMutation(()=>{this.transform((e,n,r)=>!r.spec.coerce||r.isType(e)||e===null?e:(e=Wfe(e),isNaN(e)?Ch.INVALID_DATE:new Date(e)))})}prepareParam(e,n){let r;if(na.isRef(e))r=e;else{let o=this.cast(e);if(!this._typeCheck(o))throw new TypeError(`\`${n}\` must be a Date or a value that can be \`cast()\` to a Date`);r=o}return r}min(e,n=Bv.min){let r=this.prepareParam(e,"min");return this.test({message:n,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(o){return o>=this.resolve(r)}})}max(e,n=Bv.max){let r=this.prepareParam(e,"max");return this.test({message:n,name:"max",exclusive:!0,params:{max:e},skipAbsent:!0,test(o){return o<=this.resolve(r)}})}}Ch.INVALID_DATE=epe;Ch.prototype;function npe(t,e=[]){let n=[],r=new Set,o=new Set(e.map(([s,a])=>`${s}-${a}`));function i(s,a){let l=zs.split(s)[0];r.add(l),o.has(`${a}-${l}`)||n.push([a,l])}for(const s of Object.keys(t)){let a=t[s];r.add(s),na.isRef(a)&&a.isSibling?i(a.path,s):z1(a)&&"deps"in a&&a.deps.forEach(l=>i(l,s))}return Rfe.array(Array.from(r),n).reverse()}function m2(t,e){let n=1/0;return t.some((r,o)=>{var i;if((i=e.path)!=null&&i.includes(r))return n=o,!0}),n}function mj(t){return(e,n)=>m2(t,e)-m2(t,n)}const rpe=(t,e,n)=>{if(typeof t!="string")return t;let r=t;try{r=JSON.parse(t)}catch{}return n.isType(r)?r:t};function pf(t){if("fields"in t){const e={};for(const[n,r]of Object.entries(t.fields))e[n]=pf(r);return t.setFields(e)}if(t.type==="array"){const e=t.optional();return e.innerType&&(e.innerType=pf(e.innerType)),e}return t.type==="tuple"?t.optional().clone({types:t.spec.types.map(pf)}):"optional"in t?t.optional():t}const ope=(t,e)=>{const n=[...zs.normalizePath(e)];if(n.length===1)return n[0]in t;let r=n.pop(),o=zs.getter(zs.join(n),!0)(t);return!!(o&&r in o)};let g2=t=>Object.prototype.toString.call(t)==="[object Object]";function y2(t,e){let n=Object.keys(t.fields);return Object.keys(e).filter(r=>n.indexOf(r)===-1)}const ipe=mj([]);function gj(t){return new yj(t)}class yj extends jo{constructor(e){super({type:"object",check(n){return g2(n)||typeof n=="function"}}),this.fields=Object.create(null),this._sortErrors=ipe,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{e&&this.shape(e)})}_cast(e,n={}){var r;let o=super._cast(e,n);if(o===void 0)return this.getDefault(n);if(!this._typeCheck(o))return o;let i=this.fields,s=(r=n.stripUnknown)!=null?r:this.spec.noUnknown,a=[].concat(this._nodes,Object.keys(o).filter(p=>!this._nodes.includes(p))),l={},u=Object.assign({},n,{parent:l,__validating:n.__validating||!1}),f=!1;for(const p of a){let m=i[p],y=p in o;if(m){let b,g=o[p];u.path=(n.path?`${n.path}.`:"")+p,m=m.resolve({value:g,context:n.context,parent:l});let S=m instanceof jo?m.spec:void 0,C=S==null?void 0:S.strict;if(S!=null&&S.strip){f=f||p in o;continue}b=!n.__validating||!C?m.cast(o[p],u):o[p],b!==void 0&&(l[p]=b)}else y&&!s&&(l[p]=o[p]);(y!==p in l||l[p]!==o[p])&&(f=!0)}return f?l:o}_validate(e,n={},r,o){let{from:i=[],originalValue:s=e,recursive:a=this.spec.recursive}=n;n.from=[{schema:this,value:s},...i],n.__validating=!0,n.originalValue=s,super._validate(e,n,r,(l,u)=>{if(!a||!g2(u)){o(l,u);return}s=s||u;let f=[];for(let p of this._nodes){let m=this.fields[p];!m||na.isRef(m)||f.push(m.asNestedTest({options:n,key:p,parent:u,parentPath:n.path,originalParent:s}))}this.runTests({tests:f,value:u,originalValue:s,options:n},r,p=>{o(p.sort(this._sortErrors).concat(l),u)})})}clone(e){const n=super.clone(e);return n.fields=Object.assign({},this.fields),n._nodes=this._nodes,n._excludedEdges=this._excludedEdges,n._sortErrors=this._sortErrors,n}concat(e){let n=super.concat(e),r=n.fields;for(let[o,i]of Object.entries(this.fields)){const s=r[o];r[o]=s===void 0?i:s}return n.withMutation(o=>o.setFields(r,[...this._excludedEdges,...e._excludedEdges]))}_getDefault(e){if("default"in this.spec)return super._getDefault(e);if(!this._nodes.length)return;let n={};return this._nodes.forEach(r=>{var o;const i=this.fields[r];let s=e;(o=s)!=null&&o.value&&(s=Object.assign({},s,{parent:s.value,value:s.value[r]})),n[r]=i&&"getDefault"in i?i.getDefault(s):void 0}),n}setFields(e,n){let r=this.clone();return r.fields=e,r._nodes=npe(e,n),r._sortErrors=mj(Object.keys(e)),n&&(r._excludedEdges=n),r}shape(e,n=[]){return this.clone().withMutation(r=>{let o=r._excludedEdges;return n.length&&(Array.isArray(n[0])||(n=[n]),o=[...r._excludedEdges,...n]),r.setFields(Object.assign(r.fields,e),o)})}partial(){const e={};for(const[n,r]of Object.entries(this.fields))e[n]="optional"in r&&r.optional instanceof Function?r.optional():r;return this.setFields(e)}deepPartial(){return pf(this)}pick(e){const n={};for(const r of e)this.fields[r]&&(n[r]=this.fields[r]);return this.setFields(n,this._excludedEdges.filter(([r,o])=>e.includes(r)&&e.includes(o)))}omit(e){const n=[];for(const r of Object.keys(this.fields))e.includes(r)||n.push(r);return this.pick(n)}from(e,n,r){let o=zs.getter(e,!0);return this.transform(i=>{if(!i)return i;let s=i;return ope(i,e)&&(s=Object.assign({},i),r||delete s[e],s[n]=o(i)),s})}json(){return this.transform(rpe)}exact(e){return this.test({name:"exact",exclusive:!0,message:e||ff.exact,test(n){if(n==null)return!0;const r=y2(this.schema,n);return r.length===0||this.createError({params:{properties:r.join(", ")}})}})}stripUnknown(){return this.clone({noUnknown:!0})}noUnknown(e=!0,n=ff.noUnknown){typeof e!="boolean"&&(n=e,e=!0);let r=this.test({name:"noUnknown",exclusive:!0,message:n,test(o){if(o==null)return!0;const i=y2(this.schema,o);return!e||i.length===0||this.createError({params:{unknown:i.join(", ")}})}});return r.spec.noUnknown=e,r}unknown(e=!0,n=ff.noUnknown){return this.noUnknown(!e,n)}transformKeys(e){return this.transform(n=>{if(!n)return n;const r={};for(const o of Object.keys(n))r[e(o)]=n[o];return r})}camelCase(){return this.transformKeys(P0.camelCase)}snakeCase(){return this.transformKeys(P0.snakeCase)}constantCase(){return this.transformKeys(e=>P0.snakeCase(e).toUpperCase())}describe(e){const n=(e?this.resolve(e):this).clone(),r=super.describe(e);r.fields={};for(const[i,s]of Object.entries(n.fields)){var o;let a=e;(o=a)!=null&&o.value&&(a=Object.assign({},a,{parent:a.value,value:a.value[i]})),r.fields[i]=s.describe(a)}return r}}gj.prototype=yj.prototype;const spe=t=>{const{title:e,onSave:n,onCancel:r,disableFileUpload:o=!1,modifyCitation:i,readOnly:s=!1,showCloseBtn:a=!1}=t,l=X.useRef(null),[u,f]=X.useState(!1),[p,m]=X.useState({type:"Attachment",title:"",file:void 0,fileName:""});return X.useEffect(()=>{i&&m({...i,type:"Attachment",file:void 0})},[]),v.jsxs(v.Fragment,{children:[v.jsxs(D.Box,{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",children:[v.jsx(D.Typography,{variant:"h6",margin:"10px 0",children:e}),a&&v.jsx(D.IconButton,{onClick:r,children:v.jsx(Dp,{})})]}),v.jsx(qt.Formik,{innerRef:l,enableReinitialize:!0,initialValues:p,validationSchema:gj().shape({title:Vv().required("Title is required"),fileName:Vv().required("A file is required")}),onSubmit:async y=>{f(!0),n(y).catch(b=>{throw f(!1),b}).finally(()=>f(!1))},children:({values:y,setFieldValue:b})=>{var g;return X.useEffect(()=>{var S,C;(S=y.file)!=null&&S.name&&b("fileName",(C=y.file)==null?void 0:C.name)},[(g=y.file)==null?void 0:g.name]),v.jsxs(qt.Form,{autoComplete:"off",children:[v.jsx(Ps,{name:"title",disabled:u,required:!0,margin:"none",readOnly:s}),v.jsxs(D.Box,{marginTop:o||s?0:1,children:[v.jsxs(D.Box,{display:"flex",flexDirection:"row",alignItems:"flex-start",children:[!o&&!s&&v.jsx(IR,{name:"file",errorMode:"hidden"}),v.jsx(Ps,{readOnly:!0,name:"fileName",label:s||o?"File Name":""})]}),v.jsx(yr,{name:"fileName"})]}),v.jsx(D.DialogActions,{sx:{px:0},children:s?v.jsx(D.Button,{onClick:r,size:"small",variant:"contained",children:"Back to Table"}):v.jsxs(v.Fragment,{children:[v.jsx(D.Button,{onClick:r,variant:"outlined",size:"small",children:"Cancel"}),v.jsx(B1,{size:"small",loading:u,children:i?"Update Attachment":"Upload Attachment"})]})})]})}})]})},Su=t=>{const{open:e=!1,onClose:n,title:r,children:o,actions:i,closeBtnLabel:s,closeButtonPosition:a,closeButtonProps:l={},disableDismiss:u=!1,...f}=t;if(!e)return null;const p=a==="bottom"||a==="top-and-bottom",m=a==="top"||a==="top-and-bottom",y=()=>{if(s&&p)return v.jsx(D.Button,{className:"MBv2_Modal_Close",onClick:t.onClose,...l,children:s})},b=()=>{if(i)return v.jsx(D.DialogActions,{className:"MBv2_Modal_Actions",children:v.jsxs(D.Box,{display:"flex",flexDirection:"row",justifyContent:"space-between",width:"100%",gap:"0.25rem",children:[v.jsx(D.Box,{children:y()}),v.jsxs(D.Box,{display:"flex",gap:".25rem",children:[...i]})]})});if(s&&p)return v.jsx(D.DialogActions,{className:"MBv2_Modal_Actions",children:v.jsx(D.Box,{children:y()})})};return v.jsxs(D.Dialog,{className:"MBv2_Modal",open:e,onClose:()=>{u||n==null||n()},...f,children:[typeof r=="string"?v.jsx(D.DialogTitle,{className:"MBv2_Modal_Title",children:v.jsxs(D.Box,{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",children:[r,m&&v.jsx(D.IconButton,{"data-testid":"modal-header-close-btn",onClick:n,children:v.jsx(Dp,{})})]})}):r,o&&(typeof o=="string"?v.jsx(D.DialogContent,{className:"MBv2_Modal_Content",children:v.jsx(D.DialogContentText,{className:"MBv2_Modal_Content_Text",children:o})}):o),b()]})};function ape(t){return Ye("MuiAlert",t)}const b2=We("MuiAlert",["root","action","icon","message","filled","colorSuccess","colorInfo","colorWarning","colorError","filledSuccess","filledInfo","filledWarning","filledError","outlined","outlinedSuccess","outlinedInfo","outlinedWarning","outlinedError","standard","standardSuccess","standardInfo","standardWarning","standardError"]),lpe=Le(v.jsx("path",{d:"M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2, 4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0, 0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"}),"SuccessOutlined"),cpe=Le(v.jsx("path",{d:"M12 5.99L19.53 19H4.47L12 5.99M12 2L1 21h22L12 2zm1 14h-2v2h2v-2zm0-6h-2v4h2v-4z"}),"ReportProblemOutlined"),upe=Le(v.jsx("path",{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),"ErrorOutline"),dpe=Le(v.jsx("path",{d:"M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20, 12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10, 10 0 0,0 12,2M11,17H13V11H11V17Z"}),"InfoOutlined"),fpe=Le(v.jsx("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close"),ppe=t=>{const{variant:e,color:n,severity:r,classes:o}=t,i={root:["root",`color${Re(n||r)}`,`${e}${Re(n||r)}`,`${e}`],icon:["icon"],message:["message"],action:["action"]};return Ke(i,ape,o)},hpe=ve(pl,{name:"MuiAlert",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[n.variant],e[`${n.variant}${Re(n.color||n.severity)}`]]}})(It(({theme:t})=>{const e=t.palette.mode==="light"?Za:Mc,n=t.palette.mode==="light"?Mc:Za;return{...t.typography.body2,backgroundColor:"transparent",display:"flex",padding:"6px 16px",variants:[...Object.entries(t.palette).filter(Hn(["light"])).map(([r])=>({props:{colorSeverity:r,variant:"standard"},style:{color:t.vars?t.vars.palette.Alert[`${r}Color`]:e(t.palette[r].light,.6),backgroundColor:t.vars?t.vars.palette.Alert[`${r}StandardBg`]:n(t.palette[r].light,.9),[`& .${b2.icon}`]:t.vars?{color:t.vars.palette.Alert[`${r}IconColor`]}:{color:t.palette[r].main}}})),...Object.entries(t.palette).filter(Hn(["light"])).map(([r])=>({props:{colorSeverity:r,variant:"outlined"},style:{color:t.vars?t.vars.palette.Alert[`${r}Color`]:e(t.palette[r].light,.6),border:`1px solid ${(t.vars||t).palette[r].light}`,[`& .${b2.icon}`]:t.vars?{color:t.vars.palette.Alert[`${r}IconColor`]}:{color:t.palette[r].main}}})),...Object.entries(t.palette).filter(Hn(["dark"])).map(([r])=>({props:{colorSeverity:r,variant:"filled"},style:{fontWeight:t.typography.fontWeightMedium,...t.vars?{color:t.vars.palette.Alert[`${r}FilledColor`],backgroundColor:t.vars.palette.Alert[`${r}FilledBg`]}:{backgroundColor:t.palette.mode==="dark"?t.palette[r].dark:t.palette[r].main,color:t.palette.getContrastText(t.palette[r].main)}}}))]}})),mpe=ve("div",{name:"MuiAlert",slot:"Icon",overridesResolver:(t,e)=>e.icon})({marginRight:12,padding:"7px 0",display:"flex",fontSize:22,opacity:.9}),gpe=ve("div",{name:"MuiAlert",slot:"Message",overridesResolver:(t,e)=>e.message})({padding:"8px 0",minWidth:0,overflow:"auto"}),ype=ve("div",{name:"MuiAlert",slot:"Action",overridesResolver:(t,e)=>e.action})({display:"flex",alignItems:"flex-start",padding:"4px 0 0 16px",marginLeft:"auto",marginRight:-8}),v2={success:v.jsx(lpe,{fontSize:"inherit"}),warning:v.jsx(cpe,{fontSize:"inherit"}),error:v.jsx(upe,{fontSize:"inherit"}),info:v.jsx(dpe,{fontSize:"inherit"})},bj=A.forwardRef(function(e,n){const r=St({props:e,name:"MuiAlert"}),{action:o,children:i,className:s,closeText:a="Close",color:l,components:u={},componentsProps:f={},icon:p,iconMapping:m=v2,onClose:y,role:b="alert",severity:g="success",slotProps:S={},slots:C={},variant:_="standard",...T}=r,w={...r,color:l,severity:g,variant:_,colorSeverity:l||g},E=ppe(w),O={slots:{closeButton:u.CloseButton,closeIcon:u.CloseIcon,...C},slotProps:{...f,...S}},[N,P]=Bt("root",{ref:n,shouldForwardComponentProp:!0,className:Pe(E.root,s),elementType:hpe,externalForwardedProps:{...O,...T},ownerState:w,additionalProps:{role:b,elevation:0}}),[j,M]=Bt("icon",{className:E.icon,elementType:mpe,externalForwardedProps:O,ownerState:w}),[R,B]=Bt("message",{className:E.message,elementType:gpe,externalForwardedProps:O,ownerState:w}),[F,$]=Bt("action",{className:E.action,elementType:ype,externalForwardedProps:O,ownerState:w}),[z,L]=Bt("closeButton",{elementType:hl,externalForwardedProps:O,ownerState:w}),[W,q]=Bt("closeIcon",{elementType:fpe,externalForwardedProps:O,ownerState:w});return v.jsxs(N,{...P,children:[p!==!1?v.jsx(j,{...M,children:p||m[g]||v2[g]}):null,v.jsx(R,{...B,children:i}),o!=null?v.jsx(F,{...$,children:o}):null,o==null&&y?v.jsx(F,{...$,children:v.jsx(z,{size:"small","aria-label":a,title:a,color:"inherit",onClick:y,...L,children:v.jsx(W,{fontSize:"small",...q})})}):null]})});process.env.NODE_ENV!=="production"&&(bj.propTypes={action:c.node,children:c.node,classes:c.object,className:c.string,closeText:c.string,color:c.oneOfType([c.oneOf(["error","info","success","warning"]),c.string]),components:c.shape({CloseButton:c.elementType,CloseIcon:c.elementType}),componentsProps:c.shape({closeButton:c.object,closeIcon:c.object}),icon:c.node,iconMapping:c.shape({error:c.node,info:c.node,success:c.node,warning:c.node}),onClose:c.func,role:c.string,severity:c.oneOfType([c.oneOf(["error","info","success","warning"]),c.string]),slotProps:c.shape({action:c.oneOfType([c.func,c.object]),closeButton:c.oneOfType([c.func,c.object]),closeIcon:c.oneOfType([c.func,c.object]),icon:c.oneOfType([c.func,c.object]),message:c.oneOfType([c.func,c.object]),root:c.oneOfType([c.func,c.object])}),slots:c.shape({action:c.elementType,closeButton:c.elementType,closeIcon:c.elementType,icon:c.elementType,message:c.elementType,root:c.elementType}),sx:c.oneOfType([c.arrayOf(c.oneOfType([c.func,c.object,c.bool])),c.func,c.object]),variant:c.oneOfType([c.oneOf(["filled","outlined","standard"]),c.string])});const Cu=t=>{var y;const{noIcon:e=!1,children:n,severity:r="success",variant:o="leftBorder",sx:i,title:s,...a}=t,{palette:l}=D.useTheme(),u=e?{icon:!1}:{},f=o==="leftBorder"?"standard":o,p=o==="leftBorder"?{...i,borderLeft:`4px solid ${(y=l[r])==null?void 0:y.main}`}:i,m=s?{icon:{sx:{mt:"6px"}}}:{};return v.jsxs(bj,{severity:r,variant:f,sx:p,slotProps:m,...u,...a,children:[s&&v.jsx(D.Typography,{variant:"h3",children:s}),n]})},vj=t=>v.jsx(Cu,{severity:"error",...t}),xj=t=>v.jsx(Cu,{severity:"success",...t}),bpe=t=>{const{alert:e,setAlert:n}=t,r=()=>n(void 0);return v.jsxs(v.Fragment,{children:[(e==null?void 0:e.type)==="Error"&&v.jsx(vj,{"data-testid":"citation-menu-error",onClose:r,title:e.title,children:e.message.toString()}),(e==null?void 0:e.type)==="Success"&&v.jsx(xj,{"data-testid":"citation-menu-success",onClose:r,children:e.message})]})};function Sj({getCitationsPaginated:t,onCreateCitation:e,onUpdateCitation:n,onDeleteCitation:r,getCitationById:o,onDownloadAttachment:i,onSelectCitations:s,onCancel:a,initialSelectedIds:l=[],onContentChange:u,onError:f=()=>{},renderAsSelectablePopup:p=!1,addlActions:m,canLaunchUrl:y,readOnly:b}){const[g,S]=X.useState("Insert Citation/Attachment(s)"),[C,_]=X.useState(l),[T,w]=X.useState(void 0),[E,O]=X.useState(void 0),N=ae=>{O(void 0),S(ae)},[P,j]=X.useState(0);X.useEffect(()=>{u==null||u()},[g,E,u]);const M=(ae=!1)=>{(!p||ae)&&j(de=>de+1)},R=(ae,de)=>{var se;const ee=typeof((se=de.response)==null?void 0:se.data)=="string"&&de.response.data,he=typeof de.message=="string"&&de.message;O({type:"Error",title:ae,message:ee??he}),f(de)},B=ae=>O({type:"Success",title:"",message:ae}),F=async ae=>{if(g==="Insert Citation/Attachment(s)")throw Error("onSave called with invalid state");if(g==="Edit Citation"||g==="Edit Attachment"){if(ae.id===void 0)throw Error("Failed to update citation. Citation is missing id");await(n==null?void 0:n(ae).then(()=>{N("Insert Citation/Attachment(s)"),M()}).catch(ee=>{R("Failed to update",ee)}))}else await(e==null?void 0:e(ae).then(ee=>{_([...C,ee.id]),N("Insert Citation/Attachment(s)"),M()}).catch(ee=>{R("Failed to create",ee)}))},$=r&&(async ae=>r(ae).then(()=>{M(!0),_(C.filter(de=>de!==ae)),B("Successfully deleted")}).catch(de=>R("Failed to delete",de))),z=(ae,de)=>{o(ae.id).then(ee=>{w(ee),N(de)}).catch(ee=>{R("Failed to load",ee)})},L=i&&(async ae=>i(ae).catch(de=>{R(`Failed to download ${ae.fileName}`,de)})),W=v.jsx(Tfe,{refreshKey:P,getCitationsPaginated:ae=>t(ae).then(de=>(u==null||u(),de)),onCancel:a,onNewCitation:()=>{w(void 0),N("Add Citation")},onNewAttachment:()=>{w(void 0),N("Add Attachment")},onEditCitation:ae=>z(ae,b?"View Citation":"Edit Citation"),onEditAttachment:ae=>z(ae,b?"View Attachment":"Edit Attachment"),onDeleteCitation:$,onDownloadAttachment:L,onSelect:s,setSelectedIds:_,selectedIds:C,onError:f,condenseTable:p,canSelect:p,title:p&&!b?g:"Attachments & Citations",addlActions:m,canCreate:!!e,canEdit:!!n,canDelete:!!$,canLaunchUrl:y,readOnly:b,showCloseBtn:p}),q=v.jsx(_fe,{modifyCitation:T,onSave:F,onCancel:()=>N("Insert Citation/Attachment(s)"),title:g,readOnly:g==="View Citation",showCloseBtn:p}),G=v.jsx(spe,{onSave:F,onCancel:()=>N("Insert Citation/Attachment(s)"),modifyCitation:T,disableFileUpload:g==="Edit Attachment",title:g,readOnly:g==="View Attachment",showCloseBtn:p}),U=v.jsx(bpe,{alert:E,setAlert:O}),Z=g==="Add Citation"||g==="Edit Citation"||g==="View Citation",pe=g==="Add Attachment"||g==="Edit Attachment"||g==="View Attachment";if(p){let ae=null;return!p||g==="Insert Citation/Attachment(s)"?ae=W:Z?ae=q:pe&&(ae=G),v.jsxs(D.Box,{width:"500px",children:[U,v.jsx(D.Box,{paddingTop:"8px",children:ae})]})}return v.jsxs(D.Box,{width:"100%",children:[g==="Insert Citation/Attachment(s)"&&U,v.jsx(D.Box,{paddingTop:"8px",children:W}),v.jsx(Su,{open:Z||pe,children:v.jsxs(D.Box,{padding:"10px 20px",minWidth:"400px","data-testid":"citation-form-modal",children:[U,Z?q:G]})})]})}function Cj({...t}){return v.jsx(Sj,{renderAsSelectablePopup:!0,...t})}const vpe=Yt({name:{CitationBubbleMenuTipTap:wj}})(t=>({content:{padding:t.spacing(1.5,2,.5),backgroundColor:"#f9f9f9"}}));function wj({getCitationsPaginated:t,onCreateCitation:e,onUpdateCitation:n,onDeleteCitation:r,getCitationById:o,onDownloadAttachment:i,canLaunchUrl:s,readOnly:a,...l}){const{classes:u}=vpe(),f=vt();if(f&&!("citationBubbleMenuHandler"in(f==null?void 0:f.storage)))throw new Error("You must add the CitationBubbleMenuHandler extension to the useEditor `extensions` array in order to use this component!");const p=f==null?void 0:f.storage.citationBubbleMenuHandler,m=p.isOpen,y=p.selectedIds,b=p.selectedNodePos,g=T=>{f&&(T.length===0?f.commands.deleteCitation(b):y.length===0?f.commands.insertCitation({ids:T}):f.commands.updateCitation({ids:T},b))},S=T=>{g(T),f==null||f.commands.closeCitationBubbleMenu()},C=()=>{g(y),f==null||f.commands.closeCitationBubbleMenu()},_=X.useCallback(()=>{requestAnimationFrame(()=>{f!=null&&f.view&&f.view.dispatch(f.view.state.tr)})},[f]);return f?v.jsx(gh,{editor:f,open:m,...p.bubbleMenuOptions,...l,children:v.jsx("div",{className:u.content,children:v.jsx(Cj,{getCitationsPaginated:t,onCreateCitation:e,onUpdateCitation:n,onDeleteCitation:r,getCitationById:o,onDownloadAttachment:i,onSelectCitations:S,onCancel:C,initialSelectedIds:y,onContentChange:_,canLaunchUrl:s,readOnly:a})})}):null}const xpe=un.create({name:"starterKit",addExtensions(){const t=[];return this.options.bold!==!1&&t.push(RN.configure(this.options.bold)),this.options.blockquote!==!1&&t.push(ON.configure(this.options.blockquote)),this.options.bulletList!==!1&&t.push(AN.configure(this.options.bulletList)),this.options.code!==!1&&t.push(IN.configure(this.options.code)),this.options.codeBlock!==!1&&t.push(DN.configure(this.options.codeBlock)),this.options.document!==!1&&t.push(PN.configure(this.options.document)),this.options.dropcursor!==!1&&t.push(NN.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&t.push(jN.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&t.push(LN.configure(this.options.hardBreak)),this.options.heading!==!1&&t.push(hN.configure(this.options.heading)),this.options.history!==!1&&t.push(VN.configure(this.options.history)),this.options.horizontalRule!==!1&&t.push(HN.configure(this.options.horizontalRule)),this.options.italic!==!1&&t.push(WN.configure(this.options.italic)),this.options.listItem!==!1&&t.push(ej.configure(this.options.listItem)),this.options.orderedList!==!1&&t.push(tj.configure(this.options.orderedList)),this.options.paragraph!==!1&&t.push(nj.configure(this.options.paragraph)),this.options.strike!==!1&&t.push(oj.configure(this.options.strike)),this.options.text!==!1&&t.push(ij.configure(this.options.text)),t}}),Spe=()=>un.create({name:"citationBubbleMenuHandler",addStorage(){return{isOpen:!1,selectedIds:[],bubbleMenuOptions:void 0,selectedNodePos:0}},addCommands(){return{openCitationBubbleMenu:(t={},e)=>({editor:n,dispatch:r})=>{var a;const{doc:o}=n.state,i=o.nodeAt(e??0),s=((a=i==null?void 0:i.attrs)==null?void 0:a.ids)??[];return r&&(this.storage.isOpen=!0,this.storage.selectedIds=s,this.storage.bubbleMenuOptions=t,this.storage.selectedNodePos=e??0),!0},closeCitationBubbleMenu:()=>({commands:t,dispatch:e})=>this.storage.isOpen?(t.focus(),e&&(this.storage.isOpen=!1,this.storage.selectedIds=[],this.storage.selectedNodePos=0),!0):!1}},onSelectionUpdate(){this.storage.isOpen&&!this.editor.isActive("citation")&&this.editor.commands.closeCitationBubbleMenu()},addKeyboardShortcuts(){return{"Mod-Shift-c":()=>(this.editor.commands.openCitationBubbleMenu(),!0)}}});function Cpe(t){const e=vt(),n=X.useRef(null);return v.jsx(mt,{buttonRef:n,tooltipLabel:"Insert Citation/Attachment",tooltipShortcutKeys:["mod","Shift","C"],disabled:!(e!=null&&e.isEditable),onClick:()=>e==null?void 0:e.commands.openCitationBubbleMenu({anchorEl:n.current,placement:"bottom"}),...t,children:v.jsxs(D.Box,{display:"flex",flexDirection:"row",gap:"4px",alignItems:"center",children:[v.jsx($q,{fontSize:"small"}),v.jsx(D.Typography,{variant:"body2",children:"Insert Citation/Attachment"})]})})}const Tj=X.createContext(void 0),_j=()=>{const t=X.useContext(Tj);if(!t)throw new Error("useSync must be used inside CitationFieldProvider");return t},wpe=({node:t,HTMLAttributes:e,selected:n,extension:r,updateAttributes:o,deleteNode:i})=>{const s=t.attrs.ids||[],{citations:a,isLoaded:l}=_j(),[u,f]=X.useState(String(s)),[p,m]=X.useState([]),y=r.options.citationMaxLength;if(X.useEffect(()=>{if(!l)return;const b=a.filter(C=>s.includes(C.id)),g=b.map(C=>yf.truncate(C.title,{length:y,omission:"..."})).join(", ");f(g),m(b);const S=b.map(C=>C.id);S.length===0?setTimeout(i,0):S.length!==s.length&&setTimeout(()=>o({ids:b.map(C=>C.id)}),0)},[a,s,l]),p.length!==0)return v.jsx(x1,{as:"span",...e,"data-testid":"citation-node-component",children:v.jsx(D.Tooltip,{title:v.jsx(D.Box,{className:"citation-tooltip",children:p.map((b,g)=>{var C;const S=[b.source,b.title,b.fileName,b.url,(C=b.accessedAt)==null?void 0:C.slice(0,10),b.classification];return v.jsxs(D.Typography,{variant:"subtitle2",children:[S.filter(Boolean).join(" | "),g<p.length-1&&v.jsx(D.Divider,{className:"citation-tooltip-divider"})]},b.id)})}),slotProps:{tooltip:{sx:{maxWidth:500}}},children:v.jsx("a",{href:"#",onClick:b=>{b.preventDefault(),b.stopPropagation()},className:n?"selected-citation-link":"citation-link",children:u})})})},Tpe=en.create({name:"citation",group:"inline",inline:!0,atom:!0,selectable:!0,addAttributes(){return{ids:{default:[],parseHTML:t=>{const e=t.getAttribute("ids");return e?e.split(",").map(n=>parseInt(n.trim(),10)).filter(n=>!isNaN(n)):[]},renderHTML:t=>({ids:Array.isArray(t.ids)?t.ids.join(","):""})}}},parseHTML(){return[{tag:"citation"}]},renderHTML({HTMLAttributes:t}){return["citation",bt(t)]},addNodeView(){return S1(wpe)},addProseMirrorPlugins(){return[new tn({props:{handleClickOn:(t,e,n,r,o,i)=>n&&n.type.name==="citation"?(this.editor.commands.openCitationBubbleMenu({},r),!0):!1}})]},addCommands(){return{insertCitation:t=>({commands:e})=>e.insertContent({type:"citation",attrs:t}),updateCitation:(t,e)=>({state:n,dispatch:r,tr:o})=>{const i=n.doc.nodeAt(e);return!i||i.type.name!=="citation"?!1:(o.setNodeMarkup(e,void 0,t),r&&r(o),!0)},deleteCitation:t=>({tr:e,dispatch:n})=>{if(typeof t!="number")return!1;const r=t,o=t+1;return n&&n(e.delete(r,o)),!0}}}}),kj=t=>v.jsx(AR,{name:t.name,label:"Not Applicable",errorMode:"hidden"}),_pe=t=>{const{name:e,label:n=Mn(e),hideLabel:r=!1,required:o=!1,readOnly:i=!1,margin:s="dense",citationMaxLength:a=24,getCitationsPaginated:l,onCreateCitation:u,onUpdateCitation:f,onDeleteCitation:p,getCitationById:m,onDownloadAttachment:y,onError:b=()=>{},placeholder:g="Start typing here...",notApplicableName:S,errorMode:C="normal",canLaunchUrl:_}=t,T=[xpe,rj.configure({placeholder:g}),Spe(),Tpe.configure({citationMaxLength:a})],[w,E,O]=qt.useField({name:e}),{setValue:N}=O,{value:P}=w,{addUpdateCitation:j,deleteCitation:M,batchUpdate:R}=_j();X.useEffect(()=>{var q;const L=(q=B==null?void 0:B.current)==null?void 0:q.editor;if(!L)return;L.getHTML()!==P&&setTimeout(()=>{L.commands.setContent(P)},0)},[P]);const B=X.useRef(null),F={normal:{marginTop:"16px",marginBottom:"8px"},dense:{marginTop:"8px",marginBottom:"4px"},none:{margin:0}},$=()=>{var q,G;const L=((G=(q=B.current)==null?void 0:q.editor)==null?void 0:G.getHTML())??"",W=!L.replace(/<\/?p>|<br>/g,"").trim();N(W?"":L)},z=v.jsxs(D.Box,{id:`citation-field_${e}`,sx:{"& .ProseMirror":{"& h1, & h2, & h3, & h4, & h5, & h6":{scrollMarginTop:i?0:50}}},...F[s],children:[v.jsx(ZP,{ref:B,extensions:T,content:P,editable:!i,renderControls:i?void 0:()=>v.jsx(bh,{children:v.jsx(Cpe,{})}),onBlur:$,RichTextFieldProps:{variant:"outlined",MenuBarProps:{hide:i}},children:()=>v.jsx(wj,{getCitationsPaginated:L=>l(L).then(W=>(R(W.data),W)),onCreateCitation:u&&(L=>u(L).then(W=>(j(W),W))),onUpdateCitation:f&&(L=>f(L).then(W=>(j(W),W))),onDeleteCitation:p&&(L=>p(L).then(()=>M(L))),getCitationById:m,onDownloadAttachment:y,onError:b,canLaunchUrl:_,readOnly:i})}),v.jsx(yr,{name:e,id:`${e}-err`,errorMode:C})]});return v.jsxs(D.Box,{display:"flex",flexDirection:"column",width:"100%",children:[v.jsxs(D.Box,{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",children:[!r&&v.jsx(D.InputLabel,{htmlFor:`citation-field_${e}`,required:o,children:n}),S&&v.jsx(kj,{name:S})]}),z]})},kpe=t=>{const{name:e="submit"}=t;return v.jsx(qr,{name:e,type:"submit",...t})},Epe=t=>{const{label:e="Return to Top",icon:n=Kd,scrollThresholdPx:r=100}=t,o=D.useScrollTrigger({threshold:r}),i=X.useCallback(()=>{window.scrollTo({top:0,behavior:"smooth"})},[]);return v.jsx(D.Zoom,{in:o,children:v.jsx(D.Box,{sx:{position:"fixed",bottom:32,right:32,zIndex:1},children:v.jsxs(D.Fab,{onClick:i,color:"primary",size:"small",variant:"extended","aria-label":"Scroll back to top",children:[v.jsx(n,{fontSize:"medium"}),e]})})})},Ej=t=>{const{label:e,menuOptions:n=[],icon:r}=t,o=ao.useNavigate(),[i,s]=A.useState(null),a=!!i,l=f=>{s(f.currentTarget)},u=()=>{s(null)};return n.length===0?null:v.jsxs(v.Fragment,{children:[v.jsx(D.Button,{startIcon:r,variant:"outlined",color:"inherit",sx:{minWidth:0,padding:1},onClick:l,children:e}),v.jsx(D.Menu,{anchorEl:i,open:a,onClick:u,children:n.map(f=>v.jsxs(D.MenuItem,{...Zc(f,o),children:[f.icon&&v.jsx(D.ListItemIcon,{children:f.icon}),v.jsx(D.ListItemText,{primary:f.label})]},f.label))})]})},Mpe=()=>{const{values:t,errors:e,status:n}=qt.useFormikContext(),{palette:r}=D.useTheme();return v.jsx(D.Paper,{style:{backgroundColor:r.mode==="dark"?"#303030":"#f0f0f0",margin:"10px 0"},children:v.jsxs(D.List,{children:[v.jsxs(D.ListItem,{children:[v.jsx(D.Typography,{display:"block",variant:"h6",children:"Values"}),v.jsx("br",{}),v.jsx(D.Divider,{variant:"inset"}),v.jsx("pre",{children:JSON.stringify(t,null,2)})]}),v.jsx(D.Divider,{variant:"inset",component:"li"}),v.jsxs(D.ListItem,{id:"testing",children:[v.jsx(D.Typography,{display:"block",variant:"h6",children:"Errors"}),v.jsx("br",{}),v.jsx(D.Divider,{variant:"inset"}),v.jsx("pre",{children:JSON.stringify(e,null,2)})]}),v.jsxs(D.ListItem,{children:[v.jsx(D.Typography,{display:"block",variant:"h6",children:"Status"}),v.jsx("br",{}),v.jsx(D.Divider,{variant:"inset"}),v.jsx("pre",{children:JSON.stringify(n,null,2)})]})]})})},Ope=t=>{const{steps:e,orientation:n,inlineLabel:r=n=="vertical",isResponsive:o=!1}=t,{width:i}=cj();let s=!r,a=n;o&&(n&&console.warn("Stepper: Ignoring orientation. isResponsive is set to true, so the orientation is determined automatically based on the window size."),a=i<600?"vertical":"horizontal",a=="vertical"?s=!1:s=!r),n=="vertical"&&!r&&(console.warn("Stepper: ignoring inlineLabel={false}. Must use inline labels when orientation is vertical"),s=!1);const l=["steps","inlineLabel","orientation","isResponsive"],u={alternativeLabel:s,orientation:a,...er({...t},l)};return v.jsx(D.Stepper,{...u,children:e.map(f=>v.jsx(D.Step,{children:v.jsx(D.StepLabel,{children:f})},f))})},Rpe=t=>{const{name:e,label:n=Mn(e),labelProps:r={fontSize:"1.1em",color:"#808080",fontWeight:"600"},initialState:o,renderFormGroup:i,addButtonContent:s="Add Another",removeButtonContent:a=t.removePosition==="right"?v.jsx(y8,{}):"Remove",variant:l="card",addButtonSx:u,removeButtonSx:f,allowRemoveAll:p=!1,readOnly:m=!1,emptyListMsg:y="None",showDivider:b=!1,removePosition:g="bottom"}=t,[S]=qt.useField({name:e}),{value:C}=S,_=T=>({display:"flex",flexDirection:T==="bottom"?"column":"row",alignItems:T==="bottom"?"flex-start":"center"});return v.jsxs(D.FormControl,{fullWidth:!0,children:[v.jsx(D.Typography,{...r,children:n}),m&&S.value.length===0?v.jsx(D.Typography,{children:y}):v.jsx(qt.FieldArray,{name:e,render:T=>v.jsxs("div",{children:[C.map((w,E)=>v.jsx(X.Fragment,{children:v.jsx(Ape,{variant:l,content:v.jsxs(D.Box,{"data-testid":"form-group-container",sx:typeof g=="string"?_(g):{...g},children:[v.jsxs(D.Box,{width:"100%",children:[i(`${e}.${E}`,E),b&&E!==C.length-1&&v.jsx(D.Divider,{"data-testid":"divider"})]}),!m&&C.length>(p?0:1)&&v.jsx(D.Button,{"data-testid":"repeatable-form-group_remove-btn",sx:f,onClick:()=>T.remove(E),children:a})]})})},`${e}-${E}`)),!m&&v.jsx(D.Button,{"data-testid":"repeatable-form-group_add-btn",onClick:()=>T.push(o),sx:u,children:s})]})})]})},Ape=({variant:t,content:e})=>{switch(t){case"card":return v.jsx(D.Card,{"data-testid":"repeatable-form-group_card",sx:{padding:"8px",marginBottom:"8px"},children:v.jsx(D.CardContent,{children:e})});case"elevatedCard":return v.jsx(D.Card,{"data-testid":"repeatable-form-group_elevated-card",elevation:4,sx:{border:"unset",padding:"8px",marginBottom:"8px"},children:v.jsx(D.CardContent,{children:e})});case"none":return e}},Ipe=t=>{const{confirmBtnLabel:e,onConfirm:n,confirmButtonProps:r={color:"primary",variant:"contained"},closeBtnLabel:o="Cancel",closeButtonPosition:i="bottom",...s}=t;return v.jsx(Su,{actions:[v.jsx(D.Button,{className:"MBv2_ConfirmationModal_ConfirmBtn",onClick:n,...r,children:e})],closeBtnLabel:o,closeButtonPosition:i,...s})},Dpe=t=>{const{closeBtnLabel:e="OK",closeButtonPosition:n="bottom",closeButtonProps:r={color:"primary",variant:"contained"},...o}=t;return v.jsx(Su,{closeBtnLabel:e,closeButtonPosition:n,closeButtonProps:r,...o})},Ppe=t=>{const{primaryBtnLabel:e,onPrimaryAction:n,primaryActionProps:r={color:"primary",variant:"contained"},secondaryBtnLabel:o,onSecondaryAction:i,secondaryActionProps:s={color:"primary",variant:"outlined"},closeBtnLabel:a="Cancel",closeButtonPosition:l="bottom",...u}=t;return v.jsx(Su,{actions:[v.jsx(D.Button,{className:"MBv2_DecisionModal_SecondaryAction",onClick:i,...s,children:o}),v.jsx(D.Button,{className:"MBv2_DecisionModal_PrimaryAction",onClick:n,...r,children:e})],closeBtnLabel:a,closeButtonPosition:l,...u})},Npe=t=>{const{featureMenuOptions:e=[],copyright:n,logo:r,sx:o={},fontColor:i="primary"}=t,{palette:s}=D.useTheme(),a=ao.useNavigate();return v.jsxs(D.Box,{className:"MBv2_Footer",sx:{backgroundColor:s.mode==="dark"?"#222222":"#ededed",padding:"25px 30px",...o},children:[v.jsx(D.Box,{className:"MBv2_Footer_Logo",sx:{display:"flex",gap:2,alignItems:"center",paddingBottom:1},children:typeof r=="string"?v.jsx("img",{draggable:"false",src:r,style:{width:"200px"},alt:"logo"}):r}),v.jsxs(D.Box,{display:"flex",justifyContent:"space-between",flexWrap:"wrap",className:"MBv2_Footer_Nav_Links_Container",gap:2,children:[v.jsx(D.Box,{sx:{flexGrow:1},className:"MBv2_Footer_Nav_Links",display:"flex",flexDirection:"row",justifyContent:"flex-start",gap:3,children:e==null?void 0:e.map(l=>v.jsx(D.Link,{"data-testid":l.label,sx:{cursor:"pointer",fontSize:15},color:i,...Zc(l,a),children:l.label},l.label))}),n&&v.jsx(D.Typography,{style:{fontSize:15},"data-testid":"copyright",className:"MBv2_Footer_Copyright",color:i,children:n})]})]})},Mj=t=>{const{menuOptionLists:e,anchor:n="left",children:r}=t,{pathname:o}=ao.useLocation(),i=ao.useNavigate(),[s,a]=X.useState(!1),l=(m,y)=>v.jsx(D.MenuList,{children:m.map(b=>v.jsxs(D.MenuItem,{...Zc(b,i,()=>a(!1)),children:[b.icon&&v.jsx(D.ListItemIcon,{children:b.icon}),v.jsx(D.ListItemText,{primary:b.label})]},`mobile-drawer-group-${y}-item-${b.path}`))}),f=(()=>{if(e){const m=e.filter(y=>y&&y.length>0);return m.length===0?null:m.map((y,b)=>v.jsxs(X.Fragment,{children:[l(y,b),b<m.length-1&&v.jsx(D.Divider,{})]},`mobile-drawer-group-${b}`))}return r?v.jsx(D.Box,{role:"presentation",onClick:()=>a(!1),children:r}):null})(),p=f??!1;return X.useEffect(()=>{a(!1)},[o]),p&&v.jsxs(v.Fragment,{children:[v.jsx(D.IconButton,{onClick:()=>a(!0),color:"inherit",title:"Menu",children:v.jsx(f8,{})}),v.jsx(D.Drawer,{"data-testid":"mobile-drawer",anchor:n,open:s,onClose:()=>a(!1),children:v.jsx(D.Box,{sx:{width:300},display:"flex",flexDirection:"column",justifyContent:"space-between",children:v.jsx(D.Box,{display:"flex",justifyContent:"start",flexDirection:"column",children:f})})})]})},Oj=t=>{const{env:e,isProd:n}=t;return n?null:v.jsx(D.Paper,{sx:{borderRadius:0,display:"flex",alignItems:"center",justifyContent:"center"},children:v.jsxs(D.Typography,{variant:"h6",color:"error",children:[e," Environment - Test Data Only"]})})},Rj=t=>{const{displayName:e,userMenuOptions:n}=t;return v.jsx(Ej,{label:e,menuOptions:n,icon:v.jsx(h8,{})})},wh=t=>{const{menuOptions:e,orientation:n="horizontal",activeTabIdx:r,sx:o=n=="vertical"?{"& .MuiTabs-indicator":{left:0}}:void 0,slotProps:i={indicator:{sx:n=="horizontal"?{height:4}:{width:4}}}}=t,{palette:s}=D.useTheme(),a=ao.useNavigate();return v.jsx(D.Tabs,{orientation:n,value:r??!1,sx:o,slotProps:i,children:e.map((l,u)=>v.jsx(D.Tab,{icon:l.icon,label:l.label,value:u,...Zc(l,a),sx:{alignItems:n=="vertical"?"flex-start":void 0,borderBottom:n=="vertical"?"1px solid":void 0,borderColor:"divider","&.Mui-selected":{backgroundColor:n=="vertical"?s.grey[s.mode=="dark"?800:50]:void 0,color:"inherit"}}},l.label))})},Aj=t=>{const{featureMenuOptions:e=[],activeTabIdx:n,sx:r}=t;return e.length>0&&v.jsx(D.Paper,{sx:{pl:4,pr:4,borderRadius:0},"data-testid":"navBar",children:v.jsx(wh,{menuOptions:e,activeTabIdx:n,sx:r})})},Ij=t=>{const{onToggle:e}=t,{palette:n}=D.useTheme(),r=n.mode==="dark";return v.jsx(D.IconButton,{onClick:e,color:"inherit",title:"Dark Mode Toggle",children:r?v.jsx(BR,{}):v.jsx(FR,{})})},jpe=t=>{const{envInfo:e,headerRef:n,logo:r,featureMenuOptions:o=[],userMenuOptions:i=[],onToggleDarkMode:s,quickLinks:a=[],displayName:l,banner:u,position:f="fixed",children:p,sx:m,navBarSx:y}=t,b=ao.useNavigate(),g=D.useMediaQuery(D.useTheme().breakpoints.down("sm")),{palette:S}=D.useTheme(),{pathname:C}=ao.useLocation(),_=S.mode==="dark",[T,w]=A.useState(void 0);A.useEffect(()=>{const N=o.findIndex(P=>P.path&&C.startsWith(P.path));w(N>=0?N:void 0)},[C,o]);const E=s&&v.jsx(Ij,{onToggle:s}),O=s&&(g||!g&&l)?[{icon:_?v.jsx(BR,{}):v.jsx(FR,{}),label:`Switch to ${_?"Light":"Dark"} mode`,onClick:s},...i]:i;return v.jsxs(D.AppBar,{ref:n,position:f,sx:m,elevation:4,children:[e&&v.jsx(Oj,{...e}),u,v.jsxs(D.Toolbar,{sx:{color:"white",display:"flex",justifyContent:"space-between",gap:2},children:[v.jsx(D.Button,{disableRipple:!0,component:ao.Link,to:"/",children:r&&typeof r=="string"?v.jsx("img",{draggable:"false",src:r,style:{width:"200px",filter:"brightness(0) invert(1)"},alt:"logo"}):r}),v.jsxs(D.Box,{display:"flex",gap:2,alignItems:"center",children:[!l&&!g&&E,g&&v.jsx(Mj,{menuOptionLists:[o,a,O],anchor:"right"}),!g&&v.jsxs(v.Fragment,{children:[v.jsx(D.Box,{display:"flex",gap:0,children:a==null?void 0:a.map((N,P)=>v.jsxs(D.Box,{display:"flex",alignItems:"center",children:[P>0&&v.jsx(D.Typography,{className:"quickLink-divider",color:S.primary.contrastText,children:"|"}),v.jsx(D.Button,{variant:"text",sx:{color:"white"},...Zc(N,b),children:v.jsxs(D.Box,{display:"flex",gap:"3px",alignItems:"center",children:[N.icon,N.label]})})]},N.label))}),p,l&&v.jsx(Rj,{displayName:l,userMenuOptions:O})]})]})]}),!g&&v.jsx(Aj,{featureMenuOptions:o,activeTabIdx:T,sx:y})]})},Lpe=t=>{const{sx:e,menuOptions:n=[]}=t,{pathname:r}=ao.useLocation(),o=D.useMediaQuery(D.useTheme().breakpoints.down("sm")),[i,s]=X.useState(void 0);return X.useEffect(()=>{const a=n.findIndex(l=>l.path&&r.startsWith(l.path))??-1;s(a>=0?a:void 0)},[r,n]),!o&&n.length>0&&v.jsx(D.Box,{sx:e,children:v.jsx(D.Card,{sx:{height:"100%",width:200},children:v.jsx(wh,{orientation:"vertical",menuOptions:n,activeTabIdx:i})})})},Fpe=t=>{const{featureMenuOptions:e=[],activeTabIdx:n,sx:r}=t,{palette:o}=D.useTheme();return e.length>0&&v.jsx(wh,{menuOptions:e,activeTabIdx:n,sx:{margin:"8px",backgroundColor:o.primary.dark,borderRadius:"8px","& .MuiTab-root":{color:o.secondary.light,flexDirection:"row",gap:"2px","& .MuiTab-icon":{marginBottom:"unset"},minHeight:"58px"},"& .MuiTab-root.Mui-selected":{color:o.primary.contrastText,fontSize:"120%"},"& .MuiTabs-indicator":{display:"none"},...r}})},$pe=t=>v.jsx(Cu,{severity:"info",...t}),Bpe=t=>v.jsx(Cu,{severity:"warning",...t}),Dj=t=>{const{crumbInfo:e}=t,n=ao.useNavigate();return v.jsx(D.Breadcrumbs,{"aria-label":"breadcrumb",separator:v.jsx(p8,{color:"primary"}),sx:{marginBottom:2},children:e.map(({label:r,path:o},i)=>o&&i<e.length-1?v.jsx(D.Link,{color:"primary",sx:{cursor:"pointer"},onClick:()=>n(o),children:r},r):v.jsx(D.Typography,{color:"primary",children:r},r))})},zpe=t=>{const{title:e,message:n,type:r,onClose:o,autoHideDuration:i=8e3,variant:s="leftBorder",elevation:a=6}=t,l=Vpe(r);return v.jsx(D.Snackbar,{"data-testid":"message-snackbar",anchorOrigin:{vertical:"bottom",horizontal:"right"},open:!0,onClose:u=>{u==null&&o()},autoHideDuration:i,children:v.jsx(Cu,{"data-testid":"message-snackbar-alert",severity:l,iconMapping:{info:x2(r),warning:x2(r)},onClose:o,elevation:a,variant:s,children:n?v.jsxs(v.Fragment,{children:[v.jsx(D.AlertTitle,{"data-testid":"alertTitle",sx:{fontWeight:"bold"},children:e}),n]}):e})})},Vpe=t=>t=="logout"?"info":t=="timeout"?"warning":t,x2=t=>{if(t=="timeout")return v.jsx(jq,{});if(t=="logout")return v.jsx(d8,{})},Hpe=t=>{const{title:e,createButtonLabel:n,showAddButton:r=!1,onAdd:o=()=>alert("Not implemented yet"),breadcrumbs:i=[],children:s,sx:a}=t,l=D.useMediaQuery(D.useTheme().breakpoints.down("sm"));return r&&o.toString()==='() => alert("Not implemented yet")'&&console.warn('PageHeader: "showAddButton" is true but "onAdd" is not defined.'),v.jsxs(D.Box,{sx:a,children:[i.length>0&&v.jsx(Dj,{crumbInfo:i}),v.jsxs(D.Box,{className:"MBv2_PageHeader_Header",display:"flex",flexDirection:l?"column":"row",justifyContent:"space-between",alignItems:"center",gap:1,children:[v.jsxs(D.Box,{className:"MBv2_PageHeader_TitleAndCreateBtn",display:"flex",flexDirection:"row",justifyContent:l||!s?"space-between":"start",alignItems:"center",width:"100%",gap:1,children:[typeof e=="string"?v.jsx(D.Typography,{className:"MBv2_PageHeader_Title",variant:"h2",children:e}):e,r&&v.jsxs(qr,{className:"MBv2_PageHeader_CreateBtn",onClick:()=>o(),children:[v.jsx(Lq,{style:{marginRight:"0.5rem"}}),n]})]}),s&&v.jsx(D.Box,{width:l?"100%":"50%",children:s})]})]})},Wpe=t=>{const{title:e,titleIcon:n,fullWidthIcon:r=!1,children:o,actionLabel:i,action:s,sx:a}=t,l=D.useMediaQuery(D.useTheme().breakpoints.down("sm"));return v.jsxs(D.Card,{sx:a||{padding:"30px 40px",display:"flex",flexDirection:"column",gap:"1rem"},children:[n&&v.jsx(D.Box,{className:"MBv2_SingleActionCard_Img",sx:[r?{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",gap:"20px",marginBottom:"10px"}:{display:"inline"}],children:n}),v.jsx(D.Typography,{variant:"h1",display:"inline",fontSize:"calc(20px + .9vw)",className:"MBv2_SingleActionCard_Title",children:e}),o,v.jsx(D.Button,{variant:"contained",color:"primary",onClick:s,fullWidth:l,className:"MBv2_SingleActionCard_ActionButton",children:i})]})};function qpe({...t}){return v.jsx(Sj,{onSelectCitations:()=>{},onCancel:()=>{},renderAsSelectablePopup:!1,...t})}const Upe=({children:t,getCitations:e})=>{const[n,r]=X.useState([]),[o,i]=X.useState(!1);X.useEffect(()=>{(async()=>e().then(f=>{r(p=>{const m=new Set(p.map(b=>b.id));return[...p.filter(b=>!m.has(b.id)),...f]}),i(!0)}).catch(f=>{console.error(`Error fetching citations: ${f==null?void 0:f.toString()}`)}))()},[]);const s=X.useCallback(u=>{r(f=>{const p=f.map(b=>{const g=u.find(S=>S.id===b.id);return g||b}),m=new Set(f.map(b=>b.id)),y=u.filter(b=>!m.has(b.id));return[...p,...y]})},[]),a=X.useCallback(u=>{const f=n.findIndex(p=>p.id===u.id);r(f!==-1?p=>{const m=[...p];return m[f]=u,m}:[...n,u])},[n]),l=X.useCallback(u=>r(n.filter(f=>f.id!==u)),[n]);return v.jsx(Tj.Provider,{value:{citations:n,isLoaded:o,addUpdateCitation:a,deleteCitation:l,batchUpdate:s},children:t})},Kpe=t=>{const{size:e="small"}=t;let n=`${e}px`;switch(e){case"x-small":n="6px";break;case"small":n="10px";break;case"medium":n="14px";break;case"large":n="18px";break;case"x-large":n="22px";break}return v.jsx(D.Box,{height:n})};exports.AlertModal=Dpe;exports.Autocomplete=RR;exports.Breadcrumbs=Dj;exports.Button=qr;exports.Checkbox=AR;exports.CheckboxGroup=mq;exports.CitationField=_pe;exports.CitationFieldProvider=Upe;exports.CitationManager=qpe;exports.ConfirmationModal=Ipe;exports.DarkModeToggle=Ij;exports.DateField=Ef;exports.DateRangeField=FQ;exports.DecisionModal=Ppe;exports.Drawer=Mj;exports.DynamicAutocomplete=pq;exports.EnvironmentBanner=Oj;exports.ErrorAlert=vj;exports.FileList=yq;exports.FileUpload=IR;exports.FloatingNavBar=Fpe;exports.Footer=Npe;exports.FormDebugger=Mpe;exports.Header=jpe;exports.InfoAlert=$pe;exports.LoadingButton=B1;exports.LoadingIndicator=$v;exports.Location=Iq;exports.MenuButton=Ej;exports.Modal=Su;exports.MultiAutocomplete=hq;exports.NavBar=Aj;exports.NotApplicableCheckbox=kj;exports.PageHeader=Hpe;exports.PaginatedTable=lj;exports.ProfileMenu=Rj;exports.RadioGroup=LR;exports.RangeSlider=Dq;exports.RepeatableFormGroup=Rpe;exports.RichTextField=Sfe;exports.ScrollToTop=Epe;exports.SearchField=_8;exports.Select=Pq;exports.SelectableCitationManager=Cj;exports.Sidebar=Lpe;exports.SingleActionCard=Wpe;exports.Snackbar=zpe;exports.Spacer=Kpe;exports.Stepper=Ope;exports.Submit=kpe;exports.SuccessAlert=xj;exports.Switch=Nq;exports.Table=aj;exports.Tabs=wh;exports.TextField=Ps;exports.ValidationError=yr;exports.WarningAlert=Bpe;exports.commonTheme=Sn;exports.darkTheme=p6;exports.lightTheme=f6;