diff --git a/Changelog.md b/Changelog.md index 5c85f9f59367d9e0aa85733dd8a92e095d8d02e3..88bd824b7e12f0c7df629be4158b6fba56e0b72c 100644 --- a/Changelog.md +++ b/Changelog.md @@ -2,6 +2,9 @@ All notable changes to this project will be documented in this file. +## [0.72] - 2024-12-06 +- Fix bug with nren now being an object + ## [0.71] - 2024-12-06 - Add survey notes textbox to the survey management page that can be updated as required to keep notes about a survey response - Update rendering to be more consistent, and all components now have access to the react-dom-router diff --git a/compendium-frontend/src/survey/Landing.tsx b/compendium-frontend/src/survey/Landing.tsx index 2241a0dffdc66ecd49b6049d1b59caa74b7b60f9..96ddad55c491b0ed406b12cfe849422adddededb 100644 --- a/compendium-frontend/src/survey/Landing.tsx +++ b/compendium-frontend/src/survey/Landing.tsx @@ -147,7 +147,7 @@ function Landing(): ReactElement { <tr key={response.nren.id}> <td>{response.nren.name}</td> <td> - <Link to={`/survey/response/${survey.year}/${response.nren}`}><span>Navigate to survey</span></Link> + <Link to={`/survey/response/${survey.year}/${response.nren.name}`}><span>Navigate to survey</span></Link> </td> <td>{response.status}</td> </tr> diff --git a/compendium-frontend/src/survey/SurveyManagementComponent.tsx b/compendium-frontend/src/survey/SurveyManagementComponent.tsx index 2166a6d42510365dfa0be47f62f0a78675d4793f..5c59ba4a4c6fe282cff5bc4ca24a70846ad2fa62 100644 --- a/compendium-frontend/src/survey/SurveyManagementComponent.tsx +++ b/compendium-frontend/src/survey/SurveyManagementComponent.tsx @@ -77,7 +77,7 @@ function SurveyManagementComponent() { }); }, []); - async function apiCall(url, failureToast, successToast) { + async function apiCall(url: string, failureToast: string, successToast: string) { try { const response = await fetch(url, { method: 'POST' }); const json = await response.json(); @@ -98,7 +98,7 @@ function SurveyManagementComponent() { await apiCall('/api/survey/new', "Failed creating new survey: ", "Created new survey"); } - async function postSurveyStatus(year, status) { + async function postSurveyStatus(year: number, status: string) { if (surveyStatusUpdating.current) { toast("Wait for status update to be finished..."); return; @@ -112,7 +112,7 @@ function SurveyManagementComponent() { surveyStatusUpdating.current = false; } - async function removeLock(year, nrenName) { + async function removeLock(year: number, nrenName: string) { await apiCall( '/api/response/unlock/' + year + '/' + nrenName, "Error while unlocking " + nrenName + " " + year + " survey response: ", @@ -199,14 +199,14 @@ function SurveyManagementComponent() { {'notes' in response && <textarea onInput={debounce((e) => updateSurveyNotes(survey.year, response.nren.id, e.target.value), 1000)} style={{ minWidth: '100%', minHeight: '5rem' }} placeholder="Notes for this survey" defaultValue={response.notes || ''}> </textarea>} - + </td> <td> - <Button onClick={() => navigate(`/survey/response/${survey.year}/${response.nren}`)} style={{ pointerEvents: 'auto', margin: '.5rem' }} + <Button onClick={() => navigate(`/survey/response/${survey.year}/${response.nren.name}`)} style={{ pointerEvents: 'auto', margin: '.5rem' }} title="Open the responses of the NREN."> open </Button> - <Button onClick={() => removeLock(survey.year, response.nren)} disabled={response.lock_description == ''} style={{ pointerEvents: 'auto' }} + <Button onClick={() => removeLock(survey.year, response.nren.name)} disabled={response.lock_description == ''} style={{ pointerEvents: 'auto' }} title="Remove the lock from the survey so that another person can open the survey for editing. WARNING: The person that currently has the lock will not be able to save their changes anymore once someone else starts editing!"> remove lock </Button> diff --git a/compendium_v2/static/bundle.js b/compendium_v2/static/bundle.js index 53cf166f8aae597aaae148f0b34404b121b51ac3..c568949f3563e2a707bba82e6e3b2232a8ee6f7e 100644 --- a/compendium_v2/static/bundle.js +++ b/compendium_v2/static/bundle.js @@ -169,4 +169,4 @@ to { > * { pointer-events: auto; } -`,JO=({reverseOrder:e,position:n="top-center",toastOptions:r,gutter:o,children:i,containerStyle:s,containerClassName:a})=>{let{toasts:l,handlers:u}=(e=>{let{toasts:n,pausedAt:r}=((e={})=>{let[n,r]=(0,t.useState)(wO);(0,t.useEffect)((()=>(CO.push(r),()=>{let e=CO.indexOf(r);e>-1&&CO.splice(e,1)})),[n]);let o=n.toasts.map((t=>{var n,r;return{...e,...e[t.type],...t,duration:t.duration||(null==(n=e[t.type])?void 0:n.duration)||(null==e?void 0:e.duration)||EO[t.type],style:{...e.style,...null==(r=e[t.type])?void 0:r.style,...t.style}}}));return{...n,toasts:o}})(e);(0,t.useEffect)((()=>{if(r)return;let e=Date.now(),t=n.map((t=>{if(t.duration===1/0)return;let n=(t.duration||0)+t.pauseDuration-(e-t.createdAt);if(!(n<0))return setTimeout((()=>SO.dismiss(t.id)),n);t.visible&&SO.dismiss(t.id)}));return()=>{t.forEach((e=>e&&clearTimeout(e)))}}),[n,r]);let o=(0,t.useCallback)((()=>{r&&xO({type:6,time:Date.now()})}),[r]),i=(0,t.useCallback)(((e,t)=>{let{reverseOrder:r=!1,gutter:o=8,defaultPosition:i}=t||{},s=n.filter((t=>(t.position||i)===(e.position||i)&&t.height)),a=s.findIndex((t=>t.id===e.id)),l=s.filter(((e,t)=>t<a&&e.visible)).length;return s.filter((e=>e.visible)).slice(...r?[l+1]:[0,l]).reduce(((e,t)=>e+(t.height||0)+o),0)}),[n]);return{toasts:n,handlers:{updateHeight:OO,startPause:TO,endPause:o,calculateOffset:i}}})(r);return t.createElement("div",{style:{position:"fixed",zIndex:9999,top:16,left:16,right:16,bottom:16,pointerEvents:"none",...s},className:a,onMouseEnter:u.startPause,onMouseLeave:u.endPause},l.map((r=>{let s=r.position||n,a=((e,t)=>{let n=e.includes("top"),r=n?{top:0}:{bottom:0},o=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:gO()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(n?1:-1)}px)`,...r,...o}})(s,u.calculateOffset(r,{reverseOrder:e,gutter:o,defaultPosition:n}));return t.createElement($O,{id:r.id,key:r.id,onHeightUpdate:u.updateHeight,className:r.visible?GO:"",style:a},"custom"===r.type?fO(r.message,r):i?i(r):t.createElement(WO,{toast:r,position:s}))})))},YO=SO,KO=function(e){return e.Unverified="unverified",e.Verified="verified",e.Edited="edited",e}({}),XO=function(e){return e.not_started="not started",e.started="started",e.completed="completed",e}({}),ZO=function(e){return e.closed="closed",e.open="open",e.preview="preview",e.published="published",e}({});function eT(){return tT.apply(this,arguments)}function tT(){return(tT=Dt(Mt().mark((function e(){var t,n;return Mt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,fetch("/api/survey/list");case 3:return t=e.sent,e.next=6,t.json();case 6:return n=e.sent,e.abrupt("return",n);case 10:return e.prev=10,e.t0=e.catch(0),e.abrupt("return",[]);case 13:case"end":return e.stop()}}),e,null,[[0,10]])})))).apply(this,arguments)}function nT(){return rT.apply(this,arguments)}function rT(){return(rT=Dt(Mt().mark((function e(){var t,n,r;return Mt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,fetch("/api/survey/active/year");case 3:return t=e.sent,e.next=6,t.json();case 6:if(!("year"in(n=e.sent))){e.next=12;break}return r=n.year,e.abrupt("return",r.toString());case 12:return console.log("Invalid response format: Failed fetching active survey year."),e.abrupt("return","");case 14:e.next=20;break;case 16:return e.prev=16,e.t0=e.catch(0),console.error("Failed fetching active survey year:",e.t0),e.abrupt("return","");case 20:case"end":return e.stop()}}),e,null,[[0,16]])})))).apply(this,arguments)}const oT=t.forwardRef((({bsPrefix:e,variant:t,animation:n="border",size:r,as:o="div",className:i,...s},a)=>{const l=`${e=Cn(e,"spinner")}-${n}`;return(0,gn.jsx)(o,{ref:a,...s,className:mn()(i,l,r&&`${l}-${r}`,t&&`text-${t}`)})}));oT.displayName="Spinner";const iT=oT;function sT(e){return yr({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M362.6 192.9L345 174.8c-.7-.8-1.8-1.2-2.8-1.2-1.1 0-2.1.4-2.8 1.2l-122 122.9-44.4-44.4c-.8-.8-1.8-1.2-2.8-1.2-1 0-2 .4-2.8 1.2l-17.8 17.8c-1.6 1.6-1.6 4.1 0 5.7l56 56c3.6 3.6 8 5.7 11.7 5.7 5.3 0 9.9-3.9 11.6-5.5h.1l133.7-134.4c1.4-1.7 1.4-4.2-.1-5.7z"},child:[]},{tag:"path",attr:{d:"M256 76c48.1 0 93.3 18.7 127.3 52.7S436 207.9 436 256s-18.7 93.3-52.7 127.3S304.1 436 256 436c-48.1 0-93.3-18.7-127.3-52.7S76 304.1 76 256s18.7-93.3 52.7-127.3S207.9 76 256 76m0-28C141.1 48 48 141.1 48 256s93.1 208 208 208 208-93.1 208-208S370.9 48 256 48z"},child:[]}]})(e)}function aT(e){return yr({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 48C141.1 48 48 141.1 48 256s93.1 208 208 208 208-93.1 208-208S370.9 48 256 48zm106.5 150.5L228.8 332.8h-.1c-1.7 1.7-6.3 5.5-11.6 5.5-3.8 0-8.1-2.1-11.7-5.7l-56-56c-1.6-1.6-1.6-4.1 0-5.7l17.8-17.8c.8-.8 1.8-1.2 2.8-1.2 1 0 2 .4 2.8 1.2l44.4 44.4 122-122.9c.8-.8 1.8-1.2 2.8-1.2 1.1 0 2.1.4 2.8 1.2l17.5 18.1c1.8 1.7 1.8 4.2.2 5.8z"},child:[]}]})(e)}function lT(e){return yr({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M331.3 308.7L278.6 256l52.7-52.7c6.2-6.2 6.2-16.4 0-22.6-6.2-6.2-16.4-6.2-22.6 0L256 233.4l-52.7-52.7c-6.2-6.2-15.6-7.1-22.6 0-7.1 7.1-6 16.6 0 22.6l52.7 52.7-52.7 52.7c-6.7 6.7-6.4 16.3 0 22.6 6.4 6.4 16.4 6.2 22.6 0l52.7-52.7 52.7 52.7c6.2 6.2 16.4 6.2 22.6 0 6.3-6.2 6.3-16.4 0-22.6z"},child:[]},{tag:"path",attr:{d:"M256 76c48.1 0 93.3 18.7 127.3 52.7S436 207.9 436 256s-18.7 93.3-52.7 127.3S304.1 436 256 436c-48.1 0-93.3-18.7-127.3-52.7S76 304.1 76 256s18.7-93.3 52.7-127.3S207.9 76 256 76m0-28C141.1 48 48 141.1 48 256s93.1 208 208 208 208-93.1 208-208S370.9 48 256 48z"},child:[]}]})(e)}function uT(e){return yr({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 48C141.1 48 48 141.1 48 256s93.1 208 208 208 208-93.1 208-208S370.9 48 256 48zm52.7 283.3L256 278.6l-52.7 52.7c-6.2 6.2-16.4 6.2-22.6 0-3.1-3.1-4.7-7.2-4.7-11.3 0-4.1 1.6-8.2 4.7-11.3l52.7-52.7-52.7-52.7c-3.1-3.1-4.7-7.2-4.7-11.3 0-4.1 1.6-8.2 4.7-11.3 6.2-6.2 16.4-6.2 22.6 0l52.7 52.7 52.7-52.7c6.2-6.2 16.4-6.2 22.6 0 6.2 6.2 6.2 16.4 0 22.6L278.6 256l52.7 52.7c6.2 6.2 6.2 16.4 0 22.6-6.2 6.3-16.4 6.3-22.6 0z"},child:[]}]})(e)}const cT=function(e){var n=e.status;return{completed:t.createElement(aT,{title:n,size:24,color:"green"}),started:t.createElement(sT,{title:n,size:24,color:"rgb(217, 117, 10)"}),"did not respond":t.createElement(uT,{title:n,size:24,color:"red"}),"not started":t.createElement(lT,{title:n,size:24})}[n]||n};function pT(e){var n=e.text,r=e.helpText,o=e.onClick,i=e.enabled,s=Rt((0,t.useState)(!1),2),a=s[0],l=s[1],u=function(){var e=Dt(Mt().mark((function e(){return Mt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!a){e.next=2;break}return e.abrupt("return");case 2:return l(!0),e.prev=3,e.next=6,o();case 6:return e.prev=6,l(!1),e.finish(6);case 9:case"end":return e.stop()}}),e,null,[[3,,6,9]])})));return function(){return e.apply(this,arguments)}}();return t.createElement(as,{onClick:u,disabled:!i,style:{pointerEvents:"auto",marginLeft:".5rem"},title:r},a&&t.createElement(iT,{as:"span",animation:"border",size:"sm",role:"status","aria-hidden":"true"}),n)}const dT=function(){var e=Rt((0,t.useState)([]),2),n=e[0],r=e[1],o=(0,t.useRef)(!1);function i(e,t,n){return s.apply(this,arguments)}function s(){return(s=Dt(Mt().mark((function e(t,n,o){var i,s;return Mt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,fetch(t,{method:"POST"});case 3:return i=e.sent,e.next=6,i.json();case 6:s=e.sent,i.ok?(YO(o),eT().then((function(e){r(e)}))):YO(n+s.message),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),YO(n+e.t0.message);case 13:case"end":return e.stop()}}),e,null,[[0,10]])})))).apply(this,arguments)}function a(){return(a=Dt(Mt().mark((function e(){return Mt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i("/api/survey/new","Failed creating new survey: ","Created new survey");case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function l(e,t){return u.apply(this,arguments)}function u(){return(u=Dt(Mt().mark((function e(t,n){return Mt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!o.current){e.next=3;break}return YO("Wait for status update to be finished..."),e.abrupt("return");case 3:return o.current=!0,e.next=6,i("/api/survey/"+n+"/"+t,"Error while updating "+t+" survey status to "+n+": ",t+" survey status updated to "+n);case 6:o.current=!1;case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function c(){return(c=Dt(Mt().mark((function e(t,n){return Mt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i("/api/response/unlock/"+t+"/"+n,"Error while unlocking "+n+" "+t+" survey response: ",n+" "+t+" survey response unlocked");case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}(0,t.useEffect)((function(){eT().then((function(e){r(e)}))}),[]);var p=n.length>0&&n.every((function(e){return e.status==ZO.published})),d=We(),h=window.location.origin+"/data?preview";return t.createElement("div",{className:"py-5 grey-container"},t.createElement(Sn,{style:{maxWidth:"100rem"}},t.createElement(Tn,null,t.createElement(JO,null),t.createElement(as,{onClick:function(){return a.apply(this,arguments)},disabled:!p,style:{pointerEvents:"auto",width:"10rem",margin:"1rem"},title:"Create a new survey for the next year. Only possible if all current surveys are published."},"start new survey"),t.createElement(KS,{defaultActiveKey:"0"},n.map((function(e,n){return t.createElement(KS.Item,{eventKey:n.toString(),key:e.year},t.createElement(KS.Header,null,e.year," - ",e.status),t.createElement(KS.Body,null,t.createElement("div",{style:{marginLeft:".5rem",marginBottom:"1rem"}},t.createElement(as,{style:{marginLeft:".5rem"},onClick:function(){return d("/survey/admin/inspect/".concat(e.year))},title:"Open the survey for inspection with all questions visible and any visibleIf logic added to the title."},"Inspect Survey"),t.createElement(as,{style:{marginLeft:".5rem"},onClick:function(){return d("/survey/admin/try/".concat(e.year))},title:"Open the survey exactly as the nrens will see it, but without any nren data."},"Try Survey"),t.createElement(pT,{text:"Mark as open",helpText:"Allow the NRENs to respond to this survey. Only 1 survey may be open at a time, and (pre)-published surveys cannot be opened anymore.",enabled:e.status==ZO.closed,onClick:function(){return l(e.year,"open")}}),t.createElement(pT,{text:"Mark as closed",helpText:"Do not allow the NRENs to respond to this survey anymore. Only surveys with status open can be closed.",enabled:e.status==ZO.open,onClick:function(){return l(e.year,"close")}}),t.createElement(pT,{text:"Preview results",helpText:"Publish all completed survey responses to the compendium website for preview by admins. This is only possible if the survey is closed or previewed already.",enabled:e.status==ZO.closed||e.status==ZO.preview,onClick:function(){return l(e.year,"preview")}}),t.createElement(pT,{text:"Publish results",helpText:"Publish or re-publish all completed survey responses to the compendium website. This is only possible if the survey is in preview or published already.",enabled:e.status==ZO.preview||e.status==ZO.published,onClick:function(){return l(e.year,"publish")}}),e.status==ZO.preview&&t.createElement("span",null," Preview link: ",t.createElement("a",{href:h},h))),t.createElement(bP,null,t.createElement("colgroup",null,t.createElement("col",{style:{width:"10%"}}),t.createElement("col",{style:{width:"20%"}}),t.createElement("col",{style:{width:"20%"}}),t.createElement("col",{style:{width:"30%"}}),t.createElement("col",{style:{width:"20%"}})),t.createElement("thead",null,t.createElement("tr",null,t.createElement("th",null,"NREN"),t.createElement("th",null,"Status"),t.createElement("th",null,"Lock"),t.createElement("th",null,"Management Notes"),t.createElement("th",null,"Actions"))),t.createElement("tbody",null,e.responses.map((function(n){return t.createElement("tr",{key:n.nren.id},t.createElement("td",null,n.nren.name),t.createElement("td",null,t.createElement(cT,{status:n.status})),t.createElement("td",{style:{textWrap:"wrap",wordWrap:"break-word",maxWidth:"10rem"}},n.lock_description),t.createElement("td",null,"notes"in n&&t.createElement("textarea",{onInput:(r=function(t){return r=e.year,o=n.nren.id,i=t.target.value,void fetch("/api/survey/"+r+"/"+o+"/notes",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({notes:i||""})}).then(function(){var e=Dt(Mt().mark((function e(t){var n;return Mt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.json();case 2:n=e.sent,t.ok?YO.success("Notes saved"):YO.error("Failed saving notes: "+n.message||0);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()).catch((function(e){YO.error("Failed saving notes: "+e)}));var r,o,i},function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];clearTimeout(o),o=setTimeout((function(){r.apply(void 0,t),clearTimeout(o)}),1e3)}),style:{minWidth:"100%",minHeight:"5rem"},placeholder:"Notes for this survey",defaultValue:n.notes||""})),t.createElement("td",null,t.createElement(as,{onClick:function(){return d("/survey/response/".concat(e.year,"/").concat(n.nren))},style:{pointerEvents:"auto",margin:".5rem"},title:"Open the responses of the NREN."},"open"),t.createElement(as,{onClick:function(){return function(e,t){return c.apply(this,arguments)}(e.year,n.nren)},disabled:""==n.lock_description,style:{pointerEvents:"auto"},title:"Remove the lock from the survey so that another person can open the survey for editing. WARNING: The person that currently has the lock will not be able to save their changes anymore once someone else starts editing!"},"remove lock")));var r,o}))))))}))))))};function hT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function fT(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?hT(Object(n),!0).forEach((function(t){tn(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hT(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function mT(){return(mT=Dt(Mt().mark((function e(){var t,n;return Mt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,fetch("/api/user/list");case 3:return t=e.sent,e.next=6,t.json();case 6:return n=e.sent,e.abrupt("return",n);case 10:return e.prev=10,e.t0=e.catch(0),e.abrupt("return",[]);case 13:case"end":return e.stop()}}),e,null,[[0,10]])})))).apply(this,arguments)}function gT(){return(gT=Dt(Mt().mark((function e(){var t,n;return Mt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,fetch("/api/nren/list");case 3:return t=e.sent,e.next=6,t.json();case 6:return n=e.sent,e.abrupt("return",n);case 10:return e.prev=10,e.t0=e.catch(0),e.abrupt("return",[]);case 13:case"end":return e.stop()}}),e,null,[[0,10]])})))).apply(this,arguments)}var yT=function(){var e=Dt(Mt().mark((function e(t,n){var r,o,i,s;return Mt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=fT({id:t},n),o={method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)},e.next=4,fetch("/api/user/".concat(t),o);case 4:return i=e.sent,e.next=7,i.json();case 7:if(s=e.sent,i.ok){e.next=10;break}throw new Error(s.message);case 10:return e.abrupt("return",s.user);case 11:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),vT=function(e,t){return e.permissions.active&&!t.permissions.active?-1:!e.permissions.active&&t.permissions.active?1:e.permissions.active&&t.permissions.active?"admin"===e.role&&"admin"!==t.role?1:"admin"!==e.role&&"admin"===t.role?-1:e.name.localeCompare(t.name):e.name.localeCompare(t.name)};const bT=function(){var e=Rt((0,t.useState)([]),2),n=e[0],r=e[1],o=Rt((0,t.useState)([]),2),i=o[0],s=o[1],a=(0,t.useContext)(Ft).user,l=Rt((0,t.useState)({idx:-1,asc:!0}),2),u=l[0],c=l[1],p=Rt((0,t.useState)([]),2),d=p[0],h=p[1];(0,t.useEffect)((function(){(function(){return mT.apply(this,arguments)})().then((function(e){r(e),h(e.sort(vT))})),function(){return gT.apply(this,arguments)}().then((function(e){s(e.sort((function(e,t){return e.name.localeCompare(t.name)})))}))}),[]),(0,t.useEffect)((function(){h(Kt(n.sort(vT)))}),[n]);for(var f=function(e,t){var o=n.findIndex((function(e){return e.id===t.id})),i=Kt(n),s=e.target.name,a={};a[s]="active"===s?e.target.checked:e.target.value,yT(t.id,a).then((function(e){i[o]=e,r(i)})).catch((function(e){alert(e.message)}))},m=function(e){var t;if(e===u.idx||(5===e||0===e)&&-1===u.idx)return 5!==e&&0!==e||(e=-1),c({idx:e,asc:!u.asc}),void h(Kt(d.reverse()));0===e?(t=vT,c({idx:-1,asc:!0})):1===e?(t=function(e,t){return e.permissions.active&&!t.permissions.active?-1:!e.permissions.active&&t.permissions.active?1:0},c({idx:e,asc:!0})):2===e?(t=function(e,t){return e.role.localeCompare(t.role)},c({idx:e,asc:!0})):3===e?(t=function(e,t){return e.email.localeCompare(t.email)},c({idx:e,asc:!0})):4===e?(t=function(e,t){return e.name.localeCompare(t.name)},c({idx:e,asc:!0})):5===e?(t=vT,c({idx:-1,asc:!0})):6===e?(t=function(e,t){return 0===e.nrens.length&&0===t.nrens.length?0:0===e.nrens.length?-1:0===t.nrens.length?1:e.nrens[0].localeCompare(t.nrens[0])},c({idx:e,asc:!0})):(t=vT,c({idx:e,asc:!0})),h(n.sort(t))},g={},y=0;y<=6;y++)g[y]=u.idx===y?{"aria-sort":u.asc?"ascending":"descending"}:null;return t.createElement(Sn,{style:{maxWidth:"90vw"}},t.createElement(Tn,null,t.createElement("h1",null," User Management Page"),t.createElement(bP,null,t.createElement("thead",null,t.createElement("tr",null,t.createElement("th",nE({},g[0],{onClick:function(){return m(0)},className:"pt-3 sortable",style:{border:"1px solid #ddd"}}),"Id"),t.createElement("th",nE({},g[1],{onClick:function(){return m(1)},className:"pt-3 sortable",style:{border:"1px solid #ddd"}}),"Active"),t.createElement("th",nE({},g[2],{onClick:function(){return m(2)},className:"pt-3 sortable",style:{border:"1px solid #ddd"}}),"Role"),t.createElement("th",nE({},g[3],{onClick:function(){return m(3)},className:"pt-3 sortable",style:{border:"1px solid #ddd"}}),"Email"),t.createElement("th",nE({},g[4],{onClick:function(){return m(4)},className:"pt-3 sortable",style:{border:"1px solid #ddd"}}),"Full Name"),t.createElement("th",nE({},g[5],{onClick:function(){return m(5)},className:"pt-3 sortable",style:{border:"1px solid #ddd"}}),"OIDC Sub"),t.createElement("th",nE({},g[6],{onClick:function(){return m(6)},className:"pt-3 sortable",style:{border:"1px solid #ddd"}}),"NREN"))),t.createElement("tbody",null,d.map((function(e){return t.createElement("tr",{key:e.id},t.createElement("td",{style:{border:"1px dotted #ddd"}},e.id),t.createElement("td",{style:{border:"1px dotted #ddd"}},e.id==a.id?"Active":t.createElement("input",{type:"checkbox",name:"active",checked:e.permissions.active,onChange:function(t){return f(t,e)}})),t.createElement("td",{style:{border:"1px dotted #ddd"}},e.id==a.id?e.role.charAt(0).toUpperCase()+e.role.slice(1):t.createElement("select",{name:"role",defaultValue:e.role,onChange:function(t){return f(t,e)}},t.createElement("option",{value:"admin"},"Admin"),t.createElement("option",{value:"user"},"User"),t.createElement("option",{value:"observer"},"Observer"))),t.createElement("td",{style:{border:"1px dotted #ddd"}},e.email),t.createElement("td",{style:{border:"1px dotted #ddd"}},e.name),t.createElement("td",{style:{border:"1px dotted #ddd"}},e.oidc_sub),t.createElement("td",{style:{border:"1px dotted #ddd"}},t.createElement("select",{name:"nren",multiple:!1,value:e.nrens.length>0?(n=e.nrens[0],null===(r=i.find((function(e){return e.id==n||e.name==n})))||void 0===r?void 0:r.id):"",onChange:function(t){return f(t,e)}},t.createElement("option",{value:""},"Select NREN"),i.map((function(e){return t.createElement("option",{key:"nren_"+e.id,value:e.id},e.name)})))));var n,r}))))))};var CT=o(522),wT=o(755);function xT(e,t){if(0==t.column.indexValue&&"item"in t.row){var n,r,o=t.row.item;void 0!==o.customDescription&&(null===(n=t.htmlElement.parentElement)||void 0===n||n.children[0].children[0].setAttribute("description",o.customDescription),null===(r=t.htmlElement.parentElement)||void 0===r||r.children[0].children[0].classList.add("survey-tooltip"))}}function ET(e,t){t.question.hideCheckboxLabels&&(t.cssClasses.root+=" hidden-checkbox-labels")}function PT(e,t){var n,r='[data-name="'+t.question.name+'"]',o=null===(n=document.querySelector(r))||void 0===n?void 0:n.querySelector("h5");o&&!o.classList.contains("sv-header-flex")&&t.question.updateElementCss()}function ST(e,t,n){var r;n.verificationStatus.set(e.name,t);var o=document.createElement("button");o.type="button",o.className="sv-action-bar-item verification",o.innerHTML=t,t==KO.Unverified?(o.innerHTML="No change from previous year",o.className+=" verification-required",o.onclick=function(){"display"!=n.mode&&(e.validate(),ST(e,KO.Verified,n))}):(o.innerHTML="Answer updated",o.className+=" verification-ok");var i='[data-name="'+e.name+'"]',s=null===(r=document.querySelector(i))||void 0===r?void 0:r.querySelector("h5"),a=null==s?void 0:s.querySelector(".verification");a?a.replaceWith(o):null==s||s.appendChild(o)}const OT=function(e){var n=e.surveyModel,r=(0,t.useCallback)((function(e,t){var r,o=n.verificationStatus.get(t.question.name),i=null===(r=t.question)||void 0===r?void 0:r.readOnly;o&&!i?ST(t.question,o,n):i&&function(e){var t,n=!!e.visibleIf,r='[data-name="'+e.name+'"]',o=document.querySelector(r),i=null==o?void 0:o.querySelector("h5");if(n)o.style.display="none";else{i&&(i.style.textDecoration="line-through");var s=null===(t=document.querySelector(r))||void 0===t?void 0:t.querySelector(".sv-question__content");s&&(s.style.display="none")}}(t.question)}),[n]),o=(0,t.useCallback)((function(e,t){n.verificationStatus.get(t.question.name)==KO.Unverified&&ST(t.question,KO.Edited,n)}),[n]);return n.css.question.title.includes("sv-header-flex")||(n.css.question.title="sv-title sv-question__title sv-header-flex",n.css.question.titleOnError="sv-question__title--error sv-error-color-fix"),n.onAfterRenderQuestion.hasFunc(r)||(n.onAfterRenderQuestion.add(r),n.onAfterRenderQuestion.add(PT)),n.onValueChanged.hasFunc(o)||n.onValueChanged.add(o),n.onUpdateQuestionCssClasses.hasFunc(ET)||n.onUpdateQuestionCssClasses.add(ET),n.onMatrixAfterCellRender.hasFunc(xT)||n.onMatrixAfterCellRender.add(xT),t.createElement(wT.Survey,{model:n})};function TT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _T(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?TT(Object(n),!0).forEach((function(t){tn(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):TT(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const VT=function(e){var n=e.surveyModel,r=e.pageNoSetter,o=Rt((0,t.useState)([]),2),i=o[0],s=o[1],a=function(e){return!(null===e.value||void 0===e.value||""===e.value||"checkbox"===e.getType()&&0==e.value.length||"multipletext"===e.getType()&&(1===Object.keys(e.value).length&&void 0===Object.values(e.value)[0]||0===Object.keys(e.value).length))};(0,t.useEffect)((function(){var e=function(e){if(e&&e.pages){var t=[];e.pages.forEach((function(n){var r=n.questions.filter((function(e){return e.startWithNewLine})),o=r.length,i=r.filter(a).length,s=o-i,l=i/o;t.push({completionPercentage:100*l,unansweredPercentage:s/o*100,totalPages:e.pages.length,pageTitle:n.title})})),s(t)}};n.onValueChanged.add((function(t){e(t)})),e(n)}),[n]);var l={height:"0.5rem",transition:"width 0.3s ease"};return t.createElement(Sn,{className:"survey-progress"},t.createElement(Tn,null,i.map((function(e,o){return t.createElement(Vn,{xs:12,md:!0,key:o,onClick:function(){return r(o)},style:{cursor:"pointer",margin:"0.5rem"}},t.createElement("div",null,t.createElement("span",{style:{whiteSpace:"nowrap",fontSize:"1.5rem",marginRight:"0.25rem",fontWeight:"bold",color:"#2db394"}},o+1),t.createElement("span",{style:_T({whiteSpace:"nowrap"},n.currentPageNo==o&&{fontWeight:"bold"})},e.pageTitle),t.createElement("div",{style:{display:"flex",flexWrap:"wrap"}},t.createElement("div",{style:_T(_T({},l),{},{width:"".concat(e.completionPercentage,"%"),backgroundColor:"#262261"})}),t.createElement("div",{style:_T(_T({},l),{},{width:"".concat(e.unansweredPercentage,"%"),backgroundColor:"#cdcdcd"})}))))}))))},RT=function(e){var n=e.surveyModel,r=e.surveyActions,o=e.year,i=e.nren,s=e.children,a=Rt((0,t.useState)(0),2),l=a[0],u=a[1],c=Rt((0,t.useState)(!1),2),p=c[0],d=c[1],h=Rt((0,t.useState)(""),2),f=h[0],m=h[1],g=Rt((0,t.useState)(""),2),y=g[0],v=g[1],b=(0,t.useContext)(Ft).user,C=(0,t.useCallback)((function(){d("edit"==n.mode),m(n.lockedBy),u(n.currentPageNo),v(n.status)}),[n]);(0,t.useEffect)((function(){C()}),[C]);var w=function(e){u(e),n.currentPageNo=e},x=function(){w(n.currentPageNo+1)},E=function(){var e=Dt(Mt().mark((function e(t){return Mt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r[t]();case 2:C();case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),P=function(e,t){return S(e,(function(){return E(t)}))},S=function(e,n){return t.createElement("button",{className:"sv-btn sv-btn--navigation",onClick:n},e)},O="Save and stop editing",T="Save progress",_="Start editing",V="Complete Survey",R=function(){return t.createElement("div",{className:"survey-edit-buttons-block"},!p&&!f&&n.editAllowed&&P(_,"startEdit"),!p&&f&&f==b.name&&P("Discard any unsaved changes and release your lock","releaseLock"),p&&y==XO.started&&P(T,"save"),p&&y==XO.started&&P(O,"saveAndStopEdit"),p&&l===n.visiblePages.length-1&&P(V,"complete"),l!==n.visiblePages.length-1&&S("Next Section",x))};return t.createElement(Sn,null,t.createElement(Tn,{className:"survey-content"},t.createElement("h2",null,t.createElement("span",{className:"survey-title"},o," Compendium Survey "),t.createElement("span",{className:"survey-title-nren"}," ",i," "),t.createElement("span",null," - ",y)),t.createElement("div",{style:{marginTop:"1rem",textAlign:"justify"}},t.createElement("p",null,"To get started, click “",_,"” to end read-only mode. Different people from your NREN (Compendium administrators) can contribute to the survey if needed, but agreement should be reached internally before completing the survey as the administration team will treat responses as a single source of truth from the NREN. You can start editing only when nobody else from your NREN is currently working on the survey."),t.createElement("p",null,t.createElement("b",null,"In a small change, the survey now asks about this calendar year, i.e. ",o)," (or the current financial year if your budget or staffing data does not match the calendar year). For network questions, please provide data from the 12 months preceding you answering the question. Where available, the survey questions are pre-filled with answers from the previous survey. You can edit the pre-filled answer to provide new information, or press the “no change from previous year” button."),t.createElement("p",null,"Press the “",T,"“ or “",O,"“ button to save all answers in the survey. When you reach the last section of the survey (Services), you will find a “",V,"“ button which saves all answers in the survey and lets the Compendium team know that your answers are ready to be published. As long as the survey remains open, any Compendium administrator from your NREN can add answers or amend existing ones, even after using the “",V,"“ button."),t.createElement("p",null,"Some fields require specific data, such as numerical data, valid http-addresses, and in some questions, the answer has to add up to 100%. If an answer does not fulfil the set criteria, the question will turn pink and an error message will appear. Fields can be left blank if you prefer not to answer a question. If you notice any errors after the survey was closed, please contact us for correcting those.")),t.createElement("p",null,"Thank you for taking the time to fill in the ",o," Compendium Survey. Any questions or requests can be sent to ",t.createElement("a",{href:"mailto:Partner-Relations@geant.org"},t.createElement("span",null,"Partner-Relations@geant.org"))),p&&t.createElement(t.Fragment,null,t.createElement("br",null),t.createElement("b",null,"Remember to click “",O,"” before leaving the page."))),t.createElement(Tn,null,R()),t.createElement(Tn,{className:"survey-content"},!p&&t.createElement("div",{className:"survey-edit-explainer"},!f&&n.editAllowed&&"The survey is in read-only mode; click the “Start editing“ button to begin editing the answers.",!f&&!n.editAllowed&&"The survey is in read-only mode and can not be edited by you.",f&&f!=b.name&&"The survey is in read-only mode and currently being edited by: "+f+". To start editing the survey, ask them to complete their edits.",f&&f==b.name&&'The survey is in read-only mode because you started editing in another tab, browser or device. To start editing the survey, either complete those edits or click the "Discard any unsaved changes" button.')),t.createElement(Tn,null,t.createElement(VT,{surveyModel:n,pageNoSetter:w}),s),t.createElement(Tn,null,R()))},IT=function(e){var n=e.when,r=e.onPageExit;return function(e){let{router:n,basename:r}=nt(et.UseBlocker),o=rt(tt.UseBlocker),[i,s]=t.useState(""),a=t.useCallback((t=>{if("/"===r)return e();let{currentLocation:n,nextLocation:o,historyAction:i}=t;return e((Me({},n,{pathname:I(n.pathname,r)||n.pathname}),Me({},o,{pathname:I(o.pathname,r)||o.pathname})))}),[r,e]);t.useEffect((()=>{let e=String(++it);return s(e),()=>n.deleteBlocker(e)}),[n]),t.useEffect((()=>{""!==i&&n.getBlocker(i,a)}),[n,i,a]),i&&o.blockers.has(i)&&o.blockers.get(i)}((function(){if(n()){var t=window.confirm(e.message);return t&&r(),!t}return!1})),t.createElement("div",null)};function kT(e){var t=e[0];if(!e[1]&&(void 0===t||null==t))return!0;try{return!!new URL(t)}catch(e){return!1}}CT.Serializer.addProperty("itemvalue","customDescription:text"),CT.Serializer.addProperty("question","hideCheckboxLabels:boolean");const AT=function(e){var n=e.loadFrom,r=Rt((0,t.useState)(),2),o=r[0],i=r[1],s=function(){let{matches:e}=t.useContext(qe),n=e[e.length-1];return n?n.params:{}}(),a=s.year,l=s.nren,u=Rt((0,t.useState)("loading survey..."),2),c=u[0],p=u[1];CT.FunctionFactory.Instance.hasFunction("validateWebsiteUrl")||CT.FunctionFactory.Instance.register("validateWebsiteUrl",kT);var d=lr().trackPageView,h=(0,t.useCallback)((function(e){return e.preventDefault(),e.returnValue=""}),[]),f=(0,t.useCallback)((function(){window.navigator.sendBeacon("/api/response/unlock/"+a+"/"+l)}),[]),m=(0,t.useCallback)((function(){window.navigator.sendBeacon("/api/response/unlock/"+a+"/"+l),removeEventListener("beforeunload",h,{capture:!0}),removeEventListener("pagehide",f)}),[]);if((0,t.useEffect)((function(){function e(){return(e=Dt(Mt().mark((function e(){var t,r,o,s;return Mt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(n+a+(l?"/"+l:""));case 2:return t=e.sent,e.next=5,t.json();case 5:if(r=e.sent,t.ok){e.next=12;break}if(!("message"in r)){e.next=11;break}throw new Error(r.message);case 11:throw new Error("Request failed with status ".concat(t.status));case 12:for(s in(o=new CT.Model(r.model)).setVariable("surveyyear",a),o.setVariable("previousyear",parseInt(a)-1),o.showNavigationButtons=!1,o.requiredText="",o.verificationStatus=new Map,r.verification_status)o.verificationStatus.set(s,r.verification_status[s]);o.data=r.data,o.clearIncorrectValues(!0),o.currentPageNo=r.page,o.mode=r.mode,o.lockedBy=r.locked_by,o.status=r.status,o.editAllowed=r.edit_allowed,i(o);case 27:case"end":return e.stop()}}),e)})))).apply(this,arguments)}(function(){return e.apply(this,arguments)})().catch((function(e){return p("Error when loading survey: "+e.message)})).then((function(){d({documentTitle:"Survey for ".concat(l," (").concat(a,")")})}))}),[]),!o)return t.createElement(t.Fragment,null,c);var g,y,v,b,C,w=function(){var e=Dt(Mt().mark((function e(t,n){var r,i,s;return Mt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(l){e.next=2;break}return e.abrupt("return","Saving not available in inpect/try mode");case 2:return r={lock_uuid:t.lockUUID,new_state:n,data:t.data,page:t.currentPageNo,verification_status:Object.fromEntries(t.verificationStatus)},e.prev=3,e.next=6,fetch("/api/response/save/"+a+"/"+l,{method:"POST",headers:{"Content-Type":"application/json; charset=utf-8"},body:JSON.stringify(r)});case 6:return i=e.sent,e.next=9,i.json();case 9:if(s=e.sent,i.ok){e.next=12;break}return e.abrupt("return",s.message);case 12:o.mode=s.mode,o.lockedBy=s.locked_by,o.status=s.status,e.next=20;break;case 17:return e.prev=17,e.t0=e.catch(3),e.abrupt("return","Unknown Error: "+e.t0.message);case 20:case"end":return e.stop()}}),e,null,[[3,17]])})));return function(t,n){return e.apply(this,arguments)}}(),x=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n="",r=function(e,t){e.verificationStatus.get(t.name)==KO.Unverified&&(""==n&&(n=t.name),t.error='Please verify that last years data is correct by editing the answer or pressing the "No change from previous year" button!')};t&&o.onValidateQuestion.add(r);var i=e();return t&&o.onValidateQuestion.remove(r),i||YO("Validation failed!"),i},E={save:(C=Dt(Mt().mark((function e(){var t;return Mt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(x(o.validate.bind(o,!0,!0),!1)){e.next=4;break}return YO("Please correct the invalid fields before saving!"),e.abrupt("return");case 4:return e.next=6,w(o,"editing");case 6:t=e.sent,YO(t?"Failed saving survey: "+t:"Survey saved!");case 8:case"end":return e.stop()}}),e)}))),function(){return C.apply(this,arguments)}),complete:(b=Dt(Mt().mark((function e(){var t;return Mt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!x(o.validate.bind(o,!0,!0))){e.next=6;break}return e.next=4,w(o,"completed");case 4:(t=e.sent)?YO("Failed completing survey: "+t):(YO("Survey completed!"),removeEventListener("beforeunload",h,{capture:!0}),removeEventListener("pagehide",f));case 6:case"end":return e.stop()}}),e)}))),function(){return b.apply(this,arguments)}),saveAndStopEdit:(v=Dt(Mt().mark((function e(){var t;return Mt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(x(o.validate.bind(o,!0,!0),!1)){e.next=4;break}return YO("Please correct the invalid fields before saving."),e.abrupt("return");case 4:return e.next=6,w(o,"readonly");case 6:(t=e.sent)?YO("Failed saving survey: "+t):(YO("Survey saved!"),removeEventListener("beforeunload",h,{capture:!0}),removeEventListener("pagehide",f));case 8:case"end":return e.stop()}}),e)}))),function(){return v.apply(this,arguments)}),startEdit:(y=Dt(Mt().mark((function e(){var t,n,r;return Mt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch("/api/response/lock/"+a+"/"+l,{method:"POST"});case 2:return t=e.sent,e.next=5,t.json();case 5:if(n=e.sent,t.ok){e.next=9;break}return YO("Failed starting edit: "+n.message),e.abrupt("return");case 9:for(r in addEventListener("pagehide",f),addEventListener("beforeunload",h,{capture:!0}),n.verification_status)o.verificationStatus.set(r,n.verification_status[r]);if(o.data=n.data,o.clearIncorrectValues(!0),o.mode=n.mode,o.lockedBy=n.locked_by,o.lockUUID=n.lock_uuid,o.status=n.status,x(o.validate.bind(o,!0,!0),!1)){e.next=22;break}return YO("Some fields are invalid, please correct them."),e.abrupt("return");case 22:case"end":return e.stop()}}),e)}))),function(){return y.apply(this,arguments)}),releaseLock:(g=Dt(Mt().mark((function e(){var t,n;return Mt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch("/api/response/unlock/"+a+"/"+l,{method:"POST"});case 2:return t=e.sent,e.next=5,t.json();case 5:if(n=e.sent,t.ok){e.next=9;break}return YO("Failed releasing lock: "+n.message),e.abrupt("return");case 9:o.mode=n.mode,o.lockedBy=n.locked_by,o.status=n.status;case 12:case"end":return e.stop()}}),e)}))),function(){return g.apply(this,arguments)}),validatePage:function(){x(o.validatePage.bind(o))&&YO("Page validation successful!")}};return t.createElement(Sn,{className:"survey-container"},t.createElement(JO,null),t.createElement(IT,{message:"Are you sure you want to leave this page? Information you've entered may not be saved.",when:function(){return"edit"==o.mode&&!!l},onPageExit:m}),t.createElement(RT,{surveyModel:o,surveyActions:E,year:a,nren:l},t.createElement(OT,{surveyModel:o})))},DT=function(){var e=lr().trackPageView,n=(0,t.useContext)(Ft).user,r=We(),o=!!n.id,i=!!o&&!!n.nrens.length,s=i?n.nrens[0]:"",a=!!o&&n.permissions.admin,l=!!o&&"observer"===n.role,u=Rt((0,t.useState)(null),2),c=u[0],p=u[1];(0,t.useEffect)((function(){var t=function(){var e=Dt(Mt().mark((function e(){var t;return Mt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,nT();case 2:t=e.sent,p(t);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();t(),e({documentTitle:"GEANT Survey Landing Page"})}),[e]);var d=function(){var e=Rt((0,t.useState)(),2),n=e[0],r=e[1];return(0,t.useEffect)((function(){eT().then((function(e){r(e[0])}))}),[]),t.createElement(bP,{striped:!0,bordered:!0,responsive:!0},t.createElement("thead",null,t.createElement("tr",null,t.createElement("th",null,"(N)REN"),t.createElement("th",null,"Link"),t.createElement("th",null,"Survey Status"))),t.createElement("tbody",null,n&&n.responses.map((function(e){return t.createElement("tr",{key:e.nren.id},t.createElement("td",null,e.nren.name),t.createElement("td",null,t.createElement(St,{to:"/survey/response/".concat(n.year,"/").concat(e.nren)},t.createElement("span",null,"Navigate to survey"))),t.createElement("td",null,e.status))}))))};return t.createElement(Sn,{className:"py-5 grey-container"},t.createElement(Tn,null,t.createElement("div",{className:"center-text"},t.createElement("h1",{className:"geant-header"},"THE GÉANT COMPENDIUM OF NRENS SURVEY"),t.createElement("div",{className:"wordwrap pt-4",style:{maxWidth:"75rem"}},t.createElement("p",{style:{textAlign:"left"}},"Hello,",t.createElement("br",null),"Welcome to the GÉANT Compendium Survey. (N)REN Compendium administrators can login via Single Sign On (SSO) ",t.createElement("a",{href:"/login"},"here"),", which will complete their registration to fill in the latest Compendium survey. This will send a notification to the Compendium administration team and they will assign you to your (N)REN.",t.createElement("br",null),"Once this step has been completed, you will receive an email from the administration team. We aim to get back to you the same working day, but sometimes may take a little longer.",t.createElement("br",null),"If you are not sure whether you are a Compendium Administrator for your (N)REN, please contact your GÉANT Partner Relations relationship manager.",t.createElement("br",null),"Thank you."),t.createElement("span",null,"Current registration status:"),t.createElement("br",null),t.createElement("br",null),a?t.createElement("ul",null,t.createElement("li",null,t.createElement("span",null,"You are logged in as a Compendium Administrator")),t.createElement("li",null,t.createElement("span",null,"Click ",t.createElement(St,{to:"/survey/admin/surveys"},"here")," to access the survey management page.")),t.createElement("li",null,t.createElement("span",null,"Click ",t.createElement(St,{to:"/survey/admin/users"},"here")," to access the user management page.")),t.createElement("li",null,t.createElement("span",null,"Click ",t.createElement("a",{href:"#",onClick:function(){fetch("/api/data-download").then((function(e){if(!e.ok)throw new Error("Network response was not ok");return e.json()})).then((function(e){var t=function(e){var t=dC.book_new();e.forEach((function(e){var n=dC.json_to_sheet(e.data);e.meta&&function(e,t,n){for(var r,o=dC.decode_range(null!==(r=e["!ref"])&&void 0!==r?r:""),i=-1,s=o.s.c;s<=o.e.c;s++){var a=e[dC.encode_cell({r:o.s.r,c:s})];if(a&&"string"==typeof a.v&&a.v===t){i=s;break}}if(-1!==i)for(var l=o.s.r+1;l<=o.e.r;++l){var u=dC.encode_cell({r:l,c:i});e[u]&&"n"===e[u].t&&(e[u].z=n)}else console.error("Column '".concat(t,"' not found."))}(n,e.meta.columnName,e.meta.format),dC.book_append_sheet(t,n,e.name)}));for(var n=nC(t,{bookType:"xlsx",type:"binary"}),r=new ArrayBuffer(n.length),o=new Uint8Array(r),i=0;i<n.length;i++)o[i]=255&n.charCodeAt(i);return new Blob([r],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8"})}(e),n=document.createElement("a");n.href=URL.createObjectURL(t),n.download="data.xlsx",document.body.appendChild(n),n.click(),document.body.removeChild(n)})).catch((function(e){console.error("Error fetching data:",e)}))}},"here")," to do the full data download."))):t.createElement("ul",null,c&&!a&&!l&&i&&function(){try{return r("/survey/response/".concat(c,"/").concat(s)),t.createElement("li",null,"Redirecting to survey...")}catch(e){return console.error("Error navigating:",e),null}}(),o?t.createElement("li",null,t.createElement("span",null,"You are logged in")):t.createElement("li",null,t.createElement("span",null,"You are not logged in")),o&&!l&&!i&&t.createElement("li",null,t.createElement("span",null,"Your access to the survey has not yet been approved")),o&&!l&&!i&&t.createElement("li",null,t.createElement("span",null,"Once you have been approved, you will immediately be directed to the relevant survey upon visiting this page")),o&&l&&t.createElement("li",null,t.createElement("span",null,"You have read-only access to the following surveys:"))),o&&l&&t.createElement(d,null)))))};var NT,MT=function(){var e="/"!==Qe().pathname;return t.createElement(t.Fragment,null,t.createElement(pn,null,t.createElement(In,null),e?t.createElement(at,null):t.createElement(ur,null),t.createElement(ls,null)),t.createElement(Dn,null))},LT=(NT=[{path:"",element:t.createElement(MT,null),children:[{path:"/budget",element:t.createElement(ME,null)},{path:"/funding",element:t.createElement(yP,null)},{path:"/data/employment",element:t.createElement(TP,{key:"staffgraph"})},{path:"/data/traffic-ratio",element:t.createElement(SS,null)},{path:"/data/roles",element:t.createElement(TP,{roles:!0,key:"staffgraphroles"})},{path:"/employee-count",element:t.createElement(VP,null)},{path:"/charging",element:t.createElement(wP,null)},{path:"/suborganisations",element:t.createElement(kP,null)},{path:"/parentorganisation",element:t.createElement(AP,null)},{path:"/ec-projects",element:t.createElement(DP,null)},{path:"/policy",element:t.createElement(NP,null)},{path:"/traffic-volume",element:t.createElement(ES,null)},{path:"/data",element:t.createElement(Dr,null)},{path:"/institutions-urls",element:t.createElement(JP,null)},{path:"/connected-proportion",element:t.createElement(ZP,{page:hn.ConnectedProportion,key:hn.ConnectedProportion})},{path:"/connectivity-level",element:t.createElement(ZP,{page:hn.ConnectivityLevel,key:hn.ConnectivityLevel})},{path:"/connectivity-growth",element:t.createElement(ZP,{page:hn.ConnectivityGrowth,key:hn.ConnectivityGrowth})},{path:"/connection-carrier",element:t.createElement(ZP,{page:hn.ConnectionCarrier,key:hn.ConnectionCarrier})},{path:"/connectivity-load",element:t.createElement(ZP,{page:hn.ConnectivityLoad,key:hn.ConnectivityLoad})},{path:"/commercial-charging-level",element:t.createElement(ZP,{page:hn.CommercialChargingLevel,key:hn.CommercialChargingLevel})},{path:"/commercial-connectivity",element:t.createElement(ZP,{page:hn.CommercialConnectivity,key:hn.CommercialConnectivity})},{path:"/network-services",element:t.createElement(VS,{category:dn.network_services,key:dn.network_services})},{path:"/isp-support-services",element:t.createElement(VS,{category:dn.isp_support,key:dn.isp_support})},{path:"/security-services",element:t.createElement(VS,{category:dn.security,key:dn.security})},{path:"/identity-services",element:t.createElement(VS,{category:dn.identity,key:dn.identity})},{path:"/collaboration-services",element:t.createElement(VS,{category:dn.collaboration,key:dn.collaboration})},{path:"/multimedia-services",element:t.createElement(VS,{category:dn.multimedia,key:dn.multimedia})},{path:"/storage-and-hosting-services",element:t.createElement(VS,{category:dn.storage_and_hosting,key:dn.storage_and_hosting})},{path:"/professional-services",element:t.createElement(VS,{category:dn.professional_services,key:dn.professional_services})},{path:"/fibre-light",element:t.createElement(eS,null)},{path:"/monitoring-tools",element:t.createElement(tS,null)},{path:"/pert-team",element:t.createElement(nS,null)},{path:"/passive-monitoring",element:t.createElement(rS,null)},{path:"/alien-wave",element:t.createElement(oS,null)},{path:"/alien-wave-internal",element:t.createElement(iS,null)},{path:"/ops-automation",element:t.createElement(sS,null)},{path:"/network-automation",element:t.createElement(aS,null)},{path:"/traffic-stats",element:t.createElement(lS,null)},{path:"/weather-map",element:t.createElement(uS,null)},{path:"/network-map",element:t.createElement(cS,null)},{path:"/nfv",element:t.createElement(pS,null)},{path:"/certificate-provider",element:t.createElement(dS,null)},{path:"/siem-vendors",element:t.createElement(hS,null)},{path:"/capacity-largest-link",element:t.createElement(mS,null)},{path:"/capacity-core-ip",element:t.createElement(yS,null)},{path:"/non-rne-peers",element:t.createElement(bS,null)},{path:"/iru-duration",element:t.createElement(wS,null)},{path:"/audits",element:t.createElement(MP,null)},{path:"/business-continuity",element:t.createElement(LP,null)},{path:"/crisis-management",element:t.createElement(FP,null)},{path:"/crisis-exercise",element:t.createElement(jP,null)},{path:"/security-control",element:t.createElement(BP,null)},{path:"/services-offered",element:t.createElement(zP,null)},{path:"/service-management-framework",element:t.createElement(UP,null)},{path:"/service-level-targets",element:t.createElement(WP,null)},{path:"/corporate-strategy",element:t.createElement(QP,null)},{path:"survey/admin/surveys",element:t.createElement(dT,null)},{path:"survey/admin/users",element:t.createElement(bT,null)},{path:"survey/admin/inspect/:year",element:t.createElement(AT,{loadFrom:"/api/response/inspect/"})},{path:"survey/admin/try/:year",element:t.createElement(AT,{loadFrom:"/api/response/try/"})},{path:"survey/response/:year/:nren",element:t.createElement(AT,{loadFrom:"/api/response/load/"})},{path:"survey/*",element:t.createElement(DT,null)},{path:"*",element:t.createElement(ur,null)}]}],function(t){const n=t.window?t.window:"undefined"!=typeof window?window:void 0,r=void 0!==n&&void 0!==n.document&&void 0!==n.document.createElement,o=!r;let s;if(a(t.routes.length>0,"You must provide a non-empty routes array to createRouter"),t.mapRouteProperties)s=t.mapRouteProperties;else if(t.detectErrorBoundary){let e=t.detectErrorBoundary;s=t=>({hasErrorBoundary:e(t)})}else s=Z;let u,p,d,f={},v=m(t.routes,s,void 0,f),b=t.basename||"/",C=t.unstable_dataStrategy||ue,w=t.unstable_patchRoutesOnMiss,x=i({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,unstable_skipActionErrorRevalidation:!1},t.future),E=null,P=new Set,S=null,O=null,T=null,_=null!=t.hydrationData,V=g(v,t.history.location,b),R=null;if(null==V&&!w){let e=Ce(404,{pathname:t.history.location.pathname}),{matches:n,route:r}=be(v);V=n,R={[r.id]:e}}if(V&&w&&ct(V,v,t.history.location.pathname).active&&(V=null),V)if(V.some((e=>e.route.lazy)))p=!1;else if(V.some((e=>e.route.loader)))if(x.v7_partialHydration){let e=t.hydrationData?t.hydrationData.loaderData:null,n=t.hydrationData?t.hydrationData.errors:null,r=t=>!t.route.loader||("function"!=typeof t.route.loader||!0!==t.route.loader.hydrate)&&(e&&void 0!==e[t.route.id]||n&&void 0!==n[t.route.id]);if(n){let e=V.findIndex((e=>void 0!==n[e.route.id]));p=V.slice(0,e+1).every(r)}else p=V.every(r)}else p=null!=t.hydrationData;else p=!0;else p=!1,V=[];let k,A={historyAction:t.history.action,location:t.history.location,matches:V,initialized:p,navigation:J,restoreScrollPosition:null==t.hydrationData&&null,preventScrollReset:!1,revalidation:"idle",loaderData:t.hydrationData&&t.hydrationData.loaderData||{},actionData:t.hydrationData&&t.hydrationData.actionData||null,errors:t.hydrationData&&t.hydrationData.errors||R,fetchers:new Map,blockers:new Map},D=e.Pop,N=!1,M=!1,L=new Map,j=null,F=!1,H=!1,z=[],Q=[],U=new Map,$=0,oe=-1,ie=new Map,he=new Set,fe=new Map,xe=new Map,Re=new Set,Me=new Map,Le=new Map,je=new Map,Fe=!1;function Be(e,t){void 0===t&&(t={}),A=i({},A,e);let n=[],r=[];x.v7_fetcherPersist&&A.fetchers.forEach(((e,t)=>{"idle"===e.state&&(Re.has(t)?r.push(t):n.push(t))})),[...P].forEach((e=>e(A,{deletedFetchers:r,unstable_viewTransitionOpts:t.viewTransitionOpts,unstable_flushSync:!0===t.flushSync}))),x.v7_fetcherPersist&&(n.forEach((e=>A.fetchers.delete(e))),r.forEach((e=>Ke(e))))}function qe(n,r,o){var s,a;let l,{flushSync:c}=void 0===o?{}:o,p=null!=A.actionData&&null!=A.navigation.formMethod&&Te(A.navigation.formMethod)&&"loading"===A.navigation.state&&!0!==(null==(s=n.state)?void 0:s._isRedirect);l=r.actionData?Object.keys(r.actionData).length>0?r.actionData:null:p?A.actionData:null;let d=r.loaderData?ge(A.loaderData,r.loaderData,r.matches||[],r.errors):A.loaderData,h=A.blockers;h.size>0&&(h=new Map(h),h.forEach(((e,t)=>h.set(t,K))));let f,m=!0===N||null!=A.navigation.formMethod&&Te(A.navigation.formMethod)&&!0!==(null==(a=n.state)?void 0:a._isRedirect);if(u&&(v=u,u=void 0),F||D===e.Pop||(D===e.Push?t.history.push(n,n.state):D===e.Replace&&t.history.replace(n,n.state)),D===e.Pop){let e=L.get(A.location.pathname);e&&e.has(n.pathname)?f={currentLocation:A.location,nextLocation:n}:L.has(n.pathname)&&(f={currentLocation:n,nextLocation:A.location})}else if(M){let e=L.get(A.location.pathname);e?e.add(n.pathname):(e=new Set([n.pathname]),L.set(A.location.pathname,e)),f={currentLocation:A.location,nextLocation:n}}Be(i({},r,{actionData:l,loaderData:d,historyAction:D,location:n,initialized:!0,navigation:J,revalidation:"idle",restoreScrollPosition:ut(n,r.matches||A.matches),preventScrollReset:m,blockers:h}),{viewTransitionOpts:f,flushSync:!0===c}),D=e.Pop,N=!1,M=!1,F=!1,H=!1,z=[],Q=[]}async function He(n,r,o){k&&k.abort(),k=null,D=n,F=!0===(o&&o.startUninterruptedRevalidation),function(e,t){if(S&&T){let n=lt(e,t);S[n]=T()}}(A.location,A.matches),N=!0===(o&&o.preventScrollReset),M=!0===(o&&o.enableViewTransition);let s=u||v,a=o&&o.overrideNavigation,l=g(s,r,b),c=!0===(o&&o.flushSync),p=ct(l,s,r.pathname);if(p.active&&p.matches&&(l=p.matches),!l){let{error:e,notFoundMatches:t,route:n}=it(r.pathname);return void qe(r,{matches:t,loaderData:{},errors:{[n.id]:e}},{flushSync:c})}if(A.initialized&&!H&&function(e,t){return e.pathname===t.pathname&&e.search===t.search&&(""===e.hash?""!==t.hash:e.hash===t.hash||""!==t.hash)}(A.location,r)&&!(o&&o.submission&&Te(o.submission.formMethod)))return void qe(r,{matches:l},{flushSync:c});k=new AbortController;let d,f=de(t.history,r,k.signal,o&&o.submission);if(o&&o.pendingError)d=[ve(l).route.id,{type:h.error,error:o.pendingError}];else if(o&&o.submission&&Te(o.submission.formMethod)){let n=await async function(t,n,r,o,i,s){void 0===s&&(s={}),$e();let a,l=function(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}}(n,r);if(Be({navigation:l},{flushSync:!0===s.flushSync}),i){let e=await pt(o,n.pathname,t.signal);if("aborted"===e.type)return{shortCircuited:!0};if("error"===e.type){let{error:t,notFoundMatches:r,route:o}=st(n.pathname,e);return{matches:r,pendingActionResult:[o.id,{type:h.error,error:t}]}}if(!e.matches){let{notFoundMatches:e,error:t,route:r}=it(n.pathname);return{matches:e,pendingActionResult:[r.id,{type:h.error,error:t}]}}o=e.matches}let u=Ie(o,n);if(u.route.action||u.route.lazy){if(a=(await Ue("action",t,[u],o))[0],t.signal.aborted)return{shortCircuited:!0}}else a={type:h.error,error:Ce(405,{method:t.method,pathname:n.pathname,routeId:u.route.id})};if(Se(a)){let e;return e=s&&null!=s.replace?s.replace:pe(a.response.headers.get("Location"),new URL(t.url),b)===A.location.pathname+A.location.search,await Qe(t,a,{submission:r,replace:e}),{shortCircuited:!0}}if(Ee(a))throw Ce(400,{type:"defer-action"});if(Pe(a)){let t=ve(o,u.route.id);return!0!==(s&&s.replace)&&(D=e.Push),{matches:o,pendingActionResult:[t.route.id,a]}}return{matches:o,pendingActionResult:[u.route.id,a]}}(f,r,o.submission,l,p.active,{replace:o.replace,flushSync:c});if(n.shortCircuited)return;if(n.pendingActionResult){let[e,t]=n.pendingActionResult;if(Pe(t)&&q(t.error)&&404===t.error.status)return k=null,void qe(r,{matches:n.matches,loaderData:{},errors:{[e]:t.error}})}l=n.matches||l,d=n.pendingActionResult,a=Ae(r,o.submission),c=!1,p.active=!1,f=de(t.history,f.url,f.signal)}let{shortCircuited:m,matches:y,loaderData:C,errors:w}=await async function(e,n,r,o,s,a,l,c,p,d,h){let f=s||Ae(n,a),m=a||l||ke(f),g=!(F||x.v7_partialHydration&&p);if(o){if(g){let e=ze(h);Be(i({navigation:f},void 0!==e?{actionData:e}:{}),{flushSync:d})}let t=await pt(r,n.pathname,e.signal);if("aborted"===t.type)return{shortCircuited:!0};if("error"===t.type){let{error:e,notFoundMatches:r,route:o}=st(n.pathname,t);return{matches:r,loaderData:{},errors:{[o.id]:e}}}if(!t.matches){let{error:e,notFoundMatches:t,route:r}=it(n.pathname);return{matches:t,loaderData:{},errors:{[r.id]:e}}}r=t.matches}let y=u||v,[C,w]=re(t.history,A,r,m,n,x.v7_partialHydration&&!0===p,x.unstable_skipActionErrorRevalidation,H,z,Q,Re,fe,he,y,b,h);if(at((e=>!(r&&r.some((t=>t.route.id===e)))||C&&C.some((t=>t.route.id===e)))),oe=++$,0===C.length&&0===w.length){let e=et();return qe(n,i({matches:r,loaderData:{},errors:h&&Pe(h[1])?{[h[0]]:h[1].error}:null},ye(h),e?{fetchers:new Map(A.fetchers)}:{}),{flushSync:d}),{shortCircuited:!0}}if(g){let e={};if(!o){e.navigation=f;let t=ze(h);void 0!==t&&(e.actionData=t)}w.length>0&&(e.fetchers=function(e){return e.forEach((e=>{let t=A.fetchers.get(e.key),n=De(void 0,t?t.data:void 0);A.fetchers.set(e.key,n)})),new Map(A.fetchers)}(w)),Be(e,{flushSync:d})}w.forEach((e=>{U.has(e.key)&&Xe(e.key),e.controller&&U.set(e.key,e.controller)}));let E=()=>w.forEach((e=>Xe(e.key)));k&&k.signal.addEventListener("abort",E);let{loaderResults:P,fetcherResults:S}=await We(A.matches,r,C,w,e);if(e.signal.aborted)return{shortCircuited:!0};k&&k.signal.removeEventListener("abort",E),w.forEach((e=>U.delete(e.key)));let O=we([...P,...S]);if(O){if(O.idx>=C.length){let e=w[O.idx-C.length].key;he.add(e)}return await Qe(e,O.result,{replace:c}),{shortCircuited:!0}}let{loaderData:T,errors:_}=me(A,r,C,P,h,w,S,Me);Me.forEach(((e,t)=>{e.subscribe((n=>{(n||e.done)&&Me.delete(t)}))})),x.v7_partialHydration&&p&&A.errors&&Object.entries(A.errors).filter((e=>{let[t]=e;return!C.some((e=>e.route.id===t))})).forEach((e=>{let[t,n]=e;_=Object.assign(_||{},{[t]:n})}));let V=et(),R=tt(oe),I=V||R||w.length>0;return i({matches:r,loaderData:T,errors:_},I?{fetchers:new Map(A.fetchers)}:{})}(f,r,l,p.active,a,o&&o.submission,o&&o.fetcherSubmission,o&&o.replace,o&&!0===o.initialHydration,c,d);m||(k=null,qe(r,i({matches:y||l},ye(d),{loaderData:C,errors:w})))}function ze(e){return e&&!Pe(e[1])?{[e[0]]:e[1].data}:A.actionData?0===Object.keys(A.actionData).length?null:A.actionData:void 0}async function Qe(o,s,l){let{submission:u,fetcherSubmission:p,replace:d}=void 0===l?{}:l;s.response.headers.has("X-Remix-Revalidate")&&(H=!0);let h=s.response.headers.get("Location");a(h,"Expected a Location header on the redirect Response"),h=pe(h,new URL(o.url),b);let f=c(A.location,h,{_isRedirect:!0});if(r){let e=!1;if(s.response.headers.has("X-Remix-Reload-Document"))e=!0;else if(X.test(h)){const r=t.history.createURL(h);e=r.origin!==n.location.origin||null==I(r.pathname,b)}if(e)return void(d?n.location.replace(h):n.location.assign(h))}k=null;let m=!0===d?e.Replace:e.Push,{formMethod:g,formAction:y,formEncType:v}=A.navigation;!u&&!p&&g&&y&&v&&(u=ke(A.navigation));let C=u||p;if(G.has(s.response.status)&&C&&Te(C.formMethod))await He(m,f,{submission:i({},C,{formAction:h}),preventScrollReset:N});else{let e=Ae(f,u);await He(m,f,{overrideNavigation:e,fetcherSubmission:p,preventScrollReset:N})}}async function Ue(e,t,n,r){try{let o=await async function(e,t,n,r,o,s,l,u){let c=r.reduce(((e,t)=>e.add(t.route.id)),new Set),p=new Set,d=await e({matches:o.map((e=>{let r=c.has(e.route.id);return i({},e,{shouldLoad:r,resolve:o=>(p.add(e.route.id),r?async function(e,t,n,r,o,i,s){let l,u,c=r=>{let o,a=new Promise(((e,t)=>o=t));u=()=>o(),t.signal.addEventListener("abort",u);let l,c=o=>"function"!=typeof r?Promise.reject(new Error('You cannot call the handler for a route which defines a boolean "'+e+'" [routeId: '+n.route.id+"]")):r({request:t,params:n.params,context:s},...void 0!==o?[o]:[]);return l=i?i((e=>c(e))):(async()=>{try{return{type:"data",result:await c()}}catch(e){return{type:"error",result:e}}})(),Promise.race([l,a])};try{let i=n.route[e];if(n.route.lazy)if(i){let e,[t]=await Promise.all([c(i).catch((t=>{e=t})),le(n.route,o,r)]);if(void 0!==e)throw e;l=t}else{if(await le(n.route,o,r),i=n.route[e],!i){if("action"===e){let e=new URL(t.url),r=e.pathname+e.search;throw Ce(405,{method:t.method,pathname:r,routeId:n.route.id})}return{type:h.data,result:void 0}}l=await c(i)}else{if(!i){let e=new URL(t.url);throw Ce(404,{pathname:e.pathname+e.search})}l=await c(i)}a(void 0!==l.result,"You defined "+("action"===e?"an action":"a loader")+' for route "'+n.route.id+"\" but didn't return anything from your `"+e+"` function. Please return a value or `null`.")}catch(e){return{type:h.error,result:e}}finally{u&&t.signal.removeEventListener("abort",u)}return l}(t,n,e,s,l,o,u):Promise.resolve({type:h.data,result:void 0}))})})),request:n,params:o[0].params,context:u});return o.forEach((e=>a(p.has(e.route.id),'`match.resolve()` was not called for route id "'+e.route.id+'". You must call `match.resolve()` on every match passed to `dataStrategy` to ensure all routes are properly loaded.'))),d.filter(((e,t)=>c.has(o[t].route.id)))}(C,e,t,n,r,f,s);return await Promise.all(o.map(((e,o)=>{if(function(e){return Oe(e.result)&&W.has(e.result.status)}(e)){let i=e.result;return{type:h.redirect,response:ce(i,t,n[o].route.id,r,b,x.v7_relativeSplatPath)}}return async function(e){let{result:t,type:n,status:r}=e;if(Oe(t)){let e;try{let n=t.headers.get("Content-Type");e=n&&/\bapplication\/json\b/.test(n)?null==t.body?null:await t.json():await t.text()}catch(e){return{type:h.error,error:e}}return n===h.error?{type:h.error,error:new B(t.status,t.statusText,e),statusCode:t.status,headers:t.headers}:{type:h.data,data:e,statusCode:t.status,headers:t.headers}}return n===h.error?{type:h.error,error:t,statusCode:q(t)?t.status:r}:function(e){let t=e;return t&&"object"==typeof t&&"object"==typeof t.data&&"function"==typeof t.subscribe&&"function"==typeof t.cancel&&"function"==typeof t.resolveData}(t)?{type:h.deferred,deferredData:t,statusCode:null==(o=t.init)?void 0:o.status,headers:(null==(i=t.init)?void 0:i.headers)&&new Headers(t.init.headers)}:{type:h.data,data:t,statusCode:r};var o,i}(e)})))}catch(e){return n.map((()=>({type:h.error,error:e})))}}async function We(e,n,r,o,i){let[s,...a]=await Promise.all([r.length?Ue("loader",i,r,n):[],...o.map((e=>e.matches&&e.match&&e.controller?Ue("loader",de(t.history,e.path,e.controller.signal),[e.match],e.matches).then((e=>e[0])):Promise.resolve({type:h.error,error:Ce(404,{pathname:e.path})})))]);return await Promise.all([_e(e,r,s,s.map((()=>i.signal)),!1,A.loaderData),_e(e,o.map((e=>e.match)),a,o.map((e=>e.controller?e.controller.signal:null)),!0)]),{loaderResults:s,fetcherResults:a}}function $e(){H=!0,z.push(...at()),fe.forEach(((e,t)=>{U.has(t)&&(Q.push(t),Xe(t))}))}function Ge(e,t,n){void 0===n&&(n={}),A.fetchers.set(e,t),Be({fetchers:new Map(A.fetchers)},{flushSync:!0===(n&&n.flushSync)})}function Je(e,t,n,r){void 0===r&&(r={});let o=ve(A.matches,t);Ke(e),Be({errors:{[o.route.id]:n},fetchers:new Map(A.fetchers)},{flushSync:!0===(r&&r.flushSync)})}function Ye(e){return x.v7_fetcherPersist&&(xe.set(e,(xe.get(e)||0)+1),Re.has(e)&&Re.delete(e)),A.fetchers.get(e)||Y}function Ke(e){let t=A.fetchers.get(e);!U.has(e)||t&&"loading"===t.state&&ie.has(e)||Xe(e),fe.delete(e),ie.delete(e),he.delete(e),Re.delete(e),A.fetchers.delete(e)}function Xe(e){let t=U.get(e);a(t,"Expected fetch controller: "+e),t.abort(),U.delete(e)}function Ze(e){for(let t of e){let e=Ne(Ye(t).data);A.fetchers.set(t,e)}}function et(){let e=[],t=!1;for(let n of he){let r=A.fetchers.get(n);a(r,"Expected fetcher: "+n),"loading"===r.state&&(he.delete(n),e.push(n),t=!0)}return Ze(e),t}function tt(e){let t=[];for(let[n,r]of ie)if(r<e){let e=A.fetchers.get(n);a(e,"Expected fetcher: "+n),"loading"===e.state&&(Xe(n),ie.delete(n),t.push(n))}return Ze(t),t.length>0}function nt(e){A.blockers.delete(e),Le.delete(e)}function rt(e,t){let n=A.blockers.get(e)||K;a("unblocked"===n.state&&"blocked"===t.state||"blocked"===n.state&&"blocked"===t.state||"blocked"===n.state&&"proceeding"===t.state||"blocked"===n.state&&"unblocked"===t.state||"proceeding"===n.state&&"unblocked"===t.state,"Invalid blocker state transition: "+n.state+" -> "+t.state);let r=new Map(A.blockers);r.set(e,t),Be({blockers:r})}function ot(e){let{currentLocation:t,nextLocation:n,historyAction:r}=e;if(0===Le.size)return;Le.size>1&&l(!1,"A router only supports one blocker at a time");let o=Array.from(Le.entries()),[i,s]=o[o.length-1],a=A.blockers.get(i);return a&&"proceeding"===a.state?void 0:s({currentLocation:t,nextLocation:n,historyAction:r})?i:void 0}function it(e){let t=Ce(404,{pathname:e}),n=u||v,{matches:r,route:o}=be(n);return at(),{notFoundMatches:r,route:o,error:t}}function st(e,t){let n=t.partialMatches,r=n[n.length-1].route;return{notFoundMatches:n,route:r,error:Ce(400,{type:"route-discovery",routeId:r.id,pathname:e,message:null!=t.error&&"message"in t.error?t.error:String(t.error)})}}function at(e){let t=[];return Me.forEach(((n,r)=>{e&&!e(r)||(n.cancel(),t.push(r),Me.delete(r))})),t}function lt(e,t){if(O){return O(e,t.map((e=>function(e,t){let{route:n,pathname:r,params:o}=e;return{id:n.id,pathname:r,params:o,data:t[n.id],handle:n.handle}}(e,A.loaderData))))||e.key}return e.key}function ut(e,t){if(S){let n=lt(e,t),r=S[n];if("number"==typeof r)return r}return null}function ct(e,t,n){if(w){if(!e)return{active:!0,matches:y(t,n,b,!0)||[]};{let r=e[e.length-1].route;if(r.path&&("*"===r.path||r.path.endsWith("/*")))return{active:!0,matches:y(t,n,b,!0)}}}return{active:!1,matches:null}}async function pt(e,t,n){let r=e,o=r.length>0?r[r.length-1].route:null;for(;;){let e=null==u,i=u||v;try{await se(w,t,r,i,f,s,je,n)}catch(e){return{type:"error",error:e,partialMatches:r}}finally{e&&(v=[...v])}if(n.aborted)return{type:"aborted"};let a=g(i,t,b),l=!1;if(a){let e=a[a.length-1].route;if(e.index)return{type:"success",matches:a};if(e.path&&e.path.length>0){if("*"!==e.path)return{type:"success",matches:a};l=!0}}let c=y(i,t,b,!0);if(!c||r.map((e=>e.route.id)).join("-")===c.map((e=>e.route.id)).join("-"))return{type:"success",matches:l?a:null};if(r=c,o=r[r.length-1].route,"*"===o.path)return{type:"success",matches:r}}}return d={get basename(){return b},get future(){return x},get state(){return A},get routes(){return v},get window(){return n},initialize:function(){if(E=t.history.listen((e=>{let{action:n,location:r,delta:o}=e;if(Fe)return void(Fe=!1);l(0===Le.size||null!=o,"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 i=ot({currentLocation:A.location,nextLocation:r,historyAction:n});return i&&null!=o?(Fe=!0,t.history.go(-1*o),void rt(i,{state:"blocked",location:r,proceed(){rt(i,{state:"proceeding",proceed:void 0,reset:void 0,location:r}),t.history.go(o)},reset(){let e=new Map(A.blockers);e.set(i,K),Be({blockers:e})}})):He(n,r)})),r){!function(e,t){try{let n=e.sessionStorage.getItem(ee);if(n){let e=JSON.parse(n);for(let[n,r]of Object.entries(e||{}))r&&Array.isArray(r)&&t.set(n,new Set(r||[]))}}catch(e){}}(n,L);let e=()=>function(e,t){if(t.size>0){let n={};for(let[e,r]of t)n[e]=[...r];try{e.sessionStorage.setItem(ee,JSON.stringify(n))}catch(e){l(!1,"Failed to save applied view transitions in sessionStorage ("+e+").")}}}(n,L);n.addEventListener("pagehide",e),j=()=>n.removeEventListener("pagehide",e)}return A.initialized||He(e.Pop,A.location,{initialHydration:!0}),d},subscribe:function(e){return P.add(e),()=>P.delete(e)},enableScrollRestoration:function(e,t,n){if(S=e,T=t,O=n||null,!_&&A.navigation===J){_=!0;let e=ut(A.location,A.matches);null!=e&&Be({restoreScrollPosition:e})}return()=>{S=null,T=null,O=null}},navigate:async function n(r,o){if("number"==typeof r)return void t.history.go(r);let s=te(A.location,A.matches,b,x.v7_prependBasename,r,x.v7_relativeSplatPath,null==o?void 0:o.fromRouteId,null==o?void 0:o.relative),{path:a,submission:l,error:u}=ne(x.v7_normalizeFormMethod,!1,s,o),p=A.location,d=c(A.location,a,o&&o.state);d=i({},d,t.history.encodeLocation(d));let h=o&&null!=o.replace?o.replace:void 0,f=e.Push;!0===h?f=e.Replace:!1===h||null!=l&&Te(l.formMethod)&&l.formAction===A.location.pathname+A.location.search&&(f=e.Replace);let m=o&&"preventScrollReset"in o?!0===o.preventScrollReset:void 0,g=!0===(o&&o.unstable_flushSync),y=ot({currentLocation:p,nextLocation:d,historyAction:f});if(!y)return await He(f,d,{submission:l,pendingError:u,preventScrollReset:m,replace:o&&o.replace,enableViewTransition:o&&o.unstable_viewTransition,flushSync:g});rt(y,{state:"blocked",location:d,proceed(){rt(y,{state:"proceeding",proceed:void 0,reset:void 0,location:d}),n(r,o)},reset(){let e=new Map(A.blockers);e.set(y,K),Be({blockers:e})}})},fetch:function(e,n,r,i){if(o)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");U.has(e)&&Xe(e);let s=!0===(i&&i.unstable_flushSync),l=u||v,c=te(A.location,A.matches,b,x.v7_prependBasename,r,x.v7_relativeSplatPath,n,null==i?void 0:i.relative),p=g(l,c,b),d=ct(p,l,c);if(d.active&&d.matches&&(p=d.matches),!p)return void Je(e,n,Ce(404,{pathname:c}),{flushSync:s});let{path:h,submission:f,error:m}=ne(x.v7_normalizeFormMethod,!0,c,i);if(m)return void Je(e,n,m,{flushSync:s});let y=Ie(p,h);N=!0===(i&&i.preventScrollReset),f&&Te(f.formMethod)?async function(e,n,r,o,i,s,l,c){function p(t){if(!t.route.action&&!t.route.lazy){let t=Ce(405,{method:c.formMethod,pathname:r,routeId:n});return Je(e,n,t,{flushSync:l}),!0}return!1}if($e(),fe.delete(e),!s&&p(o))return;let d=A.fetchers.get(e);Ge(e,function(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}}(c,d),{flushSync:l});let h=new AbortController,f=de(t.history,r,h.signal,c);if(s){let t=await pt(i,r,f.signal);if("aborted"===t.type)return;if("error"===t.type){let{error:o}=st(r,t);return void Je(e,n,o,{flushSync:l})}if(!t.matches)return void Je(e,n,Ce(404,{pathname:r}),{flushSync:l});if(p(o=Ie(i=t.matches,r)))return}U.set(e,h);let m=$,y=(await Ue("action",f,[o],i))[0];if(f.signal.aborted)return void(U.get(e)===h&&U.delete(e));if(x.v7_fetcherPersist&&Re.has(e)){if(Se(y)||Pe(y))return void Ge(e,Ne(void 0))}else{if(Se(y))return U.delete(e),oe>m?void Ge(e,Ne(void 0)):(he.add(e),Ge(e,De(c)),Qe(f,y,{fetcherSubmission:c}));if(Pe(y))return void Je(e,n,y.error)}if(Ee(y))throw Ce(400,{type:"defer-action"});let C=A.navigation.location||A.location,w=de(t.history,C,h.signal),E=u||v,P="idle"!==A.navigation.state?g(E,A.navigation.location,b):A.matches;a(P,"Didn't find any matches after fetcher action");let S=++$;ie.set(e,S);let O=De(c,y.data);A.fetchers.set(e,O);let[T,_]=re(t.history,A,P,c,C,!1,x.unstable_skipActionErrorRevalidation,H,z,Q,Re,fe,he,E,b,[o.route.id,y]);_.filter((t=>t.key!==e)).forEach((e=>{let t=e.key,n=A.fetchers.get(t),r=De(void 0,n?n.data:void 0);A.fetchers.set(t,r),U.has(t)&&Xe(t),e.controller&&U.set(t,e.controller)})),Be({fetchers:new Map(A.fetchers)});let V=()=>_.forEach((e=>Xe(e.key)));h.signal.addEventListener("abort",V);let{loaderResults:R,fetcherResults:I}=await We(A.matches,P,T,_,w);if(h.signal.aborted)return;h.signal.removeEventListener("abort",V),ie.delete(e),U.delete(e),_.forEach((e=>U.delete(e.key)));let N=we([...R,...I]);if(N){if(N.idx>=T.length){let e=_[N.idx-T.length].key;he.add(e)}return Qe(w,N.result)}let{loaderData:M,errors:L}=me(A,A.matches,T,R,void 0,_,I,Me);if(A.fetchers.has(e)){let t=Ne(y.data);A.fetchers.set(e,t)}tt(S),"loading"===A.navigation.state&&S>oe?(a(D,"Expected pending action"),k&&k.abort(),qe(A.navigation.location,{matches:P,loaderData:M,errors:L,fetchers:new Map(A.fetchers)})):(Be({errors:L,loaderData:ge(A.loaderData,M,P,L),fetchers:new Map(A.fetchers)}),H=!1)}(e,n,h,y,p,d.active,s,f):(fe.set(e,{routeId:n,path:h}),async function(e,n,r,o,i,s,l,u){let c=A.fetchers.get(e);Ge(e,De(u,c?c.data:void 0),{flushSync:l});let p=new AbortController,d=de(t.history,r,p.signal);if(s){let t=await pt(i,r,d.signal);if("aborted"===t.type)return;if("error"===t.type){let{error:o}=st(r,t);return void Je(e,n,o,{flushSync:l})}if(!t.matches)return void Je(e,n,Ce(404,{pathname:r}),{flushSync:l});o=Ie(i=t.matches,r)}U.set(e,p);let h=$,f=(await Ue("loader",d,[o],i))[0];if(Ee(f)&&(f=await Ve(f,d.signal,!0)||f),U.get(e)===p&&U.delete(e),!d.signal.aborted){if(!Re.has(e))return Se(f)?oe>h?void Ge(e,Ne(void 0)):(he.add(e),void await Qe(d,f)):void(Pe(f)?Je(e,n,f.error):(a(!Ee(f),"Unhandled fetcher deferred data"),Ge(e,Ne(f.data))));Ge(e,Ne(void 0))}}(e,n,h,y,p,d.active,s,f))},revalidate:function(){$e(),Be({revalidation:"loading"}),"submitting"!==A.navigation.state&&("idle"!==A.navigation.state?He(D||A.historyAction,A.navigation.location,{overrideNavigation:A.navigation}):He(A.historyAction,A.location,{startUninterruptedRevalidation:!0}))},createHref:e=>t.history.createHref(e),encodeLocation:e=>t.history.encodeLocation(e),getFetcher:Ye,deleteFetcher:function(e){if(x.v7_fetcherPersist){let t=(xe.get(e)||0)-1;t<=0?(xe.delete(e),Re.add(e)):xe.set(e,t)}else Ke(e);Be({fetchers:new Map(A.fetchers)})},dispose:function(){E&&E(),j&&j(),P.clear(),k&&k.abort(),A.fetchers.forEach(((e,t)=>Ke(t))),A.blockers.forEach(((e,t)=>nt(t)))},getBlocker:function(e,t){let n=A.blockers.get(e)||K;return Le.get(e)!==t&&Le.set(e,t),n},deleteBlocker:nt,patchRoutes:function(e,t){let n=null==u;ae(e,t,u||v,f,s),n&&(v=[...v],Be({}))},_internalFetchControllers:U,_internalActiveDeferreds:Me,_internalSetRoutes:function(e){f={},u=m(e,s,void 0,f)}},d}({basename:void 0,future:pt({},void 0,{v7_prependBasename:!0}),history:function(t){return void 0===t&&(t={}),function(t,n,r,o){void 0===o&&(o={});let{window:l=document.defaultView,v5Compat:d=!1}=o,h=l.history,f=e.Pop,m=null,g=y();function y(){return(h.state||{idx:null}).idx}function v(){f=e.Pop;let t=y(),n=null==t?null:t-g;g=t,m&&m({action:f,location:C.location,delta:n})}function b(e){let t="null"!==l.location.origin?l.location.origin:l.location.href,n="string"==typeof e?e:p(e);return n=n.replace(/ $/,"%20"),a(t,"No window.location.(origin|href) available to create URL for href: "+n),new URL(n,t)}null==g&&(g=0,h.replaceState(i({},h.state,{idx:g}),""));let C={get action(){return f},get location(){return t(l,h)},listen(e){if(m)throw new Error("A history only accepts one active listener");return l.addEventListener(s,v),m=e,()=>{l.removeEventListener(s,v),m=null}},createHref:e=>n(l,e),createURL:b,encodeLocation(e){let t=b(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(t,n){f=e.Push;let o=c(C.location,t,n);r&&r(o,t),g=y()+1;let i=u(o,g),s=C.createHref(o);try{h.pushState(i,"",s)}catch(e){if(e instanceof DOMException&&"DataCloneError"===e.name)throw e;l.location.assign(s)}d&&m&&m({action:f,location:C.location,delta:1})},replace:function(t,n){f=e.Replace;let o=c(C.location,t,n);r&&r(o,t),g=y();let i=u(o,g),s=C.createHref(o);h.replaceState(i,"",s),d&&m&&m({action:f,location:C.location,delta:0})},go:e=>h.go(e)};return C}((function(e,t){let{pathname:n,search:r,hash:o}=e.location;return c("",{pathname:n,search:r,hash:o},t.state&&t.state.usr||null,t.state&&t.state.key||"default")}),(function(e,t){return"string"==typeof t?t:p(t)}),null,t)}({window:void 0}),hydrationData:function(){var e;let t=null==(e=window)?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=pt({},t,{errors:ft(t.errors)})),t}(),routes:NT,mapRouteProperties:function(e){let n={hasErrorBoundary:null!=e.ErrorBoundary||null!=e.errorElement};return e.Component&&Object.assign(n,{element:t.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(n,{hydrateFallbackElement:t.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(n,{errorElement:t.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),n},unstable_dataStrategy:void 0,unstable_patchRoutesOnMiss:void 0,window:void 0}).initialize());const jT=function(){return t.createElement("div",{className:"app"},t.createElement(wt,{router:LT}))};var FT=document.getElementById("root");(0,r.H)(FT).render(t.createElement(t.StrictMode,null,t.createElement(jT,null)))})()})(); \ No newline at end of file +`,JO=({reverseOrder:e,position:n="top-center",toastOptions:r,gutter:o,children:i,containerStyle:s,containerClassName:a})=>{let{toasts:l,handlers:u}=(e=>{let{toasts:n,pausedAt:r}=((e={})=>{let[n,r]=(0,t.useState)(wO);(0,t.useEffect)((()=>(CO.push(r),()=>{let e=CO.indexOf(r);e>-1&&CO.splice(e,1)})),[n]);let o=n.toasts.map((t=>{var n,r;return{...e,...e[t.type],...t,duration:t.duration||(null==(n=e[t.type])?void 0:n.duration)||(null==e?void 0:e.duration)||EO[t.type],style:{...e.style,...null==(r=e[t.type])?void 0:r.style,...t.style}}}));return{...n,toasts:o}})(e);(0,t.useEffect)((()=>{if(r)return;let e=Date.now(),t=n.map((t=>{if(t.duration===1/0)return;let n=(t.duration||0)+t.pauseDuration-(e-t.createdAt);if(!(n<0))return setTimeout((()=>SO.dismiss(t.id)),n);t.visible&&SO.dismiss(t.id)}));return()=>{t.forEach((e=>e&&clearTimeout(e)))}}),[n,r]);let o=(0,t.useCallback)((()=>{r&&xO({type:6,time:Date.now()})}),[r]),i=(0,t.useCallback)(((e,t)=>{let{reverseOrder:r=!1,gutter:o=8,defaultPosition:i}=t||{},s=n.filter((t=>(t.position||i)===(e.position||i)&&t.height)),a=s.findIndex((t=>t.id===e.id)),l=s.filter(((e,t)=>t<a&&e.visible)).length;return s.filter((e=>e.visible)).slice(...r?[l+1]:[0,l]).reduce(((e,t)=>e+(t.height||0)+o),0)}),[n]);return{toasts:n,handlers:{updateHeight:OO,startPause:TO,endPause:o,calculateOffset:i}}})(r);return t.createElement("div",{style:{position:"fixed",zIndex:9999,top:16,left:16,right:16,bottom:16,pointerEvents:"none",...s},className:a,onMouseEnter:u.startPause,onMouseLeave:u.endPause},l.map((r=>{let s=r.position||n,a=((e,t)=>{let n=e.includes("top"),r=n?{top:0}:{bottom:0},o=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:gO()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(n?1:-1)}px)`,...r,...o}})(s,u.calculateOffset(r,{reverseOrder:e,gutter:o,defaultPosition:n}));return t.createElement($O,{id:r.id,key:r.id,onHeightUpdate:u.updateHeight,className:r.visible?GO:"",style:a},"custom"===r.type?fO(r.message,r):i?i(r):t.createElement(WO,{toast:r,position:s}))})))},YO=SO,KO=function(e){return e.Unverified="unverified",e.Verified="verified",e.Edited="edited",e}({}),XO=function(e){return e.not_started="not started",e.started="started",e.completed="completed",e}({}),ZO=function(e){return e.closed="closed",e.open="open",e.preview="preview",e.published="published",e}({});function eT(){return tT.apply(this,arguments)}function tT(){return(tT=Dt(Mt().mark((function e(){var t,n;return Mt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,fetch("/api/survey/list");case 3:return t=e.sent,e.next=6,t.json();case 6:return n=e.sent,e.abrupt("return",n);case 10:return e.prev=10,e.t0=e.catch(0),e.abrupt("return",[]);case 13:case"end":return e.stop()}}),e,null,[[0,10]])})))).apply(this,arguments)}function nT(){return rT.apply(this,arguments)}function rT(){return(rT=Dt(Mt().mark((function e(){var t,n,r;return Mt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,fetch("/api/survey/active/year");case 3:return t=e.sent,e.next=6,t.json();case 6:if(!("year"in(n=e.sent))){e.next=12;break}return r=n.year,e.abrupt("return",r.toString());case 12:return console.log("Invalid response format: Failed fetching active survey year."),e.abrupt("return","");case 14:e.next=20;break;case 16:return e.prev=16,e.t0=e.catch(0),console.error("Failed fetching active survey year:",e.t0),e.abrupt("return","");case 20:case"end":return e.stop()}}),e,null,[[0,16]])})))).apply(this,arguments)}const oT=t.forwardRef((({bsPrefix:e,variant:t,animation:n="border",size:r,as:o="div",className:i,...s},a)=>{const l=`${e=Cn(e,"spinner")}-${n}`;return(0,gn.jsx)(o,{ref:a,...s,className:mn()(i,l,r&&`${l}-${r}`,t&&`text-${t}`)})}));oT.displayName="Spinner";const iT=oT;function sT(e){return yr({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M362.6 192.9L345 174.8c-.7-.8-1.8-1.2-2.8-1.2-1.1 0-2.1.4-2.8 1.2l-122 122.9-44.4-44.4c-.8-.8-1.8-1.2-2.8-1.2-1 0-2 .4-2.8 1.2l-17.8 17.8c-1.6 1.6-1.6 4.1 0 5.7l56 56c3.6 3.6 8 5.7 11.7 5.7 5.3 0 9.9-3.9 11.6-5.5h.1l133.7-134.4c1.4-1.7 1.4-4.2-.1-5.7z"},child:[]},{tag:"path",attr:{d:"M256 76c48.1 0 93.3 18.7 127.3 52.7S436 207.9 436 256s-18.7 93.3-52.7 127.3S304.1 436 256 436c-48.1 0-93.3-18.7-127.3-52.7S76 304.1 76 256s18.7-93.3 52.7-127.3S207.9 76 256 76m0-28C141.1 48 48 141.1 48 256s93.1 208 208 208 208-93.1 208-208S370.9 48 256 48z"},child:[]}]})(e)}function aT(e){return yr({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 48C141.1 48 48 141.1 48 256s93.1 208 208 208 208-93.1 208-208S370.9 48 256 48zm106.5 150.5L228.8 332.8h-.1c-1.7 1.7-6.3 5.5-11.6 5.5-3.8 0-8.1-2.1-11.7-5.7l-56-56c-1.6-1.6-1.6-4.1 0-5.7l17.8-17.8c.8-.8 1.8-1.2 2.8-1.2 1 0 2 .4 2.8 1.2l44.4 44.4 122-122.9c.8-.8 1.8-1.2 2.8-1.2 1.1 0 2.1.4 2.8 1.2l17.5 18.1c1.8 1.7 1.8 4.2.2 5.8z"},child:[]}]})(e)}function lT(e){return yr({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M331.3 308.7L278.6 256l52.7-52.7c6.2-6.2 6.2-16.4 0-22.6-6.2-6.2-16.4-6.2-22.6 0L256 233.4l-52.7-52.7c-6.2-6.2-15.6-7.1-22.6 0-7.1 7.1-6 16.6 0 22.6l52.7 52.7-52.7 52.7c-6.7 6.7-6.4 16.3 0 22.6 6.4 6.4 16.4 6.2 22.6 0l52.7-52.7 52.7 52.7c6.2 6.2 16.4 6.2 22.6 0 6.3-6.2 6.3-16.4 0-22.6z"},child:[]},{tag:"path",attr:{d:"M256 76c48.1 0 93.3 18.7 127.3 52.7S436 207.9 436 256s-18.7 93.3-52.7 127.3S304.1 436 256 436c-48.1 0-93.3-18.7-127.3-52.7S76 304.1 76 256s18.7-93.3 52.7-127.3S207.9 76 256 76m0-28C141.1 48 48 141.1 48 256s93.1 208 208 208 208-93.1 208-208S370.9 48 256 48z"},child:[]}]})(e)}function uT(e){return yr({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 48C141.1 48 48 141.1 48 256s93.1 208 208 208 208-93.1 208-208S370.9 48 256 48zm52.7 283.3L256 278.6l-52.7 52.7c-6.2 6.2-16.4 6.2-22.6 0-3.1-3.1-4.7-7.2-4.7-11.3 0-4.1 1.6-8.2 4.7-11.3l52.7-52.7-52.7-52.7c-3.1-3.1-4.7-7.2-4.7-11.3 0-4.1 1.6-8.2 4.7-11.3 6.2-6.2 16.4-6.2 22.6 0l52.7 52.7 52.7-52.7c6.2-6.2 16.4-6.2 22.6 0 6.2 6.2 6.2 16.4 0 22.6L278.6 256l52.7 52.7c6.2 6.2 6.2 16.4 0 22.6-6.2 6.3-16.4 6.3-22.6 0z"},child:[]}]})(e)}const cT=function(e){var n=e.status;return{completed:t.createElement(aT,{title:n,size:24,color:"green"}),started:t.createElement(sT,{title:n,size:24,color:"rgb(217, 117, 10)"}),"did not respond":t.createElement(uT,{title:n,size:24,color:"red"}),"not started":t.createElement(lT,{title:n,size:24})}[n]||n};function pT(e){var n=e.text,r=e.helpText,o=e.onClick,i=e.enabled,s=Rt((0,t.useState)(!1),2),a=s[0],l=s[1],u=function(){var e=Dt(Mt().mark((function e(){return Mt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!a){e.next=2;break}return e.abrupt("return");case 2:return l(!0),e.prev=3,e.next=6,o();case 6:return e.prev=6,l(!1),e.finish(6);case 9:case"end":return e.stop()}}),e,null,[[3,,6,9]])})));return function(){return e.apply(this,arguments)}}();return t.createElement(as,{onClick:u,disabled:!i,style:{pointerEvents:"auto",marginLeft:".5rem"},title:r},a&&t.createElement(iT,{as:"span",animation:"border",size:"sm",role:"status","aria-hidden":"true"}),n)}const dT=function(){var e=Rt((0,t.useState)([]),2),n=e[0],r=e[1],o=(0,t.useRef)(!1);function i(e,t,n){return s.apply(this,arguments)}function s(){return(s=Dt(Mt().mark((function e(t,n,o){var i,s;return Mt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,fetch(t,{method:"POST"});case 3:return i=e.sent,e.next=6,i.json();case 6:s=e.sent,i.ok?(YO(o),eT().then((function(e){r(e)}))):YO(n+s.message),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),YO(n+e.t0.message);case 13:case"end":return e.stop()}}),e,null,[[0,10]])})))).apply(this,arguments)}function a(){return(a=Dt(Mt().mark((function e(){return Mt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i("/api/survey/new","Failed creating new survey: ","Created new survey");case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function l(e,t){return u.apply(this,arguments)}function u(){return(u=Dt(Mt().mark((function e(t,n){return Mt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!o.current){e.next=3;break}return YO("Wait for status update to be finished..."),e.abrupt("return");case 3:return o.current=!0,e.next=6,i("/api/survey/"+n+"/"+t,"Error while updating "+t+" survey status to "+n+": ",t+" survey status updated to "+n);case 6:o.current=!1;case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function c(){return(c=Dt(Mt().mark((function e(t,n){return Mt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i("/api/response/unlock/"+t+"/"+n,"Error while unlocking "+n+" "+t+" survey response: ",n+" "+t+" survey response unlocked");case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}(0,t.useEffect)((function(){eT().then((function(e){r(e)}))}),[]);var p=n.length>0&&n.every((function(e){return e.status==ZO.published})),d=We(),h=window.location.origin+"/data?preview";return t.createElement("div",{className:"py-5 grey-container"},t.createElement(Sn,{style:{maxWidth:"100rem"}},t.createElement(Tn,null,t.createElement(JO,null),t.createElement(as,{onClick:function(){return a.apply(this,arguments)},disabled:!p,style:{pointerEvents:"auto",width:"10rem",margin:"1rem"},title:"Create a new survey for the next year. Only possible if all current surveys are published."},"start new survey"),t.createElement(KS,{defaultActiveKey:"0"},n.map((function(e,n){return t.createElement(KS.Item,{eventKey:n.toString(),key:e.year},t.createElement(KS.Header,null,e.year," - ",e.status),t.createElement(KS.Body,null,t.createElement("div",{style:{marginLeft:".5rem",marginBottom:"1rem"}},t.createElement(as,{style:{marginLeft:".5rem"},onClick:function(){return d("/survey/admin/inspect/".concat(e.year))},title:"Open the survey for inspection with all questions visible and any visibleIf logic added to the title."},"Inspect Survey"),t.createElement(as,{style:{marginLeft:".5rem"},onClick:function(){return d("/survey/admin/try/".concat(e.year))},title:"Open the survey exactly as the nrens will see it, but without any nren data."},"Try Survey"),t.createElement(pT,{text:"Mark as open",helpText:"Allow the NRENs to respond to this survey. Only 1 survey may be open at a time, and (pre)-published surveys cannot be opened anymore.",enabled:e.status==ZO.closed,onClick:function(){return l(e.year,"open")}}),t.createElement(pT,{text:"Mark as closed",helpText:"Do not allow the NRENs to respond to this survey anymore. Only surveys with status open can be closed.",enabled:e.status==ZO.open,onClick:function(){return l(e.year,"close")}}),t.createElement(pT,{text:"Preview results",helpText:"Publish all completed survey responses to the compendium website for preview by admins. This is only possible if the survey is closed or previewed already.",enabled:e.status==ZO.closed||e.status==ZO.preview,onClick:function(){return l(e.year,"preview")}}),t.createElement(pT,{text:"Publish results",helpText:"Publish or re-publish all completed survey responses to the compendium website. This is only possible if the survey is in preview or published already.",enabled:e.status==ZO.preview||e.status==ZO.published,onClick:function(){return l(e.year,"publish")}}),e.status==ZO.preview&&t.createElement("span",null," Preview link: ",t.createElement("a",{href:h},h))),t.createElement(bP,null,t.createElement("colgroup",null,t.createElement("col",{style:{width:"10%"}}),t.createElement("col",{style:{width:"20%"}}),t.createElement("col",{style:{width:"20%"}}),t.createElement("col",{style:{width:"30%"}}),t.createElement("col",{style:{width:"20%"}})),t.createElement("thead",null,t.createElement("tr",null,t.createElement("th",null,"NREN"),t.createElement("th",null,"Status"),t.createElement("th",null,"Lock"),t.createElement("th",null,"Management Notes"),t.createElement("th",null,"Actions"))),t.createElement("tbody",null,e.responses.map((function(n){return t.createElement("tr",{key:n.nren.id},t.createElement("td",null,n.nren.name),t.createElement("td",null,t.createElement(cT,{status:n.status})),t.createElement("td",{style:{textWrap:"wrap",wordWrap:"break-word",maxWidth:"10rem"}},n.lock_description),t.createElement("td",null,"notes"in n&&t.createElement("textarea",{onInput:(r=function(t){return r=e.year,o=n.nren.id,i=t.target.value,void fetch("/api/survey/"+r+"/"+o+"/notes",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({notes:i||""})}).then(function(){var e=Dt(Mt().mark((function e(t){var n;return Mt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.json();case 2:n=e.sent,t.ok?YO.success("Notes saved"):YO.error("Failed saving notes: "+n.message||0);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()).catch((function(e){YO.error("Failed saving notes: "+e)}));var r,o,i},function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];clearTimeout(o),o=setTimeout((function(){r.apply(void 0,t),clearTimeout(o)}),1e3)}),style:{minWidth:"100%",minHeight:"5rem"},placeholder:"Notes for this survey",defaultValue:n.notes||""})),t.createElement("td",null,t.createElement(as,{onClick:function(){return d("/survey/response/".concat(e.year,"/").concat(n.nren.name))},style:{pointerEvents:"auto",margin:".5rem"},title:"Open the responses of the NREN."},"open"),t.createElement(as,{onClick:function(){return function(e,t){return c.apply(this,arguments)}(e.year,n.nren.name)},disabled:""==n.lock_description,style:{pointerEvents:"auto"},title:"Remove the lock from the survey so that another person can open the survey for editing. WARNING: The person that currently has the lock will not be able to save their changes anymore once someone else starts editing!"},"remove lock")));var r,o}))))))}))))))};function hT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function fT(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?hT(Object(n),!0).forEach((function(t){tn(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hT(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function mT(){return(mT=Dt(Mt().mark((function e(){var t,n;return Mt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,fetch("/api/user/list");case 3:return t=e.sent,e.next=6,t.json();case 6:return n=e.sent,e.abrupt("return",n);case 10:return e.prev=10,e.t0=e.catch(0),e.abrupt("return",[]);case 13:case"end":return e.stop()}}),e,null,[[0,10]])})))).apply(this,arguments)}function gT(){return(gT=Dt(Mt().mark((function e(){var t,n;return Mt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,fetch("/api/nren/list");case 3:return t=e.sent,e.next=6,t.json();case 6:return n=e.sent,e.abrupt("return",n);case 10:return e.prev=10,e.t0=e.catch(0),e.abrupt("return",[]);case 13:case"end":return e.stop()}}),e,null,[[0,10]])})))).apply(this,arguments)}var yT=function(){var e=Dt(Mt().mark((function e(t,n){var r,o,i,s;return Mt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=fT({id:t},n),o={method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)},e.next=4,fetch("/api/user/".concat(t),o);case 4:return i=e.sent,e.next=7,i.json();case 7:if(s=e.sent,i.ok){e.next=10;break}throw new Error(s.message);case 10:return e.abrupt("return",s.user);case 11:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),vT=function(e,t){return e.permissions.active&&!t.permissions.active?-1:!e.permissions.active&&t.permissions.active?1:e.permissions.active&&t.permissions.active?"admin"===e.role&&"admin"!==t.role?1:"admin"!==e.role&&"admin"===t.role?-1:e.name.localeCompare(t.name):e.name.localeCompare(t.name)};const bT=function(){var e=Rt((0,t.useState)([]),2),n=e[0],r=e[1],o=Rt((0,t.useState)([]),2),i=o[0],s=o[1],a=(0,t.useContext)(Ft).user,l=Rt((0,t.useState)({idx:-1,asc:!0}),2),u=l[0],c=l[1],p=Rt((0,t.useState)([]),2),d=p[0],h=p[1];(0,t.useEffect)((function(){(function(){return mT.apply(this,arguments)})().then((function(e){r(e),h(e.sort(vT))})),function(){return gT.apply(this,arguments)}().then((function(e){s(e.sort((function(e,t){return e.name.localeCompare(t.name)})))}))}),[]),(0,t.useEffect)((function(){h(Kt(n.sort(vT)))}),[n]);for(var f=function(e,t){var o=n.findIndex((function(e){return e.id===t.id})),i=Kt(n),s=e.target.name,a={};a[s]="active"===s?e.target.checked:e.target.value,yT(t.id,a).then((function(e){i[o]=e,r(i)})).catch((function(e){alert(e.message)}))},m=function(e){var t;if(e===u.idx||(5===e||0===e)&&-1===u.idx)return 5!==e&&0!==e||(e=-1),c({idx:e,asc:!u.asc}),void h(Kt(d.reverse()));0===e?(t=vT,c({idx:-1,asc:!0})):1===e?(t=function(e,t){return e.permissions.active&&!t.permissions.active?-1:!e.permissions.active&&t.permissions.active?1:0},c({idx:e,asc:!0})):2===e?(t=function(e,t){return e.role.localeCompare(t.role)},c({idx:e,asc:!0})):3===e?(t=function(e,t){return e.email.localeCompare(t.email)},c({idx:e,asc:!0})):4===e?(t=function(e,t){return e.name.localeCompare(t.name)},c({idx:e,asc:!0})):5===e?(t=vT,c({idx:-1,asc:!0})):6===e?(t=function(e,t){return 0===e.nrens.length&&0===t.nrens.length?0:0===e.nrens.length?-1:0===t.nrens.length?1:e.nrens[0].localeCompare(t.nrens[0])},c({idx:e,asc:!0})):(t=vT,c({idx:e,asc:!0})),h(n.sort(t))},g={},y=0;y<=6;y++)g[y]=u.idx===y?{"aria-sort":u.asc?"ascending":"descending"}:null;return t.createElement(Sn,{style:{maxWidth:"90vw"}},t.createElement(Tn,null,t.createElement("h1",null," User Management Page"),t.createElement(bP,null,t.createElement("thead",null,t.createElement("tr",null,t.createElement("th",nE({},g[0],{onClick:function(){return m(0)},className:"pt-3 sortable",style:{border:"1px solid #ddd"}}),"Id"),t.createElement("th",nE({},g[1],{onClick:function(){return m(1)},className:"pt-3 sortable",style:{border:"1px solid #ddd"}}),"Active"),t.createElement("th",nE({},g[2],{onClick:function(){return m(2)},className:"pt-3 sortable",style:{border:"1px solid #ddd"}}),"Role"),t.createElement("th",nE({},g[3],{onClick:function(){return m(3)},className:"pt-3 sortable",style:{border:"1px solid #ddd"}}),"Email"),t.createElement("th",nE({},g[4],{onClick:function(){return m(4)},className:"pt-3 sortable",style:{border:"1px solid #ddd"}}),"Full Name"),t.createElement("th",nE({},g[5],{onClick:function(){return m(5)},className:"pt-3 sortable",style:{border:"1px solid #ddd"}}),"OIDC Sub"),t.createElement("th",nE({},g[6],{onClick:function(){return m(6)},className:"pt-3 sortable",style:{border:"1px solid #ddd"}}),"NREN"))),t.createElement("tbody",null,d.map((function(e){return t.createElement("tr",{key:e.id},t.createElement("td",{style:{border:"1px dotted #ddd"}},e.id),t.createElement("td",{style:{border:"1px dotted #ddd"}},e.id==a.id?"Active":t.createElement("input",{type:"checkbox",name:"active",checked:e.permissions.active,onChange:function(t){return f(t,e)}})),t.createElement("td",{style:{border:"1px dotted #ddd"}},e.id==a.id?e.role.charAt(0).toUpperCase()+e.role.slice(1):t.createElement("select",{name:"role",defaultValue:e.role,onChange:function(t){return f(t,e)}},t.createElement("option",{value:"admin"},"Admin"),t.createElement("option",{value:"user"},"User"),t.createElement("option",{value:"observer"},"Observer"))),t.createElement("td",{style:{border:"1px dotted #ddd"}},e.email),t.createElement("td",{style:{border:"1px dotted #ddd"}},e.name),t.createElement("td",{style:{border:"1px dotted #ddd"}},e.oidc_sub),t.createElement("td",{style:{border:"1px dotted #ddd"}},t.createElement("select",{name:"nren",multiple:!1,value:e.nrens.length>0?(n=e.nrens[0],null===(r=i.find((function(e){return e.id==n||e.name==n})))||void 0===r?void 0:r.id):"",onChange:function(t){return f(t,e)}},t.createElement("option",{value:""},"Select NREN"),i.map((function(e){return t.createElement("option",{key:"nren_"+e.id,value:e.id},e.name)})))));var n,r}))))))};var CT=o(522),wT=o(755);function xT(e,t){if(0==t.column.indexValue&&"item"in t.row){var n,r,o=t.row.item;void 0!==o.customDescription&&(null===(n=t.htmlElement.parentElement)||void 0===n||n.children[0].children[0].setAttribute("description",o.customDescription),null===(r=t.htmlElement.parentElement)||void 0===r||r.children[0].children[0].classList.add("survey-tooltip"))}}function ET(e,t){t.question.hideCheckboxLabels&&(t.cssClasses.root+=" hidden-checkbox-labels")}function PT(e,t){var n,r='[data-name="'+t.question.name+'"]',o=null===(n=document.querySelector(r))||void 0===n?void 0:n.querySelector("h5");o&&!o.classList.contains("sv-header-flex")&&t.question.updateElementCss()}function ST(e,t,n){var r;n.verificationStatus.set(e.name,t);var o=document.createElement("button");o.type="button",o.className="sv-action-bar-item verification",o.innerHTML=t,t==KO.Unverified?(o.innerHTML="No change from previous year",o.className+=" verification-required",o.onclick=function(){"display"!=n.mode&&(e.validate(),ST(e,KO.Verified,n))}):(o.innerHTML="Answer updated",o.className+=" verification-ok");var i='[data-name="'+e.name+'"]',s=null===(r=document.querySelector(i))||void 0===r?void 0:r.querySelector("h5"),a=null==s?void 0:s.querySelector(".verification");a?a.replaceWith(o):null==s||s.appendChild(o)}const OT=function(e){var n=e.surveyModel,r=(0,t.useCallback)((function(e,t){var r,o=n.verificationStatus.get(t.question.name),i=null===(r=t.question)||void 0===r?void 0:r.readOnly;o&&!i?ST(t.question,o,n):i&&function(e){var t,n=!!e.visibleIf,r='[data-name="'+e.name+'"]',o=document.querySelector(r),i=null==o?void 0:o.querySelector("h5");if(n)o.style.display="none";else{i&&(i.style.textDecoration="line-through");var s=null===(t=document.querySelector(r))||void 0===t?void 0:t.querySelector(".sv-question__content");s&&(s.style.display="none")}}(t.question)}),[n]),o=(0,t.useCallback)((function(e,t){n.verificationStatus.get(t.question.name)==KO.Unverified&&ST(t.question,KO.Edited,n)}),[n]);return n.css.question.title.includes("sv-header-flex")||(n.css.question.title="sv-title sv-question__title sv-header-flex",n.css.question.titleOnError="sv-question__title--error sv-error-color-fix"),n.onAfterRenderQuestion.hasFunc(r)||(n.onAfterRenderQuestion.add(r),n.onAfterRenderQuestion.add(PT)),n.onValueChanged.hasFunc(o)||n.onValueChanged.add(o),n.onUpdateQuestionCssClasses.hasFunc(ET)||n.onUpdateQuestionCssClasses.add(ET),n.onMatrixAfterCellRender.hasFunc(xT)||n.onMatrixAfterCellRender.add(xT),t.createElement(wT.Survey,{model:n})};function TT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _T(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?TT(Object(n),!0).forEach((function(t){tn(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):TT(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const VT=function(e){var n=e.surveyModel,r=e.pageNoSetter,o=Rt((0,t.useState)([]),2),i=o[0],s=o[1],a=function(e){return!(null===e.value||void 0===e.value||""===e.value||"checkbox"===e.getType()&&0==e.value.length||"multipletext"===e.getType()&&(1===Object.keys(e.value).length&&void 0===Object.values(e.value)[0]||0===Object.keys(e.value).length))};(0,t.useEffect)((function(){var e=function(e){if(e&&e.pages){var t=[];e.pages.forEach((function(n){var r=n.questions.filter((function(e){return e.startWithNewLine})),o=r.length,i=r.filter(a).length,s=o-i,l=i/o;t.push({completionPercentage:100*l,unansweredPercentage:s/o*100,totalPages:e.pages.length,pageTitle:n.title})})),s(t)}};n.onValueChanged.add((function(t){e(t)})),e(n)}),[n]);var l={height:"0.5rem",transition:"width 0.3s ease"};return t.createElement(Sn,{className:"survey-progress"},t.createElement(Tn,null,i.map((function(e,o){return t.createElement(Vn,{xs:12,md:!0,key:o,onClick:function(){return r(o)},style:{cursor:"pointer",margin:"0.5rem"}},t.createElement("div",null,t.createElement("span",{style:{whiteSpace:"nowrap",fontSize:"1.5rem",marginRight:"0.25rem",fontWeight:"bold",color:"#2db394"}},o+1),t.createElement("span",{style:_T({whiteSpace:"nowrap"},n.currentPageNo==o&&{fontWeight:"bold"})},e.pageTitle),t.createElement("div",{style:{display:"flex",flexWrap:"wrap"}},t.createElement("div",{style:_T(_T({},l),{},{width:"".concat(e.completionPercentage,"%"),backgroundColor:"#262261"})}),t.createElement("div",{style:_T(_T({},l),{},{width:"".concat(e.unansweredPercentage,"%"),backgroundColor:"#cdcdcd"})}))))}))))},RT=function(e){var n=e.surveyModel,r=e.surveyActions,o=e.year,i=e.nren,s=e.children,a=Rt((0,t.useState)(0),2),l=a[0],u=a[1],c=Rt((0,t.useState)(!1),2),p=c[0],d=c[1],h=Rt((0,t.useState)(""),2),f=h[0],m=h[1],g=Rt((0,t.useState)(""),2),y=g[0],v=g[1],b=(0,t.useContext)(Ft).user,C=(0,t.useCallback)((function(){d("edit"==n.mode),m(n.lockedBy),u(n.currentPageNo),v(n.status)}),[n]);(0,t.useEffect)((function(){C()}),[C]);var w=function(e){u(e),n.currentPageNo=e},x=function(){w(n.currentPageNo+1)},E=function(){var e=Dt(Mt().mark((function e(t){return Mt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r[t]();case 2:C();case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),P=function(e,t){return S(e,(function(){return E(t)}))},S=function(e,n){return t.createElement("button",{className:"sv-btn sv-btn--navigation",onClick:n},e)},O="Save and stop editing",T="Save progress",_="Start editing",V="Complete Survey",R=function(){return t.createElement("div",{className:"survey-edit-buttons-block"},!p&&!f&&n.editAllowed&&P(_,"startEdit"),!p&&f&&f==b.name&&P("Discard any unsaved changes and release your lock","releaseLock"),p&&y==XO.started&&P(T,"save"),p&&y==XO.started&&P(O,"saveAndStopEdit"),p&&l===n.visiblePages.length-1&&P(V,"complete"),l!==n.visiblePages.length-1&&S("Next Section",x))};return t.createElement(Sn,null,t.createElement(Tn,{className:"survey-content"},t.createElement("h2",null,t.createElement("span",{className:"survey-title"},o," Compendium Survey "),t.createElement("span",{className:"survey-title-nren"}," ",i," "),t.createElement("span",null," - ",y)),t.createElement("div",{style:{marginTop:"1rem",textAlign:"justify"}},t.createElement("p",null,"To get started, click “",_,"” to end read-only mode. Different people from your NREN (Compendium administrators) can contribute to the survey if needed, but agreement should be reached internally before completing the survey as the administration team will treat responses as a single source of truth from the NREN. You can start editing only when nobody else from your NREN is currently working on the survey."),t.createElement("p",null,t.createElement("b",null,"In a small change, the survey now asks about this calendar year, i.e. ",o)," (or the current financial year if your budget or staffing data does not match the calendar year). For network questions, please provide data from the 12 months preceding you answering the question. Where available, the survey questions are pre-filled with answers from the previous survey. You can edit the pre-filled answer to provide new information, or press the “no change from previous year” button."),t.createElement("p",null,"Press the “",T,"“ or “",O,"“ button to save all answers in the survey. When you reach the last section of the survey (Services), you will find a “",V,"“ button which saves all answers in the survey and lets the Compendium team know that your answers are ready to be published. As long as the survey remains open, any Compendium administrator from your NREN can add answers or amend existing ones, even after using the “",V,"“ button."),t.createElement("p",null,"Some fields require specific data, such as numerical data, valid http-addresses, and in some questions, the answer has to add up to 100%. If an answer does not fulfil the set criteria, the question will turn pink and an error message will appear. Fields can be left blank if you prefer not to answer a question. If you notice any errors after the survey was closed, please contact us for correcting those.")),t.createElement("p",null,"Thank you for taking the time to fill in the ",o," Compendium Survey. Any questions or requests can be sent to ",t.createElement("a",{href:"mailto:Partner-Relations@geant.org"},t.createElement("span",null,"Partner-Relations@geant.org"))),p&&t.createElement(t.Fragment,null,t.createElement("br",null),t.createElement("b",null,"Remember to click “",O,"” before leaving the page."))),t.createElement(Tn,null,R()),t.createElement(Tn,{className:"survey-content"},!p&&t.createElement("div",{className:"survey-edit-explainer"},!f&&n.editAllowed&&"The survey is in read-only mode; click the “Start editing“ button to begin editing the answers.",!f&&!n.editAllowed&&"The survey is in read-only mode and can not be edited by you.",f&&f!=b.name&&"The survey is in read-only mode and currently being edited by: "+f+". To start editing the survey, ask them to complete their edits.",f&&f==b.name&&'The survey is in read-only mode because you started editing in another tab, browser or device. To start editing the survey, either complete those edits or click the "Discard any unsaved changes" button.')),t.createElement(Tn,null,t.createElement(VT,{surveyModel:n,pageNoSetter:w}),s),t.createElement(Tn,null,R()))},IT=function(e){var n=e.when,r=e.onPageExit;return function(e){let{router:n,basename:r}=nt(et.UseBlocker),o=rt(tt.UseBlocker),[i,s]=t.useState(""),a=t.useCallback((t=>{if("/"===r)return e();let{currentLocation:n,nextLocation:o,historyAction:i}=t;return e((Me({},n,{pathname:I(n.pathname,r)||n.pathname}),Me({},o,{pathname:I(o.pathname,r)||o.pathname})))}),[r,e]);t.useEffect((()=>{let e=String(++it);return s(e),()=>n.deleteBlocker(e)}),[n]),t.useEffect((()=>{""!==i&&n.getBlocker(i,a)}),[n,i,a]),i&&o.blockers.has(i)&&o.blockers.get(i)}((function(){if(n()){var t=window.confirm(e.message);return t&&r(),!t}return!1})),t.createElement("div",null)};function kT(e){var t=e[0];if(!e[1]&&(void 0===t||null==t))return!0;try{return!!new URL(t)}catch(e){return!1}}CT.Serializer.addProperty("itemvalue","customDescription:text"),CT.Serializer.addProperty("question","hideCheckboxLabels:boolean");const AT=function(e){var n=e.loadFrom,r=Rt((0,t.useState)(),2),o=r[0],i=r[1],s=function(){let{matches:e}=t.useContext(qe),n=e[e.length-1];return n?n.params:{}}(),a=s.year,l=s.nren,u=Rt((0,t.useState)("loading survey..."),2),c=u[0],p=u[1];CT.FunctionFactory.Instance.hasFunction("validateWebsiteUrl")||CT.FunctionFactory.Instance.register("validateWebsiteUrl",kT);var d=lr().trackPageView,h=(0,t.useCallback)((function(e){return e.preventDefault(),e.returnValue=""}),[]),f=(0,t.useCallback)((function(){window.navigator.sendBeacon("/api/response/unlock/"+a+"/"+l)}),[]),m=(0,t.useCallback)((function(){window.navigator.sendBeacon("/api/response/unlock/"+a+"/"+l),removeEventListener("beforeunload",h,{capture:!0}),removeEventListener("pagehide",f)}),[]);if((0,t.useEffect)((function(){function e(){return(e=Dt(Mt().mark((function e(){var t,r,o,s;return Mt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(n+a+(l?"/"+l:""));case 2:return t=e.sent,e.next=5,t.json();case 5:if(r=e.sent,t.ok){e.next=12;break}if(!("message"in r)){e.next=11;break}throw new Error(r.message);case 11:throw new Error("Request failed with status ".concat(t.status));case 12:for(s in(o=new CT.Model(r.model)).setVariable("surveyyear",a),o.setVariable("previousyear",parseInt(a)-1),o.showNavigationButtons=!1,o.requiredText="",o.verificationStatus=new Map,r.verification_status)o.verificationStatus.set(s,r.verification_status[s]);o.data=r.data,o.clearIncorrectValues(!0),o.currentPageNo=r.page,o.mode=r.mode,o.lockedBy=r.locked_by,o.status=r.status,o.editAllowed=r.edit_allowed,i(o);case 27:case"end":return e.stop()}}),e)})))).apply(this,arguments)}(function(){return e.apply(this,arguments)})().catch((function(e){return p("Error when loading survey: "+e.message)})).then((function(){d({documentTitle:"Survey for ".concat(l," (").concat(a,")")})}))}),[]),!o)return t.createElement(t.Fragment,null,c);var g,y,v,b,C,w=function(){var e=Dt(Mt().mark((function e(t,n){var r,i,s;return Mt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(l){e.next=2;break}return e.abrupt("return","Saving not available in inpect/try mode");case 2:return r={lock_uuid:t.lockUUID,new_state:n,data:t.data,page:t.currentPageNo,verification_status:Object.fromEntries(t.verificationStatus)},e.prev=3,e.next=6,fetch("/api/response/save/"+a+"/"+l,{method:"POST",headers:{"Content-Type":"application/json; charset=utf-8"},body:JSON.stringify(r)});case 6:return i=e.sent,e.next=9,i.json();case 9:if(s=e.sent,i.ok){e.next=12;break}return e.abrupt("return",s.message);case 12:o.mode=s.mode,o.lockedBy=s.locked_by,o.status=s.status,e.next=20;break;case 17:return e.prev=17,e.t0=e.catch(3),e.abrupt("return","Unknown Error: "+e.t0.message);case 20:case"end":return e.stop()}}),e,null,[[3,17]])})));return function(t,n){return e.apply(this,arguments)}}(),x=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n="",r=function(e,t){e.verificationStatus.get(t.name)==KO.Unverified&&(""==n&&(n=t.name),t.error='Please verify that last years data is correct by editing the answer or pressing the "No change from previous year" button!')};t&&o.onValidateQuestion.add(r);var i=e();return t&&o.onValidateQuestion.remove(r),i||YO("Validation failed!"),i},E={save:(C=Dt(Mt().mark((function e(){var t;return Mt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(x(o.validate.bind(o,!0,!0),!1)){e.next=4;break}return YO("Please correct the invalid fields before saving!"),e.abrupt("return");case 4:return e.next=6,w(o,"editing");case 6:t=e.sent,YO(t?"Failed saving survey: "+t:"Survey saved!");case 8:case"end":return e.stop()}}),e)}))),function(){return C.apply(this,arguments)}),complete:(b=Dt(Mt().mark((function e(){var t;return Mt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!x(o.validate.bind(o,!0,!0))){e.next=6;break}return e.next=4,w(o,"completed");case 4:(t=e.sent)?YO("Failed completing survey: "+t):(YO("Survey completed!"),removeEventListener("beforeunload",h,{capture:!0}),removeEventListener("pagehide",f));case 6:case"end":return e.stop()}}),e)}))),function(){return b.apply(this,arguments)}),saveAndStopEdit:(v=Dt(Mt().mark((function e(){var t;return Mt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(x(o.validate.bind(o,!0,!0),!1)){e.next=4;break}return YO("Please correct the invalid fields before saving."),e.abrupt("return");case 4:return e.next=6,w(o,"readonly");case 6:(t=e.sent)?YO("Failed saving survey: "+t):(YO("Survey saved!"),removeEventListener("beforeunload",h,{capture:!0}),removeEventListener("pagehide",f));case 8:case"end":return e.stop()}}),e)}))),function(){return v.apply(this,arguments)}),startEdit:(y=Dt(Mt().mark((function e(){var t,n,r;return Mt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch("/api/response/lock/"+a+"/"+l,{method:"POST"});case 2:return t=e.sent,e.next=5,t.json();case 5:if(n=e.sent,t.ok){e.next=9;break}return YO("Failed starting edit: "+n.message),e.abrupt("return");case 9:for(r in addEventListener("pagehide",f),addEventListener("beforeunload",h,{capture:!0}),n.verification_status)o.verificationStatus.set(r,n.verification_status[r]);if(o.data=n.data,o.clearIncorrectValues(!0),o.mode=n.mode,o.lockedBy=n.locked_by,o.lockUUID=n.lock_uuid,o.status=n.status,x(o.validate.bind(o,!0,!0),!1)){e.next=22;break}return YO("Some fields are invalid, please correct them."),e.abrupt("return");case 22:case"end":return e.stop()}}),e)}))),function(){return y.apply(this,arguments)}),releaseLock:(g=Dt(Mt().mark((function e(){var t,n;return Mt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch("/api/response/unlock/"+a+"/"+l,{method:"POST"});case 2:return t=e.sent,e.next=5,t.json();case 5:if(n=e.sent,t.ok){e.next=9;break}return YO("Failed releasing lock: "+n.message),e.abrupt("return");case 9:o.mode=n.mode,o.lockedBy=n.locked_by,o.status=n.status;case 12:case"end":return e.stop()}}),e)}))),function(){return g.apply(this,arguments)}),validatePage:function(){x(o.validatePage.bind(o))&&YO("Page validation successful!")}};return t.createElement(Sn,{className:"survey-container"},t.createElement(JO,null),t.createElement(IT,{message:"Are you sure you want to leave this page? Information you've entered may not be saved.",when:function(){return"edit"==o.mode&&!!l},onPageExit:m}),t.createElement(RT,{surveyModel:o,surveyActions:E,year:a,nren:l},t.createElement(OT,{surveyModel:o})))},DT=function(){var e=lr().trackPageView,n=(0,t.useContext)(Ft).user,r=We(),o=!!n.id,i=!!o&&!!n.nrens.length,s=i?n.nrens[0]:"",a=!!o&&n.permissions.admin,l=!!o&&"observer"===n.role,u=Rt((0,t.useState)(null),2),c=u[0],p=u[1];(0,t.useEffect)((function(){var t=function(){var e=Dt(Mt().mark((function e(){var t;return Mt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,nT();case 2:t=e.sent,p(t);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();t(),e({documentTitle:"GEANT Survey Landing Page"})}),[e]);var d=function(){var e=Rt((0,t.useState)(),2),n=e[0],r=e[1];return(0,t.useEffect)((function(){eT().then((function(e){r(e[0])}))}),[]),t.createElement(bP,{striped:!0,bordered:!0,responsive:!0},t.createElement("thead",null,t.createElement("tr",null,t.createElement("th",null,"(N)REN"),t.createElement("th",null,"Link"),t.createElement("th",null,"Survey Status"))),t.createElement("tbody",null,n&&n.responses.map((function(e){return t.createElement("tr",{key:e.nren.id},t.createElement("td",null,e.nren.name),t.createElement("td",null,t.createElement(St,{to:"/survey/response/".concat(n.year,"/").concat(e.nren.name)},t.createElement("span",null,"Navigate to survey"))),t.createElement("td",null,e.status))}))))};return t.createElement(Sn,{className:"py-5 grey-container"},t.createElement(Tn,null,t.createElement("div",{className:"center-text"},t.createElement("h1",{className:"geant-header"},"THE GÉANT COMPENDIUM OF NRENS SURVEY"),t.createElement("div",{className:"wordwrap pt-4",style:{maxWidth:"75rem"}},t.createElement("p",{style:{textAlign:"left"}},"Hello,",t.createElement("br",null),"Welcome to the GÉANT Compendium Survey. (N)REN Compendium administrators can login via Single Sign On (SSO) ",t.createElement("a",{href:"/login"},"here"),", which will complete their registration to fill in the latest Compendium survey. This will send a notification to the Compendium administration team and they will assign you to your (N)REN.",t.createElement("br",null),"Once this step has been completed, you will receive an email from the administration team. We aim to get back to you the same working day, but sometimes may take a little longer.",t.createElement("br",null),"If you are not sure whether you are a Compendium Administrator for your (N)REN, please contact your GÉANT Partner Relations relationship manager.",t.createElement("br",null),"Thank you."),t.createElement("span",null,"Current registration status:"),t.createElement("br",null),t.createElement("br",null),a?t.createElement("ul",null,t.createElement("li",null,t.createElement("span",null,"You are logged in as a Compendium Administrator")),t.createElement("li",null,t.createElement("span",null,"Click ",t.createElement(St,{to:"/survey/admin/surveys"},"here")," to access the survey management page.")),t.createElement("li",null,t.createElement("span",null,"Click ",t.createElement(St,{to:"/survey/admin/users"},"here")," to access the user management page.")),t.createElement("li",null,t.createElement("span",null,"Click ",t.createElement("a",{href:"#",onClick:function(){fetch("/api/data-download").then((function(e){if(!e.ok)throw new Error("Network response was not ok");return e.json()})).then((function(e){var t=function(e){var t=dC.book_new();e.forEach((function(e){var n=dC.json_to_sheet(e.data);e.meta&&function(e,t,n){for(var r,o=dC.decode_range(null!==(r=e["!ref"])&&void 0!==r?r:""),i=-1,s=o.s.c;s<=o.e.c;s++){var a=e[dC.encode_cell({r:o.s.r,c:s})];if(a&&"string"==typeof a.v&&a.v===t){i=s;break}}if(-1!==i)for(var l=o.s.r+1;l<=o.e.r;++l){var u=dC.encode_cell({r:l,c:i});e[u]&&"n"===e[u].t&&(e[u].z=n)}else console.error("Column '".concat(t,"' not found."))}(n,e.meta.columnName,e.meta.format),dC.book_append_sheet(t,n,e.name)}));for(var n=nC(t,{bookType:"xlsx",type:"binary"}),r=new ArrayBuffer(n.length),o=new Uint8Array(r),i=0;i<n.length;i++)o[i]=255&n.charCodeAt(i);return new Blob([r],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8"})}(e),n=document.createElement("a");n.href=URL.createObjectURL(t),n.download="data.xlsx",document.body.appendChild(n),n.click(),document.body.removeChild(n)})).catch((function(e){console.error("Error fetching data:",e)}))}},"here")," to do the full data download."))):t.createElement("ul",null,c&&!a&&!l&&i&&function(){try{return r("/survey/response/".concat(c,"/").concat(s)),t.createElement("li",null,"Redirecting to survey...")}catch(e){return console.error("Error navigating:",e),null}}(),o?t.createElement("li",null,t.createElement("span",null,"You are logged in")):t.createElement("li",null,t.createElement("span",null,"You are not logged in")),o&&!l&&!i&&t.createElement("li",null,t.createElement("span",null,"Your access to the survey has not yet been approved")),o&&!l&&!i&&t.createElement("li",null,t.createElement("span",null,"Once you have been approved, you will immediately be directed to the relevant survey upon visiting this page")),o&&l&&t.createElement("li",null,t.createElement("span",null,"You have read-only access to the following surveys:"))),o&&l&&t.createElement(d,null)))))};var NT,MT=function(){var e="/"!==Qe().pathname;return t.createElement(t.Fragment,null,t.createElement(pn,null,t.createElement(In,null),e?t.createElement(at,null):t.createElement(ur,null),t.createElement(ls,null)),t.createElement(Dn,null))},LT=(NT=[{path:"",element:t.createElement(MT,null),children:[{path:"/budget",element:t.createElement(ME,null)},{path:"/funding",element:t.createElement(yP,null)},{path:"/data/employment",element:t.createElement(TP,{key:"staffgraph"})},{path:"/data/traffic-ratio",element:t.createElement(SS,null)},{path:"/data/roles",element:t.createElement(TP,{roles:!0,key:"staffgraphroles"})},{path:"/employee-count",element:t.createElement(VP,null)},{path:"/charging",element:t.createElement(wP,null)},{path:"/suborganisations",element:t.createElement(kP,null)},{path:"/parentorganisation",element:t.createElement(AP,null)},{path:"/ec-projects",element:t.createElement(DP,null)},{path:"/policy",element:t.createElement(NP,null)},{path:"/traffic-volume",element:t.createElement(ES,null)},{path:"/data",element:t.createElement(Dr,null)},{path:"/institutions-urls",element:t.createElement(JP,null)},{path:"/connected-proportion",element:t.createElement(ZP,{page:hn.ConnectedProportion,key:hn.ConnectedProportion})},{path:"/connectivity-level",element:t.createElement(ZP,{page:hn.ConnectivityLevel,key:hn.ConnectivityLevel})},{path:"/connectivity-growth",element:t.createElement(ZP,{page:hn.ConnectivityGrowth,key:hn.ConnectivityGrowth})},{path:"/connection-carrier",element:t.createElement(ZP,{page:hn.ConnectionCarrier,key:hn.ConnectionCarrier})},{path:"/connectivity-load",element:t.createElement(ZP,{page:hn.ConnectivityLoad,key:hn.ConnectivityLoad})},{path:"/commercial-charging-level",element:t.createElement(ZP,{page:hn.CommercialChargingLevel,key:hn.CommercialChargingLevel})},{path:"/commercial-connectivity",element:t.createElement(ZP,{page:hn.CommercialConnectivity,key:hn.CommercialConnectivity})},{path:"/network-services",element:t.createElement(VS,{category:dn.network_services,key:dn.network_services})},{path:"/isp-support-services",element:t.createElement(VS,{category:dn.isp_support,key:dn.isp_support})},{path:"/security-services",element:t.createElement(VS,{category:dn.security,key:dn.security})},{path:"/identity-services",element:t.createElement(VS,{category:dn.identity,key:dn.identity})},{path:"/collaboration-services",element:t.createElement(VS,{category:dn.collaboration,key:dn.collaboration})},{path:"/multimedia-services",element:t.createElement(VS,{category:dn.multimedia,key:dn.multimedia})},{path:"/storage-and-hosting-services",element:t.createElement(VS,{category:dn.storage_and_hosting,key:dn.storage_and_hosting})},{path:"/professional-services",element:t.createElement(VS,{category:dn.professional_services,key:dn.professional_services})},{path:"/fibre-light",element:t.createElement(eS,null)},{path:"/monitoring-tools",element:t.createElement(tS,null)},{path:"/pert-team",element:t.createElement(nS,null)},{path:"/passive-monitoring",element:t.createElement(rS,null)},{path:"/alien-wave",element:t.createElement(oS,null)},{path:"/alien-wave-internal",element:t.createElement(iS,null)},{path:"/ops-automation",element:t.createElement(sS,null)},{path:"/network-automation",element:t.createElement(aS,null)},{path:"/traffic-stats",element:t.createElement(lS,null)},{path:"/weather-map",element:t.createElement(uS,null)},{path:"/network-map",element:t.createElement(cS,null)},{path:"/nfv",element:t.createElement(pS,null)},{path:"/certificate-provider",element:t.createElement(dS,null)},{path:"/siem-vendors",element:t.createElement(hS,null)},{path:"/capacity-largest-link",element:t.createElement(mS,null)},{path:"/capacity-core-ip",element:t.createElement(yS,null)},{path:"/non-rne-peers",element:t.createElement(bS,null)},{path:"/iru-duration",element:t.createElement(wS,null)},{path:"/audits",element:t.createElement(MP,null)},{path:"/business-continuity",element:t.createElement(LP,null)},{path:"/crisis-management",element:t.createElement(FP,null)},{path:"/crisis-exercise",element:t.createElement(jP,null)},{path:"/security-control",element:t.createElement(BP,null)},{path:"/services-offered",element:t.createElement(zP,null)},{path:"/service-management-framework",element:t.createElement(UP,null)},{path:"/service-level-targets",element:t.createElement(WP,null)},{path:"/corporate-strategy",element:t.createElement(QP,null)},{path:"survey/admin/surveys",element:t.createElement(dT,null)},{path:"survey/admin/users",element:t.createElement(bT,null)},{path:"survey/admin/inspect/:year",element:t.createElement(AT,{loadFrom:"/api/response/inspect/"})},{path:"survey/admin/try/:year",element:t.createElement(AT,{loadFrom:"/api/response/try/"})},{path:"survey/response/:year/:nren",element:t.createElement(AT,{loadFrom:"/api/response/load/"})},{path:"survey/*",element:t.createElement(DT,null)},{path:"*",element:t.createElement(ur,null)}]}],function(t){const n=t.window?t.window:"undefined"!=typeof window?window:void 0,r=void 0!==n&&void 0!==n.document&&void 0!==n.document.createElement,o=!r;let s;if(a(t.routes.length>0,"You must provide a non-empty routes array to createRouter"),t.mapRouteProperties)s=t.mapRouteProperties;else if(t.detectErrorBoundary){let e=t.detectErrorBoundary;s=t=>({hasErrorBoundary:e(t)})}else s=Z;let u,p,d,f={},v=m(t.routes,s,void 0,f),b=t.basename||"/",C=t.unstable_dataStrategy||ue,w=t.unstable_patchRoutesOnMiss,x=i({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,unstable_skipActionErrorRevalidation:!1},t.future),E=null,P=new Set,S=null,O=null,T=null,_=null!=t.hydrationData,V=g(v,t.history.location,b),R=null;if(null==V&&!w){let e=Ce(404,{pathname:t.history.location.pathname}),{matches:n,route:r}=be(v);V=n,R={[r.id]:e}}if(V&&w&&ct(V,v,t.history.location.pathname).active&&(V=null),V)if(V.some((e=>e.route.lazy)))p=!1;else if(V.some((e=>e.route.loader)))if(x.v7_partialHydration){let e=t.hydrationData?t.hydrationData.loaderData:null,n=t.hydrationData?t.hydrationData.errors:null,r=t=>!t.route.loader||("function"!=typeof t.route.loader||!0!==t.route.loader.hydrate)&&(e&&void 0!==e[t.route.id]||n&&void 0!==n[t.route.id]);if(n){let e=V.findIndex((e=>void 0!==n[e.route.id]));p=V.slice(0,e+1).every(r)}else p=V.every(r)}else p=null!=t.hydrationData;else p=!0;else p=!1,V=[];let k,A={historyAction:t.history.action,location:t.history.location,matches:V,initialized:p,navigation:J,restoreScrollPosition:null==t.hydrationData&&null,preventScrollReset:!1,revalidation:"idle",loaderData:t.hydrationData&&t.hydrationData.loaderData||{},actionData:t.hydrationData&&t.hydrationData.actionData||null,errors:t.hydrationData&&t.hydrationData.errors||R,fetchers:new Map,blockers:new Map},D=e.Pop,N=!1,M=!1,L=new Map,j=null,F=!1,H=!1,z=[],Q=[],U=new Map,$=0,oe=-1,ie=new Map,he=new Set,fe=new Map,xe=new Map,Re=new Set,Me=new Map,Le=new Map,je=new Map,Fe=!1;function Be(e,t){void 0===t&&(t={}),A=i({},A,e);let n=[],r=[];x.v7_fetcherPersist&&A.fetchers.forEach(((e,t)=>{"idle"===e.state&&(Re.has(t)?r.push(t):n.push(t))})),[...P].forEach((e=>e(A,{deletedFetchers:r,unstable_viewTransitionOpts:t.viewTransitionOpts,unstable_flushSync:!0===t.flushSync}))),x.v7_fetcherPersist&&(n.forEach((e=>A.fetchers.delete(e))),r.forEach((e=>Ke(e))))}function qe(n,r,o){var s,a;let l,{flushSync:c}=void 0===o?{}:o,p=null!=A.actionData&&null!=A.navigation.formMethod&&Te(A.navigation.formMethod)&&"loading"===A.navigation.state&&!0!==(null==(s=n.state)?void 0:s._isRedirect);l=r.actionData?Object.keys(r.actionData).length>0?r.actionData:null:p?A.actionData:null;let d=r.loaderData?ge(A.loaderData,r.loaderData,r.matches||[],r.errors):A.loaderData,h=A.blockers;h.size>0&&(h=new Map(h),h.forEach(((e,t)=>h.set(t,K))));let f,m=!0===N||null!=A.navigation.formMethod&&Te(A.navigation.formMethod)&&!0!==(null==(a=n.state)?void 0:a._isRedirect);if(u&&(v=u,u=void 0),F||D===e.Pop||(D===e.Push?t.history.push(n,n.state):D===e.Replace&&t.history.replace(n,n.state)),D===e.Pop){let e=L.get(A.location.pathname);e&&e.has(n.pathname)?f={currentLocation:A.location,nextLocation:n}:L.has(n.pathname)&&(f={currentLocation:n,nextLocation:A.location})}else if(M){let e=L.get(A.location.pathname);e?e.add(n.pathname):(e=new Set([n.pathname]),L.set(A.location.pathname,e)),f={currentLocation:A.location,nextLocation:n}}Be(i({},r,{actionData:l,loaderData:d,historyAction:D,location:n,initialized:!0,navigation:J,revalidation:"idle",restoreScrollPosition:ut(n,r.matches||A.matches),preventScrollReset:m,blockers:h}),{viewTransitionOpts:f,flushSync:!0===c}),D=e.Pop,N=!1,M=!1,F=!1,H=!1,z=[],Q=[]}async function He(n,r,o){k&&k.abort(),k=null,D=n,F=!0===(o&&o.startUninterruptedRevalidation),function(e,t){if(S&&T){let n=lt(e,t);S[n]=T()}}(A.location,A.matches),N=!0===(o&&o.preventScrollReset),M=!0===(o&&o.enableViewTransition);let s=u||v,a=o&&o.overrideNavigation,l=g(s,r,b),c=!0===(o&&o.flushSync),p=ct(l,s,r.pathname);if(p.active&&p.matches&&(l=p.matches),!l){let{error:e,notFoundMatches:t,route:n}=it(r.pathname);return void qe(r,{matches:t,loaderData:{},errors:{[n.id]:e}},{flushSync:c})}if(A.initialized&&!H&&function(e,t){return e.pathname===t.pathname&&e.search===t.search&&(""===e.hash?""!==t.hash:e.hash===t.hash||""!==t.hash)}(A.location,r)&&!(o&&o.submission&&Te(o.submission.formMethod)))return void qe(r,{matches:l},{flushSync:c});k=new AbortController;let d,f=de(t.history,r,k.signal,o&&o.submission);if(o&&o.pendingError)d=[ve(l).route.id,{type:h.error,error:o.pendingError}];else if(o&&o.submission&&Te(o.submission.formMethod)){let n=await async function(t,n,r,o,i,s){void 0===s&&(s={}),$e();let a,l=function(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}}(n,r);if(Be({navigation:l},{flushSync:!0===s.flushSync}),i){let e=await pt(o,n.pathname,t.signal);if("aborted"===e.type)return{shortCircuited:!0};if("error"===e.type){let{error:t,notFoundMatches:r,route:o}=st(n.pathname,e);return{matches:r,pendingActionResult:[o.id,{type:h.error,error:t}]}}if(!e.matches){let{notFoundMatches:e,error:t,route:r}=it(n.pathname);return{matches:e,pendingActionResult:[r.id,{type:h.error,error:t}]}}o=e.matches}let u=Ie(o,n);if(u.route.action||u.route.lazy){if(a=(await Ue("action",t,[u],o))[0],t.signal.aborted)return{shortCircuited:!0}}else a={type:h.error,error:Ce(405,{method:t.method,pathname:n.pathname,routeId:u.route.id})};if(Se(a)){let e;return e=s&&null!=s.replace?s.replace:pe(a.response.headers.get("Location"),new URL(t.url),b)===A.location.pathname+A.location.search,await Qe(t,a,{submission:r,replace:e}),{shortCircuited:!0}}if(Ee(a))throw Ce(400,{type:"defer-action"});if(Pe(a)){let t=ve(o,u.route.id);return!0!==(s&&s.replace)&&(D=e.Push),{matches:o,pendingActionResult:[t.route.id,a]}}return{matches:o,pendingActionResult:[u.route.id,a]}}(f,r,o.submission,l,p.active,{replace:o.replace,flushSync:c});if(n.shortCircuited)return;if(n.pendingActionResult){let[e,t]=n.pendingActionResult;if(Pe(t)&&q(t.error)&&404===t.error.status)return k=null,void qe(r,{matches:n.matches,loaderData:{},errors:{[e]:t.error}})}l=n.matches||l,d=n.pendingActionResult,a=Ae(r,o.submission),c=!1,p.active=!1,f=de(t.history,f.url,f.signal)}let{shortCircuited:m,matches:y,loaderData:C,errors:w}=await async function(e,n,r,o,s,a,l,c,p,d,h){let f=s||Ae(n,a),m=a||l||ke(f),g=!(F||x.v7_partialHydration&&p);if(o){if(g){let e=ze(h);Be(i({navigation:f},void 0!==e?{actionData:e}:{}),{flushSync:d})}let t=await pt(r,n.pathname,e.signal);if("aborted"===t.type)return{shortCircuited:!0};if("error"===t.type){let{error:e,notFoundMatches:r,route:o}=st(n.pathname,t);return{matches:r,loaderData:{},errors:{[o.id]:e}}}if(!t.matches){let{error:e,notFoundMatches:t,route:r}=it(n.pathname);return{matches:t,loaderData:{},errors:{[r.id]:e}}}r=t.matches}let y=u||v,[C,w]=re(t.history,A,r,m,n,x.v7_partialHydration&&!0===p,x.unstable_skipActionErrorRevalidation,H,z,Q,Re,fe,he,y,b,h);if(at((e=>!(r&&r.some((t=>t.route.id===e)))||C&&C.some((t=>t.route.id===e)))),oe=++$,0===C.length&&0===w.length){let e=et();return qe(n,i({matches:r,loaderData:{},errors:h&&Pe(h[1])?{[h[0]]:h[1].error}:null},ye(h),e?{fetchers:new Map(A.fetchers)}:{}),{flushSync:d}),{shortCircuited:!0}}if(g){let e={};if(!o){e.navigation=f;let t=ze(h);void 0!==t&&(e.actionData=t)}w.length>0&&(e.fetchers=function(e){return e.forEach((e=>{let t=A.fetchers.get(e.key),n=De(void 0,t?t.data:void 0);A.fetchers.set(e.key,n)})),new Map(A.fetchers)}(w)),Be(e,{flushSync:d})}w.forEach((e=>{U.has(e.key)&&Xe(e.key),e.controller&&U.set(e.key,e.controller)}));let E=()=>w.forEach((e=>Xe(e.key)));k&&k.signal.addEventListener("abort",E);let{loaderResults:P,fetcherResults:S}=await We(A.matches,r,C,w,e);if(e.signal.aborted)return{shortCircuited:!0};k&&k.signal.removeEventListener("abort",E),w.forEach((e=>U.delete(e.key)));let O=we([...P,...S]);if(O){if(O.idx>=C.length){let e=w[O.idx-C.length].key;he.add(e)}return await Qe(e,O.result,{replace:c}),{shortCircuited:!0}}let{loaderData:T,errors:_}=me(A,r,C,P,h,w,S,Me);Me.forEach(((e,t)=>{e.subscribe((n=>{(n||e.done)&&Me.delete(t)}))})),x.v7_partialHydration&&p&&A.errors&&Object.entries(A.errors).filter((e=>{let[t]=e;return!C.some((e=>e.route.id===t))})).forEach((e=>{let[t,n]=e;_=Object.assign(_||{},{[t]:n})}));let V=et(),R=tt(oe),I=V||R||w.length>0;return i({matches:r,loaderData:T,errors:_},I?{fetchers:new Map(A.fetchers)}:{})}(f,r,l,p.active,a,o&&o.submission,o&&o.fetcherSubmission,o&&o.replace,o&&!0===o.initialHydration,c,d);m||(k=null,qe(r,i({matches:y||l},ye(d),{loaderData:C,errors:w})))}function ze(e){return e&&!Pe(e[1])?{[e[0]]:e[1].data}:A.actionData?0===Object.keys(A.actionData).length?null:A.actionData:void 0}async function Qe(o,s,l){let{submission:u,fetcherSubmission:p,replace:d}=void 0===l?{}:l;s.response.headers.has("X-Remix-Revalidate")&&(H=!0);let h=s.response.headers.get("Location");a(h,"Expected a Location header on the redirect Response"),h=pe(h,new URL(o.url),b);let f=c(A.location,h,{_isRedirect:!0});if(r){let e=!1;if(s.response.headers.has("X-Remix-Reload-Document"))e=!0;else if(X.test(h)){const r=t.history.createURL(h);e=r.origin!==n.location.origin||null==I(r.pathname,b)}if(e)return void(d?n.location.replace(h):n.location.assign(h))}k=null;let m=!0===d?e.Replace:e.Push,{formMethod:g,formAction:y,formEncType:v}=A.navigation;!u&&!p&&g&&y&&v&&(u=ke(A.navigation));let C=u||p;if(G.has(s.response.status)&&C&&Te(C.formMethod))await He(m,f,{submission:i({},C,{formAction:h}),preventScrollReset:N});else{let e=Ae(f,u);await He(m,f,{overrideNavigation:e,fetcherSubmission:p,preventScrollReset:N})}}async function Ue(e,t,n,r){try{let o=await async function(e,t,n,r,o,s,l,u){let c=r.reduce(((e,t)=>e.add(t.route.id)),new Set),p=new Set,d=await e({matches:o.map((e=>{let r=c.has(e.route.id);return i({},e,{shouldLoad:r,resolve:o=>(p.add(e.route.id),r?async function(e,t,n,r,o,i,s){let l,u,c=r=>{let o,a=new Promise(((e,t)=>o=t));u=()=>o(),t.signal.addEventListener("abort",u);let l,c=o=>"function"!=typeof r?Promise.reject(new Error('You cannot call the handler for a route which defines a boolean "'+e+'" [routeId: '+n.route.id+"]")):r({request:t,params:n.params,context:s},...void 0!==o?[o]:[]);return l=i?i((e=>c(e))):(async()=>{try{return{type:"data",result:await c()}}catch(e){return{type:"error",result:e}}})(),Promise.race([l,a])};try{let i=n.route[e];if(n.route.lazy)if(i){let e,[t]=await Promise.all([c(i).catch((t=>{e=t})),le(n.route,o,r)]);if(void 0!==e)throw e;l=t}else{if(await le(n.route,o,r),i=n.route[e],!i){if("action"===e){let e=new URL(t.url),r=e.pathname+e.search;throw Ce(405,{method:t.method,pathname:r,routeId:n.route.id})}return{type:h.data,result:void 0}}l=await c(i)}else{if(!i){let e=new URL(t.url);throw Ce(404,{pathname:e.pathname+e.search})}l=await c(i)}a(void 0!==l.result,"You defined "+("action"===e?"an action":"a loader")+' for route "'+n.route.id+"\" but didn't return anything from your `"+e+"` function. Please return a value or `null`.")}catch(e){return{type:h.error,result:e}}finally{u&&t.signal.removeEventListener("abort",u)}return l}(t,n,e,s,l,o,u):Promise.resolve({type:h.data,result:void 0}))})})),request:n,params:o[0].params,context:u});return o.forEach((e=>a(p.has(e.route.id),'`match.resolve()` was not called for route id "'+e.route.id+'". You must call `match.resolve()` on every match passed to `dataStrategy` to ensure all routes are properly loaded.'))),d.filter(((e,t)=>c.has(o[t].route.id)))}(C,e,t,n,r,f,s);return await Promise.all(o.map(((e,o)=>{if(function(e){return Oe(e.result)&&W.has(e.result.status)}(e)){let i=e.result;return{type:h.redirect,response:ce(i,t,n[o].route.id,r,b,x.v7_relativeSplatPath)}}return async function(e){let{result:t,type:n,status:r}=e;if(Oe(t)){let e;try{let n=t.headers.get("Content-Type");e=n&&/\bapplication\/json\b/.test(n)?null==t.body?null:await t.json():await t.text()}catch(e){return{type:h.error,error:e}}return n===h.error?{type:h.error,error:new B(t.status,t.statusText,e),statusCode:t.status,headers:t.headers}:{type:h.data,data:e,statusCode:t.status,headers:t.headers}}return n===h.error?{type:h.error,error:t,statusCode:q(t)?t.status:r}:function(e){let t=e;return t&&"object"==typeof t&&"object"==typeof t.data&&"function"==typeof t.subscribe&&"function"==typeof t.cancel&&"function"==typeof t.resolveData}(t)?{type:h.deferred,deferredData:t,statusCode:null==(o=t.init)?void 0:o.status,headers:(null==(i=t.init)?void 0:i.headers)&&new Headers(t.init.headers)}:{type:h.data,data:t,statusCode:r};var o,i}(e)})))}catch(e){return n.map((()=>({type:h.error,error:e})))}}async function We(e,n,r,o,i){let[s,...a]=await Promise.all([r.length?Ue("loader",i,r,n):[],...o.map((e=>e.matches&&e.match&&e.controller?Ue("loader",de(t.history,e.path,e.controller.signal),[e.match],e.matches).then((e=>e[0])):Promise.resolve({type:h.error,error:Ce(404,{pathname:e.path})})))]);return await Promise.all([_e(e,r,s,s.map((()=>i.signal)),!1,A.loaderData),_e(e,o.map((e=>e.match)),a,o.map((e=>e.controller?e.controller.signal:null)),!0)]),{loaderResults:s,fetcherResults:a}}function $e(){H=!0,z.push(...at()),fe.forEach(((e,t)=>{U.has(t)&&(Q.push(t),Xe(t))}))}function Ge(e,t,n){void 0===n&&(n={}),A.fetchers.set(e,t),Be({fetchers:new Map(A.fetchers)},{flushSync:!0===(n&&n.flushSync)})}function Je(e,t,n,r){void 0===r&&(r={});let o=ve(A.matches,t);Ke(e),Be({errors:{[o.route.id]:n},fetchers:new Map(A.fetchers)},{flushSync:!0===(r&&r.flushSync)})}function Ye(e){return x.v7_fetcherPersist&&(xe.set(e,(xe.get(e)||0)+1),Re.has(e)&&Re.delete(e)),A.fetchers.get(e)||Y}function Ke(e){let t=A.fetchers.get(e);!U.has(e)||t&&"loading"===t.state&&ie.has(e)||Xe(e),fe.delete(e),ie.delete(e),he.delete(e),Re.delete(e),A.fetchers.delete(e)}function Xe(e){let t=U.get(e);a(t,"Expected fetch controller: "+e),t.abort(),U.delete(e)}function Ze(e){for(let t of e){let e=Ne(Ye(t).data);A.fetchers.set(t,e)}}function et(){let e=[],t=!1;for(let n of he){let r=A.fetchers.get(n);a(r,"Expected fetcher: "+n),"loading"===r.state&&(he.delete(n),e.push(n),t=!0)}return Ze(e),t}function tt(e){let t=[];for(let[n,r]of ie)if(r<e){let e=A.fetchers.get(n);a(e,"Expected fetcher: "+n),"loading"===e.state&&(Xe(n),ie.delete(n),t.push(n))}return Ze(t),t.length>0}function nt(e){A.blockers.delete(e),Le.delete(e)}function rt(e,t){let n=A.blockers.get(e)||K;a("unblocked"===n.state&&"blocked"===t.state||"blocked"===n.state&&"blocked"===t.state||"blocked"===n.state&&"proceeding"===t.state||"blocked"===n.state&&"unblocked"===t.state||"proceeding"===n.state&&"unblocked"===t.state,"Invalid blocker state transition: "+n.state+" -> "+t.state);let r=new Map(A.blockers);r.set(e,t),Be({blockers:r})}function ot(e){let{currentLocation:t,nextLocation:n,historyAction:r}=e;if(0===Le.size)return;Le.size>1&&l(!1,"A router only supports one blocker at a time");let o=Array.from(Le.entries()),[i,s]=o[o.length-1],a=A.blockers.get(i);return a&&"proceeding"===a.state?void 0:s({currentLocation:t,nextLocation:n,historyAction:r})?i:void 0}function it(e){let t=Ce(404,{pathname:e}),n=u||v,{matches:r,route:o}=be(n);return at(),{notFoundMatches:r,route:o,error:t}}function st(e,t){let n=t.partialMatches,r=n[n.length-1].route;return{notFoundMatches:n,route:r,error:Ce(400,{type:"route-discovery",routeId:r.id,pathname:e,message:null!=t.error&&"message"in t.error?t.error:String(t.error)})}}function at(e){let t=[];return Me.forEach(((n,r)=>{e&&!e(r)||(n.cancel(),t.push(r),Me.delete(r))})),t}function lt(e,t){if(O){return O(e,t.map((e=>function(e,t){let{route:n,pathname:r,params:o}=e;return{id:n.id,pathname:r,params:o,data:t[n.id],handle:n.handle}}(e,A.loaderData))))||e.key}return e.key}function ut(e,t){if(S){let n=lt(e,t),r=S[n];if("number"==typeof r)return r}return null}function ct(e,t,n){if(w){if(!e)return{active:!0,matches:y(t,n,b,!0)||[]};{let r=e[e.length-1].route;if(r.path&&("*"===r.path||r.path.endsWith("/*")))return{active:!0,matches:y(t,n,b,!0)}}}return{active:!1,matches:null}}async function pt(e,t,n){let r=e,o=r.length>0?r[r.length-1].route:null;for(;;){let e=null==u,i=u||v;try{await se(w,t,r,i,f,s,je,n)}catch(e){return{type:"error",error:e,partialMatches:r}}finally{e&&(v=[...v])}if(n.aborted)return{type:"aborted"};let a=g(i,t,b),l=!1;if(a){let e=a[a.length-1].route;if(e.index)return{type:"success",matches:a};if(e.path&&e.path.length>0){if("*"!==e.path)return{type:"success",matches:a};l=!0}}let c=y(i,t,b,!0);if(!c||r.map((e=>e.route.id)).join("-")===c.map((e=>e.route.id)).join("-"))return{type:"success",matches:l?a:null};if(r=c,o=r[r.length-1].route,"*"===o.path)return{type:"success",matches:r}}}return d={get basename(){return b},get future(){return x},get state(){return A},get routes(){return v},get window(){return n},initialize:function(){if(E=t.history.listen((e=>{let{action:n,location:r,delta:o}=e;if(Fe)return void(Fe=!1);l(0===Le.size||null!=o,"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 i=ot({currentLocation:A.location,nextLocation:r,historyAction:n});return i&&null!=o?(Fe=!0,t.history.go(-1*o),void rt(i,{state:"blocked",location:r,proceed(){rt(i,{state:"proceeding",proceed:void 0,reset:void 0,location:r}),t.history.go(o)},reset(){let e=new Map(A.blockers);e.set(i,K),Be({blockers:e})}})):He(n,r)})),r){!function(e,t){try{let n=e.sessionStorage.getItem(ee);if(n){let e=JSON.parse(n);for(let[n,r]of Object.entries(e||{}))r&&Array.isArray(r)&&t.set(n,new Set(r||[]))}}catch(e){}}(n,L);let e=()=>function(e,t){if(t.size>0){let n={};for(let[e,r]of t)n[e]=[...r];try{e.sessionStorage.setItem(ee,JSON.stringify(n))}catch(e){l(!1,"Failed to save applied view transitions in sessionStorage ("+e+").")}}}(n,L);n.addEventListener("pagehide",e),j=()=>n.removeEventListener("pagehide",e)}return A.initialized||He(e.Pop,A.location,{initialHydration:!0}),d},subscribe:function(e){return P.add(e),()=>P.delete(e)},enableScrollRestoration:function(e,t,n){if(S=e,T=t,O=n||null,!_&&A.navigation===J){_=!0;let e=ut(A.location,A.matches);null!=e&&Be({restoreScrollPosition:e})}return()=>{S=null,T=null,O=null}},navigate:async function n(r,o){if("number"==typeof r)return void t.history.go(r);let s=te(A.location,A.matches,b,x.v7_prependBasename,r,x.v7_relativeSplatPath,null==o?void 0:o.fromRouteId,null==o?void 0:o.relative),{path:a,submission:l,error:u}=ne(x.v7_normalizeFormMethod,!1,s,o),p=A.location,d=c(A.location,a,o&&o.state);d=i({},d,t.history.encodeLocation(d));let h=o&&null!=o.replace?o.replace:void 0,f=e.Push;!0===h?f=e.Replace:!1===h||null!=l&&Te(l.formMethod)&&l.formAction===A.location.pathname+A.location.search&&(f=e.Replace);let m=o&&"preventScrollReset"in o?!0===o.preventScrollReset:void 0,g=!0===(o&&o.unstable_flushSync),y=ot({currentLocation:p,nextLocation:d,historyAction:f});if(!y)return await He(f,d,{submission:l,pendingError:u,preventScrollReset:m,replace:o&&o.replace,enableViewTransition:o&&o.unstable_viewTransition,flushSync:g});rt(y,{state:"blocked",location:d,proceed(){rt(y,{state:"proceeding",proceed:void 0,reset:void 0,location:d}),n(r,o)},reset(){let e=new Map(A.blockers);e.set(y,K),Be({blockers:e})}})},fetch:function(e,n,r,i){if(o)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");U.has(e)&&Xe(e);let s=!0===(i&&i.unstable_flushSync),l=u||v,c=te(A.location,A.matches,b,x.v7_prependBasename,r,x.v7_relativeSplatPath,n,null==i?void 0:i.relative),p=g(l,c,b),d=ct(p,l,c);if(d.active&&d.matches&&(p=d.matches),!p)return void Je(e,n,Ce(404,{pathname:c}),{flushSync:s});let{path:h,submission:f,error:m}=ne(x.v7_normalizeFormMethod,!0,c,i);if(m)return void Je(e,n,m,{flushSync:s});let y=Ie(p,h);N=!0===(i&&i.preventScrollReset),f&&Te(f.formMethod)?async function(e,n,r,o,i,s,l,c){function p(t){if(!t.route.action&&!t.route.lazy){let t=Ce(405,{method:c.formMethod,pathname:r,routeId:n});return Je(e,n,t,{flushSync:l}),!0}return!1}if($e(),fe.delete(e),!s&&p(o))return;let d=A.fetchers.get(e);Ge(e,function(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}}(c,d),{flushSync:l});let h=new AbortController,f=de(t.history,r,h.signal,c);if(s){let t=await pt(i,r,f.signal);if("aborted"===t.type)return;if("error"===t.type){let{error:o}=st(r,t);return void Je(e,n,o,{flushSync:l})}if(!t.matches)return void Je(e,n,Ce(404,{pathname:r}),{flushSync:l});if(p(o=Ie(i=t.matches,r)))return}U.set(e,h);let m=$,y=(await Ue("action",f,[o],i))[0];if(f.signal.aborted)return void(U.get(e)===h&&U.delete(e));if(x.v7_fetcherPersist&&Re.has(e)){if(Se(y)||Pe(y))return void Ge(e,Ne(void 0))}else{if(Se(y))return U.delete(e),oe>m?void Ge(e,Ne(void 0)):(he.add(e),Ge(e,De(c)),Qe(f,y,{fetcherSubmission:c}));if(Pe(y))return void Je(e,n,y.error)}if(Ee(y))throw Ce(400,{type:"defer-action"});let C=A.navigation.location||A.location,w=de(t.history,C,h.signal),E=u||v,P="idle"!==A.navigation.state?g(E,A.navigation.location,b):A.matches;a(P,"Didn't find any matches after fetcher action");let S=++$;ie.set(e,S);let O=De(c,y.data);A.fetchers.set(e,O);let[T,_]=re(t.history,A,P,c,C,!1,x.unstable_skipActionErrorRevalidation,H,z,Q,Re,fe,he,E,b,[o.route.id,y]);_.filter((t=>t.key!==e)).forEach((e=>{let t=e.key,n=A.fetchers.get(t),r=De(void 0,n?n.data:void 0);A.fetchers.set(t,r),U.has(t)&&Xe(t),e.controller&&U.set(t,e.controller)})),Be({fetchers:new Map(A.fetchers)});let V=()=>_.forEach((e=>Xe(e.key)));h.signal.addEventListener("abort",V);let{loaderResults:R,fetcherResults:I}=await We(A.matches,P,T,_,w);if(h.signal.aborted)return;h.signal.removeEventListener("abort",V),ie.delete(e),U.delete(e),_.forEach((e=>U.delete(e.key)));let N=we([...R,...I]);if(N){if(N.idx>=T.length){let e=_[N.idx-T.length].key;he.add(e)}return Qe(w,N.result)}let{loaderData:M,errors:L}=me(A,A.matches,T,R,void 0,_,I,Me);if(A.fetchers.has(e)){let t=Ne(y.data);A.fetchers.set(e,t)}tt(S),"loading"===A.navigation.state&&S>oe?(a(D,"Expected pending action"),k&&k.abort(),qe(A.navigation.location,{matches:P,loaderData:M,errors:L,fetchers:new Map(A.fetchers)})):(Be({errors:L,loaderData:ge(A.loaderData,M,P,L),fetchers:new Map(A.fetchers)}),H=!1)}(e,n,h,y,p,d.active,s,f):(fe.set(e,{routeId:n,path:h}),async function(e,n,r,o,i,s,l,u){let c=A.fetchers.get(e);Ge(e,De(u,c?c.data:void 0),{flushSync:l});let p=new AbortController,d=de(t.history,r,p.signal);if(s){let t=await pt(i,r,d.signal);if("aborted"===t.type)return;if("error"===t.type){let{error:o}=st(r,t);return void Je(e,n,o,{flushSync:l})}if(!t.matches)return void Je(e,n,Ce(404,{pathname:r}),{flushSync:l});o=Ie(i=t.matches,r)}U.set(e,p);let h=$,f=(await Ue("loader",d,[o],i))[0];if(Ee(f)&&(f=await Ve(f,d.signal,!0)||f),U.get(e)===p&&U.delete(e),!d.signal.aborted){if(!Re.has(e))return Se(f)?oe>h?void Ge(e,Ne(void 0)):(he.add(e),void await Qe(d,f)):void(Pe(f)?Je(e,n,f.error):(a(!Ee(f),"Unhandled fetcher deferred data"),Ge(e,Ne(f.data))));Ge(e,Ne(void 0))}}(e,n,h,y,p,d.active,s,f))},revalidate:function(){$e(),Be({revalidation:"loading"}),"submitting"!==A.navigation.state&&("idle"!==A.navigation.state?He(D||A.historyAction,A.navigation.location,{overrideNavigation:A.navigation}):He(A.historyAction,A.location,{startUninterruptedRevalidation:!0}))},createHref:e=>t.history.createHref(e),encodeLocation:e=>t.history.encodeLocation(e),getFetcher:Ye,deleteFetcher:function(e){if(x.v7_fetcherPersist){let t=(xe.get(e)||0)-1;t<=0?(xe.delete(e),Re.add(e)):xe.set(e,t)}else Ke(e);Be({fetchers:new Map(A.fetchers)})},dispose:function(){E&&E(),j&&j(),P.clear(),k&&k.abort(),A.fetchers.forEach(((e,t)=>Ke(t))),A.blockers.forEach(((e,t)=>nt(t)))},getBlocker:function(e,t){let n=A.blockers.get(e)||K;return Le.get(e)!==t&&Le.set(e,t),n},deleteBlocker:nt,patchRoutes:function(e,t){let n=null==u;ae(e,t,u||v,f,s),n&&(v=[...v],Be({}))},_internalFetchControllers:U,_internalActiveDeferreds:Me,_internalSetRoutes:function(e){f={},u=m(e,s,void 0,f)}},d}({basename:void 0,future:pt({},void 0,{v7_prependBasename:!0}),history:function(t){return void 0===t&&(t={}),function(t,n,r,o){void 0===o&&(o={});let{window:l=document.defaultView,v5Compat:d=!1}=o,h=l.history,f=e.Pop,m=null,g=y();function y(){return(h.state||{idx:null}).idx}function v(){f=e.Pop;let t=y(),n=null==t?null:t-g;g=t,m&&m({action:f,location:C.location,delta:n})}function b(e){let t="null"!==l.location.origin?l.location.origin:l.location.href,n="string"==typeof e?e:p(e);return n=n.replace(/ $/,"%20"),a(t,"No window.location.(origin|href) available to create URL for href: "+n),new URL(n,t)}null==g&&(g=0,h.replaceState(i({},h.state,{idx:g}),""));let C={get action(){return f},get location(){return t(l,h)},listen(e){if(m)throw new Error("A history only accepts one active listener");return l.addEventListener(s,v),m=e,()=>{l.removeEventListener(s,v),m=null}},createHref:e=>n(l,e),createURL:b,encodeLocation(e){let t=b(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(t,n){f=e.Push;let o=c(C.location,t,n);r&&r(o,t),g=y()+1;let i=u(o,g),s=C.createHref(o);try{h.pushState(i,"",s)}catch(e){if(e instanceof DOMException&&"DataCloneError"===e.name)throw e;l.location.assign(s)}d&&m&&m({action:f,location:C.location,delta:1})},replace:function(t,n){f=e.Replace;let o=c(C.location,t,n);r&&r(o,t),g=y();let i=u(o,g),s=C.createHref(o);h.replaceState(i,"",s),d&&m&&m({action:f,location:C.location,delta:0})},go:e=>h.go(e)};return C}((function(e,t){let{pathname:n,search:r,hash:o}=e.location;return c("",{pathname:n,search:r,hash:o},t.state&&t.state.usr||null,t.state&&t.state.key||"default")}),(function(e,t){return"string"==typeof t?t:p(t)}),null,t)}({window:void 0}),hydrationData:function(){var e;let t=null==(e=window)?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=pt({},t,{errors:ft(t.errors)})),t}(),routes:NT,mapRouteProperties:function(e){let n={hasErrorBoundary:null!=e.ErrorBoundary||null!=e.errorElement};return e.Component&&Object.assign(n,{element:t.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(n,{hydrateFallbackElement:t.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(n,{errorElement:t.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),n},unstable_dataStrategy:void 0,unstable_patchRoutesOnMiss:void 0,window:void 0}).initialize());const jT=function(){return t.createElement("div",{className:"app"},t.createElement(wt,{router:LT}))};var FT=document.getElementById("root");(0,r.H)(FT).render(t.createElement(t.StrictMode,null,t.createElement(jT,null)))})()})(); \ No newline at end of file diff --git a/setup.py b/setup.py index 59d81f79af9393a27b70b85ff28f1125267beb71..d8878539368f0527ae83980fd73a7100fab1f626 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import setup, find_packages setup( name='compendium-v2', - version="0.71", + version="0.72", author='GEANT', author_email='swd@geant.org', description='Flask and React project for displaying '