(function() { var exports = {}; exports.id = 5891; exports.ids = [5891]; exports.modules = { /***/ 3920: /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; var _apollo = _interopRequireDefault(__webpack_require__(6371)); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } async function GetSparepartYGP(token = "") { var res = await _apollo.default.query(` query{ ygParts{ id name img{ url } price1 price2 ygp_units{ name part_code price } } } `, token); return res; } async function GetSparepartYamalube(token = "") { var res = await _apollo.default.query(` query { yamalubes { id name part_code price description stock img{ url } } } `, token); return res; } async function GetHelmet(token = "") { var res = await _apollo.default.query(` query { helmets{ id name price img { url } } }`, token); return res; } async function GetApparel(token = "") { var res = await _apollo.default.query(` query { apparels{ id name price img { url } } }`, token); return res; } async function GetAcc(token = "") { var res = await _apollo.default.query(` query { accessories{ id name price img { url } } }`, token); return res; } async function GetYGPDetail(id, token = "") { var res = await _apollo.default.query(` query($input: ID!){ ygParts(where:{id:$input}) { id name img{ url } description price1 price2 ygp_units{ name part_code price description } } } `, token, { "input": id }); return res; } async function GetYamalubeDetail(id, token = "") { var res = await _apollo.default.query(` query($input: ID!){ yamalubes(where:{id:$input}) { id name description price part_code img { url } stock } } `, token, { "input": id }); return res; } async function GetHelmetDetail(id, token = "") { var res = await _apollo.default.query(` query($input: ID!){ helmets(where:{id:$input}) { id name description price part_code img { url } stock } } `, token, { "input": id }); return res; } async function GetApparelDetail(id, token = "") { var res = await _apollo.default.query(` query($input: ID!){ apparels(where:{id:$input}) { id name description price part_code img { url } stock } } `, token, { "input": id }); return res; } async function GetAccDetail(id, token = "") { var res = await _apollo.default.query(` query($input: ID!){ accessories(where:{id:$input}) { id name description price part_code img { url } stock } } `, token, { "input": id }); return res; } module.exports = { //collection type YGP GetSparepartYGP: GetSparepartYGP, GetSparepartYamalube: GetSparepartYamalube, GetHelmet: GetHelmet, GetApparel: GetApparel, GetAcc: GetAcc, //Detail GetYGPDetail: GetYGPDetail, GetYamalubeDetail: GetYamalubeDetail, GetHelmetDetail: GetHelmetDetail, GetApparelDetail: GetApparelDetail, GetAccDetail: GetAccDetail }; /***/ }), /***/ 9280: /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { "default": function() { return /* binding */ Product_Sparepart; }, "getServerSideProps": function() { return /* binding */ getServerSideProps; } }); // EXTERNAL MODULE: external "react/jsx-runtime" var jsx_runtime_ = __webpack_require__(5282); // EXTERNAL MODULE: external "react" var external_react_ = __webpack_require__(9297); // EXTERNAL MODULE: ./components/_App/NavbarYamaha.js var NavbarYamaha = __webpack_require__(2478); // EXTERNAL MODULE: ./components/_App/FooterYamaha.js var FooterYamaha = __webpack_require__(362); // EXTERNAL MODULE: ./components/Common/PageBanner.js var PageBanner = __webpack_require__(1288); // EXTERNAL MODULE: ./node_modules/next/link.js var next_link = __webpack_require__(1664); // EXTERNAL MODULE: external "react-feather" var external_react_feather_ = __webpack_require__(9337); // EXTERNAL MODULE: external "react-redux" var external_react_redux_ = __webpack_require__(79); // EXTERNAL MODULE: ./components/Shop/AddToCartBtn.js var AddToCartBtn = __webpack_require__(2337); // EXTERNAL MODULE: external "react-number-format" var external_react_number_format_ = __webpack_require__(3230); var external_react_number_format_default = /*#__PURE__*/__webpack_require__.n(external_react_number_format_); ;// CONCATENATED MODULE: ./components/Yamaha/Product/Sparepart.js function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } const ProductCard = function (_ref) { let { ygp, yamalube, helmet, apparel, accessories, backend } = _ref, props = _objectWithoutProperties(_ref, ["ygp", "yamalube", "helmet", "apparel", "accessories", "backend"]); const products = (0,external_react_redux_.useSelector)(state => state.products); console.log(ygp); const Product = ygp.map(data => { return /*#__PURE__*/jsx_runtime_.jsx("div", { className: "col-lg-3 col-md-6 col-sm-6", children: /*#__PURE__*/(0,jsx_runtime_.jsxs)("div", { className: "single-products", children: [/*#__PURE__*/(0,jsx_runtime_.jsxs)("div", { className: "products-image", children: [/*#__PURE__*/jsx_runtime_.jsx("img", { src: `${backend}${data.img["url"]}` }), /*#__PURE__*/(0,jsx_runtime_.jsxs)("ul", { children: [/*#__PURE__*/jsx_runtime_.jsx("li", { children: /*#__PURE__*/jsx_runtime_.jsx("a", { href: "#", children: /*#__PURE__*/jsx_runtime_.jsx(external_react_feather_.Search, {}) }) }), /*#__PURE__*/jsx_runtime_.jsx("li", { children: /*#__PURE__*/jsx_runtime_.jsx("a", { href: "#", children: /*#__PURE__*/jsx_runtime_.jsx(external_react_feather_.Heart, {}) }) }), /*#__PURE__*/jsx_runtime_.jsx("li", { children: /*#__PURE__*/jsx_runtime_.jsx(next_link.default, { href: "/products/[id]", as: `/products/${ygp.id}`, children: /*#__PURE__*/jsx_runtime_.jsx("a", { children: /*#__PURE__*/jsx_runtime_.jsx(external_react_feather_.Link, {}) }) }) })] })] }), /*#__PURE__*/(0,jsx_runtime_.jsxs)("div", { className: "products-content", children: [/*#__PURE__*/jsx_runtime_.jsx("h3", { children: /*#__PURE__*/jsx_runtime_.jsx(next_link.default, { href: "/yamaha/Product/Motor_Detail?s=" + data.id, children: /*#__PURE__*/jsx_runtime_.jsx("a", { children: data.name }) }) }), /*#__PURE__*/jsx_runtime_.jsx("span", { children: /*#__PURE__*/jsx_runtime_.jsx((external_react_number_format_default()), { value: data.price2, displayType: 'text', thousandSeparator: true, prefix: 'Rp.' }) }), /*#__PURE__*/(0,jsx_runtime_.jsxs)("ul", { children: [/*#__PURE__*/jsx_runtime_.jsx("li", { children: /*#__PURE__*/jsx_runtime_.jsx("i", { className: "flaticon-star-1" }) }), /*#__PURE__*/jsx_runtime_.jsx("li", { children: /*#__PURE__*/jsx_runtime_.jsx("i", { className: "flaticon-star-1" }) }), /*#__PURE__*/jsx_runtime_.jsx("li", { children: /*#__PURE__*/jsx_runtime_.jsx("i", { className: "flaticon-star-1" }) }), /*#__PURE__*/jsx_runtime_.jsx("li", { children: /*#__PURE__*/jsx_runtime_.jsx("i", { className: "flaticon-star-1" }) }), /*#__PURE__*/jsx_runtime_.jsx("li", { children: /*#__PURE__*/jsx_runtime_.jsx("i", { className: "flaticon-star-1" }) })] }), /*#__PURE__*/jsx_runtime_.jsx(AddToCartBtn/* default */.Z, _objectSpread({}, ygp))] })] }) }, ygp.id); }); return /*#__PURE__*/jsx_runtime_.jsx("div", { className: "shop-area ptb-80", children: /*#__PURE__*/(0,jsx_runtime_.jsxs)("div", { className: "container", children: [/*#__PURE__*/jsx_runtime_.jsx("div", { className: "woocommerce-topbar", children: /*#__PURE__*/(0,jsx_runtime_.jsxs)("div", { className: "row align-items-center", children: [/*#__PURE__*/jsx_runtime_.jsx("div", { className: "col-lg-9 col-md-7 col-sm-7", children: /*#__PURE__*/jsx_runtime_.jsx("div", { className: "woocommerce-result-count", children: /*#__PURE__*/jsx_runtime_.jsx("p", { children: "Showing 1-8 of 14 results" }) }) }), /*#__PURE__*/jsx_runtime_.jsx("div", { className: "col-lg-3 col-md-5 col-sm-5", children: /*#__PURE__*/jsx_runtime_.jsx("div", { className: "woocommerce-topbar-ordering", children: /*#__PURE__*/(0,jsx_runtime_.jsxs)("select", { className: "form-select", children: [/*#__PURE__*/jsx_runtime_.jsx("option", { value: "1", children: "Sort by Popularity" }), /*#__PURE__*/jsx_runtime_.jsx("option", { value: "2", children: "Sort by Average Rating" }), /*#__PURE__*/jsx_runtime_.jsx("option", { value: "3", children: "Sort by Latest" }), /*#__PURE__*/jsx_runtime_.jsx("option", { value: "4", children: "Sort by price: Low to High" }), /*#__PURE__*/jsx_runtime_.jsx("option", { value: "5", children: "Sort by price: High to Low" }), /*#__PURE__*/jsx_runtime_.jsx("option", { value: "6", children: "Sort by New" })] }) }) })] }) }), /*#__PURE__*/(0,jsx_runtime_.jsxs)("div", { className: "row justify-content-md-center", children: [Product, /*#__PURE__*/jsx_runtime_.jsx("div", { className: "col-lg-12 col-md-12 col-sm-12", children: /*#__PURE__*/jsx_runtime_.jsx("div", { className: "pagination-area", children: /*#__PURE__*/jsx_runtime_.jsx("nav", { "aria-label": "Page navigation", children: /*#__PURE__*/(0,jsx_runtime_.jsxs)("ul", { className: "pagination justify-content-center", children: [/*#__PURE__*/jsx_runtime_.jsx("li", { className: "page-item", children: /*#__PURE__*/jsx_runtime_.jsx("a", { className: "page-link", href: "#", children: "Prev" }) }), /*#__PURE__*/jsx_runtime_.jsx("li", { className: "page-item active", children: /*#__PURE__*/jsx_runtime_.jsx("a", { className: "page-link", href: "#", children: "1" }) }), /*#__PURE__*/jsx_runtime_.jsx("li", { className: "page-item", children: /*#__PURE__*/jsx_runtime_.jsx("a", { className: "page-link", href: "#", children: "2" }) }), /*#__PURE__*/jsx_runtime_.jsx("li", { className: "page-item", children: /*#__PURE__*/jsx_runtime_.jsx("a", { className: "page-link", href: "#", children: "3" }) }), /*#__PURE__*/jsx_runtime_.jsx("li", { className: "page-item", children: /*#__PURE__*/jsx_runtime_.jsx("a", { className: "page-link", href: "#", children: "Next" }) })] }) }) }) })] })] }) }); }; /* harmony default export */ var Sparepart = (ProductCard); // EXTERNAL MODULE: ./api/sparepart/sparepart.js var sparepart = __webpack_require__(3920); var sparepart_default = /*#__PURE__*/__webpack_require__.n(sparepart); // EXTERNAL MODULE: external "cookies" var external_cookies_ = __webpack_require__(9038); ;// CONCATENATED MODULE: ./pages/yamaha/Product/Sparepart.js function Sparepart_objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = Sparepart_objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } function Sparepart_objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } const Shop = function (_ref) { let { ygp, yamalube, helmet, apparel, accessories, backend } = _ref, props = Sparepart_objectWithoutProperties(_ref, ["ygp", "yamalube", "helmet", "apparel", "accessories", "backend"]); return /*#__PURE__*/(0,jsx_runtime_.jsxs)(jsx_runtime_.Fragment, { children: [/*#__PURE__*/jsx_runtime_.jsx(NavbarYamaha/* default */.Z, {}), /*#__PURE__*/jsx_runtime_.jsx(PageBanner/* default */.Z, { pageTitle: "Sparepart" }), /*#__PURE__*/jsx_runtime_.jsx(Sparepart, { ygp: ygp, yamalube: yamalube, helmet: helmet, apparel: apparel, accessories: accessories, backend: backend }), /*#__PURE__*/jsx_runtime_.jsx(FooterYamaha/* default */.Z, {})] }); }; /* harmony default export */ var Product_Sparepart = (Shop); async function getServerSideProps(context) { var ygp = []; var yamalube = []; var helmet = []; var apparel = []; var accessories = []; const backend = process.env.BACKEND_SERVER_URI; var res = await sparepart_default().GetSparepartYGP(); if (res["STATUS"] === 1) { ygp = res["DATA"]["ygParts"]; } var res = await sparepart_default().GetSparepartYamalube(); if (res["STATUS"] === 1) { yamalube = res["DATA"]["yamalubes"]; } var res = await sparepart_default().GetHelmet(); if (res["STATUS"] === 1) { helmet = res["DATA"]["helmets"]; } var res = await sparepart_default().GetApparel(); if (res["STATUS"] === 1) { apparel = res["DATA"]["apparels"]; } var res = await sparepart_default().GetAcc(); if (res["STATUS"] === 1) { accessories = res["DATA"]["accessories"]; } return { props: { ygp, yamalube, helmet, apparel, accessories, backend } // will be passed to the page component as props }; } /***/ }), /***/ 8074: /***/ (function(module) { "use strict"; module.exports = require("@apollo/client");; /***/ }), /***/ 9038: /***/ (function(module) { "use strict"; module.exports = require("cookies");; /***/ }), /***/ 1683: /***/ (function(module) { "use strict"; module.exports = require("cross-fetch");; /***/ }), /***/ 8417: /***/ (function(module) { "use strict"; module.exports = require("next/dist/next-server/lib/router-context.js");; /***/ }), /***/ 2238: /***/ (function(module) { "use strict"; module.exports = require("next/dist/next-server/lib/router/utils/get-asset-path-from-route.js");; /***/ }), /***/ 6731: /***/ (function(module) { "use strict"; module.exports = require("next/router");; /***/ }), /***/ 9297: /***/ (function(module) { "use strict"; module.exports = require("react");; /***/ }), /***/ 9337: /***/ (function(module) { "use strict"; module.exports = require("react-feather");; /***/ }), /***/ 3230: /***/ (function(module) { "use strict"; module.exports = require("react-number-format");; /***/ }), /***/ 79: /***/ (function(module) { "use strict"; module.exports = require("react-redux");; /***/ }), /***/ 9614: /***/ (function(module) { "use strict"; module.exports = require("react-toast-notifications");; /***/ }), /***/ 5282: /***/ (function(module) { "use strict"; module.exports = require("react/jsx-runtime");; /***/ }) }; ; // load runtime var __webpack_require__ = require("../../../webpack-runtime.js"); __webpack_require__.C(exports); var __webpack_exec__ = function(moduleId) { return __webpack_require__(__webpack_require__.s = moduleId); } var __webpack_exports__ = __webpack_require__.X(0, [1664,4755,6371,7798,6120], function() { return __webpack_exec__(9280); }); module.exports = __webpack_exports__; })();