1/*! For license information please see VoltoFormBlockEdit.21e4bbfd.chunk.js.LICENSE.txt */ 2(self.__LOADABLE_LOADED_CHUNKS__=self.__LOADABLE_LOADED_CHUNKS__||[]).push([[713],{19050:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>j});var l=a(75995),s=a(64581),i=a(67294),o=a(35766),r=a(27444),n=a(90684),d=a(43409),u=a(16739),c=a(48237),p=a(63508),m=a(17340),f=a(11715),v=a(76011),h=a(86933),g=a(65382),_=a(71551),b=a(46091),y=a(61161),M=a(73888),C=a(60612),Z=a.n(C),k=a(27572),D=a.n(k),w=a(8357),x=a.n(w),S=a(18042),E=a.n(S),N=a(88640),$=a(67100),q=a(36247),F=a(10600),O=a(1300),T=a(9172),R=a(25146),I=i.createElement;const P=(0,N.v)({exportCsv:{id:"form_edit_exportCsv",defaultMessage:"Export data"},clearData:{id:"form_clear_data",defaultMessage:"Clear data"},formDataCountSingle:{id:"form_formDataCountSingle",defaultMessage:"Item stored"},formDataCount:{id:"form_formDataCount",defaultMessage:"Items stored"},confirmClearData:{id:"form_confirmClearData",defaultMessage:"Are you sure you want to delete all saved items?"},cancel:{id:"Cancel",defaultMessage:"Cancel"},formValueYes:{id:"form_formValueYes",defaultMessage:"Yes"},formValueNo:{id:"form_formValueNo",defaultMessage:"No"}}),L=(0,M.lX)(["ReactTable"])((({ReactTable:e,properties:t,blockId:a})=>{const{useReactTable:l,flexRender:s,getCoreRowModel:o,getPaginationRowModel:r,getSortedRowModel:n}=e,d=(0,q.useDispatch)(),u=(0,$.Z)(),p=(0,q.useSelector)((e=>e.formData)),m=(0,q.useSelector)((e=>e.clearFormData)),{0:f,1:v}=(0,i.useState)(!1),{0:h,1:g}=(0,i.useState)([]),{0:_,1:M}=(0,i.useState)([]),{0:C,1:k}=(0,i.useState)([]);(0,i.useEffect)((()=>{d((0,R.zi)({path:(0,y.ZV)(t["@id"]),block_id:a}))}),[m.loaded]),(0,i.useEffect)((()=>{var e,t;let l=[];(null===p||void 0===p||null===(e=p.result)||void 0===e||null===(t=e.items)||void 0===t?void 0:t.length)>0&&(l=p.result.items.filter((e=>e.block_id.value===a))),k(l)}),[p]);const w=l({columns:(0,i.useMemo)((()=>{let e=[],t=[];const a=["__expired","block_id","id","field_type"];if((null===C||void 0===C?void 0:C.length)>0){e=C.flatMap((e=>Object.entries(e).filter((([e,t])=>e)).map((([e,t])=>({id:e,header:null===t||void 0===t?void 0:t.label,accessorFn:t=>{var a;return null===(a=t[e])||void 0===a?void 0:a.value},cell:e=>{switch(null===t||void 0===t?void 0:t.field_type){case"attachment":const t=e.getValue();return t?I("a",{href:t.url,download:!0},t.filename):"";case"textarea":return I("pre",null,e.getValue()||"");case"checkbox":return e.getValue()?u.formatMessage(P.formValueYes):u.formatMessage(P.formValueNo);default:return e.getValue()||""}}}))))).filter((e=>!a.includes(e.id))).reduce(((e,t)=>(e.find((e=>e.id===t.id))||e.push(t),e)),[]);const l=e.find((e=>"date"===e.id));t=e.filter((e=>"date"!==e.id)),l&&t.push(l)}return t})),data:C,state:{sorting:h},columnResizeMode:"onEnd",onSortingChange:g,getCoreRowModel:o(),getPaginationRowModel:r(),getSortedRowModel:n()});return I("div",{className:"dt-wrapper"},I("div",{className:"dt-wrapper-header"},I("div",{className:"dt-info-results"},I("p",null,I("strong",null,C.length," "),1===C.length?u.formatMessage(P.formDataCountSingle):u.formatMessage(P.formDataCount))),I("div",{className:"dt-actions"},I(c.Z,{icon:!0,primary:!0,onClick:()=>{var e;return d((0,R.S6)((0,y.ZV)(t["@id"]),`export-${null!==(e=t.id)&&void 0!==e?e:"form"}.csv`,a))}},I(b.JO$,{name:D(),size:"30px"}),u.formatMessage(P.exportCsv)),I(c.Z,{icon:!0,negative:!0,onClick:()=>v(!0)},I(b.JO$,{name:Z(),size:"30px"}),u.formatMessage(P.clearData)),I(F.Z,{open:f,content:u.formatMessage(P.confirmClearData),cancelButton:u.formatMessage(P.cancel),onCancel:()=>v(!1),onConfirm:()=>{d((0,R.pg)({path:(0,y.ZV)(t["@id"]),block_id:a})),v(!1)}}))),I("div",{className:"dt-wrapper-table"},I(O.Z,{celled:!0,sortable:!0,striped:!0},I(O.Z.Header,null,w.getHeaderGroups().map((e=>I(O.Z.Row,{key:e.id},e.headers.map((e=>I(O.Z.HeaderCell,{key:e.id,sorted:{asc:"ascending",desc:"descending"}[e.column.getIsSorted()],onClick:e.column.getToggleSortingHandler()},e.isPlaceholder?null:s(e.column.columnDef.header,e.getContext())))))))),I(O.Z.Body,null,w.getRowModel().rows.map((e=>I(O.Z.Row,{key:e.id},e.getVisibleCells().map((e=>I(O.Z.Cell,{key:e.id},s(e.column.columnDef.cell,e.getContext())))))))))),w.getPageCount()>1&&I("div",{className:"pagination-wrapper react-table-pagination"},I(T.Z,{activePage:w.getState().pagination.pageIndex+1,totalPages:w.getPageCount(),onPageChange:(e,{activePage:t})=>{w.setPageIndex(t-1)},firstItem:null,lastItem:null,prevItem:{content:I(b.JO$,{name:x(),size:"18px"}),icon:!0,"aria-disabled":w.getState().pagination.pageIndex+1===1,className:w.getState().pagination.pageIndex+1===1?"disabled":null},nextItem:{content:I(b.JO$,{name:E(),size:"18px"}),icon:!0,"aria-disabled":w.getState().pagination.pageIndex+1===w.getPageCount(),className:w.getState().pagination.pageIndex+1===w.getPageCount()?"disabled":null}})))}
2));var V=i.createElement;const B=e=>{const{0:t,1:a}=(0,i.useState)(!0);return V(i.Fragment,null,V(c.Z,{onClick:()=>{a(!0)},icon:!0},V(g.Z,{name:"eye"})," ",V(h.Z,{id:"Show data",defaultMessage:"Show data"})),V(_.Z,{size:"fullscreen",open:t,onClose:()=>{a(!1)},style:{padding:"20px"}},V(L,e),V("br",null),V(c.Z,{onClick:()=>{a(!1)},icon:!0},V(g.Z,{name:"close"}),V(h.Z,{id:"Close",defaultMessage:"Close"}))))};var A=a(77518),z=i.createElement;const H=(0,N.v)({addField:{id:"Add field",defaultMessage:"Aggiungi un campo"},default_submit_label:{id:"form_default_submit_label",defaultMessage:"Invia"},default_cancel_label:{id:"form_default_cancel_label",defaultMessage:"Annulla"},warning:{id:"form_edit_warning",defaultMessage:"Attenzione!"},warning_from:{id:"form_edit_warning_from",defaultMessage:"Enter a field of type 'Sender E-mail'. If it is not present, or it is present but not filled in by the user, the sender address of the e-mail will be the one configured in the right sidebar."},warning_enable_save:{id:"warning_enable_save",defaultMessage:'Select the "Save Data" option in the right sidebar to enable storage and display of submitted data.'},form:{id:"Form",defaultMessage:"Form"},data:{id:"Data",defaultMessage:"data"}});class U extends p.xd{componentDidMount(){super.componentDidMount(),this.props.data.default_from||this.props.onChangeBlock(this.props.block,(0,s.Z)((0,s.Z)({},this.props.data),{},{default_from:"[email protected]",lastChange:(new Date).getTime()}))}render(){var e;return z("div",{className:"public-ui"},z(A.Z,{data:this.props.data,onEdit:!0,onChangeBlock:e=>{this.props.onChangeBlock(this.props.block,e)}},z(o.Z,null,this.props.data.title&&z("h2",null,this.props.data.title),this.props.data.description&&z("p",{className:"description"},this.props.data.description),z(p.mx,{node:this.node},z(r.Z,{panes:[{menuItem:this.props.intl.formatMessage(H.form),render:()=>{var e;return z(n.Z,null,this.state.subblocks.map(((e,t)=>z(d.Z.Field,{key:t},z(f.default,(0,l.Z)({data:e,index:t,selected:this.isSubblockSelected(t)},this.subblockProps,{openObjectBrowser:this.props.openObjectBrowser}))))),this.props.selected&&z(d.Z.Field,null,this.renderAddBlockButton(this.props.intl.formatMessage(H.addField))),z(u.Z,{columns:1,padded:"vertically"},z(u.Z.Row,null,z(u.Z.Column,{textAlign:"center"},(null===(e=this.props.data)||void 0===e?void 0:e.show_cancel)&&z(c.Z,{secondary:!0},this.props.data.cancel_label||this.props.intl.formatMessage(H.default_cancel_label)),z(c.Z,{primary:!0},this.props.data.submit_label||this.props.intl.formatMessage(H.default_submit_label))))))}},{menuItem:this.props.intl.formatMessage(H.data),render:()=>z(n.Z,{className:"container"},this.props.data.store?z(B,{properties:this.props.properties,blockId:this.props.block,removeDataAfterDays:this.props.data.remove_data_after_days}):z("p",null,this.props.intl.formatMessage(H.warning_enable_save)))}]})))),z(m.Z,{selected:this.props.selected||!1},z(v.default,(0,l.Z)({},this.props,{data:this.props.data,block:this.props.block,onChangeBlock:this.props.onChangeBlock,onChangeSubBlock:this.onChangeSubblocks,selected:this.state.subIndexSelected,setSelected:this.onSubblockChangeFocus,openObjectBrowser:this.props.openObjectBrowser,properties:null!==(e=this.props.metadata)&&void 0!==e&&e["@id"]?this.props.metadata:this.props.properties}))))}}const j=i.memo((0,p.Ft)(U))},11715:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>c});var l=a(75995),s=a(67294),i=a(95173),o=a(63508),r=a(33244),n=a(41548),d=s.createElement;class u extends o.ub{constructor(e){super(e),e.data.field_type||this.onChange({field_type:"text"})}render(){var e;const t=(null===(e=this.props.data)||void 0===e?void 0:e.id)||(new Date).getTime();return d(o.OL,{subblock:this,className:"subblock-edit"},d("div",{key:this.props.data.index},d(r.default,(0,l.Z)({},this.props.data,{name:(0,n.T)(this.props.data.label,t),key:this.props.data.index,isOnEdit:!0,id:t,field_id:t,index:this.props.data.index,value:"static_text"===this.props.data.field_type?this.props.data.value:null,onChange:"static_text"===this.props.data.field_type?(e,t)=>this.onChange({value:t}):()=>{}}))))}}const c=(0,i.compose)(o.oC)(u)},33244:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>p});var l=a(75995),s=a(67294),i=a(88640),o=a(67100),r=a(24233),n=a(99390),d=a(32951),u=s.createElement;const c=(0,i.v)({select_a_value:{id:"form_select_a_value",defaultMessage:"Select a value"}}),p=({label:e,description:t,name:a,field_type:s,required:i,input_values:p,value:m,onChange:f,isOnEdit:v,valid:h,disabled:g=!1,formHasErrors:_=!1,errorMessage:b,id:y})=>{var M,C,Z,k,D;const w=(0,o.Z)(),x=()=>!v&&!h,S=b?[b]:[];return u("div",{className:"field"},"text"===s&&u(n.yE,(0,l.Z)({id:a,name:a,title:e,description:t,required:i,onChange:f,value:m,error:S,isDisabled:g,invali
2d:x().toString()},x()?{className:"is-invalid"}:{})),"textarea"===s&&u(n._t,(0,l.Z)({id:a,name:a,title:e,description:t,required:i,onChange:f,value:m,rows:10,error:S,isDisabled:g,invalid:x().toString()},x()?{className:"is-invalid"}:{})),"select"===s&&u(n.uU,(0,l.Z)({id:a,name:a,title:e,description:t,getVocabulary:()=>{},getVocabularyTokenTitle:()=>{},choices:[...null!==(M=null===p||void 0===p?void 0:p.map((e=>[e,e])))&&void 0!==M?M:[]],value:m,onChange:f,placeholder:w.formatMessage(c.select_a_value),"aria-label":w.formatMessage(c.select_a_value),classNamePrefix:"react-select",error:S,isDisabled:g,invalid:x().toString(),required:i},x()?{className:"is-invalid"}:{})),"single_choice"===s&&u(n.b$,(0,l.Z)({id:a,title:e,description:t,required:i,onChange:f,valueList:[...null!==(C=null===p||void 0===p?void 0:p.map((e=>({value:e,label:e}))))&&void 0!==C?C:[]],value:m,error:S,isDisabled:g,invalid:x().toString()},x()?{className:"is-invalid"}:{})),"multiple_choice"===s&&u(n.sv,(0,l.Z)({id:a,name:a,title:e,description:t,required:i,onChange:f,valueList:[...null!==(Z=null===p||void 0===p?void 0:p.map((e=>({value:e,label:e}))))&&void 0!==Z?Z:[]],value:m,error:S,isDisabled:g,invalid:x().toString()},x()?{className:"is-invalid"}:{})),"checkbox"===s&&u(n.OA,(0,l.Z)({id:a,name:a,title:e,description:t,required:i,onChange:f,value:!!m,error:S,isDisabled:g,invalid:x().toString()},x()?{className:"is-invalid"}:{})),"date"===s&&u(n.bs,(0,l.Z)({id:a,name:a,title:e,description:t,dateOnly:!0,noPastDates:!1,resettable:!1,onChange:f,value:m,error:S,isDisabled:g,required:i,invalid:x().toString()},x()?{className:"is-invalid"}:{})),"attachment"===s&&u(n.ls,{id:a,name:a,title:e,description:t,type:"file",required:i,invalid:x().toString(),error:S,isDisabled:g,onChange:f,value:m,multiple:!1}),("from"===s||"email"===s)&&u(n.lW,(0,l.Z)({id:a,name:a,title:e,description:t,required:i,onChange:f,value:m,error:S,isDisabled:g,invalid:x().toString()},x()?{className:"is-invalid"}:{})),"hidden"===s&&u(n.O_,{id:a,value:m,isOnEdit:v}),"static_text"===s&&(v?u(r.Z,{wrapped:!1,id:a,name:a,title:e,description:t,onChange:f,value:m}):null!==m&&void 0!==m&&m.data?u("div",{className:"static-text",dangerouslySetInnerHTML:{__html:m.data}}):u("br",null)),null!==(k=null===(D=d.Z.blocks.blocksConfig.form.additionalFields)||void 0===D?void 0:D.reduce(((o,r)=>r.id===s?[...o,u(r.component,(0,l.Z)({id:a,name:a,title:e,description:t,required:i,onChange:f,value:m,error:S,isDisabled:g,formHasErrors:_,invalid:x().toString()},x()?{className:"is-invalid"}:{}))]:o),[]))&&void 0!==k?k:[])}},57007:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>p});var l=a(67294),s=a(88640),i=a(67100),o=a(68788),r=a(48237),n=a(41548),d=l.createElement;const u=(0,s.v)({success:{id:"form_submit_success",defaultMessage:"Sent!"},reset:{id:"form_reset",defaultMessage:"Clear"}}),c=(e,t)=>{let a=0;for(;a<t.length;){var l;let s=(0,n.T)(t[a].label,t[a].field_id);e=e.replaceAll("${"+s+"}",null!==(l=t[a].value)&&void 0!==l?l:""),a++}return e=(e=e.replaceAll(/\$\{[^}]*\}/gm,"")).replaceAll("\n","<br/>")},p=({formState:e,data:t,resetFormState:a})=>{const s=(0,i.Z)();return d(o.Z,{positive:!0,role:"alert"},t.send_message?d("p",{dangerouslySetInnerHTML:{__html:c(t.send_message,e.result.data)}}):d(l.Fragment,null,d(o.Z.Header,{as:"h4"},s.formatMessage(u.success)),d("p",null,e.result.message)),d(r.Z,{secondary:!0,type:"button",onClick:e=>{e.preventDefault(),e.stopPropagation(),a()}},s.formatMessage(u.reset)))}},78039:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>M});var l=a(64581),s=a(75995),i=a(67294),o=a(88640),r=a(67100),n=a(35766),d=a(43409),u=a(16739),c=a(68788),p=a(64968),m=a(41548),f=a(33244),v=a(99390),h=a(32951),g=a(59536),_=a(47893),b=i.createElement;const y=(0,o.v)({default_submit_label:{id:"form_default_submit_label",defaultMessage:"Submit"},default_cancel_label:{id:"form_default_cancel_label",defaultMessage:"Cancel"},error:{id:"Error",defaultMessage:"Error"},form_errors:{id:"form_errors_validation",defaultMessage:"There are some errors in the form."}}),M=({formState:e,formErrors:t,formData:a,onChangeFormData:o,data:M,onSubmit:C,resetFormState:Z,resetFormOnError:k,captcha:D,id:w,getErrorMessage:x,path:S,block_id:E})=>{var N,$;const q=(0,r.Z)(),F=h.Z.blocks.blocksConfig.form.fieldSchema,O=e=>0===(null===t||void 0===t?void 0:t.filter((t=>t.field===e)).length),T=e=>{var t,a=[],l=null===(t=F(e))||void 0===t?void 0:t.properties;for(var s in l)l[s].send_to_backend&&a.push(s);return Object.assign({},...a.map((t=>({[t]:e[t]}))))};return b("div",{className:"block form"},b("div",{className:"public-ui"},b(n.Z,{style:{margin:"2rem 0"},padded:!0},M.title&&b("h2",null,M.title),M.description&&b("p",{className:"description"},M.description),e.result?b(g.wB,{formState:e,data:M,resetFormState:Z}):b(d.Z,{id:w,loading:e.loading,onSubmit:e=>{k(),C(e)},autoComplete:"off",method:"post"},b(u.Z,{columns:1,padded:"vertically"},null===(N=M.static_fields)||void 0===N?void 0:N.map((e=>{var a,l,i;return b(u.Z.Row,{key:e.field_id,className:"static-field"}
2,b(u.Z.Column,null,b(f.default,(0,s.Z)({},e,{field_type:e.field_type||"text",name:"static_field_"+(null!==(a=e.field_id)&&void 0!==a?a:null===(l=e.name)||void 0===l||null===(i=l.toLowerCase())||void 0===i?void 0:i.replace(" ","")),value:e.value,onChange:()=>{},disabled:!0,valid:!0,formHasErrors:(null===t||void 0===t?void 0:t.length)>0}))))})),null===($=M.subblocks)||void 0===$?void 0:$.map(((e,l)=>{var i;let r=(0,m.T)(e.label,e.id);const n=T(e);return(0,_.hj)(null===e||void 0===e?void 0:e.visibility_conditions,a)&&b(u.Z.Row,{key:"row"+l},b(u.Z.Column,null,b(f.default,(0,s.Z)({},e,{name:r,onChange:(t,a)=>o(e.id,t,a,n),value:"static_text"===e.field_type?e.value:null===(i=a[r])||void 0===i?void 0:i.value,valid:O(r),errorMessage:x(r),formHasErrors:(null===t||void 0===t?void 0:t.length)>0}))))})),M.email_otp_verification?M.subblocks.filter((e=>e.use_as_bcc)).map(((e,i)=>{var r,n;const d=(0,m.T)(e.label,e.id),c=d+v.Ig,p=null===(r=a[d])||void 0===r?void 0:r.value,f=null===(n=a[d])||void 0===n?void 0:n.otp,h=T(e);return b(u.Z.Row,{key:"row_otp"+i},b(u.Z.Column,null,b(v.WR,(0,s.Z)({},e,{fieldValue:p,onChange:(t,a)=>o(e.id,d,p,(0,l.Z)((0,l.Z)({},h),{},{otp:a})),value:f,valid:O(c),errorMessage:x(c),formHasErrors:(null===t||void 0===t?void 0:t.length)>0,path:S,block_id:E}))))})):b(i.Fragment,null),D.render(),t.length>0&&b(c.Z,{error:!0,role:"alert"},b(c.Z.Header,{as:"h4"},q.formatMessage(y.error)),b("p",null,q.formatMessage(y.form_errors))),e.error&&b(c.Z,{error:!0,role:"alert"},b(c.Z.Header,{as:"h4"},q.formatMessage(y.error)),b("p",null,e.error)),b(u.Z.Row,{centered:!0,className:"row-padded-top"},b(u.Z.Column,{textAlign:"center"},(null===M||void 0===M?void 0:M.show_cancel)&&b(v.zx,{secondary:!0,type:"button",onClick:e=>{e.preventDefault(),e.stopPropagation(),Z()}},M.cancel_label||q.formatMessage(y.default_cancel_label)),b(v.zx,{primary:!0,type:"submit",disabled:e.loading},M.submit_label||q.formatMessage(y.default_submit_label),e.loading&&b(p.Z,{role:"progressbar",percent:100,active:!0,success:!1,color:"grey"})))))))))}},76011:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>k});var l=a(64581),s=a(67294),i=a(36247),o=a(43409),r=a(35766),n=a(16739),d=a(70760),u=a(88640),c=a(67100),p=a(86933),m=a(14302),f=a(7212),v=a.n(f),h=a(64777),g=a.n(h),_=a(32951),b=a(25146),y=a(46091),M=a(41548),C=s.createElement;const Z=(0,u.v)({fieldId:{id:"fieldId",defaultMessage:"Field ID"},remove_data_cron_info:{id:"remove_data_cron_info",defaultMessage:"To automate the removal of records that have exceeded the maximum number of days indicated in configuration, a cron must be set up on the server as indicated in the product documentation."},remove_data_warning:{id:"remove_data_warning",defaultMessage:"There are {record} record that have exceeded the maximum number of days."},remove_data_button:{id:"remove_data_button",defaultMessage:"remove expired data"}}),k=({data:e,properties:t,block:a,onChangeBlock:u,onChangeSubBlock:f,selected:h=0,setSelected:k})=>{var D;const w=(0,c.Z)(),x=(0,i.useDispatch)();void 0===e.send_email&&(e.send_email=!0),e.subblocks&&e.subblocks.forEach((e=>{e.field_id=e.id}));var S=_.Z.blocks.blocksConfig.form.formSchema,E=_.Z.blocks.blocksConfig.form.fieldSchema;return(0,s.useEffect)((()=>{var t;(null===(t=e.subblocks)||void 0===t?void 0:t.length)>0&&x((0,b.eX)(e.subblocks))}),[e]),C(o.Z,null,C(r.Z.Group,{raised:!0},C("header",{className:"header pulled"},C("h2",null,C(p.Z,{id:"Form",defaultMessage:"Form"}))),C(r.Z,null,C(y.Iub,{schema:S(e),onChangeField:(t,s)=>{u(a,(0,l.Z)((0,l.Z)({},e),{},{[t]:s}))},formData:e}),(null===t||void 0===t||null===(D=t["@components"])||void 0===D?void 0:D.form_data)&&C(o.Z.Field,{inline:!0},C(n.Z,null))),C(d.Z,{fluid:!0,styled:!0,className:"form"},e.subblocks&&e.subblocks.map(((e,t)=>{var a;return C("div",{key:"subblock"+t},C(d.Z.Title,{active:h===t,index:t,onClick:()=>k(h===t?null:t)},null!==(a=e.label)&&void 0!==a?a:e.field_name,C(m.Z,h===t?{name:v(),size:"20px"}:{name:g(),size:"20px"})),C(d.Z.Content,{active:h===t},("text"===e.field_type||"from"===e.field_type||"textarea"===e.field_type||"date"===e.field_type||"single_choice"===e.field_type||"multiple_choice"===e.field_type||"select"===e.field_type||"checkbox"===e.field_type||"attachment"===e.field_type)&&C(r.Z,{tertiary:!0},w.formatMessage(Z.fieldId),":"," ",C("strong",null,(0,M.T)(e.label,e.field_id))),C(y.Iub,{schema:E(e),onChangeField:(a,s)=>{const i={};"static_text"===e.field_type&&(i.required=!1),f(t,(0,l.Z)((0,l.Z)({},e),{},{[a]:s},i))},formData:e})))})))))}},77518:(e,t,a)=>{"use strict";a.d(t,{Z:()=>u});var l=a(64581),s=a(67294),i=a(88640),o=a(67100),r=a(32951),n=s.createElement;const d=(0,i.v)({fill_required_config_fields:{id:"form_edit_fill_required_configuration_fields",defaultMessage:"Please, fill-in required configuration fields in sidebar. The form will be not displayed in view mode until required fields are filled-in."},other_errors:{id:"form_edit_other_errors",defaultMessage:"Please, verify this configuration errors in sidebar. The form will be not displayed in view mode until this errors fields are not fixed."}}),u=({data:e={},children:t,onEdit:a,onChangeBlock:i})=>{var u,c,p;const m=(0,o.Z)();var f=(0,r.Z.blocks.blocksConfig.form.formSchema)(e);(0,s.useEffect)((()=>
2{if(a){const t=((e,t,a)=>{var l=r.Z.blocks.blocksConfig.form.schemaValidators;const s=t.required,i=0===s.filter((a=>null===e[a]||void 0===e[a]||""===e[a]||"boolean"===t.properties[a].type&&!e[a])).length;let o=[];l&&Object.keys(l).forEach((t=>{const s=(0,l[t])(e,a);s&&o.push({field:t,message:s})}));let n=0===o.length;return{valid:i&&n,required_fields:s,schema_validation:o}})(e,f,m);JSON.stringify(t)!==JSON.stringify(e.configValidation)&&i((0,l.Z)((0,l.Z)({},e),{},{configValidation:t}))}}),[e]);const v=(null===(u=e.configValidation)||void 0===u?void 0:u.valid)||!e.configValidation;return n(s.Fragment,null,!v&&a&&n("div",{style:{padding:"1rem",backgroundColor:"#fff0f0",border:"1px solid #c40e00",borderRadius:"3px"}},(null===(c=e.configValidation.required_fields)||void 0===c?void 0:c.length)>0&&n(s.Fragment,null,m.formatMessage(d.fill_required_config_fields)),(null===(p=e.configValidation.schema_validation)||void 0===p?void 0:p.length)>0&&n("div",null,m.formatMessage(d.other_errors),n("ul",null,e.configValidation.schema_validation.map((e=>n("li",null,e.message)))))),(v||a)&&n(s.Fragment,null,t))}},34978:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>k});var l=a(64581),s=a(67294),i=a(36247),o=a(88640),r=a(67100),n=a(25146),d=a(41548),u=a(78039),c=a(32951),p=a(99390),m=a(22988),f=a(77518),v=s.createElement;const h=(0,o.v)({formSubmitted:{id:"formSubmitted",defaultMessage:"Form successfully submitted"},defaultInvalidFieldMessage:{id:"formblock_defaultInvalidFieldMessage",defaultMessage:"Invalid field value"},requiredFieldMessage:{id:"formblock_requiredFieldMessage",defaultMessage:"Fill-in this field"},invalidEmailMessage:{id:"formblock_invalidEmailMessage",defaultMessage:"The email is incorrect"},insertOtp:{id:"formblock_insertOtp_error",defaultMessage:"Please, insert the OTP code recived via email."}}),g={loading:!1,error:null,result:null},_="normal",b="loading",y="error",M="success",C=(e,t)=>{switch(t.type){case _:return g;case b:return{loading:!0,error:null,result:null};case y:return{loading:!1,error:t.error,result:null};case M:return{loading:!1,error:null,result:t.result};default:return g}},Z=e=>{const{static_fields:t=[],subblocks:a=[]}=e;return(0,l.Z)((0,l.Z)({},a.reduce(((t,a)=>"hidden"===a.field_type?(0,l.Z)((0,l.Z)({},t),{},{[(0,d.T)(a.label,a.id)]:(0,l.Z)((0,l.Z)({},a),e[a.id]&&{custom_field_id:e[a.id]})}):t),{})),t.reduce(((e,t)=>(0,l.Z)((0,l.Z)({},e),{},{[(0,d.T)(t.label,t.id)]:t})),{}))},k=({data:e,id:t,path:a})=>{const o=(0,r.Z)(),k=(0,i.useDispatch)(),{0:D,1:w}=(0,s.useReducer)(((a,s)=>s.reset?(e.email_otp_verification&&k((0,n.xQ)(t)),Z(e)):(0,l.Z)((0,l.Z)({},a),{},{[s.field]:s.value})),Z(e)),{0:x,1:S}=(0,s.useReducer)(C,g),{0:E,1:N}=(0,s.useState)([]),$=(0,i.useSelector)((e=>{var a,l;return null===(a=e.submitForm)||void 0===a||null===(l=a.subrequests)||void 0===l?void 0:l[t]})),q=(0,s.useRef)(),F=(e,t,a,s)=>{w({field:t,value:(0,l.Z)({field_id:e,value:a},s)})};(0,s.useEffect)((()=>{E.length>0&&O()}),[D]);const O=()=>{const t=[];return e.subblocks.forEach(((a,l)=>{var s,i,r,n,u,f,v,g,_;const b=(0,d.T)(a.label,a.id),y=a.field_type,M=a.use_as_bcc,C=null!==(s=null===(i=c.Z.blocks.blocksConfig.form.additionalFields)||void 0===i||null===(r=i.filter((e=>e.id===y&&void 0!==e.isValid)))||void 0===r?void 0:r[0])&&void 0!==s?s:null;if(!a.required||!C||null!==C&&void 0!==C&&C.isValid(D,b))(!a.required||"checkbox"!==y||null!==(n=D[b])&&void 0!==n&&n.value)&&(!a.required||D[b]&&0!==(null===(u=D[b])||void 0===u||null===(f=u.value)||void 0===f?void 0:f.length)&&"{}"!==JSON.stringify(null!==(v=null===(g=D[b])||void 0===g?void 0:g.value)&&void 0!==v?v:{}))?"from"!==y&&"email"!==y||null===(_=D[b])||void 0===_||!_.value||((0,m.vV)(D[b].value)?e.email_otp_verification&&M&&!D[b].otp&&t.push({field:b+p.Ig,message:o.formatMessage(h.insertOtp)}):t.push({field:b,message:o.formatMessage(h.invalidEmailMessage)})):t.push({field:b,message:o.formatMessage(h.requiredFieldMessage)});else{const e=null===C||void 0===C?void 0:C.isValid(D,b);"boolean"===typeof e?t.push({field:b,message:o.formatMessage(h.defaultInvalidFieldMessage)}):"object"===typeof e&&t.push(e)}})),e.captcha&&!q.current&&t.push({field:"captcha",message:o.formatMessage(h.requiredFieldMessage)}),N(t),0===t.length},T=()=>{w({reset:!0}),S({type:_})},R=e=>{const t=null===E||void 0===E?void 0:E.filter((t=>t.field===e));return t.length>0?t[0].message:null},I=new p.UG({captchaToken:q,captcha:e.captcha,captcha_props:e.captcha_props,errorMessage:R("captcha"),onChangeFormData:F}),P=`form-${t}`;return(0,s.useEffect)((()=>
2{if(null!==$&&void 0!==$&&$.loaded){S({type:M,result:(0,l.Z)({message:o.formatMessage(h.formSubmitted)},$.result)}),I.reset();const e=document.getElementById(P);if(null!==e){const t=e.getBoundingClientRect();null!==t&&window.scrollTo({top:t.x,left:t.y,behavior:"smooth"})}}else if(null!==$&&void 0!==$&&$.error){var e,t,a;let l=`${null===(e=JSON.parse(null!==(t=null===(a=$.error.response)||void 0===a?void 0:a.text)&&void 0!==t?t:"{}"))||void 0===e?void 0:e.message}`;S({type:y,error:l})}}),[$]),(0,s.useEffect)((()=>{T()}),[]),v(f.Z,{data:e},v(u.default,{id:P,formState:x,formErrors:E,formData:D,captcha:I,onChangeFormData:F,data:e,onSubmit:s=>{s.preventDefault(),I.verify().then((()=>{if(O()){const o={},r={provider:e.captcha,token:q.current};var s,i;if("honeypot"===e.captcha)r.value=null!==(s=null===(i=D[e.captcha_props.id])||void 0===i?void 0:i.value)&&void 0!==s?s:"";const u=(0,l.Z)({},D);e.subblocks.forEach((e=>{var t;const a=(0,d.T)(e.label,e.id);if(null!==(t=u[a])&&void 0!==t&&t.value){u[a].field_id=e.field_id;c.Z.blocks.blocksConfig.form.attachment_fields.includes(e.field_type)&&(o[a]=(0,l.Z)((0,l.Z)({},u[a].value),{},{label:u[a].label,field_id:e.field_id}),delete u[a])}})),k((0,n.R2)(a,t,Object.keys(u).map((e=>(0,l.Z)({},u[e]))),o,r)),S({type:b})}else S({type:y})})).catch((()=>{S({type:y})}))},resetFormState:T,resetFormOnError:()=>{S({type:_})},getErrorMessage:R,path:a,block_id:t}))}},91127:(e,t,a)=>{"use strict";a.d(t,{Z:()=>q});var l=a(75995),s=a(64581),i=a(93229),o=a(67294),r=a(95173),n=a(88640),d=a(3473),u=a(66727),c=a(93967),p=a.n(c),m=a(13515),f=a(14302),v=a(27765),h=a(73888),g=a(8357),_=a.n(g),b=a(18042),y=a.n(b),M=a(64247),C=a.n(M),Z=a(6063),k=a.n(Z),D=o.createElement;const w=(0,u.ZP)({resolved:{},chunkName:()=>"rc-time-picker",isReady(e){const t=this.resolve(e);return!0===this.resolved[t]&&!!a.m[t]},importAsync:()=>a.e(644).then(a.bind(a,7010)),requireAsync(e){const t=this.resolve(e);return this.resolved[t]=!1,this.importAsync(e).then((e=>(this.resolved[t]=!0,e)))},requireSync(e){const t=this.resolve(e);return a(t)},resolve(){return 7010}}),x=(0,n.v)({date:{id:"Date",defaultMessage:"Date"},time:{id:"Time",defaultMessage:"Time"}}),S=()=>D("div",{style:{color:"#000",left:"22px",padding:"5px",position:"absolute",top:"15px"},tabIndex:"0"},D(f.Z,{name:_(),size:"30px"})),E=()=>D("div",{style:{color:"#000",right:"22px",padding:"5px",position:"absolute",top:"15px"},tabIndex:"0"},D(f.Z,{name:y(),size:"30px"})),N={hour:12,minute:0,second:0};class $ extends o.Component{constructor(e){var t;super(e),(0,i.Z)(this,"onDateChange",(e=>{if(e){const t=this.props.moment.default,a=this.getDateOnly(),l=(this.getInternalValue()||t()).set((0,s.Z)({year:e.year(),month:e.month(),date:e.date()},a?N:{})),i=a?l.format("YYYY-MM-DD"):l.toISOString();this.props.onChange(this.props.id,i)}this.setState({isDefault:!1})})),(0,i.Z)(this,"onTimeChange",(e=>{const t=this.props.moment.default;if(e){var a,l;const s=(this.getInternalValue()||t()).set({hours:null!==(a=null===e||void 0===e?void 0:e.hours())&&void 0!==a?a:0,minutes:null!==(l=null===e||void 0===e?void 0:e.minutes())&&void 0!==l?l:0,seconds:0}).toISOString();this.props.onChange(this.props.id,s)}})),(0,i.Z)(this,"onResetDates",(()=>{this.setState({isDefault:!1}),this.props.onChange(this.props.id,null)})),(0,i.Z)(this,"onFocusChange",(({focused:e})=>this.setState({focused:e}))),this.moment=e.moment.default,this.state={focused:!1,isDefault:(null===(t=(0,v.wG)(this.props.intl.locale,this.props.value,void 0,this.moment))||void 0===t?void 0:t.toISOString())===this.moment().utc().toISOString()}}getInternalValue(){return(0,v.wG)(this.props.intl.locale,this.props.value,void 0,this.moment)}getDateOnly(){return this.props.dateOnly||"date"===this.props.widget}render(){var e;const{id:t,resettable:a,intl:s,reactDates:i,widgetOptions:o,invalid:r,required:n}=this.props,d=this.props.noPastDates||(null===o||void 0===o||null===(e=o.pattern_options)||void 0===e?void 0:e.noPastDates),u=this.props.moment.default,c=this.getInternalValue(),v=this.getDateOnly(),{SingleDatePicker:h}=i;let g={};n&&(g.required=!0,g["aria-required"]=!0);return(!0===r||"true"===r)&&(g["aria-invalid"]=!0),D(m.Z,this.props,D("div",{className:"date-time-widget-wrapper"},D("div",{className:p()("ui input date-input",{"default-date":this.state.isDefault})},D(h,(0,l.Z)({date:c,disabled:this.props.isDisabled,onDateChange:this.onDateChange,focused:this.state.focused,numberOfMonths:1},d?{}:{isOutsideRange:()=>!1},{onFocusChange:this.onFocusChange,noBorder:!0,displayFormat:u.localeData(s.locale).longDateFormat("L"),navPrev:D(S,null),navNext:D(E,null),id:`${t}-date`,placeholder:s.formatMessage(x.date)},g))),!v&&D("div",{className:p()("ui input time-input",{"default-date":this.state.isDefault})},D(w,{disabled:this.props.isDisabled,defaultValue:c,value:c,onChange:this.onTimeChange,allowEmpty:!1,showSecond:!1,use12Hours:"en"===s.locale,id:`${t}-time`,format:u.localeData(s.locale).longDateFormat("LT"),placeholder:s.formatMessage(x.time),focusOnOpen:!0,placement:"bottomRight"})),a&&D("button",{disabled:this.props.isDisabled||!c,onClick:()=>this.onResetDates(),className:"item ui noborder button"},D(f.Z,{name:C(),size:"24px",className:"close"}))))}}$.defaultProps={description:null,required:!1,error:[],dateOnly:!1,noPastDates:!1,value:null,resettable:!0};const q=(0,r.compose)((0,h.lX)(["reactDates","moment"]),d.ZP)($)},77592:(e,t,a)=>{"use strict";a.d(t,{Z:()=>k});var l=a(75995),s=a(67294),i=a(37401),o=a(8736),r=a(77708),n=a.n(r),d=a(3473),u=a(60612),c=a.n(u),p=a(13515),m=a(14302),f=a(66727),v=a(51565),h=a(88640),g=a(67100),_=a(99390),b=s.createElement;const y=["image/png","image/jpeg","image/webp","image/jpg","image/gif","
2image/svg+xml"],M=(0,f.ZP)({resolved:{},chunkName:()=>"react-dropzone",isReady(e){const t=this.resolve(e);return!0===this.resolved[t]&&!!a.m[t]},importAsync:()=>Promise.resolve().then(a.bind(a,13356)),requireAsync(e){const t=this.resolve(e);return this.resolved[t]=!1,this.importAsync(e).then((e=>(this.resolved[t]=!0,e)))},requireSync(e){const t=this.resolve(e);return a(t)},resolve(){return 13356}}),C=(0,h.v)({releaseDrag:{id:"Drop files here ...",defaultMessage:"Drop files here ..."},editFile:{id:"Drop file here to replace the existing file",defaultMessage:"Drop file here to replace the existing file"},fileDrag:{id:"Drop file here to upload a new file",defaultMessage:"Drop file here to upload a new file"},replaceFile:{id:"Replace existing file",defaultMessage:"Replace existing file"},addNewFile:{id:"Choose a file",defaultMessage:"Choose a file"}}),Z=e=>{const{id:t,value:a,onChange:n,required:d,invalid:u}=e,[f,h]=s.useState(!1),Z=(0,g.Z)();s.useEffect((()=>{a&&y.includes(a["content-type"])&&h(!0)}),[a]);const k=null!==a&&void 0!==a&&a.download?`${(0,v.ZV)(null===a||void 0===a?void 0:a.download)}?id=${Date.now()}`:null!==a&&void 0!==a&&a.data?`data:${a["content-type"]};${a.encoding},${a.data}`:null;let D={};d&&(D.required=!0,D["aria-required"]=!0);return(!0===u||"true"===u)&&(D["aria-invalid"]=!0),b(p.Z,e,b(M,{onDrop:e=>{const a=e[0];(0,r.readAsDataURL)(a).then((e=>{const l=e.match(/^data:(.*);(.*),(.*)$/);n(t,{data:l[3],encoding:l[2],"content-type":l[1],filename:a.name})}));let l=new FileReader;l.onload=function(){const e=l.result.match(/^data:(.*);(.*),(.*)$/);if(y.includes(e[1])){h(!0),document.getElementById(`field-${t}-image`).src=l.result}else h(!1)},l.readAsDataURL(e[0]);let s=document.getElementById(`field-${t}`);const i=new File([],a.name,{type:a.type,lastModified:new Date}),o=new DataTransfer;o.items.add(i),s.files=o.files,s.webkitEntries.length&&(s.dataset.file=`${o.files[0].name}`)}},(({getRootProps:e,getInputProps:s,isDragActive:r})=>b("div",(0,l.Z)({className:"file-widget-dropzone"},e()),r&&b(i.Z,{active:!0}),f?b(o.Z,{className:"image-preview",id:`field-${t}-image`,size:"small",src:k}):b("div",{className:"dropzone-placeholder"},b("p",{className:"dropzone-text"},r?Z.formatMessage(C.releaseDrag):a?Z.formatMessage(C.editFile):Z.formatMessage(C.fileDrag))),b("label",{className:"label-file-widget-input"},a?Z.formatMessage(C.replaceFile):Z.formatMessage(C.addNewFile)),b("input",(0,l.Z)({},s({type:"file",style:{display:"none"}}),{id:`field-${t}`,name:t,type:"file"},D))))),b("div",{className:"field-file-name"},a&&a.filename,a&&b(_.zx,{icon:!0,basic:!0,className:"delete-button","aria-label":"delete file",onClick:()=>{n(t,null),h(!1)}},b(m.Z,{name:c(),size:"20px"}))))};Z.defaultProps={description:null,required:!1,error:[],value:null};const k=(0,d.ZP)(Z)},99390:(e,t,a)=>{"use strict";a.d(t,{zx:()=>De,UG:()=>o,sv:()=>p,OA:()=>h,bs:()=>g.Z,lW:()=>M,ls:()=>C.Z,$Z:()=>w,D7:()=>$,O_:()=>F,OJ:()=>R,IZ:()=>L,WR:()=>Ce,Ig:()=>be,b$:()=>B,uU:()=>ie,yE:()=>fe,_t:()=>ue});var l=a(67294),s=l.createElement;class i extends l.Component{constructor(e){super(e),this.captchaRef=(0,l.createRef)()}reset(){const{captcha:e,captchaToken:t}=this.props,a=this.captchaRef;"recaptcha"===e||"hcaptcha"!==e&&"hcaptcha_invisible"!==e||(a.current&&a.current.resetCaptcha(),t.current=null)}verify(){const{captcha:e,captchaToken:t}=this.props,a=this.captchaRef;if("recaptcha"===e)return a.current.verify();if("hcaptcha"===e){if(!t.current)return a.current.execute({async:!0})}else if("hcaptcha_invisible"===e&&!t.current)return a.current.execute({async:!0});return new Promise((e=>{e()}))}render(){const{captchaToken:e,captcha:t,captcha_props:a,onChangeFormData:i,errorMessage:o}=this.props,r=()=>o?s("div",{className:"captcha-error-message"},o):s(l.Fragment,null),n=this.captchaRef;return"recaptcha"===t?s(l.Fragment,null,s(w,{captchaToken:e,sitekey:null===a||void 0===a?void 0:a.public_key,captchaRef:n}),s(r,null)):"hcaptcha"===t?s(l.Fragment,null,s($,{captchaToken:e,sitekey:null===a||void 0===a?void 0:a.public_key,size:"normal",captchaRef:n}),s(r,null)):"hcaptcha_invisible"===t?s(l.Fragment,null,s($,{captchaToken:e,sitekey:null===a||void 0===a?void 0:a.public_key,size:"invisible",captchaRef:n}),s(r,null)):"norobots-captcha"===t?s(l.Fragment,null,s(L,{id:a.id,id_check:a.id_check,title:a.title,captchaRef:n,captchaToken:e}),s(r,null)):"honeypot"===t?s(l.Fragment,null,s(R,{id:a.id,title:a.id,captchaRef:n,captchaToken:e,onChangeFormData:i}),s(r,null)):null}}const o=i;var r=a(75995),n=a(71820),d=a(13515),u=l.createElement;const c=({id:e,title:t,required:a,description:l,error:s,value:i=[],valueList:o,onChange:c,fieldSet:p,isDisabled:m,wrapped:f,invali
2d:v})=>{let h={};a&&(h.required=!0,h["aria-required"]=!0);return(!0===v||"true"===v)&&(h["aria-invalid"]=!0),u(d.Z,{id:e,title:t,description:l,required:a||null,error:s,fieldSet:p,wrapped:f},u("div",{className:"checkbox-list-widget"},u("fieldset",{className:"checkbox-group"},u("legend",{"aria-hidden":"false"},t),null===o||void 0===o?void 0:o.map((t=>u("div",{className:"checkbox-item",key:t.value},u(n.Z,(0,r.Z)({id:`field-${e}-${t.value}`,name:`field-${e}-${t.value}`,checked:null===i||void 0===i?void 0:i.includes(t.value),disabled:m,onChange:(a,{checked:l})=>((t,a)=>{let l=new Set([...i||[]]);a?l.add(t):l.delete(t),c(e,[...l])})(t.value,l),label:u("label",{htmlFor:`field-${e}-${t.value}`},t.label)},h))))))))};c.defaultProps={description:null,required:!1,error:[],value:[],onChange:null,onEdit:null,onDelete:null};const p=c;var m=a(3473),f=l.createElement;const v=e=>{const{id:t,title:a,value:l,onChange:s,isDisabled:i,required:o,invalid:u}=e,c=Math.random().toString(36).substr(2,5);let p={};o&&(p.required=!0,p["aria-required"]="true");return(!0===u||"true"===u)&&(p["aria-invalid"]=!0),f(d.Z,(0,r.Z)({},e,{columns:1}),f("div",{className:"wrapper"},f(n.Z,(0,r.Z)({id:`field-${t}-${c}`,name:`field-${t}-${c}`,checked:l||!1,disabled:i,onChange:(e,{checked:a})=>{s(t,a)},"aria-required":o?"true":"false",label:f("label",{htmlFor:`field-${t}-${c}`},a)},p))))};v.defaultProps={description:null,required:!1,error:[],value:null,onChange:null,onEdit:null,onDelete:null};const h=(0,m.ZP)(v);var g=a(91127),_=a(60416),b=l.createElement;const y=e=>{const{id:t,value:a,onChange:l,onBlur:s,onClick:i,minLength:o,maxLength:n,placeholder:u,isDisabled:c,required:p,invalid:m}=e,f=`field-${t}`;let v={};p&&(v.required=!0,v["aria-required"]=!0);return(!0===m||"true"===m)&&(v["aria-invalid"]=!0),b(d.Z,(0,r.Z)({},e,{className:"email"}),b(_.Z,(0,r.Z)({id:f,name:t,type:"email",value:a||"",disabled:c,placeholder:u,onChange:({target:e})=>l(t,""===e.value?void 0:e.value),onBlur:({target:e})=>s(t,""===e.value?void 0:e.value),onClick:()=>i(),minLength:o||null,maxLength:n||null},v)))};y.defaultProps={description:null,required:!1,error:[],value:null,onChange:()=>{},onBlur:()=>{},onClick:()=>{},minLength:null,maxLength:null};const M=y;var C=a(77592),Z=a(73888),k=a(67100),D=l.createElement;const w=(0,Z.lX)(["GoogleReCaptcha"])((({captchaRef:e,captchaToken:t,sitekey:a,GoogleReCaptcha:s})=>{var i;const{GoogleReCaptchaProvider:o,useGoogleReCaptcha:r}=s,n=(0,k.Z)();return D(o,{reCaptchaKey:a,language:null!==(i=n.locale)&&void 0!==i?i:"en"},D((()=>{const{executeRecaptcha:a}=r(),s=(0,l.useCallback)((async()=>{if(!a)return;const e=await a();t.current=e}),[a]);return(0,l.useEffect)((()=>{e.current={verify:s}}),[]),null}),null))}));var x=a(16739),S=a(88640),E=l.createElement;const N=(0,S.v)({invisibleCaptcha:{id:"HCaptchaInvisibleInfo",defaultMessage:'This site is protected by hCaptcha and its <a href="https://www.hcaptcha.com/privacy">Privacy Policy</a> and <a href="https://www.hcaptcha.com/terms">Terms of Service</a> apply.'}}),$=(0,Z.lX)(["HCaptcha"])((({captchaRef:e,captchaToken:t,sitekey:a,size:l,HCaptcha:s})=>{const i=s.default,o=(0,k.Z)(),r=e=>{t.current=e},n=()=>{e.current.execute()};return E(x.Z.Row,{centered:!0,className:"row-padded-top"},"invisible"===l?E(x.Z.Column,{textAlign:"center"},E(i,{ref:e,sitekey:a,onLoad:n,onVerify:r,onExpire:()=>{t.current=null},size:l}),E("div",{dangerouslySetInnerHTML:{__html:o.formatMessage(N.invisibleCaptcha)}})):E(x.Z.Column,{textAlign:"center"},E(i,{ref:e,sitekey:a,onLoad:n,onVerify:r,size:l})))}));var q=l.createElement;const F=({id:e,title:t,value:a,isOnEdit:s})=>{const i=`field-${e}`;return q(l.Fragment,null,s?q("label",{htmlFor:i},"Hidden: ",t||e):null,q("input",{type:"hidden",id:i,name:e,value:a}))};var O=a(57304),T=l.createElement;const R=({id:e,title:t,captchaToken:a,onChangeFormData:s})=>{(0,l.useEffect)((()=>{a.current=((e,t)=>{const a={id:e,value:t};return JSON.stringify(a)})(e,(new Date).toString())}),[a,e]),(0,l.useEffect)((()=>{s(e,e,"",{label:e})}),[]);const{0:i,1:o}=(0,l.useState)();return T("div",{className:"honey-wrapper",key:"honeypot-captcha"},T(O.Z,{id:e,name:e,label:t,title:t,onChange:(t,l)=>{a.current=void 0,o(l),s(e,t,l,{})},value:i}))};var I=l.createElement;
2const P=(0,S.v)({resolveCaptcha:{id:"resolveCaptcha",defaultMessage:"Answer the question to prove that you are human"}}),L=({id:e,id_check:t,title:a,captchaToken:s})=>{const i=(0,k.Z)(),{0:o,1:r}=(0,l.useState)();return I(x.Z.Row,{key:"row-captcha"},I(x.Z.Column,null,I(O.Z,{id:"captcha",name:"captcha",label:a,title:a,description:i.formatMessage(P.resolveCaptcha),onChange:(a,l)=>{s.current=((e,t,a)=>{const l={id:e,id_check:t,value:a};return JSON.stringify(l)})(e,t,l),r(l)},required:!0,value:o})))};var V=l.createElement;const B=({id:e,title:t,required:a,description:l,error:s,value:i,valueList:o,onChange:n,onEdit:u,onDelete:c,intl:p,fieldSet:m,wrapped:f,invalid:v})=>{let h={};a&&(h.required=!0,h["aria-required"]=!0);return(!0===v||"true"===v)&&(h["aria-invalid"]=!0),V(d.Z,{id:e,title:t,description:l,required:a||null,error:s,fieldSet:m,wrapped:f},V("div",{className:"radio-widget"},V("fieldset",{className:"radio-group"},V("legend",{"aria-hidden":"false"},t),o.map((t=>V("div",{className:"radio-button",key:t.value},V("input",(0,r.Z)({type:"radio",name:e,id:e+t.value,value:t.value,checked:t.value===i,onChange:t=>n(e,t.target.value)},h)),V("label",{htmlFor:e+t.value},t.label)))))))};var A=a(64581),z=a(93229),H=a(35161),U=a.n(H),j=a(36247),J=a(95173),G=a(80740),Y=a(71661),X=a(54971),W=a(13595);const K=(0,S.v)({risultato:{id:"select_risultato",defaultMessage:"result"},risultati:{id:"select_risultati",defaultMessage:"results"},ay11_up_down:{id:"ay11_Use Up and Down to choose options",defaultMessage:"Use Up and Down to choose options"},ay11_select_option:{id:"ay11_select_press Enter to select the currently focused option",defaultMessage:"press Enter to select the currently focused option"},ay11_exit_menu:{id:"ay11_select_press Escape to exit the menu",defaultMessage:"press Escape to exit the menu"},ay11_tab_select_and_exit:{id:"ay11_select__press Tab to select the option and exit the menu",defaultMessage:"press Tab to select the option and exit the menu"},ay11_is_focused:{id:"ay11_select_is_focused",defaultMessage:"is_focused"},ay11_type_to_refine_list:{id:"ay11_select__type to refine list",defaultMessage:"type to refine list"},ay11_open_menu:{id:"ay11_select_press Down to open the menu",defaultMessage:"press Down to open the menu"},ay11_multi_select_focus_values:{id:"ay11_select_press left to focus selected values",defaultMessage:"press left to focus selected values"},ay11_toggle_values:{id:"ay11_select_Use left and right to toggle between focused values, press Backspace to remove the currently focused value",defaultMessage:"Use left and right to toggle between focused values, press Backspace to remove the currently focused value"},ay11_option:{id:"ay11_select option",defaultMessage:"option"},ay11_option_deselected:{id:"ay11_select deselected",defaultMessage:"deselected"},ay11_option_disabled:{id:"ay11_select is disabled. Select another option.",defaultMessage:"is disabled. Select another option."},ay11_option_selected:{id:"ay11_select selected",defaultMessage:"selected"},ay11_value:{id:"ay11_select value",defaultMessage:"value"},ay11_focused:{id:"ay11_select focused",defaultMessage:"focused"},ay11_disabled:{id:"ay11_select disabled",defaultMessage:"disabled"},ay11_for_search_term:{id:"ay11_select for search term",defaultMessage:"for search term"},results:{id:"ay11_select results",defaultMessage:"results"},result:{id:"ay11_select result",defaultMessage:"result"},availables:{id:"ay11_select availables",defaultMessage:"availables"},available:{id:"ay11_select available",defaultMessage:"available"}}),Q=e=>({guidance:t=>{const{isSearchable:a,isMulti:l,isDisabled:s,tabSelectsValue:i,context:o}=t;switch(o){case"menu":return`${e.formatMessage(K.ay11_up_down)}${s?"":`, ${e.formatMessage(K.ay11_select_option)}`}, ${e.formatMessage(K.ay11_exit_menu)}${i?`, ${e.formatMessage(K.ay11_tab_select_and_exit)}`:""}.`;case"input":return`${t["aria-label"]||"Select"} ${e.formatMessage(K.ay11_is_focused)} ${a?`,${e.formatMessage(K.ay11_type_to_refine_list)}`:""}, ${e.formatMessage(K.ay11_open_menu)}, ${l?` ${e.formatMessage(K.ay11_multi_select_focus_values)}`:""}`;case"value":return e.formatMessage(K.ay11_toggle_values);default:return""}},onChange:t=>{const{action:a,label:l="",isDisabled:s}=t;
2switch(a){case"deselect-option":case"pop-value":case"remove-value":return`${e.formatMessage(K.ay11_option)} ${l}, ${e.formatMessage(K.ay11_option_deselected)}.`;case"select-option":return s?`${e.formatMessage(K.ay11_option)} ${l} ${e.formatMessage(K.ay11_option_disabled)}.`:`${e.formatMessage(K.ay11_option)} ${l}, ${e.formatMessage(K.ay11_option_selected)}.`;default:return""}},onFocus:t=>{const{context:a,focused:l={},options:s,label:i="",selectValue:o,isDisabled:r,isSelected:n}=t,d=(e,t)=>e&&e.length?`${e.indexOf(t)+1} di ${e.length}`:"";if("value"===a&&o)return`${e.formatMessage(K.ay11_value)} ${i} ${e.formatMessage(K.ay11_focused)}, ${d(o,l)}.`;if("menu"===a){const t=r?` ${e.formatMessage(K.ay11_disabled)}`:"",a=`${n?e.formatMessage(K.ay11_option_selected):e.formatMessage(K.ay11_focused)}${t}`;return`${e.formatMessage(K.ay11_option)} ${i} ${a}, ${d(s,l)}.`}return""},onFilter:t=>{const{inputValue:a,resultsMessage:l}=t;return`${l}${a?` ${e.formatMessage(K.ay11_for_search_term)} `+a:""}.`}}),ee=e=>({count:t})=>`${t} ${1!==t?e.formatMessage(K.results):e.formatMessage(K.result)} ${1!==t?e.formatMessage(K.availables):e.formatMessage(K.available)}`;var te=l.createElement;const ae=(0,S.v)({default:{id:"Default",defaultMessage:"Default"},idDescription:{id:"Used for programmatic access to the fieldset.",defaultMessage:"Used for programmatic access to the fieldset."},title:{id:"Title",defaultMessage:"Title"},description:{id:"Description",defaultMessage:"Description"},close:{id:"Close",defaultMessage:"Close"},choices:{id:"Choices",defaultMessage:"Choices"},required:{id:"Required",defaultMessage:"Required"},select:{id:"Select\u2026",defaultMessage:"Select\u2026"},no_value:{id:"No value",defaultMessage:"No value"}});class le extends l.Component{componentDidMount(){var e;this.props.choices&&0!==(null===(e=this.props.choices)||void 0===e?void 0:e.length)||!this.props.vocabBaseUrl||this.props.getVocabulary({vocabNameOrURL:this.props.vocabBaseUrl,size:-1,subrequest:this.props.intl.locale})}render(){var e;const{id:t,choices:a,value:l,intl:s,onChange:i,required:o,invalid:n,title:u}=this.props,c=(0,X._1)(a,l,s),p=this.props.disabled||this.props.isDisabled,m=this.props.reactSelect.default;let f=this.props.vocabBaseUrl?this.props.choices:[...U()(a,(e=>({value:e[0],label:"None"!==e[1]&&e[1]?e[1]:e[0]}))),...this.props.noValueOption&&!this.props.default?[{label:this.props.intl.formatMessage(ae.no_value),value:"no-value"}]:[]];const v=this.props.isMulti?this.props.isMulti:"roles"===t||"groups"===t;let h={};o&&(h.required=!0,h["aria-required"]=!0);return(!0===n||"true"===n)&&(h["aria-invalid"]=!0),te(d.Z,this.props,te(m,(0,r.Z)({id:`field-${t}`,key:a,name:t,isDisabled:p,isSearchable:!0,className:"react-select-container",classNamePrefix:"react-select",isMulti:v,options:f},h,{styles:W.XR,theme:W.Pu,components:(0,A.Z)((0,A.Z)({},(null===f||void 0===f?void 0:f.length)>25&&{MenuList:W.qy}),{},{DropdownIndicator:W.ms,ClearIndicator:W.k2,Option:this.props.customOptionStyling||W.Wx}),value:c,placeholder:null!==(e=this.props.placeholder)&&void 0!==e?e:this.props.intl.formatMessage(ae.select),onChange:e=>i(t,v?e.map((e=>e.value)):e&&"no-value"!==e.value?e.value:void 0),isClearable:!0,"aria-label":u,ariaLiveMessages:Q(s),screenReaderStatus:ee(s)})))}}(0,z.Z)(le,"defaultProps",{description:null,required:!1,items:{vocabulary:null},widgetOptions:{vocabulary:null},error:[],choices:[],value:null,onChange:()=>{},onBlur:()=>{},onClick:()=>{},onEdit:null,onDelete:null,noValueOption:!0,customOptionStyling:null});const se=(0,m.ZP)(le),ie=(0,J.compose)((0,Z.lX)(["reactSelect"]),(0,j.connect)(((e,t)=>{var a,l,s;const i=t.choices?"":(0,G.G8)(t)||(0,G.Up)(t)||(0,G.xE)(t),o=null===(a=e.vocabularies)||void 0===a||null===(l=a[i])||void 0===l||null===(s=l.subrequests)||void 0===s?void 0:s[t.intl.locale];return t.choices?{choices:t.choices}:o?{vocabBaseUrl:i,choices:null!==(r=null===o||void 0===o?void 0:o.items)&&void 0!==r?r:[]}:i?{vocabBaseUrl:i}:{};var r}),{getVocabulary:Y.Rz,getVocabularyTokenTitle:Y.WL}))(se);var oe=a(416),re=a(87401),ne=l.createElement;const de=e=>{const{id:t,maxLength:a,value:s,onChange:i,placeholder:o,required:n,invalid:u}=e,{0:c,1:p}=(0,l.useState)("");let m={};
2n&&(m.required=!0,m["aria-required"]=!0);const f=!0===u||"true"===u;return((null===c||void 0===c?void 0:c.length)>0||f)&&(m["aria-invalid"]=!0),ne(d.Z,(0,r.Z)({},e,{className:"textarea"}),ne(oe.Z,(0,r.Z)({id:`field-${t}`,name:t,value:s||"",disabled:e.isDisabled,placeholder:o,onChange:({target:e})=>((e,t)=>{if(a&(null===t||void 0===t?void 0:t.length)){let e=a-t.length;p(e<0?`You have exceed word limit by ${Math.abs(e)}`:"")}i(e,t)})(t,""===e.value?void 0:e.value)},m)),c.length>0&&ne(re.Z,{key:c,basic:!0,color:"red",pointing:!0},c))};de.defaultProps={description:null,maxLength:null,required:!1,error:[],value:null,onChange:null,onEdit:null,onDelete:null};const ue=(0,m.ZP)(de);var ce=a(14302),pe=l.createElement;class me extends l.Component{componentDidMount(){this.props.focus&&this.node.focus()}render(){const{id:e,value:t,onChange:a,onBlur:l,onClick:s,icon:i,iconAction:o,minLength:n,maxLength:u,placeholder:c,error:p,required:m,invalid:f}=this.props;let v={};m&&(v.required=!0,v["aria-required"]=!0);const h=!0===f||"true"===f;return((null===p||void 0===p?void 0:p.length)>0||h)&&(v["aria-invalid"]=!0),pe(d.Z,(0,r.Z)({},this.props,{className:"text"}),pe(_.Z,(0,r.Z)({id:`field-${e}`,name:e,value:t||"",disabled:this.props.isDisabled,icon:i||null,placeholder:c,onChange:({target:t})=>a(e,""===t.value?void 0:t.value)},v,{ref:e=>{this.node=e},onBlur:({target:t})=>l(e,""===t.value?void 0:t.value),onClick:()=>s(),minLength:n||null,maxLength:u||null})),i&&o&&pe("button",{className:`field-${e}-action-button`,onClick:o},pe(ce.Z,{name:i,size:"18px"})))}}(0,z.Z)(me,"defaultProps",{description:null,required:!1,error:[],value:null,onChange:()=>{},onBlur:()=>{},onClick:()=>{},onEdit:null,onDelete:null,focus:!1,icon:null,iconAction:null,minLength:null,maxLength:null});const fe=(0,m.ZP)(me);var ve=a(22988),he=a(33244),ge=a(25146),_e=l.createElement;const be="_otp",ye=(0,S.v)({send_otp_to:{id:"form_send_otp_to",defaultMessage:"Send OTP code to {email}"},insert_otp:{id:"form_insert_otp",defaultMessage:"Insert here the OTP code received at {email}"},otp_sent:{id:"form_otp_send",defaultMessage:"OTP code was sent to {email}. Check your email and insert the received OTP code into the field above."},otp_countdown:{id:"form_otp_countdown",defaultMessage:"You can send a new OTP code in"}}),Me=e=>{const{id:t,title:a,fieldValue:s,onChange:i,value:o,valid:r,disabled:n,isOnEdit:d,formHasErrors:u,errorMessage:c,path:p,block_id:m}=e,f=(0,k.Z)(),v=(0,j.useDispatch)(),h=t+be,g=(0,j.useSelector)((e=>{var t,a;return null===(t=e.sendOTP)||void 0===t||null===(a=t.subrequests)||void 0===a?void 0:a["otp_"+m+"_"+s]})),{0:_,1:b}=(0,l.useState)(null),{0:y,1:M}=(0,l.useState)(null),C=(0,ve.vV)(s);return(0,l.useEffect)((()=>{if(null!==g&&void 0!==g&&g.loaded){const e=(new Date).getTime()+3e5;b(e),M(e-(new Date).getTime());const t=setInterval((()=>{M(_-(new Date).getTime())}),1e3);return()=>clearInterval(t)}M(null),b(null)}),[g,_]),C?_e("div",{className:"otp-widget"},_e("div",{className:"otp-widget-field-wrapper"},_e("div",{className:"button-wrapper"},_e(De,{basic:!0,size:"mini",primary:!0,type:"button",onClick:e=>{e.preventDefault(),v((0,ge.OA)(p,m,s))},className:"send-otp-code",disabled:y>0},f.formatMessage(ye.send_otp_to,{email:s})),y>0&&_e("div",{className:"otp-button-message"},f.formatMessage(ye.otp_countdown)," ",(e=>[Math.floor(e/864e5),Math.floor(e%864e5/36e5),Math.floor(e%36e5/6e4),Math.floor(e%6e4/1e3)])(y).filter(((e,t)=>e>0||2===t||3===t)).map((e=>e<10?"0"+e:e)).join(":"),".")),_e(he.default,{label:null!==a&&void 0!==a?a:f.formatMessage(ye.insert_otp,{email:s}),name:h,id:t,field_type:"text",required:!0,value:o||"",onChange:i,valid:r,disabled:n,formHasErrors:u,errorMessage:c,isOnEdit:d})),(null===g||void 0===g?void 0:g.loaded)&&!(null!==g&&void 0!==g&&g.loading)&&_e("div",{className:"otp-alert otp-success"},f.formatMessage(ye.otp_sent,{email:s})),(null===g||void 0===g?void 0:g.error)&&_e("div",{className:"otp-alert otp-error"},JSON.stringify(g.error))):_e(l.Fragment,null)};Me.defaultProps={description:null,required:!1,error:[],value:null,onChange:()=>{},onBlur:()=>{},onClick:()=>{},minLength:null,maxLength:null};const Ce=Me;var Ze=a(48237),ke=l.createElement;const De=e=>ke(Ze.Z,e)},27572:e=>{e.exports={attributes:{xmlns:"http://www.w3.org/2000/svg",width:"36",height:"36",viewBox:"0 0 36 36"},content:'<g fill-rule="evenodd">
2<path d="M28.9707,15.6641 C28.9907,15.4401 28.9997,15.2191 28.9997,15.0001 C28.9997,10.5891 25.4107,7.0001 20.9997,7.0001 C17.9547,7.0001 15.2217,8.7151 13.8727,11.3711 C13.2807,11.1261 12.6477,11.0001 11.9997,11.0001 C9.3517,11.0001 7.1777,13.0691 7.0107,15.6761 C4.5837,16.8221 2.9997,19.2771 2.9997,22.0001 C2.9997,25.8591 6.1407,29.0001 9.9997,29.0001 L11.9997,29.0001 L11.9997,27.0001 L9.9997,27.0001 C7.2427,27.0001 4.9997,24.7571 4.9997,22.0001 C4.9997,19.8761 6.3517,17.9791 8.3627,17.2801 L9.0977,17.0251 L8.9997,16.0001 C8.9997,14.3461 10.3457,13.0001 11.9997,13.0001 C12.6307,13.0001 13.2427,13.2051 13.7697,13.5931 L14.8757,14.4071 L15.3107,13.1031 C16.1287,10.6491 18.4147,9.0001 20.9997,9.0001 C24.3087,9.0001 26.9997,11.6911 26.9997,15.0001 C26.9997,15.3601 26.9637,15.7361 26.8917,16.1161 L26.7287,16.9781 L27.5617,17.2531 C29.6177,17.9301 30.9997,19.8371 30.9997,22.0001 C30.9997,24.7531 28.7637,26.9931 26.0127,27.0001 C25.6057,26.9681 24.9807,26.9801 23.9807,27.0001 L24.0197,29.0001 C24.4497,28.9911 24.9307,28.9841 25.2997,28.9821 L25.9997,29.0001 C29.8597,29.0001 32.9997,25.8591 32.9997,22.0001 C32.9997,19.2551 31.4107,16.8041 28.9707,15.6641"/><path d="M19 27.586 19 17 17 17 17 27.586 13.707 24.293 12.293 25.707 18 31.414 23.707 25.707 22.293 24.293z"/></g>'}}}]); 3//# sourceMappingURL=VoltoFormBlockEdit.21e4bbfd.chunk.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.