1"use strict";(self.webpackChunksmartfire=self.webpackChunksmartfire||[]).push([[3613],{60768(e,t,r){r.r(t),r.d(t,{Button:()=>x,default:()=>P});var l=r(89379),o=r(53986),n=r(41594),i=r(74888),a=r(70579);const s=["color"];const d=function(e){let t=e.color,r=void 0===t?"#202F46":t,n=(0,o.A)(e,s);return(0,a.jsx)("svg",(0,l.A)((0,l.A)({xmlns:"http://www.w3.org/2000/svg",width:"23",height:"14",fill:"none",viewBox:"0 0 23 14"},n),{},{children:(0,a.jsx)("path",{fill:r,d:"M1 6.15a.85.85 0 000 1.7v-1.7zm21.601 1.451a.85.85 0 000-1.202l-5.41-5.41a.85.85 0 00-1.201 1.203L20.798 7l-4.808 4.808a.85.85 0 101.202 1.202L22.6 7.601zM1 7.85h21v-1.7H1v1.7z"})}))};var u,c,f,p,m;const h=["title","titleId"];function _(){return _=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var l in r)({}).hasOwnProperty.call(r,l)&&(e[l]=r[l])}return e},_.apply(null,arguments)}function g(e,t){let r=e.title,l=e.titleId,o=function(e,t){if(null==e)return{};var r,l,o=function(e,t){if(null==e)return{};var r={};for(var l in e)if({}.hasOwnProperty.call(e,l)){if(-1!==t.indexOf(l))continue;r[l]=e[l]}return r}(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(l=0;l<n.length;l++)r=n[l],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,h);return n.createElement("svg",_({width:35,height:48,viewBox:"0 0 35 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:t,"aria-labelledby":l},o),r?n.createElement("title",{id:l},r):null,u||(u=n.createElement("path",{d:"M2.76353 25.1545H5.39163C6.49555 25.1545 7.68424 25.6981 7.63506 27.0639C7.59195 28.2915 6.84976 29.0305 5.39163 29.0305H2.76353V25.1545ZM0 22.8689V36.0694H2.76353V31.277H5.82645C8.31074 31.277 10.0598 29.52 10.0598 27.1415C10.0598 24.6577 8.17903 22.8693 5.82645 22.8693L0 22.8689Z",fill:"#202F46"})),c||(c=n.createElement("path",{d:"M14.7687 25.1545H16.8125C19.4917 25.1545 20.4864 26.8957 20.4948 29.3289C20.4977 31.809 19.39 33.8228 17.0547 33.8228H14.7686L14.7687 25.1545ZM12.082 22.8689V36.0694H17.61C21.3964 36.0694 23.3751 32.7389 23.3161 29.3293C23.2505 25.616 20.7039 22.8684 17.1944 22.8684L12.082 22.8689Z",fill:"#202F46"})),f||(f=n.createElement("path",{d:"M25.5959 22.8694V36.0699H28.3604V30.5044H34.1645V28.1757H28.3604V25.1746H35.0003V22.8697L25.5959 22.8694Z",fill:"#202F46"})),p||(p=n.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.3432 0.000359652L0.00732422 11.9026V20.9444H2.54127V13.648H14.0396V5.14286H11.5005V11.1099H4.05324L11.5005 2.53814H32.4533V20.9445H34.9915V0L10.3432 0.000359652Z",fill:"#202F46"})),m||(m=n.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.00732422 38.0094V47.2685L34.9919 47.3027V33.5312H32.4538V44.7621L2.54067 44.7344V38.0098L0.00732422 38.0094Z",fill:"#202F46"})))}const y=n.forwardRef(g);r.p;var w=r(58387),b=r(60953);const v=["text","linkType","link","targetBlank","type","shape","arrow","color","color2","align","className","wrapper","showInspector","tagName","isSubmit","postType","fileId","postId","taxonomy","termId","isLoading"],k=["align"],A=(0,n.lazy)(()=>Promise.all([r.e(9044),r.e(6324)]).then(r.bind(r,56324))),x=e=>{let t=e.text,r=e.linkType,s=e.link,u=e.targetBlank,c=void 0!==u&&u,f=e.type,p=void 0===f?"filled":f,m=e.shape,h=void 0===m?"squared":m,_=e.arrow,g=void 0===_?"rightArrow":_,k=e.color,x=void 0===k?b.A.yellow:k,P=e.color2,B=void 0===P?b.A.blue:P,D=(e.align,e.className),I=void 0===D?null:D,H=(e.wrapper,e.showInspector),V=void 0===H||H,j=e.tagName,L=void 0===j?"a":j,C=e.isSubmit,E=void 0!==C&&C,N=(e.postType,e.fileId,e.postId,e.taxonomy,e.termId,e.isLoading),S=void 0!==N&&N,F=(0,o.A)(e,v);const O=(0,i.useEditor)().isEditing;(0,i.useInspectorControl)(V?A:()=>"");const T=(0,n.useMemo)(()=>{switch(r){case"email":return"mailto:"+s;case"tel":return"tel:"+s;default:return s}},[s,r]),M=L,R=x===b.A.blue||x===b.A.blue2||x===b.A.black,q=B===b.A.blue||B===b.A.blue2||B===b.A.black;return(0,a.jsxs)(M,(0,l.A)((0,l.A)({className:(0,w.A)(I,b.A.button,b.A[p],b.A[h],b.A[g],b.A[r],R&&b.A.dark,q&&b.A.hoverDark,S&&b.A.loading),href:!O&&T?T:void 0,target:c?"_blank":void 0,download:"file"===r,type:E?"submit":null,style:{"--color":x,"--color2":B}},F),{},{children:["file"===r&&(0,a.jsx)(y,{className:b.A.pdfIcon}),(0,a.jsx)("div",{className:b.A.back}),t&&(0,a.jsx)("span",{className:b.A.text,children:t}),F.children,!S&&(0,a.jsx)(d,{className:b.A.icon})]}))},P=(0,i.defineBlock)({Block:e=>{let t=e.align,r=(0,o.A)(e,k);return(0,a.jsx)(i.BlockWrapper.Div,{className:(0,w.A)(b.A.wrapper,t&&b.A[t]),children:(0,a.jsx)(x,(0,l.A)({},r))})},smartProps:{text:i.smartProps.string.withDefault("Mon Bouton"),linkType:i.smartProps.string.withDefault("other"),link:i.smartProps.string.withDefault(""),postType:i.smartProps.string.withDefault(""),fileId:i.smartProps.number.withDefault(0),targetBlank:i.smartProps.bool.withDefault(!1),type:i.smartProps.string.withDefault("filled"),shape:i.smartProps.string.withDefault("squared"),arrow:i.smartProps.string.withDefault("rightArrow"),color:i.smartProps.string.withDefault(b.A.yellow),color2:i.smartProps.string.withDefault(b.A.blue),align:i.smartProps.string.withDefault("
1center"),postId:i.smartProps.number.withDefault(0),taxonomy:i.smartProps.string.withDefault(""),termId:i.smartProps.number.withDefault(0)},setup:{title:"Bouton"}})},39375(e,t,r){r.r(t),r.d(t,{default:()=>m});var l=r(47075),o=r(41594),n=r(19508),i=r.n(n),a=r(74888),s=r(39657),d=r(60768);const u={tabletBreakpoint:"992px",mobileBreakpoint:"767px",desktopBreakpoint:"1200px",headerTopMenuHeight:"68px",yellow:"#d8b458",yellowHover:"#caa851",yellowLink:"#8d650c",blue:"#202f46",blue2:"#131c2a",beige:"#fefdfb",beige2:"#f6f5f3",white:"#fff",black:"#212121","content-width":"block_content-width__SrXhM",form:"block_form__NK5Cm",left:"block_left__rmsGF",center:"block_center__Fqi2r",right:"block_right__GMyEt",fields:"block_fields__Fp0bs",medium:"block_medium__9ZDyy",large:"block_large__vmIc5",sendButton:"block_sendButton__XOm1W",alert:"block_alert__lS+qd"};var c=r(58387),f=r(70579);const p=(0,o.lazy)(()=>r.e(9302).then(r.bind(r,89302))),m=(0,a.defineBlock)({Block:e=>{let t=e.formId,r=e.formVersion,n=e.sendButtonText,m=e.width,h=e.formAlign;(0,a.useInspectorControl)(p);const _=(0,a.useEditor)().isEditing,g=(0,s.Ub)({query:"(max-width: "+u.mobileBreakpoint+")"}),y=(0,o.useState)(!1),w=(0,l.A)(y,2),b=w[0],v=w[1],k=(0,o.useState)(""),A=(0,l.A)(k,2),x=A[0],P=A[1],B=(0,o.useState)([]),D=(0,l.A)(B,2),I=D[0],H=D[1],V=(0,o.useRef)(null);return(0,f.jsxs)(a.BlockWrapper.Form,{className:(0,c.A)(u.form,u[h]),onSubmit:e=>{if(e.preventDefault(),b)return;if(_)return;if(null===V||void 0===V||!V.current)return;H([]);const l=[],o=new FormData;o.append("formId",t),o.append("formVersion",r);for(const t of V.current.elements)if("BUTTON"!==t.tagName&&("radio"!==t.type||t.checked)){if("INPUT"===t.tagName){const e=t.closest('[id^="formulaide_group"]');if(e){if("none"===window.getComputedStyle(e).getPropertyValue("display"))continue}if("hidden"!==t.type&&""===t.value.trim()&&l.push({field:t.name,message:"Ce champ est requis."}),"hidden"===t.type&&"arity_min_elements"===t.name)continue;if("tel"===t.type){/^(?:(?:\+|00)33|0)\s*[1-9](?:[\s.-]*\d{2}){4}$/.test(t.value)||l.push({field:t.name,message:"Le num\xe9ro de t\xe9l\xe9phone est invalide."})}if("email"===t.type){/^[A-Za-z0-9_!#$%&'*+=?`{|}~^.-]+@[A-Za-z0-9.-]+$/gm.test(t.value)||l.push({field:t.name,message:"L'adresse email est invalide."})}"checkbox"===t.type&&(t.value=t.checked?"true":"false")}o.append(t.name,t.value)}const n=V.current.querySelectorAll('[id^="formulaide_arity_"]');if(n.length>0)for(const t of n){const e=t.closest('[id^="formulaide_group"]');if(e){if("none"===window.getComputedStyle(e).getPropertyValue("display")&&"block"!==e.style.display)continue}const r=t.querySelector('[name="arity_min_elements"').value;if(r<1)continue;t.querySelector("[id^=arity_groups_]").childElementCount<r&&l.push({field:t.id,message:"Vous n\u2019avez pas ajout\xe9 assez d\u2019\xe9l\xe9ments."})}H(l),l.length>0||(v(!0),i()({path:"smartfire/v1/sendDataToForm",method:"POST",body:o}).then(e=>{const t=V.current.querySelectorAll("input");t.length>0&&t.forEach(e=>{"radio"!==e.type&&(e.value="")}),P(null===e||void 0===e?void 0:e.message)}).catch(()=>{P("D\xe9sol\xe9, une erreur s'est produite.")}).finally(()=>{v(!1);const e=V.current.getBoundingClientRect(),t=e.top,r=e.bottom,l=window.innerHeight;(t<0||r>l)&&V.current.scrollIntoView({behavior:"smooth"})}))},ref:V,children:[x&&(0,f.jsx)("div",{className:u.alert,children:(0,f.jsx)("p",{children:x})}),(0,f.jsx)(a.ChildrenBlock,{gutenbergEditorConfig:{orientation:"vertical"},className:(0,c.A)(u.fields,u[m]),childrenProps:{formErrors:I,setFormErrors:H}}),(0,f.jsx)(d.default,{text:n,className:u.sendButton,showInspector:!1,align:g?"center":"left",isSubmit:!0,tagName:"button",isLoading:b})]})},smartProps:{formId:a.smartProps.string.withDefault(""),formVersion:a.smartProps.string.withDefault(""),formFields:a.smartProps.array.withDefault({}).contentServerSide(),sendButtonText:a.smartProps.string.withDefault("Envoyer le formulaire"),width:a.smartProps.string.withDefault("medium"),formAlign:a.smartProps.string.withDefault("left")},setup:{title:"Formulaide"}})},60953(e,t,r){r.d(t,{A:()=>l});
vendor: 1,389 bytes, lines 1-2
1const l={tabletBreakpoint:"992px",mobileBreakpoint:"767px",desktopBreakpoint:"1200px",headerTopMenuHeight:"68px",yellow:"#d8b458",yellowHover:"#caa851",yellowLink:"#8d650c",blue:"#202f46",blue2:"#131c2a",beige:"#fefdfb",beige2:"#f6f5f3",white:"#fff",black:"#212121","content-width":"style_content-width__20rYF",wrapper:"style_wrapper__rwADw",left:"style_left__L-zp3",center:"style_center__1z5Bp",right:"style_right__ORlOf",button:"style_button__W1egp",pdfIcon:"style_pdfIcon__ZHgAL",back:"style_back__LIFRR",icon:"style_icon__foyH6",noArrow:"style_noArrow__HUi+b",leftArrow:"style_leftArrow__nRT6T",file:"style_file__EKg15",filled:"style_filled__qTB0S",dark:"style_dark__j-RR-",borders:"style_borders__h57kA",loading:"style_loading__0IpHO",hoverDark:"style_hoverDark__jBFOZ",empty:"style_empty__hDF22",rightArrow:"style_rightArrow__qIIo7",rounded:"style_rounded__QNIOC",text:"style_text__KyhHI",rotation:"style_rotation__Enm57"}},58387(e,t,r){function l(e){var t,r,o="";if("string"==typeof e||"number"==typeof e)o+=e;else if("object"==typeof e)if(Array.isArray(e)){var n=e.length;for(t=0;t<n;t++)e[t]&&(r=l(e[t]))&&(o&&(o+=" "),o+=r)}else for(r in e)e[r]&&(o&&(o+=" "),o+=r);return o}r.d(t,{A:()=>o});const o=function(){for(var e,t,r=0,o="",n=arguments.length;r<n;r++)(e=arguments[r])&&(t=l(e))&&(o&&(o+=" "),o+=t);return o}}}]); 2//# sourceMappingURL=block-formulaide.6abe36ed.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.