PageSourceSearch

https://www.pingviini.fi/fi-FI/component---src-pages-strapi-contact-form-slug-js-0544ec776aa2fde335cc.js

js pingviini.fi collected 2026-10-02 13:45:54 UTC 8,447 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunkhtml=self.webpackChunkhtml||[]).push([[896],{44679:function(e,t,n){n.d(t,{P:function(){return i}});n(96540);var a=n(24794),o=n(59146),l=n(53283),s=n(17437);const i=e=>{let{children:t}=e;const{siteSettings:n}=(0,a.useStaticQuery)("2169102981");return(0,s.Y)(o.a,null,(0,s.Y)(l.Y9,null),(0,s.Y)(o.a,{as:"main"},t),(0,s.Y)(l.wi,null),(null==n?void 0:n.backToTopText)&&(0,s.Y)(l.eq,{text:n.backToTopText}))}},62672:function(e,t,n){n.r(t),n.d(t,{Head:function(){return V},default:function(){return j}});var a=n(54506),o=n(96540),l=n(44679),s=n(53283),i=n(82777),r=n(67234),d=n(85353),c=n(59146),u=n(78787),m=n(35627),p=n(80334),f=n(74493),b=n(18795),v=n(69038),h=n(83239),y=n(10776),g=n(71461),w=n(79613),Y=n(57559),x=n(31048),I=n(23094),A=n(22319),k=n(75948),T=n(80096),S=n(57243),$=n(79762),C=n(17921);const D=e=>e.map(e=>{let{files:t,...n}=e;return n}),P=async e=>{const t=e.flatMap(e=>e.files||[]);return Promise.all(t.map(async e=>{const t=await(n=e,new Promise(e=>{const t=new FileReader;t.readAsDataURL(n),t.onloadend=()=>{e(t.result)}}));var n;return{filename:e.name,blob:t.split("base64,")[1]}}))};var R=n(17437);const B={text:v.A,textarea:h.A,selection:b.A,number:y.A,email:g.A,date:w.A,file:Y.A,checkbox:x.A,radio:I.A},V=e=>{let{location:t,data:n}=e;const{pathname:a}=t,{strapiContactForm:l}=n;return(0,R.Y)(o.Fragment,null,(0,R.Y)(s.G$,{seo:null==l?void 0:l.seo,pathname:a,defaultTitle:null==l?void 0:l.title,siteLanguage:S.locale}),(null==l?void 0:l.body)&&(0,R.Y)(s.NV,{firstComponent:l.body[0]}))};var j=e=>{var t;let{data:n,pageContext:s}=e;const{breadcrumbs:b}=s,{strapiContactForm:v}=n,{formId:h,heading:y,tagline:g,content:w,defaultPlaceholder:Y,defaultErrorMessage:x,submitButtonText:I,responseText:V,sendingMessageText:j,sendAgainText:z,fieldGroups:q,commands:M}=v,_=(0,C.Pi)(q),{0:E,1:L}=(0,o.useState)(!1),{0:F,1:U}=(0,o.useState)(!1),{0:Z,1:W}=(0,o.useState)(!1),{0:G,1:N}=(0,o.useState)(!1),{0:Q,1:H}=(0,o.useState)(!1),{0:K,1:J}=(0,o.useState)([]),{0:O,1:X}=(0,o.useState)([]),ee=e=>{let{fieldId:t,required:n}=e;!0===n&&J(e=>[].concat((0,a.A)(e),[t]))},te=(0,o.useCallback)(async e=>{e.preventDefault();const t=(n=e.target.elements,Array.from(n).filter(e=>e.id&&e.id.length>0&&"submit"!==e.type).map(e=>{const{id:t,name:n,value:o,type:l,selectedIndex:s}=e,i=e.dataset.customDataId||null;if("radio"===l&&!1===e.checked)return null;if("file"===l){const o=(0,a.A)(e.files||[]);return{id:t,name:n,type:l,value:o.map(e=>e.name).join(", "),selectedIndex:s,dataId:i,files:o}}return{id:t,name:n,type:l,value:o,selectedIndex:s,dataId:i,files:[]}}).filter(Boolean));var n;if(U(!0),H(!1),!0===E){U(!1),W(!0);const e=await P(t),{success:n,data:a}=await(0,C.jT)(`${(0,$.m)(S.localeRoot,"/")}api/post-form/`,{formId:h,values:D(t),attachments:e});if(W(!1),!1===n)return console.log("Returned error data:",a),void H(!0);N(!0)}else if("undefined"!=typeof window&&K.length>0){const[e]=K,t=document.getElementById(e);t&&t.scrollIntoView({behavior:"smooth",block:"center",inline:"nearest"})}},[E,h,K]),ne=(0,o.useCallback)(()=>{H(!1),W(!1),N(!1),U(!1),L(!1)},[]);return(0,o.useEffect)(()=>{L(0===K.length)},[K]),(0,o.useEffect)(()=>{_.forEach(e=>{let{fields:t}=e;t.map(e=>{var t,n;let{id:o,label:l,fieldType:s,errorMessage:i,required:r,placeholder:d,dataId:c}=e;const u=(null==M||null===(t=M.strapi_json_value)||void 0===t?void 0:t.find(e=>{var t,n;return(null==e||null===(t=e.if)||void 0===t?void 0:t.dataId)===c&&!(null==e||null===(n=e.if)||void 0===n||!n.showById)}))||null;if(null==u)return;const m=!0===Array.isArray(s.fieldValue)?null===(n=s.fieldValue[0])||void 0===n?void 0:n.value:s.fieldValue;var p;u.if.hasValue!==m&&X((0,a.A)(null==u||null===(p=u.if)||void 0===p?void 0:p.showById))})})},[]),(0,R.Y)(l.P,null,(0,R.Y)(r.s,{width:"100%",flexDirection:{base:"column",md:"row"},pb:"24"},(0,R.Y)(u.A,{h:"fit-content",w:{base:"100%",md:"50%"},pt:{base:"32",md:"44"},pb:{base:"2",md:"12"},mb:"0",bg:"primary.dark-blue",borderBottomRightRadius:{base:"none",md:"lg"}},(0,R.Y)(r.s,{px:{base:5,md:14},maxWidth:"45rem",h:"100%",ml:"auto",flexDirection:"column"},b.crumbs&&(0,R.Y)(k.A,{id:"contact-form-breadcrumbs",color:"white",background:"transparent",wrapperProps:{px:0,pb:4,sx:{a:{color:"white"},div:{color:"white"}}},crumbs:b.crumbs}),null!==g&&(0,R.Y)(d.D,{as:"p",pb:{base:"2",md:"26"},variant:"detail",size:"xs",color:"secondary.light-grey"},g),null!==y&&(0,R.Y)(d.D,{as:"h2",size:"4xl",mt:"auto",mb:"4",color:"secondary.light-grey"},y),null!==(null==w||null===(t=w.data)||void 0===t?void 0:t.content)&&(0,R.Y)(T.A,{props:{px:"0",color:"white"},data:{richText:{data:{richText:w.data.content}}}}))),(0,R.Y)(u.A,{w:{base:"100%",md:"50%"},px:{base:"5",md:"28"},pt:{base:"32",md:"44"},p:"0",mb:"0",bg:{base:"primary.dark-blue",md:"transparent"}},(0,R.Y)(c.a,{pt:{base:12,md:0}
1,px:"5",bg:"white",borderTopLeftRadius:"sm",borderTopRightRadius:"sm"},!0===Z||!0===G||!0===Q?(0,R.Y)(A.A,{responseText:V,sendingMessageText:j,sendAgainText:z,onClick:ne,formDidError:Q,submitInProgress:Z,submitSuccess:G}):(0,R.Y)(r.s,{maxWidth:{base:"none",md:"25rem"},mr:"auto",flexDirection:"column"},(0,R.Y)(c.a,{id:"contact-form",as:"form",onSubmit:te,noValidate:!0},(null==_?void 0:_.length)>0&&_.map(e=>{let{id:t,label:n,fields:o}=e;return(0,R.Y)(c.a,{w:"100%",key:`contact-form-field-group-${n}-${t}}`,mb:{base:"0",md:"6"}},(0,R.Y)(d.D,{as:"p",size:"md",color:"primary.dark-blue",mb:"1.5"},n),(null==o?void 0:o.length)>0&&o.filter(e=>!1===O.some(t=>t===e.dataId)).map(e=>{let{id:t,label:n,fieldType:o,errorMessage:l,required:s,placeholder:i,dataId:r}=e;if(null===o)return(0,R.Y)("div",{key:`dynamic-zone-component-${t}`},"Field type missing for ",t,".");const d=o.type?B[String(o.type)]:null;return null==d?(0,R.Y)("div",{key:`dynamic-zone-component-${o.type}-${t}`},"Component ",(0,R.Y)("b",null,o.type)," not found on ",t,"."):(0,R.Y)(d,{key:`contact-form-field-component-${o.type}-${t}`,fieldId:t,dataId:r,submitAttempted:F,defaultPlaceholder:Y,overridePlaceholder:i,required:s,errorMessage:l||x,fieldLabel:n,fieldValue:o.fieldValue,onReady:ee,onChange:e=>(e=>{let{fieldId:t,isValid:n,fieldLabel:o,dataId:l,value:s}=e;if(null!=M&&M.strapi_json_value){var i;const e=(null==M||null===(i=M.strapi_json_value)||void 0===i?void 0:i.find(e=>{var t,n;return(null==e||null===(t=e.if)||void 0===t?void 0:t.dataId)===l&&!(null==e||null===(n=e.if)||void 0===n||!n.showById)}))||null;if(null==e)return;var r;e.if.hasValue===s?X(t=>t.filter(t=>{var n;return!1===(null==e||null===(n=e.if)||void 0===n?void 0:n.showById.some(e=>e===t))})):X([].concat((0,a.A)(O),(0,a.A)(null==e||null===(r=e.if)||void 0===r?void 0:r.showById)))}const d=K.filter(e=>e!==t);J(!1===n?[].concat((0,a.A)(d),[t]):d)})({...e,dataId:r})})}))}),(0,R.Y)(p.A,{type:"submit",disabled:!1===E||!0===Z,rightIcon:(0,R.Y)(f.ArrowRightIcon,null)},I)))))),(0,R.Y)(m.A,null,(null==v?void 0:v.body)&&v.body.map((e,t)=>(0,i.a)({...e,index:t}))))}},82777:function(e,t,n){n.d(t,{a:function(){return s}});n(96540);var a=n(53283),o=n(17437);const l={"sections.standard-hero":a.wB,"sections.home-hero":a.UQ,"sections.article-hero":a.rP,"sections.media-and-text":a.bC,"sections.text-on-media":a.No,"sections.brand-hero":a.gQ,"sections.brand-cards-row":a.n_,"sections.other-brands-row":a.T$,"elements.brand-card":a.Zp,"elements.product-card":a.Zp,"elements.news-card":a.Zp,"elements.team-card":a.Zp,"elements.job-card":a.Zp,"elements.wysiwyg":a.sD,"elements.cookie-policy":a.Db,"elements.breadcrumbs":a.BI,"elements.share-block":a.SY,"sections.half-and-half":a.qY,"sections.spotlight-on-carousel":a.GI,"sections.product-row":a.eg,"sections.team-carousel":a.Wl,"sections.news-carousel":a.Ss,"sections.project-carousel":a.Ss,"sections.faq-block":a.YN,"sections.tabs":a.tU,"sections.tabs-long-form":a.HW,"sections.mondelez-tabs-form":a.Tf,"sections.list-stack":a.LI,"sections.team-card-row":a.sS,"sections.interactive-map":a.R5,"sections.timeline":a.Kf,"sections.job-description":a.km,"sections.kiosk-map":a.i7,"media.image":a.$U,"media.video":a.$U,"sections.competition-selector":a.eP,"sections.jobs-embed":a.mr},s=e=>{let{id:t,strapiComponent:n,index:a,...s}=e;const i=l[String(n)];return void 0===i?(0,o.Y)("div",{key:`dynamic-zone-component-${n}-${a}`},"Component ",(0,o.Y)("b",null,n)," not found"):(0,o.Y)(i,{key:`dynamic-zone-component-${n}-${a}`,data:{strapiComponent:n,...s}})}}}]);
2//# sourceMappingURL=component---src-pages-strapi-contact-form-slug-js-0544ec776aa2fde335cc.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.