PageSourceSearch

https://avicennaresearch.com/app/assets/index--YG49IiL.js

js avicennaresearch.com collected 2026-10-01 14:13:44 UTC 3,168 bytes, 1 lines download raw bytes

1import{r as e,i as g,j as t,B as N,b as O,h as H,a as K,A as P,L as M,a9 as V,K as W}from"./index-MBthoxJu.js";import{b as $}from"./environment-BEfFhOWN.js";import{j as q}from"./join-study-C0Sgcf-f.js";import{S as z}from"./not-enrolled-in-study-iGDv2teC.js";import{u as Q}from"./useMutation-Ka6RvnWm.js";import{b as v,a as T,u as X}from"./index-tpAujqLd.js";import{u as Y}from"./user-info-BukOBq4I.js";import"./index-CNmKxZ54.js";import"./study-CcksejXR.js";import"./study-Cz2odjcQ.js";import"./misc-DDu84iZh.js";import"./useQuery-Mpn1wWGO.js";import"./numbers-C11L_IDE.js";import"./traditional-C6VIU1yI.js";const Z="_list_139wb_8",tt="_card_139wb_20",st="_cardInfo_139wb_31",_={list:Z,card:tt,cardInfo:st},et=({title:i,company:a,id:n})=>{const{t:d}=g(),{mutate:o,isPending:f}=v(),l=e.useCallback(()=>{o({studyId:n})},[o,n]);return t.jsxs("li",{className:_.card,children:[t.jsxs("div",{className:_.cardInfo,children:[t.jsx("h5",{children:i}),t.jsx("h6",{children:a}),t.jsxs("h6",{children:["Study ID: ",n]})]}),t.jsx(N,{color:"ghost",onClick:l,loading:f,children:d("join")})]})},nt=e.memo(et),ot=({studies:i})=>{const{t:a}=g();return i.length===0?null:t.jsxs("ul",{className:_.list,children:[t.jsx("h4",{children:a("pending_invitations")}),i.map(({id:n,title:d,company:o})=>t.jsx(nt,{title:d,company:o,id:n},n))]})},rt=e.memo(ot),it="_formInfo_1h1lf_8",at="_form_1h1lf_8",ut="_fieldGroup_1h1lf_28",ct="_inputRow_1h1lf_34",dt="_input_1h1lf_34",lt="_button_1h1lf_49",c={formInfo:it,form:at,fieldGroup:ut,inputRow:ct,input:dt,button:lt},mt=({showIllustration:i=!1,pendingStudies:a,enableAutoRegister:n=!0,enableUrlParam:d=!0})=>{const o=O(),{notify:f}=H(),{t:l}=g(),[R]=K(),y=e.useRef(!1),I=d?R.get("studyId"):null,m=Number(I),r=I!=null&&m>0&&!Number.isNaN(m),[u,w]=e.useState(r?m:null),[E,j]=e.useState(r);e.useEffect(()=>{r||j(!1)},[r]);const{studies:A,isSuccess:p,isError:x,refetch:C}=T(),{deviceId:D}=Y(),F=X(s=>s.setActiveStudyId),{mutate:h,isPending:b}=v({onSuccess:({id:s})=>{o(W(P.ParticipantDashboard.NewStudyInfo,{studyId:String(s)}),{replace:!0})},onError:()=>{j(!1)}}),{mutate:G,isPending:J}=Q({mutationFn:async s=>q(s,D),onSuccess:async(s,U)=>{await C(),F(U),o(P.ParticipantDashboard.Home,{replace:!0})},onError:s=>{f("error",s.message)}}),S=n?$():null,k=S!=null;e.useEffect(()=>{y.current||!r&&!p&&!x||r&&(y.current=!0,h({studyId:m}))},[r,m,h,p,x,k,S,G]);const B=s=>{s.preventDefault(),u!=null&&u>0&&h({studyId:u})},L=S!=null;return b||J||E||L?t.jsx(M,{}):t.jsxs("div",{"data-testid":"join-study-panel",children:[i&&t.jsxs("div",{className:c.formInfo,children:[t.jsx(z,{}),p&&A.length===0&&t.jsx("p",{children:l("join_study_not_enrolled_description")})]}),t.jsx("form",{className:c.form,onSubmit:B,children:t.jsx("div",{className:c.fieldGroup,children:t.jsxs("div",{className:c.inputRow,children:[t.jsx(V,{label:l("study_registration_reg_code_hint"),containerClass:c.input,integerOnly:!0,positiveOnly:!0,value:u,onChange:w,hasBorder:!0,placeholder:"1234"}),t.jsx(N,{className:c.button,color:"primary",type:"submit",disabled:u==null||u===0,loading:b,children:l("join_study")})]})})}),a!=null&&t.jsx(rt,{studies:a})]})},Rt=e.memo(mt);export{Rt as JoinStudy};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.