1"use strict";(self.webpackChunk_metafox_react=self.webpackChunk_metafox_react||[]).push([["formElement"],{171:function(e,t,l){l.d(t,{A:function(){return i}});var n=l(53993),a=l(30758);function i({text:e}){let{i18n:t}=(0,n.PCX)();return e?e.startsWith("<html>")?a.createElement(a.Fragment,null,t.formatMessage({id:"[placeholder]",defaultMessage:e})):a.createElement(a.Fragment,null,e):null}},1024:function(e,t,l){l.r(t);var n=l(97071),a=l(74209),i=l(39296),r=l(13775),o=l(89123),s=l(89541),d=l(43890),u=l(29820),c=l(98002),m=l.n(c),p=l(4633),g=l.n(p),f=l(30758),v=l(27550),h=l(53993),y=l(33153);let b=(0,d.Ay)(n.A,{name:"CaptchaContent"})(({theme:e})=>({"& img":{maxWidth:"100%"}}));t.default=({config:e,disabled:t,required:l,name:d,formik:c})=>{let{margin:p,fullWidth:E,disabled:A,img:x,key:_,required:C=!0,label:w,placeholder:S,actionName:k,autoFocus:M}=e,[I,R]=(0,u.Mt)(null!=d?d:"image_captcha"),{apiClient:T,compactData:z}=(0,h.PCX)(),[$,P]=f.useState(!1),[W,F]=f.useState(x),L=f.useRef(!1),q=(0,s.A)(),[B,O]=f.useState(_),j=(0,h.IgF)("captcha","image_captcha","refreshCaptcha"),D=()=>{!$&&j&&(P(!0),T.request({method:j.apiMethod||"POST",url:j.apiUrl,data:z(j.apiParams,{action_name:k})}).then(e=>e.data.data).then(e=>{e&&(O(null==e?void 0:e.key),F(null==e?void 0:e.img))}).finally(()=>{P(!1)}))},N=!!(R.error&&(R.touched||c.submitCount));return(f.useEffect(()=>{(null==c?void 0:c.isSubmitting)&&(null==c?void 0:c.isValid)&&(L.current=!0)},[null==c?void 0:c.isSubmitting,null==c?void 0:c.isValid]),f.useEffect(()=>{(null==c?void 0:c.isSubmitting)||!L.current||g()(null==c?void 0:c.errors)||(L.current=!1,D())},[L.current,null==c?void 0:c.isSubmitting,null==c?void 0:c.errors]),f.useEffect(()=>{((null==R?void 0:R.touched)||M)&&B&&c.setFieldValue("image_captcha_key",B,!1)},[null==R?void 0:R.touched,B,M]),f.useEffect(()=>{B||D()},[]),A||t)?null:f.createElement(a.A,{margin:p,fullWidth:E,"data-testid":m()(`field ${d}`)},f.createElement(n.A,{sx:{display:"flex"}},f.createElement(n.A,{sx:{display:"flex",alignItems:"center"}},f.createElement(n.A,{sx:{maxWidth:"50%"}},f.createElement(i.A,{...I,error:N,required:C||l,inputProps:{"data-testid":m()(`input ${d}`)},label:w,placeholder:S,autoFocus:M})),f.createElement(b,{ml:1,sx:{flex:1,minWidth:0,position:"relative",display:"flex"}},$?f.createElement(n.A,{sx:{display:"flex",justifyContent:"center",alignItems:"center",position:"absolute",left:0,top:0,right:0,bottom:0,background:"dark"===q.palette.mode?"rgba(0,0,0,0.5)":"rgba(255,255,255,0.5)"}},f.createElement(r.A,{size:16})):null,f.createElement("img",{src:W,alt:""})),f.createElement(n.A,{sx:{minWidth:"40px"}},f.createElement(o.A,{size:"medium",color:"primary",onClick:D},f.createElement(y.s4,{icon:"ico-rotate-right"}))))),N?f.createElement(v.A,{error:R.error}):null)}},5965:function(e,t,l){l.r(t),l.d(t,{default:function(){return h}});var n=l(53993),a=l(33153),i=l(41818),r=l(83933),o=l(29820),s=l(98002),d=l.n(s),u=l(1384),c=l.n(u),m=l(30758),p=l(171),g=l(76439),f=l(5172),v=(0,g.A)(e=>(0,f.A)({root:{margin:e.spacing(2,0,1),"& button":{fontSize:e.mixins.pxToRem(13),border:e.mixins.border("primary"),borderRadius:4,padding:e.spacing(.5,2)},"& .ico":{fontSize:e.mixins.pxToRem(15)}},addPhotoWrapper:{},previewList:{display:"flex",margin:e.spacing(1,-.5,0)},previewItem:{margin:e.spacing(0,.5),position:"relative","& img":{width:48,height:48,minWidth:48,minHeight:48,objectFit:"cover",borderRadius:4}},deletePhoto:{position:"absolute",top:4,right:4,borderRadius:"50%",width:16,height:16,opacity:.7,backgroundColor:e.mixins.backgroundColor("paper"),display:"flex",alignItems:"center",justifyContent:"center",fontSize:"8px !important",cursor:"pointer","&:hover":{opacity:1}},totalPhoto:{marginTop:e.spacing(.5)},controls:{height:120,border:"solid 1px rgba(0, 0, 0, 0.23)",borderRadius:4,padding:e.spacing(.5,2),marginTop:e.spacing(1),display:"flex",alignItems:"center",justifyContent:"center","&:hover":{border:"1px solid",borderColor:e.palette.border.primary}}}),{name:"ItemPhotoGalleryField"});function h({name:e,config:t}){let l=v(),[,,{setValue:s}]=(0,o.Mt)(null!=e?e:"ItemPhotoGalleryField"),{i18n:u}=(0,n.PCX)(),g=t.placeholder||"Add Photos",[f,h]=(0,m.useState)([]),[y,b]=(0,m.useState)(f.length-1>0),E=(0,m.useRef)(),A=(0,m.useCallback)(()=>{E.current.click()},[]),x=(0,m.useCallback)(()=>{let e=E.current.files;if(!e)return;let t=[];for(let l=0;l<e.length;++l)t.push({uid:c()("file"),source:URL.createObjectURL(e.item(l)),file:e.item(l)}
1);t&&(h(t),s(f),b(!0))},[f,s]),_=(0,m.useCallback)(e=>{h(t=>t.filter(t=>t.uid!==e.uid)),s(f),b(f.length-1>0)},[f,s]);return m.createElement("div",{className:l.root,"data-testid":d()(`field ${e}`)},m.createElement("div",{className:l.addPhotoWrapper},m.createElement(p.A,null,t.label),m.createElement("div",{className:l.controls,role:"button",onClick:A},m.createElement(i.A,{size:"small",color:"primary",variant:"outlined",startIcon:m.createElement(a.s4,{icon:"ico-photos-plus-o"})},g)),m.createElement("input",{ref:E,type:"file",multiple:!0,"aria-hidden":!0,className:"srOnly",accept:"image/*",onChange:x})),y&&m.createElement(m.Fragment,null,m.createElement("div",{className:l.previewList},f.map((e,t)=>m.createElement("div",{className:l.previewItem,key:t.toString()},m.createElement("img",{src:e.source,alt:""}),m.createElement(r.A,{title:u.formatMessage({id:"remove"})},m.createElement(a.s4,{icon:"ico-close",onClick:()=>_(e),className:l.deletePhoto}))))),m.createElement("div",{className:l.totalPhoto},f.length,"/10"," ",u.formatMessage({id:"photos_uploaded"}))))}},12087:function(e,t,l){l.r(t),l.d(t,{default:function(){return x}});var n=l(53993),a=l(29820),i=l(28017),r=l(20644),o=l.n(r),s=l(66521),d=l.n(s),u=l(30758),c=l(27550),m=l(39296),p=l(41818),g=l(97071),f=l(76439),v=l(5172),h=(0,f.A)(e=>(0,v.A)({answerInput:{width:"calc(100% - 130px)"},answerItem:{display:"flex"},input:{"&::placeholder":{color:e.palette.text.secondary,opacity:1}},endAdornment:{cursor:"pointer"},endAdornmentButton:{display:"flex",alignItems:"center",paddingLeft:e.spacing(2)},buttonWrapper:{display:"flex",width:"100%",justifyContent:"space-between",marginRight:e.spacing(1),marginTop:e.spacing(1),"& button":{minWidth:e.spacing(5)}},button:{"& + button":{marginLeft:e.spacing(1)},fontWeight:e.typography.fontWeightBold,fontSize:e.mixins.pxToRem(13),color:e.palette.primary.main,cursor:"pointer",display:"flex",alignItems:"center","&:hover":{textDecoration:"underline"}},visible:{visibility:"hidden"}}),{name:"AnswerPollItem"}),y=l(33153),b=l(98002),E=l.n(b),A=({lastElement:e,index:t,item:l,handleDelete:a,handleAdd:i,handleChange:r,disabled:o,submitCount:s,error:d,maxLength:f,disabledAddMore:v,disableRemove:b,meta:A,setTouched:x,name:_,fieldName:C})=>{let w=h(),{i18n:S}=(0,n.PCX)(),k=!!(d&&(A.touched||s));return u.createElement(u.Fragment,null,u.createElement("div",{className:w.answerItem},u.createElement(m.A,{className:w.answerInput,required:!0,variant:"outlined",onBlur:()=>x(!0),fullWidth:!0,margin:"normal",disabled:o,inputProps:{maxLength:f,"data-testid":E()(`input ${_}`)},label:S.formatMessage({id:"option_answer"},{value:t+1}),defaultValue:l.answer,onChange:e=>r(e,l.id),error:k,"data-testid":E()(`field ${_}`)}),u.createElement("div",{className:w.endAdornmentButton},u.createElement("div",{className:w.buttonWrapper},u.createElement(p.A,{className:w.button,onClick:()=>a(l.order),disabled:b||o,variant:"outlined",color:"primary","data-testid":E()(`button_remove ${_}`)},u.createElement(g.A,{sx:{display:{sm:"block",xs:"none"}}},S.formatMessage({id:"remove"})),u.createElement(g.A,{sx:{display:{sm:"none"}}},u.createElement(y.s4,{icon:"ico-trash-alt"}))),u.createElement(p.A,{className:e?w.button:w.visible,onClick:()=>i(),variant:"outlined",color:"primary",disabled:v||o,"data-testid":e?E()(`button_add ${C}`):E()(`button_add ${_}`)},u.createElement(g.A,{sx:{display:{sm:"block",xs:"none"}}},S.formatMessage({id:"add"})),u.createElement(g.A,{sx:{display:{sm:"none"}}},u.createElement(y.s4,{icon:"ico-plus"})))))),k?u.createElement(c.A,{error:d}):null)},x=({config:e,name:t,disabled:l,formik:r})=>{var s,m;let{i18n:p,dialogBackend:g}=(0,n.PCX)(),{minAnswers:f,maxAnswers:v,disabled:h,maxLength:y}=e,[b,E,{setValue:x,setTouched:_}]=(0,a.Mt)(null!=t?t:"PollAnswer"),[C,w]=u.useState(null==b?void 0:b.value),S=u.useRef((null==b||null==(s=b.value)?void 0:s.length)||0),k=u.useCallback(e=>{w(t=>(0,i.Ay)(t,t=>{if(t.length===f)g.alert({message:p.formatMessage({id:"you_must_have_min_answer"},{value:f})});else if(e){let l=t.findIndex(t=>t.order===e);t.splice(l,1)}else t.pop()}))},[]),M=u.useCallback((e,t)=>{let l=e.target.value;w(e=>(0,i.Ay)(e,e=>{e[t]={...e[t],answer:l}}
1))},[]),I=u.useCallback(()=>{w(e=>(0,i.Ay)(e,e=>{if(e.length===v)g.alert({message:p.formatMessage({id:"you_must_have_max_answer"},{value:v})});else{let t={item:{answer:"",order:++S.current}};e.push(t.item)}}))},[]);u.useEffect(()=>{C.length<f?I():x(C.map(e=>({...e,answer:e.answer.trim()})))},[C]);let R=d()(E.error);return u.createElement("div",null,null==C?void 0:C.map((e,n)=>u.createElement(A,{lastElement:n===C.length-1,index:n,key:e.order.toString(),item:e,maxLength:y,handleAdd:I,submitCount:r.submitCount,meta:E,setTouched:_,handleDelete:k,disabled:h||l||r.isSubmitting,handleChange:e=>M(e,n),error:o()(E.error,`[${n}].answer`),disabledAddMore:C.length===v,disableRemove:C.length===f,name:`${t}_${n+1}`,fieldName:t})),E.error&&!R?u.createElement(c.A,{error:null==(m=E.error)?void 0:m.toString()}):null)}},25106:function(e,t,l){l.r(t),l.d(t,{default:function(){return x}});var n=l(53993),a=l(33153),i=l(37254),r=l(74209),o=l(41818),s=l(97071),d=l(43890),u=l(29820),c=l(98002),m=l.n(c),p=l(1384),g=l.n(p),f=l(30758),v=l(27550);let h={width:2,position:"absolute",left:0,opacity:0},y=(0,d.Ay)(a.s4,{name:"AttachmentIcon"})(({theme:e})=>({paddingRight:e.spacing(.5),fontSize:e.mixins.pxToRem(15)})),b=(0,d.Ay)("div",{name:"AttachmentAction"})(({theme:e})=>({color:e.palette.primary.main,marginLeft:e.spacing(1.5),cursor:"pointer","&:hover":{textDecoration:"underline"}})),E=(0,d.Ay)("div",{name:"Item"})(({theme:e})=>({display:"flex",marginTop:e.spacing(1),fontSize:e.mixins.pxToRem(13),lineHeight:1.5})),A=(0,d.Ay)("div",{name:"ItemInfo"})(({theme:e})=>({display:"flex"}));function x({config:e,name:t,disabled:l,formik:d,required:c}){var p;let{dialogBackend:x,i18n:_}=(0,n.PCX)(),[C,w,{setValue:S}]=(0,u.Mt)(null!=t?t:"rawFile"),{required:k,item_type:M,fullWidth:I=!0,margin:R="normal",showPreview:T,preventRemove:z,size:$,max_upload_filesize:P,disabled:W,accept:F,upload_url:L,storage_id:q}=e,[B,O]=(0,f.useState)(C.value),j=(0,f.useRef)(),D=e.placeholder||"Attach File";(0,f.useEffect)(()=>{S(B)},[B]);let N=(0,f.useCallback)(()=>{x.confirm({message:_.formatMessage({id:"are_you_sure_you_want_to_delete_attachment_file"}),title:_.formatMessage({id:"are_you_sure"})}).then(e=>{e&&O(null)})},[]),V=(0,f.useCallback)(()=>{var e;let t=j.current.files;if(0===t.length)return;let l={file_name:t.item(0).name,download_url:URL.createObjectURL(t.item(0)),file:t.item(0),file_type:null==(e=t.item(0))?void 0:e.type,key:g()("file"),fileItemType:M,status:"new",...L&&{upload_url:L,uid:g()("file"),storage_id:null!=q?q:null}},n=l.file.size,a=l.file_name;if(n>P&&0!==P)return void x.alert({message:_.formatMessage({id:"warning_upload_limit_one_file"},{fileName:(0,i.Tu)(a,30),fileSize:(0,i.lT)(l.file.size),maxSize:(0,i.lT)(P)})});l&&O(l)},[B]),U=(0,f.useCallback)(()=>{j.current.click()},[]),X=null==B||null==(p=B.file_type)?void 0:p.match("image/*"),H=!!(w.error&&(w.touched||d.submitCount));return f.createElement(r.A,{fullWidth:I,margin:R,size:$,"data-testid":m()(`field ${t}`)},B?f.createElement(s.A,null,T&&X?f.createElement(s.A,{sx:{"& img":{width:"auto",maxWidth:"120px",maxHeight:"120px"}}},f.createElement(a._V,{src:(null==B?void 0:B.url)||(null==B?void 0:B.download_url)})):null,f.createElement(E,null,f.createElement(A,null,f.createElement(y,{icon:"ico-paperclip-alt"}),f.createElement("div",null,B.file_name)),z?f.createElement(b,{onClick:()=>U()},_.formatMessage({id:"edit"})):f.createElement(b,{onClick:()=>N()},_.formatMessage({id:"remove"})))):f.createElement("div",null,f.createElement(o.A,{variant:"outlined",size:"small",color:"primary","data-testid":m()(`button ${t}`),onClick:U,disabled:W||l||d.isSubmitting,startIcon:f.createElement(a.s4,{icon:"ico-paperclip-alt"})},k||c?"*":null,D)),H&&f.createElement(v.A,{error:w.error}),f.createElement("input",{onClick:e=>{e.currentTarget.value=null},"data-testid":m()(`input ${t}`),ref:j,style:h,accept:F,"aria-hidden":!0,type:"file",multiple:!1,onChange:V}))}},27550:function(e,t,l){l.d(t,{A:function(){return o}});var n=l(30758),a=l(57717),i=l.n(a);let r=e=>e?i()(e)?r(Object.values(e)[0]):e.toString():null;function o({error:e,className:t="invalid-feedback order-last"}){return e?n.createElement("div",{"data-testid":"error",className:t},r(e)):null}},39532:function(e,t,l){l.r(t);var n=l(37254),a=l(97071),i=l(39296),r=l(98065),o=l(74209),s=l(84209),d=l(97397),u=l(5949),c=l(63101),m=l(29820),p=l(98002),g=l.n(p),f=l(20644),v=l.n(f),h=l(66521),y=l.n(h),b=l(3029),E=l.n(b),A=l(12119),x=l.n(A),_=l(57468),C=l.n(_),w=l(30758),S=l(43890),k=l(53993),M=l(56362);let I=(0,S.Ay)("span")(({theme:e})=>({paddingLeft:e.spacing(1.5)}));t.default=({config:e,disabled:t,required:l,name:p,formik:f})=>{var h,b,A;let[_,S,{setValue:R,setTouched:T}]=(0,m.Mt)(null!=p?p:"SelectField"),{slotName:z}=(0,M.lA)(),{label:$,margin:P,disabled:W,fullWidth:F,hiddenLabel:L,required:q,variant:B,size:O,sx:j,sxFieldWrapper:D,description:N,defaultValue:V="",value_type:U,multiple:X=!1,autoComplete:H="off",options:Q=[],subOptionPrefix:G=" ⢠",suboptions:J={},allowParent:K=!0,subOptionKey:Y="options",labelProp:Z="label",valueProp:ee="value",relatedFieldName:et,optionRelatedMapping:el,alwaysShow:en,disableClearable:ea,disablePortal:ei}=e,[er]=(0,m.Mt)(null!=et?et:`${p}_child`),[eo,es]=w.useState([]),[ed,eu]=w.useState([]),{i18n:ec,useIsMobile:em}=(0,k.PCX)(),ep=em();w.useEffect(()=>{if(et){if(el){if(y()(null==er?void 0:er.value))return;let e=el[null==er?void 0:er.value]||[];if(eu(e),e.some(e=>e.value===_.value))return;let t=e.find(e=>null==e?void 0:e.is_default);R((null==t?void 0:t.value)||null);return}y()(null==er?void 0:er.value)?es(null==er?void 0:er.value):es([null==er?void 0:er.value])}},[et,null==er?void 0:er.value]);let eg=!!(S.error&&(S.touched||f.submitCount)),ef=(0,c.Z)({stringify:({label:e})=>`${e}`}),ev=w.useCallback((e,t)=>{let l=+!!t.prefix;return(null==t?void 0:t.level)&&(l=(null==t?void 0:t.level)-1),w.createElement(a.A,{"data-value":null==t?void 0:t.value,component:"li",...e,key:`${null==t?void 0:t.value}${null==t?void 0:t.label}`},l?E()(0,l).map((e,t)=>
1w.createElement(I,{key:`indent${t}`})):"",t.label)},[]),eh=w.useMemo(()=>{let e=[];return(y()(Q)&&(e=ed.length&&el?ed:Q.filter(e=>!eo.includes(e.value))),y()(Q))?(0,n.kU)(e,J,K,Y,G,0,ee,Z):[]},[el,ed,Q,J,Y,K,G,ee,Z,eo]),{optionsActive:ey,optionsUnactive:eb}=eh.reduce((e,t)=>(void 0!==t.is_active?t.is_active?e.optionsActive.push(t):e.optionsUnactive.push(t):e.optionsActive.push(t),e),{optionsActive:[],optionsUnactive:[]}),eE=w.useMemo(()=>{let e={};return eh.forEach(t=>{e[t.value]=t}),e},[eh]),eA=w.useMemo(()=>Q.findIndex(e=>e.value===_.value),[_.value,Q]),ex=w.useCallback(e=>{if(e){let t=e.value;R("array"===U?[t]:t)}else R("array"===U?[]:null)},[]),e_=w.useMemo(()=>{if(X)if(y()(_.value))return _.value.map(e=>eE[e]).filter(e=>void 0!==e);else return[];{let e=y()(_.value)?_.value[0]:_.value;if(void 0!==e)return eE[e]}},[_.value,X,eE]),eC=w.useMemo(()=>{if(X)if(y()(V))return V.map(e=>eE[e]).filter(e=>void 0!==e);else return[];{let e=y()(V)?V[0]:V;if(void 0!==e)return eE[e]}},[]);if(!eh.length&&!en)return null;let ew=e=>{13===e.keyCode&&e.preventDefault()},eS=x()(y()(e_)?e_:[e_],eb,C()),ek=eS.length;return w.createElement(o.A,{margin:null!=P?P:"normal",disabled:W,fullWidth:F,hiddenLabel:L,required:q||l,sx:D,error:eg,size:O,variant:B,"data-testid":g()(`field ${p}`)},w.createElement(s.A,{clearText:ec.formatMessage({id:"clear"}),openText:ec.formatMessage({id:"open"}),closeText:ec.formatMessage({id:"close"}),filterOptions:ef,disableClearable:ea||q,openOnFocus:!0,value:null!=(A=null!=e_?e_:eC)?A:V,disabled:W||t||f.isSubmitting,defaultValue:null!=eC?eC:V,onChange:(e,t)=>
1((null==S?void 0:S.touched)||T(!0),X?void(y()(t)?R(t.map(e=>e.value)):R([])):ex(t)),onBlur:e=>{_.onBlur(e),T(!0)},id:`select-${p}`,sx:j,isOptionEqualToValue:(e,t)=>v()(e,"value")==v()(t,"value"),options:ey,noOptionsText:ec.formatMessage({id:"no_options"}),getOptionDisabled:e=>e.disabled,multiple:X,getOptionLabel:e=>{var t;return null!=(t=v()(e,"label"))?t:""},autoHighlight:!0,renderInput:e=>w.createElement(i.A,{...e,label:$,variant:B,size:O,fullWidth:!0,onKeyDown:ew,error:eg,required:q||l,inputProps:{...e.inputProps,"data-testid":g()(`input ${p}`),form:{autoComplete:H}},sx:j}),renderOption:ev,renderTags:(e,t)=>e.map((e,l)=>w.createElement(r.A,{...t({index:l}),key:null==e?void 0:e.value,label:null==e?void 0:e.label,sx:{opacity:eb.map(e=>e.value).includes(null==e?void 0:e.value)?.5:void 0}})),ListboxProps:{"data-testid":g()(`menu ${p}`)},"data-testid":g()(`input ${p}`),disablePortal:null!=ei?ei:"side"===z&&!ep}),!N&&(null==(h=Q[eA])?void 0:h.description)&&w.createElement(d.A,{sx:{fontSize:"13px"},color:"text.hint",mt:1},null==(b=Q[eA])?void 0:b.description),N&&w.createElement(d.A,{sx:{fontSize:"13px"},color:"text.hint",mt:1},N),ek>0&&w.createElement(d.A,{mt:1,color:"warning.main",variant:"body2"},ec.formatMessage({id:"the_following_option_s_have_been_deactivated"},{values:eS.map(e=>e.label).join(", "),total:ek})),eg&&w.createElement(u.A,null,null==S?void 0:S.error))}},41590:function(e,t,l){l.r(t),l.d(t,{default:function(){return S}});var n,a=l(53993),i=l(43890),r=l(41818),o=l(74209),s=l(97071),d=l(39296),u=l(78930),c=l(70614),m=l(29820),p=l(98002),g=l.n(p),f=l(4633),v=l.n(f),h=l(4239),y=l.n(h),b=l(30758),E=l(27550),A=l(67804),x=((n={})[n.FreeAnswer=0]="FreeAnswer",n[n.Select=1]="Select",n[n.CheckBox=2]="CheckBox",n),_=l(33153);let C=(0,i.Ay)(r.A)(({theme:e})=>({fontWeight:e.typography.fontWeightMedium,fontSize:e.mixins.pxToRem(13),color:e.palette.primary.main,cursor:"pointer",display:"flex",alignItems:"center",marginTop:e.spacing(.5),marginLeft:e.spacing(1.2),width:"fit-content","&:hover":{textDecoration:"underline"},"& .ico":{marginRight:e.spacing(1)}})),w=[{value:x.CheckBox,label:"checkbox"},{value:x.Select,label:"multiple_choice"},{value:x.FreeAnswer,label:"written_answer"}];var S=({name:e,formik:t,disabled:l})=>{var n,i,r,p,f,h;let{i18n:S,getSetting:k}=(0,a.PCX)(),M=(0,m.j7)(),I=parseInt(k("group.minimum_membership_question_option")||1);return b.useEffect(()=>{var e,l,n,a,i,r;let o=[];v()(null==(e=M.initialValues)?void 0:e.options)&&(o=Array(I).fill(0).map((e,t)=>({title:"",id:new Date().getMilliseconds()+t,status:"new"}))),v()(null==(l=M.initialValues)?void 0:l.options)||(o=null==(i=M.initialValues)?void 0:i.options),v()(null==(n=M.values)?void 0:n.options)||(o=null==(r=M.values)?void 0:r.options),(null==(a=M.values)?void 0:a.type_id)===x.FreeAnswer&&(o=void 0),t.setFieldValue("options",o,!0)},[null==(n=M.values)?void 0:n.type_id]),b.createElement(o.A,{fullWidth:!0,margin:"normal","data-testid":g()(`field ${e}`)},b.createElement(s.A,null,b.createElement(s.A,{sx:{height:"40px",display:"flex"}},b.createElement(d.A,{id:"question",name:"question",sx:{flex:1,minWidth:0,marginRight:2},size:"small",label:S.formatMessage({id:"add_a_question"}),variant:"outlined",inputProps:{maxLength:255},error:!!(t.submitCount&&t.errors.question),value:null==(i=M.values)?void 0:i.question,onChange:t.handleChange,onBlur:e=>{var l,n;(null==(n=M.values)||null==(l=n.question)?void 0:l.trim())||t.setFieldValue("question",""),t.handleBlur(e)}}),b.createElement(u.A,{id:"type_id",name:"type_id",sx:{height:"100%"},value:null==(r=M.values)?void 0:r.type_id,onChange:t.handleChange},w.map(({value:e,label:t},l)=>b.createElement(c.A,{key:l.toString(),value:e},S.formatMessage({id:t}))))),b.createElement(E.A,{error:null==(p=t.errors)?void 0:p.question})),M.values.type_id!==x.FreeAnswer?b.createElement(b.Fragment,null,null==(h=M.values)||null==(f=h.options)?void 0:f.map((e,l)=>{var n,a,i;return b.createElement(A.default,{minAnswer:I,formik:M||t,key:e.id.toString(),value:e.title,type:M.values.type_id,error:!v()(null==(n=t.errors)?void 0:n.options)&&(null==(i=t.errors)||null==(a=i.options)?void 0:a[l]),onRemove:()=>(e=>{var l;let n=null==(l=M.values.options)?void 0:l.map(t=>
1t.id===e?(null==t?void 0:t.status)==="new"?{...t,status:"delete"}:{...t,status:"remove"}:t);t.setFieldValue("options",n.filter(e=>(null==e?void 0:e.status)!=="delete"))})(e.id),onChange:l=>((e,l)=>{var n;let{value:a}=e.target,i=null==(n=M.values.options)?void 0:n.map(e=>e.id===l.id?{...e,title:a.trim(),status:"new"!==l.status?"update":"new"}:e);t.setFieldValue("options",i)})(l,e)})}),b.createElement(C,{onClick:()=>{var e;let l=[...null==(e=M.values)?void 0:e.options,{title:"",id:new Date().getMilliseconds(),status:"new"}];t.setFieldValue("options",l)},variant:"text",color:"primary",size:"small",disabled:l},b.createElement(_.s4,{icon:"ico-plus"}),S.formatMessage({id:"add_answer"})),y()(t.errors)&&b.createElement(E.A,{error:t.errors})):null)}},56432:function(e,t,l){l.r(t),l.d(t,{default:function(){return A}});var n=l(97071),a=l(97375),i=l(58791),r=l.n(i),o=l(39419),s=l.n(o),d=l(37562),u=l.n(d),c=l(82645),m=l.n(c),p=l(14340),g=l.n(p),f=l(1855),v=l.n(f),h=l(30758),y=l(35655),b=l(53993),E=l(29820);function A({config:{excludeFields:e,component:t,label:l="reset",align:i="right",...o},name:d,formik:c}){let{i18n:p}=(0,b.PCX)(),{value:f,acceptPageParams:A}=(0,y.$J)(),{values:x={},setValues:_}=(0,E.j7)(),C=s()({...f},e),w=s()(Object.assign({},x),e),S=r()(Object.assign({},x),e),k=g()(C,u()(w,e=>!e),(e,t)=>{if(A&&(v()(e)||v()(t)))return e==t}),M=h.useCallback(()=>{k||_({...S,...C})},[C,k,S]),I=m()(M,200);return h.createElement(n.A,{sx:{textAlign:i},...o},h.createElement(a.A,{color:"primary",component:"button",variant:"body2",onClick:()=>{I()},disabled:k,type:"button"},l&&p.formatMessage({id:l})))}},56879:function(e,t,l){l.r(t),l.d(t,{default:function(){return D}});var n=l(53993),a=l(33153),i=l(37254),r=l(41818),o=l(71129),s=l(97397),d=l(97071),u=l(81916),c=l(74209),m=l(43890),p=l(29820),g=l(28017),f=l(98002),v=l.n(f),h=l(1384),y=l.n(h),b=l(82645),E=l.n(b),A=l(4239),x=l.n(A),_=l(66521),C=l.n(_),w=l(4633),S=l.n(w),k=l(30758),M=l(27550),I=l(35655);let R=(0,m.Ay)("div",{name:"RootStyled"})(({theme:e})=>({padding:e.spacing(2),marginBottom:e.spacing(1.5),border:"1px solid #eeeeee","& > div":{width:"100%"}}));var T=function({initialValues:e,formSchema:t,dataSource:l,onChange:n}){let a=k.useCallback(t=>{let l=((e,t)=>{let l={};if(!S()(t))return Object.keys(e).forEach(n=>{t[n]!==e[n]&&(l[n]="string"==typeof t[n]?t[n].trim():t[n])}),l})(e,null==t?void 0:t.values);if(!S()(l))for(let e in l)Object.prototype.hasOwnProperty.call(l,e)&&n(null==l?void 0:l[e],e)},[n,e]);if(!(S()(t)&&S()(l)))return k.createElement(R,null,k.createElement(I.FF,{noHeader:!0,noTitle:!0,initialValues:e,formSchema:t,dataSource:l,onChange:a}))};let z="MultiAudioField",$=(0,m.Ay)(r.A,{name:z,slot:"DropButton"})(({theme:e,isOver:t})=>({...t&&{backgroundColor:e.palette.action.hover}})),P=(0,m.Ay)("div",{name:z,slot:"AudioUploaded"})(({theme:e})=>({display:"flex",fontSize:e.mixins.pxToRem(13),justifyContent:"space-between",paddingBottom:e.spacing(1),"& .ico-music-note-o":{fontSize:e.mixins.pxToRem(15)}})),W=(0,m.Ay)("div",{name:z,slot:"IconAction"})(({theme:e})=>({display:"flex","& > span":{marginLeft:e.spacing(1)}})),F=(0,m.Ay)("div",{name:z,slot:"DropzoneBox"})(({theme:e})=>({width:"fit-content"})),L=(0,m.Ay)(o.A,{name:z,slot:"Label"})(({theme:e,haveError:t})=>({...t&&{color:e.palette.error.main}})),q=(0,m.Ay)(s.A,{name:z,slot:"Noti"})(({theme:e,haveError:t})=>({...t&&{color:e.palette.error.main}})),B=(0,m.Ay)(s.A,{name:z,slot:"TitleSong"})(({theme:e})=>({marginLeft:e.spacing(1),marginRight:e.spacing(1),overflowWrap:"anywhere"})),O=(0,m.Ay)("div",{name:z,slot:"WrapTitleStyled"})(({theme:e})=>({display:"flex",alignItems:"center"}));function j({item:e,index:t,handleChange:l,showEditAudio:n,handleEditAudio:r,handleRemoveAudio:o,error:c,enabled:m,progress:p,uploading:g,formSchemaEditItem:f,dataSourceEditItem:v}){if("remove"===e.status)return null;let h=C()(c)&&c[t],y=S()(f)&&S()(v);return k.createElement(k.Fragment,null,k.createElement(P,{"data-testid":`audioUploaded_${t}`},k.createElement(O,{"data-testid":`audioUploadedWrapTitle_${t}`},k.createElement(a.s4,{icon:"ico-music-note-o"}),k.createElement(B,{"data-testid":`audioUploadedTitle_${t}`,color:h?"error":null},(0,i.Tu)(null==e?void 0:e.file_name,70))),k.createElement(W,{"data-testid":`audioUploadedAction_${t}`},g?k.createElement(d.A,{sx:{minWidth:"100px",pl:1,mt:"6px"}},k.createElement(u.A,{"data-testid":`audioUploadedProgress_${t}`,variant:"determinate",value:p||0})):k.createElement(k.Fragment,null,y?null:k.createElement(s.A,{"data-testid":`audioUploadedEdit_${t}`,variant:"body2",color:"primary",component:"span",role:"button",onClick:()=>m&&r((null==e?void 0:e.id)||(null==e?void 0:e.uid))},k.createElement(a.s4,{icon:"ico-compose"})),k.createElement(s.A,{"data-testid":`audioUploadedRemove_${t}`,variant:"body2",color:"primary",component:"span",role:"button",onClick:()=>m&&o(t)},k.createElement(a.s4,{icon:"ico-close"}))))),y||n!==((null==e?void 0:e.id)||(null==e?void 0:e.uid))?null:k.createElement(T,{initialValues:e,formSchema:f,dataSource:v,onChange:(e,n)=>l(e,t,n)}))}
1function D({name:e,config:t,disabled:l,formik:r}){let{label:o="Select songs",description:s,item_type:u,accept:m="audio/mp3",max_upload_filesize:f,max_length_name:h=100,maxFilesPerUpload:b,maxFiles:A,upload_url:_,disabled:C,storage_id:w,placeholder:S,appName:I,resourceName:R,formEditItem:T,dataSourceName:z,messageAcceptFail:P}=t,{dialogBackend:W,i18n:B}=(0,n.PCX)(),O=(0,n.EkY)(I,R,T),D=(0,n.IgF)(I,R,z),[N,V]=k.useState(),U=(0,k.useRef)(),[X,H,{setValue:Q,setTouched:G}]=(0,p.Mt)(null!=e?e:"ItemPhotoField"),[J,K]=k.useState(X.value||[]),[Y,Z]=k.useState({}),ee=()=>{U.current.click()},et=e=>{let t=e.lastIndexOf(".");return e.slice(0,t)},el=k.useCallback(e=>{W.confirm({message:B.formatMessage({id:"are_you_sure_you_want_to_delete_attachment_file"}),title:B.formatMessage({id:"are_you_sure"})}).then(t=>{t&&K(t=>(0,g.Ay)(t,t=>{t[e].id?t[e].status="remove":t.splice(e,1)}))})},[]),en=k.useCallback(e=>{N!==e?V(e):V(null)},[N]);k.useEffect(()=>{Q(J.map((e,t)=>({...e,onUploadProgress:e=>((e,t)=>{let l=Math.round(100*e.loaded/e.total);Z(e=>({...e,[t]:l}))})(e,t)})))},[J]);let ea=e=>{let t=[];for(let n of Object.keys(e)){var l;let a={id:0,status:"new",upload_url:_,name:et(e[n].name).slice(0,h),description:"",source:URL.createObjectURL(e[n]),file:e[n],file_name:e[n].name,file_size:e[n].size,file_type:e[n].type,uid:y()("file"),fileItemType:u,storage_id:null!=w?w:null},r=null==a?void 0:a.file_size;if(!(0,i.HH)(null==(l=e[n])?void 0:l.type,m)){W.alert({message:B.formatMessage({id:P||"file_accept_type_fail"})}),(null==U?void 0:U.current)&&(U.current.value=null);break}if(r>(null==f?void 0:f.music)&&(null==f?void 0:f.music))return void W.alert({message:B.formatMessage({id:"warning_upload_limit_one_file"},{fileName:(0,i.Tu)(a.file_name,30),fileSize:(0,i.lT)(a.file_size),maxSize:(0,i.lT)(null==f?void 0:f.music)})});t.push(a)}t.length&&K((0,g.Ay)(e=>{e.push(...t)}))},ei=k.useCallback(()=>{let e=U.current.files;e&&(G(!0),ea(e))},[J]),er=E()((e,t,l)=>{K((0,g.Ay)(n=>{n[e].id&&(n[e].status="update"),n[e][l]=t}))},1e3),eo=(e,t,l)=>{er(t,e,l)},es=J.filter(e=>e.uid),ed=!!(H.error&&(H.touched||r.submitCount));return k.createElement(c.A,{fullWidth:!0,margin:"normal","data-testid":v()(`field ${e}`)},k.createElement(L,{haveError:ed,required:!0,variant:"outlined",shrink:"true"},o),k.createElement(d.A,{sx:{p:2,pt:2.5}},k.createElement(q,{variant:"body2",color:"text.hint",mb:1.5,component:"p"},s),k.createElement(F,null,k.createElement(a.dl,{onDrop:e=>{e&&ea(e)},render:({isOver:t})=>k.createElement($,{onClick:ee,size:"small",color:"primary",sx:{fontWeight:"bold"},isOver:t,variant:"outlined",disabled:C||l||r.isSubmitting||J.length>=A||es.length>=b,"data-testid":v()(`button ${e}`),startIcon:k.createElement(a.s4,{icon:"ico-upload"})},S)})),J.length>0&&k.createElement(d.A,{"data-testid":v()("audio uploaded list"),sx:{mt:2}},J.map((e,t)=>k.createElement(j,{i18n:B,key:t.toString(),handleRemoveAudio:el,handleChange:eo,handleEditAudio:en,showEditAudio:N,index:t,item:e,error:H.error,enabled:!r.isSubmitting,progress:Y[t],uploading:r.isSubmitting,formSchemaEditItem:O,dataSourceEditItem:D}))),ed&&x()(H.error)?k.createElement(M.A,{error:H.error}):null),k.createElement(a._r,{haveError:ed,children:t.label,variant:"outlined"}),k.createElement("input",{ref:U,onClick:e=>{e.currentTarget.value=null},className:"srOnly",type:"file","data-testid":v()(`input ${e}`),multiple:!0,accept:m,onChange:ei}))}},60408:function(e,t,l){l.r(t),l.d(t,{default:function(){return g}});var n=l(97071),a=l(74209),i=l(43890),r=l(33153),o=l(98002),s=l.n(o),d=l(30758);let u=(0,i.Ay)(n.A,{name:"ImageWrapper"})(({theme:e})=>({width:"auto",maxWidth:e.mixins.pxToRem(240),maxHeight:e.mixins.pxToRem(150),margin:"0 auto",height:e.mixins.pxToRem(150),display:"flex",alignItems:"center","& img":{maxHeight:e.mixins.pxToRem(150)},[e.breakpoints.down("sm")]:{height:"auto"}})),c=(0,i.Ay)(r.s4,{name:"Icon"})(({theme:e})=>({fontSize:e.mixins.pxToRem(20),[e.breakpoints.down("sm")]:{padding:e.spacing(3,0),transform:"rotate(90deg)"}})),m=(0,i.Ay)(n.A,{name:"Wrapper"})(({theme:e})=>({display:"flex",justifyContent:"space-evenly",alignItems:"center",marginTop:e.spacing(2),[e.breakpoints.down("sm")]:{flexDirection:"column"}})),p=(0,i.Ay)(n.A,{name:"TitleWrapper"})(({theme:e})=>({width:"auto",maxWidth:e.mixins.pxToRem(240),wordBreak:"break-all"}));function g({config:e,name:t}){var l,i;let{fullWidth:o=!0,margin:g="normal",arrowConfig:f,from:v,to:h}=e,y=null==v||null==(l=v.dataSource.file_type)?void 0:l.match("image/*"),b=null==h||null==(i=h.dataSource.file_type)?void 0:i.match("image/*");return d.createElement(a.A,{fullWidth:o,margin:g,"data-testid":s()(`field ${t}`)}
1,d.createElement(m,null,d.createElement(n.A,null,y?d.createElement(u,null,d.createElement(r._V,{src:null==v?void 0:v.dataSource.url})):d.createElement(p,null,null==v?void 0:v.dataSource.url)),d.createElement(c,{icon:f.icon}),d.createElement(n.A,null,b?d.createElement(u,null,d.createElement(r._V,{src:null==h?void 0:h.dataSource.url})):d.createElement(p,null,null==h?void 0:h.dataSource.url))))}},66499:function(e,t,l){l.r(t),l.d(t,{default:function(){return I}});var n=l(53993),a=l(43890),i=l(97071),r=l(97397),o=l(48749),s=l(29820),d=l(98002),u=l.n(d),c=l(20644),m=l.n(c),p=l(30758),g=l(33153),f=l(89123),v=l(63478),h=l(4633),y=l.n(h);let b=(0,a.Ay)("div",{name:"FilterCategoryField",slot:"itemCategoryFilter",overridesResolver(e,t){return[t.itemCategoryFilter]}})(({theme:e})=>({"&.hasSubs":{display:"flex",alignItems:"center","& > div":{paddingRight:e.spacing(5)}},"&.itemActive":{"& > div":{color:e.palette.primary.main,fontWeight:e.typography.fontWeightBold}}})),E=(0,a.Ay)("div")(({theme:e})=>({minHeight:e.spacing(7),flex:1,minWidth:0,padding:e.spacing(1,2),"&:hover":{backgroundColor:e.palette.action.selected,borderRadius:e.shape.borderRadius},cursor:"pointer",fontSize:e.mixins.pxToRem(15),display:"flex",flexDirection:"row",alignItems:"center",color:"light"===e.palette.mode?e.palette.text.primary:e.palette.text.secondary,textDecoration:"none",position:"relative"})),A=(0,a.Ay)(f.A)(({theme:e})=>({position:"absolute",width:32,height:32,right:e.spacing(1),"& .ico":{fontSize:e.mixins.pxToRem(15),paddingLeft:0}})),x=(0,a.Ay)("ul")(({theme:e})=>({borderLeft:`1px solid ${e.palette.border.secondary}`,listStyle:"none",margin:e.spacing(0,0,0,2),padding:"0 0 0 2px"})),_=(e,t)=>
1{var l;return!!((null==e||null==(l=e.subs)?void 0:l.length)>0&&e.subs.some(e=>e.id.toString()===t||_(e,t)))};function C({item:e,handleSelect:t,active:l,classes:n,category_id:a}){var r;let[o,s]=p.useState(!1);p.useEffect(()=>{if(_(e,a))return void s(!0)},[a]);let d=p.useCallback(()=>{s(e=>!e)},[]),u=(e,l)=>{t(e,l)};return p.createElement(i.A,null,p.createElement(b,{className:(0,v.A)(!y()(e.subs)&&"hasSubs",l&&"itemActive")},p.createElement(E,{onClick:()=>u(e.id,e.resource_name),"data-testid":"itemCategory",color:"inherit","aria-selected":l,"aria-label":e.name},p.createElement("span",null,e.name)),y()(e.subs)?null:p.createElement(A,{size:"small",onClick:d},p.createElement(g.s4,{icon:o?"ico-angle-up":"ico-angle-down"}))),o&&(null==e||null==(r=e.subs)?void 0:r.length)>0?p.createElement(x,null,null==e?void 0:e.subs.map((e,t)=>p.createElement("div",{key:e.id},p.createElement(C,{item:e,classes:n,handleSelect:u,active:e.id.toString()===a,category_id:a})))):null)}let w="FilterCategoryField",S=(0,a.Ay)(i.A,{name:w,slot:"dividerCategory",overridesResolver(e,t){return[t.dividerCategory]}})(({theme:e})=>({paddingTop:e.spacing(2),paddingBottom:e.spacing(2)})),k=(0,a.Ay)(r.A,{name:w,slot:"titleCategoryFilter",overridesResolver(e,t){return[t.titleCategoryFilter]}})(({theme:e})=>({paddingBottom:e.spacing(1)})),M=(0,a.Ay)(i.A,{name:w,slot:"menuCategoryFilter",overridesResolver(e,t){return[t.menuCategoryFilter]}})(({theme:e})=>({paddingBottom:e.spacing(3)}));function I({config:{label:e,apiUrl:t,dataSource:l=[],defaultValue:a},name:i}){let[,,{setValue:r}]=(0,s.Mt)(i),{useFetchItems:d,usePageParams:c,i18n:g}=(0,n.PCX)(),f=c(),v=m()(f,i),[h]=d({dataSource:{apiUrl:t},data:[],cache:!0}),y=h.length>0?h:l,b=p.useCallback(e=>{r(e)},[]),E=p.useCallback(()=>{r(void 0)},[]);return p.createElement("div",{"data-testid":u()(`field ${i}`)},p.createElement(S,{sx:{pt:2,pb:2}},p.createElement(o.A,null)),p.createElement(k,{component:"h4",variant:"h4",color:"textPrimary",sx:{pb:1}},e),p.createElement(M,null,y&&y.length?p.createElement(C,{item:{name:g.formatMessage({id:"all"})},handleSelect:E,key:"all",active:!v,category_id:v}):null,y.map(e=>p.createElement(C,{item:e,handleSelect:b,key:e.id,active:v===String(e.id),category_id:v}))))}},67804:function(e,t,l){l.r(t);var n,a=l(53993),i=l(33153),r=l(62068),o=l(92162),s=l(97071),d=l(39296),u=l(83933),c=l(43890),m=l(4633),p=l.n(m),g=l(30758),f=l(27550);let v=(0,c.Ay)("div",{name:"StyledAnswer"})(({theme:e})=>({display:"flex",alignItems:"center",paddingTop:e.spacing(2)})),h=(0,c.Ay)("div",{name:"AnswerItem",slot:"IconClose"})(({theme:e})=>({cursor:"pointer",display:"flex",justifyContent:"center",alignItems:"center",width:e.spacing(5),height:e.spacing(5),margin:e.spacing(0,.5),"& .ico":{fontSize:e.mixins.pxToRem(16),color:e.palette.text.hint}}));var y=((n=y||{})[n.FreeAnswer=0]="FreeAnswer",n[n.Select=1]="Select",n[n.CheckBox=2]="CheckBox",n);t.default=({formik:e,type:t,value:l,onRemove:n,onChange:c,onBlur:m,error:y,minAnswer:b})=>{let{i18n:E,dialogBackend:A}=(0,a.PCX)(),[x,_]=(0,g.useState)(0===t),[C,w]=(0,g.useState)(l||""),[S,k]=(0,g.useState)(null);g.useEffect(()=>{p()(y)||k(y)},[y]);let M=e=>{p()(e)?k(E.formatMessage({id:"error_the_field_is_required"},{field:"answer"})):k(null)},I=(0,g.useMemo)(()=>2===t?g.createElement(r.A,{disabled:!0}):1===t?g.createElement(o.A,{disabled:!0}):void 0,[t]);return x?null:g.createElement(v,null,g.createElement(s.A,{sx:{flex:1}},g.createElement(s.A,{sx:{display:"flex"}},I,g.createElement(d.A,{size:"small",fullWidth:!0,id:"outlined-basic",value:C,variant:"outlined",onChange:e=>{let{value:t}=e.target;M(t),w(t),c&&c(e)},onBlur:e=>{let{value:t}=e.target;m&&m(e),M(t)},inputProps:{maxLength:255},error:!!(e.submitCount&&S)}),g.createElement(h,{onClick:()=>{var t;if((null==(t=e.values.options)?void 0:t.length)<=b)return void A.alert({message:E.formatMessage({id:"you_must_have_min_answer"},{value:b})});n&&n(),_(!0)}},g.createElement(u.A,{title:E.formatMessage({id:"remove_answer"}),placement:"top"},g.createElement(i.s4,{icon:"ico-close"})))),S?g.createElement(s.A,{ml:5},g.createElement(f.A,{error:S})):null))}},69103:function(e,t,l){l.r(t);var n=l(33153),a=l(45873),i=l(97071),r=l(92162),o=l(97397),s=l(74209),d=l(68590),u=l(80922),c=l(43890),m=l(29820),p=l(98002),g=l.n(p),f=l(30758),v=l(27550),h=l(171);let y=(0,c.Ay)(a.A,{name:"Title"})(({theme:e})=>({marginBottom:e.spacing(1)})),b=(0,c.Ay)(i.A)(({theme:e})=>({display:"flex",alignItems:"center"})),E=(0,c.Ay)(r.A)(({theme:e})=>({height:42,width:42})),A=(0,c.Ay)(o.A)(({theme:e})=>({marginLeft:e.spacing(3.75)}));t.default=({config:e,name:t,disabled:l,required:a,formik:r})=>{var c;let[p,x]=(0,m.Mt)(null!=t?t:"RadioGroupField"),{options:_,label:C,margin:w="normal",variant:S,fullWidth:k,disabled:M,labelPlacement:I,inline:R,size:T,required:z,hasFormOrder:$=!1,order:P,description:W,titleConfig:F={},descriptionConfig:L,descriptionPlacement:q="top"}=e,B=$&&P?`${P}. `:null,O=!!(x.error&&(x.touched||r.submitCount));return f.createElement(s.A,{component:"fieldset",margin:w,variant:S,disabled:M||l||r.isSubmitting,fullWidth:k,size:T,"data-testid":g()(`field ${t}`),required:z},C||B?f.createElement(y,{focused:!1,required:z||a,...F},B,C):null,W&&"top"===q?f.createElement(o.A,{my:1,color:"text.secondary",variant:"body2",...L},W):null,f.createElement(d.A,{"aria-label":C,name:p.name,value:null==(c=p.value)?void 0:c.toString(),onChange:p.onChange,style:R?{flexDirection:"row"}:void 0,sx:{alignItems:"start"}},_?_.map((e,t)=>{var a;return f.createElement(i.A,{key:t.toString()},f.createElement(u.A,{sx:{alignItems:"center"},labelPlacement:I,value:null==(a=e.value)?void 0:a.toString(),disabled:M||e.disabled||l||r.isSubmitting,control:f.createElement(E,{disabled:e.disabled}),label:f.createElement(b,{sx:{my:1}},e.icon?f.createElement(n.s4,{sx:{marginRight:"8px"},icon:e.icon}):null,f.createElement(h.A,{text:e.label,hint:e.hint}))}),(null==e?void 0:e.description)?f.createElement(A,{variant:"body2",color:M||e.disabled||l||r.isSubmitting?"text.disabled":"text.secondary"},e.description):null)}):null),W&&"bottom"===q?f.createElement(o.A,{my:1,color:"text.secondary",variant:"body2",...L},W):null,O?f.createElement(v.A,{error:x.error}):null)}},71912:function(e,t,l){l.r(t),l.d(t,{default:function(){return b}});var n=l(35655),a=l(53993),i=l(97071),r=l(41818),o=l(43890),s=l(98002),d=l.n(s),u=l(4633),c=l.n(u),m=l(67194),p=l.n(m),g=l(30758);let f=(0,o.Ay)("div",{name:"StyledItemView"})(({theme:e})=>{var t;return{display:"flex",alignItems:"baseline",width:"100%",justifyContent:"flex-start",padding:e.spacing(2.75,0),[e.breakpoints.down("sm")]:{display:"block"},"&+div":{borderTop:"solid 1px",borderTopColor:null==(t=e.palette.border)?void 0:t.secondary}}}),v=(0,o.Ay)("div",{name:"StyledItemView",slot:"StyledTitle"})(({theme:e})=>({width:300,fontSize:e.typography.body1.fontSize,lineHeight:1.6,fontWeight:e.typography.fontWeightBold,color:e.palette.text.primary})),h=(0,o.Ay)("div",{name:"StyledItemView",slot:"StyledContent"})(({theme:e})=>({padding:e.spacing(0,2),width:"100%",fontSize:e.typography.body1.fontSize,lineHeight:1.6,color:e.palette.text.primary})),y=(0,o.Ay)("div",{name:"StyledItemView",slot:"StyledContentInner"})(({theme:e})=>({display:"flex",flexDirection:"column","& button":{marginRight:e.spacing(1)},"& div:first-of-type":{marginTop:0,marginBottom:0}}));function b({config:e,formik:t,name:l}){let{i18n:o}=(0,a.PCX)(),[s,u]=(0,g.useState)(!1),{label:m,value:b,elements:E}=e;return g.createElement(f,{"data-testid":d()(`field ${l}`)},g.createElement(v,null,m),g.createElement(h,null,s?g.createElement(y,null,p()(E,(e,l)=>g.createElement(n.Hg,{formik:t,key:l.toString(),config:e})),g.createElement(i.A,{sx:{my:1}},g.createElement(r.A,{variant:"contained",onClick:()=>
1{t.submitForm().then(e=>{c()(t.errors)&&u(!1)})}},o.formatMessage({id:"save"})),g.createElement(r.A,{variant:"outlined",onClick:()=>u(!1)},o.formatMessage({id:"cancel"})))):g.createElement("p",null,b)),!s&&g.createElement(r.A,{variant:"text",onClick:()=>u(!0)},o.formatMessage({id:"edit"})))}},72858:function(e,t,l){l.r(t),l.d(t,{default:function(){return C}});var n=l(53993),a=l(33153),i=l(43890),r=l(39296),o=l(97071),s=l(24892),d=l(75169),u=l(23102),c=l(80139),m=l(97397),p=l(29820),g=l(98002),f=l.n(g),v=l(57717),h=l.n(v),y=l(30758),b=l(76439),E=l(5172),A=(0,b.A)(e=>(0,E.A)({root:{display:"block",position:"relative"},map:{display:"block",height:300,backgroundColor:e.palette.action.focus},hideMap:{display:"none !important"},popper:{zIndex:1300,width:"100%"},paper:{padding:e.spacing(1,1)},suggestItem:{display:"flex",flexDirection:"row",padding:e.spacing(1,1),fontSize:e.mixins.pxToRem(15),cursor:"pointer","&:hover":{backgroundColor:e.palette.action.focus}},suggestIcon:{color:e.palette.text.secondary,fontSize:e.mixins.pxToRem(13),paddingRight:e.spacing(1),paddingTop:e.spacing(.5)},suggestName:{color:e.palette.text.primary},suggestAddress:{color:e.palette.text.secondary}}),{name:"formFooter"});let x=e=>e?h()(e)?x(Object.values(e)[0]):e.toString():null,_=(0,i.Ay)(r.A,{name:"Text"})(({theme:e})=>({"& input::placeholder":{color:e.palette.text.hint}}));var C=function({config:e,disabled:t,required:l,name:i,formik:r}){var g,v,h;let[b,E,{setValue:C,setTouched:w}]=(0,p.Mt)(null!=i?i:"location"),{label:S,labelProps:k={},placeholder:M,variant:I,disabled:R,margin:T="normal",fullWidth:z,required:$,description:P,autoFocus:W,hideMap:F=!1,requiredMap:L=!1,searchOptions:q}=e,B=y.useRef(),O=y.useRef(),j=A(),D=y.useRef(),[N,V="",U,,X,H,{loading:Q,error:G}]=(0,n._gs)(D,{lat:null==(g=b.value)?void 0:g.lat,lng:null==(v=b.value)?void 0:v.lng,address:null==(h=b.value)?void 0:h.address},q),J=y.useCallback(e=>{U(e),L||C({address:e}),""===e&&C(null)},[]),[K,Y]=y.useState(!1),Z=y.useCallback(()=>{setTimeout(()=>{Y(!1)},200)},[]),ee=!!(E.error&&(E.touched||r.submitCount)),et=n.uO7;return y.createElement("div",{className:j.root},y.createElement(a.qB,{excludeRef:B,onClickAway:Z},y.createElement(o.A,null,y.createElement(_,{label:S,autoComplete:"off",required:l||$,inputRef:O,onFocus:e=>{Y(!0)},onBlur:e=>{(null==E?void 0:E.touched)||w(!0),setTimeout(()=>{Y(!1),b.onBlur(e)},200)},onChange:e=>J(e.target.value),value:V,disabled:e.disabled||R,autoFocus:W,variant:I,error:ee,inputProps:{"data-testid":f()(`input ${i}`)},InputLabelProps:{shrink:V||b.value||void 0,...Object.assign({},k)},placeholder:M,margin:T,"data-testid":f()(`field ${i}`),fullWidth:z,helperText:ee?x(E.error):P}),et?y.createElement("div",{className:F?j.hideMap:j.map,ref:D}):null)),et?y.createElement(s.A,{open:K,anchorEl:O.current,disablePortal:!0,placement:"bottom-start",className:j.popper},y.createElement(d.A,{className:j.paper},y.createElement(u.A,{in:K},Q?y.createElement(o.A,null,y.createElement(c.A,{animation:"wave",height:30,width:"50%"}),y.createElement(c.A,{animation:"wave",height:30,width:"30%"}),y.createElement(c.A,{animation:"wave",height:30,width:"40%"})):N.map((e,t)=>y.createElement("div",{key:`${t}${e.lat}${e.lng}`,className:j.suggestItem,onClick:()=>(e=>{let t={address:(({address:e,name:t})=>e?e.includes(t)?`${e}`:`${t}, ${e}`:t)(e),lat:e.lat,lng:e.lng};C(t),X(e),U(t.address),H(e,e=>((e,t)=>{let{address_components:l}=t,n=l[0];C({...e,short_name:n.short_name})})(t,e))})(e)},y.createElement(a.s4,{icon:"ico-checkin",className:j.suggestIcon}),y.createElement(o.A,null,y.createElement(m.A,{color:"text.primary"},e.name),y.createElement(m.A,{color:"text.secondary"},e.address)))),G&&y.createElement("div",null,G)))):null)}},73752:function(e,t,l){l.r(t),l.d(t,{default:function(){return I}});var n=l(41818),a=l(74209),i=l(97071),r=l(89541),o=l(43890),s=l(74254),d=l(58791),u=l.n(d),c=l(39419),m=l.n(c),p=l(98002),g=l.n(p),f=l(37562),v=l.n(f),h=l(68651),y=l.n(h),b=l(14340),E=l.n(b),A=l(1855),x=l.n(A),_=l(30758),C=l(35655),w=l(53993),S=l(29820);let k=(0,o.Ay)(n.A)(({theme:e})=>({fontWeight:e.typography.fontWeightMedium,fontSize:e.mixins.pxToRem(13),color:e.palette.primary.main})),M=e=>y()(e)||""===e;function I({config:{excludeFields:e,label:t="reset",align:l="right",size:n="medium",margin:o,fullWidth:d,sxFieldWrapper:c,flexWidth:p},name:f}){let{i18n:h}=(0,w.PCX)(),{value:y,acceptPageParams:b}=(0,C.$J)(),{values:A={},setValues:I}=(0,S.j7)(),R=m()({...y},e),T=m()(Object.assign({},A),e),z=u()(Object.assign({},A),e),$=E()(v()(R,M),v()(T,M),(e,t)=>{if(b&&(x()(e)||x()(t)))return e==t}),P=(0,r.A)(),W=(0,s.A)(P.breakpoints.down("sm")),F=_.useCallback(()=>{$||I({...z,...R})},[$,R,z]);return _.createElement(a.A,{size:n,margin:o,fullWidth:d,"data-testid":g()(`field ${f}`),sx:{minWidth:!W&&p?"275px":"auto",...c}},_.createElement(i.A,{sx:{textAlign:l},component:"span"},_.createElement(k,{size:W?"medium":n,color:"primary",variant:"text",onClick:F,disabled:$},t&&h.formatMessage({id:t}
1))))}},75267:function(e,t,l){l.r(t),l.d(t,{default:function(){return T}});var n=l(53993),a=l(33153),i=l(37254),r=l(43890),o=l(41818),s=l(74209),d=l(97397),u=l(83933),c=l(97375),m=l(29820),p=l(98002),g=l.n(p),f=l(1384),v=l.n(f),h=l(30758),y=l(27550),b=l(13775);let E=(0,r.Ay)("div",{name:"ProgressWrapperField",slot:"icon",shouldForwardProp:e=>"hide"!==e})(({theme:e})=>({background:"light"===e.palette.mode?"rgba(255, 255, 255, 0.6) !important":"rgba(0, 0, 0, 0.3) !important",position:"absolute",left:0,right:0,bottom:0,top:0,zIndex:2,display:"flex",alignItems:"center",justifyContent:"center"}));function A({value:e,uploading:t,size:l="56px",sx:n}){return t?h.createElement(E,{sx:n},h.createElement(b.A,{sx:{width:`${l} !important`,height:`${l} !important`},variant:"determinate",value:e||0})):null}let x={width:2,right:0,position:"absolute",opacity:0,display:"none"},_=(0,r.Ay)(o.A,{name:"AddPhotoButton"})(({theme:e})=>({fontWeight:"bold",margin:e.spacing(0,2),height:"auto"})),C=(0,r.Ay)(s.A,{name:"Root"})(({theme:e})=>({margin:e.spacing(2,0,1),overflow:"hidden"})),w=(0,r.Ay)("div",{name:"Preview"})(({theme:e})=>({marginTop:-5,borderRadius:4,width:"100%",maxWidth:"100%",overflow:"hidden",display:"flex",alignItems:"center",justifyContent:"center",position:"relative","& button":{"& + button":{marginLeft:e.spacing(1)}}})),S=(0,r.Ay)("div",{name:"RemoveBtn",slot:"removeBtn"})(({theme:e})=>({width:e.spacing(3),height:e.spacing(3),borderRadius:e.spacing(1.5),backgroundColor:"rgba(0,0,0,0.89)",color:"#fff",position:"absolute",top:e.spacing(2),right:e.spacing(2),display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"})),k=(0,r.Ay)("div",{name:"Controls",slot:"Controls"})(({theme:e})=>({borderRadius:4,display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",top:0,left:0,width:"100%",height:"100%"})),M=(0,r.Ay)("div",{name:"ImageWrapper",slot:"ImageWrapper",shouldForwardProp:e=>"widthPhoto"!==e&&"haveError"!==e&&"isMobile"!==e&&"hoverState"!==e})(({theme:e,haveError:t,hoverState:l,widthPhoto:n,isMobile:a})=>({width:a?"100%":n,maxWidth:a?"100%":n,overflow:"hidden",position:"relative",borderStyle:"solid",borderWidth:"1px",borderColor:"light"===e.palette.mode?"#0000003b":"rgba(255, 255, 255, 0.23)",borderRadius:4,...l&&{borderColor:"light"===e.palette.mode?"#000":"#fff"},...t&&{borderColor:e.palette.error.main}})),I=(0,r.Ay)("div",{name:"LinkChange"})(({theme:e})=>({marginTop:e.spacing(1),marginBottom:e.spacing(1),cursor:"pointer"})),R=(0,r.Ay)(d.A,{name:"LabelStyled",shouldForwardProp:e=>"haveError"!==e})(({theme:e,haveError:t})=>({marginBottom:e.spacing(1),fontSize:e.mixins.pxToRem(13),color:e.palette.text.secondary,...t&&{color:e.palette.error.main}}));function T({name:e,config:t,disabled:l,formik:r}){let{required:o,variant:s="outlined",item_type:p,max_upload_filesize:f,upload_url:b,preview_url:E,disabled:T,returnBase64:z=!1,thumbnail_sizes:$,aspectRatio:P="1:1",widthPhoto:W="200px",accept:F="image/*",isDropFile:L=!1}=t,{dialogBackend:q,i18n:B,useIsMobile:O,ParserPreviewPhoto:j}=(0,n.PCX)(),[D,N,{setValue:V,setTouched:U}]=(0,m.Mt)(null!=e?e:"ItemPhotoField"),X=t.placeholder||"add_photo",[H,Q]=(0,h.useState)(E),[G,J]=(0,h.useState)(!!H),K=(0,h.useRef)(),[Y,Z]=(0,h.useState)(!1),ee=P.replace(":",""),et=O(),[el,en]=h.useState(100*!!z),ea=async(e,t)=>{e&&t(await new Promise(t=>{let l=new FileReader;l.addEventListener("load",()=>t(l.result),!1),l.readAsDataURL(e)}))},ei=()=>{K.current.click()},er=e=>{en(Math.round(100*e.loaded/e.total))},eo=(e,t)=>{var l;(null==N?void 0:N.touched)||U(!0);let n=t||K.current.files;if(!n&&!n.length)return;let a=(0,i.EL)(n[0].type)?"video":"photo",r={id:0,uid:v()("file"),source:URL.createObjectURL(n[0]),file:n[0],file_name:n[0].name,file_size:n[0].size,file_type:a,fileItemType:p,status:"update",upload_url:b,extension:(0,i.QC)(n[0].name),thumbnail_sizes:$,onUploadProgress:er};if(r.file.size>f&&0!==f)return void q.alert({message:B.formatMessage({id:"warning_upload_limit_one_file"},{fileName:(0,i.Tu)(r.file_name,30),fileSize:(0,i.lT)(r.file.size),maxSize:(0,i.lT)(f)})});if(!(0,i.HH)(null==r||null==(l=r.file)?void 0:l.type,F)){q.alert({message:B.formatMessage({id:"file_accept_type_fail"})}),(null==K?void 0:K.current)&&(K.current.value=null);return}r&&(Q(r.source),J(!0),z?ea(null==r?void 0:r.file,e=>{V({base64:e})}):V(r))},es=e=>{e.currentTarget.value=null},ed=!!(N.error&&(N.touched||r.submitCount));
1return G?h.createElement(h.Fragment,null,h.createElement(C,{fullWidth:!0,variant:s,margin:"normal","data-testid":g()(`field ${e}`)},h.createElement(R,{haveError:ed},t.label,o?"(*)":""),h.createElement(M,{haveError:ed,hoverState:Y,widthPhoto:W,isMobile:et},h.createElement(j,{item:D.value,onParse:e=>{var t;V({...e.preUploadFile,status:"update"}),Q(null==e||null==(t=e.preUploadFile)?void 0:t.url),J(!0)}},h.createElement(w,{onMouseOver:()=>Z(!0),onMouseLeave:()=>Z(!1)},h.createElement(a._V,{src:H,aspectRatio:ee,backgroundImage:!0}),r.isSubmitting?h.createElement(A,{uploading:r.isSubmitting,value:el}):h.createElement(u.A,{title:B.formatMessage({id:"remove"})},h.createElement(S,{onClick:()=>{Q(null),J(!1),V(E?{status:"remove",temp_file:0}:void 0)},"data-testid":g()(`button_remove ${e}`)},h.createElement(a.s4,{icon:"ico-close"})))))),h.createElement(I,null,h.createElement(c.A,{onClick:ei,color:"primary","data-testid":g()(`button add ${e}`),disabled:T||l||r.isSubmitting},B.formatMessage({id:"change"})))),ed?h.createElement(y.A,{error:N.error}):null,h.createElement("input",{onClick:es,ref:K,type:"file","aria-hidden":!0,accept:F,style:x,"data-testid":g()(`input ${e}`),onChange:eo})):h.createElement(C,{variant:s,margin:"normal","data-testid":g()(`field ${e}`)},h.createElement(R,{haveError:ed},t.label,o?"(*)":""),L?h.createElement(a.dl,{onDrop:e=>(e=>{if(!e.length)return;let t=Object.assign({length:e.length},e);t&&eo(null,t)})(e),render:({canDrop:t,isOver:n})=>h.createElement(M,{haveError:ed,hoverState:Y,widthPhoto:W,isMobile:et},h.createElement(a._V,{src:H,aspectRatio:ee,backgroundImage:!0}),h.createElement(k,{role:"button",onClick:ei,onMouseOver:()=>Z(!0),onMouseLeave:()=>Z(!1)},h.createElement(_,{size:"small",color:"primary",variant:"outlined","data-testid":g()(`button add ${e}`),disabled:T||l||r.isSubmitting,startIcon:h.createElement(a.s4,{icon:"ico-photo-plus-o"})},B.formatMessage({id:X}))))}):h.createElement(M,{haveError:ed,hoverState:Y,widthPhoto:W,isMobile:et},h.createElement(a._V,{src:H,aspectRatio:ee,backgroundImage:!0}),h.createElement(k,{role:"button",onClick:ei,onMouseOver:()=>Z(!0),onMouseLeave:()=>Z(!1)},h.createElement(_,{size:"small",color:"primary",variant:"outlined","data-testid":g()(`button add ${e}`),disabled:T||l||r.isSubmitting,startIcon:h.createElement(a.s4,{icon:"ico-photo-plus-o"})},B.formatMessage({id:X})))),ed?h.createElement(y.A,{error:N.error}):null,t.description?h.createElement(d.A,{sx:{fontSize:"13px"},color:"text.hint",mt:1,mb:1},t.description):null,h.createElement("input",{onClick:es,ref:K,type:"file","aria-hidden":!0,accept:F,"data-testid":g()(`input ${e}`),onChange:eo,style:x}))}},79813:function(e,t,l){l.r(t),l.d(t,{default:function(){return M}});var n=l(53993),a=l(33153),i=l(37254),r=l(41818),o=l(71129),s=l(74209),d=l(97071),u=l(97397),c=l(81916),m=l(97375),p=l(43890),g=l(29820),f=l(98002),v=l.n(f),h=l(1384),y=l.n(h),b=l(30758),E=l(27550);let A="SingleAudioField",x=(0,p.Ay)(r.A,{name:A,slot:"DropButton"})(({theme:e,isOver:t})=>({...t&&{backgroundColor:e.palette.action.hover}})),_=(0,p.Ay)("div",{name:A,slot:"AudioUploaded"})(({theme:e})=>({display:"flex",alignItems:"center",fontSize:e.mixins.pxToRem(13),"& .ico-music-note-o":{fontSize:e.mixins.pxToRem(15)}})),C=(0,p.Ay)("div",{name:A,slot:"WrapTitleStyled"})(({theme:e})=>({display:"flex",alignItems:"center"})),w=(0,p.Ay)("div",{name:A,slot:"DropzoneBox"})(({theme:e})=>({width:"fit-content"})),S=(0,p.Ay)(o.A,{name:A,slot:"Label"})(({theme:e,haveError:t})=>({...t&&{color:e.palette.error.main}})),k=(0,p.Ay)("div",{name:A,slot:"TitleSong"})(({theme:e})=>({marginLeft:e.spacing(1),marginRight:e.spacing(1),overflowWrap:"anywhere"}));function M({name:e,config:t,disabled:l,formik:r}){var o,p;let{label:f="Select Audio",description:h,item_type:A,accept:M="audio/*",max_upload_filesize:I,max_length_name:R,upload_url:T,disabled:z,storage_id:$,placeholder:P,autoFillValueName:W,messageAcceptFail:F}=t,{dialogBackend:L,i18n:q}=(0,n.PCX)(),[B,O,{setValue:j,setTouched:D}]=(0,g.Mt)(null!=e?e:"ItemPhotoField"),N=(0,b.useRef)(),[V,U]=b.useState(0),X=e=>{U(Math.round(100*e.loaded/e.total))},H=()=>{N.current.click()},Q=e=>{var t;let l={id:0,uid:y()("file"),source:URL.createObjectURL(e),file:e,file_name:e.name,file_type:e.type,file_size:e.size,fileItemType:A,upload_url:T,status:"new",storage_id:null!=$?$:null,onUploadProgress:X};if(l.file_size>(null==I?void 0:I.music)&&(null==I?void 0:I.music))return void L.alert({message:q.formatMessage({id:"warning_upload_limit_one_file"},{fileName:(0,i.Tu)(l.file_name,30),fileSize:(0,i.lT)(l.file_size),maxSize:(0,i.lT)(null==I?void 0:I.music)})});if(!(0,i.HH)(null==l||null==(t=l.file)?void 0:t.type,M)){L.alert({message:q.formatMessage({id:F||"file_accept_type_fail"})}),(null==N?void 0:N.current)&&(N.current.value=null);return}l&&(W&&r.setFieldValue(W,(e=>{let t=e.lastIndexOf(".");return e.slice(0,t)})(l.file_name).slice(0,R)),j(l))},G=!!(O.error&&(O.touched||r.submitCount));return b.createElement(s.A,{fullWidth:!0,margin:"normal","data-testid":v()(`field ${e}`)},b.createElement(S,{haveError:G,required:!0,variant:"outlined",shrink:"true"},f),b.createElement(d.A,{sx:{p:2,pt:2.5}},b.createElement(u.A,{variant:"body2",color:"text.hint",mb:.5,component:"p"},B.value?q.formatMessage({id:"audio_file_selected"}):h),B.value?b.createElement(_,{"data-testid":v()("audio uploaded")},b.createElement(C,{"data-testid":v()("audio uploaded wrapTitle")},b.createElement(a.s4,{icon:"ico-music-note-o"}),b.createElement(k,{"data-testid":v()("audio uploaded title")},(0,i.Tu)((null==(o=B.value)?void 0:o.file_name)||(null==(p=B.value)?void 0:p.name),30))),r.isSubmitting?b.createElement(d.A,{sx:{marginLeft:"auto",minWidth:"100px",pl:1,mt:1}},b.createElement(c.A,{"data-testid":v()("audio uploaded progress"),variant:"determinate",value:V}
1)):b.createElement(m.A,{"data-testid":v()("audio uploaded remove"),variant:"body2",color:"primary",component:"span",role:"button",onClick:()=>{j(void 0)}},q.formatMessage({id:"remove"}))):b.createElement(w,null,b.createElement(a.dl,{onDrop:e=>{var t;(t=e)&&Q(t[0])},render:({canDrop:t,isOver:n})=>b.createElement(x,{onClick:H,size:"small",color:"primary",sx:{fontWeight:"bold"},isOver:n,variant:"outlined",disabled:z||l||r.isSubmitting,"data-testid":v()(`button ${e}`),startIcon:b.createElement(a.s4,{icon:"ico-upload"})},P)})),G?b.createElement(E.A,{error:O.error}):null),b.createElement(a._r,{haveError:G,children:t.label,variant:"outlined"}),b.createElement("input",{ref:N,onClick:e=>{e.currentTarget.value=null},className:"srOnly",type:"file","data-testid":v()(`input ${e}`),multiple:!1,accept:M,onChange:()=>{(null==O?void 0:O.touched)||D(!0);let e=N.current.files;e&&Q(e.item(0))}}))}},85380:function(e,t,l){l.r(t),l.d(t,{default:function(){return C}});var n=l(53993),a=l(33153),i=l(37254),r=l(41818),o=l(74209),s=l(97397),d=l(97071),u=l(81916),c=l(97375),m=l(43890),p=l(29820),g=l(98002),f=l.n(g),v=l(1384),h=l.n(v),y=l(30758),b=l(27550);let E="SingleVideoField",A=(0,m.Ay)(r.A,{name:E,slot:"DropButton"})(({theme:e,isOver:t})=>({...t&&{backgroundColor:e.palette.action.hover}})),x=(0,m.Ay)("div",{name:E,slot:"VideoUploaded"})(({theme:e})=>({display:"flex",fontSize:e.mixins.pxToRem(13),"& .ico-video":{fontSize:e.mixins.pxToRem(15)}})),_=(0,m.Ay)("div",{name:E,slot:"DropzoneBox"})(({theme:e})=>({width:"fit-content"}));function C({name:e,config:t,disabled:l,formik:r}){var m,g;let{label:v="Select Video",description:E,item_type:C,accept:w="video/*",max_upload_filesize:S,upload_url:k,disabled:M,storage_id:I}=t,{dialogBackend:R,i18n:T}=(0,n.PCX)(),[z,$,{setValue:P,setTouched:W}]=(0,p.Mt)(null!=e?e:"ItemPhotoField"),[F,L]=y.useState(!1),q=(0,y.useRef)(),[B,O]=y.useState(0),j=e=>{O(Math.round(100*e.loaded/e.total))},D=()=>{q.current.click()},N=e=>{var t;let l={id:0,uid:h()("file"),source:URL.createObjectURL(e),file:e,file_name:e.name,file_type:e.type,file_size:e.size,fileItemType:C,upload_url:k,storage_id:null!=I?I:null,status:"new",onUploadProgress:j},n=l.file.size;if(!(0,i.HH)(null==l||null==(t=l.file)?void 0:t.type,w)){R.alert({message:T.formatMessage({id:"file_accept_type_fail"})}),(null==q?void 0:q.current)&&(q.current.value=null);return}if(n>S&&0!==S)return void R.alert({message:T.formatMessage({id:"warning_upload_limit_one_file"},{fileName:(0,i.Tu)(l.file_name,30),fileSize:(0,i.lT)(l.file.size),maxSize:(0,i.lT)(S)})});l&&(P(l),L(!0))},V=!!($.error&&($.touched||r.submitCount));return y.createElement(o.A,{fullWidth:!0,margin:"normal","data-testid":f()(`field ${e}`)},y.createElement(s.A,{variant:"body2",color:"text.hint",mb:1.5,component:"p"},F?T.formatMessage({id:"video_file_selected"}):E),F?y.createElement(x,null,y.createElement(a.s4,{icon:"ico-video"}),y.createElement(d.A,{ml:1,mr:1},(0,i.Tu)(null==(g=z.value)||null==(m=g.file)?void 0:m.name,30)),r.isSubmitting?y.createElement(d.A,{sx:{marginLeft:"auto",minWidth:"100px",pl:1,mt:1}},y.createElement(u.A,{variant:"determinate",value:B})):y.createElement(c.A,{variant:"body2",color:"primary",component:"span",role:"button",onClick:()=>{L(!1),P(void 0)}},T.formatMessage({id:"remove"}))):y.createElement(_,null,y.createElement(a.dl,{onDrop:e=>{var t;(t=e)&&N(t[0])},render:({canDrop:t,isOver:n})=>y.createElement(A,{onClick:D,size:"small",color:"primary",sx:{fontWeight:"bold"},isOver:n,variant:"outlined",disabled:M||l||r.isSubmitting,"data-testid":f()(`button ${e}`),startIcon:y.createElement(a.s4,{icon:"ico-upload"})},v)})),V?y.createElement(b.A,{error:$.error}):null,y.createElement("input",{ref:q,onClick:e=>{e.currentTarget.value=null},className:"srOnly",type:"file","data-testid":f()(`input ${e}`),multiple:!1,accept:w,onChange:()=>{(null==$?void 0:$.touched)||W(!0);let e=q.current.files;e&&N(e.item(0))}}))}},92686:function(e,t,l){l.r(t),l.d(t,{default:function(){return O}});var n=l(53993),a=l(33153),i=l(43890),r=l(41818),o=l(97071),s=l(97397),d=l(29820),u=l(28017),c=l(98002),m=l.n(c),p=l(20644),g=l.n(p),f=l(4239),v=l.n(f),h=l(30758),y=l(27550),b=l(39296),E=l(50343),A=l(42954),x=l(92162),_=l(83933);let C="AnswerItem",w=(0,i.Ay)("div",{name:"AnswerItem",slot:"IconClose"})(({theme:e})=>
1({cursor:"pointer",display:"flex",justifyContent:"center",alignItems:"center",width:e.spacing(5),height:e.spacing(5),margin:e.spacing(0,.5),"& .ico":{fontSize:e.mixins.pxToRem(18),color:e.palette.text.hint}})),S=(0,i.Ay)("div",{name:C,slot:"Radiogroup"})(({theme:e})=>({display:"flex",alignItems:"center"})),k=(0,i.Ay)("div",{name:C,slot:"AnswerItemStyled"})(({theme:e})=>({display:"flex",alignItems:"center"})),M=(0,i.Ay)(b.A,{name:C,slot:"AnswerInput"})(({theme:e})=>({width:"calc(100% / 3 * 2)","& .MuiOutlinedInput-root":{borderRadius:e.spacing(.5)}})),I=(0,i.Ay)("div",{name:C,slot:"EndAdornmentButton"})(({theme:e})=>({width:"calc(100% / 3 * 1)",display:"flex",alignItems:"center"})),R=(0,i.Ay)("div",{name:C,slot:"ButtonWrapper"})(({theme:e})=>({display:"flex",width:"100%",justifyContent:"flex-start",alignItem:"center"})),T=(0,i.Ay)(x.A,{name:C,slot:"RadioButton"})(({theme:e})=>({width:40,height:40}));var z=(0,h.memo)(({lastElement:e,index:t,item:l,disabled:i,questionIndex:r,addMoreAnswer:o,handleDeleteAnswer:d,handleChangeAnswer:u,handleChangeCorrectAnswer:c,submitCount:p,error:g,handleTouched:f,maxLength:v})=>{let{i18n:b}=(0,n.PCX)(),[x,z]=h.useState(!1),$=!!(g&&(x||p));return h.createElement(h.Fragment,null,h.createElement(k,{key:t,"data-testid":`answer_${t+1}`},h.createElement(M,{onBlur:()=>{f(),z(!0)},variant:"outlined",margin:"dense",disabled:i,required:!0,placeholder:b.formatMessage({id:"answer_index"},{index:t+1}),defaultValue:l.answer,error:$,onChange:e=>u(e,r,t),inputProps:{maxLength:v}}),h.createElement(I,null,h.createElement(R,null,h.createElement(w,{"data-testid":m()(`button_remove_answer ${C}`),onClick:d},h.createElement(_.A,{title:b.formatMessage({id:"remove_answer"}),placement:"top"},h.createElement(a.s4,{icon:"ico-close"}))),h.createElement(S,null,h.createElement(T,{checked:!!l.is_correct,icon:h.createElement(A.A,null),checkedIcon:h.createElement(E.A,null),disabled:i,name:"checkedH",color:"primary","data-testid":m()(`radio_correct_answer ${C}`),onChange:e=>c(e,r,t)}),h.createElement(s.A,{variant:"body1",color:"text.hint",sx:{display:{sm:"block",xs:"none"}}},b.formatMessage({id:"correct_answer"})))))),$?h.createElement(y.A,{error:g}):null)});let $=(0,i.Ay)("div",{name:"QuizItem",slot:"wrapper-answer"})(({theme:e})=>({borderLeft:e.mixins.border("secondary"),paddingLeft:e.spacing(2),marginBottom:e.spacing(1.5)})),P=(0,i.Ay)(r.A)(({theme:e})=>({fontWeight:e.typography.fontWeightBold,fontSize:e.mixins.pxToRem(13),color:e.palette.primary.main,cursor:"pointer","&:hover":{textDecoration:"underline"}})),W=(0,i.Ay)(o.A)(({theme:e})=>({margin:e.spacing(1,0)}));var F=(0,h.memo)(({index:e,item:t,name:l,disabled:a,maxLength:i,lastElement:r,error:s,submitCount:d,formik:u,handleChangeAnswer:c,handleChangeQuestion:p,addMoreQuestion:f,handleDeleteQuestion:E,addMoreAnswer:A,handleDeleteAnswer:x,handleChangeCorrectAnswer:_,handleTouched:C,maxAnswerLength:w})=>{let{i18n:S}=(0,n.PCX)(),{question:k,answers:M}=t,I=h.useRef(!1),[R,T]=h.useState(!1);h.useEffect(()=>{u.isSubmitting&&(I.current=!0)},[u.isSubmitting]);let F=!!(g()(s,"question")&&(R||(I.current?d:0))),L=!!(g()(s,"answers.[0]")&&v()(g()(s,"answers.[0]"))&&(R||(I.current?d:0)));return h.createElement("div",null,h.createElement(b.A,{variant:"outlined",margin:"normal",fullWidth:!0,required:!0,label:S.formatMessage({id:"question_with_index"},{value:e+1}),placeholder:S.formatMessage({id:"question_with_index"},{value:e+1}),disabled:a,defaultValue:k,onChange:t=>p(t,e),error:F,onBlur:()=>{C(),T(!0)},inputProps:{maxLength:i,"data-testid":m()(`input question ${l}${e}`)},"data-testid":m()(`field question ${l}${e}`)}),F&&h.createElement(y.A,{error:g()(s,"question")}),h.createElement($,{"data-testid":m()(`box question ${l}`)},h.createElement(o.A,{"data-testid":m()(`questionAnswer ${e}`)},M.length>0&&M.map((t,l)=>h.createElement(z,{item:t,key:t.ordering,index:l,disabled:a,questionIndex:e,lastElement:l===M.length-1,addMoreAnswer:A,handleDeleteAnswer:()=>x(t.ordering),handleChangeAnswer:c,handleChangeCorrectAnswer:_,submitCount:I.current?d:0,error:g()(s,`answers.[${l}].answer`),handleTouched:C,maxLength:w}))),h.createElement("div",null,h.createElement(P,{onClick:()=>A(),variant:"text",color:"primary",size:"small",disabled:a,sx:{fontWeight:500},"data-testid":m()(`button_add_answer ${l}`)},S.formatMessage({id:"add_answer"})),h.createElement(P,{onClick:E,disabled:a,variant:"text",size:"small",color:"primary",sx:{fontWeight:500},"data-testid":m()(`button_remove_question ${l}`)},S.formatMessage({id:"remove_question"}))),L?h.createElement(W,null,h.createElement(y.A,{error:g()(s,"answers")})):null))});let L=(0,i.Ay)(r.A)(({theme:e})=>({fontSize:e.mixins.pxToRem(13),minWidth:e.spacing(6.25),fontWeight:e.typography.fontWeightBold,color:e.palette.primary.main,cursor:"pointer",display:"flex",alignItems:"center","&:hover":{textDecoration:"underline"},"& .ico.ico-plus-circle-o":{marginRight:e.spacing(.75),fontSize:e.mixins.pxToRem(15)}})),q=(0,i.Ay)(o.A)(({theme:e})=>({margin:e.spacing(1,0)}
1)),B=(0,i.Ay)(o.A)(({theme:e})=>({marginBottom:e.spacing(1),"& input::placeholder":{color:e.palette.text.hint}}));var O=({config:e,formik:t,name:l,disabled:i})=>{let{i18n:r,dialogBackend:o}=(0,n.PCX)(),{minQuestions:c,maxQuestions:p,minAnswers:f,maxAnswers:b,disabled:E,defaultAnswers:A,maxLength:x,maxAnswerLength:_}=e,[{value:C},w,{setValue:S,setTouched:k}]=(0,d.Mt)(null!=l?l:"QuizQuestion"),[M,I]=h.useState(C||[]),R=h.useRef((null==C?void 0:C.length)||0),T=h.useRef(M.map(e=>e.answers[e.answers.length-1].ordering)||[]),z=()=>{(null==w?void 0:w.touched)||k(!0)},$=(e,t)=>{let{value:l}=e.target;I(e=>(0,u.Ay)(e,e=>{e[t].question=l?l.trim():""}))},P=(e,t,l)=>{let{value:n}=e.target;I(e=>(0,u.Ay)(e,e=>{e[t].answers[l].answer=n?n.trim():""}))},W=()=>{if(p>0&&M.length>=p)return void o.alert({title:r.formatMessage({id:"limit_reached"}),message:r.formatMessage({id:"you_have_reached_maximum_number_allowed_question"})});let e=[],t=2;for(;e.length<(A||f);)0===e.length&&e.push({answer:"",is_correct:1,ordering:1}),e.push({answer:"",is_correct:0,ordering:t}),++t;I(t=>(0,u.Ay)(t,t=>{let l={answers:e,question:"",ordering:++R.current};t.push(l)}))},O=(e,t,l)=>{I(e=>(0,u.Ay)(e,e=>{e[t].answers.forEach((e,t)=>{t===l?e.is_correct=1:e.is_correct=0})}))};h.useEffect(()=>{M.length<c?W():(S(M),T.current=M.map(e=>e.answers[e.answers.length-1].ordering))},[M]);let j=!!(w.error&&(w.touched||t.submitCount))&&v()(g()(w.error,"[0]"));return h.createElement(B,null,null==M?void 0:M.map((e,n)=>h.createElement(F,{index:n,key:e.ordering,maxLength:x,name:l,item:e,formik:t,disabled:E||i||t.isSubmitting,submitCount:t.submitCount,lastElement:n===M.length-1,handleChangeQuestion:$,handleChangeAnswer:P,addMoreQuestion:W,handleDeleteQuestion:()=>(e=>{if(M.length<=Math.max(c,1))return void o.alert({message:r.formatMessage({id:"you_must_have_min_question"},{value:c})});I(t=>(0,u.Ay)(t,t=>{if(e){let l=t.findIndex(t=>t.ordering===e);t.splice(l,1)}else t.pop()}))})(e.ordering),addMoreAnswer:()=>(e=>{if(b>0&&M[e].answers.length>=b)return void o.alert({title:r.formatMessage({id:"limit_reached"}),message:r.formatMessage({id:"you_have_reached_maximum_number_answers_allowed_question"})});T.current=T.current.map((t,l)=>l===e?++t:t),I(t=>(0,u.Ay)(t,t=>{let l={answer:"",ordering:T.current[e]};t[e].answers.push(l)}))})(n),handleDeleteAnswer:e=>{((e,t)=>{let l=M[e].answers;if(l){if(l.length<=Math.max(f,1))return o.alert({message:r.formatMessage({id:"you_must_have_min_answer"},{value:f})});I(n=>(0,u.Ay)(n,n=>{if(t){let l=n[e].answers.findIndex(e=>e.ordering===t);if(-1===l)return;let a=n[e].answers[l];n[e].answers.splice(l,1),a.is_correct&&(n[e].answers[0].is_correct=1)}else n[e].answers[l.length-1].is_correct&&(n[e].answers[0].is_correct=1),n[e].answers.pop()}))}})(n,e)},handleTouched:z,error:g()(w.error,`[${n}]`),handleChangeCorrectAnswer:O,maxAnswerLength:_})),j&&h.createElement(q,null,h.createElement(y.A,{error:w.error})),h.createElement("div",null,h.createElement(L,{variant:"outlined",color:"primary",disabled:E||i||t.isSubmitting,onClick:W,"data-testid":m()(`button_add_question ${l}`)},h.createElement(a.s4,{icon:"ico-plus-circle-o"}),h.createElement(s.A,{variant:"body1",sx:{fontWeight:"bold"}},r.formatMessage({id:"add_question"})))))}},94016:function(e,t,l){l.r(t),l.d(t,{default:function(){return g}});var n=l(35655),a=l(53993),i=l(33153),r=l(74209),o=l(43890),s=l(29820),d=l(98002),u=l.n(d),c=l(30758);let m=(0,o.Ay)(i.s4,{name:"IconClearStyled"})(({theme:e})=>({marginRight:e.spacing(.5),cursor:"pointer",color:e.palette.text.hint})),p=(0,o.Ay)(i.Gd,{name:"SearchWrapper"})(({theme:e})=>({"& input::placeholder, .ico":{color:e.palette.text.hint}}));function g({config:{placeholder:e,size:t,margin:l="normal",fullWidth:i=!0,className:o,sx:d},name:g}){let{eventCenter:f}=(0,a.PCX)(),[v,,{setValue:h}]=(0,s.Mt)(g),[y,b]=(0,c.useState)(v.value||""),{usePageParams:E}=(0,a.PCX)(),A=E(),{formContext:x}=(0,n.$J)(),_=null==x?void 0:x.isSidebarAppMobile;(0,c.useEffect)(()=>{(null==A?void 0:A.q)&&(b(null==A?void 0:A.q),h(null==A?void 0:A.q))},[A]),(0,c.useEffect)(()=>{f.dispatch("minimizeGlobalSearchForm",!0)});let C=c.useCallback(e=>{"Enter"===e.key&&(y?h(y.trim()):h(""),e.preventDefault())},[y]);return c.createElement(r.A,{size:t,margin:l,fullWidth:i,"data-testid":u()(`field ${g}`),sx:d},c.createElement(p,{name:"q",value:y,onChange:e=>{var t;let l=null==e||null==(t=e.target)?void 0:t.value;b(l),_&&h(l)},placeholder:e,onKeyDown:_?void 0:C,endAdornment:y?c.createElement(m,{icon:"ico-close",onClick:()=>{b(""),h("")}}):null}))}},97310:function(e,t,l){l.r(t),l.d(t,{default:function(){return w}});var n,a=l(53993),i=l(33153),r=l(43890),o=l(2729),s=l(74209),d=l(78930),u=l(70614),c=l(71129),m=l(5949),p=l(97397),g=l(29820),f=l(98002),v=l.n(f),h=l(30758),y=l(27550),b=l(76439),E=l(5172),A=(0,b.A)(e=>(0,E.A)({root:{paddingLeft:0,"& .MuiSelect-root":{paddingLeft:e.spacing(5)}},startIcon:{position:"absolute",left:e.spacing(2)}}),{name:"PrivacyField"}),x=((n=x||{})[n.Everyone=0]="Everyone",n[n.Friends=2]="Friends",n[n.Friends_of_friends=3]="Friends_of_friends",n[n.Only_me=4]="Only_me",n[n.Custom=10]="Custom",n[n.Community=1]="Community",n);let _=[{label:"Public",value:0,icon:"ico-globe"},{label:"Community",value:1,icon:"ico-user-circle"},{label:"Friends",value:2,icon:"ico-user-two-men"},{label:"Friends of Friends",value:3,icon:"ico-user-man-three"},{label:"Only Me",value:4,icon:"ico-lock"},{label:"Custom",value:10,icon:"ico-gear"}],C=(0,r.Ay)(o.A,{name:"AvatarWrapper"})(({theme:e})=>({position:"absolute",left:e.spacing(2),width:e.spacing(3),justifyContent:"center"}));function w({config:e,name:t,disabled:l,formik:n}){var r,o;let[f,b,{setValue:E}]=(0,g.Mt)(null!=t?t:"PrivacyField"),{disabled:x,description:w,options:S,label:k,variant:M,fullWidth:I,defaultValue:R,minWidth:T,sx:z}=e,{dialogBackend:$}=(0,a.PCX)(),P=A(),[W,F]=h.useState(f.value||R||0),L=h.useCallback(e=>{10===e?B():(F(e),E(e))},[W]),q=!!(b.error&&(b.touched||n.submitCount)),B=()=>{$.present({component:"dialog.DialogCustomListPrivacy",props:{value:W}}).then(e=>{e&&(E(e),F(e))})},O=S.find(e=>Array.isArray(W)?10===e.value:e.value===W);return h.createElement(s.A,{margin:"normal",fullWidth:I,variant:M,sx:{...z,minWidth:T},"data-testid":v()(`field ${t}`)},h.createElement(d.A,{className:P.root,value:Array.isArray(W)?10:W,sx:{paddingLeft:0},disabled:x||l||n.isSubmitting,onBlur:f.onBlur,label:k,startAdornment:h.createElement(C,{position:"start"},h.createElement(i.s4,{icon:(r=Array.isArray(W)?10:W,null==(o=_.find(e=>e.value==r))?void 0:o.icon)})),MenuProps:{anchorOrigin:{vertical:"bottom",horizontal:"left"},getContentAnchorEl:null,transformOrigin:{vertical:"top",horizontal:"left"},"data-testid":v()(`menu ${t}`),PaperProps:{style:{maxHeight:200}}}},S?S.map((e,t)=>h.createElement(u.A,{value:e.value,"data-value":e.value,key:t.toString(),onClick:()=>L(e.value)},e.label)):null),h.createElement(c.A,{id:`label-${t}`}
1,k),(null==O?void 0:O.description)?h.createElement(m.A,null,null==O?void 0:O.description):null,w?h.createElement(p.A,{sx:{fontSize:"13px"},color:"text.hint",mt:1},w):null,q&&h.createElement(y.A,{error:b.error}))}}}]);
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.