@flarehr/apollo-import-workspace-app 0.42.0 → 0.44.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -76,4 +76,4 @@ License: MIT
|
|
|
76
76
|
|\r|
|
|
77
77
|
`,","),t).encoding}const LC=e=>e.filter(r=>!$t(r)).length===0;function Z5(e){return $8(e.trim(),'"')}function BC(e,t){const r=Au(t.name,".csv")&&W2(t.type,FC,{Equals:(i,o)=>i===o,GetHashCode:He}),n=t.size<=10485760;if(r)if(n){const i=new FileReader;i.onload=o=>{const s=PC(i),a={};a.complete=(l,u)=>{let d,f,p,h,m,g,y,_,C,E,M,O;e((d=l.errors,!D2(e0,d,T0())&&d.length===0?(f=(p=l.data,p.filter(R=>!LC(R))),h=f.length>1?new I(0,[void 0]):new I(1,[new we(2,[])]),h.tag===1?new I(1,[h.fields[0]]):(m=f.length<=5001?new I(0,[void 0]):new I(1,[new we(3,[])]),m.tag===1?new I(1,[m.fields[0]]):(g=_i(f),y=g.length|0,_=g.some($t)?new I(1,[new we(4,[])]):new I(0,[void 0]),_.tag===1?new I(1,[_.fields[0]]):(C=(E=ma(t1(R=>Z5(R).toLocaleLowerCase(),g),{Equals:(R,D)=>R===D,GetHashCode:He}),E.length===y?new I(0,[void 0]):new I(1,[new we(5,[])])),C.tag===1?new I(1,[C.fields[0]]):(M=(O=f.filter(R=>R.length!==y),O.length===0?new I(0,[void 0]):new I(1,[new we(6,[])])),M.tag===1?new I(1,[M.fields[0]]):new I(0,[new Ug(new ya(t.name),K8((R,D)=>[new Ng(R),new Lg(Z5(D))],_i(f)),new wa(t1(R=>new Bg(t1(Z5,R)),Yu(f))),t.size)])))))):new I(1,[new we(7,[w0(0,l.errors).message])])))},a.error=(l,u)=>{e(new I(1,[new we(7,[l])]))},a.worker=!0,a.skipEmptyLines=!0,a.encoding=s,$C.parse(t,a)},i.onerror=o=>{e(new I(1,[new we(7,["Error reading file"])]))},i.readAsBinaryString(t)}else e(new I(1,[new we(1,[])]));else e(new I(1,[new we(0,[])]))}let E2=class extends W{constructor(t,r){super(),this.tag=t,this.fields=r}cases(){return["NoFileSelected","ParsingFile","FileSelected"]}};function HC(e){return e==null?[new E2(0,[void 0]),C0()]:[new E2(2,[e]),C0()]}function VC(e,t,r,n){const i=d=>Pe(t,new re(1,[{Success:d}]));let o,s,a,l,u;switch(r.tag){case 1:{n.tag===1?o=4:o=5;break}case 2:{n.tag===2?o=6:o=7;break}default:if(r.fields[0].tag===1)r.fields[0].fields[0].tag===1?n.tag===1?(o=2,u=r.fields[0].fields[0].fields[0]):o=3:n.tag===1?(o=1,l=r.fields[0].fields[0].fields[0]):o=3;else switch(n.tag){case 0:{o=0,s=r.fields[0].fields[0][0],a=r.fields[0].fields[0][1];break}case 2:{o=0,s=r.fields[0].fields[0][0],a=r.fields[0].fields[0][1];break}default:o=3}}switch(o){case 0:return[new E2(1,[s]),_6(a)];case 1:return[new E2(2,[l]),b6(w([Pe(e,!0),i(!0)]))];case 2:return[new E2(0,[u]),i(!1)];case 3:return[n,C0()];case 4:return[new E2(0,[void 0]),C0()];case 5:return[n,C0()];case 6:return[new E2(0,[void 0]),Pe(e,!1)];default:return[n,C0()]}}function UC(e,t){let r,n,i,o,s,a,l;return Zt(w([new S1(3,[e]),new S1(4,[t]),new S1(5,[[Xt(s0(new Jt(2,["fixed inset-0 bg-gray-500/50"]))),c("div",v(w([["className","fixed top-0 bottom-0 right-0 w-[480px] bg-white overflow-y-auto"],(r=[Kt(s0(new d2(2,[[c("div",v(w([["className","flex flex-col mt-6 mb-6 px-6"],(n=[c("div",v(w([["className","flex flex-row justify-between"],(i=[c("span",{className:"text-gray-900 font-semibold text-lg",children:"Frequently asked questions"}),c("button",v(w([["onClick",u=>{t()}],["type","button"],["className","text-gray-700"],(o=[z2(24,24)],["children",b.Children.toArray(Array.from(o))])])))],["children",b.Children.toArray(Array.from(i))])]))),c("div",{className:"font-semibold text-sm pt-6",children:"What file format is accepted for bulk import?"}),c("div",{className:"text-sm text-gray-500 pt-2",children:"The only accepted file format for bulk import is CSV."}),c("div",{className:"font-semibold text-sm pt-6",children:"What is the maximum upload file size?"}),c("div",{className:"text-sm text-gray-500 pt-2",children:"The maximum upload file size is 10 MB."}),c("div",{className:"font-semibold text-sm pt-6",children:"What is the maximum number of rows supported for bulk import?"}),c("div",{className:"text-sm text-gray-500 pt-2",children:"The maximum number of rows you can upload is 5,000."}),c("div",{className:"font-semibold text-sm pt-6",children:"What information do I need to include in the CSV file?"}),c("div",v(w([["className","text-sm text-gray-500 pt-2"],(s="You must include the required fields: “First name,” “Last name,” and “Email” to create a profile. “Mobile number” and “Employment basis” are optional but recommended, as they can help with searching and filtering.",["children",s])]))),c("div",{className:"font-semibold text-sm pt-6",children:"How do I format the CSV file?"}),c("div",v(w([["className","text-sm text-gray-500 pt-2"],(a=`We recommend downloading and editing our sample CSV template, which includes all the necessary column headers and example values.
|
|
78
78
|
If you’re using your own CSV, ensure that your data is organised correctly and that there are no extra spaces or special characters.`,["children",a])]))),c("div",{className:"font-semibold text-sm pt-6",children:"What should I do if my CSV file contains errors?"}),c("div",v(w([["className","text-sm text-gray-500 pt-2"],(l=`We recommend checking for common issues, such as missing data or incorrect formatting before upload.
|
|
79
|
-
If errors are detected during import, you can download a CSV file that lists all the rows with issues.`,["children",l])])))],["children",b.Children.toArray(Array.from(n))])])))]])))],["children",b.Children.toArray(Array.from(r))])])))]])]))}function jC(e,t){let r,n,i;return c("svg",v(w([["fill","none"],["height",t],["width",e],["viewBox","0 0 "+e+" "+t],["xmlns","http://www.w3.org/2000/svg"],(r=w([c("path",v(w([(n="M18 10C18 14.4183 14.4183 18 10 18C5.58172 18 2 14.4183 2 10C2 5.58172 5.58172 2 10 2C14.4183 2 18 5.58172 18 10ZM3.99743 10C3.99743 13.3151 6.68487 16.0026 10 16.0026C13.3151 16.0026 16.0026 13.3151 16.0026 10C16.0026 6.68487 13.3151 3.99743 10 3.99743C6.68487 3.99743 3.99743 6.68487 3.99743 10Z",["d",n]),["fill","#D6E2FC"]]))),c("path",v(w([(i="M10 3C10 2.44772 10.4494 1.99356 10.9974 2.06242C11.7053 2.15137 12.3996 2.3348 13.0615 2.60896C14.0321 3.011 14.914 3.60028 15.6569 4.34315C16.3997 5.08602 16.989 5.96793 17.391 6.93853C17.6652 7.60043 17.8486 8.29473 17.9376 9.0026C18.0064 9.55057 17.5523 10 17 10C16.4477 10 16.0085 9.54925 15.9169 9.00462C15.842 8.55939 15.7169 8.12298 15.5433 7.7039C15.2417 6.97595 14.7998 6.31451 14.2426 5.75736C13.6855 5.20021 13.0241 4.75825 12.2961 4.45672C11.877 4.28313 11.4406 4.15804 10.9954 4.08314C10.4508 3.99152 10 3.55228 10 3Z",["d",i]),["fill","#2E66F7"]])))]),["children",b.Children.toArray(Array.from(r))])])))}function WC(e,t){let r,n;return c("svg",v(w([["fill","none"],["height",t],["width",e],["viewBox","0 0 "+e+" "+t],["xmlns","http://www.w3.org/2000/svg"],(r=w([c("path",v(w([(n="M17 21H3C1.346 21 0 19.654 0 18V14H2V18C2 18.551 2.448 19 3 19H17C17.552 19 18 18.551 18 18V14H20V18C20 19.654 18.654 21 17 21Z",["d",n]),["fill","#9CA3AF"]]))),c("path",{d:"M16.414 7L10 0.585999L3.586 7L5 8.414L9 4.414V15H11V4.414L15 8.414L16.414 7Z",fill:"#9CA3AF"})]),["children",b.Children.toArray(Array.from(r))])])))}function qC(e,t){Lt(z.Delay(()=>z.Bind(cs(1e3),()=>(BC(r=>{t(new Tr(0,[new xn(1,[r])]))},e),z.Zero()))))}const K5=(()=>{const e=new Blob(["First name,Last name,Email,Mobile phone,Employment basis"],{type:"text/csv;charset=utf-8;"});return window.URL.createObjectURL(e)})();function GC(e){let t,r,n,i,o,s,a,l,u,d;const f=e.sendAnalytics,p=e.markDirty,h=e.cancel,m=e.next,g=e.existingCsvFile;let y;const _=HC(g);y=G2(()=>q2(()=>_,(F,V)=>VC(p,f,F,V),(F,V)=>{}),void 0,void 0);const C=y[0],E=y[1],M=F=>{E(new Tr(0,[new xn(0,[[new ya(F.name),V=>{qC(F,V)}]])]))},O=b.useState(!1),R=O[1],D=b.useState(!1),S=D[1],x=b.useState(!1),A=x[1],N=b.useRef(void 0),P=C.tag===2;return c("div",v(w([["className","bg-gray-50 h-full"],(t=[c("div",v(w([["className","max-w-[640px] flex flex-col mx-12 mt-8 mb-12"],(r=[nl(K5,O[0],()=>{R(!1)}),UC(x[0],()=>{A(!1)}),Hn("Upload CSV"),Vn("Download and use our template, or upload your own CSV to get started."),c("a",v(w([["className","flex flex-row items-end gap-1 text-primary-600"],["href",K5],["download","import_users"],(n=[c("span",{className:"text-sm font-medium pt-2",children:"Download sample CSV template"}),c("span",v(w([["className","pb-0.5"],(i=[rl(16,16)],["children",b.Children.toArray(Array.from(i))])])))],["children",b.Children.toArray(Array.from(n))])]))),c("div",v(w([["className","flex flex-row pt-3 gap-2"],(o=[R3("What kind of data do I need?",()=>{R(!0)}),R3("Frequently asked questions",()=>{A(!0)})],["children",b.Children.toArray(Array.from(o))])]))),c("div",v(s0((s=q(k(()=>{let F,V,i0,J,X,L,G,U,f0,Y,$,h0,m0,j,O0;switch(C.tag){case 2:{let Z;const l0=C.fields[0].SizeInBytes/1024/1024;return Z=l0<.01?.01:l0,T(c("div",v(w([["className","border border-emerald-200 border-2 rounded-md my-6 bg-emerald-50 p-6"],(F=[c("div",v(w([["className","justify-between items-center inline-flex w-full"],(V=[c("div",v(w([["className","justify-start items-start gap-2 flex"],(i0=[c("div",{className:"text-center text-gray-600 text-sm font-medium",children:C.fields[0].Name.fields[0]}),c("span",v(w([["className","text-emerald-700"],(J=[jn(20,20)],["children",b.Children.toArray(Array.from(J))])])))],["children",b.Children.toArray(Array.from(i0))])]))),c("div",v(w([["className","justify-start items-start gap-3 flex"],(X=[c("div",{className:"text-center text-gray-500 text-sm font-medium",children:(L=J4("{0:F2}",Z),O2(Ve("%s MB"))(L))}),c("button",v(w([["className","justify-start items-center gap-1 flex text-red-600"],["onClick",y0=>{E(new Tr(2,[]))}],(G=[c("div",{className:"text-center text-sm font-medium",children:"Remove"}),c("div",v(w([["className","w-4 h-4 justify-center items-center flex"],(U=[jr(10,10)],["children",b.Children.toArray(Array.from(U))])])))],["children",b.Children.toArray(Array.from(G))])])))],["children",b.Children.toArray(Array.from(X))])])))],["children",b.Children.toArray(Array.from(V))])]))),c("div",{className:"text-gray-500 text-xs font-normal",children:`${C.fields[0].DataRows.fields[0].length+1} rows`})],["children",b.Children.toArray(Array.from(F))])]))))}case 1:return T(c("div",v(w([["className","border-gray-300 border-dashed border-2 rounded-md my-6"],(f0=[c("div",v(w([["className","p-6 justify-between items-center inline-flex w-full"],(Y=[c("div",v(w([["className","justify-start items-start gap-2 flex"],($=[c("div",{className:"text-center text-gray-600 text-sm font-medium",children:C.fields[0].fields[0]}),c("span",v(w([["className","animate-spin"],(h0=[jC(20,20)],["children",b.Children.toArray(Array.from(h0))])])))],["children",b.Children.toArray(Array.from($))])]))),c("div",v(w([["className","justify-start items-start gap-2 flex"],(m0=[c("button",v(w([["className","justify-start items-center gap-1 flex text-red-600"],["onClick",Z=>{E(new Tr(1,[]))}],(j=[c("div",{className:"text-center text-sm font-medium",children:"Cancel"}),c("div",v(w([["className","w-4 h-4 justify-center items-center flex"],(O0=[jr(10,10)],["children",b.Children.toArray(Array.from(O0))])])))],["children",b.Children.toArray(Array.from(j))])])))],["children",b.Children.toArray(Array.from(m0))])])))],["children",b.Children.toArray(Array.from(Y))])])))],["children",b.Children.toArray(Array.from(f0))])]))));default:{const Z=l0=>{l0.preventDefault(),l0.stopPropagation()};return T(c("div",v(q(k(()=>H(D[0]?T(["className","border-gray-300 border-dashed border-2 rounded-md my-6 bg-blue-50 border-blue-300"]):T(["className","border-gray-300 border-dashed border-2 rounded-md my-6 hover:bg-gray-100"]),k(()=>{let l0,y0;return T((l0=[c("div",v(w([["className","flex flex-col items-center p-4"],["onDragEnter",_0=>{Z(_0),S(!0)}],["onDragLeave",_0=>{Z(_0),S(!1)}],["onDragOver",_0=>{Z(_0),S(!0)}],["onDrop",_0=>{let K;Z(_0),S(!1),M((K=_0,K.dataTransfer).files.item(0))}],(y0=q(k(()=>{let _0,K,b0,u0,A0,D0;return H((_0=C.fields[0],_0==null?T(T0()):(K=_0,T(c("div",v(w([["className","p-2 bg-red-50 rounded-md justify-start items-start gap-2 inline-flex w-full mb-4"],(b0=[c("div",v(w([["className","w-5 h-5 px-0.5 pt-0.5 pb-[3px] justify-center items-center flex"],(u0=[B9(16,15)],["children",b.Children.toArray(Array.from(u0))])]))),c("div",v(w([["className","grow shrink basis-0 flex-col justify-start items-start gap-2 inline-flex"],(A0=[c("div",v(w([["className","self-stretch text-red-800 text-sm font-normal"],(D0=q(k(()=>{let p0;const $0=P0=>c("span",{className:"font-medium",children:P0}),g0=P0=>c("span",{children:[P0]}),v0=c("a",{className:"underline",children:"sample CSV",href:K5,download:"import_users"});return T((p0=K.tag===1?w([$0("File is too large (over 10 MB). "),g0("Upload a "),$0("smaller file"),g0(".")]):K.tag===2?w([$0("File is empty. "),g0("Ensure your file contains data before uploading.")]):K.tag===3?w([$0("Too many rows (5000+). "),g0("Upload a "),$0("file with fewer rows"),g0(".")]):K.tag===4?w([$0("Invalid CSV: Missing header field(s). "),g0("Try using our "),v0,g0(".")]):K.tag===5?w([$0("Invalid CSV: Duplicate header fields. "),g0("Try using our "),v0,g0(".")]):K.tag===6?w([$0("Invalid CSV: Rows have different lengths. "),g0("Check for missing or extra columns.")]):K.tag===7?w([$0("Invalid CSV format. "),g0("Try using our "),v0,g0(".")]):w([$0("Unsupported file type. "),g0("Upload a "),$0(".csv file"),g0(".")]),c("p",{children:b.Children.toArray(Array.from(p0))})))})),["children",b.Children.toArray(Array.from(D0))])])))],["children",b.Children.toArray(Array.from(A0))])])))],["children",b.Children.toArray(Array.from(b0))])])))))),k(()=>{let p0;return H(T(c("div",v(w([["className","pt-2"],(p0=[WC(20,21)],["children",b.Children.toArray(Array.from(p0))])])))),k(()=>H(T(c("input",{type:"file",onChange:$0=>{const g0=$0.target.files;g0!=null&&g0.length>0&&M(g0.item(0))},className:"hidden",ref:N,accept:".csv"})),k(()=>H(T(c("span",{className:"text-gray-600 text-sm font-medium mt-3",children:"Drag and drop CSV file here"})),k(()=>H(T(c("button",{className:"rounded text-sm w-[120px] border px-3 py-2 mt-4 font-medium text-gray-700 bg-white hover:bg-gray-50",onClick:$0=>{qe(g0=>{g0.click()},Ft(N.current))},type:"button",children:b.Children.toArray(["Choose file"])})),k(()=>T(c("span",{className:"text-gray-500 text-xs font-normal mt-2 font-normal pb-2",children:"Maximum size: 10 MB"}))))))))))}))})),["children",b.Children.toArray(Array.from(y0))])])))],["children",b.Children.toArray(Array.from(l0))]))})))))))}}})),["children",b.Children.toArray(Array.from(s))])))),c("div",v(w([["className","flex flex-row justify-end gap-3"],(a=[c("button",v(w([(l="bg-white hover:bg-gray-50 rounded-md text-red-700 shadow-sm text-sm border border-gray-300 font-medium px-3 py-2 min-w-[120px]",["className",l]),["onClick",F=>{h()}],["type","button"],["children",b.Children.toArray(["Cancel import"])]]))),c("button",v(w([(u="inline-flex justify-center items-center gap-x-1 rounded-md text-white bg-primary-600 hover:enabled:bg-primary-700 text-sm min-w-[120px] border font-medium px-3 py-2 disabled:opacity-50",["className",u]),["onClick",F=>{C.tag===2&&m(C.fields[0])}],["type","button"],["disabled",!P],(d=["Map fields",U6(13,8)],["children",b.Children.toArray(Array.from(d))])])))],["children",b.Children.toArray(Array.from(a))])])))],["children",b.Children.toArray(Array.from(r))])])))],["children",b.Children.toArray(Array.from(t))])])))}class G1 extends W{constructor(t,r){super(),this.tag=t,this.fields=r}cases(){return["UploadingCsv","MappingColumns","MappingEmploymentBasis","Reviewing"]}}function sl(e){switch(e.tag){case 1:return"field mapping";case 2:return"value mapping";case 3:return"review";default:return"file upload"}}class V1 extends W{constructor(t,r){super(),this.tag=t,this.fields=r}cases(){return["Configuring","Importing"]}}function qo(e){return e.tag===1?"requested":sl(e.fields[0])}function zC(){return[new V1(0,[new G1(0,[void 0])]),C0()]}function YC(e,t,r,n){const i=(j,O0)=>b6(w([Pe(t,new re(3,[{From:qo(j),To:qo(O0)}])),em(e)]));let o,s,a,l,u,d,f,p,h,m,g,y,_,C,E,M,O,R,D,S,x,A,N,P,F,V,i0,J,X,L,G,U,f0,Y,$,h0,m0;if(r.tag===1)switch(r.fields[0].tag){case 1:{n.tag===0&&n.fields[0].tag===2?(o=13,V=n.fields[0].fields[0][1],i0=n.fields[0].fields[0][0],J=n.fields[0].fields[0][2],X=r.fields[0].fields[0]):o=14;break}case 2:{r.fields[0].fields[0].tag===0?n.tag===0&&n.fields[0].tag===1?(o=17,h0=n.fields[0].fields[0][0],m0=r.fields[0].fields[0].fields[0]):o=18:r.fields[0].fields[0].fields[1]!=null?n.tag===0&&n.fields[0].tag===1?(o=16,U=r.fields[0].fields[0].fields[0],f0=n.fields[0].fields[0][0],Y=r.fields[0].fields[0].fields[1],$=n.fields[0].fields[0][1]):o=18:n.tag===0&&n.fields[0].tag===1?(o=15,L=r.fields[0].fields[0].fields[0],G=n.fields[0].fields[0][0]):o=18;break}default:n.tag===0&&n.fields[0].tag===3?n.fields[0].fields[0][2]!=null?(o=11,A=n.fields[0].fields[0][1],N=n.fields[0].fields[0][0],P=n.fields[0].fields[0][2][0],F=n.fields[0].fields[0][2][1]):(o=10,S=n.fields[0].fields[0][1],x=n.fields[0].fields[0][0]):o=12}else switch(r.fields[0].tag){case 1:{r.fields[0].fields[1]!=null?n.tag===0&&n.fields[0].tag===1?(o=4,p=r.fields[0].fields[0],h=n.fields[0].fields[0][0],m=r.fields[0].fields[1],g=n.fields[0].fields[0][1]):o=5:n.tag===0&&n.fields[0].tag===1?(o=3,d=r.fields[0].fields[0],f=n.fields[0].fields[0][0]):o=5;break}case 2:{n.tag===0&&n.fields[0].tag===2?(o=6,y=n.fields[0].fields[0][1],_=n.fields[0].fields[0][0],C=n.fields[0].fields[0][2],E=r.fields[0].fields[0]):o=7;break}case 3:{n.tag===0&&n.fields[0].tag===3?(o=8,n.fields[0].fields[0][0],M=n.fields[0].fields[0][1],O=n.fields[0].fields[0][2],R=r.fields[0].fields[1],D=r.fields[0].fields[0]):o=9;break}default:n.tag===0&&n.fields[0].tag===0?n.fields[0].fields[0]!=null?(o=1,a=r.fields[0].fields[0],l=n.fields[0].fields[0][0],u=n.fields[0].fields[0][1]):(o=0,s=r.fields[0].fields[0]):o=2}switch(o){case 0:{const j=new V1(0,[new G1(1,[[s,new Me(0,[void 0])]])]);return[j,i(n,j)]}case 1:{const j=e0(a,l)?new V1(0,[new G1(1,[[l,u]])]):new V1(0,[new G1(1,[[a,new Me(0,[void 0])]])]);return[j,i(n,j)]}case 2:return[n,C0()];case 3:{const j=new V1(0,[new G1(3,[[f,d,void 0]])]);return[j,i(n,j)]}case 4:{const j=new V1(0,[new G1(2,[[h,p,m,g.tag===1&&g.fields[0].tag===1&&e0(m,g.fields[0].fields[1])?g.fields[0].fields[2]:void 0]])]);return[j,i(n,j)]}case 5:return[n,C0()];case 6:{const j=new V1(0,[new G1(3,[[_,y,[C,E]]])]);return[j,i(n,j)]}case 7:return[n,C0()];case 8:{const j=new V1(1,[[D,M,O,R]]);return[j,i(n,j)]}case 9:return[n,C0()];case 10:{const j=new V1(0,[new G1(1,[[x,new Me(1,[new tt(0,[S])])]])]);return[j,i(n,j)]}case 11:{const j=new V1(0,[new G1(2,[[N,A,P,F]])]);return[j,i(n,j)]}case 12:return[n,C0()];case 13:{const j=new V1(0,[new G1(1,[[i0,new Me(1,[new tt(1,[V,J,X])])]])]);return[j,i(n,j)]}case 14:return[n,C0()];case 15:{const j=new V1(0,[new G1(0,[[G,new Me(1,[new tt(0,[L])])]])]);return[j,i(n,j)]}case 16:{const j=new V1(0,[new G1(0,[[f0,$.tag===1?$.fields[0].tag===1?e0(U,$.fields[0].fields[0])&&e0(Y,$.fields[0].fields[1])?$:new Me(1,[new tt(1,[U,Y,void 0])]):new Me(1,[new tt(1,[U,Y,void 0])]):new Me(1,[new tt(1,[U,Y,void 0])])]])]);return[j,i(n,j)]}case 17:{const j=new V1(0,[new G1(0,[[h0,new Me(0,[m0])]])]);return[j,i(n,j)]}default:return[n,C0()]}}function ZC(e,t,r){let n,i,o,s,a,l,u,d,f,p,h;return Zt(w([new S1(3,[e]),new S1(4,[t]),new S1(5,[[Xt(s0(new Jt(2,["fixed inset-0 bg-gray-500/50"]))),c("div",v(w([["className","fixed inset-0 z-10 w-screen overflow-y-auto"],(n=[c("div",v(w([["className","flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0"],(i=[Kt(w([new d2(1,["relative transform overflow-hidden rounded-lg bg-white px-4 pt-5 pb-4 text-left shadow-xl sm:my-8 sm:w-full sm:max-w-lg sm:p-6"]),new d2(2,[[c("div",v(w([["className","absolute top-0 right-0 hidden pt-4 pr-4 sm:block"],(o=[c("button",v(w([["type","button"],["onClick",m=>{t()}],["className","text-gray-600"],(s=[z2(24,24)],["children",b.Children.toArray(Array.from(s))])])))],["children",b.Children.toArray(Array.from(o))])]))),c("div",v(w([["className","sm:flex sm:items-start"],(a=[c("div",v(w([["className","mx-auto flex size-12 shrink-0 items-center justify-center sm:mx-0 sm:size-10"],(l=[P_([])],["children",b.Children.toArray(Array.from(l))])]))),c("div",v(w([["className","mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left"],(u=[P9(w([new Qr(2,["text-gray-900 text-lg font-bold"]),new Qr(3,[["Cancel import"]])])),c("div",v(w([["className","mt-2 text-sm text-gray-500 leading-tight"],(d=[c("p",{children:["You’re about to cancel your import. All changes will be discarded."]}),c("br",{}),c("p",{children:["Are you sure you want to cancel and exit?"]})],["children",b.Children.toArray(Array.from(d))])])))],["children",b.Children.toArray(Array.from(u))])])))],["children",b.Children.toArray(Array.from(a))])]))),c("div",v(w([["className","mt-5 sm:mt-4 sm:flex sm:flex-row-reverse"],(f=[c("button",v(w([["type","button"],["onClick",m=>{r()}],(p="inline-flex w-full justify-center rounded-md bg-red-600 px-3 py-2 text-sm font-medium text-white shadow-xs hover:bg-red-500 sm:ml-3 sm:w-auto",["className",p]),["children","Cancel import and exit"]]))),c("button",v(w([["type","button"],["onClick",m=>{t()}],(h="mt-3 inline-flex w-full justify-center rounded-md bg-white px-3 py-2 text-gray-700 text-sm font-medium ring-1 shadow-xs ring-gray-300 ring-inset hover:bg-gray-50 sm:mt-0 sm:w-auto",["className",h]),["children","Continue import"]])))],["children",b.Children.toArray(Array.from(f))])])))]])]))],["children",b.Children.toArray(Array.from(i))])])))],["children",b.Children.toArray(Array.from(n))])])))]])]))}class J5 extends W{constructor(t,r){super(),this.tag=t,this.fields=r}cases(){return["HasNotStartedYet","InProgress","Resolved","Failed"]}}function KC(e,t){let r;const n=Vc();return r=b.useRef(n),ds(()=>l6(()=>{Uc(r.current)})),fs(i=>{jc(r.current)||Lt(z.Delay(()=>z.TryWith(z.Delay(()=>(t(new J5(1,[])),z.Bind(e(i),o=>(t(new J5(2,[o])),z.Zero())))),o=>(t(new J5(3,[o])),z.Zero()))),r.current)})}function JC(e,t,r,n,i,o,s){let a,l,u,d,f,p,h;return wn((a=[()=>C_(e,t,r,n,i),m=>{let g,y,_,C;switch(m.tag){case 1:case 0:{g=3;break}case 3:{g=2,C=m.fields[0];break}default:m.fields[0].tag===1?(g=1,_=m.fields[0].fields[0]):(g=0,y=m.fields[0].fields[0])}switch(g){case 0:{o(y);break}case 1:{s(_);break}case 2:{s(i1(C));break}}}],KC(a[0],a[1]))),c("div",v(w([["className","fixed inset-0 z-100 w-screen overflow-y-auto bg-white"],(l=[c("div",v(w([["className","flex-col w-full h-full justify-center items-center gap-2.5 inline-flex overflow-hidden"],(u=[c("div",v(w([["className","self-stretch h-[118px] flex-col justify-center items-center gap-8 flex"],(d=[c("div",v(w([["className","relative"],(f=[B_([])],["children",b.Children.toArray(Array.from(f))])]))),c("div",v(w([["className","flex-col justify-start items-center gap-6 flex"],(p=[c("div",v(w([["className","w-[140px] h-1.5 relative bg-blue-100 rounded-[5px] overflow-hidden"],(h=[c("div",{style:{animation:"progressBar 2s linear infinite"},className:"h-1.5 top-0 absolute bg-gradient-to-r from-[#a650ff] to-[#0095f2] rounded-[5px]"})],["children",b.Children.toArray(Array.from(h))])])))],["children",b.Children.toArray(Array.from(p))])])))],["children",b.Children.toArray(Array.from(d))])])))],["children",b.Children.toArray(Array.from(u))])])))],["children",b.Children.toArray(Array.from(l))])])))}class ye extends W{constructor(t,r){super(),this.tag=t,this.fields=r}cases(){return["Key","As","Appear","Show","ClassName","Enter","EnterFrom","EnterTo","Leave","LeaveFrom","LeaveTo","Children"]}}function XC(e){return c(O9,Ge(e,1))}class st extends E0{constructor(t,r,n){super(),this.Type=t,this.Title=r,this.Message=n}}class at extends W{constructor(t,r){super(),this.tag=t,this.fields=r}cases(){return["Success","Failure","InProgress"]}}function QC(e,t){let r,n,i,o,s,a,l,u;return XC(w([new ye(1,["div"]),new ye(4,["pointer-events-auto w-full max-w-sm overflow-hidden rounded-lg bg-white shadow-lg ring-1 ring-black ring-opacity-5"]),new ye(3,[!0]),new ye(5,["transform ease-out duration-300 transition"]),new ye(6,["translate-y-2 opacity-0 sm:translate-y-0 sm:translate-x-2"]),new ye(7,["translate-y-0 opacity-100 sm:translate-x-0"]),new ye(8,["transition ease-in duration-100"]),new ye(9,["opacity-100"]),new ye(10,["opacity-0"]),new ye(11,[[c("div",v(w([["key","1"],(r=[c("div",v(w([["className","p-4"],(n=[c("div",v(w([["className","flex items-start"],(i=[c("div",v(w([["className","flex-shrink-0"],(o=q(k(()=>{const d=t.Type;return d.tag===1?T(V_([])):d.tag===2?T(U_([])):T(H_([]))})),["children",b.Children.toArray(Array.from(o))])]))),c("div",v(w([["className","ml-3 w-0 flex-1 pt-0.5"],(s=[c("p",{className:"text-sm font-medium text-gray-900",children:t.Title}),c("p",{className:"mt-1 text-sm text-gray-500",children:t.Message})],["children",b.Children.toArray(Array.from(s))])]))),c("div",v(w([["className","ml-4 flex flex-shrink-0"],(a=[c("button",v(w([["type","button"],(l="inline-flex rounded-md bg-white text-gray-400 hover:text-gray-500 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-offset-2",["className",l]),["onClick",d=>{e()}],(u=[jr(10,10)],["children",b.Children.toArray(Array.from(u))])])))],["children",b.Children.toArray(Array.from(a))])])))],["children",b.Children.toArray(Array.from(i))])])))],["children",b.Children.toArray(Array.from(n))])])))],["children",b.Children.toArray(Array.from(r))])])))]])]))}function ex(e){const t=document.getElementById("workspace-toasts-container"),r=Ts(),n=QC(()=>{document.getElementById(r).remove()},e),i=document.createElement("div");q4(n,i);const o=i.children[0];o.id=r,t.appendChild(o)}const tx=3e4;function rx(e,t,r,n,i){const o=n.fields[0],s=()=>z.Delay(()=>z.Bind(cs(tx),()=>z.Bind(t(r),a=>{let l,u,d,f;const p=a;return p.tag!==1&&(p.fields[0].tag!==1||(p.fields[0].fields[0].tag===1?(e(new st(new at(1,[]),"We found a duplicate user",`"${w0(i.fields[0],w0(p.fields[0].fields[0].fields[0]-2,o).fields[0])}" already exists in our system. This user was skipped during the import.`)),!1):p.fields[0].fields[0].tag===2?(l=p.fields[0].fields[0].fields[0].DuplicateEmailCount>0,u=p.fields[0].fields[0].fields[0].OtherFailuresCount>0,e(l?u?new st(new at(1,[]),"We found multiple import errors",(d="One or more of the rows experienced errors during import. These rows were skipped during the import.",d)):new st(new at(1,[]),`We found ${p.fields[0].fields[0].fields[0].DuplicateEmailCount} duplicate users`,(f="One or more of the users you’re trying to add already exist in our system. These users were skipped during the import.",f)):new st(new at(1,[]),"We found multiple import errors",(d="One or more of the rows experienced errors during import. These rows were skipped during the import.",d))),!1):(e(new st(new at(0,[]),p.fields[0].fields[0].fields[0]===1?"Successfully added 1 user":`Successfully added ${p.fields[0].fields[0].fields[0]} users`,"If you don’t see any new users, try refreshing this page.")),!1)))?z.Bind(s(),()=>z.Return(void 0)):z.Zero()})));e(new st(new at(2,[]),o.length===1?"Importing 1 user":`Importing ${o.length} users`,"This might take a while. We’ll let you know via email when it’s finished.")),Lt(s())}class I1 extends W{constructor(t,r){super(),this.tag=t,this.fields=r}cases(){return["Completed","Active","Disabled"]}}class vr extends E0{constructor(t,r,n,i){super(),this.UploadingCsv=t,this.MappingColumns=r,this.MappingEmploymentBasis=n,this.Reviewing=i}}function Go(){ha(w(["admin","app","users"]))}function al(e){ha(w(["admin","app","oops"]))}function nx(e){switch(e.tag){case 1:return new vr(new I1(0,[]),new I1(1,[]),new I1(2,[]),new I1(2,[]));case 2:return new vr(new I1(0,[]),new I1(0,[]),new I1(1,[]),new I1(2,[]));case 3:return new vr(new I1(0,[]),new I1(0,[]),new I1(0,[]),new I1(1,[]));default:return new vr(new I1(1,[]),new I1(2,[]),new I1(2,[]),new I1(2,[]))}}function ix(e,t,r,n,i,o){switch(o.tag){case 1:{const s=o.fields[0],a=s[1].tag===1?s[1].fields[0].tag===1?[E7(s[1].fields[0].fields[0],s[1].fields[0].fields[1]),s[0].HeaderRow,s[0].DataRows]:[E7(s[1].fields[0].fields[0],void 0),s[0].HeaderRow,s[0].DataRows]:[s[1].fields[0],s[0].HeaderRow,s[0].DataRows];return c(l_,{existingMappings:w3(a[0]),headerRow:a[1],dataRows:a[2],next:l=>{let u;r(new y2(0,[(u=l,new pr(1,[u[0],u[1]]))]))},back:l=>{r(new y2(1,[new m5(2,[l])]))},sendAnalytics:i})}case 2:{const s=Hg(o.fields[0][0].DataRows,o.fields[0][2]);return c(w_,{existingMappings:w3(o.fields[0][3]),employmentBasisColumn:s,next:a=>{r(new y2(0,[new pr(2,[a])]))},back:a=>{r(new y2(1,[new m5(1,[a])]))}})}case 3:return c(K_,{apiCallAsync:e,dataRows:o.fields[0][0].DataRows,baseColumnMappings:o.fields[0][1],employmentBasis:w3(o.fields[0][2]),next:s=>{let a;r(new y2(0,[(a=s,new pr(3,[a[0],a[1]]))]))},back:()=>{r(new y2(1,[new m5(0,[])]))},onError:s=>{al()},sendAnalytics:i});default:{const s=C1(a=>a[0],o.fields[0]);return c(GC,{existingCsvFile:w3(s),next:a=>{r(new y2(0,[new pr(0,[a])]))},cancel:t,markDirty:n,sendAnalytics:i})}}}function br(e,t){let r,n,i;switch(t.tag){case 1:return c("div",v(w([["className","text-sm font-medium border-b-2 border-primary-600 pt-1 pb-3 text-primary-600 text-nowrap"],(r=[c("span",{children:e})],["children",b.Children.toArray(Array.from(r))])])));case 2:return c("div",v(w([["className","text-sm font-medium pt-1 pb-3 text-gray-500 text-nowrap"],(n=[c("span",{children:e})],["children",b.Children.toArray(Array.from(n))])])));default:return c("div",v(w([["className","text-sm font-medium pt-1 pb-3 text-emerald-700 gap-2 inline-flex text-nowrap"],(i=[jn(20,20),c("span",{children:e})],["children",b.Children.toArray(Array.from(i))])])))}}function ox(e){let t,r,n,i,o,s,a,l;const u=(t=Ts(),t);l=O=>zs(e.backendUrl,u,O),a=O=>{Lt(l(O))},s=b.useCallback(a,[]),wn(()=>{s(new re(0,[{Section:"user import"}]))});const d=G2(()=>q2(zC,(O,R)=>YC(()=>{window.scrollTo(0,0)},s,O,R),(O,R)=>{}),void 0,void 0),f=d[0],p=b.useState(!1),h=p[0],m=p[1],g=b.useState(!1),y=g[0],_=b.useCallback(O=>{O.preventDefault(),O.returnValue=!0},[]),C=()=>{window.removeEventListener("beforeunload",_)};as(()=>(y?window.addEventListener("beforeunload",_):C(),{Dispose(){C()}}),[y]);let E;if(f.tag===0){const O=f.fields[0],R=()=>{h||m(!0)},D=nx(O),S=ix(x=>hh(e.backendUrl,x),R,d[1],g[1],s,O);E=c("div",v(w([["className","min-w-[640px] flex flex-col h-full"],(r=[ZC(h,()=>{h&&m(!1)},()=>{h&&(s(new re(2,[{From:sl(O)}])),C(),Go())}),c("div",v(w([["className","flex flex-row justify-between px-12 pt-8 pb-4"],(n=[c("span",{className:"font-['BR Sonoma'] text-gray-900 font-bold text-lg",children:"Import Users from CSV"}),c("button",v(w([(i="bg-white hover:bg-gray-50 rounded-md text-red-700 shadow-sm text-sm border border-gray-300 font-medium px-3 py-2 min-w-[120px]",["className",i]),["onClick",x=>{R()}],["type","button"],["children",b.Children.toArray(["Cancel import"])]])))],["children",b.Children.toArray(Array.from(n))])]))),c("div",v(w([["className","flex flex-row items-center px-12 gap-2 border-b border-gray-200"],(o=[br("1. Upload CSV",D.UploadingCsv),c("hr",{className:"w-16 pt-1.5"}),br("2. Map fields",D.MappingColumns),c("hr",{className:"w-16 pt-1.5"}),br("3. Map values",D.MappingEmploymentBasis),c("hr",{className:"w-16 pt-1.5"}),br("4. Review",D.Reviewing)],["children",b.Children.toArray(Array.from(o))])]))),S],["children",b.Children.toArray(Array.from(r))])])))}else{const O=f.fields[0][3],R=f.fields[0][0],D=f.fields[0][1];E=JC(S=>mh(e.backendUrl,S),R,D,f.fields[0][2],O,S=>{s(new re(8,[{ImportId:S,UsersInvited:O.tag!==1}])),C();const x=[S,R,D.Email];rx(A=>{ex(A)},A=>ph(e.backendUrl,A),x[0],x[1],x[2]),Go()},S=>{s(new re(9,[{Reason:S}])),C(),al()})}const M=[c("style",{children:[Z4]}),E];return c(J0,{},...M)}function sx(){F4(e=>c(ox,e),"apollo-import-workspace-wizard")}F4(e=>c(uc,e),"apollo-import-workspace-app");vg();sx();
|
|
79
|
+
If errors are detected during import, you can download a CSV file that lists all the rows with issues.`,["children",l])])))],["children",b.Children.toArray(Array.from(n))])])))]])))],["children",b.Children.toArray(Array.from(r))])])))]])]))}function jC(e,t){let r,n,i;return c("svg",v(w([["fill","none"],["height",t],["width",e],["viewBox","0 0 "+e+" "+t],["xmlns","http://www.w3.org/2000/svg"],(r=w([c("path",v(w([(n="M18 10C18 14.4183 14.4183 18 10 18C5.58172 18 2 14.4183 2 10C2 5.58172 5.58172 2 10 2C14.4183 2 18 5.58172 18 10ZM3.99743 10C3.99743 13.3151 6.68487 16.0026 10 16.0026C13.3151 16.0026 16.0026 13.3151 16.0026 10C16.0026 6.68487 13.3151 3.99743 10 3.99743C6.68487 3.99743 3.99743 6.68487 3.99743 10Z",["d",n]),["fill","#D6E2FC"]]))),c("path",v(w([(i="M10 3C10 2.44772 10.4494 1.99356 10.9974 2.06242C11.7053 2.15137 12.3996 2.3348 13.0615 2.60896C14.0321 3.011 14.914 3.60028 15.6569 4.34315C16.3997 5.08602 16.989 5.96793 17.391 6.93853C17.6652 7.60043 17.8486 8.29473 17.9376 9.0026C18.0064 9.55057 17.5523 10 17 10C16.4477 10 16.0085 9.54925 15.9169 9.00462C15.842 8.55939 15.7169 8.12298 15.5433 7.7039C15.2417 6.97595 14.7998 6.31451 14.2426 5.75736C13.6855 5.20021 13.0241 4.75825 12.2961 4.45672C11.877 4.28313 11.4406 4.15804 10.9954 4.08314C10.4508 3.99152 10 3.55228 10 3Z",["d",i]),["fill","#2E66F7"]])))]),["children",b.Children.toArray(Array.from(r))])])))}function WC(e,t){let r,n;return c("svg",v(w([["fill","none"],["height",t],["width",e],["viewBox","0 0 "+e+" "+t],["xmlns","http://www.w3.org/2000/svg"],(r=w([c("path",v(w([(n="M17 21H3C1.346 21 0 19.654 0 18V14H2V18C2 18.551 2.448 19 3 19H17C17.552 19 18 18.551 18 18V14H20V18C20 19.654 18.654 21 17 21Z",["d",n]),["fill","#9CA3AF"]]))),c("path",{d:"M16.414 7L10 0.585999L3.586 7L5 8.414L9 4.414V15H11V4.414L15 8.414L16.414 7Z",fill:"#9CA3AF"})]),["children",b.Children.toArray(Array.from(r))])])))}function qC(e,t){Lt(z.Delay(()=>z.Bind(cs(1e3),()=>(BC(r=>{t(new Tr(0,[new xn(1,[r])]))},e),z.Zero()))))}const K5=(()=>{const e=new Blob(["First name,Last name,Email,Mobile phone,Employment basis"],{type:"text/csv;charset=utf-8;"});return window.URL.createObjectURL(e)})();function GC(e){let t,r,n,i,o,s,a,l,u,d;const f=e.sendAnalytics,p=e.markDirty,h=e.cancel,m=e.next,g=e.existingCsvFile;let y;const _=HC(g);y=G2(()=>q2(()=>_,(F,V)=>VC(p,f,F,V),(F,V)=>{}),void 0,void 0);const C=y[0],E=y[1],M=F=>{E(new Tr(0,[new xn(0,[[new ya(F.name),V=>{qC(F,V)}]])]))},O=b.useState(!1),R=O[1],D=b.useState(!1),S=D[1],x=b.useState(!1),A=x[1],N=b.useRef(void 0),P=C.tag===2;return c("div",v(w([["className","bg-gray-50 h-full"],(t=[c("div",v(w([["className","max-w-[640px] flex flex-col mx-12 mt-8 mb-12"],(r=[nl(K5,O[0],()=>{R(!1)}),UC(x[0],()=>{A(!1)}),Hn("Upload CSV"),Vn("Download and use our template, or upload your own CSV to get started."),c("a",v(w([["className","flex flex-row items-end gap-1 text-primary-600"],["href",K5],["download","import_users"],(n=[c("span",{className:"text-sm font-medium pt-2",children:"Download sample CSV template"}),c("span",v(w([["className","pb-0.5"],(i=[rl(16,16)],["children",b.Children.toArray(Array.from(i))])])))],["children",b.Children.toArray(Array.from(n))])]))),c("div",v(w([["className","flex flex-row pt-3 gap-2"],(o=[R3("What kind of data do I need?",()=>{R(!0)}),R3("Frequently asked questions",()=>{A(!0)})],["children",b.Children.toArray(Array.from(o))])]))),c("div",v(s0((s=q(k(()=>{let F,V,i0,J,X,L,G,U,f0,Y,$,h0,m0,j,O0;switch(C.tag){case 2:{let Z;const l0=C.fields[0].SizeInBytes/1024/1024;return Z=l0<.01?.01:l0,T(c("div",v(w([["className","border border-emerald-200 border-2 rounded-md my-6 bg-emerald-50 p-6"],(F=[c("div",v(w([["className","justify-between items-center inline-flex w-full"],(V=[c("div",v(w([["className","justify-start items-start gap-2 flex"],(i0=[c("div",{className:"text-center text-gray-600 text-sm font-medium",children:C.fields[0].Name.fields[0]}),c("span",v(w([["className","text-emerald-700"],(J=[jn(20,20)],["children",b.Children.toArray(Array.from(J))])])))],["children",b.Children.toArray(Array.from(i0))])]))),c("div",v(w([["className","justify-start items-start gap-3 flex"],(X=[c("div",{className:"text-center text-gray-500 text-sm font-medium",children:(L=J4("{0:F2}",Z),O2(Ve("%s MB"))(L))}),c("button",v(w([["className","justify-start items-center gap-1 flex text-red-600"],["onClick",y0=>{E(new Tr(2,[]))}],(G=[c("div",{className:"text-center text-sm font-medium",children:"Remove"}),c("div",v(w([["className","w-4 h-4 justify-center items-center flex"],(U=[jr(10,10)],["children",b.Children.toArray(Array.from(U))])])))],["children",b.Children.toArray(Array.from(G))])])))],["children",b.Children.toArray(Array.from(X))])])))],["children",b.Children.toArray(Array.from(V))])]))),c("div",{className:"text-gray-500 text-xs font-normal",children:`${C.fields[0].DataRows.fields[0].length+1} rows`})],["children",b.Children.toArray(Array.from(F))])]))))}case 1:return T(c("div",v(w([["className","border-gray-300 border-dashed border-2 rounded-md my-6"],(f0=[c("div",v(w([["className","p-6 justify-between items-center inline-flex w-full"],(Y=[c("div",v(w([["className","justify-start items-start gap-2 flex"],($=[c("div",{className:"text-center text-gray-600 text-sm font-medium",children:C.fields[0].fields[0]}),c("span",v(w([["className","animate-spin"],(h0=[jC(20,20)],["children",b.Children.toArray(Array.from(h0))])])))],["children",b.Children.toArray(Array.from($))])]))),c("div",v(w([["className","justify-start items-start gap-2 flex"],(m0=[c("button",v(w([["className","justify-start items-center gap-1 flex text-red-600"],["onClick",Z=>{E(new Tr(1,[]))}],(j=[c("div",{className:"text-center text-sm font-medium",children:"Cancel"}),c("div",v(w([["className","w-4 h-4 justify-center items-center flex"],(O0=[jr(10,10)],["children",b.Children.toArray(Array.from(O0))])])))],["children",b.Children.toArray(Array.from(j))])])))],["children",b.Children.toArray(Array.from(m0))])])))],["children",b.Children.toArray(Array.from(Y))])])))],["children",b.Children.toArray(Array.from(f0))])]))));default:{const Z=l0=>{l0.preventDefault(),l0.stopPropagation()};return T(c("div",v(q(k(()=>H(D[0]?T(["className","border-gray-300 border-dashed border-2 rounded-md my-6 bg-blue-50 border-blue-300"]):T(["className","border-gray-300 border-dashed border-2 rounded-md my-6 hover:bg-gray-100"]),k(()=>{let l0,y0;return T((l0=[c("div",v(w([["className","flex flex-col items-center p-4"],["onDragEnter",_0=>{Z(_0),S(!0)}],["onDragLeave",_0=>{Z(_0),S(!1)}],["onDragOver",_0=>{Z(_0),S(!0)}],["onDrop",_0=>{let K;Z(_0),S(!1),M((K=_0,K.dataTransfer).files.item(0))}],(y0=q(k(()=>{let _0,K,b0,u0,A0,D0;return H((_0=C.fields[0],_0==null?T(T0()):(K=_0,T(c("div",v(w([["className","p-2 bg-red-50 rounded-md justify-start items-start gap-2 inline-flex w-full mb-4"],(b0=[c("div",v(w([["className","w-5 h-5 px-0.5 pt-0.5 pb-[3px] justify-center items-center flex"],(u0=[B9(16,15)],["children",b.Children.toArray(Array.from(u0))])]))),c("div",v(w([["className","grow shrink basis-0 flex-col justify-start items-start gap-2 inline-flex"],(A0=[c("div",v(w([["className","self-stretch text-red-800 text-sm font-normal"],(D0=q(k(()=>{let p0;const $0=P0=>c("span",{className:"font-medium",children:P0}),g0=P0=>c("span",{children:[P0]}),v0=c("a",{className:"underline",children:"sample CSV",href:K5,download:"import_users"});return T((p0=K.tag===1?w([$0("File is too large (over 10 MB). "),g0("Upload a "),$0("smaller file"),g0(".")]):K.tag===2?w([$0("File is empty. "),g0("Ensure your file contains data before uploading.")]):K.tag===3?w([$0("Too many rows (5000+). "),g0("Upload a "),$0("file with fewer rows"),g0(".")]):K.tag===4?w([$0("Invalid CSV: Missing header field(s). "),g0("Try using our "),v0,g0(".")]):K.tag===5?w([$0("Invalid CSV: Duplicate header fields. "),g0("Try using our "),v0,g0(".")]):K.tag===6?w([$0("Invalid CSV: Rows have different lengths. "),g0("Check for missing or extra columns.")]):K.tag===7?w([$0("Invalid CSV format. "),g0("Try using our "),v0,g0(".")]):w([$0("Unsupported file type. "),g0("Upload a "),$0(".csv file"),g0(".")]),c("p",{children:b.Children.toArray(Array.from(p0))})))})),["children",b.Children.toArray(Array.from(D0))])])))],["children",b.Children.toArray(Array.from(A0))])])))],["children",b.Children.toArray(Array.from(b0))])])))))),k(()=>{let p0;return H(T(c("div",v(w([["className","pt-2"],(p0=[WC(20,21)],["children",b.Children.toArray(Array.from(p0))])])))),k(()=>H(T(c("input",{type:"file",onChange:$0=>{const g0=$0.target.files;g0!=null&&g0.length>0&&M(g0.item(0))},className:"hidden",ref:N,accept:".csv"})),k(()=>H(T(c("span",{className:"text-gray-600 text-sm font-medium mt-3",children:"Drag and drop CSV file here"})),k(()=>H(T(c("button",{className:"rounded text-sm w-[120px] border px-3 py-2 mt-4 font-medium text-gray-700 bg-white hover:bg-gray-50",onClick:$0=>{qe(g0=>{g0.click()},Ft(N.current))},type:"button",children:b.Children.toArray(["Choose file"])})),k(()=>T(c("span",{className:"text-gray-500 text-xs font-normal mt-2 font-normal pb-2",children:"Maximum size: 10 MB"}))))))))))}))})),["children",b.Children.toArray(Array.from(y0))])])))],["children",b.Children.toArray(Array.from(l0))]))})))))))}}})),["children",b.Children.toArray(Array.from(s))])))),c("div",v(w([["className","flex flex-row justify-end gap-3"],(a=[c("button",v(w([(l="bg-white hover:bg-gray-50 rounded-md text-red-700 shadow-sm text-sm border border-gray-300 font-medium px-3 py-2 min-w-[120px]",["className",l]),["onClick",F=>{h()}],["type","button"],["children",b.Children.toArray(["Cancel import"])]]))),c("button",v(w([(u="inline-flex justify-center items-center gap-x-1 rounded-md text-white bg-primary-600 hover:enabled:bg-primary-700 text-sm min-w-[120px] border font-medium px-3 py-2 disabled:opacity-50",["className",u]),["onClick",F=>{C.tag===2&&m(C.fields[0])}],["type","button"],["disabled",!P],(d=["Map fields",U6(13,8)],["children",b.Children.toArray(Array.from(d))])])))],["children",b.Children.toArray(Array.from(a))])])))],["children",b.Children.toArray(Array.from(r))])])))],["children",b.Children.toArray(Array.from(t))])])))}class G1 extends W{constructor(t,r){super(),this.tag=t,this.fields=r}cases(){return["UploadingCsv","MappingColumns","MappingEmploymentBasis","Reviewing"]}}function sl(e){switch(e.tag){case 1:return"field mapping";case 2:return"value mapping";case 3:return"review";default:return"file upload"}}class V1 extends W{constructor(t,r){super(),this.tag=t,this.fields=r}cases(){return["Configuring","Importing"]}}function qo(e){return e.tag===1?"requested":sl(e.fields[0])}function zC(){return[new V1(0,[new G1(0,[void 0])]),C0()]}function YC(e,t,r,n){const i=(j,O0)=>b6(w([Pe(t,new re(3,[{From:qo(j),To:qo(O0)}])),em(e)]));let o,s,a,l,u,d,f,p,h,m,g,y,_,C,E,M,O,R,D,S,x,A,N,P,F,V,i0,J,X,L,G,U,f0,Y,$,h0,m0;if(r.tag===1)switch(r.fields[0].tag){case 1:{n.tag===0&&n.fields[0].tag===2?(o=13,V=n.fields[0].fields[0][1],i0=n.fields[0].fields[0][0],J=n.fields[0].fields[0][2],X=r.fields[0].fields[0]):o=14;break}case 2:{r.fields[0].fields[0].tag===0?n.tag===0&&n.fields[0].tag===1?(o=17,h0=n.fields[0].fields[0][0],m0=r.fields[0].fields[0].fields[0]):o=18:r.fields[0].fields[0].fields[1]!=null?n.tag===0&&n.fields[0].tag===1?(o=16,U=r.fields[0].fields[0].fields[0],f0=n.fields[0].fields[0][0],Y=r.fields[0].fields[0].fields[1],$=n.fields[0].fields[0][1]):o=18:n.tag===0&&n.fields[0].tag===1?(o=15,L=r.fields[0].fields[0].fields[0],G=n.fields[0].fields[0][0]):o=18;break}default:n.tag===0&&n.fields[0].tag===3?n.fields[0].fields[0][2]!=null?(o=11,A=n.fields[0].fields[0][1],N=n.fields[0].fields[0][0],P=n.fields[0].fields[0][2][0],F=n.fields[0].fields[0][2][1]):(o=10,S=n.fields[0].fields[0][1],x=n.fields[0].fields[0][0]):o=12}else switch(r.fields[0].tag){case 1:{r.fields[0].fields[1]!=null?n.tag===0&&n.fields[0].tag===1?(o=4,p=r.fields[0].fields[0],h=n.fields[0].fields[0][0],m=r.fields[0].fields[1],g=n.fields[0].fields[0][1]):o=5:n.tag===0&&n.fields[0].tag===1?(o=3,d=r.fields[0].fields[0],f=n.fields[0].fields[0][0]):o=5;break}case 2:{n.tag===0&&n.fields[0].tag===2?(o=6,y=n.fields[0].fields[0][1],_=n.fields[0].fields[0][0],C=n.fields[0].fields[0][2],E=r.fields[0].fields[0]):o=7;break}case 3:{n.tag===0&&n.fields[0].tag===3?(o=8,n.fields[0].fields[0][0],M=n.fields[0].fields[0][1],O=n.fields[0].fields[0][2],R=r.fields[0].fields[1],D=r.fields[0].fields[0]):o=9;break}default:n.tag===0&&n.fields[0].tag===0?n.fields[0].fields[0]!=null?(o=1,a=r.fields[0].fields[0],l=n.fields[0].fields[0][0],u=n.fields[0].fields[0][1]):(o=0,s=r.fields[0].fields[0]):o=2}switch(o){case 0:{const j=new V1(0,[new G1(1,[[s,new Me(0,[void 0])]])]);return[j,i(n,j)]}case 1:{const j=e0(a,l)?new V1(0,[new G1(1,[[l,u]])]):new V1(0,[new G1(1,[[a,new Me(0,[void 0])]])]);return[j,i(n,j)]}case 2:return[n,C0()];case 3:{const j=new V1(0,[new G1(3,[[f,d,void 0]])]);return[j,i(n,j)]}case 4:{const j=new V1(0,[new G1(2,[[h,p,m,g.tag===1&&g.fields[0].tag===1&&e0(m,g.fields[0].fields[1])?g.fields[0].fields[2]:void 0]])]);return[j,i(n,j)]}case 5:return[n,C0()];case 6:{const j=new V1(0,[new G1(3,[[_,y,[C,E]]])]);return[j,i(n,j)]}case 7:return[n,C0()];case 8:{const j=new V1(1,[[D,M,O,R]]);return[j,i(n,j)]}case 9:return[n,C0()];case 10:{const j=new V1(0,[new G1(1,[[x,new Me(1,[new tt(0,[S])])]])]);return[j,i(n,j)]}case 11:{const j=new V1(0,[new G1(2,[[N,A,P,F]])]);return[j,i(n,j)]}case 12:return[n,C0()];case 13:{const j=new V1(0,[new G1(1,[[i0,new Me(1,[new tt(1,[V,J,X])])]])]);return[j,i(n,j)]}case 14:return[n,C0()];case 15:{const j=new V1(0,[new G1(0,[[G,new Me(1,[new tt(0,[L])])]])]);return[j,i(n,j)]}case 16:{const j=new V1(0,[new G1(0,[[f0,$.tag===1?$.fields[0].tag===1?e0(U,$.fields[0].fields[0])&&e0(Y,$.fields[0].fields[1])?$:new Me(1,[new tt(1,[U,Y,void 0])]):new Me(1,[new tt(1,[U,Y,void 0])]):new Me(1,[new tt(1,[U,Y,void 0])])]])]);return[j,i(n,j)]}case 17:{const j=new V1(0,[new G1(0,[[h0,new Me(0,[m0])]])]);return[j,i(n,j)]}default:return[n,C0()]}}function ZC(e,t,r){let n,i,o,s,a,l,u,d,f,p,h;return Zt(w([new S1(3,[e]),new S1(4,[t]),new S1(5,[[Xt(s0(new Jt(2,["fixed inset-0 bg-gray-500/50"]))),c("div",v(w([["className","fixed inset-0 z-10 w-screen overflow-y-auto"],(n=[c("div",v(w([["className","flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0"],(i=[Kt(w([new d2(1,["relative transform overflow-hidden rounded-lg bg-white px-4 pt-5 pb-4 text-left shadow-xl sm:my-8 sm:w-full sm:max-w-lg sm:p-6"]),new d2(2,[[c("div",v(w([["className","absolute top-0 right-0 hidden pt-4 pr-4 sm:block"],(o=[c("button",v(w([["type","button"],["onClick",m=>{t()}],["className","text-gray-600"],(s=[z2(24,24)],["children",b.Children.toArray(Array.from(s))])])))],["children",b.Children.toArray(Array.from(o))])]))),c("div",v(w([["className","sm:flex sm:items-start"],(a=[c("div",v(w([["className","mx-auto flex size-12 shrink-0 items-center justify-center sm:mx-0 sm:size-10"],(l=[P_([])],["children",b.Children.toArray(Array.from(l))])]))),c("div",v(w([["className","mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left"],(u=[P9(w([new Qr(2,["text-gray-900 text-lg font-bold"]),new Qr(3,[["Cancel import"]])])),c("div",v(w([["className","mt-2 text-sm text-gray-500 leading-tight"],(d=[c("p",{children:["You’re about to cancel your import. All changes will be discarded."]}),c("br",{}),c("p",{children:["Are you sure you want to cancel and exit?"]})],["children",b.Children.toArray(Array.from(d))])])))],["children",b.Children.toArray(Array.from(u))])])))],["children",b.Children.toArray(Array.from(a))])]))),c("div",v(w([["className","mt-5 sm:mt-4 sm:flex sm:flex-row-reverse"],(f=[c("button",v(w([["type","button"],["onClick",m=>{r()}],(p="inline-flex w-full justify-center rounded-md bg-red-600 px-3 py-2 text-sm font-medium text-white shadow-xs hover:bg-red-500 sm:ml-3 sm:w-auto",["className",p]),["children","Cancel import and exit"]]))),c("button",v(w([["type","button"],["onClick",m=>{t()}],(h="mt-3 inline-flex w-full justify-center rounded-md bg-white px-3 py-2 text-gray-700 text-sm font-medium ring-1 shadow-xs ring-gray-300 ring-inset hover:bg-gray-50 sm:mt-0 sm:w-auto",["className",h]),["children","Continue import"]])))],["children",b.Children.toArray(Array.from(f))])])))]])]))],["children",b.Children.toArray(Array.from(i))])])))],["children",b.Children.toArray(Array.from(n))])])))]])]))}class J5 extends W{constructor(t,r){super(),this.tag=t,this.fields=r}cases(){return["HasNotStartedYet","InProgress","Resolved","Failed"]}}function KC(e,t){let r;const n=Vc();return r=b.useRef(n),ds(()=>l6(()=>{Uc(r.current)})),fs(i=>{jc(r.current)||Lt(z.Delay(()=>z.TryWith(z.Delay(()=>(t(new J5(1,[])),z.Bind(e(i),o=>(t(new J5(2,[o])),z.Zero())))),o=>(t(new J5(3,[o])),z.Zero()))),r.current)})}function JC(e,t,r,n,i,o,s){let a,l,u,d,f,p,h;return wn((a=[()=>C_(e,t,r,n,i),m=>{let g,y,_,C;switch(m.tag){case 1:case 0:{g=3;break}case 3:{g=2,C=m.fields[0];break}default:m.fields[0].tag===1?(g=1,_=m.fields[0].fields[0]):(g=0,y=m.fields[0].fields[0])}switch(g){case 0:{o(y);break}case 1:{s(_);break}case 2:{s(i1(C));break}}}],KC(a[0],a[1]))),c("div",v(w([["className","fixed inset-0 z-100 w-screen overflow-y-auto bg-white"],(l=[c("div",v(w([["className","flex-col w-full h-full justify-center items-center gap-2.5 inline-flex overflow-hidden"],(u=[c("div",v(w([["className","self-stretch h-[118px] flex-col justify-center items-center gap-8 flex"],(d=[c("div",v(w([["className","relative"],(f=[B_([])],["children",b.Children.toArray(Array.from(f))])]))),c("div",v(w([["className","flex-col justify-start items-center gap-6 flex"],(p=[c("div",v(w([["className","w-[140px] h-1.5 relative bg-blue-100 rounded-[5px] overflow-hidden"],(h=[c("div",{style:{animation:"progressBar 2s linear infinite"},className:"h-1.5 top-0 absolute bg-gradient-to-r from-[#a650ff] to-[#0095f2] rounded-[5px]"})],["children",b.Children.toArray(Array.from(h))])])))],["children",b.Children.toArray(Array.from(p))])])))],["children",b.Children.toArray(Array.from(d))])])))],["children",b.Children.toArray(Array.from(u))])])))],["children",b.Children.toArray(Array.from(l))])])))}class ye extends W{constructor(t,r){super(),this.tag=t,this.fields=r}cases(){return["Key","As","Appear","Show","ClassName","Enter","EnterFrom","EnterTo","Leave","LeaveFrom","LeaveTo","Children"]}}function XC(e){return c(O9,Ge(e,1))}class st extends E0{constructor(t,r,n){super(),this.Type=t,this.Title=r,this.Message=n}}class at extends W{constructor(t,r){super(),this.tag=t,this.fields=r}cases(){return["Success","Failure","InProgress"]}}function QC(e,t){let r,n,i,o,s,a,l,u;return XC(w([new ye(1,["div"]),new ye(4,["pointer-events-auto w-full max-w-sm overflow-hidden rounded-lg bg-white shadow-lg ring-1 ring-black ring-opacity-5"]),new ye(3,[!0]),new ye(5,["transform ease-out duration-300 transition"]),new ye(6,["translate-y-2 opacity-0 sm:translate-y-0 sm:translate-x-2"]),new ye(7,["translate-y-0 opacity-100 sm:translate-x-0"]),new ye(8,["transition ease-in duration-100"]),new ye(9,["opacity-100"]),new ye(10,["opacity-0"]),new ye(11,[[c("div",v(w([["key","1"],(r=[c("div",v(w([["className","p-4"],(n=[c("div",v(w([["className","flex items-start"],(i=[c("div",v(w([["className","flex-shrink-0"],(o=q(k(()=>{const d=t.Type;return d.tag===1?T(V_([])):d.tag===2?T(U_([])):T(H_([]))})),["children",b.Children.toArray(Array.from(o))])]))),c("div",v(w([["className","ml-3 w-0 flex-1 pt-0.5"],(s=[c("p",{className:"text-sm font-medium text-gray-900",children:t.Title}),c("p",{className:"mt-1 text-sm text-gray-500",children:t.Message})],["children",b.Children.toArray(Array.from(s))])]))),c("div",v(w([["className","ml-4 flex flex-shrink-0"],(a=[c("button",v(w([["type","button"],(l="inline-flex rounded-md bg-white text-gray-400 hover:text-gray-500 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-offset-2",["className",l]),["onClick",d=>{e()}],(u=[jr(10,10)],["children",b.Children.toArray(Array.from(u))])])))],["children",b.Children.toArray(Array.from(a))])])))],["children",b.Children.toArray(Array.from(i))])])))],["children",b.Children.toArray(Array.from(n))])])))],["children",b.Children.toArray(Array.from(r))])])))]])]))}function ex(e){const t=document.getElementById("workspace-toasts-container"),r=Ts(),n=QC(()=>{document.getElementById(r).remove()},e),i=document.createElement("div");q4(n,i);const o=i.children[0];o.id=r,t.appendChild(o)}const tx=3e4;function rx(e,t,r,n,i){const o=n.fields[0],s=()=>z.Delay(()=>z.Bind(cs(tx),()=>z.Bind(t(r),a=>{let l,u,d,f;const p=a;return p.tag!==1&&(p.fields[0].tag!==1||(p.fields[0].fields[0].tag===1?(e(new st(new at(1,[]),"We found a duplicate user",`"${w0(i.fields[0],w0(p.fields[0].fields[0].fields[0]-2,o).fields[0])}" already exists in our system. This user was skipped during the import.`)),!1):p.fields[0].fields[0].tag===2?(l=p.fields[0].fields[0].fields[0].DuplicateEmailCount>0,u=p.fields[0].fields[0].fields[0].OtherFailuresCount>0,e(l?u?new st(new at(1,[]),"We found multiple import errors",(d="One or more of the rows experienced errors during import. These rows were skipped during the import.",d)):new st(new at(1,[]),`We found ${p.fields[0].fields[0].fields[0].DuplicateEmailCount} duplicate users`,(f="One or more of the users you’re trying to add already exist in our system. These users were skipped during the import.",f)):new st(new at(1,[]),"We found multiple import errors",(d="One or more of the rows experienced errors during import. These rows were skipped during the import.",d))),!1):(e(new st(new at(0,[]),p.fields[0].fields[0].fields[0]===1?"Successfully added 1 user":`Successfully added ${p.fields[0].fields[0].fields[0]} users`,"If you don’t see any new users, try refreshing this page.")),!1)))?z.Bind(s(),()=>z.Return(void 0)):z.Zero()})));e(new st(new at(2,[]),o.length===1?"Importing 1 user":`Importing ${o.length} users`,"This might take a while. We’ll let you know via email when it’s finished.")),Lt(s())}class I1 extends W{constructor(t,r){super(),this.tag=t,this.fields=r}cases(){return["Completed","Active","Disabled"]}}class vr extends E0{constructor(t,r,n,i){super(),this.UploadingCsv=t,this.MappingColumns=r,this.MappingEmploymentBasis=n,this.Reviewing=i}}function Go(){ha(w(["workspace","app","users"]))}function al(e){ha(w(["workspace","app","oops"]))}function nx(e){switch(e.tag){case 1:return new vr(new I1(0,[]),new I1(1,[]),new I1(2,[]),new I1(2,[]));case 2:return new vr(new I1(0,[]),new I1(0,[]),new I1(1,[]),new I1(2,[]));case 3:return new vr(new I1(0,[]),new I1(0,[]),new I1(0,[]),new I1(1,[]));default:return new vr(new I1(1,[]),new I1(2,[]),new I1(2,[]),new I1(2,[]))}}function ix(e,t,r,n,i,o){switch(o.tag){case 1:{const s=o.fields[0],a=s[1].tag===1?s[1].fields[0].tag===1?[E7(s[1].fields[0].fields[0],s[1].fields[0].fields[1]),s[0].HeaderRow,s[0].DataRows]:[E7(s[1].fields[0].fields[0],void 0),s[0].HeaderRow,s[0].DataRows]:[s[1].fields[0],s[0].HeaderRow,s[0].DataRows];return c(l_,{existingMappings:w3(a[0]),headerRow:a[1],dataRows:a[2],next:l=>{let u;r(new y2(0,[(u=l,new pr(1,[u[0],u[1]]))]))},back:l=>{r(new y2(1,[new m5(2,[l])]))},sendAnalytics:i})}case 2:{const s=Hg(o.fields[0][0].DataRows,o.fields[0][2]);return c(w_,{existingMappings:w3(o.fields[0][3]),employmentBasisColumn:s,next:a=>{r(new y2(0,[new pr(2,[a])]))},back:a=>{r(new y2(1,[new m5(1,[a])]))}})}case 3:return c(K_,{apiCallAsync:e,dataRows:o.fields[0][0].DataRows,baseColumnMappings:o.fields[0][1],employmentBasis:w3(o.fields[0][2]),next:s=>{let a;r(new y2(0,[(a=s,new pr(3,[a[0],a[1]]))]))},back:()=>{r(new y2(1,[new m5(0,[])]))},onError:s=>{al()},sendAnalytics:i});default:{const s=C1(a=>a[0],o.fields[0]);return c(GC,{existingCsvFile:w3(s),next:a=>{r(new y2(0,[new pr(0,[a])]))},cancel:t,markDirty:n,sendAnalytics:i})}}}function br(e,t){let r,n,i;switch(t.tag){case 1:return c("div",v(w([["className","text-sm font-medium border-b-2 border-primary-600 pt-1 pb-3 text-primary-600 text-nowrap"],(r=[c("span",{children:e})],["children",b.Children.toArray(Array.from(r))])])));case 2:return c("div",v(w([["className","text-sm font-medium pt-1 pb-3 text-gray-500 text-nowrap"],(n=[c("span",{children:e})],["children",b.Children.toArray(Array.from(n))])])));default:return c("div",v(w([["className","text-sm font-medium pt-1 pb-3 text-emerald-700 gap-2 inline-flex text-nowrap"],(i=[jn(20,20),c("span",{children:e})],["children",b.Children.toArray(Array.from(i))])])))}}function ox(e){let t,r,n,i,o,s,a,l;const u=(t=Ts(),t);l=O=>zs(e.backendUrl,u,O),a=O=>{Lt(l(O))},s=b.useCallback(a,[]),wn(()=>{s(new re(0,[{Section:"user import"}]))});const d=G2(()=>q2(zC,(O,R)=>YC(()=>{window.scrollTo(0,0)},s,O,R),(O,R)=>{}),void 0,void 0),f=d[0],p=b.useState(!1),h=p[0],m=p[1],g=b.useState(!1),y=g[0],_=b.useCallback(O=>{O.preventDefault(),O.returnValue=!0},[]),C=()=>{window.removeEventListener("beforeunload",_)};as(()=>(y?window.addEventListener("beforeunload",_):C(),{Dispose(){C()}}),[y]);let E;if(f.tag===0){const O=f.fields[0],R=()=>{h||m(!0)},D=nx(O),S=ix(x=>hh(e.backendUrl,x),R,d[1],g[1],s,O);E=c("div",v(w([["className","min-w-[640px] flex flex-col h-full"],(r=[ZC(h,()=>{h&&m(!1)},()=>{h&&(s(new re(2,[{From:sl(O)}])),C(),Go())}),c("div",v(w([["className","flex flex-row justify-between px-12 pt-8 pb-4"],(n=[c("span",{className:"font-['BR Sonoma'] text-gray-900 font-bold text-lg",children:"Import Users from CSV"}),c("button",v(w([(i="bg-white hover:bg-gray-50 rounded-md text-red-700 shadow-sm text-sm border border-gray-300 font-medium px-3 py-2 min-w-[120px]",["className",i]),["onClick",x=>{R()}],["type","button"],["children",b.Children.toArray(["Cancel import"])]])))],["children",b.Children.toArray(Array.from(n))])]))),c("div",v(w([["className","flex flex-row items-center px-12 gap-2 border-b border-gray-200"],(o=[br("1. Upload CSV",D.UploadingCsv),c("hr",{className:"w-16 pt-1.5"}),br("2. Map fields",D.MappingColumns),c("hr",{className:"w-16 pt-1.5"}),br("3. Map values",D.MappingEmploymentBasis),c("hr",{className:"w-16 pt-1.5"}),br("4. Review",D.Reviewing)],["children",b.Children.toArray(Array.from(o))])]))),S],["children",b.Children.toArray(Array.from(r))])])))}else{const O=f.fields[0][3],R=f.fields[0][0],D=f.fields[0][1];E=JC(S=>mh(e.backendUrl,S),R,D,f.fields[0][2],O,S=>{s(new re(8,[{ImportId:S,UsersInvited:O.tag!==1}])),C();const x=[S,R,D.Email];rx(A=>{ex(A)},A=>ph(e.backendUrl,A),x[0],x[1],x[2]),Go()},S=>{s(new re(9,[{Reason:S}])),C(),al()})}const M=[c("style",{children:[Z4]}),E];return c(J0,{},...M)}function sx(){F4(e=>c(ox,e),"apollo-import-workspace-wizard")}F4(e=>c(uc,e),"apollo-import-workspace-app");vg();sx();
|