PageSourceSearch

https://gmobile.mn/_next/static/chunks/pages/checkout/post-748491e9909c4fbc.js

js gmobile.mn collected 2026-10-04 22:53:26 UTC 12,176 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1066],{5033:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/checkout/post",function(){return r(7628)}])},8878:function(e,t,r){"use strict";var n=r(5893),s=(r(7294),r(1163));t.Z=function(e){var t=e.patharray,r=t.pathName,a=t.routeTo,o=(0,s.useRouter)();return(0,n.jsx)(n.Fragment,{children:(0,n.jsx)("div",{className:"bg-gray-100",children:(0,n.jsx)("div",{className:"container mx-auto max-w-screen-lg px-3 py-3 md:px-3 xl:px-0",children:(0,n.jsx)("ol",{className:"flex flex-wrap md:inline-flex lg:inline-flex xl:inline-flex list-none",children:r.map((function(e,t){var s=t;return t===r.length-1?(0,n.jsx)("li",{children:(0,n.jsx)("div",{id:e,className:"text-sm font-rubik text-gray-400 cursor-pointer",children:e})},e):(0,n.jsxs)("li",{className:"flex items-center text-gray-500",children:[(0,n.jsx)("div",{id:r,onClick:function(){return o.push(a[s])},className:"text-sm font-rubik text-gray-800 hover:text-gray-500 cursor-pointer",children:e}),(0,n.jsx)("svg",{className:"mx-3 h-3 w-3 fill-current",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512",children:(0,n.jsx)("path",{d:"M285.476 272.971L91.132 467.314c-9.373 9.373-24.569 9.373-33.941 0l-22.667-22.667c-9.357-9.357-9.375-24.522-.04-33.901L188.505 256 34.484 101.255c-9.335-9.379-9.317-24.544.04-33.901l22.667-22.667c9.373-9.373 24.569-9.373 33.941 0L285.475 239.03c9.373 9.372 9.373 24.568.001 33.941z"})})]},e)}))})})})})}},1119:function(e,t,r){"use strict";r(5893),r(7294)},8502:function(e,t,r){"use strict";var n=r(7568),s=r(6042),a=r(9396),o=r(414),i=r(196),c=r(1955),u=i.ZP.create({baseURL:"https://api.gmobile.mn/plugins/api/",withCredentials:!0,headers:{"Content-Type":"application/json",Accept:"application/json"}});u.defaults.timeout=6e4,u.interceptors.request.use((function(e){e.params=(0,a.Z)((0,s.Z)({},e.params),{timestamp:Date.now()});var t=c.Z.get("_hjSessionUser");return t?(t=t.trim().replace(/^"(.*)"$/,"$1"),e.headers=(0,a.Z)((0,s.Z)({},e.headers),{authorization:"Bearer ".concat(t)})):e.headers=(0,a.Z)((0,s.Z)({},e.headers),{authorization:"Bearer ".concat(c.Z.get("_hjSession"))}),e}),(function(e){return Promise.reject(e)}));var l=function(){var e=(0,n.Z)((function(){var e;return(0,o.__generator)(this,(function(t){return e={channel:"Website",username:"[email protected]",password:"H^89**dkfj:))"},[2,i.ZP.post("https://api.gmobile.mn/plugins/api/user/webtoken",e)]}))}));return function(){return e.apply(this,arguments)}}(),m=function(){var e=(0,n.Z)((function(e){var t;return(0,o.__generator)(this,(function(r){switch(r.label){case 0:return t={phoneNumber:e},[4,i.ZP.post("https://api.gmobile.mn/plugins/api/user out",t).then((function(e){"successful"===e.data.status&&(c.Z.remove("user"),c.Z.remove("_hjSessionUser"),c.Z.remove("refreshToken"),localStorage.removeItem("_octo"),localStorage.removeItem("_pPcheck"),c.Z.remove("_null"))})).catch((function(e){}))];case 1:return r.sent(),[2]}}))}));return function(t){return e.apply(this,arguments)}}(),p=null;u.interceptors.response.use(function(){var e=(0,n.Z)((function(e){var t,r,n,s,a,d,f,h;return(0,o.__generator)(this,(function(o){switch(o.label){case 0:if(t=e.config,r=c.Z.get("refreshToken"),n=c.Z.get("_hjSessionUser"),s=c.Z.get("user"),!r)return[3,7];if("Access token expired"!==e.data.error)return[3,5];if(t._retry)return[3,4];t._retry=!0,o.label=1;case 1:return o.trys.push([1,3,,4]),p=p||function(e){var t={token:e};return i.ZP.post("https://api.gmobile.mn/plugins/api/token/refresh",t)}(r),[4,p];case 2:return a=o.sent(),p=null,a.data.info.accessToken&&(c.Z.set("_hjSessionUser",a.data.info.accessToken),c.Z.remove("refreshToken")),[2,u(t)];case 3:return d=o.sent(),[2,Promise.reject(d)];case 4:return[3,6];case 5:"Invalid token"!==e.data.error&&"Not found token"!==e.data.error||m(s),o.label=6;case 6:return[3,11];case 7:if("Invalid token"!==e.data.error&&"Access token expired"!==e.data.error&&"Not found token"!==e.data.error)return[3,11];if(n&&m(s),t._retry)return[3,11];t._retry=!0,o.label=8;case 8:return o.trys.push([8,10,,11]),[4,p=p||l()];case 9:return f=o.sent(),p=null,f.data.info.token.accessToken&&c.Z.set("_hjSession",f.data.info.token.accessToken,{expires:new Date(Date.now()+288e5),sameSite:"Lax"}),[2,u(t)];case 10:return h=o.sent(),[2,Promise.reject(h)];case 11:return[2,e]}}))}));return function(t){return e.apply(this,arguments)}}(),(function(e){return Promise.reject(e)})),t.Z=u},7612:function(e,t,r){"use strict";var n=r(1955);t.Z=function(e,t){n.Z.set(e,JSON.stringify(t),{expires:new Date(Date.now()+12e5),sameSite:"Lax",path:"/"})}},7628:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return b}});var n=r(4924),s=r(6042),a=r(9396),o=r(828),i=r(5893),c=r(7294),u=r(8878),l=r(8362),m=(r(1119),[{pathName:["\u0422\u04e9\u043b\u0431\u04e9\u0440 \u0442\u04e9\u043b\u04e9\u0445","\u0414\u0443\u0433\u0430\u0430\u0440 \u043e\u0440\u0443\u0443\u043b\u0430\u0445"],routeTo:["/"]}
1]),p=function(e){var t=e.buttonData,r=e.onClick,n=e.onChangePrice,s=e.onChangeNumber,a=e.isLoading,o=e.priceTotal,c=e.number,p=e.errors,d=e.data;return(0,i.jsxs)(l.Z,{children:[(0,i.jsx)(u.Z,{patharray:m[0]}),(0,i.jsx)("div",{className:"bg-gray-100",children:(0,i.jsxs)("div",{className:"container mx-auto mt-10 mb-10 max-w-screen-lg px-3 md:px-3 xl:px-0",children:[(0,i.jsx)("div",{className:"font-rubik text-2xl font-medium text-gray-900 md:text-3xl lg:text-4xl",children:"\u0422\u04e9\u043b\u0431\u04e9\u0440 \u0442\u04e9\u043b\u04e9\u0445 \u0443\u0442\u0430\u0441\u043d\u044b \u0434\u0443\u0433\u0430\u0430\u0440"}),(0,i.jsx)("div",{children:(0,i.jsxs)("div",{className:"relative mt-6 block md:inline-block",children:[(0,i.jsx)("div",{className:"pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3",children:(0,i.jsx)("h1",{className:"font-rubik text-lg text-black",children:"+976"})}),(0,i.jsx)("input",{maxLength:8,type:"tel",name:"numberformat",value:c,className:"h-14 w-72 pl-14 bg-white rounded-xl font-rubik text-lg p-2 mr-4 border-2 focus:outline-none focus:border-[#F9A825] appearance-none",placeholder:"\u0413\u0430\u0440 \u0443\u0442\u0430\u0441\u043d\u044b \u0434\u0443\u0433\u0430\u0430\u0440",onChange:s})]})}),(0,i.jsxs)("div",{className:"relative mt-4 block md:inline-block",children:[(0,i.jsx)("div",{className:"pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3",children:(0,i.jsx)("h1",{className:"font-rubik text-lg text-black",children:"\u20ae"})}),(0,i.jsx)("input",{maxLength:10,type:"tel",name:"amount",value:o,className:"h-14 w-72 pl-7 bg-white rounded-xl font-rubik text-lg p-2 mr-4 border-2 focus:outline-none focus:border-[#F9A825] appearance-none",placeholder:"\u0422\u04e9\u043b\u0431\u04e9\u0440 \u0442\u04e9\u043b\u04e9\u0445 \u0434\u04af\u043d",onChange:n,disabled:a||p||8!==c.length})]}),(0,i.jsxs)("button",{className:"mt-4 block h-14 w-72 rounded-xl bg-[#F9A825] px-14 py-2 font-rubik text-lg font-normal text-white hover:bg-yellow-400 md:mt-0 md:ml-5 md:inline-block disabled:cursor-not-allowed",onClick:r,disabled:!o||!c||a,children:[a&&(0,i.jsxs)("svg",{className:"inline mr-3 h-5 w-5 animate-spin text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[(0,i.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,i.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),a&&(0,i.jsx)("span",{children:"\u0423\u043d\u0448\u0438\u0436 \u0431\u0430\u0439\u043d\u0430..."}),!a&&(0,i.jsx)("span",{children:t})]})]})}),(0,i.jsx)("span",{className:"container mx-auto mt-10 mb-10 max-w-screen-lg px-3 md:px-3 xl:px-0 font-rubik",dangerouslySetInnerHTML:{__html:d}})]})},d=r(8502),f=r(8739),h=r(7612),g=r(1163),x=r(4547);var b=function(){var e=(0,o.Z)(c.useState({numberformat:"",product_id:"",amount:"",quantity:"1",customer_type:"user",channel:"Website"}),2),t=e[0],r=e[1],u=(0,o.Z)(c.useState(""),2),l=u[0],m=u[1],b=(0,o.Z)(c.useState(""),2),v=b[0],y=b[1],w=(0,o.Z)(c.useState(""),2),j=w[0],k=w[1],Z=(0,o.Z)(c.useState(!1),2),N=Z[0],_=Z[1],P=c.useContext(x.Z).notificationHandler,O=(0,f.Z)("user"),S=(0,g.useRouter)(),C=function(e){var r={websessionId:e,channel:"Website"};d.Z.post("websession/get",r).then((function(r){"successful"===r.data.status?"post"===r.data.info.slug?T(e,t.numberformat,j):S.push("/"):(_(!1),0===r.data.message.show?P({type:"errors",message:"\u0410\u043c\u0436\u0438\u043b\u0442\u0433\u04af\u0439"}):P({type:"errors",message:r.data.message.text}))})).catch((function(e){_(!1),P({type:"errors",message:"\u0410\u043c\u0436\u0438\u043b\u0442\u0433\u04af\u0439!"}),y("\u0410\u043c\u0436\u0438\u043b\u0442\u0433\u04af\u0439!")}))};c.useEffect((function(){d.Z.post("extraservice/servicedetail",{slug:"post_description"}).then((function(e){var t;"successful"===e.data.status?m(null===(t=e.data.info[0])||void 0===t?void 0:t.body):0===e.data.message.show?P({type:"errors",message:"\u0410\u043c\u0436\u0438\u043b\u0442\u0433\u04af\u0439"}):P({type:"errors",message:e.data.message.text})})).catch((function(e){P({type:"errors",message:"\u0410\u043c\u0436\u0438\u043b\u0442\u0433\u04af\u0439!"})}))}),[]),c.useEffect((function(){8===t.numberformat.length?I():(y(""),k(""))}),[t.numberformat]);var T=function(e,t,r){var n={websession_id:e,serviceId:"",packageId:"",productId:"",phoneNumber:t,simType:"",shippingType:"",shippingAddress:"",userId:"",orderId:"",amount:r,jsonList:{},email:"",channel:"Website"};d.Z.post("websession/update",n).then((function(e){"successful"===e.data.status?S.push("/checkout/service/check"):(_(!1),0===e.data.message.show?P({type:"errors",message:"\u0410\u043c\u0436\u0438\u043b\u0442\u0433\u04af\u0439"}):P({type:"errors",message:e.data.message.text}))})).catch((function(e){_(!1),P({type:"errors",message:"\u0410\u043c\u0436\u0438\u043b\u0442\u0433\u04af\u0439!"}),y("\u0410\u043c\u0436\u0438\u043b\u0442\u0433\u04af\u0439!")}))},I=function(){var e={phoneNumber:t.numberformat,keyword:"post",channel:t.channel};_(!0),d.Z.post("product/info",e).then((function(e){if("successful"===e.data.status){var r=e.data.info.products.map((function(e){return e.data[0]})).map((function(e){return e.price}));O===t.numberformat?"0"===r[0]?k(""):k(r[0]):k("")}else 0===e.data.message.show?(P({type:"errors",message:"\u0410\u043c\u0436\u0438\u043b\u0442\u0433\u04af\u0439"}),y(e.data.error)):(P({type:"errors",message:e.data.message.text}),y(e.data.message.text));_(!1)})).catch((function(e){_(!1),P({type:"errors",message:"\u0410\u043c\u0436\u0438\u043b\u0442\u0433\u04af\u0439!"}),y("\u0410\u043c\u0436\u0438\u043b\u0442\u0433\u04af\u0439!")}))};return(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(p,{buttonData:"\u04ae\u0440\u0433\u044d\u043b\u0436\u043b\u04af\u04af\u043b\u044d\u0445",onClick:function(){_(!0),d.Z.post("websession/register",{slug:"post"}).then((function(e){"successful"===e.data.status?((0,h.Z)("sessionId",e.data.info),C(e.data.info)):(_(!1),e.data.message.show,P({type:"errors",message:"\u0410\u043c\u0436\u0438\u043b\u0442\u0433\u04af\u0439"}))})).catch((function(e){_(!1),P({type:"errors",message:"\u0410\u043c\u0436\u0438\u043b\u0442\u0433\u04af\u0439!"}),y("\u0410\u043c\u0436\u0438\u043b\u0442\u0433\u04af\u0439!")}))},onChangeNumber:function(e){r((0,a.Z)((0,s.Z)({},t),(0,n.Z)({},e.target.name,e.target.value.replace(/[^0-9]/g,""))))},onChangePrice:function(e){var t=e.target.value;/^\d{0,8}(\.\d{0,2})?$/.test(t)&&k(t)},isLoading:N,priceTotal:j,number:t.numberformat,errors:v,data:l})})}},9396:function(e,t,r){"use strict";function n(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}
1(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})),e}r.d(t,{Z:function(){return n}})}},function(e){e.O(0,[9774,2888,179],(function(){return t=5033,e(e.s=t);var t}));var t=e.O();_N_E=t}]);

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.