1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[393],{51350:function(e,a,l){(window.__NEXT_P=window.__NEXT_P||[]).push(["/create-event/speakers",function(){return l(54212)}])},45672:function(e,a,l){"use strict";var t=l(85893),i=l(60887),o=l(32339),n=l(45587),s=l(24285),r=l(5779),d=l(67294),u=l(66653),m=l(57632),c=l(51773);let p=e=>{let{tableHeading:a,rows:l,sortable:s=!1,onSort:u,items:c}=e,{theme:p}=(0,r.Fg)(),h=(0,m.Z)(),f=()=>null==l?void 0:l.map((e,a)=>({data:e,id:a})),[x,g]=(0,d.useState)(f());(0,d.useEffect)(()=>{g(f())},[l]);let b=e=>{let{active:a,over:l}=e;if(l&&a.id!==l.id&&x&&c){let t=null==x?void 0:x.findIndex(e=>e.id===a.id),i=null==x?void 0:x.findIndex(e=>e.id===l.id),o=(0,n.Rp)(x,t,i);g(o);let s=(0,n.Rp)(c,t,i);u&&u(s)}};return(0,t.jsxs)("table",{className:"w-full table-auto text-left rounded-lg border border-midnight-gray",children:[(0,t.jsx)("thead",{className:"",children:(0,t.jsx)("tr",{style:{backgroundColor:p.foregroundColour},className:"border-b-midnight-gray border-b",children:a.map(e=>(0,t.jsx)("th",{className:"p-3",children:e},"table-head-".concat(h,"-").concat(e.toString().length>0?e.toString():(0,m.Z)())))},"table-head-".concat(h,"-container"))}),(0,t.jsx)("tbody",{children:s&&x?(0,t.jsx)(i.LB,{modifiers:[o.DL],onDragEnd:b,children:(0,t.jsx)(n.Fo,{items:x,strategy:n.qw,children:null==x?void 0:x.map((e,a)=>(0,t.jsx)(v,{sortable:!0,id:e.id,className:"py-2 border-b-midnight-gray border-b bg-white",children:e.data.map((e,l)=>(0,t.jsx)("td",{className:"p-3",children:3===a&&"Break"===e?(0,t.jsx)("span",{className:"rounded border border-orange-200 text-orange-200 py-0.5 px-1 text-sm",children:"Break"}):e},"table-data-".concat(h,"-").concat(l)))},"".concat(e.id)))})}):null==x?void 0:x.map((e,a)=>(0,t.jsx)(v,{id:e.id,className:"py-2 border-b-midnight-gray border-b",children:e.data.map((e,l)=>(0,t.jsx)("td",{className:"p-3",children:3===a&&"Break"===e?(0,t.jsx)("span",{className:"rounded border border-orange-200 text-orange-200 py-0.5 px-1 text-sm",children:"Break"}):e},"table-data-".concat(h,"-").concat(l)))},"".concat(e.id)))})]})},v=e=>{let{children:a,className:l,id:i,key:o,sortable:r=!1}=e,{attributes:d,listeners:m,setNodeRef:p,transform:v,transition:h}=(0,n.nB)({id:i}),f={transform:s.ux.Transform.toString(v),transition:h};return(0,t.jsx)("tr",{ref:p,style:f,className:"p-3 ".concat(l),children:r?(0,t.jsxs)(t.Fragment,{children:[a,(0,t.jsx)("td",{className:"py-3",children:(0,t.jsx)(c.default,{className:"",...d,...m,children:(0,t.jsx)(u.gMO,{})})})]}):a},"table-row-".concat(i," relative"))};a.Z=p},29033:function(e,a,l){"use strict";var t=l(85893),i=l(51773),o=l(11390);let n=e=>{let{action:a=[],deleteClicked:l,editClicked:n,confirmModal:s,disabled:r=!1}=e;return(0,t.jsxs)(i.default,{className:"flex",children:[(0,t.jsx)(i.default,{className:"flex justify-end flex-1",children:a.map(e=>{var a;if(e.show)return(0,t.jsx)(o.z,{onClick:e.onClicked,className:"ml-auto mr-2",size:"small",title:null!==(a=e.title)&&void 0!==a?a:"Action",disabled:r,confirmationModal:e.confirmModal,loading:e.loading},e.title)})}),n&&(0,t.jsx)(o.z,{onClick:n,className:"ml-auto mr-2",size:"small",title:"Edit",disabled:r}),l&&(0,t.jsx)(o.z,{onClick:l,size:"small",title:"Remove",confirmationModal:s||void 0,disabled:r})]})};a.Z=n},71766:function(e,a,l){"use strict";var t=l(11163),i=l(67294);let o=e=>{let a=(0,t.useRouter)(),l=a=>JSON.stringify(e)===JSON.stringify(a)?n(!1):n(!0),o=()=>"true"===window.localStorage.getItem("Forumm_FormEditedState"),n=async e=>new Promise((a,l)=>{try{window.localStorage.setItem("Forumm_FormEditedState",e?"true":"false"),a(!0)}catch(t){console.error(t),l(!1)}});return(0,i.useEffect)(()=>()=>{},[a]),{getHasEdited:o,setHasEdited:n,hasDataChanged:l}};a.Z=o},11734:function(e,a,l){"use strict";l.d(a,{Z:function(){return r}});var t=l(72742),i=l(66703);let o=(0,i.B)("\n mutation UploadMedia($input: MediaUploadInput!) {\n uploadMedia(input: $input) {\n preSignedUrl\n uploadedFileUrl\n }\n }\n");var n=l(57632);let s=()=>{let[e]=(0,t.D)(o),a=e=>(0,n.Z)(),l=async l=>{var t,i;let o=await e({variables:{input:{contentType:"application/x-www-form-urlencoded",filename:a(l.name)}}}),n=null===(t=o.data)||void 0===t?void 0:t.uploadMedia.preSignedUrl,s=null===(i=o.data)||void 0===i?void 0:i.uploadMedia.uploadedFileUrl;return await fetch(n,{method:"PUT",body:l,headers:{"Content-Type":l.type}}),null!=s?s:""};return l};var r=s},54212:function(e,a,l){"use strict";l.r(a);var t=l(85893),i=l(51773),o=l(11390),n=l(40296),s=l(26291),r=l(39618),d=l(18860),u=l(68240),m=l(67526),c=l(25687),p=l(11734),v=l(67294),h=l(45672),f=l(29033),x=l(16798),g=l(71766),b=l(33923),j=l(52229);let w=()=>{var e,a,l,m,w,y,N,k,S;let[I,C]=(0,v.useState)(!1),[E,z]=(0,v.useState)(!1),{formData:L,setFormData:Z,errors:F,setErrors:O}=(0,c.O)(),{speakers:M}=null!=L?L:{},T=void 0==M||(null==M?void 0:M.length)===0,_=(0,p.Z)(),{readRemoteFile:B}=(0,x.vE)(),{setHasEdited:A}=(0,g.Z)(),[U,P]=(0,v.useState)(void 0),q=function(e){let a=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return(l,t)=>{let i=[...F],o=!!l||""!==l,n=i.find(e=>e.eleId===t)&&!o;if(n)return O(i.filter(e=>e.eleId!==t));let s=!!i.find(e=>e.eleId===t);!s&&o&&O([...i,{step:null!=e?e:"unknown",message:l,eleId:t,alert:a}])}},J=(0,t.jsx)(d.Z,{show:I,setShow:C,title:"Add Speaker",children:(0,t.jsxs)(s.l,{initialFormData:{name:null!==(a=null==U?void 0:U.name)&&void 0!==a?a:"",email:null!==(l=null==U?void 0:U.email)&&void 0!==l?l:"",position:null!==(m=null==U?void 0:U.position)&&void 0!==m?m:"",organisation:null!==(w=null==U?void 0:U.organization)&&void 0!==w?w:"",profileImage:null!==(y=null==U?void 0:U.profileImage)&&void 0!==y?y:"https://media.istockphoto.com/vectors/male-user-icon-vector-id517998264?k=20&m=517998264&s=612x612&w=0&h=pdEwtkJlZsIoYBVeO2Bo4jJN6lxOuifgjaH8uMIaHTU=",TicketType:u.zK.Free,bio:null!==(N=null==U?void 0:U.bio)&&void 0!==N?N:"",editIndex:null!==(k=null==U?void 0:U.editIndex)&&void 0!==k?k:""},async onSubmit(e){var a;let{name:l,email:t,position:i,organisation:o,profileImage:n,ticketType:s,bio:r,editIndex:d}=e,u={name:l,email:t,position:i,organization:o,profileImage:n,ticketType:s,bio:r},m=[...null!==(a=null==L?void 0:L.speakers)&&void 0!==a?a:[]];d||0===d?m[d]=u:m.push(u),Z({...L,speakers:m}),P(void 0),C(!1)},children:[(0,t.jsx)(i.default,{className:"flex justify-center p-2",children:(0,t.jsx)(n.S,{uploadFile:_,label:"Profile Image",hint:"(Optional) recommended size 800x800px",hintPosition:"bottom",value:null==U?void 0:U.profileImage,crop:!0,cropShape:"rect",cropAspectRatio:1})}),(0,t.jsxs)(i.default,{className:"flex gap-2 flex-wrap",children:[(0,t.jsx)(r.o,{className:"flex-1",validations:{maxLength:{value:70,message:"Name must be at most 70 characters"}},required:!0,setError:q("speakers"),label:"Name",placeholder:"Taylor Swift",value:null==U?void 0:U.name}),(0,t.jsx)(r.o,{className:"flex-2",validations:{minLength:{value:7,message:"Email must be at least 7 characters"},maxLength:{value:70,message:"Email must be less than 70 characters"},pattern:{value:/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i,message:"Email must be valid"}},type:"email",label:"Email",required:(null==L?void 0:null===(e=L.event)||void 0===e?void 0:e.eventType)===u.tw.Online,placeholder:"[email protected]",setError:q("speakers"),value:null==U?void 0:U.email})]}),(0,t.jsxs)(i.default,{className:"flex flex-wrap gap-2",children:[(0,t.jsx)(r.o,{className:"flex-1 mt-2",validations:{maxLength:{value:70,message:"Position must be less than 70 characters"}},required:!0,label:"Position",setError:q("speakers"),placeholder:"Manager",value:null==U?void 0:U.position}),(0,t.jsx)(r.o,{className:"flex-1 mt-2",validations:{maxLength:{value:70,message:"Organisation must be less than 70 characters"}},required:!0,label:"Organisation",setError:q("speakers"),placeholder:"Forumm",value:null==U?void 0:U.organization})]}),(0,t.jsx)(b.F,{className:"mt-2",testid:"speaker-bio-input",validations:{maxLength:{value:1e3,message:"Speakers bio must be 1000 characters or less"}},required:!0,hint:"(Maximum of 1000 characters)",label:"Bio",setError:q("speakers"),placeholder:"A short bio about the speaker",value:null==U?void 0:U.bio}),(0,t.jsx)(i.default,{className:"text-sm",children:"Once you've published your event, your speakers will receive an invite email."}),(0,t.jsx)(o.z,{className:"my-4 ml-auto",title:"".concat((null==U?void 0:U.name)?"Save":"Add"," Speaker"),type:"primary",buttonType:"submit"})]})}),R=(0,t.jsxs)(d.Z,{show:E,setShow:z,title:"Import Speaker from CSV",children:[(0,t.jsx)("a",{href:"https://forumm-images-prod.s3.eu-west-1.amazonaws.com/user-content/manual-upload/sample_speakers.csv",className:"text-link hover:underline pointer",download:!0,children:"Download Sample CSV"}),(0,t.jsxs)(s.l,{clearFormOnSubmit:!0,async onSubmit(e){let{csvUpload:a,ticket:l}=e;B(a,{download:!0,complete(e){let a=[],l=e.data[0].findIndex(e=>"email"===e.toLowerCase()),t=e.data[0].findIndex(e=>"name"===e.toLowerCase()||"fullname"===e.toLowerCase()),i=e.data[0].findIndex(e=>"organisation"===e.toLowerCase()||"organization"===e.toLowerCase()),o=e.data[0].findIndex(e=>"position"===e.toLowerCase()),n=e.data[0].findIndex(e=>"profileimage"===e.toLowerCase()||"image"===e.toLowerCase()||"pfp"===e.toLowerCase()||"avatar"===e.toLowerCase());
1-1!==l&&e.data.forEach(e=>{var s,r,d,u;if(!e[l])return;let m=e[l].toLowerCase(),c=null!==(s=e[t])&&void 0!==s?s:"No name on file",p=null!==(r=e[i])&&void 0!==r?r:"No organisation on file",v=null!==(d=e[o])&&void 0!==d?d:"No position on file",h=null!==(u=e[n])&&void 0!==u?u:"https://media.istockphoto.com/vectors/male-user-icon-vector-id517998264?k=20&m=517998264&s=612x612&w=0&h=pdEwtkJlZsIoYBVeO2Bo4jJN6lxOuifgjaH8uMIaHTU=";null!=M&&M.find(e=>e.email===m)||"email"===m||a.push({name:c,email:m,ticketType:"FREE",organization:p,position:v,profileImage:h})}),Z({...L,speakers:[...null!=M?M:[],...null!=a?a:[]]}),A(!0),z(!1)}})},children:[(0,t.jsx)(n.S,{uploadFile:_,className:"mt-1",label:"CSV Upload",hint:"Max upload: (200MB).",type:"csv"}),(0,t.jsx)(o.z,{className:"my-4",title:"Import Speakers",type:"primary",buttonType:"submit"})]})]});return(0,t.jsxs)(t.Fragment,{children:[R,J,(0,t.jsxs)(i.default,{className:"w-full",children:[(0,t.jsxs)(i.default,{className:"mt-6 mb-4 flex",children:[(0,t.jsx)(o.z,{onClick(){P(void 0),C(!0)},title:"Add Speaker",type:"secondary",size:"small",className:"mr-4"}),(0,t.jsx)(o.z,{onClick(){z(!0)},title:"Import Speakers",type:"secondary",size:"small"})]}),(0,t.jsx)(h.Z,{tableHeading:["Name","Email","Postion","Organization",""],rows:null==M?void 0:M.map((e,a)=>[null==e?void 0:e.name,null!==(S=(0,j.aS)(null==e?void 0:e.email,200))&&void 0!==S?S:"No email on file",null==e?void 0:e.position,null==e?void 0:e.organization,(0,t.jsx)(f.Z,{confirmModal:{title:"Are you sure?",content:"Are you sure you want to delete this? This cannot be undone."},editClicked(){var l,t;let i={name:null==e?void 0:e.name,email:null==e?void 0:e.email,position:null==e?void 0:e.position,organization:null==e?void 0:e.organization,profileImage:null!==(l=null==e?void 0:e.profileImage)&&void 0!==l?l:"",bio:null!==(t=null==e?void 0:e.bio)&&void 0!==t?t:"",editIndex:a};P(i),C(!0)},deleteClicked(){A(!0),Z({...L,speakers:M.filter((e,l)=>l!==a)})}},a)])}),T&&(0,t.jsxs)(i.default,{children:[(0,t.jsx)(i.default,{className:"text-sm mt-8 text-center",children:"No speakers have been created"}),(0,t.jsx)("hr",{className:"my-6 border-gray-600 opacity-50"})]})]})]})};w.Layout=m.Z,a.default=w}},function(e){e.O(0,[4617,3777,3714,1458,9198,474,4555,1209,7632,9681,6109,8012,4893,788,5687,7526,9774,2888,179],function(){return e(e.s=51350)}),_N_E=e.O()}]); 2//# sourceMappingURL=speakers-0d41063bd933ed06.js.map
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.