1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8783],{2336:function(t,e,r){r.d(e,{ZP:function(){return a}});var s=r(56569),n=r(55288),i=r(31229),o=r(27258);r(90008),r(90339),r(20877);var a=(0,i.forwardRef)(function(t,e){var r=(0,s.u)(t);return i.createElement(o.S,(0,n.Z)({ref:e},r))})},24267:function(t,e,r){r.r(e),r.d(e,{default:function(){return p}});var s=r(59533),n=r(40771),i=r(64126),o=r(89021),a=r(93321),l=r(76917),u=r(65674),c=r(96037),h=r(20742),d=r(39448);let f=i.z.object({title:c.p.text,description:c.p.text,tags:c.p.tags,bountyTrack:i.z.array(i.z.string())}).required();function p(t){var e,r,i,c,p,v,m,b,y,g,x;let{data:j,close:R}=t,{showLoading:k,dismissLoading:E}=(0,a.Sm)(),M=(0,l.E)(t=>t.add),O=(0,h.sU)(),S=async t=>{k();try{var e;let r={projectName:t.title,projectDescription:t.description,projectTags:t.tags,projectBountyTrack:t.bountyTrack};await O.mutateAsync({teamId:null===(e=j.team)||void 0===e?void 0:e.id,payload:r}),M({type:"success",title:"Project updated",description:""}),R()}catch(t){console.log(t)}finally{E()}},{control:N,register:T,handleSubmit:C,formState:{errors:w}}=(0,n.cI)({resolver:(0,d.F)(f),defaultValues:{title:null!==(b=j.name)&&void 0!==b?b:"",description:null!==(y=j.description)&&void 0!==y?y:"",tags:null!==(g=j.tags)&&void 0!==g?g:[],bountyTrack:null!==(x=j.bountyTrack)&&void 0!==x?x:[]}});j.team;let V=u.K;(null===(r=j.team)||void 0===r?void 0:null===(e=r.challenge)||void 0===e?void 0:e.track)&&j.team.challenge.track.length>0&&(V=(0,u.c)(j.team.challenge.track));let I=u.K;return(null==j?void 0:null===(c=j.team)||void 0===c?void 0:null===(i=c.challenge)||void 0===i?void 0:i.otherInfo)&&j.team.challenge.otherInfo.bountyTrack.length>0&&(I=(0,u.c)(j.team.challenge.otherInfo.bountyTrack)),(0,s.jsxs)("div",{className:"flex flex-col justify-center w-[80vw] max-w-md ",children:[(0,s.jsx)("p",{className:"body-2 mb-4",children:"Edit Project Detail"}),(0,s.jsxs)("form",{method:"post",onSubmit:C(S),children:[(0,s.jsx)(o.II,{label:"Project title",required:!0,placeholder:"Enter your project title",error:w.title,...T("title")}),(0,s.jsx)(o.Ph,{id:"select-tags",label:(null===(p=j.team.challenge)||void 0===p?void 0:p.id)==="146"||"146"===j.team.challengeId?"Track":"Project Tag",required:!0,isSingle:(null===(v=j.team.challenge)||void 0===v?void 0:v.id)==="146",maxSelections:(null===(m=j.team.challenge)||void 0===m?void 0:m.id)==="146"||"146"===j.team.challengeId?1:5,options:V,error:w.tags,control:N,...T("tags")}),"136"===j.team.challengeId&&(0,s.jsx)(o.Ph,{id:"select-bountyTrack",label:"Bounty Track",maxSelections:5,options:I,error:w.bountyTrack,control:N,...T("bountyTrack")}),(0,s.jsx)(o.Kx,{label:"Project Description",placeholder:"Enter your project description",error:w.description,...T("description")}),(0,s.jsxs)("div",{className:"flex justify-between",children:[(0,s.jsx)("div",{className:"flex-1"}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("button",{className:"btn btn-secondary ",type:"button",onClick:R,children:"Cancel"}),(0,s.jsx)("button",{className:"btn btn-primary ",children:"Update"})]})]})]})]})}},39448:function(t,e,r){r.d(e,{F:function(){return u}});var s=r(40771);let n=(t,e,r)=>{if(t&&"reportValidity"in t){let n=(0,s.U2)(r,e);t.setCustomValidity(n&&n.message||""),t.reportValidity()}},i=(t,e)=>{for(let r in e.fields){let s=e.fields[r];s&&s.ref&&"reportValidity"in s.ref?n(s.ref,r,t):s.refs&&s.refs.forEach(e=>n(e,r,t))}},o=(t,e)=>{e.shouldUseNativeValidation&&i(t,e);let r={};for(let n in t){let i=(0,s.U2)(e.fields,n),o=Object.assign(t[n]||{},{ref:i&&i.ref});if(a(e.names||Object.keys(t),n)){let t=Object.assign({},(0,s.U2)(r,n));(0,s.t8)(t,"root",o),(0,s.t8)(r,n,t)}else(0,s.t8)(r,n,o)}return r},a=(t,e)=>t.some(t=>t.startsWith(e+"."));var l=function(t,e){for(var r={};t.length;){var n=t[0],i=n.code,o=n.message,a=n.path.join(".");if(!r[a]){if("unionErrors"in n){var l=n.unionErrors[0].errors[0];r[a]={message:l.message,type:l.code}}else r[a]={message:o,type:i}}if("unionErrors"in n&&n.unionErrors.forEach(function(e){return e.errors.forEach(function(e){return t.push(e)})}),e){var u=r[a].types,c=u&&u[n.code];r[a]=(0,s.KN)(a,e,r,i,c?[].concat(c,n.message):n.message)}t.shift()}return r},u=function(t,e,r){return void 0===r&&(r={}),function(s,n,a){try{return Promise.resolve(function(n,o){try{var l=Promise.resolve(t["sync"===r.mode?"parse":"parseAsync"](s,e)).then(function(t){return a.shouldUseNativeValidation&&i({},a),{errors:{},values:r.raw?s:t}})}catch(t){return o(t)}return l&&l.then?l.then(void 0,o):l}(0,function(t){if(Array.isArray(null==t?void 0:t.errors))return{values:{},errors:o(l(t.errors,!a.shouldUseNativeValidation&&"all"===a.criteriaMode),a)};throw t}))}catch(t){return Promise.reject(t)}}}},46865:function(t,e,r){r.d(e,{D:function(){return d}});var s=r(31229),n=r(4870),i=r(13082),o=r(3542),a=r(44144);class l extends a.l{constructor(t,e){super(),this.client=t,this.setOptions(e),this.bindMethods(),this.updateResult()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var e;let r=this.options;this.options=this.client.defaultMutationOptions(t),(0,n.VS)(r,this.options)||this.client.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.currentMutation,observer:this}),null==(e=this.currentMutation)||e.setOptions(this.options)}onUnsubscribe(){if(!this.hasListeners()){var t;null==(t=this.currentMutation)||t.removeObserver(this)}}onMutationUpdate(t){this.updateResult();let e={listeners:!0};"success"===t.type?e.onSuccess=!0:"error"===t.type&&(e.onError=!0),this.notify(e)}getCurrentResult(){return this.currentResult}reset(){this.currentMutation=void 0,this.updateResult(),this.notify({listeners:!0})}mutate(t,e){return this.mutateOptions=e,this.currentMutation&&this.currentMutation.removeObserver(this),this.currentMutation=this.client.getMutationCache().build(this.client,{...this.options,variables:void 0!==t?t:this.options.variables}),this.currentMutation.addObserver(this),this.currentMutation.execute()}updateResult(){let t=this.currentMutation?this.currentMutation.state:(0,i.R)(),e={...t,isLoading:"loading"===t.status,isSuccess:"success"===t.status,isError:"error"===t.status,isIdle:"idle"===t.status,mutate:this.mutate,reset:this.reset};this.currentResult=e}notify(t){o.V.batch(()=>
1{if(this.mutateOptions&&this.hasListeners()){var e,r,s,n,i,o,a,l;t.onSuccess?(null==(e=(r=this.mutateOptions).onSuccess)||e.call(r,this.currentResult.data,this.currentResult.variables,this.currentResult.context),null==(s=(n=this.mutateOptions).onSettled)||s.call(n,this.currentResult.data,null,this.currentResult.variables,this.currentResult.context)):t.onError&&(null==(i=(o=this.mutateOptions).onError)||i.call(o,this.currentResult.error,this.currentResult.variables,this.currentResult.context),null==(a=(l=this.mutateOptions).onSettled)||a.call(l,void 0,this.currentResult.error,this.currentResult.variables,this.currentResult.context))}t.listeners&&this.listeners.forEach(({listener:t})=>{t(this.currentResult)})})}}var u=r(51079),c=r(26421),h=r(39062);function d(t,e,r){let i=(0,n.lV)(t,e,r),a=(0,c.NL)({context:i.context}),[d]=s.useState(()=>new l(a,i));s.useEffect(()=>{d.setOptions(i)},[d,i]);let p=(0,u.$)(s.useCallback(t=>d.subscribe(o.V.batchCalls(t)),[d]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),v=s.useCallback((t,e)=>{d.mutate(t,e).catch(f)},[d]);if(p.error&&(0,h.L)(d.options.useErrorBoundary,[p.error]))throw p.error;return{...p,mutate:v,mutateAsync:p.mutate}}function f(){}},51079:function(t,e,r){r.d(e,{$:function(){return s}});let s=r(37738).useSyncExternalStore},39062:function(t,e,r){r.d(e,{L:function(){return s}});function s(t,e){return"function"==typeof t?t(...e):!!t}}}]);
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.