django-content-studio 1.0.0b2.post1__py3-none-any.whl → 1.0.0b2.post3__py3-none-any.whl
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.
- content_studio/static/content_studio/assets/index.js +2 -2
- {django_content_studio-1.0.0b2.post1.dist-info → django_content_studio-1.0.0b2.post3.dist-info}/METADATA +1 -1
- {django_content_studio-1.0.0b2.post1.dist-info → django_content_studio-1.0.0b2.post3.dist-info}/RECORD +5 -5
- {django_content_studio-1.0.0b2.post1.dist-info → django_content_studio-1.0.0b2.post3.dist-info}/LICENSE +0 -0
- {django_content_studio-1.0.0b2.post1.dist-info → django_content_studio-1.0.0b2.post3.dist-info}/WHEEL +0 -0
|
@@ -9,7 +9,7 @@ Error generating stack: `+m.message+`
|
|
|
9
9
|
`).replace(L5,"")}function EO(s,c){return c=CO(c),CO(s)===c}function Xt(s,c,f,m,v,S){switch(f){case"children":typeof m=="string"?c==="body"||c==="textarea"&&m===""||lc(s,m):(typeof m=="number"||typeof m=="bigint")&&c!=="body"&&lc(s,""+m);break;case"className":na(s,"class",m);break;case"tabIndex":na(s,"tabindex",m);break;case"dir":case"role":case"viewBox":case"width":case"height":na(s,f,m);break;case"style":EE(s,m,S);break;case"data":if(c!=="object"){na(s,"data",m);break}case"src":case"href":if(m===""&&(c!=="a"||f!=="href")){s.removeAttribute(f);break}if(m==null||typeof m=="function"||typeof m=="symbol"||typeof m=="boolean"){s.removeAttribute(f);break}m=$h(""+m),s.setAttribute(f,m);break;case"action":case"formAction":if(typeof m=="function"){s.setAttribute(f,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof S=="function"&&(f==="formAction"?(c!=="input"&&Xt(s,c,"name",v.name,v,null),Xt(s,c,"formEncType",v.formEncType,v,null),Xt(s,c,"formMethod",v.formMethod,v,null),Xt(s,c,"formTarget",v.formTarget,v,null)):(Xt(s,c,"encType",v.encType,v,null),Xt(s,c,"method",v.method,v,null),Xt(s,c,"target",v.target,v,null)));if(m==null||typeof m=="symbol"||typeof m=="boolean"){s.removeAttribute(f);break}m=$h(""+m),s.setAttribute(f,m);break;case"onClick":m!=null&&(s.onclick=ra);break;case"onScroll":m!=null&&Et("scroll",s);break;case"onScrollEnd":m!=null&&Et("scrollend",s);break;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(r(61));if(f=m.__html,f!=null){if(v.children!=null)throw Error(r(60));s.innerHTML=f}}break;case"multiple":s.multiple=m&&typeof m!="function"&&typeof m!="symbol";break;case"muted":s.muted=m&&typeof m!="function"&&typeof m!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(m==null||typeof m=="function"||typeof m=="boolean"||typeof m=="symbol"){s.removeAttribute("xlink:href");break}f=$h(""+m),s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",f);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":m!=null&&typeof m!="function"&&typeof m!="symbol"?s.setAttribute(f,""+m):s.removeAttribute(f);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":m&&typeof m!="function"&&typeof m!="symbol"?s.setAttribute(f,""):s.removeAttribute(f);break;case"capture":case"download":m===!0?s.setAttribute(f,""):m!==!1&&m!=null&&typeof m!="function"&&typeof m!="symbol"?s.setAttribute(f,m):s.removeAttribute(f);break;case"cols":case"rows":case"size":case"span":m!=null&&typeof m!="function"&&typeof m!="symbol"&&!isNaN(m)&&1<=m?s.setAttribute(f,m):s.removeAttribute(f);break;case"rowSpan":case"start":m==null||typeof m=="function"||typeof m=="symbol"||isNaN(m)?s.removeAttribute(f):s.setAttribute(f,m);break;case"popover":Et("beforetoggle",s),Et("toggle",s),vn(s,"popover",m);break;case"xlinkActuate":Ni(s,"http://www.w3.org/1999/xlink","xlink:actuate",m);break;case"xlinkArcrole":Ni(s,"http://www.w3.org/1999/xlink","xlink:arcrole",m);break;case"xlinkRole":Ni(s,"http://www.w3.org/1999/xlink","xlink:role",m);break;case"xlinkShow":Ni(s,"http://www.w3.org/1999/xlink","xlink:show",m);break;case"xlinkTitle":Ni(s,"http://www.w3.org/1999/xlink","xlink:title",m);break;case"xlinkType":Ni(s,"http://www.w3.org/1999/xlink","xlink:type",m);break;case"xmlBase":Ni(s,"http://www.w3.org/XML/1998/namespace","xml:base",m);break;case"xmlLang":Ni(s,"http://www.w3.org/XML/1998/namespace","xml:lang",m);break;case"xmlSpace":Ni(s,"http://www.w3.org/XML/1998/namespace","xml:space",m);break;case"is":vn(s,"is",m);break;case"innerText":case"textContent":break;default:(!(2<f.length)||f[0]!=="o"&&f[0]!=="O"||f[1]!=="n"&&f[1]!=="N")&&(f=uB.get(f)||f,vn(s,f,m))}}function w0(s,c,f,m,v,S){switch(f){case"style":EE(s,m,S);break;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(r(61));if(f=m.__html,f!=null){if(v.children!=null)throw Error(r(60));s.innerHTML=f}}break;case"children":typeof m=="string"?lc(s,m):(typeof m=="number"||typeof m=="bigint")&&lc(s,""+m);break;case"onScroll":m!=null&&Et("scroll",s);break;case"onScrollEnd":m!=null&&Et("scrollend",s);break;case"onClick":m!=null&&(s.onclick=ra);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Eo.hasOwnProperty(f))e:{if(f[0]==="o"&&f[1]==="n"&&(v=f.endsWith("Capture"),c=f.slice(2,v?f.length-7:void 0),S=s[Pe]||null,S=S!=null?S[f]:null,typeof S=="function"&&s.removeEventListener(c,S,v),typeof m=="function")){typeof S!="function"&&S!==null&&(f in s?s[f]=null:s.hasAttribute(f)&&s.removeAttribute(f)),s.addEventListener(c,m,v);break e}f in s?s[f]=m:m===!0?s.setAttribute(f,""):vn(s,f,m)}}}function Sr(s,c,f){switch(c){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Et("error",s),Et("load",s);var m=!1,v=!1,S;for(S in f)if(f.hasOwnProperty(S)){var M=f[S];if(M!=null)switch(S){case"src":m=!0;break;case"srcSet":v=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,c));default:Xt(s,c,S,M,f,null)}}v&&Xt(s,c,"srcSet",f.srcSet,f,null),m&&Xt(s,c,"src",f.src,f,null);return;case"input":Et("invalid",s);var _=S=M=v=null,Z=null,le=null;for(m in f)if(f.hasOwnProperty(m)){var ve=f[m];if(ve!=null)switch(m){case"name":v=ve;break;case"type":M=ve;break;case"checked":Z=ve;break;case"defaultChecked":le=ve;break;case"value":S=ve;break;case"defaultValue":_=ve;break;case"children":case"dangerouslySetInnerHTML":if(ve!=null)throw Error(r(137,c));break;default:Xt(s,c,m,ve,f,null)}}xE(s,S,_,Z,le,M,v,!1);return;case"select":Et("invalid",s),m=M=S=null;for(v in f)if(f.hasOwnProperty(v)&&(_=f[v],_!=null))switch(v){case"value":S=_;break;case"defaultValue":M=_;break;case"multiple":m=_;default:Xt(s,c,v,_,f,null)}c=S,f=M,s.multiple=!!m,c!=null?sc(s,!!m,c,!1):f!=null&&sc(s,!!m,f,!0);return;case"textarea":Et("invalid",s),S=v=m=null;for(M in f)if(f.hasOwnProperty(M)&&(_=f[M],_!=null))switch(M){case"value":m=_;break;case"defaultValue":v=_;break;case"children":S=_;break;case"dangerouslySetInnerHTML":if(_!=null)throw Error(r(91));break;default:Xt(s,c,M,_,f,null)}SE(s,m,v,S);return;case"option":for(Z in f)if(f.hasOwnProperty(Z)&&(m=f[Z],m!=null))switch(Z){case"selected":s.selected=m&&typeof m!="function"&&typeof m!="symbol";break;default:Xt(s,c,Z,m,f,null)}return;case"dialog":Et("beforetoggle",s),Et("toggle",s),Et("cancel",s),Et("close",s);break;case"iframe":case"object":Et("load",s);break;case"video":case"audio":for(m=0;m<_d.length;m++)Et(_d[m],s);break;case"image":Et("error",s),Et("load",s);break;case"details":Et("toggle",s);break;case"embed":case"source":case"link":Et("error",s),Et("load",s);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(le in f)if(f.hasOwnProperty(le)&&(m=f[le],m!=null))switch(le){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,c));default:Xt(s,c,le,m,f,null)}return;default:if(Pv(c)){for(ve in f)f.hasOwnProperty(ve)&&(m=f[ve],m!==void 0&&w0(s,c,ve,m,f,void 0));return}}for(_ in f)f.hasOwnProperty(_)&&(m=f[_],m!=null&&Xt(s,c,_,m,f,null))}function z5(s,c,f,m){switch(c){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var v=null,S=null,M=null,_=null,Z=null,le=null,ve=null;for(me in f){var xe=f[me];if(f.hasOwnProperty(me)&&xe!=null)switch(me){case"checked":break;case"value":break;case"defaultValue":Z=xe;default:m.hasOwnProperty(me)||Xt(s,c,me,null,m,xe)}}for(var de in m){var me=m[de];if(xe=f[de],m.hasOwnProperty(de)&&(me!=null||xe!=null))switch(de){case"type":S=me;break;case"name":v=me;break;case"checked":le=me;break;case"defaultChecked":ve=me;break;case"value":M=me;break;case"defaultValue":_=me;break;case"children":case"dangerouslySetInnerHTML":if(me!=null)throw Error(r(137,c));break;default:me!==xe&&Xt(s,c,de,me,m,xe)}}_v(s,M,_,Z,le,ve,S,v);return;case"select":me=M=_=de=null;for(S in f)if(Z=f[S],f.hasOwnProperty(S)&&Z!=null)switch(S){case"value":break;case"multiple":me=Z;default:m.hasOwnProperty(S)||Xt(s,c,S,null,m,Z)}for(v in m)if(S=m[v],Z=f[v],m.hasOwnProperty(v)&&(S!=null||Z!=null))switch(v){case"value":de=S;break;case"defaultValue":_=S;break;case"multiple":M=S;default:S!==Z&&Xt(s,c,v,S,m,Z)}c=_,f=M,m=me,de!=null?sc(s,!!f,de,!1):!!m!=!!f&&(c!=null?sc(s,!!f,c,!0):sc(s,!!f,f?[]:"",!1));return;case"textarea":me=de=null;for(_ in f)if(v=f[_],f.hasOwnProperty(_)&&v!=null&&!m.hasOwnProperty(_))switch(_){case"value":break;case"children":break;default:Xt(s,c,_,null,m,v)}for(M in m)if(v=m[M],S=f[M],m.hasOwnProperty(M)&&(v!=null||S!=null))switch(M){case"value":de=v;break;case"defaultValue":me=v;break;case"children":break;case"dangerouslySetInnerHTML":if(v!=null)throw Error(r(91));break;default:v!==S&&Xt(s,c,M,v,m,S)}wE(s,de,me);return;case"option":for(var Fe in f)if(de=f[Fe],f.hasOwnProperty(Fe)&&de!=null&&!m.hasOwnProperty(Fe))switch(Fe){case"selected":s.selected=!1;break;default:Xt(s,c,Fe,null,m,de)}for(Z in m)if(de=m[Z],me=f[Z],m.hasOwnProperty(Z)&&de!==me&&(de!=null||me!=null))switch(Z){case"selected":s.selected=de&&typeof de!="function"&&typeof de!="symbol";break;default:Xt(s,c,Z,de,m,me)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var nt in f)de=f[nt],f.hasOwnProperty(nt)&&de!=null&&!m.hasOwnProperty(nt)&&Xt(s,c,nt,null,m,de);for(le in m)if(de=m[le],me=f[le],m.hasOwnProperty(le)&&de!==me&&(de!=null||me!=null))switch(le){case"children":case"dangerouslySetInnerHTML":if(de!=null)throw Error(r(137,c));break;default:Xt(s,c,le,de,m,me)}return;default:if(Pv(c)){for(var Qt in f)de=f[Qt],f.hasOwnProperty(Qt)&&de!==void 0&&!m.hasOwnProperty(Qt)&&w0(s,c,Qt,void 0,m,de);for(ve in m)de=m[ve],me=f[ve],!m.hasOwnProperty(ve)||de===me||de===void 0&&me===void 0||w0(s,c,ve,de,m,me);return}}for(var re in f)de=f[re],f.hasOwnProperty(re)&&de!=null&&!m.hasOwnProperty(re)&&Xt(s,c,re,null,m,de);for(xe in m)de=m[xe],me=f[xe],!m.hasOwnProperty(xe)||de===me||de==null&&me==null||Xt(s,c,xe,de,m,me)}function kO(s){switch(s){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function I5(){if(typeof performance.getEntriesByType=="function"){for(var s=0,c=0,f=performance.getEntriesByType("resource"),m=0;m<f.length;m++){var v=f[m],S=v.transferSize,M=v.initiatorType,_=v.duration;if(S&&_&&kO(M)){for(M=0,_=v.responseEnd,m+=1;m<f.length;m++){var Z=f[m],le=Z.startTime;if(le>_)break;var ve=Z.transferSize,xe=Z.initiatorType;ve&&kO(xe)&&(Z=Z.responseEnd,M+=ve*(Z<_?1:(_-le)/(Z-le)))}if(--m,c+=8*(S+M)/(v.duration/1e3),s++,10<s)break}}if(0<s)return c/s/1e6}return navigator.connection&&(s=navigator.connection.downlink,typeof s=="number")?s:5}var S0=null,C0=null;function jp(s){return s.nodeType===9?s:s.ownerDocument}function MO(s){switch(s){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function OO(s,c){if(s===0)switch(c){case"svg":return 1;case"math":return 2;default:return 0}return s===1&&c==="foreignObject"?0:s}function E0(s,c){return s==="textarea"||s==="noscript"||typeof c.children=="string"||typeof c.children=="number"||typeof c.children=="bigint"||typeof c.dangerouslySetInnerHTML=="object"&&c.dangerouslySetInnerHTML!==null&&c.dangerouslySetInnerHTML.__html!=null}var k0=null;function $5(){var s=window.event;return s&&s.type==="popstate"?s===k0?!1:(k0=s,!0):(k0=null,!1)}var TO=typeof setTimeout=="function"?setTimeout:void 0,F5=typeof clearTimeout=="function"?clearTimeout:void 0,AO=typeof Promise=="function"?Promise:void 0,B5=typeof queueMicrotask=="function"?queueMicrotask:typeof AO<"u"?function(s){return AO.resolve(null).then(s).catch(H5)}:TO;function H5(s){setTimeout(function(){throw s})}function ns(s){return s==="head"}function DO(s,c){var f=c,m=0;do{var v=f.nextSibling;if(s.removeChild(f),v&&v.nodeType===8)if(f=v.data,f==="/$"||f==="/&"){if(m===0){s.removeChild(v),$c(c);return}m--}else if(f==="$"||f==="$?"||f==="$~"||f==="$!"||f==="&")m++;else if(f==="html")Pd(s.ownerDocument.documentElement);else if(f==="head"){f=s.ownerDocument.head,Pd(f);for(var S=f.firstChild;S;){var M=S.nextSibling,_=S.nodeName;S[Ut]||_==="SCRIPT"||_==="STYLE"||_==="LINK"&&S.rel.toLowerCase()==="stylesheet"||f.removeChild(S),S=M}}else f==="body"&&Pd(s.ownerDocument.body);f=v}while(f);$c(c)}function RO(s,c){var f=s;s=0;do{var m=f.nextSibling;if(f.nodeType===1?c?(f._stashedDisplay=f.style.display,f.style.display="none"):(f.style.display=f._stashedDisplay||"",f.getAttribute("style")===""&&f.removeAttribute("style")):f.nodeType===3&&(c?(f._stashedText=f.nodeValue,f.nodeValue=""):f.nodeValue=f._stashedText||""),m&&m.nodeType===8)if(f=m.data,f==="/$"){if(s===0)break;s--}else f!=="$"&&f!=="$?"&&f!=="$~"&&f!=="$!"||s++;f=m}while(f)}function M0(s){var c=s.firstChild;for(c&&c.nodeType===10&&(c=c.nextSibling);c;){var f=c;switch(c=c.nextSibling,f.nodeName){case"HTML":case"HEAD":case"BODY":M0(f),Vt(f);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(f.rel.toLowerCase()==="stylesheet")continue}s.removeChild(f)}}function U5(s,c,f,m){for(;s.nodeType===1;){var v=f;if(s.nodeName.toLowerCase()!==c.toLowerCase()){if(!m&&(s.nodeName!=="INPUT"||s.type!=="hidden"))break}else if(m){if(!s[Ut])switch(c){case"meta":if(!s.hasAttribute("itemprop"))break;return s;case"link":if(S=s.getAttribute("rel"),S==="stylesheet"&&s.hasAttribute("data-precedence"))break;if(S!==v.rel||s.getAttribute("href")!==(v.href==null||v.href===""?null:v.href)||s.getAttribute("crossorigin")!==(v.crossOrigin==null?null:v.crossOrigin)||s.getAttribute("title")!==(v.title==null?null:v.title))break;return s;case"style":if(s.hasAttribute("data-precedence"))break;return s;case"script":if(S=s.getAttribute("src"),(S!==(v.src==null?null:v.src)||s.getAttribute("type")!==(v.type==null?null:v.type)||s.getAttribute("crossorigin")!==(v.crossOrigin==null?null:v.crossOrigin))&&S&&s.hasAttribute("async")&&!s.hasAttribute("itemprop"))break;return s;default:return s}}else if(c==="input"&&s.type==="hidden"){var S=v.name==null?null:""+v.name;if(v.type==="hidden"&&s.getAttribute("name")===S)return s}else return s;if(s=Fi(s.nextSibling),s===null)break}return null}function V5(s,c,f){if(c==="")return null;for(;s.nodeType!==3;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!f||(s=Fi(s.nextSibling),s===null))return null;return s}function NO(s,c){for(;s.nodeType!==8;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!c||(s=Fi(s.nextSibling),s===null))return null;return s}function O0(s){return s.data==="$?"||s.data==="$~"}function T0(s){return s.data==="$!"||s.data==="$?"&&s.ownerDocument.readyState!=="loading"}function q5(s,c){var f=s.ownerDocument;if(s.data==="$~")s._reactRetry=c;else if(s.data!=="$?"||f.readyState!=="loading")c();else{var m=function(){c(),f.removeEventListener("DOMContentLoaded",m)};f.addEventListener("DOMContentLoaded",m),s._reactRetry=m}}function Fi(s){for(;s!=null;s=s.nextSibling){var c=s.nodeType;if(c===1||c===3)break;if(c===8){if(c=s.data,c==="$"||c==="$!"||c==="$?"||c==="$~"||c==="&"||c==="F!"||c==="F")break;if(c==="/$"||c==="/&")return null}}return s}var A0=null;function _O(s){s=s.nextSibling;for(var c=0;s;){if(s.nodeType===8){var f=s.data;if(f==="/$"||f==="/&"){if(c===0)return Fi(s.nextSibling);c--}else f!=="$"&&f!=="$!"&&f!=="$?"&&f!=="$~"&&f!=="&"||c++}s=s.nextSibling}return null}function jO(s){s=s.previousSibling;for(var c=0;s;){if(s.nodeType===8){var f=s.data;if(f==="$"||f==="$!"||f==="$?"||f==="$~"||f==="&"){if(c===0)return s;c--}else f!=="/$"&&f!=="/&"||c++}s=s.previousSibling}return null}function PO(s,c,f){switch(c=jp(f),s){case"html":if(s=c.documentElement,!s)throw Error(r(452));return s;case"head":if(s=c.head,!s)throw Error(r(453));return s;case"body":if(s=c.body,!s)throw Error(r(454));return s;default:throw Error(r(451))}}function Pd(s){for(var c=s.attributes;c.length;)s.removeAttributeNode(c[0]);Vt(s)}var Bi=new Map,LO=new Set;function Pp(s){return typeof s.getRootNode=="function"?s.getRootNode():s.nodeType===9?s:s.ownerDocument}var ba=F.d;F.d={f:W5,r:K5,D:Y5,C:Z5,L:G5,m:X5,X:J5,S:Q5,M:e6};function W5(){var s=ba.f(),c=Mp();return s||c}function K5(s){var c=Di(s);c!==null&&c.tag===5&&c.type==="form"?Jk(c):ba.r(s)}var Lc=typeof document>"u"?null:document;function zO(s,c,f){var m=Lc;if(m&&typeof c=="string"&&c){var v=_i(c);v='link[rel="'+s+'"][href="'+v+'"]',typeof f=="string"&&(v+='[crossorigin="'+f+'"]'),LO.has(v)||(LO.add(v),s={rel:s,crossOrigin:f,href:c},m.querySelector(v)===null&&(c=m.createElement("link"),Sr(c,"link",s),An(c),m.head.appendChild(c)))}}function Y5(s){ba.D(s),zO("dns-prefetch",s,null)}function Z5(s,c){ba.C(s,c),zO("preconnect",s,c)}function G5(s,c,f){ba.L(s,c,f);var m=Lc;if(m&&s&&c){var v='link[rel="preload"][as="'+_i(c)+'"]';c==="image"&&f&&f.imageSrcSet?(v+='[imagesrcset="'+_i(f.imageSrcSet)+'"]',typeof f.imageSizes=="string"&&(v+='[imagesizes="'+_i(f.imageSizes)+'"]')):v+='[href="'+_i(s)+'"]';var S=v;switch(c){case"style":S=zc(s);break;case"script":S=Ic(s)}Bi.has(S)||(s=p({rel:"preload",href:c==="image"&&f&&f.imageSrcSet?void 0:s,as:c},f),Bi.set(S,s),m.querySelector(v)!==null||c==="style"&&m.querySelector(Ld(S))||c==="script"&&m.querySelector(zd(S))||(c=m.createElement("link"),Sr(c,"link",s),An(c),m.head.appendChild(c)))}}function X5(s,c){ba.m(s,c);var f=Lc;if(f&&s){var m=c&&typeof c.as=="string"?c.as:"script",v='link[rel="modulepreload"][as="'+_i(m)+'"][href="'+_i(s)+'"]',S=v;switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":S=Ic(s)}if(!Bi.has(S)&&(s=p({rel:"modulepreload",href:s},c),Bi.set(S,s),f.querySelector(v)===null)){switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(f.querySelector(zd(S)))return}m=f.createElement("link"),Sr(m,"link",s),An(m),f.head.appendChild(m)}}}function Q5(s,c,f){ba.S(s,c,f);var m=Lc;if(m&&s){var v=vr(m).hoistableStyles,S=zc(s);c=c||"default";var M=v.get(S);if(!M){var _={loading:0,preload:null};if(M=m.querySelector(Ld(S)))_.loading=5;else{s=p({rel:"stylesheet",href:s,"data-precedence":c},f),(f=Bi.get(S))&&D0(s,f);var Z=M=m.createElement("link");An(Z),Sr(Z,"link",s),Z._p=new Promise(function(le,ve){Z.onload=le,Z.onerror=ve}),Z.addEventListener("load",function(){_.loading|=1}),Z.addEventListener("error",function(){_.loading|=2}),_.loading|=4,Lp(M,c,m)}M={type:"stylesheet",instance:M,count:1,state:_},v.set(S,M)}}}function J5(s,c){ba.X(s,c);var f=Lc;if(f&&s){var m=vr(f).hoistableScripts,v=Ic(s),S=m.get(v);S||(S=f.querySelector(zd(v)),S||(s=p({src:s,async:!0},c),(c=Bi.get(v))&&R0(s,c),S=f.createElement("script"),An(S),Sr(S,"link",s),f.head.appendChild(S)),S={type:"script",instance:S,count:1,state:null},m.set(v,S))}}function e6(s,c){ba.M(s,c);var f=Lc;if(f&&s){var m=vr(f).hoistableScripts,v=Ic(s),S=m.get(v);S||(S=f.querySelector(zd(v)),S||(s=p({src:s,async:!0,type:"module"},c),(c=Bi.get(v))&&R0(s,c),S=f.createElement("script"),An(S),Sr(S,"link",s),f.head.appendChild(S)),S={type:"script",instance:S,count:1,state:null},m.set(v,S))}}function IO(s,c,f,m){var v=(v=ge.current)?Pp(v):null;if(!v)throw Error(r(446));switch(s){case"meta":case"title":return null;case"style":return typeof f.precedence=="string"&&typeof f.href=="string"?(c=zc(f.href),f=vr(v).hoistableStyles,m=f.get(c),m||(m={type:"style",instance:null,count:0,state:null},f.set(c,m)),m):{type:"void",instance:null,count:0,state:null};case"link":if(f.rel==="stylesheet"&&typeof f.href=="string"&&typeof f.precedence=="string"){s=zc(f.href);var S=vr(v).hoistableStyles,M=S.get(s);if(M||(v=v.ownerDocument||v,M={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},S.set(s,M),(S=v.querySelector(Ld(s)))&&!S._p&&(M.instance=S,M.state.loading=5),Bi.has(s)||(f={rel:"preload",as:"style",href:f.href,crossOrigin:f.crossOrigin,integrity:f.integrity,media:f.media,hrefLang:f.hrefLang,referrerPolicy:f.referrerPolicy},Bi.set(s,f),S||t6(v,s,f,M.state))),c&&m===null)throw Error(r(528,""));return M}if(c&&m!==null)throw Error(r(529,""));return null;case"script":return c=f.async,f=f.src,typeof f=="string"&&c&&typeof c!="function"&&typeof c!="symbol"?(c=Ic(f),f=vr(v).hoistableScripts,m=f.get(c),m||(m={type:"script",instance:null,count:0,state:null},f.set(c,m)),m):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,s))}}function zc(s){return'href="'+_i(s)+'"'}function Ld(s){return'link[rel="stylesheet"]['+s+"]"}function $O(s){return p({},s,{"data-precedence":s.precedence,precedence:null})}function t6(s,c,f,m){s.querySelector('link[rel="preload"][as="style"]['+c+"]")?m.loading=1:(c=s.createElement("link"),m.preload=c,c.addEventListener("load",function(){return m.loading|=1}),c.addEventListener("error",function(){return m.loading|=2}),Sr(c,"link",f),An(c),s.head.appendChild(c))}function Ic(s){return'[src="'+_i(s)+'"]'}function zd(s){return"script[async]"+s}function FO(s,c,f){if(c.count++,c.instance===null)switch(c.type){case"style":var m=s.querySelector('style[data-href~="'+_i(f.href)+'"]');if(m)return c.instance=m,An(m),m;var v=p({},f,{"data-href":f.href,"data-precedence":f.precedence,href:null,precedence:null});return m=(s.ownerDocument||s).createElement("style"),An(m),Sr(m,"style",v),Lp(m,f.precedence,s),c.instance=m;case"stylesheet":v=zc(f.href);var S=s.querySelector(Ld(v));if(S)return c.state.loading|=4,c.instance=S,An(S),S;m=$O(f),(v=Bi.get(v))&&D0(m,v),S=(s.ownerDocument||s).createElement("link"),An(S);var M=S;return M._p=new Promise(function(_,Z){M.onload=_,M.onerror=Z}),Sr(S,"link",m),c.state.loading|=4,Lp(S,f.precedence,s),c.instance=S;case"script":return S=Ic(f.src),(v=s.querySelector(zd(S)))?(c.instance=v,An(v),v):(m=f,(v=Bi.get(S))&&(m=p({},f),R0(m,v)),s=s.ownerDocument||s,v=s.createElement("script"),An(v),Sr(v,"link",m),s.head.appendChild(v),c.instance=v);case"void":return null;default:throw Error(r(443,c.type))}else c.type==="stylesheet"&&(c.state.loading&4)===0&&(m=c.instance,c.state.loading|=4,Lp(m,f.precedence,s));return c.instance}function Lp(s,c,f){for(var m=f.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),v=m.length?m[m.length-1]:null,S=v,M=0;M<m.length;M++){var _=m[M];if(_.dataset.precedence===c)S=_;else if(S!==v)break}S?S.parentNode.insertBefore(s,S.nextSibling):(c=f.nodeType===9?f.head:f,c.insertBefore(s,c.firstChild))}function D0(s,c){s.crossOrigin==null&&(s.crossOrigin=c.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=c.referrerPolicy),s.title==null&&(s.title=c.title)}function R0(s,c){s.crossOrigin==null&&(s.crossOrigin=c.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=c.referrerPolicy),s.integrity==null&&(s.integrity=c.integrity)}var zp=null;function BO(s,c,f){if(zp===null){var m=new Map,v=zp=new Map;v.set(f,m)}else v=zp,m=v.get(f),m||(m=new Map,v.set(f,m));if(m.has(s))return m;for(m.set(s,null),f=f.getElementsByTagName(s),v=0;v<f.length;v++){var S=f[v];if(!(S[Ut]||S[Ie]||s==="link"&&S.getAttribute("rel")==="stylesheet")&&S.namespaceURI!=="http://www.w3.org/2000/svg"){var M=S.getAttribute(c)||"";M=s+M;var _=m.get(M);_?_.push(S):m.set(M,[S])}}return m}function HO(s,c,f){s=s.ownerDocument||s,s.head.insertBefore(f,c==="title"?s.querySelector("head > title"):null)}function n6(s,c,f){if(f===1||c.itemProp!=null)return!1;switch(s){case"meta":case"title":return!0;case"style":if(typeof c.precedence!="string"||typeof c.href!="string"||c.href==="")break;return!0;case"link":if(typeof c.rel!="string"||typeof c.href!="string"||c.href===""||c.onLoad||c.onError)break;switch(c.rel){case"stylesheet":return s=c.disabled,typeof c.precedence=="string"&&s==null;default:return!0}case"script":if(c.async&&typeof c.async!="function"&&typeof c.async!="symbol"&&!c.onLoad&&!c.onError&&c.src&&typeof c.src=="string")return!0}return!1}function UO(s){return!(s.type==="stylesheet"&&(s.state.loading&3)===0)}function r6(s,c,f,m){if(f.type==="stylesheet"&&(typeof m.media!="string"||matchMedia(m.media).matches!==!1)&&(f.state.loading&4)===0){if(f.instance===null){var v=zc(m.href),S=c.querySelector(Ld(v));if(S){c=S._p,c!==null&&typeof c=="object"&&typeof c.then=="function"&&(s.count++,s=Ip.bind(s),c.then(s,s)),f.state.loading|=4,f.instance=S,An(S);return}S=c.ownerDocument||c,m=$O(m),(v=Bi.get(v))&&D0(m,v),S=S.createElement("link"),An(S);var M=S;M._p=new Promise(function(_,Z){M.onload=_,M.onerror=Z}),Sr(S,"link",m),f.instance=S}s.stylesheets===null&&(s.stylesheets=new Map),s.stylesheets.set(f,c),(c=f.state.preload)&&(f.state.loading&3)===0&&(s.count++,f=Ip.bind(s),c.addEventListener("load",f),c.addEventListener("error",f))}}var N0=0;function i6(s,c){return s.stylesheets&&s.count===0&&Fp(s,s.stylesheets),0<s.count||0<s.imgCount?function(f){var m=setTimeout(function(){if(s.stylesheets&&Fp(s,s.stylesheets),s.unsuspend){var S=s.unsuspend;s.unsuspend=null,S()}},6e4+c);0<s.imgBytes&&N0===0&&(N0=62500*I5());var v=setTimeout(function(){if(s.waitingForImages=!1,s.count===0&&(s.stylesheets&&Fp(s,s.stylesheets),s.unsuspend)){var S=s.unsuspend;s.unsuspend=null,S()}},(s.imgBytes>N0?50:800)+c);return s.unsuspend=f,function(){s.unsuspend=null,clearTimeout(m),clearTimeout(v)}}:null}function Ip(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Fp(this,this.stylesheets);else if(this.unsuspend){var s=this.unsuspend;this.unsuspend=null,s()}}}var $p=null;function Fp(s,c){s.stylesheets=null,s.unsuspend!==null&&(s.count++,$p=new Map,c.forEach(o6,s),$p=null,Ip.call(s))}function o6(s,c){if(!(c.state.loading&4)){var f=$p.get(s);if(f)var m=f.get(null);else{f=new Map,$p.set(s,f);for(var v=s.querySelectorAll("link[data-precedence],style[data-precedence]"),S=0;S<v.length;S++){var M=v[S];(M.nodeName==="LINK"||M.getAttribute("media")!=="not all")&&(f.set(M.dataset.precedence,M),m=M)}m&&f.set(null,m)}v=c.instance,M=v.getAttribute("data-precedence"),S=f.get(M)||m,S===m&&f.set(null,v),f.set(M,v),this.count++,m=Ip.bind(this),v.addEventListener("load",m),v.addEventListener("error",m),S?S.parentNode.insertBefore(v,S.nextSibling):(s=s.nodeType===9?s.head:s,s.insertBefore(v,s.firstChild)),c.state.loading|=4}}var Id={$$typeof:A,Provider:null,Consumer:null,_currentValue:z,_currentValue2:z,_threadCount:0};function a6(s,c,f,m,v,S,M,_,Z){this.tag=1,this.containerInfo=s,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=qr(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=qr(0),this.hiddenUpdates=qr(null),this.identifierPrefix=m,this.onUncaughtError=v,this.onCaughtError=S,this.onRecoverableError=M,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Z,this.incompleteTransitions=new Map}function VO(s,c,f,m,v,S,M,_,Z,le,ve,xe){return s=new a6(s,c,f,M,Z,le,ve,xe,_),c=1,S===!0&&(c|=24),S=fi(3,null,null,c),s.current=S,S.stateNode=s,c=db(),c.refCount++,s.pooledCache=c,c.refCount++,S.memoizedState={element:m,isDehydrated:f,cache:c},mb(S),s}function qO(s){return s?(s=mc,s):mc}function WO(s,c,f,m,v,S){v=qO(v),m.context===null?m.context=v:m.pendingContext=v,m=qa(c),m.payload={element:f},S=S===void 0?null:S,S!==null&&(m.callback=S),f=Wa(s,m,c),f!==null&&(ei(f,s,c),gd(f,s,c))}function KO(s,c){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var f=s.retryLane;s.retryLane=f!==0&&f<c?f:c}}function _0(s,c){KO(s,c),(s=s.alternate)&&KO(s,c)}function YO(s){if(s.tag===13||s.tag===31){var c=tl(s,67108864);c!==null&&ei(c,s,67108864),_0(s,67108864)}}function ZO(s){if(s.tag===13||s.tag===31){var c=yi();c=Ne(c);var f=tl(s,c);f!==null&&ei(f,s,c),_0(s,c)}}var Bp=!0;function s6(s,c,f,m){var v=R.T;R.T=null;var S=F.p;try{F.p=2,j0(s,c,f,m)}finally{F.p=S,R.T=v}}function l6(s,c,f,m){var v=R.T;R.T=null;var S=F.p;try{F.p=8,j0(s,c,f,m)}finally{F.p=S,R.T=v}}function j0(s,c,f,m){if(Bp){var v=P0(m);if(v===null)x0(s,c,m,Hp,f),XO(s,m);else if(u6(v,s,c,f,m))m.stopPropagation();else if(XO(s,m),c&4&&-1<c6.indexOf(s)){for(;v!==null;){var S=Di(v);if(S!==null)switch(S.tag){case 3:if(S=S.stateNode,S.current.memoizedState.isDehydrated){var M=ct(S.pendingLanes);if(M!==0){var _=S;for(_.pendingLanes|=2,_.entangledLanes|=2;M;){var Z=1<<31-Bt(M);_.entanglements[1]|=Z,M&=~Z}To(S),(Pt&6)===0&&(Ep=ie()+500,Nd(0))}}break;case 31:case 13:_=tl(S,2),_!==null&&ei(_,S,2),Mp(),_0(S,2)}if(S=P0(m),S===null&&x0(s,c,m,Hp,f),S===v)break;v=S}v!==null&&m.stopPropagation()}else x0(s,c,m,null,f)}}function P0(s){return s=zv(s),L0(s)}var Hp=null;function L0(s){if(Hp=null,s=Wr(s),s!==null){var c=o(s);if(c===null)s=null;else{var f=c.tag;if(f===13){if(s=a(c),s!==null)return s;s=null}else if(f===31){if(s=l(c),s!==null)return s;s=null}else if(f===3){if(c.stateNode.current.memoizedState.isDehydrated)return c.tag===3?c.stateNode.containerInfo:null;s=null}else c!==s&&(s=null)}}return Hp=s,null}function GO(s){switch(s){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(he()){case Re:return 2;case $e:return 8;case Ke:case $t:return 32;case un:return 268435456;default:return 32}default:return 32}}var z0=!1,rs=null,is=null,as=null,$d=new Map,Fd=new Map,ss=[],c6="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function XO(s,c){switch(s){case"focusin":case"focusout":rs=null;break;case"dragenter":case"dragleave":is=null;break;case"mouseover":case"mouseout":as=null;break;case"pointerover":case"pointerout":$d.delete(c.pointerId);break;case"gotpointercapture":case"lostpointercapture":Fd.delete(c.pointerId)}}function Bd(s,c,f,m,v,S){return s===null||s.nativeEvent!==S?(s={blockedOn:c,domEventName:f,eventSystemFlags:m,nativeEvent:S,targetContainers:[v]},c!==null&&(c=Di(c),c!==null&&YO(c)),s):(s.eventSystemFlags|=m,c=s.targetContainers,v!==null&&c.indexOf(v)===-1&&c.push(v),s)}function u6(s,c,f,m,v){switch(c){case"focusin":return rs=Bd(rs,s,c,f,m,v),!0;case"dragenter":return is=Bd(is,s,c,f,m,v),!0;case"mouseover":return as=Bd(as,s,c,f,m,v),!0;case"pointerover":var S=v.pointerId;return $d.set(S,Bd($d.get(S)||null,s,c,f,m,v)),!0;case"gotpointercapture":return S=v.pointerId,Fd.set(S,Bd(Fd.get(S)||null,s,c,f,m,v)),!0}return!1}function QO(s){var c=Wr(s.target);if(c!==null){var f=o(c);if(f!==null){if(c=f.tag,c===13){if(c=a(f),c!==null){s.blockedOn=c,qe(s.priority,function(){ZO(f)});return}}else if(c===31){if(c=l(f),c!==null){s.blockedOn=c,qe(s.priority,function(){ZO(f)});return}}else if(c===3&&f.stateNode.current.memoizedState.isDehydrated){s.blockedOn=f.tag===3?f.stateNode.containerInfo:null;return}}}s.blockedOn=null}function Up(s){if(s.blockedOn!==null)return!1;for(var c=s.targetContainers;0<c.length;){var f=P0(s.nativeEvent);if(f===null){f=s.nativeEvent;var m=new f.constructor(f.type,f);Lv=m,f.target.dispatchEvent(m),Lv=null}else return c=Di(f),c!==null&&YO(c),s.blockedOn=f,!1;c.shift()}return!0}function JO(s,c,f){Up(s)&&f.delete(c)}function d6(){z0=!1,rs!==null&&Up(rs)&&(rs=null),is!==null&&Up(is)&&(is=null),as!==null&&Up(as)&&(as=null),$d.forEach(JO),Fd.forEach(JO)}function Vp(s,c){s.blockedOn===c&&(s.blockedOn=null,z0||(z0=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,d6)))}var qp=null;function eT(s){qp!==s&&(qp=s,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){qp===s&&(qp=null);for(var c=0;c<s.length;c+=3){var f=s[c],m=s[c+1],v=s[c+2];if(typeof m!="function"){if(L0(m||f)===null)continue;break}var S=Di(f);S!==null&&(s.splice(c,3),c-=3,Pb(S,{pending:!0,data:v,method:f.method,action:m},m,v))}}))}function $c(s){function c(Z){return Vp(Z,s)}rs!==null&&Vp(rs,s),is!==null&&Vp(is,s),as!==null&&Vp(as,s),$d.forEach(c),Fd.forEach(c);for(var f=0;f<ss.length;f++){var m=ss[f];m.blockedOn===s&&(m.blockedOn=null)}for(;0<ss.length&&(f=ss[0],f.blockedOn===null);)QO(f),f.blockedOn===null&&ss.shift();if(f=(s.ownerDocument||s).$$reactFormReplay,f!=null)for(m=0;m<f.length;m+=3){var v=f[m],S=f[m+1],M=v[Pe]||null;if(typeof S=="function")M||eT(f);else if(M){var _=null;if(S&&S.hasAttribute("formAction")){if(v=S,M=S[Pe]||null)_=M.formAction;else if(L0(v)!==null)continue}else _=M.action;typeof _=="function"?f[m+1]=_:(f.splice(m,3),m-=3),eT(f)}}}function tT(){function s(S){S.canIntercept&&S.info==="react-transition"&&S.intercept({handler:function(){return new Promise(function(M){return v=M})},focusReset:"manual",scroll:"manual"})}function c(){v!==null&&(v(),v=null),m||setTimeout(f,20)}function f(){if(!m&&!navigation.transition){var S=navigation.currentEntry;S&&S.url!=null&&navigation.navigate(S.url,{state:S.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var m=!1,v=null;return navigation.addEventListener("navigate",s),navigation.addEventListener("navigatesuccess",c),navigation.addEventListener("navigateerror",c),setTimeout(f,100),function(){m=!0,navigation.removeEventListener("navigate",s),navigation.removeEventListener("navigatesuccess",c),navigation.removeEventListener("navigateerror",c),v!==null&&(v(),v=null)}}}function I0(s){this._internalRoot=s}Wp.prototype.render=I0.prototype.render=function(s){var c=this._internalRoot;if(c===null)throw Error(r(409));var f=c.current,m=yi();WO(f,m,s,c,null,null)},Wp.prototype.unmount=I0.prototype.unmount=function(){var s=this._internalRoot;if(s!==null){this._internalRoot=null;var c=s.containerInfo;WO(s.current,2,null,s,null,null),Mp(),c[Ve]=null}};function Wp(s){this._internalRoot=s}Wp.prototype.unstable_scheduleHydration=function(s){if(s){var c=Ye();s={blockedOn:null,target:s,priority:c};for(var f=0;f<ss.length&&c!==0&&c<ss[f].priority;f++);ss.splice(f,0,s),f===0&&QO(s)}};var nT=t.version;if(nT!=="19.2.0")throw Error(r(527,nT,"19.2.0"));F.findDOMNode=function(s){var c=s._reactInternals;if(c===void 0)throw typeof s.render=="function"?Error(r(188)):(s=Object.keys(s).join(","),Error(r(268,s)));return s=d(c),s=s!==null?h(s):null,s=s===null?null:s.stateNode,s};var f6={bundleType:0,version:"19.2.0",rendererPackageName:"react-dom",currentDispatcherRef:R,reconcilerVersion:"19.2.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Kp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Kp.isDisabled&&Kp.supportsFiber)try{en=Kp.inject(f6),Ft=Kp}catch{}}return Ud.createRoot=function(s,c){if(!i(s))throw Error(r(299));var f=!1,m="",v=cM,S=uM,M=dM;return c!=null&&(c.unstable_strictMode===!0&&(f=!0),c.identifierPrefix!==void 0&&(m=c.identifierPrefix),c.onUncaughtError!==void 0&&(v=c.onUncaughtError),c.onCaughtError!==void 0&&(S=c.onCaughtError),c.onRecoverableError!==void 0&&(M=c.onRecoverableError)),c=VO(s,1,!1,null,null,f,m,null,v,S,M,tT),s[Ve]=c.current,b0(s),new I0(c)},Ud.hydrateRoot=function(s,c,f){if(!i(s))throw Error(r(299));var m=!1,v="",S=cM,M=uM,_=dM,Z=null;return f!=null&&(f.unstable_strictMode===!0&&(m=!0),f.identifierPrefix!==void 0&&(v=f.identifierPrefix),f.onUncaughtError!==void 0&&(S=f.onUncaughtError),f.onCaughtError!==void 0&&(M=f.onCaughtError),f.onRecoverableError!==void 0&&(_=f.onRecoverableError),f.formState!==void 0&&(Z=f.formState)),c=VO(s,1,!0,c,f??null,m,v,Z,S,M,_,tT),c.context=qO(null),f=c.current,m=yi(),m=Ne(m),v=qa(m),v.callback=null,Wa(f,v,m),f=m,c.current.lanes=f,hn(c,f),To(c),s[Ve]=c.current,b0(s),new Wp(c)},Ud.version="19.2.0",Ud}var fT;function S6(){if(fT)return F0.exports;fT=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),F0.exports=w6(),F0.exports}var C6=S6();const E6=yo(C6);var w=Pu();const V=yo(w),Z1=p6({__proto__:null,default:V},[w]);var T2=e=>{throw TypeError(e)},k6=(e,t,n)=>t.has(e)||T2("Cannot "+n),q0=(e,t,n)=>(k6(e,t,"read from private field"),n?n.call(e):t.get(e)),M6=(e,t,n)=>t.has(e)?T2("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),hT="popstate";function O6(e={}){function t(r,i){let{pathname:o,search:a,hash:l}=r.location;return Df("",{pathname:o,search:a,hash:l},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function n(r,i){return typeof i=="string"?i:Vo(i)}return A6(t,n,null,e)}function bt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Ln(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function T6(){return Math.random().toString(36).substring(2,10)}function pT(e,t){return{usr:e.state,key:e.key,idx:t}}function Df(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Hs(t):t,state:n,key:t&&t.key||r||T6()}}function Vo({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function Hs(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function A6(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:o=!1}=r,a=i.history,l="POP",u=null,d=h();d==null&&(d=0,a.replaceState({...a.state,idx:d},""));function h(){return(a.state||{idx:null}).idx}function p(){l="POP";let E=h(),k=E==null?null:E-d;d=E,u&&u({action:l,location:C.location,delta:k})}function g(E,k){l="PUSH";let O=Df(C.location,E,k);d=h()+1;let A=pT(O,d),N=C.createHref(O);try{a.pushState(A,"",N)}catch(D){if(D instanceof DOMException&&D.name==="DataCloneError")throw D;i.location.assign(N)}o&&u&&u({action:l,location:C.location,delta:1})}function y(E,k){l="REPLACE";let O=Df(C.location,E,k);d=h();let A=pT(O,d),N=C.createHref(O);a.replaceState(A,"",N),o&&u&&u({action:l,location:C.location,delta:0})}function b(E){return A2(E)}let C={get action(){return l},get location(){return e(i,a)},listen(E){if(u)throw new Error("A history only accepts one active listener");return i.addEventListener(hT,p),u=E,()=>{i.removeEventListener(hT,p),u=null}},createHref(E){return t(i,E)},createURL:b,encodeLocation(E){let k=b(E);return{pathname:k.pathname,search:k.search,hash:k.hash}},push:g,replace:y,go(E){return a.go(E)}};return C}function A2(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),bt(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:Vo(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}var rf,mT=class{constructor(e){if(M6(this,rf,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(q0(this,rf).has(e))return q0(this,rf).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){q0(this,rf).set(e,t)}};rf=new WeakMap;var D6=new Set(["lazy","caseSensitive","path","id","index","children"]);function R6(e){return D6.has(e)}var N6=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function _6(e){return N6.has(e)}function j6(e){return e.index===!0}function Rf(e,t,n=[],r={},i=!1){return e.map((o,a)=>{let l=[...n,String(a)],u=typeof o.id=="string"?o.id:l.join("-");if(bt(o.index!==!0||!o.children,"Cannot specify children on an index route"),bt(i||!r[u],`Found a route id collision on id "${u}". Route id's must be globally unique within Data Router usages`),j6(o)){let d={...o,id:u};return r[u]=gT(d,t(d)),d}else{let d={...o,id:u,children:void 0};return r[u]=gT(d,t(d)),o.children&&(d.children=Rf(o.children,t,l,r,i)),d}})}function gT(e,t){return Object.assign(e,{...t,...typeof t.lazy=="object"&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function xs(e,t,n="/"){return Dm(e,t,n,!1)}function Dm(e,t,n,r){let i=typeof t=="string"?Hs(t):t,o=Xi(i.pathname||"/",n);if(o==null)return null;let a=D2(e);L6(a);let l=null;for(let u=0;l==null&&u<a.length;++u){let d=K6(o);l=q6(a[u],d,r)}return l}function P6(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function D2(e,t=[],n=[],r="",i=!1){let o=(a,l,u=i,d)=>{let h={relativePath:d===void 0?a.path||"":d,caseSensitive:a.caseSensitive===!0,childrenIndex:l,route:a};if(h.relativePath.startsWith("/")){if(!h.relativePath.startsWith(r)&&u)return;bt(h.relativePath.startsWith(r),`Absolute route path "${h.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),h.relativePath=h.relativePath.slice(r.length)}let p=Ho([r,h.relativePath]),g=n.concat(h);a.children&&a.children.length>0&&(bt(a.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${p}".`),D2(a.children,t,g,p,u)),!(a.path==null&&!a.index)&&t.push({path:p,score:U6(p,a.index),routesMeta:g})};return e.forEach((a,l)=>{if(a.path===""||!a.path?.includes("?"))o(a,l);else for(let u of R2(a.path))o(a,l,!0,u)}),t}function R2(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return i?[o,""]:[o];let a=R2(r.join("/")),l=[];return l.push(...a.map(u=>u===""?o:[o,u].join("/"))),i&&l.push(...a),l.map(u=>e.startsWith("/")&&u===""?"/":u)}function L6(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:V6(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var z6=/^:[\w-]+$/,I6=3,$6=2,F6=1,B6=10,H6=-2,yT=e=>e==="*";function U6(e,t){let n=e.split("/"),r=n.length;return n.some(yT)&&(r+=H6),t&&(r+=$6),n.filter(i=>!yT(i)).reduce((i,o)=>i+(z6.test(o)?I6:o===""?F6:B6),r)}function V6(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function q6(e,t,n=!1){let{routesMeta:r}=e,i={},o="/",a=[];for(let l=0;l<r.length;++l){let u=r[l],d=l===r.length-1,h=o==="/"?t:t.slice(o.length)||"/",p=Xm({path:u.relativePath,caseSensitive:u.caseSensitive,end:d},h),g=u.route;if(!p&&d&&n&&!r[r.length-1].route.index&&(p=Xm({path:u.relativePath,caseSensitive:u.caseSensitive,end:!1},h)),!p)return null;Object.assign(i,p.params),a.push({params:i,pathname:Ho([o,p.pathname]),pathnameBase:X6(Ho([o,p.pathnameBase])),route:g}),p.pathnameBase!=="/"&&(o=Ho([o,p.pathnameBase]))}return a}function Xm(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=W6(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let o=i[0],a=o.replace(/(.)\/+$/,"$1"),l=i.slice(1);return{params:r.reduce((d,{paramName:h,isOptional:p},g)=>{if(h==="*"){let b=l[g]||"";a=o.slice(0,o.length-b.length).replace(/(.)\/+$/,"$1")}const y=l[g];return p&&!y?d[h]=void 0:d[h]=(y||"").replace(/%2F/g,"/"),d},{}),pathname:o,pathnameBase:a,pattern:e}}function W6(e,t=!1,n=!0){Ln(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(a,l,u)=>(r.push({paramName:l,isOptional:u!=null}),u?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function K6(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Ln(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Xi(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function Y6({basename:e,pathname:t}){return t==="/"?e:Ho([e,t])}function Z6(e,t="/"){let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?Hs(e):e;return{pathname:n?n.startsWith("/")?n:G6(n,t):t,search:Q6(r),hash:J6(i)}}function G6(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function W0(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function N2(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function yy(e){let t=N2(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function vy(e,t,n,r=!1){let i;typeof e=="string"?i=Hs(e):(i={...e},bt(!i.pathname||!i.pathname.includes("?"),W0("?","pathname","search",i)),bt(!i.pathname||!i.pathname.includes("#"),W0("#","pathname","hash",i)),bt(!i.search||!i.search.includes("#"),W0("#","search","hash",i)));let o=e===""||i.pathname==="",a=o?"/":i.pathname,l;if(a==null)l=n;else{let p=t.length-1;if(!r&&a.startsWith("..")){let g=a.split("/");for(;g[0]==="..";)g.shift(),p-=1;i.pathname=g.join("/")}l=p>=0?t[p]:"/"}let u=Z6(i,l),d=a&&a!=="/"&&a.endsWith("/"),h=(o||a===".")&&n.endsWith("/");return!u.pathname.endsWith("/")&&(d||h)&&(u.pathname+="/"),u}var Ho=e=>e.join("/").replace(/\/\/+/g,"/"),X6=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Q6=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,J6=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,Qm=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function Nf(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function G1(e){return e.filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var Es=Symbol("Uninstrumented");function eH(e,t){let n={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(i=>i({id:t.id,index:t.index,path:t.path,instrument(o){let a=Object.keys(n);for(let l of a)o[l]&&n[l].push(o[l])}}));let r={};if(typeof t.lazy=="function"&&n.lazy.length>0){let i=lu(n.lazy,t.lazy,()=>{});i&&(r.lazy=i)}if(typeof t.lazy=="object"){let i=t.lazy;["middleware","loader","action"].forEach(o=>{let a=i[o],l=n[`lazy.${o}`];if(typeof a=="function"&&l.length>0){let u=lu(l,a,()=>{});u&&(r.lazy=Object.assign(r.lazy||{},{[o]:u}))}})}return["loader","action"].forEach(i=>{let o=t[i];if(typeof o=="function"&&n[i].length>0){let a=o[Es]??o,l=lu(n[i],a,(...u)=>vT(u[0]));l&&(l[Es]=a,r[i]=l)}}),t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map(i=>{let o=i[Es]??i,a=lu(n.middleware,o,(...l)=>vT(l[0]));return a?(a[Es]=o,a):i})),r}function tH(e,t){let n={navigate:[],fetch:[]};if(t.forEach(r=>r({instrument(i){let o=Object.keys(i);for(let a of o)i[a]&&n[a].push(i[a])}})),n.navigate.length>0){let r=e.navigate[Es]??e.navigate,i=lu(n.navigate,r,(...o)=>{let[a,l]=o;return{to:typeof a=="number"||typeof a=="string"?a:a?Vo(a):".",...bT(e,l??{})}});i&&(i[Es]=r,e.navigate=i)}if(n.fetch.length>0){let r=e.fetch[Es]??e.fetch,i=lu(n.fetch,r,(...o)=>{let[a,,l,u]=o;return{href:l??".",fetcherKey:a,...bT(e,u??{})}});i&&(i[Es]=r,e.fetch=i)}return e}function lu(e,t,n){return e.length===0?null:async(...r)=>{let i=await _2(e,n(...r),()=>t(...r),e.length-1);if(i.type==="error")throw i.value;return i.value}}async function _2(e,t,n,r){let i=e[r],o;if(i){let a,l=async()=>(a?console.error("You cannot call instrumented handlers more than once"):a=_2(e,t,n,r-1),o=await a,bt(o,"Expected a result"),o.type==="error"&&o.value instanceof Error?{status:"error",error:o.value}:{status:"success",error:void 0});try{await i(l,t)}catch(u){console.error("An instrumentation function threw an error:",u)}a||await l(),await a}else try{o={type:"success",value:await n()}}catch(a){o={type:"error",value:a}}return o||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function vT(e){let{request:t,context:n,params:r,unstable_pattern:i}=e;return{request:nH(t),params:{...r},unstable_pattern:i,context:rH(n)}}function bT(e,t){return{currentUrl:Vo(e.state.location),..."formMethod"in t?{formMethod:t.formMethod}:{},..."formEncType"in t?{formEncType:t.formEncType}:{},..."formData"in t?{formData:t.formData}:{},..."body"in t?{body:t.body}:{}}}function nH(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function rH(e){if(oH(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var iH=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function oH(e){if(e===null||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null||Object.getOwnPropertyNames(t).sort().join("\0")===iH}var j2=["POST","PUT","PATCH","DELETE"],aH=new Set(j2),sH=["GET",...j2],lH=new Set(sH),cH=new Set([301,302,303,307,308]),uH=new Set([307,308]),K0={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},dH={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Vd={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},fH=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,X1=e=>fH.test(e),hH=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),P2="remix-router-transitions",L2=Symbol("ResetLoaderData");function pH(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u";bt(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let r=e.hydrationRouteProperties||[],i=e.mapRouteProperties||hH,o=i;if(e.unstable_instrumentations){let W=e.unstable_instrumentations;o=oe=>({...i(oe),...eH(W.map(ue=>ue.route).filter(Boolean),oe)})}let a={},l=Rf(e.routes,o,void 0,a),u,d=e.basename||"/";d.startsWith("/")||(d=`/${d}`);let h=e.dataStrategy||bH,p={...e.future},g=null,y=new Set,b=null,C=null,E=null,k=e.hydrationData!=null,O=xs(l,e.history.location,d),A=!1,N=null,D;if(O==null&&!e.patchRoutesOnNavigation){let W=Vi(404,{pathname:e.history.location.pathname}),{matches:oe,route:ue}=Yp(l);D=!0,O=oe,N={[ue.id]:W}}else if(O&&!e.hydrationData&&dn(O,l,e.history.location.pathname).active&&(O=null),O)if(O.some(W=>W.route.lazy))D=!1;else if(!O.some(W=>Q1(W.route)))D=!0;else{let W=e.hydrationData?e.hydrationData.loaderData:null,oe=e.hydrationData?e.hydrationData.errors:null;if(oe){let ue=O.findIndex(Ee=>oe[Ee.route.id]!==void 0);D=O.slice(0,ue+1).every(Ee=>!dw(Ee.route,W,oe))}else D=O.every(ue=>!dw(ue.route,W,oe))}else{D=!1,O=[];let W=dn(null,l,e.history.location.pathname);W.active&&W.matches&&(A=!0,O=W.matches)}let L,T={historyAction:e.history.action,location:e.history.location,matches:O,initialized:D,navigation:K0,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||N,fetchers:new Map,blockers:new Map},I="POP",G=!1,te,fe=!1,Q=new Map,J=null,H=!1,q=!1,R=new Set,F=new Map,z=0,B=-1,U=new Map,P=new Set,j=new Map,$=new Map,K=new Set,ee=new Map,ge,ne=null;function Ce(){if(g=e.history.listen(({action:W,location:oe,delta:ue})=>{if(ge){ge(),ge=void 0;return}Ln(ee.size===0||ue!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let Ee=tt({currentLocation:T.location,nextLocation:oe,historyAction:W});if(Ee&&ue!=null){let Ne=new Promise(ze=>{ge=ze});e.history.go(ue*-1),dt(Ee,{state:"blocked",location:oe,proceed(){dt(Ee,{state:"proceeding",proceed:void 0,reset:void 0,location:oe}),Ne.then(()=>e.history.go(ue))},reset(){let ze=new Map(T.blockers);ze.set(Ee,Vd),Se({blockers:ze})}});return}return ot(W,oe)}),n){jH(t,Q);let W=()=>PH(t,Q);t.addEventListener("pagehide",W),J=()=>t.removeEventListener("pagehide",W)}return T.initialized||ot("POP",T.location,{initialHydration:!0}),L}function Te(){g&&g(),J&&J(),y.clear(),te&&te.abort(),T.fetchers.forEach((W,oe)=>Sn(oe)),T.blockers.forEach((W,oe)=>et(oe))}function ye(W){return y.add(W),()=>y.delete(W)}function Se(W,oe={}){W.matches&&(W.matches=W.matches.map(Ne=>{let ze=a[Ne.route.id],Ye=Ne.route;return Ye.element!==ze.element||Ye.errorElement!==ze.errorElement||Ye.hydrateFallbackElement!==ze.hydrateFallbackElement?{...Ne,route:ze}:Ne})),T={...T,...W};let ue=[],Ee=[];T.fetchers.forEach((Ne,ze)=>{Ne.state==="idle"&&(K.has(ze)?ue.push(ze):Ee.push(ze))}),K.forEach(Ne=>{!T.fetchers.has(Ne)&&!F.has(Ne)&&ue.push(Ne)}),[...y].forEach(Ne=>Ne(T,{deletedFetchers:ue,viewTransitionOpts:oe.viewTransitionOpts,flushSync:oe.flushSync===!0})),ue.forEach(Ne=>Sn(Ne)),Ee.forEach(Ne=>T.fetchers.delete(Ne))}function De(W,oe,{flushSync:ue}={}){let Ee=T.actionData!=null&&T.navigation.formMethod!=null&&Lr(T.navigation.formMethod)&&T.navigation.state==="loading"&&W.state?._isRedirect!==!0,Ne;oe.actionData?Object.keys(oe.actionData).length>0?Ne=oe.actionData:Ne=null:Ee?Ne=T.actionData:Ne=null;let ze=oe.loaderData?AT(T.loaderData,oe.loaderData,oe.matches||[],oe.errors):T.loaderData,Ye=T.blockers;Ye.size>0&&(Ye=new Map(Ye),Ye.forEach((Pe,Ve)=>Ye.set(Ve,Vd)));let qe=H?!1:Ht(W,oe.matches||T.matches),Ue=G===!0||T.navigation.formMethod!=null&&Lr(T.navigation.formMethod)&&W.state?._isRedirect!==!0;u&&(l=u,u=void 0),H||I==="POP"||(I==="PUSH"?e.history.push(W,W.state):I==="REPLACE"&&e.history.replace(W,W.state));let Ie;if(I==="POP"){let Pe=Q.get(T.location.pathname);Pe&&Pe.has(W.pathname)?Ie={currentLocation:T.location,nextLocation:W}:Q.has(W.pathname)&&(Ie={currentLocation:W,nextLocation:T.location})}else if(fe){let Pe=Q.get(T.location.pathname);Pe?Pe.add(W.pathname):(Pe=new Set([W.pathname]),Q.set(T.location.pathname,Pe)),Ie={currentLocation:T.location,nextLocation:W}}Se({...oe,actionData:Ne,loaderData:ze,historyAction:I,location:W,initialized:!0,navigation:K0,revalidation:"idle",restoreScrollPosition:qe,preventScrollReset:Ue,blockers:Ye},{viewTransitionOpts:Ie,flushSync:ue===!0}),I="POP",G=!1,fe=!1,H=!1,q=!1,ne?.resolve(),ne=null}async function it(W,oe){if(typeof W=="number"){e.history.go(W);return}let ue=uw(T.location,T.matches,d,W,oe?.fromRouteId,oe?.relative),{path:Ee,submission:Ne,error:ze}=xT(!1,ue,oe),Ye=T.location,qe=Df(T.location,Ee,oe&&oe.state);qe={...qe,...e.history.encodeLocation(qe)};let Ue=oe&&oe.replace!=null?oe.replace:void 0,Ie="PUSH";Ue===!0?Ie="REPLACE":Ue===!1||Ne!=null&&Lr(Ne.formMethod)&&Ne.formAction===T.location.pathname+T.location.search&&(Ie="REPLACE");let Pe=oe&&"preventScrollReset"in oe?oe.preventScrollReset===!0:void 0,Ve=(oe&&oe.flushSync)===!0,St=tt({currentLocation:Ye,nextLocation:qe,historyAction:Ie});if(St){dt(St,{state:"blocked",location:qe,proceed(){dt(St,{state:"proceeding",proceed:void 0,reset:void 0,location:qe}),it(W,oe)},reset(){let an=new Map(T.blockers);an.set(St,Vd),Se({blockers:an})}});return}await ot(Ie,qe,{submission:Ne,pendingError:ze,preventScrollReset:Pe,replace:oe&&oe.replace,enableViewTransition:oe&&oe.viewTransition,flushSync:Ve})}function yt(){ne||(ne=LH()),Re(),Se({revalidation:"loading"});let W=ne.promise;return T.navigation.state==="submitting"?W:T.navigation.state==="idle"?(ot(T.historyAction,T.location,{startUninterruptedRevalidation:!0}),W):(ot(I||T.historyAction,T.navigation.location,{overrideNavigation:T.navigation,enableViewTransition:fe===!0}),W)}async function ot(W,oe,ue){te&&te.abort(),te=null,I=W,H=(ue&&ue.startUninterruptedRevalidation)===!0,rt(T.location,T.matches),G=(ue&&ue.preventScrollReset)===!0,fe=(ue&&ue.enableViewTransition)===!0;let Ee=u||l,Ne=ue&&ue.overrideNavigation,ze=ue?.initialHydration&&T.matches&&T.matches.length>0&&!A?T.matches:xs(Ee,oe,d),Ye=(ue&&ue.flushSync)===!0;if(ze&&T.initialized&&!q&&OH(T.location,oe)&&!(ue&&ue.submission&&Lr(ue.submission.formMethod))){De(oe,{matches:ze},{flushSync:Ye});return}let qe=dn(ze,Ee,oe.pathname);if(qe.active&&qe.matches&&(ze=qe.matches),!ze){let{error:ur,notFoundMatches:Ut,route:Vt}=wt(oe.pathname);De(oe,{matches:Ut,loaderData:{},errors:{[Vt.id]:ur}},{flushSync:Ye});return}te=new AbortController;let Ue=eu(e.history,oe,te.signal,ue&&ue.submission),Ie=e.getContext?await e.getContext():new mT,Pe;if(ue&&ue.pendingError)Pe=[ws(ze).route.id,{type:"error",error:ue.pendingError}];else if(ue&&ue.submission&&Lr(ue.submission.formMethod)){let ur=await Nt(Ue,oe,ue.submission,ze,Ie,qe.active,ue&&ue.initialHydration===!0,{replace:ue.replace,flushSync:Ye});if(ur.shortCircuited)return;if(ur.pendingActionResult){let[Ut,Vt]=ur.pendingActionResult;if(bi(Vt)&&Nf(Vt.error)&&Vt.error.status===404){te=null,De(oe,{matches:ur.matches,loaderData:{},errors:{[Ut]:Vt.error}});return}}ze=ur.matches||ze,Pe=ur.pendingActionResult,Ne=Y0(oe,ue.submission),Ye=!1,qe.active=!1,Ue=eu(e.history,Ue.url,Ue.signal)}let{shortCircuited:Ve,matches:St,loaderData:an,errors:Wn}=await xt(Ue,oe,ze,Ie,qe.active,Ne,ue&&ue.submission,ue&&ue.fetcherSubmission,ue&&ue.replace,ue&&ue.initialHydration===!0,Ye,Pe);Ve||(te=null,De(oe,{matches:St||ze,...DT(Pe),loaderData:an,errors:Wn}))}async function Nt(W,oe,ue,Ee,Ne,ze,Ye,qe={}){Re();let Ue=NH(oe,ue);if(Se({navigation:Ue},{flushSync:qe.flushSync===!0}),ze){let Ve=await fn(Ee,oe.pathname,W.signal);if(Ve.type==="aborted")return{shortCircuited:!0};if(Ve.type==="error"){if(Ve.partialMatches.length===0){let{matches:an,route:Wn}=Yp(l);return{matches:an,pendingActionResult:[Wn.id,{type:"error",error:Ve.error}]}}let St=ws(Ve.partialMatches).route.id;return{matches:Ve.partialMatches,pendingActionResult:[St,{type:"error",error:Ve.error}]}}else if(Ve.matches)Ee=Ve.matches;else{let{notFoundMatches:St,error:an,route:Wn}=wt(oe.pathname);return{matches:St,pendingActionResult:[Wn.id,{type:"error",error:an}]}}}let Ie,Pe=Rm(Ee,oe);if(!Pe.route.action&&!Pe.route.lazy)Ie={type:"error",error:Vi(405,{method:W.method,pathname:oe.pathname,routeId:Pe.route.id})};else{let Ve=du(o,a,W,Ee,Pe,Ye?[]:r,Ne),St=await ie(W,Ve,Ne,null);if(Ie=St[Pe.route.id],!Ie){for(let an of Ee)if(St[an.route.id]){Ie=St[an.route.id];break}}if(W.signal.aborted)return{shortCircuited:!0}}if(bl(Ie)){let Ve;return qe&&qe.replace!=null?Ve=qe.replace:Ve=MT(Ie.response.headers.get("Location"),new URL(W.url),d)===T.location.pathname+T.location.search,await Oe(W,Ie,!0,{submission:ue,replace:Ve}),{shortCircuited:!0}}if(bi(Ie)){let Ve=ws(Ee,Pe.route.id);return(qe&&qe.replace)!==!0&&(I="PUSH"),{matches:Ee,pendingActionResult:[Ve.route.id,Ie,Pe.route.id]}}return{matches:Ee,pendingActionResult:[Pe.route.id,Ie]}}async function xt(W,oe,ue,Ee,Ne,ze,Ye,qe,Ue,Ie,Pe,Ve){let St=ze||Y0(oe,Ye),an=Ye||qe||NT(St),Wn=!H&&!Ie;if(Ne){if(Wn){let rr=Ot(Ve);Se({navigation:St,...rr!==void 0?{actionData:rr}:{}},{flushSync:Pe})}let Tt=await fn(ue,oe.pathname,W.signal);if(Tt.type==="aborted")return{shortCircuited:!0};if(Tt.type==="error"){if(Tt.partialMatches.length===0){let{matches:ea,route:ta}=Yp(l);return{matches:ea,loaderData:{},errors:{[ta.id]:Tt.error}}}let rr=ws(Tt.partialMatches).route.id;return{matches:Tt.partialMatches,loaderData:{},errors:{[rr]:Tt.error}}}else if(Tt.matches)ue=Tt.matches;else{let{error:rr,notFoundMatches:ea,route:ta}=wt(oe.pathname);return{matches:ea,loaderData:{},errors:{[ta.id]:rr}}}}let ur=u||l,{dsMatches:Ut,revalidatingFetchers:Vt}=wT(W,Ee,o,a,e.history,T,ue,an,oe,Ie?[]:r,Ie===!0,q,R,K,j,P,ur,d,e.patchRoutesOnNavigation!=null,Ve);if(B=++z,!e.dataStrategy&&!Ut.some(Tt=>Tt.shouldLoad)&&!Ut.some(Tt=>Tt.route.middleware&&Tt.route.middleware.length>0)&&Vt.length===0){let Tt=Tn();return De(oe,{matches:ue,loaderData:{},errors:Ve&&bi(Ve[1])?{[Ve[0]]:Ve[1].error}:null,...DT(Ve),...Tt?{fetchers:new Map(T.fetchers)}:{}},{flushSync:Pe}),{shortCircuited:!0}}if(Wn){let Tt={};if(!Ne){Tt.navigation=St;let rr=Ot(Ve);rr!==void 0&&(Tt.actionData=rr)}Vt.length>0&&(Tt.fetchers=zt(Vt)),Se(Tt,{flushSync:Pe})}Vt.forEach(Tt=>{en(Tt.key),Tt.controller&&F.set(Tt.key,Tt.controller)});let Wr=()=>Vt.forEach(Tt=>en(Tt.key));te&&te.signal.addEventListener("abort",Wr);let{loaderResults:Di,fetcherResults:Kr}=await he(Ut,Vt,W,Ee);if(W.signal.aborted)return{shortCircuited:!0};te&&te.signal.removeEventListener("abort",Wr),Vt.forEach(Tt=>F.delete(Tt.key));let vr=Zp(Di);if(vr)return await Oe(W,vr.result,!0,{replace:Ue}),{shortCircuited:!0};if(vr=Zp(Kr),vr)return P.add(vr.key),await Oe(W,vr.result,!0,{replace:Ue}),{shortCircuited:!0};let{loaderData:An,errors:Ia}=TT(T,ue,Di,Ve,Vt,Kr);Ie&&T.errors&&(Ia={...T.errors,...Ia});let Eo=Tn(),Ri=Bt(B),to=Eo||Ri||Vt.length>0;return{matches:ue,loaderData:An,errors:Ia,...to?{fetchers:new Map(T.fetchers)}:{}}}function Ot(W){if(W&&!bi(W[1]))return{[W[0]]:W[1].data};if(T.actionData)return Object.keys(T.actionData).length===0?null:T.actionData}function zt(W){return W.forEach(oe=>{let ue=T.fetchers.get(oe.key),Ee=qd(void 0,ue?ue.data:void 0);T.fetchers.set(oe.key,Ee)}),new Map(T.fetchers)}async function Y(W,oe,ue,Ee){en(W);let Ne=(Ee&&Ee.flushSync)===!0,ze=u||l,Ye=uw(T.location,T.matches,d,ue,oe,Ee?.relative),qe=xs(ze,Ye,d),Ue=dn(qe,ze,Ye);if(Ue.active&&Ue.matches&&(qe=Ue.matches),!qe){Ke(W,oe,Vi(404,{pathname:Ye}),{flushSync:Ne});return}let{path:Ie,submission:Pe,error:Ve}=xT(!0,Ye,Ee);if(Ve){Ke(W,oe,Ve,{flushSync:Ne});return}let St=e.getContext?await e.getContext():new mT,an=(Ee&&Ee.preventScrollReset)===!0;if(Pe&&Lr(Pe.formMethod)){await ae(W,oe,Ie,qe,St,Ue.active,Ne,an,Pe);return}j.set(W,{routeId:oe,path:Ie}),await ce(W,oe,Ie,qe,St,Ue.active,Ne,an,Pe)}async function ae(W,oe,ue,Ee,Ne,ze,Ye,qe,Ue){Re(),j.delete(W);let Ie=T.fetchers.get(W);$e(W,_H(Ue,Ie),{flushSync:Ye});let Pe=new AbortController,Ve=eu(e.history,ue,Pe.signal,Ue);if(ze){let vn=await fn(Ee,new URL(Ve.url).pathname,Ve.signal,W);if(vn.type==="aborted")return;if(vn.type==="error"){Ke(W,oe,vn.error,{flushSync:Ye});return}else if(vn.matches)Ee=vn.matches;else{Ke(W,oe,Vi(404,{pathname:ue}),{flushSync:Ye});return}}let St=Rm(Ee,ue);if(!St.route.action&&!St.route.lazy){let vn=Vi(405,{method:Ue.formMethod,pathname:ue,routeId:oe});Ke(W,oe,vn,{flushSync:Ye});return}F.set(W,Pe);let an=z,Wn=du(o,a,Ve,Ee,St,r,Ne),Ut=(await ie(Ve,Wn,Ne,W))[St.route.id];if(Ve.signal.aborted){F.get(W)===Pe&&F.delete(W);return}if(K.has(W)){if(bl(Ut)||bi(Ut)){$e(W,ka(void 0));return}}else{if(bl(Ut))if(F.delete(W),B>an){$e(W,ka(void 0));return}else return P.add(W),$e(W,qd(Ue)),Oe(Ve,Ut,!1,{fetcherSubmission:Ue,preventScrollReset:qe});if(bi(Ut)){Ke(W,oe,Ut.error);return}}let Vt=T.navigation.location||T.location,Wr=eu(e.history,Vt,Pe.signal),Di=u||l,Kr=T.navigation.state!=="idle"?xs(Di,T.navigation.location,d):T.matches;bt(Kr,"Didn't find any matches after fetcher action");let vr=++z;U.set(W,vr);let An=qd(Ue,Ut.data);T.fetchers.set(W,An);let{dsMatches:Ia,revalidatingFetchers:Eo}=wT(Wr,Ne,o,a,e.history,T,Kr,Ue,Vt,r,!1,q,R,K,j,P,Di,d,e.patchRoutesOnNavigation!=null,[St.route.id,Ut]);Eo.filter(vn=>vn.key!==W).forEach(vn=>{let na=vn.key,Ni=T.fetchers.get(na),Yr=qd(void 0,Ni?Ni.data:void 0);T.fetchers.set(na,Yr),en(na),vn.controller&&F.set(na,vn.controller)}),Se({fetchers:new Map(T.fetchers)});let Ri=()=>Eo.forEach(vn=>en(vn.key));Pe.signal.addEventListener("abort",Ri);let{loaderResults:to,fetcherResults:Tt}=await he(Ia,Eo,Wr,Ne);if(Pe.signal.aborted)return;if(Pe.signal.removeEventListener("abort",Ri),U.delete(W),F.delete(W),Eo.forEach(vn=>F.delete(vn.key)),T.fetchers.has(W)){let vn=ka(Ut.data);T.fetchers.set(W,vn)}let rr=Zp(to);if(rr)return Oe(Wr,rr.result,!1,{preventScrollReset:qe});if(rr=Zp(Tt),rr)return P.add(rr.key),Oe(Wr,rr.result,!1,{preventScrollReset:qe});let{loaderData:ea,errors:ta}=TT(T,Kr,to,void 0,Eo,Tt);Bt(vr),T.navigation.state==="loading"&&vr>B?(bt(I,"Expected pending action"),te&&te.abort(),De(T.navigation.location,{matches:Kr,loaderData:ea,errors:ta,fetchers:new Map(T.fetchers)})):(Se({errors:ta,loaderData:AT(T.loaderData,ea,Kr,ta),fetchers:new Map(T.fetchers)}),q=!1)}async function ce(W,oe,ue,Ee,Ne,ze,Ye,qe,Ue){let Ie=T.fetchers.get(W);$e(W,qd(Ue,Ie?Ie.data:void 0),{flushSync:Ye});let Pe=new AbortController,Ve=eu(e.history,ue,Pe.signal);if(ze){let Vt=await fn(Ee,new URL(Ve.url).pathname,Ve.signal,W);if(Vt.type==="aborted")return;if(Vt.type==="error"){Ke(W,oe,Vt.error,{flushSync:Ye});return}else if(Vt.matches)Ee=Vt.matches;else{Ke(W,oe,Vi(404,{pathname:ue}),{flushSync:Ye});return}}let St=Rm(Ee,ue);F.set(W,Pe);let an=z,Wn=du(o,a,Ve,Ee,St,r,Ne),Ut=(await ie(Ve,Wn,Ne,W))[St.route.id];if(F.get(W)===Pe&&F.delete(W),!Ve.signal.aborted){if(K.has(W)){$e(W,ka(void 0));return}if(bl(Ut))if(B>an){$e(W,ka(void 0));return}else{P.add(W),await Oe(Ve,Ut,!1,{preventScrollReset:qe});return}if(bi(Ut)){Ke(W,oe,Ut.error);return}$e(W,ka(Ut.data))}}async function Oe(W,oe,ue,{submission:Ee,fetcherSubmission:Ne,preventScrollReset:ze,replace:Ye}={}){oe.response.headers.has("X-Remix-Revalidate")&&(q=!0);let qe=oe.response.headers.get("Location");bt(qe,"Expected a Location header on the redirect Response"),qe=MT(qe,new URL(W.url),d);let Ue=Df(T.location,qe,{_isRedirect:!0});if(n){let Wn=!1;if(oe.response.headers.has("X-Remix-Reload-Document"))Wn=!0;else if(X1(qe)){const ur=A2(qe,!0);Wn=ur.origin!==t.location.origin||Xi(ur.pathname,d)==null}if(Wn){Ye?t.location.replace(qe):t.location.assign(qe);return}}te=null;let Ie=Ye===!0||oe.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:Pe,formAction:Ve,formEncType:St}=T.navigation;!Ee&&!Ne&&Pe&&Ve&&St&&(Ee=NT(T.navigation));let an=Ee||Ne;if(uH.has(oe.response.status)&&an&&Lr(an.formMethod))await ot(Ie,Ue,{submission:{...an,formAction:qe},preventScrollReset:ze||G,enableViewTransition:ue?fe:void 0});else{let Wn=Y0(Ue,Ee);await ot(Ie,Ue,{overrideNavigation:Wn,fetcherSubmission:Ne,preventScrollReset:ze||G,enableViewTransition:ue?fe:void 0})}}async function ie(W,oe,ue,Ee){let Ne,ze={};try{Ne=await wH(h,W,oe,Ee,ue,!1)}catch(Ye){return oe.filter(qe=>qe.shouldLoad).forEach(qe=>{ze[qe.route.id]={type:"error",error:Ye}}),ze}if(W.signal.aborted)return ze;for(let[Ye,qe]of Object.entries(Ne))if(DH(qe)){let Ue=qe.result;ze[Ye]={type:"redirect",response:kH(Ue,W,Ye,oe,d)}}else ze[Ye]=await EH(qe);return ze}async function he(W,oe,ue,Ee){let Ne=ie(ue,W,Ee,null),ze=Promise.all(oe.map(async Ue=>{if(Ue.matches&&Ue.match&&Ue.request&&Ue.controller){let Pe=(await ie(Ue.request,Ue.matches,Ee,Ue.key))[Ue.match.route.id];return{[Ue.key]:Pe}}else return Promise.resolve({[Ue.key]:{type:"error",error:Vi(404,{pathname:Ue.path})}})})),Ye=await Ne,qe=(await ze).reduce((Ue,Ie)=>Object.assign(Ue,Ie),{});return{loaderResults:Ye,fetcherResults:qe}}function Re(){q=!0,j.forEach((W,oe)=>{F.has(oe)&&R.add(oe),en(oe)})}function $e(W,oe,ue={}){T.fetchers.set(W,oe),Se({fetchers:new Map(T.fetchers)},{flushSync:(ue&&ue.flushSync)===!0})}function Ke(W,oe,ue,Ee={}){let Ne=ws(T.matches,oe);Sn(W),Se({errors:{[Ne.route.id]:ue},fetchers:new Map(T.fetchers)},{flushSync:(Ee&&Ee.flushSync)===!0})}function $t(W){return $.set(W,($.get(W)||0)+1),K.has(W)&&K.delete(W),T.fetchers.get(W)||dH}function un(W,oe){en(W,oe?.reason),$e(W,ka(null))}function Sn(W){let oe=T.fetchers.get(W);F.has(W)&&!(oe&&oe.state==="loading"&&U.has(W))&&en(W),j.delete(W),U.delete(W),P.delete(W),K.delete(W),R.delete(W),T.fetchers.delete(W)}function cr(W){let oe=($.get(W)||0)-1;oe<=0?($.delete(W),K.add(W)):$.set(W,oe),Se({fetchers:new Map(T.fetchers)})}function en(W,oe){let ue=F.get(W);ue&&(ue.abort(oe),F.delete(W))}function Ft(W){for(let oe of W){let ue=$t(oe),Ee=ka(ue.data);T.fetchers.set(oe,Ee)}}function Tn(){let W=[],oe=!1;for(let ue of P){let Ee=T.fetchers.get(ue);bt(Ee,`Expected fetcher: ${ue}`),Ee.state==="loading"&&(P.delete(ue),W.push(ue),oe=!0)}return Ft(W),oe}function Bt(W){let oe=[];for(let[ue,Ee]of U)if(Ee<W){let Ne=T.fetchers.get(ue);bt(Ne,`Expected fetcher: ${ue}`),Ne.state==="loading"&&(en(ue),U.delete(ue),oe.push(ue))}return Ft(oe),oe.length>0}function ui(W,oe){let ue=T.blockers.get(W)||Vd;return ee.get(W)!==oe&&ee.set(W,oe),ue}function et(W){T.blockers.delete(W),ee.delete(W)}function dt(W,oe){let ue=T.blockers.get(W)||Vd;bt(ue.state==="unblocked"&&oe.state==="blocked"||ue.state==="blocked"&&oe.state==="blocked"||ue.state==="blocked"&&oe.state==="proceeding"||ue.state==="blocked"&&oe.state==="unblocked"||ue.state==="proceeding"&&oe.state==="unblocked",`Invalid blocker state transition: ${ue.state} -> ${oe.state}`);let Ee=new Map(T.blockers);Ee.set(W,oe),Se({blockers:Ee})}function tt({currentLocation:W,nextLocation:oe,historyAction:ue}){if(ee.size===0)return;ee.size>1&&Ln(!1,"A router only supports one blocker at a time");let Ee=Array.from(ee.entries()),[Ne,ze]=Ee[Ee.length-1],Ye=T.blockers.get(Ne);if(!(Ye&&Ye.state==="proceeding")&&ze({currentLocation:W,nextLocation:oe,historyAction:ue}))return Ne}function wt(W){let oe=Vi(404,{pathname:W}),ue=u||l,{matches:Ee,route:Ne}=Yp(ue);return{notFoundMatches:Ee,route:Ne,error:oe}}function Cn(W,oe,ue){if(b=W,E=oe,C=ue||null,!k&&T.navigation===K0){k=!0;let Ee=Ht(T.location,T.matches);Ee!=null&&Se({restoreScrollPosition:Ee})}return()=>{b=null,E=null,C=null}}function ct(W,oe){return C&&C(W,oe.map(Ee=>P6(Ee,T.loaderData)))||W.key}function rt(W,oe){if(b&&E){let ue=ct(W,oe);b[ue]=E()}}function Ht(W,oe){if(b){let ue=ct(W,oe),Ee=b[ue];if(typeof Ee=="number")return Ee}return null}function dn(W,oe,ue){if(e.patchRoutesOnNavigation)if(W){if(Object.keys(W[0].params).length>0)return{active:!0,matches:Dm(oe,ue,d,!0)}}else return{active:!0,matches:Dm(oe,ue,d,!0)||[]};return{active:!1,matches:null}}async function fn(W,oe,ue,Ee){if(!e.patchRoutesOnNavigation)return{type:"success",matches:W};let Ne=W;for(;;){let ze=u==null,Ye=u||l,qe=a;try{await e.patchRoutesOnNavigation({signal:ue,path:oe,matches:Ne,fetcherKey:Ee,patch:(Pe,Ve)=>{ue.aborted||ST(Pe,Ve,Ye,qe,o,!1)}})}catch(Pe){return{type:"error",error:Pe,partialMatches:Ne}}finally{ze&&!ue.aborted&&(l=[...l])}if(ue.aborted)return{type:"aborted"};let Ue=xs(Ye,oe,d);if(Ue)return{type:"success",matches:Ue};let Ie=Dm(Ye,oe,d,!0);if(!Ie||Ne.length===Ie.length&&Ne.every((Pe,Ve)=>Pe.route.id===Ie[Ve].route.id))return{type:"success",matches:null};Ne=Ie}}function qr(W){a={},u=Rf(W,o,void 0,a)}function hn(W,oe,ue=!1){let Ee=u==null;ST(W,oe,u||l,a,o,ue),Ee&&(l=[...l],Se({}))}return L={get basename(){return d},get future(){return p},get state(){return T},get routes(){return l},get window(){return t},initialize:Ce,subscribe:ye,enableScrollRestoration:Cn,navigate:it,fetch:Y,revalidate:yt,createHref:W=>e.history.createHref(W),encodeLocation:W=>e.history.encodeLocation(W),getFetcher:$t,resetFetcher:un,deleteFetcher:cr,dispose:Te,getBlocker:ui,deleteBlocker:et,patchRoutes:hn,_internalFetchControllers:F,_internalSetRoutes:qr,_internalSetStateDoNotUseOrYouWillBreakYourApp(W){Se(W)}},e.unstable_instrumentations&&(L=tH(L,e.unstable_instrumentations.map(W=>W.router).filter(Boolean))),L}function mH(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function uw(e,t,n,r,i,o){let a,l;if(i){a=[];for(let d of t)if(a.push(d),d.route.id===i){l=d;break}}else a=t,l=t[t.length-1];let u=vy(r||".",yy(a),Xi(e.pathname,n)||e.pathname,o==="path");if(r==null&&(u.search=e.search,u.hash=e.hash),(r==null||r===""||r===".")&&l){let d=J1(u.search);if(l.route.index&&!d)u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index";else if(!l.route.index&&d){let h=new URLSearchParams(u.search),p=h.getAll("index");h.delete("index"),p.filter(y=>y).forEach(y=>h.append("index",y));let g=h.toString();u.search=g?`?${g}`:""}}return n!=="/"&&(u.pathname=Y6({basename:n,pathname:u.pathname})),Vo(u)}function xT(e,t,n){if(!n||!mH(n))return{path:t};if(n.formMethod&&!RH(n.formMethod))return{path:t,error:Vi(405,{method:n.formMethod})};let r=()=>({path:t,error:Vi(400,{type:"invalid-body"})}),o=(n.formMethod||"get").toUpperCase(),a=H2(t);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!Lr(o))return r();let p=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((g,[y,b])=>`${g}${y}=${b}
|
|
10
10
|
`,""):String(n.body);return{path:t,submission:{formMethod:o,formAction:a,formEncType:n.formEncType,formData:void 0,json:void 0,text:p}}}else if(n.formEncType==="application/json"){if(!Lr(o))return r();try{let p=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:o,formAction:a,formEncType:n.formEncType,formData:void 0,json:p,text:void 0}}}catch{return r()}}}bt(typeof FormData=="function","FormData is not available in this environment");let l,u;if(n.formData)l=hw(n.formData),u=n.formData;else if(n.body instanceof FormData)l=hw(n.body),u=n.body;else if(n.body instanceof URLSearchParams)l=n.body,u=OT(l);else if(n.body==null)l=new URLSearchParams,u=new FormData;else try{l=new URLSearchParams(n.body),u=OT(l)}catch{return r()}let d={formMethod:o,formAction:a,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:u,json:void 0,text:void 0};if(Lr(d.formMethod))return{path:t,submission:d};let h=Hs(t);return e&&h.search&&J1(h.search)&&l.append("index",""),h.search=`?${l}`,{path:Vo(h),submission:d}}function wT(e,t,n,r,i,o,a,l,u,d,h,p,g,y,b,C,E,k,O,A){let N=A?bi(A[1])?A[1].error:A[1].data:void 0,D=i.createURL(o.location),L=i.createURL(u),T;if(h&&o.errors){let H=Object.keys(o.errors)[0];T=a.findIndex(q=>q.route.id===H)}else if(A&&bi(A[1])){let H=A[0];T=a.findIndex(q=>q.route.id===H)-1}let I=A?A[1].statusCode:void 0,G=I&&I>=400,te={currentUrl:D,currentParams:o.matches[0]?.params||{},nextUrl:L,nextParams:a[0].params,...l,actionResult:N,actionStatus:I},fe=G1(a.map(H=>H.route.path)),Q=a.map((H,q)=>{let{route:R}=H,F=null;if(T!=null&&q>T?F=!1:R.lazy?F=!0:Q1(R)?h?F=dw(R,o.loaderData,o.errors):gH(o.loaderData,o.matches[q],H)&&(F=!0):F=!1,F!==null)return fw(n,r,e,fe,H,d,t,F);let z=G?!1:p||D.pathname+D.search===L.pathname+L.search||D.search!==L.search||yH(o.matches[q],H),B={...te,defaultShouldRevalidate:z},U=Jm(H,B);return fw(n,r,e,fe,H,d,t,U,B)}),J=[];return b.forEach((H,q)=>{if(h||!a.some($=>$.route.id===H.routeId)||y.has(q))return;let R=o.fetchers.get(q),F=R&&R.state!=="idle"&&R.data===void 0,z=xs(E,H.path,k);if(!z){if(O&&F)return;J.push({key:q,routeId:H.routeId,path:H.path,matches:null,match:null,request:null,controller:null});return}if(C.has(q))return;let B=Rm(z,H.path),U=new AbortController,P=eu(i,H.path,U.signal),j=null;if(g.has(q))g.delete(q),j=du(n,r,P,z,B,d,t);else if(F)p&&(j=du(n,r,P,z,B,d,t));else{let $={...te,defaultShouldRevalidate:G?!1:p};Jm(B,$)&&(j=du(n,r,P,z,B,d,t,$))}j&&J.push({key:q,routeId:H.routeId,path:H.path,matches:j,match:B,request:P,controller:U})}),{dsMatches:Q,revalidatingFetchers:J}}function Q1(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function dw(e,t,n){if(e.lazy)return!0;if(!Q1(e))return!1;let r=t!=null&&e.id in t,i=n!=null&&n[e.id]!==void 0;return!r&&i?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!r&&!i}function gH(e,t,n){let r=!t||n.route.id!==t.route.id,i=!e.hasOwnProperty(n.route.id);return r||i}function yH(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function Jm(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function ST(e,t,n,r,i,o){let a;if(e){let d=r[e];bt(d,`No route found to patch children into: routeId = ${e}`),d.children||(d.children=[]),a=d.children}else a=n;let l=[],u=[];if(t.forEach(d=>{let h=a.find(p=>z2(d,p));h?u.push({existingRoute:h,newRoute:d}):l.push(d)}),l.length>0){let d=Rf(l,i,[e||"_","patch",String(a?.length||"0")],r);a.push(...d)}if(o&&u.length>0)for(let d=0;d<u.length;d++){let{existingRoute:h,newRoute:p}=u[d],g=h,[y]=Rf([p],i,[],{},!0);Object.assign(g,{element:y.element?y.element:g.element,errorElement:y.errorElement?y.errorElement:g.errorElement,hydrateFallbackElement:y.hydrateFallbackElement?y.hydrateFallbackElement:g.hydrateFallbackElement})}}function z2(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children.every((n,r)=>t.children?.some(i=>z2(n,i))):!1}var CT=new WeakMap,I2=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let i=n[t.id];if(bt(i,"No route found in manifest"),!i.lazy||typeof i.lazy!="object")return;let o=i.lazy[e];if(!o)return;let a=CT.get(i);a||(a={},CT.set(i,a));let l=a[e];if(l)return l;let u=(async()=>{let d=R6(e),p=i[e]!==void 0&&e!=="hasErrorBoundary";if(d)Ln(!d,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),a[e]=Promise.resolve();else if(p)Ln(!1,`Route "${i.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let g=await o();g!=null&&(Object.assign(i,{[e]:g}),Object.assign(i,r(i)))}typeof i.lazy=="object"&&(i.lazy[e]=void 0,Object.values(i.lazy).every(g=>g===void 0)&&(i.lazy=void 0))})();return a[e]=u,u},ET=new WeakMap;function vH(e,t,n,r,i){let o=n[e.id];if(bt(o,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let h=ET.get(o);if(h)return{lazyRoutePromise:h,lazyHandlerPromise:h};let p=(async()=>{bt(typeof e.lazy=="function","No lazy route function found");let g=await e.lazy(),y={};for(let b in g){let C=g[b];if(C===void 0)continue;let E=_6(b),O=o[b]!==void 0&&b!=="hasErrorBoundary";E?Ln(!E,"Route property "+b+" is not a supported property to be returned from a lazy route function. This property will be ignored."):O?Ln(!O,`Route "${o.id}" has a static property "${b}" defined but its lazy function is also returning a value for this property. The lazy route property "${b}" will be ignored.`):y[b]=C}Object.assign(o,y),Object.assign(o,{...r(o),lazy:void 0})})();return ET.set(o,p),p.catch(()=>{}),{lazyRoutePromise:p,lazyHandlerPromise:p}}let a=Object.keys(e.lazy),l=[],u;for(let h of a){if(i&&i.includes(h))continue;let p=I2({key:h,route:e,manifest:n,mapRouteProperties:r});p&&(l.push(p),h===t&&(u=p))}let d=l.length>0?Promise.all(l).then(()=>{}):void 0;return d?.catch(()=>{}),u?.catch(()=>{}),{lazyRoutePromise:d,lazyHandlerPromise:u}}async function kT(e){let t=e.matches.filter(i=>i.shouldLoad),n={};return(await Promise.all(t.map(i=>i.resolve()))).forEach((i,o)=>{n[t[o].route.id]=i}),n}async function bH(e){return e.matches.some(t=>t.route.middleware)?$2(e,()=>kT(e)):kT(e)}function $2(e,t){return xH(e,t,r=>r,TH,n);function n(r,i,o){if(o)return Promise.resolve(Object.assign(o.value,{[i]:{type:"error",result:r}}));{let{matches:a}=e,l=Math.min(Math.max(a.findIndex(d=>d.route.id===i),0),Math.max(a.findIndex(d=>d.unstable_shouldCallHandler()),0)),u=ws(a,a[l].route.id).route.id;return Promise.resolve({[u]:{type:"error",result:r}})}}}async function xH(e,t,n,r,i){let{matches:o,request:a,params:l,context:u,unstable_pattern:d}=e,h=o.flatMap(g=>g.route.middleware?g.route.middleware.map(y=>[g.route.id,y]):[]);return await F2({request:a,params:l,context:u,unstable_pattern:d},h,t,n,r,i)}async function F2(e,t,n,r,i,o,a=0){let{request:l}=e;if(l.signal.aborted)throw l.signal.reason??new Error(`Request aborted: ${l.method} ${l.url}`);let u=t[a];if(!u)return await n();let[d,h]=u,p,g=async()=>{if(p)throw new Error("You may only call `next()` once per middleware");try{return p={value:await F2(e,t,n,r,i,o,a+1)},p.value}catch(y){return p={value:await o(y,d,p)},p.value}};try{let y=await h(e,g),b=y!=null?r(y):void 0;return i(b)?b:p?b??p.value:(p={value:await g()},p.value)}catch(y){return await o(y,d,p)}}function B2(e,t,n,r,i){let o=I2({key:"middleware",route:r.route,manifest:t,mapRouteProperties:e}),a=vH(r.route,Lr(n.method)?"action":"loader",t,e,i);return{middleware:o,route:a.lazyRoutePromise,handler:a.lazyHandlerPromise}}function fw(e,t,n,r,i,o,a,l,u=null){let d=!1,h=B2(e,t,n,i,o);return{...i,_lazyPromises:h,shouldLoad:l,unstable_shouldRevalidateArgs:u,unstable_shouldCallHandler(p){return d=!0,u?typeof p=="boolean"?Jm(i,{...u,defaultShouldRevalidate:p}):Jm(i,u):l},resolve(p){let{lazy:g,loader:y,middleware:b}=i.route,C=d||l||p&&!Lr(n.method)&&(g||y),E=b&&b.length>0&&!y&&!g;return C&&(Lr(n.method)||!E)?SH({request:n,unstable_pattern:r,match:i,lazyHandlerPromise:h?.handler,lazyRoutePromise:h?.route,handlerOverride:p,scopedContext:a}):Promise.resolve({type:"data",result:void 0})}}}function du(e,t,n,r,i,o,a,l=null){return r.map(u=>u.route.id!==i.route.id?{...u,shouldLoad:!1,unstable_shouldRevalidateArgs:l,unstable_shouldCallHandler:()=>!1,_lazyPromises:B2(e,t,n,u,o),resolve:()=>Promise.resolve({type:"data",result:void 0})}:fw(e,t,n,G1(r.map(d=>d.route.path)),u,o,a,!0,l))}async function wH(e,t,n,r,i,o){n.some(d=>d._lazyPromises?.middleware)&&await Promise.all(n.map(d=>d._lazyPromises?.middleware));let a={request:t,unstable_pattern:G1(n.map(d=>d.route.path)),params:n[0].params,context:i,matches:n},u=await e({...a,fetcherKey:r,runClientMiddleware:d=>{let h=a;return $2(h,()=>d({...h,fetcherKey:r,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(n.flatMap(d=>[d._lazyPromises?.handler,d._lazyPromises?.route]))}catch{}return u}async function SH({request:e,unstable_pattern:t,match:n,lazyHandlerPromise:r,lazyRoutePromise:i,handlerOverride:o,scopedContext:a}){let l,u,d=Lr(e.method),h=d?"action":"loader",p=g=>{let y,b=new Promise((k,O)=>y=O);u=()=>y(),e.signal.addEventListener("abort",u);let C=k=>typeof g!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${h}" [routeId: ${n.route.id}]`)):g({request:e,unstable_pattern:t,params:n.params,context:a},...k!==void 0?[k]:[]),E=(async()=>{try{return{type:"data",result:await(o?o(O=>C(O)):C())}}catch(k){return{type:"error",result:k}}})();return Promise.race([E,b])};try{let g=d?n.route.action:n.route.loader;if(r||i)if(g){let y,[b]=await Promise.all([p(g).catch(C=>{y=C}),r,i]);if(y!==void 0)throw y;l=b}else{await r;let y=d?n.route.action:n.route.loader;if(y)[l]=await Promise.all([p(y),i]);else if(h==="action"){let b=new URL(e.url),C=b.pathname+b.search;throw Vi(405,{method:e.method,pathname:C,routeId:n.route.id})}else return{type:"data",result:void 0}}else if(g)l=await p(g);else{let y=new URL(e.url),b=y.pathname+y.search;throw Vi(404,{pathname:b})}}catch(g){return{type:"error",result:g}}finally{u&&e.signal.removeEventListener("abort",u)}return l}async function CH(e){let t=e.headers.get("Content-Type");return t&&/\bapplication\/json\b/.test(t)?e.body==null?null:e.json():e.text()}async function EH(e){let{result:t,type:n}=e;if(U2(t)){let r;try{r=await CH(t)}catch(i){return{type:"error",error:i}}return n==="error"?{type:"error",error:new Qm(t.status,t.statusText,r),statusCode:t.status,headers:t.headers}:{type:"data",data:r,statusCode:t.status,headers:t.headers}}return n==="error"?RT(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:new Qm(t.init?.status||500,void 0,t.data),statusCode:Nf(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:Nf(t)?t.status:void 0}:RT(t)?{type:"data",data:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function kH(e,t,n,r,i){let o=e.headers.get("Location");if(bt(o,"Redirects returned/thrown from loaders/actions must have a Location header"),!X1(o)){let a=r.slice(0,r.findIndex(l=>l.route.id===n)+1);o=uw(new URL(t.url),a,i,o),e.headers.set("Location",o)}return e}function MT(e,t,n){if(X1(e)){let r=e,i=r.startsWith("//")?new URL(t.protocol+r):new URL(r),o=Xi(i.pathname,n)!=null;if(i.origin===t.origin&&o)return i.pathname+i.search+i.hash}return e}function eu(e,t,n,r){let i=e.createURL(H2(t)).toString(),o={signal:n};if(r&&Lr(r.formMethod)){let{formMethod:a,formEncType:l}=r;o.method=a.toUpperCase(),l==="application/json"?(o.headers=new Headers({"Content-Type":l}),o.body=JSON.stringify(r.json)):l==="text/plain"?o.body=r.text:l==="application/x-www-form-urlencoded"&&r.formData?o.body=hw(r.formData):o.body=r.formData}return new Request(i,o)}function hw(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function OT(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function MH(e,t,n,r=!1,i=!1){let o={},a=null,l,u=!1,d={},h=n&&bi(n[1])?n[1].error:void 0;return e.forEach(p=>{if(!(p.route.id in t))return;let g=p.route.id,y=t[g];if(bt(!bl(y),"Cannot handle redirect results in processLoaderData"),bi(y)){let b=y.error;if(h!==void 0&&(b=h,h=void 0),a=a||{},i)a[g]=b;else{let C=ws(e,g);a[C.route.id]==null&&(a[C.route.id]=b)}r||(o[g]=L2),u||(u=!0,l=Nf(y.error)?y.error.status:500),y.headers&&(d[g]=y.headers)}else o[g]=y.data,y.statusCode&&y.statusCode!==200&&!u&&(l=y.statusCode),y.headers&&(d[g]=y.headers)}),h!==void 0&&n&&(a={[n[0]]:h},n[2]&&(o[n[2]]=void 0)),{loaderData:o,errors:a,statusCode:l||200,loaderHeaders:d}}function TT(e,t,n,r,i,o){let{loaderData:a,errors:l}=MH(t,n,r);return i.filter(u=>!u.matches||u.matches.some(d=>d.shouldLoad)).forEach(u=>{let{key:d,match:h,controller:p}=u;if(p&&p.signal.aborted)return;let g=o[d];if(bt(g,"Did not find corresponding fetcher result"),bi(g)){let y=ws(e.matches,h?.route.id);l&&l[y.route.id]||(l={...l,[y.route.id]:g.error}),e.fetchers.delete(d)}else if(bl(g))bt(!1,"Unhandled fetcher revalidation redirect");else{let y=ka(g.data);e.fetchers.set(d,y)}}),{loaderData:a,errors:l}}function AT(e,t,n,r){let i=Object.entries(t).filter(([,o])=>o!==L2).reduce((o,[a,l])=>(o[a]=l,o),{});for(let o of n){let a=o.route.id;if(!t.hasOwnProperty(a)&&e.hasOwnProperty(a)&&o.route.loader&&(i[a]=e[a]),r&&r.hasOwnProperty(a))break}return i}function DT(e){return e?bi(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function ws(e,t){return(t?e.slice(0,e.findIndex(r=>r.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function Yp(e){let t=e.length===1?e[0]:e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function Vi(e,{pathname:t,routeId:n,method:r,type:i,message:o}={}){let a="Unknown Server Error",l="Unknown @remix-run/router error";return e===400?(a="Bad Request",r&&t&&n?l=`You made a ${r} request to "${t}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:i==="invalid-body"&&(l="Unable to encode submission body")):e===403?(a="Forbidden",l=`Route "${n}" does not match URL "${t}"`):e===404?(a="Not Found",l=`No route matches URL "${t}"`):e===405&&(a="Method Not Allowed",r&&t&&n?l=`You made a ${r.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:r&&(l=`Invalid request method "${r.toUpperCase()}"`)),new Qm(e||500,a,new Error(l),!0)}function Zp(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[r,i]=t[n];if(bl(i))return{key:r,result:i}}}function H2(e){let t=typeof e=="string"?Hs(e):e;return Vo({...t,hash:""})}function OH(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function TH(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([t,n])=>typeof t=="string"&&AH(n))}function AH(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function DH(e){return U2(e.result)&&cH.has(e.result.status)}function bi(e){return e.type==="error"}function bl(e){return(e&&e.type)==="redirect"}function RT(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function U2(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function RH(e){return lH.has(e.toUpperCase())}function Lr(e){return aH.has(e.toUpperCase())}function J1(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Rm(e,t){let n=typeof t=="string"?Hs(t).search:t.search;if(e[e.length-1].route.index&&J1(n||""))return e[e.length-1];let r=N2(e);return r[r.length-1]}function NT(e){let{formMethod:t,formAction:n,formEncType:r,text:i,formData:o,json:a}=e;if(!(!t||!n||!r)){if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:i};if(o!=null)return{formMethod:t,formAction:n,formEncType:r,formData:o,json:void 0,text:void 0};if(a!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:a,text:void 0}}}function Y0(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function NH(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function qd(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function _H(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function ka(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function jH(e,t){try{let n=e.sessionStorage.getItem(P2);if(n){let r=JSON.parse(n);for(let[i,o]of Object.entries(r||{}))o&&Array.isArray(o)&&t.set(i,new Set(o||[]))}}catch{}}function PH(e,t){if(t.size>0){let n={};for(let[r,i]of t)n[r]=[...i];try{e.sessionStorage.setItem(P2,JSON.stringify(n))}catch(r){Ln(!1,`Failed to save applied view transitions in sessionStorage (${r}).`)}}}function LH(){let e,t,n=new Promise((r,i)=>{e=async o=>{r(o);try{await n}catch{}},t=async o=>{i(o);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var Xl=w.createContext(null);Xl.displayName="DataRouter";var ih=w.createContext(null);ih.displayName="DataRouterState";w.createContext(!1);var eS=w.createContext({isTransitioning:!1});eS.displayName="ViewTransition";var V2=w.createContext(new Map);V2.displayName="Fetchers";var zH=w.createContext(null);zH.displayName="Await";var vo=w.createContext(null);vo.displayName="Navigation";var by=w.createContext(null);by.displayName="Location";var Ji=w.createContext({outlet:null,matches:[],isDataRoute:!1});Ji.displayName="Route";var tS=w.createContext(null);tS.displayName="RouteError";function IH(e,{relative:t}={}){bt(Lu(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=w.useContext(vo),{hash:i,pathname:o,search:a}=oh(e,{relative:t}),l=o;return n!=="/"&&(l=o==="/"?n:Ho([n,o])),r.createHref({pathname:l,search:a,hash:i})}function Lu(){return w.useContext(by)!=null}function bo(){return bt(Lu(),"useLocation() may be used only in the context of a <Router> component."),w.useContext(by).location}var q2="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function W2(e){w.useContext(vo).static||w.useLayoutEffect(e)}function zu(){let{isDataRoute:e}=w.useContext(Ji);return e?JH():$H()}function $H(){bt(Lu(),"useNavigate() may be used only in the context of a <Router> component.");let e=w.useContext(Xl),{basename:t,navigator:n}=w.useContext(vo),{matches:r}=w.useContext(Ji),{pathname:i}=bo(),o=JSON.stringify(yy(r)),a=w.useRef(!1);return W2(()=>{a.current=!0}),w.useCallback((u,d={})=>{if(Ln(a.current,q2),!a.current)return;if(typeof u=="number"){n.go(u);return}let h=vy(u,JSON.parse(o),i,d.relative==="path");e==null&&t!=="/"&&(h.pathname=h.pathname==="/"?t:Ho([t,h.pathname])),(d.replace?n.replace:n.push)(h,d.state,d)},[t,n,o,i,e])}var FH=w.createContext(null);function BH(e){let t=w.useContext(Ji).outlet;return w.useMemo(()=>t&&w.createElement(FH.Provider,{value:e},t),[t,e])}function K2(){let{matches:e}=w.useContext(Ji),t=e[e.length-1];return t?t.params:{}}function oh(e,{relative:t}={}){let{matches:n}=w.useContext(Ji),{pathname:r}=bo(),i=JSON.stringify(yy(n));return w.useMemo(()=>vy(e,JSON.parse(i),r,t==="path"),[e,i,r,t])}function HH(e,t,n,r,i){bt(Lu(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:o}=w.useContext(vo),{matches:a}=w.useContext(Ji),l=a[a.length-1],u=l?l.params:{},d=l?l.pathname:"/",h=l?l.pathnameBase:"/",p=l&&l.route;{let O=p&&p.path||"";Y2(d,!p||O.endsWith("*")||O.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${d}" (under <Route path="${O}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
11
11
|
|
|
12
|
-
Please change the parent <Route path="${O}"> to <Route path="${O==="/"?"*":`${O}/*`}">.`)}let g=bo(),y;y=g;let b=y.pathname||"/",C=b;if(h!=="/"){let O=h.replace(/^\//,"").split("/");C="/"+b.replace(/^\//,"").split("/").slice(O.length).join("/")}let E=xs(e,{pathname:C});return Ln(p||E!=null,`No routes matched location "${y.pathname}${y.search}${y.hash}" `),Ln(E==null||E[E.length-1].route.element!==void 0||E[E.length-1].route.Component!==void 0||E[E.length-1].route.lazy!==void 0,`Matched leaf route at location "${y.pathname}${y.search}${y.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`),KH(E&&E.map(O=>Object.assign({},O,{params:Object.assign({},u,O.params),pathname:Ho([h,o.encodeLocation?o.encodeLocation(O.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:O.pathname]),pathnameBase:O.pathnameBase==="/"?h:Ho([h,o.encodeLocation?o.encodeLocation(O.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:O.pathnameBase])})),a,n,r,i)}function UH(){let e=QH(),t=Nf(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",i={padding:"0.5rem",backgroundColor:r},o={padding:"2px 4px",backgroundColor:r},a=null;return console.error("Error handled by React Router default ErrorBoundary:",e),a=w.createElement(w.Fragment,null,w.createElement("p",null,"💿 Hey developer 👋"),w.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",w.createElement("code",{style:o},"ErrorBoundary")," or"," ",w.createElement("code",{style:o},"errorElement")," prop on your route.")),w.createElement(w.Fragment,null,w.createElement("h2",null,"Unexpected Application Error!"),w.createElement("h3",{style:{fontStyle:"italic"}},t),n?w.createElement("pre",{style:i},n):null,a)}var VH=w.createElement(UH,null),qH=class extends w.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.unstable_onError?this.props.unstable_onError(e,t):console.error("React Router caught the following error during render",e)}render(){return this.state.error!==void 0?w.createElement(Ji.Provider,{value:this.props.routeContext},w.createElement(tS.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function WH({routeContext:e,match:t,children:n}){let r=w.useContext(Xl);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),w.createElement(Ji.Provider,{value:e},n)}function KH(e,t=[],n=null,r=null,i=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,a=n?.errors;if(a!=null){let d=o.findIndex(h=>h.route.id&&a?.[h.route.id]!==void 0);bt(d>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(",")}`),o=o.slice(0,Math.min(o.length,d+1))}let l=!1,u=-1;if(n)for(let d=0;d<o.length;d++){let h=o[d];if((h.route.HydrateFallback||h.route.hydrateFallbackElement)&&(u=d),h.route.id){let{loaderData:p,errors:g}=n,y=h.route.loader&&!p.hasOwnProperty(h.route.id)&&(!g||g[h.route.id]===void 0);if(h.route.lazy||y){l=!0,u>=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((d,h,p)=>{let g,y=!1,b=null,C=null;n&&(g=a&&h.route.id?a[h.route.id]:void 0,b=h.route.errorElement||VH,l&&(u<0&&p===0?(Y2("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),y=!0,C=null):u===p&&(y=!0,C=h.route.hydrateFallbackElement||null)));let E=t.concat(o.slice(0,p+1)),k=()=>{let O;return g?O=b:y?O=C:h.route.Component?O=w.createElement(h.route.Component,null):h.route.element?O=h.route.element:O=d,w.createElement(WH,{match:h,routeContext:{outlet:d,matches:E,isDataRoute:n!=null},children:O})};return n&&(h.route.ErrorBoundary||h.route.errorElement||p===0)?w.createElement(qH,{location:n.location,revalidation:n.revalidation,component:b,error:g,children:k(),routeContext:{outlet:null,matches:E,isDataRoute:!0},unstable_onError:r}):k()},null)}function nS(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function YH(e){let t=w.useContext(Xl);return bt(t,nS(e)),t}function ZH(e){let t=w.useContext(ih);return bt(t,nS(e)),t}function GH(e){let t=w.useContext(Ji);return bt(t,nS(e)),t}function rS(e){let t=GH(e),n=t.matches[t.matches.length-1];return bt(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function XH(){return rS("useRouteId")}function QH(){let e=w.useContext(tS),t=ZH("useRouteError"),n=rS("useRouteError");return e!==void 0?e:t.errors?.[n]}function JH(){let{router:e}=YH("useNavigate"),t=rS("useNavigate"),n=w.useRef(!1);return W2(()=>{n.current=!0}),w.useCallback(async(i,o={})=>{Ln(n.current,q2),n.current&&(typeof i=="number"?e.navigate(i):await e.navigate(i,{fromRouteId:t,...o}))},[e,t])}var _T={};function Y2(e,t,n){!t&&!_T[e]&&(_T[e]=!0,Ln(!1,n))}var jT={};function PT(e,t){!e&&!jT[t]&&(jT[t]=!0,console.warn(t))}function e8(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&Ln(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:w.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&Ln(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:w.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&Ln(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:w.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var t8=["HydrateFallback","hydrateFallbackElement"],n8=class{constructor(){this.status="pending",this.promise=new Promise((e,t)=>{this.resolve=n=>{this.status==="pending"&&(this.status="resolved",e(n))},this.reject=n=>{this.status==="pending"&&(this.status="rejected",t(n))}})}};function r8({router:e,flushSync:t,unstable_onError:n}){let[r,i]=w.useState(e.state),[o,a]=w.useState(),[l,u]=w.useState({isTransitioning:!1}),[d,h]=w.useState(),[p,g]=w.useState(),[y,b]=w.useState(),C=w.useRef(new Map),E=w.useCallback(D=>{i(L=>(D.errors&&n&&Object.entries(D.errors).forEach(([T,I])=>{L.errors?.[T]!==I&&n(I)}),D))},[n]),k=w.useCallback((D,{deletedFetchers:L,flushSync:T,viewTransitionOpts:I})=>{D.fetchers.forEach((te,fe)=>{te.data!==void 0&&C.current.set(fe,te.data)}),L.forEach(te=>C.current.delete(te)),PT(T===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let G=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(PT(I==null||G,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!I||!G){t&&T?t(()=>E(D)):w.startTransition(()=>E(D));return}if(t&&T){t(()=>{p&&(d&&d.resolve(),p.skipTransition()),u({isTransitioning:!0,flushSync:!0,currentLocation:I.currentLocation,nextLocation:I.nextLocation})});let te=e.window.document.startViewTransition(()=>{t(()=>E(D))});te.finished.finally(()=>{t(()=>{h(void 0),g(void 0),a(void 0),u({isTransitioning:!1})})}),t(()=>g(te));return}p?(d&&d.resolve(),p.skipTransition(),b({state:D,currentLocation:I.currentLocation,nextLocation:I.nextLocation})):(a(D),u({isTransitioning:!0,flushSync:!1,currentLocation:I.currentLocation,nextLocation:I.nextLocation}))},[e.window,t,p,d,E]);w.useLayoutEffect(()=>e.subscribe(k),[e,k]),w.useEffect(()=>{l.isTransitioning&&!l.flushSync&&h(new n8)},[l]),w.useEffect(()=>{if(d&&o&&e.window){let D=o,L=d.promise,T=e.window.document.startViewTransition(async()=>{w.startTransition(()=>E(D)),await L});T.finished.finally(()=>{h(void 0),g(void 0),a(void 0),u({isTransitioning:!1})}),g(T)}},[o,d,e.window,E]),w.useEffect(()=>{d&&o&&r.location.key===o.location.key&&d.resolve()},[d,p,r.location,o]),w.useEffect(()=>{!l.isTransitioning&&y&&(a(y.state),u({isTransitioning:!0,flushSync:!1,currentLocation:y.currentLocation,nextLocation:y.nextLocation}),b(void 0))},[l.isTransitioning,y]);let O=w.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:D=>e.navigate(D),push:(D,L,T)=>e.navigate(D,{state:L,preventScrollReset:T?.preventScrollReset}),replace:(D,L,T)=>e.navigate(D,{replace:!0,state:L,preventScrollReset:T?.preventScrollReset})}),[e]),A=e.basename||"/",N=w.useMemo(()=>({router:e,navigator:O,static:!1,basename:A,unstable_onError:n}),[e,O,A,n]);return w.createElement(w.Fragment,null,w.createElement(Xl.Provider,{value:N},w.createElement(ih.Provider,{value:r},w.createElement(V2.Provider,{value:C.current},w.createElement(eS.Provider,{value:l},w.createElement(s8,{basename:A,location:r.location,navigationType:r.historyAction,navigator:O},w.createElement(i8,{routes:e.routes,future:e.future,state:r,unstable_onError:n})))))),null)}var i8=w.memo(o8);function o8({routes:e,future:t,state:n,unstable_onError:r}){return HH(e,void 0,n,r,t)}function a8({to:e,replace:t,state:n,relative:r}){bt(Lu(),"<Navigate> may be used only in the context of a <Router> component.");let{static:i}=w.useContext(vo);Ln(!i,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:o}=w.useContext(Ji),{pathname:a}=bo(),l=zu(),u=vy(e,yy(o),a,r==="path"),d=JSON.stringify(u);return w.useEffect(()=>{l(JSON.parse(d),{replace:t,state:n,relative:r})},[l,d,r,t,n]),null}function ah(e){return BH(e.context)}function s8({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:i,static:o=!1}){bt(!Lu(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let a=e.replace(/^\/*/,"/"),l=w.useMemo(()=>({basename:a,navigator:i,static:o,future:{}}),[a,i,o]);typeof n=="string"&&(n=Hs(n));let{pathname:u="/",search:d="",hash:h="",state:p=null,key:g="default"}=n,y=w.useMemo(()=>{let b=Xi(u,a);return b==null?null:{location:{pathname:b,search:d,hash:h,state:p,key:g},navigationType:r}},[a,u,d,h,p,g,r]);return Ln(y!=null,`<Router basename="${a}"> is not able to match the URL "${u}${d}${h}" because it does not start with the basename, so the <Router> won't render anything.`),y==null?null:w.createElement(vo.Provider,{value:l},w.createElement(by.Provider,{children:t,value:y}))}var Nm="get",_m="application/x-www-form-urlencoded";function xy(e){return e!=null&&typeof e.tagName=="string"}function l8(e){return xy(e)&&e.tagName.toLowerCase()==="button"}function c8(e){return xy(e)&&e.tagName.toLowerCase()==="form"}function u8(e){return xy(e)&&e.tagName.toLowerCase()==="input"}function d8(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function f8(e,t){return e.button===0&&(!t||t==="_self")&&!d8(e)}function pw(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(i=>[n,i]):[[n,r]])},[]))}function h8(e,t){let n=pw(e);return t&&t.forEach((r,i)=>{n.has(i)||t.getAll(i).forEach(o=>{n.append(i,o)})}),n}var Gp=null;function p8(){if(Gp===null)try{new FormData(document.createElement("form"),0),Gp=!1}catch{Gp=!0}return Gp}var m8=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Z0(e){return e!=null&&!m8.has(e)?(Ln(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${_m}"`),null):e}function g8(e,t){let n,r,i,o,a;if(c8(e)){let l=e.getAttribute("action");r=l?Xi(l,t):null,n=e.getAttribute("method")||Nm,i=Z0(e.getAttribute("enctype"))||_m,o=new FormData(e)}else if(l8(e)||u8(e)&&(e.type==="submit"||e.type==="image")){let l=e.form;if(l==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let u=e.getAttribute("formaction")||l.getAttribute("action");if(r=u?Xi(u,t):null,n=e.getAttribute("formmethod")||l.getAttribute("method")||Nm,i=Z0(e.getAttribute("formenctype"))||Z0(l.getAttribute("enctype"))||_m,o=new FormData(l,e),!p8()){let{name:d,type:h,value:p}=e;if(h==="image"){let g=d?`${d}.`:"";o.append(`${g}x`,"0"),o.append(`${g}y`,"0")}else d&&o.append(d,p)}}else{if(xy(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Nm,r=null,i=_m,a=e}return o&&i==="text/plain"&&(a=o,o=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:o,body:a}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function iS(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function y8(e,t,n){let r=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r.pathname==="/"?r.pathname=`_root.${n}`:t&&Xi(r.pathname,t)==="/"?r.pathname=`${t.replace(/\/$/,"")}/_root.${n}`:r.pathname=`${r.pathname.replace(/\/$/,"")}.${n}`,r}async function v8(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function b8(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function x8(e,t,n){let r=await Promise.all(e.map(async i=>{let o=t.routes[i.route.id];if(o){let a=await v8(o,n);return a.links?a.links():[]}return[]}));return E8(r.flat(1).filter(b8).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function LT(e,t,n,r,i,o){let a=(u,d)=>n[d]?u.route.id!==n[d].route.id:!0,l=(u,d)=>n[d].pathname!==u.pathname||n[d].route.path?.endsWith("*")&&n[d].params["*"]!==u.params["*"];return o==="assets"?t.filter((u,d)=>a(u,d)||l(u,d)):o==="data"?t.filter((u,d)=>{let h=r.routes[u.route.id];if(!h||!h.hasLoader)return!1;if(a(u,d)||l(u,d))return!0;if(u.route.shouldRevalidate){let p=u.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:u.params,defaultShouldRevalidate:!0});if(typeof p=="boolean")return p}return!0}):[]}function w8(e,t,{includeHydrateFallback:n}={}){return S8(e.map(r=>{let i=t.routes[r.route.id];if(!i)return[];let o=[i.module];return i.clientActionModule&&(o=o.concat(i.clientActionModule)),i.clientLoaderModule&&(o=o.concat(i.clientLoaderModule)),n&&i.hydrateFallbackModule&&(o=o.concat(i.hydrateFallbackModule)),i.imports&&(o=o.concat(i.imports)),o}).flat(1))}function S8(e){return[...new Set(e)]}function C8(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function E8(e,t){let n=new Set;return new Set(t),e.reduce((r,i)=>{let o=JSON.stringify(C8(i));return n.has(o)||(n.add(o),r.push({key:o,link:i})),r},[])}function Z2(){let e=w.useContext(Xl);return iS(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function k8(){let e=w.useContext(ih);return iS(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var oS=w.createContext(void 0);oS.displayName="FrameworkContext";function G2(){let e=w.useContext(oS);return iS(e,"You must render this element inside a <HydratedRouter> element"),e}function M8(e,t){let n=w.useContext(oS),[r,i]=w.useState(!1),[o,a]=w.useState(!1),{onFocus:l,onBlur:u,onMouseEnter:d,onMouseLeave:h,onTouchStart:p}=t,g=w.useRef(null);w.useEffect(()=>{if(e==="render"&&a(!0),e==="viewport"){let C=k=>{k.forEach(O=>{a(O.isIntersecting)})},E=new IntersectionObserver(C,{threshold:.5});return g.current&&E.observe(g.current),()=>{E.disconnect()}}},[e]),w.useEffect(()=>{if(r){let C=setTimeout(()=>{a(!0)},100);return()=>{clearTimeout(C)}}},[r]);let y=()=>{i(!0)},b=()=>{i(!1),a(!1)};return n?e!=="intent"?[o,g,{}]:[o,g,{onFocus:Wd(l,y),onBlur:Wd(u,b),onMouseEnter:Wd(d,y),onMouseLeave:Wd(h,b),onTouchStart:Wd(p,y)}]:[!1,g,{}]}function Wd(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function O8({page:e,...t}){let{router:n}=Z2(),r=w.useMemo(()=>xs(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?w.createElement(A8,{page:e,matches:r,...t}):null}function T8(e){let{manifest:t,routeModules:n}=G2(),[r,i]=w.useState([]);return w.useEffect(()=>{let o=!1;return x8(e,t,n).then(a=>{o||i(a)}),()=>{o=!0}},[e,t,n]),r}function A8({page:e,matches:t,...n}){let r=bo(),{manifest:i,routeModules:o}=G2(),{basename:a}=Z2(),{loaderData:l,matches:u}=k8(),d=w.useMemo(()=>LT(e,t,u,i,r,"data"),[e,t,u,i,r]),h=w.useMemo(()=>LT(e,t,u,i,r,"assets"),[e,t,u,i,r]),p=w.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let b=new Set,C=!1;if(t.forEach(k=>{let O=i.routes[k.route.id];!O||!O.hasLoader||(!d.some(A=>A.route.id===k.route.id)&&k.route.id in l&&o[k.route.id]?.shouldRevalidate||O.hasClientLoader?C=!0:b.add(k.route.id))}),b.size===0)return[];let E=y8(e,a,"data");return C&&b.size>0&&E.searchParams.set("_routes",t.filter(k=>b.has(k.route.id)).map(k=>k.route.id).join(",")),[E.pathname+E.search]},[a,l,r,i,d,t,e,o]),g=w.useMemo(()=>w8(h,i),[h,i]),y=T8(h);return w.createElement(w.Fragment,null,p.map(b=>w.createElement("link",{key:b,rel:"prefetch",as:"fetch",href:b,...n})),g.map(b=>w.createElement("link",{key:b,rel:"modulepreload",href:b,...n})),y.map(({key:b,link:C})=>w.createElement("link",{key:b,nonce:n.nonce,...C})))}function D8(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var X2=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{X2&&(window.__reactRouterVersion="7.9.5")}catch{}function R8(e,t){return pH({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:O6({window:t?.window}),hydrationData:N8(),routes:e,mapRouteProperties:e8,hydrationRouteProperties:t8,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,unstable_instrumentations:t?.unstable_instrumentations}).initialize()}function N8(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:_8(e.errors)}),e}function _8(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,i]of t)if(i&&i.__type==="RouteErrorResponse")n[r]=new Qm(i.status,i.statusText,i.data,i.internal===!0);else if(i&&i.__type==="Error"){if(i.__subType){let o=window[i.__subType];if(typeof o=="function")try{let a=new o(i.message);a.stack="",n[r]=a}catch{}}if(n[r]==null){let o=new Error(i.message);o.stack="",n[r]=o}}else n[r]=i;return n}var Q2=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Iu=w.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:i,reloadDocument:o,replace:a,state:l,target:u,to:d,preventScrollReset:h,viewTransition:p,...g},y){let{basename:b}=w.useContext(vo),C=typeof d=="string"&&Q2.test(d),E,k=!1;if(typeof d=="string"&&C&&(E=d,X2))try{let G=new URL(window.location.href),te=d.startsWith("//")?new URL(G.protocol+d):new URL(d),fe=Xi(te.pathname,b);te.origin===G.origin&&fe!=null?d=fe+te.search+te.hash:k=!0}catch{Ln(!1,`<Link to="${d}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let O=IH(d,{relative:i}),[A,N,D]=M8(r,g),L=z8(d,{replace:a,state:l,target:u,preventScrollReset:h,relative:i,viewTransition:p});function T(G){t&&t(G),G.defaultPrevented||L(G)}let I=w.createElement("a",{...g,...D,href:E||O,onClick:k||o?t:T,ref:D8(y,N),target:u,"data-discover":!C&&n==="render"?"true":void 0});return A&&!C?w.createElement(w.Fragment,null,I,w.createElement(O8,{page:O})):I});Iu.displayName="Link";var j8=w.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:i=!1,style:o,to:a,viewTransition:l,children:u,...d},h){let p=oh(a,{relative:d.relative}),g=bo(),y=w.useContext(ih),{navigator:b,basename:C}=w.useContext(vo),E=y!=null&&H8(p)&&l===!0,k=b.encodeLocation?b.encodeLocation(p).pathname:p.pathname,O=g.pathname,A=y&&y.navigation&&y.navigation.location?y.navigation.location.pathname:null;n||(O=O.toLowerCase(),A=A?A.toLowerCase():null,k=k.toLowerCase()),A&&C&&(A=Xi(A,C)||A);const N=k!=="/"&&k.endsWith("/")?k.length-1:k.length;let D=O===k||!i&&O.startsWith(k)&&O.charAt(N)==="/",L=A!=null&&(A===k||!i&&A.startsWith(k)&&A.charAt(k.length)==="/"),T={isActive:D,isPending:L,isTransitioning:E},I=D?t:void 0,G;typeof r=="function"?G=r(T):G=[r,D?"active":null,L?"pending":null,E?"transitioning":null].filter(Boolean).join(" ");let te=typeof o=="function"?o(T):o;return w.createElement(Iu,{...d,"aria-current":I,className:G,ref:h,style:te,to:a,viewTransition:l},typeof u=="function"?u(T):u)});j8.displayName="NavLink";var P8=w.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:o,method:a=Nm,action:l,onSubmit:u,relative:d,preventScrollReset:h,viewTransition:p,...g},y)=>{let b=F8(),C=B8(l,{relative:d}),E=a.toLowerCase()==="get"?"get":"post",k=typeof l=="string"&&Q2.test(l),O=A=>{if(u&&u(A),A.defaultPrevented)return;A.preventDefault();let N=A.nativeEvent.submitter,D=N?.getAttribute("formmethod")||a;b(N||A.currentTarget,{fetcherKey:t,method:D,navigate:n,replace:i,state:o,relative:d,preventScrollReset:h,viewTransition:p})};return w.createElement("form",{ref:y,method:E,action:C,onSubmit:r?u:O,...g,"data-discover":!k&&e==="render"?"true":void 0})});P8.displayName="Form";function L8(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function J2(e){let t=w.useContext(Xl);return bt(t,L8(e)),t}function z8(e,{target:t,replace:n,state:r,preventScrollReset:i,relative:o,viewTransition:a}={}){let l=zu(),u=bo(),d=oh(e,{relative:o});return w.useCallback(h=>{if(f8(h,t)){h.preventDefault();let p=n!==void 0?n:Vo(u)===Vo(d);l(e,{replace:p,state:r,preventScrollReset:i,relative:o,viewTransition:a})}},[u,l,d,n,r,t,e,i,o,a])}function aS(e){Ln(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=w.useRef(pw(e)),n=w.useRef(!1),r=bo(),i=w.useMemo(()=>h8(r.search,n.current?null:t.current),[r.search]),o=zu(),a=w.useCallback((l,u)=>{const d=pw(typeof l=="function"?l(new URLSearchParams(i)):l);n.current=!0,o("?"+d,u)},[o,i]);return[i,a]}var I8=0,$8=()=>`__${String(++I8)}__`;function F8(){let{router:e}=J2("useSubmit"),{basename:t}=w.useContext(vo),n=XH();return w.useCallback(async(r,i={})=>{let{action:o,method:a,encType:l,formData:u,body:d}=g8(r,t);if(i.navigate===!1){let h=i.fetcherKey||$8();await e.fetch(h,n,i.action||o,{preventScrollReset:i.preventScrollReset,formData:u,body:d,formMethod:i.method||a,formEncType:i.encType||l,flushSync:i.flushSync})}else await e.navigate(i.action||o,{preventScrollReset:i.preventScrollReset,formData:u,body:d,formMethod:i.method||a,formEncType:i.encType||l,replace:i.replace,state:i.state,fromRouteId:n,flushSync:i.flushSync,viewTransition:i.viewTransition})},[e,t,n])}function B8(e,{relative:t}={}){let{basename:n}=w.useContext(vo),r=w.useContext(Ji);bt(r,"useFormAction must be used inside a RouteContext");let[i]=r.matches.slice(-1),o={...oh(e||".",{relative:t})},a=bo();if(e==null){o.search=a.search;let l=new URLSearchParams(o.search),u=l.getAll("index");if(u.some(h=>h==="")){l.delete("index"),u.filter(p=>p).forEach(p=>l.append("index",p));let h=l.toString();o.search=h?`?${h}`:""}}return(!e||e===".")&&i.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(o.pathname=o.pathname==="/"?n:Ho([n,o.pathname])),Vo(o)}function H8(e,{relative:t}={}){let n=w.useContext(eS);bt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=J2("useViewTransitionState"),i=oh(e,{relative:t});if(!n.isTransitioning)return!1;let o=Xi(n.currentLocation.pathname,r)||n.currentLocation.pathname,a=Xi(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Xm(i.pathname,a)!=null||Xm(i.pathname,o)!=null}const at=e=>typeof e=="string",Kd=()=>{let e,t;const n=new Promise((r,i)=>{e=r,t=i});return n.resolve=e,n.reject=t,n},zT=e=>e==null?"":""+e,U8=(e,t,n)=>{e.forEach(r=>{t[r]&&(n[r]=t[r])})},V8=/###/g,IT=e=>e&&e.indexOf("###")>-1?e.replace(V8,"."):e,$T=e=>!e||at(e),gf=(e,t,n)=>{const r=at(t)?t.split("."):t;let i=0;for(;i<r.length-1;){if($T(e))return{};const o=IT(r[i]);!e[o]&&n&&(e[o]=new n),Object.prototype.hasOwnProperty.call(e,o)?e=e[o]:e={},++i}return $T(e)?{}:{obj:e,k:IT(r[i])}},FT=(e,t,n)=>{const{obj:r,k:i}=gf(e,t,Object);if(r!==void 0||t.length===1){r[i]=n;return}let o=t[t.length-1],a=t.slice(0,t.length-1),l=gf(e,a,Object);for(;l.obj===void 0&&a.length;)o=`${a[a.length-1]}.${o}`,a=a.slice(0,a.length-1),l=gf(e,a,Object),l?.obj&&typeof l.obj[`${l.k}.${o}`]<"u"&&(l.obj=void 0);l.obj[`${l.k}.${o}`]=n},q8=(e,t,n,r)=>{const{obj:i,k:o}=gf(e,t,Object);i[o]=i[o]||[],i[o].push(n)},eg=(e,t)=>{const{obj:n,k:r}=gf(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},W8=(e,t,n)=>{const r=eg(e,n);return r!==void 0?r:eg(t,n)},e_=(e,t,n)=>{for(const r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?at(e[r])||e[r]instanceof String||at(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):e_(e[r],t[r],n):e[r]=t[r]);return e},Fc=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var K8={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const Y8=e=>at(e)?e.replace(/[&<>"'\/]/g,t=>K8[t]):e;class Z8{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const n=this.regExpMap.get(t);if(n!==void 0)return n;const r=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,r),this.regExpQueue.push(t),r}}const G8=[" ",",","?","!",";"],X8=new Z8(20),Q8=(e,t,n)=>{t=t||"",n=n||"";const r=G8.filter(a=>t.indexOf(a)<0&&n.indexOf(a)<0);if(r.length===0)return!0;const i=X8.getRegExp(`(${r.map(a=>a==="?"?"\\?":a).join("|")})`);let o=!i.test(e);if(!o){const a=e.indexOf(n);a>0&&!i.test(e.substring(0,a))&&(o=!0)}return o},mw=(e,t,n=".")=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;const r=t.split(n);let i=e;for(let o=0;o<r.length;){if(!i||typeof i!="object")return;let a,l="";for(let u=o;u<r.length;++u)if(u!==o&&(l+=n),l+=r[u],a=i[l],a!==void 0){if(["string","number","boolean"].indexOf(typeof a)>-1&&u<r.length-1)continue;o+=u-o+1;break}i=a}return i},_f=e=>e?.replace("_","-"),J8={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console?.[e]?.apply?.(console,t)}};class tg{constructor(t,n={}){this.init(t,n)}init(t,n={}){this.prefix=n.prefix||"i18next:",this.logger=t||J8,this.options=n,this.debug=n.debug}log(...t){return this.forward(t,"log","",!0)}warn(...t){return this.forward(t,"warn","",!0)}error(...t){return this.forward(t,"error","")}deprecate(...t){return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(t,n,r,i){return i&&!this.debug?null:(at(t[0])&&(t[0]=`${r}${this.prefix} ${t[0]}`),this.logger[n](t))}create(t){return new tg(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new tg(this.logger,t)}}var Io=new tg;let wy=class{constructor(){this.observers={}}on(t,n){return t.split(" ").forEach(r=>{this.observers[r]||(this.observers[r]=new Map);const i=this.observers[r].get(n)||0;this.observers[r].set(n,i+1)}),this}off(t,n){if(this.observers[t]){if(!n){delete this.observers[t];return}this.observers[t].delete(n)}}emit(t,...n){this.observers[t]&&Array.from(this.observers[t].entries()).forEach(([i,o])=>{for(let a=0;a<o;a++)i(...n)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([i,o])=>{for(let a=0;a<o;a++)i.apply(i,[t,...n])})}};class BT extends wy{constructor(t,n={ns:["translation"],defaultNS:"translation"}){super(),this.data=t||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const n=this.options.ns.indexOf(t);n>-1&&this.options.ns.splice(n,1)}getResource(t,n,r,i={}){const o=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,a=i.ignoreJSONStructure!==void 0?i.ignoreJSONStructure:this.options.ignoreJSONStructure;let l;t.indexOf(".")>-1?l=t.split("."):(l=[t,n],r&&(Array.isArray(r)?l.push(...r):at(r)&&o?l.push(...r.split(o)):l.push(r)));const u=eg(this.data,l);return!u&&!n&&!r&&t.indexOf(".")>-1&&(t=l[0],n=l[1],r=l.slice(2).join(".")),u||!a||!at(r)?u:mw(this.data?.[t]?.[n],r,o)}addResource(t,n,r,i,o={silent:!1}){const a=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator;let l=[t,n];r&&(l=l.concat(a?r.split(a):r)),t.indexOf(".")>-1&&(l=t.split("."),i=n,n=l[1]),this.addNamespaces(n),FT(this.data,l,i),o.silent||this.emit("added",t,n,r,i)}addResources(t,n,r,i={silent:!1}){for(const o in r)(at(r[o])||Array.isArray(r[o]))&&this.addResource(t,n,o,r[o],{silent:!0});i.silent||this.emit("added",t,n,r)}addResourceBundle(t,n,r,i,o,a={silent:!1,skipCopy:!1}){let l=[t,n];t.indexOf(".")>-1&&(l=t.split("."),i=r,r=n,n=l[1]),this.addNamespaces(n);let u=eg(this.data,l)||{};a.skipCopy||(r=JSON.parse(JSON.stringify(r))),i?e_(u,r,o):u={...u,...r},FT(this.data,l,u),a.silent||this.emit("added",t,n,r)}removeResourceBundle(t,n){this.hasResourceBundle(t,n)&&delete this.data[t][n],this.removeNamespaces(n),this.emit("removed",t,n)}hasResourceBundle(t,n){return this.getResource(t,n)!==void 0}getResourceBundle(t,n){return n||(n=this.options.defaultNS),this.getResource(t,n)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const n=this.getDataByLanguage(t);return!!(n&&Object.keys(n)||[]).find(i=>n[i]&&Object.keys(n[i]).length>0)}toJSON(){return this.data}}var t_={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,i){return e.forEach(o=>{t=this.processors[o]?.process(t,n,r,i)??t}),t}};const n_=Symbol("i18next/PATH_KEY");function eU(){const e=[],t=Object.create(null);let n;return t.get=(r,i)=>(n?.revoke?.(),i===n_?e:(e.push(i),n=Proxy.revocable(r,t),n.proxy)),Proxy.revocable(Object.create(null),t).proxy}function gw(e,t){const{[n_]:n}=e(eU());return n.join(t?.keySeparator??".")}const HT={},G0=e=>!at(e)&&typeof e!="boolean"&&typeof e!="number";class ng extends wy{constructor(t,n={}){super(),U8(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Io.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t,n={interpolation:{}}){const r={...n};if(t==null)return!1;const i=this.resolve(t,r);if(i?.res===void 0)return!1;const o=G0(i.res);return!(r.returnObjects===!1&&o)}extractFromKey(t,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const i=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let o=n.ns||this.options.defaultNS||[];const a=r&&t.indexOf(r)>-1,l=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!Q8(t,r,i);if(a&&!l){const u=t.match(this.interpolator.nestingRegexp);if(u&&u.length>0)return{key:t,namespaces:at(o)?[o]:o};const d=t.split(r);(r!==i||r===i&&this.options.ns.indexOf(d[0])>-1)&&(o=d.shift()),t=d.join(i)}return{key:t,namespaces:at(o)?[o]:o}}translate(t,n,r){let i=typeof n=="object"?{...n}:n;if(typeof i!="object"&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),typeof i=="object"&&(i={...i}),i||(i={}),t==null)return"";typeof t=="function"&&(t=gw(t,{...this.options,...i})),Array.isArray(t)||(t=[String(t)]);const o=i.returnDetails!==void 0?i.returnDetails:this.options.returnDetails,a=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,{key:l,namespaces:u}=this.extractFromKey(t[t.length-1],i),d=u[u.length-1];let h=i.nsSeparator!==void 0?i.nsSeparator:this.options.nsSeparator;h===void 0&&(h=":");const p=i.lng||this.language,g=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(p?.toLowerCase()==="cimode")return g?o?{res:`${d}${h}${l}`,usedKey:l,exactUsedKey:l,usedLng:p,usedNS:d,usedParams:this.getUsedParamsDetails(i)}:`${d}${h}${l}`:o?{res:l,usedKey:l,exactUsedKey:l,usedLng:p,usedNS:d,usedParams:this.getUsedParamsDetails(i)}:l;const y=this.resolve(t,i);let b=y?.res;const C=y?.usedKey||l,E=y?.exactUsedKey||l,k=["[object Number]","[object Function]","[object RegExp]"],O=i.joinArrays!==void 0?i.joinArrays:this.options.joinArrays,A=!this.i18nFormat||this.i18nFormat.handleAsObject,N=i.count!==void 0&&!at(i.count),D=ng.hasDefaultValue(i),L=N?this.pluralResolver.getSuffix(p,i.count,i):"",T=i.ordinal&&N?this.pluralResolver.getSuffix(p,i.count,{ordinal:!1}):"",I=N&&!i.ordinal&&i.count===0,G=I&&i[`defaultValue${this.options.pluralSeparator}zero`]||i[`defaultValue${L}`]||i[`defaultValue${T}`]||i.defaultValue;let te=b;A&&!b&&D&&(te=G);const fe=G0(te),Q=Object.prototype.toString.apply(te);if(A&&te&&fe&&k.indexOf(Q)<0&&!(at(O)&&Array.isArray(te))){if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const J=this.options.returnedObjectHandler?this.options.returnedObjectHandler(C,te,{...i,ns:u}):`key '${l} (${this.language})' returned an object instead of string.`;return o?(y.res=J,y.usedParams=this.getUsedParamsDetails(i),y):J}if(a){const J=Array.isArray(te),H=J?[]:{},q=J?E:C;for(const R in te)if(Object.prototype.hasOwnProperty.call(te,R)){const F=`${q}${a}${R}`;D&&!b?H[R]=this.translate(F,{...i,defaultValue:G0(G)?G[R]:void 0,joinArrays:!1,ns:u}):H[R]=this.translate(F,{...i,joinArrays:!1,ns:u}),H[R]===F&&(H[R]=te[R])}b=H}}else if(A&&at(O)&&Array.isArray(b))b=b.join(O),b&&(b=this.extendTranslation(b,t,i,r));else{let J=!1,H=!1;!this.isValidLookup(b)&&D&&(J=!0,b=G),this.isValidLookup(b)||(H=!0,b=l);const R=(i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&H?void 0:b,F=D&&G!==b&&this.options.updateMissing;if(H||J||F){if(this.logger.log(F?"updateKey":"missingKey",p,d,l,F?G:b),a){const P=this.resolve(l,{...i,keySeparator:!1});P&&P.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let z=[];const B=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if(this.options.saveMissingTo==="fallback"&&B&&B[0])for(let P=0;P<B.length;P++)z.push(B[P]);else this.options.saveMissingTo==="all"?z=this.languageUtils.toResolveHierarchy(i.lng||this.language):z.push(i.lng||this.language);const U=(P,j,$)=>{const K=D&&$!==b?$:R;this.options.missingKeyHandler?this.options.missingKeyHandler(P,d,j,K,F,i):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(P,d,j,K,F,i),this.emit("missingKey",P,d,j,b)};this.options.saveMissing&&(this.options.saveMissingPlurals&&N?z.forEach(P=>{const j=this.pluralResolver.getSuffixes(P,i);I&&i[`defaultValue${this.options.pluralSeparator}zero`]&&j.indexOf(`${this.options.pluralSeparator}zero`)<0&&j.push(`${this.options.pluralSeparator}zero`),j.forEach($=>{U([P],l+$,i[`defaultValue${$}`]||G)})}):U(z,l,G))}b=this.extendTranslation(b,t,i,y,r),H&&b===l&&this.options.appendNamespaceToMissingKey&&(b=`${d}${h}${l}`),(H||J)&&this.options.parseMissingKeyHandler&&(b=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${d}${h}${l}`:l,J?b:void 0,i))}return o?(y.res=b,y.usedParams=this.getUsedParamsDetails(i),y):b}extendTranslation(t,n,r,i,o){if(this.i18nFormat?.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const u=at(t)&&(r?.interpolation?.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let d;if(u){const p=t.match(this.interpolator.nestingRegexp);d=p&&p.length}let h=r.replace&&!at(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(h={...this.options.interpolation.defaultVariables,...h}),t=this.interpolator.interpolate(t,h,r.lng||this.language||i.usedLng,r),u){const p=t.match(this.interpolator.nestingRegexp),g=p&&p.length;d<g&&(r.nest=!1)}!r.lng&&i&&i.res&&(r.lng=this.language||i.usedLng),r.nest!==!1&&(t=this.interpolator.nest(t,(...p)=>o?.[0]===p[0]&&!r.context?(this.logger.warn(`It seems you are nesting recursively key: ${p[0]} in key: ${n[0]}`),null):this.translate(...p,n),r)),r.interpolation&&this.interpolator.reset()}const a=r.postProcess||this.options.postProcess,l=at(a)?[a]:a;return t!=null&&l?.length&&r.applyPostProcessor!==!1&&(t=t_.handle(l,t,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...i,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),t}resolve(t,n={}){let r,i,o,a,l;return at(t)&&(t=[t]),t.forEach(u=>{if(this.isValidLookup(r))return;const d=this.extractFromKey(u,n),h=d.key;i=h;let p=d.namespaces;this.options.fallbackNS&&(p=p.concat(this.options.fallbackNS));const g=n.count!==void 0&&!at(n.count),y=g&&!n.ordinal&&n.count===0,b=n.context!==void 0&&(at(n.context)||typeof n.context=="number")&&n.context!=="",C=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);p.forEach(E=>{this.isValidLookup(r)||(l=E,!HT[`${C[0]}-${E}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(l)&&(HT[`${C[0]}-${E}`]=!0,this.logger.warn(`key "${i}" for languages "${C.join(", ")}" won't get resolved as namespace "${l}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),C.forEach(k=>{if(this.isValidLookup(r))return;a=k;const O=[h];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(O,h,k,E,n);else{let N;g&&(N=this.pluralResolver.getSuffix(k,n.count,n));const D=`${this.options.pluralSeparator}zero`,L=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(g&&(n.ordinal&&N.indexOf(L)===0&&O.push(h+N.replace(L,this.options.pluralSeparator)),O.push(h+N),y&&O.push(h+D)),b){const T=`${h}${this.options.contextSeparator||"_"}${n.context}`;O.push(T),g&&(n.ordinal&&N.indexOf(L)===0&&O.push(T+N.replace(L,this.options.pluralSeparator)),O.push(T+N),y&&O.push(T+D))}}let A;for(;A=O.pop();)this.isValidLookup(r)||(o=A,r=this.getResource(k,E,A,n))}))})}),{res:r,usedKey:i,exactUsedKey:o,usedLng:a,usedNS:l}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,n,r,i={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(t,n,r,i):this.resourceStore.getResource(t,n,r,i)}getUsedParamsDetails(t={}){const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=t.replace&&!at(t.replace);let i=r?t.replace:t;if(r&&typeof t.count<"u"&&(i.count=t.count),this.options.interpolation.defaultVariables&&(i={...this.options.interpolation.defaultVariables,...i}),!r){i={...i};for(const o of n)delete i[o]}return i}static hasDefaultValue(t){const n="defaultValue";for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&n===r.substring(0,n.length)&&t[r]!==void 0)return!0;return!1}}class UT{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Io.create("languageUtils")}getScriptPartFromCode(t){if(t=_f(t),!t||t.indexOf("-")<0)return null;const n=t.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(t){if(t=_f(t),!t||t.indexOf("-")<0)return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(at(t)&&t.indexOf("-")>-1){let n;try{n=Intl.getCanonicalLocales(t)[0]}catch{}return n&&this.options.lowerCaseLng&&(n=n.toLowerCase()),n||(this.options.lowerCaseLng?t.toLowerCase():t)}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let n;return t.forEach(r=>{if(n)return;const i=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(i))&&(n=i)}),!n&&this.options.supportedLngs&&t.forEach(r=>{if(n)return;const i=this.getScriptPartFromCode(r);if(this.isSupportedCode(i))return n=i;const o=this.getLanguagePartFromCode(r);if(this.isSupportedCode(o))return n=o;n=this.options.supportedLngs.find(a=>{if(a===o)return a;if(!(a.indexOf("-")<0&&o.indexOf("-")<0)&&(a.indexOf("-")>0&&o.indexOf("-")<0&&a.substring(0,a.indexOf("-"))===o||a.indexOf(o)===0&&o.length>1))return a})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(t,n){if(!t)return[];if(typeof t=="function"&&(t=t(n)),at(t)&&(t=[t]),Array.isArray(t))return t;if(!n)return t.default||[];let r=t[n];return r||(r=t[this.getScriptPartFromCode(n)]),r||(r=t[this.formatLanguageCode(n)]),r||(r=t[this.getLanguagePartFromCode(n)]),r||(r=t.default),r||[]}toResolveHierarchy(t,n){const r=this.getFallbackCodes((n===!1?[]:n)||this.options.fallbackLng||[],t),i=[],o=a=>{a&&(this.isSupportedCode(a)?i.push(a):this.logger.warn(`rejecting language code not found in supportedLngs: ${a}`))};return at(t)&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&o(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&o(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&o(this.getLanguagePartFromCode(t))):at(t)&&o(this.formatLanguageCode(t)),r.forEach(a=>{i.indexOf(a)<0&&o(this.formatLanguageCode(a))}),i}}const VT={zero:0,one:1,two:2,few:3,many:4,other:5},qT={select:e=>e===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class tU{constructor(t,n={}){this.languageUtils=t,this.options=n,this.logger=Io.create("pluralResolver"),this.pluralRulesCache={}}addRule(t,n){this.rules[t]=n}clearCache(){this.pluralRulesCache={}}getRule(t,n={}){const r=_f(t==="dev"?"en":t),i=n.ordinal?"ordinal":"cardinal",o=JSON.stringify({cleanedCode:r,type:i});if(o in this.pluralRulesCache)return this.pluralRulesCache[o];let a;try{a=new Intl.PluralRules(r,{type:i})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),qT;if(!t.match(/-|_/))return qT;const u=this.languageUtils.getLanguagePartFromCode(t);a=this.getRule(u,n)}return this.pluralRulesCache[o]=a,a}needsPlural(t,n={}){let r=this.getRule(t,n);return r||(r=this.getRule("dev",n)),r?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(t,n,r={}){return this.getSuffixes(t,r).map(i=>`${n}${i}`)}getSuffixes(t,n={}){let r=this.getRule(t,n);return r||(r=this.getRule("dev",n)),r?r.resolvedOptions().pluralCategories.sort((i,o)=>VT[i]-VT[o]).map(i=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${i}`):[]}getSuffix(t,n,r={}){const i=this.getRule(t,r);return i?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${i.select(n)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",n,r))}}const WT=(e,t,n,r=".",i=!0)=>{let o=W8(e,t,n);return!o&&i&&at(n)&&(o=mw(e,n,r),o===void 0&&(o=mw(t,n,r))),o},X0=e=>e.replace(/\$/g,"$$$$");class nU{constructor(t={}){this.logger=Io.create("interpolator"),this.options=t,this.format=t?.interpolation?.format||(n=>n),this.init(t)}init(t={}){t.interpolation||(t.interpolation={escapeValue:!0});const{escape:n,escapeValue:r,useRawValueToEscape:i,prefix:o,prefixEscaped:a,suffix:l,suffixEscaped:u,formatSeparator:d,unescapeSuffix:h,unescapePrefix:p,nestingPrefix:g,nestingPrefixEscaped:y,nestingSuffix:b,nestingSuffixEscaped:C,nestingOptionsSeparator:E,maxReplaces:k,alwaysFormat:O}=t.interpolation;this.escape=n!==void 0?n:Y8,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=i!==void 0?i:!1,this.prefix=o?Fc(o):a||"{{",this.suffix=l?Fc(l):u||"}}",this.formatSeparator=d||",",this.unescapePrefix=h?"":p||"-",this.unescapeSuffix=this.unescapePrefix?"":h||"",this.nestingPrefix=g?Fc(g):y||Fc("$t("),this.nestingSuffix=b?Fc(b):C||Fc(")"),this.nestingOptionsSeparator=E||",",this.maxReplaces=k||1e3,this.alwaysFormat=O!==void 0?O:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(n,r)=>n?.source===r?(n.lastIndex=0,n):new RegExp(r,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(t,n,r,i){let o,a,l;const u=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},d=y=>{if(y.indexOf(this.formatSeparator)<0){const k=WT(n,u,y,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(k,void 0,r,{...i,...n,interpolationkey:y}):k}const b=y.split(this.formatSeparator),C=b.shift().trim(),E=b.join(this.formatSeparator).trim();return this.format(WT(n,u,C,this.options.keySeparator,this.options.ignoreJSONStructure),E,r,{...i,...n,interpolationkey:C})};this.resetRegExp();const h=i?.missingInterpolationHandler||this.options.missingInterpolationHandler,p=i?.interpolation?.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:y=>X0(y)},{regex:this.regexp,safeValue:y=>this.escapeValue?X0(this.escape(y)):X0(y)}].forEach(y=>{for(l=0;o=y.regex.exec(t);){const b=o[1].trim();if(a=d(b),a===void 0)if(typeof h=="function"){const E=h(t,o,i);a=at(E)?E:""}else if(i&&Object.prototype.hasOwnProperty.call(i,b))a="";else if(p){a=o[0];continue}else this.logger.warn(`missed to pass in variable ${b} for interpolating ${t}`),a="";else!at(a)&&!this.useRawValueToEscape&&(a=zT(a));const C=y.safeValue(a);if(t=t.replace(o[0],C),p?(y.regex.lastIndex+=a.length,y.regex.lastIndex-=o[0].length):y.regex.lastIndex=0,l++,l>=this.maxReplaces)break}}),t}nest(t,n,r={}){let i,o,a;const l=(u,d)=>{const h=this.nestingOptionsSeparator;if(u.indexOf(h)<0)return u;const p=u.split(new RegExp(`${h}[ ]*{`));let g=`{${p[1]}`;u=p[0],g=this.interpolate(g,a);const y=g.match(/'/g),b=g.match(/"/g);((y?.length??0)%2===0&&!b||b.length%2!==0)&&(g=g.replace(/'/g,'"'));try{a=JSON.parse(g),d&&(a={...d,...a})}catch(C){return this.logger.warn(`failed parsing options string in nesting for key ${u}`,C),`${u}${h}${g}`}return a.defaultValue&&a.defaultValue.indexOf(this.prefix)>-1&&delete a.defaultValue,u};for(;i=this.nestingRegexp.exec(t);){let u=[];a={...r},a=a.replace&&!at(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;const d=/{.*}/.test(i[1])?i[1].lastIndexOf("}")+1:i[1].indexOf(this.formatSeparator);if(d!==-1&&(u=i[1].slice(d).split(this.formatSeparator).map(h=>h.trim()).filter(Boolean),i[1]=i[1].slice(0,d)),o=n(l.call(this,i[1].trim(),a),a),o&&i[0]===t&&!at(o))return o;at(o)||(o=zT(o)),o||(this.logger.warn(`missed to resolve ${i[1]} for nesting ${t}`),o=""),u.length&&(o=u.reduce((h,p)=>this.format(h,p,r.lng,{...r,interpolationkey:i[1].trim()}),o.trim())),t=t.replace(i[0],o),this.regexp.lastIndex=0}return t}}const rU=e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const i=r[1].substring(0,r[1].length-1);t==="currency"&&i.indexOf(":")<0?n.currency||(n.currency=i.trim()):t==="relativetime"&&i.indexOf(":")<0?n.range||(n.range=i.trim()):i.split(";").forEach(a=>{if(a){const[l,...u]=a.split(":"),d=u.join(":").trim().replace(/^'+|'+$/g,""),h=l.trim();n[h]||(n[h]=d),d==="false"&&(n[h]=!1),d==="true"&&(n[h]=!0),isNaN(d)||(n[h]=parseInt(d,10))}})}return{formatName:t,formatOptions:n}},KT=e=>{const t={};return(n,r,i)=>{let o=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(o={...o,[i.interpolationkey]:void 0});const a=r+JSON.stringify(o);let l=t[a];return l||(l=e(_f(r),i),t[a]=l),l(n)}},iU=e=>(t,n,r)=>e(_f(n),r)(t);class oU{constructor(t={}){this.logger=Io.create("formatter"),this.options=t,this.init(t)}init(t,n={interpolation:{}}){this.formatSeparator=n.interpolation.formatSeparator||",";const r=n.cacheInBuiltFormats?KT:iU;this.formats={number:r((i,o)=>{const a=new Intl.NumberFormat(i,{...o});return l=>a.format(l)}),currency:r((i,o)=>{const a=new Intl.NumberFormat(i,{...o,style:"currency"});return l=>a.format(l)}),datetime:r((i,o)=>{const a=new Intl.DateTimeFormat(i,{...o});return l=>a.format(l)}),relativetime:r((i,o)=>{const a=new Intl.RelativeTimeFormat(i,{...o});return l=>a.format(l,o.range||"day")}),list:r((i,o)=>{const a=new Intl.ListFormat(i,{...o});return l=>a.format(l)})}}add(t,n){this.formats[t.toLowerCase().trim()]=n}addCached(t,n){this.formats[t.toLowerCase().trim()]=KT(n)}format(t,n,r,i={}){const o=n.split(this.formatSeparator);if(o.length>1&&o[0].indexOf("(")>1&&o[0].indexOf(")")<0&&o.find(l=>l.indexOf(")")>-1)){const l=o.findIndex(u=>u.indexOf(")")>-1);o[0]=[o[0],...o.splice(1,l)].join(this.formatSeparator)}return o.reduce((l,u)=>{const{formatName:d,formatOptions:h}=rU(u);if(this.formats[d]){let p=l;try{const g=i?.formatParams?.[i.interpolationkey]||{},y=g.locale||g.lng||i.locale||i.lng||r;p=this.formats[d](l,y,{...h,...i,...g})}catch(g){this.logger.warn(g)}return p}else this.logger.warn(`there was no format function for ${d}`);return l},t)}}const aU=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class sU extends wy{constructor(t,n,r,i={}){super(),this.backend=t,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=i,this.logger=Io.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=i.maxParallelReads||10,this.readingCalls=0,this.maxRetries=i.maxRetries>=0?i.maxRetries:5,this.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(r,i.backend,i)}queueLoad(t,n,r,i){const o={},a={},l={},u={};return t.forEach(d=>{let h=!0;n.forEach(p=>{const g=`${d}|${p}`;!r.reload&&this.store.hasResourceBundle(d,p)?this.state[g]=2:this.state[g]<0||(this.state[g]===1?a[g]===void 0&&(a[g]=!0):(this.state[g]=1,h=!1,a[g]===void 0&&(a[g]=!0),o[g]===void 0&&(o[g]=!0),u[p]===void 0&&(u[p]=!0)))}),h||(l[d]=!0)}),(Object.keys(o).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(o),pending:Object.keys(a),toLoadLanguages:Object.keys(l),toLoadNamespaces:Object.keys(u)}}loaded(t,n,r){const i=t.split("|"),o=i[0],a=i[1];n&&this.emit("failedLoading",o,a,n),!n&&r&&this.store.addResourceBundle(o,a,r,void 0,void 0,{skipCopy:!0}),this.state[t]=n?-1:2,n&&r&&(this.state[t]=0);const l={};this.queue.forEach(u=>{q8(u.loaded,[o],a),aU(u,t),n&&u.errors.push(n),u.pendingCount===0&&!u.done&&(Object.keys(u.loaded).forEach(d=>{l[d]||(l[d]={});const h=u.loaded[d];h.length&&h.forEach(p=>{l[d][p]===void 0&&(l[d][p]=!0)})}),u.done=!0,u.errors.length?u.callback(u.errors):u.callback())}),this.emit("loaded",l),this.queue=this.queue.filter(u=>!u.done)}read(t,n,r,i=0,o=this.retryTimeout,a){if(!t.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:r,tried:i,wait:o,callback:a});return}this.readingCalls++;const l=(d,h)=>{if(this.readingCalls--,this.waitingReads.length>0){const p=this.waitingReads.shift();this.read(p.lng,p.ns,p.fcName,p.tried,p.wait,p.callback)}if(d&&h&&i<this.maxRetries){setTimeout(()=>{this.read.call(this,t,n,r,i+1,o*2,a)},o);return}a(d,h)},u=this.backend[r].bind(this.backend);if(u.length===2){try{const d=u(t,n);d&&typeof d.then=="function"?d.then(h=>l(null,h)).catch(l):l(null,d)}catch(d){l(d)}return}return u(t,n,l)}prepareLoading(t,n,r={},i){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();at(t)&&(t=this.languageUtils.toResolveHierarchy(t)),at(n)&&(n=[n]);const o=this.queueLoad(t,n,r,i);if(!o.toLoad.length)return o.pending.length||i(),null;o.toLoad.forEach(a=>{this.loadOne(a)})}load(t,n,r){this.prepareLoading(t,n,{},r)}reload(t,n,r){this.prepareLoading(t,n,{reload:!0},r)}loadOne(t,n=""){const r=t.split("|"),i=r[0],o=r[1];this.read(i,o,"read",void 0,void 0,(a,l)=>{a&&this.logger.warn(`${n}loading namespace ${o} for language ${i} failed`,a),!a&&l&&this.logger.log(`${n}loaded namespace ${o} for language ${i}`,l),this.loaded(t,a,l)})}saveMissing(t,n,r,i,o,a={},l=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(n)){this.logger.warn(`did not save key "${r}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if(this.backend?.create){const u={...a,isUpdate:o},d=this.backend.create.bind(this.backend);if(d.length<6)try{let h;d.length===5?h=d(t,n,r,i,u):h=d(t,n,r,i),h&&typeof h.then=="function"?h.then(p=>l(null,p)).catch(l):l(null,h)}catch(h){l(h)}else d(t,n,r,i,l,u)}!t||!t[0]||this.store.addResource(t[0],n,r,i)}}}const YT=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]=="object"&&(t=e[1]),at(e[1])&&(t.defaultValue=e[1]),at(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const n=e[3]||e[2];Object.keys(n).forEach(r=>{t[r]=n[r]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),ZT=e=>(at(e.ns)&&(e.ns=[e.ns]),at(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),at(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs?.indexOf?.("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),typeof e.initImmediate=="boolean"&&(e.initAsync=e.initImmediate),e),Xp=()=>{},lU=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})};class yf extends wy{constructor(t={},n){if(super(),this.options=ZT(t),this.services={},this.logger=Io,this.modules={external:[]},lU(this),n&&!this.isInitialized&&!t.isClone){if(!this.options.initAsync)return this.init(t,n),this;setTimeout(()=>{this.init(t,n)},0)}}init(t={},n){this.isInitializing=!0,typeof t=="function"&&(n=t,t={}),t.defaultNS==null&&t.ns&&(at(t.ns)?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const r=YT();this.options={...r,...this.options,...ZT(t)},this.options.interpolation={...r.interpolation,...this.options.interpolation},t.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=t.keySeparator),t.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=t.nsSeparator);const i=d=>d?typeof d=="function"?new d:d:null;if(!this.options.isClone){this.modules.logger?Io.init(i(this.modules.logger),this.options):Io.init(null,this.options);let d;this.modules.formatter?d=this.modules.formatter:d=oU;const h=new UT(this.options);this.store=new BT(this.options.resources,this.options);const p=this.services;p.logger=Io,p.resourceStore=this.store,p.languageUtils=h,p.pluralResolver=new tU(h,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==r.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),d&&(!this.options.interpolation.format||this.options.interpolation.format===r.interpolation.format)&&(p.formatter=i(d),p.formatter.init&&p.formatter.init(p,this.options),this.options.interpolation.format=p.formatter.format.bind(p.formatter)),p.interpolator=new nU(this.options),p.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},p.backendConnector=new sU(i(this.modules.backend),p.resourceStore,p,this.options),p.backendConnector.on("*",(y,...b)=>{this.emit(y,...b)}),this.modules.languageDetector&&(p.languageDetector=i(this.modules.languageDetector),p.languageDetector.init&&p.languageDetector.init(p,this.options.detection,this.options)),this.modules.i18nFormat&&(p.i18nFormat=i(this.modules.i18nFormat),p.i18nFormat.init&&p.i18nFormat.init(this)),this.translator=new ng(this.services,this.options),this.translator.on("*",(y,...b)=>{this.emit(y,...b)}),this.modules.external.forEach(y=>{y.init&&y.init(this)})}if(this.format=this.options.interpolation.format,n||(n=Xp),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const d=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);d.length>0&&d[0]!=="dev"&&(this.options.lng=d[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(d=>{this[d]=(...h)=>this.store[d](...h)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(d=>{this[d]=(...h)=>(this.store[d](...h),this)});const l=Kd(),u=()=>{const d=(h,p)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),l.resolve(p),n(h,p)};if(this.languages&&!this.isInitialized)return d(null,this.t.bind(this));this.changeLanguage(this.options.lng,d)};return this.options.resources||!this.options.initAsync?u():setTimeout(u,0),l}loadResources(t,n=Xp){let r=n;const i=at(t)?t:this.language;if(typeof t=="function"&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if(i?.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const o=[],a=l=>{if(!l||l==="cimode")return;this.services.languageUtils.toResolveHierarchy(l).forEach(d=>{d!=="cimode"&&o.indexOf(d)<0&&o.push(d)})};i?a(i):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(u=>a(u)),this.options.preload?.forEach?.(l=>a(l)),this.services.backendConnector.load(o,this.options.ns,l=>{!l&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(l)})}else r(null)}reloadResources(t,n,r){const i=Kd();return typeof t=="function"&&(r=t,t=void 0),typeof n=="function"&&(r=n,n=void 0),t||(t=this.languages),n||(n=this.options.ns),r||(r=Xp),this.services.backendConnector.reload(t,n,o=>{i.resolve(),r(o)}),i}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&t_.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!(["cimode","dev"].indexOf(t)>-1)){for(let n=0;n<this.languages.length;n++){const r=this.languages[n];if(!(["cimode","dev"].indexOf(r)>-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}!this.resolvedLanguage&&this.languages.indexOf(t)<0&&this.store.hasLanguageSomeTranslations(t)&&(this.resolvedLanguage=t,this.languages.unshift(t))}}changeLanguage(t,n){this.isLanguageChangingTo=t;const r=Kd();this.emit("languageChanging",t);const i=l=>{this.language=l,this.languages=this.services.languageUtils.toResolveHierarchy(l),this.resolvedLanguage=void 0,this.setResolvedLanguage(l)},o=(l,u)=>{u?this.isLanguageChangingTo===t&&(i(u),this.translator.changeLanguage(u),this.isLanguageChangingTo=void 0,this.emit("languageChanged",u),this.logger.log("languageChanged",u)):this.isLanguageChangingTo=void 0,r.resolve((...d)=>this.t(...d)),n&&n(l,(...d)=>this.t(...d))},a=l=>{!t&&!l&&this.services.languageDetector&&(l=[]);const u=at(l)?l:l&&l[0],d=this.store.hasLanguageSomeTranslations(u)?u:this.services.languageUtils.getBestMatchFromCodes(at(l)?[l]:l);d&&(this.language||i(d),this.translator.language||this.translator.changeLanguage(d),this.services.languageDetector?.cacheUserLanguage?.(d)),this.loadResources(d,h=>{o(h,d)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?a(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(t),r}getFixedT(t,n,r){const i=(o,a,...l)=>{let u;typeof a!="object"?u=this.options.overloadTranslationOptionHandler([o,a].concat(l)):u={...a},u.lng=u.lng||i.lng,u.lngs=u.lngs||i.lngs,u.ns=u.ns||i.ns,u.keyPrefix!==""&&(u.keyPrefix=u.keyPrefix||r||i.keyPrefix);const d=this.options.keySeparator||".";let h;return u.keyPrefix&&Array.isArray(o)?h=o.map(p=>(typeof p=="function"&&(p=gw(p,{...this.options,...a})),`${u.keyPrefix}${d}${p}`)):(typeof o=="function"&&(o=gw(o,{...this.options,...a})),h=u.keyPrefix?`${u.keyPrefix}${d}${o}`:o),this.t(h,u)};return at(t)?i.lng=t:i.lngs=t,i.ns=n,i.keyPrefix=r,i}t(...t){return this.translator?.translate(...t)}exists(...t){return this.translator?.exists(...t)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t,n={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const r=n.lng||this.resolvedLanguage||this.languages[0],i=this.options?this.options.fallbackLng:!1,o=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const a=(l,u)=>{const d=this.services.backendConnector.state[`${l}|${u}`];return d===-1||d===0||d===2};if(n.precheck){const l=n.precheck(this,a);if(l!==void 0)return l}return!!(this.hasResourceBundle(r,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(r,t)&&(!i||a(o,t)))}loadNamespaces(t,n){const r=Kd();return this.options.ns?(at(t)&&(t=[t]),t.forEach(i=>{this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}),this.loadResources(i=>{r.resolve(),n&&n(i)}),r):(n&&n(),Promise.resolve())}loadLanguages(t,n){const r=Kd();at(t)&&(t=[t]);const i=this.options.preload||[],o=t.filter(a=>i.indexOf(a)<0&&this.services.languageUtils.isSupportedCode(a));return o.length?(this.options.preload=i.concat(o),this.loadResources(a=>{r.resolve(),n&&n(a)}),r):(n&&n(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!t)return"rtl";try{const i=new Intl.Locale(t);if(i&&i.getTextInfo){const o=i.getTextInfo();if(o&&o.direction)return o.direction}}catch{}const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],r=this.services?.languageUtils||new UT(YT());return t.toLowerCase().indexOf("-latn")>1?"ltr":n.indexOf(r.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(t={},n){const r=new yf(t,n);return r.createInstance=yf.createInstance,r}cloneInstance(t={},n=Xp){const r=t.forkResourceStore;r&&delete t.forkResourceStore;const i={...this.options,...t,isClone:!0},o=new yf(i);if((t.debug!==void 0||t.prefix!==void 0)&&(o.logger=o.logger.clone(t)),["store","services","language"].forEach(l=>{o[l]=this[l]}),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},r){const l=Object.keys(this.store.data).reduce((u,d)=>(u[d]={...this.store.data[d]},u[d]=Object.keys(u[d]).reduce((h,p)=>(h[p]={...u[d][p]},h),u[d]),u),{});o.store=new BT(l,i),o.services.resourceStore=o.store}return o.translator=new ng(o.services,i),o.translator.on("*",(l,...u)=>{o.emit(l,...u)}),o.init(i,n),o.translator.options=i,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Hr=yf.createInstance();Hr.createInstance;Hr.dir;Hr.init;Hr.loadResources;Hr.reloadResources;Hr.use;Hr.changeLanguage;Hr.getFixedT;Hr.t;Hr.exists;Hr.setDefaultNamespace;Hr.hasLoadedNamespace;Hr.loadNamespaces;Hr.loadLanguages;const{slice:cU,forEach:uU}=[];function dU(e){return uU.call(cU.call(arguments,1),t=>{if(t)for(const n in t)e[n]===void 0&&(e[n]=t[n])}),e}function fU(e){return typeof e!="string"?!1:[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some(n=>n.test(e))}const GT=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,hU=function(e,t){const r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},i=encodeURIComponent(t);let o=`${e}=${i}`;if(r.maxAge>0){const a=r.maxAge-0;if(Number.isNaN(a))throw new Error("maxAge should be a Number");o+=`; Max-Age=${Math.floor(a)}`}if(r.domain){if(!GT.test(r.domain))throw new TypeError("option domain is invalid");o+=`; Domain=${r.domain}`}if(r.path){if(!GT.test(r.path))throw new TypeError("option path is invalid");o+=`; Path=${r.path}`}if(r.expires){if(typeof r.expires.toUTCString!="function")throw new TypeError("option expires is invalid");o+=`; Expires=${r.expires.toUTCString()}`}if(r.httpOnly&&(o+="; HttpOnly"),r.secure&&(o+="; Secure"),r.sameSite)switch(typeof r.sameSite=="string"?r.sameSite.toLowerCase():r.sameSite){case!0:o+="; SameSite=Strict";break;case"lax":o+="; SameSite=Lax";break;case"strict":o+="; SameSite=Strict";break;case"none":o+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return r.partitioned&&(o+="; Partitioned"),o},XT={create(e,t,n,r){let i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};n&&(i.expires=new Date,i.expires.setTime(i.expires.getTime()+n*60*1e3)),r&&(i.domain=r),document.cookie=hU(e,t,i)},read(e){const t=`${e}=`,n=document.cookie.split(";");for(let r=0;r<n.length;r++){let i=n[r];for(;i.charAt(0)===" ";)i=i.substring(1,i.length);if(i.indexOf(t)===0)return i.substring(t.length,i.length)}return null},remove(e,t){this.create(e,"",-1,t)}};var pU={name:"cookie",lookup(e){let{lookupCookie:t}=e;if(t&&typeof document<"u")return XT.read(t)||void 0},cacheUserLanguage(e,t){let{lookupCookie:n,cookieMinutes:r,cookieDomain:i,cookieOptions:o}=t;n&&typeof document<"u"&&XT.create(n,e,r,i,o)}},mU={name:"querystring",lookup(e){let{lookupQuerystring:t}=e,n;if(typeof window<"u"){let{search:r}=window.location;!window.location.search&&window.location.hash?.indexOf("?")>-1&&(r=window.location.hash.substring(window.location.hash.indexOf("?")));const o=r.substring(1).split("&");for(let a=0;a<o.length;a++){const l=o[a].indexOf("=");l>0&&o[a].substring(0,l)===t&&(n=o[a].substring(l+1))}}return n}},gU={name:"hash",lookup(e){let{lookupHash:t,lookupFromHashIndex:n}=e,r;if(typeof window<"u"){const{hash:i}=window.location;if(i&&i.length>2){const o=i.substring(1);if(t){const a=o.split("&");for(let l=0;l<a.length;l++){const u=a[l].indexOf("=");u>0&&a[l].substring(0,u)===t&&(r=a[l].substring(u+1))}}if(r)return r;if(!r&&n>-1){const a=i.match(/\/([a-zA-Z-]*)/g);return Array.isArray(a)?a[typeof n=="number"?n:0]?.replace("/",""):void 0}}}return r}};let Bc=null;const QT=()=>{if(Bc!==null)return Bc;try{if(Bc=typeof window<"u"&&window.localStorage!==null,!Bc)return!1;const e="i18next.translate.boo";window.localStorage.setItem(e,"foo"),window.localStorage.removeItem(e)}catch{Bc=!1}return Bc};var yU={name:"localStorage",lookup(e){let{lookupLocalStorage:t}=e;if(t&&QT())return window.localStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupLocalStorage:n}=t;n&&QT()&&window.localStorage.setItem(n,e)}};let Hc=null;const JT=()=>{if(Hc!==null)return Hc;try{if(Hc=typeof window<"u"&&window.sessionStorage!==null,!Hc)return!1;const e="i18next.translate.boo";window.sessionStorage.setItem(e,"foo"),window.sessionStorage.removeItem(e)}catch{Hc=!1}return Hc};var vU={name:"sessionStorage",lookup(e){let{lookupSessionStorage:t}=e;if(t&&JT())return window.sessionStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupSessionStorage:n}=t;n&&JT()&&window.sessionStorage.setItem(n,e)}},bU={name:"navigator",lookup(e){const t=[];if(typeof navigator<"u"){const{languages:n,userLanguage:r,language:i}=navigator;if(n)for(let o=0;o<n.length;o++)t.push(n[o]);r&&t.push(r),i&&t.push(i)}return t.length>0?t:void 0}},xU={name:"htmlTag",lookup(e){let{htmlTag:t}=e,n;const r=t||(typeof document<"u"?document.documentElement:null);return r&&typeof r.getAttribute=="function"&&(n=r.getAttribute("lang")),n}},wU={name:"path",lookup(e){let{lookupFromPathIndex:t}=e;if(typeof window>"u")return;const n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(n)?n[typeof t=="number"?t:0]?.replace("/",""):void 0}},SU={name:"subdomain",lookup(e){let{lookupFromSubdomainIndex:t}=e;const n=typeof t=="number"?t+1:1,r=typeof window<"u"&&window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(r)return r[n]}};let r_=!1;try{document.cookie,r_=!0}catch{}const i_=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];r_||i_.splice(1,1);const CU=()=>({order:i_,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:e=>e});class o_{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(t,n)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=t,this.options=dU(n,this.options||{},CU()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=i=>i.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=r,this.addDetector(pU),this.addDetector(mU),this.addDetector(yU),this.addDetector(vU),this.addDetector(bU),this.addDetector(xU),this.addDetector(wU),this.addDetector(SU),this.addDetector(gU)}addDetector(t){return this.detectors[t.name]=t,this}detect(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,n=[];return t.forEach(r=>{if(this.detectors[r]){let i=this.detectors[r].lookup(this.options);i&&typeof i=="string"&&(i=[i]),i&&(n=n.concat(i))}}),n=n.filter(r=>r!=null&&!fU(r)).map(r=>this.options.convertDetectedLanguage(r)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?n:n.length>0?n[0]:null}cacheUserLanguage(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;n&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(t)>-1||n.forEach(r=>{this.detectors[r]&&this.detectors[r].cacheUserLanguage(t,this.options)}))}}o_.type="languageDetector";function yw(e){"@babel/helpers - typeof";return yw=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yw(e)}function a_(){return typeof XMLHttpRequest=="function"||(typeof XMLHttpRequest>"u"?"undefined":yw(XMLHttpRequest))==="object"}function EU(e){return!!e&&typeof e.then=="function"}function kU(e){return EU(e)?e:Promise.resolve(e)}const MU="modulepreload",OU=function(e){return"/"+e},eA={},TU=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){let u=function(d){return Promise.all(d.map(h=>Promise.resolve(h).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),l=a?.nonce||a?.getAttribute("nonce");i=u(n.map(d=>{if(d=OU(d),d in eA)return;eA[d]=!0;const h=d.endsWith(".css"),p=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${p}`))return;const g=document.createElement("link");if(g.rel=h?"stylesheet":MU,h||(g.as="script"),g.crossOrigin="",g.href=d,l&&g.setAttribute("nonce",l),document.head.appendChild(g),h)return new Promise((y,b)=>{g.addEventListener("load",y),g.addEventListener("error",()=>b(new Error(`Unable to preload CSS for ${d}`)))})}))}function o(a){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=a,window.dispatchEvent(l),!l.defaultPrevented)throw a}return i.then(a=>{for(const l of a||[])l.status==="rejected"&&o(l.reason);return t().catch(o)})};function tA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function nA(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?tA(Object(n),!0).forEach(function(r){AU(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function AU(e,t,n){return(t=DU(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function DU(e){var t=RU(e,"string");return jl(t)=="symbol"?t:t+""}function RU(e,t){if(jl(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(jl(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function jl(e){"@babel/helpers - typeof";return jl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},jl(e)}var Ls=typeof fetch=="function"?fetch:void 0;typeof global<"u"&&global.fetch?Ls=global.fetch:typeof window<"u"&&window.fetch&&(Ls=window.fetch);var jf;a_()&&(typeof global<"u"&&global.XMLHttpRequest?jf=global.XMLHttpRequest:typeof window<"u"&&window.XMLHttpRequest&&(jf=window.XMLHttpRequest));var rg;typeof ActiveXObject=="function"&&(typeof global<"u"&&global.ActiveXObject?rg=global.ActiveXObject:typeof window<"u"&&window.ActiveXObject&&(rg=window.ActiveXObject));typeof Ls!="function"&&(Ls=void 0);if(!Ls&&!jf&&!rg)try{TU(()=>import("./browser-ponyfill-Ct7s-5jI.js").then(e=>e.b),[]).then(function(e){Ls=e.default}).catch(function(){})}catch{}var vw=function(t,n){if(n&&jl(n)==="object"){var r="";for(var i in n)r+="&"+encodeURIComponent(i)+"="+encodeURIComponent(n[i]);if(!r)return t;t=t+(t.indexOf("?")!==-1?"&":"?")+r.slice(1)}return t},rA=function(t,n,r,i){var o=function(u){if(!u.ok)return r(u.statusText||"Error",{status:u.status});u.text().then(function(d){r(null,{status:u.status,data:d})}).catch(r)};if(i){var a=i(t,n);if(a instanceof Promise){a.then(o).catch(r);return}}typeof fetch=="function"?fetch(t,n).then(o).catch(r):Ls(t,n).then(o).catch(r)},iA=!1,NU=function(t,n,r,i){t.queryStringParams&&(n=vw(n,t.queryStringParams));var o=nA({},typeof t.customHeaders=="function"?t.customHeaders():t.customHeaders);typeof window>"u"&&typeof global<"u"&&typeof global.process<"u"&&global.process.versions&&global.process.versions.node&&(o["User-Agent"]="i18next-http-backend (node/".concat(global.process.version,"; ").concat(global.process.platform," ").concat(global.process.arch,")")),r&&(o["Content-Type"]="application/json");var a=typeof t.requestOptions=="function"?t.requestOptions(r):t.requestOptions,l=nA({method:r?"POST":"GET",body:r?t.stringify(r):void 0,headers:o},iA?{}:a),u=typeof t.alternateFetch=="function"&&t.alternateFetch.length>=1?t.alternateFetch:void 0;try{rA(n,l,i,u)}catch(d){if(!a||Object.keys(a).length===0||!d.message||d.message.indexOf("not implemented")<0)return i(d);try{Object.keys(a).forEach(function(h){delete l[h]}),rA(n,l,i,u),iA=!0}catch(h){i(h)}}},_U=function(t,n,r,i){r&&jl(r)==="object"&&(r=vw("",r).slice(1)),t.queryStringParams&&(n=vw(n,t.queryStringParams));try{var o=jf?new jf:new rg("MSXML2.XMLHTTP.3.0");o.open(r?"POST":"GET",n,1),t.crossDomain||o.setRequestHeader("X-Requested-With","XMLHttpRequest"),o.withCredentials=!!t.withCredentials,r&&o.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),o.overrideMimeType&&o.overrideMimeType("application/json");var a=t.customHeaders;if(a=typeof a=="function"?a():a,a)for(var l in a)o.setRequestHeader(l,a[l]);o.onreadystatechange=function(){o.readyState>3&&i(o.status>=400?o.statusText:null,{status:o.status,data:o.responseText})},o.send(r)}catch(u){console&&console.log(u)}},jU=function(t,n,r,i){if(typeof r=="function"&&(i=r,r=void 0),i=i||function(){},Ls&&n.indexOf("file:")!==0)return NU(t,n,r,i);if(a_()||typeof ActiveXObject=="function")return _U(t,n,r,i);i(new Error("No fetch and no xhr implementation found!"))};function xu(e){"@babel/helpers - typeof";return xu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xu(e)}function oA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Q0(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?oA(Object(n),!0).forEach(function(r){s_(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function PU(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function LU(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,l_(r.key),r)}}function zU(e,t,n){return t&&LU(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function s_(e,t,n){return(t=l_(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l_(e){var t=IU(e,"string");return xu(t)=="symbol"?t:t+""}function IU(e,t){if(xu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(xu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var $U=function(){return{loadPath:"/locales/{{lng}}/{{ns}}.json",addPath:"/locales/add/{{lng}}/{{ns}}",parse:function(n){return JSON.parse(n)},stringify:JSON.stringify,parsePayload:function(n,r,i){return s_({},r,i||"")},parseLoadPayload:function(n,r){},request:jU,reloadInterval:typeof window<"u"?!1:60*60*1e3,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:"cors",credentials:"same-origin",cache:"default"}}},c_=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};PU(this,e),this.services=t,this.options=n,this.allOptions=r,this.type="backend",this.init(t,n,r)}return zU(e,[{key:"init",value:function(n){var r=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(this.services=n,this.options=Q0(Q0(Q0({},$U()),this.options||{}),i),this.allOptions=o,this.services&&this.options.reloadInterval){var a=setInterval(function(){return r.reload()},this.options.reloadInterval);xu(a)==="object"&&typeof a.unref=="function"&&a.unref()}}},{key:"readMulti",value:function(n,r,i){this._readAny(n,n,r,r,i)}},{key:"read",value:function(n,r,i){this._readAny([n],n,[r],r,i)}},{key:"_readAny",value:function(n,r,i,o,a){var l=this,u=this.options.loadPath;typeof this.options.loadPath=="function"&&(u=this.options.loadPath(n,i)),u=kU(u),u.then(function(d){if(!d)return a(null,{});var h=l.services.interpolator.interpolate(d,{lng:n.join("+"),ns:i.join("+")});l.loadUrl(h,a,r,o)})}},{key:"loadUrl",value:function(n,r,i,o){var a=this,l=typeof i=="string"?[i]:i,u=typeof o=="string"?[o]:o,d=this.options.parseLoadPayload(l,u);this.options.request(this.options,n,d,function(h,p){if(p&&(p.status>=500&&p.status<600||!p.status))return r("failed loading "+n+"; status code: "+p.status,!0);if(p&&p.status>=400&&p.status<500)return r("failed loading "+n+"; status code: "+p.status,!1);if(!p&&h&&h.message){var g=h.message.toLowerCase(),y=["failed","fetch","network","load"].find(function(E){return g.indexOf(E)>-1});if(y)return r("failed loading "+n+": "+h.message,!0)}if(h)return r(h,!1);var b,C;try{typeof p.data=="string"?b=a.options.parse(p.data,i,o):b=p.data}catch{C="failed parsing "+n+" to json"}if(C)return r(C,!1);r(null,b)})}},{key:"create",value:function(n,r,i,o,a){var l=this;if(this.options.addPath){typeof n=="string"&&(n=[n]);var u=this.options.parsePayload(r,i,o),d=0,h=[],p=[];n.forEach(function(g){var y=l.options.addPath;typeof l.options.addPath=="function"&&(y=l.options.addPath(g,r));var b=l.services.interpolator.interpolate(y,{lng:g,ns:r});l.options.request(l.options,b,u,function(C,E){d+=1,h.push(C),p.push(E),d===n.length&&typeof a=="function"&&a(h,p)})})}}},{key:"reload",value:function(){var n=this,r=this.services,i=r.backendConnector,o=r.languageUtils,a=r.logger,l=i.language;if(!(l&&l.toLowerCase()==="cimode")){var u=[],d=function(p){var g=o.toResolveHierarchy(p);g.forEach(function(y){u.indexOf(y)<0&&u.push(y)})};d(l),this.allOptions.preload&&this.allOptions.preload.forEach(function(h){return d(h)}),u.forEach(function(h){n.allOptions.ns.forEach(function(p){i.read(h,p,"read",null,null,function(g,y){g&&a.warn("loading namespace ".concat(p," for language ").concat(h," failed"),g),!g&&y&&a.log("loaded namespace ".concat(p," for language ").concat(h),y),i.loaded("".concat(h,"|").concat(p),g,y)})})})}}}])}();c_.type="backend";const FU=(e,t,n,r)=>{const i=[n,{code:t,...r||{}}];if(e?.services?.logger?.forward)return e.services.logger.forward(i,"warn","react-i18next::",!0);Pl(i[0])&&(i[0]=`react-i18next:: ${i[0]}`),e?.services?.logger?.warn?e.services.logger.warn(...i):console?.warn&&console.warn(...i)},aA={},u_=(e,t,n,r)=>{Pl(n)&&aA[n]||(Pl(n)&&(aA[n]=new Date),FU(e,t,n,r))},d_=(e,t)=>()=>{if(e.isInitialized)t();else{const n=()=>{setTimeout(()=>{e.off("initialized",n)},0),t()};e.on("initialized",n)}},bw=(e,t,n)=>{e.loadNamespaces(t,d_(e,n))},sA=(e,t,n,r)=>{if(Pl(n)&&(n=[n]),e.options.preload&&e.options.preload.indexOf(t)>-1)return bw(e,n,r);n.forEach(i=>{e.options.ns.indexOf(i)<0&&e.options.ns.push(i)}),e.loadLanguages(t,d_(e,r))},BU=(e,t,n={})=>!t.languages||!t.languages.length?(u_(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0):t.hasLoadedNamespace(e,{lng:n.lng,precheck:(r,i)=>{if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&r.services.backendConnector.backend&&r.isLanguageChangingTo&&!i(r.isLanguageChangingTo,e))return!1}}),Pl=e=>typeof e=="string",HU=e=>typeof e=="object"&&e!==null,UU=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,VU={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},qU=e=>VU[e],WU=e=>e.replace(UU,qU);let xw={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:WU};const KU=(e={})=>{xw={...xw,...e}},YU=()=>xw;let f_;const ZU=e=>{f_=e},GU=()=>f_,XU={type:"3rdParty",init(e){KU(e.options.react),ZU(e)}},QU=w.createContext();class JU{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}var J0={exports:{}},ex={};var lA;function eV(){if(lA)return ex;lA=1;var e=Pu();function t(p,g){return p===g&&(p!==0||1/p===1/g)||p!==p&&g!==g}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,o=e.useLayoutEffect,a=e.useDebugValue;function l(p,g){var y=g(),b=r({inst:{value:y,getSnapshot:g}}),C=b[0].inst,E=b[1];return o(function(){C.value=y,C.getSnapshot=g,u(C)&&E({inst:C})},[p,y,g]),i(function(){return u(C)&&E({inst:C}),p(function(){u(C)&&E({inst:C})})},[p]),a(y),y}function u(p){var g=p.getSnapshot;p=p.value;try{var y=g();return!n(p,y)}catch{return!0}}function d(p,g){return g()}var h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:l;return ex.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:h,ex}var cA;function h_(){return cA||(cA=1,J0.exports=eV()),J0.exports}var Sy=h_();const tV=(e,t)=>Pl(t)?t:HU(t)&&Pl(t.defaultValue)?t.defaultValue:Array.isArray(e)?e[e.length-1]:e,nV={t:tV,ready:!1},rV=()=>()=>{},cn=(e,t={})=>{const{i18n:n}=t,{i18n:r,defaultNS:i}=w.useContext(QU)||{},o=n||r||GU();o&&!o.reportNamespaces&&(o.reportNamespaces=new JU),o||u_(o,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const a=w.useMemo(()=>({...YU(),...o?.options?.react,...t}),[o,t]),{useSuspense:l,keyPrefix:u}=a,d=w.useMemo(()=>{const N=i||o?.options?.defaultNS;return Pl(N)?[N]:N||["translation"]},[e,i,o]);o?.reportNamespaces?.addUsedNamespaces?.(d);const h=w.useRef(0),p=w.useCallback(N=>{if(!o)return rV;const{bindI18n:D,bindI18nStore:L}=a,T=()=>{h.current+=1,N()};return D&&o.on(D,T),L&&o.store.on(L,T),()=>{D&&D.split(" ").forEach(I=>o.off(I,T)),L&&L.split(" ").forEach(I=>o.store.off(I,T))}},[o,a]),g=w.useRef(),y=w.useCallback(()=>{if(!o)return nV;const N=!!(o.isInitialized||o.initializedStoreOnce)&&d.every(te=>BU(te,o,a)),D=t.lng||o.language,L=h.current,T=g.current;if(T&&T.ready===N&&T.lng===D&&T.keyPrefix===u&&T.revision===L)return T;const G={t:o.getFixedT(D,a.nsMode==="fallback"?d:d[0],u),ready:N,lng:D,keyPrefix:u,revision:L};return g.current=G,G},[o,d,u,a,t.lng]),[b,C]=w.useState(0),{t:E,ready:k}=Sy.useSyncExternalStore(p,y,y);w.useEffect(()=>{if(o&&!k&&!l){const N=()=>C(D=>D+1);t.lng?sA(o,t.lng,d,N):bw(o,d,N)}},[o,t.lng,d,k,l,b]);const O=o||{},A=w.useMemo(()=>{const N=[E,O,k];return N.t=E,N.i18n=O,N.ready=k,N},[E,O,k]);if(o&&l&&!k)throw new Promise(N=>{const D=()=>N();t.lng?sA(o,t.lng,d,D):bw(o,d,D)});return A};Hr.use(XU).use(c_).use(o_).init({fallbackLng:"en",defaultNS:"translation",load:"languageOnly",interpolation:{escapeValue:!1},backend:{loadPath:"/locales/{{lng}}/{{ns}}.json"}});var $u=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},iV={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},oV=class{#e=iV;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},xl=new oV;function aV(e){setTimeout(e,0)}var Ll=typeof window>"u"||"Deno"in globalThis;function Pr(){}function sV(e,t){return typeof e=="function"?e(t):e}function ww(e){return typeof e=="number"&&e>=0&&e!==1/0}function p_(e,t){return Math.max(e+(t||0)-Date.now(),0)}function As(e,t){return typeof e=="function"?e(t):e}function qi(e,t){return typeof e=="function"?e(t):e}function uA(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:o,queryKey:a,stale:l}=e;if(a){if(r){if(t.queryHash!==sS(a,t.options))return!1}else if(!Pf(t.queryKey,a))return!1}if(n!=="all"){const u=t.isActive();if(n==="active"&&!u||n==="inactive"&&u)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||i&&i!==t.state.fetchStatus||o&&!o(t))}function dA(e,t){const{exact:n,status:r,predicate:i,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(zl(t.options.mutationKey)!==zl(o))return!1}else if(!Pf(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function sS(e,t){return(t?.queryKeyHashFn||zl)(e)}function zl(e){return JSON.stringify(e,(t,n)=>Sw(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Pf(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Pf(e[n],t[n])):!1}var lV=Object.prototype.hasOwnProperty;function lS(e,t){if(e===t)return e;const n=fA(e)&&fA(t);if(!n&&!(Sw(e)&&Sw(t)))return t;const i=(n?e:Object.keys(e)).length,o=n?t:Object.keys(t),a=o.length,l=n?new Array(a):{};let u=0;for(let d=0;d<a;d++){const h=n?d:o[d],p=e[h],g=t[h];if(p===g){l[h]=p,(n?d<i:lV.call(e,h))&&u++;continue}if(p===null||g===null||typeof p!="object"||typeof g!="object"){l[h]=g;continue}const y=lS(p,g);l[h]=y,y===p&&u++}return i===a&&u===i?e:l}function ig(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function fA(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Sw(e){if(!hA(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!hA(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function hA(e){return Object.prototype.toString.call(e)==="[object Object]"}function cV(e){return new Promise(t=>{xl.setTimeout(t,e)})}function Cw(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?lS(e,t):t}function Ql(e){return e}function uV(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function dV(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var cS=Symbol();function m_(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===cS?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function g_(e,t){return typeof e=="function"?e(...t):!!e}var fV=class extends $u{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!Ll&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},uS=new fV;function Ew(){let e,t;const n=new Promise((i,o)=>{e=i,t=o});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}var hV=aV;function pV(){let e=[],t=0,n=l=>{l()},r=l=>{l()},i=hV;const o=l=>{t?e.push(l):i(()=>{n(l)})},a=()=>{const l=e;e=[],l.length&&i(()=>{r(()=>{l.forEach(u=>{n(u)})})})};return{batch:l=>{let u;t++;try{u=l()}finally{t--,t||a()}return u},batchCalls:l=>(...u)=>{o(()=>{l(...u)})},schedule:o,setNotifyFunction:l=>{n=l},setBatchNotifyFunction:l=>{r=l},setScheduler:l=>{i=l}}}var Qn=pV(),mV=class extends $u{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!Ll&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(n=>{n(e)}))}isOnline(){return this.#e}},og=new mV;function gV(e){return Math.min(1e3*2**e,3e4)}function y_(e){return(e??"online")==="online"?og.isOnline():!0}var kw=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function v_(e){let t=!1,n=0,r;const i=Ew(),o=()=>i.status!=="pending",a=C=>{if(!o()){const E=new kw(C);g(E),e.onCancel?.(E)}},l=()=>{t=!0},u=()=>{t=!1},d=()=>uS.isFocused()&&(e.networkMode==="always"||og.isOnline())&&e.canRun(),h=()=>y_(e.networkMode)&&e.canRun(),p=C=>{o()||(r?.(),i.resolve(C))},g=C=>{o()||(r?.(),i.reject(C))},y=()=>new Promise(C=>{r=E=>{(o()||d())&&C(E)},e.onPause?.()}).then(()=>{r=void 0,o()||e.onContinue?.()}),b=()=>{if(o())return;let C;const E=n===0?e.initialPromise:void 0;try{C=E??e.fn()}catch(k){C=Promise.reject(k)}Promise.resolve(C).then(p).catch(k=>{if(o())return;const O=e.retry??(Ll?0:3),A=e.retryDelay??gV,N=typeof A=="function"?A(n,k):A,D=O===!0||typeof O=="number"&&n<O||typeof O=="function"&&O(n,k);if(t||!D){g(k);return}n++,e.onFail?.(n,k),cV(N).then(()=>d()?void 0:y()).then(()=>{t?g(k):b()})})};return{promise:i,status:()=>i.status,cancel:a,continue:()=>(r?.(),i),cancelRetry:l,continueRetry:u,canStart:h,start:()=>(h()?b():y().then(b),i)}}var b_=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),ww(this.gcTime)&&(this.#e=xl.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Ll?1/0:5*60*1e3))}clearGcTimeout(){this.#e&&(xl.clearTimeout(this.#e),this.#e=void 0)}},yV=class extends b_{#e;#t;#n;#i;#r;#a;#s;constructor(e){super(),this.#s=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#n=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=mA(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#r?.promise}setOptions(e){if(this.options={...this.#a,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=mA(this.options);t.data!==void 0&&(this.setState(pA(t.data,t.dataUpdatedAt)),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const n=Cw(this.state.data,e,this.options);return this.#o({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#o({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#r?.promise;return this.#r?.cancel(e),t?t.then(Pr).catch(Pr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>qi(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===cS||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>As(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!p_(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#r&&(this.#s?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#o({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(e&&this.setOptions(e),!this.options.queryFn){const l=this.observers.find(u=>u.options.queryFn);l&&this.setOptions(l.options)}const n=new AbortController,r=l=>{Object.defineProperty(l,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{const l=m_(this.options,t),d=(()=>{const h={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(h),h})();return this.#s=!1,this.options.persister?this.options.persister(l,d,this):l(d)},a=(()=>{const l={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(l),l})();this.options.behavior?.onFetch(a,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#o({type:"fetch",meta:a.fetchOptions?.meta}),this.#r=v_({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:l=>{l instanceof kw&&l.revert&&this.setState({...this.#t,fetchStatus:"idle"}),n.abort()},onFail:(l,u)=>{this.#o({type:"failed",failureCount:l,error:u})},onPause:()=>{this.#o({type:"pause"})},onContinue:()=>{this.#o({type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{const l=await this.#r.start();if(l===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(l),this.#n.config.onSuccess?.(l,this),this.#n.config.onSettled?.(l,this.state.error,this),l}catch(l){if(l instanceof kw){if(l.silent)return this.#r.promise;if(l.revert){if(this.state.data===void 0)throw l;return this.state.data}}throw this.#o({type:"error",error:l}),this.#n.config.onError?.(l,this),this.#n.config.onSettled?.(this.state.data,l,this),l}finally{this.scheduleGc()}}#o(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...x_(n.data,this.options),fetchMeta:e.meta??null};case"success":const r={...n,...pA(e.data,e.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?r:void 0,r;case"error":const i=e.error;return{...n,error:i,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),Qn.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function x_(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:y_(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function pA(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function mA(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var vV=class extends $u{constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.#s=Ew(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#i=void 0;#r;#a;#s;#o;#m;#f;#h;#c;#u;#l;#p=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),gA(this.#t,this.options)?this.#d():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Mw(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Mw(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#w(),this.#t.removeObserver(this)}setOptions(e){const t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof qi(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#S(),this.#t.setOptions(this.options),t._defaulted&&!ig(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const r=this.hasListeners();r&&yA(this.#t,n,this.options,t)&&this.#d(),this.updateResult(),r&&(this.#t!==n||qi(this.options.enabled,this.#t)!==qi(t.enabled,this.#t)||As(this.options.staleTime,this.#t)!==As(t.staleTime,this.#t))&&this.#g();const i=this.#y();r&&(this.#t!==n||qi(this.options.enabled,this.#t)!==qi(t.enabled,this.#t)||i!==this.#l)&&this.#v(i)}getOptimisticResult(e){const t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return xV(this,n)&&(this.#i=n,this.#a=this.options,this.#r=this.#t.state),n}getCurrentResult(){return this.#i}trackResult(e,t){return new Proxy(e,{get:(n,r)=>(this.trackProp(r),t?.(r),r==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#s.status==="pending"&&this.#s.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,r))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#d({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#i))}#d(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(Pr)),t}#g(){this.#x();const e=As(this.options.staleTime,this.#t);if(Ll||this.#i.isStale||!ww(e))return;const n=p_(this.#i.dataUpdatedAt,e)+1;this.#c=xl.setTimeout(()=>{this.#i.isStale||this.updateResult()},n)}#y(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#w(),this.#l=e,!(Ll||qi(this.options.enabled,this.#t)===!1||!ww(this.#l)||this.#l===0)&&(this.#u=xl.setInterval(()=>{(this.options.refetchIntervalInBackground||uS.isFocused())&&this.#d()},this.#l))}#b(){this.#g(),this.#v(this.#y())}#x(){this.#c&&(xl.clearTimeout(this.#c),this.#c=void 0)}#w(){this.#u&&(xl.clearInterval(this.#u),this.#u=void 0)}createResult(e,t){const n=this.#t,r=this.options,i=this.#i,o=this.#r,a=this.#a,u=e!==n?e.state:this.#n,{state:d}=e;let h={...d},p=!1,g;if(t._optimisticResults){const I=this.hasListeners(),G=!I&&gA(e,t),te=I&&yA(e,n,t,r);(G||te)&&(h={...h,...x_(d.data,e.options)}),t._optimisticResults==="isRestoring"&&(h.fetchStatus="idle")}let{error:y,errorUpdatedAt:b,status:C}=h;g=h.data;let E=!1;if(t.placeholderData!==void 0&&g===void 0&&C==="pending"){let I;i?.isPlaceholderData&&t.placeholderData===a?.placeholderData?(I=i.data,E=!0):I=typeof t.placeholderData=="function"?t.placeholderData(this.#h?.state.data,this.#h):t.placeholderData,I!==void 0&&(C="success",g=Cw(i?.data,I,t),p=!0)}if(t.select&&g!==void 0&&!E)if(i&&g===o?.data&&t.select===this.#m)g=this.#f;else try{this.#m=t.select,g=t.select(g),g=Cw(i?.data,g,t),this.#f=g,this.#o=null}catch(I){this.#o=I}this.#o&&(y=this.#o,g=this.#f,b=Date.now(),C="error");const k=h.fetchStatus==="fetching",O=C==="pending",A=C==="error",N=O&&k,D=g!==void 0,T={status:C,fetchStatus:h.fetchStatus,isPending:O,isSuccess:C==="success",isError:A,isInitialLoading:N,isLoading:N,data:g,dataUpdatedAt:h.dataUpdatedAt,error:y,errorUpdatedAt:b,failureCount:h.fetchFailureCount,failureReason:h.fetchFailureReason,errorUpdateCount:h.errorUpdateCount,isFetched:h.dataUpdateCount>0||h.errorUpdateCount>0,isFetchedAfterMount:h.dataUpdateCount>u.dataUpdateCount||h.errorUpdateCount>u.errorUpdateCount,isFetching:k,isRefetching:k&&!O,isLoadingError:A&&!D,isPaused:h.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:A&&D,isStale:dS(e,t),refetch:this.refetch,promise:this.#s,isEnabled:qi(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const I=fe=>{T.status==="error"?fe.reject(T.error):T.data!==void 0&&fe.resolve(T.data)},G=()=>{const fe=this.#s=T.promise=Ew();I(fe)},te=this.#s;switch(te.status){case"pending":e.queryHash===n.queryHash&&I(te);break;case"fulfilled":(T.status==="error"||T.data!==te.value)&&G();break;case"rejected":(T.status!=="error"||T.error!==te.reason)&&G();break}}return T}updateResult(){const e=this.#i,t=this.createResult(this.#t,this.options);if(this.#r=this.#t.state,this.#a=this.options,this.#r.data!==void 0&&(this.#h=this.#t),ig(t,e))return;this.#i=t;const n=()=>{if(!e)return!0;const{notifyOnChangeProps:r}=this.options,i=typeof r=="function"?r():r;if(i==="all"||!i&&!this.#p.size)return!0;const o=new Set(i??this.#p);return this.options.throwOnError&&o.add("error"),Object.keys(this.#i).some(a=>{const l=a;return this.#i[l]!==e[l]&&o.has(l)})};this.#C({listeners:n()})}#S(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#C(e){Qn.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#i)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function bV(e,t){return qi(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function gA(e,t){return bV(e,t)||e.state.data!==void 0&&Mw(e,t,t.refetchOnMount)}function Mw(e,t,n){if(qi(t.enabled,e)!==!1&&As(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&dS(e,t)}return!1}function yA(e,t,n,r){return(e!==t||qi(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&dS(e,n)}function dS(e,t){return qi(t.enabled,e)!==!1&&e.isStaleByTime(As(t.staleTime,e))}function xV(e,t){return!ig(e.getCurrentResult(),t)}function vA(e){return{onFetch:(t,n)=>{const r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,o=t.state.data?.pages||[],a=t.state.data?.pageParams||[];let l={pages:[],pageParams:[]},u=0;const d=async()=>{let h=!1;const p=b=>{Object.defineProperty(b,"signal",{enumerable:!0,get:()=>(t.signal.aborted?h=!0:t.signal.addEventListener("abort",()=>{h=!0}),t.signal)})},g=m_(t.options,t.fetchOptions),y=async(b,C,E)=>{if(h)return Promise.reject();if(C==null&&b.pages.length)return Promise.resolve(b);const O=(()=>{const L={client:t.client,queryKey:t.queryKey,pageParam:C,direction:E?"backward":"forward",meta:t.options.meta};return p(L),L})(),A=await g(O),{maxPages:N}=t.options,D=E?dV:uV;return{pages:D(b.pages,A,N),pageParams:D(b.pageParams,C,N)}};if(i&&o.length){const b=i==="backward",C=b?wV:bA,E={pages:o,pageParams:a},k=C(r,E);l=await y(E,k,b)}else{const b=e??o.length;do{const C=u===0?a[0]??r.initialPageParam:bA(r,l);if(u>0&&C==null)break;l=await y(l,C),u++}while(u<b)}return l};t.options.persister?t.fetchFn=()=>t.options.persister?.(d,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=d}}}function bA(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function wV(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var SV=class extends b_{#e;#t;#n;#i;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||w_(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#i?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#r({type:"continue"})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#i=v_({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(o,a)=>{this.#r({type:"failed",failureCount:o,error:a})},onPause:()=>{this.#r({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const r=this.state.status==="pending",i=!this.#i.canStart();try{if(r)t();else{this.#r({type:"pending",variables:e,isPaused:i}),await this.#n.config.onMutate?.(e,this,n);const a=await this.options.onMutate?.(e,n);a!==this.state.context&&this.#r({type:"pending",context:a,variables:e,isPaused:i})}const o=await this.#i.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#r({type:"success",data:o}),o}catch(o){try{throw await this.#n.config.onError?.(o,e,this.state.context,this,n),await this.options.onError?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(void 0,o,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(void 0,o,e,this.state.context,n),o}finally{this.#r({type:"error",error:o})}}finally{this.#n.runNext(this)}}#r(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),Qn.batch(()=>{this.#t.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function w_(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var CV=class extends $u{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){const r=new SV({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);const t=Qp(e);if(typeof t=="string"){const n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=Qp(e);if(typeof t=="string"){const n=this.#t.get(t);if(n)if(n.length>1){const r=n.indexOf(e);r!==-1&&n.splice(r,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=Qp(e);if(typeof t=="string"){const r=this.#t.get(t)?.find(i=>i.state.status==="pending");return!r||r===e}else return!0}runNext(e){const t=Qp(e);return typeof t=="string"?this.#t.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Qn.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const t={exact:!0,...e};return this.getAll().find(n=>dA(t,n))}findAll(e={}){return this.getAll().filter(t=>dA(e,t))}notify(e){Qn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return Qn.batch(()=>Promise.all(e.map(t=>t.continue().catch(Pr))))}};function Qp(e){return e.options.scope?.id}var EV=class extends $u{#e;#t=void 0;#n;#i;constructor(t,n){super(),this.#e=t,this.setOptions(n),this.bindMethods(),this.#r()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const n=this.options;this.options=this.#e.defaultMutationOptions(t),ig(this.options,n)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),n?.mutationKey&&this.options.mutationKey&&zl(n.mutationKey)!==zl(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(t){this.#r(),this.#a(t)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#r(),this.#a()}mutate(t,n){return this.#i=n,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(t)}#r(){const t=this.#n?.state??w_();this.#t={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#a(t){Qn.batch(()=>{if(this.#i&&this.hasListeners()){const n=this.#t.variables,r=this.#t.context,i={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};t?.type==="success"?(this.#i.onSuccess?.(t.data,n,r,i),this.#i.onSettled?.(t.data,null,n,r,i)):t?.type==="error"&&(this.#i.onError?.(t.error,n,r,i),this.#i.onSettled?.(void 0,t.error,n,r,i))}this.listeners.forEach(n=>{n(this.#t)})})}},kV=class extends $u{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const r=t.queryKey,i=t.queryHash??sS(r,t);let o=this.get(i);return o||(o=new yV({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(o)),o}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Qn.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>uA(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>uA(e,n)):t}notify(e){Qn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Qn.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Qn.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},MV=class{#e;#t;#n;#i;#r;#a;#s;#o;constructor(e={}){this.#e=e.queryCache||new kV,this.#t=e.mutationCache||new CV,this.#n=e.defaultOptions||{},this.#i=new Map,this.#r=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#s=uS.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#o=og.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#s?.(),this.#s=void 0,this.#o?.(),this.#o=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(As(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),o=this.#e.get(r.queryHash)?.state.data,a=sV(t,o);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return Qn.batch(()=>this.#e.findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;Qn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e;return Qn.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Qn.batch(()=>this.#e.findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(Pr).catch(Pr)}invalidateQueries(e,t={}){return Qn.batch(()=>(this.#e.findAll(e).forEach(n=>{n.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=Qn.batch(()=>this.#e.findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let o=i.fetch(void 0,n);return n.throwOnError||(o=o.catch(Pr)),i.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(Pr)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(As(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Pr).catch(Pr)}fetchInfiniteQuery(e){return e.behavior=vA(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Pr).catch(Pr)}ensureInfiniteQueryData(e){return e.behavior=vA(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return og.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#i.set(zl(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#i.values()],n={};return t.forEach(r=>{Pf(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#r.set(zl(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(r=>{Pf(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=sS(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===cS&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},S_=w.createContext(void 0),xo=e=>{const t=w.useContext(S_);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},OV=({client:e,children:t})=>(w.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),x.jsx(S_.Provider,{value:e,children:t})),C_=w.createContext(!1),TV=()=>w.useContext(C_);C_.Provider;function AV(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var DV=w.createContext(AV()),RV=()=>w.useContext(DV),NV=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},_V=e=>{w.useEffect(()=>{e.clearReset()},[e])},jV=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||g_(n,[e.error,r])),PV=e=>{if(e.suspense){const n=i=>i==="static"?i:Math.max(i??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...i)=>n(r(...i)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},LV=(e,t)=>e.isLoading&&e.isFetching&&!t,zV=(e,t)=>e?.suspense&&t.isPending,xA=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function IV(e,t,n){const r=TV(),i=RV(),o=xo(n),a=o.defaultQueryOptions(e);o.getDefaultOptions().queries?._experimental_beforeQuery?.(a),a._optimisticResults=r?"isRestoring":"optimistic",PV(a),NV(a,i),_V(i);const l=!o.getQueryCache().get(a.queryHash),[u]=w.useState(()=>new t(o,a)),d=u.getOptimisticResult(a),h=!r&&e.subscribed!==!1;if(w.useSyncExternalStore(w.useCallback(p=>{const g=h?u.subscribe(Qn.batchCalls(p)):Pr;return u.updateResult(),g},[u,h]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),w.useEffect(()=>{u.setOptions(a)},[a,u]),zV(a,d))throw xA(a,u,i);if(jV({result:d,errorResetBoundary:i,throwOnError:a.throwOnError,query:o.getQueryCache().get(a.queryHash),suspense:a.suspense}))throw d.error;return o.getDefaultOptions().queries?._experimental_afterQuery?.(a,d),a.experimental_prefetchInRender&&!Ll&&LV(d,r)&&(l?xA(a,u,i):o.getQueryCache().get(a.queryHash)?.promise)?.catch(Pr).finally(()=>{u.updateResult()}),a.notifyOnChangeProps?d:u.trackResult(d)}function Oi(e,t){return IV(e,vV,t)}function $V(e,t){const n=xo(t);return FV({filters:{...e,status:"pending"}},n).length}function wA(e,t){return e.findAll(t.filters).map(n=>t.select?t.select(n):n.state)}function FV(e={},t){const n=xo(t).getMutationCache(),r=w.useRef(e),i=w.useRef(null);return i.current===null&&(i.current=wA(n,e)),w.useEffect(()=>{r.current=e}),w.useSyncExternalStore(w.useCallback(o=>n.subscribe(()=>{const a=lS(i.current,wA(n,r.current));i.current!==a&&(i.current=a,Qn.schedule(o))}),[n]),()=>i.current,()=>i.current)}function Us(e,t){const n=xo(t),[r]=w.useState(()=>new EV(n,e));w.useEffect(()=>{r.setOptions(e)},[r,e]);const i=w.useSyncExternalStore(w.useCallback(a=>r.subscribe(Qn.batchCalls(a)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),o=w.useCallback((a,l)=>{r.mutate(a,l).catch(Pr)},[r]);if(i.error&&g_(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:o,mutateAsync:i.mutate}}function BV(e,t){const n=w.createContext(t),r=o=>{const{children:a,...l}=o,u=w.useMemo(()=>l,Object.values(l));return x.jsx(n.Provider,{value:u,children:a})};r.displayName=e+"Provider";function i(o){const a=w.useContext(n);if(a)return a;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[r,i]}function Ti(e,t=[]){let n=[];function r(o,a){const l=w.createContext(a),u=n.length;n=[...n,a];const d=p=>{const{scope:g,children:y,...b}=p,C=g?.[e]?.[u]||l,E=w.useMemo(()=>b,Object.values(b));return x.jsx(C.Provider,{value:E,children:y})};d.displayName=o+"Provider";function h(p,g){const y=g?.[e]?.[u]||l,b=w.useContext(y);if(b)return b;if(a!==void 0)return a;throw new Error(`\`${p}\` must be used within \`${o}\``)}return[d,h]}const i=()=>{const o=n.map(a=>w.createContext(a));return function(l){const u=l?.[e]||o;return w.useMemo(()=>({[`__scope${e}`]:{...l,[e]:u}}),[l,u])}};return i.scopeName=e,[r,HV(i,...t)]}function HV(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const a=r.reduce((l,{useScope:u,scopeName:d})=>{const p=u(o)[`__scope${d}`];return{...l,...p}},{});return w.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function SA(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Ir(...e){return t=>{let n=!1;const r=e.map(i=>{const o=SA(i,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let i=0;i<r.length;i++){const o=r[i];typeof o=="function"?o():SA(e[i],null)}}}}function Dt(...e){return w.useCallback(Ir(...e),e)}function _e(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e?.(i),n===!1||!i.defaultPrevented)return t?.(i)}}var sr=globalThis?.document?w.useLayoutEffect:()=>{},UV=Z1[" useId ".trim().toString()]||(()=>{}),VV=0;function hr(e){const[t,n]=w.useState(UV());return sr(()=>{n(r=>r??String(VV++))},[e]),t?`radix-${t}`:""}var qV=Z1[" useInsertionEffect ".trim().toString()]||sr;function qo({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,o,a]=WV({defaultProp:t,onChange:n}),l=e!==void 0,u=l?e:i;{const h=w.useRef(e!==void 0);w.useEffect(()=>{const p=h.current;p!==l&&console.warn(`${r} is changing from ${p?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),h.current=l},[l,r])}const d=w.useCallback(h=>{if(l){const p=KV(h)?h(e):h;p!==e&&a.current?.(p)}else o(h)},[l,e,o,a]);return[u,d]}function WV({defaultProp:e,onChange:t}){const[n,r]=w.useState(e),i=w.useRef(n),o=w.useRef(t);return qV(()=>{o.current=t},[t]),w.useEffect(()=>{i.current!==n&&(o.current?.(n),i.current=n)},[n,i]),[n,r,o]}function KV(e){return typeof e=="function"}var sh=O2();const fS=yo(sh);function YV(e){const t=ZV(e),n=w.forwardRef((r,i)=>{const{children:o,...a}=r,l=w.Children.toArray(o),u=l.find(XV);if(u){const d=u.props.children,h=l.map(p=>p===u?w.Children.count(d)>1?w.Children.only(null):w.isValidElement(d)?d.props.children:null:p);return x.jsx(t,{...a,ref:i,children:w.isValidElement(d)?w.cloneElement(d,void 0,h):null})}return x.jsx(t,{...a,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}function ZV(e){const t=w.forwardRef((n,r)=>{const{children:i,...o}=n;if(w.isValidElement(i)){const a=JV(i),l=QV(o,i.props);return i.type!==w.Fragment&&(l.ref=r?Ir(r,a):a),w.cloneElement(i,l)}return w.Children.count(i)>1?w.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var GV=Symbol("radix.slottable");function XV(e){return w.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===GV}function QV(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...l)=>{const u=o(...l);return i(...l),u}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function JV(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var eq=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ge=eq.reduce((e,t)=>{const n=YV(`Primitive.${t}`),r=w.forwardRef((i,o)=>{const{asChild:a,...l}=i,u=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),x.jsx(u,{...l,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function E_(e,t){e&&sh.flushSync(()=>e.dispatchEvent(t))}function Qi(e){const t=w.useRef(e);return w.useEffect(()=>{t.current=e}),w.useMemo(()=>(...n)=>t.current?.(...n),[])}function tq(e,t=globalThis?.document){const n=Qi(e);w.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var nq="DismissableLayer",Ow="dismissableLayer.update",rq="dismissableLayer.pointerDownOutside",iq="dismissableLayer.focusOutside",CA,k_=w.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Fu=w.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:a,onDismiss:l,...u}=e,d=w.useContext(k_),[h,p]=w.useState(null),g=h?.ownerDocument??globalThis?.document,[,y]=w.useState({}),b=Dt(t,T=>p(T)),C=Array.from(d.layers),[E]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),k=C.indexOf(E),O=h?C.indexOf(h):-1,A=d.layersWithOutsidePointerEventsDisabled.size>0,N=O>=k,D=sq(T=>{const I=T.target,G=[...d.branches].some(te=>te.contains(I));!N||G||(i?.(T),a?.(T),T.defaultPrevented||l?.())},g),L=lq(T=>{const I=T.target;[...d.branches].some(te=>te.contains(I))||(o?.(T),a?.(T),T.defaultPrevented||l?.())},g);return tq(T=>{O===d.layers.size-1&&(r?.(T),!T.defaultPrevented&&l&&(T.preventDefault(),l()))},g),w.useEffect(()=>{if(h)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(CA=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(h)),d.layers.add(h),EA(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=CA)}},[h,g,n,d]),w.useEffect(()=>()=>{h&&(d.layers.delete(h),d.layersWithOutsidePointerEventsDisabled.delete(h),EA())},[h,d]),w.useEffect(()=>{const T=()=>y({});return document.addEventListener(Ow,T),()=>document.removeEventListener(Ow,T)},[]),x.jsx(Ge.div,{...u,ref:b,style:{pointerEvents:A?N?"auto":"none":void 0,...e.style},onFocusCapture:_e(e.onFocusCapture,L.onFocusCapture),onBlurCapture:_e(e.onBlurCapture,L.onBlurCapture),onPointerDownCapture:_e(e.onPointerDownCapture,D.onPointerDownCapture)})});Fu.displayName=nq;var oq="DismissableLayerBranch",aq=w.forwardRef((e,t)=>{const n=w.useContext(k_),r=w.useRef(null),i=Dt(t,r);return w.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),x.jsx(Ge.div,{...e,ref:i})});aq.displayName=oq;function sq(e,t=globalThis?.document){const n=Qi(e),r=w.useRef(!1),i=w.useRef(()=>{});return w.useEffect(()=>{const o=l=>{if(l.target&&!r.current){let u=function(){M_(rq,n,d,{discrete:!0})};const d={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=u,t.addEventListener("click",i.current,{once:!0})):u()}else t.removeEventListener("click",i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",o),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function lq(e,t=globalThis?.document){const n=Qi(e),r=w.useRef(!1);return w.useEffect(()=>{const i=o=>{o.target&&!r.current&&M_(iq,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function EA(){const e=new CustomEvent(Ow);document.dispatchEvent(e)}function M_(e,t,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?E_(i,o):i.dispatchEvent(o)}var tx="focusScope.autoFocusOnMount",nx="focusScope.autoFocusOnUnmount",kA={bubbles:!1,cancelable:!0},cq="FocusScope",lh=w.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...a}=e,[l,u]=w.useState(null),d=Qi(i),h=Qi(o),p=w.useRef(null),g=Dt(t,C=>u(C)),y=w.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;w.useEffect(()=>{if(r){let C=function(A){if(y.paused||!l)return;const N=A.target;l.contains(N)?p.current=N:ps(p.current,{select:!0})},E=function(A){if(y.paused||!l)return;const N=A.relatedTarget;N!==null&&(l.contains(N)||ps(p.current,{select:!0}))},k=function(A){if(document.activeElement===document.body)for(const D of A)D.removedNodes.length>0&&ps(l)};document.addEventListener("focusin",C),document.addEventListener("focusout",E);const O=new MutationObserver(k);return l&&O.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",C),document.removeEventListener("focusout",E),O.disconnect()}}},[r,l,y.paused]),w.useEffect(()=>{if(l){OA.add(y);const C=document.activeElement;if(!l.contains(C)){const k=new CustomEvent(tx,kA);l.addEventListener(tx,d),l.dispatchEvent(k),k.defaultPrevented||(uq(mq(O_(l)),{select:!0}),document.activeElement===C&&ps(l))}return()=>{l.removeEventListener(tx,d),setTimeout(()=>{const k=new CustomEvent(nx,kA);l.addEventListener(nx,h),l.dispatchEvent(k),k.defaultPrevented||ps(C??document.body,{select:!0}),l.removeEventListener(nx,h),OA.remove(y)},0)}}},[l,d,h,y]);const b=w.useCallback(C=>{if(!n&&!r||y.paused)return;const E=C.key==="Tab"&&!C.altKey&&!C.ctrlKey&&!C.metaKey,k=document.activeElement;if(E&&k){const O=C.currentTarget,[A,N]=dq(O);A&&N?!C.shiftKey&&k===N?(C.preventDefault(),n&&ps(A,{select:!0})):C.shiftKey&&k===A&&(C.preventDefault(),n&&ps(N,{select:!0})):k===O&&C.preventDefault()}},[n,r,y.paused]);return x.jsx(Ge.div,{tabIndex:-1,...a,ref:g,onKeyDown:b})});lh.displayName=cq;function uq(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(ps(r,{select:t}),document.activeElement!==n)return}function dq(e){const t=O_(e),n=MA(t,e),r=MA(t.reverse(),e);return[n,r]}function O_(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function MA(e,t){for(const n of e)if(!fq(n,{upTo:t}))return n}function fq(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function hq(e){return e instanceof HTMLInputElement&&"select"in e}function ps(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&hq(e)&&t&&e.select()}}var OA=pq();function pq(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=TA(e,t),e.unshift(t)},remove(t){e=TA(e,t),e[0]?.resume()}}}function TA(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function mq(e){return e.filter(t=>t.tagName!=="A")}var gq="Portal",Bu=w.forwardRef((e,t)=>{const{container:n,...r}=e,[i,o]=w.useState(!1);sr(()=>o(!0),[]);const a=n||i&&globalThis?.document?.body;return a?fS.createPortal(x.jsx(Ge.div,{...r,ref:t}),a):null});Bu.displayName=gq;function yq(e,t){return w.useReducer((n,r)=>t[n][r]??n,e)}var li=e=>{const{present:t,children:n}=e,r=vq(t),i=typeof n=="function"?n({present:r.isPresent}):w.Children.only(n),o=Dt(r.ref,bq(i));return typeof n=="function"||r.isPresent?w.cloneElement(i,{ref:o}):null};li.displayName="Presence";function vq(e){const[t,n]=w.useState(),r=w.useRef(null),i=w.useRef(e),o=w.useRef("none"),a=e?"mounted":"unmounted",[l,u]=yq(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return w.useEffect(()=>{const d=Jp(r.current);o.current=l==="mounted"?d:"none"},[l]),sr(()=>{const d=r.current,h=i.current;if(h!==e){const g=o.current,y=Jp(d);e?u("MOUNT"):y==="none"||d?.display==="none"?u("UNMOUNT"):u(h&&g!==y?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,u]),sr(()=>{if(t){let d;const h=t.ownerDocument.defaultView??window,p=y=>{const C=Jp(r.current).includes(CSS.escape(y.animationName));if(y.target===t&&C&&(u("ANIMATION_END"),!i.current)){const E=t.style.animationFillMode;t.style.animationFillMode="forwards",d=h.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=E)})}},g=y=>{y.target===t&&(o.current=Jp(r.current))};return t.addEventListener("animationstart",g),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{h.clearTimeout(d),t.removeEventListener("animationstart",g),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:w.useCallback(d=>{r.current=d?getComputedStyle(d):null,n(d)},[])}}function Jp(e){return e?.animationName||"none"}function bq(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var rx=0;function Cy(){w.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??AA()),document.body.insertAdjacentElement("beforeend",e[1]??AA()),rx++,()=>{rx===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),rx--}},[])}function AA(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Po=function(){return Po=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Po.apply(this,arguments)};function T_(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Jl(e,t,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(h){try{d(r.next(h))}catch(p){a(p)}}function u(h){try{d(r.throw(h))}catch(p){a(p)}}function d(h){h.done?o(h.value):i(h.value).then(l,u)}d((r=r.apply(e,t||[])).next())})}function xq(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}var jm="right-scroll-bar-position",Pm="width-before-scroll-bar",wq="with-scroll-bars-hidden",Sq="--removed-body-scroll-bar-size";function ix(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Cq(e,t){var n=w.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}var Eq=typeof window<"u"?w.useLayoutEffect:w.useEffect,DA=new WeakMap;function kq(e,t){var n=Cq(null,function(r){return e.forEach(function(i){return ix(i,r)})});return Eq(function(){var r=DA.get(n);if(r){var i=new Set(r),o=new Set(e),a=n.current;i.forEach(function(l){o.has(l)||ix(l,null)}),o.forEach(function(l){i.has(l)||ix(l,a)})}DA.set(n,e)},[e]),n}function Mq(e){return e}function Oq(e,t){t===void 0&&(t=Mq);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(o){var a=t(o,r);return n.push(a),function(){n=n.filter(function(l){return l!==a})}},assignSyncMedium:function(o){for(r=!0;n.length;){var a=n;n=[],a.forEach(o)}n={push:function(l){return o(l)},filter:function(){return n}}},assignMedium:function(o){r=!0;var a=[];if(n.length){var l=n;n=[],l.forEach(o),a=n}var u=function(){var h=a;a=[],h.forEach(o)},d=function(){return Promise.resolve().then(u)};d(),n={push:function(h){a.push(h),d()},filter:function(h){return a=a.filter(h),n}}}};return i}function Tq(e){e===void 0&&(e={});var t=Oq(null);return t.options=Po({async:!0,ssr:!1},e),t}var A_=function(e){var t=e.sideCar,n=T_(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return w.createElement(r,Po({},n))};A_.isSideCarExport=!0;function Aq(e,t){return e.useMedium(t),A_}var D_=Tq(),ox=function(){},Ey=w.forwardRef(function(e,t){var n=w.useRef(null),r=w.useState({onScrollCapture:ox,onWheelCapture:ox,onTouchMoveCapture:ox}),i=r[0],o=r[1],a=e.forwardProps,l=e.children,u=e.className,d=e.removeScrollBar,h=e.enabled,p=e.shards,g=e.sideCar,y=e.noRelative,b=e.noIsolation,C=e.inert,E=e.allowPinchZoom,k=e.as,O=k===void 0?"div":k,A=e.gapMode,N=T_(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),D=g,L=kq([n,t]),T=Po(Po({},N),i);return w.createElement(w.Fragment,null,h&&w.createElement(D,{sideCar:D_,removeScrollBar:d,shards:p,noRelative:y,noIsolation:b,inert:C,setCallbacks:o,allowPinchZoom:!!E,lockRef:n,gapMode:A}),a?w.cloneElement(w.Children.only(l),Po(Po({},T),{ref:L})):w.createElement(O,Po({},T,{className:u,ref:L}),l))});Ey.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Ey.classNames={fullWidth:Pm,zeroRight:jm};var Dq=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Rq(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Dq();return t&&e.setAttribute("nonce",t),e}function Nq(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function _q(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var jq=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Rq())&&(Nq(t,n),_q(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Pq=function(){var e=jq();return function(t,n){w.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},R_=function(){var e=Pq(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},Lq={left:0,top:0,right:0,gap:0},ax=function(e){return parseInt(e||"",10)||0},zq=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[ax(n),ax(r),ax(i)]},Iq=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Lq;var t=zq(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},$q=R_(),fu="data-scroll-locked",Fq=function(e,t,n,r){var i=e.left,o=e.top,a=e.right,l=e.gap;return n===void 0&&(n="margin"),`
|
|
12
|
+
Please change the parent <Route path="${O}"> to <Route path="${O==="/"?"*":`${O}/*`}">.`)}let g=bo(),y;y=g;let b=y.pathname||"/",C=b;if(h!=="/"){let O=h.replace(/^\//,"").split("/");C="/"+b.replace(/^\//,"").split("/").slice(O.length).join("/")}let E=xs(e,{pathname:C});return Ln(p||E!=null,`No routes matched location "${y.pathname}${y.search}${y.hash}" `),Ln(E==null||E[E.length-1].route.element!==void 0||E[E.length-1].route.Component!==void 0||E[E.length-1].route.lazy!==void 0,`Matched leaf route at location "${y.pathname}${y.search}${y.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`),KH(E&&E.map(O=>Object.assign({},O,{params:Object.assign({},u,O.params),pathname:Ho([h,o.encodeLocation?o.encodeLocation(O.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:O.pathname]),pathnameBase:O.pathnameBase==="/"?h:Ho([h,o.encodeLocation?o.encodeLocation(O.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:O.pathnameBase])})),a,n,r,i)}function UH(){let e=QH(),t=Nf(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",i={padding:"0.5rem",backgroundColor:r},o={padding:"2px 4px",backgroundColor:r},a=null;return console.error("Error handled by React Router default ErrorBoundary:",e),a=w.createElement(w.Fragment,null,w.createElement("p",null,"💿 Hey developer 👋"),w.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",w.createElement("code",{style:o},"ErrorBoundary")," or"," ",w.createElement("code",{style:o},"errorElement")," prop on your route.")),w.createElement(w.Fragment,null,w.createElement("h2",null,"Unexpected Application Error!"),w.createElement("h3",{style:{fontStyle:"italic"}},t),n?w.createElement("pre",{style:i},n):null,a)}var VH=w.createElement(UH,null),qH=class extends w.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.unstable_onError?this.props.unstable_onError(e,t):console.error("React Router caught the following error during render",e)}render(){return this.state.error!==void 0?w.createElement(Ji.Provider,{value:this.props.routeContext},w.createElement(tS.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function WH({routeContext:e,match:t,children:n}){let r=w.useContext(Xl);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),w.createElement(Ji.Provider,{value:e},n)}function KH(e,t=[],n=null,r=null,i=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,a=n?.errors;if(a!=null){let d=o.findIndex(h=>h.route.id&&a?.[h.route.id]!==void 0);bt(d>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(",")}`),o=o.slice(0,Math.min(o.length,d+1))}let l=!1,u=-1;if(n)for(let d=0;d<o.length;d++){let h=o[d];if((h.route.HydrateFallback||h.route.hydrateFallbackElement)&&(u=d),h.route.id){let{loaderData:p,errors:g}=n,y=h.route.loader&&!p.hasOwnProperty(h.route.id)&&(!g||g[h.route.id]===void 0);if(h.route.lazy||y){l=!0,u>=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((d,h,p)=>{let g,y=!1,b=null,C=null;n&&(g=a&&h.route.id?a[h.route.id]:void 0,b=h.route.errorElement||VH,l&&(u<0&&p===0?(Y2("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),y=!0,C=null):u===p&&(y=!0,C=h.route.hydrateFallbackElement||null)));let E=t.concat(o.slice(0,p+1)),k=()=>{let O;return g?O=b:y?O=C:h.route.Component?O=w.createElement(h.route.Component,null):h.route.element?O=h.route.element:O=d,w.createElement(WH,{match:h,routeContext:{outlet:d,matches:E,isDataRoute:n!=null},children:O})};return n&&(h.route.ErrorBoundary||h.route.errorElement||p===0)?w.createElement(qH,{location:n.location,revalidation:n.revalidation,component:b,error:g,children:k(),routeContext:{outlet:null,matches:E,isDataRoute:!0},unstable_onError:r}):k()},null)}function nS(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function YH(e){let t=w.useContext(Xl);return bt(t,nS(e)),t}function ZH(e){let t=w.useContext(ih);return bt(t,nS(e)),t}function GH(e){let t=w.useContext(Ji);return bt(t,nS(e)),t}function rS(e){let t=GH(e),n=t.matches[t.matches.length-1];return bt(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function XH(){return rS("useRouteId")}function QH(){let e=w.useContext(tS),t=ZH("useRouteError"),n=rS("useRouteError");return e!==void 0?e:t.errors?.[n]}function JH(){let{router:e}=YH("useNavigate"),t=rS("useNavigate"),n=w.useRef(!1);return W2(()=>{n.current=!0}),w.useCallback(async(i,o={})=>{Ln(n.current,q2),n.current&&(typeof i=="number"?e.navigate(i):await e.navigate(i,{fromRouteId:t,...o}))},[e,t])}var _T={};function Y2(e,t,n){!t&&!_T[e]&&(_T[e]=!0,Ln(!1,n))}var jT={};function PT(e,t){!e&&!jT[t]&&(jT[t]=!0,console.warn(t))}function e8(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&Ln(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:w.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&Ln(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:w.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&Ln(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:w.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var t8=["HydrateFallback","hydrateFallbackElement"],n8=class{constructor(){this.status="pending",this.promise=new Promise((e,t)=>{this.resolve=n=>{this.status==="pending"&&(this.status="resolved",e(n))},this.reject=n=>{this.status==="pending"&&(this.status="rejected",t(n))}})}};function r8({router:e,flushSync:t,unstable_onError:n}){let[r,i]=w.useState(e.state),[o,a]=w.useState(),[l,u]=w.useState({isTransitioning:!1}),[d,h]=w.useState(),[p,g]=w.useState(),[y,b]=w.useState(),C=w.useRef(new Map),E=w.useCallback(D=>{i(L=>(D.errors&&n&&Object.entries(D.errors).forEach(([T,I])=>{L.errors?.[T]!==I&&n(I)}),D))},[n]),k=w.useCallback((D,{deletedFetchers:L,flushSync:T,viewTransitionOpts:I})=>{D.fetchers.forEach((te,fe)=>{te.data!==void 0&&C.current.set(fe,te.data)}),L.forEach(te=>C.current.delete(te)),PT(T===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let G=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(PT(I==null||G,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!I||!G){t&&T?t(()=>E(D)):w.startTransition(()=>E(D));return}if(t&&T){t(()=>{p&&(d&&d.resolve(),p.skipTransition()),u({isTransitioning:!0,flushSync:!0,currentLocation:I.currentLocation,nextLocation:I.nextLocation})});let te=e.window.document.startViewTransition(()=>{t(()=>E(D))});te.finished.finally(()=>{t(()=>{h(void 0),g(void 0),a(void 0),u({isTransitioning:!1})})}),t(()=>g(te));return}p?(d&&d.resolve(),p.skipTransition(),b({state:D,currentLocation:I.currentLocation,nextLocation:I.nextLocation})):(a(D),u({isTransitioning:!0,flushSync:!1,currentLocation:I.currentLocation,nextLocation:I.nextLocation}))},[e.window,t,p,d,E]);w.useLayoutEffect(()=>e.subscribe(k),[e,k]),w.useEffect(()=>{l.isTransitioning&&!l.flushSync&&h(new n8)},[l]),w.useEffect(()=>{if(d&&o&&e.window){let D=o,L=d.promise,T=e.window.document.startViewTransition(async()=>{w.startTransition(()=>E(D)),await L});T.finished.finally(()=>{h(void 0),g(void 0),a(void 0),u({isTransitioning:!1})}),g(T)}},[o,d,e.window,E]),w.useEffect(()=>{d&&o&&r.location.key===o.location.key&&d.resolve()},[d,p,r.location,o]),w.useEffect(()=>{!l.isTransitioning&&y&&(a(y.state),u({isTransitioning:!0,flushSync:!1,currentLocation:y.currentLocation,nextLocation:y.nextLocation}),b(void 0))},[l.isTransitioning,y]);let O=w.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:D=>e.navigate(D),push:(D,L,T)=>e.navigate(D,{state:L,preventScrollReset:T?.preventScrollReset}),replace:(D,L,T)=>e.navigate(D,{replace:!0,state:L,preventScrollReset:T?.preventScrollReset})}),[e]),A=e.basename||"/",N=w.useMemo(()=>({router:e,navigator:O,static:!1,basename:A,unstable_onError:n}),[e,O,A,n]);return w.createElement(w.Fragment,null,w.createElement(Xl.Provider,{value:N},w.createElement(ih.Provider,{value:r},w.createElement(V2.Provider,{value:C.current},w.createElement(eS.Provider,{value:l},w.createElement(s8,{basename:A,location:r.location,navigationType:r.historyAction,navigator:O},w.createElement(i8,{routes:e.routes,future:e.future,state:r,unstable_onError:n})))))),null)}var i8=w.memo(o8);function o8({routes:e,future:t,state:n,unstable_onError:r}){return HH(e,void 0,n,r,t)}function a8({to:e,replace:t,state:n,relative:r}){bt(Lu(),"<Navigate> may be used only in the context of a <Router> component.");let{static:i}=w.useContext(vo);Ln(!i,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:o}=w.useContext(Ji),{pathname:a}=bo(),l=zu(),u=vy(e,yy(o),a,r==="path"),d=JSON.stringify(u);return w.useEffect(()=>{l(JSON.parse(d),{replace:t,state:n,relative:r})},[l,d,r,t,n]),null}function ah(e){return BH(e.context)}function s8({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:i,static:o=!1}){bt(!Lu(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let a=e.replace(/^\/*/,"/"),l=w.useMemo(()=>({basename:a,navigator:i,static:o,future:{}}),[a,i,o]);typeof n=="string"&&(n=Hs(n));let{pathname:u="/",search:d="",hash:h="",state:p=null,key:g="default"}=n,y=w.useMemo(()=>{let b=Xi(u,a);return b==null?null:{location:{pathname:b,search:d,hash:h,state:p,key:g},navigationType:r}},[a,u,d,h,p,g,r]);return Ln(y!=null,`<Router basename="${a}"> is not able to match the URL "${u}${d}${h}" because it does not start with the basename, so the <Router> won't render anything.`),y==null?null:w.createElement(vo.Provider,{value:l},w.createElement(by.Provider,{children:t,value:y}))}var Nm="get",_m="application/x-www-form-urlencoded";function xy(e){return e!=null&&typeof e.tagName=="string"}function l8(e){return xy(e)&&e.tagName.toLowerCase()==="button"}function c8(e){return xy(e)&&e.tagName.toLowerCase()==="form"}function u8(e){return xy(e)&&e.tagName.toLowerCase()==="input"}function d8(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function f8(e,t){return e.button===0&&(!t||t==="_self")&&!d8(e)}function pw(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(i=>[n,i]):[[n,r]])},[]))}function h8(e,t){let n=pw(e);return t&&t.forEach((r,i)=>{n.has(i)||t.getAll(i).forEach(o=>{n.append(i,o)})}),n}var Gp=null;function p8(){if(Gp===null)try{new FormData(document.createElement("form"),0),Gp=!1}catch{Gp=!0}return Gp}var m8=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Z0(e){return e!=null&&!m8.has(e)?(Ln(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${_m}"`),null):e}function g8(e,t){let n,r,i,o,a;if(c8(e)){let l=e.getAttribute("action");r=l?Xi(l,t):null,n=e.getAttribute("method")||Nm,i=Z0(e.getAttribute("enctype"))||_m,o=new FormData(e)}else if(l8(e)||u8(e)&&(e.type==="submit"||e.type==="image")){let l=e.form;if(l==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let u=e.getAttribute("formaction")||l.getAttribute("action");if(r=u?Xi(u,t):null,n=e.getAttribute("formmethod")||l.getAttribute("method")||Nm,i=Z0(e.getAttribute("formenctype"))||Z0(l.getAttribute("enctype"))||_m,o=new FormData(l,e),!p8()){let{name:d,type:h,value:p}=e;if(h==="image"){let g=d?`${d}.`:"";o.append(`${g}x`,"0"),o.append(`${g}y`,"0")}else d&&o.append(d,p)}}else{if(xy(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Nm,r=null,i=_m,a=e}return o&&i==="text/plain"&&(a=o,o=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:o,body:a}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function iS(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function y8(e,t,n){let r=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r.pathname==="/"?r.pathname=`_root.${n}`:t&&Xi(r.pathname,t)==="/"?r.pathname=`${t.replace(/\/$/,"")}/_root.${n}`:r.pathname=`${r.pathname.replace(/\/$/,"")}.${n}`,r}async function v8(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function b8(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function x8(e,t,n){let r=await Promise.all(e.map(async i=>{let o=t.routes[i.route.id];if(o){let a=await v8(o,n);return a.links?a.links():[]}return[]}));return E8(r.flat(1).filter(b8).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function LT(e,t,n,r,i,o){let a=(u,d)=>n[d]?u.route.id!==n[d].route.id:!0,l=(u,d)=>n[d].pathname!==u.pathname||n[d].route.path?.endsWith("*")&&n[d].params["*"]!==u.params["*"];return o==="assets"?t.filter((u,d)=>a(u,d)||l(u,d)):o==="data"?t.filter((u,d)=>{let h=r.routes[u.route.id];if(!h||!h.hasLoader)return!1;if(a(u,d)||l(u,d))return!0;if(u.route.shouldRevalidate){let p=u.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:u.params,defaultShouldRevalidate:!0});if(typeof p=="boolean")return p}return!0}):[]}function w8(e,t,{includeHydrateFallback:n}={}){return S8(e.map(r=>{let i=t.routes[r.route.id];if(!i)return[];let o=[i.module];return i.clientActionModule&&(o=o.concat(i.clientActionModule)),i.clientLoaderModule&&(o=o.concat(i.clientLoaderModule)),n&&i.hydrateFallbackModule&&(o=o.concat(i.hydrateFallbackModule)),i.imports&&(o=o.concat(i.imports)),o}).flat(1))}function S8(e){return[...new Set(e)]}function C8(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function E8(e,t){let n=new Set;return new Set(t),e.reduce((r,i)=>{let o=JSON.stringify(C8(i));return n.has(o)||(n.add(o),r.push({key:o,link:i})),r},[])}function Z2(){let e=w.useContext(Xl);return iS(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function k8(){let e=w.useContext(ih);return iS(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var oS=w.createContext(void 0);oS.displayName="FrameworkContext";function G2(){let e=w.useContext(oS);return iS(e,"You must render this element inside a <HydratedRouter> element"),e}function M8(e,t){let n=w.useContext(oS),[r,i]=w.useState(!1),[o,a]=w.useState(!1),{onFocus:l,onBlur:u,onMouseEnter:d,onMouseLeave:h,onTouchStart:p}=t,g=w.useRef(null);w.useEffect(()=>{if(e==="render"&&a(!0),e==="viewport"){let C=k=>{k.forEach(O=>{a(O.isIntersecting)})},E=new IntersectionObserver(C,{threshold:.5});return g.current&&E.observe(g.current),()=>{E.disconnect()}}},[e]),w.useEffect(()=>{if(r){let C=setTimeout(()=>{a(!0)},100);return()=>{clearTimeout(C)}}},[r]);let y=()=>{i(!0)},b=()=>{i(!1),a(!1)};return n?e!=="intent"?[o,g,{}]:[o,g,{onFocus:Wd(l,y),onBlur:Wd(u,b),onMouseEnter:Wd(d,y),onMouseLeave:Wd(h,b),onTouchStart:Wd(p,y)}]:[!1,g,{}]}function Wd(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function O8({page:e,...t}){let{router:n}=Z2(),r=w.useMemo(()=>xs(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?w.createElement(A8,{page:e,matches:r,...t}):null}function T8(e){let{manifest:t,routeModules:n}=G2(),[r,i]=w.useState([]);return w.useEffect(()=>{let o=!1;return x8(e,t,n).then(a=>{o||i(a)}),()=>{o=!0}},[e,t,n]),r}function A8({page:e,matches:t,...n}){let r=bo(),{manifest:i,routeModules:o}=G2(),{basename:a}=Z2(),{loaderData:l,matches:u}=k8(),d=w.useMemo(()=>LT(e,t,u,i,r,"data"),[e,t,u,i,r]),h=w.useMemo(()=>LT(e,t,u,i,r,"assets"),[e,t,u,i,r]),p=w.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let b=new Set,C=!1;if(t.forEach(k=>{let O=i.routes[k.route.id];!O||!O.hasLoader||(!d.some(A=>A.route.id===k.route.id)&&k.route.id in l&&o[k.route.id]?.shouldRevalidate||O.hasClientLoader?C=!0:b.add(k.route.id))}),b.size===0)return[];let E=y8(e,a,"data");return C&&b.size>0&&E.searchParams.set("_routes",t.filter(k=>b.has(k.route.id)).map(k=>k.route.id).join(",")),[E.pathname+E.search]},[a,l,r,i,d,t,e,o]),g=w.useMemo(()=>w8(h,i),[h,i]),y=T8(h);return w.createElement(w.Fragment,null,p.map(b=>w.createElement("link",{key:b,rel:"prefetch",as:"fetch",href:b,...n})),g.map(b=>w.createElement("link",{key:b,rel:"modulepreload",href:b,...n})),y.map(({key:b,link:C})=>w.createElement("link",{key:b,nonce:n.nonce,...C})))}function D8(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var X2=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{X2&&(window.__reactRouterVersion="7.9.5")}catch{}function R8(e,t){return pH({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:O6({window:t?.window}),hydrationData:t?.hydrationData||N8(),routes:e,mapRouteProperties:e8,hydrationRouteProperties:t8,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,unstable_instrumentations:t?.unstable_instrumentations}).initialize()}function N8(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:_8(e.errors)}),e}function _8(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,i]of t)if(i&&i.__type==="RouteErrorResponse")n[r]=new Qm(i.status,i.statusText,i.data,i.internal===!0);else if(i&&i.__type==="Error"){if(i.__subType){let o=window[i.__subType];if(typeof o=="function")try{let a=new o(i.message);a.stack="",n[r]=a}catch{}}if(n[r]==null){let o=new Error(i.message);o.stack="",n[r]=o}}else n[r]=i;return n}var Q2=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Iu=w.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:i,reloadDocument:o,replace:a,state:l,target:u,to:d,preventScrollReset:h,viewTransition:p,...g},y){let{basename:b}=w.useContext(vo),C=typeof d=="string"&&Q2.test(d),E,k=!1;if(typeof d=="string"&&C&&(E=d,X2))try{let G=new URL(window.location.href),te=d.startsWith("//")?new URL(G.protocol+d):new URL(d),fe=Xi(te.pathname,b);te.origin===G.origin&&fe!=null?d=fe+te.search+te.hash:k=!0}catch{Ln(!1,`<Link to="${d}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let O=IH(d,{relative:i}),[A,N,D]=M8(r,g),L=z8(d,{replace:a,state:l,target:u,preventScrollReset:h,relative:i,viewTransition:p});function T(G){t&&t(G),G.defaultPrevented||L(G)}let I=w.createElement("a",{...g,...D,href:E||O,onClick:k||o?t:T,ref:D8(y,N),target:u,"data-discover":!C&&n==="render"?"true":void 0});return A&&!C?w.createElement(w.Fragment,null,I,w.createElement(O8,{page:O})):I});Iu.displayName="Link";var j8=w.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:i=!1,style:o,to:a,viewTransition:l,children:u,...d},h){let p=oh(a,{relative:d.relative}),g=bo(),y=w.useContext(ih),{navigator:b,basename:C}=w.useContext(vo),E=y!=null&&H8(p)&&l===!0,k=b.encodeLocation?b.encodeLocation(p).pathname:p.pathname,O=g.pathname,A=y&&y.navigation&&y.navigation.location?y.navigation.location.pathname:null;n||(O=O.toLowerCase(),A=A?A.toLowerCase():null,k=k.toLowerCase()),A&&C&&(A=Xi(A,C)||A);const N=k!=="/"&&k.endsWith("/")?k.length-1:k.length;let D=O===k||!i&&O.startsWith(k)&&O.charAt(N)==="/",L=A!=null&&(A===k||!i&&A.startsWith(k)&&A.charAt(k.length)==="/"),T={isActive:D,isPending:L,isTransitioning:E},I=D?t:void 0,G;typeof r=="function"?G=r(T):G=[r,D?"active":null,L?"pending":null,E?"transitioning":null].filter(Boolean).join(" ");let te=typeof o=="function"?o(T):o;return w.createElement(Iu,{...d,"aria-current":I,className:G,ref:h,style:te,to:a,viewTransition:l},typeof u=="function"?u(T):u)});j8.displayName="NavLink";var P8=w.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:o,method:a=Nm,action:l,onSubmit:u,relative:d,preventScrollReset:h,viewTransition:p,...g},y)=>{let b=F8(),C=B8(l,{relative:d}),E=a.toLowerCase()==="get"?"get":"post",k=typeof l=="string"&&Q2.test(l),O=A=>{if(u&&u(A),A.defaultPrevented)return;A.preventDefault();let N=A.nativeEvent.submitter,D=N?.getAttribute("formmethod")||a;b(N||A.currentTarget,{fetcherKey:t,method:D,navigate:n,replace:i,state:o,relative:d,preventScrollReset:h,viewTransition:p})};return w.createElement("form",{ref:y,method:E,action:C,onSubmit:r?u:O,...g,"data-discover":!k&&e==="render"?"true":void 0})});P8.displayName="Form";function L8(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function J2(e){let t=w.useContext(Xl);return bt(t,L8(e)),t}function z8(e,{target:t,replace:n,state:r,preventScrollReset:i,relative:o,viewTransition:a}={}){let l=zu(),u=bo(),d=oh(e,{relative:o});return w.useCallback(h=>{if(f8(h,t)){h.preventDefault();let p=n!==void 0?n:Vo(u)===Vo(d);l(e,{replace:p,state:r,preventScrollReset:i,relative:o,viewTransition:a})}},[u,l,d,n,r,t,e,i,o,a])}function aS(e){Ln(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=w.useRef(pw(e)),n=w.useRef(!1),r=bo(),i=w.useMemo(()=>h8(r.search,n.current?null:t.current),[r.search]),o=zu(),a=w.useCallback((l,u)=>{const d=pw(typeof l=="function"?l(new URLSearchParams(i)):l);n.current=!0,o("?"+d,u)},[o,i]);return[i,a]}var I8=0,$8=()=>`__${String(++I8)}__`;function F8(){let{router:e}=J2("useSubmit"),{basename:t}=w.useContext(vo),n=XH();return w.useCallback(async(r,i={})=>{let{action:o,method:a,encType:l,formData:u,body:d}=g8(r,t);if(i.navigate===!1){let h=i.fetcherKey||$8();await e.fetch(h,n,i.action||o,{preventScrollReset:i.preventScrollReset,formData:u,body:d,formMethod:i.method||a,formEncType:i.encType||l,flushSync:i.flushSync})}else await e.navigate(i.action||o,{preventScrollReset:i.preventScrollReset,formData:u,body:d,formMethod:i.method||a,formEncType:i.encType||l,replace:i.replace,state:i.state,fromRouteId:n,flushSync:i.flushSync,viewTransition:i.viewTransition})},[e,t,n])}function B8(e,{relative:t}={}){let{basename:n}=w.useContext(vo),r=w.useContext(Ji);bt(r,"useFormAction must be used inside a RouteContext");let[i]=r.matches.slice(-1),o={...oh(e||".",{relative:t})},a=bo();if(e==null){o.search=a.search;let l=new URLSearchParams(o.search),u=l.getAll("index");if(u.some(h=>h==="")){l.delete("index"),u.filter(p=>p).forEach(p=>l.append("index",p));let h=l.toString();o.search=h?`?${h}`:""}}return(!e||e===".")&&i.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(o.pathname=o.pathname==="/"?n:Ho([n,o.pathname])),Vo(o)}function H8(e,{relative:t}={}){let n=w.useContext(eS);bt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=J2("useViewTransitionState"),i=oh(e,{relative:t});if(!n.isTransitioning)return!1;let o=Xi(n.currentLocation.pathname,r)||n.currentLocation.pathname,a=Xi(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Xm(i.pathname,a)!=null||Xm(i.pathname,o)!=null}const at=e=>typeof e=="string",Kd=()=>{let e,t;const n=new Promise((r,i)=>{e=r,t=i});return n.resolve=e,n.reject=t,n},zT=e=>e==null?"":""+e,U8=(e,t,n)=>{e.forEach(r=>{t[r]&&(n[r]=t[r])})},V8=/###/g,IT=e=>e&&e.indexOf("###")>-1?e.replace(V8,"."):e,$T=e=>!e||at(e),gf=(e,t,n)=>{const r=at(t)?t.split("."):t;let i=0;for(;i<r.length-1;){if($T(e))return{};const o=IT(r[i]);!e[o]&&n&&(e[o]=new n),Object.prototype.hasOwnProperty.call(e,o)?e=e[o]:e={},++i}return $T(e)?{}:{obj:e,k:IT(r[i])}},FT=(e,t,n)=>{const{obj:r,k:i}=gf(e,t,Object);if(r!==void 0||t.length===1){r[i]=n;return}let o=t[t.length-1],a=t.slice(0,t.length-1),l=gf(e,a,Object);for(;l.obj===void 0&&a.length;)o=`${a[a.length-1]}.${o}`,a=a.slice(0,a.length-1),l=gf(e,a,Object),l?.obj&&typeof l.obj[`${l.k}.${o}`]<"u"&&(l.obj=void 0);l.obj[`${l.k}.${o}`]=n},q8=(e,t,n,r)=>{const{obj:i,k:o}=gf(e,t,Object);i[o]=i[o]||[],i[o].push(n)},eg=(e,t)=>{const{obj:n,k:r}=gf(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},W8=(e,t,n)=>{const r=eg(e,n);return r!==void 0?r:eg(t,n)},e_=(e,t,n)=>{for(const r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?at(e[r])||e[r]instanceof String||at(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):e_(e[r],t[r],n):e[r]=t[r]);return e},Fc=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var K8={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const Y8=e=>at(e)?e.replace(/[&<>"'\/]/g,t=>K8[t]):e;class Z8{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const n=this.regExpMap.get(t);if(n!==void 0)return n;const r=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,r),this.regExpQueue.push(t),r}}const G8=[" ",",","?","!",";"],X8=new Z8(20),Q8=(e,t,n)=>{t=t||"",n=n||"";const r=G8.filter(a=>t.indexOf(a)<0&&n.indexOf(a)<0);if(r.length===0)return!0;const i=X8.getRegExp(`(${r.map(a=>a==="?"?"\\?":a).join("|")})`);let o=!i.test(e);if(!o){const a=e.indexOf(n);a>0&&!i.test(e.substring(0,a))&&(o=!0)}return o},mw=(e,t,n=".")=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;const r=t.split(n);let i=e;for(let o=0;o<r.length;){if(!i||typeof i!="object")return;let a,l="";for(let u=o;u<r.length;++u)if(u!==o&&(l+=n),l+=r[u],a=i[l],a!==void 0){if(["string","number","boolean"].indexOf(typeof a)>-1&&u<r.length-1)continue;o+=u-o+1;break}i=a}return i},_f=e=>e?.replace("_","-"),J8={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console?.[e]?.apply?.(console,t)}};class tg{constructor(t,n={}){this.init(t,n)}init(t,n={}){this.prefix=n.prefix||"i18next:",this.logger=t||J8,this.options=n,this.debug=n.debug}log(...t){return this.forward(t,"log","",!0)}warn(...t){return this.forward(t,"warn","",!0)}error(...t){return this.forward(t,"error","")}deprecate(...t){return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(t,n,r,i){return i&&!this.debug?null:(at(t[0])&&(t[0]=`${r}${this.prefix} ${t[0]}`),this.logger[n](t))}create(t){return new tg(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new tg(this.logger,t)}}var Io=new tg;let wy=class{constructor(){this.observers={}}on(t,n){return t.split(" ").forEach(r=>{this.observers[r]||(this.observers[r]=new Map);const i=this.observers[r].get(n)||0;this.observers[r].set(n,i+1)}),this}off(t,n){if(this.observers[t]){if(!n){delete this.observers[t];return}this.observers[t].delete(n)}}emit(t,...n){this.observers[t]&&Array.from(this.observers[t].entries()).forEach(([i,o])=>{for(let a=0;a<o;a++)i(...n)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([i,o])=>{for(let a=0;a<o;a++)i.apply(i,[t,...n])})}};class BT extends wy{constructor(t,n={ns:["translation"],defaultNS:"translation"}){super(),this.data=t||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const n=this.options.ns.indexOf(t);n>-1&&this.options.ns.splice(n,1)}getResource(t,n,r,i={}){const o=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,a=i.ignoreJSONStructure!==void 0?i.ignoreJSONStructure:this.options.ignoreJSONStructure;let l;t.indexOf(".")>-1?l=t.split("."):(l=[t,n],r&&(Array.isArray(r)?l.push(...r):at(r)&&o?l.push(...r.split(o)):l.push(r)));const u=eg(this.data,l);return!u&&!n&&!r&&t.indexOf(".")>-1&&(t=l[0],n=l[1],r=l.slice(2).join(".")),u||!a||!at(r)?u:mw(this.data?.[t]?.[n],r,o)}addResource(t,n,r,i,o={silent:!1}){const a=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator;let l=[t,n];r&&(l=l.concat(a?r.split(a):r)),t.indexOf(".")>-1&&(l=t.split("."),i=n,n=l[1]),this.addNamespaces(n),FT(this.data,l,i),o.silent||this.emit("added",t,n,r,i)}addResources(t,n,r,i={silent:!1}){for(const o in r)(at(r[o])||Array.isArray(r[o]))&&this.addResource(t,n,o,r[o],{silent:!0});i.silent||this.emit("added",t,n,r)}addResourceBundle(t,n,r,i,o,a={silent:!1,skipCopy:!1}){let l=[t,n];t.indexOf(".")>-1&&(l=t.split("."),i=r,r=n,n=l[1]),this.addNamespaces(n);let u=eg(this.data,l)||{};a.skipCopy||(r=JSON.parse(JSON.stringify(r))),i?e_(u,r,o):u={...u,...r},FT(this.data,l,u),a.silent||this.emit("added",t,n,r)}removeResourceBundle(t,n){this.hasResourceBundle(t,n)&&delete this.data[t][n],this.removeNamespaces(n),this.emit("removed",t,n)}hasResourceBundle(t,n){return this.getResource(t,n)!==void 0}getResourceBundle(t,n){return n||(n=this.options.defaultNS),this.getResource(t,n)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const n=this.getDataByLanguage(t);return!!(n&&Object.keys(n)||[]).find(i=>n[i]&&Object.keys(n[i]).length>0)}toJSON(){return this.data}}var t_={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,i){return e.forEach(o=>{t=this.processors[o]?.process(t,n,r,i)??t}),t}};const n_=Symbol("i18next/PATH_KEY");function eU(){const e=[],t=Object.create(null);let n;return t.get=(r,i)=>(n?.revoke?.(),i===n_?e:(e.push(i),n=Proxy.revocable(r,t),n.proxy)),Proxy.revocable(Object.create(null),t).proxy}function gw(e,t){const{[n_]:n}=e(eU());return n.join(t?.keySeparator??".")}const HT={},G0=e=>!at(e)&&typeof e!="boolean"&&typeof e!="number";class ng extends wy{constructor(t,n={}){super(),U8(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Io.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t,n={interpolation:{}}){const r={...n};if(t==null)return!1;const i=this.resolve(t,r);if(i?.res===void 0)return!1;const o=G0(i.res);return!(r.returnObjects===!1&&o)}extractFromKey(t,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const i=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let o=n.ns||this.options.defaultNS||[];const a=r&&t.indexOf(r)>-1,l=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!Q8(t,r,i);if(a&&!l){const u=t.match(this.interpolator.nestingRegexp);if(u&&u.length>0)return{key:t,namespaces:at(o)?[o]:o};const d=t.split(r);(r!==i||r===i&&this.options.ns.indexOf(d[0])>-1)&&(o=d.shift()),t=d.join(i)}return{key:t,namespaces:at(o)?[o]:o}}translate(t,n,r){let i=typeof n=="object"?{...n}:n;if(typeof i!="object"&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),typeof i=="object"&&(i={...i}),i||(i={}),t==null)return"";typeof t=="function"&&(t=gw(t,{...this.options,...i})),Array.isArray(t)||(t=[String(t)]);const o=i.returnDetails!==void 0?i.returnDetails:this.options.returnDetails,a=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,{key:l,namespaces:u}=this.extractFromKey(t[t.length-1],i),d=u[u.length-1];let h=i.nsSeparator!==void 0?i.nsSeparator:this.options.nsSeparator;h===void 0&&(h=":");const p=i.lng||this.language,g=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(p?.toLowerCase()==="cimode")return g?o?{res:`${d}${h}${l}`,usedKey:l,exactUsedKey:l,usedLng:p,usedNS:d,usedParams:this.getUsedParamsDetails(i)}:`${d}${h}${l}`:o?{res:l,usedKey:l,exactUsedKey:l,usedLng:p,usedNS:d,usedParams:this.getUsedParamsDetails(i)}:l;const y=this.resolve(t,i);let b=y?.res;const C=y?.usedKey||l,E=y?.exactUsedKey||l,k=["[object Number]","[object Function]","[object RegExp]"],O=i.joinArrays!==void 0?i.joinArrays:this.options.joinArrays,A=!this.i18nFormat||this.i18nFormat.handleAsObject,N=i.count!==void 0&&!at(i.count),D=ng.hasDefaultValue(i),L=N?this.pluralResolver.getSuffix(p,i.count,i):"",T=i.ordinal&&N?this.pluralResolver.getSuffix(p,i.count,{ordinal:!1}):"",I=N&&!i.ordinal&&i.count===0,G=I&&i[`defaultValue${this.options.pluralSeparator}zero`]||i[`defaultValue${L}`]||i[`defaultValue${T}`]||i.defaultValue;let te=b;A&&!b&&D&&(te=G);const fe=G0(te),Q=Object.prototype.toString.apply(te);if(A&&te&&fe&&k.indexOf(Q)<0&&!(at(O)&&Array.isArray(te))){if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const J=this.options.returnedObjectHandler?this.options.returnedObjectHandler(C,te,{...i,ns:u}):`key '${l} (${this.language})' returned an object instead of string.`;return o?(y.res=J,y.usedParams=this.getUsedParamsDetails(i),y):J}if(a){const J=Array.isArray(te),H=J?[]:{},q=J?E:C;for(const R in te)if(Object.prototype.hasOwnProperty.call(te,R)){const F=`${q}${a}${R}`;D&&!b?H[R]=this.translate(F,{...i,defaultValue:G0(G)?G[R]:void 0,joinArrays:!1,ns:u}):H[R]=this.translate(F,{...i,joinArrays:!1,ns:u}),H[R]===F&&(H[R]=te[R])}b=H}}else if(A&&at(O)&&Array.isArray(b))b=b.join(O),b&&(b=this.extendTranslation(b,t,i,r));else{let J=!1,H=!1;!this.isValidLookup(b)&&D&&(J=!0,b=G),this.isValidLookup(b)||(H=!0,b=l);const R=(i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&H?void 0:b,F=D&&G!==b&&this.options.updateMissing;if(H||J||F){if(this.logger.log(F?"updateKey":"missingKey",p,d,l,F?G:b),a){const P=this.resolve(l,{...i,keySeparator:!1});P&&P.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let z=[];const B=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if(this.options.saveMissingTo==="fallback"&&B&&B[0])for(let P=0;P<B.length;P++)z.push(B[P]);else this.options.saveMissingTo==="all"?z=this.languageUtils.toResolveHierarchy(i.lng||this.language):z.push(i.lng||this.language);const U=(P,j,$)=>{const K=D&&$!==b?$:R;this.options.missingKeyHandler?this.options.missingKeyHandler(P,d,j,K,F,i):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(P,d,j,K,F,i),this.emit("missingKey",P,d,j,b)};this.options.saveMissing&&(this.options.saveMissingPlurals&&N?z.forEach(P=>{const j=this.pluralResolver.getSuffixes(P,i);I&&i[`defaultValue${this.options.pluralSeparator}zero`]&&j.indexOf(`${this.options.pluralSeparator}zero`)<0&&j.push(`${this.options.pluralSeparator}zero`),j.forEach($=>{U([P],l+$,i[`defaultValue${$}`]||G)})}):U(z,l,G))}b=this.extendTranslation(b,t,i,y,r),H&&b===l&&this.options.appendNamespaceToMissingKey&&(b=`${d}${h}${l}`),(H||J)&&this.options.parseMissingKeyHandler&&(b=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${d}${h}${l}`:l,J?b:void 0,i))}return o?(y.res=b,y.usedParams=this.getUsedParamsDetails(i),y):b}extendTranslation(t,n,r,i,o){if(this.i18nFormat?.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const u=at(t)&&(r?.interpolation?.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let d;if(u){const p=t.match(this.interpolator.nestingRegexp);d=p&&p.length}let h=r.replace&&!at(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(h={...this.options.interpolation.defaultVariables,...h}),t=this.interpolator.interpolate(t,h,r.lng||this.language||i.usedLng,r),u){const p=t.match(this.interpolator.nestingRegexp),g=p&&p.length;d<g&&(r.nest=!1)}!r.lng&&i&&i.res&&(r.lng=this.language||i.usedLng),r.nest!==!1&&(t=this.interpolator.nest(t,(...p)=>o?.[0]===p[0]&&!r.context?(this.logger.warn(`It seems you are nesting recursively key: ${p[0]} in key: ${n[0]}`),null):this.translate(...p,n),r)),r.interpolation&&this.interpolator.reset()}const a=r.postProcess||this.options.postProcess,l=at(a)?[a]:a;return t!=null&&l?.length&&r.applyPostProcessor!==!1&&(t=t_.handle(l,t,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...i,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),t}resolve(t,n={}){let r,i,o,a,l;return at(t)&&(t=[t]),t.forEach(u=>{if(this.isValidLookup(r))return;const d=this.extractFromKey(u,n),h=d.key;i=h;let p=d.namespaces;this.options.fallbackNS&&(p=p.concat(this.options.fallbackNS));const g=n.count!==void 0&&!at(n.count),y=g&&!n.ordinal&&n.count===0,b=n.context!==void 0&&(at(n.context)||typeof n.context=="number")&&n.context!=="",C=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);p.forEach(E=>{this.isValidLookup(r)||(l=E,!HT[`${C[0]}-${E}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(l)&&(HT[`${C[0]}-${E}`]=!0,this.logger.warn(`key "${i}" for languages "${C.join(", ")}" won't get resolved as namespace "${l}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),C.forEach(k=>{if(this.isValidLookup(r))return;a=k;const O=[h];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(O,h,k,E,n);else{let N;g&&(N=this.pluralResolver.getSuffix(k,n.count,n));const D=`${this.options.pluralSeparator}zero`,L=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(g&&(n.ordinal&&N.indexOf(L)===0&&O.push(h+N.replace(L,this.options.pluralSeparator)),O.push(h+N),y&&O.push(h+D)),b){const T=`${h}${this.options.contextSeparator||"_"}${n.context}`;O.push(T),g&&(n.ordinal&&N.indexOf(L)===0&&O.push(T+N.replace(L,this.options.pluralSeparator)),O.push(T+N),y&&O.push(T+D))}}let A;for(;A=O.pop();)this.isValidLookup(r)||(o=A,r=this.getResource(k,E,A,n))}))})}),{res:r,usedKey:i,exactUsedKey:o,usedLng:a,usedNS:l}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,n,r,i={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(t,n,r,i):this.resourceStore.getResource(t,n,r,i)}getUsedParamsDetails(t={}){const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=t.replace&&!at(t.replace);let i=r?t.replace:t;if(r&&typeof t.count<"u"&&(i.count=t.count),this.options.interpolation.defaultVariables&&(i={...this.options.interpolation.defaultVariables,...i}),!r){i={...i};for(const o of n)delete i[o]}return i}static hasDefaultValue(t){const n="defaultValue";for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&n===r.substring(0,n.length)&&t[r]!==void 0)return!0;return!1}}class UT{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Io.create("languageUtils")}getScriptPartFromCode(t){if(t=_f(t),!t||t.indexOf("-")<0)return null;const n=t.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(t){if(t=_f(t),!t||t.indexOf("-")<0)return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(at(t)&&t.indexOf("-")>-1){let n;try{n=Intl.getCanonicalLocales(t)[0]}catch{}return n&&this.options.lowerCaseLng&&(n=n.toLowerCase()),n||(this.options.lowerCaseLng?t.toLowerCase():t)}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let n;return t.forEach(r=>{if(n)return;const i=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(i))&&(n=i)}),!n&&this.options.supportedLngs&&t.forEach(r=>{if(n)return;const i=this.getScriptPartFromCode(r);if(this.isSupportedCode(i))return n=i;const o=this.getLanguagePartFromCode(r);if(this.isSupportedCode(o))return n=o;n=this.options.supportedLngs.find(a=>{if(a===o)return a;if(!(a.indexOf("-")<0&&o.indexOf("-")<0)&&(a.indexOf("-")>0&&o.indexOf("-")<0&&a.substring(0,a.indexOf("-"))===o||a.indexOf(o)===0&&o.length>1))return a})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(t,n){if(!t)return[];if(typeof t=="function"&&(t=t(n)),at(t)&&(t=[t]),Array.isArray(t))return t;if(!n)return t.default||[];let r=t[n];return r||(r=t[this.getScriptPartFromCode(n)]),r||(r=t[this.formatLanguageCode(n)]),r||(r=t[this.getLanguagePartFromCode(n)]),r||(r=t.default),r||[]}toResolveHierarchy(t,n){const r=this.getFallbackCodes((n===!1?[]:n)||this.options.fallbackLng||[],t),i=[],o=a=>{a&&(this.isSupportedCode(a)?i.push(a):this.logger.warn(`rejecting language code not found in supportedLngs: ${a}`))};return at(t)&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&o(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&o(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&o(this.getLanguagePartFromCode(t))):at(t)&&o(this.formatLanguageCode(t)),r.forEach(a=>{i.indexOf(a)<0&&o(this.formatLanguageCode(a))}),i}}const VT={zero:0,one:1,two:2,few:3,many:4,other:5},qT={select:e=>e===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class tU{constructor(t,n={}){this.languageUtils=t,this.options=n,this.logger=Io.create("pluralResolver"),this.pluralRulesCache={}}addRule(t,n){this.rules[t]=n}clearCache(){this.pluralRulesCache={}}getRule(t,n={}){const r=_f(t==="dev"?"en":t),i=n.ordinal?"ordinal":"cardinal",o=JSON.stringify({cleanedCode:r,type:i});if(o in this.pluralRulesCache)return this.pluralRulesCache[o];let a;try{a=new Intl.PluralRules(r,{type:i})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),qT;if(!t.match(/-|_/))return qT;const u=this.languageUtils.getLanguagePartFromCode(t);a=this.getRule(u,n)}return this.pluralRulesCache[o]=a,a}needsPlural(t,n={}){let r=this.getRule(t,n);return r||(r=this.getRule("dev",n)),r?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(t,n,r={}){return this.getSuffixes(t,r).map(i=>`${n}${i}`)}getSuffixes(t,n={}){let r=this.getRule(t,n);return r||(r=this.getRule("dev",n)),r?r.resolvedOptions().pluralCategories.sort((i,o)=>VT[i]-VT[o]).map(i=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${i}`):[]}getSuffix(t,n,r={}){const i=this.getRule(t,r);return i?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${i.select(n)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",n,r))}}const WT=(e,t,n,r=".",i=!0)=>{let o=W8(e,t,n);return!o&&i&&at(n)&&(o=mw(e,n,r),o===void 0&&(o=mw(t,n,r))),o},X0=e=>e.replace(/\$/g,"$$$$");class nU{constructor(t={}){this.logger=Io.create("interpolator"),this.options=t,this.format=t?.interpolation?.format||(n=>n),this.init(t)}init(t={}){t.interpolation||(t.interpolation={escapeValue:!0});const{escape:n,escapeValue:r,useRawValueToEscape:i,prefix:o,prefixEscaped:a,suffix:l,suffixEscaped:u,formatSeparator:d,unescapeSuffix:h,unescapePrefix:p,nestingPrefix:g,nestingPrefixEscaped:y,nestingSuffix:b,nestingSuffixEscaped:C,nestingOptionsSeparator:E,maxReplaces:k,alwaysFormat:O}=t.interpolation;this.escape=n!==void 0?n:Y8,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=i!==void 0?i:!1,this.prefix=o?Fc(o):a||"{{",this.suffix=l?Fc(l):u||"}}",this.formatSeparator=d||",",this.unescapePrefix=h?"":p||"-",this.unescapeSuffix=this.unescapePrefix?"":h||"",this.nestingPrefix=g?Fc(g):y||Fc("$t("),this.nestingSuffix=b?Fc(b):C||Fc(")"),this.nestingOptionsSeparator=E||",",this.maxReplaces=k||1e3,this.alwaysFormat=O!==void 0?O:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(n,r)=>n?.source===r?(n.lastIndex=0,n):new RegExp(r,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(t,n,r,i){let o,a,l;const u=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},d=y=>{if(y.indexOf(this.formatSeparator)<0){const k=WT(n,u,y,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(k,void 0,r,{...i,...n,interpolationkey:y}):k}const b=y.split(this.formatSeparator),C=b.shift().trim(),E=b.join(this.formatSeparator).trim();return this.format(WT(n,u,C,this.options.keySeparator,this.options.ignoreJSONStructure),E,r,{...i,...n,interpolationkey:C})};this.resetRegExp();const h=i?.missingInterpolationHandler||this.options.missingInterpolationHandler,p=i?.interpolation?.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:y=>X0(y)},{regex:this.regexp,safeValue:y=>this.escapeValue?X0(this.escape(y)):X0(y)}].forEach(y=>{for(l=0;o=y.regex.exec(t);){const b=o[1].trim();if(a=d(b),a===void 0)if(typeof h=="function"){const E=h(t,o,i);a=at(E)?E:""}else if(i&&Object.prototype.hasOwnProperty.call(i,b))a="";else if(p){a=o[0];continue}else this.logger.warn(`missed to pass in variable ${b} for interpolating ${t}`),a="";else!at(a)&&!this.useRawValueToEscape&&(a=zT(a));const C=y.safeValue(a);if(t=t.replace(o[0],C),p?(y.regex.lastIndex+=a.length,y.regex.lastIndex-=o[0].length):y.regex.lastIndex=0,l++,l>=this.maxReplaces)break}}),t}nest(t,n,r={}){let i,o,a;const l=(u,d)=>{const h=this.nestingOptionsSeparator;if(u.indexOf(h)<0)return u;const p=u.split(new RegExp(`${h}[ ]*{`));let g=`{${p[1]}`;u=p[0],g=this.interpolate(g,a);const y=g.match(/'/g),b=g.match(/"/g);((y?.length??0)%2===0&&!b||b.length%2!==0)&&(g=g.replace(/'/g,'"'));try{a=JSON.parse(g),d&&(a={...d,...a})}catch(C){return this.logger.warn(`failed parsing options string in nesting for key ${u}`,C),`${u}${h}${g}`}return a.defaultValue&&a.defaultValue.indexOf(this.prefix)>-1&&delete a.defaultValue,u};for(;i=this.nestingRegexp.exec(t);){let u=[];a={...r},a=a.replace&&!at(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;const d=/{.*}/.test(i[1])?i[1].lastIndexOf("}")+1:i[1].indexOf(this.formatSeparator);if(d!==-1&&(u=i[1].slice(d).split(this.formatSeparator).map(h=>h.trim()).filter(Boolean),i[1]=i[1].slice(0,d)),o=n(l.call(this,i[1].trim(),a),a),o&&i[0]===t&&!at(o))return o;at(o)||(o=zT(o)),o||(this.logger.warn(`missed to resolve ${i[1]} for nesting ${t}`),o=""),u.length&&(o=u.reduce((h,p)=>this.format(h,p,r.lng,{...r,interpolationkey:i[1].trim()}),o.trim())),t=t.replace(i[0],o),this.regexp.lastIndex=0}return t}}const rU=e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const i=r[1].substring(0,r[1].length-1);t==="currency"&&i.indexOf(":")<0?n.currency||(n.currency=i.trim()):t==="relativetime"&&i.indexOf(":")<0?n.range||(n.range=i.trim()):i.split(";").forEach(a=>{if(a){const[l,...u]=a.split(":"),d=u.join(":").trim().replace(/^'+|'+$/g,""),h=l.trim();n[h]||(n[h]=d),d==="false"&&(n[h]=!1),d==="true"&&(n[h]=!0),isNaN(d)||(n[h]=parseInt(d,10))}})}return{formatName:t,formatOptions:n}},KT=e=>{const t={};return(n,r,i)=>{let o=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(o={...o,[i.interpolationkey]:void 0});const a=r+JSON.stringify(o);let l=t[a];return l||(l=e(_f(r),i),t[a]=l),l(n)}},iU=e=>(t,n,r)=>e(_f(n),r)(t);class oU{constructor(t={}){this.logger=Io.create("formatter"),this.options=t,this.init(t)}init(t,n={interpolation:{}}){this.formatSeparator=n.interpolation.formatSeparator||",";const r=n.cacheInBuiltFormats?KT:iU;this.formats={number:r((i,o)=>{const a=new Intl.NumberFormat(i,{...o});return l=>a.format(l)}),currency:r((i,o)=>{const a=new Intl.NumberFormat(i,{...o,style:"currency"});return l=>a.format(l)}),datetime:r((i,o)=>{const a=new Intl.DateTimeFormat(i,{...o});return l=>a.format(l)}),relativetime:r((i,o)=>{const a=new Intl.RelativeTimeFormat(i,{...o});return l=>a.format(l,o.range||"day")}),list:r((i,o)=>{const a=new Intl.ListFormat(i,{...o});return l=>a.format(l)})}}add(t,n){this.formats[t.toLowerCase().trim()]=n}addCached(t,n){this.formats[t.toLowerCase().trim()]=KT(n)}format(t,n,r,i={}){const o=n.split(this.formatSeparator);if(o.length>1&&o[0].indexOf("(")>1&&o[0].indexOf(")")<0&&o.find(l=>l.indexOf(")")>-1)){const l=o.findIndex(u=>u.indexOf(")")>-1);o[0]=[o[0],...o.splice(1,l)].join(this.formatSeparator)}return o.reduce((l,u)=>{const{formatName:d,formatOptions:h}=rU(u);if(this.formats[d]){let p=l;try{const g=i?.formatParams?.[i.interpolationkey]||{},y=g.locale||g.lng||i.locale||i.lng||r;p=this.formats[d](l,y,{...h,...i,...g})}catch(g){this.logger.warn(g)}return p}else this.logger.warn(`there was no format function for ${d}`);return l},t)}}const aU=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class sU extends wy{constructor(t,n,r,i={}){super(),this.backend=t,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=i,this.logger=Io.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=i.maxParallelReads||10,this.readingCalls=0,this.maxRetries=i.maxRetries>=0?i.maxRetries:5,this.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(r,i.backend,i)}queueLoad(t,n,r,i){const o={},a={},l={},u={};return t.forEach(d=>{let h=!0;n.forEach(p=>{const g=`${d}|${p}`;!r.reload&&this.store.hasResourceBundle(d,p)?this.state[g]=2:this.state[g]<0||(this.state[g]===1?a[g]===void 0&&(a[g]=!0):(this.state[g]=1,h=!1,a[g]===void 0&&(a[g]=!0),o[g]===void 0&&(o[g]=!0),u[p]===void 0&&(u[p]=!0)))}),h||(l[d]=!0)}),(Object.keys(o).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(o),pending:Object.keys(a),toLoadLanguages:Object.keys(l),toLoadNamespaces:Object.keys(u)}}loaded(t,n,r){const i=t.split("|"),o=i[0],a=i[1];n&&this.emit("failedLoading",o,a,n),!n&&r&&this.store.addResourceBundle(o,a,r,void 0,void 0,{skipCopy:!0}),this.state[t]=n?-1:2,n&&r&&(this.state[t]=0);const l={};this.queue.forEach(u=>{q8(u.loaded,[o],a),aU(u,t),n&&u.errors.push(n),u.pendingCount===0&&!u.done&&(Object.keys(u.loaded).forEach(d=>{l[d]||(l[d]={});const h=u.loaded[d];h.length&&h.forEach(p=>{l[d][p]===void 0&&(l[d][p]=!0)})}),u.done=!0,u.errors.length?u.callback(u.errors):u.callback())}),this.emit("loaded",l),this.queue=this.queue.filter(u=>!u.done)}read(t,n,r,i=0,o=this.retryTimeout,a){if(!t.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:r,tried:i,wait:o,callback:a});return}this.readingCalls++;const l=(d,h)=>{if(this.readingCalls--,this.waitingReads.length>0){const p=this.waitingReads.shift();this.read(p.lng,p.ns,p.fcName,p.tried,p.wait,p.callback)}if(d&&h&&i<this.maxRetries){setTimeout(()=>{this.read.call(this,t,n,r,i+1,o*2,a)},o);return}a(d,h)},u=this.backend[r].bind(this.backend);if(u.length===2){try{const d=u(t,n);d&&typeof d.then=="function"?d.then(h=>l(null,h)).catch(l):l(null,d)}catch(d){l(d)}return}return u(t,n,l)}prepareLoading(t,n,r={},i){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();at(t)&&(t=this.languageUtils.toResolveHierarchy(t)),at(n)&&(n=[n]);const o=this.queueLoad(t,n,r,i);if(!o.toLoad.length)return o.pending.length||i(),null;o.toLoad.forEach(a=>{this.loadOne(a)})}load(t,n,r){this.prepareLoading(t,n,{},r)}reload(t,n,r){this.prepareLoading(t,n,{reload:!0},r)}loadOne(t,n=""){const r=t.split("|"),i=r[0],o=r[1];this.read(i,o,"read",void 0,void 0,(a,l)=>{a&&this.logger.warn(`${n}loading namespace ${o} for language ${i} failed`,a),!a&&l&&this.logger.log(`${n}loaded namespace ${o} for language ${i}`,l),this.loaded(t,a,l)})}saveMissing(t,n,r,i,o,a={},l=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(n)){this.logger.warn(`did not save key "${r}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if(this.backend?.create){const u={...a,isUpdate:o},d=this.backend.create.bind(this.backend);if(d.length<6)try{let h;d.length===5?h=d(t,n,r,i,u):h=d(t,n,r,i),h&&typeof h.then=="function"?h.then(p=>l(null,p)).catch(l):l(null,h)}catch(h){l(h)}else d(t,n,r,i,l,u)}!t||!t[0]||this.store.addResource(t[0],n,r,i)}}}const YT=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]=="object"&&(t=e[1]),at(e[1])&&(t.defaultValue=e[1]),at(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const n=e[3]||e[2];Object.keys(n).forEach(r=>{t[r]=n[r]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),ZT=e=>(at(e.ns)&&(e.ns=[e.ns]),at(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),at(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs?.indexOf?.("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),typeof e.initImmediate=="boolean"&&(e.initAsync=e.initImmediate),e),Xp=()=>{},lU=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})};class yf extends wy{constructor(t={},n){if(super(),this.options=ZT(t),this.services={},this.logger=Io,this.modules={external:[]},lU(this),n&&!this.isInitialized&&!t.isClone){if(!this.options.initAsync)return this.init(t,n),this;setTimeout(()=>{this.init(t,n)},0)}}init(t={},n){this.isInitializing=!0,typeof t=="function"&&(n=t,t={}),t.defaultNS==null&&t.ns&&(at(t.ns)?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const r=YT();this.options={...r,...this.options,...ZT(t)},this.options.interpolation={...r.interpolation,...this.options.interpolation},t.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=t.keySeparator),t.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=t.nsSeparator);const i=d=>d?typeof d=="function"?new d:d:null;if(!this.options.isClone){this.modules.logger?Io.init(i(this.modules.logger),this.options):Io.init(null,this.options);let d;this.modules.formatter?d=this.modules.formatter:d=oU;const h=new UT(this.options);this.store=new BT(this.options.resources,this.options);const p=this.services;p.logger=Io,p.resourceStore=this.store,p.languageUtils=h,p.pluralResolver=new tU(h,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==r.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),d&&(!this.options.interpolation.format||this.options.interpolation.format===r.interpolation.format)&&(p.formatter=i(d),p.formatter.init&&p.formatter.init(p,this.options),this.options.interpolation.format=p.formatter.format.bind(p.formatter)),p.interpolator=new nU(this.options),p.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},p.backendConnector=new sU(i(this.modules.backend),p.resourceStore,p,this.options),p.backendConnector.on("*",(y,...b)=>{this.emit(y,...b)}),this.modules.languageDetector&&(p.languageDetector=i(this.modules.languageDetector),p.languageDetector.init&&p.languageDetector.init(p,this.options.detection,this.options)),this.modules.i18nFormat&&(p.i18nFormat=i(this.modules.i18nFormat),p.i18nFormat.init&&p.i18nFormat.init(this)),this.translator=new ng(this.services,this.options),this.translator.on("*",(y,...b)=>{this.emit(y,...b)}),this.modules.external.forEach(y=>{y.init&&y.init(this)})}if(this.format=this.options.interpolation.format,n||(n=Xp),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const d=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);d.length>0&&d[0]!=="dev"&&(this.options.lng=d[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(d=>{this[d]=(...h)=>this.store[d](...h)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(d=>{this[d]=(...h)=>(this.store[d](...h),this)});const l=Kd(),u=()=>{const d=(h,p)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),l.resolve(p),n(h,p)};if(this.languages&&!this.isInitialized)return d(null,this.t.bind(this));this.changeLanguage(this.options.lng,d)};return this.options.resources||!this.options.initAsync?u():setTimeout(u,0),l}loadResources(t,n=Xp){let r=n;const i=at(t)?t:this.language;if(typeof t=="function"&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if(i?.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const o=[],a=l=>{if(!l||l==="cimode")return;this.services.languageUtils.toResolveHierarchy(l).forEach(d=>{d!=="cimode"&&o.indexOf(d)<0&&o.push(d)})};i?a(i):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(u=>a(u)),this.options.preload?.forEach?.(l=>a(l)),this.services.backendConnector.load(o,this.options.ns,l=>{!l&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(l)})}else r(null)}reloadResources(t,n,r){const i=Kd();return typeof t=="function"&&(r=t,t=void 0),typeof n=="function"&&(r=n,n=void 0),t||(t=this.languages),n||(n=this.options.ns),r||(r=Xp),this.services.backendConnector.reload(t,n,o=>{i.resolve(),r(o)}),i}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&t_.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!(["cimode","dev"].indexOf(t)>-1)){for(let n=0;n<this.languages.length;n++){const r=this.languages[n];if(!(["cimode","dev"].indexOf(r)>-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}!this.resolvedLanguage&&this.languages.indexOf(t)<0&&this.store.hasLanguageSomeTranslations(t)&&(this.resolvedLanguage=t,this.languages.unshift(t))}}changeLanguage(t,n){this.isLanguageChangingTo=t;const r=Kd();this.emit("languageChanging",t);const i=l=>{this.language=l,this.languages=this.services.languageUtils.toResolveHierarchy(l),this.resolvedLanguage=void 0,this.setResolvedLanguage(l)},o=(l,u)=>{u?this.isLanguageChangingTo===t&&(i(u),this.translator.changeLanguage(u),this.isLanguageChangingTo=void 0,this.emit("languageChanged",u),this.logger.log("languageChanged",u)):this.isLanguageChangingTo=void 0,r.resolve((...d)=>this.t(...d)),n&&n(l,(...d)=>this.t(...d))},a=l=>{!t&&!l&&this.services.languageDetector&&(l=[]);const u=at(l)?l:l&&l[0],d=this.store.hasLanguageSomeTranslations(u)?u:this.services.languageUtils.getBestMatchFromCodes(at(l)?[l]:l);d&&(this.language||i(d),this.translator.language||this.translator.changeLanguage(d),this.services.languageDetector?.cacheUserLanguage?.(d)),this.loadResources(d,h=>{o(h,d)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?a(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(t),r}getFixedT(t,n,r){const i=(o,a,...l)=>{let u;typeof a!="object"?u=this.options.overloadTranslationOptionHandler([o,a].concat(l)):u={...a},u.lng=u.lng||i.lng,u.lngs=u.lngs||i.lngs,u.ns=u.ns||i.ns,u.keyPrefix!==""&&(u.keyPrefix=u.keyPrefix||r||i.keyPrefix);const d=this.options.keySeparator||".";let h;return u.keyPrefix&&Array.isArray(o)?h=o.map(p=>(typeof p=="function"&&(p=gw(p,{...this.options,...a})),`${u.keyPrefix}${d}${p}`)):(typeof o=="function"&&(o=gw(o,{...this.options,...a})),h=u.keyPrefix?`${u.keyPrefix}${d}${o}`:o),this.t(h,u)};return at(t)?i.lng=t:i.lngs=t,i.ns=n,i.keyPrefix=r,i}t(...t){return this.translator?.translate(...t)}exists(...t){return this.translator?.exists(...t)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t,n={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const r=n.lng||this.resolvedLanguage||this.languages[0],i=this.options?this.options.fallbackLng:!1,o=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const a=(l,u)=>{const d=this.services.backendConnector.state[`${l}|${u}`];return d===-1||d===0||d===2};if(n.precheck){const l=n.precheck(this,a);if(l!==void 0)return l}return!!(this.hasResourceBundle(r,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(r,t)&&(!i||a(o,t)))}loadNamespaces(t,n){const r=Kd();return this.options.ns?(at(t)&&(t=[t]),t.forEach(i=>{this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}),this.loadResources(i=>{r.resolve(),n&&n(i)}),r):(n&&n(),Promise.resolve())}loadLanguages(t,n){const r=Kd();at(t)&&(t=[t]);const i=this.options.preload||[],o=t.filter(a=>i.indexOf(a)<0&&this.services.languageUtils.isSupportedCode(a));return o.length?(this.options.preload=i.concat(o),this.loadResources(a=>{r.resolve(),n&&n(a)}),r):(n&&n(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!t)return"rtl";try{const i=new Intl.Locale(t);if(i&&i.getTextInfo){const o=i.getTextInfo();if(o&&o.direction)return o.direction}}catch{}const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],r=this.services?.languageUtils||new UT(YT());return t.toLowerCase().indexOf("-latn")>1?"ltr":n.indexOf(r.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(t={},n){const r=new yf(t,n);return r.createInstance=yf.createInstance,r}cloneInstance(t={},n=Xp){const r=t.forkResourceStore;r&&delete t.forkResourceStore;const i={...this.options,...t,isClone:!0},o=new yf(i);if((t.debug!==void 0||t.prefix!==void 0)&&(o.logger=o.logger.clone(t)),["store","services","language"].forEach(l=>{o[l]=this[l]}),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},r){const l=Object.keys(this.store.data).reduce((u,d)=>(u[d]={...this.store.data[d]},u[d]=Object.keys(u[d]).reduce((h,p)=>(h[p]={...u[d][p]},h),u[d]),u),{});o.store=new BT(l,i),o.services.resourceStore=o.store}return o.translator=new ng(o.services,i),o.translator.on("*",(l,...u)=>{o.emit(l,...u)}),o.init(i,n),o.translator.options=i,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Hr=yf.createInstance();Hr.createInstance;Hr.dir;Hr.init;Hr.loadResources;Hr.reloadResources;Hr.use;Hr.changeLanguage;Hr.getFixedT;Hr.t;Hr.exists;Hr.setDefaultNamespace;Hr.hasLoadedNamespace;Hr.loadNamespaces;Hr.loadLanguages;const{slice:cU,forEach:uU}=[];function dU(e){return uU.call(cU.call(arguments,1),t=>{if(t)for(const n in t)e[n]===void 0&&(e[n]=t[n])}),e}function fU(e){return typeof e!="string"?!1:[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some(n=>n.test(e))}const GT=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,hU=function(e,t){const r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},i=encodeURIComponent(t);let o=`${e}=${i}`;if(r.maxAge>0){const a=r.maxAge-0;if(Number.isNaN(a))throw new Error("maxAge should be a Number");o+=`; Max-Age=${Math.floor(a)}`}if(r.domain){if(!GT.test(r.domain))throw new TypeError("option domain is invalid");o+=`; Domain=${r.domain}`}if(r.path){if(!GT.test(r.path))throw new TypeError("option path is invalid");o+=`; Path=${r.path}`}if(r.expires){if(typeof r.expires.toUTCString!="function")throw new TypeError("option expires is invalid");o+=`; Expires=${r.expires.toUTCString()}`}if(r.httpOnly&&(o+="; HttpOnly"),r.secure&&(o+="; Secure"),r.sameSite)switch(typeof r.sameSite=="string"?r.sameSite.toLowerCase():r.sameSite){case!0:o+="; SameSite=Strict";break;case"lax":o+="; SameSite=Lax";break;case"strict":o+="; SameSite=Strict";break;case"none":o+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return r.partitioned&&(o+="; Partitioned"),o},XT={create(e,t,n,r){let i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};n&&(i.expires=new Date,i.expires.setTime(i.expires.getTime()+n*60*1e3)),r&&(i.domain=r),document.cookie=hU(e,t,i)},read(e){const t=`${e}=`,n=document.cookie.split(";");for(let r=0;r<n.length;r++){let i=n[r];for(;i.charAt(0)===" ";)i=i.substring(1,i.length);if(i.indexOf(t)===0)return i.substring(t.length,i.length)}return null},remove(e,t){this.create(e,"",-1,t)}};var pU={name:"cookie",lookup(e){let{lookupCookie:t}=e;if(t&&typeof document<"u")return XT.read(t)||void 0},cacheUserLanguage(e,t){let{lookupCookie:n,cookieMinutes:r,cookieDomain:i,cookieOptions:o}=t;n&&typeof document<"u"&&XT.create(n,e,r,i,o)}},mU={name:"querystring",lookup(e){let{lookupQuerystring:t}=e,n;if(typeof window<"u"){let{search:r}=window.location;!window.location.search&&window.location.hash?.indexOf("?")>-1&&(r=window.location.hash.substring(window.location.hash.indexOf("?")));const o=r.substring(1).split("&");for(let a=0;a<o.length;a++){const l=o[a].indexOf("=");l>0&&o[a].substring(0,l)===t&&(n=o[a].substring(l+1))}}return n}},gU={name:"hash",lookup(e){let{lookupHash:t,lookupFromHashIndex:n}=e,r;if(typeof window<"u"){const{hash:i}=window.location;if(i&&i.length>2){const o=i.substring(1);if(t){const a=o.split("&");for(let l=0;l<a.length;l++){const u=a[l].indexOf("=");u>0&&a[l].substring(0,u)===t&&(r=a[l].substring(u+1))}}if(r)return r;if(!r&&n>-1){const a=i.match(/\/([a-zA-Z-]*)/g);return Array.isArray(a)?a[typeof n=="number"?n:0]?.replace("/",""):void 0}}}return r}};let Bc=null;const QT=()=>{if(Bc!==null)return Bc;try{if(Bc=typeof window<"u"&&window.localStorage!==null,!Bc)return!1;const e="i18next.translate.boo";window.localStorage.setItem(e,"foo"),window.localStorage.removeItem(e)}catch{Bc=!1}return Bc};var yU={name:"localStorage",lookup(e){let{lookupLocalStorage:t}=e;if(t&&QT())return window.localStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupLocalStorage:n}=t;n&&QT()&&window.localStorage.setItem(n,e)}};let Hc=null;const JT=()=>{if(Hc!==null)return Hc;try{if(Hc=typeof window<"u"&&window.sessionStorage!==null,!Hc)return!1;const e="i18next.translate.boo";window.sessionStorage.setItem(e,"foo"),window.sessionStorage.removeItem(e)}catch{Hc=!1}return Hc};var vU={name:"sessionStorage",lookup(e){let{lookupSessionStorage:t}=e;if(t&&JT())return window.sessionStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupSessionStorage:n}=t;n&&JT()&&window.sessionStorage.setItem(n,e)}},bU={name:"navigator",lookup(e){const t=[];if(typeof navigator<"u"){const{languages:n,userLanguage:r,language:i}=navigator;if(n)for(let o=0;o<n.length;o++)t.push(n[o]);r&&t.push(r),i&&t.push(i)}return t.length>0?t:void 0}},xU={name:"htmlTag",lookup(e){let{htmlTag:t}=e,n;const r=t||(typeof document<"u"?document.documentElement:null);return r&&typeof r.getAttribute=="function"&&(n=r.getAttribute("lang")),n}},wU={name:"path",lookup(e){let{lookupFromPathIndex:t}=e;if(typeof window>"u")return;const n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(n)?n[typeof t=="number"?t:0]?.replace("/",""):void 0}},SU={name:"subdomain",lookup(e){let{lookupFromSubdomainIndex:t}=e;const n=typeof t=="number"?t+1:1,r=typeof window<"u"&&window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(r)return r[n]}};let r_=!1;try{document.cookie,r_=!0}catch{}const i_=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];r_||i_.splice(1,1);const CU=()=>({order:i_,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:e=>e});class o_{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(t,n)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=t,this.options=dU(n,this.options||{},CU()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=i=>i.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=r,this.addDetector(pU),this.addDetector(mU),this.addDetector(yU),this.addDetector(vU),this.addDetector(bU),this.addDetector(xU),this.addDetector(wU),this.addDetector(SU),this.addDetector(gU)}addDetector(t){return this.detectors[t.name]=t,this}detect(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,n=[];return t.forEach(r=>{if(this.detectors[r]){let i=this.detectors[r].lookup(this.options);i&&typeof i=="string"&&(i=[i]),i&&(n=n.concat(i))}}),n=n.filter(r=>r!=null&&!fU(r)).map(r=>this.options.convertDetectedLanguage(r)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?n:n.length>0?n[0]:null}cacheUserLanguage(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;n&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(t)>-1||n.forEach(r=>{this.detectors[r]&&this.detectors[r].cacheUserLanguage(t,this.options)}))}}o_.type="languageDetector";function yw(e){"@babel/helpers - typeof";return yw=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yw(e)}function a_(){return typeof XMLHttpRequest=="function"||(typeof XMLHttpRequest>"u"?"undefined":yw(XMLHttpRequest))==="object"}function EU(e){return!!e&&typeof e.then=="function"}function kU(e){return EU(e)?e:Promise.resolve(e)}const MU="modulepreload",OU=function(e){return"/"+e},eA={},TU=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){let u=function(d){return Promise.all(d.map(h=>Promise.resolve(h).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),l=a?.nonce||a?.getAttribute("nonce");i=u(n.map(d=>{if(d=OU(d),d in eA)return;eA[d]=!0;const h=d.endsWith(".css"),p=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${p}`))return;const g=document.createElement("link");if(g.rel=h?"stylesheet":MU,h||(g.as="script"),g.crossOrigin="",g.href=d,l&&g.setAttribute("nonce",l),document.head.appendChild(g),h)return new Promise((y,b)=>{g.addEventListener("load",y),g.addEventListener("error",()=>b(new Error(`Unable to preload CSS for ${d}`)))})}))}function o(a){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=a,window.dispatchEvent(l),!l.defaultPrevented)throw a}return i.then(a=>{for(const l of a||[])l.status==="rejected"&&o(l.reason);return t().catch(o)})};function tA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function nA(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?tA(Object(n),!0).forEach(function(r){AU(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function AU(e,t,n){return(t=DU(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function DU(e){var t=RU(e,"string");return jl(t)=="symbol"?t:t+""}function RU(e,t){if(jl(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(jl(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function jl(e){"@babel/helpers - typeof";return jl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},jl(e)}var Ls=typeof fetch=="function"?fetch:void 0;typeof global<"u"&&global.fetch?Ls=global.fetch:typeof window<"u"&&window.fetch&&(Ls=window.fetch);var jf;a_()&&(typeof global<"u"&&global.XMLHttpRequest?jf=global.XMLHttpRequest:typeof window<"u"&&window.XMLHttpRequest&&(jf=window.XMLHttpRequest));var rg;typeof ActiveXObject=="function"&&(typeof global<"u"&&global.ActiveXObject?rg=global.ActiveXObject:typeof window<"u"&&window.ActiveXObject&&(rg=window.ActiveXObject));typeof Ls!="function"&&(Ls=void 0);if(!Ls&&!jf&&!rg)try{TU(()=>import("./browser-ponyfill-Ct7s-5jI.js").then(e=>e.b),[]).then(function(e){Ls=e.default}).catch(function(){})}catch{}var vw=function(t,n){if(n&&jl(n)==="object"){var r="";for(var i in n)r+="&"+encodeURIComponent(i)+"="+encodeURIComponent(n[i]);if(!r)return t;t=t+(t.indexOf("?")!==-1?"&":"?")+r.slice(1)}return t},rA=function(t,n,r,i){var o=function(u){if(!u.ok)return r(u.statusText||"Error",{status:u.status});u.text().then(function(d){r(null,{status:u.status,data:d})}).catch(r)};if(i){var a=i(t,n);if(a instanceof Promise){a.then(o).catch(r);return}}typeof fetch=="function"?fetch(t,n).then(o).catch(r):Ls(t,n).then(o).catch(r)},iA=!1,NU=function(t,n,r,i){t.queryStringParams&&(n=vw(n,t.queryStringParams));var o=nA({},typeof t.customHeaders=="function"?t.customHeaders():t.customHeaders);typeof window>"u"&&typeof global<"u"&&typeof global.process<"u"&&global.process.versions&&global.process.versions.node&&(o["User-Agent"]="i18next-http-backend (node/".concat(global.process.version,"; ").concat(global.process.platform," ").concat(global.process.arch,")")),r&&(o["Content-Type"]="application/json");var a=typeof t.requestOptions=="function"?t.requestOptions(r):t.requestOptions,l=nA({method:r?"POST":"GET",body:r?t.stringify(r):void 0,headers:o},iA?{}:a),u=typeof t.alternateFetch=="function"&&t.alternateFetch.length>=1?t.alternateFetch:void 0;try{rA(n,l,i,u)}catch(d){if(!a||Object.keys(a).length===0||!d.message||d.message.indexOf("not implemented")<0)return i(d);try{Object.keys(a).forEach(function(h){delete l[h]}),rA(n,l,i,u),iA=!0}catch(h){i(h)}}},_U=function(t,n,r,i){r&&jl(r)==="object"&&(r=vw("",r).slice(1)),t.queryStringParams&&(n=vw(n,t.queryStringParams));try{var o=jf?new jf:new rg("MSXML2.XMLHTTP.3.0");o.open(r?"POST":"GET",n,1),t.crossDomain||o.setRequestHeader("X-Requested-With","XMLHttpRequest"),o.withCredentials=!!t.withCredentials,r&&o.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),o.overrideMimeType&&o.overrideMimeType("application/json");var a=t.customHeaders;if(a=typeof a=="function"?a():a,a)for(var l in a)o.setRequestHeader(l,a[l]);o.onreadystatechange=function(){o.readyState>3&&i(o.status>=400?o.statusText:null,{status:o.status,data:o.responseText})},o.send(r)}catch(u){console&&console.log(u)}},jU=function(t,n,r,i){if(typeof r=="function"&&(i=r,r=void 0),i=i||function(){},Ls&&n.indexOf("file:")!==0)return NU(t,n,r,i);if(a_()||typeof ActiveXObject=="function")return _U(t,n,r,i);i(new Error("No fetch and no xhr implementation found!"))};function xu(e){"@babel/helpers - typeof";return xu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xu(e)}function oA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Q0(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?oA(Object(n),!0).forEach(function(r){s_(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oA(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function PU(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function LU(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,l_(r.key),r)}}function zU(e,t,n){return t&&LU(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function s_(e,t,n){return(t=l_(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l_(e){var t=IU(e,"string");return xu(t)=="symbol"?t:t+""}function IU(e,t){if(xu(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(xu(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var $U=function(){return{loadPath:"/locales/{{lng}}/{{ns}}.json",addPath:"/locales/add/{{lng}}/{{ns}}",parse:function(n){return JSON.parse(n)},stringify:JSON.stringify,parsePayload:function(n,r,i){return s_({},r,i||"")},parseLoadPayload:function(n,r){},request:jU,reloadInterval:typeof window<"u"?!1:60*60*1e3,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:"cors",credentials:"same-origin",cache:"default"}}},c_=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};PU(this,e),this.services=t,this.options=n,this.allOptions=r,this.type="backend",this.init(t,n,r)}return zU(e,[{key:"init",value:function(n){var r=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(this.services=n,this.options=Q0(Q0(Q0({},$U()),this.options||{}),i),this.allOptions=o,this.services&&this.options.reloadInterval){var a=setInterval(function(){return r.reload()},this.options.reloadInterval);xu(a)==="object"&&typeof a.unref=="function"&&a.unref()}}},{key:"readMulti",value:function(n,r,i){this._readAny(n,n,r,r,i)}},{key:"read",value:function(n,r,i){this._readAny([n],n,[r],r,i)}},{key:"_readAny",value:function(n,r,i,o,a){var l=this,u=this.options.loadPath;typeof this.options.loadPath=="function"&&(u=this.options.loadPath(n,i)),u=kU(u),u.then(function(d){if(!d)return a(null,{});var h=l.services.interpolator.interpolate(d,{lng:n.join("+"),ns:i.join("+")});l.loadUrl(h,a,r,o)})}},{key:"loadUrl",value:function(n,r,i,o){var a=this,l=typeof i=="string"?[i]:i,u=typeof o=="string"?[o]:o,d=this.options.parseLoadPayload(l,u);this.options.request(this.options,n,d,function(h,p){if(p&&(p.status>=500&&p.status<600||!p.status))return r("failed loading "+n+"; status code: "+p.status,!0);if(p&&p.status>=400&&p.status<500)return r("failed loading "+n+"; status code: "+p.status,!1);if(!p&&h&&h.message){var g=h.message.toLowerCase(),y=["failed","fetch","network","load"].find(function(E){return g.indexOf(E)>-1});if(y)return r("failed loading "+n+": "+h.message,!0)}if(h)return r(h,!1);var b,C;try{typeof p.data=="string"?b=a.options.parse(p.data,i,o):b=p.data}catch{C="failed parsing "+n+" to json"}if(C)return r(C,!1);r(null,b)})}},{key:"create",value:function(n,r,i,o,a){var l=this;if(this.options.addPath){typeof n=="string"&&(n=[n]);var u=this.options.parsePayload(r,i,o),d=0,h=[],p=[];n.forEach(function(g){var y=l.options.addPath;typeof l.options.addPath=="function"&&(y=l.options.addPath(g,r));var b=l.services.interpolator.interpolate(y,{lng:g,ns:r});l.options.request(l.options,b,u,function(C,E){d+=1,h.push(C),p.push(E),d===n.length&&typeof a=="function"&&a(h,p)})})}}},{key:"reload",value:function(){var n=this,r=this.services,i=r.backendConnector,o=r.languageUtils,a=r.logger,l=i.language;if(!(l&&l.toLowerCase()==="cimode")){var u=[],d=function(p){var g=o.toResolveHierarchy(p);g.forEach(function(y){u.indexOf(y)<0&&u.push(y)})};d(l),this.allOptions.preload&&this.allOptions.preload.forEach(function(h){return d(h)}),u.forEach(function(h){n.allOptions.ns.forEach(function(p){i.read(h,p,"read",null,null,function(g,y){g&&a.warn("loading namespace ".concat(p," for language ").concat(h," failed"),g),!g&&y&&a.log("loaded namespace ".concat(p," for language ").concat(h),y),i.loaded("".concat(h,"|").concat(p),g,y)})})})}}}])}();c_.type="backend";const FU=(e,t,n,r)=>{const i=[n,{code:t,...r||{}}];if(e?.services?.logger?.forward)return e.services.logger.forward(i,"warn","react-i18next::",!0);Pl(i[0])&&(i[0]=`react-i18next:: ${i[0]}`),e?.services?.logger?.warn?e.services.logger.warn(...i):console?.warn&&console.warn(...i)},aA={},u_=(e,t,n,r)=>{Pl(n)&&aA[n]||(Pl(n)&&(aA[n]=new Date),FU(e,t,n,r))},d_=(e,t)=>()=>{if(e.isInitialized)t();else{const n=()=>{setTimeout(()=>{e.off("initialized",n)},0),t()};e.on("initialized",n)}},bw=(e,t,n)=>{e.loadNamespaces(t,d_(e,n))},sA=(e,t,n,r)=>{if(Pl(n)&&(n=[n]),e.options.preload&&e.options.preload.indexOf(t)>-1)return bw(e,n,r);n.forEach(i=>{e.options.ns.indexOf(i)<0&&e.options.ns.push(i)}),e.loadLanguages(t,d_(e,r))},BU=(e,t,n={})=>!t.languages||!t.languages.length?(u_(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0):t.hasLoadedNamespace(e,{lng:n.lng,precheck:(r,i)=>{if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&r.services.backendConnector.backend&&r.isLanguageChangingTo&&!i(r.isLanguageChangingTo,e))return!1}}),Pl=e=>typeof e=="string",HU=e=>typeof e=="object"&&e!==null,UU=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,VU={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},qU=e=>VU[e],WU=e=>e.replace(UU,qU);let xw={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:WU};const KU=(e={})=>{xw={...xw,...e}},YU=()=>xw;let f_;const ZU=e=>{f_=e},GU=()=>f_,XU={type:"3rdParty",init(e){KU(e.options.react),ZU(e)}},QU=w.createContext();class JU{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}var J0={exports:{}},ex={};var lA;function eV(){if(lA)return ex;lA=1;var e=Pu();function t(p,g){return p===g&&(p!==0||1/p===1/g)||p!==p&&g!==g}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,o=e.useLayoutEffect,a=e.useDebugValue;function l(p,g){var y=g(),b=r({inst:{value:y,getSnapshot:g}}),C=b[0].inst,E=b[1];return o(function(){C.value=y,C.getSnapshot=g,u(C)&&E({inst:C})},[p,y,g]),i(function(){return u(C)&&E({inst:C}),p(function(){u(C)&&E({inst:C})})},[p]),a(y),y}function u(p){var g=p.getSnapshot;p=p.value;try{var y=g();return!n(p,y)}catch{return!0}}function d(p,g){return g()}var h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:l;return ex.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:h,ex}var cA;function h_(){return cA||(cA=1,J0.exports=eV()),J0.exports}var Sy=h_();const tV=(e,t)=>Pl(t)?t:HU(t)&&Pl(t.defaultValue)?t.defaultValue:Array.isArray(e)?e[e.length-1]:e,nV={t:tV,ready:!1},rV=()=>()=>{},cn=(e,t={})=>{const{i18n:n}=t,{i18n:r,defaultNS:i}=w.useContext(QU)||{},o=n||r||GU();o&&!o.reportNamespaces&&(o.reportNamespaces=new JU),o||u_(o,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const a=w.useMemo(()=>({...YU(),...o?.options?.react,...t}),[o,t]),{useSuspense:l,keyPrefix:u}=a,d=w.useMemo(()=>{const N=i||o?.options?.defaultNS;return Pl(N)?[N]:N||["translation"]},[e,i,o]);o?.reportNamespaces?.addUsedNamespaces?.(d);const h=w.useRef(0),p=w.useCallback(N=>{if(!o)return rV;const{bindI18n:D,bindI18nStore:L}=a,T=()=>{h.current+=1,N()};return D&&o.on(D,T),L&&o.store.on(L,T),()=>{D&&D.split(" ").forEach(I=>o.off(I,T)),L&&L.split(" ").forEach(I=>o.store.off(I,T))}},[o,a]),g=w.useRef(),y=w.useCallback(()=>{if(!o)return nV;const N=!!(o.isInitialized||o.initializedStoreOnce)&&d.every(te=>BU(te,o,a)),D=t.lng||o.language,L=h.current,T=g.current;if(T&&T.ready===N&&T.lng===D&&T.keyPrefix===u&&T.revision===L)return T;const G={t:o.getFixedT(D,a.nsMode==="fallback"?d:d[0],u),ready:N,lng:D,keyPrefix:u,revision:L};return g.current=G,G},[o,d,u,a,t.lng]),[b,C]=w.useState(0),{t:E,ready:k}=Sy.useSyncExternalStore(p,y,y);w.useEffect(()=>{if(o&&!k&&!l){const N=()=>C(D=>D+1);t.lng?sA(o,t.lng,d,N):bw(o,d,N)}},[o,t.lng,d,k,l,b]);const O=o||{},A=w.useMemo(()=>{const N=[E,O,k];return N.t=E,N.i18n=O,N.ready=k,N},[E,O,k]);if(o&&l&&!k)throw new Promise(N=>{const D=()=>N();t.lng?sA(o,t.lng,d,D):bw(o,d,D)});return A};Hr.use(XU).use(c_).use(o_).init({fallbackLng:"en",defaultNS:"translation",load:"languageOnly",interpolation:{escapeValue:!1},backend:{loadPath:"/locales/{{lng}}/{{ns}}.json"}});var $u=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},iV={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},oV=class{#e=iV;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},xl=new oV;function aV(e){setTimeout(e,0)}var Ll=typeof window>"u"||"Deno"in globalThis;function Pr(){}function sV(e,t){return typeof e=="function"?e(t):e}function ww(e){return typeof e=="number"&&e>=0&&e!==1/0}function p_(e,t){return Math.max(e+(t||0)-Date.now(),0)}function As(e,t){return typeof e=="function"?e(t):e}function qi(e,t){return typeof e=="function"?e(t):e}function uA(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:o,queryKey:a,stale:l}=e;if(a){if(r){if(t.queryHash!==sS(a,t.options))return!1}else if(!Pf(t.queryKey,a))return!1}if(n!=="all"){const u=t.isActive();if(n==="active"&&!u||n==="inactive"&&u)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||i&&i!==t.state.fetchStatus||o&&!o(t))}function dA(e,t){const{exact:n,status:r,predicate:i,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(zl(t.options.mutationKey)!==zl(o))return!1}else if(!Pf(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function sS(e,t){return(t?.queryKeyHashFn||zl)(e)}function zl(e){return JSON.stringify(e,(t,n)=>Sw(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Pf(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Pf(e[n],t[n])):!1}var lV=Object.prototype.hasOwnProperty;function lS(e,t){if(e===t)return e;const n=fA(e)&&fA(t);if(!n&&!(Sw(e)&&Sw(t)))return t;const i=(n?e:Object.keys(e)).length,o=n?t:Object.keys(t),a=o.length,l=n?new Array(a):{};let u=0;for(let d=0;d<a;d++){const h=n?d:o[d],p=e[h],g=t[h];if(p===g){l[h]=p,(n?d<i:lV.call(e,h))&&u++;continue}if(p===null||g===null||typeof p!="object"||typeof g!="object"){l[h]=g;continue}const y=lS(p,g);l[h]=y,y===p&&u++}return i===a&&u===i?e:l}function ig(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function fA(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Sw(e){if(!hA(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!hA(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function hA(e){return Object.prototype.toString.call(e)==="[object Object]"}function cV(e){return new Promise(t=>{xl.setTimeout(t,e)})}function Cw(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?lS(e,t):t}function Ql(e){return e}function uV(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function dV(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var cS=Symbol();function m_(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===cS?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function g_(e,t){return typeof e=="function"?e(...t):!!e}var fV=class extends $u{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!Ll&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},uS=new fV;function Ew(){let e,t;const n=new Promise((i,o)=>{e=i,t=o});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}var hV=aV;function pV(){let e=[],t=0,n=l=>{l()},r=l=>{l()},i=hV;const o=l=>{t?e.push(l):i(()=>{n(l)})},a=()=>{const l=e;e=[],l.length&&i(()=>{r(()=>{l.forEach(u=>{n(u)})})})};return{batch:l=>{let u;t++;try{u=l()}finally{t--,t||a()}return u},batchCalls:l=>(...u)=>{o(()=>{l(...u)})},schedule:o,setNotifyFunction:l=>{n=l},setBatchNotifyFunction:l=>{r=l},setScheduler:l=>{i=l}}}var Qn=pV(),mV=class extends $u{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!Ll&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(n=>{n(e)}))}isOnline(){return this.#e}},og=new mV;function gV(e){return Math.min(1e3*2**e,3e4)}function y_(e){return(e??"online")==="online"?og.isOnline():!0}var kw=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function v_(e){let t=!1,n=0,r;const i=Ew(),o=()=>i.status!=="pending",a=C=>{if(!o()){const E=new kw(C);g(E),e.onCancel?.(E)}},l=()=>{t=!0},u=()=>{t=!1},d=()=>uS.isFocused()&&(e.networkMode==="always"||og.isOnline())&&e.canRun(),h=()=>y_(e.networkMode)&&e.canRun(),p=C=>{o()||(r?.(),i.resolve(C))},g=C=>{o()||(r?.(),i.reject(C))},y=()=>new Promise(C=>{r=E=>{(o()||d())&&C(E)},e.onPause?.()}).then(()=>{r=void 0,o()||e.onContinue?.()}),b=()=>{if(o())return;let C;const E=n===0?e.initialPromise:void 0;try{C=E??e.fn()}catch(k){C=Promise.reject(k)}Promise.resolve(C).then(p).catch(k=>{if(o())return;const O=e.retry??(Ll?0:3),A=e.retryDelay??gV,N=typeof A=="function"?A(n,k):A,D=O===!0||typeof O=="number"&&n<O||typeof O=="function"&&O(n,k);if(t||!D){g(k);return}n++,e.onFail?.(n,k),cV(N).then(()=>d()?void 0:y()).then(()=>{t?g(k):b()})})};return{promise:i,status:()=>i.status,cancel:a,continue:()=>(r?.(),i),cancelRetry:l,continueRetry:u,canStart:h,start:()=>(h()?b():y().then(b),i)}}var b_=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),ww(this.gcTime)&&(this.#e=xl.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Ll?1/0:5*60*1e3))}clearGcTimeout(){this.#e&&(xl.clearTimeout(this.#e),this.#e=void 0)}},yV=class extends b_{#e;#t;#n;#i;#r;#a;#s;constructor(e){super(),this.#s=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#n=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=mA(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#r?.promise}setOptions(e){if(this.options={...this.#a,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=mA(this.options);t.data!==void 0&&(this.setState(pA(t.data,t.dataUpdatedAt)),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const n=Cw(this.state.data,e,this.options);return this.#o({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#o({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#r?.promise;return this.#r?.cancel(e),t?t.then(Pr).catch(Pr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>qi(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===cS||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>As(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!p_(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#r&&(this.#s?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#o({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(e&&this.setOptions(e),!this.options.queryFn){const l=this.observers.find(u=>u.options.queryFn);l&&this.setOptions(l.options)}const n=new AbortController,r=l=>{Object.defineProperty(l,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{const l=m_(this.options,t),d=(()=>{const h={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(h),h})();return this.#s=!1,this.options.persister?this.options.persister(l,d,this):l(d)},a=(()=>{const l={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(l),l})();this.options.behavior?.onFetch(a,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#o({type:"fetch",meta:a.fetchOptions?.meta}),this.#r=v_({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:l=>{l instanceof kw&&l.revert&&this.setState({...this.#t,fetchStatus:"idle"}),n.abort()},onFail:(l,u)=>{this.#o({type:"failed",failureCount:l,error:u})},onPause:()=>{this.#o({type:"pause"})},onContinue:()=>{this.#o({type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{const l=await this.#r.start();if(l===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(l),this.#n.config.onSuccess?.(l,this),this.#n.config.onSettled?.(l,this.state.error,this),l}catch(l){if(l instanceof kw){if(l.silent)return this.#r.promise;if(l.revert){if(this.state.data===void 0)throw l;return this.state.data}}throw this.#o({type:"error",error:l}),this.#n.config.onError?.(l,this),this.#n.config.onSettled?.(this.state.data,l,this),l}finally{this.scheduleGc()}}#o(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...x_(n.data,this.options),fetchMeta:e.meta??null};case"success":const r={...n,...pA(e.data,e.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?r:void 0,r;case"error":const i=e.error;return{...n,error:i,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),Qn.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function x_(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:y_(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function pA(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function mA(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var vV=class extends $u{constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.#s=Ew(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#i=void 0;#r;#a;#s;#o;#m;#f;#h;#c;#u;#l;#p=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),gA(this.#t,this.options)?this.#d():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Mw(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Mw(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#w(),this.#t.removeObserver(this)}setOptions(e){const t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof qi(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#S(),this.#t.setOptions(this.options),t._defaulted&&!ig(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const r=this.hasListeners();r&&yA(this.#t,n,this.options,t)&&this.#d(),this.updateResult(),r&&(this.#t!==n||qi(this.options.enabled,this.#t)!==qi(t.enabled,this.#t)||As(this.options.staleTime,this.#t)!==As(t.staleTime,this.#t))&&this.#g();const i=this.#y();r&&(this.#t!==n||qi(this.options.enabled,this.#t)!==qi(t.enabled,this.#t)||i!==this.#l)&&this.#v(i)}getOptimisticResult(e){const t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return xV(this,n)&&(this.#i=n,this.#a=this.options,this.#r=this.#t.state),n}getCurrentResult(){return this.#i}trackResult(e,t){return new Proxy(e,{get:(n,r)=>(this.trackProp(r),t?.(r),r==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#s.status==="pending"&&this.#s.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,r))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#d({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#i))}#d(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(Pr)),t}#g(){this.#x();const e=As(this.options.staleTime,this.#t);if(Ll||this.#i.isStale||!ww(e))return;const n=p_(this.#i.dataUpdatedAt,e)+1;this.#c=xl.setTimeout(()=>{this.#i.isStale||this.updateResult()},n)}#y(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#w(),this.#l=e,!(Ll||qi(this.options.enabled,this.#t)===!1||!ww(this.#l)||this.#l===0)&&(this.#u=xl.setInterval(()=>{(this.options.refetchIntervalInBackground||uS.isFocused())&&this.#d()},this.#l))}#b(){this.#g(),this.#v(this.#y())}#x(){this.#c&&(xl.clearTimeout(this.#c),this.#c=void 0)}#w(){this.#u&&(xl.clearInterval(this.#u),this.#u=void 0)}createResult(e,t){const n=this.#t,r=this.options,i=this.#i,o=this.#r,a=this.#a,u=e!==n?e.state:this.#n,{state:d}=e;let h={...d},p=!1,g;if(t._optimisticResults){const I=this.hasListeners(),G=!I&&gA(e,t),te=I&&yA(e,n,t,r);(G||te)&&(h={...h,...x_(d.data,e.options)}),t._optimisticResults==="isRestoring"&&(h.fetchStatus="idle")}let{error:y,errorUpdatedAt:b,status:C}=h;g=h.data;let E=!1;if(t.placeholderData!==void 0&&g===void 0&&C==="pending"){let I;i?.isPlaceholderData&&t.placeholderData===a?.placeholderData?(I=i.data,E=!0):I=typeof t.placeholderData=="function"?t.placeholderData(this.#h?.state.data,this.#h):t.placeholderData,I!==void 0&&(C="success",g=Cw(i?.data,I,t),p=!0)}if(t.select&&g!==void 0&&!E)if(i&&g===o?.data&&t.select===this.#m)g=this.#f;else try{this.#m=t.select,g=t.select(g),g=Cw(i?.data,g,t),this.#f=g,this.#o=null}catch(I){this.#o=I}this.#o&&(y=this.#o,g=this.#f,b=Date.now(),C="error");const k=h.fetchStatus==="fetching",O=C==="pending",A=C==="error",N=O&&k,D=g!==void 0,T={status:C,fetchStatus:h.fetchStatus,isPending:O,isSuccess:C==="success",isError:A,isInitialLoading:N,isLoading:N,data:g,dataUpdatedAt:h.dataUpdatedAt,error:y,errorUpdatedAt:b,failureCount:h.fetchFailureCount,failureReason:h.fetchFailureReason,errorUpdateCount:h.errorUpdateCount,isFetched:h.dataUpdateCount>0||h.errorUpdateCount>0,isFetchedAfterMount:h.dataUpdateCount>u.dataUpdateCount||h.errorUpdateCount>u.errorUpdateCount,isFetching:k,isRefetching:k&&!O,isLoadingError:A&&!D,isPaused:h.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:A&&D,isStale:dS(e,t),refetch:this.refetch,promise:this.#s,isEnabled:qi(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const I=fe=>{T.status==="error"?fe.reject(T.error):T.data!==void 0&&fe.resolve(T.data)},G=()=>{const fe=this.#s=T.promise=Ew();I(fe)},te=this.#s;switch(te.status){case"pending":e.queryHash===n.queryHash&&I(te);break;case"fulfilled":(T.status==="error"||T.data!==te.value)&&G();break;case"rejected":(T.status!=="error"||T.error!==te.reason)&&G();break}}return T}updateResult(){const e=this.#i,t=this.createResult(this.#t,this.options);if(this.#r=this.#t.state,this.#a=this.options,this.#r.data!==void 0&&(this.#h=this.#t),ig(t,e))return;this.#i=t;const n=()=>{if(!e)return!0;const{notifyOnChangeProps:r}=this.options,i=typeof r=="function"?r():r;if(i==="all"||!i&&!this.#p.size)return!0;const o=new Set(i??this.#p);return this.options.throwOnError&&o.add("error"),Object.keys(this.#i).some(a=>{const l=a;return this.#i[l]!==e[l]&&o.has(l)})};this.#C({listeners:n()})}#S(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#C(e){Qn.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#i)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function bV(e,t){return qi(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function gA(e,t){return bV(e,t)||e.state.data!==void 0&&Mw(e,t,t.refetchOnMount)}function Mw(e,t,n){if(qi(t.enabled,e)!==!1&&As(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&dS(e,t)}return!1}function yA(e,t,n,r){return(e!==t||qi(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&dS(e,n)}function dS(e,t){return qi(t.enabled,e)!==!1&&e.isStaleByTime(As(t.staleTime,e))}function xV(e,t){return!ig(e.getCurrentResult(),t)}function vA(e){return{onFetch:(t,n)=>{const r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,o=t.state.data?.pages||[],a=t.state.data?.pageParams||[];let l={pages:[],pageParams:[]},u=0;const d=async()=>{let h=!1;const p=b=>{Object.defineProperty(b,"signal",{enumerable:!0,get:()=>(t.signal.aborted?h=!0:t.signal.addEventListener("abort",()=>{h=!0}),t.signal)})},g=m_(t.options,t.fetchOptions),y=async(b,C,E)=>{if(h)return Promise.reject();if(C==null&&b.pages.length)return Promise.resolve(b);const O=(()=>{const L={client:t.client,queryKey:t.queryKey,pageParam:C,direction:E?"backward":"forward",meta:t.options.meta};return p(L),L})(),A=await g(O),{maxPages:N}=t.options,D=E?dV:uV;return{pages:D(b.pages,A,N),pageParams:D(b.pageParams,C,N)}};if(i&&o.length){const b=i==="backward",C=b?wV:bA,E={pages:o,pageParams:a},k=C(r,E);l=await y(E,k,b)}else{const b=e??o.length;do{const C=u===0?a[0]??r.initialPageParam:bA(r,l);if(u>0&&C==null)break;l=await y(l,C),u++}while(u<b)}return l};t.options.persister?t.fetchFn=()=>t.options.persister?.(d,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=d}}}function bA(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function wV(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var SV=class extends b_{#e;#t;#n;#i;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||w_(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#i?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#r({type:"continue"})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#i=v_({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(o,a)=>{this.#r({type:"failed",failureCount:o,error:a})},onPause:()=>{this.#r({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const r=this.state.status==="pending",i=!this.#i.canStart();try{if(r)t();else{this.#r({type:"pending",variables:e,isPaused:i}),await this.#n.config.onMutate?.(e,this,n);const a=await this.options.onMutate?.(e,n);a!==this.state.context&&this.#r({type:"pending",context:a,variables:e,isPaused:i})}const o=await this.#i.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#r({type:"success",data:o}),o}catch(o){try{throw await this.#n.config.onError?.(o,e,this.state.context,this,n),await this.options.onError?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(void 0,o,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(void 0,o,e,this.state.context,n),o}finally{this.#r({type:"error",error:o})}}finally{this.#n.runNext(this)}}#r(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),Qn.batch(()=>{this.#t.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function w_(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var CV=class extends $u{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){const r=new SV({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);const t=Qp(e);if(typeof t=="string"){const n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=Qp(e);if(typeof t=="string"){const n=this.#t.get(t);if(n)if(n.length>1){const r=n.indexOf(e);r!==-1&&n.splice(r,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=Qp(e);if(typeof t=="string"){const r=this.#t.get(t)?.find(i=>i.state.status==="pending");return!r||r===e}else return!0}runNext(e){const t=Qp(e);return typeof t=="string"?this.#t.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Qn.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const t={exact:!0,...e};return this.getAll().find(n=>dA(t,n))}findAll(e={}){return this.getAll().filter(t=>dA(e,t))}notify(e){Qn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return Qn.batch(()=>Promise.all(e.map(t=>t.continue().catch(Pr))))}};function Qp(e){return e.options.scope?.id}var EV=class extends $u{#e;#t=void 0;#n;#i;constructor(t,n){super(),this.#e=t,this.setOptions(n),this.bindMethods(),this.#r()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const n=this.options;this.options=this.#e.defaultMutationOptions(t),ig(this.options,n)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),n?.mutationKey&&this.options.mutationKey&&zl(n.mutationKey)!==zl(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(t){this.#r(),this.#a(t)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#r(),this.#a()}mutate(t,n){return this.#i=n,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(t)}#r(){const t=this.#n?.state??w_();this.#t={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#a(t){Qn.batch(()=>{if(this.#i&&this.hasListeners()){const n=this.#t.variables,r=this.#t.context,i={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};t?.type==="success"?(this.#i.onSuccess?.(t.data,n,r,i),this.#i.onSettled?.(t.data,null,n,r,i)):t?.type==="error"&&(this.#i.onError?.(t.error,n,r,i),this.#i.onSettled?.(void 0,t.error,n,r,i))}this.listeners.forEach(n=>{n(this.#t)})})}},kV=class extends $u{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const r=t.queryKey,i=t.queryHash??sS(r,t);let o=this.get(i);return o||(o=new yV({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(o)),o}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Qn.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>uA(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>uA(e,n)):t}notify(e){Qn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Qn.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Qn.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},MV=class{#e;#t;#n;#i;#r;#a;#s;#o;constructor(e={}){this.#e=e.queryCache||new kV,this.#t=e.mutationCache||new CV,this.#n=e.defaultOptions||{},this.#i=new Map,this.#r=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#s=uS.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#o=og.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#s?.(),this.#s=void 0,this.#o?.(),this.#o=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(As(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),o=this.#e.get(r.queryHash)?.state.data,a=sV(t,o);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return Qn.batch(()=>this.#e.findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;Qn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e;return Qn.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Qn.batch(()=>this.#e.findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(Pr).catch(Pr)}invalidateQueries(e,t={}){return Qn.batch(()=>(this.#e.findAll(e).forEach(n=>{n.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=Qn.batch(()=>this.#e.findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let o=i.fetch(void 0,n);return n.throwOnError||(o=o.catch(Pr)),i.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(Pr)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(As(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Pr).catch(Pr)}fetchInfiniteQuery(e){return e.behavior=vA(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Pr).catch(Pr)}ensureInfiniteQueryData(e){return e.behavior=vA(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return og.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#i.set(zl(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#i.values()],n={};return t.forEach(r=>{Pf(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#r.set(zl(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(r=>{Pf(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=sS(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===cS&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},S_=w.createContext(void 0),xo=e=>{const t=w.useContext(S_);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},OV=({client:e,children:t})=>(w.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),x.jsx(S_.Provider,{value:e,children:t})),C_=w.createContext(!1),TV=()=>w.useContext(C_);C_.Provider;function AV(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var DV=w.createContext(AV()),RV=()=>w.useContext(DV),NV=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},_V=e=>{w.useEffect(()=>{e.clearReset()},[e])},jV=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||g_(n,[e.error,r])),PV=e=>{if(e.suspense){const n=i=>i==="static"?i:Math.max(i??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...i)=>n(r(...i)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},LV=(e,t)=>e.isLoading&&e.isFetching&&!t,zV=(e,t)=>e?.suspense&&t.isPending,xA=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function IV(e,t,n){const r=TV(),i=RV(),o=xo(n),a=o.defaultQueryOptions(e);o.getDefaultOptions().queries?._experimental_beforeQuery?.(a),a._optimisticResults=r?"isRestoring":"optimistic",PV(a),NV(a,i),_V(i);const l=!o.getQueryCache().get(a.queryHash),[u]=w.useState(()=>new t(o,a)),d=u.getOptimisticResult(a),h=!r&&e.subscribed!==!1;if(w.useSyncExternalStore(w.useCallback(p=>{const g=h?u.subscribe(Qn.batchCalls(p)):Pr;return u.updateResult(),g},[u,h]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),w.useEffect(()=>{u.setOptions(a)},[a,u]),zV(a,d))throw xA(a,u,i);if(jV({result:d,errorResetBoundary:i,throwOnError:a.throwOnError,query:o.getQueryCache().get(a.queryHash),suspense:a.suspense}))throw d.error;return o.getDefaultOptions().queries?._experimental_afterQuery?.(a,d),a.experimental_prefetchInRender&&!Ll&&LV(d,r)&&(l?xA(a,u,i):o.getQueryCache().get(a.queryHash)?.promise)?.catch(Pr).finally(()=>{u.updateResult()}),a.notifyOnChangeProps?d:u.trackResult(d)}function Oi(e,t){return IV(e,vV,t)}function $V(e,t){const n=xo(t);return FV({filters:{...e,status:"pending"}},n).length}function wA(e,t){return e.findAll(t.filters).map(n=>t.select?t.select(n):n.state)}function FV(e={},t){const n=xo(t).getMutationCache(),r=w.useRef(e),i=w.useRef(null);return i.current===null&&(i.current=wA(n,e)),w.useEffect(()=>{r.current=e}),w.useSyncExternalStore(w.useCallback(o=>n.subscribe(()=>{const a=lS(i.current,wA(n,r.current));i.current!==a&&(i.current=a,Qn.schedule(o))}),[n]),()=>i.current,()=>i.current)}function Us(e,t){const n=xo(t),[r]=w.useState(()=>new EV(n,e));w.useEffect(()=>{r.setOptions(e)},[r,e]);const i=w.useSyncExternalStore(w.useCallback(a=>r.subscribe(Qn.batchCalls(a)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),o=w.useCallback((a,l)=>{r.mutate(a,l).catch(Pr)},[r]);if(i.error&&g_(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:o,mutateAsync:i.mutate}}function BV(e,t){const n=w.createContext(t),r=o=>{const{children:a,...l}=o,u=w.useMemo(()=>l,Object.values(l));return x.jsx(n.Provider,{value:u,children:a})};r.displayName=e+"Provider";function i(o){const a=w.useContext(n);if(a)return a;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[r,i]}function Ti(e,t=[]){let n=[];function r(o,a){const l=w.createContext(a),u=n.length;n=[...n,a];const d=p=>{const{scope:g,children:y,...b}=p,C=g?.[e]?.[u]||l,E=w.useMemo(()=>b,Object.values(b));return x.jsx(C.Provider,{value:E,children:y})};d.displayName=o+"Provider";function h(p,g){const y=g?.[e]?.[u]||l,b=w.useContext(y);if(b)return b;if(a!==void 0)return a;throw new Error(`\`${p}\` must be used within \`${o}\``)}return[d,h]}const i=()=>{const o=n.map(a=>w.createContext(a));return function(l){const u=l?.[e]||o;return w.useMemo(()=>({[`__scope${e}`]:{...l,[e]:u}}),[l,u])}};return i.scopeName=e,[r,HV(i,...t)]}function HV(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const a=r.reduce((l,{useScope:u,scopeName:d})=>{const p=u(o)[`__scope${d}`];return{...l,...p}},{});return w.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function SA(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Ir(...e){return t=>{let n=!1;const r=e.map(i=>{const o=SA(i,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let i=0;i<r.length;i++){const o=r[i];typeof o=="function"?o():SA(e[i],null)}}}}function Dt(...e){return w.useCallback(Ir(...e),e)}function _e(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e?.(i),n===!1||!i.defaultPrevented)return t?.(i)}}var sr=globalThis?.document?w.useLayoutEffect:()=>{},UV=Z1[" useId ".trim().toString()]||(()=>{}),VV=0;function hr(e){const[t,n]=w.useState(UV());return sr(()=>{n(r=>r??String(VV++))},[e]),t?`radix-${t}`:""}var qV=Z1[" useInsertionEffect ".trim().toString()]||sr;function qo({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,o,a]=WV({defaultProp:t,onChange:n}),l=e!==void 0,u=l?e:i;{const h=w.useRef(e!==void 0);w.useEffect(()=>{const p=h.current;p!==l&&console.warn(`${r} is changing from ${p?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),h.current=l},[l,r])}const d=w.useCallback(h=>{if(l){const p=KV(h)?h(e):h;p!==e&&a.current?.(p)}else o(h)},[l,e,o,a]);return[u,d]}function WV({defaultProp:e,onChange:t}){const[n,r]=w.useState(e),i=w.useRef(n),o=w.useRef(t);return qV(()=>{o.current=t},[t]),w.useEffect(()=>{i.current!==n&&(o.current?.(n),i.current=n)},[n,i]),[n,r,o]}function KV(e){return typeof e=="function"}var sh=O2();const fS=yo(sh);function YV(e){const t=ZV(e),n=w.forwardRef((r,i)=>{const{children:o,...a}=r,l=w.Children.toArray(o),u=l.find(XV);if(u){const d=u.props.children,h=l.map(p=>p===u?w.Children.count(d)>1?w.Children.only(null):w.isValidElement(d)?d.props.children:null:p);return x.jsx(t,{...a,ref:i,children:w.isValidElement(d)?w.cloneElement(d,void 0,h):null})}return x.jsx(t,{...a,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}function ZV(e){const t=w.forwardRef((n,r)=>{const{children:i,...o}=n;if(w.isValidElement(i)){const a=JV(i),l=QV(o,i.props);return i.type!==w.Fragment&&(l.ref=r?Ir(r,a):a),w.cloneElement(i,l)}return w.Children.count(i)>1?w.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var GV=Symbol("radix.slottable");function XV(e){return w.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===GV}function QV(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...l)=>{const u=o(...l);return i(...l),u}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function JV(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var eq=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ge=eq.reduce((e,t)=>{const n=YV(`Primitive.${t}`),r=w.forwardRef((i,o)=>{const{asChild:a,...l}=i,u=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),x.jsx(u,{...l,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function E_(e,t){e&&sh.flushSync(()=>e.dispatchEvent(t))}function Qi(e){const t=w.useRef(e);return w.useEffect(()=>{t.current=e}),w.useMemo(()=>(...n)=>t.current?.(...n),[])}function tq(e,t=globalThis?.document){const n=Qi(e);w.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var nq="DismissableLayer",Ow="dismissableLayer.update",rq="dismissableLayer.pointerDownOutside",iq="dismissableLayer.focusOutside",CA,k_=w.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Fu=w.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:a,onDismiss:l,...u}=e,d=w.useContext(k_),[h,p]=w.useState(null),g=h?.ownerDocument??globalThis?.document,[,y]=w.useState({}),b=Dt(t,T=>p(T)),C=Array.from(d.layers),[E]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),k=C.indexOf(E),O=h?C.indexOf(h):-1,A=d.layersWithOutsidePointerEventsDisabled.size>0,N=O>=k,D=sq(T=>{const I=T.target,G=[...d.branches].some(te=>te.contains(I));!N||G||(i?.(T),a?.(T),T.defaultPrevented||l?.())},g),L=lq(T=>{const I=T.target;[...d.branches].some(te=>te.contains(I))||(o?.(T),a?.(T),T.defaultPrevented||l?.())},g);return tq(T=>{O===d.layers.size-1&&(r?.(T),!T.defaultPrevented&&l&&(T.preventDefault(),l()))},g),w.useEffect(()=>{if(h)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(CA=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(h)),d.layers.add(h),EA(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=CA)}},[h,g,n,d]),w.useEffect(()=>()=>{h&&(d.layers.delete(h),d.layersWithOutsidePointerEventsDisabled.delete(h),EA())},[h,d]),w.useEffect(()=>{const T=()=>y({});return document.addEventListener(Ow,T),()=>document.removeEventListener(Ow,T)},[]),x.jsx(Ge.div,{...u,ref:b,style:{pointerEvents:A?N?"auto":"none":void 0,...e.style},onFocusCapture:_e(e.onFocusCapture,L.onFocusCapture),onBlurCapture:_e(e.onBlurCapture,L.onBlurCapture),onPointerDownCapture:_e(e.onPointerDownCapture,D.onPointerDownCapture)})});Fu.displayName=nq;var oq="DismissableLayerBranch",aq=w.forwardRef((e,t)=>{const n=w.useContext(k_),r=w.useRef(null),i=Dt(t,r);return w.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),x.jsx(Ge.div,{...e,ref:i})});aq.displayName=oq;function sq(e,t=globalThis?.document){const n=Qi(e),r=w.useRef(!1),i=w.useRef(()=>{});return w.useEffect(()=>{const o=l=>{if(l.target&&!r.current){let u=function(){M_(rq,n,d,{discrete:!0})};const d={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=u,t.addEventListener("click",i.current,{once:!0})):u()}else t.removeEventListener("click",i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",o),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function lq(e,t=globalThis?.document){const n=Qi(e),r=w.useRef(!1);return w.useEffect(()=>{const i=o=>{o.target&&!r.current&&M_(iq,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function EA(){const e=new CustomEvent(Ow);document.dispatchEvent(e)}function M_(e,t,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?E_(i,o):i.dispatchEvent(o)}var tx="focusScope.autoFocusOnMount",nx="focusScope.autoFocusOnUnmount",kA={bubbles:!1,cancelable:!0},cq="FocusScope",lh=w.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...a}=e,[l,u]=w.useState(null),d=Qi(i),h=Qi(o),p=w.useRef(null),g=Dt(t,C=>u(C)),y=w.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;w.useEffect(()=>{if(r){let C=function(A){if(y.paused||!l)return;const N=A.target;l.contains(N)?p.current=N:ps(p.current,{select:!0})},E=function(A){if(y.paused||!l)return;const N=A.relatedTarget;N!==null&&(l.contains(N)||ps(p.current,{select:!0}))},k=function(A){if(document.activeElement===document.body)for(const D of A)D.removedNodes.length>0&&ps(l)};document.addEventListener("focusin",C),document.addEventListener("focusout",E);const O=new MutationObserver(k);return l&&O.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",C),document.removeEventListener("focusout",E),O.disconnect()}}},[r,l,y.paused]),w.useEffect(()=>{if(l){OA.add(y);const C=document.activeElement;if(!l.contains(C)){const k=new CustomEvent(tx,kA);l.addEventListener(tx,d),l.dispatchEvent(k),k.defaultPrevented||(uq(mq(O_(l)),{select:!0}),document.activeElement===C&&ps(l))}return()=>{l.removeEventListener(tx,d),setTimeout(()=>{const k=new CustomEvent(nx,kA);l.addEventListener(nx,h),l.dispatchEvent(k),k.defaultPrevented||ps(C??document.body,{select:!0}),l.removeEventListener(nx,h),OA.remove(y)},0)}}},[l,d,h,y]);const b=w.useCallback(C=>{if(!n&&!r||y.paused)return;const E=C.key==="Tab"&&!C.altKey&&!C.ctrlKey&&!C.metaKey,k=document.activeElement;if(E&&k){const O=C.currentTarget,[A,N]=dq(O);A&&N?!C.shiftKey&&k===N?(C.preventDefault(),n&&ps(A,{select:!0})):C.shiftKey&&k===A&&(C.preventDefault(),n&&ps(N,{select:!0})):k===O&&C.preventDefault()}},[n,r,y.paused]);return x.jsx(Ge.div,{tabIndex:-1,...a,ref:g,onKeyDown:b})});lh.displayName=cq;function uq(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(ps(r,{select:t}),document.activeElement!==n)return}function dq(e){const t=O_(e),n=MA(t,e),r=MA(t.reverse(),e);return[n,r]}function O_(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function MA(e,t){for(const n of e)if(!fq(n,{upTo:t}))return n}function fq(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function hq(e){return e instanceof HTMLInputElement&&"select"in e}function ps(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&hq(e)&&t&&e.select()}}var OA=pq();function pq(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=TA(e,t),e.unshift(t)},remove(t){e=TA(e,t),e[0]?.resume()}}}function TA(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function mq(e){return e.filter(t=>t.tagName!=="A")}var gq="Portal",Bu=w.forwardRef((e,t)=>{const{container:n,...r}=e,[i,o]=w.useState(!1);sr(()=>o(!0),[]);const a=n||i&&globalThis?.document?.body;return a?fS.createPortal(x.jsx(Ge.div,{...r,ref:t}),a):null});Bu.displayName=gq;function yq(e,t){return w.useReducer((n,r)=>t[n][r]??n,e)}var li=e=>{const{present:t,children:n}=e,r=vq(t),i=typeof n=="function"?n({present:r.isPresent}):w.Children.only(n),o=Dt(r.ref,bq(i));return typeof n=="function"||r.isPresent?w.cloneElement(i,{ref:o}):null};li.displayName="Presence";function vq(e){const[t,n]=w.useState(),r=w.useRef(null),i=w.useRef(e),o=w.useRef("none"),a=e?"mounted":"unmounted",[l,u]=yq(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return w.useEffect(()=>{const d=Jp(r.current);o.current=l==="mounted"?d:"none"},[l]),sr(()=>{const d=r.current,h=i.current;if(h!==e){const g=o.current,y=Jp(d);e?u("MOUNT"):y==="none"||d?.display==="none"?u("UNMOUNT"):u(h&&g!==y?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,u]),sr(()=>{if(t){let d;const h=t.ownerDocument.defaultView??window,p=y=>{const C=Jp(r.current).includes(CSS.escape(y.animationName));if(y.target===t&&C&&(u("ANIMATION_END"),!i.current)){const E=t.style.animationFillMode;t.style.animationFillMode="forwards",d=h.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=E)})}},g=y=>{y.target===t&&(o.current=Jp(r.current))};return t.addEventListener("animationstart",g),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{h.clearTimeout(d),t.removeEventListener("animationstart",g),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:w.useCallback(d=>{r.current=d?getComputedStyle(d):null,n(d)},[])}}function Jp(e){return e?.animationName||"none"}function bq(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var rx=0;function Cy(){w.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??AA()),document.body.insertAdjacentElement("beforeend",e[1]??AA()),rx++,()=>{rx===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),rx--}},[])}function AA(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Po=function(){return Po=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Po.apply(this,arguments)};function T_(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Jl(e,t,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function l(h){try{d(r.next(h))}catch(p){a(p)}}function u(h){try{d(r.throw(h))}catch(p){a(p)}}function d(h){h.done?o(h.value):i(h.value).then(l,u)}d((r=r.apply(e,t||[])).next())})}function xq(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}var jm="right-scroll-bar-position",Pm="width-before-scroll-bar",wq="with-scroll-bars-hidden",Sq="--removed-body-scroll-bar-size";function ix(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Cq(e,t){var n=w.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}var Eq=typeof window<"u"?w.useLayoutEffect:w.useEffect,DA=new WeakMap;function kq(e,t){var n=Cq(null,function(r){return e.forEach(function(i){return ix(i,r)})});return Eq(function(){var r=DA.get(n);if(r){var i=new Set(r),o=new Set(e),a=n.current;i.forEach(function(l){o.has(l)||ix(l,null)}),o.forEach(function(l){i.has(l)||ix(l,a)})}DA.set(n,e)},[e]),n}function Mq(e){return e}function Oq(e,t){t===void 0&&(t=Mq);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(o){var a=t(o,r);return n.push(a),function(){n=n.filter(function(l){return l!==a})}},assignSyncMedium:function(o){for(r=!0;n.length;){var a=n;n=[],a.forEach(o)}n={push:function(l){return o(l)},filter:function(){return n}}},assignMedium:function(o){r=!0;var a=[];if(n.length){var l=n;n=[],l.forEach(o),a=n}var u=function(){var h=a;a=[],h.forEach(o)},d=function(){return Promise.resolve().then(u)};d(),n={push:function(h){a.push(h),d()},filter:function(h){return a=a.filter(h),n}}}};return i}function Tq(e){e===void 0&&(e={});var t=Oq(null);return t.options=Po({async:!0,ssr:!1},e),t}var A_=function(e){var t=e.sideCar,n=T_(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return w.createElement(r,Po({},n))};A_.isSideCarExport=!0;function Aq(e,t){return e.useMedium(t),A_}var D_=Tq(),ox=function(){},Ey=w.forwardRef(function(e,t){var n=w.useRef(null),r=w.useState({onScrollCapture:ox,onWheelCapture:ox,onTouchMoveCapture:ox}),i=r[0],o=r[1],a=e.forwardProps,l=e.children,u=e.className,d=e.removeScrollBar,h=e.enabled,p=e.shards,g=e.sideCar,y=e.noRelative,b=e.noIsolation,C=e.inert,E=e.allowPinchZoom,k=e.as,O=k===void 0?"div":k,A=e.gapMode,N=T_(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),D=g,L=kq([n,t]),T=Po(Po({},N),i);return w.createElement(w.Fragment,null,h&&w.createElement(D,{sideCar:D_,removeScrollBar:d,shards:p,noRelative:y,noIsolation:b,inert:C,setCallbacks:o,allowPinchZoom:!!E,lockRef:n,gapMode:A}),a?w.cloneElement(w.Children.only(l),Po(Po({},T),{ref:L})):w.createElement(O,Po({},T,{className:u,ref:L}),l))});Ey.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Ey.classNames={fullWidth:Pm,zeroRight:jm};var Dq=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Rq(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Dq();return t&&e.setAttribute("nonce",t),e}function Nq(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function _q(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var jq=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Rq())&&(Nq(t,n),_q(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Pq=function(){var e=jq();return function(t,n){w.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},R_=function(){var e=Pq(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},Lq={left:0,top:0,right:0,gap:0},ax=function(e){return parseInt(e||"",10)||0},zq=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[ax(n),ax(r),ax(i)]},Iq=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Lq;var t=zq(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},$q=R_(),fu="data-scroll-locked",Fq=function(e,t,n,r){var i=e.left,o=e.top,a=e.right,l=e.gap;return n===void 0&&(n="margin"),`
|
|
13
13
|
.`.concat(wq,` {
|
|
14
14
|
overflow: hidden `).concat(r,`;
|
|
15
15
|
padding-right: `).concat(l,"px ").concat(r,`;
|
|
@@ -225,4 +225,4 @@ ${y.slice(d+2)}`,p+=1;else break}t.push({indent:d,number:parseInt(l,10),content:
|
|
|
225
225
|
`):"",markdownTokenizer:{name:"orderedList",level:"block",start:e=>{const t=e.match(/^(\s*)(\d+)\.\s+/),n=t?.index;return n!==void 0?n:-1},tokenize:(e,t,n)=>{var r;const i=e.split(`
|
|
226
226
|
`),[o,a]=fve(i);if(o.length===0)return;const l=Q3(o,0,n);return l.length===0?void 0:{type:"list",ordered:!0,start:((r=o[0])==null?void 0:r.number)||1,items:l,raw:i.slice(0,a).join(`
|
|
227
227
|
`)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(pve,this.editor.getAttributes(y2)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let e=ju({find:v2,type:this.type,getAttributes:t=>({start:+t[1]}),joinPredicate:(t,n)=>n.childCount+n.attrs.start===+t[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(e=ju({find:v2,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:t=>({start:+t[1],...this.editor.getAttributes(y2)}),joinPredicate:(t,n)=>n.childCount+n.attrs.start===+t[1],editor:this.editor})),[e]}}),mve=/^\s*(\[([( |x])?\])\s$/,gve=ci.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:e=>{const t=e.getAttribute("data-checked");return t===""||t==="true"},renderHTML:e=>({"data-checked":e.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:e,HTMLAttributes:t}){return["li",Un(this.options.HTMLAttributes,t,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:e.attrs.checked?"checked":null}],["span"]],["div",0]]},parseMarkdown:(e,t)=>{const n=[];if(e.tokens&&e.tokens.length>0?n.push(t.createNode("paragraph",{},t.parseInline(e.tokens))):e.text?n.push(t.createNode("paragraph",{},[t.createNode("text",{text:e.text})])):n.push(t.createNode("paragraph",{},[])),e.nestedTokens&&e.nestedTokens.length>0){const r=t.parseChildren(e.nestedTokens);n.push(...r)}return t.createNode("taskItem",{checked:e.checked||!1},n)},renderMarkdown:(e,t)=>{var n;const i=`- [${(n=e.attrs)!=null&&n.checked?"x":" "}] `;return rE(e,t,i)},addKeyboardShortcuts(){const e={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...e,Tab:()=>this.editor.commands.sinkListItem(this.name)}:e},addNodeView(){return({node:e,HTMLAttributes:t,getPos:n,editor:r})=>{const i=document.createElement("li"),o=document.createElement("label"),a=document.createElement("span"),l=document.createElement("input"),u=document.createElement("div"),d=h=>{var p,g;l.ariaLabel=((g=(p=this.options.a11y)==null?void 0:p.checkboxLabel)==null?void 0:g.call(p,h,l.checked))||`Task item checkbox for ${h.textContent||"empty task item"}`};return d(e),o.contentEditable="false",l.type="checkbox",l.addEventListener("mousedown",h=>h.preventDefault()),l.addEventListener("change",h=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){l.checked=!l.checked;return}const{checked:p}=h.target;r.isEditable&&typeof n=="function"&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:g})=>{const y=n();if(typeof y!="number")return!1;const b=g.doc.nodeAt(y);return g.setNodeMarkup(y,void 0,{...b?.attrs,checked:p}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(e,p)||(l.checked=!l.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([h,p])=>{i.setAttribute(h,p)}),i.dataset.checked=e.attrs.checked,l.checked=e.attrs.checked,o.append(l,a),i.append(o,u),Object.entries(t).forEach(([h,p])=>{i.setAttribute(h,p)}),{dom:i,contentDOM:u,update:h=>h.type!==this.type?!1:(i.dataset.checked=h.attrs.checked,l.checked=h.attrs.checked,d(h),!0)}}},addInputRules(){return[ju({find:mve,type:this.type,getAttributes:e=>({checked:e[e.length-1]==="x"})})]}}),yve=ci.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:e}){return["ul",Un(this.options.HTMLAttributes,e,{"data-type":this.name}),0]},parseMarkdown:(e,t)=>t.createNode("taskList",{},t.parseChildren(e.items||[])),renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
|
|
228
|
-
`):"",markdownTokenizer:{name:"taskList",level:"block",start(e){var t;const n=(t=e.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))==null?void 0:t.index;return n!==void 0?n:-1},tokenize(e,t,n){const r=o=>{const a=N1(o,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:l=>({indentLevel:l[1].length,mainContent:l[4],checked:l[3].toLowerCase()==="x"}),createToken:(l,u)=>({type:"taskItem",raw:"",mainContent:l.mainContent,indentLevel:l.indentLevel,checked:l.checked,text:l.mainContent,tokens:n.inlineTokens(l.mainContent),nestedTokens:u}),customNestedParser:r},n);return a?[{type:"taskList",raw:a.raw,items:a.items}]:n.blockTokens(o)},i=N1(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:o=>({indentLevel:o[1].length,mainContent:o[4],checked:o[3].toLowerCase()==="x"}),createToken:(o,a)=>({type:"taskItem",raw:"",mainContent:o.mainContent,indentLevel:o.indentLevel,checked:o.checked,text:o.mainContent,tokens:n.inlineTokens(o.mainContent),nestedTokens:a}),customNestedParser:r},n);if(i)return{type:"taskList",raw:i.raw,items:i.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});qn.create({name:"listKit",addExtensions(){const e=[];return this.options.bulletList!==!1&&e.push(V3.configure(this.options.bulletList)),this.options.listItem!==!1&&e.push(q3.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(X3.configure(this.options.listKeymap)),this.options.orderedList!==!1&&e.push(J3.configure(this.options.orderedList)),this.options.taskItem!==!1&&e.push(gve.configure(this.options.taskItem)),this.options.taskList!==!1&&e.push(yve.configure(this.options.taskList)),e}});var vve=ci.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:e}){return["p",Un(this.options.HTMLAttributes,e),0]},parseMarkdown:(e,t)=>{const n=e.tokens||[];return n.length===1&&n[0].type==="image"?t.parseChildren([n[0]]):t.createNode("paragraph",void 0,t.parseInline(n))},renderMarkdown:(e,t)=>!e||!Array.isArray(e.content)?"":t.renderChildren(e.content),addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),bve=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,xve=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,wve=ac.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:e=>e.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:e}){return["s",Un(this.options.HTMLAttributes,e),0]},markdownTokenName:"del",parseMarkdown:(e,t)=>t.applyMark("strike",t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>`~~${t.renderChildren(e)}~~`,addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[_u({find:bve,type:this.type})]},addPasteRules(){return[Yl({find:xve,type:this.type})]}}),Sve=ci.create({name:"text",group:"inline",parseMarkdown:e=>({type:"text",text:e.text||""}),renderMarkdown:e=>e.text||""});function Cve(e={}){return new In({view(t){return new Eve(t,e)}})}class Eve{constructor(t,n){var r;this.editorView=t,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=n.width)!==null&&r!==void 0?r:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(i=>{let o=a=>{this[i](a)};return t.dom.addEventListener(i,o),{name:i,handler:o}})}destroy(){this.handlers.forEach(({name:t,handler:n})=>this.editorView.dom.removeEventListener(t,n))}update(t,n){this.cursorPos!=null&&n.doc!=t.state.doc&&(this.cursorPos>t.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(t){t!=this.cursorPos&&(this.cursorPos=t,t==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let t=this.editorView.state.doc.resolve(this.cursorPos),n=!t.parent.inlineContent,r,i=this.editorView.dom,o=i.getBoundingClientRect(),a=o.width/i.offsetWidth,l=o.height/i.offsetHeight;if(n){let p=t.nodeBefore,g=t.nodeAfter;if(p||g){let y=this.editorView.nodeDOM(this.cursorPos-(p?p.nodeSize:0));if(y){let b=y.getBoundingClientRect(),C=p?b.bottom:b.top;p&&g&&(C=(C+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let E=this.width/2*l;r={left:b.left,right:b.right,top:C-E,bottom:C+E}}}}if(!r){let p=this.editorView.coordsAtPos(this.cursorPos),g=this.width/2*a;r={left:p.left-g,right:p.left+g,top:p.top,bottom:p.bottom}}let u=this.editorView.dom.offsetParent;this.element||(this.element=u.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let d,h;if(!u||u==document.body&&getComputedStyle(u).position=="static")d=-pageXOffset,h=-pageYOffset;else{let p=u.getBoundingClientRect(),g=p.width/u.offsetWidth,y=p.height/u.offsetHeight;d=p.left-u.scrollLeft*g,h=p.top-u.scrollTop*y}this.element.style.left=(r.left-d)/a+"px",this.element.style.top=(r.top-h)/l+"px",this.element.style.width=(r.right-r.left)/a+"px",this.element.style.height=(r.bottom-r.top)/l+"px"}scheduleRemoval(t){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),t)}dragover(t){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:t.clientX,top:t.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),i=r&&r.type.spec.disableDropCursor,o=typeof i=="function"?i(this.editorView,n,t):i;if(n&&!o){let a=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let l=e$(this.editorView.state.doc,a,this.editorView.dragging.slice);l!=null&&(a=l)}this.setCursor(a),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(t){this.editorView.dom.contains(t.relatedTarget)||this.setCursor(null)}}class jn extends gt{constructor(t){super(t,t)}map(t,n){let r=t.resolve(n.map(this.head));return jn.valid(r)?new jn(r):gt.near(r)}content(){return Le.empty}eq(t){return t instanceof jn&&t.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new jn(t.resolve(n.pos))}getBookmark(){return new pE(this.anchor)}static valid(t){let n=t.parent;if(n.isTextblock||!kve(t)||!Mve(t))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let i=n.contentMatchAt(t.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(t,n,r=!1){e:for(;;){if(!r&&jn.valid(t))return t;let i=t.pos,o=null;for(let a=t.depth;;a--){let l=t.node(a);if(n>0?t.indexAfter(a)<l.childCount:t.index(a)>0){o=l.child(n>0?t.indexAfter(a):t.index(a)-1);break}else if(a==0)return null;i+=n;let u=t.doc.resolve(i);if(jn.valid(u))return u}for(;;){let a=n>0?o.firstChild:o.lastChild;if(!a){if(o.isAtom&&!o.isText&&!Je.isSelectable(o)){t=t.doc.resolve(i+o.nodeSize*n),r=!1;continue e}break}o=a,i+=n;let l=t.doc.resolve(i);if(jn.valid(l))return l}return null}}}jn.prototype.visible=!1;jn.findFrom=jn.findGapCursorFrom;gt.jsonID("gapcursor",jn);class pE{constructor(t){this.pos=t}map(t){return new pE(t.map(this.pos))}resolve(t){let n=t.resolve(this.pos);return jn.valid(n)?new jn(n):gt.near(n)}}function kve(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function Mve(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function Ove(){return new In({props:{decorations:Rve,createSelectionBetween(e,t,n){return t.pos==n.pos&&jn.valid(n)?new jn(n):null},handleClick:Ave,handleKeyDown:Tve,handleDOMEvents:{beforeinput:Dve}}})}const Tve=e3({ArrowLeft:Tm("horiz",-1),ArrowRight:Tm("horiz",1),ArrowUp:Tm("vert",-1),ArrowDown:Tm("vert",1)});function Tm(e,t){const n=e=="vert"?t>0?"down":"up":t>0?"right":"left";return function(r,i,o){let a=r.selection,l=t>0?a.$to:a.$from,u=a.empty;if(a instanceof st){if(!o.endOfTextblock(n)||l.depth==0)return!1;u=!1,l=r.doc.resolve(t>0?l.after():l.before())}let d=jn.findGapCursorFrom(l,t,u);return d?(i&&i(r.tr.setSelection(new jn(d))),!0):!1}}function Ave(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!jn.valid(r))return!1;let i=e.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&Je.isSelectable(e.state.doc.nodeAt(i.inside))?!1:(e.dispatch(e.state.tr.setSelection(new jn(r))),!0)}function Dve(e,t){if(t.inputType!="insertCompositionText"||!(e.state.selection instanceof jn))return!1;let{$from:n}=e.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;let i=Me.empty;for(let a=r.length-1;a>=0;a--)i=Me.from(r[a].createAndFill(null,i));let o=e.state.tr.replace(n.pos,n.pos,new Le(i,0,0));return o.setSelection(st.near(o.doc.resolve(n.pos+1))),e.dispatch(o),!1}function Rve(e){if(!(e.selection instanceof jn))return null;let t=document.createElement("div");return t.className="ProseMirror-gapcursor",Mn.create(e.doc,[zr.widget(e.selection.head,t,{key:"gapcursor"})])}var my=200,mr=function(){};mr.prototype.append=function(t){return t.length?(t=mr.from(t),!this.length&&t||t.length<my&&this.leafAppend(t)||this.length<my&&t.leafPrepend(this)||this.appendInner(t)):this};mr.prototype.prepend=function(t){return t.length?mr.from(t).append(this):this};mr.prototype.appendInner=function(t){return new Nve(this,t)};mr.prototype.slice=function(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.length),t>=n?mr.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,n))};mr.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)};mr.prototype.forEach=function(t,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(t,n,r,0):this.forEachInvertedInner(t,n,r,0)};mr.prototype.map=function(t,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(o,a){return i.push(t(o,a))},n,r),i};mr.from=function(t){return t instanceof mr?t:t&&t.length?new eF(t):mr.empty};var eF=function(e){function t(r){e.call(this),this.values=r}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(i,o){return i==0&&o==this.length?this:new t(this.values.slice(i,o))},t.prototype.getInner=function(i){return this.values[i]},t.prototype.forEachInner=function(i,o,a,l){for(var u=o;u<a;u++)if(i(this.values[u],l+u)===!1)return!1},t.prototype.forEachInvertedInner=function(i,o,a,l){for(var u=o-1;u>=a;u--)if(i(this.values[u],l+u)===!1)return!1},t.prototype.leafAppend=function(i){if(this.length+i.length<=my)return new t(this.values.concat(i.flatten()))},t.prototype.leafPrepend=function(i){if(this.length+i.length<=my)return new t(i.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(mr);mr.empty=new eF([]);var Nve=function(e){function t(n,r){e.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},t.prototype.forEachInner=function(r,i,o,a){var l=this.left.length;if(i<l&&this.left.forEachInner(r,i,Math.min(o,l),a)===!1||o>l&&this.right.forEachInner(r,Math.max(i-l,0),Math.min(this.length,o)-l,a+l)===!1)return!1},t.prototype.forEachInvertedInner=function(r,i,o,a){var l=this.left.length;if(i>l&&this.right.forEachInvertedInner(r,i-l,Math.max(o,l)-l,a+l)===!1||o<l&&this.left.forEachInvertedInner(r,Math.min(i,l),o,a)===!1)return!1},t.prototype.sliceInner=function(r,i){if(r==0&&i==this.length)return this;var o=this.left.length;return i<=o?this.left.slice(r,i):r>=o?this.right.slice(r-o,i-o):this.left.slice(r,o).append(this.right.slice(0,i-o))},t.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new t(this.left,i)},t.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new t(i,this.right)},t.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new t(this.left,new t(this.right,r)):new t(this,r)},t}(mr);const _ve=500;class fo{constructor(t,n){this.items=t,this.eventCount=n}popEvent(t,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,o;n&&(i=this.remapping(r,this.items.length),o=i.maps.length);let a=t.tr,l,u,d=[],h=[];return this.items.forEach((p,g)=>{if(!p.step){i||(i=this.remapping(r,g+1),o=i.maps.length),o--,h.push(p);return}if(i){h.push(new hs(p.map));let y=p.step.map(i.slice(o)),b;y&&a.maybeStep(y).doc&&(b=a.mapping.maps[a.mapping.maps.length-1],d.push(new hs(b,void 0,void 0,d.length+h.length))),o--,b&&i.appendMap(b,o)}else a.maybeStep(p.step);if(p.selection)return l=i?p.selection.map(i.slice(o)):p.selection,u=new fo(this.items.slice(0,r).append(h.reverse().concat(d)),this.eventCount-1),!1},this.items.length,0),{remaining:u,transform:a,selection:l}}addTransform(t,n,r,i){let o=[],a=this.eventCount,l=this.items,u=!i&&l.length?l.get(l.length-1):null;for(let h=0;h<t.steps.length;h++){let p=t.steps[h].invert(t.docs[h]),g=new hs(t.mapping.maps[h],p,n),y;(y=u&&u.merge(g))&&(g=y,h?o.pop():l=l.slice(0,l.length-1)),o.push(g),n&&(a++,n=void 0),i||(u=g)}let d=a-r.depth;return d>Pve&&(l=jve(l,d),a-=d),new fo(l.append(o),a)}remapping(t,n){let r=new Zf;return this.items.forEach((i,o)=>{let a=i.mirrorOffset!=null&&o-i.mirrorOffset>=t?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,a)},t,n),r}addMaps(t){return this.eventCount==0?this:new fo(this.items.append(t.map(n=>new hs(n))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),o=t.mapping,a=t.steps.length,l=this.eventCount;this.items.forEach(g=>{g.selection&&l--},i);let u=n;this.items.forEach(g=>{let y=o.getMirror(--u);if(y==null)return;a=Math.min(a,y);let b=o.maps[y];if(g.step){let C=t.steps[y].invert(t.docs[y]),E=g.selection&&g.selection.map(o.slice(u+1,y));E&&l++,r.push(new hs(b,C,E))}else r.push(new hs(b))},i);let d=[];for(let g=n;g<a;g++)d.push(new hs(o.maps[g]));let h=this.items.slice(0,i).append(d).append(r),p=new fo(h,l);return p.emptyItemCount()>_ve&&(p=p.compress(this.items.length-r.length)),p}emptyItemCount(){let t=0;return this.items.forEach(n=>{n.step||t++}),t}compress(t=this.items.length){let n=this.remapping(0,t),r=n.maps.length,i=[],o=0;return this.items.forEach((a,l)=>{if(l>=t)i.push(a),a.selection&&o++;else if(a.step){let u=a.step.map(n.slice(r)),d=u&&u.getMap();if(r--,d&&n.appendMap(d,r),u){let h=a.selection&&a.selection.map(n.slice(r));h&&o++;let p=new hs(d.invert(),u,h),g,y=i.length-1;(g=i.length&&i[y].merge(p))?i[y]=g:i.push(p)}}else a.map&&r--},this.items.length,0),new fo(mr.from(i.reverse()),o)}}fo.empty=new fo(mr.empty,0);function jve(e,t){let n;return e.forEach((r,i)=>{if(r.selection&&t--==0)return n=i,!1}),e.slice(n)}let hs=class tF{constructor(t,n,r,i){this.map=t,this.step=n,this.selection=r,this.mirrorOffset=i}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new tF(n.getMap().invert(),n,this.selection)}}};class bs{constructor(t,n,r,i,o){this.done=t,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}}const Pve=20;function Lve(e,t,n,r){let i=n.getMeta(_l),o;if(i)return i.historyState;n.getMeta($ve)&&(e=new bs(e.done,e.undone,null,0,-1));let a=n.getMeta("appendedTransaction");if(n.steps.length==0)return e;if(a&&a.getMeta(_l))return a.getMeta(_l).redo?new bs(e.done.addTransform(n,void 0,r,Gm(t)),e.undone,b2(n.mapping.maps),e.prevTime,e.prevComposition):new bs(e.done,e.undone.addTransform(n,void 0,r,Gm(t)),null,e.prevTime,e.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(a&&a.getMeta("addToHistory")===!1)){let l=n.getMeta("composition"),u=e.prevTime==0||!a&&e.prevComposition!=l&&(e.prevTime<(n.time||0)-r.newGroupDelay||!zve(n,e.prevRanges)),d=a?sw(e.prevRanges,n.mapping):b2(n.mapping.maps);return new bs(e.done.addTransform(n,u?t.selection.getBookmark():void 0,r,Gm(t)),fo.empty,d,n.time,l??e.prevComposition)}else return(o=n.getMeta("rebased"))?new bs(e.done.rebased(n,o),e.undone.rebased(n,o),sw(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new bs(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),sw(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function zve(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((r,i)=>{for(let o=0;o<t.length;o+=2)r<=t[o+1]&&i>=t[o]&&(n=!0)}),n}function b2(e){let t=[];for(let n=e.length-1;n>=0&&t.length==0;n--)e[n].forEach((r,i,o,a)=>t.push(o,a));return t}function sw(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let i=t.map(e[r],1),o=t.map(e[r+1],-1);i<=o&&n.push(i,o)}return n}function Ive(e,t,n){let r=Gm(t),i=_l.get(t).spec.config,o=(n?e.undone:e.done).popEvent(t,r);if(!o)return null;let a=o.selection.resolve(o.transform.doc),l=(n?e.done:e.undone).addTransform(o.transform,t.selection.getBookmark(),i,r),u=new bs(n?l:o.remaining,n?o.remaining:l,null,0,-1);return o.transform.setSelection(a).setMeta(_l,{redo:n,historyState:u})}let lw=!1,x2=null;function Gm(e){let t=e.plugins;if(x2!=t){lw=!1,x2=t;for(let n=0;n<t.length;n++)if(t[n].spec.historyPreserveItems){lw=!0;break}}return lw}const _l=new yr("history"),$ve=new yr("closeHistory");function Fve(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new In({key:_l,state:{init(){return new bs(fo.empty,fo.empty,null,0,-1)},apply(t,n,r){return Lve(n,r,t,e)}},config:e,props:{handleDOMEvents:{beforeinput(t,n){let r=n.inputType,i=r=="historyUndo"?rF:r=="historyRedo"?iF:null;return i?(n.preventDefault(),i(t.state,t.dispatch)):!1}}}})}function nF(e,t){return(n,r)=>{let i=_l.getState(n);if(!i||(e?i.undone:i.done).eventCount==0)return!1;if(r){let o=Ive(i,n,e);o&&r(t?o.scrollIntoView():o)}return!0}}const rF=nF(!1,!0),iF=nF(!0,!0);qn.create({name:"characterCount",addOptions(){return{limit:null,mode:"textSize",textCounter:e=>e.length,wordCounter:e=>e.split(" ").filter(t=>t!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=e=>{const t=e?.node||this.editor.state.doc;if((e?.mode||this.options.mode)==="textSize"){const r=t.textBetween(0,t.content.size,void 0," ");return this.options.textCounter(r)}return t.nodeSize},this.storage.words=e=>{const t=e?.node||this.editor.state.doc,n=t.textBetween(0,t.content.size," "," ");return this.options.wordCounter(n)}},addProseMirrorPlugins(){let e=!1;return[new In({key:new yr("characterCount"),appendTransaction:(t,n,r)=>{if(e)return;const i=this.options.limit;if(i==null||i===0){e=!0;return}const o=this.storage.characters({node:r.doc});if(o>i){const a=o-i,l=0,u=a;console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);const d=r.tr.deleteRange(l,u);return e=!0,d}e=!0},filterTransaction:(t,n)=>{const r=this.options.limit;if(!t.docChanged||r===0||r===null||r===void 0)return!0;const i=this.storage.characters({node:n.doc}),o=this.storage.characters({node:t.doc});if(o<=r||i>r&&o>r&&o<=i)return!0;if(i>r&&o>r&&o>i||!t.getMeta("paste"))return!1;const l=t.selection.$head.pos,u=o-r,d=l-u,h=l;return t.deleteRange(d,h),!(this.storage.characters({node:t.doc})>r)}})]}});var Bve=qn.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[Cve(this.options)]}});qn.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new In({key:new yr("focus"),props:{decorations:({doc:e,selection:t})=>{const{isEditable:n,isFocused:r}=this.editor,{anchor:i}=t,o=[];if(!n||!r)return Mn.create(e,[]);let a=0;this.options.mode==="deepest"&&e.descendants((u,d)=>{if(u.isText)return;if(!(i>=d&&i<=d+u.nodeSize-1))return!1;a+=1});let l=0;return e.descendants((u,d)=>{if(u.isText||!(i>=d&&i<=d+u.nodeSize-1))return!1;if(l+=1,this.options.mode==="deepest"&&a-l>0||this.options.mode==="shallowest"&&l>1)return this.options.mode==="deepest";o.push(zr.node(d,d+u.nodeSize,{class:this.options.className}))}),Mn.create(e,o)}}})]}});var Hve=qn.create({name:"gapCursor",addProseMirrorPlugins(){return[Ove()]},extendNodeSchema(e){var t;const n={name:e.name,options:e.options,storage:e.storage};return{allowGapCursor:(t=Yt(Qe(e,"allowGapCursor",n)))!=null?t:null}}});qn.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new In({key:new yr("placeholder"),props:{decorations:({doc:e,selection:t})=>{const n=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=t,i=[];if(!n)return null;const o=this.editor.isEmpty;return e.descendants((a,l)=>{const u=r>=l&&r<=l+a.nodeSize,d=!a.isLeaf&&Ev(a);if((u||!this.options.showOnlyCurrent)&&d){const h=[this.options.emptyNodeClass];o&&h.push(this.options.emptyEditorClass);const p=zr.node(l,l+a.nodeSize,{class:h.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:a,pos:l,hasAnchor:u}):this.options.placeholder});i.push(p)}return this.options.includeChildren}),Mn.create(e,i)}}})]}});qn.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){const{editor:e,options:t}=this;return[new In({key:new yr("selection"),props:{decorations(n){return n.selection.empty||e.isFocused||!e.isEditable||g3(n.selection)||e.view.dragging?null:Mn.create(n.doc,[zr.inline(n.selection.from,n.selection.to,{class:t.className})])}}})]}});function w2({types:e,node:t}){return t&&Array.isArray(e)&&e.includes(t.type)||t?.type===e}var Uve=qn.create({name:"trailingNode",addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){var e;const t=new yr(this.name),n=((e=this.editor.schema.topNodeType.contentMatch.defaultType)==null?void 0:e.name)||this.options.node||"paragraph",r=Object.entries(this.editor.schema.nodes).map(([,i])=>i).filter(i=>(this.options.notAfter||[]).concat(n).includes(i.name));return[new In({key:t,appendTransaction:(i,o,a)=>{const{doc:l,tr:u,schema:d}=a,h=t.getState(a),p=l.content.size,g=d.nodes[n];if(h)return u.insert(p,g.create())},state:{init:(i,o)=>{const a=o.tr.doc.lastChild;return!w2({node:a,types:r})},apply:(i,o)=>{if(!i.docChanged)return o;const a=i.doc.lastChild;return!w2({node:a,types:r})}}})]}}),Vve=qn.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:e,dispatch:t})=>rF(e,t),redo:()=>({state:e,dispatch:t})=>iF(e,t)}},addProseMirrorPlugins(){return[Fve(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),qve=qn.create({name:"starterKit",addExtensions(){var e,t,n,r;const i=[];return this.options.bold!==!1&&i.push(Vye.configure(this.options.bold)),this.options.blockquote!==!1&&i.push($ye.configure(this.options.blockquote)),this.options.bulletList!==!1&&i.push(V3.configure(this.options.bulletList)),this.options.code!==!1&&i.push(Kye.configure(this.options.code)),this.options.codeBlock!==!1&&i.push(Gye.configure(this.options.codeBlock)),this.options.document!==!1&&i.push(Xye.configure(this.options.document)),this.options.dropcursor!==!1&&i.push(Bve.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&i.push(Hve.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&i.push(Qye.configure(this.options.hardBreak)),this.options.heading!==!1&&i.push(Jye.configure(this.options.heading)),this.options.undoRedo!==!1&&i.push(Vve.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&i.push(eve.configure(this.options.horizontalRule)),this.options.italic!==!1&&i.push(ove.configure(this.options.italic)),this.options.listItem!==!1&&i.push(q3.configure(this.options.listItem)),this.options.listKeymap!==!1&&i.push(X3.configure((e=this.options)==null?void 0:e.listKeymap)),this.options.link!==!1&&i.push(B3.configure((t=this.options)==null?void 0:t.link)),this.options.orderedList!==!1&&i.push(J3.configure(this.options.orderedList)),this.options.paragraph!==!1&&i.push(vve.configure(this.options.paragraph)),this.options.strike!==!1&&i.push(wve.configure(this.options.strike)),this.options.text!==!1&&i.push(Sve.configure(this.options.text)),this.options.underline!==!1&&i.push(H3.configure((n=this.options)==null?void 0:n.underline)),this.options.trailingNode!==!1&&i.push(Uve.configure((r=this.options)==null?void 0:r.trailingNode)),i}}),Wve="Separator",S2="horizontal",Kve=["horizontal","vertical"],oF=w.forwardRef((e,t)=>{const{decorative:n,orientation:r=S2,...i}=e,o=Yve(r)?r:S2,l=n?{role:"none"}:{"aria-orientation":o==="vertical"?o:void 0,role:"separator"};return x.jsx(Ge.div,{"data-orientation":o,...l,...i,ref:t})});oF.displayName=Wve;function Yve(e){return Kve.includes(e)}var Zve=oF;function C2({className:e,orientation:t="horizontal",decorative:n=!0,...r}){return x.jsx(Zve,{"data-slot":"separator",decorative:n,orientation:t,className:we("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...r})}var aF="Toggle",sF=w.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r,onPressedChange:i,...o}=e,[a,l]=qo({prop:n,onChange:i,defaultProp:r??!1,caller:aF});return x.jsx(Ge.button,{type:"button","aria-pressed":a,"data-state":a?"on":"off","data-disabled":e.disabled?"":void 0,...o,ref:t,onClick:_e(e.onClick,()=>{e.disabled||l(!a)})})});sF.displayName=aF;var Gve=sF;const Xve=ec("inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-stone-700 data-[state=on]:text-white [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground"},size:{default:"h-8 px-1.5 min-w-9",sm:"h-7 px-1.5 min-w-8",lg:"h-9 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}});function Am({className:e,variant:t,size:n,...r}){return x.jsx(Gve,{"data-slot":"toggle",className:we(Xve({variant:t,size:n,className:e})),...r})}function E2(e,[t,n]){return Math.min(n,Math.max(t,e))}function Qve(e){const t=Jve(e),n=w.forwardRef((r,i)=>{const{children:o,...a}=r,l=w.Children.toArray(o),u=l.find(tbe);if(u){const d=u.props.children,h=l.map(p=>p===u?w.Children.count(d)>1?w.Children.only(null):w.isValidElement(d)?d.props.children:null:p);return x.jsx(t,{...a,ref:i,children:w.isValidElement(d)?w.cloneElement(d,void 0,h):null})}return x.jsx(t,{...a,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}function Jve(e){const t=w.forwardRef((n,r)=>{const{children:i,...o}=n;if(w.isValidElement(i)){const a=rbe(i),l=nbe(o,i.props);return i.type!==w.Fragment&&(l.ref=r?Ir(r,a):a),w.cloneElement(i,l)}return w.Children.count(i)>1?w.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ebe=Symbol("radix.slottable");function tbe(e){return w.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ebe}function nbe(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...l)=>{const u=o(...l);return i(...l),u}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function rbe(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var ibe=[" ","Enter","ArrowUp","ArrowDown"],obe=[" ","Enter"],Zl="Select",[Ov,Tv,abe]=vC(Zl),[ed,Axe]=Ti(Zl,[abe,qs]),Av=qs(),[sbe,Gs]=ed(Zl),[lbe,cbe]=ed(Zl),lF=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:o,value:a,defaultValue:l,onValueChange:u,dir:d,name:h,autoComplete:p,disabled:g,required:y,form:b}=e,C=Av(t),[E,k]=w.useState(null),[O,A]=w.useState(null),[N,D]=w.useState(!1),L=lv(d),[T,I]=qo({prop:r,defaultProp:i??!1,onChange:o,caller:Zl}),[G,te]=qo({prop:a,defaultProp:l,onChange:u,caller:Zl}),fe=w.useRef(null),Q=E?b||!!E.closest("form"):!0,[J,H]=w.useState(new Set),q=Array.from(J).map(R=>R.props.value).join(";");return x.jsx(Uy,{...C,children:x.jsxs(sbe,{required:y,scope:t,trigger:E,onTriggerChange:k,valueNode:O,onValueNodeChange:A,valueNodeHasChildren:N,onValueNodeHasChildrenChange:D,contentId:hr(),value:G,onValueChange:te,open:T,onOpenChange:I,dir:L,triggerPointerDownPosRef:fe,disabled:g,children:[x.jsx(Ov.Provider,{scope:t,children:x.jsx(lbe,{scope:e.__scopeSelect,onNativeOptionAdd:w.useCallback(R=>{H(F=>new Set(F).add(R))},[]),onNativeOptionRemove:w.useCallback(R=>{H(F=>{const z=new Set(F);return z.delete(R),z})},[]),children:n})}),Q?x.jsxs(DF,{"aria-hidden":!0,required:y,tabIndex:-1,name:h,autoComplete:p,value:G,onChange:R=>te(R.target.value),disabled:g,form:b,children:[G===void 0?x.jsx("option",{value:""}):null,Array.from(J)]},q):null]})})};lF.displayName=Zl;var cF="SelectTrigger",uF=w.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,o=Av(n),a=Gs(cF,n),l=a.disabled||r,u=Dt(t,a.onTriggerChange),d=Tv(n),h=w.useRef("touch"),[p,g,y]=NF(C=>{const E=d().filter(A=>!A.disabled),k=E.find(A=>A.value===a.value),O=_F(E,C,k);O!==void 0&&a.onValueChange(O.value)}),b=C=>{l||(a.onOpenChange(!0),y()),C&&(a.triggerPointerDownPosRef.current={x:Math.round(C.pageX),y:Math.round(C.pageY)})};return x.jsx(xh,{asChild:!0,...o,children:x.jsx(Ge.button,{type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":RF(a.value)?"":void 0,...i,ref:u,onClick:_e(i.onClick,C=>{C.currentTarget.focus(),h.current!=="mouse"&&b(C)}),onPointerDown:_e(i.onPointerDown,C=>{h.current=C.pointerType;const E=C.target;E.hasPointerCapture(C.pointerId)&&E.releasePointerCapture(C.pointerId),C.button===0&&C.ctrlKey===!1&&C.pointerType==="mouse"&&(b(C),C.preventDefault())}),onKeyDown:_e(i.onKeyDown,C=>{const E=p.current!=="";!(C.ctrlKey||C.altKey||C.metaKey)&&C.key.length===1&&g(C.key),!(E&&C.key===" ")&&ibe.includes(C.key)&&(b(),C.preventDefault())})})})});uF.displayName=cF;var dF="SelectValue",fF=w.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:o,placeholder:a="",...l}=e,u=Gs(dF,n),{onValueNodeHasChildrenChange:d}=u,h=o!==void 0,p=Dt(t,u.onValueNodeChange);return sr(()=>{d(h)},[d,h]),x.jsx(Ge.span,{...l,ref:p,style:{pointerEvents:"none"},children:RF(u.value)?x.jsx(x.Fragment,{children:a}):o})});fF.displayName=dF;var ube="SelectIcon",hF=w.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return x.jsx(Ge.span,{"aria-hidden":!0,...i,ref:t,children:r||"▼"})});hF.displayName=ube;var dbe="SelectPortal",pF=e=>x.jsx(Bu,{asChild:!0,...e});pF.displayName=dbe;var Gl="SelectContent",mF=w.forwardRef((e,t)=>{const n=Gs(Gl,e.__scopeSelect),[r,i]=w.useState();if(sr(()=>{i(new DocumentFragment)},[]),!n.open){const o=r;return o?sh.createPortal(x.jsx(gF,{scope:e.__scopeSelect,children:x.jsx(Ov.Slot,{scope:e.__scopeSelect,children:x.jsx("div",{children:e.children})})}),o):null}return x.jsx(yF,{...e,ref:t})});mF.displayName=Gl;var so=10,[gF,Xs]=ed(Gl),fbe="SelectContentImpl",hbe=Qve("SelectContent.RemoveScroll"),yF=w.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:a,side:l,sideOffset:u,align:d,alignOffset:h,arrowPadding:p,collisionBoundary:g,collisionPadding:y,sticky:b,hideWhenDetached:C,avoidCollisions:E,...k}=e,O=Gs(Gl,n),[A,N]=w.useState(null),[D,L]=w.useState(null),T=Dt(t,ne=>N(ne)),[I,G]=w.useState(null),[te,fe]=w.useState(null),Q=Tv(n),[J,H]=w.useState(!1),q=w.useRef(!1);w.useEffect(()=>{if(A)return ky(A)},[A]),Cy();const R=w.useCallback(ne=>{const[Ce,...Te]=Q().map(De=>De.ref.current),[ye]=Te.slice(-1),Se=document.activeElement;for(const De of ne)if(De===Se||(De?.scrollIntoView({block:"nearest"}),De===Ce&&D&&(D.scrollTop=0),De===ye&&D&&(D.scrollTop=D.scrollHeight),De?.focus(),document.activeElement!==Se))return},[Q,D]),F=w.useCallback(()=>R([I,A]),[R,I,A]);w.useEffect(()=>{J&&F()},[J,F]);const{onOpenChange:z,triggerPointerDownPosRef:B}=O;w.useEffect(()=>{if(A){let ne={x:0,y:0};const Ce=ye=>{ne={x:Math.abs(Math.round(ye.pageX)-(B.current?.x??0)),y:Math.abs(Math.round(ye.pageY)-(B.current?.y??0))}},Te=ye=>{ne.x<=10&&ne.y<=10?ye.preventDefault():A.contains(ye.target)||z(!1),document.removeEventListener("pointermove",Ce),B.current=null};return B.current!==null&&(document.addEventListener("pointermove",Ce),document.addEventListener("pointerup",Te,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Ce),document.removeEventListener("pointerup",Te,{capture:!0})}}},[A,z,B]),w.useEffect(()=>{const ne=()=>z(!1);return window.addEventListener("blur",ne),window.addEventListener("resize",ne),()=>{window.removeEventListener("blur",ne),window.removeEventListener("resize",ne)}},[z]);const[U,P]=NF(ne=>{const Ce=Q().filter(Se=>!Se.disabled),Te=Ce.find(Se=>Se.ref.current===document.activeElement),ye=_F(Ce,ne,Te);ye&&setTimeout(()=>ye.ref.current.focus())}),j=w.useCallback((ne,Ce,Te)=>{const ye=!q.current&&!Te;(O.value!==void 0&&O.value===Ce||ye)&&(G(ne),ye&&(q.current=!0))},[O.value]),$=w.useCallback(()=>A?.focus(),[A]),K=w.useCallback((ne,Ce,Te)=>{const ye=!q.current&&!Te;(O.value!==void 0&&O.value===Ce||ye)&&fe(ne)},[O.value]),ee=r==="popper"?V1:vF,ge=ee===V1?{side:l,sideOffset:u,align:d,alignOffset:h,arrowPadding:p,collisionBoundary:g,collisionPadding:y,sticky:b,hideWhenDetached:C,avoidCollisions:E}:{};return x.jsx(gF,{scope:n,content:A,viewport:D,onViewportChange:L,itemRefCallback:j,selectedItem:I,onItemLeave:$,itemTextRefCallback:K,focusSelectedItem:F,selectedItemText:te,position:r,isPositioned:J,searchRef:U,children:x.jsx(ch,{as:hbe,allowPinchZoom:!0,children:x.jsx(lh,{asChild:!0,trapped:O.open,onMountAutoFocus:ne=>{ne.preventDefault()},onUnmountAutoFocus:_e(i,ne=>{O.trigger?.focus({preventScroll:!0}),ne.preventDefault()}),children:x.jsx(Fu,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:ne=>ne.preventDefault(),onDismiss:()=>O.onOpenChange(!1),children:x.jsx(ee,{role:"listbox",id:O.contentId,"data-state":O.open?"open":"closed",dir:O.dir,onContextMenu:ne=>ne.preventDefault(),...k,...ge,onPlaced:()=>H(!0),ref:T,style:{display:"flex",flexDirection:"column",outline:"none",...k.style},onKeyDown:_e(k.onKeyDown,ne=>{const Ce=ne.ctrlKey||ne.altKey||ne.metaKey;if(ne.key==="Tab"&&ne.preventDefault(),!Ce&&ne.key.length===1&&P(ne.key),["ArrowUp","ArrowDown","Home","End"].includes(ne.key)){let ye=Q().filter(Se=>!Se.disabled).map(Se=>Se.ref.current);if(["ArrowUp","End"].includes(ne.key)&&(ye=ye.slice().reverse()),["ArrowUp","ArrowDown"].includes(ne.key)){const Se=ne.target,De=ye.indexOf(Se);ye=ye.slice(De+1)}setTimeout(()=>R(ye)),ne.preventDefault()}})})})})})})});yF.displayName=fbe;var pbe="SelectItemAlignedPosition",vF=w.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,o=Gs(Gl,n),a=Xs(Gl,n),[l,u]=w.useState(null),[d,h]=w.useState(null),p=Dt(t,T=>h(T)),g=Tv(n),y=w.useRef(!1),b=w.useRef(!0),{viewport:C,selectedItem:E,selectedItemText:k,focusSelectedItem:O}=a,A=w.useCallback(()=>{if(o.trigger&&o.valueNode&&l&&d&&C&&E&&k){const T=o.trigger.getBoundingClientRect(),I=d.getBoundingClientRect(),G=o.valueNode.getBoundingClientRect(),te=k.getBoundingClientRect();if(o.dir!=="rtl"){const Se=te.left-I.left,De=G.left-Se,it=T.left-De,yt=T.width+it,ot=Math.max(yt,I.width),Nt=window.innerWidth-so,xt=E2(De,[so,Math.max(so,Nt-ot)]);l.style.minWidth=yt+"px",l.style.left=xt+"px"}else{const Se=I.right-te.right,De=window.innerWidth-G.right-Se,it=window.innerWidth-T.right-De,yt=T.width+it,ot=Math.max(yt,I.width),Nt=window.innerWidth-so,xt=E2(De,[so,Math.max(so,Nt-ot)]);l.style.minWidth=yt+"px",l.style.right=xt+"px"}const fe=g(),Q=window.innerHeight-so*2,J=C.scrollHeight,H=window.getComputedStyle(d),q=parseInt(H.borderTopWidth,10),R=parseInt(H.paddingTop,10),F=parseInt(H.borderBottomWidth,10),z=parseInt(H.paddingBottom,10),B=q+R+J+z+F,U=Math.min(E.offsetHeight*5,B),P=window.getComputedStyle(C),j=parseInt(P.paddingTop,10),$=parseInt(P.paddingBottom,10),K=T.top+T.height/2-so,ee=Q-K,ge=E.offsetHeight/2,ne=E.offsetTop+ge,Ce=q+R+ne,Te=B-Ce;if(Ce<=K){const Se=fe.length>0&&E===fe[fe.length-1].ref.current;l.style.bottom="0px";const De=d.clientHeight-C.offsetTop-C.offsetHeight,it=Math.max(ee,ge+(Se?$:0)+De+F),yt=Ce+it;l.style.height=yt+"px"}else{const Se=fe.length>0&&E===fe[0].ref.current;l.style.top="0px";const it=Math.max(K,q+C.offsetTop+(Se?j:0)+ge)+Te;l.style.height=it+"px",C.scrollTop=Ce-K+C.offsetTop}l.style.margin=`${so}px 0`,l.style.minHeight=U+"px",l.style.maxHeight=Q+"px",r?.(),requestAnimationFrame(()=>y.current=!0)}},[g,o.trigger,o.valueNode,l,d,C,E,k,o.dir,r]);sr(()=>A(),[A]);const[N,D]=w.useState();sr(()=>{d&&D(window.getComputedStyle(d).zIndex)},[d]);const L=w.useCallback(T=>{T&&b.current===!0&&(A(),O?.(),b.current=!1)},[A,O]);return x.jsx(gbe,{scope:n,contentWrapper:l,shouldExpandOnScrollRef:y,onScrollButtonChange:L,children:x.jsx("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:N},children:x.jsx(Ge.div,{...i,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});vF.displayName=pbe;var mbe="SelectPopperPosition",V1=w.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=so,...o}=e,a=Av(n);return x.jsx(Vy,{...a,...o,ref:t,align:r,collisionPadding:i,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});V1.displayName=mbe;var[gbe,mE]=ed(Gl,{}),q1="SelectViewport",bF=w.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...i}=e,o=Xs(q1,n),a=mE(q1,n),l=Dt(t,o.onViewportChange),u=w.useRef(0);return x.jsxs(x.Fragment,{children:[x.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),x.jsx(Ov.Slot,{scope:n,children:x.jsx(Ge.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:_e(i.onScroll,d=>{const h=d.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:g}=a;if(g?.current&&p){const y=Math.abs(u.current-h.scrollTop);if(y>0){const b=window.innerHeight-so*2,C=parseFloat(p.style.minHeight),E=parseFloat(p.style.height),k=Math.max(C,E);if(k<b){const O=k+y,A=Math.min(b,O),N=O-A;p.style.height=A+"px",p.style.bottom==="0px"&&(h.scrollTop=N>0?N:0,p.style.justifyContent="flex-end")}}}u.current=h.scrollTop})})})]})});bF.displayName=q1;var xF="SelectGroup",[ybe,vbe]=ed(xF),bbe=w.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=hr();return x.jsx(ybe,{scope:n,id:i,children:x.jsx(Ge.div,{role:"group","aria-labelledby":i,...r,ref:t})})});bbe.displayName=xF;var wF="SelectLabel",xbe=w.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=vbe(wF,n);return x.jsx(Ge.div,{id:i.id,...r,ref:t})});xbe.displayName=wF;var gy="SelectItem",[wbe,SF]=ed(gy),CF=w.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:o,...a}=e,l=Gs(gy,n),u=Xs(gy,n),d=l.value===r,[h,p]=w.useState(o??""),[g,y]=w.useState(!1),b=Dt(t,O=>u.itemRefCallback?.(O,r,i)),C=hr(),E=w.useRef("touch"),k=()=>{i||(l.onValueChange(r),l.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return x.jsx(wbe,{scope:n,value:r,disabled:i,textId:C,isSelected:d,onItemTextChange:w.useCallback(O=>{p(A=>A||(O?.textContent??"").trim())},[]),children:x.jsx(Ov.ItemSlot,{scope:n,value:r,disabled:i,textValue:h,children:x.jsx(Ge.div,{role:"option","aria-labelledby":C,"data-highlighted":g?"":void 0,"aria-selected":d&&g,"data-state":d?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...a,ref:b,onFocus:_e(a.onFocus,()=>y(!0)),onBlur:_e(a.onBlur,()=>y(!1)),onClick:_e(a.onClick,()=>{E.current!=="mouse"&&k()}),onPointerUp:_e(a.onPointerUp,()=>{E.current==="mouse"&&k()}),onPointerDown:_e(a.onPointerDown,O=>{E.current=O.pointerType}),onPointerMove:_e(a.onPointerMove,O=>{E.current=O.pointerType,i?u.onItemLeave?.():E.current==="mouse"&&O.currentTarget.focus({preventScroll:!0})}),onPointerLeave:_e(a.onPointerLeave,O=>{O.currentTarget===document.activeElement&&u.onItemLeave?.()}),onKeyDown:_e(a.onKeyDown,O=>{u.searchRef?.current!==""&&O.key===" "||(obe.includes(O.key)&&k(),O.key===" "&&O.preventDefault())})})})})});CF.displayName=gy;var mf="SelectItemText",EF=w.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...o}=e,a=Gs(mf,n),l=Xs(mf,n),u=SF(mf,n),d=cbe(mf,n),[h,p]=w.useState(null),g=Dt(t,k=>p(k),u.onItemTextChange,k=>l.itemTextRefCallback?.(k,u.value,u.disabled)),y=h?.textContent,b=w.useMemo(()=>x.jsx("option",{value:u.value,disabled:u.disabled,children:y},u.value),[u.disabled,u.value,y]),{onNativeOptionAdd:C,onNativeOptionRemove:E}=d;return sr(()=>(C(b),()=>E(b)),[C,E,b]),x.jsxs(x.Fragment,{children:[x.jsx(Ge.span,{id:u.textId,...o,ref:g}),u.isSelected&&a.valueNode&&!a.valueNodeHasChildren?sh.createPortal(o.children,a.valueNode):null]})});EF.displayName=mf;var kF="SelectItemIndicator",MF=w.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return SF(kF,n).isSelected?x.jsx(Ge.span,{"aria-hidden":!0,...r,ref:t}):null});MF.displayName=kF;var W1="SelectScrollUpButton",OF=w.forwardRef((e,t)=>{const n=Xs(W1,e.__scopeSelect),r=mE(W1,e.__scopeSelect),[i,o]=w.useState(!1),a=Dt(t,r.onScrollButtonChange);return sr(()=>{if(n.viewport&&n.isPositioned){let l=function(){const d=u.scrollTop>0;o(d)};const u=n.viewport;return l(),u.addEventListener("scroll",l),()=>u.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),i?x.jsx(AF,{...e,ref:a,onAutoScroll:()=>{const{viewport:l,selectedItem:u}=n;l&&u&&(l.scrollTop=l.scrollTop-u.offsetHeight)}}):null});OF.displayName=W1;var K1="SelectScrollDownButton",TF=w.forwardRef((e,t)=>{const n=Xs(K1,e.__scopeSelect),r=mE(K1,e.__scopeSelect),[i,o]=w.useState(!1),a=Dt(t,r.onScrollButtonChange);return sr(()=>{if(n.viewport&&n.isPositioned){let l=function(){const d=u.scrollHeight-u.clientHeight,h=Math.ceil(u.scrollTop)<d;o(h)};const u=n.viewport;return l(),u.addEventListener("scroll",l),()=>u.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),i?x.jsx(AF,{...e,ref:a,onAutoScroll:()=>{const{viewport:l,selectedItem:u}=n;l&&u&&(l.scrollTop=l.scrollTop+u.offsetHeight)}}):null});TF.displayName=K1;var AF=w.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,o=Xs("SelectScrollButton",n),a=w.useRef(null),l=Tv(n),u=w.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return w.useEffect(()=>()=>u(),[u]),sr(()=>{l().find(h=>h.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[l]),x.jsx(Ge.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:_e(i.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(r,50))}),onPointerMove:_e(i.onPointerMove,()=>{o.onItemLeave?.(),a.current===null&&(a.current=window.setInterval(r,50))}),onPointerLeave:_e(i.onPointerLeave,()=>{u()})})}),Sbe="SelectSeparator",Cbe=w.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return x.jsx(Ge.div,{"aria-hidden":!0,...r,ref:t})});Cbe.displayName=Sbe;var Y1="SelectArrow",Ebe=w.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Av(n),o=Gs(Y1,n),a=Xs(Y1,n);return o.open&&a.position==="popper"?x.jsx(qy,{...i,...r,ref:t}):null});Ebe.displayName=Y1;var kbe="SelectBubbleInput",DF=w.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const i=w.useRef(null),o=Dt(r,i),a=vP(t);return w.useEffect(()=>{const l=i.current;if(!l)return;const u=window.HTMLSelectElement.prototype,h=Object.getOwnPropertyDescriptor(u,"value").set;if(a!==t&&h){const p=new Event("change",{bubbles:!0});h.call(l,t),l.dispatchEvent(p)}},[a,t]),x.jsx(Ge.select,{...n,style:{...dL,...n.style},ref:o,defaultValue:t})});DF.displayName=kbe;function RF(e){return e===""||e===void 0}function NF(e){const t=Qi(e),n=w.useRef(""),r=w.useRef(0),i=w.useCallback(a=>{const l=n.current+a;t(l),function u(d){n.current=d,window.clearTimeout(r.current),d!==""&&(r.current=window.setTimeout(()=>u(""),1e3))}(l)},[t]),o=w.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return w.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,o]}function _F(e,t,n){const i=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let a=Mbe(e,Math.max(o,0));i.length===1&&(a=a.filter(d=>d!==n));const u=a.find(d=>d.textValue.toLowerCase().startsWith(i.toLowerCase()));return u!==n?u:void 0}function Mbe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Obe=lF,Tbe=uF,Abe=fF,Dbe=hF,Rbe=pF,Nbe=mF,_be=bF,jbe=CF,Pbe=EF,Lbe=MF,zbe=OF,Ibe=TF;function jF({...e}){return x.jsx(Obe,{"data-slot":"select",...e})}function $be({...e}){return x.jsx(Abe,{"data-slot":"select-value",...e})}function PF({className:e,size:t="default",children:n,...r}){return x.jsxs(Tbe,{"data-slot":"select-trigger","data-size":t,className:we("border-input hover:border-slate-300 data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-8 data-[size=sm]:h-7 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r,children:[n,x.jsx(Dbe,{asChild:!0,children:x.jsx(yh,{className:"size-4 opacity-50"})})]})}function LF({className:e,children:t,position:n="popper",align:r="center",...i}){return x.jsx(Rbe,{children:x.jsxs(Nbe,{"data-slot":"select-content",className:we("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md shadow-foreground/5",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,align:r,...i,children:[x.jsx(Fbe,{}),x.jsx(_be,{className:we("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),x.jsx(Bbe,{})]})})}function zF({className:e,children:t,...n}){return x.jsxs(jbe,{"data-slot":"select-item",className:we("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...n,children:[x.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:x.jsx(Lbe,{children:x.jsx(yP,{className:"size-4"})})}),x.jsx(Pbe,{children:t})]})}function Fbe({className:e,...t}){return x.jsx(zbe,{"data-slot":"select-scroll-up-button",className:we("flex cursor-default items-center justify-center py-1",e),...t,children:x.jsx(qZ,{className:"size-4"})})}function Bbe({className:e,...t}){return x.jsx(Ibe,{"data-slot":"select-scroll-down-button",className:we("flex cursor-default items-center justify-center py-1",e),...t,children:x.jsx(yh,{className:"size-4"})})}function Hbe(e){return e?.isActive("codeBlock")?"codeBlock":e?.isActive("blockquote")?"blockquote":e?.isActive("heading",{level:1})?"heading1":e?.isActive("heading",{level:2})?"heading2":e?.isActive("heading",{level:3})?"heading3":e?.isActive("heading",{level:4})?"heading4":e?.isActive("heading",{level:5})?"heading5":e?.isActive("heading",{level:6})?"heading6":"paragraph"}const Ube=["heading1","heading2","heading3","heading4","heading5","heading6","paragraph","blockquote","codeBlock"];function Vbe({editor:e}){const{t}=cn(),n=e?Hbe(e):void 0;return x.jsxs(jF,{value:n,onValueChange:r=>{const i=e.chain().focus().clearNodes();r.startsWith("heading")&&i.setHeading({level:Number(r.at(-1))}).run(),r==="blockquote"&&i.setBlockquote().run(),r==="codeBlock"&&i.setCodeBlock().run(),r==="paragraph"&&i.setParagraph().run()},children:[x.jsx(PF,{children:t(`widgets.rich_text_widget.${n}`)}),x.jsx(LF,{children:Ube.map(r=>x.jsx(zF,{value:r,children:t(`widgets.rich_text_widget.${r}`)},r))})]})}function qbe({editor:e}){const{t}=cn(),[n,r]=w.useState(!1),i=!zn(e.view.state.selection.content().toJSON());return x.jsxs(x.Fragment,{children:[n&&x.jsx(Wbe,{editor:e,onClose:()=>r(!1)}),x.jsxs(SL,{children:[x.jsx(EL,{children:e.isActive("link")?t("widgets.rich_text_widget.update_link"):t("widgets.rich_text_widget.set_link")}),x.jsx(CL,{asChild:!0,children:x.jsx(on,{size:"sm",variant:"ghost",disabled:!i&&!e.isActive("link"),onClick:()=>r(!0),children:x.jsx(DG,{})})})]})]})}const Wbe=({editor:e,onClose:t})=>{const{t:n}=cn(),[r,i]=w.useState(e.getAttributes("link").href??""),o=e.isActive("link");return x.jsx(Zu,{open:!0,onOpenChange:a=>{a||t()},children:x.jsxs(Gu,{children:[x.jsx(XS,{children:x.jsx(QS,{children:n(o?"widgets.rich_text_widget.update_link":"widgets.rich_text_widget.set_link")})}),x.jsx("div",{className:"py-6",children:x.jsx(Mr,{placeholder:"https://",value:r,onChange:a=>i(a.target.value)})}),x.jsxs(mJ,{children:[o&&x.jsx(on,{variant:"destructive",className:"mr-auto",onClick:()=>{e.chain().focus().unsetLink().run(),t()},children:n("widgets.rich_text_widget.remove_link")}),x.jsx(on,{variant:"ghost",onClick:()=>t(),children:n("common.cancel")}),x.jsx(on,{onClick:()=>{e.chain().focus().extendMarkRange("link").setLink({href:r}).run(),t()},children:n(o?"widgets.rich_text_widget.update_link":"widgets.rich_text_widget.set_link")})]})]})})};function Kbe({editor:e}){return e&&x.jsxs("div",{className:"border-b flex items-center gap-2 p-1 overflow-x-auto overflow-y-hidden",children:[x.jsx(on,{size:"sm",variant:"ghost",onClick:()=>e?.chain().focus().undo().run(),children:x.jsx(SG,{})}),x.jsx(on,{size:"sm",variant:"ghost",onClick:()=>e?.chain().focus().redo().run(),children:x.jsx(CG,{})}),x.jsx("div",{className:"w-[140px]",children:x.jsx(Vbe,{editor:e})}),x.jsx(Am,{pressed:e?.isActive("bold"),onPressedChange:()=>e?.chain().focus().toggleBold().run(),children:x.jsx(jG,{})}),x.jsx(Am,{pressed:e?.isActive("italic"),onPressedChange:()=>e?.chain().focus().toggleItalic().run(),children:x.jsx(PG,{})}),x.jsx(Am,{pressed:e?.isActive("underline"),onPressedChange:()=>e?.chain().focus().toggleUnderline().run(),children:x.jsx(zG,{})}),x.jsx(Am,{pressed:e?.isActive("strike"),onPressedChange:()=>e?.chain().focus().toggleStrike().run(),children:x.jsx(LG,{})}),x.jsx(C2,{orientation:"vertical",className:"h-auto self-stretch"}),x.jsx(on,{size:"sm",variant:"ghost",onClick:()=>e?.chain().focus().toggleOrderedList().run(),children:x.jsx(RG,{})}),x.jsx(on,{size:"sm",variant:"ghost",onClick:()=>e?.chain().focus().toggleBulletList().run(),children:x.jsx(NG,{})}),x.jsx(C2,{orientation:"vertical",className:"h-auto self-stretch"}),x.jsx(qbe,{editor:e})]})}const Ybe=[qve,mye,B3.configure({autolink:!0,linkOnPaste:!0,openOnClick:!1}),H3,Sge.configure({HTMLAttributes:{class:"rich-text-image"}})];function Zbe({value:e,onChange:t,disabled:n}){const r=jye({extensions:Ybe,content:e,editable:!n,editorProps:{attributes:{class:"rich-text-field"}},onUpdate({editor:i}){t?.(i.getHTML())}});return w.useEffect(()=>{e!==r.getHTML()&&r.commands.setContent(e??"")},[e,r]),zn(e)?null:x.jsxs("div",{className:"border border-solid rounded-md bg-background focus-within:border-ring",children:[x.jsx(Kbe,{editor:r}),x.jsx("div",{className:"max-h-[600px] overflow-y-auto scrollbar",children:x.jsx(Oye,{editor:r})})]})}function Gbe({field:e,value:t,onChange:n}){return x.jsxs(jF,{value:t,onValueChange:n,children:[x.jsx(PF,{children:x.jsx($be,{})}),x.jsx(LF,{children:e.choices?.map(([r,i])=>x.jsx(zF,{value:r,children:i}))})]})}function Xbe({value:e,onChange:t}){return x.jsx("div",{children:x.jsx(Mr,{value:e,onChange:n=>t(n.target.value.toLowerCase().replace(/[^0-9a-z_-]/g,"-"))})})}function Qbe({value:e,onChange:t}){return x.jsx("div",{children:x.jsx(Cce,{value:e,onChange:n=>t(n.target.value)})})}function Jbe({value:e="",onChange:t}){const[n,r]=e.split(":"),i=w.useRef(null);return x.jsxs("div",{className:"flex items-center gap-1",children:[x.jsx(Mr,{value:n,maxLength:2,max:24,inputMode:"decimal",className:"w-12",placeholder:"HH",onFocus:o=>o.target.select(),onChange:o=>{const a=o.target.value;t(`${a}:${r}`),a.length===2&&i.current&&i.current.focus()}}),x.jsx("span",{children:":"}),x.jsx(Mr,{value:r,maxLength:2,inputMode:"decimal",className:"w-12",placeholder:"mm",ref:i,onFocus:o=>o.target.select(),onChange:o=>t(`${n}:${o.target.value}`)})]})}function e0e({value:e,onChange:t}){return x.jsx("div",{children:x.jsxs(xI,{children:[x.jsx(c1,{children:"/"}),x.jsx(wI,{value:e.replace(/^\//,""),onChange:n=>t(`/${n.target.value.toLowerCase().replace(/[^0-9a-z_/-]/g,"-")}`)})]})})}function t0e({value:e,onChange:t,field:n}){const{data:r}=gh(),i=n.widget_class??r?.widgets[n.type]?.name??null,o=w.useMemo(()=>kS([[zn,Rt(TR)],[()=>n.type===Py.CharField&&!zn(n.choices),Rt(Gbe)],[sn(ti.DateWidget),Rt(Fse)],[sn(ti.ForeignKeyWidget),Rt(Use)],[sn(ti.InputWidget),Rt(TR)],[sn(ti.JSONSchemaWidget),Rt(Vse)],[sn(ti.ManyToManyWidget),Rt(Cle)],[sn(ti.MediaWidget),Rt(mde)],[sn(ti.MultiSelectWidget),Rt(xde)],[sn(ti.RichTextWidget),Rt(Zbe)],[sn(ti.TextAreaWidget),Rt(Qbe)],[sn(ti.SlugWidget),Rt(Xbe)],[sn(ti.URLPathWidget),Rt(e0e)],[sn(ti.CheckboxWidget),Rt(zre)],[sn(ti.TimeWidget),Rt(Jbe)],[wS,Rt(Bse)]])(i),[n.choices,n.type,i]);return x.jsx(o,{value:e,onChange:t,field:n})}function k2({formField:e,model:t}){const n=Xu(),r=t.fields[e.name];return x.jsx("div",{children:x.jsx(of,{control:n.control,name:e.name,render:({field:i})=>x.jsxs(af,{children:[x.jsx(Vm,{children:e.label||r?.verbose_name}),!r||r.readonly?x.jsx(GS,{value:i.value,field:r}):x.jsx(sf,{children:x.jsx(t0e,{field:r,...i})}),r&&x.jsx(Lre,{children:r.help_text}),x.jsx(lf,{})]})})})}function IF({formSet:e,model:t,hiddenFields:n=[]}){return x.jsxs("div",{children:[x.jsxs("div",{className:"mb-4 empty:hidden",children:[e.title&&x.jsx("h4",{className:"font-semibold",children:e.title}),e.description?x.jsx("div",{className:"text-sm text-muted-foreground",children:e.description}):null]}),x.jsx("div",{className:"space-y-3",children:e.fields.map((r,i)=>GW("fields",r)?x.jsx("div",{className:"grid gap-3",style:{gridTemplateColumns:`repeat(${r.fields.length}, 1fr)`},children:r.fields.filter(o=>!n.includes(o.name)).map(o=>x.jsx(k2,{formField:o,model:t},i))}):!n.includes(r.name)&&x.jsx(k2,{formField:r,model:t},i))})]})}function n0e({model:e,hiddenFields:t}){const{admin:{edit:{sidebar:n}}}=e;return!ks(n)&&!zn(n)&&x.jsx("aside",{className:"space-y-4",children:n.map((i,o)=>x.jsx("section",{className:"border rounded-lg p-4 w-full",children:x.jsx(IF,{model:e,formSet:i,hiddenFields:t})},o))})}var Dv="DropdownMenu",[r0e,Dxe]=Ti(Dv,[uv]),Vr=uv(),[i0e,$F]=r0e(Dv),FF=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:o,onOpenChange:a,modal:l=!0}=e,u=Vr(t),d=w.useRef(null),[h,p]=qo({prop:i,defaultProp:o??!1,onChange:a,caller:Dv});return x.jsx(i0e,{scope:t,triggerId:hr(),triggerRef:d,contentId:hr(),open:h,onOpenChange:p,onOpenToggle:w.useCallback(()=>p(g=>!g),[p]),modal:l,children:x.jsx(XI,{...u,open:h,onOpenChange:p,dir:r,modal:l,children:n})})};FF.displayName=Dv;var BF="DropdownMenuTrigger",HF=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,o=$F(BF,n),a=Vr(n);return x.jsx(QI,{asChild:!0,...a,children:x.jsx(Ge.button,{type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...i,ref:Ir(t,o.triggerRef),onPointerDown:_e(e.onPointerDown,l=>{!r&&l.button===0&&l.ctrlKey===!1&&(o.onOpenToggle(),o.open||l.preventDefault())}),onKeyDown:_e(e.onKeyDown,l=>{r||(["Enter"," "].includes(l.key)&&o.onOpenToggle(),l.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(l.key)&&l.preventDefault())})})})});HF.displayName=BF;var o0e="DropdownMenuPortal",UF=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Vr(t);return x.jsx(JI,{...r,...n})};UF.displayName=o0e;var VF="DropdownMenuContent",qF=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=$F(VF,n),o=Vr(n),a=w.useRef(!1);return x.jsx(e4,{id:i.contentId,"aria-labelledby":i.triggerId,...o,...r,ref:t,onCloseAutoFocus:_e(e.onCloseAutoFocus,l=>{a.current||i.triggerRef.current?.focus(),a.current=!1,l.preventDefault()}),onInteractOutside:_e(e.onInteractOutside,l=>{const u=l.detail.originalEvent,d=u.button===0&&u.ctrlKey===!0,h=u.button===2||d;(!i.modal||h)&&(a.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});qF.displayName=VF;var a0e="DropdownMenuGroup",s0e=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Vr(n);return x.jsx(t4,{...i,...r,ref:t})});s0e.displayName=a0e;var l0e="DropdownMenuLabel",c0e=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Vr(n);return x.jsx(n4,{...i,...r,ref:t})});c0e.displayName=l0e;var u0e="DropdownMenuItem",WF=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Vr(n);return x.jsx(r4,{...i,...r,ref:t})});WF.displayName=u0e;var d0e="DropdownMenuCheckboxItem",f0e=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Vr(n);return x.jsx(i4,{...i,...r,ref:t})});f0e.displayName=d0e;var h0e="DropdownMenuRadioGroup",p0e=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Vr(n);return x.jsx(o4,{...i,...r,ref:t})});p0e.displayName=h0e;var m0e="DropdownMenuRadioItem",g0e=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Vr(n);return x.jsx(a4,{...i,...r,ref:t})});g0e.displayName=m0e;var y0e="DropdownMenuItemIndicator",v0e=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Vr(n);return x.jsx(s4,{...i,...r,ref:t})});v0e.displayName=y0e;var b0e="DropdownMenuSeparator",x0e=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Vr(n);return x.jsx(l4,{...i,...r,ref:t})});x0e.displayName=b0e;var w0e="DropdownMenuArrow",S0e=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Vr(n);return x.jsx(c4,{...i,...r,ref:t})});S0e.displayName=w0e;var C0e="DropdownMenuSubTrigger",E0e=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Vr(n);return x.jsx(u4,{...i,...r,ref:t})});E0e.displayName=C0e;var k0e="DropdownMenuSubContent",M0e=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Vr(n);return x.jsx(d4,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});M0e.displayName=k0e;var O0e=FF,T0e=HF,A0e=UF,D0e=qF,R0e=WF;function KF({...e}){return x.jsx(O0e,{"data-slot":"dropdown-menu",...e})}function YF({...e}){return x.jsx(T0e,{"data-slot":"dropdown-menu-trigger",...e})}function ZF({className:e,sideOffset:t=4,...n}){return x.jsx(A0e,{children:x.jsx(D0e,{"data-slot":"dropdown-menu-content",sideOffset:t,className:we("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",e),...n})})}function GF({className:e,inset:t,variant:n="default",...r}){return x.jsx(R0e,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:we("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r})}function N0e({model:e,resource:t,isSaving:n,onSave:r,onDelete:i,onClose:o}){const{t:a}=cn(),l=Vn(),{data:u}=gh(),d=OC(),h=Xu(),p=!t?.id,g=e?.admin.is_singleton??!1,{isDirty:y}=h.formState,b=t&&u?t[u.settings.edited_at_attr]:null,C=xo(),{mutateAsync:E}=Us({async mutationFn(k){await l.delete(`/content/${e.label}/${k}`)},async onSuccess(){await C.invalidateQueries({queryKey:["resources",e.label]})}});return e&&x.jsx(x.Fragment,{children:x.jsxs(XS,{className:"border-b flex-row items-center gap-6 p-5",children:[x.jsx(on,{variant:"outline",size:"icon",disabled:n,onClick:async()=>{if(!y)return o?.();await d({description:a("editor.unsaved_alert")})&&o?.()},children:x.jsx(HG,{})}),x.jsxs("div",{className:"select-none",children:[x.jsx(QS,{children:`${a(p?"editor.title_create":"editor.title_edit",{modelName:e.verbose_name.toLowerCase()})}`}),x.jsx("div",{className:"text-sm font-medium text-muted-foreground",children:t?.__str__})]}),x.jsxs("div",{className:"flex-1 flex items-center justify-end gap-2",children:[b?x.jsx("div",{className:"text-muted-foreground text-sm font-medium mr-4 select-none",children:`${a("editor.last_edited")} ${Ko(b).fromNow()}`}):null,x.jsx(on,{onClick:async()=>{try{await r()}catch{}},isLoading:n,children:a(p?"common.create":"common.save")}),!g&&!p&&x.jsxs(KF,{children:[x.jsx(YF,{asChild:!0,children:x.jsx(on,{size:"icon",variant:"ghost",children:x.jsx(NP,{})})}),x.jsx(ZF,{align:"end",children:x.jsx(GF,{className:"text-destructive",onSelect:async()=>{await d({title:a("common.delete_confirm_title"),description:a("common.delete_confirm_description")})&&(await E(t.id),i?.())},children:a("common.delete")})})]})]})]})})}var Rv="Tabs",[_0e,Rxe]=Ti(Rv,[cv]),XF=cv(),[j0e,gE]=_0e(Rv),QF=w.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:o,orientation:a="horizontal",dir:l,activationMode:u="automatic",...d}=e,h=lv(l),[p,g]=qo({prop:r,onChange:i,defaultProp:o??"",caller:Rv});return x.jsx(j0e,{scope:n,baseId:hr(),value:p,onValueChange:g,orientation:a,dir:h,activationMode:u,children:x.jsx(Ge.div,{dir:h,"data-orientation":a,...d,ref:t})})});QF.displayName=Rv;var JF="TabsList",eB=w.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...i}=e,o=gE(JF,n),a=XF(n);return x.jsx(OI,{asChild:!0,...a,orientation:o.orientation,dir:o.dir,loop:r,children:x.jsx(Ge.div,{role:"tablist","aria-orientation":o.orientation,...i,ref:t})})});eB.displayName=JF;var tB="TabsTrigger",nB=w.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...o}=e,a=gE(tB,n),l=XF(n),u=oB(a.baseId,r),d=aB(a.baseId,r),h=r===a.value;return x.jsx(TI,{asChild:!0,...l,focusable:!i,active:h,children:x.jsx(Ge.button,{type:"button",role:"tab","aria-selected":h,"aria-controls":d,"data-state":h?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:u,...o,ref:t,onMouseDown:_e(e.onMouseDown,p=>{!i&&p.button===0&&p.ctrlKey===!1?a.onValueChange(r):p.preventDefault()}),onKeyDown:_e(e.onKeyDown,p=>{[" ","Enter"].includes(p.key)&&a.onValueChange(r)}),onFocus:_e(e.onFocus,()=>{const p=a.activationMode!=="manual";!h&&!i&&p&&a.onValueChange(r)})})})});nB.displayName=tB;var rB="TabsContent",iB=w.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:i,children:o,...a}=e,l=gE(rB,n),u=oB(l.baseId,r),d=aB(l.baseId,r),h=r===l.value,p=w.useRef(h);return w.useEffect(()=>{const g=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(g)},[]),x.jsx(li,{present:i||h,children:({present:g})=>x.jsx(Ge.div,{"data-state":h?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":u,hidden:!g,id:d,tabIndex:0,...a,ref:t,style:{...e.style,animationDuration:p.current?"0s":void 0},children:g&&o})})});iB.displayName=rB;function oB(e,t){return`${e}-trigger-${t}`}function aB(e,t){return`${e}-content-${t}`}var P0e=QF,L0e=eB,z0e=nB,I0e=iB;function $0e({className:e,...t}){return x.jsx(P0e,{"data-slot":"tabs",className:we("flex flex-col gap-2",e),...t})}function F0e({className:e,...t}){return x.jsx(L0e,{"data-slot":"tabs-list",className:we("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",e),...t})}function cw({className:e,...t}){return x.jsx(z0e,{"data-slot":"tabs-trigger",className:we("data-[state=active]:bg-background dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}function M2({className:e,...t}){return x.jsx(I0e,{"data-slot":"tabs-content",className:we("flex-1 outline-none",e),...t})}function B0e({relModel:e,relId:t,model:n,adminModel:r}){const{t:i}=cn(),o=Vn(),[a,l]=w.useState(!1),[u,d]=w.useState(1),h=!n.admin,p=PL({name:"__str__"}),{data:g}=Oi({retry:!1,refetchOnWindowFocus:!0,placeholderData:Ql,queryKey:["resources",e,n.label,r.fk_name,t,u],async queryFn(){const{data:y}=await o.get(`/inlines/${e}/${n.label}`,{params:{[`${r.fk_name}_id`]:t,page:u}});return y}});return x.jsxs("div",{className:"space-y-4",children:[x.jsx(Zu,{open:a,onOpenChange:l,children:x.jsx(Gu,{className:"p-0 sm:max-w-5xl",showCloseButton:!1,children:x.jsx(yE,{modelLabel:n.label,initialValues:{[r.fk_name]:{id:t,__str__:p}},onSave:()=>l(!1),onClose:()=>l(!1)})})}),x.jsx("div",{className:"border rounded-lg scrollbar",children:x.jsxs(kL,{children:[x.jsx(ML,{children:x.jsx(mg,{children:r.list_display?.map(y=>x.jsx(TL,{children:x.jsx("div",{className:"flex items-center",children:n.fields[y]?.verbose_name})},y))})}),x.jsx(OL,{children:g?.results.map(y=>x.jsx(H0e,{resource:y,model:n,adminModel:r,relId:t,relName:p,readOnly:h},y.id))})]})}),g?.pagination&&x.jsx("div",{className:"flex justify-center",children:x.jsx(vh,{current:g.pagination.current,pages:g.pagination.pages,onPageChange:d})}),x.jsx("div",{className:"flex justify-center",children:x.jsxs(on,{size:"sm",variant:"outline",onClick:()=>l(!0),children:[x.jsx(jP,{}),i("common.create")]})})]})}function H0e({resource:e,readOnly:t,model:n,adminModel:r,relId:i,relName:o}){const[a,l]=w.useState(!1);return x.jsxs(x.Fragment,{children:[x.jsx(Zu,{open:a,onOpenChange:l,children:!t&&x.jsx(Gu,{className:"p-0 sm:max-w-5xl",showCloseButton:!1,children:x.jsx(yE,{modelLabel:n.label,id:e.id,initialValues:{[r.fk_name]:{id:i,__str__:o}},onSave:()=>l(!1),onClose:()=>l(!1),onDelete:()=>l(!1)})})},e.id),x.jsx(mg,{onClick:()=>!t&&l(!0),className:we({"hover:bg-transparent":t}),children:r.list_display?.map(u=>x.jsx(AL,{children:x.jsx(GS,{value:e[u],field:n.fields[u]})},u))})]})}function U0e({model:e,id:t,hiddenFields:n}){const{t:r}=cn(),{data:i}=Ai(),{admin:{edit:{main:o,inlines:a}}}=e,l=o.length>1||!ks(o[0]?.label)||!ks(a),u=o.filter(ES("label"));return x.jsx("div",{children:x.jsxs($0e,{defaultValue:u[0]?.label||"default",children:[l&&x.jsxs(F0e,{className:"w-full",children:[u.map((d,h)=>x.jsx(cw,{value:d.label,children:d.label},h)),ks(u)&&!ks(a)&&x.jsx(cw,{value:"default",children:r("common.general")}),t?a.map(d=>x.jsx(cw,{value:d.model,children:i?.models.find(Wo({label:d.model}))?.verbose_name_plural},d.model)):null]}),o.map((d,h)=>x.jsx(M2,{value:d.label||"default",className:"space-y-4",children:d.formsets.map((p,g)=>x.jsx("section",{className:"border rounded-lg p-4 w-full",children:x.jsx(IF,{model:e,formSet:p,hiddenFields:n})},g))},h)),t?a.map(d=>{const h=i?.models.find(Wo({label:d.model}));return h?x.jsx(M2,{value:d.model,children:x.jsx(B0e,{relModel:e.label,relId:t,model:h,adminModel:d})},d.model):null}):null]})})}function yE({modelLabel:e,id:t,initialValues:n={},onDelete:r,onSave:i,onClose:o}){const a=xo(),l=Vn(),{data:u}=Ai(),d=u?.models.find(Wo({label:e})),h=d?.admin.is_singleton??!1,p=Object.keys(n),g=Object.entries(d?.fields??{}).reduce((A,[N,D])=>({...A,[N]:D.default}),{}),y=oz({id:Qw().readonly().optional(),__str__:Qw().readonly().optional()}),b=HL({resolver:rz(y),mode:"onChange",defaultValues:i7(n,g)}),{data:C}=Oi({enabled:!zn(t)||h,retry:!1,queryKey:["resources",e,t||h],async queryFn(){const{data:A}=await l.get(`/content/${e}${h?"":`/${t}`}`);return b.reset(A),A}}),{mutateAsync:E,isPending:k}=Us({async mutationFn(A){await l[A.id?"put":"post"](`/content/${e}${A.id?`/${A.id}`:""}`,A)},async onSuccess(){await a.invalidateQueries({queryKey:["resources",e]})}});async function O(A){await E(A)}return d&&x.jsx(lz,{...b,children:x.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[x.jsx(N0e,{model:d,resource:C,isSaving:k,onSave:async()=>{await b.handleSubmit(O)(),i?.()},onDelete:r,onClose:o}),x.jsxs("div",{className:"flex flex-1 justify-center overflow-y-auto",children:[x.jsx("div",{className:"w-full max-w-3xl",children:x.jsx("div",{className:"p-5",children:x.jsx(U0e,{model:d,id:t,hiddenFields:p})})}),x.jsx("div",{className:"w-full max-w-[360px]",children:x.jsx("div",{className:"p-5",children:x.jsx(n0e,{model:d,hiddenFields:p})})})]})]})})}function V0e(){const e=bo(),t=zu(),[n,r,i]=e.hash.split(":");return x.jsx(Zu,{open:e.hash.startsWith("#editor:"),onOpenChange:o=>{o||t({hash:""})},children:x.jsx(Gu,{showCloseButton:!1,className:"sm:max-w-none w-screen h-screen rounded-none p-0",onOpenAutoFocus:o=>o.preventDefault(),children:x.jsx(yE,{modelLabel:r,id:i,onClose:()=>t({hash:""}),onSave:()=>t({hash:""}),onDelete:()=>t({hash:""})})})})}function q0e(){const e=Vn();return Oi({retry:!1,queryKey:["me"],async queryFn(){const{data:t}=await e.get("/me");return t}})}function W0e(){const{t:e}=cn(),t=zu(),{setToken:n}=_S(),{data:r}=gh(),{data:i}=q0e(),{data:o}=Ai(),[a,l]=w.useState("");return x.jsxs("nav",{className:"w-[240px] shrink-0 flex flex-col bg-stone-50 border-r",children:[r&&x.jsxs("div",{className:"flex items-center gap-2 border-b p-3",children:[x.jsx("div",{className:"bg-gradient-to-tl from-stone-900 to-stone-600 size-7 rounded flex items-center justify-center text-white font-black shrink-0",children:r.site_header[0]}),x.jsx("h2",{className:"line-clamp-1 break-all text-base font-semibold",children:r.site_header})]}),x.jsx("div",{className:"p-3 border-b",children:x.jsx(Mr,{variant:"secondary",className:"border",placeholder:e("common.search"),value:a,onChange:u=>l(u.target.value)})}),x.jsxs("div",{className:"flex-1 p-2 space-y-1 overflow-y-auto scrollbar",children:[x.jsx(nf,{to:"/",color:"slate",icon:x.jsx(AG,{}),label:e("main_menu.dashboard")}),o?.media_library.enabled&&x.jsx(nf,{to:"/media-library",color:"pink",icon:x.jsx(_P,{}),label:e("main_menu.media_library")}),x.jsx("div",{className:"h-4",role:"separator"}),o?.model_groups.map(u=>x.jsx(nf,{color:u.color??"blue",icon:u.icon??x.jsx($w,{}),label:u.label,children:u.models.map(d=>{const h=o.models.find(Wo({label:d}));return h?x.jsx(nf,{to:h.admin.is_singleton?{hash:`editor:${h.label}`}:`/content/${h.label}`,label:h.verbose_name_plural,icon:h.admin.icon??x.jsx($w,{})},d):null}).filter(d=>!zn(d))},u.name)),x.jsx("div",{className:"h-4",role:"separator"}),x.jsx(nf,{to:"/",icon:x.jsx(_G,{}),label:e("main_menu.settings")})]}),x.jsx("div",{className:"p-1 border-t",children:i&&x.jsxs(KF,{children:[x.jsx(ZF,{side:"right",align:"start",children:x.jsxs(GF,{onClick:()=>{n(null),t("/login")},children:[x.jsx(FG,{}),e("main_menu.log_out")]})}),x.jsxs(YF,{className:"flex items-center text-left w-full gap-3 hover:bg-stone-200 p-2 rounded-md select-none",children:[x.jsxs("div",{className:"relative rounded-full size-8 bg-indigo-500 text-indigo-100 flex items-center justify-center font-bold shrink-0 text-xs",children:[`${i.first_name??""}${i.last_name??""}${i.username??""}`.trim().replace(/\s/g,"").slice(0,2).toUpperCase(),x.jsx("div",{className:"bg-emerald-500 size-2 rounded-full absolute bottom-px right-px"})]}),x.jsxs("div",{className:"flex-1",children:[x.jsx("div",{className:"text-sm font-medium",children:`${i.first_name??""} ${i.last_name??""}`.trim()}),x.jsx("div",{className:"text-xs text-muted-foreground",children:i.username})]})]})]})})]})}const K0e={slate:"bg-slate-200 text-slate-600",gray:"bg-gray-200 text-gray-600",zinc:"bg-zinc-200 text-zinc-600",neutral:"bg-neutral-200 text-neutral-600",stone:"bg-stone-200 text-stone-600",red:"bg-red-100 text-red-600",orange:"bg-orange-100 text-orange-600",amber:"bg-amber-100 text-amber-600",yellow:"bg-yellow-100 text-yellow-600",lime:"bg-lime-100 text-lime-600",green:"bg-green-100 text-green-600",emerald:"bg-emerald-100 text-emerald-600",teal:"bg-teal-100 text-teal-600",cyan:"bg-cyan-100 text-cyan-600",sky:"bg-sky-100 text-sky-600",blue:"bg-blue-100 text-blue-600",indigo:"bg-indigo-100 text-indigo-600",violet:"bg-violet-100 text-violet-600",purple:"bg-purple-100 text-purple-600",fuchsia:"bg-fuchsia-100 text-fuchsia-600",pink:"bg-pink-100 text-pink-600",rose:"bg-rose-100 text-rose-600"};function nf({label:e,icon:t,to:n,color:r,children:i}){const o=n?Iu:"button",[a,l]=w.useState(!1);return x.jsxs(x.Fragment,{children:[x.jsxs(o,{to:n??void 0,className:"flex items-center w-full text-sm font-medium gap-2 h-8 px-2 hover:bg-stone-100 rounded hover:cursor-default",onClick:()=>{i&&l(!a)},children:[t&&x.jsx("span",{className:we("size-5 rounded flex items-center justify-center",r?K0e[r]:"text-stone-500"),children:typeof t=="string"?x.jsx("span",{className:we(t)}):t}),x.jsxs("span",{className:"flex items-center justify-between flex-1",children:[x.jsx("span",{className:"first-letter:uppercase line-clamp-1 break-all",children:e}),i?a?x.jsx(kG,{}):x.jsx(DP,{}):null]})]}),i&&a?x.jsx("div",{className:"pl-3",children:i}):null]})}function Y0e(){return x.jsxs("div",{className:"h-screen flex items-stretch",children:[x.jsx(W0e,{}),x.jsx(V0e,{}),x.jsx("div",{className:"flex-1 bg-[#FDFDFD] flex flex-col overflow-y-auto scrollbar",children:x.jsx(ah,{})})]})}function Z0e({filters:e,onFilterChange:t}){const{t:n}=cn();return x.jsx("div",{children:x.jsx(Mr,{variant:"secondary",value:e.search,onChange:r=>t({search:r.target.value}),placeholder:n("common.search")})})}function G0e({items:e}){const{data:t}=Ai();return t?.media_library.models.media_model&&x.jsx("div",{className:"grid grid-cols-4 gap-4",children:e.map(r=>x.jsx(E4,{item:r},r.id))})}function X0e(){const{t:e}=cn(),{data:t}=Ai(),n=t?.media_library.models.media_model,[r,i]=aS(),o=Number(r.get("page")??"1"),a=r.get("folder"),[l,u]=w.useState({search:""}),{data:d}=M4({folder:a,page:o,filters:l});return n&&d?x.jsxs("div",{className:"flex flex-col overflow-hidden",children:[x.jsxs("div",{className:"flex items-center gap-4 mb-6 py-3 px-5 border-b",children:[x.jsx(_P,{size:24,className:"text-muted-foreground shrink-0"}),x.jsxs("div",{className:"flex-1",children:[x.jsx("h1",{className:"text-xl/tight font-semibold mb-0.5",children:e("media-library.title")}),t.media_library.folders?x.jsx(bI,{folder:a,onSelect:h=>i(p=>(h?p.set("folder",h):p.delete("folder"),p))}):x.jsx("div",{className:"text-muted-foreground",children:e("media-library.description")})]})]}),x.jsx("div",{className:"mb-8 px-5",children:x.jsx(Z0e,{filters:l,onFilterChange:u})}),t.media_library.folders&&x.jsx("div",{className:"mb-4 px-5",children:x.jsx(C4,{parent:a,onSelect:h=>i(p=>(h?p.set("folder",h):p.delete("folder"),p))})}),x.jsxs("div",{className:"px-5 overflow-y-auto scrollbar flex-1",children:[x.jsx(G0e,{items:d.results}),x.jsx("div",{className:"py-5",children:x.jsx(vh,{current:d.pagination.current,pages:d.pagination.pages,onPageChange:h=>i(p=>(p.set("page",`${h}`),p))})})]})]}):x.jsx("div",{className:"flex-1 flex items-center justify-center",children:x.jsx(Iy,{})})}const Q0e=R8([{element:x.jsx(QK,{}),children:[{element:x.jsx(RZ,{}),children:[{element:x.jsx(Y0e,{}),children:[{path:"",element:x.jsx(xG,{})},{path:"/media-library",element:x.jsx(X0e,{})},{path:"/content/:model",element:x.jsx(wG,{}),children:[{path:"",element:x.jsx(dJ,{})}]}]}]},{element:x.jsx(NZ,{}),children:[{path:"login",element:x.jsx(pG,{})}]}]}]),J0e=document.getElementById("root");E6.createRoot(J0e).render(x.jsx(DZ,{children:x.jsx(r8,{router:Q0e})}));export{exe as c,yo as g};
|
|
228
|
+
`):"",markdownTokenizer:{name:"taskList",level:"block",start(e){var t;const n=(t=e.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))==null?void 0:t.index;return n!==void 0?n:-1},tokenize(e,t,n){const r=o=>{const a=N1(o,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:l=>({indentLevel:l[1].length,mainContent:l[4],checked:l[3].toLowerCase()==="x"}),createToken:(l,u)=>({type:"taskItem",raw:"",mainContent:l.mainContent,indentLevel:l.indentLevel,checked:l.checked,text:l.mainContent,tokens:n.inlineTokens(l.mainContent),nestedTokens:u}),customNestedParser:r},n);return a?[{type:"taskList",raw:a.raw,items:a.items}]:n.blockTokens(o)},i=N1(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:o=>({indentLevel:o[1].length,mainContent:o[4],checked:o[3].toLowerCase()==="x"}),createToken:(o,a)=>({type:"taskItem",raw:"",mainContent:o.mainContent,indentLevel:o.indentLevel,checked:o.checked,text:o.mainContent,tokens:n.inlineTokens(o.mainContent),nestedTokens:a}),customNestedParser:r},n);if(i)return{type:"taskList",raw:i.raw,items:i.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});qn.create({name:"listKit",addExtensions(){const e=[];return this.options.bulletList!==!1&&e.push(V3.configure(this.options.bulletList)),this.options.listItem!==!1&&e.push(q3.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(X3.configure(this.options.listKeymap)),this.options.orderedList!==!1&&e.push(J3.configure(this.options.orderedList)),this.options.taskItem!==!1&&e.push(gve.configure(this.options.taskItem)),this.options.taskList!==!1&&e.push(yve.configure(this.options.taskList)),e}});var vve=ci.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:e}){return["p",Un(this.options.HTMLAttributes,e),0]},parseMarkdown:(e,t)=>{const n=e.tokens||[];return n.length===1&&n[0].type==="image"?t.parseChildren([n[0]]):t.createNode("paragraph",void 0,t.parseInline(n))},renderMarkdown:(e,t)=>!e||!Array.isArray(e.content)?"":t.renderChildren(e.content),addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),bve=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,xve=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,wve=ac.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:e=>e.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:e}){return["s",Un(this.options.HTMLAttributes,e),0]},markdownTokenName:"del",parseMarkdown:(e,t)=>t.applyMark("strike",t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>`~~${t.renderChildren(e)}~~`,addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[_u({find:bve,type:this.type})]},addPasteRules(){return[Yl({find:xve,type:this.type})]}}),Sve=ci.create({name:"text",group:"inline",parseMarkdown:e=>({type:"text",text:e.text||""}),renderMarkdown:e=>e.text||""});function Cve(e={}){return new In({view(t){return new Eve(t,e)}})}class Eve{constructor(t,n){var r;this.editorView=t,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=n.width)!==null&&r!==void 0?r:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(i=>{let o=a=>{this[i](a)};return t.dom.addEventListener(i,o),{name:i,handler:o}})}destroy(){this.handlers.forEach(({name:t,handler:n})=>this.editorView.dom.removeEventListener(t,n))}update(t,n){this.cursorPos!=null&&n.doc!=t.state.doc&&(this.cursorPos>t.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(t){t!=this.cursorPos&&(this.cursorPos=t,t==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let t=this.editorView.state.doc.resolve(this.cursorPos),n=!t.parent.inlineContent,r,i=this.editorView.dom,o=i.getBoundingClientRect(),a=o.width/i.offsetWidth,l=o.height/i.offsetHeight;if(n){let p=t.nodeBefore,g=t.nodeAfter;if(p||g){let y=this.editorView.nodeDOM(this.cursorPos-(p?p.nodeSize:0));if(y){let b=y.getBoundingClientRect(),C=p?b.bottom:b.top;p&&g&&(C=(C+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let E=this.width/2*l;r={left:b.left,right:b.right,top:C-E,bottom:C+E}}}}if(!r){let p=this.editorView.coordsAtPos(this.cursorPos),g=this.width/2*a;r={left:p.left-g,right:p.left+g,top:p.top,bottom:p.bottom}}let u=this.editorView.dom.offsetParent;this.element||(this.element=u.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let d,h;if(!u||u==document.body&&getComputedStyle(u).position=="static")d=-pageXOffset,h=-pageYOffset;else{let p=u.getBoundingClientRect(),g=p.width/u.offsetWidth,y=p.height/u.offsetHeight;d=p.left-u.scrollLeft*g,h=p.top-u.scrollTop*y}this.element.style.left=(r.left-d)/a+"px",this.element.style.top=(r.top-h)/l+"px",this.element.style.width=(r.right-r.left)/a+"px",this.element.style.height=(r.bottom-r.top)/l+"px"}scheduleRemoval(t){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),t)}dragover(t){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:t.clientX,top:t.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),i=r&&r.type.spec.disableDropCursor,o=typeof i=="function"?i(this.editorView,n,t):i;if(n&&!o){let a=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let l=e$(this.editorView.state.doc,a,this.editorView.dragging.slice);l!=null&&(a=l)}this.setCursor(a),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(t){this.editorView.dom.contains(t.relatedTarget)||this.setCursor(null)}}class jn extends gt{constructor(t){super(t,t)}map(t,n){let r=t.resolve(n.map(this.head));return jn.valid(r)?new jn(r):gt.near(r)}content(){return Le.empty}eq(t){return t instanceof jn&&t.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new jn(t.resolve(n.pos))}getBookmark(){return new pE(this.anchor)}static valid(t){let n=t.parent;if(n.isTextblock||!kve(t)||!Mve(t))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let i=n.contentMatchAt(t.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(t,n,r=!1){e:for(;;){if(!r&&jn.valid(t))return t;let i=t.pos,o=null;for(let a=t.depth;;a--){let l=t.node(a);if(n>0?t.indexAfter(a)<l.childCount:t.index(a)>0){o=l.child(n>0?t.indexAfter(a):t.index(a)-1);break}else if(a==0)return null;i+=n;let u=t.doc.resolve(i);if(jn.valid(u))return u}for(;;){let a=n>0?o.firstChild:o.lastChild;if(!a){if(o.isAtom&&!o.isText&&!Je.isSelectable(o)){t=t.doc.resolve(i+o.nodeSize*n),r=!1;continue e}break}o=a,i+=n;let l=t.doc.resolve(i);if(jn.valid(l))return l}return null}}}jn.prototype.visible=!1;jn.findFrom=jn.findGapCursorFrom;gt.jsonID("gapcursor",jn);class pE{constructor(t){this.pos=t}map(t){return new pE(t.map(this.pos))}resolve(t){let n=t.resolve(this.pos);return jn.valid(n)?new jn(n):gt.near(n)}}function kve(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function Mve(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function Ove(){return new In({props:{decorations:Rve,createSelectionBetween(e,t,n){return t.pos==n.pos&&jn.valid(n)?new jn(n):null},handleClick:Ave,handleKeyDown:Tve,handleDOMEvents:{beforeinput:Dve}}})}const Tve=e3({ArrowLeft:Tm("horiz",-1),ArrowRight:Tm("horiz",1),ArrowUp:Tm("vert",-1),ArrowDown:Tm("vert",1)});function Tm(e,t){const n=e=="vert"?t>0?"down":"up":t>0?"right":"left";return function(r,i,o){let a=r.selection,l=t>0?a.$to:a.$from,u=a.empty;if(a instanceof st){if(!o.endOfTextblock(n)||l.depth==0)return!1;u=!1,l=r.doc.resolve(t>0?l.after():l.before())}let d=jn.findGapCursorFrom(l,t,u);return d?(i&&i(r.tr.setSelection(new jn(d))),!0):!1}}function Ave(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!jn.valid(r))return!1;let i=e.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&Je.isSelectable(e.state.doc.nodeAt(i.inside))?!1:(e.dispatch(e.state.tr.setSelection(new jn(r))),!0)}function Dve(e,t){if(t.inputType!="insertCompositionText"||!(e.state.selection instanceof jn))return!1;let{$from:n}=e.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;let i=Me.empty;for(let a=r.length-1;a>=0;a--)i=Me.from(r[a].createAndFill(null,i));let o=e.state.tr.replace(n.pos,n.pos,new Le(i,0,0));return o.setSelection(st.near(o.doc.resolve(n.pos+1))),e.dispatch(o),!1}function Rve(e){if(!(e.selection instanceof jn))return null;let t=document.createElement("div");return t.className="ProseMirror-gapcursor",Mn.create(e.doc,[zr.widget(e.selection.head,t,{key:"gapcursor"})])}var my=200,mr=function(){};mr.prototype.append=function(t){return t.length?(t=mr.from(t),!this.length&&t||t.length<my&&this.leafAppend(t)||this.length<my&&t.leafPrepend(this)||this.appendInner(t)):this};mr.prototype.prepend=function(t){return t.length?mr.from(t).append(this):this};mr.prototype.appendInner=function(t){return new Nve(this,t)};mr.prototype.slice=function(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.length),t>=n?mr.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,n))};mr.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)};mr.prototype.forEach=function(t,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(t,n,r,0):this.forEachInvertedInner(t,n,r,0)};mr.prototype.map=function(t,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(o,a){return i.push(t(o,a))},n,r),i};mr.from=function(t){return t instanceof mr?t:t&&t.length?new eF(t):mr.empty};var eF=function(e){function t(r){e.call(this),this.values=r}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(i,o){return i==0&&o==this.length?this:new t(this.values.slice(i,o))},t.prototype.getInner=function(i){return this.values[i]},t.prototype.forEachInner=function(i,o,a,l){for(var u=o;u<a;u++)if(i(this.values[u],l+u)===!1)return!1},t.prototype.forEachInvertedInner=function(i,o,a,l){for(var u=o-1;u>=a;u--)if(i(this.values[u],l+u)===!1)return!1},t.prototype.leafAppend=function(i){if(this.length+i.length<=my)return new t(this.values.concat(i.flatten()))},t.prototype.leafPrepend=function(i){if(this.length+i.length<=my)return new t(i.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(mr);mr.empty=new eF([]);var Nve=function(e){function t(n,r){e.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},t.prototype.forEachInner=function(r,i,o,a){var l=this.left.length;if(i<l&&this.left.forEachInner(r,i,Math.min(o,l),a)===!1||o>l&&this.right.forEachInner(r,Math.max(i-l,0),Math.min(this.length,o)-l,a+l)===!1)return!1},t.prototype.forEachInvertedInner=function(r,i,o,a){var l=this.left.length;if(i>l&&this.right.forEachInvertedInner(r,i-l,Math.max(o,l)-l,a+l)===!1||o<l&&this.left.forEachInvertedInner(r,Math.min(i,l),o,a)===!1)return!1},t.prototype.sliceInner=function(r,i){if(r==0&&i==this.length)return this;var o=this.left.length;return i<=o?this.left.slice(r,i):r>=o?this.right.slice(r-o,i-o):this.left.slice(r,o).append(this.right.slice(0,i-o))},t.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new t(this.left,i)},t.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new t(i,this.right)},t.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new t(this.left,new t(this.right,r)):new t(this,r)},t}(mr);const _ve=500;class fo{constructor(t,n){this.items=t,this.eventCount=n}popEvent(t,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,o;n&&(i=this.remapping(r,this.items.length),o=i.maps.length);let a=t.tr,l,u,d=[],h=[];return this.items.forEach((p,g)=>{if(!p.step){i||(i=this.remapping(r,g+1),o=i.maps.length),o--,h.push(p);return}if(i){h.push(new hs(p.map));let y=p.step.map(i.slice(o)),b;y&&a.maybeStep(y).doc&&(b=a.mapping.maps[a.mapping.maps.length-1],d.push(new hs(b,void 0,void 0,d.length+h.length))),o--,b&&i.appendMap(b,o)}else a.maybeStep(p.step);if(p.selection)return l=i?p.selection.map(i.slice(o)):p.selection,u=new fo(this.items.slice(0,r).append(h.reverse().concat(d)),this.eventCount-1),!1},this.items.length,0),{remaining:u,transform:a,selection:l}}addTransform(t,n,r,i){let o=[],a=this.eventCount,l=this.items,u=!i&&l.length?l.get(l.length-1):null;for(let h=0;h<t.steps.length;h++){let p=t.steps[h].invert(t.docs[h]),g=new hs(t.mapping.maps[h],p,n),y;(y=u&&u.merge(g))&&(g=y,h?o.pop():l=l.slice(0,l.length-1)),o.push(g),n&&(a++,n=void 0),i||(u=g)}let d=a-r.depth;return d>Pve&&(l=jve(l,d),a-=d),new fo(l.append(o),a)}remapping(t,n){let r=new Zf;return this.items.forEach((i,o)=>{let a=i.mirrorOffset!=null&&o-i.mirrorOffset>=t?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,a)},t,n),r}addMaps(t){return this.eventCount==0?this:new fo(this.items.append(t.map(n=>new hs(n))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),o=t.mapping,a=t.steps.length,l=this.eventCount;this.items.forEach(g=>{g.selection&&l--},i);let u=n;this.items.forEach(g=>{let y=o.getMirror(--u);if(y==null)return;a=Math.min(a,y);let b=o.maps[y];if(g.step){let C=t.steps[y].invert(t.docs[y]),E=g.selection&&g.selection.map(o.slice(u+1,y));E&&l++,r.push(new hs(b,C,E))}else r.push(new hs(b))},i);let d=[];for(let g=n;g<a;g++)d.push(new hs(o.maps[g]));let h=this.items.slice(0,i).append(d).append(r),p=new fo(h,l);return p.emptyItemCount()>_ve&&(p=p.compress(this.items.length-r.length)),p}emptyItemCount(){let t=0;return this.items.forEach(n=>{n.step||t++}),t}compress(t=this.items.length){let n=this.remapping(0,t),r=n.maps.length,i=[],o=0;return this.items.forEach((a,l)=>{if(l>=t)i.push(a),a.selection&&o++;else if(a.step){let u=a.step.map(n.slice(r)),d=u&&u.getMap();if(r--,d&&n.appendMap(d,r),u){let h=a.selection&&a.selection.map(n.slice(r));h&&o++;let p=new hs(d.invert(),u,h),g,y=i.length-1;(g=i.length&&i[y].merge(p))?i[y]=g:i.push(p)}}else a.map&&r--},this.items.length,0),new fo(mr.from(i.reverse()),o)}}fo.empty=new fo(mr.empty,0);function jve(e,t){let n;return e.forEach((r,i)=>{if(r.selection&&t--==0)return n=i,!1}),e.slice(n)}let hs=class tF{constructor(t,n,r,i){this.map=t,this.step=n,this.selection=r,this.mirrorOffset=i}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new tF(n.getMap().invert(),n,this.selection)}}};class bs{constructor(t,n,r,i,o){this.done=t,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}}const Pve=20;function Lve(e,t,n,r){let i=n.getMeta(_l),o;if(i)return i.historyState;n.getMeta($ve)&&(e=new bs(e.done,e.undone,null,0,-1));let a=n.getMeta("appendedTransaction");if(n.steps.length==0)return e;if(a&&a.getMeta(_l))return a.getMeta(_l).redo?new bs(e.done.addTransform(n,void 0,r,Gm(t)),e.undone,b2(n.mapping.maps),e.prevTime,e.prevComposition):new bs(e.done,e.undone.addTransform(n,void 0,r,Gm(t)),null,e.prevTime,e.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(a&&a.getMeta("addToHistory")===!1)){let l=n.getMeta("composition"),u=e.prevTime==0||!a&&e.prevComposition!=l&&(e.prevTime<(n.time||0)-r.newGroupDelay||!zve(n,e.prevRanges)),d=a?sw(e.prevRanges,n.mapping):b2(n.mapping.maps);return new bs(e.done.addTransform(n,u?t.selection.getBookmark():void 0,r,Gm(t)),fo.empty,d,n.time,l??e.prevComposition)}else return(o=n.getMeta("rebased"))?new bs(e.done.rebased(n,o),e.undone.rebased(n,o),sw(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new bs(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),sw(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function zve(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((r,i)=>{for(let o=0;o<t.length;o+=2)r<=t[o+1]&&i>=t[o]&&(n=!0)}),n}function b2(e){let t=[];for(let n=e.length-1;n>=0&&t.length==0;n--)e[n].forEach((r,i,o,a)=>t.push(o,a));return t}function sw(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let i=t.map(e[r],1),o=t.map(e[r+1],-1);i<=o&&n.push(i,o)}return n}function Ive(e,t,n){let r=Gm(t),i=_l.get(t).spec.config,o=(n?e.undone:e.done).popEvent(t,r);if(!o)return null;let a=o.selection.resolve(o.transform.doc),l=(n?e.done:e.undone).addTransform(o.transform,t.selection.getBookmark(),i,r),u=new bs(n?l:o.remaining,n?o.remaining:l,null,0,-1);return o.transform.setSelection(a).setMeta(_l,{redo:n,historyState:u})}let lw=!1,x2=null;function Gm(e){let t=e.plugins;if(x2!=t){lw=!1,x2=t;for(let n=0;n<t.length;n++)if(t[n].spec.historyPreserveItems){lw=!0;break}}return lw}const _l=new yr("history"),$ve=new yr("closeHistory");function Fve(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new In({key:_l,state:{init(){return new bs(fo.empty,fo.empty,null,0,-1)},apply(t,n,r){return Lve(n,r,t,e)}},config:e,props:{handleDOMEvents:{beforeinput(t,n){let r=n.inputType,i=r=="historyUndo"?rF:r=="historyRedo"?iF:null;return i?(n.preventDefault(),i(t.state,t.dispatch)):!1}}}})}function nF(e,t){return(n,r)=>{let i=_l.getState(n);if(!i||(e?i.undone:i.done).eventCount==0)return!1;if(r){let o=Ive(i,n,e);o&&r(t?o.scrollIntoView():o)}return!0}}const rF=nF(!1,!0),iF=nF(!0,!0);qn.create({name:"characterCount",addOptions(){return{limit:null,mode:"textSize",textCounter:e=>e.length,wordCounter:e=>e.split(" ").filter(t=>t!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=e=>{const t=e?.node||this.editor.state.doc;if((e?.mode||this.options.mode)==="textSize"){const r=t.textBetween(0,t.content.size,void 0," ");return this.options.textCounter(r)}return t.nodeSize},this.storage.words=e=>{const t=e?.node||this.editor.state.doc,n=t.textBetween(0,t.content.size," "," ");return this.options.wordCounter(n)}},addProseMirrorPlugins(){let e=!1;return[new In({key:new yr("characterCount"),appendTransaction:(t,n,r)=>{if(e)return;const i=this.options.limit;if(i==null||i===0){e=!0;return}const o=this.storage.characters({node:r.doc});if(o>i){const a=o-i,l=0,u=a;console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);const d=r.tr.deleteRange(l,u);return e=!0,d}e=!0},filterTransaction:(t,n)=>{const r=this.options.limit;if(!t.docChanged||r===0||r===null||r===void 0)return!0;const i=this.storage.characters({node:n.doc}),o=this.storage.characters({node:t.doc});if(o<=r||i>r&&o>r&&o<=i)return!0;if(i>r&&o>r&&o>i||!t.getMeta("paste"))return!1;const l=t.selection.$head.pos,u=o-r,d=l-u,h=l;return t.deleteRange(d,h),!(this.storage.characters({node:t.doc})>r)}})]}});var Bve=qn.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[Cve(this.options)]}});qn.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new In({key:new yr("focus"),props:{decorations:({doc:e,selection:t})=>{const{isEditable:n,isFocused:r}=this.editor,{anchor:i}=t,o=[];if(!n||!r)return Mn.create(e,[]);let a=0;this.options.mode==="deepest"&&e.descendants((u,d)=>{if(u.isText)return;if(!(i>=d&&i<=d+u.nodeSize-1))return!1;a+=1});let l=0;return e.descendants((u,d)=>{if(u.isText||!(i>=d&&i<=d+u.nodeSize-1))return!1;if(l+=1,this.options.mode==="deepest"&&a-l>0||this.options.mode==="shallowest"&&l>1)return this.options.mode==="deepest";o.push(zr.node(d,d+u.nodeSize,{class:this.options.className}))}),Mn.create(e,o)}}})]}});var Hve=qn.create({name:"gapCursor",addProseMirrorPlugins(){return[Ove()]},extendNodeSchema(e){var t;const n={name:e.name,options:e.options,storage:e.storage};return{allowGapCursor:(t=Yt(Qe(e,"allowGapCursor",n)))!=null?t:null}}});qn.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new In({key:new yr("placeholder"),props:{decorations:({doc:e,selection:t})=>{const n=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=t,i=[];if(!n)return null;const o=this.editor.isEmpty;return e.descendants((a,l)=>{const u=r>=l&&r<=l+a.nodeSize,d=!a.isLeaf&&Ev(a);if((u||!this.options.showOnlyCurrent)&&d){const h=[this.options.emptyNodeClass];o&&h.push(this.options.emptyEditorClass);const p=zr.node(l,l+a.nodeSize,{class:h.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:a,pos:l,hasAnchor:u}):this.options.placeholder});i.push(p)}return this.options.includeChildren}),Mn.create(e,i)}}})]}});qn.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){const{editor:e,options:t}=this;return[new In({key:new yr("selection"),props:{decorations(n){return n.selection.empty||e.isFocused||!e.isEditable||g3(n.selection)||e.view.dragging?null:Mn.create(n.doc,[zr.inline(n.selection.from,n.selection.to,{class:t.className})])}}})]}});function w2({types:e,node:t}){return t&&Array.isArray(e)&&e.includes(t.type)||t?.type===e}var Uve=qn.create({name:"trailingNode",addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){var e;const t=new yr(this.name),n=((e=this.editor.schema.topNodeType.contentMatch.defaultType)==null?void 0:e.name)||this.options.node||"paragraph",r=Object.entries(this.editor.schema.nodes).map(([,i])=>i).filter(i=>(this.options.notAfter||[]).concat(n).includes(i.name));return[new In({key:t,appendTransaction:(i,o,a)=>{const{doc:l,tr:u,schema:d}=a,h=t.getState(a),p=l.content.size,g=d.nodes[n];if(h)return u.insert(p,g.create())},state:{init:(i,o)=>{const a=o.tr.doc.lastChild;return!w2({node:a,types:r})},apply:(i,o)=>{if(!i.docChanged)return o;const a=i.doc.lastChild;return!w2({node:a,types:r})}}})]}}),Vve=qn.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:e,dispatch:t})=>rF(e,t),redo:()=>({state:e,dispatch:t})=>iF(e,t)}},addProseMirrorPlugins(){return[Fve(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),qve=qn.create({name:"starterKit",addExtensions(){var e,t,n,r;const i=[];return this.options.bold!==!1&&i.push(Vye.configure(this.options.bold)),this.options.blockquote!==!1&&i.push($ye.configure(this.options.blockquote)),this.options.bulletList!==!1&&i.push(V3.configure(this.options.bulletList)),this.options.code!==!1&&i.push(Kye.configure(this.options.code)),this.options.codeBlock!==!1&&i.push(Gye.configure(this.options.codeBlock)),this.options.document!==!1&&i.push(Xye.configure(this.options.document)),this.options.dropcursor!==!1&&i.push(Bve.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&i.push(Hve.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&i.push(Qye.configure(this.options.hardBreak)),this.options.heading!==!1&&i.push(Jye.configure(this.options.heading)),this.options.undoRedo!==!1&&i.push(Vve.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&i.push(eve.configure(this.options.horizontalRule)),this.options.italic!==!1&&i.push(ove.configure(this.options.italic)),this.options.listItem!==!1&&i.push(q3.configure(this.options.listItem)),this.options.listKeymap!==!1&&i.push(X3.configure((e=this.options)==null?void 0:e.listKeymap)),this.options.link!==!1&&i.push(B3.configure((t=this.options)==null?void 0:t.link)),this.options.orderedList!==!1&&i.push(J3.configure(this.options.orderedList)),this.options.paragraph!==!1&&i.push(vve.configure(this.options.paragraph)),this.options.strike!==!1&&i.push(wve.configure(this.options.strike)),this.options.text!==!1&&i.push(Sve.configure(this.options.text)),this.options.underline!==!1&&i.push(H3.configure((n=this.options)==null?void 0:n.underline)),this.options.trailingNode!==!1&&i.push(Uve.configure((r=this.options)==null?void 0:r.trailingNode)),i}}),Wve="Separator",S2="horizontal",Kve=["horizontal","vertical"],oF=w.forwardRef((e,t)=>{const{decorative:n,orientation:r=S2,...i}=e,o=Yve(r)?r:S2,l=n?{role:"none"}:{"aria-orientation":o==="vertical"?o:void 0,role:"separator"};return x.jsx(Ge.div,{"data-orientation":o,...l,...i,ref:t})});oF.displayName=Wve;function Yve(e){return Kve.includes(e)}var Zve=oF;function C2({className:e,orientation:t="horizontal",decorative:n=!0,...r}){return x.jsx(Zve,{"data-slot":"separator",decorative:n,orientation:t,className:we("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...r})}var aF="Toggle",sF=w.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r,onPressedChange:i,...o}=e,[a,l]=qo({prop:n,onChange:i,defaultProp:r??!1,caller:aF});return x.jsx(Ge.button,{type:"button","aria-pressed":a,"data-state":a?"on":"off","data-disabled":e.disabled?"":void 0,...o,ref:t,onClick:_e(e.onClick,()=>{e.disabled||l(!a)})})});sF.displayName=aF;var Gve=sF;const Xve=ec("inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-stone-700 data-[state=on]:text-white [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground"},size:{default:"h-8 px-1.5 min-w-9",sm:"h-7 px-1.5 min-w-8",lg:"h-9 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}});function Am({className:e,variant:t,size:n,...r}){return x.jsx(Gve,{"data-slot":"toggle",className:we(Xve({variant:t,size:n,className:e})),...r})}function E2(e,[t,n]){return Math.min(n,Math.max(t,e))}function Qve(e){const t=Jve(e),n=w.forwardRef((r,i)=>{const{children:o,...a}=r,l=w.Children.toArray(o),u=l.find(tbe);if(u){const d=u.props.children,h=l.map(p=>p===u?w.Children.count(d)>1?w.Children.only(null):w.isValidElement(d)?d.props.children:null:p);return x.jsx(t,{...a,ref:i,children:w.isValidElement(d)?w.cloneElement(d,void 0,h):null})}return x.jsx(t,{...a,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}function Jve(e){const t=w.forwardRef((n,r)=>{const{children:i,...o}=n;if(w.isValidElement(i)){const a=rbe(i),l=nbe(o,i.props);return i.type!==w.Fragment&&(l.ref=r?Ir(r,a):a),w.cloneElement(i,l)}return w.Children.count(i)>1?w.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ebe=Symbol("radix.slottable");function tbe(e){return w.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ebe}function nbe(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...l)=>{const u=o(...l);return i(...l),u}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function rbe(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var ibe=[" ","Enter","ArrowUp","ArrowDown"],obe=[" ","Enter"],Zl="Select",[Ov,Tv,abe]=vC(Zl),[ed,Axe]=Ti(Zl,[abe,qs]),Av=qs(),[sbe,Gs]=ed(Zl),[lbe,cbe]=ed(Zl),lF=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:o,value:a,defaultValue:l,onValueChange:u,dir:d,name:h,autoComplete:p,disabled:g,required:y,form:b}=e,C=Av(t),[E,k]=w.useState(null),[O,A]=w.useState(null),[N,D]=w.useState(!1),L=lv(d),[T,I]=qo({prop:r,defaultProp:i??!1,onChange:o,caller:Zl}),[G,te]=qo({prop:a,defaultProp:l,onChange:u,caller:Zl}),fe=w.useRef(null),Q=E?b||!!E.closest("form"):!0,[J,H]=w.useState(new Set),q=Array.from(J).map(R=>R.props.value).join(";");return x.jsx(Uy,{...C,children:x.jsxs(sbe,{required:y,scope:t,trigger:E,onTriggerChange:k,valueNode:O,onValueNodeChange:A,valueNodeHasChildren:N,onValueNodeHasChildrenChange:D,contentId:hr(),value:G,onValueChange:te,open:T,onOpenChange:I,dir:L,triggerPointerDownPosRef:fe,disabled:g,children:[x.jsx(Ov.Provider,{scope:t,children:x.jsx(lbe,{scope:e.__scopeSelect,onNativeOptionAdd:w.useCallback(R=>{H(F=>new Set(F).add(R))},[]),onNativeOptionRemove:w.useCallback(R=>{H(F=>{const z=new Set(F);return z.delete(R),z})},[]),children:n})}),Q?x.jsxs(DF,{"aria-hidden":!0,required:y,tabIndex:-1,name:h,autoComplete:p,value:G,onChange:R=>te(R.target.value),disabled:g,form:b,children:[G===void 0?x.jsx("option",{value:""}):null,Array.from(J)]},q):null]})})};lF.displayName=Zl;var cF="SelectTrigger",uF=w.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,o=Av(n),a=Gs(cF,n),l=a.disabled||r,u=Dt(t,a.onTriggerChange),d=Tv(n),h=w.useRef("touch"),[p,g,y]=NF(C=>{const E=d().filter(A=>!A.disabled),k=E.find(A=>A.value===a.value),O=_F(E,C,k);O!==void 0&&a.onValueChange(O.value)}),b=C=>{l||(a.onOpenChange(!0),y()),C&&(a.triggerPointerDownPosRef.current={x:Math.round(C.pageX),y:Math.round(C.pageY)})};return x.jsx(xh,{asChild:!0,...o,children:x.jsx(Ge.button,{type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":RF(a.value)?"":void 0,...i,ref:u,onClick:_e(i.onClick,C=>{C.currentTarget.focus(),h.current!=="mouse"&&b(C)}),onPointerDown:_e(i.onPointerDown,C=>{h.current=C.pointerType;const E=C.target;E.hasPointerCapture(C.pointerId)&&E.releasePointerCapture(C.pointerId),C.button===0&&C.ctrlKey===!1&&C.pointerType==="mouse"&&(b(C),C.preventDefault())}),onKeyDown:_e(i.onKeyDown,C=>{const E=p.current!=="";!(C.ctrlKey||C.altKey||C.metaKey)&&C.key.length===1&&g(C.key),!(E&&C.key===" ")&&ibe.includes(C.key)&&(b(),C.preventDefault())})})})});uF.displayName=cF;var dF="SelectValue",fF=w.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:o,placeholder:a="",...l}=e,u=Gs(dF,n),{onValueNodeHasChildrenChange:d}=u,h=o!==void 0,p=Dt(t,u.onValueNodeChange);return sr(()=>{d(h)},[d,h]),x.jsx(Ge.span,{...l,ref:p,style:{pointerEvents:"none"},children:RF(u.value)?x.jsx(x.Fragment,{children:a}):o})});fF.displayName=dF;var ube="SelectIcon",hF=w.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return x.jsx(Ge.span,{"aria-hidden":!0,...i,ref:t,children:r||"▼"})});hF.displayName=ube;var dbe="SelectPortal",pF=e=>x.jsx(Bu,{asChild:!0,...e});pF.displayName=dbe;var Gl="SelectContent",mF=w.forwardRef((e,t)=>{const n=Gs(Gl,e.__scopeSelect),[r,i]=w.useState();if(sr(()=>{i(new DocumentFragment)},[]),!n.open){const o=r;return o?sh.createPortal(x.jsx(gF,{scope:e.__scopeSelect,children:x.jsx(Ov.Slot,{scope:e.__scopeSelect,children:x.jsx("div",{children:e.children})})}),o):null}return x.jsx(yF,{...e,ref:t})});mF.displayName=Gl;var so=10,[gF,Xs]=ed(Gl),fbe="SelectContentImpl",hbe=Qve("SelectContent.RemoveScroll"),yF=w.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:a,side:l,sideOffset:u,align:d,alignOffset:h,arrowPadding:p,collisionBoundary:g,collisionPadding:y,sticky:b,hideWhenDetached:C,avoidCollisions:E,...k}=e,O=Gs(Gl,n),[A,N]=w.useState(null),[D,L]=w.useState(null),T=Dt(t,ne=>N(ne)),[I,G]=w.useState(null),[te,fe]=w.useState(null),Q=Tv(n),[J,H]=w.useState(!1),q=w.useRef(!1);w.useEffect(()=>{if(A)return ky(A)},[A]),Cy();const R=w.useCallback(ne=>{const[Ce,...Te]=Q().map(De=>De.ref.current),[ye]=Te.slice(-1),Se=document.activeElement;for(const De of ne)if(De===Se||(De?.scrollIntoView({block:"nearest"}),De===Ce&&D&&(D.scrollTop=0),De===ye&&D&&(D.scrollTop=D.scrollHeight),De?.focus(),document.activeElement!==Se))return},[Q,D]),F=w.useCallback(()=>R([I,A]),[R,I,A]);w.useEffect(()=>{J&&F()},[J,F]);const{onOpenChange:z,triggerPointerDownPosRef:B}=O;w.useEffect(()=>{if(A){let ne={x:0,y:0};const Ce=ye=>{ne={x:Math.abs(Math.round(ye.pageX)-(B.current?.x??0)),y:Math.abs(Math.round(ye.pageY)-(B.current?.y??0))}},Te=ye=>{ne.x<=10&&ne.y<=10?ye.preventDefault():A.contains(ye.target)||z(!1),document.removeEventListener("pointermove",Ce),B.current=null};return B.current!==null&&(document.addEventListener("pointermove",Ce),document.addEventListener("pointerup",Te,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Ce),document.removeEventListener("pointerup",Te,{capture:!0})}}},[A,z,B]),w.useEffect(()=>{const ne=()=>z(!1);return window.addEventListener("blur",ne),window.addEventListener("resize",ne),()=>{window.removeEventListener("blur",ne),window.removeEventListener("resize",ne)}},[z]);const[U,P]=NF(ne=>{const Ce=Q().filter(Se=>!Se.disabled),Te=Ce.find(Se=>Se.ref.current===document.activeElement),ye=_F(Ce,ne,Te);ye&&setTimeout(()=>ye.ref.current.focus())}),j=w.useCallback((ne,Ce,Te)=>{const ye=!q.current&&!Te;(O.value!==void 0&&O.value===Ce||ye)&&(G(ne),ye&&(q.current=!0))},[O.value]),$=w.useCallback(()=>A?.focus(),[A]),K=w.useCallback((ne,Ce,Te)=>{const ye=!q.current&&!Te;(O.value!==void 0&&O.value===Ce||ye)&&fe(ne)},[O.value]),ee=r==="popper"?V1:vF,ge=ee===V1?{side:l,sideOffset:u,align:d,alignOffset:h,arrowPadding:p,collisionBoundary:g,collisionPadding:y,sticky:b,hideWhenDetached:C,avoidCollisions:E}:{};return x.jsx(gF,{scope:n,content:A,viewport:D,onViewportChange:L,itemRefCallback:j,selectedItem:I,onItemLeave:$,itemTextRefCallback:K,focusSelectedItem:F,selectedItemText:te,position:r,isPositioned:J,searchRef:U,children:x.jsx(ch,{as:hbe,allowPinchZoom:!0,children:x.jsx(lh,{asChild:!0,trapped:O.open,onMountAutoFocus:ne=>{ne.preventDefault()},onUnmountAutoFocus:_e(i,ne=>{O.trigger?.focus({preventScroll:!0}),ne.preventDefault()}),children:x.jsx(Fu,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:ne=>ne.preventDefault(),onDismiss:()=>O.onOpenChange(!1),children:x.jsx(ee,{role:"listbox",id:O.contentId,"data-state":O.open?"open":"closed",dir:O.dir,onContextMenu:ne=>ne.preventDefault(),...k,...ge,onPlaced:()=>H(!0),ref:T,style:{display:"flex",flexDirection:"column",outline:"none",...k.style},onKeyDown:_e(k.onKeyDown,ne=>{const Ce=ne.ctrlKey||ne.altKey||ne.metaKey;if(ne.key==="Tab"&&ne.preventDefault(),!Ce&&ne.key.length===1&&P(ne.key),["ArrowUp","ArrowDown","Home","End"].includes(ne.key)){let ye=Q().filter(Se=>!Se.disabled).map(Se=>Se.ref.current);if(["ArrowUp","End"].includes(ne.key)&&(ye=ye.slice().reverse()),["ArrowUp","ArrowDown"].includes(ne.key)){const Se=ne.target,De=ye.indexOf(Se);ye=ye.slice(De+1)}setTimeout(()=>R(ye)),ne.preventDefault()}})})})})})})});yF.displayName=fbe;var pbe="SelectItemAlignedPosition",vF=w.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,o=Gs(Gl,n),a=Xs(Gl,n),[l,u]=w.useState(null),[d,h]=w.useState(null),p=Dt(t,T=>h(T)),g=Tv(n),y=w.useRef(!1),b=w.useRef(!0),{viewport:C,selectedItem:E,selectedItemText:k,focusSelectedItem:O}=a,A=w.useCallback(()=>{if(o.trigger&&o.valueNode&&l&&d&&C&&E&&k){const T=o.trigger.getBoundingClientRect(),I=d.getBoundingClientRect(),G=o.valueNode.getBoundingClientRect(),te=k.getBoundingClientRect();if(o.dir!=="rtl"){const Se=te.left-I.left,De=G.left-Se,it=T.left-De,yt=T.width+it,ot=Math.max(yt,I.width),Nt=window.innerWidth-so,xt=E2(De,[so,Math.max(so,Nt-ot)]);l.style.minWidth=yt+"px",l.style.left=xt+"px"}else{const Se=I.right-te.right,De=window.innerWidth-G.right-Se,it=window.innerWidth-T.right-De,yt=T.width+it,ot=Math.max(yt,I.width),Nt=window.innerWidth-so,xt=E2(De,[so,Math.max(so,Nt-ot)]);l.style.minWidth=yt+"px",l.style.right=xt+"px"}const fe=g(),Q=window.innerHeight-so*2,J=C.scrollHeight,H=window.getComputedStyle(d),q=parseInt(H.borderTopWidth,10),R=parseInt(H.paddingTop,10),F=parseInt(H.borderBottomWidth,10),z=parseInt(H.paddingBottom,10),B=q+R+J+z+F,U=Math.min(E.offsetHeight*5,B),P=window.getComputedStyle(C),j=parseInt(P.paddingTop,10),$=parseInt(P.paddingBottom,10),K=T.top+T.height/2-so,ee=Q-K,ge=E.offsetHeight/2,ne=E.offsetTop+ge,Ce=q+R+ne,Te=B-Ce;if(Ce<=K){const Se=fe.length>0&&E===fe[fe.length-1].ref.current;l.style.bottom="0px";const De=d.clientHeight-C.offsetTop-C.offsetHeight,it=Math.max(ee,ge+(Se?$:0)+De+F),yt=Ce+it;l.style.height=yt+"px"}else{const Se=fe.length>0&&E===fe[0].ref.current;l.style.top="0px";const it=Math.max(K,q+C.offsetTop+(Se?j:0)+ge)+Te;l.style.height=it+"px",C.scrollTop=Ce-K+C.offsetTop}l.style.margin=`${so}px 0`,l.style.minHeight=U+"px",l.style.maxHeight=Q+"px",r?.(),requestAnimationFrame(()=>y.current=!0)}},[g,o.trigger,o.valueNode,l,d,C,E,k,o.dir,r]);sr(()=>A(),[A]);const[N,D]=w.useState();sr(()=>{d&&D(window.getComputedStyle(d).zIndex)},[d]);const L=w.useCallback(T=>{T&&b.current===!0&&(A(),O?.(),b.current=!1)},[A,O]);return x.jsx(gbe,{scope:n,contentWrapper:l,shouldExpandOnScrollRef:y,onScrollButtonChange:L,children:x.jsx("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:N},children:x.jsx(Ge.div,{...i,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});vF.displayName=pbe;var mbe="SelectPopperPosition",V1=w.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=so,...o}=e,a=Av(n);return x.jsx(Vy,{...a,...o,ref:t,align:r,collisionPadding:i,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});V1.displayName=mbe;var[gbe,mE]=ed(Gl,{}),q1="SelectViewport",bF=w.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...i}=e,o=Xs(q1,n),a=mE(q1,n),l=Dt(t,o.onViewportChange),u=w.useRef(0);return x.jsxs(x.Fragment,{children:[x.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),x.jsx(Ov.Slot,{scope:n,children:x.jsx(Ge.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:_e(i.onScroll,d=>{const h=d.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:g}=a;if(g?.current&&p){const y=Math.abs(u.current-h.scrollTop);if(y>0){const b=window.innerHeight-so*2,C=parseFloat(p.style.minHeight),E=parseFloat(p.style.height),k=Math.max(C,E);if(k<b){const O=k+y,A=Math.min(b,O),N=O-A;p.style.height=A+"px",p.style.bottom==="0px"&&(h.scrollTop=N>0?N:0,p.style.justifyContent="flex-end")}}}u.current=h.scrollTop})})})]})});bF.displayName=q1;var xF="SelectGroup",[ybe,vbe]=ed(xF),bbe=w.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=hr();return x.jsx(ybe,{scope:n,id:i,children:x.jsx(Ge.div,{role:"group","aria-labelledby":i,...r,ref:t})})});bbe.displayName=xF;var wF="SelectLabel",xbe=w.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=vbe(wF,n);return x.jsx(Ge.div,{id:i.id,...r,ref:t})});xbe.displayName=wF;var gy="SelectItem",[wbe,SF]=ed(gy),CF=w.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:o,...a}=e,l=Gs(gy,n),u=Xs(gy,n),d=l.value===r,[h,p]=w.useState(o??""),[g,y]=w.useState(!1),b=Dt(t,O=>u.itemRefCallback?.(O,r,i)),C=hr(),E=w.useRef("touch"),k=()=>{i||(l.onValueChange(r),l.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return x.jsx(wbe,{scope:n,value:r,disabled:i,textId:C,isSelected:d,onItemTextChange:w.useCallback(O=>{p(A=>A||(O?.textContent??"").trim())},[]),children:x.jsx(Ov.ItemSlot,{scope:n,value:r,disabled:i,textValue:h,children:x.jsx(Ge.div,{role:"option","aria-labelledby":C,"data-highlighted":g?"":void 0,"aria-selected":d&&g,"data-state":d?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...a,ref:b,onFocus:_e(a.onFocus,()=>y(!0)),onBlur:_e(a.onBlur,()=>y(!1)),onClick:_e(a.onClick,()=>{E.current!=="mouse"&&k()}),onPointerUp:_e(a.onPointerUp,()=>{E.current==="mouse"&&k()}),onPointerDown:_e(a.onPointerDown,O=>{E.current=O.pointerType}),onPointerMove:_e(a.onPointerMove,O=>{E.current=O.pointerType,i?u.onItemLeave?.():E.current==="mouse"&&O.currentTarget.focus({preventScroll:!0})}),onPointerLeave:_e(a.onPointerLeave,O=>{O.currentTarget===document.activeElement&&u.onItemLeave?.()}),onKeyDown:_e(a.onKeyDown,O=>{u.searchRef?.current!==""&&O.key===" "||(obe.includes(O.key)&&k(),O.key===" "&&O.preventDefault())})})})})});CF.displayName=gy;var mf="SelectItemText",EF=w.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...o}=e,a=Gs(mf,n),l=Xs(mf,n),u=SF(mf,n),d=cbe(mf,n),[h,p]=w.useState(null),g=Dt(t,k=>p(k),u.onItemTextChange,k=>l.itemTextRefCallback?.(k,u.value,u.disabled)),y=h?.textContent,b=w.useMemo(()=>x.jsx("option",{value:u.value,disabled:u.disabled,children:y},u.value),[u.disabled,u.value,y]),{onNativeOptionAdd:C,onNativeOptionRemove:E}=d;return sr(()=>(C(b),()=>E(b)),[C,E,b]),x.jsxs(x.Fragment,{children:[x.jsx(Ge.span,{id:u.textId,...o,ref:g}),u.isSelected&&a.valueNode&&!a.valueNodeHasChildren?sh.createPortal(o.children,a.valueNode):null]})});EF.displayName=mf;var kF="SelectItemIndicator",MF=w.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return SF(kF,n).isSelected?x.jsx(Ge.span,{"aria-hidden":!0,...r,ref:t}):null});MF.displayName=kF;var W1="SelectScrollUpButton",OF=w.forwardRef((e,t)=>{const n=Xs(W1,e.__scopeSelect),r=mE(W1,e.__scopeSelect),[i,o]=w.useState(!1),a=Dt(t,r.onScrollButtonChange);return sr(()=>{if(n.viewport&&n.isPositioned){let l=function(){const d=u.scrollTop>0;o(d)};const u=n.viewport;return l(),u.addEventListener("scroll",l),()=>u.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),i?x.jsx(AF,{...e,ref:a,onAutoScroll:()=>{const{viewport:l,selectedItem:u}=n;l&&u&&(l.scrollTop=l.scrollTop-u.offsetHeight)}}):null});OF.displayName=W1;var K1="SelectScrollDownButton",TF=w.forwardRef((e,t)=>{const n=Xs(K1,e.__scopeSelect),r=mE(K1,e.__scopeSelect),[i,o]=w.useState(!1),a=Dt(t,r.onScrollButtonChange);return sr(()=>{if(n.viewport&&n.isPositioned){let l=function(){const d=u.scrollHeight-u.clientHeight,h=Math.ceil(u.scrollTop)<d;o(h)};const u=n.viewport;return l(),u.addEventListener("scroll",l),()=>u.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),i?x.jsx(AF,{...e,ref:a,onAutoScroll:()=>{const{viewport:l,selectedItem:u}=n;l&&u&&(l.scrollTop=l.scrollTop+u.offsetHeight)}}):null});TF.displayName=K1;var AF=w.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,o=Xs("SelectScrollButton",n),a=w.useRef(null),l=Tv(n),u=w.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return w.useEffect(()=>()=>u(),[u]),sr(()=>{l().find(h=>h.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[l]),x.jsx(Ge.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:_e(i.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(r,50))}),onPointerMove:_e(i.onPointerMove,()=>{o.onItemLeave?.(),a.current===null&&(a.current=window.setInterval(r,50))}),onPointerLeave:_e(i.onPointerLeave,()=>{u()})})}),Sbe="SelectSeparator",Cbe=w.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return x.jsx(Ge.div,{"aria-hidden":!0,...r,ref:t})});Cbe.displayName=Sbe;var Y1="SelectArrow",Ebe=w.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Av(n),o=Gs(Y1,n),a=Xs(Y1,n);return o.open&&a.position==="popper"?x.jsx(qy,{...i,...r,ref:t}):null});Ebe.displayName=Y1;var kbe="SelectBubbleInput",DF=w.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const i=w.useRef(null),o=Dt(r,i),a=vP(t);return w.useEffect(()=>{const l=i.current;if(!l)return;const u=window.HTMLSelectElement.prototype,h=Object.getOwnPropertyDescriptor(u,"value").set;if(a!==t&&h){const p=new Event("change",{bubbles:!0});h.call(l,t),l.dispatchEvent(p)}},[a,t]),x.jsx(Ge.select,{...n,style:{...dL,...n.style},ref:o,defaultValue:t})});DF.displayName=kbe;function RF(e){return e===""||e===void 0}function NF(e){const t=Qi(e),n=w.useRef(""),r=w.useRef(0),i=w.useCallback(a=>{const l=n.current+a;t(l),function u(d){n.current=d,window.clearTimeout(r.current),d!==""&&(r.current=window.setTimeout(()=>u(""),1e3))}(l)},[t]),o=w.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return w.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,o]}function _F(e,t,n){const i=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let a=Mbe(e,Math.max(o,0));i.length===1&&(a=a.filter(d=>d!==n));const u=a.find(d=>d.textValue.toLowerCase().startsWith(i.toLowerCase()));return u!==n?u:void 0}function Mbe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Obe=lF,Tbe=uF,Abe=fF,Dbe=hF,Rbe=pF,Nbe=mF,_be=bF,jbe=CF,Pbe=EF,Lbe=MF,zbe=OF,Ibe=TF;function jF({...e}){return x.jsx(Obe,{"data-slot":"select",...e})}function $be({...e}){return x.jsx(Abe,{"data-slot":"select-value",...e})}function PF({className:e,size:t="default",children:n,...r}){return x.jsxs(Tbe,{"data-slot":"select-trigger","data-size":t,className:we("border-input hover:border-slate-300 data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-8 data-[size=sm]:h-7 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r,children:[n,x.jsx(Dbe,{asChild:!0,children:x.jsx(yh,{className:"size-4 opacity-50"})})]})}function LF({className:e,children:t,position:n="popper",align:r="center",...i}){return x.jsx(Rbe,{children:x.jsxs(Nbe,{"data-slot":"select-content",className:we("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md shadow-foreground/5",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,align:r,...i,children:[x.jsx(Fbe,{}),x.jsx(_be,{className:we("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),x.jsx(Bbe,{})]})})}function zF({className:e,children:t,...n}){return x.jsxs(jbe,{"data-slot":"select-item",className:we("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...n,children:[x.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:x.jsx(Lbe,{children:x.jsx(yP,{className:"size-4"})})}),x.jsx(Pbe,{children:t})]})}function Fbe({className:e,...t}){return x.jsx(zbe,{"data-slot":"select-scroll-up-button",className:we("flex cursor-default items-center justify-center py-1",e),...t,children:x.jsx(qZ,{className:"size-4"})})}function Bbe({className:e,...t}){return x.jsx(Ibe,{"data-slot":"select-scroll-down-button",className:we("flex cursor-default items-center justify-center py-1",e),...t,children:x.jsx(yh,{className:"size-4"})})}function Hbe(e){return e?.isActive("codeBlock")?"codeBlock":e?.isActive("blockquote")?"blockquote":e?.isActive("heading",{level:1})?"heading1":e?.isActive("heading",{level:2})?"heading2":e?.isActive("heading",{level:3})?"heading3":e?.isActive("heading",{level:4})?"heading4":e?.isActive("heading",{level:5})?"heading5":e?.isActive("heading",{level:6})?"heading6":"paragraph"}const Ube=["heading1","heading2","heading3","heading4","heading5","heading6","paragraph","blockquote","codeBlock"];function Vbe({editor:e}){const{t}=cn(),n=e?Hbe(e):void 0;return x.jsxs(jF,{value:n,onValueChange:r=>{const i=e.chain().focus().clearNodes();r.startsWith("heading")&&i.setHeading({level:Number(r.at(-1))}).run(),r==="blockquote"&&i.setBlockquote().run(),r==="codeBlock"&&i.setCodeBlock().run(),r==="paragraph"&&i.setParagraph().run()},children:[x.jsx(PF,{children:t(`widgets.rich_text_widget.${n}`)}),x.jsx(LF,{children:Ube.map(r=>x.jsx(zF,{value:r,children:t(`widgets.rich_text_widget.${r}`)},r))})]})}function qbe({editor:e}){const{t}=cn(),[n,r]=w.useState(!1),i=!zn(e.view.state.selection.content().toJSON());return x.jsxs(x.Fragment,{children:[n&&x.jsx(Wbe,{editor:e,onClose:()=>r(!1)}),x.jsxs(SL,{children:[x.jsx(EL,{children:e.isActive("link")?t("widgets.rich_text_widget.update_link"):t("widgets.rich_text_widget.set_link")}),x.jsx(CL,{asChild:!0,children:x.jsx(on,{size:"sm",variant:"ghost",disabled:!i&&!e.isActive("link"),onClick:()=>r(!0),children:x.jsx(DG,{})})})]})]})}const Wbe=({editor:e,onClose:t})=>{const{t:n}=cn(),[r,i]=w.useState(e.getAttributes("link").href??""),o=e.isActive("link");return x.jsx(Zu,{open:!0,onOpenChange:a=>{a||t()},children:x.jsxs(Gu,{children:[x.jsx(XS,{children:x.jsx(QS,{children:n(o?"widgets.rich_text_widget.update_link":"widgets.rich_text_widget.set_link")})}),x.jsx("div",{className:"py-6",children:x.jsx(Mr,{placeholder:"https://",value:r,onChange:a=>i(a.target.value)})}),x.jsxs(mJ,{children:[o&&x.jsx(on,{variant:"destructive",className:"mr-auto",onClick:()=>{e.chain().focus().unsetLink().run(),t()},children:n("widgets.rich_text_widget.remove_link")}),x.jsx(on,{variant:"ghost",onClick:()=>t(),children:n("common.cancel")}),x.jsx(on,{onClick:()=>{e.chain().focus().extendMarkRange("link").setLink({href:r}).run(),t()},children:n(o?"widgets.rich_text_widget.update_link":"widgets.rich_text_widget.set_link")})]})]})})};function Kbe({editor:e}){return e&&x.jsxs("div",{className:"border-b flex items-center gap-2 p-1 overflow-x-auto overflow-y-hidden",children:[x.jsx(on,{size:"sm",variant:"ghost",onClick:()=>e?.chain().focus().undo().run(),children:x.jsx(SG,{})}),x.jsx(on,{size:"sm",variant:"ghost",onClick:()=>e?.chain().focus().redo().run(),children:x.jsx(CG,{})}),x.jsx("div",{className:"w-[140px]",children:x.jsx(Vbe,{editor:e})}),x.jsx(Am,{pressed:e?.isActive("bold"),onPressedChange:()=>e?.chain().focus().toggleBold().run(),children:x.jsx(jG,{})}),x.jsx(Am,{pressed:e?.isActive("italic"),onPressedChange:()=>e?.chain().focus().toggleItalic().run(),children:x.jsx(PG,{})}),x.jsx(Am,{pressed:e?.isActive("underline"),onPressedChange:()=>e?.chain().focus().toggleUnderline().run(),children:x.jsx(zG,{})}),x.jsx(Am,{pressed:e?.isActive("strike"),onPressedChange:()=>e?.chain().focus().toggleStrike().run(),children:x.jsx(LG,{})}),x.jsx(C2,{orientation:"vertical",className:"h-auto self-stretch"}),x.jsx(on,{size:"sm",variant:"ghost",onClick:()=>e?.chain().focus().toggleOrderedList().run(),children:x.jsx(RG,{})}),x.jsx(on,{size:"sm",variant:"ghost",onClick:()=>e?.chain().focus().toggleBulletList().run(),children:x.jsx(NG,{})}),x.jsx(C2,{orientation:"vertical",className:"h-auto self-stretch"}),x.jsx(qbe,{editor:e})]})}const Ybe=[qve,mye,B3.configure({autolink:!0,linkOnPaste:!0,openOnClick:!1}),H3,Sge.configure({HTMLAttributes:{class:"rich-text-image"}})];function Zbe({value:e,onChange:t,disabled:n}){const r=jye({extensions:Ybe,content:e,editable:!n,editorProps:{attributes:{class:"rich-text-field"}},onUpdate({editor:i}){t?.(i.getHTML())}});return w.useEffect(()=>{e!==r.getHTML()&&r.commands.setContent(e??"")},[e,r]),zn(e)?null:x.jsxs("div",{className:"border border-solid rounded-md bg-background focus-within:border-ring",children:[x.jsx(Kbe,{editor:r}),x.jsx("div",{className:"max-h-[600px] overflow-y-auto scrollbar",children:x.jsx(Oye,{editor:r})})]})}function Gbe({field:e,value:t,onChange:n}){return x.jsxs(jF,{value:t,onValueChange:n,children:[x.jsx(PF,{children:x.jsx($be,{})}),x.jsx(LF,{children:e.choices?.map(([r,i])=>x.jsx(zF,{value:r,children:i}))})]})}function Xbe({value:e,onChange:t}){return x.jsx("div",{children:x.jsx(Mr,{value:e,onChange:n=>t(n.target.value.toLowerCase().replace(/[^0-9a-z_-]/g,"-"))})})}function Qbe({value:e,onChange:t}){return x.jsx("div",{children:x.jsx(Cce,{value:e,onChange:n=>t(n.target.value)})})}function Jbe({value:e="",onChange:t}){const[n,r]=e.split(":"),i=w.useRef(null);return x.jsxs("div",{className:"flex items-center gap-1",children:[x.jsx(Mr,{value:n,maxLength:2,max:24,inputMode:"decimal",className:"w-12",placeholder:"HH",onFocus:o=>o.target.select(),onChange:o=>{const a=o.target.value;t(`${a}:${r}`),a.length===2&&i.current&&i.current.focus()}}),x.jsx("span",{children:":"}),x.jsx(Mr,{value:r,maxLength:2,inputMode:"decimal",className:"w-12",placeholder:"mm",ref:i,onFocus:o=>o.target.select(),onChange:o=>t(`${n}:${o.target.value}`)})]})}function e0e({value:e,onChange:t}){return x.jsx("div",{children:x.jsxs(xI,{children:[x.jsx(c1,{children:"/"}),x.jsx(wI,{value:e.replace(/^\//,""),onChange:n=>t(`/${n.target.value.toLowerCase().replace(/[^0-9a-z_/-]/g,"-")}`)})]})})}function t0e({value:e,onChange:t,field:n}){const{data:r}=gh(),i=n.widget_class??r?.widgets[n.type]?.name??null,o=w.useMemo(()=>kS([[zn,Rt(TR)],[()=>n.type===Py.CharField&&!zn(n.choices),Rt(Gbe)],[sn(ti.DateWidget),Rt(Fse)],[sn(ti.ForeignKeyWidget),Rt(Use)],[sn(ti.InputWidget),Rt(TR)],[sn(ti.JSONSchemaWidget),Rt(Vse)],[sn(ti.ManyToManyWidget),Rt(Cle)],[sn(ti.MediaWidget),Rt(mde)],[sn(ti.MultiSelectWidget),Rt(xde)],[sn(ti.RichTextWidget),Rt(Zbe)],[sn(ti.TextAreaWidget),Rt(Qbe)],[sn(ti.SlugWidget),Rt(Xbe)],[sn(ti.URLPathWidget),Rt(e0e)],[sn(ti.CheckboxWidget),Rt(zre)],[sn(ti.TimeWidget),Rt(Jbe)],[wS,Rt(Bse)]])(i),[n.choices,n.type,i]);return x.jsx(o,{value:e,onChange:t,field:n})}function k2({formField:e,model:t}){const n=Xu(),r=t.fields[e.name];return x.jsx("div",{children:x.jsx(of,{control:n.control,name:e.name,render:({field:i})=>x.jsxs(af,{children:[x.jsx(Vm,{children:e.label||r?.verbose_name}),!r||r.readonly?x.jsx(GS,{value:i.value,field:r}):x.jsx(sf,{children:x.jsx(t0e,{field:r,...i})}),r&&x.jsx(Lre,{children:r.help_text}),x.jsx(lf,{})]})})})}function IF({formSet:e,model:t,hiddenFields:n=[]}){return x.jsxs("div",{children:[x.jsxs("div",{className:"mb-4 empty:hidden",children:[e.title&&x.jsx("h4",{className:"font-semibold",children:e.title}),e.description?x.jsx("div",{className:"text-sm text-muted-foreground",children:e.description}):null]}),x.jsx("div",{className:"space-y-3",children:e.fields.map((r,i)=>GW("fields",r)?x.jsx("div",{className:"grid gap-3",style:{gridTemplateColumns:`repeat(${r.fields.length}, 1fr)`},children:r.fields.filter(o=>!n.includes(o.name)).map(o=>x.jsx(k2,{formField:o,model:t},i))}):!n.includes(r.name)&&x.jsx(k2,{formField:r,model:t},i))})]})}function n0e({model:e,hiddenFields:t}){const{admin:{edit:{sidebar:n}}}=e;return!ks(n)&&!zn(n)&&x.jsx("aside",{className:"space-y-4",children:n.map((i,o)=>x.jsx("section",{className:"border rounded-lg p-4 w-full",children:x.jsx(IF,{model:e,formSet:i,hiddenFields:t})},o))})}var Dv="DropdownMenu",[r0e,Dxe]=Ti(Dv,[uv]),Vr=uv(),[i0e,$F]=r0e(Dv),FF=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:o,onOpenChange:a,modal:l=!0}=e,u=Vr(t),d=w.useRef(null),[h,p]=qo({prop:i,defaultProp:o??!1,onChange:a,caller:Dv});return x.jsx(i0e,{scope:t,triggerId:hr(),triggerRef:d,contentId:hr(),open:h,onOpenChange:p,onOpenToggle:w.useCallback(()=>p(g=>!g),[p]),modal:l,children:x.jsx(XI,{...u,open:h,onOpenChange:p,dir:r,modal:l,children:n})})};FF.displayName=Dv;var BF="DropdownMenuTrigger",HF=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,o=$F(BF,n),a=Vr(n);return x.jsx(QI,{asChild:!0,...a,children:x.jsx(Ge.button,{type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...i,ref:Ir(t,o.triggerRef),onPointerDown:_e(e.onPointerDown,l=>{!r&&l.button===0&&l.ctrlKey===!1&&(o.onOpenToggle(),o.open||l.preventDefault())}),onKeyDown:_e(e.onKeyDown,l=>{r||(["Enter"," "].includes(l.key)&&o.onOpenToggle(),l.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(l.key)&&l.preventDefault())})})})});HF.displayName=BF;var o0e="DropdownMenuPortal",UF=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Vr(t);return x.jsx(JI,{...r,...n})};UF.displayName=o0e;var VF="DropdownMenuContent",qF=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=$F(VF,n),o=Vr(n),a=w.useRef(!1);return x.jsx(e4,{id:i.contentId,"aria-labelledby":i.triggerId,...o,...r,ref:t,onCloseAutoFocus:_e(e.onCloseAutoFocus,l=>{a.current||i.triggerRef.current?.focus(),a.current=!1,l.preventDefault()}),onInteractOutside:_e(e.onInteractOutside,l=>{const u=l.detail.originalEvent,d=u.button===0&&u.ctrlKey===!0,h=u.button===2||d;(!i.modal||h)&&(a.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});qF.displayName=VF;var a0e="DropdownMenuGroup",s0e=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Vr(n);return x.jsx(t4,{...i,...r,ref:t})});s0e.displayName=a0e;var l0e="DropdownMenuLabel",c0e=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Vr(n);return x.jsx(n4,{...i,...r,ref:t})});c0e.displayName=l0e;var u0e="DropdownMenuItem",WF=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Vr(n);return x.jsx(r4,{...i,...r,ref:t})});WF.displayName=u0e;var d0e="DropdownMenuCheckboxItem",f0e=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Vr(n);return x.jsx(i4,{...i,...r,ref:t})});f0e.displayName=d0e;var h0e="DropdownMenuRadioGroup",p0e=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Vr(n);return x.jsx(o4,{...i,...r,ref:t})});p0e.displayName=h0e;var m0e="DropdownMenuRadioItem",g0e=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Vr(n);return x.jsx(a4,{...i,...r,ref:t})});g0e.displayName=m0e;var y0e="DropdownMenuItemIndicator",v0e=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Vr(n);return x.jsx(s4,{...i,...r,ref:t})});v0e.displayName=y0e;var b0e="DropdownMenuSeparator",x0e=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Vr(n);return x.jsx(l4,{...i,...r,ref:t})});x0e.displayName=b0e;var w0e="DropdownMenuArrow",S0e=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Vr(n);return x.jsx(c4,{...i,...r,ref:t})});S0e.displayName=w0e;var C0e="DropdownMenuSubTrigger",E0e=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Vr(n);return x.jsx(u4,{...i,...r,ref:t})});E0e.displayName=C0e;var k0e="DropdownMenuSubContent",M0e=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Vr(n);return x.jsx(d4,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});M0e.displayName=k0e;var O0e=FF,T0e=HF,A0e=UF,D0e=qF,R0e=WF;function KF({...e}){return x.jsx(O0e,{"data-slot":"dropdown-menu",...e})}function YF({...e}){return x.jsx(T0e,{"data-slot":"dropdown-menu-trigger",...e})}function ZF({className:e,sideOffset:t=4,...n}){return x.jsx(A0e,{children:x.jsx(D0e,{"data-slot":"dropdown-menu-content",sideOffset:t,className:we("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",e),...n})})}function GF({className:e,inset:t,variant:n="default",...r}){return x.jsx(R0e,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:we("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r})}function N0e({model:e,resource:t,isSaving:n,onSave:r,onDelete:i,onClose:o}){const{t:a}=cn(),l=Vn(),{data:u}=gh(),d=OC(),h=Xu(),p=!t?.id,g=e?.admin.is_singleton??!1,{isDirty:y}=h.formState,b=t&&u?t[u.settings.edited_at_attr]:null,C=xo(),{mutateAsync:E}=Us({async mutationFn(k){await l.delete(`/content/${e.label}/${k}`)},async onSuccess(){await C.invalidateQueries({queryKey:["resources",e.label]})}});return e&&x.jsx(x.Fragment,{children:x.jsxs(XS,{className:"border-b flex-row items-center gap-6 p-5",children:[x.jsx(on,{variant:"outline",size:"icon",disabled:n,onClick:async()=>{if(!y)return o?.();await d({description:a("editor.unsaved_alert")})&&o?.()},children:x.jsx(HG,{})}),x.jsxs("div",{className:"select-none",children:[x.jsx(QS,{children:`${a(p?"editor.title_create":"editor.title_edit",{modelName:e.verbose_name.toLowerCase()})}`}),x.jsx("div",{className:"text-sm font-medium text-muted-foreground",children:t?.__str__})]}),x.jsxs("div",{className:"flex-1 flex items-center justify-end gap-2",children:[b?x.jsx("div",{className:"text-muted-foreground text-sm font-medium mr-4 select-none",children:`${a("editor.last_edited")} ${Ko(b).fromNow()}`}):null,x.jsx(on,{onClick:async()=>{try{await r()}catch{}},isLoading:n,children:a(p?"common.create":"common.save")}),!g&&!p&&x.jsxs(KF,{children:[x.jsx(YF,{asChild:!0,children:x.jsx(on,{size:"icon",variant:"ghost",children:x.jsx(NP,{})})}),x.jsx(ZF,{align:"end",children:x.jsx(GF,{className:"text-destructive",onSelect:async()=>{await d({title:a("common.delete_confirm_title"),description:a("common.delete_confirm_description")})&&(await E(t.id),i?.())},children:a("common.delete")})})]})]})]})})}var Rv="Tabs",[_0e,Rxe]=Ti(Rv,[cv]),XF=cv(),[j0e,gE]=_0e(Rv),QF=w.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:o,orientation:a="horizontal",dir:l,activationMode:u="automatic",...d}=e,h=lv(l),[p,g]=qo({prop:r,onChange:i,defaultProp:o??"",caller:Rv});return x.jsx(j0e,{scope:n,baseId:hr(),value:p,onValueChange:g,orientation:a,dir:h,activationMode:u,children:x.jsx(Ge.div,{dir:h,"data-orientation":a,...d,ref:t})})});QF.displayName=Rv;var JF="TabsList",eB=w.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...i}=e,o=gE(JF,n),a=XF(n);return x.jsx(OI,{asChild:!0,...a,orientation:o.orientation,dir:o.dir,loop:r,children:x.jsx(Ge.div,{role:"tablist","aria-orientation":o.orientation,...i,ref:t})})});eB.displayName=JF;var tB="TabsTrigger",nB=w.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...o}=e,a=gE(tB,n),l=XF(n),u=oB(a.baseId,r),d=aB(a.baseId,r),h=r===a.value;return x.jsx(TI,{asChild:!0,...l,focusable:!i,active:h,children:x.jsx(Ge.button,{type:"button",role:"tab","aria-selected":h,"aria-controls":d,"data-state":h?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:u,...o,ref:t,onMouseDown:_e(e.onMouseDown,p=>{!i&&p.button===0&&p.ctrlKey===!1?a.onValueChange(r):p.preventDefault()}),onKeyDown:_e(e.onKeyDown,p=>{[" ","Enter"].includes(p.key)&&a.onValueChange(r)}),onFocus:_e(e.onFocus,()=>{const p=a.activationMode!=="manual";!h&&!i&&p&&a.onValueChange(r)})})})});nB.displayName=tB;var rB="TabsContent",iB=w.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:i,children:o,...a}=e,l=gE(rB,n),u=oB(l.baseId,r),d=aB(l.baseId,r),h=r===l.value,p=w.useRef(h);return w.useEffect(()=>{const g=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(g)},[]),x.jsx(li,{present:i||h,children:({present:g})=>x.jsx(Ge.div,{"data-state":h?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":u,hidden:!g,id:d,tabIndex:0,...a,ref:t,style:{...e.style,animationDuration:p.current?"0s":void 0},children:g&&o})})});iB.displayName=rB;function oB(e,t){return`${e}-trigger-${t}`}function aB(e,t){return`${e}-content-${t}`}var P0e=QF,L0e=eB,z0e=nB,I0e=iB;function $0e({className:e,...t}){return x.jsx(P0e,{"data-slot":"tabs",className:we("flex flex-col gap-2",e),...t})}function F0e({className:e,...t}){return x.jsx(L0e,{"data-slot":"tabs-list",className:we("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",e),...t})}function cw({className:e,...t}){return x.jsx(z0e,{"data-slot":"tabs-trigger",className:we("data-[state=active]:bg-background dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}function M2({className:e,...t}){return x.jsx(I0e,{"data-slot":"tabs-content",className:we("flex-1 outline-none",e),...t})}function B0e({relModel:e,relId:t,model:n,adminModel:r}){const{t:i}=cn(),o=Vn(),[a,l]=w.useState(!1),[u,d]=w.useState(1),h=!n.admin,p=PL({name:"__str__"}),{data:g}=Oi({retry:!1,refetchOnWindowFocus:!0,placeholderData:Ql,queryKey:["resources",e,n.label,r.fk_name,t,u],async queryFn(){const{data:y}=await o.get(`/inlines/${e}/${n.label}`,{params:{[`${r.fk_name}_id`]:t,page:u}});return y}});return x.jsxs("div",{className:"space-y-4",children:[x.jsx(Zu,{open:a,onOpenChange:l,children:x.jsx(Gu,{className:"p-0 sm:max-w-5xl",showCloseButton:!1,children:x.jsx(yE,{modelLabel:n.label,initialValues:{[r.fk_name]:{id:t,__str__:p}},onSave:()=>l(!1),onClose:()=>l(!1)})})}),x.jsx("div",{className:"border rounded-lg scrollbar",children:x.jsxs(kL,{children:[x.jsx(ML,{children:x.jsx(mg,{children:r.list_display?.map(y=>x.jsx(TL,{children:x.jsx("div",{className:"flex items-center",children:n.fields[y]?.verbose_name})},y))})}),x.jsx(OL,{children:g?.results.map(y=>x.jsx(H0e,{resource:y,model:n,adminModel:r,relId:t,relName:p,readOnly:h},y.id))})]})}),g?.pagination&&x.jsx("div",{className:"flex justify-center",children:x.jsx(vh,{current:g.pagination.current,pages:g.pagination.pages,onPageChange:d})}),x.jsx("div",{className:"flex justify-center",children:x.jsxs(on,{size:"sm",variant:"outline",onClick:()=>l(!0),children:[x.jsx(jP,{}),i("common.create")]})})]})}function H0e({resource:e,readOnly:t,model:n,adminModel:r,relId:i,relName:o}){const[a,l]=w.useState(!1);return x.jsxs(x.Fragment,{children:[x.jsx(Zu,{open:a,onOpenChange:l,children:!t&&x.jsx(Gu,{className:"p-0 sm:max-w-5xl",showCloseButton:!1,children:x.jsx(yE,{modelLabel:n.label,id:e.id,initialValues:{[r.fk_name]:{id:i,__str__:o}},onSave:()=>l(!1),onClose:()=>l(!1),onDelete:()=>l(!1)})})},e.id),x.jsx(mg,{onClick:()=>!t&&l(!0),className:we({"hover:bg-transparent":t}),children:r.list_display?.map(u=>x.jsx(AL,{children:x.jsx(GS,{value:e[u],field:n.fields[u]})},u))})]})}function U0e({model:e,id:t,hiddenFields:n}){const{t:r}=cn(),{data:i}=Ai(),{admin:{edit:{main:o,inlines:a}}}=e,l=o.length>1||!ks(o[0]?.label)||!ks(a),u=o.filter(ES("label"));return x.jsx("div",{children:x.jsxs($0e,{defaultValue:u[0]?.label||"default",children:[l&&x.jsxs(F0e,{className:"w-full",children:[u.map((d,h)=>x.jsx(cw,{value:d.label,children:d.label},h)),ks(u)&&!ks(a)&&x.jsx(cw,{value:"default",children:r("common.general")}),t?a.map(d=>x.jsx(cw,{value:d.model,children:i?.models.find(Wo({label:d.model}))?.verbose_name_plural},d.model)):null]}),o.map((d,h)=>x.jsx(M2,{value:d.label||"default",className:"space-y-4",children:d.formsets.map((p,g)=>x.jsx("section",{className:"border rounded-lg p-4 w-full",children:x.jsx(IF,{model:e,formSet:p,hiddenFields:n})},g))},h)),t?a.map(d=>{const h=i?.models.find(Wo({label:d.model}));return h?x.jsx(M2,{value:d.model,children:x.jsx(B0e,{relModel:e.label,relId:t,model:h,adminModel:d})},d.model):null}):null]})})}function yE({modelLabel:e,id:t,initialValues:n={},onDelete:r,onSave:i,onClose:o}){const a=xo(),l=Vn(),{data:u}=Ai(),d=u?.models.find(Wo({label:e})),h=d?.admin.is_singleton??!1,p=Object.keys(n),g=Object.entries(d?.fields??{}).reduce((A,[N,D])=>({...A,[N]:D.default}),{}),y=oz({id:Qw().readonly().optional(),__str__:Qw().readonly().optional()}),b=HL({resolver:rz(y),mode:"onChange",defaultValues:i7(n,g)}),{data:C}=Oi({enabled:!zn(t)||h,retry:!1,queryKey:["resources",e,t||h],async queryFn(){const{data:A}=await l.get(`/content/${e}${h?"":`/${t}`}`);return b.reset(A),A}}),{mutateAsync:E,isPending:k}=Us({async mutationFn(A){await l[A.id?"put":"post"](`/content/${e}${A.id?`/${A.id}`:""}`,A)},async onSuccess(){await a.invalidateQueries({queryKey:["resources",e]})}});async function O(A){await E(A)}return d&&x.jsx(lz,{...b,children:x.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[x.jsx(N0e,{model:d,resource:C,isSaving:k,onSave:async()=>{await b.handleSubmit(O)(),i?.()},onDelete:r,onClose:o}),x.jsxs("div",{className:"flex flex-1 justify-center overflow-y-auto",children:[x.jsx("div",{className:"w-full max-w-3xl",children:x.jsx("div",{className:"p-5",children:x.jsx(U0e,{model:d,id:t,hiddenFields:p})})}),x.jsx("div",{className:"w-full max-w-[360px]",children:x.jsx("div",{className:"p-5",children:x.jsx(n0e,{model:d,hiddenFields:p})})})]})]})})}function V0e(){const e=bo(),t=zu(),[n,r,i]=e.hash.split(":");return x.jsx(Zu,{open:e.hash.startsWith("#editor:"),onOpenChange:o=>{o||t({hash:""})},children:x.jsx(Gu,{showCloseButton:!1,className:"sm:max-w-none w-screen h-screen rounded-none p-0",onOpenAutoFocus:o=>o.preventDefault(),children:x.jsx(yE,{modelLabel:r,id:i,onClose:()=>t({hash:""}),onSave:()=>t({hash:""}),onDelete:()=>t({hash:""})})})})}function q0e(){const e=Vn();return Oi({retry:!1,queryKey:["me"],async queryFn(){const{data:t}=await e.get("/me");return t}})}function W0e(){const{t:e}=cn(),t=zu(),{setToken:n}=_S(),{data:r}=gh(),{data:i}=q0e(),{data:o}=Ai(),[a,l]=w.useState("");return x.jsxs("nav",{className:"w-[240px] shrink-0 flex flex-col bg-stone-50 border-r",children:[r&&x.jsxs("div",{className:"flex items-center gap-2 border-b p-3",children:[x.jsx("div",{className:"bg-gradient-to-tl from-stone-900 to-stone-600 size-7 rounded flex items-center justify-center text-white font-black shrink-0",children:r.site_header[0]}),x.jsx("h2",{className:"line-clamp-1 break-all text-base font-semibold",children:r.site_header})]}),x.jsx("div",{className:"p-3 border-b",children:x.jsx(Mr,{variant:"secondary",className:"border",placeholder:e("common.search"),value:a,onChange:u=>l(u.target.value)})}),x.jsxs("div",{className:"flex-1 p-2 space-y-1 overflow-y-auto scrollbar",children:[x.jsx(nf,{to:"/",color:"slate",icon:x.jsx(AG,{}),label:e("main_menu.dashboard")}),o?.media_library.enabled&&x.jsx(nf,{to:"/media-library",color:"pink",icon:x.jsx(_P,{}),label:e("main_menu.media_library")}),x.jsx("div",{className:"h-4",role:"separator"}),o?.model_groups.map(u=>x.jsx(nf,{color:u.color??"blue",icon:u.icon??x.jsx($w,{}),label:u.label,children:u.models.map(d=>{const h=o.models.find(Wo({label:d}));return h?x.jsx(nf,{to:h.admin.is_singleton?{hash:`editor:${h.label}`}:`/content/${h.label}`,label:h.verbose_name_plural,icon:h.admin.icon??x.jsx($w,{})},d):null}).filter(d=>!zn(d))},u.name)),x.jsx("div",{className:"h-4",role:"separator"}),x.jsx(nf,{to:"/",icon:x.jsx(_G,{}),label:e("main_menu.settings")})]}),x.jsx("div",{className:"p-1 border-t",children:i&&x.jsxs(KF,{children:[x.jsx(ZF,{side:"right",align:"start",children:x.jsxs(GF,{onClick:()=>{n(null),t("/login")},children:[x.jsx(FG,{}),e("main_menu.log_out")]})}),x.jsxs(YF,{className:"flex items-center text-left w-full gap-3 hover:bg-stone-200 p-2 rounded-md select-none",children:[x.jsxs("div",{className:"relative rounded-full size-8 bg-indigo-500 text-indigo-100 flex items-center justify-center font-bold shrink-0 text-xs",children:[`${i.first_name??""}${i.last_name??""}${i.username??""}`.trim().replace(/\s/g,"").slice(0,2).toUpperCase(),x.jsx("div",{className:"bg-emerald-500 size-2 rounded-full absolute bottom-px right-px"})]}),x.jsxs("div",{className:"flex-1",children:[x.jsx("div",{className:"text-sm font-medium",children:`${i.first_name??""} ${i.last_name??""}`.trim()}),x.jsx("div",{className:"text-xs text-muted-foreground",children:i.username})]})]})]})})]})}const K0e={slate:"bg-slate-200 text-slate-600",gray:"bg-gray-200 text-gray-600",zinc:"bg-zinc-200 text-zinc-600",neutral:"bg-neutral-200 text-neutral-600",stone:"bg-stone-200 text-stone-600",red:"bg-red-100 text-red-600",orange:"bg-orange-100 text-orange-600",amber:"bg-amber-100 text-amber-600",yellow:"bg-yellow-100 text-yellow-600",lime:"bg-lime-100 text-lime-600",green:"bg-green-100 text-green-600",emerald:"bg-emerald-100 text-emerald-600",teal:"bg-teal-100 text-teal-600",cyan:"bg-cyan-100 text-cyan-600",sky:"bg-sky-100 text-sky-600",blue:"bg-blue-100 text-blue-600",indigo:"bg-indigo-100 text-indigo-600",violet:"bg-violet-100 text-violet-600",purple:"bg-purple-100 text-purple-600",fuchsia:"bg-fuchsia-100 text-fuchsia-600",pink:"bg-pink-100 text-pink-600",rose:"bg-rose-100 text-rose-600"};function nf({label:e,icon:t,to:n,color:r,children:i}){const o=n?Iu:"button",[a,l]=w.useState(!1);return x.jsxs(x.Fragment,{children:[x.jsxs(o,{to:n??void 0,className:"flex items-center w-full text-sm font-medium gap-2 h-8 px-2 hover:bg-stone-100 rounded hover:cursor-default",onClick:()=>{i&&l(!a)},children:[t&&x.jsx("span",{className:we("size-5 rounded flex items-center justify-center",r?K0e[r]:"text-stone-500"),children:typeof t=="string"?x.jsx("span",{className:we(t)}):t}),x.jsxs("span",{className:"flex items-center justify-between flex-1",children:[x.jsx("span",{className:"first-letter:uppercase line-clamp-1 break-all",children:e}),i?a?x.jsx(kG,{}):x.jsx(DP,{}):null]})]}),i&&a?x.jsx("div",{className:"pl-3",children:i}):null]})}function Y0e(){return x.jsxs("div",{className:"h-screen flex items-stretch",children:[x.jsx(W0e,{}),x.jsx(V0e,{}),x.jsx("div",{className:"flex-1 bg-[#FDFDFD] flex flex-col overflow-y-auto scrollbar",children:x.jsx(ah,{})})]})}function Z0e({filters:e,onFilterChange:t}){const{t:n}=cn();return x.jsx("div",{children:x.jsx(Mr,{variant:"secondary",value:e.search,onChange:r=>t({search:r.target.value}),placeholder:n("common.search")})})}function G0e({items:e}){const{data:t}=Ai();return t?.media_library.models.media_model&&x.jsx("div",{className:"grid grid-cols-4 gap-4",children:e.map(r=>x.jsx(E4,{item:r},r.id))})}function X0e(){const{t:e}=cn(),{data:t}=Ai(),n=t?.media_library.models.media_model,[r,i]=aS(),o=Number(r.get("page")??"1"),a=r.get("folder"),[l,u]=w.useState({search:""}),{data:d}=M4({folder:a,page:o,filters:l});return n&&d?x.jsxs("div",{className:"flex flex-col overflow-hidden",children:[x.jsxs("div",{className:"flex items-center gap-4 mb-6 py-3 px-5 border-b",children:[x.jsx(_P,{size:24,className:"text-muted-foreground shrink-0"}),x.jsxs("div",{className:"flex-1",children:[x.jsx("h1",{className:"text-xl/tight font-semibold mb-0.5",children:e("media-library.title")}),t.media_library.folders?x.jsx(bI,{folder:a,onSelect:h=>i(p=>(h?p.set("folder",h):p.delete("folder"),p))}):x.jsx("div",{className:"text-muted-foreground",children:e("media-library.description")})]})]}),x.jsx("div",{className:"mb-8 px-5",children:x.jsx(Z0e,{filters:l,onFilterChange:u})}),t.media_library.folders&&x.jsx("div",{className:"mb-4 px-5",children:x.jsx(C4,{parent:a,onSelect:h=>i(p=>(h?p.set("folder",h):p.delete("folder"),p))})}),x.jsxs("div",{className:"px-5 overflow-y-auto scrollbar flex-1",children:[x.jsx(G0e,{items:d.results}),x.jsx("div",{className:"py-5",children:x.jsx(vh,{current:d.pagination.current,pages:d.pagination.pages,onPageChange:h=>i(p=>(p.set("page",`${h}`),p))})})]})]}):x.jsx("div",{className:"flex-1 flex items-center justify-center",children:x.jsx(Iy,{})})}const Q0e=R8([{path:"/",element:x.jsx(QK,{}),children:[{element:x.jsx(RZ,{}),children:[{element:x.jsx(Y0e,{}),children:[{index:!0,element:x.jsx(xG,{})},{path:"media-library",element:x.jsx(X0e,{})},{path:"content/:model",element:x.jsx(wG,{}),children:[{index:!0,element:x.jsx(dJ,{})}]}]}]},{element:x.jsx(NZ,{}),children:[{path:"login",element:x.jsx(pG,{})}]}]}],{basename:window.DCS_BASENAME}),J0e=document.getElementById("root");E6.createRoot(J0e).render(x.jsx(DZ,{children:x.jsx(r8,{router:Q0e})}));export{exe as c,yo as g};
|