@simoncomputing/mui-bueno-v2 0.16.1 → 0.16.2

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/CHANGELOG.md CHANGED
@@ -11,6 +11,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
11
11
  - Minor increment --> singlular/minor changes. Minimal breaking changes.
12
12
  - Patch increment --> singlular/minor changes. Zero breaking changes.
13
13
 
14
+ ## [0.16.2] - 2025-08-15
15
+
16
+ ### Added
17
+
18
+ - `Table`: Made mobile cards horizontally scrollable when the contents are too wide to fit in the card. Made the mobile cards column names avoid text wrap to make them easier to read.
19
+
14
20
  ## [0.16.1] - 2025-08-12
15
21
 
16
22
  ### Added
package/dist/index.cjs.js CHANGED
@@ -396,7 +396,7 @@ img.ProseMirror-separator {
396
396
  `,Jae="️",Zae="‍",Tv="";let Ld=null,jd=null;function Xae(t=[]){const e={};ur.groups=e;const n=new ur;Ld==null&&(Ld=KR(Wae)),jd==null&&(jd=KR(qae)),Oe(n,"'",O1),Oe(n,"{",xc),Oe(n,"}",Sc),Oe(n,"[",Bf),Oe(n,"]",Vf),Oe(n,"(",zf),Oe(n,")",Hf),Oe(n,"<",Wf),Oe(n,">",qf),Oe(n,"(",Uf),Oe(n,")",Kf),Oe(n,"「",Yf),Oe(n,"」",Gf),Oe(n,"『",Jf),Oe(n,"』",Zf),Oe(n,"<",Xf),Oe(n,">",Qf),Oe(n,"&",ep),Oe(n,"*",tp),Oe(n,"@",Ai),Oe(n,"`",rp),Oe(n,"^",op),Oe(n,":",Pi),Oe(n,",",R1),Oe(n,"$",ip),Oe(n,".",xo),Oe(n,"=",sp),Oe(n,"!",A1),Oe(n,"-",$r),Oe(n,"%",Cc),Oe(n,"|",ap),Oe(n,"+",lp),Oe(n,"#",cp),Oe(n,"?",wc),Oe(n,'"',I1),Oe(n,"/",So),Oe(n,";",D1),Oe(n,"~",Tc),Oe(n,"_",up),Oe(n,"\\",np),Oe(n,"・",yN);const r=rn(n,Zo,k1,{[k0]:!0});rn(r,Zo,r);const o=rn(r,Jo,mN,{[vc]:!0}),i=rn(r,Ul,gN,{[oc]:!0}),s=rn(n,Jo,ei,{[M0]:!0});rn(s,Zo,o),rn(s,Jo,s),rn(o,Zo,o),rn(o,Jo,o);const a=rn(n,Ul,A0,{[O0]:!0});rn(a,Jo),rn(a,Zo,i),rn(a,Ul,a),rn(i,Zo,i),rn(i,Jo),rn(i,Ul,i);const l=Oe(n,wv,M1,{[xv]:!0}),u=Oe(n,UR,P0,{[xv]:!0}),f=rn(n,Cv,P0,{[xv]:!0});Oe(n,Tv,f),Oe(u,wv,l),Oe(u,Tv,f),rn(u,Cv,f),Oe(f,UR),Oe(f,wv),rn(f,Cv,f),Oe(f,Tv,f);const p=rn(n,Sv,bN,{[hN]:!0});Oe(p,"#"),rn(p,Sv,p),Oe(p,Jae,p);const m=Oe(p,Zae);Oe(m,"#"),rn(m,Sv,p);const g=[[Jo,s],[Zo,o]],b=[[Jo,null],[Ul,a],[Zo,i]];for(let y=0;y<Ld.length;y++)Ei(n,Ld[y],I0,ei,g);for(let y=0;y<jd.length;y++)Ei(n,jd[y],D0,A0,b);As(I0,{tld:!0,ascii:!0},e),As(D0,{utld:!0,alpha:!0},e),Ei(n,"file",af,ei,g),Ei(n,"mailto",af,ei,g),Ei(n,"http",_a,ei,g),Ei(n,"https",_a,ei,g),Ei(n,"ftp",_a,ei,g),Ei(n,"ftps",_a,ei,g),As(af,{scheme:!0,ascii:!0},e),As(_a,{slashscheme:!0,ascii:!0},e),t=t.sort((y,S)=>y[0]>S[0]?1:-1);for(let y=0;y<t.length;y++){const S=t[y][0],E=t[y][1]?{[Uae]:!0}:{[Kae]:!0};S.indexOf("-")>=0?E[R0]=!0:Jo.test(S)?Zo.test(S)?E[vc]=!0:E[M0]=!0:E[k0]=!0,qR(n,S,S,E)}return qR(n,"localhost",Kc,{ascii:!0}),n.jd=new ur(dp),{start:n,tokens:cl({groups:e},vN)}}function xN(t,e){const n=Qae(e.replace(/[A-Z]/g,a=>a.toLowerCase())),r=n.length,o=[];let i=0,s=0;for(;s<r;){let a=t,l=null,u=0,f=null,p=-1,m=-1;for(;s<r&&(l=a.go(n[s]));)a=l,a.accepts()?(p=0,m=0,f=a):p>=0&&(p+=n[s].length,m++),u+=n[s].length,i+=n[s].length,s++;i-=p,s-=m,u-=p,o.push({t:f.t,v:e.slice(i-u,i),s:i-u,e:i})}return o}function Qae(t){const e=[],n=t.length;let r=0;for(;r<n;){let o=t.charCodeAt(r),i,s=o<55296||o>56319||r+1===n||(i=t.charCodeAt(r+1))<56320||i>57343?t[r]:t.slice(r,r+2);e.push(s),r+=s.length}return e}function Ei(t,e,n,r,o){let i;const s=e.length;for(let a=0;a<s-1;a++){const l=e[a];t.j[l]?i=t.j[l]:(i=new ur(r),i.jr=o.slice(),t.j[l]=i),t=i}return i=new ur(n),i.jr=o.slice(),t.j[e[s-1]]=i,i}function KR(t){const e=[],n=[];let r=0,o="0123456789";for(;r<t.length;){let i=0;for(;o.indexOf(t[r+i])>=0;)i++;if(i>0){e.push(n.join(""));for(let s=parseInt(t.substring(r,r+i),10);s>0;s--)n.pop();r+=i}else n.push(t[r]),r++}return e}const Yc={defaultProtocol:"http",events:null,format:YR,formatHref:YR,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function P1(t,e=null){let n=cl({},Yc);t&&(n=cl(n,t instanceof P1?t.o:t));const r=n.ignoreTags,o=[];for(let i=0;i<r.length;i++)o.push(r[i].toUpperCase());this.o=n,e&&(this.defaultRender=e),this.ignoreTags=o}P1.prototype={o:Yc,ignoreTags:[],defaultRender(t){return t},check(t){return this.get("validate",t.toString(),t)},get(t,e,n){const r=e!=null;let o=this.o[t];return o&&(typeof o=="object"?(o=n.t in o?o[n.t]:Yc[t],typeof o=="function"&&r&&(o=o(e,n))):typeof o=="function"&&r&&(o=o(e,n.t,n)),o)},getObj(t,e,n){let r=this.o[t];return typeof r=="function"&&e!=null&&(r=r(e,n.t,n)),r},render(t){const e=t.render(this);return(this.get("render",null,t)||this.defaultRender)(e,t.t,t)}};function YR(t){return t}function SN(t,e){this.t="token",this.v=t,this.tk=e}SN.prototype={isLink:!1,toString(){return this.v},toHref(t){return this.toString()},toFormattedString(t){const e=this.toString(),n=t.get("truncate",e,this),r=t.get("format",e,this);return n&&r.length>n?r.substring(0,n)+"…":r},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t=Yc.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){const e=this,n=this.toHref(t.get("defaultProtocol")),r=t.get("formatHref",n,this),o=t.get("tagName",n,e),i=this.toFormattedString(t),s={},a=t.get("className",n,e),l=t.get("target",n,e),u=t.get("rel",n,e),f=t.getObj("attributes",n,e),p=t.getObj("events",n,e);return s.href=r,a&&(s.class=a),l&&(s.target=l),u&&(s.rel=u),f&&cl(s,f),{tagName:o,attributes:s,content:i,eventListeners:p}}};function mh(t,e){class n extends SN{constructor(o,i){super(o,i),this.t=t}}for(const r in e)n.prototype[r]=e[r];return n.t=t,n}const GR=mh("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),JR=mh("text"),ele=mh("nl"),$d=mh("url",{isLink:!0,toHref(t=Yc.defaultProtocol){return this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==Kc&&t[1].t===Pi}}),jr=t=>new ur(t);function tle({groups:t}){const e=t.domain.concat([ep,tp,Ai,np,rp,op,ip,sp,$r,k1,Cc,ap,lp,cp,So,dp,Tc,up]),n=[Pi,R1,xo,A1,Cc,wc,I1,D1,Wf,qf,xc,Sc,Vf,Bf,zf,Hf,Uf,Kf,Yf,Gf,Jf,Zf,Xf,Qf],r=[ep,O1,tp,np,rp,op,ip,sp,$r,xc,Sc,Cc,ap,lp,cp,wc,So,dp,Tc,up],o=jr(),i=Oe(o,Tc);at(i,r,i),at(i,t.domain,i);const s=jr(),a=jr(),l=jr();at(o,t.domain,s),at(o,t.scheme,a),at(o,t.slashscheme,l),at(s,r,i),at(s,t.domain,s);const u=Oe(s,Ai);Oe(i,Ai,u),Oe(a,Ai,u),Oe(l,Ai,u);const f=Oe(i,xo);at(f,r,i),at(f,t.domain,i);const p=jr();at(u,t.domain,p),at(p,t.domain,p);const m=Oe(p,xo);at(m,t.domain,p);const g=jr(GR);at(m,t.tld,g),at(m,t.utld,g),Oe(u,Kc,g);const b=Oe(p,$r);Oe(b,$r,b),at(b,t.domain,p),at(g,t.domain,p),Oe(g,xo,m),Oe(g,$r,b);const y=Oe(g,Pi);at(y,t.numeric,GR);const S=Oe(s,$r),C=Oe(s,xo);Oe(S,$r,S),at(S,t.domain,s),at(C,r,i),at(C,t.domain,s);const E=jr($d);at(C,t.tld,E),at(C,t.utld,E),at(E,t.domain,s),at(E,r,i),Oe(E,xo,C),Oe(E,$r,S),Oe(E,Ai,u);const T=Oe(E,Pi),w=jr($d);at(T,t.numeric,w);const M=jr($d),R=jr();at(M,e,M),at(M,n,R),at(R,e,M),at(R,n,R),Oe(E,So,M),Oe(w,So,M);const P=Oe(a,Pi),I=Oe(l,Pi),L=Oe(I,So),O=Oe(L,So);at(a,t.domain,s),Oe(a,xo,C),Oe(a,$r,S),at(l,t.domain,s),Oe(l,xo,C),Oe(l,$r,S),at(P,t.domain,M),Oe(P,So,M),Oe(P,wc,M),at(O,t.domain,M),at(O,e,M),Oe(O,So,M);const A=[[xc,Sc],[Bf,Vf],[zf,Hf],[Wf,qf],[Uf,Kf],[Yf,Gf],[Jf,Zf],[Xf,Qf]];for(let N=0;N<A.length;N++){const[F,V]=A[N],$=Oe(M,F);Oe(R,F,$),Oe($,V,M);const B=jr($d);at($,e,B);const U=jr();at($,n),at(B,e,B),at(B,n,U),at(U,e,B),at(U,n,U),Oe(B,V,M),Oe(U,V,M)}return Oe(o,Kc,E),Oe(o,M1,ele),{start:o,tokens:vN}}function nle(t,e,n){let r=n.length,o=0,i=[],s=[];for(;o<r;){let a=t,l=null,u=null,f=0,p=null,m=-1;for(;o<r&&!(l=a.go(n[o].t));)s.push(n[o++]);for(;o<r&&(u=l||a.go(n[o].t));)l=null,a=u,a.accepts()?(m=0,p=a):m>=0&&m++,o++,f++;if(m<0)o-=f,o<r&&(s.push(n[o]),o++);else{s.length>0&&(i.push(Ev(JR,e,s)),s=[]),o-=m,f-=m;const g=p.t,b=n.slice(o-f,o);i.push(Ev(g,e,b))}}return s.length>0&&i.push(Ev(JR,e,s)),i}function Ev(t,e,n){const r=n[0].s,o=n[n.length-1].e,i=e.slice(r,o);return new t(i,n)}const rle=typeof console<"u"&&console&&console.warn||(()=>{}),ole="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",Ht={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function ile(){return ur.groups={},Ht.scanner=null,Ht.parser=null,Ht.tokenQueue=[],Ht.pluginQueue=[],Ht.customSchemes=[],Ht.initialized=!1,Ht}function ZR(t,e=!1){if(Ht.initialized&&rle(`linkifyjs: already initialized - will not register custom scheme "${t}" ${ole}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format.
397
397
  1. Must only contain digits, lowercase ASCII letters or "-"
398
398
  2. Cannot start or end with "-"
399
- 3. "-" cannot repeat`);Ht.customSchemes.push([t,e])}function sle(){Ht.scanner=Xae(Ht.customSchemes);for(let t=0;t<Ht.tokenQueue.length;t++)Ht.tokenQueue[t][1]({scanner:Ht.scanner});Ht.parser=tle(Ht.scanner.tokens);for(let t=0;t<Ht.pluginQueue.length;t++)Ht.pluginQueue[t][1]({scanner:Ht.scanner,parser:Ht.parser});return Ht.initialized=!0,Ht}function _1(t){return Ht.initialized||sle(),nle(Ht.parser.start,t,xN(Ht.scanner.start,t))}_1.scan=xN;function CN(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 P1(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 ale(t){return t.length===1?t[0].isLink:t.length===3&&t[1].isLink?["()","[]"].includes(t[0].value+t[2].value):!1}function lle(t){return new en({key:new gn("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=fee(n.doc,[...e]);if(bee(a).forEach(({newRange:u})=>{const f=hee(r.doc,u,g=>g.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 g=m.split(" ").filter(C=>C!=="");if(g.length<=0)return!1;const b=g[g.length-1],y=p.pos+m.lastIndexOf(b);if(!b)return!1;const S=_1(b).map(C=>C.toObject(t.defaultProtocol));if(!ale(S))return!1;S.filter(C=>C.isLink).map(C=>({...C,from:y+C.start+1,to:y+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=>{Xx(C.from,C.to,r.doc).some(E=>E.mark.type===t.type)||s.addMark(C.from,C.to,t.type.create({href:C.href}))})}}),!!s.steps.length)return s}})}function cle(t){return new en({key:new gn("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=Zx(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 ule(t){return new en({key:new gn("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=CN(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 dle=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g;function vs(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(dle,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}const fle=mr.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"){ZR(t);return}ZR(t.scheme,t.optionalSlashes)})},onDestroy(){ile()},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)=>!!vs(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=>!!vs(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=>!!vs(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",yt(this.options.HTMLAttributes,t),0]:["a",yt(this.options.HTMLAttributes,{...t,href:""}),0]},addCommands(){return{setLink:t=>({chain:e})=>{const{href:n}=t;return this.options.isAllowedUri(n,{defaultValidate:r=>!!vs(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=>!!vs(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[Yi({find:t=>{const e=[];if(t){const{protocols:n,defaultProtocol:r}=this.options,o=CN(t).filter(i=>i.isLink&&this.options.isAllowedUri(i.value,{defaultValidate:s=>!!vs(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(lle({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:o=>!!vs(o,e),protocols:e,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),this.options.openOnClick===!0&&t.push(cle({type:this.type})),this.options.linkOnPaste&&t.push(ule({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),t}}),wN=Qt.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",yt(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 ple(t){var e;const{char:n,allowSpaces:r,allowToIncludeChar:o,allowedPrefixes:i,startOfLine:s,$position:a}=t,l=r&&!o,u=Xee(n),f=new RegExp(`\\s${u}$`),p=s?"^":"",m=o?"":u,g=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 y=a.pos-b.length,S=Array.from(b.matchAll(g)).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),E=new RegExp(`^[${i==null?void 0:i.join("")}\0]?$`).test(C);if(i!==null&&!E)return null;const T=y+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 hle=new gn("suggestion");function mle({pluginKey:t=hle,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:g=ple}){let b;const y=p==null?void 0:p(),S=new en({key:t,view(){return{update:async(C,E)=>{var T,w,M,R,P,I,L;const O=(T=this.key)===null||T===void 0?void 0:T.getState(E),A=(w=this.key)===null||w===void 0?void 0:w.getState(C.state),N=O.active&&A.active&&O.range.from!==A.range.from,F=!O.active&&A.active,V=O.active&&!A.active,$=!F&&!V&&O.query!==A.query,B=F||N&&$,U=$||N,K=V||N&&$;if(!B&&!U&&!K)return;const G=K&&!B?O:A,Y=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:Y,clientRect:Y?()=>{var Z;const{decorationId:he}=(Z=this.key)===null||Z===void 0?void 0:Z.getState(e.state),pe=C.dom.querySelector(`[data-decoration-id="${he}"]`);return(pe==null?void 0:pe.getBoundingClientRect())||null}:null},B&&((M=y==null?void 0:y.onBeforeStart)===null||M===void 0||M.call(y,b)),U&&((R=y==null?void 0:y.onBeforeUpdate)===null||R===void 0||R.call(y,b)),(U||B)&&(b.items=await f({editor:e,query:G.query})),K&&((P=y==null?void 0:y.onExit)===null||P===void 0||P.call(y,b)),U&&((I=y==null?void 0:y.onUpdate)===null||I===void 0||I.call(y,b)),B&&((L=y==null?void 0:y.onStart)===null||L===void 0||L.call(y,b))},destroy:()=>{var C;b&&((C=y==null?void 0:y.onExit)===null||C===void 0||C.call(y,b))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(C,E,T,w){const{isEditable:M}=e,{composing:R}=e.view,{selection:P}=C,{empty:I,from:L}=P,O={...E};if(O.composing=R,M&&(I||e.view.composing)){(L<E.range.from||L>E.range.to)&&!R&&!E.composing&&(O.active=!1);const A=g({char:n,allowSpaces:r,allowToIncludeChar:o,allowedPrefixes:i,startOfLine:s,$position:P.$from}),N=`id_${Math.floor(Math.random()*4294967295)}`;A&&m({editor:e,state:w,range:A.range,isActive:E.active})?(O.active=!0,O.decorationId=E.decorationId?E.decorationId:N,O.range=A.range,O.query=A.query,O.text=A.text):O.active=!1}else O.active=!1;return O.active||(O.decorationId=null,O.range={from:0,to:0},O.query=null,O.text=null),O}},props:{handleKeyDown(C,E){var T;const{active:w,range:M}=S.getState(C.state);return w&&((T=y==null?void 0:y.onKeyDown)===null||T===void 0?void 0:T.call(y,{view:C,event:E,range:M}))||!1},decorations(C){const{active:E,range:T,decorationId:w}=S.getState(C);return E?Zt.create(C.doc,[Ln.inline(T.from,T.to,{nodeName:a,class:l,"data-decoration-id":w})]):null}}});return S}const gle=new gn("mention"),yle=Qt.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",yt(this.HTMLAttributes,t.HTMLAttributes),`${t.suggestion.char}${(n=e.attrs.label)!==null&&n!==void 0?n:e.attrs.id}`]},suggestion:{char:"@",pluginKey:gle,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",yt({"data-type":this.name},this.options.HTMLAttributes,e),this.options.renderLabel({options:this.options,node:t})];const n={...this.options};n.HTMLAttributes=yt({"data-type":this.name},this.options.HTMLAttributes,e);const r=this.options.renderHTML({options:n,node:t});return typeof r=="string"?["span",yt({"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[mle({editor:this.editor,...this.options.suggestion})]}}),ble="listItem",XR="textStyle",QR=/^(\d+)\.\s$/,TN=Qt.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",yt(this.options.HTMLAttributes,n),0]:["ol",yt(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(ble,this.editor.getAttributes(XR)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=al({find:QR,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=al({find:QR,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(XR)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}}),EN=Qt.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",yt(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),kN=cn.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new en({key:new gn("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&&rh(s);if((l||!this.options.showOnlyCurrent)&&u){const f=[this.options.emptyNodeClass];i&&f.push(this.options.emptyEditorClass);const p=Ln.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}),Zt.create(t,o)}}})]}}),vle=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,xle=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,MN=mr.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",yt(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[qs({find:vle,type:this.type})]},addPasteRules(){return[Yi({find:xle,type:this.type})]}}),Sle=mr.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",yt(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()}}}),Cle=mr.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",yt(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()}}}),wle=Qt.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",yt(this.options.HTMLAttributes,t),0]}}),Tle=Qt.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",yt(this.options.HTMLAttributes,t),0]}}),Ele=Qt.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:t}){return["tr",yt(this.options.HTMLAttributes,t),0]}}),kle=/^\s*(\[([( |x])?\])\s$/,Mle=Qt.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",yt(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 g=p.doc.nodeAt(m);return p.setNodeMarkup(m,void 0,{...g==null?void 0:g.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[al({find:kle,type:this.type,getAttributes:t=>({checked:t[t.length-1]==="x"})})]}}),Ole=Qt.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",yt(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()}}}),ON=Qt.create({name:"text",group:"inline"}),Rle=cn.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")}}}),Ale=mr.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",yt(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()}}}),RN=J.forwardRef((t,e)=>{const[n,r]=J.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 J.useEffect(()=>r(0),[t.items]),J.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(j.Paper,{elevation:5,children:v.jsx(j.List,{dense:!0,sx:{overflow:"hidden"},children:t.items.map((l,u)=>v.jsx(j.ListItem,{disablePadding:!0,children:v.jsx(j.ListItemButton,{selected:u===n,onClick:()=>o(u),children:l.mentionLabel})},l.id))})}):null});RN.displayName="SuggestionList";const eA={bottom:0,height:0,left:0,right:0,top:0,width:0,x:0,y:0,toJSON(){return{}}},Ile={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 h_(RN,{props:n,editor:n.editor}),e=gu("body",{getReferenceClientRect:()=>{var r;return((r=n.clientRect)==null?void 0:r.call(n))??eA},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))??eA}})},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}}}},Dle=fle.extend({inclusive:!1}),Ple=Sle.extend({excludes:"superscript"}),_le=Cle.extend({excludes:"subscript"});function Nle({placeholder:t}={}){return J.useMemo(()=>[rae.configure({resizable:!0}),Ele,Tle,wle,eN,nN,rN,sN,wN,TN,EN,Ple,_le,ON,Q_,X_,tN,pN,Ale,MN,Dle.configure({autolink:!0,linkOnPaste:!0,openOnClick:!1}),Zne,iN,Yie,Rle.configure({types:["heading","paragraph","image"]}),gae,yae,xae,Uie,Aae.configure({multicolor:!0}),fN,tse,oN,Ole,Mle.configure({nested:!0}),yle.configure({suggestion:Ile}),kN.configure({placeholder:t}),dN],[t])}function tA(t){return Array.from(t).filter(e=>(e.type||"").toLowerCase().startsWith("image/"))}const Lle=t=>{const e=Nle({placeholder:"Add your own content here..."});if(t.renderContentOnly)return v.jsx(Toe,{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]=Wt.useField({name:n}),{setValue:f}=u,{value:p}=a;J.useEffect(()=>{var C,E,T;(T=(E=(C=m==null?void 0:m.current)==null?void 0:C.editor)==null?void 0:E.commands)==null||T.setContent(p)},[p]);const m=J.useRef(null),g=J.useCallback((C,E)=>{var w;const T=(w=m.current)==null?void 0:w.editor;if(T)if(i instanceof Promise)i(C).then(M=>{v0({images:M,editor:T,position:E})});else{const M=i(C);v0({images:M,editor:T,position:E})}},[]),b=J.useCallback((C,E,T,w)=>{var R;if(!(E instanceof DragEvent)||!E.dataTransfer)return!1;const M=tA(E.dataTransfer.files);if(M.length>0){const P=(R=C.posAtCoords({left:E.clientX,top:E.clientY}))==null?void 0:R.pos;return g(M,P),E.preventDefault(),!0}return!1},[g]),y=J.useCallback((C,E,T)=>{if(!E.clipboardData)return!1;const w=tA(E.clipboardData.files);return w.length>0?(g(w),!0):!1},[g]),S=v.jsx(j.Box,{sx:{"& .ProseMirror":{"& h1, & h2, & h3, & h4, & h5, & h6":{scrollMarginTop:s?0:50}}},children:v.jsx(x_,{ref:m,extensions:e,content:p,editable:!s,editorProps:{handleDrop:b,handlePaste:y},renderControls:s?void 0:()=>v.jsx(oae,{onUploadFiles:i}),onBlur:()=>{var C,E;return f(((E=(C=m.current)==null?void 0:C.editor)==null?void 0:E.getHTML())??"")},RichTextFieldProps:{variant:"outlined",MenuBarProps:{hide:s}},children:()=>v.jsxs(v.Fragment,{children:[v.jsx(XP,{}),v.jsx(S_,{})]})})});return v.jsxs(j.Box,{display:"flex",flexDirection:"column",children:[r&&v.jsx(j.Typography,{...o,children:r}),S]})},_0=t=>{const{title:e="Loading...",message:n}=t;return v.jsxs(j.Box,{className:"loading-page",sx:{gap:2},"data-testid":"loading-page",children:[v.jsxs(j.Box,{className:"text-content",children:[v.jsx(j.Typography,{variant:"h1","data-testid":"title",children:e}),n&&v.jsx(j.Typography,{"data-testid":"message",children:n})]}),v.jsx(j.CircularProgress,{size:75,"data-testid":"loading-spinner"})]})},nA=t=>{const{colSpan:e,isExpanded:n,renderExpand:r,obj:o,asMobileCard:i=!1,reRenderExpand:s=!1}=t,[a,l]=J.useState(!1),[u,f]=J.useState(void 0);return J.useEffect(()=>{n&&(!a||s)&&(l(!0),f(r(o)))},[n,o]),i?v.jsx(j.Box,{children:v.jsx(j.Collapse,{in:n,children:u})}):v.jsx(j.TableRow,{children:v.jsx(j.TableCell,{style:{paddingBottom:0,paddingTop:0},colSpan:e,children:v.jsx(j.Collapse,{in:n,children:u})})})},AN=t=>{const{id:e,getRowKey:n=W=>"id"in W&&(typeof W.id=="string"||typeof W.id=="number")?W.id:(console.warn(`Table: "id: string | number" not found in ${JSON.stringify(W)}. Please implement the Table.getRowKey prop so Table knows how to uniquely identify this row.`),JSON.stringify(W)),columns:r,data:o=[],onRowClick:i,renderExpand:s,hideColumnsOnMobile:a=[],sortField:l,sortOrder:u,onSortChange:f,allowSortCols:p,fixedLayout:m=!1,className:g,emptyTableMsg:b="No items to display",errorTableMsg:y,retryCallback:S,isLoading:C=!1,disableMobileCards:E=!1,highlightSelectedRow:T=!1,headerRowStyle:w={},stickyHeader:M,reRenderExpand:R=!1,...P}=t,{palette:I}=j.useTheme(),[L,O]=J.useState(void 0),[A,N]=J.useState(void 0);Array.isArray(m)&&m.length!==r.length&&console.error('Table component: Length of "fixedLayout" is not equal to the length of "columns".');const F=W=>{W!==l?f&&f(W,"asc"):f&&f(l,u==="asc"?"desc":"asc")},V=W=>l===W?u:null,$=j.useMediaQuery(j.useTheme().breakpoints.down("sm")),B=$&&a?r.filter(W=>!a.includes(W.fieldName)):r,U=(W,ee)=>ee.split(".").reduce((le,Q)=>{if(le&&typeof le=="object")return le[Q]},W),K=(W,ee)=>{const le=U(ee,W.fieldName);return W.render?W.render(le,ee,$):le},G=f!==void 0,Y=W=>G?p?p.includes(W):!0:!1,Z=v.jsxs(j.Box,{display:"flex",justifyContent:"center",alignItems:"center",flexDirection:"row",children:[v.jsx(E6,{})," ",b]}),he=v.jsxs(j.Box,{"data-testid":"table-fetch-error-msg",display:"flex",justifyContent:"center",alignItems:"center",flexDirection:"row",children:[v.jsx(QA,{color:"error"})," ",y,S&&v.jsx(j.Button,{variant:"text",onClick:S,children:"Retry?"})]}),pe=()=>{if(C)return v.jsx(j.TableRow,{children:v.jsx(j.TableCell,{colSpan:r.length,align:"center",children:v.jsx(j.Box,{display:"flex",justifyContent:"center",alignItems:"center",flexDirection:"row",children:v.jsx(_0,{})})})});if(y)return v.jsx(j.TableRow,{children:v.jsx(j.TableCell,{colSpan:r.length,align:"center",children:he})});if(o.length===0)return v.jsx(j.TableRow,{children:v.jsx(j.TableCell,{colSpan:r.length,align:"center",children:Z})})},me=()=>{if(C)return v.jsx(_0,{});if(y)return he;if(o.length===0)return Z},re=W=>{T&&N(W)},fe=W=>{if(i&&(i(W),re(W)),s){const ee=L===W?void 0:W;O(ee),re(ee)}},ae=typeof T=="string"?T:I.grey[I.mode=="dark"?600:50],se=W=>{const ee=A===n(W)?ae:"inherit";return{cursor:i||s?"pointer":"default",backgroundColor:ee,...i&&{"&:hover":{backgroundColor:ee===ae?Ga(ee,.1):ae}}}};return $&&!E?v.jsxs("div",{...e?{id:`mobile-table-${e}`}:{},className:g,"data-testid":"mui-table-mobile",children:[G&&v.jsxs(v.Fragment,{children:[v.jsxs(j.Box,{display:"flex",className:"MBv2_Table_Stack_Sort",children:[v.jsx(j.TextField,{select:!0,sx:{flexGrow:1},id:"demo-simple-select",size:"small",value:l??"",label:"Sort By...",onChange:W=>F(W.target.value),fullWidth:!0,children:B.map(W=>{if(Y(W.fieldName))return v.jsx(j.MenuItem,{value:W.sortName??W.fieldName,children:W.label??kn(W.fieldName)},`${W.key??"rowHeader"}-${W.fieldName}`)})}),v.jsx(j.IconButton,{onClick:()=>{l&&F(l)},children:v.jsx(N6,{className:`sort-icon-${u}`})})]}),v.jsx(j.Divider,{sx:{margin:"10px 0"}})]}),me()??o.map(W=>v.jsxs(j.Card,{className:"MBv2_Table_Stack_Container",sx:{margin:"5px 0",padding:"5px",...se(W)},onClick:()=>fe(n(W)),"data-testid":`card-${n(W)}`,children:[v.jsx("table",{className:"MBv2_Table_Stack",children:v.jsx("tbody",{className:"MBv2_Table_Stack_Body",children:B.map(ee=>v.jsxs("tr",{className:"MBv2_Table_Stack_Row",children:[v.jsx("td",{className:`MBv2_Table_Stack_Cell_Label MBv2_Table_Stack_Col_${ee.fieldName}`,children:ee.label??kn(ee.fieldName)}),v.jsx("td",{className:`MBv2_Table_Stack_Cell_Value MBv2_Table_Stack_Val_${ee.fieldName}`,style:{paddingLeft:"10px"},children:K(ee,W)})]},`${ee.key??"row"}-${n(W)}-${ee.fieldName}`))})}),s&&v.jsx(nA,{colSpan:r.length,isExpanded:n(W)===L,obj:W,renderExpand:ee=>s(ee),asMobileCard:!0})]},n(W)))]}):v.jsx(j.TableContainer,{component:j.Card,"data-testid":"mui-table",...e?{id:`table-${e}`}:{},className:g,style:M?{maxHeight:M,overflow:"auto"}:{},children:v.jsxs(j.Table,{stickyHeader:M!=="undefined",style:{tableLayout:m?"fixed":"auto"},className:"MBv2_Table",sx:w?{"& .MuiTableCell-head":{...w}}:{},...P,children:[v.jsx(j.TableHead,{className:"MBv2_Table_Head",children:v.jsx(j.TableRow,{className:"MBv2_Table_Head_Row",children:B.map((W,ee)=>{const le=Y(W.fieldName);return v.jsx(j.TableCell,{width:Array.isArray(m)?m[ee]:"auto",children:v.jsx(j.Box,{style:{display:"flex",alignItems:"center"},children:v.jsxs(j.Box,{sx:[le&&{"&:hover":{cursor:"pointer",backgroundColor:I.mode==="dark"?"#222222":"#ededed",borderRadius:2}}],style:{display:"flex",alignItems:"center",padding:"5px",paddingLeft:"6px",marginLeft:"-6px"},onClick:le?()=>F(W.sortName??W.fieldName):void 0,children:[v.jsx("strong",{className:"MBv2_Table_Col_Label",style:{wordBreak:"normal"},children:W.label??kn(W.fieldName)}),le&&V(W.fieldName)==="asc"&&v.jsx(lI,{style:{marginLeft:"5px"}}),le&&V(W.fieldName)==="desc"&&v.jsx(k6,{style:{marginLeft:"5px"}}),le&&V(W.fieldName)!=="asc"&&V(W.fieldName)!=="desc"&&v.jsx(D6,{style:{marginLeft:"5px"}})]})})},`${W.key??"rowHeader"}-${W.fieldName}`)})})}),v.jsx(j.TableBody,{className:"MBv2_Table_Body",children:pe()??o.map(W=>v.jsxs(J.Fragment,{children:[v.jsx(j.TableRow,{"data-testid":`row-${n(W)}`,className:"MBv2_Table_Body_Row",onClick:()=>fe(n(W)),sx:se(W),children:B.map(ee=>v.jsx(j.TableCell,{className:`MBv2_Table_Body_Cell MBv2_Table_Body_Col_${ee.fieldName}`,children:K(ee,W)},`${ee.key??"row"}-${n(W)}-${ee.fieldName}`))}),s&&v.jsx(nA,{colSpan:r.length,isExpanded:n(W)===L,obj:W,renderExpand:ee=>s(ee),reRenderExpand:R})]},n(W)))})]})})},IN=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)},g=S=>{r(parseInt(S.target.value,10))},b=j.useMediaQuery(j.useTheme().breakpoints.down("sm")),y=!t.data||t.data&&t.data.length===0;return v.jsxs(j.Box,{children:[v.jsx(AN,{sortOrder:p,sortField:f,...s}),!o&&!y&&v.jsx(j.TablePagination,{"data-testid":"pagination-controls",component:"div",rowsPerPageOptions:b?[]:i,count:u,rowsPerPage:l,page:a,onPageChange:(S,C)=>m(C),onRowsPerPageChange:g,sx:{flexGrow:1,marginRight:{xs:0,md:15}}})]})},rA=()=>({height:window.innerHeight,width:window.innerWidth}),DN=()=>{const[t,e]=J.useState(rA());return J.useEffect(()=>{const n=()=>{e(rA())};return window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[]),t},Eo=t=>{const{name:e="button",color:n="primary",fullWidthOnMobile:r=!0,type:o="button",variant:i="contained"}=t,{width:s}=DN(),a=["locationInBar","closeDialog","fullWidthOnMobile"],l=r&&s<600;return v.jsx(j.Button,{role:"button",name:e,color:n,variant:i,type:o,fullWidth:t.fullWidth?!0:l,...Xn({...t},a)})},jle=t=>{const{onCancel:e,onNewCitation:n,onNewAttachment:r,onEditCitation:o,onEditAttachment:i,onDeleteCitation:s,onSelect:a,fetchExistingCitations:l,selectedIds:u,setSelectedIds:f,onError:p=()=>{},setError:m}=t,[g,b]=J.useState([]),[y,S]=J.useState(!1),[C,E]=J.useState(!0),[T,w]=J.useState(null),[M,R]=J.useState(null),[P,I]=J.useState({pageNo:0,pageSize:5,totalCount:0}),L=()=>{S(!1),E(!0),l({pageNo:P.pageNo,pageSize:P.pageSize}).then(A=>{b(A.data),I({...P,totalCount:A.totalCount})}).catch(A=>{p(A),S(!0),b([])}).finally(()=>E(!1))};J.useEffect(L,[P.pageNo,P.pageSize]);const O=()=>{R(null),w(null)};return v.jsxs(v.Fragment,{children:[v.jsx(IN,{"data-testid":"citation-table",size:"x-small",isLoading:C,columns:[{fieldName:"id",key:"select",label:"",render:(A,N)=>v.jsx(j.Checkbox,{"data-testid":`citation-table_checkbox-${A}`,onChange:()=>{const F=u.includes(N.id);f(F?u.filter(V=>V!==N.id):[...u,N.id])},checked:u.includes(A)})},{fieldName:"title"},{fieldName:"fileName",key:"CitationOrAttachment",label:"Type",render:A=>A?"Attachment":"Citation"},{fieldName:"id",key:"Action",label:"Action",render:(A,N)=>v.jsxs(v.Fragment,{children:[v.jsx(j.IconButton,{color:"primary",onClick:()=>N.fileName?i(N):o(N),"data-testid":`citation-table_edit-btn-${A}`,children:v.jsx(a6,{})}),v.jsx(j.IconButton,{color:"error",onClick:F=>{R(A),w(F.currentTarget)},"data-testid":`citation-table_delete-btn-${A}`,children:v.jsx(_v,{})}),v.jsx(j.Popper,{open:M===A,anchorEl:T,placement:"bottom-end",style:{zIndex:1300},children:v.jsxs(j.Box,{component:j.Paper,p:1,display:"flex",gap:1,boxShadow:9,"data-testid":`citation-table_delete-prompt-${A}`,children:[v.jsxs(j.Typography,{variant:"body2",children:["Are you sure you want to delete this"," ",N.fileName?"attachment":"citation","?"]}),v.jsxs(j.Box,{display:"flex",flexDirection:"row",children:[v.jsx(Eo,{size:"small",variant:"text",onClick:O,"data-testid":`citation-table_delete-prompt-${A}-noBtn`,children:"No"}),v.jsx(Eo,{size:"small",color:"error",startIcon:v.jsx(_v,{}),onClick:()=>{s(A).then(()=>{L(),f(u.filter(F=>F!==A))}).catch(F=>m({title:`Failed to delete ${N.fileName?"attachment":"citation"}`,err:F})).finally(O)},"data-testid":`citation-table_delete-prompt-${A}-yesBtn`,children:"Yes"})]})]})})]})}],data:g,paginationState:P,onPageChange:A=>I({...P,pageNo:A}),onRowsPerPageChange:A=>I({...P,pageSize:A,pageNo:0}),fixedLayout:["60px","auto","auto","120px"],errorTableMsg:y?"Failed to load citations.":void 0,retryCallback:L}),v.jsxs(j.Box,{display:"flex",flexDirection:"row",justifyContent:"space-between",marginTop:"20px",children:[v.jsxs(j.Box,{display:"flex",flexDirection:"row",gap:".25rem",children:[v.jsx(Eo,{variant:"outlined",size:"small",onClick:n,startIcon:v.jsx(U0,{}),children:"Add Citation"}),v.jsx(Eo,{variant:"outlined",size:"small",onClick:r,startIcon:v.jsx(e6,{}),children:"Add Attachment"})]}),v.jsxs(j.Box,{display:"flex",flexDirection:"row",gap:".25rem",children:[v.jsx(Eo,{variant:"outlined",size:"small",onClick:e,children:"Cancel"}),v.jsxs(Eo,{variant:"contained",size:"small",onClick:()=>a(u),children:["Select",u.length>0&&` (${u.length})`]})]})]})]})},N1=t=>{const{loading:e=!1,type:n="submit",size:r="medium",...o}=t,s={small:16,medium:20,large:24}[r];return v.jsx(Eo,{type:n,disabled:e,size:r,startIcon:e?v.jsx(j.CircularProgress,{size:s,color:"inherit"}):null,...o})},$le=t=>{const{id:e,onSave:n,onCancel:r,getCitationById:o,setError:i}=t,s=J.useRef(null),[a,l]=J.useState(!0),[u,f]=J.useState({source:"",title:"",accessedAt:null,url:"",classification:""});J.useEffect(()=>{if(e===void 0){l(!1);return}o(e).then(m=>{f(m),l(!1)}).catch(m=>{l(!1),i({title:"Failed to retrieve citation",err:m})})},[]);const p=()=>{var g,b,y;const m=(b=(g=s==null?void 0:s.current)==null?void 0:g.values)==null?void 0:b.url;m&&((y=s==null?void 0:s.current)==null||y.setFieldValue("url",JP(m)))};return v.jsx(Wt.Formik,{innerRef:s,enableReinitialize:!0,initialValues:u,onSubmit:async m=>{l(!0),n(m).catch(g=>{l(!1),i({title:`Failed to ${e===void 0?"save":"update"} citation`,err:g})}).finally(()=>l(!1))},children:v.jsxs(Wt.Form,{autoComplete:"off",children:[v.jsx(Ba,{name:"source",disabled:a,required:!0,margin:"none"}),v.jsx(Ba,{name:"title",disabled:a,required:!0,margin:"none"}),v.jsx(Cf,{name:"accessedAt",disabled:a,required:!0,margin:"none",isDatePicker:!0}),v.jsx(Ba,{name:"url",disabled:a,required:!0,onBlur:p,margin:"none"}),v.jsx(sI,{row:!0,name:"classification",required:!0,radios:[{label:"Public Source",value:"Public Source"},{label:"Proprietary Source",value:"Proprietary Source"}],margin:"none"}),v.jsxs(j.DialogActions,{sx:{px:0},children:[v.jsx(j.Button,{onClick:r,variant:"outlined",size:"small",children:"Cancel"}),v.jsx(N1,{size:"small",loading:a,children:e?"Update Citation":"Add New Citation"})]})]})})};var kv,oA;function Fle(){if(oA)return kv;oA=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,E){return this._size>=this._maxSize&&this.clear(),C in this._values||this._size++,this._values[C]=E};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);kv={Cache:t,split:p,normalizePath:f,setter:function(C){var E=f(C);return l.get(C)||l.set(C,function(w,M){for(var R=0,P=E.length,I=w;R<P-1;){var L=E[R];if(L==="__proto__"||L==="constructor"||L==="prototype")return w;I=I[E[R++]]}I[E[R]]=M})},getter:function(C,E){var T=f(C);return u.get(C)||u.set(C,function(M){for(var R=0,P=T.length;R<P;)if(M!=null||!E)M=M[T[R++]];else return;return M})},join:function(C){return C.reduce(function(E,T){return E+(g(T)||n.test(T)?"["+T+"]":(E?".":"")+T)},"")},forEach:function(C,E,T){m(Array.isArray(C)?C:p(C),E,T)}};function f(C){return a.get(C)||a.set(C,p(C).map(function(E){return E.replace(i,"$2")}))}function p(C){return C.match(e)||[""]}function m(C,E,T){var w=C.length,M,R,P,I;for(R=0;R<w;R++)M=C[R],M&&(S(M)&&(M='"'+M+'"'),I=g(M),P=!I&&/^\d+$/.test(M),E.call(T,M,I,P,R,C))}function g(C){return typeof C=="string"&&C&&["'",'"'].indexOf(C.charAt(0))!==-1}function b(C){return C.match(r)&&!C.match(n)}function y(C){return o.test(C)}function S(C){return!g(C)&&(b(C)||y(C))}return kv}var $s=Fle(),Mv,iA;function Ble(){if(iA)return Mv;iA=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 Mv={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(" ")},Mv}var Ov=Ble(),Fd={exports:{}},sA;function Vle(){if(sA)return Fd.exports;sA=1,Fd.exports=function(o){return t(e(o),o)},Fd.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(g){if(!p.has(g[0])||!p.has(g[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(g,b,y){if(y.has(g)){var S;try{S=", node was:"+JSON.stringify(g)}catch{S=""}throw new Error("Cyclic dependency"+S)}if(!p.has(g))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(g));if(!l[b]){l[b]=!0;var C=f.get(g)||new Set;if(C=Array.from(C),b=C.length){y.add(g);do{var E=C[--b];m(E,p.get(E),y)}while(b);y.delete(g)}a[--s]=g}}}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 Fd.exports}var zle=Vle();const Hle=rr(zle),Wle=Object.prototype.toString,qle=Error.prototype.toString,Ule=RegExp.prototype.toString,Kle=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",Yle=/^Symbol\((.*)\)(.*)$/;function Gle(t){return t!=+t?"NaN":t===0&&1/t<0?"-0":""+t}function aA(t,e=!1){if(t==null||t===!0||t===!1)return""+t;const n=typeof t;if(n==="number")return Gle(t);if(n==="string")return e?`"${t}"`:t;if(n==="function")return"[Function "+(t.name||"anonymous")+"]";if(n==="symbol")return Kle.call(t).replace(Yle,"Symbol($1)");const r=Wle.call(t).slice(8,-1);return r==="Date"?isNaN(t.getTime())?""+t:t.toISOString(t):r==="Error"||t instanceof Error?"["+qle.call(t)+"]":r==="RegExp"?Ule.call(t):null}function Wi(t,e){let n=aA(t,e);return n!==null?n:JSON.stringify(t,function(r,o){let i=aA(this[r],e);return i!==null?i:o},2)}function PN(t){return t==null?[]:[].concat(t)}let _N,NN,LN,Jle=/\$\{\s*(\w+)\s*\}/g;_N=Symbol.toStringTag;class lA{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[_N]="Error",this.name="ValidationError",this.value=n,this.path=r,this.type=o,this.errors=[],this.inner=[],PN(e).forEach(i=>{if(dr.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]}}NN=Symbol.hasInstance;LN=Symbol.toStringTag;class dr 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(Jle,(o,i)=>Wi(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 lA(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[LN]="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,dr)}static[NN](e){return lA[Symbol.hasInstance](e)||super[Symbol.hasInstance](e)}}let Co={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 \`${Wi(r,!0)}\`).`:".";return e!=="mixed"?`${t} must be a \`${e}\` type, but the final value was: \`${Wi(n,!0)}\``+o:`${t} must match the configured type. The validated value was: \`${Wi(n,!0)}\``+o}},cr={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"},Zle={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"},N0={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},Xle={isValue:"${path} field must be ${value}"},lf={noUnknown:"${path} field has unspecified keys: ${unknown}",exact:"${path} object contains unknown properties: ${properties}"},Qle={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"},ece={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: \`${Wi(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: \`${Wi(n,!0)}\``}return dr.formatError(Co.notType,t)}};Object.assign(Object.create(null),{mixed:Co,string:cr,number:Zle,date:N0,object:lf,array:Qle,boolean:Xle,tuple:ece});const L1=t=>t&&t.__isYupSchema__;class fp{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 fp(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(!L1(o))throw new TypeError("conditions must return a schema object");return o.resolve(n)}}const Bd={context:"$",value:"."};class Qs{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]===Bd.context,this.isValue=this.key[0]===Bd.value,this.isSibling=!this.isContext&&!this.isValue;let r=this.isContext?Bd.context:this.isValue?Bd.value:"";this.path=this.key.slice(r.length),this.getter=this.path&&$s.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}}Qs.prototype.__isYupRef=!0;const Is=t=>t==null;function Ra(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:g}=t;let{parent:b,context:y,abortEarly:S=s.spec.abortEarly,disableStackTrace:C=s.spec.disableStackTrace}=o;function E(A){return Qs.isRef(A)?A.getValue(n,b,y):A}function T(A={}){const N=Object.assign({value:n,originalValue:i,label:s.spec.label,path:A.path||r,spec:s.spec,disableStackTrace:A.disableStackTrace||C},p,A.params);for(const V of Object.keys(N))N[V]=E(N[V]);const F=new dr(dr.formatError(A.message||m,N),n,N.path,A.type||u,N.disableStackTrace);return F.params=N,F}const w=S?a:l;let M={path:r,parent:b,type:u,from:o.from,createError:T,resolve:E,options:o,originalValue:i,schema:s};const R=A=>{dr.isError(A)?w(A):A?l(null):w(T())},P=A=>{dr.isError(A)?w(A):a(A)};if(g&&Is(n))return R(!0);let L;try{var O;if(L=f.call(M,n,M),typeof((O=L)==null?void 0:O.then)=="function"){if(o.sync)throw new Error(`Validation test of type: "${M.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(L).then(R,P)}}catch(A){P(A);return}R(L)}return e.OPTIONS=t,e}function tce(t,e,n,r=n){let o,i,s;return e?($s.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 pp extends Set{describe(){const e=[];for(const n of this.values())e.push(Qs.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 pp(this.values())}merge(e,n){const r=this.clone();return e.forEach(o=>r.add(o)),n.forEach(o=>r.delete(o)),r}}function $a(t,e=new Map){if(L1(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]=$a(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,$a(o,e))}else if(t instanceof Set){n=new Set,e.set(t,n);for(const r of t)n.add($a(r,e))}else if(t instanceof Object){n={},e.set(t,n);for(const[r,o]of Object.entries(t))n[r]=$a(o,e)}else throw Error(`Unable to clone ${t}`);return n}class _o{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 pp,this._blacklist=new pp,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(Co.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=$a(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&&Is(i))return i;let s=Wi(e),a=Wi(i);throw new TypeError(`The value of ${n.path||"field"} could not be cast to a value that satisfies the schema type: "${r.type}".
399
+ 3. "-" cannot repeat`);Ht.customSchemes.push([t,e])}function sle(){Ht.scanner=Xae(Ht.customSchemes);for(let t=0;t<Ht.tokenQueue.length;t++)Ht.tokenQueue[t][1]({scanner:Ht.scanner});Ht.parser=tle(Ht.scanner.tokens);for(let t=0;t<Ht.pluginQueue.length;t++)Ht.pluginQueue[t][1]({scanner:Ht.scanner,parser:Ht.parser});return Ht.initialized=!0,Ht}function _1(t){return Ht.initialized||sle(),nle(Ht.parser.start,t,xN(Ht.scanner.start,t))}_1.scan=xN;function CN(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 P1(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 ale(t){return t.length===1?t[0].isLink:t.length===3&&t[1].isLink?["()","[]"].includes(t[0].value+t[2].value):!1}function lle(t){return new en({key:new gn("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=fee(n.doc,[...e]);if(bee(a).forEach(({newRange:u})=>{const f=hee(r.doc,u,g=>g.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 g=m.split(" ").filter(C=>C!=="");if(g.length<=0)return!1;const b=g[g.length-1],y=p.pos+m.lastIndexOf(b);if(!b)return!1;const S=_1(b).map(C=>C.toObject(t.defaultProtocol));if(!ale(S))return!1;S.filter(C=>C.isLink).map(C=>({...C,from:y+C.start+1,to:y+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=>{Xx(C.from,C.to,r.doc).some(E=>E.mark.type===t.type)||s.addMark(C.from,C.to,t.type.create({href:C.href}))})}}),!!s.steps.length)return s}})}function cle(t){return new en({key:new gn("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=Zx(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 ule(t){return new en({key:new gn("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=CN(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 dle=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g;function vs(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(dle,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}const fle=mr.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"){ZR(t);return}ZR(t.scheme,t.optionalSlashes)})},onDestroy(){ile()},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)=>!!vs(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=>!!vs(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=>!!vs(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",yt(this.options.HTMLAttributes,t),0]:["a",yt(this.options.HTMLAttributes,{...t,href:""}),0]},addCommands(){return{setLink:t=>({chain:e})=>{const{href:n}=t;return this.options.isAllowedUri(n,{defaultValidate:r=>!!vs(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=>!!vs(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[Yi({find:t=>{const e=[];if(t){const{protocols:n,defaultProtocol:r}=this.options,o=CN(t).filter(i=>i.isLink&&this.options.isAllowedUri(i.value,{defaultValidate:s=>!!vs(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(lle({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:o=>!!vs(o,e),protocols:e,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),this.options.openOnClick===!0&&t.push(cle({type:this.type})),this.options.linkOnPaste&&t.push(ule({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),t}}),wN=Qt.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",yt(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 ple(t){var e;const{char:n,allowSpaces:r,allowToIncludeChar:o,allowedPrefixes:i,startOfLine:s,$position:a}=t,l=r&&!o,u=Xee(n),f=new RegExp(`\\s${u}$`),p=s?"^":"",m=o?"":u,g=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 y=a.pos-b.length,S=Array.from(b.matchAll(g)).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),E=new RegExp(`^[${i==null?void 0:i.join("")}\0]?$`).test(C);if(i!==null&&!E)return null;const T=y+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 hle=new gn("suggestion");function mle({pluginKey:t=hle,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:g=ple}){let b;const y=p==null?void 0:p(),S=new en({key:t,view(){return{update:async(C,E)=>{var T,w,M,R,P,I,L;const O=(T=this.key)===null||T===void 0?void 0:T.getState(E),A=(w=this.key)===null||w===void 0?void 0:w.getState(C.state),N=O.active&&A.active&&O.range.from!==A.range.from,F=!O.active&&A.active,V=O.active&&!A.active,$=!F&&!V&&O.query!==A.query,B=F||N&&$,U=$||N,K=V||N&&$;if(!B&&!U&&!K)return;const G=K&&!B?O:A,Y=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:Y,clientRect:Y?()=>{var Z;const{decorationId:he}=(Z=this.key)===null||Z===void 0?void 0:Z.getState(e.state),pe=C.dom.querySelector(`[data-decoration-id="${he}"]`);return(pe==null?void 0:pe.getBoundingClientRect())||null}:null},B&&((M=y==null?void 0:y.onBeforeStart)===null||M===void 0||M.call(y,b)),U&&((R=y==null?void 0:y.onBeforeUpdate)===null||R===void 0||R.call(y,b)),(U||B)&&(b.items=await f({editor:e,query:G.query})),K&&((P=y==null?void 0:y.onExit)===null||P===void 0||P.call(y,b)),U&&((I=y==null?void 0:y.onUpdate)===null||I===void 0||I.call(y,b)),B&&((L=y==null?void 0:y.onStart)===null||L===void 0||L.call(y,b))},destroy:()=>{var C;b&&((C=y==null?void 0:y.onExit)===null||C===void 0||C.call(y,b))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(C,E,T,w){const{isEditable:M}=e,{composing:R}=e.view,{selection:P}=C,{empty:I,from:L}=P,O={...E};if(O.composing=R,M&&(I||e.view.composing)){(L<E.range.from||L>E.range.to)&&!R&&!E.composing&&(O.active=!1);const A=g({char:n,allowSpaces:r,allowToIncludeChar:o,allowedPrefixes:i,startOfLine:s,$position:P.$from}),N=`id_${Math.floor(Math.random()*4294967295)}`;A&&m({editor:e,state:w,range:A.range,isActive:E.active})?(O.active=!0,O.decorationId=E.decorationId?E.decorationId:N,O.range=A.range,O.query=A.query,O.text=A.text):O.active=!1}else O.active=!1;return O.active||(O.decorationId=null,O.range={from:0,to:0},O.query=null,O.text=null),O}},props:{handleKeyDown(C,E){var T;const{active:w,range:M}=S.getState(C.state);return w&&((T=y==null?void 0:y.onKeyDown)===null||T===void 0?void 0:T.call(y,{view:C,event:E,range:M}))||!1},decorations(C){const{active:E,range:T,decorationId:w}=S.getState(C);return E?Zt.create(C.doc,[Ln.inline(T.from,T.to,{nodeName:a,class:l,"data-decoration-id":w})]):null}}});return S}const gle=new gn("mention"),yle=Qt.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",yt(this.HTMLAttributes,t.HTMLAttributes),`${t.suggestion.char}${(n=e.attrs.label)!==null&&n!==void 0?n:e.attrs.id}`]},suggestion:{char:"@",pluginKey:gle,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",yt({"data-type":this.name},this.options.HTMLAttributes,e),this.options.renderLabel({options:this.options,node:t})];const n={...this.options};n.HTMLAttributes=yt({"data-type":this.name},this.options.HTMLAttributes,e);const r=this.options.renderHTML({options:n,node:t});return typeof r=="string"?["span",yt({"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[mle({editor:this.editor,...this.options.suggestion})]}}),ble="listItem",XR="textStyle",QR=/^(\d+)\.\s$/,TN=Qt.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",yt(this.options.HTMLAttributes,n),0]:["ol",yt(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(ble,this.editor.getAttributes(XR)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=al({find:QR,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=al({find:QR,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(XR)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}}),EN=Qt.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",yt(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),kN=cn.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new en({key:new gn("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&&rh(s);if((l||!this.options.showOnlyCurrent)&&u){const f=[this.options.emptyNodeClass];i&&f.push(this.options.emptyEditorClass);const p=Ln.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}),Zt.create(t,o)}}})]}}),vle=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,xle=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,MN=mr.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",yt(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[qs({find:vle,type:this.type})]},addPasteRules(){return[Yi({find:xle,type:this.type})]}}),Sle=mr.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",yt(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()}}}),Cle=mr.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",yt(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()}}}),wle=Qt.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",yt(this.options.HTMLAttributes,t),0]}}),Tle=Qt.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",yt(this.options.HTMLAttributes,t),0]}}),Ele=Qt.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:t}){return["tr",yt(this.options.HTMLAttributes,t),0]}}),kle=/^\s*(\[([( |x])?\])\s$/,Mle=Qt.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",yt(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 g=p.doc.nodeAt(m);return p.setNodeMarkup(m,void 0,{...g==null?void 0:g.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[al({find:kle,type:this.type,getAttributes:t=>({checked:t[t.length-1]==="x"})})]}}),Ole=Qt.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",yt(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()}}}),ON=Qt.create({name:"text",group:"inline"}),Rle=cn.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")}}}),Ale=mr.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",yt(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()}}}),RN=J.forwardRef((t,e)=>{const[n,r]=J.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 J.useEffect(()=>r(0),[t.items]),J.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(j.Paper,{elevation:5,children:v.jsx(j.List,{dense:!0,sx:{overflow:"hidden"},children:t.items.map((l,u)=>v.jsx(j.ListItem,{disablePadding:!0,children:v.jsx(j.ListItemButton,{selected:u===n,onClick:()=>o(u),children:l.mentionLabel})},l.id))})}):null});RN.displayName="SuggestionList";const eA={bottom:0,height:0,left:0,right:0,top:0,width:0,x:0,y:0,toJSON(){return{}}},Ile={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 h_(RN,{props:n,editor:n.editor}),e=gu("body",{getReferenceClientRect:()=>{var r;return((r=n.clientRect)==null?void 0:r.call(n))??eA},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))??eA}})},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}}}},Dle=fle.extend({inclusive:!1}),Ple=Sle.extend({excludes:"superscript"}),_le=Cle.extend({excludes:"subscript"});function Nle({placeholder:t}={}){return J.useMemo(()=>[rae.configure({resizable:!0}),Ele,Tle,wle,eN,nN,rN,sN,wN,TN,EN,Ple,_le,ON,Q_,X_,tN,pN,Ale,MN,Dle.configure({autolink:!0,linkOnPaste:!0,openOnClick:!1}),Zne,iN,Yie,Rle.configure({types:["heading","paragraph","image"]}),gae,yae,xae,Uie,Aae.configure({multicolor:!0}),fN,tse,oN,Ole,Mle.configure({nested:!0}),yle.configure({suggestion:Ile}),kN.configure({placeholder:t}),dN],[t])}function tA(t){return Array.from(t).filter(e=>(e.type||"").toLowerCase().startsWith("image/"))}const Lle=t=>{const e=Nle({placeholder:"Add your own content here..."});if(t.renderContentOnly)return v.jsx(Toe,{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]=Wt.useField({name:n}),{setValue:f}=u,{value:p}=a;J.useEffect(()=>{var C,E,T;(T=(E=(C=m==null?void 0:m.current)==null?void 0:C.editor)==null?void 0:E.commands)==null||T.setContent(p)},[p]);const m=J.useRef(null),g=J.useCallback((C,E)=>{var w;const T=(w=m.current)==null?void 0:w.editor;if(T)if(i instanceof Promise)i(C).then(M=>{v0({images:M,editor:T,position:E})});else{const M=i(C);v0({images:M,editor:T,position:E})}},[]),b=J.useCallback((C,E,T,w)=>{var R;if(!(E instanceof DragEvent)||!E.dataTransfer)return!1;const M=tA(E.dataTransfer.files);if(M.length>0){const P=(R=C.posAtCoords({left:E.clientX,top:E.clientY}))==null?void 0:R.pos;return g(M,P),E.preventDefault(),!0}return!1},[g]),y=J.useCallback((C,E,T)=>{if(!E.clipboardData)return!1;const w=tA(E.clipboardData.files);return w.length>0?(g(w),!0):!1},[g]),S=v.jsx(j.Box,{sx:{"& .ProseMirror":{"& h1, & h2, & h3, & h4, & h5, & h6":{scrollMarginTop:s?0:50}}},children:v.jsx(x_,{ref:m,extensions:e,content:p,editable:!s,editorProps:{handleDrop:b,handlePaste:y},renderControls:s?void 0:()=>v.jsx(oae,{onUploadFiles:i}),onBlur:()=>{var C,E;return f(((E=(C=m.current)==null?void 0:C.editor)==null?void 0:E.getHTML())??"")},RichTextFieldProps:{variant:"outlined",MenuBarProps:{hide:s}},children:()=>v.jsxs(v.Fragment,{children:[v.jsx(XP,{}),v.jsx(S_,{})]})})});return v.jsxs(j.Box,{display:"flex",flexDirection:"column",children:[r&&v.jsx(j.Typography,{...o,children:r}),S]})},_0=t=>{const{title:e="Loading...",message:n}=t;return v.jsxs(j.Box,{className:"loading-page",sx:{gap:2},"data-testid":"loading-page",children:[v.jsxs(j.Box,{className:"text-content",children:[v.jsx(j.Typography,{variant:"h1","data-testid":"title",children:e}),n&&v.jsx(j.Typography,{"data-testid":"message",children:n})]}),v.jsx(j.CircularProgress,{size:75,"data-testid":"loading-spinner"})]})},nA=t=>{const{colSpan:e,isExpanded:n,renderExpand:r,obj:o,asMobileCard:i=!1,reRenderExpand:s=!1}=t,[a,l]=J.useState(!1),[u,f]=J.useState(void 0);return J.useEffect(()=>{n&&(!a||s)&&(l(!0),f(r(o)))},[n,o]),i?v.jsx(j.Box,{children:v.jsx(j.Collapse,{in:n,children:u})}):v.jsx(j.TableRow,{children:v.jsx(j.TableCell,{style:{paddingBottom:0,paddingTop:0},colSpan:e,children:v.jsx(j.Collapse,{in:n,children:u})})})},AN=t=>{const{id:e,getRowKey:n=W=>"id"in W&&(typeof W.id=="string"||typeof W.id=="number")?W.id:(console.warn(`Table: "id: string | number" not found in ${JSON.stringify(W)}. Please implement the Table.getRowKey prop so Table knows how to uniquely identify this row.`),JSON.stringify(W)),columns:r,data:o=[],onRowClick:i,renderExpand:s,hideColumnsOnMobile:a=[],sortField:l,sortOrder:u,onSortChange:f,allowSortCols:p,fixedLayout:m=!1,className:g,emptyTableMsg:b="No items to display",errorTableMsg:y,retryCallback:S,isLoading:C=!1,disableMobileCards:E=!1,highlightSelectedRow:T=!1,headerRowStyle:w={},stickyHeader:M,reRenderExpand:R=!1,...P}=t,{palette:I}=j.useTheme(),[L,O]=J.useState(void 0),[A,N]=J.useState(void 0);Array.isArray(m)&&m.length!==r.length&&console.error('Table component: Length of "fixedLayout" is not equal to the length of "columns".');const F=W=>{W!==l?f&&f(W,"asc"):f&&f(l,u==="asc"?"desc":"asc")},V=W=>l===W?u:null,$=j.useMediaQuery(j.useTheme().breakpoints.down("sm")),B=$&&a?r.filter(W=>!a.includes(W.fieldName)):r,U=(W,ee)=>ee.split(".").reduce((le,Q)=>{if(le&&typeof le=="object")return le[Q]},W),K=(W,ee)=>{const le=U(ee,W.fieldName);return W.render?W.render(le,ee,$):le},G=f!==void 0,Y=W=>G?p?p.includes(W):!0:!1,Z=v.jsxs(j.Box,{display:"flex",justifyContent:"center",alignItems:"center",flexDirection:"row",children:[v.jsx(E6,{})," ",b]}),he=v.jsxs(j.Box,{"data-testid":"table-fetch-error-msg",display:"flex",justifyContent:"center",alignItems:"center",flexDirection:"row",children:[v.jsx(QA,{color:"error"})," ",y,S&&v.jsx(j.Button,{variant:"text",onClick:S,children:"Retry?"})]}),pe=()=>{if(C)return v.jsx(j.TableRow,{children:v.jsx(j.TableCell,{colSpan:r.length,align:"center",children:v.jsx(j.Box,{display:"flex",justifyContent:"center",alignItems:"center",flexDirection:"row",children:v.jsx(_0,{})})})});if(y)return v.jsx(j.TableRow,{children:v.jsx(j.TableCell,{colSpan:r.length,align:"center",children:he})});if(o.length===0)return v.jsx(j.TableRow,{children:v.jsx(j.TableCell,{colSpan:r.length,align:"center",children:Z})})},me=()=>{if(C)return v.jsx(_0,{});if(y)return he;if(o.length===0)return Z},re=W=>{T&&N(W)},fe=W=>{if(i&&(i(W),re(W)),s){const ee=L===W?void 0:W;O(ee),re(ee)}},ae=typeof T=="string"?T:I.grey[I.mode=="dark"?600:50],se=W=>{const ee=A===n(W)?ae:"inherit";return{cursor:i||s?"pointer":"default",backgroundColor:ee,...i&&{"&:hover":{backgroundColor:ee===ae?Ga(ee,.1):ae}}}};return $&&!E?v.jsxs("div",{...e?{id:`mobile-table-${e}`}:{},className:g,"data-testid":"mui-table-mobile",children:[G&&v.jsxs(v.Fragment,{children:[v.jsxs(j.Box,{display:"flex",className:"MBv2_Table_Stack_Sort",children:[v.jsx(j.TextField,{select:!0,sx:{flexGrow:1},id:"demo-simple-select",size:"small",value:l??"",label:"Sort By...",onChange:W=>F(W.target.value),fullWidth:!0,children:B.map(W=>{if(Y(W.fieldName))return v.jsx(j.MenuItem,{value:W.sortName??W.fieldName,children:W.label??kn(W.fieldName)},`${W.key??"rowHeader"}-${W.fieldName}`)})}),v.jsx(j.IconButton,{onClick:()=>{l&&F(l)},children:v.jsx(N6,{className:`sort-icon-${u}`})})]}),v.jsx(j.Divider,{sx:{margin:"10px 0"}})]}),me()??o.map(W=>v.jsxs(j.Card,{className:"MBv2_Table_Stack_Container",sx:{margin:"5px 0",padding:"5px",overflowX:"auto",...se(W)},onClick:()=>fe(n(W)),"data-testid":`card-${n(W)}`,children:[v.jsx("table",{className:"MBv2_Table_Stack",children:v.jsx("tbody",{className:"MBv2_Table_Stack_Body",children:B.map(ee=>v.jsxs("tr",{className:"MBv2_Table_Stack_Row",children:[v.jsx("td",{className:`MBv2_Table_Stack_Cell_Label MBv2_Table_Stack_Col_${ee.fieldName}`,style:{textWrap:"nowrap"},children:ee.label??kn(ee.fieldName)}),v.jsx("td",{className:`MBv2_Table_Stack_Cell_Value MBv2_Table_Stack_Val_${ee.fieldName}`,style:{paddingLeft:"10px"},children:K(ee,W)})]},`${ee.key??"row"}-${n(W)}-${ee.fieldName}`))})}),s&&v.jsx(nA,{colSpan:r.length,isExpanded:n(W)===L,obj:W,renderExpand:ee=>s(ee),asMobileCard:!0})]},n(W)))]}):v.jsx(j.TableContainer,{component:j.Card,"data-testid":"mui-table",...e?{id:`table-${e}`}:{},className:g,style:M?{maxHeight:M,overflow:"auto"}:{},children:v.jsxs(j.Table,{stickyHeader:M!=="undefined",style:{tableLayout:m?"fixed":"auto"},className:"MBv2_Table",sx:w?{"& .MuiTableCell-head":{...w}}:{},...P,children:[v.jsx(j.TableHead,{className:"MBv2_Table_Head",children:v.jsx(j.TableRow,{className:"MBv2_Table_Head_Row",children:B.map((W,ee)=>{const le=Y(W.fieldName);return v.jsx(j.TableCell,{width:Array.isArray(m)?m[ee]:"auto",children:v.jsx(j.Box,{style:{display:"flex",alignItems:"center"},children:v.jsxs(j.Box,{sx:[le&&{"&:hover":{cursor:"pointer",backgroundColor:I.mode==="dark"?"#222222":"#ededed",borderRadius:2}}],style:{display:"flex",alignItems:"center",padding:"5px",paddingLeft:"6px",marginLeft:"-6px"},onClick:le?()=>F(W.sortName??W.fieldName):void 0,children:[v.jsx("strong",{className:"MBv2_Table_Col_Label",style:{wordBreak:"normal"},children:W.label??kn(W.fieldName)}),le&&V(W.fieldName)==="asc"&&v.jsx(lI,{style:{marginLeft:"5px"}}),le&&V(W.fieldName)==="desc"&&v.jsx(k6,{style:{marginLeft:"5px"}}),le&&V(W.fieldName)!=="asc"&&V(W.fieldName)!=="desc"&&v.jsx(D6,{style:{marginLeft:"5px"}})]})})},`${W.key??"rowHeader"}-${W.fieldName}`)})})}),v.jsx(j.TableBody,{className:"MBv2_Table_Body",children:pe()??o.map(W=>v.jsxs(J.Fragment,{children:[v.jsx(j.TableRow,{"data-testid":`row-${n(W)}`,className:"MBv2_Table_Body_Row",onClick:()=>fe(n(W)),sx:se(W),children:B.map(ee=>v.jsx(j.TableCell,{className:`MBv2_Table_Body_Cell MBv2_Table_Body_Col_${ee.fieldName}`,children:K(ee,W)},`${ee.key??"row"}-${n(W)}-${ee.fieldName}`))}),s&&v.jsx(nA,{colSpan:r.length,isExpanded:n(W)===L,obj:W,renderExpand:ee=>s(ee),reRenderExpand:R})]},n(W)))})]})})},IN=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)},g=S=>{r(parseInt(S.target.value,10))},b=j.useMediaQuery(j.useTheme().breakpoints.down("sm")),y=!t.data||t.data&&t.data.length===0;return v.jsxs(j.Box,{children:[v.jsx(AN,{sortOrder:p,sortField:f,...s}),!o&&!y&&v.jsx(j.TablePagination,{"data-testid":"pagination-controls",component:"div",rowsPerPageOptions:b?[]:i,count:u,rowsPerPage:l,page:a,onPageChange:(S,C)=>m(C),onRowsPerPageChange:g,sx:{flexGrow:1,marginRight:{xs:0,md:15}}})]})},rA=()=>({height:window.innerHeight,width:window.innerWidth}),DN=()=>{const[t,e]=J.useState(rA());return J.useEffect(()=>{const n=()=>{e(rA())};return window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[]),t},Eo=t=>{const{name:e="button",color:n="primary",fullWidthOnMobile:r=!0,type:o="button",variant:i="contained"}=t,{width:s}=DN(),a=["locationInBar","closeDialog","fullWidthOnMobile"],l=r&&s<600;return v.jsx(j.Button,{role:"button",name:e,color:n,variant:i,type:o,fullWidth:t.fullWidth?!0:l,...Xn({...t},a)})},jle=t=>{const{onCancel:e,onNewCitation:n,onNewAttachment:r,onEditCitation:o,onEditAttachment:i,onDeleteCitation:s,onSelect:a,fetchExistingCitations:l,selectedIds:u,setSelectedIds:f,onError:p=()=>{},setError:m}=t,[g,b]=J.useState([]),[y,S]=J.useState(!1),[C,E]=J.useState(!0),[T,w]=J.useState(null),[M,R]=J.useState(null),[P,I]=J.useState({pageNo:0,pageSize:5,totalCount:0}),L=()=>{S(!1),E(!0),l({pageNo:P.pageNo,pageSize:P.pageSize}).then(A=>{b(A.data),I({...P,totalCount:A.totalCount})}).catch(A=>{p(A),S(!0),b([])}).finally(()=>E(!1))};J.useEffect(L,[P.pageNo,P.pageSize]);const O=()=>{R(null),w(null)};return v.jsxs(v.Fragment,{children:[v.jsx(IN,{"data-testid":"citation-table",size:"x-small",isLoading:C,columns:[{fieldName:"id",key:"select",label:"",render:(A,N)=>v.jsx(j.Checkbox,{"data-testid":`citation-table_checkbox-${A}`,onChange:()=>{const F=u.includes(N.id);f(F?u.filter(V=>V!==N.id):[...u,N.id])},checked:u.includes(A)})},{fieldName:"title"},{fieldName:"fileName",key:"CitationOrAttachment",label:"Type",render:A=>A?"Attachment":"Citation"},{fieldName:"id",key:"Action",label:"Action",render:(A,N)=>v.jsxs(v.Fragment,{children:[v.jsx(j.IconButton,{color:"primary",onClick:()=>N.fileName?i(N):o(N),"data-testid":`citation-table_edit-btn-${A}`,children:v.jsx(a6,{})}),v.jsx(j.IconButton,{color:"error",onClick:F=>{R(A),w(F.currentTarget)},"data-testid":`citation-table_delete-btn-${A}`,children:v.jsx(_v,{})}),v.jsx(j.Popper,{open:M===A,anchorEl:T,placement:"bottom-end",style:{zIndex:1300},children:v.jsxs(j.Box,{component:j.Paper,p:1,display:"flex",gap:1,boxShadow:9,"data-testid":`citation-table_delete-prompt-${A}`,children:[v.jsxs(j.Typography,{variant:"body2",children:["Are you sure you want to delete this"," ",N.fileName?"attachment":"citation","?"]}),v.jsxs(j.Box,{display:"flex",flexDirection:"row",children:[v.jsx(Eo,{size:"small",variant:"text",onClick:O,"data-testid":`citation-table_delete-prompt-${A}-noBtn`,children:"No"}),v.jsx(Eo,{size:"small",color:"error",startIcon:v.jsx(_v,{}),onClick:()=>{s(A).then(()=>{L(),f(u.filter(F=>F!==A))}).catch(F=>m({title:`Failed to delete ${N.fileName?"attachment":"citation"}`,err:F})).finally(O)},"data-testid":`citation-table_delete-prompt-${A}-yesBtn`,children:"Yes"})]})]})})]})}],data:g,paginationState:P,onPageChange:A=>I({...P,pageNo:A}),onRowsPerPageChange:A=>I({...P,pageSize:A,pageNo:0}),fixedLayout:["60px","auto","auto","120px"],errorTableMsg:y?"Failed to load citations.":void 0,retryCallback:L}),v.jsxs(j.Box,{display:"flex",flexDirection:"row",justifyContent:"space-between",marginTop:"20px",children:[v.jsxs(j.Box,{display:"flex",flexDirection:"row",gap:".25rem",children:[v.jsx(Eo,{variant:"outlined",size:"small",onClick:n,startIcon:v.jsx(U0,{}),children:"Add Citation"}),v.jsx(Eo,{variant:"outlined",size:"small",onClick:r,startIcon:v.jsx(e6,{}),children:"Add Attachment"})]}),v.jsxs(j.Box,{display:"flex",flexDirection:"row",gap:".25rem",children:[v.jsx(Eo,{variant:"outlined",size:"small",onClick:e,children:"Cancel"}),v.jsxs(Eo,{variant:"contained",size:"small",onClick:()=>a(u),children:["Select",u.length>0&&` (${u.length})`]})]})]})]})},N1=t=>{const{loading:e=!1,type:n="submit",size:r="medium",...o}=t,s={small:16,medium:20,large:24}[r];return v.jsx(Eo,{type:n,disabled:e,size:r,startIcon:e?v.jsx(j.CircularProgress,{size:s,color:"inherit"}):null,...o})},$le=t=>{const{id:e,onSave:n,onCancel:r,getCitationById:o,setError:i}=t,s=J.useRef(null),[a,l]=J.useState(!0),[u,f]=J.useState({source:"",title:"",accessedAt:null,url:"",classification:""});J.useEffect(()=>{if(e===void 0){l(!1);return}o(e).then(m=>{f(m),l(!1)}).catch(m=>{l(!1),i({title:"Failed to retrieve citation",err:m})})},[]);const p=()=>{var g,b,y;const m=(b=(g=s==null?void 0:s.current)==null?void 0:g.values)==null?void 0:b.url;m&&((y=s==null?void 0:s.current)==null||y.setFieldValue("url",JP(m)))};return v.jsx(Wt.Formik,{innerRef:s,enableReinitialize:!0,initialValues:u,onSubmit:async m=>{l(!0),n(m).catch(g=>{l(!1),i({title:`Failed to ${e===void 0?"save":"update"} citation`,err:g})}).finally(()=>l(!1))},children:v.jsxs(Wt.Form,{autoComplete:"off",children:[v.jsx(Ba,{name:"source",disabled:a,required:!0,margin:"none"}),v.jsx(Ba,{name:"title",disabled:a,required:!0,margin:"none"}),v.jsx(Cf,{name:"accessedAt",disabled:a,required:!0,margin:"none",isDatePicker:!0}),v.jsx(Ba,{name:"url",disabled:a,required:!0,onBlur:p,margin:"none"}),v.jsx(sI,{row:!0,name:"classification",required:!0,radios:[{label:"Public Source",value:"Public Source"},{label:"Proprietary Source",value:"Proprietary Source"}],margin:"none"}),v.jsxs(j.DialogActions,{sx:{px:0},children:[v.jsx(j.Button,{onClick:r,variant:"outlined",size:"small",children:"Cancel"}),v.jsx(N1,{size:"small",loading:a,children:e?"Update Citation":"Add New Citation"})]})]})})};var kv,oA;function Fle(){if(oA)return kv;oA=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,E){return this._size>=this._maxSize&&this.clear(),C in this._values||this._size++,this._values[C]=E};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);kv={Cache:t,split:p,normalizePath:f,setter:function(C){var E=f(C);return l.get(C)||l.set(C,function(w,M){for(var R=0,P=E.length,I=w;R<P-1;){var L=E[R];if(L==="__proto__"||L==="constructor"||L==="prototype")return w;I=I[E[R++]]}I[E[R]]=M})},getter:function(C,E){var T=f(C);return u.get(C)||u.set(C,function(M){for(var R=0,P=T.length;R<P;)if(M!=null||!E)M=M[T[R++]];else return;return M})},join:function(C){return C.reduce(function(E,T){return E+(g(T)||n.test(T)?"["+T+"]":(E?".":"")+T)},"")},forEach:function(C,E,T){m(Array.isArray(C)?C:p(C),E,T)}};function f(C){return a.get(C)||a.set(C,p(C).map(function(E){return E.replace(i,"$2")}))}function p(C){return C.match(e)||[""]}function m(C,E,T){var w=C.length,M,R,P,I;for(R=0;R<w;R++)M=C[R],M&&(S(M)&&(M='"'+M+'"'),I=g(M),P=!I&&/^\d+$/.test(M),E.call(T,M,I,P,R,C))}function g(C){return typeof C=="string"&&C&&["'",'"'].indexOf(C.charAt(0))!==-1}function b(C){return C.match(r)&&!C.match(n)}function y(C){return o.test(C)}function S(C){return!g(C)&&(b(C)||y(C))}return kv}var $s=Fle(),Mv,iA;function Ble(){if(iA)return Mv;iA=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 Mv={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(" ")},Mv}var Ov=Ble(),Fd={exports:{}},sA;function Vle(){if(sA)return Fd.exports;sA=1,Fd.exports=function(o){return t(e(o),o)},Fd.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(g){if(!p.has(g[0])||!p.has(g[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(g,b,y){if(y.has(g)){var S;try{S=", node was:"+JSON.stringify(g)}catch{S=""}throw new Error("Cyclic dependency"+S)}if(!p.has(g))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(g));if(!l[b]){l[b]=!0;var C=f.get(g)||new Set;if(C=Array.from(C),b=C.length){y.add(g);do{var E=C[--b];m(E,p.get(E),y)}while(b);y.delete(g)}a[--s]=g}}}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 Fd.exports}var zle=Vle();const Hle=rr(zle),Wle=Object.prototype.toString,qle=Error.prototype.toString,Ule=RegExp.prototype.toString,Kle=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",Yle=/^Symbol\((.*)\)(.*)$/;function Gle(t){return t!=+t?"NaN":t===0&&1/t<0?"-0":""+t}function aA(t,e=!1){if(t==null||t===!0||t===!1)return""+t;const n=typeof t;if(n==="number")return Gle(t);if(n==="string")return e?`"${t}"`:t;if(n==="function")return"[Function "+(t.name||"anonymous")+"]";if(n==="symbol")return Kle.call(t).replace(Yle,"Symbol($1)");const r=Wle.call(t).slice(8,-1);return r==="Date"?isNaN(t.getTime())?""+t:t.toISOString(t):r==="Error"||t instanceof Error?"["+qle.call(t)+"]":r==="RegExp"?Ule.call(t):null}function Wi(t,e){let n=aA(t,e);return n!==null?n:JSON.stringify(t,function(r,o){let i=aA(this[r],e);return i!==null?i:o},2)}function PN(t){return t==null?[]:[].concat(t)}let _N,NN,LN,Jle=/\$\{\s*(\w+)\s*\}/g;_N=Symbol.toStringTag;class lA{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[_N]="Error",this.name="ValidationError",this.value=n,this.path=r,this.type=o,this.errors=[],this.inner=[],PN(e).forEach(i=>{if(dr.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]}}NN=Symbol.hasInstance;LN=Symbol.toStringTag;class dr 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(Jle,(o,i)=>Wi(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 lA(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[LN]="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,dr)}static[NN](e){return lA[Symbol.hasInstance](e)||super[Symbol.hasInstance](e)}}let Co={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 \`${Wi(r,!0)}\`).`:".";return e!=="mixed"?`${t} must be a \`${e}\` type, but the final value was: \`${Wi(n,!0)}\``+o:`${t} must match the configured type. The validated value was: \`${Wi(n,!0)}\``+o}},cr={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"},Zle={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"},N0={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},Xle={isValue:"${path} field must be ${value}"},lf={noUnknown:"${path} field has unspecified keys: ${unknown}",exact:"${path} object contains unknown properties: ${properties}"},Qle={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"},ece={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: \`${Wi(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: \`${Wi(n,!0)}\``}return dr.formatError(Co.notType,t)}};Object.assign(Object.create(null),{mixed:Co,string:cr,number:Zle,date:N0,object:lf,array:Qle,boolean:Xle,tuple:ece});const L1=t=>t&&t.__isYupSchema__;class fp{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 fp(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(!L1(o))throw new TypeError("conditions must return a schema object");return o.resolve(n)}}const Bd={context:"$",value:"."};class Qs{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]===Bd.context,this.isValue=this.key[0]===Bd.value,this.isSibling=!this.isContext&&!this.isValue;let r=this.isContext?Bd.context:this.isValue?Bd.value:"";this.path=this.key.slice(r.length),this.getter=this.path&&$s.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}}Qs.prototype.__isYupRef=!0;const Is=t=>t==null;function Ra(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:g}=t;let{parent:b,context:y,abortEarly:S=s.spec.abortEarly,disableStackTrace:C=s.spec.disableStackTrace}=o;function E(A){return Qs.isRef(A)?A.getValue(n,b,y):A}function T(A={}){const N=Object.assign({value:n,originalValue:i,label:s.spec.label,path:A.path||r,spec:s.spec,disableStackTrace:A.disableStackTrace||C},p,A.params);for(const V of Object.keys(N))N[V]=E(N[V]);const F=new dr(dr.formatError(A.message||m,N),n,N.path,A.type||u,N.disableStackTrace);return F.params=N,F}const w=S?a:l;let M={path:r,parent:b,type:u,from:o.from,createError:T,resolve:E,options:o,originalValue:i,schema:s};const R=A=>{dr.isError(A)?w(A):A?l(null):w(T())},P=A=>{dr.isError(A)?w(A):a(A)};if(g&&Is(n))return R(!0);let L;try{var O;if(L=f.call(M,n,M),typeof((O=L)==null?void 0:O.then)=="function"){if(o.sync)throw new Error(`Validation test of type: "${M.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(L).then(R,P)}}catch(A){P(A);return}R(L)}return e.OPTIONS=t,e}function tce(t,e,n,r=n){let o,i,s;return e?($s.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 pp extends Set{describe(){const e=[];for(const n of this.values())e.push(Qs.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 pp(this.values())}merge(e,n){const r=this.clone();return e.forEach(o=>r.add(o)),n.forEach(o=>r.delete(o)),r}}function $a(t,e=new Map){if(L1(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]=$a(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,$a(o,e))}else if(t instanceof Set){n=new Set,e.set(t,n);for(const r of t)n.add($a(r,e))}else if(t instanceof Object){n={},e.set(t,n);for(const[r,o]of Object.entries(t))n[r]=$a(o,e)}else throw Error(`Unable to clone ${t}`);return n}class _o{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 pp,this._blacklist=new pp,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(Co.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=$a(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&&Is(i))return i;let s=Wi(e),a=Wi(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
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=y=>{o||(o=!0,n(y,s))},p=y=>{o||(o=!0,r(y,s))},m=i.length,g=[];if(!m)return p([]);let b={value:s,originalValue:a,path:l,options:u,schema:this};for(let y=0;y<i.length;y++){const S=i[y];S(b,f,function(E){E&&(Array.isArray(E)?g.push(...E):g.push(E)),--m<=0&&p(g)})}}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,g)=>this.resolve(f)._validate(u,f,m,g)}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)=>{dr.isError(l)&&(l.value=u),a(l)},(l,u)=>{l.length?a(new dr(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 dr.isError(a)&&(a.value=l),a},(a,l)=>{if(a.length)throw new dr(a,e,void 0,void 0,s);i=l}),i}isValid(e,n){return this.validate(e,n).then(()=>!0,r=>{if(dr.isError(r))return!1;throw r})}isValidSync(e,n){try{return this.validateSync(e,n),!0}catch(r){if(dr.isError(r))return!1;throw r}}_getDefault(e){let n=this.spec.default;return n==null?n:typeof n=="function"?n.call(this,e):$a(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=Ra({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=Ra({message:n,name:"optionality",test(o){return o===void 0?this.schema.spec.optional:!0}}),r}optional(){return this.optionality(!0)}defined(e=Co.defined){return this.optionality(!1,e)}nullable(){return this.nullability(!0)}nonNullable(e=Co.notNull){return this.nullability(!1,e)}required(e=Co.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=Co.default),typeof n.test!="function")throw new TypeError("`test` is a required parameters");let r=this.clone(),o=Ra(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=PN(e).map(i=>new Qs(i));return o.forEach(i=>{i.isSibling&&r.deps.push(i.key)}),r.conditions.push(typeof n=="function"?new fp(o,n):fp.fromOptions(o,n)),r}typeError(e){let n=this.clone();return n.internalTests.typeError=Ra({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=Co.oneOf){let r=this.clone();return e.forEach(o=>{r._whitelist.add(o),r._blacklist.delete(o)}),r.internalTests.whiteList=Ra({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=Co.notOneOf){let r=this.clone();return e.forEach(o=>{r._blacklist.add(o),r._whitelist.delete(o)}),r.internalTests.blacklist=Ra({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)}}}_o.prototype.__isYupSchema__=!0;for(const t of["validate","validateSync"])_o.prototype[`${t}At`]=function(e,n,r={}){const{parent:o,parentPath:i,schema:s}=tce(this,e,n,r.context);return s[t](o&&o[i],Object.assign({},r,{parent:o,path:e}))};for(const t of["equals","is"])_o.prototype[t]=_o.prototype.oneOf;for(const t of["not","nope"])_o.prototype[t]=_o.prototype.notOneOf;const nce=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function rce(t){const e=L0(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 L0(t){var e,n;const r=nce.exec(t);return r?{year:Xo(r[1]),month:Xo(r[2],1)-1,day:Xo(r[3],1),hour:Xo(r[4]),minute:Xo(r[5]),second:Xo(r[6]),millisecond:r[7]?Xo(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:Xo(r[10]),minuteOffset:Xo(r[11])}:null}function Xo(t,e=0){return Number(t)||e}let oce=/^[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])?)*$/,ice=/^((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,sce=/^(?:[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,ace="^\\d{4}-\\d{2}-\\d{2}",lce="\\d{2}:\\d{2}:\\d{2}",cce="(([+-]\\d{2}(:?\\d{2})?)|Z)",uce=new RegExp(`${ace}T${lce}(\\.\\d+)?${cce}$`),dce=t=>Is(t)||t===t.trim(),fce={}.toString();function j0(){return new jN}class jN extends _o{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===fce?e:o})})}required(e){return super.required(e).withMutation(n=>n.test({message:e||Co.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=cr.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=cr.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=cr.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||cr.matches,params:{regex:e},skipAbsent:!0,test:s=>s===""&&r||s.search(e)!==-1})}email(e=cr.email){return this.matches(oce,{name:"email",message:e,excludeEmptyString:!0})}url(e=cr.url){return this.matches(ice,{name:"url",message:e,excludeEmptyString:!0})}uuid(e=cr.uuid){return this.matches(sce,{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(uce,{name:"datetime",message:n||cr.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:n||cr.datetime_offset,params:{allowOffset:r},skipAbsent:!0,test:i=>{if(!i||r)return!0;const s=L0(i);return s?!!s.z:!1}}).test({name:"datetime_precision",message:n||cr.datetime_precision,params:{precision:o},skipAbsent:!0,test:i=>{if(!i||o==null)return!0;const s=L0(i);return s?s.precision===o:!1}})}ensure(){return this.default("").transform(e=>e===null?"":e)}trim(e=cr.trim){return this.transform(n=>n!=null?n.trim():n).test({message:e,name:"trim",test:dce})}lowercase(e=cr.lowercase){return this.transform(n=>Is(n)?n:n.toLowerCase()).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>Is(n)||n===n.toLowerCase()})}uppercase(e=cr.uppercase){return this.transform(n=>Is(n)?n:n.toUpperCase()).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>Is(n)||n===n.toUpperCase()})}}j0.prototype=jN.prototype;let pce=new Date(""),hce=t=>Object.prototype.toString.call(t)==="[object Date]";class gh extends _o{constructor(){super({type:"date",check(e){return hce(e)&&!isNaN(e.getTime())}}),this.withMutation(()=>{this.transform((e,n,r)=>!r.spec.coerce||r.isType(e)||e===null?e:(e=rce(e),isNaN(e)?gh.INVALID_DATE:new Date(e)))})}prepareParam(e,n){let r;if(Qs.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=N0.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=N0.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)}})}}gh.INVALID_DATE=pce;gh.prototype;function mce(t,e=[]){let n=[],r=new Set,o=new Set(e.map(([s,a])=>`${s}-${a}`));function i(s,a){let l=$s.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),Qs.isRef(a)&&a.isSibling?i(a.path,s):L1(a)&&"deps"in a&&a.deps.forEach(l=>i(l,s))}return Hle.array(Array.from(r),n).reverse()}function cA(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 $N(t){return(e,n)=>cA(t,e)-cA(t,n)}const gce=(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 cf(t){if("fields"in t){const e={};for(const[n,r]of Object.entries(t.fields))e[n]=cf(r);return t.setFields(e)}if(t.type==="array"){const e=t.optional();return e.innerType&&(e.innerType=cf(e.innerType)),e}return t.type==="tuple"?t.optional().clone({types:t.spec.types.map(cf)}):"optional"in t?t.optional():t}const yce=(t,e)=>{const n=[...$s.normalizePath(e)];if(n.length===1)return n[0]in t;let r=n.pop(),o=$s.getter($s.join(n),!0)(t);return!!(o&&r in o)};let uA=t=>Object.prototype.toString.call(t)==="[object Object]";function dA(t,e){let n=Object.keys(t.fields);return Object.keys(e).filter(r=>n.indexOf(r)===-1)}const bce=$N([]);function FN(t){return new BN(t)}class BN extends _o{constructor(e){super({type:"object",check(n){return uA(n)||typeof n=="function"}}),this.fields=Object.create(null),this._sortErrors=bce,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],g=p in o;if(m){let b,y=o[p];u.path=(n.path?`${n.path}.`:"")+p,m=m.resolve({value:y,context:n.context,parent:l});let S=m instanceof _o?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 g&&!s&&(l[p]=o[p]);(g!==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||!uA(u)){o(l,u);return}s=s||u;let f=[];for(let p of this._nodes){let m=this.fields[p];!m||Qs.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=mce(e,n),r._sortErrors=$N(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 cf(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=$s.getter(e,!0);return this.transform(i=>{if(!i)return i;let s=i;return yce(i,e)&&(s=Object.assign({},i),r||delete s[e],s[n]=o(i)),s})}json(){return this.transform(gce)}exact(e){return this.test({name:"exact",exclusive:!0,message:e||lf.exact,test(n){if(n==null)return!0;const r=dA(this.schema,n);return r.length===0||this.createError({params:{properties:r.join(", ")}})}})}stripUnknown(){return this.clone({noUnknown:!0})}noUnknown(e=!0,n=lf.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=dA(this.schema,o);return!e||i.length===0||this.createError({params:{unknown:i.join(", ")}})}});return r.spec.noUnknown=e,r}unknown(e=!0,n=lf.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(Ov.camelCase)}snakeCase(){return this.transformKeys(Ov.snakeCase)}constantCase(){return this.transformKeys(e=>Ov.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}}FN.prototype=BN.prototype;const vce=t=>{const{id:e,onSave:n,onCancel:r,getCitationById:o,disableFileUpload:i=!1,setError:s}=t,a=J.useRef(null),[l,u]=J.useState(!0),[f,p]=J.useState({title:"",file:void 0,fileName:""});return J.useEffect(()=>{if(e===void 0){u(!1);return}o(e).then(m=>{p({...m,file:void 0}),u(!1)}).catch(m=>{u(!1),s({title:"Failed to retrieve attachment",err:m})})},[]),v.jsx(Wt.Formik,{innerRef:a,enableReinitialize:!0,initialValues:f,validationSchema:FN().shape({title:j0().required("Title is required"),fileName:j0().required("A file is required")}),onSubmit:async m=>{u(!0),n(m).catch(g=>{u(!1),s({title:`Failed to ${e===void 0?"save":"update"} attachment`,err:g})}).finally(()=>u(!1))},children:({values:m,setFieldValue:g})=>{var b;return J.useEffect(()=>{var y,S;(y=m.file)!=null&&y.name&&g("fileName",(S=m.file)==null?void 0:S.name)},[(b=m.file)==null?void 0:b.name]),v.jsxs(Wt.Form,{autoComplete:"off",children:[v.jsx(Ba,{name:"title",disabled:l,required:!0,margin:"none"}),v.jsxs(j.Box,{display:"flex",flexDirection:"row",alignItems:"flex-start",children:[v.jsx(tI,{name:"file",readOnly:i}),m.fileName&&v.jsx("span",{style:{margin:"6px 0 0 10px"},children:m.fileName}),v.jsx(Qn,{name:"fileName",id:"fileName-err"})]}),v.jsxs(j.DialogActions,{sx:{px:0},children:[v.jsx(j.Button,{onClick:r,variant:"outlined",size:"small",children:"Cancel"}),v.jsx(N1,{size:"small",loading:l,children:e?"Update Attachment":"Add New Attachment"})]})]})}})};function xce(t){return Ke("MuiAlert",t)}const fA=He("MuiAlert",["root","action","icon","message","filled","colorSuccess","colorInfo","colorWarning","colorError","filledSuccess","filledInfo","filledWarning","filledError","outlined","outlinedSuccess","outlinedInfo","outlinedWarning","outlinedError","standard","standardSuccess","standardInfo","standardWarning","standardError"]),Sce=Fe(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"),Cce=Fe(v.jsx("path",{d:"M12 5.99L19.53 19H4.47L12 5.99M12 2L1 21h22L12 2zm1 14h-2v2h2v-2zm0-6h-2v4h2v-4z"}),"ReportProblemOutlined"),wce=Fe(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"),Tce=Fe(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"),Ece=Fe(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"),kce=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 Ue(i,xce,o)},Mce=ye(dl,{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"?Ga:kc,n=t.palette.mode==="light"?kc:Ga;return{...t.typography.body2,backgroundColor:"transparent",display:"flex",padding:"6px 16px",variants:[...Object.entries(t.palette).filter(Vn(["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),[`& .${fA.icon}`]:t.vars?{color:t.vars.palette.Alert[`${r}IconColor`]}:{color:t.palette[r].main}}})),...Object.entries(t.palette).filter(Vn(["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}`,[`& .${fA.icon}`]:t.vars?{color:t.vars.palette.Alert[`${r}IconColor`]}:{color:t.palette[r].main}}})),...Object.entries(t.palette).filter(Vn(["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)}}}))]}})),Oce=ye("div",{name:"MuiAlert",slot:"Icon",overridesResolver:(t,e)=>e.icon})({marginRight:12,padding:"7px 0",display:"flex",fontSize:22,opacity:.9}),Rce=ye("div",{name:"MuiAlert",slot:"Message",overridesResolver:(t,e)=>e.message})({padding:"8px 0",minWidth:0,overflow:"auto"}),Ace=ye("div",{name:"MuiAlert",slot:"Action",overridesResolver:(t,e)=>e.action})({display:"flex",alignItems:"flex-start",padding:"4px 0 0 16px",marginLeft:"auto",marginRight:-8}),pA={success:v.jsx(Sce,{fontSize:"inherit"}),warning:v.jsx(Cce,{fontSize:"inherit"}),error:v.jsx(wce,{fontSize:"inherit"}),info:v.jsx(Tce,{fontSize:"inherit"})},VN=D.forwardRef(function(e,n){const r=xt({props:e,name:"MuiAlert"}),{action:o,children:i,className:s,closeText:a="Close",color:l,components:u={},componentsProps:f={},icon:p,iconMapping:m=pA,onClose:g,role:b="alert",severity:y="success",slotProps:S={},slots:C={},variant:E="standard",...T}=r,w={...r,color:l,severity:y,variant:E,colorSeverity:l||y},M=kce(w),R={slots:{closeButton:u.CloseButton,closeIcon:u.CloseIcon,...C},slotProps:{...f,...S}},[P,I]=Ft("root",{ref:n,shouldForwardComponentProp:!0,className:Pe(M.root,s),elementType:Mce,externalForwardedProps:{...R,...T},ownerState:w,additionalProps:{role:b,elevation:0}}),[L,O]=Ft("icon",{className:M.icon,elementType:Oce,externalForwardedProps:R,ownerState:w}),[A,N]=Ft("message",{className:M.message,elementType:Rce,externalForwardedProps:R,ownerState:w}),[F,V]=Ft("action",{className:M.action,elementType:Ace,externalForwardedProps:R,ownerState:w}),[$,B]=Ft("closeButton",{elementType:fl,externalForwardedProps:R,ownerState:w}),[U,K]=Ft("closeIcon",{elementType:Ece,externalForwardedProps:R,ownerState:w});return v.jsxs(P,{...I,children:[p!==!1?v.jsx(L,{...O,children:p||m[y]||pA[y]}):null,v.jsx(A,{...N,children:i}),o!=null?v.jsx(F,{...V,children:o}):null,o==null&&g?v.jsx(F,{...V,children:v.jsx($,{size:"small","aria-label":a,title:a,color:"inherit",onClick:g,...B,children:v.jsx(U,{fontSize:"small",...K})})}):null]})});process.env.NODE_ENV!=="production"&&(VN.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 vu=t=>{var g;const{noIcon:e=!1,children:n,severity:r="success",variant:o="leftBorder",sx:i,title:s,...a}=t,{palette:l}=j.useTheme(),u=e?{icon:!1}:{},f=o==="leftBorder"?"standard":o,p=o==="leftBorder"?{...i,borderLeft:`4px solid ${(g=l[r])==null?void 0:g.main}`}:i,m=s?{icon:{sx:{mt:"6px"}}}:{};return v.jsxs(VN,{severity:r,variant:f,sx:p,slotProps:m,...u,...a,children:[s&&v.jsx(j.Typography,{variant:"h3",children:s}),n]})},zN=t=>v.jsx(vu,{severity:"error",...t});function HN({fetchExistingCitations:t,onCreateCitation:e,onUpdateCitation:n,onDeleteCitation:r,getCitationById:o,onStoreAttachment:i,onSelectCitations:s,onCancel:a,initialSelectedIds:l=[],onContentUpdate:u,onError:f=()=>{}}){const[p,m]=J.useState("Insert Citation/Attachment(s)"),[g,b]=J.useState(l),[y,S]=J.useState(void 0),[C,E]=J.useState(void 0);J.useEffect(()=>u==null?void 0:u(),[p,g,C]),J.useEffect(()=>E(void 0),[p]),J.useEffect(()=>{C&&f(C.err)},[C]);const T=async R=>{if(p==="Edit Citation"){if(R.id===void 0)throw Error("Failed to update citation. Citation is missing id");await n(R).then(()=>m("Insert Citation/Attachment(s)")).catch(P=>E({title:"Failed to update citation",err:P}))}else p==="Add Citation"&&await e(R).then(P=>{b([...g,P.id]),m("Insert Citation/Attachment(s)")}).catch(P=>E({title:"Failed to create citation",err:P}))},w=async R=>{if(p==="Edit Attachment"){if(R.id===void 0)throw Error("Failed to update citation. Citation is missing id");await n(R).then(()=>m("Insert Citation/Attachment(s)")).catch(P=>E({title:"Failed to update attachment",err:P}))}else p==="Add Attachment"&&await i(R).then(P=>{b([...g,P.id]),m("Insert Citation/Attachment(s)")}).catch(P=>E({title:"Failed to upload attachment",err:P}))};let M=null;return p==="Insert Citation/Attachment(s)"?M=v.jsx(jle,{fetchExistingCitations:t,onCancel:a,onNewCitation:()=>{S(void 0),m("Add Citation")},onNewAttachment:()=>{S(void 0),m("Add Attachment")},onEditCitation:R=>{S(R.id),m("Edit Citation")},onEditAttachment:R=>{S(R.id),m("Edit Attachment")},onDeleteCitation:r,onSelect:s,setSelectedIds:b,selectedIds:g,onError:f,setError:E}):p==="Add Citation"||p==="Edit Citation"?M=v.jsx($le,{id:y,onSave:T,onCancel:()=>m("Insert Citation/Attachment(s)"),getCitationById:o,setError:E}):(p==="Add Attachment"||p==="Edit Attachment")&&(M=v.jsx(vce,{id:y,onSave:w,onCancel:()=>m("Insert Citation/Attachment(s)"),getCitationById:o,disableFileUpload:p==="Edit Attachment",setError:E})),v.jsxs(j.Box,{width:"500px",children:[v.jsx(j.Typography,{variant:"h6",children:p}),C&&v.jsx(zN,{"data-testid":"citation-menu-error",onClose:()=>E(void 0),children:C.title}),v.jsx(j.Box,{paddingTop:"8px",children:M})]})}const Ice=Kt({name:{CitationBubbleMenuTipTap:WN}})(t=>({content:{padding:t.spacing(1.5,2,.5),backgroundColor:"#f9f9f9"}}));function WN({fetchExistingCitations:t,onCreateCitation:e,onUpdateCitation:n,onDeleteCitation:r,getCitationById:o,onStoreAttachment:i,...s}){const{classes:a}=Ice(),l=bt();if(!(l!=null&&l.isEditable))return null;if(!("citationBubbleMenuHandler"in l.storage))throw new Error("You must add the CitationBubbleMenuHandler extension to the useEditor `extensions` array in order to use this component!");const u=l.storage.citationBubbleMenuHandler,f=u.isOpen,p=u.selectedIds,m=u.selectedNodePos,g=S=>{l&&(S.length===0?l.commands.deleteCitation(m):p.length===0?l.commands.insertCitation({ids:S}):l.commands.updateCitation({ids:S},m))},b=S=>{g(S),l.commands.closeCitationBubbleMenu()},y=()=>{g(p),l.commands.closeCitationBubbleMenu()};return v.jsx(uh,{editor:l,open:f,...u.bubbleMenuOptions,...s,children:v.jsx("div",{className:a.content,children:v.jsx(HN,{fetchExistingCitations:t,onCreateCitation:e,onUpdateCitation:n,onDeleteCitation:r,getCitationById:o,onStoreAttachment:i,onSelectCitations:b,onCancel:y,initialSelectedIds:p,onContentUpdate:()=>{requestAnimationFrame(()=>{l!=null&&l.view&&l.view.dispatch(l.view.state.tr)})}})})})}const Dce=cn.create({name:"starterKit",addExtensions(){const t=[];return this.options.bold!==!1&&t.push(Q_.configure(this.options.bold)),this.options.blockquote!==!1&&t.push(X_.configure(this.options.blockquote)),this.options.bulletList!==!1&&t.push(eN.configure(this.options.bulletList)),this.options.code!==!1&&t.push(tN.configure(this.options.code)),this.options.codeBlock!==!1&&t.push(nN.configure(this.options.codeBlock)),this.options.document!==!1&&t.push(rN.configure(this.options.document)),this.options.dropcursor!==!1&&t.push(oN.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&t.push(iN.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&t.push(sN.configure(this.options.hardBreak)),this.options.heading!==!1&&t.push(j_.configure(this.options.heading)),this.options.history!==!1&&t.push(dN.configure(this.options.history)),this.options.horizontalRule!==!1&&t.push(fN.configure(this.options.horizontalRule)),this.options.italic!==!1&&t.push(pN.configure(this.options.italic)),this.options.listItem!==!1&&t.push(wN.configure(this.options.listItem)),this.options.orderedList!==!1&&t.push(TN.configure(this.options.orderedList)),this.options.paragraph!==!1&&t.push(EN.configure(this.options.paragraph)),this.options.strike!==!1&&t.push(MN.configure(this.options.strike)),this.options.text!==!1&&t.push(ON.configure(this.options.text)),t}}),Pce=()=>cn.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 _ce(t){const e=bt(),n=J.useRef(null);return v.jsx(ht,{buttonRef:n,tooltipLabel:"Insert Citation",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(j.Box,{display:"flex",flexDirection:"row",gap:"4px",alignItems:"center",children:[v.jsx(t6,{fontSize:"small"}),v.jsx(j.Typography,{variant:"body2",children:"Insert Citation"})]})})}const qN=J.createContext(void 0),UN=()=>{const t=J.useContext(qN);if(!t)throw new Error("useSync must be used inside CitationFieldProvider");return t},Nce=({node:t,HTMLAttributes:e,selected:n,extension:r})=>{const o=t.attrs.ids||[],{citations:i}=UN(),[s,a]=J.useState(String(o)),[l,u]=J.useState([]),f=r.options.citationMaxLength;if(J.useEffect(()=>{const p=i.filter(g=>o.includes(g.id)),m=p.map(g=>pf.truncate(g.title,{length:f,omission:"..."})).join(", ");a(m),u(p)},[i,o]),l.length!==0)return v.jsx(m1,{as:"span",...e,children:v.jsx(j.Tooltip,{title:v.jsx(j.Box,{className:"citation-tooltip",children:l.map((p,m)=>{var b;const g=[p.source,p.title,p.fileName,p.url,(b=p.accessedAt)==null?void 0:b.slice(0,10),p.classification];return v.jsxs(j.Typography,{variant:"subtitle2",children:[g.filter(Boolean).join(" | "),m<l.length-1&&v.jsx(j.Divider,{className:"citation-tooltip-divider"})]},p.id)})}),slotProps:{tooltip:{sx:{maxWidth:500}}},children:v.jsx("a",{href:"#",onClick:p=>{p.preventDefault(),p.stopPropagation()},className:n?"selected-citation-link":"citation-link",children:s})})})},Lce=Qt.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",yt(t)]},addNodeView(){return g1(Nce)},addProseMirrorPlugins(){return[new en({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}}}}),jce=t=>{const{name:e,label:n=kn(e),hideLabel:r=!1,required:o=!1,readOnly:i=!1,margin:s="dense",citationMaxLength:a=24,fetchExistingCitations:l,onCreateCitation:u,onUpdateCitation:f,onDeleteCitation:p,getCitationById:m,onStoreAttachment:g,onError:b=()=>{}}=t,y=[Dce,kN.configure({placeholder:"Start typing here..."}),Pce(),Lce.configure({citationMaxLength:a})],[S,C,E]=Wt.useField({name:e}),{setValue:T}=E,{value:w}=S,{resync:M,addUpdateCitation:R,deleteCitation:P}=UN();J.useEffect(()=>{var N,F;w!==((F=(N=I==null?void 0:I.current)==null?void 0:N.editor)==null?void 0:F.getHTML())&&setTimeout(()=>{var V,$,B;(B=($=(V=I==null?void 0:I.current)==null?void 0:V.editor)==null?void 0:$.commands)==null||B.setContent(w),M()},0)},[w]),J.useEffect(()=>{w&&setTimeout(()=>{var N,F,V;(V=(F=(N=I==null?void 0:I.current)==null?void 0:N.editor)==null?void 0:F.commands)==null||V.setContent(w),M()},0)},[]);const I=J.useRef(null),L={normal:{marginTop:"16px",marginBottom:"8px"},dense:{marginTop:"8px",marginBottom:"4px"},none:{margin:0}},O=()=>{var V,$;const N=(($=(V=I.current)==null?void 0:V.editor)==null?void 0:$.getHTML())??"<p></p>",F=!N.replace(/<\/?p>|<br>/g,"").trim();T(F?"<p></p>":N)},A=v.jsxs(j.Box,{id:`citation-field_${e}`,sx:{"& .ProseMirror":{"& h1, & h2, & h3, & h4, & h5, & h6":{scrollMarginTop:i?0:50}}},...L[s],children:[v.jsx(x_,{ref:I,extensions:y,content:w,editable:!i,renderControls:i?void 0:()=>v.jsx(fh,{children:v.jsx(_ce,{})}),onBlur:O,RichTextFieldProps:{variant:"outlined",MenuBarProps:{hide:i}},children:()=>v.jsx(WN,{fetchExistingCitations:l,onCreateCitation:N=>u(N).then(F=>(R(F),F)),onUpdateCitation:N=>f(N).then(F=>(R(F),F)),onDeleteCitation:N=>p(N).then(()=>P(N)),getCitationById:m,onStoreAttachment:g,onError:b})}),v.jsx(Qn,{name:e,id:`${e}-err`})]});return v.jsxs(j.Box,{display:"flex",flexDirection:"column",width:"100%",children:[!r&&v.jsx(j.InputLabel,{htmlFor:`citation-field_${e}`,required:o,children:n}),A]})},$ce=t=>{const{name:e="submit"}=t;return v.jsx(Eo,{name:e,type:"submit",...t})},Fce=t=>{const{label:e="Return to Top",icon:n=lI,scrollThresholdPx:r=100}=t,o=j.useScrollTrigger({threshold:r}),i=J.useCallback(()=>{window.scrollTo({top:0,behavior:"smooth"})},[]);return v.jsx(j.Zoom,{in:o,children:v.jsx(j.Box,{sx:{position:"fixed",bottom:32,right:32,zIndex:1},children:v.jsxs(j.Fab,{onClick:i,color:"primary",size:"small",variant:"extended","aria-label":"Scroll back to top",children:[v.jsx(n,{fontSize:"medium"}),e]})})})},Bce=()=>{const{values:t,errors:e,status:n}=Wt.useFormikContext(),{palette:r}=j.useTheme();return v.jsx(j.Paper,{style:{backgroundColor:r.mode==="dark"?"#303030":"#f0f0f0",margin:"10px 0"},children:v.jsxs(j.List,{children:[v.jsxs(j.ListItem,{children:[v.jsx(j.Typography,{display:"block",variant:"h6",children:"Values"}),v.jsx("br",{}),v.jsx(j.Divider,{variant:"inset"}),v.jsx("pre",{children:JSON.stringify(t,null,2)})]}),v.jsx(j.Divider,{variant:"inset",component:"li"}),v.jsxs(j.ListItem,{id:"testing",children:[v.jsx(j.Typography,{display:"block",variant:"h6",children:"Errors"}),v.jsx("br",{}),v.jsx(j.Divider,{variant:"inset"}),v.jsx("pre",{children:JSON.stringify(e,null,2)})]}),v.jsxs(j.ListItem,{children:[v.jsx(j.Typography,{display:"block",variant:"h6",children:"Status"}),v.jsx("br",{}),v.jsx(j.Divider,{variant:"inset"}),v.jsx("pre",{children:JSON.stringify(n,null,2)})]})]})})},Vce=t=>{const{steps:e,orientation:n,inlineLabel:r=n=="vertical",isResponsive:o=!1}=t,{width:i}=DN();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,...Xn({...t},l)};return v.jsx(j.Stepper,{...u,children:e.map(f=>v.jsx(j.Step,{children:v.jsx(j.StepLabel,{children:f})},f))})},zce=t=>{const{name:e,label:n=kn(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(P6,{}):"Remove",variant:l="card",addButtonSx:u,removeButtonSx:f,allowRemoveAll:p=!1,readOnly:m=!1,emptyListMsg:g="None",showDivider:b=!1,removePosition:y="bottom"}=t,[S]=Wt.useField({name:e}),{value:C}=S,E=T=>({display:"flex",flexDirection:T==="bottom"?"column":"row",alignItems:T==="bottom"?"flex-start":"center"});return v.jsxs(j.FormControl,{fullWidth:!0,children:[v.jsx(j.Typography,{...r,children:n}),m&&S.value.length===0?v.jsx(j.Typography,{children:g}):v.jsx(Wt.FieldArray,{name:e,render:T=>v.jsxs("div",{children:[C.map((w,M)=>v.jsx(J.Fragment,{children:v.jsx(Hce,{variant:l,content:v.jsxs(j.Box,{"data-testid":"form-group-container",sx:typeof y=="string"?E(y):{...y},children:[v.jsxs(j.Box,{width:"100%",children:[i(`${e}.${M}`,M),b&&M!==C.length-1&&v.jsx(j.Divider,{"data-testid":"divider"})]}),!m&&C.length>(p?0:1)&&v.jsx(j.Button,{"data-testid":"repeatable-form-group_remove-btn",sx:f,onClick:()=>T.remove(M),children:a})]})})},`${e}-${M}`)),!m&&v.jsx(j.Button,{"data-testid":"repeatable-form-group_add-btn",onClick:()=>T.push(o),sx:u,children:s})]})})]})},Hce=({variant:t,content:e})=>{switch(t){case"card":return v.jsx(j.Card,{"data-testid":"repeatable-form-group_card",sx:{padding:"8px",marginBottom:"8px"},children:v.jsx(j.CardContent,{children:e})});case"elevatedCard":return v.jsx(j.Card,{"data-testid":"repeatable-form-group_elevated-card",elevation:4,sx:{border:"unset",padding:"8px",marginBottom:"8px"},children:v.jsx(j.CardContent,{children:e})});case"none":return e}},yh=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",g=()=>{if(s&&p)return v.jsx(j.Button,{className:"MBv2_Modal_Close",onClick:t.onClose,...l,children:s})},b=()=>{if(i)return v.jsx(j.DialogActions,{className:"MBv2_Modal_Actions",children:v.jsxs(j.Box,{display:"flex",flexDirection:"row",justifyContent:"space-between",width:"100%",gap:"0.25rem",children:[v.jsx(j.Box,{children:g()}),v.jsxs(j.Box,{display:"flex",gap:".25rem",children:[...i]})]})});if(s&&p)return v.jsx(j.DialogActions,{className:"MBv2_Modal_Actions",children:v.jsx(j.Box,{children:g()})})};return v.jsxs(j.Dialog,{className:"MBv2_Modal",open:e,onClose:()=>{u||n==null||n()},...f,children:[typeof r=="string"?v.jsx(j.DialogTitle,{className:"MBv2_Modal_Title",children:v.jsxs(j.Box,{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",children:[r,m&&v.jsx(j.IconButton,{"data-testid":"modal-header-close-btn",onClick:n,children:v.jsx(o6,{})})]})}):r,o&&(typeof o=="string"?v.jsx(j.DialogContent,{className:"MBv2_Modal_Content",children:v.jsx(j.DialogContentText,{className:"MBv2_Modal_Content_Text",children:o})}):o),b()]})},Wce=t=>{const{confirmBtnLabel:e,onConfirm:n,confirmButtonProps:r={color:"primary",variant:"contained"},closeBtnLabel:o="Cancel",closeButtonPosition:i="bottom",...s}=t;return v.jsx(yh,{actions:[v.jsx(j.Button,{className:"MBv2_ConfirmationModal_ConfirmBtn",onClick:n,...r,children:e})],closeBtnLabel:o,closeButtonPosition:i,...s})},qce=t=>{const{closeBtnLabel:e="OK",closeButtonPosition:n="bottom",closeButtonProps:r={color:"primary",variant:"contained"},...o}=t;return v.jsx(yh,{closeBtnLabel:e,closeButtonPosition:n,closeButtonProps:r,...o})},Uce=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(yh,{actions:[v.jsx(j.Button,{className:"MBv2_DecisionModal_SecondaryAction",onClick:i,...s,children:o}),v.jsx(j.Button,{className:"MBv2_DecisionModal_PrimaryAction",onClick:n,...r,children:e})],closeBtnLabel:a,closeButtonPosition:l,...u})},Kce=t=>{const{featureMenuOptions:e=[],copyright:n,logo:r,sx:o={},fontColor:i="primary"}=t,{palette:s}=j.useTheme(),a=oo.useNavigate();return v.jsxs(j.Box,{className:"MBv2_Footer",sx:{backgroundColor:s.mode==="dark"?"#222222":"#ededed",padding:"25px 30px",...o},children:[v.jsx(j.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(j.Box,{display:"flex",justifyContent:"space-between",flexWrap:"wrap",className:"MBv2_Footer_Nav_Links_Container",gap:2,children:[v.jsx(j.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(j.Link,{"data-testid":l.label,sx:{cursor:"pointer",fontSize:15},color:i,...Gc(l,a),children:l.label},l.label))}),n&&v.jsx(j.Typography,{style:{fontSize:15},"data-testid":"copyright",className:"MBv2_Footer_Copyright",color:i,children:n})]})]})},KN=t=>{const{menuOptionLists:e,anchor:n="left",children:r}=t,{pathname:o}=oo.useLocation(),i=oo.useNavigate(),[s,a]=J.useState(!1),l=(m,g)=>v.jsx(j.MenuList,{children:m.map(b=>v.jsxs(j.MenuItem,{...Gc(b,i,()=>a(!1)),children:[b.icon&&v.jsx(j.ListItemIcon,{children:b.icon}),v.jsx(j.ListItemText,{primary:b.label})]},`mobile-drawer-group-${g}-item-${b.path}`))}),f=(()=>{if(e){const m=e.filter(g=>g&&g.length>0);return m.length===0?null:m.map((g,b)=>v.jsxs(J.Fragment,{children:[l(g,b),b<m.length-1&&v.jsx(j.Divider,{})]},`mobile-drawer-group-${b}`))}return r?v.jsx(j.Box,{role:"presentation",onClick:()=>a(!1),children:r}):null})(),p=f??!1;return J.useEffect(()=>{a(!1)},[o]),p&&v.jsxs(v.Fragment,{children:[v.jsx(j.IconButton,{onClick:()=>a(!0),color:"inherit",title:"Menu",children:v.jsx(O6,{})}),v.jsx(j.Drawer,{"data-testid":"mobile-drawer",anchor:n,open:s,onClose:()=>a(!1),children:v.jsx(j.Box,{sx:{width:300},display:"flex",flexDirection:"column",justifyContent:"space-between",children:v.jsx(j.Box,{display:"flex",justifyContent:"start",flexDirection:"column",children:f})})})]})},YN=t=>{const{env:e,isProd:n}=t;return n?null:v.jsx(j.Paper,{sx:{borderRadius:0,display:"flex",alignItems:"center",justifyContent:"center"},children:v.jsxs(j.Typography,{variant:"h6",color:"error",children:[e," Environment - Test Data Only"]})})},GN=t=>{const{label:e,menuOptions:n=[],icon:r}=t,o=oo.useNavigate(),[i,s]=D.useState(null),a=!!i,l=f=>{s(f.currentTarget)},u=()=>{s(null)};return n.length===0?null:v.jsxs(v.Fragment,{children:[v.jsx(j.Button,{startIcon:r,variant:"outlined",color:"inherit",sx:{minWidth:0,padding:1},onClick:l,children:e}),v.jsx(j.Menu,{anchorEl:i,open:a,onClick:u,children:n.map(f=>v.jsxs(j.MenuItem,{...Gc(f,o),children:[f.icon&&v.jsx(j.ListItemIcon,{children:f.icon}),v.jsx(j.ListItemText,{primary:f.label})]},f.label))})]})},JN=t=>{const{displayName:e,userMenuOptions:n}=t;return v.jsx(GN,{label:e,menuOptions:n,icon:v.jsx(A6,{})})},bh=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}=j.useTheme(),a=oo.useNavigate();return v.jsx(j.Tabs,{orientation:n,value:r??!1,sx:o,slotProps:i,children:e.map((l,u)=>v.jsx(j.Tab,{icon:l.icon,label:l.label,value:u,...Gc(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))})},ZN=t=>{const{featureMenuOptions:e=[],activeTabIdx:n,sx:r}=t;return e.length>0&&v.jsx(j.Paper,{sx:{pl:4,pr:4,borderRadius:0},"data-testid":"navBar",children:v.jsx(bh,{menuOptions:e,activeTabIdx:n,sx:r})})},XN=t=>{const{onToggle:e}=t,{palette:n}=j.useTheme(),r=n.mode==="dark";return v.jsx(j.IconButton,{onClick:e,color:"inherit",title:"Dark Mode Toggle",children:r?v.jsx(cI,{}):v.jsx(aI,{})})},Yce=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:g}=t,b=oo.useNavigate(),y=j.useMediaQuery(j.useTheme().breakpoints.down("sm")),{palette:S}=j.useTheme(),{pathname:C}=oo.useLocation(),E=S.mode==="dark",[T,w]=D.useState(void 0);D.useEffect(()=>{const P=o.findIndex(I=>I.path&&C.startsWith(I.path));w(P>=0?P:void 0)},[C,o]);const M=s&&v.jsx(XN,{onToggle:s}),R=s&&(y||!y&&l)?[{icon:E?v.jsx(cI,{}):v.jsx(aI,{}),label:`Switch to ${E?"Light":"Dark"} mode`,onClick:s},...i]:i;return v.jsxs(j.AppBar,{ref:n,position:f,sx:m,elevation:4,children:[e&&v.jsx(YN,{...e}),u,v.jsxs(j.Toolbar,{sx:{color:"white",display:"flex",justifyContent:"space-between",gap:2},children:[v.jsx(j.Button,{disableRipple:!0,component:oo.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(j.Box,{display:"flex",gap:2,alignItems:"center",children:[!l&&!y&&M,y&&v.jsx(KN,{menuOptionLists:[o,a,R],anchor:"right"}),!y&&v.jsxs(v.Fragment,{children:[v.jsx(j.Box,{display:"flex",gap:0,children:a==null?void 0:a.map((P,I)=>v.jsxs(j.Box,{display:"flex",alignItems:"center",children:[I>0&&v.jsx(j.Typography,{className:"quickLink-divider",color:S.primary.contrastText,children:"|"}),v.jsx(j.Button,{variant:"text",sx:{color:"white"},...Gc(P,b),children:v.jsxs(j.Box,{display:"flex",gap:"3px",alignItems:"center",children:[P.icon,P.label]})})]},P.label))}),p,l&&v.jsx(JN,{displayName:l,userMenuOptions:R})]})]})]}),!y&&v.jsx(ZN,{featureMenuOptions:o,activeTabIdx:T,sx:g})]})},Gce=t=>{const{sx:e,menuOptions:n=[]}=t,{pathname:r}=oo.useLocation(),o=j.useMediaQuery(j.useTheme().breakpoints.down("sm")),[i,s]=J.useState(void 0);return J.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(j.Box,{sx:e,children:v.jsx(j.Card,{sx:{height:"100%",width:200},children:v.jsx(bh,{orientation:"vertical",menuOptions:n,activeTabIdx:i})})})},Jce=t=>{const{featureMenuOptions:e=[],activeTabIdx:n,sx:r}=t,{palette:o}=j.useTheme();return e.length>0&&v.jsx(bh,{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}})},Zce=t=>v.jsx(vu,{severity:"success",...t}),Xce=t=>v.jsx(vu,{severity:"info",...t}),Qce=t=>v.jsx(vu,{severity:"warning",...t}),QN=t=>{const{crumbInfo:e}=t,n=oo.useNavigate();return v.jsx(j.Breadcrumbs,{"aria-label":"breadcrumb",separator:v.jsx(R6,{color:"primary"}),sx:{marginBottom:2},children:e.map(({label:r,path:o},i)=>o&&i<e.length-1?v.jsx(j.Link,{color:"primary",sx:{cursor:"pointer"},onClick:()=>n(o),children:r},r):v.jsx(j.Typography,{color:"primary",children:r},r))})},eue=t=>{const{title:e,message:n,type:r,onClose:o,autoHideDuration:i=8e3,variant:s="leftBorder",elevation:a=6}=t,l=tue(r);return v.jsx(j.Snackbar,{"data-testid":"message-snackbar",anchorOrigin:{vertical:"bottom",horizontal:"right"},open:!0,onClose:u=>{u==null&&o()},autoHideDuration:i,children:v.jsx(vu,{"data-testid":"message-snackbar-alert",severity:l,iconMapping:{info:hA(r),warning:hA(r)},onClose:o,elevation:a,variant:s,children:n?v.jsxs(v.Fragment,{children:[v.jsx(j.AlertTitle,{"data-testid":"alertTitle",sx:{fontWeight:"bold"},children:e}),n]}):e})})},tue=t=>t=="logout"?"info":t=="timeout"?"warning":t,hA=t=>{if(t=="timeout")return v.jsx(ZH,{});if(t=="logout")return v.jsx(M6,{})},nue=t=>{const{title:e,createButtonLabel:n,showAddButton:r=!1,onAdd:o=()=>alert("Not implemented yet"),breadcrumbs:i=[],children:s,sx:a}=t,l=j.useMediaQuery(j.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(j.Box,{sx:a,children:[i.length>0&&v.jsx(QN,{crumbInfo:i}),v.jsxs(j.Box,{className:"MBv2_PageHeader_Header",display:"flex",flexDirection:l?"column":"row",justifyContent:"space-between",alignItems:"center",gap:1,children:[v.jsxs(j.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(j.Typography,{className:"MBv2_PageHeader_Title",variant:"h2",children:e}):e,r&&v.jsxs(Eo,{className:"MBv2_PageHeader_CreateBtn",onClick:()=>o(),children:[v.jsx(XH,{style:{marginRight:"0.5rem"}}),n]})]}),s&&v.jsx(j.Box,{width:l?"100%":"50%",children:s})]})]})},rue=t=>{const{title:e,titleIcon:n,fullWidthIcon:r=!1,children:o,actionLabel:i,action:s,sx:a}=t,l=j.useMediaQuery(j.useTheme().breakpoints.down("sm"));return v.jsxs(j.Card,{sx:a||{padding:"30px 40px",display:"flex",flexDirection:"column",gap:"1rem"},children:[n&&v.jsx(j.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(j.Typography,{variant:"h1",display:"inline",fontSize:"calc(20px + .9vw)",className:"MBv2_SingleActionCard_Title",children:e}),o,v.jsx(j.Button,{variant:"contained",color:"primary",onClick:s,fullWidth:l,className:"MBv2_SingleActionCard_ActionButton",children:i})]})},oue=({children:t,fetchExistingCitations:e})=>{const[n,r]=J.useState([]),o=J.useCallback(async()=>{const a=await e();r(l=>{const u=new Set(l.map(p=>p.id));return[...l.filter(p=>!u.has(p.id)),...a]})},[e]),i=J.useCallback(a=>{const l=n.findIndex(u=>u.id===a.id);r(l!==-1?u=>{const f=[...u];return f[l]=a,f}:[...n,a])},[n]),s=J.useCallback(a=>r(n.filter(l=>l.id!==a)),[n]);return v.jsx(qN.Provider,{value:{citations:n,resync:o,addUpdateCitation:i,deleteCitation:s},children:t})};exports.AlertModal=qce;exports.Autocomplete=eI;exports.Breadcrumbs=QN;exports.Button=Eo;exports.Checkbox=RH;exports.CheckboxGroup=AH;exports.CitationField=jce;exports.CitationFieldProvider=oue;exports.CitationMenu=HN;exports.ConfirmationModal=Wce;exports.DarkModeToggle=XN;exports.DateField=Cf;exports.DateRangeField=QG;exports.DecisionModal=Uce;exports.Drawer=KN;exports.DynamicAutocomplete=MH;exports.EnvironmentBanner=YN;exports.Error=Qn;exports.ErrorAlert=zN;exports.FileList=DH;exports.FileUpload=tI;exports.FloatingNavBar=Jce;exports.Footer=Kce;exports.FormDebugger=Bce;exports.Header=Yce;exports.InfoAlert=Xce;exports.LoadingButton=N1;exports.LoadingIndicator=_0;exports.Location=KH;exports.MenuButton=GN;exports.Modal=yh;exports.MultiAutocomplete=OH;exports.NavBar=ZN;exports.PageHeader=nue;exports.PaginatedTable=IN;exports.ProfileMenu=JN;exports.RadioGroup=sI;exports.RangeSlider=YH;exports.RepeatableFormGroup=zce;exports.RichTextField=Lle;exports.ScrollToTop=Fce;exports.SearchField=B6;exports.Select=GH;exports.Sidebar=Gce;exports.SingleActionCard=rue;exports.Snackbar=eue;exports.Stepper=Vce;exports.Submit=$ce;exports.SuccessAlert=Zce;exports.Switch=JH;exports.Table=AN;exports.Tabs=bh;exports.TextField=Ba;exports.WarningAlert=Qce;
package/dist/index.es.js CHANGED
@@ -56612,6 +56612,7 @@ const Wde = (t) => {
56612
56612
  sx: {
56613
56613
  margin: "5px 0",
56614
56614
  padding: "5px",
56615
+ overflowX: "auto",
56615
56616
  ...ie(j)
56616
56617
  },
56617
56618
  onClick: () => de(n(j)),
@@ -56626,6 +56627,7 @@ const Wde = (t) => {
56626
56627
  "td",
56627
56628
  {
56628
56629
  className: `MBv2_Table_Stack_Cell_Label MBv2_Table_Stack_Col_${X.fieldName}`,
56630
+ style: { textWrap: "nowrap" },
56629
56631
  children: X.label ?? Dn(X.fieldName)
56630
56632
  }
56631
56633
  ),
package/dist/index.umd.js CHANGED
@@ -397,7 +397,7 @@ img.ProseMirror-separator {
397
397
  `,dee="️",fee="‍",d1="";let yp=null,bp=null;function pee(t=[]){const e={};cr.groups=e;const n=new cr;yp==null&&(yp=kP(iee)),bp==null&&(bp=kP(see)),Oe(n,"'",r1),Oe(n,"{",Gc),Oe(n,"}",Jc),Oe(n,"[",qf),Oe(n,"]",Uf),Oe(n,"(",Kf),Oe(n,")",Yf),Oe(n,"<",Gf),Oe(n,">",Jf),Oe(n,"(",Zf),Oe(n,")",Xf),Oe(n,"「",Qf),Oe(n,"」",ep),Oe(n,"『",tp),Oe(n,"』",np),Oe(n,"<",rp),Oe(n,">",op),Oe(n,"&",ip),Oe(n,"*",sp),Oe(n,"@",qi),Oe(n,"`",lp),Oe(n,"^",cp),Oe(n,":",Ui),Oe(n,",",o1),Oe(n,"$",up),Oe(n,".",Io),Oe(n,"=",dp),Oe(n,"!",i1),Oe(n,"-",Hr),Oe(n,"%",Zc),Oe(n,"|",fp),Oe(n,"+",pp),Oe(n,"#",hp),Oe(n,"?",Xc),Oe(n,'"',s1),Oe(n,"/",Do),Oe(n,";",a1),Oe(n,"~",Qc),Oe(n,"_",mp),Oe(n,"\\",ap),Oe(n,"・",CP);const r=ln(n,ni,e1,{[U0]:!0});ln(r,ni,r);const o=ln(r,ti,xP,{[Uc]:!0}),i=ln(r,eu,SP,{[Kc]:!0}),s=ln(n,ti,ei,{[K0]:!0});ln(s,ni,o),ln(s,ti,s),ln(o,ni,o),ln(o,ti,o);const a=ln(n,eu,Z0,{[Y0]:!0});ln(a,ti),ln(a,ni,i),ln(a,eu,a),ln(i,ni,i),ln(i,ti),ln(i,eu,i);const l=Oe(n,u1,n1,{[J0]:!0}),u=Oe(n,EP,t1,{[J0]:!0}),f=ln(n,c1,t1,{[J0]:!0});Oe(n,d1,f),Oe(u,u1,l),Oe(u,d1,f),ln(u,c1,f),Oe(f,EP),Oe(f,u1),ln(f,c1,f),Oe(f,d1,f);const p=ln(n,l1,wP,{[bP]:!0});Oe(p,"#"),ln(p,l1,p),Oe(p,dee,p);const m=Oe(p,fee);Oe(m,"#"),ln(m,l1,p);const g=[[ti,s],[ni,o]],b=[[ti,null],[eu,a],[ni,i]];for(let y=0;y<yp.length;y++)Ki(n,yp[y],X0,ei,g);for(let y=0;y<bp.length;y++)Ki(n,bp[y],Q0,Z0,b);zs(X0,{tld:!0,ascii:!0},e),zs(Q0,{utld:!0,alpha:!0},e),Ki(n,"file",Wf,ei,g),Ki(n,"mailto",Wf,ei,g),Ki(n,"http",Xa,ei,g),Ki(n,"https",Xa,ei,g),Ki(n,"ftp",Xa,ei,g),Ki(n,"ftps",Xa,ei,g),zs(Wf,{scheme:!0,ascii:!0},e),zs(Xa,{slashscheme:!0,ascii:!0},e),t=t.sort((y,S)=>y[0]>S[0]?1:-1);for(let y=0;y<t.length;y++){const S=t[y][0],E=t[y][1]?{[aee]:!0}:{[lee]:!0};S.indexOf("-")>=0?E[G0]=!0:ti.test(S)?ni.test(S)?E[Uc]=!0:E[K0]=!0:E[U0]=!0,vP(n,S,S,E)}return vP(n,"localhost",Yc,{ascii:!0}),n.jd=new cr(gp),{start:n,tokens:Za({groups:e},TP)}}function MP(t,e){const n=hee(e.replace(/[A-Z]/g,a=>a.toLowerCase())),r=n.length,o=[];let i=0,s=0;for(;s<r;){let a=t,l=null,u=0,f=null,p=-1,m=-1;for(;s<r&&(l=a.go(n[s]));)a=l,a.accepts()?(p=0,m=0,f=a):p>=0&&(p+=n[s].length,m++),u+=n[s].length,i+=n[s].length,s++;i-=p,s-=m,u-=p,o.push({t:f.t,v:e.slice(i-u,i),s:i-u,e:i})}return o}function hee(t){const e=[],n=t.length;let r=0;for(;r<n;){let o=t.charCodeAt(r),i,s=o<55296||o>56319||r+1===n||(i=t.charCodeAt(r+1))<56320||i>57343?t[r]:t.slice(r,r+2);e.push(s),r+=s.length}return e}function Ki(t,e,n,r,o){let i;const s=e.length;for(let a=0;a<s-1;a++){const l=e[a];t.j[l]?i=t.j[l]:(i=new cr(r),i.jr=o.slice(),t.j[l]=i),t=i}return i=new cr(n),i.jr=o.slice(),t.j[e[s-1]]=i,i}function kP(t){const e=[],n=[];let r=0,o="0123456789";for(;r<t.length;){let i=0;for(;o.indexOf(t[r+i])>=0;)i++;if(i>0){e.push(n.join(""));for(let s=parseInt(t.substring(r,r+i),10);s>0;s--)n.pop();r+=i}else n.push(t[r]),r++}return e}const tu={defaultProtocol:"http",events:null,format:OP,formatHref:OP,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function f1(t,e=null){let n=Za({},tu);t&&(n=Za(n,t instanceof f1?t.o:t));const r=n.ignoreTags,o=[];for(let i=0;i<r.length;i++)o.push(r[i].toUpperCase());this.o=n,e&&(this.defaultRender=e),this.ignoreTags=o}f1.prototype={o:tu,ignoreTags:[],defaultRender(t){return t},check(t){return this.get("validate",t.toString(),t)},get(t,e,n){const r=e!=null;let o=this.o[t];return o&&(typeof o=="object"?(o=n.t in o?o[n.t]:tu[t],typeof o=="function"&&r&&(o=o(e,n))):typeof o=="function"&&r&&(o=o(e,n.t,n)),o)},getObj(t,e,n){let r=this.o[t];return typeof r=="function"&&e!=null&&(r=r(e,n.t,n)),r},render(t){const e=t.render(this);return(this.get("render",null,t)||this.defaultRender)(e,t.t,t)}};function OP(t){return t}function AP(t,e){this.t="token",this.v=t,this.tk=e}AP.prototype={isLink:!1,toString(){return this.v},toHref(t){return this.toString()},toFormattedString(t){const e=this.toString(),n=t.get("truncate",e,this),r=t.get("format",e,this);return n&&r.length>n?r.substring(0,n)+"…":r},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t=tu.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){const e=this,n=this.toHref(t.get("defaultProtocol")),r=t.get("formatHref",n,this),o=t.get("tagName",n,e),i=this.toFormattedString(t),s={},a=t.get("className",n,e),l=t.get("target",n,e),u=t.get("rel",n,e),f=t.getObj("attributes",n,e),p=t.getObj("events",n,e);return s.href=r,a&&(s.class=a),l&&(s.target=l),u&&(s.rel=u),f&&Za(s,f),{tagName:o,attributes:s,content:i,eventListeners:p}}};function vp(t,e){class n extends AP{constructor(o,i){super(o,i),this.t=t}}for(const r in e)n.prototype[r]=e[r];return n.t=t,n}const IP=vp("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),DP=vp("text"),mee=vp("nl"),xp=vp("url",{isLink:!0,toHref(t=tu.defaultProtocol){return this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==Yc&&t[1].t===Ui}}),jr=t=>new cr(t);function gee({groups:t}){const e=t.domain.concat([ip,sp,qi,ap,lp,cp,up,dp,Hr,e1,Zc,fp,pp,hp,Do,gp,Qc,mp]),n=[Ui,o1,Io,i1,Zc,Xc,s1,a1,Gf,Jf,Gc,Jc,Uf,qf,Kf,Yf,Zf,Xf,Qf,ep,tp,np,rp,op],r=[ip,r1,sp,ap,lp,cp,up,dp,Hr,Gc,Jc,Zc,fp,pp,hp,Xc,Do,gp,Qc,mp],o=jr(),i=Oe(o,Qc);at(i,r,i),at(i,t.domain,i);const s=jr(),a=jr(),l=jr();at(o,t.domain,s),at(o,t.scheme,a),at(o,t.slashscheme,l),at(s,r,i),at(s,t.domain,s);const u=Oe(s,qi);Oe(i,qi,u),Oe(a,qi,u),Oe(l,qi,u);const f=Oe(i,Io);at(f,r,i),at(f,t.domain,i);const p=jr();at(u,t.domain,p),at(p,t.domain,p);const m=Oe(p,Io);at(m,t.domain,p);const g=jr(IP);at(m,t.tld,g),at(m,t.utld,g),Oe(u,Yc,g);const b=Oe(p,Hr);Oe(b,Hr,b),at(b,t.domain,p),at(g,t.domain,p),Oe(g,Io,m),Oe(g,Hr,b);const y=Oe(g,Ui);at(y,t.numeric,IP);const S=Oe(s,Hr),C=Oe(s,Io);Oe(S,Hr,S),at(S,t.domain,s),at(C,r,i),at(C,t.domain,s);const E=jr(xp);at(C,t.tld,E),at(C,t.utld,E),at(E,t.domain,s),at(E,r,i),Oe(E,Io,C),Oe(E,Hr,S),Oe(E,qi,u);const T=Oe(E,Ui),w=jr(xp);at(T,t.numeric,w);const k=jr(xp),A=jr();at(k,e,k),at(k,n,A),at(A,e,k),at(A,n,A),Oe(E,Do,k),Oe(w,Do,k);const _=Oe(a,Ui),D=Oe(l,Ui),$=Oe(D,Do),O=Oe($,Do);at(a,t.domain,s),Oe(a,Io,C),Oe(a,Hr,S),at(l,t.domain,s),Oe(l,Io,C),Oe(l,Hr,S),at(_,t.domain,k),Oe(_,Do,k),Oe(_,Xc,k),at(O,t.domain,k),at(O,e,k),Oe(O,Do,k);const I=[[Gc,Jc],[qf,Uf],[Kf,Yf],[Gf,Jf],[Zf,Xf],[Qf,ep],[tp,np],[rp,op]];for(let L=0;L<I.length;L++){const[B,z]=I[L],R=Oe(k,B);Oe(A,B,R),Oe(R,z,k);const V=jr(xp);at(R,e,V);const U=jr();at(R,n),at(V,e,V),at(V,n,U),at(U,e,V),at(U,n,U),Oe(V,z,k),Oe(U,z,k)}return Oe(o,Yc,E),Oe(o,n1,mee),{start:o,tokens:TP}}function yee(t,e,n){let r=n.length,o=0,i=[],s=[];for(;o<r;){let a=t,l=null,u=null,f=0,p=null,m=-1;for(;o<r&&!(l=a.go(n[o].t));)s.push(n[o++]);for(;o<r&&(u=l||a.go(n[o].t));)l=null,a=u,a.accepts()?(m=0,p=a):m>=0&&m++,o++,f++;if(m<0)o-=f,o<r&&(s.push(n[o]),o++);else{s.length>0&&(i.push(p1(DP,e,s)),s=[]),o-=m,f-=m;const g=p.t,b=n.slice(o-f,o);i.push(p1(g,e,b))}}return s.length>0&&i.push(p1(DP,e,s)),i}function p1(t,e,n){const r=n[0].s,o=n[n.length-1].e,i=e.slice(r,o);return new t(i,n)}const bee=typeof console<"u"&&console&&console.warn||(()=>{}),vee="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",Ut={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function xee(){return cr.groups={},Ut.scanner=null,Ut.parser=null,Ut.tokenQueue=[],Ut.pluginQueue=[],Ut.customSchemes=[],Ut.initialized=!1,Ut}function PP(t,e=!1){if(Ut.initialized&&bee(`linkifyjs: already initialized - will not register custom scheme "${t}" ${vee}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format.
398
398
  1. Must only contain digits, lowercase ASCII letters or "-"
399
399
  2. Cannot start or end with "-"
400
- 3. "-" cannot repeat`);Ut.customSchemes.push([t,e])}function See(){Ut.scanner=pee(Ut.customSchemes);for(let t=0;t<Ut.tokenQueue.length;t++)Ut.tokenQueue[t][1]({scanner:Ut.scanner});Ut.parser=gee(Ut.scanner.tokens);for(let t=0;t<Ut.pluginQueue.length;t++)Ut.pluginQueue[t][1]({scanner:Ut.scanner,parser:Ut.parser});return Ut.initialized=!0,Ut}function h1(t){return Ut.initialized||See(),yee(Ut.parser.start,t,MP(Ut.scanner.start,t))}h1.scan=MP;function _P(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=h1(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 Cee(t){return t.length===1?t[0].isLink:t.length===3&&t[1].isLink?["()","[]"].includes(t[0].value+t[2].value):!1}function wee(t){return new Qt({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=B7(n.doc,[...e]);if(q7(a).forEach(({newRange:u})=>{const f=z7(r.doc,u,g=>g.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 g=m.split(" ").filter(C=>C!=="");if(g.length<=0)return!1;const b=g[g.length-1],y=p.pos+m.lastIndexOf(b);if(!b)return!1;const S=h1(b).map(C=>C.toObject(t.defaultProtocol));if(!Cee(S))return!1;S.filter(C=>C.isLink).map(C=>({...C,from:y+C.start+1,to:y+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=>{ny(C.from,C.to,r.doc).some(E=>E.mark.type===t.type)||s.addMark(C.from,C.to,t.type.create({href:C.href}))})}}),!!s.steps.length)return s}})}function Tee(t){return new Qt({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=ty(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 Eee(t){return new Qt({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=_P(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 Mee=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g;function Hs(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(Mee,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}const kee=lr.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"){PP(t);return}PP(t.scheme,t.optionalSlashes)})},onDestroy(){xee()},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)=>!!Hs(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=>!!Hs(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=>!!Hs(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",gt(this.options.HTMLAttributes,t),0]:["a",gt(this.options.HTMLAttributes,{...t,href:""}),0]},addCommands(){return{setLink:t=>({chain:e})=>{const{href:n}=t;return this.options.isAllowedUri(n,{defaultValidate:r=>!!Hs(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=>!!Hs(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[Bi({find:t=>{const e=[];if(t){const{protocols:n,defaultProtocol:r}=this.options,o=_P(t).filter(i=>i.isLink&&this.options.isAllowedUri(i.value,{defaultValidate:s=>!!Hs(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(wee({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:o=>!!Hs(o,e),protocols:e,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),this.options.openOnClick===!0&&t.push(Tee({type:this.type})),this.options.linkOnPaste&&t.push(Eee({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),t}}),NP=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",gt(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 Oee(t){var e;const{char:n,allowSpaces:r,allowToIncludeChar:o,allowedPrefixes:i,startOfLine:s,$position:a}=t,l=r&&!o,u=mK(n),f=new RegExp(`\\s${u}$`),p=s?"^":"",m=o?"":u,g=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 y=a.pos-b.length,S=Array.from(b.matchAll(g)).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),E=new RegExp(`^[${i==null?void 0:i.join("")}\0]?$`).test(C);if(i!==null&&!E)return null;const T=y+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 Aee=new yn("suggestion");function Iee({pluginKey:t=Aee,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:g=Oee}){let b;const y=p==null?void 0:p(),S=new Qt({key:t,view(){return{update:async(C,E)=>{var T,w,k,A,_,D,$;const O=(T=this.key)===null||T===void 0?void 0:T.getState(E),I=(w=this.key)===null||w===void 0?void 0:w.getState(C.state),L=O.active&&I.active&&O.range.from!==I.range.from,B=!O.active&&I.active,z=O.active&&!I.active,R=!B&&!z&&O.query!==I.query,V=B||L&&R,U=R||L,K=z||L&&R;if(!V&&!U&&!K)return;const G=K&&!V?O:I,Y=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:Y,clientRect:Y?()=>{var Z;const{decorationId:he}=(Z=this.key)===null||Z===void 0?void 0:Z.getState(e.state),pe=C.dom.querySelector(`[data-decoration-id="${he}"]`);return(pe==null?void 0:pe.getBoundingClientRect())||null}:null},V&&((k=y==null?void 0:y.onBeforeStart)===null||k===void 0||k.call(y,b)),U&&((A=y==null?void 0:y.onBeforeUpdate)===null||A===void 0||A.call(y,b)),(U||V)&&(b.items=await f({editor:e,query:G.query})),K&&((_=y==null?void 0:y.onExit)===null||_===void 0||_.call(y,b)),U&&((D=y==null?void 0:y.onUpdate)===null||D===void 0||D.call(y,b)),V&&(($=y==null?void 0:y.onStart)===null||$===void 0||$.call(y,b))},destroy:()=>{var C;b&&((C=y==null?void 0:y.onExit)===null||C===void 0||C.call(y,b))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(C,E,T,w){const{isEditable:k}=e,{composing:A}=e.view,{selection:_}=C,{empty:D,from:$}=_,O={...E};if(O.composing=A,k&&(D||e.view.composing)){($<E.range.from||$>E.range.to)&&!A&&!E.composing&&(O.active=!1);const I=g({char:n,allowSpaces:r,allowToIncludeChar:o,allowedPrefixes:i,startOfLine:s,$position:_.$from}),L=`id_${Math.floor(Math.random()*4294967295)}`;I&&m({editor:e,state:w,range:I.range,isActive:E.active})?(O.active=!0,O.decorationId=E.decorationId?E.decorationId:L,O.range=I.range,O.query=I.query,O.text=I.text):O.active=!1}else O.active=!1;return O.active||(O.decorationId=null,O.range={from:0,to:0},O.query=null,O.text=null),O}},props:{handleKeyDown(C,E){var T;const{active:w,range:k}=S.getState(C.state);return w&&((T=y==null?void 0:y.onKeyDown)===null||T===void 0?void 0:T.call(y,{view:C,event:E,range:k}))||!1},decorations(C){const{active:E,range:T,decorationId:w}=S.getState(C);return E?Jt.create(C.doc,[_n.inline(T.from,T.to,{nodeName:a,class:l,"data-decoration-id":w})]):null}}});return S}const Dee=new yn("mention"),Pee=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",gt(this.HTMLAttributes,t.HTMLAttributes),`${t.suggestion.char}${(n=e.attrs.label)!==null&&n!==void 0?n:e.attrs.id}`]},suggestion:{char:"@",pluginKey:Dee,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",gt({"data-type":this.name},this.options.HTMLAttributes,e),this.options.renderLabel({options:this.options,node:t})];const n={...this.options};n.HTMLAttributes=gt({"data-type":this.name},this.options.HTMLAttributes,e);const r=this.options.renderHTML({options:n,node:t});return typeof r=="string"?["span",gt({"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[Iee({editor:this.editor,...this.options.suggestion})]}}),_ee="listItem",LP="textStyle",$P=/^(\d+)\.\s$/,FP=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",gt(this.options.HTMLAttributes,n),0]:["ol",gt(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(_ee,this.editor.getAttributes(LP)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=Ha({find:$P,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=Ha({find:$P,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(LP)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}}),RP=en.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",gt(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),BP=on.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new Qt({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&&gf(s);if((l||!this.options.showOnlyCurrent)&&u){const f=[this.options.emptyNodeClass];i&&f.push(this.options.emptyEditorClass);const p=_n.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}),Jt.create(t,o)}}})]}}),Nee=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,Lee=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,VP=lr.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",gt(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[_s({find:Nee,type:this.type})]},addPasteRules(){return[Bi({find:Lee,type:this.type})]}}),$ee=lr.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",gt(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()}}}),Fee=lr.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",gt(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()}}}),Ree=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",gt(this.options.HTMLAttributes,t),0]}}),Bee=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",gt(this.options.HTMLAttributes,t),0]}}),Vee=en.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:t}){return["tr",gt(this.options.HTMLAttributes,t),0]}}),zee=/^\s*(\[([( |x])?\])\s$/,Hee=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",gt(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 g=p.doc.nodeAt(m);return p.setNodeMarkup(m,void 0,{...g==null?void 0:g.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[Ha({find:zee,type:this.type,getAttributes:t=>({checked:t[t.length-1]==="x"})})]}}),jee=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",gt(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()}}}),zP=en.create({name:"text",group:"inline"}),Wee=on.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")}}}),qee=lr.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",gt(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()}}}),HP=J.forwardRef((t,e)=>{const[n,r]=J.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 J.useEffect(()=>r(0),[t.items]),J.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(F.Paper,{elevation:5,children:v.jsx(F.List,{dense:!0,sx:{overflow:"hidden"},children:t.items.map((l,u)=>v.jsx(F.ListItem,{disablePadding:!0,children:v.jsx(F.ListItemButton,{selected:u===n,onClick:()=>o(u),children:l.mentionLabel})},l.id))})}):null});HP.displayName="SuggestionList";const jP={bottom:0,height:0,left:0,right:0,top:0,width:0,x:0,y:0,toJSON(){return{}}},Uee={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 G2(HP,{props:n,editor:n.editor}),e=Vc("body",{getReferenceClientRect:()=>{var r;return((r=n.clientRect)==null?void 0:r.call(n))??jP},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))??jP}})},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}}}},Kee=kee.extend({inclusive:!1}),Yee=$ee.extend({excludes:"superscript"}),Gee=Fee.extend({excludes:"subscript"});function Jee({placeholder:t}={}){return J.useMemo(()=>[bQ.configure({resizable:!0}),Vee,Bee,Ree,nP,oP,iP,lP,NP,FP,RP,Yee,Gee,zP,QD,XD,rP,yP,qee,VP,Kee.configure({autolink:!0,linkOnPaste:!0,openOnClick:!1}),hG,aP,uX,Wee.configure({types:["heading","paragraph","image"]}),DQ,PQ,LQ,lX,qQ.configure({multicolor:!0}),gP,yX,sP,jee,Hee.configure({nested:!0}),Pee.configure({suggestion:Uee}),BP.configure({placeholder:t}),mP],[t])}function WP(t){return Array.from(t).filter(e=>(e.type||"").toLowerCase().startsWith("image/"))}const Zee=t=>{const e=Jee({placeholder:"Add your own content here..."});if(t.renderContentOnly)return v.jsx(VJ,{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]=Ht.useField({name:n}),{setValue:f}=u,{value:p}=a;J.useEffect(()=>{var C,E,T;(T=(E=(C=m==null?void 0:m.current)==null?void 0:C.editor)==null?void 0:E.commands)==null||T.setContent(p)},[p]);const m=J.useRef(null),g=J.useCallback((C,E)=>{var w;const T=(w=m.current)==null?void 0:w.editor;if(T)if(i instanceof Promise)i(C).then(k=>{P0({images:k,editor:T,position:E})});else{const k=i(C);P0({images:k,editor:T,position:E})}},[]),b=J.useCallback((C,E,T,w)=>{var A;if(!(E instanceof DragEvent)||!E.dataTransfer)return!1;const k=WP(E.dataTransfer.files);if(k.length>0){const _=(A=C.posAtCoords({left:E.clientX,top:E.clientY}))==null?void 0:A.pos;return g(k,_),E.preventDefault(),!0}return!1},[g]),y=J.useCallback((C,E,T)=>{if(!E.clipboardData)return!1;const w=WP(E.clipboardData.files);return w.length>0?(g(w),!0):!1},[g]),S=v.jsx(F.Box,{sx:{"& .ProseMirror":{"& h1, & h2, & h3, & h4, & h5, & h6":{scrollMarginTop:s?0:50}}},children:v.jsx(tD,{ref:m,extensions:e,content:p,editable:!s,editorProps:{handleDrop:b,handlePaste:y},renderControls:s?void 0:()=>v.jsx(vQ,{onUploadFiles:i}),onBlur:()=>{var C,E;return f(((E=(C=m.current)==null?void 0:C.editor)==null?void 0:E.getHTML())??"")},RichTextFieldProps:{variant:"outlined",MenuBarProps:{hide:s}},children:()=>v.jsxs(v.Fragment,{children:[v.jsx(b2,{}),v.jsx(nD,{})]})})});return v.jsxs(F.Box,{display:"flex",flexDirection:"column",children:[r&&v.jsx(F.Typography,{...o,children:r}),S]})},m1=t=>{const{title:e="Loading...",message:n}=t;return v.jsxs(F.Box,{className:"loading-page",sx:{gap:2},"data-testid":"loading-page",children:[v.jsxs(F.Box,{className:"text-content",children:[v.jsx(F.Typography,{variant:"h1","data-testid":"title",children:e}),n&&v.jsx(F.Typography,{"data-testid":"message",children:n})]}),v.jsx(F.CircularProgress,{size:75,"data-testid":"loading-spinner"})]})},qP=t=>{const{colSpan:e,isExpanded:n,renderExpand:r,obj:o,asMobileCard:i=!1,reRenderExpand:s=!1}=t,[a,l]=J.useState(!1),[u,f]=J.useState(void 0);return J.useEffect(()=>{n&&(!a||s)&&(l(!0),f(r(o)))},[n,o]),i?v.jsx(F.Box,{children:v.jsx(F.Collapse,{in:n,children:u})}):v.jsx(F.TableRow,{children:v.jsx(F.TableCell,{style:{paddingBottom:0,paddingTop:0},colSpan:e,children:v.jsx(F.Collapse,{in:n,children:u})})})},UP=t=>{const{id:e,getRowKey:n=W=>"id"in W&&(typeof W.id=="string"||typeof W.id=="number")?W.id:(console.warn(`Table: "id: string | number" not found in ${JSON.stringify(W)}. Please implement the Table.getRowKey prop so Table knows how to uniquely identify this row.`),JSON.stringify(W)),columns:r,data:o=[],onRowClick:i,renderExpand:s,hideColumnsOnMobile:a=[],sortField:l,sortOrder:u,onSortChange:f,allowSortCols:p,fixedLayout:m=!1,className:g,emptyTableMsg:b="No items to display",errorTableMsg:y,retryCallback:S,isLoading:C=!1,disableMobileCards:E=!1,highlightSelectedRow:T=!1,headerRowStyle:w={},stickyHeader:k,reRenderExpand:A=!1,..._}=t,{palette:D}=F.useTheme(),[$,O]=J.useState(void 0),[I,L]=J.useState(void 0);Array.isArray(m)&&m.length!==r.length&&console.error('Table component: Length of "fixedLayout" is not equal to the length of "columns".');const B=W=>{W!==l?f&&f(W,"asc"):f&&f(l,u==="asc"?"desc":"asc")},z=W=>l===W?u:null,R=F.useMediaQuery(F.useTheme().breakpoints.down("sm")),V=R&&a?r.filter(W=>!a.includes(W.fieldName)):r,U=(W,ee)=>ee.split(".").reduce((le,Q)=>{if(le&&typeof le=="object")return le[Q]},W),K=(W,ee)=>{const le=U(ee,W.fieldName);return W.render?W.render(le,ee,R):le},G=f!==void 0,Y=W=>G?p?p.includes(W):!0:!1,Z=v.jsxs(F.Box,{display:"flex",justifyContent:"center",alignItems:"center",flexDirection:"row",children:[v.jsx(XB,{})," ",b]}),he=v.jsxs(F.Box,{"data-testid":"table-fetch-error-msg",display:"flex",justifyContent:"center",alignItems:"center",flexDirection:"row",children:[v.jsx(lC,{color:"error"})," ",y,S&&v.jsx(F.Button,{variant:"text",onClick:S,children:"Retry?"})]}),pe=()=>{if(C)return v.jsx(F.TableRow,{children:v.jsx(F.TableCell,{colSpan:r.length,align:"center",children:v.jsx(F.Box,{display:"flex",justifyContent:"center",alignItems:"center",flexDirection:"row",children:v.jsx(m1,{})})})});if(y)return v.jsx(F.TableRow,{children:v.jsx(F.TableCell,{colSpan:r.length,align:"center",children:he})});if(o.length===0)return v.jsx(F.TableRow,{children:v.jsx(F.TableCell,{colSpan:r.length,align:"center",children:Z})})},me=()=>{if(C)return v.jsx(m1,{});if(y)return he;if(o.length===0)return Z},re=W=>{T&&L(W)},fe=W=>{if(i&&(i(W),re(W)),s){const ee=$===W?void 0:W;O(ee),re(ee)}},ae=typeof T=="string"?T:D.grey[D.mode=="dark"?600:50],se=W=>{const ee=I===n(W)?ae:"inherit";return{cursor:i||s?"pointer":"default",backgroundColor:ee,...i&&{"&:hover":{backgroundColor:ee===ae?ra(ee,.1):ae}}}};return R&&!E?v.jsxs("div",{...e?{id:`mobile-table-${e}`}:{},className:g,"data-testid":"mui-table-mobile",children:[G&&v.jsxs(v.Fragment,{children:[v.jsxs(F.Box,{display:"flex",className:"MBv2_Table_Stack_Sort",children:[v.jsx(F.TextField,{select:!0,sx:{flexGrow:1},id:"demo-simple-select",size:"small",value:l??"",label:"Sort By...",onChange:W=>B(W.target.value),fullWidth:!0,children:V.map(W=>{if(Y(W.fieldName))return v.jsx(F.MenuItem,{value:W.sortName??W.fieldName,children:W.label??Cn(W.fieldName)},`${W.key??"rowHeader"}-${W.fieldName}`)})}),v.jsx(F.IconButton,{onClick:()=>{l&&B(l)},children:v.jsx(l5,{className:`sort-icon-${u}`})})]}),v.jsx(F.Divider,{sx:{margin:"10px 0"}})]}),me()??o.map(W=>v.jsxs(F.Card,{className:"MBv2_Table_Stack_Container",sx:{margin:"5px 0",padding:"5px",...se(W)},onClick:()=>fe(n(W)),"data-testid":`card-${n(W)}`,children:[v.jsx("table",{className:"MBv2_Table_Stack",children:v.jsx("tbody",{className:"MBv2_Table_Stack_Body",children:V.map(ee=>v.jsxs("tr",{className:"MBv2_Table_Stack_Row",children:[v.jsx("td",{className:`MBv2_Table_Stack_Cell_Label MBv2_Table_Stack_Col_${ee.fieldName}`,children:ee.label??Cn(ee.fieldName)}),v.jsx("td",{className:`MBv2_Table_Stack_Cell_Value MBv2_Table_Stack_Val_${ee.fieldName}`,style:{paddingLeft:"10px"},children:K(ee,W)})]},`${ee.key??"row"}-${n(W)}-${ee.fieldName}`))})}),s&&v.jsx(qP,{colSpan:r.length,isExpanded:n(W)===$,obj:W,renderExpand:ee=>s(ee),asMobileCard:!0})]},n(W)))]}):v.jsx(F.TableContainer,{component:F.Card,"data-testid":"mui-table",...e?{id:`table-${e}`}:{},className:g,style:k?{maxHeight:k,overflow:"auto"}:{},children:v.jsxs(F.Table,{stickyHeader:k!=="undefined",style:{tableLayout:m?"fixed":"auto"},className:"MBv2_Table",sx:w?{"& .MuiTableCell-head":{...w}}:{},..._,children:[v.jsx(F.TableHead,{className:"MBv2_Table_Head",children:v.jsx(F.TableRow,{className:"MBv2_Table_Head_Row",children:V.map((W,ee)=>{const le=Y(W.fieldName);return v.jsx(F.TableCell,{width:Array.isArray(m)?m[ee]:"auto",children:v.jsx(F.Box,{style:{display:"flex",alignItems:"center"},children:v.jsxs(F.Box,{sx:[le&&{"&:hover":{cursor:"pointer",backgroundColor:D.mode==="dark"?"#222222":"#ededed",borderRadius:2}}],style:{display:"flex",alignItems:"center",padding:"5px",paddingLeft:"6px",marginLeft:"-6px"},onClick:le?()=>B(W.sortName??W.fieldName):void 0,children:[v.jsx("strong",{className:"MBv2_Table_Col_Label",style:{wordBreak:"normal"},children:W.label??Cn(W.fieldName)}),le&&z(W.fieldName)==="asc"&&v.jsx(LC,{style:{marginLeft:"5px"}}),le&&z(W.fieldName)==="desc"&&v.jsx(QB,{style:{marginLeft:"5px"}}),le&&z(W.fieldName)!=="asc"&&z(W.fieldName)!=="desc"&&v.jsx(i5,{style:{marginLeft:"5px"}})]})})},`${W.key??"rowHeader"}-${W.fieldName}`)})})}),v.jsx(F.TableBody,{className:"MBv2_Table_Body",children:pe()??o.map(W=>v.jsxs(J.Fragment,{children:[v.jsx(F.TableRow,{"data-testid":`row-${n(W)}`,className:"MBv2_Table_Body_Row",onClick:()=>fe(n(W)),sx:se(W),children:V.map(ee=>v.jsx(F.TableCell,{className:`MBv2_Table_Body_Cell MBv2_Table_Body_Col_${ee.fieldName}`,children:K(ee,W)},`${ee.key??"row"}-${n(W)}-${ee.fieldName}`))}),s&&v.jsx(qP,{colSpan:r.length,isExpanded:n(W)===$,obj:W,renderExpand:ee=>s(ee),reRenderExpand:A})]},n(W)))})]})})},KP=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)},g=S=>{r(parseInt(S.target.value,10))},b=F.useMediaQuery(F.useTheme().breakpoints.down("sm")),y=!t.data||t.data&&t.data.length===0;return v.jsxs(F.Box,{children:[v.jsx(UP,{sortOrder:p,sortField:f,...s}),!o&&!y&&v.jsx(F.TablePagination,{"data-testid":"pagination-controls",component:"div",rowsPerPageOptions:b?[]:i,count:u,rowsPerPage:l,page:a,onPageChange:(S,C)=>m(C),onRowsPerPageChange:g,sx:{flexGrow:1,marginRight:{xs:0,md:15}}})]})},YP=()=>({height:window.innerHeight,width:window.innerWidth}),GP=()=>{const[t,e]=J.useState(YP());return J.useEffect(()=>{const n=()=>{e(YP())};return window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[]),t},Po=t=>{const{name:e="button",color:n="primary",fullWidthOnMobile:r=!0,type:o="button",variant:i="contained"}=t,{width:s}=GP(),a=["locationInBar","closeDialog","fullWidthOnMobile"],l=r&&s<600;return v.jsx(F.Button,{role:"button",name:e,color:n,variant:i,type:o,fullWidth:t.fullWidth?!0:l,...Yn({...t},a)})},Xee=t=>{const{onCancel:e,onNewCitation:n,onNewAttachment:r,onEditCitation:o,onEditAttachment:i,onDeleteCitation:s,onSelect:a,fetchExistingCitations:l,selectedIds:u,setSelectedIds:f,onError:p=()=>{},setError:m}=t,[g,b]=J.useState([]),[y,S]=J.useState(!1),[C,E]=J.useState(!0),[T,w]=J.useState(null),[k,A]=J.useState(null),[_,D]=J.useState({pageNo:0,pageSize:5,totalCount:0}),$=()=>{S(!1),E(!0),l({pageNo:_.pageNo,pageSize:_.pageSize}).then(I=>{b(I.data),D({..._,totalCount:I.totalCount})}).catch(I=>{p(I),S(!0),b([])}).finally(()=>E(!1))};J.useEffect($,[_.pageNo,_.pageSize]);const O=()=>{A(null),w(null)};return v.jsxs(v.Fragment,{children:[v.jsx(KP,{"data-testid":"citation-table",size:"x-small",isLoading:C,columns:[{fieldName:"id",key:"select",label:"",render:(I,L)=>v.jsx(F.Checkbox,{"data-testid":`citation-table_checkbox-${I}`,onChange:()=>{const B=u.includes(L.id);f(B?u.filter(z=>z!==L.id):[...u,L.id])},checked:u.includes(I)})},{fieldName:"title"},{fieldName:"fileName",key:"CitationOrAttachment",label:"Type",render:I=>I?"Attachment":"Citation"},{fieldName:"id",key:"Action",label:"Action",render:(I,L)=>v.jsxs(v.Fragment,{children:[v.jsx(F.IconButton,{color:"primary",onClick:()=>L.fileName?i(L):o(L),"data-testid":`citation-table_edit-btn-${I}`,children:v.jsx(NB,{})}),v.jsx(F.IconButton,{color:"error",onClick:B=>{A(I),w(B.currentTarget)},"data-testid":`citation-table_delete-btn-${I}`,children:v.jsx(Hh,{})}),v.jsx(F.Popper,{open:k===I,anchorEl:T,placement:"bottom-end",style:{zIndex:1300},children:v.jsxs(F.Box,{component:F.Paper,p:1,display:"flex",gap:1,boxShadow:9,"data-testid":`citation-table_delete-prompt-${I}`,children:[v.jsxs(F.Typography,{variant:"body2",children:["Are you sure you want to delete this"," ",L.fileName?"attachment":"citation","?"]}),v.jsxs(F.Box,{display:"flex",flexDirection:"row",children:[v.jsx(Po,{size:"small",variant:"text",onClick:O,"data-testid":`citation-table_delete-prompt-${I}-noBtn`,children:"No"}),v.jsx(Po,{size:"small",color:"error",startIcon:v.jsx(Hh,{}),onClick:()=>{s(I).then(()=>{$(),f(u.filter(B=>B!==I))}).catch(B=>m({title:`Failed to delete ${L.fileName?"attachment":"citation"}`,err:B})).finally(O)},"data-testid":`citation-table_delete-prompt-${I}-yesBtn`,children:"Yes"})]})]})})]})}],data:g,paginationState:_,onPageChange:I=>D({..._,pageNo:I}),onRowsPerPageChange:I=>D({..._,pageSize:I,pageNo:0}),fixedLayout:["60px","auto","auto","120px"],errorTableMsg:y?"Failed to load citations.":void 0,retryCallback:$}),v.jsxs(F.Box,{display:"flex",flexDirection:"row",justifyContent:"space-between",marginTop:"20px",children:[v.jsxs(F.Box,{display:"flex",flexDirection:"row",gap:".25rem",children:[v.jsx(Po,{variant:"outlined",size:"small",onClick:n,startIcon:v.jsx(om,{}),children:"Add Citation"}),v.jsx(Po,{variant:"outlined",size:"small",onClick:r,startIcon:v.jsx(kB,{}),children:"Add Attachment"})]}),v.jsxs(F.Box,{display:"flex",flexDirection:"row",gap:".25rem",children:[v.jsx(Po,{variant:"outlined",size:"small",onClick:e,children:"Cancel"}),v.jsxs(Po,{variant:"contained",size:"small",onClick:()=>a(u),children:["Select",u.length>0&&` (${u.length})`]})]})]})]})},g1=t=>{const{loading:e=!1,type:n="submit",size:r="medium",...o}=t,s={small:16,medium:20,large:24}[r];return v.jsx(Po,{type:n,disabled:e,size:r,startIcon:e?v.jsx(F.CircularProgress,{size:s,color:"inherit"}):null,...o})},Qee=t=>{const{id:e,onSave:n,onCancel:r,getCitationById:o,setError:i}=t,s=J.useRef(null),[a,l]=J.useState(!0),[u,f]=J.useState({source:"",title:"",accessedAt:null,url:"",classification:""});J.useEffect(()=>{if(e===void 0){l(!1);return}o(e).then(m=>{f(m),l(!1)}).catch(m=>{l(!1),i({title:"Failed to retrieve citation",err:m})})},[]);const p=()=>{var g,b,y;const m=(b=(g=s==null?void 0:s.current)==null?void 0:g.values)==null?void 0:b.url;m&&((y=s==null?void 0:s.current)==null||y.setFieldValue("url",n2(m)))};return v.jsx(Ht.Formik,{innerRef:s,enableReinitialize:!0,initialValues:u,onSubmit:async m=>{l(!0),n(m).catch(g=>{l(!1),i({title:`Failed to ${e===void 0?"save":"update"} citation`,err:g})}).finally(()=>l(!1))},children:v.jsxs(Ht.Form,{autoComplete:"off",children:[v.jsx(ca,{name:"source",disabled:a,required:!0,margin:"none"}),v.jsx(ca,{name:"title",disabled:a,required:!0,margin:"none"}),v.jsx(Pd,{name:"accessedAt",disabled:a,required:!0,margin:"none",isDatePicker:!0}),v.jsx(ca,{name:"url",disabled:a,required:!0,onBlur:p,margin:"none"}),v.jsx(_C,{row:!0,name:"classification",required:!0,radios:[{label:"Public Source",value:"Public Source"},{label:"Proprietary Source",value:"Proprietary Source"}],margin:"none"}),v.jsxs(F.DialogActions,{sx:{px:0},children:[v.jsx(F.Button,{onClick:r,variant:"outlined",size:"small",children:"Cancel"}),v.jsx(g1,{size:"small",loading:a,children:e?"Update Citation":"Add New Citation"})]})]})})};var y1,JP;function ete(){if(JP)return y1;JP=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,E){return this._size>=this._maxSize&&this.clear(),C in this._values||this._size++,this._values[C]=E};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);y1={Cache:t,split:p,normalizePath:f,setter:function(C){var E=f(C);return l.get(C)||l.set(C,function(w,k){for(var A=0,_=E.length,D=w;A<_-1;){var $=E[A];if($==="__proto__"||$==="constructor"||$==="prototype")return w;D=D[E[A++]]}D[E[A]]=k})},getter:function(C,E){var T=f(C);return u.get(C)||u.set(C,function(k){for(var A=0,_=T.length;A<_;)if(k!=null||!E)k=k[T[A++]];else return;return k})},join:function(C){return C.reduce(function(E,T){return E+(g(T)||n.test(T)?"["+T+"]":(E?".":"")+T)},"")},forEach:function(C,E,T){m(Array.isArray(C)?C:p(C),E,T)}};function f(C){return a.get(C)||a.set(C,p(C).map(function(E){return E.replace(i,"$2")}))}function p(C){return C.match(e)||[""]}function m(C,E,T){var w=C.length,k,A,_,D;for(A=0;A<w;A++)k=C[A],k&&(S(k)&&(k='"'+k+'"'),D=g(k),_=!D&&/^\d+$/.test(k),E.call(T,k,D,_,A,C))}function g(C){return typeof C=="string"&&C&&["'",'"'].indexOf(C.charAt(0))!==-1}function b(C){return C.match(r)&&!C.match(n)}function y(C){return o.test(C)}function S(C){return!g(C)&&(b(C)||y(C))}return y1}var js=ete(),b1,ZP;function tte(){if(ZP)return b1;ZP=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 b1={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(" ")},b1}var v1=tte(),Sp={exports:{}},XP;function nte(){if(XP)return Sp.exports;XP=1,Sp.exports=function(o){return t(e(o),o)},Sp.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(g){if(!p.has(g[0])||!p.has(g[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(g,b,y){if(y.has(g)){var S;try{S=", node was:"+JSON.stringify(g)}catch{S=""}throw new Error("Cyclic dependency"+S)}if(!p.has(g))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(g));if(!l[b]){l[b]=!0;var C=f.get(g)||new Set;if(C=Array.from(C),b=C.length){y.add(g);do{var E=C[--b];m(E,p.get(E),y)}while(b);y.delete(g)}a[--s]=g}}}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 Sp.exports}var rte=nte();const ote=Gn(rte),ite=Object.prototype.toString,ste=Error.prototype.toString,ate=RegExp.prototype.toString,lte=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",cte=/^Symbol\((.*)\)(.*)$/;function ute(t){return t!=+t?"NaN":t===0&&1/t<0?"-0":""+t}function QP(t,e=!1){if(t==null||t===!0||t===!1)return""+t;const n=typeof t;if(n==="number")return ute(t);if(n==="string")return e?`"${t}"`:t;if(n==="function")return"[Function "+(t.name||"anonymous")+"]";if(n==="symbol")return lte.call(t).replace(cte,"Symbol($1)");const r=ite.call(t).slice(8,-1);return r==="Date"?isNaN(t.getTime())?""+t:t.toISOString(t):r==="Error"||t instanceof Error?"["+ste.call(t)+"]":r==="RegExp"?ate.call(t):null}function Yi(t,e){let n=QP(t,e);return n!==null?n:JSON.stringify(t,function(r,o){let i=QP(this[r],e);return i!==null?i:o},2)}function e_(t){return t==null?[]:[].concat(t)}let t_,n_,r_,dte=/\$\{\s*(\w+)\s*\}/g;t_=Symbol.toStringTag;class o_{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[t_]="Error",this.name="ValidationError",this.value=n,this.path=r,this.type=o,this.errors=[],this.inner=[],e_(e).forEach(i=>{if(ur.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]}}n_=Symbol.hasInstance,r_=Symbol.toStringTag;class ur 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(dte,(o,i)=>Yi(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 o_(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[r_]="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,ur)}static[n_](e){return o_[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 \`${Yi(r,!0)}\`).`:".";return e!=="mixed"?`${t} must be a \`${e}\` type, but the final value was: \`${Yi(n,!0)}\``+o:`${t} must match the configured type. The validated value was: \`${Yi(n,!0)}\``+o}},dr={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"},fte={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"},x1={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},pte={isValue:"${path} field must be ${value}"},Cp={noUnknown:"${path} field has unspecified keys: ${unknown}",exact:"${path} object contains unknown properties: ${properties}"};Object.assign(Object.create(null),{mixed:_o,string:dr,number:fte,date:x1,object:Cp,array:{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"},boolean:pte,tuple:{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: \`${Yi(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: \`${Yi(n,!0)}\``}return ur.formatError(_o.notType,t)}}});const S1=t=>t&&t.__isYupSchema__;class wp{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 wp(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(!S1(o))throw new TypeError("conditions must return a schema object");return o.resolve(n)}}const Tp={context:"$",value:"."};class Ws{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]===Tp.context,this.isValue=this.key[0]===Tp.value,this.isSibling=!this.isContext&&!this.isValue;let r=this.isContext?Tp.context:this.isValue?Tp.value:"";this.path=this.key.slice(r.length),this.getter=this.path&&js.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}}Ws.prototype.__isYupRef=!0;const qs=t=>t==null;function Qa(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:g}=t;let{parent:b,context:y,abortEarly:S=s.spec.abortEarly,disableStackTrace:C=s.spec.disableStackTrace}=o;function E(I){return Ws.isRef(I)?I.getValue(n,b,y):I}function T(I={}){const L=Object.assign({value:n,originalValue:i,label:s.spec.label,path:I.path||r,spec:s.spec,disableStackTrace:I.disableStackTrace||C},p,I.params);for(const z of Object.keys(L))L[z]=E(L[z]);const B=new ur(ur.formatError(I.message||m,L),n,L.path,I.type||u,L.disableStackTrace);return B.params=L,B}const w=S?a:l;let k={path:r,parent:b,type:u,from:o.from,createError:T,resolve:E,options:o,originalValue:i,schema:s};const A=I=>{ur.isError(I)?w(I):I?l(null):w(T())},_=I=>{ur.isError(I)?w(I):a(I)};if(g&&qs(n))return A(!0);let $;try{var O;if($=f.call(k,n,k),typeof((O=$)==null?void 0:O.then)=="function"){if(o.sync)throw new Error(`Validation test of type: "${k.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve($).then(A,_)}}catch(I){_(I);return}A($)}return e.OPTIONS=t,e}function hte(t,e,n,r=n){let o,i,s;return e?(js.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 Ep extends Set{describe(){const e=[];for(const n of this.values())e.push(Ws.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 Ep(this.values())}merge(e,n){const r=this.clone();return e.forEach(o=>r.add(o)),n.forEach(o=>r.delete(o)),r}}function el(t,e=new Map){if(S1(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]=el(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,el(o,e))}else if(t instanceof Set){n=new Set,e.set(t,n);for(const r of t)n.add(el(r,e))}else if(t instanceof Object){n={},e.set(t,n);for(const[r,o]of Object.entries(t))n[r]=el(o,e)}else throw Error(`Unable to clone ${t}`);return n}class No{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 Ep,this._blacklist=new Ep,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=el(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&&qs(i))return i;let s=Yi(e),a=Yi(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
+ 3. "-" cannot repeat`);Ut.customSchemes.push([t,e])}function See(){Ut.scanner=pee(Ut.customSchemes);for(let t=0;t<Ut.tokenQueue.length;t++)Ut.tokenQueue[t][1]({scanner:Ut.scanner});Ut.parser=gee(Ut.scanner.tokens);for(let t=0;t<Ut.pluginQueue.length;t++)Ut.pluginQueue[t][1]({scanner:Ut.scanner,parser:Ut.parser});return Ut.initialized=!0,Ut}function h1(t){return Ut.initialized||See(),yee(Ut.parser.start,t,MP(Ut.scanner.start,t))}h1.scan=MP;function _P(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=h1(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 Cee(t){return t.length===1?t[0].isLink:t.length===3&&t[1].isLink?["()","[]"].includes(t[0].value+t[2].value):!1}function wee(t){return new Qt({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=B7(n.doc,[...e]);if(q7(a).forEach(({newRange:u})=>{const f=z7(r.doc,u,g=>g.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 g=m.split(" ").filter(C=>C!=="");if(g.length<=0)return!1;const b=g[g.length-1],y=p.pos+m.lastIndexOf(b);if(!b)return!1;const S=h1(b).map(C=>C.toObject(t.defaultProtocol));if(!Cee(S))return!1;S.filter(C=>C.isLink).map(C=>({...C,from:y+C.start+1,to:y+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=>{ny(C.from,C.to,r.doc).some(E=>E.mark.type===t.type)||s.addMark(C.from,C.to,t.type.create({href:C.href}))})}}),!!s.steps.length)return s}})}function Tee(t){return new Qt({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=ty(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 Eee(t){return new Qt({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=_P(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 Mee=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g;function Hs(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(Mee,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}const kee=lr.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"){PP(t);return}PP(t.scheme,t.optionalSlashes)})},onDestroy(){xee()},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)=>!!Hs(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=>!!Hs(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=>!!Hs(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",gt(this.options.HTMLAttributes,t),0]:["a",gt(this.options.HTMLAttributes,{...t,href:""}),0]},addCommands(){return{setLink:t=>({chain:e})=>{const{href:n}=t;return this.options.isAllowedUri(n,{defaultValidate:r=>!!Hs(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=>!!Hs(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[Bi({find:t=>{const e=[];if(t){const{protocols:n,defaultProtocol:r}=this.options,o=_P(t).filter(i=>i.isLink&&this.options.isAllowedUri(i.value,{defaultValidate:s=>!!Hs(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(wee({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:o=>!!Hs(o,e),protocols:e,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),this.options.openOnClick===!0&&t.push(Tee({type:this.type})),this.options.linkOnPaste&&t.push(Eee({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),t}}),NP=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",gt(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 Oee(t){var e;const{char:n,allowSpaces:r,allowToIncludeChar:o,allowedPrefixes:i,startOfLine:s,$position:a}=t,l=r&&!o,u=mK(n),f=new RegExp(`\\s${u}$`),p=s?"^":"",m=o?"":u,g=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 y=a.pos-b.length,S=Array.from(b.matchAll(g)).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),E=new RegExp(`^[${i==null?void 0:i.join("")}\0]?$`).test(C);if(i!==null&&!E)return null;const T=y+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 Aee=new yn("suggestion");function Iee({pluginKey:t=Aee,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:g=Oee}){let b;const y=p==null?void 0:p(),S=new Qt({key:t,view(){return{update:async(C,E)=>{var T,w,k,A,_,D,$;const O=(T=this.key)===null||T===void 0?void 0:T.getState(E),I=(w=this.key)===null||w===void 0?void 0:w.getState(C.state),L=O.active&&I.active&&O.range.from!==I.range.from,B=!O.active&&I.active,z=O.active&&!I.active,R=!B&&!z&&O.query!==I.query,V=B||L&&R,U=R||L,K=z||L&&R;if(!V&&!U&&!K)return;const G=K&&!V?O:I,Y=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:Y,clientRect:Y?()=>{var Z;const{decorationId:he}=(Z=this.key)===null||Z===void 0?void 0:Z.getState(e.state),pe=C.dom.querySelector(`[data-decoration-id="${he}"]`);return(pe==null?void 0:pe.getBoundingClientRect())||null}:null},V&&((k=y==null?void 0:y.onBeforeStart)===null||k===void 0||k.call(y,b)),U&&((A=y==null?void 0:y.onBeforeUpdate)===null||A===void 0||A.call(y,b)),(U||V)&&(b.items=await f({editor:e,query:G.query})),K&&((_=y==null?void 0:y.onExit)===null||_===void 0||_.call(y,b)),U&&((D=y==null?void 0:y.onUpdate)===null||D===void 0||D.call(y,b)),V&&(($=y==null?void 0:y.onStart)===null||$===void 0||$.call(y,b))},destroy:()=>{var C;b&&((C=y==null?void 0:y.onExit)===null||C===void 0||C.call(y,b))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(C,E,T,w){const{isEditable:k}=e,{composing:A}=e.view,{selection:_}=C,{empty:D,from:$}=_,O={...E};if(O.composing=A,k&&(D||e.view.composing)){($<E.range.from||$>E.range.to)&&!A&&!E.composing&&(O.active=!1);const I=g({char:n,allowSpaces:r,allowToIncludeChar:o,allowedPrefixes:i,startOfLine:s,$position:_.$from}),L=`id_${Math.floor(Math.random()*4294967295)}`;I&&m({editor:e,state:w,range:I.range,isActive:E.active})?(O.active=!0,O.decorationId=E.decorationId?E.decorationId:L,O.range=I.range,O.query=I.query,O.text=I.text):O.active=!1}else O.active=!1;return O.active||(O.decorationId=null,O.range={from:0,to:0},O.query=null,O.text=null),O}},props:{handleKeyDown(C,E){var T;const{active:w,range:k}=S.getState(C.state);return w&&((T=y==null?void 0:y.onKeyDown)===null||T===void 0?void 0:T.call(y,{view:C,event:E,range:k}))||!1},decorations(C){const{active:E,range:T,decorationId:w}=S.getState(C);return E?Jt.create(C.doc,[_n.inline(T.from,T.to,{nodeName:a,class:l,"data-decoration-id":w})]):null}}});return S}const Dee=new yn("mention"),Pee=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",gt(this.HTMLAttributes,t.HTMLAttributes),`${t.suggestion.char}${(n=e.attrs.label)!==null&&n!==void 0?n:e.attrs.id}`]},suggestion:{char:"@",pluginKey:Dee,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",gt({"data-type":this.name},this.options.HTMLAttributes,e),this.options.renderLabel({options:this.options,node:t})];const n={...this.options};n.HTMLAttributes=gt({"data-type":this.name},this.options.HTMLAttributes,e);const r=this.options.renderHTML({options:n,node:t});return typeof r=="string"?["span",gt({"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[Iee({editor:this.editor,...this.options.suggestion})]}}),_ee="listItem",LP="textStyle",$P=/^(\d+)\.\s$/,FP=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",gt(this.options.HTMLAttributes,n),0]:["ol",gt(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(_ee,this.editor.getAttributes(LP)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=Ha({find:$P,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=Ha({find:$P,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(LP)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}}),RP=en.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",gt(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),BP=on.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new Qt({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&&gf(s);if((l||!this.options.showOnlyCurrent)&&u){const f=[this.options.emptyNodeClass];i&&f.push(this.options.emptyEditorClass);const p=_n.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}),Jt.create(t,o)}}})]}}),Nee=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,Lee=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,VP=lr.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",gt(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[_s({find:Nee,type:this.type})]},addPasteRules(){return[Bi({find:Lee,type:this.type})]}}),$ee=lr.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",gt(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()}}}),Fee=lr.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",gt(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()}}}),Ree=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",gt(this.options.HTMLAttributes,t),0]}}),Bee=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",gt(this.options.HTMLAttributes,t),0]}}),Vee=en.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:t}){return["tr",gt(this.options.HTMLAttributes,t),0]}}),zee=/^\s*(\[([( |x])?\])\s$/,Hee=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",gt(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 g=p.doc.nodeAt(m);return p.setNodeMarkup(m,void 0,{...g==null?void 0:g.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[Ha({find:zee,type:this.type,getAttributes:t=>({checked:t[t.length-1]==="x"})})]}}),jee=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",gt(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()}}}),zP=en.create({name:"text",group:"inline"}),Wee=on.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")}}}),qee=lr.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",gt(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()}}}),HP=J.forwardRef((t,e)=>{const[n,r]=J.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 J.useEffect(()=>r(0),[t.items]),J.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(F.Paper,{elevation:5,children:v.jsx(F.List,{dense:!0,sx:{overflow:"hidden"},children:t.items.map((l,u)=>v.jsx(F.ListItem,{disablePadding:!0,children:v.jsx(F.ListItemButton,{selected:u===n,onClick:()=>o(u),children:l.mentionLabel})},l.id))})}):null});HP.displayName="SuggestionList";const jP={bottom:0,height:0,left:0,right:0,top:0,width:0,x:0,y:0,toJSON(){return{}}},Uee={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 G2(HP,{props:n,editor:n.editor}),e=Vc("body",{getReferenceClientRect:()=>{var r;return((r=n.clientRect)==null?void 0:r.call(n))??jP},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))??jP}})},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}}}},Kee=kee.extend({inclusive:!1}),Yee=$ee.extend({excludes:"superscript"}),Gee=Fee.extend({excludes:"subscript"});function Jee({placeholder:t}={}){return J.useMemo(()=>[bQ.configure({resizable:!0}),Vee,Bee,Ree,nP,oP,iP,lP,NP,FP,RP,Yee,Gee,zP,QD,XD,rP,yP,qee,VP,Kee.configure({autolink:!0,linkOnPaste:!0,openOnClick:!1}),hG,aP,uX,Wee.configure({types:["heading","paragraph","image"]}),DQ,PQ,LQ,lX,qQ.configure({multicolor:!0}),gP,yX,sP,jee,Hee.configure({nested:!0}),Pee.configure({suggestion:Uee}),BP.configure({placeholder:t}),mP],[t])}function WP(t){return Array.from(t).filter(e=>(e.type||"").toLowerCase().startsWith("image/"))}const Zee=t=>{const e=Jee({placeholder:"Add your own content here..."});if(t.renderContentOnly)return v.jsx(VJ,{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]=Ht.useField({name:n}),{setValue:f}=u,{value:p}=a;J.useEffect(()=>{var C,E,T;(T=(E=(C=m==null?void 0:m.current)==null?void 0:C.editor)==null?void 0:E.commands)==null||T.setContent(p)},[p]);const m=J.useRef(null),g=J.useCallback((C,E)=>{var w;const T=(w=m.current)==null?void 0:w.editor;if(T)if(i instanceof Promise)i(C).then(k=>{P0({images:k,editor:T,position:E})});else{const k=i(C);P0({images:k,editor:T,position:E})}},[]),b=J.useCallback((C,E,T,w)=>{var A;if(!(E instanceof DragEvent)||!E.dataTransfer)return!1;const k=WP(E.dataTransfer.files);if(k.length>0){const _=(A=C.posAtCoords({left:E.clientX,top:E.clientY}))==null?void 0:A.pos;return g(k,_),E.preventDefault(),!0}return!1},[g]),y=J.useCallback((C,E,T)=>{if(!E.clipboardData)return!1;const w=WP(E.clipboardData.files);return w.length>0?(g(w),!0):!1},[g]),S=v.jsx(F.Box,{sx:{"& .ProseMirror":{"& h1, & h2, & h3, & h4, & h5, & h6":{scrollMarginTop:s?0:50}}},children:v.jsx(tD,{ref:m,extensions:e,content:p,editable:!s,editorProps:{handleDrop:b,handlePaste:y},renderControls:s?void 0:()=>v.jsx(vQ,{onUploadFiles:i}),onBlur:()=>{var C,E;return f(((E=(C=m.current)==null?void 0:C.editor)==null?void 0:E.getHTML())??"")},RichTextFieldProps:{variant:"outlined",MenuBarProps:{hide:s}},children:()=>v.jsxs(v.Fragment,{children:[v.jsx(b2,{}),v.jsx(nD,{})]})})});return v.jsxs(F.Box,{display:"flex",flexDirection:"column",children:[r&&v.jsx(F.Typography,{...o,children:r}),S]})},m1=t=>{const{title:e="Loading...",message:n}=t;return v.jsxs(F.Box,{className:"loading-page",sx:{gap:2},"data-testid":"loading-page",children:[v.jsxs(F.Box,{className:"text-content",children:[v.jsx(F.Typography,{variant:"h1","data-testid":"title",children:e}),n&&v.jsx(F.Typography,{"data-testid":"message",children:n})]}),v.jsx(F.CircularProgress,{size:75,"data-testid":"loading-spinner"})]})},qP=t=>{const{colSpan:e,isExpanded:n,renderExpand:r,obj:o,asMobileCard:i=!1,reRenderExpand:s=!1}=t,[a,l]=J.useState(!1),[u,f]=J.useState(void 0);return J.useEffect(()=>{n&&(!a||s)&&(l(!0),f(r(o)))},[n,o]),i?v.jsx(F.Box,{children:v.jsx(F.Collapse,{in:n,children:u})}):v.jsx(F.TableRow,{children:v.jsx(F.TableCell,{style:{paddingBottom:0,paddingTop:0},colSpan:e,children:v.jsx(F.Collapse,{in:n,children:u})})})},UP=t=>{const{id:e,getRowKey:n=W=>"id"in W&&(typeof W.id=="string"||typeof W.id=="number")?W.id:(console.warn(`Table: "id: string | number" not found in ${JSON.stringify(W)}. Please implement the Table.getRowKey prop so Table knows how to uniquely identify this row.`),JSON.stringify(W)),columns:r,data:o=[],onRowClick:i,renderExpand:s,hideColumnsOnMobile:a=[],sortField:l,sortOrder:u,onSortChange:f,allowSortCols:p,fixedLayout:m=!1,className:g,emptyTableMsg:b="No items to display",errorTableMsg:y,retryCallback:S,isLoading:C=!1,disableMobileCards:E=!1,highlightSelectedRow:T=!1,headerRowStyle:w={},stickyHeader:k,reRenderExpand:A=!1,..._}=t,{palette:D}=F.useTheme(),[$,O]=J.useState(void 0),[I,L]=J.useState(void 0);Array.isArray(m)&&m.length!==r.length&&console.error('Table component: Length of "fixedLayout" is not equal to the length of "columns".');const B=W=>{W!==l?f&&f(W,"asc"):f&&f(l,u==="asc"?"desc":"asc")},z=W=>l===W?u:null,R=F.useMediaQuery(F.useTheme().breakpoints.down("sm")),V=R&&a?r.filter(W=>!a.includes(W.fieldName)):r,U=(W,ee)=>ee.split(".").reduce((le,Q)=>{if(le&&typeof le=="object")return le[Q]},W),K=(W,ee)=>{const le=U(ee,W.fieldName);return W.render?W.render(le,ee,R):le},G=f!==void 0,Y=W=>G?p?p.includes(W):!0:!1,Z=v.jsxs(F.Box,{display:"flex",justifyContent:"center",alignItems:"center",flexDirection:"row",children:[v.jsx(XB,{})," ",b]}),he=v.jsxs(F.Box,{"data-testid":"table-fetch-error-msg",display:"flex",justifyContent:"center",alignItems:"center",flexDirection:"row",children:[v.jsx(lC,{color:"error"})," ",y,S&&v.jsx(F.Button,{variant:"text",onClick:S,children:"Retry?"})]}),pe=()=>{if(C)return v.jsx(F.TableRow,{children:v.jsx(F.TableCell,{colSpan:r.length,align:"center",children:v.jsx(F.Box,{display:"flex",justifyContent:"center",alignItems:"center",flexDirection:"row",children:v.jsx(m1,{})})})});if(y)return v.jsx(F.TableRow,{children:v.jsx(F.TableCell,{colSpan:r.length,align:"center",children:he})});if(o.length===0)return v.jsx(F.TableRow,{children:v.jsx(F.TableCell,{colSpan:r.length,align:"center",children:Z})})},me=()=>{if(C)return v.jsx(m1,{});if(y)return he;if(o.length===0)return Z},re=W=>{T&&L(W)},fe=W=>{if(i&&(i(W),re(W)),s){const ee=$===W?void 0:W;O(ee),re(ee)}},ae=typeof T=="string"?T:D.grey[D.mode=="dark"?600:50],se=W=>{const ee=I===n(W)?ae:"inherit";return{cursor:i||s?"pointer":"default",backgroundColor:ee,...i&&{"&:hover":{backgroundColor:ee===ae?ra(ee,.1):ae}}}};return R&&!E?v.jsxs("div",{...e?{id:`mobile-table-${e}`}:{},className:g,"data-testid":"mui-table-mobile",children:[G&&v.jsxs(v.Fragment,{children:[v.jsxs(F.Box,{display:"flex",className:"MBv2_Table_Stack_Sort",children:[v.jsx(F.TextField,{select:!0,sx:{flexGrow:1},id:"demo-simple-select",size:"small",value:l??"",label:"Sort By...",onChange:W=>B(W.target.value),fullWidth:!0,children:V.map(W=>{if(Y(W.fieldName))return v.jsx(F.MenuItem,{value:W.sortName??W.fieldName,children:W.label??Cn(W.fieldName)},`${W.key??"rowHeader"}-${W.fieldName}`)})}),v.jsx(F.IconButton,{onClick:()=>{l&&B(l)},children:v.jsx(l5,{className:`sort-icon-${u}`})})]}),v.jsx(F.Divider,{sx:{margin:"10px 0"}})]}),me()??o.map(W=>v.jsxs(F.Card,{className:"MBv2_Table_Stack_Container",sx:{margin:"5px 0",padding:"5px",overflowX:"auto",...se(W)},onClick:()=>fe(n(W)),"data-testid":`card-${n(W)}`,children:[v.jsx("table",{className:"MBv2_Table_Stack",children:v.jsx("tbody",{className:"MBv2_Table_Stack_Body",children:V.map(ee=>v.jsxs("tr",{className:"MBv2_Table_Stack_Row",children:[v.jsx("td",{className:`MBv2_Table_Stack_Cell_Label MBv2_Table_Stack_Col_${ee.fieldName}`,style:{textWrap:"nowrap"},children:ee.label??Cn(ee.fieldName)}),v.jsx("td",{className:`MBv2_Table_Stack_Cell_Value MBv2_Table_Stack_Val_${ee.fieldName}`,style:{paddingLeft:"10px"},children:K(ee,W)})]},`${ee.key??"row"}-${n(W)}-${ee.fieldName}`))})}),s&&v.jsx(qP,{colSpan:r.length,isExpanded:n(W)===$,obj:W,renderExpand:ee=>s(ee),asMobileCard:!0})]},n(W)))]}):v.jsx(F.TableContainer,{component:F.Card,"data-testid":"mui-table",...e?{id:`table-${e}`}:{},className:g,style:k?{maxHeight:k,overflow:"auto"}:{},children:v.jsxs(F.Table,{stickyHeader:k!=="undefined",style:{tableLayout:m?"fixed":"auto"},className:"MBv2_Table",sx:w?{"& .MuiTableCell-head":{...w}}:{},..._,children:[v.jsx(F.TableHead,{className:"MBv2_Table_Head",children:v.jsx(F.TableRow,{className:"MBv2_Table_Head_Row",children:V.map((W,ee)=>{const le=Y(W.fieldName);return v.jsx(F.TableCell,{width:Array.isArray(m)?m[ee]:"auto",children:v.jsx(F.Box,{style:{display:"flex",alignItems:"center"},children:v.jsxs(F.Box,{sx:[le&&{"&:hover":{cursor:"pointer",backgroundColor:D.mode==="dark"?"#222222":"#ededed",borderRadius:2}}],style:{display:"flex",alignItems:"center",padding:"5px",paddingLeft:"6px",marginLeft:"-6px"},onClick:le?()=>B(W.sortName??W.fieldName):void 0,children:[v.jsx("strong",{className:"MBv2_Table_Col_Label",style:{wordBreak:"normal"},children:W.label??Cn(W.fieldName)}),le&&z(W.fieldName)==="asc"&&v.jsx(LC,{style:{marginLeft:"5px"}}),le&&z(W.fieldName)==="desc"&&v.jsx(QB,{style:{marginLeft:"5px"}}),le&&z(W.fieldName)!=="asc"&&z(W.fieldName)!=="desc"&&v.jsx(i5,{style:{marginLeft:"5px"}})]})})},`${W.key??"rowHeader"}-${W.fieldName}`)})})}),v.jsx(F.TableBody,{className:"MBv2_Table_Body",children:pe()??o.map(W=>v.jsxs(J.Fragment,{children:[v.jsx(F.TableRow,{"data-testid":`row-${n(W)}`,className:"MBv2_Table_Body_Row",onClick:()=>fe(n(W)),sx:se(W),children:V.map(ee=>v.jsx(F.TableCell,{className:`MBv2_Table_Body_Cell MBv2_Table_Body_Col_${ee.fieldName}`,children:K(ee,W)},`${ee.key??"row"}-${n(W)}-${ee.fieldName}`))}),s&&v.jsx(qP,{colSpan:r.length,isExpanded:n(W)===$,obj:W,renderExpand:ee=>s(ee),reRenderExpand:A})]},n(W)))})]})})},KP=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)},g=S=>{r(parseInt(S.target.value,10))},b=F.useMediaQuery(F.useTheme().breakpoints.down("sm")),y=!t.data||t.data&&t.data.length===0;return v.jsxs(F.Box,{children:[v.jsx(UP,{sortOrder:p,sortField:f,...s}),!o&&!y&&v.jsx(F.TablePagination,{"data-testid":"pagination-controls",component:"div",rowsPerPageOptions:b?[]:i,count:u,rowsPerPage:l,page:a,onPageChange:(S,C)=>m(C),onRowsPerPageChange:g,sx:{flexGrow:1,marginRight:{xs:0,md:15}}})]})},YP=()=>({height:window.innerHeight,width:window.innerWidth}),GP=()=>{const[t,e]=J.useState(YP());return J.useEffect(()=>{const n=()=>{e(YP())};return window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[]),t},Po=t=>{const{name:e="button",color:n="primary",fullWidthOnMobile:r=!0,type:o="button",variant:i="contained"}=t,{width:s}=GP(),a=["locationInBar","closeDialog","fullWidthOnMobile"],l=r&&s<600;return v.jsx(F.Button,{role:"button",name:e,color:n,variant:i,type:o,fullWidth:t.fullWidth?!0:l,...Yn({...t},a)})},Xee=t=>{const{onCancel:e,onNewCitation:n,onNewAttachment:r,onEditCitation:o,onEditAttachment:i,onDeleteCitation:s,onSelect:a,fetchExistingCitations:l,selectedIds:u,setSelectedIds:f,onError:p=()=>{},setError:m}=t,[g,b]=J.useState([]),[y,S]=J.useState(!1),[C,E]=J.useState(!0),[T,w]=J.useState(null),[k,A]=J.useState(null),[_,D]=J.useState({pageNo:0,pageSize:5,totalCount:0}),$=()=>{S(!1),E(!0),l({pageNo:_.pageNo,pageSize:_.pageSize}).then(I=>{b(I.data),D({..._,totalCount:I.totalCount})}).catch(I=>{p(I),S(!0),b([])}).finally(()=>E(!1))};J.useEffect($,[_.pageNo,_.pageSize]);const O=()=>{A(null),w(null)};return v.jsxs(v.Fragment,{children:[v.jsx(KP,{"data-testid":"citation-table",size:"x-small",isLoading:C,columns:[{fieldName:"id",key:"select",label:"",render:(I,L)=>v.jsx(F.Checkbox,{"data-testid":`citation-table_checkbox-${I}`,onChange:()=>{const B=u.includes(L.id);f(B?u.filter(z=>z!==L.id):[...u,L.id])},checked:u.includes(I)})},{fieldName:"title"},{fieldName:"fileName",key:"CitationOrAttachment",label:"Type",render:I=>I?"Attachment":"Citation"},{fieldName:"id",key:"Action",label:"Action",render:(I,L)=>v.jsxs(v.Fragment,{children:[v.jsx(F.IconButton,{color:"primary",onClick:()=>L.fileName?i(L):o(L),"data-testid":`citation-table_edit-btn-${I}`,children:v.jsx(NB,{})}),v.jsx(F.IconButton,{color:"error",onClick:B=>{A(I),w(B.currentTarget)},"data-testid":`citation-table_delete-btn-${I}`,children:v.jsx(Hh,{})}),v.jsx(F.Popper,{open:k===I,anchorEl:T,placement:"bottom-end",style:{zIndex:1300},children:v.jsxs(F.Box,{component:F.Paper,p:1,display:"flex",gap:1,boxShadow:9,"data-testid":`citation-table_delete-prompt-${I}`,children:[v.jsxs(F.Typography,{variant:"body2",children:["Are you sure you want to delete this"," ",L.fileName?"attachment":"citation","?"]}),v.jsxs(F.Box,{display:"flex",flexDirection:"row",children:[v.jsx(Po,{size:"small",variant:"text",onClick:O,"data-testid":`citation-table_delete-prompt-${I}-noBtn`,children:"No"}),v.jsx(Po,{size:"small",color:"error",startIcon:v.jsx(Hh,{}),onClick:()=>{s(I).then(()=>{$(),f(u.filter(B=>B!==I))}).catch(B=>m({title:`Failed to delete ${L.fileName?"attachment":"citation"}`,err:B})).finally(O)},"data-testid":`citation-table_delete-prompt-${I}-yesBtn`,children:"Yes"})]})]})})]})}],data:g,paginationState:_,onPageChange:I=>D({..._,pageNo:I}),onRowsPerPageChange:I=>D({..._,pageSize:I,pageNo:0}),fixedLayout:["60px","auto","auto","120px"],errorTableMsg:y?"Failed to load citations.":void 0,retryCallback:$}),v.jsxs(F.Box,{display:"flex",flexDirection:"row",justifyContent:"space-between",marginTop:"20px",children:[v.jsxs(F.Box,{display:"flex",flexDirection:"row",gap:".25rem",children:[v.jsx(Po,{variant:"outlined",size:"small",onClick:n,startIcon:v.jsx(om,{}),children:"Add Citation"}),v.jsx(Po,{variant:"outlined",size:"small",onClick:r,startIcon:v.jsx(kB,{}),children:"Add Attachment"})]}),v.jsxs(F.Box,{display:"flex",flexDirection:"row",gap:".25rem",children:[v.jsx(Po,{variant:"outlined",size:"small",onClick:e,children:"Cancel"}),v.jsxs(Po,{variant:"contained",size:"small",onClick:()=>a(u),children:["Select",u.length>0&&` (${u.length})`]})]})]})]})},g1=t=>{const{loading:e=!1,type:n="submit",size:r="medium",...o}=t,s={small:16,medium:20,large:24}[r];return v.jsx(Po,{type:n,disabled:e,size:r,startIcon:e?v.jsx(F.CircularProgress,{size:s,color:"inherit"}):null,...o})},Qee=t=>{const{id:e,onSave:n,onCancel:r,getCitationById:o,setError:i}=t,s=J.useRef(null),[a,l]=J.useState(!0),[u,f]=J.useState({source:"",title:"",accessedAt:null,url:"",classification:""});J.useEffect(()=>{if(e===void 0){l(!1);return}o(e).then(m=>{f(m),l(!1)}).catch(m=>{l(!1),i({title:"Failed to retrieve citation",err:m})})},[]);const p=()=>{var g,b,y;const m=(b=(g=s==null?void 0:s.current)==null?void 0:g.values)==null?void 0:b.url;m&&((y=s==null?void 0:s.current)==null||y.setFieldValue("url",n2(m)))};return v.jsx(Ht.Formik,{innerRef:s,enableReinitialize:!0,initialValues:u,onSubmit:async m=>{l(!0),n(m).catch(g=>{l(!1),i({title:`Failed to ${e===void 0?"save":"update"} citation`,err:g})}).finally(()=>l(!1))},children:v.jsxs(Ht.Form,{autoComplete:"off",children:[v.jsx(ca,{name:"source",disabled:a,required:!0,margin:"none"}),v.jsx(ca,{name:"title",disabled:a,required:!0,margin:"none"}),v.jsx(Pd,{name:"accessedAt",disabled:a,required:!0,margin:"none",isDatePicker:!0}),v.jsx(ca,{name:"url",disabled:a,required:!0,onBlur:p,margin:"none"}),v.jsx(_C,{row:!0,name:"classification",required:!0,radios:[{label:"Public Source",value:"Public Source"},{label:"Proprietary Source",value:"Proprietary Source"}],margin:"none"}),v.jsxs(F.DialogActions,{sx:{px:0},children:[v.jsx(F.Button,{onClick:r,variant:"outlined",size:"small",children:"Cancel"}),v.jsx(g1,{size:"small",loading:a,children:e?"Update Citation":"Add New Citation"})]})]})})};var y1,JP;function ete(){if(JP)return y1;JP=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,E){return this._size>=this._maxSize&&this.clear(),C in this._values||this._size++,this._values[C]=E};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);y1={Cache:t,split:p,normalizePath:f,setter:function(C){var E=f(C);return l.get(C)||l.set(C,function(w,k){for(var A=0,_=E.length,D=w;A<_-1;){var $=E[A];if($==="__proto__"||$==="constructor"||$==="prototype")return w;D=D[E[A++]]}D[E[A]]=k})},getter:function(C,E){var T=f(C);return u.get(C)||u.set(C,function(k){for(var A=0,_=T.length;A<_;)if(k!=null||!E)k=k[T[A++]];else return;return k})},join:function(C){return C.reduce(function(E,T){return E+(g(T)||n.test(T)?"["+T+"]":(E?".":"")+T)},"")},forEach:function(C,E,T){m(Array.isArray(C)?C:p(C),E,T)}};function f(C){return a.get(C)||a.set(C,p(C).map(function(E){return E.replace(i,"$2")}))}function p(C){return C.match(e)||[""]}function m(C,E,T){var w=C.length,k,A,_,D;for(A=0;A<w;A++)k=C[A],k&&(S(k)&&(k='"'+k+'"'),D=g(k),_=!D&&/^\d+$/.test(k),E.call(T,k,D,_,A,C))}function g(C){return typeof C=="string"&&C&&["'",'"'].indexOf(C.charAt(0))!==-1}function b(C){return C.match(r)&&!C.match(n)}function y(C){return o.test(C)}function S(C){return!g(C)&&(b(C)||y(C))}return y1}var js=ete(),b1,ZP;function tte(){if(ZP)return b1;ZP=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 b1={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(" ")},b1}var v1=tte(),Sp={exports:{}},XP;function nte(){if(XP)return Sp.exports;XP=1,Sp.exports=function(o){return t(e(o),o)},Sp.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(g){if(!p.has(g[0])||!p.has(g[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(g,b,y){if(y.has(g)){var S;try{S=", node was:"+JSON.stringify(g)}catch{S=""}throw new Error("Cyclic dependency"+S)}if(!p.has(g))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(g));if(!l[b]){l[b]=!0;var C=f.get(g)||new Set;if(C=Array.from(C),b=C.length){y.add(g);do{var E=C[--b];m(E,p.get(E),y)}while(b);y.delete(g)}a[--s]=g}}}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 Sp.exports}var rte=nte();const ote=Gn(rte),ite=Object.prototype.toString,ste=Error.prototype.toString,ate=RegExp.prototype.toString,lte=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",cte=/^Symbol\((.*)\)(.*)$/;function ute(t){return t!=+t?"NaN":t===0&&1/t<0?"-0":""+t}function QP(t,e=!1){if(t==null||t===!0||t===!1)return""+t;const n=typeof t;if(n==="number")return ute(t);if(n==="string")return e?`"${t}"`:t;if(n==="function")return"[Function "+(t.name||"anonymous")+"]";if(n==="symbol")return lte.call(t).replace(cte,"Symbol($1)");const r=ite.call(t).slice(8,-1);return r==="Date"?isNaN(t.getTime())?""+t:t.toISOString(t):r==="Error"||t instanceof Error?"["+ste.call(t)+"]":r==="RegExp"?ate.call(t):null}function Yi(t,e){let n=QP(t,e);return n!==null?n:JSON.stringify(t,function(r,o){let i=QP(this[r],e);return i!==null?i:o},2)}function e_(t){return t==null?[]:[].concat(t)}let t_,n_,r_,dte=/\$\{\s*(\w+)\s*\}/g;t_=Symbol.toStringTag;class o_{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[t_]="Error",this.name="ValidationError",this.value=n,this.path=r,this.type=o,this.errors=[],this.inner=[],e_(e).forEach(i=>{if(ur.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]}}n_=Symbol.hasInstance,r_=Symbol.toStringTag;class ur 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(dte,(o,i)=>Yi(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 o_(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[r_]="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,ur)}static[n_](e){return o_[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 \`${Yi(r,!0)}\`).`:".";return e!=="mixed"?`${t} must be a \`${e}\` type, but the final value was: \`${Yi(n,!0)}\``+o:`${t} must match the configured type. The validated value was: \`${Yi(n,!0)}\``+o}},dr={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"},fte={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"},x1={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},pte={isValue:"${path} field must be ${value}"},Cp={noUnknown:"${path} field has unspecified keys: ${unknown}",exact:"${path} object contains unknown properties: ${properties}"};Object.assign(Object.create(null),{mixed:_o,string:dr,number:fte,date:x1,object:Cp,array:{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"},boolean:pte,tuple:{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: \`${Yi(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: \`${Yi(n,!0)}\``}return ur.formatError(_o.notType,t)}}});const S1=t=>t&&t.__isYupSchema__;class wp{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 wp(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(!S1(o))throw new TypeError("conditions must return a schema object");return o.resolve(n)}}const Tp={context:"$",value:"."};class Ws{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]===Tp.context,this.isValue=this.key[0]===Tp.value,this.isSibling=!this.isContext&&!this.isValue;let r=this.isContext?Tp.context:this.isValue?Tp.value:"";this.path=this.key.slice(r.length),this.getter=this.path&&js.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}}Ws.prototype.__isYupRef=!0;const qs=t=>t==null;function Qa(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:g}=t;let{parent:b,context:y,abortEarly:S=s.spec.abortEarly,disableStackTrace:C=s.spec.disableStackTrace}=o;function E(I){return Ws.isRef(I)?I.getValue(n,b,y):I}function T(I={}){const L=Object.assign({value:n,originalValue:i,label:s.spec.label,path:I.path||r,spec:s.spec,disableStackTrace:I.disableStackTrace||C},p,I.params);for(const z of Object.keys(L))L[z]=E(L[z]);const B=new ur(ur.formatError(I.message||m,L),n,L.path,I.type||u,L.disableStackTrace);return B.params=L,B}const w=S?a:l;let k={path:r,parent:b,type:u,from:o.from,createError:T,resolve:E,options:o,originalValue:i,schema:s};const A=I=>{ur.isError(I)?w(I):I?l(null):w(T())},_=I=>{ur.isError(I)?w(I):a(I)};if(g&&qs(n))return A(!0);let $;try{var O;if($=f.call(k,n,k),typeof((O=$)==null?void 0:O.then)=="function"){if(o.sync)throw new Error(`Validation test of type: "${k.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve($).then(A,_)}}catch(I){_(I);return}A($)}return e.OPTIONS=t,e}function hte(t,e,n,r=n){let o,i,s;return e?(js.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 Ep extends Set{describe(){const e=[];for(const n of this.values())e.push(Ws.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 Ep(this.values())}merge(e,n){const r=this.clone();return e.forEach(o=>r.add(o)),n.forEach(o=>r.delete(o)),r}}function el(t,e=new Map){if(S1(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]=el(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,el(o,e))}else if(t instanceof Set){n=new Set,e.set(t,n);for(const r of t)n.add(el(r,e))}else if(t instanceof Object){n={},e.set(t,n);for(const[r,o]of Object.entries(t))n[r]=el(o,e)}else throw Error(`Unable to clone ${t}`);return n}class No{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 Ep,this._blacklist=new Ep,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=el(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&&qs(i))return i;let s=Yi(e),a=Yi(i);throw new TypeError(`The value of ${n.path||"field"} could not be cast to a value that satisfies the schema type: "${r.type}".
401
401
 
402
402
  attempted value: ${s}
403
403
  `+(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=y=>{o||(o=!0,n(y,s))},p=y=>{o||(o=!0,r(y,s))},m=i.length,g=[];if(!m)return p([]);let b={value:s,originalValue:a,path:l,options:u,schema:this};for(let y=0;y<i.length;y++){const S=i[y];S(b,f,function(E){E&&(Array.isArray(E)?g.push(...E):g.push(E)),--m<=0&&p(g)})}}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,g)=>this.resolve(f)._validate(u,f,m,g)}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)=>{ur.isError(l)&&(l.value=u),a(l)},(l,u)=>{l.length?a(new ur(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 ur.isError(a)&&(a.value=l),a},(a,l)=>{if(a.length)throw new ur(a,e,void 0,void 0,s);i=l}),i}isValid(e,n){return this.validate(e,n).then(()=>!0,r=>{if(ur.isError(r))return!1;throw r})}isValidSync(e,n){try{return this.validateSync(e,n),!0}catch(r){if(ur.isError(r))return!1;throw r}}_getDefault(e){let n=this.spec.default;return n==null?n:typeof n=="function"?n.call(this,e):el(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=Qa({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=Qa({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=Qa(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=e_(e).map(i=>new Ws(i));return o.forEach(i=>{i.isSibling&&r.deps.push(i.key)}),r.conditions.push(typeof n=="function"?new wp(o,n):wp.fromOptions(o,n)),r}typeError(e){let n=this.clone();return n.internalTests.typeError=Qa({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=Qa({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=Qa({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)}}}No.prototype.__isYupSchema__=!0;for(const t of["validate","validateSync"])No.prototype[`${t}At`]=function(e,n,r={}){const{parent:o,parentPath:i,schema:s}=hte(this,e,n,r.context);return s[t](o&&o[i],Object.assign({},r,{parent:o,path:e}))};for(const t of["equals","is"])No.prototype[t]=No.prototype.oneOf;for(const t of["not","nope"])No.prototype[t]=No.prototype.notOneOf;const mte=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function gte(t){const e=C1(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 C1(t){var e,n;const r=mte.exec(t);return r?{year:ri(r[1]),month:ri(r[2],1)-1,day:ri(r[3],1),hour:ri(r[4]),minute:ri(r[5]),second:ri(r[6]),millisecond:r[7]?ri(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:ri(r[10]),minuteOffset:ri(r[11])}:null}function ri(t,e=0){return Number(t)||e}let yte=/^[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])?)*$/,bte=/^((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,vte=/^(?:[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,xte="^\\d{4}-\\d{2}-\\d{2}",Ste="\\d{2}:\\d{2}:\\d{2}",Cte="(([+-]\\d{2}(:?\\d{2})?)|Z)",wte=new RegExp(`${xte}T${Ste}(\\.\\d+)?${Cte}$`),Tte=t=>qs(t)||t===t.trim(),Ete={}.toString();function w1(){return new i_}class i_ extends No{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===Ete?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=dr.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=dr.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=dr.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||dr.matches,params:{regex:e},skipAbsent:!0,test:s=>s===""&&r||s.search(e)!==-1})}email(e=dr.email){return this.matches(yte,{name:"email",message:e,excludeEmptyString:!0})}url(e=dr.url){return this.matches(bte,{name:"url",message:e,excludeEmptyString:!0})}uuid(e=dr.uuid){return this.matches(vte,{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(wte,{name:"datetime",message:n||dr.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:n||dr.datetime_offset,params:{allowOffset:r},skipAbsent:!0,test:i=>{if(!i||r)return!0;const s=C1(i);return s?!!s.z:!1}}).test({name:"datetime_precision",message:n||dr.datetime_precision,params:{precision:o},skipAbsent:!0,test:i=>{if(!i||o==null)return!0;const s=C1(i);return s?s.precision===o:!1}})}ensure(){return this.default("").transform(e=>e===null?"":e)}trim(e=dr.trim){return this.transform(n=>n!=null?n.trim():n).test({message:e,name:"trim",test:Tte})}lowercase(e=dr.lowercase){return this.transform(n=>qs(n)?n:n.toLowerCase()).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>qs(n)||n===n.toLowerCase()})}uppercase(e=dr.uppercase){return this.transform(n=>qs(n)?n:n.toUpperCase()).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>qs(n)||n===n.toUpperCase()})}}w1.prototype=i_.prototype;let Mte=new Date(""),kte=t=>Object.prototype.toString.call(t)==="[object Date]";class Mp extends No{constructor(){super({type:"date",check(e){return kte(e)&&!isNaN(e.getTime())}}),this.withMutation(()=>{this.transform((e,n,r)=>!r.spec.coerce||r.isType(e)||e===null?e:(e=gte(e),isNaN(e)?Mp.INVALID_DATE:new Date(e)))})}prepareParam(e,n){let r;if(Ws.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=x1.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=x1.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)}})}}Mp.INVALID_DATE=Mte,Mp.prototype;function Ote(t,e=[]){let n=[],r=new Set,o=new Set(e.map(([s,a])=>`${s}-${a}`));function i(s,a){let l=js.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),Ws.isRef(a)&&a.isSibling?i(a.path,s):S1(a)&&"deps"in a&&a.deps.forEach(l=>i(l,s))}return ote.array(Array.from(r),n).reverse()}function s_(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 a_(t){return(e,n)=>s_(t,e)-s_(t,n)}const Ate=(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 kp(t){if("fields"in t){const e={};for(const[n,r]of Object.entries(t.fields))e[n]=kp(r);return t.setFields(e)}if(t.type==="array"){const e=t.optional();return e.innerType&&(e.innerType=kp(e.innerType)),e}return t.type==="tuple"?t.optional().clone({types:t.spec.types.map(kp)}):"optional"in t?t.optional():t}const Ite=(t,e)=>{const n=[...js.normalizePath(e)];if(n.length===1)return n[0]in t;let r=n.pop(),o=js.getter(js.join(n),!0)(t);return!!(o&&r in o)};let l_=t=>Object.prototype.toString.call(t)==="[object Object]";function c_(t,e){let n=Object.keys(t.fields);return Object.keys(e).filter(r=>n.indexOf(r)===-1)}const Dte=a_([]);function u_(t){return new d_(t)}class d_ extends No{constructor(e){super({type:"object",check(n){return l_(n)||typeof n=="function"}}),this.fields=Object.create(null),this._sortErrors=Dte,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],g=p in o;if(m){let b,y=o[p];u.path=(n.path?`${n.path}.`:"")+p,m=m.resolve({value:y,context:n.context,parent:l});let S=m instanceof No?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 g&&!s&&(l[p]=o[p]);(g!==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||!l_(u)){o(l,u);return}s=s||u;let f=[];for(let p of this._nodes){let m=this.fields[p];!m||Ws.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=Ote(e,n),r._sortErrors=a_(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 kp(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=js.getter(e,!0);return this.transform(i=>{if(!i)return i;let s=i;return Ite(i,e)&&(s=Object.assign({},i),r||delete s[e],s[n]=o(i)),s})}json(){return this.transform(Ate)}exact(e){return this.test({name:"exact",exclusive:!0,message:e||Cp.exact,test(n){if(n==null)return!0;const r=c_(this.schema,n);return r.length===0||this.createError({params:{properties:r.join(", ")}})}})}stripUnknown(){return this.clone({noUnknown:!0})}noUnknown(e=!0,n=Cp.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=c_(this.schema,o);return!e||i.length===0||this.createError({params:{unknown:i.join(", ")}})}});return r.spec.noUnknown=e,r}unknown(e=!0,n=Cp.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(v1.camelCase)}snakeCase(){return this.transformKeys(v1.snakeCase)}constantCase(){return this.transformKeys(e=>v1.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}}u_.prototype=d_.prototype;const Pte=t=>{const{id:e,onSave:n,onCancel:r,getCitationById:o,disableFileUpload:i=!1,setError:s}=t,a=J.useRef(null),[l,u]=J.useState(!0),[f,p]=J.useState({title:"",file:void 0,fileName:""});return J.useEffect(()=>{if(e===void 0){u(!1);return}o(e).then(m=>{p({...m,file:void 0}),u(!1)}).catch(m=>{u(!1),s({title:"Failed to retrieve attachment",err:m})})},[]),v.jsx(Ht.Formik,{innerRef:a,enableReinitialize:!0,initialValues:f,validationSchema:u_().shape({title:w1().required("Title is required"),fileName:w1().required("A file is required")}),onSubmit:async m=>{u(!0),n(m).catch(g=>{u(!1),s({title:`Failed to ${e===void 0?"save":"update"} attachment`,err:g})}).finally(()=>u(!1))},children:({values:m,setFieldValue:g})=>{var b;return J.useEffect(()=>{var y,S;(y=m.file)!=null&&y.name&&g("fileName",(S=m.file)==null?void 0:S.name)},[(b=m.file)==null?void 0:b.name]),v.jsxs(Ht.Form,{autoComplete:"off",children:[v.jsx(ca,{name:"title",disabled:l,required:!0,margin:"none"}),v.jsxs(F.Box,{display:"flex",flexDirection:"row",alignItems:"flex-start",children:[v.jsx(fC,{name:"file",readOnly:i}),m.fileName&&v.jsx("span",{style:{margin:"6px 0 0 10px"},children:m.fileName}),v.jsx(Jn,{name:"fileName",id:"fileName-err"})]}),v.jsxs(F.DialogActions,{sx:{px:0},children:[v.jsx(F.Button,{onClick:r,variant:"outlined",size:"small",children:"Cancel"}),v.jsx(g1,{size:"small",loading:l,children:e?"Update Attachment":"Add New Attachment"})]})]})}})};function _te(t){return Ue("MuiAlert",t)}const f_=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"]),Nte=Be(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"),Lte=Be(v.jsx("path",{d:"M12 5.99L19.53 19H4.47L12 5.99M12 2L1 21h22L12 2zm1 14h-2v2h2v-2zm0-6h-2v4h2v-4z"}),"ReportProblemOutlined"),$te=Be(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"),Fte=Be(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"),Rte=Be(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"),Bte=t=>{const{variant:e,color:n,severity:r,classes:o}=t,i={root:["root",`color${Ae(n||r)}`,`${e}${Ae(n||r)}`,`${e}`],icon:["icon"],message:["message"],action:["action"]};return qe(i,_te,o)},Vte=ye(ma,{name:"MuiAlert",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,e[n.variant],e[`${n.variant}${Ae(n.color||n.severity)}`]]}})(Dt(({theme:t})=>{const e=t.palette.mode==="light"?ra:kl,n=t.palette.mode==="light"?kl:ra;return{...t.typography.body2,backgroundColor:"transparent",display:"flex",padding:"6px 16px",variants:[...Object.entries(t.palette).filter(Vn(["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),[`& .${f_.icon}`]:t.vars?{color:t.vars.palette.Alert[`${r}IconColor`]}:{color:t.palette[r].main}}})),...Object.entries(t.palette).filter(Vn(["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}`,[`& .${f_.icon}`]:t.vars?{color:t.vars.palette.Alert[`${r}IconColor`]}:{color:t.palette[r].main}}})),...Object.entries(t.palette).filter(Vn(["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)}}}))]}})),zte=ye("div",{name:"MuiAlert",slot:"Icon",overridesResolver:(t,e)=>e.icon})({marginRight:12,padding:"7px 0",display:"flex",fontSize:22,opacity:.9}),Hte=ye("div",{name:"MuiAlert",slot:"Message",overridesResolver:(t,e)=>e.message})({padding:"8px 0",minWidth:0,overflow:"auto"}),jte=ye("div",{name:"MuiAlert",slot:"Action",overridesResolver:(t,e)=>e.action})({display:"flex",alignItems:"flex-start",padding:"4px 0 0 16px",marginLeft:"auto",marginRight:-8}),p_={success:v.jsx(Nte,{fontSize:"inherit"}),warning:v.jsx(Lte,{fontSize:"inherit"}),error:v.jsx($te,{fontSize:"inherit"}),info:v.jsx(Fte,{fontSize:"inherit"})},h_=P.forwardRef(function(e,n){const r=xt({props:e,name:"MuiAlert"}),{action:o,children:i,className:s,closeText:a="Close",color:l,components:u={},componentsProps:f={},icon:p,iconMapping:m=p_,onClose:g,role:b="alert",severity:y="success",slotProps:S={},slots:C={},variant:E="standard",...T}=r,w={...r,color:l,severity:y,variant:E,colorSeverity:l||y},k=Bte(w),A={slots:{closeButton:u.CloseButton,closeIcon:u.CloseIcon,...C},slotProps:{...f,...S}},[_,D]=Bt("root",{ref:n,shouldForwardComponentProp:!0,className:Ne(k.root,s),elementType:Vte,externalForwardedProps:{...A,...T},ownerState:w,additionalProps:{role:b,elevation:0}}),[$,O]=Bt("icon",{className:k.icon,elementType:zte,externalForwardedProps:A,ownerState:w}),[I,L]=Bt("message",{className:k.message,elementType:Hte,externalForwardedProps:A,ownerState:w}),[B,z]=Bt("action",{className:k.action,elementType:jte,externalForwardedProps:A,ownerState:w}),[R,V]=Bt("closeButton",{elementType:va,externalForwardedProps:A,ownerState:w}),[U,K]=Bt("closeIcon",{elementType:Rte,externalForwardedProps:A,ownerState:w});return v.jsxs(_,{...D,children:[p!==!1?v.jsx($,{...O,children:p||m[y]||p_[y]}):null,v.jsx(I,{...L,children:i}),o!=null?v.jsx(B,{...z,children:o}):null,o==null&&g?v.jsx(B,{...z,children:v.jsx(R,{size:"small","aria-label":a,title:a,color:"inherit",onClick:g,...V,children:v.jsx(U,{fontSize:"small",...K})})}):null]})});process.env.NODE_ENV!=="production"&&(h_.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 nu=t=>{var g;const{noIcon:e=!1,children:n,severity:r="success",variant:o="leftBorder",sx:i,title:s,...a}=t,{palette:l}=F.useTheme(),u=e?{icon:!1}:{},f=o==="leftBorder"?"standard":o,p=o==="leftBorder"?{...i,borderLeft:`4px solid ${(g=l[r])==null?void 0:g.main}`}:i,m=s?{icon:{sx:{mt:"6px"}}}:{};return v.jsxs(h_,{severity:r,variant:f,sx:p,slotProps:m,...u,...a,children:[s&&v.jsx(F.Typography,{variant:"h3",children:s}),n]})},m_=t=>v.jsx(nu,{severity:"error",...t});function g_({fetchExistingCitations:t,onCreateCitation:e,onUpdateCitation:n,onDeleteCitation:r,getCitationById:o,onStoreAttachment:i,onSelectCitations:s,onCancel:a,initialSelectedIds:l=[],onContentUpdate:u,onError:f=()=>{}}){const[p,m]=J.useState("Insert Citation/Attachment(s)"),[g,b]=J.useState(l),[y,S]=J.useState(void 0),[C,E]=J.useState(void 0);J.useEffect(()=>u==null?void 0:u(),[p,g,C]),J.useEffect(()=>E(void 0),[p]),J.useEffect(()=>{C&&f(C.err)},[C]);const T=async A=>{if(p==="Edit Citation"){if(A.id===void 0)throw Error("Failed to update citation. Citation is missing id");await n(A).then(()=>m("Insert Citation/Attachment(s)")).catch(_=>E({title:"Failed to update citation",err:_}))}else p==="Add Citation"&&await e(A).then(_=>{b([...g,_.id]),m("Insert Citation/Attachment(s)")}).catch(_=>E({title:"Failed to create citation",err:_}))},w=async A=>{if(p==="Edit Attachment"){if(A.id===void 0)throw Error("Failed to update citation. Citation is missing id");await n(A).then(()=>m("Insert Citation/Attachment(s)")).catch(_=>E({title:"Failed to update attachment",err:_}))}else p==="Add Attachment"&&await i(A).then(_=>{b([...g,_.id]),m("Insert Citation/Attachment(s)")}).catch(_=>E({title:"Failed to upload attachment",err:_}))};let k=null;return p==="Insert Citation/Attachment(s)"?k=v.jsx(Xee,{fetchExistingCitations:t,onCancel:a,onNewCitation:()=>{S(void 0),m("Add Citation")},onNewAttachment:()=>{S(void 0),m("Add Attachment")},onEditCitation:A=>{S(A.id),m("Edit Citation")},onEditAttachment:A=>{S(A.id),m("Edit Attachment")},onDeleteCitation:r,onSelect:s,setSelectedIds:b,selectedIds:g,onError:f,setError:E}):p==="Add Citation"||p==="Edit Citation"?k=v.jsx(Qee,{id:y,onSave:T,onCancel:()=>m("Insert Citation/Attachment(s)"),getCitationById:o,setError:E}):(p==="Add Attachment"||p==="Edit Attachment")&&(k=v.jsx(Pte,{id:y,onSave:w,onCancel:()=>m("Insert Citation/Attachment(s)"),getCitationById:o,disableFileUpload:p==="Edit Attachment",setError:E})),v.jsxs(F.Box,{width:"500px",children:[v.jsx(F.Typography,{variant:"h6",children:p}),C&&v.jsx(m_,{"data-testid":"citation-menu-error",onClose:()=>E(void 0),children:C.title}),v.jsx(F.Box,{paddingTop:"8px",children:k})]})}const Wte=qt({name:{CitationBubbleMenuTipTap:y_}})(t=>({content:{padding:t.spacing(1.5,2,.5),backgroundColor:"#f9f9f9"}}));function y_({fetchExistingCitations:t,onCreateCitation:e,onUpdateCitation:n,onDeleteCitation:r,getCitationById:o,onStoreAttachment:i,...s}){const{classes:a}=Wte(),l=yt();if(!(l!=null&&l.isEditable))return null;if(!("citationBubbleMenuHandler"in l.storage))throw new Error("You must add the CitationBubbleMenuHandler extension to the useEditor `extensions` array in order to use this component!");const u=l.storage.citationBubbleMenuHandler,f=u.isOpen,p=u.selectedIds,m=u.selectedNodePos,g=S=>{l&&(S.length===0?l.commands.deleteCitation(m):p.length===0?l.commands.insertCitation({ids:S}):l.commands.updateCitation({ids:S},m))},b=S=>{g(S),l.commands.closeCitationBubbleMenu()},y=()=>{g(p),l.commands.closeCitationBubbleMenu()};return v.jsx(Mf,{editor:l,open:f,...u.bubbleMenuOptions,...s,children:v.jsx("div",{className:a.content,children:v.jsx(g_,{fetchExistingCitations:t,onCreateCitation:e,onUpdateCitation:n,onDeleteCitation:r,getCitationById:o,onStoreAttachment:i,onSelectCitations:b,onCancel:y,initialSelectedIds:p,onContentUpdate:()=>{requestAnimationFrame(()=>{l!=null&&l.view&&l.view.dispatch(l.view.state.tr)})}})})})}const qte=on.create({name:"starterKit",addExtensions(){const t=[];return this.options.bold!==!1&&t.push(QD.configure(this.options.bold)),this.options.blockquote!==!1&&t.push(XD.configure(this.options.blockquote)),this.options.bulletList!==!1&&t.push(nP.configure(this.options.bulletList)),this.options.code!==!1&&t.push(rP.configure(this.options.code)),this.options.codeBlock!==!1&&t.push(oP.configure(this.options.codeBlock)),this.options.document!==!1&&t.push(iP.configure(this.options.document)),this.options.dropcursor!==!1&&t.push(sP.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&t.push(aP.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&t.push(lP.configure(this.options.hardBreak)),this.options.heading!==!1&&t.push(TD.configure(this.options.heading)),this.options.history!==!1&&t.push(mP.configure(this.options.history)),this.options.horizontalRule!==!1&&t.push(gP.configure(this.options.horizontalRule)),this.options.italic!==!1&&t.push(yP.configure(this.options.italic)),this.options.listItem!==!1&&t.push(NP.configure(this.options.listItem)),this.options.orderedList!==!1&&t.push(FP.configure(this.options.orderedList)),this.options.paragraph!==!1&&t.push(RP.configure(this.options.paragraph)),this.options.strike!==!1&&t.push(VP.configure(this.options.strike)),this.options.text!==!1&&t.push(zP.configure(this.options.text)),t}}),Ute=()=>on.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 Kte(t){const e=yt(),n=J.useRef(null);return v.jsx(ht,{buttonRef:n,tooltipLabel:"Insert Citation",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(F.Box,{display:"flex",flexDirection:"row",gap:"4px",alignItems:"center",children:[v.jsx(OB,{fontSize:"small"}),v.jsx(F.Typography,{variant:"body2",children:"Insert Citation"})]})})}const b_=J.createContext(void 0),v_=()=>{const t=J.useContext(b_);if(!t)throw new Error("useSync must be used inside CitationFieldProvider");return t},Yte=({node:t,HTMLAttributes:e,selected:n,extension:r})=>{const o=t.attrs.ids||[],{citations:i}=v_(),[s,a]=J.useState(String(o)),[l,u]=J.useState([]),f=r.options.citationMaxLength;if(J.useEffect(()=>{const p=i.filter(g=>o.includes(g.id)),m=p.map(g=>Wu.truncate(g.title,{length:f,omission:"..."})).join(", ");a(m),u(p)},[i,o]),l.length!==0)return v.jsx(m0,{as:"span",...e,children:v.jsx(F.Tooltip,{title:v.jsx(F.Box,{className:"citation-tooltip",children:l.map((p,m)=>{var b;const g=[p.source,p.title,p.fileName,p.url,(b=p.accessedAt)==null?void 0:b.slice(0,10),p.classification];return v.jsxs(F.Typography,{variant:"subtitle2",children:[g.filter(Boolean).join(" | "),m<l.length-1&&v.jsx(F.Divider,{className:"citation-tooltip-divider"})]},p.id)})}),slotProps:{tooltip:{sx:{maxWidth:500}}},children:v.jsx("a",{href:"#",onClick:p=>{p.preventDefault(),p.stopPropagation()},className:n?"selected-citation-link":"citation-link",children:s})})})},Gte=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",gt(t)]},addNodeView(){return g0(Yte)},addProseMirrorPlugins(){return[new Qt({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}}}}),Jte=t=>{const{name:e,label:n=Cn(e),hideLabel:r=!1,required:o=!1,readOnly:i=!1,margin:s="dense",citationMaxLength:a=24,fetchExistingCitations:l,onCreateCitation:u,onUpdateCitation:f,onDeleteCitation:p,getCitationById:m,onStoreAttachment:g,onError:b=()=>{}}=t,y=[qte,BP.configure({placeholder:"Start typing here..."}),Ute(),Gte.configure({citationMaxLength:a})],[S,C,E]=Ht.useField({name:e}),{setValue:T}=E,{value:w}=S,{resync:k,addUpdateCitation:A,deleteCitation:_}=v_();J.useEffect(()=>{var L,B;w!==((B=(L=D==null?void 0:D.current)==null?void 0:L.editor)==null?void 0:B.getHTML())&&setTimeout(()=>{var z,R,V;(V=(R=(z=D==null?void 0:D.current)==null?void 0:z.editor)==null?void 0:R.commands)==null||V.setContent(w),k()},0)},[w]),J.useEffect(()=>{w&&setTimeout(()=>{var L,B,z;(z=(B=(L=D==null?void 0:D.current)==null?void 0:L.editor)==null?void 0:B.commands)==null||z.setContent(w),k()},0)},[]);const D=J.useRef(null),$={normal:{marginTop:"16px",marginBottom:"8px"},dense:{marginTop:"8px",marginBottom:"4px"},none:{margin:0}},O=()=>{var z,R;const L=((R=(z=D.current)==null?void 0:z.editor)==null?void 0:R.getHTML())??"<p></p>",B=!L.replace(/<\/?p>|<br>/g,"").trim();T(B?"<p></p>":L)},I=v.jsxs(F.Box,{id:`citation-field_${e}`,sx:{"& .ProseMirror":{"& h1, & h2, & h3, & h4, & h5, & h6":{scrollMarginTop:i?0:50}}},...$[s],children:[v.jsx(tD,{ref:D,extensions:y,content:w,editable:!i,renderControls:i?void 0:()=>v.jsx(If,{children:v.jsx(Kte,{})}),onBlur:O,RichTextFieldProps:{variant:"outlined",MenuBarProps:{hide:i}},children:()=>v.jsx(y_,{fetchExistingCitations:l,onCreateCitation:L=>u(L).then(B=>(A(B),B)),onUpdateCitation:L=>f(L).then(B=>(A(B),B)),onDeleteCitation:L=>p(L).then(()=>_(L)),getCitationById:m,onStoreAttachment:g,onError:b})}),v.jsx(Jn,{name:e,id:`${e}-err`})]});return v.jsxs(F.Box,{display:"flex",flexDirection:"column",width:"100%",children:[!r&&v.jsx(F.InputLabel,{htmlFor:`citation-field_${e}`,required:o,children:n}),I]})},Zte=t=>{const{name:e="submit"}=t;return v.jsx(Po,{name:e,type:"submit",...t})},Xte=t=>{const{label:e="Return to Top",icon:n=LC,scrollThresholdPx:r=100}=t,o=F.useScrollTrigger({threshold:r}),i=J.useCallback(()=>{window.scrollTo({top:0,behavior:"smooth"})},[]);return v.jsx(F.Zoom,{in:o,children:v.jsx(F.Box,{sx:{position:"fixed",bottom:32,right:32,zIndex:1},children:v.jsxs(F.Fab,{onClick:i,color:"primary",size:"small",variant:"extended","aria-label":"Scroll back to top",children:[v.jsx(n,{fontSize:"medium"}),e]})})})},Qte=()=>{const{values:t,errors:e,status:n}=Ht.useFormikContext(),{palette:r}=F.useTheme();return v.jsx(F.Paper,{style:{backgroundColor:r.mode==="dark"?"#303030":"#f0f0f0",margin:"10px 0"},children:v.jsxs(F.List,{children:[v.jsxs(F.ListItem,{children:[v.jsx(F.Typography,{display:"block",variant:"h6",children:"Values"}),v.jsx("br",{}),v.jsx(F.Divider,{variant:"inset"}),v.jsx("pre",{children:JSON.stringify(t,null,2)})]}),v.jsx(F.Divider,{variant:"inset",component:"li"}),v.jsxs(F.ListItem,{id:"testing",children:[v.jsx(F.Typography,{display:"block",variant:"h6",children:"Errors"}),v.jsx("br",{}),v.jsx(F.Divider,{variant:"inset"}),v.jsx("pre",{children:JSON.stringify(e,null,2)})]}),v.jsxs(F.ListItem,{children:[v.jsx(F.Typography,{display:"block",variant:"h6",children:"Status"}),v.jsx("br",{}),v.jsx(F.Divider,{variant:"inset"}),v.jsx("pre",{children:JSON.stringify(n,null,2)})]})]})})},ene=t=>{const{steps:e,orientation:n,inlineLabel:r=n=="vertical",isResponsive:o=!1}=t,{width:i}=GP();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,...Yn({...t},l)};return v.jsx(F.Stepper,{...u,children:e.map(f=>v.jsx(F.Step,{children:v.jsx(F.StepLabel,{children:f})},f))})},tne=t=>{const{name:e,label:n=Cn(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(s5,{}):"Remove",variant:l="card",addButtonSx:u,removeButtonSx:f,allowRemoveAll:p=!1,readOnly:m=!1,emptyListMsg:g="None",showDivider:b=!1,removePosition:y="bottom"}=t,[S]=Ht.useField({name:e}),{value:C}=S,E=T=>({display:"flex",flexDirection:T==="bottom"?"column":"row",alignItems:T==="bottom"?"flex-start":"center"});return v.jsxs(F.FormControl,{fullWidth:!0,children:[v.jsx(F.Typography,{...r,children:n}),m&&S.value.length===0?v.jsx(F.Typography,{children:g}):v.jsx(Ht.FieldArray,{name:e,render:T=>v.jsxs("div",{children:[C.map((w,k)=>v.jsx(J.Fragment,{children:v.jsx(nne,{variant:l,content:v.jsxs(F.Box,{"data-testid":"form-group-container",sx:typeof y=="string"?E(y):{...y},children:[v.jsxs(F.Box,{width:"100%",children:[i(`${e}.${k}`,k),b&&k!==C.length-1&&v.jsx(F.Divider,{"data-testid":"divider"})]}),!m&&C.length>(p?0:1)&&v.jsx(F.Button,{"data-testid":"repeatable-form-group_remove-btn",sx:f,onClick:()=>T.remove(k),children:a})]})})},`${e}-${k}`)),!m&&v.jsx(F.Button,{"data-testid":"repeatable-form-group_add-btn",onClick:()=>T.push(o),sx:u,children:s})]})})]})},nne=({variant:t,content:e})=>{switch(t){case"card":return v.jsx(F.Card,{"data-testid":"repeatable-form-group_card",sx:{padding:"8px",marginBottom:"8px"},children:v.jsx(F.CardContent,{children:e})});case"elevatedCard":return v.jsx(F.Card,{"data-testid":"repeatable-form-group_elevated-card",elevation:4,sx:{border:"unset",padding:"8px",marginBottom:"8px"},children:v.jsx(F.CardContent,{children:e})});case"none":return e}},Op=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",g=()=>{if(s&&p)return v.jsx(F.Button,{className:"MBv2_Modal_Close",onClick:t.onClose,...l,children:s})},b=()=>{if(i)return v.jsx(F.DialogActions,{className:"MBv2_Modal_Actions",children:v.jsxs(F.Box,{display:"flex",flexDirection:"row",justifyContent:"space-between",width:"100%",gap:"0.25rem",children:[v.jsx(F.Box,{children:g()}),v.jsxs(F.Box,{display:"flex",gap:".25rem",children:[...i]})]})});if(s&&p)return v.jsx(F.DialogActions,{className:"MBv2_Modal_Actions",children:v.jsx(F.Box,{children:g()})})};return v.jsxs(F.Dialog,{className:"MBv2_Modal",open:e,onClose:()=>{u||n==null||n()},...f,children:[typeof r=="string"?v.jsx(F.DialogTitle,{className:"MBv2_Modal_Title",children:v.jsxs(F.Box,{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",children:[r,m&&v.jsx(F.IconButton,{"data-testid":"modal-header-close-btn",onClick:n,children:v.jsx(DB,{})})]})}):r,o&&(typeof o=="string"?v.jsx(F.DialogContent,{className:"MBv2_Modal_Content",children:v.jsx(F.DialogContentText,{className:"MBv2_Modal_Content_Text",children:o})}):o),b()]})},rne=t=>{const{confirmBtnLabel:e,onConfirm:n,confirmButtonProps:r={color:"primary",variant:"contained"},closeBtnLabel:o="Cancel",closeButtonPosition:i="bottom",...s}=t;return v.jsx(Op,{actions:[v.jsx(F.Button,{className:"MBv2_ConfirmationModal_ConfirmBtn",onClick:n,...r,children:e})],closeBtnLabel:o,closeButtonPosition:i,...s})},one=t=>{const{closeBtnLabel:e="OK",closeButtonPosition:n="bottom",closeButtonProps:r={color:"primary",variant:"contained"},...o}=t;return v.jsx(Op,{closeBtnLabel:e,closeButtonPosition:n,closeButtonProps:r,...o})},ine=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(Op,{actions:[v.jsx(F.Button,{className:"MBv2_DecisionModal_SecondaryAction",onClick:i,...s,children:o}),v.jsx(F.Button,{className:"MBv2_DecisionModal_PrimaryAction",onClick:n,...r,children:e})],closeBtnLabel:a,closeButtonPosition:l,...u})},sne=t=>{const{featureMenuOptions:e=[],copyright:n,logo:r,sx:o={},fontColor:i="primary"}=t,{palette:s}=F.useTheme(),a=Xr.useNavigate();return v.jsxs(F.Box,{className:"MBv2_Footer",sx:{backgroundColor:s.mode==="dark"?"#222222":"#ededed",padding:"25px 30px",...o},children:[v.jsx(F.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(F.Box,{display:"flex",justifyContent:"space-between",flexWrap:"wrap",className:"MBv2_Footer_Nav_Links_Container",gap:2,children:[v.jsx(F.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(F.Link,{"data-testid":l.label,sx:{cursor:"pointer",fontSize:15},color:i,...yl(l,a),children:l.label},l.label))}),n&&v.jsx(F.Typography,{style:{fontSize:15},"data-testid":"copyright",className:"MBv2_Footer_Copyright",color:i,children:n})]})]})},x_=t=>{const{menuOptionLists:e,anchor:n="left",children:r}=t,{pathname:o}=Xr.useLocation(),i=Xr.useNavigate(),[s,a]=J.useState(!1),l=(m,g)=>v.jsx(F.MenuList,{children:m.map(b=>v.jsxs(F.MenuItem,{...yl(b,i,()=>a(!1)),children:[b.icon&&v.jsx(F.ListItemIcon,{children:b.icon}),v.jsx(F.ListItemText,{primary:b.label})]},`mobile-drawer-group-${g}-item-${b.path}`))}),f=(()=>{if(e){const m=e.filter(g=>g&&g.length>0);return m.length===0?null:m.map((g,b)=>v.jsxs(J.Fragment,{children:[l(g,b),b<m.length-1&&v.jsx(F.Divider,{})]},`mobile-drawer-group-${b}`))}return r?v.jsx(F.Box,{role:"presentation",onClick:()=>a(!1),children:r}):null})(),p=f??!1;return J.useEffect(()=>{a(!1)},[o]),p&&v.jsxs(v.Fragment,{children:[v.jsx(F.IconButton,{onClick:()=>a(!0),color:"inherit",title:"Menu",children:v.jsx(t5,{})}),v.jsx(F.Drawer,{"data-testid":"mobile-drawer",anchor:n,open:s,onClose:()=>a(!1),children:v.jsx(F.Box,{sx:{width:300},display:"flex",flexDirection:"column",justifyContent:"space-between",children:v.jsx(F.Box,{display:"flex",justifyContent:"start",flexDirection:"column",children:f})})})]})},S_=t=>{const{env:e,isProd:n}=t;return n?null:v.jsx(F.Paper,{sx:{borderRadius:0,display:"flex",alignItems:"center",justifyContent:"center"},children:v.jsxs(F.Typography,{variant:"h6",color:"error",children:[e," Environment - Test Data Only"]})})},C_=t=>{const{label:e,menuOptions:n=[],icon:r}=t,o=Xr.useNavigate(),[i,s]=P.useState(null),a=!!i,l=f=>{s(f.currentTarget)},u=()=>{s(null)};return n.length===0?null:v.jsxs(v.Fragment,{children:[v.jsx(F.Button,{startIcon:r,variant:"outlined",color:"inherit",sx:{minWidth:0,padding:1},onClick:l,children:e}),v.jsx(F.Menu,{anchorEl:i,open:a,onClick:u,children:n.map(f=>v.jsxs(F.MenuItem,{...yl(f,o),children:[f.icon&&v.jsx(F.ListItemIcon,{children:f.icon}),v.jsx(F.ListItemText,{primary:f.label})]},f.label))})]})},w_=t=>{const{displayName:e,userMenuOptions:n}=t;return v.jsx(C_,{label:e,menuOptions:n,icon:v.jsx(r5,{})})},Ap=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}=F.useTheme(),a=Xr.useNavigate();return v.jsx(F.Tabs,{orientation:n,value:r??!1,sx:o,slotProps:i,children:e.map((l,u)=>v.jsx(F.Tab,{icon:l.icon,label:l.label,value:u,...yl(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))})},T_=t=>{const{featureMenuOptions:e=[],activeTabIdx:n,sx:r}=t;return e.length>0&&v.jsx(F.Paper,{sx:{pl:4,pr:4,borderRadius:0},"data-testid":"navBar",children:v.jsx(Ap,{menuOptions:e,activeTabIdx:n,sx:r})})},E_=t=>{const{onToggle:e}=t,{palette:n}=F.useTheme(),r=n.mode==="dark";return v.jsx(F.IconButton,{onClick:e,color:"inherit",title:"Dark Mode Toggle",children:r?v.jsx($C,{}):v.jsx(NC,{})})},ane=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:g}=t,b=Xr.useNavigate(),y=F.useMediaQuery(F.useTheme().breakpoints.down("sm")),{palette:S}=F.useTheme(),{pathname:C}=Xr.useLocation(),E=S.mode==="dark",[T,w]=P.useState(void 0);P.useEffect(()=>{const _=o.findIndex(D=>D.path&&C.startsWith(D.path));w(_>=0?_:void 0)},[C,o]);const k=s&&v.jsx(E_,{onToggle:s}),A=s&&(y||!y&&l)?[{icon:E?v.jsx($C,{}):v.jsx(NC,{}),label:`Switch to ${E?"Light":"Dark"} mode`,onClick:s},...i]:i;return v.jsxs(F.AppBar,{ref:n,position:f,sx:m,elevation:4,children:[e&&v.jsx(S_,{...e}),u,v.jsxs(F.Toolbar,{sx:{color:"white",display:"flex",justifyContent:"space-between",gap:2},children:[v.jsx(F.Button,{disableRipple:!0,component:Xr.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(F.Box,{display:"flex",gap:2,alignItems:"center",children:[!l&&!y&&k,y&&v.jsx(x_,{menuOptionLists:[o,a,A],anchor:"right"}),!y&&v.jsxs(v.Fragment,{children:[v.jsx(F.Box,{display:"flex",gap:0,children:a==null?void 0:a.map((_,D)=>v.jsxs(F.Box,{display:"flex",alignItems:"center",children:[D>0&&v.jsx(F.Typography,{className:"quickLink-divider",color:S.primary.contrastText,children:"|"}),v.jsx(F.Button,{variant:"text",sx:{color:"white"},...yl(_,b),children:v.jsxs(F.Box,{display:"flex",gap:"3px",alignItems:"center",children:[_.icon,_.label]})})]},_.label))}),p,l&&v.jsx(w_,{displayName:l,userMenuOptions:A})]})]})]}),!y&&v.jsx(T_,{featureMenuOptions:o,activeTabIdx:T,sx:g})]})},lne=t=>{const{sx:e,menuOptions:n=[]}=t,{pathname:r}=Xr.useLocation(),o=F.useMediaQuery(F.useTheme().breakpoints.down("sm")),[i,s]=J.useState(void 0);return J.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(F.Box,{sx:e,children:v.jsx(F.Card,{sx:{height:"100%",width:200},children:v.jsx(Ap,{orientation:"vertical",menuOptions:n,activeTabIdx:i})})})},cne=t=>{const{featureMenuOptions:e=[],activeTabIdx:n,sx:r}=t,{palette:o}=F.useTheme();return e.length>0&&v.jsx(Ap,{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}})},une=t=>v.jsx(nu,{severity:"success",...t}),dne=t=>v.jsx(nu,{severity:"info",...t}),fne=t=>v.jsx(nu,{severity:"warning",...t}),M_=t=>{const{crumbInfo:e}=t,n=Xr.useNavigate();return v.jsx(F.Breadcrumbs,{"aria-label":"breadcrumb",separator:v.jsx(n5,{color:"primary"}),sx:{marginBottom:2},children:e.map(({label:r,path:o},i)=>o&&i<e.length-1?v.jsx(F.Link,{color:"primary",sx:{cursor:"pointer"},onClick:()=>n(o),children:r},r):v.jsx(F.Typography,{color:"primary",children:r},r))})},pne=t=>{const{title:e,message:n,type:r,onClose:o,autoHideDuration:i=8e3,variant:s="leftBorder",elevation:a=6}=t,l=hne(r);return v.jsx(F.Snackbar,{"data-testid":"message-snackbar",anchorOrigin:{vertical:"bottom",horizontal:"right"},open:!0,onClose:u=>{u==null&&o()},autoHideDuration:i,children:v.jsx(nu,{"data-testid":"message-snackbar-alert",severity:l,iconMapping:{info:k_(r),warning:k_(r)},onClose:o,elevation:a,variant:s,children:n?v.jsxs(v.Fragment,{children:[v.jsx(F.AlertTitle,{"data-testid":"alertTitle",sx:{fontWeight:"bold"},children:e}),n]}):e})})},hne=t=>t=="logout"?"info":t=="timeout"?"warning":t,k_=t=>{if(t=="timeout")return v.jsx(TB,{});if(t=="logout")return v.jsx(e5,{})},mne=t=>{const{title:e,createButtonLabel:n,showAddButton:r=!1,onAdd:o=()=>alert("Not implemented yet"),breadcrumbs:i=[],children:s,sx:a}=t,l=F.useMediaQuery(F.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(F.Box,{sx:a,children:[i.length>0&&v.jsx(M_,{crumbInfo:i}),v.jsxs(F.Box,{className:"MBv2_PageHeader_Header",display:"flex",flexDirection:l?"column":"row",justifyContent:"space-between",alignItems:"center",gap:1,children:[v.jsxs(F.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(F.Typography,{className:"MBv2_PageHeader_Title",variant:"h2",children:e}):e,r&&v.jsxs(Po,{className:"MBv2_PageHeader_CreateBtn",onClick:()=>o(),children:[v.jsx(EB,{style:{marginRight:"0.5rem"}}),n]})]}),s&&v.jsx(F.Box,{width:l?"100%":"50%",children:s})]})]})},gne=t=>{const{title:e,titleIcon:n,fullWidthIcon:r=!1,children:o,actionLabel:i,action:s,sx:a}=t,l=F.useMediaQuery(F.useTheme().breakpoints.down("sm"));return v.jsxs(F.Card,{sx:a||{padding:"30px 40px",display:"flex",flexDirection:"column",gap:"1rem"},children:[n&&v.jsx(F.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(F.Typography,{variant:"h1",display:"inline",fontSize:"calc(20px + .9vw)",className:"MBv2_SingleActionCard_Title",children:e}),o,v.jsx(F.Button,{variant:"contained",color:"primary",onClick:s,fullWidth:l,className:"MBv2_SingleActionCard_ActionButton",children:i})]})},yne=({children:t,fetchExistingCitations:e})=>{const[n,r]=J.useState([]),o=J.useCallback(async()=>{const a=await e();r(l=>{const u=new Set(l.map(p=>p.id));return[...l.filter(p=>!u.has(p.id)),...a]})},[e]),i=J.useCallback(a=>{const l=n.findIndex(u=>u.id===a.id);r(l!==-1?u=>{const f=[...u];return f[l]=a,f}:[...n,a])},[n]),s=J.useCallback(a=>r(n.filter(l=>l.id!==a)),[n]);return v.jsx(b_.Provider,{value:{citations:n,resync:o,addUpdateCitation:i,deleteCitation:s},children:t})};_e.AlertModal=one,_e.Autocomplete=cC,_e.Breadcrumbs=M_,_e.Button=Po,_e.Checkbox=nB,_e.CheckboxGroup=rB,_e.CitationField=Jte,_e.CitationFieldProvider=yne,_e.CitationMenu=g_,_e.ConfirmationModal=rne,_e.DarkModeToggle=E_,_e.DateField=Pd,_e.DateRangeField=Mq,_e.DecisionModal=ine,_e.Drawer=x_,_e.DynamicAutocomplete=eB,_e.EnvironmentBanner=S_,_e.Error=Jn,_e.ErrorAlert=m_,_e.FileList=iB,_e.FileUpload=fC,_e.FloatingNavBar=cne,_e.Footer=sne,_e.FormDebugger=Qte,_e.Header=ane,_e.InfoAlert=dne,_e.LoadingButton=g1,_e.LoadingIndicator=m1,_e.Location=xB,_e.MenuButton=C_,_e.Modal=Op,_e.MultiAutocomplete=tB,_e.NavBar=T_,_e.PageHeader=mne,_e.PaginatedTable=KP,_e.ProfileMenu=w_,_e.RadioGroup=_C,_e.RangeSlider=SB,_e.RepeatableFormGroup=tne,_e.RichTextField=Zee,_e.ScrollToTop=Xte,_e.SearchField=p5,_e.Select=CB,_e.Sidebar=lne,_e.SingleActionCard=gne,_e.Snackbar=pne,_e.Stepper=ene,_e.Submit=Zte,_e.SuccessAlert=une,_e.Switch=wB,_e.Table=UP,_e.Tabs=Ap,_e.TextField=ca,_e.WarningAlert=fne,Object.defineProperty(_e,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@simoncomputing/mui-bueno-v2",
3
3
  "private": false,
4
- "version": "0.16.1",
4
+ "version": "0.16.2",
5
5
  "type": "module",
6
6
  "main": "./dist/index.umd.js",
7
7
  "module": "./dist/index.es.js",