%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /var/www/html/.next/server/chunks/
Upload File :
Create Path :
Current File : /var/www/html/.next/server/chunks/300.js

"use strict";
exports.id = 300;
exports.ids = [300];
exports.modules = {

/***/ 2300:
/***/ ((module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "Z": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6689);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1664);
/* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var next_image__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(5675);
/* harmony import */ var next_image__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_image__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var formik__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(2296);
/* harmony import */ var formik__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(formik__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var yup__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(5609);
/* harmony import */ var yup__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(yup__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var html_react_parser__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2905);
/* harmony import */ var _Icons__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(8777);
/* harmony import */ var _store_context_GlobalContext__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(9592);
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([html_react_parser__WEBPACK_IMPORTED_MODULE_6__, _store_context_GlobalContext__WEBPACK_IMPORTED_MODULE_8__]);
([html_react_parser__WEBPACK_IMPORTED_MODULE_6__, _store_context_GlobalContext__WEBPACK_IMPORTED_MODULE_8__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);









// import { useInView } from "./useInView";
function Contact() {
    const { contact , footer , setIsColor  } = (0,_store_context_GlobalContext__WEBPACK_IMPORTED_MODULE_8__/* .useGlobalContext */ .b)();
    const { 0: msg , 1: setMsg  } = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false);
    const { 0: errMsg , 1: setErrMsg  } = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false);
    // const targetColorRef = useRef(null);
    // const targetColorSecondRef = useRef(null);
    // const useTarget = useInView(targetColorRef, {
    //   rootMargin: "200px 0px -700px 0px",
    //   threshold: 0.8,
    // });
    // const useSecondTarget = useInView(targetColorSecondRef, {
    //   rootMargin: "200px 0px -700px 0px",
    //   threshold: 0.2,
    // });
    // useEffect(() => {
    //   if (useTarget) {
    //     console.log("a");
    //     setIsColor("white");
    //   } else if (useSecondTarget) {
    //     console.log("b");
    //     setIsColor("original");
    //   } else {
    //     setIsColor("original");
    //   }
    // }, [useTarget, useSecondTarget]);
    (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{
        // window.addEventListener("loadstart", () => {
        //   ScrollTrigger.clearScrollMemory();
        // });
        // window.history.scrollRestoration = "manual";
        window.scrollTo({
            top: 0,
            left: 0,
            behavior: "smooth"
        });
    }, []);
    const { 0: legalModal , 1: setLegalModal  } = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false);
    const hideScroll = ()=>{
        let html = document.querySelector("html");
        html.classList.add("overflowHidden");
    };
    const showScroll = ()=>{
        let html = document.querySelector("html");
        html.classList.remove("overflowHidden");
    };
    return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
        className: "mainContact",
        children: [
            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                className: "newsBackground",
                children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                    className: "intro",
                    children: [
                        /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                            className: "contactUsDiv",
                            children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("h4", {
                                children: contact?.small_title
                            })
                        }),
                        /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("h2", {
                            children: contact?.title
                        }),
                        /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("h1", {
                            children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("a", {
                                href: `tel:${contact?.phone}`,
                                children: contact?.phone
                            })
                        })
                    ]
                })
            }),
            /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                className: "content",
                children: [
                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(formik__WEBPACK_IMPORTED_MODULE_4__.Formik, {
                        validationSchema: (0,yup__WEBPACK_IMPORTED_MODULE_5__.object)({
                            Email: (0,yup__WEBPACK_IMPORTED_MODULE_5__.string)().email().required(`Email is required`),
                            terms: (0,yup__WEBPACK_IMPORTED_MODULE_5__.boolean)().oneOf([
                                true
                            ], "You must accept the terms and conditions")
                        }),
                        initialValues: {
                            First_name: "",
                            Email: "",
                            Message: "",
                            terms: false
                        },
                        onSubmit: async (values, { resetForm  })=>{
                            setMsg(false);
                            setErrMsg(false);
                            const { First_name , Email , Message , terms  } = values;
                            let body = {
                                First_name: First_name,
                                Email: Email,
                                Message: Message
                            };
                            const res = await fetch(`https://api.atvbuggy-dubrovnik.com/wp-json/api/v1/sendMail`, {
                                method: "POST",
                                headers: {
                                    "Content-Type": "application/json"
                                },
                                body: JSON.stringify(body)
                            }).then((response)=>response.json()).then((data)=>data);
                            if (res.status === true) {
                                resetForm({
                                    values: ""
                                });
                                setMsg(true);
                            } else {
                                setErrMsg(true);
                            }
                        },
                        children: ({ isSubmitting , isValidating  })=>/*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(formik__WEBPACK_IMPORTED_MODULE_4__.Form, {
                                children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                                    className: "form",
                                    children: [
                                        /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("h3", {
                                            children: contact?.form_description
                                        }),
                                        /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(formik__WEBPACK_IMPORTED_MODULE_4__.Field, {
                                            type: "text",
                                            placeholder: "Enter your name",
                                            name: "First_name"
                                        }),
                                        /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(formik__WEBPACK_IMPORTED_MODULE_4__.Field, {
                                            type: "text",
                                            placeholder: "Enter your email address",
                                            name: "Email"
                                        }),
                                        /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(formik__WEBPACK_IMPORTED_MODULE_4__.ErrorMessage, {
                                            name: "Email",
                                            children: (msg)=>/*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                                                    className: "error-msg",
                                                    children: msg
                                                })
                                        }),
                                        /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(formik__WEBPACK_IMPORTED_MODULE_4__.Field, {
                                            type: "text",
                                            placeholder: "Enter your message here",
                                            name: "Message"
                                        }),
                                        /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                                            className: "policy",
                                            children: [
                                                /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                                                    className: "conditions",
                                                    children: [
                                                        /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(formik__WEBPACK_IMPORTED_MODULE_4__.Field, {
                                                            type: "checkbox",
                                                            name: "terms"
                                                        }),
                                                        /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", {
                                                            htmlFor: "terms",
                                                            children: [
                                                                "I have read and accepted the",
                                                                " ",
                                                                /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_link__WEBPACK_IMPORTED_MODULE_2___default()), {
                                                                    href: "/terms-and-conditions",
                                                                    children: "Terms and Conditions"
                                                                }),
                                                                " ",
                                                                "and ",
                                                                /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_link__WEBPACK_IMPORTED_MODULE_2___default()), {
                                                                    href: "/privacy-policy",
                                                                    children: "Privacy Policy"
                                                                }),
                                                                "."
                                                            ]
                                                        })
                                                    ]
                                                }),
                                                /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(formik__WEBPACK_IMPORTED_MODULE_4__.ErrorMessage, {
                                                    name: "terms",
                                                    children: (msg)=>/*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                                                            className: "error-msg",
                                                            children: msg
                                                        })
                                                }),
                                                msg ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("p", {
                                                    className: "success-msg",
                                                    children: "Thank you for contacting us!"
                                                }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
                                                    children: [
                                                        /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", {
                                                            type: "submit",
                                                            disabled: isSubmitting || isValidating,
                                                            className: "disabled-btn",
                                                            children: [
                                                                /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                                                                    className: "arrowsDiv",
                                                                    children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_Icons__WEBPACK_IMPORTED_MODULE_7__/* .ArrowsRightWhite */ .sN, {})
                                                                }),
                                                                "Submit Your Message"
                                                            ]
                                                        }),
                                                        errMsg && /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("p", {
                                                            className: "error-msg",
                                                            children: "Something went wrong, please try again"
                                                        })
                                                    ]
                                                }),
                                                /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", {
                                                    className: "email-text",
                                                    children: [
                                                        "Or send us and email to:",
                                                        " ",
                                                        /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("a", {
                                                            href: "mailto:" + footer?.socials?.email,
                                                            children: `${footer?.socials?.email}`
                                                        })
                                                    ]
                                                })
                                            ]
                                        })
                                    ]
                                })
                            })
                    }),
                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                        className: "newsletter",
                        children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_link__WEBPACK_IMPORTED_MODULE_2___default()), {
                            href: contact?.location_url ? contact?.location_url : "/",
                            passHref: true,
                            children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("a", {
                                target: "_blank",
                                rel: "noopener noreferrer",
                                children: [
                                    /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("span", {
                                        className: "newsletterLink",
                                        children: "Click on the image for Google maps location."
                                    }),
                                    contact?.location_image ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_image__WEBPACK_IMPORTED_MODULE_3___default()), {
                                        src: `${contact?.location_image}`,
                                        width: 736,
                                        height: 770,
                                        objectFit: "cover",
                                        objectPosition: "right"
                                    }) : ""
                                ]
                            })
                        })
                    })
                ]
            }),
            /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                className: "footer",
                children: [
                    /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("a", {
                        href: "https://digitalpresent.io/",
                        target: "_blank",
                        rel: "noopener noreferrer",
                        "aria-label": "developed by Digital Present",
                        className: "developed",
                        children: [
                            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("p", {
                                className: "developed__p",
                                children: "Developed by"
                            }),
                            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_Icons__WEBPACK_IMPORTED_MODULE_7__/* .DPLogo */ .V7, {
                                color: "#fff"
                            })
                        ]
                    }),
                    /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", {
                        children: [
                            "Copyright ",
                            new Date().getFullYear(),
                            " ATV. All rights reserved."
                        ]
                    }),
                    footer?.footer?.slice(0, 1).map((links, index)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                            className: "legal",
                            children: [
                                /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("p", {
                                    onClick: ()=>{
                                        setLegalModal(true);
                                        hideScroll();
                                    },
                                    children: links?.title
                                }),
                                /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                                    className: "legal-modal",
                                    style: {
                                        display: legalModal ? "flex" : "none"
                                    },
                                    children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                                        className: "legal-modal-content",
                                        children: [
                                            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("button", {
                                                onClick: (e)=>{
                                                    setLegalModal(false);
                                                    showScroll();
                                                },
                                                children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_Icons__WEBPACK_IMPORTED_MODULE_7__/* .CloseIcon */ .Tw, {})
                                            }),
                                            /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("p", {
                                                children: (0,html_react_parser__WEBPACK_IMPORTED_MODULE_6__["default"])(footer?.legal)
                                            })
                                        ]
                                    })
                                })
                            ]
                        }, index)),
                    footer?.footer?.slice(1).map((links, index)=>/*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
                            className: "terms",
                            children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((next_link__WEBPACK_IMPORTED_MODULE_2___default()), {
                                href: `/${links.slug}`,
                                children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("p", {
                                    children: links.title
                                })
                            })
                        }, index)),
                    /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
                        className: "icons",
                        children: [
                            `${footer?.socials?.tw}` ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("a", {
                                href: `${footer?.socials?.tw}`,
                                target: "_blank",
                                rel: "noreferrer",
                                children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_Icons__WEBPACK_IMPORTED_MODULE_7__/* .TwitterIcon */ .Zm, {})
                            }) : "",
                            `${footer?.socials?.in}` ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("a", {
                                href: `${footer?.socials?.in}`,
                                target: "_blank",
                                rel: "noreferrer",
                                children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_Icons__WEBPACK_IMPORTED_MODULE_7__/* .InstaIcon */ .kd, {})
                            }) : "",
                            `${footer?.socials?.fb}` ? /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("a", {
                                href: `${footer?.socials?.fb}`,
                                target: "_blank",
                                rel: "noreferrer",
                                children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_Icons__WEBPACK_IMPORTED_MODULE_7__/* .FbIcon */ .BM, {})
                            }) : ""
                        ]
                    })
                ]
            })
        ]
    });
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Contact);

__webpack_async_result__();
} catch(e) { __webpack_async_result__(e); } });

/***/ })

};
;

Zerion Mini Shell 1.0