@cimplify/sdk 0.109.0 → 0.111.0
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/CHANGELOG.md +54 -0
- package/README.md +18 -0
- package/dist/advanced.d.mts +4 -4
- package/dist/advanced.d.ts +4 -4
- package/dist/advanced.js +22 -22
- package/dist/advanced.mjs +3 -3
- package/dist/{audio-XU2sFNyO.d.mts → audio-DhvyjqdA.d.mts} +2 -2
- package/dist/{audio-8Igdy2WK.d.ts → audio-m0w8cnxq.d.ts} +2 -2
- package/dist/avatars.js +21 -21
- package/dist/avatars.mjs +3 -3
- package/dist/{backend-L4d_Ha0J.d.mts → backend-gUCzs5Kg.d.mts} +16 -2
- package/dist/{backend-L4d_Ha0J.d.ts → backend-gUCzs5Kg.d.ts} +16 -2
- package/dist/{catalogue-DLLsfuNg.d.ts → catalogue-1QcoGDO6.d.ts} +2 -2
- package/dist/{catalogue-BeBFWlHF.d.mts → catalogue-FdFQiWrU.d.mts} +2 -2
- package/dist/{chunk-HF2MZKP2.mjs → chunk-22BD3RHN.mjs} +6 -3
- package/dist/{chunk-B54P6RL2.js → chunk-2AQ237Y4.js} +30 -30
- package/dist/{chunk-W3VVG4NL.js → chunk-2O2CG465.js} +14 -2
- package/dist/{chunk-UPHTPBNQ.mjs → chunk-2QTQ6BUH.mjs} +1 -1
- package/dist/{chunk-BS65NRDW.js → chunk-3S6WPBZL.js} +16 -16
- package/dist/{chunk-PEZYNYJE.js → chunk-3TUOUP5T.js} +3 -3
- package/dist/{chunk-EB6EAOM5.mjs → chunk-3VEH23I5.mjs} +7 -10
- package/dist/{chunk-SYEO2WV4.mjs → chunk-42JTCWIE.mjs} +3 -3
- package/dist/{chunk-FB6YH2WW.js → chunk-4C7I3ELN.js} +4 -4
- package/dist/{chunk-UQYO3OM7.js → chunk-4ZDR72SG.js} +1 -2
- package/dist/{chunk-HPKKCUHU.js → chunk-52YS45RR.js} +13 -13
- package/dist/{chunk-6YVELDFK.mjs → chunk-5BYDGGWO.mjs} +1 -1
- package/dist/{chunk-YN24DET4.js → chunk-5HFMY3D7.js} +10 -10
- package/dist/{chunk-4CVB2ZTC.js → chunk-5LH2QN3T.js} +32 -29
- package/dist/{chunk-4A24F4ZV.mjs → chunk-5YFBGGCK.mjs} +4 -1
- package/dist/{chunk-NLAT3DB2.mjs → chunk-6DAEZKIG.mjs} +1 -1
- package/dist/{chunk-F6CHJXXK.mjs → chunk-6DATW7TB.mjs} +3 -3
- package/dist/{chunk-4RYATNVK.mjs → chunk-6H254EVP.mjs} +6 -11
- package/dist/{chunk-32U4BVJA.mjs → chunk-6PJWXIFX.mjs} +1 -1
- package/dist/{chunk-OMTVH334.js → chunk-6QANXRUM.js} +203 -186
- package/dist/{chunk-BHAGIIBI.js → chunk-6WUBSMTX.js} +82 -85
- package/dist/{chunk-EPYFN2A3.js → chunk-7AAIAVAA.js} +24 -20
- package/dist/{chunk-HZC27ICH.mjs → chunk-7BHW5GTC.mjs} +3 -3
- package/dist/{chunk-MB425DVA.mjs → chunk-7IQQQENP.mjs} +2 -2
- package/dist/{chunk-DJUUL67Z.js → chunk-7KFTYENS.js} +296 -296
- package/dist/{chunk-XLQSNQMP.js → chunk-7SM6XSPZ.js} +339 -339
- package/dist/{chunk-NBH64BDP.mjs → chunk-A33OORT7.mjs} +13 -1
- package/dist/{chunk-G2SXLGFY.js → chunk-A7BU3BK4.js} +7 -7
- package/dist/{chunk-ZNWS7NOW.mjs → chunk-A7V4L2IT.mjs} +2 -2
- package/dist/{chunk-O3SITS4R.mjs → chunk-AGV33FWC.mjs} +4 -4
- package/dist/{chunk-Z2DE3EHS.js → chunk-AHNR3BXI.js} +7 -7
- package/dist/{chunk-UQ4BHMLS.mjs → chunk-AQ5RLBU2.mjs} +5 -5
- package/dist/{chunk-J4HU2YQB.js → chunk-AQOE6WCG.js} +2 -2
- package/dist/{chunk-X57B7VQC.js → chunk-AYJPHKYV.js} +22 -22
- package/dist/{chunk-6XTWY6MH.js → chunk-AZAXD44P.js} +126 -42
- package/dist/{chunk-6ETDAU62.mjs → chunk-B45X3HPO.mjs} +98 -39
- package/dist/{chunk-QDW4EPWS.mjs → chunk-BBGKQIJJ.mjs} +1 -1
- package/dist/{chunk-NHYTO4VU.js → chunk-BP4JLSUA.js} +111 -120
- package/dist/{chunk-7INQVOHY.mjs → chunk-BU6OK542.mjs} +25 -8
- package/dist/{chunk-MKIJQL5Q.js → chunk-CJVEJPIG.js} +69 -69
- package/dist/{chunk-W23VX5MY.js → chunk-CVSRWM6W.js} +5 -5
- package/dist/{chunk-A7DK7QAG.mjs → chunk-CYBMFMJD.mjs} +1 -1
- package/dist/{chunk-BOTUAHP2.mjs → chunk-DS2VU4WW.mjs} +5 -20
- package/dist/{chunk-HMMFNLXZ.js → chunk-DSAG7T5P.js} +2 -2
- package/dist/{chunk-7GG4KNTL.mjs → chunk-E65WCTIG.mjs} +8 -4
- package/dist/{chunk-WXDVEXTW.mjs → chunk-ECDK6QBF.mjs} +1 -1
- package/dist/{chunk-5IRV36MS.mjs → chunk-EIB4OWVQ.mjs} +1 -1
- package/dist/{chunk-JLJ4FD5H.js → chunk-EQUZYCGO.js} +18 -18
- package/dist/{chunk-Q2Y3VMKH.js → chunk-ETZDIISN.js} +151 -151
- package/dist/{chunk-AKTWH3KJ.mjs → chunk-F3UJ6ZRM.mjs} +2 -2
- package/dist/{chunk-J6HRY5EQ.js → chunk-F63N2ZTQ.js} +232 -232
- package/dist/{chunk-MUEFTPNN.js → chunk-FE6VCE4K.js} +34 -34
- package/dist/{chunk-GCKWKLZF.mjs → chunk-FT6GFYJL.mjs} +17 -3
- package/dist/{chunk-2UYTS7SL.mjs → chunk-GCX7TY4D.mjs} +16 -16
- package/dist/{chunk-QDLMIHUH.js → chunk-GDB6TCSD.js} +7 -7
- package/dist/{chunk-7S7LDFGH.js → chunk-GDZT5LZ5.js} +12 -12
- package/dist/{chunk-TB2LS4CE.mjs → chunk-GHS6MIL6.mjs} +7 -11
- package/dist/{chunk-7OHZ56N7.mjs → chunk-GXKI64OT.mjs} +4 -4
- package/dist/{chunk-HRSIIDOZ.js → chunk-H3OQKK6X.js} +41 -41
- package/dist/{chunk-56BM75QX.js → chunk-H5DFSCJ6.js} +2 -2
- package/dist/{chunk-LMK775I4.mjs → chunk-HAGEIC2L.mjs} +1 -1
- package/dist/{chunk-6FZDMICK.js → chunk-HAJ4JRFO.js} +15 -15
- package/dist/{chunk-AWR2G5QN.js → chunk-HDR72GB6.js} +6 -11
- package/dist/{chunk-PTT6KIM6.js → chunk-HSEO6TPU.js} +9 -9
- package/dist/{chunk-CQSA2D2O.js → chunk-I5FOHCLH.js} +4 -31
- package/dist/{chunk-TMFB55IR.js → chunk-J2U6PJSO.js} +3 -30
- package/dist/{chunk-W77VO6LP.js → chunk-J5AJNY2N.js} +13 -13
- package/dist/{chunk-UKA7LHIT.js → chunk-JR3TNEQC.js} +98 -98
- package/dist/{chunk-P2O34BIO.mjs → chunk-JURRXY2J.mjs} +1 -1
- package/dist/{chunk-PKMVOVUA.mjs → chunk-K3HW5I2A.mjs} +1 -1
- package/dist/{chunk-BXUGKBMK.mjs → chunk-KDQOR4QQ.mjs} +1 -14
- package/dist/{chunk-KVZSYGTX.mjs → chunk-KGHJH5KJ.mjs} +1 -1
- package/dist/{chunk-3AKWZF3X.mjs → chunk-KK6HYVBI.mjs} +1 -1
- package/dist/{chunk-K6GK5B5J.js → chunk-KMKWGXMK.js} +6 -6
- package/dist/{chunk-EH4UG7IL.mjs → chunk-KU7O4IXU.mjs} +4 -4
- package/dist/{chunk-IHRMR3WV.mjs → chunk-KVFNRJOR.mjs} +9 -9
- package/dist/{chunk-A36JRXXH.mjs → chunk-KWZHIPRN.mjs} +26 -9
- package/dist/{chunk-HBZQ5HSV.mjs → chunk-LIV3KXJG.mjs} +1 -1
- package/dist/{chunk-S75PBSSL.mjs → chunk-ME6HGG4I.mjs} +92 -8
- package/dist/{chunk-SNNEOS5Z.js → chunk-MHDUUSG6.js} +75 -75
- package/dist/{chunk-FKYZCXFM.js → chunk-MIPO6F72.js} +3 -3
- package/dist/{chunk-MFWIHTEN.js → chunk-MTIHEW2M.js} +5 -5
- package/dist/{chunk-UCR5HRYM.js → chunk-NFXCKTE2.js} +17 -3
- package/dist/{chunk-M53GR3ZV.mjs → chunk-NHJUGZUR.mjs} +43 -5
- package/dist/{chunk-FAYK2MN6.js → chunk-NZTKLY2W.js} +14 -18
- package/dist/{chunk-EQW6PFC2.js → chunk-O2ICABUD.js} +2 -2
- package/dist/{chunk-5PW6DVHF.js → chunk-OIVVQQ22.js} +55 -37
- package/dist/{chunk-GBJ5CW3A.js → chunk-PKOZXD2Q.js} +30 -30
- package/dist/{chunk-NGN3JE5A.js → chunk-PQTQKNKD.js} +16 -7
- package/dist/{chunk-DFZWHNRG.js → chunk-QOCHWR4V.js} +105 -42
- package/dist/{chunk-PCVVQNBD.js → chunk-QS6TRHMR.js} +5 -5
- package/dist/{chunk-DXZZ27CV.js → chunk-RKBLPGPV.js} +245 -207
- package/dist/{chunk-765P2G7G.mjs → chunk-RUVGVNOF.mjs} +1 -1
- package/dist/{chunk-NJ7ZWH4U.mjs → chunk-SAFJIGYB.mjs} +1 -1
- package/dist/{chunk-AOPH2IZV.js → chunk-SKQFLBDD.js} +60 -22
- package/dist/{chunk-BUUA5XJV.js → chunk-TWM6DLYF.js} +2 -2
- package/dist/{chunk-YPL5TKI4.mjs → chunk-U6UVWEAK.mjs} +1 -1
- package/dist/{chunk-6YQDHXPL.mjs → chunk-UCEPNO6N.mjs} +46 -9
- package/dist/{chunk-U7RULAEP.mjs → chunk-UG5BTOTF.mjs} +2 -2
- package/dist/{chunk-MITGBWV7.mjs → chunk-UGH37BQW.mjs} +1 -1
- package/dist/{chunk-IZDWAL53.mjs → chunk-UJDQQTBS.mjs} +8 -8
- package/dist/{chunk-URRZ2SMI.mjs → chunk-V7ZRH3PY.mjs} +2 -2
- package/dist/{chunk-3H76N7G5.mjs → chunk-VBGHBL3E.mjs} +8 -17
- package/dist/{chunk-AZC2LTUI.js → chunk-VVE3Y76O.js} +2 -2
- package/dist/{chunk-BRAA7U3I.mjs → chunk-W65JIRI4.mjs} +1 -1
- package/dist/{chunk-KU4EDEKA.js → chunk-WKWTDZS7.js} +9 -9
- package/dist/{chunk-BTUSVHIE.mjs → chunk-WLSU5QJT.mjs} +2 -2
- package/dist/{chunk-NTTHAXHI.js → chunk-X5A5FOWW.js} +11 -8
- package/dist/{chunk-ODL55PYL.mjs → chunk-XD2PMH46.mjs} +16 -7
- package/dist/{chunk-OADW5BSV.js → chunk-XK6UDWJS.js} +2 -2
- package/dist/{chunk-7ZTEVNXO.mjs → chunk-Y65LXQGA.mjs} +8 -8
- package/dist/{chunk-Z3PGQRTX.mjs → chunk-Y66WVMO5.mjs} +3 -30
- package/dist/{chunk-VZAJDN5C.mjs → chunk-Y7JWLB25.mjs} +1 -1
- package/dist/{chunk-ZJGPD42I.js → chunk-YCDXAJKU.js} +3 -3
- package/dist/{chunk-NCTLCSLE.mjs → chunk-Z3A3AFVU.mjs} +1 -1
- package/dist/{chunk-AEEF3T2E.mjs → chunk-ZCY6YKKP.mjs} +3 -3
- package/dist/{chunk-M5FWHML6.js → chunk-ZMIL4ZOA.js} +5 -18
- package/dist/{chunk-D3JMTFOX.mjs → chunk-ZR5ULMN2.mjs} +1 -1
- package/dist/{client-C9hsiaki.d.ts → client-CChON4-x.d.ts} +2 -2
- package/dist/{client-CO8lw80Q.d.mts → client-EeuGm5gj.d.mts} +2 -2
- package/dist/{courier-CJasuxTU.d.ts → courier-Cnn-edJ4.d.ts} +5 -5
- package/dist/{courier-C2Vo2VlH.d.mts → courier-FmGfkvIN.d.mts} +5 -5
- package/dist/{crowd-D1ljcic8.d.ts → crowd-DdHFbqKK.d.ts} +1 -1
- package/dist/{crowd-B37S1apB.d.mts → crowd-hOVSAmA3.d.mts} +1 -1
- package/dist/{danfo-BsaPzhGi.d.mts → danfo-BEBapFlX.d.mts} +3 -3
- package/dist/{danfo-CCv23CPy.d.ts → danfo-UQ_PTIIx.d.ts} +3 -3
- package/dist/{elements-Bsfk7CPw.d.ts → elements-ss9xZgRg.d.mts} +47 -1
- package/dist/{elements-Bsfk7CPw.d.mts → elements-ss9xZgRg.d.ts} +47 -1
- package/dist/engines/godot.d.mts +1 -1
- package/dist/engines/godot.d.ts +1 -1
- package/dist/engines/wasm.d.mts +1 -1
- package/dist/engines/wasm.d.ts +1 -1
- package/dist/fallback-KDB4Y2CE.mjs +6 -0
- package/dist/fallback-Y26TQENE.js +19 -0
- package/dist/{five-a-side-DP84gMuh.d.mts → five-a-side-Bv1AOUy3.d.mts} +4 -4
- package/dist/{five-a-side-DO8SDqMb.d.ts → five-a-side-EC51SJY1.d.ts} +4 -4
- package/dist/{fluid-BkxNBD2t.d.ts → fluid-ARr0qUIL.d.ts} +168 -4
- package/dist/{fluid-BZ42EMds.d.mts → fluid-DLlEj2cs.d.mts} +168 -4
- package/dist/game/conformance.d.mts +7 -7
- package/dist/game/conformance.d.ts +7 -7
- package/dist/game/conformance.js +39 -41
- package/dist/game/conformance.mjs +17 -19
- package/dist/game/heap.d.mts +3 -3
- package/dist/game/heap.d.ts +3 -3
- package/dist/game/heap.js +13 -15
- package/dist/game/heap.mjs +4 -6
- package/dist/game/kit/canvas.d.mts +33 -34
- package/dist/game/kit/canvas.d.ts +33 -34
- package/dist/game/kit/canvas.js +569 -570
- package/dist/game/kit/canvas.mjs +52 -53
- package/dist/game/kit/courier.d.mts +9 -9
- package/dist/game/kit/courier.d.ts +9 -9
- package/dist/game/kit/courier.js +20 -20
- package/dist/game/kit/courier.mjs +17 -17
- package/dist/game/kit/danfo.d.mts +7 -7
- package/dist/game/kit/danfo.d.ts +7 -7
- package/dist/game/kit/danfo.js +30 -30
- package/dist/game/kit/danfo.mjs +15 -15
- package/dist/game/kit/engine.d.mts +12 -12
- package/dist/game/kit/engine.d.ts +12 -12
- package/dist/game/kit/engine.js +40 -41
- package/dist/game/kit/engine.mjs +11 -12
- package/dist/game/kit/five-a-side.d.mts +7 -7
- package/dist/game/kit/five-a-side.d.ts +7 -7
- package/dist/game/kit/five-a-side.js +24 -24
- package/dist/game/kit/five-a-side.mjs +14 -14
- package/dist/game/kit/frontier.d.mts +7 -7
- package/dist/game/kit/frontier.d.ts +7 -7
- package/dist/game/kit/genesis.d.mts +7 -7
- package/dist/game/kit/genesis.d.ts +7 -7
- package/dist/game/kit/ludo.d.mts +8 -8
- package/dist/game/kit/ludo.d.ts +8 -8
- package/dist/game/kit/ludo.js +24 -24
- package/dist/game/kit/ludo.mjs +14 -14
- package/dist/game/kit/runner.d.mts +8 -8
- package/dist/game/kit/runner.d.ts +8 -8
- package/dist/game/kit/runner.js +22 -22
- package/dist/game/kit/runner.mjs +14 -14
- package/dist/game/kit/shootout.d.mts +9 -9
- package/dist/game/kit/shootout.d.ts +9 -9
- package/dist/game/kit/shootout.js +33 -34
- package/dist/game/kit/shootout.mjs +18 -19
- package/dist/game/kit/tycoon.d.mts +9 -9
- package/dist/game/kit/tycoon.d.ts +9 -9
- package/dist/game/kit/tycoon.js +38 -38
- package/dist/game/kit/tycoon.mjs +14 -14
- package/dist/game/kit/word.d.mts +7 -7
- package/dist/game/kit/word.d.ts +7 -7
- package/dist/game/kit/word.js +22 -22
- package/dist/game/kit/word.mjs +14 -14
- package/dist/game/kit/worlds.d.mts +10 -10
- package/dist/game/kit/worlds.d.ts +10 -10
- package/dist/game/kit/worlds.js +22 -22
- package/dist/game/kit/worlds.mjs +17 -17
- package/dist/game/kit.d.mts +31 -32
- package/dist/game/kit.d.ts +31 -32
- package/dist/game/kit.js +523 -524
- package/dist/game/kit.mjs +38 -39
- package/dist/game/prepared.d.mts +6 -7
- package/dist/game/prepared.d.ts +6 -7
- package/dist/game/prepared.js +23 -24
- package/dist/game/prepared.mjs +12 -13
- package/dist/{game-BZAfgKV6.d.mts → game-Bx8onkhX.d.mts} +5 -97
- package/dist/{game-UoJWopvD.d.ts → game-fgQy2YIm.d.ts} +5 -97
- package/dist/game.d.mts +56 -18
- package/dist/game.d.ts +56 -18
- package/dist/game.js +922 -927
- package/dist/game.mjs +16 -17
- package/dist/{graphics-DNIAV5Mi.d.ts → graphics-C6YjWYvP.d.ts} +1 -1
- package/dist/{graphics-CGJDdtdT.d.mts → graphics-Dk2yQnYN.d.mts} +1 -1
- package/dist/{guest-CMCZeyh5.d.mts → guest-DrsA00XD.d.mts} +2 -7
- package/dist/{guest-CB458Hgw.d.ts → guest-wIdfoT05.d.ts} +2 -7
- package/dist/{hit-stop-D2Ca-i9-.d.mts → hit-stop-BKkVwTq7.d.mts} +1 -1
- package/dist/{hit-stop-Ca1OYk15.d.ts → hit-stop-D-8pPYnM.d.ts} +1 -1
- package/dist/{hot-B9BTmDz6.d.ts → hot-Crn9XpHJ.d.ts} +1 -1
- package/dist/{hot-B_L-GEHZ.d.mts → hot-DH3nOhQD.d.mts} +1 -1
- package/dist/{index-DPeyo938.d.ts → index-B8ybCKJI.d.ts} +3 -3
- package/dist/index-BB2gjVvA.d.mts +153 -0
- package/dist/index-BEfmBDAH.d.ts +153 -0
- package/dist/{index-D8ZDzms9.d.mts → index-DHjNHb1c.d.mts} +3 -3
- package/dist/{index-DFDeJxFQ.d.ts → index-DQK8sTfu.d.ts} +2 -2
- package/dist/{index-C76o9Pj4.d.mts → index-DSVkhRmW.d.mts} +2 -2
- package/dist/index.d.mts +8 -8
- package/dist/index.d.ts +8 -8
- package/dist/index.js +189 -177
- package/dist/index.mjs +8 -8
- package/dist/interactives-authoring.js +12 -1
- package/dist/interactives-authoring.mjs +12 -1
- package/dist/interactives-canvas.global.js +14 -39
- package/dist/interactives-guest.d.mts +2 -2
- package/dist/interactives-guest.d.ts +2 -2
- package/dist/interactives-guest.js +10 -10
- package/dist/interactives-guest.mjs +6 -6
- package/dist/interactives-jsc.global.js +4 -23
- package/dist/interactives-meters.d.mts +11 -11
- package/dist/interactives-meters.d.ts +11 -11
- package/dist/interactives-meters.js +65 -66
- package/dist/interactives-meters.mjs +17 -18
- package/dist/interactives-production.d.mts +5 -5
- package/dist/interactives-production.d.ts +5 -5
- package/dist/interactives-production.js +15 -16
- package/dist/interactives-production.mjs +3 -4
- package/dist/interactives-record.d.mts +3 -9
- package/dist/interactives-record.d.ts +3 -9
- package/dist/interactives-record.js +45 -65
- package/dist/interactives-record.mjs +19 -39
- package/dist/interactives-runtime.d.mts +3 -3
- package/dist/interactives-runtime.d.ts +3 -3
- package/dist/interactives-runtime.js +101 -105
- package/dist/interactives-runtime.mjs +6 -6
- package/dist/interactives-studio-kernel.global.js +1 -1
- package/dist/interactives-studio.d.mts +7 -7
- package/dist/interactives-studio.d.ts +7 -7
- package/dist/interactives-studio.js +136 -82
- package/dist/interactives-studio.mjs +65 -11
- package/dist/interactives-web.d.mts +14 -14
- package/dist/interactives-web.d.ts +14 -14
- package/dist/interactives-web.js +201 -198
- package/dist/interactives-web.mjs +33 -34
- package/dist/interactives.d.mts +7 -28
- package/dist/interactives.d.ts +7 -28
- package/dist/interactives.js +267 -313
- package/dist/interactives.mjs +26 -24
- package/dist/{juice-Dfgc1B1q.d.ts → juice-CoHxlpKA.d.ts} +1 -1
- package/dist/{juice-CsnrmTOk.d.mts → juice-DQztFS43.d.mts} +1 -1
- package/dist/{launch-CCsmv8HC.d.mts → launch-T2f4_Di4.d.mts} +6 -6
- package/dist/{launch-8W_Tojpz.d.ts → launch-d6oreMzR.d.ts} +6 -6
- package/dist/{local-DA_HpPOj.d.mts → local-D8_I6UeL.d.mts} +0 -5
- package/dist/{local-_mD0x-p_.d.ts → local-VZkqsCzR.d.ts} +0 -5
- package/dist/{ludo-BVHycBP-.d.ts → ludo-B8ClkDqr.d.ts} +4 -4
- package/dist/{ludo-BRaTcI3E.d.mts → ludo-BOuohQ-M.d.mts} +4 -4
- package/dist/mock/cli.mjs +25 -10
- package/dist/mock/library.js +25 -10
- package/dist/mock/library.mjs +25 -10
- package/dist/mock/msw.js +25 -10
- package/dist/mock/msw.mjs +25 -10
- package/dist/{native-CcMUV7rL.d.mts → native-BodxSh03.d.mts} +2 -2
- package/dist/{native-3f4Ht82c.d.ts → native-DUHMT8gA.d.ts} +2 -2
- package/dist/{online-CCy8pwOn.d.ts → online-XeymeM9s.d.ts} +1 -1
- package/dist/{online-smW2BO3Y.d.mts → online-d7W_Al9a.d.mts} +1 -1
- package/dist/{play-BhHHX1jD.d.ts → play-BRRlfLhX.d.ts} +5 -5
- package/dist/{play-Bn7NfGNE.d.mts → play-ClrMd_e8.d.mts} +5 -5
- package/dist/{policy-Dvnzg8ki.d.mts → policy-CCw8tXLm.d.mts} +19 -19
- package/dist/{policy-b3MVXMQu.d.ts → policy-CMqOSQIu.d.ts} +19 -19
- package/dist/{ports-CNeZdgVm.d.mts → ports-B_0v_P3A.d.mts} +1 -1
- package/dist/{ports-Vno6MDaR.d.ts → ports-CGU_3e_0.d.ts} +1 -1
- package/dist/{prefetch-BFg6lJyD.d.ts → prefetch-BHnicOQj.d.ts} +3 -3
- package/dist/{prefetch-BOoKX3qx.d.mts → prefetch-CBXgYacv.d.mts} +3 -3
- package/dist/{price-BIKJla_G.d.mts → price-B-w4PwHm.d.mts} +1 -1
- package/dist/{price-D1gE7Ek6.d.ts → price-BEvQFNJv.d.ts} +1 -1
- package/dist/react.d.mts +35 -27
- package/dist/react.d.ts +35 -27
- package/dist/react.js +276 -248
- package/dist/react.mjs +147 -119
- package/dist/{runner-BAG8EglP.d.ts → runner-CQcLL7By.d.ts} +6 -6
- package/dist/{runner-CKtKtIzc.d.mts → runner-D46Yj-wE.d.mts} +6 -6
- package/dist/{runtime-DfZp1Kwg.d.mts → runtime-BRWfkf_q.d.mts} +1 -8
- package/dist/{runtime-yHPgIJV-.d.ts → runtime-DyuBMkKM.d.ts} +1 -8
- package/dist/{scheduling-CnRAhWQL.d.ts → scheduling-D9WwOxbo.d.ts} +1 -1
- package/dist/{scheduling-lHyYoCa7.d.mts → scheduling-DDmrYCr-.d.mts} +1 -1
- package/dist/{server-DxcxjER1.d.ts → server-BiKwxvnf.d.ts} +2 -2
- package/dist/{server-lU3Sznd4.d.mts → server-DPdtl2dd.d.mts} +2 -2
- package/dist/server.d.mts +4 -4
- package/dist/server.d.ts +4 -4
- package/dist/server.js +10 -10
- package/dist/server.mjs +4 -4
- package/dist/{shootout-rK-oblpb.d.ts → shootout-BJZeX6FG.d.ts} +6 -6
- package/dist/{shootout-D998OWa-.d.mts → shootout-tcZd1Rxt.d.mts} +6 -6
- package/dist/styles.css +1 -1
- package/dist/{template-Byaueo34.d.mts → template-AhCdB1kW.d.mts} +3 -3
- package/dist/{template-BXE2L654.d.ts → template-BkEGVTQj.d.ts} +3 -3
- package/dist/{terrain-vgYkJPNx.d.ts → terrain-BMxEc6Oc.d.ts} +3 -3
- package/dist/{terrain-CR0NQZPl.d.mts → terrain-C-XC1Oui.d.mts} +3 -3
- package/dist/testing/msw.d.mts +3 -3
- package/dist/testing/msw.d.ts +3 -3
- package/dist/testing/msw.js +3 -3
- package/dist/testing/msw.mjs +2 -2
- package/dist/testing/suite.d.mts +6 -6
- package/dist/testing/suite.d.ts +6 -6
- package/dist/testing/suite.js +25 -25
- package/dist/testing/suite.mjs +6 -6
- package/dist/testing.d.mts +5 -5
- package/dist/testing.d.ts +5 -5
- package/dist/testing.js +117 -117
- package/dist/testing.mjs +7 -7
- package/dist/{tick-transport-Q_8syS8J.d.mts → tick-transport-C8QEh8Uw.d.mts} +1 -1
- package/dist/{tick-transport-xpMcMTs2.d.ts → tick-transport-UjHY3xK1.d.ts} +1 -1
- package/dist/{tree-BsXFWKQ6.d.mts → tree-C-Io2Hbx.d.mts} +1 -1
- package/dist/{tree-DW9x29Vv.d.ts → tree-CP_qSW4H.d.ts} +1 -1
- package/dist/{tycoon-BMAE5Wea.d.mts → tycoon-B5KHk2Xx.d.mts} +5 -5
- package/dist/{tycoon-dWvWTbE4.d.ts → tycoon-hmHo-3HX.d.ts} +5 -5
- package/dist/{types-AkQEePZo.d.mts → types-BQkxPwZP.d.mts} +1 -1
- package/dist/{types-BWaZJDla.d.ts → types-D_f6UUxM.d.ts} +1 -1
- package/dist/utils.d.mts +3 -3
- package/dist/utils.d.ts +3 -3
- package/dist/utils.js +44 -32
- package/dist/utils.mjs +2 -2
- package/dist/{weave-delivery-3G03LdMM.d.mts → weave-delivery-CW-Kstut.d.mts} +10 -1
- package/dist/{weave-delivery-3G03LdMM.d.ts → weave-delivery-CW-Kstut.d.ts} +10 -1
- package/dist/{web-C8B9uVx_.d.ts → web-Dss74a7v.d.ts} +7 -7
- package/dist/{web-BqSEfX2o.d.mts → web-f9ZQPoyw.d.mts} +7 -7
- package/dist/{weight-BDABC8cN.d.ts → weight-CPGjsgjV.d.ts} +3 -3
- package/dist/{weight-Cee73u3d.d.mts → weight-tF1ODR1p.d.mts} +3 -3
- package/dist/{word-DB2CcI9q.d.mts → word-BcX9Jcmv.d.mts} +3 -3
- package/dist/{word-C1Q8oXuy.d.ts → word-C7sVPLHm.d.ts} +3 -3
- package/dist/{world-Bmh7K4tQ.d.ts → world-PvILHDR1.d.ts} +1 -1
- package/dist/{world-CPEjuctH.d.mts → world-qekkXjJv.d.mts} +1 -1
- package/dist/{worlds-ShY5h6Z_.d.ts → worlds-Br2Pb0Cs.d.ts} +6 -6
- package/dist/{worlds-CQgN3GnR.d.mts → worlds-D5ydYr7d.d.mts} +6 -6
- package/package.json +5 -3
- package/registry/cart-summary.json +1 -1
- package/registry/chat-widget.json +1 -1
- package/registry/price.json +1 -1
- package/registry/product-customizer.json +1 -1
- package/registry/search-input.json +1 -1
- package/dist/chunk-2LKAOU3L.mjs +0 -96
- package/dist/chunk-UWPQL2IQ.js +0 -104
- package/dist/fallback-Q5YYIMVJ.js +0 -20
- package/dist/fallback-XGBE3RXC.mjs +0 -7
- package/dist/index-C3KORE2U.d.mts +0 -86
- package/dist/index-Cv_rL5X0.d.ts +0 -86
- package/dist/split-Di9wBpNx.d.mts +0 -68
- package/dist/split-Di9wBpNx.d.ts +0 -68
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunkGTJWQAGU_js = require('./chunk-GTJWQAGU.js');
|
|
4
|
-
var
|
|
5
|
-
var
|
|
4
|
+
var chunkQOCHWR4V_js = require('./chunk-QOCHWR4V.js');
|
|
5
|
+
var chunkNFXCKTE2_js = require('./chunk-NFXCKTE2.js');
|
|
6
6
|
|
|
7
7
|
// src/types/result.ts
|
|
8
8
|
function ok(value) {
|
|
@@ -112,7 +112,7 @@ function clearIntentIdempotencyKey(scope, storage = sessionStorageOrNull()) {
|
|
|
112
112
|
|
|
113
113
|
// src/internal/safe.ts
|
|
114
114
|
function toCimplifyError(error) {
|
|
115
|
-
return error instanceof
|
|
115
|
+
return error instanceof chunkNFXCKTE2_js.CimplifyError ? chunkNFXCKTE2_js.enrichError(error) : error instanceof Error ? chunkNFXCKTE2_js.enrichError(new chunkNFXCKTE2_js.CimplifyError(chunkNFXCKTE2_js.ErrorCode.UNKNOWN_ERROR, error.message, false)) : chunkNFXCKTE2_js.enrichError(new chunkNFXCKTE2_js.CimplifyError(chunkNFXCKTE2_js.ErrorCode.UNKNOWN_ERROR, String(error), false));
|
|
116
116
|
}
|
|
117
117
|
async function safe(promise) {
|
|
118
118
|
try {
|
|
@@ -133,6 +133,12 @@ function withQuery(path, params) {
|
|
|
133
133
|
function isRecord(value) {
|
|
134
134
|
return typeof value == "object" && value !== null;
|
|
135
135
|
}
|
|
136
|
+
function isProductPayload(value) {
|
|
137
|
+
return isRecord(value) && typeof value.id == "string" && typeof value.name == "string";
|
|
138
|
+
}
|
|
139
|
+
function isCategoryPayload(value) {
|
|
140
|
+
return isRecord(value) && typeof value.id == "string" && typeof value.name == "string" && typeof value.slug == "string";
|
|
141
|
+
}
|
|
136
142
|
function readFinalPrice(value) {
|
|
137
143
|
if (!isRecord(value)) return;
|
|
138
144
|
let finalPrice = value.final_price;
|
|
@@ -162,15 +168,17 @@ function normalizeAddOnPayload(addOn) {
|
|
|
162
168
|
}), normalizedAddOn;
|
|
163
169
|
}
|
|
164
170
|
function normalizeCatalogueProductPayload(product) {
|
|
165
|
-
|
|
171
|
+
if (!isRecord(product))
|
|
172
|
+
return product;
|
|
173
|
+
let defaultPrice = product.default_price, addOns = product.add_ons, needsPriceFix = needsDefaultPriceNormalization(defaultPrice), needsAddOnFix = Array.isArray(addOns) && addOns.some((addOn) => addOnNeedsNormalization(addOn));
|
|
166
174
|
if (!needsPriceFix && !needsAddOnFix)
|
|
167
175
|
return product;
|
|
168
|
-
let normalized = {
|
|
176
|
+
let normalized = {};
|
|
169
177
|
if (needsPriceFix) {
|
|
170
|
-
let derivedDefaultPrice = readFinalPrice(
|
|
171
|
-
normalized.default_price = derivedDefaultPrice
|
|
178
|
+
let derivedDefaultPrice = readFinalPrice(product.default_price_info) || readFinalPrice(product.price_info) || (typeof product.final_price == "string" || typeof product.final_price == "number" ? product.final_price : void 0);
|
|
179
|
+
derivedDefaultPrice !== void 0 && (normalized.default_price = derivedDefaultPrice);
|
|
172
180
|
}
|
|
173
|
-
return needsAddOnFix && Array.isArray(addOns) && (normalized.add_ons = addOns.map((addOn) => normalizeAddOnPayload(addOn))), normalized;
|
|
181
|
+
return needsAddOnFix && Array.isArray(addOns) && (normalized.add_ons = addOns.map((addOn) => normalizeAddOnPayload(addOn))), Object.assign({}, product, normalized);
|
|
174
182
|
}
|
|
175
183
|
function toFiniteNumber(value) {
|
|
176
184
|
if (typeof value == "number" && Number.isFinite(value))
|
|
@@ -269,8 +277,17 @@ var CatalogueQueries = class {
|
|
|
269
277
|
this.client.get(`/api/v1/catalogue/products/${encodedId}`, opts)
|
|
270
278
|
);
|
|
271
279
|
if (!result.ok) return result;
|
|
272
|
-
let payload = result.value, rawProduct = isRecord(payload.item) ? payload.item : payload
|
|
273
|
-
|
|
280
|
+
let payload = result.value, rawProduct = isRecord(payload) && isRecord(payload.item) ? payload.item : payload;
|
|
281
|
+
if (!isProductPayload(rawProduct))
|
|
282
|
+
return err(
|
|
283
|
+
new chunkNFXCKTE2_js.CimplifyError(
|
|
284
|
+
chunkNFXCKTE2_js.ErrorCode.UNKNOWN_ERROR,
|
|
285
|
+
`Product ${id} came back without an id or name`,
|
|
286
|
+
false
|
|
287
|
+
)
|
|
288
|
+
);
|
|
289
|
+
let product = normalizeCatalogueProductPayload(rawProduct);
|
|
290
|
+
isRecord(payload) && isCategoryPayload(payload.category) && (product.category = payload.category);
|
|
274
291
|
let addOnIds = rawProduct.add_on_ids;
|
|
275
292
|
if (Array.isArray(addOnIds) && addOnIds.length > 0) {
|
|
276
293
|
let addOnsResult = await this.getAddOns(product.id, opts);
|
|
@@ -619,7 +636,7 @@ var CartOperations = class {
|
|
|
619
636
|
async updateItem(cartItemId, updates) {
|
|
620
637
|
return typeof updates.quantity != "number" ? {
|
|
621
638
|
ok: false,
|
|
622
|
-
error: new
|
|
639
|
+
error: new chunkNFXCKTE2_js.CimplifyError(
|
|
623
640
|
"VALIDATION_ERROR",
|
|
624
641
|
"updateItem requires a quantity; richer mid-cart edits are not supported"
|
|
625
642
|
)
|
|
@@ -706,12 +723,12 @@ var PAYMENT_AUTHORIZATION_OUTCOME_STATUS = {
|
|
|
706
723
|
|
|
707
724
|
// src/payment-authorization/providers/paystack.ts
|
|
708
725
|
var PAYSTACK_POPUP_ERROR = {
|
|
709
|
-
PROVIDER_UNAVAILABLE:
|
|
726
|
+
PROVIDER_UNAVAILABLE: chunkNFXCKTE2_js.ErrorCode.PROVIDER_UNAVAILABLE,
|
|
710
727
|
SUBMISSION_UNKNOWN: "SUBMISSION_UNKNOWN",
|
|
711
728
|
CANCELLED: "CANCELLED",
|
|
712
|
-
PAYMENT_CANCELLED:
|
|
713
|
-
PAYMENT_FAILED:
|
|
714
|
-
POPUP_BLOCKED:
|
|
729
|
+
PAYMENT_CANCELLED: chunkNFXCKTE2_js.ErrorCode.PAYMENT_CANCELLED,
|
|
730
|
+
PAYMENT_FAILED: chunkNFXCKTE2_js.ErrorCode.PAYMENT_FAILED,
|
|
731
|
+
POPUP_BLOCKED: chunkNFXCKTE2_js.ErrorCode.POPUP_BLOCKED
|
|
715
732
|
};
|
|
716
733
|
async function openPaystackPopup(options, signal) {
|
|
717
734
|
if (typeof window > "u")
|
|
@@ -791,17 +808,17 @@ var PaystackAuthorizationAdapter = class {
|
|
|
791
808
|
reference: context.reference
|
|
792
809
|
} : !result.error || result.error === PAYSTACK_POPUP_ERROR.CANCELLED || result.error === PAYSTACK_POPUP_ERROR.PAYMENT_CANCELLED ? { status: PAYMENT_AUTHORIZATION_OUTCOME_STATUS.CANCELLED } : result.error === PAYSTACK_POPUP_ERROR.POPUP_BLOCKED ? {
|
|
793
810
|
status: PAYMENT_AUTHORIZATION_OUTCOME_STATUS.FAILED,
|
|
794
|
-
code:
|
|
811
|
+
code: chunkNFXCKTE2_js.ErrorCode.POPUP_BLOCKED,
|
|
795
812
|
message: "Unable to open the Paystack payment popup. Please allow popups and try again.",
|
|
796
813
|
recoverable: true
|
|
797
814
|
} : result.error === PAYSTACK_POPUP_ERROR.PROVIDER_UNAVAILABLE ? {
|
|
798
815
|
status: PAYMENT_AUTHORIZATION_OUTCOME_STATUS.FAILED,
|
|
799
|
-
code:
|
|
816
|
+
code: chunkNFXCKTE2_js.ErrorCode.PROVIDER_UNAVAILABLE,
|
|
800
817
|
message: "Paystack is unavailable in this environment.",
|
|
801
818
|
recoverable: false
|
|
802
819
|
} : {
|
|
803
820
|
status: PAYMENT_AUTHORIZATION_OUTCOME_STATUS.FAILED,
|
|
804
|
-
code:
|
|
821
|
+
code: chunkNFXCKTE2_js.ErrorCode.PAYMENT_FAILED,
|
|
805
822
|
message: result.error || "Paystack payment could not be submitted.",
|
|
806
823
|
recoverable: true
|
|
807
824
|
};
|
|
@@ -881,12 +898,12 @@ function stripeFailure(error) {
|
|
|
881
898
|
let message = error?.message || "Stripe could not authorize this payment.";
|
|
882
899
|
return error?.code === "payment_intent_authentication_failure" || error?.type === "invalid_request_error" ? {
|
|
883
900
|
status: PAYMENT_AUTHORIZATION_OUTCOME_STATUS.FAILED,
|
|
884
|
-
code:
|
|
901
|
+
code: chunkNFXCKTE2_js.ErrorCode.AUTHORIZATION_FAILED,
|
|
885
902
|
message,
|
|
886
903
|
recoverable: true
|
|
887
904
|
} : {
|
|
888
905
|
status: PAYMENT_AUTHORIZATION_OUTCOME_STATUS.FAILED,
|
|
889
|
-
code:
|
|
906
|
+
code: chunkNFXCKTE2_js.ErrorCode.PAYMENT_FAILED,
|
|
890
907
|
message,
|
|
891
908
|
recoverable: true
|
|
892
909
|
};
|
|
@@ -900,7 +917,7 @@ var StripeAuthorizationAdapter = class {
|
|
|
900
917
|
if (typeof window > "u" || typeof document > "u" || context.signal?.aborted)
|
|
901
918
|
return context.signal?.aborted ? { status: PAYMENT_AUTHORIZATION_OUTCOME_STATUS.CANCELLED } : {
|
|
902
919
|
status: PAYMENT_AUTHORIZATION_OUTCOME_STATUS.FAILED,
|
|
903
|
-
code:
|
|
920
|
+
code: chunkNFXCKTE2_js.ErrorCode.PROVIDER_UNAVAILABLE,
|
|
904
921
|
message: "Stripe Payment Element is unavailable in this environment.",
|
|
905
922
|
recoverable: false
|
|
906
923
|
};
|
|
@@ -913,7 +930,7 @@ var StripeAuthorizationAdapter = class {
|
|
|
913
930
|
} catch (error) {
|
|
914
931
|
return {
|
|
915
932
|
status: PAYMENT_AUTHORIZATION_OUTCOME_STATUS.FAILED,
|
|
916
|
-
code:
|
|
933
|
+
code: chunkNFXCKTE2_js.ErrorCode.PROVIDER_UNAVAILABLE,
|
|
917
934
|
message: error instanceof Error ? error.message : "Stripe.js could not be loaded.",
|
|
918
935
|
recoverable: true
|
|
919
936
|
};
|
|
@@ -923,7 +940,7 @@ var StripeAuthorizationAdapter = class {
|
|
|
923
940
|
if (!stripe)
|
|
924
941
|
return {
|
|
925
942
|
status: PAYMENT_AUTHORIZATION_OUTCOME_STATUS.FAILED,
|
|
926
|
-
code:
|
|
943
|
+
code: chunkNFXCKTE2_js.ErrorCode.PROVIDER_UNAVAILABLE,
|
|
927
944
|
message: "Stripe.js could not be loaded.",
|
|
928
945
|
recoverable: false
|
|
929
946
|
};
|
|
@@ -931,7 +948,7 @@ var StripeAuthorizationAdapter = class {
|
|
|
931
948
|
if (!modal)
|
|
932
949
|
return {
|
|
933
950
|
status: PAYMENT_AUTHORIZATION_OUTCOME_STATUS.FAILED,
|
|
934
|
-
code:
|
|
951
|
+
code: chunkNFXCKTE2_js.ErrorCode.PROVIDER_UNAVAILABLE,
|
|
935
952
|
message: "Stripe Payment Element could not be mounted.",
|
|
936
953
|
recoverable: false
|
|
937
954
|
};
|
|
@@ -941,7 +958,7 @@ var StripeAuthorizationAdapter = class {
|
|
|
941
958
|
} catch {
|
|
942
959
|
return modal.root.remove(), modal.previousFocus?.focus(), {
|
|
943
960
|
status: PAYMENT_AUTHORIZATION_OUTCOME_STATUS.FAILED,
|
|
944
|
-
code:
|
|
961
|
+
code: chunkNFXCKTE2_js.ErrorCode.PROVIDER_UNAVAILABLE,
|
|
945
962
|
message: "Stripe Payment Element could not be initialized.",
|
|
946
963
|
recoverable: false
|
|
947
964
|
};
|
|
@@ -1009,7 +1026,7 @@ var StripeAuthorizationAdapter = class {
|
|
|
1009
1026
|
modal.form.addEventListener("submit", onSubmit), modal.cancelButton.addEventListener("click", onCancel), context.signal?.addEventListener("abort", onAbort, { once: true }), paymentElement.on?.("escape", onCancel), paymentElement.on?.("loaderror", (event) => {
|
|
1010
1027
|
confirmationStarted || settle({
|
|
1011
1028
|
status: PAYMENT_AUTHORIZATION_OUTCOME_STATUS.FAILED,
|
|
1012
|
-
code:
|
|
1029
|
+
code: chunkNFXCKTE2_js.ErrorCode.PROVIDER_UNAVAILABLE,
|
|
1013
1030
|
message: event?.error?.message || "Stripe Payment Element failed to load.",
|
|
1014
1031
|
recoverable: true
|
|
1015
1032
|
});
|
|
@@ -1051,7 +1068,7 @@ var PaymentAuthorizationAdapterRegistry = class {
|
|
|
1051
1068
|
if (!provider)
|
|
1052
1069
|
return {
|
|
1053
1070
|
status: PAYMENT_AUTHORIZATION_OUTCOME_STATUS.FAILED,
|
|
1054
|
-
code:
|
|
1071
|
+
code: chunkNFXCKTE2_js.ErrorCode.PROVIDER_UNAVAILABLE,
|
|
1055
1072
|
message: "Card authorization response did not identify a payment provider.",
|
|
1056
1073
|
recoverable: false
|
|
1057
1074
|
};
|
|
@@ -1059,7 +1076,7 @@ var PaymentAuthorizationAdapterRegistry = class {
|
|
|
1059
1076
|
if (!adapter)
|
|
1060
1077
|
return {
|
|
1061
1078
|
status: PAYMENT_AUTHORIZATION_OUTCOME_STATUS.FAILED,
|
|
1062
|
-
code:
|
|
1079
|
+
code: chunkNFXCKTE2_js.ErrorCode.PROVIDER_UNAVAILABLE,
|
|
1063
1080
|
message: `Card authorization provider '${provider}' is not supported by this SDK client.`,
|
|
1064
1081
|
recoverable: false
|
|
1065
1082
|
};
|
|
@@ -1069,7 +1086,7 @@ var PaymentAuthorizationAdapterRegistry = class {
|
|
|
1069
1086
|
} catch (error) {
|
|
1070
1087
|
return {
|
|
1071
1088
|
status: PAYMENT_AUTHORIZATION_OUTCOME_STATUS.FAILED,
|
|
1072
|
-
code:
|
|
1089
|
+
code: chunkNFXCKTE2_js.ErrorCode.PAYMENT_FAILED,
|
|
1073
1090
|
message: error instanceof Error ? error.message : `Card authorization provider '${provider}' failed unexpectedly.`,
|
|
1074
1091
|
recoverable: true
|
|
1075
1092
|
};
|
|
@@ -1089,7 +1106,7 @@ function isExactlyZeroMoney(value) {
|
|
|
1089
1106
|
return typeof value == "number" ? Object.is(value, 0) || Object.is(value, -0) : EXACT_ZERO_MONEY.test(value.trim());
|
|
1090
1107
|
}
|
|
1091
1108
|
function selectPurchaseIntentPaymentOption(terms, selection) {
|
|
1092
|
-
return terms.payment_options.filter((option) => option.status ===
|
|
1109
|
+
return terms.payment_options.filter((option) => option.status === chunkNFXCKTE2_js.PAYMENT_OPTION_STATUS.ELIGIBLE).sort((left, right) => left.rank - right.rank).find(
|
|
1093
1110
|
(option) => option.method_kind === selection.method_kind && (selection.payment_option_id === void 0 || option.id === selection.payment_option_id)
|
|
1094
1111
|
);
|
|
1095
1112
|
}
|
|
@@ -1102,7 +1119,7 @@ function createPurchaseIntentConfirmation(terms, paymentOption, idempotencyKey)
|
|
|
1102
1119
|
if (paymentOption && !requiresOption)
|
|
1103
1120
|
throw new TypeError("Zero-rail terms must not name a payment option");
|
|
1104
1121
|
let authoritativeOption = paymentOption ? terms.payment_options.find(
|
|
1105
|
-
(candidate) => candidate.id === paymentOption.id && candidate.status ===
|
|
1122
|
+
(candidate) => candidate.id === paymentOption.id && candidate.status === chunkNFXCKTE2_js.PAYMENT_OPTION_STATUS.ELIGIBLE
|
|
1106
1123
|
) : void 0;
|
|
1107
1124
|
if (paymentOption && !authoritativeOption)
|
|
1108
1125
|
throw new TypeError("Payment option is not eligible for these checkout terms");
|
|
@@ -1134,7 +1151,7 @@ function isSameAmount(left, right) {
|
|
|
1134
1151
|
}
|
|
1135
1152
|
function confirmationForUnchangedReplacement(response, selection, idempotencyKey) {
|
|
1136
1153
|
let { replacement, deltas } = response, paymentDeltas = deltas.filter(
|
|
1137
|
-
(delta2) => delta2.kind ===
|
|
1154
|
+
(delta2) => delta2.kind === chunkNFXCKTE2_js.CHECKOUT_TERMS_DELTA_KIND.PAYMENT_OPTION
|
|
1138
1155
|
);
|
|
1139
1156
|
if (paymentDeltas.length !== deltas.length) return null;
|
|
1140
1157
|
if (!purchaseIntentRequiresPaymentOption(replacement))
|
|
@@ -1143,57 +1160,57 @@ function confirmationForUnchangedReplacement(response, selection, idempotencyKey
|
|
|
1143
1160
|
let option = selectPurchaseIntentPaymentOption(replacement, {
|
|
1144
1161
|
method_kind: selection.method_kind
|
|
1145
1162
|
}), [delta] = paymentDeltas;
|
|
1146
|
-
return !option || delta.kind !==
|
|
1163
|
+
return !option || delta.kind !== chunkNFXCKTE2_js.CHECKOUT_TERMS_DELTA_KIND.PAYMENT_OPTION || !isSameAmount(option.customer_debit_amount, delta.accepted_customer_debit_amount) ? null : createPurchaseIntentConfirmation(replacement, option, idempotencyKey);
|
|
1147
1164
|
}
|
|
1148
1165
|
|
|
1149
1166
|
// src/utils/purchase-intent-adapter.ts
|
|
1150
1167
|
function tenderPreference(form) {
|
|
1151
|
-
if (form.payment_method ===
|
|
1168
|
+
if (form.payment_method === chunkNFXCKTE2_js.PURCHASE_INTENT_PAYMENT_METHOD.MOBILE_MONEY) {
|
|
1152
1169
|
if (form.link_payment_method_id)
|
|
1153
1170
|
return {
|
|
1154
|
-
method_kind:
|
|
1171
|
+
method_kind: chunkNFXCKTE2_js.PURCHASE_INTENT_PAYMENT_METHOD.MOBILE_MONEY,
|
|
1155
1172
|
authority: {
|
|
1156
|
-
authority_kind:
|
|
1173
|
+
authority_kind: chunkNFXCKTE2_js.MOBILE_MONEY_TENDER_AUTHORITY_KIND.SAVED_REFERENCE,
|
|
1157
1174
|
stored_instrument_id: form.link_payment_method_id
|
|
1158
1175
|
}
|
|
1159
1176
|
};
|
|
1160
1177
|
let details = form.mobile_money_details;
|
|
1161
1178
|
if (!details?.phone_number || !details.provider)
|
|
1162
|
-
throw new
|
|
1163
|
-
|
|
1179
|
+
throw new chunkNFXCKTE2_js.CimplifyError(
|
|
1180
|
+
chunkNFXCKTE2_js.ErrorCode.INVALID_PAYMENT_METHOD,
|
|
1164
1181
|
"Mobile money requires a phone number and network.",
|
|
1165
1182
|
false
|
|
1166
1183
|
);
|
|
1167
|
-
let network =
|
|
1184
|
+
let network = chunkQOCHWR4V_js.purchaseIntentMobileMoneyNetwork(details.provider);
|
|
1168
1185
|
if (!network)
|
|
1169
|
-
throw new
|
|
1170
|
-
|
|
1186
|
+
throw new chunkNFXCKTE2_js.CimplifyError(
|
|
1187
|
+
chunkNFXCKTE2_js.ErrorCode.INVALID_PAYMENT_METHOD,
|
|
1171
1188
|
"That mobile money network is not available for PurchaseIntent checkout.",
|
|
1172
1189
|
false
|
|
1173
1190
|
);
|
|
1174
1191
|
return {
|
|
1175
|
-
method_kind:
|
|
1192
|
+
method_kind: chunkNFXCKTE2_js.PURCHASE_INTENT_PAYMENT_METHOD.MOBILE_MONEY,
|
|
1176
1193
|
authority: {
|
|
1177
|
-
authority_kind:
|
|
1194
|
+
authority_kind: chunkNFXCKTE2_js.MOBILE_MONEY_TENDER_AUTHORITY_KIND.TRANSIENT,
|
|
1178
1195
|
phone_number: details.phone_number,
|
|
1179
1196
|
network
|
|
1180
1197
|
}
|
|
1181
1198
|
};
|
|
1182
1199
|
}
|
|
1183
|
-
if (form.payment_method ===
|
|
1184
|
-
throw new
|
|
1185
|
-
|
|
1200
|
+
if (form.payment_method === chunkNFXCKTE2_js.LEGACY_CHECKOUT_PAYMENT_METHOD_ALIAS.CASH || form.payment_method === chunkNFXCKTE2_js.PURCHASE_INTENT_PAYMENT_METHOD.OFFLINE)
|
|
1201
|
+
throw new chunkNFXCKTE2_js.CimplifyError(
|
|
1202
|
+
chunkNFXCKTE2_js.ErrorCode.INVALID_PAYMENT_METHOD,
|
|
1186
1203
|
"Offline tender requires an authenticated staff checkout.",
|
|
1187
1204
|
false
|
|
1188
1205
|
);
|
|
1189
|
-
if (form.payment_method ===
|
|
1206
|
+
if (form.payment_method === chunkNFXCKTE2_js.PURCHASE_INTENT_PAYMENT_METHOD.CARD)
|
|
1190
1207
|
return {
|
|
1191
|
-
method_kind:
|
|
1208
|
+
method_kind: chunkNFXCKTE2_js.PURCHASE_INTENT_PAYMENT_METHOD.CARD,
|
|
1192
1209
|
stored_instrument_id: form.link_payment_method_id
|
|
1193
1210
|
};
|
|
1194
|
-
if (form.payment_method !==
|
|
1195
|
-
throw new
|
|
1196
|
-
|
|
1211
|
+
if (form.payment_method !== chunkNFXCKTE2_js.LEGACY_CHECKOUT_PAYMENT_METHOD_ALIAS.STORE_CREDIT)
|
|
1212
|
+
throw new chunkNFXCKTE2_js.CimplifyError(
|
|
1213
|
+
chunkNFXCKTE2_js.ErrorCode.INVALID_PAYMENT_METHOD,
|
|
1197
1214
|
"Checkout payment method is not supported.",
|
|
1198
1215
|
false
|
|
1199
1216
|
);
|
|
@@ -1201,7 +1218,7 @@ function tenderPreference(form) {
|
|
|
1201
1218
|
function checkoutFormToIntentRequest(form, clientIntentKey) {
|
|
1202
1219
|
return {
|
|
1203
1220
|
client_intent_key: clientIntentKey,
|
|
1204
|
-
source: { kind:
|
|
1221
|
+
source: { kind: chunkNFXCKTE2_js.PURCHASE_INTENT_SOURCE_KIND.CART, cart_id: form.cart_id },
|
|
1205
1222
|
checkout: {
|
|
1206
1223
|
customer: form.customer,
|
|
1207
1224
|
order_type: form.order_type,
|
|
@@ -1213,7 +1230,7 @@ function checkoutFormToIntentRequest(form, clientIntentKey) {
|
|
|
1213
1230
|
metadata: form.metadata,
|
|
1214
1231
|
pay_currency: form.pay_currency,
|
|
1215
1232
|
fx_quote_id: form.fx_quote_id,
|
|
1216
|
-
use_store_credit: form.use_store_credit || form.payment_method ===
|
|
1233
|
+
use_store_credit: form.use_store_credit || form.payment_method === chunkNFXCKTE2_js.LEGACY_CHECKOUT_PAYMENT_METHOD_ALIAS.STORE_CREDIT,
|
|
1217
1234
|
voucher_code: form.voucher_code,
|
|
1218
1235
|
pay_deposit: form.pay_deposit,
|
|
1219
1236
|
tender_preference: tenderPreference(form)
|
|
@@ -1223,7 +1240,7 @@ function checkoutFormToIntentRequest(form, clientIntentKey) {
|
|
|
1223
1240
|
function selectCheckoutPaymentOption(terms, form) {
|
|
1224
1241
|
let preference = tenderPreference(form);
|
|
1225
1242
|
if (preference)
|
|
1226
|
-
return terms.payment_options.filter((option) => option.status ===
|
|
1243
|
+
return terms.payment_options.filter((option) => option.status === chunkNFXCKTE2_js.PAYMENT_OPTION_STATUS.ELIGIBLE).sort((left, right) => left.rank - right.rank).find((option) => option.method_kind === preference.method_kind);
|
|
1227
1244
|
}
|
|
1228
1245
|
function checkoutFormToConfirmation(_form, terms, paymentOption, idempotencyKey) {
|
|
1229
1246
|
return createPurchaseIntentConfirmation(terms, paymentOption, idempotencyKey);
|
|
@@ -1239,39 +1256,39 @@ function committedBase(response) {
|
|
|
1239
1256
|
}
|
|
1240
1257
|
function confirmationToCheckoutResult(response) {
|
|
1241
1258
|
switch (response.status) {
|
|
1242
|
-
case
|
|
1259
|
+
case chunkNFXCKTE2_js.PURCHASE_INTENT_CONFIRM_STATUS.ORDER_CREATED:
|
|
1243
1260
|
return ok({
|
|
1244
1261
|
...committedBase(response),
|
|
1245
|
-
payment_status:
|
|
1262
|
+
payment_status: chunkNFXCKTE2_js.LEGACY_CHECKOUT_PAYMENT_STATUS.SUCCEEDED,
|
|
1246
1263
|
requires_authorization: false,
|
|
1247
1264
|
next_action: { type: chunkGTJWQAGU_js.CHECKOUT_NEXT_ACTION.NONE }
|
|
1248
1265
|
});
|
|
1249
|
-
case
|
|
1266
|
+
case chunkNFXCKTE2_js.PURCHASE_INTENT_CONFIRM_STATUS.COLLECTION_PROCESSING:
|
|
1250
1267
|
return ok({
|
|
1251
1268
|
...committedBase(response),
|
|
1252
|
-
payment_status:
|
|
1269
|
+
payment_status: chunkNFXCKTE2_js.LEGACY_CHECKOUT_PAYMENT_STATUS.PROCESSING,
|
|
1253
1270
|
requires_authorization: false,
|
|
1254
1271
|
next_action: { type: chunkGTJWQAGU_js.CHECKOUT_NEXT_ACTION.POLL }
|
|
1255
1272
|
});
|
|
1256
|
-
case
|
|
1273
|
+
case chunkNFXCKTE2_js.PURCHASE_INTENT_CONFIRM_STATUS.PAYMENT_OUTCOME_UNKNOWN:
|
|
1257
1274
|
return ok({
|
|
1258
1275
|
...committedBase(response),
|
|
1259
|
-
payment_status:
|
|
1276
|
+
payment_status: chunkNFXCKTE2_js.LEGACY_CHECKOUT_PAYMENT_STATUS.UNKNOWN,
|
|
1260
1277
|
requires_authorization: false,
|
|
1261
1278
|
next_action: { type: chunkGTJWQAGU_js.CHECKOUT_NEXT_ACTION.POLL }
|
|
1262
1279
|
});
|
|
1263
|
-
case
|
|
1280
|
+
case chunkNFXCKTE2_js.PURCHASE_INTENT_CONFIRM_STATUS.PAYMENT_FAILED:
|
|
1264
1281
|
return err(
|
|
1265
|
-
new
|
|
1266
|
-
|
|
1282
|
+
new chunkNFXCKTE2_js.CimplifyError(
|
|
1283
|
+
chunkNFXCKTE2_js.PURCHASE_INTENT_ERROR_CODE.PAYMENT_FAILED,
|
|
1267
1284
|
"Payment failed. The order remains recorded, but collection did not succeed.",
|
|
1268
1285
|
true
|
|
1269
1286
|
)
|
|
1270
1287
|
);
|
|
1271
|
-
case
|
|
1288
|
+
case chunkNFXCKTE2_js.PURCHASE_INTENT_CONFIRM_STATUS.REDIRECT_REQUIRED:
|
|
1272
1289
|
return ok({
|
|
1273
1290
|
...committedBase(response),
|
|
1274
|
-
payment_status:
|
|
1291
|
+
payment_status: chunkNFXCKTE2_js.LEGACY_CHECKOUT_PAYMENT_STATUS.REQUIRES_ACTION,
|
|
1275
1292
|
requires_authorization: false,
|
|
1276
1293
|
authorization_url: response.authorization_url,
|
|
1277
1294
|
next_action: {
|
|
@@ -1279,10 +1296,10 @@ function confirmationToCheckoutResult(response) {
|
|
|
1279
1296
|
authorization_url: response.authorization_url
|
|
1280
1297
|
}
|
|
1281
1298
|
});
|
|
1282
|
-
case
|
|
1299
|
+
case chunkNFXCKTE2_js.PURCHASE_INTENT_CONFIRM_STATUS.CARD_POPUP_REQUIRED:
|
|
1283
1300
|
return ok({
|
|
1284
1301
|
...committedBase(response),
|
|
1285
|
-
payment_status:
|
|
1302
|
+
payment_status: chunkNFXCKTE2_js.LEGACY_CHECKOUT_PAYMENT_STATUS.REQUIRES_ACTION,
|
|
1286
1303
|
requires_authorization: false,
|
|
1287
1304
|
provider: response.provider,
|
|
1288
1305
|
client_secret: response.client_secret,
|
|
@@ -1295,10 +1312,10 @@ function confirmationToCheckoutResult(response) {
|
|
|
1295
1312
|
provider_account_id: response.provider_account_id ?? void 0
|
|
1296
1313
|
}
|
|
1297
1314
|
});
|
|
1298
|
-
case
|
|
1315
|
+
case chunkNFXCKTE2_js.PURCHASE_INTENT_CONFIRM_STATUS.AUTHORIZATION_REQUIRED:
|
|
1299
1316
|
return ok({
|
|
1300
1317
|
...committedBase(response),
|
|
1301
|
-
payment_status:
|
|
1318
|
+
payment_status: chunkNFXCKTE2_js.LEGACY_CHECKOUT_PAYMENT_STATUS.REQUIRES_ACTION,
|
|
1302
1319
|
requires_authorization: true,
|
|
1303
1320
|
authorization_type: response.authorization_type,
|
|
1304
1321
|
display_text: response.display_text,
|
|
@@ -1308,34 +1325,34 @@ function confirmationToCheckoutResult(response) {
|
|
|
1308
1325
|
display_text: response.display_text
|
|
1309
1326
|
}
|
|
1310
1327
|
});
|
|
1311
|
-
case
|
|
1328
|
+
case chunkNFXCKTE2_js.PURCHASE_INTENT_CONFIRM_STATUS.TERMS_CHANGED:
|
|
1312
1329
|
return err(
|
|
1313
|
-
new
|
|
1314
|
-
|
|
1330
|
+
new chunkNFXCKTE2_js.CimplifyError(
|
|
1331
|
+
chunkNFXCKTE2_js.PURCHASE_INTENT_ERROR_CODE.TERMS_CHANGED,
|
|
1315
1332
|
"Checkout terms changed. Review the replacement terms before confirming again.",
|
|
1316
1333
|
true
|
|
1317
1334
|
)
|
|
1318
1335
|
);
|
|
1319
|
-
case
|
|
1336
|
+
case chunkNFXCKTE2_js.PURCHASE_INTENT_CONFIRM_STATUS.SELECTION_UNAVAILABLE:
|
|
1320
1337
|
return err(
|
|
1321
|
-
new
|
|
1322
|
-
|
|
1338
|
+
new chunkNFXCKTE2_js.CimplifyError(
|
|
1339
|
+
chunkNFXCKTE2_js.PURCHASE_INTENT_ERROR_CODE.SELECTION_UNAVAILABLE,
|
|
1323
1340
|
"One or more checkout selections are no longer available.",
|
|
1324
1341
|
true
|
|
1325
1342
|
)
|
|
1326
1343
|
);
|
|
1327
|
-
case
|
|
1344
|
+
case chunkNFXCKTE2_js.PURCHASE_INTENT_CONFIRM_STATUS.OFFER_ENDED:
|
|
1328
1345
|
return err(
|
|
1329
|
-
new
|
|
1330
|
-
|
|
1346
|
+
new chunkNFXCKTE2_js.CimplifyError(
|
|
1347
|
+
chunkNFXCKTE2_js.PURCHASE_INTENT_ERROR_CODE.OFFER_ENDED,
|
|
1331
1348
|
"This offer has ended.",
|
|
1332
1349
|
false
|
|
1333
1350
|
)
|
|
1334
1351
|
);
|
|
1335
|
-
case
|
|
1352
|
+
case chunkNFXCKTE2_js.PURCHASE_INTENT_CONFIRM_STATUS.SOURCE_UNAVAILABLE:
|
|
1336
1353
|
return err(
|
|
1337
|
-
new
|
|
1338
|
-
|
|
1354
|
+
new chunkNFXCKTE2_js.CimplifyError(
|
|
1355
|
+
chunkNFXCKTE2_js.PURCHASE_INTENT_ERROR_CODE.SOURCE_UNAVAILABLE,
|
|
1339
1356
|
"This purchase source is unavailable.",
|
|
1340
1357
|
false
|
|
1341
1358
|
)
|
|
@@ -1345,7 +1362,7 @@ function confirmationToCheckoutResult(response) {
|
|
|
1345
1362
|
|
|
1346
1363
|
// src/checkout.ts
|
|
1347
1364
|
function checkoutActionAuthority(response) {
|
|
1348
|
-
if (response.status !==
|
|
1365
|
+
if (response.status !== chunkNFXCKTE2_js.PURCHASE_INTENT_CONFIRM_STATUS.CARD_POPUP_REQUIRED && response.status !== chunkNFXCKTE2_js.PURCHASE_INTENT_CONFIRM_STATUS.AUTHORIZATION_REQUIRED)
|
|
1349
1366
|
return null;
|
|
1350
1367
|
let paymentId = response.payment_id?.trim();
|
|
1351
1368
|
return paymentId ? {
|
|
@@ -1355,7 +1372,7 @@ function checkoutActionAuthority(response) {
|
|
|
1355
1372
|
} : null;
|
|
1356
1373
|
}
|
|
1357
1374
|
function isAmbiguousCheckoutError(error) {
|
|
1358
|
-
return error.code ===
|
|
1375
|
+
return error.code === chunkNFXCKTE2_js.ErrorCode.NETWORK_ERROR || error.code === chunkNFXCKTE2_js.ErrorCode.TIMEOUT;
|
|
1359
1376
|
}
|
|
1360
1377
|
function authorizationKind(value) {
|
|
1361
1378
|
if (value && typeof value == "object" && chunkGTJWQAGU_js.AUTHORIZATION_TYPE.ADDRESS in value)
|
|
@@ -1397,7 +1414,7 @@ function isValidCustomerName(name) {
|
|
|
1397
1414
|
return trimmed.length >= 2 && /\p{L}/u.test(trimmed);
|
|
1398
1415
|
}
|
|
1399
1416
|
function isOfflinePaymentMethod(method) {
|
|
1400
|
-
return method ===
|
|
1417
|
+
return method === chunkNFXCKTE2_js.LEGACY_CHECKOUT_PAYMENT_METHOD_ALIAS.CASH || method === chunkNFXCKTE2_js.PURCHASE_INTENT_PAYMENT_METHOD.OFFLINE;
|
|
1401
1418
|
}
|
|
1402
1419
|
function notifyCheckoutStatus(observer, status, context = {}) {
|
|
1403
1420
|
try {
|
|
@@ -1417,14 +1434,14 @@ var MAX_STOREFRONT_COLLECTION_OPTIONS = 32, CHECKOUT_INTENT_SCOPE_PREFIX = "chec
|
|
|
1417
1434
|
updateCustomer: (orderId) => `/api/v1/orders/${orderId}/customer`,
|
|
1418
1435
|
verifyPayment: (orderId) => `/api/v1/orders/${orderId}/verify-payment`
|
|
1419
1436
|
}, CHECKOUT_STATUS_BY_PURCHASE_INTENT_RESOLVE_STATUS = {
|
|
1420
|
-
[
|
|
1421
|
-
[
|
|
1422
|
-
[
|
|
1423
|
-
[
|
|
1424
|
-
[
|
|
1425
|
-
[
|
|
1426
|
-
[
|
|
1427
|
-
[
|
|
1437
|
+
[chunkNFXCKTE2_js.PURCHASE_INTENT_RESOLVE_STATUS.CONFIRMING]: chunkGTJWQAGU_js.CHECKOUT_STATUS.PROCESSING,
|
|
1438
|
+
[chunkNFXCKTE2_js.PURCHASE_INTENT_RESOLVE_STATUS.POLLING]: chunkGTJWQAGU_js.CHECKOUT_STATUS.POLLING,
|
|
1439
|
+
[chunkNFXCKTE2_js.PURCHASE_INTENT_RESOLVE_STATUS.RECONNECTING]: chunkGTJWQAGU_js.CHECKOUT_STATUS.POLLING,
|
|
1440
|
+
[chunkNFXCKTE2_js.PURCHASE_INTENT_RESOLVE_STATUS.AWAITING_ACTION]: chunkGTJWQAGU_js.CHECKOUT_STATUS.AWAITING_AUTHORIZATION,
|
|
1441
|
+
[chunkNFXCKTE2_js.PURCHASE_INTENT_RESOLVE_STATUS.REVIEWING_TERMS]: chunkGTJWQAGU_js.CHECKOUT_STATUS.REVIEWING_TERMS,
|
|
1442
|
+
[chunkNFXCKTE2_js.PURCHASE_INTENT_RESOLVE_STATUS.COMPLETED]: chunkGTJWQAGU_js.CHECKOUT_STATUS.FINALIZING,
|
|
1443
|
+
[chunkNFXCKTE2_js.PURCHASE_INTENT_RESOLVE_STATUS.FAILED]: chunkGTJWQAGU_js.CHECKOUT_STATUS.FAILED,
|
|
1444
|
+
[chunkNFXCKTE2_js.PURCHASE_INTENT_RESOLVE_STATUS.OUTCOME_UNKNOWN]: chunkGTJWQAGU_js.CHECKOUT_STATUS.RECOVERING
|
|
1428
1445
|
};
|
|
1429
1446
|
function normalizeCollectionOptions(value, expectedCurrency) {
|
|
1430
1447
|
if (!value || typeof value != "object") return null;
|
|
@@ -1440,7 +1457,7 @@ function normalizeCollectionOptions(value, expectedCurrency) {
|
|
|
1440
1457
|
}
|
|
1441
1458
|
if (option.method !== chunkGTJWQAGU_js.PAYMENT_METHOD.MOBILE_MONEY || typeof option.network != "string" || !option.network.trim())
|
|
1442
1459
|
continue;
|
|
1443
|
-
let network =
|
|
1460
|
+
let network = chunkQOCHWR4V_js.purchaseIntentMobileMoneyNetwork(option.network);
|
|
1444
1461
|
if (!network) continue;
|
|
1445
1462
|
let key = `${chunkGTJWQAGU_js.PAYMENT_METHOD.MOBILE_MONEY}:${network}`;
|
|
1446
1463
|
seen.has(key) || (seen.add(key), options.push({ method: chunkGTJWQAGU_js.PAYMENT_METHOD.MOBILE_MONEY, network }));
|
|
@@ -1456,12 +1473,12 @@ var CheckoutService = class {
|
|
|
1456
1473
|
this.actionAuthorities = /* @__PURE__ */ new Map();
|
|
1457
1474
|
}
|
|
1458
1475
|
validateCheckoutData(data) {
|
|
1459
|
-
return isOfflinePaymentMethod(data.payment_method) ? new
|
|
1460
|
-
|
|
1476
|
+
return isOfflinePaymentMethod(data.payment_method) ? new chunkNFXCKTE2_js.CimplifyError(
|
|
1477
|
+
chunkNFXCKTE2_js.ErrorCode.INVALID_PAYMENT_METHOD,
|
|
1461
1478
|
"Offline payment isn't available for online checkout. Please pay by card or mobile money.",
|
|
1462
1479
|
false
|
|
1463
|
-
) : isValidCustomerName(data.customer?.name) ? null : new
|
|
1464
|
-
|
|
1480
|
+
) : isValidCustomerName(data.customer?.name) ? null : new chunkNFXCKTE2_js.CimplifyError(
|
|
1481
|
+
chunkNFXCKTE2_js.ErrorCode.INVALID_CUSTOMER_NAME,
|
|
1465
1482
|
"Enter your name, not a phone number.",
|
|
1466
1483
|
false
|
|
1467
1484
|
);
|
|
@@ -1473,10 +1490,10 @@ var CheckoutService = class {
|
|
|
1473
1490
|
/** Available storefront collection methods for one presentment currency. */
|
|
1474
1491
|
async collectionOptions(currency) {
|
|
1475
1492
|
let normalized = currency.trim().toUpperCase();
|
|
1476
|
-
if (!
|
|
1493
|
+
if (!chunkNFXCKTE2_js.isSupportedCurrency(normalized))
|
|
1477
1494
|
return err(
|
|
1478
|
-
new
|
|
1479
|
-
|
|
1495
|
+
new chunkNFXCKTE2_js.CimplifyError(
|
|
1496
|
+
chunkNFXCKTE2_js.ErrorCode.UNSUPPORTED_CURRENCY,
|
|
1480
1497
|
"No online payment method is available for this currency.",
|
|
1481
1498
|
false
|
|
1482
1499
|
)
|
|
@@ -1489,8 +1506,8 @@ var CheckoutService = class {
|
|
|
1489
1506
|
if (!response.ok) return response;
|
|
1490
1507
|
let options = normalizeCollectionOptions(response.value, normalized);
|
|
1491
1508
|
return options ? ok(options) : err(
|
|
1492
|
-
new
|
|
1493
|
-
|
|
1509
|
+
new chunkNFXCKTE2_js.CimplifyError(
|
|
1510
|
+
chunkNFXCKTE2_js.ErrorCode.PAYMENT_CAPABILITY_MISMATCH,
|
|
1494
1511
|
"Payment methods could not be verified for this currency.",
|
|
1495
1512
|
false
|
|
1496
1513
|
)
|
|
@@ -1513,8 +1530,8 @@ var CheckoutService = class {
|
|
|
1513
1530
|
mintRequest = checkoutFormToIntentRequest(checkoutData, clientIntentKey);
|
|
1514
1531
|
} catch (error) {
|
|
1515
1532
|
return clearIntentIdempotencyKey(intentScope), this.intentCommands.delete(intentScope), err(
|
|
1516
|
-
error instanceof
|
|
1517
|
-
|
|
1533
|
+
error instanceof chunkNFXCKTE2_js.CimplifyError ? error : new chunkNFXCKTE2_js.CimplifyError(
|
|
1534
|
+
chunkNFXCKTE2_js.ErrorCode.CHECKOUT_VALIDATION_FAILED,
|
|
1518
1535
|
"Checkout details are invalid.",
|
|
1519
1536
|
false
|
|
1520
1537
|
)
|
|
@@ -1526,8 +1543,8 @@ var CheckoutService = class {
|
|
|
1526
1543
|
let terms = minted.value.current_terms;
|
|
1527
1544
|
if (!terms)
|
|
1528
1545
|
return clearIntentIdempotencyKey(intentScope), this.intentCommands.delete(intentScope), err(
|
|
1529
|
-
new
|
|
1530
|
-
|
|
1546
|
+
new chunkNFXCKTE2_js.CimplifyError(
|
|
1547
|
+
chunkNFXCKTE2_js.ErrorCode.CHECKOUT_TERMS_UNAVAILABLE,
|
|
1531
1548
|
"Checkout terms are not available for this purchase intent.",
|
|
1532
1549
|
true
|
|
1533
1550
|
)
|
|
@@ -1537,8 +1554,8 @@ var CheckoutService = class {
|
|
|
1537
1554
|
paymentOption = selectCheckoutPaymentOption(terms, checkoutData);
|
|
1538
1555
|
} catch (error) {
|
|
1539
1556
|
return err(
|
|
1540
|
-
error instanceof
|
|
1541
|
-
|
|
1557
|
+
error instanceof chunkNFXCKTE2_js.CimplifyError ? error : new chunkNFXCKTE2_js.CimplifyError(
|
|
1558
|
+
chunkNFXCKTE2_js.ErrorCode.INVALID_PAYMENT_METHOD,
|
|
1542
1559
|
"Payment details are invalid.",
|
|
1543
1560
|
false
|
|
1544
1561
|
)
|
|
@@ -1546,8 +1563,8 @@ var CheckoutService = class {
|
|
|
1546
1563
|
}
|
|
1547
1564
|
if (!paymentOption && purchaseIntentRequiresPaymentOption(terms))
|
|
1548
1565
|
return err(
|
|
1549
|
-
new
|
|
1550
|
-
|
|
1566
|
+
new chunkNFXCKTE2_js.CimplifyError(
|
|
1567
|
+
chunkNFXCKTE2_js.ErrorCode.PAYMENT_CAPABILITY_MISMATCH,
|
|
1551
1568
|
"The selected payment method is not eligible for these checkout terms.",
|
|
1552
1569
|
true
|
|
1553
1570
|
)
|
|
@@ -1588,12 +1605,12 @@ var CheckoutService = class {
|
|
|
1588
1605
|
if (!started.ok) return started;
|
|
1589
1606
|
this.reconcileActionAuthority(started.value.initialResponse);
|
|
1590
1607
|
let result = confirmationToCheckoutResult(started.value.initialResponse);
|
|
1591
|
-
return (started.value.initialResponse.status ===
|
|
1608
|
+
return (started.value.initialResponse.status === chunkNFXCKTE2_js.PURCHASE_INTENT_CONFIRM_STATUS.ORDER_CREATED || started.value.initialResponse.status === chunkNFXCKTE2_js.PURCHASE_INTENT_CONFIRM_STATUS.PAYMENT_FAILED) && (clearIntentIdempotencyKey(started.value.intentScope), clearIntentIdempotencyKey(started.value.confirmationScope), this.intentCommands.delete(started.value.intentScope)), result;
|
|
1592
1609
|
}
|
|
1593
1610
|
async initializePayment(_orderId, _method) {
|
|
1594
1611
|
return err(
|
|
1595
|
-
new
|
|
1596
|
-
|
|
1612
|
+
new chunkNFXCKTE2_js.CimplifyError(
|
|
1613
|
+
chunkNFXCKTE2_js.ErrorCode.NOT_IMPLEMENTED,
|
|
1597
1614
|
"initializePayment is not available in REST mode.",
|
|
1598
1615
|
false
|
|
1599
1616
|
)
|
|
@@ -1609,8 +1626,8 @@ var CheckoutService = class {
|
|
|
1609
1626
|
let paymentId = input.payment_id.trim(), authority = this.actionAuthorities.get(paymentId);
|
|
1610
1627
|
if (!authority)
|
|
1611
1628
|
return err(
|
|
1612
|
-
new
|
|
1613
|
-
|
|
1629
|
+
new chunkNFXCKTE2_js.CimplifyError(
|
|
1630
|
+
chunkNFXCKTE2_js.ErrorCode.CHECKOUT_AUTHORITY_REQUIRED,
|
|
1614
1631
|
"The purchase-intent action authority is unavailable. Restart checkout before submitting authorization.",
|
|
1615
1632
|
false
|
|
1616
1633
|
)
|
|
@@ -1689,7 +1706,7 @@ var CheckoutService = class {
|
|
|
1689
1706
|
if (notifyCheckoutStatus(data.on_status_change, chunkGTJWQAGU_js.CHECKOUT_STATUS.PREPARING), !data.cart_id)
|
|
1690
1707
|
return ok(
|
|
1691
1708
|
toTerminalFailure(
|
|
1692
|
-
|
|
1709
|
+
chunkNFXCKTE2_js.ErrorCode.INVALID_CART,
|
|
1693
1710
|
"A valid cart is required before checkout can start.",
|
|
1694
1711
|
false
|
|
1695
1712
|
)
|
|
@@ -1698,7 +1715,7 @@ var CheckoutService = class {
|
|
|
1698
1715
|
if (!cartResult.ok || !cartResult.value?.id)
|
|
1699
1716
|
return ok(
|
|
1700
1717
|
toTerminalFailure(
|
|
1701
|
-
|
|
1718
|
+
chunkNFXCKTE2_js.ErrorCode.INVALID_CART,
|
|
1702
1719
|
"Unable to load cart for checkout.",
|
|
1703
1720
|
false
|
|
1704
1721
|
)
|
|
@@ -1707,7 +1724,7 @@ var CheckoutService = class {
|
|
|
1707
1724
|
if (cart.id !== data.cart_id || cart.items.length === 0)
|
|
1708
1725
|
return ok(
|
|
1709
1726
|
toTerminalFailure(
|
|
1710
|
-
|
|
1727
|
+
chunkNFXCKTE2_js.ErrorCode.INVALID_CART,
|
|
1711
1728
|
"Cart is empty or no longer valid. Please refresh and try again.",
|
|
1712
1729
|
false
|
|
1713
1730
|
)
|
|
@@ -1732,28 +1749,28 @@ var CheckoutService = class {
|
|
|
1732
1749
|
voucher_code: data.voucher_code,
|
|
1733
1750
|
pay_deposit: data.pay_deposit
|
|
1734
1751
|
}, rawBaseCurrency = typeof cart.pricing.currency == "string" ? cart.pricing.currency.trim().toUpperCase() : "";
|
|
1735
|
-
if (!
|
|
1752
|
+
if (!chunkNFXCKTE2_js.isSupportedCurrency(rawBaseCurrency))
|
|
1736
1753
|
return ok(
|
|
1737
1754
|
toTerminalFailure(
|
|
1738
|
-
|
|
1755
|
+
chunkNFXCKTE2_js.ErrorCode.UNSUPPORTED_CURRENCY,
|
|
1739
1756
|
"Cart currency is missing or unsupported. Refresh the cart before checkout.",
|
|
1740
1757
|
false
|
|
1741
1758
|
)
|
|
1742
1759
|
);
|
|
1743
1760
|
let baseCurrency = rawBaseCurrency, payCurrency = data.pay_currency?.trim().toUpperCase();
|
|
1744
|
-
if (payCurrency && !
|
|
1761
|
+
if (payCurrency && !chunkNFXCKTE2_js.isSupportedCurrency(payCurrency))
|
|
1745
1762
|
return ok(
|
|
1746
1763
|
toTerminalFailure(
|
|
1747
|
-
|
|
1764
|
+
chunkNFXCKTE2_js.ErrorCode.UNSUPPORTED_CURRENCY,
|
|
1748
1765
|
"Payment currency is unsupported for checkout.",
|
|
1749
1766
|
false
|
|
1750
1767
|
)
|
|
1751
1768
|
);
|
|
1752
|
-
let payCurrencyCode = payCurrency &&
|
|
1769
|
+
let payCurrencyCode = payCurrency && chunkNFXCKTE2_js.isSupportedCurrency(payCurrency) ? payCurrency : void 0, cartTotalSign = decimalSign(cart.pricing.total_price);
|
|
1753
1770
|
if (cartTotalSign === null || cartTotalSign < 0)
|
|
1754
1771
|
return ok(
|
|
1755
1772
|
toTerminalFailure(
|
|
1756
|
-
|
|
1773
|
+
chunkNFXCKTE2_js.ErrorCode.CHECKOUT_VALIDATION_FAILED,
|
|
1757
1774
|
"Cart total is not a valid non-negative decimal amount.",
|
|
1758
1775
|
false
|
|
1759
1776
|
)
|
|
@@ -1767,7 +1784,7 @@ var CheckoutService = class {
|
|
|
1767
1784
|
if (!fxQuoteResult.ok)
|
|
1768
1785
|
return ok(
|
|
1769
1786
|
toTerminalFailure(
|
|
1770
|
-
|
|
1787
|
+
chunkNFXCKTE2_js.ErrorCode.FX_QUOTE_FAILED,
|
|
1771
1788
|
fxQuoteResult.error.message || "Unable to lock FX quote for checkout.",
|
|
1772
1789
|
true
|
|
1773
1790
|
)
|
|
@@ -1779,7 +1796,7 @@ var CheckoutService = class {
|
|
|
1779
1796
|
if (!started.ok)
|
|
1780
1797
|
return ok(
|
|
1781
1798
|
toTerminalFailure(
|
|
1782
|
-
started.error.code ||
|
|
1799
|
+
started.error.code || chunkNFXCKTE2_js.ErrorCode.CHECKOUT_FAILED,
|
|
1783
1800
|
started.error.message || "Unable to process checkout.",
|
|
1784
1801
|
started.error.retryable ?? true
|
|
1785
1802
|
)
|
|
@@ -1794,19 +1811,19 @@ var CheckoutService = class {
|
|
|
1794
1811
|
signal: data.signal,
|
|
1795
1812
|
onStatusChange: (status, response) => {
|
|
1796
1813
|
let context = {};
|
|
1797
|
-
response && "order_id" in response && (context.order_id = response.order_id), response?.status ===
|
|
1814
|
+
response && "order_id" in response && (context.order_id = response.order_id), response?.status === chunkNFXCKTE2_js.PURCHASE_INTENT_CONFIRM_STATUS.TERMS_CHANGED && (context.replacement_terms = response.replacement, context.terms_deltas = response.deltas), response?.status === chunkNFXCKTE2_js.PURCHASE_INTENT_CONFIRM_STATUS.SELECTION_UNAVAILABLE && (context.unavailable_lines = response.lines);
|
|
1798
1815
|
let checkoutStatus = CHECKOUT_STATUS_BY_PURCHASE_INTENT_RESOLVE_STATUS[status];
|
|
1799
1816
|
notifyCheckoutStatus(data.on_status_change, checkoutStatus, context);
|
|
1800
1817
|
},
|
|
1801
1818
|
onActionRequired: async (action) => {
|
|
1802
1819
|
switch (action.status) {
|
|
1803
|
-
case
|
|
1820
|
+
case chunkNFXCKTE2_js.PURCHASE_INTENT_CONFIRM_STATUS.CARD_POPUP_REQUIRED: {
|
|
1804
1821
|
if (!(data.allow_popups ?? typeof window < "u"))
|
|
1805
1822
|
return actionFailure = {
|
|
1806
|
-
code:
|
|
1823
|
+
code: chunkNFXCKTE2_js.ErrorCode.PROVIDER_UNAVAILABLE,
|
|
1807
1824
|
message: "Card authorization UI is unavailable in this environment.",
|
|
1808
1825
|
recoverable: !1
|
|
1809
|
-
},
|
|
1826
|
+
}, chunkNFXCKTE2_js.PURCHASE_INTENT_ACTION_DECISION.STOP;
|
|
1810
1827
|
let outcome;
|
|
1811
1828
|
try {
|
|
1812
1829
|
notifyAuthorizationUi(data.on_authorization_ui_change, !0), outcome = await this.authorizeCardPopup(
|
|
@@ -1827,24 +1844,24 @@ var CheckoutService = class {
|
|
|
1827
1844
|
} finally {
|
|
1828
1845
|
notifyAuthorizationUi(data.on_authorization_ui_change, !1);
|
|
1829
1846
|
}
|
|
1830
|
-
return outcome.status === PAYMENT_AUTHORIZATION_OUTCOME_STATUS.SUBMITTED ?
|
|
1831
|
-
code:
|
|
1847
|
+
return outcome.status === PAYMENT_AUTHORIZATION_OUTCOME_STATUS.SUBMITTED ? chunkNFXCKTE2_js.PURCHASE_INTENT_ACTION_DECISION.CONTINUE : (actionFailure = outcome.status === PAYMENT_AUTHORIZATION_OUTCOME_STATUS.CANCELLED ? {
|
|
1848
|
+
code: chunkNFXCKTE2_js.ErrorCode.PAYMENT_CANCELLED,
|
|
1832
1849
|
message: "Card payment was cancelled before submission.",
|
|
1833
1850
|
recoverable: !0
|
|
1834
1851
|
} : {
|
|
1835
1852
|
code: outcome.code,
|
|
1836
1853
|
message: outcome.message,
|
|
1837
1854
|
recoverable: outcome.recoverable
|
|
1838
|
-
},
|
|
1855
|
+
}, chunkNFXCKTE2_js.PURCHASE_INTENT_ACTION_DECISION.STOP);
|
|
1839
1856
|
}
|
|
1840
|
-
case
|
|
1841
|
-
let authorizationUrl =
|
|
1857
|
+
case chunkNFXCKTE2_js.PURCHASE_INTENT_CONFIRM_STATUS.REDIRECT_REQUIRED: {
|
|
1858
|
+
let authorizationUrl = chunkQOCHWR4V_js.paymentAuthorizationUrl(action.authorization_url);
|
|
1842
1859
|
if (!authorizationUrl)
|
|
1843
1860
|
return actionFailure = {
|
|
1844
|
-
code:
|
|
1861
|
+
code: chunkNFXCKTE2_js.ErrorCode.AUTHORIZATION_FAILED,
|
|
1845
1862
|
message: "The provider returned an invalid authorization URL.",
|
|
1846
1863
|
recoverable: !1
|
|
1847
|
-
},
|
|
1864
|
+
}, chunkNFXCKTE2_js.PURCHASE_INTENT_ACTION_DECISION.STOP;
|
|
1848
1865
|
if (typeof window < "u")
|
|
1849
1866
|
if (data.allow_popups === !1)
|
|
1850
1867
|
window.location.assign(authorizationUrl);
|
|
@@ -1856,38 +1873,38 @@ var CheckoutService = class {
|
|
|
1856
1873
|
);
|
|
1857
1874
|
if (!popup)
|
|
1858
1875
|
return actionFailure = {
|
|
1859
|
-
code:
|
|
1876
|
+
code: chunkNFXCKTE2_js.ErrorCode.POPUP_BLOCKED,
|
|
1860
1877
|
message: "Authorization popup was blocked.",
|
|
1861
1878
|
recoverable: !0
|
|
1862
|
-
},
|
|
1879
|
+
}, chunkNFXCKTE2_js.PURCHASE_INTENT_ACTION_DECISION.STOP;
|
|
1863
1880
|
popup.opener = null, popup.location.replace(authorizationUrl);
|
|
1864
1881
|
}
|
|
1865
1882
|
return actionFailure = {
|
|
1866
|
-
code:
|
|
1883
|
+
code: chunkNFXCKTE2_js.ErrorCode.REDIRECT_REQUIRED,
|
|
1867
1884
|
message: "Complete authorization at the payment provider, then resume checkout.",
|
|
1868
1885
|
recoverable: !0
|
|
1869
|
-
},
|
|
1886
|
+
}, chunkNFXCKTE2_js.PURCHASE_INTENT_ACTION_DECISION.STOP;
|
|
1870
1887
|
}
|
|
1871
|
-
case
|
|
1888
|
+
case chunkNFXCKTE2_js.PURCHASE_INTENT_CONFIRM_STATUS.AUTHORIZATION_REQUIRED: {
|
|
1872
1889
|
let expected = authorizationKind(action.authorization_type);
|
|
1873
1890
|
if (!expected || !data.on_authorization_required)
|
|
1874
1891
|
return actionFailure = {
|
|
1875
|
-
code:
|
|
1892
|
+
code: chunkNFXCKTE2_js.ErrorCode.AUTHORIZATION_REQUIRED,
|
|
1876
1893
|
message: "Additional payment authorization is required.",
|
|
1877
1894
|
recoverable: !0
|
|
1878
|
-
},
|
|
1895
|
+
}, chunkNFXCKTE2_js.PURCHASE_INTENT_ACTION_DECISION.STOP;
|
|
1879
1896
|
let submission;
|
|
1880
1897
|
return await data.on_authorization_required(expected, async (candidate) => {
|
|
1881
1898
|
if (submission) throw new Error("Authorization was already submitted.");
|
|
1882
1899
|
submission = normalizeAuthorizationSubmission(expected, candidate);
|
|
1883
1900
|
}), submission ? {
|
|
1884
|
-
kind:
|
|
1901
|
+
kind: chunkNFXCKTE2_js.PURCHASE_INTENT_ACTION_DECISION.SUBMIT,
|
|
1885
1902
|
request: { authorization: submission }
|
|
1886
1903
|
} : (actionFailure = {
|
|
1887
|
-
code:
|
|
1904
|
+
code: chunkNFXCKTE2_js.ErrorCode.AUTHORIZATION_REQUIRED,
|
|
1888
1905
|
message: "Payment authorization was not submitted.",
|
|
1889
1906
|
recoverable: !0
|
|
1890
|
-
},
|
|
1907
|
+
}, chunkNFXCKTE2_js.PURCHASE_INTENT_ACTION_DECISION.STOP);
|
|
1891
1908
|
}
|
|
1892
1909
|
}
|
|
1893
1910
|
}
|
|
@@ -1895,13 +1912,13 @@ var CheckoutService = class {
|
|
|
1895
1912
|
if (!resolved.ok)
|
|
1896
1913
|
return ok(
|
|
1897
1914
|
toTerminalFailure(
|
|
1898
|
-
resolved.error.code ||
|
|
1915
|
+
resolved.error.code || chunkNFXCKTE2_js.ErrorCode.CHECKOUT_FAILED,
|
|
1899
1916
|
resolved.error.message || "Unable to resolve checkout.",
|
|
1900
1917
|
resolved.error.retryable ?? !0
|
|
1901
1918
|
)
|
|
1902
1919
|
);
|
|
1903
1920
|
switch (resolved.value.kind) {
|
|
1904
|
-
case
|
|
1921
|
+
case chunkNFXCKTE2_js.PURCHASE_INTENT_RESOLUTION_KIND.COMPLETED: {
|
|
1905
1922
|
clearIntentIdempotencyKey(started.value.intentScope), clearIntentIdempotencyKey(started.value.confirmationScope);
|
|
1906
1923
|
let response = resolved.value.response;
|
|
1907
1924
|
notifyCheckoutStatus(data.on_status_change, chunkGTJWQAGU_js.CHECKOUT_STATUS.FINALIZING, {
|
|
@@ -1922,68 +1939,68 @@ var CheckoutService = class {
|
|
|
1922
1939
|
enrolled_in_link: enrolledInLink
|
|
1923
1940
|
});
|
|
1924
1941
|
}
|
|
1925
|
-
case
|
|
1942
|
+
case chunkNFXCKTE2_js.PURCHASE_INTENT_RESOLUTION_KIND.FAILED:
|
|
1926
1943
|
return clearIntentIdempotencyKey(started.value.confirmationScope), ok(
|
|
1927
1944
|
toTerminalFailure(
|
|
1928
|
-
|
|
1945
|
+
chunkNFXCKTE2_js.PURCHASE_INTENT_ERROR_CODE.PAYMENT_FAILED,
|
|
1929
1946
|
"Payment failed. Choose another method or retry collection.",
|
|
1930
1947
|
!0
|
|
1931
1948
|
)
|
|
1932
1949
|
);
|
|
1933
|
-
case
|
|
1950
|
+
case chunkNFXCKTE2_js.PURCHASE_INTENT_RESOLUTION_KIND.OUTCOME_UNKNOWN:
|
|
1934
1951
|
return ok(
|
|
1935
1952
|
toTerminalFailure(
|
|
1936
|
-
|
|
1953
|
+
chunkNFXCKTE2_js.ErrorCode.PAYMENT_OUTCOME_UNKNOWN,
|
|
1937
1954
|
"Payment outcome is still unknown. Resume this intent before retrying.",
|
|
1938
1955
|
!0
|
|
1939
1956
|
)
|
|
1940
1957
|
);
|
|
1941
|
-
case
|
|
1958
|
+
case chunkNFXCKTE2_js.PURCHASE_INTENT_RESOLUTION_KIND.TIMED_OUT:
|
|
1942
1959
|
return ok(
|
|
1943
1960
|
toTerminalFailure(
|
|
1944
|
-
|
|
1961
|
+
chunkNFXCKTE2_js.ErrorCode.TIMEOUT,
|
|
1945
1962
|
"Payment is still processing. Resume this intent to continue polling.",
|
|
1946
1963
|
!0
|
|
1947
1964
|
)
|
|
1948
1965
|
);
|
|
1949
|
-
case
|
|
1966
|
+
case chunkNFXCKTE2_js.PURCHASE_INTENT_RESOLUTION_KIND.ACTION_REQUIRED:
|
|
1950
1967
|
return ok(
|
|
1951
1968
|
toTerminalFailure(
|
|
1952
|
-
actionFailure?.code ??
|
|
1969
|
+
actionFailure?.code ?? chunkNFXCKTE2_js.ErrorCode.AUTHORIZATION_REQUIRED,
|
|
1953
1970
|
actionFailure?.message ?? "Checkout requires additional authorization.",
|
|
1954
1971
|
actionFailure?.recoverable ?? !0
|
|
1955
1972
|
)
|
|
1956
1973
|
);
|
|
1957
|
-
case
|
|
1974
|
+
case chunkNFXCKTE2_js.PURCHASE_INTENT_RESOLUTION_KIND.REVIEW_REQUIRED:
|
|
1958
1975
|
switch (resolved.value.response.status) {
|
|
1959
|
-
case
|
|
1976
|
+
case chunkNFXCKTE2_js.PURCHASE_INTENT_CONFIRM_STATUS.TERMS_CHANGED:
|
|
1960
1977
|
return ok(
|
|
1961
1978
|
toTerminalFailure(
|
|
1962
|
-
|
|
1979
|
+
chunkNFXCKTE2_js.PURCHASE_INTENT_ERROR_CODE.TERMS_CHANGED,
|
|
1963
1980
|
"Checkout terms changed and require explicit review.",
|
|
1964
1981
|
!0
|
|
1965
1982
|
)
|
|
1966
1983
|
);
|
|
1967
|
-
case
|
|
1984
|
+
case chunkNFXCKTE2_js.PURCHASE_INTENT_CONFIRM_STATUS.SELECTION_UNAVAILABLE:
|
|
1968
1985
|
return ok(
|
|
1969
1986
|
toTerminalFailure(
|
|
1970
|
-
|
|
1987
|
+
chunkNFXCKTE2_js.PURCHASE_INTENT_ERROR_CODE.SELECTION_UNAVAILABLE,
|
|
1971
1988
|
"One or more checkout selections are unavailable.",
|
|
1972
1989
|
!0
|
|
1973
1990
|
)
|
|
1974
1991
|
);
|
|
1975
|
-
case
|
|
1992
|
+
case chunkNFXCKTE2_js.PURCHASE_INTENT_CONFIRM_STATUS.OFFER_ENDED:
|
|
1976
1993
|
return ok(
|
|
1977
1994
|
toTerminalFailure(
|
|
1978
|
-
|
|
1995
|
+
chunkNFXCKTE2_js.PURCHASE_INTENT_ERROR_CODE.OFFER_ENDED,
|
|
1979
1996
|
"This offer has ended.",
|
|
1980
1997
|
!1
|
|
1981
1998
|
)
|
|
1982
1999
|
);
|
|
1983
|
-
case
|
|
2000
|
+
case chunkNFXCKTE2_js.PURCHASE_INTENT_CONFIRM_STATUS.SOURCE_UNAVAILABLE:
|
|
1984
2001
|
return ok(
|
|
1985
2002
|
toTerminalFailure(
|
|
1986
|
-
|
|
2003
|
+
chunkNFXCKTE2_js.PURCHASE_INTENT_ERROR_CODE.SOURCE_UNAVAILABLE,
|
|
1987
2004
|
"This purchase source is unavailable.",
|
|
1988
2005
|
!1
|
|
1989
2006
|
)
|
|
@@ -1994,7 +2011,7 @@ var CheckoutService = class {
|
|
|
1994
2011
|
let cancelled = data.signal?.aborted || error instanceof Error && error.name === ABORT_ERROR_NAME;
|
|
1995
2012
|
return ok(
|
|
1996
2013
|
toTerminalFailure(
|
|
1997
|
-
cancelled ?
|
|
2014
|
+
cancelled ? chunkNFXCKTE2_js.ErrorCode.CANCELLED : chunkNFXCKTE2_js.ErrorCode.AUTHORIZATION_FAILED,
|
|
1998
2015
|
cancelled ? "Checkout was cancelled." : error instanceof Error ? error.message : "Checkout authorization failed.",
|
|
1999
2016
|
true
|
|
2000
2017
|
)
|
|
@@ -2071,7 +2088,7 @@ var LinkService = class {
|
|
|
2071
2088
|
supersededActivation() {
|
|
2072
2089
|
return {
|
|
2073
2090
|
ok: false,
|
|
2074
|
-
error: new
|
|
2091
|
+
error: new chunkNFXCKTE2_js.CimplifyError(
|
|
2075
2092
|
"session_superseded",
|
|
2076
2093
|
"A newer authentication session replaced this one"
|
|
2077
2094
|
)
|
|
@@ -2181,7 +2198,7 @@ var LinkService = class {
|
|
|
2181
2198
|
*/
|
|
2182
2199
|
async confirmSaveDetails(data, code) {
|
|
2183
2200
|
let verified = await this.verifyOtp(code);
|
|
2184
|
-
return verified.ok ? verified.value.success ? this.saveDetails(data) : err(new
|
|
2201
|
+
return verified.ok ? verified.value.success ? this.saveDetails(data) : err(new chunkNFXCKTE2_js.CimplifyError(chunkNFXCKTE2_js.ErrorCode.UNAUTHORIZED, verified.value.message, true)) : err(verified.error);
|
|
2185
2202
|
}
|
|
2186
2203
|
async updatePreferences(preferences) {
|
|
2187
2204
|
return safe(this.client.linkPost("/v1/link/preferences", preferences));
|
|
@@ -2354,7 +2371,7 @@ var BusinessService = class {
|
|
|
2354
2371
|
let result = await this.getLocations(opts);
|
|
2355
2372
|
if (!result.ok) return err(result.error);
|
|
2356
2373
|
let location = result.value.find((item) => item.id === locationId);
|
|
2357
|
-
return location ? ok(location) : err(new
|
|
2374
|
+
return location ? ok(location) : err(new chunkNFXCKTE2_js.CimplifyError(chunkNFXCKTE2_js.ErrorCode.NOT_FOUND, `Location not found: ${locationId}`, false));
|
|
2358
2375
|
}
|
|
2359
2376
|
async getHours(opts) {
|
|
2360
2377
|
return safe(this.client.get("/api/v1/business/hours", opts));
|
|
@@ -2892,7 +2909,7 @@ function createClientEvents() {
|
|
|
2892
2909
|
|
|
2893
2910
|
// src/elements.ts
|
|
2894
2911
|
function toCheckoutError(code, message, recoverable) {
|
|
2895
|
-
let hint =
|
|
2912
|
+
let hint = chunkNFXCKTE2_js.getErrorHint(code);
|
|
2896
2913
|
return {
|
|
2897
2914
|
success: false,
|
|
2898
2915
|
error: {
|
|
@@ -3095,7 +3112,7 @@ var CimplifyElements = class {
|
|
|
3095
3112
|
} : {
|
|
3096
3113
|
success: false,
|
|
3097
3114
|
error: {
|
|
3098
|
-
code: result.error?.code ||
|
|
3115
|
+
code: result.error?.code || chunkNFXCKTE2_js.ErrorCode.CHECKOUT_FAILED,
|
|
3099
3116
|
message: result.error?.message || "Checkout failed"
|
|
3100
3117
|
}
|
|
3101
3118
|
};
|
|
@@ -3110,38 +3127,38 @@ var CimplifyElements = class {
|
|
|
3110
3127
|
location_id: options.location_id
|
|
3111
3128
|
}), typeof options.tip_amount == "number" && options.tip_amount > 0)
|
|
3112
3129
|
return toCheckoutError(
|
|
3113
|
-
|
|
3130
|
+
chunkNFXCKTE2_js.ErrorCode.TIP_NOT_SUPPORTED,
|
|
3114
3131
|
"Tips are not part of checkout. Remove the tip and try again.",
|
|
3115
3132
|
false
|
|
3116
3133
|
);
|
|
3117
3134
|
if (this.checkoutInProgress)
|
|
3118
3135
|
return this.debug("[cimplify:checkout] BLOCKED: already processing"), toCheckoutError(
|
|
3119
|
-
|
|
3136
|
+
chunkNFXCKTE2_js.ErrorCode.ALREADY_PROCESSING,
|
|
3120
3137
|
"Checkout is already in progress.",
|
|
3121
3138
|
false
|
|
3122
3139
|
);
|
|
3123
3140
|
if (this.checkoutInProgress = true, !options.cart_id && !options.intent_id)
|
|
3124
3141
|
return this.debug("[cimplify:checkout] BLOCKED: no cart_id or intent_id"), this.checkoutInProgress = false, toCheckoutError(
|
|
3125
|
-
|
|
3142
|
+
chunkNFXCKTE2_js.ErrorCode.CHECKOUT_AUTHORITY_REQUIRED,
|
|
3126
3143
|
"A cart or existing purchase intent is required before checkout can start.",
|
|
3127
3144
|
false
|
|
3128
3145
|
);
|
|
3129
3146
|
if (!options.order_type)
|
|
3130
3147
|
return this.debug("[cimplify:checkout] BLOCKED: no order_type"), this.checkoutInProgress = false, toCheckoutError(
|
|
3131
|
-
|
|
3148
|
+
chunkNFXCKTE2_js.ErrorCode.ORDER_TYPE_REQUIRED,
|
|
3132
3149
|
"Order type is required before checkout can start.",
|
|
3133
3150
|
false
|
|
3134
3151
|
);
|
|
3135
3152
|
let checkoutElement = this.elements.get(ELEMENT_TYPES.CHECKOUT) || this.elements.get(ELEMENT_TYPES.PAYMENT);
|
|
3136
3153
|
if (!checkoutElement)
|
|
3137
3154
|
return this.debug("[cimplify:checkout] BLOCKED: no checkout element"), this.checkoutInProgress = false, toCheckoutError(
|
|
3138
|
-
|
|
3155
|
+
chunkNFXCKTE2_js.ErrorCode.NO_PAYMENT_ELEMENT,
|
|
3139
3156
|
"Checkout element must be mounted before checkout.",
|
|
3140
3157
|
false
|
|
3141
3158
|
);
|
|
3142
3159
|
if (!checkoutElement.isMounted())
|
|
3143
3160
|
return this.debug("[cimplify:checkout] BLOCKED: checkout element not mounted"), this.checkoutInProgress = false, toCheckoutError(
|
|
3144
|
-
|
|
3161
|
+
chunkNFXCKTE2_js.ErrorCode.PAYMENT_NOT_MOUNTED,
|
|
3145
3162
|
"Checkout element must be mounted before checkout.",
|
|
3146
3163
|
false
|
|
3147
3164
|
);
|
|
@@ -3149,7 +3166,7 @@ var CimplifyElements = class {
|
|
|
3149
3166
|
if (!isUnifiedCheckout) {
|
|
3150
3167
|
if (this.elements.get(ELEMENT_TYPES.AUTH) && !this.isAuthenticated())
|
|
3151
3168
|
return this.debug("[cimplify:checkout] BLOCKED: auth incomplete"), this.checkoutInProgress = false, toCheckoutError(
|
|
3152
|
-
|
|
3169
|
+
chunkNFXCKTE2_js.ErrorCode.AUTH_INCOMPLETE,
|
|
3153
3170
|
"Authentication must complete before checkout can start.",
|
|
3154
3171
|
true
|
|
3155
3172
|
);
|
|
@@ -3196,7 +3213,7 @@ var CimplifyElements = class {
|
|
|
3196
3213
|
clearTimeout(timeout), timeout = setTimeout(() => {
|
|
3197
3214
|
settle(
|
|
3198
3215
|
toCheckoutError(
|
|
3199
|
-
|
|
3216
|
+
chunkNFXCKTE2_js.ErrorCode.TIMEOUT,
|
|
3200
3217
|
"Checkout timed out before receiving a terminal response.",
|
|
3201
3218
|
true
|
|
3202
3219
|
)
|
|
@@ -3240,7 +3257,7 @@ var CimplifyElements = class {
|
|
|
3240
3257
|
enrolled_in_link: message.enrolled_in_link
|
|
3241
3258
|
})), message.type === MESSAGE_TYPES.LOGOUT_COMPLETE && (checkoutElement.sendMessage({ type: MESSAGE_TYPES.ABORT_CHECKOUT }), settle(
|
|
3242
3259
|
toCheckoutError(
|
|
3243
|
-
|
|
3260
|
+
chunkNFXCKTE2_js.ErrorCode.AUTH_LOST,
|
|
3244
3261
|
"Authentication was cleared during checkout.",
|
|
3245
3262
|
true
|
|
3246
3263
|
)
|
|
@@ -3248,7 +3265,7 @@ var CimplifyElements = class {
|
|
|
3248
3265
|
}
|
|
3249
3266
|
};
|
|
3250
3267
|
typeof window < "u" && window.addEventListener("message", handleCheckoutMessage), abortFn = () => {
|
|
3251
|
-
checkoutElement.sendMessage({ type: MESSAGE_TYPES.ABORT_CHECKOUT }), settle(toCheckoutError(
|
|
3268
|
+
checkoutElement.sendMessage({ type: MESSAGE_TYPES.ABORT_CHECKOUT }), settle(toCheckoutError(chunkNFXCKTE2_js.ErrorCode.CANCELLED, "Checkout was cancelled.", true));
|
|
3252
3269
|
}, this.activeCheckoutAbort = abortFn, this.debug("[cimplify:checkout] sending process_checkout to checkout iframe", {
|
|
3253
3270
|
cart_id: processMessage.cart_id,
|
|
3254
3271
|
intent_id: processMessage.intent_id,
|
|
@@ -3401,7 +3418,7 @@ var CimplifyElements = class {
|
|
|
3401
3418
|
let auth = this.options.auth ?? {}, clientId = auth.clientId ?? readPublicEnv("NEXT_PUBLIC_CIMPLIFY_CLIENT_ID"), redirectUri = auth.redirectUri ?? readPublicEnv("NEXT_PUBLIC_CIMPLIFY_REDIRECT_URI");
|
|
3402
3419
|
if (!clientId || !redirectUri) {
|
|
3403
3420
|
sourceElement._emitError({
|
|
3404
|
-
code:
|
|
3421
|
+
code: chunkNFXCKTE2_js.ErrorCode.AUTH_CONFIG_REQUIRED,
|
|
3405
3422
|
message: "Cimplify OAuth clientId and redirectUri are required."
|
|
3406
3423
|
});
|
|
3407
3424
|
return;
|
|
@@ -3423,7 +3440,7 @@ var CimplifyElements = class {
|
|
|
3423
3440
|
if (this.authGeneration !== generation) return;
|
|
3424
3441
|
if (this.authInProgress = false, !accessToken) {
|
|
3425
3442
|
sourceElement._emitError({
|
|
3426
|
-
code:
|
|
3443
|
+
code: chunkNFXCKTE2_js.ErrorCode.AUTH_CALLBACK_MISSING_TOKEN,
|
|
3427
3444
|
message: "Sign-in callback did not return an access token."
|
|
3428
3445
|
});
|
|
3429
3446
|
return;
|
|
@@ -3442,7 +3459,7 @@ var CimplifyElements = class {
|
|
|
3442
3459
|
}
|
|
3443
3460
|
}).catch((error) => {
|
|
3444
3461
|
this.authGeneration === generation && (this.authInProgress = false, sourceElement._emitError({
|
|
3445
|
-
code:
|
|
3462
|
+
code: chunkNFXCKTE2_js.ErrorCode.AUTH_START_FAILED,
|
|
3446
3463
|
message: error instanceof Error ? error.message : "Unable to start sign-in."
|
|
3447
3464
|
}));
|
|
3448
3465
|
});
|
|
@@ -3621,7 +3638,7 @@ var CimplifyElement = class {
|
|
|
3621
3638
|
let resolvedBusinessId = this.businessId ?? await this.parent.resolveBusinessId();
|
|
3622
3639
|
if (!resolvedBusinessId || !this.container || !this.mounted) {
|
|
3623
3640
|
console.error("Unable to mount element without a resolved business ID"), this.emit(EVENT_TYPES.ERROR, {
|
|
3624
|
-
code:
|
|
3641
|
+
code: chunkNFXCKTE2_js.ErrorCode.BUSINESS_ID_REQUIRED,
|
|
3625
3642
|
message: "Unable to initialize checkout without a business ID."
|
|
3626
3643
|
});
|
|
3627
3644
|
return;
|