@ikas/storefront 4.5.0 → 4.5.1-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/components/checkout/components/epaykolay-button/index.d.ts +5 -0
- package/build/components/checkout/components/epaykolay-button/index.js +1 -0
- package/build/components/checkout/components/epaykolay-button/style.module.scss.js +1 -0
- package/build/components/checkout/components/svg/epaykolay.d.ts +6 -0
- package/build/components/checkout/components/svg/epaykolay.js +1 -0
- package/build/components/checkout/index.js +1 -1
- package/build/components/checkout/model.d.ts +2 -0
- package/build/components/checkout/model.js +1 -1
- package/build/components/checkout/style.module.scss.js +1 -1
- package/build/components/page/head.js +1 -1
- package/package.json +11 -11
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import*as e from"react";import a from"./style.module.scss.js";import l from"../svg/epaykolay.js";var t=function(t){return e.createElement("div",{className:a.Container},e.createElement("div",{className:a.Text},e.createElement("strong",null,"e-Pay Kolay")," ile ödeyerek adres ve kart bilgilerinizi girmeden alışverişlerinizi hızlı bir şekilde tamamlayın."),e.createElement("div",{className:a.EPayKolayButton,onClick:t.onClick},e.createElement("div",{className:a.Icon},e.createElement(l,null)),e.createElement("div",{className:a.ButtonText}," ile Öde")))};export{t as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import n from'./../../../../ext/style-inject/dist/style-inject.es.js';var e={Container:"style-module_Container__oDKWq",Text:"style-module_Text__Ps262",EPayKolayButton:"style-module_EPayKolayButton__c8OjL",ButtonText:"style-module_ButtonText__G12-2"};n(".style-module_Container__oDKWq {\n width: 100%;\n padding: 16px 24px;\n background-color: rgb(237, 238, 240);\n border-radius: 16px;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n.style-module_Container__oDKWq .style-module_Text__Ps262 {\n flex: 1 1 auto;\n}\n.style-module_Container__oDKWq .style-module_Text__Ps262 strong {\n font-weight: 500;\n}\n.style-module_Container__oDKWq .style-module_EPayKolayButton__c8OjL {\n flex: 0 0 auto;\n width: 230px;\n height: 50px;\n display: flex;\n justify-content: center;\n align-items: center;\n background-color: rgb(35, 154, 255);\n border-radius: 8px;\n cursor: pointer;\n transition: all 0.3s;\n margin-left: 24px;\n padding-top: 4px;\n}\n.style-module_Container__oDKWq .style-module_EPayKolayButton__c8OjL .style-module_ButtonText__G12-2 {\n color: white;\n margin-bottom: 2px;\n margin-left: 2px;\n font-weight: 500;\n}\n@media only screen and (max-width: 1440px) {\n .style-module_Container__oDKWq .style-module_EPayKolayButton__c8OjL {\n margin-left: 16px;\n }\n}\n@media only screen and (max-width: 1280px) {\n .style-module_Container__oDKWq {\n flex-direction: column;\n }\n .style-module_Container__oDKWq .style-module_EPayKolayButton__c8OjL {\n margin-left: 0;\n margin-top: 12px;\n }\n}\n@media only screen and (max-width: 1024px) {\n .style-module_Container__oDKWq {\n margin: 0 12px;\n width: calc(100% - 24px);\n margin-bottom: 24px;\n }\n}");export{e as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import*as C from"react";var e=function(e){return e.className,C.createElement("svg",{width:"101",height:"22",viewBox:"0 0 101 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},C.createElement("g",{"clip-path":"url(#clip0_6858_149691)"},C.createElement("path",{d:"M69.4952 15.4336C69.1677 15.4343 68.8462 15.3456 68.5654 15.1771C68.2846 15.0086 68.0553 14.7666 67.9022 14.4773L66.4754 11.7834H66.4305L65.9991 14.2371C65.9405 14.5697 65.7665 14.871 65.5076 15.0882C65.2488 15.3053 64.9216 15.4245 64.5836 15.4246H63.3613L65.179 5.0981C65.2377 4.76332 65.4128 4.45999 65.6734 4.24153C65.934 4.02306 66.2634 3.90346 66.6035 3.90381H67.8438L66.5923 10.9101H66.6395L68.9627 8.42728C69.1395 8.2449 69.3516 8.10031 69.586 8.00229C69.8205 7.90428 70.0724 7.85487 70.3265 7.85708H72.5913L68.929 11.3973L71.3219 15.4381L69.4952 15.4336Z",fill:"white"}),C.createElement("path",{d:"M75.2392 15.6469C74.7198 15.6528 74.2027 15.577 73.7069 15.4224C73.2597 15.2807 72.845 15.0518 72.4869 14.749C72.1326 14.4489 71.8496 14.0739 71.6584 13.6511C71.4672 13.2282 71.3726 12.7682 71.3814 12.3043C71.379 11.6911 71.4878 11.0827 71.7027 10.5083C71.907 9.95429 72.2202 9.44671 72.6239 9.01548C73.0363 8.58147 73.5313 8.23419 74.0799 7.99406C74.6913 7.73182 75.3513 7.60177 76.0166 7.61242C76.5434 7.60625 77.068 7.68198 77.5715 7.83691C78.0221 7.97474 78.4412 8.19976 78.805 8.49916C79.1499 8.787 79.4282 9.14623 79.6206 9.55201C79.8254 9.98702 79.9277 10.4632 79.9194 10.9439C79.9227 11.5629 79.8138 12.1774 79.5981 12.7577C79.3926 13.3126 79.0761 13.8198 78.6679 14.2483C78.2517 14.6828 77.7519 15.0287 77.1985 15.2653C76.5783 15.5248 75.9116 15.6547 75.2392 15.6469ZM77.5153 11.2245C77.5296 10.8034 77.3789 10.3934 77.0951 10.0818C76.9419 9.92667 76.757 9.80629 76.5531 9.72882C76.3492 9.65135 76.131 9.61861 75.9133 9.63283C75.6076 9.62927 75.3053 9.69691 75.0303 9.83038C74.7698 9.9581 74.54 10.1403 74.3562 10.3647C74.1696 10.5967 74.0251 10.8596 73.9293 11.1414C73.8278 11.4407 73.7769 11.7548 73.7788 12.0708C73.7641 12.4876 73.9115 12.8938 74.19 13.2045C74.3416 13.3593 74.5249 13.4795 74.7273 13.557C74.9297 13.6345 75.1465 13.6674 75.3628 13.6534C75.662 13.6599 75.9588 13.5988 76.2311 13.4748C76.5034 13.3508 76.7442 13.1671 76.9356 12.9373C77.1267 12.7081 77.2738 12.4455 77.3693 12.1628C77.4699 11.8604 77.5193 11.5432 77.5153 11.2245Z",fill:"white"}),C.createElement("path",{d:"M80.2129 15.4335L82.0104 5.23495C82.075 4.86552 82.2684 4.53085 82.5562 4.29011C82.844 4.04937 83.2078 3.91807 83.5832 3.91944H84.7313L82.6844 15.4335H80.2129Z",fill:"white"}),C.createElement("path",{d:"M91.6556 10.0727C91.6556 10.2142 91.6556 10.3668 91.6331 10.5217C91.6106 10.6766 91.5949 10.8427 91.5657 10.9954L91.0467 13.9497C90.9945 14.2162 90.9563 14.4852 90.9321 14.7556C90.919 14.9381 90.8375 15.1088 90.7037 15.2337C90.57 15.3586 90.3939 15.4284 90.2108 15.4291H88.7302C88.7302 15.3168 88.7302 15.1866 88.7459 15.0407C88.7616 14.8948 88.7706 14.7534 88.7908 14.6209H88.7504C88.1932 15.2809 87.421 15.6109 86.4339 15.6109C86.1591 15.6102 85.8853 15.5771 85.6183 15.5121C85.3457 15.4493 85.0873 15.3358 84.8566 15.1776C84.6247 15.0166 84.4345 14.8026 84.3017 14.5536C84.1468 14.2606 84.0695 13.9329 84.077 13.6017C84.051 13.0673 84.2096 12.5403 84.5263 12.1089C84.8436 11.7137 85.2555 11.4049 85.7239 11.2109C86.2588 10.9835 86.823 10.8324 87.4 10.7619C88.0244 10.6811 88.6533 10.6406 89.2829 10.6407C89.3006 10.5671 89.3104 10.4919 89.3121 10.4162V10.2793C89.3208 10.1594 89.2992 10.0392 89.2494 9.92975C89.1995 9.82032 89.123 9.72515 89.0268 9.65295C88.7604 9.50201 88.4562 9.43108 88.1505 9.44866C87.7931 9.45039 87.439 9.51734 87.1057 9.64621C86.9956 9.68662 86.881 9.73152 86.7867 9.78091C86.6007 9.87334 86.3879 9.89677 86.1863 9.84702C85.9846 9.79727 85.8072 9.67757 85.6857 9.50927C85.6119 9.40852 85.5607 9.29305 85.5356 9.17074C85.5105 9.04843 85.5121 8.92214 85.5402 8.80049C85.5683 8.67884 85.6224 8.56468 85.6987 8.46579C85.775 8.3669 85.8717 8.2856 85.9823 8.22744C86.2228 8.10568 86.4722 8.00213 86.7282 7.91764C87.2947 7.72384 87.8888 7.62301 88.4875 7.61907C88.9136 7.6156 89.3384 7.66461 89.7525 7.76499C90.1114 7.84958 90.4508 8.00198 90.7523 8.21397C91.0317 8.41353 91.2621 8.67371 91.4264 8.97499C91.5916 9.31663 91.6703 9.69359 91.6556 10.0727ZM88.9594 12.1134C88.6538 12.1134 88.3437 12.1268 88.0292 12.1515C87.7415 12.1714 87.4572 12.2249 87.1821 12.3109C86.9563 12.3794 86.7468 12.4932 86.5665 12.6454C86.4861 12.7151 86.4224 12.8019 86.38 12.8994C86.3377 12.9969 86.3177 13.1026 86.3216 13.2089C86.3069 13.3311 86.3287 13.4549 86.3843 13.5647C86.4399 13.6746 86.5267 13.7655 86.6339 13.8262C86.849 13.9347 87.0872 13.9894 87.3282 13.9856C87.7606 13.9989 88.1813 13.8435 88.501 13.5523C88.8116 13.2694 89.0208 12.8924 89.0964 12.4793L89.1728 12.1134H88.9594Z",fill:"white"}),C.createElement("path",{d:"M96.0294 16.5764C95.8048 16.9715 95.5801 17.3262 95.3666 17.6404C95.1664 17.9371 94.9251 18.2039 94.6499 18.4329C94.3838 18.6506 94.0789 18.8159 93.7511 18.92C93.371 19.0387 92.9742 19.0956 92.576 19.0884C92.457 19.0884 92.3514 19.0884 92.2323 19.0884C92.1156 19.0803 92.002 19.0476 91.8989 18.9925C91.7958 18.9373 91.7056 18.8611 91.634 18.7686C91.5625 18.6762 91.5114 18.5697 91.484 18.4561C91.4566 18.3425 91.4536 18.2245 91.4751 18.1096L91.5425 17.7415C91.5832 17.5461 91.6916 17.3714 91.8486 17.2482C92.0057 17.125 92.2012 17.0612 92.4008 17.068C92.7016 17.0864 92.9984 16.9911 93.2321 16.8008C93.4622 16.5816 93.6556 16.3269 93.8051 16.0466L94.1691 15.4225L92.4322 7.85718H93.6658C94.0653 7.85746 94.4515 8.00071 94.7545 8.26097C95.0574 8.52124 95.257 8.88131 95.3172 9.27595L95.8632 12.8229H95.8924L97.9438 8.78208C98.0823 8.505 98.2952 8.27181 98.5586 8.10851C98.822 7.9452 99.1256 7.85819 99.4356 7.85718H101.008L96.0294 16.5764Z",fill:"white"}),C.createElement("path",{d:"M26.2181 12.2953C26.2079 12.3402 26.2026 12.3861 26.2024 12.4322C26.199 12.6326 26.2494 12.8303 26.3484 13.0047C26.4444 13.1713 26.5737 13.3165 26.7281 13.4312C26.8903 13.5482 27.0711 13.637 27.2629 13.6939C27.4631 13.7552 27.6713 13.7862 27.8807 13.7859C28.2335 13.7902 28.5825 13.7134 28.9008 13.5614C28.9958 13.5158 29.088 13.4648 29.1772 13.4088C29.3452 13.2972 29.5441 13.2413 29.7458 13.249C29.9474 13.2566 30.1415 13.3274 30.3006 13.4514C30.425 13.5445 30.5246 13.6667 30.5907 13.8072C30.6568 13.9477 30.6875 14.1023 30.6799 14.2574C30.6724 14.4125 30.6269 14.5634 30.5475 14.6968C30.468 14.8303 30.357 14.9422 30.2242 15.0228C30.0279 15.137 29.8228 15.2354 29.6108 15.3169C28.9926 15.5492 28.3368 15.6656 27.6763 15.6604C27.1769 15.6643 26.6801 15.5886 26.2046 15.4359C25.7709 15.2992 25.3691 15.0771 25.0228 14.7826C24.6829 14.4869 24.4129 14.1197 24.2319 13.7073C24.0317 13.2465 23.9328 12.7482 23.942 12.2459C23.9321 11.6254 24.0419 11.0087 24.2656 10.4298C24.4835 9.88353 24.8047 9.38431 25.2115 8.95937C25.62 8.53809 26.11 8.20431 26.6517 7.97835C27.2358 7.73463 27.8635 7.61241 28.4964 7.61916C28.9604 7.61661 29.4215 7.69251 29.8602 7.84365C30.2518 7.97464 30.6127 8.18392 30.9207 8.45875C31.2205 8.73678 31.4546 9.07803 31.606 9.45773C31.7754 9.89404 31.8578 10.3592 31.8487 10.8271C31.8448 11.0591 31.8275 11.2908 31.797 11.5208C31.7673 11.7343 31.6618 11.93 31.4997 12.0722C31.3376 12.2144 31.1297 12.2936 30.914 12.2953H26.2181ZM29.6782 10.8024C29.689 10.753 29.6943 10.7026 29.6939 10.652V10.4994C29.699 10.3409 29.6696 10.1832 29.608 10.0372C29.5463 9.89109 29.4538 9.76005 29.3367 9.65304C29.0501 9.41216 28.6813 9.29148 28.3076 9.3163C28.0537 9.31222 27.8017 9.36195 27.5684 9.46222C27.3603 9.55122 27.1671 9.6716 26.9955 9.81916C26.8394 9.95515 26.7059 10.115 26.6 10.2928C26.5016 10.4481 26.426 10.6167 26.3754 10.7934L29.6782 10.8024Z",fill:"white"}),C.createElement("path",{d:"M32.2402 12.4321L32.5907 10.4993H36.4328L36.0958 12.4321H32.2402Z",fill:"white"}),C.createElement("path",{d:"M37.3267 19.0815C37.1517 19.0815 36.9787 19.0432 36.8201 18.9694C36.6614 18.8955 36.5208 18.7878 36.4082 18.6539C36.2956 18.52 36.2136 18.3631 36.1682 18.1942C36.1227 18.0253 36.1147 17.8485 36.1449 17.6762L37.6345 9.22643C37.7064 8.84142 37.9109 8.49369 38.2126 8.24356C38.5142 7.99344 38.894 7.85669 39.286 7.85704H40.1959L40.014 8.90765H40.0589C40.3414 8.52827 40.7093 8.22065 41.1329 8.00969C41.5707 7.79049 42.0542 7.67817 42.5439 7.68194C43.0048 7.67385 43.4628 7.75623 43.892 7.92439C44.2715 8.07517 44.6145 8.30472 44.8986 8.59786C45.1771 8.89616 45.3898 9.24947 45.5232 9.635C45.6682 10.0537 45.7404 10.494 45.7367 10.937C45.7402 11.5619 45.6345 12.1826 45.4243 12.7711C45.2292 13.3216 44.9319 13.8303 44.5481 14.2707C44.1712 14.6876 43.7153 15.0257 43.2067 15.2652C42.6815 15.5159 42.1059 15.6434 41.5238 15.6379C41.0228 15.65 40.5261 15.543 40.0746 15.3258C39.6923 15.1409 39.3739 14.8462 39.1602 14.4795H39.1287L38.5086 18.0938C38.4594 18.371 38.3139 18.6221 38.0978 18.8028C37.8816 18.9834 37.6086 19.0822 37.3267 19.0815ZM43.2898 11.2379C43.3004 10.8238 43.1598 10.4201 42.8944 10.1019C42.7486 9.94235 42.5686 9.81769 42.3679 9.73724C42.1671 9.65678 41.9508 9.6226 41.735 9.63724C41.4389 9.63516 41.1463 9.70284 40.8812 9.8348C40.6236 9.96687 40.3945 10.1484 40.2072 10.3691C40.0122 10.5991 39.86 10.8622 39.7578 11.1458C39.645 11.4426 39.5878 11.7577 39.5893 12.0752C39.5814 12.2854 39.615 12.4951 39.6882 12.6924C39.7615 12.8896 39.8729 13.0704 40.0162 13.2246C40.1694 13.3773 40.3529 13.4961 40.5549 13.5735C40.757 13.6508 40.973 13.6849 41.1891 13.6736C41.492 13.679 41.7921 13.6137 42.0653 13.4828C42.325 13.3608 42.555 13.1839 42.7394 12.9642C42.918 12.732 43.0534 12.4697 43.1393 12.1897C43.2416 11.8852 43.2925 11.5658 43.2898 11.2446V11.2379Z",fill:"white"}),C.createElement("path",{d:"M53.5333 10.0727C53.5333 10.2142 53.5333 10.3668 53.5108 10.5217C53.4884 10.6766 53.4726 10.8427 53.4434 10.9954L52.9244 13.9497C52.8722 14.2161 52.834 14.4851 52.8098 14.7556V14.7691C52.793 14.9487 52.7099 15.1156 52.5765 15.2373C52.4431 15.3589 52.2692 15.4265 52.0886 15.4268H50.6079C50.6079 15.3146 50.6079 15.1844 50.6236 15.0384C50.6394 14.8925 50.6484 14.7511 50.6686 14.6186H50.6371C50.0799 15.2786 49.3077 15.6086 48.3206 15.6086C48.0458 15.6082 47.772 15.5751 47.505 15.5099C47.2297 15.4502 46.9683 15.339 46.7344 15.1821C46.5021 15.0208 46.3111 14.807 46.1771 14.558C46.0272 14.2637 45.9538 13.9363 45.9637 13.6062C45.9377 13.0718 46.0963 12.5447 46.4131 12.1133C46.738 11.7187 47.1577 11.4128 47.6331 11.2244C48.1689 10.9973 48.7338 10.8461 49.3115 10.7754C49.9358 10.6946 50.5648 10.6541 51.1943 10.6542C51.2121 10.5806 51.2218 10.5053 51.2235 10.4297V10.2927C51.2309 10.1675 51.2053 10.0426 51.1493 9.93037C51.0933 9.81812 51.0089 9.72247 50.9045 9.65293C50.6382 9.502 50.3339 9.43107 50.0282 9.44865C49.6697 9.45225 49.3148 9.52149 48.9812 9.65293C48.8711 9.69334 48.7565 9.73824 48.6621 9.78763C48.4758 9.87976 48.2628 9.90302 48.0609 9.85331C47.8589 9.8036 47.6811 9.68411 47.5589 9.51599C47.4844 9.4148 47.4326 9.29868 47.4072 9.17562C47.3818 9.05255 47.3834 8.92545 47.4118 8.80304C47.4401 8.68063 47.4947 8.5658 47.5717 8.46645C47.6487 8.36709 47.7463 8.28555 47.8578 8.22742C48.6361 7.83814 49.4927 7.63014 50.363 7.61906C50.7891 7.61573 51.2139 7.66473 51.628 7.76497C51.9869 7.84957 52.3262 8.00197 52.6278 8.21395C52.9071 8.41352 53.1376 8.6737 53.3019 8.97497C53.4679 9.31642 53.5473 9.69339 53.5333 10.0727ZM50.8371 12.1133C50.5315 12.1133 50.2215 12.1268 49.9069 12.1515C49.6193 12.1712 49.3349 12.2247 49.0598 12.3109C48.8335 12.3798 48.6234 12.4936 48.442 12.6454C48.3623 12.7155 48.2992 12.8024 48.2572 12.8998C48.2152 12.9973 48.1955 13.1028 48.1993 13.2089C48.1846 13.3311 48.2064 13.4549 48.262 13.5647C48.3176 13.6746 48.4044 13.7655 48.5116 13.8262C48.7266 13.9349 48.9649 13.9896 49.2059 13.9856C49.6383 13.9989 50.059 13.8435 50.3787 13.5523C50.6894 13.2694 50.8985 12.8924 50.9741 12.4793L51.0483 12.1223L50.8371 12.1133Z",fill:"white"}),C.createElement("path",{d:"M57.9079 16.5764C57.6832 16.9715 57.4585 17.3262 57.2338 17.6405C57.0336 17.9371 56.7923 18.2039 56.5171 18.4329C56.251 18.6506 55.946 18.8159 55.6183 18.9201C55.2382 19.0388 54.8414 19.0956 54.4432 19.0884C54.3241 19.0884 54.2185 19.0884 54.0995 19.0884C53.9828 19.0803 53.8692 19.0476 53.7661 18.9925C53.663 18.9374 53.5727 18.8611 53.5012 18.7687C53.4297 18.6762 53.3786 18.5697 53.3512 18.4561C53.3238 18.3426 53.3208 18.2245 53.3423 18.1096L53.4029 17.7796C53.4398 17.5773 53.5466 17.3943 53.7047 17.2626C53.8628 17.1309 54.0621 17.0589 54.268 17.059C54.5688 17.0775 54.8656 16.9821 55.0993 16.7919C55.3293 16.5726 55.5228 16.318 55.6723 16.0376L56.0362 15.4135L54.3107 7.85719H55.2094C55.7047 7.85782 56.1834 8.03533 56.5591 8.35766C56.9349 8.67999 57.183 9.12592 57.2585 9.61495L57.7438 12.8139H57.7731L59.7121 8.97964C59.8872 8.64028 60.1528 8.35586 60.4795 8.15779C60.8062 7.95972 61.1813 7.85569 61.5635 7.85719H62.8801L57.9079 16.5764Z",fill:"white"}),C.createElement("path",{d:"M20.8507 3.52221L12.0206 0.235682H11.9959C11.0979 -0.0665352 10.126 -0.0704726 9.22556 0.224458H9.19635L0.4494 3.52221C0.33726 3.56559 0.238219 3.63714 0.161859 3.72995C0.0854988 3.82276 0.0344024 3.93369 0.0135124 4.05201C0.00446901 4.09558 -4.86163e-05 4.13996 3.13281e-05 4.18446V14.8275C-0.00332389 15.7178 0.2629 16.5883 0.76374 17.3247C1.26458 18.0611 1.97662 18.629 2.80634 18.9536L10.3827 21.9461C10.5479 22.0117 10.732 22.0117 10.8972 21.9461L14.3079 20.5789C14.4371 20.5277 14.5479 20.4389 14.626 20.3241C14.7042 20.2092 14.746 20.0735 14.746 19.9347V15.7457L18.496 14.2573C19.3257 13.9326 20.0378 13.3648 20.5386 12.6284C21.0395 11.892 21.3057 11.0215 21.3023 10.1312V4.22038C21.3034 4.20243 21.3034 4.18444 21.3023 4.1665C21.3003 4.02628 21.2561 3.8899 21.1756 3.77503C21.0951 3.66016 20.9819 3.57209 20.8507 3.52221Z",fill:"white"}),C.createElement("path",{d:"M20.6088 4.17323L10.662 8.11751L0.697266 4.17323L9.43748 0.879962C10.1964 0.630833 11.0152 0.630833 11.7742 0.879962L20.6088 4.17323Z",fill:"#51C5DA"}),C.createElement("path",{d:"M10.6523 8.11758V21.3064H10.6816L14.0518 19.9594V10.6139L18.1096 8.88309V10.7172L14.8292 12.1494V14.9713L18.2399 13.6108C18.9385 13.3352 19.5379 12.8559 19.9602 12.2354C20.3826 11.6148 20.6083 10.8817 20.6081 10.1313V4.18677L10.6523 8.11758Z",fill:"#EC008C"}),C.createElement("path",{d:"M3.92373 14.0487L10.653 16.8772V8.12212H10.6261L0.697269 4.18457V14.8276C0.69626 15.5779 0.921418 16.3112 1.34342 16.9318C1.76541 17.5524 2.36469 18.0317 3.06319 18.3072L10.6261 21.2929L10.653 21.3042V17.8089L3.9125 14.8905L3.92373 14.0487ZM3.92373 9.21988L7.92311 10.8811V12.8095L3.92149 11.0764L3.92373 9.21988Z",fill:"#004385"})),C.createElement("defs",null,C.createElement("clipPath",{id:"clip0_6858_149691"},C.createElement("rect",{width:"101",height:"22",fill:"white"}))))};export{e as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as e,__generator as t}from'./../../ext/tslib/tslib.es6.js';import*as o from"react";import{observer as i}from"mobx-react-lite";import{useRouter as r}from"next/router.js";import s from"next/link.js";import a from"react-tooltip";import l,{CheckoutStep as n}from"./model.js";import{IkasStorefrontConfig as c}from"@ikas/storefront-config";import{formatCurrency as m}from"../../utils/currency.js";import{useTranslation as d}from"../../utils/i18n.js";import p from"./steps/step-info/index.js";import{CheckoutStepShipping as u}from"./steps/step-shipping/index.js";import{CheckoutStepPayment as v}from"./steps/step-payment/index.js";import{CartSummary as h}from"./components/cart-summary/index.js";import"../../models/data/blog/category/index.js";import"../../models/data/blog/content/index.js";import"../../models/data/blog/meta-data/index.js";import"../../models/data/blog/tag/index.js";import"../../models/data/blog/index.js";import"../../models/data/brand/index.js";import{IkasThemeJsonPageType as g}from"@ikas/storefront-models";import"mobx";import"../../models/data/campaign-offer/index.js";import"../../models/data/cart/campaign-offer/index.js";import"../../models/data/cart/index.js";import"../../models/data/category/path-item/index.js";import"../../models/data/category/index.js";import"../../models/data/checkout/index.js";import"../../models/data/checkout-settings/index.js";import"../../models/data/city/index.js";import"../../models/data/country/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/address/ikas-localized-customer-address.js";import"../../models/data/customer/attribute/index.js";import"../../models/data/customer/review/summary/index.js";import"../../models/data/customer/review/index.js";import"../../models/data/customer/index.js";import"../../models/data/district/index.js";import"../../models/data/favorite-product/index.js";import"../../models/data/filter-category/index.js";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/order/address/index.js";import"../../models/data/order/line-item/option/value/index.js";import"../../models/data/order/line-item/variant/value/index.js";import"../../models/data/order/line-item/variant/index.js";import"../../models/data/order/line-item/index.js";import"../../models/data/order/package/index.js";import"../../models/data/order/transaction/index.js";import"../../models/data/order/index.js";import"../../models/data/payment-gateway/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product/filter/index.js";import"../../models/data/product/option-set/option/index.js";import"../../models/data/product/option-set/index.js";import"../../models/data/product/stock-location/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/index.js";import"../../models/data/raffle/index.js";import"../../models/data/state/index.js";import"../../models/data/theme-json/index.js";import"../../models/data/theme-json/custom-data/index.js";import"../../models/data/variant-type/variant-value/index.js";import"@ikas/localized-address";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-list/index.js";import"../../models/ui/product-attribute-detail/index.js";import"../../models/ui/product-attribute-list/index.js";import"../../models/ui/customer-review-list/index.js";import"../../models/ui/customer-review-summary-list/index.js";import"../../models/ui/validator/index.js";import"../../models/ui/validator/rules/index.js";import"../../models/ui/validator/form/login.js";import"../../models/ui/validator/form/address.js";import"../../models/ui/validator/form/ikas-address.js";import"../../models/ui/validator/form/register.js";import{ContactForm as E}from"../../models/ui/validator/form/contact-form.js";import"../../models/ui/validator/form/forgot-password.js";import"../../models/ui/validator/form/recover-password.js";import"../../models/ui/validator/form/account-info.js";import"../../models/ui/validator/form/raffle-form.js";import"../../models/ui/validator/form/customer-review.js";import"../../models/ui/raffle-list/index.js";import{StepSuccess as f}from"./steps/step-success/index.js";import{Modal as y}from"./components/modal/index.js";import x from"./components/master-pass/modal-otp/index.js";import k from"./components/master-pass/modal-response/index.js";import j from"./components/master-pass/modal-success/index.js";import{Image as C}from"../image/index.js";import b,{Step as N}from"./components/step-container/index.js";import{StockError as F}from"./components/error/stock-error/index.js";import{FullscreenLoading as M}from"./components/fullscreen-loading/index.js";import T from"./components/notification-box/index.js";import{FormItem as P}from"./components/form-item/index.js";import{FormItemType as S}from"./components/form-item/model.js";import{Button as A}from"./components/button/index.js";import{IkasPageHead as w}from"../page/head.js";import I from"./components/offer-product/index.js";import V from"./components/svg/ikas.js";import O from"./style.module.scss.js";import{Analytics as B}from"../../analytics/analytics.js";import"../../analytics/head/index.js";var L=i((function(e){var t,i,s,m=e.checkout,p=e.checkoutSettings,u=e.customizationProps,v=e.returnPolicy,E=e.privacyPolicy,C=e.termsOfService,b=e.imprint,N=e.shippingPolicy,T=d().t,P=r(),S=o.useState((function(){return new l(m,p,P,v,E,C,b,N,T,u||{})}))[0];return S.step===n.PAYMENT&&B.disableHTML(),o.useEffect((function(){S.checkoutSettings.isAccountRequired&&!S.checkout.hasCustomer&&P.push("/account/login?redirect="+encodeURIComponent(S.checkoutUrl)),B.beginCheckout(S.checkout),B.pageView(g.CHECKOUT)}),[]),o.useEffect((function(){S.customizationProps=u,function(e){document.documentElement.style.setProperty("--checkout-button-bg-color",(null==e?void 0:e.buttonBgColor)||"#272727"),document.documentElement.style.setProperty("--checkout-button-text-color",(null==e?void 0:e.buttonTextColor)||"#FFFFFF"),document.documentElement.style.setProperty("--checkout-button-disabled-bg-color",(null==e?void 0:e.buttonDisabledBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-button-disabled-text-color",(null==e?void 0:e.buttonDisabledTextColor)||"#8A8B94"),document.documentElement.style.setProperty("--checkout-primary-text-color",(null==e?void 0:e.primaryTextColor)||"#272727"),document.documentElement.style.setProperty("--checkout-secondary-text-color",(null==e?void 0:e.secondaryTextColor)||"#8A8B94"),document.documentElement.style.setProperty("--checkout-primary-bg-color",(null==e?void 0:e.primaryBgColor)||"#FFFFFF"),document.documentElement.style.setProperty("--checkout-secondary-bg-color",(null==e?void 0:e.secondaryBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-border-color",(null==e?void 0:e.borderColor)||"#E5E4E9"),document.documentElement.style.setProperty("--checkout-card-bg-color",(null==e?void 0:e.cardBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-error-color",(null==e?void 0:e.errorColor)||"#FB4E4E"),document.documentElement.style.setProperty("--checkout-error-light-color",(null==e?void 0:e.errorLightColor)||"#FCF3F4"),document.documentElement.style.setProperty("--checkout-warning-color",(null==e?void 0:e.warningColor)||"#FFBC1F"),document.documentElement.style.setProperty("--checkout-warning-light-color",(null==e?void 0:e.warningLightColor)||"#FFFAEE"),document.documentElement.style.setProperty("--checkout-success-color",(null==e?void 0:e.successColor)||"#2DCA73"),document.documentElement.style.setProperty("--checkout-success-light-color",(null==e?void 0:e.successLightColor)||"#F6FFED")}(u)}),[u]),S.isCheckoutLoaded&&S.store.customerStore.initialized?S.checkout.hasCustomer&&(null===(t=S.store.customerStore.customer)||void 0===t?void 0:t.id)!==(null===(i=S.checkout.customer)||void 0===i?void 0:i.id)?(P.push("/account/login?redirect="+encodeURIComponent(S.checkoutUrl)),null):o.createElement(o.Fragment,null,o.createElement(w,{pageType:g.CHECKOUT,pageTitle:((null===(s=S.merchantSettings)||void 0===s?void 0:s.merchantName)||"")+" - "+T("checkout-page:securePayment"),pageDescription:T("checkout-page:securePayment")}),o.createElement("div",{id:"Checkout",className:O.CheckoutPage},o.createElement(a,{place:"top",type:"dark",effect:"solid",arrowColor:"transparent",multiline:!0,className:O.ReactTooltipWrap,globalEventOff:"touchstart"}),o.createElement("div",{className:O.Left},o.createElement("div",{className:O.LeftContent},o.createElement("div",null,o.createElement(R,{vm:S}),S.hasStockError&&o.createElement("div",{className:O.ErrorContainer},o.createElement(F,{vm:S,error:S.error})),!S.hasStockError&&o.createElement(o.Fragment,null,o.createElement(h,{vm:S,allowExpand:!0}),S.step===n.SUCCESS?o.createElement(f,{vm:S}):o.createElement(o.Fragment,null,S.checkoutCampaignOffer&&o.createElement(I,{vm:S,campaignOffer:S.checkoutCampaignOffer}),o.createElement(D,{vm:S}))),o.createElement("div",{className:O.Space})),o.createElement(z,{vm:S}))),o.createElement("div",{className:O.Right},o.createElement("div",{className:O.RightContent},o.createElement(h,{vm:S}),o.createElement("div",{className:O.PoweredBy},o.createElement("span",null,"powered by"),o.createElement("a",{href:"https://ikas.com"+("tr"===c.getCurrentLocale()?"/tr":""),target:"_blank"},o.createElement(V,null))))),!!S.policyModalText&&o.createElement(y,{title:S.policyModalTitle,modalContent:S.policyModalText,onClose:function(){S.policyModalText=""}}),S.isContactModalVisible&&o.createElement(G,{vm:S,setVisible:S.setContactModalVisible}),S.mpVM.isOtpModalVisible&&o.createElement(x,{vm:S,visible:S.mpVM.isOtpModalVisible,type:S.mpVM.otpModalType,onClose:S.mpVM.hideOtpModal}),S.mpVM.isResponseModalVisible&&o.createElement(k,{visible:S.mpVM.isResponseModalVisible,text:S.mpVM.mfsResponseModalText,onClose:S.mpVM.onResponseModalClose}),S.mpVM.isSuccessModalVisible&&o.createElement(j,{visible:S.mpVM.isSuccessModalVisible,type:S.mpVM.successModalType,onClose:S.mpVM.onSuccessModalClose}))):o.createElement(M,null)})),R=i((function(e){var t,i,r,a=e.vm,l=d().t;return o.createElement("div",{className:O.Header},o.createElement(s,{href:"/",passHref:!0},o.createElement("a",null,(null===(t=a.merchantSettings)||void 0===t?void 0:t.logo)?o.createElement("div",{className:O.Logo},o.createElement(C,{layout:"fill",image:a.merchantSettings.logo,sizes:"360px"})):(null===(i=a.merchantSettings)||void 0===i?void 0:i.merchantName)||"")),!a.checkout.hasCustomer&&o.createElement("div",{className:O.LoginText},o.createElement("span",{className:O.LoginCta},l("checkout-page:alreadyHaveAnAccount")),o.createElement(s,{href:"/account/login?redirect="+encodeURIComponent(a.checkoutUrl),passHref:!0},o.createElement("a",{className:O.LoginBtn},l("checkout-page:actions.login")))),a.checkout.hasCustomer&&o.createElement("div",{className:O.CustomerInfo},o.createElement("div",{className:O.Name},a.checkout.customerFullName),o.createElement("div",{className:O.Email},null===(r=a.checkout.customer)||void 0===r?void 0:r.email)))})),D=i((function(e){var t=e.vm,i=d().t,r=o.useMemo((function(){switch(t.step){case n.INFO:return o.createElement(p,{vm:t});case n.SHIPPING:return o.createElement(u,{vm:t});case n.PAYMENT:return o.createElement(v,{vm:t});case n.SUCCESS:return o.createElement(f,{vm:t})}}),[t,t.step]),s=[new N(i("checkout-page:address"),t.step===n.INFO,t.step!==n.INFO,t.step!==n.INFO?o.createElement("div",{className:O.AdressStepInfo},o.createElement(U,{vm:t}),o.createElement("div",{className:O.EditBtn,onClick:t.onBackToInfoClick},i("checkout-page:actions.edit"))):void 0,t.step!==n.INFO?o.createElement("div",{className:O.AddressStepInfoMobile},o.createElement(U,{vm:t})):void 0),new N(i("checkout-page:payment"),t.step===n.PAYMENT,!1)];return"address"!==t.deliveryMethod||t.isDigitalOnly||s.splice(1,0,new N(i("checkout-page:shipping"),t.step===n.SHIPPING,t.step===n.PAYMENT,t.step===n.PAYMENT?o.createElement("div",{className:O.AdressStepInfo},o.createElement(H,{vm:t}),(t.checkout.availableShippingMethods&&t.checkout.availableShippingMethods.length>1||t.checkoutSettings.isGiftPackageEnabled)&&o.createElement("div",{className:O.EditBtn,onClick:t.onBackToShippingClick},i("checkout-page:actions.edit"))):void 0,t.step===n.PAYMENT?o.createElement("div",{className:O.AddressStepInfoMobile},o.createElement(H,{vm:t})):void 0)),o.createElement(b,{steps:s,stepContent:r})})),U=i((function(e){var t,i,r,s,a,l,n,c,m,p=e.vm,u=d().t,v=p.isDigitalOnly?((null===(t=p.checkout.billingAddress)||void 0===t?void 0:t.firstName)||"")+" "+((null===(i=p.checkout.billingAddress)||void 0===i?void 0:i.lastName)||""):((null===(r=p.checkout.shippingAddress)||void 0===r?void 0:r.firstName)||"")+" "+((null===(s=p.checkout.shippingAddress)||void 0===s?void 0:s.lastName)||"");return o.createElement("div",{className:O.Address},o.createElement("div",{className:[O.Text,O.WithMBottom].join(" ")},(null===(a=p.checkout.customer)||void 0===a?void 0:a.email)||""),"address"===p.deliveryMethod?o.createElement("div",{className:O.Text},v):o.createElement(o.Fragment,null,o.createElement("div",{className:O.Text},u("checkout-page:receiver")),o.createElement("div",{className:[O.Text,O.Gray].join(" ")},v)),o.createElement("div",{className:[O.Text,O.Gray].join(" ")},p.isDigitalOnly?null===(l=p.checkout.billingAddress)||void 0===l?void 0:l.phone:null===(n=p.checkout.shippingAddress)||void 0===n?void 0:n.phone),"in-store"===p.deliveryMethod&&o.createElement(o.Fragment,null,o.createElement("div",{className:[O.Text,O.WithMTop].join(" ")},u("checkout-page:pickUpLocation"))),o.createElement("div",{className:[O.Text,O.Gray].join(" ")},p.isDigitalOnly?null===(c=p.checkout.billingAddress)||void 0===c?void 0:c.addressText:null===(m=p.checkout.shippingAddress)||void 0===m?void 0:m.addressText))})),H=i((function(e){var t=e.vm,i=d().t;return o.createElement("div",{className:O.Address},t.checkout.shippingLines&&t.checkout.shippingLines.length?o.createElement(o.Fragment,null,o.createElement("span",null,t.checkout.shippingLines[0].title),o.createElement("span",{className:O.LightText}," / "+(0===t.checkout.shippingLines[0].price?i("checkout-page:free"):m(t.checkout.shippingLines[0].price,t.checkout.currencyCode,t.checkout.currencySymbol)))):i("checkout-page:standartShipping"))})),z=i((function(e){var t=e.vm,i=d().t;return o.createElement("div",{className:O.Footer},o.createElement("div",{className:O.FooterItem,onClick:function(){t.policyModalTitle=i("checkout-page:returnPolicy"),t.policyModalText=t.returnPolicy}},i("checkout-page:returnPolicy")),o.createElement("div",{className:O.FooterBullet},"•"),o.createElement("div",{className:O.FooterItem,onClick:function(){t.policyModalTitle=i("checkout-page:privacyPolicy"),t.policyModalText=t.privacyPolicy}},i("checkout-page:privacyPolicy")),o.createElement("div",{className:O.FooterBullet},"•"),o.createElement("div",{className:O.FooterItem,onClick:function(){t.policyModalTitle=i("checkout-page:termsOfService"),t.policyModalText=t.termsOfService}},i("checkout-page:termsOfService")),t.imprint&&o.createElement(o.Fragment,null,o.createElement("div",{className:O.FooterBullet},"•"),o.createElement("div",{className:O.FooterItem,onClick:function(){t.policyModalTitle=i("checkout-page:imprint"),t.policyModalText=t.imprint}},i("checkout-page:imprint"))),t.shippingPolicy&&o.createElement(o.Fragment,null,o.createElement("div",{className:O.FooterBullet},"•"),o.createElement("div",{className:O.FooterItem,onClick:function(){t.policyModalTitle=i("checkout-page:shippingPolicy"),t.policyModalText=t.shippingPolicy}},i("checkout-page:shippingPolicy"))))})),G=i((function(i){var r,s,a,l=i.vm,n=i.setVisible,c=d().t,m=o.useState(!1),p=m[0],u=m[1],v=o.useState(!1),h=v[0],g=v[1],f=o.useState(new E({message:{requiredRule:"",emailRule:"",minRule:""}}))[0];f.email=(null===(r=l.checkout.customer)||void 0===r?void 0:r.email)||"",f.firstName=(null===(s=l.checkout.customer)||void 0===s?void 0:s.firstName)||"",f.lastName=(null===(a=l.checkout.customer)||void 0===a?void 0:a.lastName)||"";var x=o.useCallback((function(){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return h?[2,n(!1)]:(u(!0),[4,f.saveContactForm()]);case 1:return e.sent()&&g(!0),u(!1),[2]}}))}))}),[p]);return o.createElement(y,{title:c("checkout-page:contactForm"),modalContent:o.createElement("div",null,h&&o.createElement("div",{style:{marginBottom:"12px",maxWidth:"352px"}},o.createElement(T,{type:"success",title:c("checkout-page:contactFormSent"),content:c("checkout-page:contactFormDescription")})),o.createElement(P,{type:S.TEXT_AREA,label:"",value:f.message||"",onChange:f.onMessageChange,textAreaPlaceholder:c("checkout-page:contactFormCta")}),o.createElement(A,{style:{width:"100%",marginTop:"24px"},text:c(h?"checkout-page:actions.close":"checkout-page:actions.sendMessage"),isLoading:p,isDisabled:!f.message,onClick:x})),onClose:function(){return n(!1)}})}));export{L as default};
|
|
1
|
+
import{__awaiter as e,__generator as t}from'./../../ext/tslib/tslib.es6.js';import*as o from"react";import{observer as i}from"mobx-react-lite";import{useRouter as r}from"next/router.js";import a from"next/link.js";import s from"react-tooltip";import n,{CheckoutStep as c}from"./model.js";import{IkasStorefrontConfig as l}from"@ikas/storefront-config";import{formatCurrency as m}from"../../utils/currency.js";import{useTranslation as d}from"../../utils/i18n.js";import p from"./steps/step-info/index.js";import{CheckoutStepShipping as u}from"./steps/step-shipping/index.js";import{CheckoutStepPayment as v}from"./steps/step-payment/index.js";import{CartSummary as h}from"./components/cart-summary/index.js";import"../../models/data/blog/category/index.js";import"../../models/data/blog/content/index.js";import"../../models/data/blog/meta-data/index.js";import"../../models/data/blog/tag/index.js";import"../../models/data/blog/index.js";import"../../models/data/brand/index.js";import{IkasThemeJsonPageType as g}from"@ikas/storefront-models";import"mobx";import"../../models/data/campaign-offer/index.js";import"../../models/data/cart/campaign-offer/index.js";import"../../models/data/cart/index.js";import"../../models/data/category/path-item/index.js";import"../../models/data/category/index.js";import"../../models/data/checkout/index.js";import"../../models/data/checkout-settings/index.js";import"../../models/data/city/index.js";import"../../models/data/country/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/address/ikas-localized-customer-address.js";import"../../models/data/customer/attribute/index.js";import"../../models/data/customer/review/summary/index.js";import"../../models/data/customer/review/index.js";import"../../models/data/customer/index.js";import"../../models/data/district/index.js";import"../../models/data/favorite-product/index.js";import"../../models/data/filter-category/index.js";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/order/address/index.js";import"../../models/data/order/line-item/option/value/index.js";import"../../models/data/order/line-item/variant/value/index.js";import"../../models/data/order/line-item/variant/index.js";import"../../models/data/order/line-item/index.js";import"../../models/data/order/package/index.js";import"../../models/data/order/transaction/index.js";import"../../models/data/order/index.js";import"../../models/data/payment-gateway/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product/filter/index.js";import"../../models/data/product/option-set/option/index.js";import"../../models/data/product/option-set/index.js";import"../../models/data/product/stock-location/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/index.js";import"../../models/data/raffle/index.js";import"../../models/data/state/index.js";import"../../models/data/theme-json/index.js";import"../../models/data/theme-json/custom-data/index.js";import"../../models/data/variant-type/variant-value/index.js";import"@ikas/localized-address";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-list/index.js";import"../../models/ui/product-attribute-detail/index.js";import"../../models/ui/product-attribute-list/index.js";import"../../models/ui/customer-review-list/index.js";import"../../models/ui/customer-review-summary-list/index.js";import"../../models/ui/validator/index.js";import"../../models/ui/validator/rules/index.js";import"../../models/ui/validator/form/login.js";import"../../models/ui/validator/form/address.js";import"../../models/ui/validator/form/ikas-address.js";import"../../models/ui/validator/form/register.js";import{ContactForm as y}from"../../models/ui/validator/form/contact-form.js";import"../../models/ui/validator/form/forgot-password.js";import"../../models/ui/validator/form/recover-password.js";import"../../models/ui/validator/form/account-info.js";import"../../models/ui/validator/form/raffle-form.js";import"../../models/ui/validator/form/customer-review.js";import"../../models/ui/raffle-list/index.js";import{StepSuccess as f}from"./steps/step-success/index.js";import{Modal as E}from"./components/modal/index.js";import k from"./components/master-pass/modal-otp/index.js";import x from"./components/master-pass/modal-response/index.js";import j from"./components/master-pass/modal-success/index.js";import{Image as C}from"../image/index.js";import b,{Step as N}from"./components/step-container/index.js";import{StockError as F}from"./components/error/stock-error/index.js";import{FullscreenLoading as M}from"./components/fullscreen-loading/index.js";import P from"./components/notification-box/index.js";import{FormItem as T}from"./components/form-item/index.js";import{FormItemType as S}from"./components/form-item/model.js";import{Button as w}from"./components/button/index.js";import{IkasPageHead as A}from"../page/head.js";import I from"./components/offer-product/index.js";import O from"./components/svg/ikas.js";import B from"./style.module.scss.js";import{Analytics as L}from"../../analytics/analytics.js";import"../../analytics/head/index.js";import V from"./components/epaykolay-button/index.js";var R=i((function(i){var a,m,p,u=i.checkout,v=i.checkoutSettings,y=i.customizationProps,C=i.returnPolicy,b=i.privacyPolicy,N=i.termsOfService,P=i.imprint,T=i.shippingPolicy,S=d().t,w=r(),R=o.useState((function(){return new n(u,v,w,C,b,N,P,T,S,y||{})}))[0];R.step===c.PAYMENT&&L.disableHTML();var _=function(o){return e(void 0,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return e="".concat(process.env.NEXT_PUBLIC_BASE_URL,"/os/e-pay-kolay/get-basket"),[4,fetch(e,{method:"POST",headers:{"Content-Type":"application/json","x-api-key":l.getApiKey()},body:JSON.stringify({cartId:R.checkout.id,customerNumber:o,sessionsState:Date.now()})})];case 1:return[2,t.sent().json()]}}))}))};o.useEffect((function(){R.checkoutSettings.isAccountRequired&&!R.checkout.hasCustomer&&w.push("/account/login?redirect="+encodeURIComponent(R.checkoutUrl)),L.beginCheckout(R.checkout),L.pageView(g.CHECKOUT)}),[]),o.useEffect((function(){R.customizationProps=y,function(e){document.documentElement.style.setProperty("--checkout-button-bg-color",(null==e?void 0:e.buttonBgColor)||"#272727"),document.documentElement.style.setProperty("--checkout-button-text-color",(null==e?void 0:e.buttonTextColor)||"#FFFFFF"),document.documentElement.style.setProperty("--checkout-button-disabled-bg-color",(null==e?void 0:e.buttonDisabledBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-button-disabled-text-color",(null==e?void 0:e.buttonDisabledTextColor)||"#8A8B94"),document.documentElement.style.setProperty("--checkout-primary-text-color",(null==e?void 0:e.primaryTextColor)||"#272727"),document.documentElement.style.setProperty("--checkout-secondary-text-color",(null==e?void 0:e.secondaryTextColor)||"#8A8B94"),document.documentElement.style.setProperty("--checkout-primary-bg-color",(null==e?void 0:e.primaryBgColor)||"#FFFFFF"),document.documentElement.style.setProperty("--checkout-secondary-bg-color",(null==e?void 0:e.secondaryBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-border-color",(null==e?void 0:e.borderColor)||"#E5E4E9"),document.documentElement.style.setProperty("--checkout-card-bg-color",(null==e?void 0:e.cardBgColor)||"#F7F7F9"),document.documentElement.style.setProperty("--checkout-error-color",(null==e?void 0:e.errorColor)||"#FB4E4E"),document.documentElement.style.setProperty("--checkout-error-light-color",(null==e?void 0:e.errorLightColor)||"#FCF3F4"),document.documentElement.style.setProperty("--checkout-warning-color",(null==e?void 0:e.warningColor)||"#FFBC1F"),document.documentElement.style.setProperty("--checkout-warning-light-color",(null==e?void 0:e.warningLightColor)||"#FFFAEE"),document.documentElement.style.setProperty("--checkout-success-color",(null==e?void 0:e.successColor)||"#2DCA73"),document.documentElement.style.setProperty("--checkout-success-light-color",(null==e?void 0:e.successLightColor)||"#F6FFED")}(y)}),[y]),o.useEffect((function(){if(R.isEPayKolayEnabled)var o=setInterval((function(){var i;window.setContainerService&&R.isCheckoutLoaded&&(window.setContainerService(null===(i=l.getMerchantSettings())||void 0===i?void 0:i.merchantId,_,(function(o){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return[4,K(o)];case 1:return[2,e.sent()]}}))}))}),(function(){console.log("Switching to epaykolay"),R.isEPayKolayPayment=!0}),"https://cdn.myikas.com/sf/static/e-pay-kolay/"),clearInterval(o))}),100)}),[]);var K=o.useCallback((function(o){return e(void 0,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return[4,fetch("".concat(process.env.NEXT_PUBLIC_BASE_URL,"/os/e-pay-kolay/complete-payment"),{method:"POST",body:JSON.stringify({data:o,cartId:R.checkout.id}),headers:{"Content-Type":"application/json","x-api-key":l.getApiKey()}})];case 1:return[4,t.sent().json()];case 2:return e=t.sent(),[2,"".concat(window.location.pathname,"?id=").concat(R.checkout.id,"&step=").concat(e.success?"success":"info")]}}))}))}),[]);if(!R.isCheckoutLoaded||!R.store.customerStore.initialized)return o.createElement(M,null);if(R.checkout.hasCustomer&&(null===(a=R.store.customerStore.customer)||void 0===a?void 0:a.id)!==(null===(m=R.checkout.customer)||void 0===m?void 0:m.id))return w.push("/account/login?redirect="+encodeURIComponent(R.checkoutUrl)),null;return o.createElement(o.Fragment,null,o.createElement(A,{pageType:g.CHECKOUT,pageTitle:((null===(p=R.merchantSettings)||void 0===p?void 0:p.merchantName)||"")+" - "+S("checkout-page:securePayment"),pageDescription:S("checkout-page:securePayment")}),o.createElement("div",{id:"Checkout",className:B.CheckoutPage},o.createElement(s,{place:"top",type:"dark",effect:"solid",arrowColor:"transparent",multiline:!0,className:B.ReactTooltipWrap,globalEventOff:"touchstart"}),o.createElement("div",{className:[B.Left,R.isEPayKolayPayment?B.epaykolay:""].join(" ")},R.isEPayKolayEnabled&&o.createElement("div",{id:"plateau_ui_placeholder",style:{width:"100%"}}),!R.isEPayKolayPayment&&o.createElement("div",{className:B.LeftContent},o.createElement("div",null,o.createElement(U,{vm:R}),o.createElement("div",null,R.step!==c.SUCCESS&&R.isEPayKolayEnabled&&o.createElement(V,{onClick:function(){window.frictionless()}})),R.hasStockError&&o.createElement("div",{className:B.ErrorContainer},o.createElement(F,{vm:R,error:R.error})),!R.hasStockError&&o.createElement(o.Fragment,null,o.createElement(h,{vm:R,allowExpand:!0}),R.step===c.SUCCESS?o.createElement(f,{vm:R}):o.createElement(o.Fragment,null,R.checkoutCampaignOffer&&o.createElement(I,{vm:R,campaignOffer:R.checkoutCampaignOffer}),o.createElement(D,{vm:R}))),o.createElement("div",{className:B.Space})),o.createElement(H,{vm:R}))),o.createElement("div",{className:B.Right},o.createElement("div",{className:B.RightContent},o.createElement(h,{vm:R}),o.createElement("div",{className:B.PoweredBy},o.createElement("span",null,"powered by"),o.createElement("a",{href:"https://ikas.com"+("tr"===l.getCurrentLocale()?"/tr":""),target:"_blank"},o.createElement(O,null))))),!!R.policyModalText&&o.createElement(E,{title:R.policyModalTitle,modalContent:R.policyModalText,onClose:function(){R.policyModalText=""}}),R.isContactModalVisible&&o.createElement(z,{vm:R,setVisible:R.setContactModalVisible}),R.mpVM.isOtpModalVisible&&o.createElement(k,{vm:R,visible:R.mpVM.isOtpModalVisible,type:R.mpVM.otpModalType,onClose:R.mpVM.hideOtpModal}),R.mpVM.isResponseModalVisible&&o.createElement(x,{visible:R.mpVM.isResponseModalVisible,text:R.mpVM.mfsResponseModalText,onClose:R.mpVM.onResponseModalClose}),R.mpVM.isSuccessModalVisible&&o.createElement(j,{visible:R.mpVM.isSuccessModalVisible,type:R.mpVM.successModalType,onClose:R.mpVM.onSuccessModalClose})))})),U=i((function(e){var t,i,r,s=e.vm,n=d().t;return o.createElement("div",{className:B.Header},o.createElement(a,{href:"/",passHref:!0},o.createElement("a",null,(null===(t=s.merchantSettings)||void 0===t?void 0:t.logo)?o.createElement("div",{className:B.Logo},o.createElement(C,{layout:"fill",image:s.merchantSettings.logo,sizes:"360px"})):(null===(i=s.merchantSettings)||void 0===i?void 0:i.merchantName)||"")),!s.checkout.hasCustomer&&o.createElement("div",{className:B.LoginText},o.createElement("span",{className:B.LoginCta},n("checkout-page:alreadyHaveAnAccount")),o.createElement(a,{href:"/account/login?redirect="+encodeURIComponent(s.checkoutUrl),passHref:!0},o.createElement("a",{className:B.LoginBtn},n("checkout-page:actions.login")))),s.checkout.hasCustomer&&o.createElement("div",{className:B.CustomerInfo},o.createElement("div",{className:B.Name},s.checkout.customerFullName),o.createElement("div",{className:B.Email},null===(r=s.checkout.customer)||void 0===r?void 0:r.email)))})),D=i((function(e){var t=e.vm,i=d().t,r=o.useMemo((function(){switch(t.step){case c.INFO:return o.createElement(p,{vm:t});case c.SHIPPING:return o.createElement(u,{vm:t});case c.PAYMENT:return o.createElement(v,{vm:t});case c.SUCCESS:return o.createElement(f,{vm:t})}}),[t,t.step]),a=[new N(i("checkout-page:address"),t.step===c.INFO,t.step!==c.INFO,t.step!==c.INFO?o.createElement("div",{className:B.AdressStepInfo},o.createElement(_,{vm:t}),o.createElement("div",{className:B.EditBtn,onClick:t.onBackToInfoClick},i("checkout-page:actions.edit"))):void 0,t.step!==c.INFO?o.createElement("div",{className:B.AddressStepInfoMobile},o.createElement(_,{vm:t})):void 0),new N(i("checkout-page:payment"),t.step===c.PAYMENT,!1)];return"address"!==t.deliveryMethod||t.isDigitalOnly||a.splice(1,0,new N(i("checkout-page:shipping"),t.step===c.SHIPPING,t.step===c.PAYMENT,t.step===c.PAYMENT?o.createElement("div",{className:B.AdressStepInfo},o.createElement(K,{vm:t}),(t.checkout.availableShippingMethods&&t.checkout.availableShippingMethods.length>1||t.checkoutSettings.isGiftPackageEnabled)&&o.createElement("div",{className:B.EditBtn,onClick:t.onBackToShippingClick},i("checkout-page:actions.edit"))):void 0,t.step===c.PAYMENT?o.createElement("div",{className:B.AddressStepInfoMobile},o.createElement(K,{vm:t})):void 0)),o.createElement(b,{steps:a,stepContent:r})})),_=i((function(e){var t,i,r,a,s,n,c,l,m,p=e.vm,u=d().t,v=p.isDigitalOnly?((null===(t=p.checkout.billingAddress)||void 0===t?void 0:t.firstName)||"")+" "+((null===(i=p.checkout.billingAddress)||void 0===i?void 0:i.lastName)||""):((null===(r=p.checkout.shippingAddress)||void 0===r?void 0:r.firstName)||"")+" "+((null===(a=p.checkout.shippingAddress)||void 0===a?void 0:a.lastName)||"");return o.createElement("div",{className:B.Address},o.createElement("div",{className:[B.Text,B.WithMBottom].join(" ")},(null===(s=p.checkout.customer)||void 0===s?void 0:s.email)||""),"address"===p.deliveryMethod?o.createElement("div",{className:B.Text},v):o.createElement(o.Fragment,null,o.createElement("div",{className:B.Text},u("checkout-page:receiver")),o.createElement("div",{className:[B.Text,B.Gray].join(" ")},v)),o.createElement("div",{className:[B.Text,B.Gray].join(" ")},p.isDigitalOnly?null===(n=p.checkout.billingAddress)||void 0===n?void 0:n.phone:null===(c=p.checkout.shippingAddress)||void 0===c?void 0:c.phone),"in-store"===p.deliveryMethod&&o.createElement(o.Fragment,null,o.createElement("div",{className:[B.Text,B.WithMTop].join(" ")},u("checkout-page:pickUpLocation"))),o.createElement("div",{className:[B.Text,B.Gray].join(" ")},p.isDigitalOnly?null===(l=p.checkout.billingAddress)||void 0===l?void 0:l.addressText:null===(m=p.checkout.shippingAddress)||void 0===m?void 0:m.addressText))})),K=i((function(e){var t=e.vm,i=d().t;return o.createElement("div",{className:B.Address},t.checkout.shippingLines&&t.checkout.shippingLines.length?o.createElement(o.Fragment,null,o.createElement("span",null,t.checkout.shippingLines[0].title),o.createElement("span",{className:B.LightText}," / "+(0===t.checkout.shippingLines[0].price?i("checkout-page:free"):m(t.checkout.shippingLines[0].price,t.checkout.currencyCode,t.checkout.currencySymbol)))):i("checkout-page:standartShipping"))})),H=i((function(e){var t=e.vm,i=d().t;return o.createElement("div",{className:B.Footer},o.createElement("div",{className:B.FooterItem,onClick:function(){t.policyModalTitle=i("checkout-page:returnPolicy"),t.policyModalText=t.returnPolicy}},i("checkout-page:returnPolicy")),o.createElement("div",{className:B.FooterBullet},"•"),o.createElement("div",{className:B.FooterItem,onClick:function(){t.policyModalTitle=i("checkout-page:privacyPolicy"),t.policyModalText=t.privacyPolicy}},i("checkout-page:privacyPolicy")),o.createElement("div",{className:B.FooterBullet},"•"),o.createElement("div",{className:B.FooterItem,onClick:function(){t.policyModalTitle=i("checkout-page:termsOfService"),t.policyModalText=t.termsOfService}},i("checkout-page:termsOfService")),t.imprint&&o.createElement(o.Fragment,null,o.createElement("div",{className:B.FooterBullet},"•"),o.createElement("div",{className:B.FooterItem,onClick:function(){t.policyModalTitle=i("checkout-page:imprint"),t.policyModalText=t.imprint}},i("checkout-page:imprint"))),t.shippingPolicy&&o.createElement(o.Fragment,null,o.createElement("div",{className:B.FooterBullet},"•"),o.createElement("div",{className:B.FooterItem,onClick:function(){t.policyModalTitle=i("checkout-page:shippingPolicy"),t.policyModalText=t.shippingPolicy}},i("checkout-page:shippingPolicy"))))})),z=i((function(i){var r,a,s,n=i.vm,c=i.setVisible,l=d().t,m=o.useState(!1),p=m[0],u=m[1],v=o.useState(!1),h=v[0],g=v[1],f=o.useState(new y({message:{requiredRule:"",emailRule:"",minRule:""}}))[0];f.email=(null===(r=n.checkout.customer)||void 0===r?void 0:r.email)||"",f.firstName=(null===(a=n.checkout.customer)||void 0===a?void 0:a.firstName)||"",f.lastName=(null===(s=n.checkout.customer)||void 0===s?void 0:s.lastName)||"";var k=o.useCallback((function(){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return h?[2,c(!1)]:(u(!0),[4,f.saveContactForm()]);case 1:return e.sent()&&g(!0),u(!1),[2]}}))}))}),[p]);return o.createElement(E,{title:l("checkout-page:contactForm"),modalContent:o.createElement("div",null,h&&o.createElement("div",{style:{marginBottom:"12px",maxWidth:"352px"}},o.createElement(P,{type:"success",title:l("checkout-page:contactFormSent"),content:l("checkout-page:contactFormDescription")})),o.createElement(T,{type:S.TEXT_AREA,label:"",value:f.message||"",onChange:f.onMessageChange,textAreaPlaceholder:l("checkout-page:contactFormCta")}),o.createElement(w,{style:{width:"100%",marginTop:"24px"},text:l(h?"checkout-page:actions.close":"checkout-page:actions.sendMessage"),isLoading:p,isDisabled:!f.message,onClick:k})),onClose:function(){return c(!1)}})}));export{R as default};
|
|
@@ -28,6 +28,7 @@ export default class CheckoutViewModel {
|
|
|
28
28
|
isTermsAndConditionsChecked: boolean;
|
|
29
29
|
isChangingShippingMethod: boolean;
|
|
30
30
|
isContactModalVisible: boolean;
|
|
31
|
+
isEPayKolayPayment: boolean;
|
|
31
32
|
step: CheckoutStep;
|
|
32
33
|
customizationProps?: IkasCheckoutCustomizationProps | null;
|
|
33
34
|
cardData?: CreditCardData | null;
|
|
@@ -102,6 +103,7 @@ export default class CheckoutViewModel {
|
|
|
102
103
|
get isDigitalOnly(): boolean;
|
|
103
104
|
get customerAddresses(): IkasLocalizedCustomerAddress[] | undefined;
|
|
104
105
|
get isManualOrder(): boolean;
|
|
106
|
+
get isEPayKolayEnabled(): boolean;
|
|
105
107
|
saveCart: () => Promise<import("../../models").IkasCart | null | undefined>;
|
|
106
108
|
inStockDeliveryInputData: (input: SaveCartInput) => Promise<SaveCartInput>;
|
|
107
109
|
checkStocks: () => Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as t,__generator as e,__assign as i}from'./../../ext/tslib/tslib.es6.js';import{makeAutoObservable as s}from"mobx";import n from"lodash/cloneDeep";import r from"lodash/sortBy";import"../../models/data/blog/category/index.js";import"../../models/data/blog/content/index.js";import"../../models/data/blog/meta-data/index.js";import"../../models/data/blog/tag/index.js";import"../../models/data/blog/index.js";import"../../models/data/brand/index.js";import{IkasPaymentMethodType as o,IkasPaymentGatewayType as a,IkasOrderShippingMethod as c,IkasCartCreatedBy as d,IkasTransactionStatus as u,IkasCartCampaignOfferStatus as l,IkasCampaignOfferTargetPageType as h}from"@ikas/storefront-models";import"../../models/data/campaign-offer/index.js";import"../../models/data/cart/campaign-offer/index.js";import"../../models/data/cart/index.js";import"../../models/data/category/path-item/index.js";import"../../models/data/category/index.js";import{IkasCheckout as p}from"../../models/data/checkout/index.js";import"../../models/data/checkout-settings/index.js";import"../../models/data/city/index.js";import"../../models/data/country/index.js";import{IkasCustomerAddress as m}from"../../models/data/customer/address/index.js";import{IkasLocalizedCustomerAddress as f}from"../../models/data/customer/address/ikas-localized-customer-address.js";import"../../models/data/customer/attribute/index.js";import"../../models/data/customer/review/summary/index.js";import"../../models/data/customer/review/index.js";import"../../models/data/customer/index.js";import"../../models/data/district/index.js";import"../../models/data/favorite-product/index.js";import"../../models/data/filter-category/index.js";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import{IkasMerchantSettings as g}from"../../models/data/merchant-settings/index.js";import"../../models/data/order/address/index.js";import{IkasOrderCustomer as v}from"../../models/data/order/customer/index.js";import"../../models/data/order/line-item/option/value/index.js";import"../../models/data/order/line-item/variant/value/index.js";import"../../models/data/order/line-item/variant/index.js";import"../../models/data/order/line-item/index.js";import"../../models/data/order/package/index.js";import"../../models/data/order/transaction/index.js";import"../../models/data/order/index.js";import"../../models/data/payment-gateway/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product/filter/index.js";import"../../models/data/product/option-set/option/index.js";import"../../models/data/product/option-set/index.js";import"../../models/data/product/stock-location/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/variant-type/index.js";import{IkasProduct as y}from"../../models/data/product/index.js";import"../../models/data/raffle/index.js";import"../../models/data/state/index.js";import"../../models/data/theme-json/index.js";import"../../models/data/theme-json/custom-data/index.js";import"../../models/data/variant-type/variant-value/index.js";import{LocalizedAddressModel as S}from"@ikas/localized-address";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-list/index.js";import"../../models/ui/product-attribute-detail/index.js";import"../../models/ui/product-attribute-list/index.js";import"../../models/ui/customer-review-list/index.js";import"../../models/ui/customer-review-summary-list/index.js";import"../../models/ui/validator/index.js";import"../../models/ui/validator/rules/index.js";import"../../models/ui/validator/form/login.js";import"../../models/ui/validator/form/address.js";import"../../models/ui/validator/form/ikas-address.js";import"../../models/ui/validator/form/register.js";import"../../models/ui/validator/form/contact-form.js";import"../../models/ui/validator/form/forgot-password.js";import"../../models/ui/validator/form/recover-password.js";import"../../models/ui/validator/form/account-info.js";import"../../models/ui/validator/form/raffle-form.js";import"../../models/ui/validator/form/customer-review.js";import"../../models/ui/raffle-list/index.js";import k from"./components/credit-card-form/model.js";import b from"../../store/customer/api.js";import C from"../../store/checkout/index.js";import P from"../../store/cart/api.js";import I,{MFS_ELEMENT_ID as A,MFS_SCRIPT_URL as w}from"./modelMasterPass.js";import N from"../../store/product/index.js";import{IkasBaseStore as O}from"../../store/base.js";import"../../store/customer/index.js";import"../../store/cart/index.js";import{IkasStorefrontConfig as E}from"@ikas/storefront-config";import{Analytics as j}from"../../analytics/analytics.js";import"../../analytics/head/index.js";import{SaveCartInput as R,CheckStocksLineInput as x}from"@ikas/storefront-api";import D from"../../models/data/order/address/ikas-localized-order-address.js";var T,G,L=/^\d+$/,M="undefined"==typeof localStorage,_=function(){function L(c,d,f,g,L,_,K,F,Y,B){var H=this;this.storefront=null,this.isCheckoutLoaded=!1,this.isErrorsVisible=!1,this.isStepLoading=!1,this.isTermsAndConditionsChecked=!1,this.isChangingShippingMethod=!1,this.isContactModalVisible=!1,this.step=T.INFO,this.customizationProps=null,this.cardData=null,this.paymentGateways=[],this.installmentInfo=null,this.useDifferentAddress=!1,this.shouldSaveAddress=!0,this.addressTitle="",this.shippingCountryIds=null,this.selectedShippingAddressId="-1",this.selectedBillingAddressId="-1",this.stockLocations=[],this.availableStockLocations=[],this.deliveryMethod="address",this.stripeResponse=null,this.klarnaResponse=null,this.isKlarnaPaymentCompleted=!1,this.adyenResponse=null,this.payPalClientIdResponse=null,this.paypalOrderResponse=null,this.policyModalTitle="",this.policyModalText="",this.error=null,this.couponError=null,this.showTestModal=!1,this.init=function(){return t(H,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,this.countrySettings.waitUntilInitialized()];case 1:return t.sent(),[4,O.getInstance().customerStore.waitUntilInitialized()];case 2:return t.sent(),this.createCustomer(),this.createShippingAddress(),this.createBillingAddress(),[4,this.getCampaignOffer()];case 3:return t.sent(),[4,this.initStep()];case 4:return t.sent(),[2]}}))}))},this.initStep=function(){return t(H,void 0,void 0,(function(){var t,i,s,n,r,o,a;return e(this,(function(e){switch(e.label){case 0:if(E.getIsEditor())return this.step=T.INFO,this.isCheckoutLoaded=!0,[2];if(t=new URLSearchParams(window.location.search),i=t.get("step"),s=t.get("failed"),n=t.get("error"),i){if(this.step=i,this.step===T.SHIPPING&&!this.canProceedToShipping)return[2,this.changeStep(T.INFO)];if(this.step!==T.PAYMENT||this.canProceedToPayment){if(this.step===T.SUCCESS&&!this.canProceedToPayment)return[2,this.changeStep(T.INFO)];if(![T.INFO,T.SUCCESS,T.SHIPPING,T.PAYMENT].includes(this.step))return[2,this.changeStep(T.INFO)]}else{if(!this.isInStoreDelivery)return[2,this.changeStep(T.INFO)];this.deliveryMethod="in-store"}}return s&&(this.error={type:G.PAYMENT_ERROR,data:n||null}),this.step!==T.INFO?[3,4]:[4,this.getShippingCountries()];case 1:return e.sent(),this.checkShippingCountries(),[4,this.getStockLocations()];case 2:return e.sent(),[4,this.getAvailableStockLocations()];case 3:e.sent(),this.isInStoreDelivery&&(this.deliveryMethod="in-store"),e.label=4;case 4:return this.step!==T.SHIPPING||1!==(null===(o=this.checkout.availableShippingMethods)||void 0===o?void 0:o.length)||this.checkoutSettings.isGiftPackageEnabled||(this.step=T.PAYMENT,this.router.replace("/checkout?id=".concat(this.checkout.id,"&step=").concat(this.step),void 0,{shallow:!0})),this.step!==T.SHIPPING||(null===(a=this.checkout.availableShippingMethods)||void 0===a?void 0:a.length)?this.step!==T.PAYMENT&&this.step!==T.SUCCESS?[3,8]:[4,this.listPaymentGateways()]:(this.error={type:G.NO_SHIPPING_ERROR},this.isCheckoutLoaded=!0,[2]);case 5:return e.sent(),this.isInStoreDelivery?(this.deliveryMethod="in-store",[4,this.getStockLocations()]):[3,7];case 6:e.sent(),e.label=7;case 7:if(!this.paymentGateways.length)return this.error={type:G.NO_SHIPPING_ERROR},this.isCheckoutLoaded=!0,[2];e.label=8;case 8:return this.step===T.SUCCESS?[3,12]:this.checkout.isComplete?[2,this.changeStep(T.SUCCESS)]:[3,9];case 9:return[4,this.initialStockCheck()];case 10:e.sent(),e.label=11;case 11:return[3,14];case 12:return[4,this.getSuccessTransaction()];case 13:e.sent(),this.successTransaction&&(r=this.successTransaction.paymentGatewayId,this.checkout.selectedPaymentGateway=this.paymentGateways.find((function(t){return t.id===r}))),e.label=14;case 14:return this.isCheckoutLoaded=!0,j.checkoutStep(this.checkout,this.step),[2]}}))}))},this.getSuccessTransaction=function(){return t(H,void 0,void 0,(function(){var t,i;return e(this,(function(e){switch(e.label){case 0:return[4,b.listOrderTransactions({orderId:{eq:this.checkout.id}})];case 1:return t=e.sent(),this.successTransaction=t.isSuccess&&(null===(i=t.data)||void 0===i?void 0:i.length)?t.data[t.data.length-1]:void 0,[2]}}))}))},this.saveCart=function(){return t(H,void 0,void 0,(function(){var t,i,s,n;return e(this,(function(e){switch(e.label){case 0:return t=new R(this.checkout),"in-store"!==this.deliveryMethod?[3,2]:[4,this.inStockDeliveryInputData(t)];case 1:t=e.sent(),e.label=2;case 2:return this.step!==T.INFO&&this.step!==T.SHIPPING||this.isDigitalOnly||(t.billingAddress=null),this.isDigitalOnly&&(t.shippingAddress=null),[4,P.saveCart({input:t})];case 3:if((null==(i=e.sent())?void 0:i.graphQLErrors)&&i.graphQLErrors.length)throw s=i.graphQLErrors[0],"CUSTOMER_LOGIN_REQUIRED"===(null===(n=s.extensions)||void 0===n?void 0:n.code)?{type:G.CUSTOMER_LOGIN_REQUIRED_ERROR}:{type:G.API_ERROR,data:i.firstErrorMessage};return[2,i.data]}}))}))},this.inStockDeliveryInputData=function(i){return t(H,void 0,void 0,(function(){var t,s,n=this;return e(this,(function(e){return t=i,(s=this.stockLocations.find((function(t){return t.id===n.checkout.stockLocationId})))&&t.shippingAddress&&s.address&&(t.shippingAddress.country=s.address.country,t.shippingAddress.city=s.address.city,t.shippingAddress.state=s.address.state,t.shippingAddress.district=s.address.district,t.shippingAddress.postalCode=s.address.postalCode,t.shippingAddress.addressLine1=s.address.address||"",t.shippingAddress.addressLine2=null),[2,t]}))}))},this.checkStocks=function(){return t(H,void 0,void 0,(function(){var t,i,s,n,r,o,a,c,d,u,l,h;return e(this,(function(e){switch(e.label){case 0:return this.isManualOrder?[2]:(t=this.checkout.items.map((function(t){return{quantity:t.quantity,variantId:t.variant.id,productId:t.variant.productId}})),[4,C.checkStocks({lines:t.map((function(t){return new x(t)})),stockLocationIdList:(null===(u=E.getStockLocationIds())||void 0===u?void 0:u.length)?E.getStockLocationIds():null})]);case 1:if(!(i=e.sent()).isSuccess)throw{type:G.API_ERROR,data:i.firstErrorMessage};if(null==(s=null===(h=null===(l=i.data)||void 0===l?void 0:l.lines)||void 0===h?void 0:h.filter((function(t){return!t.isAvailable})))?void 0:s.length){for(n=[],r=function(t){var e=o.checkout.items.find((function(e){return e.variant.id===t.variantId}));e&&n.push({item:e,stockCount:t.stockCount})},o=this,a=0,c=s;a<c.length;a++)d=c[a],r(d);throw{type:G.STOCK_ERROR,data:n}}return[2]}}))}))},this.setIsKlarnaPaymentCompleted=function(i){return t(H,void 0,void 0,(function(){return e(this,(function(t){return this.isKlarnaPaymentCompleted=i,[2]}))}))},this.removeUnavailableItems=function(i){return t(H,void 0,void 0,(function(){var t,s,n;return e(this,(function(e){switch(e.label){case 0:t=0,s=i,e.label=1;case 1:return t<s.length?(n=s[t],[4,O.getInstance().cartStore.changeItemQuantity(n.item,n.stockCount<0?0:n.stockCount)]):[3,4];case 2:e.sent(),e.label=3;case 3:return t++,[3,1];case 4:return[2]}}))}))},this.getShippingCountries=function(){return t(H,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,C.getAvailableShippingCountries({salesChannelId:E.getSalesChannelId()})];case 1:return t=e.sent(),this.shippingCountryIds=t.data,[2]}}))}))},this.getStockLocations=function(){return t(H,void 0,void 0,(function(){var t,i;return e(this,(function(e){switch(e.label){case 0:return E.getPickupStockLocationIds()?[4,C.listStockLocation({id:{in:E.getPickupStockLocationIds()}})]:[3,2];case 1:if(!(t=e.sent()).isSuccess||!(null===(i=t.data)||void 0===i?void 0:i.length))return this.error={type:G.API_ERROR,data:t.firstErrorMessage},[2];this.stockLocations=t.data,e.label=2;case 2:return[2]}}))}))},this.getAvailableStockLocations=function(){return t(H,void 0,void 0,(function(){var t,i;return e(this,(function(e){switch(e.label){case 0:return E.getPickupStockLocationIds()?(t=this.checkout.items.map((function(t){return{quantity:t.quantity,variantId:t.variant.id,productId:t.variant.productId}})),[4,C.getAvailableStockLocations({lines:t.map((function(t){return new x(t)})),stockLocationIdList:E.getPickupStockLocationIds()})]):[3,2];case 1:if(!(i=e.sent()).isSuccess)return this.error={type:G.API_ERROR},[2];this.availableStockLocations=i.data||[],e.label=2;case 2:return[2]}}))}))},this.checkShippingCountries=function(){var t;(null===(t=H.shippingCountryIds)||void 0===t?void 0:t.length)||(H.error={type:G.NO_SHIPPING_ERROR})},this.onDeliveryMethodChange=function(t){"address"===t&&(H.checkout.stockLocationId=null),H.deliveryMethod=t,H.isErrorsVisible=!1},this.initialStockCheck=function(){return t(H,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,this.checkStocks()];case 1:return e.sent(),[3,3];case 2:return void 0!==typeof(t=e.sent()).type?this.error=t:(console.log(t),this.error={type:G.UNKNOWN}),[3,3];case 3:return[2]}}))}))},this.listPaymentGateways=function(){return t(H,void 0,void 0,(function(){var t,i,s,n,o,a,c,d,u,l,h=this;return e(this,(function(e){switch(e.label){case 0:return t="local"===process.env.NEXT_PUBLIC_ENV,i=E.getPaymentGateways().map((function(t){return t.id})),[4,C.listPaymentGateway({id:t?void 0:{in:i},locale:E.getCurrentLocale(),transactionAmount:this.checkout.totalFinalPrice})];case 1:return(s=e.sent()).isSuccess&&(null===(u=s.data)||void 0===u?void 0:u.length)?(n=s.data,this.step===T.PAYMENT&&(n=n.filter((function(t){var e;return!(null===(e=t.supportedCurrencies)||void 0===e?void 0:e.length)||t.supportedCurrencies.includes(h.checkout.currencyCode)})),(o=null===(l=this.checkout.shippingAddress)||void 0===l?void 0:l.country)&&o.iso2&&(n=n.filter((function(t){var e;return!(null===(e=t.availableCountries)||void 0===e?void 0:e.length)||t.availableCountries.includes(o.iso2||"")})))),a=[],r(E.getPaymentGateways(),"order").forEach((function(t){var e=null==n?void 0:n.find((function(e){return e.id===t.id}));e&&a.push(e)})),this.paymentGateways=t?n:a,this.checkout.selectedPaymentGateway||this.setPaymentGateway(0),this.step===T.PAYMENT&&(c=n.find((function(t){return!!t.masterPassClientId})))&&(this.checkout.masterPassPaymentGateway=c,(d=document.createElement("script")).id=A,d.src=w,d.onload=function(){h.mpVM.checkMasterPass({checkout:h.checkout,store:O.getInstance()})},document.head.appendChild(d)),[2]):(this.error={type:G.API_ERROR,data:s.firstErrorMessage},[2])}}))}))},this.retrieveInstallmentInfo=function(i){return t(H,void 0,void 0,(function(){var t,s,n;return e(this,(function(e){switch(e.label){case 0:return[4,C.retrieveInstallmentInfo(i)];case 1:return t=e.sent(),s=t.data,null===(n=null==s?void 0:s.installmentPrices)||void 0===n||n.sort((function(t,e){return(t.installmentCount||-1)>(e.installmentCount||-1)?1:-1})),this.installmentInfo=s,[2]}}))}))},this.createCustomer=function(){var t;H.store.customerStore.customer?(null===(t=H.customerAddresses)||void 0===t||t.forEach((function(t){return t.checkoutSettings=H.checkoutSettings})),H.checkout.customer=new v(H.store.customerStore.customer)):H.checkout.customer=new v(H.checkout.customer||{})},this.setCheckoutShippingAddressSettings=function(){H.checkout.shippingAddress&&(H.checkout.shippingAddress.checkoutSettings=H.checkoutSettings,H.checkout.shippingAddress.countrySettings=H.countrySettings)},this.setCheckoutBillingAddressSettings=function(){H.checkout.billingAddress&&(H.checkout.billingAddress.checkoutSettings=H.checkoutSettings,H.checkout.billingAddress.countrySettings=H.countrySettings)},this.createShippingAddress=function(){if(!H.isDigitalOnly)if(H.isInStoreDelivery)H.setCheckoutShippingAddressSettings();else if(H.checkout.shippingAddress){if(H.store.customerStore.customer){var t=null==(e=H.customerAddresses)?void 0:e.find((function(t){var e;return t.id===(null===(e=H.checkout.shippingAddress)||void 0===e?void 0:e.id)}));if(t)return H.onSelectedShippingAddressIdChange(t.id||"-1"),void H.setCheckoutShippingAddressSettings()}H.checkout.shippingAddress=new D(n(H.checkout.shippingAddress)||{}),H.setCheckoutShippingAddressSettings()}else if(H.store.customerStore.customer){var e=H.customerAddresses;H.onSelectedShippingAddressIdChange((null==e?void 0:e.length)?e[0].id:"-1")}else H.onSelectedShippingAddressIdChange("-1")},this.createBillingAddress=function(){if("undefined"!=typeof localStorage)if(H.useDifferentAddress=!!localStorage.getItem("sAddr"),H.checkout.billingAddress){if(H.store.customerStore.customer){var t=null==(e=H.customerAddresses)?void 0:e.find((function(t){var e;return t.id===(null===(e=H.checkout.billingAddress)||void 0===e?void 0:e.id)}));if(t)return H.onSelectedBillingAddressIdChange(t.id||"-1"),void H.setCheckoutBillingAddressSettings()}H.checkout.billingAddress=new D(n(H.checkout.billingAddress)||{}),H.setCheckoutBillingAddressSettings()}else if(H.store.customerStore.customer){var e=H.customerAddresses;H.onSelectedBillingAddressIdChange((null==e?void 0:e.length)?e[0].id:"-1"),(null==e?void 0:e.length)||H.useDifferentAddress||!H.checkout.shippingAddress||H.isInStoreDelivery||(H.checkout.billingAddress=new D(n(H.checkout.shippingAddress)),H.setCheckoutBillingAddressSettings())}else H.onSelectedBillingAddressIdChange("-1"),H.useDifferentAddress||!H.checkout.shippingAddress||H.isInStoreDelivery||(H.checkout.billingAddress=new D(n(H.checkout.shippingAddress)),H.setCheckoutBillingAddressSettings())},this.onShippingMethodChange=function(i){return t(H,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return this.isChangingShippingMethod?[2]:(this.isChangingShippingMethod=!0,this.checkout.shippingSettingsId=i.shippingSettingsId,this.checkout.shippingZoneRateId=i.shippingZoneRateId,[4,this.saveCart()]);case 1:return(t=e.sent())&&(this.checkout=new p(t,this.countrySettings)),this.checkout.shippingAddress&&(this.checkout.shippingAddress.checkoutSettings=this.checkoutSettings),this.isChangingShippingMethod=!1,[2]}}))}))},this.onStockLocationChange=function(i){return t(H,void 0,void 0,(function(){return e(this,(function(t){return this.checkout.stockLocationId=i.id,[2]}))}))},this.onCouponCodeApply=function(){return t(H,void 0,void 0,(function(){var t,s,n,r,o,a;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,5,,6]),[4,P.saveCartCouponCode({cartId:this.checkout.id,couponCode:this.checkout.couponCode||null})];case 1:return(t=e.sent()).isSuccess&&t.data?(s=t.data,n=null===(a=null===(o=this.cardData)||void 0===o?void 0:o.cardNumber)||void 0===a?void 0:a.split(" ").join(""),this.couponError=null,this.step===T.PAYMENT&&(null==n?void 0:n.length)&&n.length>=6&&this.retrieveInstallmentInfo({input:{binNumber:n.slice(0,6),paymentGatewayId:this.checkout.selectedPaymentGateway.id,price:s.totalFinalPrice}}),this.mpVM.selectedCard&&this.mpVM.selectedCard.Value1?[4,this.retrieveInstallmentInfo({input:{binNumber:this.mpVM.selectedCard.Value1.slice(0,6),paymentGatewayId:this.mpVM.selectedCard.paymentGatewayId,price:s.totalFinalPrice}})]:[3,3]):[3,4];case 2:e.sent(),e.label=3;case 3:s&&(r=this.checkout,this.checkout=new p(i(i({},s),{shippingAddress:r.shippingAddress,billingAddress:r.billingAddress,customer:r.customer,selectedPaymentGateway:r.selectedPaymentGateway}),this.countrySettings)),e.label=4;case 4:return t.isSuccess||(this.couponError=t.errorCodes[0]),[3,6];case 5:return e.sent(),[3,6];case 6:return[2]}}))}))},this.onSelectedShippingAddressIdChange=function(t){var e;if(H.selectedShippingAddressId=t,"-1"===t)H.checkout.shippingAddress=new D,H.checkout.shippingAddress.countrySettings=H.countrySettings;else{var i=null===(e=H.customerAddresses)||void 0===e?void 0:e.find((function(e){return e.id===t}));i&&(H.checkout.shippingAddress=new D(i),H.checkout.shippingAddress.countrySettings=H.countrySettings)}H.checkout.shippingAddress&&(H.checkout.shippingAddress.checkoutSettings=H.checkoutSettings)},this.onSelectedBillingAddressIdChange=function(t){var e;if(H.selectedBillingAddressId=t,"-1"===t)H.checkout.billingAddress=new D,H.checkout.billingAddress.countrySettings=H.countrySettings;else{var i=null===(e=H.customerAddresses)||void 0===e?void 0:e.find((function(e){return e.id===t}));i&&(H.checkout.billingAddress=new D(i),H.checkout.billingAddress.countrySettings=H.countrySettings)}H.checkout.billingAddress&&(H.checkout.billingAddress.checkoutSettings=H.checkoutSettings)},this.onTermsAndConditionsCheckedChange=function(t){H.isTermsAndConditionsChecked=t},this.onCardNumberChange=function(t){if(H.cardData&&(!(t.length>H.cardData.cardNumber.length)||U(t))){var e=(H.cardData.cardNumber||"").split(" ").join(""),i=t.split(" ").join("");i.length>16||(e.length<6&&i.length>=6&&!H.installmentInfo?H.retrieveInstallmentInfo({input:{binNumber:i.slice(0,6),paymentGatewayId:H.checkout.selectedPaymentGateway.id,price:H.checkout.totalFinalPrice}}):i.length<6&&e.length>i.length&&(H.cardData.installmentCount=1,H.installmentInfo=void 0),H.cardData.cardNumber=V(i,4).join(" "))}},this.onCardHolderNameChange=function(t){H.cardData&&(H.cardData.cardHolderName=t)},this.onExpirationDateChange=function(t){var e;if(H.cardData&&(!(t.length>H.cardData.expirationDate.length)||U(t))){if(0===(null===(e=H.cardData.expirationDate)||void 0===e?void 0:e.length)){var i=t.replace(".","/").split("/");if(2===i.length){var s=i[0].trim(),n=i[1].trim();if(4===s.length&&2===n.length){var r=parseInt(s.slice(2)),o=parseInt(n);if(!isNaN(r)&&!isNaN(o))return void(H.cardData.expirationDate="".concat(o<10?"0"+o:o," / ").concat(r<10?"0"+r:r))}if(2===s.length&&4===n.length){o=parseInt(s),r=parseInt(n.slice(2));if(!isNaN(r)&&!isNaN(o))return void(H.cardData.expirationDate="".concat(o<10?"0"+o:o," / ").concat(r<10?"0"+r:r))}if(2===s.length&&2===n.length){var a=parseInt(s),c=parseInt(n);o=a<=12?a:c,r=c>12?c:a;if(!isNaN(r)&&!isNaN(o))return void(H.cardData.expirationDate="".concat(o<10?"0"+o:o," / ").concat(r<10?"0"+r:r))}}}var d=t.split(" / ").join("");d.length>4||(H.cardData.expirationDate=V(d,2).join(" / "))}},this.onCvcChange=function(t){H.cardData&&(t.length>H.cardData.cvv.length&&!U(t)||t.length>4||(H.cardData.cvv=t))},this.saveAddress=function(s){return t(H,void 0,void 0,(function(){var t,r,o,a,c,d,u,l,h,p,f,g,v=this;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,3,,4]),this.shouldSaveAddress&&this.store.customerStore.customer?(t="shipping"===s?this.checkout.shippingAddress:this.checkout.billingAddress,(null===(h=this.customerAddresses)||void 0===h?void 0:h.find((function(e){return e.id===(null==t?void 0:t.id)})))?[2]:(r=null===(p=this.customerAddresses)||void 0===p?void 0:p.map((function(t){return t.id})),o=new m(i(i({},t),{title:this.addressTitle||this.t("checkout-page:newAddress")})),(a=n(this.store.customerStore.customer)).addresses||(a.addresses=[]),a.addresses.push(o),[4,this.store.customerStore.saveCustomer(a)])):[3,2];case 1:e.sent(),null===(f=this.customerAddresses)||void 0===f||f.forEach((function(t){return t.checkoutSettings=v.checkoutSettings})),c=null===(g=this.customerAddresses)||void 0===g?void 0:g.map((function(t){return t.id})),d=null==c?void 0:c.filter((function(t){return!(null==r?void 0:r.includes(t))})),u=(null==d?void 0:d.length)?d[0]:void 0,"shipping"===s?(this.checkout.shippingAddress.id=u||"",this.selectedShippingAddressId=u||"-1"):(this.checkout.billingAddress.id=u||"",this.selectedBillingAddressId=u||"-1"),e.label=2;case 2:return[3,4];case 3:return l=e.sent(),console.error(l),[3,4];case 4:return[2]}}))}))},this.onGoToCartClick=function(){H.router.push("/cart")},this.onBackToShoppingClick=function(){H.router.push("/")},this.onGoToLoginClick=function(){H.router.push("/account/login")},this.onProceedToShippingClick=function(){return t(H,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:if("address"===this.deliveryMethod){if(!this.canProceedToShipping)return this.isErrorsVisible=!0,[2]}else if(!this.canProceedToInStoreDelivery)return this.isErrorsVisible=!0,[2];this.isErrorsVisible=!1,e.label=1;case 1:return e.trys.push([1,6,,7]),this.isStepLoading=!0,"address"!==this.deliveryMethod?[3,3]:[4,this.saveAddress("shipping")];case 2:e.sent(),e.label=3;case 3:return[4,this.checkStocks()];case 4:return e.sent(),[4,this.saveCart()];case 5:return e.sent(),"address"===this.deliveryMethod?this.changeStep(T.SHIPPING):this.changeStep(T.PAYMENT),[3,7];case 6:return void 0!==typeof(t=e.sent()).type?this.error=t:(console.log(t),this.error={type:G.UNKNOWN}),this.isStepLoading=!1,[3,7];case 7:return[2]}}))}))},this.onProceedToDigitalOnlyPaymentClick=function(){return t(H,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:if(!this.canProceedToPayment)return this.isErrorsVisible=!0,[2];this.isErrorsVisible=!1,e.label=1;case 1:return e.trys.push([1,4,,5]),this.isStepLoading=!0,[4,this.checkStocks()];case 2:return e.sent(),[4,this.saveCart()];case 3:return e.sent(),this.changeStep(T.PAYMENT),[3,5];case 4:return(t=e.sent()).type?this.error=t:(console.log(t),this.error={type:G.UNKNOWN}),this.isStepLoading=!1,[3,5];case 5:return[2]}}))}))},this.onProceedToPaymentClick=function(){return t(H,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:if(!this.canProceedToPayment)return this.isErrorsVisible=!0,[2];this.isErrorsVisible=!1,e.label=1;case 1:return e.trys.push([1,4,,5]),this.isStepLoading=!0,[4,this.checkStocks()];case 2:return e.sent(),[4,this.saveCart()];case 3:return e.sent(),this.error=void 0,this.changeStep(T.PAYMENT),[3,5];case 4:return void 0!==typeof(t=e.sent()).type?this.error=t:(console.log(t),this.error={type:G.UNKNOWN}),this.isStepLoading=!1,[3,5];case 5:return[2]}}))}))},this.checkPaypalButtonAvailable=function(){return!!H.canPerformPayment||(H.isErrorsVisible=!0,!1)},this.onCompletePaymentClick=function(){return t(H,void 0,void 0,(function(){var t,i;return e(this,(function(e){switch(e.label){case 0:return this.canPerformPayment?(this.useDifferentAddress||(this.checkout.billingAddress=this.checkout.shippingAddress),this.isKlarna?[4,this.saveCart()]:[3,2]):(this.isErrorsVisible=!0,[2]);case 1:return e.sent(),this.setIsKlarnaPaymentCompleted(!0),[2];case 2:return e.trys.push([2,8,,9]),this.isErrorsVisible=!1,this.isStepLoading=!0,[4,this.checkStocks()];case 3:return e.sent(),"address"===this.deliveryMethod&&this.useDifferentAddress?[4,this.saveAddress("billing")]:[3,5];case 4:e.sent(),e.label=5;case 5:return[4,this.saveCart()];case 6:return e.sent(),this.isCustomFlowStripe?((t=document.querySelector("#stripe-form-btn"))&&t.click(),[2]):this.isAdyen?(this.adyenDropinElement.submit(),this.adyenDropinElement.isValid||(this.isStepLoading=!1),[2]):this.isPayPal?[2]:[4,this.createSaleTransaction()];case 7:return e.sent(),[3,9];case 8:return void 0!==typeof(i=e.sent()).type?this.error=i:this.error={type:G.UNKNOWN},this.isStepLoading=!1,[3,9];case 9:return[2]}}))}))},this.onCompleteDigitalOnlyPaymentClick=function(){return t(H,void 0,void 0,(function(){var t,i;return e(this,(function(e){switch(e.label){case 0:return!this.canProceedToPayment||this.checkoutSettings.showTermsAndConditionsCheckbox&&!this.isTermsAndConditionsChecked?(this.isErrorsVisible=!0,[2]):this.isKlarna?[4,this.saveCart()]:[3,2];case 1:return e.sent(),this.setIsKlarnaPaymentCompleted(!0),[2];case 2:return e.trys.push([2,6,,7]),this.isErrorsVisible=!1,this.isStepLoading=!0,[4,this.checkStocks()];case 3:return e.sent(),[4,this.saveCart()];case 4:return e.sent(),this.isCustomFlowStripe?((t=document.querySelector("#stripe-form-btn"))&&t.click(),[2]):this.isAdyen?(this.adyenDropinElement.submit(),this.adyenDropinElement.isValid||(this.isStepLoading=!1),[2]):this.isPayPal?[2]:[4,this.createSaleTransaction()];case 5:return e.sent(),[3,7];case 6:return(i=e.sent()).type?this.error=i:this.error={type:G.UNKNOWN},this.isStepLoading=!1,[3,7];case 7:return[2]}}))}))},this.createSaleTransaction=function(){return t(H,void 0,void 0,(function(){var t,i,s,n,r,c,d,l,h,p,m,f,g,v,y;return e(this,(function(e){switch(e.label){case 0:return(i=this.mpVM.selectedCard)&&(null===(l=this.mpVM.selectedCard)||void 0===l?void 0:l.Name)?((n=this.mpVM.phoneNumber({store:this.store,checkout:this.checkout}))&&(t=n),void 0===(null===(h=this.cardData)||void 0===h?void 0:h.installmentCount)?[2]:[4,C.createSaleTransactionWithCart({input:{cartId:this.checkout.id,masterPassDetail:{phoneNumber:t,savedCardName:null===(p=this.mpVM.selectedCard)||void 0===p?void 0:p.Name},paymentGatewayId:null===(m=this.mpVM.selectedCard)||void 0===m?void 0:m.paymentGatewayId,paymentMethodDetail:{cardNumber:this.mpVM.selectedCard.Value1,cardHolderName:this.mpVM.selectedCard.Name,cvv:this.mpVM.selectedCard.Value2,expiredMonth:11,expiredYear:11,installmentCount:this.cardData.installmentCount,threeDSecure:!!(null===(f=this.cardData)||void 0===f?void 0:f.threeDSecure)}}})]):[3,2];case 1:return s=e.sent(),[3,4];case 2:return this.checkout.selectedPaymentGateway?[4,C.createSaleTransactionWithCart({input:{cartId:this.checkout.id,masterPassDetail:i&&t?{phoneNumber:t,savedCardName:null===(g=this.mpVM.selectedCard)||void 0===g?void 0:g.Name}:void 0,paymentGatewayId:this.checkout.selectedPaymentGateway.id,paymentMethodDetail:i?void 0:this.checkout.selectedPaymentGateway.paymentMethodType===o.CREDIT_CARD&&this.checkout.selectedPaymentGateway.type===a.INTERNAL&&this.cardData?this.cardData.toInput():void 0}})]:[2];case 3:s=e.sent(),e.label=4;case 4:return r=null===(v=null==s?void 0:s.data)||void 0===v?void 0:v.transactionStatus,c=r&&[u.SUCCESS,u.AUTHORIZED].includes(r),d=r===u.PENDING,c?[4,this.getSuccessTransaction()]:[3,7];case 5:return e.sent(),[4,this.onCheckoutTransactionSuccess()];case 6:return e.sent(),[3,8];case 7:if(!d||!(null===(y=null==s?void 0:s.data)||void 0===y?void 0:y.returnSlug))throw{data:s.firstErrorMessage,type:G.UNKNOWN};window.location.href=process.env.NEXT_PUBLIC_BASE_URL+s.data.returnSlug,e.label=8;case 8:return[2]}}))}))},this.onCheckoutTransactionSuccess=function(){return t(H,void 0,void 0,(function(){var t,i;return e(this,(function(e){switch(e.label){case 0:return localStorage.removeItem("sAddr"),(null===(t=this.checkout.customer)||void 0===t?void 0:t.notificationsAccepted)?[4,this.store.customerStore.createEmailSubscription((null===(i=this.checkout.customer)||void 0===i?void 0:i.email)||"")]:[3,2];case 1:e.sent(),e.label=2;case 2:return this.changeStep(T.SUCCESS),[2]}}))}))},this.onBackToInfoClick=function(){H.changeStep(T.INFO)},this.onBackToShippingClick=function(){H.changeStep(T.SHIPPING)},this.setCustomerConsentGranted=function(t){H.checkout.customer&&(H.checkout.customer.notificationsAccepted=t)},this.setUseDifferentAddress=function(t){H.useDifferentAddress=t,H.useDifferentAddress?(localStorage.setItem("sAddr","1"),H.checkout.billingAddress=H.checkout.billingAddress||new D,H.checkout.billingAddress.countrySettings=H.countrySettings):(localStorage.removeItem("sAddr"),H.checkout.billingAddress=H.checkout.shippingAddress)},this.setShouldSaveAddress=function(t){H.shouldSaveAddress=t},this.setAddressTitle=function(t){H.addressTitle=t},this.setPaymentGateway=function(i){return t(H,void 0,void 0,(function(){var t,s,n;return e(this,(function(e){switch(e.label){case 0:return this.paymentGateways.length?"STRIPE"!==(t=this.paymentGateways[i]).code||!(null===(n=t.settings)||void 0===n?void 0:n.find((function(t){return"allow_custom_flow"===t.label&&"1"===t.value})))||this.stripeResponse?[3,2]:[4,C.createStripePaymentIntent({input:{cartId:this.checkout.id,paymentGatewayId:t.id||""}})]:[2];case 1:(s=e.sent()).isSuccess&&s.data&&(this.stripeResponse=s.data),e.label=2;case 2:return"KLARNA"!==t.code||this.klarnaResponse?[3,4]:[4,C.createKlarnaClientToken({input:{cartId:this.checkout.id,paymentGatewayId:t.id||""}})];case 3:(s=e.sent()).isSuccess&&s.data&&(this.klarnaResponse=s.data),e.label=4;case 4:return"ADYEN"!==t.code||this.adyenResponse?[3,6]:[4,C.createAdyenClientToken({input:{cartId:this.checkout.id,paymentGatewayId:t.id||""}})];case 5:(s=e.sent()).isSuccess&&s.data&&(this.adyenResponse=s.data),e.label=6;case 6:return"PAYPAL"!==t.code||this.payPalClientIdResponse?[3,8]:[4,C.getPayPalClientId({input:{cartId:this.checkout.id,paymentGatewayId:t.id||""}})];case 7:(s=e.sent()).isSuccess&&s.data&&(this.payPalClientIdResponse=s.data),e.label=8;case 8:return this.checkout.selectedPaymentGateway=t,this.step!==T.SUCCESS&&(t.paymentMethodType===o.CREDIT_CARD&&t.type===a.INTERNAL&&(this.cardData=new k,t.masterPassClientId&&(console.log("called 1511 ikas log"),this.mpVM.checkMasterPass({checkout:this.checkout,store:this.store}))),this.installmentInfo=void 0),[2]}}))}))},this.setInstallmentCount=function(t){H.cardData&&(H.cardData.installmentCount=t)},this.changeStep=function(i){return t(H,void 0,void 0,(function(){return e(this,(function(t){return M||window.location.replace("".concat(window.location.pathname,"?id=").concat(this.checkout.id,"&step=").concat(i)),[2]}))}))},this.logout=function(){return t(H,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:this.checkout.customer=null,this.store.customerStore.logout(),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,this.saveCart()];case 2:case 3:return t.sent(),[3,4];case 4:return this.createCustomer(),[2]}}))}))},this.setContactModalVisible=function(t){H.isContactModalVisible=t},this.getCampaignOfferProducts=function(i){return t(H,void 0,void 0,(function(){var t,s,n,r;return e(this,(function(o){switch(o.label){case 0:if(!this.checkout.campaignOffers||!this.checkout.campaignOffers.length)return[3,4];if(t=this.checkout.campaignOffers.filter((function(t){var e;return t.status===l.WAITING_FOR_ACTION&&(null===(e=t.campaignOffer)||void 0===e?void 0:e.targetPageTypes.some((function(t){return t===i})))})),!t.length)return[3,4];s=function(i){var s,n,r,o,a;return e(this,(function(e){switch(e.label){case 0:return(s=t[i]).campaignOffer&&(n=s.campaignOffer.offers.find((function(t){return t.id===s.campaignOfferProductId})))?[4,N.searchProducts({input:{productIdList:[n.productId]}})]:[3,2];case 1:if((r=e.sent()).isSuccess&&r.data&&r.data.data&&r.data.data.length&&(o=r.data.data[0],a=[],n.excludedVariantIdList&&n.excludedVariantIdList.length?o.variants.map((function(t){var e;t.hasStock&&!(null===(e=n.excludedVariantIdList)||void 0===e?void 0:e.some((function(e){return e===t.id})))&&a.push(t)})):a.push.apply(a,o.variants.filter((function(t){return t.hasStock}))),a.length))return[2,{value:{product:new y(o),variants:a,campaignOffer:s,offer:n}}];e.label=2;case 2:return[2]}}))},n=0,o.label=1;case 1:return n<t.length?[5,s(n)]:[3,4];case 2:if("object"==typeof(r=o.sent()))return[2,r.value];o.label=3;case 3:return n++,[3,1];case 4:return[2,void 0]}}))}))},this.getCampaignOffer=function(){return t(H,void 0,void 0,(function(){var t,i;return e(this,(function(e){switch(e.label){case 0:return t=this,[4,this.getCampaignOfferProducts(h.CHECKOUT)];case 1:return t.checkoutCampaignOffer=e.sent(),i=this,[4,this.getCampaignOfferProducts(h.POST_CHECKOUT)];case 2:return i.postCheckoutCampaignOffer=e.sent(),[2]}}))}))},this.updateCartCampaignOffer=function(i){return t(H,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return this.isCheckoutLoaded=!1,[4,P.updateCartCampaignOffer({input:i})];case 1:return(t=e.sent())&&t.isSuccess&&t.data&&(this.checkout=new p(t.data,this.countrySettings),i.accepted&&this.step===T.SUCCESS?this.changeStep(T.INFO):this.changeStep(this.step)),[2]}}))}))},this.registerCustomer=function(i){return t(H,void 0,void 0,(function(){var t,s,n,r;return e(this,(function(e){switch(e.label){case 0:return this.checkout.customer?(t=this.checkout.customer,s=t.firstName,n=t.lastName,r=t.email,s&&n&&r?[4,b.register({orderId:this.checkout.id,firstName:s,lastName:n,email:r,password:i})]:[3,2]):[3,2];case 1:return[2,e.sent()];case 2:return[2]}}))}))},this.checkout=c,this.checkoutSettings=d,this.router=f,this.returnPolicy=g,this.privacyPolicy=L,this.termsOfService=_,this.imprint=K,this.shippingPolicy=F,this.t=Y,this.customizationProps=B,this.mpVM=new I,this.isTermsAndConditionsChecked=this.checkoutSettings.isTermsAndConditionsDefaultChecked||!1,this.countrySettings=new S({currentLocale:E.getCurrentLocale()}),this.init(),s(this)}return Object.defineProperty(L.prototype,"merchantSettings",{get:function(){return new g(E.getMerchantSettings())},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"selectedPaymentGatewayIndex",{get:function(){var t=this;return this.paymentGateways.findIndex((function(e){var i;return e.id===(null===(i=t.checkout.selectedPaymentGateway)||void 0===i?void 0:i.id)}))},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"selectedInstallmentIndex",{get:function(){var t,e,i=this;return(null===(e=null===(t=this.installmentInfo)||void 0===t?void 0:t.installmentPrices)||void 0===e?void 0:e.findIndex((function(t){var e;return t.installmentCount===(null===(e=i.cardData)||void 0===e?void 0:e.installmentCount)})))||0},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"checkoutUrl",{get:function(){return"/checkout?id=".concat(this.checkout.id,"&step=info")},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"customerAddressOptions",{get:function(){var t,e,i={label:this.t("checkout-page:newAddress"),value:"-1"},s=(null===(e=null===(t=O.getInstance().customerStore.customer)||void 0===t?void 0:t.addresses)||void 0===e?void 0:e.map((function(t){return{label:t.title+" - "+t.addressText,value:t.id}})))||[];return[i].concat(s)},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"installmentPrice",{get:function(){var t,e,i,s=this;if(this.installmentInfo&&(null===(t=this.cardData)||void 0===t?void 0:t.installmentCount))return null===(i=null===(e=this.installmentInfo.installmentPrices)||void 0===e?void 0:e.find((function(t){var e;return t.installmentCount===(null===(e=s.cardData)||void 0===e?void 0:e.installmentCount)})))||void 0===i?void 0:i.totalPrice},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"installmentExtraPrice",{get:function(){if(this.installmentPrice&&this.checkout.totalFinalPrice)return this.installmentPrice-this.checkout.totalFinalPrice},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"finalPrice",{get:function(){return this.step===T.SUCCESS?this.checkout.totalFinalPrice:this.installmentPrice||this.checkout.$totalFinalPrice},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"hasStockError",{get:function(){var t;return(null===(t=this.error)||void 0===t?void 0:t.type)===G.STOCK_ERROR},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"isPaymentGatewayHasMasterPass",{get:function(){return-1!==this.selectedPaymentGatewayIndex&&(!!this.paymentGateways.length&&!!this.paymentGateways[this.selectedPaymentGatewayIndex].masterPassClientId)},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"hasQuickRegistration",{get:function(){return this.checkoutSettings.isQuickRegistrationEnabled&&this.checkout.customer&&this.checkout.customer.isGuestCheckout},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"canProceedToShipping",{get:function(){var t,e,i;return(this.isDigitalOnly?null===(t=this.checkout.billingAddress)||void 0===t?void 0:t.isValidAddress:null===(e=this.checkout.shippingAddress)||void 0===e?void 0:e.isValidAddress)&&this.checkout.hasValidCustomerEmail&&(null===(i=this.error)||void 0===i?void 0:i.type)!==G.NO_SHIPPING_ERROR},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"canProceedToInStoreDelivery",{get:function(){var t,e,i;return!!((null===(t=this.checkout.shippingAddress)||void 0===t?void 0:t.firstName)&&(null===(e=this.checkout.shippingAddress)||void 0===e?void 0:e.lastName)&&(null===(i=this.checkout.customer)||void 0===i?void 0:i.email)&&this.checkout.stockLocationId)},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"canProceedToPayment",{get:function(){return this.canProceedToShipping},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"isInStoreDelivery",{get:function(){return!!this.checkout.stockLocationId},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"klarnaPaymentGateway",{get:function(){var t=this.paymentGateways.findIndex((function(t){return"KLARNA"===t.code}));if(-1!==t)return this.paymentGateways[t]},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"klarnaPaymentGatewayIndex",{get:function(){return this.paymentGateways.findIndex((function(t){return"KLARNA"===t.code}))},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"adyenPaymentGateway",{get:function(){var t=this.paymentGateways.findIndex((function(t){return"ADYEN"===t.code}));if(-1!==t)return this.paymentGateways[t]},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"adyenPaymentGatewayIndex",{get:function(){return this.paymentGateways.findIndex((function(t){return"ADYEN"===t.code}))},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"payPalPaymentGateway",{get:function(){var t=this.paymentGateways.findIndex((function(t){return"PAYPAL"===t.code}));if(-1!==t)return this.paymentGateways[t]},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"payPalPaymentGatewayIndex",{get:function(){return this.paymentGateways.findIndex((function(t){return"PAYPAL"===t.code}))},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"isCustomFlowStripe",{get:function(){var t,e=this.checkout.selectedPaymentGateway;return e&&"STRIPE"===e.code&&(null===(t=e.settings)||void 0===t?void 0:t.find((function(t){return"allow_custom_flow"===t.label&&"1"===t.value})))},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"isKlarna",{get:function(){var t=this.checkout.selectedPaymentGateway;return t&&"KLARNA"===t.code},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"isAdyen",{get:function(){var t=this.checkout.selectedPaymentGateway;return t&&"ADYEN"===t.code},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"isPayPal",{get:function(){var t=this.checkout.selectedPaymentGateway;return t&&"PAYPAL"===t.code},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"store",{get:function(){return O.getInstance()},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"canPerformPayment",{get:function(){var t,e;if(this.checkoutSettings.showTermsAndConditionsCheckbox&&!this.isTermsAndConditionsChecked)return!1;var i=this.checkout.selectedPaymentGateway,s=!!("in-store"===this.deliveryMethod)||!!this.canProceedToShipping,n=!!(null===(t=this.checkout.billingAddress)||void 0===t?void 0:t.isValidAddress),r=!!this.mpVM.selectedCard||((null==i?void 0:i.paymentMethodType)===o.CREDIT_CARD&&i.type===a.INTERNAL?!!this.isCustomFlowStripe||(!(!this.isKlarna&&!this.isPayPal)||(null===(e=this.cardData)||void 0===e?void 0:e.isValid)):!!i);return s&&n&&r},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"isDigitalOnly",{get:function(){return this.checkout.shippingMethod===c.DIGITAL_DELIVERY},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"customerAddresses",{get:function(){var t,e,s=this;return null===(e=null===(t=this.store.customerStore.customer)||void 0===t?void 0:t.addresses)||void 0===e?void 0:e.map((function(t){var e=new f(i({countrySettings:s.countrySettings},t));return e.checkoutSettings=s.checkoutSettings,e}))},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"isManualOrder",{get:function(){return this.checkout.createdBy===d.ADMIN},enumerable:!1,configurable:!0}),L.prototype.setAdyenDropinElement=function(t){this.adyenDropinElement=t},L}();function V(t,e){return t.match(new RegExp(".{1,"+e+"}","g"))||[]}function U(t){return t&&L.test(t.charAt(t.length-1))}!function(t){t.INFO="info",t.SHIPPING="shipping",t.PAYMENT="payment",t.SUCCESS="success"}(T||(T={})),function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.API_ERROR=1]="API_ERROR",t[t.STOCK_ERROR=2]="STOCK_ERROR",t[t.PAYMENT_ERROR=3]="PAYMENT_ERROR",t[t.NO_SHIPPING_ERROR=4]="NO_SHIPPING_ERROR",t[t.CUSTOMER_LOGIN_REQUIRED_ERROR=5]="CUSTOMER_LOGIN_REQUIRED_ERROR"}(G||(G={}));export{T as CheckoutStep,G as ErrorType,_ as default};
|
|
1
|
+
import{__awaiter as t,__generator as e,__assign as i}from'./../../ext/tslib/tslib.es6.js';import{makeAutoObservable as s}from"mobx";import n from"lodash/cloneDeep";import r from"lodash/sortBy";import"../../models/data/blog/category/index.js";import"../../models/data/blog/content/index.js";import"../../models/data/blog/meta-data/index.js";import"../../models/data/blog/tag/index.js";import"../../models/data/blog/index.js";import"../../models/data/brand/index.js";import{IkasPaymentMethodType as o,IkasPaymentGatewayType as a,IkasOrderShippingMethod as c,IkasCartCreatedBy as d,IkasTransactionStatus as u,IkasCartCampaignOfferStatus as l,IkasCampaignOfferTargetPageType as h}from"@ikas/storefront-models";import"../../models/data/campaign-offer/index.js";import"../../models/data/cart/campaign-offer/index.js";import"../../models/data/cart/index.js";import"../../models/data/category/path-item/index.js";import"../../models/data/category/index.js";import{IkasCheckout as p}from"../../models/data/checkout/index.js";import"../../models/data/checkout-settings/index.js";import"../../models/data/city/index.js";import"../../models/data/country/index.js";import{IkasCustomerAddress as m}from"../../models/data/customer/address/index.js";import{IkasLocalizedCustomerAddress as f}from"../../models/data/customer/address/ikas-localized-customer-address.js";import"../../models/data/customer/attribute/index.js";import"../../models/data/customer/review/summary/index.js";import"../../models/data/customer/review/index.js";import"../../models/data/customer/index.js";import"../../models/data/district/index.js";import"../../models/data/favorite-product/index.js";import"../../models/data/filter-category/index.js";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import{IkasMerchantSettings as g}from"../../models/data/merchant-settings/index.js";import"../../models/data/order/address/index.js";import{IkasOrderCustomer as v}from"../../models/data/order/customer/index.js";import"../../models/data/order/line-item/option/value/index.js";import"../../models/data/order/line-item/variant/value/index.js";import"../../models/data/order/line-item/variant/index.js";import"../../models/data/order/line-item/index.js";import"../../models/data/order/package/index.js";import"../../models/data/order/transaction/index.js";import"../../models/data/order/index.js";import"../../models/data/payment-gateway/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product/filter/index.js";import"../../models/data/product/option-set/option/index.js";import"../../models/data/product/option-set/index.js";import"../../models/data/product/stock-location/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/variant-type/index.js";import{IkasProduct as y}from"../../models/data/product/index.js";import"../../models/data/raffle/index.js";import"../../models/data/state/index.js";import"../../models/data/theme-json/index.js";import"../../models/data/theme-json/custom-data/index.js";import"../../models/data/variant-type/variant-value/index.js";import{LocalizedAddressModel as S}from"@ikas/localized-address";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-list/index.js";import"../../models/ui/product-attribute-detail/index.js";import"../../models/ui/product-attribute-list/index.js";import"../../models/ui/customer-review-list/index.js";import"../../models/ui/customer-review-summary-list/index.js";import"../../models/ui/validator/index.js";import"../../models/ui/validator/rules/index.js";import"../../models/ui/validator/form/login.js";import"../../models/ui/validator/form/address.js";import"../../models/ui/validator/form/ikas-address.js";import"../../models/ui/validator/form/register.js";import"../../models/ui/validator/form/contact-form.js";import"../../models/ui/validator/form/forgot-password.js";import"../../models/ui/validator/form/recover-password.js";import"../../models/ui/validator/form/account-info.js";import"../../models/ui/validator/form/raffle-form.js";import"../../models/ui/validator/form/customer-review.js";import"../../models/ui/raffle-list/index.js";import k from"./components/credit-card-form/model.js";import b from"../../store/customer/api.js";import C from"../../store/checkout/index.js";import P from"../../store/cart/api.js";import I,{MFS_ELEMENT_ID as A,MFS_SCRIPT_URL as w}from"./modelMasterPass.js";import N from"../../store/product/index.js";import{IkasBaseStore as E}from"../../store/base.js";import"../../store/customer/index.js";import"../../store/cart/index.js";import{IkasStorefrontConfig as O}from"@ikas/storefront-config";import{Analytics as j}from"../../analytics/analytics.js";import"../../analytics/head/index.js";import{SaveCartInput as R,CheckStocksLineInput as x}from"@ikas/storefront-api";import D from"../../models/data/order/address/ikas-localized-order-address.js";var T,G,L=/^\d+$/,M="undefined"==typeof localStorage,_=function(){function L(c,d,f,g,L,_,K,F,Y,B){var H=this;this.storefront=null,this.isCheckoutLoaded=!1,this.isErrorsVisible=!1,this.isStepLoading=!1,this.isTermsAndConditionsChecked=!1,this.isChangingShippingMethod=!1,this.isContactModalVisible=!1,this.isEPayKolayPayment=!1,this.step=T.INFO,this.customizationProps=null,this.cardData=null,this.paymentGateways=[],this.installmentInfo=null,this.useDifferentAddress=!1,this.shouldSaveAddress=!0,this.addressTitle="",this.shippingCountryIds=null,this.selectedShippingAddressId="-1",this.selectedBillingAddressId="-1",this.stockLocations=[],this.availableStockLocations=[],this.deliveryMethod="address",this.stripeResponse=null,this.klarnaResponse=null,this.isKlarnaPaymentCompleted=!1,this.adyenResponse=null,this.payPalClientIdResponse=null,this.paypalOrderResponse=null,this.policyModalTitle="",this.policyModalText="",this.error=null,this.couponError=null,this.showTestModal=!1,this.init=function(){return t(H,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:return[4,this.countrySettings.waitUntilInitialized()];case 1:return t.sent(),[4,E.getInstance().customerStore.waitUntilInitialized()];case 2:return t.sent(),this.createCustomer(),this.createShippingAddress(),this.createBillingAddress(),[4,this.getCampaignOffer()];case 3:return t.sent(),[4,this.initStep()];case 4:return t.sent(),[2]}}))}))},this.initStep=function(){return t(H,void 0,void 0,(function(){var t,i,s,n,r,o,a;return e(this,(function(e){switch(e.label){case 0:if(O.getIsEditor())return this.step=T.INFO,this.isCheckoutLoaded=!0,[2];if(t=new URLSearchParams(window.location.search),i=t.get("step"),s=t.get("failed"),n=t.get("error"),i){if(this.step=i,this.step===T.SHIPPING&&!this.canProceedToShipping)return[2,this.changeStep(T.INFO)];if(this.step!==T.PAYMENT||this.canProceedToPayment){if(this.step===T.SUCCESS&&!this.canProceedToPayment)return[2,this.changeStep(T.INFO)];if(![T.INFO,T.SUCCESS,T.SHIPPING,T.PAYMENT].includes(this.step))return[2,this.changeStep(T.INFO)]}else{if(!this.isInStoreDelivery)return[2,this.changeStep(T.INFO)];this.deliveryMethod="in-store"}}return s&&(this.error={type:G.PAYMENT_ERROR,data:n||null}),this.step!==T.INFO?[3,4]:[4,this.getShippingCountries()];case 1:return e.sent(),this.checkShippingCountries(),[4,this.getStockLocations()];case 2:return e.sent(),[4,this.getAvailableStockLocations()];case 3:e.sent(),this.isInStoreDelivery&&(this.deliveryMethod="in-store"),e.label=4;case 4:return this.step!==T.SHIPPING||1!==(null===(o=this.checkout.availableShippingMethods)||void 0===o?void 0:o.length)||this.checkoutSettings.isGiftPackageEnabled||(this.step=T.PAYMENT,this.router.replace("/checkout?id=".concat(this.checkout.id,"&step=").concat(this.step),void 0,{shallow:!0})),this.step!==T.SHIPPING||(null===(a=this.checkout.availableShippingMethods)||void 0===a?void 0:a.length)?this.step!==T.PAYMENT&&this.step!==T.SUCCESS?[3,8]:[4,this.listPaymentGateways()]:(this.error={type:G.NO_SHIPPING_ERROR},this.isCheckoutLoaded=!0,[2]);case 5:return e.sent(),this.isInStoreDelivery?(this.deliveryMethod="in-store",[4,this.getStockLocations()]):[3,7];case 6:e.sent(),e.label=7;case 7:if(!this.paymentGateways.length)return this.error={type:G.NO_SHIPPING_ERROR},this.isCheckoutLoaded=!0,[2];e.label=8;case 8:return this.step===T.SUCCESS?[3,12]:this.checkout.isComplete?[2,this.changeStep(T.SUCCESS)]:[3,9];case 9:return[4,this.initialStockCheck()];case 10:e.sent(),e.label=11;case 11:return[3,14];case 12:return[4,this.getSuccessTransaction()];case 13:e.sent(),this.successTransaction&&(r=this.successTransaction.paymentGatewayId,this.checkout.selectedPaymentGateway=this.paymentGateways.find((function(t){return t.id===r}))),e.label=14;case 14:return this.isCheckoutLoaded=!0,j.checkoutStep(this.checkout,this.step),[2]}}))}))},this.getSuccessTransaction=function(){return t(H,void 0,void 0,(function(){var t,i;return e(this,(function(e){switch(e.label){case 0:return[4,b.listOrderTransactions({orderId:{eq:this.checkout.id}})];case 1:return t=e.sent(),this.successTransaction=t.isSuccess&&(null===(i=t.data)||void 0===i?void 0:i.length)?t.data[t.data.length-1]:void 0,[2]}}))}))},this.saveCart=function(){return t(H,void 0,void 0,(function(){var t,i,s,n;return e(this,(function(e){switch(e.label){case 0:return t=new R(this.checkout),"in-store"!==this.deliveryMethod?[3,2]:[4,this.inStockDeliveryInputData(t)];case 1:t=e.sent(),e.label=2;case 2:return this.step!==T.INFO&&this.step!==T.SHIPPING||this.isDigitalOnly||(t.billingAddress=null),this.isDigitalOnly&&(t.shippingAddress=null),[4,P.saveCart({input:t})];case 3:if((null==(i=e.sent())?void 0:i.graphQLErrors)&&i.graphQLErrors.length)throw s=i.graphQLErrors[0],"CUSTOMER_LOGIN_REQUIRED"===(null===(n=s.extensions)||void 0===n?void 0:n.code)?{type:G.CUSTOMER_LOGIN_REQUIRED_ERROR}:{type:G.API_ERROR,data:i.firstErrorMessage};return[2,i.data]}}))}))},this.inStockDeliveryInputData=function(i){return t(H,void 0,void 0,(function(){var t,s,n=this;return e(this,(function(e){return t=i,(s=this.stockLocations.find((function(t){return t.id===n.checkout.stockLocationId})))&&t.shippingAddress&&s.address&&(t.shippingAddress.country=s.address.country,t.shippingAddress.city=s.address.city,t.shippingAddress.state=s.address.state,t.shippingAddress.district=s.address.district,t.shippingAddress.postalCode=s.address.postalCode,t.shippingAddress.addressLine1=s.address.address||"",t.shippingAddress.addressLine2=null),[2,t]}))}))},this.checkStocks=function(){return t(H,void 0,void 0,(function(){var t,i,s,n,r,o,a,c,d,u,l,h;return e(this,(function(e){switch(e.label){case 0:return this.isManualOrder?[2]:(t=this.checkout.items.map((function(t){return{quantity:t.quantity,variantId:t.variant.id,productId:t.variant.productId}})),[4,C.checkStocks({lines:t.map((function(t){return new x(t)})),stockLocationIdList:(null===(u=O.getStockLocationIds())||void 0===u?void 0:u.length)?O.getStockLocationIds():null})]);case 1:if(!(i=e.sent()).isSuccess)throw{type:G.API_ERROR,data:i.firstErrorMessage};if(null==(s=null===(h=null===(l=i.data)||void 0===l?void 0:l.lines)||void 0===h?void 0:h.filter((function(t){return!t.isAvailable})))?void 0:s.length){for(n=[],r=function(t){var e=o.checkout.items.find((function(e){return e.variant.id===t.variantId}));e&&n.push({item:e,stockCount:t.stockCount})},o=this,a=0,c=s;a<c.length;a++)d=c[a],r(d);throw{type:G.STOCK_ERROR,data:n}}return[2]}}))}))},this.setIsKlarnaPaymentCompleted=function(i){return t(H,void 0,void 0,(function(){return e(this,(function(t){return this.isKlarnaPaymentCompleted=i,[2]}))}))},this.removeUnavailableItems=function(i){return t(H,void 0,void 0,(function(){var t,s,n;return e(this,(function(e){switch(e.label){case 0:t=0,s=i,e.label=1;case 1:return t<s.length?(n=s[t],[4,E.getInstance().cartStore.changeItemQuantity(n.item,n.stockCount<0?0:n.stockCount)]):[3,4];case 2:e.sent(),e.label=3;case 3:return t++,[3,1];case 4:return[2]}}))}))},this.getShippingCountries=function(){return t(H,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return[4,C.getAvailableShippingCountries({salesChannelId:O.getSalesChannelId()})];case 1:return t=e.sent(),this.shippingCountryIds=t.data,[2]}}))}))},this.getStockLocations=function(){return t(H,void 0,void 0,(function(){var t,i;return e(this,(function(e){switch(e.label){case 0:return O.getPickupStockLocationIds()?[4,C.listStockLocation({id:{in:O.getPickupStockLocationIds()}})]:[3,2];case 1:if(!(t=e.sent()).isSuccess||!(null===(i=t.data)||void 0===i?void 0:i.length))return this.error={type:G.API_ERROR,data:t.firstErrorMessage},[2];this.stockLocations=t.data,e.label=2;case 2:return[2]}}))}))},this.getAvailableStockLocations=function(){return t(H,void 0,void 0,(function(){var t,i;return e(this,(function(e){switch(e.label){case 0:return O.getPickupStockLocationIds()?(t=this.checkout.items.map((function(t){return{quantity:t.quantity,variantId:t.variant.id,productId:t.variant.productId}})),[4,C.getAvailableStockLocations({lines:t.map((function(t){return new x(t)})),stockLocationIdList:O.getPickupStockLocationIds()})]):[3,2];case 1:if(!(i=e.sent()).isSuccess)return this.error={type:G.API_ERROR},[2];this.availableStockLocations=i.data||[],e.label=2;case 2:return[2]}}))}))},this.checkShippingCountries=function(){var t;(null===(t=H.shippingCountryIds)||void 0===t?void 0:t.length)||(H.error={type:G.NO_SHIPPING_ERROR})},this.onDeliveryMethodChange=function(t){"address"===t&&(H.checkout.stockLocationId=null),H.deliveryMethod=t,H.isErrorsVisible=!1},this.initialStockCheck=function(){return t(H,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,this.checkStocks()];case 1:return e.sent(),[3,3];case 2:return void 0!==typeof(t=e.sent()).type?this.error=t:(console.log(t),this.error={type:G.UNKNOWN}),[3,3];case 3:return[2]}}))}))},this.listPaymentGateways=function(){return t(H,void 0,void 0,(function(){var t,i,s,n,o,a,c,d,u,l,h=this;return e(this,(function(e){switch(e.label){case 0:return t="local"===process.env.NEXT_PUBLIC_ENV,i=O.getPaymentGateways().map((function(t){return t.id})),[4,C.listPaymentGateway({id:t?void 0:{in:i},locale:O.getCurrentLocale(),transactionAmount:this.checkout.totalFinalPrice})];case 1:return(s=e.sent()).isSuccess&&(null===(u=s.data)||void 0===u?void 0:u.length)?(n=s.data,this.step===T.PAYMENT&&(n=n.filter((function(t){var e;return!(null===(e=t.supportedCurrencies)||void 0===e?void 0:e.length)||t.supportedCurrencies.includes(h.checkout.currencyCode)})),(o=null===(l=this.checkout.shippingAddress)||void 0===l?void 0:l.country)&&o.iso2&&(n=n.filter((function(t){var e;return!(null===(e=t.availableCountries)||void 0===e?void 0:e.length)||t.availableCountries.includes(o.iso2||"")})))),a=[],r(O.getPaymentGateways(),"order").forEach((function(t){var e=null==n?void 0:n.find((function(e){return e.id===t.id}));e&&a.push(e)})),this.paymentGateways=t?n:a,this.checkout.selectedPaymentGateway||this.setPaymentGateway(0),this.step===T.PAYMENT&&(c=n.find((function(t){return!!t.masterPassClientId})))&&(this.checkout.masterPassPaymentGateway=c,(d=document.createElement("script")).id=A,d.src=w,d.onload=function(){h.mpVM.checkMasterPass({checkout:h.checkout,store:E.getInstance()})},document.head.appendChild(d)),[2]):(this.error={type:G.API_ERROR,data:s.firstErrorMessage},[2])}}))}))},this.retrieveInstallmentInfo=function(i){return t(H,void 0,void 0,(function(){var t,s,n;return e(this,(function(e){switch(e.label){case 0:return[4,C.retrieveInstallmentInfo(i)];case 1:return t=e.sent(),s=t.data,null===(n=null==s?void 0:s.installmentPrices)||void 0===n||n.sort((function(t,e){return(t.installmentCount||-1)>(e.installmentCount||-1)?1:-1})),this.installmentInfo=s,[2]}}))}))},this.createCustomer=function(){var t;H.store.customerStore.customer?(null===(t=H.customerAddresses)||void 0===t||t.forEach((function(t){return t.checkoutSettings=H.checkoutSettings})),H.checkout.customer=new v(H.store.customerStore.customer)):H.checkout.customer=new v(H.checkout.customer||{})},this.setCheckoutShippingAddressSettings=function(){H.checkout.shippingAddress&&(H.checkout.shippingAddress.checkoutSettings=H.checkoutSettings,H.checkout.shippingAddress.countrySettings=H.countrySettings)},this.setCheckoutBillingAddressSettings=function(){H.checkout.billingAddress&&(H.checkout.billingAddress.checkoutSettings=H.checkoutSettings,H.checkout.billingAddress.countrySettings=H.countrySettings)},this.createShippingAddress=function(){if(!H.isDigitalOnly)if(H.isInStoreDelivery)H.setCheckoutShippingAddressSettings();else if(H.checkout.shippingAddress){if(H.store.customerStore.customer){var t=null==(e=H.customerAddresses)?void 0:e.find((function(t){var e;return t.id===(null===(e=H.checkout.shippingAddress)||void 0===e?void 0:e.id)}));if(t)return H.onSelectedShippingAddressIdChange(t.id||"-1"),void H.setCheckoutShippingAddressSettings()}H.checkout.shippingAddress=new D(n(H.checkout.shippingAddress)||{}),H.setCheckoutShippingAddressSettings()}else if(H.store.customerStore.customer){var e=H.customerAddresses;H.onSelectedShippingAddressIdChange((null==e?void 0:e.length)?e[0].id:"-1")}else H.onSelectedShippingAddressIdChange("-1")},this.createBillingAddress=function(){if("undefined"!=typeof localStorage)if(H.useDifferentAddress=!!localStorage.getItem("sAddr"),H.checkout.billingAddress){if(H.store.customerStore.customer){var t=null==(e=H.customerAddresses)?void 0:e.find((function(t){var e;return t.id===(null===(e=H.checkout.billingAddress)||void 0===e?void 0:e.id)}));if(t)return H.onSelectedBillingAddressIdChange(t.id||"-1"),void H.setCheckoutBillingAddressSettings()}H.checkout.billingAddress=new D(n(H.checkout.billingAddress)||{}),H.setCheckoutBillingAddressSettings()}else if(H.store.customerStore.customer){var e=H.customerAddresses;H.onSelectedBillingAddressIdChange((null==e?void 0:e.length)?e[0].id:"-1"),(null==e?void 0:e.length)||H.useDifferentAddress||!H.checkout.shippingAddress||H.isInStoreDelivery||(H.checkout.billingAddress=new D(n(H.checkout.shippingAddress)),H.setCheckoutBillingAddressSettings())}else H.onSelectedBillingAddressIdChange("-1"),H.useDifferentAddress||!H.checkout.shippingAddress||H.isInStoreDelivery||(H.checkout.billingAddress=new D(n(H.checkout.shippingAddress)),H.setCheckoutBillingAddressSettings())},this.onShippingMethodChange=function(i){return t(H,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return this.isChangingShippingMethod?[2]:(this.isChangingShippingMethod=!0,this.checkout.shippingSettingsId=i.shippingSettingsId,this.checkout.shippingZoneRateId=i.shippingZoneRateId,[4,this.saveCart()]);case 1:return(t=e.sent())&&(this.checkout=new p(t,this.countrySettings)),this.checkout.shippingAddress&&(this.checkout.shippingAddress.checkoutSettings=this.checkoutSettings),this.isChangingShippingMethod=!1,[2]}}))}))},this.onStockLocationChange=function(i){return t(H,void 0,void 0,(function(){return e(this,(function(t){return this.checkout.stockLocationId=i.id,[2]}))}))},this.onCouponCodeApply=function(){return t(H,void 0,void 0,(function(){var t,s,n,r,o,a;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,5,,6]),[4,P.saveCartCouponCode({cartId:this.checkout.id,couponCode:this.checkout.couponCode||null})];case 1:return(t=e.sent()).isSuccess&&t.data?(s=t.data,n=null===(a=null===(o=this.cardData)||void 0===o?void 0:o.cardNumber)||void 0===a?void 0:a.split(" ").join(""),this.couponError=null,this.step===T.PAYMENT&&(null==n?void 0:n.length)&&n.length>=6&&this.retrieveInstallmentInfo({input:{binNumber:n.slice(0,6),paymentGatewayId:this.checkout.selectedPaymentGateway.id,price:s.totalFinalPrice}}),this.mpVM.selectedCard&&this.mpVM.selectedCard.Value1?[4,this.retrieveInstallmentInfo({input:{binNumber:this.mpVM.selectedCard.Value1.slice(0,6),paymentGatewayId:this.mpVM.selectedCard.paymentGatewayId,price:s.totalFinalPrice}})]:[3,3]):[3,4];case 2:e.sent(),e.label=3;case 3:s&&(r=this.checkout,this.checkout=new p(i(i({},s),{shippingAddress:r.shippingAddress,billingAddress:r.billingAddress,customer:r.customer,selectedPaymentGateway:r.selectedPaymentGateway}),this.countrySettings)),e.label=4;case 4:return t.isSuccess||(this.couponError=t.errorCodes[0]),[3,6];case 5:return e.sent(),[3,6];case 6:return[2]}}))}))},this.onSelectedShippingAddressIdChange=function(t){var e;if(H.selectedShippingAddressId=t,"-1"===t)H.checkout.shippingAddress=new D,H.checkout.shippingAddress.countrySettings=H.countrySettings;else{var i=null===(e=H.customerAddresses)||void 0===e?void 0:e.find((function(e){return e.id===t}));i&&(H.checkout.shippingAddress=new D(i),H.checkout.shippingAddress.countrySettings=H.countrySettings)}H.checkout.shippingAddress&&(H.checkout.shippingAddress.checkoutSettings=H.checkoutSettings)},this.onSelectedBillingAddressIdChange=function(t){var e;if(H.selectedBillingAddressId=t,"-1"===t)H.checkout.billingAddress=new D,H.checkout.billingAddress.countrySettings=H.countrySettings;else{var i=null===(e=H.customerAddresses)||void 0===e?void 0:e.find((function(e){return e.id===t}));i&&(H.checkout.billingAddress=new D(i),H.checkout.billingAddress.countrySettings=H.countrySettings)}H.checkout.billingAddress&&(H.checkout.billingAddress.checkoutSettings=H.checkoutSettings)},this.onTermsAndConditionsCheckedChange=function(t){H.isTermsAndConditionsChecked=t},this.onCardNumberChange=function(t){if(H.cardData&&(!(t.length>H.cardData.cardNumber.length)||U(t))){var e=(H.cardData.cardNumber||"").split(" ").join(""),i=t.split(" ").join("");i.length>16||(e.length<6&&i.length>=6&&!H.installmentInfo?H.retrieveInstallmentInfo({input:{binNumber:i.slice(0,6),paymentGatewayId:H.checkout.selectedPaymentGateway.id,price:H.checkout.totalFinalPrice}}):i.length<6&&e.length>i.length&&(H.cardData.installmentCount=1,H.installmentInfo=void 0),H.cardData.cardNumber=V(i,4).join(" "))}},this.onCardHolderNameChange=function(t){H.cardData&&(H.cardData.cardHolderName=t)},this.onExpirationDateChange=function(t){var e;if(H.cardData&&(!(t.length>H.cardData.expirationDate.length)||U(t))){if(0===(null===(e=H.cardData.expirationDate)||void 0===e?void 0:e.length)){var i=t.replace(".","/").split("/");if(2===i.length){var s=i[0].trim(),n=i[1].trim();if(4===s.length&&2===n.length){var r=parseInt(s.slice(2)),o=parseInt(n);if(!isNaN(r)&&!isNaN(o))return void(H.cardData.expirationDate="".concat(o<10?"0"+o:o," / ").concat(r<10?"0"+r:r))}if(2===s.length&&4===n.length){o=parseInt(s),r=parseInt(n.slice(2));if(!isNaN(r)&&!isNaN(o))return void(H.cardData.expirationDate="".concat(o<10?"0"+o:o," / ").concat(r<10?"0"+r:r))}if(2===s.length&&2===n.length){var a=parseInt(s),c=parseInt(n);o=a<=12?a:c,r=c>12?c:a;if(!isNaN(r)&&!isNaN(o))return void(H.cardData.expirationDate="".concat(o<10?"0"+o:o," / ").concat(r<10?"0"+r:r))}}}var d=t.split(" / ").join("");d.length>4||(H.cardData.expirationDate=V(d,2).join(" / "))}},this.onCvcChange=function(t){H.cardData&&(t.length>H.cardData.cvv.length&&!U(t)||t.length>4||(H.cardData.cvv=t))},this.saveAddress=function(s){return t(H,void 0,void 0,(function(){var t,r,o,a,c,d,u,l,h,p,f,g,v=this;return e(this,(function(e){switch(e.label){case 0:return e.trys.push([0,3,,4]),this.shouldSaveAddress&&this.store.customerStore.customer?(t="shipping"===s?this.checkout.shippingAddress:this.checkout.billingAddress,(null===(h=this.customerAddresses)||void 0===h?void 0:h.find((function(e){return e.id===(null==t?void 0:t.id)})))?[2]:(r=null===(p=this.customerAddresses)||void 0===p?void 0:p.map((function(t){return t.id})),o=new m(i(i({},t),{title:this.addressTitle||this.t("checkout-page:newAddress")})),(a=n(this.store.customerStore.customer)).addresses||(a.addresses=[]),a.addresses.push(o),[4,this.store.customerStore.saveCustomer(a)])):[3,2];case 1:e.sent(),null===(f=this.customerAddresses)||void 0===f||f.forEach((function(t){return t.checkoutSettings=v.checkoutSettings})),c=null===(g=this.customerAddresses)||void 0===g?void 0:g.map((function(t){return t.id})),d=null==c?void 0:c.filter((function(t){return!(null==r?void 0:r.includes(t))})),u=(null==d?void 0:d.length)?d[0]:void 0,"shipping"===s?(this.checkout.shippingAddress.id=u||"",this.selectedShippingAddressId=u||"-1"):(this.checkout.billingAddress.id=u||"",this.selectedBillingAddressId=u||"-1"),e.label=2;case 2:return[3,4];case 3:return l=e.sent(),console.error(l),[3,4];case 4:return[2]}}))}))},this.onGoToCartClick=function(){H.router.push("/cart")},this.onBackToShoppingClick=function(){H.router.push("/")},this.onGoToLoginClick=function(){H.router.push("/account/login")},this.onProceedToShippingClick=function(){return t(H,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:if("address"===this.deliveryMethod){if(!this.canProceedToShipping)return this.isErrorsVisible=!0,[2]}else if(!this.canProceedToInStoreDelivery)return this.isErrorsVisible=!0,[2];this.isErrorsVisible=!1,e.label=1;case 1:return e.trys.push([1,6,,7]),this.isStepLoading=!0,"address"!==this.deliveryMethod?[3,3]:[4,this.saveAddress("shipping")];case 2:e.sent(),e.label=3;case 3:return[4,this.checkStocks()];case 4:return e.sent(),[4,this.saveCart()];case 5:return e.sent(),"address"===this.deliveryMethod?this.changeStep(T.SHIPPING):this.changeStep(T.PAYMENT),[3,7];case 6:return void 0!==typeof(t=e.sent()).type?this.error=t:(console.log(t),this.error={type:G.UNKNOWN}),this.isStepLoading=!1,[3,7];case 7:return[2]}}))}))},this.onProceedToDigitalOnlyPaymentClick=function(){return t(H,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:if(!this.canProceedToPayment)return this.isErrorsVisible=!0,[2];this.isErrorsVisible=!1,e.label=1;case 1:return e.trys.push([1,4,,5]),this.isStepLoading=!0,[4,this.checkStocks()];case 2:return e.sent(),[4,this.saveCart()];case 3:return e.sent(),this.changeStep(T.PAYMENT),[3,5];case 4:return(t=e.sent()).type?this.error=t:(console.log(t),this.error={type:G.UNKNOWN}),this.isStepLoading=!1,[3,5];case 5:return[2]}}))}))},this.onProceedToPaymentClick=function(){return t(H,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:if(!this.canProceedToPayment)return this.isErrorsVisible=!0,[2];this.isErrorsVisible=!1,e.label=1;case 1:return e.trys.push([1,4,,5]),this.isStepLoading=!0,[4,this.checkStocks()];case 2:return e.sent(),[4,this.saveCart()];case 3:return e.sent(),this.error=void 0,this.changeStep(T.PAYMENT),[3,5];case 4:return void 0!==typeof(t=e.sent()).type?this.error=t:(console.log(t),this.error={type:G.UNKNOWN}),this.isStepLoading=!1,[3,5];case 5:return[2]}}))}))},this.checkPaypalButtonAvailable=function(){return!!H.canPerformPayment||(H.isErrorsVisible=!0,!1)},this.onCompletePaymentClick=function(){return t(H,void 0,void 0,(function(){var t,i;return e(this,(function(e){switch(e.label){case 0:return this.canPerformPayment?(this.useDifferentAddress||(this.checkout.billingAddress=this.checkout.shippingAddress),this.isKlarna?[4,this.saveCart()]:[3,2]):(this.isErrorsVisible=!0,[2]);case 1:return e.sent(),this.setIsKlarnaPaymentCompleted(!0),[2];case 2:return e.trys.push([2,8,,9]),this.isErrorsVisible=!1,this.isStepLoading=!0,[4,this.checkStocks()];case 3:return e.sent(),"address"===this.deliveryMethod&&this.useDifferentAddress?[4,this.saveAddress("billing")]:[3,5];case 4:e.sent(),e.label=5;case 5:return[4,this.saveCart()];case 6:return e.sent(),this.isCustomFlowStripe?((t=document.querySelector("#stripe-form-btn"))&&t.click(),[2]):this.isAdyen?(this.adyenDropinElement.submit(),this.adyenDropinElement.isValid||(this.isStepLoading=!1),[2]):this.isPayPal?[2]:[4,this.createSaleTransaction()];case 7:return e.sent(),[3,9];case 8:return void 0!==typeof(i=e.sent()).type?this.error=i:this.error={type:G.UNKNOWN},this.isStepLoading=!1,[3,9];case 9:return[2]}}))}))},this.onCompleteDigitalOnlyPaymentClick=function(){return t(H,void 0,void 0,(function(){var t,i;return e(this,(function(e){switch(e.label){case 0:return!this.canProceedToPayment||this.checkoutSettings.showTermsAndConditionsCheckbox&&!this.isTermsAndConditionsChecked?(this.isErrorsVisible=!0,[2]):this.isKlarna?[4,this.saveCart()]:[3,2];case 1:return e.sent(),this.setIsKlarnaPaymentCompleted(!0),[2];case 2:return e.trys.push([2,6,,7]),this.isErrorsVisible=!1,this.isStepLoading=!0,[4,this.checkStocks()];case 3:return e.sent(),[4,this.saveCart()];case 4:return e.sent(),this.isCustomFlowStripe?((t=document.querySelector("#stripe-form-btn"))&&t.click(),[2]):this.isAdyen?(this.adyenDropinElement.submit(),this.adyenDropinElement.isValid||(this.isStepLoading=!1),[2]):this.isPayPal?[2]:[4,this.createSaleTransaction()];case 5:return e.sent(),[3,7];case 6:return(i=e.sent()).type?this.error=i:this.error={type:G.UNKNOWN},this.isStepLoading=!1,[3,7];case 7:return[2]}}))}))},this.createSaleTransaction=function(){return t(H,void 0,void 0,(function(){var t,i,s,n,r,c,d,l,h,p,m,f,g,v,y;return e(this,(function(e){switch(e.label){case 0:return(i=this.mpVM.selectedCard)&&(null===(l=this.mpVM.selectedCard)||void 0===l?void 0:l.Name)?((n=this.mpVM.phoneNumber({store:this.store,checkout:this.checkout}))&&(t=n),void 0===(null===(h=this.cardData)||void 0===h?void 0:h.installmentCount)?[2]:[4,C.createSaleTransactionWithCart({input:{cartId:this.checkout.id,masterPassDetail:{phoneNumber:t,savedCardName:null===(p=this.mpVM.selectedCard)||void 0===p?void 0:p.Name},paymentGatewayId:null===(m=this.mpVM.selectedCard)||void 0===m?void 0:m.paymentGatewayId,paymentMethodDetail:{cardNumber:this.mpVM.selectedCard.Value1,cardHolderName:this.mpVM.selectedCard.Name,cvv:this.mpVM.selectedCard.Value2,expiredMonth:11,expiredYear:11,installmentCount:this.cardData.installmentCount,threeDSecure:!!(null===(f=this.cardData)||void 0===f?void 0:f.threeDSecure)}}})]):[3,2];case 1:return s=e.sent(),[3,4];case 2:return this.checkout.selectedPaymentGateway?[4,C.createSaleTransactionWithCart({input:{cartId:this.checkout.id,masterPassDetail:i&&t?{phoneNumber:t,savedCardName:null===(g=this.mpVM.selectedCard)||void 0===g?void 0:g.Name}:void 0,paymentGatewayId:this.checkout.selectedPaymentGateway.id,paymentMethodDetail:i?void 0:this.checkout.selectedPaymentGateway.paymentMethodType===o.CREDIT_CARD&&this.checkout.selectedPaymentGateway.type===a.INTERNAL&&this.cardData?this.cardData.toInput():void 0}})]:[2];case 3:s=e.sent(),e.label=4;case 4:return r=null===(v=null==s?void 0:s.data)||void 0===v?void 0:v.transactionStatus,c=r&&[u.SUCCESS,u.AUTHORIZED].includes(r),d=r===u.PENDING,c?[4,this.getSuccessTransaction()]:[3,7];case 5:return e.sent(),[4,this.onCheckoutTransactionSuccess()];case 6:return e.sent(),[3,8];case 7:if(!d||!(null===(y=null==s?void 0:s.data)||void 0===y?void 0:y.returnSlug))throw{data:s.firstErrorMessage,type:G.UNKNOWN};window.location.href=process.env.NEXT_PUBLIC_BASE_URL+s.data.returnSlug,e.label=8;case 8:return[2]}}))}))},this.onCheckoutTransactionSuccess=function(){return t(H,void 0,void 0,(function(){var t,i;return e(this,(function(e){switch(e.label){case 0:return localStorage.removeItem("sAddr"),(null===(t=this.checkout.customer)||void 0===t?void 0:t.notificationsAccepted)?[4,this.store.customerStore.createEmailSubscription((null===(i=this.checkout.customer)||void 0===i?void 0:i.email)||"")]:[3,2];case 1:e.sent(),e.label=2;case 2:return this.changeStep(T.SUCCESS),[2]}}))}))},this.onBackToInfoClick=function(){H.changeStep(T.INFO)},this.onBackToShippingClick=function(){H.changeStep(T.SHIPPING)},this.setCustomerConsentGranted=function(t){H.checkout.customer&&(H.checkout.customer.notificationsAccepted=t)},this.setUseDifferentAddress=function(t){H.useDifferentAddress=t,H.useDifferentAddress?(localStorage.setItem("sAddr","1"),H.checkout.billingAddress=H.checkout.billingAddress||new D,H.checkout.billingAddress.countrySettings=H.countrySettings):(localStorage.removeItem("sAddr"),H.checkout.billingAddress=H.checkout.shippingAddress)},this.setShouldSaveAddress=function(t){H.shouldSaveAddress=t},this.setAddressTitle=function(t){H.addressTitle=t},this.setPaymentGateway=function(i){return t(H,void 0,void 0,(function(){var t,s,n;return e(this,(function(e){switch(e.label){case 0:return this.paymentGateways.length?"STRIPE"!==(t=this.paymentGateways[i]).code||!(null===(n=t.settings)||void 0===n?void 0:n.find((function(t){return"allow_custom_flow"===t.label&&"1"===t.value})))||this.stripeResponse?[3,2]:[4,C.createStripePaymentIntent({input:{cartId:this.checkout.id,paymentGatewayId:t.id||""}})]:[2];case 1:(s=e.sent()).isSuccess&&s.data&&(this.stripeResponse=s.data),e.label=2;case 2:return"KLARNA"!==t.code||this.klarnaResponse?[3,4]:[4,C.createKlarnaClientToken({input:{cartId:this.checkout.id,paymentGatewayId:t.id||""}})];case 3:(s=e.sent()).isSuccess&&s.data&&(this.klarnaResponse=s.data),e.label=4;case 4:return"ADYEN"!==t.code||this.adyenResponse?[3,6]:[4,C.createAdyenClientToken({input:{cartId:this.checkout.id,paymentGatewayId:t.id||""}})];case 5:(s=e.sent()).isSuccess&&s.data&&(this.adyenResponse=s.data),e.label=6;case 6:return"PAYPAL"!==t.code||this.payPalClientIdResponse?[3,8]:[4,C.getPayPalClientId({input:{cartId:this.checkout.id,paymentGatewayId:t.id||""}})];case 7:(s=e.sent()).isSuccess&&s.data&&(this.payPalClientIdResponse=s.data),e.label=8;case 8:return this.checkout.selectedPaymentGateway=t,this.step!==T.SUCCESS&&(t.paymentMethodType===o.CREDIT_CARD&&t.type===a.INTERNAL&&(this.cardData=new k,t.masterPassClientId&&(console.log("called 1511 ikas log"),this.mpVM.checkMasterPass({checkout:this.checkout,store:this.store}))),this.installmentInfo=void 0),[2]}}))}))},this.setInstallmentCount=function(t){H.cardData&&(H.cardData.installmentCount=t)},this.changeStep=function(i){return t(H,void 0,void 0,(function(){return e(this,(function(t){return M||window.location.replace("".concat(window.location.pathname,"?id=").concat(this.checkout.id,"&step=").concat(i)),[2]}))}))},this.logout=function(){return t(H,void 0,void 0,(function(){return e(this,(function(t){switch(t.label){case 0:this.checkout.customer=null,this.store.customerStore.logout(),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,this.saveCart()];case 2:case 3:return t.sent(),[3,4];case 4:return this.createCustomer(),[2]}}))}))},this.setContactModalVisible=function(t){H.isContactModalVisible=t},this.getCampaignOfferProducts=function(i){return t(H,void 0,void 0,(function(){var t,s,n,r;return e(this,(function(o){switch(o.label){case 0:if(!this.checkout.campaignOffers||!this.checkout.campaignOffers.length)return[3,4];if(t=this.checkout.campaignOffers.filter((function(t){var e;return t.status===l.WAITING_FOR_ACTION&&(null===(e=t.campaignOffer)||void 0===e?void 0:e.targetPageTypes.some((function(t){return t===i})))})),!t.length)return[3,4];s=function(i){var s,n,r,o,a;return e(this,(function(e){switch(e.label){case 0:return(s=t[i]).campaignOffer&&(n=s.campaignOffer.offers.find((function(t){return t.id===s.campaignOfferProductId})))?[4,N.searchProducts({input:{productIdList:[n.productId]}})]:[3,2];case 1:if((r=e.sent()).isSuccess&&r.data&&r.data.data&&r.data.data.length&&(o=r.data.data[0],a=[],n.excludedVariantIdList&&n.excludedVariantIdList.length?o.variants.map((function(t){var e;t.hasStock&&!(null===(e=n.excludedVariantIdList)||void 0===e?void 0:e.some((function(e){return e===t.id})))&&a.push(t)})):a.push.apply(a,o.variants.filter((function(t){return t.hasStock}))),a.length))return[2,{value:{product:new y(o),variants:a,campaignOffer:s,offer:n}}];e.label=2;case 2:return[2]}}))},n=0,o.label=1;case 1:return n<t.length?[5,s(n)]:[3,4];case 2:if("object"==typeof(r=o.sent()))return[2,r.value];o.label=3;case 3:return n++,[3,1];case 4:return[2,void 0]}}))}))},this.getCampaignOffer=function(){return t(H,void 0,void 0,(function(){var t,i;return e(this,(function(e){switch(e.label){case 0:return t=this,[4,this.getCampaignOfferProducts(h.CHECKOUT)];case 1:return t.checkoutCampaignOffer=e.sent(),i=this,[4,this.getCampaignOfferProducts(h.POST_CHECKOUT)];case 2:return i.postCheckoutCampaignOffer=e.sent(),[2]}}))}))},this.updateCartCampaignOffer=function(i){return t(H,void 0,void 0,(function(){var t;return e(this,(function(e){switch(e.label){case 0:return this.isCheckoutLoaded=!1,[4,P.updateCartCampaignOffer({input:i})];case 1:return(t=e.sent())&&t.isSuccess&&t.data&&(this.checkout=new p(t.data,this.countrySettings),i.accepted&&this.step===T.SUCCESS?this.changeStep(T.INFO):this.changeStep(this.step)),[2]}}))}))},this.registerCustomer=function(i){return t(H,void 0,void 0,(function(){var t,s,n,r;return e(this,(function(e){switch(e.label){case 0:return this.checkout.customer?(t=this.checkout.customer,s=t.firstName,n=t.lastName,r=t.email,s&&n&&r?[4,b.register({orderId:this.checkout.id,firstName:s,lastName:n,email:r,password:i})]:[3,2]):[3,2];case 1:return[2,e.sent()];case 2:return[2]}}))}))},this.checkout=c,this.checkoutSettings=d,this.router=f,this.returnPolicy=g,this.privacyPolicy=L,this.termsOfService=_,this.imprint=K,this.shippingPolicy=F,this.t=Y,this.customizationProps=B,this.mpVM=new I,this.isTermsAndConditionsChecked=this.checkoutSettings.isTermsAndConditionsDefaultChecked||!1,this.countrySettings=new S({currentLocale:O.getCurrentLocale()}),this.init(),s(this)}return Object.defineProperty(L.prototype,"merchantSettings",{get:function(){return new g(O.getMerchantSettings())},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"selectedPaymentGatewayIndex",{get:function(){var t=this;return this.paymentGateways.findIndex((function(e){var i;return e.id===(null===(i=t.checkout.selectedPaymentGateway)||void 0===i?void 0:i.id)}))},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"selectedInstallmentIndex",{get:function(){var t,e,i=this;return(null===(e=null===(t=this.installmentInfo)||void 0===t?void 0:t.installmentPrices)||void 0===e?void 0:e.findIndex((function(t){var e;return t.installmentCount===(null===(e=i.cardData)||void 0===e?void 0:e.installmentCount)})))||0},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"checkoutUrl",{get:function(){return"/checkout?id=".concat(this.checkout.id,"&step=info")},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"customerAddressOptions",{get:function(){var t,e,i={label:this.t("checkout-page:newAddress"),value:"-1"},s=(null===(e=null===(t=E.getInstance().customerStore.customer)||void 0===t?void 0:t.addresses)||void 0===e?void 0:e.map((function(t){return{label:t.title+" - "+t.addressText,value:t.id}})))||[];return[i].concat(s)},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"installmentPrice",{get:function(){var t,e,i,s=this;if(this.installmentInfo&&(null===(t=this.cardData)||void 0===t?void 0:t.installmentCount))return null===(i=null===(e=this.installmentInfo.installmentPrices)||void 0===e?void 0:e.find((function(t){var e;return t.installmentCount===(null===(e=s.cardData)||void 0===e?void 0:e.installmentCount)})))||void 0===i?void 0:i.totalPrice},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"installmentExtraPrice",{get:function(){if(this.installmentPrice&&this.checkout.totalFinalPrice)return this.installmentPrice-this.checkout.totalFinalPrice},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"finalPrice",{get:function(){return this.step===T.SUCCESS?this.checkout.totalFinalPrice:this.installmentPrice||this.checkout.$totalFinalPrice},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"hasStockError",{get:function(){var t;return(null===(t=this.error)||void 0===t?void 0:t.type)===G.STOCK_ERROR},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"isPaymentGatewayHasMasterPass",{get:function(){return-1!==this.selectedPaymentGatewayIndex&&(!!this.paymentGateways.length&&!!this.paymentGateways[this.selectedPaymentGatewayIndex].masterPassClientId)},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"hasQuickRegistration",{get:function(){return this.checkoutSettings.isQuickRegistrationEnabled&&this.checkout.customer&&this.checkout.customer.isGuestCheckout},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"canProceedToShipping",{get:function(){var t,e,i;return(this.isDigitalOnly?null===(t=this.checkout.billingAddress)||void 0===t?void 0:t.isValidAddress:null===(e=this.checkout.shippingAddress)||void 0===e?void 0:e.isValidAddress)&&this.checkout.hasValidCustomerEmail&&(null===(i=this.error)||void 0===i?void 0:i.type)!==G.NO_SHIPPING_ERROR},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"canProceedToInStoreDelivery",{get:function(){var t,e,i;return!!((null===(t=this.checkout.shippingAddress)||void 0===t?void 0:t.firstName)&&(null===(e=this.checkout.shippingAddress)||void 0===e?void 0:e.lastName)&&(null===(i=this.checkout.customer)||void 0===i?void 0:i.email)&&this.checkout.stockLocationId)},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"canProceedToPayment",{get:function(){return this.canProceedToShipping},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"isInStoreDelivery",{get:function(){return!!this.checkout.stockLocationId},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"klarnaPaymentGateway",{get:function(){var t=this.paymentGateways.findIndex((function(t){return"KLARNA"===t.code}));if(-1!==t)return this.paymentGateways[t]},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"klarnaPaymentGatewayIndex",{get:function(){return this.paymentGateways.findIndex((function(t){return"KLARNA"===t.code}))},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"adyenPaymentGateway",{get:function(){var t=this.paymentGateways.findIndex((function(t){return"ADYEN"===t.code}));if(-1!==t)return this.paymentGateways[t]},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"adyenPaymentGatewayIndex",{get:function(){return this.paymentGateways.findIndex((function(t){return"ADYEN"===t.code}))},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"payPalPaymentGateway",{get:function(){var t=this.paymentGateways.findIndex((function(t){return"PAYPAL"===t.code}));if(-1!==t)return this.paymentGateways[t]},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"payPalPaymentGatewayIndex",{get:function(){return this.paymentGateways.findIndex((function(t){return"PAYPAL"===t.code}))},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"isCustomFlowStripe",{get:function(){var t,e=this.checkout.selectedPaymentGateway;return e&&"STRIPE"===e.code&&(null===(t=e.settings)||void 0===t?void 0:t.find((function(t){return"allow_custom_flow"===t.label&&"1"===t.value})))},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"isKlarna",{get:function(){var t=this.checkout.selectedPaymentGateway;return t&&"KLARNA"===t.code},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"isAdyen",{get:function(){var t=this.checkout.selectedPaymentGateway;return t&&"ADYEN"===t.code},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"isPayPal",{get:function(){var t=this.checkout.selectedPaymentGateway;return t&&"PAYPAL"===t.code},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"store",{get:function(){return E.getInstance()},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"canPerformPayment",{get:function(){var t,e;if(this.checkoutSettings.showTermsAndConditionsCheckbox&&!this.isTermsAndConditionsChecked)return!1;var i=this.checkout.selectedPaymentGateway,s=!!("in-store"===this.deliveryMethod)||!!this.canProceedToShipping,n=!!(null===(t=this.checkout.billingAddress)||void 0===t?void 0:t.isValidAddress),r=!!this.mpVM.selectedCard||((null==i?void 0:i.paymentMethodType)===o.CREDIT_CARD&&i.type===a.INTERNAL?!!this.isCustomFlowStripe||(!(!this.isKlarna&&!this.isPayPal)||(null===(e=this.cardData)||void 0===e?void 0:e.isValid)):!!i);return s&&n&&r},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"isDigitalOnly",{get:function(){return this.checkout.shippingMethod===c.DIGITAL_DELIVERY},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"customerAddresses",{get:function(){var t,e,s=this;return null===(e=null===(t=this.store.customerStore.customer)||void 0===t?void 0:t.addresses)||void 0===e?void 0:e.map((function(t){var e=new f(i({countrySettings:s.countrySettings},t));return e.checkoutSettings=s.checkoutSettings,e}))},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"isManualOrder",{get:function(){return this.checkout.createdBy===d.ADMIN},enumerable:!1,configurable:!0}),Object.defineProperty(L.prototype,"isEPayKolayEnabled",{get:function(){var t=O.getCustom();return!!t&&!!t.isEPayKolayEnabled},enumerable:!1,configurable:!0}),L.prototype.setAdyenDropinElement=function(t){this.adyenDropinElement=t},L}();function V(t,e){return t.match(new RegExp(".{1,"+e+"}","g"))||[]}function U(t){return t&&L.test(t.charAt(t.length-1))}!function(t){t.INFO="info",t.SHIPPING="shipping",t.PAYMENT="payment",t.SUCCESS="success"}(T||(T={})),function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.API_ERROR=1]="API_ERROR",t[t.STOCK_ERROR=2]="STOCK_ERROR",t[t.PAYMENT_ERROR=3]="PAYMENT_ERROR",t[t.NO_SHIPPING_ERROR=4]="NO_SHIPPING_ERROR",t[t.CUSTOMER_LOGIN_REQUIRED_ERROR=5]="CUSTOMER_LOGIN_REQUIRED_ERROR"}(G||(G={}));export{T as CheckoutStep,G as ErrorType,_ as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from'./../../ext/style-inject/dist/style-inject.es.js';var t={CheckoutPage:"style-module_CheckoutPage__ZhJkP",Left:"style-module_Left__Fi9Ka",LeftContent:"style-module_LeftContent__9OjX9",Space:"style-module_Space__rZnAy",Footer:"style-module_Footer__x-8Uy",FooterItem:"style-module_FooterItem__33V-M",FooterBullet:"style-module_FooterBullet__ReSoQ",AdressStepInfo:"style-module_AdressStepInfo__n4JGO",Address:"style-module_Address__yS7Ou",Text:"style-module_Text__jEuRS",WithMBottom:"style-module_WithMBottom__4Eb0o",WithMTop:"style-module_WithMTop__I550k",Gray:"style-module_Gray__p6WTS",EditBtn:"style-module_EditBtn__1BG0f",AddressStepInfoMobile:"style-module_AddressStepInfoMobile__7awcG",ErrorContainer:"style-module_ErrorContainer__TAK-J",Header:"style-module_Header__V7Pe2",Logo:"style-module_Logo__y9GGC",LoginText:"style-module_LoginText__OOD8r",LoginBtn:"style-module_LoginBtn__m-qco",CustomerInfo:"style-module_CustomerInfo__ECTKP",Name:"style-module_Name__iIq-v",Email:"style-module_Email__UX6fN",LoginCta:"style-module_LoginCta__TDolx",MobileCartSummary:"style-module_MobileCartSummary__bUmJj",RowPB:"style-module_RowPB__tAM9q",Right:"style-module_Right__1BcGi",RightContent:"style-module_RightContent__qvFkp",PoweredBy:"style-module_PoweredBy__3k1Sx",LightText:"style-module_LightText__IsehB",ReactTooltipWrap:"style-module_ReactTooltipWrap__HX-4g"};e('.style-module_CheckoutPage__ZhJkP {\n all: unset;\n font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;\n font-size: 16px !important;\n width: 100%;\n height: 100vh;\n overflow: auto;\n overflow-x: hidden;\n display: flex;\n color: var(--checkout-primary-text-color);\n background-color: var(--checkout-primary-bg-color);\n}\n.style-module_CheckoutPage__ZhJkP input::placeholder,\n.style-module_CheckoutPage__ZhJkP textarea::placeholder {\n all: unset;\n}\n.style-module_CheckoutPage__ZhJkP a,\n.style-module_CheckoutPage__ZhJkP a:hover,\n.style-module_CheckoutPage__ZhJkP a:focus,\n.style-module_CheckoutPage__ZhJkP a:active {\n color: inherit;\n}\n.style-module_CheckoutPage__ZhJkP * {\n box-sizing: border-box !important;\n font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;\n font-size: 16px;\n letter-spacing: normal;\n font-weight: normal;\n line-height: unset;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka {\n width: 50%;\n flex: 0 0 auto;\n display: flex;\n justify-content: flex-end;\n padding-left: 20px;\n padding-right: 64px;\n background-color: var(--checkout-primary-bg-color);\n z-index: 1;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 {\n width: 100%;\n min-width: 400px;\n max-width: 600px;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n min-height: 100vh;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_Space__rZnAy {\n width: 100%;\n height: 100px;\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_Space__rZnAy {\n height: 48px;\n }\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_Footer__x-8Uy {\n flex: 0 0 auto;\n background-color: transparent;\n width: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n flex-wrap: wrap;\n padding: 12.205px 0;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_Footer__x-8Uy .style-module_FooterItem__33V-M {\n font-size: 14px;\n color: var(--checkout-secondary-text-color);\n cursor: pointer;\n user-select: none;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_Footer__x-8Uy .style-module_FooterItem__33V-M:hover {\n color: var(--checkout-primary-text-color);\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_Footer__x-8Uy .style-module_FooterBullet__ReSoQ {\n margin: 0 12px;\n color: var(--checkout-secondary-text-color);\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_Footer__x-8Uy {\n width: 100%;\n }\n .style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_Footer__x-8Uy .style-module_FooterItem__33V-M {\n text-align: center;\n }\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_AdressStepInfo__n4JGO {\n display: flex;\n justify-content: space-between;\n padding-left: 78px;\n padding-top: 5px;\n width: 100%;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_AdressStepInfo__n4JGO .style-module_Address__yS7Ou {\n font-size: 16px;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_AdressStepInfo__n4JGO .style-module_Address__yS7Ou .style-module_Text__jEuRS {\n font-size: 14px;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_AdressStepInfo__n4JGO .style-module_Address__yS7Ou .style-module_Text__jEuRS.style-module_WithMBottom__4Eb0o {\n margin-bottom: 12px;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_AdressStepInfo__n4JGO .style-module_Address__yS7Ou .style-module_Text__jEuRS.style-module_WithMTop__I550k {\n margin-top: 12px;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_AdressStepInfo__n4JGO .style-module_Address__yS7Ou .style-module_Text__jEuRS.style-module_Gray__p6WTS {\n color: var(--checkout-secondary-text-color);\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_AdressStepInfo__n4JGO .style-module_EditBtn__1BG0f {\n cursor: pointer;\n user-select: none;\n align-self: flex-start;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_AdressStepInfo__n4JGO .style-module_EditBtn__1BG0f:hover {\n text-decoration: underline;\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_AdressStepInfo__n4JGO {\n padding-top: 0;\n justify-content: flex-end;\n }\n .style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_AdressStepInfo__n4JGO .style-module_Address__yS7Ou {\n display: none;\n }\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_AddressStepInfoMobile__7awcG {\n display: none;\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_AddressStepInfoMobile__7awcG {\n display: block;\n padding-top: 16px;\n }\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_AddressStepInfoMobile__7awcG .style-module_Address__yS7Ou {\n font-size: 16px;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_AddressStepInfoMobile__7awcG .style-module_Address__yS7Ou .style-module_Text__jEuRS {\n font-size: 14px;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_AddressStepInfoMobile__7awcG .style-module_Address__yS7Ou .style-module_Text__jEuRS.style-module_WithMBottom__4Eb0o {\n margin-bottom: 12px;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_AddressStepInfoMobile__7awcG .style-module_Address__yS7Ou .style-module_Text__jEuRS.style-module_Gray__p6WTS {\n color: var(--checkout-secondary-text-color);\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_ErrorContainer__TAK-J {\n padding: 0 24px;\n }\n}\n@media only screen and (max-width: 480px) {\n .style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_ErrorContainer__TAK-J {\n padding: 0 10px;\n }\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_Header__V7Pe2 {\n width: 100%;\n height: 96px;\n display: flex;\n justify-content: space-between;\n align-items: center;\n font-weight: 500;\n font-size: 20px;\n margin-bottom: 44px;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_Header__V7Pe2 a {\n flex: 1 1 auto;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_Header__V7Pe2 .style-module_Logo__y9GGC {\n width: calc(100% - 24px);\n max-width: 200px;\n height: 64px;\n position: relative;\n user-select: none;\n cursor: pointer;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_Header__V7Pe2 .style-module_Logo__y9GGC img {\n object-fit: contain;\n object-position: left;\n pointer-events: none;\n}\n@media only screen and (max-width: 1280px) {\n .style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_Header__V7Pe2 .style-module_Logo__y9GGC {\n max-width: 150px;\n }\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_Header__V7Pe2 .style-module_LoginText__OOD8r {\n font-size: 14px;\n text-align: right;\n flex: 0 0 auto;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_Header__V7Pe2 .style-module_LoginText__OOD8r span {\n color: var(--checkout-secondary-text-color);\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_Header__V7Pe2 .style-module_LoginBtn__m-qco {\n margin-left: 4px;\n font-weight: bold;\n user-select: none;\n cursor: pointer;\n font-weight: 500;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_Header__V7Pe2 .style-module_CustomerInfo__ECTKP {\n display: flex;\n flex-direction: column;\n align-items: flex-end;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_Header__V7Pe2 .style-module_CustomerInfo__ECTKP .style-module_Name__iIq-v {\n font-size: 20px;\n font-weight: 600;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_Header__V7Pe2 .style-module_CustomerInfo__ECTKP .style-module_Email__UX6fN {\n font-weight: 500;\n font-size: 14px;\n user-select: none;\n color: var(--checkout-secondary-text-color);\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_Header__V7Pe2 {\n height: 72px;\n margin-bottom: 0;\n padding: 0 24px;\n }\n .style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_Header__V7Pe2 .style-module_CustomerInfo__ECTKP .style-module_Name__iIq-v {\n font-size: 15px;\n }\n .style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_Header__V7Pe2 .style-module_CustomerInfo__ECTKP .style-module_Email__UX6fN {\n font-size: 13px;\n }\n .style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_Header__V7Pe2 .style-module_LoginText__OOD8r {\n display: flex;\n flex-direction: column;\n padding-bottom: 0;\n }\n .style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_Header__V7Pe2 .style-module_LoginText__OOD8r .style-module_LoginCta__TDolx {\n display: none;\n }\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_MobileCartSummary__bUmJj {\n position: sticky;\n top: 0;\n z-index: 10;\n}\n@media only screen and (min-width: 1000px) {\n .style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_MobileCartSummary__bUmJj {\n display: none;\n }\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_RowPB__tAM9q {\n padding-bottom: 16px;\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka {\n width: 100%;\n justify-content: center;\n padding-right: 0px;\n padding-left: 0px;\n }\n .style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 {\n width: 100%;\n min-width: auto;\n max-width: 100%;\n }\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Right__1BcGi {\n width: 50%;\n min-height: 100%;\n flex: 0 0 auto;\n background-color: var(--checkout-secondary-bg-color);\n display: flex;\n padding-left: 64px;\n padding-right: 20px;\n position: sticky;\n top: 0;\n overflow-y: auto;\n z-index: 1;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Right__1BcGi .style-module_RightContent__qvFkp {\n width: 100%;\n max-width: 600px;\n padding-top: 168px;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Right__1BcGi .style-module_RightContent__qvFkp .style-module_PoweredBy__3k1Sx {\n width: 100%;\n padding: 16px 0;\n display: flex;\n justify-content: center;\n align-items: center;\n color: var(--checkout-primary-text-color);\n user-select: none;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Right__1BcGi .style-module_RightContent__qvFkp .style-module_PoweredBy__3k1Sx span {\n font-size: 14px;\n line-height: 20px;\n color: var(--checkout-secondary-text-color);\n margin-right: 8px;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Right__1BcGi .style-module_RightContent__qvFkp .style-module_PoweredBy__3k1Sx a {\n display: flex;\n align-items: center;\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CheckoutPage__ZhJkP .style-module_Right__1BcGi {\n display: none;\n }\n}\n\n.style-module_LightText__IsehB {\n color: var(--checkout-secondary-text-color);\n}\n\n.style-module_ReactTooltipWrap__HX-4g {\n max-width: 300px;\n}');export{t as default};
|
|
1
|
+
import e from'./../../ext/style-inject/dist/style-inject.es.js';var t={CheckoutPage:"style-module_CheckoutPage__ZhJkP",Left:"style-module_Left__Fi9Ka",epaykolay:"style-module_epaykolay__3MlS-",LeftContent:"style-module_LeftContent__9OjX9",Space:"style-module_Space__rZnAy",Footer:"style-module_Footer__x-8Uy",FooterItem:"style-module_FooterItem__33V-M",FooterBullet:"style-module_FooterBullet__ReSoQ",AdressStepInfo:"style-module_AdressStepInfo__n4JGO",Address:"style-module_Address__yS7Ou",Text:"style-module_Text__jEuRS",WithMBottom:"style-module_WithMBottom__4Eb0o",WithMTop:"style-module_WithMTop__I550k",Gray:"style-module_Gray__p6WTS",EditBtn:"style-module_EditBtn__1BG0f",AddressStepInfoMobile:"style-module_AddressStepInfoMobile__7awcG",ErrorContainer:"style-module_ErrorContainer__TAK-J",Header:"style-module_Header__V7Pe2",Logo:"style-module_Logo__y9GGC",LoginText:"style-module_LoginText__OOD8r",LoginBtn:"style-module_LoginBtn__m-qco",CustomerInfo:"style-module_CustomerInfo__ECTKP",Name:"style-module_Name__iIq-v",Email:"style-module_Email__UX6fN",LoginCta:"style-module_LoginCta__TDolx",MobileCartSummary:"style-module_MobileCartSummary__bUmJj",RowPB:"style-module_RowPB__tAM9q",Right:"style-module_Right__1BcGi",RightContent:"style-module_RightContent__qvFkp",PoweredBy:"style-module_PoweredBy__3k1Sx",LightText:"style-module_LightText__IsehB",ReactTooltipWrap:"style-module_ReactTooltipWrap__HX-4g"};e('.style-module_CheckoutPage__ZhJkP {\n all: unset;\n font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;\n font-size: 16px !important;\n width: 100%;\n height: 100vh;\n overflow: auto;\n overflow-x: hidden;\n display: flex;\n color: var(--checkout-primary-text-color);\n background-color: var(--checkout-primary-bg-color);\n}\n.style-module_CheckoutPage__ZhJkP input::placeholder,\n.style-module_CheckoutPage__ZhJkP textarea::placeholder {\n all: unset;\n}\n.style-module_CheckoutPage__ZhJkP a,\n.style-module_CheckoutPage__ZhJkP a:hover,\n.style-module_CheckoutPage__ZhJkP a:focus,\n.style-module_CheckoutPage__ZhJkP a:active {\n color: inherit;\n}\n.style-module_CheckoutPage__ZhJkP * {\n box-sizing: border-box !important;\n font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;\n font-size: 16px;\n letter-spacing: normal;\n font-weight: normal;\n line-height: unset;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka {\n width: 50%;\n flex: 0 0 auto;\n display: flex;\n flex-direction: column;\n align-items: flex-end;\n padding-left: 20px;\n padding-right: 64px;\n background-color: var(--checkout-primary-bg-color);\n z-index: 1;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka.style-module_epaykolay__3MlS- {\n padding-left: 0;\n padding-right: 0;\n z-index: 2;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 {\n width: 100%;\n min-width: 400px;\n max-width: 600px;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n min-height: 100vh;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_Space__rZnAy {\n width: 100%;\n height: 100px;\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_Space__rZnAy {\n height: 48px;\n }\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_Footer__x-8Uy {\n flex: 0 0 auto;\n background-color: transparent;\n width: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n flex-wrap: wrap;\n padding: 12.205px 0;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_Footer__x-8Uy .style-module_FooterItem__33V-M {\n font-size: 14px;\n color: var(--checkout-secondary-text-color);\n cursor: pointer;\n user-select: none;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_Footer__x-8Uy .style-module_FooterItem__33V-M:hover {\n color: var(--checkout-primary-text-color);\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_Footer__x-8Uy .style-module_FooterBullet__ReSoQ {\n margin: 0 12px;\n color: var(--checkout-secondary-text-color);\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_Footer__x-8Uy {\n width: 100%;\n }\n .style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_Footer__x-8Uy .style-module_FooterItem__33V-M {\n text-align: center;\n }\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_AdressStepInfo__n4JGO {\n display: flex;\n justify-content: space-between;\n padding-left: 78px;\n padding-top: 5px;\n width: 100%;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_AdressStepInfo__n4JGO .style-module_Address__yS7Ou {\n font-size: 16px;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_AdressStepInfo__n4JGO .style-module_Address__yS7Ou .style-module_Text__jEuRS {\n font-size: 14px;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_AdressStepInfo__n4JGO .style-module_Address__yS7Ou .style-module_Text__jEuRS.style-module_WithMBottom__4Eb0o {\n margin-bottom: 12px;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_AdressStepInfo__n4JGO .style-module_Address__yS7Ou .style-module_Text__jEuRS.style-module_WithMTop__I550k {\n margin-top: 12px;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_AdressStepInfo__n4JGO .style-module_Address__yS7Ou .style-module_Text__jEuRS.style-module_Gray__p6WTS {\n color: var(--checkout-secondary-text-color);\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_AdressStepInfo__n4JGO .style-module_EditBtn__1BG0f {\n cursor: pointer;\n user-select: none;\n align-self: flex-start;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_AdressStepInfo__n4JGO .style-module_EditBtn__1BG0f:hover {\n text-decoration: underline;\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_AdressStepInfo__n4JGO {\n padding-top: 0;\n justify-content: flex-end;\n }\n .style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_AdressStepInfo__n4JGO .style-module_Address__yS7Ou {\n display: none;\n }\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_AddressStepInfoMobile__7awcG {\n display: none;\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_AddressStepInfoMobile__7awcG {\n display: block;\n padding-top: 16px;\n }\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_AddressStepInfoMobile__7awcG .style-module_Address__yS7Ou {\n font-size: 16px;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_AddressStepInfoMobile__7awcG .style-module_Address__yS7Ou .style-module_Text__jEuRS {\n font-size: 14px;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_AddressStepInfoMobile__7awcG .style-module_Address__yS7Ou .style-module_Text__jEuRS.style-module_WithMBottom__4Eb0o {\n margin-bottom: 12px;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_AddressStepInfoMobile__7awcG .style-module_Address__yS7Ou .style-module_Text__jEuRS.style-module_Gray__p6WTS {\n color: var(--checkout-secondary-text-color);\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_ErrorContainer__TAK-J {\n padding: 0 24px;\n }\n}\n@media only screen and (max-width: 480px) {\n .style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 .style-module_ErrorContainer__TAK-J {\n padding: 0 10px;\n }\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_Header__V7Pe2 {\n width: 100%;\n height: 96px;\n display: flex;\n justify-content: space-between;\n align-items: center;\n font-weight: 500;\n font-size: 20px;\n margin-bottom: 44px;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_Header__V7Pe2 a {\n flex: 1 1 auto;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_Header__V7Pe2 .style-module_Logo__y9GGC {\n width: calc(100% - 24px);\n max-width: 200px;\n height: 64px;\n position: relative;\n user-select: none;\n cursor: pointer;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_Header__V7Pe2 .style-module_Logo__y9GGC img {\n object-fit: contain;\n object-position: left;\n pointer-events: none;\n}\n@media only screen and (max-width: 1280px) {\n .style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_Header__V7Pe2 .style-module_Logo__y9GGC {\n max-width: 150px;\n }\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_Header__V7Pe2 .style-module_LoginText__OOD8r {\n font-size: 14px;\n text-align: right;\n flex: 0 0 auto;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_Header__V7Pe2 .style-module_LoginText__OOD8r span {\n color: var(--checkout-secondary-text-color);\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_Header__V7Pe2 .style-module_LoginBtn__m-qco {\n margin-left: 4px;\n font-weight: bold;\n user-select: none;\n cursor: pointer;\n font-weight: 500;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_Header__V7Pe2 .style-module_CustomerInfo__ECTKP {\n display: flex;\n flex-direction: column;\n align-items: flex-end;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_Header__V7Pe2 .style-module_CustomerInfo__ECTKP .style-module_Name__iIq-v {\n font-size: 20px;\n font-weight: 600;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_Header__V7Pe2 .style-module_CustomerInfo__ECTKP .style-module_Email__UX6fN {\n font-weight: 500;\n font-size: 14px;\n user-select: none;\n color: var(--checkout-secondary-text-color);\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_Header__V7Pe2 {\n height: 72px;\n margin-bottom: 0;\n padding: 0 24px;\n }\n .style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_Header__V7Pe2 .style-module_CustomerInfo__ECTKP .style-module_Name__iIq-v {\n font-size: 15px;\n }\n .style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_Header__V7Pe2 .style-module_CustomerInfo__ECTKP .style-module_Email__UX6fN {\n font-size: 13px;\n }\n .style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_Header__V7Pe2 .style-module_LoginText__OOD8r {\n display: flex;\n flex-direction: column;\n padding-bottom: 0;\n }\n .style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_Header__V7Pe2 .style-module_LoginText__OOD8r .style-module_LoginCta__TDolx {\n display: none;\n }\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_MobileCartSummary__bUmJj {\n position: sticky;\n top: 0;\n z-index: 10;\n}\n@media only screen and (min-width: 1000px) {\n .style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_MobileCartSummary__bUmJj {\n display: none;\n }\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_RowPB__tAM9q {\n padding-bottom: 16px;\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka {\n width: 100%;\n justify-content: center;\n padding-right: 0px;\n padding-left: 0px;\n }\n .style-module_CheckoutPage__ZhJkP .style-module_Left__Fi9Ka .style-module_LeftContent__9OjX9 {\n width: 100%;\n min-width: auto;\n max-width: 100%;\n }\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Right__1BcGi {\n width: 50%;\n min-height: 100%;\n flex: 0 0 auto;\n background-color: var(--checkout-secondary-bg-color);\n display: flex;\n padding-left: 64px;\n padding-right: 20px;\n position: sticky;\n top: 0;\n overflow-y: auto;\n z-index: 1;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Right__1BcGi .style-module_RightContent__qvFkp {\n width: 100%;\n max-width: 600px;\n padding-top: 168px;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Right__1BcGi .style-module_RightContent__qvFkp .style-module_PoweredBy__3k1Sx {\n width: 100%;\n padding: 16px 0;\n display: flex;\n justify-content: center;\n align-items: center;\n color: var(--checkout-primary-text-color);\n user-select: none;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Right__1BcGi .style-module_RightContent__qvFkp .style-module_PoweredBy__3k1Sx span {\n font-size: 14px;\n line-height: 20px;\n color: var(--checkout-secondary-text-color);\n margin-right: 8px;\n}\n.style-module_CheckoutPage__ZhJkP .style-module_Right__1BcGi .style-module_RightContent__qvFkp .style-module_PoweredBy__3k1Sx a {\n display: flex;\n align-items: center;\n}\n@media only screen and (max-width: 1000px) {\n .style-module_CheckoutPage__ZhJkP .style-module_Right__1BcGi {\n display: none;\n }\n}\n\n.style-module_LightText__IsehB {\n color: var(--checkout-secondary-text-color);\n}\n\n.style-module_ReactTooltipWrap__HX-4g {\n max-width: 300px;\n}');export{t as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__assign as e}from'./../../ext/tslib/tslib.es6.js';import*as t from"react";import{observer as o}from"mobx-react-lite";import a from"next/head.js";import{useRouter as r}from"next/router";import"../../models/data/blog/category/index.js";import"../../models/data/blog/content/index.js";import"../../models/data/blog/meta-data/index.js";import"../../models/data/blog/tag/index.js";import"../../models/data/blog/index.js";import"../../models/data/brand/index.js";import{IkasThemeJsonPageType as i}from"@ikas/storefront-models";import"mobx";import"../../models/data/campaign-offer/index.js";import"../../models/data/cart/campaign-offer/index.js";import"../../models/data/cart/index.js";import"../../models/data/category/path-item/index.js";import"../../models/data/category/index.js";import"../../models/data/checkout/index.js";import"../../models/data/checkout-settings/index.js";import"../../models/data/city/index.js";import"../../models/data/country/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/address/ikas-localized-customer-address.js";import"../../models/data/customer/attribute/index.js";import"../../models/data/customer/review/summary/index.js";import"../../models/data/customer/review/index.js";import"../../models/data/customer/index.js";import"../../models/data/district/index.js";import"../../models/data/favorite-product/index.js";import"../../models/data/filter-category/index.js";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/order/address/index.js";import"../../models/data/order/line-item/option/value/index.js";import"../../models/data/order/line-item/variant/value/index.js";import"../../models/data/order/line-item/variant/index.js";import"../../models/data/order/line-item/index.js";import"../../models/data/order/package/index.js";import"../../models/data/order/transaction/index.js";import"../../models/data/order/index.js";import"../../models/data/payment-gateway/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product/filter/index.js";import"../../models/data/product/option-set/option/index.js";import"../../models/data/product/option-set/index.js";import"../../models/data/product/stock-location/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/index.js";import"../../models/data/raffle/index.js";import"../../models/data/state/index.js";import"../../models/data/theme-json/index.js";import"../../models/data/theme-json/custom-data/index.js";import"../../models/data/variant-type/variant-value/index.js";import"@ikas/localized-address";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-list/index.js";import"../../models/ui/product-attribute-detail/index.js";import"../../models/ui/product-attribute-list/index.js";import"../../models/ui/customer-review-list/index.js";import"../../models/ui/customer-review-summary-list/index.js";import"../../models/ui/validator/index.js";import"../../models/ui/validator/rules/index.js";import"../../models/ui/validator/form/login.js";import"../../models/ui/validator/form/address.js";import"../../models/ui/validator/form/ikas-address.js";import"../../models/ui/validator/form/register.js";import"../../models/ui/validator/form/contact-form.js";import"../../models/ui/validator/form/forgot-password.js";import"../../models/ui/validator/form/recover-password.js";import"../../models/ui/validator/form/account-info.js";import"../../models/ui/validator/form/raffle-form.js";import"../../models/ui/validator/form/customer-review.js";import"../../models/ui/raffle-list/index.js";import{IkasStorefrontConfig as s}from"@ikas/storefront-config";import"../../analytics/analytics.js";import"../../analytics/head/index.js";import"./index.js";import"next/image.js";import"@ikas/storefront-model-functions";import"../link/index.js";import"../page-editor/loader/style.module.scss.js";import"../google-captcha/index.js";import"../../pages/home.js";import"../../pages/_slug_/index.js";import"../../pages/pages/_slug_.js";import"../../pages/checkout.js";import"../../pages/account/index.js";import"../../pages/account/addresses.js";import"../../pages/account/orders/index.js";import"../../pages/account/orders/_id_.js";import"../../pages/account/login.js";import"../../pages/account/register.js";import"../../pages/account/forgot-password.js";import"../../pages/account/recover-password.js";import"../../pages/cart.js";import"../../pages/editor.js";import"../../pages/account/favorite-products.js";import"../../pages/search.js";import"next/error.js";import"../../pages/blog/index.js";import"../../pages/blog/_slug_.js";import"../../pages/raffle/_slug_.js";import"../../pages/raffle/index.js";import"../../pages/account/raffles.js";import"../../pages/account/activate.js";import{IkasBaseStore as n}from"../../store/base.js";import"../../store/customer/index.js";import"../../store/cart/index.js";import"lodash/get";var d=o((function(o){var n=o.pageType,d=o.pageTitle,p=o.pageDescription,c=o.canonicals,u=o.disableIndex,g=o.pageSpecificData,j=o.merchantSettings,f=o.addOgpMetas,v=o.productReviewSummary,h=r(),x="undefined"!=typeof window,y="local"===process.env.NEXT_PUBLIC_ENV,b=h.asPath.split("?")[0].replace("/",""),k=s.getRoutings().filter((function(e){return e.id!==s.getStorefrontRoutingId()})),w=s.getCurrentRouting(),C=(null==w?void 0:w.path)?"/"+w.path:"",E=y?"http://localhost:3333":"https://"+s.getDomain();t.useEffect((function(){document.documentElement.lang=s.getCurrentLocale()}),[n,g]);var L=t.useMemo((function(){if(g&&g.href)return"".concat(E).concat(g.href)}),[g]),T=t.useMemo((function(){var e=[];if(f)if(e.push({property:"og:type",content:"website"}),e.push({property:"og:site_name",content:"https://"+s.getDomain()}),d&&e.push({property:"og:title",content:d}),p&&e.push({property:"og:description",content:p}),e.push({property:"og:url",content:L||(x?window.location.href:"")||"https://".concat(s.getDomain())}),g&&n===i.PRODUCT){var t=g.selectedVariant.mainImage;(null==t?void 0:t.image)&&e.push({property:"og:image",content:t.image.src})}else(null==j?void 0:j.logo)&&e.push({property:"og:image",content:j.logo.src});return e}),[d,g,L,p,j,f,j]),D=t.useMemo((function(){var t=[];if(j){var o={"@context":"https://schema.org","@type":"Website",url:"https://"+s.getDomain()},a=function(t){var o,a,r,i,n,d,m=(null==t?void 0:t.logo)?t.logo.src:void 0;return{"@context":"https://schema.org","@type":"Store",name:null==t?void 0:t.merchantName,logo:m,image:m,url:"https://"+s.getDomain(),telephone:null==t?void 0:t.phone,address:e(e({"@type":"PostalAddress",streetAddress:null===(o=t.address)||void 0===o?void 0:o.addressLine1,addressLocality:null===(r=null===(a=t.address)||void 0===a?void 0:a.city)||void 0===r?void 0:r.name},t.address&&t.address.state&&{addressRegion:t.address.state.code}),{postalCode:null===(i=t.address)||void 0===i?void 0:i.postalCode,addressCountry:null===(d=null===(n=t.address)||void 0===n?void 0:n.country)||void 0===d?void 0:d.code})}}(j);t.push(o),t.push(a)}if(g&&n===i.PRODUCT){var r=g,d=function(t,o){var a,r,i,n;try{var d="https://".concat(s.getDomain()).concat(t.href),m=t.selectedVariant;return e(e({"@context":"https://schema.org/","@type":"Product",name:t.name,description:null===(a=t.metaData)||void 0===a?void 0:a.description,image:null===(r=m.images)||void 0===r?void 0:r.map((function(e){return e.image?e.image.src:""})),productId:m.id,sku:m.sku,mpn:(null===(i=m.barcodeList)||void 0===i?void 0:i.length)?m.barcodeList[0]:"",brand:{"@type":"Brand",name:null===(n=t.brand)||void 0===n?void 0:n.name}},o&&{aggregateRating:{"@type":"AggregateRating",ratingValue:o.averageStar,reviewCount:o.totalReview}}),{offers:{"@type":"Offer",url:d,priceCurrency:m.price.currency||"TRY",price:m.price.finalPrice,priceValidUntil:"",itemCondition:"https://schema.org/NewCondition",availability:m.stock>0?"https://schema.org/InStock":"https://schema.org/OutOfStock"}})}catch(e){}}(r,v||null);if(d&&t.push(d),r.categories.length)(p=m(r.categories[0]))&&t.push(p)}if(g&&n===i.CATEGORY){var l=function(e){var t,o;try{return{"@context":"http://schema.org","@type":"CollectionPage",url:"https://".concat(s.getDomain()).concat(e.href),name:null===(t=e.metaData)||void 0===t?void 0:t.pageTitle,description:null===(o=e.metaData)||void 0===o?void 0:o.description,image:e.image?e.image.src:void 0}}catch(e){}}(g),p=m(g);l&&t.push(l),p&&t.push(p)}return t}),[g,j]),R=t.useMemo((function(){var e,t=null===(e=s.getMetaTemplates())||void 0===e?void 0:e.find((function(e){return e.locale===s.getCurrentLocale()&&e.pageType===n}));return t?l(g,n,t.titleTemplate||""):null}),[n,g]),_=t.useMemo((function(){var e,t=null===(e=s.getMetaTemplates())||void 0===e?void 0:e.find((function(e){return e.locale===s.getCurrentLocale()&&e.pageType===n}));return t?l(g,n,t.descriptionTemplate||""):null}),[n,g]);return t.createElement(a,null,t.createElement("title",null,d||R||""),t.createElement("meta",{name:"description",content:p||_||""}),k.map((function(e){return t.createElement("link",{key:e.id,rel:"alternate",hrefLang:e.locale,href:"".concat(E+(e.path?"/"+e.path:""),"/").concat(b)})})),!!w&&!!k.length&&t.createElement("link",{key:"current-routing-hreflang",rel:"alternate",hrefLang:w.locale,href:"".concat(E).concat(C,"/").concat(b)}),!!u&&t.createElement("meta",{name:"robots",content:"noindex"}),!!f&&T.map((function(e,o){return t.createElement("meta",{key:"".concat(e.content,"-").concat(o),property:e.property,content:e.content})})),!!c&&c.map((function(e,o){return t.createElement("link",{key:o+"url",rel:"canonical",href:"".concat(E).concat(C).concat(e)})})),t.createElement("link",{rel:"canonical",href:"".concat(E).concat(C,"/").concat(b)}),!!D.length&&D.map((function(e,o){return t.createElement("script",{key:o,type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(e)}})})))}));function m(e){try{var t=n.getInstance(),o=e.categoryPathItems.map((function(e,t){return{"@type":"ListItem",position:t+1,name:e.name,item:"https://"+s.getDomain()+e.href}}));return t.currentPageType===i.CATEGORY&&o.push({"@type":"ListItem",position:e.categoryPathItems.length+1,name:e.name,item:"https://"+s.getDomain()+e.href}),{"@context":"http://schema.org","@type":"BreadcrumbList",itemListElement:e.categoryPathItems.length?o:[{"@type":"ListItem",position:1,name:e.name,item:"https://"+s.getDomain()+e.href}]}}catch(e){}}function l(e,t,o){var a,r,s=o;try{switch(t){case i.PRODUCT:var n=e,d=n.name,m=(null===(a=n.brand)||void 0===a?void 0:a.name)||"",l=n.selectedVariant.sku||"",p=(null===(r=n.selectedVariant.barcodeList)||void 0===r?void 0:r.length)?n.selectedVariant.barcodeList[0]:"";s.includes("{{name}}")&&(s=s.replace("{{name}}",d)),s.includes("{{brand}}")&&(s=s.replace("{{brand}}",m)),s.includes("{{sku}}")&&(s=s.replace("{{sku}}",l)),s.includes("{{barcode}}")&&(s=s.replace("{{barcode}}",p));break;case i.BRAND:case i.CATEGORY:case i.BLOG_CATEGORY:var c=e.name||"";s.includes("{{name}}")&&(s=s.replace("{{name}}",c));break;case i.BLOG:var u=e.title;s.includes("{{name}}")&&(s=s.replace("{{name}}",u))}}catch(e){}return s.trimEnd()}export{d as IkasPageHead};
|
|
1
|
+
import{__assign as e}from'./../../ext/tslib/tslib.es6.js';import*as t from"react";import{observer as o}from"mobx-react-lite";import a from"next/head.js";import{useRouter as r}from"next/router";import"../../models/data/blog/category/index.js";import"../../models/data/blog/content/index.js";import"../../models/data/blog/meta-data/index.js";import"../../models/data/blog/tag/index.js";import"../../models/data/blog/index.js";import"../../models/data/brand/index.js";import{IkasThemeJsonPageType as i}from"@ikas/storefront-models";import"mobx";import"../../models/data/campaign-offer/index.js";import"../../models/data/cart/campaign-offer/index.js";import"../../models/data/cart/index.js";import"../../models/data/category/path-item/index.js";import"../../models/data/category/index.js";import"../../models/data/checkout/index.js";import"../../models/data/checkout-settings/index.js";import"../../models/data/city/index.js";import"../../models/data/country/index.js";import"../../models/data/customer/address/index.js";import"../../models/data/customer/address/ikas-localized-customer-address.js";import"../../models/data/customer/attribute/index.js";import"../../models/data/customer/review/summary/index.js";import"../../models/data/customer/review/index.js";import"../../models/data/customer/index.js";import"../../models/data/district/index.js";import"../../models/data/favorite-product/index.js";import"../../models/data/filter-category/index.js";import"../../models/data/html-meta-data/index.js";import"../../models/data/image/index.js";import"../../models/data/order/address/index.js";import"../../models/data/order/line-item/option/value/index.js";import"../../models/data/order/line-item/variant/value/index.js";import"../../models/data/order/line-item/variant/index.js";import"../../models/data/order/line-item/index.js";import"../../models/data/order/package/index.js";import"../../models/data/order/transaction/index.js";import"../../models/data/order/index.js";import"../../models/data/payment-gateway/index.js";import"../../models/data/product/attribute-value/index.js";import"../../models/data/product/filter/index.js";import"../../models/data/product/option-set/option/index.js";import"../../models/data/product/option-set/index.js";import"../../models/data/product/stock-location/index.js";import"../../models/data/product/variant/price/index.js";import"../../models/data/product/variant/index.js";import"../../models/data/variant-type/index.js";import"../../models/data/product/index.js";import"../../models/data/raffle/index.js";import"../../models/data/state/index.js";import"../../models/data/theme-json/index.js";import"../../models/data/theme-json/custom-data/index.js";import"../../models/data/variant-type/variant-value/index.js";import"@ikas/localized-address";import"../../models/ui/blog-list/index.js";import"../../models/ui/blog-category-list/index.js";import"../../models/ui/brand-list/index.js";import"../../models/ui/category-list/index.js";import"../../models/ui/product-list/index.js";import"../../models/ui/product-attribute-detail/index.js";import"../../models/ui/product-attribute-list/index.js";import"../../models/ui/customer-review-list/index.js";import"../../models/ui/customer-review-summary-list/index.js";import"../../models/ui/validator/index.js";import"../../models/ui/validator/rules/index.js";import"../../models/ui/validator/form/login.js";import"../../models/ui/validator/form/address.js";import"../../models/ui/validator/form/ikas-address.js";import"../../models/ui/validator/form/register.js";import"../../models/ui/validator/form/contact-form.js";import"../../models/ui/validator/form/forgot-password.js";import"../../models/ui/validator/form/recover-password.js";import"../../models/ui/validator/form/account-info.js";import"../../models/ui/validator/form/raffle-form.js";import"../../models/ui/validator/form/customer-review.js";import"../../models/ui/raffle-list/index.js";import{IkasStorefrontConfig as s}from"@ikas/storefront-config";import"../../analytics/analytics.js";import"../../analytics/head/index.js";import"./index.js";import"next/image.js";import"@ikas/storefront-model-functions";import"../link/index.js";import"../page-editor/loader/style.module.scss.js";import"../google-captcha/index.js";import"../../pages/home.js";import"../../pages/_slug_/index.js";import"../../pages/pages/_slug_.js";import"../../pages/checkout.js";import"../../pages/account/index.js";import"../../pages/account/addresses.js";import"../../pages/account/orders/index.js";import"../../pages/account/orders/_id_.js";import"../../pages/account/login.js";import"../../pages/account/register.js";import"../../pages/account/forgot-password.js";import"../../pages/account/recover-password.js";import"../../pages/cart.js";import"../../pages/editor.js";import"../../pages/account/favorite-products.js";import"../../pages/search.js";import"next/error.js";import"../../pages/blog/index.js";import"../../pages/blog/_slug_.js";import"../../pages/raffle/_slug_.js";import"../../pages/raffle/index.js";import"../../pages/account/raffles.js";import"../../pages/account/activate.js";import{IkasBaseStore as n}from"../../store/base.js";import"../../store/customer/index.js";import"../../store/cart/index.js";import"lodash/get";var d=o((function(o){var n=o.pageType,d=o.pageTitle,c=o.pageDescription,p=o.canonicals,u=o.disableIndex,g=o.pageSpecificData,j=o.merchantSettings,f=o.addOgpMetas,v=o.productReviewSummary,h=r(),x="undefined"!=typeof window,y="local"===process.env.NEXT_PUBLIC_ENV,b=h.asPath.split("?")[0].replace("/","");b="/"===b.charAt(b.length-1)?b.slice(0,-1):b;var k=s.getRoutings().filter((function(e){return e.id!==s.getStorefrontRoutingId()})),C=s.getCurrentRouting(),E=(null==C?void 0:C.path)?"/"+C.path:"",T=y?"http://localhost:3333":"https://"+s.getDomain();t.useEffect((function(){document.documentElement.lang=s.getCurrentLocale()}),[n,g]);var w=t.useMemo((function(){if(g&&g.href)return"".concat(T).concat(g.href)}),[g]),L=t.useMemo((function(){var e=[];if(f)if(e.push({property:"og:type",content:"website"}),e.push({property:"og:site_name",content:"https://"+s.getDomain()}),d&&e.push({property:"og:title",content:d}),c&&e.push({property:"og:description",content:c}),e.push({property:"og:url",content:w||(x?window.location.href:"")||"https://".concat(s.getDomain())}),g&&n===i.PRODUCT){var t=g.selectedVariant.mainImage;(null==t?void 0:t.image)&&e.push({property:"og:image",content:t.image.src})}else(null==j?void 0:j.logo)&&e.push({property:"og:image",content:j.logo.src});return e}),[d,g,w,c,j,f,j]),D=t.useMemo((function(){var t=[];if(j){var o={"@context":"https://schema.org","@type":"Website",url:"https://"+s.getDomain()},a=function(t){var o,a,r,i,n,d,m=(null==t?void 0:t.logo)?t.logo.src:void 0;return{"@context":"https://schema.org","@type":"Store",name:null==t?void 0:t.merchantName,logo:m,image:m,url:"https://"+s.getDomain(),telephone:null==t?void 0:t.phone,address:e(e({"@type":"PostalAddress",streetAddress:null===(o=t.address)||void 0===o?void 0:o.addressLine1,addressLocality:null===(r=null===(a=t.address)||void 0===a?void 0:a.city)||void 0===r?void 0:r.name},t.address&&t.address.state&&{addressRegion:t.address.state.code}),{postalCode:null===(i=t.address)||void 0===i?void 0:i.postalCode,addressCountry:null===(d=null===(n=t.address)||void 0===n?void 0:n.country)||void 0===d?void 0:d.code})}}(j);t.push(o),t.push(a)}if(g&&n===i.PRODUCT){var r=g,d=function(t,o){var a,r,i,n;try{var d="https://".concat(s.getDomain()).concat(t.href),m=t.selectedVariant;return e(e({"@context":"https://schema.org/","@type":"Product",name:t.name,description:null===(a=t.metaData)||void 0===a?void 0:a.description,image:null===(r=m.images)||void 0===r?void 0:r.map((function(e){return e.image?e.image.src:""})),productId:m.id,sku:m.sku,mpn:(null===(i=m.barcodeList)||void 0===i?void 0:i.length)?m.barcodeList[0]:"",brand:{"@type":"Brand",name:null===(n=t.brand)||void 0===n?void 0:n.name}},o&&{aggregateRating:{"@type":"AggregateRating",ratingValue:o.averageStar,reviewCount:o.totalReview}}),{offers:{"@type":"Offer",url:d,priceCurrency:m.price.currency||"TRY",price:m.price.finalPrice,priceValidUntil:"",itemCondition:"https://schema.org/NewCondition",availability:m.stock>0?"https://schema.org/InStock":"https://schema.org/OutOfStock"}})}catch(e){}}(r,v||null);if(d&&t.push(d),r.categories.length)(c=m(r.categories[0]))&&t.push(c)}if(g&&n===i.CATEGORY){var l=function(e){var t,o;try{return{"@context":"http://schema.org","@type":"CollectionPage",url:"https://".concat(s.getDomain()).concat(e.href),name:null===(t=e.metaData)||void 0===t?void 0:t.pageTitle,description:null===(o=e.metaData)||void 0===o?void 0:o.description,image:e.image?e.image.src:void 0}}catch(e){}}(g),c=m(g);l&&t.push(l),c&&t.push(c)}return t}),[g,j]),R=t.useMemo((function(){var e,t=null===(e=s.getMetaTemplates())||void 0===e?void 0:e.find((function(e){return e.locale===s.getCurrentLocale()&&e.pageType===n}));return t?l(g,n,t.titleTemplate||""):null}),[n,g]),_=t.useMemo((function(){var e,t=null===(e=s.getMetaTemplates())||void 0===e?void 0:e.find((function(e){return e.locale===s.getCurrentLocale()&&e.pageType===n}));return t?l(g,n,t.descriptionTemplate||""):null}),[n,g]),O=t.useCallback((function(){var e=s.getCustom();return!!e&&!!e.isEPayKolayEnabled}),[]);return t.createElement(a,null,t.createElement("title",null,d||R||""),t.createElement("meta",{name:"description",content:c||_||""}),n===i.CHECKOUT&&O()&&t.createElement("script",{type:"text/javascript",src:"https://cdn.myikas.com/sf/static/e-pay-kolay/containerServices.js"}),k.map((function(e){return t.createElement("link",{key:e.id,rel:"alternate",hrefLang:e.locale,href:"".concat(T+(e.path?"/"+e.path:""),"/").concat(b)})})),!!C&&!!k.length&&t.createElement("link",{key:"current-routing-hreflang",rel:"alternate",hrefLang:C.locale,href:"".concat(T).concat(E,"/").concat(b)}),!!u&&t.createElement("meta",{name:"robots",content:"noindex"}),!!f&&L.map((function(e,o){return t.createElement("meta",{key:"".concat(e.content,"-").concat(o),property:e.property,content:e.content})})),!!p&&p.map((function(e,o){return t.createElement("link",{key:o+"url",rel:"canonical",href:"".concat(T).concat(E).concat(e)})})),t.createElement("link",{rel:"canonical",href:"".concat(T).concat(E,"/").concat(b)}),!!D.length&&D.map((function(e,o){return t.createElement("script",{key:o,type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(e)}})})))}));function m(e){try{var t=n.getInstance(),o=e.categoryPathItems.map((function(e,t){return{"@type":"ListItem",position:t+1,name:e.name,item:"https://"+s.getDomain()+e.href}}));return t.currentPageType===i.CATEGORY&&o.push({"@type":"ListItem",position:e.categoryPathItems.length+1,name:e.name,item:"https://"+s.getDomain()+e.href}),{"@context":"http://schema.org","@type":"BreadcrumbList",itemListElement:e.categoryPathItems.length?o:[{"@type":"ListItem",position:1,name:e.name,item:"https://"+s.getDomain()+e.href}]}}catch(e){}}function l(e,t,o){var a,r,s=o;try{switch(t){case i.PRODUCT:var n=e,d=n.name,m=(null===(a=n.brand)||void 0===a?void 0:a.name)||"",l=n.selectedVariant.sku||"",c=(null===(r=n.selectedVariant.barcodeList)||void 0===r?void 0:r.length)?n.selectedVariant.barcodeList[0]:"";s.includes("{{name}}")&&(s=s.replace("{{name}}",d)),s.includes("{{brand}}")&&(s=s.replace("{{brand}}",m)),s.includes("{{sku}}")&&(s=s.replace("{{sku}}",l)),s.includes("{{barcode}}")&&(s=s.replace("{{barcode}}",c));break;case i.BRAND:case i.CATEGORY:case i.BLOG_CATEGORY:var p=e.name||"";s.includes("{{name}}")&&(s=s.replace("{{name}}",p));break;case i.BLOG:var u=e.title;s.includes("{{name}}")&&(s=s.replace("{{name}}",u))}}catch(e){}return s.trimEnd()}export{d as IkasPageHead};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ikas/storefront",
|
|
3
|
-
"version": "4.5.
|
|
3
|
+
"version": "4.5.1-beta.1",
|
|
4
4
|
"description": "Storefront functionality for ikas storefront themes.",
|
|
5
5
|
"author": "ikas",
|
|
6
6
|
"license": "ISC",
|
|
@@ -17,11 +17,11 @@
|
|
|
17
17
|
"build": "rm -rf build && rollup -c"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"@ikas/storefront-api": "^4.5.
|
|
21
|
-
"@ikas/storefront-config": "^4.5.
|
|
22
|
-
"@ikas/storefront-model-functions": "^4.5.
|
|
23
|
-
"@ikas/storefront-models": "^4.5.
|
|
24
|
-
"@ikas/storefront-providers": "^4.5.
|
|
20
|
+
"@ikas/storefront-api": "^4.5.1-beta.1",
|
|
21
|
+
"@ikas/storefront-config": "^4.5.1-beta.1",
|
|
22
|
+
"@ikas/storefront-model-functions": "^4.5.1-beta.1",
|
|
23
|
+
"@ikas/storefront-models": "^4.5.1-beta.1",
|
|
24
|
+
"@ikas/storefront-providers": "^4.5.1-beta.1",
|
|
25
25
|
"@ikas/localized-address": "^1.0.0-beta.2",
|
|
26
26
|
"@adyen/adyen-web": "^5.28.2",
|
|
27
27
|
"@rollup/plugin-commonjs": "^22.0.0",
|
|
@@ -55,11 +55,11 @@
|
|
|
55
55
|
},
|
|
56
56
|
"peerDependencies": {
|
|
57
57
|
"@ikas/localized-address": "^1.0.0-beta.2",
|
|
58
|
-
"@ikas/storefront-api": "^4.5.
|
|
59
|
-
"@ikas/storefront-config": "^4.5.
|
|
60
|
-
"@ikas/storefront-model-functions": "^4.5.
|
|
61
|
-
"@ikas/storefront-models": "^4.5.
|
|
62
|
-
"@ikas/storefront-providers": "^4.5.
|
|
58
|
+
"@ikas/storefront-api": "^4.5.1-beta.1",
|
|
59
|
+
"@ikas/storefront-config": "^4.5.1-beta.1",
|
|
60
|
+
"@ikas/storefront-model-functions": "^4.5.1-beta.1",
|
|
61
|
+
"@ikas/storefront-models": "^4.5.1-beta.1",
|
|
62
|
+
"@ikas/storefront-providers": "^4.5.1-beta.1",
|
|
63
63
|
"mobx": "^6.1.3",
|
|
64
64
|
"mobx-react-lite": "^3.1.5",
|
|
65
65
|
"next": "12.2.0",
|