From 88f9b6deaa5e9cfa4c7b9059bcca23f208bf0c2a Mon Sep 17 00:00:00 2001 From: eatyourpeas Date: Wed, 1 Jan 2025 00:35:26 +0000 Subject: [PATCH] deploy: f336512b15b4599f03cadfe05cdb9e22f4313eeb --- assets/{index-kZimW9Qu.js => index-CSu5Gq9x.js} | 6 +++--- index.html | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) rename assets/{index-kZimW9Qu.js => index-CSu5Gq9x.js} (99%) diff --git a/assets/index-kZimW9Qu.js b/assets/index-CSu5Gq9x.js similarity index 99% rename from assets/index-kZimW9Qu.js rename to assets/index-CSu5Gq9x.js index 2fa7d82..4b4371c 100644 --- a/assets/index-kZimW9Qu.js +++ b/assets/index-CSu5Gq9x.js @@ -964,7 +964,7 @@ three weeks after birth.`,L=M.useMemo(function(){return rp(h,g,i,n,J,b)},[o,g,i, `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(l){return l instanceof this?l:new this(l)}static concat(l,...y){const x=new this(l);return y.forEach(e=>x.set(e)),x}static accessor(l){const x=(this[ad]=this[ad]={accessors:{}}).accessors,e=this.prototype;function t(n){const B=Py(n);x[B]||(XlA(e,n),x[B]=!0)}return T.isArray(l)?l.forEach(t):t(l),this}}Z5.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);T.reduceDescriptors(Z5.prototype,({value:A},l)=>{let y=l[0].toUpperCase()+l.slice(1);return{get:()=>A,set(x){this[y]=x}}});T.freezeMethods(Z5);function mo(A,l){const y=this||V6,x=l||y,e=Z5.from(x.headers);let t=x.data;return T.forEach(A,function(B){t=B.call(y,t,e.normalize(),l?l.status:void 0)}),e.normalize(),t}function _p(A){return!!(A&&A.__CANCEL__)}function ty(A,l,y){vA.call(this,A??"canceled",vA.ERR_CANCELED,l,y),this.name="CanceledError"}T.inherits(ty,vA,{__CANCEL__:!0});function $p(A,l,y){const x=y.config.validateStatus;!y.status||!x||x(y.status)?A(y):l(new vA("Request failed with status code "+y.status,[vA.ERR_BAD_REQUEST,vA.ERR_BAD_RESPONSE][Math.floor(y.status/100)-4],y.config,y.request,y))}function qlA(A){const l=/^([-+\w]{1,25})(:?\/\/|:)/.exec(A);return l&&l[1]||""}function _lA(A,l){A=A||10;const y=new Array(A),x=new Array(A);let e=0,t=0,n;return l=l!==void 0?l:1e3,function(r){const i=Date.now(),o=x[t];n||(n=i),y[e]=r,x[e]=i;let a=t,g=0;for(;a!==e;)g+=y[a++],a=a%A;if(e=(e+1)%A,e===t&&(t=(t+1)%A),i-n{y=o,e=null,t&&(clearTimeout(t),t=null),A.apply(null,i)};return[(...i)=>{const o=Date.now(),a=o-y;a>=x?n(i,o):(e=i,t||(t=setTimeout(()=>{t=null,n(e)},x-a)))},()=>e&&n(e)]}const ut=(A,l,y=3)=>{let x=0;const e=_lA(50,250);return $lA(t=>{const n=t.loaded,B=t.lengthComputable?t.total:void 0,r=n-x,i=e(r),o=n<=B;x=n;const a={loaded:n,total:B,progress:B?n/B:void 0,bytes:r,rate:i||void 0,estimated:i&&B&&o?(B-n)/i:void 0,event:t,lengthComputable:B!=null,[l?"download":"upload"]:!0};A(a)},y)},gd=(A,l)=>{const y=A!=null;return[x=>l[0]({lengthComputable:y,total:A,loaded:x}),l[1]]},Qd=A=>(...l)=>T.asap(()=>A(...l)),A7A=a0.hasStandardBrowserEnv?function(){const l=a0.navigator&&/(msie|trident)/i.test(a0.navigator.userAgent),y=document.createElement("a");let x;function e(t){let n=t;return l&&(y.setAttribute("href",n),n=y.href),y.setAttribute("href",n),{href:y.href,protocol:y.protocol?y.protocol.replace(/:$/,""):"",host:y.host,search:y.search?y.search.replace(/^\?/,""):"",hash:y.hash?y.hash.replace(/^#/,""):"",hostname:y.hostname,port:y.port,pathname:y.pathname.charAt(0)==="/"?y.pathname:"/"+y.pathname}}return x=e(window.location.href),function(n){const B=T.isString(n)?e(n):n;return B.protocol===x.protocol&&B.host===x.host}}():function(){return function(){return!0}}(),l7A=a0.hasStandardBrowserEnv?{write(A,l,y,x,e,t){const n=[A+"="+encodeURIComponent(l)];T.isNumber(y)&&n.push("expires="+new Date(y).toGMTString()),T.isString(x)&&n.push("path="+x),T.isString(e)&&n.push("domain="+e),t===!0&&n.push("secure"),document.cookie=n.join("; ")},read(A){const l=document.cookie.match(new RegExp("(^|;\\s*)("+A+")=([^;]*)"));return l?decodeURIComponent(l[3]):null},remove(A){this.write(A,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function y7A(A){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(A)}function x7A(A,l){return l?A.replace(/\/?\/$/,"")+"/"+l.replace(/^\/+/,""):A}function Aj(A,l){return A&&!y7A(l)?x7A(A,l):l}const sd=A=>A instanceof Z5?{...A}:A;function nl(A,l){l=l||{};const y={};function x(i,o,a){return T.isPlainObject(i)&&T.isPlainObject(o)?T.merge.call({caseless:a},i,o):T.isPlainObject(o)?T.merge({},o):T.isArray(o)?o.slice():o}function e(i,o,a){if(T.isUndefined(o)){if(!T.isUndefined(i))return x(void 0,i,a)}else return x(i,o,a)}function t(i,o){if(!T.isUndefined(o))return x(void 0,o)}function n(i,o){if(T.isUndefined(o)){if(!T.isUndefined(i))return x(void 0,i)}else return x(void 0,o)}function B(i,o,a){if(a in l)return x(i,o);if(a in A)return x(void 0,i)}const r={url:t,method:t,data:t,baseURL:n,transformRequest:n,transformResponse:n,paramsSerializer:n,timeout:n,timeoutMessage:n,withCredentials:n,withXSRFToken:n,adapter:n,responseType:n,xsrfCookieName:n,xsrfHeaderName:n,onUploadProgress:n,onDownloadProgress:n,decompress:n,maxContentLength:n,maxBodyLength:n,beforeRedirect:n,transport:n,httpAgent:n,httpsAgent:n,cancelToken:n,socketPath:n,responseEncoding:n,validateStatus:B,headers:(i,o)=>e(sd(i),sd(o),!0)};return T.forEach(Object.keys(Object.assign({},A,l)),function(o){const a=r[o]||e,g=a(A[o],l[o],o);T.isUndefined(g)&&a!==B||(y[o]=g)}),y}const lj=A=>{const l=nl({},A);let{data:y,withXSRFToken:x,xsrfHeaderName:e,xsrfCookieName:t,headers:n,auth:B}=l;l.headers=n=Z5.from(n),l.url=Zp(Aj(l.baseURL,l.url),A.params,A.paramsSerializer),B&&n.set("Authorization","Basic "+btoa((B.username||"")+":"+(B.password?unescape(encodeURIComponent(B.password)):"")));let r;if(T.isFormData(y)){if(a0.hasStandardBrowserEnv||a0.hasStandardBrowserWebWorkerEnv)n.setContentType(void 0);else if((r=n.getContentType())!==!1){const[i,...o]=r?r.split(";").map(a=>a.trim()).filter(Boolean):[];n.setContentType([i||"multipart/form-data",...o].join("; "))}}if(a0.hasStandardBrowserEnv&&(x&&T.isFunction(x)&&(x=x(l)),x||x!==!1&&A7A(l.url))){const i=e&&t&&l7A.read(t);i&&n.set(e,i)}return l},e7A=typeof XMLHttpRequest<"u",t7A=e7A&&function(A){return new Promise(function(y,x){const e=lj(A);let t=e.data;const n=Z5.from(e.headers).normalize();let{responseType:B,onUploadProgress:r,onDownloadProgress:i}=e,o,a,g,c,Q;function s(){c&&c(),Q&&Q(),e.cancelToken&&e.cancelToken.unsubscribe(o),e.signal&&e.signal.removeEventListener("abort",o)}let u=new XMLHttpRequest;u.open(e.method.toUpperCase(),e.url,!0),u.timeout=e.timeout;function E(){if(!u)return;const C=Z5.from("getAllResponseHeaders"in u&&u.getAllResponseHeaders()),D={data:!B||B==="text"||B==="json"?u.responseText:u.response,status:u.status,statusText:u.statusText,headers:C,config:A,request:u};$p(function(f){y(f),s()},function(f){x(f),s()},D),u=null}"onloadend"in u?u.onloadend=E:u.onreadystatechange=function(){!u||u.readyState!==4||u.status===0&&!(u.responseURL&&u.responseURL.indexOf("file:")===0)||setTimeout(E)},u.onabort=function(){u&&(x(new vA("Request aborted",vA.ECONNABORTED,A,u)),u=null)},u.onerror=function(){x(new vA("Network Error",vA.ERR_NETWORK,A,u)),u=null},u.ontimeout=function(){let I=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const D=e.transitional||Xp;e.timeoutErrorMessage&&(I=e.timeoutErrorMessage),x(new vA(I,D.clarifyTimeoutError?vA.ETIMEDOUT:vA.ECONNABORTED,A,u)),u=null},t===void 0&&n.setContentType(null),"setRequestHeader"in u&&T.forEach(n.toJSON(),function(I,D){u.setRequestHeader(D,I)}),T.isUndefined(e.withCredentials)||(u.withCredentials=!!e.withCredentials),B&&B!=="json"&&(u.responseType=e.responseType),i&&([g,Q]=ut(i,!0),u.addEventListener("progress",g)),r&&u.upload&&([a,c]=ut(r),u.upload.addEventListener("progress",a),u.upload.addEventListener("loadend",c)),(e.cancelToken||e.signal)&&(o=C=>{u&&(x(!C||C.type?new ty(null,A,u):C),u.abort(),u=null)},e.cancelToken&&e.cancelToken.subscribe(o),e.signal&&(e.signal.aborted?o():e.signal.addEventListener("abort",o)));const w=qlA(e.url);if(w&&a0.protocols.indexOf(w)===-1){x(new vA("Unsupported protocol "+w+":",vA.ERR_BAD_REQUEST,A));return}u.send(t||null)})},n7A=(A,l)=>{let y=new AbortController,x;const e=function(r){if(!x){x=!0,n();const i=r instanceof Error?r:this.reason;y.abort(i instanceof vA?i:new ty(i instanceof Error?i.message:i))}};let t=l&&setTimeout(()=>{e(new vA(`timeout ${l} of ms exceeded`,vA.ETIMEDOUT))},l);const n=()=>{A&&(t&&clearTimeout(t),t=null,A.forEach(r=>{r&&(r.removeEventListener?r.removeEventListener("abort",e):r.unsubscribe(e))}),A=null)};A.forEach(r=>r&&r.addEventListener&&r.addEventListener("abort",e));const{signal:B}=y;return B.unsubscribe=n,[B,()=>{t&&clearTimeout(t),t=null}]},B7A=function*(A,l){let y=A.byteLength;if(y{const t=r7A(A,l,e);let n=0,B,r=i=>{B||(B=!0,x&&x(i))};return new ReadableStream({async pull(i){try{const{done:o,value:a}=await t.next();if(o){r(),i.close();return}let g=a.byteLength;if(y){let c=n+=g;y(c)}i.enqueue(new Uint8Array(a))}catch(o){throw r(o),o}},cancel(i){return r(i),t.return()}},{highWaterMark:2})},bn=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",yj=bn&&typeof ReadableStream=="function",oQ=bn&&(typeof TextEncoder=="function"?(A=>l=>A.encode(l))(new TextEncoder):async A=>new Uint8Array(await new Response(A).arrayBuffer())),xj=(A,...l)=>{try{return!!A(...l)}catch{return!1}},i7A=yj&&xj(()=>{let A=!1;const l=new Request(a0.origin,{body:new ReadableStream,method:"POST",get duplex(){return A=!0,"half"}}).headers.has("Content-Type");return A&&!l}),wd=64*1024,aQ=yj&&xj(()=>T.isReadableStream(new Response("").body)),Ct={stream:aQ&&(A=>A.body)};bn&&(A=>{["text","arrayBuffer","blob","formData","stream"].forEach(l=>{!Ct[l]&&(Ct[l]=T.isFunction(A[l])?y=>y[l]():(y,x)=>{throw new vA(`Response type '${l}' is not supported`,vA.ERR_NOT_SUPPORT,x)})})})(new Response);const o7A=async A=>{if(A==null)return 0;if(T.isBlob(A))return A.size;if(T.isSpecCompliantForm(A))return(await new Request(A).arrayBuffer()).byteLength;if(T.isArrayBufferView(A)||T.isArrayBuffer(A))return A.byteLength;if(T.isURLSearchParams(A)&&(A=A+""),T.isString(A))return(await oQ(A)).byteLength},a7A=async(A,l)=>{const y=T.toFiniteNumber(A.getContentLength());return y??o7A(l)},g7A=bn&&(async A=>{let{url:l,method:y,data:x,signal:e,cancelToken:t,timeout:n,onDownloadProgress:B,onUploadProgress:r,responseType:i,headers:o,withCredentials:a="same-origin",fetchOptions:g}=lj(A);i=i?(i+"").toLowerCase():"text";let[c,Q]=e||t||n?n7A([e,t],n):[],s,u;const E=()=>{!s&&setTimeout(()=>{c&&c.unsubscribe()}),s=!0};let w;try{if(r&&i7A&&y!=="get"&&y!=="head"&&(w=await a7A(o,x))!==0){let f=new Request(l,{method:"POST",body:x,duplex:"half"}),h;if(T.isFormData(x)&&(h=f.headers.get("content-type"))&&o.setContentType(h),f.body){const[U,F]=gd(w,ut(Qd(r)));x=cd(f.body,wd,U,F,oQ)}}T.isString(a)||(a=a?"include":"omit");const C="credentials"in Request.prototype;u=new Request(l,{...g,signal:c,method:y.toUpperCase(),headers:o.normalize().toJSON(),body:x,duplex:"half",credentials:C?a:void 0});let I=await fetch(u);const D=aQ&&(i==="stream"||i==="response");if(aQ&&(B||D)){const f={};["status","statusText","headers"].forEach(G=>{f[G]=I[G]});const h=T.toFiniteNumber(I.headers.get("content-length")),[U,F]=B&&gd(h,ut(Qd(B),!0))||[];I=new Response(cd(I.body,wd,U,()=>{F&&F(),D&&E()},oQ),f)}i=i||"text";let d=await Ct[T.findKey(Ct,i)||"text"](I,A);return!D&&E(),Q&&Q(),await new Promise((f,h)=>{$p(f,h,{data:d,headers:Z5.from(I.headers),status:I.status,statusText:I.statusText,config:A,request:u})})}catch(C){throw E(),C&&C.name==="TypeError"&&/fetch/i.test(C.message)?Object.assign(new vA("Network Error",vA.ERR_NETWORK,A,u),{cause:C.cause||C}):vA.from(C,C&&C.code,A,u)}}),gQ={http:YlA,xhr:t7A,fetch:g7A};T.forEach(gQ,(A,l)=>{if(A){try{Object.defineProperty(A,"name",{value:l})}catch{}Object.defineProperty(A,"adapterName",{value:l})}});const Ed=A=>`- ${A}`,Q7A=A=>T.isFunction(A)||A===null||A===!1,ej={getAdapter:A=>{A=T.isArray(A)?A:[A];const{length:l}=A;let y,x;const e={};for(let t=0;t`adapter ${B} `+(r===!1?"is not supported by the environment":"is not available in the build"));let n=l?t.length>1?`since : `+t.map(Ed).join(` `):" "+Ed(t[0]):"as no adapter specified";throw new vA("There is no suitable adapter to dispatch the request "+n,"ERR_NOT_SUPPORT")}return x},adapters:gQ};function Uo(A){if(A.cancelToken&&A.cancelToken.throwIfRequested(),A.signal&&A.signal.aborted)throw new ty(null,A)}function ud(A){return Uo(A),A.headers=Z5.from(A.headers),A.data=mo.call(A,A.transformRequest),["post","put","patch"].indexOf(A.method)!==-1&&A.headers.setContentType("application/x-www-form-urlencoded",!1),ej.getAdapter(A.adapter||V6.adapter)(A).then(function(x){return Uo(A),x.data=mo.call(A,A.transformResponse,x),x.headers=Z5.from(x.headers),x},function(x){return _p(x)||(Uo(A),x&&x.response&&(x.response.data=mo.call(A,A.transformResponse,x.response),x.response.headers=Z5.from(x.response.headers))),Promise.reject(x)})}const tj="1.7.5",rw={};["object","boolean","number","function","string","symbol"].forEach((A,l)=>{rw[A]=function(x){return typeof x===A||"a"+(l<1?"n ":" ")+A}});const Cd={};rw.transitional=function(l,y,x){function e(t,n){return"[Axios v"+tj+"] Transitional option '"+t+"'"+n+(x?". "+x:"")}return(t,n,B)=>{if(l===!1)throw new vA(e(n," has been removed"+(y?" in "+y:"")),vA.ERR_DEPRECATED);return y&&!Cd[n]&&(Cd[n]=!0,console.warn(e(n," has been deprecated since v"+y+" and will be removed in the near future"))),l?l(t,n,B):!0}};function s7A(A,l,y){if(typeof A!="object")throw new vA("options must be an object",vA.ERR_BAD_OPTION_VALUE);const x=Object.keys(A);let e=x.length;for(;e-- >0;){const t=x[e],n=l[t];if(n){const B=A[t],r=B===void 0||n(B,t,A);if(r!==!0)throw new vA("option "+t+" must be "+r,vA.ERR_BAD_OPTION_VALUE);continue}if(y!==!0)throw new vA("Unknown option "+t,vA.ERR_BAD_OPTION)}}const QQ={assertOptions:s7A,validators:rw},C3=QQ.validators;class W2{constructor(l){this.defaults=l,this.interceptors={request:new od,response:new od}}async request(l,y){try{return await this._request(l,y)}catch(x){if(x instanceof Error){let e;Error.captureStackTrace?Error.captureStackTrace(e={}):e=new Error;const t=e.stack?e.stack.replace(/^.+\n/,""):"";try{x.stack?t&&!String(x.stack).endsWith(t.replace(/^.+\n.+\n/,""))&&(x.stack+=` -`+t):x.stack=t}catch{}}throw x}}_request(l,y){typeof l=="string"?(y=y||{},y.url=l):y=l||{},y=nl(this.defaults,y);const{transitional:x,paramsSerializer:e,headers:t}=y;x!==void 0&&QQ.assertOptions(x,{silentJSONParsing:C3.transitional(C3.boolean),forcedJSONParsing:C3.transitional(C3.boolean),clarifyTimeoutError:C3.transitional(C3.boolean)},!1),e!=null&&(T.isFunction(e)?y.paramsSerializer={serialize:e}:QQ.assertOptions(e,{encode:C3.function,serialize:C3.function},!0)),y.method=(y.method||this.defaults.method||"get").toLowerCase();let n=t&&T.merge(t.common,t[y.method]);t&&T.forEach(["delete","get","head","post","put","patch","common"],Q=>{delete t[Q]}),y.headers=Z5.concat(n,t);const B=[];let r=!0;this.interceptors.request.forEach(function(s){typeof s.runWhen=="function"&&s.runWhen(y)===!1||(r=r&&s.synchronous,B.unshift(s.fulfilled,s.rejected))});const i=[];this.interceptors.response.forEach(function(s){i.push(s.fulfilled,s.rejected)});let o,a=0,g;if(!r){const Q=[ud.bind(this),void 0];for(Q.unshift.apply(Q,B),Q.push.apply(Q,i),g=Q.length,o=Promise.resolve(y);a{if(!x._listeners)return;let t=x._listeners.length;for(;t-- >0;)x._listeners[t](e);x._listeners=null}),this.promise.then=e=>{let t;const n=new Promise(B=>{x.subscribe(B),t=B}).then(e);return n.cancel=function(){x.unsubscribe(t)},n},l(function(t,n,B){x.reason||(x.reason=new ty(t,n,B),y(x.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(l){if(this.reason){l(this.reason);return}this._listeners?this._listeners.push(l):this._listeners=[l]}unsubscribe(l){if(!this._listeners)return;const y=this._listeners.indexOf(l);y!==-1&&this._listeners.splice(y,1)}static source(){let l;return{token:new iw(function(e){l=e}),cancel:l}}}function c7A(A){return function(y){return A.apply(null,y)}}function w7A(A){return T.isObject(A)&&A.isAxiosError===!0}const sQ={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(sQ).forEach(([A,l])=>{sQ[l]=A});function nj(A){const l=new W2(A),y=Rp(W2.prototype.request,l);return T.extend(y,W2.prototype,l,{allOwnKeys:!0}),T.extend(y,l,null,{allOwnKeys:!0}),y.create=function(e){return nj(nl(A,e))},y}const p1=nj(V6);p1.Axios=W2;p1.CanceledError=ty;p1.CancelToken=iw;p1.isCancel=_p;p1.VERSION=tj;p1.toFormData=Nn;p1.AxiosError=vA;p1.Cancel=p1.CanceledError;p1.all=function(l){return Promise.all(l)};p1.spread=c7A;p1.isAxiosError=w7A;p1.mergeConfig=nl;p1.AxiosHeaders=Z5;p1.formToJSON=A=>qp(T.isHTMLForm(A)?new FormData(A):A);p1.getAdapter=ej.getAdapter;p1.HttpStatusCode=sQ;p1.default=p1;const E7A=async(A,l,y)=>{let e=`undefined/${l}/${y}`;return y==="mid-parental-height"&&(e=`undefined/utilities/${y}`),(await p1({url:e,data:A,method:"POST",headers:{"Content-Type":"application/json","Subscription-Key":"da84206c-6e99-4b82-ae3b-88818b8a9c33"}})).data},u7A=()=>{const A={mid_parental_height:null,mid_parental_height_sds:null,mid_parental_height_centile:null,mid_parental_height_centile_data:null,mid_parental_height_lower_centile_data:null,mid_parental_height_upper_centile_data:null,mid_parental_height_lower_value:null,mid_parental_height_upper_value:null},l={turner:{height:[],weight:[],bmi:[],ofc:[]},"trisomy-21":{height:[],weight:[],bmi:[],ofc:[]},"trisomy-21-aap":{height:[],weight:[],bmi:[],ofc:[]},"uk-who":{height:[],weight:[],bmi:[],ofc:[],parentalHeights:{height_maternal:null,height_paternal:null,sex:null,reference:"uk-who"},midParentalHeights:A},who:{height:[],weight:[],bmi:[],ofc:[],parentalHeights:{height_maternal:null,height_paternal:null,sex:null,reference:"who"},midParentalHeights:A},cdc:{height:[],weight:[],bmi:[],ofc:[],parentalHeights:{height_maternal:null,height_paternal:null,sex:null,reference:"cdc"}}};return{calculation:{input:l,output:l},"fictional-child-data":{input:l,output:l},errors:{errors:!1,message:""},isLoading:!1,isMidparentalCalculation:!1}},C7A=(A,l,y="calculation")=>{const[x,e]=M.useState(u7A),t=M.useCallback(o=>{e(a=>{let g=Q9(a);return o.height_maternal&&o.height_paternal?(g[y].input[l].parentalHeights=o,g.isMidparentalCalculation=!0):g[y].input[l][A].push(o),g.isLoading=!0,g})},[A,y,l]),n=M.useCallback((o,a=!1)=>{const g=Q9(o[y].input[l][A]);g.pop();let c=null;return a&&(c=o[y].output[l][A],c.pop()),{newInput:g,newOutput:c}},[A,y,l]),B=M.useCallback(o=>{e(a=>{const g=Q9(a),{newInput:c,newOutput:Q}=n(a,o);return g[y].input[l][A]=c,Q&&(g[y].output[l][A]=Q),g})},[e,n,y,l,A]),r=M.useCallback(()=>{e(o=>{const a=Q9(o);return a[y].input[l][A]=[],a[y].output[l][A]=[],a})},[A,y,l]),i=M.useCallback(()=>{e(o=>{const a=Q9(o);return a.errors={errors:!1,message:""},a})},[]);return M.useEffect(()=>{let o=!1;if(x.isLoading){let a,g;x.isMidparentalCalculation?g=x[y].input[l].parentalHeights:(a=x[y].input[l][A],g=Q9(a[a.length-1])),E7A(g,l,x.isMidparentalCalculation?"mid-parental-height":y).then(c=>{o||e(Q=>{const s=Q9(Q);let u="",E=null;if(s.isMidparentalCalculation)return s.errors={errors:!1,message:"success"},s[y].input[l].parentalheights=g,s[y].output[l].midParentalHeights=c,s.isLoading=!1,s.isMidparentalCalculation=!1,s;y==="fictional-child-data"&&(E=c),y==="calculation"&&(E=s[y].output[l][A].concat([c]));for(const w of E)if(E.length<2&&(u=w.measurement_calculated_values.corrected_measurement_error||w.measurement_calculated_values.chronological_measurement_error),u){if(y==="fictional-child-data")s[y].input[l][A]=[];else{const{newInput:C}=n(Q);s[y].input[l][A]=C}return s.errors={errors:!0,message:`The server could not process the measurements. Details: ${u}`},s.isLoading=!1,s}return s[y].output[l][A]=E,s.errors={errors:!1,message:"success"},s.isLoading=!1,s})}).catch(c=>{e(Q=>{const s=Q9(Q),{newInput:u}=n(Q);s[y].input[l][A]=u,console.log(c.response);const E=c.response.data.detail;let w="";E.forEach(I=>w+=`${I.msg} -`);const C=`There has been a problem fetching the result from the server. +`+t):x.stack=t}catch{}}throw x}}_request(l,y){typeof l=="string"?(y=y||{},y.url=l):y=l||{},y=nl(this.defaults,y);const{transitional:x,paramsSerializer:e,headers:t}=y;x!==void 0&&QQ.assertOptions(x,{silentJSONParsing:C3.transitional(C3.boolean),forcedJSONParsing:C3.transitional(C3.boolean),clarifyTimeoutError:C3.transitional(C3.boolean)},!1),e!=null&&(T.isFunction(e)?y.paramsSerializer={serialize:e}:QQ.assertOptions(e,{encode:C3.function,serialize:C3.function},!0)),y.method=(y.method||this.defaults.method||"get").toLowerCase();let n=t&&T.merge(t.common,t[y.method]);t&&T.forEach(["delete","get","head","post","put","patch","common"],Q=>{delete t[Q]}),y.headers=Z5.concat(n,t);const B=[];let r=!0;this.interceptors.request.forEach(function(s){typeof s.runWhen=="function"&&s.runWhen(y)===!1||(r=r&&s.synchronous,B.unshift(s.fulfilled,s.rejected))});const i=[];this.interceptors.response.forEach(function(s){i.push(s.fulfilled,s.rejected)});let o,a=0,g;if(!r){const Q=[ud.bind(this),void 0];for(Q.unshift.apply(Q,B),Q.push.apply(Q,i),g=Q.length,o=Promise.resolve(y);a{if(!x._listeners)return;let t=x._listeners.length;for(;t-- >0;)x._listeners[t](e);x._listeners=null}),this.promise.then=e=>{let t;const n=new Promise(B=>{x.subscribe(B),t=B}).then(e);return n.cancel=function(){x.unsubscribe(t)},n},l(function(t,n,B){x.reason||(x.reason=new ty(t,n,B),y(x.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(l){if(this.reason){l(this.reason);return}this._listeners?this._listeners.push(l):this._listeners=[l]}unsubscribe(l){if(!this._listeners)return;const y=this._listeners.indexOf(l);y!==-1&&this._listeners.splice(y,1)}static source(){let l;return{token:new iw(function(e){l=e}),cancel:l}}}function c7A(A){return function(y){return A.apply(null,y)}}function w7A(A){return T.isObject(A)&&A.isAxiosError===!0}const sQ={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(sQ).forEach(([A,l])=>{sQ[l]=A});function nj(A){const l=new W2(A),y=Rp(W2.prototype.request,l);return T.extend(y,W2.prototype,l,{allOwnKeys:!0}),T.extend(y,l,null,{allOwnKeys:!0}),y.create=function(e){return nj(nl(A,e))},y}const p1=nj(V6);p1.Axios=W2;p1.CanceledError=ty;p1.CancelToken=iw;p1.isCancel=_p;p1.VERSION=tj;p1.toFormData=Nn;p1.AxiosError=vA;p1.Cancel=p1.CanceledError;p1.all=function(l){return Promise.all(l)};p1.spread=c7A;p1.isAxiosError=w7A;p1.mergeConfig=nl;p1.AxiosHeaders=Z5;p1.formToJSON=A=>qp(T.isHTMLForm(A)?new FormData(A):A);p1.getAdapter=ej.getAdapter;p1.HttpStatusCode=sQ;p1.default=p1;const E7A=async(A,l,y)=>{const x="https://rcpch-dgc-server-live.azurewebsites.net";let e=`${x}/${l}/${y}`;return y==="mid-parental-height"&&(e=`${x}/utilities/${y}`),(await p1({url:e,data:A,method:"POST",headers:{"Content-Type":"application/json","Subscription-Key":"da84206c-6e99-4b82-ae3b-88818b8a9c33"}})).data},u7A=()=>{const A={mid_parental_height:null,mid_parental_height_sds:null,mid_parental_height_centile:null,mid_parental_height_centile_data:null,mid_parental_height_lower_centile_data:null,mid_parental_height_upper_centile_data:null,mid_parental_height_lower_value:null,mid_parental_height_upper_value:null},l={turner:{height:[],weight:[],bmi:[],ofc:[]},"trisomy-21":{height:[],weight:[],bmi:[],ofc:[]},"trisomy-21-aap":{height:[],weight:[],bmi:[],ofc:[]},"uk-who":{height:[],weight:[],bmi:[],ofc:[],parentalHeights:{height_maternal:null,height_paternal:null,sex:null,reference:"uk-who"},midParentalHeights:A},who:{height:[],weight:[],bmi:[],ofc:[],parentalHeights:{height_maternal:null,height_paternal:null,sex:null,reference:"who"},midParentalHeights:A},cdc:{height:[],weight:[],bmi:[],ofc:[],parentalHeights:{height_maternal:null,height_paternal:null,sex:null,reference:"cdc"}}};return{calculation:{input:l,output:l},"fictional-child-data":{input:l,output:l},errors:{errors:!1,message:""},isLoading:!1,isMidparentalCalculation:!1}},C7A=(A,l,y="calculation")=>{const[x,e]=M.useState(u7A),t=M.useCallback(o=>{e(a=>{let g=Q9(a);return o.height_maternal&&o.height_paternal?(g[y].input[l].parentalHeights=o,g.isMidparentalCalculation=!0):g[y].input[l][A].push(o),g.isLoading=!0,g})},[A,y,l]),n=M.useCallback((o,a=!1)=>{const g=Q9(o[y].input[l][A]);g.pop();let c=null;return a&&(c=o[y].output[l][A],c.pop()),{newInput:g,newOutput:c}},[A,y,l]),B=M.useCallback(o=>{e(a=>{const g=Q9(a),{newInput:c,newOutput:Q}=n(a,o);return g[y].input[l][A]=c,Q&&(g[y].output[l][A]=Q),g})},[e,n,y,l,A]),r=M.useCallback(()=>{e(o=>{const a=Q9(o);return a[y].input[l][A]=[],a[y].output[l][A]=[],a})},[A,y,l]),i=M.useCallback(()=>{e(o=>{const a=Q9(o);return a.errors={errors:!1,message:""},a})},[]);return M.useEffect(()=>{let o=!1;if(x.isLoading){let a,g;x.isMidparentalCalculation?g=x[y].input[l].parentalHeights:(a=x[y].input[l][A],g=Q9(a[a.length-1])),E7A(g,l,x.isMidparentalCalculation?"mid-parental-height":y).then(c=>{o||e(Q=>{const s=Q9(Q);let u="",E=null;if(s.isMidparentalCalculation)return s.errors={errors:!1,message:"success"},s[y].input[l].parentalheights=g,s[y].output[l].midParentalHeights=c,s.isLoading=!1,s.isMidparentalCalculation=!1,s;y==="fictional-child-data"&&(E=c),y==="calculation"&&(E=s[y].output[l][A].concat([c]));for(const w of E)if(E.length<2&&(u=w.measurement_calculated_values.corrected_measurement_error||w.measurement_calculated_values.chronological_measurement_error),u){if(y==="fictional-child-data")s[y].input[l][A]=[];else{const{newInput:C}=n(Q);s[y].input[l][A]=C}return s.errors={errors:!0,message:`The server could not process the measurements. Details: ${u}`},s.isLoading=!1,s}return s[y].output[l][A]=E,s.errors={errors:!1,message:"success"},s.isLoading=!1,s})}).catch(c=>{e(Q=>{const s=Q9(Q),{newInput:u}=n(Q);s[y].input[l][A]=u;let E="";c.response&&c.response.data&&c.response.data.detail!==null&&c.response.data.detail.forEach(I=>E+=`${I.msg} +`);const w=`There has been a problem fetching the result from the server. Error details: ${c.message} -${w}`;return s.errors={errors:!0,message:C},s.isLoading=!1,s})})}return()=>{o=!0}},[x,A,y,l,n]),{fetchResult:t,removeLastActiveItem:B,clearBothActiveArrays:r,clearApiErrors:i,measurements:x[y].input,results:x[y].output,apiErrors:x.errors,isLoading:x.isLoading}},M7A=()=>({mode:"calculation",modeActiveIndex:0,reference:"uk-who",measurementMethod:"height",units:"cm",measurementMethodActiveIndex:0,sex:"male",parentalHeights:{height_maternal:null,height_paternal:null},"mid-parental-height":{mid_parental_height:null,mid_parental_height_sds:null,mid_parental_height_centile:null,mid_parental_height_centile_data:null,mid_parental_height_lower_centile_data:null,mid_parental_height_upper_centile_data:null,mid_parental_height_lower_value:null,mid_parental_height_upper_value:null},disabled:{height:!1,weight:!1,bmi:!1,ofc:!1,male:!1,female:!1},errors:{errors:!1,message:""},clearMeasurement:!1,resetCurrent:!1,undoLast:!1,isDataPresent:!1}),Vx=["height","weight","bmi","ofc","sds"],I7A=()=>{const[A,l]=M.useState(M7A),y=M.useCallback(x=>(e,t)=>{l(n=>{const B=Q9(n);switch(e){case"mode":B.mode=t,B.modeActiveIndex=t==="calculation"?0:1;break;case"modeActiveIndex":switch(B.modeActiveIndex=t,t){case 0:B.mode="calculation";break;case 1:B.mode="fictional-child-data";break;default:B.mode="calculation";break}break;case"reference":B.reference=t,t==="turner"?(B.disabled={height:!1,weight:!0,bmi:!0,ofc:!0,male:!0,female:!1},B.measurementMethod="height",B.measurementMethodActiveIndex=0,B.sex="female"):(x[t][B.measurementMethod].length>0&&x[t][B.measurementMethod][0].birth_data.sex!==B.sex&&(B.sex=x[t][B.measurementMethod][0].birth_data.sex),B.disabled={height:!1,weight:!1,bmi:!1,ofc:!1,male:!1,female:!1});break;case"measurementMethod":B.measurementMethod=t,B.units=bp(t);for(let r=0;r0){for(const i of r)if(t!==i.sex){B.errors={errors:!0,message:"Unable to change sex"};break}}B.errors.message||(B.sex=t);break}default:B[e]=t}return B})},[]);return{globalState:A,makeGlobalStateUpdater:y}},D7A=({})=>{const[A,l]=M.useState(!0),[y,x]=M.useState({value:"monochrome",text:"Monochrome"}),[e,t]=M.useState(!1),[n,B]=M.useState(H9()),{globalState:r,makeGlobalStateUpdater:i}=I7A(),[o,a]=M.useState(!0),{mode:g,modeActiveIndex:c,reference:Q,measurementMethod:s,measurementMethodActiveIndex:u,sex:E,disabled:w,errors:C,resetCurrent:I,undoLast:D}=r,{fetchResult:d,removeLastActiveItem:f,clearBothActiveArrays:h,clearApiErrors:U,measurements:F,results:G,apiErrors:p,isLoading:v}=C7A(s,Q,g),b=M.useMemo(()=>i(G),[G,i]);M.useEffect(()=>{if(p.errors?B({visible:!0,title:"Unable to plot",body:p.message,handleClose:()=>{U(),B(H9())}}):p.message==="success"&&(b("clearMeasurement",!0),U()),C.errors){let X="Only height data is available for Turner Syndrome.";C.message==="Unable to change sex"&&(X="Each chart can only display measurements from one patient at a time. Please reset the chart before entering measurements from a new patient."),B({visible:!0,title:C.message,body:X,handleClose:()=>B(H9())}),b("errors",{errors:!1,message:""})}},[C,p,U,b]),M.useEffect(()=>{G[Q][s].length>0?b("isDataPresent",!0):b("isDataPresent",!1)},[G,Q,s,b]),I&&(B({visible:!0,title:"Are you sure you want to reset?",body:"This will remove all measurements from the current chart.",handleCancel:()=>B(H9()),handleClose:()=>{h(),B(H9()),b("mid-parental-height","empty")}}),b("resetCurrent",!1)),D&&(B({visible:!0,title:"Are you sure you want to remove the last measurement?",body:"This will remove the last measurement entered on the chart.",handleCancel:()=>B(H9()),handleClose:()=>{f(!0),B(H9())}}),b("undoLast",!1));const R=(X,{activeIndex:W})=>{b("measurementMethodActiveIndex",W)},K=(X,{activeIndex:W})=>{b("modeActiveIndex",W)},J=X=>{X.noise_range=X.noise_range/100,d(X)},Y=X=>(d(X),!!v),N=(X,{value:W})=>{const sA=Md.find(nA=>nA.key===W).text;x({value:W,text:sA})},H=()=>{t(!e)},S=()=>{l(!A)},O=X=>{if(!v){const W=Q9(F[Q][s]);let q="";if(W.length>0){const sA=X.gestation_weeks*7+X.gestation_days,nA=[];for(const FA of W){if(JSON.stringify(FA)===JSON.stringify(X)){q="duplicate";break}const pA=FA.gestation_weeks*7+FA.gestation_days;if(FA.sex!==X.sex&&nA.push("differing sexes"),FA.birth_date!==X.birth_date&&nA.push("differing date of births"),pA!==sA&&nA.push("differing gestations"),nA.length>0){q=nA[0],nA.length===2?q=nA.join(" and "):nA.length===3&&(q=`${nA[0]}, ${nA[1]} and ${nA[2]}`);break}}}return q?(B(q==="duplicate"?{visible:!0,title:"Duplicate entries",body:"Please check the last measurement entry as it appears to be identical to a measurement already entered.",handleClose:()=>B(H9())}:{visible:!0,title:"Please check entries",body:`Each chart can only display measurements from one patient at a time: ${q} were detected.`,handleClose:()=>B(H9())}),!1):(d(X),!0)}},yA=d7A.map((X,W)=>({menuItem:X.menuItem,render:()=>A?j.jsx(e0.Pane,{attached:"top",disabled:w[X.measurementName],children:j.jsx(xd,{reference:Q,sex:E,measurementMethod:X.measurementName,measurementsArray:G[Q][X.measurementName],midParentalHeightData:G[Q].midParentalHeights,theme:y.value,isLoading:v,chartType:"centile",clinicianFocus:o},`centile-${W}`)},"charts"):j.jsx(e0.Pane,{attached:"top",children:j.jsx(xd,{reference:Q,sex:E,measurementMethod:X.measurementName,measurementsArray:G[Q],midParentalHeightData:G[Q].midParentalHeights,theme:y.value,isLoading:v,chartType:"sds"},`sds-${W}`)},"sds")})),_=()=>j.jsx(e0,{menu:{attached:"top",secondary:!0,pointing:!0},panes:yA,activeIndex:u,onTabChange:R},"tabPanes"),tA=[{key:"measurements",menuItem:"Measurements",render:()=>j.jsx(e0.Pane,{attached:!1,children:j.jsx(p2A,{handleMeasurementResult:O,globalState:r,updateGlobalState:b,className:"measurement-form",handleUtilitiesFormDataSubmit:Y})},"measurements")},{key:"examples",menuItem:"Examples",render:()=>j.jsx(e0.Pane,{children:j.jsx(L2A,{fictionalFormDataSubmit:J,globalState:r,updateGlobalState:b,handleUtilitiesFormDataSubmit:Y})},"examples")}],wA=()=>j.jsxs("span",{children:["Theme"," ",j.jsx(e5,{options:Md,floating:!0,inline:!0,onChange:N,text:y.text})]});return j.jsxs(M.Fragment,{children:[j.jsxs(A5,{padded:!0,children:[j.jsxs(A5.Row,{children:[j.jsx(A5.Column,{width:6,children:j.jsx(V5,{textAlign:"center",color:g==="fictional-child-data"?"black":null,children:j.jsx(e0,{panes:tA,menu:{attached:!1,secondary:!0,pointing:!0},onTabChange:K,activeIndex:c},"measurementTabs")})}),j.jsx(A5.Column,{width:10,children:j.jsxs(V5,{color:g==="fictional-child-data"?"black":null,children:[e?j.jsx(H2A,{apiResult:G,reference:Q}):j.jsx("div",{children:j.jsx(_,{})}),j.jsx(A5,{verticalAlign:"middle",children:j.jsxs(A5.Row,{columns:3,children:[j.jsxs(A5.Column,{textAlign:"left",width:4,children:[j.jsx(v0,{radio:!0,label:"Clinician Advice",name:"checkboxRadioGroup",value:0,checked:o,onChange:(X,W)=>a(!o)}),j.jsx(v0,{radio:!0,label:"Child/Family Advice",name:"checkboxRadioGroup",value:1,checked:!o,onChange:(X,W)=>a(!o)})]}),j.jsx(A5.Column,{textAlign:"center",width:4,children:j.jsx(wA,{})}),j.jsxs(A5.Column,{textAlign:"right",width:8,children:[j.jsx(TA,{onClick:S,color:"black",disabled:e,children:A?"Show SDS Chart":"Show Centile Charts"}),j.jsx(TA,{disabled:!r.isDataPresent,className:"selectUpperMargin",onClick:H,children:e?"Chart":"Results"})]})]})})]})})]}),j.jsx(A5.Row,{children:j.jsx(Ql,{children:j.jsx(Y9,{icon:"warning sign",header:"DISCLAIMER",content:"This is for demonstration purposes only and is not for clinical use.",color:"red"})})})]}),j.jsx(z2A,{title:n.title,body:n.body,visible:n.visible,handleClose:n.handleClose,handleCancel:n.handleCancel})]})},d7A=[{menuItem:"Height",measurementName:"height",key:"Height"},{menuItem:"Weight",measurementName:"weight",key:"Weight"},{menuItem:"BMI",measurementName:"bmi",key:"BMI"},{menuItem:"Head Circumference",measurementName:"ofc",key:"Head Circumference"}],Md=[{key:"monochrome",value:"monochrome",text:"Monochrome"},{key:"traditional",value:"traditional",text:"Traditional"},{key:"tanner1",value:"tanner1",text:"Tanner 1"},{key:"tanner2",value:"tanner2",text:"Tanner 2"},{key:"tanner3",value:"tanner3",text:"Tanner 3"}];function H9(){return{visible:!1,title:"",body:"",handleClose:null,handleCancel:null}}const f7A="rcpchgrowth-react",F7A="7.0.1",h7A="MIT",m7A={type:"git",url:"https://github.com/rcpch/digital-growth-charts-react-client"},U7A="http://rcpch.github.io/digital-growth-charts-react-client",Y7A="module",G7A={dev:"vite --port 3000",build:"vite build",lint:"eslint .",preview:"vite preview"},p7A={axios:"1.7.5",moment:"2.30.1",react:"18.2.0","react-dom":"18.2.0","semantic-ui-css":"2.5.0","semantic-ui-react":"3.0.0-beta.2","styled-components":"6.1.12","@rcpch/digital-growth-charts-react-component-library":"7.3.0"},j7A={"@eslint/js":"^9.8.0","@types/react":"^18.0.28","@types/react-dom":"^18.0.11","@vitejs/plugin-react":"^4.3.1",eslint:"^9.8.0","eslint-plugin-react":"^7.35.0","eslint-plugin-react-hooks":"^5.1.0-rc.0","eslint-plugin-react-refresh":"^0.4.9",globals:"^15.9.0",vite:"^5.4.0"},Id={name:f7A,version:F7A,private:!1,license:h7A,repository:m7A,homepage:U7A,type:Y7A,scripts:G7A,dependencies:p7A,devDependencies:j7A},v7A=()=>j.jsxs("div",{children:[j.jsx(D7A,{}),j.jsx("small",{children:j.jsxs("i",{children:["RCPCH digital Growth Charts - Client : v",Id.version,", Charts: v",Id.dependencies["@rcpch/digital-growth-charts-react-component-library"],"."]})})]});function P7A(){return j.jsx("div",{className:"App",children:j.jsx(v7A,{})})}const N7A=document.getElementById("root"),b7A=Yo.createRoot(N7A);b7A.render(j.jsx(m.StrictMode,{children:j.jsx(P7A,{})}))});export default R7A(); +${E}`;return s.errors={errors:!0,message:w},s.isLoading=!1,s})})}return()=>{o=!0}},[x,A,y,l,n]),{fetchResult:t,removeLastActiveItem:B,clearBothActiveArrays:r,clearApiErrors:i,measurements:x[y].input,results:x[y].output,apiErrors:x.errors,isLoading:x.isLoading}},M7A=()=>({mode:"calculation",modeActiveIndex:0,reference:"uk-who",measurementMethod:"height",units:"cm",measurementMethodActiveIndex:0,sex:"male",parentalHeights:{height_maternal:null,height_paternal:null},"mid-parental-height":{mid_parental_height:null,mid_parental_height_sds:null,mid_parental_height_centile:null,mid_parental_height_centile_data:null,mid_parental_height_lower_centile_data:null,mid_parental_height_upper_centile_data:null,mid_parental_height_lower_value:null,mid_parental_height_upper_value:null},disabled:{height:!1,weight:!1,bmi:!1,ofc:!1,male:!1,female:!1},errors:{errors:!1,message:""},clearMeasurement:!1,resetCurrent:!1,undoLast:!1,isDataPresent:!1}),Vx=["height","weight","bmi","ofc","sds"],I7A=()=>{const[A,l]=M.useState(M7A),y=M.useCallback(x=>(e,t)=>{l(n=>{const B=Q9(n);switch(e){case"mode":B.mode=t,B.modeActiveIndex=t==="calculation"?0:1;break;case"modeActiveIndex":switch(B.modeActiveIndex=t,t){case 0:B.mode="calculation";break;case 1:B.mode="fictional-child-data";break;default:B.mode="calculation";break}break;case"reference":B.reference=t,t==="turner"?(B.disabled={height:!1,weight:!0,bmi:!0,ofc:!0,male:!0,female:!1},B.measurementMethod="height",B.measurementMethodActiveIndex=0,B.sex="female"):(x[t][B.measurementMethod].length>0&&x[t][B.measurementMethod][0].birth_data.sex!==B.sex&&(B.sex=x[t][B.measurementMethod][0].birth_data.sex),B.disabled={height:!1,weight:!1,bmi:!1,ofc:!1,male:!1,female:!1});break;case"measurementMethod":B.measurementMethod=t,B.units=bp(t);for(let r=0;r0){for(const i of r)if(t!==i.sex){B.errors={errors:!0,message:"Unable to change sex"};break}}B.errors.message||(B.sex=t);break}default:B[e]=t}return B})},[]);return{globalState:A,makeGlobalStateUpdater:y}},D7A=({})=>{const[A,l]=M.useState(!0),[y,x]=M.useState({value:"monochrome",text:"Monochrome"}),[e,t]=M.useState(!1),[n,B]=M.useState(H9()),{globalState:r,makeGlobalStateUpdater:i}=I7A(),[o,a]=M.useState(!0),{mode:g,modeActiveIndex:c,reference:Q,measurementMethod:s,measurementMethodActiveIndex:u,sex:E,disabled:w,errors:C,resetCurrent:I,undoLast:D}=r,{fetchResult:d,removeLastActiveItem:f,clearBothActiveArrays:h,clearApiErrors:U,measurements:F,results:G,apiErrors:p,isLoading:v}=C7A(s,Q,g),b=M.useMemo(()=>i(G),[G,i]);M.useEffect(()=>{if(p.errors?B({visible:!0,title:"Unable to plot",body:p.message,handleClose:()=>{U(),B(H9())}}):p.message==="success"&&(b("clearMeasurement",!0),U()),C.errors){let X="Only height data is available for Turner Syndrome.";C.message==="Unable to change sex"&&(X="Each chart can only display measurements from one patient at a time. Please reset the chart before entering measurements from a new patient."),B({visible:!0,title:C.message,body:X,handleClose:()=>B(H9())}),b("errors",{errors:!1,message:""})}},[C,p,U,b]),M.useEffect(()=>{G[Q][s].length>0?b("isDataPresent",!0):b("isDataPresent",!1)},[G,Q,s,b]),I&&(B({visible:!0,title:"Are you sure you want to reset?",body:"This will remove all measurements from the current chart.",handleCancel:()=>B(H9()),handleClose:()=>{h(),B(H9()),b("mid-parental-height","empty")}}),b("resetCurrent",!1)),D&&(B({visible:!0,title:"Are you sure you want to remove the last measurement?",body:"This will remove the last measurement entered on the chart.",handleCancel:()=>B(H9()),handleClose:()=>{f(!0),B(H9())}}),b("undoLast",!1));const R=(X,{activeIndex:W})=>{b("measurementMethodActiveIndex",W)},K=(X,{activeIndex:W})=>{b("modeActiveIndex",W)},J=X=>{X.noise_range=X.noise_range/100,d(X)},Y=X=>(d(X),!!v),N=(X,{value:W})=>{const sA=Md.find(nA=>nA.key===W).text;x({value:W,text:sA})},H=()=>{t(!e)},S=()=>{l(!A)},O=X=>{if(!v){const W=Q9(F[Q][s]);let q="";if(W.length>0){const sA=X.gestation_weeks*7+X.gestation_days,nA=[];for(const FA of W){if(JSON.stringify(FA)===JSON.stringify(X)){q="duplicate";break}const pA=FA.gestation_weeks*7+FA.gestation_days;if(FA.sex!==X.sex&&nA.push("differing sexes"),FA.birth_date!==X.birth_date&&nA.push("differing date of births"),pA!==sA&&nA.push("differing gestations"),nA.length>0){q=nA[0],nA.length===2?q=nA.join(" and "):nA.length===3&&(q=`${nA[0]}, ${nA[1]} and ${nA[2]}`);break}}}return q?(B(q==="duplicate"?{visible:!0,title:"Duplicate entries",body:"Please check the last measurement entry as it appears to be identical to a measurement already entered.",handleClose:()=>B(H9())}:{visible:!0,title:"Please check entries",body:`Each chart can only display measurements from one patient at a time: ${q} were detected.`,handleClose:()=>B(H9())}),!1):(d(X),!0)}},yA=d7A.map((X,W)=>({menuItem:X.menuItem,render:()=>A?j.jsx(e0.Pane,{attached:"top",disabled:w[X.measurementName],children:j.jsx(xd,{reference:Q,sex:E,measurementMethod:X.measurementName,measurementsArray:G[Q][X.measurementName],midParentalHeightData:G[Q].midParentalHeights,theme:y.value,isLoading:v,chartType:"centile",clinicianFocus:o},`centile-${W}`)},"charts"):j.jsx(e0.Pane,{attached:"top",children:j.jsx(xd,{reference:Q,sex:E,measurementMethod:X.measurementName,measurementsArray:G[Q],midParentalHeightData:G[Q].midParentalHeights,theme:y.value,isLoading:v,chartType:"sds"},`sds-${W}`)},"sds")})),_=()=>j.jsx(e0,{menu:{attached:"top",secondary:!0,pointing:!0},panes:yA,activeIndex:u,onTabChange:R},"tabPanes"),tA=[{key:"measurements",menuItem:"Measurements",render:()=>j.jsx(e0.Pane,{attached:!1,children:j.jsx(p2A,{handleMeasurementResult:O,globalState:r,updateGlobalState:b,className:"measurement-form",handleUtilitiesFormDataSubmit:Y})},"measurements")},{key:"examples",menuItem:"Examples",render:()=>j.jsx(e0.Pane,{children:j.jsx(L2A,{fictionalFormDataSubmit:J,globalState:r,updateGlobalState:b,handleUtilitiesFormDataSubmit:Y})},"examples")}],wA=()=>j.jsxs("span",{children:["Theme"," ",j.jsx(e5,{options:Md,floating:!0,inline:!0,onChange:N,text:y.text})]});return j.jsxs(M.Fragment,{children:[j.jsxs(A5,{padded:!0,children:[j.jsxs(A5.Row,{children:[j.jsx(A5.Column,{width:6,children:j.jsx(V5,{textAlign:"center",color:g==="fictional-child-data"?"black":null,children:j.jsx(e0,{panes:tA,menu:{attached:!1,secondary:!0,pointing:!0},onTabChange:K,activeIndex:c},"measurementTabs")})}),j.jsx(A5.Column,{width:10,children:j.jsxs(V5,{color:g==="fictional-child-data"?"black":null,children:[e?j.jsx(H2A,{apiResult:G,reference:Q}):j.jsx("div",{children:j.jsx(_,{})}),j.jsx(A5,{verticalAlign:"middle",children:j.jsxs(A5.Row,{columns:3,children:[j.jsxs(A5.Column,{textAlign:"left",width:4,children:[j.jsx(v0,{radio:!0,label:"Clinician Advice",name:"checkboxRadioGroup",value:0,checked:o,onChange:(X,W)=>a(!o)}),j.jsx(v0,{radio:!0,label:"Child/Family Advice",name:"checkboxRadioGroup",value:1,checked:!o,onChange:(X,W)=>a(!o)})]}),j.jsx(A5.Column,{textAlign:"center",width:4,children:j.jsx(wA,{})}),j.jsxs(A5.Column,{textAlign:"right",width:8,children:[j.jsx(TA,{onClick:S,color:"black",disabled:e,children:A?"Show SDS Chart":"Show Centile Charts"}),j.jsx(TA,{disabled:!r.isDataPresent,className:"selectUpperMargin",onClick:H,children:e?"Chart":"Results"})]})]})})]})})]}),j.jsx(A5.Row,{children:j.jsx(Ql,{children:j.jsx(Y9,{icon:"warning sign",header:"DISCLAIMER",content:"This is for demonstration purposes only and is not for clinical use.",color:"red"})})})]}),j.jsx(z2A,{title:n.title,body:n.body,visible:n.visible,handleClose:n.handleClose,handleCancel:n.handleCancel})]})},d7A=[{menuItem:"Height",measurementName:"height",key:"Height"},{menuItem:"Weight",measurementName:"weight",key:"Weight"},{menuItem:"BMI",measurementName:"bmi",key:"BMI"},{menuItem:"Head Circumference",measurementName:"ofc",key:"Head Circumference"}],Md=[{key:"monochrome",value:"monochrome",text:"Monochrome"},{key:"traditional",value:"traditional",text:"Traditional"},{key:"tanner1",value:"tanner1",text:"Tanner 1"},{key:"tanner2",value:"tanner2",text:"Tanner 2"},{key:"tanner3",value:"tanner3",text:"Tanner 3"}];function H9(){return{visible:!1,title:"",body:"",handleClose:null,handleCancel:null}}const f7A="rcpchgrowth-react",F7A="7.0.1",h7A="MIT",m7A={type:"git",url:"https://github.com/rcpch/digital-growth-charts-react-client"},U7A="http://rcpch.github.io/digital-growth-charts-react-client",Y7A="module",G7A={dev:"vite --port 3000",build:"vite build",lint:"eslint .",preview:"vite preview"},p7A={axios:"1.7.5",moment:"2.30.1",react:"18.2.0","react-dom":"18.2.0","semantic-ui-css":"2.5.0","semantic-ui-react":"3.0.0-beta.2","styled-components":"6.1.12","@rcpch/digital-growth-charts-react-component-library":"7.3.0"},j7A={"@eslint/js":"^9.8.0","@types/react":"^18.0.28","@types/react-dom":"^18.0.11","@vitejs/plugin-react":"^4.3.1",eslint:"^9.8.0","eslint-plugin-react":"^7.35.0","eslint-plugin-react-hooks":"^5.1.0-rc.0","eslint-plugin-react-refresh":"^0.4.9",globals:"^15.9.0",vite:"^5.4.0"},Id={name:f7A,version:F7A,private:!1,license:h7A,repository:m7A,homepage:U7A,type:Y7A,scripts:G7A,dependencies:p7A,devDependencies:j7A},v7A=()=>j.jsxs("div",{children:[j.jsx(D7A,{}),j.jsx("small",{children:j.jsxs("i",{children:["RCPCH digital Growth Charts - Client : v",Id.version,", Charts: v",Id.dependencies["@rcpch/digital-growth-charts-react-component-library"],"."]})})]});function P7A(){return j.jsx("div",{className:"App",children:j.jsx(v7A,{})})}const N7A=document.getElementById("root"),b7A=Yo.createRoot(N7A);b7A.render(j.jsx(m.StrictMode,{children:j.jsx(P7A,{})}))});export default R7A(); diff --git a/index.html b/index.html index 0c257a7..2c8ec3b 100644 --- a/index.html +++ b/index.html @@ -16,7 +16,7 @@ content="React Client for RCPCH Growth Chart API" /> RCPCH | Digital Growth Charts - +