@paroicms/admin-ui 1.90.0 → 1.90.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/index-BmzsrdKx.js +754 -0
- package/dist/assets/index-Ndxz13SA.css +1 -0
- package/dist/index.html +2 -2
- package/locales/de.json +0 -1
- package/locales/en.json +0 -1
- package/locales/es.json +0 -1
- package/locales/fr.json +0 -1
- package/locales/it.json +0 -1
- package/locales/pt.json +0 -1
- package/package.json +2 -2
- package/dist/assets/index-BA0ZVvNZ.js +0 -754
- package/dist/assets/index-BhUA_y7I.css +0 -1
|
@@ -1,754 +0,0 @@
|
|
|
1
|
-
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const l of s)if(l.type==="childList")for(const c of l.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&i(c)}).observe(document,{childList:!0,subtree:!0});function n(s){const l={};return s.integrity&&(l.integrity=s.integrity),s.referrerPolicy&&(l.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?l.credentials="include":s.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function i(s){if(s.ep)return;s.ep=!0;const l=n(s);fetch(s.href,l)}})();function Zw(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function eD(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var n=function i(){var s=!1;try{s=this instanceof i}catch{}return s?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(i){var s=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(n,i,s.get?s:{enumerable:!0,get:function(){return e[i]}})}),n}var Xm={exports:{}},Pl={};var wS;function IM(){if(wS)return Pl;wS=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(i,s,l){var c=null;if(l!==void 0&&(c=""+l),s.key!==void 0&&(c=""+s.key),"key"in s){l={};for(var d in s)d!=="key"&&(l[d]=s[d])}else l=s;return s=l.ref,{$$typeof:e,type:i,key:c,ref:s!==void 0?s:null,props:l}}return Pl.Fragment=t,Pl.jsx=n,Pl.jsxs=n,Pl}var DS;function zM(){return DS||(DS=1,Xm.exports=IM()),Xm.exports}var f=zM(),Wm={exports:{}},_e={};var NS;function _M(){if(NS)return _e;NS=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),c=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),v=Symbol.for("react.activity"),b=Symbol.iterator;function D(k){return k===null||typeof k!="object"?null:(k=b&&k[b]||k["@@iterator"],typeof k=="function"?k:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},N=Object.assign,M={};function A(k,J,oe){this.props=k,this.context=J,this.refs=M,this.updater=oe||w}A.prototype.isReactComponent={},A.prototype.setState=function(k,J){if(typeof k!="object"&&typeof k!="function"&&k!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,k,J,"setState")},A.prototype.forceUpdate=function(k){this.updater.enqueueForceUpdate(this,k,"forceUpdate")};function T(){}T.prototype=A.prototype;function j(k,J,oe){this.props=k,this.context=J,this.refs=M,this.updater=oe||w}var F=j.prototype=new T;F.constructor=j,N(F,A.prototype),F.isPureReactComponent=!0;var z=Array.isArray;function P(){}var E={H:null,A:null,T:null,S:null},L=Object.prototype.hasOwnProperty;function _(k,J,oe){var ce=oe.ref;return{$$typeof:e,type:k,key:J,ref:ce!==void 0?ce:null,props:oe}}function Y(k,J){return _(k.type,J,k.props)}function Z(k){return typeof k=="object"&&k!==null&&k.$$typeof===e}function U(k){var J={"=":"=0",":":"=2"};return"$"+k.replace(/[=:]/g,function(oe){return J[oe]})}var ae=/\/+/g;function Q(k,J){return typeof k=="object"&&k!==null&&k.key!=null?U(""+k.key):J.toString(36)}function ie(k){switch(k.status){case"fulfilled":return k.value;case"rejected":throw k.reason;default:switch(typeof k.status=="string"?k.then(P,P):(k.status="pending",k.then(function(J){k.status==="pending"&&(k.status="fulfilled",k.value=J)},function(J){k.status==="pending"&&(k.status="rejected",k.reason=J)})),k.status){case"fulfilled":return k.value;case"rejected":throw k.reason}}throw k}function R(k,J,oe,ce,$e){var Fe=typeof k;(Fe==="undefined"||Fe==="boolean")&&(k=null);var Je=!1;if(k===null)Je=!0;else switch(Fe){case"bigint":case"string":case"number":Je=!0;break;case"object":switch(k.$$typeof){case e:case t:Je=!0;break;case y:return Je=k._init,R(Je(k._payload),J,oe,ce,$e)}}if(Je)return $e=$e(k),Je=ce===""?"."+Q(k,0):ce,z($e)?(oe="",Je!=null&&(oe=Je.replace(ae,"$&/")+"/"),R($e,J,oe,"",function(Pr){return Pr})):$e!=null&&(Z($e)&&($e=Y($e,oe+($e.key==null||k&&k.key===$e.key?"":(""+$e.key).replace(ae,"$&/")+"/")+Je)),J.push($e)),1;Je=0;var mn=ce===""?".":ce+":";if(z(k))for(var Mt=0;Mt<k.length;Mt++)ce=k[Mt],Fe=mn+Q(ce,Mt),Je+=R(ce,J,oe,Fe,$e);else if(Mt=D(k),typeof Mt=="function")for(k=Mt.call(k),Mt=0;!(ce=k.next()).done;)ce=ce.value,Fe=mn+Q(ce,Mt++),Je+=R(ce,J,oe,Fe,$e);else if(Fe==="object"){if(typeof k.then=="function")return R(ie(k),J,oe,ce,$e);throw J=String(k),Error("Objects are not valid as a React child (found: "+(J==="[object Object]"?"object with keys {"+Object.keys(k).join(", ")+"}":J)+"). If you meant to render a collection of children, use an array instead.")}return Je}function W(k,J,oe){if(k==null)return k;var ce=[],$e=0;return R(k,ce,"","",function(Fe){return J.call(oe,Fe,$e++)}),ce}function se(k){if(k._status===-1){var J=k._result;J=J(),J.then(function(oe){(k._status===0||k._status===-1)&&(k._status=1,k._result=oe)},function(oe){(k._status===0||k._status===-1)&&(k._status=2,k._result=oe)}),k._status===-1&&(k._status=0,k._result=J)}if(k._status===1)return k._result.default;throw k._result}var ye=typeof reportError=="function"?reportError:function(k){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var J=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof k=="object"&&k!==null&&typeof k.message=="string"?String(k.message):String(k),error:k});if(!window.dispatchEvent(J))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",k);return}console.error(k)},ke={map:W,forEach:function(k,J,oe){W(k,function(){J.apply(this,arguments)},oe)},count:function(k){var J=0;return W(k,function(){J++}),J},toArray:function(k){return W(k,function(J){return J})||[]},only:function(k){if(!Z(k))throw Error("React.Children.only expected to receive a single React element child.");return k}};return _e.Activity=v,_e.Children=ke,_e.Component=A,_e.Fragment=n,_e.Profiler=s,_e.PureComponent=j,_e.StrictMode=i,_e.Suspense=h,_e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=E,_e.__COMPILER_RUNTIME={__proto__:null,c:function(k){return E.H.useMemoCache(k)}},_e.cache=function(k){return function(){return k.apply(null,arguments)}},_e.cacheSignal=function(){return null},_e.cloneElement=function(k,J,oe){if(k==null)throw Error("The argument must be a React element, but you passed "+k+".");var ce=N({},k.props),$e=k.key;if(J!=null)for(Fe in J.key!==void 0&&($e=""+J.key),J)!L.call(J,Fe)||Fe==="key"||Fe==="__self"||Fe==="__source"||Fe==="ref"&&J.ref===void 0||(ce[Fe]=J[Fe]);var Fe=arguments.length-2;if(Fe===1)ce.children=oe;else if(1<Fe){for(var Je=Array(Fe),mn=0;mn<Fe;mn++)Je[mn]=arguments[mn+2];ce.children=Je}return _(k.type,$e,ce)},_e.createContext=function(k){return k={$$typeof:c,_currentValue:k,_currentValue2:k,_threadCount:0,Provider:null,Consumer:null},k.Provider=k,k.Consumer={$$typeof:l,_context:k},k},_e.createElement=function(k,J,oe){var ce,$e={},Fe=null;if(J!=null)for(ce in J.key!==void 0&&(Fe=""+J.key),J)L.call(J,ce)&&ce!=="key"&&ce!=="__self"&&ce!=="__source"&&($e[ce]=J[ce]);var Je=arguments.length-2;if(Je===1)$e.children=oe;else if(1<Je){for(var mn=Array(Je),Mt=0;Mt<Je;Mt++)mn[Mt]=arguments[Mt+2];$e.children=mn}if(k&&k.defaultProps)for(ce in Je=k.defaultProps,Je)$e[ce]===void 0&&($e[ce]=Je[ce]);return _(k,Fe,$e)},_e.createRef=function(){return{current:null}},_e.forwardRef=function(k){return{$$typeof:d,render:k}},_e.isValidElement=Z,_e.lazy=function(k){return{$$typeof:y,_payload:{_status:-1,_result:k},_init:se}},_e.memo=function(k,J){return{$$typeof:m,type:k,compare:J===void 0?null:J}},_e.startTransition=function(k){var J=E.T,oe={};E.T=oe;try{var ce=k(),$e=E.S;$e!==null&&$e(oe,ce),typeof ce=="object"&&ce!==null&&typeof ce.then=="function"&&ce.then(P,ye)}catch(Fe){ye(Fe)}finally{J!==null&&oe.types!==null&&(J.types=oe.types),E.T=J}},_e.unstable_useCacheRefresh=function(){return E.H.useCacheRefresh()},_e.use=function(k){return E.H.use(k)},_e.useActionState=function(k,J,oe){return E.H.useActionState(k,J,oe)},_e.useCallback=function(k,J){return E.H.useCallback(k,J)},_e.useContext=function(k){return E.H.useContext(k)},_e.useDebugValue=function(){},_e.useDeferredValue=function(k,J){return E.H.useDeferredValue(k,J)},_e.useEffect=function(k,J){return E.H.useEffect(k,J)},_e.useEffectEvent=function(k){return E.H.useEffectEvent(k)},_e.useId=function(){return E.H.useId()},_e.useImperativeHandle=function(k,J,oe){return E.H.useImperativeHandle(k,J,oe)},_e.useInsertionEffect=function(k,J){return E.H.useInsertionEffect(k,J)},_e.useLayoutEffect=function(k,J){return E.H.useLayoutEffect(k,J)},_e.useMemo=function(k,J){return E.H.useMemo(k,J)},_e.useOptimistic=function(k,J){return E.H.useOptimistic(k,J)},_e.useReducer=function(k,J,oe){return E.H.useReducer(k,J,oe)},_e.useRef=function(k){return E.H.useRef(k)},_e.useState=function(k){return E.H.useState(k)},_e.useSyncExternalStore=function(k,J,oe){return E.H.useSyncExternalStore(k,J,oe)},_e.useTransition=function(){return E.H.useTransition()},_e.version="19.2.0",_e}var CS;function Cc(){return CS||(CS=1,Wm.exports=_M()),Wm.exports}var S=Cc();const Jl=Zw(S),Mg=S.createContext(void 0),UM=Mg.Provider;function ct(e,t){const n=S.useContext(Mg),i=S.useRef(void 0);S.useEffect(()=>{let s,l;i.current?l=i.current.then(c):l=c(),i.current=l;function c(){return e().then(d=>(s=d??(()=>{}),d),n?d=>n.error(d):void 0)}return()=>{if(s){const d=s();n&&d?.catch(h=>n.error(h))}else{const d=l.then(h=>h?.());n&&d.catch(h=>n.error(h))}}},t)}function ci(){const e=S.useContext(Mg);return t=>(...n)=>{const i=t(...n);e&&i.catch(s=>e.error(s))}}function tD(e){var t,n,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=tD(e[t]))&&(i&&(i+=" "),i+=n)}else for(n in e)e[n]&&(i&&(i+=" "),i+=n);return i}function he(){for(var e,t,n=0,i="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=tD(e))&&(i&&(i+=" "),i+=t);return i}function cs({checked:e,onChange:t,label:n,className:i,...s}){const l=c=>{t(c.target.checked)};return n?f.jsxs("label",{className:he("PaCheckbox",i),children:[f.jsx("input",{className:"PaCheckbox-input",type:"checkbox",checked:e,onChange:l,...s}),f.jsx("span",{className:"PaCheckbox-label",children:n})]}):f.jsx("input",{className:he("PaCheckbox-input",i),type:"checkbox",checked:e,onChange:l,...s})}function Tg({className:e,label:t,error:n,type:i,ref:s,...l}){const c=f.jsx("input",{ref:s,type:i,className:he("PaDateInput-field",n&&"error"),...l});return f.jsxs("span",{className:he("PaDateInput",e),children:[t?f.jsxs("label",{className:"PaDateInput-wrapper",children:[f.jsx("span",{className:"PaDateInput-label",children:t}),c]}):c,n&&f.jsx("span",{className:"PaDateInput-error",children:n})]})}function BM({className:e,label:t,error:n,value:i,onChange:s,min:l,max:c,step:d,ref:h,...m}){const y=b=>{const D=b.target.value;if(D==="")s(void 0);else{const w=Number(D);Number.isNaN(w)||s(w)}},v=f.jsx("input",{ref:h,type:"number",className:he("PaInputNumber-field",n&&"error"),value:i??"",onChange:y,min:l,max:c,step:d,...m});return f.jsxs("span",{className:he("PaInputNumber",e),children:[t?f.jsxs("label",{className:"PaInputNumber-wrapper",children:[f.jsx("span",{className:"PaInputNumber-label",children:t}),v]}):v,n&&f.jsx("span",{className:"PaInputNumber-error",children:n})]})}function vn({value:e,onChange:t,label:n,error:i,className:s,fullWidth:l=!1,endElement:c,icon:d,iconPosition:h="left",...m}){const y=D=>{t(D.target.value)},v=f.jsx("input",{className:"PaInputText-field",value:e,onChange:y,...m}),b=c?f.jsxs("span",{className:"PaInputText-row",children:[v,c]}):d?f.jsxs("span",{className:he("PaInputText-iconWrapper",h==="right"&&"iconRight"),children:[f.jsx("span",{className:"PaInputText-icon",children:d}),v]}):v;return f.jsxs("span",{className:he("PaInputText",i&&"error",l&&"fullWidth",s),children:[n?f.jsxs("label",{className:"PaInputText-wrapper",children:[f.jsx("span",{className:"PaInputText-label",children:n}),b]}):b,i&&f.jsx("span",{className:"PaInputText-error",children:i})]})}const FM=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),HM=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,i)=>i?i.toUpperCase():n.toLowerCase()),ES=e=>{const t=HM(e);return t.charAt(0).toUpperCase()+t.slice(1)},nD=(...e)=>e.filter((t,n,i)=>!!t&&t.trim()!==""&&i.indexOf(t)===n).join(" ").trim(),qM=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var VM={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const KM=S.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:i,className:s="",children:l,iconNode:c,...d},h)=>S.createElement("svg",{ref:h,...VM,width:t,height:t,stroke:e,strokeWidth:i?Number(n)*24/Number(t):n,className:nD("lucide",s),...!l&&!qM(d)&&{"aria-hidden":"true"},...d},[...c.map(([m,y])=>S.createElement(m,y)),...Array.isArray(l)?l:[l]]));const ze=(e,t)=>{const n=S.forwardRef(({className:i,...s},l)=>S.createElement(KM,{ref:l,iconNode:t,className:nD(`lucide-${FM(ES(e))}`,`lucide-${e}`,i),...s}));return n.displayName=ES(e),n};const GM=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]],YM=ze("archive",GM);const JM=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],XM=ze("arrow-down",JM);const WM=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],QM=ze("arrow-left",WM);const ZM=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],eT=ze("arrow-right",ZM);const tT=[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]],nT=ze("arrow-up-down",tT);const aT=[["path",{d:"M7 17V7h10",key:"11bw93"}],["path",{d:"M17 17 7 7",key:"2786uv"}]],aD=ze("arrow-up-left",aT);const iT=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],rT=ze("arrow-up",iT);const sT=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],iD=ze("check",sT);const oT=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Ro=ze("chevron-down",oT);const lT=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],cT=ze("chevron-left",lT);const uT=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Ec=ze("chevron-right",uT);const dT=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],fT=ze("chevron-up",dT);const hT=[["path",{d:"m7 6 5 5 5-5",key:"1lc07p"}],["path",{d:"m7 13 5 5 5-5",key:"1d48rs"}]],rD=ze("chevrons-down",hT);const mT=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],pT=ze("chevrons-up-down",mT);const gT=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],yT=ze("clock",gT);const vT=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],bT=ze("copy",vT);const ST=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],Pp=ze("download",ST);const xT=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]],wT=ze("ellipsis-vertical",xT);const DT=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],AS=ze("ellipsis",DT);const NT=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],CT=ze("eye-off",NT);const ET=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],jg=ze("eye",ET);const AT=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M12 12v6",key:"3ahymv"}],["path",{d:"m15 15-3-3-3 3",key:"15xj92"}]],sD=ze("file-up",AT);const MT=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]],oD=ze("file",MT);const TT=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],lD=ze("folder",TT);const jT=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],kT=ze("history",jT);const $T=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],OT=ze("house",$T);const RT=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],LT=ze("layers",RT);const PT=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],IT=ze("list",PT);const zT=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],cD=ze("loader-circle",zT);const _T=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 9.9-1",key:"1mm8w8"}]],UT=ze("lock-open",_T);const BT=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],FT=ze("lock",BT);const HT=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],qT=ze("log-out",HT);const VT=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],KT=ze("menu",VT);const GT=[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]],YT=ze("network",GT);const JT=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],uD=ze("pencil",JT);const XT=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],ff=ze("plus",XT);const WT=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M21 7.5H3",key:"1hm9pq"}],["path",{d:"M21 12H3",key:"2avoz0"}],["path",{d:"M21 16.5H3",key:"n7jzkj"}]],QT=ze("rows-4",WT);const ZT=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],dD=ze("save",ZT);const ej=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],fD=ze("search",ej);const tj=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],hD=ze("settings",tj);const nj=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],aj=ze("square-pen",nj);const ij=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],pc=ze("trash-2",ij);const rj=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],sj=ze("user",rj);const oj=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],lj=ze("users",oj);const cj=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Lo=ze("x",cj);function uj({value:e,onChange:t,options:n,label:i,error:s,className:l,placeholder:c,disabled:d}){const[h,m]=S.useState(!1),y=S.useRef(null);S.useEffect(()=>{if(!h)return;const N=M=>{y.current&&!y.current.contains(M.target)&&m(!1)};return document.addEventListener("mousedown",N),()=>document.removeEventListener("mousedown",N)},[h]);const v=N=>{e.includes(N)?t(e.filter(M=>M!==N)):t([...e,N])},b=N=>{t(e.filter(M=>M!==N))},D=n.filter(N=>e.includes(N.value)),w=f.jsxs(f.Fragment,{children:[f.jsxs("span",{className:he("PaMultiSelect-control",h&&"open"),onClick:()=>!d&&m(!h),onKeyDown:N=>{(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),d||m(!h))},tabIndex:d?-1:0,role:"combobox","aria-expanded":h,"aria-haspopup":"listbox",children:[f.jsx("span",{className:"PaMultiSelect-values",children:D.length>0?D.map(N=>f.jsxs("span",{className:"PaMultiSelect-chip",children:[N.label,f.jsx("button",{type:"button",className:"PaMultiSelect-chipRemove",onClick:M=>{M.stopPropagation(),b(N.value)},"aria-label":`Remove ${N.label}`,children:f.jsx(Lo,{size:12})})]},N.value)):f.jsx("span",{className:"PaMultiSelect-placeholder",children:c})}),f.jsx(Ro,{className:"PaMultiSelect-icon",size:16})]}),h&&f.jsx("span",{className:"PaMultiSelect-dropdown",role:"listbox",children:n.map(N=>f.jsxs("span",{className:he("PaMultiSelect-option",e.includes(N.value)&&"selected",N.disabled&&"disabled"),onClick:()=>!N.disabled&&v(N.value),onKeyDown:M=>{(M.key==="Enter"||M.key===" ")&&(M.preventDefault(),N.disabled||v(N.value))},tabIndex:N.disabled?-1:0,role:"option","aria-selected":e.includes(N.value),children:[f.jsx("span",{className:"PaMultiSelect-checkbox",children:e.includes(N.value)&&"✓"}),N.label]},N.value))})]});return f.jsxs("span",{ref:y,className:he("PaMultiSelect",s&&"error",d&&"disabled",l),children:[i?f.jsxs("label",{className:"PaMultiSelect-wrapper",children:[f.jsx("span",{className:"PaMultiSelect-label",children:i}),w]}):w,s&&f.jsx("span",{className:"PaMultiSelect-error",children:s})]})}function Ip({className:e,label:t,error:n,ref:i,...s}){const[l,c]=S.useState(!1),d=f.jsxs("span",{className:he("PaPasswordInput-inputWrapper",n&&"error"),children:[f.jsx("input",{ref:i,type:l?"text":"password",className:"PaPasswordInput-input",...s}),f.jsx("button",{type:"button",className:"PaPasswordInput-toggle",onClick:()=>c(!l),tabIndex:-1,"aria-label":l?"Hide password":"Show password",children:l?f.jsx(CT,{size:16}):f.jsx(jg,{size:16})})]});return f.jsxs("span",{className:he("PaPasswordInput",e),children:[t?f.jsxs("label",{className:"PaPasswordInput-wrapper",children:[f.jsx("span",{className:"PaPasswordInput-label",children:t}),d]}):d,n&&f.jsx("span",{className:"PaPasswordInput-error",children:n})]})}function _d({checked:e,onChange:t,label:n,className:i,...s}){const l=c=>{t(c.target.checked)};return n?f.jsxs("label",{className:he("PaRadioButton",i),children:[f.jsx("input",{className:"PaRadioButton-input",type:"radio",checked:e,onChange:l,...s}),f.jsx("span",{className:"PaRadioButton-label",children:n})]}):f.jsx("input",{className:he("PaRadioButton-input",i),type:"radio",checked:e,onChange:l,...s})}function Ac({value:e,onChange:t,options:n,label:i,error:s,className:l,fullWidth:c=!1,placeholder:d,...h}){const m=v=>{t(v.target.value)},y=f.jsxs("span",{className:"PaSelect-fieldWrapper",children:[f.jsxs("select",{className:"PaSelect-field",value:e,onChange:m,...h,children:[d&&f.jsx("option",{value:"",disabled:!0,children:d}),n.map(v=>f.jsx("option",{value:v.value,disabled:v.disabled,children:v.label},v.value))]}),f.jsx(Ro,{className:"PaSelect-icon",size:16})]});return f.jsxs("span",{className:he("PaSelect",s&&"error",c&&"fullWidth",l),children:[i?f.jsxs("label",{className:"PaSelect-wrapper",children:[f.jsx("span",{className:"PaSelect-label",children:i}),y]}):y,s&&f.jsx("span",{className:"PaSelect-error",children:s})]})}function dj({checked:e,onChange:t,label:n,className:i,...s}){const l=c=>{t(c.target.checked)};return n?f.jsxs("label",{className:he("PaSwitch",i),children:[f.jsx("input",{className:"PaSwitch-input",type:"checkbox",checked:e,onChange:l,...s}),f.jsx("span",{className:"PaSwitch-track",children:f.jsx("span",{className:"PaSwitch-thumb"})}),f.jsx("span",{className:"PaSwitch-label",children:n})]}):f.jsxs("span",{className:he("PaSwitch",i),children:[f.jsx("input",{className:"PaSwitch-input",type:"checkbox",checked:e,onChange:l,...s}),f.jsx("span",{className:"PaSwitch-track",children:f.jsx("span",{className:"PaSwitch-thumb"})})]})}function hf({className:e,label:t,error:n,ref:i,...s}){const l=f.jsx("textarea",{ref:i,className:he("PaTextarea-field",n&&"error"),...s});return f.jsxs("span",{className:he("PaTextarea",e),children:[t?f.jsxs("label",{className:"PaTextarea-wrapper",children:[f.jsx("span",{className:"PaTextarea-label",children:t}),l]}):l,n&&f.jsx("span",{className:"PaTextarea-error",children:n})]})}function kg({value:e,onChange:t,options:n,className:i,disabled:s}){return f.jsx("fieldset",{className:he("PaToggleGroup",s&&"disabled",i),disabled:s,children:n.map(l=>f.jsx("button",{type:"button",className:he("PaToggleGroup-item",e===l.value&&"active",l.disabled&&"disabled"),onClick:()=>!l.disabled&&t(l.value),disabled:l.disabled,"aria-pressed":e===l.value,children:l.label},l.value))})}const mD=S.createContext(void 0),Qm={autoDismissAlertDurationMs:5e3,autoDismissInsideFeedbackDurationMs:2e3,logger:{error:console.error}};function fj({config:e,children:t}){return f.jsx(mD.Provider,{value:e,children:t})}function $g(){const e=S.useContext(mD);return{autoDismissAlertDurationMs:e?.autoDismissAlertDurationMs??Qm.autoDismissAlertDurationMs,autoDismissInsideFeedbackDurationMs:e?.autoDismissInsideFeedbackDurationMs??Qm.autoDismissInsideFeedbackDurationMs,logger:e?.logger??Qm.logger}}function de(e){const{children:t,className:n,disabled:i,outlined:s,icon:l,severity:c="primary",ref:d,...h}=e,{autoDismissInsideFeedbackDurationMs:m}=$g(),[y,v]=S.useState(!1),[b,D]=S.useState(!1),w=he("PaBtn",c,s&&"outlined",i&&"disabled",b&&"feedback",n),N=S.useCallback(async P=>{if(e.as==="async"){v(!0),D(!1);try{await e.onClick(P),e.insideFeedback&&(D(!0),e.insideFeedback.autoDismiss&&setTimeout(()=>D(!1),m))}catch(E){e.onError?.(E)}finally{v(!1)}}},[e.as,...e.as==="async"?[e.onClick,!!e.insideFeedback,e.insideFeedback?.autoDismiss,e.onError,m]:[]]),M=S.useCallback(P=>{e.as&&e.as!=="button"||(e.onClick&&e.onClick(P),e.insideFeedback&&(D(!0),e.insideFeedback.autoDismiss&&setTimeout(()=>D(!1),m)))},[e.as,e.onClick,...!e.as||e.as==="button"?[!!e.insideFeedback,e.insideFeedback?.autoDismiss,m]:[]]);if(e.as==="a"){const{as:P,...E}=h;return f.jsxs("a",{ref:d,className:w,...E,children:[l&&f.jsx("span",{className:"PaBtn-icon",children:l}),t]})}const{as:A,onClick:T,type:j="button",insideFeedback:F,...z}=h;return f.jsx("button",{ref:d,className:w,disabled:i||y,onClick:A==="async"?N:M,type:j,...z,children:y?f.jsxs(f.Fragment,{children:[f.jsx(cD,{size:16,className:"PaBtn-spinner"}),t]}):b&&F?f.jsxs(f.Fragment,{children:[f.jsx(iD,{size:16,className:"PaBtn-feedbackIcon"}),F.label]}):f.jsxs(f.Fragment,{children:[l&&f.jsx("span",{className:"PaBtn-icon",children:l}),t]})})}function Og(e){const{items:t,className:n,...i}=e,[s,l]=S.useState(!1),c=S.useRef(null),d=e.severity??"primary",h=e.disabled;S.useEffect(()=>{if(!s)return;const y=v=>{c.current&&!c.current.contains(v.target)&&l(!1)};return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[s]);const m=async y=>{try{await y.command()}catch(v){e.as==="async"&&e.onError?e.onError(v):console.error("Error executing SplitButton item command:",v)}finally{l(!1)}};return f.jsxs("div",{ref:c,className:he("PaSplitBtn",d,s&&"open",h&&"disabled",n),children:[f.jsx(de,{...i,className:"PaSplitBtn-main"}),f.jsx("button",{type:"button",className:"PaSplitBtn-toggle",onClick:()=>l(!s),"aria-haspopup":"menu","aria-expanded":s,children:f.jsx(Ro,{className:"PaSplitBtn-toggleIcon"})}),s&&f.jsx("div",{className:"PaSplitBtn-menu",role:"menu",children:t.map(y=>f.jsxs("button",{type:"button",className:he("PaSplitBtn-menuItem",y.danger&&"danger",y.disabled&&"disabled"),onClick:()=>void m(y),role:"menuitem",disabled:y.disabled,children:[y.icon&&f.jsx("span",{className:"PaSplitBtn-menuIcon",children:y.icon}),y.label]},y.label))})]})}function hj({checked:e,onChange:t,children:n,className:i,disabled:s,...l}){return f.jsx("button",{type:"button",className:he("PaToggleBtn",e&&"active",s&&"disabled",i),onClick:()=>!s&&t(!e),disabled:s,"aria-pressed":e,...l,children:n})}function No({children:e,severity:t="info",title:n,className:i,onClose:s}){return f.jsxs("div",{className:he("PaAlert",t,s&&"dismissible",i),children:[s&&f.jsx("button",{type:"button",className:"PaAlert-closeBtn",onClick:s,"aria-label":"Close",children:f.jsx(Lo,{size:16})}),n&&f.jsx("div",{className:"PaAlert-title",children:n}),f.jsx("div",{className:"PaAlert-content",children:e})]})}function So({children:e,severity:t="default",className:n}){return f.jsx("span",{className:he("PaBadge",t,n),children:e})}function pD({children:e,header:t,title:n,subtitle:i,className:s}){const l=t||n||i;return f.jsxs("div",{className:he("PaCard",s),children:[l&&f.jsx("div",{className:"PaCard-header",children:t||f.jsxs(f.Fragment,{children:[n&&f.jsx("h3",{className:"PaCard-title",children:n}),i&&f.jsx("p",{className:"PaCard-subtitle",children:i})]})}),e]})}function zp({label:e,onRemove:t,className:n,removable:i=!0}){return f.jsxs("span",{className:he("PaChip",n),children:[f.jsx("span",{className:"PaChip-label",children:e}),i&&t&&f.jsx("button",{type:"button",className:"PaChip-remove",onClick:t,"aria-label":`Remove ${e}`,children:f.jsx(Lo,{size:12})})]})}function it(e){return null}function ln(){return f.jsx("div",{className:"PaSpinner"})}function Po({value:e,dataKey:t,size:n,loading:i,children:s,className:l,emptyMessage:c="No data available",paginator:d,rows:h=10,totalRecords:m,first:y=0,onPage:v,rowsPerPageOptions:b,sortField:D,sortOrder:w,onSort:N,onRowClick:M,rowClassName:A,totalLabel:T}){const j=[];S.Children.forEach(s,L=>{S.isValidElement(L)&&L.props&&j.push(L.props)});const F=m??e.length,z=Math.ceil(F/h),P=Math.floor(y/h)+1,E=L=>{if(!L||!N)return;N({field:L,order:D===L&&w===1?-1:1})};return f.jsxs("div",{className:he("PaDataTable-wrapper",i&&"loading"),children:[i&&f.jsx("div",{className:"PaDataTable-overlay",children:f.jsx(ln,{})}),f.jsx("div",{className:"PaDataTable-scrollable",children:f.jsxs("table",{className:he("PaDataTable",n,l),children:[f.jsx("thead",{className:"PaDataTable-header",children:f.jsx("tr",{children:j.map((L,_)=>f.jsx("th",{className:he("PaDataTable-headerCell",L.sortable&&"sortable"),style:L.style,onClick:L.sortable?()=>E(L.field):void 0,tabIndex:0,children:f.jsxs("span",{className:"PaDataTable-headerContent",children:[L.header,L.sortable&&f.jsx("span",{className:"PaDataTable-sortIcon",children:L.field===D?w===1?f.jsx(XM,{size:14}):f.jsx(rT,{size:14}):f.jsx(pT,{size:14})})]})},L.field??_))})}),f.jsx("tbody",{children:e.length===0?f.jsx("tr",{className:"PaDataTable-emptyRow",children:f.jsx("td",{colSpan:j.length,className:"PaDataTable-emptyCell",children:c})}):e.map(L=>f.jsx("tr",{className:he("PaDataTable-row",M&&"clickable",A?.(L)),onClick:M?_=>M(L,_):void 0,children:j.map((_,Y)=>f.jsx("td",{className:he("PaDataTable-cell",_.bodyClassName),style:_.style,children:_.body?_.body(L):_.field?String(L[_.field]??""):null},_.field??Y))},String(L[t])))})]})}),d&&v&&z>0&&f.jsxs("div",{className:"PaDataTable-footer",children:[f.jsxs("span",{className:"PaDataTable-totalCount",children:[F," ",T??"items"]}),f.jsxs("div",{className:"PaDataTable-pagination",children:[f.jsx("button",{type:"button",className:"PaDataTable-paginationBtn",disabled:P<=1,onClick:()=>v({first:y-h,rows:h}),children:f.jsx(cT,{size:16})}),f.jsxs("span",{className:"PaDataTable-paginationText",children:["Page ",P," of ",z]}),f.jsx("button",{type:"button",className:"PaDataTable-paginationBtn",disabled:P>=z,onClick:()=>v({first:y+h,rows:h}),children:f.jsx(Ec,{size:16})}),b&&b.length>0&&f.jsx(Ac,{className:"PaDataTable-rowsPerPage",value:String(h),options:b.map(L=>({label:String(L),value:String(L)})),onChange:L=>v({first:0,rows:Number(L)})})]})]})]})}function gD({items:e,separator:t=f.jsx(Ec,{size:12}),className:n}){return f.jsx("nav",{className:he("PaBreadcrumb",n),"aria-label":"Breadcrumb",children:e.map((i,s)=>{const l=s===e.length-1;return f.jsxs("div",{className:"PaBreadcrumb-item",children:[l?f.jsxs("span",{className:"PaBreadcrumb-current",children:[i.icon,i.label]}):i.url?f.jsxs("a",{href:i.url,className:"PaBreadcrumb-link",children:[i.icon,i.label]}):i.onClick?f.jsxs("button",{type:"button",className:"PaBreadcrumb-link",onClick:i.onClick,children:[i.icon,i.label]}):f.jsxs("span",{className:"PaBreadcrumb-link",children:[i.icon,i.label]}),!l&&f.jsx("span",{className:"PaBreadcrumb-separator",children:t})]},`${i.label}:${s}`)})})}const mj=typeof HTMLElement<"u"&&"showPopover"in HTMLElement.prototype;mj||console?.error("PopupMenu: Popover API is not supported in this browser.");let pj=0;function yD(e,t){const n=i=>{if(i.newState==="open"){const l=t();e.style.position="absolute",e.style.top=`${l.top}px`,e.style.left=`${l.left}px`}};return e.addEventListener("toggle",n),()=>e.removeEventListener("toggle",n)}function mf({items:e,className:t,id:n,autoPosition:i=!0,position:s="bottom",children:l,ref:c}){const d=S.useRef(null),h=S.useRef(null),m=S.useRef(void 0);m.current===void 0&&(m.current=n??`pa-popup-menu-${++pj}`);const y=N=>{d.current&&d.current.togglePopover()},v=N=>{d.current&&d.current.showPopover()},b=()=>{d.current&&d.current.hidePopover()};S.useImperativeHandle(c,()=>({toggle:y,show:v,hide:b})),S.useEffect(()=>{if(!i||!d.current||!h.current)return;const N=d.current;return yD(N,()=>{const M=h.current?.getBoundingClientRect();if(!M)return{top:0,left:0};if(s==="top"){const A=N.offsetHeight||150;return{top:M.top+window.scrollY-A-8,left:M.left+window.scrollX}}return{top:M.bottom+window.scrollY,left:M.left+window.scrollX}})},[i,s]);const D={popoverTarget:m.current,popoverTargetAction:"toggle"},w=()=>l&&S.isValidElement(l)?S.cloneElement(l,{ref:h,"aria-controls":m.current,"aria-haspopup":!0,...D}):f.jsx(de,{ref:h,className:he(t,"borderless"),outlined:!0,severity:"secondary","aria-label":"unfold","aria-controls":m.current,"aria-haspopup":!0,...D,children:f.jsx(rD,{size:16})});return f.jsxs(f.Fragment,{children:[w(),f.jsx("div",{className:"PaPopupMenu",ref:d,id:m.current,popover:"auto",children:f.jsx("div",{className:"PaPopupMenu-content",children:e.map(N=>f.jsx(vD,{item:N,onHide:b},N.key))})})]})}function vD({item:e,onHide:t}){const n=S.useRef(null),i=S.useRef(`pa-submenu-${e.key}-${Math.random().toString(36).substring(2,9)}`),s={...e};if(e.subMenu&&e.subMenu.length>0){const l=e.icon;s.icon=l||f.jsx(Ec,{size:14});const c=e.command;s.command=()=>{c&&c()}}else{const l=e.command;s.command=()=>{l&&l(),t()}}return S.useEffect(()=>{if(!n.current||!e.subMenu)return;const l=n.current;return yD(l,()=>{const c=l.parentElement;if(c){const d=c.getBoundingClientRect();return{top:d.top,left:d.right+5}}return{top:0,left:0}})},[e.subMenu]),f.jsxs("div",{className:"PaPopupMenu-item",popoverTargetAction:"toggle",popoverTarget:i.current,children:[f.jsx(Rg,{item:s}),e.subMenu&&f.jsx("div",{className:"PaPopupMenu-submenu",popover:"auto",id:i.current,ref:n,children:e.subMenu.map(l=>f.jsx(vD,{item:l,onHide:t},l.key))})]})}function Rg({item:e,expanded:t,onToggle:n}){let{key:i,label:s,icon:l,url:c,command:d,popupMenu:h,className:m,style:y,active:v,disabled:b}=e;return b&&(c=void 0,d=void 0),f.jsxs("div",{className:he("PaMenuItem",v&&"active",b&&"disabled",m),style:y,children:[t!==void 0&&n?f.jsx("button",{className:"PaMenuItem-left toggle",onClick:()=>n(!t),type:"button",children:t?f.jsx(Ro,{size:14}):f.jsx(Ec,{size:14})}):l?f.jsx("div",{className:"PaMenuItem-left icon",children:l}):void 0,c?f.jsx("a",{className:"PaMenuItem-label",href:c,onClick:c&&d?D=>{D.preventDefault(),d?.()}:void 0,children:s}):d?f.jsx("button",{className:"PaMenuItem-label",onClick:d,type:"button",children:s}):f.jsx("span",{className:"PaMenuItem-label",children:s}),h&&f.jsx(mf,{className:"PaMenuItem-popup",items:h})]},i)}function Lg({children:e,header:t,expanded:n}){const[i,s]=S.useState(n??!1),l=S.useRef(null);return ct(async()=>{const c=l.current;c&&(c.classList.contains("initializing")?(c.classList.remove("initializing"),c.classList.add(i?"show":"hide"),i||(c.style.maxHeight="0")):await gj(c,i))},[i]),f.jsxs("div",{className:"PaAccordion",children:[f.jsx(Rg,{item:t,expanded:i,onToggle:s}),f.jsx("div",{className:"PaAccordion-content initializing",ref:l,children:e})]})}function gj(e,t){if(t){if(e.classList.contains("show"))return Promise.resolve()}else if(e.classList.contains("hide"))return Promise.resolve();return new Promise(n=>{let i=!1;const s=setTimeout(c,300);e.classList.remove("show","hide"),e.classList.add("transition"),e.style.maxHeight=t?"0":`${e.scrollHeight}px`;const l=()=>{clearTimeout(s),c()};e.addEventListener("transitionend",l),requestAnimationFrame(()=>{e.scrollHeight,e.style.maxHeight=t?`${e.scrollHeight}px`:"0"});function c(){i||(i=!0,e.classList.remove("transition"),e.classList.add(t?"show":"hide"),t&&(e.style.maxHeight=""),e.removeEventListener("transitionend",l),n())}})}function gc({menu:e}){return f.jsx(f.Fragment,{children:e.map(t=>f.jsx(bD,{item:t},t.key))})}function bD({item:e}){return e.subMenu?f.jsx(Lg,{header:e,expanded:e.expanded,children:e.subMenu.map(t=>f.jsx(bD,{item:t},t.key))}):f.jsx(Rg,{item:e})}function pf({children:e,value:t,onChange:n,variant:i="default",className:s}){const l=[];return S.Children.forEach(e,c=>{S.isValidElement(c)&&c.props&&l.push(c.props)}),f.jsx("div",{className:he("PaTabs",i,s),role:"tablist",children:l.map(c=>f.jsxs("button",{type:"button",className:he("PaTab",t===c.value&&"active",c.disabled&&"disabled",c.className),onClick:()=>!c.disabled&&n(c.value),disabled:c.disabled,role:"tab","aria-selected":t===c.value,children:[c.icon&&f.jsx("span",{className:"PaTab-icon",children:c.icon}),c.label]},c.value))})}function Co(e){return null}var Zm={exports:{}},Tn={};var MS;function yj(){if(MS)return Tn;MS=1;var e=Cc();function t(h){var m="https://react.dev/errors/"+h;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)m+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+h+"; visit "+m+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var i={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},s=Symbol.for("react.portal");function l(h,m,y){var v=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:v==null?null:""+v,children:h,containerInfo:m,implementation:y}}var c=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(h,m){if(h==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return Tn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,Tn.createPortal=function(h,m){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!m||m.nodeType!==1&&m.nodeType!==9&&m.nodeType!==11)throw Error(t(299));return l(h,m,null,y)},Tn.flushSync=function(h){var m=c.T,y=i.p;try{if(c.T=null,i.p=2,h)return h()}finally{c.T=m,i.p=y,i.d.f()}},Tn.preconnect=function(h,m){typeof h=="string"&&(m?(m=m.crossOrigin,m=typeof m=="string"?m==="use-credentials"?m:"":void 0):m=null,i.d.C(h,m))},Tn.prefetchDNS=function(h){typeof h=="string"&&i.d.D(h)},Tn.preinit=function(h,m){if(typeof h=="string"&&m&&typeof m.as=="string"){var y=m.as,v=d(y,m.crossOrigin),b=typeof m.integrity=="string"?m.integrity:void 0,D=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;y==="style"?i.d.S(h,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:v,integrity:b,fetchPriority:D}):y==="script"&&i.d.X(h,{crossOrigin:v,integrity:b,fetchPriority:D,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},Tn.preinitModule=function(h,m){if(typeof h=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var y=d(m.as,m.crossOrigin);i.d.M(h,{crossOrigin:y,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0})}}else m==null&&i.d.M(h)},Tn.preload=function(h,m){if(typeof h=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var y=m.as,v=d(y,m.crossOrigin);i.d.L(h,y,{crossOrigin:v,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0,type:typeof m.type=="string"?m.type:void 0,fetchPriority:typeof m.fetchPriority=="string"?m.fetchPriority:void 0,referrerPolicy:typeof m.referrerPolicy=="string"?m.referrerPolicy:void 0,imageSrcSet:typeof m.imageSrcSet=="string"?m.imageSrcSet:void 0,imageSizes:typeof m.imageSizes=="string"?m.imageSizes:void 0,media:typeof m.media=="string"?m.media:void 0})}},Tn.preloadModule=function(h,m){if(typeof h=="string")if(m){var y=d(m.as,m.crossOrigin);i.d.m(h,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:y,integrity:typeof m.integrity=="string"?m.integrity:void 0})}else i.d.m(h)},Tn.requestFormReset=function(h){i.d.r(h)},Tn.unstable_batchedUpdates=function(h,m){return h(m)},Tn.useFormState=function(h,m,y){return c.H.useFormState(h,m,y)},Tn.useFormStatus=function(){return c.H.useHostTransitionStatus()},Tn.version="19.2.0",Tn}var TS;function SD(){if(TS)return Zm.exports;TS=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(),Zm.exports=yj(),Zm.exports}var xD=SD();let dd=0;function Pg({visible:e,onHide:t,header:n,footer:i,children:s,className:l,closable:c=!0,modal:d=!0}){const h=S.useRef(void 0);if(S.useEffect(()=>(e&&(h.current=++dd),()=>{h.current!==void 0&&(h.current===dd&&dd--,h.current=void 0)}),[e]),S.useEffect(()=>{if(!e||!c)return;const y=v=>{v.key==="Escape"&&h.current===dd&&t()};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[e,c,t]),S.useEffect(()=>(e?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[e]),!e)return null;const m=f.jsxs("div",{className:"PaDialog-overlay",children:[d&&f.jsx("div",{className:"PaDialog-backdrop",onClick:c?t:void 0}),f.jsxs("div",{className:he("PaDialog",l),role:"dialog","aria-modal":d,children:[(n||c)&&f.jsxs("div",{className:"PaDialog-header",children:[n&&f.jsx("div",{className:"PaDialog-title",children:n}),c&&f.jsx("button",{type:"button",className:"PaDialog-close",onClick:t,"aria-label":"Close",children:f.jsx(Lo,{size:18})})]}),f.jsx("div",{className:"PaDialog-content",children:s}),i&&f.jsx("div",{className:"PaDialog-footer",children:i})]})]});return xD.createPortal(m,document.body)}function gf({content:e,position:t="top",children:n,className:i,delay:s=200}){const[l,c]=S.useState(!1),[d,h]=S.useState({top:0,left:0}),m=S.useRef(null),y=S.useRef(null),v=S.useRef(void 0),b=()=>{v.current=window.setTimeout(()=>{c(!0)},s)},D=()=>{v.current&&clearTimeout(v.current),c(!1)};return S.useEffect(()=>{if(!l||!m.current)return;const N=m.current.getBoundingClientRect();let M=0,A=0;switch(t){case"top":M=N.top-8,A=N.left+N.width/2;break;case"bottom":M=N.bottom+8,A=N.left+N.width/2;break;case"left":M=N.top+N.height/2,A=N.left-8;break;case"right":M=N.top+N.height/2,A=N.right+8;break}h({top:M,left:A})},[l,t]),f.jsxs(f.Fragment,{children:[f.jsx("div",{ref:m,className:"PaTooltip-trigger",onMouseEnter:b,onMouseLeave:D,onFocus:b,onBlur:D,children:n}),l&&f.jsx("div",{ref:y,className:he("PaTooltip",t,i),style:{top:d.top,left:d.left},role:"tooltip",children:e})]})}function wD({value:e,selectionMode:t,selection:n={},onSelectionChange:i,expandedKeys:s={},onExpandedKeysChange:l,nodeTemplate:c,className:d}){const h=S.useCallback(y=>{if(l){const v={...s};v[y]?delete v[y]:v[y]=!0,l(v)}},[s,l]),m=S.useCallback((y,v)=>{if(!(!i||v.selectable===!1)){if(t==="single")i({[y]:!0});else if(t==="checkbox"){const b={...n};b[y]?delete b[y]:b[y]=!0,i(b)}}},[n,t,i]);return f.jsx("div",{className:he("PaTree",d),children:f.jsx("ul",{className:"PaTree-root",children:e.map(y=>f.jsx(DD,{node:y,expandedKeys:s,selection:n,selectionMode:t,onToggleExpand:h,onToggleSelect:m,nodeTemplate:c},y.key))})})}function DD({node:e,expandedKeys:t,selection:n,selectionMode:i,onToggleExpand:s,onToggleSelect:l,nodeTemplate:c}){const d=e.children&&e.children.length>0,h=t[e.key],m=n[e.key];return f.jsxs("li",{className:he("PaTree-node",e.className),children:[f.jsxs("div",{className:he("PaTree-nodeContent",m&&"selected"),children:[d?f.jsx("button",{type:"button",className:"PaTree-toggle",onClick:()=>s(e.key),"aria-label":h?"Collapse":"Expand",children:h?f.jsx(Ro,{size:14}):f.jsx(Ec,{size:14})}):f.jsx("span",{className:"PaTree-togglePlaceholder"}),i==="checkbox"&&f.jsx("input",{type:"checkbox",className:"PaTree-checkbox",checked:m,onChange:()=>l(e.key,e),disabled:e.selectable===!1}),i==="single"&&e.selectable!==!1?f.jsxs("button",{type:"button",className:he("PaTree-labelWrapper","selectable"),onClick:()=>l(e.key,e),children:[e.icon&&f.jsx("span",{className:"PaTree-icon",children:e.icon}),c?c(e):f.jsx("span",{className:"PaTree-label",children:e.label})]}):f.jsxs("div",{className:"PaTree-labelWrapper",children:[e.icon&&f.jsx("span",{className:"PaTree-icon",children:e.icon}),c?c(e):f.jsx("span",{className:"PaTree-label",children:e.label})]})]}),d&&h&&f.jsx("ul",{className:"PaTree-children",children:e.children?.map(y=>f.jsx(DD,{node:y,expandedKeys:t,selection:n,selectionMode:i,onToggleExpand:s,onToggleSelect:l,nodeTemplate:c},y.key))})]})}var ep={exports:{}};function jS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,i)}return n}function oi(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?jS(Object(n),!0).forEach(function(i){vj(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jS(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function Ad(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ad=function(t){return typeof t}:Ad=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ad(e)}function vj(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $a(){return $a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},$a.apply(this,arguments)}function bj(e,t){if(e==null)return{};var n={},i=Object.keys(e),s,l;for(l=0;l<i.length;l++)s=i[l],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}function Sj(e,t){if(e==null)return{};var n=bj(e,t),i,s;if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(s=0;s<l.length;s++)i=l[s],!(t.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function xj(e){return wj(e)||Dj(e)||Nj(e)||Cj()}function wj(e){if(Array.isArray(e))return _p(e)}function Dj(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Nj(e,t){if(e){if(typeof e=="string")return _p(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _p(e,t)}}function _p(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function Cj(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
2
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var Ej="1.15.6";function Oi(e){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(e)}var _i=Oi(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Mc=Oi(/Edge/i),kS=Oi(/firefox/i),ic=Oi(/safari/i)&&!Oi(/chrome/i)&&!Oi(/android/i),Ig=Oi(/iP(ad|od|hone)/i),ND=Oi(/chrome/i)&&Oi(/android/i),CD={capture:!1,passive:!1};function Ke(e,t,n){e.addEventListener(t,n,!_i&&CD)}function Ve(e,t,n){e.removeEventListener(t,n,!_i&&CD)}function Ud(e,t){if(t){if(t[0]===">"&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch{return!1}return!1}}function ED(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function ta(e,t,n,i){if(e){n=n||document;do{if(t!=null&&(t[0]===">"?e.parentNode===n&&Ud(e,t):Ud(e,t))||i&&e===n)return e;if(e===n)break}while(e=ED(e))}return null}var $S=/\s+/g;function zt(e,t,n){if(e&&t)if(e.classList)e.classList[n?"add":"remove"](t);else{var i=(" "+e.className+" ").replace($S," ").replace(" "+t+" "," ");e.className=(i+(n?" "+t:"")).replace($S," ")}}function Ce(e,t,n){var i=e&&e.style;if(i){if(n===void 0)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(n=e.currentStyle),t===void 0?n:n[t];!(t in i)&&t.indexOf("webkit")===-1&&(t="-webkit-"+t),i[t]=n+(typeof n=="string"?"":"px")}}function us(e,t){var n="";if(typeof e=="string")n=e;else do{var i=Ce(e,"transform");i&&i!=="none"&&(n=i+" "+n)}while(!t&&(e=e.parentNode));var s=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return s&&new s(n)}function AD(e,t,n){if(e){var i=e.getElementsByTagName(t),s=0,l=i.length;if(n)for(;s<l;s++)n(i[s],s);return i}return[]}function ri(){var e=document.scrollingElement;return e||document.documentElement}function kt(e,t,n,i,s){if(!(!e.getBoundingClientRect&&e!==window)){var l,c,d,h,m,y,v;if(e!==window&&e.parentNode&&e!==ri()?(l=e.getBoundingClientRect(),c=l.top,d=l.left,h=l.bottom,m=l.right,y=l.height,v=l.width):(c=0,d=0,h=window.innerHeight,m=window.innerWidth,y=window.innerHeight,v=window.innerWidth),(t||n)&&e!==window&&(s=s||e.parentNode,!_i))do if(s&&s.getBoundingClientRect&&(Ce(s,"transform")!=="none"||n&&Ce(s,"position")!=="static")){var b=s.getBoundingClientRect();c-=b.top+parseInt(Ce(s,"border-top-width")),d-=b.left+parseInt(Ce(s,"border-left-width")),h=c+l.height,m=d+l.width;break}while(s=s.parentNode);if(i&&e!==window){var D=us(s||e),w=D&&D.a,N=D&&D.d;D&&(c/=N,d/=w,v/=w,y/=N,h=c+y,m=d+v)}return{top:c,left:d,bottom:h,right:m,width:v,height:y}}}function OS(e,t,n){for(var i=wr(e,!0),s=kt(e)[t];i;){var l=kt(i)[n],c=void 0;if(c=s>=l,!c)return i;if(i===ri())break;i=wr(i,!1)}return!1}function Eo(e,t,n,i){for(var s=0,l=0,c=e.children;l<c.length;){if(c[l].style.display!=="none"&&c[l]!==Le.ghost&&(i||c[l]!==Le.dragged)&&ta(c[l],n.draggable,e,!1)){if(s===t)return c[l];s++}l++}return null}function zg(e,t){for(var n=e.lastElementChild;n&&(n===Le.ghost||Ce(n,"display")==="none"||t&&!Ud(n,t));)n=n.previousElementSibling;return n||null}function Vt(e,t){var n=0;if(!e||!e.parentNode)return-1;for(;e=e.previousElementSibling;)e.nodeName.toUpperCase()!=="TEMPLATE"&&e!==Le.clone&&(!t||Ud(e,t))&&n++;return n}function RS(e){var t=0,n=0,i=ri();if(e)do{var s=us(e),l=s.a,c=s.d;t+=e.scrollLeft*l,n+=e.scrollTop*c}while(e!==i&&(e=e.parentNode));return[t,n]}function Aj(e,t){for(var n in e)if(e.hasOwnProperty(n)){for(var i in t)if(t.hasOwnProperty(i)&&t[i]===e[n][i])return Number(n)}return-1}function wr(e,t){if(!e||!e.getBoundingClientRect)return ri();var n=e,i=!1;do if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var s=Ce(n);if(n.clientWidth<n.scrollWidth&&(s.overflowX=="auto"||s.overflowX=="scroll")||n.clientHeight<n.scrollHeight&&(s.overflowY=="auto"||s.overflowY=="scroll")){if(!n.getBoundingClientRect||n===document.body)return ri();if(i||t)return n;i=!0}}while(n=n.parentNode);return ri()}function Mj(e,t){if(e&&t)for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function tp(e,t){return Math.round(e.top)===Math.round(t.top)&&Math.round(e.left)===Math.round(t.left)&&Math.round(e.height)===Math.round(t.height)&&Math.round(e.width)===Math.round(t.width)}var rc;function MD(e,t){return function(){if(!rc){var n=arguments,i=this;n.length===1?e.call(i,n[0]):e.apply(i,n),rc=setTimeout(function(){rc=void 0},t)}}}function Tj(){clearTimeout(rc),rc=void 0}function TD(e,t,n){e.scrollLeft+=t,e.scrollTop+=n}function _g(e){var t=window.Polymer,n=window.jQuery||window.Zepto;return t&&t.dom?t.dom(e).cloneNode(!0):n?n(e).clone(!0)[0]:e.cloneNode(!0)}function LS(e,t){Ce(e,"position","absolute"),Ce(e,"top",t.top),Ce(e,"left",t.left),Ce(e,"width",t.width),Ce(e,"height",t.height)}function np(e){Ce(e,"position",""),Ce(e,"top",""),Ce(e,"left",""),Ce(e,"width",""),Ce(e,"height","")}function jD(e,t,n){var i={};return Array.from(e.children).forEach(function(s){var l,c,d,h;if(!(!ta(s,t.draggable,e,!1)||s.animated||s===n)){var m=kt(s);i.left=Math.min((l=i.left)!==null&&l!==void 0?l:1/0,m.left),i.top=Math.min((c=i.top)!==null&&c!==void 0?c:1/0,m.top),i.right=Math.max((d=i.right)!==null&&d!==void 0?d:-1/0,m.right),i.bottom=Math.max((h=i.bottom)!==null&&h!==void 0?h:-1/0,m.bottom)}}),i.width=i.right-i.left,i.height=i.bottom-i.top,i.x=i.left,i.y=i.top,i}var Nn="Sortable"+new Date().getTime();function jj(){var e=[],t;return{captureAnimationState:function(){if(e=[],!!this.options.animation){var i=[].slice.call(this.el.children);i.forEach(function(s){if(!(Ce(s,"display")==="none"||s===Le.ghost)){e.push({target:s,rect:kt(s)});var l=oi({},e[e.length-1].rect);if(s.thisAnimationDuration){var c=us(s,!0);c&&(l.top-=c.f,l.left-=c.e)}s.fromRect=l}})}},addAnimationState:function(i){e.push(i)},removeAnimationState:function(i){e.splice(Aj(e,{target:i}),1)},animateAll:function(i){var s=this;if(!this.options.animation){clearTimeout(t),typeof i=="function"&&i();return}var l=!1,c=0;e.forEach(function(d){var h=0,m=d.target,y=m.fromRect,v=kt(m),b=m.prevFromRect,D=m.prevToRect,w=d.rect,N=us(m,!0);N&&(v.top-=N.f,v.left-=N.e),m.toRect=v,m.thisAnimationDuration&&tp(b,v)&&!tp(y,v)&&(w.top-v.top)/(w.left-v.left)===(y.top-v.top)/(y.left-v.left)&&(h=$j(w,b,D,s.options)),tp(v,y)||(m.prevFromRect=y,m.prevToRect=v,h||(h=s.options.animation),s.animate(m,w,v,h)),h&&(l=!0,c=Math.max(c,h),clearTimeout(m.animationResetTimer),m.animationResetTimer=setTimeout(function(){m.animationTime=0,m.prevFromRect=null,m.fromRect=null,m.prevToRect=null,m.thisAnimationDuration=null},h),m.thisAnimationDuration=h)}),clearTimeout(t),l?t=setTimeout(function(){typeof i=="function"&&i()},c):typeof i=="function"&&i(),e=[]},animate:function(i,s,l,c){if(c){Ce(i,"transition",""),Ce(i,"transform","");var d=us(this.el),h=d&&d.a,m=d&&d.d,y=(s.left-l.left)/(h||1),v=(s.top-l.top)/(m||1);i.animatingX=!!y,i.animatingY=!!v,Ce(i,"transform","translate3d("+y+"px,"+v+"px,0)"),this.forRepaintDummy=kj(i),Ce(i,"transition","transform "+c+"ms"+(this.options.easing?" "+this.options.easing:"")),Ce(i,"transform","translate3d(0,0,0)"),typeof i.animated=="number"&&clearTimeout(i.animated),i.animated=setTimeout(function(){Ce(i,"transition",""),Ce(i,"transform",""),i.animated=!1,i.animatingX=!1,i.animatingY=!1},c)}}}}function kj(e){return e.offsetWidth}function $j(e,t,n,i){return Math.sqrt(Math.pow(t.top-e.top,2)+Math.pow(t.left-e.left,2))/Math.sqrt(Math.pow(t.top-n.top,2)+Math.pow(t.left-n.left,2))*i.animation}var io=[],ap={initializeByDefault:!0},Tc={mount:function(t){for(var n in ap)ap.hasOwnProperty(n)&&!(n in t)&&(t[n]=ap[n]);io.forEach(function(i){if(i.pluginName===t.pluginName)throw"Sortable: Cannot mount plugin ".concat(t.pluginName," more than once")}),io.push(t)},pluginEvent:function(t,n,i){var s=this;this.eventCanceled=!1,i.cancel=function(){s.eventCanceled=!0};var l=t+"Global";io.forEach(function(c){n[c.pluginName]&&(n[c.pluginName][l]&&n[c.pluginName][l](oi({sortable:n},i)),n.options[c.pluginName]&&n[c.pluginName][t]&&n[c.pluginName][t](oi({sortable:n},i)))})},initializePlugins:function(t,n,i,s){io.forEach(function(d){var h=d.pluginName;if(!(!t.options[h]&&!d.initializeByDefault)){var m=new d(t,n,t.options);m.sortable=t,m.options=t.options,t[h]=m,$a(i,m.defaults)}});for(var l in t.options)if(t.options.hasOwnProperty(l)){var c=this.modifyOption(t,l,t.options[l]);typeof c<"u"&&(t.options[l]=c)}},getEventProperties:function(t,n){var i={};return io.forEach(function(s){typeof s.eventProperties=="function"&&$a(i,s.eventProperties.call(n[s.pluginName],t))}),i},modifyOption:function(t,n,i){var s;return io.forEach(function(l){t[l.pluginName]&&l.optionListeners&&typeof l.optionListeners[n]=="function"&&(s=l.optionListeners[n].call(t[l.pluginName],i))}),s}};function Xl(e){var t=e.sortable,n=e.rootEl,i=e.name,s=e.targetEl,l=e.cloneEl,c=e.toEl,d=e.fromEl,h=e.oldIndex,m=e.newIndex,y=e.oldDraggableIndex,v=e.newDraggableIndex,b=e.originalEvent,D=e.putSortable,w=e.extraEventProperties;if(t=t||n&&n[Nn],!!t){var N,M=t.options,A="on"+i.charAt(0).toUpperCase()+i.substr(1);window.CustomEvent&&!_i&&!Mc?N=new CustomEvent(i,{bubbles:!0,cancelable:!0}):(N=document.createEvent("Event"),N.initEvent(i,!0,!0)),N.to=c||n,N.from=d||n,N.item=s||n,N.clone=l,N.oldIndex=h,N.newIndex=m,N.oldDraggableIndex=y,N.newDraggableIndex=v,N.originalEvent=b,N.pullMode=D?D.lastPutMode:void 0;var T=oi(oi({},w),Tc.getEventProperties(i,t));for(var j in T)N[j]=T[j];n&&n.dispatchEvent(N),M[A]&&M[A].call(t,N)}}var Oj=["evt"],Qn=function(t,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=i.evt,l=Sj(i,Oj);Tc.pluginEvent.bind(Le)(t,n,oi({dragEl:fe,parentEl:qt,ghostEl:Be,rootEl:Lt,nextEl:rs,lastDownEl:Md,cloneEl:It,cloneHidden:vr,dragStarted:Wl,putSortable:Dn,activeSortable:Le.active,originalEvent:s,oldIndex:go,oldDraggableIndex:sc,newIndex:ha,newDraggableIndex:gr,hideGhostForTarget:RD,unhideGhostForTarget:LD,cloneNowHidden:function(){vr=!0},cloneNowShown:function(){vr=!1},dispatchSortableEvent:function(d){In({sortable:n,name:d,originalEvent:s})}},l))};function In(e){Xl(oi({putSortable:Dn,cloneEl:It,targetEl:fe,rootEl:Lt,oldIndex:go,oldDraggableIndex:sc,newIndex:ha,newDraggableIndex:gr},e))}var fe,qt,Be,Lt,rs,Md,It,vr,go,ha,sc,gr,fd,Dn,fo=!1,Bd=!1,Fd=[],ns,Fa,ip,rp,PS,IS,Wl,ro,oc,lc=!1,hd=!1,Td,jn,sp=[],Up=!1,Hd=[],yf=typeof document<"u",md=Ig,zS=Mc||_i?"cssFloat":"float",Rj=yf&&!ND&&!Ig&&"draggable"in document.createElement("div"),kD=(function(){if(yf){if(_i)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto",e.style.pointerEvents==="auto"}})(),$D=function(t,n){var i=Ce(t),s=parseInt(i.width)-parseInt(i.paddingLeft)-parseInt(i.paddingRight)-parseInt(i.borderLeftWidth)-parseInt(i.borderRightWidth),l=Eo(t,0,n),c=Eo(t,1,n),d=l&&Ce(l),h=c&&Ce(c),m=d&&parseInt(d.marginLeft)+parseInt(d.marginRight)+kt(l).width,y=h&&parseInt(h.marginLeft)+parseInt(h.marginRight)+kt(c).width;if(i.display==="flex")return i.flexDirection==="column"||i.flexDirection==="column-reverse"?"vertical":"horizontal";if(i.display==="grid")return i.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(l&&d.float&&d.float!=="none"){var v=d.float==="left"?"left":"right";return c&&(h.clear==="both"||h.clear===v)?"vertical":"horizontal"}return l&&(d.display==="block"||d.display==="flex"||d.display==="table"||d.display==="grid"||m>=s&&i[zS]==="none"||c&&i[zS]==="none"&&m+y>s)?"vertical":"horizontal"},Lj=function(t,n,i){var s=i?t.left:t.top,l=i?t.right:t.bottom,c=i?t.width:t.height,d=i?n.left:n.top,h=i?n.right:n.bottom,m=i?n.width:n.height;return s===d||l===h||s+c/2===d+m/2},Pj=function(t,n){var i;return Fd.some(function(s){var l=s[Nn].options.emptyInsertThreshold;if(!(!l||zg(s))){var c=kt(s),d=t>=c.left-l&&t<=c.right+l,h=n>=c.top-l&&n<=c.bottom+l;if(d&&h)return i=s}}),i},OD=function(t){function n(l,c){return function(d,h,m,y){var v=d.options.group.name&&h.options.group.name&&d.options.group.name===h.options.group.name;if(l==null&&(c||v))return!0;if(l==null||l===!1)return!1;if(c&&l==="clone")return l;if(typeof l=="function")return n(l(d,h,m,y),c)(d,h,m,y);var b=(c?d:h).options.group.name;return l===!0||typeof l=="string"&&l===b||l.join&&l.indexOf(b)>-1}}var i={},s=t.group;(!s||Ad(s)!="object")&&(s={name:s}),i.name=s.name,i.checkPull=n(s.pull,!0),i.checkPut=n(s.put),i.revertClone=s.revertClone,t.group=i},RD=function(){!kD&&Be&&Ce(Be,"display","none")},LD=function(){!kD&&Be&&Ce(Be,"display","")};yf&&!ND&&document.addEventListener("click",function(e){if(Bd)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),Bd=!1,!1},!0);var as=function(t){if(fe){t=t.touches?t.touches[0]:t;var n=Pj(t.clientX,t.clientY);if(n){var i={};for(var s in t)t.hasOwnProperty(s)&&(i[s]=t[s]);i.target=i.rootEl=n,i.preventDefault=void 0,i.stopPropagation=void 0,n[Nn]._onDragOver(i)}}},Ij=function(t){fe&&fe.parentNode[Nn]._isOutsideThisEl(t.target)};function Le(e,t){if(!(e&&e.nodeType&&e.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));this.el=e,this.options=t=$a({},t),e[Nn]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return $D(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(c,d){c.setData("Text",d.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:Le.supportPointer!==!1&&"PointerEvent"in window&&(!ic||Ig),emptyInsertThreshold:5};Tc.initializePlugins(this,e,n);for(var i in n)!(i in t)&&(t[i]=n[i]);OD(t);for(var s in this)s.charAt(0)==="_"&&typeof this[s]=="function"&&(this[s]=this[s].bind(this));this.nativeDraggable=t.forceFallback?!1:Rj,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?Ke(e,"pointerdown",this._onTapStart):(Ke(e,"mousedown",this._onTapStart),Ke(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(Ke(e,"dragover",this),Ke(e,"dragenter",this)),Fd.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),$a(this,jj())}Le.prototype={constructor:Le,_isOutsideThisEl:function(t){!this.el.contains(t)&&t!==this.el&&(ro=null)},_getDirection:function(t,n){return typeof this.options.direction=="function"?this.options.direction.call(this,t,n,fe):this.options.direction},_onTapStart:function(t){if(t.cancelable){var n=this,i=this.el,s=this.options,l=s.preventOnFilter,c=t.type,d=t.touches&&t.touches[0]||t.pointerType&&t.pointerType==="touch"&&t,h=(d||t).target,m=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||h,y=s.filter;if(Vj(i),!fe&&!(/mousedown|pointerdown/.test(c)&&t.button!==0||s.disabled)&&!m.isContentEditable&&!(!this.nativeDraggable&&ic&&h&&h.tagName.toUpperCase()==="SELECT")&&(h=ta(h,s.draggable,i,!1),!(h&&h.animated)&&Md!==h)){if(go=Vt(h),sc=Vt(h,s.draggable),typeof y=="function"){if(y.call(this,t,h,this)){In({sortable:n,rootEl:m,name:"filter",targetEl:h,toEl:i,fromEl:i}),Qn("filter",n,{evt:t}),l&&t.preventDefault();return}}else if(y&&(y=y.split(",").some(function(v){if(v=ta(m,v.trim(),i,!1),v)return In({sortable:n,rootEl:v,name:"filter",targetEl:h,fromEl:i,toEl:i}),Qn("filter",n,{evt:t}),!0}),y)){l&&t.preventDefault();return}s.handle&&!ta(m,s.handle,i,!1)||this._prepareDragStart(t,d,h)}}},_prepareDragStart:function(t,n,i){var s=this,l=s.el,c=s.options,d=l.ownerDocument,h;if(i&&!fe&&i.parentNode===l){var m=kt(i);if(Lt=l,fe=i,qt=fe.parentNode,rs=fe.nextSibling,Md=i,fd=c.group,Le.dragged=fe,ns={target:fe,clientX:(n||t).clientX,clientY:(n||t).clientY},PS=ns.clientX-m.left,IS=ns.clientY-m.top,this._lastX=(n||t).clientX,this._lastY=(n||t).clientY,fe.style["will-change"]="all",h=function(){if(Qn("delayEnded",s,{evt:t}),Le.eventCanceled){s._onDrop();return}s._disableDelayedDragEvents(),!kS&&s.nativeDraggable&&(fe.draggable=!0),s._triggerDragStart(t,n),In({sortable:s,name:"choose",originalEvent:t}),zt(fe,c.chosenClass,!0)},c.ignore.split(",").forEach(function(y){AD(fe,y.trim(),op)}),Ke(d,"dragover",as),Ke(d,"mousemove",as),Ke(d,"touchmove",as),c.supportPointer?(Ke(d,"pointerup",s._onDrop),!this.nativeDraggable&&Ke(d,"pointercancel",s._onDrop)):(Ke(d,"mouseup",s._onDrop),Ke(d,"touchend",s._onDrop),Ke(d,"touchcancel",s._onDrop)),kS&&this.nativeDraggable&&(this.options.touchStartThreshold=4,fe.draggable=!0),Qn("delayStart",this,{evt:t}),c.delay&&(!c.delayOnTouchOnly||n)&&(!this.nativeDraggable||!(Mc||_i))){if(Le.eventCanceled){this._onDrop();return}c.supportPointer?(Ke(d,"pointerup",s._disableDelayedDrag),Ke(d,"pointercancel",s._disableDelayedDrag)):(Ke(d,"mouseup",s._disableDelayedDrag),Ke(d,"touchend",s._disableDelayedDrag),Ke(d,"touchcancel",s._disableDelayedDrag)),Ke(d,"mousemove",s._delayedDragTouchMoveHandler),Ke(d,"touchmove",s._delayedDragTouchMoveHandler),c.supportPointer&&Ke(d,"pointermove",s._delayedDragTouchMoveHandler),s._dragStartTimer=setTimeout(h,c.delay)}else h()}},_delayedDragTouchMoveHandler:function(t){var n=t.touches?t.touches[0]:t;Math.max(Math.abs(n.clientX-this._lastX),Math.abs(n.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){fe&&op(fe),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;Ve(t,"mouseup",this._disableDelayedDrag),Ve(t,"touchend",this._disableDelayedDrag),Ve(t,"touchcancel",this._disableDelayedDrag),Ve(t,"pointerup",this._disableDelayedDrag),Ve(t,"pointercancel",this._disableDelayedDrag),Ve(t,"mousemove",this._delayedDragTouchMoveHandler),Ve(t,"touchmove",this._delayedDragTouchMoveHandler),Ve(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,n){n=n||t.pointerType=="touch"&&t,!this.nativeDraggable||n?this.options.supportPointer?Ke(document,"pointermove",this._onTouchMove):n?Ke(document,"touchmove",this._onTouchMove):Ke(document,"mousemove",this._onTouchMove):(Ke(fe,"dragend",this),Ke(Lt,"dragstart",this._onDragStart));try{document.selection?jd(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(t,n){if(fo=!1,Lt&&fe){Qn("dragStarted",this,{evt:n}),this.nativeDraggable&&Ke(document,"dragover",Ij);var i=this.options;!t&&zt(fe,i.dragClass,!1),zt(fe,i.ghostClass,!0),Le.active=this,t&&this._appendGhost(),In({sortable:this,name:"start",originalEvent:n})}else this._nulling()},_emulateDragOver:function(){if(Fa){this._lastX=Fa.clientX,this._lastY=Fa.clientY,RD();for(var t=document.elementFromPoint(Fa.clientX,Fa.clientY),n=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(Fa.clientX,Fa.clientY),t!==n);)n=t;if(fe.parentNode[Nn]._isOutsideThisEl(t),n)do{if(n[Nn]){var i=void 0;if(i=n[Nn]._onDragOver({clientX:Fa.clientX,clientY:Fa.clientY,target:t,rootEl:n}),i&&!this.options.dragoverBubble)break}t=n}while(n=ED(n));LD()}},_onTouchMove:function(t){if(ns){var n=this.options,i=n.fallbackTolerance,s=n.fallbackOffset,l=t.touches?t.touches[0]:t,c=Be&&us(Be,!0),d=Be&&c&&c.a,h=Be&&c&&c.d,m=md&&jn&&RS(jn),y=(l.clientX-ns.clientX+s.x)/(d||1)+(m?m[0]-sp[0]:0)/(d||1),v=(l.clientY-ns.clientY+s.y)/(h||1)+(m?m[1]-sp[1]:0)/(h||1);if(!Le.active&&!fo){if(i&&Math.max(Math.abs(l.clientX-this._lastX),Math.abs(l.clientY-this._lastY))<i)return;this._onDragStart(t,!0)}if(Be){c?(c.e+=y-(ip||0),c.f+=v-(rp||0)):c={a:1,b:0,c:0,d:1,e:y,f:v};var b="matrix(".concat(c.a,",").concat(c.b,",").concat(c.c,",").concat(c.d,",").concat(c.e,",").concat(c.f,")");Ce(Be,"webkitTransform",b),Ce(Be,"mozTransform",b),Ce(Be,"msTransform",b),Ce(Be,"transform",b),ip=y,rp=v,Fa=l}t.cancelable&&t.preventDefault()}},_appendGhost:function(){if(!Be){var t=this.options.fallbackOnBody?document.body:Lt,n=kt(fe,!0,md,!0,t),i=this.options;if(md){for(jn=t;Ce(jn,"position")==="static"&&Ce(jn,"transform")==="none"&&jn!==document;)jn=jn.parentNode;jn!==document.body&&jn!==document.documentElement?(jn===document&&(jn=ri()),n.top+=jn.scrollTop,n.left+=jn.scrollLeft):jn=ri(),sp=RS(jn)}Be=fe.cloneNode(!0),zt(Be,i.ghostClass,!1),zt(Be,i.fallbackClass,!0),zt(Be,i.dragClass,!0),Ce(Be,"transition",""),Ce(Be,"transform",""),Ce(Be,"box-sizing","border-box"),Ce(Be,"margin",0),Ce(Be,"top",n.top),Ce(Be,"left",n.left),Ce(Be,"width",n.width),Ce(Be,"height",n.height),Ce(Be,"opacity","0.8"),Ce(Be,"position",md?"absolute":"fixed"),Ce(Be,"zIndex","100000"),Ce(Be,"pointerEvents","none"),Le.ghost=Be,t.appendChild(Be),Ce(Be,"transform-origin",PS/parseInt(Be.style.width)*100+"% "+IS/parseInt(Be.style.height)*100+"%")}},_onDragStart:function(t,n){var i=this,s=t.dataTransfer,l=i.options;if(Qn("dragStart",this,{evt:t}),Le.eventCanceled){this._onDrop();return}Qn("setupClone",this),Le.eventCanceled||(It=_g(fe),It.removeAttribute("id"),It.draggable=!1,It.style["will-change"]="",this._hideClone(),zt(It,this.options.chosenClass,!1),Le.clone=It),i.cloneId=jd(function(){Qn("clone",i),!Le.eventCanceled&&(i.options.removeCloneOnHide||Lt.insertBefore(It,fe),i._hideClone(),In({sortable:i,name:"clone"}))}),!n&&zt(fe,l.dragClass,!0),n?(Bd=!0,i._loopId=setInterval(i._emulateDragOver,50)):(Ve(document,"mouseup",i._onDrop),Ve(document,"touchend",i._onDrop),Ve(document,"touchcancel",i._onDrop),s&&(s.effectAllowed="move",l.setData&&l.setData.call(i,s,fe)),Ke(document,"drop",i),Ce(fe,"transform","translateZ(0)")),fo=!0,i._dragStartId=jd(i._dragStarted.bind(i,n,t)),Ke(document,"selectstart",i),Wl=!0,window.getSelection().removeAllRanges(),ic&&Ce(document.body,"user-select","none")},_onDragOver:function(t){var n=this.el,i=t.target,s,l,c,d=this.options,h=d.group,m=Le.active,y=fd===h,v=d.sort,b=Dn||m,D,w=this,N=!1;if(Up)return;function M(se,ye){Qn(se,w,oi({evt:t,isOwner:y,axis:D?"vertical":"horizontal",revert:c,dragRect:s,targetRect:l,canSort:v,fromSortable:b,target:i,completed:T,onMove:function(k,J){return pd(Lt,n,fe,s,k,kt(k),t,J)},changed:j},ye))}function A(){M("dragOverAnimationCapture"),w.captureAnimationState(),w!==b&&b.captureAnimationState()}function T(se){return M("dragOverCompleted",{insertion:se}),se&&(y?m._hideClone():m._showClone(w),w!==b&&(zt(fe,Dn?Dn.options.ghostClass:m.options.ghostClass,!1),zt(fe,d.ghostClass,!0)),Dn!==w&&w!==Le.active?Dn=w:w===Le.active&&Dn&&(Dn=null),b===w&&(w._ignoreWhileAnimating=i),w.animateAll(function(){M("dragOverAnimationComplete"),w._ignoreWhileAnimating=null}),w!==b&&(b.animateAll(),b._ignoreWhileAnimating=null)),(i===fe&&!fe.animated||i===n&&!i.animated)&&(ro=null),!d.dragoverBubble&&!t.rootEl&&i!==document&&(fe.parentNode[Nn]._isOutsideThisEl(t.target),!se&&as(t)),!d.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),N=!0}function j(){ha=Vt(fe),gr=Vt(fe,d.draggable),In({sortable:w,name:"change",toEl:n,newIndex:ha,newDraggableIndex:gr,originalEvent:t})}if(t.preventDefault!==void 0&&t.cancelable&&t.preventDefault(),i=ta(i,d.draggable,n,!0),M("dragOver"),Le.eventCanceled)return N;if(fe.contains(t.target)||i.animated&&i.animatingX&&i.animatingY||w._ignoreWhileAnimating===i)return T(!1);if(Bd=!1,m&&!d.disabled&&(y?v||(c=qt!==Lt):Dn===this||(this.lastPutMode=fd.checkPull(this,m,fe,t))&&h.checkPut(this,m,fe,t))){if(D=this._getDirection(t,i)==="vertical",s=kt(fe),M("dragOverValid"),Le.eventCanceled)return N;if(c)return qt=Lt,A(),this._hideClone(),M("revert"),Le.eventCanceled||(rs?Lt.insertBefore(fe,rs):Lt.appendChild(fe)),T(!0);var F=zg(n,d.draggable);if(!F||Bj(t,D,this)&&!F.animated){if(F===fe)return T(!1);if(F&&n===t.target&&(i=F),i&&(l=kt(i)),pd(Lt,n,fe,s,i,l,t,!!i)!==!1)return A(),F&&F.nextSibling?n.insertBefore(fe,F.nextSibling):n.appendChild(fe),qt=n,j(),T(!0)}else if(F&&Uj(t,D,this)){var z=Eo(n,0,d,!0);if(z===fe)return T(!1);if(i=z,l=kt(i),pd(Lt,n,fe,s,i,l,t,!1)!==!1)return A(),n.insertBefore(fe,z),qt=n,j(),T(!0)}else if(i.parentNode===n){l=kt(i);var P=0,E,L=fe.parentNode!==n,_=!Lj(fe.animated&&fe.toRect||s,i.animated&&i.toRect||l,D),Y=D?"top":"left",Z=OS(i,"top","top")||OS(fe,"top","top"),U=Z?Z.scrollTop:void 0;ro!==i&&(E=l[Y],lc=!1,hd=!_&&d.invertSwap||L),P=Fj(t,i,l,D,_?1:d.swapThreshold,d.invertedSwapThreshold==null?d.swapThreshold:d.invertedSwapThreshold,hd,ro===i);var ae;if(P!==0){var Q=Vt(fe);do Q-=P,ae=qt.children[Q];while(ae&&(Ce(ae,"display")==="none"||ae===Be))}if(P===0||ae===i)return T(!1);ro=i,oc=P;var ie=i.nextElementSibling,R=!1;R=P===1;var W=pd(Lt,n,fe,s,i,l,t,R);if(W!==!1)return(W===1||W===-1)&&(R=W===1),Up=!0,setTimeout(_j,30),A(),R&&!ie?n.appendChild(fe):i.parentNode.insertBefore(fe,R?ie:i),Z&&TD(Z,0,U-Z.scrollTop),qt=fe.parentNode,E!==void 0&&!hd&&(Td=Math.abs(E-kt(i)[Y])),j(),T(!0)}if(n.contains(fe))return T(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){Ve(document,"mousemove",this._onTouchMove),Ve(document,"touchmove",this._onTouchMove),Ve(document,"pointermove",this._onTouchMove),Ve(document,"dragover",as),Ve(document,"mousemove",as),Ve(document,"touchmove",as)},_offUpEvents:function(){var t=this.el.ownerDocument;Ve(t,"mouseup",this._onDrop),Ve(t,"touchend",this._onDrop),Ve(t,"pointerup",this._onDrop),Ve(t,"pointercancel",this._onDrop),Ve(t,"touchcancel",this._onDrop),Ve(document,"selectstart",this)},_onDrop:function(t){var n=this.el,i=this.options;if(ha=Vt(fe),gr=Vt(fe,i.draggable),Qn("drop",this,{evt:t}),qt=fe&&fe.parentNode,ha=Vt(fe),gr=Vt(fe,i.draggable),Le.eventCanceled){this._nulling();return}fo=!1,hd=!1,lc=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),Bp(this.cloneId),Bp(this._dragStartId),this.nativeDraggable&&(Ve(document,"drop",this),Ve(n,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),ic&&Ce(document.body,"user-select",""),Ce(fe,"transform",""),t&&(Wl&&(t.cancelable&&t.preventDefault(),!i.dropBubble&&t.stopPropagation()),Be&&Be.parentNode&&Be.parentNode.removeChild(Be),(Lt===qt||Dn&&Dn.lastPutMode!=="clone")&&It&&It.parentNode&&It.parentNode.removeChild(It),fe&&(this.nativeDraggable&&Ve(fe,"dragend",this),op(fe),fe.style["will-change"]="",Wl&&!fo&&zt(fe,Dn?Dn.options.ghostClass:this.options.ghostClass,!1),zt(fe,this.options.chosenClass,!1),In({sortable:this,name:"unchoose",toEl:qt,newIndex:null,newDraggableIndex:null,originalEvent:t}),Lt!==qt?(ha>=0&&(In({rootEl:qt,name:"add",toEl:qt,fromEl:Lt,originalEvent:t}),In({sortable:this,name:"remove",toEl:qt,originalEvent:t}),In({rootEl:qt,name:"sort",toEl:qt,fromEl:Lt,originalEvent:t}),In({sortable:this,name:"sort",toEl:qt,originalEvent:t})),Dn&&Dn.save()):ha!==go&&ha>=0&&(In({sortable:this,name:"update",toEl:qt,originalEvent:t}),In({sortable:this,name:"sort",toEl:qt,originalEvent:t})),Le.active&&((ha==null||ha===-1)&&(ha=go,gr=sc),In({sortable:this,name:"end",toEl:qt,originalEvent:t}),this.save()))),this._nulling()},_nulling:function(){Qn("nulling",this),Lt=fe=qt=Be=rs=It=Md=vr=ns=Fa=Wl=ha=gr=go=sc=ro=oc=Dn=fd=Le.dragged=Le.ghost=Le.clone=Le.active=null,Hd.forEach(function(t){t.checked=!0}),Hd.length=ip=rp=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":fe&&(this._onDragOver(t),zj(t));break;case"selectstart":t.preventDefault();break}},toArray:function(){for(var t=[],n,i=this.el.children,s=0,l=i.length,c=this.options;s<l;s++)n=i[s],ta(n,c.draggable,this.el,!1)&&t.push(n.getAttribute(c.dataIdAttr)||qj(n));return t},sort:function(t,n){var i={},s=this.el;this.toArray().forEach(function(l,c){var d=s.children[c];ta(d,this.options.draggable,s,!1)&&(i[l]=d)},this),n&&this.captureAnimationState(),t.forEach(function(l){i[l]&&(s.removeChild(i[l]),s.appendChild(i[l]))}),n&&this.animateAll()},save:function(){var t=this.options.store;t&&t.set&&t.set(this)},closest:function(t,n){return ta(t,n||this.options.draggable,this.el,!1)},option:function(t,n){var i=this.options;if(n===void 0)return i[t];var s=Tc.modifyOption(this,t,n);typeof s<"u"?i[t]=s:i[t]=n,t==="group"&&OD(i)},destroy:function(){Qn("destroy",this);var t=this.el;t[Nn]=null,Ve(t,"mousedown",this._onTapStart),Ve(t,"touchstart",this._onTapStart),Ve(t,"pointerdown",this._onTapStart),this.nativeDraggable&&(Ve(t,"dragover",this),Ve(t,"dragenter",this)),Array.prototype.forEach.call(t.querySelectorAll("[draggable]"),function(n){n.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),Fd.splice(Fd.indexOf(this.el),1),this.el=t=null},_hideClone:function(){if(!vr){if(Qn("hideClone",this),Le.eventCanceled)return;Ce(It,"display","none"),this.options.removeCloneOnHide&&It.parentNode&&It.parentNode.removeChild(It),vr=!0}},_showClone:function(t){if(t.lastPutMode!=="clone"){this._hideClone();return}if(vr){if(Qn("showClone",this),Le.eventCanceled)return;fe.parentNode==Lt&&!this.options.group.revertClone?Lt.insertBefore(It,fe):rs?Lt.insertBefore(It,rs):Lt.appendChild(It),this.options.group.revertClone&&this.animate(fe,It),Ce(It,"display",""),vr=!1}}};function zj(e){e.dataTransfer&&(e.dataTransfer.dropEffect="move"),e.cancelable&&e.preventDefault()}function pd(e,t,n,i,s,l,c,d){var h,m=e[Nn],y=m.options.onMove,v;return window.CustomEvent&&!_i&&!Mc?h=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(h=document.createEvent("Event"),h.initEvent("move",!0,!0)),h.to=t,h.from=e,h.dragged=n,h.draggedRect=i,h.related=s||t,h.relatedRect=l||kt(t),h.willInsertAfter=d,h.originalEvent=c,e.dispatchEvent(h),y&&(v=y.call(m,h,c)),v}function op(e){e.draggable=!1}function _j(){Up=!1}function Uj(e,t,n){var i=kt(Eo(n.el,0,n.options,!0)),s=jD(n.el,n.options,Be),l=10;return t?e.clientX<s.left-l||e.clientY<i.top&&e.clientX<i.right:e.clientY<s.top-l||e.clientY<i.bottom&&e.clientX<i.left}function Bj(e,t,n){var i=kt(zg(n.el,n.options.draggable)),s=jD(n.el,n.options,Be),l=10;return t?e.clientX>s.right+l||e.clientY>i.bottom&&e.clientX>i.left:e.clientY>s.bottom+l||e.clientX>i.right&&e.clientY>i.top}function Fj(e,t,n,i,s,l,c,d){var h=i?e.clientY:e.clientX,m=i?n.height:n.width,y=i?n.top:n.left,v=i?n.bottom:n.right,b=!1;if(!c){if(d&&Td<m*s){if(!lc&&(oc===1?h>y+m*l/2:h<v-m*l/2)&&(lc=!0),lc)b=!0;else if(oc===1?h<y+Td:h>v-Td)return-oc}else if(h>y+m*(1-s)/2&&h<v-m*(1-s)/2)return Hj(t)}return b=b||c,b&&(h<y+m*l/2||h>v-m*l/2)?h>y+m/2?1:-1:0}function Hj(e){return Vt(fe)<Vt(e)?1:-1}function qj(e){for(var t=e.tagName+e.className+e.src+e.href+e.textContent,n=t.length,i=0;n--;)i+=t.charCodeAt(n);return i.toString(36)}function Vj(e){Hd.length=0;for(var t=e.getElementsByTagName("input"),n=t.length;n--;){var i=t[n];i.checked&&Hd.push(i)}}function jd(e){return setTimeout(e,0)}function Bp(e){return clearTimeout(e)}yf&&Ke(document,"touchmove",function(e){(Le.active||fo)&&e.cancelable&&e.preventDefault()});Le.utils={on:Ke,off:Ve,css:Ce,find:AD,is:function(t,n){return!!ta(t,n,t,!1)},extend:Mj,throttle:MD,closest:ta,toggleClass:zt,clone:_g,index:Vt,nextTick:jd,cancelNextTick:Bp,detectDirection:$D,getChild:Eo,expando:Nn};Le.get=function(e){return e[Nn]};Le.mount=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];t[0].constructor===Array&&(t=t[0]),t.forEach(function(i){if(!i.prototype||!i.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(i));i.utils&&(Le.utils=oi(oi({},Le.utils),i.utils)),Tc.mount(i)})};Le.create=function(e,t){return new Le(e,t)};Le.version=Ej;var an=[],Ql,Fp,Hp=!1,lp,cp,qd,Zl;function Kj(){function e(){this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};for(var t in this)t.charAt(0)==="_"&&typeof this[t]=="function"&&(this[t]=this[t].bind(this))}return e.prototype={dragStarted:function(n){var i=n.originalEvent;this.sortable.nativeDraggable?Ke(document,"dragover",this._handleAutoScroll):this.options.supportPointer?Ke(document,"pointermove",this._handleFallbackAutoScroll):i.touches?Ke(document,"touchmove",this._handleFallbackAutoScroll):Ke(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(n){var i=n.originalEvent;!this.options.dragOverBubble&&!i.rootEl&&this._handleAutoScroll(i)},drop:function(){this.sortable.nativeDraggable?Ve(document,"dragover",this._handleAutoScroll):(Ve(document,"pointermove",this._handleFallbackAutoScroll),Ve(document,"touchmove",this._handleFallbackAutoScroll),Ve(document,"mousemove",this._handleFallbackAutoScroll)),_S(),kd(),Tj()},nulling:function(){qd=Fp=Ql=Hp=Zl=lp=cp=null,an.length=0},_handleFallbackAutoScroll:function(n){this._handleAutoScroll(n,!0)},_handleAutoScroll:function(n,i){var s=this,l=(n.touches?n.touches[0]:n).clientX,c=(n.touches?n.touches[0]:n).clientY,d=document.elementFromPoint(l,c);if(qd=n,i||this.options.forceAutoScrollFallback||Mc||_i||ic){up(n,this.options,d,i);var h=wr(d,!0);Hp&&(!Zl||l!==lp||c!==cp)&&(Zl&&_S(),Zl=setInterval(function(){var m=wr(document.elementFromPoint(l,c),!0);m!==h&&(h=m,kd()),up(n,s.options,m,i)},10),lp=l,cp=c)}else{if(!this.options.bubbleScroll||wr(d,!0)===ri()){kd();return}up(n,this.options,wr(d,!1),!1)}}},$a(e,{pluginName:"scroll",initializeByDefault:!0})}function kd(){an.forEach(function(e){clearInterval(e.pid)}),an=[]}function _S(){clearInterval(Zl)}var up=MD(function(e,t,n,i){if(t.scroll){var s=(e.touches?e.touches[0]:e).clientX,l=(e.touches?e.touches[0]:e).clientY,c=t.scrollSensitivity,d=t.scrollSpeed,h=ri(),m=!1,y;Fp!==n&&(Fp=n,kd(),Ql=t.scroll,y=t.scrollFn,Ql===!0&&(Ql=wr(n,!0)));var v=0,b=Ql;do{var D=b,w=kt(D),N=w.top,M=w.bottom,A=w.left,T=w.right,j=w.width,F=w.height,z=void 0,P=void 0,E=D.scrollWidth,L=D.scrollHeight,_=Ce(D),Y=D.scrollLeft,Z=D.scrollTop;D===h?(z=j<E&&(_.overflowX==="auto"||_.overflowX==="scroll"||_.overflowX==="visible"),P=F<L&&(_.overflowY==="auto"||_.overflowY==="scroll"||_.overflowY==="visible")):(z=j<E&&(_.overflowX==="auto"||_.overflowX==="scroll"),P=F<L&&(_.overflowY==="auto"||_.overflowY==="scroll"));var U=z&&(Math.abs(T-s)<=c&&Y+j<E)-(Math.abs(A-s)<=c&&!!Y),ae=P&&(Math.abs(M-l)<=c&&Z+F<L)-(Math.abs(N-l)<=c&&!!Z);if(!an[v])for(var Q=0;Q<=v;Q++)an[Q]||(an[Q]={});(an[v].vx!=U||an[v].vy!=ae||an[v].el!==D)&&(an[v].el=D,an[v].vx=U,an[v].vy=ae,clearInterval(an[v].pid),(U!=0||ae!=0)&&(m=!0,an[v].pid=setInterval((function(){i&&this.layer===0&&Le.active._onTouchMove(qd);var ie=an[this.layer].vy?an[this.layer].vy*d:0,R=an[this.layer].vx?an[this.layer].vx*d:0;typeof y=="function"&&y.call(Le.dragged.parentNode[Nn],R,ie,e,qd,an[this.layer].el)!=="continue"||TD(an[this.layer].el,R,ie)}).bind({layer:v}),24))),v++}while(t.bubbleScroll&&b!==h&&(b=wr(b,!1)));Hp=m}},30),PD=function(t){var n=t.originalEvent,i=t.putSortable,s=t.dragEl,l=t.activeSortable,c=t.dispatchSortableEvent,d=t.hideGhostForTarget,h=t.unhideGhostForTarget;if(n){var m=i||l;d();var y=n.changedTouches&&n.changedTouches.length?n.changedTouches[0]:n,v=document.elementFromPoint(y.clientX,y.clientY);h(),m&&!m.el.contains(v)&&(c("spill"),this.onSpill({dragEl:s,putSortable:i}))}};function Ug(){}Ug.prototype={startIndex:null,dragStart:function(t){var n=t.oldDraggableIndex;this.startIndex=n},onSpill:function(t){var n=t.dragEl,i=t.putSortable;this.sortable.captureAnimationState(),i&&i.captureAnimationState();var s=Eo(this.sortable.el,this.startIndex,this.options);s?this.sortable.el.insertBefore(n,s):this.sortable.el.appendChild(n),this.sortable.animateAll(),i&&i.animateAll()},drop:PD};$a(Ug,{pluginName:"revertOnSpill"});function Bg(){}Bg.prototype={onSpill:function(t){var n=t.dragEl,i=t.putSortable,s=i||this.sortable;s.captureAnimationState(),n.parentNode&&n.parentNode.removeChild(n),s.animateAll()},drop:PD};$a(Bg,{pluginName:"removeOnSpill"});var Ta;function Gj(){function e(){this.defaults={swapClass:"sortable-swap-highlight"}}return e.prototype={dragStart:function(n){var i=n.dragEl;Ta=i},dragOverValid:function(n){var i=n.completed,s=n.target,l=n.onMove,c=n.activeSortable,d=n.changed,h=n.cancel;if(c.options.swap){var m=this.sortable.el,y=this.options;if(s&&s!==m){var v=Ta;l(s)!==!1?(zt(s,y.swapClass,!0),Ta=s):Ta=null,v&&v!==Ta&&zt(v,y.swapClass,!1)}d(),i(!0),h()}},drop:function(n){var i=n.activeSortable,s=n.putSortable,l=n.dragEl,c=s||this.sortable,d=this.options;Ta&&zt(Ta,d.swapClass,!1),Ta&&(d.swap||s&&s.options.swap)&&l!==Ta&&(c.captureAnimationState(),c!==i&&i.captureAnimationState(),Yj(l,Ta),c.animateAll(),c!==i&&i.animateAll())},nulling:function(){Ta=null}},$a(e,{pluginName:"swap",eventProperties:function(){return{swapItem:Ta}}})}function Yj(e,t){var n=e.parentNode,i=t.parentNode,s,l;!n||!i||n.isEqualNode(t)||i.isEqualNode(e)||(s=Vt(e),l=Vt(t),n.isEqualNode(i)&&s<l&&l++,n.insertBefore(t,n.children[s]),i.insertBefore(e,i.children[l]))}var Ue=[],fa=[],Il,Ha,zl=!1,Zn=!1,so=!1,Et,_l,gd;function Jj(){function e(t){for(var n in this)n.charAt(0)==="_"&&typeof this[n]=="function"&&(this[n]=this[n].bind(this));t.options.avoidImplicitDeselect||(t.options.supportPointer?Ke(document,"pointerup",this._deselectMultiDrag):(Ke(document,"mouseup",this._deselectMultiDrag),Ke(document,"touchend",this._deselectMultiDrag))),Ke(document,"keydown",this._checkKeyDown),Ke(document,"keyup",this._checkKeyUp),this.defaults={selectedClass:"sortable-selected",multiDragKey:null,avoidImplicitDeselect:!1,setData:function(s,l){var c="";Ue.length&&Ha===t?Ue.forEach(function(d,h){c+=(h?", ":"")+d.textContent}):c=l.textContent,s.setData("Text",c)}}}return e.prototype={multiDragKeyDown:!1,isMultiDrag:!1,delayStartGlobal:function(n){var i=n.dragEl;Et=i},delayEnded:function(){this.isMultiDrag=~Ue.indexOf(Et)},setupClone:function(n){var i=n.sortable,s=n.cancel;if(this.isMultiDrag){for(var l=0;l<Ue.length;l++)fa.push(_g(Ue[l])),fa[l].sortableIndex=Ue[l].sortableIndex,fa[l].draggable=!1,fa[l].style["will-change"]="",zt(fa[l],this.options.selectedClass,!1),Ue[l]===Et&&zt(fa[l],this.options.chosenClass,!1);i._hideClone(),s()}},clone:function(n){var i=n.sortable,s=n.rootEl,l=n.dispatchSortableEvent,c=n.cancel;this.isMultiDrag&&(this.options.removeCloneOnHide||Ue.length&&Ha===i&&(US(!0,s),l("clone"),c()))},showClone:function(n){var i=n.cloneNowShown,s=n.rootEl,l=n.cancel;this.isMultiDrag&&(US(!1,s),fa.forEach(function(c){Ce(c,"display","")}),i(),gd=!1,l())},hideClone:function(n){var i=this;n.sortable;var s=n.cloneNowHidden,l=n.cancel;this.isMultiDrag&&(fa.forEach(function(c){Ce(c,"display","none"),i.options.removeCloneOnHide&&c.parentNode&&c.parentNode.removeChild(c)}),s(),gd=!0,l())},dragStartGlobal:function(n){n.sortable,!this.isMultiDrag&&Ha&&Ha.multiDrag._deselectMultiDrag(),Ue.forEach(function(i){i.sortableIndex=Vt(i)}),Ue=Ue.sort(function(i,s){return i.sortableIndex-s.sortableIndex}),so=!0},dragStarted:function(n){var i=this,s=n.sortable;if(this.isMultiDrag){if(this.options.sort&&(s.captureAnimationState(),this.options.animation)){Ue.forEach(function(c){c!==Et&&Ce(c,"position","absolute")});var l=kt(Et,!1,!0,!0);Ue.forEach(function(c){c!==Et&&LS(c,l)}),Zn=!0,zl=!0}s.animateAll(function(){Zn=!1,zl=!1,i.options.animation&&Ue.forEach(function(c){np(c)}),i.options.sort&&yd()})}},dragOver:function(n){var i=n.target,s=n.completed,l=n.cancel;Zn&&~Ue.indexOf(i)&&(s(!1),l())},revert:function(n){var i=n.fromSortable,s=n.rootEl,l=n.sortable,c=n.dragRect;Ue.length>1&&(Ue.forEach(function(d){l.addAnimationState({target:d,rect:Zn?kt(d):c}),np(d),d.fromRect=c,i.removeAnimationState(d)}),Zn=!1,Xj(!this.options.removeCloneOnHide,s))},dragOverCompleted:function(n){var i=n.sortable,s=n.isOwner,l=n.insertion,c=n.activeSortable,d=n.parentEl,h=n.putSortable,m=this.options;if(l){if(s&&c._hideClone(),zl=!1,m.animation&&Ue.length>1&&(Zn||!s&&!c.options.sort&&!h)){var y=kt(Et,!1,!0,!0);Ue.forEach(function(b){b!==Et&&(LS(b,y),d.appendChild(b))}),Zn=!0}if(!s)if(Zn||yd(),Ue.length>1){var v=gd;c._showClone(i),c.options.animation&&!gd&&v&&fa.forEach(function(b){c.addAnimationState({target:b,rect:_l}),b.fromRect=_l,b.thisAnimationDuration=null})}else c._showClone(i)}},dragOverAnimationCapture:function(n){var i=n.dragRect,s=n.isOwner,l=n.activeSortable;if(Ue.forEach(function(d){d.thisAnimationDuration=null}),l.options.animation&&!s&&l.multiDrag.isMultiDrag){_l=$a({},i);var c=us(Et,!0);_l.top-=c.f,_l.left-=c.e}},dragOverAnimationComplete:function(){Zn&&(Zn=!1,yd())},drop:function(n){var i=n.originalEvent,s=n.rootEl,l=n.parentEl,c=n.sortable,d=n.dispatchSortableEvent,h=n.oldIndex,m=n.putSortable,y=m||this.sortable;if(i){var v=this.options,b=l.children;if(!so)if(v.multiDragKey&&!this.multiDragKeyDown&&this._deselectMultiDrag(),zt(Et,v.selectedClass,!~Ue.indexOf(Et)),~Ue.indexOf(Et))Ue.splice(Ue.indexOf(Et),1),Il=null,Xl({sortable:c,rootEl:s,name:"deselect",targetEl:Et,originalEvent:i});else{if(Ue.push(Et),Xl({sortable:c,rootEl:s,name:"select",targetEl:Et,originalEvent:i}),i.shiftKey&&Il&&c.el.contains(Il)){var D=Vt(Il),w=Vt(Et);~D&&~w&&D!==w&&(function(){var T,j;w>D?(j=D,T=w):(j=w,T=D+1);for(var F=v.filter;j<T;j++)if(!~Ue.indexOf(b[j])&&ta(b[j],v.draggable,l,!1)){var z=F&&(typeof F=="function"?F.call(c,i,b[j],c):F.split(",").some(function(P){return ta(b[j],P.trim(),l,!1)}));z||(zt(b[j],v.selectedClass,!0),Ue.push(b[j]),Xl({sortable:c,rootEl:s,name:"select",targetEl:b[j],originalEvent:i}))}})()}else Il=Et;Ha=y}if(so&&this.isMultiDrag){if(Zn=!1,(l[Nn].options.sort||l!==s)&&Ue.length>1){var N=kt(Et),M=Vt(Et,":not(."+this.options.selectedClass+")");if(!zl&&v.animation&&(Et.thisAnimationDuration=null),y.captureAnimationState(),!zl&&(v.animation&&(Et.fromRect=N,Ue.forEach(function(T){if(T.thisAnimationDuration=null,T!==Et){var j=Zn?kt(T):N;T.fromRect=j,y.addAnimationState({target:T,rect:j})}})),yd(),Ue.forEach(function(T){b[M]?l.insertBefore(T,b[M]):l.appendChild(T),M++}),h===Vt(Et))){var A=!1;Ue.forEach(function(T){if(T.sortableIndex!==Vt(T)){A=!0;return}}),A&&(d("update"),d("sort"))}Ue.forEach(function(T){np(T)}),y.animateAll()}Ha=y}(s===l||m&&m.lastPutMode!=="clone")&&fa.forEach(function(T){T.parentNode&&T.parentNode.removeChild(T)})}},nullingGlobal:function(){this.isMultiDrag=so=!1,fa.length=0},destroyGlobal:function(){this._deselectMultiDrag(),Ve(document,"pointerup",this._deselectMultiDrag),Ve(document,"mouseup",this._deselectMultiDrag),Ve(document,"touchend",this._deselectMultiDrag),Ve(document,"keydown",this._checkKeyDown),Ve(document,"keyup",this._checkKeyUp)},_deselectMultiDrag:function(n){if(!(typeof so<"u"&&so)&&Ha===this.sortable&&!(n&&ta(n.target,this.options.draggable,this.sortable.el,!1))&&!(n&&n.button!==0))for(;Ue.length;){var i=Ue[0];zt(i,this.options.selectedClass,!1),Ue.shift(),Xl({sortable:this.sortable,rootEl:this.sortable.el,name:"deselect",targetEl:i,originalEvent:n})}},_checkKeyDown:function(n){n.key===this.options.multiDragKey&&(this.multiDragKeyDown=!0)},_checkKeyUp:function(n){n.key===this.options.multiDragKey&&(this.multiDragKeyDown=!1)}},$a(e,{pluginName:"multiDrag",utils:{select:function(n){var i=n.parentNode[Nn];!i||!i.options.multiDrag||~Ue.indexOf(n)||(Ha&&Ha!==i&&(Ha.multiDrag._deselectMultiDrag(),Ha=i),zt(n,i.options.selectedClass,!0),Ue.push(n))},deselect:function(n){var i=n.parentNode[Nn],s=Ue.indexOf(n);!i||!i.options.multiDrag||!~s||(zt(n,i.options.selectedClass,!1),Ue.splice(s,1))}},eventProperties:function(){var n=this,i=[],s=[];return Ue.forEach(function(l){i.push({multiDragElement:l,index:l.sortableIndex});var c;Zn&&l!==Et?c=-1:Zn?c=Vt(l,":not(."+n.options.selectedClass+")"):c=Vt(l),s.push({multiDragElement:l,index:c})}),{items:xj(Ue),clones:[].concat(fa),oldIndicies:i,newIndicies:s}},optionListeners:{multiDragKey:function(n){return n=n.toLowerCase(),n==="ctrl"?n="Control":n.length>1&&(n=n.charAt(0).toUpperCase()+n.substr(1)),n}}})}function Xj(e,t){Ue.forEach(function(n,i){var s=t.children[n.sortableIndex+(e?Number(i):0)];s?t.insertBefore(n,s):t.appendChild(n)})}function US(e,t){fa.forEach(function(n,i){var s=t.children[n.sortableIndex+(e?Number(i):0)];s?t.insertBefore(n,s):t.appendChild(n)})}function yd(){Ue.forEach(function(e){e!==Et&&e.parentNode&&e.parentNode.removeChild(e)})}Le.mount(new Kj);Le.mount(Bg,Ug);const Wj=Object.freeze(Object.defineProperty({__proto__:null,MultiDrag:Jj,Sortable:Le,Swap:Gj,default:Le},Symbol.toStringTag,{value:"Module"})),Qj=eD(Wj);var dp={exports:{}};var BS;function Zj(){return BS||(BS=1,(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var i=[],s=0;s<arguments.length;s++){var l=arguments[s];if(l){var c=typeof l;if(c==="string"||c==="number")i.push(l);else if(Array.isArray(l)){if(l.length){var d=n.apply(null,l);d&&i.push(d)}}else if(c==="object")if(l.toString===Object.prototype.toString)for(var h in l)t.call(l,h)&&l[h]&&i.push(h);else i.push(l.toString())}}return i.join(" ")}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(dp)),dp.exports}var ek="Invariant failed";function tk(e,t){if(!e)throw new Error(ek)}const nk=Object.freeze(Object.defineProperty({__proto__:null,default:tk},Symbol.toStringTag,{value:"Module"})),ak=eD(nk);var FS;function ik(){return FS||(FS=1,(function(e){var t=Qj,n=Zj(),i=Cc(),s=ak;function l(P){return P&&P.__esModule?P.default:P}function c(P,E,L,_){Object.defineProperty(P,E,{get:L,set:_,enumerable:!0,configurable:!0})}function d(P,E){return Object.keys(E).forEach(function(L){L==="default"||L==="__esModule"||P.hasOwnProperty(L)||Object.defineProperty(P,L,{enumerable:!0,get:function(){return E[L]}})}),P}c(e.exports,"Sortable",()=>$882b6d93070905b3$re_export$Sortable),c(e.exports,"Direction",()=>$882b6d93070905b3$re_export$Direction),c(e.exports,"DOMRect",()=>$882b6d93070905b3$re_export$DOMRect),c(e.exports,"GroupOptions",()=>$882b6d93070905b3$re_export$GroupOptions),c(e.exports,"MoveEvent",()=>$882b6d93070905b3$re_export$MoveEvent),c(e.exports,"Options",()=>$882b6d93070905b3$re_export$Options),c(e.exports,"PullResult",()=>$882b6d93070905b3$re_export$PullResult),c(e.exports,"PutResult",()=>$882b6d93070905b3$re_export$PutResult),c(e.exports,"SortableEvent",()=>$882b6d93070905b3$re_export$SortableEvent),c(e.exports,"SortableOptions",()=>$882b6d93070905b3$re_export$SortableOptions),c(e.exports,"Utils",()=>$882b6d93070905b3$re_export$Utils),c(e.exports,"ReactSortable",()=>F);function h(P){P.parentElement!==null&&P.parentElement.removeChild(P)}function m(P,E,L){const _=P.children[L]||null;P.insertBefore(E,_)}function y(P){P.forEach(E=>h(E.element))}function v(P){P.forEach(E=>{m(E.parentElement,E.element,E.oldIndex)})}function b(P,E){const L=M(P),_={parentElement:P.from};let Y=[];switch(L){case"normal":Y=[{element:P.item,newIndex:P.newIndex,oldIndex:P.oldIndex,parentElement:P.from}];break;case"swap":const ae={element:P.item,oldIndex:P.oldIndex,newIndex:P.newIndex,..._},Q={element:P.swapItem,oldIndex:P.newIndex,newIndex:P.oldIndex,..._};Y=[ae,Q];break;case"multidrag":Y=P.oldIndicies.map((ie,R)=>({element:ie.multiDragElement,oldIndex:ie.index,newIndex:P.newIndicies[R].index,..._}));break}return A(Y,E)}function D(P,E){const L=w(P,E);return N(P,L)}function w(P,E){const L=[...E];return P.concat().reverse().forEach(_=>L.splice(_.oldIndex,1)),L}function N(P,E,L,_){const Y=[...E];return P.forEach(Z=>{const U=_&&L&&_(Z.item,L);Y.splice(Z.newIndex,0,U||Z.item)}),Y}function M(P){return P.oldIndicies&&P.oldIndicies.length>0?"multidrag":P.swapItem?"swap":"normal"}function A(P,E){return P.map(_=>({..._,item:E[_.oldIndex]})).sort((_,Y)=>_.oldIndex-Y.oldIndex)}function T(P){const{list:E,setList:L,children:_,tag:Y,style:Z,className:U,clone:ae,onAdd:Q,onChange:ie,onChoose:R,onClone:W,onEnd:se,onFilter:ye,onRemove:ke,onSort:k,onStart:J,onUnchoose:oe,onUpdate:ce,onMove:$e,onSpill:Fe,onSelect:Je,onDeselect:mn,...Mt}=P;return Mt}const j={dragging:null};class F extends i.Component{static defaultProps={clone:E=>E};constructor(E){super(E),this.ref=(0,i.createRef)();const L=[...E.list].map(_=>Object.assign(_,{chosen:!1,selected:!1}));E.setList(L,this.sortable,j),l(s)(!E.plugins,`
|
|
3
|
-
Plugins prop is no longer supported.
|
|
4
|
-
Instead, mount it with "Sortable.mount(new MultiDrag())"
|
|
5
|
-
Please read the updated README.md at https://github.com/SortableJS/react-sortablejs.
|
|
6
|
-
`)}componentDidMount(){if(this.ref.current===null)return;const E=this.makeOptions();l(t).create(this.ref.current,E)}componentDidUpdate(E){E.disabled!==this.props.disabled&&this.sortable&&this.sortable.option("disabled",this.props.disabled)}render(){const{tag:E,style:L,className:_,id:Y}=this.props,Z={style:L,className:_,id:Y},U=!E||E===null?"div":E;return(0,i.createElement)(U,{ref:this.ref,...Z},this.getChildren())}getChildren(){const{children:E,dataIdAttr:L,selectedClass:_="sortable-selected",chosenClass:Y="sortable-chosen",dragClass:Z="sortable-drag",fallbackClass:U="sortable-falback",ghostClass:ae="sortable-ghost",swapClass:Q="sortable-swap-highlight",filter:ie="sortable-filter",list:R}=this.props;if(!E||E==null)return null;const W=L||"data-id";return i.Children.map(E,(se,ye)=>{if(se===void 0)return;const ke=R[ye]||{},{className:k}=se.props,J=typeof ie=="string"&&{[ie.replace(".","")]:!!ke.filtered},oe=l(n)(k,{[_]:ke.selected,[Y]:ke.chosen,...J});return(0,i.cloneElement)(se,{[W]:se.key,className:oe})})}get sortable(){const E=this.ref.current;if(E===null)return null;const L=Object.keys(E).find(_=>_.includes("Sortable"));return L?E[L]:null}makeOptions(){const E=["onAdd","onChoose","onDeselect","onEnd","onRemove","onSelect","onSpill","onStart","onUnchoose","onUpdate"],L=["onChange","onClone","onFilter","onSort"],_=T(this.props);return E.forEach(Z=>_[Z]=this.prepareOnHandlerPropAndDOM(Z)),L.forEach(Z=>_[Z]=this.prepareOnHandlerProp(Z)),{..._,onMove:(Z,U)=>{const{onMove:ae}=this.props,Q=Z.willInsertAfter||-1;if(!ae)return Q;const ie=ae(Z,U,this.sortable,j);return typeof ie>"u"?!1:ie}}}prepareOnHandlerPropAndDOM(E){return L=>{this.callOnHandlerProp(L,E),this[E](L)}}prepareOnHandlerProp(E){return L=>{this.callOnHandlerProp(L,E)}}callOnHandlerProp(E,L){const _=this.props[L];_&&_(E,this.sortable,j)}onAdd(E){const{list:L,setList:_,clone:Y}=this.props,Z=[...j.dragging.props.list],U=b(E,Z);y(U);const ae=N(U,L,E,Y).map(Q=>Object.assign(Q,{selected:!1}));_(ae,this.sortable,j)}onRemove(E){const{list:L,setList:_}=this.props,Y=M(E),Z=b(E,L);v(Z);let U=[...L];if(E.pullMode!=="clone")U=w(Z,U);else{let ae=Z;switch(Y){case"multidrag":ae=Z.map((Q,ie)=>({...Q,element:E.clones[ie]}));break;case"normal":ae=Z.map(Q=>({...Q,element:E.clone}));break;case"swap":default:l(s)(!0,`mode "${Y}" cannot clone. Please remove "props.clone" from <ReactSortable/> when using the "${Y}" plugin`)}y(ae),Z.forEach(Q=>{const ie=Q.oldIndex,R=this.props.clone(Q.item,E);U.splice(ie,1,R)})}U=U.map(ae=>Object.assign(ae,{selected:!1})),_(U,this.sortable,j)}onUpdate(E){const{list:L,setList:_}=this.props,Y=b(E,L);y(Y),v(Y);const Z=D(Y,L);return _(Z,this.sortable,j)}onStart(){j.dragging=this}onEnd(){j.dragging=null}onChoose(E){const{list:L,setList:_}=this.props,Y=L.map((Z,U)=>{let ae=Z;return U===E.oldIndex&&(ae=Object.assign(Z,{chosen:!0})),ae});_(Y,this.sortable,j)}onUnchoose(E){const{list:L,setList:_}=this.props,Y=L.map((Z,U)=>{let ae=Z;return U===E.oldIndex&&(ae=Object.assign(ae,{chosen:!1})),ae});_(Y,this.sortable,j)}onSpill(E){const{removeOnSpill:L,revertOnSpill:_}=this.props;L&&!_&&h(E.item)}onSelect(E){const{list:L,setList:_}=this.props,Y=L.map(Z=>Object.assign(Z,{selected:!1}));E.newIndicies.forEach(Z=>{const U=Z.index;if(U===-1){console.log(`"${E.type}" had indice of "${Z.index}", which is probably -1 and doesn't usually happen here.`),console.log(E);return}Y[U].selected=!0}),_(Y,this.sortable,j)}onDeselect(E){const{list:L,setList:_}=this.props,Y=L.map(Z=>Object.assign(Z,{selected:!1}));E.newIndicies.forEach(Z=>{const U=Z.index;U!==-1&&(Y[U].selected=!0)}),_(Y,this.sortable,j)}}var z={};d(e.exports,z)})(ep)),ep.exports}var rk=ik();function Fg({items:e,onReorder:t,keyField:n,renderItem:i,direction:s="column",className:l,itemClassName:c}){const[d,h]=S.useState(()=>e.map(y=>({id:String(y[n]),data:y})));S.useEffect(()=>{h(e.map(y=>({id:String(y[n]),data:y})))},[e,n]);const m=y=>{y.length===0&&d.length>0||(h(y),t(y.map(v=>v.data)))};return f.jsx(rk.ReactSortable,{tag:"div",className:he("PaSortableList",s,l),list:d,setList:m,children:d.map((y,v)=>f.jsx("div",{className:he("PaSortableList-item",c),children:i(y.data,v)},y.id))})}function ho(e){if(e===void 0||typeof e=="string")return e;throw new Error(`Expected value to be a string or undefined, got: ${JSON.stringify(e)}`)}function sk(e){if(e===void 0||typeof e=="number")return e;throw new Error(`Expected value to be a number or undefined, got: ${JSON.stringify(e)}`)}function ok(e){if(e===void 0||typeof e=="boolean")return e;throw new Error(`Expected value to be a boolean or undefined, got: ${JSON.stringify(e)}`)}function jc(e){if(!Array.isArray(e))return{value:e};const[t,...n]=e,i={value:t??void 0};for(const s of n)if(s.attached==="gallery")i.gallery=s;else if(s.attached==="text")i.text=s;else throw new Error(`Unknown attached value type "${s.attached}"`);return i}function lk(e){return Array.isArray(e)}function yc(e){return typeof e=="object"&&e!==null&&"j"in e}function kc(e){return typeof e=="object"&&e!==null&&"t"in e}function ID(e){return typeof e=="object"&&e!==null&&"h"in e}function ck(e){return typeof e=="object"&&e!==null&&"t"in e}function uk(e,t){if(t){const n=Array.isArray(t)?t:[t];for(const i of n)if(e[i])return e[i]}for(const n of Object.values(e))if(n)return n;return""}function zD(e,t){if(t){const i=Array.isArray(t)?t:[t];for(const s of i)if(s in e.title)return{language:s,title:e.title[s]}}const[n]=Object.keys(e.title);if(n)return{language:n,title:e.title[n]};throw new Error(`No title found for term "${e.nodeId}"`)}const dk={en:{en:"English",fr:"French",es:"Spanish",de:"German",it:"Italian",pt:"Portuguese"},fr:{en:"Anglais",fr:"Français",es:"Espagnol",de:"Allemand",it:"Italien",pt:"Portugais"},es:{en:"Inglés",fr:"Francés",es:"Español",de:"Alemán",it:"Italiano",pt:"Portugués"},de:{en:"Englisch",fr:"Französisch",es:"Spanisch",de:"Deutsch",it:"Italienisch",pt:"Portugiesisch"},it:{en:"Inglese",fr:"Francese",es:"Spagnolo",de:"Tedesco",it:"Italiano",pt:"Portoghese"},pt:{en:"Inglês",fr:"Francês",es:"Espanhol",de:"Alemão",it:"Italiano",pt:"Português"}},cc=Object.keys(dk);function qa(e){return e!=null}function fk(e){return!Number.isNaN(Number(e))&&!Number.isNaN(Number.parseFloat(e))}function Fn(e){if(e===null)return"null";if(e===void 0)return"undefined";if(e instanceof Error)return e.message;switch(typeof e){case"bigint":case"number":case"boolean":return String(e);case"string":return e;case"symbol":return`Symbol(${e.description??""})`;case"object":return String("message"in e?e.message:e);case"function":return`function ${e.name}`;default:return"invalid error type"}}function _t(e){const t=e.split(":");if(t.length!==2)throw new Error(`[ANYWHERE-LIB] invalid lNode id "${e}"`);const[n,i]=t;if(!hk(i)||!n||!fk(n))throw new Error(`[ANYWHERE-LIB] invalid lNode id "${e}"`);return{nodeId:n,language:i}}function hk(e){return!!e.match(/^([a-z]{2,3}(?:-[A-Z]{2})?)$/)}function _D(e){return`${e.nodeId}:${e.language}`}function Er(e){return e.trim().normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^a-zA-Z0-9]/g,"-").replace(/--+/g,"-").replace(/-+$/,"").replace(/^-+/,"").toLowerCase()}const Hg=S.createContext(void 0);function Cn({children:e,ref:t}){const{logger:n}=$g(),i=S.useRef([]),s=S.useRef(0),[l,c]=S.useReducer(v=>v+1,0),d=S.useCallback((v,b)=>{const D={id:++s.current,message:v,severity:b?.severity??"info",autoDismiss:b?.autoDismiss??!1};i.current.push(D),c()},[]),h=S.useCallback(()=>{i.current.shift(),c()},[]),m=S.useCallback(v=>{n.error("AlertStack caught error:",v),d(Fn(v),{severity:"error"})},[d]);S.useImperativeHandle(t,()=>({showAlert:d,showError:m}),[d,m]);const y={showAlert:d,queue:i.current,dismissCurrent:h};return f.jsx(Hg.Provider,{value:y,children:e})}function at(){const e=S.useContext(Hg);if(!e)throw new Error("useAlertStack must be used within an AlertStackProvider");const t=S.useCallback(n=>{e.showAlert(Fn(n),{severity:"error"})},[e.showAlert]);return{showAlert:e.showAlert,showError:t}}function En(){const e=S.useContext(Hg),t=$g();if(!e)throw new Error("AlertStack must be used within an AlertStackProvider");const{queue:n,dismissCurrent:i}=e,s=n[0];return S.useEffect(()=>{if(!s?.autoDismiss)return;const l=setTimeout(i,t.autoDismissAlertDurationMs);return()=>clearTimeout(l)},[s?.id,s?.autoDismiss,t.autoDismissAlertDurationMs,i]),s?f.jsx(No,{severity:s.severity,onClose:i,children:s.message}):null}const is=()=>{};function mk(){return{error:is,warn:is,info:is,trace:is,debug:is,log:is,wrapAsync:UD({error:is}),lateSetup:()=>{throw new Error("'lateSetup' can't be called on noUiLogger.")}}}function pk(e){let t=e?.minLevel,n=HS(t);const i={...e?.send?qS(e.send,n):n,log(s){s.clientOnly?n[s.level](...s.message):i[s.level](...s.message)},lateSetup(s){s.minLevel&&s.minLevel!==t&&(t=s.minLevel,n=HS(s.minLevel)),Object.assign(i,s.send?qS(s.send,n):n)},get wrapAsync(){return UD(i)}};return i}function HS(e){return{error:Ul("error",e),warn:Ul("warn",e),info:Ul("info",e),trace:Ul("trace",e),debug:Ul("debug",e)}}function Ul(e,t){return!window.console||yo(e)>yo(t)?()=>{}:console[e]?(...n)=>console[e](`[${e}]`,...n):console.log?(...n)=>console.log(`[${e}]`,...n):()=>{}}function qS(e,t){const n=e?gk(e):(i,s)=>s;return{error:n("error",t.error),warn:n("warn",t.warn),info:n("info",t.info),trace:n("trace",t.trace),debug:n("debug",t.debug)}}function gk(e){const t=yo(e.minLevel??"none")>=yo("error"),n=e.minLevel??"none",i=e.sendToServer?new yk({sendToServer:e.sendToServer,logErrorFromBackend:t}):void 0;return(s,l)=>(...c)=>{l(...c),i&&yo(s)<=yo(n)&&i.addLogLineToPost({message:c,level:s})}}function yo(e){switch(e){case"none":return 0;case"error":return 1;case"warn":return 2;case"info":return 3;case"trace":return 4;case"debug":return 5;default:throw new Error(`Invalid level: ${e}`)}}class yk{options;lines=[];timeoutId;sending=!1;retryDelayMs=500;constructor(t){this.options=t}addLogLineToPost(t){this.lines.push(t),this.delayedSend()}delayedSend(){if(this.timeoutId!==void 0&&(clearTimeout(this.timeoutId),this.timeoutId=void 0,this.lines.length>=20)){this.#e();return}this.timeoutId=setTimeout(()=>{this.timeoutId=void 0,this.#e()},50)}async#e(){if(this.sending||this.lines.length===0)return;const t=this.lines;this.lines=[],this.sending=!0;const n=await vk({...this.options,lines:t});if(this.sending=!1,n==="NOT_READY"){this.lines=t.concat(this.lines),setTimeout(()=>this.delayedSend(),this.retryDelayMs);return}this.lines.length>0&&this.delayedSend()}}async function vk({lines:e,sendToServer:t,logErrorFromBackend:n}){try{for(const s of e)s.message=s.message.map(l=>qp(l));return await t(e.map(s=>({message:s.message.map(Fn).join(" "),level:s.level})))}catch(i){return n&&window.console?.error&&console.error("Cannot send log to backend:",i),"CANCEL"}}function qp(e,t=new WeakSet){if(e===null)return null;if(Number.isNaN(e))return"[NaN]";if(Array.isArray(e)){if(t.has(e))return"[Circular Array]";t.add(e);const n=e.map(i=>qp(i,t));return t.delete(e),n}if(e instanceof Error)return e.message??e.name??"[Error]";switch(typeof e){case"string":case"number":case"boolean":return e;case"undefined":return null;case"bigint":return`${e.toString()}n`;case"function":return e.name?`[Function: ${e.name}]`:"[Function]";case"symbol":return"[Symbol]";case"object":{if(t.has(e))return"[Circular]";t.add(e);const n={};for(const i of Object.keys(e))n[i]=qp(e[i],t);return t.delete(e),n}default:return"[Unexpected value]"}}function UD(e){return t=>(...n)=>{t(...n).catch(e.error)}}const BD=S.createContext(mk()),bk=BD.Provider;function $c(){return S.useContext(BD)}var fp={exports:{}},Bl={},hp={exports:{}},mp={};var VS;function Sk(){return VS||(VS=1,(function(e){function t(R,W){var se=R.length;R.push(W);e:for(;0<se;){var ye=se-1>>>1,ke=R[ye];if(0<s(ke,W))R[ye]=W,R[se]=ke,se=ye;else break e}}function n(R){return R.length===0?null:R[0]}function i(R){if(R.length===0)return null;var W=R[0],se=R.pop();if(se!==W){R[0]=se;e:for(var ye=0,ke=R.length,k=ke>>>1;ye<k;){var J=2*(ye+1)-1,oe=R[J],ce=J+1,$e=R[ce];if(0>s(oe,se))ce<ke&&0>s($e,oe)?(R[ye]=$e,R[ce]=se,ye=ce):(R[ye]=oe,R[J]=se,ye=J);else if(ce<ke&&0>s($e,se))R[ye]=$e,R[ce]=se,ye=ce;else break e}}return W}function s(R,W){var se=R.sortIndex-W.sortIndex;return se!==0?se:R.id-W.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var c=Date,d=c.now();e.unstable_now=function(){return c.now()-d}}var h=[],m=[],y=1,v=null,b=3,D=!1,w=!1,N=!1,M=!1,A=typeof setTimeout=="function"?setTimeout:null,T=typeof clearTimeout=="function"?clearTimeout:null,j=typeof setImmediate<"u"?setImmediate:null;function F(R){for(var W=n(m);W!==null;){if(W.callback===null)i(m);else if(W.startTime<=R)i(m),W.sortIndex=W.expirationTime,t(h,W);else break;W=n(m)}}function z(R){if(N=!1,F(R),!w)if(n(h)!==null)w=!0,P||(P=!0,U());else{var W=n(m);W!==null&&ie(z,W.startTime-R)}}var P=!1,E=-1,L=5,_=-1;function Y(){return M?!0:!(e.unstable_now()-_<L)}function Z(){if(M=!1,P){var R=e.unstable_now();_=R;var W=!0;try{e:{w=!1,N&&(N=!1,T(E),E=-1),D=!0;var se=b;try{t:{for(F(R),v=n(h);v!==null&&!(v.expirationTime>R&&Y());){var ye=v.callback;if(typeof ye=="function"){v.callback=null,b=v.priorityLevel;var ke=ye(v.expirationTime<=R);if(R=e.unstable_now(),typeof ke=="function"){v.callback=ke,F(R),W=!0;break t}v===n(h)&&i(h),F(R)}else i(h);v=n(h)}if(v!==null)W=!0;else{var k=n(m);k!==null&&ie(z,k.startTime-R),W=!1}}break e}finally{v=null,b=se,D=!1}W=void 0}}finally{W?U():P=!1}}}var U;if(typeof j=="function")U=function(){j(Z)};else if(typeof MessageChannel<"u"){var ae=new MessageChannel,Q=ae.port2;ae.port1.onmessage=Z,U=function(){Q.postMessage(null)}}else U=function(){A(Z,0)};function ie(R,W){E=A(function(){R(e.unstable_now())},W)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(R){R.callback=null},e.unstable_forceFrameRate=function(R){0>R||125<R?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):L=0<R?Math.floor(1e3/R):5},e.unstable_getCurrentPriorityLevel=function(){return b},e.unstable_next=function(R){switch(b){case 1:case 2:case 3:var W=3;break;default:W=b}var se=b;b=W;try{return R()}finally{b=se}},e.unstable_requestPaint=function(){M=!0},e.unstable_runWithPriority=function(R,W){switch(R){case 1:case 2:case 3:case 4:case 5:break;default:R=3}var se=b;b=R;try{return W()}finally{b=se}},e.unstable_scheduleCallback=function(R,W,se){var ye=e.unstable_now();switch(typeof se=="object"&&se!==null?(se=se.delay,se=typeof se=="number"&&0<se?ye+se:ye):se=ye,R){case 1:var ke=-1;break;case 2:ke=250;break;case 5:ke=1073741823;break;case 4:ke=1e4;break;default:ke=5e3}return ke=se+ke,R={id:y++,callback:W,priorityLevel:R,startTime:se,expirationTime:ke,sortIndex:-1},se>ye?(R.sortIndex=se,t(m,R),n(h)===null&&R===n(m)&&(N?(T(E),E=-1):N=!0,ie(z,se-ye))):(R.sortIndex=ke,t(h,R),w||D||(w=!0,P||(P=!0,U()))),R},e.unstable_shouldYield=Y,e.unstable_wrapCallback=function(R){var W=b;return function(){var se=b;b=W;try{return R.apply(this,arguments)}finally{b=se}}}})(mp)),mp}var KS;function xk(){return KS||(KS=1,hp.exports=Sk()),hp.exports}var GS;function wk(){if(GS)return Bl;GS=1;var e=xk(),t=Cc(),n=SD();function i(a){var r="https://react.dev/errors/"+a;if(1<arguments.length){r+="?args[]="+encodeURIComponent(arguments[1]);for(var o=2;o<arguments.length;o++)r+="&args[]="+encodeURIComponent(arguments[o])}return"Minified React error #"+a+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}function l(a){var r=a,o=a;if(a.alternate)for(;r.return;)r=r.return;else{a=r;do r=a,(r.flags&4098)!==0&&(o=r.return),a=r.return;while(a)}return r.tag===3?o:null}function c(a){if(a.tag===13){var r=a.memoizedState;if(r===null&&(a=a.alternate,a!==null&&(r=a.memoizedState)),r!==null)return r.dehydrated}return null}function d(a){if(a.tag===31){var r=a.memoizedState;if(r===null&&(a=a.alternate,a!==null&&(r=a.memoizedState)),r!==null)return r.dehydrated}return null}function h(a){if(l(a)!==a)throw Error(i(188))}function m(a){var r=a.alternate;if(!r){if(r=l(a),r===null)throw Error(i(188));return r!==a?null:a}for(var o=a,u=r;;){var p=o.return;if(p===null)break;var g=p.alternate;if(g===null){if(u=p.return,u!==null){o=u;continue}break}if(p.child===g.child){for(g=p.child;g;){if(g===o)return h(p),a;if(g===u)return h(p),r;g=g.sibling}throw Error(i(188))}if(o.return!==u.return)o=p,u=g;else{for(var x=!1,C=p.child;C;){if(C===o){x=!0,o=p,u=g;break}if(C===u){x=!0,u=p,o=g;break}C=C.sibling}if(!x){for(C=g.child;C;){if(C===o){x=!0,o=g,u=p;break}if(C===u){x=!0,u=g,o=p;break}C=C.sibling}if(!x)throw Error(i(189))}}if(o.alternate!==u)throw Error(i(190))}if(o.tag!==3)throw Error(i(188));return o.stateNode.current===o?a:r}function y(a){var r=a.tag;if(r===5||r===26||r===27||r===6)return a;for(a=a.child;a!==null;){if(r=y(a),r!==null)return r;a=a.sibling}return null}var v=Object.assign,b=Symbol.for("react.element"),D=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),N=Symbol.for("react.fragment"),M=Symbol.for("react.strict_mode"),A=Symbol.for("react.profiler"),T=Symbol.for("react.consumer"),j=Symbol.for("react.context"),F=Symbol.for("react.forward_ref"),z=Symbol.for("react.suspense"),P=Symbol.for("react.suspense_list"),E=Symbol.for("react.memo"),L=Symbol.for("react.lazy"),_=Symbol.for("react.activity"),Y=Symbol.for("react.memo_cache_sentinel"),Z=Symbol.iterator;function U(a){return a===null||typeof a!="object"?null:(a=Z&&a[Z]||a["@@iterator"],typeof a=="function"?a:null)}var ae=Symbol.for("react.client.reference");function Q(a){if(a==null)return null;if(typeof a=="function")return a.$$typeof===ae?null:a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case N:return"Fragment";case A:return"Profiler";case M:return"StrictMode";case z:return"Suspense";case P:return"SuspenseList";case _:return"Activity"}if(typeof a=="object")switch(a.$$typeof){case w:return"Portal";case j:return a.displayName||"Context";case T:return(a._context.displayName||"Context")+".Consumer";case F:var r=a.render;return a=a.displayName,a||(a=r.displayName||r.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case E:return r=a.displayName||null,r!==null?r:Q(a.type)||"Memo";case L:r=a._payload,a=a._init;try{return Q(a(r))}catch{}}return null}var ie=Array.isArray,R=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,se={pending:!1,data:null,method:null,action:null},ye=[],ke=-1;function k(a){return{current:a}}function J(a){0>ke||(a.current=ye[ke],ye[ke]=null,ke--)}function oe(a,r){ke++,ye[ke]=a.current,a.current=r}var ce=k(null),$e=k(null),Fe=k(null),Je=k(null);function mn(a,r){switch(oe(Fe,r),oe($e,a),oe(ce,null),r.nodeType){case 9:case 11:a=(a=r.documentElement)&&(a=a.namespaceURI)?V0(a):0;break;default:if(a=r.tagName,r=r.namespaceURI)r=V0(r),a=K0(r,a);else switch(a){case"svg":a=1;break;case"math":a=2;break;default:a=0}}J(ce),oe(ce,a)}function Mt(){J(ce),J($e),J(Fe)}function Pr(a){a.memoizedState!==null&&oe(Je,a);var r=ce.current,o=K0(r,a.type);r!==o&&(oe($e,a),oe(ce,o))}function Yt(a){$e.current===a&&(J(ce),J($e)),Je.current===a&&(J(Je),$l._currentValue=se)}var Xa,Fo;function hi(a){if(Xa===void 0)try{throw Error()}catch(o){var r=o.stack.trim().match(/\n( *(at )?)/);Xa=r&&r[1]||"",Fo=-1<o.stack.indexOf(`
|
|
7
|
-
at`)?" (<anonymous>)":-1<o.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
8
|
-
`+Xa+a+Fo}var La=!1;function Ho(a,r){if(!a||La)return"";La=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var u={DetermineComponentFrameRoot:function(){try{if(r){var ne=function(){throw Error()};if(Object.defineProperty(ne.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ne,[])}catch(X){var K=X}Reflect.construct(a,[],ne)}else{try{ne.call()}catch(X){K=X}a.call(ne.prototype)}}else{try{throw Error()}catch(X){K=X}(ne=a())&&typeof ne.catch=="function"&&ne.catch(function(){})}}catch(X){if(X&&K&&typeof X.stack=="string")return[X.stack,K.stack]}return[null,null]}};u.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var p=Object.getOwnPropertyDescriptor(u.DetermineComponentFrameRoot,"name");p&&p.configurable&&Object.defineProperty(u.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var g=u.DetermineComponentFrameRoot(),x=g[0],C=g[1];if(x&&C){var $=x.split(`
|
|
9
|
-
`),V=C.split(`
|
|
10
|
-
`);for(p=u=0;u<$.length&&!$[u].includes("DetermineComponentFrameRoot");)u++;for(;p<V.length&&!V[p].includes("DetermineComponentFrameRoot");)p++;if(u===$.length||p===V.length)for(u=$.length-1,p=V.length-1;1<=u&&0<=p&&$[u]!==V[p];)p--;for(;1<=u&&0<=p;u--,p--)if($[u]!==V[p]){if(u!==1||p!==1)do if(u--,p--,0>p||$[u]!==V[p]){var ee=`
|
|
11
|
-
`+$[u].replace(" at new "," at ");return a.displayName&&ee.includes("<anonymous>")&&(ee=ee.replace("<anonymous>",a.displayName)),ee}while(1<=u&&0<=p);break}}}finally{La=!1,Error.prepareStackTrace=o}return(o=a?a.displayName||a.name:"")?hi(o):""}function zf(a,r){switch(a.tag){case 26:case 27:case 5:return hi(a.type);case 16:return hi("Lazy");case 13:return a.child!==r&&r!==null?hi("Suspense Fallback"):hi("Suspense");case 19:return hi("SuspenseList");case 0:case 15:return Ho(a.type,!1);case 11:return Ho(a.type.render,!1);case 1:return Ho(a.type,!0);case 31:return hi("Activity");default:return""}}function qo(a){try{var r="",o=null;do r+=zf(a,o),o=a,a=a.return;while(a);return r}catch(u){return`
|
|
12
|
-
Error generating stack: `+u.message+`
|
|
13
|
-
`+u.stack}}var Vo=Object.prototype.hasOwnProperty,Ko=e.unstable_scheduleCallback,Go=e.unstable_cancelCallback,_f=e.unstable_shouldYield,mi=e.unstable_requestPaint,un=e.unstable_now,Xc=e.unstable_getCurrentPriorityLevel,ys=e.unstable_ImmediatePriority,va=e.unstable_UserBlockingPriority,Hn=e.unstable_NormalPriority,Wc=e.unstable_LowPriority,Qc=e.unstable_IdlePriority,Yo=e.log,Uf=e.unstable_setDisableYieldValue,$n=null,An=null;function Pa(a){if(typeof Yo=="function"&&Uf(a),An&&typeof An.setStrictMode=="function")try{An.setStrictMode($n,a)}catch{}}var Mn=Math.clz32?Math.clz32:vs,Bf=Math.log,Zc=Math.LN2;function vs(a){return a>>>=0,a===0?32:31-(Bf(a)/Zc|0)|0}var Ir=256,Bi=262144,bs=4194304;function Wa(a){var r=a&42;if(r!==0)return r;switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return a&261888;case 262144:case 524288:case 1048576:case 2097152:return a&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return a&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return a}}function Ss(a,r,o){var u=a.pendingLanes;if(u===0)return 0;var p=0,g=a.suspendedLanes,x=a.pingedLanes;a=a.warmLanes;var C=u&134217727;return C!==0?(u=C&~g,u!==0?p=Wa(u):(x&=C,x!==0?p=Wa(x):o||(o=C&~a,o!==0&&(p=Wa(o))))):(C=u&~g,C!==0?p=Wa(C):x!==0?p=Wa(x):o||(o=u&~a,o!==0&&(p=Wa(o)))),p===0?0:r!==0&&r!==p&&(r&g)===0&&(g=p&-p,o=r&-r,g>=o||g===32&&(o&4194048)!==0)?r:p}function Fi(a,r){return(a.pendingLanes&~(a.suspendedLanes&~a.pingedLanes)&r)===0}function xs(a,r){switch(a){case 1:case 2:case 4:case 8:case 64:return r+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return r+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function zr(){var a=bs;return bs<<=1,(bs&62914560)===0&&(bs=4194304),a}function ws(a){for(var r=[],o=0;31>o;o++)r.push(a);return r}function _r(a,r){a.pendingLanes|=r,r!==268435456&&(a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0)}function Ff(a,r,o,u,p,g){var x=a.pendingLanes;a.pendingLanes=o,a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0,a.expiredLanes&=o,a.entangledLanes&=o,a.errorRecoveryDisabledLanes&=o,a.shellSuspendCounter=0;var C=a.entanglements,$=a.expirationTimes,V=a.hiddenUpdates;for(o=x&~o;0<o;){var ee=31-Mn(o),ne=1<<ee;C[ee]=0,$[ee]=-1;var K=V[ee];if(K!==null)for(V[ee]=null,ee=0;ee<K.length;ee++){var X=K[ee];X!==null&&(X.lane&=-536870913)}o&=~ne}u!==0&&O(a,u,0),g!==0&&p===0&&a.tag!==0&&(a.suspendedLanes|=g&~(x&~r))}function O(a,r,o){a.pendingLanes|=r,a.suspendedLanes&=~r;var u=31-Mn(r);a.entangledLanes|=r,a.entanglements[u]=a.entanglements[u]|1073741824|o&261930}function H(a,r){var o=a.entangledLanes|=r;for(a=a.entanglements;o;){var u=31-Mn(o),p=1<<u;p&r|a[u]&r&&(a[u]|=r),o&=~p}}function G(a,r){var o=r&-r;return o=(o&42)!==0?1:re(o),(o&(a.suspendedLanes|r))!==0?0:o}function re(a){switch(a){case 2:a=1;break;case 8:a=4;break;case 32:a=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:a=128;break;case 268435456:a=134217728;break;default:a=0}return a}function ue(a){return a&=-a,2<a?8<a?(a&134217727)!==0?32:268435456:8:2}function Ee(){var a=W.p;return a!==0?a:(a=window.event,a===void 0?32:pS(a.type))}function Ae(a,r){var o=W.p;try{return W.p=a,r()}finally{W.p=o}}var ve=Math.random().toString(36).slice(2),me="__reactFiber$"+ve,be="__reactProps$"+ve,De="__reactContainer$"+ve,Te="__reactEvents$"+ve,tt="__reactListeners$"+ve,Ct="__reactHandles$"+ve,Bt="__reactResources$"+ve,Ot="__reactMarker$"+ve;function dt(a){delete a[me],delete a[be],delete a[Te],delete a[tt],delete a[Ct]}function rt(a){var r=a[me];if(r)return r;for(var o=a.parentNode;o;){if(r=o[De]||o[me]){if(o=r.alternate,r.child!==null||o!==null&&o.child!==null)for(a=Z0(a);a!==null;){if(o=a[me])return o;a=Z0(a)}return r}a=o,o=a.parentNode}return null}function qn(a){if(a=a[me]||a[De]){var r=a.tag;if(r===5||r===6||r===13||r===31||r===26||r===27||r===3)return a}return null}function Ia(a){var r=a.tag;if(r===5||r===26||r===27||r===6)return a.stateNode;throw Error(i(33))}function On(a){var r=a[Bt];return r||(r=a[Bt]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function ft(a){a[Ot]=!0}var Ds=new Set,Hi={};function Rn(a,r){za(a,r),za(a+"Capture",r)}function za(a,r){for(Hi[a]=r,a=0;a<r.length;a++)Ds.add(r[a])}var Ns=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Qe={},dn={};function qi(a){return Vo.call(dn,a)?!0:Vo.call(Qe,a)?!1:Ns.test(a)?dn[a]=!0:(Qe[a]=!0,!1)}function ba(a,r,o){if(qi(r))if(o===null)a.removeAttribute(r);else{switch(typeof o){case"undefined":case"function":case"symbol":a.removeAttribute(r);return;case"boolean":var u=r.toLowerCase().slice(0,5);if(u!=="data-"&&u!=="aria-"){a.removeAttribute(r);return}}a.setAttribute(r,""+o)}}function xt(a,r,o){if(o===null)a.removeAttribute(r);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(r);return}a.setAttribute(r,""+o)}}function Vn(a,r,o,u){if(u===null)a.removeAttribute(o);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(o);return}a.setAttributeNS(r,o,""+u)}}function Ln(a){switch(typeof a){case"bigint":case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function eu(a){var r=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function jE(a,r,o){var u=Object.getOwnPropertyDescriptor(a.constructor.prototype,r);if(!a.hasOwnProperty(r)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var p=u.get,g=u.set;return Object.defineProperty(a,r,{configurable:!0,get:function(){return p.call(this)},set:function(x){o=""+x,g.call(this,x)}}),Object.defineProperty(a,r,{enumerable:u.enumerable}),{getValue:function(){return o},setValue:function(x){o=""+x},stopTracking:function(){a._valueTracker=null,delete a[r]}}}}function Hf(a){if(!a._valueTracker){var r=eu(a)?"checked":"value";a._valueTracker=jE(a,r,""+a[r])}}function zy(a){if(!a)return!1;var r=a._valueTracker;if(!r)return!0;var o=r.getValue(),u="";return a&&(u=eu(a)?a.checked?"true":"false":a.value),a=u,a!==o?(r.setValue(a),!0):!1}function tu(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}var kE=/[\n"\\]/g;function Sa(a){return a.replace(kE,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function qf(a,r,o,u,p,g,x,C){a.name="",x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"?a.type=x:a.removeAttribute("type"),r!=null?x==="number"?(r===0&&a.value===""||a.value!=r)&&(a.value=""+Ln(r)):a.value!==""+Ln(r)&&(a.value=""+Ln(r)):x!=="submit"&&x!=="reset"||a.removeAttribute("value"),r!=null?Vf(a,x,Ln(r)):o!=null?Vf(a,x,Ln(o)):u!=null&&a.removeAttribute("value"),p==null&&g!=null&&(a.defaultChecked=!!g),p!=null&&(a.checked=p&&typeof p!="function"&&typeof p!="symbol"),C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"?a.name=""+Ln(C):a.removeAttribute("name")}function _y(a,r,o,u,p,g,x,C){if(g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(a.type=g),r!=null||o!=null){if(!(g!=="submit"&&g!=="reset"||r!=null)){Hf(a);return}o=o!=null?""+Ln(o):"",r=r!=null?""+Ln(r):o,C||r===a.value||(a.value=r),a.defaultValue=r}u=u??p,u=typeof u!="function"&&typeof u!="symbol"&&!!u,a.checked=C?a.checked:!!u,a.defaultChecked=!!u,x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(a.name=x),Hf(a)}function Vf(a,r,o){r==="number"&&tu(a.ownerDocument)===a||a.defaultValue===""+o||(a.defaultValue=""+o)}function Cs(a,r,o,u){if(a=a.options,r){r={};for(var p=0;p<o.length;p++)r["$"+o[p]]=!0;for(o=0;o<a.length;o++)p=r.hasOwnProperty("$"+a[o].value),a[o].selected!==p&&(a[o].selected=p),p&&u&&(a[o].defaultSelected=!0)}else{for(o=""+Ln(o),r=null,p=0;p<a.length;p++){if(a[p].value===o){a[p].selected=!0,u&&(a[p].defaultSelected=!0);return}r!==null||a[p].disabled||(r=a[p])}r!==null&&(r.selected=!0)}}function Uy(a,r,o){if(r!=null&&(r=""+Ln(r),r!==a.value&&(a.value=r),o==null)){a.defaultValue!==r&&(a.defaultValue=r);return}a.defaultValue=o!=null?""+Ln(o):""}function By(a,r,o,u){if(r==null){if(u!=null){if(o!=null)throw Error(i(92));if(ie(u)){if(1<u.length)throw Error(i(93));u=u[0]}o=u}o==null&&(o=""),r=o}o=Ln(r),a.defaultValue=o,u=a.textContent,u===o&&u!==""&&u!==null&&(a.value=u),Hf(a)}function Es(a,r){if(r){var o=a.firstChild;if(o&&o===a.lastChild&&o.nodeType===3){o.nodeValue=r;return}}a.textContent=r}var $E=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Fy(a,r,o){var u=r.indexOf("--")===0;o==null||typeof o=="boolean"||o===""?u?a.setProperty(r,""):r==="float"?a.cssFloat="":a[r]="":u?a.setProperty(r,o):typeof o!="number"||o===0||$E.has(r)?r==="float"?a.cssFloat=o:a[r]=(""+o).trim():a[r]=o+"px"}function Hy(a,r,o){if(r!=null&&typeof r!="object")throw Error(i(62));if(a=a.style,o!=null){for(var u in o)!o.hasOwnProperty(u)||r!=null&&r.hasOwnProperty(u)||(u.indexOf("--")===0?a.setProperty(u,""):u==="float"?a.cssFloat="":a[u]="");for(var p in r)u=r[p],r.hasOwnProperty(p)&&o[p]!==u&&Fy(a,p,u)}else for(var g in r)r.hasOwnProperty(g)&&Fy(a,g,r[g])}function Kf(a){if(a.indexOf("-")===-1)return!1;switch(a){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var OE=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),RE=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function nu(a){return RE.test(""+a)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":a}function pi(){}var Gf=null;function Yf(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var As=null,Ms=null;function qy(a){var r=qn(a);if(r&&(a=r.stateNode)){var o=a[be]||null;e:switch(a=r.stateNode,r.type){case"input":if(qf(a,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name),r=o.name,o.type==="radio"&&r!=null){for(o=a;o.parentNode;)o=o.parentNode;for(o=o.querySelectorAll('input[name="'+Sa(""+r)+'"][type="radio"]'),r=0;r<o.length;r++){var u=o[r];if(u!==a&&u.form===a.form){var p=u[be]||null;if(!p)throw Error(i(90));qf(u,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name)}}for(r=0;r<o.length;r++)u=o[r],u.form===a.form&&zy(u)}break e;case"textarea":Uy(a,o.value,o.defaultValue);break e;case"select":r=o.value,r!=null&&Cs(a,!!o.multiple,r,!1)}}}var Jf=!1;function Vy(a,r,o){if(Jf)return a(r,o);Jf=!0;try{var u=a(r);return u}finally{if(Jf=!1,(As!==null||Ms!==null)&&(Hu(),As&&(r=As,a=Ms,Ms=As=null,qy(r),a)))for(r=0;r<a.length;r++)qy(a[r])}}function Jo(a,r){var o=a.stateNode;if(o===null)return null;var u=o[be]||null;if(u===null)return null;o=u[r];e:switch(r){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(u=!u.disabled)||(a=a.type,u=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!u;break e;default:a=!1}if(a)return null;if(o&&typeof o!="function")throw Error(i(231,r,typeof o));return o}var gi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Xf=!1;if(gi)try{var Xo={};Object.defineProperty(Xo,"passive",{get:function(){Xf=!0}}),window.addEventListener("test",Xo,Xo),window.removeEventListener("test",Xo,Xo)}catch{Xf=!1}var Vi=null,Wf=null,au=null;function Ky(){if(au)return au;var a,r=Wf,o=r.length,u,p="value"in Vi?Vi.value:Vi.textContent,g=p.length;for(a=0;a<o&&r[a]===p[a];a++);var x=o-a;for(u=1;u<=x&&r[o-u]===p[g-u];u++);return au=p.slice(a,1<u?1-u:void 0)}function iu(a){var r=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&r===13&&(a=13)):a=r,a===10&&(a=13),32<=a||a===13?a:0}function ru(){return!0}function Gy(){return!1}function Kn(a){function r(o,u,p,g,x){this._reactName=o,this._targetInst=p,this.type=u,this.nativeEvent=g,this.target=x,this.currentTarget=null;for(var C in a)a.hasOwnProperty(C)&&(o=a[C],this[C]=o?o(g):g[C]);return this.isDefaultPrevented=(g.defaultPrevented!=null?g.defaultPrevented:g.returnValue===!1)?ru:Gy,this.isPropagationStopped=Gy,this}return v(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var o=this.nativeEvent;o&&(o.preventDefault?o.preventDefault():typeof o.returnValue!="unknown"&&(o.returnValue=!1),this.isDefaultPrevented=ru)},stopPropagation:function(){var o=this.nativeEvent;o&&(o.stopPropagation?o.stopPropagation():typeof o.cancelBubble!="unknown"&&(o.cancelBubble=!0),this.isPropagationStopped=ru)},persist:function(){},isPersistent:ru}),r}var Ur={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},su=Kn(Ur),Wo=v({},Ur,{view:0,detail:0}),LE=Kn(Wo),Qf,Zf,Qo,ou=v({},Wo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:th,button:0,buttons:0,relatedTarget:function(a){return a.relatedTarget===void 0?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){return"movementX"in a?a.movementX:(a!==Qo&&(Qo&&a.type==="mousemove"?(Qf=a.screenX-Qo.screenX,Zf=a.screenY-Qo.screenY):Zf=Qf=0,Qo=a),Qf)},movementY:function(a){return"movementY"in a?a.movementY:Zf}}),Yy=Kn(ou),PE=v({},ou,{dataTransfer:0}),IE=Kn(PE),zE=v({},Wo,{relatedTarget:0}),eh=Kn(zE),_E=v({},Ur,{animationName:0,elapsedTime:0,pseudoElement:0}),UE=Kn(_E),BE=v({},Ur,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),FE=Kn(BE),HE=v({},Ur,{data:0}),Jy=Kn(HE),qE={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},VE={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},KE={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function GE(a){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(a):(a=KE[a])?!!r[a]:!1}function th(){return GE}var YE=v({},Wo,{key:function(a){if(a.key){var r=qE[a.key]||a.key;if(r!=="Unidentified")return r}return a.type==="keypress"?(a=iu(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?VE[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:th,charCode:function(a){return a.type==="keypress"?iu(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?iu(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),JE=Kn(YE),XE=v({},ou,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Xy=Kn(XE),WE=v({},Wo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:th}),QE=Kn(WE),ZE=v({},Ur,{propertyName:0,elapsedTime:0,pseudoElement:0}),eA=Kn(ZE),tA=v({},ou,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0}),nA=Kn(tA),aA=v({},Ur,{newState:0,oldState:0}),iA=Kn(aA),rA=[9,13,27,32],nh=gi&&"CompositionEvent"in window,Zo=null;gi&&"documentMode"in document&&(Zo=document.documentMode);var sA=gi&&"TextEvent"in window&&!Zo,Wy=gi&&(!nh||Zo&&8<Zo&&11>=Zo),Qy=" ",Zy=!1;function ev(a,r){switch(a){case"keyup":return rA.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function tv(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var Ts=!1;function oA(a,r){switch(a){case"compositionend":return tv(r);case"keypress":return r.which!==32?null:(Zy=!0,Qy);case"textInput":return a=r.data,a===Qy&&Zy?null:a;default:return null}}function lA(a,r){if(Ts)return a==="compositionend"||!nh&&ev(a,r)?(a=Ky(),au=Wf=Vi=null,Ts=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1<r.char.length)return r.char;if(r.which)return String.fromCharCode(r.which)}return null;case"compositionend":return Wy&&r.locale!=="ko"?null:r.data;default:return null}}var cA={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function nv(a){var r=a&&a.nodeName&&a.nodeName.toLowerCase();return r==="input"?!!cA[a.type]:r==="textarea"}function av(a,r,o,u){As?Ms?Ms.push(u):Ms=[u]:As=u,r=Xu(r,"onChange"),0<r.length&&(o=new su("onChange","change",null,o,u),a.push({event:o,listeners:r}))}var el=null,tl=null;function uA(a){_0(a,0)}function lu(a){var r=Ia(a);if(zy(r))return a}function iv(a,r){if(a==="change")return r}var rv=!1;if(gi){var ah;if(gi){var ih="oninput"in document;if(!ih){var sv=document.createElement("div");sv.setAttribute("oninput","return;"),ih=typeof sv.oninput=="function"}ah=ih}else ah=!1;rv=ah&&(!document.documentMode||9<document.documentMode)}function ov(){el&&(el.detachEvent("onpropertychange",lv),tl=el=null)}function lv(a){if(a.propertyName==="value"&&lu(tl)){var r=[];av(r,tl,a,Yf(a)),Vy(uA,r)}}function dA(a,r,o){a==="focusin"?(ov(),el=r,tl=o,el.attachEvent("onpropertychange",lv)):a==="focusout"&&ov()}function fA(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return lu(tl)}function hA(a,r){if(a==="click")return lu(r)}function mA(a,r){if(a==="input"||a==="change")return lu(r)}function pA(a,r){return a===r&&(a!==0||1/a===1/r)||a!==a&&r!==r}var ra=typeof Object.is=="function"?Object.is:pA;function nl(a,r){if(ra(a,r))return!0;if(typeof a!="object"||a===null||typeof r!="object"||r===null)return!1;var o=Object.keys(a),u=Object.keys(r);if(o.length!==u.length)return!1;for(u=0;u<o.length;u++){var p=o[u];if(!Vo.call(r,p)||!ra(a[p],r[p]))return!1}return!0}function cv(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function uv(a,r){var o=cv(a);a=0;for(var u;o;){if(o.nodeType===3){if(u=a+o.textContent.length,a<=r&&u>=r)return{node:o,offset:r-a};a=u}e:{for(;o;){if(o.nextSibling){o=o.nextSibling;break e}o=o.parentNode}o=void 0}o=cv(o)}}function dv(a,r){return a&&r?a===r?!0:a&&a.nodeType===3?!1:r&&r.nodeType===3?dv(a,r.parentNode):"contains"in a?a.contains(r):a.compareDocumentPosition?!!(a.compareDocumentPosition(r)&16):!1:!1}function fv(a){a=a!=null&&a.ownerDocument!=null&&a.ownerDocument.defaultView!=null?a.ownerDocument.defaultView:window;for(var r=tu(a.document);r instanceof a.HTMLIFrameElement;){try{var o=typeof r.contentWindow.location.href=="string"}catch{o=!1}if(o)a=r.contentWindow;else break;r=tu(a.document)}return r}function rh(a){var r=a&&a.nodeName&&a.nodeName.toLowerCase();return r&&(r==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||r==="textarea"||a.contentEditable==="true")}var gA=gi&&"documentMode"in document&&11>=document.documentMode,js=null,sh=null,al=null,oh=!1;function hv(a,r,o){var u=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;oh||js==null||js!==tu(u)||(u=js,"selectionStart"in u&&rh(u)?u={start:u.selectionStart,end:u.selectionEnd}:(u=(u.ownerDocument&&u.ownerDocument.defaultView||window).getSelection(),u={anchorNode:u.anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset}),al&&nl(al,u)||(al=u,u=Xu(sh,"onSelect"),0<u.length&&(r=new su("onSelect","select",null,r,o),a.push({event:r,listeners:u}),r.target=js)))}function Br(a,r){var o={};return o[a.toLowerCase()]=r.toLowerCase(),o["Webkit"+a]="webkit"+r,o["Moz"+a]="moz"+r,o}var ks={animationend:Br("Animation","AnimationEnd"),animationiteration:Br("Animation","AnimationIteration"),animationstart:Br("Animation","AnimationStart"),transitionrun:Br("Transition","TransitionRun"),transitionstart:Br("Transition","TransitionStart"),transitioncancel:Br("Transition","TransitionCancel"),transitionend:Br("Transition","TransitionEnd")},lh={},mv={};gi&&(mv=document.createElement("div").style,"AnimationEvent"in window||(delete ks.animationend.animation,delete ks.animationiteration.animation,delete ks.animationstart.animation),"TransitionEvent"in window||delete ks.transitionend.transition);function Fr(a){if(lh[a])return lh[a];if(!ks[a])return a;var r=ks[a],o;for(o in r)if(r.hasOwnProperty(o)&&o in mv)return lh[a]=r[o];return a}var pv=Fr("animationend"),gv=Fr("animationiteration"),yv=Fr("animationstart"),yA=Fr("transitionrun"),vA=Fr("transitionstart"),bA=Fr("transitioncancel"),vv=Fr("transitionend"),bv=new Map,ch="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");ch.push("scrollEnd");function _a(a,r){bv.set(a,r),Rn(r,[a])}var cu=typeof reportError=="function"?reportError:function(a){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var r=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof a=="object"&&a!==null&&typeof a.message=="string"?String(a.message):String(a),error:a});if(!window.dispatchEvent(r))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",a);return}console.error(a)},xa=[],$s=0,uh=0;function uu(){for(var a=$s,r=uh=$s=0;r<a;){var o=xa[r];xa[r++]=null;var u=xa[r];xa[r++]=null;var p=xa[r];xa[r++]=null;var g=xa[r];if(xa[r++]=null,u!==null&&p!==null){var x=u.pending;x===null?p.next=p:(p.next=x.next,x.next=p),u.pending=p}g!==0&&Sv(o,p,g)}}function du(a,r,o,u){xa[$s++]=a,xa[$s++]=r,xa[$s++]=o,xa[$s++]=u,uh|=u,a.lanes|=u,a=a.alternate,a!==null&&(a.lanes|=u)}function dh(a,r,o,u){return du(a,r,o,u),fu(a)}function Hr(a,r){return du(a,null,null,r),fu(a)}function Sv(a,r,o){a.lanes|=o;var u=a.alternate;u!==null&&(u.lanes|=o);for(var p=!1,g=a.return;g!==null;)g.childLanes|=o,u=g.alternate,u!==null&&(u.childLanes|=o),g.tag===22&&(a=g.stateNode,a===null||a._visibility&1||(p=!0)),a=g,g=g.return;return a.tag===3?(g=a.stateNode,p&&r!==null&&(p=31-Mn(o),a=g.hiddenUpdates,u=a[p],u===null?a[p]=[r]:u.push(r),r.lane=o|536870912),g):null}function fu(a){if(50<Cl)throw Cl=0,Sm=null,Error(i(185));for(var r=a.return;r!==null;)a=r,r=a.return;return a.tag===3?a.stateNode:null}var Os={};function SA(a,r,o,u){this.tag=a,this.key=o,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=u,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function sa(a,r,o,u){return new SA(a,r,o,u)}function fh(a){return a=a.prototype,!(!a||!a.isReactComponent)}function yi(a,r){var o=a.alternate;return o===null?(o=sa(a.tag,r,a.key,a.mode),o.elementType=a.elementType,o.type=a.type,o.stateNode=a.stateNode,o.alternate=a,a.alternate=o):(o.pendingProps=r,o.type=a.type,o.flags=0,o.subtreeFlags=0,o.deletions=null),o.flags=a.flags&65011712,o.childLanes=a.childLanes,o.lanes=a.lanes,o.child=a.child,o.memoizedProps=a.memoizedProps,o.memoizedState=a.memoizedState,o.updateQueue=a.updateQueue,r=a.dependencies,o.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},o.sibling=a.sibling,o.index=a.index,o.ref=a.ref,o.refCleanup=a.refCleanup,o}function xv(a,r){a.flags&=65011714;var o=a.alternate;return o===null?(a.childLanes=0,a.lanes=r,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=o.childLanes,a.lanes=o.lanes,a.child=o.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=o.memoizedProps,a.memoizedState=o.memoizedState,a.updateQueue=o.updateQueue,a.type=o.type,r=o.dependencies,a.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),a}function hu(a,r,o,u,p,g){var x=0;if(u=a,typeof a=="function")fh(a)&&(x=1);else if(typeof a=="string")x=CM(a,o,ce.current)?26:a==="html"||a==="head"||a==="body"?27:5;else e:switch(a){case _:return a=sa(31,o,r,p),a.elementType=_,a.lanes=g,a;case N:return qr(o.children,p,g,r);case M:x=8,p|=24;break;case A:return a=sa(12,o,r,p|2),a.elementType=A,a.lanes=g,a;case z:return a=sa(13,o,r,p),a.elementType=z,a.lanes=g,a;case P:return a=sa(19,o,r,p),a.elementType=P,a.lanes=g,a;default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case j:x=10;break e;case T:x=9;break e;case F:x=11;break e;case E:x=14;break e;case L:x=16,u=null;break e}x=29,o=Error(i(130,a===null?"null":typeof a,"")),u=null}return r=sa(x,o,r,p),r.elementType=a,r.type=u,r.lanes=g,r}function qr(a,r,o,u){return a=sa(7,a,u,r),a.lanes=o,a}function hh(a,r,o){return a=sa(6,a,null,r),a.lanes=o,a}function wv(a){var r=sa(18,null,null,0);return r.stateNode=a,r}function mh(a,r,o){return r=sa(4,a.children!==null?a.children:[],a.key,r),r.lanes=o,r.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},r}var Dv=new WeakMap;function wa(a,r){if(typeof a=="object"&&a!==null){var o=Dv.get(a);return o!==void 0?o:(r={value:a,source:r,stack:qo(r)},Dv.set(a,r),r)}return{value:a,source:r,stack:qo(r)}}var Rs=[],Ls=0,mu=null,il=0,Da=[],Na=0,Ki=null,Qa=1,Za="";function vi(a,r){Rs[Ls++]=il,Rs[Ls++]=mu,mu=a,il=r}function Nv(a,r,o){Da[Na++]=Qa,Da[Na++]=Za,Da[Na++]=Ki,Ki=a;var u=Qa;a=Za;var p=32-Mn(u)-1;u&=~(1<<p),o+=1;var g=32-Mn(r)+p;if(30<g){var x=p-p%5;g=(u&(1<<x)-1).toString(32),u>>=x,p-=x,Qa=1<<32-Mn(r)+p|o<<p|u,Za=g+a}else Qa=1<<g|o<<p|u,Za=a}function ph(a){a.return!==null&&(vi(a,1),Nv(a,1,0))}function gh(a){for(;a===mu;)mu=Rs[--Ls],Rs[Ls]=null,il=Rs[--Ls],Rs[Ls]=null;for(;a===Ki;)Ki=Da[--Na],Da[Na]=null,Za=Da[--Na],Da[Na]=null,Qa=Da[--Na],Da[Na]=null}function Cv(a,r){Da[Na++]=Qa,Da[Na++]=Za,Da[Na++]=Ki,Qa=r.id,Za=r.overflow,Ki=a}var bn=null,Tt=null,nt=!1,Gi=null,Ca=!1,yh=Error(i(519));function Yi(a){var r=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw rl(wa(r,a)),yh}function Ev(a){var r=a.stateNode,o=a.type,u=a.memoizedProps;switch(r[me]=a,r[be]=u,o){case"dialog":We("cancel",r),We("close",r);break;case"iframe":case"object":case"embed":We("load",r);break;case"video":case"audio":for(o=0;o<Al.length;o++)We(Al[o],r);break;case"source":We("error",r);break;case"img":case"image":case"link":We("error",r),We("load",r);break;case"details":We("toggle",r);break;case"input":We("invalid",r),_y(r,u.value,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name,!0);break;case"select":We("invalid",r);break;case"textarea":We("invalid",r),By(r,u.value,u.defaultValue,u.children)}o=u.children,typeof o!="string"&&typeof o!="number"&&typeof o!="bigint"||r.textContent===""+o||u.suppressHydrationWarning===!0||H0(r.textContent,o)?(u.popover!=null&&(We("beforetoggle",r),We("toggle",r)),u.onScroll!=null&&We("scroll",r),u.onScrollEnd!=null&&We("scrollend",r),u.onClick!=null&&(r.onclick=pi),r=!0):r=!1,r||Yi(a,!0)}function Av(a){for(bn=a.return;bn;)switch(bn.tag){case 5:case 31:case 13:Ca=!1;return;case 27:case 3:Ca=!0;return;default:bn=bn.return}}function Ps(a){if(a!==bn)return!1;if(!nt)return Av(a),nt=!0,!1;var r=a.tag,o;if((o=r!==3&&r!==27)&&((o=r===5)&&(o=a.type,o=!(o!=="form"&&o!=="button")||Lm(a.type,a.memoizedProps)),o=!o),o&&Tt&&Yi(a),Av(a),r===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(i(317));Tt=Q0(a)}else if(r===31){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(i(317));Tt=Q0(a)}else r===27?(r=Tt,lr(a.type)?(a=Um,Um=null,Tt=a):Tt=r):Tt=bn?Aa(a.stateNode.nextSibling):null;return!0}function Vr(){Tt=bn=null,nt=!1}function vh(){var a=Gi;return a!==null&&(Xn===null?Xn=a:Xn.push.apply(Xn,a),Gi=null),a}function rl(a){Gi===null?Gi=[a]:Gi.push(a)}var bh=k(null),Kr=null,bi=null;function Ji(a,r,o){oe(bh,r._currentValue),r._currentValue=o}function Si(a){a._currentValue=bh.current,J(bh)}function Sh(a,r,o){for(;a!==null;){var u=a.alternate;if((a.childLanes&r)!==r?(a.childLanes|=r,u!==null&&(u.childLanes|=r)):u!==null&&(u.childLanes&r)!==r&&(u.childLanes|=r),a===o)break;a=a.return}}function xh(a,r,o,u){var p=a.child;for(p!==null&&(p.return=a);p!==null;){var g=p.dependencies;if(g!==null){var x=p.child;g=g.firstContext;e:for(;g!==null;){var C=g;g=p;for(var $=0;$<r.length;$++)if(C.context===r[$]){g.lanes|=o,C=g.alternate,C!==null&&(C.lanes|=o),Sh(g.return,o,a),u||(x=null);break e}g=C.next}}else if(p.tag===18){if(x=p.return,x===null)throw Error(i(341));x.lanes|=o,g=x.alternate,g!==null&&(g.lanes|=o),Sh(x,o,a),x=null}else x=p.child;if(x!==null)x.return=p;else for(x=p;x!==null;){if(x===a){x=null;break}if(p=x.sibling,p!==null){p.return=x.return,x=p;break}x=x.return}p=x}}function Is(a,r,o,u){a=null;for(var p=r,g=!1;p!==null;){if(!g){if((p.flags&524288)!==0)g=!0;else if((p.flags&262144)!==0)break}if(p.tag===10){var x=p.alternate;if(x===null)throw Error(i(387));if(x=x.memoizedProps,x!==null){var C=p.type;ra(p.pendingProps.value,x.value)||(a!==null?a.push(C):a=[C])}}else if(p===Je.current){if(x=p.alternate,x===null)throw Error(i(387));x.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(a!==null?a.push($l):a=[$l])}p=p.return}a!==null&&xh(r,a,o,u),r.flags|=262144}function pu(a){for(a=a.firstContext;a!==null;){if(!ra(a.context._currentValue,a.memoizedValue))return!0;a=a.next}return!1}function Gr(a){Kr=a,bi=null,a=a.dependencies,a!==null&&(a.firstContext=null)}function Sn(a){return Mv(Kr,a)}function gu(a,r){return Kr===null&&Gr(a),Mv(a,r)}function Mv(a,r){var o=r._currentValue;if(r={context:r,memoizedValue:o,next:null},bi===null){if(a===null)throw Error(i(308));bi=r,a.dependencies={lanes:0,firstContext:r},a.flags|=524288}else bi=bi.next=r;return o}var xA=typeof AbortController<"u"?AbortController:function(){var a=[],r=this.signal={aborted:!1,addEventListener:function(o,u){a.push(u)}};this.abort=function(){r.aborted=!0,a.forEach(function(o){return o()})}},wA=e.unstable_scheduleCallback,DA=e.unstable_NormalPriority,Qt={$$typeof:j,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function wh(){return{controller:new xA,data:new Map,refCount:0}}function sl(a){a.refCount--,a.refCount===0&&wA(DA,function(){a.controller.abort()})}var ol=null,Dh=0,zs=0,_s=null;function NA(a,r){if(ol===null){var o=ol=[];Dh=0,zs=Em(),_s={status:"pending",value:void 0,then:function(u){o.push(u)}}}return Dh++,r.then(Tv,Tv),r}function Tv(){if(--Dh===0&&ol!==null){_s!==null&&(_s.status="fulfilled");var a=ol;ol=null,zs=0,_s=null;for(var r=0;r<a.length;r++)(0,a[r])()}}function CA(a,r){var o=[],u={status:"pending",value:null,reason:null,then:function(p){o.push(p)}};return a.then(function(){u.status="fulfilled",u.value=r;for(var p=0;p<o.length;p++)(0,o[p])(r)},function(p){for(u.status="rejected",u.reason=p,p=0;p<o.length;p++)(0,o[p])(void 0)}),u}var jv=R.S;R.S=function(a,r){h0=un(),typeof r=="object"&&r!==null&&typeof r.then=="function"&&NA(a,r),jv!==null&&jv(a,r)};var Yr=k(null);function Nh(){var a=Yr.current;return a!==null?a:wt.pooledCache}function yu(a,r){r===null?oe(Yr,Yr.current):oe(Yr,r.pool)}function kv(){var a=Nh();return a===null?null:{parent:Qt._currentValue,pool:a}}var Us=Error(i(460)),Ch=Error(i(474)),vu=Error(i(542)),bu={then:function(){}};function $v(a){return a=a.status,a==="fulfilled"||a==="rejected"}function Ov(a,r,o){switch(o=a[o],o===void 0?a.push(r):o!==r&&(r.then(pi,pi),r=o),r.status){case"fulfilled":return r.value;case"rejected":throw a=r.reason,Lv(a),a;default:if(typeof r.status=="string")r.then(pi,pi);else{if(a=wt,a!==null&&100<a.shellSuspendCounter)throw Error(i(482));a=r,a.status="pending",a.then(function(u){if(r.status==="pending"){var p=r;p.status="fulfilled",p.value=u}},function(u){if(r.status==="pending"){var p=r;p.status="rejected",p.reason=u}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw a=r.reason,Lv(a),a}throw Xr=r,Us}}function Jr(a){try{var r=a._init;return r(a._payload)}catch(o){throw o!==null&&typeof o=="object"&&typeof o.then=="function"?(Xr=o,Us):o}}var Xr=null;function Rv(){if(Xr===null)throw Error(i(459));var a=Xr;return Xr=null,a}function Lv(a){if(a===Us||a===vu)throw Error(i(483))}var Bs=null,ll=0;function Su(a){var r=ll;return ll+=1,Bs===null&&(Bs=[]),Ov(Bs,a,r)}function cl(a,r){r=r.props.ref,a.ref=r!==void 0?r:null}function xu(a,r){throw r.$$typeof===b?Error(i(525)):(a=Object.prototype.toString.call(r),Error(i(31,a==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":a)))}function Pv(a){function r(B,I){if(a){var q=B.deletions;q===null?(B.deletions=[I],B.flags|=16):q.push(I)}}function o(B,I){if(!a)return null;for(;I!==null;)r(B,I),I=I.sibling;return null}function u(B){for(var I=new Map;B!==null;)B.key!==null?I.set(B.key,B):I.set(B.index,B),B=B.sibling;return I}function p(B,I){return B=yi(B,I),B.index=0,B.sibling=null,B}function g(B,I,q){return B.index=q,a?(q=B.alternate,q!==null?(q=q.index,q<I?(B.flags|=67108866,I):q):(B.flags|=67108866,I)):(B.flags|=1048576,I)}function x(B){return a&&B.alternate===null&&(B.flags|=67108866),B}function C(B,I,q,te){return I===null||I.tag!==6?(I=hh(q,B.mode,te),I.return=B,I):(I=p(I,q),I.return=B,I)}function $(B,I,q,te){var je=q.type;return je===N?ee(B,I,q.props.children,te,q.key):I!==null&&(I.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===L&&Jr(je)===I.type)?(I=p(I,q.props),cl(I,q),I.return=B,I):(I=hu(q.type,q.key,q.props,null,B.mode,te),cl(I,q),I.return=B,I)}function V(B,I,q,te){return I===null||I.tag!==4||I.stateNode.containerInfo!==q.containerInfo||I.stateNode.implementation!==q.implementation?(I=mh(q,B.mode,te),I.return=B,I):(I=p(I,q.children||[]),I.return=B,I)}function ee(B,I,q,te,je){return I===null||I.tag!==7?(I=qr(q,B.mode,te,je),I.return=B,I):(I=p(I,q),I.return=B,I)}function ne(B,I,q){if(typeof I=="string"&&I!==""||typeof I=="number"||typeof I=="bigint")return I=hh(""+I,B.mode,q),I.return=B,I;if(typeof I=="object"&&I!==null){switch(I.$$typeof){case D:return q=hu(I.type,I.key,I.props,null,B.mode,q),cl(q,I),q.return=B,q;case w:return I=mh(I,B.mode,q),I.return=B,I;case L:return I=Jr(I),ne(B,I,q)}if(ie(I)||U(I))return I=qr(I,B.mode,q,null),I.return=B,I;if(typeof I.then=="function")return ne(B,Su(I),q);if(I.$$typeof===j)return ne(B,gu(B,I),q);xu(B,I)}return null}function K(B,I,q,te){var je=I!==null?I.key:null;if(typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint")return je!==null?null:C(B,I,""+q,te);if(typeof q=="object"&&q!==null){switch(q.$$typeof){case D:return q.key===je?$(B,I,q,te):null;case w:return q.key===je?V(B,I,q,te):null;case L:return q=Jr(q),K(B,I,q,te)}if(ie(q)||U(q))return je!==null?null:ee(B,I,q,te,null);if(typeof q.then=="function")return K(B,I,Su(q),te);if(q.$$typeof===j)return K(B,I,gu(B,q),te);xu(B,q)}return null}function X(B,I,q,te,je){if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return B=B.get(q)||null,C(I,B,""+te,je);if(typeof te=="object"&&te!==null){switch(te.$$typeof){case D:return B=B.get(te.key===null?q:te.key)||null,$(I,B,te,je);case w:return B=B.get(te.key===null?q:te.key)||null,V(I,B,te,je);case L:return te=Jr(te),X(B,I,q,te,je)}if(ie(te)||U(te))return B=B.get(q)||null,ee(I,B,te,je,null);if(typeof te.then=="function")return X(B,I,q,Su(te),je);if(te.$$typeof===j)return X(B,I,q,gu(I,te),je);xu(I,te)}return null}function xe(B,I,q,te){for(var je=null,st=null,Ne=I,qe=I=0,et=null;Ne!==null&&qe<q.length;qe++){Ne.index>qe?(et=Ne,Ne=null):et=Ne.sibling;var ot=K(B,Ne,q[qe],te);if(ot===null){Ne===null&&(Ne=et);break}a&&Ne&&ot.alternate===null&&r(B,Ne),I=g(ot,I,qe),st===null?je=ot:st.sibling=ot,st=ot,Ne=et}if(qe===q.length)return o(B,Ne),nt&&vi(B,qe),je;if(Ne===null){for(;qe<q.length;qe++)Ne=ne(B,q[qe],te),Ne!==null&&(I=g(Ne,I,qe),st===null?je=Ne:st.sibling=Ne,st=Ne);return nt&&vi(B,qe),je}for(Ne=u(Ne);qe<q.length;qe++)et=X(Ne,B,qe,q[qe],te),et!==null&&(a&&et.alternate!==null&&Ne.delete(et.key===null?qe:et.key),I=g(et,I,qe),st===null?je=et:st.sibling=et,st=et);return a&&Ne.forEach(function(hr){return r(B,hr)}),nt&&vi(B,qe),je}function Oe(B,I,q,te){if(q==null)throw Error(i(151));for(var je=null,st=null,Ne=I,qe=I=0,et=null,ot=q.next();Ne!==null&&!ot.done;qe++,ot=q.next()){Ne.index>qe?(et=Ne,Ne=null):et=Ne.sibling;var hr=K(B,Ne,ot.value,te);if(hr===null){Ne===null&&(Ne=et);break}a&&Ne&&hr.alternate===null&&r(B,Ne),I=g(hr,I,qe),st===null?je=hr:st.sibling=hr,st=hr,Ne=et}if(ot.done)return o(B,Ne),nt&&vi(B,qe),je;if(Ne===null){for(;!ot.done;qe++,ot=q.next())ot=ne(B,ot.value,te),ot!==null&&(I=g(ot,I,qe),st===null?je=ot:st.sibling=ot,st=ot);return nt&&vi(B,qe),je}for(Ne=u(Ne);!ot.done;qe++,ot=q.next())ot=X(Ne,B,qe,ot.value,te),ot!==null&&(a&&ot.alternate!==null&&Ne.delete(ot.key===null?qe:ot.key),I=g(ot,I,qe),st===null?je=ot:st.sibling=ot,st=ot);return a&&Ne.forEach(function(PM){return r(B,PM)}),nt&&vi(B,qe),je}function vt(B,I,q,te){if(typeof q=="object"&&q!==null&&q.type===N&&q.key===null&&(q=q.props.children),typeof q=="object"&&q!==null){switch(q.$$typeof){case D:e:{for(var je=q.key;I!==null;){if(I.key===je){if(je=q.type,je===N){if(I.tag===7){o(B,I.sibling),te=p(I,q.props.children),te.return=B,B=te;break e}}else if(I.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===L&&Jr(je)===I.type){o(B,I.sibling),te=p(I,q.props),cl(te,q),te.return=B,B=te;break e}o(B,I);break}else r(B,I);I=I.sibling}q.type===N?(te=qr(q.props.children,B.mode,te,q.key),te.return=B,B=te):(te=hu(q.type,q.key,q.props,null,B.mode,te),cl(te,q),te.return=B,B=te)}return x(B);case w:e:{for(je=q.key;I!==null;){if(I.key===je)if(I.tag===4&&I.stateNode.containerInfo===q.containerInfo&&I.stateNode.implementation===q.implementation){o(B,I.sibling),te=p(I,q.children||[]),te.return=B,B=te;break e}else{o(B,I);break}else r(B,I);I=I.sibling}te=mh(q,B.mode,te),te.return=B,B=te}return x(B);case L:return q=Jr(q),vt(B,I,q,te)}if(ie(q))return xe(B,I,q,te);if(U(q)){if(je=U(q),typeof je!="function")throw Error(i(150));return q=je.call(q),Oe(B,I,q,te)}if(typeof q.then=="function")return vt(B,I,Su(q),te);if(q.$$typeof===j)return vt(B,I,gu(B,q),te);xu(B,q)}return typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint"?(q=""+q,I!==null&&I.tag===6?(o(B,I.sibling),te=p(I,q),te.return=B,B=te):(o(B,I),te=hh(q,B.mode,te),te.return=B,B=te),x(B)):o(B,I)}return function(B,I,q,te){try{ll=0;var je=vt(B,I,q,te);return Bs=null,je}catch(Ne){if(Ne===Us||Ne===vu)throw Ne;var st=sa(29,Ne,null,B.mode);return st.lanes=te,st.return=B,st}finally{}}}var Wr=Pv(!0),Iv=Pv(!1),Xi=!1;function Eh(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ah(a,r){a=a.updateQueue,r.updateQueue===a&&(r.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,callbacks:null})}function Wi(a){return{lane:a,tag:0,payload:null,callback:null,next:null}}function Qi(a,r,o){var u=a.updateQueue;if(u===null)return null;if(u=u.shared,(lt&2)!==0){var p=u.pending;return p===null?r.next=r:(r.next=p.next,p.next=r),u.pending=r,r=fu(a),Sv(a,null,o),r}return du(a,u,r,o),fu(a)}function ul(a,r,o){if(r=r.updateQueue,r!==null&&(r=r.shared,(o&4194048)!==0)){var u=r.lanes;u&=a.pendingLanes,o|=u,r.lanes=o,H(a,o)}}function Mh(a,r){var o=a.updateQueue,u=a.alternate;if(u!==null&&(u=u.updateQueue,o===u)){var p=null,g=null;if(o=o.firstBaseUpdate,o!==null){do{var x={lane:o.lane,tag:o.tag,payload:o.payload,callback:null,next:null};g===null?p=g=x:g=g.next=x,o=o.next}while(o!==null);g===null?p=g=r:g=g.next=r}else p=g=r;o={baseState:u.baseState,firstBaseUpdate:p,lastBaseUpdate:g,shared:u.shared,callbacks:u.callbacks},a.updateQueue=o;return}a=o.lastBaseUpdate,a===null?o.firstBaseUpdate=r:a.next=r,o.lastBaseUpdate=r}var Th=!1;function dl(){if(Th){var a=_s;if(a!==null)throw a}}function fl(a,r,o,u){Th=!1;var p=a.updateQueue;Xi=!1;var g=p.firstBaseUpdate,x=p.lastBaseUpdate,C=p.shared.pending;if(C!==null){p.shared.pending=null;var $=C,V=$.next;$.next=null,x===null?g=V:x.next=V,x=$;var ee=a.alternate;ee!==null&&(ee=ee.updateQueue,C=ee.lastBaseUpdate,C!==x&&(C===null?ee.firstBaseUpdate=V:C.next=V,ee.lastBaseUpdate=$))}if(g!==null){var ne=p.baseState;x=0,ee=V=$=null,C=g;do{var K=C.lane&-536870913,X=K!==C.lane;if(X?(Ze&K)===K:(u&K)===K){K!==0&&K===zs&&(Th=!0),ee!==null&&(ee=ee.next={lane:0,tag:C.tag,payload:C.payload,callback:null,next:null});e:{var xe=a,Oe=C;K=r;var vt=o;switch(Oe.tag){case 1:if(xe=Oe.payload,typeof xe=="function"){ne=xe.call(vt,ne,K);break e}ne=xe;break e;case 3:xe.flags=xe.flags&-65537|128;case 0:if(xe=Oe.payload,K=typeof xe=="function"?xe.call(vt,ne,K):xe,K==null)break e;ne=v({},ne,K);break e;case 2:Xi=!0}}K=C.callback,K!==null&&(a.flags|=64,X&&(a.flags|=8192),X=p.callbacks,X===null?p.callbacks=[K]:X.push(K))}else X={lane:K,tag:C.tag,payload:C.payload,callback:C.callback,next:null},ee===null?(V=ee=X,$=ne):ee=ee.next=X,x|=K;if(C=C.next,C===null){if(C=p.shared.pending,C===null)break;X=C,C=X.next,X.next=null,p.lastBaseUpdate=X,p.shared.pending=null}}while(!0);ee===null&&($=ne),p.baseState=$,p.firstBaseUpdate=V,p.lastBaseUpdate=ee,g===null&&(p.shared.lanes=0),ar|=x,a.lanes=x,a.memoizedState=ne}}function zv(a,r){if(typeof a!="function")throw Error(i(191,a));a.call(r)}function _v(a,r){var o=a.callbacks;if(o!==null)for(a.callbacks=null,a=0;a<o.length;a++)zv(o[a],r)}var Fs=k(null),wu=k(0);function Uv(a,r){a=Ti,oe(wu,a),oe(Fs,r),Ti=a|r.baseLanes}function jh(){oe(wu,Ti),oe(Fs,Fs.current)}function kh(){Ti=wu.current,J(Fs),J(wu)}var oa=k(null),Ea=null;function Zi(a){var r=a.alternate;oe(Jt,Jt.current&1),oe(oa,a),Ea===null&&(r===null||Fs.current!==null||r.memoizedState!==null)&&(Ea=a)}function $h(a){oe(Jt,Jt.current),oe(oa,a),Ea===null&&(Ea=a)}function Bv(a){a.tag===22?(oe(Jt,Jt.current),oe(oa,a),Ea===null&&(Ea=a)):er()}function er(){oe(Jt,Jt.current),oe(oa,oa.current)}function la(a){J(oa),Ea===a&&(Ea=null),J(Jt)}var Jt=k(0);function Du(a){for(var r=a;r!==null;){if(r.tag===13){var o=r.memoizedState;if(o!==null&&(o=o.dehydrated,o===null||zm(o)||_m(o)))return r}else if(r.tag===19&&(r.memoizedProps.revealOrder==="forwards"||r.memoizedProps.revealOrder==="backwards"||r.memoizedProps.revealOrder==="unstable_legacy-backwards"||r.memoizedProps.revealOrder==="together")){if((r.flags&128)!==0)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===a)break;for(;r.sibling===null;){if(r.return===null||r.return===a)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var xi=0,He=null,gt=null,Zt=null,Nu=!1,Hs=!1,Qr=!1,Cu=0,hl=0,qs=null,EA=0;function Ft(){throw Error(i(321))}function Oh(a,r){if(r===null)return!1;for(var o=0;o<r.length&&o<a.length;o++)if(!ra(a[o],r[o]))return!1;return!0}function Rh(a,r,o,u,p,g){return xi=g,He=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,R.H=a===null||a.memoizedState===null?Nb:Jh,Qr=!1,g=o(u,p),Qr=!1,Hs&&(g=Hv(r,o,u,p)),Fv(a),g}function Fv(a){R.H=gl;var r=gt!==null&>.next!==null;if(xi=0,Zt=gt=He=null,Nu=!1,hl=0,qs=null,r)throw Error(i(300));a===null||en||(a=a.dependencies,a!==null&&pu(a)&&(en=!0))}function Hv(a,r,o,u){He=a;var p=0;do{if(Hs&&(qs=null),hl=0,Hs=!1,25<=p)throw Error(i(301));if(p+=1,Zt=gt=null,a.updateQueue!=null){var g=a.updateQueue;g.lastEffect=null,g.events=null,g.stores=null,g.memoCache!=null&&(g.memoCache.index=0)}R.H=Cb,g=r(o,u)}while(Hs);return g}function AA(){var a=R.H,r=a.useState()[0];return r=typeof r.then=="function"?ml(r):r,a=a.useState()[0],(gt!==null?gt.memoizedState:null)!==a&&(He.flags|=1024),r}function Lh(){var a=Cu!==0;return Cu=0,a}function Ph(a,r,o){r.updateQueue=a.updateQueue,r.flags&=-2053,a.lanes&=~o}function Ih(a){if(Nu){for(a=a.memoizedState;a!==null;){var r=a.queue;r!==null&&(r.pending=null),a=a.next}Nu=!1}xi=0,Zt=gt=He=null,Hs=!1,hl=Cu=0,qs=null}function Pn(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Zt===null?He.memoizedState=Zt=a:Zt=Zt.next=a,Zt}function Xt(){if(gt===null){var a=He.alternate;a=a!==null?a.memoizedState:null}else a=gt.next;var r=Zt===null?He.memoizedState:Zt.next;if(r!==null)Zt=r,gt=a;else{if(a===null)throw He.alternate===null?Error(i(467)):Error(i(310));gt=a,a={memoizedState:gt.memoizedState,baseState:gt.baseState,baseQueue:gt.baseQueue,queue:gt.queue,next:null},Zt===null?He.memoizedState=Zt=a:Zt=Zt.next=a}return Zt}function Eu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ml(a){var r=hl;return hl+=1,qs===null&&(qs=[]),a=Ov(qs,a,r),r=He,(Zt===null?r.memoizedState:Zt.next)===null&&(r=r.alternate,R.H=r===null||r.memoizedState===null?Nb:Jh),a}function Au(a){if(a!==null&&typeof a=="object"){if(typeof a.then=="function")return ml(a);if(a.$$typeof===j)return Sn(a)}throw Error(i(438,String(a)))}function zh(a){var r=null,o=He.updateQueue;if(o!==null&&(r=o.memoCache),r==null){var u=He.alternate;u!==null&&(u=u.updateQueue,u!==null&&(u=u.memoCache,u!=null&&(r={data:u.data.map(function(p){return p.slice()}),index:0})))}if(r==null&&(r={data:[],index:0}),o===null&&(o=Eu(),He.updateQueue=o),o.memoCache=r,o=r.data[r.index],o===void 0)for(o=r.data[r.index]=Array(a),u=0;u<a;u++)o[u]=Y;return r.index++,o}function wi(a,r){return typeof r=="function"?r(a):r}function Mu(a){var r=Xt();return _h(r,gt,a)}function _h(a,r,o){var u=a.queue;if(u===null)throw Error(i(311));u.lastRenderedReducer=o;var p=a.baseQueue,g=u.pending;if(g!==null){if(p!==null){var x=p.next;p.next=g.next,g.next=x}r.baseQueue=p=g,u.pending=null}if(g=a.baseState,p===null)a.memoizedState=g;else{r=p.next;var C=x=null,$=null,V=r,ee=!1;do{var ne=V.lane&-536870913;if(ne!==V.lane?(Ze&ne)===ne:(xi&ne)===ne){var K=V.revertLane;if(K===0)$!==null&&($=$.next={lane:0,revertLane:0,gesture:null,action:V.action,hasEagerState:V.hasEagerState,eagerState:V.eagerState,next:null}),ne===zs&&(ee=!0);else if((xi&K)===K){V=V.next,K===zs&&(ee=!0);continue}else ne={lane:0,revertLane:V.revertLane,gesture:null,action:V.action,hasEagerState:V.hasEagerState,eagerState:V.eagerState,next:null},$===null?(C=$=ne,x=g):$=$.next=ne,He.lanes|=K,ar|=K;ne=V.action,Qr&&o(g,ne),g=V.hasEagerState?V.eagerState:o(g,ne)}else K={lane:ne,revertLane:V.revertLane,gesture:V.gesture,action:V.action,hasEagerState:V.hasEagerState,eagerState:V.eagerState,next:null},$===null?(C=$=K,x=g):$=$.next=K,He.lanes|=ne,ar|=ne;V=V.next}while(V!==null&&V!==r);if($===null?x=g:$.next=C,!ra(g,a.memoizedState)&&(en=!0,ee&&(o=_s,o!==null)))throw o;a.memoizedState=g,a.baseState=x,a.baseQueue=$,u.lastRenderedState=g}return p===null&&(u.lanes=0),[a.memoizedState,u.dispatch]}function Uh(a){var r=Xt(),o=r.queue;if(o===null)throw Error(i(311));o.lastRenderedReducer=a;var u=o.dispatch,p=o.pending,g=r.memoizedState;if(p!==null){o.pending=null;var x=p=p.next;do g=a(g,x.action),x=x.next;while(x!==p);ra(g,r.memoizedState)||(en=!0),r.memoizedState=g,r.baseQueue===null&&(r.baseState=g),o.lastRenderedState=g}return[g,u]}function qv(a,r,o){var u=He,p=Xt(),g=nt;if(g){if(o===void 0)throw Error(i(407));o=o()}else o=r();var x=!ra((gt||p).memoizedState,o);if(x&&(p.memoizedState=o,en=!0),p=p.queue,Hh(Gv.bind(null,u,p,a),[a]),p.getSnapshot!==r||x||Zt!==null&&Zt.memoizedState.tag&1){if(u.flags|=2048,Vs(9,{destroy:void 0},Kv.bind(null,u,p,o,r),null),wt===null)throw Error(i(349));g||(xi&127)!==0||Vv(u,r,o)}return o}function Vv(a,r,o){a.flags|=16384,a={getSnapshot:r,value:o},r=He.updateQueue,r===null?(r=Eu(),He.updateQueue=r,r.stores=[a]):(o=r.stores,o===null?r.stores=[a]:o.push(a))}function Kv(a,r,o,u){r.value=o,r.getSnapshot=u,Yv(r)&&Jv(a)}function Gv(a,r,o){return o(function(){Yv(r)&&Jv(a)})}function Yv(a){var r=a.getSnapshot;a=a.value;try{var o=r();return!ra(a,o)}catch{return!0}}function Jv(a){var r=Hr(a,2);r!==null&&Wn(r,a,2)}function Bh(a){var r=Pn();if(typeof a=="function"){var o=a;if(a=o(),Qr){Pa(!0);try{o()}finally{Pa(!1)}}}return r.memoizedState=r.baseState=a,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:wi,lastRenderedState:a},r}function Xv(a,r,o,u){return a.baseState=o,_h(a,gt,typeof u=="function"?u:wi)}function MA(a,r,o,u,p){if(ku(a))throw Error(i(485));if(a=r.action,a!==null){var g={payload:p,action:a,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(x){g.listeners.push(x)}};R.T!==null?o(!0):g.isTransition=!1,u(g),o=r.pending,o===null?(g.next=r.pending=g,Wv(r,g)):(g.next=o.next,r.pending=o.next=g)}}function Wv(a,r){var o=r.action,u=r.payload,p=a.state;if(r.isTransition){var g=R.T,x={};R.T=x;try{var C=o(p,u),$=R.S;$!==null&&$(x,C),Qv(a,r,C)}catch(V){Fh(a,r,V)}finally{g!==null&&x.types!==null&&(g.types=x.types),R.T=g}}else try{g=o(p,u),Qv(a,r,g)}catch(V){Fh(a,r,V)}}function Qv(a,r,o){o!==null&&typeof o=="object"&&typeof o.then=="function"?o.then(function(u){Zv(a,r,u)},function(u){return Fh(a,r,u)}):Zv(a,r,o)}function Zv(a,r,o){r.status="fulfilled",r.value=o,eb(r),a.state=o,r=a.pending,r!==null&&(o=r.next,o===r?a.pending=null:(o=o.next,r.next=o,Wv(a,o)))}function Fh(a,r,o){var u=a.pending;if(a.pending=null,u!==null){u=u.next;do r.status="rejected",r.reason=o,eb(r),r=r.next;while(r!==u)}a.action=null}function eb(a){a=a.listeners;for(var r=0;r<a.length;r++)(0,a[r])()}function tb(a,r){return r}function nb(a,r){if(nt){var o=wt.formState;if(o!==null){e:{var u=He;if(nt){if(Tt){t:{for(var p=Tt,g=Ca;p.nodeType!==8;){if(!g){p=null;break t}if(p=Aa(p.nextSibling),p===null){p=null;break t}}g=p.data,p=g==="F!"||g==="F"?p:null}if(p){Tt=Aa(p.nextSibling),u=p.data==="F!";break e}}Yi(u)}u=!1}u&&(r=o[0])}}return o=Pn(),o.memoizedState=o.baseState=r,u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:tb,lastRenderedState:r},o.queue=u,o=xb.bind(null,He,u),u.dispatch=o,u=Bh(!1),g=Yh.bind(null,He,!1,u.queue),u=Pn(),p={state:r,dispatch:null,action:a,pending:null},u.queue=p,o=MA.bind(null,He,p,g,o),p.dispatch=o,u.memoizedState=a,[r,o,!1]}function ab(a){var r=Xt();return ib(r,gt,a)}function ib(a,r,o){if(r=_h(a,r,tb)[0],a=Mu(wi)[0],typeof r=="object"&&r!==null&&typeof r.then=="function")try{var u=ml(r)}catch(x){throw x===Us?vu:x}else u=r;r=Xt();var p=r.queue,g=p.dispatch;return o!==r.memoizedState&&(He.flags|=2048,Vs(9,{destroy:void 0},TA.bind(null,p,o),null)),[u,g,a]}function TA(a,r){a.action=r}function rb(a){var r=Xt(),o=gt;if(o!==null)return ib(r,o,a);Xt(),r=r.memoizedState,o=Xt();var u=o.queue.dispatch;return o.memoizedState=a,[r,u,!1]}function Vs(a,r,o,u){return a={tag:a,create:o,deps:u,inst:r,next:null},r=He.updateQueue,r===null&&(r=Eu(),He.updateQueue=r),o=r.lastEffect,o===null?r.lastEffect=a.next=a:(u=o.next,o.next=a,a.next=u,r.lastEffect=a),a}function sb(){return Xt().memoizedState}function Tu(a,r,o,u){var p=Pn();He.flags|=a,p.memoizedState=Vs(1|r,{destroy:void 0},o,u===void 0?null:u)}function ju(a,r,o,u){var p=Xt();u=u===void 0?null:u;var g=p.memoizedState.inst;gt!==null&&u!==null&&Oh(u,gt.memoizedState.deps)?p.memoizedState=Vs(r,g,o,u):(He.flags|=a,p.memoizedState=Vs(1|r,g,o,u))}function ob(a,r){Tu(8390656,8,a,r)}function Hh(a,r){ju(2048,8,a,r)}function jA(a){He.flags|=4;var r=He.updateQueue;if(r===null)r=Eu(),He.updateQueue=r,r.events=[a];else{var o=r.events;o===null?r.events=[a]:o.push(a)}}function lb(a){var r=Xt().memoizedState;return jA({ref:r,nextImpl:a}),function(){if((lt&2)!==0)throw Error(i(440));return r.impl.apply(void 0,arguments)}}function cb(a,r){return ju(4,2,a,r)}function ub(a,r){return ju(4,4,a,r)}function db(a,r){if(typeof r=="function"){a=a();var o=r(a);return function(){typeof o=="function"?o():r(null)}}if(r!=null)return a=a(),r.current=a,function(){r.current=null}}function fb(a,r,o){o=o!=null?o.concat([a]):null,ju(4,4,db.bind(null,r,a),o)}function qh(){}function hb(a,r){var o=Xt();r=r===void 0?null:r;var u=o.memoizedState;return r!==null&&Oh(r,u[1])?u[0]:(o.memoizedState=[a,r],a)}function mb(a,r){var o=Xt();r=r===void 0?null:r;var u=o.memoizedState;if(r!==null&&Oh(r,u[1]))return u[0];if(u=a(),Qr){Pa(!0);try{a()}finally{Pa(!1)}}return o.memoizedState=[u,r],u}function Vh(a,r,o){return o===void 0||(xi&1073741824)!==0&&(Ze&261930)===0?a.memoizedState=r:(a.memoizedState=o,a=p0(),He.lanes|=a,ar|=a,o)}function pb(a,r,o,u){return ra(o,r)?o:Fs.current!==null?(a=Vh(a,o,u),ra(a,r)||(en=!0),a):(xi&42)===0||(xi&1073741824)!==0&&(Ze&261930)===0?(en=!0,a.memoizedState=o):(a=p0(),He.lanes|=a,ar|=a,r)}function gb(a,r,o,u,p){var g=W.p;W.p=g!==0&&8>g?g:8;var x=R.T,C={};R.T=C,Yh(a,!1,r,o);try{var $=p(),V=R.S;if(V!==null&&V(C,$),$!==null&&typeof $=="object"&&typeof $.then=="function"){var ee=CA($,u);pl(a,r,ee,da(a))}else pl(a,r,u,da(a))}catch(ne){pl(a,r,{then:function(){},status:"rejected",reason:ne},da())}finally{W.p=g,x!==null&&C.types!==null&&(x.types=C.types),R.T=x}}function kA(){}function Kh(a,r,o,u){if(a.tag!==5)throw Error(i(476));var p=yb(a).queue;gb(a,p,r,se,o===null?kA:function(){return vb(a),o(u)})}function yb(a){var r=a.memoizedState;if(r!==null)return r;r={memoizedState:se,baseState:se,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:wi,lastRenderedState:se},next:null};var o={};return r.next={memoizedState:o,baseState:o,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:wi,lastRenderedState:o},next:null},a.memoizedState=r,a=a.alternate,a!==null&&(a.memoizedState=r),r}function vb(a){var r=yb(a);r.next===null&&(r=a.alternate.memoizedState),pl(a,r.next.queue,{},da())}function Gh(){return Sn($l)}function bb(){return Xt().memoizedState}function Sb(){return Xt().memoizedState}function $A(a){for(var r=a.return;r!==null;){switch(r.tag){case 24:case 3:var o=da();a=Wi(o);var u=Qi(r,a,o);u!==null&&(Wn(u,r,o),ul(u,r,o)),r={cache:wh()},a.payload=r;return}r=r.return}}function OA(a,r,o){var u=da();o={lane:u,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},ku(a)?wb(r,o):(o=dh(a,r,o,u),o!==null&&(Wn(o,a,u),Db(o,r,u)))}function xb(a,r,o){var u=da();pl(a,r,o,u)}function pl(a,r,o,u){var p={lane:u,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null};if(ku(a))wb(r,p);else{var g=a.alternate;if(a.lanes===0&&(g===null||g.lanes===0)&&(g=r.lastRenderedReducer,g!==null))try{var x=r.lastRenderedState,C=g(x,o);if(p.hasEagerState=!0,p.eagerState=C,ra(C,x))return du(a,r,p,0),wt===null&&uu(),!1}catch{}finally{}if(o=dh(a,r,p,u),o!==null)return Wn(o,a,u),Db(o,r,u),!0}return!1}function Yh(a,r,o,u){if(u={lane:2,revertLane:Em(),gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},ku(a)){if(r)throw Error(i(479))}else r=dh(a,o,u,2),r!==null&&Wn(r,a,2)}function ku(a){var r=a.alternate;return a===He||r!==null&&r===He}function wb(a,r){Hs=Nu=!0;var o=a.pending;o===null?r.next=r:(r.next=o.next,o.next=r),a.pending=r}function Db(a,r,o){if((o&4194048)!==0){var u=r.lanes;u&=a.pendingLanes,o|=u,r.lanes=o,H(a,o)}}var gl={readContext:Sn,use:Au,useCallback:Ft,useContext:Ft,useEffect:Ft,useImperativeHandle:Ft,useLayoutEffect:Ft,useInsertionEffect:Ft,useMemo:Ft,useReducer:Ft,useRef:Ft,useState:Ft,useDebugValue:Ft,useDeferredValue:Ft,useTransition:Ft,useSyncExternalStore:Ft,useId:Ft,useHostTransitionStatus:Ft,useFormState:Ft,useActionState:Ft,useOptimistic:Ft,useMemoCache:Ft,useCacheRefresh:Ft};gl.useEffectEvent=Ft;var Nb={readContext:Sn,use:Au,useCallback:function(a,r){return Pn().memoizedState=[a,r===void 0?null:r],a},useContext:Sn,useEffect:ob,useImperativeHandle:function(a,r,o){o=o!=null?o.concat([a]):null,Tu(4194308,4,db.bind(null,r,a),o)},useLayoutEffect:function(a,r){return Tu(4194308,4,a,r)},useInsertionEffect:function(a,r){Tu(4,2,a,r)},useMemo:function(a,r){var o=Pn();r=r===void 0?null:r;var u=a();if(Qr){Pa(!0);try{a()}finally{Pa(!1)}}return o.memoizedState=[u,r],u},useReducer:function(a,r,o){var u=Pn();if(o!==void 0){var p=o(r);if(Qr){Pa(!0);try{o(r)}finally{Pa(!1)}}}else p=r;return u.memoizedState=u.baseState=p,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:p},u.queue=a,a=a.dispatch=OA.bind(null,He,a),[u.memoizedState,a]},useRef:function(a){var r=Pn();return a={current:a},r.memoizedState=a},useState:function(a){a=Bh(a);var r=a.queue,o=xb.bind(null,He,r);return r.dispatch=o,[a.memoizedState,o]},useDebugValue:qh,useDeferredValue:function(a,r){var o=Pn();return Vh(o,a,r)},useTransition:function(){var a=Bh(!1);return a=gb.bind(null,He,a.queue,!0,!1),Pn().memoizedState=a,[!1,a]},useSyncExternalStore:function(a,r,o){var u=He,p=Pn();if(nt){if(o===void 0)throw Error(i(407));o=o()}else{if(o=r(),wt===null)throw Error(i(349));(Ze&127)!==0||Vv(u,r,o)}p.memoizedState=o;var g={value:o,getSnapshot:r};return p.queue=g,ob(Gv.bind(null,u,g,a),[a]),u.flags|=2048,Vs(9,{destroy:void 0},Kv.bind(null,u,g,o,r),null),o},useId:function(){var a=Pn(),r=wt.identifierPrefix;if(nt){var o=Za,u=Qa;o=(u&~(1<<32-Mn(u)-1)).toString(32)+o,r="_"+r+"R_"+o,o=Cu++,0<o&&(r+="H"+o.toString(32)),r+="_"}else o=EA++,r="_"+r+"r_"+o.toString(32)+"_";return a.memoizedState=r},useHostTransitionStatus:Gh,useFormState:nb,useActionState:nb,useOptimistic:function(a){var r=Pn();r.memoizedState=r.baseState=a;var o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=o,r=Yh.bind(null,He,!0,o),o.dispatch=r,[a,r]},useMemoCache:zh,useCacheRefresh:function(){return Pn().memoizedState=$A.bind(null,He)},useEffectEvent:function(a){var r=Pn(),o={impl:a};return r.memoizedState=o,function(){if((lt&2)!==0)throw Error(i(440));return o.impl.apply(void 0,arguments)}}},Jh={readContext:Sn,use:Au,useCallback:hb,useContext:Sn,useEffect:Hh,useImperativeHandle:fb,useInsertionEffect:cb,useLayoutEffect:ub,useMemo:mb,useReducer:Mu,useRef:sb,useState:function(){return Mu(wi)},useDebugValue:qh,useDeferredValue:function(a,r){var o=Xt();return pb(o,gt.memoizedState,a,r)},useTransition:function(){var a=Mu(wi)[0],r=Xt().memoizedState;return[typeof a=="boolean"?a:ml(a),r]},useSyncExternalStore:qv,useId:bb,useHostTransitionStatus:Gh,useFormState:ab,useActionState:ab,useOptimistic:function(a,r){var o=Xt();return Xv(o,gt,a,r)},useMemoCache:zh,useCacheRefresh:Sb};Jh.useEffectEvent=lb;var Cb={readContext:Sn,use:Au,useCallback:hb,useContext:Sn,useEffect:Hh,useImperativeHandle:fb,useInsertionEffect:cb,useLayoutEffect:ub,useMemo:mb,useReducer:Uh,useRef:sb,useState:function(){return Uh(wi)},useDebugValue:qh,useDeferredValue:function(a,r){var o=Xt();return gt===null?Vh(o,a,r):pb(o,gt.memoizedState,a,r)},useTransition:function(){var a=Uh(wi)[0],r=Xt().memoizedState;return[typeof a=="boolean"?a:ml(a),r]},useSyncExternalStore:qv,useId:bb,useHostTransitionStatus:Gh,useFormState:rb,useActionState:rb,useOptimistic:function(a,r){var o=Xt();return gt!==null?Xv(o,gt,a,r):(o.baseState=a,[a,o.queue.dispatch])},useMemoCache:zh,useCacheRefresh:Sb};Cb.useEffectEvent=lb;function Xh(a,r,o,u){r=a.memoizedState,o=o(u,r),o=o==null?r:v({},r,o),a.memoizedState=o,a.lanes===0&&(a.updateQueue.baseState=o)}var Wh={enqueueSetState:function(a,r,o){a=a._reactInternals;var u=da(),p=Wi(u);p.payload=r,o!=null&&(p.callback=o),r=Qi(a,p,u),r!==null&&(Wn(r,a,u),ul(r,a,u))},enqueueReplaceState:function(a,r,o){a=a._reactInternals;var u=da(),p=Wi(u);p.tag=1,p.payload=r,o!=null&&(p.callback=o),r=Qi(a,p,u),r!==null&&(Wn(r,a,u),ul(r,a,u))},enqueueForceUpdate:function(a,r){a=a._reactInternals;var o=da(),u=Wi(o);u.tag=2,r!=null&&(u.callback=r),r=Qi(a,u,o),r!==null&&(Wn(r,a,o),ul(r,a,o))}};function Eb(a,r,o,u,p,g,x){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(u,g,x):r.prototype&&r.prototype.isPureReactComponent?!nl(o,u)||!nl(p,g):!0}function Ab(a,r,o,u){a=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(o,u),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(o,u),r.state!==a&&Wh.enqueueReplaceState(r,r.state,null)}function Zr(a,r){var o=r;if("ref"in r){o={};for(var u in r)u!=="ref"&&(o[u]=r[u])}if(a=a.defaultProps){o===r&&(o=v({},o));for(var p in a)o[p]===void 0&&(o[p]=a[p])}return o}function Mb(a){cu(a)}function Tb(a){console.error(a)}function jb(a){cu(a)}function $u(a,r){try{var o=a.onUncaughtError;o(r.value,{componentStack:r.stack})}catch(u){setTimeout(function(){throw u})}}function kb(a,r,o){try{var u=a.onCaughtError;u(o.value,{componentStack:o.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(p){setTimeout(function(){throw p})}}function Qh(a,r,o){return o=Wi(o),o.tag=3,o.payload={element:null},o.callback=function(){$u(a,r)},o}function $b(a){return a=Wi(a),a.tag=3,a}function Ob(a,r,o,u){var p=o.type.getDerivedStateFromError;if(typeof p=="function"){var g=u.value;a.payload=function(){return p(g)},a.callback=function(){kb(r,o,u)}}var x=o.stateNode;x!==null&&typeof x.componentDidCatch=="function"&&(a.callback=function(){kb(r,o,u),typeof p!="function"&&(ir===null?ir=new Set([this]):ir.add(this));var C=u.stack;this.componentDidCatch(u.value,{componentStack:C!==null?C:""})})}function RA(a,r,o,u,p){if(o.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){if(r=o.alternate,r!==null&&Is(r,o,p,!0),o=oa.current,o!==null){switch(o.tag){case 31:case 13:return Ea===null?qu():o.alternate===null&&Ht===0&&(Ht=3),o.flags&=-257,o.flags|=65536,o.lanes=p,u===bu?o.flags|=16384:(r=o.updateQueue,r===null?o.updateQueue=new Set([u]):r.add(u),Dm(a,u,p)),!1;case 22:return o.flags|=65536,u===bu?o.flags|=16384:(r=o.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([u])},o.updateQueue=r):(o=r.retryQueue,o===null?r.retryQueue=new Set([u]):o.add(u)),Dm(a,u,p)),!1}throw Error(i(435,o.tag))}return Dm(a,u,p),qu(),!1}if(nt)return r=oa.current,r!==null?((r.flags&65536)===0&&(r.flags|=256),r.flags|=65536,r.lanes=p,u!==yh&&(a=Error(i(422),{cause:u}),rl(wa(a,o)))):(u!==yh&&(r=Error(i(423),{cause:u}),rl(wa(r,o))),a=a.current.alternate,a.flags|=65536,p&=-p,a.lanes|=p,u=wa(u,o),p=Qh(a.stateNode,u,p),Mh(a,p),Ht!==4&&(Ht=2)),!1;var g=Error(i(520),{cause:u});if(g=wa(g,o),Nl===null?Nl=[g]:Nl.push(g),Ht!==4&&(Ht=2),r===null)return!0;u=wa(u,o),o=r;do{switch(o.tag){case 3:return o.flags|=65536,a=p&-p,o.lanes|=a,a=Qh(o.stateNode,u,a),Mh(o,a),!1;case 1:if(r=o.type,g=o.stateNode,(o.flags&128)===0&&(typeof r.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&(ir===null||!ir.has(g))))return o.flags|=65536,p&=-p,o.lanes|=p,p=$b(p),Ob(p,a,o,u),Mh(o,p),!1}o=o.return}while(o!==null);return!1}var Zh=Error(i(461)),en=!1;function xn(a,r,o,u){r.child=a===null?Iv(r,null,o,u):Wr(r,a.child,o,u)}function Rb(a,r,o,u,p){o=o.render;var g=r.ref;if("ref"in u){var x={};for(var C in u)C!=="ref"&&(x[C]=u[C])}else x=u;return Gr(r),u=Rh(a,r,o,x,g,p),C=Lh(),a!==null&&!en?(Ph(a,r,p),Di(a,r,p)):(nt&&C&&ph(r),r.flags|=1,xn(a,r,u,p),r.child)}function Lb(a,r,o,u,p){if(a===null){var g=o.type;return typeof g=="function"&&!fh(g)&&g.defaultProps===void 0&&o.compare===null?(r.tag=15,r.type=g,Pb(a,r,g,u,p)):(a=hu(o.type,null,u,r,r.mode,p),a.ref=r.ref,a.return=r,r.child=a)}if(g=a.child,!om(a,p)){var x=g.memoizedProps;if(o=o.compare,o=o!==null?o:nl,o(x,u)&&a.ref===r.ref)return Di(a,r,p)}return r.flags|=1,a=yi(g,u),a.ref=r.ref,a.return=r,r.child=a}function Pb(a,r,o,u,p){if(a!==null){var g=a.memoizedProps;if(nl(g,u)&&a.ref===r.ref)if(en=!1,r.pendingProps=u=g,om(a,p))(a.flags&131072)!==0&&(en=!0);else return r.lanes=a.lanes,Di(a,r,p)}return em(a,r,o,u,p)}function Ib(a,r,o,u){var p=u.children,g=a!==null?a.memoizedState:null;if(a===null&&r.stateNode===null&&(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),u.mode==="hidden"){if((r.flags&128)!==0){if(g=g!==null?g.baseLanes|o:o,a!==null){for(u=r.child=a.child,p=0;u!==null;)p=p|u.lanes|u.childLanes,u=u.sibling;u=p&~g}else u=0,r.child=null;return zb(a,r,g,o,u)}if((o&536870912)!==0)r.memoizedState={baseLanes:0,cachePool:null},a!==null&&yu(r,g!==null?g.cachePool:null),g!==null?Uv(r,g):jh(),Bv(r);else return u=r.lanes=536870912,zb(a,r,g!==null?g.baseLanes|o:o,o,u)}else g!==null?(yu(r,g.cachePool),Uv(r,g),er(),r.memoizedState=null):(a!==null&&yu(r,null),jh(),er());return xn(a,r,p,o),r.child}function yl(a,r){return a!==null&&a.tag===22||r.stateNode!==null||(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.sibling}function zb(a,r,o,u,p){var g=Nh();return g=g===null?null:{parent:Qt._currentValue,pool:g},r.memoizedState={baseLanes:o,cachePool:g},a!==null&&yu(r,null),jh(),Bv(r),a!==null&&Is(a,r,u,!0),r.childLanes=p,null}function Ou(a,r){return r=Lu({mode:r.mode,children:r.children},a.mode),r.ref=a.ref,a.child=r,r.return=a,r}function _b(a,r,o){return Wr(r,a.child,null,o),a=Ou(r,r.pendingProps),a.flags|=2,la(r),r.memoizedState=null,a}function LA(a,r,o){var u=r.pendingProps,p=(r.flags&128)!==0;if(r.flags&=-129,a===null){if(nt){if(u.mode==="hidden")return a=Ou(r,u),r.lanes=536870912,yl(null,a);if($h(r),(a=Tt)?(a=W0(a,Ca),a=a!==null&&a.data==="&"?a:null,a!==null&&(r.memoizedState={dehydrated:a,treeContext:Ki!==null?{id:Qa,overflow:Za}:null,retryLane:536870912,hydrationErrors:null},o=wv(a),o.return=r,r.child=o,bn=r,Tt=null)):a=null,a===null)throw Yi(r);return r.lanes=536870912,null}return Ou(r,u)}var g=a.memoizedState;if(g!==null){var x=g.dehydrated;if($h(r),p)if(r.flags&256)r.flags&=-257,r=_b(a,r,o);else if(r.memoizedState!==null)r.child=a.child,r.flags|=128,r=null;else throw Error(i(558));else if(en||Is(a,r,o,!1),p=(o&a.childLanes)!==0,en||p){if(u=wt,u!==null&&(x=G(u,o),x!==0&&x!==g.retryLane))throw g.retryLane=x,Hr(a,x),Wn(u,a,x),Zh;qu(),r=_b(a,r,o)}else a=g.treeContext,Tt=Aa(x.nextSibling),bn=r,nt=!0,Gi=null,Ca=!1,a!==null&&Cv(r,a),r=Ou(r,u),r.flags|=4096;return r}return a=yi(a.child,{mode:u.mode,children:u.children}),a.ref=r.ref,r.child=a,a.return=r,a}function Ru(a,r){var o=r.ref;if(o===null)a!==null&&a.ref!==null&&(r.flags|=4194816);else{if(typeof o!="function"&&typeof o!="object")throw Error(i(284));(a===null||a.ref!==o)&&(r.flags|=4194816)}}function em(a,r,o,u,p){return Gr(r),o=Rh(a,r,o,u,void 0,p),u=Lh(),a!==null&&!en?(Ph(a,r,p),Di(a,r,p)):(nt&&u&&ph(r),r.flags|=1,xn(a,r,o,p),r.child)}function Ub(a,r,o,u,p,g){return Gr(r),r.updateQueue=null,o=Hv(r,u,o,p),Fv(a),u=Lh(),a!==null&&!en?(Ph(a,r,g),Di(a,r,g)):(nt&&u&&ph(r),r.flags|=1,xn(a,r,o,g),r.child)}function Bb(a,r,o,u,p){if(Gr(r),r.stateNode===null){var g=Os,x=o.contextType;typeof x=="object"&&x!==null&&(g=Sn(x)),g=new o(u,g),r.memoizedState=g.state!==null&&g.state!==void 0?g.state:null,g.updater=Wh,r.stateNode=g,g._reactInternals=r,g=r.stateNode,g.props=u,g.state=r.memoizedState,g.refs={},Eh(r),x=o.contextType,g.context=typeof x=="object"&&x!==null?Sn(x):Os,g.state=r.memoizedState,x=o.getDerivedStateFromProps,typeof x=="function"&&(Xh(r,o,x,u),g.state=r.memoizedState),typeof o.getDerivedStateFromProps=="function"||typeof g.getSnapshotBeforeUpdate=="function"||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(x=g.state,typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount(),x!==g.state&&Wh.enqueueReplaceState(g,g.state,null),fl(r,u,g,p),dl(),g.state=r.memoizedState),typeof g.componentDidMount=="function"&&(r.flags|=4194308),u=!0}else if(a===null){g=r.stateNode;var C=r.memoizedProps,$=Zr(o,C);g.props=$;var V=g.context,ee=o.contextType;x=Os,typeof ee=="object"&&ee!==null&&(x=Sn(ee));var ne=o.getDerivedStateFromProps;ee=typeof ne=="function"||typeof g.getSnapshotBeforeUpdate=="function",C=r.pendingProps!==C,ee||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(C||V!==x)&&Ab(r,g,u,x),Xi=!1;var K=r.memoizedState;g.state=K,fl(r,u,g,p),dl(),V=r.memoizedState,C||K!==V||Xi?(typeof ne=="function"&&(Xh(r,o,ne,u),V=r.memoizedState),($=Xi||Eb(r,o,$,u,K,V,x))?(ee||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount()),typeof g.componentDidMount=="function"&&(r.flags|=4194308)):(typeof g.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=u,r.memoizedState=V),g.props=u,g.state=V,g.context=x,u=$):(typeof g.componentDidMount=="function"&&(r.flags|=4194308),u=!1)}else{g=r.stateNode,Ah(a,r),x=r.memoizedProps,ee=Zr(o,x),g.props=ee,ne=r.pendingProps,K=g.context,V=o.contextType,$=Os,typeof V=="object"&&V!==null&&($=Sn(V)),C=o.getDerivedStateFromProps,(V=typeof C=="function"||typeof g.getSnapshotBeforeUpdate=="function")||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(x!==ne||K!==$)&&Ab(r,g,u,$),Xi=!1,K=r.memoizedState,g.state=K,fl(r,u,g,p),dl();var X=r.memoizedState;x!==ne||K!==X||Xi||a!==null&&a.dependencies!==null&&pu(a.dependencies)?(typeof C=="function"&&(Xh(r,o,C,u),X=r.memoizedState),(ee=Xi||Eb(r,o,ee,u,K,X,$)||a!==null&&a.dependencies!==null&&pu(a.dependencies))?(V||typeof g.UNSAFE_componentWillUpdate!="function"&&typeof g.componentWillUpdate!="function"||(typeof g.componentWillUpdate=="function"&&g.componentWillUpdate(u,X,$),typeof g.UNSAFE_componentWillUpdate=="function"&&g.UNSAFE_componentWillUpdate(u,X,$)),typeof g.componentDidUpdate=="function"&&(r.flags|=4),typeof g.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof g.componentDidUpdate!="function"||x===a.memoizedProps&&K===a.memoizedState||(r.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||x===a.memoizedProps&&K===a.memoizedState||(r.flags|=1024),r.memoizedProps=u,r.memoizedState=X),g.props=u,g.state=X,g.context=$,u=ee):(typeof g.componentDidUpdate!="function"||x===a.memoizedProps&&K===a.memoizedState||(r.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||x===a.memoizedProps&&K===a.memoizedState||(r.flags|=1024),u=!1)}return g=u,Ru(a,r),u=(r.flags&128)!==0,g||u?(g=r.stateNode,o=u&&typeof o.getDerivedStateFromError!="function"?null:g.render(),r.flags|=1,a!==null&&u?(r.child=Wr(r,a.child,null,p),r.child=Wr(r,null,o,p)):xn(a,r,o,p),r.memoizedState=g.state,a=r.child):a=Di(a,r,p),a}function Fb(a,r,o,u){return Vr(),r.flags|=256,xn(a,r,o,u),r.child}var tm={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function nm(a){return{baseLanes:a,cachePool:kv()}}function am(a,r,o){return a=a!==null?a.childLanes&~o:0,r&&(a|=ua),a}function Hb(a,r,o){var u=r.pendingProps,p=!1,g=(r.flags&128)!==0,x;if((x=g)||(x=a!==null&&a.memoizedState===null?!1:(Jt.current&2)!==0),x&&(p=!0,r.flags&=-129),x=(r.flags&32)!==0,r.flags&=-33,a===null){if(nt){if(p?Zi(r):er(),(a=Tt)?(a=W0(a,Ca),a=a!==null&&a.data!=="&"?a:null,a!==null&&(r.memoizedState={dehydrated:a,treeContext:Ki!==null?{id:Qa,overflow:Za}:null,retryLane:536870912,hydrationErrors:null},o=wv(a),o.return=r,r.child=o,bn=r,Tt=null)):a=null,a===null)throw Yi(r);return _m(a)?r.lanes=32:r.lanes=536870912,null}var C=u.children;return u=u.fallback,p?(er(),p=r.mode,C=Lu({mode:"hidden",children:C},p),u=qr(u,p,o,null),C.return=r,u.return=r,C.sibling=u,r.child=C,u=r.child,u.memoizedState=nm(o),u.childLanes=am(a,x,o),r.memoizedState=tm,yl(null,u)):(Zi(r),im(r,C))}var $=a.memoizedState;if($!==null&&(C=$.dehydrated,C!==null)){if(g)r.flags&256?(Zi(r),r.flags&=-257,r=rm(a,r,o)):r.memoizedState!==null?(er(),r.child=a.child,r.flags|=128,r=null):(er(),C=u.fallback,p=r.mode,u=Lu({mode:"visible",children:u.children},p),C=qr(C,p,o,null),C.flags|=2,u.return=r,C.return=r,u.sibling=C,r.child=u,Wr(r,a.child,null,o),u=r.child,u.memoizedState=nm(o),u.childLanes=am(a,x,o),r.memoizedState=tm,r=yl(null,u));else if(Zi(r),_m(C)){if(x=C.nextSibling&&C.nextSibling.dataset,x)var V=x.dgst;x=V,u=Error(i(419)),u.stack="",u.digest=x,rl({value:u,source:null,stack:null}),r=rm(a,r,o)}else if(en||Is(a,r,o,!1),x=(o&a.childLanes)!==0,en||x){if(x=wt,x!==null&&(u=G(x,o),u!==0&&u!==$.retryLane))throw $.retryLane=u,Hr(a,u),Wn(x,a,u),Zh;zm(C)||qu(),r=rm(a,r,o)}else zm(C)?(r.flags|=192,r.child=a.child,r=null):(a=$.treeContext,Tt=Aa(C.nextSibling),bn=r,nt=!0,Gi=null,Ca=!1,a!==null&&Cv(r,a),r=im(r,u.children),r.flags|=4096);return r}return p?(er(),C=u.fallback,p=r.mode,$=a.child,V=$.sibling,u=yi($,{mode:"hidden",children:u.children}),u.subtreeFlags=$.subtreeFlags&65011712,V!==null?C=yi(V,C):(C=qr(C,p,o,null),C.flags|=2),C.return=r,u.return=r,u.sibling=C,r.child=u,yl(null,u),u=r.child,C=a.child.memoizedState,C===null?C=nm(o):(p=C.cachePool,p!==null?($=Qt._currentValue,p=p.parent!==$?{parent:$,pool:$}:p):p=kv(),C={baseLanes:C.baseLanes|o,cachePool:p}),u.memoizedState=C,u.childLanes=am(a,x,o),r.memoizedState=tm,yl(a.child,u)):(Zi(r),o=a.child,a=o.sibling,o=yi(o,{mode:"visible",children:u.children}),o.return=r,o.sibling=null,a!==null&&(x=r.deletions,x===null?(r.deletions=[a],r.flags|=16):x.push(a)),r.child=o,r.memoizedState=null,o)}function im(a,r){return r=Lu({mode:"visible",children:r},a.mode),r.return=a,a.child=r}function Lu(a,r){return a=sa(22,a,null,r),a.lanes=0,a}function rm(a,r,o){return Wr(r,a.child,null,o),a=im(r,r.pendingProps.children),a.flags|=2,r.memoizedState=null,a}function qb(a,r,o){a.lanes|=r;var u=a.alternate;u!==null&&(u.lanes|=r),Sh(a.return,r,o)}function sm(a,r,o,u,p,g){var x=a.memoizedState;x===null?a.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:u,tail:o,tailMode:p,treeForkCount:g}:(x.isBackwards=r,x.rendering=null,x.renderingStartTime=0,x.last=u,x.tail=o,x.tailMode=p,x.treeForkCount=g)}function Vb(a,r,o){var u=r.pendingProps,p=u.revealOrder,g=u.tail;u=u.children;var x=Jt.current,C=(x&2)!==0;if(C?(x=x&1|2,r.flags|=128):x&=1,oe(Jt,x),xn(a,r,u,o),u=nt?il:0,!C&&a!==null&&(a.flags&128)!==0)e:for(a=r.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&qb(a,o,r);else if(a.tag===19)qb(a,o,r);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===r)break e;for(;a.sibling===null;){if(a.return===null||a.return===r)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}switch(p){case"forwards":for(o=r.child,p=null;o!==null;)a=o.alternate,a!==null&&Du(a)===null&&(p=o),o=o.sibling;o=p,o===null?(p=r.child,r.child=null):(p=o.sibling,o.sibling=null),sm(r,!1,p,o,g,u);break;case"backwards":case"unstable_legacy-backwards":for(o=null,p=r.child,r.child=null;p!==null;){if(a=p.alternate,a!==null&&Du(a)===null){r.child=p;break}a=p.sibling,p.sibling=o,o=p,p=a}sm(r,!0,o,null,g,u);break;case"together":sm(r,!1,null,null,void 0,u);break;default:r.memoizedState=null}return r.child}function Di(a,r,o){if(a!==null&&(r.dependencies=a.dependencies),ar|=r.lanes,(o&r.childLanes)===0)if(a!==null){if(Is(a,r,o,!1),(o&r.childLanes)===0)return null}else return null;if(a!==null&&r.child!==a.child)throw Error(i(153));if(r.child!==null){for(a=r.child,o=yi(a,a.pendingProps),r.child=o,o.return=r;a.sibling!==null;)a=a.sibling,o=o.sibling=yi(a,a.pendingProps),o.return=r;o.sibling=null}return r.child}function om(a,r){return(a.lanes&r)!==0?!0:(a=a.dependencies,!!(a!==null&&pu(a)))}function PA(a,r,o){switch(r.tag){case 3:mn(r,r.stateNode.containerInfo),Ji(r,Qt,a.memoizedState.cache),Vr();break;case 27:case 5:Pr(r);break;case 4:mn(r,r.stateNode.containerInfo);break;case 10:Ji(r,r.type,r.memoizedProps.value);break;case 31:if(r.memoizedState!==null)return r.flags|=128,$h(r),null;break;case 13:var u=r.memoizedState;if(u!==null)return u.dehydrated!==null?(Zi(r),r.flags|=128,null):(o&r.child.childLanes)!==0?Hb(a,r,o):(Zi(r),a=Di(a,r,o),a!==null?a.sibling:null);Zi(r);break;case 19:var p=(a.flags&128)!==0;if(u=(o&r.childLanes)!==0,u||(Is(a,r,o,!1),u=(o&r.childLanes)!==0),p){if(u)return Vb(a,r,o);r.flags|=128}if(p=r.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),oe(Jt,Jt.current),u)break;return null;case 22:return r.lanes=0,Ib(a,r,o,r.pendingProps);case 24:Ji(r,Qt,a.memoizedState.cache)}return Di(a,r,o)}function Kb(a,r,o){if(a!==null)if(a.memoizedProps!==r.pendingProps)en=!0;else{if(!om(a,o)&&(r.flags&128)===0)return en=!1,PA(a,r,o);en=(a.flags&131072)!==0}else en=!1,nt&&(r.flags&1048576)!==0&&Nv(r,il,r.index);switch(r.lanes=0,r.tag){case 16:e:{var u=r.pendingProps;if(a=Jr(r.elementType),r.type=a,typeof a=="function")fh(a)?(u=Zr(a,u),r.tag=1,r=Bb(null,r,a,u,o)):(r.tag=0,r=em(null,r,a,u,o));else{if(a!=null){var p=a.$$typeof;if(p===F){r.tag=11,r=Rb(null,r,a,u,o);break e}else if(p===E){r.tag=14,r=Lb(null,r,a,u,o);break e}}throw r=Q(a)||a,Error(i(306,r,""))}}return r;case 0:return em(a,r,r.type,r.pendingProps,o);case 1:return u=r.type,p=Zr(u,r.pendingProps),Bb(a,r,u,p,o);case 3:e:{if(mn(r,r.stateNode.containerInfo),a===null)throw Error(i(387));u=r.pendingProps;var g=r.memoizedState;p=g.element,Ah(a,r),fl(r,u,null,o);var x=r.memoizedState;if(u=x.cache,Ji(r,Qt,u),u!==g.cache&&xh(r,[Qt],o,!0),dl(),u=x.element,g.isDehydrated)if(g={element:u,isDehydrated:!1,cache:x.cache},r.updateQueue.baseState=g,r.memoizedState=g,r.flags&256){r=Fb(a,r,u,o);break e}else if(u!==p){p=wa(Error(i(424)),r),rl(p),r=Fb(a,r,u,o);break e}else{switch(a=r.stateNode.containerInfo,a.nodeType){case 9:a=a.body;break;default:a=a.nodeName==="HTML"?a.ownerDocument.body:a}for(Tt=Aa(a.firstChild),bn=r,nt=!0,Gi=null,Ca=!0,o=Iv(r,null,u,o),r.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling}else{if(Vr(),u===p){r=Di(a,r,o);break e}xn(a,r,u,o)}r=r.child}return r;case 26:return Ru(a,r),a===null?(o=aS(r.type,null,r.pendingProps,null))?r.memoizedState=o:nt||(o=r.type,a=r.pendingProps,u=Wu(Fe.current).createElement(o),u[me]=r,u[be]=a,wn(u,o,a),ft(u),r.stateNode=u):r.memoizedState=aS(r.type,a.memoizedProps,r.pendingProps,a.memoizedState),null;case 27:return Pr(r),a===null&&nt&&(u=r.stateNode=eS(r.type,r.pendingProps,Fe.current),bn=r,Ca=!0,p=Tt,lr(r.type)?(Um=p,Tt=Aa(u.firstChild)):Tt=p),xn(a,r,r.pendingProps.children,o),Ru(a,r),a===null&&(r.flags|=4194304),r.child;case 5:return a===null&&nt&&((p=u=Tt)&&(u=fM(u,r.type,r.pendingProps,Ca),u!==null?(r.stateNode=u,bn=r,Tt=Aa(u.firstChild),Ca=!1,p=!0):p=!1),p||Yi(r)),Pr(r),p=r.type,g=r.pendingProps,x=a!==null?a.memoizedProps:null,u=g.children,Lm(p,g)?u=null:x!==null&&Lm(p,x)&&(r.flags|=32),r.memoizedState!==null&&(p=Rh(a,r,AA,null,null,o),$l._currentValue=p),Ru(a,r),xn(a,r,u,o),r.child;case 6:return a===null&&nt&&((a=o=Tt)&&(o=hM(o,r.pendingProps,Ca),o!==null?(r.stateNode=o,bn=r,Tt=null,a=!0):a=!1),a||Yi(r)),null;case 13:return Hb(a,r,o);case 4:return mn(r,r.stateNode.containerInfo),u=r.pendingProps,a===null?r.child=Wr(r,null,u,o):xn(a,r,u,o),r.child;case 11:return Rb(a,r,r.type,r.pendingProps,o);case 7:return xn(a,r,r.pendingProps,o),r.child;case 8:return xn(a,r,r.pendingProps.children,o),r.child;case 12:return xn(a,r,r.pendingProps.children,o),r.child;case 10:return u=r.pendingProps,Ji(r,r.type,u.value),xn(a,r,u.children,o),r.child;case 9:return p=r.type._context,u=r.pendingProps.children,Gr(r),p=Sn(p),u=u(p),r.flags|=1,xn(a,r,u,o),r.child;case 14:return Lb(a,r,r.type,r.pendingProps,o);case 15:return Pb(a,r,r.type,r.pendingProps,o);case 19:return Vb(a,r,o);case 31:return LA(a,r,o);case 22:return Ib(a,r,o,r.pendingProps);case 24:return Gr(r),u=Sn(Qt),a===null?(p=Nh(),p===null&&(p=wt,g=wh(),p.pooledCache=g,g.refCount++,g!==null&&(p.pooledCacheLanes|=o),p=g),r.memoizedState={parent:u,cache:p},Eh(r),Ji(r,Qt,p)):((a.lanes&o)!==0&&(Ah(a,r),fl(r,null,null,o),dl()),p=a.memoizedState,g=r.memoizedState,p.parent!==u?(p={parent:u,cache:u},r.memoizedState=p,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=p),Ji(r,Qt,u)):(u=g.cache,Ji(r,Qt,u),u!==p.cache&&xh(r,[Qt],o,!0))),xn(a,r,r.pendingProps.children,o),r.child;case 29:throw r.pendingProps}throw Error(i(156,r.tag))}function Ni(a){a.flags|=4}function lm(a,r,o,u,p){if((r=(a.mode&32)!==0)&&(r=!1),r){if(a.flags|=16777216,(p&335544128)===p)if(a.stateNode.complete)a.flags|=8192;else if(b0())a.flags|=8192;else throw Xr=bu,Ch}else a.flags&=-16777217}function Gb(a,r){if(r.type!=="stylesheet"||(r.state.loading&4)!==0)a.flags&=-16777217;else if(a.flags|=16777216,!lS(r))if(b0())a.flags|=8192;else throw Xr=bu,Ch}function Pu(a,r){r!==null&&(a.flags|=4),a.flags&16384&&(r=a.tag!==22?zr():536870912,a.lanes|=r,Js|=r)}function vl(a,r){if(!nt)switch(a.tailMode){case"hidden":r=a.tail;for(var o=null;r!==null;)r.alternate!==null&&(o=r),r=r.sibling;o===null?a.tail=null:o.sibling=null;break;case"collapsed":o=a.tail;for(var u=null;o!==null;)o.alternate!==null&&(u=o),o=o.sibling;u===null?r||a.tail===null?a.tail=null:a.tail.sibling=null:u.sibling=null}}function jt(a){var r=a.alternate!==null&&a.alternate.child===a.child,o=0,u=0;if(r)for(var p=a.child;p!==null;)o|=p.lanes|p.childLanes,u|=p.subtreeFlags&65011712,u|=p.flags&65011712,p.return=a,p=p.sibling;else for(p=a.child;p!==null;)o|=p.lanes|p.childLanes,u|=p.subtreeFlags,u|=p.flags,p.return=a,p=p.sibling;return a.subtreeFlags|=u,a.childLanes=o,r}function IA(a,r,o){var u=r.pendingProps;switch(gh(r),r.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return jt(r),null;case 1:return jt(r),null;case 3:return o=r.stateNode,u=null,a!==null&&(u=a.memoizedState.cache),r.memoizedState.cache!==u&&(r.flags|=2048),Si(Qt),Mt(),o.pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),(a===null||a.child===null)&&(Ps(r)?Ni(r):a===null||a.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,vh())),jt(r),null;case 26:var p=r.type,g=r.memoizedState;return a===null?(Ni(r),g!==null?(jt(r),Gb(r,g)):(jt(r),lm(r,p,null,u,o))):g?g!==a.memoizedState?(Ni(r),jt(r),Gb(r,g)):(jt(r),r.flags&=-16777217):(a=a.memoizedProps,a!==u&&Ni(r),jt(r),lm(r,p,a,u,o)),null;case 27:if(Yt(r),o=Fe.current,p=r.type,a!==null&&r.stateNode!=null)a.memoizedProps!==u&&Ni(r);else{if(!u){if(r.stateNode===null)throw Error(i(166));return jt(r),null}a=ce.current,Ps(r)?Ev(r):(a=eS(p,u,o),r.stateNode=a,Ni(r))}return jt(r),null;case 5:if(Yt(r),p=r.type,a!==null&&r.stateNode!=null)a.memoizedProps!==u&&Ni(r);else{if(!u){if(r.stateNode===null)throw Error(i(166));return jt(r),null}if(g=ce.current,Ps(r))Ev(r);else{var x=Wu(Fe.current);switch(g){case 1:g=x.createElementNS("http://www.w3.org/2000/svg",p);break;case 2:g=x.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;default:switch(p){case"svg":g=x.createElementNS("http://www.w3.org/2000/svg",p);break;case"math":g=x.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;case"script":g=x.createElement("div"),g.innerHTML="<script><\/script>",g=g.removeChild(g.firstChild);break;case"select":g=typeof u.is=="string"?x.createElement("select",{is:u.is}):x.createElement("select"),u.multiple?g.multiple=!0:u.size&&(g.size=u.size);break;default:g=typeof u.is=="string"?x.createElement(p,{is:u.is}):x.createElement(p)}}g[me]=r,g[be]=u;e:for(x=r.child;x!==null;){if(x.tag===5||x.tag===6)g.appendChild(x.stateNode);else if(x.tag!==4&&x.tag!==27&&x.child!==null){x.child.return=x,x=x.child;continue}if(x===r)break e;for(;x.sibling===null;){if(x.return===null||x.return===r)break e;x=x.return}x.sibling.return=x.return,x=x.sibling}r.stateNode=g;e:switch(wn(g,p,u),p){case"button":case"input":case"select":case"textarea":u=!!u.autoFocus;break e;case"img":u=!0;break e;default:u=!1}u&&Ni(r)}}return jt(r),lm(r,r.type,a===null?null:a.memoizedProps,r.pendingProps,o),null;case 6:if(a&&r.stateNode!=null)a.memoizedProps!==u&&Ni(r);else{if(typeof u!="string"&&r.stateNode===null)throw Error(i(166));if(a=Fe.current,Ps(r)){if(a=r.stateNode,o=r.memoizedProps,u=null,p=bn,p!==null)switch(p.tag){case 27:case 5:u=p.memoizedProps}a[me]=r,a=!!(a.nodeValue===o||u!==null&&u.suppressHydrationWarning===!0||H0(a.nodeValue,o)),a||Yi(r,!0)}else a=Wu(a).createTextNode(u),a[me]=r,r.stateNode=a}return jt(r),null;case 31:if(o=r.memoizedState,a===null||a.memoizedState!==null){if(u=Ps(r),o!==null){if(a===null){if(!u)throw Error(i(318));if(a=r.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(i(557));a[me]=r}else Vr(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;jt(r),a=!1}else o=vh(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=o),a=!0;if(!a)return r.flags&256?(la(r),r):(la(r),null);if((r.flags&128)!==0)throw Error(i(558))}return jt(r),null;case 13:if(u=r.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(p=Ps(r),u!==null&&u.dehydrated!==null){if(a===null){if(!p)throw Error(i(318));if(p=r.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(i(317));p[me]=r}else Vr(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;jt(r),p=!1}else p=vh(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=p),p=!0;if(!p)return r.flags&256?(la(r),r):(la(r),null)}return la(r),(r.flags&128)!==0?(r.lanes=o,r):(o=u!==null,a=a!==null&&a.memoizedState!==null,o&&(u=r.child,p=null,u.alternate!==null&&u.alternate.memoizedState!==null&&u.alternate.memoizedState.cachePool!==null&&(p=u.alternate.memoizedState.cachePool.pool),g=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(g=u.memoizedState.cachePool.pool),g!==p&&(u.flags|=2048)),o!==a&&o&&(r.child.flags|=8192),Pu(r,r.updateQueue),jt(r),null);case 4:return Mt(),a===null&&jm(r.stateNode.containerInfo),jt(r),null;case 10:return Si(r.type),jt(r),null;case 19:if(J(Jt),u=r.memoizedState,u===null)return jt(r),null;if(p=(r.flags&128)!==0,g=u.rendering,g===null)if(p)vl(u,!1);else{if(Ht!==0||a!==null&&(a.flags&128)!==0)for(a=r.child;a!==null;){if(g=Du(a),g!==null){for(r.flags|=128,vl(u,!1),a=g.updateQueue,r.updateQueue=a,Pu(r,a),r.subtreeFlags=0,a=o,o=r.child;o!==null;)xv(o,a),o=o.sibling;return oe(Jt,Jt.current&1|2),nt&&vi(r,u.treeForkCount),r.child}a=a.sibling}u.tail!==null&&un()>Bu&&(r.flags|=128,p=!0,vl(u,!1),r.lanes=4194304)}else{if(!p)if(a=Du(g),a!==null){if(r.flags|=128,p=!0,a=a.updateQueue,r.updateQueue=a,Pu(r,a),vl(u,!0),u.tail===null&&u.tailMode==="hidden"&&!g.alternate&&!nt)return jt(r),null}else 2*un()-u.renderingStartTime>Bu&&o!==536870912&&(r.flags|=128,p=!0,vl(u,!1),r.lanes=4194304);u.isBackwards?(g.sibling=r.child,r.child=g):(a=u.last,a!==null?a.sibling=g:r.child=g,u.last=g)}return u.tail!==null?(a=u.tail,u.rendering=a,u.tail=a.sibling,u.renderingStartTime=un(),a.sibling=null,o=Jt.current,oe(Jt,p?o&1|2:o&1),nt&&vi(r,u.treeForkCount),a):(jt(r),null);case 22:case 23:return la(r),kh(),u=r.memoizedState!==null,a!==null?a.memoizedState!==null!==u&&(r.flags|=8192):u&&(r.flags|=8192),u?(o&536870912)!==0&&(r.flags&128)===0&&(jt(r),r.subtreeFlags&6&&(r.flags|=8192)):jt(r),o=r.updateQueue,o!==null&&Pu(r,o.retryQueue),o=null,a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(o=a.memoizedState.cachePool.pool),u=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(u=r.memoizedState.cachePool.pool),u!==o&&(r.flags|=2048),a!==null&&J(Yr),null;case 24:return o=null,a!==null&&(o=a.memoizedState.cache),r.memoizedState.cache!==o&&(r.flags|=2048),Si(Qt),jt(r),null;case 25:return null;case 30:return null}throw Error(i(156,r.tag))}function zA(a,r){switch(gh(r),r.tag){case 1:return a=r.flags,a&65536?(r.flags=a&-65537|128,r):null;case 3:return Si(Qt),Mt(),a=r.flags,(a&65536)!==0&&(a&128)===0?(r.flags=a&-65537|128,r):null;case 26:case 27:case 5:return Yt(r),null;case 31:if(r.memoizedState!==null){if(la(r),r.alternate===null)throw Error(i(340));Vr()}return a=r.flags,a&65536?(r.flags=a&-65537|128,r):null;case 13:if(la(r),a=r.memoizedState,a!==null&&a.dehydrated!==null){if(r.alternate===null)throw Error(i(340));Vr()}return a=r.flags,a&65536?(r.flags=a&-65537|128,r):null;case 19:return J(Jt),null;case 4:return Mt(),null;case 10:return Si(r.type),null;case 22:case 23:return la(r),kh(),a!==null&&J(Yr),a=r.flags,a&65536?(r.flags=a&-65537|128,r):null;case 24:return Si(Qt),null;case 25:return null;default:return null}}function Yb(a,r){switch(gh(r),r.tag){case 3:Si(Qt),Mt();break;case 26:case 27:case 5:Yt(r);break;case 4:Mt();break;case 31:r.memoizedState!==null&&la(r);break;case 13:la(r);break;case 19:J(Jt);break;case 10:Si(r.type);break;case 22:case 23:la(r),kh(),a!==null&&J(Yr);break;case 24:Si(Qt)}}function bl(a,r){try{var o=r.updateQueue,u=o!==null?o.lastEffect:null;if(u!==null){var p=u.next;o=p;do{if((o.tag&a)===a){u=void 0;var g=o.create,x=o.inst;u=g(),x.destroy=u}o=o.next}while(o!==p)}}catch(C){mt(r,r.return,C)}}function tr(a,r,o){try{var u=r.updateQueue,p=u!==null?u.lastEffect:null;if(p!==null){var g=p.next;u=g;do{if((u.tag&a)===a){var x=u.inst,C=x.destroy;if(C!==void 0){x.destroy=void 0,p=r;var $=o,V=C;try{V()}catch(ee){mt(p,$,ee)}}}u=u.next}while(u!==g)}}catch(ee){mt(r,r.return,ee)}}function Jb(a){var r=a.updateQueue;if(r!==null){var o=a.stateNode;try{_v(r,o)}catch(u){mt(a,a.return,u)}}}function Xb(a,r,o){o.props=Zr(a.type,a.memoizedProps),o.state=a.memoizedState;try{o.componentWillUnmount()}catch(u){mt(a,r,u)}}function Sl(a,r){try{var o=a.ref;if(o!==null){switch(a.tag){case 26:case 27:case 5:var u=a.stateNode;break;case 30:u=a.stateNode;break;default:u=a.stateNode}typeof o=="function"?a.refCleanup=o(u):o.current=u}}catch(p){mt(a,r,p)}}function ei(a,r){var o=a.ref,u=a.refCleanup;if(o!==null)if(typeof u=="function")try{u()}catch(p){mt(a,r,p)}finally{a.refCleanup=null,a=a.alternate,a!=null&&(a.refCleanup=null)}else if(typeof o=="function")try{o(null)}catch(p){mt(a,r,p)}else o.current=null}function Wb(a){var r=a.type,o=a.memoizedProps,u=a.stateNode;try{e:switch(r){case"button":case"input":case"select":case"textarea":o.autoFocus&&u.focus();break e;case"img":o.src?u.src=o.src:o.srcSet&&(u.srcset=o.srcSet)}}catch(p){mt(a,a.return,p)}}function cm(a,r,o){try{var u=a.stateNode;sM(u,a.type,o,r),u[be]=r}catch(p){mt(a,a.return,p)}}function Qb(a){return a.tag===5||a.tag===3||a.tag===26||a.tag===27&&lr(a.type)||a.tag===4}function um(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||Qb(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.tag===27&&lr(a.type)||a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function dm(a,r,o){var u=a.tag;if(u===5||u===6)a=a.stateNode,r?(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o).insertBefore(a,r):(r=o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,r.appendChild(a),o=o._reactRootContainer,o!=null||r.onclick!==null||(r.onclick=pi));else if(u!==4&&(u===27&&lr(a.type)&&(o=a.stateNode,r=null),a=a.child,a!==null))for(dm(a,r,o),a=a.sibling;a!==null;)dm(a,r,o),a=a.sibling}function Iu(a,r,o){var u=a.tag;if(u===5||u===6)a=a.stateNode,r?o.insertBefore(a,r):o.appendChild(a);else if(u!==4&&(u===27&&lr(a.type)&&(o=a.stateNode),a=a.child,a!==null))for(Iu(a,r,o),a=a.sibling;a!==null;)Iu(a,r,o),a=a.sibling}function Zb(a){var r=a.stateNode,o=a.memoizedProps;try{for(var u=a.type,p=r.attributes;p.length;)r.removeAttributeNode(p[0]);wn(r,u,o),r[me]=a,r[be]=o}catch(g){mt(a,a.return,g)}}var Ci=!1,tn=!1,fm=!1,e0=typeof WeakSet=="function"?WeakSet:Set,pn=null;function _A(a,r){if(a=a.containerInfo,Om=id,a=fv(a),rh(a)){if("selectionStart"in a)var o={start:a.selectionStart,end:a.selectionEnd};else e:{o=(o=a.ownerDocument)&&o.defaultView||window;var u=o.getSelection&&o.getSelection();if(u&&u.rangeCount!==0){o=u.anchorNode;var p=u.anchorOffset,g=u.focusNode;u=u.focusOffset;try{o.nodeType,g.nodeType}catch{o=null;break e}var x=0,C=-1,$=-1,V=0,ee=0,ne=a,K=null;t:for(;;){for(var X;ne!==o||p!==0&&ne.nodeType!==3||(C=x+p),ne!==g||u!==0&&ne.nodeType!==3||($=x+u),ne.nodeType===3&&(x+=ne.nodeValue.length),(X=ne.firstChild)!==null;)K=ne,ne=X;for(;;){if(ne===a)break t;if(K===o&&++V===p&&(C=x),K===g&&++ee===u&&($=x),(X=ne.nextSibling)!==null)break;ne=K,K=ne.parentNode}ne=X}o=C===-1||$===-1?null:{start:C,end:$}}else o=null}o=o||{start:0,end:0}}else o=null;for(Rm={focusedElem:a,selectionRange:o},id=!1,pn=r;pn!==null;)if(r=pn,a=r.child,(r.subtreeFlags&1028)!==0&&a!==null)a.return=r,pn=a;else for(;pn!==null;){switch(r=pn,g=r.alternate,a=r.flags,r.tag){case 0:if((a&4)!==0&&(a=r.updateQueue,a=a!==null?a.events:null,a!==null))for(o=0;o<a.length;o++)p=a[o],p.ref.impl=p.nextImpl;break;case 11:case 15:break;case 1:if((a&1024)!==0&&g!==null){a=void 0,o=r,p=g.memoizedProps,g=g.memoizedState,u=o.stateNode;try{var xe=Zr(o.type,p);a=u.getSnapshotBeforeUpdate(xe,g),u.__reactInternalSnapshotBeforeUpdate=a}catch(Oe){mt(o,o.return,Oe)}}break;case 3:if((a&1024)!==0){if(a=r.stateNode.containerInfo,o=a.nodeType,o===9)Im(a);else if(o===1)switch(a.nodeName){case"HEAD":case"HTML":case"BODY":Im(a);break;default:a.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((a&1024)!==0)throw Error(i(163))}if(a=r.sibling,a!==null){a.return=r.return,pn=a;break}pn=r.return}}function t0(a,r,o){var u=o.flags;switch(o.tag){case 0:case 11:case 15:Ai(a,o),u&4&&bl(5,o);break;case 1:if(Ai(a,o),u&4)if(a=o.stateNode,r===null)try{a.componentDidMount()}catch(x){mt(o,o.return,x)}else{var p=Zr(o.type,r.memoizedProps);r=r.memoizedState;try{a.componentDidUpdate(p,r,a.__reactInternalSnapshotBeforeUpdate)}catch(x){mt(o,o.return,x)}}u&64&&Jb(o),u&512&&Sl(o,o.return);break;case 3:if(Ai(a,o),u&64&&(a=o.updateQueue,a!==null)){if(r=null,o.child!==null)switch(o.child.tag){case 27:case 5:r=o.child.stateNode;break;case 1:r=o.child.stateNode}try{_v(a,r)}catch(x){mt(o,o.return,x)}}break;case 27:r===null&&u&4&&Zb(o);case 26:case 5:Ai(a,o),r===null&&u&4&&Wb(o),u&512&&Sl(o,o.return);break;case 12:Ai(a,o);break;case 31:Ai(a,o),u&4&&i0(a,o);break;case 13:Ai(a,o),u&4&&r0(a,o),u&64&&(a=o.memoizedState,a!==null&&(a=a.dehydrated,a!==null&&(o=YA.bind(null,o),mM(a,o))));break;case 22:if(u=o.memoizedState!==null||Ci,!u){r=r!==null&&r.memoizedState!==null||tn,p=Ci;var g=tn;Ci=u,(tn=r)&&!g?Mi(a,o,(o.subtreeFlags&8772)!==0):Ai(a,o),Ci=p,tn=g}break;case 30:break;default:Ai(a,o)}}function n0(a){var r=a.alternate;r!==null&&(a.alternate=null,n0(r)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(r=a.stateNode,r!==null&&dt(r)),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}var Rt=null,Gn=!1;function Ei(a,r,o){for(o=o.child;o!==null;)a0(a,r,o),o=o.sibling}function a0(a,r,o){if(An&&typeof An.onCommitFiberUnmount=="function")try{An.onCommitFiberUnmount($n,o)}catch{}switch(o.tag){case 26:tn||ei(o,r),Ei(a,r,o),o.memoizedState?o.memoizedState.count--:o.stateNode&&(o=o.stateNode,o.parentNode.removeChild(o));break;case 27:tn||ei(o,r);var u=Rt,p=Gn;lr(o.type)&&(Rt=o.stateNode,Gn=!1),Ei(a,r,o),Tl(o.stateNode),Rt=u,Gn=p;break;case 5:tn||ei(o,r);case 6:if(u=Rt,p=Gn,Rt=null,Ei(a,r,o),Rt=u,Gn=p,Rt!==null)if(Gn)try{(Rt.nodeType===9?Rt.body:Rt.nodeName==="HTML"?Rt.ownerDocument.body:Rt).removeChild(o.stateNode)}catch(g){mt(o,r,g)}else try{Rt.removeChild(o.stateNode)}catch(g){mt(o,r,g)}break;case 18:Rt!==null&&(Gn?(a=Rt,J0(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,o.stateNode),ao(a)):J0(Rt,o.stateNode));break;case 4:u=Rt,p=Gn,Rt=o.stateNode.containerInfo,Gn=!0,Ei(a,r,o),Rt=u,Gn=p;break;case 0:case 11:case 14:case 15:tr(2,o,r),tn||tr(4,o,r),Ei(a,r,o);break;case 1:tn||(ei(o,r),u=o.stateNode,typeof u.componentWillUnmount=="function"&&Xb(o,r,u)),Ei(a,r,o);break;case 21:Ei(a,r,o);break;case 22:tn=(u=tn)||o.memoizedState!==null,Ei(a,r,o),tn=u;break;default:Ei(a,r,o)}}function i0(a,r){if(r.memoizedState===null&&(a=r.alternate,a!==null&&(a=a.memoizedState,a!==null))){a=a.dehydrated;try{ao(a)}catch(o){mt(r,r.return,o)}}}function r0(a,r){if(r.memoizedState===null&&(a=r.alternate,a!==null&&(a=a.memoizedState,a!==null&&(a=a.dehydrated,a!==null))))try{ao(a)}catch(o){mt(r,r.return,o)}}function UA(a){switch(a.tag){case 31:case 13:case 19:var r=a.stateNode;return r===null&&(r=a.stateNode=new e0),r;case 22:return a=a.stateNode,r=a._retryCache,r===null&&(r=a._retryCache=new e0),r;default:throw Error(i(435,a.tag))}}function zu(a,r){var o=UA(a);r.forEach(function(u){if(!o.has(u)){o.add(u);var p=JA.bind(null,a,u);u.then(p,p)}})}function Yn(a,r){var o=r.deletions;if(o!==null)for(var u=0;u<o.length;u++){var p=o[u],g=a,x=r,C=x;e:for(;C!==null;){switch(C.tag){case 27:if(lr(C.type)){Rt=C.stateNode,Gn=!1;break e}break;case 5:Rt=C.stateNode,Gn=!1;break e;case 3:case 4:Rt=C.stateNode.containerInfo,Gn=!0;break e}C=C.return}if(Rt===null)throw Error(i(160));a0(g,x,p),Rt=null,Gn=!1,g=p.alternate,g!==null&&(g.return=null),p.return=null}if(r.subtreeFlags&13886)for(r=r.child;r!==null;)s0(r,a),r=r.sibling}var Ua=null;function s0(a,r){var o=a.alternate,u=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:Yn(r,a),Jn(a),u&4&&(tr(3,a,a.return),bl(3,a),tr(5,a,a.return));break;case 1:Yn(r,a),Jn(a),u&512&&(tn||o===null||ei(o,o.return)),u&64&&Ci&&(a=a.updateQueue,a!==null&&(u=a.callbacks,u!==null&&(o=a.shared.hiddenCallbacks,a.shared.hiddenCallbacks=o===null?u:o.concat(u))));break;case 26:var p=Ua;if(Yn(r,a),Jn(a),u&512&&(tn||o===null||ei(o,o.return)),u&4){var g=o!==null?o.memoizedState:null;if(u=a.memoizedState,o===null)if(u===null)if(a.stateNode===null){e:{u=a.type,o=a.memoizedProps,p=p.ownerDocument||p;t:switch(u){case"title":g=p.getElementsByTagName("title")[0],(!g||g[Ot]||g[me]||g.namespaceURI==="http://www.w3.org/2000/svg"||g.hasAttribute("itemprop"))&&(g=p.createElement(u),p.head.insertBefore(g,p.querySelector("head > title"))),wn(g,u,o),g[me]=a,ft(g),u=g;break e;case"link":var x=sS("link","href",p).get(u+(o.href||""));if(x){for(var C=0;C<x.length;C++)if(g=x[C],g.getAttribute("href")===(o.href==null||o.href===""?null:o.href)&&g.getAttribute("rel")===(o.rel==null?null:o.rel)&&g.getAttribute("title")===(o.title==null?null:o.title)&&g.getAttribute("crossorigin")===(o.crossOrigin==null?null:o.crossOrigin)){x.splice(C,1);break t}}g=p.createElement(u),wn(g,u,o),p.head.appendChild(g);break;case"meta":if(x=sS("meta","content",p).get(u+(o.content||""))){for(C=0;C<x.length;C++)if(g=x[C],g.getAttribute("content")===(o.content==null?null:""+o.content)&&g.getAttribute("name")===(o.name==null?null:o.name)&&g.getAttribute("property")===(o.property==null?null:o.property)&&g.getAttribute("http-equiv")===(o.httpEquiv==null?null:o.httpEquiv)&&g.getAttribute("charset")===(o.charSet==null?null:o.charSet)){x.splice(C,1);break t}}g=p.createElement(u),wn(g,u,o),p.head.appendChild(g);break;default:throw Error(i(468,u))}g[me]=a,ft(g),u=g}a.stateNode=u}else oS(p,a.type,a.stateNode);else a.stateNode=rS(p,u,a.memoizedProps);else g!==u?(g===null?o.stateNode!==null&&(o=o.stateNode,o.parentNode.removeChild(o)):g.count--,u===null?oS(p,a.type,a.stateNode):rS(p,u,a.memoizedProps)):u===null&&a.stateNode!==null&&cm(a,a.memoizedProps,o.memoizedProps)}break;case 27:Yn(r,a),Jn(a),u&512&&(tn||o===null||ei(o,o.return)),o!==null&&u&4&&cm(a,a.memoizedProps,o.memoizedProps);break;case 5:if(Yn(r,a),Jn(a),u&512&&(tn||o===null||ei(o,o.return)),a.flags&32){p=a.stateNode;try{Es(p,"")}catch(xe){mt(a,a.return,xe)}}u&4&&a.stateNode!=null&&(p=a.memoizedProps,cm(a,p,o!==null?o.memoizedProps:p)),u&1024&&(fm=!0);break;case 6:if(Yn(r,a),Jn(a),u&4){if(a.stateNode===null)throw Error(i(162));u=a.memoizedProps,o=a.stateNode;try{o.nodeValue=u}catch(xe){mt(a,a.return,xe)}}break;case 3:if(ed=null,p=Ua,Ua=Qu(r.containerInfo),Yn(r,a),Ua=p,Jn(a),u&4&&o!==null&&o.memoizedState.isDehydrated)try{ao(r.containerInfo)}catch(xe){mt(a,a.return,xe)}fm&&(fm=!1,o0(a));break;case 4:u=Ua,Ua=Qu(a.stateNode.containerInfo),Yn(r,a),Jn(a),Ua=u;break;case 12:Yn(r,a),Jn(a);break;case 31:Yn(r,a),Jn(a),u&4&&(u=a.updateQueue,u!==null&&(a.updateQueue=null,zu(a,u)));break;case 13:Yn(r,a),Jn(a),a.child.flags&8192&&a.memoizedState!==null!=(o!==null&&o.memoizedState!==null)&&(Uu=un()),u&4&&(u=a.updateQueue,u!==null&&(a.updateQueue=null,zu(a,u)));break;case 22:p=a.memoizedState!==null;var $=o!==null&&o.memoizedState!==null,V=Ci,ee=tn;if(Ci=V||p,tn=ee||$,Yn(r,a),tn=ee,Ci=V,Jn(a),u&8192)e:for(r=a.stateNode,r._visibility=p?r._visibility&-2:r._visibility|1,p&&(o===null||$||Ci||tn||es(a)),o=null,r=a;;){if(r.tag===5||r.tag===26){if(o===null){$=o=r;try{if(g=$.stateNode,p)x=g.style,typeof x.setProperty=="function"?x.setProperty("display","none","important"):x.display="none";else{C=$.stateNode;var ne=$.memoizedProps.style,K=ne!=null&&ne.hasOwnProperty("display")?ne.display:null;C.style.display=K==null||typeof K=="boolean"?"":(""+K).trim()}}catch(xe){mt($,$.return,xe)}}}else if(r.tag===6){if(o===null){$=r;try{$.stateNode.nodeValue=p?"":$.memoizedProps}catch(xe){mt($,$.return,xe)}}}else if(r.tag===18){if(o===null){$=r;try{var X=$.stateNode;p?X0(X,!0):X0($.stateNode,!1)}catch(xe){mt($,$.return,xe)}}}else if((r.tag!==22&&r.tag!==23||r.memoizedState===null||r===a)&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===a)break e;for(;r.sibling===null;){if(r.return===null||r.return===a)break e;o===r&&(o=null),r=r.return}o===r&&(o=null),r.sibling.return=r.return,r=r.sibling}u&4&&(u=a.updateQueue,u!==null&&(o=u.retryQueue,o!==null&&(u.retryQueue=null,zu(a,o))));break;case 19:Yn(r,a),Jn(a),u&4&&(u=a.updateQueue,u!==null&&(a.updateQueue=null,zu(a,u)));break;case 30:break;case 21:break;default:Yn(r,a),Jn(a)}}function Jn(a){var r=a.flags;if(r&2){try{for(var o,u=a.return;u!==null;){if(Qb(u)){o=u;break}u=u.return}if(o==null)throw Error(i(160));switch(o.tag){case 27:var p=o.stateNode,g=um(a);Iu(a,g,p);break;case 5:var x=o.stateNode;o.flags&32&&(Es(x,""),o.flags&=-33);var C=um(a);Iu(a,C,x);break;case 3:case 4:var $=o.stateNode.containerInfo,V=um(a);dm(a,V,$);break;default:throw Error(i(161))}}catch(ee){mt(a,a.return,ee)}a.flags&=-3}r&4096&&(a.flags&=-4097)}function o0(a){if(a.subtreeFlags&1024)for(a=a.child;a!==null;){var r=a;o0(r),r.tag===5&&r.flags&1024&&r.stateNode.reset(),a=a.sibling}}function Ai(a,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)t0(a,r.alternate,r),r=r.sibling}function es(a){for(a=a.child;a!==null;){var r=a;switch(r.tag){case 0:case 11:case 14:case 15:tr(4,r,r.return),es(r);break;case 1:ei(r,r.return);var o=r.stateNode;typeof o.componentWillUnmount=="function"&&Xb(r,r.return,o),es(r);break;case 27:Tl(r.stateNode);case 26:case 5:ei(r,r.return),es(r);break;case 22:r.memoizedState===null&&es(r);break;case 30:es(r);break;default:es(r)}a=a.sibling}}function Mi(a,r,o){for(o=o&&(r.subtreeFlags&8772)!==0,r=r.child;r!==null;){var u=r.alternate,p=a,g=r,x=g.flags;switch(g.tag){case 0:case 11:case 15:Mi(p,g,o),bl(4,g);break;case 1:if(Mi(p,g,o),u=g,p=u.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(V){mt(u,u.return,V)}if(u=g,p=u.updateQueue,p!==null){var C=u.stateNode;try{var $=p.shared.hiddenCallbacks;if($!==null)for(p.shared.hiddenCallbacks=null,p=0;p<$.length;p++)zv($[p],C)}catch(V){mt(u,u.return,V)}}o&&x&64&&Jb(g),Sl(g,g.return);break;case 27:Zb(g);case 26:case 5:Mi(p,g,o),o&&u===null&&x&4&&Wb(g),Sl(g,g.return);break;case 12:Mi(p,g,o);break;case 31:Mi(p,g,o),o&&x&4&&i0(p,g);break;case 13:Mi(p,g,o),o&&x&4&&r0(p,g);break;case 22:g.memoizedState===null&&Mi(p,g,o),Sl(g,g.return);break;case 30:break;default:Mi(p,g,o)}r=r.sibling}}function hm(a,r){var o=null;a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(o=a.memoizedState.cachePool.pool),a=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(a=r.memoizedState.cachePool.pool),a!==o&&(a!=null&&a.refCount++,o!=null&&sl(o))}function mm(a,r){a=null,r.alternate!==null&&(a=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==a&&(r.refCount++,a!=null&&sl(a))}function Ba(a,r,o,u){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)l0(a,r,o,u),r=r.sibling}function l0(a,r,o,u){var p=r.flags;switch(r.tag){case 0:case 11:case 15:Ba(a,r,o,u),p&2048&&bl(9,r);break;case 1:Ba(a,r,o,u);break;case 3:Ba(a,r,o,u),p&2048&&(a=null,r.alternate!==null&&(a=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==a&&(r.refCount++,a!=null&&sl(a)));break;case 12:if(p&2048){Ba(a,r,o,u),a=r.stateNode;try{var g=r.memoizedProps,x=g.id,C=g.onPostCommit;typeof C=="function"&&C(x,r.alternate===null?"mount":"update",a.passiveEffectDuration,-0)}catch($){mt(r,r.return,$)}}else Ba(a,r,o,u);break;case 31:Ba(a,r,o,u);break;case 13:Ba(a,r,o,u);break;case 23:break;case 22:g=r.stateNode,x=r.alternate,r.memoizedState!==null?g._visibility&2?Ba(a,r,o,u):xl(a,r):g._visibility&2?Ba(a,r,o,u):(g._visibility|=2,Ks(a,r,o,u,(r.subtreeFlags&10256)!==0||!1)),p&2048&&hm(x,r);break;case 24:Ba(a,r,o,u),p&2048&&mm(r.alternate,r);break;default:Ba(a,r,o,u)}}function Ks(a,r,o,u,p){for(p=p&&((r.subtreeFlags&10256)!==0||!1),r=r.child;r!==null;){var g=a,x=r,C=o,$=u,V=x.flags;switch(x.tag){case 0:case 11:case 15:Ks(g,x,C,$,p),bl(8,x);break;case 23:break;case 22:var ee=x.stateNode;x.memoizedState!==null?ee._visibility&2?Ks(g,x,C,$,p):xl(g,x):(ee._visibility|=2,Ks(g,x,C,$,p)),p&&V&2048&&hm(x.alternate,x);break;case 24:Ks(g,x,C,$,p),p&&V&2048&&mm(x.alternate,x);break;default:Ks(g,x,C,$,p)}r=r.sibling}}function xl(a,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var o=a,u=r,p=u.flags;switch(u.tag){case 22:xl(o,u),p&2048&&hm(u.alternate,u);break;case 24:xl(o,u),p&2048&&mm(u.alternate,u);break;default:xl(o,u)}r=r.sibling}}var wl=8192;function Gs(a,r,o){if(a.subtreeFlags&wl)for(a=a.child;a!==null;)c0(a,r,o),a=a.sibling}function c0(a,r,o){switch(a.tag){case 26:Gs(a,r,o),a.flags&wl&&a.memoizedState!==null&&EM(o,Ua,a.memoizedState,a.memoizedProps);break;case 5:Gs(a,r,o);break;case 3:case 4:var u=Ua;Ua=Qu(a.stateNode.containerInfo),Gs(a,r,o),Ua=u;break;case 22:a.memoizedState===null&&(u=a.alternate,u!==null&&u.memoizedState!==null?(u=wl,wl=16777216,Gs(a,r,o),wl=u):Gs(a,r,o));break;default:Gs(a,r,o)}}function u0(a){var r=a.alternate;if(r!==null&&(a=r.child,a!==null)){r.child=null;do r=a.sibling,a.sibling=null,a=r;while(a!==null)}}function Dl(a){var r=a.deletions;if((a.flags&16)!==0){if(r!==null)for(var o=0;o<r.length;o++){var u=r[o];pn=u,f0(u,a)}u0(a)}if(a.subtreeFlags&10256)for(a=a.child;a!==null;)d0(a),a=a.sibling}function d0(a){switch(a.tag){case 0:case 11:case 15:Dl(a),a.flags&2048&&tr(9,a,a.return);break;case 3:Dl(a);break;case 12:Dl(a);break;case 22:var r=a.stateNode;a.memoizedState!==null&&r._visibility&2&&(a.return===null||a.return.tag!==13)?(r._visibility&=-3,_u(a)):Dl(a);break;default:Dl(a)}}function _u(a){var r=a.deletions;if((a.flags&16)!==0){if(r!==null)for(var o=0;o<r.length;o++){var u=r[o];pn=u,f0(u,a)}u0(a)}for(a=a.child;a!==null;){switch(r=a,r.tag){case 0:case 11:case 15:tr(8,r,r.return),_u(r);break;case 22:o=r.stateNode,o._visibility&2&&(o._visibility&=-3,_u(r));break;default:_u(r)}a=a.sibling}}function f0(a,r){for(;pn!==null;){var o=pn;switch(o.tag){case 0:case 11:case 15:tr(8,o,r);break;case 23:case 22:if(o.memoizedState!==null&&o.memoizedState.cachePool!==null){var u=o.memoizedState.cachePool.pool;u!=null&&u.refCount++}break;case 24:sl(o.memoizedState.cache)}if(u=o.child,u!==null)u.return=o,pn=u;else e:for(o=a;pn!==null;){u=pn;var p=u.sibling,g=u.return;if(n0(u),u===o){pn=null;break e}if(p!==null){p.return=g,pn=p;break e}pn=g}}}var BA={getCacheForType:function(a){var r=Sn(Qt),o=r.data.get(a);return o===void 0&&(o=a(),r.data.set(a,o)),o},cacheSignal:function(){return Sn(Qt).controller.signal}},FA=typeof WeakMap=="function"?WeakMap:Map,lt=0,wt=null,Xe=null,Ze=0,ht=0,ca=null,nr=!1,Ys=!1,pm=!1,Ti=0,Ht=0,ar=0,ts=0,gm=0,ua=0,Js=0,Nl=null,Xn=null,ym=!1,Uu=0,h0=0,Bu=1/0,Fu=null,ir=null,fn=0,rr=null,Xs=null,ji=0,vm=0,bm=null,m0=null,Cl=0,Sm=null;function da(){return(lt&2)!==0&&Ze!==0?Ze&-Ze:R.T!==null?Em():Ee()}function p0(){if(ua===0)if((Ze&536870912)===0||nt){var a=Bi;Bi<<=1,(Bi&3932160)===0&&(Bi=262144),ua=a}else ua=536870912;return a=oa.current,a!==null&&(a.flags|=32),ua}function Wn(a,r,o){(a===wt&&(ht===2||ht===9)||a.cancelPendingCommit!==null)&&(Ws(a,0),sr(a,Ze,ua,!1)),_r(a,o),((lt&2)===0||a!==wt)&&(a===wt&&((lt&2)===0&&(ts|=o),Ht===4&&sr(a,Ze,ua,!1)),ti(a))}function g0(a,r,o){if((lt&6)!==0)throw Error(i(327));var u=!o&&(r&127)===0&&(r&a.expiredLanes)===0||Fi(a,r),p=u?VA(a,r):wm(a,r,!0),g=u;do{if(p===0){Ys&&!u&&sr(a,r,0,!1);break}else{if(o=a.current.alternate,g&&!HA(o)){p=wm(a,r,!1),g=!1;continue}if(p===2){if(g=r,a.errorRecoveryDisabledLanes&g)var x=0;else x=a.pendingLanes&-536870913,x=x!==0?x:x&536870912?536870912:0;if(x!==0){r=x;e:{var C=a;p=Nl;var $=C.current.memoizedState.isDehydrated;if($&&(Ws(C,x).flags|=256),x=wm(C,x,!1),x!==2){if(pm&&!$){C.errorRecoveryDisabledLanes|=g,ts|=g,p=4;break e}g=Xn,Xn=p,g!==null&&(Xn===null?Xn=g:Xn.push.apply(Xn,g))}p=x}if(g=!1,p!==2)continue}}if(p===1){Ws(a,0),sr(a,r,0,!0);break}e:{switch(u=a,g=p,g){case 0:case 1:throw Error(i(345));case 4:if((r&4194048)!==r)break;case 6:sr(u,r,ua,!nr);break e;case 2:Xn=null;break;case 3:case 5:break;default:throw Error(i(329))}if((r&62914560)===r&&(p=Uu+300-un(),10<p)){if(sr(u,r,ua,!nr),Ss(u,0,!0)!==0)break e;ji=r,u.timeoutHandle=G0(y0.bind(null,u,o,Xn,Fu,ym,r,ua,ts,Js,nr,g,"Throttled",-0,0),p);break e}y0(u,o,Xn,Fu,ym,r,ua,ts,Js,nr,g,null,-0,0)}}break}while(!0);ti(a)}function y0(a,r,o,u,p,g,x,C,$,V,ee,ne,K,X){if(a.timeoutHandle=-1,ne=r.subtreeFlags,ne&8192||(ne&16785408)===16785408){ne={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:pi},c0(r,g,ne);var xe=(g&62914560)===g?Uu-un():(g&4194048)===g?h0-un():0;if(xe=AM(ne,xe),xe!==null){ji=g,a.cancelPendingCommit=xe(C0.bind(null,a,r,g,o,u,p,x,C,$,ee,ne,null,K,X)),sr(a,g,x,!V);return}}C0(a,r,g,o,u,p,x,C,$)}function HA(a){for(var r=a;;){var o=r.tag;if((o===0||o===11||o===15)&&r.flags&16384&&(o=r.updateQueue,o!==null&&(o=o.stores,o!==null)))for(var u=0;u<o.length;u++){var p=o[u],g=p.getSnapshot;p=p.value;try{if(!ra(g(),p))return!1}catch{return!1}}if(o=r.child,r.subtreeFlags&16384&&o!==null)o.return=r,r=o;else{if(r===a)break;for(;r.sibling===null;){if(r.return===null||r.return===a)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function sr(a,r,o,u){r&=~gm,r&=~ts,a.suspendedLanes|=r,a.pingedLanes&=~r,u&&(a.warmLanes|=r),u=a.expirationTimes;for(var p=r;0<p;){var g=31-Mn(p),x=1<<g;u[g]=-1,p&=~x}o!==0&&O(a,o,r)}function Hu(){return(lt&6)===0?(El(0),!1):!0}function xm(){if(Xe!==null){if(ht===0)var a=Xe.return;else a=Xe,bi=Kr=null,Ih(a),Bs=null,ll=0,a=Xe;for(;a!==null;)Yb(a.alternate,a),a=a.return;Xe=null}}function Ws(a,r){var o=a.timeoutHandle;o!==-1&&(a.timeoutHandle=-1,cM(o)),o=a.cancelPendingCommit,o!==null&&(a.cancelPendingCommit=null,o()),ji=0,xm(),wt=a,Xe=o=yi(a.current,null),Ze=r,ht=0,ca=null,nr=!1,Ys=Fi(a,r),pm=!1,Js=ua=gm=ts=ar=Ht=0,Xn=Nl=null,ym=!1,(r&8)!==0&&(r|=r&32);var u=a.entangledLanes;if(u!==0)for(a=a.entanglements,u&=r;0<u;){var p=31-Mn(u),g=1<<p;r|=a[p],u&=~g}return Ti=r,uu(),o}function v0(a,r){He=null,R.H=gl,r===Us||r===vu?(r=Rv(),ht=3):r===Ch?(r=Rv(),ht=4):ht=r===Zh?8:r!==null&&typeof r=="object"&&typeof r.then=="function"?6:1,ca=r,Xe===null&&(Ht=1,$u(a,wa(r,a.current)))}function b0(){var a=oa.current;return a===null?!0:(Ze&4194048)===Ze?Ea===null:(Ze&62914560)===Ze||(Ze&536870912)!==0?a===Ea:!1}function S0(){var a=R.H;return R.H=gl,a===null?gl:a}function x0(){var a=R.A;return R.A=BA,a}function qu(){Ht=4,nr||(Ze&4194048)!==Ze&&oa.current!==null||(Ys=!0),(ar&134217727)===0&&(ts&134217727)===0||wt===null||sr(wt,Ze,ua,!1)}function wm(a,r,o){var u=lt;lt|=2;var p=S0(),g=x0();(wt!==a||Ze!==r)&&(Fu=null,Ws(a,r)),r=!1;var x=Ht;e:do try{if(ht!==0&&Xe!==null){var C=Xe,$=ca;switch(ht){case 8:xm(),x=6;break e;case 3:case 2:case 9:case 6:oa.current===null&&(r=!0);var V=ht;if(ht=0,ca=null,Qs(a,C,$,V),o&&Ys){x=0;break e}break;default:V=ht,ht=0,ca=null,Qs(a,C,$,V)}}qA(),x=Ht;break}catch(ee){v0(a,ee)}while(!0);return r&&a.shellSuspendCounter++,bi=Kr=null,lt=u,R.H=p,R.A=g,Xe===null&&(wt=null,Ze=0,uu()),x}function qA(){for(;Xe!==null;)w0(Xe)}function VA(a,r){var o=lt;lt|=2;var u=S0(),p=x0();wt!==a||Ze!==r?(Fu=null,Bu=un()+500,Ws(a,r)):Ys=Fi(a,r);e:do try{if(ht!==0&&Xe!==null){r=Xe;var g=ca;t:switch(ht){case 1:ht=0,ca=null,Qs(a,r,g,1);break;case 2:case 9:if($v(g)){ht=0,ca=null,D0(r);break}r=function(){ht!==2&&ht!==9||wt!==a||(ht=7),ti(a)},g.then(r,r);break e;case 3:ht=7;break e;case 4:ht=5;break e;case 7:$v(g)?(ht=0,ca=null,D0(r)):(ht=0,ca=null,Qs(a,r,g,7));break;case 5:var x=null;switch(Xe.tag){case 26:x=Xe.memoizedState;case 5:case 27:var C=Xe;if(x?lS(x):C.stateNode.complete){ht=0,ca=null;var $=C.sibling;if($!==null)Xe=$;else{var V=C.return;V!==null?(Xe=V,Vu(V)):Xe=null}break t}}ht=0,ca=null,Qs(a,r,g,5);break;case 6:ht=0,ca=null,Qs(a,r,g,6);break;case 8:xm(),Ht=6;break e;default:throw Error(i(462))}}KA();break}catch(ee){v0(a,ee)}while(!0);return bi=Kr=null,R.H=u,R.A=p,lt=o,Xe!==null?0:(wt=null,Ze=0,uu(),Ht)}function KA(){for(;Xe!==null&&!_f();)w0(Xe)}function w0(a){var r=Kb(a.alternate,a,Ti);a.memoizedProps=a.pendingProps,r===null?Vu(a):Xe=r}function D0(a){var r=a,o=r.alternate;switch(r.tag){case 15:case 0:r=Ub(o,r,r.pendingProps,r.type,void 0,Ze);break;case 11:r=Ub(o,r,r.pendingProps,r.type.render,r.ref,Ze);break;case 5:Ih(r);default:Yb(o,r),r=Xe=xv(r,Ti),r=Kb(o,r,Ti)}a.memoizedProps=a.pendingProps,r===null?Vu(a):Xe=r}function Qs(a,r,o,u){bi=Kr=null,Ih(r),Bs=null,ll=0;var p=r.return;try{if(RA(a,p,r,o,Ze)){Ht=1,$u(a,wa(o,a.current)),Xe=null;return}}catch(g){if(p!==null)throw Xe=p,g;Ht=1,$u(a,wa(o,a.current)),Xe=null;return}r.flags&32768?(nt||u===1?a=!0:Ys||(Ze&536870912)!==0?a=!1:(nr=a=!0,(u===2||u===9||u===3||u===6)&&(u=oa.current,u!==null&&u.tag===13&&(u.flags|=16384))),N0(r,a)):Vu(r)}function Vu(a){var r=a;do{if((r.flags&32768)!==0){N0(r,nr);return}a=r.return;var o=IA(r.alternate,r,Ti);if(o!==null){Xe=o;return}if(r=r.sibling,r!==null){Xe=r;return}Xe=r=a}while(r!==null);Ht===0&&(Ht=5)}function N0(a,r){do{var o=zA(a.alternate,a);if(o!==null){o.flags&=32767,Xe=o;return}if(o=a.return,o!==null&&(o.flags|=32768,o.subtreeFlags=0,o.deletions=null),!r&&(a=a.sibling,a!==null)){Xe=a;return}Xe=a=o}while(a!==null);Ht=6,Xe=null}function C0(a,r,o,u,p,g,x,C,$){a.cancelPendingCommit=null;do Ku();while(fn!==0);if((lt&6)!==0)throw Error(i(327));if(r!==null){if(r===a.current)throw Error(i(177));if(g=r.lanes|r.childLanes,g|=uh,Ff(a,o,g,x,C,$),a===wt&&(Xe=wt=null,Ze=0),Xs=r,rr=a,ji=o,vm=g,bm=p,m0=u,(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?(a.callbackNode=null,a.callbackPriority=0,XA(Hn,function(){return j0(),null})):(a.callbackNode=null,a.callbackPriority=0),u=(r.flags&13878)!==0,(r.subtreeFlags&13878)!==0||u){u=R.T,R.T=null,p=W.p,W.p=2,x=lt,lt|=4;try{_A(a,r,o)}finally{lt=x,W.p=p,R.T=u}}fn=1,E0(),A0(),M0()}}function E0(){if(fn===1){fn=0;var a=rr,r=Xs,o=(r.flags&13878)!==0;if((r.subtreeFlags&13878)!==0||o){o=R.T,R.T=null;var u=W.p;W.p=2;var p=lt;lt|=4;try{s0(r,a);var g=Rm,x=fv(a.containerInfo),C=g.focusedElem,$=g.selectionRange;if(x!==C&&C&&C.ownerDocument&&dv(C.ownerDocument.documentElement,C)){if($!==null&&rh(C)){var V=$.start,ee=$.end;if(ee===void 0&&(ee=V),"selectionStart"in C)C.selectionStart=V,C.selectionEnd=Math.min(ee,C.value.length);else{var ne=C.ownerDocument||document,K=ne&&ne.defaultView||window;if(K.getSelection){var X=K.getSelection(),xe=C.textContent.length,Oe=Math.min($.start,xe),vt=$.end===void 0?Oe:Math.min($.end,xe);!X.extend&&Oe>vt&&(x=vt,vt=Oe,Oe=x);var B=uv(C,Oe),I=uv(C,vt);if(B&&I&&(X.rangeCount!==1||X.anchorNode!==B.node||X.anchorOffset!==B.offset||X.focusNode!==I.node||X.focusOffset!==I.offset)){var q=ne.createRange();q.setStart(B.node,B.offset),X.removeAllRanges(),Oe>vt?(X.addRange(q),X.extend(I.node,I.offset)):(q.setEnd(I.node,I.offset),X.addRange(q))}}}}for(ne=[],X=C;X=X.parentNode;)X.nodeType===1&&ne.push({element:X,left:X.scrollLeft,top:X.scrollTop});for(typeof C.focus=="function"&&C.focus(),C=0;C<ne.length;C++){var te=ne[C];te.element.scrollLeft=te.left,te.element.scrollTop=te.top}}id=!!Om,Rm=Om=null}finally{lt=p,W.p=u,R.T=o}}a.current=r,fn=2}}function A0(){if(fn===2){fn=0;var a=rr,r=Xs,o=(r.flags&8772)!==0;if((r.subtreeFlags&8772)!==0||o){o=R.T,R.T=null;var u=W.p;W.p=2;var p=lt;lt|=4;try{t0(a,r.alternate,r)}finally{lt=p,W.p=u,R.T=o}}fn=3}}function M0(){if(fn===4||fn===3){fn=0,mi();var a=rr,r=Xs,o=ji,u=m0;(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?fn=5:(fn=0,Xs=rr=null,T0(a,a.pendingLanes));var p=a.pendingLanes;if(p===0&&(ir=null),ue(o),r=r.stateNode,An&&typeof An.onCommitFiberRoot=="function")try{An.onCommitFiberRoot($n,r,void 0,(r.current.flags&128)===128)}catch{}if(u!==null){r=R.T,p=W.p,W.p=2,R.T=null;try{for(var g=a.onRecoverableError,x=0;x<u.length;x++){var C=u[x];g(C.value,{componentStack:C.stack})}}finally{R.T=r,W.p=p}}(ji&3)!==0&&Ku(),ti(a),p=a.pendingLanes,(o&261930)!==0&&(p&42)!==0?a===Sm?Cl++:(Cl=0,Sm=a):Cl=0,El(0)}}function T0(a,r){(a.pooledCacheLanes&=r)===0&&(r=a.pooledCache,r!=null&&(a.pooledCache=null,sl(r)))}function Ku(){return E0(),A0(),M0(),j0()}function j0(){if(fn!==5)return!1;var a=rr,r=vm;vm=0;var o=ue(ji),u=R.T,p=W.p;try{W.p=32>o?32:o,R.T=null,o=bm,bm=null;var g=rr,x=ji;if(fn=0,Xs=rr=null,ji=0,(lt&6)!==0)throw Error(i(331));var C=lt;if(lt|=4,d0(g.current),l0(g,g.current,x,o),lt=C,El(0,!1),An&&typeof An.onPostCommitFiberRoot=="function")try{An.onPostCommitFiberRoot($n,g)}catch{}return!0}finally{W.p=p,R.T=u,T0(a,r)}}function k0(a,r,o){r=wa(o,r),r=Qh(a.stateNode,r,2),a=Qi(a,r,2),a!==null&&(_r(a,2),ti(a))}function mt(a,r,o){if(a.tag===3)k0(a,a,o);else for(;r!==null;){if(r.tag===3){k0(r,a,o);break}else if(r.tag===1){var u=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(ir===null||!ir.has(u))){a=wa(o,a),o=$b(2),u=Qi(r,o,2),u!==null&&(Ob(o,u,r,a),_r(u,2),ti(u));break}}r=r.return}}function Dm(a,r,o){var u=a.pingCache;if(u===null){u=a.pingCache=new FA;var p=new Set;u.set(r,p)}else p=u.get(r),p===void 0&&(p=new Set,u.set(r,p));p.has(o)||(pm=!0,p.add(o),a=GA.bind(null,a,r,o),r.then(a,a))}function GA(a,r,o){var u=a.pingCache;u!==null&&u.delete(r),a.pingedLanes|=a.suspendedLanes&o,a.warmLanes&=~o,wt===a&&(Ze&o)===o&&(Ht===4||Ht===3&&(Ze&62914560)===Ze&&300>un()-Uu?(lt&2)===0&&Ws(a,0):gm|=o,Js===Ze&&(Js=0)),ti(a)}function $0(a,r){r===0&&(r=zr()),a=Hr(a,r),a!==null&&(_r(a,r),ti(a))}function YA(a){var r=a.memoizedState,o=0;r!==null&&(o=r.retryLane),$0(a,o)}function JA(a,r){var o=0;switch(a.tag){case 31:case 13:var u=a.stateNode,p=a.memoizedState;p!==null&&(o=p.retryLane);break;case 19:u=a.stateNode;break;case 22:u=a.stateNode._retryCache;break;default:throw Error(i(314))}u!==null&&u.delete(r),$0(a,o)}function XA(a,r){return Ko(a,r)}var Gu=null,Zs=null,Nm=!1,Yu=!1,Cm=!1,or=0;function ti(a){a!==Zs&&a.next===null&&(Zs===null?Gu=Zs=a:Zs=Zs.next=a),Yu=!0,Nm||(Nm=!0,QA())}function El(a,r){if(!Cm&&Yu){Cm=!0;do for(var o=!1,u=Gu;u!==null;){if(a!==0){var p=u.pendingLanes;if(p===0)var g=0;else{var x=u.suspendedLanes,C=u.pingedLanes;g=(1<<31-Mn(42|a)+1)-1,g&=p&~(x&~C),g=g&201326741?g&201326741|1:g?g|2:0}g!==0&&(o=!0,P0(u,g))}else g=Ze,g=Ss(u,u===wt?g:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),(g&3)===0||Fi(u,g)||(o=!0,P0(u,g));u=u.next}while(o);Cm=!1}}function WA(){O0()}function O0(){Yu=Nm=!1;var a=0;or!==0&&lM()&&(a=or);for(var r=un(),o=null,u=Gu;u!==null;){var p=u.next,g=R0(u,r);g===0?(u.next=null,o===null?Gu=p:o.next=p,p===null&&(Zs=o)):(o=u,(a!==0||(g&3)!==0)&&(Yu=!0)),u=p}fn!==0&&fn!==5||El(a),or!==0&&(or=0)}function R0(a,r){for(var o=a.suspendedLanes,u=a.pingedLanes,p=a.expirationTimes,g=a.pendingLanes&-62914561;0<g;){var x=31-Mn(g),C=1<<x,$=p[x];$===-1?((C&o)===0||(C&u)!==0)&&(p[x]=xs(C,r)):$<=r&&(a.expiredLanes|=C),g&=~C}if(r=wt,o=Ze,o=Ss(a,a===r?o:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),u=a.callbackNode,o===0||a===r&&(ht===2||ht===9)||a.cancelPendingCommit!==null)return u!==null&&u!==null&&Go(u),a.callbackNode=null,a.callbackPriority=0;if((o&3)===0||Fi(a,o)){if(r=o&-o,r===a.callbackPriority)return r;switch(u!==null&&Go(u),ue(o)){case 2:case 8:o=va;break;case 32:o=Hn;break;case 268435456:o=Qc;break;default:o=Hn}return u=L0.bind(null,a),o=Ko(o,u),a.callbackPriority=r,a.callbackNode=o,r}return u!==null&&u!==null&&Go(u),a.callbackPriority=2,a.callbackNode=null,2}function L0(a,r){if(fn!==0&&fn!==5)return a.callbackNode=null,a.callbackPriority=0,null;var o=a.callbackNode;if(Ku()&&a.callbackNode!==o)return null;var u=Ze;return u=Ss(a,a===wt?u:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),u===0?null:(g0(a,u,r),R0(a,un()),a.callbackNode!=null&&a.callbackNode===o?L0.bind(null,a):null)}function P0(a,r){if(Ku())return null;g0(a,r,!0)}function QA(){uM(function(){(lt&6)!==0?Ko(ys,WA):O0()})}function Em(){if(or===0){var a=zs;a===0&&(a=Ir,Ir<<=1,(Ir&261888)===0&&(Ir=256)),or=a}return or}function I0(a){return a==null||typeof a=="symbol"||typeof a=="boolean"?null:typeof a=="function"?a:nu(""+a)}function z0(a,r){var o=r.ownerDocument.createElement("input");return o.name=r.name,o.value=r.value,a.id&&o.setAttribute("form",a.id),r.parentNode.insertBefore(o,r),a=new FormData(a),o.parentNode.removeChild(o),a}function ZA(a,r,o,u,p){if(r==="submit"&&o&&o.stateNode===p){var g=I0((p[be]||null).action),x=u.submitter;x&&(r=(r=x[be]||null)?I0(r.formAction):x.getAttribute("formAction"),r!==null&&(g=r,x=null));var C=new su("action","action",null,u,p);a.push({event:C,listeners:[{instance:null,listener:function(){if(u.defaultPrevented){if(or!==0){var $=x?z0(p,x):new FormData(p);Kh(o,{pending:!0,data:$,method:p.method,action:g},null,$)}}else typeof g=="function"&&(C.preventDefault(),$=x?z0(p,x):new FormData(p),Kh(o,{pending:!0,data:$,method:p.method,action:g},g,$))},currentTarget:p}]})}}for(var Am=0;Am<ch.length;Am++){var Mm=ch[Am],eM=Mm.toLowerCase(),tM=Mm[0].toUpperCase()+Mm.slice(1);_a(eM,"on"+tM)}_a(pv,"onAnimationEnd"),_a(gv,"onAnimationIteration"),_a(yv,"onAnimationStart"),_a("dblclick","onDoubleClick"),_a("focusin","onFocus"),_a("focusout","onBlur"),_a(yA,"onTransitionRun"),_a(vA,"onTransitionStart"),_a(bA,"onTransitionCancel"),_a(vv,"onTransitionEnd"),za("onMouseEnter",["mouseout","mouseover"]),za("onMouseLeave",["mouseout","mouseover"]),za("onPointerEnter",["pointerout","pointerover"]),za("onPointerLeave",["pointerout","pointerover"]),Rn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Rn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Rn("onBeforeInput",["compositionend","keypress","textInput","paste"]),Rn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Rn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Rn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Al="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),nM=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Al));function _0(a,r){r=(r&4)!==0;for(var o=0;o<a.length;o++){var u=a[o],p=u.event;u=u.listeners;e:{var g=void 0;if(r)for(var x=u.length-1;0<=x;x--){var C=u[x],$=C.instance,V=C.currentTarget;if(C=C.listener,$!==g&&p.isPropagationStopped())break e;g=C,p.currentTarget=V;try{g(p)}catch(ee){cu(ee)}p.currentTarget=null,g=$}else for(x=0;x<u.length;x++){if(C=u[x],$=C.instance,V=C.currentTarget,C=C.listener,$!==g&&p.isPropagationStopped())break e;g=C,p.currentTarget=V;try{g(p)}catch(ee){cu(ee)}p.currentTarget=null,g=$}}}}function We(a,r){var o=r[Te];o===void 0&&(o=r[Te]=new Set);var u=a+"__bubble";o.has(u)||(U0(r,a,2,!1),o.add(u))}function Tm(a,r,o){var u=0;r&&(u|=4),U0(o,a,u,r)}var Ju="_reactListening"+Math.random().toString(36).slice(2);function jm(a){if(!a[Ju]){a[Ju]=!0,Ds.forEach(function(o){o!=="selectionchange"&&(nM.has(o)||Tm(o,!1,a),Tm(o,!0,a))});var r=a.nodeType===9?a:a.ownerDocument;r===null||r[Ju]||(r[Ju]=!0,Tm("selectionchange",!1,r))}}function U0(a,r,o,u){switch(pS(r)){case 2:var p=jM;break;case 8:p=kM;break;default:p=Vm}o=p.bind(null,r,o,a),p=void 0,!Xf||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(p=!0),u?p!==void 0?a.addEventListener(r,o,{capture:!0,passive:p}):a.addEventListener(r,o,!0):p!==void 0?a.addEventListener(r,o,{passive:p}):a.addEventListener(r,o,!1)}function km(a,r,o,u,p){var g=u;if((r&1)===0&&(r&2)===0&&u!==null)e:for(;;){if(u===null)return;var x=u.tag;if(x===3||x===4){var C=u.stateNode.containerInfo;if(C===p)break;if(x===4)for(x=u.return;x!==null;){var $=x.tag;if(($===3||$===4)&&x.stateNode.containerInfo===p)return;x=x.return}for(;C!==null;){if(x=rt(C),x===null)return;if($=x.tag,$===5||$===6||$===26||$===27){u=g=x;continue e}C=C.parentNode}}u=u.return}Vy(function(){var V=g,ee=Yf(o),ne=[];e:{var K=bv.get(a);if(K!==void 0){var X=su,xe=a;switch(a){case"keypress":if(iu(o)===0)break e;case"keydown":case"keyup":X=JE;break;case"focusin":xe="focus",X=eh;break;case"focusout":xe="blur",X=eh;break;case"beforeblur":case"afterblur":X=eh;break;case"click":if(o.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":X=Yy;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":X=IE;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":X=QE;break;case pv:case gv:case yv:X=UE;break;case vv:X=eA;break;case"scroll":case"scrollend":X=LE;break;case"wheel":X=nA;break;case"copy":case"cut":case"paste":X=FE;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":X=Xy;break;case"toggle":case"beforetoggle":X=iA}var Oe=(r&4)!==0,vt=!Oe&&(a==="scroll"||a==="scrollend"),B=Oe?K!==null?K+"Capture":null:K;Oe=[];for(var I=V,q;I!==null;){var te=I;if(q=te.stateNode,te=te.tag,te!==5&&te!==26&&te!==27||q===null||B===null||(te=Jo(I,B),te!=null&&Oe.push(Ml(I,te,q))),vt)break;I=I.return}0<Oe.length&&(K=new X(K,xe,null,o,ee),ne.push({event:K,listeners:Oe}))}}if((r&7)===0){e:{if(K=a==="mouseover"||a==="pointerover",X=a==="mouseout"||a==="pointerout",K&&o!==Gf&&(xe=o.relatedTarget||o.fromElement)&&(rt(xe)||xe[De]))break e;if((X||K)&&(K=ee.window===ee?ee:(K=ee.ownerDocument)?K.defaultView||K.parentWindow:window,X?(xe=o.relatedTarget||o.toElement,X=V,xe=xe?rt(xe):null,xe!==null&&(vt=l(xe),Oe=xe.tag,xe!==vt||Oe!==5&&Oe!==27&&Oe!==6)&&(xe=null)):(X=null,xe=V),X!==xe)){if(Oe=Yy,te="onMouseLeave",B="onMouseEnter",I="mouse",(a==="pointerout"||a==="pointerover")&&(Oe=Xy,te="onPointerLeave",B="onPointerEnter",I="pointer"),vt=X==null?K:Ia(X),q=xe==null?K:Ia(xe),K=new Oe(te,I+"leave",X,o,ee),K.target=vt,K.relatedTarget=q,te=null,rt(ee)===V&&(Oe=new Oe(B,I+"enter",xe,o,ee),Oe.target=q,Oe.relatedTarget=vt,te=Oe),vt=te,X&&xe)t:{for(Oe=aM,B=X,I=xe,q=0,te=B;te;te=Oe(te))q++;te=0;for(var je=I;je;je=Oe(je))te++;for(;0<q-te;)B=Oe(B),q--;for(;0<te-q;)I=Oe(I),te--;for(;q--;){if(B===I||I!==null&&B===I.alternate){Oe=B;break t}B=Oe(B),I=Oe(I)}Oe=null}else Oe=null;X!==null&&B0(ne,K,X,Oe,!1),xe!==null&&vt!==null&&B0(ne,vt,xe,Oe,!0)}}e:{if(K=V?Ia(V):window,X=K.nodeName&&K.nodeName.toLowerCase(),X==="select"||X==="input"&&K.type==="file")var st=iv;else if(nv(K))if(rv)st=mA;else{st=fA;var Ne=dA}else X=K.nodeName,!X||X.toLowerCase()!=="input"||K.type!=="checkbox"&&K.type!=="radio"?V&&Kf(V.elementType)&&(st=iv):st=hA;if(st&&(st=st(a,V))){av(ne,st,o,ee);break e}Ne&&Ne(a,K,V),a==="focusout"&&V&&K.type==="number"&&V.memoizedProps.value!=null&&Vf(K,"number",K.value)}switch(Ne=V?Ia(V):window,a){case"focusin":(nv(Ne)||Ne.contentEditable==="true")&&(js=Ne,sh=V,al=null);break;case"focusout":al=sh=js=null;break;case"mousedown":oh=!0;break;case"contextmenu":case"mouseup":case"dragend":oh=!1,hv(ne,o,ee);break;case"selectionchange":if(gA)break;case"keydown":case"keyup":hv(ne,o,ee)}var qe;if(nh)e:{switch(a){case"compositionstart":var et="onCompositionStart";break e;case"compositionend":et="onCompositionEnd";break e;case"compositionupdate":et="onCompositionUpdate";break e}et=void 0}else Ts?ev(a,o)&&(et="onCompositionEnd"):a==="keydown"&&o.keyCode===229&&(et="onCompositionStart");et&&(Wy&&o.locale!=="ko"&&(Ts||et!=="onCompositionStart"?et==="onCompositionEnd"&&Ts&&(qe=Ky()):(Vi=ee,Wf="value"in Vi?Vi.value:Vi.textContent,Ts=!0)),Ne=Xu(V,et),0<Ne.length&&(et=new Jy(et,a,null,o,ee),ne.push({event:et,listeners:Ne}),qe?et.data=qe:(qe=tv(o),qe!==null&&(et.data=qe)))),(qe=sA?oA(a,o):lA(a,o))&&(et=Xu(V,"onBeforeInput"),0<et.length&&(Ne=new Jy("onBeforeInput","beforeinput",null,o,ee),ne.push({event:Ne,listeners:et}),Ne.data=qe)),ZA(ne,a,V,o,ee)}_0(ne,r)})}function Ml(a,r,o){return{instance:a,listener:r,currentTarget:o}}function Xu(a,r){for(var o=r+"Capture",u=[];a!==null;){var p=a,g=p.stateNode;if(p=p.tag,p!==5&&p!==26&&p!==27||g===null||(p=Jo(a,o),p!=null&&u.unshift(Ml(a,p,g)),p=Jo(a,r),p!=null&&u.push(Ml(a,p,g))),a.tag===3)return u;a=a.return}return[]}function aM(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5&&a.tag!==27);return a||null}function B0(a,r,o,u,p){for(var g=r._reactName,x=[];o!==null&&o!==u;){var C=o,$=C.alternate,V=C.stateNode;if(C=C.tag,$!==null&&$===u)break;C!==5&&C!==26&&C!==27||V===null||($=V,p?(V=Jo(o,g),V!=null&&x.unshift(Ml(o,V,$))):p||(V=Jo(o,g),V!=null&&x.push(Ml(o,V,$)))),o=o.return}x.length!==0&&a.push({event:r,listeners:x})}var iM=/\r\n?/g,rM=/\u0000|\uFFFD/g;function F0(a){return(typeof a=="string"?a:""+a).replace(iM,`
|
|
14
|
-
`).replace(rM,"")}function H0(a,r){return r=F0(r),F0(a)===r}function yt(a,r,o,u,p,g){switch(o){case"children":typeof u=="string"?r==="body"||r==="textarea"&&u===""||Es(a,u):(typeof u=="number"||typeof u=="bigint")&&r!=="body"&&Es(a,""+u);break;case"className":xt(a,"class",u);break;case"tabIndex":xt(a,"tabindex",u);break;case"dir":case"role":case"viewBox":case"width":case"height":xt(a,o,u);break;case"style":Hy(a,u,g);break;case"data":if(r!=="object"){xt(a,"data",u);break}case"src":case"href":if(u===""&&(r!=="a"||o!=="href")){a.removeAttribute(o);break}if(u==null||typeof u=="function"||typeof u=="symbol"||typeof u=="boolean"){a.removeAttribute(o);break}u=nu(""+u),a.setAttribute(o,u);break;case"action":case"formAction":if(typeof u=="function"){a.setAttribute(o,"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 g=="function"&&(o==="formAction"?(r!=="input"&&yt(a,r,"name",p.name,p,null),yt(a,r,"formEncType",p.formEncType,p,null),yt(a,r,"formMethod",p.formMethod,p,null),yt(a,r,"formTarget",p.formTarget,p,null)):(yt(a,r,"encType",p.encType,p,null),yt(a,r,"method",p.method,p,null),yt(a,r,"target",p.target,p,null)));if(u==null||typeof u=="symbol"||typeof u=="boolean"){a.removeAttribute(o);break}u=nu(""+u),a.setAttribute(o,u);break;case"onClick":u!=null&&(a.onclick=pi);break;case"onScroll":u!=null&&We("scroll",a);break;case"onScrollEnd":u!=null&&We("scrollend",a);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(i(61));if(o=u.__html,o!=null){if(p.children!=null)throw Error(i(60));a.innerHTML=o}}break;case"multiple":a.multiple=u&&typeof u!="function"&&typeof u!="symbol";break;case"muted":a.muted=u&&typeof u!="function"&&typeof u!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(u==null||typeof u=="function"||typeof u=="boolean"||typeof u=="symbol"){a.removeAttribute("xlink:href");break}o=nu(""+u),a.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",o);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":u!=null&&typeof u!="function"&&typeof u!="symbol"?a.setAttribute(o,""+u):a.removeAttribute(o);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":u&&typeof u!="function"&&typeof u!="symbol"?a.setAttribute(o,""):a.removeAttribute(o);break;case"capture":case"download":u===!0?a.setAttribute(o,""):u!==!1&&u!=null&&typeof u!="function"&&typeof u!="symbol"?a.setAttribute(o,u):a.removeAttribute(o);break;case"cols":case"rows":case"size":case"span":u!=null&&typeof u!="function"&&typeof u!="symbol"&&!isNaN(u)&&1<=u?a.setAttribute(o,u):a.removeAttribute(o);break;case"rowSpan":case"start":u==null||typeof u=="function"||typeof u=="symbol"||isNaN(u)?a.removeAttribute(o):a.setAttribute(o,u);break;case"popover":We("beforetoggle",a),We("toggle",a),ba(a,"popover",u);break;case"xlinkActuate":Vn(a,"http://www.w3.org/1999/xlink","xlink:actuate",u);break;case"xlinkArcrole":Vn(a,"http://www.w3.org/1999/xlink","xlink:arcrole",u);break;case"xlinkRole":Vn(a,"http://www.w3.org/1999/xlink","xlink:role",u);break;case"xlinkShow":Vn(a,"http://www.w3.org/1999/xlink","xlink:show",u);break;case"xlinkTitle":Vn(a,"http://www.w3.org/1999/xlink","xlink:title",u);break;case"xlinkType":Vn(a,"http://www.w3.org/1999/xlink","xlink:type",u);break;case"xmlBase":Vn(a,"http://www.w3.org/XML/1998/namespace","xml:base",u);break;case"xmlLang":Vn(a,"http://www.w3.org/XML/1998/namespace","xml:lang",u);break;case"xmlSpace":Vn(a,"http://www.w3.org/XML/1998/namespace","xml:space",u);break;case"is":ba(a,"is",u);break;case"innerText":case"textContent":break;default:(!(2<o.length)||o[0]!=="o"&&o[0]!=="O"||o[1]!=="n"&&o[1]!=="N")&&(o=OE.get(o)||o,ba(a,o,u))}}function $m(a,r,o,u,p,g){switch(o){case"style":Hy(a,u,g);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(i(61));if(o=u.__html,o!=null){if(p.children!=null)throw Error(i(60));a.innerHTML=o}}break;case"children":typeof u=="string"?Es(a,u):(typeof u=="number"||typeof u=="bigint")&&Es(a,""+u);break;case"onScroll":u!=null&&We("scroll",a);break;case"onScrollEnd":u!=null&&We("scrollend",a);break;case"onClick":u!=null&&(a.onclick=pi);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Hi.hasOwnProperty(o))e:{if(o[0]==="o"&&o[1]==="n"&&(p=o.endsWith("Capture"),r=o.slice(2,p?o.length-7:void 0),g=a[be]||null,g=g!=null?g[o]:null,typeof g=="function"&&a.removeEventListener(r,g,p),typeof u=="function")){typeof g!="function"&&g!==null&&(o in a?a[o]=null:a.hasAttribute(o)&&a.removeAttribute(o)),a.addEventListener(r,u,p);break e}o in a?a[o]=u:u===!0?a.setAttribute(o,""):ba(a,o,u)}}}function wn(a,r,o){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":We("error",a),We("load",a);var u=!1,p=!1,g;for(g in o)if(o.hasOwnProperty(g)){var x=o[g];if(x!=null)switch(g){case"src":u=!0;break;case"srcSet":p=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,r));default:yt(a,r,g,x,o,null)}}p&&yt(a,r,"srcSet",o.srcSet,o,null),u&&yt(a,r,"src",o.src,o,null);return;case"input":We("invalid",a);var C=g=x=p=null,$=null,V=null;for(u in o)if(o.hasOwnProperty(u)){var ee=o[u];if(ee!=null)switch(u){case"name":p=ee;break;case"type":x=ee;break;case"checked":$=ee;break;case"defaultChecked":V=ee;break;case"value":g=ee;break;case"defaultValue":C=ee;break;case"children":case"dangerouslySetInnerHTML":if(ee!=null)throw Error(i(137,r));break;default:yt(a,r,u,ee,o,null)}}_y(a,g,C,$,V,x,p,!1);return;case"select":We("invalid",a),u=x=g=null;for(p in o)if(o.hasOwnProperty(p)&&(C=o[p],C!=null))switch(p){case"value":g=C;break;case"defaultValue":x=C;break;case"multiple":u=C;default:yt(a,r,p,C,o,null)}r=g,o=x,a.multiple=!!u,r!=null?Cs(a,!!u,r,!1):o!=null&&Cs(a,!!u,o,!0);return;case"textarea":We("invalid",a),g=p=u=null;for(x in o)if(o.hasOwnProperty(x)&&(C=o[x],C!=null))switch(x){case"value":u=C;break;case"defaultValue":p=C;break;case"children":g=C;break;case"dangerouslySetInnerHTML":if(C!=null)throw Error(i(91));break;default:yt(a,r,x,C,o,null)}By(a,u,p,g);return;case"option":for($ in o)if(o.hasOwnProperty($)&&(u=o[$],u!=null))switch($){case"selected":a.selected=u&&typeof u!="function"&&typeof u!="symbol";break;default:yt(a,r,$,u,o,null)}return;case"dialog":We("beforetoggle",a),We("toggle",a),We("cancel",a),We("close",a);break;case"iframe":case"object":We("load",a);break;case"video":case"audio":for(u=0;u<Al.length;u++)We(Al[u],a);break;case"image":We("error",a),We("load",a);break;case"details":We("toggle",a);break;case"embed":case"source":case"link":We("error",a),We("load",a);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(V in o)if(o.hasOwnProperty(V)&&(u=o[V],u!=null))switch(V){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,r));default:yt(a,r,V,u,o,null)}return;default:if(Kf(r)){for(ee in o)o.hasOwnProperty(ee)&&(u=o[ee],u!==void 0&&$m(a,r,ee,u,o,void 0));return}}for(C in o)o.hasOwnProperty(C)&&(u=o[C],u!=null&&yt(a,r,C,u,o,null))}function sM(a,r,o,u){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var p=null,g=null,x=null,C=null,$=null,V=null,ee=null;for(X in o){var ne=o[X];if(o.hasOwnProperty(X)&&ne!=null)switch(X){case"checked":break;case"value":break;case"defaultValue":$=ne;default:u.hasOwnProperty(X)||yt(a,r,X,null,u,ne)}}for(var K in u){var X=u[K];if(ne=o[K],u.hasOwnProperty(K)&&(X!=null||ne!=null))switch(K){case"type":g=X;break;case"name":p=X;break;case"checked":V=X;break;case"defaultChecked":ee=X;break;case"value":x=X;break;case"defaultValue":C=X;break;case"children":case"dangerouslySetInnerHTML":if(X!=null)throw Error(i(137,r));break;default:X!==ne&&yt(a,r,K,X,u,ne)}}qf(a,x,C,$,V,ee,g,p);return;case"select":X=x=C=K=null;for(g in o)if($=o[g],o.hasOwnProperty(g)&&$!=null)switch(g){case"value":break;case"multiple":X=$;default:u.hasOwnProperty(g)||yt(a,r,g,null,u,$)}for(p in u)if(g=u[p],$=o[p],u.hasOwnProperty(p)&&(g!=null||$!=null))switch(p){case"value":K=g;break;case"defaultValue":C=g;break;case"multiple":x=g;default:g!==$&&yt(a,r,p,g,u,$)}r=C,o=x,u=X,K!=null?Cs(a,!!o,K,!1):!!u!=!!o&&(r!=null?Cs(a,!!o,r,!0):Cs(a,!!o,o?[]:"",!1));return;case"textarea":X=K=null;for(C in o)if(p=o[C],o.hasOwnProperty(C)&&p!=null&&!u.hasOwnProperty(C))switch(C){case"value":break;case"children":break;default:yt(a,r,C,null,u,p)}for(x in u)if(p=u[x],g=o[x],u.hasOwnProperty(x)&&(p!=null||g!=null))switch(x){case"value":K=p;break;case"defaultValue":X=p;break;case"children":break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(i(91));break;default:p!==g&&yt(a,r,x,p,u,g)}Uy(a,K,X);return;case"option":for(var xe in o)if(K=o[xe],o.hasOwnProperty(xe)&&K!=null&&!u.hasOwnProperty(xe))switch(xe){case"selected":a.selected=!1;break;default:yt(a,r,xe,null,u,K)}for($ in u)if(K=u[$],X=o[$],u.hasOwnProperty($)&&K!==X&&(K!=null||X!=null))switch($){case"selected":a.selected=K&&typeof K!="function"&&typeof K!="symbol";break;default:yt(a,r,$,K,u,X)}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 Oe in o)K=o[Oe],o.hasOwnProperty(Oe)&&K!=null&&!u.hasOwnProperty(Oe)&&yt(a,r,Oe,null,u,K);for(V in u)if(K=u[V],X=o[V],u.hasOwnProperty(V)&&K!==X&&(K!=null||X!=null))switch(V){case"children":case"dangerouslySetInnerHTML":if(K!=null)throw Error(i(137,r));break;default:yt(a,r,V,K,u,X)}return;default:if(Kf(r)){for(var vt in o)K=o[vt],o.hasOwnProperty(vt)&&K!==void 0&&!u.hasOwnProperty(vt)&&$m(a,r,vt,void 0,u,K);for(ee in u)K=u[ee],X=o[ee],!u.hasOwnProperty(ee)||K===X||K===void 0&&X===void 0||$m(a,r,ee,K,u,X);return}}for(var B in o)K=o[B],o.hasOwnProperty(B)&&K!=null&&!u.hasOwnProperty(B)&&yt(a,r,B,null,u,K);for(ne in u)K=u[ne],X=o[ne],!u.hasOwnProperty(ne)||K===X||K==null&&X==null||yt(a,r,ne,K,u,X)}function q0(a){switch(a){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function oM(){if(typeof performance.getEntriesByType=="function"){for(var a=0,r=0,o=performance.getEntriesByType("resource"),u=0;u<o.length;u++){var p=o[u],g=p.transferSize,x=p.initiatorType,C=p.duration;if(g&&C&&q0(x)){for(x=0,C=p.responseEnd,u+=1;u<o.length;u++){var $=o[u],V=$.startTime;if(V>C)break;var ee=$.transferSize,ne=$.initiatorType;ee&&q0(ne)&&($=$.responseEnd,x+=ee*($<C?1:(C-V)/($-V)))}if(--u,r+=8*(g+x)/(p.duration/1e3),a++,10<a)break}}if(0<a)return r/a/1e6}return navigator.connection&&(a=navigator.connection.downlink,typeof a=="number")?a:5}var Om=null,Rm=null;function Wu(a){return a.nodeType===9?a:a.ownerDocument}function V0(a){switch(a){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function K0(a,r){if(a===0)switch(r){case"svg":return 1;case"math":return 2;default:return 0}return a===1&&r==="foreignObject"?0:a}function Lm(a,r){return a==="textarea"||a==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.children=="bigint"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var Pm=null;function lM(){var a=window.event;return a&&a.type==="popstate"?a===Pm?!1:(Pm=a,!0):(Pm=null,!1)}var G0=typeof setTimeout=="function"?setTimeout:void 0,cM=typeof clearTimeout=="function"?clearTimeout:void 0,Y0=typeof Promise=="function"?Promise:void 0,uM=typeof queueMicrotask=="function"?queueMicrotask:typeof Y0<"u"?function(a){return Y0.resolve(null).then(a).catch(dM)}:G0;function dM(a){setTimeout(function(){throw a})}function lr(a){return a==="head"}function J0(a,r){var o=r,u=0;do{var p=o.nextSibling;if(a.removeChild(o),p&&p.nodeType===8)if(o=p.data,o==="/$"||o==="/&"){if(u===0){a.removeChild(p),ao(r);return}u--}else if(o==="$"||o==="$?"||o==="$~"||o==="$!"||o==="&")u++;else if(o==="html")Tl(a.ownerDocument.documentElement);else if(o==="head"){o=a.ownerDocument.head,Tl(o);for(var g=o.firstChild;g;){var x=g.nextSibling,C=g.nodeName;g[Ot]||C==="SCRIPT"||C==="STYLE"||C==="LINK"&&g.rel.toLowerCase()==="stylesheet"||o.removeChild(g),g=x}}else o==="body"&&Tl(a.ownerDocument.body);o=p}while(o);ao(r)}function X0(a,r){var o=a;a=0;do{var u=o.nextSibling;if(o.nodeType===1?r?(o._stashedDisplay=o.style.display,o.style.display="none"):(o.style.display=o._stashedDisplay||"",o.getAttribute("style")===""&&o.removeAttribute("style")):o.nodeType===3&&(r?(o._stashedText=o.nodeValue,o.nodeValue=""):o.nodeValue=o._stashedText||""),u&&u.nodeType===8)if(o=u.data,o==="/$"){if(a===0)break;a--}else o!=="$"&&o!=="$?"&&o!=="$~"&&o!=="$!"||a++;o=u}while(o)}function Im(a){var r=a.firstChild;for(r&&r.nodeType===10&&(r=r.nextSibling);r;){var o=r;switch(r=r.nextSibling,o.nodeName){case"HTML":case"HEAD":case"BODY":Im(o),dt(o);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(o.rel.toLowerCase()==="stylesheet")continue}a.removeChild(o)}}function fM(a,r,o,u){for(;a.nodeType===1;){var p=o;if(a.nodeName.toLowerCase()!==r.toLowerCase()){if(!u&&(a.nodeName!=="INPUT"||a.type!=="hidden"))break}else if(u){if(!a[Ot])switch(r){case"meta":if(!a.hasAttribute("itemprop"))break;return a;case"link":if(g=a.getAttribute("rel"),g==="stylesheet"&&a.hasAttribute("data-precedence"))break;if(g!==p.rel||a.getAttribute("href")!==(p.href==null||p.href===""?null:p.href)||a.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin)||a.getAttribute("title")!==(p.title==null?null:p.title))break;return a;case"style":if(a.hasAttribute("data-precedence"))break;return a;case"script":if(g=a.getAttribute("src"),(g!==(p.src==null?null:p.src)||a.getAttribute("type")!==(p.type==null?null:p.type)||a.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin))&&g&&a.hasAttribute("async")&&!a.hasAttribute("itemprop"))break;return a;default:return a}}else if(r==="input"&&a.type==="hidden"){var g=p.name==null?null:""+p.name;if(p.type==="hidden"&&a.getAttribute("name")===g)return a}else return a;if(a=Aa(a.nextSibling),a===null)break}return null}function hM(a,r,o){if(r==="")return null;for(;a.nodeType!==3;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!o||(a=Aa(a.nextSibling),a===null))return null;return a}function W0(a,r){for(;a.nodeType!==8;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!r||(a=Aa(a.nextSibling),a===null))return null;return a}function zm(a){return a.data==="$?"||a.data==="$~"}function _m(a){return a.data==="$!"||a.data==="$?"&&a.ownerDocument.readyState!=="loading"}function mM(a,r){var o=a.ownerDocument;if(a.data==="$~")a._reactRetry=r;else if(a.data!=="$?"||o.readyState!=="loading")r();else{var u=function(){r(),o.removeEventListener("DOMContentLoaded",u)};o.addEventListener("DOMContentLoaded",u),a._reactRetry=u}}function Aa(a){for(;a!=null;a=a.nextSibling){var r=a.nodeType;if(r===1||r===3)break;if(r===8){if(r=a.data,r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"||r==="F!"||r==="F")break;if(r==="/$"||r==="/&")return null}}return a}var Um=null;function Q0(a){a=a.nextSibling;for(var r=0;a;){if(a.nodeType===8){var o=a.data;if(o==="/$"||o==="/&"){if(r===0)return Aa(a.nextSibling);r--}else o!=="$"&&o!=="$!"&&o!=="$?"&&o!=="$~"&&o!=="&"||r++}a=a.nextSibling}return null}function Z0(a){a=a.previousSibling;for(var r=0;a;){if(a.nodeType===8){var o=a.data;if(o==="$"||o==="$!"||o==="$?"||o==="$~"||o==="&"){if(r===0)return a;r--}else o!=="/$"&&o!=="/&"||r++}a=a.previousSibling}return null}function eS(a,r,o){switch(r=Wu(o),a){case"html":if(a=r.documentElement,!a)throw Error(i(452));return a;case"head":if(a=r.head,!a)throw Error(i(453));return a;case"body":if(a=r.body,!a)throw Error(i(454));return a;default:throw Error(i(451))}}function Tl(a){for(var r=a.attributes;r.length;)a.removeAttributeNode(r[0]);dt(a)}var Ma=new Map,tS=new Set;function Qu(a){return typeof a.getRootNode=="function"?a.getRootNode():a.nodeType===9?a:a.ownerDocument}var ki=W.d;W.d={f:pM,r:gM,D:yM,C:vM,L:bM,m:SM,X:wM,S:xM,M:DM};function pM(){var a=ki.f(),r=Hu();return a||r}function gM(a){var r=qn(a);r!==null&&r.tag===5&&r.type==="form"?vb(r):ki.r(a)}var eo=typeof document>"u"?null:document;function nS(a,r,o){var u=eo;if(u&&typeof r=="string"&&r){var p=Sa(r);p='link[rel="'+a+'"][href="'+p+'"]',typeof o=="string"&&(p+='[crossorigin="'+o+'"]'),tS.has(p)||(tS.add(p),a={rel:a,crossOrigin:o,href:r},u.querySelector(p)===null&&(r=u.createElement("link"),wn(r,"link",a),ft(r),u.head.appendChild(r)))}}function yM(a){ki.D(a),nS("dns-prefetch",a,null)}function vM(a,r){ki.C(a,r),nS("preconnect",a,r)}function bM(a,r,o){ki.L(a,r,o);var u=eo;if(u&&a&&r){var p='link[rel="preload"][as="'+Sa(r)+'"]';r==="image"&&o&&o.imageSrcSet?(p+='[imagesrcset="'+Sa(o.imageSrcSet)+'"]',typeof o.imageSizes=="string"&&(p+='[imagesizes="'+Sa(o.imageSizes)+'"]')):p+='[href="'+Sa(a)+'"]';var g=p;switch(r){case"style":g=to(a);break;case"script":g=no(a)}Ma.has(g)||(a=v({rel:"preload",href:r==="image"&&o&&o.imageSrcSet?void 0:a,as:r},o),Ma.set(g,a),u.querySelector(p)!==null||r==="style"&&u.querySelector(jl(g))||r==="script"&&u.querySelector(kl(g))||(r=u.createElement("link"),wn(r,"link",a),ft(r),u.head.appendChild(r)))}}function SM(a,r){ki.m(a,r);var o=eo;if(o&&a){var u=r&&typeof r.as=="string"?r.as:"script",p='link[rel="modulepreload"][as="'+Sa(u)+'"][href="'+Sa(a)+'"]',g=p;switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":g=no(a)}if(!Ma.has(g)&&(a=v({rel:"modulepreload",href:a},r),Ma.set(g,a),o.querySelector(p)===null)){switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(o.querySelector(kl(g)))return}u=o.createElement("link"),wn(u,"link",a),ft(u),o.head.appendChild(u)}}}function xM(a,r,o){ki.S(a,r,o);var u=eo;if(u&&a){var p=On(u).hoistableStyles,g=to(a);r=r||"default";var x=p.get(g);if(!x){var C={loading:0,preload:null};if(x=u.querySelector(jl(g)))C.loading=5;else{a=v({rel:"stylesheet",href:a,"data-precedence":r},o),(o=Ma.get(g))&&Bm(a,o);var $=x=u.createElement("link");ft($),wn($,"link",a),$._p=new Promise(function(V,ee){$.onload=V,$.onerror=ee}),$.addEventListener("load",function(){C.loading|=1}),$.addEventListener("error",function(){C.loading|=2}),C.loading|=4,Zu(x,r,u)}x={type:"stylesheet",instance:x,count:1,state:C},p.set(g,x)}}}function wM(a,r){ki.X(a,r);var o=eo;if(o&&a){var u=On(o).hoistableScripts,p=no(a),g=u.get(p);g||(g=o.querySelector(kl(p)),g||(a=v({src:a,async:!0},r),(r=Ma.get(p))&&Fm(a,r),g=o.createElement("script"),ft(g),wn(g,"link",a),o.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},u.set(p,g))}}function DM(a,r){ki.M(a,r);var o=eo;if(o&&a){var u=On(o).hoistableScripts,p=no(a),g=u.get(p);g||(g=o.querySelector(kl(p)),g||(a=v({src:a,async:!0,type:"module"},r),(r=Ma.get(p))&&Fm(a,r),g=o.createElement("script"),ft(g),wn(g,"link",a),o.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},u.set(p,g))}}function aS(a,r,o,u){var p=(p=Fe.current)?Qu(p):null;if(!p)throw Error(i(446));switch(a){case"meta":case"title":return null;case"style":return typeof o.precedence=="string"&&typeof o.href=="string"?(r=to(o.href),o=On(p).hoistableStyles,u=o.get(r),u||(u={type:"style",instance:null,count:0,state:null},o.set(r,u)),u):{type:"void",instance:null,count:0,state:null};case"link":if(o.rel==="stylesheet"&&typeof o.href=="string"&&typeof o.precedence=="string"){a=to(o.href);var g=On(p).hoistableStyles,x=g.get(a);if(x||(p=p.ownerDocument||p,x={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},g.set(a,x),(g=p.querySelector(jl(a)))&&!g._p&&(x.instance=g,x.state.loading=5),Ma.has(a)||(o={rel:"preload",as:"style",href:o.href,crossOrigin:o.crossOrigin,integrity:o.integrity,media:o.media,hrefLang:o.hrefLang,referrerPolicy:o.referrerPolicy},Ma.set(a,o),g||NM(p,a,o,x.state))),r&&u===null)throw Error(i(528,""));return x}if(r&&u!==null)throw Error(i(529,""));return null;case"script":return r=o.async,o=o.src,typeof o=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(r=no(o),o=On(p).hoistableScripts,u=o.get(r),u||(u={type:"script",instance:null,count:0,state:null},o.set(r,u)),u):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,a))}}function to(a){return'href="'+Sa(a)+'"'}function jl(a){return'link[rel="stylesheet"]['+a+"]"}function iS(a){return v({},a,{"data-precedence":a.precedence,precedence:null})}function NM(a,r,o,u){a.querySelector('link[rel="preload"][as="style"]['+r+"]")?u.loading=1:(r=a.createElement("link"),u.preload=r,r.addEventListener("load",function(){return u.loading|=1}),r.addEventListener("error",function(){return u.loading|=2}),wn(r,"link",o),ft(r),a.head.appendChild(r))}function no(a){return'[src="'+Sa(a)+'"]'}function kl(a){return"script[async]"+a}function rS(a,r,o){if(r.count++,r.instance===null)switch(r.type){case"style":var u=a.querySelector('style[data-href~="'+Sa(o.href)+'"]');if(u)return r.instance=u,ft(u),u;var p=v({},o,{"data-href":o.href,"data-precedence":o.precedence,href:null,precedence:null});return u=(a.ownerDocument||a).createElement("style"),ft(u),wn(u,"style",p),Zu(u,o.precedence,a),r.instance=u;case"stylesheet":p=to(o.href);var g=a.querySelector(jl(p));if(g)return r.state.loading|=4,r.instance=g,ft(g),g;u=iS(o),(p=Ma.get(p))&&Bm(u,p),g=(a.ownerDocument||a).createElement("link"),ft(g);var x=g;return x._p=new Promise(function(C,$){x.onload=C,x.onerror=$}),wn(g,"link",u),r.state.loading|=4,Zu(g,o.precedence,a),r.instance=g;case"script":return g=no(o.src),(p=a.querySelector(kl(g)))?(r.instance=p,ft(p),p):(u=o,(p=Ma.get(g))&&(u=v({},o),Fm(u,p)),a=a.ownerDocument||a,p=a.createElement("script"),ft(p),wn(p,"link",u),a.head.appendChild(p),r.instance=p);case"void":return null;default:throw Error(i(443,r.type))}else r.type==="stylesheet"&&(r.state.loading&4)===0&&(u=r.instance,r.state.loading|=4,Zu(u,o.precedence,a));return r.instance}function Zu(a,r,o){for(var u=o.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=u.length?u[u.length-1]:null,g=p,x=0;x<u.length;x++){var C=u[x];if(C.dataset.precedence===r)g=C;else if(g!==p)break}g?g.parentNode.insertBefore(a,g.nextSibling):(r=o.nodeType===9?o.head:o,r.insertBefore(a,r.firstChild))}function Bm(a,r){a.crossOrigin==null&&(a.crossOrigin=r.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=r.referrerPolicy),a.title==null&&(a.title=r.title)}function Fm(a,r){a.crossOrigin==null&&(a.crossOrigin=r.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=r.referrerPolicy),a.integrity==null&&(a.integrity=r.integrity)}var ed=null;function sS(a,r,o){if(ed===null){var u=new Map,p=ed=new Map;p.set(o,u)}else p=ed,u=p.get(o),u||(u=new Map,p.set(o,u));if(u.has(a))return u;for(u.set(a,null),o=o.getElementsByTagName(a),p=0;p<o.length;p++){var g=o[p];if(!(g[Ot]||g[me]||a==="link"&&g.getAttribute("rel")==="stylesheet")&&g.namespaceURI!=="http://www.w3.org/2000/svg"){var x=g.getAttribute(r)||"";x=a+x;var C=u.get(x);C?C.push(g):u.set(x,[g])}}return u}function oS(a,r,o){a=a.ownerDocument||a,a.head.insertBefore(o,r==="title"?a.querySelector("head > title"):null)}function CM(a,r,o){if(o===1||r.itemProp!=null)return!1;switch(a){case"meta":case"title":return!0;case"style":if(typeof r.precedence!="string"||typeof r.href!="string"||r.href==="")break;return!0;case"link":if(typeof r.rel!="string"||typeof r.href!="string"||r.href===""||r.onLoad||r.onError)break;switch(r.rel){case"stylesheet":return a=r.disabled,typeof r.precedence=="string"&&a==null;default:return!0}case"script":if(r.async&&typeof r.async!="function"&&typeof r.async!="symbol"&&!r.onLoad&&!r.onError&&r.src&&typeof r.src=="string")return!0}return!1}function lS(a){return!(a.type==="stylesheet"&&(a.state.loading&3)===0)}function EM(a,r,o,u){if(o.type==="stylesheet"&&(typeof u.media!="string"||matchMedia(u.media).matches!==!1)&&(o.state.loading&4)===0){if(o.instance===null){var p=to(u.href),g=r.querySelector(jl(p));if(g){r=g._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(a.count++,a=td.bind(a),r.then(a,a)),o.state.loading|=4,o.instance=g,ft(g);return}g=r.ownerDocument||r,u=iS(u),(p=Ma.get(p))&&Bm(u,p),g=g.createElement("link"),ft(g);var x=g;x._p=new Promise(function(C,$){x.onload=C,x.onerror=$}),wn(g,"link",u),o.instance=g}a.stylesheets===null&&(a.stylesheets=new Map),a.stylesheets.set(o,r),(r=o.state.preload)&&(o.state.loading&3)===0&&(a.count++,o=td.bind(a),r.addEventListener("load",o),r.addEventListener("error",o))}}var Hm=0;function AM(a,r){return a.stylesheets&&a.count===0&&ad(a,a.stylesheets),0<a.count||0<a.imgCount?function(o){var u=setTimeout(function(){if(a.stylesheets&&ad(a,a.stylesheets),a.unsuspend){var g=a.unsuspend;a.unsuspend=null,g()}},6e4+r);0<a.imgBytes&&Hm===0&&(Hm=62500*oM());var p=setTimeout(function(){if(a.waitingForImages=!1,a.count===0&&(a.stylesheets&&ad(a,a.stylesheets),a.unsuspend)){var g=a.unsuspend;a.unsuspend=null,g()}},(a.imgBytes>Hm?50:800)+r);return a.unsuspend=o,function(){a.unsuspend=null,clearTimeout(u),clearTimeout(p)}}:null}function td(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ad(this,this.stylesheets);else if(this.unsuspend){var a=this.unsuspend;this.unsuspend=null,a()}}}var nd=null;function ad(a,r){a.stylesheets=null,a.unsuspend!==null&&(a.count++,nd=new Map,r.forEach(MM,a),nd=null,td.call(a))}function MM(a,r){if(!(r.state.loading&4)){var o=nd.get(a);if(o)var u=o.get(null);else{o=new Map,nd.set(a,o);for(var p=a.querySelectorAll("link[data-precedence],style[data-precedence]"),g=0;g<p.length;g++){var x=p[g];(x.nodeName==="LINK"||x.getAttribute("media")!=="not all")&&(o.set(x.dataset.precedence,x),u=x)}u&&o.set(null,u)}p=r.instance,x=p.getAttribute("data-precedence"),g=o.get(x)||u,g===u&&o.set(null,p),o.set(x,p),this.count++,u=td.bind(this),p.addEventListener("load",u),p.addEventListener("error",u),g?g.parentNode.insertBefore(p,g.nextSibling):(a=a.nodeType===9?a.head:a,a.insertBefore(p,a.firstChild)),r.state.loading|=4}}var $l={$$typeof:j,Provider:null,Consumer:null,_currentValue:se,_currentValue2:se,_threadCount:0};function TM(a,r,o,u,p,g,x,C,$){this.tag=1,this.containerInfo=a,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=ws(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ws(0),this.hiddenUpdates=ws(null),this.identifierPrefix=u,this.onUncaughtError=p,this.onCaughtError=g,this.onRecoverableError=x,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=$,this.incompleteTransitions=new Map}function cS(a,r,o,u,p,g,x,C,$,V,ee,ne){return a=new TM(a,r,o,x,$,V,ee,ne,C),r=1,g===!0&&(r|=24),g=sa(3,null,null,r),a.current=g,g.stateNode=a,r=wh(),r.refCount++,a.pooledCache=r,r.refCount++,g.memoizedState={element:u,isDehydrated:o,cache:r},Eh(g),a}function uS(a){return a?(a=Os,a):Os}function dS(a,r,o,u,p,g){p=uS(p),u.context===null?u.context=p:u.pendingContext=p,u=Wi(r),u.payload={element:o},g=g===void 0?null:g,g!==null&&(u.callback=g),o=Qi(a,u,r),o!==null&&(Wn(o,a,r),ul(o,a,r))}function fS(a,r){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var o=a.retryLane;a.retryLane=o!==0&&o<r?o:r}}function qm(a,r){fS(a,r),(a=a.alternate)&&fS(a,r)}function hS(a){if(a.tag===13||a.tag===31){var r=Hr(a,67108864);r!==null&&Wn(r,a,67108864),qm(a,67108864)}}function mS(a){if(a.tag===13||a.tag===31){var r=da();r=re(r);var o=Hr(a,r);o!==null&&Wn(o,a,r),qm(a,r)}}var id=!0;function jM(a,r,o,u){var p=R.T;R.T=null;var g=W.p;try{W.p=2,Vm(a,r,o,u)}finally{W.p=g,R.T=p}}function kM(a,r,o,u){var p=R.T;R.T=null;var g=W.p;try{W.p=8,Vm(a,r,o,u)}finally{W.p=g,R.T=p}}function Vm(a,r,o,u){if(id){var p=Km(u);if(p===null)km(a,r,u,rd,o),gS(a,u);else if(OM(p,a,r,o,u))u.stopPropagation();else if(gS(a,u),r&4&&-1<$M.indexOf(a)){for(;p!==null;){var g=qn(p);if(g!==null)switch(g.tag){case 3:if(g=g.stateNode,g.current.memoizedState.isDehydrated){var x=Wa(g.pendingLanes);if(x!==0){var C=g;for(C.pendingLanes|=2,C.entangledLanes|=2;x;){var $=1<<31-Mn(x);C.entanglements[1]|=$,x&=~$}ti(g),(lt&6)===0&&(Bu=un()+500,El(0))}}break;case 31:case 13:C=Hr(g,2),C!==null&&Wn(C,g,2),Hu(),qm(g,2)}if(g=Km(u),g===null&&km(a,r,u,rd,o),g===p)break;p=g}p!==null&&u.stopPropagation()}else km(a,r,u,null,o)}}function Km(a){return a=Yf(a),Gm(a)}var rd=null;function Gm(a){if(rd=null,a=rt(a),a!==null){var r=l(a);if(r===null)a=null;else{var o=r.tag;if(o===13){if(a=c(r),a!==null)return a;a=null}else if(o===31){if(a=d(r),a!==null)return a;a=null}else if(o===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;a=null}else r!==a&&(a=null)}}return rd=a,null}function pS(a){switch(a){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(Xc()){case ys:return 2;case va:return 8;case Hn:case Wc:return 32;case Qc:return 268435456;default:return 32}default:return 32}}var Ym=!1,cr=null,ur=null,dr=null,Ol=new Map,Rl=new Map,fr=[],$M="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 gS(a,r){switch(a){case"focusin":case"focusout":cr=null;break;case"dragenter":case"dragleave":ur=null;break;case"mouseover":case"mouseout":dr=null;break;case"pointerover":case"pointerout":Ol.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":Rl.delete(r.pointerId)}}function Ll(a,r,o,u,p,g){return a===null||a.nativeEvent!==g?(a={blockedOn:r,domEventName:o,eventSystemFlags:u,nativeEvent:g,targetContainers:[p]},r!==null&&(r=qn(r),r!==null&&hS(r)),a):(a.eventSystemFlags|=u,r=a.targetContainers,p!==null&&r.indexOf(p)===-1&&r.push(p),a)}function OM(a,r,o,u,p){switch(r){case"focusin":return cr=Ll(cr,a,r,o,u,p),!0;case"dragenter":return ur=Ll(ur,a,r,o,u,p),!0;case"mouseover":return dr=Ll(dr,a,r,o,u,p),!0;case"pointerover":var g=p.pointerId;return Ol.set(g,Ll(Ol.get(g)||null,a,r,o,u,p)),!0;case"gotpointercapture":return g=p.pointerId,Rl.set(g,Ll(Rl.get(g)||null,a,r,o,u,p)),!0}return!1}function yS(a){var r=rt(a.target);if(r!==null){var o=l(r);if(o!==null){if(r=o.tag,r===13){if(r=c(o),r!==null){a.blockedOn=r,Ae(a.priority,function(){mS(o)});return}}else if(r===31){if(r=d(o),r!==null){a.blockedOn=r,Ae(a.priority,function(){mS(o)});return}}else if(r===3&&o.stateNode.current.memoizedState.isDehydrated){a.blockedOn=o.tag===3?o.stateNode.containerInfo:null;return}}}a.blockedOn=null}function sd(a){if(a.blockedOn!==null)return!1;for(var r=a.targetContainers;0<r.length;){var o=Km(a.nativeEvent);if(o===null){o=a.nativeEvent;var u=new o.constructor(o.type,o);Gf=u,o.target.dispatchEvent(u),Gf=null}else return r=qn(o),r!==null&&hS(r),a.blockedOn=o,!1;r.shift()}return!0}function vS(a,r,o){sd(a)&&o.delete(r)}function RM(){Ym=!1,cr!==null&&sd(cr)&&(cr=null),ur!==null&&sd(ur)&&(ur=null),dr!==null&&sd(dr)&&(dr=null),Ol.forEach(vS),Rl.forEach(vS)}function od(a,r){a.blockedOn===r&&(a.blockedOn=null,Ym||(Ym=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,RM)))}var ld=null;function bS(a){ld!==a&&(ld=a,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){ld===a&&(ld=null);for(var r=0;r<a.length;r+=3){var o=a[r],u=a[r+1],p=a[r+2];if(typeof u!="function"){if(Gm(u||o)===null)continue;break}var g=qn(o);g!==null&&(a.splice(r,3),r-=3,Kh(g,{pending:!0,data:p,method:o.method,action:u},u,p))}}))}function ao(a){function r($){return od($,a)}cr!==null&&od(cr,a),ur!==null&&od(ur,a),dr!==null&&od(dr,a),Ol.forEach(r),Rl.forEach(r);for(var o=0;o<fr.length;o++){var u=fr[o];u.blockedOn===a&&(u.blockedOn=null)}for(;0<fr.length&&(o=fr[0],o.blockedOn===null);)yS(o),o.blockedOn===null&&fr.shift();if(o=(a.ownerDocument||a).$$reactFormReplay,o!=null)for(u=0;u<o.length;u+=3){var p=o[u],g=o[u+1],x=p[be]||null;if(typeof g=="function")x||bS(o);else if(x){var C=null;if(g&&g.hasAttribute("formAction")){if(p=g,x=g[be]||null)C=x.formAction;else if(Gm(p)!==null)continue}else C=x.action;typeof C=="function"?o[u+1]=C:(o.splice(u,3),u-=3),bS(o)}}}function SS(){function a(g){g.canIntercept&&g.info==="react-transition"&&g.intercept({handler:function(){return new Promise(function(x){return p=x})},focusReset:"manual",scroll:"manual"})}function r(){p!==null&&(p(),p=null),u||setTimeout(o,20)}function o(){if(!u&&!navigation.transition){var g=navigation.currentEntry;g&&g.url!=null&&navigation.navigate(g.url,{state:g.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var u=!1,p=null;return navigation.addEventListener("navigate",a),navigation.addEventListener("navigatesuccess",r),navigation.addEventListener("navigateerror",r),setTimeout(o,100),function(){u=!0,navigation.removeEventListener("navigate",a),navigation.removeEventListener("navigatesuccess",r),navigation.removeEventListener("navigateerror",r),p!==null&&(p(),p=null)}}}function Jm(a){this._internalRoot=a}cd.prototype.render=Jm.prototype.render=function(a){var r=this._internalRoot;if(r===null)throw Error(i(409));var o=r.current,u=da();dS(o,u,a,r,null,null)},cd.prototype.unmount=Jm.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var r=a.containerInfo;dS(a.current,2,null,a,null,null),Hu(),r[De]=null}};function cd(a){this._internalRoot=a}cd.prototype.unstable_scheduleHydration=function(a){if(a){var r=Ee();a={blockedOn:null,target:a,priority:r};for(var o=0;o<fr.length&&r!==0&&r<fr[o].priority;o++);fr.splice(o,0,a),o===0&&yS(a)}};var xS=t.version;if(xS!=="19.2.0")throw Error(i(527,xS,"19.2.0"));W.findDOMNode=function(a){var r=a._reactInternals;if(r===void 0)throw typeof a.render=="function"?Error(i(188)):(a=Object.keys(a).join(","),Error(i(268,a)));return a=m(r),a=a!==null?y(a):null,a=a===null?null:a.stateNode,a};var LM={bundleType:0,version:"19.2.0",rendererPackageName:"react-dom",currentDispatcherRef:R,reconcilerVersion:"19.2.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ud=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ud.isDisabled&&ud.supportsFiber)try{$n=ud.inject(LM),An=ud}catch{}}return Bl.createRoot=function(a,r){if(!s(a))throw Error(i(299));var o=!1,u="",p=Mb,g=Tb,x=jb;return r!=null&&(r.unstable_strictMode===!0&&(o=!0),r.identifierPrefix!==void 0&&(u=r.identifierPrefix),r.onUncaughtError!==void 0&&(p=r.onUncaughtError),r.onCaughtError!==void 0&&(g=r.onCaughtError),r.onRecoverableError!==void 0&&(x=r.onRecoverableError)),r=cS(a,1,!1,null,null,o,u,null,p,g,x,SS),a[De]=r.current,jm(a),new Jm(r)},Bl.hydrateRoot=function(a,r,o){if(!s(a))throw Error(i(299));var u=!1,p="",g=Mb,x=Tb,C=jb,$=null;return o!=null&&(o.unstable_strictMode===!0&&(u=!0),o.identifierPrefix!==void 0&&(p=o.identifierPrefix),o.onUncaughtError!==void 0&&(g=o.onUncaughtError),o.onCaughtError!==void 0&&(x=o.onCaughtError),o.onRecoverableError!==void 0&&(C=o.onRecoverableError),o.formState!==void 0&&($=o.formState)),r=cS(a,1,!0,r,o??null,u,p,$,g,x,C,SS),r.context=uS(null),o=r.current,u=da(),u=re(u),p=Wi(u),p.callback=null,Qi(o,p,u),o=u,r.current.lanes=o,_r(r,o),ti(r),a[De]=r.current,jm(a),new cd(r)},Bl.version="19.2.0",Bl}var YS;function Dk(){if(YS)return fp.exports;YS=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(),fp.exports=wk(),fp.exports}var Nk=Dk();const Ck=Zw(Nk),Pe=e=>typeof e=="string",Fl=()=>{let e,t;const n=new Promise((i,s)=>{e=i,t=s});return n.resolve=e,n.reject=t,n},JS=e=>e==null?"":""+e,Ek=(e,t,n)=>{e.forEach(i=>{t[i]&&(n[i]=t[i])})},Ak=/###/g,XS=e=>e&&e.indexOf("###")>-1?e.replace(Ak,"."):e,WS=e=>!e||Pe(e),uc=(e,t,n)=>{const i=Pe(t)?t.split("."):t;let s=0;for(;s<i.length-1;){if(WS(e))return{};const l=XS(i[s]);!e[l]&&n&&(e[l]=new n),Object.prototype.hasOwnProperty.call(e,l)?e=e[l]:e={},++s}return WS(e)?{}:{obj:e,k:XS(i[s])}},QS=(e,t,n)=>{const{obj:i,k:s}=uc(e,t,Object);if(i!==void 0||t.length===1){i[s]=n;return}let l=t[t.length-1],c=t.slice(0,t.length-1),d=uc(e,c,Object);for(;d.obj===void 0&&c.length;)l=`${c[c.length-1]}.${l}`,c=c.slice(0,c.length-1),d=uc(e,c,Object),d?.obj&&typeof d.obj[`${d.k}.${l}`]<"u"&&(d.obj=void 0);d.obj[`${d.k}.${l}`]=n},Mk=(e,t,n,i)=>{const{obj:s,k:l}=uc(e,t,Object);s[l]=s[l]||[],s[l].push(n)},Vd=(e,t)=>{const{obj:n,k:i}=uc(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,i))return n[i]},Tk=(e,t,n)=>{const i=Vd(e,n);return i!==void 0?i:Vd(t,n)},FD=(e,t,n)=>{for(const i in t)i!=="__proto__"&&i!=="constructor"&&(i in e?Pe(e[i])||e[i]instanceof String||Pe(t[i])||t[i]instanceof String?n&&(e[i]=t[i]):FD(e[i],t[i],n):e[i]=t[i]);return e},oo=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var jk={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const kk=e=>Pe(e)?e.replace(/[&<>"'\/]/g,t=>jk[t]):e;class $k{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 i=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,i),this.regExpQueue.push(t),i}}const Ok=[" ",",","?","!",";"],Rk=new $k(20),Lk=(e,t,n)=>{t=t||"",n=n||"";const i=Ok.filter(c=>t.indexOf(c)<0&&n.indexOf(c)<0);if(i.length===0)return!0;const s=Rk.getRegExp(`(${i.map(c=>c==="?"?"\\?":c).join("|")})`);let l=!s.test(e);if(!l){const c=e.indexOf(n);c>0&&!s.test(e.substring(0,c))&&(l=!0)}return l},Vp=(e,t,n=".")=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;const i=t.split(n);let s=e;for(let l=0;l<i.length;){if(!s||typeof s!="object")return;let c,d="";for(let h=l;h<i.length;++h)if(h!==l&&(d+=n),d+=i[h],c=s[d],c!==void 0){if(["string","number","boolean"].indexOf(typeof c)>-1&&h<i.length-1)continue;l+=h-l+1;break}s=c}return s},vc=e=>e?.replace("_","-"),Pk={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 Kd{constructor(t,n={}){this.init(t,n)}init(t,n={}){this.prefix=n.prefix||"i18next:",this.logger=t||Pk,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,i,s){return s&&!this.debug?null:(Pe(t[0])&&(t[0]=`${i}${this.prefix} ${t[0]}`),this.logger[n](t))}create(t){return new Kd(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new Kd(this.logger,t)}}var ai=new Kd;class vf{constructor(){this.observers={}}on(t,n){return t.split(" ").forEach(i=>{this.observers[i]||(this.observers[i]=new Map);const s=this.observers[i].get(n)||0;this.observers[i].set(n,s+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(([s,l])=>{for(let c=0;c<l;c++)s(...n)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([s,l])=>{for(let c=0;c<l;c++)s.apply(s,[t,...n])})}}class ZS extends vf{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,i,s={}){const l=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,c=s.ignoreJSONStructure!==void 0?s.ignoreJSONStructure:this.options.ignoreJSONStructure;let d;t.indexOf(".")>-1?d=t.split("."):(d=[t,n],i&&(Array.isArray(i)?d.push(...i):Pe(i)&&l?d.push(...i.split(l)):d.push(i)));const h=Vd(this.data,d);return!h&&!n&&!i&&t.indexOf(".")>-1&&(t=d[0],n=d[1],i=d.slice(2).join(".")),h||!c||!Pe(i)?h:Vp(this.data?.[t]?.[n],i,l)}addResource(t,n,i,s,l={silent:!1}){const c=l.keySeparator!==void 0?l.keySeparator:this.options.keySeparator;let d=[t,n];i&&(d=d.concat(c?i.split(c):i)),t.indexOf(".")>-1&&(d=t.split("."),s=n,n=d[1]),this.addNamespaces(n),QS(this.data,d,s),l.silent||this.emit("added",t,n,i,s)}addResources(t,n,i,s={silent:!1}){for(const l in i)(Pe(i[l])||Array.isArray(i[l]))&&this.addResource(t,n,l,i[l],{silent:!0});s.silent||this.emit("added",t,n,i)}addResourceBundle(t,n,i,s,l,c={silent:!1,skipCopy:!1}){let d=[t,n];t.indexOf(".")>-1&&(d=t.split("."),s=i,i=n,n=d[1]),this.addNamespaces(n);let h=Vd(this.data,d)||{};c.skipCopy||(i=JSON.parse(JSON.stringify(i))),s?FD(h,i,l):h={...h,...i},QS(this.data,d,h),c.silent||this.emit("added",t,n,i)}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(s=>n[s]&&Object.keys(n[s]).length>0)}toJSON(){return this.data}}var HD={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,i,s){return e.forEach(l=>{t=this.processors[l]?.process(t,n,i,s)??t}),t}};const qD=Symbol("i18next/PATH_KEY");function Ik(){const e=[],t=Object.create(null);let n;return t.get=(i,s)=>(n?.revoke?.(),s===qD?e:(e.push(s),n=Proxy.revocable(i,t),n.proxy)),Proxy.revocable(Object.create(null),t).proxy}function Kp(e,t){const{[qD]:n}=e(Ik());return n.join(t?.keySeparator??".")}const ex={},pp=e=>!Pe(e)&&typeof e!="boolean"&&typeof e!="number";class Gd extends vf{constructor(t,n={}){super(),Ek(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=ai.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t,n={interpolation:{}}){const i={...n};if(t==null)return!1;const s=this.resolve(t,i);if(s?.res===void 0)return!1;const l=pp(s.res);return!(i.returnObjects===!1&&l)}extractFromKey(t,n){let i=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;i===void 0&&(i=":");const s=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let l=n.ns||this.options.defaultNS||[];const c=i&&t.indexOf(i)>-1,d=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!Lk(t,i,s);if(c&&!d){const h=t.match(this.interpolator.nestingRegexp);if(h&&h.length>0)return{key:t,namespaces:Pe(l)?[l]:l};const m=t.split(i);(i!==s||i===s&&this.options.ns.indexOf(m[0])>-1)&&(l=m.shift()),t=m.join(s)}return{key:t,namespaces:Pe(l)?[l]:l}}translate(t,n,i){let s=typeof n=="object"?{...n}:n;if(typeof s!="object"&&this.options.overloadTranslationOptionHandler&&(s=this.options.overloadTranslationOptionHandler(arguments)),typeof s=="object"&&(s={...s}),s||(s={}),t==null)return"";typeof t=="function"&&(t=Kp(t,{...this.options,...s})),Array.isArray(t)||(t=[String(t)]);const l=s.returnDetails!==void 0?s.returnDetails:this.options.returnDetails,c=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,{key:d,namespaces:h}=this.extractFromKey(t[t.length-1],s),m=h[h.length-1];let y=s.nsSeparator!==void 0?s.nsSeparator:this.options.nsSeparator;y===void 0&&(y=":");const v=s.lng||this.language,b=s.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(v?.toLowerCase()==="cimode")return b?l?{res:`${m}${y}${d}`,usedKey:d,exactUsedKey:d,usedLng:v,usedNS:m,usedParams:this.getUsedParamsDetails(s)}:`${m}${y}${d}`:l?{res:d,usedKey:d,exactUsedKey:d,usedLng:v,usedNS:m,usedParams:this.getUsedParamsDetails(s)}:d;const D=this.resolve(t,s);let w=D?.res;const N=D?.usedKey||d,M=D?.exactUsedKey||d,A=["[object Number]","[object Function]","[object RegExp]"],T=s.joinArrays!==void 0?s.joinArrays:this.options.joinArrays,j=!this.i18nFormat||this.i18nFormat.handleAsObject,F=s.count!==void 0&&!Pe(s.count),z=Gd.hasDefaultValue(s),P=F?this.pluralResolver.getSuffix(v,s.count,s):"",E=s.ordinal&&F?this.pluralResolver.getSuffix(v,s.count,{ordinal:!1}):"",L=F&&!s.ordinal&&s.count===0,_=L&&s[`defaultValue${this.options.pluralSeparator}zero`]||s[`defaultValue${P}`]||s[`defaultValue${E}`]||s.defaultValue;let Y=w;j&&!w&&z&&(Y=_);const Z=pp(Y),U=Object.prototype.toString.apply(Y);if(j&&Y&&Z&&A.indexOf(U)<0&&!(Pe(T)&&Array.isArray(Y))){if(!s.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const ae=this.options.returnedObjectHandler?this.options.returnedObjectHandler(N,Y,{...s,ns:h}):`key '${d} (${this.language})' returned an object instead of string.`;return l?(D.res=ae,D.usedParams=this.getUsedParamsDetails(s),D):ae}if(c){const ae=Array.isArray(Y),Q=ae?[]:{},ie=ae?M:N;for(const R in Y)if(Object.prototype.hasOwnProperty.call(Y,R)){const W=`${ie}${c}${R}`;z&&!w?Q[R]=this.translate(W,{...s,defaultValue:pp(_)?_[R]:void 0,joinArrays:!1,ns:h}):Q[R]=this.translate(W,{...s,joinArrays:!1,ns:h}),Q[R]===W&&(Q[R]=Y[R])}w=Q}}else if(j&&Pe(T)&&Array.isArray(w))w=w.join(T),w&&(w=this.extendTranslation(w,t,s,i));else{let ae=!1,Q=!1;!this.isValidLookup(w)&&z&&(ae=!0,w=_),this.isValidLookup(w)||(Q=!0,w=d);const R=(s.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&Q?void 0:w,W=z&&_!==w&&this.options.updateMissing;if(Q||ae||W){if(this.logger.log(W?"updateKey":"missingKey",v,m,d,W?_:w),c){const k=this.resolve(d,{...s,keySeparator:!1});k&&k.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 se=[];const ye=this.languageUtils.getFallbackCodes(this.options.fallbackLng,s.lng||this.language);if(this.options.saveMissingTo==="fallback"&&ye&&ye[0])for(let k=0;k<ye.length;k++)se.push(ye[k]);else this.options.saveMissingTo==="all"?se=this.languageUtils.toResolveHierarchy(s.lng||this.language):se.push(s.lng||this.language);const ke=(k,J,oe)=>{const ce=z&&oe!==w?oe:R;this.options.missingKeyHandler?this.options.missingKeyHandler(k,m,J,ce,W,s):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(k,m,J,ce,W,s),this.emit("missingKey",k,m,J,w)};this.options.saveMissing&&(this.options.saveMissingPlurals&&F?se.forEach(k=>{const J=this.pluralResolver.getSuffixes(k,s);L&&s[`defaultValue${this.options.pluralSeparator}zero`]&&J.indexOf(`${this.options.pluralSeparator}zero`)<0&&J.push(`${this.options.pluralSeparator}zero`),J.forEach(oe=>{ke([k],d+oe,s[`defaultValue${oe}`]||_)})}):ke(se,d,_))}w=this.extendTranslation(w,t,s,D,i),Q&&w===d&&this.options.appendNamespaceToMissingKey&&(w=`${m}${y}${d}`),(Q||ae)&&this.options.parseMissingKeyHandler&&(w=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${m}${y}${d}`:d,ae?w:void 0,s))}return l?(D.res=w,D.usedParams=this.getUsedParamsDetails(s),D):w}extendTranslation(t,n,i,s,l){if(this.i18nFormat?.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...i},i.lng||this.language||s.usedLng,s.usedNS,s.usedKey,{resolved:s});else if(!i.skipInterpolation){i.interpolation&&this.interpolator.init({...i,interpolation:{...this.options.interpolation,...i.interpolation}});const h=Pe(t)&&(i?.interpolation?.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let m;if(h){const v=t.match(this.interpolator.nestingRegexp);m=v&&v.length}let y=i.replace&&!Pe(i.replace)?i.replace:i;if(this.options.interpolation.defaultVariables&&(y={...this.options.interpolation.defaultVariables,...y}),t=this.interpolator.interpolate(t,y,i.lng||this.language||s.usedLng,i),h){const v=t.match(this.interpolator.nestingRegexp),b=v&&v.length;m<b&&(i.nest=!1)}!i.lng&&s&&s.res&&(i.lng=this.language||s.usedLng),i.nest!==!1&&(t=this.interpolator.nest(t,(...v)=>l?.[0]===v[0]&&!i.context?(this.logger.warn(`It seems you are nesting recursively key: ${v[0]} in key: ${n[0]}`),null):this.translate(...v,n),i)),i.interpolation&&this.interpolator.reset()}const c=i.postProcess||this.options.postProcess,d=Pe(c)?[c]:c;return t!=null&&d?.length&&i.applyPostProcessor!==!1&&(t=HD.handle(d,t,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...s,usedParams:this.getUsedParamsDetails(i)},...i}:i,this)),t}resolve(t,n={}){let i,s,l,c,d;return Pe(t)&&(t=[t]),t.forEach(h=>{if(this.isValidLookup(i))return;const m=this.extractFromKey(h,n),y=m.key;s=y;let v=m.namespaces;this.options.fallbackNS&&(v=v.concat(this.options.fallbackNS));const b=n.count!==void 0&&!Pe(n.count),D=b&&!n.ordinal&&n.count===0,w=n.context!==void 0&&(Pe(n.context)||typeof n.context=="number")&&n.context!=="",N=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);v.forEach(M=>{this.isValidLookup(i)||(d=M,!ex[`${N[0]}-${M}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(d)&&(ex[`${N[0]}-${M}`]=!0,this.logger.warn(`key "${s}" for languages "${N.join(", ")}" won't get resolved as namespace "${d}" 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!!!")),N.forEach(A=>{if(this.isValidLookup(i))return;c=A;const T=[y];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(T,y,A,M,n);else{let F;b&&(F=this.pluralResolver.getSuffix(A,n.count,n));const z=`${this.options.pluralSeparator}zero`,P=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(b&&(n.ordinal&&F.indexOf(P)===0&&T.push(y+F.replace(P,this.options.pluralSeparator)),T.push(y+F),D&&T.push(y+z)),w){const E=`${y}${this.options.contextSeparator||"_"}${n.context}`;T.push(E),b&&(n.ordinal&&F.indexOf(P)===0&&T.push(E+F.replace(P,this.options.pluralSeparator)),T.push(E+F),D&&T.push(E+z))}}let j;for(;j=T.pop();)this.isValidLookup(i)||(l=j,i=this.getResource(A,M,j,n))}))})}),{res:i,usedKey:s,exactUsedKey:l,usedLng:c,usedNS:d}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,n,i,s={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(t,n,i,s):this.resourceStore.getResource(t,n,i,s)}getUsedParamsDetails(t={}){const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],i=t.replace&&!Pe(t.replace);let s=i?t.replace:t;if(i&&typeof t.count<"u"&&(s.count=t.count),this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),!i){s={...s};for(const l of n)delete s[l]}return s}static hasDefaultValue(t){const n="defaultValue";for(const i in t)if(Object.prototype.hasOwnProperty.call(t,i)&&n===i.substring(0,n.length)&&t[i]!==void 0)return!0;return!1}}class tx{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=ai.create("languageUtils")}getScriptPartFromCode(t){if(t=vc(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=vc(t),!t||t.indexOf("-")<0)return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(Pe(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(i=>{if(n)return;const s=this.formatLanguageCode(i);(!this.options.supportedLngs||this.isSupportedCode(s))&&(n=s)}),!n&&this.options.supportedLngs&&t.forEach(i=>{if(n)return;const s=this.getScriptPartFromCode(i);if(this.isSupportedCode(s))return n=s;const l=this.getLanguagePartFromCode(i);if(this.isSupportedCode(l))return n=l;n=this.options.supportedLngs.find(c=>{if(c===l)return c;if(!(c.indexOf("-")<0&&l.indexOf("-")<0)&&(c.indexOf("-")>0&&l.indexOf("-")<0&&c.substring(0,c.indexOf("-"))===l||c.indexOf(l)===0&&l.length>1))return c})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(t,n){if(!t)return[];if(typeof t=="function"&&(t=t(n)),Pe(t)&&(t=[t]),Array.isArray(t))return t;if(!n)return t.default||[];let i=t[n];return i||(i=t[this.getScriptPartFromCode(n)]),i||(i=t[this.formatLanguageCode(n)]),i||(i=t[this.getLanguagePartFromCode(n)]),i||(i=t.default),i||[]}toResolveHierarchy(t,n){const i=this.getFallbackCodes((n===!1?[]:n)||this.options.fallbackLng||[],t),s=[],l=c=>{c&&(this.isSupportedCode(c)?s.push(c):this.logger.warn(`rejecting language code not found in supportedLngs: ${c}`))};return Pe(t)&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&l(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&l(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&l(this.getLanguagePartFromCode(t))):Pe(t)&&l(this.formatLanguageCode(t)),i.forEach(c=>{s.indexOf(c)<0&&l(this.formatLanguageCode(c))}),s}}const nx={zero:0,one:1,two:2,few:3,many:4,other:5},ax={select:e=>e===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class zk{constructor(t,n={}){this.languageUtils=t,this.options=n,this.logger=ai.create("pluralResolver"),this.pluralRulesCache={}}addRule(t,n){this.rules[t]=n}clearCache(){this.pluralRulesCache={}}getRule(t,n={}){const i=vc(t==="dev"?"en":t),s=n.ordinal?"ordinal":"cardinal",l=JSON.stringify({cleanedCode:i,type:s});if(l in this.pluralRulesCache)return this.pluralRulesCache[l];let c;try{c=new Intl.PluralRules(i,{type:s})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),ax;if(!t.match(/-|_/))return ax;const h=this.languageUtils.getLanguagePartFromCode(t);c=this.getRule(h,n)}return this.pluralRulesCache[l]=c,c}needsPlural(t,n={}){let i=this.getRule(t,n);return i||(i=this.getRule("dev",n)),i?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(t,n,i={}){return this.getSuffixes(t,i).map(s=>`${n}${s}`)}getSuffixes(t,n={}){let i=this.getRule(t,n);return i||(i=this.getRule("dev",n)),i?i.resolvedOptions().pluralCategories.sort((s,l)=>nx[s]-nx[l]).map(s=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${s}`):[]}getSuffix(t,n,i={}){const s=this.getRule(t,i);return s?`${this.options.prepend}${i.ordinal?`ordinal${this.options.prepend}`:""}${s.select(n)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",n,i))}}const ix=(e,t,n,i=".",s=!0)=>{let l=Tk(e,t,n);return!l&&s&&Pe(n)&&(l=Vp(e,n,i),l===void 0&&(l=Vp(t,n,i))),l},gp=e=>e.replace(/\$/g,"$$$$");class _k{constructor(t={}){this.logger=ai.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:i,useRawValueToEscape:s,prefix:l,prefixEscaped:c,suffix:d,suffixEscaped:h,formatSeparator:m,unescapeSuffix:y,unescapePrefix:v,nestingPrefix:b,nestingPrefixEscaped:D,nestingSuffix:w,nestingSuffixEscaped:N,nestingOptionsSeparator:M,maxReplaces:A,alwaysFormat:T}=t.interpolation;this.escape=n!==void 0?n:kk,this.escapeValue=i!==void 0?i:!0,this.useRawValueToEscape=s!==void 0?s:!1,this.prefix=l?oo(l):c||"{{",this.suffix=d?oo(d):h||"}}",this.formatSeparator=m||",",this.unescapePrefix=y?"":v||"-",this.unescapeSuffix=this.unescapePrefix?"":y||"",this.nestingPrefix=b?oo(b):D||oo("$t("),this.nestingSuffix=w?oo(w):N||oo(")"),this.nestingOptionsSeparator=M||",",this.maxReplaces=A||1e3,this.alwaysFormat=T!==void 0?T:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(n,i)=>n?.source===i?(n.lastIndex=0,n):new RegExp(i,"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,i,s){let l,c,d;const h=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},m=D=>{if(D.indexOf(this.formatSeparator)<0){const A=ix(n,h,D,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(A,void 0,i,{...s,...n,interpolationkey:D}):A}const w=D.split(this.formatSeparator),N=w.shift().trim(),M=w.join(this.formatSeparator).trim();return this.format(ix(n,h,N,this.options.keySeparator,this.options.ignoreJSONStructure),M,i,{...s,...n,interpolationkey:N})};this.resetRegExp();const y=s?.missingInterpolationHandler||this.options.missingInterpolationHandler,v=s?.interpolation?.skipOnVariables!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:D=>gp(D)},{regex:this.regexp,safeValue:D=>this.escapeValue?gp(this.escape(D)):gp(D)}].forEach(D=>{for(d=0;l=D.regex.exec(t);){const w=l[1].trim();if(c=m(w),c===void 0)if(typeof y=="function"){const M=y(t,l,s);c=Pe(M)?M:""}else if(s&&Object.prototype.hasOwnProperty.call(s,w))c="";else if(v){c=l[0];continue}else this.logger.warn(`missed to pass in variable ${w} for interpolating ${t}`),c="";else!Pe(c)&&!this.useRawValueToEscape&&(c=JS(c));const N=D.safeValue(c);if(t=t.replace(l[0],N),v?(D.regex.lastIndex+=c.length,D.regex.lastIndex-=l[0].length):D.regex.lastIndex=0,d++,d>=this.maxReplaces)break}}),t}nest(t,n,i={}){let s,l,c;const d=(h,m)=>{const y=this.nestingOptionsSeparator;if(h.indexOf(y)<0)return h;const v=h.split(new RegExp(`${y}[ ]*{`));let b=`{${v[1]}`;h=v[0],b=this.interpolate(b,c);const D=b.match(/'/g),w=b.match(/"/g);((D?.length??0)%2===0&&!w||w.length%2!==0)&&(b=b.replace(/'/g,'"'));try{c=JSON.parse(b),m&&(c={...m,...c})}catch(N){return this.logger.warn(`failed parsing options string in nesting for key ${h}`,N),`${h}${y}${b}`}return c.defaultValue&&c.defaultValue.indexOf(this.prefix)>-1&&delete c.defaultValue,h};for(;s=this.nestingRegexp.exec(t);){let h=[];c={...i},c=c.replace&&!Pe(c.replace)?c.replace:c,c.applyPostProcessor=!1,delete c.defaultValue;const m=/{.*}/.test(s[1])?s[1].lastIndexOf("}")+1:s[1].indexOf(this.formatSeparator);if(m!==-1&&(h=s[1].slice(m).split(this.formatSeparator).map(y=>y.trim()).filter(Boolean),s[1]=s[1].slice(0,m)),l=n(d.call(this,s[1].trim(),c),c),l&&s[0]===t&&!Pe(l))return l;Pe(l)||(l=JS(l)),l||(this.logger.warn(`missed to resolve ${s[1]} for nesting ${t}`),l=""),h.length&&(l=h.reduce((y,v)=>this.format(y,v,i.lng,{...i,interpolationkey:s[1].trim()}),l.trim())),t=t.replace(s[0],l),this.regexp.lastIndex=0}return t}}const Uk=e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const i=e.split("(");t=i[0].toLowerCase().trim();const s=i[1].substring(0,i[1].length-1);t==="currency"&&s.indexOf(":")<0?n.currency||(n.currency=s.trim()):t==="relativetime"&&s.indexOf(":")<0?n.range||(n.range=s.trim()):s.split(";").forEach(c=>{if(c){const[d,...h]=c.split(":"),m=h.join(":").trim().replace(/^'+|'+$/g,""),y=d.trim();n[y]||(n[y]=m),m==="false"&&(n[y]=!1),m==="true"&&(n[y]=!0),isNaN(m)||(n[y]=parseInt(m,10))}})}return{formatName:t,formatOptions:n}},rx=e=>{const t={};return(n,i,s)=>{let l=s;s&&s.interpolationkey&&s.formatParams&&s.formatParams[s.interpolationkey]&&s[s.interpolationkey]&&(l={...l,[s.interpolationkey]:void 0});const c=i+JSON.stringify(l);let d=t[c];return d||(d=e(vc(i),s),t[c]=d),d(n)}},Bk=e=>(t,n,i)=>e(vc(n),i)(t);class Fk{constructor(t={}){this.logger=ai.create("formatter"),this.options=t,this.init(t)}init(t,n={interpolation:{}}){this.formatSeparator=n.interpolation.formatSeparator||",";const i=n.cacheInBuiltFormats?rx:Bk;this.formats={number:i((s,l)=>{const c=new Intl.NumberFormat(s,{...l});return d=>c.format(d)}),currency:i((s,l)=>{const c=new Intl.NumberFormat(s,{...l,style:"currency"});return d=>c.format(d)}),datetime:i((s,l)=>{const c=new Intl.DateTimeFormat(s,{...l});return d=>c.format(d)}),relativetime:i((s,l)=>{const c=new Intl.RelativeTimeFormat(s,{...l});return d=>c.format(d,l.range||"day")}),list:i((s,l)=>{const c=new Intl.ListFormat(s,{...l});return d=>c.format(d)})}}add(t,n){this.formats[t.toLowerCase().trim()]=n}addCached(t,n){this.formats[t.toLowerCase().trim()]=rx(n)}format(t,n,i,s={}){const l=n.split(this.formatSeparator);if(l.length>1&&l[0].indexOf("(")>1&&l[0].indexOf(")")<0&&l.find(d=>d.indexOf(")")>-1)){const d=l.findIndex(h=>h.indexOf(")")>-1);l[0]=[l[0],...l.splice(1,d)].join(this.formatSeparator)}return l.reduce((d,h)=>{const{formatName:m,formatOptions:y}=Uk(h);if(this.formats[m]){let v=d;try{const b=s?.formatParams?.[s.interpolationkey]||{},D=b.locale||b.lng||s.locale||s.lng||i;v=this.formats[m](d,D,{...y,...s,...b})}catch(b){this.logger.warn(b)}return v}else this.logger.warn(`there was no format function for ${m}`);return d},t)}}const Hk=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class qk extends vf{constructor(t,n,i,s={}){super(),this.backend=t,this.store=n,this.services=i,this.languageUtils=i.languageUtils,this.options=s,this.logger=ai.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=s.maxParallelReads||10,this.readingCalls=0,this.maxRetries=s.maxRetries>=0?s.maxRetries:5,this.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(i,s.backend,s)}queueLoad(t,n,i,s){const l={},c={},d={},h={};return t.forEach(m=>{let y=!0;n.forEach(v=>{const b=`${m}|${v}`;!i.reload&&this.store.hasResourceBundle(m,v)?this.state[b]=2:this.state[b]<0||(this.state[b]===1?c[b]===void 0&&(c[b]=!0):(this.state[b]=1,y=!1,c[b]===void 0&&(c[b]=!0),l[b]===void 0&&(l[b]=!0),h[v]===void 0&&(h[v]=!0)))}),y||(d[m]=!0)}),(Object.keys(l).length||Object.keys(c).length)&&this.queue.push({pending:c,pendingCount:Object.keys(c).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(l),pending:Object.keys(c),toLoadLanguages:Object.keys(d),toLoadNamespaces:Object.keys(h)}}loaded(t,n,i){const s=t.split("|"),l=s[0],c=s[1];n&&this.emit("failedLoading",l,c,n),!n&&i&&this.store.addResourceBundle(l,c,i,void 0,void 0,{skipCopy:!0}),this.state[t]=n?-1:2,n&&i&&(this.state[t]=0);const d={};this.queue.forEach(h=>{Mk(h.loaded,[l],c),Hk(h,t),n&&h.errors.push(n),h.pendingCount===0&&!h.done&&(Object.keys(h.loaded).forEach(m=>{d[m]||(d[m]={});const y=h.loaded[m];y.length&&y.forEach(v=>{d[m][v]===void 0&&(d[m][v]=!0)})}),h.done=!0,h.errors.length?h.callback(h.errors):h.callback())}),this.emit("loaded",d),this.queue=this.queue.filter(h=>!h.done)}read(t,n,i,s=0,l=this.retryTimeout,c){if(!t.length)return c(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:i,tried:s,wait:l,callback:c});return}this.readingCalls++;const d=(m,y)=>{if(this.readingCalls--,this.waitingReads.length>0){const v=this.waitingReads.shift();this.read(v.lng,v.ns,v.fcName,v.tried,v.wait,v.callback)}if(m&&y&&s<this.maxRetries){setTimeout(()=>{this.read.call(this,t,n,i,s+1,l*2,c)},l);return}c(m,y)},h=this.backend[i].bind(this.backend);if(h.length===2){try{const m=h(t,n);m&&typeof m.then=="function"?m.then(y=>d(null,y)).catch(d):d(null,m)}catch(m){d(m)}return}return h(t,n,d)}prepareLoading(t,n,i={},s){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),s&&s();Pe(t)&&(t=this.languageUtils.toResolveHierarchy(t)),Pe(n)&&(n=[n]);const l=this.queueLoad(t,n,i,s);if(!l.toLoad.length)return l.pending.length||s(),null;l.toLoad.forEach(c=>{this.loadOne(c)})}load(t,n,i){this.prepareLoading(t,n,{},i)}reload(t,n,i){this.prepareLoading(t,n,{reload:!0},i)}loadOne(t,n=""){const i=t.split("|"),s=i[0],l=i[1];this.read(s,l,"read",void 0,void 0,(c,d)=>{c&&this.logger.warn(`${n}loading namespace ${l} for language ${s} failed`,c),!c&&d&&this.logger.log(`${n}loaded namespace ${l} for language ${s}`,d),this.loaded(t,c,d)})}saveMissing(t,n,i,s,l,c={},d=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(n)){this.logger.warn(`did not save key "${i}" 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(!(i==null||i==="")){if(this.backend?.create){const h={...c,isUpdate:l},m=this.backend.create.bind(this.backend);if(m.length<6)try{let y;m.length===5?y=m(t,n,i,s,h):y=m(t,n,i,s),y&&typeof y.then=="function"?y.then(v=>d(null,v)).catch(d):d(null,y)}catch(y){d(y)}else m(t,n,i,s,d,h)}!t||!t[0]||this.store.addResource(t[0],n,i,s)}}}const sx=()=>({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]),Pe(e[1])&&(t.defaultValue=e[1]),Pe(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const n=e[3]||e[2];Object.keys(n).forEach(i=>{t[i]=n[i]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),ox=e=>(Pe(e.ns)&&(e.ns=[e.ns]),Pe(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),Pe(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),vd=()=>{},Vk=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})};class dc extends vf{constructor(t={},n){if(super(),this.options=ox(t),this.services={},this.logger=ai,this.modules={external:[]},Vk(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&&(Pe(t.ns)?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const i=sx();this.options={...i,...this.options,...ox(t)},this.options.interpolation={...i.interpolation,...this.options.interpolation},t.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=t.keySeparator),t.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=t.nsSeparator);const s=m=>m?typeof m=="function"?new m:m:null;if(!this.options.isClone){this.modules.logger?ai.init(s(this.modules.logger),this.options):ai.init(null,this.options);let m;this.modules.formatter?m=this.modules.formatter:m=Fk;const y=new tx(this.options);this.store=new ZS(this.options.resources,this.options);const v=this.services;v.logger=ai,v.resourceStore=this.store,v.languageUtils=y,v.pluralResolver=new zk(y,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==i.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"),m&&(!this.options.interpolation.format||this.options.interpolation.format===i.interpolation.format)&&(v.formatter=s(m),v.formatter.init&&v.formatter.init(v,this.options),this.options.interpolation.format=v.formatter.format.bind(v.formatter)),v.interpolator=new _k(this.options),v.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},v.backendConnector=new qk(s(this.modules.backend),v.resourceStore,v,this.options),v.backendConnector.on("*",(D,...w)=>{this.emit(D,...w)}),this.modules.languageDetector&&(v.languageDetector=s(this.modules.languageDetector),v.languageDetector.init&&v.languageDetector.init(v,this.options.detection,this.options)),this.modules.i18nFormat&&(v.i18nFormat=s(this.modules.i18nFormat),v.i18nFormat.init&&v.i18nFormat.init(this)),this.translator=new Gd(this.services,this.options),this.translator.on("*",(D,...w)=>{this.emit(D,...w)}),this.modules.external.forEach(D=>{D.init&&D.init(this)})}if(this.format=this.options.interpolation.format,n||(n=vd),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const m=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);m.length>0&&m[0]!=="dev"&&(this.options.lng=m[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(m=>{this[m]=(...y)=>this.store[m](...y)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(m=>{this[m]=(...y)=>(this.store[m](...y),this)});const d=Fl(),h=()=>{const m=(y,v)=>{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),d.resolve(v),n(y,v)};if(this.languages&&!this.isInitialized)return m(null,this.t.bind(this));this.changeLanguage(this.options.lng,m)};return this.options.resources||!this.options.initAsync?h():setTimeout(h,0),d}loadResources(t,n=vd){let i=n;const s=Pe(t)?t:this.language;if(typeof t=="function"&&(i=t),!this.options.resources||this.options.partialBundledLanguages){if(s?.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return i();const l=[],c=d=>{if(!d||d==="cimode")return;this.services.languageUtils.toResolveHierarchy(d).forEach(m=>{m!=="cimode"&&l.indexOf(m)<0&&l.push(m)})};s?c(s):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(h=>c(h)),this.options.preload?.forEach?.(d=>c(d)),this.services.backendConnector.load(l,this.options.ns,d=>{!d&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),i(d)})}else i(null)}reloadResources(t,n,i){const s=Fl();return typeof t=="function"&&(i=t,t=void 0),typeof n=="function"&&(i=n,n=void 0),t||(t=this.languages),n||(n=this.options.ns),i||(i=vd),this.services.backendConnector.reload(t,n,l=>{s.resolve(),i(l)}),s}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"&&HD.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 i=this.languages[n];if(!(["cimode","dev"].indexOf(i)>-1)&&this.store.hasLanguageSomeTranslations(i)){this.resolvedLanguage=i;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 i=Fl();this.emit("languageChanging",t);const s=d=>{this.language=d,this.languages=this.services.languageUtils.toResolveHierarchy(d),this.resolvedLanguage=void 0,this.setResolvedLanguage(d)},l=(d,h)=>{h?this.isLanguageChangingTo===t&&(s(h),this.translator.changeLanguage(h),this.isLanguageChangingTo=void 0,this.emit("languageChanged",h),this.logger.log("languageChanged",h)):this.isLanguageChangingTo=void 0,i.resolve((...m)=>this.t(...m)),n&&n(d,(...m)=>this.t(...m))},c=d=>{!t&&!d&&this.services.languageDetector&&(d=[]);const h=Pe(d)?d:d&&d[0],m=this.store.hasLanguageSomeTranslations(h)?h:this.services.languageUtils.getBestMatchFromCodes(Pe(d)?[d]:d);m&&(this.language||s(m),this.translator.language||this.translator.changeLanguage(m),this.services.languageDetector?.cacheUserLanguage?.(m)),this.loadResources(m,y=>{l(y,m)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?c(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(c):this.services.languageDetector.detect(c):c(t),i}getFixedT(t,n,i){const s=(l,c,...d)=>{let h;typeof c!="object"?h=this.options.overloadTranslationOptionHandler([l,c].concat(d)):h={...c},h.lng=h.lng||s.lng,h.lngs=h.lngs||s.lngs,h.ns=h.ns||s.ns,h.keyPrefix!==""&&(h.keyPrefix=h.keyPrefix||i||s.keyPrefix);const m=this.options.keySeparator||".";let y;return h.keyPrefix&&Array.isArray(l)?y=l.map(v=>(typeof v=="function"&&(v=Kp(v,{...this.options,...c})),`${h.keyPrefix}${m}${v}`)):(typeof l=="function"&&(l=Kp(l,{...this.options,...c})),y=h.keyPrefix?`${h.keyPrefix}${m}${l}`:l),this.t(y,h)};return Pe(t)?s.lng=t:s.lngs=t,s.ns=n,s.keyPrefix=i,s}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 i=n.lng||this.resolvedLanguage||this.languages[0],s=this.options?this.options.fallbackLng:!1,l=this.languages[this.languages.length-1];if(i.toLowerCase()==="cimode")return!0;const c=(d,h)=>{const m=this.services.backendConnector.state[`${d}|${h}`];return m===-1||m===0||m===2};if(n.precheck){const d=n.precheck(this,c);if(d!==void 0)return d}return!!(this.hasResourceBundle(i,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||c(i,t)&&(!s||c(l,t)))}loadNamespaces(t,n){const i=Fl();return this.options.ns?(Pe(t)&&(t=[t]),t.forEach(s=>{this.options.ns.indexOf(s)<0&&this.options.ns.push(s)}),this.loadResources(s=>{i.resolve(),n&&n(s)}),i):(n&&n(),Promise.resolve())}loadLanguages(t,n){const i=Fl();Pe(t)&&(t=[t]);const s=this.options.preload||[],l=t.filter(c=>s.indexOf(c)<0&&this.services.languageUtils.isSupportedCode(c));return l.length?(this.options.preload=s.concat(l),this.loadResources(c=>{i.resolve(),n&&n(c)}),i):(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 s=new Intl.Locale(t);if(s&&s.getTextInfo){const l=s.getTextInfo();if(l&&l.direction)return l.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"],i=this.services?.languageUtils||new tx(sx());return t.toLowerCase().indexOf("-latn")>1?"ltr":n.indexOf(i.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(t={},n){const i=new dc(t,n);return i.createInstance=dc.createInstance,i}cloneInstance(t={},n=vd){const i=t.forkResourceStore;i&&delete t.forkResourceStore;const s={...this.options,...t,isClone:!0},l=new dc(s);if((t.debug!==void 0||t.prefix!==void 0)&&(l.logger=l.logger.clone(t)),["store","services","language"].forEach(d=>{l[d]=this[d]}),l.services={...this.services},l.services.utils={hasLoadedNamespace:l.hasLoadedNamespace.bind(l)},i){const d=Object.keys(this.store.data).reduce((h,m)=>(h[m]={...this.store.data[m]},h[m]=Object.keys(h[m]).reduce((y,v)=>(y[v]={...h[m][v]},y),h[m]),h),{});l.store=new ZS(d,s),l.services.resourceStore=l.store}return l.translator=new Gd(l.services,s),l.translator.on("*",(d,...h)=>{l.emit(d,...h)}),l.init(s,n),l.translator.options=s,l.translator.backendConnector.services.utils={hasLoadedNamespace:l.hasLoadedNamespace.bind(l)},l}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const sn=dc.createInstance();sn.createInstance;sn.dir;sn.init;sn.loadResources;sn.reloadResources;sn.use;sn.changeLanguage;sn.getFixedT;sn.t;sn.exists;sn.setDefaultNamespace;sn.hasLoadedNamespace;sn.loadNamespaces;sn.loadLanguages;const Kk=(e,t,n,i)=>{const s=[n,{code:t,...i||{}}];if(e?.services?.logger?.forward)return e.services.logger.forward(s,"warn","react-i18next::",!0);fs(s[0])&&(s[0]=`react-i18next:: ${s[0]}`),e?.services?.logger?.warn?e.services.logger.warn(...s):console?.warn&&console.warn(...s)},lx={},VD=(e,t,n,i)=>{fs(n)&&lx[n]||(fs(n)&&(lx[n]=new Date),Kk(e,t,n,i))},KD=(e,t)=>()=>{if(e.isInitialized)t();else{const n=()=>{setTimeout(()=>{e.off("initialized",n)},0),t()};e.on("initialized",n)}},Gp=(e,t,n)=>{e.loadNamespaces(t,KD(e,n))},cx=(e,t,n,i)=>{if(fs(n)&&(n=[n]),e.options.preload&&e.options.preload.indexOf(t)>-1)return Gp(e,n,i);n.forEach(s=>{e.options.ns.indexOf(s)<0&&e.options.ns.push(s)}),e.loadLanguages(t,KD(e,i))},Gk=(e,t,n={})=>!t.languages||!t.languages.length?(VD(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0):t.hasLoadedNamespace(e,{lng:n.lng,precheck:(i,s)=>{if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&i.services.backendConnector.backend&&i.isLanguageChangingTo&&!s(i.isLanguageChangingTo,e))return!1}}),fs=e=>typeof e=="string",Yk=e=>typeof e=="object"&&e!==null,Jk=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,Xk={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},Wk=e=>Xk[e],Qk=e=>e.replace(Jk,Wk);let Yp={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:Qk};const Zk=(e={})=>{Yp={...Yp,...e}},e$=()=>Yp;let GD;const t$=e=>{GD=e},n$=()=>GD,a$={type:"3rdParty",init(e){Zk(e.options.react),t$(e)}},YD=S.createContext();class i${constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}var yp={exports:{}},vp={};var ux;function r$(){if(ux)return vp;ux=1;var e=Cc();function t(v,b){return v===b&&(v!==0||1/v===1/b)||v!==v&&b!==b}var n=typeof Object.is=="function"?Object.is:t,i=e.useState,s=e.useEffect,l=e.useLayoutEffect,c=e.useDebugValue;function d(v,b){var D=b(),w=i({inst:{value:D,getSnapshot:b}}),N=w[0].inst,M=w[1];return l(function(){N.value=D,N.getSnapshot=b,h(N)&&M({inst:N})},[v,D,b]),s(function(){return h(N)&&M({inst:N}),v(function(){h(N)&&M({inst:N})})},[v]),c(D),D}function h(v){var b=v.getSnapshot;v=v.value;try{var D=b();return!n(v,D)}catch{return!0}}function m(v,b){return b()}var y=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?m:d;return vp.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:y,vp}var dx;function s$(){return dx||(dx=1,yp.exports=r$()),yp.exports}var o$=s$();const l$=(e,t)=>fs(t)?t:Yk(t)&&fs(t.defaultValue)?t.defaultValue:Array.isArray(e)?e[e.length-1]:e,c$={t:l$,ready:!1},u$=()=>()=>{},Pt=(e,t={})=>{const{i18n:n}=t,{i18n:i,defaultNS:s}=S.useContext(YD)||{},l=n||i||n$();l&&!l.reportNamespaces&&(l.reportNamespaces=new i$),l||VD(l,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const c=S.useMemo(()=>({...e$(),...l?.options?.react,...t}),[l,t]),{useSuspense:d,keyPrefix:h}=c,m=s||l?.options?.defaultNS,y=fs(m)?[m]:m||["translation"],v=S.useMemo(()=>y,y);l?.reportNamespaces?.addUsedNamespaces?.(v);const b=S.useRef(0),D=S.useCallback(_=>{if(!l)return u$;const{bindI18n:Y,bindI18nStore:Z}=c,U=()=>{b.current+=1,_()};return Y&&l.on(Y,U),Z&&l.store.on(Z,U),()=>{Y&&Y.split(" ").forEach(ae=>l.off(ae,U)),Z&&Z.split(" ").forEach(ae=>l.store.off(ae,U))}},[l,c]),w=S.useRef(),N=S.useCallback(()=>{if(!l)return c$;const _=!!(l.isInitialized||l.initializedStoreOnce)&&v.every(ie=>Gk(ie,l,c)),Y=t.lng||l.language,Z=b.current,U=w.current;if(U&&U.ready===_&&U.lng===Y&&U.keyPrefix===h&&U.revision===Z)return U;const Q={t:l.getFixedT(Y,c.nsMode==="fallback"?v:v[0],h),ready:_,lng:Y,keyPrefix:h,revision:Z};return w.current=Q,Q},[l,v,h,c,t.lng]),[M,A]=S.useState(0),{t:T,ready:j}=o$.useSyncExternalStore(D,N,N);S.useEffect(()=>{if(l&&!j&&!d){const _=()=>A(Y=>Y+1);t.lng?cx(l,t.lng,v,_):Gp(l,v,_)}},[l,t.lng,v,j,d,M]);const F=l||{},z=S.useRef(null),P=S.useRef(),E=_=>{const Y=Object.getOwnPropertyDescriptors(_);Y.__original&&delete Y.__original;const Z=Object.create(Object.getPrototypeOf(_),Y);if(!Object.prototype.hasOwnProperty.call(Z,"__original"))try{Object.defineProperty(Z,"__original",{value:_,writable:!1,enumerable:!1,configurable:!1})}catch{}return Z},L=S.useMemo(()=>{const _=F,Y=_?.language;let Z=_;_&&(z.current&&z.current.__original===_?P.current!==Y?(Z=E(_),z.current=Z,P.current=Y):Z=z.current:(Z=E(_),z.current=Z,P.current=Y));const U=[T,Z,j];return U.t=T,U.i18n=Z,U.ready=j,U},[T,F,j,F.resolvedLanguage,F.language,F.languages]);if(l&&d&&!j)throw new Promise(_=>{const Y=()=>_();t.lng?cx(l,t.lng,v,Y):Gp(l,v,Y)});return L};function d$({i18n:e,defaultNS:t,children:n}){const i=S.useMemo(()=>({i18n:e,defaultNS:t}),[e,t]);return S.createElement(YD.Provider,{value:i},n)}var JD=e=>{throw TypeError(e)},f$=(e,t,n)=>t.has(e)||JD("Cannot "+n),bp=(e,t,n)=>(f$(e,t,"read from private field"),n?n.call(e):t.get(e)),h$=(e,t,n)=>t.has(e)?JD("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),fx="popstate";function m$(e={}){function t(i,s){let{pathname:l,search:c,hash:d}=i.location;return bc("",{pathname:l,search:c,hash:d},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function n(i,s){return typeof s=="string"?s:li(s)}return g$(t,n,null,e)}function Ye(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Kt(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function p$(){return Math.random().toString(36).substring(2,10)}function hx(e,t){return{usr:e.state,key:e.key,idx:t}}function bc(e,t,n=null,i){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?jr(t):t,state:n,key:t&&t.key||i||p$()}}function li({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 jr(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let i=e.indexOf("?");i>=0&&(t.search=e.substring(i),e=e.substring(0,i)),e&&(t.pathname=e)}return t}function g$(e,t,n,i={}){let{window:s=document.defaultView,v5Compat:l=!1}=i,c=s.history,d="POP",h=null,m=y();m==null&&(m=0,c.replaceState({...c.state,idx:m},""));function y(){return(c.state||{idx:null}).idx}function v(){d="POP";let M=y(),A=M==null?null:M-m;m=M,h&&h({action:d,location:N.location,delta:A})}function b(M,A){d="PUSH";let T=bc(N.location,M,A);m=y()+1;let j=hx(T,m),F=N.createHref(T);try{c.pushState(j,"",F)}catch(z){if(z instanceof DOMException&&z.name==="DataCloneError")throw z;s.location.assign(F)}l&&h&&h({action:d,location:N.location,delta:1})}function D(M,A){d="REPLACE";let T=bc(N.location,M,A);m=y();let j=hx(T,m),F=N.createHref(T);c.replaceState(j,"",F),l&&h&&h({action:d,location:N.location,delta:0})}function w(M){return XD(M)}let N={get action(){return d},get location(){return e(s,c)},listen(M){if(h)throw new Error("A history only accepts one active listener");return s.addEventListener(fx,v),h=M,()=>{s.removeEventListener(fx,v),h=null}},createHref(M){return t(s,M)},createURL:w,encodeLocation(M){let A=w(M);return{pathname:A.pathname,search:A.search,hash:A.hash}},push:b,replace:D,go(M){return c.go(M)}};return N}function XD(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Ye(n,"No window.location.(origin|href) available to create URL");let i=typeof e=="string"?e:li(e);return i=i.replace(/ $/,"%20"),!t&&i.startsWith("//")&&(i=n+i),new URL(i,n)}var ec,mx=class{constructor(e){if(h$(this,ec,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(bp(this,ec).has(e))return bp(this,ec).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){bp(this,ec).set(e,t)}};ec=new WeakMap;var y$=new Set(["lazy","caseSensitive","path","id","index","children"]);function v$(e){return y$.has(e)}var b$=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function S$(e){return b$.has(e)}function x$(e){return e.index===!0}function Sc(e,t,n=[],i={},s=!1){return e.map((l,c)=>{let d=[...n,String(c)],h=typeof l.id=="string"?l.id:d.join("-");if(Ye(l.index!==!0||!l.children,"Cannot specify children on an index route"),Ye(s||!i[h],`Found a route id collision on id "${h}". Route id's must be globally unique within Data Router usages`),x$(l)){let m={...l,id:h};return i[h]=px(m,t(m)),m}else{let m={...l,id:h,children:void 0};return i[h]=px(m,t(m)),l.children&&(m.children=Sc(l.children,t,d,i,s)),m}})}function px(e,t){return Object.assign(e,{...t,...typeof t.lazy=="object"&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function br(e,t,n="/"){return tc(e,t,n,!1)}function tc(e,t,n,i){let s=typeof t=="string"?jr(t):t,l=Oa(s.pathname||"/",n);if(l==null)return null;let c=WD(e);D$(c);let d=null;for(let h=0;d==null&&h<c.length;++h){let m=R$(l);d=$$(c[h],m,i)}return d}function w$(e,t){let{route:n,pathname:i,params:s}=e;return{id:n.id,pathname:i,params:s,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function WD(e,t=[],n=[],i="",s=!1){let l=(c,d,h=s,m)=>{let y={relativePath:m===void 0?c.path||"":m,caseSensitive:c.caseSensitive===!0,childrenIndex:d,route:c};if(y.relativePath.startsWith("/")){if(!y.relativePath.startsWith(i)&&h)return;Ye(y.relativePath.startsWith(i),`Absolute route path "${y.relativePath}" nested under path "${i}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),y.relativePath=y.relativePath.slice(i.length)}let v=si([i,y.relativePath]),b=n.concat(y);c.children&&c.children.length>0&&(Ye(c.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${v}".`),WD(c.children,t,b,v,h)),!(c.path==null&&!c.index)&&t.push({path:v,score:j$(v,c.index),routesMeta:b})};return e.forEach((c,d)=>{if(c.path===""||!c.path?.includes("?"))l(c,d);else for(let h of QD(c.path))l(c,d,!0,h)}),t}function QD(e){let t=e.split("/");if(t.length===0)return[];let[n,...i]=t,s=n.endsWith("?"),l=n.replace(/\?$/,"");if(i.length===0)return s?[l,""]:[l];let c=QD(i.join("/")),d=[];return d.push(...c.map(h=>h===""?l:[l,h].join("/"))),s&&d.push(...c),d.map(h=>e.startsWith("/")&&h===""?"/":h)}function D$(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:k$(t.routesMeta.map(i=>i.childrenIndex),n.routesMeta.map(i=>i.childrenIndex)))}var N$=/^:[\w-]+$/,C$=3,E$=2,A$=1,M$=10,T$=-2,gx=e=>e==="*";function j$(e,t){let n=e.split("/"),i=n.length;return n.some(gx)&&(i+=T$),t&&(i+=E$),n.filter(s=>!gx(s)).reduce((s,l)=>s+(N$.test(l)?C$:l===""?A$:M$),i)}function k$(e,t){return e.length===t.length&&e.slice(0,-1).every((i,s)=>i===t[s])?e[e.length-1]-t[t.length-1]:0}function $$(e,t,n=!1){let{routesMeta:i}=e,s={},l="/",c=[];for(let d=0;d<i.length;++d){let h=i[d],m=d===i.length-1,y=l==="/"?t:t.slice(l.length)||"/",v=Yd({path:h.relativePath,caseSensitive:h.caseSensitive,end:m},y),b=h.route;if(!v&&m&&n&&!i[i.length-1].route.index&&(v=Yd({path:h.relativePath,caseSensitive:h.caseSensitive,end:!1},y)),!v)return null;Object.assign(s,v.params),c.push({params:s,pathname:si([l,v.pathname]),pathnameBase:z$(si([l,v.pathnameBase])),route:b}),v.pathnameBase!=="/"&&(l=si([l,v.pathnameBase]))}return c}function Yd(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,i]=O$(e.path,e.caseSensitive,e.end),s=t.match(n);if(!s)return null;let l=s[0],c=l.replace(/(.)\/+$/,"$1"),d=s.slice(1);return{params:i.reduce((m,{paramName:y,isOptional:v},b)=>{if(y==="*"){let w=d[b]||"";c=l.slice(0,l.length-w.length).replace(/(.)\/+$/,"$1")}const D=d[b];return v&&!D?m[y]=void 0:m[y]=(D||"").replace(/%2F/g,"/"),m},{}),pathname:l,pathnameBase:c,pattern:e}}function O$(e,t=!1,n=!0){Kt(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 i=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(c,d,h)=>(i.push({paramName:d,isOptional:h!=null}),h?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(i.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),i]}function R$(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Kt(!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 Oa(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,i=e.charAt(n);return i&&i!=="/"?null:e.slice(n)||"/"}function L$({basename:e,pathname:t}){return t==="/"?e:si([e,t])}var P$=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,bf=e=>P$.test(e);function I$(e,t="/"){let{pathname:n,search:i="",hash:s=""}=typeof e=="string"?jr(e):e,l;if(n)if(bf(n))l=n;else{if(n.includes("//")){let c=n;n=n.replace(/\/\/+/g,"/"),Kt(!1,`Pathnames cannot have embedded double slashes - normalizing ${c} -> ${n}`)}n.startsWith("/")?l=yx(n.substring(1),"/"):l=yx(n,t)}else l=t;return{pathname:l,search:_$(i),hash:U$(s)}}function yx(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function Sp(e,t,n,i){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(i)}]. 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 ZD(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function qg(e){let t=ZD(e);return t.map((n,i)=>i===t.length-1?n.pathname:n.pathnameBase)}function Vg(e,t,n,i=!1){let s;typeof e=="string"?s=jr(e):(s={...e},Ye(!s.pathname||!s.pathname.includes("?"),Sp("?","pathname","search",s)),Ye(!s.pathname||!s.pathname.includes("#"),Sp("#","pathname","hash",s)),Ye(!s.search||!s.search.includes("#"),Sp("#","search","hash",s)));let l=e===""||s.pathname==="",c=l?"/":s.pathname,d;if(c==null)d=n;else{let v=t.length-1;if(!i&&c.startsWith("..")){let b=c.split("/");for(;b[0]==="..";)b.shift(),v-=1;s.pathname=b.join("/")}d=v>=0?t[v]:"/"}let h=I$(s,d),m=c&&c!=="/"&&c.endsWith("/"),y=(l||c===".")&&n.endsWith("/");return!h.pathname.endsWith("/")&&(m||y)&&(h.pathname+="/"),h}var si=e=>e.join("/").replace(/\/\/+/g,"/"),z$=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),_$=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,U$=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,Jd=class{constructor(e,t,n,i=!1){this.status=e,this.statusText=t||"",this.internal=i,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function Ar(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function Kg(e){return e.filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var Dr=Symbol("Uninstrumented");function B$(e,t){let n={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(s=>s({id:t.id,index:t.index,path:t.path,instrument(l){let c=Object.keys(n);for(let d of c)l[d]&&n[d].push(l[d])}}));let i={};if(typeof t.lazy=="function"&&n.lazy.length>0){let s=vo(n.lazy,t.lazy,()=>{});s&&(i.lazy=s)}if(typeof t.lazy=="object"){let s=t.lazy;["middleware","loader","action"].forEach(l=>{let c=s[l],d=n[`lazy.${l}`];if(typeof c=="function"&&d.length>0){let h=vo(d,c,()=>{});h&&(i.lazy=Object.assign(i.lazy||{},{[l]:h}))}})}return["loader","action"].forEach(s=>{let l=t[s];if(typeof l=="function"&&n[s].length>0){let c=l[Dr]??l,d=vo(n[s],c,(...h)=>vx(h[0]));d&&(d[Dr]=c,i[s]=d)}}),t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(i.middleware=t.middleware.map(s=>{let l=s[Dr]??s,c=vo(n.middleware,l,(...d)=>vx(d[0]));return c?(c[Dr]=l,c):s})),i}function F$(e,t){let n={navigate:[],fetch:[]};if(t.forEach(i=>i({instrument(s){let l=Object.keys(s);for(let c of l)s[c]&&n[c].push(s[c])}})),n.navigate.length>0){let i=e.navigate[Dr]??e.navigate,s=vo(n.navigate,i,(...l)=>{let[c,d]=l;return{to:typeof c=="number"||typeof c=="string"?c:c?li(c):".",...bx(e,d??{})}});s&&(s[Dr]=i,e.navigate=s)}if(n.fetch.length>0){let i=e.fetch[Dr]??e.fetch,s=vo(n.fetch,i,(...l)=>{let[c,,d,h]=l;return{href:d??".",fetcherKey:c,...bx(e,h??{})}});s&&(s[Dr]=i,e.fetch=s)}return e}function vo(e,t,n){return e.length===0?null:async(...i)=>{let s=await eN(e,n(...i),()=>t(...i),e.length-1);if(s.type==="error")throw s.value;return s.value}}async function eN(e,t,n,i){let s=e[i],l;if(s){let c,d=async()=>(c?console.error("You cannot call instrumented handlers more than once"):c=eN(e,t,n,i-1),l=await c,Ye(l,"Expected a result"),l.type==="error"&&l.value instanceof Error?{status:"error",error:l.value}:{status:"success",error:void 0});try{await s(d,t)}catch(h){console.error("An instrumentation function threw an error:",h)}c||await d(),await c}else try{l={type:"success",value:await n()}}catch(c){l={type:"error",value:c}}return l||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function vx(e){let{request:t,context:n,params:i,unstable_pattern:s}=e;return{request:H$(t),params:{...i},unstable_pattern:s,context:q$(n)}}function bx(e,t){return{currentUrl:li(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 H$(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function q$(e){if(K$(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var V$=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function K$(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")===V$}var tN=["POST","PUT","PATCH","DELETE"],G$=new Set(tN),Y$=["GET",...tN],J$=new Set(Y$),X$=new Set([301,302,303,307,308]),W$=new Set([307,308]),xp={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Q$={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Hl={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Z$=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),nN="remix-router-transitions",aN=Symbol("ResetLoaderData");function eO(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";Ye(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let i=e.hydrationRouteProperties||[],s=e.mapRouteProperties||Z$,l=s;if(e.unstable_instrumentations){let O=e.unstable_instrumentations;l=H=>({...s(H),...B$(O.map(G=>G.route).filter(Boolean),H)})}let c={},d=Sc(e.routes,l,void 0,c),h,m=e.basename||"/";m.startsWith("/")||(m=`/${m}`);let y=e.dataStrategy||rO,v={...e.future},b=null,D=new Set,w=null,N=null,M=null,A=e.hydrationData!=null,T=br(d,e.history.location,m),j=!1,F=null,z;if(T==null&&!e.patchRoutesOnNavigation){let O=ja(404,{pathname:e.history.location.pathname}),{matches:H,route:G}=bd(d);z=!0,T=H,F={[G.id]:O}}else if(T&&!e.hydrationData&&xs(T,d,e.history.location.pathname).active&&(T=null),T)if(T.some(O=>O.route.lazy))z=!1;else if(!T.some(O=>Gg(O.route)))z=!0;else{let O=e.hydrationData?e.hydrationData.loaderData:null,H=e.hydrationData?e.hydrationData.errors:null;if(H){let G=T.findIndex(re=>H[re.route.id]!==void 0);z=T.slice(0,G+1).every(re=>!Xp(re.route,O,H))}else z=T.every(G=>!Xp(G.route,O,H))}else{z=!1,T=[];let O=xs(null,d,e.history.location.pathname);O.active&&O.matches&&(j=!0,T=O.matches)}let P,E={historyAction:e.history.action,location:e.history.location,matches:T,initialized:z,navigation:xp,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||F,fetchers:new Map,blockers:new Map},L="POP",_=!1,Y,Z=!1,U=new Map,ae=null,Q=!1,ie=!1,R=new Set,W=new Map,se=0,ye=-1,ke=new Map,k=new Set,J=new Map,oe=new Map,ce=new Set,$e=new Map,Fe,Je=null;function mn(){if(b=e.history.listen(({action:O,location:H,delta:G})=>{if(Fe){Fe(),Fe=void 0;return}Kt($e.size===0||G!=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 re=Ir({currentLocation:E.location,nextLocation:H,historyAction:O});if(re&&G!=null){let ue=new Promise(Ee=>{Fe=Ee});e.history.go(G*-1),vs(re,{state:"blocked",location:H,proceed(){vs(re,{state:"proceeding",proceed:void 0,reset:void 0,location:H}),ue.then(()=>e.history.go(G))},reset(){let Ee=new Map(E.blockers);Ee.set(re,Hl),Yt({blockers:Ee})}});return}return La(O,H)}),n){SO(t,U);let O=()=>xO(t,U);t.addEventListener("pagehide",O),ae=()=>t.removeEventListener("pagehide",O)}return E.initialized||La("POP",E.location,{initialHydration:!0}),P}function Mt(){b&&b(),ae&&ae(),D.clear(),Y&&Y.abort(),E.fetchers.forEach((O,H)=>Yo(H)),E.blockers.forEach((O,H)=>Zc(H))}function Pr(O){return D.add(O),()=>D.delete(O)}function Yt(O,H={}){O.matches&&(O.matches=O.matches.map(ue=>{let Ee=c[ue.route.id],Ae=ue.route;return Ae.element!==Ee.element||Ae.errorElement!==Ee.errorElement||Ae.hydrateFallbackElement!==Ee.hydrateFallbackElement?{...ue,route:Ee}:ue})),E={...E,...O};let G=[],re=[];E.fetchers.forEach((ue,Ee)=>{ue.state==="idle"&&(ce.has(Ee)?G.push(Ee):re.push(Ee))}),ce.forEach(ue=>{!E.fetchers.has(ue)&&!W.has(ue)&&G.push(ue)}),[...D].forEach(ue=>ue(E,{deletedFetchers:G,viewTransitionOpts:H.viewTransitionOpts,flushSync:H.flushSync===!0})),G.forEach(ue=>Yo(ue)),re.forEach(ue=>E.fetchers.delete(ue))}function Xa(O,H,{flushSync:G}={}){let re=E.actionData!=null&&E.navigation.formMethod!=null&&zn(E.navigation.formMethod)&&E.navigation.state==="loading"&&O.state?._isRedirect!==!0,ue;H.actionData?Object.keys(H.actionData).length>0?ue=H.actionData:ue=null:re?ue=E.actionData:ue=null;let Ee=H.loaderData?Tx(E.loaderData,H.loaderData,H.matches||[],H.errors):E.loaderData,Ae=E.blockers;Ae.size>0&&(Ae=new Map(Ae),Ae.forEach((De,Te)=>Ae.set(Te,Hl)));let ve=Q?!1:Fi(O,H.matches||E.matches),me=_===!0||E.navigation.formMethod!=null&&zn(E.navigation.formMethod)&&O.state?._isRedirect!==!0;h&&(d=h,h=void 0),Q||L==="POP"||(L==="PUSH"?e.history.push(O,O.state):L==="REPLACE"&&e.history.replace(O,O.state));let be;if(L==="POP"){let De=U.get(E.location.pathname);De&&De.has(O.pathname)?be={currentLocation:E.location,nextLocation:O}:U.has(O.pathname)&&(be={currentLocation:O,nextLocation:E.location})}else if(Z){let De=U.get(E.location.pathname);De?De.add(O.pathname):(De=new Set([O.pathname]),U.set(E.location.pathname,De)),be={currentLocation:E.location,nextLocation:O}}Yt({...H,actionData:ue,loaderData:Ee,historyAction:L,location:O,initialized:!0,navigation:xp,revalidation:"idle",restoreScrollPosition:ve,preventScrollReset:me,blockers:Ae},{viewTransitionOpts:be,flushSync:G===!0}),L="POP",_=!1,Z=!1,Q=!1,ie=!1,Je?.resolve(),Je=null}async function Fo(O,H){if(typeof O=="number"){e.history.go(O);return}let G=Jp(E.location,E.matches,m,O,H?.fromRouteId,H?.relative),{path:re,submission:ue,error:Ee}=Sx(!1,G,H),Ae=E.location,ve=bc(E.location,re,H&&H.state);ve={...ve,...e.history.encodeLocation(ve)};let me=H&&H.replace!=null?H.replace:void 0,be="PUSH";me===!0?be="REPLACE":me===!1||ue!=null&&zn(ue.formMethod)&&ue.formAction===E.location.pathname+E.location.search&&(be="REPLACE");let De=H&&"preventScrollReset"in H?H.preventScrollReset===!0:void 0,Te=(H&&H.flushSync)===!0,tt=Ir({currentLocation:Ae,nextLocation:ve,historyAction:be});if(tt){vs(tt,{state:"blocked",location:ve,proceed(){vs(tt,{state:"proceeding",proceed:void 0,reset:void 0,location:ve}),Fo(O,H)},reset(){let Ct=new Map(E.blockers);Ct.set(tt,Hl),Yt({blockers:Ct})}});return}await La(be,ve,{submission:ue,pendingError:Ee,preventScrollReset:De,replace:H&&H.replace,enableViewTransition:H&&H.viewTransition,flushSync:Te})}function hi(){Je||(Je=wO()),ys(),Yt({revalidation:"loading"});let O=Je.promise;return E.navigation.state==="submitting"?O:E.navigation.state==="idle"?(La(E.historyAction,E.location,{startUninterruptedRevalidation:!0}),O):(La(L||E.historyAction,E.navigation.location,{overrideNavigation:E.navigation,enableViewTransition:Z===!0}),O)}async function La(O,H,G){Y&&Y.abort(),Y=null,L=O,Q=(G&&G.startUninterruptedRevalidation)===!0,Ss(E.location,E.matches),_=(G&&G.preventScrollReset)===!0,Z=(G&&G.enableViewTransition)===!0;let re=h||d,ue=G&&G.overrideNavigation,Ee=G?.initialHydration&&E.matches&&E.matches.length>0&&!j?E.matches:br(re,H,m),Ae=(G&&G.flushSync)===!0;if(Ee&&E.initialized&&!ie&&hO(E.location,H)&&!(G&&G.submission&&zn(G.submission.formMethod))){Xa(H,{matches:Ee},{flushSync:Ae});return}let ve=xs(Ee,re,H.pathname);if(ve.active&&ve.matches&&(Ee=ve.matches),!Ee){let{error:Ot,notFoundMatches:dt,route:rt}=Bi(H.pathname);Xa(H,{matches:dt,loaderData:{},errors:{[rt.id]:Ot}},{flushSync:Ae});return}Y=new AbortController;let me=mo(e.history,H,Y.signal,G&&G.submission),be=e.getContext?await e.getContext():new mx,De;if(G&&G.pendingError)De=[Sr(Ee).route.id,{type:"error",error:G.pendingError}];else if(G&&G.submission&&zn(G.submission.formMethod)){let Ot=await Ho(me,H,G.submission,Ee,be,ve.active,G&&G.initialHydration===!0,{replace:G.replace,flushSync:Ae});if(Ot.shortCircuited)return;if(Ot.pendingActionResult){let[dt,rt]=Ot.pendingActionResult;if(ma(rt)&&Ar(rt.error)&&rt.error.status===404){Y=null,Xa(H,{matches:Ot.matches,loaderData:{},errors:{[dt]:rt.error}});return}}Ee=Ot.matches||Ee,De=Ot.pendingActionResult,ue=wp(H,G.submission),Ae=!1,ve.active=!1,me=mo(e.history,me.url,me.signal)}let{shortCircuited:Te,matches:tt,loaderData:Ct,errors:Bt}=await zf(me,H,Ee,be,ve.active,ue,G&&G.submission,G&&G.fetcherSubmission,G&&G.replace,G&&G.initialHydration===!0,Ae,De);Te||(Y=null,Xa(H,{matches:tt||Ee,...jx(De),loaderData:Ct,errors:Bt}))}async function Ho(O,H,G,re,ue,Ee,Ae,ve={}){ys();let me=vO(H,G);if(Yt({navigation:me},{flushSync:ve.flushSync===!0}),Ee){let Te=await zr(re,H.pathname,O.signal);if(Te.type==="aborted")return{shortCircuited:!0};if(Te.type==="error"){if(Te.partialMatches.length===0){let{matches:Ct,route:Bt}=bd(d);return{matches:Ct,pendingActionResult:[Bt.id,{type:"error",error:Te.error}]}}let tt=Sr(Te.partialMatches).route.id;return{matches:Te.partialMatches,pendingActionResult:[tt,{type:"error",error:Te.error}]}}else if(Te.matches)re=Te.matches;else{let{notFoundMatches:tt,error:Ct,route:Bt}=Bi(H.pathname);return{matches:tt,pendingActionResult:[Bt.id,{type:"error",error:Ct}]}}}let be,De=$d(re,H);if(!De.route.action&&!De.route.lazy)be={type:"error",error:ja(405,{method:O.method,pathname:H.pathname,routeId:De.route.id})};else{let Te=xo(l,c,O,re,De,Ae?[]:i,ue),tt=await un(O,Te,ue,null);if(be=tt[De.route.id],!be){for(let Ct of re)if(tt[Ct.route.id]){be=tt[Ct.route.id];break}}if(O.signal.aborted)return{shortCircuited:!0}}if(os(be)){let Te;return ve&&ve.replace!=null?Te=ve.replace:Te=Ex(be.response.headers.get("Location"),new URL(O.url),m)===E.location.pathname+E.location.search,await mi(O,be,!0,{submission:G,replace:Te}),{shortCircuited:!0}}if(ma(be)){let Te=Sr(re,De.route.id);return(ve&&ve.replace)!==!0&&(L="PUSH"),{matches:re,pendingActionResult:[Te.route.id,be,De.route.id]}}return{matches:re,pendingActionResult:[De.route.id,be]}}async function zf(O,H,G,re,ue,Ee,Ae,ve,me,be,De,Te){let tt=Ee||wp(H,Ae),Ct=Ae||ve||$x(tt),Bt=!Q&&!be;if(ue){if(Bt){let dn=qo(Te);Yt({navigation:tt,...dn!==void 0?{actionData:dn}:{}},{flushSync:De})}let Qe=await zr(G,H.pathname,O.signal);if(Qe.type==="aborted")return{shortCircuited:!0};if(Qe.type==="error"){if(Qe.partialMatches.length===0){let{matches:qi,route:ba}=bd(d);return{matches:qi,loaderData:{},errors:{[ba.id]:Qe.error}}}let dn=Sr(Qe.partialMatches).route.id;return{matches:Qe.partialMatches,loaderData:{},errors:{[dn]:Qe.error}}}else if(Qe.matches)G=Qe.matches;else{let{error:dn,notFoundMatches:qi,route:ba}=Bi(H.pathname);return{matches:qi,loaderData:{},errors:{[ba.id]:dn}}}}let Ot=h||d,{dsMatches:dt,revalidatingFetchers:rt}=xx(O,re,l,c,e.history,E,G,Ct,H,be?[]:i,be===!0,ie,R,ce,J,k,Ot,m,e.patchRoutesOnNavigation!=null,Te);if(ye=++se,!e.dataStrategy&&!dt.some(Qe=>Qe.shouldLoad)&&!dt.some(Qe=>Qe.route.middleware&&Qe.route.middleware.length>0)&&rt.length===0){let Qe=Pa();return Xa(H,{matches:G,loaderData:{},errors:Te&&ma(Te[1])?{[Te[0]]:Te[1].error}:null,...jx(Te),...Qe?{fetchers:new Map(E.fetchers)}:{}},{flushSync:De}),{shortCircuited:!0}}if(Bt){let Qe={};if(!ue){Qe.navigation=tt;let dn=qo(Te);dn!==void 0&&(Qe.actionData=dn)}rt.length>0&&(Qe.fetchers=Vo(rt)),Yt(Qe,{flushSync:De})}rt.forEach(Qe=>{$n(Qe.key),Qe.controller&&W.set(Qe.key,Qe.controller)});let qn=()=>rt.forEach(Qe=>$n(Qe.key));Y&&Y.signal.addEventListener("abort",qn);let{loaderResults:Ia,fetcherResults:On}=await Xc(dt,rt,O,re);if(O.signal.aborted)return{shortCircuited:!0};Y&&Y.signal.removeEventListener("abort",qn),rt.forEach(Qe=>W.delete(Qe.key));let ft=Sd(Ia);if(ft)return await mi(O,ft.result,!0,{replace:me}),{shortCircuited:!0};if(ft=Sd(On),ft)return k.add(ft.key),await mi(O,ft.result,!0,{replace:me}),{shortCircuited:!0};let{loaderData:Ds,errors:Hi}=Mx(E,G,Ia,Te,rt,On);be&&E.errors&&(Hi={...E.errors,...Hi});let Rn=Pa(),za=Mn(ye),Ns=Rn||za||rt.length>0;return{matches:G,loaderData:Ds,errors:Hi,...Ns?{fetchers:new Map(E.fetchers)}:{}}}function qo(O){if(O&&!ma(O[1]))return{[O[0]]:O[1].data};if(E.actionData)return Object.keys(E.actionData).length===0?null:E.actionData}function Vo(O){return O.forEach(H=>{let G=E.fetchers.get(H.key),re=ql(void 0,G?G.data:void 0);E.fetchers.set(H.key,re)}),new Map(E.fetchers)}async function Ko(O,H,G,re){$n(O);let ue=(re&&re.flushSync)===!0,Ee=h||d,Ae=Jp(E.location,E.matches,m,G,H,re?.relative),ve=br(Ee,Ae,m),me=xs(ve,Ee,Ae);if(me.active&&me.matches&&(ve=me.matches),!ve){Hn(O,H,ja(404,{pathname:Ae}),{flushSync:ue});return}let{path:be,submission:De,error:Te}=Sx(!0,Ae,re);if(Te){Hn(O,H,Te,{flushSync:ue});return}let tt=e.getContext?await e.getContext():new mx,Ct=(re&&re.preventScrollReset)===!0;if(De&&zn(De.formMethod)){await Go(O,H,be,ve,tt,me.active,ue,Ct,De);return}J.set(O,{routeId:H,path:be}),await _f(O,H,be,ve,tt,me.active,ue,Ct,De)}async function Go(O,H,G,re,ue,Ee,Ae,ve,me){ys(),J.delete(O);let be=E.fetchers.get(O);va(O,bO(me,be),{flushSync:Ae});let De=new AbortController,Te=mo(e.history,G,De.signal,me);if(Ee){let xt=await zr(re,new URL(Te.url).pathname,Te.signal,O);if(xt.type==="aborted")return;if(xt.type==="error"){Hn(O,H,xt.error,{flushSync:Ae});return}else if(xt.matches)re=xt.matches;else{Hn(O,H,ja(404,{pathname:G}),{flushSync:Ae});return}}let tt=$d(re,G);if(!tt.route.action&&!tt.route.lazy){let xt=ja(405,{method:me.formMethod,pathname:G,routeId:H});Hn(O,H,xt,{flushSync:Ae});return}W.set(O,De);let Ct=se,Bt=xo(l,c,Te,re,tt,i,ue),Ot=await un(Te,Bt,ue,O),dt=Ot[tt.route.id];if(!dt){for(let xt of Bt)if(Ot[xt.route.id]){dt=Ot[xt.route.id];break}}if(Te.signal.aborted){W.get(O)===De&&W.delete(O);return}if(ce.has(O)){if(os(dt)||ma(dt)){va(O,$i(void 0));return}}else{if(os(dt))if(W.delete(O),ye>Ct){va(O,$i(void 0));return}else return k.add(O),va(O,ql(me)),mi(Te,dt,!1,{fetcherSubmission:me,preventScrollReset:ve});if(ma(dt)){Hn(O,H,dt.error);return}}let rt=E.navigation.location||E.location,qn=mo(e.history,rt,De.signal),Ia=h||d,On=E.navigation.state!=="idle"?br(Ia,E.navigation.location,m):E.matches;Ye(On,"Didn't find any matches after fetcher action");let ft=++se;ke.set(O,ft);let Ds=ql(me,dt.data);E.fetchers.set(O,Ds);let{dsMatches:Hi,revalidatingFetchers:Rn}=xx(qn,ue,l,c,e.history,E,On,me,rt,i,!1,ie,R,ce,J,k,Ia,m,e.patchRoutesOnNavigation!=null,[tt.route.id,dt]);Rn.filter(xt=>xt.key!==O).forEach(xt=>{let Vn=xt.key,Ln=E.fetchers.get(Vn),eu=ql(void 0,Ln?Ln.data:void 0);E.fetchers.set(Vn,eu),$n(Vn),xt.controller&&W.set(Vn,xt.controller)}),Yt({fetchers:new Map(E.fetchers)});let za=()=>Rn.forEach(xt=>$n(xt.key));De.signal.addEventListener("abort",za);let{loaderResults:Ns,fetcherResults:Qe}=await Xc(Hi,Rn,qn,ue);if(De.signal.aborted)return;if(De.signal.removeEventListener("abort",za),ke.delete(O),W.delete(O),Rn.forEach(xt=>W.delete(xt.key)),E.fetchers.has(O)){let xt=$i(dt.data);E.fetchers.set(O,xt)}let dn=Sd(Ns);if(dn)return mi(qn,dn.result,!1,{preventScrollReset:ve});if(dn=Sd(Qe),dn)return k.add(dn.key),mi(qn,dn.result,!1,{preventScrollReset:ve});let{loaderData:qi,errors:ba}=Mx(E,On,Ns,void 0,Rn,Qe);Mn(ft),E.navigation.state==="loading"&&ft>ye?(Ye(L,"Expected pending action"),Y&&Y.abort(),Xa(E.navigation.location,{matches:On,loaderData:qi,errors:ba,fetchers:new Map(E.fetchers)})):(Yt({errors:ba,loaderData:Tx(E.loaderData,qi,On,ba),fetchers:new Map(E.fetchers)}),ie=!1)}async function _f(O,H,G,re,ue,Ee,Ae,ve,me){let be=E.fetchers.get(O);va(O,ql(me,be?be.data:void 0),{flushSync:Ae});let De=new AbortController,Te=mo(e.history,G,De.signal);if(Ee){let rt=await zr(re,new URL(Te.url).pathname,Te.signal,O);if(rt.type==="aborted")return;if(rt.type==="error"){Hn(O,H,rt.error,{flushSync:Ae});return}else if(rt.matches)re=rt.matches;else{Hn(O,H,ja(404,{pathname:G}),{flushSync:Ae});return}}let tt=$d(re,G);W.set(O,De);let Ct=se,Bt=xo(l,c,Te,re,tt,i,ue),dt=(await un(Te,Bt,ue,O))[tt.route.id];if(W.get(O)===De&&W.delete(O),!Te.signal.aborted){if(ce.has(O)){va(O,$i(void 0));return}if(os(dt))if(ye>Ct){va(O,$i(void 0));return}else{k.add(O),await mi(Te,dt,!1,{preventScrollReset:ve});return}if(ma(dt)){Hn(O,H,dt.error);return}va(O,$i(dt.data))}}async function mi(O,H,G,{submission:re,fetcherSubmission:ue,preventScrollReset:Ee,replace:Ae}={}){H.response.headers.has("X-Remix-Revalidate")&&(ie=!0);let ve=H.response.headers.get("Location");Ye(ve,"Expected a Location header on the redirect Response"),ve=Ex(ve,new URL(O.url),m);let me=bc(E.location,ve,{_isRedirect:!0});if(n){let Bt=!1;if(H.response.headers.has("X-Remix-Reload-Document"))Bt=!0;else if(bf(ve)){const Ot=XD(ve,!0);Bt=Ot.origin!==t.location.origin||Oa(Ot.pathname,m)==null}if(Bt){Ae?t.location.replace(ve):t.location.assign(ve);return}}Y=null;let be=Ae===!0||H.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:De,formAction:Te,formEncType:tt}=E.navigation;!re&&!ue&&De&&Te&&tt&&(re=$x(E.navigation));let Ct=re||ue;if(W$.has(H.response.status)&&Ct&&zn(Ct.formMethod))await La(be,me,{submission:{...Ct,formAction:ve},preventScrollReset:Ee||_,enableViewTransition:G?Z:void 0});else{let Bt=wp(me,re);await La(be,me,{overrideNavigation:Bt,fetcherSubmission:ue,preventScrollReset:Ee||_,enableViewTransition:G?Z:void 0})}}async function un(O,H,G,re){let ue,Ee={};try{ue=await oO(y,O,H,re,G,!1)}catch(Ae){return H.filter(ve=>ve.shouldLoad).forEach(ve=>{Ee[ve.route.id]={type:"error",error:Ae}}),Ee}if(O.signal.aborted)return Ee;for(let[Ae,ve]of Object.entries(ue))if(gO(ve)){let me=ve.result;Ee[Ae]={type:"redirect",response:dO(me,O,Ae,H,m)}}else Ee[Ae]=await uO(ve);return Ee}async function Xc(O,H,G,re){let ue=un(G,O,re,null),Ee=Promise.all(H.map(async me=>{if(me.matches&&me.match&&me.request&&me.controller){let De=(await un(me.request,me.matches,re,me.key))[me.match.route.id];return{[me.key]:De}}else return Promise.resolve({[me.key]:{type:"error",error:ja(404,{pathname:me.path})}})})),Ae=await ue,ve=(await Ee).reduce((me,be)=>Object.assign(me,be),{});return{loaderResults:Ae,fetcherResults:ve}}function ys(){ie=!0,J.forEach((O,H)=>{W.has(H)&&R.add(H),$n(H)})}function va(O,H,G={}){E.fetchers.set(O,H),Yt({fetchers:new Map(E.fetchers)},{flushSync:(G&&G.flushSync)===!0})}function Hn(O,H,G,re={}){let ue=Sr(E.matches,H);Yo(O),Yt({errors:{[ue.route.id]:G},fetchers:new Map(E.fetchers)},{flushSync:(re&&re.flushSync)===!0})}function Wc(O){return oe.set(O,(oe.get(O)||0)+1),ce.has(O)&&ce.delete(O),E.fetchers.get(O)||Q$}function Qc(O,H){$n(O,H?.reason),va(O,$i(null))}function Yo(O){let H=E.fetchers.get(O);W.has(O)&&!(H&&H.state==="loading"&&ke.has(O))&&$n(O),J.delete(O),ke.delete(O),k.delete(O),ce.delete(O),R.delete(O),E.fetchers.delete(O)}function Uf(O){let H=(oe.get(O)||0)-1;H<=0?(oe.delete(O),ce.add(O)):oe.set(O,H),Yt({fetchers:new Map(E.fetchers)})}function $n(O,H){let G=W.get(O);G&&(G.abort(H),W.delete(O))}function An(O){for(let H of O){let G=Wc(H),re=$i(G.data);E.fetchers.set(H,re)}}function Pa(){let O=[],H=!1;for(let G of k){let re=E.fetchers.get(G);Ye(re,`Expected fetcher: ${G}`),re.state==="loading"&&(k.delete(G),O.push(G),H=!0)}return An(O),H}function Mn(O){let H=[];for(let[G,re]of ke)if(re<O){let ue=E.fetchers.get(G);Ye(ue,`Expected fetcher: ${G}`),ue.state==="loading"&&($n(G),ke.delete(G),H.push(G))}return An(H),H.length>0}function Bf(O,H){let G=E.blockers.get(O)||Hl;return $e.get(O)!==H&&$e.set(O,H),G}function Zc(O){E.blockers.delete(O),$e.delete(O)}function vs(O,H){let G=E.blockers.get(O)||Hl;Ye(G.state==="unblocked"&&H.state==="blocked"||G.state==="blocked"&&H.state==="blocked"||G.state==="blocked"&&H.state==="proceeding"||G.state==="blocked"&&H.state==="unblocked"||G.state==="proceeding"&&H.state==="unblocked",`Invalid blocker state transition: ${G.state} -> ${H.state}`);let re=new Map(E.blockers);re.set(O,H),Yt({blockers:re})}function Ir({currentLocation:O,nextLocation:H,historyAction:G}){if($e.size===0)return;$e.size>1&&Kt(!1,"A router only supports one blocker at a time");let re=Array.from($e.entries()),[ue,Ee]=re[re.length-1],Ae=E.blockers.get(ue);if(!(Ae&&Ae.state==="proceeding")&&Ee({currentLocation:O,nextLocation:H,historyAction:G}))return ue}function Bi(O){let H=ja(404,{pathname:O}),G=h||d,{matches:re,route:ue}=bd(G);return{notFoundMatches:re,route:ue,error:H}}function bs(O,H,G){if(w=O,M=H,N=G||null,!A&&E.navigation===xp){A=!0;let re=Fi(E.location,E.matches);re!=null&&Yt({restoreScrollPosition:re})}return()=>{w=null,M=null,N=null}}function Wa(O,H){return N&&N(O,H.map(re=>w$(re,E.loaderData)))||O.key}function Ss(O,H){if(w&&M){let G=Wa(O,H);w[G]=M()}}function Fi(O,H){if(w){let G=Wa(O,H),re=w[G];if(typeof re=="number")return re}return null}function xs(O,H,G){if(e.patchRoutesOnNavigation)if(O){if(Object.keys(O[0].params).length>0)return{active:!0,matches:tc(H,G,m,!0)}}else return{active:!0,matches:tc(H,G,m,!0)||[]};return{active:!1,matches:null}}async function zr(O,H,G,re){if(!e.patchRoutesOnNavigation)return{type:"success",matches:O};let ue=O;for(;;){let Ee=h==null,Ae=h||d,ve=c;try{await e.patchRoutesOnNavigation({signal:G,path:H,matches:ue,fetcherKey:re,patch:(De,Te)=>{G.aborted||wx(De,Te,Ae,ve,l,!1)}})}catch(De){return{type:"error",error:De,partialMatches:ue}}finally{Ee&&!G.aborted&&(d=[...d])}if(G.aborted)return{type:"aborted"};let me=br(Ae,H,m),be=null;if(me){if(Object.keys(me[0].params).length===0)return{type:"success",matches:me};if(be=tc(Ae,H,m,!0),!(be&&ue.length<be.length&&ws(ue,be.slice(0,ue.length))))return{type:"success",matches:me}}if(be||(be=tc(Ae,H,m,!0)),!be||ws(ue,be))return{type:"success",matches:null};ue=be}}function ws(O,H){return O.length===H.length&&O.every((G,re)=>G.route.id===H[re].route.id)}function _r(O){c={},h=Sc(O,l,void 0,c)}function Ff(O,H,G=!1){let re=h==null;wx(O,H,h||d,c,l,G),re&&(d=[...d],Yt({}))}return P={get basename(){return m},get future(){return v},get state(){return E},get routes(){return d},get window(){return t},initialize:mn,subscribe:Pr,enableScrollRestoration:bs,navigate:Fo,fetch:Ko,revalidate:hi,createHref:O=>e.history.createHref(O),encodeLocation:O=>e.history.encodeLocation(O),getFetcher:Wc,resetFetcher:Qc,deleteFetcher:Uf,dispose:Mt,getBlocker:Bf,deleteBlocker:Zc,patchRoutes:Ff,_internalFetchControllers:W,_internalSetRoutes:_r,_internalSetStateDoNotUseOrYouWillBreakYourApp(O){Yt(O)}},e.unstable_instrumentations&&(P=F$(P,e.unstable_instrumentations.map(O=>O.router).filter(Boolean))),P}function tO(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function Jp(e,t,n,i,s,l){let c,d;if(s){c=[];for(let m of t)if(c.push(m),m.route.id===s){d=m;break}}else c=t,d=t[t.length-1];let h=Vg(i||".",qg(c),Oa(e.pathname,n)||e.pathname,l==="path");if(i==null&&(h.search=e.search,h.hash=e.hash),(i==null||i===""||i===".")&&d){let m=Yg(h.search);if(d.route.index&&!m)h.search=h.search?h.search.replace(/^\?/,"?index&"):"?index";else if(!d.route.index&&m){let y=new URLSearchParams(h.search),v=y.getAll("index");y.delete("index"),v.filter(D=>D).forEach(D=>y.append("index",D));let b=y.toString();h.search=b?`?${b}`:""}}return n!=="/"&&(h.pathname=L$({basename:n,pathname:h.pathname})),li(h)}function Sx(e,t,n){if(!n||!tO(n))return{path:t};if(n.formMethod&&!yO(n.formMethod))return{path:t,error:ja(405,{method:n.formMethod})};let i=()=>({path:t,error:ja(400,{type:"invalid-body"})}),l=(n.formMethod||"get").toUpperCase(),c=cN(t);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!zn(l))return i();let v=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((b,[D,w])=>`${b}${D}=${w}
|
|
15
|
-
`,""):String(n.body);return{path:t,submission:{formMethod:l,formAction:c,formEncType:n.formEncType,formData:void 0,json:void 0,text:v}}}else if(n.formEncType==="application/json"){if(!zn(l))return i();try{let v=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:l,formAction:c,formEncType:n.formEncType,formData:void 0,json:v,text:void 0}}}catch{return i()}}}Ye(typeof FormData=="function","FormData is not available in this environment");let d,h;if(n.formData)d=Qp(n.formData),h=n.formData;else if(n.body instanceof FormData)d=Qp(n.body),h=n.body;else if(n.body instanceof URLSearchParams)d=n.body,h=Ax(d);else if(n.body==null)d=new URLSearchParams,h=new FormData;else try{d=new URLSearchParams(n.body),h=Ax(d)}catch{return i()}let m={formMethod:l,formAction:c,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:h,json:void 0,text:void 0};if(zn(m.formMethod))return{path:t,submission:m};let y=jr(t);return e&&y.search&&Yg(y.search)&&d.append("index",""),y.search=`?${d}`,{path:li(y),submission:m}}function xx(e,t,n,i,s,l,c,d,h,m,y,v,b,D,w,N,M,A,T,j){let F=j?ma(j[1])?j[1].error:j[1].data:void 0,z=s.createURL(l.location),P=s.createURL(h),E;if(y&&l.errors){let Q=Object.keys(l.errors)[0];E=c.findIndex(ie=>ie.route.id===Q)}else if(j&&ma(j[1])){let Q=j[0];E=c.findIndex(ie=>ie.route.id===Q)-1}let L=j?j[1].statusCode:void 0,_=L&&L>=400,Y={currentUrl:z,currentParams:l.matches[0]?.params||{},nextUrl:P,nextParams:c[0].params,...d,actionResult:F,actionStatus:L},Z=Kg(c.map(Q=>Q.route.path)),U=c.map((Q,ie)=>{let{route:R}=Q,W=null;if(E!=null&&ie>E?W=!1:R.lazy?W=!0:Gg(R)?y?W=Xp(R,l.loaderData,l.errors):nO(l.loaderData,l.matches[ie],Q)&&(W=!0):W=!1,W!==null)return Wp(n,i,e,Z,Q,m,t,W);let se=_?!1:v||z.pathname+z.search===P.pathname+P.search||z.search!==P.search||aO(l.matches[ie],Q),ye={...Y,defaultShouldRevalidate:se},ke=Xd(Q,ye);return Wp(n,i,e,Z,Q,m,t,ke,ye)}),ae=[];return w.forEach((Q,ie)=>{if(y||!c.some(oe=>oe.route.id===Q.routeId)||D.has(ie))return;let R=l.fetchers.get(ie),W=R&&R.state!=="idle"&&R.data===void 0,se=br(M,Q.path,A);if(!se){if(T&&W)return;ae.push({key:ie,routeId:Q.routeId,path:Q.path,matches:null,match:null,request:null,controller:null});return}if(N.has(ie))return;let ye=$d(se,Q.path),ke=new AbortController,k=mo(s,Q.path,ke.signal),J=null;if(b.has(ie))b.delete(ie),J=xo(n,i,k,se,ye,m,t);else if(W)v&&(J=xo(n,i,k,se,ye,m,t));else{let oe={...Y,defaultShouldRevalidate:_?!1:v};Xd(ye,oe)&&(J=xo(n,i,k,se,ye,m,t,oe))}J&&ae.push({key:ie,routeId:Q.routeId,path:Q.path,matches:J,match:ye,request:k,controller:ke})}),{dsMatches:U,revalidatingFetchers:ae}}function Gg(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function Xp(e,t,n){if(e.lazy)return!0;if(!Gg(e))return!1;let i=t!=null&&e.id in t,s=n!=null&&n[e.id]!==void 0;return!i&&s?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!i&&!s}function nO(e,t,n){let i=!t||n.route.id!==t.route.id,s=!e.hasOwnProperty(n.route.id);return i||s}function aO(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function Xd(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function wx(e,t,n,i,s,l){let c;if(e){let m=i[e];Ye(m,`No route found to patch children into: routeId = ${e}`),m.children||(m.children=[]),c=m.children}else c=n;let d=[],h=[];if(t.forEach(m=>{let y=c.find(v=>iN(m,v));y?h.push({existingRoute:y,newRoute:m}):d.push(m)}),d.length>0){let m=Sc(d,s,[e||"_","patch",String(c?.length||"0")],i);c.push(...m)}if(l&&h.length>0)for(let m=0;m<h.length;m++){let{existingRoute:y,newRoute:v}=h[m],b=y,[D]=Sc([v],s,[],{},!0);Object.assign(b,{element:D.element?D.element:b.element,errorElement:D.errorElement?D.errorElement:b.errorElement,hydrateFallbackElement:D.hydrateFallbackElement?D.hydrateFallbackElement:b.hydrateFallbackElement})}}function iN(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,i)=>t.children?.some(s=>iN(n,s))):!1}var Dx=new WeakMap,rN=({key:e,route:t,manifest:n,mapRouteProperties:i})=>{let s=n[t.id];if(Ye(s,"No route found in manifest"),!s.lazy||typeof s.lazy!="object")return;let l=s.lazy[e];if(!l)return;let c=Dx.get(s);c||(c={},Dx.set(s,c));let d=c[e];if(d)return d;let h=(async()=>{let m=v$(e),v=s[e]!==void 0&&e!=="hasErrorBoundary";if(m)Kt(!m,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),c[e]=Promise.resolve();else if(v)Kt(!1,`Route "${s.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let b=await l();b!=null&&(Object.assign(s,{[e]:b}),Object.assign(s,i(s)))}typeof s.lazy=="object"&&(s.lazy[e]=void 0,Object.values(s.lazy).every(b=>b===void 0)&&(s.lazy=void 0))})();return c[e]=h,h},Nx=new WeakMap;function iO(e,t,n,i,s){let l=n[e.id];if(Ye(l,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let y=Nx.get(l);if(y)return{lazyRoutePromise:y,lazyHandlerPromise:y};let v=(async()=>{Ye(typeof e.lazy=="function","No lazy route function found");let b=await e.lazy(),D={};for(let w in b){let N=b[w];if(N===void 0)continue;let M=S$(w),T=l[w]!==void 0&&w!=="hasErrorBoundary";M?Kt(!M,"Route property "+w+" is not a supported property to be returned from a lazy route function. This property will be ignored."):T?Kt(!T,`Route "${l.id}" has a static property "${w}" defined but its lazy function is also returning a value for this property. The lazy route property "${w}" will be ignored.`):D[w]=N}Object.assign(l,D),Object.assign(l,{...i(l),lazy:void 0})})();return Nx.set(l,v),v.catch(()=>{}),{lazyRoutePromise:v,lazyHandlerPromise:v}}let c=Object.keys(e.lazy),d=[],h;for(let y of c){if(s&&s.includes(y))continue;let v=rN({key:y,route:e,manifest:n,mapRouteProperties:i});v&&(d.push(v),y===t&&(h=v))}let m=d.length>0?Promise.all(d).then(()=>{}):void 0;return m?.catch(()=>{}),h?.catch(()=>{}),{lazyRoutePromise:m,lazyHandlerPromise:h}}async function Cx(e){let t=e.matches.filter(s=>s.shouldLoad),n={};return(await Promise.all(t.map(s=>s.resolve()))).forEach((s,l)=>{n[t[l].route.id]=s}),n}async function rO(e){return e.matches.some(t=>t.route.middleware)?sN(e,()=>Cx(e)):Cx(e)}function sN(e,t){return sO(e,t,i=>i,mO,n);function n(i,s,l){if(l)return Promise.resolve(Object.assign(l.value,{[s]:{type:"error",result:i}}));{let{matches:c}=e,d=Math.min(Math.max(c.findIndex(m=>m.route.id===s),0),Math.max(c.findIndex(m=>m.unstable_shouldCallHandler()),0)),h=Sr(c,c[d].route.id).route.id;return Promise.resolve({[h]:{type:"error",result:i}})}}}async function sO(e,t,n,i,s){let{matches:l,request:c,params:d,context:h,unstable_pattern:m}=e,y=l.flatMap(b=>b.route.middleware?b.route.middleware.map(D=>[b.route.id,D]):[]);return await oN({request:c,params:d,context:h,unstable_pattern:m},y,t,n,i,s)}async function oN(e,t,n,i,s,l,c=0){let{request:d}=e;if(d.signal.aborted)throw d.signal.reason??new Error(`Request aborted: ${d.method} ${d.url}`);let h=t[c];if(!h)return await n();let[m,y]=h,v,b=async()=>{if(v)throw new Error("You may only call `next()` once per middleware");try{return v={value:await oN(e,t,n,i,s,l,c+1)},v.value}catch(D){return v={value:await l(D,m,v)},v.value}};try{let D=await y(e,b),w=D!=null?i(D):void 0;return s(w)?w:v?w??v.value:(v={value:await b()},v.value)}catch(D){return await l(D,m,v)}}function lN(e,t,n,i,s){let l=rN({key:"middleware",route:i.route,manifest:t,mapRouteProperties:e}),c=iO(i.route,zn(n.method)?"action":"loader",t,e,s);return{middleware:l,route:c.lazyRoutePromise,handler:c.lazyHandlerPromise}}function Wp(e,t,n,i,s,l,c,d,h=null){let m=!1,y=lN(e,t,n,s,l);return{...s,_lazyPromises:y,shouldLoad:d,unstable_shouldRevalidateArgs:h,unstable_shouldCallHandler(v){return m=!0,h?typeof v=="boolean"?Xd(s,{...h,defaultShouldRevalidate:v}):Xd(s,h):d},resolve(v){let{lazy:b,loader:D,middleware:w}=s.route,N=m||d||v&&!zn(n.method)&&(b||D),M=w&&w.length>0&&!D&&!b;return N&&(zn(n.method)||!M)?lO({request:n,unstable_pattern:i,match:s,lazyHandlerPromise:y?.handler,lazyRoutePromise:y?.route,handlerOverride:v,scopedContext:c}):Promise.resolve({type:"data",result:void 0})}}}function xo(e,t,n,i,s,l,c,d=null){return i.map(h=>h.route.id!==s.route.id?{...h,shouldLoad:!1,unstable_shouldRevalidateArgs:d,unstable_shouldCallHandler:()=>!1,_lazyPromises:lN(e,t,n,h,l),resolve:()=>Promise.resolve({type:"data",result:void 0})}:Wp(e,t,n,Kg(i.map(m=>m.route.path)),h,l,c,!0,d))}async function oO(e,t,n,i,s,l){n.some(m=>m._lazyPromises?.middleware)&&await Promise.all(n.map(m=>m._lazyPromises?.middleware));let c={request:t,unstable_pattern:Kg(n.map(m=>m.route.path)),params:n[0].params,context:s,matches:n},h=await e({...c,fetcherKey:i,runClientMiddleware:m=>{let y=c;return sN(y,()=>m({...y,fetcherKey:i,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(n.flatMap(m=>[m._lazyPromises?.handler,m._lazyPromises?.route]))}catch{}return h}async function lO({request:e,unstable_pattern:t,match:n,lazyHandlerPromise:i,lazyRoutePromise:s,handlerOverride:l,scopedContext:c}){let d,h,m=zn(e.method),y=m?"action":"loader",v=b=>{let D,w=new Promise((A,T)=>D=T);h=()=>D(),e.signal.addEventListener("abort",h);let N=A=>typeof b!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${y}" [routeId: ${n.route.id}]`)):b({request:e,unstable_pattern:t,params:n.params,context:c},...A!==void 0?[A]:[]),M=(async()=>{try{return{type:"data",result:await(l?l(T=>N(T)):N())}}catch(A){return{type:"error",result:A}}})();return Promise.race([M,w])};try{let b=m?n.route.action:n.route.loader;if(i||s)if(b){let D,[w]=await Promise.all([v(b).catch(N=>{D=N}),i,s]);if(D!==void 0)throw D;d=w}else{await i;let D=m?n.route.action:n.route.loader;if(D)[d]=await Promise.all([v(D),s]);else if(y==="action"){let w=new URL(e.url),N=w.pathname+w.search;throw ja(405,{method:e.method,pathname:N,routeId:n.route.id})}else return{type:"data",result:void 0}}else if(b)d=await v(b);else{let D=new URL(e.url),w=D.pathname+D.search;throw ja(404,{pathname:w})}}catch(b){return{type:"error",result:b}}finally{h&&e.signal.removeEventListener("abort",h)}return d}async function cO(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 uO(e){let{result:t,type:n}=e;if(uN(t)){let i;try{i=await cO(t)}catch(s){return{type:"error",error:s}}return n==="error"?{type:"error",error:new Jd(t.status,t.statusText,i),statusCode:t.status,headers:t.headers}:{type:"data",data:i,statusCode:t.status,headers:t.headers}}return n==="error"?kx(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 Jd(t.init?.status||500,void 0,t.data),statusCode:Ar(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:Ar(t)?t.status:void 0}:kx(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 dO(e,t,n,i,s){let l=e.headers.get("Location");if(Ye(l,"Redirects returned/thrown from loaders/actions must have a Location header"),!bf(l)){let c=i.slice(0,i.findIndex(d=>d.route.id===n)+1);l=Jp(new URL(t.url),c,s,l),e.headers.set("Location",l)}return e}function Ex(e,t,n){if(bf(e)){let i=e,s=i.startsWith("//")?new URL(t.protocol+i):new URL(i),l=Oa(s.pathname,n)!=null;if(s.origin===t.origin&&l)return s.pathname+s.search+s.hash}return e}function mo(e,t,n,i){let s=e.createURL(cN(t)).toString(),l={signal:n};if(i&&zn(i.formMethod)){let{formMethod:c,formEncType:d}=i;l.method=c.toUpperCase(),d==="application/json"?(l.headers=new Headers({"Content-Type":d}),l.body=JSON.stringify(i.json)):d==="text/plain"?l.body=i.text:d==="application/x-www-form-urlencoded"&&i.formData?l.body=Qp(i.formData):l.body=i.formData}return new Request(s,l)}function Qp(e){let t=new URLSearchParams;for(let[n,i]of e.entries())t.append(n,typeof i=="string"?i:i.name);return t}function Ax(e){let t=new FormData;for(let[n,i]of e.entries())t.append(n,i);return t}function fO(e,t,n,i=!1,s=!1){let l={},c=null,d,h=!1,m={},y=n&&ma(n[1])?n[1].error:void 0;return e.forEach(v=>{if(!(v.route.id in t))return;let b=v.route.id,D=t[b];if(Ye(!os(D),"Cannot handle redirect results in processLoaderData"),ma(D)){let w=D.error;if(y!==void 0&&(w=y,y=void 0),c=c||{},s)c[b]=w;else{let N=Sr(e,b);c[N.route.id]==null&&(c[N.route.id]=w)}i||(l[b]=aN),h||(h=!0,d=Ar(D.error)?D.error.status:500),D.headers&&(m[b]=D.headers)}else l[b]=D.data,D.statusCode&&D.statusCode!==200&&!h&&(d=D.statusCode),D.headers&&(m[b]=D.headers)}),y!==void 0&&n&&(c={[n[0]]:y},n[2]&&(l[n[2]]=void 0)),{loaderData:l,errors:c,statusCode:d||200,loaderHeaders:m}}function Mx(e,t,n,i,s,l){let{loaderData:c,errors:d}=fO(t,n,i);return s.filter(h=>!h.matches||h.matches.some(m=>m.shouldLoad)).forEach(h=>{let{key:m,match:y,controller:v}=h;if(v&&v.signal.aborted)return;let b=l[m];if(Ye(b,"Did not find corresponding fetcher result"),ma(b)){let D=Sr(e.matches,y?.route.id);d&&d[D.route.id]||(d={...d,[D.route.id]:b.error}),e.fetchers.delete(m)}else if(os(b))Ye(!1,"Unhandled fetcher revalidation redirect");else{let D=$i(b.data);e.fetchers.set(m,D)}}),{loaderData:c,errors:d}}function Tx(e,t,n,i){let s=Object.entries(t).filter(([,l])=>l!==aN).reduce((l,[c,d])=>(l[c]=d,l),{});for(let l of n){let c=l.route.id;if(!t.hasOwnProperty(c)&&e.hasOwnProperty(c)&&l.route.loader&&(s[c]=e[c]),i&&i.hasOwnProperty(c))break}return s}function jx(e){return e?ma(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Sr(e,t){return(t?e.slice(0,e.findIndex(i=>i.route.id===t)+1):[...e]).reverse().find(i=>i.route.hasErrorBoundary===!0)||e[0]}function bd(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 ja(e,{pathname:t,routeId:n,method:i,type:s,message:l}={}){let c="Unknown Server Error",d="Unknown @remix-run/router error";return e===400?(c="Bad Request",i&&t&&n?d=`You made a ${i} request to "${t}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:s==="invalid-body"&&(d="Unable to encode submission body")):e===403?(c="Forbidden",d=`Route "${n}" does not match URL "${t}"`):e===404?(c="Not Found",d=`No route matches URL "${t}"`):e===405&&(c="Method Not Allowed",i&&t&&n?d=`You made a ${i.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:i&&(d=`Invalid request method "${i.toUpperCase()}"`)),new Jd(e||500,c,new Error(d),!0)}function Sd(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[i,s]=t[n];if(os(s))return{key:i,result:s}}}function cN(e){let t=typeof e=="string"?jr(e):e;return li({...t,hash:""})}function hO(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function mO(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([t,n])=>typeof t=="string"&&pO(n))}function pO(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function gO(e){return uN(e.result)&&X$.has(e.result.status)}function ma(e){return e.type==="error"}function os(e){return(e&&e.type)==="redirect"}function kx(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function uN(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function yO(e){return J$.has(e.toUpperCase())}function zn(e){return G$.has(e.toUpperCase())}function Yg(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function $d(e,t){let n=typeof t=="string"?jr(t).search:t.search;if(e[e.length-1].route.index&&Yg(n||""))return e[e.length-1];let i=ZD(e);return i[i.length-1]}function $x(e){let{formMethod:t,formAction:n,formEncType:i,text:s,formData:l,json:c}=e;if(!(!t||!n||!i)){if(s!=null)return{formMethod:t,formAction:n,formEncType:i,formData:void 0,json:void 0,text:s};if(l!=null)return{formMethod:t,formAction:n,formEncType:i,formData:l,json:void 0,text:void 0};if(c!==void 0)return{formMethod:t,formAction:n,formEncType:i,formData:void 0,json:c,text:void 0}}}function wp(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 vO(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 ql(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 bO(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 $i(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 SO(e,t){try{let n=e.sessionStorage.getItem(nN);if(n){let i=JSON.parse(n);for(let[s,l]of Object.entries(i||{}))l&&Array.isArray(l)&&t.set(s,new Set(l||[]))}}catch{}}function xO(e,t){if(t.size>0){let n={};for(let[i,s]of t)n[i]=[...s];try{e.sessionStorage.setItem(nN,JSON.stringify(n))}catch(i){Kt(!1,`Failed to save applied view transitions in sessionStorage (${i}).`)}}}function wO(){let e,t,n=new Promise((i,s)=>{e=async l=>{i(l);try{await n}catch{}},t=async l=>{s(l);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var ms=S.createContext(null);ms.displayName="DataRouter";var Oc=S.createContext(null);Oc.displayName="DataRouterState";S.createContext(!1);var Jg=S.createContext({isTransitioning:!1});Jg.displayName="ViewTransition";var dN=S.createContext(new Map);dN.displayName="Fetchers";var DO=S.createContext(null);DO.displayName="Await";var ui=S.createContext(null);ui.displayName="Navigation";var Sf=S.createContext(null);Sf.displayName="Location";var Ga=S.createContext({outlet:null,matches:[],isDataRoute:!1});Ga.displayName="Route";var Xg=S.createContext(null);Xg.displayName="RouteError";function NO(e,{relative:t}={}){Ye(Rc(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:i}=S.useContext(ui),{hash:s,pathname:l,search:c}=Lc(e,{relative:t}),d=l;return n!=="/"&&(d=l==="/"?n:si([n,l])),i.createHref({pathname:d,search:c,hash:s})}function Rc(){return S.useContext(Sf)!=null}function Ra(){return Ye(Rc(),"useLocation() may be used only in the context of a <Router> component."),S.useContext(Sf).location}var fN="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function hN(e){S.useContext(ui).static||S.useLayoutEffect(e)}function xf(){let{isDataRoute:e}=S.useContext(Ga);return e?zO():CO()}function CO(){Ye(Rc(),"useNavigate() may be used only in the context of a <Router> component.");let e=S.useContext(ms),{basename:t,navigator:n}=S.useContext(ui),{matches:i}=S.useContext(Ga),{pathname:s}=Ra(),l=JSON.stringify(qg(i)),c=S.useRef(!1);return hN(()=>{c.current=!0}),S.useCallback((h,m={})=>{if(Kt(c.current,fN),!c.current)return;if(typeof h=="number"){n.go(h);return}let y=Vg(h,JSON.parse(l),s,m.relative==="path");e==null&&t!=="/"&&(y.pathname=y.pathname==="/"?t:si([t,y.pathname])),(m.replace?n.replace:n.push)(y,m.state,m)},[t,n,l,s,e])}var EO=S.createContext(null);function AO(e){let t=S.useContext(Ga).outlet;return S.useMemo(()=>t&&S.createElement(EO.Provider,{value:e},t),[t,e])}function Wg(){let{matches:e}=S.useContext(Ga),t=e[e.length-1];return t?t.params:{}}function Lc(e,{relative:t}={}){let{matches:n}=S.useContext(Ga),{pathname:i}=Ra(),s=JSON.stringify(qg(n));return S.useMemo(()=>Vg(e,JSON.parse(s),i,t==="path"),[e,s,i,t])}function MO(e,t,n,i,s){Ye(Rc(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:l}=S.useContext(ui),{matches:c}=S.useContext(Ga),d=c[c.length-1],h=d?d.params:{},m=d?d.pathname:"/",y=d?d.pathnameBase:"/",v=d&&d.route;{let T=v&&v.path||"";pN(m,!v||T.endsWith("*")||T.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${m}" (under <Route path="${T}">) 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.
|
|
16
|
-
|
|
17
|
-
Please change the parent <Route path="${T}"> to <Route path="${T==="/"?"*":`${T}/*`}">.`)}let b=Ra(),D;D=b;let w=D.pathname||"/",N=w;if(y!=="/"){let T=y.replace(/^\//,"").split("/");N="/"+w.replace(/^\//,"").split("/").slice(T.length).join("/")}let M=br(e,{pathname:N});return Kt(v||M!=null,`No routes matched location "${D.pathname}${D.search}${D.hash}" `),Kt(M==null||M[M.length-1].route.element!==void 0||M[M.length-1].route.Component!==void 0||M[M.length-1].route.lazy!==void 0,`Matched leaf route at location "${D.pathname}${D.search}${D.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.`),OO(M&&M.map(T=>Object.assign({},T,{params:Object.assign({},h,T.params),pathname:si([y,l.encodeLocation?l.encodeLocation(T.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:T.pathname]),pathnameBase:T.pathnameBase==="/"?y:si([y,l.encodeLocation?l.encodeLocation(T.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:T.pathnameBase])})),c,n,i,s)}function TO(){let e=mN(),t=Ar(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i="rgba(200,200,200, 0.5)",s={padding:"0.5rem",backgroundColor:i},l={padding:"2px 4px",backgroundColor:i},c=null;return console.error("Error handled by React Router default ErrorBoundary:",e),c=S.createElement(S.Fragment,null,S.createElement("p",null,"💿 Hey developer 👋"),S.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",S.createElement("code",{style:l},"ErrorBoundary")," or"," ",S.createElement("code",{style:l},"errorElement")," prop on your route.")),S.createElement(S.Fragment,null,S.createElement("h2",null,"Unexpected Application Error!"),S.createElement("h3",{style:{fontStyle:"italic"}},t),n?S.createElement("pre",{style:s},n):null,c)}var jO=S.createElement(TO,null),kO=class extends S.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.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){return this.state.error!==void 0?S.createElement(Ga.Provider,{value:this.props.routeContext},S.createElement(Xg.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function $O({routeContext:e,match:t,children:n}){let i=S.useContext(ms);return i&&i.static&&i.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=t.route.id),S.createElement(Ga.Provider,{value:e},n)}function OO(e,t=[],n=null,i=null,s=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 l=e,c=n?.errors;if(c!=null){let y=l.findIndex(v=>v.route.id&&c?.[v.route.id]!==void 0);Ye(y>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(c).join(",")}`),l=l.slice(0,Math.min(l.length,y+1))}let d=!1,h=-1;if(n)for(let y=0;y<l.length;y++){let v=l[y];if((v.route.HydrateFallback||v.route.hydrateFallbackElement)&&(h=y),v.route.id){let{loaderData:b,errors:D}=n,w=v.route.loader&&!b.hasOwnProperty(v.route.id)&&(!D||D[v.route.id]===void 0);if(v.route.lazy||w){d=!0,h>=0?l=l.slice(0,h+1):l=[l[0]];break}}}let m=n&&i?(y,v)=>{i(y,{location:n.location,params:n.matches?.[0]?.params??{},errorInfo:v})}:void 0;return l.reduceRight((y,v,b)=>{let D,w=!1,N=null,M=null;n&&(D=c&&v.route.id?c[v.route.id]:void 0,N=v.route.errorElement||jO,d&&(h<0&&b===0?(pN("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),w=!0,M=null):h===b&&(w=!0,M=v.route.hydrateFallbackElement||null)));let A=t.concat(l.slice(0,b+1)),T=()=>{let j;return D?j=N:w?j=M:v.route.Component?j=S.createElement(v.route.Component,null):v.route.element?j=v.route.element:j=y,S.createElement($O,{match:v,routeContext:{outlet:y,matches:A,isDataRoute:n!=null},children:j})};return n&&(v.route.ErrorBoundary||v.route.errorElement||b===0)?S.createElement(kO,{location:n.location,revalidation:n.revalidation,component:N,error:D,children:T(),routeContext:{outlet:null,matches:A,isDataRoute:!0},onError:m}):T()},null)}function Qg(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function RO(e){let t=S.useContext(ms);return Ye(t,Qg(e)),t}function LO(e){let t=S.useContext(Oc);return Ye(t,Qg(e)),t}function PO(e){let t=S.useContext(Ga);return Ye(t,Qg(e)),t}function Zg(e){let t=PO(e),n=t.matches[t.matches.length-1];return Ye(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function IO(){return Zg("useRouteId")}function mN(){let e=S.useContext(Xg),t=LO("useRouteError"),n=Zg("useRouteError");return e!==void 0?e:t.errors?.[n]}function zO(){let{router:e}=RO("useNavigate"),t=Zg("useNavigate"),n=S.useRef(!1);return hN(()=>{n.current=!0}),S.useCallback(async(s,l={})=>{Kt(n.current,fN),n.current&&(typeof s=="number"?e.navigate(s):await e.navigate(s,{fromRouteId:t,...l}))},[e,t])}var Ox={};function pN(e,t,n){!t&&!Ox[e]&&(Ox[e]=!0,Kt(!1,n))}var Rx={};function Lx(e,t){!e&&!Rx[t]&&(Rx[t]=!0,console.warn(t))}function _O(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&Kt(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:S.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&Kt(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:S.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&Kt(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:S.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var UO=["HydrateFallback","hydrateFallbackElement"],BO=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 FO({router:e,flushSync:t,unstable_onError:n}){let[i,s]=S.useState(e.state),[l,c]=S.useState(),[d,h]=S.useState({isTransitioning:!1}),[m,y]=S.useState(),[v,b]=S.useState(),[D,w]=S.useState(),N=S.useRef(new Map),M=S.useCallback(z=>{s(P=>(z.errors&&n&&Object.entries(z.errors).forEach(([E,L])=>{P.errors?.[E]!==L&&n(L,{location:z.location,params:z.matches[0]?.params??{}})}),z))},[n]),A=S.useCallback((z,{deletedFetchers:P,flushSync:E,viewTransitionOpts:L})=>{z.fetchers.forEach((Y,Z)=>{Y.data!==void 0&&N.current.set(Z,Y.data)}),P.forEach(Y=>N.current.delete(Y)),Lx(E===!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 _=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(Lx(L==null||_,"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."),!L||!_){t&&E?t(()=>M(z)):S.startTransition(()=>M(z));return}if(t&&E){t(()=>{v&&(m&&m.resolve(),v.skipTransition()),h({isTransitioning:!0,flushSync:!0,currentLocation:L.currentLocation,nextLocation:L.nextLocation})});let Y=e.window.document.startViewTransition(()=>{t(()=>M(z))});Y.finished.finally(()=>{t(()=>{y(void 0),b(void 0),c(void 0),h({isTransitioning:!1})})}),t(()=>b(Y));return}v?(m&&m.resolve(),v.skipTransition(),w({state:z,currentLocation:L.currentLocation,nextLocation:L.nextLocation})):(c(z),h({isTransitioning:!0,flushSync:!1,currentLocation:L.currentLocation,nextLocation:L.nextLocation}))},[e.window,t,v,m,M]);S.useLayoutEffect(()=>e.subscribe(A),[e,A]),S.useEffect(()=>{d.isTransitioning&&!d.flushSync&&y(new BO)},[d]),S.useEffect(()=>{if(m&&l&&e.window){let z=l,P=m.promise,E=e.window.document.startViewTransition(async()=>{S.startTransition(()=>M(z)),await P});E.finished.finally(()=>{y(void 0),b(void 0),c(void 0),h({isTransitioning:!1})}),b(E)}},[l,m,e.window,M]),S.useEffect(()=>{m&&l&&i.location.key===l.location.key&&m.resolve()},[m,v,i.location,l]),S.useEffect(()=>{!d.isTransitioning&&D&&(c(D.state),h({isTransitioning:!0,flushSync:!1,currentLocation:D.currentLocation,nextLocation:D.nextLocation}),w(void 0))},[d.isTransitioning,D]);let T=S.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:z=>e.navigate(z),push:(z,P,E)=>e.navigate(z,{state:P,preventScrollReset:E?.preventScrollReset}),replace:(z,P,E)=>e.navigate(z,{replace:!0,state:P,preventScrollReset:E?.preventScrollReset})}),[e]),j=e.basename||"/",F=S.useMemo(()=>({router:e,navigator:T,static:!1,basename:j,unstable_onError:n}),[e,T,j,n]);return S.createElement(S.Fragment,null,S.createElement(ms.Provider,{value:F},S.createElement(Oc.Provider,{value:i},S.createElement(dN.Provider,{value:N.current},S.createElement(Jg.Provider,{value:d},S.createElement(KO,{basename:j,location:i.location,navigationType:i.historyAction,navigator:T},S.createElement(HO,{routes:e.routes,future:e.future,state:i,unstable_onError:n})))))),null)}var HO=S.memo(qO);function qO({routes:e,future:t,state:n,unstable_onError:i}){return MO(e,void 0,n,i,t)}function VO(e){return AO(e.context)}function KO({basename:e="/",children:t=null,location:n,navigationType:i="POP",navigator:s,static:l=!1}){Ye(!Rc(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let c=e.replace(/^\/*/,"/"),d=S.useMemo(()=>({basename:c,navigator:s,static:l,future:{}}),[c,s,l]);typeof n=="string"&&(n=jr(n));let{pathname:h="/",search:m="",hash:y="",state:v=null,key:b="default"}=n,D=S.useMemo(()=>{let w=Oa(h,c);return w==null?null:{location:{pathname:w,search:m,hash:y,state:v,key:b},navigationType:i}},[c,h,m,y,v,b,i]);return Kt(D!=null,`<Router basename="${c}"> is not able to match the URL "${h}${m}${y}" because it does not start with the basename, so the <Router> won't render anything.`),D==null?null:S.createElement(ui.Provider,{value:d},S.createElement(Sf.Provider,{children:t,value:D}))}var Od="get",Rd="application/x-www-form-urlencoded";function wf(e){return e!=null&&typeof e.tagName=="string"}function GO(e){return wf(e)&&e.tagName.toLowerCase()==="button"}function YO(e){return wf(e)&&e.tagName.toLowerCase()==="form"}function JO(e){return wf(e)&&e.tagName.toLowerCase()==="input"}function XO(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function WO(e,t){return e.button===0&&(!t||t==="_self")&&!XO(e)}function Zp(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let i=e[n];return t.concat(Array.isArray(i)?i.map(s=>[n,s]):[[n,i]])},[]))}function QO(e,t){let n=Zp(e);return t&&t.forEach((i,s)=>{n.has(s)||t.getAll(s).forEach(l=>{n.append(s,l)})}),n}var xd=null;function ZO(){if(xd===null)try{new FormData(document.createElement("form"),0),xd=!1}catch{xd=!0}return xd}var eR=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Dp(e){return e!=null&&!eR.has(e)?(Kt(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Rd}"`),null):e}function tR(e,t){let n,i,s,l,c;if(YO(e)){let d=e.getAttribute("action");i=d?Oa(d,t):null,n=e.getAttribute("method")||Od,s=Dp(e.getAttribute("enctype"))||Rd,l=new FormData(e)}else if(GO(e)||JO(e)&&(e.type==="submit"||e.type==="image")){let d=e.form;if(d==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let h=e.getAttribute("formaction")||d.getAttribute("action");if(i=h?Oa(h,t):null,n=e.getAttribute("formmethod")||d.getAttribute("method")||Od,s=Dp(e.getAttribute("formenctype"))||Dp(d.getAttribute("enctype"))||Rd,l=new FormData(d,e),!ZO()){let{name:m,type:y,value:v}=e;if(y==="image"){let b=m?`${m}.`:"";l.append(`${b}x`,"0"),l.append(`${b}y`,"0")}else m&&l.append(m,v)}}else{if(wf(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Od,i=null,s=Rd,c=e}return l&&s==="text/plain"&&(c=l,l=void 0),{action:i,method:n.toLowerCase(),encType:s,formData:l,body:c}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function ey(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function nR(e,t,n){let i=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return i.pathname==="/"?i.pathname=`_root.${n}`:t&&Oa(i.pathname,t)==="/"?i.pathname=`${t.replace(/\/$/,"")}/_root.${n}`:i.pathname=`${i.pathname.replace(/\/$/,"")}.${n}`,i}async function aR(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 iR(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 rR(e,t,n){let i=await Promise.all(e.map(async s=>{let l=t.routes[s.route.id];if(l){let c=await aR(l,n);return c.links?c.links():[]}return[]}));return cR(i.flat(1).filter(iR).filter(s=>s.rel==="stylesheet"||s.rel==="preload").map(s=>s.rel==="stylesheet"?{...s,rel:"prefetch",as:"style"}:{...s,rel:"prefetch"}))}function Px(e,t,n,i,s,l){let c=(h,m)=>n[m]?h.route.id!==n[m].route.id:!0,d=(h,m)=>n[m].pathname!==h.pathname||n[m].route.path?.endsWith("*")&&n[m].params["*"]!==h.params["*"];return l==="assets"?t.filter((h,m)=>c(h,m)||d(h,m)):l==="data"?t.filter((h,m)=>{let y=i.routes[h.route.id];if(!y||!y.hasLoader)return!1;if(c(h,m)||d(h,m))return!0;if(h.route.shouldRevalidate){let v=h.route.shouldRevalidate({currentUrl:new URL(s.pathname+s.search+s.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:h.params,defaultShouldRevalidate:!0});if(typeof v=="boolean")return v}return!0}):[]}function sR(e,t,{includeHydrateFallback:n}={}){return oR(e.map(i=>{let s=t.routes[i.route.id];if(!s)return[];let l=[s.module];return s.clientActionModule&&(l=l.concat(s.clientActionModule)),s.clientLoaderModule&&(l=l.concat(s.clientLoaderModule)),n&&s.hydrateFallbackModule&&(l=l.concat(s.hydrateFallbackModule)),s.imports&&(l=l.concat(s.imports)),l}).flat(1))}function oR(e){return[...new Set(e)]}function lR(e){let t={},n=Object.keys(e).sort();for(let i of n)t[i]=e[i];return t}function cR(e,t){let n=new Set;return new Set(t),e.reduce((i,s)=>{let l=JSON.stringify(lR(s));return n.has(l)||(n.add(l),i.push({key:l,link:s})),i},[])}function gN(){let e=S.useContext(ms);return ey(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function uR(){let e=S.useContext(Oc);return ey(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var ty=S.createContext(void 0);ty.displayName="FrameworkContext";function yN(){let e=S.useContext(ty);return ey(e,"You must render this element inside a <HydratedRouter> element"),e}function dR(e,t){let n=S.useContext(ty),[i,s]=S.useState(!1),[l,c]=S.useState(!1),{onFocus:d,onBlur:h,onMouseEnter:m,onMouseLeave:y,onTouchStart:v}=t,b=S.useRef(null);S.useEffect(()=>{if(e==="render"&&c(!0),e==="viewport"){let N=A=>{A.forEach(T=>{c(T.isIntersecting)})},M=new IntersectionObserver(N,{threshold:.5});return b.current&&M.observe(b.current),()=>{M.disconnect()}}},[e]),S.useEffect(()=>{if(i){let N=setTimeout(()=>{c(!0)},100);return()=>{clearTimeout(N)}}},[i]);let D=()=>{s(!0)},w=()=>{s(!1),c(!1)};return n?e!=="intent"?[l,b,{}]:[l,b,{onFocus:Vl(d,D),onBlur:Vl(h,w),onMouseEnter:Vl(m,D),onMouseLeave:Vl(y,w),onTouchStart:Vl(v,D)}]:[!1,b,{}]}function Vl(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function fR({page:e,...t}){let{router:n}=gN(),i=S.useMemo(()=>br(n.routes,e,n.basename),[n.routes,e,n.basename]);return i?S.createElement(mR,{page:e,matches:i,...t}):null}function hR(e){let{manifest:t,routeModules:n}=yN(),[i,s]=S.useState([]);return S.useEffect(()=>{let l=!1;return rR(e,t,n).then(c=>{l||s(c)}),()=>{l=!0}},[e,t,n]),i}function mR({page:e,matches:t,...n}){let i=Ra(),{manifest:s,routeModules:l}=yN(),{basename:c}=gN(),{loaderData:d,matches:h}=uR(),m=S.useMemo(()=>Px(e,t,h,s,i,"data"),[e,t,h,s,i]),y=S.useMemo(()=>Px(e,t,h,s,i,"assets"),[e,t,h,s,i]),v=S.useMemo(()=>{if(e===i.pathname+i.search+i.hash)return[];let w=new Set,N=!1;if(t.forEach(A=>{let T=s.routes[A.route.id];!T||!T.hasLoader||(!m.some(j=>j.route.id===A.route.id)&&A.route.id in d&&l[A.route.id]?.shouldRevalidate||T.hasClientLoader?N=!0:w.add(A.route.id))}),w.size===0)return[];let M=nR(e,c,"data");return N&&w.size>0&&M.searchParams.set("_routes",t.filter(A=>w.has(A.route.id)).map(A=>A.route.id).join(",")),[M.pathname+M.search]},[c,d,i,s,m,t,e,l]),b=S.useMemo(()=>sR(y,s),[y,s]),D=hR(y);return S.createElement(S.Fragment,null,v.map(w=>S.createElement("link",{key:w,rel:"prefetch",as:"fetch",href:w,...n})),b.map(w=>S.createElement("link",{key:w,rel:"modulepreload",href:w,...n})),D.map(({key:w,link:N})=>S.createElement("link",{key:w,nonce:n.nonce,...N})))}function pR(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var vN=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{vN&&(window.__reactRouterVersion="7.9.6")}catch{}function gR(e,t){return eO({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:m$({window:t?.window}),hydrationData:t?.hydrationData||yR(),routes:e,mapRouteProperties:_O,hydrationRouteProperties:UO,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,unstable_instrumentations:t?.unstable_instrumentations}).initialize()}function yR(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:vR(e.errors)}),e}function vR(e){if(!e)return null;let t=Object.entries(e),n={};for(let[i,s]of t)if(s&&s.__type==="RouteErrorResponse")n[i]=new Jd(s.status,s.statusText,s.data,s.internal===!0);else if(s&&s.__type==="Error"){if(s.__subType){let l=window[s.__subType];if(typeof l=="function")try{let c=new l(s.message);c.stack="",n[i]=c}catch{}}if(n[i]==null){let l=new Error(s.message);l.stack="",n[i]=l}}else n[i]=s;return n}var bN=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ny=S.forwardRef(function({onClick:t,discover:n="render",prefetch:i="none",relative:s,reloadDocument:l,replace:c,state:d,target:h,to:m,preventScrollReset:y,viewTransition:v,...b},D){let{basename:w}=S.useContext(ui),N=typeof m=="string"&&bN.test(m),M,A=!1;if(typeof m=="string"&&N&&(M=m,vN))try{let _=new URL(window.location.href),Y=m.startsWith("//")?new URL(_.protocol+m):new URL(m),Z=Oa(Y.pathname,w);Y.origin===_.origin&&Z!=null?m=Z+Y.search+Y.hash:A=!0}catch{Kt(!1,`<Link to="${m}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let T=NO(m,{relative:s}),[j,F,z]=dR(i,b),P=wR(m,{replace:c,state:d,target:h,preventScrollReset:y,relative:s,viewTransition:v});function E(_){t&&t(_),_.defaultPrevented||P(_)}let L=S.createElement("a",{...b,...z,href:M||T,onClick:A||l?t:E,ref:pR(D,F),target:h,"data-discover":!N&&n==="render"?"true":void 0});return j&&!N?S.createElement(S.Fragment,null,L,S.createElement(fR,{page:T})):L});ny.displayName="Link";var bR=S.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:i="",end:s=!1,style:l,to:c,viewTransition:d,children:h,...m},y){let v=Lc(c,{relative:m.relative}),b=Ra(),D=S.useContext(Oc),{navigator:w,basename:N}=S.useContext(ui),M=D!=null&&MR(v)&&d===!0,A=w.encodeLocation?w.encodeLocation(v).pathname:v.pathname,T=b.pathname,j=D&&D.navigation&&D.navigation.location?D.navigation.location.pathname:null;n||(T=T.toLowerCase(),j=j?j.toLowerCase():null,A=A.toLowerCase()),j&&N&&(j=Oa(j,N)||j);const F=A!=="/"&&A.endsWith("/")?A.length-1:A.length;let z=T===A||!s&&T.startsWith(A)&&T.charAt(F)==="/",P=j!=null&&(j===A||!s&&j.startsWith(A)&&j.charAt(A.length)==="/"),E={isActive:z,isPending:P,isTransitioning:M},L=z?t:void 0,_;typeof i=="function"?_=i(E):_=[i,z?"active":null,P?"pending":null,M?"transitioning":null].filter(Boolean).join(" ");let Y=typeof l=="function"?l(E):l;return S.createElement(ny,{...m,"aria-current":L,className:_,ref:y,style:Y,to:c,viewTransition:d},typeof h=="function"?h(E):h)});bR.displayName="NavLink";var SR=S.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:i,replace:s,state:l,method:c=Od,action:d,onSubmit:h,relative:m,preventScrollReset:y,viewTransition:v,...b},D)=>{let w=CR(),N=ER(d,{relative:m}),M=c.toLowerCase()==="get"?"get":"post",A=typeof d=="string"&&bN.test(d),T=j=>{if(h&&h(j),j.defaultPrevented)return;j.preventDefault();let F=j.nativeEvent.submitter,z=F?.getAttribute("formmethod")||c;w(F||j.currentTarget,{fetcherKey:t,method:z,navigate:n,replace:s,state:l,relative:m,preventScrollReset:y,viewTransition:v})};return S.createElement("form",{ref:D,method:M,action:N,onSubmit:i?h:T,...b,"data-discover":!A&&e==="render"?"true":void 0})});SR.displayName="Form";function xR(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function SN(e){let t=S.useContext(ms);return Ye(t,xR(e)),t}function wR(e,{target:t,replace:n,state:i,preventScrollReset:s,relative:l,viewTransition:c}={}){let d=xf(),h=Ra(),m=Lc(e,{relative:l});return S.useCallback(y=>{if(WO(y,t)){y.preventDefault();let v=n!==void 0?n:li(h)===li(m);d(e,{replace:v,state:i,preventScrollReset:s,relative:l,viewTransition:c})}},[h,d,m,n,i,t,e,s,l,c])}function xN(e){Kt(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=S.useRef(Zp(e)),n=S.useRef(!1),i=Ra(),s=S.useMemo(()=>QO(i.search,n.current?null:t.current),[i.search]),l=xf(),c=S.useCallback((d,h)=>{const m=Zp(typeof d=="function"?d(new URLSearchParams(s)):d);n.current=!0,l("?"+m,h)},[l,s]);return[s,c]}var DR=0,NR=()=>`__${String(++DR)}__`;function CR(){let{router:e}=SN("useSubmit"),{basename:t}=S.useContext(ui),n=IO();return S.useCallback(async(i,s={})=>{let{action:l,method:c,encType:d,formData:h,body:m}=tR(i,t);if(s.navigate===!1){let y=s.fetcherKey||NR();await e.fetch(y,n,s.action||l,{preventScrollReset:s.preventScrollReset,formData:h,body:m,formMethod:s.method||c,formEncType:s.encType||d,flushSync:s.flushSync})}else await e.navigate(s.action||l,{preventScrollReset:s.preventScrollReset,formData:h,body:m,formMethod:s.method||c,formEncType:s.encType||d,replace:s.replace,state:s.state,fromRouteId:n,flushSync:s.flushSync,viewTransition:s.viewTransition})},[e,t,n])}function ER(e,{relative:t}={}){let{basename:n}=S.useContext(ui),i=S.useContext(Ga);Ye(i,"useFormAction must be used inside a RouteContext");let[s]=i.matches.slice(-1),l={...Lc(e||".",{relative:t})},c=Ra();if(e==null){l.search=c.search;let d=new URLSearchParams(l.search),h=d.getAll("index");if(h.some(y=>y==="")){d.delete("index"),h.filter(v=>v).forEach(v=>d.append("index",v));let y=d.toString();l.search=y?`?${y}`:""}}return(!e||e===".")&&s.route.index&&(l.search=l.search?l.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(l.pathname=l.pathname==="/"?n:si([n,l.pathname])),li(l)}function AR(e,t){let{capture:n}={};S.useEffect(()=>{let i=n!=null?{capture:n}:void 0;return window.addEventListener("beforeunload",e,i),()=>{window.removeEventListener("beforeunload",e,i)}},[e,n])}function MR(e,{relative:t}={}){let n=S.useContext(Jg);Ye(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=SN("useViewTransitionState"),s=Lc(e,{relative:t});if(!n.isTransitioning)return!1;let l=Oa(n.currentLocation.pathname,i)||n.currentLocation.pathname,c=Oa(n.nextLocation.pathname,i)||n.nextLocation.pathname;return Yd(s.pathname,c)!=null||Yd(s.pathname,l)!=null}function TR(e){return S.createElement(FO,{flushSync:xD.flushSync,...e})}const Pc=e=>Array.isArray(e)?e:[e],jR=(e,t)=>{const n=[[],[]];for(const i of e)t(i)?n[0].push(i):n[1].push(i);return n},wN=Array,yr=(e,t)=>e.includes(t),kR=(e,t=0)=>[...new Array(e)].map((n,i)=>i+t),Dt=(e,t,n)=>e===void 0?t===void 0?[]:Array.isArray(t)?t:[t]:(Array.isArray(t)?e.push(...t):e.push(t),e),ls=(e,t)=>t==null?e??[]:e==null?Pc(t):e.concat(t),$R=(...e)=>e.reduce(ls,[]),ds=(e,t,n)=>{if(e===void 0)return Array.isArray(t)?t:[t];const i=n?.isEqual??((s,l)=>s===l);for(const s of Pc(t))e.some(l=>i(l,s))||e.push(s);return e},OR=(e,t)=>e.reduce((n,i)=>{const s=i[t];return n[s]=Dt(n[s],i),n},{}),Ao=(e,t,n)=>e.length===t.length&&e.every(n?.isEqual?(i,s)=>n.isEqual(i,t[s]):(i,s)=>i===t[s]),ps=(e,t)=>Ya(e)===t,Ya=e=>{const t=typeof e;return t==="object"?e===null?"null":"object":t==="function"?"object":t},Ri={boolean:"boolean",null:"null",undefined:"undefined",bigint:"a bigint",number:"a number",object:"an object",string:"a string",symbol:"a symbol"},RR={...Ri,function:"a function"};class LR extends Error{}const cn=e=>Mo(e,LR),Mo=(e,t=Error)=>{throw new t(e)};class PR extends Error{name="ParseError"}const le=e=>Mo(e,PR),DN=e=>` ${e}`,IR="",Nt=(e,t)=>{const n={},i=Array.isArray(e);let s=!1;for(const[l,c]of Object.entries(e).entries()){const d=i?t(l,c[1]):t(...c,l);s||=typeof d[0]=="number";const h=Array.isArray(d[0])||d.length===0?d:[d];for(const[m,y]of h)typeof m=="object"?n[m.group]=Dt(n[m.group],y):n[m]=y}return s?Object.values(n):n},NN=Object.entries,di=(e,t)=>e in t,ay=(e,t)=>t in e;class zR{constructor(t){Object.assign(this,t)}}const _R=class{};class CN extends _R{}const UR=(e,t)=>{const n={},i={};let s;for(s in e)s in t?n[s]=e[s]:i[s]=e[s];return[n,i]},EN=(e,t)=>UR(e,t)[1],Ic=e=>Object.keys(e).length===0,Wd=e=>[...Object.entries(e),...Object.getOwnPropertySymbols(e).map(t=>[t,e[t]])],BR=(e,t)=>Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)),FR=e=>{const t=Object.keys(e).sort(),n={};for(let i=0;i<t.length;i++)n[t[i]]=e[t[i]];return n},ni=DN(`unset${IR}`),HR=e=>Object.values(e).filter(t=>typeof t=="number"?!0:typeof e[t]!="number"),AN={Array,Boolean,Date,Error,Function,Map,Number,Promise,RegExp,Set,String,WeakMap,WeakSet},MN=globalThis.File??Blob,TN={ArrayBuffer,Blob,File:MN,FormData,Headers,Request,Response,URL},qR={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array},To={...AN,...TN,...qR,String,Number,Boolean},iy=e=>{let t=Object.getPrototypeOf(e);for(;t?.constructor&&(!di(t.constructor.name,To)||!(e instanceof To[t.constructor.name]));)t=Object.getPrototypeOf(t);const n=t?.constructor?.name;if(!(n===void 0||n==="Object"))return n},eg=e=>typeof e=="object"&&e!==null?iy(e)??"object":Ya(e),kn=Array.isArray,VR={Array:"an array",Function:"a function",Date:"a Date",RegExp:"a RegExp",Error:"an Error",Map:"a Map",Set:"a Set",String:"a String object",Number:"a Number object",Boolean:"a Boolean object",Promise:"a Promise",WeakMap:"a WeakMap",WeakSet:"a WeakSet"},KR={ArrayBuffer:"an ArrayBuffer instance",Blob:"a Blob instance",File:"a File instance",FormData:"a FormData instance",Headers:"a Headers instance",Request:"a Request instance",Response:"a Response instance",URL:"a URL instance"},GR={Int8Array:"an Int8Array",Uint8Array:"a Uint8Array",Uint8ClampedArray:"a Uint8ClampedArray",Int16Array:"an Int16Array",Uint16Array:"a Uint16Array",Int32Array:"an Int32Array",Uint32Array:"a Uint32Array",Float32Array:"a Float32Array",Float64Array:"a Float64Array",BigInt64Array:"a BigInt64Array",BigUint64Array:"a BigUint64Array"},YR={...VR,...KR,...GR},ry=e=>{const t=Object(e).name??null;return t&&di(t,To)&&To[t]===e?t:null},Ix=(e,t)=>{let n=e.prototype;for(;n!==null;){if(n===t.prototype)return!0;n=Object.getPrototypeOf(n)}return!1},JR=e=>jN(e,new Map),jN=(e,t)=>{if(typeof e!="object"||e===null)return e;if(t?.has(e))return t.get(e);const n=ry(e.constructor);if(n==="Date")return new Date(e.getTime());if(n&&n!=="Array")return e;const i=Array.isArray(e)?e.slice():Object.create(Object.getPrototypeOf(e)),s=Object.getOwnPropertyDescriptors(e);if(t){t.set(e,i);for(const l in s){const c=s[l];"get"in c||"set"in c||(c.value=jN(c.value,t))}}return Object.defineProperties(i,s),i},XR=e=>{let t=ni;return()=>t===ni?t=e():t},Df=e=>typeof e=="function"&&e.length===0,WR=class extends Function{constructor(...e){const t=e.slice(0,-1),n=e[e.length-1];try{super(...t,n)}catch(i){return cn(`Encountered an unexpected error while compiling your definition:
|
|
18
|
-
Message: ${i}
|
|
19
|
-
Source: (${e.slice(0,-1)}) => {
|
|
20
|
-
${e[e.length-1]}
|
|
21
|
-
}`)}}};class kr{constructor(t,...[n]){return Object.assign(Object.setPrototypeOf(t.bind(n?.bind??this),this.constructor.prototype),n?.attach)}}const QR=XR(()=>{try{return new Function("return false")()}catch{return!0}});class fi{constructor(){}}var ZR={};const e2=()=>{try{return((new Error().stack?.split(`
|
|
22
|
-
`)[2]?.trim()||"").match(/\(?(.+?)(?::\d+:\d+)?\)?$/)?.[1]||"unknown").replace(/^file:\/\//,"")}catch{return"unknown"}},t2=ZR??{},n2={fileName:e2,env:t2},a2=e=>e[0].toUpperCase()+e.slice(1),kN=e=>new RegExp(i2(e),typeof e=="string"?"":e.flags),i2=e=>`^(?:${typeof e=="string"?e:e.source})$`,xr={negativeLookahead:e=>`(?!${e})`,nonCapturingGroup:e=>`(?:${e})`},fc="\\",Nf={" ":1,"\n":1," ":1},r2=/^-0\.?0*$/.source,$N=/[1-9]\d*/.source,s2=/\.\d+/.source,o2=/\.\d*[1-9]/.source,ON=e=>kN(xr.negativeLookahead(r2)+xr.nonCapturingGroup("-?"+xr.nonCapturingGroup(xr.nonCapturingGroup("0|"+$N)+xr.nonCapturingGroup(e.decimalPattern)+"?")+(e.allowDecimalOnly?"|"+e.decimalPattern:"")+"?")),zx=ON({decimalPattern:o2,allowDecimalOnly:!1}),l2=zx.test.bind(zx),tg=ON({decimalPattern:s2,allowDecimalOnly:!0});tg.test.bind(tg);const c2=/^-?\d*\.?\d*$/,u2=e=>e.length!==0&&c2.test(e),Qd=kN(xr.negativeLookahead("^-0$")+"-?"+xr.nonCapturingGroup(xr.nonCapturingGroup("0|"+$N))),d2=Qd.test.bind(Qd),ng=/^-?\d+$/,f2=ng.test.bind(ng),RN={number:"a number",bigint:"a bigint",integer:"an integer"},LN=(e,t)=>`'${e}' was parsed as ${RN[t]} but could not be narrowed to a literal value. Avoid unnecessary leading or trailing zeros and other abnormal notation`,h2=(e,t)=>t==="number"?l2(e):d2(e),m2=(e,t)=>t==="number"?Number(e):Number.parseInt(e),p2=(e,t)=>t==="number"?u2(e):f2(e),g2=(e,t)=>sy(e,"number",t),y2=(e,t)=>sy(e,"number",{...t,strict:!0}),v2=(e,t)=>sy(e,"integer",t),sy=(e,t,n)=>{const i=m2(e,t);return!Number.isNaN(i)&&p2(e,t)?n?.strict?h2(e,t)?i:le(LN(e,t)):i:n?.errorOnFail?le(n?.errorOnFail===!0?`Failed to parse ${RN[t]} from '${e}'`:n?.errorOnFail):void 0},b2=e=>{if(e[e.length-1]!=="n")return;const t=e.slice(0,-1);let n;try{n=BigInt(t)}catch{return}if(Qd.test(t))return n;if(ng.test(t))return le(LN(e,"bigint"))},S2="0.55.0",x2={version:S2,filename:n2.fileName(),FileConstructor:MN},zc=x2,_x=new Map,Np=Object.create(null),ag=e=>{const t=_x.get(e);if(t)return t;let n=w2(e);return Np[n]?n=`${n}${Np[n]++}`:Np[n]=1,zc[n]=e,_x.set(e,n),n},xc=e=>/^[$A-Z_a-z][\w$]*$/.test(e),w2=e=>{switch(typeof e){case"object":{if(e===null)break;const t=iy(e)??"object";return t[0].toLowerCase()+t.slice(1)}case"function":return xc(e.name)?e.name:"fn";case"symbol":return e.description&&xc(e.description)?e.description:"symbol"}return cn(`Unexpected attempt to register serializable value of type ${Ya(e)}`)},oy=e=>typeof e=="string"?JSON.stringify(e):typeof e=="bigint"?`${e}n`:`${e}`,D2=(e,t={})=>hc(e,{onUndefined:"$ark.undefined",onBigInt:n=>`$ark.bigint-${n}`,...t},[]),bt=(e,t)=>{switch(Ya(e)){case"object":const n=e,i=n.constructor.name;return i==="Object"||i==="Array"?t?.quoteKeys===!1?Zd(n,t?.indent??0,""):JSON.stringify(hc(n,jo,[]),null,t?.indent):Zd(n,t?.indent??0,"");case"symbol":return jo.onSymbol(e);default:return oy(e)}},Zd=(e,t,n)=>{if(typeof e=="function")return jo.onFunction(e);if(typeof e!="object"||e===null)return oy(e);const i=n+" ".repeat(t);if(Array.isArray(e)){if(e.length===0)return"[]";const l=e.map(c=>Zd(c,t,i)).join(`,
|
|
23
|
-
`+i);return t?`[
|
|
24
|
-
${i}${l}
|
|
25
|
-
${n}]`:`[${l}]`}const s=e.constructor.name;if(s==="Object"){const l=Wd(e).map(([c,d])=>{const h=typeof c=="symbol"?jo.onSymbol(c):xc(c)?c:JSON.stringify(c),m=Zd(d,t,i);return`${i}${h}: ${m}`});return l.length===0?"{}":t?`{
|
|
26
|
-
${l.join(`,
|
|
27
|
-
`)}
|
|
28
|
-
${n}}`:`{${l.join(", ")}}`}return e instanceof Date?_c(e):"expression"in e&&typeof e.expression=="string"?e.expression:s},jo={onCycle:()=>"(cycle)",onSymbol:e=>`Symbol(${ag(e)})`,onFunction:e=>`Function(${ag(e)})`},hc=(e,t,n)=>{switch(Ya(e)){case"object":{const i=e;if("toJSON"in i&&typeof i.toJSON=="function")return i.toJSON();if(typeof i=="function")return jo.onFunction(i);if(n.includes(i))return"(cycle)";const s=[...n,i];if(Array.isArray(i))return i.map(c=>hc(c,t,s));if(i instanceof Date)return i.toDateString();const l={};for(const c in i)l[c]=hc(i[c],t,s);for(const c of Object.getOwnPropertySymbols(i))l[t.onSymbol?.(c)??c.toString()]=hc(i[c],t,s);return l}case"symbol":return jo.onSymbol(e);case"bigint":return t.onBigInt?.(e)??`${e}n`;case"undefined":return t.onUndefined??"undefined";case"string":return e.replace(/\\/g,"\\\\");default:return e}},_c=e=>{const t=e.getFullYear(),n=e.getMonth(),i=e.getDate(),s=e.getHours(),l=e.getMinutes(),c=e.getSeconds(),d=e.getMilliseconds();if(n===0&&i===1&&s===0&&l===0&&c===0&&d===0)return`${t}`;const h=`${N2[n]} ${i}, ${t}`;if(s===0&&l===0&&c===0&&d===0)return h;let m=e.toLocaleTimeString();const y=m.endsWith(" AM")||m.endsWith(" PM")?m.slice(-3):"";return y&&(m=m.slice(0,-y.length)),d?m+=`.${E2(d,3)}`:C2.test(m)&&(m=m.slice(0,-3)),`${m+y}, ${h}`},N2=["January","February","March","April","May","June","July","August","September","October","November","December"],C2=/:\d\d:00$/,E2=(e,t)=>String(e).padStart(t,"0"),PN=(e,t,...[n])=>{const i=n?.stringifySymbol??bt;let s=e;switch(typeof t){case"string":s=xc(t)?e===""?t:`${e}.${t}`:`${e}[${JSON.stringify(t)}]`;break;case"number":s=`${e}[${t}]`;break;case"symbol":s=`${e}[${i(t)}]`;break;default:n?.stringifyNonKey?s=`${e}[${n.stringifyNonKey(t)}]`:le(`${bt(t)} must be a PropertyKey or stringifyNonKey must be passed to options`)}return s},Uc=(e,...t)=>e.reduce((n,i)=>PN(n,i,...t),"");class IN extends wN{cache={};constructor(...t){super(),this.push(...t)}toJSON(){if(this.cache.json)return this.cache.json;this.cache.json=[];for(let t=0;t<this.length;t++)this.cache.json.push(typeof this[t]=="symbol"?bt(this[t]):this[t]);return this.cache.json}stringify(){return this.cache.stringify?this.cache.stringify:this.cache.stringify=Uc(this)}stringifyAncestors(){if(this.cache.stringifyAncestors)return this.cache.stringifyAncestors;let t="";const n=[t];for(const i of this)t=PN(t,i),n.push(t);return this.cache.stringifyAncestors=n}}class zN{chars;i;def;constructor(t){this.def=t,this.chars=[...t],this.i=0}shift(){return this.chars[this.i++]??""}get lookahead(){return this.chars[this.i]??""}get nextLookahead(){return this.chars[this.i+1]??""}get length(){return this.chars.length}shiftUntil(t){let n="";for(;this.lookahead&&!t(this,n);)n+=this.shift();return n}shiftUntilEscapable(t){let n="";for(;this.lookahead;)if(this.lookahead===fc)this.shift(),t(this,n)?n+=this.shift():this.lookahead===fc?n+=this.shift():n+=`${fc}${this.shift()}`;else{if(t(this,n))break;n+=this.shift()}return n}shiftUntilLookahead(t){return typeof t=="string"?this.shiftUntil(n=>n.lookahead===t):this.shiftUntil(n=>n.lookahead in t)}shiftUntilNonWhitespace(){return this.shiftUntil(()=>!(this.lookahead in Nf))}jumpToIndex(t){this.i=t<0?this.length+t:t}jumpForward(t){this.i+=t}get location(){return this.i}get unscanned(){return this.chars.slice(this.i,this.length).join("")}get scanned(){return this.chars.slice(0,this.i).join("")}sliceChars(t,n){return this.chars.slice(t,n).join("")}lookaheadIs(t){return this.lookahead===t}lookaheadIsIn(t){return this.lookahead in t}}const A2=(e,t)=>`Unmatched ${e}${t===""?"":` before ${t}`}`,_N=e=>`Missing ${e}`;let ig="$ark",M2=2;for(;ig in globalThis;)ig=`$ark${M2++}`;const UN=ig;globalThis[UN]=zc;const pe=zc,T2=e=>`${UN}.${e}`,Un=e=>T2(ag(e));class BN extends CN{argNames;body="";constructor(...t){super(),this.argNames=t;for(const n of t){if(n in this)throw new Error(`Arg name '${n}' would overwrite an existing property on FunctionBody`);this[n]=n}}indentation=0;indent(){return this.indentation+=4,this}dedent(){return this.indentation-=4,this}prop(t,n=!1){return FN(t,n)}index(t,n=!1){return HN(`${t}`,n)}line(t){return this.body+=`${" ".repeat(this.indentation)}${t}
|
|
29
|
-
`,this}const(t,n){return this.line(`const ${t} = ${n}`),this}let(t,n){return this.line(`let ${t} = ${n}`)}set(t,n){return this.line(`${t} = ${n}`)}if(t,n){return this.block(`if (${t})`,n)}elseIf(t,n){return this.block(`else if (${t})`,n)}else(t){return this.block("else",t)}for(t,n,i=0){return this.block(`for (let i = ${i}; ${t}; i++)`,n)}forIn(t,n){return this.block(`for (const k in ${t})`,n)}block(t,n,i=""){return this.line(`${t} {`),this.indent(),n(this),this.dedent(),this.line(`}${i}`)}return(t=""){return this.line(`return ${t}`)}write(t="anonymous",n=0){return`${t}(${this.argNames.join(", ")}) { ${n?this.body.split(`
|
|
30
|
-
`).map(i=>" ".repeat(n)+`${i}`).join(`
|
|
31
|
-
`):this.body} }`}compile(){return new WR(...this.argNames,this.body)}}const Io=e=>ps(e,"object")||typeof e=="symbol"?Un(e):oy(e),FN=(e,t=!1)=>typeof e=="string"&&xc(e)?`${t?"?":""}.${e}`:HN(j2(e),t),j2=e=>typeof e=="symbol"?Un(e):JSON.stringify(e),HN=(e,t=!1)=>`${t?"?.":""}[${e}]`;class Cp extends BN{traversalKind;optimistic;constructor(t){super("data","ctx"),this.traversalKind=t.kind,this.optimistic=t.optimistic===!0}invoke(t,n){const i=n?.arg??this.data,s=typeof t=="string"?!0:this.requiresContextFor(t),l=typeof t=="string"?t:t.id;return s?`${this.referenceToId(l,n)}(${i}, ${this.ctx})`:`${this.referenceToId(l,n)}(${i})`}referenceToId(t,n){const i=n?.kind??this.traversalKind,s=`this.${t}${i}`;return n?.bind?`${s}.bind(${n?.bind})`:s}requiresContextFor(t){return this.traversalKind==="Apply"||t.allowsRequiresContext}initializeErrorCount(){return this.const("errorCount","ctx.currentErrorCount")}returnIfFail(){return this.if("ctx.currentErrorCount > errorCount",()=>this.return())}returnIfFailFast(){return this.if("ctx.failFast && ctx.currentErrorCount > errorCount",()=>this.return())}traverseKey(t,n,i){const s=this.requiresContextFor(i);return s&&this.line(`${this.ctx}.path.push(${t})`),this.check(i,{arg:n}),s&&this.line(`${this.ctx}.path.pop()`),this}check(t,n){return this.traversalKind==="Allows"?this.if(`!${this.invoke(t,n)}`,()=>this.return(!1)):this.line(this.invoke(t,n))}}const qN=e=>Nt(e,(t,n)=>[t,kn(n)?[...n]:n]),Li=DN("arkKind"),Re=(e,t)=>e?.[Li]===t,_n=e=>Re(e,"root")||Re(e,"constraint"),k2=["unit","proto","domain"],Cf=["required","optional","index","sequence"],VN=["pattern","divisor","exactLength","max","min","maxLength","minLength","before","after"],KN=[...VN,"structure","predicate"],ly=[...KN,...Cf],Ef=["alias","union","morph","unit","intersection","proto","domain"],$2=[...Ef,...ly],GN=Nt(ly,(e,t)=>[t,1]),O2=Nt([...Cf,"undeclared"],(e,t)=>[t,1]),YN=Nt($2,(e,t)=>[t,e]),Ld=e=>typeof e=="string"&&e in YN,ef=e=>YN[e],cy=e=>Ef.slice(ef(e)+1);[...cy("union")];[...cy("morph")];const hs=e=>typeof e=="string"||typeof e=="boolean"||e===null?e:typeof e=="number"?Number.isNaN(e)?"NaN":e===Number.POSITIVE_INFINITY?"Infinity":e===Number.NEGATIVE_INFINITY?"-Infinity":e:Io(e),Af=e=>{let t="{ ";for(const[n,i]of Object.entries(e))t+=`${n}: ${Io(i)}, `;return t+" }"},Gt=e=>{const t=e;return t.hasAssociatedError&&(t.defaults.expected??=n=>"description"in n?n.description:t.defaults.description(n),t.defaults.actual??=n=>bt(n),t.defaults.problem??=n=>`must be ${n.expected}${n.actual?` (was ${n.actual})`:""}`,t.defaults.message??=n=>{if(n.path.length===0)return n.problem;const i=`${n.propString} ${n.problem}`;return i[0]==="["?`value at ${i}`:i}),t};class R2 extends Error{name="ToJsonSchemaError";code;context;constructor(t,n){super(bt(n,{quoteKeys:!1,indent:4})),this.code=t,this.context=n}hasCode(t){return this.code===t}}const L2={dialect:"https://json-schema.org/draft/2020-12/schema",useRefs:!1,fallback:{arrayObject:e=>hn.throw("arrayObject",e),arrayPostfix:e=>hn.throw("arrayPostfix",e),defaultValue:e=>hn.throw("defaultValue",e),domain:e=>hn.throw("domain",e),morph:e=>hn.throw("morph",e),patternIntersection:e=>hn.throw("patternIntersection",e),predicate:e=>hn.throw("predicate",e),proto:e=>hn.throw("proto",e),symbolKey:e=>hn.throw("symbolKey",e),unit:e=>hn.throw("unit",e),date:e=>hn.throw("date",e)}},hn={Error:R2,throw:(...e)=>{throw new hn.Error(...e)},throwInternalOperandError:(e,t)=>cn(`Unexpected JSON Schema input for ${e}: ${bt(t)}`),defaultConfig:L2};pe.config??={};const rg=(e,t)=>{if(!t)return e;const n={...e};let i;for(i in t){const s={...e.keywords};if(i==="keywords"){for(const l in t[i]){const c=t.keywords[l];c!==void 0&&(s[l]=typeof c=="string"?{description:c}:c)}n.keywords=s}else i==="toJsonSchema"?n[i]=JN(e.toJsonSchema,t.toJsonSchema):Ld(i)?n[i]={...e[i],...t[i]}:n[i]=t[i]}return n},JN=((e,t)=>{if(!e)return t??{};if(!t)return e;const n={...e};let i;for(i in t)i==="fallback"?n.fallback=P2(e.fallback,t.fallback):n[i]=t[i];return n}),P2=(e,t)=>{e=Ux(e),t=Ux(t);const n={};let i;for(i in hn.defaultConfig.fallback)n[i]=t[i]??t.default??e[i]??e.default??hn.defaultConfig.fallback[i];return n},Ux=e=>typeof e=="function"?{default:e}:e??{};class ko extends CN{[Li]="error";path;data;nodeConfig;input;ctx;constructor({prefixPath:t,relativePath:n,...i},s){super(),this.input=i,this.ctx=s,BR(this,i);const l=s.data;i.code==="union"&&(i.errors=i.errors.flatMap(d=>{const h=d.hasCode("union")?d.errors:[d];return!t&&!n?h:h.map(m=>m.transform(y=>({...y,path:$R(t,y.path,n)})))})),this.nodeConfig=s.config[this.code];const c=[...i.path??s.path];n&&c.push(...n),t&&c.unshift(...t),this.path=new IN(...c),this.data="data"in i?i.data:l}transform(t){return new ko(t({data:this.data,path:this.path,...this.input}),this.ctx)}hasCode(t){return this.code===t}get propString(){return Uc(this.path)}get expected(){if(this.input.expected)return this.input.expected;const t=this.meta?.expected??this.nodeConfig.expected;return typeof t=="function"?t(this.input):t}get actual(){if(this.input.actual)return this.input.actual;const t=this.meta?.actual??this.nodeConfig.actual;return typeof t=="function"?t(this.data):t}get problem(){if(this.input.problem)return this.input.problem;const t=this.meta?.problem??this.nodeConfig.problem;return typeof t=="function"?t(this):t}get message(){if(this.input.message)return this.input.message;const t=this.meta?.message??this.nodeConfig.message;return typeof t=="function"?t(this):t}get flat(){return this.hasCode("intersection")?[...this.errors]:[this]}toJSON(){return{data:this.data,path:this.path,...this.input,expected:this.expected,actual:this.actual,problem:this.problem,message:this.message}}toString(){return this.message}throw(){throw this}}class Mr extends wN{[Li]="errors";ctx;constructor(t){super(),this.ctx=t}byPath=Object.create(null);get flatByPath(){return Nt(this.byPath,(t,n)=>[t,n.flat])}get flatProblemsByPath(){return Nt(this.byPath,(t,n)=>[t,n.flat.map(i=>i.problem)])}byAncestorPath=Object.create(null);count=0;mutable=this;throw(){throw this.toTraversalError()}toTraversalError(){return new I2(this)}add(t){const n=this.byPath[t.propString];if(n){if(t===n||n.hasCode("union")&&n.errors.length===0)return;const i=t.hasCode("union")&&t.errors.length===0?t:new ko({code:"intersection",errors:n.hasCode("intersection")?[...n.errors,t]:[n,t]},this.ctx),s=this.indexOf(n);this.mutable[s===-1?this.length:s]=i,this.byPath[t.propString]=i,this.addAncestorPaths(t)}else this.byPath[t.propString]=t,this.addAncestorPaths(t),this.mutable.push(t);this.count++}transform(t){const n=new Mr(this.ctx);for(const i of this)n.add(t(i));return n}merge(t){for(const n of t)this.add(new ko({...n,path:[...this.ctx.path,...n.path]},this.ctx))}affectsPath(t){return this.length===0?!1:t.stringifyAncestors().some(n=>n in this.byPath)||t.stringify()in this.byAncestorPath}get summary(){return this.toString()}get issues(){return this}toJSON(){return[...this.map(t=>t.toJSON())]}toString(){return this.join(`
|
|
32
|
-
`)}addAncestorPaths(t){for(const n of t.path.stringifyAncestors())this.byAncestorPath[n]=Dt(this.byAncestorPath[n],t)}}class I2 extends Error{name="TraversalError";constructor(t){t.length===1?super(t.summary):super(`
|
|
33
|
-
`+t.map(n=>` • ${z2(n)}`).join(`
|
|
34
|
-
`)),Object.defineProperty(this,"arkErrors",{value:t,enumerable:!1})}}const z2=e=>e.toString().split(`
|
|
35
|
-
`).join(`
|
|
36
|
-
`);class bo{path=[];errors=new Mr(this);root;config;queuedMorphs=[];branches=[];seen={};constructor(t,n){this.root=t,this.config=n}get data(){let t=this.root;for(const n of this.path)t=t?.[n];return t}get propString(){return Uc(this.path)}reject(t){return this.error(t),!1}mustBe(t){return this.error(t),!1}error(t){const n=typeof t=="object"?t.code?t:{...t,code:"predicate"}:{code:"predicate",expected:t};return this.errorFromContext(n)}hasError(){return this.currentErrorCount!==0}get currentBranch(){return this.branches[this.branches.length-1]}queueMorphs(t){const n={path:new IN(...this.path),morphs:t};this.currentBranch?this.currentBranch.queuedMorphs.push(n):this.queuedMorphs.push(n)}finalize(t){return this.queuedMorphs.length&&(typeof this.root=="object"&&this.root!==null&&this.config.clone&&(this.root=this.config.clone(this.root)),this.applyQueuedMorphs()),this.hasError()?t?t(this.errors):this.errors:this.root}get currentErrorCount(){return this.currentBranch?this.currentBranch.error?1:0:this.errors.count}get failFast(){return this.branches.length!==0}pushBranch(){this.branches.push({error:void 0,queuedMorphs:[]})}popBranch(){return this.branches.pop()}get external(){return this}errorFromNodeContext(t){return this.errorFromContext(t)}errorFromContext(t){const n=new ko(t,this);return this.currentBranch?this.currentBranch.error=n:this.errors.add(n),n}applyQueuedMorphs(){for(;this.queuedMorphs.length;){const t=this.queuedMorphs;this.queuedMorphs=[];for(const{path:n,morphs:i}of t)this.errors.affectsPath(n)||this.applyMorphsAtPath(n,i)}}applyMorphsAtPath(t,n){const i=t[t.length-1];let s;if(i!==void 0){s=this.root;for(let l=0;l<t.length-1;l++)s=s[t[l]]}for(const l of n){this.path=[...t];const c=_n(l),d=l(s===void 0?this.root:s[i],this);if(d instanceof ko){this.errors.add(d);break}if(d instanceof Mr){c||this.errors.merge(d),this.queuedMorphs=[];break}s===void 0?this.root=d:s[i]=d,this.applyQueuedMorphs()}}}const Pi=(e,t,n)=>{if(!n)return t();n.path.push(e);const i=t();return n.path.pop(),i};class XN extends kr{attachments;$;onFail;includesTransform;includesContextualPredicate;isCyclic;allowsRequiresContext;rootApplyStrategy;contextFreeMorph;rootApply;referencesById;shallowReferences;flatRefs;flatMorphs;allows;get shallowMorphs(){return[]}constructor(t,n){super((s,l,c=this.onFail)=>l?(this.traverseApply(s,l),l.hasError()?l.errors:l.data):this.rootApply(s,c),{attach:t}),this.attachments=t,this.$=n,this.onFail=this.meta.onFail??this.$.resolvedConfig.onFail,this.includesTransform=this.hasKind("morph")||this.hasKind("structure")&&this.structuralMorph!==void 0||this.hasKind("sequence")&&this.inner.defaultables!==void 0,this.includesContextualPredicate=this.hasKind("predicate")&&this.inner.predicate.length!==1,this.isCyclic=this.kind==="alias",this.referencesById={[this.id]:this},this.shallowReferences=this.hasKind("structure")?[this,...this.children]:this.children.reduce((s,l)=>F2(s,l.shallowReferences),[this]);const i=this.isStructural();this.flatRefs=[],this.flatMorphs=[];for(let s=0;s<this.children.length;s++){if(this.includesTransform||=this.children[s].includesTransform,this.includesContextualPredicate||=this.children[s].includesContextualPredicate,this.isCyclic||=this.children[s].isCyclic,!i){const l=this.children[s].flatRefs;for(let c=0;c<l.length;c++){const d=l[c];if(!this.flatRefs.some(h=>WN(h,d))){this.flatRefs.push(d);for(const h of d.node.branches)(h.hasKind("morph")||h.hasKind("intersection")&&h.structure?.structuralMorph!==void 0)&&this.flatMorphs.push({path:d.path,propString:d.propString,node:h})}}}Object.assign(this.referencesById,this.children[s].referencesById)}this.flatRefs.sort((s,l)=>s.path.length>l.path.length?1:s.path.length<l.path.length?-1:s.propString>l.propString?1:s.propString<l.propString||s.node.expression<l.node.expression?-1:1),this.allowsRequiresContext=this.includesContextualPredicate||this.isCyclic,this.rootApplyStrategy=!this.allowsRequiresContext&&this.flatMorphs.length===0?this.shallowMorphs.length===0?"allows":this.shallowMorphs.every(s=>s.length===1||s.name==="$arkStructuralMorph")?this.hasKind("union")?this.branches.some(s=>s.shallowMorphs.length>1)?"contextual":"branchedOptimistic":this.shallowMorphs.length>1?"contextual":"optimistic":"contextual":"contextual",this.rootApply=this.createRootApply(),this.allows=this.allowsRequiresContext?s=>this.traverseAllows(s,new bo(s,this.$.resolvedConfig)):s=>this.traverseAllows(s)}createRootApply(){switch(this.rootApplyStrategy){case"allows":return(n,i)=>{if(this.allows(n))return n;const s=new bo(n,this.$.resolvedConfig);return this.traverseApply(n,s),s.finalize(i)};case"contextual":return(n,i)=>{const s=new bo(n,this.$.resolvedConfig);return this.traverseApply(n,s),s.finalize(i)};case"optimistic":this.contextFreeMorph=this.shallowMorphs[0];const t=this.$.resolvedConfig.clone;return(n,i)=>{if(this.allows(n))return this.contextFreeMorph(t&&(typeof n=="object"&&n!==null||typeof n=="function")?t(n):n);const s=new bo(n,this.$.resolvedConfig);return this.traverseApply(n,s),s.finalize(i)};case"branchedOptimistic":return this.createBranchedOptimisticRootApply();default:return this.rootApplyStrategy,cn(`Unexpected rootApplyStrategy ${this.rootApplyStrategy}`)}}compiledMeta=B2(this.metaJson);cacheGetter(t,n){return Object.defineProperty(this,t,{value:n}),n}get description(){return this.cacheGetter("description",this.meta?.description??this.$.resolvedConfig[this.kind].description(this))}get references(){return Object.values(this.referencesById)}precedence=ef(this.kind);precompilation;assert=(t,n)=>this(t,n,i=>i.throw());traverse(t,n){return this(t,n,null)}get in(){return this.cacheGetter("in",this.rawIn.isRoot()?this.$.finalize(this.rawIn):this.rawIn)}get rawIn(){return this.cacheGetter("rawIn",this.getIo("in"))}get out(){return this.cacheGetter("out",this.rawOut.isRoot()?this.$.finalize(this.rawOut):this.rawOut)}get rawOut(){return this.cacheGetter("rawOut",this.getIo("out"))}getIo(t){if(!this.includesTransform)return this;const n={};for(const[i,s]of this.innerEntries){const l=this.impl.keys[i];if(l.reduceIo)l.reduceIo(t,n,s);else if(l.child){const c=s;n[i]=kn(c)?c.map(d=>t==="in"?d.rawIn:d.rawOut):t==="in"?c.rawIn:c.rawOut}else n[i]=s}return this.$.node(this.kind,n)}toJSON(){return this.json}toString(){return`Type<${this.expression}>`}equals(t){const n=_n(t)?t:this.$.parseDefinition(t);return this.innerHash===n.innerHash}ifEquals(t){return this.equals(t)?this:void 0}hasKind(t){return this.kind===t}assertHasKind(t){return this.kind!==t&&Mo(`${this.kind} node was not of asserted kind ${t}`),this}hasKindIn(...t){return t.includes(this.kind)}assertHasKindIn(...t){return yr(t,this.kind)||Mo(`${this.kind} node was not one of asserted kinds ${t}`),this}isBasis(){return yr(k2,this.kind)}isConstraint(){return yr(ly,this.kind)}isStructural(){return yr(Cf,this.kind)}isRefinement(){return yr(KN,this.kind)}isRoot(){return yr(Ef,this.kind)}isUnknown(){return this.hasKind("intersection")&&this.children.length===0}isNever(){return this.hasKind("union")&&this.children.length===0}hasUnit(t){return this.hasKind("unit")&&this.allows(t)}hasOpenIntersection(){return this.impl.intersectionIsOpen}get nestableExpression(){return this.expression}select(t){const n=nc.normalize(t);return this._select(n)}_select(t){let n=nc.applyBoundary[t.boundary??"references"](this);return t.kind&&(n=n.filter(i=>i.kind===t.kind)),t.where&&(n=n.filter(t.where)),nc.applyMethod[t.method??"filter"](n,this,t)}transform(t,n){return this._transform(t,this._createTransformContext(n))}_createTransformContext(t){return{root:this,selected:void 0,seen:{},path:[],parseOptions:{prereduced:t?.prereduced??!1},undeclaredKeyHandling:void 0,...t}}_transform(t,n){const i=n.bindScope??this.$;if(n.seen[this.id])return this.$.lazilyResolve(n.seen[this.id]);if(n.shouldTransform?.(this,n)===!1)return this;let s;n.seen[this.id]=()=>s,this.hasKind("structure")&&this.undeclared!==n.undeclaredKeyHandling&&(n={...n,undeclaredKeyHandling:this.undeclared});const l=Nt(this.inner,(y,v)=>{if(!this.impl.keys[y].child)return[y,v];const b=v;if(!kn(b)){const w=b._transform(t,n);return w?[y,w]:[]}if(b.length===0)return[y,v];const D=b.flatMap(w=>w._transform(t,n)??[]);return D.length?[y,D]:[]});delete n.seen[this.id];const c=Object.assign(l,{meta:this.meta}),d=n.selected&&!n.selected.includes(this)?c:t(this.kind,c,n);if(d===null)return null;if(_n(d))return s=d;const h=Object.keys(d);return(h.length===0||h.length===1&&h[0]==="meta")&&!Ic(this.inner)?null:(this.kind==="required"||this.kind==="optional"||this.kind==="index")&&!("value"in d)?n.undeclaredKeyHandling?{...d,value:pe.intrinsic.unknown}:null:(this.kind==="morph"&&(d.in??=pe.intrinsic.unknown),s=i.node(this.kind,d,n.parseOptions))}configureReferences(t,n="references"){const i=nc.normalize(n),s=typeof t=="string"?(h,m)=>({...m,meta:{...m.meta,description:t}}):typeof t=="function"?(h,m)=>({...m,meta:t(m.meta)}):(h,m)=>({...m,meta:{...m.meta,...t}});if(i.boundary==="self")return this.$.node(this.kind,s(this.kind,{...this.inner,meta:this.meta}));const l=this._select(i),c=l&&Pc(l),d=i.boundary==="child"?(h,m)=>m.root.children.includes(h):i.boundary==="shallow"?h=>h.kind!=="structure":()=>!0;return this.$.finalize(this.transform(s,{shouldTransform:d,selected:c}))}}const nc={applyBoundary:{self:e=>[e],child:e=>[...e.children],shallow:e=>[...e.shallowReferences],references:e=>[...e.references]},applyMethod:{filter:e=>e,assertFilter:(e,t,n)=>(e.length===0&&Mo(Bx(t,n)),e),find:e=>e[0],assertFind:(e,t,n)=>(e.length===0&&Mo(Bx(t,n)),e[0])},normalize:e=>typeof e=="function"?{boundary:"references",method:"filter",where:e}:typeof e=="string"?di(e,nc.applyBoundary)?{method:"filter",boundary:e}:{boundary:"references",method:"filter",kind:e}:{boundary:"references",method:"filter",...e}},Bx=(e,t)=>`${e} had no references matching ${bt(t)}.`,_2=e=>Uc(e,{stringifyNonKey:t=>t.expression}),U2=/"(\$ark\.[^"]+)"/g,B2=e=>JSON.stringify(e).replace(U2,"$1"),Nr=(e,t)=>({path:e,node:t,propString:_2(e)}),WN=(e,t)=>e.propString===t.propString&&e.node.equals(t.node),Fx=(e,t)=>ds(e,t,{isEqual:WN}),F2=(e,t)=>ds(e,t,{isEqual:(n,i)=>n.equals(i)});class Me extends Array{static init(t,n,i,s){return new Me({kind:t,l:n,r:i,path:s?.path??[],optional:s?.optional??!1})}add(t,n,i,s){return this.push({kind:t,l:n,r:i,path:s?.path??[],optional:s?.optional??!1}),this}get summary(){return this.describeReasons()}describeReasons(){if(this.length===1){const{path:t,l:n,r:i}=this[0],s=Uc(t);return QN(`Intersection${s&&` at ${s}`} of ${Hx(n,i)}`)}return`The following intersections result in unsatisfiable types:
|
|
37
|
-
• ${this.map(({path:t,l:n,r:i})=>`${t}: ${Hx(n,i)}`).join(`
|
|
38
|
-
• `)}`}throw(){return le(this.describeReasons())}invert(){const t=this.map(n=>({...n,l:n.r,r:n.l}));return t instanceof Me?t:new Me(...t)}withPrefixKey(t,n){return this.map(i=>({...i,path:[t,...i.path],optional:i.optional||n==="optional"}))}toNeverIfDisjoint(){return pe.intrinsic.never}}const Hx=(e,t)=>`${sg(e)} and ${sg(t)}`,sg=e=>_n(e)?e.expression:kn(e)?e.map(sg).join(" | ")||"never":String(e),QN=e=>`${e} results in an unsatisfiable type`,lo={},Ii=(e,t,n)=>yn(e,t,{$:n,invert:!1,pipe:!1}),og=(e,t,n)=>yn(e,t,{$:n,invert:!1,pipe:!0}),yn=((e,t,n)=>{const i=n.pipe?"|>":"&",s=`${e.hash}${i}${t.hash}`;if(lo[s]!==void 0)return lo[s];if(!n.pipe){const d=`${t.hash}${i}${e.hash}`;if(lo[d]!==void 0){const h=lo[d],m=h instanceof Me?h.invert():h;return lo[s]=m,m}}const l=!n.pipe||!e.includesTransform&&!t.includesTransform;if(l&&e.equals(t))return e;let c=l?lg(e,t,n):e.hasKindIn(...Ef)?H2(e,t,n):lg(e,t,n);return _n(c)&&(e.equals(c)?c=e:t.equals(c)&&(c=t)),lo[s]=c,c}),lg=(e,t,n)=>{const i=e.precedence<t.precedence?e.kind:t.kind,s=e.impl.intersections[t.kind]??t.impl.intersections[e.kind];if(s===void 0)return null;if(i===e.kind)return s(e,t,n);{let l=s(t,e,{...n,invert:!n.invert});return l instanceof Me&&(l=l.invert()),l}},H2=(e,t,n)=>e.includesTransform||t.includesTransform?n.invert?qx(t,e,n):qx(e,t,n):lg(e,t,n),qx=(e,t,n)=>e.distribute(i=>q2(i,t,n),i=>{const s=i.filter(_n);if(s.length===0)return Me.init("union",e.branches,t.branches);if(s.length<e.branches.length||!e.branches.every((c,d)=>c.rawIn.equals(s[d].rawIn)))return n.$.parseSchema(s);if(s.length===1)return s[0];const l={branches:s};return n.$.parseSchema(l)}),q2=(e,t,n)=>{if(e.hasKind("morph")){const s=[...e.morphs];if(e.lastMorphIfNode){const l=yn(e.lastMorphIfNode,t,n);if(l instanceof Me)return l;s[s.length-1]=l}else s.push(t);return n.$.node("morph",{morphs:s,in:e.inner.in})}if(t.hasKind("morph")){const s=yn(e,t.rawIn,n);return s instanceof Me?s:n.$.node("morph",{morphs:[t],in:s})}return n.$.node("morph",{morphs:[t],in:e})};class zo extends XN{constructor(t,n){super(t,n),Object.defineProperty(this,Li,{value:"constraint",enumerable:!1})}impliedSiblings;intersect(t){return Ii(this,t,this.$)}}class Mf extends zo{traverseApply=(t,n)=>{this.traverseAllows(t,n)||n.errorFromNodeContext(this.errorContext)};compile(t){t.traversalKind==="Allows"?t.return(this.compiledCondition):t.if(this.compiledNegation,()=>t.line(`ctx.errorFromNodeContext(${this.compiledErrorContext})`))}get errorContext(){return{code:this.kind,description:this.description,meta:this.meta,...this.inner}}get compiledErrorContext(){return Af(this.errorContext)}}const ea=e=>(t,n)=>{if(kn(t)){if(t.length===0)return;const s=t.map(l=>n.$.node(e,l));return e==="predicate"?s:s.sort((l,c)=>l.hash<c.hash?-1:1)}const i=n.$.node(e,t);return i.hasOpenIntersection()?[i]:i},tf=e=>{const t=e.r.shift();if(!t){let i=e.l.length===0&&e.kind==="structure"?pe.intrinsic.unknown.internal:e.ctx.$.node(e.kind,Object.assign(e.baseInner,V2(e.l)),{prereduced:!0});for(const s of e.roots){if(i instanceof Me)return i;i=yn(s,i,e.ctx)}return i}let n=!1;for(let i=0;i<e.l.length;i++){const s=yn(e.l[i],t,e.ctx);if(s!==null){if(s instanceof Me)return s;if(s.isRoot())return e.roots.push(s),e.l.splice(i),tf(e);if(!n)e.l[i]=s,n=!0;else if(!e.l.includes(s))return cn(`Unexpectedly encountered multiple distinct intersection results for refinement ${t}`)}}if(n||e.l.push(t),e.kind==="intersection"&&t.impliedSiblings)for(const i of t.impliedSiblings)ds(e.r,i);return tf(e)},nf=e=>Object.entries(e).flatMap(([n,i])=>n in GN?i:[]).sort((n,i)=>n.precedence<i.precedence?-1:n.precedence>i.precedence?1:n.kind==="predicate"&&i.kind==="predicate"?0:n.hash<i.hash?-1:1),V2=e=>{const t={};for(const n of e)if(n.hasOpenIntersection())t[n.kind]=Dt(t[n.kind],n);else{if(t[n.kind])return cn(`Unexpected intersection of closed refinements of kind ${n.kind}`);t[n.kind]=n}return t},K2=(...e)=>le(G2(...e)),G2=(e,t,n)=>{const i=n.hasKind("morph")?"a morph":n.isUnknown()?"unknown":n.exclude(t).defaultShortDescription;return`${a2(e)} operand must be ${t.description} (was ${i})`},Y2=(e,t,n)=>new af(e,t,n,n,null);class ZN extends kr{}class af extends kr{[Li]="generic";paramDefs;bodyDef;$;arg$;baseInstantiation;hkt;description;constructor(t,n,i,s,l){super((...c)=>{const d=Nt(this.names,(h,m)=>{const y=this.arg$.parse(c[h]);return y.extends(this.constraints[h])||le(J2(m,this.constraints[h].expression,y.expression)),[m,y]});if(this.defIsLazy()){const h=this.bodyDef(d);return this.$.parse(h)}return this.$.parse(n,{args:d})}),this.paramDefs=t,this.bodyDef=n,this.$=i,this.arg$=s,this.hkt=l,this.description=l?new l().description??`a generic type for ${l.constructor.name}`:"a generic type",this.baseInstantiation=this(...this.constraints)}defIsLazy(){return this.bodyDef instanceof ZN}cacheGetter(t,n){return Object.defineProperty(this,t,{value:n}),n}get json(){return this.cacheGetter("json",{params:this.params.map(t=>t[1].isUnknown()?t[0]:[t[0],t[1].json]),body:D2(this.bodyDef)})}get params(){return this.cacheGetter("params",this.paramDefs.map(t=>typeof t=="string"?[t,pe.intrinsic.unknown]:[t[0],this.$.parse(t[1])]))}get names(){return this.cacheGetter("names",this.params.map(t=>t[0]))}get constraints(){return this.cacheGetter("constraints",this.params.map(t=>t[1]))}get internal(){return this}get referencesById(){return this.baseInstantiation.internal.referencesById}get references(){return this.baseInstantiation.internal.references}}const J2=(e,t,n)=>`${e} must be assignable to ${t} (was ${n})`,X2=Gt({kind:"predicate",hasAssociatedError:!0,collapsibleKey:"predicate",keys:{predicate:{}},normalize:e=>typeof e=="function"?{predicate:e}:e,defaults:{description:e=>`valid according to ${e.predicate.name||"an anonymous predicate"}`},intersectionIsOpen:!0,intersections:{predicate:()=>null}});class W2 extends zo{serializedPredicate=Un(this.predicate);compiledCondition=`${this.serializedPredicate}(data, ctx)`;compiledNegation=`!${this.compiledCondition}`;impliedBasis=null;expression=this.serializedPredicate;traverseAllows=this.predicate;errorContext={code:"predicate",description:this.description,meta:this.meta};compiledErrorContext=Af(this.errorContext);traverseApply=(t,n)=>{!this.predicate(t,n.external)&&!n.hasError()&&n.errorFromNodeContext(this.errorContext)};compile(t){if(t.traversalKind==="Allows"){t.return(this.compiledCondition);return}t.if(`${this.compiledNegation} && !ctx.hasError()`,()=>t.line(`ctx.errorFromNodeContext(${this.compiledErrorContext})`))}reduceJsonSchema(t,n){return n.fallback.predicate({code:"predicate",base:t,predicate:this.predicate})}}const eC={implementation:X2,Node:W2},Q2=Gt({kind:"divisor",collapsibleKey:"rule",keys:{rule:{parse:e=>Number.isInteger(e)?e:le(eL(e))}},normalize:e=>typeof e=="number"?{rule:e}:e,hasAssociatedError:!0,defaults:{description:e=>e.rule===1?"an integer":e.rule===2?"even":`a multiple of ${e.rule}`},intersections:{divisor:(e,t,n)=>n.$.node("divisor",{rule:Math.abs(e.rule*t.rule/tL(e.rule,t.rule))})},obviatesBasisDescription:!0});class Z2 extends Mf{traverseAllows=t=>t%this.rule===0;compiledCondition=`data % ${this.rule} === 0`;compiledNegation=`data % ${this.rule} !== 0`;impliedBasis=pe.intrinsic.number.internal;expression=`% ${this.rule}`;reduceJsonSchema(t){return t.type="integer",this.rule===1||(t.multipleOf=this.rule),t}}const tC={implementation:Q2,Node:Z2},eL=e=>`divisor must be an integer (was ${e})`,tL=(e,t)=>{let n,i=e,s=t;for(;s!==0;)n=s,s=i%s,i=n;return i};class _o extends Mf{boundOperandKind=rL[this.kind];compiledActual=this.boundOperandKind==="value"?"data":this.boundOperandKind==="length"?"data.length":"data.valueOf()";comparator=sL(this.kind,this.exclusive);numericLimit=this.rule.valueOf();expression=`${this.comparator} ${this.rule}`;compiledCondition=`${this.compiledActual} ${this.comparator} ${this.numericLimit}`;compiledNegation=`${this.compiledActual} ${nL[this.comparator]} ${this.numericLimit}`;stringLimit=this.boundOperandKind==="date"?oL(this.numericLimit):`${this.numericLimit}`;limitKind=this.comparator[0]==="<"?"upper":"lower";isStricterThan(t){return(this.limitKind==="upper"?this.numericLimit<t.numericLimit:this.numericLimit>t.numericLimit)||this.numericLimit===t.numericLimit&&this.exclusive===!0&&!t.exclusive}overlapsRange(t){return!(this.isStricterThan(t)||this.numericLimit===t.numericLimit&&(this.exclusive||t.exclusive))}overlapIsUnit(t){return this.numericLimit===t.numericLimit&&!this.exclusive&&!t.exclusive}}const nL={"<":">=","<=":">",">":"<=",">=":"<"},aL={min:"max",minLength:"maxLength",after:"before"},nC={parse:e=>e||void 0},aC=e=>t=>{if(typeof t=="number")return{rule:t};const{exclusive:n,...i}=t;return n?{...i,rule:e==="minLength"?i.rule+1:i.rule-1}:i},iC=e=>t=>{if(typeof t=="number"||typeof t=="string"||t instanceof Date)return{rule:t};const{exclusive:n,...i}=t;if(!n)return i;const s=typeof i.rule=="number"?i.rule:typeof i.rule=="string"?new Date(i.rule).valueOf():i.rule.valueOf();return n?{...i,rule:e==="after"?s+1:s-1}:i},rC=e=>typeof e=="string"||typeof e=="number"?new Date(e):e,iL=(e,t)=>`${e} bound must be a positive integer (was ${t})`,uy=e=>t=>((!Number.isInteger(t)||t<0)&&le(iL(e,t)),t),rL={min:"value",max:"value",minLength:"length",maxLength:"length",after:"date",before:"date"},sL=(e,t)=>`${di(e,aL)?">":"<"}${t?"":"="}`,oL=e=>typeof e=="string"?e:new Date(e).toLocaleString(),lL=e=>`Bounded expression ${e} must be exactly one of number, string, Array, or Date`,cL=Gt({kind:"after",collapsibleKey:"rule",hasAssociatedError:!0,keys:{rule:{parse:rC,serialize:e=>e.toISOString()}},normalize:iC("after"),defaults:{description:e=>`${e.collapsibleLimitString} or later`,actual:_c},intersections:{after:(e,t)=>e.isStricterThan(t)?e:t}});class uL extends _o{impliedBasis=pe.intrinsic.Date.internal;collapsibleLimitString=_c(this.rule);traverseAllows=t=>t>=this.rule;reduceJsonSchema(t,n){return n.fallback.date({code:"date",base:t,after:this.rule})}}const sC={implementation:cL,Node:uL},dL=Gt({kind:"before",collapsibleKey:"rule",hasAssociatedError:!0,keys:{rule:{parse:rC,serialize:e=>e.toISOString()}},normalize:iC("before"),defaults:{description:e=>`${e.collapsibleLimitString} or earlier`,actual:_c},intersections:{before:(e,t)=>e.isStricterThan(t)?e:t,after:(e,t,n)=>e.overlapsRange(t)?e.overlapIsUnit(t)?n.$.node("unit",{unit:e.rule}):null:Me.init("range",e,t)}});class fL extends _o{collapsibleLimitString=_c(this.rule);traverseAllows=t=>t<=this.rule;impliedBasis=pe.intrinsic.Date.internal;reduceJsonSchema(t,n){return n.fallback.date({code:"date",base:t,before:this.rule})}}const oC={implementation:dL,Node:fL},hL=Gt({kind:"exactLength",collapsibleKey:"rule",keys:{rule:{parse:uy("exactLength")}},normalize:e=>typeof e=="number"?{rule:e}:e,hasAssociatedError:!0,defaults:{description:e=>`exactly length ${e.rule}`,actual:e=>`${e.length}`},intersections:{exactLength:(e,t,n)=>Me.init("unit",n.$.node("unit",{unit:e.rule}),n.$.node("unit",{unit:t.rule}),{path:["length"]}),minLength:(e,t)=>e.rule>=t.rule?e:Me.init("range",e,t),maxLength:(e,t)=>e.rule<=t.rule?e:Me.init("range",e,t)}});class mL extends Mf{traverseAllows=t=>t.length===this.rule;compiledCondition=`data.length === ${this.rule}`;compiledNegation=`data.length !== ${this.rule}`;impliedBasis=pe.intrinsic.lengthBoundable.internal;expression=`== ${this.rule}`;reduceJsonSchema(t){switch(t.type){case"string":return t.minLength=this.rule,t.maxLength=this.rule,t;case"array":return t.minItems=this.rule,t.maxItems=this.rule,t;default:return hn.throwInternalOperandError("exactLength",t)}}}const lC={implementation:hL,Node:mL},pL=Gt({kind:"max",collapsibleKey:"rule",hasAssociatedError:!0,keys:{rule:{},exclusive:nC},normalize:e=>typeof e=="number"?{rule:e}:e,defaults:{description:e=>e.rule===0?e.exclusive?"negative":"non-positive":`${e.exclusive?"less than":"at most"} ${e.rule}`},intersections:{max:(e,t)=>e.isStricterThan(t)?e:t,min:(e,t,n)=>e.overlapsRange(t)?e.overlapIsUnit(t)?n.$.node("unit",{unit:e.rule}):null:Me.init("range",e,t)},obviatesBasisDescription:!0});class gL extends _o{impliedBasis=pe.intrinsic.number.internal;traverseAllows=this.exclusive?t=>t<this.rule:t=>t<=this.rule;reduceJsonSchema(t){return this.exclusive?t.exclusiveMaximum=this.rule:t.maximum=this.rule,t}}const cC={implementation:pL,Node:gL},yL=Gt({kind:"maxLength",collapsibleKey:"rule",hasAssociatedError:!0,keys:{rule:{parse:uy("maxLength")}},reduce:(e,t)=>e.rule===0?t.node("exactLength",e):void 0,normalize:aC("maxLength"),defaults:{description:e=>`at most length ${e.rule}`,actual:e=>`${e.length}`},intersections:{maxLength:(e,t)=>e.isStricterThan(t)?e:t,minLength:(e,t,n)=>e.overlapsRange(t)?e.overlapIsUnit(t)?n.$.node("exactLength",{rule:e.rule}):null:Me.init("range",e,t)}});class vL extends _o{impliedBasis=pe.intrinsic.lengthBoundable.internal;traverseAllows=t=>t.length<=this.rule;reduceJsonSchema(t){switch(t.type){case"string":return t.maxLength=this.rule,t;case"array":return t.maxItems=this.rule,t;default:return hn.throwInternalOperandError("maxLength",t)}}}const uC={implementation:yL,Node:vL},bL=Gt({kind:"min",collapsibleKey:"rule",hasAssociatedError:!0,keys:{rule:{},exclusive:nC},normalize:e=>typeof e=="number"?{rule:e}:e,defaults:{description:e=>e.rule===0?e.exclusive?"positive":"non-negative":`${e.exclusive?"more than":"at least"} ${e.rule}`},intersections:{min:(e,t)=>e.isStricterThan(t)?e:t},obviatesBasisDescription:!0});class SL extends _o{impliedBasis=pe.intrinsic.number.internal;traverseAllows=this.exclusive?t=>t>this.rule:t=>t>=this.rule;reduceJsonSchema(t){return this.exclusive?t.exclusiveMinimum=this.rule:t.minimum=this.rule,t}}const dC={implementation:bL,Node:SL},xL=Gt({kind:"minLength",collapsibleKey:"rule",hasAssociatedError:!0,keys:{rule:{parse:uy("minLength")}},reduce:e=>e.rule===0?pe.intrinsic.unknown:void 0,normalize:aC("minLength"),defaults:{description:e=>e.rule===1?"non-empty":`at least length ${e.rule}`,actual:e=>e.length===0?"":`${e.length}`},intersections:{minLength:(e,t)=>e.isStricterThan(t)?e:t}});class wL extends _o{impliedBasis=pe.intrinsic.lengthBoundable.internal;traverseAllows=t=>t.length>=this.rule;reduceJsonSchema(t){switch(t.type){case"string":return t.minLength=this.rule,t;case"array":return t.minItems=this.rule,t;default:return hn.throwInternalOperandError("minLength",t)}}}const fC={implementation:xL,Node:wL},DL={min:dC.implementation,max:cC.implementation,minLength:fC.implementation,maxLength:uC.implementation,exactLength:lC.implementation,after:sC.implementation,before:oC.implementation},NL={min:dC.Node,max:cC.Node,minLength:fC.Node,maxLength:uC.Node,exactLength:lC.Node,after:sC.Node,before:oC.Node},CL=Gt({kind:"pattern",collapsibleKey:"rule",keys:{rule:{},flags:{}},normalize:e=>typeof e=="string"?{rule:e}:e instanceof RegExp?e.flags?{rule:e.source,flags:e.flags}:{rule:e.source}:e,obviatesBasisDescription:!0,obviatesBasisExpression:!0,hasAssociatedError:!0,intersectionIsOpen:!0,defaults:{description:e=>`matched by ${e.rule}`},intersections:{pattern:()=>null}});class EL extends Mf{instance=new RegExp(this.rule,this.flags);expression=`${this.instance}`;traverseAllows=this.instance.test.bind(this.instance);compiledCondition=`${this.expression}.test(data)`;compiledNegation=`!${this.compiledCondition}`;impliedBasis=pe.intrinsic.string.internal;reduceJsonSchema(t,n){return t.pattern?n.fallback.patternIntersection({code:"patternIntersection",base:t,pattern:this.rule}):(t.pattern=this.rule,t)}}const hC={implementation:CL,Node:EL},Pd=(e,t)=>{const n=AL(e);return t&&!t.includes(n)?le(`Root of kind ${n} should be one of ${t}`):n},AL=e=>{if(Re(e,"root"))return e.kind;if(typeof e=="string")return e[0]==="$"?"alias":e in Ri?"domain":"proto";if(typeof e=="function")return"proto";if(typeof e!="object"||e===null)return le(Vx(e));if("morphs"in e)return"morph";if("branches"in e||kn(e))return"union";if("unit"in e)return"unit";if("reference"in e)return"alias";const t=Object.keys(e);return t.length===0||t.some(n=>n in GN)?"intersection":"proto"in e?"proto":"domain"in e?"domain":le(Vx(e))},Vx=e=>`${bt(e)} is not a valid type schema`,Kx={},ML=e=>kn(e)?e.map(t=>t.collapsibleJson):e.collapsibleJson,ka={};pe.nodesByRegisteredId=ka;const mC=e=>(Kx[e]??=0,`${e}${++Kx[e]}`),pC=e=>{const t=Tf[e.kind],n=t.applyConfig?.(e.def,e.$.resolvedConfig)??e.def,i={},{meta:s,...l}=n,c=s===void 0?{}:typeof s=="string"?{description:s}:s,d=NN(l).sort(([m],[y])=>Ld(m)?Ld(y)?ef(m)-ef(y):1:Ld(y)||m<y?-1:1).filter(([m,y])=>{if(m.startsWith("meta.")){const v=m.slice(5);return c[v]=y,!1}return!0});for(const m of d){const y=m[0],v=t.keys[y];if(!v)return le(`Key ${y} is not valid on ${e.kind} schema`);const b=v.parse?v.parse(m[1],e):m[1];b!==ni&&(b!==void 0||v.preserveUndefined)&&(i[y]=b)}if(t.reduce&&!e.prereduced){const m=t.reduce(i,e.$);if(m)return m instanceof Me?m.throw():jL(m,c)}return dy({id:e.id,kind:e.kind,inner:i,meta:c,$:e.$})},dy=({id:e,kind:t,inner:n,meta:i,$:s,ignoreCache:l})=>{const c=Tf[t],d=NN(n),h=[];let m={};for(const[A,T]of d){const j=c.keys[A],F=j.serialize??(j.child?ML:hs);if(m[A]=F(T),j.child===!0){const z=T;kn(z)?h.push(...z):h.push(z)}else typeof j.child=="function"&&h.push(...j.child(T))}c.finalizeInnerJson&&(m=c.finalizeInnerJson(m));let y={...m},v={};Ic(i)||(v=Nt(i,(A,T)=>[A,A==="examples"?T:hs(T)]),y.meta=wd(v,"description",!0)),m=wd(m,c.collapsibleKey,!1);const b=JSON.stringify({kind:t,...m});y=wd(y,c.collapsibleKey,!1);const D=wd(y,c.collapsibleKey,!0),w=JSON.stringify({kind:t,...y});if(s.nodesByHash[w]&&!l)return s.nodesByHash[w];const N={id:e,kind:t,impl:c,inner:n,innerEntries:d,innerJson:m,innerHash:b,meta:i,metaJson:v,json:y,hash:w,collapsibleJson:D,children:h};if(t!=="intersection")for(const A in n)A!=="in"&&A!=="out"&&(N[A]=n[A]);const M=new PP[t](N,s);return s.nodesByHash[w]=M},TL=(e,t)=>e.id===t?e:(_n(ka[t])&&cn(`Unexpected attempt to overwrite node id ${t}`),dy({id:t,kind:e.kind,inner:e.inner,meta:e.meta,$:e.$,ignoreCache:!0})),jL=(e,t,n)=>dy({id:mC(t.alias??e.kind),kind:e.kind,inner:e.inner,meta:t,$:e.$}),wd=(e,t,n)=>{const i=Object.keys(e);if(i.length===1&&i[0]===t){const s=e[t];if(n||ps(s,"object")&&(Object.keys(s).length===1||Array.isArray(s)))return s}return e},cg=(e,t,n)=>{if(e.key!==t.key)return null;const i=e.key;let s=yn(e.value,t.value,n);const l=e.required||t.required?"required":"optional";if(s instanceof Me)if(l==="optional")s=pe.intrinsic.never.internal;else return s.withPrefixKey(e.key,e.required&&t.required?"required":"optional");if(l==="required")return n.$.node("required",{key:i,value:s});const c=e.hasDefault()?t.hasDefault()?e.default===t.default?e.default:le(yC(e.default,t.default)):e.default:t.hasDefault()?t.default:ni;return n.$.node("optional",{key:i,value:s,default:c})};class gC extends zo{required=this.kind==="required";optional=this.kind==="optional";impliedBasis=pe.intrinsic.object.internal;serializedKey=Io(this.key);compiledKey=typeof this.key=="string"?this.key:this.serializedKey;flatRefs=Dt(this.value.flatRefs.map(t=>Nr([this.key,...t.path],t.node)),Nr([this.key],this.value));_transform(t,n){n.path.push(this.key);const i=super._transform(t,n);return n.path.pop(),i}hasDefault(){return"default"in this.inner}traverseAllows=(t,n)=>this.key in t?Pi(this.key,()=>this.value.traverseAllows(t[this.key],n),n):this.optional;traverseApply=(t,n)=>{this.key in t?Pi(this.key,()=>this.value.traverseApply(t[this.key],n),n):this.hasKind("required")&&n.errorFromNodeContext(this.errorContext)};compile(t){t.if(`${this.serializedKey} in data`,()=>t.traverseKey(this.serializedKey,`data${t.prop(this.key)}`,this.value)),this.hasKind("required")&&t.else(()=>t.traversalKind==="Apply"?t.line(`ctx.errorFromNodeContext(${this.compiledErrorContext})`):t.return(!1)),t.traversalKind==="Allows"&&t.return(!0)}}const yC=(e,t)=>`Invalid intersection of default values ${bt(e)} & ${bt(t)}`,kL=Gt({kind:"optional",hasAssociatedError:!1,intersectionIsOpen:!0,keys:{key:{},value:{child:!0,parse:(e,t)=>t.$.parseSchema(e)},default:{preserveUndefined:!0}},normalize:e=>e,reduce:(e,t)=>{if(t.resolvedConfig.exactOptionalPropertyTypes===!1&&!e.value.allows(void 0))return t.node("optional",{...e,value:e.value.or(Ie.undefined)},{prereduced:!0})},defaults:{description:e=>`${e.compiledKey}?: ${e.value.description}`},intersections:{optional:cg}});class $L extends gC{constructor(...t){super(...t),"default"in this.inner&&hy(this.value,this.inner.default,this.key)}get rawIn(){const t=super.rawIn;return this.hasDefault()?this.$.node("optional",EN(t.inner,{default:!0}),{prereduced:!0}):t}get outProp(){if(!this.hasDefault())return this;const{default:t,...n}=this.inner;return this.cacheGetter("outProp",this.$.node("required",n,{prereduced:!0}))}expression=this.hasDefault()?`${this.compiledKey}: ${this.value.expression} = ${bt(this.inner.default)}`:`${this.compiledKey}?: ${this.value.expression}`;defaultValueMorph=RL(this);defaultValueMorphRef=this.defaultValueMorph&&Un(this.defaultValueMorph)}const fy={implementation:kL,Node:$L},OL={},RL=e=>{if(!e.hasDefault())return;const t=`{${e.compiledKey}: ${e.value.id} = ${hs(e.default)}}`;return OL[t]??=vC(e.key,e.value,e.default)},vC=(e,t,n)=>{if(typeof n=="function")return t.includesTransform?(s,l)=>(Pi(e,()=>t(s[e]=n(),l),l),s):s=>(s[e]=n(),s);const i=t.includesTransform?t.assert(n):n;return ps(i,"object")?(s,l)=>(Pi(e,()=>t(s[e]=n,l),l),s):s=>(s[e]=i,s)},hy=(e,t,n)=>{const i=Df(t);ps(t,"object")&&!i&&le(LL(n));const s=e.in(i?t():t);if(s instanceof Mr){n===null&&le(`Default ${s.summary}`);const l=s.transform(c=>c.transform(d=>({...d,prefixPath:[n]})));le(`Default for ${l.summary}`)}return t},LL=e=>`Non-primitive default ${e===null?"":typeof e=="number"?`for value at [${e}] `:`for ${Io(e)} `}must be specified as a function like () => ({my: 'object'})`;class Bc extends XN{constructor(t,n){super(t,n),Object.defineProperty(this,Li,{value:"root",enumerable:!1})}get rawIn(){return super.rawIn}get rawOut(){return super.rawOut}get internal(){return this}get"~standard"(){return{vendor:"arktype",version:1,validate:t=>{const n=this(t);return n instanceof Mr?n:{value:n}},toJSONSchema:t=>t.target&&t.target!=="draft-2020-12"?le(`JSONSchema target '${t.target}' is not supported (must be "draft-2020-12")`):t.io==="input"?this.rawIn.toJsonSchema():this.rawOut.toJsonSchema()}}as(){return this}brand(t){return t===""?le(PL):this}readonly(){return this}branches=this.hasKind("union")?this.inner.branches:[this];distribute(t,n){const i=this.branches.map(t);return n?.(i)??i}get shortDescription(){return this.meta.description??this.defaultShortDescription}toJsonSchema(t={}){const n=JN(this.$.resolvedConfig.toJsonSchema,t);n.useRefs||=this.isCyclic;const i=typeof n.dialect=="string"?{$schema:n.dialect}:{};return Object.assign(i,this.toJsonSchemaRecurse(n)),n.useRefs&&(i.$defs=Nt(this.references,(s,l)=>l.isRoot()&&!l.alwaysExpandJsonSchema?[l.id,l.toResolvedJsonSchema(n)]:[])),i}toJsonSchemaRecurse(t){return t.useRefs&&!this.alwaysExpandJsonSchema?{$ref:`#/$defs/${this.id}`}:this.toResolvedJsonSchema(t)}get alwaysExpandJsonSchema(){return this.isBasis()||this.kind==="alias"||this.hasKind("union")&&this.isBoolean}toResolvedJsonSchema(t){const n=this.innerToJsonSchema(t);return Object.assign(n,this.metaJson)}intersect(t){const n=this.$.parseDefinition(t),i=this.rawIntersect(n);return i instanceof Me?i:this.$.finalize(i)}rawIntersect(t){return Ii(this,t,this.$)}toNeverIfDisjoint(){return this}and(t){const n=this.intersect(t);return n instanceof Me?n.throw():n}rawAnd(t){const n=this.rawIntersect(t);return n instanceof Me?n.throw():n}or(t){const n=this.$.parseDefinition(t);return this.$.finalize(this.rawOr(n))}rawOr(t){const n=[...this.branches,...t.branches];return this.$.node("union",n)}map(t){return this.$.schema(this.applyStructuralOperation("map",[t]))}pick(...t){return this.$.schema(this.applyStructuralOperation("pick",t))}omit(...t){return this.$.schema(this.applyStructuralOperation("omit",t))}required(){return this.$.schema(this.applyStructuralOperation("required",[]))}partial(){return this.$.schema(this.applyStructuralOperation("partial",[]))}_keyof;keyof(){if(this._keyof)return this._keyof;const t=this.applyStructuralOperation("keyof",[]).reduce((n,i)=>n.intersect(i).toNeverIfDisjoint(),pe.intrinsic.unknown.internal);return t.branches.length===0&&le(QN(`keyof ${this.expression}`)),this._keyof=this.$.finalize(t)}get props(){return this.branches.length!==1?le(IL(this.expression)):[...this.applyStructuralOperation("props",[])[0]]}merge(t){const n=this.$.parseDefinition(t);return this.$.schema(n.distribute(i=>this.applyStructuralOperation("merge",[Gx(i)??le(Yx("merge",i.expression))])))}applyStructuralOperation(t,n){return this.distribute(i=>{if(i.equals(pe.intrinsic.object)&&t!=="merge")return i;const s=Gx(i);if(s||le(Yx(t,i.expression)),t==="keyof")return s.keyof();if(t==="get")return s.get(...n);if(t==="props")return s.props;const l=t==="required"?"require":t==="partial"?"optionalize":t;return this.$.node("intersection",{domain:"object",structure:s[l](...n)})})}get(...t){return t[0]===void 0?this:this.$.schema(this.applyStructuralOperation("get",t))}extract(t){const n=this.$.parseDefinition(t);return this.$.schema(this.branches.filter(i=>i.extends(n)))}exclude(t){const n=this.$.parseDefinition(t);return this.$.schema(this.branches.filter(i=>!i.extends(n)))}array(){return this.$.schema(this.isUnknown()?{proto:Array}:{proto:Array,sequence:this},{prereduced:!0})}overlaps(t){return!(this.intersect(t)instanceof Me)}extends(t){if(this.isNever())return!0;const n=this.intersect(t);return!(n instanceof Me)&&this.equals(n)}ifExtends(t){return this.extends(t)?this:void 0}subsumes(t){return this.$.parseDefinition(t).extends(this)}configure(t,n="shallow"){return this.configureReferences(t,n)}describe(t,n="shallow"){return this.configure({description:t},n)}optional(){return[this,"?"]}default(t){return hy(this,t,null),[this,"=",t]}from(t){return this.assert(t)}_pipe(...t){const n=t.reduce((i,s)=>i.rawPipeOnce(s),this);return this.$.finalize(n)}tryPipe(...t){const n=t.reduce((i,s)=>i.rawPipeOnce(Re(s,"root")?s:((l,c)=>{try{return s(l,c)}catch(d){return c.error({code:"predicate",predicate:s,actual:`aborted due to error:
|
|
39
|
-
${d}
|
|
40
|
-
`})}})),this);return this.$.finalize(n)}pipe=Object.assign(this._pipe.bind(this),{try:this.tryPipe.bind(this)});to(t){return this.$.finalize(this.toNode(this.$.parseDefinition(t)))}toNode(t){const n=og(this,t,this.$);return n instanceof Me?n.throw():n}rawPipeOnce(t){return Re(t,"root")?this.toNode(t):this.distribute(n=>n.hasKind("morph")?this.$.node("morph",{in:n.inner.in,morphs:[...n.morphs,t]}):this.$.node("morph",{in:n,morphs:[t]}),this.$.parseSchema)}narrow(t){return this.constrainOut("predicate",t)}constrain(t,n){return this._constrain("root",t,n)}constrainIn(t,n){return this._constrain("in",t,n)}constrainOut(t,n){return this._constrain("out",t,n)}_constrain(t,n,i){const s=this.$.node(n,i);if(s.isRoot())return s.isUnknown()?this:cn(`Unexpected constraint node ${s}`);const l=t==="root"?this:t==="in"?this.rawIn:this.rawOut;if(l.hasKind("morph")||s.impliedBasis&&!l.extends(s.impliedBasis))return K2(n,s.impliedBasis,this);const c=this.$.node("intersection",{[s.kind]:s}),d=t==="out"?og(this,c,this.$):Ii(this,c,this.$);return d instanceof Me&&d.throw(),this.$.finalize(d)}onUndeclaredKey(t){const n=typeof t=="string"?t:t.rule,i=typeof t=="string"?!1:t.deep;return this.$.finalize(this.transform((s,l)=>s==="structure"?n==="ignore"?EN(l,{undeclared:1}):{...l,undeclared:n}:l,i?void 0:{shouldTransform:s=>!yr(Cf,s.kind)}))}hasEqualMorphs(t){return!this.includesTransform&&!t.includesTransform?!0:!(!Ao(this.shallowMorphs,t.shallowMorphs)||!Ao(this.flatMorphs,t.flatMorphs,{isEqual:(n,i)=>n.propString===i.propString&&(n.node.hasKind("morph")&&i.node.hasKind("morph")?n.node.hasEqualMorphs(i.node):n.node.hasKind("intersection")&&i.node.hasKind("intersection")?n.node.structure?.structuralMorphRef===i.node.structure?.structuralMorphRef:!1)}))}onDeepUndeclaredKey(t){return this.onUndeclaredKey({rule:t,deep:!0})}filter(t){return this.constrainIn("predicate",t)}divisibleBy(t){return this.constrain("divisor",t)}matching(t){return this.constrain("pattern",t)}atLeast(t){return this.constrain("min",t)}atMost(t){return this.constrain("max",t)}moreThan(t){return this.constrain("min",co(t))}lessThan(t){return this.constrain("max",co(t))}atLeastLength(t){return this.constrain("minLength",t)}atMostLength(t){return this.constrain("maxLength",t)}moreThanLength(t){return this.constrain("minLength",co(t))}lessThanLength(t){return this.constrain("maxLength",co(t))}exactlyLength(t){return this.constrain("exactLength",t)}atOrAfter(t){return this.constrain("after",t)}atOrBefore(t){return this.constrain("before",t)}laterThan(t){return this.constrain("after",co(t))}earlierThan(t){return this.constrain("before",co(t))}}const PL="Expected a non-empty brand name after #",co=e=>typeof e=="object"&&!(e instanceof Date)?{...e,exclusive:!0}:{rule:e,exclusive:!0},Dd=(e,t)=>Re(t,"root")?Re(e,"root")?e.extends(t):t.allows(e):Re(e,"root")?e.hasUnit(t):t===e,Gx=e=>e.hasKind("morph")?null:e.hasKind("intersection")?e.inner.structure??(e.basis?.domain==="object"?e.$.bindReference(pe.intrinsic.emptyStructure):null):e.isBasis()&&e.domain==="object"?e.$.bindReference(pe.intrinsic.emptyStructure):null,IL=e=>`Props cannot be extracted from a union. Use .distribute to extract props from each branch instead. Received:
|
|
41
|
-
${e}`,Yx=(e,t)=>`${e} operand must be an object (was ${t})`,Fc=(e,t)=>Nt(cy(e),(n,i)=>[i,t]),zL=e=>typeof e=="string"?{reference:e}:e,Jx=e=>e instanceof Me?pe.intrinsic.never.internal:e,_L=Gt({kind:"alias",hasAssociatedError:!1,collapsibleKey:"reference",keys:{reference:{serialize:e=>e.startsWith("$")?e:`$ark.${e}`},resolve:{}},normalize:zL,defaults:{description:e=>e.reference},intersections:{alias:(e,t,n)=>n.$.lazilyResolve(()=>Jx(yn(e.resolution,t.resolution,n)),`${e.reference}${n.pipe?"=>":"&"}${t.reference}`),...Fc("alias",(e,t,n)=>t.isUnknown()?e:t.isNever()?t:t.isBasis()&&!t.overlaps(pe.intrinsic.object)?Me.init("assignability",pe.intrinsic.object,t):n.$.lazilyResolve(()=>Jx(yn(e.resolution,t,n)),`${e.reference}${n.pipe?"=>":"&"}${t.id}`))}});class UL extends Bc{expression=this.reference;structure=void 0;get resolution(){const t=this._resolve();return ka[this.id]=t}_resolve(){if(this.resolve)return this.resolve();if(this.reference[0]==="$")return this.$.resolveRoot(this.reference.slice(1));const t=this.reference;let n=ka[t];const i=[];for(;Re(n,"context");){if(i.includes(n.id))return le(BL(n.id,i));i.push(n.id),n=ka[n.id]}return Re(n,"root")?n:cn(`Unexpected resolution for reference ${this.reference}
|
|
42
|
-
Seen: [${i.join("->")}]
|
|
43
|
-
Resolution: ${bt(n)}`)}get resolutionId(){if(this.reference.includes("&")||this.reference.includes("=>"))return this.resolution.id;if(this.reference[0]!=="$")return this.reference;const t=this.reference.slice(1),n=this.$.resolutions[t];return typeof n=="string"?n:Re(n,"root")?n.id:cn(`Unexpected resolution for reference ${this.reference}: ${bt(n)}`)}get defaultShortDescription(){return Ri.object}innerToJsonSchema(t){return this.resolution.toJsonSchemaRecurse(t)}traverseAllows=(t,n)=>{const i=n.seen[this.reference];return i?.includes(t)?!0:(n.seen[this.reference]=Dt(i,t),this.resolution.traverseAllows(t,n))};traverseApply=(t,n)=>{const i=n.seen[this.reference];i?.includes(t)||(n.seen[this.reference]=Dt(i,t),this.resolution.traverseApply(t,n))};compile(t){const n=this.resolutionId;t.if(`ctx.seen.${n} && ctx.seen.${n}.includes(data)`,()=>t.return(!0)),t.if(`!ctx.seen.${n}`,()=>t.line(`ctx.seen.${n} = []`)),t.line(`ctx.seen.${n}.push(data)`),t.return(t.invoke(n))}}const BL=(e,t)=>`Alias '${e}' has a shallow resolution cycle: ${[...t,e].join("->")}`,my={implementation:_L,Node:UL};class py extends Bc{traverseApply=(t,n)=>{this.traverseAllows(t,n)||n.errorFromNodeContext(this.errorContext)};get errorContext(){return{code:this.kind,description:this.description,meta:this.meta,...this.inner}}get compiledErrorContext(){return Af(this.errorContext)}compile(t){t.traversalKind==="Allows"?t.return(this.compiledCondition):t.if(this.compiledNegation,()=>t.line(`ctx.errorFromNodeContext(${this.compiledErrorContext})`))}}const FL=Gt({kind:"domain",hasAssociatedError:!0,collapsibleKey:"domain",keys:{domain:{},numberAllowsNaN:{}},normalize:e=>typeof e=="string"?{domain:e}:ay(e,"numberAllowsNaN")&&e.domain!=="number"?le(gy.writeBadAllowNanMessage(e.domain)):e,applyConfig:(e,t)=>e.numberAllowsNaN===void 0&&e.domain==="number"&&t.numberAllowsNaN?{...e,numberAllowsNaN:!0}:e,defaults:{description:e=>Ri[e.domain],actual:e=>Number.isNaN(e)?"NaN":Ri[Ya(e)]},intersections:{domain:(e,t)=>e.domain==="number"&&t.domain==="number"?e.numberAllowsNaN?t:e:Me.init("domain",e,t)}});class HL extends py{requiresNaNCheck=this.domain==="number"&&!this.numberAllowsNaN;traverseAllows=this.requiresNaNCheck?t=>typeof t=="number"&&!Number.isNaN(t):t=>Ya(t)===this.domain;compiledCondition=this.domain==="object"?'((typeof data === "object" && data !== null) || typeof data === "function")':`typeof data === "${this.domain}"${this.requiresNaNCheck?" && !Number.isNaN(data)":""}`;compiledNegation=this.domain==="object"?'((typeof data !== "object" || data === null) && typeof data !== "function")':`typeof data !== "${this.domain}"${this.requiresNaNCheck?" || Number.isNaN(data)":""}`;expression=this.numberAllowsNaN?"number | NaN":this.domain;get nestableExpression(){return this.numberAllowsNaN?`(${this.expression})`:this.expression}get defaultShortDescription(){return Ri[this.domain]}innerToJsonSchema(t){return this.domain==="bigint"||this.domain==="symbol"?t.fallback.domain({code:"domain",base:{},domain:this.domain}):{type:this.domain}}}const gy={implementation:FL,Node:HL,writeBadAllowNanMessage:e=>`numberAllowsNaN may only be specified with domain "number" (was ${e})`},qL=Gt({kind:"intersection",hasAssociatedError:!0,normalize:e=>{if(_n(e))return e;const{structure:t,...n}=e,i=!!t,s=t??{},l=Nt(n,(c,d)=>di(c,O2)?(i&&le(`Flattened structure key ${c} cannot be specified alongside a root 'structure' key.`),s[c]=d,[]):[c,d]);return(Re(s,"constraint")||!Ic(s))&&(l.structure=s),l},finalizeInnerJson:({structure:e,...t})=>ps(e,"object")?{...e,...t}:t,keys:{domain:{child:!0,parse:(e,t)=>t.$.node("domain",e)},proto:{child:!0,parse:(e,t)=>t.$.node("proto",e)},structure:{child:!0,parse:(e,t)=>t.$.node("structure",e),serialize:e=>{if(!e.sequence?.minLength)return e.collapsibleJson;const{sequence:t,...n}=e.collapsibleJson,{minVariadicLength:i,...s}=t,l=s.variadic&&Object.keys(s).length===1?s.variadic:s;return{...n,sequence:l}}},divisor:{child:!0,parse:ea("divisor")},max:{child:!0,parse:ea("max")},min:{child:!0,parse:ea("min")},maxLength:{child:!0,parse:ea("maxLength")},minLength:{child:!0,parse:ea("minLength")},exactLength:{child:!0,parse:ea("exactLength")},before:{child:!0,parse:ea("before")},after:{child:!0,parse:ea("after")},pattern:{child:!0,parse:ea("pattern")},predicate:{child:!0,parse:ea("predicate")}},reduce:(e,t)=>Xx({},e,{$:t,invert:!1,pipe:!1}),defaults:{description:e=>{if(e.children.length===0)return"unknown";if(e.structure)return e.structure.description;const t=[];if(e.basis&&!e.prestructurals.some(n=>n.impl.obviatesBasisDescription)&&t.push(e.basis.description),e.prestructurals.length){const n=e.prestructurals.slice().sort((i,s)=>i.kind==="min"&&s.kind==="max"?-1:0).map(i=>i.description);t.push(...n)}return e.inner.predicate&&t.push(...e.inner.predicate.map(n=>n.description)),t.join(" and ")},expected:e=>` ◦ ${e.errors.map(t=>t.expected).join(`
|
|
44
|
-
◦ `)}`,problem:e=>`(${e.actual}) must be...
|
|
45
|
-
${e.expected}`},intersections:{intersection:(e,t,n)=>Xx(e.inner,t.inner,n),...Fc("intersection",(e,t,n)=>{if(e.children.length===0)return t;const{domain:i,proto:s,...l}=e.inner,c=s??i,d=c?yn(c,t,n):t;return d instanceof Me?d:e?.basis?.equals(d)?e:e.$.node("intersection",{...l,[d.kind]:d},{prereduced:!0})})}});class VL extends Bc{basis=this.inner.domain??this.inner.proto??null;prestructurals=[];refinements=this.children.filter(t=>t.isRefinement()?(yr(VN,t.kind)&&this.prestructurals.push(t),!0):!1);structure=this.inner.structure;expression=KL(this);get shallowMorphs(){return this.inner.structure?.structuralMorph?[this.inner.structure.structuralMorph]:[]}get defaultShortDescription(){return this.basis?.defaultShortDescription??"present"}innerToJsonSchema(t){return this.children.reduce((n,i)=>i.isBasis()?i.toJsonSchemaRecurse(t):i.reduceJsonSchema(n,t),{})}traverseAllows=(t,n)=>this.children.every(i=>i.traverseAllows(t,n));traverseApply=(t,n)=>{const i=n.currentErrorCount;if(!(this.basis&&(this.basis.traverseApply(t,n),n.currentErrorCount>i))){if(this.prestructurals.length){for(let s=0;s<this.prestructurals.length-1;s++)if(this.prestructurals[s].traverseApply(t,n),n.failFast&&n.currentErrorCount>i)return;if(this.prestructurals[this.prestructurals.length-1].traverseApply(t,n),n.currentErrorCount>i)return}if(!(this.structure&&(this.structure.traverseApply(t,n),n.currentErrorCount>i))&&this.inner.predicate){for(let s=0;s<this.inner.predicate.length-1;s++)if(this.inner.predicate[s].traverseApply(t,n),n.failFast&&n.currentErrorCount>i)return;this.inner.predicate[this.inner.predicate.length-1].traverseApply(t,n)}}};compile(t){if(t.traversalKind==="Allows"){for(const n of this.children)t.check(n);t.return(!0);return}if(t.initializeErrorCount(),this.basis&&(t.check(this.basis),this.children.length>1&&t.returnIfFail()),this.prestructurals.length){for(let n=0;n<this.prestructurals.length-1;n++)t.check(this.prestructurals[n]),t.returnIfFailFast();t.check(this.prestructurals[this.prestructurals.length-1]),(this.structure||this.inner.predicate)&&t.returnIfFail()}if(this.structure&&(t.check(this.structure),this.inner.predicate&&t.returnIfFail()),this.inner.predicate){for(let n=0;n<this.inner.predicate.length-1;n++)t.check(this.inner.predicate[n]),t.returnIfFail();t.check(this.inner.predicate[this.inner.predicate.length-1])}}}const bC={implementation:qL,Node:VL},KL=e=>{if(e.structure?.expression)return e.structure.expression;const t=e.basis&&!e.prestructurals.some(s=>s.impl.obviatesBasisExpression)?e.basis.nestableExpression:"",n=e.prestructurals.map(s=>s.expression).join(" & "),i=`${t}${t?" ":""}${n}`;return i==="Array == 0"?"[]":i||"unknown"},Xx=(e,t,n)=>{const i={},s=e.proto??e.domain,l=t.proto??t.domain,c=s?l?yn(s,l,n):s:l;return c instanceof Me?c:(c&&(i[c.kind]=c),tf({kind:"intersection",baseInner:i,l:nf(e),r:nf(t),roots:[],ctx:n}))},GL=Gt({kind:"morph",hasAssociatedError:!1,keys:{in:{child:!0,parse:(e,t)=>t.$.parseSchema(e)},morphs:{parse:Pc,serialize:e=>e.map(t=>Re(t,"root")?t.json:Un(t))},declaredIn:{child:!1,serialize:e=>e.json},declaredOut:{child:!1,serialize:e=>e.json}},normalize:e=>e,defaults:{description:e=>`a morph from ${e.rawIn.description} to ${e.rawOut?.description??"unknown"}`},intersections:{morph:(e,t,n)=>{if(!e.hasEqualMorphs(t))return le(JL(e.expression,t.expression));const i=yn(e.rawIn,t.rawIn,n);if(i instanceof Me)return i;const s={morphs:e.morphs};if(e.declaredIn||t.declaredIn){const l=yn(e.rawIn,t.rawIn,n);if(l instanceof Me)return l.throw();s.declaredIn=l}if(e.declaredOut||t.declaredOut){const l=yn(e.rawOut,t.rawOut,n);if(l instanceof Me)return l.throw();s.declaredOut=l}return i.distribute(l=>n.$.node("morph",{...s,in:l}),n.$.parseSchema)},...Fc("morph",(e,t,n)=>{const i=e.inner.in?yn(e.inner.in,t,n):t;return i instanceof Me?i:i.equals(e.inner.in)?e:n.$.node("morph",{...e.inner,in:i})})}});class YL extends Bc{serializedMorphs=this.morphs.map(Un);compiledMorphs=`[${this.serializedMorphs}]`;lastMorph=this.inner.morphs[this.inner.morphs.length-1];lastMorphIfNode=Re(this.lastMorph,"root")?this.lastMorph:void 0;introspectableIn=this.inner.in;introspectableOut=this.lastMorphIfNode?Object.assign(this.referencesById,this.lastMorphIfNode.referencesById)&&this.lastMorphIfNode.rawOut:void 0;get shallowMorphs(){return Array.isArray(this.inner.in?.shallowMorphs)?[...this.inner.in.shallowMorphs,...this.morphs]:this.morphs}get rawIn(){return this.declaredIn??this.inner.in?.rawIn??pe.intrinsic.unknown.internal}get rawOut(){return this.declaredOut??this.introspectableOut??pe.intrinsic.unknown.internal}declareIn(t){return this.$.node("morph",{...this.inner,declaredIn:t})}declareOut(t){return this.$.node("morph",{...this.inner,declaredOut:t})}expression=`(In: ${this.rawIn.expression}) => ${this.lastMorphIfNode?"To":"Out"}<${this.rawOut.expression}>`;get defaultShortDescription(){return this.rawIn.meta.description??this.rawIn.defaultShortDescription}innerToJsonSchema(t){return t.fallback.morph({code:"morph",base:this.rawIn.toJsonSchemaRecurse(t),out:this.introspectableOut?.toJsonSchemaRecurse(t)??null})}compile(t){if(t.traversalKind==="Allows"){if(!this.introspectableIn)return;t.return(t.invoke(this.introspectableIn));return}this.introspectableIn&&t.line(t.invoke(this.introspectableIn)),t.line(`ctx.queueMorphs(${this.compiledMorphs})`)}traverseAllows=(t,n)=>!this.introspectableIn||this.introspectableIn.traverseAllows(t,n);traverseApply=(t,n)=>{this.introspectableIn&&this.introspectableIn.traverseApply(t,n),n.queueMorphs(this.morphs)};hasEqualMorphs(t){return Ao(this.morphs,t.morphs,{isEqual:(n,i)=>n===i||Re(n,"root")&&Re(i,"root")&&n.equals(i)})}}const SC={implementation:GL,Node:YL},JL=(e,t)=>`The intersection of distinct morphs at a single path is indeterminate:
|
|
46
|
-
Left: ${e}
|
|
47
|
-
Right: ${t}`,XL=Gt({kind:"proto",hasAssociatedError:!0,collapsibleKey:"proto",keys:{proto:{serialize:e=>ry(e)??hs(e)},dateAllowsInvalid:{}},normalize:e=>{const t=typeof e=="string"?{proto:To[e]}:typeof e=="function"?_n(e)?e:{proto:e}:typeof e.proto=="string"?{...e,proto:To[e.proto]}:e;return typeof t.proto!="function"&&le(rf.writeInvalidSchemaMessage(t.proto)),ay(t,"dateAllowsInvalid")&&t.proto!==Date&&le(rf.writeBadInvalidDateMessage(t.proto)),t},applyConfig:(e,t)=>e.dateAllowsInvalid===void 0&&e.proto===Date&&t.dateAllowsInvalid?{...e,dateAllowsInvalid:!0}:e,defaults:{description:e=>e.builtinName?YR[e.builtinName]:`an instance of ${e.proto.name}`,actual:e=>e instanceof Date&&e.toString()==="Invalid Date"?"an invalid Date":eg(e)},intersections:{proto:(e,t)=>e.proto===Date&&t.proto===Date?e.dateAllowsInvalid?t:e:Ix(e.proto,t.proto)?e:Ix(t.proto,e.proto)?t:Me.init("proto",e,t),domain:(e,t)=>t.domain==="object"?e:Me.init("domain",pe.intrinsic.object.internal,t)}});class WL extends py{builtinName=ry(this.proto);serializedConstructor=this.json.proto;requiresInvalidDateCheck=this.proto===Date&&!this.dateAllowsInvalid;traverseAllows=this.requiresInvalidDateCheck?t=>t instanceof Date&&t.toString()!=="Invalid Date":t=>t instanceof this.proto;compiledCondition=`data instanceof ${this.serializedConstructor}${this.requiresInvalidDateCheck?' && data.toString() !== "Invalid Date"':""}`;compiledNegation=`!(${this.compiledCondition})`;innerToJsonSchema(t){switch(this.builtinName){case"Array":return{type:"array"};case"Date":return t.fallback.date?.({code:"date",base:{}})??t.fallback.proto({code:"proto",base:{},proto:this.proto});default:return t.fallback.proto({code:"proto",base:{},proto:this.proto})}}expression=this.dateAllowsInvalid?"Date | InvalidDate":this.proto.name;get nestableExpression(){return this.dateAllowsInvalid?`(${this.expression})`:this.expression}domain="object";get defaultShortDescription(){return this.description}}const rf={implementation:XL,Node:WL,writeBadInvalidDateMessage:e=>`dateAllowsInvalid may only be specified with constructor Date (was ${e.name})`,writeInvalidSchemaMessage:e=>`instanceOf operand must be a function (was ${Ya(e)})`},QL=Gt({kind:"union",hasAssociatedError:!0,collapsibleKey:"branches",keys:{ordered:{},branches:{child:!0,parse:(e,t)=>{const n=[];for(const i of e){const s=Re(i,"root")?i.branches:t.$.parseSchema(i).branches;for(const l of s)if(l.hasKind("morph")){const c=n.findIndex(d=>d.hasKind("morph")&&d.hasEqualMorphs(l));if(c===-1)n.push(l);else{const d=n[c];n[c]=t.$.node("morph",{...d.inner,in:d.rawIn.rawOr(l.rawIn)})}}else n.push(l)}return t.def.ordered||n.sort((i,s)=>i.hash<s.hash?-1:1),n}}},normalize:e=>kn(e)?{branches:e}:e,reduce:(e,t)=>{const n=cP(e);if(n.length===1)return n[0];if(n.length!==e.branches.length)return t.node("union",{...e,branches:n},{prereduced:!0})},defaults:{description:e=>e.distribute(t=>t.description,wo),expected:e=>{const t=OR(e.errors,"propString"),n=Object.entries(t).map(([i,s])=>{const l=[];for(const h of s)ds(l,h.expected);const c=wo(l),d=s.every(h=>h.actual===s[0].actual)?s[0].actual:bt(s[0].data);return`${i&&`${i} `}must be ${c}${d&&` (was ${d})`}`});return wo(n)},problem:e=>e.expected,message:e=>e.problem[0]==="["?`value at ${e.problem}`:e.problem},intersections:{union:(e,t,n)=>{if(e.isNever!==t.isNever)return Me.init("presence",e,t);let i;return e.ordered?(t.ordered&&le(dP(e.expression,t.expression)),i=Ep(t.branches,e.branches,n),i instanceof Me&&i.invert()):i=Ep(e.branches,t.branches,n),i instanceof Me?i:n.$.parseSchema(e.ordered||t.ordered?{branches:i,ordered:!0}:{branches:i})},...Fc("union",(e,t,n)=>{const i=Ep(e.branches,[t],n);return i instanceof Me?i:i.length===1?i[0]:n.$.parseSchema(e.ordered?{branches:i,ordered:!0}:{branches:i})})}});class ZL extends Bc{isBoolean=this.branches.length===2&&this.branches[0].hasUnit(!1)&&this.branches[1].hasUnit(!0);get branchGroups(){const t=[];let n=-1;for(const i of this.branches){if(i.hasKind("unit")&&i.domain==="boolean"){n===-1?(n=t.length,t.push(i)):t[n]=pe.intrinsic.boolean;continue}t.push(i)}return t}unitBranches=this.branches.filter(t=>t.rawIn.hasKind("unit"));discriminant=this.discriminate();discriminantJson=this.discriminant?sP(this.discriminant):null;expression=this.distribute(t=>t.nestableExpression,lP);createBranchedOptimisticRootApply(){return(t,n)=>{const i=this.traverseOptimistic(t);if(i!==ni)return i;const s=new bo(t,this.$.resolvedConfig);return this.traverseApply(t,s),s.finalize(n)}}get shallowMorphs(){return this.branches.reduce((t,n)=>ds(t,n.shallowMorphs),[])}get defaultShortDescription(){return this.distribute(t=>t.defaultShortDescription,wo)}innerToJsonSchema(t){if(this.branchGroups.length===1&&this.branchGroups[0].equals(pe.intrinsic.boolean))return{type:"boolean"};const n=this.branchGroups.map(i=>i.toJsonSchemaRecurse(t));return n.every(i=>Object.keys(i).length===1&&ay(i,"const"))?{enum:n.map(i=>i.const)}:{anyOf:n}}traverseAllows=(t,n)=>this.branches.some(i=>i.traverseAllows(t,n));traverseApply=(t,n)=>{const i=[];for(let s=0;s<this.branches.length;s++){if(n.pushBranch(),this.branches[s].traverseApply(t,n),!n.hasError())return this.branches[s].includesTransform?n.queuedMorphs.push(...n.popBranch().queuedMorphs):n.popBranch();i.push(n.popBranch().error)}n.errorFromNodeContext({code:"union",errors:i,meta:this.meta})};traverseOptimistic=t=>{for(let n=0;n<this.branches.length;n++){const i=this.branches[n];if(i.traverseAllows(t))return i.contextFreeMorph?i.contextFreeMorph(t):t}return ni};compile(t){if(!this.discriminant||this.unitBranches.length===this.branches.length&&this.branches.length===2)return this.compileIndiscriminable(t);let n=this.discriminant.optionallyChainedPropString;this.discriminant.kind==="domain"&&(n=`typeof ${n} === "object" ? ${n} === null ? "null" : "object" : typeof ${n} === "function" ? "object" : typeof ${n}`);const i=this.discriminant.cases,s=Object.keys(i),{optimistic:l}=t;if(t.optimistic=!1,t.block(`switch(${n})`,()=>{for(const y in i){const v=i[y],b=y==="default"?y:`case ${y}`;let D;v===!0?D=l?"data":"true":l?v.rootApplyStrategy==="branchedOptimistic"?D=t.invoke(v,{kind:"Optimistic"}):v.contextFreeMorph?D=`${t.invoke(v)} ? ${Un(v.contextFreeMorph)}(data) : "${ni}"`:D=`${t.invoke(v)} ? data : "${ni}"`:D=t.invoke(v),t.line(`${b}: return ${D}`)}return t}),t.traversalKind==="Allows"){t.return(l?`"${ni}"`:!1);return}const c=wo(this.discriminant.kind==="domain"?s.map(y=>{const v=y.slice(1,-1);return v==="function"?Ri.object:Ri[v]}):s),d=this.discriminant.path.map(y=>typeof y=="symbol"?Un(y):JSON.stringify(y)),h=JSON.stringify(c),m=this.discriminant.kind==="domain"?`${iP}[${n}]`:`${rP}(${n})`;t.line(`ctx.errorFromNodeContext({
|
|
48
|
-
code: "predicate",
|
|
49
|
-
expected: ${h},
|
|
50
|
-
actual: ${m},
|
|
51
|
-
relativePath: [${d}],
|
|
52
|
-
meta: ${this.compiledMeta}
|
|
53
|
-
})`)}compileIndiscriminable(t){if(t.traversalKind==="Apply"){t.const("errors","[]");for(const n of this.branches)t.line("ctx.pushBranch()").line(t.invoke(n)).if("!ctx.hasError()",()=>t.return(n.includesTransform?"ctx.queuedMorphs.push(...ctx.popBranch().queuedMorphs)":"ctx.popBranch()")).line("errors.push(ctx.popBranch().error)");t.line(`ctx.errorFromNodeContext({ code: "union", errors, meta: ${this.compiledMeta} })`)}else{const{optimistic:n}=t;t.optimistic=!1;for(const i of this.branches)t.if(`${t.invoke(i)}`,()=>t.return(n?i.contextFreeMorph?`${Un(i.contextFreeMorph)}(data)`:"data":!0));t.return(n?`"${ni}"`:!1)}}get nestableExpression(){return this.isBoolean?"boolean":`(${this.expression})`}discriminate(){if(this.branches.length<2||this.isCyclic)return null;if(this.unitBranches.length===this.branches.length){const l=Nt(this.unitBranches,(c,d)=>[`${d.rawIn.serializedValue}`,d.hasKind("morph")?d:!0]);return{kind:"unit",path:[],optionallyChainedPropString:"data",cases:l}}const t=[];for(let l=0;l<this.branches.length-1;l++){const c=this.branches[l];for(let d=l+1;d<this.branches.length;d++){const h=this.branches[d],m=Ii(c.rawIn,h.rawIn,c.$);if(m instanceof Me)for(const y of m){if(!y.kind||y.optional)continue;let v,b;if(y.kind==="domain"){const w=y.l,N=y.r;v=`"${typeof w=="string"?w:w.domain}"`,b=`"${typeof N=="string"?N:N.domain}"`}else if(y.kind==="unit")v=y.l.serializedValue,b=y.r.serializedValue;else continue;const D=t.find(w=>Ao(w.path,y.path)&&w.kind===y.kind);D?(D.cases[v]?D.cases[v].branchIndices=ds(D.cases[v].branchIndices,l):D.cases[v]??={branchIndices:[l],condition:y.l},D.cases[b]?D.cases[b].branchIndices=ds(D.cases[b].branchIndices,d):D.cases[b]??={branchIndices:[d],condition:y.r}):t.push({kind:y.kind,cases:{[v]:{branchIndices:[l],condition:y.l},[b]:{branchIndices:[d],condition:y.r}},path:y.path})}}}const n=this.ordered?nP(t,this.branches):t;if(!n.length)return null;const i=eP(n,this),s={};for(const l in i.best.cases){const c=tP(i,l);if(c===null){s[l]=!0;continue}if(c.length===this.branches.length)return null;this.ordered&&c.sort((m,y)=>m.originalIndex-y.originalIndex);const d=c.map(m=>m.branch),h=d.length===1?d[0]:this.$.node("union",this.ordered?{branches:d,ordered:!0}:d);Object.assign(this.referencesById,h.referencesById),s[l]=h}if(i.defaultEntries.length){const l=i.defaultEntries.map(c=>c.branch);s.default=this.$.node("union",this.ordered?{branches:l,ordered:!0}:l,{prereduced:!0}),Object.assign(this.referencesById,s.default.referencesById)}return Object.assign(i.location,{cases:s})}}const eP=(e,t)=>{const i=e.sort((c,d)=>c.path.length===d.path.length?Object.keys(d.cases).length-Object.keys(c.cases).length:c.path.length-d.path.length)[0],s={kind:i.kind,path:i.path,optionallyChainedPropString:xC(i.path)},l=t.branches.map((c,d)=>({originalIndex:d,branch:c}));return{best:i,location:s,defaultEntries:l,node:t}},tP=(e,t)=>{const n=e.best.cases[t],i=aP(n.condition,e.location.path,e.node.$);let s=[];const l=[];for(let c=0;c<e.defaultEntries.length;c++){const d=e.defaultEntries[c];if(n.branchIndices.includes(d.originalIndex)){const h=Wx(e.node.branches[d.originalIndex],e.location);h===null?s=null:s?.push({originalIndex:d.originalIndex,branch:h})}else if(d.branch.hasKind("alias")&&i.hasKind("domain")&&i.domain==="object")s?.push(d);else{if(d.branch.rawIn.overlaps(i)){const h=Wx(d.branch,e.location);s?.push({originalIndex:d.originalIndex,branch:h})}l.push(d)}}return e.defaultEntries=l,s},nP=(e,t)=>e.filter(i=>{const s=Object.values(i.cases).map(l=>l.branchIndices);for(let l=0;l<s.length-1;l++){const c=s[l];for(let d=l+1;d<s.length;d++){const h=s[d];for(const m of c)for(const y of h)if(m>y&&t[m].overlaps(t[y]))return!1}}return!0}),aP=(e,t,n)=>{let i=e==="undefined"?n.node("unit",{unit:void 0}):e==="null"?n.node("unit",{unit:null}):e==="boolean"?n.units([!0,!1]):e;for(let s=t.length-1;s>=0;s--){const l=t[s];i=n.node("intersection",typeof l=="number"?{proto:"Array",sequence:[...kR(l).map(c=>({})),i]}:{domain:"object",required:[{key:l,value:i}]})}return i},xC=e=>e.reduce((t,n)=>t+FN(n,!0),"data"),iP=Un(RR),rP=Un(bt),wC={implementation:QL,Node:ZL},sP=e=>({kind:e.kind,path:e.path.map(t=>typeof t=="string"?t:Io(t)),cases:Nt(e.cases,(t,n)=>[t,n===!0?n:n.hasKind("union")&&n.discriminantJson?n.discriminantJson:n.json])}),oP={delimiter:" | ",finalDelimiter:" | "},lP=e=>wo(e,oP),wo=(e,t)=>{const n=t?.delimiter??", ",i=t?.finalDelimiter??" or ";if(e.length===0)return"never";if(e.length===1)return e[0];if(e.length===2&&e[0]==="false"&&e[1]==="true"||e[0]==="true"&&e[1]==="false")return"boolean";const s={},l=e.filter(d=>s[d]?!1:s[d]=!0),c=l.pop();return`${l.join(n)}${l.length?i:""}${c}`},Ep=(e,t,n)=>{const i=t.map(()=>[]);for(let l=0;l<e.length;l++){let c={};for(let d=0;d<t.length;d++){if(i[d]===null)continue;if(e[l].equals(t[d])){i[d]=null,c={};break}const h=yn(e[l],t[d],n);if(!(h instanceof Me)){if(h.equals(e[l])){i[d].push(e[l]),c={};break}h.equals(t[d])?i[d]=null:c[d]=h}}for(const d in c)i[d][l]=c[d]}const s=i.flatMap((l,c)=>l?.flatMap(d=>d.branches)??t[c]);return s.length===0?Me.init("union",e,t):s},cP=({branches:e,ordered:t})=>{if(e.length<2)return e;const n=e.map(()=>!0);for(let i=0;i<e.length;i++)for(let s=i+1;s<e.length&&n[i]&&n[s];s++){if(e[i].equals(e[s])){n[s]=!1;continue}const l=Ii(e[i].rawIn,e[s].rawIn,e[0].$);l instanceof Me||(t||uP(e[i],e[s]),l.equals(e[i].rawIn)?n[i]=!!t:l.equals(e[s].rawIn)&&(n[s]=!1))}return e.filter((i,s)=>n[s])},uP=(e,t)=>{!e.includesTransform&&!t.includesTransform||(Ao(e.shallowMorphs,t.shallowMorphs)||le(Qx(e.expression,t.expression)),Ao(e.flatMorphs,t.flatMorphs,{isEqual:(n,i)=>n.propString===i.propString&&(n.node.hasKind("morph")&&i.node.hasKind("morph")?n.node.hasEqualMorphs(i.node):n.node.hasKind("intersection")&&i.node.hasKind("intersection")?n.node.structure?.structuralMorphRef===i.node.structure?.structuralMorphRef:!1)})||le(Qx(e.expression,t.expression)))},Wx=(e,t)=>e.transform((n,i)=>n==="domain"||n==="unit"?null:i,{shouldTransform:(n,i)=>{const s=xC(i.path);return t.optionallyChainedPropString.startsWith(s)?n.hasKind("domain")&&n.domain==="object"||(n.hasKind("domain")||t.kind==="unit")&&s===t.optionallyChainedPropString?!0:n.children.length!==0&&n.kind!=="index":!1}}),Qx=(e,t)=>`An unordered union of a type including a morph and a type with overlapping input is indeterminate:
|
|
54
|
-
Left: ${e}
|
|
55
|
-
Right: ${t}`,dP=(e,t)=>`The intersection of two ordered unions is indeterminate:
|
|
56
|
-
Left: ${e}
|
|
57
|
-
Right: ${t}`,fP=Gt({kind:"unit",hasAssociatedError:!0,keys:{unit:{preserveUndefined:!0,serialize:e=>e instanceof Date?e.toISOString():hs(e)}},normalize:e=>e,defaults:{description:e=>bt(e.unit),problem:({expected:e,actual:t})=>`${e===t?`must be reference equal to ${e} (serialized to the same value)`:`must be ${e} (was ${t})`}`},intersections:{unit:(e,t)=>Me.init("unit",e,t),...Fc("unit",(e,t)=>{if(t.allows(e.unit))return e;const n=t.hasKind("intersection")?t.basis:t;if(n){const i=n.hasKind("domain")?n:pe.intrinsic.object;if(e.domain!==i.domain){const s=e.domain==="undefined"||e.domain==="null"||e.domain==="boolean"?e.domain:pe.intrinsic[e.domain];return Me.init("domain",s,i)}}return Me.init("assignability",e,t.hasKind("intersection")?t.children.find(i=>!i.allows(e.unit)):t)})}});class hP extends py{compiledValue=this.json.unit;serializedValue=typeof this.unit=="string"||this.unit instanceof Date?JSON.stringify(this.compiledValue):`${this.compiledValue}`;compiledCondition=Zx(this.unit,this.serializedValue);compiledNegation=Zx(this.unit,this.serializedValue,"negated");expression=bt(this.unit);domain=Ya(this.unit);get defaultShortDescription(){return this.domain==="object"?Ri.object:this.description}innerToJsonSchema(t){return this.unit===null?{type:"null"}:pe.intrinsic.jsonPrimitive.allows(this.unit)?{const:this.unit}:t.fallback.unit({code:"unit",base:{},unit:this.unit})}traverseAllows=this.unit instanceof Date?t=>t instanceof Date&&t.toISOString()===this.compiledValue:Number.isNaN(this.unit)?t=>Number.isNaN(t):t=>t===this.unit}const DC={implementation:fP,Node:hP},Zx=(e,t,n)=>{if(e instanceof Date){const i=`data instanceof Date && data.toISOString() === ${t}`;return n?`!(${i})`:i}return Number.isNaN(e)?`${n?"!":""}Number.isNaN(data)`:`data ${n?"!":"="}== ${t}`},mP=Gt({kind:"index",hasAssociatedError:!1,intersectionIsOpen:!0,keys:{signature:{child:!0,parse:(e,t)=>{const n=t.$.parseSchema(e);if(!n.extends(pe.intrinsic.key))return le(yP(n.expression));const i=n.branches.filter(s=>s.hasKind("unit"));return i.length?le(gP(i.map(s=>bt(s.unit)))):n}},value:{child:!0,parse:(e,t)=>t.$.parseSchema(e)}},normalize:e=>e,defaults:{description:e=>`[${e.signature.expression}]: ${e.value.description}`},intersections:{index:(e,t,n)=>{if(e.signature.equals(t.signature)){const i=yn(e.value,t.value,n),s=i instanceof Me?pe.intrinsic.never.internal:i;return n.$.node("index",{signature:e.signature,value:s})}return e.signature.extends(t.signature)&&e.value.subsumes(t.value)?t:t.signature.extends(e.signature)&&t.value.subsumes(e.value)?e:null}}});class pP extends zo{impliedBasis=pe.intrinsic.object.internal;expression=`[${this.signature.expression}]: ${this.value.expression}`;flatRefs=Dt(this.value.flatRefs.map(t=>Nr([this.signature,...t.path],t.node)),Nr([this.signature],this.value));traverseAllows=(t,n)=>Wd(t).every(i=>this.signature.traverseAllows(i[0],n)?Pi(i[0],()=>this.value.traverseAllows(i[1],n),n):!0);traverseApply=(t,n)=>{for(const i of Wd(t))this.signature.traverseAllows(i[0],n)&&Pi(i[0],()=>this.value.traverseApply(i[1],n),n)};_transform(t,n){n.path.push(this.signature);const i=super._transform(t,n);return n.path.pop(),i}compile(){}}const NC={implementation:mP,Node:pP},gP=e=>`Index keys ${e.join(", ")} should be specified as named props.`,yP=e=>`Indexed key definition '${e}' must be a string or symbol`,vP=Gt({kind:"required",hasAssociatedError:!0,intersectionIsOpen:!0,keys:{key:{},value:{child:!0,parse:(e,t)=>t.$.parseSchema(e)}},normalize:e=>e,defaults:{description:e=>`${e.compiledKey}: ${e.value.description}`,expected:e=>e.missingValueDescription,actual:()=>"missing"},intersections:{required:cg,optional:cg}});class bP extends gC{expression=`${this.compiledKey}: ${this.value.expression}`;errorContext=Object.freeze({code:"required",missingValueDescription:this.value.defaultShortDescription,relativePath:[this.key],meta:this.meta});compiledErrorContext=Af(this.errorContext)}const CC={implementation:vP,Node:bP},SP=Gt({kind:"sequence",hasAssociatedError:!1,collapsibleKey:"variadic",keys:{prefix:{child:!0,parse:(e,t)=>{if(e.length!==0)return e.map(n=>t.$.parseSchema(n))}},optionals:{child:!0,parse:(e,t)=>{if(e.length!==0)return e.map(n=>t.$.parseSchema(n))}},defaultables:{child:e=>e.map(t=>t[0]),parse:(e,t)=>{if(e.length!==0)return e.map(n=>{const i=t.$.parseSchema(n[0]);return hy(i,n[1],null),[i,n[1]]})},serialize:e=>e.map(t=>[t[0].collapsibleJson,hs(t[1])]),reduceIo:(e,t,n)=>{if(e==="in"){t.optionals=n.map(i=>i[0].rawIn);return}t.prefix=n.map(i=>i[0].rawOut)}},variadic:{child:!0,parse:(e,t)=>t.$.parseSchema(e,t)},minVariadicLength:{parse:e=>e===0?void 0:e},postfix:{child:!0,parse:(e,t)=>{if(e.length!==0)return e.map(n=>t.$.parseSchema(n))}}},normalize:e=>{if(typeof e=="string")return{variadic:e};if("variadic"in e||"prefix"in e||"defaultables"in e||"optionals"in e||"postfix"in e||"minVariadicLength"in e){if(e.postfix?.length){if(!e.variadic)return le(CP);if(e.optionals?.length||e.defaultables?.length)return le(AC)}return e.minVariadicLength&&!e.variadic?le("minVariadicLength may not be specified without a variadic element"):e}return{variadic:e}},reduce:(e,t)=>{let n=e.minVariadicLength??0;const i=e.prefix?.slice()??[],s=e.defaultables?.slice()??[],l=e.optionals?.slice()??[],c=e.postfix?.slice()??[];if(e.variadic){for(;l[l.length-1]?.equals(e.variadic);)l.pop();if(l.length===0&&s.length===0)for(;i[i.length-1]?.equals(e.variadic);)i.pop(),n++;for(;c[0]?.equals(e.variadic);)c.shift(),n++}else l.length===0&&s.length===0&&i.push(...c.splice(0));if(n!==e.minVariadicLength||e.prefix&&e.prefix.length!==i.length)return t.node("sequence",{...e,prefix:i,defaultables:s,optionals:l,postfix:c,minVariadicLength:n},{prereduced:!0})},defaults:{description:e=>e.isVariadicOnly?`${e.variadic.nestableExpression}[]`:`[${e.tuple.map(n=>n.kind==="defaultables"?`${n.node.nestableExpression} = ${bt(n.default)}`:n.kind==="optionals"?`${n.node.nestableExpression}?`:n.kind==="variadic"?`...${n.node.nestableExpression}[]`:n.node.expression).join(", ")}]`},intersections:{sequence:(e,t,n)=>{const i=ac({l:e.tuple,r:t.tuple,disjoint:new Me,result:[],fixedVariants:[],ctx:n}),s=i.disjoint.length===0?[i,...i.fixedVariants]:i.fixedVariants;return s.length===0?i.disjoint:s.length===1?n.$.node("sequence",ew(s[0].result)):n.$.node("union",s.map(l=>({proto:Array,sequence:ew(l.result)})))}}});class xP extends zo{impliedBasis=pe.intrinsic.Array.internal;tuple=NP(this.inner);prefixLength=this.prefix?.length??0;defaultablesLength=this.defaultables?.length??0;optionalsLength=this.optionals?.length??0;postfixLength=this.postfix?.length??0;defaultablesAndOptionals=[];prevariadic=this.tuple.filter(t=>t.kind==="defaultables"||t.kind==="optionals"?(this.defaultablesAndOptionals.push(t.node),!0):t.kind==="prefix");variadicOrPostfix=ls(this.variadic&&[this.variadic],this.postfix);flatRefs=this.addFlatRefs();addFlatRefs(){return Fx(this.flatRefs,this.prevariadic.flatMap((t,n)=>Dt(t.node.flatRefs.map(i=>Nr([`${n}`,...i.path],i.node)),Nr([`${n}`],t.node)))),Fx(this.flatRefs,this.variadicOrPostfix.flatMap(t=>Dt(t.flatRefs.map(n=>Nr([pe.intrinsic.nonNegativeIntegerString.internal,...n.path],n.node)),Nr([pe.intrinsic.nonNegativeIntegerString.internal],t)))),this.flatRefs}isVariadicOnly=this.prevariadic.length+this.postfixLength===0;minVariadicLength=this.inner.minVariadicLength??0;minLength=this.prefixLength+this.minVariadicLength+this.postfixLength;minLengthNode=this.minLength===0?null:this.$.node("minLength",this.minLength);maxLength=this.variadic?null:this.tuple.length;maxLengthNode=this.maxLength===null?null:this.$.node("maxLength",this.maxLength);impliedSiblings=this.minLengthNode?this.maxLengthNode?[this.minLengthNode,this.maxLengthNode]:[this.minLengthNode]:this.maxLengthNode?[this.maxLengthNode]:[];defaultValueMorphs=DP(this);defaultValueMorphsReference=this.defaultValueMorphs.length?Un(this.defaultValueMorphs):void 0;elementAtIndex(t,n){if(n<this.prevariadic.length)return this.tuple[n];const i=t.length-this.postfixLength;return n>=i?{kind:"postfix",node:this.postfix[n-i]}:{kind:"variadic",node:this.variadic??cn(`Unexpected attempt to access index ${n} on ${this}`)}}traverseAllows=(t,n)=>{for(let i=0;i<t.length;i++)if(!this.elementAtIndex(t,i).node.traverseAllows(t[i],n))return!1;return!0};traverseApply=(t,n)=>{let i=0;for(;i<t.length;i++)Pi(i,()=>this.elementAtIndex(t,i).node.traverseApply(t[i],n),n)};get element(){return this.cacheGetter("element",this.$.node("union",this.children))}compile(t){if(this.prefix)for(const[n,i]of this.prefix.entries())t.traverseKey(`${n}`,`data[${n}]`,i);for(const[n,i]of this.defaultablesAndOptionals.entries()){const s=`${n+this.prefixLength}`;t.if(`${s} >= data.length`,()=>t.traversalKind==="Allows"?t.return(!0):t.return()),t.traverseKey(s,`data[${s}]`,i)}if(this.variadic&&(this.postfix&&t.const("firstPostfixIndex",`data.length${this.postfix?`- ${this.postfix.length}`:""}`),t.for(`i < ${this.postfix?"firstPostfixIndex":"data.length"}`,()=>t.traverseKey("i","data[i]",this.variadic),this.prevariadic.length),this.postfix))for(const[n,i]of this.postfix.entries()){const s=`firstPostfixIndex + ${n}`;t.traverseKey(s,`data[${s}]`,i)}t.traversalKind==="Allows"&&t.return(!0)}_transform(t,n){n.path.push(pe.intrinsic.nonNegativeIntegerString.internal);const i=super._transform(t,n);return n.path.pop(),i}expression=this.description;reduceJsonSchema(t,n){if(this.prevariadic.length&&(t.prefixItems=this.prevariadic.map(i=>{const s=i.node.toJsonSchemaRecurse(n);if(i.kind==="defaultables"){const l=typeof i.default=="function"?i.default():i.default;s.default=pe.intrinsic.jsonData.allows(l)?l:n.fallback.defaultValue({code:"defaultValue",base:s,value:l})}return s})),this.minLength&&(t.minItems=this.minLength),this.variadic){const i=Object.assign(t,{items:this.variadic.toJsonSchemaRecurse(n)});if(this.maxLength&&(i.maxItems=this.maxLength),this.postfix){const s=this.postfix.map(l=>l.toJsonSchemaRecurse(n));t=n.fallback.arrayPostfix({code:"arrayPostfix",base:i,elements:s})}}else t.items=!1,delete t.maxItems;return t}}const wP={},DP=e=>{if(!e.defaultables)return[];const t=[];let n="[";const i=e.prefixLength+e.defaultablesLength-1;for(let s=e.prefixLength;s<=i;s++){const[l,c]=e.defaultables[s-e.prefixLength];t.push(vC(s,l,c)),n+=`${s}: ${l.id} = ${hs(c)}, `}return n+="]",wP[n]??=t},EC={implementation:SP,Node:xP},NP=e=>{const t=[];if(e.prefix)for(const n of e.prefix)t.push({kind:"prefix",node:n});if(e.defaultables)for(const[n,i]of e.defaultables)t.push({kind:"defaultables",node:n,default:i});if(e.optionals)for(const n of e.optionals)t.push({kind:"optionals",node:n});if(e.variadic&&t.push({kind:"variadic",node:e.variadic}),e.postfix)for(const n of e.postfix)t.push({kind:"postfix",node:n});return t},ew=e=>e.reduce((t,n)=>(n.kind==="variadic"?t.variadic=n.node:n.kind==="defaultables"?t.defaultables=Dt(t.defaultables,[[n.node,n.default]]):t[n.kind]=Dt(t[n.kind],n.node),t),{}),AC="A postfix required element cannot follow an optional or defaultable element",CP="A postfix element requires a variadic element",ac=e=>{const[t,...n]=e.l,[i,...s]=e.r;if(!t||!i)return e;const l=n[n.length-1]?.kind==="postfix",c=s[s.length-1]?.kind==="postfix",d=t.kind==="prefix"||i.kind==="prefix"?"prefix":t.kind==="postfix"||i.kind==="postfix"?"postfix":t.kind==="variadic"&&i.kind==="variadic"?"variadic":l||c?"prefix":t.kind==="defaultables"||i.kind==="defaultables"?"defaultables":"optionals";if(t.kind==="prefix"&&i.kind==="variadic"&&c){const v=ac({...e,fixedVariants:[],r:s.map(b=>({...b,kind:"prefix"}))});v.disjoint.length===0&&e.fixedVariants.push(v)}else if(i.kind==="prefix"&&t.kind==="variadic"&&l){const v=ac({...e,fixedVariants:[],l:n.map(b=>({...b,kind:"prefix"}))});v.disjoint.length===0&&e.fixedVariants.push(v)}const h=yn(t.node,i.node,e.ctx);if(h instanceof Me)if(d==="prefix"||d==="postfix")e.disjoint.push(...h.withPrefixKey(d==="prefix"?e.result.length:`-${n.length+1}`,tw(t)&&tw(i)?"required":"optional")),e.result=[...e.result,{kind:d,node:pe.intrinsic.never.internal}];else return d==="optionals"||d==="defaultables"?e:ac({...e,fixedVariants:[],l:n.map(v=>({...v,kind:"prefix"})),r:n.map(v=>({...v,kind:"prefix"}))});else d==="defaultables"?(t.kind==="defaultables"&&i.kind==="defaultables"&&t.default!==i.default&&le(yC(t.default,i.default)),e.result=[...e.result,{kind:d,node:h,default:t.kind==="defaultables"?t.default:i.kind==="defaultables"?i.default:cn(`Unexpected defaultable intersection from ${t.kind} and ${i.kind} elements.`)}]):e.result=[...e.result,{kind:d,node:h}];const m=e.l.length,y=e.r.length;return(t.kind!=="variadic"||m>=y&&(i.kind==="variadic"||y===1))&&(e.l=n),(i.kind!=="variadic"||y>=m&&(t.kind==="variadic"||m===1))&&(e.r=s),ac(e)},tw=e=>e.kind==="prefix"||e.kind==="postfix",MC=e=>t=>{if(t.props.length||t.index){const n=t.index?.map(s=>s[e])??[];for(const s of t.props)n.push(s[e]);t.undeclared&&n.push(`+ (undeclared): ${t.undeclared}`);const i=`{ ${n.join(", ")} }`;return t.sequence?`${i} & ${t.sequence.description}`:i}return t.sequence?.description??"{}"},EP=MC("description"),AP=MC("expression"),nw=(e,t,n)=>{const i=e.required?"required":"optional";if(!t.signature.allows(e.key))return null;const s=Ii(e.value,t.value,n);return s instanceof Me?i==="optional"?n.node("optional",{key:e.key,value:pe.intrinsic.never.internal}):s.withPrefixKey(e.key,e.kind):null},MP=Gt({kind:"structure",hasAssociatedError:!1,normalize:e=>e,applyConfig:(e,t)=>!e.undeclared&&t.onUndeclaredKey!=="ignore"?{...e,undeclared:t.onUndeclaredKey}:e,keys:{required:{child:!0,parse:ea("required"),reduceIo:(e,t,n)=>{t.required=Dt(t.required,n.map(i=>e==="in"?i.rawIn:i.rawOut))}},optional:{child:!0,parse:ea("optional"),reduceIo:(e,t,n)=>{if(e==="in"){t.optional=n.map(i=>i.rawIn);return}for(const i of n)t[i.outProp.kind]=Dt(t[i.outProp.kind],i.outProp.rawOut)}},index:{child:!0,parse:ea("index")},sequence:{child:!0,parse:ea("sequence")},undeclared:{parse:e=>e==="ignore"?void 0:e,reduceIo:(e,t,n)=>{if(n==="reject"){t.undeclared="reject";return}e==="in"?delete t.undeclared:t.undeclared="reject"}}},defaults:{description:EP},intersections:{structure:(e,t,n)=>{const i={...e.inner},s={...t.inner},l=new Me;if(e.undeclared){const h=e.keyof();for(const m of t.requiredKeys)h.allows(m)||l.add("presence",pe.intrinsic.never.internal,t.propsByKey[m].value,{path:[m]});s.optional&&(s.optional=s.optional.filter(m=>h.allows(m.key))),s.index&&(s.index=s.index.flatMap(m=>{if(m.signature.extends(h))return m;const y=Ii(h,m.signature,n.$);if(y instanceof Me)return[];const v=ug(y,m.value,n.$);return v.required&&(s.required=ls(s.required,v.required)),v.optional&&(s.optional=ls(s.optional,v.optional)),v.index??[]}))}if(t.undeclared){const h=t.keyof();for(const m of e.requiredKeys)h.allows(m)||l.add("presence",e.propsByKey[m].value,pe.intrinsic.never.internal,{path:[m]});i.optional&&(i.optional=i.optional.filter(m=>h.allows(m.key))),i.index&&(i.index=i.index.flatMap(m=>{if(m.signature.extends(h))return m;const y=Ii(h,m.signature,n.$);if(y instanceof Me)return[];const v=ug(y,m.value,n.$);return v.required&&(i.required=ls(i.required,v.required)),v.optional&&(i.optional=ls(i.optional,v.optional)),v.index??[]}))}const c={};(e.undeclared||t.undeclared)&&(c.undeclared=e.undeclared==="reject"||t.undeclared==="reject"?"reject":"delete");const d=tf({kind:"structure",baseInner:c,l:nf(i),r:nf(s),roots:[],ctx:n});return d instanceof Me&&l.push(...d),l.length?l:d}},reduce:(e,t)=>{if(!e.required&&!e.optional)return;const n={};let i=!1;const s=e.optional?[...e.optional]:[];if(e.required)for(let l=0;l<e.required.length;l++){const c=e.required[l];if(c.key in n&&le(iw(c.key)),n[c.key]=!0,e.index)for(const d of e.index){const h=nw(c,d,t);if(h instanceof Me)return h}}if(e.optional)for(let l=0;l<e.optional.length;l++){const c=e.optional[l];if(c.key in n&&le(iw(c.key)),n[c.key]=!0,e.index)for(const d of e.index){const h=nw(c,d,t);if(h instanceof Me)return h;h!==null&&(s[l]=h,i=!0)}}if(i)return t.node("structure",{...e,optional:s},{prereduced:!0})}});class TP extends zo{impliedBasis=pe.intrinsic.object.internal;impliedSiblings=this.children.flatMap(t=>t.impliedSiblings??[]);props=ls(this.required,this.optional);propsByKey=Nt(this.props,(t,n)=>[n.key,n]);propsByKeyReference=Un(this.propsByKey);expression=AP(this);requiredKeys=this.required?.map(t=>t.key)??[];optionalKeys=this.optional?.map(t=>t.key)??[];literalKeys=[...this.requiredKeys,...this.optionalKeys];_keyof;keyof(){if(this._keyof)return this._keyof;let t=this.$.units(this.literalKeys).branches;if(this.index)for(const{signature:n}of this.index)t=t.concat(n.branches);return this._keyof=this.$.node("union",t)}map(t){return this.$.node("structure",this.props.flatMap(t).reduce((n,i)=>{const s=this.propsByKey[i.key];if(_n(i))return i.kind!=="required"&&i.kind!=="optional"?le(`Map result must have kind "required" or "optional" (was ${i.kind})`):(n[i.kind]=Dt(n[i.kind],i),n);const l=i.kind??s?.kind??"required",c=Nt(i,(d,h)=>d in fy.implementation.keys?[d,h]:[]);return n[l]=Dt(n[l],this.$.node(l,c)),n},{}))}assertHasKeys(t){const n=t.filter(i=>!Dd(i,this.keyof()));if(n.length)return le(aw(this.expression,n))}get(t,...n){let i,s=!1;const l=OP(t);if((typeof l=="string"||typeof l=="symbol")&&this.propsByKey[l]&&(i=this.propsByKey[l].value,s=this.propsByKey[l].required),this.index)for(const d of this.index)Dd(l,d.signature)&&(i=i?.and(d.value)??d.value);if(this.sequence&&Dd(l,pe.intrinsic.nonNegativeIntegerString))if(Re(l,"root"))this.sequence.variadic&&(i=i?.and(this.sequence.element)??this.sequence.element);else{const d=Number.parseInt(l);if(d<this.sequence.prevariadic.length){const h=this.sequence.prevariadic[d].node;i=i?.and(h)??h,s||=d<this.sequence.prefixLength}else if(this.sequence.variadic){const h=this.$.node("union",this.sequence.variadicOrPostfix);i=i?.and(h)??h}}if(!i)return this.sequence?.variadic&&Re(l,"root")&&l.extends(pe.intrinsic.number)?le(RP(l.expression,this.sequence.expression)):le(aw(this.expression,[l]));const c=i.get(...n);return s?c:c.or(pe.intrinsic.undefined)}pick(...t){return this.assertHasKeys(t),this.$.node("structure",this.filterKeys("pick",t))}omit(...t){return this.assertHasKeys(t),this.$.node("structure",this.filterKeys("omit",t))}optionalize(){const{required:t,...n}=this.inner;return this.$.node("structure",{...n,optional:this.props.map(i=>i.hasKind("required")?this.$.node("optional",i.inner):i)})}require(){const{optional:t,...n}=this.inner;return this.$.node("structure",{...n,required:this.props.map(i=>i.hasKind("optional")?{key:i.key,value:i.value}:i)})}merge(t){const n=this.filterKeys("omit",[t.keyof()]);return t.required&&(n.required=Dt(n.required,t.required)),t.optional&&(n.optional=Dt(n.optional,t.optional)),t.index&&(n.index=Dt(n.index,t.index)),t.sequence&&(n.sequence=t.sequence),t.undeclared?n.undeclared=t.undeclared:delete n.undeclared,this.$.node("structure",n)}filterKeys(t,n){const i=qN(this.inner),s=l=>{const c=n.some(d=>Dd(l,d));return t==="pick"?c:!c};return i.required&&(i.required=i.required.filter(l=>s(l.key))),i.optional&&(i.optional=i.optional.filter(l=>s(l.key))),i.index&&(i.index=i.index.filter(l=>s(l.signature))),i}traverseAllows=(t,n)=>this._traverse("Allows",t,n);traverseApply=(t,n)=>this._traverse("Apply",t,n);_traverse=(t,n,i)=>{const s=i?.currentErrorCount??0;for(let l=0;l<this.props.length;l++)if(t==="Allows"){if(!this.props[l].traverseAllows(n,i))return!1}else if(this.props[l].traverseApply(n,i),i.failFast&&i.currentErrorCount>s)return!1;if(this.sequence){if(t==="Allows"){if(!this.sequence.traverseAllows(n,i))return!1}else if(this.sequence.traverseApply(n,i),i.failFast&&i.currentErrorCount>s)return!1}if(this.index||this.undeclared==="reject"){const l=Object.keys(n);l.push(...Object.getOwnPropertySymbols(n));for(let c=0;c<l.length;c++){const d=l[c];if(this.index){for(const h of this.index)if(h.signature.traverseAllows(d,i)){if(t==="Allows"){if(!Pi(d,()=>h.value.traverseAllows(n[d],i),i))return!1}else if(Pi(d,()=>h.value.traverseApply(n[d],i),i),i.failFast&&i.currentErrorCount>s)return!1}}if(this.undeclared==="reject"&&!this.declaresKey(d)&&(t==="Allows"||(i.errorFromNodeContext({code:"predicate",expected:"removed",actual:"",relativePath:[d],meta:this.meta}),i.failFast)))return!1}}return this.structuralMorph&&i&&!i.hasError()&&i.queueMorphs([this.structuralMorph]),!0};get defaultable(){return this.cacheGetter("defaultable",this.optional?.filter(t=>t.hasDefault())??[])}declaresKey=t=>t in this.propsByKey||this.index?.some(n=>n.signature.allows(t))||this.sequence!==void 0&&pe.intrinsic.nonNegativeIntegerString.allows(t);_compileDeclaresKey(t){const n=[];if(this.props.length&&n.push(`k in ${this.propsByKeyReference}`),this.index)for(const i of this.index)n.push(t.invoke(i.signature,{kind:"Allows",arg:"k"}));return this.sequence&&n.push("$ark.intrinsic.nonNegativeIntegerString.allows(k)"),n.join(" || ")||"false"}get structuralMorph(){return this.cacheGetter("structuralMorph",kP(this))}structuralMorphRef=this.structuralMorph&&Un(this.structuralMorph);compile(t){t.traversalKind==="Apply"&&t.initializeErrorCount();for(const n of this.props)t.check(n),t.traversalKind==="Apply"&&t.returnIfFailFast();if(this.sequence&&(t.check(this.sequence),t.traversalKind==="Apply"&&t.returnIfFailFast()),(this.index||this.undeclared==="reject")&&(t.const("keys","Object.keys(data)"),t.line("keys.push(...Object.getOwnPropertySymbols(data))"),t.for("i < keys.length",()=>this.compileExhaustiveEntry(t))),t.traversalKind==="Allows")return t.return(!0);this.structuralMorphRef&&t.if("ctx && !ctx.hasError()",()=>(t.line("ctx.queueMorphs(["),$P(t,this),t.line("])")))}compileExhaustiveEntry(t){if(t.const("k","keys[i]"),this.index)for(const n of this.index)t.if(`${t.invoke(n.signature,{arg:"k",kind:"Allows"})}`,()=>t.traverseKey("k","data[k]",n.value));return this.undeclared==="reject"&&t.if(`!(${this._compileDeclaresKey(t)})`,()=>t.traversalKind==="Allows"?t.return(!1):t.line(`ctx.errorFromNodeContext({ code: "predicate", expected: "removed", actual: "", relativePath: [k], meta: ${this.compiledMeta} })`).if("ctx.failFast",()=>t.return())),t}reduceJsonSchema(t,n){switch(t.type){case"object":return this.reduceObjectJsonSchema(t,n);case"array":const i=this.sequence?.reduceJsonSchema(t,n)??t;return this.props.length||this.index?n.fallback.arrayObject({code:"arrayObject",base:i,object:this.reduceObjectJsonSchema({type:"object"},n)}):i;default:return hn.throwInternalOperandError("structure",t)}}reduceObjectJsonSchema(t,n){if(this.props.length){t.properties={};for(const i of this.props){const s=i.value.toJsonSchemaRecurse(n);if(typeof i.key=="symbol"){n.fallback.symbolKey({code:"symbolKey",base:t,key:i.key,value:s,optional:i.optional});continue}if(i.hasDefault()){const l=typeof i.default=="function"?i.default():i.default;s.default=pe.intrinsic.jsonData.allows(l)?l:n.fallback.defaultValue({code:"defaultValue",base:s,value:l})}t.properties[i.key]=s}this.requiredKeys.length&&t.properties&&(t.required=this.requiredKeys.filter(i=>typeof i=="string"&&i in t.properties))}if(this.index)for(const i of this.index){const s=i.value.toJsonSchemaRecurse(n);if(i.signature.equals(pe.intrinsic.string)){t.additionalProperties=s;continue}for(const l of i.signature.branches){if(!l.extends(pe.intrinsic.string)){t=n.fallback.symbolKey({code:"symbolKey",base:t,key:null,value:s,optional:!1});continue}let c={type:"string"};if(l.hasKind("morph")&&(c=n.fallback.morph({code:"morph",base:l.rawIn.toJsonSchemaRecurse(n),out:l.rawOut.toJsonSchemaRecurse(n)})),!l.hasKind("intersection"))return cn(`Unexpected index branch kind ${l.kind}.`);const{pattern:d}=l.inner;if(d){const h=Object.assign(c,{pattern:d[0].rule});for(let m=1;m<d.length;m++)c=n.fallback.patternIntersection({code:"patternIntersection",base:h,pattern:d[m].rule});t.patternProperties??={},t.patternProperties[h.pattern]=s}}}return this.undeclared&&!t.additionalProperties&&(t.additionalProperties=!1),t}}const Ap={},jP=e=>{let t="";for(let n=0;n<e.defaultable.length;n++)t+=e.defaultable[n].defaultValueMorphRef;if(e.sequence?.defaultValueMorphsReference&&(t+=e.sequence?.defaultValueMorphsReference),e.undeclared==="delete"){if(t+="delete !(",e.required)for(const n of e.required)t+=n.compiledKey+" | ";if(e.optional)for(const n of e.optional)t+=n.compiledKey+" | ";if(e.index)for(const n of e.index)t+=n.signature.id+" | ";if(e.sequence)if(e.sequence.maxLength===null)t+=Ie.nonNegativeIntegerString.id;else for(let n=0;n<e.sequence.tuple.length;n++)t+=n+" | ";t+=")"}return t},kP=e=>{const t=jP(e);if(!t)return;if(Ap[t])return Ap[t];const n=(i,s)=>{for(let l=0;l<e.defaultable.length;l++)e.defaultable[l].key in i||e.defaultable[l].defaultValueMorph(i,s);if(e.sequence?.defaultables)for(let l=i.length-e.sequence.prefixLength;l<e.sequence.defaultables.length;l++)e.sequence.defaultValueMorphs[l](i,s);if(e.undeclared==="delete")for(const l in i)e.declaresKey(l)||delete i[l];return i};return Ap[t]=n},$P=(e,t)=>{const i=`(data${t.defaultable.some(s=>s.defaultValueMorph.length===2)||t.sequence?.defaultValueMorphs.some(s=>s.length===2)?", ctx":""})`;return e.block(`${i} => `,s=>{for(let l=0;l<t.defaultable.length;l++){const{serializedKey:c,defaultValueMorphRef:d}=t.defaultable[l];s.if(`!(${c} in data)`,h=>h.line(`${d}${i}`))}return t.sequence?.defaultables&&s.for(`i < ${t.sequence.defaultables.length}`,l=>l.set("data[i]",5),`data.length - ${t.sequence.prefixLength}`),t.undeclared==="delete"&&s.forIn("data",l=>l.if(`!(${t._compileDeclaresKey(l)})`,c=>c.line("delete data[k]"))),s.return("data")})},TC={implementation:MP,Node:TP},OP=e=>(Re(e,"root")&&e.hasKind("unit")&&(e=e.unit),typeof e=="number"&&(e=`${e}`),e),RP=(e,t)=>`${e} is not allowed as an array index on ${t}. Use the 'nonNegativeIntegerString' keyword instead.`,ug=(e,t,n)=>{const[i,s]=jR(e.branches,c=>c.hasKind("unit"));if(!i.length)return{index:n.node("index",{signature:e,value:t})};const l={};for(const c of i){const d=n.node("required",{key:c.unit,value:t});l[d.kind]=Dt(l[d.kind],d)}return s.length&&(l.index=n.node("index",{signature:s,value:t})),l},LP=e=>Re(e,"root")?e.expression:bt(e),aw=(e,t)=>`Key${t.length===1?"":"s"} ${t.map(LP).join(", ")} ${t.length===1?"does":"do"} not exist on ${e}`,iw=e=>`Duplicate key ${Io(e)}`,Tf={...DL,alias:my.implementation,domain:gy.implementation,unit:DC.implementation,proto:rf.implementation,union:wC.implementation,morph:SC.implementation,intersection:bC.implementation,divisor:tC.implementation,pattern:hC.implementation,predicate:eC.implementation,required:CC.implementation,optional:fy.implementation,index:NC.implementation,sequence:EC.implementation,structure:TC.implementation};pe.defaultConfig=FR(Object.assign(Nt(Tf,(e,t)=>[e,t.defaults]),{jitless:QR(),clone:JR,onUndeclaredKey:"ignore",exactOptionalPropertyTypes:!0,numberAllowsNaN:!1,dateAllowsInvalid:!1,onFail:null,keywords:{},toJsonSchema:hn.defaultConfig}));pe.resolvedConfig=rg(pe.defaultConfig,pe.config);const PP={...NL,alias:my.Node,domain:gy.Node,unit:DC.Node,proto:rf.Node,union:wC.Node,morph:SC.Node,intersection:bC.Node,divisor:tC.Node,pattern:hC.Node,predicate:eC.Node,required:CC.Node,optional:fy.Node,index:NC.Node,sequence:EC.Node,structure:TC.Node};class dg extends zR{get[Li](){return"module"}}const jC=(e,t)=>new dg(Nt(e,(n,i)=>[n,Re(i,"module")?jC(i,t):t.bindReference(i)])),IP=e=>kn(e)?e:"branches"in e&&kn(e.branches)?e.branches:void 0,zP=(e,t)=>le(`Node of kind ${t} is not valid as a ${e} definition`),rw=e=>`#${e} duplicates public alias ${e}`,Mp={};pe.ambient??={};let sw;const kC="function $",_P=e=>$C(e,OC(e)),$C=(e,t)=>{const n=t.write(kC,4),i=t.compile()();for(const s of e)s.precompilation||(s.traverseAllows=i[`${s.id}Allows`].bind(i),s.isRoot()&&!s.allowsRequiresContext&&(s.allows=s.traverseAllows),s.traverseApply=i[`${s.id}Apply`].bind(i),i[`${s.id}Optimistic`]&&(s.traverseOptimistic=i[`${s.id}Optimistic`].bind(i)),s.precompilation=n)},OC=e=>new BN().return(e.reduce((t,n)=>{const i=new Cp({kind:"Allows"}).indent();n.compile(i);const s=i.write(`${n.id}Allows`),l=new Cp({kind:"Apply"}).indent();n.compile(l);const c=l.write(`${n.id}Apply`),d=`${t}${s},
|
|
58
|
-
${c},
|
|
59
|
-
`;if(!n.hasKind("union"))return d;const h=new Cp({kind:"Allows",optimistic:!0}).indent();n.compile(h);const m=h.write(`${n.id}Optimistic`);return`${d}${m},
|
|
60
|
-
`},`{
|
|
61
|
-
`)+"}");class RC{config;resolvedConfig;name;get[Li](){return"scope"}referencesById={};references=[];resolutions={};exportedNames=[];aliases={};resolved=!1;nodesByHash={};intrinsic;constructor(t,n){this.config=rg(pe.config,n),this.resolvedConfig=rg(pe.resolvedConfig,n),this.name=this.resolvedConfig.name??`anonymousScope${Object.keys(Mp).length}`,this.name in Mp&&le(`A Scope already named ${this.name} already exists`),Mp[this.name]=this;const i=Object.entries(t).map(s=>this.preparseOwnAliasEntry(...s));for(const[s,l]of i){let c=s;if(s[0]==="#"?(c=s.slice(1),c in this.aliases&&le(rw(c)),this.aliases[c]=l):(c in this.aliases&&le(rw(s)),this.aliases[c]=l,this.exportedNames.push(c)),!Re(l,"module")&&!Re(l,"generic")&&!Df(l)){const d=this.preparseOwnDefinitionFormat(l,{alias:c});this.resolutions[c]=Re(d,"root")?this.bindReference(d):this.createParseContext(d).id}}sw??=this.node("union",{branches:["string","number","object","bigint","symbol",{unit:!0},{unit:!1},{unit:void 0},{unit:null}]},{prereduced:!0}),this.nodesByHash[sw.hash]=this.node("intersection",{},{prereduced:!0}),this.intrinsic=pe.intrinsic?Nt(pe.intrinsic,(s,l)=>s.startsWith("json")?[]:[s,this.bindReference(l)]):{}}cacheGetter(t,n){return Object.defineProperty(this,t,{value:n}),n}get internal(){return this}_json;get json(){return this._json||this.export(),this._json}defineSchema(t){return t}generic=(...t)=>{const n=this;return(i,s)=>new af(t,s?new ZN(i):i,n,n,s??null)};units=(t,n)=>{const i=[];for(const l of t)i.includes(l)||i.push(l);const s=i.map(l=>this.node("unit",{unit:l},n));return this.node("union",s,{...n,prereduced:!0})};lazyResolutions=[];lazilyResolve(t,n){const i=this.node("alias",{reference:n??"synthetic",resolve:t},{prereduced:!0});return this.resolved||this.lazyResolutions.push(i),i}schema=(t,n)=>this.finalize(this.parseSchema(t,n));parseSchema=(t,n)=>this.node(Pd(t),t,n);preparseNode(t,n,i){let s=typeof t=="string"?t:Pd(n,t);if(_n(n)&&n.kind===s)return n;if(s==="alias"&&!i?.prereduced){const{reference:d}=my.implementation.normalize(n,this);if(d.startsWith("$")){const h=this.resolveRoot(d.slice(1));n=h,s=h.kind}}else if(s==="union"&&ps(n,"object")){const d=IP(n);d?.length===1&&(n=d[0],s=Pd(n))}if(_n(n)&&n.kind===s)return n;const c=Tf[s].normalize?.(n,this)??n;return _n(c)?c.kind===s?c:zP(s,c.kind):{...i,$:this,kind:s,def:c,prefix:i.alias??s}}bindReference(t){let n;return _n(t)?n=t.$===this?t:new t.constructor(t.attachments,this):n=t.$===this?t:new af(t.params,t.bodyDef,t.$,this,t.hkt),this.resolved||Object.assign(this.referencesById,n.referencesById),n}resolveRoot(t){return this.maybeResolveRoot(t)??le(zC(t))}maybeResolveRoot(t){const n=this.maybeResolve(t);if(!Re(n,"generic"))return n}maybeResolveSubalias(t){return fg(this.aliases,t)??fg(this.ambient,t)}get ambient(){return pe.ambient}maybeResolve(t){const n=this.resolutions[t];if(n){if(typeof n!="string")return this.bindReference(n);const s=ka[n];if(Re(s,"root"))return this.resolutions[t]=s;if(Re(s,"context")){if(s.phase==="resolving")return this.node("alias",{reference:`$${t}`},{prereduced:!0});if(s.phase==="resolved")return cn(`Unexpected resolved context for was uncached by its scope: ${bt(s)}`);s.phase="resolving";const l=this.bindReference(this.parseOwnDefinitionFormat(s.def,s));return s.phase="resolved",ka[l.id]=l,ka[s.id]=l,this.resolutions[t]=l}return cn(`Unexpected nodesById entry for ${n}: ${bt(s)}`)}let i=this.aliases[t]??this.ambient?.[t];return i?(i=this.normalizeRootScopeValue(i),Re(i,"generic")?this.resolutions[t]=this.bindReference(i):Re(i,"module")?(i.root||le(_C(t)),this.resolutions[t]=this.bindReference(i.root)):this.resolutions[t]=this.parse(i,{alias:t})):this.maybeResolveSubalias(t)}createParseContext(t){const n=t.id??mC(t.prefix);return ka[n]=Object.assign(t,{[Li]:"context",$:this,id:n,phase:"unresolved"})}traversal(t){return new bo(t,this.resolvedConfig)}import(...t){return new dg(Nt(this.export(...t),(n,i)=>[`#${n}`,i]))}precompilation;_exportedResolutions;_exports;export(...t){if(!this._exports){this._exports={};for(const i of this.exportedNames){const s=this.aliases[i];this._exports[i]=Re(s,"module")?jC(s,this):ow(this.maybeResolve(i))}for(const i of this.lazyResolutions)i.resolution;if(this._exportedResolutions=IC(this,this._exports),this._json=PC(this._exportedResolutions),Object.assign(this.resolutions,this._exportedResolutions),this.references=Object.values(this.referencesById),!this.resolvedConfig.jitless){const i=OC(this.references);this.precompilation=i.write(kC,4),$C(this.references,i)}this.resolved=!0}const n=t.length?t:this.exportedNames;return new dg(Nt(n,(i,s)=>[s,this._exports[s]]))}resolve(t){return this.export()[t]}node=(t,n,i={})=>{const s=this.preparseNode(t,n,i);if(_n(s))return this.bindReference(s);const l=this.createParseContext(s),c=pC(l),d=this.bindReference(c);return ka[l.id]=d};parse=(t,n={})=>this.finalize(this.parseDefinition(t,n));parseDefinition(t,n={}){if(Re(t,"root"))return this.bindReference(t);const i=this.preparseOwnDefinitionFormat(t,n);if(Re(i,"root"))return this.bindReference(i);const s=this.createParseContext(i);ka[s.id]=s;let l=this.bindReference(this.parseOwnDefinitionFormat(t,s));return l.isCyclic&&(l=TL(l,s.id)),ka[s.id]=l,l}finalize(t){return ow(t),!t.precompilation&&!this.resolvedConfig.jitless&&_P(t.references),t}}class LC extends RC{parseOwnDefinitionFormat(t,n){return pC(n)}preparseOwnDefinitionFormat(t,n){return this.preparseNode(Pd(t),t,n)}preparseOwnAliasEntry(t,n){return[t,n]}normalizeRootScopeValue(t){return t}}const ow=e=>{const t=e.references.filter(n=>n.hasKind("alias"));for(const n of t){Object.assign(n.referencesById,n.resolution.referencesById);for(const i of e.references)n.id in i.referencesById&&Object.assign(i.referencesById,n.referencesById)}return e},PC=e=>Nt(e,(t,n)=>[t,Re(n,"root")||Re(n,"generic")?n.json:Re(n,"module")?PC(n):cn(`Unexpected resolution ${bt(n)}`)]),fg=(e,t)=>{const n=t.indexOf(".");if(n===-1)return;const i=t.slice(0,n),s=e[i];if(s===void 0)return;if(!Re(s,"module"))return le(UP(i));const l=t.slice(n+1),c=s[l];if(c===void 0)return fg(s,l);if(Re(c,"root")||Re(c,"generic"))return c;if(Re(c,"module"))return c.root??le(_C(t));cn(`Unexpected resolution for alias '${t}': ${bt(c)}`)},yy=(e,t)=>new LC(e,t),Hc=new LC({}),IC=(e,t)=>{const n={};for(const i in t){const s=t[i];if(Re(s,"module")){const l=IC(e,s),c=Nt(l,(d,h)=>[`${i}.${d}`,h]);Object.assign(n,c)}else Re(s,"root")||Re(s,"generic")?n[i]=s:cn(`Unexpected scope resolution ${bt(s)}`)}return n},zC=e=>`'${e}' is unresolvable`,UP=e=>`'${e}' must reference a module to be accessed using dot syntax`,_C=e=>`Reference to submodule '${e}' must specify an alias`;Hc.export();const At=Hc.schema,vy=Hc.node;Hc.defineSchema;const Ui=Hc.generic,UC="^(?:0|[1-9]\\d*)$",BP=new RegExp(UC);Un(BP);const BC=yy({bigint:"bigint",boolean:[{unit:!1},{unit:!0}],false:{unit:!1},never:[],null:{unit:null},number:"number",object:"object",string:"string",symbol:"symbol",true:{unit:!0},unknown:{},undefined:{unit:void 0},Array,Date},{prereducedAliases:!0}).export();pe.intrinsic={...BC};const FC=yy({integer:{domain:"number",divisor:1},lengthBoundable:["string",Array],key:["string","symbol"],nonNegativeIntegerString:{domain:"string",pattern:UC}},{prereducedAliases:!0}).export();Object.assign(pe.intrinsic,FC);const FP=yy({jsonPrimitive:["string","number",{unit:!0},{unit:!1},{unit:null}],jsonObject:{domain:"object",index:{signature:"string",value:"$jsonData"}},jsonData:["$jsonPrimitive","$jsonObject"]},{prereducedAliases:!0}).export(),Ie={...BC,...FC,...FP,emptyStructure:vy("structure",{},{prereduced:!0})};pe.intrinsic={...Ie};const lw=((e,t)=>new RegExp(e,t));Object.assign(lw,{as:lw});const HP=e=>typeof e=="string"&&e[0]==="d"&&(e[1]==="'"||e[1]==='"')&&e[e.length-1]===e[1],cw=e=>e.toString()!=="Invalid Date",qP=e=>e.slice(2,-1),HC=e=>`'${e}' could not be parsed by the Date constructor`,VP=(e,t)=>KP(e,t),KP=(e,t)=>{const n=new Date(e);if(cw(n))return n;const i=g2(e);if(i!==void 0){const s=new Date(i);if(cw(s))return s}return t?le(t===!0?HC(e):t):void 0},uw=(e,t)=>{const n=e.scanner.shiftUntilEscapable(JP[VC[t]]);if(e.scanner.lookahead==="")return e.error(WP(n,t));if(e.scanner.shift(),t==="/"){try{new RegExp(n)}catch(i){le(String(i))}e.root=e.ctx.$.node("intersection",{domain:"string",pattern:n},{prereduced:!0})}else if(di(t,qC))e.root=e.ctx.$.node("unit",{unit:n});else{const i=VP(n,HC(n));e.root=e.ctx.$.node("unit",{meta:n,unit:i})}},qC={"'":1,'"':1},GP={"/":1,"'":1,'"':1},YP={"d'":"'",'d"':'"',"'":"'",'"':'"'},VC={...YP,"/":"/"},JP={"'":e=>e.lookahead==="'",'"':e=>e.lookahead==='"',"/":e=>e.lookahead==="/"},XP={'"':"double-quote","'":"single-quote","/":"forward slash"},WP=(e,t)=>`${t}${e} requires a closing ${XP[VC[t]]}`,QP=e=>`Private type references should not include '#'. Use '${e}' instead.`,KC="Optional definitions like 'string?' are only valid as properties in an object or tuple",GC="Defaultable definitions like 'number = 0' are only valid as properties in an object or tuple",Uo={"<":1,">":1,"=":1,"|":1,"&":1,")":1,"[":1,"%":1,",":1,":":1,"?":1,"#":1,...Nf},ZP=(e,t)=>e===">"?t[0]==="="?t[1]==="=":t.trimStart()===""||di(t.trimStart()[0],Uo):e==="="?t[0]!=="=":e===","||e==="?",eI=(e,t,n)=>YC(e,t,n,[]),YC=(e,t,n,i)=>{const s=n.parseUntilFinalizer();return i.push(s.root),s.finalizer===">"?i.length!==t.params.length?n.error(JC(e,t.names,i.map(l=>l.expression))):i:s.finalizer===","?YC(e,t,n,i):s.error(_N(">"))},JC=(e,t,n)=>`${e}<${t.join(", ")}> requires exactly ${t.length} args (got ${n.length}${n.length===0?"":`: ${n.join(", ")}`})`,dw=e=>{const t=e.scanner.shiftUntilLookahead(Uo);t==="keyof"?e.addPrefix("keyof"):e.root=nI(e,t)},tI=(e,t,n)=>{if(n.scanner.shiftUntilNonWhitespace(),n.scanner.shift()!=="<")return n.error(JC(e,t.names,[]));const s=eI(e,t,n);return t(...s)},nI=(e,t)=>aI(e,t)??iI(e,t)??e.error(t===""?e.scanner.lookahead==="#"?QP(e.shiftedByOne().scanner.shiftUntilLookahead(Uo)):XC(e):zC(t)),aI=(e,t)=>{if(e.ctx.args?.[t]){const i=e.ctx.args[t];return typeof i!="string"?i:e.ctx.$.node("alias",{reference:i},{prereduced:!0})}const n=e.ctx.$.maybeResolve(t);if(Re(n,"root"))return n;if(n!==void 0)return Re(n,"generic")?tI(t,n,e):le(`Unexpected resolution ${bt(n)}`)},iI=(e,t)=>{const n=y2(t);if(n!==void 0)return e.ctx.$.node("unit",{unit:n});const i=b2(t);if(i!==void 0)return e.ctx.$.node("unit",{unit:i})},XC=e=>{const t=e.previousOperator();return t?WC(t,e.scanner.unscanned):rI(e.scanner.unscanned)},WC=(e,t="")=>`Token '${e}' requires a right operand${t?` before '${t}'`:""}`,rI=e=>`Expected an expression${e?` before '${e}'`:""}`,QC=e=>e.scanner.lookahead===""?e.error(XC(e)):e.scanner.lookahead==="("?e.shiftedByOne().reduceGroupOpen():e.scanner.lookaheadIsIn(GP)?uw(e,e.scanner.shift()):e.scanner.lookaheadIsIn(Nf)?QC(e.shiftedByOne()):e.scanner.lookahead==="d"&&e.scanner.nextLookahead in qC?uw(e,`${e.scanner.shift()}${e.scanner.shift()}`):dw(e),sI={">":!0,">=":!0},oI={"<":!0,"<=":!0},sf={"<":">",">":"<","<=":">=",">=":"<=","==":"=="},lI=(e,t)=>`Left bounds are only valid when paired with right bounds (try ...${t}${e})`,ZC=e=>`Left-bounded expressions must specify their limits using < or <= (was ${e})`,cI=(e,t,n,i)=>`An expression may have at most one left bound (parsed ${e}${sf[t]}, ${n}${sf[i]})`,uI=(e,t)=>{const n=fI(e,t);if(e.root.hasKind("unit")){if(typeof e.root.unit=="number"){e.reduceLeftBound(e.root.unit,n),e.unsetRoot();return}if(e.root.unit instanceof Date){const i=`d'${e.root.description??e.root.unit.toISOString()}'`;e.unsetRoot(),e.reduceLeftBound(i,n);return}}return mI(e,n)},dI={"<":1,">":1,"=":1},fI=(e,t)=>e.scanner.lookaheadIs("=")?`${t}${e.scanner.shift()}`:t,fw=(e,t,n,i)=>n.extends(pe.intrinsic.number)?typeof t!="number"?le(hg(e,t,i)):e==="=="?["min","max"]:e[0]===">"?["min"]:["max"]:n.extends(pe.intrinsic.lengthBoundable)?typeof t!="number"?le(hg(e,t,i)):e==="=="?["exactLength"]:e[0]===">"?["minLength"]:["maxLength"]:n.extends(pe.intrinsic.Date)?e==="=="?["after","before"]:e[0]===">"?["after"]:["before"]:le(lL(n.expression)),hI=e=>({rule:HP(e.limit)?qP(e.limit):e.limit,exclusive:e.comparator.length===1}),mI=(e,t)=>{const n=e.unsetRoot(),i=e.scanner.location;e.parseOperand();const s=e.unsetRoot(),l=e.scanner.sliceChars(i,e.scanner.location);if(e.root=n,!s.hasKind("unit")||typeof s.unit!="number"&&!(s.unit instanceof Date))return e.error(hg(t,l,"right"));const c=s.unit,d=t.length===1,h=fw(t,typeof c=="number"?c:l,n,"right");for(const y of h)e.constrainRoot(y,t==="=="?{rule:c}:{rule:c,exclusive:d});if(!e.branches.leftBound)return;if(!di(t,oI))return e.error(ZC(t));const m=fw(e.branches.leftBound.comparator,e.branches.leftBound.limit,n,"left");e.constrainRoot(m[0],hI(e.branches.leftBound)),e.branches.leftBound=null},hg=(e,t,n)=>`Comparator ${n==="left"?sf[e]:e} must be ${n==="left"?"preceded":"followed"} by a corresponding literal (was ${t})`,pI=e=>{e.scanner.shiftUntilNonWhitespace();const t=e.scanner.shiftUntilLookahead(Uo);e.root=e.root.brand(t)},gI=e=>{e.scanner.shiftUntilNonWhitespace();const t=e.scanner.shiftUntilLookahead(Uo),n=v2(t,{errorOnFail:hw(t)});n===0&&e.error(hw(0)),e.root=e.root.constrain("divisor",n)},hw=e=>`% operator must be followed by a non-zero integer literal (was ${e})`,e1=e=>{const t=e.scanner.shift();return t===""?e.finalize(""):t==="["?e.scanner.shift()==="]"?e.setRoot(e.root.array()):e.error(yI):t==="|"?e.scanner.lookahead===">"?e.shiftedByOne().pushRootToBranch("|>"):e.pushRootToBranch(t):t==="&"?e.pushRootToBranch(t):t===")"?e.finalizeGroup():ZP(t,e.scanner.unscanned)?e.finalize(t):di(t,dI)?uI(e,t):t==="%"?gI(e):t==="#"?pI(e):t in Nf?e1(e):e.error(by(t))},by=(e,t="")=>`'${e}' is not allowed here${t&&` (should be ${t})`}`,yI="Missing expected ']'",vI=e=>{const t=e.unsetRoot();e.parseOperand();const n=e.unsetRoot();if(!n.hasKind("unit"))return e.error(bI(n.expression));const i=n.unit instanceof Date?()=>new Date(n.unit):n.unit;return[t,"=",i]},bI=e=>`Default value '${e}' must be a literal value`,mw=(e,t)=>{const n=t.$.maybeResolveRoot(e);if(n)return n;if(e.endsWith("[]")){const l=t.$.maybeResolveRoot(e.slice(0,-2));if(l)return l.array()}const i=new jf(new zN(e),t),s=SI(i);return i.finalizer===">"&&le(by(">")),s},SI=e=>{e.parseOperand();let t=Sy(e).root;return t?(e.finalizer==="="?t=vI(e):e.finalizer==="?"&&(t=[t,"?"]),e.scanner.shiftUntilNonWhitespace(),e.scanner.lookahead&&le(by(e.scanner.lookahead)),t):cn(`Root was unexpectedly unset after parsing string '${e.scanner.scanned}'`)},Sy=e=>{for(;e.finalizer===void 0;)xI(e);return e},xI=e=>e.hasRoot()?e.parseOperator():e.parseOperand();class jf{root;branches={prefixes:[],leftBound:null,intersection:null,union:null,pipe:null};finalizer;groups=[];scanner;ctx;constructor(t,n){this.scanner=t,this.ctx=n}error(t){return le(t)}hasRoot(){return this.root!==void 0}setRoot(t){this.root=t}unsetRoot(){const t=this.root;return this.root=void 0,t}constrainRoot(...t){this.root=this.root.constrain(t[0],t[1])}finalize(t){if(this.groups.length)return this.error(_N(")"));this.finalizeBranches(),this.finalizer=t}reduceLeftBound(t,n){const i=sf[n];if(!di(i,sI))return this.error(ZC(n));if(this.branches.leftBound)return this.error(cI(this.branches.leftBound.limit,this.branches.leftBound.comparator,t,i));this.branches.leftBound={comparator:i,limit:t}}finalizeBranches(){if(this.assertRangeUnset(),this.branches.pipe){this.pushRootToBranch("|>"),this.root=this.branches.pipe;return}if(this.branches.union){this.pushRootToBranch("|"),this.root=this.branches.union;return}if(this.branches.intersection){this.pushRootToBranch("&"),this.root=this.branches.intersection;return}this.applyPrefixes()}finalizeGroup(){this.finalizeBranches();const t=this.groups.pop();if(!t)return this.error(A2(")",this.scanner.unscanned));this.branches=t}addPrefix(t){this.branches.prefixes.push(t)}applyPrefixes(){for(;this.branches.prefixes.length;){const t=this.branches.prefixes.pop();this.root=t==="keyof"?this.root.keyof():cn(`Unexpected prefix '${t}'`)}}pushRootToBranch(t){this.assertRangeUnset(),this.applyPrefixes();const n=this.root;this.root=void 0,this.branches.intersection=this.branches.intersection?.rawAnd(n)??n,t!=="&"&&(this.branches.union=this.branches.union?.rawOr(this.branches.intersection)??this.branches.intersection,this.branches.intersection=null,t!=="|"&&(this.branches.pipe=this.branches.pipe?.rawPipeOnce(this.branches.union)??this.branches.union,this.branches.union=null))}parseUntilFinalizer(){return Sy(new jf(this.scanner,this.ctx))}parseOperator(){return e1(this)}parseOperand(){return QC(this)}assertRangeUnset(){if(this.branches.leftBound)return this.error(lI(this.branches.leftBound.limit,this.branches.leftBound.comparator))}reduceGroupOpen(){this.groups.push(this.branches),this.branches={prefixes:[],leftBound:null,union:null,intersection:null,pipe:null}}previousOperator(){return this.branches.leftBound?.comparator??this.branches.prefixes[this.branches.prefixes.length-1]??(this.branches.intersection?"&":this.branches.union?"|":this.branches.pipe?"|>":void 0)}shiftedByOne(){return this.scanner.shift(),this}}const wI="An empty string is not a valid generic parameter name",mg=(e,t,n)=>{e.shiftUntilNonWhitespace();const i=e.shiftUntilLookahead(Uo);return i===""?e.lookahead===""&&t.length?t:le(wI):(e.shiftUntilNonWhitespace(),DI(e,i,t,n))},pw="extends ",DI=(e,t,n,i)=>{if(e.shiftUntilNonWhitespace(),e.unscanned.startsWith(pw))e.jumpForward(pw.length);else return e.lookahead===","&&e.shift(),n.push(t),mg(e,n,i);const s=Sy(new jf(e,i));return n.push([t,s.root]),mg(e,n,i)};class NI extends kr{constructor(t){const n={$:t,raw:t.fn};super((...i)=>{const s=i.indexOf(":"),l=s===-1?i.length-1:s-1,c=i.slice(0,l+1),d=t.parse(c).assertHasKind("intersection");let h=t.intrinsic.unknown;if(s!==-1){if(s!==i.length-2)return le(EI);h=t.parse(i[s+1])}return m=>new CI(m,d,h)},{attach:n})}}class CI extends kr{raw;params;returns;expression;constructor(t,n,i){const s=`typed ${t.name}`,l={[s]:(...d)=>{const h=n.assert(d),m=t(...h);return i.assert(m)}}[s];super(l),this.raw=t,this.params=n,this.returns=i;let c=n.expression;c[0]==="["&&c[c.length-1]==="]"?c=c.slice(1,-1):c.endsWith("[]")&&(c=`...${c}`),this.expression=`(${c}) => ${i?.expression??"unknown"}`}}const EI=`":" must be followed by exactly one return type e.g:
|
|
62
|
-
fn("string", ":", "number")(s => s.length)`;class AI extends kr{$;constructor(t){super((...n)=>new Nd(t)(...n),{bind:t}),this.$=t}in(t){return new Nd(this.$,t===void 0?void 0:this.$.parse(t))}at(t,n){return new Nd(this.$).at(t,n)}case(t,n){return new Nd(this.$).case(t,n)}}class Nd extends kr{$;in;key;branches=[];constructor(t,n){super(i=>this.caseEntries(Object.entries(i).map(([s,l])=>s==="default"?[s,l]:[this.$.parse(s),l]))),this.$=t,this.in=n}at(t,n){return this.key&&le(TI),this.branches.length&&le(MI),this.key=t,n?this.match(n):this}case(t,n){return this.caseEntry(this.$.parse(t),n)}caseEntry(t,n){const s=(this.key?this.$.parse({[this.key]:t}):t).pipe(n);return this.branches.push(s),this}match(t){return this(t)}strings(t){return this.caseEntries(Object.entries(t).map(([n,i])=>n==="default"?[n,i]:[this.$.node("unit",{unit:n}),i]))}caseEntries(t){for(let n=0;n<t.length;n++){const[i,s]=t[n];if(i==="default")return n!==t.length-1&&le("default may only be specified as the last key of a switch definition"),this.default(s);if(typeof s!="function")return le(`Value for case "${i}" must be a function (was ${Ya(s)})`);this.caseEntry(i,s)}return this}default(t){typeof t=="function"&&this.case(Ie.unknown,t);const n={branches:this.branches,ordered:!0};(t==="never"||t==="assert")&&(n.meta={onFail:gw});const i=this.$.node("union",n);if(!this.in)return this.$.finalize(i);let s=this.in.pipe(i);return(t==="never"||t==="assert")&&(s=s.configureReferences({onFail:gw},"self")),this.$.finalize(s)}}const gw=e=>e.throw(),MI="A key matcher must be specified before the first case i.e. match.at('foo') or match.in<object>().at('bar')",TI="At most one key matcher may be specified per expression",t1=(e,t)=>{if(kn(e)){if(e[1]==="=")return[t.$.parseOwnDefinitionFormat(e[0],t),"=",e[2]];if(e[1]==="?")return[t.$.parseOwnDefinitionFormat(e[0],t),"?"]}return l1(e,t)},jI="Only required keys may make their values optional, e.g. { [mySymbol]: ['number', '?'] }",kI="Only required keys may specify default values, e.g. { value: 'number = 0' }",$I=(e,t)=>{let n;const i={},s=Wd(e);for(const[c,d]of s){const h=LI(c);if(h.kind==="spread"){if(!Ic(i))return le(RI);const D=t.$.parseOwnDefinitionFormat(d,t);if(D.equals(Ie.object))continue;if(!D.hasKind("intersection")||!D.basis?.equals(Ie.object))return le(PI(D.expression));n=D.structure;continue}if(h.kind==="undeclared"){d!=="reject"&&d!=="delete"&&d!=="ignore"&&le(OI(d)),i.undeclared=d;continue}const m=t1(d,t),y=h;if(h.kind==="required"){kn(m)?Tp(i,"optional",m[1]==="="?{key:h.normalized,value:m[0],default:m[2]}:{key:h.normalized,value:m[0]},t):Tp(i,"required",{key:h.normalized,value:m},t);continue}if(kn(m)&&(m[1]==="?"&&le(jI),m[1]==="="&&le(kI)),h.kind==="optional"){Tp(i,"optional",{key:h.normalized,value:m},t);continue}const v=t.$.parseOwnDefinitionFormat(y.normalized,t),b=ug(v,m,t.$);b.index&&(i.index=Dt(i.index,b.index)),b.required&&(i.required=Dt(i.required,b.required))}const l=t.$.node("structure",i);return t.$.parseSchema({domain:"object",structure:n?.merge(l)??l})},Tp=(e,t,n,i)=>{e[t]=Dt(e[t],i.$.node(t,n))},OI=e=>`Value of '+' key must be 'reject', 'delete', or 'ignore' (was ${bt(e)})`,RI="Spread operator may only be used as the first key in an object",LI=e=>typeof e=="symbol"?{kind:"required",normalized:e}:e[e.length-1]==="?"?e[e.length-2]===fc?{kind:"required",normalized:`${e.slice(0,-2)}?`}:{kind:"optional",normalized:e.slice(0,-1)}:e[0]==="["&&e[e.length-1]==="]"?{kind:"index",normalized:e.slice(1,-1)}:e[0]===fc&&e[1]==="["&&e[e.length-1]==="]"?{kind:"required",normalized:e.slice(1)}:e==="..."?{kind:"spread"}:e==="+"?{kind:"undeclared"}:{kind:"required",normalized:e==="\\..."?"...":e==="\\+"?"+":e},PI=e=>`Spread operand must resolve to an object literal type (was ${e})`,II=(e,t)=>GI(e)?r1[e[0]](e,t):VI(e)?i1[e[1]](e,t):null,zI=(e,t)=>t.$.parseOwnDefinitionFormat(e[1],t).keyof(),jp=(e,t)=>{if(e[2]===void 0)return le(WC(e[1],""));const n=t.$.parseOwnDefinitionFormat(e[0],t),i=t.$.parseOwnDefinitionFormat(e[2],t);if(e[1]==="|")return t.$.node("union",{branches:[n,i]});const s=e[1]==="&"?Ii(n,i,t.$):og(n,i,t.$);return s instanceof Me?s.throw():s},_I=(e,t)=>t.$.parseOwnDefinitionFormat(e[0],t).array(),UI=(e,t)=>typeof e[2]!="function"?le(n1("=>",e[2])):t.$.parseOwnDefinitionFormat(e[0],t).pipe(e[2]),n1=(e,t)=>`${e===":"?"Narrow":"Morph"} expression requires a function following '${e}' (was ${typeof t})`,BI=(e,t)=>typeof e[2]!="function"?le(n1(":",e[2])):t.$.parseOwnDefinitionFormat(e[0],t).constrain("predicate",e[2]),FI=(e,t)=>t.$.parseOwnDefinitionFormat(e[0],t).configure(e[2],e[3]),a1=e=>e,HI=a1({"[]":_I,"?":()=>le(KC)}),qI=a1({"|":jp,"&":jp,":":BI,"=>":UI,"|>":jp,"@":FI,"=":()=>le(GC)}),i1={...HI,...qI},VI=e=>i1[e[1]]!==void 0,KI=e=>e,r1=KI({keyof:zI,instanceof:(e,t)=>{if(typeof e[1]!="function")return le(yw(eg(e[1])));const n=e.slice(1).map(i=>typeof i=="function"?t.$.node("proto",{proto:i}):le(yw(eg(i))));return n.length===1?n[0]:t.$.node("union",{branches:n})},"===":(e,t)=>t.$.units(e.slice(1))}),GI=e=>r1[e[0]]!==void 0,yw=e=>`Expected a constructor following 'instanceof' operator (was ${e})`,YI=(e,t)=>{let n=[{}],i=0;for(;i<e.length;){let s=!1;e[i]==="..."&&i<e.length-1&&(s=!0,i++);const l=t1(e[i],t),[c,d,h]=kn(l)?l:[l];if(i++,s){if(!c.extends(pe.intrinsic.Array))return le(WI(c.expression));n=n.flatMap(m=>c.distribute(y=>XI(qN(m),y)))}else n=n.map(m=>d==="?"?s1(m,c):d==="="?JI(m,c,h):pg(m,c))}return t.$.parseSchema(n.map(s=>Ic(s)?{proto:Array,exactLength:0}:{proto:Array,sequence:s}))},pg=(e,t)=>e.defaultables||e.optionals?le(e.variadic?AC:QI):(e.variadic?e.postfix=Dt(e.postfix,t):e.prefix=Dt(e.prefix,t),e),s1=(e,t)=>e.variadic?le(o1):(e.optionals=Dt(e.optionals,t),e),JI=(e,t,n)=>e.variadic?le(o1):e.optionals?le(ZI):(e.defaultables=Dt(e.defaultables,[[t,n]]),e),vw=(e,t)=>(e.postfix&&le(bw),e.variadic?e.variadic.equals(t)||le(bw):e.variadic=t.internal,e),XI=(e,t)=>{const n=t.select({method:"find",kind:"sequence"});if(!n)return vw(e,pe.intrinsic.unknown);if(n.prefix)for(const i of n.prefix)pg(e,i);if(n.optionals)for(const i of n.optionals)s1(e,i);if(n.variadic&&vw(e,n.variadic),n.postfix)for(const i of n.postfix)pg(e,i);return e},WI=e=>`Spread element must be an array (was ${e})`,bw="A tuple may have at most one variadic element",QI="A required element may not follow an optional element",o1="An optional element may not follow a variadic element",ZI="A defaultable element may not follow an optional element without a default",ez={},l1=(e,t)=>{if(typeof e=="string"){if(t.args&&Object.keys(t.args).some(i=>e.includes(i)))return mw(e,t);const n=ez[t.$.name]??={};return n[e]??=mw(e,t)}return ps(e,"object")?tz(e,t):le(gg(Ya(e)))},tz=(e,t)=>{const n=iy(e);switch(n){case void 0:return Re(e,"root")?e:$I(e,t);case"Array":return nz(e,t);case"RegExp":return t.$.node("intersection",{domain:"string",pattern:e},{prereduced:!0});case"Function":{const i=Df(e)?e():e;return Re(i,"root")?i:le(gg("Function"))}default:return le(gg(n??bt(e)))}},nz=(e,t)=>II(e,t)??YI(e,t),gg=e=>`Type definitions must be strings or objects (was ${e})`;class az extends kr{constructor(t){const n=Object.assign({errors:Mr,hkt:fi,$:t,raw:t.parse,module:t.constructor.module,scope:t.constructor.scope,declare:t.declare,define:t.define,match:t.match,generic:t.generic,schema:t.schema,keywords:t.ambient,unit:t.unit,enumerated:t.enumerated,instanceOf:t.instanceOf,valueOf:t.valueOf,or:t.or,and:t.and,merge:t.merge,pipe:t.pipe,fn:t.fn},t.ambientAttachments);super((...i)=>{if(i.length===1)return t.parse(i[0]);if(i.length===2&&typeof i[0]=="string"&&i[0][0]==="<"&&i[0][i[0].length-1]===">"){const s=i[0].slice(1,-1),l=t.parseGenericParams(s,{});return new af(l,i[1],t,t,null)}return t.parse(i)},{attach:n})}}const wc=pe;class kf extends RC{get ambientAttachments(){if(wc.typeAttachments)return this.cacheGetter("ambientAttachments",Nt(wc.typeAttachments,(t,n)=>[t,this.bindReference(n)]))}preparseOwnAliasEntry(t,n){const i=t.indexOf("<");if(i===-1){if(Re(n,"module")||Re(n,"generic"))return[t,n];const c=this.name==="ark"?t:t==="root"?this.name:`${this.name}.${t}`,d=this.resolvedConfig.keywords?.[c];return d&&(n=[n,"@",d]),[t,n]}t[t.length-1]!==">"&&le("'>' must be the last character of a generic declaration in a scope");const s=t.slice(0,i),l=t.slice(i+1,-1);return[s,()=>{const c=this.parseGenericParams(l,{alias:s});return Y2(c,n,this)}]}parseGenericParams(t,n){return mg(new zN(t),[],this.createParseContext({...n,def:t,prefix:"generic"}))}normalizeRootScopeValue(t){return Df(t)&&!Re(t,"generic")?t():t}preparseOwnDefinitionFormat(t,n){return{...n,def:t,prefix:n.alias??"type"}}parseOwnDefinitionFormat(t,n){!(n.alias&&n.alias in this.aliases)&&!n.args&&(n.args={this:n.id});const s=l1(t,n);if(kn(s)){if(s[1]==="=")return le(GC);if(s[1]==="?")return le(KC)}return s}unit=t=>this.units([t]);valueOf=t=>this.units(HR(t));enumerated=(...t)=>this.units(t);instanceOf=t=>this.node("proto",{proto:t},{prereduced:!0});or=(...t)=>this.schema(t.map(n=>this.parse(n)));and=(...t)=>t.reduce((n,i)=>n.and(this.parse(i)),this.intrinsic.unknown);merge=(...t)=>t.reduce((n,i)=>n.merge(this.parse(i)),this.intrinsic.object);pipe=(...t)=>this.intrinsic.unknown.pipe(...t);fn=new NI(this);match=new AI(this);declare=()=>({type:this.type});define(t){return t}type=new az(this);static scope=((t,n={})=>new kf(t,n));static module=((t,n={})=>this.scope(t,n).export())}const iz=Object.assign(kf.scope,{define:e=>e}),ut=kf;class rz extends fi{description='merge an object\'s properties onto another like `Merge(User, { isAdmin: "true" })`'}const sz=Ui(["base",Ie.object],["props",Ie.object])(e=>e.base.merge(e.props),rz),oz=ut.module({Key:Ie.key,Merge:sz});class lz extends fi{}const cz=Ui("element")(e=>{const t=e.element.exclude(Ie.Array),n=t.array();return t.rawOr(n).pipe(Pc).distribute(i=>i.assertHasKind("morph").declareOut(n),At)},lz),uz=ut.module({root:Ie.Array,readonly:"root",index:Ie.nonNegativeIntegerString,liftFrom:cz},{name:"Array"}),yg=At(["string",zc.FileConstructor]),dz=yg.rawOr(yg.array()),Sw=At({meta:"an object representing parsed form data",domain:"object",index:{signature:"string",value:dz}}),fz=ut.module({root:["instanceof",FormData],value:yg,parsed:Sw,parse:At({in:FormData,morphs:e=>{const t={};for(const[n,i]of e)if(n in t){const s=t[n];typeof s=="string"||s instanceof zc.FileConstructor?t[n]=[s,i]:s.push(i)}else t[n]=i;return t},declaredOut:Sw})},{name:"FormData"}),hz=ut.module({Int8:["instanceof",Int8Array],Uint8:["instanceof",Uint8Array],Uint8Clamped:["instanceof",Uint8ClampedArray],Int16:["instanceof",Int16Array],Uint16:["instanceof",Uint16Array],Int32:["instanceof",Int32Array],Uint32:["instanceof",Uint32Array],Float32:["instanceof",Float32Array],Float64:["instanceof",Float64Array],BigInt64:["instanceof",BigInt64Array],BigUint64:["instanceof",BigUint64Array]},{name:"TypedArray"}),mz={Boolean:1,Number:1,String:1},pz=ut.module({...Nt({...AN,...TN},(e,t)=>e in mz?[]:[e,["instanceof",t]]),Array:uz,TypedArray:hz,FormData:fz}),gz=At({domain:{domain:"number",meta:"a number representing a Unix timestamp"},divisor:{rule:1,meta:"an integer representing a Unix timestamp"},min:{rule:-864e13,meta:"a Unix timestamp after -8640000000000000"},max:{rule:864e13,meta:"a Unix timestamp before 8640000000000000"},meta:"an integer representing a safe Unix timestamp"}),yz=At({domain:"number",divisor:1}),c1=ut.module({root:Ie.number,integer:yz,epoch:gz,safe:At({domain:{domain:"number",numberAllowsNaN:!1},min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER}),NaN:["===",Number.NaN],Infinity:["===",Number.POSITIVE_INFINITY],NegativeInfinity:["===",Number.NEGATIVE_INFINITY]},{name:"number"}),$t=(e,t,n)=>{const i={domain:"string",pattern:{rule:e.source,flags:e.flags,meta:t}};return n&&(i.meta={format:n}),vy("intersection",i)},xw=$t(Qd,"a well-formed integer string"),u1=ut.module({root:xw,parse:At({in:xw,morphs:(e,t)=>{const n=Number.parseInt(e);return Number.isSafeInteger(n)?n:t.error("an integer in the range Number.MIN_SAFE_INTEGER to Number.MAX_SAFE_INTEGER")},declaredOut:Ie.integer})},{name:"string.integer"}),vz=$t(/^[\dA-Fa-f]+$/,"hex characters only"),bz=ut.module({root:$t(/^(?:[\d+/A-Za-z]{4})*(?:[\d+/A-Za-z]{2}==|[\d+/A-Za-z]{3}=)?$/,"base64-encoded"),url:$t(/^(?:[\w-]{4})*(?:[\w-]{2}(?:==|%3D%3D)?|[\w-]{3}(?:=|%3D)?)?$/,"base64url-encoded")},{name:"string.base64"}),ww=$t(/^[A-Z].*$/,"capitalized"),Sz=ut.module({root:At({in:"string",morphs:e=>e.charAt(0).toUpperCase()+e.slice(1),declaredOut:ww}),preformatted:ww},{name:"string.capitalize"}),xz=e=>{const t=e.replace(/[ -]+/g,"");let n=0,i,s,l=!1;for(let c=t.length-1;c>=0;c--)i=t.substring(c,c+1),s=Number.parseInt(i,10),l?(s*=2,n+=s>=10?s%10+1:s):n+=s,l=!l;return!!(n%10===0&&t)},wz=/^(?:4\d{12}(?:\d{3,6})?|5[1-5]\d{14}|(222[1-9]|22[3-9]\d|2[3-6]\d{2}|27[01]\d|2720)\d{12}|6(?:011|5\d\d)\d{12,15}|3[47]\d{13}|3(?:0[0-5]|[68]\d)\d{11}|(?:2131|1800|35\d{3})\d{11}|6[27]\d{14}|^(81\d{14,17}))$/,Dz=At({domain:"string",pattern:{meta:"a credit card number",rule:wz.source},predicate:{meta:"a credit card number",predicate:xz}}),Nz=/^([+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-3])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))(T((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([,.]\d+(?!:))?)?(\17[0-5]\d([,.]\d+)?)?([Zz]|([+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/,Cz=e=>!Number.isNaN(new Date(e).valueOf()),Dw=At({domain:"string",predicate:{meta:"a parsable date",predicate:Cz}}).assertHasKind("intersection"),Nw=u1.root.internal.narrow((e,t)=>{const n=Number.parseInt(e),i=c1.epoch(n);return i instanceof Mr?(t.errors.merge(i),!1):!0}).configure({description:"an integer string representing a safe Unix timestamp"},"self").assertHasKind("intersection"),Ez=ut.module({root:Nw,parse:At({in:Nw,morphs:e=>new Date(e),declaredOut:Ie.Date})},{name:"string.date.epoch"}),Cw=$t(Nz,"an ISO 8601 (YYYY-MM-DDTHH:mm:ss.sssZ) date").internal.assertHasKind("intersection"),Az=ut.module({root:Cw,parse:At({in:Cw,morphs:e=>new Date(e),declaredOut:Ie.Date})},{name:"string.date.iso"}),Mz=ut.module({root:Dw,parse:At({declaredIn:Dw,in:"string",morphs:(e,t)=>{const n=new Date(e);return Number.isNaN(n.valueOf())?t.error("a parsable date"):n},declaredOut:Ie.Date}),iso:Az,epoch:Ez},{name:"string.date"}),Tz=$t(/^[\w%+.-]+@[\d.A-Za-z-]+\.[A-Za-z]{2,}$/,"an email address","email"),Ew="(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])",pr=`(${Ew}[.]){3}${Ew}`,jz=new RegExp(`^${pr}$`),nn="(?:[0-9a-fA-F]{1,4})",kz=new RegExp(`^((?:${nn}:){7}(?:${nn}|:)|(?:${nn}:){6}(?:${pr}|:${nn}|:)|(?:${nn}:){5}(?::${pr}|(:${nn}){1,2}|:)|(?:${nn}:){4}(?:(:${nn}){0,1}:${pr}|(:${nn}){1,3}|:)|(?:${nn}:){3}(?:(:${nn}){0,2}:${pr}|(:${nn}){1,4}|:)|(?:${nn}:){2}(?:(:${nn}){0,3}:${pr}|(:${nn}){1,5}|:)|(?:${nn}:){1}(?:(:${nn}){0,4}:${pr}|(:${nn}){1,6}|:)|(?::((?::${nn}){0,5}:${pr}|(?::${nn}){1,7}|:)))(%[0-9a-zA-Z.]{1,})?$`),$z=ut.module({root:["v4 | v6","@","an IP address"],v4:$t(jz,"an IPv4 address","ipv4"),v6:$t(kz,"an IPv6 address","ipv6")},{name:"string.ip"}),Do="a JSON string",d1=e=>{if(!(e instanceof SyntaxError))throw e;return`must be ${Do} (${e})`},Oz=At({meta:Do,domain:"string",predicate:{meta:Do,predicate:(e,t)=>{try{return JSON.parse(e),!0}catch(n){return t.reject({code:"predicate",expected:Do,problem:d1(n)})}}}}),Rz=(e,t)=>{if(e.length===0)return t.error({code:"predicate",expected:Do,actual:"empty"});try{return JSON.parse(e)}catch(n){return t.error({code:"predicate",expected:Do,problem:d1(n)})}},Lz=ut.module({root:Oz,parse:At({meta:"safe JSON string parser",in:"string",morphs:Rz,declaredOut:Ie.jsonObject})},{name:"string.json"}),Aw=$t(/^[a-z]*$/,"only lowercase letters"),Pz=ut.module({root:At({in:"string",morphs:e=>e.toLowerCase(),declaredOut:Aw}),preformatted:Aw},{name:"string.lower"}),f1=["NFC","NFD","NFKC","NFKD"],qc=Nt(f1,(e,t)=>[t,At({domain:"string",predicate:n=>n.normalize(t)===n,meta:`${t}-normalized unicode`})]),$f=Nt(f1,(e,t)=>[t,At({in:"string",morphs:n=>n.normalize(t),declaredOut:qc[t]})]),Iz=ut.module({root:$f.NFC,preformatted:qc.NFC},{name:"string.normalize.NFC"}),zz=ut.module({root:$f.NFD,preformatted:qc.NFD},{name:"string.normalize.NFD"}),_z=ut.module({root:$f.NFKC,preformatted:qc.NFKC},{name:"string.normalize.NFKC"}),Uz=ut.module({root:$f.NFKD,preformatted:qc.NFKD},{name:"string.normalize.NFKD"}),Bz=ut.module({root:"NFC",NFC:Iz,NFD:zz,NFKC:_z,NFKD:Uz},{name:"string.normalize"}),Mw=$t(tg,"a well-formed numeric string"),Fz=ut.module({root:Mw,parse:At({in:Mw,morphs:e=>Number.parseFloat(e),declaredOut:Ie.number})},{name:"string.numeric"}),Tw="a regex pattern",Hz=At({domain:"string",predicate:{meta:Tw,predicate:(e,t)=>{try{return new RegExp(e),!0}catch(n){return t.reject({code:"predicate",expected:Tw,problem:String(n)})}}},meta:{format:"regex"}}),qz=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[A-Za-z-][\dA-Za-z-]*)(?:\.(?:0|[1-9]\d*|\d*[A-Za-z-][\dA-Za-z-]*))*))?(?:\+([\dA-Za-z-]+(?:\.[\dA-Za-z-]+)*))?$/,Vz=$t(qz,"a semantic version (see https://semver.org/)"),jw=$t(/^\S.*\S$|^\S?$/,"trimmed"),Kz=ut.module({root:At({in:"string",morphs:e=>e.trim(),declaredOut:jw}),preformatted:jw},{name:"string.trim"}),kw=$t(/^[A-Z]*$/,"only uppercase letters"),Gz=ut.module({root:At({in:"string",morphs:e=>e.toUpperCase(),declaredOut:kw}),preformatted:kw},{name:"string.upper"}),Yz=e=>URL.canParse(e),$w=At({domain:"string",predicate:{meta:"a URL string",predicate:Yz},meta:{format:"uri"}}),Jz=ut.module({root:$w,parse:At({declaredIn:$w,in:"string",morphs:(e,t)=>{try{return new URL(e)}catch{return t.error("a URL string")}},declaredOut:At(URL)})},{name:"string.url"}),Xz=ut.module({root:["versioned | nil | max","@",{description:"a UUID",format:"uuid"}],"#nil":"'00000000-0000-0000-0000-000000000000'","#max":"'ffffffff-ffff-ffff-ffff-ffffffffffff'","#versioned":/[\da-f]{8}-[\da-f]{4}-[1-8][\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}/i,v1:$t(/^[\da-f]{8}-[\da-f]{4}-1[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i,"a UUIDv1"),v2:$t(/^[\da-f]{8}-[\da-f]{4}-2[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i,"a UUIDv2"),v3:$t(/^[\da-f]{8}-[\da-f]{4}-3[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i,"a UUIDv3"),v4:$t(/^[\da-f]{8}-[\da-f]{4}-4[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i,"a UUIDv4"),v5:$t(/^[\da-f]{8}-[\da-f]{4}-5[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i,"a UUIDv5"),v6:$t(/^[\da-f]{8}-[\da-f]{4}-6[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i,"a UUIDv6"),v7:$t(/^[\da-f]{8}-[\da-f]{4}-7[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i,"a UUIDv7"),v8:$t(/^[\da-f]{8}-[\da-f]{4}-8[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i,"a UUIDv8")},{name:"string.uuid"}),Wz=ut.module({root:Ie.string,alpha:$t(/^[A-Za-z]*$/,"only letters"),alphanumeric:$t(/^[\dA-Za-z]*$/,"only letters and digits 0-9"),hex:vz,base64:bz,capitalize:Sz,creditCard:Dz,date:Mz,digits:$t(/^\d*$/,"only digits 0-9"),email:Tz,integer:u1,ip:$z,json:Lz,lower:Pz,normalize:Bz,numeric:Fz,regex:Hz,semver:Vz,trim:Kz,upper:Gz,url:Jz,uuid:Xz},{name:"string"}),Qz=ut.module({bigint:Ie.bigint,boolean:Ie.boolean,false:Ie.false,never:Ie.never,null:Ie.null,number:Ie.number,object:Ie.object,string:Ie.string,symbol:Ie.symbol,true:Ie.true,unknown:Ie.unknown,undefined:Ie.undefined}),Zz=ut.module({root:Ie.unknown,any:Ie.unknown},{name:"unknown"}),e3=ut.module({root:Ie.jsonObject,stringify:vy("morph",{in:Ie.jsonObject,morphs:e=>JSON.stringify(e),declaredOut:Ie.string})},{name:"object.json"}),t3=ut.module({root:Ie.object,json:e3},{name:"object"});class n3 extends fi{description='instantiate an object from an index signature and corresponding value type like `Record("string", "number")`'}const a3=Ui(["K",Ie.key],"V")(e=>({domain:"object",index:{signature:e.K,value:e.V}}),n3);class i3 extends fi{description='pick a set of properties from an object like `Pick(User, "name | age")`'}const r3=Ui(["T",Ie.object],["K",Ie.key])(e=>e.T.pick(e.K),i3);class s3 extends fi{description='omit a set of properties from an object like `Omit(User, "age")`'}const o3=Ui(["T",Ie.object],["K",Ie.key])(e=>e.T.omit(e.K),s3);class l3 extends fi{description="make all named properties of an object optional like `Partial(User)`"}const c3=Ui(["T",Ie.object])(e=>e.T.partial(),l3);class u3 extends fi{description="make all named properties of an object required like `Required(User)`"}const d3=Ui(["T",Ie.object])(e=>e.T.required(),u3);class f3 extends fi{description='exclude branches of a union like `Exclude("boolean", "true")`'}const h3=Ui("T","U")(e=>e.T.exclude(e.U),f3);class m3 extends fi{description='extract branches of a union like `Extract("0 | false | 1", "number")`'}const p3=Ui("T","U")(e=>e.T.extract(e.U),m3),g3=ut.module({Exclude:h3,Extract:p3,Omit:o3,Partial:c3,Pick:r3,Record:a3,Required:d3}),$r=iz({...Qz,...g3,...pz,...oz,string:Wz,number:c1,object:t3,unknown:Zz},{prereducedAliases:!0,name:"ark"}),gn=$r.export();Object.assign(wc.ambient,gn);wc.typeAttachments={string:gn.string.root,number:gn.number.root,bigint:gn.bigint,boolean:gn.boolean,symbol:gn.symbol,undefined:gn.undefined,null:gn.null,object:gn.object.root,unknown:gn.unknown.root,false:gn.false,true:gn.true,never:gn.never,arrayIndex:gn.Array.index,Key:gn.Key,Record:gn.Record,Array:gn.Array.root,Date:gn.Date};const xy=Object.assign($r.type,wc.typeAttachments);$r.match;$r.fn;$r.generic;$r.schema;$r.define;$r.declare;async function Of({url:e,method:t="GET",body:n,headers:i}){if(t==="POST"&&!n)throw new Error("The request body is required");const s=await fetch(e,{method:t,headers:i,body:n&&t==="POST"?n:void 0});if(s.status<200||s.status>=300){const l=await s.text();throw new Error(`Error '${s.status}' from the server: ${l}`)}return await s.json()}async function h1(e,t){return await Of({url:e,method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...t,action:"signIn"})})}async function y3(e){return await Of({url:Id,method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:e,action:"verify"})})}function of(e){return"id"in e}async function v3(e,t){return await Of({url:e,method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:t,action:"loginWithPlatformToken"})})}const wy="sess",lf="paAdminUiToken";let pa;const b3=xy({id:"string",token:"string","adminUiToken?":"string|undefined","+":"delete"});async function S3(){const e=localStorage.getItem(wy);if(!e)return;const t=b3.assert(JSON.parse(e));if(!t)return;const n=await y3(t.token);if(of(n)){const i={id:n.id,token:n.token,adminUiToken:n.adminUiToken||t.adminUiToken};return pa=i,i.adminUiToken&&await m1(i.adminUiToken),i}n.statusCode===401&&await mc()}async function vg(e){pa=e,localStorage.setItem(wy,JSON.stringify(e)),e.adminUiToken&&await m1(e.adminUiToken)}async function mc(){localStorage.removeItem(wy),pa=void 0,await x3()}async function m1(e){"cookieStore"in window?await cookieStore.set({name:lf,value:e,path:"/",sameSite:"strict"}):document.cookie=`${lf}=${e}; path=/; SameSite=Strict`}async function x3(){"cookieStore"in window?await cookieStore.delete({name:lf,path:"/"}):document.cookie=`${lf}=; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT; SameSite=Strict`}async function w3(e){const t=pa?.token;if(!t)return"NOT_READY";const n=e.map(c=>({message:c.message,level:c.level})),s=await fetch(p1,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`},body:JSON.stringify({query:`
|
|
63
|
-
mutation SaveLog($lines: [LogLineInput!]!) {
|
|
64
|
-
saveLog(lines: $lines)
|
|
65
|
-
}
|
|
66
|
-
`,variables:{lines:n}})});return!s.ok||(await s.json()).errors?"CANCEL":"DONE"}function D3(e){let t=e,n;return i=>{if(i&&(t=i),!t)throw new Error("Missing an URL to open");if(n===void 0||n.closed){if(n=window.open(t,"_blank")??void 0,!n)return}else n.location.href===t?n.location.reload():n.location.href=t;n.focus()}}const bg=xy("string|undefined").assert(void 0),Sg="/adm",Va=bg?`//${document.location.hostname}:${bg}`:`//${document.location.host}`,p1=`${Va}/adm/backend/graphql`,Id=`${Va}/api/v1/login`,N3=e=>`${e}/?redirectTo=${bg?document.location.hostname:document.location.host}`,on=pk({minLevel:"debug",send:{minLevel:"warn",sendToServer:w3}}),g1=D3();function we(){const{t:e,i18n:t}=Pt(),n=S.useRef(e);return S.useEffect(()=>{n.current=e},[t.language]),n.current}function Dy(){const e=we();return f.jsxs("div",{className:"NotFoundScreen",children:[f.jsx("h1",{children:"Oops!"}),f.jsx("p",{children:e("NotFoundScreen.notFound")}),f.jsx(ny,{to:"/",className:"Button primary",children:e("NotFoundScreen.returnHomePage")})]})}function y1(e,t){e.sorting==="manual"?t.sort((n,i)=>n.orderNum===i.orderNum?0:n.orderNum===null||n.orderNum===void 0?-1:i.orderNum===null||i.orderNum===void 0?1:n.orderNum-i.orderNum):Ow(e.sorting,{fieldName:"publishDate",direction:"desc"})?t.sort((n,i)=>n.publishDate&&i.publishDate?n.publishDate===i.publishDate?Number(n.nodeId)>Number(i.nodeId)?-1:1:new Date(i.publishDate).getTime()-new Date(n.publishDate).getTime():0):Ow(e.sorting,{fieldName:"publishDate",direction:"asc"})&&t.sort((n,i)=>n.publishDate&&i.publishDate?n.publishDate===i.publishDate?Number(n.nodeId)>Number(i.nodeId)?-1:1:new Date(n.publishDate).getTime()-new Date(i.publishDate).getTime():0)}function Ow(e,t){return e.some(n=>n.fieldName===t.fieldName&&n.direction===t.direction)}function C3(e,t,n){return`/preview-${e}/${t}/${n}`}const E3=xy({access:'"public"|"protected"',"password?":"string|undefined","+":"reject"});function A3(e){const{value:t}=jc(e);return yc(t)&&typeof t.j=="object"&&t.j!==null?E3.assert(t.j):void 0}function Tr(e,t){const n=e.nodeTypes[t];if(!n||n.kind!=="document")throw new Error(`Unknown document type '${t}'`);return n}function v1(e,t){const n=e.nodeTypes[t];if(!n||n.kind!=="document"||n.documentKind!=="routing")throw new Error(`Unknown routing document type '${t}'`);return n}function M3(e,t){const n=e.nodeTypes[t];if(!n||n.kind!=="document"||n.documentKind!=="regular")throw new Error(`Unknown regular document type '${t}'`);return n}function T3(e,t,n){return Object.values(e.nodeTypes).find(i=>i.kind===n&&i.kebabName===t)}function j3(e,t){const n=t.mediaPolicy;if(n){const i=e.mediaPolicies[n].mediaLimitPerDocument;if(i!==void 0)return i}return e.mediaPolicies.default.mediaLimitPerDocument}function k3(e,t){const n=t.mediaPolicy;if(n){const i=e.mediaPolicies[n].mediaLimitPerPart;if(i!==void 0)return i}return e.mediaPolicies.default.mediaLimitPerPart}function Vc(e){return e.documentKind==="regular"||!e.redirectTo}function $3(e,t){const i=Object.keys(e.nodeTypes).indexOf(t);return i>=0?i:0}function b1(e){return e.kind!=="document"?!1:e.documentKind==="regular"&&(!!e.routingChildren&&e.routingChildren.length>0||!!e.cluster)||e.documentKind==="routing"&&e.typeName==="home"}function O3(e){return e.kind==="document"&&e.documentKind==="regular"&&(!!e.routingChildren&&e.routingChildren.length>0||!!e.cluster)}function S1(e){return{all:e=e||new Map,on:function(t,n){var i=e.get(t);i?i.push(n):e.set(t,[n])},off:function(t,n){var i=e.get(t);i&&(n?i.splice(i.indexOf(n)>>>0,1):e.set(t,[]))},emit:function(t,n){var i=e.get(t);i&&i.slice().map(function(s){s(n)}),(i=e.get("*"))&&i.slice().map(function(s){s(t,n)})}}}const kp=S1(),rn={emit(e,t){setTimeout(()=>kp.emit(e,t),0)},on(e,t){kp.on(e,t)},off(e,t){kp.off(e,t)}},Rw=e=>{let t;const n=new Set,i=(m,y)=>{const v=typeof m=="function"?m(t):m;if(!Object.is(v,t)){const b=t;t=y??(typeof v!="object"||v===null)?v:Object.assign({},t,v),n.forEach(D=>D(t,b))}},s=()=>t,d={setState:i,getState:s,getInitialState:()=>h,subscribe:m=>(n.add(m),()=>n.delete(m))},h=t=e(i,s,d);return d},R3=(e=>e?Rw(e):Rw),L3=e=>e;function P3(e,t=L3){const n=Jl.useSyncExternalStore(e.subscribe,Jl.useCallback(()=>t(e.getState()),[e,t]),Jl.useCallback(()=>t(e.getInitialState()),[e,t]));return Jl.useDebugValue(n),n}const I3=e=>{const t=R3(e),n=i=>P3(t,i);return Object.assign(n,t),n},z3=(e=>I3),x1="defaultLanguage";function _3(e){return localStorage.setItem(x1,e)}function U3(){return localStorage.getItem(x1)}let w1;function B3(){return w1}const Ge=z3()((e,t)=>({appLayout:"desktop",isAuthenticated:!1,userLanguage:Lw(),setAppLayout:n=>e({appLayout:n}),setIsAuthenticated:n=>e({isAuthenticated:n}),setPublicConstants:n=>e({publicConstants:n,userLanguage:Lw(n)}),setInitialData:n=>e({initialData:n}),setHomeRoutingCluster:n=>e({homeRoutingCluster:n}),setContentLanguage:n=>{e({contentLanguage:n}),w1=n},setUserLanguage(n){_3(n),e({userLanguage:n})},setAuthAccount:n=>e({authAccount:n,preferences:void 0}),setPreferences:n=>{const{setUserLanguage:i}=t();e({preferences:n}),n?.language&&i(n.language)},setSiteFieldValues:n=>e({siteFieldValues:n,siteTitle:ho(n.title)})}));function Lw(e){const t=e?e.languageWithLabels.map(l=>l.language):[],n=t.some(l=>cc.includes(l));let i;n?i=t:i=[...new Set([...t,"en"])];const s=U3()??navigator.language.substring(0,2);return i.includes(s)?s:i[0]??"en"}function Kc(){const e=Ge(t=>t.publicConstants);if(!e)throw new Error("Site constants not set");return e}function St(){const e=Ge(t=>t.initialData);if(!e)throw new Error("No initial data");return e}function Rf(){const e=Ge(t=>t.homeRoutingCluster);if(!e)throw new Error("No home routing cluster");return e}function ya(){const e=Ge(n=>n.contentLanguage),{siteSchema:t}=St();return e??t.defaultLanguage}function F3(){const{siteSchema:e}=St();return()=>B3()??e.defaultLanguage}function Ny(){const e=Ge(t=>t.authAccount);if(!e)throw new Error("No account");return e}function na(){return Ge(e=>e.userLanguage)}function Cy(){const{contentLanguage:e}=Wg(),t=Ge(s=>s.setContentLanguage),{siteSchema:n}=St(),i=!!e&&!n.languages.includes(e);return S.useEffect(()=>{e&&(i?rn.emit("404"):t(e))},[e,i]),{requestedContentLanguage:i?void 0:e,isInvalid:i}}function D1(e){const{side:t,children:n,className:i,sideClassName:s,mainClassName:l,burgerClassName:c,noSidePaddingOnMobile:d,scrollable:h}=e,[m,y]=S.useState(!1),v=Ge(D=>D.appLayout),b=Ra();return S.useEffect(()=>{y(!1)},[b]),f.jsxs("div",{className:he("PaApp WithSidebar",i,d&&"noSidePaddingOnMobile"),children:[v==="mobile"&&f.jsx(de,{className:he("WithSidebar-burgerBtn",c),severity:"secondary",onClick:()=>y(!m),children:f.jsx(KT,{size:16})}),f.jsxs("div",{className:he("_sidebar WithSidebar-side bg-bluegray-800",s,v==="mobile"&&!m&&"hidden"),children:[v==="mobile"&&f.jsx(de,{className:"WithSidebar-closeButton",severity:"secondary",onClick:()=>y(!1),children:f.jsx(Lo,{size:16})}),t]}),f.jsx("div",{className:he("PaMainContent WithSidebar-main",l,h&&"Scrollable"),children:n})]})}let po=[];function H3(e){const t=S.useRef(e),n=po.indexOf(t.current);n!==-1&&po.splice(n,po.length-n),po.push(e),t.current=e;const i=Ra();S.useEffect(()=>{po=[]},[i])}let xg=0n;function Wt(){const e=N1(),t=$c();return S.useCallback((n,i)=>{e(n,i).catch(s=>{t.error("Safe navigation failed",s)})},[e,t])}function N1(){const e=xf();return S.useCallback(async(t,n)=>{const i=++xg;return!await q3(i)||i!==xg?!1:(await e(t,n),!0)},[e])}async function q3(e){for(const t of po)if(e!==xg||!await t())return!1;return!0}function C1(){const e=Ge(t=>t.setIsAuthenticated);return async()=>{await mc(),e(!1)}}function Bn(e,t){const{documentType:n,language:i,documentNodeId:s}=E1(e),{kebabName:l}=n,c=t??V3(n);return c==="edit"?`/node/${i}/${l}/${s}/edit`:c==="childDocuments"?`/node/${i}/${l}/${s}/child-documents`:c==="parts"?`/node/${i}/${l}/${s}/parts`:`/node/${i}/${l}/${s}`}function V3(e){const t=e.adminUi?.defaultTab;if(t&&t!=="auto")return t;if(e.lists)return"parts";const n=e.regularChildren;if(n&&n.length>0)return"childDocuments";if(Vc(e))return"edit"}function $o(e){const{documentNodeId:t,language:n,documentType:i}=E1(e);let s;if("partId"in e&&e.partId!==void 0){const c=_t(e.partId);if(c.language!==n)throw new Error("Part language must match document language");s=c.nodeId}else"partNodeId"in e&&e.partNodeId!==void 0&&(s=e.partNodeId);const l=s!==void 0?`/${s}`:"";return`/node/${n}/${i.kebabName}/${t}/parts${l}`}function ii(e){return`/adm${e}`}function E1(e){const{documentType:t}=e;if("documentId"in e){const{language:n,nodeId:i}=_t(e.documentId);return{language:n,documentNodeId:i,documentType:t}}return{language:e.language,documentNodeId:e.documentNodeId,documentType:t}}function ge(e,...t){return e.reduce((n,i,s)=>n+i+(t[s]||""),"")}async function Se(e,t,{undefOn404:n}={}){try{const i=await fetch(p1,{method:"POST",headers:{"Content-Type":"application/json",...pa?.token&&{Authorization:`Bearer ${pa.token}`}},body:JSON.stringify({query:e,variables:t})}),s=await i.json();if(i.ok||on.error(`[Network error]: HTTP ${i.status}`),s.errors||!s.data){if(n&&K3(s.errors))return;throw new Error(`GraphQL error: ${G3(s.errors)}`)}return s.data}catch(i){throw i instanceof TypeError&&on.error(`[Network error]: ${Fn(i)}`),i}}function K3(e){return e?e.some(t=>t?.extensions?.status===404||t?.extensions?.code==="NOT_FOUND"):!1}function G3(e){return e?e.map(t=>t.message).join(", "):"Unknown error"}const Y3=ge`
|
|
67
|
-
query routingClusterAndParents($nodeId: ID!) {
|
|
68
|
-
routingClusterAndParents(nodeId: $nodeId)
|
|
69
|
-
}
|
|
70
|
-
`;function J3(){const e=Ge(t=>t.setHomeRoutingCluster);return S.useCallback(async t=>{const i=(await Se(Y3,{nodeId:t})).routingClusterAndParents.map(l=>JSON.parse(l)),s=i[0];if(s){if(s.kind!=="home")throw new Error("should be home routing cluster");e(s)}return i},[e])}const X3=ge`
|
|
71
|
-
query annotatedCluster($rootNodeId: ID!) {
|
|
72
|
-
annotatedCluster(rootNodeId: $rootNodeId)
|
|
73
|
-
}
|
|
74
|
-
`;function A1(){return S.useCallback(async e=>{const t=await Se(X3,{rootNodeId:e});return JSON.parse(t.annotatedCluster)},[])}const W3=ge`
|
|
75
|
-
mutation manageClusterRoutingDocuments($requestJson: String!) {
|
|
76
|
-
manageClusterRoutingDocuments(requestJson: $requestJson)
|
|
77
|
-
}
|
|
78
|
-
`;function Q3(){return S.useCallback(async e=>{await Se(W3,{requestJson:JSON.stringify(e)})},[])}const Z3=ge`
|
|
79
|
-
mutation deleteCluster($rootLNodeId: String!) {
|
|
80
|
-
deleteCluster(rootLNodeId: $rootLNodeId)
|
|
81
|
-
}
|
|
82
|
-
`;function e_(){return S.useCallback(async e=>{await Se(Z3,{rootLNodeId:e})},[])}const t_=ge`
|
|
83
|
-
mutation deleteNodeAndClusters($rootNodeId: String!) {
|
|
84
|
-
deleteNodeAndClusters(rootNodeId: $rootNodeId)
|
|
85
|
-
}
|
|
86
|
-
`;function n_(){return S.useCallback(async e=>{await Se(t_,{rootNodeId:e})},[])}const Lf=S.createContext(void 0);function a_({documentNodeId:e,children:t}){const n=J3(),i=Rf(),[s,l]=S.useState([i]),c=S.useCallback(async()=>{const h=await n(e);l(h)},[e,n]),d=S.useMemo(()=>({clusterHierarchy:s,refreshRoutingCluster:c}),[s,c]);return ct(async()=>{const h=await n(e);l(h)},[e,n]),f.jsx(Lf.Provider,{value:d,children:t})}function i_(){const e=S.useContext(Lf),t=Rf();return e?e.clusterHierarchy[e.clusterHierarchy.length-1]??t:t}function M1(){const e=S.useContext(Lf),t=Rf();return e?e.clusterHierarchy:[t]}function r_(){const e=S.useContext(Lf);return e?e.refreshRoutingCluster:async()=>{}}const s_=ge`
|
|
87
|
-
query DocumentTitle($lNodeId: ID!) {
|
|
88
|
-
lNodeWrap(lNodeId: $lNodeId) {
|
|
89
|
-
document {
|
|
90
|
-
title
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
`;function o_(){return S.useCallback(async e=>(await Se(s_,{lNodeId:e},{undefOn404:!0}))?.lNodeWrap.document?.title??void 0,[])}function l_(e,t){const n=we(),i=Wt(),{siteSchema:s}=St(),l=ya(),c=o_(),[d,h]=S.useState();return ct(async()=>{if(e.kind!=="sub")return;const m=e.lNodeIds[l];if(m!==void 0){const y=await c(m);y&&h(y)}},[e,l,c]),S.useMemo(()=>c_({t:n,navigate:i,contentLanguage:l,siteSchema:s,cluster:e,activeMap:d_(e,t),rootDocumentTitle:d}),[s,e,n,t,l,i,d])}function c_(e){const{siteSchema:t,cluster:n}=e,i=Tr(t,n.typeName),l=[j1(e,i,n.nodeId)];return T1(e,l,i,n),l}function T1(e,t,n,i,{allowPopupItems:s}={}){const{siteSchema:l}=e,c=[];for(const d of n.routingChildren??[]){const h=v1(l,d),m=i.children?.[d];if(!m)continue;const y=u_(e,h,m);s&&h.adminUi?.menuPlacement==="popup"&&!y.subMenu?c.push(y):t.push(y)}if(s)return c}function u_(e,t,n){const{activeMap:i}=e,s=j1(e,t,n.nodeId);if(t.routingChildren){const l=[],c=T1(e,l,t,n,{allowPopupItems:!0});c.length>0&&(s.popupMenu=c),l.length>0&&(s.subMenu=l),i.get(n.nodeId)==="parent"&&(s.expanded=!0)}return s}function j1(e,t,n){const{contentLanguage:i,navigate:s,t:l,rootDocumentTitle:c,cluster:d}=e,h=Bn({language:i,documentType:t,documentNodeId:n},t.adminUi?.defaultTab);let m=d.nodeId===n?c:void 0;m??=l(`siteSchema.nodeTypes.${t.typeName}.label`,t.typeName);let y;return t.lists&&t.lists.length>0?y=f.jsx(LT,{size:16}):t.regularChildren&&t.regularChildren.length>0?y=f.jsx(QT,{size:16}):y=f.jsx(uD,{size:16}),{key:`${n}:${i}`,label:m,url:ii(h),command:()=>s(h),icon:y,active:e.activeMap.has(n)}}function d_(e,t){if(t.kind!=="document")return new Map;const n=t.documentNodeId,i=[];return e.nodeId===n?i.push([e.nodeId,"active"]):e.children&&i.push(...k1(n,Object.values(e.children))),new Map(i)}function k1(e,t){const n=[];for(const i of t)if(i.nodeId===e)n.push([i.nodeId,"active"]);else if(i.children){const s=k1(e,Object.values(i.children));s.length>0&&(n.push([i.nodeId,"parent"]),n.push(...s))}return n}function f_({clusterHierarchy:e,activeRoute:t}){return f.jsx(f.Fragment,{children:e.map(n=>f.jsx(h_,{cluster:n,activeRoute:t},n.nodeId))})}function h_({cluster:e,activeRoute:t}){const n=i_(),i=l_(e,t);if(!(ya()in e.lNodeIds))return;const l=n.nodeId===e.nodeId;if(l&&e.kind==="home")return f.jsx(gc,{menu:i});const[c,...d]=i;if(c)return f.jsx(Lg,{header:c,expanded:l,children:f.jsx(gc,{menu:d})})}function m_(e){const t=Wt(),{t:n}=Pt(),i=ya(),l=Ny()?.permissions??[],c=l.includes("site.editProperties"),d=l.includes("site.manageUsers"),h=l.includes("site.backup"),m=l.includes("site.eventLog"),y=c||d||h||m,v=`/settings/site-fields/${i}`,b=e.kind==="settings"?e.menuItemKey:void 0;if(!y)return[];const D=[];return c&&D.push({key:`siteProperties:${i}`,label:n("app.siteProperties"),icon:f.jsx(hD,{size:16}),url:ii(v),command:()=>t(v),active:b==="siteFields"}),d&&D.push({key:"accounts",label:n("AccountScreen.userAccounts"),icon:f.jsx(lj,{size:16}),url:ii("/settings/accounts"),command:()=>t("/settings/accounts"),active:b==="accounts"}),h&&D.push({key:"backup",label:n("BackupScreen.backup"),icon:f.jsx(YM,{size:16}),url:ii("/settings/backup"),command:()=>t("/settings/backup"),active:b==="backup"}),m&&D.push({key:"eventLog",label:n("EventLogScreen.eventLog"),icon:f.jsx(IT,{size:16}),url:ii("/settings/event-log"),command:()=>t("/settings/event-log"),active:b==="eventLog"}),[{key:"bottom-menu",label:n("app.settings"),expanded:e.kind==="settings",subMenu:D}]}function p_({siteTitle:e,siteConstants:t,activeRoute:n}){const i=M1(),{cmsVersion:s}=St(),l=m_(n),c=ci(),d=C1(),h=we(),m=Ny(),y=Wt(),v=ya();return f.jsxs("div",{className:"PaSidebar dark",children:[f.jsxs("div",{className:"PaSidebar-header",children:[t.faviconThumb&&f.jsx("div",{className:"PaSidebar-logo",children:f.jsx("img",{src:t.faviconThumb.url,width:t.faviconThumb.width,height:t.faviconThumb.height,alt:""})}),f.jsx("span",{className:"PaSidebar-title",children:e}),f.jsx("button",{type:"button",className:"PaSidebar-viewSiteBtn",onClick:()=>{const b=t.homeUrls.find(D=>D.language===v);g1(b?.url??"/")},title:h("app.openSite"),children:f.jsx(jg,{size:16})})]}),f.jsxs("div",{className:"PaSidebar-nav",children:[f.jsx(gc,{menu:[{key:"dashboard",label:h("Dashboard"),url:ii(`/${v}`),command:()=>{y(`/${v}`)},icon:f.jsx(OT,{size:16}),active:n.kind==="home"}]}),f.jsx(f_,{clusterHierarchy:i,activeRoute:n})]}),f.jsxs("div",{className:"PaSidebar-footer",children:[f.jsx(gc,{menu:l}),f.jsxs("div",{className:"PaSidebar-userSection",children:[f.jsx(mf,{position:"top",items:[{key:"user-settings",label:h("app.userSettings"),icon:f.jsx(hD,{size:16}),command:()=>{y("/user-settings")}},{key:"logout",label:h("app.logout"),command:c(d),icon:f.jsx(qT,{size:16})}],children:f.jsxs("button",{type:"button",className:"UserMenu-trigger",children:[f.jsx(sj,{size:18,className:"UserMenu-icon"}),f.jsx("span",{className:"UserMenu-name",children:m.name??m.email}),m.loginMethod&&f.jsx(So,{className:"Ml2",children:h(`app.loginMethod.${m.loginMethod}`)})]})}),f.jsxs("div",{className:"PaSidebar-version",children:[h("app.PoweredBy")," ParoiCMS ",s]})]})]})]})}function Or({children:e,activeRoute:t}){const n=Ge(s=>s.siteTitle),i=Ge(s=>s.publicConstants);return i?f.jsx(D1,{burgerClassName:"MainBurgerBtn",noSidePaddingOnMobile:!0,side:f.jsx(p_,{siteTitle:n,siteConstants:i,activeRoute:t}),children:e}):f.jsx(ln,{})}const $1=Symbol("internal"),Ey=S.createContext({on:()=>{},emit:()=>{},off:()=>{},setModifiedValue:()=>{},cancelModifiedValue:()=>{},getModifiedValues:()=>{},hasModifiedValues:()=>!1,isPristine:()=>!0,registerSaveHandler:()=>{},unregisterSaveHandler:()=>{},saveAll:()=>Promise.resolve(!1),plugChildScope:()=>{},unplugChildScope:()=>{}});function g_(e){let{parentScope:t,uploadLimitManager:n}=e;n??=t?.uploadLimitManager;const i=S1(),s=new Map,l=new Set,c=new Set;let d=!0;const h={updatePristineStatus(){const y=d;d=!m(),y!==d&&i.emit("isPristineChange",d),t&&b_(t).updatePristineStatus()}};function m(){for(const y of c)if(y.hasModifiedValues())return!0;return s.size>0}return{[$1]:h,parentScope:t,uploadLimitManager:n,on:i.on,emit(y){for(const v of c)v.emit(y);i.emit(y)},off:i.off,setModifiedValue(y,v){s.set(y,v),h.updatePristineStatus()},cancelModifiedValue(y){s.delete(y),h.updatePristineStatus()},getModifiedValues(){if(s.size===0)return;const y={};for(const[v,b]of s)y[v]=typeof b=="function"?b():b;return y},hasModifiedValues(){return!d},isPristine(){return d},registerSaveHandler(y){l.add(y)},unregisterSaveHandler(y){l.delete(y)},async saveAll(){let y=!1;for(const v of c){const b=await v.saveAll();y||=b}for(const v of l){const b=await v();y||=b}return s.clear(),h.updatePristineStatus(),y},plugChildScope(y){c.add(y)},unplugChildScope(y){c.delete(y)}}}function Rr({children:e,scopeRef:t,parentScope:n,uploadLimitManager:i}){const s=S.useRef(void 0);return s.current===void 0&&(s.current=g_({parentScope:n,uploadLimitManager:i})),t&&(t.current===void 0||t.current===null)&&(t.current=s.current),S.useEffect(()=>{const l=s.current;if(!(!l||!n))return n.plugChildScope(l),()=>n.unplugChildScope(l)},[n]),f.jsx(Ey.Provider,{value:s.current,children:e})}function Ut(){return S.useContext(Ey)}function Ay(){const e=Ut(),[t,n]=S.useState(!e.hasModifiedValues());return S.useEffect(()=>{const i=s=>{n(s)};return e.on("isPristineChange",i),()=>{e.off("isPristineChange",i)}},[]),t}function aa(e){const t=S.useContext(Ey),n=S.useRef(void 0);return n.current&&n.current.fieldName!==e&&(t.cancelModifiedValue(n.current.fieldName),n.current=void 0),n.current||(n.current={fieldName:e,emit:t.emit,setModifiedValue(i){t.setModifiedValue(e,i)},cancelModifiedValue(){t.cancelModifiedValue(e)},registerSaveHandler:t.registerSaveHandler,unregisterSaveHandler:t.unregisterSaveHandler,uploadLimitManager:t.uploadLimitManager}),S.useEffect(()=>()=>{n.current&&(t.cancelModifiedValue(n.current.fieldName),n.current=void 0)},[]),n.current}function Bo(e){const{registerSaveHandler:t,unregisterSaveHandler:n}=Ut(),i=S.useRef(e);i.current=e,S.useEffect(()=>{const s=()=>i.current();return t(s),()=>{n(s)}},[])}function Gc(e,t,n,i={}){const{on:s,off:l}=Ut(),c=S.useRef(t);S.useEffect(()=>(c.current=t,s(e,t),()=>l(e,t)),n),ct(async()=>{i.useEffect&&await c.current()},n)}function y_(e,t,n,i={}){const{on:s,off:l}=Ut(),c=S.useRef(t);S.useEffect(()=>(c.current=t,s(e,t),()=>l(e,t)),n),S.useEffect(()=>{i.useEffect&&c.current()},n)}function Ka(e,t){const n=e?.trim()??"",i=t?.trim()??"";if(n!==i)return n===""?null:n}function v_(e,t){if(e!==t)return e===void 0?null:e}function b_(e){const t=e[$1];if(!t)throw new Error("invalid scoped data");return t}function O1({lNodeId:e,limit:t}){const[n,i]=S.useState(),[s,l]=S.useState(new Map),c=d=>{if(t===void 0||s.get(d.handle)===d.count)return;s.set(d.handle,d.count);const m=Array.from(s.values()).reduce((y,v)=>y+v,0);i(t-m)};return S.useEffect(()=>{if(t===void 0)i(void 0);else{const d=Array.from(s.values()).reduce((h,m)=>h+m,0);i(t-d)}},[t]),S.useEffect(()=>{i(void 0),l(new Map)},[e]),{remainingMediaPlaces:n,updateMediaCount:c}}function wg(){let e,t;return{promise:new Promise((i,s)=>{e=i,t=s}),resolve:e,reject:t}}const My=S.createContext(void 0);function R1({children:e,logger:t}){const n=S.useRef({idSeq:0,dialogStack:[],forceRepaint:()=>{throw new Error("forceRepaint not initialized")},logger:t});return f.jsxs(My.Provider,{value:n.current,children:[e,f.jsx(S_,{state:n.current})]})}function S_({state:e}){const[,t]=S.useReducer(n=>n+1,0);return e.forceRepaint=t,f.jsx(f.Fragment,{children:e.dialogStack.map(n=>f.jsx(w_,{state:e,item:n},n.id))})}function ia(){const e=S.useContext(My);if(!e)throw new Error("Missing dialog context parent");return(t,n)=>L1(e,t,n)}function L1(e,t,n){const{promise:i,resolve:s,reject:l}=wg();return e.dialogStack.push({id:++e.idSeq,resolve:s,reject:l,dialog:t,parameter:n}),e.forceRepaint(),i}function gs(){const e=S.useContext(My);if(!e)throw new Error("Missing dialog context parent");return S.useCallback((t,n)=>x_(e,t,n),[e])}function x_(e,t,n){L1(e,t,n).catch(e.logger.error)}function w_({state:e,item:t}){const[n,i]=S.useState(!0);let[s]=S.useState();const l=ci(),c={closeDialog:v=>(i(!1),D_(e,v,t)),onCancelDialog:v=>{s=v},parameter:t.parameter},d=l(async()=>{await s?.()!==!1&&c.closeDialog()}),{content:h,footer:m,header:y}=t.dialog(c);return f.jsx(Pg,{visible:n,onHide:d,header:y,footer:m,children:f.jsxs(Cn,{children:[f.jsx(En,{}),h]})},t.id)}function D_(e,t,n){const i=e.dialogStack.findIndex(({id:s})=>s===n.id);if(i===-1){e.logger.warn(`Missing dialog '${n.id}'`);return}for(let s=e.dialogStack.length-1;s>i;--s)e.dialogStack[s].resolve(void 0);e.dialogStack.splice(i),e.forceRepaint(),n.resolve(t)}function N_(e){AR(S.useCallback(t=>{if(e())return t.preventDefault(),!0},[e]))}function C_(e){const{closeDialog:t,parameter:{save:n}}=e,i=we(),{showError:s}=at(),l=async()=>{await n(),t("canNavigate")},c=i("common.confirmation"),d=f.jsx("div",{className:"SaveChangesOrCancel",children:f.jsxs("p",{className:"Mb4",children:[" ",i("SaveChangesOrCancelDialog.confirmationMessage")," "]})}),h=f.jsxs(f.Fragment,{children:[f.jsx(de,{severity:"secondary",onClick:()=>t(),children:i("SaveChangesOrCancelDialog.stayAndEditing")}),f.jsx(de,{severity:"warning",onClick:()=>t("canNavigate"),children:i("SaveChangesOrCancelDialog.cancelWithoutSave")}),f.jsx(de,{as:"async",onClick:l,autoFocus:!0,insideFeedback:{label:i("common.saved")},onError:s,children:i("common.save")})]});return{header:c,content:d,footer:h}}function Yc(){const{saveAll:e,hasModifiedValues:t}=Ut(),n=ia();N_(t),H3(async()=>t()?await n(C_,{save:async()=>{await e()}})==="canNavigate":!0)}const P1=6048e5,E_=864e5,I1=6e4,z1=36e5,Pw=Symbol.for("constructDateFrom");function zi(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&Pw in e?e[Pw](t):e instanceof Date?new e.constructor(t):new Date(t)}function ga(e,t){return zi(t||e,e)}let A_={};function Pf(){return A_}function Dc(e,t){const n=Pf(),i=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,s=ga(e,t?.in),l=s.getDay(),c=(l<i?7:0)+l-i;return s.setDate(s.getDate()-c),s.setHours(0,0,0,0),s}function cf(e,t){return Dc(e,{...t,weekStartsOn:1})}function _1(e,t){const n=ga(e,t?.in),i=n.getFullYear(),s=zi(n,0);s.setFullYear(i+1,0,4),s.setHours(0,0,0,0);const l=cf(s),c=zi(n,0);c.setFullYear(i,0,4),c.setHours(0,0,0,0);const d=cf(c);return n.getTime()>=l.getTime()?i+1:n.getTime()>=d.getTime()?i:i-1}function Iw(e){const t=ga(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function M_(e,...t){const n=zi.bind(null,t.find(i=>typeof i=="object"));return t.map(n)}function zw(e,t){const n=ga(e,t?.in);return n.setHours(0,0,0,0),n}function T_(e,t,n){const[i,s]=M_(n?.in,e,t),l=zw(i),c=zw(s),d=+l-Iw(l),h=+c-Iw(c);return Math.round((d-h)/E_)}function j_(e,t){const n=_1(e,t),i=zi(e,0);return i.setFullYear(n,0,4),i.setHours(0,0,0,0),cf(i)}function k_(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function $_(e){return!(!k_(e)&&typeof e!="number"||isNaN(+ga(e)))}function O_(e,t){const n=ga(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}const R_={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},L_=(e,t,n)=>{let i;const s=R_[e];return typeof s=="string"?i=s:t===1?i=s.one:i=s.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+i:i+" ago":i};function $p(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const P_={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},I_={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},z_={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},__={date:$p({formats:P_,defaultWidth:"full"}),time:$p({formats:I_,defaultWidth:"full"}),dateTime:$p({formats:z_,defaultWidth:"full"})},U_={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},B_=(e,t,n,i)=>U_[e];function Kl(e){return(t,n)=>{const i=n?.context?String(n.context):"standalone";let s;if(i==="formatting"&&e.formattingValues){const c=e.defaultFormattingWidth||e.defaultWidth,d=n?.width?String(n.width):c;s=e.formattingValues[d]||e.formattingValues[c]}else{const c=e.defaultWidth,d=n?.width?String(n.width):e.defaultWidth;s=e.values[d]||e.values[c]}const l=e.argumentCallback?e.argumentCallback(t):t;return s[l]}}const F_={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},H_={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},q_={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},V_={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},K_={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},G_={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Y_=(e,t)=>{const n=Number(e),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},J_={ordinalNumber:Y_,era:Kl({values:F_,defaultWidth:"wide"}),quarter:Kl({values:H_,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Kl({values:q_,defaultWidth:"wide"}),day:Kl({values:V_,defaultWidth:"wide"}),dayPeriod:Kl({values:K_,defaultWidth:"wide",formattingValues:G_,defaultFormattingWidth:"wide"})};function Gl(e){return(t,n={})=>{const i=n.width,s=i&&e.matchPatterns[i]||e.matchPatterns[e.defaultMatchWidth],l=t.match(s);if(!l)return null;const c=l[0],d=i&&e.parsePatterns[i]||e.parsePatterns[e.defaultParseWidth],h=Array.isArray(d)?W_(d,v=>v.test(c)):X_(d,v=>v.test(c));let m;m=e.valueCallback?e.valueCallback(h):h,m=n.valueCallback?n.valueCallback(m):m;const y=t.slice(c.length);return{value:m,rest:y}}}function X_(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function W_(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function Q_(e){return(t,n={})=>{const i=t.match(e.matchPattern);if(!i)return null;const s=i[0],l=t.match(e.parsePattern);if(!l)return null;let c=e.valueCallback?e.valueCallback(l[0]):l[0];c=n.valueCallback?n.valueCallback(c):c;const d=t.slice(s.length);return{value:c,rest:d}}}const Z_=/^(\d+)(th|st|nd|rd)?/i,eU=/\d+/i,tU={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},nU={any:[/^b/i,/^(a|c)/i]},aU={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},iU={any:[/1/i,/2/i,/3/i,/4/i]},rU={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},sU={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},oU={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},lU={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},cU={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},uU={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},dU={ordinalNumber:Q_({matchPattern:Z_,parsePattern:eU,valueCallback:e=>parseInt(e,10)}),era:Gl({matchPatterns:tU,defaultMatchWidth:"wide",parsePatterns:nU,defaultParseWidth:"any"}),quarter:Gl({matchPatterns:aU,defaultMatchWidth:"wide",parsePatterns:iU,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Gl({matchPatterns:rU,defaultMatchWidth:"wide",parsePatterns:sU,defaultParseWidth:"any"}),day:Gl({matchPatterns:oU,defaultMatchWidth:"wide",parsePatterns:lU,defaultParseWidth:"any"}),dayPeriod:Gl({matchPatterns:cU,defaultMatchWidth:"any",parsePatterns:uU,defaultParseWidth:"any"})},fU={code:"en-US",formatDistance:L_,formatLong:__,formatRelative:B_,localize:J_,match:dU,options:{weekStartsOn:0,firstWeekContainsDate:1}};function hU(e,t){const n=ga(e,t?.in);return T_(n,O_(n))+1}function mU(e,t){const n=ga(e,t?.in),i=+cf(n)-+j_(n);return Math.round(i/P1)+1}function U1(e,t){const n=ga(e,t?.in),i=n.getFullYear(),s=Pf(),l=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??s.firstWeekContainsDate??s.locale?.options?.firstWeekContainsDate??1,c=zi(t?.in||e,0);c.setFullYear(i+1,0,l),c.setHours(0,0,0,0);const d=Dc(c,t),h=zi(t?.in||e,0);h.setFullYear(i,0,l),h.setHours(0,0,0,0);const m=Dc(h,t);return+n>=+d?i+1:+n>=+m?i:i-1}function pU(e,t){const n=Pf(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,s=U1(e,t),l=zi(t?.in||e,0);return l.setFullYear(s,0,i),l.setHours(0,0,0,0),Dc(l,t)}function gU(e,t){const n=ga(e,t?.in),i=+Dc(n,t)-+pU(n,t);return Math.round(i/P1)+1}function pt(e,t){const n=e<0?"-":"",i=Math.abs(e).toString().padStart(t,"0");return n+i}const mr={y(e,t){const n=e.getFullYear(),i=n>0?n:1-n;return pt(t==="yy"?i%100:i,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):pt(n+1,2)},d(e,t){return pt(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return pt(e.getHours()%12||12,t.length)},H(e,t){return pt(e.getHours(),t.length)},m(e,t){return pt(e.getMinutes(),t.length)},s(e,t){return pt(e.getSeconds(),t.length)},S(e,t){const n=t.length,i=e.getMilliseconds(),s=Math.trunc(i*Math.pow(10,n-3));return pt(s,t.length)}},uo={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},_w={G:function(e,t,n){const i=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(i,{width:"abbreviated"});case"GGGGG":return n.era(i,{width:"narrow"});case"GGGG":default:return n.era(i,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const i=e.getFullYear(),s=i>0?i:1-i;return n.ordinalNumber(s,{unit:"year"})}return mr.y(e,t)},Y:function(e,t,n,i){const s=U1(e,i),l=s>0?s:1-s;if(t==="YY"){const c=l%100;return pt(c,2)}return t==="Yo"?n.ordinalNumber(l,{unit:"year"}):pt(l,t.length)},R:function(e,t){const n=_1(e);return pt(n,t.length)},u:function(e,t){const n=e.getFullYear();return pt(n,t.length)},Q:function(e,t,n){const i=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return pt(i,2);case"Qo":return n.ordinalNumber(i,{unit:"quarter"});case"QQQ":return n.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(i,{width:"wide",context:"formatting"})}},q:function(e,t,n){const i=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return pt(i,2);case"qo":return n.ordinalNumber(i,{unit:"quarter"});case"qqq":return n.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(i,{width:"wide",context:"standalone"})}},M:function(e,t,n){const i=e.getMonth();switch(t){case"M":case"MM":return mr.M(e,t);case"Mo":return n.ordinalNumber(i+1,{unit:"month"});case"MMM":return n.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(i,{width:"wide",context:"formatting"})}},L:function(e,t,n){const i=e.getMonth();switch(t){case"L":return String(i+1);case"LL":return pt(i+1,2);case"Lo":return n.ordinalNumber(i+1,{unit:"month"});case"LLL":return n.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(i,{width:"wide",context:"standalone"})}},w:function(e,t,n,i){const s=gU(e,i);return t==="wo"?n.ordinalNumber(s,{unit:"week"}):pt(s,t.length)},I:function(e,t,n){const i=mU(e);return t==="Io"?n.ordinalNumber(i,{unit:"week"}):pt(i,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):mr.d(e,t)},D:function(e,t,n){const i=hU(e);return t==="Do"?n.ordinalNumber(i,{unit:"dayOfYear"}):pt(i,t.length)},E:function(e,t,n){const i=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(i,{width:"short",context:"formatting"});case"EEEE":default:return n.day(i,{width:"wide",context:"formatting"})}},e:function(e,t,n,i){const s=e.getDay(),l=(s-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(l);case"ee":return pt(l,2);case"eo":return n.ordinalNumber(l,{unit:"day"});case"eee":return n.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(s,{width:"short",context:"formatting"});case"eeee":default:return n.day(s,{width:"wide",context:"formatting"})}},c:function(e,t,n,i){const s=e.getDay(),l=(s-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(l);case"cc":return pt(l,t.length);case"co":return n.ordinalNumber(l,{unit:"day"});case"ccc":return n.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(s,{width:"narrow",context:"standalone"});case"cccccc":return n.day(s,{width:"short",context:"standalone"});case"cccc":default:return n.day(s,{width:"wide",context:"standalone"})}},i:function(e,t,n){const i=e.getDay(),s=i===0?7:i;switch(t){case"i":return String(s);case"ii":return pt(s,t.length);case"io":return n.ordinalNumber(s,{unit:"day"});case"iii":return n.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(i,{width:"short",context:"formatting"});case"iiii":default:return n.day(i,{width:"wide",context:"formatting"})}},a:function(e,t,n){const s=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(e,t,n){const i=e.getHours();let s;switch(i===12?s=uo.noon:i===0?s=uo.midnight:s=i/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(e,t,n){const i=e.getHours();let s;switch(i>=17?s=uo.evening:i>=12?s=uo.afternoon:i>=4?s=uo.morning:s=uo.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let i=e.getHours()%12;return i===0&&(i=12),n.ordinalNumber(i,{unit:"hour"})}return mr.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):mr.H(e,t)},K:function(e,t,n){const i=e.getHours()%12;return t==="Ko"?n.ordinalNumber(i,{unit:"hour"}):pt(i,t.length)},k:function(e,t,n){let i=e.getHours();return i===0&&(i=24),t==="ko"?n.ordinalNumber(i,{unit:"hour"}):pt(i,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):mr.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):mr.s(e,t)},S:function(e,t){return mr.S(e,t)},X:function(e,t,n){const i=e.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return Bw(i);case"XXXX":case"XX":return ss(i);case"XXXXX":case"XXX":default:return ss(i,":")}},x:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"x":return Bw(i);case"xxxx":case"xx":return ss(i);case"xxxxx":case"xxx":default:return ss(i,":")}},O:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Uw(i,":");case"OOOO":default:return"GMT"+ss(i,":")}},z:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Uw(i,":");case"zzzz":default:return"GMT"+ss(i,":")}},t:function(e,t,n){const i=Math.trunc(+e/1e3);return pt(i,t.length)},T:function(e,t,n){return pt(+e,t.length)}};function Uw(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),s=Math.trunc(i/60),l=i%60;return l===0?n+String(s):n+String(s)+t+pt(l,2)}function Bw(e,t){return e%60===0?(e>0?"-":"+")+pt(Math.abs(e)/60,2):ss(e,t)}function ss(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),s=pt(Math.trunc(i/60),2),l=pt(i%60,2);return n+s+t+l}const Fw=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},B1=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},yU=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],i=n[1],s=n[2];if(!s)return Fw(e,t);let l;switch(i){case"P":l=t.dateTime({width:"short"});break;case"PP":l=t.dateTime({width:"medium"});break;case"PPP":l=t.dateTime({width:"long"});break;case"PPPP":default:l=t.dateTime({width:"full"});break}return l.replace("{{date}}",Fw(i,t)).replace("{{time}}",B1(s,t))},vU={p:B1,P:yU},bU=/^D+$/,SU=/^Y+$/,xU=["D","DD","YY","YYYY"];function wU(e){return bU.test(e)}function DU(e){return SU.test(e)}function NU(e,t,n){const i=CU(e,t,n);if(console.warn(i),xU.includes(e))throw new RangeError(i)}function CU(e,t,n){const i=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${i} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const EU=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,AU=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,MU=/^'([^]*?)'?$/,TU=/''/g,jU=/[a-zA-Z]/;function Cr(e,t,n){const i=Pf(),s=i.locale??fU,l=i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,c=i.weekStartsOn??i.locale?.options?.weekStartsOn??0,d=ga(e,n?.in);if(!$_(d))throw new RangeError("Invalid time value");let h=t.match(AU).map(y=>{const v=y[0];if(v==="p"||v==="P"){const b=vU[v];return b(y,s.formatLong)}return y}).join("").match(EU).map(y=>{if(y==="''")return{isToken:!1,value:"'"};const v=y[0];if(v==="'")return{isToken:!1,value:kU(y)};if(_w[v])return{isToken:!0,value:y};if(v.match(jU))throw new RangeError("Format string contains an unescaped latin alphabet character `"+v+"`");return{isToken:!1,value:y}});s.localize.preprocessor&&(h=s.localize.preprocessor(d,h));const m={firstWeekContainsDate:l,weekStartsOn:c,locale:s};return h.map(y=>{if(!y.isToken)return y.value;const v=y.value;(DU(v)||wU(v))&&NU(v,t,String(e));const b=_w[v[0]];return b(d,v,s.localize,m)}).join("")}function kU(e){const t=e.match(MU);return t?t[1].replace(TU,"'"):e}function F1(e,t){const n=()=>zi(t?.in,NaN),s=LU(e);let l;if(s.date){const m=PU(s.date,2);l=IU(m.restDateString,m.year)}if(!l||isNaN(+l))return n();const c=+l;let d=0,h;if(s.time&&(d=zU(s.time),isNaN(d)))return n();if(s.timezone){if(h=_U(s.timezone),isNaN(h))return n()}else{const m=new Date(c+d),y=ga(0,t?.in);return y.setFullYear(m.getUTCFullYear(),m.getUTCMonth(),m.getUTCDate()),y.setHours(m.getUTCHours(),m.getUTCMinutes(),m.getUTCSeconds(),m.getUTCMilliseconds()),y}return ga(c+d+h,t?.in)}const Cd={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},$U=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,OU=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,RU=/^([+-])(\d{2})(?::?(\d{2}))?$/;function LU(e){const t={},n=e.split(Cd.dateTimeDelimiter);let i;if(n.length>2)return t;if(/:/.test(n[0])?i=n[0]:(t.date=n[0],i=n[1],Cd.timeZoneDelimiter.test(t.date)&&(t.date=e.split(Cd.timeZoneDelimiter)[0],i=e.substr(t.date.length,e.length))),i){const s=Cd.timezone.exec(i);s?(t.time=i.replace(s[1],""),t.timezone=s[1]):t.time=i}return t}function PU(e,t){const n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),i=e.match(n);if(!i)return{year:NaN,restDateString:""};const s=i[1]?parseInt(i[1]):null,l=i[2]?parseInt(i[2]):null;return{year:l===null?s:l*100,restDateString:e.slice((i[1]||i[2]).length)}}function IU(e,t){if(t===null)return new Date(NaN);const n=e.match($U);if(!n)return new Date(NaN);const i=!!n[4],s=Yl(n[1]),l=Yl(n[2])-1,c=Yl(n[3]),d=Yl(n[4]),h=Yl(n[5])-1;if(i)return qU(t,d,h)?UU(t,d,h):new Date(NaN);{const m=new Date(0);return!FU(t,l,c)||!HU(t,s)?new Date(NaN):(m.setUTCFullYear(t,l,Math.max(s,c)),m)}}function Yl(e){return e?parseInt(e):1}function zU(e){const t=e.match(OU);if(!t)return NaN;const n=Op(t[1]),i=Op(t[2]),s=Op(t[3]);return VU(n,i,s)?n*z1+i*I1+s*1e3:NaN}function Op(e){return e&&parseFloat(e.replace(",","."))||0}function _U(e){if(e==="Z")return 0;const t=e.match(RU);if(!t)return 0;const n=t[1]==="+"?-1:1,i=parseInt(t[2]),s=t[3]&&parseInt(t[3])||0;return KU(i,s)?n*(i*z1+s*I1):NaN}function UU(e,t,n){const i=new Date(0);i.setUTCFullYear(e,0,4);const s=i.getUTCDay()||7,l=(t-1)*7+n+1-s;return i.setUTCDate(i.getUTCDate()+l),i}const BU=[31,null,31,30,31,30,31,31,30,31,30,31];function H1(e){return e%400===0||e%4===0&&e%100!==0}function FU(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(BU[t]||(H1(e)?29:28))}function HU(e,t){return t>=1&&t<=(H1(e)?366:365)}function qU(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}function VU(e,t,n){return e===24?t===0&&n===0:n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}function KU(e,t){return t>=0&&t<=59}function Oo(e,t){const n=typeof e=="string"?F1(e):e;return t==="fr"||t==="it"?Cr(n,"dd/MM/yyyy"):t==="de"?Cr(n,"dd.MM.yyyy"):t==="es"||t==="pt"?Cr(n,"dd/MM/yyyy"):Cr(n,"M/d/yy")}function q1(e,t){const n=typeof e=="string"?F1(e):e;return t==="fr"||t==="it"?Cr(n,"dd/MM/yyyy HH:mm"):t==="de"?Cr(n,"dd.MM.yyyy HH:mm"):t==="es"||t==="pt"?Cr(n,"dd/MM/yyyy HH:mm"):Cr(n,"M/d/yy, h:mm a")}function V1({ready:e,publishDate:t,scheduled:n}){const i=we(),s=na();return f.jsxs("div",{className:"PublishStatusFlag",children:[e!==void 0&&f.jsx("div",{className:"PublishStatusFlag-tag",children:e?n?f.jsx(So,{severity:"primary",children:i("common.scheduled")}):f.jsx(So,{severity:"success",children:i("common.published")}):f.jsx(So,{severity:"default",children:i("common.draft")})}),f.jsx("span",{className:"PublishStatusFlag-dt",children:t&&Oo(t,s)})]})}function GU({header:e,children:t,defaultCollapsed:n=!1,className:i}){const[s,l]=S.useState(n),c=S.useRef(null);return ct(async()=>{const d=c.current;d&&(d.classList.contains("initializing")?(d.classList.remove("initializing"),d.classList.add(s?"hide":"show"),s&&(d.style.maxHeight="0")):await YU(d,!s))},[s]),f.jsxs("div",{className:he("DocControlBar",s&&"collapsed",i),children:[f.jsxs("div",{className:"DocControlBar-header BarAccent _coloredBg",children:[f.jsx("button",{type:"button",className:"DocControlBar-toggleBtn",onClick:()=>l(!s),"aria-expanded":!s,"aria-label":s?"Expand":"Collapse",children:s?f.jsx(Ro,{size:16}):f.jsx(fT,{size:16})}),f.jsx("div",{className:"DocControlBar-headerContent",children:e})]}),f.jsx("div",{className:he("DocControlBar-content WallAccentAsPlainBg initializing"),ref:c,children:t})]})}function YU(e,t){if(t){if(e.classList.contains("show"))return Promise.resolve()}else if(e.classList.contains("hide"))return Promise.resolve();return new Promise(n=>{let i=!1;const s=setTimeout(c,300);e.classList.remove("show","hide"),e.classList.add("transition"),e.style.maxHeight=t?"0":`${e.scrollHeight}px`;const l=()=>{clearTimeout(s),c()};e.addEventListener("transitionend",l),requestAnimationFrame(()=>{e.scrollHeight,e.style.maxHeight=t?`${e.scrollHeight}px`:"0"});function c(){i||(i=!0,e.classList.remove("transition"),e.classList.add(t?"show":"hide"),t&&(e.style.maxHeight=""),e.removeEventListener("transitionend",l),n())}})}function K1(){const e=Wt(),t=S.useCallback(i=>{const s=i.length-2,l=i[s];return l?s===0?`/${l.language}`:Bn({language:l.language,documentNodeId:l.nodeId,documentType:l.documentType},l.documentType.adminUi?.defaultTab):"/"},[]),n=S.useCallback(i=>{e(t(i))},[]);return{backUrlOf:t,navigateToBack:n}}const JU=ge`
|
|
95
|
-
mutation SetLNodeReady(
|
|
96
|
-
$lNodeId: ID!
|
|
97
|
-
$ready: Boolean!
|
|
98
|
-
) {
|
|
99
|
-
setLNodeReady(
|
|
100
|
-
lNodeId: $lNodeId
|
|
101
|
-
ready: $ready
|
|
102
|
-
)
|
|
103
|
-
}
|
|
104
|
-
`;function Ty(){return S.useCallback(async e=>{await Se(JU,e)},[])}const XU=ge`
|
|
105
|
-
mutation SetNodePublishDate(
|
|
106
|
-
$nodeId: ID!
|
|
107
|
-
$publishDate: DateTime
|
|
108
|
-
) {
|
|
109
|
-
setNodePublishDate(
|
|
110
|
-
nodeId: $nodeId
|
|
111
|
-
publishDate: $publishDate
|
|
112
|
-
) {
|
|
113
|
-
id
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
`;function G1(){return S.useCallback(async e=>(await Se(XU,e)).setNodePublishDate,[])}function Y1({closeDialog:e,parameter:t}){const n=we(),i=Ty(),s=G1(),[l,c]=S.useState(t.publishDate?new Date(t.publishDate):new Date),{showError:d}=at(),h=async()=>{const b=t.lNodeId,{nodeId:D}=_t(b),w=t.publishDate?new Date(t.publishDate).toISOString():void 0,N=t.ready;let M,A;if(l){l.setSeconds(0,0);const j=l.toISOString();M=j===w?void 0:j,A=N?void 0:!0}else M=w?null:void 0,A=N?!1:void 0;A!==void 0&&await i({lNodeId:b,ready:A}),M!==void 0&&await s({nodeId:D,publishDate:M}),e({done:M!==void 0||A!==void 0})};if(!l)return{header:t.dialogTitle,content:f.jsx(ln,{})};const m=b=>{const D=b.getFullYear(),w=(b.getMonth()+1).toString().padStart(2,"0"),N=b.getDate().toString().padStart(2,"0"),M=b.getHours().toString().padStart(2,"0"),A=b.getMinutes().toString().padStart(2,"0");return`${D}-${w}-${N}T${M}:${A}`},y=f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"FieldLabel",children:n("common.publishDate")}),f.jsx("input",{type:"datetime-local",className:"PaDateInput-field WFull",value:m(l),onChange:b=>{const D=b.target.value?new Date(b.target.value):void 0;c(D)}})]}),v=f.jsxs("div",{className:"ButtonBar alignRight",children:[f.jsx(de,{severity:"secondary",onClick:()=>e(),children:n("common.cancel")}),f.jsx(de,{as:"async",onClick:h,insideFeedback:{label:n("common.done")},onError:d,children:l.getTime()>Date.now()?n("common.schedule"):n("common.publish")})]});return{header:t.dialogTitle,content:y,footer:v}}const WU=ge`
|
|
117
|
-
query HistoryEntries($lNodeId: ID!) {
|
|
118
|
-
historyEntries(lNodeId: $lNodeId) {
|
|
119
|
-
id
|
|
120
|
-
updatedAt
|
|
121
|
-
timeTier
|
|
122
|
-
changeSummary {
|
|
123
|
-
affectedFields
|
|
124
|
-
affectedDocumentMetadata
|
|
125
|
-
beforeRestore
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
`;function QU(){return S.useCallback(async e=>(await Se(WU,{lNodeId:e})).historyEntries.map(n=>({id:n.id,updatedAt:new Date(n.updatedAt),timeTier:n.timeTier,changeSummary:ZU(n.changeSummary)})),[])}function ZU(e){if(e)return{affectedFields:e.affectedFields??void 0,affectedDocumentMetadata:e.affectedDocumentMetadata??void 0,beforeRestore:e.beforeRestore??void 0}}const eB=ge`
|
|
130
|
-
mutation RestoreHistoryEntry($entryId: ID!) {
|
|
131
|
-
restoreHistoryEntry(entryId: $entryId)
|
|
132
|
-
}
|
|
133
|
-
`;function tB(){return S.useCallback(async e=>(await Se(eB,{entryId:e})).restoreHistoryEntry,[])}function nB({closeDialog:e,parameter:{lNodeId:t,typeName:n}}){const i=we(),s=na(),l=QU(),c=tB(),[d,h]=S.useState(!0),[m,y]=S.useState([]),{showError:v}=at();ct(async()=>{h(!0);const j=await l(t);y(j),h(!1)},[t]);const b=j=>{switch(j){case"short":return i("VersionHistoryDialog.tierShort");case"medium":return i("VersionHistoryDialog.tierMedium");case"long":return i("VersionHistoryDialog.tierLong");default:return j}},D=j=>{const F=`siteSchema.nodeTypes.${n}.fields.${j}.label`,z=i(F,j);return z===F?j:z},w=j=>{switch(j){case"title":return i("DocumentView.title");case"slug":return i("DocumentView.slug");case"metaDescription":return i("DocumentView.metaDescription");case"metaKeywords":return i("DocumentView.metaKeywords");default:return j}},N=j=>{const F=[],z=j.changeSummary;if(z?.beforeRestore&&F.push(i("VersionHistoryDialog.beforeRestore")),z?.affectedDocumentMetadata&&z.affectedDocumentMetadata.length>0){const P=z.affectedDocumentMetadata.map(w);F.push(...P)}if(z?.affectedFields&&z.affectedFields.length>0){const P=z.affectedFields.map(D);F.push(...P)}return F.join(", ")||"—"},M=async j=>{await c(j),e({done:!0})},A=m.map(j=>({id:j.id,date:q1(j.updatedAt,s),tier:b(j.timeTier),changes:N(j),entry:j})),T=j=>f.jsx(de,{as:"async",severity:"secondary",onClick:()=>M(j.id),insideFeedback:{label:i("VersionHistoryDialog.restored")},onError:v,children:i("VersionHistoryDialog.restore")});return d?f.jsx("div",{className:"VersionHistoryDialog",children:f.jsx("div",{className:"VersionHistoryDialog-loading",children:f.jsx(ln,{})})}):m.length===0?f.jsx("div",{className:"VersionHistoryDialog",children:f.jsx("p",{className:"VersionHistoryDialog-empty",children:i("VersionHistoryDialog.noHistory")})}):f.jsx("div",{className:"VersionHistoryDialog",children:f.jsxs(Po,{value:A,dataKey:"id",size:"small",children:[f.jsx(it,{field:"date",header:i("VersionHistoryDialog.dateColumn")}),f.jsx(it,{field:"tier",header:i("VersionHistoryDialog.tierColumn")}),f.jsx(it,{field:"changes",header:i("VersionHistoryDialog.changesColumn")}),f.jsx(it,{body:T,style:{width:"8rem"}})]})})}function J1(e){const t=we();return{header:t("VersionHistoryDialog.title"),content:f.jsx(nB,{...e}),footer:f.jsx("div",{className:"ButtonBar alignRight",children:f.jsx(de,{severity:"secondary",onClick:()=>e.closeDialog(),children:t("common.close")})})}}const aB=ge`
|
|
134
|
-
mutation DeleteNodeAndDocuments(
|
|
135
|
-
$lNodeId: String!
|
|
136
|
-
) {
|
|
137
|
-
deleteNodeAndDocuments(
|
|
138
|
-
lNodeId: $lNodeId
|
|
139
|
-
)
|
|
140
|
-
}
|
|
141
|
-
`;function iB(){return S.useCallback(async e=>{await Se(aB,{lNodeId:e})},[])}const rB=ge`
|
|
142
|
-
mutation DeleteDocument(
|
|
143
|
-
$lNodeId: String!
|
|
144
|
-
) {
|
|
145
|
-
deleteDocument(
|
|
146
|
-
lNodeId: $lNodeId
|
|
147
|
-
)
|
|
148
|
-
}
|
|
149
|
-
`;function sB(){return S.useCallback(async e=>{await Se(rB,{lNodeId:e})},[])}const oB=ge`
|
|
150
|
-
mutation CreatePartOnNode(
|
|
151
|
-
$nodeId: ID!
|
|
152
|
-
$language: String!
|
|
153
|
-
) {
|
|
154
|
-
createPartOnNode(
|
|
155
|
-
language: $language,
|
|
156
|
-
nodeId: $nodeId
|
|
157
|
-
) {
|
|
158
|
-
partId
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
`;function lB(){return S.useCallback(async e=>(await Se(oB,e)).createPartOnNode.partId,[])}const cB=ge`
|
|
162
|
-
mutation DeletePart(
|
|
163
|
-
$lNodeId: ID!
|
|
164
|
-
) {
|
|
165
|
-
deletePart(
|
|
166
|
-
lNodeId: $lNodeId
|
|
167
|
-
)
|
|
168
|
-
}
|
|
169
|
-
`;function uB(){return S.useCallback(async e=>{await Se(cB,{lNodeId:e})},[])}const dB=ge`
|
|
170
|
-
mutation UpdateDocumentTitle(
|
|
171
|
-
$lNodeId: ID!
|
|
172
|
-
$values: UpdateDocumentTitleValues!
|
|
173
|
-
) {
|
|
174
|
-
updateDocumentTitle(
|
|
175
|
-
id: $lNodeId
|
|
176
|
-
values: $values
|
|
177
|
-
) {
|
|
178
|
-
lNodeId
|
|
179
|
-
title
|
|
180
|
-
slug
|
|
181
|
-
metaDescription
|
|
182
|
-
metaKeywords
|
|
183
|
-
featuredImageHandle
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
`;function fB(){return S.useCallback(async e=>(await Se(dB,e)).updateDocumentTitle,[])}const hB=ge`
|
|
187
|
-
mutation UpdateDocumentMeta(
|
|
188
|
-
$lNodeId: ID!
|
|
189
|
-
$values: UpdateDocumentMetaValues!
|
|
190
|
-
) {
|
|
191
|
-
updateDocumentMeta(
|
|
192
|
-
id: $lNodeId
|
|
193
|
-
values: $values
|
|
194
|
-
) {
|
|
195
|
-
lNodeId
|
|
196
|
-
title
|
|
197
|
-
slug
|
|
198
|
-
metaDescription
|
|
199
|
-
metaKeywords
|
|
200
|
-
featuredImageHandle
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
`;function mB(){return S.useCallback(async e=>(await Se(hB,e)).updateDocumentMeta,[])}function pB({closeDialog:e,parameter:{documentControlData:t}}){const n=we(),i=iB(),s=sB(),l=t.translations.length>1,{showError:c}=at(),d=async()=>{await i(t.documentId),e({done:!0})},h=async()=>{await s(t.documentId),e({done:!0})},m=n("common.deletion"),y=f.jsx("div",{children:n("DeleteDocument.documentDeletingConfirmationMessage",{title:t.title})}),v=f.jsxs("div",{className:"ButtonBar alignRight",children:[f.jsx(de,{severity:"secondary",onClick:()=>{e()},children:n("common.cancel")}),f.jsxs("div",{className:"ButtonBar",children:[l&&f.jsx(de,{as:"async",className:"Mr2",onClick:d,severity:"danger",insideFeedback:{label:n("common.done")},onError:c,children:n("DeleteDocument.deleteAllTranslations")}),f.jsx(de,{as:"async",onClick:h,severity:"danger",insideFeedback:{label:n("common.done")},onError:c,children:n(l?"DeleteDocument.deleteJustThisArticle":"DeleteDocument.deleteThisArticle",{language:t.language})})]})]});return{header:m,content:y,footer:v}}function gB({closeDialog:e,parameter:{lNodeId:t}}){const n=we(),i=Ty(),{showError:s}=at(),l=async()=>{await i({lNodeId:t,ready:!1}),e({done:!0})},c=n("common.switchToDraft"),d=f.jsx("p",{children:n("SwitchToDraft.switchToDraftConfirmationMessage")}),h=f.jsxs("div",{className:"ButtonBar alignRight",children:[f.jsx(de,{severity:"secondary",onClick:()=>e(),children:n("common.cancel")}),f.jsx(de,{as:"async",onClick:l,insideFeedback:{label:n("common.done")},onError:s,children:n("common.switchToDraft")})]});return{header:c,content:d,footer:h}}function yB(e){return f.jsx(Cn,{children:f.jsx(vB,{...e})})}function vB({documentControlData:e,documentType:t,saveDocument:n,disabled:i,parentScopedData:s}){const l=we(),{showError:c}=at(),{navigateToBack:d}=K1(),{emit:h}=Ut(),m=Ge(A=>A.appLayout),y=t.documentKind==="regular"&&!b1(t),v=ia(),b=async()=>{(await v(gB,{lNodeId:e.documentId}))?.done&&h("shouldRefresh")},D=async()=>{(await v(pB,{documentControlData:e}))?.done&&d(e.breadcrumb)},w=async()=>{(await v(Y1,{dialogTitle:l("DocumentControl.setPublishDate"),lNodeId:e.documentId,ready:e.ready,publishDate:e.node.publishDate}))?.done&&(await n(),h("shouldRefresh"))},N=async()=>{(await v(J1,{lNodeId:e.documentId,typeName:t.typeName}))?.done&&s.emit("shouldRefresh")},M=()=>{const A=[];return e.ready?A.push({icon:f.jsx(aj,{size:16}),label:l("common.switchToDraft"),command:b}):A.push({icon:f.jsx(sD,{size:16}),label:l("DocumentControl.setPublishDate"),command:w}),A.push({icon:f.jsx(kT,{size:16}),label:l("VersionHistoryDialog.title"),command:N}),y&&A.push({icon:f.jsx(pc,{size:16}),label:l("common.delete"),command:D,danger:!0}),A};return f.jsxs(f.Fragment,{children:[f.jsx(En,{}),f.jsx(Og,{as:"async",icon:f.jsx(dD,{size:16}),onClick:n,insideFeedback:{label:l("common.saved"),autoDismiss:!0},onError:c,items:M(),disabled:i,children:m==="mobile"?"":e.ready?l("common.save"):l("DocumentControl.updateDraft")})]})}const bB=ge`
|
|
204
|
-
query DocumentControlData(
|
|
205
|
-
$documentId: ID!
|
|
206
|
-
) {
|
|
207
|
-
lNodeWrap(lNodeId: $documentId) {
|
|
208
|
-
lNodeId
|
|
209
|
-
language
|
|
210
|
-
ready
|
|
211
|
-
document {
|
|
212
|
-
url
|
|
213
|
-
title
|
|
214
|
-
slug
|
|
215
|
-
metaDescription
|
|
216
|
-
metaKeywords
|
|
217
|
-
featuredImageHandle
|
|
218
|
-
featuredImage { thumb }
|
|
219
|
-
}
|
|
220
|
-
node {
|
|
221
|
-
typeName
|
|
222
|
-
publishDate
|
|
223
|
-
scheduled
|
|
224
|
-
}
|
|
225
|
-
translations {
|
|
226
|
-
language
|
|
227
|
-
}
|
|
228
|
-
breadcrumb { language nodeId typeName title }
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
`;function jy(){const{siteSchema:e}=St();return S.useCallback(async t=>{const n=await Se(bB,t);return SB(e,n.lNodeWrap)},[e])}function SB(e,t){const{document:n}=t;if(!n)return{withData:!1,...Hw(e,t)};const i=n.featuredImage?.thumb;return{withData:!0,url:n.url??void 0,title:n.title??void 0,slug:n.slug??void 0,metaDescription:n.metaDescription??void 0,metaKeywords:n.metaKeywords??void 0,featuredImageHandle:n.featuredImageHandle,featuredImageThumb:i?JSON.parse(i):void 0,...Hw(e,t)}}function Hw(e,t){const{lNodeId:n,language:i,ready:s,node:l}=t,{typeName:c,publishDate:d,scheduled:h}=l;return{documentId:n,language:i,ready:s,node:{typeName:c,publishDate:d??void 0,scheduled:h},translations:t.translations,breadcrumb:t.breadcrumb.map(m=>({nodeId:m.nodeId,language:m.language,documentType:Tr(e,m.typeName),title:m.title??void 0}))}}function qw({closeDialog:e,parameter:{routingDocumentTitles:t,deleteType:n,clusterTitle:i,language:s,rootDocumentType:l}}){const c=we(),d=Rf(),h=l.typeName==="home",m=Object.keys(d.lNodeIds).length,y=h&&(m===1||n==="all"),v=c("common.deletion"),b=f.jsx("div",{children:y?f.jsx("p",{children:c("DeleteDocument.cannotDeleteLastHomeLanguage")}):f.jsxs("div",{children:[i&&f.jsxs("p",{children:[f.jsxs("strong",{children:[c("ClusterManagementConfirmDialog.cluster"),":"]})," ",i]}),f.jsx("p",{dangerouslySetInnerHTML:{__html:n==="current"?c("ClusterManagementConfirmDialog.confirmCurrentLanguageDeletion",{language:c(`languages.${s}`)}):c("ClusterManagementConfirmDialog.confirmAllLanguagesDeletion")}}),f.jsxs("p",{children:[c("ClusterManagementConfirmDialog.documentsToDelete"),":"]}),f.jsx("ul",{children:t.map(w=>f.jsx("li",{children:f.jsx("strong",{children:w})},w))})]})}),D=f.jsxs("div",{className:"ButtonBar alignRight",children:[f.jsx(de,{severity:"secondary",onClick:()=>e({done:!1}),children:c("common.cancel")}),!y&&f.jsx(de,{severity:"danger",onClick:()=>e({done:!0}),children:c("common.validate")})]});return{header:v,content:b,footer:D}}function xB({rootDocumentId:e,rootNodeId:t,rootDocumentType:n,language:i,treeData:s,breadcrumb:l,loading:c,documentTitle:d,showAlert:h}){const m=we(),y=e_(),v=n_(),{navigateToBack:b}=K1(),D=ia(),w=S.useCallback(async()=>{const F=Vw(s);(await D(qw,{routingDocumentTitles:F,deleteType:"current",clusterTitle:d,language:i,rootDocumentType:n}))?.done&&(await y(e),b(l))},[e,n,s,D,y,d,i,m,b,l]),N=S.useCallback(async()=>{const F=Vw(s);if((await D(qw,{routingDocumentTitles:F,deleteType:"all",clusterTitle:d,language:i,rootDocumentType:n}))?.done)try{await v(t),b(l)}catch(P){on.error("Error deleting cluster:",P)}},[s,D,t,n,v,d,i,m,b,l]),M=s?DB(s,i):!1,A=c||M,T=s?wB(s,i):!1,j=f.jsx(Og,{icon:f.jsx(pc,{size:16}),severity:"secondary",as:"async",onClick:w,onError:F=>{on.error("Error deleting cluster:",F),h(F)},disabled:A,items:[{label:m("ClusterManagementDialog.removeClusterAllLanguages"),icon:f.jsx(pc,{size:16}),command:N,danger:!0,disabled:T||M}],children:m("ClusterManagementDialog.removeCluster")});return f.jsx(f.Fragment,{children:M?f.jsx(gf,{content:m("ClusterManagementDialog.cannotDeleteClusterHasChildren"),children:j}):j})}function Vw(e){if(!e)return[];const t=[];function n(i){i.data?.clusterNode&&t.push(i.label),i.children&&i.children.forEach(n)}return n(e),t}function wB(e,t){function n(i){return i.data?.clusterNode?.annotations?.hasChildrenInLanguages?.some(l=>l!==t)?!0:i.children?i.children.some(n):!1}return n(e)}function DB(e,t){function n(i){return i.data?.clusterNode?.annotations?.hasChildrenInLanguages?.includes(t)?!0:i.children?i.children.some(n):!1}return n(e)}function NB({rootDocumentId:e,rootDocumentType:t,documentTitle:n,breadcrumb:i,onClose:s}){const l=we(),{siteSchema:c}=St(),d=A1(),h=Q3(),m=r_(),[y,v]=S.useState(!0),[b,D]=S.useState(),[w,N]=S.useState(!1),[M,A]=S.useState({}),[T,j]=S.useState(new Map),{showAlert:F,showError:z}=at(),{nodeId:P,language:E}=_t(e);ct(async()=>{try{v(!0);const Q=await d(P),ie=X1(l,c,Q,t,E);D(ie),A(CB(ie.children??[]))}catch(Q){on.error("Error fetching annotated cluster:",Q),F(l("errorOccurred"),{severity:"error"})}finally{v(!1)}},[P,c,l]);const L=S.useCallback(Q=>Q?T.get(Q)?.action!=="delete":!0,[T]),_=S.useCallback(Q=>{if(!Q||!Q.children)return!1;for(const ie of Q.children){if(!ie.data)continue;const R=ie.data.documentType.typeName;if((qa(ie.data.clusterNode)?!T.has(R):T.has(R))||_(ie))return!0}return!1},[T]),Y=S.useCallback((Q,ie,R,W)=>{if(R&&!ie){F(l("ClusterManagementDialog.cannotDeleteWithChildren"),{severity:"warning"});return}if(!ie&&!L(W)){F(l("ClusterManagementDialog.parentMustBeChecked"),{severity:"warning"});return}if(!ie){const se=Dg(Q.typeName,b?.children);if(se&&_(se)){F(l("ClusterManagementDialog.cannotDeleteParentWithCheckedChildren"),{severity:"warning"});return}}j(se=>{const ye=new Map(se);return ie?ye.delete(Q.typeName):ye.set(Q.typeName,{action:"delete",nodeId:Q.nodeId}),N(ye.size>0),ye})},[l,L,Dg,b,_]),Z=S.useCallback((Q,ie,R)=>{if(ie&&!L(R)){F(l("ClusterManagementDialog.parentMustBeChecked"),{severity:"warning"});return}j(W=>{const se=new Map(W);return ie?se.set(Q,{action:"insert"}):se.delete(Q),N(se.size>0),se})},[l,L]),U=S.useCallback(async()=>{if(T.size===0){s();return}const Q={rootTypeName:t.typeName,rootNodeId:P,children:Array.from(T.entries(),([ie,{action:R,nodeId:W}])=>({typeName:ie,action:R,nodeId:W}))};await h(Q),await m(),s()},[c,P,l,s,T,h,m]),ae=S.useCallback(Q=>{if(!Q.data)throw new Error("Tree node data is missing");const{documentType:ie,clusterNode:R,parentTypeName:W,enabled:se}=Q.data,ye=qa(R),ke=ye&&!T.has(ie.typeName),k=!ye&&T.has(ie.typeName),J=R?.annotations?.hasChildrenInLanguages?.includes(E)??!1,oe=()=>{const ce={};return ye&&!ke&&se&&(ce.textDecoration="line-through"),!ye&&k&&(ce.fontWeight="bold"),ce};return f.jsxs("div",{className:"TreeNode",children:[f.jsx(cs,{checked:ye?ke:k,onChange:ce=>{ye?Y(R,ce,J,W):Z(ie.typeName,ce,W)},disabled:!se}),se?f.jsxs("span",{className:ye?"text-color":"text-red-500",style:oe(),children:[Q.label,J&&` (${l("ClusterManagementDialog.hasChildren")})`]}):f.jsx(gf,{content:l("ClusterManagementDialog.cannotDeleteDocumentHasChildren"),children:f.jsxs("span",{className:ye?"text-color":"text-red-500",style:oe(),children:[Q.label,J&&` (${l("ClusterManagementDialog.hasChildren")})`]})})]})},[Y,Z,l,T,E]);return f.jsx(Pg,{header:`${l("ClusterManagementDialog.title")} - ${n??l("NavBar.noTitle")}`,visible:!0,onHide:s,footer:f.jsxs("div",{className:"ClusterManagementDialog-footer",children:[f.jsx(xB,{rootDocumentId:e,rootNodeId:P,rootDocumentType:t,language:E,treeData:b,breadcrumb:i,loading:y,documentTitle:n,showAlert:z}),f.jsxs("div",{className:"ButtonBar",children:[f.jsxs(de,{outlined:!0,onClick:s,children:[f.jsx(Lo,{size:16}),l("common.cancel")]}),f.jsxs(de,{as:"async",onClick:U,disabled:y||!w,insideFeedback:{label:l("common.done")},onError:z,children:[f.jsx(iD,{size:16}),l("ClusterManagementDialog.apply")]})]})]}),children:y||!b?f.jsx("div",{className:"ClusterManagementDialog-loading",children:f.jsx(ln,{})}):f.jsxs("div",{children:[f.jsx("p",{className:"Mb3",children:l("ClusterManagementDialog.description")}),f.jsx(wD,{value:b.children??[],nodeTemplate:Q=>ae(Q),expandedKeys:M,onExpandedKeysChange:A})]})})}function X1(e,t,n,i,s,l){const c=i.routingChildren?i.routingChildren.map(v=>{const b=Tr(t,v),D=n?.children?.[v];return X1(e,t,D,b,s,i.typeName)}):void 0,d=qa(n),h=n?.annotations?.hasChildrenInLanguages?.includes(s)??!1,m=c?.some(v=>!v.data?.enabled)??!1,y=!(d&&h)&&!m;return{key:i.typeName,label:e(`siteSchema.nodeTypes.${i.typeName}.label`,i.typeName),data:{documentType:i,clusterNode:n,parentTypeName:l,enabled:y},children:c}}function CB(e){const t={};function n(i){i.children&&i.children.length>0&&qa(i.key)&&(t[i.key]=!0,i.children.forEach(n))}return e.forEach(n),t}function Dg(e,t){if(t)for(const n of t){if(n.data?.documentType.typeName===e)return n;const i=Dg(e,n.children);if(i)return i}}function W1({onDropFiles:e,children:t,onDraggingChange:n}){const{t:i}=Pt(),[s,l]=S.useState(!1),c=S.useRef(!1);function d(b){b!==c.current&&(c.current=b,l(b),n?.(b))}function h(b){b.preventDefault(),b.stopPropagation()}function m(b){h(b),d(!0)}function y(b){h(b),b.target.classList.contains("FileDrop-overlay")&&d(!1)}function v(b){h(b),d(!1),e(b.dataTransfer.files)}return f.jsxs("div",{className:he("FileDrop"),onDrag:h,onDragStart:h,onDragEnd:h,onDragEnter:h,onDragOver:m,onDragLeave:y,onDrop:v,children:[f.jsx("div",{className:he("FileDrop-overlay",{dragging:s}),children:i("mediaGallery.dropFilesHere")}),t]})}const Q1="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='utf-8'?%3e%3c!--%20Uploaded%20to:%20SVG%20Repo,%20www.svgrepo.com,%20Generator:%20SVG%20Repo%20Mixer%20Tools%20--%3e%3csvg%20fill='%23000000'%20width='800px'%20height='800px'%20viewBox='0%200%2032%2032'%20id='icon'%20xmlns='http://www.w3.org/2000/svg'%3e%3cdefs%3e%3cstyle%3e%20.cls-1%20{%20fill:%20none;%20}%20%3c/style%3e%3c/defs%3e%3ctitle%3edocument--pdf%3c/title%3e%3cpolygon%20points='30%2018%2030%2016%2024%2016%2024%2026%2026%2026%2026%2022%2029%2022%2029%2020%2026%2020%2026%2018%2030%2018'/%3e%3cpath%20d='M19,26H15V16h4a3.0033,3.0033,0,0,1,3,3v4A3.0033,3.0033,0,0,1,19,26Zm-2-2h2a1.0011,1.0011,0,0,0,1-1V19a1.0011,1.0011,0,0,0-1-1H17Z'/%3e%3cpath%20d='M11,16H6V26H8V23h3a2.0027,2.0027,0,0,0,2-2V18A2.0023,2.0023,0,0,0,11,16ZM8,21V18h3l.001,3Z'/%3e%3cpath%20d='M22,14V10a.9092.9092,0,0,0-.3-.7l-7-7A.9087.9087,0,0,0,14,2H4A2.0059,2.0059,0,0,0,2,4V28a2,2,0,0,0,2,2H20V28H4V4h8v6a2.0059,2.0059,0,0,0,2,2h6v2Zm-8-4V4.4L19.6,10Z'/%3e%3crect%20id='_Transparent_Rectangle_'%20data-name='<Transparent%20Rectangle>'%20class='cls-1'%20width='32'%20height='32'/%3e%3c/svg%3e";function Nc({closeDialog:e,parameter:{title:t,message:n,confirmLabel:i,cancelLabel:s,confirmSeverity:l="danger",action:c}}){const d=we(),{showError:h}=at(),m=async()=>{await c(),e(!0)},y=t,v=f.jsx("div",{children:n}),b=f.jsxs("div",{className:"ButtonBar alignRight",children:[f.jsx(de,{severity:"secondary",onClick:()=>e(!1),children:s??d("common.cancel")}),f.jsx(de,{as:"async",severity:l,autoFocus:!0,onClick:m,insideFeedback:{label:d("common.done")},onError:h,children:i??d("common.confirm")})]});return{header:y,content:v,footer:b}}function Z1(){const{t:e,i18n:t}=Pt(),n=t.language;return function(s){const l=s/1e3,c=l/1e3,d=c/1e3,h={maximumFractionDigits:2,language:n};return d>=1?`${Rp(d,h)} ${e("sizeFormatter.GB")}`:c>=1?`${Rp(c,h)} ${e("sizeFormatter.MB")}`:l>=1?`${Rp(l,{language:n})} ${e("sizeFormatter.KB")}`:`${s} ${e("sizeFormatter.B")}`}}function Rp(e,{maximumFractionDigits:t=0,language:n}){return new Intl.NumberFormat(n,{maximumFractionDigits:t}).format(e)}const EB=ge`
|
|
232
|
-
query Medias($handle: ID!) {
|
|
233
|
-
medias(handle: $handle) { source thumb }
|
|
234
|
-
}
|
|
235
|
-
`;function ky(){return S.useCallback(async e=>(await Se(EB,{handle:e})).medias.map(nE),[])}const AB=ge`
|
|
236
|
-
query Media($handle: ID!) {
|
|
237
|
-
media(handle: $handle) { source thumb }
|
|
238
|
-
}
|
|
239
|
-
`;function eE(){return S.useCallback(async e=>{const t=await Se(AB,{handle:e});return t.media?nE(t.media):void 0},[])}const MB=ge`
|
|
240
|
-
mutation updateMediaAttachedData($mediaId: ID!, $language: String!, $value: String) {
|
|
241
|
-
updateMediaAttachedData(
|
|
242
|
-
mediaId: $mediaId,
|
|
243
|
-
language: $language,
|
|
244
|
-
value: $value
|
|
245
|
-
)
|
|
246
|
-
}
|
|
247
|
-
`;function tE(){return S.useCallback(async e=>{await Se(MB,{mediaId:e.mediaId,language:e.language,value:e.value?JSON.stringify(e.value):null})},[])}const TB=ge`
|
|
248
|
-
mutation updateMediaPixelRatio($mediaId: ID!, $pixelRatio: Float) {
|
|
249
|
-
updateMediaPixelRatio(
|
|
250
|
-
mediaId: $mediaId,
|
|
251
|
-
pixelRatio: $pixelRatio
|
|
252
|
-
)
|
|
253
|
-
}
|
|
254
|
-
`;function jB(){return S.useCallback(async e=>{await Se(TB,{mediaId:e.mediaId,pixelRatio:e.pixelRatio})},[])}function nE(e){const t=JSON.parse(e.source),n=e.thumb?JSON.parse(e.thumb):void 0;if(t.kind==="file")return{kind:"file",source:t};if(!n)throw new Error(`missing thumbImage for mediaId "${t.mediaId}"`);return{kind:"image",source:t,thumb:n}}const kB=ge`
|
|
255
|
-
query GetUsedRawSizesByMedia($mediaId: ID!) {
|
|
256
|
-
getUsedRawSizesByMedia(mediaId: $mediaId) {
|
|
257
|
-
rawResizeR
|
|
258
|
-
rawSizeName
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
`;function $B(){return S.useCallback(async e=>(await Se(kB,{mediaId:e})).getUsedRawSizesByMedia,[])}const Kw=[1,1.5,2,3];function OB({value:e,onChange:t,defaultPixelRatio:n,className:i}){const{t:s}=Pt(),l=e===void 0,c=[...Kw];e!==void 0&&!Kw.includes(e)&&(c.push(e),c.sort((y,v)=>y-v));const d=y=>`${y}×`,h=y=>{t(y?void 0:n)},m=y=>{t(y)};return f.jsxs("div",{className:`PixelRatioSelector ${i||""}`,children:[f.jsx("div",{className:"PixelRatioSelector-toggle",children:f.jsx(gf,{content:`${s("mediaGallery.mediaProperties.auto")}${l?` (${n}×)`:""}`,children:f.jsx(hj,{checked:l,onChange:h,children:s("mediaGallery.mediaProperties.auto")})})}),!l&&f.jsx("div",{className:"PixelRatioSelector-dropdown",children:f.jsx(Ac,{value:e?.toString()??"",options:c.map(y=>({label:d(y),value:y.toString()})),onChange:y=>m(Number(y)),placeholder:"Select ratio"})})]})}function RB({closeDialog:e,parameter:{updateMediaAttachedData:t,onDelete:n,media:i,contentLanguage:s,defaultPixelRatio:l}}){const[c,d]=S.useState(""),[h,m]=S.useState(void 0),[y,v]=S.useState([]),{showError:b}=at(),D=Z1(),{t:w}=Pt(),N=ia(),M=jB(),A=$B();S.useEffect(()=>{s&&(d(i.source.attachedData?.[s]?.caption??""),i.kind==="image"&&m(i.source.pixelRatio))},[i,s]),ct(async()=>{i.kind==="image"&&await A(i.source.mediaId).then(v)},[i,A]);const T=L=>`${L.source.rawWidth}×${L.source.rawHeight}`,j=async()=>{if(!n)return;await N(Nc,{title:w("mediaGallery.deleteFileModalTitle"),message:w("mediaGallery.deleteThisFile"),confirmLabel:w("common.yes"),cancelLabel:w("common.no"),confirmSeverity:"danger",action:n})===!0&&e(!0)},F=async()=>{if(!s||!t)return;let L=c.trim();L===""&&(L=void 0);const _=i.source.attachedData?.[s]??{};if(L!==_.caption){const Y={..._,caption:L};await t(i.source.mediaId,Object.keys(Y).length>1||L?Y:null)}i.kind==="image"&&h!==i.source.pixelRatio&&await M({mediaId:i.source.mediaId,pixelRatio:h??null}),e(!0)},z=i.kind==="image"?w("mediaGallery.mediaProperties.imageProperties"):w("mediaGallery.mediaProperties.fileProperties"),P=f.jsxs("div",{className:"MediaProperties",children:[f.jsxs("div",{className:"MediaPropertiesDialog-header",children:[i.kind==="image"&&f.jsx("a",{href:i.source.url,target:"_blank",rel:"noreferrer",className:"Mb5 MediaPropertiesDialog-sourceLink",children:f.jsx("img",{src:i.thumb.url,alt:"media",width:"200"})}),f.jsxs("div",{children:[f.jsxs("div",{className:"row",children:[f.jsx("div",{className:"label",children:i.kind==="image"?w("mediaGallery.mediaProperties.imageStored"):w("mediaGallery.mediaProperties.fileStored")}),f.jsxs("div",{children:[f.jsxs("span",{className:"info",children:[D(i.source.weightB),","]}),i.kind==="image"&&f.jsxs("span",{className:"info",children:[T(i),","]}),f.jsxs("span",{className:"info",children:[w("mediaGallery.mediaProperties.format")," ",i.source.mediaType]})]}),f.jsx(de,{as:"a",href:i.source.url,target:"_blank",rel:"noreferrer",className:"no-underline",severity:"primary",children:f.jsx(Pp,{size:16})})]}),f.jsxs("div",{className:"row",children:[f.jsx("div",{className:"label",children:w("mediaGallery.mediaProperties.originalFileName")}),f.jsx("div",{children:i.source.originalName})]})]})]}),i.kind==="image"&&f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"row",children:[f.jsx("div",{className:"label",children:w("mediaGallery.mediaProperties.caption")}),f.jsx(vn,{className:"MediaProperties-captionField",value:c,onChange:d})]}),f.jsxs("div",{className:"row",children:[f.jsx("div",{className:"label",children:w("mediaGallery.mediaProperties.pixelRatio")}),f.jsx(OB,{value:h,onChange:m,defaultPixelRatio:l,className:"MediaProperties-pixelRatioField"})]}),y.length>0&&f.jsxs("div",{className:"row",children:[f.jsx("div",{className:"label",children:w("mediaGallery.mediaProperties.usedSizes")}),f.jsx("div",{className:"Mb1",children:y.map(L=>f.jsx(zp,{label:L.rawSizeName===L.rawResizeR?L.rawSizeName:`${L.rawSizeName} (${L.rawResizeR})`,className:"Mr1 Mb1"},L.rawResizeR))})]})]})]}),E=f.jsxs(f.Fragment,{children:[n&&f.jsx(de,{as:"async",outlined:!0,severity:"danger",onClick:j,insideFeedback:{label:w("common.done")},onError:b,children:w("common.delete")}),f.jsx(de,{severity:i.kind==="image"?"secondary":void 0,onClick:()=>e(),children:i.kind==="image"?w("common.cancel"):w("common.close")}),t&&i.kind==="image"&&f.jsx(de,{as:"async",onClick:F,insideFeedback:{label:w("common.saved")},onError:b,children:w("common.save")})]});return{header:z,content:P,footer:E}}function $y({media:e,onDelete:t,onClick:n,onReplace:i,isMobile:s,updateMediaAttachedData:l,contentLanguage:c,defaultPixelRatio:d,refresh:h,disableActions:m}){const{t:y}=Pt(),[v]=S.useState(!1),b=S.useId(),D=ia(),N=ci()(async()=>{await D(RB,{updateMediaAttachedData:l,onDelete:t,media:e,contentLanguage:c,defaultPixelRatio:d})&&h&&await h()}),M=()=>{const T=[];return t&&T.push({key:"delete",label:y("common.delete"),command:async()=>{await D(Nc,{title:y("mediaGallery.deleteFileModalTitle"),message:y("mediaGallery.deleteThisFile"),confirmLabel:y("common.yes"),cancelLabel:y("common.no"),confirmSeverity:"danger",action:t})}}),i&&T.push({key:"replace",label:y("mediaGallery.replace"),command:i}),T.push({key:"properties",label:y("mediaGallery.properties"),command:N}),T};let A;return i?A=f.jsx(mf,{items:M(),id:b,children:f.jsx(de,{className:he("Media-dropdown",v&&"opened"),children:f.jsx(AS,{size:16})})}):A=f.jsx(de,{className:"Media-dropdown",onClick:N,children:f.jsx(AS,{size:16})}),f.jsxs("div",{className:"Media",children:[!m&&A&&A,!m&&n&&f.jsx(de,{className:"Media-insertImage",onClick:n,children:f.jsx(QM,{size:14})}),f.jsx("div",{className:he("Media-image",{mobile:!!s}),children:LB(e)})]})}function LB(e){return e.kind==="image"?f.jsx("img",{src:e.thumb.url,height:e.thumb.height,width:e.thumb.width,alt:""}):/pdf/.test(e.source.mediaType)?f.jsx("img",{src:Q1,alt:""}):f.jsx(oD,{size:80})}let PB=0;function Oy(e){const{t}=Pt(),n=$c(),{showAlert:i}=at(),[s,l]=S.useState([]),[c,d]=S.useState([]),h=S.useRef(e);S.useEffect(()=>{h.current=e},Object.values(e));const m=S.useRef(async()=>{const{mediaHandle:v,getMedias:b,limitManager:D}=h.current,w=await b(v);d(w),D?.updateMediaCount({handle:v,count:w.length})});return{uploadFiles:S.useRef(v=>{const{mediaHandle:b,httpUploadMedia:D,acceptFilter:w}=h.current,N=(w?v.filter(w):v).map(A),M=N.map(T=>T.promise);return l(T=>[...T,...N.map(j=>({uploadId:j.uploadId,file:j.file,handler:j.uploadingHandler}))]),Promise.all(M);function A(T){const j=++PB,F=D({file:T,handle:b}),z=F.promise.catch(()=>{i(t("DocumentEditPanel.uploadError",{filename:T.name}),{severity:"error"})}).finally(()=>{l(E=>E.filter(L=>L.uploadId!==j))}).catch(E=>{n.error("[media-gallery]",E)}),P={uploadId:j,file:T,uploadingHandler:F,progress:0,promise:z};return F.onProgress=E=>{P.progress=E},P}}).current,uploadingFiles:s,medias:c,refreshMedias:m.current}}function IB({label:e,accept:t,onFilesSelect:n,multiple:i,className:s,disabled:l,ref:c}){const d=S.useRef(null);return S.useImperativeHandle(c,()=>({open(){d.current?.click()}}),[]),f.jsxs("label",{ref:d,className:`MediaPicker${s?` ${s}`:""}`,children:[f.jsx(ff,{size:20,strokeWidth:2}),f.jsx("span",{children:e}),f.jsx("input",{type:"file",accept:t,multiple:i,disabled:l,onChange:h=>{const m=h.target.files;n(m?[...m]:[]),h.target.files=null,h.target.value=""}})]})}function zB({localMedia:e,progress:t,onAbort:n}){const{t:i}=Pt(),[s,l]=S.useState(),[c,d]=S.useState(!1),h=S.useCallback(()=>{s&&URL.revokeObjectURL(s)},[s]);return S.useEffect(()=>{/^image/.test(e.type)?(l(URL.createObjectURL(e)),d(!1)):/pdf/.test(e.type)?(l(Q1),d(!1)):d(!0)},[]),S.useEffect(()=>()=>h(),[h]),f.jsxs("div",{className:"Media",children:[n&&f.jsxs("div",{className:"Media-dropdown",children:[f.jsx("button",{className:"Media-dropdownBtn",type:"button",children:f.jsx(wT,{})}),f.jsx("div",{className:"Media-content",children:f.jsx("li",{onClick:n,onKeyUp:n,children:i("mediaGallery.cancelUpload")})})]}),f.jsx("div",{className:"Media-image",children:c?f.jsx(oD,{size:80}):f.jsx("img",{src:s,alt:e.name})}),f.jsxs("div",{className:"Media-progress",children:[f.jsx("div",{className:"progress",style:{width:`${t}%`}}),f.jsxs("div",{className:"progressValue",children:[t,"%"]})]})]})}function aE({localMedia:e,handler:t}){const[n,i]=S.useState(0);return S.useEffect(()=>{t.onProgress=i},[t]),f.jsx(zB,{localMedia:e,progress:n,onAbort:()=>t.abort()})}function _B({mediaHandle:e,getMedia:t,httpUploadMedia:n,deleteMedia:i,accept:s,acceptFilter:l,label:c,limitManager:d,isMobile:h,updateMediaAttachedData:m,contentLanguage:y,defaultPixelRatio:v}){const{t:b}=Pt(),[D,w]=S.useState(!1),N=S.useRef(null),M=ci(),{showAlert:A}=at();ct(async()=>{w(!1),await z(),w(!0)},[e]);const{uploadFiles:T,uploadingFiles:j,medias:F,refreshMedias:z}=Oy({mediaHandle:e,httpUploadMedia:n,acceptFilter:l,limitManager:d,getMedias:async()=>{const U=await t(e);return U?[U]:[]}}),P=async U=>{await T([U[0]]),await z()},E=()=>F.length>0,L=()=>j.length>0,_=()=>{N.current?.open()},Y=async()=>{!E()||!i||(await i(e),await z(),d?.updateMediaCount({handle:e,count:0}))};async function Z(U){if(d?.remainingMediaPlaces===0){A(b("mediaGallery.mediaLimitReached"),{severity:"warning"});return}try{await P([...U])}catch(ae){A(Fn(ae),{severity:"error"})}}return f.jsx(W1,{onDropFiles:M(Z),children:f.jsxs("div",{className:"SingleMedia",children:[f.jsx(IB,{className:he("single",{hidden:D&&E()||L()}),ref:N,label:c??b("mediaGallery.chooseAFile"),accept:s,multiple:!1,onFilesSelect:P,disabled:d?.remainingMediaPlaces===0}),L()&&f.jsx(aE,{localMedia:j[0].file,handler:j[0].handler}),!L()&&E()&&f.jsx($y,{media:F[0],onReplace:_,onDelete:Y,isMobile:h,updateMediaAttachedData:m,contentLanguage:y,defaultPixelRatio:v,refresh:z},F[0].source.mediaId)]})})}const UB=ge`
|
|
262
|
-
mutation DeleteMediaFromGallery($mediaId: ID!, $handle: ID!) {
|
|
263
|
-
deleteMediaFromGallery(mediaId: $mediaId, handle: $handle)
|
|
264
|
-
}
|
|
265
|
-
`;function BB(){return S.useCallback(async({mediaId:e,handle:t})=>{await Se(UB,{mediaId:e,handle:t})},[])}const FB=ge`
|
|
266
|
-
mutation DeleteMedia($handle: ID!) {
|
|
267
|
-
deleteMedia(handle: $handle)
|
|
268
|
-
}
|
|
269
|
-
`;function HB(){return S.useCallback(async e=>{await Se(FB,{handle:e})},[])}const qB=ge`
|
|
270
|
-
mutation ReorderMedias($handle: ID!, $mediaIds: [ID!]!) {
|
|
271
|
-
reorderMedias(
|
|
272
|
-
input: {
|
|
273
|
-
handle: $handle
|
|
274
|
-
mediaIds: $mediaIds
|
|
275
|
-
}
|
|
276
|
-
) { source thumb }
|
|
277
|
-
}
|
|
278
|
-
`;function VB(){return S.useCallback(async e=>{await Se(qB,e)},[])}const Ed={"image/*":e=>e.startsWith("image/"),"image/webp":e=>e==="image/webp","image/jpeg":e=>e==="image/jpeg","image/png":e=>e==="image/png","image/gif":e=>e==="image/gif","image/svg+xml":e=>e==="image/svg+xml","application/pdf":e=>e==="application/pdf"};function Ry({accept:e,refuse:t}){const n=we(),{showAlert:i}=at();return S.useMemo(()=>{if(!e)return()=>!0;const s=KB(e,{refuse:t});return l=>s(l.type)?!0:(i(n("mediaField.invalidFile",{filename:l.name}),{severity:"warning"}),!1)},[e,t,i,n])}function KB(e,t={}){const i=(typeof e=="string"?e.split(/\s*,\s*/):e).map(c=>{if(!Ed[c])throw new Error(`invalid accept '${c}'`);return Ed[c]}),l=((typeof t.refuse=="string"?t.refuse.split(/\s*,\s*/):t.refuse)??[]).map(c=>{if(!Ed[c])throw new Error(`invalid refuse '${c}'`);return Ed[c]});return c=>{for(const d of l)if(d(c))return!1;for(const d of i)if(d(c))return!0;return!1}}function GB(e){let t,n;const i=new Promise((c,d)=>{t=c,n=d}),s=new XMLHttpRequest;s.addEventListener("progress",c=>{const d=c.total===0?1:Math.round(100*c.loaded/c.total);l.onProgress?.(d)}),s.addEventListener("loadend",()=>{let c;try{c=JSON.parse(s.response)}catch{n(new Error(`api error '${s.status}': ${s.response}`));return}s.status>=200&&s.status<300?t(c):n(new Error(`api error '${s.status}': ${s.response}`))}),s.addEventListener("error",()=>{n(new Error(`xhr error '${s.status}'`))}),s.addEventListener("abort",()=>{n(new Error("xhr aborted"))}),s.open(e.method,e.url),e.bearerToken&&s.setRequestHeader("Authorization",`Bearer ${e.bearerToken}`),s.send(e.data);const l={promise:i,onProgress:void 0,abort:()=>s.abort()};return l}function Ly({apiUrl:e,replace:t}){return S.useMemo(()=>({file:n,handle:i,attachedData:s})=>{const l=pa?.token;if(!l)throw new Error("Missing bearer token");const c=new FormData;return c.set("file",n),c.set("handle",i),c.set("replace",t?"1":"0"),s&&c.set("attachedData",JSON.stringify(s)),GB({data:c,method:"POST",url:`${e}/adm/backend/upload`,bearerToken:l})},[e,t])}function iE(e){return f.jsx(Cn,{children:f.jsx(YB,{...e})})}function YB({mediaHandle:e,apiUrl:t,accept:n,refuse:i,label:s,isMobile:l,contentLanguage:c}){const d=eE(),h=HB(),{uploadLimitManager:m}=Ut(),{themeConf:y}=St(),v=Ry({accept:n,refuse:i}),b=Ly({apiUrl:t,replace:!0}),D=tE();return f.jsxs(f.Fragment,{children:[f.jsx(_B,{mediaHandle:e,accept:n,acceptFilter:v,getMedia:d,deleteMedia:h,httpUploadMedia:b,label:s,limitManager:m,isMobile:l,updateMediaAttachedData:async(w,N)=>{await D({mediaId:w,language:c,value:N})},contentLanguage:c,defaultPixelRatio:y.pixelRatio}),f.jsx(En,{})]})}function JB({documentControlData:e}){const t=we(),n=Ge(s=>s.appLayout),i=ya();return f.jsx(iE,{isMobile:n==="mobile",apiUrl:Va,accept:"image/*",refuse:"image/svg+xml",mediaHandle:e.featuredImageHandle,label:t("DocumentView.chooseFeatureImage"),contentLanguage:i})}function XB({documentControlData:e}){const t=we(),{setModifiedValue:n,cancelModifiedValue:i}=aa("metaDescription"),s=e.metaDescription??"",[l,c]=S.useState(s);S.useEffect(()=>{c(s)},[s]),S.useEffect(()=>{const h=Ka(l,s);h===void 0?i():n(h)},[l,s,n,i]);const d=h=>{c(h.target.value)};return f.jsxs("label",{className:"Block",children:[f.jsx("span",{className:"FieldLabel",children:t("DocumentView.metaDescription")}),f.jsx(hf,{className:"WFull",rows:3,value:l,onChange:d})]})}function WB({documentControlData:e}){const t=we(),{setModifiedValue:n,cancelModifiedValue:i}=aa("metaKeywords"),s=e.metaKeywords??"",[l,c]=S.useState(s);S.useEffect(()=>{c(s)},[s]),S.useEffect(()=>{const h=Ka(l,s);h===void 0?i():n(h)},[l,s,n,i]);const d=h=>{c(h.target.value)};return f.jsxs("label",{className:"Block",children:[f.jsx("span",{className:"FieldLabel",children:t("DocumentView.metaKeywords")}),f.jsx(hf,{className:"WFull",rows:3,value:l,onChange:d})]})}function QB({documentControlData:e}){const t=we(),{setModifiedValue:n,cancelModifiedValue:i}=aa("publishDate"),s=Ty(),l=G1(),c=e.node.publishDate??"",[d,h]=S.useState(c);S.useEffect(()=>{h(c)},[c]),S.useEffect(()=>{const b=Ka(d,c);b===void 0?i():n(b)},[d,c,n,i]),Bo(async()=>{if(d===c)return!1;const b=e.documentId,{nodeId:D}=_t(b);return d&&!e.ready&&await s({lNodeId:b,ready:!0}),!d&&e.ready&&await s({lNodeId:b,ready:!1}),await l({nodeId:D,publishDate:d||null}),!0});const m=b=>{if(!b)return"";const D=new Date(b),w=D.getFullYear(),N=(D.getMonth()+1).toString().padStart(2,"0"),M=D.getDate().toString().padStart(2,"0"),A=D.getHours().toString().padStart(2,"0"),T=D.getMinutes().toString().padStart(2,"0");return`${w}-${N}-${M}T${A}:${T}`},y=b=>{if(!b)return"";const D=new Date(b);return D.setSeconds(0,0),D.toISOString()},v=b=>{const D=y(b.target.value);h(D)};return f.jsx(Tg,{type:"datetime-local",label:t("common.publishDate"),className:"WFull",value:m(d),onChange:v})}function ZB({documentControlData:e,currentTitle:t}){const n=we(),{setModifiedValue:i,cancelModifiedValue:s}=aa("slug"),l=e.slug??"",c=e.title??"",[d,h]=S.useState(l),[m,y]=S.useState(Er(c)===l);S.useEffect(()=>{h(l)},[l]),S.useEffect(()=>{if(m){const D=Er(t);h(D)}},[t,m]),S.useEffect(()=>{const D=Ka(d,l);D===void 0?s():i(D)},[d,l,i,s]);const v=D=>{h(D),y(!1)},b=()=>{const D=!m;if(y(D),D){const w=Er(t);h(w)}};return f.jsxs("label",{className:"Block",children:[f.jsx("span",{className:"FieldLabel",children:n("DocumentView.slug")}),f.jsx(vn,{value:d,onChange:v,endElement:f.jsx(de,{onClick:b,severity:"secondary",children:m?f.jsx(FT,{size:16}):f.jsx(UT,{size:16})})})]})}function e4({documentControlData:e,onTitleChange:t}){const n=we(),{setModifiedValue:i,cancelModifiedValue:s}=aa("title"),l=e.title??"",[c,d]=S.useState(l);S.useEffect(()=>{d(l)},[l]),S.useEffect(()=>{const m=Ka(c,l);m===void 0?s():i(m)},[c,l,i,s]);const h=m=>{d(m),t?.(m)};return f.jsxs("label",{className:"Block",children:[f.jsx("span",{className:"FieldLabel",children:n("DocumentView.title")}),f.jsx(vn,{className:"WFull",value:c,onChange:h})]})}function t4({documentControlData:e,documentType:t}){const{siteConfiguration:n}=St(),i=we(),[s,l]=S.useState(!1),[c,d]=S.useState(e.title??""),{getModifiedValues:h,cancelModifiedValue:m}=Ut(),y=fB(),v=mB(),b=b1(t),D=n.enableMetaKeywords;Bo(async()=>{const M=h();if(!M)return!1;const{title:A,slug:T,metaDescription:j,metaKeywords:F}=M;let z=!1;if(A!==void 0||T!==void 0){const P=A??e.title??"",E=T??e.slug??"";m("title"),m("slug"),await y({lNodeId:e.documentId,values:{title:P===""?null:P,slug:E===""?null:E}}),z=!0}if(j!==void 0||F!==void 0){const P=j??e.metaDescription??"",E=F??e.metaKeywords??"";m("metaDescription"),m("metaKeywords"),await v({lNodeId:e.documentId,values:{metaDescription:P===""?null:P,metaKeywords:E===""?null:E}}),z=!0}return z});const w=()=>b&&D?"DocumentControlPanel-bottom":b?"DocumentControlPanel-bottom noKeywords":D?"DocumentControlPanel-bottom noCluster":"DocumentControlPanel-bottom noKeywords noCluster",N=t.withFeaturedImage?"DocumentControlPanel-top withFeaturedImage":"DocumentControlPanel-top";return f.jsxs("div",{className:"DocumentControlPanel",children:[f.jsxs("div",{className:N,children:[f.jsx("div",{className:"DocumentControlPanel-title",children:f.jsx(e4,{documentControlData:e,onTitleChange:d})}),f.jsx("div",{className:"DocumentControlPanel-slug",children:f.jsx(ZB,{documentControlData:e,currentTitle:c})}),f.jsx("div",{className:"DocumentControlPanel-publishDate",children:f.jsx(QB,{documentControlData:e})}),t.withFeaturedImage&&f.jsx("div",{className:"DocumentControlPanel-featuredImage",children:f.jsx(JB,{documentControlData:e})})]}),f.jsxs("div",{className:w(),children:[f.jsx("div",{className:"DocumentControlPanel-metaDescription",children:f.jsx(XB,{documentControlData:e})}),D&&f.jsx("div",{className:"DocumentControlPanel-metaKeywords",children:f.jsx(WB,{documentControlData:e})}),b&&f.jsx("div",{className:"DocumentControlPanel-clusterButton",children:f.jsxs("button",{type:"button",className:"DocumentControlPanel-clusterButtonCircle",onClick:()=>l(!0),children:[f.jsx(YT,{size:24}),f.jsx("span",{children:i("DocumentControlPanel.editCluster")})]})})]}),s&&f.jsx(NB,{rootDocumentId:e.documentId,rootDocumentType:t,documentTitle:e.withData?e.title:void 0,breadcrumb:e.breadcrumb,onClose:()=>l(!1)})]})}function n4({documentType:e}){const t=we();return f.jsx("header",{className:"NoDataDocumentControlBar",children:f.jsx("span",{className:"NoDataDocumentControlBar-title",children:t(`siteSchema.nodeTypes.${e.typeName}.label`,e.typeName)})})}function Gw({tooltip:e,children:t}){return f.jsx("span",{className:"RoundedFlag",title:e,children:t})}function Yw({url:e,title:t}){const n=Ge(s=>s.appLayout),i=()=>{g1(e)};return f.jsxs(de,{onClick:i,severity:"secondary",children:[f.jsx(jg,{size:16}),n!=="mobile"&&t]})}function a4(e){const t=Ut(),n=Ay();return Vc(e.documentType)?f.jsx(Rr,{parentScope:t,children:f.jsx(i4,{...e,parentScopedData:t,parentScopeIsPristine:n})}):f.jsx(n4,{documentType:e.documentType})}function i4({className:e,documentId:t,documentType:n,parentScopedData:i,parentScopeIsPristine:s}){const l=we(),{siteConfiguration:c,previewSecret:d}=St(),h=Kc(),m=jy(),[y,v]=S.useState(),{emit:b,isPristine:D}=Ut(),w=Ge(A=>A.appLayout);Gc("shouldRefresh",async()=>{const A=await m({documentId:t});if(A.node.typeName!==n.typeName){on.error(`Document type mismatch: ${A.node.typeName} ≠ ${n.typeName}`),rn.emit("404");return}if(!A.withData)throw new Error(`Document "${t}" should have data`);v(A)},[t,n],{useEffect:!0});const N=async()=>{const A=D();await i.saveAll()&&(i.emit("shouldRefresh"),A||b("shouldRefresh"))},M=()=>{if(!y)return f.jsx(ln,{});const{featuredImageThumb:A}=y,T=f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"SimpleBar",children:[A&&f.jsx("img",{className:"DocumentControlBar-img",src:A.url,width:A.width,height:A.height,alt:""}),w!=="mobile"&&f.jsx("span",{className:"DocumentControlBar-title",children:y.title}),y.metaDescription&&f.jsx(Gw,{tooltip:l("DocumentControl.MDTooltip"),children:l("DocumentControl.MD")}),y.metaKeywords&&c.enableMetaKeywords&&f.jsx(Gw,{tooltip:l("DocumentControl.MKTooltip"),children:l("DocumentControl.MK")}),f.jsx(V1,{ready:y.ready,publishDate:y.node.publishDate,scheduled:y.node.scheduled})]}),f.jsxs("div",{className:"SimpleBar gap3",children:[y.ready&&!y.node.scheduled&&y.url?f.jsx(Yw,{url:y.url,title:l("DocumentControl.view")}):f.jsx(Yw,{url:`${h.publicSiteUrl}${C3(d,y.language,_t(y.documentId).nodeId)}`,title:l("DocumentControl.preview")}),f.jsx(yB,{documentControlData:y,documentType:n,saveDocument:N,disabled:s,parentScopedData:i})]})]});return w==="mobile"?f.jsxs("div",{className:"WmaxFull",children:[f.jsx("div",{className:"SimpleBar spaceBetween",children:T}),f.jsx("div",{className:"DocumentControlBar-title",children:y.title})]}):T};return f.jsx("div",{className:he(e,"DocumentControlBar-container"),children:f.jsx(GU,{header:M(),defaultCollapsed:!!n.fields,children:y?f.jsx(t4,{documentType:n,documentControlData:y}):f.jsx(ln,{})})})}const r4=ge`
|
|
279
|
-
query fieldValues($lNodeId: String!) {
|
|
280
|
-
fieldValues(lNodeId: $lNodeId)
|
|
281
|
-
}
|
|
282
|
-
`;function s4(){return S.useCallback(async e=>{const t=await Se(r4,{lNodeId:e});return JSON.parse(t.fieldValues)},[])}const o4=ge`
|
|
283
|
-
mutation SetFieldValues($nodeId: ID!, $language: String, $values: String!) {
|
|
284
|
-
setFieldValues(nodeId: $nodeId, language: $language, values: $values)
|
|
285
|
-
}
|
|
286
|
-
`;function l4(){return S.useCallback(async e=>{await Se(o4,{nodeId:e.nodeId,language:e.language,values:JSON.stringify(e.values)})},[])}function c4(e,t,n){if(n.storedAs==="labeling"){const i=u4(e),s=d4(t);return i.length!==s.length||i.some((l,c)=>l!==s[c])}if(n.dataType==="json"){const i=yc(e)?e.j:e,s=yc(t)?t.j:t;return qa(i)?qa(s)?JSON.stringify(i)!==JSON.stringify(s):!0:qa(s)}return n.dataType==="string"?(e??"")!==(t??""):qa(e)?qa(t)?e!==t:!0:qa(t)}function u4(e){return kc(e)?e.t.map(t=>t.nodeId):[]}function d4(e){return ck(e)?e.t:[]}function Jw(e){if(!e||typeof e!="object"||!("h"in e)||typeof e.h!="string")throw new Error("invalid media handle value");return e.h}function f4({value:e,fieldType:t,l10nPrefix:n}){const i=A3(e),{t:s}=Pt(),[l,c]=S.useState(i?.access??"public"),[d,h]=S.useState(i?.password??""),{setModifiedValue:m,cancelModifiedValue:y}=aa(t.name);return S.useEffect(()=>{const v=d.trim()||void 0,b=v===void 0?"public":l;b===(i?.access??"public")&&v===i?.password?y():m({j:b==="protected"?{access:"protected",password:v}:{access:"public",password:v}})},[l,d,i]),S.useEffect(()=>{c(i?.access??"public"),h(i?.password??"")},[i?.access,i?.password]),f.jsxs("div",{className:"Block",children:[f.jsx("span",{className:"FieldLabel",children:s(`${n}.${t.name}.label`,t.name)}),f.jsxs("div",{className:"AccessJsonFieldControls",children:[f.jsx(kg,{value:l,options:[{label:s("common.public"),value:"public"},{label:s("common.protected"),value:"protected"}],onChange:v=>c(v)}),l==="protected"&&f.jsx(vn,{type:"text",value:d,onChange:h,placeholder:s("common.passwordPlaceholder"),className:"AccessJsonFieldInput-select"})]})]})}function h4({value:e,fieldType:t,l10nPrefix:n}){const{t:i}=Pt(),[s,l]=S.useState(e??!1),{setModifiedValue:c,cancelModifiedValue:d}=aa(t.name);return S.useEffect(()=>{s===e?d():c(s)},[s,e]),S.useEffect(()=>l(e??!1),[e]),f.jsxs("label",{className:"Block",children:[f.jsx("span",{className:"FieldLabel",children:i(`${n}.${t.name}.label`,t.name)}),f.jsxs("div",{className:"BooleanFieldControl",children:[f.jsx(dj,{checked:s,onChange:h=>l(h)}),f.jsx("span",{className:"Ml2",children:i(s?"common.yes":"common.no")})]})]})}function Lp({fieldType:e,value:t,l10nPrefix:n}){const i=we(),[s,l]=S.useState(t?Xw(t,e):void 0),{setModifiedValue:c,cancelModifiedValue:d}=aa(e.name),h=e.dataType==="dateTime"||e.dataType==="date",m=e.dataType==="dateTime"||e.dataType==="time",y=()=>h&&m?"datetime-local":m?"time":"date",v=D=>{if(!D)return"";if(e.dataType==="time"){const j=D.getHours().toString().padStart(2,"0"),F=D.getMinutes().toString().padStart(2,"0");return`${j}:${F}`}if(e.dataType==="date")return D.toISOString().split("T")[0];const w=D.getFullYear(),N=(D.getMonth()+1).toString().padStart(2,"0"),M=D.getDate().toString().padStart(2,"0"),A=D.getHours().toString().padStart(2,"0"),T=D.getMinutes().toString().padStart(2,"0");return`${w}-${N}-${M}T${A}:${T}`},b=D=>{if(D){if(e.dataType==="time"){const[w,N]=D.split(":"),M=new Date;return M.setHours(Number.parseInt(w,10),Number.parseInt(N,10),0,0),M}return new Date(D)}};return S.useEffect(()=>{const D=Ka(m4(s,e),t);D===void 0?d():c(D)},[s,t]),S.useEffect(()=>l(t?Xw(t,e):void 0),[t]),f.jsx(Tg,{type:y(),label:i(`${n}.${e.name}.label`,e.name),value:v(s),onChange:D=>l(b(D.target.value))})}function Xw(e,t){if(t.dataType==="dateTime")return g4(e);if(t.dataType==="date")return S4(e);if(t.dataType==="time")return v4(e);throw new Error(`Unexpected data type: "${t.dataType}"`)}function m4(e,t){if(!e)return"";if(t.dataType==="dateTime")return p4(e);if(t.dataType==="date")return b4(e);if(t.dataType==="time")return y4(e);throw new Error(`Unexpected data type: "${t.dataType}"`)}function p4(e){const t=e.getFullYear(),n=(e.getMonth()+1).toString().padStart(2,"0"),i=e.getDate().toString().padStart(2,"0"),s=e.getHours().toString().padStart(2,"0"),l=e.getMinutes().toString().padStart(2,"0");return`${t}-${n}-${i}T${s}:${l}:00.000Z`}function g4(e){const[t,n,i]=e.split("T")[0].split("-"),[s,l,c]=e.split("T")[1].split(":"),d=c.split(".")[0],h=new Date;return h.setFullYear(Number(t)),h.setMonth(Number(n)-1),h.setDate(Number(i)),h.setHours(Number(s)),h.setMinutes(Number(l)),h.setSeconds(Number(d)),h}function y4(e){const t=e.getHours().toString().padStart(2,"0"),n=e.getMinutes().toString().padStart(2,"0");return`${t}:${n}:00`}function v4(e){const[t,n]=e.split(":").map(Number),i=new Date;return i.setHours(t),i.setMinutes(n),i.setSeconds(0),i}function b4(e){const t=e.getFullYear(),n=(e.getMonth()+1).toString().padStart(2,"0"),i=e.getDate().toString().padStart(2,"0");return`${t}-${n}-${i}`}function S4(e){const[t,n,i]=e.split("-").map(Number),s=new Date;return s.setFullYear(t),s.setMonth(n-1),s.setDate(i),s}function x4({value:e,fieldType:t,l10nPrefix:n}){const{t:i}=Pt(),[s,l]=S.useState(e),{setModifiedValue:c,cancelModifiedValue:d}=aa(t.name);return S.useEffect(()=>{const h=v_(s,e);h===void 0?d():c(h)},[s,e]),S.useEffect(()=>l(e),[e]),f.jsxs("label",{className:"Block",children:[f.jsx("span",{className:"FieldLabel",children:i(`${n}.${t.name}.label`,t.name)}),t.enum?f.jsx("div",{className:"NumberFieldRadioGroup",children:t.enum.map(h=>f.jsx(_d,{name:t.name,checked:s===h,onChange:()=>l(h),label:i([`${n}.${t.name}.enum.${h}}`,`${h}`])},h))}):f.jsx(BM,{className:"NumberFieldInput-input",value:s,onChange:h=>l(h)})]})}function w4({value:e,fieldType:t,l10nPrefix:n}){const i=e??"",{t:s}=Pt(),[l,c]=S.useState(i),{setModifiedValue:d,cancelModifiedValue:h}=aa(t.name);return S.useEffect(()=>{const m=Ka(l,i);m===void 0?h():d(m)},[l,i]),S.useEffect(()=>c(i),[e]),f.jsxs("label",{className:"Block",children:[f.jsx("span",{className:"FieldLabel",children:s(`${n}.${t.name}.label`,t.name)}),f.jsx("div",{className:"FieldLayout",children:f.jsx(hf,{className:"WFull",rows:10,value:l,onChange:m=>{c(m.target.value)},disabled:t.readOnly,style:{fontFamily:"monospace"}})})]})}function D4({value:e,fieldType:t,l10nPrefix:n}){const i=N4(e),{t:s}=Pt(),[l,c]=S.useState(i===void 0?"":JSON.stringify(i,void 0,2)),[d,h]=S.useState(),{setModifiedValue:m,cancelModifiedValue:y}=aa(t.name);return S.useEffect(()=>{let v;if(l!=="")try{v=JSON.parse(l)}catch{h(s("common.invalidJson"));return}h(void 0),v===void 0?i===void 0?y():m(null):i!==void 0&&JSON.stringify(v)===JSON.stringify(i)?y():m({j:v})},[l,i]),S.useEffect(()=>{c(i===void 0?"":JSON.stringify(i,void 0,2))},[i]),f.jsxs("label",{className:"Block",children:[f.jsx("span",{className:"FieldLabel",children:s(`${n}.${t.name}.label`,t.name)}),f.jsxs("div",{className:"FieldLayout",children:[f.jsx(hf,{className:"WFull",rows:10,value:l,onChange:v=>c(v.target.value),style:{fontFamily:"monospace"}}),d&&f.jsx("small",{className:"ErrorMessage",children:d})]})]})}function N4(e){return yc(e)&&typeof e.j=="object"&&e.j!==null?e.j:void 0}function C4({value:e,fieldType:t,l10nPrefix:n}){const i=e??"",s=we(),[l,c]=S.useState(i),{setModifiedValue:d,cancelModifiedValue:h}=aa(t.name);return S.useEffect(()=>{const m=Ka(l,i);m===void 0?h():d(m)},[l,i]),S.useEffect(()=>c(i),[e]),f.jsxs("label",{className:"Block",children:[f.jsx("span",{className:"FieldLabel",children:s(`${n}.${t.name}.label`,t.name)}),t.enum?f.jsx("div",{className:"StringFieldRadioGroup",children:t.enum.map(m=>f.jsx(_d,{name:t.name,checked:l===m,onChange:()=>c(m),label:s([`${n}.${t.name}.enum.${m}`,m])},m))}):f.jsx(vn,{fullWidth:!0,value:l,onChange:m=>c(m),disabled:t.readOnly})]})}function E4(e,t,n){const i=[...e].reverse();for(const s of i){const l=rE(s,t);if(l!==void 0){const c=l.lNodeIds[n];if(c===void 0)throw new Error(`Taxonomy "${t}" is not available in language "${n}"`);return c}}}function rE(e,t){if(e.typeName===t)return e;if(e.children)for(const n of Object.values(e.children)){const i=rE(n,t);if(i!==void 0)return i}}const A4=ge`
|
|
287
|
-
query Terms($taxonomyId: ID!) {
|
|
288
|
-
lNodeWraps(parentLNodeId: $taxonomyId) {
|
|
289
|
-
nodeId
|
|
290
|
-
document {
|
|
291
|
-
title
|
|
292
|
-
}
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
`;function M4(){return S.useCallback(async e=>(await Se(A4,{taxonomyId:e})).lNodeWraps.map(n=>({nodeId:n.nodeId,title:n.document.title??void 0})),[])}function T4({value:e,fieldType:t,l10nPrefix:n}){const{t:i}=Pt(),s=M4(),l=M1(),[c,d]=S.useState([]),[h,m]=S.useState([]),{setModifiedValue:y,cancelModifiedValue:v}=aa(t.name),b=!!t.multiple,D=ya();return ct(async()=>{const w=E4(l,t.taxonomy,D);if(w===void 0)return;const N=await s(w);d(N.map(M=>({nodeId:M.nodeId,title:M.title??"-"})))},[t,D,l,s]),S.useEffect(()=>{if(!e){m([]);return}if(!kc(e)){on.warn("LabelingField: value is not a ReadLabelingFieldValue",e),m([]);return}const w=e.t.map(N=>({nodeId:N.nodeId,title:zD(N,D).title??"-"}));m(w)},[e]),S.useEffect(()=>{const w=e?e.t?.map(A=>A.nodeId)||[]:[],N=h.map(A=>A.nodeId);w.length===N.length&&w.every((A,T)=>N[T]===A)?v():y({t:N})},[h]),f.jsxs("label",{className:"Block",children:[f.jsx("span",{className:"FieldLabel",children:i(`${n}.${t.name}.label`,t.name)}),b?f.jsx(uj,{value:h.map(w=>w.nodeId),options:c.map(w=>({label:w.title,value:w.nodeId})),onChange:w=>{const N=c.filter(M=>w.includes(M.nodeId));m(N)},placeholder:i("common.select"),className:"WFull",disabled:t.readOnly}):f.jsx(Ac,{value:h[0]?.nodeId??"",options:c.map(w=>({label:w.title,value:w.nodeId})),onChange:w=>{const N=c.find(M=>M.nodeId===w);m(N?[N]:[])},placeholder:i("common.select"),className:"WFull",disabled:t.readOnly})]})}function j4(e){const{isMobile:t}=e,{t:n}=Pt(),i=gs();return f.jsx(de,{className:he("ReorderMedias-button","small",{mobile:!!t}),onClick:()=>i(k4,e),severity:"secondary",children:n("mediaGallery.orderTheMedia")})}function k4({closeDialog:e,parameter:{medias:t,setOrdering:n,defaultPixelRatio:i}}){const{t:s}=Pt(),{showAlert:l}=at(),c=w=>l(Fn(w),{severity:"error"}),d=s("mediaGallery.dragAndDropMedia"),[h,m]=S.useState(()=>t.map(w=>({...w,sortKey:w.source.mediaId}))),y=async()=>{await n(h.map(({sortKey:w,...N})=>N)),e()},v=w=>{m(w)},b=f.jsx(f.Fragment,{children:f.jsx(Fg,{items:h,onReorder:v,keyField:"sortKey",direction:"row",className:"Gallery",renderItem:w=>f.jsx($y,{media:w,defaultPixelRatio:i,disableActions:!0})})}),D=f.jsxs(f.Fragment,{children:[f.jsx(de,{severity:"secondary",onClick:()=>e(),children:s("common.cancel")}),f.jsx(de,{as:"async",onClick:y,insideFeedback:{label:s("common.saved"),autoDismiss:!0},onError:c,children:s("common.save")})]});return{header:d,content:b,footer:D}}function $4(e){return f.jsx(Cn,{children:f.jsx(O4,{...e})})}function O4({deleteMedia:e,className:t,reorderMedias:n,accept:i,handle:s,direction:l="row",onMediaAction:c,limitManager:d,isMobile:h,updateMediaAttachedData:m,contentLanguage:y,uploadFiles:v,uploadingFiles:b,refreshMedias:D,medias:w,defaultPixelRatio:N}){const{t:M}=Pt(),[A,T]=S.useState(!1),j=ci(),{showAlert:F}=at(),z=async _=>{await e({mediaId:_.source.mediaId,handle:s}),await D(),F(M("DocumentEditPanel.mediaDeleted"),{severity:"info"})},P=async _=>{n&&(await n({mediaIds:_.map(Y=>Y.source.mediaId),handle:s}),await D())};ct(D,[s]);async function E(_){if(d?.remainingMediaPlaces===0){F(M("mediaGallery.mediaLimitReached"),{severity:"warning"});return}try{await v([..._]),await D()}catch(Y){F(Fn(Y),{severity:"error"})}}const L=f.jsxs(f.Fragment,{children:[w.map(_=>f.jsx($y,{isMobile:h,media:_,onDelete:()=>z(_),onClick:c?()=>c(_):void 0,updateMediaAttachedData:m,contentLanguage:y,defaultPixelRatio:N,refresh:D},_.source.mediaId)),b.map(_=>f.jsx(aE,{localMedia:_.file,handler:_.handler},_.uploadId))]});return f.jsxs(W1,{onDropFiles:j(E),onDraggingChange:T,children:[f.jsx(En,{}),f.jsxs("div",{className:he("MediaGallery",l,t),children:[w.length>1&&n&&f.jsx(j4,{isMobile:h,medias:w,setOrdering:P,defaultPixelRatio:N}),f.jsxs("span",{className:he("MediaGallery-fileSelectorBtn",l,{dragging:A,mobile:!!h}),children:[f.jsx(ff,{size:20,strokeWidth:2}),l==="row"&&f.jsx("span",{children:M("mediaGallery.chooseAFile")}),f.jsx("input",{className:"MediaGallery-fileSelectorInput",type:"file",name:"files",accept:i,multiple:!0,disabled:d?.remainingMediaPlaces===0,onChange:j(async _=>{if(_.target.files)try{await v([..._.target.files]),await D()}catch(Y){F(Fn(Y),{severity:"error"})}})})]}),l==="row"?L:f.jsx("div",{className:he("Gallery",l),children:L})]})]})}function sE({handle:e,accept:t,onMediaAction:n,direction:i,reorderMedias:s,isMobile:l,contentLanguage:c,uploadHandler:{uploadFiles:d,uploadingFiles:h,medias:m,refreshMedias:y}}){const v=BB(),b=ky(),D=tE(),{uploadLimitManager:w}=Ut(),{themeConf:N}=St();return f.jsx($4,{isMobile:l,accept:t,direction:i,deleteMedia:v,getMedias:b,handle:e,onMediaAction:n,reorderMedias:s,limitManager:w,updateMediaAttachedData:async(M,A)=>{await D({mediaId:M,language:c,value:A})},contentLanguage:c,uploadFiles:d,uploadingFiles:h,medias:m,refreshMedias:y,defaultPixelRatio:N.pixelRatio})}function R4({handle:e,apiUrl:t,accept:n,refuse:i,isMobile:s,contentLanguage:l}){return f.jsx(Cn,{children:f.jsx(L4,{handle:e,apiUrl:t,accept:n,refuse:i,isMobile:s,contentLanguage:l})})}function L4({handle:e,apiUrl:t,accept:n,refuse:i,isMobile:s,contentLanguage:l}){const c=VB(),d=ky(),h=Ly({apiUrl:Va,replace:!1}),{uploadLimitManager:m}=Ut(),y=Ry({accept:n,refuse:i}),v=Oy({mediaHandle:e,httpUploadMedia:h,acceptFilter:y,limitManager:m,getMedias:d});return f.jsxs(f.Fragment,{children:[f.jsx(sE,{handle:e,apiUrl:t,accept:n,direction:"row",reorderMedias:c,isMobile:s,contentLanguage:l,uploadHandler:v}),f.jsx(En,{})]})}const oE=`
|
|
296
|
-
lNodeId
|
|
297
|
-
language
|
|
298
|
-
ready,
|
|
299
|
-
translatedInto
|
|
300
|
-
updatedAt
|
|
301
|
-
node {
|
|
302
|
-
publishDate
|
|
303
|
-
scheduled
|
|
304
|
-
typeName
|
|
305
|
-
}
|
|
306
|
-
document {
|
|
307
|
-
title
|
|
308
|
-
url
|
|
309
|
-
featuredImage { thumb }
|
|
310
|
-
}
|
|
311
|
-
fieldValues
|
|
312
|
-
parentLanguages
|
|
313
|
-
`,P4=ge`
|
|
314
|
-
query PagedChildDocuments(
|
|
315
|
-
$parentDocumentId: ID!
|
|
316
|
-
$limit: Int!
|
|
317
|
-
$offset: Int!
|
|
318
|
-
$sorting: [SortRule!]
|
|
319
|
-
$missingInLanguage: Boolean
|
|
320
|
-
) {
|
|
321
|
-
pagedChildDocuments(
|
|
322
|
-
parentLNodeId: $parentDocumentId
|
|
323
|
-
limit: $limit
|
|
324
|
-
offset: $offset
|
|
325
|
-
sorting: $sorting
|
|
326
|
-
missingInLanguage: $missingInLanguage
|
|
327
|
-
) {
|
|
328
|
-
items { ${oE} }
|
|
329
|
-
offset
|
|
330
|
-
total
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
|
-
`;function I4(){return S.useCallback(async e=>{const t=await Se(P4,e,{undefOn404:!0});return t?cE(t.pagedChildDocuments):void 0},[])}const z4=ge`
|
|
334
|
-
query SearchDocuments(
|
|
335
|
-
$language: String!
|
|
336
|
-
$limit: Int!
|
|
337
|
-
$offset: Int!
|
|
338
|
-
$queryString: String!
|
|
339
|
-
$sorting: [SortRule!]
|
|
340
|
-
){
|
|
341
|
-
searchDocuments(
|
|
342
|
-
language: $language
|
|
343
|
-
limit: $limit
|
|
344
|
-
offset: $offset
|
|
345
|
-
queryString: $queryString
|
|
346
|
-
sorting: $sorting
|
|
347
|
-
) {
|
|
348
|
-
items { ${oE} }
|
|
349
|
-
total
|
|
350
|
-
offset
|
|
351
|
-
}
|
|
352
|
-
}
|
|
353
|
-
`;function lE(){return S.useCallback(async e=>{const t=await Se(z4,e);return cE(t.searchDocuments)},[])}function cE(e){return{items:e.items.map(t=>{if(!t.document)throw new Error(`missing document for "${t.lNodeId}"`);const n=t.document?.featuredImage?.thumb;return{typeName:t.node.typeName,lNodeId:t.lNodeId,publishDate:t.node.publishDate??void 0,scheduled:t.node.scheduled,language:t.language,ready:t.ready,translatedInto:t.translatedInto,title:t.document.title??void 0,url:t.document.url,featuredImageThumb:n?JSON.parse(n):void 0,fieldValues:JSON.parse(t.fieldValues),parentLanguages:t.parentLanguages,updatedAt:new Date(t.updatedAt)}}),total:e.total,offset:e.offset}}function _4({wrapper:e}){const[,t]=S.useReducer(n=>n+1,0);return f.jsx(Pg,{header:typeof e.dialog.header=="string"?e.dialog.header:f.jsx("div",{ref:n=>{n&&e.dialog.header&&zd(n,e.dialog.header)}}),visible:!!e.opened,className:"PluginDialog",onHide:()=>{e.opened&&(e.opened.resolve(),e.opened=void 0,e.dialog.onCancel?.(),t())},footer:f.jsx("div",{ref:n=>{n&&e.dialog.footer&&zd(n,e.dialog.footer)}}),children:f.jsx("div",{style:{marginTop:"10px"},ref:n=>{n&&e.dialog.content&&zd(n,e.dialog.content)}})})}function zd(e,t){if(Array.isArray(t))for(const n of t)zd(e,n);else{if(t===!1)return;e.appendChild(t)}}let U4=0,Ng;function B4(e){if(!Ng)throw new Error("PluginDialogSystem is not in the dialog stack");return Ng(e)}function F4(){const[,e]=S.useReducer(s=>s+1,0),[t,n]=S.useState([]);return Ng=S.useRef(s=>{const l={key:++U4,dialog:s,opened:void 0};return n(c=>[...c,l]),{open(){return l.opened?Promise.reject(new Error("Dialog already opened")):(l.opened=wg(),e(),l.opened.promise)},close(c){l.opened&&(l.opened.resolve(c),l.opened=void 0,e())},show(){l.opened||(l.opened=wg(),e())},hide(){l.opened&&(l.opened.resolve(),l.opened=void 0,e())}}}).current,f.jsx(f.Fragment,{children:t.map(s=>f.jsx(_4,{wrapper:s},s.key))})}const H4=ge`
|
|
354
|
-
query LNodeWrap($lNodeId: ID!) {
|
|
355
|
-
lNodeWrap(lNodeId: $lNodeId) {
|
|
356
|
-
document {
|
|
357
|
-
lNodeId
|
|
358
|
-
title
|
|
359
|
-
slug
|
|
360
|
-
metaDescription
|
|
361
|
-
metaKeywords
|
|
362
|
-
featuredImageHandle
|
|
363
|
-
}
|
|
364
|
-
node {
|
|
365
|
-
publishDate
|
|
366
|
-
scheduled
|
|
367
|
-
typeName
|
|
368
|
-
}
|
|
369
|
-
}
|
|
370
|
-
}
|
|
371
|
-
`;function q4(){return S.useCallback(async e=>(await Se(H4,{lNodeId:e},{undefOn404:!0}))?.lNodeWrap,[])}const V4=ge`
|
|
372
|
-
mutation useAdminUiImage($input: UseAdminUiImageInput!) {
|
|
373
|
-
useAdminUiImage(input: $input) { source variant }
|
|
374
|
-
}
|
|
375
|
-
`;function K4(){return S.useCallback(async e=>{const t=await Se(V4,{input:e});return uE(t.useAdminUiImage)},[])}const G4=ge`
|
|
376
|
-
mutation useFTextImage($input: UseFTextImageInput!) {
|
|
377
|
-
useFTextImage(input: $input) { source variant }
|
|
378
|
-
}
|
|
379
|
-
`;function Y4(){return S.useCallback(async e=>{const t=await Se(G4,{input:e});return uE(t.useFTextImage)},[])}function uE(e){return{source:JSON.parse(e.source),variant:JSON.parse(e.variant)}}const Jc=S.createContext(void 0);function J4({children:e}){const t=S.useRef({plugins:new Map,pluginsStatus:"notLoaded",afterInitListeners:[],hooks:new Map});return f.jsx(Jc.Provider,{value:t.current,children:e})}function X4(){const e=S.useContext(Jc);if(!e)throw new Error("Missing plugins context parent");return t=>e.plugins.get(t)?.plugin}function W4(){const e=S.useContext(Jc);if(!e)throw new Error("Missing plugins context parent");return(t,n)=>Q4(e,t,n)}async function Q4(e,t,n){const{plugins:i,pluginsStatus:s,afterInitListeners:l}=e;if(s!=="notLoaded"){if(t.find(h=>!i.has(h.pluginName)))throw new Error("Inconsistant plugins");return}e.pluginsStatus="loading";for(const h of t)i.set(h.pluginName,{...h});const c=(h,m)=>{l.push({listener:h,loadingPlugin:m})},d=await Promise.all(t.map(h=>e6(e,h,n,c)));for(let h=0;h<t.length;h++){const m=t[h],y=d[h];if(y){const v=i.get(m.pluginName);if(!v)throw new Error(`unknown plugin: '${m.pluginName}'`);v.plugin=y}}e.pluginsStatus="initialized"}function Z4(){const e=S.useContext(Jc);if(!e)throw new Error("Missing plugins context parent");const[t,n]=S.useState(e?.pluginsStatus==="ready"),i=dE(),s=e.afterInitListeners.map(l=>({listener:l.listener,createService:()=>i(l.loadingPlugin.pluginName)}));return ct(async()=>{if(e.pluginsStatus!=="initialized"){n(!0);return}e.pluginsStatus="afterInit";for(const{listener:l,createService:c}of s)await l(c());e.pluginsStatus="ready",n(!0)},[]),t}async function e6(e,t,n,i){const{pluginName:s,adminUiPluginBaseUrl:l}=t;try{const d=await import(`${l}/admin-ui-plugin.mjs`);if(!d.default||!("init"in d.default)||!("create"in d.default))throw new Error(`[${s}] invalid plugin`);const h=t6(e,t,n,m=>i(m,t));return await d.default.init(h),d.default}catch(c){on.error(`Failed loading plugin '${s}'`,c)}}function t6(e,t,n,i){return{logger:on,fqdn:n.fqdn,publicSiteUrl:n.publicSiteUrl,themeConf:n.themeConf,configuration:t.conf??{},pluginBaseUrl:t.adminUiPluginBaseUrl,registerHook(s,l,c){const d=e.hooks.get(s);if(d){if(d.replace||c?.replace)throw new Error(`[${s}] hook already registered`);d.handlers.push(l)}else e.hooks.set(s,{name:s,handlers:[l],replace:c?.replace})},addAfterInitListener:i}}function dE(){const e=S.useContext(Jc);if(!e)throw new Error("Missing plugins context parent");const t=F3(),{showAlert:n}=at(),i=Kc(),{themeConf:s,siteSchema:l}=St(),c=Wt(),d=K4(),h=Y4(),m=lE(),y=q4();return v=>{const b=e.plugins.get(v);if(!b)throw new Error(`Plugin '${v}' not found`);const D={fqdn:i.fqdn,publicSiteUrl:i.publicSiteUrl,themeConf:s,logger:on,configuration:b.conf??{},pluginBaseUrl:b.adminUiPluginBaseUrl,createModalDialog:B4,showAlert:n,useAdminUiImage:async(w,N)=>{try{return await d({mediaId:typeof w=="string"?w:w.mediaId,...N})}catch{}},useFTextImage:async(w,N)=>{try{return await h({mediaId:typeof w=="string"?w:w.mediaId,...N})}catch{}},executeHook(w,N){const M=e.hooks.get(w);return M?M.handlers.map(A=>A(D,N)):[]},openDocumentEdition(w,N){const M=_t(w),A=Tr(l,N),T=Bn({documentType:A,language:M.language,documentNodeId:M.nodeId},A.adminUi?.defaultTab);c(T)},async searchDocuments({searchString:w,language:N,limit:M,offset:A,sorting:T}){const j=M??10;return(await m({queryString:w,language:N??t(),limit:j,offset:A??0,sorting:T})).items.map(z=>({id:z.lNodeId,title:z.title,url:z.url,typeName:z.typeName,ready:z.ready,publishDate:z.publishDate}))},async getDocument(w){const N=await y(w);if(!N)return;const{document:M,node:A}=N;return{id:w,title:M.title,typeName:A.typeName}}};return D}}function fE({fieldType:e,initialValue:t,uploadMedia:n}){const{pluginName:i}=e;if(!i)throw new Error("invalid call to PluginComponent");const s=na(),l=S.useRef(null),c=S.useRef(void 0),d=dE(),[h,m]=S.useState("initializing"),{setModifiedValue:y,cancelModifiedValue:v}=aa(e.name),b=ya(),D=X4(),w=S.useRef(t);return S.useEffect(()=>{c.current&&c.current.pluginInst.setLanguage(s)},[s]),S.useEffect(()=>{w.current=t,c.current&&c.current.contentLanguage===b&&c.current.initialValue!==t&&(v(),c.current.initialValue=t,c.current.pluginInst.setValue(t))},[t,b]),S.useEffect(()=>{m("initializing");const N=l.current;if(!N||c.current)return;const M=D(i);if(!M){on.error(`Error in plugin ${i}: plugin not found`),m("error");return}let A;try{A=M.create({...d(i),fieldType:e,setModifiedValue:T=>{typeof T=="function"||c4(w.current,T,e)?y(T??null):v()},cancelModifiedValue:v,language:s,contentLanguage:b,initialValue:w.current,uploadMedia:n?async T=>(await n(T))?.source:void 0})}catch(T){on.error(`Error in plugin ${i}:`,T),m("error");return}return N.appendChild(A.element),c.current={pluginInst:A,detach:()=>{N.removeChild(A.element),A.dispose()},contentLanguage:b,initialValue:w.current},m("ready"),()=>{c.current&&(c.current.detach(),c.current=void 0)}},[e,b]),{status:h,containerRef:l,pluginInstRef:c}}function n6(e){if(lk(e.value))throw new Error(`Field "${e.fieldType.name}" should not have a gallery`);return f.jsx(Cn,{children:f.jsx(a6,{...e})})}function a6(e){const{status:t,containerRef:n}=fE({fieldType:e.fieldType,initialValue:e.value});return t==="error"?f.jsxs("div",{children:['Error in plugin "',e.fieldType.pluginName,'"']}):f.jsxs(f.Fragment,{children:[f.jsx(En,{}),f.jsx("div",{className:"PluginField",ref:n})]})}function i6(e){return f.jsx(Cn,{children:f.jsx(r6,{...e})})}function r6(e){const{fieldType:t,value:n}=e,{pluginName:i}=t;if(!i)throw new Error("invalid call to PluginComponent");const s=ya(),l=ky(),c=Ly({apiUrl:Va,replace:!1}),{uploadLimitManager:d}=Ut(),h=Ry({}),m=Ge(F=>F.appLayout),y=m==="mobile",{value:v,gallery:b}=jc(n);if(b===void 0)throw new Error(`missing handle in value of field "${t.name}"`);const D=Oy({acceptFilter:h,mediaHandle:b.h,getMedias:l,httpUploadMedia:c,limitManager:d}),w=async F=>{const[z]=await D.uploadFiles([F]);return await D.refreshMedias(),z},{status:N,containerRef:M,pluginInstRef:A}=fE({fieldType:t,initialValue:v,uploadMedia:w});if(N==="error")return f.jsxs("div",{children:['Error in plugin "',e.fieldType.pluginName,'"']});const T=A.current?.pluginInst.insertMedia,j=T?F=>T(F.source):void 0;return f.jsxs("div",{className:he("PluginWithGallery",{mobile:m==="mobile"}),children:[f.jsx(En,{}),f.jsx("div",{className:"PluginWithGallery-pluginWrap PluginField",ref:M}),f.jsx("div",{className:"PluginWithGallery-gallery",children:N==="ready"&&f.jsx(sE,{handle:b.h,apiUrl:Va,onMediaAction:j,direction:y?"row":"column",isMobile:y,contentLanguage:s,uploadHandler:D})})]})}function s6(e){const{fieldType:t}=e;return t.withGallery?f.jsx(i6,{...e}):f.jsx(n6,{...e})}function hE(e){const t=we(),{l10nPrefix:n,areSiteFields:i}=e,s=Ge(c=>c.appLayout),l=ya();return({fieldType:c,value:d})=>{if(c.pluginName)return f.jsxs("div",{children:[f.jsx("span",{className:"FieldLabel",children:t(`${n}.${c.name}.label`,c.name)}),f.jsx(s6,{fieldType:c,value:d},c.name)]},`${c.name}-wrap`);const{value:h}=jc(d);if(c.storedAs==="mediaHandle"&&c.dataType==="media")return f.jsxs("div",{children:[f.jsx("span",{className:"FieldLabel",children:t(`${n}.${c.name}.label`,c.name)}),f.jsx(iE,{mediaHandle:Jw(h),accept:c.accept,refuse:c.refuse,apiUrl:Va,contentLanguage:l},c.name)]},`${c.name}-wrap`);if(c.storedAs==="mediaHandle"&&c.dataType==="gallery")return f.jsxs("div",{children:[f.jsx("span",{className:"FieldLabel",children:t(`${n}.${c.name}.label`,c.name)}),f.jsx(R4,{isMobile:s==="mobile",handle:Jw(h),accept:c.accept,refuse:c.refuse,apiUrl:Va,contentLanguage:l},c.name)]},`${c.name}-wrap`);if(c.storedAs==="labeling"){if(h!==void 0&&!kc(h))throw new Error(`Invalid value for field type '${c.name}' (expected 'labeling', got '${h}')`);return f.jsx(T4,{fieldType:c,value:h,l10nPrefix:n},c.name)}if(c.dataType==="number")return f.jsx(x4,{fieldType:c,value:sk(h),l10nPrefix:n},c.name);if(c.dataType==="string")return c.multiline||c.renderAs==="html"?f.jsx(w4,{fieldType:c,value:ho(h),l10nPrefix:n},c.name):f.jsx(C4,{fieldType:c,value:ho(h),l10nPrefix:n},c.name);if(c.dataType==="boolean")return f.jsx(h4,{fieldType:c,value:ok(h),l10nPrefix:n},c.name);if(c.dataType==="dateTime")return f.jsx(Lp,{value:ho(h),fieldType:c,l10nPrefix:n},c.name);if(c.dataType==="date")return f.jsx(Lp,{value:ho(h),fieldType:c,l10nPrefix:n},c.name);if(c.dataType==="time")return f.jsx(Lp,{value:ho(h),fieldType:c,l10nPrefix:n},c.name);if(c.dataType==="json")return i&&c.name==="access"?f.jsx(f4,{fieldType:c,value:h,l10nPrefix:n},c.name):f.jsx(D4,{fieldType:c,value:h,l10nPrefix:n},c.name);throw new Error(`invalid field type '${c.dataType}'`)}}function o6({fieldValues:e,fieldTypes:t,createFieldOptions:n}){const i=hE(n);return f.jsx("div",{className:"ColumnWithGap",children:t.map(s=>i({fieldType:s,value:e[s.name]}))})}function l6({fieldTypes:e,fieldValues:t,...n}){return f.jsx(o6,{fieldTypes:e,fieldValues:t,createFieldOptions:n})}function mE({className:e,lNodeId:t,nodeType:n}){const[i,s]=S.useState(),l=l4(),c=s4(),{getModifiedValues:d}=Ut();if(Gc("shouldRefresh",async()=>{const h=t,m=await c(h);s({values:m,id:h})},[t],{useEffect:!0}),Bo(async()=>{const h=d();return h?(await l({values:h,..._t(t)}),!0):!1}),!i||t!==i.id)return f.jsx("div",{className:e,children:f.jsx(ln,{})});if(!n.fields)throw new Error("should have fields here");return f.jsx("div",{className:he("FieldPanel WallAccent",e),children:f.jsx(l6,{fieldTypes:n.fields,fieldValues:i.values,l10nPrefix:`siteSchema.nodeTypes.${n.typeName}.fields`})})}function Ja(e){const{top:t,children:n,className:i,topClassName:s,mainClassName:l,scrollable:c,biggerOnMobile:d}=e;return f.jsxs("div",{className:he("WithTopBar",i,d&&"biggerOnMobile"),children:[f.jsx("div",{className:he("_topBar WithTopBar-top",s),children:t}),f.jsx("div",{className:he("WithTopBar-main",l,c&&"Scrollable"),children:n})]})}function c6(e){const{siteSchema:t}=St(),n=O1({lNodeId:e.documentId,limit:j3(t,e.documentType)});return f.jsx(Rr,{uploadLimitManager:n,children:f.jsx(u6,{...e})},e.documentId)}function u6({className:e,...t}){return Yc(),f.jsx(Ja,{className:he("MaxEditWidth",e),top:f.jsx(a4,{...t}),scrollable:!0,biggerOnMobile:!0,children:f.jsx(d6,{...t})})}function d6({className:e,documentId:t,documentType:n}){const i=Ut();if(!(!Vc(n)||!n.fields))return f.jsx(Rr,{parentScope:i,children:f.jsx(mE,{className:e,nodeType:n,lNodeId:t})})}const f6=ge`
|
|
380
|
-
mutation CreateDocumentOnNode(
|
|
381
|
-
$nodeId: ID!
|
|
382
|
-
$language: String!
|
|
383
|
-
$values: CreateDocumentValues
|
|
384
|
-
) {
|
|
385
|
-
createDocumentOnNode(
|
|
386
|
-
nodeId: $nodeId
|
|
387
|
-
language: $language
|
|
388
|
-
values: $values
|
|
389
|
-
) {
|
|
390
|
-
language
|
|
391
|
-
nodeId
|
|
392
|
-
}
|
|
393
|
-
}
|
|
394
|
-
`;function If(){return S.useCallback(async e=>(await Se(f6,e)).createDocumentOnNode,[])}const h6=ge`
|
|
395
|
-
mutation CreateNodeWithDocument(
|
|
396
|
-
$parentDocumentId: String!
|
|
397
|
-
$values: CreateNodeWithDocumentValues!
|
|
398
|
-
) {
|
|
399
|
-
createNodeWithDocument(
|
|
400
|
-
parentLNodeId: $parentDocumentId
|
|
401
|
-
values: $values
|
|
402
|
-
) {
|
|
403
|
-
language
|
|
404
|
-
nodeId
|
|
405
|
-
}
|
|
406
|
-
}
|
|
407
|
-
`;function m6(){return S.useCallback(async e=>(await Se(h6,e)).createNodeWithDocument,[])}function p6({closeDialog:e,parameter:{createNodeWithDocument:t,parentDocumentId:n,documentType:i}}){const{siteSchema:s}=St(),l=i.regularChildren?.map(F=>M3(s,F))??[];if(l.length===0)throw new Error(`No children ScRegularDocumentType types for '${i.typeName}'`);const c=we(),d=ya(),{showError:h}=at(),m=S.useRef(null),y=l.length>1,[v,b]=S.useState(""),[D,w]=S.useState(""),N=async()=>{let F;if(y){if(!v)return;if(F=l.find(z=>z.typeName===v),!F)throw new Error(`No children ScRegularDocumentType type for '${v}'`)}else F=l[0];await t({parentDocumentId:n,documentType:F,documentTitle:D}),e()},M=f.jsxs(f.Fragment,{children:[c([`siteSchema.nodeTypes.${i.typeName}.addChild`,"documentType.addChild"])," ",s.isMultilingual&&`(${c("common.inLanguage",{language:c(`languages.${d}`,d)})})`]}),A=f.jsx("div",{className:"CreateDocument",children:f.jsxs("form",{onSubmit:F=>{F.preventDefault(),m.current?.click()},children:[y&&f.jsx(kg,{className:"Mb4 Mt2",value:v,onChange:b,options:l.map(F=>({label:c(`siteSchema.nodeTypes.${F.typeName}.label`,F.typeName),value:F.typeName}))}),f.jsxs("label",{className:"FieldLayout",children:[f.jsx("span",{children:c("common.title")}),f.jsx(vn,{className:"CreateDocument-input",placeholder:c("common.title"),value:D,onChange:w})]})]})}),T=!(y&&v||!y),j=f.jsxs("div",{className:"ButtonBar alignRight",children:[f.jsx(de,{onClick:()=>e(),severity:"secondary",children:c("common.cancel")}),f.jsx(de,{ref:m,as:"async",disabled:T,onClick:N,insideFeedback:{label:c("common.done")},onError:h,children:c("common.validate")})]});return{header:M,content:A,footer:j}}function uf({closeDialog:e,parameter:{createDocumentOnNode:t,language:n,nodeId:i,documentType:s,parentLanguages:l}}){const c=we(),[d,h]=S.useState(""),{showError:m}=at(),y=S.useRef(null),v=c("common.translateDocumentInto",{language:c(`languages.${n}`,n)}),b=async()=>{await t({newLanguage:n,nodeId:i,title:d,documentType:s}),e()};if(s.typeName!=="home"&&!l.includes(n)){const N=f.jsx("div",{className:"CreateDocument",children:f.jsx("p",{children:c("TranslateDocumentDialog.parentNotTranslated")})}),M=f.jsx(de,{onClick:()=>e(),severity:"secondary",children:c("common.cancel")});return{header:v,content:N,footer:M}}const D=f.jsx("form",{className:"CreateDocument",onSubmit:N=>{N.preventDefault(),y.current?.click()},children:f.jsxs("label",{className:"FieldLayout",children:[f.jsx("span",{children:c("common.title")}),f.jsx(vn,{placeholder:c("common.title"),value:d,onChange:N=>h(N)})]})}),w=f.jsxs(f.Fragment,{children:[f.jsx(de,{onClick:()=>e(),severity:"secondary",children:c("common.cancel")}),f.jsx(de,{ref:y,as:"async",onClick:b,insideFeedback:{label:c("common.done")},onError:m,children:c("common.validate")})]});return{header:v,content:D,footer:w}}function pE({data:e,limit:t,total:n,contentLanguage:i,visibleFieldTypes:s,createDocumentOnNode:l,refreshData:c}){const d=we(),h=Wt(),{siteSchema:m}=St(),y=gs(),v=na(),b=(U,ae)=>U.includes(ae),D=U=>{const ae=U.map(Q=>f.jsx(So,{severity:"info",className:"square",children:Q},Q));return f.jsxs("div",{className:"LanguageBadges",children:[...ae]})},w=U=>{const ae=U.publishDate?new Date(U.publishDate):void 0,Q=ae&&ae.getTime()<Date.now(),ie=U.ready?Q?`${d("common.published")}`:`${d("common.scheduled")}`:`${d("common.draft")}`;return b(U.translatedInto,i)?f.jsx(So,{severity:U.ready?Q?"success":"contrast":"secondary",children:ie}):void 0},N=U=>U.isTranslatedInContentLanguage?"":"unselectable",M=(U,ae,Q,ie)=>{const R=Tr(m,Q);return f.jsx(de,{className:"DocumentTable-translateButton small",onClick:()=>{y(uf,{createDocumentOnNode:l,language:ae,nodeId:U,documentType:R,parentLanguages:ie})},children:d("common.translate")})},A=(U,ae)=>{if(!U.isTranslatedInContentLanguage)return;const Q=U.lNodeWrap,ie=_t(Q.lNodeId),R=Bn({documentType:Tr(m,Q.typeName),language:Q.language,documentNodeId:ie.nodeId},"edit");if(ae.metaKey||ae.ctrlKey){window.open(`${ii(R)}`,"_blank");return}h(R)},T=[];if(s)for(const U of Object.keys(s))s[U].forEach(ae=>{T.push({key:ae.name,header:d(`siteSchema.nodeTypes.${U}.fields.${ae.name}.label`)})});const j=U=>{const ae=U.fieldValues;if(!ae||!s)return{};const Q={};for(const ie of Object.keys(s))for(const R of s[ie]){const W=ae[R.name];Q[R.name]=W?f.jsx("div",{children:y6(W,i)},R.name):void 0}return Q},F=e.map(U=>{const{nodeId:ae}=_t(U.lNodeId);return{lNodeId:U.lNodeId,thumbnail:U.featuredImageThumb?g6(U.featuredImageThumb):"",title:U.title,languages:D(U.translatedInto),status:w(U),publishDate:U.publishDate?Oo(U.publishDate,v):"",updatedAt:Oo(U.updatedAt,v),leatfType:U.typeName,lNodeWrap:U,translateButton:U.translatedInto.includes(i)?void 0:M(ae,i,U.typeName,U.parentLanguages),isTranslatedInContentLanguage:b(U.translatedInto,i),visibleFieldElements:j(U)}}),[z,P]=S.useState(!1),[E,L]=S.useState({first:0,rows:t}),_=async()=>{P(!0);const U=E.sortField?[{fieldName:E.sortField,direction:E.sortOrder===-1?"desc":"asc"}]:void 0;await c({limit:t,offset:E.first,sorting:U}),P(!1)},Y=({first:U,rows:ae})=>{L(Q=>({...Q,first:U,rows:ae}))},Z=({field:U,order:ae})=>{L(Q=>({...Q,first:0,sortField:U,sortOrder:ae}))};return ct(_,[E]),f.jsx("div",{className:"card DocumentTableWrapper",children:f.jsxs(Po,{loading:z,value:F,className:"DocumentTable",paginator:!0,rows:t,onRowClick:A,rowClassName:N,dataKey:"lNodeId",totalRecords:n,totalLabel:d("common.documents"),first:E.first,onPage:Y,onSort:Z,sortField:E.sortField,sortOrder:E.sortOrder,children:[f.jsx(it,{bodyClassName:"DocumentTable-column",body:U=>U.thumbnail}),f.jsx(it,{bodyClassName:"DocumentTable-column",field:"title",header:d("common.title"),sortable:!0}),m.isMultilingual&&f.jsx(it,{header:d("DocumentListPanel.translations"),body:U=>U.languages}),f.jsx(it,{header:d("DocumentListPanel.status"),body:U=>U.status}),f.jsx(it,{field:"publishDate",header:d("common.publishDate"),sortable:!0}),f.jsx(it,{field:"updatedAt",header:d("DocumentTable.lastModified"),sortable:!0}),f.jsx(it,{body:U=>U.translateButton}),T.map(U=>f.jsx(it,{header:U.header,body:ae=>ae.visibleFieldElements[U.key]},U.key))]})})}function g6(e){return f.jsx("img",{className:"DocumentTable-thumbnailColumn",src:e.url,width:e.width,height:e.height,alt:""})}function y6(e,t){const{value:n}=jc(e);if(n===void 0)return"";if(typeof n=="string")return n;if(typeof n=="number")return n.toString();if(typeof n=="boolean")return n?"✔":"✗";if(yc(n))return JSON.stringify(n.j).substring(0,20);if(ID(n))return"(img)";if(kc(n))return n.t.map(i=>zD(i,t).title).join(", ");throw new Error("Unknown field value type")}const v6=ge`
|
|
408
|
-
mutation ReorderParts($nodeIds: [String!]!, $parentNodeId: String!, $listName: String!) {
|
|
409
|
-
reorderParts(nodeIds: $nodeIds, parentNodeId: $parentNodeId, listName: $listName)
|
|
410
|
-
}
|
|
411
|
-
`;function b6(){return S.useCallback(async e=>(await Se(v6,e)).reorderParts,[])}const S6=ge`
|
|
412
|
-
mutation ReorderDocuments($nodeIds: [String!]!, $parentNodeId: String!) {
|
|
413
|
-
reorderDocuments(nodeIds: $nodeIds, parentNodeId: $parentNodeId)
|
|
414
|
-
}
|
|
415
|
-
`;function x6(){return S.useCallback(async e=>(await Se(S6,e)).reorderDocuments,[])}function w6({closeDialog:e,parameter:{pagedDocuments:t,parentDocumentId:n,refreshPagedDocuments:i,title:s}}){const[l,c]=S.useState([]),[d,h]=S.useState([]),[m,y]=S.useState(!1),{showError:v}=at(),b=x6(),D=we(),w=na();S.useEffect(()=>{const F=t.items.map(z=>({title:z.title,lNodeId:z.lNodeId,date:z.publishDate?Oo(z.publishDate,w):""}));h(F),c(F)},[t]);const N=()=>{if(l.length!==d.length)return!0;for(let F=0;F<l.length;++F){const z=l[F],P=d[F];if(z.lNodeId!==P.lNodeId)return!0}return!1};async function M(){await b({nodeIds:d.map(F=>_t(F.lNodeId).nodeId),parentNodeId:_t(n).nodeId}),await i({limit:50,offset:0}),e()}const A=F=>f.jsxs("div",{className:"ReorderDocumentList-row",children:[f.jsx("span",{className:"ReorderDocumentList-title",children:F.title}),f.jsx("span",{className:"ReorderDocumentList-date",children:F.date})]}),T=f.jsx("div",{className:"ReorderDocumentList",children:f.jsx(Fg,{items:d,onReorder:h,keyField:"lNodeId",direction:"column",renderItem:A})}),j=f.jsxs("div",{className:"ButtonBar alignRight",children:[f.jsx(de,{onClick:()=>e(),severity:"secondary",children:D("common.cancel")}),f.jsx(de,{as:"async",disabled:!m,onClick:M,insideFeedback:{label:D("common.saved")},onError:v,children:D("common.save")})]});return S.useEffect(()=>{y(N())},[d]),{header:s,content:T,footer:j}}function D6({className:e,documentId:t,documentType:n,onAddButtonChange:i}){const l=Wt(),c=m6(),d=If(),h=we(),{siteSchema:m}=St(),y=gs(),{language:v}=_t(t),[b,D]=S.useState(),[w,N]=S.useState(!1),M=I4(),A={};if(n.regularChildren){const Z=n.regularChildren;for(const U of Z){const Q=Tr(m,U).fields?.filter(ie=>ie.dataType!=="json"&&ie.renderAs!=="html"&&ie.storedAs!=="mediaHandle")??[];A[U]=Q}}const T=async({offset:Z=0,limit:U=50,sorting:ae,missingInLanguage:Q=w}={})=>{const ie=await M({parentDocumentId:t,limit:U,offset:Z,sorting:ae,missingInLanguage:Q});D(ie)},j=async({nodeId:Z,newLanguage:U,title:ae,documentType:Q})=>{await d({nodeId:Z,language:U,values:{title:ae,slug:ae?Er(ae):void 0}}),l(Bn({language:U,documentNodeId:Z,documentType:Q},"edit"))},F=S.useCallback(async({parentDocumentId:Z,documentType:U,documentTitle:ae})=>{const Q=await c({parentDocumentId:Z,values:{typeName:U.typeName,title:ae,slug:Er(ae)}});l(Bn({language:Q.language,documentNodeId:Q.nodeId,documentType:U},"edit"))},[c,l]);ct(T,[v,n.kebabName,w]);const z=n.childLimit===void 0||(b?b.items.length<n.childLimit:!0),P=h([`siteSchema.nodeTypes.${n.typeName}.addChild`,"documentType.addChild"]),E=h("common.inLanguage",{language:h(`languages.${v}`,v)}),L=m.isMultilingual?`${P} (${E})`:P;if(S.useEffect(()=>{if(i){if(!z){i(void 0);return}i(f.jsx(de,{onClick:()=>{y(p6,{parentDocumentId:t,createNodeWithDocument:F,documentType:n})},children:L}))}},[z,i,L,t,y,F,n]),!b)return f.jsx(ln,{});const _=[{value:"translated",label:h("DocumentListPanel.translated")},{value:"notTranslated",label:h("DocumentListPanel.notTranslated")}],Y=h("ReorderDocumentDialog.changeDisplayOrder");return f.jsx("div",{className:e,children:f.jsxs("div",{className:"MainContent",children:[m.isMultilingual&&f.jsx("div",{className:"DocumentListPanel-filters",children:f.jsx(kg,{value:w?"notTranslated":"translated",onChange:Z=>N(Z==="notTranslated"),options:_})}),b.items.length===0&&w?f.jsx("p",{className:"DocumentListPanel-emptyState",children:h("DocumentListPanel.allTranslated")}):f.jsx(pE,{visibleFieldTypes:A,data:b.items,limit:50,total:b.total,contentLanguage:v,createDocumentOnNode:j,refreshData:T}),n.regularChildrenSorting==="manual"&&b.items.length>=2&&f.jsx("div",{className:"DocumentListPanel-actions",children:f.jsx(de,{severity:"secondary",onClick:()=>{y(w6,{pagedDocuments:b,parentDocumentId:t,refreshPagedDocuments:T,title:Y})},children:Y})})]})})}function Lr({title:e,actionElement:t,className:n}){return f.jsxs("div",{className:he("TitleBar",n),children:[f.jsx("div",{className:"TitleBar-title",children:e}),t&&f.jsx("div",{className:"TitleBar-action",children:t})]})}function N6({className:e,documentId:t,documentType:n,action:i}){const s=we(),l=jy(),[c,d]=S.useState();ct(async()=>{const m=await l({documentId:t});if(m.node.typeName!==n.typeName){on.error(`Document type mismatch: ${m.node.typeName} ≠ ${n.typeName}`),rn.emit("404");return}d(m)},[t]);const h=c?c.withData?c.title??s("NavBar.noTitle"):s(`siteSchema.nodeTypes.${n.typeName}.label`,n.typeName):f.jsx(ln,{});return f.jsx(Lr,{className:he("BarAccent",e),title:h,actionElement:i})}function C6({className:e,...t}){const[n,i]=S.useState();return f.jsx(Ja,{className:e,scrollable:!0,top:f.jsx(N6,{...t,action:n}),children:f.jsx(D6,{...t,onAddButtonChange:i})})}function gE(e,t){if(e.typeName===t)return e;const n=e.children?.[t];if(n)return n;if(e.children)for(const i of Object.values(e.children)){const s=gE(i,t);if(s)return s}}function E6({routingChildTypes:e,contentLanguage:t,documentNodeId:n,documentType:i}){const s=Wt(),{t:l}=Pt(),c=na(),d=S.useId(),h=A1(),[m,y]=S.useState();ct(async()=>{if(!O3(i))return;const b=await h(n);y(b)},[n,h,i]);const v=S.useMemo(()=>m?e.map(b=>{const D=gE(m,b.typeName);if(!D)return;const w=Bn({documentType:b,documentNodeId:D.nodeId,language:t},b.adminUi?.defaultTab);return{key:b.typeName,label:l(`siteSchema.nodeTypes.${b.typeName}.label`,b.typeName),url:ii(w),command:()=>{s(w)}}}).filter(qa):[],[m,e,t,c]);if(e.length!==0)return f.jsx("div",{className:"ChildRoutingDocuments",children:f.jsx(mf,{items:v,id:d,children:f.jsx(de,{severity:"secondary","aria-label":l("NavBar.openListOfParts"),children:f.jsx(rD,{size:18})})})})}function yE({closeDialog:e,parameter:{language:t,nodeId:n}}){const i=we(),s=lB(),{showError:l}=at(),c=async()=>{const m=await s({language:t,nodeId:n});e({done:!0,partId:m})},d=i("common.translatePartInto",{language:i(`languages.${t}`,t)}),h=f.jsxs(f.Fragment,{children:[f.jsx(de,{onClick:()=>e(),severity:"secondary",children:i("common.cancel")}),f.jsx(de,{as:"async",onClick:c,insideFeedback:{label:i("common.done")},onError:l,children:i("common.validate")})]});return{header:d,footer:h}}function A6({tabName:e,documentType:t,contentLanguage:n,documentId:i,partNodeId:s,docData:l,partLanguages:c}){const d=Wt(),{siteSchema:h}=St(),[m,y]=S.useState(n),v=na(),b=If(),D=ia(),w=gs(),N=ci(),M=z=>l.languages.includes(z),A=async({newLanguage:z,title:P,nodeId:E})=>{await b({nodeId:E,language:z,values:{title:P,slug:P?Er(P):void 0}}),d(Bn({documentType:t,language:z,documentNodeId:E},"edit"))},T=async z=>{if(z!==m&&e!=="childDocuments"){if(e==="parts"){if(s===void 0||!c||c.includes(z))return;const P=await D(yE,{language:z,nodeId:s});P?.done&&d($o({documentType:t,language:z,documentNodeId:_t(i).nodeId,partNodeId:_t(P.partId).nodeId}))}else if(e==="edit"){if(M(z))return;w(uf,{language:z,createDocumentOnNode:A,nodeId:_t(i).nodeId,documentType:t,parentLanguages:l.parentLanguages})}}};S.useEffect(()=>{y(n)},[n]);const j=S.useMemo(()=>h.languages.map(z=>{const P=M(z);let E;return P&&(e==="childDocuments"?E=Bn({documentType:t,language:z,documentNodeId:_t(i).nodeId},"childDocuments"):e==="parts"&&(!c||c.includes(z))?E=$o({documentType:t,language:z,documentNodeId:_t(i).nodeId,partNodeId:s}):e==="edit"&&(E=Bn({documentType:t,language:z,documentNodeId:_t(i).nodeId},"edit"))),{language:z,isDocTranslated:P,url:E,disabled:e!=="edit"&&!P,canBeTranslated:!E&&e==="edit"}}),[h,v,e,t,i,s,l,c]),F=N(async z=>{const P=j.find(E=>E.language===z);P&&(P.url?(d(P.url),y(z)):await T(z))});return f.jsx(pf,{value:m,onChange:F,variant:"pill",children:j.map(({language:z,disabled:P,canBeTranslated:E})=>f.jsx(Co,{value:z,label:z,disabled:P,className:he({missing:E})},z))})}function M6({documentType:e,lNodeWrap:t}){const n=we(),i=Wt(),s=Ge(d=>d.appLayout),l=(d,h)=>d??(Vc(h)?n("NavBar.noTitle"):n(`siteSchema.nodeTypes.${h.typeName}.label`,h.typeName)),c=[];if(s==="mobile"){const d=t.breadcrumb;let h="/";if(d.length>=2){const m=d[d.length-2];h=Bn({language:m.language,documentNodeId:m.nodeId,documentType:m.documentType},m.documentType.adminUi?.defaultTab)}c.push({label:"",icon:f.jsx(aD,{size:16}),onClick:()=>i(h)})}else{for(let d=0;d<t.breadcrumb.length-1;++d){const{language:h,nodeId:m,documentType:y,title:v}=t.breadcrumb[d],b=Bn({language:h,documentNodeId:m,documentType:y},y.adminUi?.defaultTab);c.push({label:l(v,y),onClick:()=>i(b)})}c.push({label:l(t.documentTitle,e)})}return f.jsx(gD,{items:c})}function T6({documentType:e,lNodeWrap:t,contentLanguage:n,tabName:i}){const s=Wt(),{t:l}=Pt(),c=na(),d=If(),h=gs(),m=A=>t.languages.includes(A),y=Bn({documentType:e,documentNodeId:t.nodeId,language:n},"edit"),v=Bn({documentType:e,documentNodeId:t.nodeId,language:n},"childDocuments"),b=$o({documentType:e,documentNodeId:t.nodeId,language:n}),D=async({nodeId:A,newLanguage:T,title:j})=>{await d({nodeId:A,language:T,values:{title:j,slug:j?Er(j):void 0}}),s(e.fields?y:b)},w=S.useMemo(()=>{const A=[];if(e.regularChildren&&A.push({id:"childDocuments",label:l("common.Documents"),url:v,needsTranslation:!1,onClick:()=>s(v)}),Vc(e)){if(e.lists){const T=m(n);A.push({id:"parts",label:l("NavBar.parts"),url:b,needsTranslation:!T,onClick:()=>{T?s(b):h(uf,{createDocumentOnNode:D,language:n,nodeId:t.nodeId,documentType:e,parentLanguages:t.parentLanguages})}})}if(!e.redirectTo){const T=m(n);A.push({id:"edit",label:l("common.edit"),url:y,needsTranslation:!T,onClick:()=>{T?s(y):h(uf,{createDocumentOnNode:D,language:n,nodeId:t.nodeId,documentType:e,parentLanguages:t.parentLanguages})}})}}return A},[e,t,n,c]),N=i??w[0]?.id,M=A=>{const T=w.find(j=>j.id===A);T&&T.onClick()};return f.jsx(pf,{className:"DocumentTabMenu",value:N,onChange:M,children:w.map(A=>A.needsTranslation?f.jsx(gf,{content:l("app.tooltipTranslateMessage",{language:l(`app.languages.${n}`)}),children:f.jsx(Co,{value:A.id,label:A.label,className:he({missing:A.needsTranslation})})},A.id):f.jsx(Co,{value:A.id,label:A.label},A.id))})}const j6=ge`
|
|
416
|
-
query DocumentNavbarData($lNodeId: ID!) {
|
|
417
|
-
lNodeWrap(lNodeId: $lNodeId) {
|
|
418
|
-
nodeId
|
|
419
|
-
breadcrumb {
|
|
420
|
-
language
|
|
421
|
-
nodeId
|
|
422
|
-
typeName
|
|
423
|
-
title
|
|
424
|
-
}
|
|
425
|
-
document {
|
|
426
|
-
title
|
|
427
|
-
}
|
|
428
|
-
translations {
|
|
429
|
-
language
|
|
430
|
-
}
|
|
431
|
-
parentLanguages
|
|
432
|
-
}
|
|
433
|
-
}
|
|
434
|
-
`;function k6(){const{siteSchema:e}=St();return S.useCallback(async t=>{const n=await Se(j6,{lNodeId:t},{undefOn404:!0});return n?$6(e,n):void 0},[e])}function $6(e,t){const{lNodeWrap:n}=t;return{nodeId:n.nodeId,language:n.language,breadcrumb:n.breadcrumb.map(i=>({nodeId:i.nodeId,language:i.language,documentType:Tr(e,i.typeName),title:i.title??void 0})),languages:n.translations.map(i=>i.language),parentLanguages:n.parentLanguages,documentTitle:n.document?.title??void 0}}const O6=ge`
|
|
435
|
-
query PartTranslations($nodeId: ID!) {
|
|
436
|
-
translationsOf(nodeId: $nodeId)
|
|
437
|
-
}
|
|
438
|
-
`;function R6(){return S.useCallback(async e=>(await Se(O6,{nodeId:e},{undefOn404:!0}))?.translationsOf,[])}function L6({className:e,documentId:t,documentType:n,partNodeId:i,contentLanguage:s,tabName:l}){const{siteSchema:c}=St(),d=k6(),h=R6(),[m,y]=S.useState(),[v,b]=S.useState(),D=(n.routingChildren??[]).map(w=>v1(c,w));return ct(async()=>{const w=await d(t);if(!w){rn.emit("404");return}y(w)},[t]),ct(async()=>{const w=i===void 0?void 0:await h(i);b(w)},[i]),m?f.jsxs("div",{className:he("PaNavbar",e),children:[f.jsxs("div",{className:"PaNavbar-group",children:[f.jsx("div",{className:"PaNavbar-item",children:f.jsx(M6,{documentType:n,lNodeWrap:m})}),f.jsx("div",{className:"PaNavbar-item",children:f.jsx(E6,{documentNodeId:m.nodeId,documentType:n,routingChildTypes:D,contentLanguage:s})})]}),f.jsxs("div",{className:"PaNavbar-group",children:[f.jsx("div",{className:"PaNavbar-item alignBottom",children:f.jsx(T6,{documentType:n,contentLanguage:s,lNodeWrap:m,tabName:l})}),c.isMultilingual&&f.jsx("div",{className:"PaNavbar-item",children:f.jsx(A6,{documentType:n,documentId:t,partNodeId:i,contentLanguage:s,tabName:l,docData:m,partLanguages:i===void 0?void 0:v})})]})]}):f.jsx(ln,{})}function P6({part:e,className:t}){const{partId:n,partType:i}=e,s=Ut(),{siteSchema:l}=St(),c=O1({lNodeId:n,limit:k3(l,i)});if(Yc(),!!i.fields)return f.jsx(Rr,{parentScope:s,uploadLimitManager:c,children:f.jsx(mE,{className:t,nodeType:i,lNodeId:n})})}function I6({closeDialog:e,parameter:{part:t}}){const n=we(),i=uB(),{showError:s}=at(),l=async()=>{await i(t.partId),e({done:!0})},c=n("common.deletion"),d=f.jsx("div",{className:"DeletePart",children:f.jsx("p",{children:n([`siteSchema.nodeTypes.${t.partType.typeName}.confirmItemDeletion`,"list.confirmItemDeletion"])})}),h=f.jsxs("div",{className:"ButtonBar alignRight",children:[f.jsx(de,{severity:"secondary",onClick:()=>e({done:!1}),children:n("common.cancel")}),f.jsx(de,{as:"async",severity:"danger",onClick:l,insideFeedback:{label:n("common.done")},onError:s,children:n("common.validate")})]});return{header:c,content:d,footer:h}}function vE(e,t,n){const{partType:i}=t,s=e.t(`siteSchema.nodeTypes.${i.typeName}.label`,i.typeName);return`${t.number}. ${s}`}function Py({part:e,parentList:t,className:n}){const i=we(),s=ya(),l=vE({t:i},e),c=z6(e,s);return f.jsxs("div",{className:`PartCard ${n||""}`,children:[f.jsx("div",{className:"PartCard-title",children:l}),c.length>0&&f.jsx("div",{className:"PartCard-fields",children:c.map(d=>f.jsx("div",{className:"PartCard-field",children:d.content},d.name))})]})}function z6(e,t){if(e.kind==="placeholder"||!e.partType.fields)return[];const n=[];for(const i of e.partType.fields){if(!_6(i))continue;const s=e.fieldValues[i.name],{value:l,text:c}=jc(s);let d;if(i.storedAs==="labeling"){if(!l||!kc(l))continue;const h=l.t.map(m=>uk(m.title,t)).join(", ");h&&(d=h)}else if(i.renderAs==="html"){if(!c?.excerpt)continue;d=c.excerpt}else if(i.dataType==="media"){if(!l)continue;ID(l)&&(d=f.jsx(F6,{handle:l.h}))}else if(typeof l!="object"){if(!l)continue;const h=typeof l=="string"?l:typeof l=="number"?String(l):typeof l=="boolean"?l?"✓":"✗":void 0;h!==void 0&&(d=h)}if(d&&n.push({name:i.name,content:d}),n.length>=2)break}return U6(n)}function _6(e){const t=e.adminUi?.showInCard;return t===!0?!0:t===!1||e.dataType==="gallery"?!1:e.plugin===void 0||e.renderAs==="html"}function U6(e){const t=[];let n;for(const i of e){if(typeof i.content!="string"){t.push(i),n=void 0;continue}n?n.content+=` • ${i.content}`:(n={...i},t.push(n))}for(const i of t)typeof i.content=="string"&&(i.content=f.jsx("span",{className:"PartCard-textField",children:B6(i.content,60)}));return t}function B6(e,t){return e.length<=t?e:`${e.substring(0,t-1)}…`}function F6({handle:e}){const[t,n]=S.useState(),i=eE();return ct(async()=>{const s=await i(e);s?.kind==="image"&&n(s.thumb)},[e]),t?f.jsx("img",{className:"PartCard-image",src:t.url,width:t.width,height:t.height,alt:""}):null}const H6=ge`
|
|
439
|
-
mutation CreateNodeWithPart(
|
|
440
|
-
$parentLNodeId: String!
|
|
441
|
-
$listName: String!
|
|
442
|
-
$typeName: String!
|
|
443
|
-
) {
|
|
444
|
-
createNodeWithPart(
|
|
445
|
-
parentLNodeId: $parentLNodeId,
|
|
446
|
-
listName: $listName
|
|
447
|
-
typeName: $typeName
|
|
448
|
-
) { partId }
|
|
449
|
-
}
|
|
450
|
-
`;function q6(){return S.useCallback(async e=>(await Se(H6,e)).createNodeWithPart.partId,[])}const V6=ge`
|
|
451
|
-
mutation MovePart(
|
|
452
|
-
$partNodeId: String!
|
|
453
|
-
$newParentNodeId: String!
|
|
454
|
-
$newListName: String!
|
|
455
|
-
) {
|
|
456
|
-
movePart(
|
|
457
|
-
partNodeId: $partNodeId,
|
|
458
|
-
newParentNodeId: $newParentNodeId
|
|
459
|
-
newListName: $newListName
|
|
460
|
-
)
|
|
461
|
-
}
|
|
462
|
-
`;function K6(){return S.useCallback(async e=>{await Se(V6,e)},[])}function G6({closeDialog:e,parameter:{part:t,documentLists:n,documentNodeId:i}}){const s=K6(),l=we(),{siteSchema:c}=St(),[d,h]=S.useState(""),[m,y]=S.useState([]),[v,b]=S.useState(),[D,w]=S.useState([]),{showError:N}=at();S.useEffect(()=>{const P=Y6(n,i,t.partType.typeName,c,l,t.nodeId);y(P)},[n,i,t.partType.typeName,t.nodeId,c,l]),S.useEffect(()=>{if(!d.trim()){w(m);return}const P=d.toLowerCase(),E=SE(m,P);w(E)},[m,d]);const M=async()=>{if(!v)return;const P=m.map(E=>Cg(E,v)).find(Boolean);!P?.data.listName||!P?.data.nodeId||(await s({partNodeId:t.nodeId,newParentNodeId:P.data.nodeId,newListName:P.data.listName}),e({done:!0}))},A=v&&m.some(P=>Cg(P,v)?.data.isCompatible),T=P=>{const E=P,{data:L}=E;return L?.type==="list"&&L.part&&L.parentList?f.jsx("div",{className:"move-part-tree-node",children:f.jsx(Py,{part:L.part,parentList:L.parentList,className:"move-part-tree-card"})}):f.jsx("div",{className:"move-part-tree-node",children:f.jsx("span",{className:P.className,children:P.label})})},j=l("movePart.title"),F=f.jsxs("div",{className:"move-part-dialog",children:[f.jsxs("label",{className:"search-section",children:[f.jsx("span",{className:"search-label",children:l("movePart.searchPlaceholder")}),f.jsx(vn,{value:d,onChange:h,placeholder:l("movePart.searchPlaceholder"),className:"WFull"})]}),f.jsx("div",{className:"tree-section",children:f.jsx(wD,{value:D,selectionMode:"single",selection:v?{[v]:!0}:{},onSelectionChange:P=>{const E=Object.keys(P)[0];b(E)},nodeTemplate:T,className:"WFull"})})]}),z=f.jsxs("div",{className:"dialog-actions",children:[f.jsx(de,{onClick:()=>e(void 0),severity:"secondary",children:l("common.cancel")}),f.jsx(de,{as:"async",onClick:M,disabled:!A,insideFeedback:{label:l("common.done")},onError:N,children:l("common.save")})]});return{header:j,content:F,footer:z}}function Y6(e,t,n,i,s,l){const c=[];for(const d of e){const h=d.listType.parts.includes(n),m={key:`list_${d.listType.listName}_${t}`,label:s(`siteSchema.nodeTypes.${d.listType.listName}.label`,d.listType.listName),icon:f.jsx(lD,{size:14}),className:h?"text-primary":"text-gray-400",children:bE(d,n,i,s,l),data:{listName:d.listType.listName,nodeId:t,isCompatible:h,isDocument:!0,type:"list",part:void 0,parentList:void 0}};c.push(m)}return c}function bE(e,t,n,i,s){const l=[];for(const c of e.parts)if(c.nodeId!==s&&c.subList){const d=J6(c.subList,c,t,n,i,s);l.push(...d)}return l}function J6(e,t,n,i,s,l){const c=e.listType.parts.includes(n);return[{key:`list_${e.listType.listName}_${e.parentNodeId}`,label:X6(t,s),icon:f.jsx(lD,{size:14}),className:c?"text-primary":"text-gray-400",children:bE(e,n,i,s,l),data:{listName:e.listType.listName,nodeId:e.parentNodeId,isCompatible:c,type:"list",part:t,parentList:e}}]}function X6(e,t){return e.kind==="placeholder"?t("part.placeholder"):`${e.partType.typeName} #${e.number}`}function SE(e,t){return e.map(n=>W6(n,t)).filter(Boolean)}function W6(e,t){const i=(typeof e.label=="string"?e.label:"").toLowerCase().includes(t),s=e.children?SE(e.children,t):[];if(i||s.length>0)return{...e,children:s}}function Cg(e,t){if(e.key===t)return e;if(e.children)for(const n of e.children){const i=Cg(n,t);if(i)return i}}function Q6(e){return f.jsx(Cn,{children:f.jsx(Z6,{...e})})}function Z6({part:e,documentId:t,documentType:n,save:i,disabled:s,documentParts:l}){const c=we(),{showError:d}=at(),h=N1(),{emit:m}=Ut(),y=Ge(A=>A.appLayout),v=ia(),b=async()=>{if((await v(I6,{part:e}))?.done){m("shouldRefresh");const T=$o({documentId:t,documentType:n});await h(T,{replace:!0})}},D=async()=>{if(!l)return;const{nodeId:A}=_t(t);(await v(G6,{part:e,documentLists:l.lists,documentNodeId:A}))?.done&&m("shouldRefresh")},w=async()=>{(await v(Y1,{dialogTitle:c("part.setPublishDate"),lNodeId:e.partId,ready:e.ready,publishDate:e.publishDate}))?.done&&(await i(),m("shouldRefresh"))},N=async()=>{(await v(J1,{lNodeId:e.partId,typeName:e.partType.typeName}))?.done&&m("shouldRefresh")},M=()=>{const A=[];return A.push({icon:f.jsx(sD,{size:16}),label:c("part.setPublishDate"),command:w}),A.push({icon:f.jsx(yT,{size:16}),label:c("VersionHistoryDialog.title"),command:N}),l&&A.push({icon:f.jsx(eT,{size:16}),label:c("movePart.menuLabel"),command:D}),(!e.subList||e.subList.parts.length===0)&&A.push({icon:f.jsx(pc,{size:16}),label:c("common.delete"),command:b}),A};return f.jsxs(f.Fragment,{children:[f.jsx(En,{}),f.jsx(Og,{as:"async",icon:f.jsx(dD,{size:16}),onClick:i,insideFeedback:{label:c("common.saved"),autoDismiss:!0},onError:d,items:M(),disabled:s,children:y==="mobile"?"":c("common.save")})]})}function eF({className:e,documentTitle:t,part:n,list:i,documentId:s,documentType:l,documentParts:c}){const d=Ay(),h=we(),{emit:m,saveAll:y}=Ut(),v=async()=>{await y()&&m("shouldRefresh")};return f.jsxs("div",{className:he("PartControlBar","BarAccent",e),children:[f.jsx("div",{className:"PartControlBar-left",children:f.jsx("div",{className:"PartControlBar-docTitle",children:t})}),f.jsxs("div",{className:"PartControlBar-main",children:[f.jsxs("div",{className:"SimpleBar gap",children:[n&&i&&f.jsx("span",{className:"PartControlBar-partTitle",children:vE({t:h},n)}),n&&n.kind==="part"&&f.jsx(V1,{publishDate:n.publishDate,scheduled:n.scheduled})]}),f.jsx("div",{className:"SimpleBar",children:n&&n.kind==="part"&&f.jsx(Q6,{part:n,documentId:s,documentType:l,save:v,disabled:d,documentParts:c})})]})]})}function tF({part:e,className:t}){const n=we(),i=ci(),{emit:s}=Ut(),l=ia(),c=async()=>{(await l(yE,{language:e.language,nodeId:e.nodeId}))?.done&&s("shouldRefresh")};return f.jsx("div",{className:t,children:f.jsx("div",{className:"MainContent PartPlaceholderPanel",children:f.jsx(de,{onClick:i(c),children:n("common.translate")})})})}const nF=ge`
|
|
463
|
-
query LNodeWrap(
|
|
464
|
-
$documentId: ID!
|
|
465
|
-
) {
|
|
466
|
-
partsOf(documentId: $documentId) {
|
|
467
|
-
... on Part {
|
|
468
|
-
__typename
|
|
469
|
-
listName
|
|
470
|
-
parentNodeId
|
|
471
|
-
typeName
|
|
472
|
-
nodeId
|
|
473
|
-
publishDate
|
|
474
|
-
orderNum
|
|
475
|
-
partId
|
|
476
|
-
language
|
|
477
|
-
ready
|
|
478
|
-
scheduled
|
|
479
|
-
fieldValues(preprocess: { replaceWithExcerpt: true })
|
|
480
|
-
}
|
|
481
|
-
... on PartPlaceholder {
|
|
482
|
-
__typename
|
|
483
|
-
listName
|
|
484
|
-
parentNodeId
|
|
485
|
-
typeName
|
|
486
|
-
nodeId
|
|
487
|
-
publishDate
|
|
488
|
-
orderNum
|
|
489
|
-
}
|
|
490
|
-
}
|
|
491
|
-
}
|
|
492
|
-
`;function aF(){const{siteSchema:e}=St();return S.useCallback(async({documentType:t,documentId:n})=>{const i=await Se(nF,{documentId:n});return iF(e,i,{documentId:n,documentType:t})},[e])}function iF(e,t,{documentId:n,documentType:i}){const{language:s}=_t(n),l=t.partsOf??[];if(!i.lists)return{allPartsByNodeIdMap:new Map,lists:[],getParent:()=>{throw new Error("list not found")}};const c=new Map;for(const v of l){const b=Eg(v);let D=c.get(b);D||(D=[],c.set(b,D)),D.push(v)}const d=_t(n).nodeId,h=i.lists.map(v=>{const{toPartOrPlaceholder:b,getTotalByTypes:D}=wE(e,s),w=Eg({parentNodeId:d,listName:v.listName}),N=c.get(w)??[];y1(v,N);const M=N.map(b),A=D(),T={listType:v,parts:M,total:M.length,totalByTypes:A,parentNodeId:d,parentLNodeId:n,language:s,l10nPrefix:`siteSchema.nodeTypes.${i.typeName}.lists.${v.listName}`};return xE(e,c,T),T}).filter(v=>!!v),m=new Map,y=new Map;for(const v of h)DE(v,m,y);return{allPartsByNodeIdMap:m,lists:h,getParent(v){const b=y.get(v.nodeId);if(!b)throw new Error(`parent not found for part "${v.nodeId}"`);return b}}}function xE(e,t,n,i,s){const{parts:l,language:c}=n;for(const d of l){const{toPartOrPlaceholder:h,getTotalByTypes:m}=wE(e,c),y=d.partType.list;if(!y)continue;const v=Eg({parentNodeId:d.nodeId,listName:y.listName}),b=t.get(v)??[];y1(y,b);const D=b.map(h),w=m();d.subList={listType:y,parts:D,total:D.length,totalByTypes:w,parentNodeId:d.nodeId,parentLNodeId:d.kind==="part"?d.partId:void 0,language:c,l10nPrefix:`siteSchema.nodeTypes.${d.partType.typeName}.lists.${y.listName}`},xE(e,t,d.subList)}}function Eg(e){return`${e.parentNodeId}-${e.listName}`}function wE(e,t){let n=0;const i=new Map;return{toPartOrPlaceholder:l=>{const c=e.nodeTypes[l.typeName];if(!c||c.kind!=="part")throw new Error(`part type "${l.typeName}" not found`);++n;const d=(i.get(l.typeName)??0)+1;if(i.set(l.typeName,d),l.__typename==="Part")return rF(l,c,{number:n,numberOfType:d});if(l.__typename==="PartPlaceholder")return sF(l,c,{number:n,numberOfType:d},t);throw new Error(`invalid part "${l.__typename}"`)},getTotalByTypes:()=>Object.fromEntries(i)}}function rF(e,t,n){return{kind:"part",partId:e.partId,nodeId:e.nodeId,language:e.language,ready:e.ready,scheduled:e.scheduled,partType:t,...n,publishDate:e.publishDate??void 0,fieldValues:JSON.parse(e.fieldValues)}}function sF(e,t,n,i){return{kind:"placeholder",nodeId:e.nodeId,language:i,partType:t,...n,publishDate:e.publishDate??void 0}}function DE(e,t,n,i){for(const s of e.parts)t.set(s.nodeId,s),n.set(s.nodeId,{list:e,part:i}),s.subList&&DE(s.subList,t,n,s)}function oF({closeDialog:e,parameter:{list:t,title:n}}){const i=b6(),s=we(),[l,c]=S.useState([]),{showError:d}=at();S.useEffect(()=>{const v=t.parts.map((b,D)=>({key:String(D),part:b}));c(v)},[t]);const h=async()=>{await i({nodeIds:l.map(({part:v})=>v.nodeId),listName:t.listType.listName,parentNodeId:t.parentNodeId}),e({done:!0})},m=f.jsx(f.Fragment,{children:f.jsx(Fg,{items:l,onReorder:c,keyField:"key",direction:"column",renderItem:v=>f.jsx(Py,{part:v.part,parentList:t,className:"ReorderParts-partCard"})})}),y=f.jsxs(f.Fragment,{children:[f.jsx(de,{severity:"secondary",onClick:()=>e(),children:s("common.cancel")}),f.jsx(de,{as:"async",onClick:h,insideFeedback:{label:s("common.done")},onError:d,children:s("common.confirm")})]});return{header:n,content:m,footer:y}}function lF(e){const{closeDialog:t,parameter:{l10nPrefix:n,listType:i}}=e,s=we(),l=s([`${n}.addPart`,"list.createPart"]),c=f.jsx("div",{className:"Bar",children:i.parts.map(h=>f.jsx(de,{onClick:()=>t(h),children:s(`siteSchema.nodeTypes.${h}.label`,h)},h))}),d=f.jsx("div",{className:"ButtonBar alignRight",children:f.jsx(de,{severity:"secondary",onClick:()=>t(),children:s("common.cancel")})});return{header:l,footer:d,content:c}}let Ww=0;function cF({documentId:e,documentType:t,lists:n,activePartNodeId:i}){const s=we(),l=Wt(),c=Ut(),d=mF(),h=ci(),m=ia();function y(){const{nodeId:D,language:w}=_t(e);return uF({t:s,navigate:l,documentType:t,documentNodeId:D,contentLanguage:w,addPartAction:d,scopedData:c,wrapAsync:h,openModalDialog:m,...dF(i,n)},n)}const[v,b]=S.useState(()=>y());return S.useEffect(()=>{b(y())},[e,t,n,i,s]),v}function uF(e,t){if(!t)return;const{documentNodeId:n,contentLanguage:i,activeListNames:s,documentType:l}=e;return t.map(c=>{const d=CE(e,c),{listType:h}=c,m=`siteSchema.nodeTypes.${l.typeName}.lists.${h.listName}`;return{key:`${n}:${i}:${h.listName}`,subMenu:d,label:e.t(`${m}.label`,h.listName),popupMenu:EE(e,{list:c,l10nPrefix:m}),expanded:!0,active:s.has(h.listName)}})}function dF(e,t){const n=new Set,i=[];if(e!==void 0&&t)for(const l of t){const c=NE(e,l);c.length>0&&(i.push(...c),n.add(l.listType.listName))}return{activeMap:new Map(i),activeListNames:n}}function NE(e,t){const n=[];for(const i of t.parts)if(i.nodeId===e)n.push([i.nodeId,"active"]);else if(i.subList){const s=NE(e,i.subList);s.length>0&&(n.push(...s),n.push([i.nodeId,"parent"]))}return n}function CE(e,t){return t.parts.map(n=>fF(e,n,t))}function fF(e,t,n){const i=hF(e,t,n);if(!t.subList)return i;const s=CE(e,t.subList);return i.popupMenu=EE(e,{list:t.subList,l10nPrefix:`siteSchema.nodeTypes.${t.partType.typeName}`}),s.length>0&&(i.subMenu=s,e.activeMap.get(t.nodeId)==="parent"&&(i.expanded=!0)),i}function hF(e,t,n){const i=$o({documentType:e.documentType,documentNodeId:e.documentNodeId,partNodeId:t.nodeId,language:e.contentLanguage});return{key:`${t.nodeId}:${e.contentLanguage}`,url:ii(i),command:()=>{e.navigate(i)},icon:f.jsx(uD,{size:16}),label:f.jsx(Py,{part:t,parentList:n}),active:e.activeMap.has(t.nodeId),className:t.kind}}function EE(e,{l10nPrefix:t,list:n}){const{listType:i,total:s}=n,l=[];if((i.limit===void 0||s<i.limit)&&l.push({key:`_popup-menu-${++Ww}`,label:e.t([`${t}.addPart`,"list.addPart"]),icon:f.jsx(ff,{size:16}),command:e.wrapAsync(async()=>{await e.addPartAction(e,n)})}),i.sorting==="manual"&&s>=2){const c=e.t([`${t}.reorderParts`,"list.reorderParts"]);l.push({key:`_popup-menu-${++Ww}`,label:c,icon:f.jsx(nT,{size:16}),command:e.wrapAsync(async()=>{(await e.openModalDialog(oF,{list:n,title:c}))?.done&&e.scopedData.emit("shouldRefresh")})})}return l.length>0?l:void 0}function mF(){const e=Wt(),t=q6(),n=ia(),i=async(l,{typeName:c,list:d})=>{const h=await t({parentLNodeId:_D({nodeId:d.parentNodeId,language:l.contentLanguage}),listName:d.listType.listName,typeName:c});l.scopedData.emit("invalidate"),l.scopedData.emit("shouldRefresh"),e($o({documentType:l.documentType,documentNodeId:l.documentNodeId,partId:h,language:l.contentLanguage}))};return async(l,c)=>{const{listType:d}=c;if(d.parts.length===0)throw new Error("No part node types");if(d.parts.length===1){await i(l,{typeName:d.parts[0],list:c});return}const h=await n(lF,c);h&&await i(l,{typeName:h,list:c})}}function pF(e){if(e.documentType.lists)return f.jsx(Rr,{children:f.jsx(gF,{...e})})}function gF({documentId:e,partNodeId:t,documentType:n,className:i}){const s=we(),l=aF(),c=jy(),[d,h]=S.useState(),[m,y]=S.useState(),v=cF({documentType:n,documentId:e,lists:d?.lists,activePartNodeId:t});if(y_("invalidate",()=>h(void 0),[]),Gc("shouldRefresh",async()=>{const w=await l({documentId:e,documentType:n});h(w)},[e,n],{useEffect:!0}),ct(async()=>{const w=await c({documentId:e});if(w.node.typeName!==n.typeName){on.error(`Document type mismatch: ${w.node.typeName} ≠ ${n.typeName}`),rn.emit("404");return}y(w)},[e]),!d||!v)return f.jsx(ln,{});let b;if(t!==void 0){const w=d.allPartsByNodeIdMap.get(t);if(!w){rn.emit("404");return}b=w}const D=m?m.withData?m.title??s("NavBar.noTitle"):s(`siteSchema.nodeTypes.${n.typeName}.label`,n.typeName):f.jsx(ln,{});return f.jsx(Ja,{className:he("MaxEditWidth",i),top:f.jsx(eF,{documentTitle:D,part:b,list:b?d.getParent(b).list:void 0,documentId:e,documentType:n,documentParts:d}),scrollable:!1,children:f.jsxs(D1,{className:"PartsLayoutFillHeight secondary",sideClassName:"LeftSep secondary",scrollable:!0,side:f.jsx("div",{className:"PaSidebar light",children:f.jsx("div",{className:"PaSidebar-nav",children:f.jsx(gc,{menu:v})})}),children:[b&&b.kind==="part"&&f.jsx(P6,{part:b}),b&&b.kind==="placeholder"&&f.jsx(tF,{part:b})]})})}function yF({documentType:e,documentId:t,partNodeId:n,contentLanguage:i,tabName:s}){const{siteSchema:l}=St(),c=$3(l,e.typeName)%12;return f.jsxs(Ja,{className:`_accent${c}`,scrollable:!0,top:f.jsx(L6,{tabName:s,contentLanguage:i,documentId:t,documentType:e,partNodeId:n}),children:[s==="edit"&&f.jsx(c6,{documentType:e,documentId:t}),s==="childDocuments"&&f.jsx(C6,{documentType:e,documentId:t}),s==="parts"&&f.jsx(pF,{documentType:e,documentId:t,partNodeId:n})]})}function vF(){const{requestedContentLanguage:e,isInvalid:t}=Cy(),{siteSchema:n}=St(),{documentNodeId:i,documentTypeKebabName:s,tabName:l,partNodeId:c}=Wg(),d=bF(l),h=s?T3(n,s,"document"):void 0;if(t)return;if(d==="invalid"||!h||!e||i===void 0||!s||c!==void 0&&d!=="parts"){rn.emit("404");return}if(!d)return;const m=_D({nodeId:i,language:e}),y={kind:"document",documentNodeId:i,contentLanguage:e,documentId:m,documentType:h};return f.jsx(a_,{documentNodeId:i,children:f.jsx(Or,{activeRoute:y,children:f.jsx(yF,{documentType:h,documentId:m,partNodeId:c,contentLanguage:e,tabName:d})})})}function bF(e){if(e==="edit")return"edit";if(e==="child-documents")return"childDocuments";if(e==="parts")return"parts";if(e)return"invalid"}function Iy({languages:e,contentLanguage:t,navigateLanguage:n}){return e.length<=1?null:f.jsx(pf,{value:t,onChange:i=>n(i),children:e.map(i=>f.jsx(Co,{value:i,label:i},i))})}function SF({contentLanguage:e}){const n=we(),i=ci(),s=Wt(),l=lE(),[c,d]=S.useState(),h=If(),[m,y]=xN(),v=decodeURIComponent(m.get("q")??""),[b,D]=S.useState(v),w=S.useCallback(async({offset:A,limit:T,sorting:j})=>{const F=v?await l({offset:A,limit:T,queryString:v,language:e,sorting:j}):{items:[],total:0,offset:0};d(F)},[v,e]);ct(async()=>{await w({offset:0,limit:50})},[v,e]);const N=i(async A=>{A.preventDefault(),e&&y({q:encodeURIComponent(b)})}),M=async({nodeId:A,newLanguage:T,title:j,documentType:F})=>{await h({nodeId:A,language:T,values:{title:j,slug:j?Er(j):void 0}}),s(Bn({language:T,documentNodeId:A,documentType:F},F.adminUi?.defaultTab))};return f.jsxs("div",{className:"DocumentSearch",children:[f.jsxs("form",{className:"SearchBar",onSubmit:N,children:[f.jsx("span",{className:"SearchBar-label",children:n("DocumentSearch.searchLabel")}),f.jsx(vn,{className:"SearchBar-input",icon:f.jsx(fD,{size:16}),placeholder:n("DocumentSearch.searchPlaceholder"),onChange:D,value:b})]}),f.jsx("div",{className:"DocumentSearch-table",children:c&&f.jsx(pE,{data:c.items,limit:50,total:c.total,contentLanguage:e,createDocumentOnNode:M,refreshData:w})})]})}function xF(){return f.jsx(Or,{activeRoute:{kind:"home"},children:f.jsx(wF,{})})}function wF(){const{requestedContentLanguage:e,isInvalid:t}=Cy(),n=we(),{siteSchema:i}=St(),s=ya(),l=Wt(),c=Ra();if(S.useEffect(()=>{!t&&!e&&l({pathname:`/${s}`,search:c.search})},[t,e]),!(!e||t))return f.jsx(Ja,{scrollable:!0,top:f.jsx(Lr,{title:n("app.adminArea"),actionElement:f.jsx(Iy,{languages:i.languages,contentLanguage:e,navigateLanguage:d=>l({pathname:`/${d}`,search:c.search})})}),children:f.jsx("div",{className:"MainContent HomeScreen",children:f.jsx("div",{className:"HomeScreen-searchPanel",children:f.jsx(SF,{contentLanguage:e})})})})}const DF=ge`
|
|
493
|
-
query GetBackups($offset: Int, $limit: Int) {
|
|
494
|
-
backups(offset: $offset, limit: $limit) {
|
|
495
|
-
items {
|
|
496
|
-
fileName
|
|
497
|
-
fileWeight
|
|
498
|
-
createdAt
|
|
499
|
-
}
|
|
500
|
-
total
|
|
501
|
-
}
|
|
502
|
-
}
|
|
503
|
-
`,NF=ge`
|
|
504
|
-
mutation InitializeBackup {
|
|
505
|
-
initializeBackup {
|
|
506
|
-
fileName
|
|
507
|
-
fileWeight
|
|
508
|
-
}
|
|
509
|
-
}
|
|
510
|
-
`,CF=ge`
|
|
511
|
-
mutation GenerateBackupDownloadLink($fileName: String!) {
|
|
512
|
-
generateBackupDownloadLink(fileName: $fileName)
|
|
513
|
-
}
|
|
514
|
-
`,EF=ge`
|
|
515
|
-
mutation DeleteBackup($fileName: String!) {
|
|
516
|
-
deleteBackup(fileName: $fileName)
|
|
517
|
-
}
|
|
518
|
-
`;function AF(){return S.useCallback(async(e,t)=>(await Se(DF,{offset:e,limit:t})).backups,[])}function MF(){return S.useCallback(async()=>(await Se(NF)).initializeBackup,[])}function TF(){return S.useCallback(async e=>(await Se(CF,{fileName:e})).generateBackupDownloadLink,[])}function jF(){return S.useCallback(async e=>(await Se(EF,{fileName:e})).deleteBackup,[])}function kF(){return f.jsx(Or,{activeRoute:{kind:"settings",menuItemKey:"backup"},children:f.jsx($F,{})})}function $F(){return f.jsx(Cn,{children:f.jsx(OF,{})})}function OF(){const e=we(),t=na(),n=Z1(),i=ia(),s=AF(),l=MF(),c=TF(),d=jF(),[h,m]=S.useState([]),[y,v]=S.useState(0),[b,D]=S.useState(!1),[w,N]=S.useState({first:0,rows:10}),[M,A]=S.useState(),{showError:T,showAlert:j}=at(),F=async()=>{D(!0);try{const U=await s(w.first,w.rows);m(U.items),v(U.total)}finally{D(!1)}};ct(F,[w]);const z=({first:U,rows:ae})=>{N({first:U,rows:ae})},P=async()=>{const U=await l();A(U),N({first:0,rows:10})},E=async U=>{const ae=await c(U);window.open(`${Va}${ae}`,"_blank")},L=async U=>{await i(Nc,{title:e("BackupScreen.confirmDeleteTitle"),message:e("BackupScreen.confirmDeleteMessage"),confirmLabel:e("common.delete"),confirmSeverity:"danger",action:async()=>{await d(U.fileName)}})&&(j(e("BackupScreen.backupDeleted"),{severity:"info"}),await F())},_=U=>q1(U.createdAt,t),Y=U=>n(U.fileWeight),Z=U=>f.jsxs("div",{className:"BackupScreen-actions",children:[f.jsx(de,{severity:"secondary",className:"small Mr2",onClick:()=>E(U.fileName),title:e("BackupScreen.download"),children:f.jsx(Pp,{size:16})}),f.jsx(de,{severity:"danger",className:"small",onClick:()=>L(U),title:e("BackupScreen.delete"),outlined:!0,children:f.jsx(pc,{size:16})})]});return f.jsx(Ja,{scrollable:!0,top:f.jsx(Lr,{title:e("BackupScreen.backup"),actionElement:f.jsx(de,{as:"async",severity:"primary",onClick:P,insideFeedback:{label:e("BackupScreen.backupCreated")},onError:T,children:e("BackupScreen.prepareBackup")})}),children:f.jsxs("div",{className:"BackupScreen MainContent",children:[f.jsx(En,{}),M&&f.jsxs(No,{severity:"info",className:"Mb4 MaxWLg Centered",onClose:()=>A(void 0),children:[f.jsx("p",{children:e("BackupScreen.backupReady")}),f.jsx("div",{className:"Mt2",style:{textAlign:"center"},children:f.jsxs(de,{severity:"primary",onClick:()=>E(M.fileName),children:[f.jsx(Pp,{size:16}),e("BackupScreen.download")]})})]}),f.jsxs(Po,{value:h,dataKey:"fileName",loading:b,paginator:!0,rows:10,totalRecords:y,first:w.first,onPage:z,children:[f.jsx(it,{field:"fileName",header:e("BackupScreen.fileName")}),f.jsx(it,{header:e("BackupScreen.fileSize"),body:Y}),f.jsx(it,{header:e("BackupScreen.createdAt"),body:_}),f.jsx(it,{header:e("BackupScreen.actions"),body:Z})]})]})})}const RF=ge`
|
|
519
|
-
query GetEventLog($offset: Int!, $limit: Int!, $searchText: String) {
|
|
520
|
-
eventLog(offset: $offset, limit: $limit, searchText: $searchText) {
|
|
521
|
-
items {
|
|
522
|
-
id
|
|
523
|
-
eventType
|
|
524
|
-
actorEmail
|
|
525
|
-
actorName
|
|
526
|
-
targetType
|
|
527
|
-
targetId
|
|
528
|
-
eventData
|
|
529
|
-
createdAt
|
|
530
|
-
}
|
|
531
|
-
total
|
|
532
|
-
offset
|
|
533
|
-
}
|
|
534
|
-
}
|
|
535
|
-
`;function LF(){return S.useCallback(async e=>(await Se(RF,e)).eventLog,[])}function PF(){return f.jsx(Or,{activeRoute:{kind:"settings",menuItemKey:"eventLog"},children:f.jsx(IF,{})})}function IF(){const e=we(),t=na(),n=LF(),i=ia(),[s,l]=xN(),[c,d]=S.useState([]),[h,m]=S.useState(0),[y,v]=S.useState(!1),[b,D]=S.useState(s.get("search")??""),[w,N]=S.useState(s.get("search")??""),[M,A]=S.useState({first:0,rows:50});ct(async()=>{v(!0);try{const L=await n({offset:M.first,limit:M.rows,searchText:w||void 0});d(L.items),m(L.total)}finally{v(!1)}},[M,w]);const j=({first:L,rows:_})=>{A({first:L,rows:_})},F=L=>{L.key==="Enter"&&(N(b),A({first:0,rows:50}),l(b?{search:b}:{}))},z=L=>Oo(L.createdAt,t),P=L=>L.actorEmail?L.actorName?`${L.actorEmail} (${L.actorName})`:L.actorEmail:"—",E=L=>{i(zF,{entry:L})};return f.jsx(Ja,{scrollable:!0,top:f.jsx(Lr,{title:e("EventLogScreen.eventLog"),actionElement:f.jsx(vn,{icon:f.jsx(fD,{size:16}),value:b,onChange:D,onKeyDown:F,placeholder:e("EventLogScreen.searchPlaceholder"),className:"WFull"})}),children:f.jsx("div",{className:"EventLogScreen MainContent",children:f.jsx("div",{className:"EventLogScreen-table card",children:f.jsxs(Po,{value:c,dataKey:"id",loading:y,paginator:!0,rows:50,totalRecords:h,first:M.first,onPage:j,children:[f.jsx(it,{field:"createdAt",header:e("EventLogScreen.createdAt"),body:z}),f.jsx(it,{field:"eventType",header:e("EventLogScreen.eventType")}),f.jsx(it,{header:e("EventLogScreen.actor"),body:P}),f.jsx(it,{field:"targetType",header:e("EventLogScreen.targetType")}),f.jsx(it,{field:"targetId",header:e("EventLogScreen.targetId")}),f.jsx(it,{header:"",body:L=>f.jsx(de,{severity:"secondary",className:"small",onClick:()=>E(L),children:e("common.details")})})]})})})})}function zF({parameter:{entry:e},closeDialog:t}){const n=we(),i=()=>{if(!e.eventData)return n("EventLogScreen.noEventData");try{const c=JSON.parse(e.eventData);return JSON.stringify(c,null,2)}catch{return e.eventData}},s=f.jsx("pre",{className:"EventLogScreen-dialogData",children:i()}),l=f.jsx("div",{className:"ButtonBar alignRight",children:f.jsx(de,{onClick:t,children:n("common.close")})});return{header:n("EventLogScreen.eventDetails"),content:s,footer:l}}function _F({fieldValues:e}){const{siteSchema:t}=St(),n=t.nodeTypes._site.fields,i=hE({l10nPrefix:"siteSchema.nodeTypes._site.fields",areSiteFields:!0});return f.jsx("div",{className:"ColumnWithGap",children:n.map(s=>i({fieldType:s,value:e[s.name]}))})}const UF=ge`
|
|
536
|
-
query SiteFieldValues($fieldNames: [String!]!, $language: String){
|
|
537
|
-
siteFieldValues(fieldNames: $fieldNames, language: $language)
|
|
538
|
-
}
|
|
539
|
-
`;function BF(){return S.useCallback(async e=>{const t=await Se(UF,e);return JSON.parse(t.siteFieldValues)},[])}const FF=ge`
|
|
540
|
-
mutation SetSiteFieldValues($values: String!, $language: String){
|
|
541
|
-
setSiteFieldValues(values: $values, language: $language)
|
|
542
|
-
}
|
|
543
|
-
`;function HF(){return S.useCallback(async({values:e,language:t})=>{await Se(FF,{language:t,values:JSON.stringify(e)})},[])}function qF(){return f.jsx(Cn,{children:f.jsx(VF,{})})}function VF(){const e=we(),{siteSchema:t}=St(),n=ya(),i=BF(),s=HF(),l=Wt(),{getModifiedValues:c,saveAll:d,emit:h}=Ut(),m=Ay(),[y,v]=S.useState(),{showAlert:b}=at(),D=N=>b(Fn(N),{severity:"error"});Yc();const w=t.nodeTypes._site.fields;return Bo(async()=>{const N=c();return N?(await s({values:N,language:n}),!0):!1}),Gc("shouldRefresh",async()=>{if(!n)return;const N=await i({fieldNames:w.map(M=>M.name),language:n});v(N)},[n,w],{useEffect:!0}),y?f.jsx(Ja,{scrollable:!0,top:f.jsx(Lr,{title:e("app.siteProperties"),actionElement:f.jsxs(f.Fragment,{children:[f.jsx(Iy,{languages:t.languages,contentLanguage:n,navigateLanguage:N=>l(`/settings/site-fields/${N}`)}),f.jsx(de,{as:"async",onClick:async()=>{await d(),h("shouldRefresh")},disabled:m,insideFeedback:{label:e("app.saved")},onError:D,children:e("app.saveChanges")})]})}),children:f.jsxs("div",{className:"MainContent",children:[f.jsx(En,{}),f.jsx(_F,{fieldValues:y})]})}):f.jsx(ln,{})}function KF(){const{requestedContentLanguage:e,isInvalid:t}=Cy();if(!t){if(!e){rn.emit("404");return}return f.jsx(Or,{activeRoute:{kind:"settings",menuItemKey:"siteFields"},children:f.jsx(Rr,{children:f.jsx(qF,{})})})}}function AE({className:e,breadcrumbItems:t,withLanguageSelector:n,backUrl:i}){const s=Wt(),c=Ge(d=>d.appLayout)==="mobile"?[{label:"",icon:f.jsx(aD,{size:16}),onClick:()=>s(i??"/")}]:(t??[]).map(d=>({label:d.label??"",onClick:d.command?()=>d.command?.({}):void 0}));return f.jsxs("div",{className:he("PaNavbar",e),children:[f.jsx("div",{className:"PaNavbar-group",children:f.jsx("div",{className:"PaNavbar-item",children:f.jsx(gD,{items:c})})}),n&&f.jsx("div",{className:"PaNavbar-item",children:f.jsx(Iy,{languages:n.languages,contentLanguage:n.contentLanguage,navigateLanguage:n.navigateLanguage})})]})}const GF=ge`
|
|
544
|
-
query Account($id: ID!) {
|
|
545
|
-
account(id: $id) {
|
|
546
|
-
email
|
|
547
|
-
hasPasswordResetToken
|
|
548
|
-
id
|
|
549
|
-
name
|
|
550
|
-
roles
|
|
551
|
-
linkedAuthors {
|
|
552
|
-
nodeId
|
|
553
|
-
title
|
|
554
|
-
}
|
|
555
|
-
currentAuthor {
|
|
556
|
-
nodeId
|
|
557
|
-
title
|
|
558
|
-
}
|
|
559
|
-
active
|
|
560
|
-
loginMethod
|
|
561
|
-
}
|
|
562
|
-
}
|
|
563
|
-
`;function YF(){return S.useCallback(async e=>{const t=await Se(GF,{id:e});return{...t.account,loginMethod:t.account.loginMethod??void 0}},[])}const JF=ge`
|
|
564
|
-
query AllAccounts {
|
|
565
|
-
allAccounts {
|
|
566
|
-
email
|
|
567
|
-
hasPasswordResetToken
|
|
568
|
-
id
|
|
569
|
-
name
|
|
570
|
-
roles
|
|
571
|
-
linkedAuthors {
|
|
572
|
-
nodeId
|
|
573
|
-
title
|
|
574
|
-
}
|
|
575
|
-
currentAuthor {
|
|
576
|
-
nodeId
|
|
577
|
-
title
|
|
578
|
-
}
|
|
579
|
-
active
|
|
580
|
-
loginMethod
|
|
581
|
-
}
|
|
582
|
-
}
|
|
583
|
-
`;function XF(){return S.useCallback(async()=>(await Se(JF)).allAccounts.map(t=>({...t,loginMethod:t.loginMethod??void 0})),[])}const WF=ge`
|
|
584
|
-
mutation CreateAccount(
|
|
585
|
-
$values: CreateAccountValues!
|
|
586
|
-
) {
|
|
587
|
-
createAccount(
|
|
588
|
-
values: $values
|
|
589
|
-
) {
|
|
590
|
-
email
|
|
591
|
-
hasPasswordResetToken
|
|
592
|
-
id
|
|
593
|
-
name
|
|
594
|
-
active
|
|
595
|
-
loginMethod
|
|
596
|
-
roles
|
|
597
|
-
}
|
|
598
|
-
}
|
|
599
|
-
`;function QF(){return S.useCallback(async e=>{const t=await Se(WF,e);return{...t.createAccount,loginMethod:t.createAccount.loginMethod??void 0}},[])}const ZF=ge`
|
|
600
|
-
mutation UpdateAccount($accountId: ID! $name: String!, $email: String!) {
|
|
601
|
-
updateAccount(accountId: $accountId, values: { email: $email, name: $name }) {
|
|
602
|
-
email
|
|
603
|
-
hasPasswordResetToken
|
|
604
|
-
id
|
|
605
|
-
name
|
|
606
|
-
active
|
|
607
|
-
loginMethod
|
|
608
|
-
}
|
|
609
|
-
}
|
|
610
|
-
`;function e5(){return S.useCallback(async e=>{const t=await Se(ZF,e);return{...t.updateAccount,loginMethod:t.updateAccount.loginMethod??void 0}},[])}const t5=ge`
|
|
611
|
-
mutation DeleteAccount($accountId: ID!) {
|
|
612
|
-
deleteAccount(accountId: $accountId)
|
|
613
|
-
}
|
|
614
|
-
`;function n5(){return S.useCallback(async e=>{await Se(t5,{accountId:e})},[])}const a5=ge`
|
|
615
|
-
mutation ResetAccountPassword($accountId: ID!) {
|
|
616
|
-
resetAccountPassword(accountId: $accountId)
|
|
617
|
-
}
|
|
618
|
-
`;function i5(){return S.useCallback(async e=>{await Se(a5,{accountId:e})},[])}const r5=ge`
|
|
619
|
-
mutation UpdateAccountRoles($accountId: ID!, $roles: [String!]!) {
|
|
620
|
-
updateAccountRoles(accountId: $accountId, roles: $roles) {
|
|
621
|
-
id
|
|
622
|
-
roles
|
|
623
|
-
}
|
|
624
|
-
}
|
|
625
|
-
`;function s5(){return S.useCallback(async e=>{await Se(r5,e)},[])}ge`
|
|
626
|
-
mutation LinkAuthorToAccount($authorNodeId: ID!, $accountId: ID!) {
|
|
627
|
-
linkAuthorToAccount(authorNodeId: $authorNodeId, accountId: $accountId)
|
|
628
|
-
}
|
|
629
|
-
`;ge`
|
|
630
|
-
mutation UnlinkAuthorFromAccount($authorNodeId: ID!, $accountId: ID!) {
|
|
631
|
-
unlinkAuthorFromAccount(authorNodeId: $authorNodeId, accountId: $accountId)
|
|
632
|
-
}
|
|
633
|
-
`;ge`
|
|
634
|
-
mutation SetCurrentAuthor($accountId: ID!, $authorNodeId: ID) {
|
|
635
|
-
setCurrentAuthor(accountId: $accountId, authorNodeId: $authorNodeId)
|
|
636
|
-
}
|
|
637
|
-
`;const o5=ge`
|
|
638
|
-
mutation ReactivateAccount($accountId: ID!) {
|
|
639
|
-
reactivateAccount(accountId: $accountId)
|
|
640
|
-
}
|
|
641
|
-
`;function l5(){return S.useCallback(async e=>{await Se(o5,{accountId:e})},[])}function c5(){const{accountId:e}=Wg();if(!e){rn.emit("404");return}return f.jsx(Or,{activeRoute:{kind:"settings",menuItemKey:"accounts"},children:f.jsx(Rr,{children:f.jsx(u5,{accountId:e})})})}function u5(e){const t=Wt(),n=we(),i=[{label:n("app.settings"),disabled:!0,url:"/settings"},{label:n("AccountScreen.userAccounts"),url:ii("/settings/accounts"),command:()=>{t("/settings/accounts")}},{label:n("AccountScreen.editUserAccount"),disabled:!0}];return f.jsx(Ja,{scrollable:!0,top:f.jsx(AE,{breadcrumbItems:i,backUrl:"/settings/accounts"}),children:f.jsx(d5,{className:"MainContent",...e})})}function d5(e){return f.jsx(Cn,{children:f.jsx(f5,{...e})})}function f5({accountId:e,className:t}){const n=Wt(),i=we(),s=Ny(),l=n5(),c=i5(),d=l5(),h=e5(),m=s5(),y=YF(),{saveAll:v,setModifiedValue:b,cancelModifiedValue:D}=Ut(),[w,N]=S.useState(),M=ia(),A=gs(),{showError:T}=at(),j=S.useRef(null),F=w?.loginMethod&&["localDev","platformAdmin"].includes(w.loginMethod),z=w&&!w.active,P=F||z;Yc();const[E,L]=S.useState("");S.useEffect(()=>{if(!w)return;const R=Ka(E,w.email);R===void 0?D("email"):b("email",R)},[E,w]);const[_,Y]=S.useState("");S.useEffect(()=>{if(!w)return;const R=Ka(_,w.name);R===void 0?D("name"):b("name",R)},[_,w]);const[Z,U]=S.useState([]),ae=(R,W)=>{const se=W?[...Z,R]:Z.filter(ye=>ye!==R);U(se)};Bo(async()=>w?(await h({accountId:e,name:_,email:E}),JSON.stringify(Z.sort())!==JSON.stringify((w.roles??[]).sort())&&await m({accountId:e,roles:Z}),!0):!1),Gc("shouldRefresh",async()=>{N(void 0);const R=await y(e);N(R),L(R.email),Y(R.name),U(R.roles??[])},[e],{useEffect:!0});const Q=async R=>{await l(R)},ie=async R=>{await c(R)};return w?f.jsxs("div",{className:t,children:[f.jsxs("div",{className:he("AccountEditScreen-header",{withResetToken:w.hasPasswordResetToken}),children:[f.jsx("h2",{className:`text-base ${w.hasPasswordResetToken?"w-9":"w-11"}`,children:i("AccountScreen.editUserAccount")}),w.hasPasswordResetToken&&f.jsx(zp,{label:i("AccountScreen.passwordBeingReset")})]}),f.jsxs("div",{className:"MainContent-formBlock m-auto",children:[f.jsx(En,{}),f.jsxs("form",{className:"Mb5",onSubmit:R=>{R.preventDefault(),j.current?.click()},children:[f.jsxs("label",{className:"Block Mb4",children:[f.jsx("span",{className:"FieldLabel",children:i("common.name")}),f.jsx(vn,{value:_,placeholder:i("common.name"),className:"AccountEditScreen-input",onChange:Y,readOnly:P,disabled:P})]}),f.jsxs("label",{className:"Block Mb4",children:[f.jsx("span",{className:"FieldLabel",children:i("common.email")}),f.jsx(vn,{value:E,placeholder:i("common.email"),className:"AccountEditScreen-input",onChange:L,readOnly:P,disabled:P})]}),f.jsxs("label",{className:"Block Mb4",children:[f.jsx("span",{className:"FieldLabel",children:i("AccountScreen.loginMethod")}),f.jsx(vn,{value:w.loginMethod?i(`app.loginMethod.${w.loginMethod}`):"—",className:"AccountEditScreen-input",onChange:()=>{},readOnly:!0,disabled:!0})]}),f.jsx("div",{className:"Mb4",children:f.jsxs("label",{className:"RoleCheckbox",children:[f.jsx(cs,{id:"active",checked:w.active,onChange:()=>{},disabled:!0}),f.jsx("label",{htmlFor:"active",className:"Ml2",children:i("AccountScreen.active")})]})}),f.jsxs("div",{className:"Mb4",children:[f.jsx("label",{className:"AccountEditScreen-fieldLabel Mb2",children:i("AccountScreen.roles")}),f.jsxs("div",{className:"FieldLayout",children:[f.jsxs("div",{className:"RoleCheckbox",children:[f.jsx(cs,{id:"role-admin",checked:Z.includes("admin"),onChange:R=>ae("admin",R),disabled:P||s.email===w?.email&&Z.includes("admin")}),f.jsx("label",{htmlFor:"role-admin",className:"Ml2",children:i("AccountScreen.roleAdmin")})]}),f.jsxs("div",{className:"RoleCheckbox",children:[f.jsx(cs,{id:"role-editor",checked:Z.includes("editor"),onChange:R=>ae("editor",R),disabled:P}),f.jsx("label",{htmlFor:"role-editor",className:"Ml2",children:i("AccountScreen.roleEditor")})]})]})]}),w&&w.linkedAuthors.length>0&&f.jsxs("div",{className:"Mb4",children:[f.jsx("label",{className:"AccountEditScreen-fieldLabel Mb2",children:i("AccountScreen.linkedAuthors")}),f.jsx("div",{className:"AuthorChips",children:w.linkedAuthors.map(R=>f.jsx(zp,{label:R.title??R.nodeId},R.nodeId))})]})]}),f.jsxs("div",{className:"ButtonBar",children:[f.jsx(de,{disabled:z||w.email===s.email,onClick:async()=>{await M(Nc,{title:i("AccountScreen.deleteAccountDialog.title"),message:i("AccountScreen.deleteAccountDialog.description"),confirmLabel:i("common.delete"),confirmSeverity:"danger",action:async()=>{await Q(e)}})&&n("/settings/accounts")},severity:"danger",outlined:!0,children:i("common.delete")}),f.jsx(de,{disabled:F,onClick:()=>{A(Nc,{title:i("AccountScreen.resetPasswordDialog.title"),message:i("AccountScreen.resetPasswordDialog.description"),confirmSeverity:"primary",action:async()=>{await ie(e)}})},severity:"warning",outlined:!0,children:i("AccountScreen.resetPasswordButton")}),z&&f.jsx(de,{as:"async",onClick:async()=>{await d(e);const R=await y(e);N(R),L(R.email),Y(R.name),U(R.roles??[])},severity:"success",insideFeedback:{label:i("common.done")},onError:T,children:i("AccountScreen.reactivateAccount")}),f.jsx(de,{ref:j,as:"async",onClick:v,insideFeedback:{label:i("common.saved")},onError:T,children:i("common.validate")})]})]})]}):f.jsx("div",{className:t,children:f.jsx(ln,{})})}function h5({closeDialog:e,parameter:{createAccount:t}}){const n=we(),i=Kc(),[s,l]=S.useState(""),[c,d]=S.useState(""),[h,m]=S.useState("local"),[y,v]=S.useState(["editor"]),{showError:b}=at(),D=S.useRef(null),w=(j,F)=>{const z=F?[...y,j]:y.filter(P=>P!==j);v(z)},N=async()=>{await t({name:s,email:c,accountType:h,roles:y}),e()},M=n("AccountScreen.createAnAccount"),A=f.jsx("div",{className:"CreateAccountDialog",children:f.jsxs("form",{onSubmit:j=>{j.preventDefault(),D.current?.click()},children:[f.jsxs("div",{className:"Mb3",children:[f.jsx("p",{children:n("AccountScreen.makeCreateAccountDialog.accountType")}),f.jsx("div",{className:"AccountTypeSelector",children:f.jsxs("div",{className:"AccountTypeOptions",children:[f.jsxs("label",{children:[f.jsx(_d,{name:"accountType",value:"local",onChange:()=>m("local"),checked:h==="local"}),f.jsx("span",{className:"Ml2",children:n("AccountScreen.makeCreateAccountDialog.localAccount")})]}),i.platformAuthUrl&&f.jsxs("label",{children:[f.jsx(_d,{name:"accountType",value:"google",onChange:()=>m("google"),checked:h==="google"}),f.jsx("span",{className:"Ml2",children:n("AccountScreen.makeCreateAccountDialog.googleAccount")})]})]})})]}),f.jsxs("label",{className:"FieldLayout Mb3",children:[f.jsx("span",{children:n("common.name")}),f.jsx(vn,{placeholder:n("common.name"),value:s,onChange:l})]}),f.jsxs("label",{className:"FieldLayout",children:[f.jsx("span",{children:n("common.email")}),f.jsx(vn,{placeholder:n("common.email"),value:c,onChange:d})]}),f.jsxs("div",{className:"Mb4",children:[f.jsx("label",{className:"CreateAccountDialog-fieldLabel Mb2",children:n("AccountScreen.roles")}),f.jsxs("div",{className:"FieldLayout",children:[f.jsxs("div",{className:"RoleCheckbox",children:[f.jsx(cs,{id:"role-admin",checked:y.includes("admin"),onChange:j=>w("admin",j)}),f.jsx("label",{htmlFor:"role-admin",className:"Ml2",children:n("AccountScreen.roleAdmin")})]}),f.jsxs("div",{className:"RoleCheckbox",children:[f.jsx(cs,{id:"role-editor",checked:y.includes("editor"),onChange:j=>w("editor",j)}),f.jsx("label",{htmlFor:"role-editor",className:"Ml2",children:n("AccountScreen.roleEditor")})]})]})]})]})}),T=f.jsxs("div",{className:"ButtonBar alignRight",children:[f.jsx(de,{onClick:()=>e(),severity:"secondary",children:n("common.cancel")}),f.jsx(de,{ref:D,as:"async",onClick:N,insideFeedback:{label:n("common.created")},onError:b,children:n("common.validate")})]});return{header:M,content:A,footer:T}}function m5(){return f.jsx(Or,{activeRoute:{kind:"settings",menuItemKey:"accounts"},children:f.jsx(p5,{})})}function p5(){const e=XF(),t=QF(),[n,i]=S.useState(),s=Wt(),{t:l}=Pt(),c=na(),d=gs(),h=v=>v.length===0?"-":v.map(b=>b==="admin"?l("AccountScreen.roleAdmin"):b==="editor"?l("AccountScreen.roleEditor"):b).join(", "),m=async()=>{i(await e())};ct(m,[]);const y=async({name:v,email:b,accountType:D,roles:w})=>{await t({values:{name:v,email:b,language:c,accountType:D,roles:w}}),await m()};return f.jsx(Ja,{scrollable:!0,top:f.jsx(Lr,{title:l("AccountScreen.userAccounts"),actionElement:f.jsx(de,{onClick:()=>d(h5,{createAccount:y,syncAccount:m}),children:l("AccountScreen.createAnAccount")})}),children:f.jsx("div",{className:"MainContent",children:f.jsxs(Po,{dataKey:"id",value:n??[],onRowClick:v=>s(`/settings/accounts/${v.id}`),children:[f.jsx(it,{field:"name",header:l("common.name")}),f.jsx(it,{field:"email",header:l("common.email")}),f.jsx(it,{field:"active",header:l("AccountScreen.active"),body:v=>v.active?"✓":"✗"}),f.jsx(it,{field:"roles",header:l("AccountScreen.roles"),body:v=>h(v.roles)})]})})})}ge`
|
|
642
|
-
query AuthAccount {
|
|
643
|
-
authAccount {
|
|
644
|
-
preferences {
|
|
645
|
-
language
|
|
646
|
-
}
|
|
647
|
-
}
|
|
648
|
-
}
|
|
649
|
-
`;const g5=ge`
|
|
650
|
-
mutation SetAccountPreferences($accountId: ID!, $values: AccountPreferencesValues!) {
|
|
651
|
-
setAccountPreferences(accountId: $accountId, values: $values)
|
|
652
|
-
}
|
|
653
|
-
`;function y5(){return S.useCallback(async e=>{await Se(g5,e)},[])}function v5({closeDialog:e,parameter:{createPat:t}}){const n=we(),[i,s]=S.useState(""),[l,c]=S.useState(),{showAlert:d}=at(),h=D=>d(Fn(D),{severity:"error"}),m=async()=>{if(!pa)return;const D=await t({accountId:pa.id,description:i||void 0,expiresAt:l?.toISOString()});e(D)},y=n("personalAccessTokens.createToken"),v=f.jsxs("div",{className:"CreatePatDialog-content",children:[f.jsx(vn,{label:n("personalAccessTokens.descriptionOptional"),value:i,onChange:s}),f.jsx(Tg,{type:"date",label:n("personalAccessTokens.expirationDate"),value:l?.toISOString().split("T")[0]??"",onChange:D=>c(D.target.value?new Date(D.target.value):void 0),min:new Date().toISOString().split("T")[0]})]}),b=f.jsxs("div",{className:"ButtonBar alignRight",children:[f.jsx(de,{severity:"secondary",onClick:()=>e(),children:n("common.cancel")}),f.jsx(de,{as:"async",onClick:m,insideFeedback:{label:n("personalAccessTokens.creating")},onError:h,children:n("personalAccessTokens.create")})]});return{header:y,content:v,footer:b}}function b5({closeDialog:e,parameter:{pat:t,updatePat:n,deletePat:i}}){const s=we(),[l,c]=S.useState(t.description??""),[d,h]=S.useState(t.active),{showAlert:m}=at(),y=M=>m(Fn(M),{severity:"error"}),v=async()=>{const M=await n(t.id,{description:l||void 0,active:d});e({action:"updated",pat:M})},b=async()=>{await i(t.id),e({action:"deleted"})},D=s("personalAccessTokens.editToken"),w=f.jsxs("div",{className:"EditPatDialog-content",children:[f.jsx(vn,{label:s("personalAccessTokens.descriptionOptional"),value:l,onChange:c}),f.jsx(cs,{checked:d,onChange:M=>h(M),label:s("personalAccessTokens.active")})]}),N=f.jsxs("div",{className:"ButtonBar spaceBetween",children:[f.jsx(de,{as:"async",severity:"danger",outlined:!0,onClick:b,insideFeedback:{label:s("personalAccessTokens.tokenDeleted"),autoDismiss:!0},onError:y,children:s("common.delete")}),f.jsxs("div",{className:"ButtonBar-group",children:[f.jsx(de,{severity:"secondary",onClick:()=>e(),children:s("common.cancel")}),f.jsx(de,{as:"async",onClick:v,insideFeedback:{label:s("personalAccessTokens.tokenUpdated"),autoDismiss:!0},onError:y,children:s("common.save")})]})]});return{header:D,content:w,footer:N}}const S5=ge`
|
|
654
|
-
query ListPersonalAccessTokens($accountId: ID!) {
|
|
655
|
-
personalAccessTokens(accountId: $accountId) {
|
|
656
|
-
id
|
|
657
|
-
tokenPreview
|
|
658
|
-
description
|
|
659
|
-
createdAt
|
|
660
|
-
lastUsedAt
|
|
661
|
-
expiresAt
|
|
662
|
-
active
|
|
663
|
-
}
|
|
664
|
-
}
|
|
665
|
-
`;function x5(){return S.useCallback(async e=>(await Se(S5,{accountId:e})).personalAccessTokens,[])}const w5=ge`
|
|
666
|
-
mutation CreatePat($input: CreatePatInput!) {
|
|
667
|
-
createPat(input: $input) {
|
|
668
|
-
token
|
|
669
|
-
pat {
|
|
670
|
-
id
|
|
671
|
-
tokenPreview
|
|
672
|
-
description
|
|
673
|
-
createdAt
|
|
674
|
-
lastUsedAt
|
|
675
|
-
expiresAt
|
|
676
|
-
active
|
|
677
|
-
}
|
|
678
|
-
}
|
|
679
|
-
}
|
|
680
|
-
`;function D5(){return S.useCallback(async e=>(await Se(w5,{input:e})).createPat,[])}const N5=ge`
|
|
681
|
-
mutation UpdatePat($id: ID!, $input: UpdatePatInput!) {
|
|
682
|
-
updatePat(id: $id, input: $input) {
|
|
683
|
-
id
|
|
684
|
-
tokenPreview
|
|
685
|
-
description
|
|
686
|
-
createdAt
|
|
687
|
-
lastUsedAt
|
|
688
|
-
expiresAt
|
|
689
|
-
active
|
|
690
|
-
}
|
|
691
|
-
}
|
|
692
|
-
`;function C5(){return S.useCallback(async(e,t)=>(await Se(N5,{id:e,input:t})).updatePat,[])}const E5=ge`
|
|
693
|
-
mutation DeletePat($id: ID!) {
|
|
694
|
-
deletePat(id: $id)
|
|
695
|
-
}
|
|
696
|
-
`;function A5(){return S.useCallback(async e=>{await Se(E5,{id:e})},[])}function M5({closeDialog:e,parameter:{token:t}}){const n=we(),i=()=>{navigator.clipboard.writeText(t)},s=n("personalAccessTokens.tokenCreated"),l=f.jsxs("div",{className:"TokenDisplayDialog-content",children:[f.jsx(No,{severity:"warning",children:n("personalAccessTokens.tokenCreatedWarning")}),f.jsx("div",{className:"TokenDisplayDialog-token",children:f.jsx("code",{children:t})})]}),c=f.jsxs("div",{className:"ButtonBar alignRight",children:[f.jsxs(de,{severity:"secondary",onClick:i,insideFeedback:{label:n("personalAccessTokens.tokenCopied"),autoDismiss:!0},children:[f.jsx(bT,{size:16}),n("personalAccessTokens.copyToken")]}),f.jsx(de,{onClick:()=>e(),children:n("common.close")})]});return{header:s,content:l,footer:c}}function T5(){const e=we(),t=ia(),n=x5(),i=D5(),s=C5(),l=A5(),[c,d]=S.useState([]),[h,m]=S.useState(!0),y=na(),v=async()=>{if(pa){m(!0);try{const A=await n(pa.id);d(A)}finally{m(!1)}}};ct(async()=>{await v()},[]);const b=A=>A?Oo(A,y):e("personalAccessTokens.never"),D=A=>f.jsx("span",{className:A.active?"text-green-600":"text-gray-500",children:A.active?e("personalAccessTokens.active"):e("personalAccessTokens.inactive")}),w=async()=>{const A=await t(v5,{createPat:i});A&&(d([A.pat,...c]),await t(M5,{token:A.token}))},N=async A=>{const T=await t(b5,{pat:A,updatePat:s,deletePat:l});T?.action==="updated"&&T.pat?d(c.map(j=>j.id===T.pat?.id?T.pat:j)):T?.action==="deleted"&&d(c.filter(j=>j.id!==A.id))},M=A=>f.jsx(de,{severity:"secondary",outlined:!0,onClick:()=>N(A),children:e("common.edit")});return f.jsxs("div",{children:[f.jsx(Lr,{title:e("personalAccessTokens.title"),actionElement:f.jsxs(de,{onClick:w,children:[f.jsx(ff,{size:16}),e("personalAccessTokens.createNew")]})}),f.jsxs("div",{className:"MainContent",children:[f.jsx("p",{className:"PersonalAccessTokens-description",children:e("personalAccessTokens.intro")}),c.length===0&&!h&&f.jsx(No,{severity:"info",children:e("personalAccessTokens.noTokens")}),c.length>0&&f.jsxs(Po,{value:c,dataKey:"id",loading:h,children:[f.jsx(it,{field:"description",header:e("personalAccessTokens.description")}),f.jsx(it,{field:"tokenPreview",header:e("personalAccessTokens.tokenPreview")}),f.jsx(it,{field:"createdAt",header:e("personalAccessTokens.createdAt"),body:A=>b(A.createdAt)}),f.jsx(it,{field:"lastUsedAt",header:e("personalAccessTokens.lastUsedAt"),body:A=>b(A.lastUsedAt)}),f.jsx(it,{field:"expiresAt",header:e("personalAccessTokens.expiresAt"),body:A=>A.expiresAt?b(A.expiresAt):e("personalAccessTokens.noExpiration")}),f.jsx(it,{field:"active",header:e("personalAccessTokens.active"),body:D}),f.jsx(it,{body:M})]})]})]})}function j5(){return f.jsx(ME,{activeTabIndex:0,children:f.jsx(Rr,{children:f.jsx($5,{})})})}function k5(){return f.jsx(ME,{activeTabIndex:1,children:f.jsx(T5,{})})}function ME({activeTabIndex:e,children:t}){const n=we(),i=Wt(),s=[{label:n("app.userSettings")}],l=e===0?"preferences":"pat",c=d=>{i(d==="preferences"?"/user-settings":"/user-settings/pat")};return f.jsx(Or,{activeRoute:{kind:"userSettings"},children:f.jsx(Ja,{scrollable:!0,top:f.jsx(AE,{breadcrumbItems:s}),children:f.jsxs("div",{className:"MainContent",children:[f.jsxs(pf,{value:l,onChange:c,children:[f.jsx(Co,{value:"preferences",label:n("app.preferences")}),f.jsx(Co,{value:"pat",label:n("personalAccessTokens.title")})]}),f.jsx("div",{className:"Preferences-content",children:t})]})})})}function $5(){return f.jsx(Cn,{children:f.jsx(O5,{})})}function O5(){const e=we(),{siteSchema:t}=St(),n=y5(),{saveAll:i,setModifiedValue:s,cancelModifiedValue:l}=Ut(),c=Ge(w=>w.preferences),d=Ge(w=>w.setPreferences),h=c?.language??t.defaultLanguage,{showAlert:m}=at(),y=w=>m(Fn(w),{severity:"error"});Yc();const v=S.useMemo(()=>{const w=t.languages.some(M=>cc.includes(M));let N;return w?N=t.languages:N=[...new Set([...t.languages,"en"])],N.map(M=>{let A;return t.languageLabels[M]?A=t.languageLabels[M]:A=e(M,M),{key:M,name:A}})},[t.languages,t.languageLabels,e]),[b,D]=S.useState(v.find(w=>w.key===h));return S.useEffect(()=>{D(v.find(w=>w.key===h))},[h]),S.useEffect(()=>{const w=Ka(b?.key,h);w===void 0?l("language"):s("language",w)},[b,h]),Bo(async()=>{if(!b||!pa)return!1;const w={language:b.key};return await n({accountId:pa.id,values:w}),d(w),!0}),f.jsxs(f.Fragment,{children:[f.jsx(Lr,{title:e("app.preferences"),actionElement:f.jsx(de,{as:"async",onClick:i,insideFeedback:{label:e("common.saved"),autoDismiss:!0},onError:y,children:e("app.saveChanges")})}),f.jsxs("div",{className:"MainContent",children:[f.jsx(En,{}),f.jsxs("label",{className:"MainContent-field Preferences-field",children:[f.jsx("span",{children:e("app.administrationLanguage")}),f.jsx(Ac,{value:b?.key??"",options:v.map(w=>({value:w.key,label:w.name})),className:"Preferences-languageSelect",onChange:w=>D(v.find(N=>N.key===w))})]})]})]})}function R5(){const e=Ra(),[t,n]=S.useState(!1),i=Z4();return S.useEffect(()=>{const s=()=>n(!0);return rn.on("404",s),()=>{rn.off("404",s)}},[]),S.useEffect(()=>n(!1),[e]),f.jsxs(R1,{logger:on,children:[f.jsx(F4,{}),t?f.jsx(Dy,{}):i?f.jsx(VO,{}):f.jsx(ln,{})]})}function L5({logger:e}){const t=mN(),n=xf();return S.useEffect(()=>{Ar(t)?e.error("Route error:",{status:t.status,statusText:t.statusText,data:t.data}):t instanceof Error?e.error("Route component error:",t):e.error("Unknown route error:",t)},[t,e]),Ar(t)&&t.status===404?f.jsx(Dy,{}):Ar(t)?f.jsxs("div",{style:{padding:"2rem"},children:[f.jsxs("h1",{children:[t.status," ",t.statusText]}),f.jsx("p",{children:t.data}),f.jsx("button",{type:"button",onClick:()=>n("/"),children:"Go to Home"})]}):t instanceof Error?f.jsxs("div",{style:{padding:"2rem"},children:[f.jsx("h1",{children:"Something went wrong"}),f.jsx("p",{children:t.message}),!1,f.jsx("button",{type:"button",onClick:()=>n("/"),children:"Go to Home"})]}):f.jsxs("div",{style:{padding:"2rem"},children:[f.jsx("h1",{children:"Unknown Error"}),f.jsx("p",{children:"An unexpected error occurred."}),f.jsx("button",{type:"button",onClick:()=>n("/"),children:"Go to Home"})]})}function P5(){return gR([{path:"/",element:f.jsx(R5,{}),errorElement:f.jsx(L5,{logger:on}),children:[{path:":contentLanguage?",element:f.jsx(xF,{})},{path:"node/:contentLanguage/:documentTypeKebabName/:documentNodeId/:tabName?/:partNodeId?",element:f.jsx(vF,{})},{path:"user-settings",children:[{index:!0,element:f.jsx(j5,{})},{path:"pat",element:f.jsx(k5,{})}]},{path:"settings",children:[{path:"site-fields/:contentLanguage",element:f.jsx(KF,{})},{path:"backup",element:f.jsx(kF,{})},{path:"event-log",element:f.jsx(PF,{})},{path:"accounts",element:f.jsx(m5,{})},{path:"accounts/:accountId",element:f.jsx(c5,{})}]},{path:"*",element:f.jsx(Dy,{})}]}],{basename:Sg})}const I5={B:"B",GB:"GB",MB:"MB",KB:"KB"},z5="Sprache auswählen",_5="Ein Fehler ist aufgetreten",U5="Dashboard",B5={logout:"Abmelden",adminUiTitle:"Admin - {{siteTitle}}",dev:"ENT",adminArea:"Verwaltungsbereich",settings:"Einstellungen",siteProperties:"Website-Eigenschaften",successfulUpdate:"Erfolgreiches Update",updateFailed:"Update fehlgeschlagen",saveChanges:"Speichern",tooltipTranslateMessage:"{{language}} (Übersetzen)",userSettings:"Benutzereinstellungen",preferences:"Einstellungen",administrationLanguage:"Sprache des Administrationsbereichs:",PoweredBy:"Bereitgestellt von",loginMethod:{local:"Lokal",localDev:"Lokal Dev",platform:"Plattform",platformAdmin:"Plattform Admin"},openSite:"Website öffnen"},F5={title:"Persönliche Zugriffstoken",intro:"Token ermöglichen externen Tools und Skripten den programmatischen Zugriff auf Ihre Inhalte.",createNew:"Neuen Token erstellen",noTokens:"Noch keine persönlichen Zugriffstoken",description:"Beschreibung",descriptionOptional:"Beschreibung (optional)",tokenPreview:"Token",createdAt:"Erstellt",lastUsedAt:"Zuletzt verwendet",expiresAt:"Läuft ab",active:"Aktiv",inactive:"Inaktiv",never:"Nie",noExpiration:"Kein Ablauf",create:"Erstellen",creating:"Wird erstellt…",editToken:"Token bearbeiten",deleteToken:"Token löschen",deleteConfirm:"Möchten Sie dieses Token wirklich löschen? Diese Aktion kann nicht rückgängig gemacht werden.",createToken:"Persönliches Zugriffstoken erstellen",expirationDate:"Ablaufdatum (optional)",tokenCreated:"Token erfolgreich erstellt",tokenCreatedWarning:"Speichern Sie dieses Token jetzt. Sie können es nicht noch einmal sehen!",copyToken:"Token kopieren",tokenCopied:"Token in die Zwischenablage kopiert",tokenDeleted:"Token erfolgreich gelöscht",tokenUpdated:"Token erfolgreich aktualisiert"},H5={searchLabel:"Ihre Suche",searchPlaceholder:"Suchen"},q5={parts:"Unterteile",openListOfParts:"Liste der Unterteile öffnen",noTitle:"(kein Titel)"},V5={en:"Englisch",fr:"Französisch",es:"Spanisch",de:"Deutsch",it:"Italienisch",pt:"Portugiesisch"},K5={setPublishDate:"Veröffentlichungsdatum des Unterteils ändern"},G5={title:"Einen Unterteil verschieben",menuLabel:"Verschieben",searchPlaceholder:"Nach einem Ziel suchen…"},Y5={mediaDeleted:"Medium gelöscht",uploadError:"Das Medium '{{ filename }}' wurde nicht empfangen."},J5={label:"Unterteile",addPart:"Einen Unterteil hinzufügen",reorderParts:"Neu ordnen",partDeleted:"Unterteil gelöscht",confirmItemDeletion:"Möchten Sie diesen Unterteil löschen?",createPart:"Einen Unterteil erstellen"},X5={addChild:"Hinzufügen"},W5={editPublishDate:"Veröffentlichungsdatum bearbeiten",setPublishDate:"Veröffentlichen oder planen",updateDraft:"Entwurf aktualisieren",view:"Ansehen",preview:"Vorschau",MD:"B",MDTooltip:"Eine Beschreibung ist vorhanden",MK:"S",MKTooltip:"Schlüsselwörter sind vorhanden"},Q5={documentDeletingConfirmationMessage:'Möchten Sie den Artikel "{{title}}" löschen?',deleteJustThisArticle:'Nur diesen Artikel in "{{language}}" löschen',deleteThisArticle:"Diesen Artikel löschen",deleteAllTranslations:"Alle Übersetzungen löschen",cannotDeleteLastHomeLanguage:"Das Home-Dokument muss mindestens eine Sprache haben. Sie können die letzte verbleibende Übersetzung nicht löschen."},Z5={switchToDraftConfirmationMessage:"Möchten Sie dieses Dokument in einen Entwurf umwandeln? Es wird nicht mehr von der Website aus zugänglich sein."},eH={seoSettings:"SEO-Einstellungen",title:"Titel:",slug:"Slug:",metaDescription:"Beschreibung:",metaKeywords:"Schlüsselwörter:",chooseFeatureImage:"Hervorgehobenes Bild"},tH={translations:"Übersetzungen",status:"Status",draft:"Entwurf",maximumChildPartsReached:"Sie haben das Limit für Unterteile erreicht.",translated:"Dokumente",notTranslated:"Nicht übersetzt",allTranslated:"Alle Dokumente sind übersetzt."},nH={changeDisplayOrder:"Anzeigereihenfolge ändern"},aH={switchAndTranslateConfirmationMesage:"Möchten Sie übersetzen"},iH={confirmationMessage:"Möchten Sie Ihre Updates speichern?",stayAndEditing:"Weiter bearbeiten",cancelWithoutSave:"Verlassen ohne zu speichern"},rH={title:"Auswahl",selectedItems:"Ausgewählt:",availableItems:"Verfügbar:",emptySelection:"Kein ausgewähltes Element"},sH={editCluster:"Cluster bearbeiten"},oH={title:"Cluster",description:"Wählen Sie aus, welche Routing-Dokumente in diesem Cluster existieren sollen. Dokumente mit Kindern können nicht gelöscht werden.",apply:"Anwenden",cannotDeleteWithChildren:"Kann Routing-Dokument mit Kindern nicht löschen",cannotDeleteParentWithCheckedChildren:"Kann Elternelement nicht abwählen wenn Kinder ausgewählt sind",cannotDeleteDocumentHasChildren:"Kann Dokument nicht löschen, da es Kinder hat",cannotDeleteClusterHasChildren:"Kann Cluster nicht löschen, da es Kinder hat",cannotDeleteClusterHasChildrenInOtherLanguages:"Cluster kann nicht gelöscht werden, da es verknüpfte Dokumente in anderen Sprachen hat",parentMustBeChecked:"Das übergeordnete Dokument muss zuerst angehakt werden",hasChildren:"hat Kinder",removeCluster:"Cluster entfernen",removeClusterAllLanguages:"Cluster in allen Sprachen entfernen"},lH={cluster:"Cluster",confirmCurrentLanguageDeletion:"Sind Sie sicher, dass Sie diesen Cluster in <strong>{{language}}</strong> löschen möchten?",confirmAllLanguagesDeletion:"Sind Sie sicher, dass Sie diesen Cluster in <strong>allen Sprachen</strong> löschen möchten?",documentsToDelete:"Die folgenden Routing-Dokumente werden gelöscht"},cH={inLanguage:"auf {{language}}",translateDocumentInto:"Das Dokument ins {{language}} übersetzen",translatePartInto:"Den Unterteil ins {{language}} übersetzen",switchToDraft:"Zu Entwurf wechseln",deletion:"Löschen",editItem:"Unterteil {{orderNum}} ({{typeLabel}})",title:"Titel",edit:"Bearbeiten",delete:"Löschen",save:"Speichern",saved:"Gespeichert",created:"Erstellt",done:"Fertig",close:"Schließen",validate:"Validieren",translate:"Übersetzen",publish:"Veröffentlichen",published:"Veröffentlicht",schedule:"Planen",scheduled:"Geplant",draft:"Entwurf",publishDate:"Veröffentlichungsdatum",cancel:"Abbrechen",confirm:"Bestätigen",confirmation:"Bestätigung",email:"E-Mail",name:"Name",thumbnail:"Vorschaubild",colon:"{{label}}:",fold:"falten",unfold:"entfalten",invalidJson:"Ungültiges JSON",yes:"Ja",no:"Nein",select:"Auswählen",public:"Öffentlich",protected:"Geschützt",passwordPlaceholder:"Passwort eingeben",details:"Details",documents:"Dokumente",Documents:"Dokumente"},uH={signIn:"Anmelden",password:"Passwort",signin:"Anmelden",or:"oder",failedMessage:"Falsche E-Mail oder Passwort.",signInWithGoogle:"Mit Google anmelden",signInWithLocalAccount:"Mit einem lokalen Konto anmelden"},dH={invalidToken:"Entschuldigung, Ihr Token ist nicht oder nicht mehr gültig.",newPassword:"Neues Passwort",confirmPassword:"Geben Sie Ihr Passwort erneut ein",validate:"Validieren",resetPassword:"Ihr Passwort zurücksetzen",nonIdenticalPasswords:"Nicht identische Passwörter"},fH={accounts:"Konten",active:"Aktiv",addAccount:"Konto hinzufügen",userAccounts:"Benutzerkonten",createAnAccount:"Ein Konto erstellen",editUserAccount:"Ein Benutzerkonto bearbeiten",loginMethod:"Anmeldemethode",passwordBeingReset:"Passwort wird zurückgesetzt",reactivateAccount:"Konto reaktivieren",resetPasswordButton:"Passwort zurücksetzen",roles:"Rollen",roleAdmin:"Administrator",roleEditor:"Redakteur",linkedAuthors:"Verknüpfte Autoren",resetPasswordDialog:{title:"Passwort zurücksetzen",description:"Möchten Sie das Kontokennwort zurücksetzen?"},deleteAccountDialog:{title:"Konto löschen",description:"Möchten Sie dieses Konto löschen?"},makeCreateAccountDialog:{accountType:"Kontotyp",localAccount:"Lokales Konto",googleAccount:"Google-Konto"}},hH={parentNotTranslated:"Entschuldigung, dieses Dokument kann nicht übersetzt werden, das übergeordnete Dokument muss zuerst übersetzt werden."},mH={backup:"Sicherung",prepareBackup:"Eine Sicherung vorbereiten",backupFileSizeLabel:"Größe der Sicherungsdatei:",fileName:"Dateiname",fileSize:"Größe",createdAt:"Datum",actions:"Aktionen",download:"Herunterladen",delete:"Löschen",confirmDeleteTitle:"Sicherung löschen",confirmDeleteMessage:"Sind Sie sicher, dass Sie diese Sicherungsdatei löschen möchten? Diese Aktion kann nicht rückgängig gemacht werden.",backupDeleted:"Sicherung erfolgreich gelöscht",backupCreated:"Sicherung erfolgreich erstellt",backupReady:"Ihre Sicherung ist zum Herunterladen bereit."},pH={eventLog:"Ereignisprotokoll",searchPlaceholder:"In Ereignissen suchen...",createdAt:"Datum/Uhrzeit",eventType:"Ereignistyp",actor:"Akteur",targetType:"Zieltyp",targetId:"Ziel-ID",eventData:"Ereignisdaten",noEventData:"Keine Ereignisdaten",jsonParseError:"JSON-Analyse fehlgeschlagen",eventDetails:"Ereignisdetails"},gH={notFound:"Ressource nicht gefunden",returnHomePage:"Zu unserer Startseite zurückkehren"},yH={title:"Versionshistorie",noHistory:"Keine Versionshistorie verfügbar",restore:"Wiederherstellen",restored:"Wiederhergestellt",dateColumn:"Datum",tierColumn:"Typ",changesColumn:"Änderungen",documentMetadata:"Dokumentmetadaten",tierShort:"Aktuell",tierMedium:"Regulär",tierLong:"Archiv",beforeRestore:"Automatisch vor Wiederherstellung gespeichert"},vH={lastModified:"Zuletzt geändert"},bH={invalidFile:"Ungültige Datei: {{ filename }}"},SH={chooseAFile:"Auswählen",deleteThisFile:"Möchten Sie diese Datei löschen?",orderTheMedia:"Neu ordnen",dragAndDropMedia:"Medien neu ordnen",cancelUpload:"Upload abbrechen",replace:"Ersetzen",properties:"Eigenschaften",deleteFileModalTitle:"Medienlöschung",dropFilesHere:"Laden Sie Ihre Dateien hier hoch…",mediaLimitReached:"Das Medienlimit wurde erreicht.",mediaProperties:{fileProperties:"Dateieigenschaften",imageProperties:"Bildeigenschaften",fileStored:"Datei gespeichert:",imageStored:"Bild gespeichert:",format:"Format",originalFileName:"Ursprünglicher Dateiname:",caption:"Bildunterschrift:",pixelRatio:"Pixelverhältnis:",usedSizes:"Verwendete Größen:",auto:"Auto"}},xH={sizeFormatter:I5,selectALanguage:z5,errorOccurred:_5,Dashboard:U5,app:B5,personalAccessTokens:F5,DocumentSearch:H5,NavBar:q5,languages:V5,part:K5,movePart:G5,DocumentEditPanel:Y5,list:J5,documentType:X5,DocumentControl:W5,DeleteDocument:Q5,SwitchToDraft:Z5,DocumentView:eH,DocumentListPanel:tH,ReorderDocumentDialog:nH,SwitchAndTranslateDocument:aH,SaveChangesOrCancelDialog:iH,SelectTermsDialog:rH,DocumentControlPanel:sH,ClusterManagementDialog:oH,ClusterManagementConfirmDialog:lH,common:cH,LoginScreen:uH,PasswordReset:dH,AccountScreen:fH,TranslateDocumentDialog:hH,BackupScreen:mH,EventLogScreen:pH,NotFoundScreen:gH,VersionHistoryDialog:yH,DocumentTable:vH,mediaField:bH,mediaGallery:SH},wH={B:"B",GB:"GB",MB:"MB",KB:"KB"},DH="Select a language",NH="An error occured",CH="Dashboard",EH={logout:"Log out",adminUiTitle:"Admin - {{siteTitle}}",dev:"DEV",adminArea:"Administration area",settings:"Settings",siteProperties:"Site properties",successfulUpdate:"Successful update",updateFailed:"Update failed",saveChanges:"Save",tooltipTranslateMessage:"{{language}} (Translate)",userSettings:"User Settings",preferences:"Preferences",administrationLanguage:"Language of the administration area:",PoweredBy:"Powered by",loginMethod:{local:"Local",localDev:"Local Dev",platform:"Platform",platformAdmin:"Platform Admin"},openSite:"Open site"},AH={title:"Personal Access Tokens",intro:"Tokens allow external tools and scripts to access your content programmatically.",createNew:"Create New Token",noTokens:"No personal access tokens yet",description:"Description",descriptionOptional:"Description (optional)",tokenPreview:"Token",createdAt:"Created",lastUsedAt:"Last Used",expiresAt:"Expires",active:"Active",inactive:"Inactive",never:"Never",noExpiration:"No expiration",create:"Create",creating:"Creating…",editToken:"Edit Token",deleteToken:"Delete Token",deleteConfirm:"Are you sure you want to delete this token? This action cannot be undone.",createToken:"Create Personal Access Token",expirationDate:"Expiration Date (optional)",tokenCreated:"Token Created Successfully",tokenCreatedWarning:"Save this token now. You won't be able to see it again!",copyToken:"Copy Token",tokenCopied:"Token copied to clipboard",tokenDeleted:"Token deleted successfully",tokenUpdated:"Token updated successfully"},MH={searchLabel:"Your search",searchPlaceholder:"Search"},TH={parts:"Sub-parts",openListOfParts:"Open the list of sub-parts",noTitle:"(no title)"},jH={en:"English",fr:"French",es:"Spanish",de:"German",it:"Italian",pt:"Portuguese"},kH={setPublishDate:"Change publication date of the sub-part"},$H={title:"Move a sub-part",menuLabel:"Move",searchPlaceholder:"Search for a destination…"},OH={mediaDeleted:"Media deleted",uploadError:"The '{{ filename }}' media has not been received."},RH={label:"Sub-parts",addPart:"Add a sub-part",reorderParts:"Reorder",partDeleted:"Sub-part deleted",confirmItemDeletion:"Do you want to delete this sub-part?",createPart:"Create a sub-part"},LH={addChild:"Add"},PH={editPublishDate:"Edit publish date",setPublishDate:"Publish or schedule",updateDraft:"Update draft",view:"View",preview:"Preview",MD:"D",MDTooltip:"A description is present",MK:"K",MKTooltip:"Keywords are present"},IH={documentDeletingConfirmationMessage:'Do you want to delete the article "{{title}}"?',deleteJustThisArticle:'Delete just this article in "{{language}}"',deleteThisArticle:"Delete this article",deleteAllTranslations:"Delete all the translations",cannotDeleteLastHomeLanguage:"The home document must have at least one language. You cannot delete the last remaining translation."},zH={switchToDraftConfirmationMessage:"Would you like to change this document to draft? It will no longer be accessible from the website."},_H={seoSettings:"SEO Settings",title:"Title:",slug:"Slug:",metaDescription:"Description:",metaKeywords:"Keywords:",chooseFeatureImage:"Featured image"},UH={translations:"Translations",status:"Status",draft:"Draft",maximumChildPartsReached:"You have reached the sub-part limit.",translated:"Documents",notTranslated:"Not translated",allTranslated:"All documents are translated."},BH={changeDisplayOrder:"Change display order"},FH={switchAndTranslateConfirmationMesage:"Do you want translate"},HH={confirmationMessage:"Would you like to save your updates?",stayAndEditing:"Continue editing",cancelWithoutSave:"Leave without saving"},qH={title:"Selection",selectedItems:"Selected:",availableItems:"Available:",emptySelection:"No selected item"},VH={editCluster:"Edit the cluster"},KH={title:"Cluster",description:"Select which routing documents should exist in this cluster. Documents with children cannot be deleted.",apply:"Apply",cannotDeleteWithChildren:"Cannot delete routing document with children",cannotDeleteParentWithCheckedChildren:"Cannot uncheck parent when children are checked",cannotDeleteDocumentHasChildren:"Cannot delete document because it has children",cannotDeleteClusterHasChildren:"Cannot delete cluster because it has children",cannotDeleteClusterHasChildrenInOtherLanguages:"Cannot delete cluster because it has attached documents in other languages",parentMustBeChecked:"Parent document must be checked first",hasChildren:"has children",removeCluster:"Remove cluster",removeClusterAllLanguages:"Remove cluster in all languages"},GH={cluster:"Cluster",confirmCurrentLanguageDeletion:"Are you sure you want to delete this cluster in <strong>{{language}}</strong>?",confirmAllLanguagesDeletion:"Are you sure you want to delete this cluster in <strong>all languages</strong>?",documentsToDelete:"The following routing documents will be deleted"},YH={inLanguage:"in {{language}}",translateDocumentInto:"Translate the document into {{language}}",translatePartInto:"Translate the sub-part into {{language}}",switchToDraft:"Switch to draft",deletion:"Deletion",editItem:"Sub-part {{orderNum}} ({{typeLabel}})",title:"Title",edit:"Edit",delete:"Delete",save:"Save",saved:"Saved",created:"Created",done:"Done",close:"Close",validate:"Validate",translate:"Translate",publish:"Publish",published:"Published",schedule:"Schedule",scheduled:"Scheduled",draft:"Draft",publishDate:"Publish date",cancel:"Cancel",confirm:"Confirm",confirmation:"Confirmation",email:"E-mail",name:"Name",thumbnail:"Thumbnail",colon:"{{label}}:",fold:"fold",unfold:"unfold",invalidJson:"Invalid JSON",yes:"Yes",no:"No",select:"Select",public:"Public",protected:"Protected",passwordPlaceholder:"Enter password",details:"Details",documents:"documents",Documents:"Documents"},JH={signIn:"Sign in",password:"Password",signin:"Sign in",or:"or",failedMessage:"Incorrect e-mail or password.",signInWithGoogle:"Sign in with Google",signInWithLocalAccount:"Sign in with a local account"},XH={invalidToken:"Sorry, your token is not or no longer valid.",newPassword:"New password",confirmPassword:"Enter again your password",validate:"Validate",resetPassword:"Reset your password",nonIdenticalPasswords:"Non-identical passwords"},WH={accounts:"Accounts",active:"Active",addAccount:"Add account",userAccounts:"User Accounts",createAnAccount:"Create an account",editUserAccount:"Edit a user account",loginMethod:"Login Method",passwordBeingReset:"Password being reset",reactivateAccount:"Reactivate Account",resetPasswordButton:"Reset password",roles:"Roles",roleAdmin:"Administrator",roleEditor:"Editor",linkedAuthors:"Linked authors",resetPasswordDialog:{title:"Password resetting",description:"Would you like to reset account password?"},deleteAccountDialog:{title:"Delete account",description:"Would you like to delete this account?"},makeCreateAccountDialog:{accountType:"Account type",localAccount:"Local account",googleAccount:"Google account"}},QH={parentNotTranslated:"Sorry, this document can't be translated, the parent document must be translated first."},ZH={backup:"Backup",prepareBackup:"Prepare a backup",backupFileSizeLabel:"Backup file size :",fileName:"File name",fileSize:"Size",createdAt:"Date",actions:"Actions",download:"Download",delete:"Delete",confirmDeleteTitle:"Delete backup",confirmDeleteMessage:"Are you sure you want to delete this backup file? This action cannot be undone.",backupDeleted:"Backup deleted successfully",backupCreated:"Backup created successfully",backupReady:"Your backup is ready for download."},e8={eventLog:"Event Log",searchPlaceholder:"Search in events...",createdAt:"Date/Time",eventType:"Event Type",actor:"Actor",targetType:"Target Type",targetId:"Target ID",eventData:"Event Data",noEventData:"No event data",jsonParseError:"Failed to parse JSON",eventDetails:"Event Details"},t8={notFound:"Resource not found",returnHomePage:"Return to our Home Page"},n8={title:"Version history",noHistory:"No version history available",restore:"Restore",restored:"Restored",dateColumn:"Date",tierColumn:"Type",changesColumn:"Changes",documentMetadata:"Document metadata",tierShort:"Recent",tierMedium:"Regular",tierLong:"Archive",beforeRestore:"Auto-saved before restore"},a8={lastModified:"Last modified"},i8={invalidFile:"Invalid file: {{ filename }}"},r8={chooseAFile:"Choose",deleteThisFile:"Do you want to delete this file?",orderTheMedia:"Reorder",dragAndDropMedia:"Reorder medias",cancelUpload:"Cancel upload",replace:"Replace",properties:"Properties",deleteFileModalTitle:"Media deletion",dropFilesHere:"Upload your files here…",mediaLimitReached:"The media limit has been reached.",mediaProperties:{fileProperties:"File properties",imageProperties:"Image properties",fileStored:"File stored:",imageStored:"Image stored:",format:"format",originalFileName:"Original file name:",caption:"Caption:",pixelRatio:"Pixel ratio:",usedSizes:"Used sizes:",auto:"Auto"}},s8={sizeFormatter:wH,selectALanguage:DH,errorOccurred:NH,Dashboard:CH,app:EH,personalAccessTokens:AH,DocumentSearch:MH,NavBar:TH,languages:jH,part:kH,movePart:$H,DocumentEditPanel:OH,list:RH,documentType:LH,DocumentControl:PH,DeleteDocument:IH,SwitchToDraft:zH,DocumentView:_H,DocumentListPanel:UH,ReorderDocumentDialog:BH,SwitchAndTranslateDocument:FH,SaveChangesOrCancelDialog:HH,SelectTermsDialog:qH,DocumentControlPanel:VH,ClusterManagementDialog:KH,ClusterManagementConfirmDialog:GH,common:YH,LoginScreen:JH,PasswordReset:XH,AccountScreen:WH,TranslateDocumentDialog:QH,BackupScreen:ZH,EventLogScreen:e8,NotFoundScreen:t8,VersionHistoryDialog:n8,DocumentTable:a8,mediaField:i8,mediaGallery:r8},o8={B:"B",GB:"GB",MB:"MB",KB:"KB"},l8="Seleccionar un idioma",c8="Ha ocurrido un error",u8="Panel de control",d8={logout:"Cerrar sesión",adminUiTitle:"Admin - {{siteTitle}}",dev:"DES",adminArea:"Área de administración",settings:"Configuración",siteProperties:"Propiedades del sitio",successfulUpdate:"Actualización exitosa",updateFailed:"Actualización fallida",saveChanges:"Guardar",tooltipTranslateMessage:"{{language}} (Traducir)",userSettings:"Configuración de usuario",preferences:"Preferencias",administrationLanguage:"Idioma del área de administración:",PoweredBy:"Desarrollado por",loginMethod:{local:"Local",localDev:"Local Dev",platform:"Plataforma",platformAdmin:"Admin Plataforma"},openSite:"Abrir sitio"},f8={title:"Tokens de acceso personal",intro:"Los tokens permiten que herramientas externas y scripts accedan a su contenido de forma programática.",createNew:"Crear nuevo token",noTokens:"Aún no hay tokens de acceso personal",description:"Descripción",descriptionOptional:"Descripción (opcional)",tokenPreview:"Token",createdAt:"Creado",lastUsedAt:"Último uso",expiresAt:"Expira",active:"Activo",inactive:"Inactivo",never:"Nunca",noExpiration:"Sin expiración",create:"Crear",creating:"Creando…",editToken:"Editar token",deleteToken:"Eliminar token",deleteConfirm:"¿Está seguro de que desea eliminar este token? Esta acción no se puede deshacer.",createToken:"Crear token de acceso personal",expirationDate:"Fecha de expiración (opcional)",tokenCreated:"Token creado exitosamente",tokenCreatedWarning:"Guarde este token ahora. ¡No podrá verlo de nuevo!",copyToken:"Copiar token",tokenCopied:"Token copiado al portapapeles",tokenDeleted:"Token eliminado exitosamente",tokenUpdated:"Token actualizado exitosamente"},h8={searchLabel:"Su búsqueda",searchPlaceholder:"Buscar"},m8={parts:"Sub-partes",openListOfParts:"Abrir la lista de sub-partes",noTitle:"(sin título)"},p8={en:"Inglés",fr:"Francés",es:"Español",de:"Alemán",it:"Italiano",pt:"Portugués"},g8={setPublishDate:"Cambiar fecha de publicación de la sub-parte"},y8={title:"Mover una sub-parte",menuLabel:"Mover",searchPlaceholder:"Buscar un destino…"},v8={mediaDeleted:"Medio eliminado",uploadError:"El medio '{{ filename }}' no ha sido recibido."},b8={label:"Sub-partes",addPart:"Agregar una sub-parte",reorderParts:"Reordenar",partDeleted:"Sub-parte eliminada",confirmItemDeletion:"¿Desea eliminar esta sub-parte?",createPart:"Crear una sub-parte"},S8={addChild:"Agregar"},x8={editPublishDate:"Editar fecha de publicación",setPublishDate:"Publicar o programar",updateDraft:"Actualizar borrador",view:"Ver",preview:"Vista previa",MD:"D",MDTooltip:"Una descripción está presente",MK:"K",MKTooltip:"Las palabras clave están presentes"},w8={documentDeletingConfirmationMessage:'¿Desea eliminar el artículo "{{title}}"?',deleteJustThisArticle:'Eliminar solo este artículo en "{{language}}"',deleteThisArticle:"Eliminar este artículo",deleteAllTranslations:"Eliminar todas las traducciones",cannotDeleteLastHomeLanguage:"El documento de inicio debe tener al menos un idioma. No puede eliminar la última traducción restante."},D8={switchToDraftConfirmationMessage:"¿Le gustaría cambiar este documento a borrador? Ya no será accesible desde el sitio web."},N8={seoSettings:"Configuración SEO",title:"Título:",slug:"Slug:",metaDescription:"Descripción:",metaKeywords:"Palabras clave:",chooseFeatureImage:"Imagen destacada"},C8={translations:"Traducciones",status:"Estado",draft:"Borrador",maximumChildPartsReached:"Ha alcanzado el límite de sub-partes.",translated:"Documentos",notTranslated:"No traducidos",allTranslated:"Todos los documentos están traducidos."},E8={changeDisplayOrder:"Cambiar orden de visualización"},A8={switchAndTranslateConfirmationMesage:"¿Desea traducir"},M8={confirmationMessage:"¿Le gustaría guardar sus actualizaciones?",stayAndEditing:"Continuar editando",cancelWithoutSave:"Salir sin guardar"},T8={title:"Selección",selectedItems:"Seleccionado:",availableItems:"Disponible:",emptySelection:"No hay elemento seleccionado"},j8={editCluster:"Editar el clúster"},k8={title:"Clúster",description:"Seleccione qué documentos de enrutamiento deben existir en este clúster. Los documentos con hijos no se pueden eliminar.",apply:"Aplicar",cannotDeleteWithChildren:"No se puede eliminar documento de enrutamiento con hijos",cannotDeleteParentWithCheckedChildren:"No se puede desmarcar padre cuando hijos están marcados",cannotDeleteDocumentHasChildren:"No se puede eliminar el documento porque tiene hijos",cannotDeleteClusterHasChildren:"No se puede eliminar el clúster porque tiene hijos",cannotDeleteClusterHasChildrenInOtherLanguages:"No se puede eliminar el clúster porque tiene documentos adjuntos en otros idiomas",parentMustBeChecked:"El documento padre debe estar marcado primero",hasChildren:"tiene hijos",removeCluster:"Eliminar clúster",removeClusterAllLanguages:"Eliminar clúster en todos los idiomas"},$8={cluster:"Clúster",confirmCurrentLanguageDeletion:"¿Está seguro de que desea eliminar este clúster en <strong>{{language}}</strong>?",confirmAllLanguagesDeletion:"¿Está seguro de que desea eliminar este clúster en <strong>todos los idiomas</strong>?",documentsToDelete:"Los siguientes documentos de enrutamiento serán eliminados"},O8={inLanguage:"en {{language}}",translateDocumentInto:"Traducir el documento al {{language}}",translatePartInto:"Traducir la sub-parte al {{language}}",switchToDraft:"Cambiar a borrador",deletion:"Eliminación",editItem:"Sub-parte {{orderNum}} ({{typeLabel}})",title:"Título",edit:"Editar",delete:"Eliminar",save:"Guardar",saved:"Guardado",created:"Creado",done:"Hecho",close:"Cerrar",validate:"Validar",translate:"Traducir",publish:"Publicar",published:"Publicado",schedule:"Programar",scheduled:"Programado",draft:"Borrador",publishDate:"Fecha de publicación",cancel:"Cancelar",confirm:"Confirmar",confirmation:"Confirmación",email:"E-mail",name:"Nombre",thumbnail:"Miniatura",colon:"{{label}}:",fold:"plegar",unfold:"desplegar",invalidJson:"JSON inválido",yes:"Sí",no:"No",select:"Seleccionar",public:"Público",protected:"Protegido",passwordPlaceholder:"Ingrese contraseña",details:"Detalles",documents:"documentos",Documents:"Documentos"},R8={signIn:"Iniciar sesión",password:"Contraseña",signin:"Iniciar sesión",or:"o",failedMessage:"E-mail o contraseña incorrectos.",signInWithGoogle:"Iniciar sesión con Google",signInWithLocalAccount:"Iniciar sesión con una cuenta local"},L8={invalidToken:"Lo sentimos, su token no es válido o ya no es válido.",newPassword:"Nueva contraseña",confirmPassword:"Ingrese nuevamente su contraseña",validate:"Validar",resetPassword:"Restablecer su contraseña",nonIdenticalPasswords:"Contraseñas no idénticas"},P8={accounts:"Cuentas",active:"Activo",addAccount:"Agregar cuenta",userAccounts:"Cuentas de Usuario",createAnAccount:"Crear una cuenta",editUserAccount:"Editar una cuenta de usuario",loginMethod:"Método de inicio de sesión",passwordBeingReset:"Contraseña siendo restablecida",reactivateAccount:"Reactivar cuenta",resetPasswordButton:"Restablecer contraseña",roles:"Roles",roleAdmin:"Administrador",roleEditor:"Editor",linkedAuthors:"Autores vinculados",resetPasswordDialog:{title:"Restablecimiento de contraseña",description:"¿Le gustaría restablecer la contraseña de la cuenta?"},deleteAccountDialog:{title:"Eliminar cuenta",description:"¿Le gustaría eliminar esta cuenta?"},makeCreateAccountDialog:{accountType:"Tipo de cuenta",localAccount:"Cuenta local",googleAccount:"Cuenta de Google"}},I8={parentNotTranslated:"Lo siento, este documento no se puede traducir, el documento padre debe ser traducido primero."},z8={backup:"Copia de seguridad",prepareBackup:"Preparar una copia de seguridad",backupFileSizeLabel:"Tamaño del archivo de copia de seguridad:",fileName:"Nombre del archivo",fileSize:"Tamaño",createdAt:"Fecha",actions:"Acciones",download:"Descargar",delete:"Eliminar",confirmDeleteTitle:"Eliminar copia de seguridad",confirmDeleteMessage:"¿Está seguro de que desea eliminar este archivo de copia de seguridad? Esta acción no se puede deshacer.",backupDeleted:"Copia de seguridad eliminada con éxito",backupCreated:"Copia de seguridad creada con éxito",backupReady:"Su copia de seguridad está lista para descargar."},_8={eventLog:"Registro de eventos",searchPlaceholder:"Buscar en eventos...",createdAt:"Fecha/Hora",eventType:"Tipo de evento",actor:"Actor",targetType:"Tipo de objetivo",targetId:"ID de objetivo",eventData:"Datos del evento",noEventData:"Sin datos de evento",jsonParseError:"Error al analizar JSON",eventDetails:"Detalles del evento"},U8={notFound:"Recurso no encontrado",returnHomePage:"Volver a nuestra Página de Inicio"},B8={title:"Historial de versiones",noHistory:"No hay historial de versiones disponible",restore:"Restaurar",restored:"Restaurado",dateColumn:"Fecha",tierColumn:"Tipo",changesColumn:"Cambios",documentMetadata:"Metadatos del documento",tierShort:"Reciente",tierMedium:"Regular",tierLong:"Archivo",beforeRestore:"Guardado automático antes de restaurar"},F8={lastModified:"Última modificación"},H8={invalidFile:"Archivo inválido: {{ filename }}"},q8={chooseAFile:"Elegir",deleteThisFile:"¿Desea eliminar este archivo?",orderTheMedia:"Reordenar",dragAndDropMedia:"Reordenar medios",cancelUpload:"Cancelar subida",replace:"Reemplazar",properties:"Propiedades",deleteFileModalTitle:"Eliminación de medio",dropFilesHere:"Suba sus archivos aquí…",mediaLimitReached:"Se ha alcanzado el límite de medios.",mediaProperties:{fileProperties:"Propiedades del archivo",imageProperties:"Propiedades de la imagen",fileStored:"Archivo almacenado:",imageStored:"Imagen almacenada:",format:"formato",originalFileName:"Nombre del archivo original:",caption:"Leyenda:",pixelRatio:"Relación de píxeles:",usedSizes:"Tamaños utilizados:",auto:"Auto"}},V8={sizeFormatter:o8,selectALanguage:l8,errorOccurred:c8,Dashboard:u8,app:d8,personalAccessTokens:f8,DocumentSearch:h8,NavBar:m8,languages:p8,part:g8,movePart:y8,DocumentEditPanel:v8,list:b8,documentType:S8,DocumentControl:x8,DeleteDocument:w8,SwitchToDraft:D8,DocumentView:N8,DocumentListPanel:C8,ReorderDocumentDialog:E8,SwitchAndTranslateDocument:A8,SaveChangesOrCancelDialog:M8,SelectTermsDialog:T8,DocumentControlPanel:j8,ClusterManagementDialog:k8,ClusterManagementConfirmDialog:$8,common:O8,LoginScreen:R8,PasswordReset:L8,AccountScreen:P8,TranslateDocumentDialog:I8,BackupScreen:z8,EventLogScreen:_8,NotFoundScreen:U8,VersionHistoryDialog:B8,DocumentTable:F8,mediaField:H8,mediaGallery:q8},K8={B:"o",GB:"Go",MB:"Mo",KB:"Ko"},G8="Sélectionnez une langue",Y8="Une erreur s'est produite",J8="Tableau de bord",X8={logout:"Se déconnecter",adminUiTitle:"Admin - {{siteTitle}}",dev:"DÉV",adminArea:"Espace d'administration",settings:"Configuration",siteProperties:"Propriétés du site",successfulUpdate:"Mise à jour réussie",updateFailed:"Mise à jour échouée",saveChanges:"Enregistrer",tooltipTranslateMessage:"{{language}} (Traduire)",userSettings:"Paramètres utilisateur",preferences:"Préférences",administrationLanguage:"Language de l'espace d'administration :",PoweredBy:"Propulsé par",loginMethod:{local:"Local",localDev:"Local Dev",platform:"Plateforme",platformAdmin:"Admin Plateforme"},openSite:"Ouvrir le site"},W8={title:"Jetons d'accès personnels",intro:"Les jetons permettent aux outils externes et aux scripts d'accéder à votre contenu de manière programmatique.",createNew:"Créer un nouveau jeton",noTokens:"Aucun jeton d'accès personnel pour le moment",description:"Description",descriptionOptional:"Description (optionnel)",tokenPreview:"Jeton",createdAt:"Créé le",lastUsedAt:"Dernière utilisation",expiresAt:"Expire le",active:"Actif",inactive:"Inactif",never:"Jamais",noExpiration:"Pas d'expiration",create:"Créer",creating:"Création…",editToken:"Modifier le jeton",deleteToken:"Supprimer le jeton",deleteConfirm:"Êtes-vous sûr de vouloir supprimer ce jeton ? Cette action ne peut pas être annulée.",createToken:"Créer un jeton d'accès personnel",expirationDate:"Date d'expiration (facultative)",tokenCreated:"Jeton créé avec succès",tokenCreatedWarning:"Enregistrez ce jeton maintenant. Vous ne pourrez plus le voir !",copyToken:"Copier le jeton",tokenCopied:"Jeton copié dans le presse-papiers",tokenDeleted:"Jeton supprimé avec succès",tokenUpdated:"Jeton mis à jour avec succès"},Q8={searchLabel:"Votre recherche",searchPlaceholder:"Rechercher"},Z8={parts:"Sous-parties",openListOfParts:"Ouvrir la liste des sous-rubriques",noTitle:"(pas de titre)"},eq={en:"anglais",fr:"français",es:"espagnol",de:"allemand",it:"italien",pt:"portugais"},tq={setPublishDate:"Modifier la date de publication de la sous-partie"},nq={title:"Déplacer une sous-partie",menuLabel:"Déplacer",searchPlaceholder:"Rechercher une destination…"},aq={mediaDeleted:"Média supprimé",uploadError:"Le fichier '{{ filename }}' n'a pas été reçu."},iq={label:"Sous-parties",addPart:"Ajouter une sous-partie",reorderParts:"Réordonner",partDeleted:"Sous-partie supprimée",confirmItemDeletion:"Voulez-vous supprimer cette sous-partie ?",createPart:"Créer une sous-partie"},rq={addChild:"Ajouter"},sq={editPublishDate:"Changer la date de publication",setPublishDate:"Publier ou programmer",updateDraft:"Enregistrer le brouillon",view:"Voir",preview:"Aperçu",MD:"D",MDTooltip:"Une description est présente",MK:"M",MKTooltip:"Des mot-clés sont présents"},oq={switchToDraftConfirmationMessage:"Souhaitez-vous passer ce document en brouillon ? Il ne sera plus accessible depuis le site web."},lq={documentDeletingConfirmationMessage:`Voulez-vous supprimer l'article "{{title}}"?`,deleteJustThisArticle:'Supprimer uniquement cet article "{{language}}"',deleteThisArticle:"Supprimer cet article",deleteAllTranslations:"Supprimer toutes les traductions",cannotDeleteLastHomeLanguage:"Le document d'accueil doit avoir au moins une langue. Vous ne pouvez pas supprimer la dernière traduction restante."},cq={seoSettings:"Paramètres SEO",title:"Titre :",slug:"Slug :",metaDescription:"Description :",metaKeywords:"Mot-clés :",chooseFeatureImage:"Image mise en avant"},uq={translations:"Traductions",status:"Statut",draft:"Brouillon",maximumChildPartsReached:"Vous avez atteint la limite des sous-parties.",translated:"Documents",notTranslated:"Non traduits",allTranslated:"Tous les documents sont traduits."},dq={changeDisplayOrder:"Modifier l'ordre d'affichage"},fq={switchAndTranslateConfirmationMesage:"Souhaitez-vous traduire"},hq={confirmationMessage:"Souhaitez-vous enregistrer vos modifications ?",stayAndEditing:"Continuer à éditer",cancelWithoutSave:"Quitter sans enregistrer"},mq={title:"Sélection",selectedItems:"Sélectionnés :",availableItems:"Disponibles :",emptySelection:"Aucun item sélectionné"},pq={editCluster:"Modifier le cluster"},gq={title:"Cluster",description:"Sélectionnez quels documents de routage doivent exister dans ce cluster. Les documents avec des enfants ne peuvent pas être supprimés.",apply:"Appliquer",cannotDeleteWithChildren:"Impossible de supprimer un document de routage avec des enfants",cannotDeleteParentWithCheckedChildren:"Impossible de décocher un parent quand des enfants sont cochés",cannotDeleteDocumentHasChildren:"Impossible de supprimer le document car il a des enfants",cannotDeleteClusterHasChildren:"Impossible de supprimer le cluster car il a des enfants",cannotDeleteClusterHasChildrenInOtherLanguages:"Impossible de supprimer le cluster car il a des documents attachés dans d'autres langues",parentMustBeChecked:"Le document parent doit être coché en premier",hasChildren:"a des enfants",removeCluster:"Supprimer le cluster",removeClusterAllLanguages:"Supprimer le cluster dans toutes les langues"},yq={cluster:"Cluster",confirmCurrentLanguageDeletion:"Êtes-vous sûr de vouloir supprimer ce cluster en <strong>{{language}}</strong> ?",confirmAllLanguagesDeletion:"Êtes-vous sûr de vouloir supprimer ce cluster dans <strong>toutes les langues</strong> ?",documentsToDelete:"Les documents de routage suivants seront supprimés"},vq={inLanguage:"en {{language}}",translateDocumentInto:"Traduire le document en {{language}}",translatePartInto:"Traduire la sous-partie en {{language}}",switchToDraft:"Passer en brouillon",deletion:"Suppression",editItem:"Sous-partie {{orderNum}} ({{typeLabel}})",title:"Titre",edit:"Éditer",delete:"Supprimer",save:"Enregistrer",saved:"Enregistré",created:"Créé",done:"Terminé",close:"Fermer",validate:"Valider",translate:"Traduire",publish:"Publier",published:"Publié",schedule:"Programmer",scheduled:"Programmé",draft:"Brouillon",publishDate:"Date de publication",cancel:"Annuler",confirm:"Valider",confirmation:"Confirmation",email:"E-mail",name:"Nom",thumbnail:"Miniature",colon:"{{label}} :",fold:"replier",unfold:"déplier",invalidJson:"Le JSON est invalide",yes:"Oui",no:"Non",select:"Sélectionner",public:"Public",protected:"Protégé",passwordPlaceholder:"Saisissez le mot de passe",details:"Détails",documents:"documents",Documents:"Documents"},bq={signIn:"Se connecter",password:"Mot de passe",signin:"Se connecter",or:"ou",failedMessage:"E-mail ou mot de passe incorrect",signInWithGoogle:"Se connecter avec Google",signInWithLocalAccount:"Se connecter avec un compte local"},Sq={invalidToken:"Désolé, votre token n'est pas ou plus valide.",newPassword:"Nouveau mot de passe",confirmPassword:"Saisissez encore votre mot de passe",validate:"Valider",resetPassword:"Réinitialiser votre mot de passe",nonIdenticalPasswords:"Mots de passe non identiques"},xq={accounts:"Comptes",active:"Actif",addAccount:"Ajouter un compte",userAccounts:"Comptes utilisateurs",createAnAccount:"Créer un compte",editUserAccount:"Édition d'un compte utilisateur",loginMethod:"Méthode de connexion",passwordBeingReset:"Mot de passe en cours de réinitialisation",reactivateAccount:"Réactiver le compte",resetPasswordButton:"Réinitialiser le mot de passe",roles:"Rôles",roleAdmin:"Administrateur",roleEditor:"Éditeur",linkedAuthors:"Auteurs liés",resetPasswordDialog:{title:"Réinitialisation du mot de passe",description:"Souhaitez-vous réinitialiser le mot de passe du compte?"},deleteAccountDialog:{title:"Suppression d'un compte",description:"Souhaitez-vous supprimer ce compte ?"},makeCreateAccountDialog:{accountType:"Type de compte",localAccount:"Compte local",googleAccount:"Compte Google"}},wq={parentNotTranslated:"Désolé, ce document ne peut pas être traduit, le document parent doit d'abord être traduit."},Dq={backup:"Sauvegarde",prepareBackup:"Préparer une sauvegarde",backupFileSizeLabel:"Taille du fichier de sauvegarde :",fileName:"Nom du fichier",fileSize:"Taille",createdAt:"Date",actions:"Actions",download:"Télécharger",delete:"Supprimer",confirmDeleteTitle:"Supprimer la sauvegarde",confirmDeleteMessage:"Êtes-vous sûr de vouloir supprimer ce fichier de sauvegarde ? Cette action est irréversible.",backupDeleted:"Sauvegarde supprimée avec succès",backupCreated:"Sauvegarde créée avec succès",backupReady:"Votre sauvegarde est prête à être téléchargée."},Nq={eventLog:"Journal des événements",searchPlaceholder:"Rechercher dans les événements...",createdAt:"Date/Heure",eventType:"Type d'événement",actor:"Acteur",targetType:"Type de cible",targetId:"ID de cible",eventData:"Données de l'événement",noEventData:"Aucune donnée d'événement",jsonParseError:"Échec de l'analyse JSON",eventDetails:"Détails de l'événement"},Cq={notFound:"Ressource non trouvée",returnHomePage:"Retourner sur la page d'accueil"},Eq={title:"Historique des versions",noHistory:"Aucun historique de version disponible",restore:"Restaurer",restored:"Restauré",dateColumn:"Date",tierColumn:"Type",changesColumn:"Modifications",documentMetadata:"Métadonnées du document",tierShort:"Récent",tierMedium:"Régulier",tierLong:"Archive",beforeRestore:"Sauvegarde auto avant restauration"},Aq={lastModified:"Dernière modification"},Mq={invalidFile:"Fichier invalide : {{ filename }}"},Tq={chooseAFile:"Choisir",deleteThisFile:"Voulez-vous supprimer ce fichier?",orderTheMedia:"Réordonner",dragAndDropMedia:"Réordonner les médias",cancelUpload:"Annuler l'upload",replace:"Remplacer",properties:"Propriétés",deleteFileModalTitle:"Suppression de média",dropFilesHere:"Déposez vos fichiers ici…",mediaLimitReached:"La limite des médias a été atteinte.",mediaProperties:{fileProperties:"Propriétés du fichier",imageProperties:"Propriétés de l'image",fileStored:"Fichier stocké :",imageStored:"Image stockée :",format:"format",originalFileName:"Nom du fichier original :",caption:"Légende :",pixelRatio:"Ratio de pixels :",usedSizes:"Tailles utilisées :",auto:"Automatique"}},jq={sizeFormatter:K8,selectALanguage:G8,errorOccurred:Y8,Dashboard:J8,app:X8,personalAccessTokens:W8,DocumentSearch:Q8,NavBar:Z8,languages:eq,part:tq,movePart:nq,DocumentEditPanel:aq,list:iq,documentType:rq,DocumentControl:sq,SwitchToDraft:oq,DeleteDocument:lq,DocumentView:cq,DocumentListPanel:uq,ReorderDocumentDialog:dq,SwitchAndTranslateDocument:fq,SaveChangesOrCancelDialog:hq,SelectTermsDialog:mq,DocumentControlPanel:pq,ClusterManagementDialog:gq,ClusterManagementConfirmDialog:yq,common:vq,LoginScreen:bq,PasswordReset:Sq,AccountScreen:xq,TranslateDocumentDialog:wq,BackupScreen:Dq,EventLogScreen:Nq,NotFoundScreen:Cq,VersionHistoryDialog:Eq,DocumentTable:Aq,mediaField:Mq,mediaGallery:Tq},kq={B:"B",GB:"GB",MB:"MB",KB:"KB"},$q="Seleziona una lingua",Oq="Si è verificato un errore",Rq="Dashboard",Lq={logout:"Disconnetti",adminUiTitle:"Admin - {{siteTitle}}",dev:"SVL",adminArea:"Area di amministrazione",settings:"Impostazioni",siteProperties:"Proprietà del sito",successfulUpdate:"Aggiornamento riuscito",updateFailed:"Aggiornamento fallito",saveChanges:"Salva",tooltipTranslateMessage:"{{language}} (Traduci)",userSettings:"Impostazioni utente",preferences:"Preferenze",administrationLanguage:"Lingua dell'area di amministrazione:",PoweredBy:"Alimentato da",loginMethod:{local:"Locale",localDev:"Locale Dev",platform:"Piattaforma",platformAdmin:"Admin Piattaforma"},openSite:"Apri sito"},Pq={title:"Token di accesso personali",intro:"I token consentono a strumenti esterni e script di accedere ai contenuti in modo programmatico.",createNew:"Crea nuovo token",noTokens:"Nessun token di accesso personale ancora",description:"Descrizione",descriptionOptional:"Descrizione (opzionale)",tokenPreview:"Token",createdAt:"Creato",lastUsedAt:"Ultimo utilizzo",expiresAt:"Scade",active:"Attivo",inactive:"Inattivo",never:"Mai",noExpiration:"Nessuna scadenza",create:"Crea",creating:"Creazione…",editToken:"Modifica token",deleteToken:"Elimina token",deleteConfirm:"Sei sicuro di voler eliminare questo token? Questa azione non può essere annullata.",createToken:"Crea token di accesso personale",expirationDate:"Data di scadenza (opzionale)",tokenCreated:"Token creato con successo",tokenCreatedWarning:"Salva questo token ora. Non potrai più vederlo!",copyToken:"Copia token",tokenCopied:"Token copiato negli appunti",tokenDeleted:"Token eliminato con successo",tokenUpdated:"Token aggiornato con successo"},Iq={searchLabel:"La tua ricerca",searchPlaceholder:"Cerca"},zq={parts:"Sotto-parti",openListOfParts:"Apri la lista delle sotto-parti",noTitle:"(nessun titolo)"},_q={en:"Inglese",fr:"Francese",es:"Spagnolo",de:"Tedesco",it:"Italiano",pt:"Portoghese"},Uq={setPublishDate:"Cambia data di pubblicazione della sotto-parte"},Bq={title:"Sposta una sotto-parte",menuLabel:"Sposta",searchPlaceholder:"Cerca una destinazione…"},Fq={mediaDeleted:"Media eliminato",uploadError:"Il media '{{ filename }}' non è stato ricevuto."},Hq={label:"Sotto-parti",addPart:"Aggiungi una sotto-parte",reorderParts:"Riordina",partDeleted:"Sotto-parte eliminata",confirmItemDeletion:"Vuoi eliminare questa sotto-parte?",createPart:"Crea una sotto-parte"},qq={addChild:"Aggiungi"},Vq={editPublishDate:"Modifica data di pubblicazione",setPublishDate:"Pubblica o programma",updateDraft:"Aggiorna bozza",view:"Visualizza",preview:"Anteprima",MD:"D",MDTooltip:"Una descrizione è presente",MK:"P",MKTooltip:"Le parole chiave sono presenti"},Kq={documentDeletingConfirmationMessage:`Vuoi eliminare l'articolo "{{title}}"?`,deleteJustThisArticle:'Elimina solo questo articolo in "{{language}}"',deleteThisArticle:"Elimina questo articolo",deleteAllTranslations:"Elimina tutte le traduzioni",cannotDeleteLastHomeLanguage:"Il documento home deve avere almeno una lingua. Non puoi eliminare l'ultima traduzione rimasta."},Gq={switchToDraftConfirmationMessage:"Vorresti cambiare questo documento in bozza? Non sarà più accessibile dal sito web."},Yq={seoSettings:"Impostazioni SEO",title:"Titolo:",slug:"Slug:",metaDescription:"Descrizione:",metaKeywords:"Parole chiave:",chooseFeatureImage:"Immagine in evidenza"},Jq={translations:"Traduzioni",status:"Stato",draft:"Bozza",maximumChildPartsReached:"Hai raggiunto il limite delle sotto-parti.",translated:"Documenti",notTranslated:"Non tradotti",allTranslated:"Tutti i documenti sono tradotti."},Xq={changeDisplayOrder:"Cambia ordine di visualizzazione"},Wq={switchAndTranslateConfirmationMesage:"Vuoi tradurre"},Qq={confirmationMessage:"Vorresti salvare i tuoi aggiornamenti?",stayAndEditing:"Continua a modificare",cancelWithoutSave:"Esci senza salvare"},Zq={title:"Selezione",selectedItems:"Selezionato:",availableItems:"Disponibile:",emptySelection:"Nessun elemento selezionato"},eV={editCluster:"Modifica il cluster"},tV={title:"Cluster",description:"Seleziona quali documenti di routing devono esistere in questo cluster. I documenti con figli non possono essere eliminati.",apply:"Applica",cannotDeleteWithChildren:"Impossibile eliminare documento di routing con figli",cannotDeleteParentWithCheckedChildren:"Impossibile deselezionare genitore quando i figli sono selezionati",cannotDeleteDocumentHasChildren:"Impossibile eliminare il documento perché ha figli",cannotDeleteClusterHasChildren:"Impossibile eliminare il cluster perché ha figli",cannotDeleteClusterHasChildrenInOtherLanguages:"Impossibile eliminare il cluster perché ha documenti allegati in altre lingue",parentMustBeChecked:"Il documento padre deve essere selezionato prima",hasChildren:"ha figli",removeCluster:"Rimuovi cluster",removeClusterAllLanguages:"Rimuovi cluster in tutte le lingue"},nV={cluster:"Cluster",confirmCurrentLanguageDeletion:"Sei sicuro di voler eliminare questo cluster in <strong>{{language}}</strong>?",confirmAllLanguagesDeletion:"Sei sicuro di voler eliminare questo cluster in <strong>tutte le lingue</strong>?",documentsToDelete:"I seguenti documenti di routing saranno eliminati"},aV={inLanguage:"in {{language}}",translateDocumentInto:"Traduci il documento in {{language}}",translatePartInto:"Traduci la sotto-parte in {{language}}",switchToDraft:"Cambia in bozza",deletion:"Eliminazione",editItem:"Sotto-parte {{orderNum}} ({{typeLabel}})",title:"Titolo",edit:"Modifica",delete:"Elimina",save:"Salva",saved:"Salvato",created:"Creato",done:"Fatto",close:"Chiudi",validate:"Valida",translate:"Traduci",publish:"Pubblica",published:"Pubblicato",schedule:"Programma",scheduled:"Programmato",draft:"Bozza",publishDate:"Data di pubblicazione",cancel:"Annulla",confirm:"Conferma",confirmation:"Conferma",email:"E-mail",name:"Nome",thumbnail:"Miniatura",colon:"{{label}}:",fold:"piega",unfold:"spiega",invalidJson:"JSON non valido",yes:"Sì",no:"No",select:"Seleziona",public:"Pubblico",protected:"Protetto",passwordPlaceholder:"Inserisci password",details:"Dettagli",documents:"documenti",Documents:"Documenti"},iV={signIn:"Accedi",password:"Password",signin:"Accedi",or:"o",failedMessage:"E-mail o password errati.",signInWithGoogle:"Accedi con Google",signInWithLocalAccount:"Accedi con un account locale"},rV={invalidToken:"Spiacenti, il tuo token non è valido o non è più valido.",newPassword:"Nuova password",confirmPassword:"Inserisci di nuovo la tua password",validate:"Valida",resetPassword:"Reimposta la tua password",nonIdenticalPasswords:"Password non identiche"},sV={accounts:"Account",active:"Attivo",addAccount:"Aggiungi account",userAccounts:"Account Utente",createAnAccount:"Crea un account",editUserAccount:"Modifica un account utente",loginMethod:"Metodo di accesso",passwordBeingReset:"Password in fase di reimpostazione",reactivateAccount:"Riattiva account",resetPasswordButton:"Reimposta password",roles:"Ruoli",roleAdmin:"Amministratore",roleEditor:"Redattore",linkedAuthors:"Autori collegati",resetPasswordDialog:{title:"Reimpostazione password",description:"Vorresti reimpostare la password dell'account?"},deleteAccountDialog:{title:"Elimina account",description:"Vorresti eliminare questo account?"},makeCreateAccountDialog:{accountType:"Tipo di account",localAccount:"Account locale",googleAccount:"Account Google"}},oV={parentNotTranslated:"Spiacente, questo documento non può essere tradotto, il documento genitore deve essere tradotto prima."},lV={backup:"Backup",prepareBackup:"Prepara un backup",backupFileSizeLabel:"Dimensione del file di backup:",fileName:"Nome file",fileSize:"Dimensione",createdAt:"Data",actions:"Azioni",download:"Scarica",delete:"Elimina",confirmDeleteTitle:"Elimina backup",confirmDeleteMessage:"Sei sicuro di voler eliminare questo file di backup? Questa azione non può essere annullata.",backupDeleted:"Backup eliminato con successo",backupCreated:"Backup creato con successo",backupReady:"Il tuo backup è pronto per il download."},cV={eventLog:"Registro eventi",searchPlaceholder:"Cerca negli eventi...",createdAt:"Data/Ora",eventType:"Tipo di evento",actor:"Attore",targetType:"Tipo di destinazione",targetId:"ID destinazione",eventData:"Dati evento",noEventData:"Nessun dato evento",jsonParseError:"Errore durante l'analisi JSON",eventDetails:"Dettagli evento"},uV={notFound:"Risorsa non trovata",returnHomePage:"Torna alla nostra Pagina Iniziale"},dV={title:"Cronologia versioni",noHistory:"Nessuna cronologia versioni disponibile",restore:"Ripristina",restored:"Ripristinato",dateColumn:"Data",tierColumn:"Tipo",changesColumn:"Modifiche",documentMetadata:"Metadati del documento",tierShort:"Recente",tierMedium:"Regolare",tierLong:"Archivio",beforeRestore:"Salvataggio automatico prima del ripristino"},fV={lastModified:"Ultima modifica"},hV={invalidFile:"File non valido: {{ filename }}"},mV={chooseAFile:"Scegli",deleteThisFile:"Vuoi eliminare questo file?",orderTheMedia:"Riordina",dragAndDropMedia:"Riordina media",cancelUpload:"Annulla caricamento",replace:"Sostituisci",properties:"Proprietà",deleteFileModalTitle:"Eliminazione media",dropFilesHere:"Carica i tuoi file qui…",mediaLimitReached:"È stato raggiunto il limite dei media.",mediaProperties:{fileProperties:"Proprietà del file",imageProperties:"Proprietà dell'immagine",fileStored:"File memorizzato:",imageStored:"Immagine memorizzata:",format:"formato",originalFileName:"Nome file originale:",caption:"Didascalia:",pixelRatio:"Rapporto pixel:",usedSizes:"Dimensioni utilizzate:",auto:"Auto"}},pV={sizeFormatter:kq,selectALanguage:$q,errorOccurred:Oq,Dashboard:Rq,app:Lq,personalAccessTokens:Pq,DocumentSearch:Iq,NavBar:zq,languages:_q,part:Uq,movePart:Bq,DocumentEditPanel:Fq,list:Hq,documentType:qq,DocumentControl:Vq,DeleteDocument:Kq,SwitchToDraft:Gq,DocumentView:Yq,DocumentListPanel:Jq,ReorderDocumentDialog:Xq,SwitchAndTranslateDocument:Wq,SaveChangesOrCancelDialog:Qq,SelectTermsDialog:Zq,DocumentControlPanel:eV,ClusterManagementDialog:tV,ClusterManagementConfirmDialog:nV,common:aV,LoginScreen:iV,PasswordReset:rV,AccountScreen:sV,TranslateDocumentDialog:oV,BackupScreen:lV,EventLogScreen:cV,NotFoundScreen:uV,VersionHistoryDialog:dV,DocumentTable:fV,mediaField:hV,mediaGallery:mV},gV={B:"B",GB:"GB",MB:"MB",KB:"KB"},yV="Selecionar um idioma",vV="Ocorreu um erro",bV="Painel de controle",SV={logout:"Sair",adminUiTitle:"Admin - {{siteTitle}}",dev:"DES",adminArea:"Área de administração",settings:"Configurações",siteProperties:"Propriedades do site",successfulUpdate:"Atualização bem-sucedida",updateFailed:"Atualização falhou",saveChanges:"Salvar",tooltipTranslateMessage:"{{language}} (Traduzir)",userSettings:"Configurações de usuário",preferences:"Preferências",administrationLanguage:"Idioma da área de administração:",PoweredBy:"Desenvolvido por",loginMethod:{local:"Local",localDev:"Local Dev",platform:"Plataforma",platformAdmin:"Admin Plataforma"},openSite:"Abrir site"},xV={title:"Tokens de acesso pessoal",intro:"Os tokens permitem que ferramentas externas e scripts acessem seu conteúdo programaticamente.",createNew:"Criar novo token",noTokens:"Ainda não há tokens de acesso pessoal",description:"Descrição",descriptionOptional:"Descrição (opcional)",tokenPreview:"Token",createdAt:"Criado",lastUsedAt:"Último uso",expiresAt:"Expira",active:"Ativo",inactive:"Inativo",never:"Nunca",noExpiration:"Sem expiração",create:"Criar",creating:"Criando…",editToken:"Editar token",deleteToken:"Excluir token",deleteConfirm:"Tem certeza de que deseja excluir este token? Esta ação não pode ser desfeita.",createToken:"Criar token de acesso pessoal",expirationDate:"Data de expiração (opcional)",tokenCreated:"Token criado com sucesso",tokenCreatedWarning:"Salve este token agora. Você não poderá vê-lo novamente!",copyToken:"Copiar token",tokenCopied:"Token copiado para a área de transferência",tokenDeleted:"Token excluído com sucesso",tokenUpdated:"Token atualizado com sucesso"},wV={searchLabel:"Sua pesquisa",searchPlaceholder:"Pesquisar"},DV={parts:"Sub-partes",openListOfParts:"Abrir a lista de sub-partes",noTitle:"(sem título)"},NV={en:"Inglês",fr:"Francês",es:"Espanhol",de:"Alemão",it:"Italiano",pt:"Português"},CV={setPublishDate:"Alterar data de publicação da sub-parte"},EV={title:"Mover uma sub-parte",menuLabel:"Mover",searchPlaceholder:"Procurar um destino…"},AV={mediaDeleted:"Mídia excluída",uploadError:"A mídia '{{ filename }}' não foi recebida."},MV={label:"Sub-partes",addPart:"Adicionar uma sub-parte",reorderParts:"Reordenar",partDeleted:"Sub-parte excluída",confirmItemDeletion:"Você deseja excluir esta sub-parte?",createPart:"Criar uma sub-parte"},TV={addChild:"Adicionar"},jV={editPublishDate:"Editar data de publicação",setPublishDate:"Publicar ou agendar",updateDraft:"Atualizar rascunho",view:"Visualizar",preview:"Pré-visualizar",MD:"D",MDTooltip:"Uma descrição está presente",MK:"P",MKTooltip:"Palavras-chave estão presentes"},kV={documentDeletingConfirmationMessage:'Você deseja excluir o artigo "{{title}}"?',deleteJustThisArticle:'Excluir apenas este artigo em "{{language}}"',deleteThisArticle:"Excluir este artigo",deleteAllTranslations:"Excluir todas as traduções",cannotDeleteLastHomeLanguage:"O documento inicial deve ter pelo menos um idioma. Você não pode excluir a última tradução restante."},$V={switchToDraftConfirmationMessage:"Você gostaria de alterar este documento para rascunho? Ele não será mais acessível a partir do site."},OV={seoSettings:"Configurações de SEO",title:"Título:",slug:"Slug:",metaDescription:"Descrição:",metaKeywords:"Palavras-chave:",chooseFeatureImage:"Imagem em destaque"},RV={translations:"Traduções",status:"Status",draft:"Rascunho",maximumChildPartsReached:"Você atingiu o limite de sub-partes.",translated:"Documentos",notTranslated:"Não traduzidos",allTranslated:"Todos os documentos estão traduzidos."},LV={changeDisplayOrder:"Alterar ordem de exibição"},PV={switchAndTranslateConfirmationMesage:"Você deseja traduzir"},IV={confirmationMessage:"Você gostaria de salvar suas atualizações?",stayAndEditing:"Continuar editando",cancelWithoutSave:"Sair sem salvar"},zV={title:"Seleção",selectedItems:"Selecionado:",availableItems:"Disponível:",emptySelection:"Nenhum item selecionado"},_V={editCluster:"Editar o cluster"},UV={title:"Cluster",description:"Selecione quais documentos de roteamento devem existir neste cluster. Documentos com filhos não podem ser excluídos.",apply:"Aplicar",cannotDeleteWithChildren:"Não é possível excluir documento de roteamento com filhos",cannotDeleteParentWithCheckedChildren:"Não é possível desmarcar pai quando filhos estão marcados",cannotDeleteDocumentHasChildren:"Não é possível excluir o documento porque tem filhos",cannotDeleteClusterHasChildren:"Não é possível excluir o cluster porque tem filhos",cannotDeleteClusterHasChildrenInOtherLanguages:"Não é possível excluir o cluster porque tem documentos anexados em outros idiomas",parentMustBeChecked:"O documento pai deve ser marcado primeiro",hasChildren:"tem filhos",removeCluster:"Remover cluster",removeClusterAllLanguages:"Remover cluster em todos os idiomas"},BV={cluster:"Cluster",confirmCurrentLanguageDeletion:"Tem certeza de que deseja excluir este cluster em <strong>{{language}}</strong>?",confirmAllLanguagesDeletion:"Tem certeza de que deseja excluir este cluster em <strong>todos os idiomas</strong>?",documentsToDelete:"Os seguintes documentos de roteamento serão excluídos"},FV={inLanguage:"em {{language}}",translateDocumentInto:"Traduzir o documento para {{language}}",translatePartInto:"Traduzir a sub-parte para {{language}}",switchToDraft:"Alternar para rascunho",deletion:"Exclusão",editItem:"Sub-parte {{orderNum}} ({{typeLabel}})",title:"Título",edit:"Editar",delete:"Excluir",save:"Salvar",saved:"Salvo",created:"Criado",done:"Feito",close:"Fechar",validate:"Validar",translate:"Traduzir",publish:"Publicar",published:"Publicado",schedule:"Agendar",scheduled:"Agendado",draft:"Rascunho",publishDate:"Data de publicação",cancel:"Cancelar",confirm:"Confirmar",confirmation:"Confirmação",email:"E-mail",name:"Nome",thumbnail:"Miniatura",colon:"{{label}}:",fold:"dobrar",unfold:"desdobrar",invalidJson:"JSON inválido",yes:"Sim",no:"Não",select:"Selecionar",public:"Público",protected:"Protegido",passwordPlaceholder:"Digite a senha",details:"Detalhes",documents:"documentos",Documents:"Documentos"},HV={signIn:"Entrar",password:"Senha",signin:"Entrar",or:"ou",failedMessage:"E-mail ou senha incorretos.",signInWithGoogle:"Entrar com Google",signInWithLocalAccount:"Entrar com uma conta local"},qV={invalidToken:"Desculpe, seu token não é válido ou não é mais válido.",newPassword:"Nova senha",confirmPassword:"Digite novamente sua senha",validate:"Validar",resetPassword:"Redefinir sua senha",nonIdenticalPasswords:"Senhas não idênticas"},VV={accounts:"Contas",active:"Ativo",addAccount:"Adicionar conta",userAccounts:"Contas de Usuário",createAnAccount:"Criar uma conta",editUserAccount:"Editar uma conta de usuário",loginMethod:"Método de login",passwordBeingReset:"Senha sendo redefinida",reactivateAccount:"Reativar conta",resetPasswordButton:"Redefinir senha",roles:"Funções",roleAdmin:"Administrador",roleEditor:"Editor",linkedAuthors:"Autores vinculados",resetPasswordDialog:{title:"Redefinição de senha",description:"Você gostaria de redefinir a senha da conta?"},deleteAccountDialog:{title:"Excluir conta",description:"Você gostaria de excluir esta conta?"},makeCreateAccountDialog:{accountType:"Tipo de conta",localAccount:"Conta local",googleAccount:"Conta do Google"}},KV={parentNotTranslated:"Desculpe, este documento não pode ser traduzido, o documento pai deve ser traduzido primeiro."},GV={backup:"Backup",prepareBackup:"Preparar um backup",backupFileSizeLabel:"Tamanho do arquivo de backup:",fileName:"Nome do arquivo",fileSize:"Tamanho",createdAt:"Data",actions:"Ações",download:"Baixar",delete:"Excluir",confirmDeleteTitle:"Excluir backup",confirmDeleteMessage:"Tem certeza de que deseja excluir este arquivo de backup? Esta ação não pode ser desfeita.",backupDeleted:"Backup excluído com sucesso",backupCreated:"Backup criado com sucesso",backupReady:"Seu backup está pronto para download."},YV={eventLog:"Registro de eventos",searchPlaceholder:"Pesquisar em eventos...",createdAt:"Data/Hora",eventType:"Tipo de evento",actor:"Ator",targetType:"Tipo de destino",targetId:"ID de destino",eventData:"Dados do evento",noEventData:"Sem dados de evento",jsonParseError:"Falha ao analisar JSON",eventDetails:"Detalhes do evento"},JV={notFound:"Recurso não encontrado",returnHomePage:"Retornar à nossa Página Inicial"},XV={title:"Histórico de versões",noHistory:"Nenhum histórico de versões disponível",restore:"Restaurar",restored:"Restaurado",dateColumn:"Data",tierColumn:"Tipo",changesColumn:"Alterações",documentMetadata:"Metadados do documento",tierShort:"Recente",tierMedium:"Regular",tierLong:"Arquivo",beforeRestore:"Salvo automaticamente antes da restauração"},WV={lastModified:"Última modificação"},QV={invalidFile:"Arquivo inválido: {{ filename }}"},ZV={chooseAFile:"Escolher",deleteThisFile:"Você deseja excluir este arquivo?",orderTheMedia:"Reordenar",dragAndDropMedia:"Reordenar mídias",cancelUpload:"Cancelar upload",replace:"Substituir",properties:"Propriedades",deleteFileModalTitle:"Exclusão de mídia",dropFilesHere:"Faça upload de seus arquivos aqui…",mediaLimitReached:"O limite de mídia foi atingido.",mediaProperties:{fileProperties:"Propriedades do arquivo",imageProperties:"Propriedades da imagem",fileStored:"Arquivo armazenado:",imageStored:"Imagem armazenada:",format:"formato",originalFileName:"Nome do arquivo original:",caption:"Legenda:",pixelRatio:"Proporção de pixels:",usedSizes:"Tamanhos utilizados:",auto:"Auto"}},eK={sizeFormatter:gV,selectALanguage:yV,errorOccurred:vV,Dashboard:bV,app:SV,personalAccessTokens:xV,DocumentSearch:wV,NavBar:DV,languages:NV,part:CV,movePart:EV,DocumentEditPanel:AV,list:MV,documentType:TV,DocumentControl:jV,DeleteDocument:kV,SwitchToDraft:$V,DocumentView:OV,DocumentListPanel:RV,ReorderDocumentDialog:LV,SwitchAndTranslateDocument:PV,SaveChangesOrCancelDialog:IV,SelectTermsDialog:zV,DocumentControlPanel:_V,ClusterManagementDialog:UV,ClusterManagementConfirmDialog:BV,common:FV,LoginScreen:HV,PasswordReset:qV,AccountScreen:VV,TranslateDocumentDialog:KV,BackupScreen:GV,EventLogScreen:YV,NotFoundScreen:JV,VersionHistoryDialog:XV,DocumentTable:WV,mediaField:QV,mediaGallery:ZV};async function tK(){await sn.use(a$).init({resources:{en:{translations:s8},fr:{translations:jq},es:{translations:V8},de:{translations:xH},it:{translations:pV},pt:{translations:eK}},fallbackLng:"en",defaultNS:"translations",interpolation:{escapeValue:!1}})}function nK(e,t){for(const[n,i]of Object.entries(e))sn.getResourceBundle(n,"translations")||sn.addResourceBundle(n,"translations",{},!0,!0),sn.addResourceBundle(n,"translations",{siteSchema:i},!0,!0);aK(t)}function aK(e){const t=[...new Set([...cc,...e])],n={};t.forEach(i=>{const s=[];cc.includes(i)&&s.push(i);const l=e.find(c=>cc.includes(c));l&&l!==i&&s.push(l),s.includes("en")||s.push("en"),n[i]=s}),sn.options.fallbackLng=n}const iK=ge`
|
|
697
|
-
query GetInitialData($fieldNames: [String!]!, $language: String){
|
|
698
|
-
authAccount {
|
|
699
|
-
preferences {
|
|
700
|
-
language
|
|
701
|
-
}
|
|
702
|
-
email
|
|
703
|
-
name
|
|
704
|
-
special
|
|
705
|
-
roles
|
|
706
|
-
permissions
|
|
707
|
-
}
|
|
708
|
-
|
|
709
|
-
siteConstants {
|
|
710
|
-
cmsVersion
|
|
711
|
-
siteSchema
|
|
712
|
-
siteConfiguration { enableMetaKeywords }
|
|
713
|
-
themeConf {
|
|
714
|
-
pixelRatio
|
|
715
|
-
fTextImageResizeRules
|
|
716
|
-
}
|
|
717
|
-
previewSecret
|
|
718
|
-
}
|
|
719
|
-
|
|
720
|
-
homeRoutingCluster
|
|
721
|
-
|
|
722
|
-
siteFieldValues(fieldNames: $fieldNames, language: $language)
|
|
723
|
-
|
|
724
|
-
plugins {
|
|
725
|
-
pluginName
|
|
726
|
-
adminUiPluginBaseUrl
|
|
727
|
-
confJson
|
|
728
|
-
}
|
|
729
|
-
}`;function rK(){return S.useCallback(async e=>{const t=await Se(iK,e),{siteConstants:n,homeRoutingCluster:i,siteFieldValues:s,authAccount:l}=t,{preferences:c,...d}=l;return{authAccount:d,preferences:c,siteConstants:{...n,siteSchema:JSON.parse(n.siteSchema)},homeRoutingCluster:JSON.parse(i),siteFieldValues:JSON.parse(s),plugins:t.plugins.map(h=>({pluginName:h.pluginName,adminUiPluginBaseUrl:h.adminUiPluginBaseUrl,conf:h.confJson?JSON.parse(h.confJson):void 0}))}},[])}function sK(){const e=$c(),t=rK(),n=Ge(b=>b.setInitialData),i=Ge(b=>b.setHomeRoutingCluster),s=Ge(b=>b.setSiteFieldValues),l=Ge(b=>b.setAuthAccount),c=Ge(b=>b.setPreferences),d=Kc(),h=na(),[m,y]=S.useState(!1),v=W4();return ct(async()=>{try{y(!1);const b=await t({fieldNames:["title"],language:h});n({cmsVersion:b.siteConstants.cmsVersion,siteSchema:b.siteConstants.siteSchema,themeConf:b.siteConstants.themeConf,siteConfiguration:b.siteConstants.siteConfiguration,previewSecret:b.siteConstants.previewSecret}),i(b.homeRoutingCluster),s(b.siteFieldValues),l(b.authAccount),c(b.preferences),nK(b.siteConstants.siteSchema.l10n,b.siteConstants.siteSchema.languages),await v(b.plugins,{fqdn:d.fqdn,publicSiteUrl:d.publicSiteUrl,themeConf:b.siteConstants.themeConf}),y(!0)}catch(b){e.error(b),rn.emit("fatalError",`Unexpected error: ${Fn(b)}`)}},[h]),m?f.jsx(TR,{router:P5()}):f.jsx(ln,{})}const oK=ge`
|
|
730
|
-
query {
|
|
731
|
-
migrationInfo {
|
|
732
|
-
currentSiteSchemaVersion
|
|
733
|
-
targetSiteSchemaVersion
|
|
734
|
-
}
|
|
735
|
-
}
|
|
736
|
-
`;function lK(){return S.useCallback(async()=>{const e=await Se(oK);return cK(e.migrationInfo)},[])}function cK(e){return{currentSiteSchemaVersion:e.currentSiteSchemaVersion,targetSiteSchemaVersion:e.targetSiteSchemaVersion}}const uK=ge`
|
|
737
|
-
mutation {
|
|
738
|
-
runSiteSchemaMigrations
|
|
739
|
-
}
|
|
740
|
-
`;function dK(){return S.useCallback(async()=>{await Se(uK)},[])}function fK(){return f.jsx(Cn,{children:f.jsx(hK,{})})}function hK(){const[e,t]=S.useState(!1),[n,i]=S.useState(),s=dK(),l=lK(),c=$c(),d=Ge(y=>y.publicConstants),{showAlert:h}=at();ct(async()=>{try{const y=await l();i(y)}catch(y){c.error("Failed to fetch migration info",y)}},[l]);const m=async()=>{try{await s(),t(!0),h("Site schema migration completed successfully!",{severity:"success"}),setTimeout(()=>{window.location.reload()},2e3)}catch(y){c.error("Migration failed",y),h(`Migration failed: ${Fn(y)}`,{severity:"error"})}};return f.jsx("div",{className:"Middle",children:f.jsx("div",{className:"MigrationApp",children:f.jsxs(pD,{title:"Site Migration Required",className:"MigrationApp-card",children:[f.jsx(En,{}),f.jsx(No,{severity:"warning",className:"MigrationApp-alert",children:"This site uses an outdated schema format and requires migration before it can be used normally."}),n&&f.jsxs("div",{className:"MigrationApp-info",children:[f.jsx("div",{className:"MigrationApp-infoTitle",children:"Site Schema Version Information:"}),f.jsxs("div",{className:"MigrationApp-infoGrid",children:[f.jsxs("div",{children:[f.jsx("div",{className:"MigrationApp-infoLabel",children:"Current Version:"}),f.jsx("div",{className:"MigrationApp-infoValue",children:n.currentSiteSchemaVersion})]}),f.jsxs("div",{children:[f.jsx("div",{className:"MigrationApp-infoLabel",children:"Target Version:"}),f.jsx("div",{className:"MigrationApp-infoValue",children:n.targetSiteSchemaVersion})]})]})]}),e?f.jsx(No,{severity:"success",className:"MigrationApp-alert",children:"Migration completed successfully! The page will reload shortly."}):f.jsx(de,{className:"MigrationApp-runBtn",as:"async",onClick:m,children:"Run Site Migration"}),d&&f.jsxs("div",{className:"MigrationApp-siteUrl",children:["Site: ",d.publicSiteUrl]})]})})})}const mK=ge`
|
|
741
|
-
query {
|
|
742
|
-
publicSiteConstants {
|
|
743
|
-
fqdn
|
|
744
|
-
publicSiteUrl
|
|
745
|
-
platformAuthUrl
|
|
746
|
-
faviconThumb
|
|
747
|
-
adminUiFaviconThumb
|
|
748
|
-
languageWithLabels { language label }
|
|
749
|
-
homeUrls { language url }
|
|
750
|
-
siteStatus
|
|
751
|
-
allowUnsafeLogin
|
|
752
|
-
}
|
|
753
|
-
}
|
|
754
|
-
`;function pK(){return S.useCallback(async()=>{const e=await Se(mK);return gK(e.publicSiteConstants)},[])}function gK(e){return{fqdn:e.fqdn,publicSiteUrl:e.publicSiteUrl,platformAuthUrl:e.platformAuthUrl??void 0,faviconThumb:e.faviconThumb?JSON.parse(e.faviconThumb):void 0,adminUiFaviconThumb:e.adminUiFaviconThumb?JSON.parse(e.adminUiFaviconThumb):void 0,languageWithLabels:e.languageWithLabels,homeUrls:e.homeUrls,siteStatus:yK(e.siteStatus),allowUnsafeLogin:e.allowUnsafeLogin}}function yK(e){if(e==="ready"||e==="migration")return e;throw new Error(`Invalid site status: "${e}"`)}function TE(e){return new URLSearchParams(window.location.search).has(e)}function df(e){return new URLSearchParams(window.location.search).get(e)??void 0}function Qw(...e){const t=window.location.search,n=new URLSearchParams(t);return e.map(i=>n.get(i)??void 0)}function Ag(e){const t=e?new URLSearchParams(e):void 0;history.replaceState(null,"",t?`${Sg}?${t.toString()}`:Sg)}const vK="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2048%2048'%20width='30px'%20height='30px'%3e%3cpath%20fill='%23FFC107'%20d='M43.611,20.083H42V20H24v8h11.303c-1.649,4.657-6.08,8-11.303,8c-6.627,0-12-5.373-12-12c0-6.627,5.373-12,12-12c3.059,0,5.842,1.154,7.961,3.039l5.657-5.657C34.046,6.053,29.268,4,24,4C12.955,4,4,12.955,4,24c0,11.045,8.955,20,20,20c11.045,0,20-8.955,20-20C44,22.659,43.862,21.35,43.611,20.083z'%20/%3e%3cpath%20fill='%23FF3D00'%20d='M6.306,14.691l6.571,4.819C14.655,15.108,18.961,12,24,12c3.059,0,5.842,1.154,7.961,3.039l5.657-5.657C34.046,6.053,29.268,4,24,4C16.318,4,9.656,8.337,6.306,14.691z'%20/%3e%3cpath%20fill='%234CAF50'%20d='M24,44c5.166,0,9.86-1.977,13.409-5.192l-6.19-5.238C29.211,35.091,26.715,36,24,36c-5.202,0-9.619-3.317-11.283-7.946l-6.522,5.025C9.505,39.556,16.227,44,24,44z'%20/%3e%3cpath%20fill='%231976D2'%20d='M43.611,20.083H42V20H24v8h11.303c-0.792,2.237-2.231,4.166-4.087,5.571c0.001-0.001,0.002-0.001,0.003-0.002l6.19,5.238C36.971,39.205,44,34,44,24C44,22.659,43.862,21.35,43.611,20.083z'%20/%3e%3c/svg%3e";function bK({currentLanguage:e,onChange:t,languageWithLabels:n}){const{t:i}=Pt(),s=S.useMemo(()=>n.map(({label:l,language:c})=>({value:c,label:l})),[n]);return f.jsx("div",{className:"LanguageSwitch",children:f.jsx(Ac,{value:e,onChange:l=>t(l),options:s,placeholder:i("selectALanguage")})})}function SK({loginApiUrl:e}){return f.jsx(Cn,{children:f.jsx(xK,{loginApiUrl:e})})}function xK({loginApiUrl:e}){const t=we(),[n,i]=S.useState(!1),[s,l]=S.useState({email:"",password:""}),c=Ge(m=>m.setIsAuthenticated),{showAlert:d}=at(),h=async()=>{i(!0);try{const m=await h1(e,s);of(m)?(await vg({id:m.id,token:m.token,adminUiToken:m.adminUiToken}),c(!0)):d(t("LoginScreen.failedMessage"),{severity:"error"})}finally{i(!1)}};return f.jsxs("form",{className:"Form",onSubmit:async m=>{m.preventDefault(),await h()},children:[f.jsx(En,{}),f.jsx(vn,{className:"LoginForm-field",label:t("common.email"),type:"email",value:s.email,placeholder:t("common.email"),onChange:m=>l(y=>({...y,email:m}))}),f.jsx(Ip,{label:t("LoginScreen.password"),defaultValue:s.password,placeholder:t("LoginScreen.password"),onChange:m=>l(y=>({...y,password:m.target.value}))}),f.jsx("div",{className:"Form-actionBar LoginForm-actionBar",children:f.jsxs(de,{className:"LoginForm-submitBtn",type:"submit",disabled:n,children:[n&&f.jsx(cD,{size:16,className:"animate-spin"}),t("LoginScreen.signin")]})})]})}function wK(e){return f.jsx(Cn,{children:f.jsx(DK,{...e})})}function DK(e){const t=we(),n=Kc(),i=na(),s=Ge(h=>h.setUserLanguage),{showAlert:l}=at(),c=S.useRef(void 0);S.useEffect(()=>{e.authError&&e.authError!==c.current&&(c.current=e.authError,l(e.authError,{severity:"error"}),e.onClearAuthError?.())},[e.authError,e.onClearAuthError,l]);const d=!e.platformAuthUrl||df("local")==="1";return f.jsx("div",{className:"Middle",children:f.jsxs("div",{className:"LoginScreen",children:[f.jsxs(pD,{title:t("LoginScreen.signIn"),className:"LoginScreen-card",children:[f.jsx(En,{}),e.platformAuthUrl&&f.jsxs(f.Fragment,{children:[f.jsxs("a",{className:"PaBtn primary outlined LoginScreen-button",href:N3(e.platformAuthUrl),children:[f.jsx("img",{className:"LoginScreen-googleIcon",src:vK,alt:"google-icon"})," ",t("LoginScreen.signInWithGoogle")]}),f.jsx("div",{className:"LoginScreen-divider",children:f.jsx("span",{children:t("LoginScreen.or")})})]}),f.jsx(Lg,{header:{key:"local",label:t("LoginScreen.signInWithLocalAccount")},expanded:d,children:f.jsx(SK,{...e})})]}),n.languageWithLabels.length>1&&f.jsx(bK,{currentLanguage:i,onChange:s,languageWithLabels:n.languageWithLabels})]})})}async function NK({url:e,body:t}){const n=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:t});if(n.status<200||n.status>=300){const i=await n.text();throw new Error(`Error '${n.status}' from the server: ${i}`)}}function CK(){return f.jsx(Cn,{children:f.jsx(EK,{})})}function EK(){const e=we(),t=ci(),n=C1(),{showAlert:i}=at(),[s,l]=S.useState(),[c,d]=S.useState(),[h,m]=S.useState(),[y,v]=S.useState(),b=t(async()=>{if(!c)return;if(c!==h){i(e("PasswordReset.nonIdenticalPasswords"),{severity:"error"});return}const[w,N]=Qw("account","reset-password");await NK({url:`${Va}/api/v1/set-account-password`,body:JSON.stringify({password:c,accountId:w,resetToken:N})}),await n(),Ag({local:"1"}),rn.emit("globalRepaint")}),D=async()=>{const[w,N]=Qw("account","reset-password"),M=await Of({url:`${Va}/api/v1/check-password-reset`,method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accountId:w,resetToken:N})});if(!M?.authorized){l(!1);return}v(M),l(!0)};return ct(async()=>{if(df("account")===void 0){l(!1);return}await D()},[]),s===void 0?f.jsx(ln,{}):s===!1?f.jsx("div",{className:"Middle",children:f.jsxs("section",{className:"PasswordReset",children:[f.jsx("h1",{className:"PasswordReset-h1",children:e("PasswordReset.resetPassword")}),f.jsx("p",{children:e("PasswordReset.invalidToken")})]})}):f.jsx("div",{className:"Middle",children:f.jsxs("section",{className:"PasswordReset",children:[f.jsx("h1",{className:"PasswordReset-h1",children:e("PasswordReset.resetPassword")}),f.jsxs("div",{className:"PasswordReset-info",children:[f.jsx("span",{className:"Mr2",children:y?.name}),f.jsx("span",{children:y?.email})]}),f.jsxs("form",{onSubmit:w=>{w.preventDefault(),b()},className:"Form",children:[f.jsx(En,{}),f.jsx(Ip,{label:e("PasswordReset.newPassword"),defaultValue:c,onChange:w=>{d(w.target.value)}}),f.jsx(Ip,{label:e("PasswordReset.confirmPassword"),defaultValue:h,onChange:w=>{m(w.target.value)}}),f.jsx(de,{className:"WFull",type:"submit",children:e("PasswordReset.validate")})]})]})})}function AK(){const[e,t]=S.useState(!0),[n,i]=S.useState(),s=Ge(h=>h.setIsAuthenticated),l=Ge(h=>h.publicConstants),c=$c(),d=we();return ct(async()=>{try{t(!0);const h=df("pltok");if(h){await mc();const v=await v3(Id,h);of(v)?(await vg({id:v.id,token:v.token,adminUiToken:v.adminUiToken}),Ag(),s(!0),rn.emit("globalRepaint")):i(v.message);return}const m=df("unsafe-login");if(m&&l?.allowUnsafeLogin){await mc();const v=atob(m),b=v.indexOf(":"),D=v.slice(0,b),w=v.slice(b+1),N=await h1(Id,{email:D,password:w});of(N)?(await vg({id:N.id,token:N.token,adminUiToken:N.adminUiToken}),Ag(),s(!0),rn.emit("globalRepaint")):i(d("LoginScreen.failedMessage"));return}await S3()&&s(!0)}catch(h){c.error(h),rn.emit("fatalError",`Unexpected error: ${Fn(h)}`)}finally{t(!1)}},[l]),e||!l?f.jsx(ln,{}):TE("reset-password")?(mc().catch(h=>{c.error("Error forgetting session during password reset:",h)}),f.jsx(CK,{})):f.jsx(R1,{logger:c,children:f.jsx(wK,{loginApiUrl:Id,platformAuthUrl:l.platformAuthUrl,authError:n,onClearAuthError:()=>i(void 0)})})}function MK(){const e=pK(),t=Ge(i=>i.publicConstants),n=Ge(i=>i.setPublicConstants);return ct(async()=>{if(t)return;const i=await e();if(n(i),i.adminUiFaviconThumb){let s=document.head.querySelector("link[rel='icon']");s||(s=document.createElement("link"),s.setAttribute("rel","icon"),s.setAttribute("type",i.adminUiFaviconThumb.mediaType),document.head.appendChild(s)),s.href=i.adminUiFaviconThumb.url}},[]),t?f.jsx(AK,{}):f.jsx(ln,{})}function TK(){const[e,t]=S.useState(),n=Ge(y=>y.isAuthenticated),i=Ge(y=>y.publicConstants),s=Ge(y=>y.userLanguage),l=Ge(y=>y.setAppLayout),{t:c,i18n:d}=Pt(),[,h]=S.useReducer(y=>y+1,0),m=Ge(y=>y.siteTitle);return S.useEffect(()=>{let y;const v=()=>{const D=window.matchMedia("(min-width: 990px)").matches?"desktop":"mobile";y!==D&&(y=D,l(D),document.body.classList.toggle("_mobile",D==="mobile"),document.body.classList.toggle("_desktop",D==="desktop"))};return window.addEventListener("resize",v),v(),()=>{window.removeEventListener("resize",v)}},[]),S.useEffect(()=>(rn.on("fatalError",t),rn.on("globalRepaint",h),()=>{rn.off("fatalError",t),rn.off("globalRepaint",h)}),[]),ct(async()=>{await d.changeLanguage(s)},[s]),S.useEffect(()=>{document.title=c("app.adminUiTitle",{siteTitle:m})},[m]),e?f.jsx("p",{style:{color:"red",fontWeight:"bold"},children:e}):!n||TE("reset-password")?f.jsx(MK,{}):i?.siteStatus==="migration"?f.jsx(fK,{}):f.jsx(sK,{})}async function jK(){const e=document.getElementById("app");if(!e)throw new Error("Missing '#app' element.");await tK(),Ck.createRoot(e).render(f.jsx(Jl.StrictMode,{children:f.jsx(fj,{config:{logger:on,autoDismissAlertDurationMs:3e3,autoDismissInsideFeedbackDurationMs:2e3},children:f.jsx(bk,{value:on,children:f.jsx(UM,{value:on,children:f.jsx(d$,{i18n:sn,children:f.jsx(J4,{children:f.jsxs(Cn,{children:[f.jsx(En,{}),f.jsx(TK,{})]})})})})})})}))}jK().catch(e=>on.error(e));
|