@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
package/dist/react.js
CHANGED
|
@@ -3,16 +3,16 @@
|
|
|
3
3
|
|
|
4
4
|
var chunkLHWPRUJL_js = require('./chunk-LHWPRUJL.js');
|
|
5
5
|
var chunkZF7JCXCI_js = require('./chunk-ZF7JCXCI.js');
|
|
6
|
-
var
|
|
7
|
-
require('./chunk-
|
|
6
|
+
var chunkTWM6DLYF_js = require('./chunk-TWM6DLYF.js');
|
|
7
|
+
require('./chunk-AHNR3BXI.js');
|
|
8
8
|
require('./chunk-MEXP6DA6.js');
|
|
9
|
-
require('./chunk-
|
|
10
|
-
var
|
|
9
|
+
require('./chunk-PQTQKNKD.js');
|
|
10
|
+
var chunkETZDIISN_js = require('./chunk-ETZDIISN.js');
|
|
11
11
|
var chunkWOF3AD3J_js = require('./chunk-WOF3AD3J.js');
|
|
12
|
-
var
|
|
12
|
+
var chunk6QANXRUM_js = require('./chunk-6QANXRUM.js');
|
|
13
13
|
var chunkGTJWQAGU_js = require('./chunk-GTJWQAGU.js');
|
|
14
|
-
var
|
|
15
|
-
var
|
|
14
|
+
var chunkQOCHWR4V_js = require('./chunk-QOCHWR4V.js');
|
|
15
|
+
var chunkNFXCKTE2_js = require('./chunk-NFXCKTE2.js');
|
|
16
16
|
require('./chunk-JGBCIKJV.js');
|
|
17
17
|
var React14 = require('react');
|
|
18
18
|
var jsxRuntime = require('react/jsx-runtime');
|
|
@@ -387,8 +387,8 @@ function toNumber(value) {
|
|
|
387
387
|
}
|
|
388
388
|
return 0;
|
|
389
389
|
}
|
|
390
|
-
function roundMoney(value) {
|
|
391
|
-
return Math.max(0,
|
|
390
|
+
function roundMoney(value, currency) {
|
|
391
|
+
return Math.max(0, chunkQOCHWR4V_js.roundToCurrencyDigits(value, currency));
|
|
392
392
|
}
|
|
393
393
|
function clampQuantity(quantity) {
|
|
394
394
|
return Number.isFinite(quantity) ? Math.max(1, Math.floor(quantity)) : 1;
|
|
@@ -425,18 +425,21 @@ function attachInternalItemMetadata(item, metadata = {}) {
|
|
|
425
425
|
};
|
|
426
426
|
return metadata.quotedUnitPrice !== void 0 && (internalItem._quotedUnitPrice = metadata.quotedUnitPrice), internalItem;
|
|
427
427
|
}
|
|
428
|
-
function calculateLineSubtotal(item) {
|
|
428
|
+
function calculateLineSubtotal(item, currency) {
|
|
429
429
|
if (item._quotedUnitPrice !== void 0)
|
|
430
|
-
return roundMoney(
|
|
431
|
-
let unitPrice =
|
|
432
|
-
item.variant?.price_adjustment && (unitPrice +=
|
|
430
|
+
return roundMoney(chunkQOCHWR4V_js.parsePrice(item._quotedUnitPrice) * item.quantity, currency);
|
|
431
|
+
let unitPrice = chunkQOCHWR4V_js.parsePrice(item.product.default_price);
|
|
432
|
+
item.variant?.price_adjustment && (unitPrice += chunkQOCHWR4V_js.parsePrice(item.variant.price_adjustment));
|
|
433
433
|
for (let option of item.addOnOptions || [])
|
|
434
|
-
option.default_price && (unitPrice +=
|
|
435
|
-
return roundMoney(unitPrice * item.quantity);
|
|
434
|
+
option.default_price && (unitPrice += chunkQOCHWR4V_js.parsePrice(option.default_price));
|
|
435
|
+
return roundMoney(unitPrice * item.quantity, currency);
|
|
436
436
|
}
|
|
437
|
-
function calculateSummary(items) {
|
|
438
|
-
let subtotal = roundMoney(
|
|
439
|
-
|
|
437
|
+
function calculateSummary(items, currency) {
|
|
438
|
+
let subtotal = roundMoney(
|
|
439
|
+
items.reduce((sum, item) => sum + calculateLineSubtotal(item, currency), 0),
|
|
440
|
+
currency
|
|
441
|
+
), tax = roundMoney(subtotal * (0), currency);
|
|
442
|
+
return { subtotal, tax, total: roundMoney(subtotal + tax, currency) };
|
|
440
443
|
}
|
|
441
444
|
function applyCartPatch(base, patch) {
|
|
442
445
|
switch (patch.kind) {
|
|
@@ -452,17 +455,17 @@ function applyCartPatch(base, patch) {
|
|
|
452
455
|
};
|
|
453
456
|
} else
|
|
454
457
|
nextItems.push(patch.tempItem);
|
|
455
|
-
return { ...base, items: nextItems, ...calculateSummary(nextItems) };
|
|
458
|
+
return { ...base, items: nextItems, ...calculateSummary(nextItems, base.currency) };
|
|
456
459
|
}
|
|
457
460
|
case "remove_item": {
|
|
458
461
|
let nextItems = base.items.filter((item) => item.id !== patch.itemId);
|
|
459
|
-
return { ...base, items: nextItems, ...calculateSummary(nextItems) };
|
|
462
|
+
return { ...base, items: nextItems, ...calculateSummary(nextItems, base.currency) };
|
|
460
463
|
}
|
|
461
464
|
case "set_quantity": {
|
|
462
465
|
let resolved = clampQuantity(patch.quantity), nextItems = base.items.map(
|
|
463
466
|
(item) => item.id === patch.itemId ? { ...item, quantity: resolved } : item
|
|
464
467
|
);
|
|
465
|
-
return { ...base, items: nextItems, ...calculateSummary(nextItems) };
|
|
468
|
+
return { ...base, items: nextItems, ...calculateSummary(nextItems, base.currency) };
|
|
466
469
|
}
|
|
467
470
|
case "clear":
|
|
468
471
|
return { ...base, items: [], subtotal: 0, tax: 0, total: 0 };
|
|
@@ -539,7 +542,8 @@ function toProductFromServerItem(item, businessId) {
|
|
|
539
542
|
metadata: { from_sdk: true }
|
|
540
543
|
};
|
|
541
544
|
}
|
|
542
|
-
function mapServerCart(serverCart,
|
|
545
|
+
function mapServerCart(serverCart, businessCurrency) {
|
|
546
|
+
let cartCurrency = serverCart.pricing.currency || businessCurrency;
|
|
543
547
|
return {
|
|
544
548
|
items: serverCart.items.map((item) => {
|
|
545
549
|
let variant = item.variant_info || item.variant_name ? {
|
|
@@ -583,14 +587,14 @@ function mapServerCart(serverCart, fallbackCurrency) {
|
|
|
583
587
|
{ quotedUnitPrice: item.total_price }
|
|
584
588
|
);
|
|
585
589
|
}),
|
|
586
|
-
subtotal: roundMoney(toNumber(serverCart.pricing.subtotal)),
|
|
587
|
-
tax: roundMoney(toNumber(serverCart.pricing.tax_amount)),
|
|
590
|
+
subtotal: roundMoney(toNumber(serverCart.pricing.subtotal), cartCurrency),
|
|
591
|
+
tax: roundMoney(toNumber(serverCart.pricing.tax_amount), cartCurrency),
|
|
588
592
|
taxRate: serverCart.pricing.tax_rate != null ? toNumber(serverCart.pricing.tax_rate) : null,
|
|
589
593
|
taxInclusive: serverCart.pricing.tax_inclusive,
|
|
590
594
|
displayGross: chunkZF7JCXCI_js.displaysGrossPrices(serverCart.pricing),
|
|
591
595
|
taxJurisdictionLabel: serverCart.pricing.tax_jurisdiction_label ?? null,
|
|
592
|
-
total: roundMoney(toNumber(serverCart.pricing.total_price)),
|
|
593
|
-
currency:
|
|
596
|
+
total: roundMoney(toNumber(serverCart.pricing.total_price), cartCurrency),
|
|
597
|
+
currency: cartCurrency,
|
|
594
598
|
isLoading: false
|
|
595
599
|
};
|
|
596
600
|
}
|
|
@@ -607,7 +611,7 @@ function annotateOptimisticItems(base, ops) {
|
|
|
607
611
|
};
|
|
608
612
|
}
|
|
609
613
|
function deriveView(base, ops) {
|
|
610
|
-
let folded = base ?? emptyBase(
|
|
614
|
+
let folded = base ?? emptyBase(null);
|
|
611
615
|
for (let op of ops)
|
|
612
616
|
folded = applyCartPatch(folded, op.patch);
|
|
613
617
|
return folded = annotateOptimisticItems(folded, ops), {
|
|
@@ -626,7 +630,7 @@ async function syncFromServer(entry) {
|
|
|
626
630
|
}), next;
|
|
627
631
|
}
|
|
628
632
|
function emitMutationError(entry, operation, opId, idempotencyKey, error) {
|
|
629
|
-
entry.client.events.emit(
|
|
633
|
+
entry.client.events.emit(chunk6QANXRUM_js.MUTATION_ERROR, {
|
|
630
634
|
service: "cart",
|
|
631
635
|
operation,
|
|
632
636
|
opId,
|
|
@@ -645,7 +649,7 @@ function getOrCreateStore(params) {
|
|
|
645
649
|
purgeLegacyCartCachesOnce();
|
|
646
650
|
let storeKey = buildStoreKey(client, locationId), existing = cartStores.get(storeKey);
|
|
647
651
|
if (existing)
|
|
648
|
-
return existing.optimisticEnabled = optimisticEnabled, existing;
|
|
652
|
+
return existing.optimisticEnabled = optimisticEnabled, currency !== null && (existing.currency = currency), existing;
|
|
649
653
|
let entry = {
|
|
650
654
|
collection: createCollection({
|
|
651
655
|
applyPatch: applyCartPatch,
|
|
@@ -661,9 +665,9 @@ function getOrCreateStore(params) {
|
|
|
661
665
|
syncTail: Promise.resolve(),
|
|
662
666
|
failedOpRemovers: /* @__PURE__ */ new Set()
|
|
663
667
|
};
|
|
664
|
-
return client.events.on(
|
|
668
|
+
return client.events.on(chunk6QANXRUM_js.SESSION_CLAIMED, () => {
|
|
665
669
|
entry.initialized && syncFromServer(entry);
|
|
666
|
-
}), client.events.on(
|
|
670
|
+
}), client.events.on(chunk6QANXRUM_js.SESSION_CLEARED, () => {
|
|
667
671
|
entry.initialized && syncFromServer(entry);
|
|
668
672
|
}), cartStores.set(storeKey, entry), entry;
|
|
669
673
|
}
|
|
@@ -790,7 +794,7 @@ function useCart(options = {}) {
|
|
|
790
794
|
let context = useOptionalCimplify(), client = options.client ?? context?.client;
|
|
791
795
|
if (!client)
|
|
792
796
|
throw new Error("useCart must be used within CimplifyProvider or passed { client }.");
|
|
793
|
-
let locationId = options.locationId ?? (context?.client === client ? context.currentLocation?.id ?? (context.isReady ? null : client.getLocationId()) : client.getLocationId()), currency = options.currency ?? context?.currency ??
|
|
797
|
+
let locationId = options.locationId ?? (context?.client === client ? context.currentLocation?.id ?? (context.isReady ? null : client.getLocationId()) : client.getLocationId()), currency = options.currency ?? context?.currency ?? null, optimisticEnabled = context?.optimistic ?? true, entry = React14.useMemo(
|
|
794
798
|
() => getOrCreateStore({
|
|
795
799
|
client,
|
|
796
800
|
locationId,
|
|
@@ -889,10 +893,10 @@ function preconnectOrigin(url, crossOrigin) {
|
|
|
889
893
|
let link = document.createElement("link");
|
|
890
894
|
link.rel = "preconnect", link.href = origin, crossOrigin && (link.crossOrigin = crossOrigin), document.head.appendChild(link);
|
|
891
895
|
}
|
|
892
|
-
var LOCATION_STORAGE_KEY = "cimplify_location_id", DISPLAY_CURRENCY_STORAGE_KEY = "cimplify_display_currency", FX_REFRESH_INTERVAL = 12e4,
|
|
896
|
+
var LOCATION_STORAGE_KEY = "cimplify_location_id", DISPLAY_CURRENCY_STORAGE_KEY = "cimplify_display_currency", FX_REFRESH_INTERVAL = 12e4, DEFAULT_COUNTRY = "US";
|
|
893
897
|
function createDefaultClient() {
|
|
894
898
|
let envPublicKey = globalThis.process?.env?.NEXT_PUBLIC_CIMPLIFY_PUBLIC_KEY || "";
|
|
895
|
-
return
|
|
899
|
+
return chunkETZDIISN_js.createCimplifyClient({ publicKey: envPublicKey });
|
|
896
900
|
}
|
|
897
901
|
function getStoredLocationId() {
|
|
898
902
|
if (typeof window > "u" || !window.localStorage)
|
|
@@ -919,7 +923,7 @@ function getStoredDisplayCurrency() {
|
|
|
919
923
|
if (!value)
|
|
920
924
|
return null;
|
|
921
925
|
let normalized = value.trim().toUpperCase();
|
|
922
|
-
return normalized
|
|
926
|
+
return chunkNFXCKTE2_js.isSupportedCurrency(normalized) ? normalized : null;
|
|
923
927
|
}
|
|
924
928
|
function setStoredDisplayCurrency(currency) {
|
|
925
929
|
if (!(typeof window > "u" || !window.localStorage)) {
|
|
@@ -969,26 +973,23 @@ function CimplifyProvider({
|
|
|
969
973
|
React14.useEffect(() => {
|
|
970
974
|
onLocationChangeRef.current = onLocationChange;
|
|
971
975
|
}, [onLocationChange]);
|
|
972
|
-
let baseCurrency = business?.default_currency ||
|
|
976
|
+
let baseCurrency = business?.default_currency || null, [displayCurrencyOverride, setDisplayCurrencyOverride] = React14.useState(
|
|
973
977
|
() => getStoredDisplayCurrency()
|
|
974
|
-
), [fxRate, setFxRate] = React14.useState(null), displayCurrency =
|
|
978
|
+
), [fxRate, setFxRate] = React14.useState(null), displayCurrency = baseCurrency !== null && displayCurrencyOverride !== null ? displayCurrencyOverride : baseCurrency, setDisplayCurrency = React14.useCallback(
|
|
975
979
|
(currency) => {
|
|
976
980
|
let normalized = currency?.trim().toUpperCase() || null;
|
|
977
|
-
normalized && !
|
|
981
|
+
normalized !== null && !chunkNFXCKTE2_js.isSupportedCurrency(normalized) || (setDisplayCurrencyOverride(normalized), setStoredDisplayCurrency(normalized), (!normalized || normalized === baseCurrency) && setFxRate(null));
|
|
978
982
|
},
|
|
979
983
|
[baseCurrency]
|
|
980
984
|
);
|
|
981
985
|
React14.useEffect(() => {
|
|
982
|
-
if (displayCurrency === baseCurrency) {
|
|
986
|
+
if (baseCurrency === null || displayCurrency === null || displayCurrency === baseCurrency) {
|
|
983
987
|
setFxRate(null);
|
|
984
988
|
return;
|
|
985
989
|
}
|
|
986
|
-
let cancelled = false;
|
|
990
|
+
let fromCurrency = baseCurrency, toCurrency = displayCurrency, cancelled = false;
|
|
987
991
|
async function fetchRate() {
|
|
988
|
-
let result = await resolvedClient.fx.getRate(
|
|
989
|
-
baseCurrency,
|
|
990
|
-
displayCurrency
|
|
991
|
-
);
|
|
992
|
+
let result = await resolvedClient.fx.getRate(fromCurrency, toCurrency);
|
|
992
993
|
cancelled || (result.ok ? setFxRate(Number(result.value.rate)) : setFxRate(null));
|
|
993
994
|
}
|
|
994
995
|
fetchRate();
|
|
@@ -1001,8 +1002,8 @@ function CimplifyProvider({
|
|
|
1001
1002
|
}, [resolvedClient, baseCurrency, displayCurrency]);
|
|
1002
1003
|
let convertPrice = React14.useCallback(
|
|
1003
1004
|
(amount) => {
|
|
1004
|
-
let
|
|
1005
|
-
return
|
|
1005
|
+
let value = chunkQOCHWR4V_js.parsePrice(amount);
|
|
1006
|
+
return !fxRate || displayCurrency === null || displayCurrency === baseCurrency ? value : chunkQOCHWR4V_js.roundToCurrencyDigits(value * fxRate, displayCurrency);
|
|
1006
1007
|
},
|
|
1007
1008
|
[fxRate, displayCurrency, baseCurrency]
|
|
1008
1009
|
);
|
|
@@ -1083,10 +1084,7 @@ function useCimplify() {
|
|
|
1083
1084
|
let clientContext = React14.useContext(CimplifyClientContext), stateContext = React14.useContext(CimplifyStateContext);
|
|
1084
1085
|
if (!clientContext || !stateContext)
|
|
1085
1086
|
throw new Error("useCimplify must be used within CimplifyProvider");
|
|
1086
|
-
return React14.useMemo(
|
|
1087
|
-
() => ({ ...clientContext, ...stateContext }),
|
|
1088
|
-
[clientContext, stateContext]
|
|
1089
|
-
);
|
|
1087
|
+
return React14.useMemo(() => ({ ...clientContext, ...stateContext }), [clientContext, stateContext]);
|
|
1090
1088
|
}
|
|
1091
1089
|
function useOptionalCimplify() {
|
|
1092
1090
|
let clientContext = React14.useContext(CimplifyClientContext), stateContext = React14.useContext(CimplifyStateContext);
|
|
@@ -1133,9 +1131,11 @@ function CimplifyCheckout({
|
|
|
1133
1131
|
() => orderTypes && orderTypes.length > 0 ? orderTypes : [chunkGTJWQAGU_js.ORDER_TYPE.PICKUP, chunkGTJWQAGU_js.ORDER_TYPE.DELIVERY],
|
|
1134
1132
|
[orderTypes]
|
|
1135
1133
|
), resolvedDefaultOrderType = React14.useMemo(() => defaultOrderType && resolvedOrderTypes.includes(defaultOrderType) ? defaultOrderType : resolvedOrderTypes[0] || chunkGTJWQAGU_js.ORDER_TYPE.PICKUP, [defaultOrderType, resolvedOrderTypes]), [orderType, setOrderType] = React14.useState(resolvedDefaultOrderType), [status, setStatus] = React14.useState(null), [statusText, setStatusText] = React14.useState(""), [isSubmitting, setIsSubmitting] = React14.useState(false), [isInitializing, setIsInitializing] = React14.useState(false), [errorMessage, setErrorMessage] = React14.useState(null), [resolvedBusinessId, setResolvedBusinessId] = React14.useState(businessId ?? null), [resolvedCartId, setResolvedCartId] = React14.useState(cartId ?? null), [resolvedCart, setResolvedCart] = React14.useState(null), checkoutMountRef = React14.useRef(null), elementsRef = React14.useRef(null), activeCheckoutRef = React14.useRef(null), initialAppearanceRef = React14.useRef(appearance), hasWarnedInlineAppearanceRef = React14.useRef(false), isMountedRef = React14.useRef(true), isTestMode = client.isTestMode(), cimplifyCtx = useOptionalCimplify(), fxOptions = React14.useMemo(() => {
|
|
1136
|
-
if (cimplifyCtx?.fxRate
|
|
1134
|
+
if (!cimplifyCtx?.fxRate) return;
|
|
1135
|
+
let displayCurrency = cimplifyCtx.displayCurrency;
|
|
1136
|
+
if (!(displayCurrency === null || displayCurrency === cimplifyCtx.baseCurrency))
|
|
1137
1137
|
return {
|
|
1138
|
-
displayCurrency
|
|
1138
|
+
displayCurrency,
|
|
1139
1139
|
convertPrice: cimplifyCtx.convertPrice
|
|
1140
1140
|
};
|
|
1141
1141
|
}, [
|
|
@@ -1158,7 +1158,7 @@ function CimplifyCheckout({
|
|
|
1158
1158
|
onComplete(result);
|
|
1159
1159
|
return;
|
|
1160
1160
|
}
|
|
1161
|
-
let code = result.error?.code ||
|
|
1161
|
+
let code = result.error?.code || chunkNFXCKTE2_js.ErrorCode.CHECKOUT_FAILED, message = result.error?.message || "Payment failed.";
|
|
1162
1162
|
setErrorMessage(message), fireError({ code, message });
|
|
1163
1163
|
});
|
|
1164
1164
|
React14.useEffect(() => {
|
|
@@ -1185,7 +1185,7 @@ function CimplifyCheckout({
|
|
|
1185
1185
|
} catch {
|
|
1186
1186
|
if (!cancelled) {
|
|
1187
1187
|
let message = "Unable to initialize checkout business context.";
|
|
1188
|
-
setResolvedBusinessId(null), setResolvedCartId(null), setErrorMessage(message), setIsInitializing(false), fireError({ code:
|
|
1188
|
+
setResolvedBusinessId(null), setResolvedCartId(null), setErrorMessage(message), setIsInitializing(false), fireError({ code: chunkNFXCKTE2_js.ErrorCode.BUSINESS_ID_REQUIRED, message });
|
|
1189
1189
|
}
|
|
1190
1190
|
return;
|
|
1191
1191
|
}
|
|
@@ -1195,7 +1195,7 @@ function CimplifyCheckout({
|
|
|
1195
1195
|
if (!cartResult.ok || !cartResult.value?.id || cartResult.value.items.length === 0) {
|
|
1196
1196
|
if (!cancelled) {
|
|
1197
1197
|
let message = "Your cart is empty. Add items before checkout.";
|
|
1198
|
-
setResolvedBusinessId(nextBusinessId), setResolvedCartId(null), setErrorMessage(message), setIsInitializing(false), fireError({ code:
|
|
1198
|
+
setResolvedBusinessId(nextBusinessId), setResolvedCartId(null), setErrorMessage(message), setIsInitializing(false), fireError({ code: chunkNFXCKTE2_js.ErrorCode.CART_EMPTY, message });
|
|
1199
1199
|
}
|
|
1200
1200
|
return;
|
|
1201
1201
|
}
|
|
@@ -1213,7 +1213,7 @@ function CimplifyCheckout({
|
|
|
1213
1213
|
if (isSubmitting || isInitializing || !resolvedCartId && !intentId) {
|
|
1214
1214
|
if (!resolvedCartId && !intentId && !isInitializing) {
|
|
1215
1215
|
let message = "A cart or purchase intent is required before checkout.";
|
|
1216
|
-
setErrorMessage(message), fireError({ code:
|
|
1216
|
+
setErrorMessage(message), fireError({ code: chunkNFXCKTE2_js.ErrorCode.CHECKOUT_AUTHORITY_REQUIRED, message });
|
|
1217
1217
|
}
|
|
1218
1218
|
return;
|
|
1219
1219
|
}
|
|
@@ -1221,7 +1221,7 @@ function CimplifyCheckout({
|
|
|
1221
1221
|
display_text: statusToLabel(chunkGTJWQAGU_js.CHECKOUT_STATUS.PREPARING)
|
|
1222
1222
|
}), !elementsRef.current) {
|
|
1223
1223
|
let message = "Checkout is still initializing. Please try again.";
|
|
1224
|
-
setErrorMessage(message), fireError({ code:
|
|
1224
|
+
setErrorMessage(message), fireError({ code: chunkNFXCKTE2_js.ErrorCode.CHECKOUT_NOT_READY, message }), setIsSubmitting(false);
|
|
1225
1225
|
return;
|
|
1226
1226
|
}
|
|
1227
1227
|
let checkout = elementsRef.current.processCheckout({
|
|
@@ -1242,7 +1242,7 @@ function CimplifyCheckout({
|
|
|
1242
1242
|
onComplete(result);
|
|
1243
1243
|
return;
|
|
1244
1244
|
}
|
|
1245
|
-
let code = result.error?.code ||
|
|
1245
|
+
let code = result.error?.code || chunkNFXCKTE2_js.ErrorCode.CHECKOUT_FAILED, message = result.error?.message || "Payment failed.";
|
|
1246
1246
|
setErrorMessage(message), fireError({ code, message });
|
|
1247
1247
|
} finally {
|
|
1248
1248
|
isMountedRef.current && (activeCheckoutRef.current = null, setIsSubmitting(false));
|
|
@@ -1258,7 +1258,7 @@ function CimplifyCheckout({
|
|
|
1258
1258
|
linkUrl
|
|
1259
1259
|
});
|
|
1260
1260
|
elementsRef.current = elements2;
|
|
1261
|
-
let checkout = elements2.create(
|
|
1261
|
+
let checkout = elements2.create(chunk6QANXRUM_js.ELEMENT_TYPES.CHECKOUT, {
|
|
1262
1262
|
orderTypes: resolvedOrderTypes,
|
|
1263
1263
|
defaultOrderType: resolvedDefaultOrderType,
|
|
1264
1264
|
submitLabel,
|
|
@@ -1267,16 +1267,16 @@ function CimplifyCheckout({
|
|
|
1267
1267
|
initialTerms,
|
|
1268
1268
|
offerSaveDetails: enrollInLink
|
|
1269
1269
|
});
|
|
1270
|
-
return checkoutMountRef.current && checkout.mount(checkoutMountRef.current), checkout.on(
|
|
1270
|
+
return checkoutMountRef.current && checkout.mount(checkoutMountRef.current), checkout.on(chunk6QANXRUM_js.EVENT_TYPES.READY, () => {
|
|
1271
1271
|
let cart = resolvedCartRef.current;
|
|
1272
1272
|
cart && checkout.setCart(chunkZF7JCXCI_js.transformToCheckoutCart(cart, fxOptionsRef.current));
|
|
1273
|
-
}), checkout.on(
|
|
1273
|
+
}), checkout.on(chunk6QANXRUM_js.EVENT_TYPES.ORDER_TYPE_CHANGED, ({ orderType: nextOrderType }) => {
|
|
1274
1274
|
nextOrderType && setOrderType(nextOrderType);
|
|
1275
|
-
}), checkout.on(
|
|
1275
|
+
}), checkout.on(chunk6QANXRUM_js.EVENT_TYPES.CHECKOUT_STATUS, ({ status: nextStatus, context }) => {
|
|
1276
1276
|
emitStatus(nextStatus, context);
|
|
1277
|
-
}), checkout.on(
|
|
1277
|
+
}), checkout.on(chunk6QANXRUM_js.EVENT_TYPES.CHECKOUT_COMPLETE, (result) => {
|
|
1278
1278
|
settleRecoveredCheckout(result);
|
|
1279
|
-
}), checkout.on(
|
|
1279
|
+
}), checkout.on(chunk6QANXRUM_js.EVENT_TYPES.REQUEST_SUBMIT, () => {
|
|
1280
1280
|
handleSubmit();
|
|
1281
1281
|
}), () => {
|
|
1282
1282
|
activeCheckoutRef.current?.abort(), activeCheckoutRef.current = null, elements2.destroy(), elementsRef.current = null;
|
|
@@ -1293,7 +1293,7 @@ function CimplifyCheckout({
|
|
|
1293
1293
|
enrollInLink
|
|
1294
1294
|
]), React14.useEffect(() => {
|
|
1295
1295
|
if (!resolvedCart || !elementsRef.current) return;
|
|
1296
|
-
let checkoutElement = elementsRef.current.getElement(
|
|
1296
|
+
let checkoutElement = elementsRef.current.getElement(chunk6QANXRUM_js.ELEMENT_TYPES.CHECKOUT);
|
|
1297
1297
|
checkoutElement && checkoutElement.setCart(chunkZF7JCXCI_js.transformToCheckoutCart(resolvedCart, fxOptions));
|
|
1298
1298
|
}, [resolvedCart, fxOptions]);
|
|
1299
1299
|
let colors = shellColors(isDark ?? false);
|
|
@@ -2716,17 +2716,17 @@ function toAccountLineItem(item, currency) {
|
|
|
2716
2716
|
quantity: s.quantity,
|
|
2717
2717
|
name: s.product_name,
|
|
2718
2718
|
variantName: s.variant_name,
|
|
2719
|
-
priceLabel:
|
|
2719
|
+
priceLabel: chunkQOCHWR4V_js.parsePrice(s.unit_price) > 0 ? chunkQOCHWR4V_js.formatMoney(s.unit_price, currency) : void 0
|
|
2720
2720
|
})), customisations = item.composite_selections?.selections.map((s) => ({
|
|
2721
2721
|
quantity: s.quantity,
|
|
2722
2722
|
name: s.component_name,
|
|
2723
|
-
priceLabel:
|
|
2723
|
+
priceLabel: chunkQOCHWR4V_js.parsePrice(s.unit_price) > 0 ? `+${chunkQOCHWR4V_js.formatMoney(s.unit_price, currency)}` : void 0
|
|
2724
2724
|
})), data = {
|
|
2725
2725
|
id: item.id,
|
|
2726
2726
|
name: item.product_name ?? "Item",
|
|
2727
2727
|
imageUrl: item.image_url,
|
|
2728
2728
|
subtitle: lineSubtitle(item),
|
|
2729
|
-
priceLabel:
|
|
2729
|
+
priceLabel: chunkQOCHWR4V_js.formatMoney(item.total_price, currency),
|
|
2730
2730
|
lineType: item.line_type,
|
|
2731
2731
|
includes,
|
|
2732
2732
|
customisations,
|
|
@@ -2758,13 +2758,13 @@ var STATUS_TONE2 = {
|
|
|
2758
2758
|
};
|
|
2759
2759
|
function toAccountOrderView(order, opts = {}) {
|
|
2760
2760
|
let currency = order.payment.currency, rows = [
|
|
2761
|
-
{ label: "Subtotal", value:
|
|
2761
|
+
{ label: "Subtotal", value: chunkQOCHWR4V_js.formatMoney(order.pricing.subtotal, currency) }
|
|
2762
2762
|
];
|
|
2763
|
-
|
|
2763
|
+
chunkQOCHWR4V_js.parsePrice(order.pricing.total_discount) > 0 && rows.push({
|
|
2764
2764
|
label: "Discount",
|
|
2765
|
-
value: `\u2212${
|
|
2765
|
+
value: `\u2212${chunkQOCHWR4V_js.formatMoney(order.pricing.total_discount, currency)}`,
|
|
2766
2766
|
tone: "positive"
|
|
2767
|
-
}), order.pricing.tax &&
|
|
2767
|
+
}), order.pricing.tax && chunkQOCHWR4V_js.parsePrice(order.pricing.tax) > 0 && rows.push({ label: "Tax", value: chunkQOCHWR4V_js.formatMoney(order.pricing.tax, currency) }), order.pricing.service_charge && chunkQOCHWR4V_js.parsePrice(order.pricing.service_charge) > 0 && rows.push({ label: "Service", value: chunkQOCHWR4V_js.formatMoney(order.pricing.service_charge, currency) });
|
|
2768
2768
|
let placed = fmtDateTime(order.timestamps.created_at), placedLabel = opts.placedLabel ?? [placed && `Placed ${placed}`, `${order.items.length} item${order.items.length === 1 ? "" : "s"}`].filter(Boolean).join(" \xB7 ");
|
|
2769
2769
|
return {
|
|
2770
2770
|
orderNumber: order.user_friendly_id,
|
|
@@ -2776,7 +2776,7 @@ function toAccountOrderView(order, opts = {}) {
|
|
|
2776
2776
|
stateLabel: cap(order.payment.computed_status ?? order.payment.state),
|
|
2777
2777
|
stateTone: PAYMENT_TONE[order.payment.state] ?? "muted",
|
|
2778
2778
|
rows,
|
|
2779
|
-
total: { label: "Total", value:
|
|
2779
|
+
total: { label: "Total", value: chunkQOCHWR4V_js.formatMoney(order.pricing.total_price, currency) }
|
|
2780
2780
|
},
|
|
2781
2781
|
shipTo: order.customer.delivery_address ? { lines: order.customer.delivery_address } : void 0,
|
|
2782
2782
|
onBack: opts.onBack
|
|
@@ -2930,10 +2930,10 @@ function NextDeliveryCard({
|
|
|
2930
2930
|
);
|
|
2931
2931
|
}
|
|
2932
2932
|
var BASE_CLASSES = "inline-flex items-center justify-center gap-2 font-medium text-sm rounded-md transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed", VARIANT_CLASSES = {
|
|
2933
|
-
primary: "bg-
|
|
2933
|
+
primary: "bg-[#FFE01A] text-[#141413] hover:bg-[#E0A12E] px-4 py-2.5 border border-transparent",
|
|
2934
2934
|
outline: "bg-white text-zinc-900 hover:bg-zinc-50 px-4 py-2.5 border border-zinc-300",
|
|
2935
2935
|
dark: "bg-zinc-900 text-white hover:bg-zinc-800 px-4 py-2.5 border border-zinc-800",
|
|
2936
|
-
text: "bg-transparent text-
|
|
2936
|
+
text: "bg-transparent text-[#7A6300] hover:text-[#8A5508] px-2 py-1"
|
|
2937
2937
|
};
|
|
2938
2938
|
function CimplifySignInButton({
|
|
2939
2939
|
variant = "primary",
|
|
@@ -2951,7 +2951,7 @@ function CimplifySignInButton({
|
|
|
2951
2951
|
{
|
|
2952
2952
|
type: "button",
|
|
2953
2953
|
onClick: async () => {
|
|
2954
|
-
busy || disabled || !signInOpts.clientId || (setBusy(true), await
|
|
2954
|
+
busy || disabled || !signInOpts.clientId || (setBusy(true), await chunk6QANXRUM_js.startSignIn({
|
|
2955
2955
|
...signInOpts,
|
|
2956
2956
|
onSuccess: () => {
|
|
2957
2957
|
setBusy(false), onSuccess?.();
|
|
@@ -2965,10 +2965,21 @@ function CimplifySignInButton({
|
|
|
2965
2965
|
className: cn(BASE_CLASSES, VARIANT_CLASSES[variant], fullWidth && "w-full", className),
|
|
2966
2966
|
"data-cimplify-signin": true,
|
|
2967
2967
|
children: [
|
|
2968
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": "true", className: "inline-flex", style: { width: 16, height: 16 }, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
|
|
2968
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": "true", className: "inline-flex", style: { width: 16, height: 16 }, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2969
|
+
"svg",
|
|
2970
|
+
{
|
|
2971
|
+
viewBox: "0 0 24 24",
|
|
2972
|
+
fill: "none",
|
|
2973
|
+
stroke: "currentColor",
|
|
2974
|
+
strokeWidth: 2.4,
|
|
2975
|
+
strokeLinecap: "round",
|
|
2976
|
+
strokeLinejoin: "round",
|
|
2977
|
+
children: [
|
|
2978
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M10 13.5a4 4 0 0 0 5.6 0l3-3a4 4 0 0 0-5.6-5.6L11.5 6.4" }),
|
|
2979
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M14 10.5a4 4 0 0 0-5.6 0l-3 3a4 4 0 0 0 5.6 5.6l1.5-1.5" })
|
|
2980
|
+
]
|
|
2981
|
+
}
|
|
2982
|
+
) }),
|
|
2972
2983
|
label ?? (busy ? "Signing in\u2026" : "Continue with Cimplify")
|
|
2973
2984
|
]
|
|
2974
2985
|
}
|
|
@@ -3746,10 +3757,12 @@ function Price({
|
|
|
3746
3757
|
prefix,
|
|
3747
3758
|
convert = true
|
|
3748
3759
|
}) {
|
|
3749
|
-
let context = useOptionalCimplify(), sourceCurrency = currency ?? context?.baseCurrency ??
|
|
3750
|
-
|
|
3760
|
+
let context = useOptionalCimplify(), sourceCurrency = currency ?? context?.baseCurrency ?? null;
|
|
3761
|
+
if (sourceCurrency === null) return null;
|
|
3762
|
+
let displayCurrency = context?.displayCurrency ?? null, formatted = convert && context !== null && context.fxRate != null && displayCurrency !== null && displayCurrency !== sourceCurrency && sourceCurrency === context.baseCurrency && context !== null && displayCurrency !== null ? chunkQOCHWR4V_js.formatCurrencyAmount(context.convertPrice(amount), displayCurrency) : chunkQOCHWR4V_js.formatCurrencyAmount(amount, sourceCurrency);
|
|
3763
|
+
return formatted === null ? null : /* @__PURE__ */ jsxRuntime.jsxs("span", { className, children: [
|
|
3751
3764
|
prefix,
|
|
3752
|
-
|
|
3765
|
+
formatted
|
|
3753
3766
|
] });
|
|
3754
3767
|
}
|
|
3755
3768
|
function createCachedQuery(config) {
|
|
@@ -4208,9 +4221,9 @@ function useClientSessionEpoch(client) {
|
|
|
4208
4221
|
let subscribe = React14.useCallback(
|
|
4209
4222
|
(notify) => {
|
|
4210
4223
|
let unsubscribe = [
|
|
4211
|
-
client.events.on(
|
|
4212
|
-
client.events.on(
|
|
4213
|
-
client.events.on(
|
|
4224
|
+
client.events.on(chunk6QANXRUM_js.AUTH_TOKEN_CHANGED, notify),
|
|
4225
|
+
client.events.on(chunk6QANXRUM_js.SESSION_CLAIMED, notify),
|
|
4226
|
+
client.events.on(chunk6QANXRUM_js.SESSION_CLEARED, notify)
|
|
4214
4227
|
];
|
|
4215
4228
|
return () => {
|
|
4216
4229
|
for (let stopListening of unsubscribe)
|
|
@@ -4601,12 +4614,13 @@ function useProductPrice(input) {
|
|
|
4601
4614
|
if (bundleTotalPrice != null)
|
|
4602
4615
|
unitPrice = bundleTotalPrice;
|
|
4603
4616
|
else if (compositePrice)
|
|
4604
|
-
unitPrice =
|
|
4605
|
-
else if (unitPrice =
|
|
4617
|
+
unitPrice = chunkQOCHWR4V_js.parsePrice(compositePrice.final_price);
|
|
4618
|
+
else if (unitPrice = chunkQOCHWR4V_js.getVariantUnitPrice(product, variant), addOnOptions)
|
|
4606
4619
|
for (let option of addOnOptions)
|
|
4607
|
-
option.default_price && (unitPrice +=
|
|
4608
|
-
|
|
4609
|
-
|
|
4620
|
+
option.default_price && (unitPrice += chunkQOCHWR4V_js.parsePrice(option.default_price));
|
|
4621
|
+
let currency = chunkQOCHWR4V_js.getProductCurrency(product);
|
|
4622
|
+
unitPrice = chunkQOCHWR4V_js.roundToCurrencyDigits(unitPrice, currency);
|
|
4623
|
+
let totalPrice = chunkQOCHWR4V_js.roundToCurrencyDigits(unitPrice * quantity, currency);
|
|
4610
4624
|
return {
|
|
4611
4625
|
unitPrice,
|
|
4612
4626
|
totalPrice,
|
|
@@ -5182,7 +5196,7 @@ function useChat(options = {}) {
|
|
|
5182
5196
|
wsReconnectAttemptRef.current = 0, stopPolling();
|
|
5183
5197
|
}, ws.onmessage = (event) => {
|
|
5184
5198
|
try {
|
|
5185
|
-
let envelope = JSON.parse(event.data), update =
|
|
5199
|
+
let envelope = JSON.parse(event.data), update = chunkETZDIISN_js.chatRealtimeUpdateFromWire(envelope);
|
|
5186
5200
|
if (update.kind === "message")
|
|
5187
5201
|
appendMessages([update.message]);
|
|
5188
5202
|
else if (update.kind === "message_updated")
|
|
@@ -5241,13 +5255,13 @@ function useChat(options = {}) {
|
|
|
5241
5255
|
}, [hydrateConversation]), watchSessionClaims = React14.useCallback(() => {
|
|
5242
5256
|
let c = clientRef.current;
|
|
5243
5257
|
if (!c || claimUnsubRef.current) return;
|
|
5244
|
-
let unsubClaimed = c.events.on(
|
|
5258
|
+
let unsubClaimed = c.events.on(chunk6QANXRUM_js.SESSION_CLAIMED, (event) => {
|
|
5245
5259
|
if (setClaimedAs(event.customerName || c.session.claimedCustomerName || null), !openedRef.current) {
|
|
5246
5260
|
openIfExisting();
|
|
5247
5261
|
return;
|
|
5248
5262
|
}
|
|
5249
5263
|
connectWebSocket(), resyncConversation();
|
|
5250
|
-
}), unsubCleared = c.events.on(
|
|
5264
|
+
}), unsubCleared = c.events.on(chunk6QANXRUM_js.SESSION_CLEARED, resetConversation);
|
|
5251
5265
|
claimUnsubRef.current = () => {
|
|
5252
5266
|
unsubClaimed(), unsubCleared();
|
|
5253
5267
|
};
|
|
@@ -5268,7 +5282,7 @@ function useChat(options = {}) {
|
|
|
5268
5282
|
let attachments = opts?.attachments ?? [];
|
|
5269
5283
|
if (!client || !content.trim() && attachments.length === 0 || (setError(null), lastActivityRef.current = Date.now(), !openedRef.current && (await openConversation(), !openedRef.current)))
|
|
5270
5284
|
return false;
|
|
5271
|
-
let replyTo = opts?.replyTo, clientId =
|
|
5285
|
+
let replyTo = opts?.replyTo, clientId = chunk6QANXRUM_js.generateIdempotencyKey(), localId = optimisticId(clientId), optimistic = {
|
|
5272
5286
|
id: localId,
|
|
5273
5287
|
sender_type: "customer",
|
|
5274
5288
|
content: content.trim(),
|
|
@@ -5411,12 +5425,12 @@ function AuthElement({
|
|
|
5411
5425
|
onReadyRef.current = onReady, onAuthenticatedRef.current = onAuthenticated, onErrorRef.current = onError;
|
|
5412
5426
|
}, [onReady, onAuthenticated, onError]), React14.useEffect(() => {
|
|
5413
5427
|
if (!elements2 || !containerRef.current) return;
|
|
5414
|
-
let element = elements2.create(
|
|
5415
|
-
return elementRef.current = element, element.on(
|
|
5416
|
-
|
|
5428
|
+
let element = elements2.create(chunk6QANXRUM_js.ELEMENT_TYPES.AUTH, { prefillEmail });
|
|
5429
|
+
return elementRef.current = element, element.on(chunk6QANXRUM_js.EVENT_TYPES.READY, () => onReadyRef.current?.()), element.on(
|
|
5430
|
+
chunk6QANXRUM_js.EVENT_TYPES.AUTHENTICATED,
|
|
5417
5431
|
(data) => onAuthenticatedRef.current?.(data)
|
|
5418
5432
|
), element.on(
|
|
5419
|
-
|
|
5433
|
+
chunk6QANXRUM_js.EVENT_TYPES.ERROR,
|
|
5420
5434
|
(data) => onErrorRef.current?.(data)
|
|
5421
5435
|
), element.mount(containerRef.current), () => element.destroy();
|
|
5422
5436
|
}, [elements2, prefillEmail]), /* @__PURE__ */ jsxRuntime.jsx("div", { ref: containerRef, className, style });
|
|
@@ -5434,12 +5448,12 @@ function AddressElement({
|
|
|
5434
5448
|
onReadyRef.current = onReady, onChangeRef.current = onChange, onErrorRef.current = onError;
|
|
5435
5449
|
}, [onReady, onChange, onError]), React14.useEffect(() => {
|
|
5436
5450
|
if (!elements2 || !containerRef.current) return;
|
|
5437
|
-
let element = elements2.create(
|
|
5438
|
-
return elementRef.current = element, element.on(
|
|
5439
|
-
|
|
5451
|
+
let element = elements2.create(chunk6QANXRUM_js.ELEMENT_TYPES.ADDRESS, { mode });
|
|
5452
|
+
return elementRef.current = element, element.on(chunk6QANXRUM_js.EVENT_TYPES.READY, () => onReadyRef.current?.()), element.on(
|
|
5453
|
+
chunk6QANXRUM_js.EVENT_TYPES.CHANGE,
|
|
5440
5454
|
(data) => onChangeRef.current?.(data)
|
|
5441
5455
|
), element.on(
|
|
5442
|
-
|
|
5456
|
+
chunk6QANXRUM_js.EVENT_TYPES.ERROR,
|
|
5443
5457
|
(data) => onErrorRef.current?.(data)
|
|
5444
5458
|
), element.mount(containerRef.current), () => element.destroy();
|
|
5445
5459
|
}, [elements2, mode]), /* @__PURE__ */ jsxRuntime.jsx("div", { ref: containerRef, className, style });
|
|
@@ -5458,12 +5472,12 @@ function PaymentElement({
|
|
|
5458
5472
|
onReadyRef.current = onReady, onChangeRef.current = onChange, onErrorRef.current = onError;
|
|
5459
5473
|
}, [onReady, onChange, onError]), React14.useEffect(() => {
|
|
5460
5474
|
if (!elements2 || !containerRef.current) return;
|
|
5461
|
-
let element = elements2.create(
|
|
5462
|
-
return elementRef.current = element, element.on(
|
|
5463
|
-
|
|
5475
|
+
let element = elements2.create(chunk6QANXRUM_js.ELEMENT_TYPES.PAYMENT, { amount, currency });
|
|
5476
|
+
return elementRef.current = element, element.on(chunk6QANXRUM_js.EVENT_TYPES.READY, () => onReadyRef.current?.()), element.on(
|
|
5477
|
+
chunk6QANXRUM_js.EVENT_TYPES.CHANGE,
|
|
5464
5478
|
(data) => onChangeRef.current?.(data)
|
|
5465
5479
|
), element.on(
|
|
5466
|
-
|
|
5480
|
+
chunk6QANXRUM_js.EVENT_TYPES.ERROR,
|
|
5467
5481
|
(data) => onErrorRef.current?.(data)
|
|
5468
5482
|
), element.mount(containerRef.current), () => element.destroy();
|
|
5469
5483
|
}, [elements2, amount, currency]), /* @__PURE__ */ jsxRuntime.jsx("div", { ref: containerRef, className, style });
|
|
@@ -5593,7 +5607,7 @@ function VariantSelector({
|
|
|
5593
5607
|
match && match.id !== selectedVariantId && onVariantChange(match.id, match);
|
|
5594
5608
|
}, [axisSelections, variants, variantAxes, selectedVariantId, onVariantChange]), !variants || variants.length <= 1)
|
|
5595
5609
|
return null;
|
|
5596
|
-
basePrice != null ?
|
|
5610
|
+
basePrice != null ? chunkQOCHWR4V_js.parsePrice(basePrice) : 0;
|
|
5597
5611
|
if (variantAxes && variantAxes.length > 0)
|
|
5598
5612
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-cimplify-variant-selector": true, className: cn("space-y-5", className, classNames?.root), children: variantAxes.map((axis) => {
|
|
5599
5613
|
let labelId = `${idPrefix}-axis-${axis.id}`;
|
|
@@ -5697,7 +5711,7 @@ function VariantSelector({
|
|
|
5697
5711
|
"data-cimplify-variant-list": true,
|
|
5698
5712
|
className: cn("divide-y divide-border", classNames?.list),
|
|
5699
5713
|
children: variants.map((variant) => {
|
|
5700
|
-
let isSelected = selectedVariantId === variant.id, adjustment =
|
|
5714
|
+
let isSelected = selectedVariantId === variant.id, adjustment = chunkQOCHWR4V_js.parsePrice(variant.price_adjustment);
|
|
5701
5715
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5702
5716
|
radio.Radio.Root,
|
|
5703
5717
|
{
|
|
@@ -5936,9 +5950,9 @@ function BundleSelector({
|
|
|
5936
5950
|
}, [components, selections, onReady]);
|
|
5937
5951
|
let totalPrice = React14.useMemo(() => {
|
|
5938
5952
|
if (pricingType === "fixed" && bundlePrice)
|
|
5939
|
-
return
|
|
5953
|
+
return chunkQOCHWR4V_js.parsePrice(bundlePrice);
|
|
5940
5954
|
let componentsTotal = components.reduce((sum, comp) => sum + getComponentPrice(comp, variantChoices[comp.id]) * comp.quantity, 0);
|
|
5941
|
-
return pricingType === "percentage_discount" && discountValue ? componentsTotal * (1 -
|
|
5955
|
+
return pricingType === "percentage_discount" && discountValue ? componentsTotal * (1 - chunkQOCHWR4V_js.parsePrice(discountValue) / 100) : pricingType === "fixed_discount" && discountValue ? componentsTotal - chunkQOCHWR4V_js.parsePrice(discountValue) : componentsTotal;
|
|
5942
5956
|
}, [components, variantChoices, pricingType, bundlePrice, discountValue]);
|
|
5943
5957
|
React14.useEffect(() => {
|
|
5944
5958
|
onPriceChange?.(totalPrice);
|
|
@@ -5995,11 +6009,11 @@ function BundleSelector({
|
|
|
5995
6009
|
}
|
|
5996
6010
|
function getComponentPrice(component, selectedVariantId) {
|
|
5997
6011
|
if (!selectedVariantId || component.available_variants.length === 0)
|
|
5998
|
-
return
|
|
6012
|
+
return chunkQOCHWR4V_js.parsePrice(component.effective_price);
|
|
5999
6013
|
if (selectedVariantId === component.variant_id)
|
|
6000
|
-
return
|
|
6014
|
+
return chunkQOCHWR4V_js.parsePrice(component.effective_price);
|
|
6001
6015
|
let bakedAdj = component.variant_id ? component.available_variants.find((v) => v.id === component.variant_id) : void 0, selectedAdj = component.available_variants.find((v) => v.id === selectedVariantId);
|
|
6002
|
-
return selectedAdj ?
|
|
6016
|
+
return selectedAdj ? chunkQOCHWR4V_js.parsePrice(component.effective_price) - chunkQOCHWR4V_js.parsePrice(bakedAdj?.price_adjustment ?? "0") + chunkQOCHWR4V_js.parsePrice(selectedAdj.price_adjustment) : chunkQOCHWR4V_js.parsePrice(component.effective_price);
|
|
6003
6017
|
}
|
|
6004
6018
|
function formatDuration(minutes, unit) {
|
|
6005
6019
|
return unit === "hours" || !unit && minutes >= 60 && minutes % 60 === 0 ? `${Math.round(minutes / 60)}h` : unit === "days" || unit === "nights" ? `${Math.round(minutes / 1440)}${unit === "nights" ? "n" : "d"}` : `${minutes}min`;
|
|
@@ -6101,7 +6115,7 @@ function BundleComponentCard({
|
|
|
6101
6115
|
"data-cimplify-bundle-variant-picker": true,
|
|
6102
6116
|
className: cn("mt-3 divide-y divide-border", classNames?.variantPicker),
|
|
6103
6117
|
children: component.available_variants.map((variant) => {
|
|
6104
|
-
let isSelected = selectedVariantId === variant.id, adjustment =
|
|
6118
|
+
let isSelected = selectedVariantId === variant.id, adjustment = chunkQOCHWR4V_js.parsePrice(variant.price_adjustment);
|
|
6105
6119
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6106
6120
|
radio.Radio.Root,
|
|
6107
6121
|
{
|
|
@@ -6494,7 +6508,7 @@ function CompositeSelector({
|
|
|
6494
6508
|
"data-cimplify-composite-summary": true,
|
|
6495
6509
|
className: cn("border-t border-border pt-4 space-y-1 text-sm", classNames?.summary),
|
|
6496
6510
|
children: [
|
|
6497
|
-
|
|
6511
|
+
chunkQOCHWR4V_js.parsePrice(priceResult.base_price) !== 0 && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6498
6512
|
"div",
|
|
6499
6513
|
{
|
|
6500
6514
|
"data-cimplify-composite-summary-line": true,
|
|
@@ -6505,7 +6519,7 @@ function CompositeSelector({
|
|
|
6505
6519
|
]
|
|
6506
6520
|
}
|
|
6507
6521
|
),
|
|
6508
|
-
|
|
6522
|
+
chunkQOCHWR4V_js.parsePrice(priceResult.components_total) !== 0 && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6509
6523
|
"div",
|
|
6510
6524
|
{
|
|
6511
6525
|
"data-cimplify-composite-summary-line": true,
|
|
@@ -6645,7 +6659,7 @@ function BookingSummary({
|
|
|
6645
6659
|
className,
|
|
6646
6660
|
classNames
|
|
6647
6661
|
}) {
|
|
6648
|
-
let depositValue = depositAmount != null ?
|
|
6662
|
+
let depositValue = depositAmount != null ? chunkQOCHWR4V_js.parsePrice(depositAmount) : 0, depositDue = depositType === "percentage" ? total * depositValue / 100 : depositType === "fixed" ? depositValue : 0, hasDeposit = depositDue > 0, balance = Math.max(0, total - depositDue), rowClass = cn("flex items-center justify-between", classNames?.row), labelClass = cn("text-muted-foreground", classNames?.label), valueClass = cn("font-medium", classNames?.value);
|
|
6649
6663
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6650
6664
|
"div",
|
|
6651
6665
|
{
|
|
@@ -7277,7 +7291,7 @@ function InputField({
|
|
|
7277
7291
|
currency,
|
|
7278
7292
|
classNames
|
|
7279
7293
|
}) {
|
|
7280
|
-
let hasPriceAdjustment = field.price_adjustment != null &&
|
|
7294
|
+
let hasPriceAdjustment = field.price_adjustment != null && chunkQOCHWR4V_js.parsePrice(field.price_adjustment) > 0;
|
|
7281
7295
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-customer-input": true, "data-field-type": field.field_type, className: classNames?.field, children: [
|
|
7282
7296
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 mb-1.5", children: [
|
|
7283
7297
|
/* @__PURE__ */ jsxRuntime.jsx("label", { className: cn("text-sm font-semibold", classNames?.label), children: field.name }),
|
|
@@ -8279,12 +8293,12 @@ function ProductCustomizerContent({
|
|
|
8279
8293
|
new Set(selectedAddOnOptionIds.map((id) => id.trim()).filter(Boolean))
|
|
8280
8294
|
).sort(), [selectedAddOnOptionIds]), localTotalPrice = React14.useMemo(() => {
|
|
8281
8295
|
if (isComposite && compositePrice)
|
|
8282
|
-
return
|
|
8296
|
+
return chunkQOCHWR4V_js.parsePrice(compositePrice.final_price) * quantity;
|
|
8283
8297
|
if (isBundle && bundleTotalPrice != null)
|
|
8284
8298
|
return bundleTotalPrice * quantity;
|
|
8285
|
-
let price =
|
|
8299
|
+
let price = chunkQOCHWR4V_js.getVariantUnitPrice(product, selectedVariant);
|
|
8286
8300
|
for (let option of selectedAddOnOptions)
|
|
8287
|
-
option.default_price && (price +=
|
|
8301
|
+
option.default_price && (price += chunkQOCHWR4V_js.parsePrice(option.default_price));
|
|
8288
8302
|
return price * quantity;
|
|
8289
8303
|
}, [
|
|
8290
8304
|
product.default_price,
|
|
@@ -8336,9 +8350,9 @@ function ProductCustomizerContent({
|
|
|
8336
8350
|
isExpired: isQuoteExpired2
|
|
8337
8351
|
} = useQuote(quoteInput, {
|
|
8338
8352
|
enabled: quoteEnabled
|
|
8339
|
-
}), currency = quote?.currency ??
|
|
8353
|
+
}), quotedPriceInfo = quote?.quoted_total_price_info ?? quote?.final_price_info, currency = quote?.currency ?? quotedPriceInfo?.currency ?? chunkQOCHWR4V_js.getProductCurrency(product), quoteId = quote?.quote_id, quotedUnitPrice = quotedPriceInfo?.final_price, quotedTotalPrice = React14.useMemo(() => {
|
|
8340
8354
|
if (quotedUnitPrice != null)
|
|
8341
|
-
return
|
|
8355
|
+
return chunkQOCHWR4V_js.parsePrice(quotedUnitPrice) * quantity;
|
|
8342
8356
|
}, [quotedUnitPrice, quantity]), quoteIsReady = quoteEnabled && quote !== null && !isQuoteLoading && !quoteError && !isQuoteExpired2, validationMessage = quoteEnabled ? quoteError ? QUOTE_UNAVAILABLE_MESSAGE : quoteIsReady ? null : QUOTE_LOADING_MESSAGE : REQUIRED_OPTIONS_MESSAGE, displayTotalPrice = React14.useMemo(() => {
|
|
8343
8357
|
let total = quotedTotalPrice ?? localTotalPrice, multiplier = chunkZF7JCXCI_js.serviceBillingMultiplier(product, {
|
|
8344
8358
|
quantity,
|
|
@@ -8544,7 +8558,7 @@ function ProductCustomizerContent({
|
|
|
8544
8558
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.deposit_amount, currency })
|
|
8545
8559
|
] }) : /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
|
|
8546
8560
|
"Deposit required: ",
|
|
8547
|
-
|
|
8561
|
+
chunkQOCHWR4V_js.parsePrice(product.deposit_amount),
|
|
8548
8562
|
"%"
|
|
8549
8563
|
] })
|
|
8550
8564
|
}
|
|
@@ -8652,10 +8666,10 @@ function ProductCustomizerContent({
|
|
|
8652
8666
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8653
8667
|
Price,
|
|
8654
8668
|
{
|
|
8655
|
-
amount:
|
|
8669
|
+
amount: chunkQOCHWR4V_js.getUnitPriceAtQuantity(
|
|
8656
8670
|
product.quantity_pricing,
|
|
8657
8671
|
quantity,
|
|
8658
|
-
|
|
8672
|
+
chunkQOCHWR4V_js.parsePrice(product.default_price)
|
|
8659
8673
|
),
|
|
8660
8674
|
currency,
|
|
8661
8675
|
className: "font-medium text-foreground"
|
|
@@ -9076,7 +9090,7 @@ function CartLineItemRow({
|
|
|
9076
9090
|
product: item.product,
|
|
9077
9091
|
variant: item.variant,
|
|
9078
9092
|
addOnOptions: item.addOnOptions
|
|
9079
|
-
}), pinnedUnitPrice = item._quotedUnitPrice, unitPrice = pinnedUnitPrice === void 0 ? locallyResolvedUnitPrice :
|
|
9093
|
+
}), pinnedUnitPrice = item._quotedUnitPrice, unitPrice = pinnedUnitPrice === void 0 ? locallyResolvedUnitPrice : chunkQOCHWR4V_js.parsePrice(pinnedUnitPrice), hasComposite = item.compositeSelections && item.compositeSelections.length > 0, hasBundle = item.bundleSelections && item.bundleSelections.length > 0, isOptimistic2 = item.isOptimistic === true, lineTotal = chunkQOCHWR4V_js.parsePrice(unitPrice) * item.quantity, imageUrl = item.product.image_url, variantLabel2 = item.variant ? chunkZF7JCXCI_js.getVariantDisplayName(item.variant, item.product.name) : null;
|
|
9080
9094
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
9081
9095
|
"div",
|
|
9082
9096
|
{
|
|
@@ -9361,7 +9375,7 @@ function CartSummary({
|
|
|
9361
9375
|
currency,
|
|
9362
9376
|
removeItem,
|
|
9363
9377
|
updateQuantity
|
|
9364
|
-
} = useCart(), displayCurrency = serverCart?.currency ??
|
|
9378
|
+
} = useCart(), displayCurrency = serverCart?.currency ?? (currency === null ? null : chunkNFXCKTE2_js.currencyCode(currency)), deliveryFee = serverCart?.delivery_fee, serviceCharge = serverCart?.service_charge, totalDiscounts = serverCart?.total_discounts, handleRemove = (itemId) => {
|
|
9365
9379
|
onItemRemove ? onItemRemove(itemId) : removeItem(itemId);
|
|
9366
9380
|
}, handleQuantityChange = (itemId, qty) => {
|
|
9367
9381
|
onQuantityChange ? onQuantityChange(itemId, qty) : updateQuantity(itemId, qty);
|
|
@@ -9411,7 +9425,7 @@ function CartSummary({
|
|
|
9411
9425
|
]
|
|
9412
9426
|
}
|
|
9413
9427
|
),
|
|
9414
|
-
totalDiscounts != null &&
|
|
9428
|
+
totalDiscounts != null && chunkQOCHWR4V_js.parsePrice(totalDiscounts) > 0 && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
9415
9429
|
"div",
|
|
9416
9430
|
{
|
|
9417
9431
|
"data-cimplify-cart-discount": true,
|
|
@@ -9437,7 +9451,7 @@ function CartSummary({
|
|
|
9437
9451
|
className: cn("flex items-baseline justify-between", classNames?.deliveryFee),
|
|
9438
9452
|
children: [
|
|
9439
9453
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "Delivery" }),
|
|
9440
|
-
|
|
9454
|
+
chunkQOCHWR4V_js.parsePrice(deliveryFee) > 0 ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
9441
9455
|
Price,
|
|
9442
9456
|
{
|
|
9443
9457
|
amount: deliveryFee,
|
|
@@ -9448,7 +9462,7 @@ function CartSummary({
|
|
|
9448
9462
|
]
|
|
9449
9463
|
}
|
|
9450
9464
|
),
|
|
9451
|
-
serviceCharge != null &&
|
|
9465
|
+
serviceCharge != null && chunkQOCHWR4V_js.parsePrice(serviceCharge) > 0 && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
9452
9466
|
"div",
|
|
9453
9467
|
{
|
|
9454
9468
|
"data-cimplify-cart-service-charge": true,
|
|
@@ -9578,11 +9592,11 @@ function SaleBadge({
|
|
|
9578
9592
|
className,
|
|
9579
9593
|
classNames
|
|
9580
9594
|
}) {
|
|
9581
|
-
let onSale =
|
|
9595
|
+
let onSale = chunkQOCHWR4V_js.isOnSale(product), hasDeal = dealInfo !== void 0;
|
|
9582
9596
|
if (!hasDeal && !onSale && !label)
|
|
9583
9597
|
return null;
|
|
9584
9598
|
let percentage = null;
|
|
9585
|
-
product.sale ? percentage =
|
|
9599
|
+
product.sale ? percentage = chunkQOCHWR4V_js.parsePrice(product.sale.percent_off) : hasDeal && dealInfo.benefit_type === "percentage" ? percentage = chunkQOCHWR4V_js.parsePrice(dealInfo.value) : onSale && (percentage = chunkQOCHWR4V_js.getDiscountPercentage(product));
|
|
9586
9600
|
let badgeText = label ?? product.sale?.badge_text ?? dealInfo?.label ?? (percentage != null && percentage > 0 ? `${percentage}% off` : null);
|
|
9587
9601
|
return badgeText ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
9588
9602
|
"span",
|
|
@@ -9597,7 +9611,7 @@ function SaleBadge({
|
|
|
9597
9611
|
"%"
|
|
9598
9612
|
] }),
|
|
9599
9613
|
/* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-sale-label": true, className: classNames?.label, children: badgeText }),
|
|
9600
|
-
showOriginalPrice && onSale && /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-sale-original-price": true, className: classNames?.originalPrice, children: /* @__PURE__ */ jsxRuntime.jsx(Price, { amount:
|
|
9614
|
+
showOriginalPrice && onSale && /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-sale-original-price": true, className: classNames?.originalPrice, children: /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: chunkQOCHWR4V_js.getBasePrice(product), currency: chunkQOCHWR4V_js.getProductCurrency(product) }) })
|
|
9601
9615
|
]
|
|
9602
9616
|
}
|
|
9603
9617
|
) : null;
|
|
@@ -9614,7 +9628,7 @@ function SalePrice({
|
|
|
9614
9628
|
}) {
|
|
9615
9629
|
if (!sale)
|
|
9616
9630
|
return /* @__PURE__ */ jsxRuntime.jsx(Price, { amount, currency, className });
|
|
9617
|
-
let off = Math.round(
|
|
9631
|
+
let off = Math.round(chunkQOCHWR4V_js.parsePrice(sale.percent_off));
|
|
9618
9632
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
9619
9633
|
"span",
|
|
9620
9634
|
{
|
|
@@ -9949,7 +9963,7 @@ function ProductSheet({
|
|
|
9949
9963
|
Price,
|
|
9950
9964
|
{
|
|
9951
9965
|
amount: fullProduct.default_price,
|
|
9952
|
-
currency:
|
|
9966
|
+
currency: chunkQOCHWR4V_js.getProductCurrency(fullProduct),
|
|
9953
9967
|
className: classNames?.price
|
|
9954
9968
|
}
|
|
9955
9969
|
)
|
|
@@ -10107,10 +10121,10 @@ function SoldOutOverlay() {
|
|
|
10107
10121
|
function SaleBadge2({ product }) {
|
|
10108
10122
|
let label = null;
|
|
10109
10123
|
if (product.sale) {
|
|
10110
|
-
let off = Math.round(
|
|
10124
|
+
let off = Math.round(chunkQOCHWR4V_js.parsePrice(product.sale.percent_off));
|
|
10111
10125
|
label = product.sale.badge_text ?? (off > 0 ? `-${off}%` : null);
|
|
10112
|
-
} else if (
|
|
10113
|
-
let pct =
|
|
10126
|
+
} else if (chunkQOCHWR4V_js.isOnSale(product)) {
|
|
10127
|
+
let pct = chunkQOCHWR4V_js.getDiscountPercentage(product);
|
|
10114
10128
|
label = pct && pct > 0 ? `-${pct}%` : null;
|
|
10115
10129
|
}
|
|
10116
10130
|
return label ? /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-card-sale-badge": true, className: "inline-flex items-center text-[11px] font-semibold tracking-wide bg-destructive text-destructive-foreground px-2 py-0.5 rounded-md", children: label }) : null;
|
|
@@ -10144,7 +10158,7 @@ function FoodProductCard({
|
|
|
10144
10158
|
renderLink,
|
|
10145
10159
|
className
|
|
10146
10160
|
}) {
|
|
10147
|
-
let image = product.image_url || product.images?.[0] || "", currency =
|
|
10161
|
+
let image = product.image_url || product.images?.[0] || "", currency = chunkQOCHWR4V_js.getProductCurrency(product), tags = product.tags || [], isSignature = product.metadata?.is_signature === true, isNew = product.metadata?.is_new === true, isComposite = product.type === chunkZF7JCXCI_js.PRODUCT_TYPE.Composite;
|
|
10148
10162
|
return /* @__PURE__ */ jsxRuntime.jsxs(CardShell, { product, renderLink, className, children: [
|
|
10149
10163
|
/* @__PURE__ */ jsxRuntime.jsxs(CardImage, { src: image, alt: product.name, aspectRatio: "square", renderImage, children: [
|
|
10150
10164
|
isSignature && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "absolute top-3 left-3 inline-flex items-center gap-1 text-[11px] font-semibold tracking-wide bg-amber-50 text-amber-700 border border-amber-200/60 px-2 py-0.5 rounded-md", children: [
|
|
@@ -10190,7 +10204,7 @@ function RetailProductCard({
|
|
|
10190
10204
|
renderLink,
|
|
10191
10205
|
className
|
|
10192
10206
|
}) {
|
|
10193
|
-
let image = product.image_url || product.images?.[0] || "", currency =
|
|
10207
|
+
let image = product.image_url || product.images?.[0] || "", currency = chunkQOCHWR4V_js.getProductCurrency(product), outOfStock = product.inventory_status?.in_stock === false, onSale = chunkQOCHWR4V_js.isOnSale(product), swatches = getColorSwatches(product);
|
|
10194
10208
|
return /* @__PURE__ */ jsxRuntime.jsxs(CardShell, { product, renderLink, disabled: outOfStock, className, children: [
|
|
10195
10209
|
outOfStock && /* @__PURE__ */ jsxRuntime.jsx(SoldOutOverlay, {}),
|
|
10196
10210
|
/* @__PURE__ */ jsxRuntime.jsxs(CardImage, { src: image, alt: product.name, aspectRatio: "3/4", renderImage, children: [
|
|
@@ -10210,7 +10224,7 @@ function RetailProductCard({
|
|
|
10210
10224
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.sale.original, currency, className: "text-xs text-muted-foreground line-through" })
|
|
10211
10225
|
] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
10212
10226
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, currency, className: "text-sm font-bold" }),
|
|
10213
|
-
onSale && /* @__PURE__ */ jsxRuntime.jsx(Price, { amount:
|
|
10227
|
+
onSale && /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: chunkQOCHWR4V_js.getBasePrice(product), currency, className: "text-xs text-muted-foreground line-through" })
|
|
10214
10228
|
] }) }),
|
|
10215
10229
|
swatches.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex gap-1.5 mt-2.5", children: swatches.map((name) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
10216
10230
|
"span",
|
|
@@ -10225,8 +10239,8 @@ function RetailProductCard({
|
|
|
10225
10239
|
] });
|
|
10226
10240
|
}
|
|
10227
10241
|
function PriceRange({ product, currency, className }) {
|
|
10228
|
-
let resolvedCurrency = currency ??
|
|
10229
|
-
return range ? /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-price-range": true, className, children:
|
|
10242
|
+
let resolvedCurrency = currency ?? chunkQOCHWR4V_js.getProductCurrency(product), range = chunkQOCHWR4V_js.getPriceRange(product);
|
|
10243
|
+
return range ? /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-price-range": true, className, children: chunkQOCHWR4V_js.formatPriceRange(range.min, range.max, resolvedCurrency) }) : null;
|
|
10230
10244
|
}
|
|
10231
10245
|
function WholesaleProductCard({
|
|
10232
10246
|
product,
|
|
@@ -10235,7 +10249,7 @@ function WholesaleProductCard({
|
|
|
10235
10249
|
renderLink,
|
|
10236
10250
|
className
|
|
10237
10251
|
}) {
|
|
10238
|
-
let image = product.image_url || product.images?.[0] || "", currency =
|
|
10252
|
+
let image = product.image_url || product.images?.[0] || "", currency = chunkQOCHWR4V_js.getProductCurrency(product), hasTiers = product.quantity_pricing && product.quantity_pricing.length > 1, status = product.inventory_status;
|
|
10239
10253
|
return /* @__PURE__ */ jsxRuntime.jsxs(CardShell, { product, renderLink, className, children: [
|
|
10240
10254
|
/* @__PURE__ */ jsxRuntime.jsxs(CardImage, { src: image, alt: product.name, aspectRatio: "square", renderImage, children: [
|
|
10241
10255
|
product.min_order_quantity != null && product.min_order_quantity > 1 && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "absolute top-3 left-3 text-[11px] font-semibold tracking-wide bg-zinc-800 text-white px-2 py-0.5 rounded-md", children: [
|
|
@@ -10280,7 +10294,7 @@ function DigitalProductCard({
|
|
|
10280
10294
|
renderLink,
|
|
10281
10295
|
className
|
|
10282
10296
|
}) {
|
|
10283
|
-
let image = product.image_url || product.images?.[0] || "", currency =
|
|
10297
|
+
let image = product.image_url || product.images?.[0] || "", currency = chunkQOCHWR4V_js.getProductCurrency(product), typeBadge = product.digital_type ? TYPE_BADGES[product.digital_type] : null, isTicket = product.digital_type === "ticket";
|
|
10284
10298
|
return /* @__PURE__ */ jsxRuntime.jsxs(CardShell, { product, renderLink, className, children: [
|
|
10285
10299
|
/* @__PURE__ */ jsxRuntime.jsx(CardImage, { src: image, alt: product.name, aspectRatio: "4/3", renderImage, children: typeBadge && /* @__PURE__ */ jsxRuntime.jsx("span", { className: `absolute top-3 left-3 text-[11px] font-semibold tracking-wide border px-2 py-0.5 rounded-md ${typeBadge.color}`, children: typeBadge.label }) }),
|
|
10286
10300
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-3.5", children: [
|
|
@@ -10308,7 +10322,7 @@ function BundleProductCard({
|
|
|
10308
10322
|
renderLink,
|
|
10309
10323
|
className
|
|
10310
10324
|
}) {
|
|
10311
|
-
let image = product.image_url || product.images?.[0] || "", currency =
|
|
10325
|
+
let image = product.image_url || product.images?.[0] || "", currency = chunkQOCHWR4V_js.getProductCurrency(product), components = product.components || [], componentCount = components.length, onSale = chunkQOCHWR4V_js.isOnSale(product), discount = chunkQOCHWR4V_js.getDiscountPercentage(product), hasVariantChoice = components.some((c) => c.allow_variant_choice);
|
|
10312
10326
|
return /* @__PURE__ */ jsxRuntime.jsxs(CardShell, { product, renderLink, className, children: [
|
|
10313
10327
|
/* @__PURE__ */ jsxRuntime.jsxs(CardImage, { src: image, alt: product.name, aspectRatio: "square", renderImage, children: [
|
|
10314
10328
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute top-3 left-3 text-[11px] font-semibold tracking-wide bg-indigo-50 text-indigo-700 border border-indigo-200/60 px-2 py-0.5 rounded-md", children: "Bundle" }),
|
|
@@ -10334,7 +10348,7 @@ function BundleProductCard({
|
|
|
10334
10348
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 mt-2.5", children: [
|
|
10335
10349
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, currency, className: "text-sm font-bold" }),
|
|
10336
10350
|
onSale && product.bundle_price && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
10337
|
-
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount:
|
|
10351
|
+
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: chunkQOCHWR4V_js.getBasePrice(product), currency, className: "text-xs text-muted-foreground line-through" }),
|
|
10338
10352
|
discount != null && discount > 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-[10px] font-semibold text-emerald-600", children: [
|
|
10339
10353
|
"Save ",
|
|
10340
10354
|
discount,
|
|
@@ -10353,7 +10367,7 @@ function CompositeProductCard({
|
|
|
10353
10367
|
renderLink,
|
|
10354
10368
|
className
|
|
10355
10369
|
}) {
|
|
10356
|
-
let image = product.image_url || product.images?.[0] || "", currency =
|
|
10370
|
+
let image = product.image_url || product.images?.[0] || "", currency = chunkQOCHWR4V_js.getProductCurrency(product), groups = product.groups || [], groupCount = groups.length; groups.reduce((sum, g) => sum + g.components.length, 0); let tags = product.tags || [];
|
|
10357
10371
|
return /* @__PURE__ */ jsxRuntime.jsxs(CardShell, { product, renderLink, className, children: [
|
|
10358
10372
|
/* @__PURE__ */ jsxRuntime.jsxs(CardImage, { src: image, alt: product.name, aspectRatio: "square", renderImage, children: [
|
|
10359
10373
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute top-3 left-3 text-[11px] font-semibold tracking-wide bg-violet-50 text-violet-700 border border-violet-200/60 px-2 py-0.5 rounded-md", children: "Build Your Own" }),
|
|
@@ -10399,7 +10413,7 @@ function StandardServiceCard({
|
|
|
10399
10413
|
renderLink,
|
|
10400
10414
|
className
|
|
10401
10415
|
}) {
|
|
10402
|
-
let image = product.image_url || product.images?.[0] || "", currency =
|
|
10416
|
+
let image = product.image_url || product.images?.[0] || "", currency = chunkQOCHWR4V_js.getProductCurrency(product), hasDeposit = product.deposit_type && product.deposit_type !== "none" && product.deposit_amount;
|
|
10403
10417
|
return /* @__PURE__ */ jsxRuntime.jsxs(CardShell, { product, renderLink, className, children: [
|
|
10404
10418
|
/* @__PURE__ */ jsxRuntime.jsxs(CardImage, { src: image, alt: product.name, aspectRatio: "16/9", renderImage, children: [
|
|
10405
10419
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-0 bg-gradient-to-t from-black/50 to-transparent pointer-events-none" }),
|
|
@@ -10449,7 +10463,7 @@ function CompactServiceCard({
|
|
|
10449
10463
|
renderLink,
|
|
10450
10464
|
className
|
|
10451
10465
|
}) {
|
|
10452
|
-
let image = product.image_url || product.images?.[0] || "", currency =
|
|
10466
|
+
let image = product.image_url || product.images?.[0] || "", currency = chunkQOCHWR4V_js.getProductCurrency(product), hasDeposit = product.deposit_type && product.deposit_type !== "none" && product.deposit_amount, hasBillingPlans = product.billing_plans && product.billing_plans.length > 0, href = `/products/${product.slug}`, content = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-4 p-3", children: [
|
|
10453
10467
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-[72px] h-[72px] rounded-xl overflow-hidden bg-muted shrink-0", children: renderImage ? renderImage({ src: image, alt: product.name, className: "w-full h-full object-cover" }) : image ? /* @__PURE__ */ jsxRuntime.jsx("img", { src: image, alt: product.name, className: "w-full h-full object-cover" }) : null }),
|
|
10454
10468
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 min-w-0", children: [
|
|
10455
10469
|
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-[14px] font-semibold text-foreground leading-tight truncate", children: product.name }),
|
|
@@ -10489,7 +10503,7 @@ function ScheduleServiceCard({
|
|
|
10489
10503
|
renderLink,
|
|
10490
10504
|
className
|
|
10491
10505
|
}) {
|
|
10492
|
-
let image = product.image_url || product.images?.[0] || "", currency =
|
|
10506
|
+
let image = product.image_url || product.images?.[0] || "", currency = chunkQOCHWR4V_js.getProductCurrency(product), href = `/products/${product.slug}`, durationLabel = product.duration_minutes != null ? formatDuration2(product.duration_minutes, product.duration_unit) : null, displaySlots = (slots || []).slice(0, 3), shellClass = cn(
|
|
10493
10507
|
"group block text-left cursor-pointer bg-card rounded-[14px] overflow-hidden",
|
|
10494
10508
|
"shadow-[0_1px_3px_rgba(0,0,0,0.04),0_6px_24px_rgba(0,0,0,0.06)]",
|
|
10495
10509
|
"transition-all duration-300 ease-[cubic-bezier(0.19,1,0.22,1)]",
|
|
@@ -10550,7 +10564,7 @@ function RentalServiceCard({
|
|
|
10550
10564
|
renderLink,
|
|
10551
10565
|
className
|
|
10552
10566
|
}) {
|
|
10553
|
-
let image = product.image_url || product.images?.[0] || "", currency =
|
|
10567
|
+
let image = product.image_url || product.images?.[0] || "", currency = chunkQOCHWR4V_js.getProductCurrency(product), hasDeposit = product.deposit_type && product.deposit_type !== "none" && product.deposit_amount, unit = product.duration_unit ? UNIT_LABELS2[product.duration_unit] || product.duration_unit : "day", priceUnit = product.price_basis === "per_person" ? "guest" : product.price_basis === "flat" ? "" : unit, status = product.inventory_status;
|
|
10554
10568
|
return /* @__PURE__ */ jsxRuntime.jsxs(CardShell, { product, renderLink, className, children: [
|
|
10555
10569
|
/* @__PURE__ */ jsxRuntime.jsxs(CardImage, { src: image, alt: product.name, aspectRatio: "16/9", renderImage, children: [
|
|
10556
10570
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-0 bg-gradient-to-t from-black/50 to-transparent pointer-events-none" }),
|
|
@@ -10613,7 +10627,7 @@ function AccommodationCard({
|
|
|
10613
10627
|
renderLink,
|
|
10614
10628
|
className
|
|
10615
10629
|
}) {
|
|
10616
|
-
let image = product.image_url || product.images?.[0] || "", currency =
|
|
10630
|
+
let image = product.image_url || product.images?.[0] || "", currency = chunkQOCHWR4V_js.getProductCurrency(product), hasTiers = product.quantity_pricing && product.quantity_pricing.length > 1, cancellationHours = product.cancellation_window_minutes ? Math.floor(product.cancellation_window_minutes / 60) : null, tags = product.tags || [];
|
|
10617
10631
|
return /* @__PURE__ */ jsxRuntime.jsxs(CardShell, { product, renderLink, className, children: [
|
|
10618
10632
|
/* @__PURE__ */ jsxRuntime.jsxs(CardImage, { src: image, alt: product.name, aspectRatio: "16/9", renderImage, children: [
|
|
10619
10633
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-0 bg-gradient-to-t from-black/50 to-transparent pointer-events-none" }),
|
|
@@ -10673,7 +10687,7 @@ function LeaseServiceCard({
|
|
|
10673
10687
|
renderLink,
|
|
10674
10688
|
className
|
|
10675
10689
|
}) {
|
|
10676
|
-
let image = product.image_url || product.images?.[0] || "", currency =
|
|
10690
|
+
let image = product.image_url || product.images?.[0] || "", currency = chunkQOCHWR4V_js.getProductCurrency(product), hasDeposit = product.deposit_type && product.deposit_type !== "none" && product.deposit_amount, hasTiers = product.quantity_pricing && product.quantity_pricing.length > 1, unit = product.duration_unit ? UNIT_LABELS3[product.duration_unit] || product.duration_unit : "mo", tags = product.tags || [], cancellationHours = product.cancellation_window_minutes ? Math.floor(product.cancellation_window_minutes / 60) : null;
|
|
10677
10691
|
return /* @__PURE__ */ jsxRuntime.jsxs(CardShell, { product, renderLink, className, children: [
|
|
10678
10692
|
/* @__PURE__ */ jsxRuntime.jsxs(CardImage, { src: image, alt: product.name, aspectRatio: "16/9", renderImage, children: [
|
|
10679
10693
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-0 bg-gradient-to-t from-black/50 to-transparent pointer-events-none" }),
|
|
@@ -10739,7 +10753,7 @@ function SubscriptionCard({
|
|
|
10739
10753
|
renderLink,
|
|
10740
10754
|
className
|
|
10741
10755
|
}) {
|
|
10742
|
-
let image = product.image_url || product.images?.[0] || "", currency =
|
|
10756
|
+
let image = product.image_url || product.images?.[0] || "", currency = chunkQOCHWR4V_js.getProductCurrency(product), plans = product.billing_plans || [], primaryPlan = plans[0], frequency = primaryPlan?.frequency ? FREQUENCY_LABELS2[primaryPlan.frequency] || `/${primaryPlan.frequency}` : "/mo", hasTrial = primaryPlan?.trial_days != null && primaryPlan.trial_days > 0, tags = product.tags || [];
|
|
10743
10757
|
return /* @__PURE__ */ jsxRuntime.jsxs(CardShell, { product, renderLink, className, children: [
|
|
10744
10758
|
/* @__PURE__ */ jsxRuntime.jsxs(CardImage, { src: image, alt: product.name, aspectRatio: "16/9", renderImage, children: [
|
|
10745
10759
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-0 bg-gradient-to-t from-black/50 to-transparent pointer-events-none" }),
|
|
@@ -10897,7 +10911,7 @@ function ProductCard({
|
|
|
10897
10911
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-product-card-body": true, className: cn("p-4 flex flex-col gap-1", classNames?.body), children: [
|
|
10898
10912
|
/* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-product-card-name": true, className: cn("font-semibold text-foreground leading-tight", classNames?.name), children: product.name }),
|
|
10899
10913
|
descriptionPreview && /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-product-card-description": true, className: cn("text-sm text-muted-foreground line-clamp-2", classNames?.description), children: descriptionPreview }),
|
|
10900
|
-
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, currency:
|
|
10914
|
+
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, currency: chunkQOCHWR4V_js.getProductCurrency(product), className: cn("text-sm font-medium text-foreground mt-1", classNames?.price) })
|
|
10901
10915
|
] })
|
|
10902
10916
|
] });
|
|
10903
10917
|
})();
|
|
@@ -11198,11 +11212,39 @@ function SearchInput({
|
|
|
11198
11212
|
alt: "",
|
|
11199
11213
|
"data-cimplify-search-result-image": true,
|
|
11200
11214
|
className: classNames?.resultImage,
|
|
11201
|
-
style: {
|
|
11215
|
+
style: {
|
|
11216
|
+
width: "2rem",
|
|
11217
|
+
height: "2rem",
|
|
11218
|
+
objectFit: "cover",
|
|
11219
|
+
borderRadius: "0.25rem",
|
|
11220
|
+
flexShrink: 0
|
|
11221
|
+
}
|
|
11222
|
+
}
|
|
11223
|
+
),
|
|
11224
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11225
|
+
"span",
|
|
11226
|
+
{
|
|
11227
|
+
"data-cimplify-search-result-name": true,
|
|
11228
|
+
className: classNames?.resultName,
|
|
11229
|
+
style: { flex: 1, textAlign: "left" },
|
|
11230
|
+
children: product.name
|
|
11202
11231
|
}
|
|
11203
11232
|
),
|
|
11204
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11205
|
-
|
|
11233
|
+
product.default_price !== void 0 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
11234
|
+
"span",
|
|
11235
|
+
{
|
|
11236
|
+
"data-cimplify-search-result-price": true,
|
|
11237
|
+
className: classNames?.resultPrice,
|
|
11238
|
+
style: { flexShrink: 0 },
|
|
11239
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
11240
|
+
Price,
|
|
11241
|
+
{
|
|
11242
|
+
amount: product.default_price,
|
|
11243
|
+
currency: chunkQOCHWR4V_js.getProductCurrency(product)
|
|
11244
|
+
}
|
|
11245
|
+
)
|
|
11246
|
+
}
|
|
11247
|
+
)
|
|
11206
11248
|
] })
|
|
11207
11249
|
},
|
|
11208
11250
|
product.id
|
|
@@ -11649,19 +11691,19 @@ function OrderSummary({
|
|
|
11649
11691
|
order.customer_notes.map((note, index2) => /* @__PURE__ */ jsxRuntime.jsx("p", { "data-cimplify-order-note": true, children: note }, index2))
|
|
11650
11692
|
] }),
|
|
11651
11693
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-order-totals": true, className: classNames?.totals, children: [
|
|
11652
|
-
order.total_discount != null &&
|
|
11694
|
+
order.total_discount != null && chunkQOCHWR4V_js.parsePrice(order.total_discount) !== 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-order-discount": true, children: [
|
|
11653
11695
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Discount" }),
|
|
11654
11696
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: order.total_discount, prefix: "-" })
|
|
11655
11697
|
] }),
|
|
11656
|
-
order.delivery_fee != null &&
|
|
11698
|
+
order.delivery_fee != null && chunkQOCHWR4V_js.parsePrice(order.delivery_fee) > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-order-delivery-fee": true, children: [
|
|
11657
11699
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Delivery fee" }),
|
|
11658
11700
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: order.delivery_fee })
|
|
11659
11701
|
] }),
|
|
11660
|
-
order.service_charge != null &&
|
|
11702
|
+
order.service_charge != null && chunkQOCHWR4V_js.parsePrice(order.service_charge) !== 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-order-service-charge": true, children: [
|
|
11661
11703
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Service charge" }),
|
|
11662
11704
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: order.service_charge })
|
|
11663
11705
|
] }),
|
|
11664
|
-
order.tax != null &&
|
|
11706
|
+
order.tax != null && chunkQOCHWR4V_js.parsePrice(order.tax) !== 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-order-tax": true, children: [
|
|
11665
11707
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Tax" }),
|
|
11666
11708
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: order.tax })
|
|
11667
11709
|
] }),
|
|
@@ -12150,7 +12192,7 @@ function BookingPage({
|
|
|
12150
12192
|
className,
|
|
12151
12193
|
classNames
|
|
12152
12194
|
}) {
|
|
12153
|
-
let { addItem } = useCart(), { client } = useCimplifyClient(), currency = service.currency, isReschedule = existingBooking !== void 0, [step, setStep] = React14.useState(STEP.SELECT_SLOT), [selectedSlot, setSelectedSlot] = React14.useState(null), [selectedDate, setSelectedDate] = React14.useState(null), [selectedStaffId, setSelectedStaffId] = React14.useState(null), [selectedResourceId, setSelectedResourceId] = React14.useState(null), [bookingUnits, setBookingUnits] = React14.useState(1), [isSubmitting, setIsSubmitting] = React14.useState(false), [error, setError] = React14.useState(null), hasResourceStep = resources && resources.length > 0, hasStaffStep = staff && staff.length > 0, depositType = product?.deposit_type, depositAmount = product?.deposit_amount, hasDeposit = depositType !== void 0 && depositType !== "none" && depositAmount !== void 0 &&
|
|
12195
|
+
let { addItem } = useCart(), { client } = useCimplifyClient(), currency = service.currency, isReschedule = existingBooking !== void 0, [step, setStep] = React14.useState(STEP.SELECT_SLOT), [selectedSlot, setSelectedSlot] = React14.useState(null), [selectedDate, setSelectedDate] = React14.useState(null), [selectedStaffId, setSelectedStaffId] = React14.useState(null), [selectedResourceId, setSelectedResourceId] = React14.useState(null), [bookingUnits, setBookingUnits] = React14.useState(1), [isSubmitting, setIsSubmitting] = React14.useState(false), [error, setError] = React14.useState(null), hasResourceStep = resources && resources.length > 0, hasStaffStep = staff && staff.length > 0, depositType = product?.deposit_type, depositAmount = product?.deposit_amount, hasDeposit = depositType !== void 0 && depositType !== "none" && depositAmount !== void 0 && chunkQOCHWR4V_js.parsePrice(depositAmount) !== 0, cancellationMinutes = product?.cancellation_window_minutes, noShowFee = product?.no_show_fee, handleSlotSelect = React14.useCallback(
|
|
12154
12196
|
(slot, date) => {
|
|
12155
12197
|
setSelectedSlot(slot), setSelectedDate(date), setError(null), setStep(hasResourceStep ? STEP.SELECT_RESOURCE : hasStaffStep ? STEP.SELECT_STAFF : STEP.CONFIRM);
|
|
12156
12198
|
},
|
|
@@ -12247,14 +12289,14 @@ function BookingPage({
|
|
|
12247
12289
|
service.price && /* @__PURE__ */ jsxRuntime.jsx("span", { "data-cimplify-booking-service-price": true, children: /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: service.price, currency }) }),
|
|
12248
12290
|
hasDeposit && /* @__PURE__ */ jsxRuntime.jsxs("span", { "data-cimplify-booking-deposit-info": true, className: classNames?.depositInfo, children: [
|
|
12249
12291
|
"Deposit: ",
|
|
12250
|
-
depositType === "percentage" ? `${
|
|
12292
|
+
depositType === "percentage" ? `${chunkQOCHWR4V_js.parsePrice(depositAmount)}%` : /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: depositAmount, currency })
|
|
12251
12293
|
] }),
|
|
12252
12294
|
cancellationMinutes !== void 0 && cancellationMinutes > 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { "data-cimplify-booking-cancellation-policy": true, className: classNames?.cancellationPolicy, children: [
|
|
12253
12295
|
"Free cancellation up to ",
|
|
12254
12296
|
cancellationMinutes >= 60 ? `${Math.floor(cancellationMinutes / 60)} hour${Math.floor(cancellationMinutes / 60) !== 1 ? "s" : ""}` : `${cancellationMinutes} minute${cancellationMinutes !== 1 ? "s" : ""}`,
|
|
12255
12297
|
" before"
|
|
12256
12298
|
] }),
|
|
12257
|
-
noShowFee !== void 0 &&
|
|
12299
|
+
noShowFee !== void 0 && chunkQOCHWR4V_js.parsePrice(noShowFee) !== 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { "data-cimplify-booking-no-show-fee": true, className: classNames?.cancellationPolicy, children: [
|
|
12258
12300
|
"No-show fee: ",
|
|
12259
12301
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: noShowFee, currency })
|
|
12260
12302
|
] })
|
|
@@ -12357,7 +12399,7 @@ function BookingPage({
|
|
|
12357
12399
|
] }),
|
|
12358
12400
|
hasDeposit && /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-booking-summary-row": true, className: cn(classNames?.summaryRow, classNames?.depositInfo), children: [
|
|
12359
12401
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Deposit" }),
|
|
12360
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { children: depositType === "percentage" ? `${
|
|
12402
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: depositType === "percentage" ? `${chunkQOCHWR4V_js.parsePrice(depositAmount)}%` : /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: depositAmount, currency }) })
|
|
12361
12403
|
] })
|
|
12362
12404
|
] }),
|
|
12363
12405
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -12976,7 +13018,7 @@ function DefaultProductLayout({
|
|
|
12976
13018
|
showRelated = true,
|
|
12977
13019
|
className
|
|
12978
13020
|
}) {
|
|
12979
|
-
let [selectedVariantId, setSelectedVariantId] = React14__default.default.useState(), images = chunkZF7JCXCI_js.resolveGallery(product, selectedVariantId), currency =
|
|
13021
|
+
let [selectedVariantId, setSelectedVariantId] = React14__default.default.useState(), images = chunkZF7JCXCI_js.resolveGallery(product, selectedVariantId), currency = chunkQOCHWR4V_js.getProductCurrency(product), hasRange = product.quantity_pricing && product.quantity_pricing.length > 1 || product.variants && product.variants.length > 1, onSale = chunkQOCHWR4V_js.isOnSale(product), hasPhysicalDetails = product.sku || product.vendor || product.material;
|
|
12980
13022
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-product-layout": "default", className: cn("space-y-8", className), children: [
|
|
12981
13023
|
renderBreadcrumb?.(product),
|
|
12982
13024
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -12998,13 +13040,13 @@ function DefaultProductLayout({
|
|
|
12998
13040
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-baseline gap-3", children: hasRange ? /* @__PURE__ */ jsxRuntime.jsx(PriceRange, { product, currency, className: "text-2xl font-extrabold" }) : product.sale ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
12999
13041
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.sale.price, currency, className: "text-2xl font-extrabold" }),
|
|
13000
13042
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.sale.original, currency, className: "text-lg text-muted-foreground line-through" }),
|
|
13001
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-bold text-destructive bg-destructive/10 px-2 py-0.5", children: product.sale.badge_text ?? `${Math.round(
|
|
13043
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-bold text-destructive bg-destructive/10 px-2 py-0.5", children: product.sale.badge_text ?? `${Math.round(chunkQOCHWR4V_js.parsePrice(product.sale.percent_off))}% OFF` })
|
|
13002
13044
|
] }) : onSale ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
13003
13045
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, currency, className: "text-2xl font-extrabold" }),
|
|
13004
|
-
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount:
|
|
13046
|
+
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: chunkQOCHWR4V_js.getBasePrice(product), currency, className: "text-lg text-muted-foreground line-through" }),
|
|
13005
13047
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-sm font-bold text-destructive bg-destructive/10 px-2 py-0.5", children: [
|
|
13006
13048
|
"Save ",
|
|
13007
|
-
|
|
13049
|
+
chunkQOCHWR4V_js.getDiscountPercentage(product),
|
|
13008
13050
|
"%"
|
|
13009
13051
|
] })
|
|
13010
13052
|
] }) : /* @__PURE__ */ jsxRuntime.jsx(Price, { amount: product.default_price, currency, className: "text-2xl font-semibold" }) }),
|
|
@@ -13065,7 +13107,7 @@ function FoodProductLayout({
|
|
|
13065
13107
|
showRelated = true,
|
|
13066
13108
|
className
|
|
13067
13109
|
}) {
|
|
13068
|
-
let images = product.images || (product.image_url ? [product.image_url] : []), currency =
|
|
13110
|
+
let images = product.images || (product.image_url ? [product.image_url] : []), currency = chunkQOCHWR4V_js.getProductCurrency(product), tags = product.tags || [], ingredients = getMetadataStringList(product.metadata, "ingredients"), pairings = getMetadataStringList(product.metadata, "pairings");
|
|
13069
13111
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-product-layout": "food", className: cn("space-y-8", className), children: [
|
|
13070
13112
|
renderBreadcrumb?.(product),
|
|
13071
13113
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -13136,7 +13178,7 @@ function WholesaleProductLayout({
|
|
|
13136
13178
|
showRelated = true,
|
|
13137
13179
|
className
|
|
13138
13180
|
}) {
|
|
13139
|
-
let images = product.images || (product.image_url ? [product.image_url] : []), currency =
|
|
13181
|
+
let images = product.images || (product.image_url ? [product.image_url] : []), currency = chunkQOCHWR4V_js.getProductCurrency(product), hasTiers = product.quantity_pricing && product.quantity_pricing.length > 1;
|
|
13140
13182
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-product-layout": "wholesale", className: cn("space-y-8", className), children: [
|
|
13141
13183
|
renderBreadcrumb?.(product),
|
|
13142
13184
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -13218,7 +13260,7 @@ function ServiceProductLayout({
|
|
|
13218
13260
|
showRelated = true,
|
|
13219
13261
|
className
|
|
13220
13262
|
}) {
|
|
13221
|
-
let images = product.images || (product.image_url ? [product.image_url] : []), currency =
|
|
13263
|
+
let images = product.images || (product.image_url ? [product.image_url] : []), currency = chunkQOCHWR4V_js.getProductCurrency(product), hasDeposit = product.deposit_type && product.deposit_type !== "none" && product.deposit_amount, depositAmount = hasDeposit ? chunkQOCHWR4V_js.parsePrice(product.deposit_amount) : 0, cancellationHours = product.cancellation_window_minutes ? Math.floor(product.cancellation_window_minutes / 60) : null;
|
|
13222
13264
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-product-layout": "service", className: cn("space-y-8", className), children: [
|
|
13223
13265
|
renderBreadcrumb?.(product),
|
|
13224
13266
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -13285,7 +13327,7 @@ function ServiceProductLayout({
|
|
|
13285
13327
|
/* @__PURE__ */ jsxRuntime.jsx(Price, { amount: depositAmount, currency, className: "font-medium text-foreground" }),
|
|
13286
13328
|
" deposit charged at booking"
|
|
13287
13329
|
] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
13288
|
-
|
|
13330
|
+
chunkQOCHWR4V_js.parsePrice(product.deposit_amount),
|
|
13289
13331
|
"% deposit charged at booking"
|
|
13290
13332
|
] }) })
|
|
13291
13333
|
] })
|
|
@@ -13316,7 +13358,7 @@ function DigitalProductLayout({
|
|
|
13316
13358
|
showRelated = true,
|
|
13317
13359
|
className
|
|
13318
13360
|
}) {
|
|
13319
|
-
let images = product.images || (product.image_url ? [product.image_url] : []), currency =
|
|
13361
|
+
let images = product.images || (product.image_url ? [product.image_url] : []), currency = chunkQOCHWR4V_js.getProductCurrency(product), typeLabel = product.digital_type ? DIGITAL_TYPE_LABELS[product.digital_type] || product.digital_type : "Digital product", isTicket = product.digital_type === "ticket", isAccessPass = product.digital_type === "access_grant", isDownload = product.digital_type === "download" || product.digital_type === "license_key";
|
|
13320
13362
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-product-layout": "digital", className: cn("space-y-8", className), children: [
|
|
13321
13363
|
renderBreadcrumb?.(product),
|
|
13322
13364
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -13438,10 +13480,10 @@ function BundleProductLayout({
|
|
|
13438
13480
|
showRelated = true,
|
|
13439
13481
|
className
|
|
13440
13482
|
}) {
|
|
13441
|
-
let images = product.images || (product.image_url ? [product.image_url] : []), currency =
|
|
13442
|
-
(sum, c) => sum +
|
|
13483
|
+
let images = product.images || (product.image_url ? [product.image_url] : []), currency = chunkQOCHWR4V_js.getProductCurrency(product), components = product.components || [], onSale = chunkQOCHWR4V_js.isOnSale(product), discount = chunkQOCHWR4V_js.getDiscountPercentage(product), baseTotal = components.reduce(
|
|
13484
|
+
(sum, c) => sum + chunkQOCHWR4V_js.parsePrice(c.effective_price ?? 0) * (c.quantity ?? 1),
|
|
13443
13485
|
0
|
|
13444
|
-
), bundlePrice =
|
|
13486
|
+
), bundlePrice = chunkQOCHWR4V_js.parsePrice(product.default_price), savings = baseTotal > bundlePrice ? baseTotal - bundlePrice : 0;
|
|
13445
13487
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-product-layout": "bundle", className: cn("space-y-8", className), children: [
|
|
13446
13488
|
renderBreadcrumb?.(product),
|
|
13447
13489
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -13515,7 +13557,7 @@ function CompositeProductLayout({
|
|
|
13515
13557
|
showRelated = true,
|
|
13516
13558
|
className
|
|
13517
13559
|
}) {
|
|
13518
|
-
let images = product.images || (product.image_url ? [product.image_url] : []), currency =
|
|
13560
|
+
let images = product.images || (product.image_url ? [product.image_url] : []), currency = chunkQOCHWR4V_js.getProductCurrency(product), groups = product.groups || [];
|
|
13519
13561
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-product-layout": "composite", className: cn("space-y-8", className), children: [
|
|
13520
13562
|
renderBreadcrumb?.(product),
|
|
13521
13563
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -13854,7 +13896,7 @@ function CartDrawer({
|
|
|
13854
13896
|
freeShippingThreshold = 0,
|
|
13855
13897
|
className
|
|
13856
13898
|
}) {
|
|
13857
|
-
let { isOpen, close } = useCartDrawer(), cart = useCart(), subtotalNum =
|
|
13899
|
+
let { isOpen, close } = useCartDrawer(), cart = useCart(), subtotalNum = chunkQOCHWR4V_js.parsePrice(cart.subtotal), animatedSubtotal = useAnimatedNumber(subtotalNum);
|
|
13858
13900
|
React14.useEffect(() => {
|
|
13859
13901
|
if (!isOpen) return;
|
|
13860
13902
|
let original = document.body.style.overflow;
|
|
@@ -14216,7 +14258,7 @@ function CatalogueCollectionLayout({
|
|
|
14216
14258
|
(p) => p.name.toLowerCase().includes(q) || p.description?.toLowerCase().includes(q)
|
|
14217
14259
|
);
|
|
14218
14260
|
}
|
|
14219
|
-
return activeCategory && (result = result.filter((p) => p.tags?.includes(activeCategory))), sortBy === "price-asc" ? result = [...result].sort((a, b) =>
|
|
14261
|
+
return activeCategory && (result = result.filter((p) => p.tags?.includes(activeCategory))), sortBy === "price-asc" ? result = [...result].sort((a, b) => chunkQOCHWR4V_js.parsePrice(a.default_price) - chunkQOCHWR4V_js.parsePrice(b.default_price)) : sortBy === "price-desc" ? result = [...result].sort((a, b) => chunkQOCHWR4V_js.parsePrice(b.default_price) - chunkQOCHWR4V_js.parsePrice(a.default_price)) : sortBy === "name" && (result = [...result].sort((a, b) => a.name.localeCompare(b.name))), result;
|
|
14220
14262
|
}, [products, searchQuery, activeCategory, sortBy]);
|
|
14221
14263
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-cimplify-collection-layout": "catalogue", className: cn("space-y-6", className), children: [
|
|
14222
14264
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
@@ -18128,16 +18170,16 @@ var COLOR = {
|
|
|
18128
18170
|
hairline: "#EDEEF1",
|
|
18129
18171
|
surface: "#FFFFFF",
|
|
18130
18172
|
fill: "#F1F1F3",
|
|
18131
|
-
accent: "#
|
|
18132
|
-
accentWash: "#
|
|
18133
|
-
accentInk: "#
|
|
18173
|
+
accent: "#FFE01A",
|
|
18174
|
+
accentWash: "#FDF3DF",
|
|
18175
|
+
accentInk: "#7A6300",
|
|
18134
18176
|
danger: "#C2410C",
|
|
18135
18177
|
iconDisabled: "#C4C8D0",
|
|
18136
|
-
onAccent: "#
|
|
18178
|
+
onAccent: "#141413",
|
|
18137
18179
|
transparent: "transparent"
|
|
18138
18180
|
}, SHADOW = {
|
|
18139
|
-
sheet: "0 12px 32px #
|
|
18140
|
-
form: "0 8px 24px #
|
|
18181
|
+
sheet: "0 12px 32px #14141314",
|
|
18182
|
+
form: "0 8px 24px #1414130F",
|
|
18141
18183
|
segment: "0 1px 3px #14161C1A",
|
|
18142
18184
|
knob: "0 2px 4px #0000001F",
|
|
18143
18185
|
focusRing: `0 0 0 4px ${COLOR.accentWash}`,
|
|
@@ -19291,7 +19333,7 @@ function toneChip(value) {
|
|
|
19291
19333
|
}
|
|
19292
19334
|
}
|
|
19293
19335
|
function money(amount, currency) {
|
|
19294
|
-
return
|
|
19336
|
+
return chunkQOCHWR4V_js.formatPrice(chunkQOCHWR4V_js.parsePrice(num(amount) ?? 0), text3(currency));
|
|
19295
19337
|
}
|
|
19296
19338
|
var CHAT_GENUI_COMPONENTS = {
|
|
19297
19339
|
Stack: ({ node, ctx }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -19416,7 +19458,10 @@ var CHAT_GENUI_COMPONENTS = {
|
|
|
19416
19458
|
{
|
|
19417
19459
|
role: action ? "button" : void 0,
|
|
19418
19460
|
onClick: action ? () => ctx.onAction({ action, label: title }) : void 0,
|
|
19419
|
-
className: cn(
|
|
19461
|
+
className: cn(
|
|
19462
|
+
"flex items-center gap-2.5 py-1",
|
|
19463
|
+
action && "cursor-pointer active:opacity-70"
|
|
19464
|
+
),
|
|
19420
19465
|
children: [
|
|
19421
19466
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 grow flex-col", children: [
|
|
19422
19467
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate text-sm font-medium text-foreground", children: title }),
|
|
@@ -19529,7 +19574,7 @@ function ReplyCardView({
|
|
|
19529
19574
|
card.image_url && /* @__PURE__ */ jsxRuntime.jsx("img", { src: card.image_url, alt: "", className: "size-12 shrink-0 rounded-xl object-cover" }),
|
|
19530
19575
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex min-w-0 flex-col gap-0.5", children: [
|
|
19531
19576
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate text-sm font-semibold text-foreground", children: card.name }),
|
|
19532
|
-
card.price !== void 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[13px] font-semibold text-foreground tabular-nums", children:
|
|
19577
|
+
card.price !== void 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[13px] font-semibold text-foreground tabular-nums", children: chunkQOCHWR4V_js.formatPrice(chunkQOCHWR4V_js.parsePrice(card.price), currency) }),
|
|
19533
19578
|
fire2 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs font-semibold text-primary", children: "View" })
|
|
19534
19579
|
] })
|
|
19535
19580
|
]
|
|
@@ -19589,7 +19634,7 @@ function ChatWidget({
|
|
|
19589
19634
|
className,
|
|
19590
19635
|
classNames
|
|
19591
19636
|
}) {
|
|
19592
|
-
let context = useOptionalCimplifyClient(), client = clientProp ?? context?.client, businessName = businessNameProp ?? context?.business?.name ?? "Support", currency = currencyProp ?? context?.baseCurrency, [open, setOpen] = React14.useState(defaultOpen), [readAt, setReadAt] = React14.useState(null), [attachError, setAttachError] = React14.useState(null), [replyTo, setReplyTo] = React14.useState(null), {
|
|
19637
|
+
let context = useOptionalCimplifyClient(), client = clientProp ?? context?.client, businessName = businessNameProp ?? context?.business?.name ?? "Support", currency = currencyProp ?? context?.baseCurrency ?? void 0, [open, setOpen] = React14.useState(defaultOpen), [readAt, setReadAt] = React14.useState(null), [attachError, setAttachError] = React14.useState(null), [replyTo, setReplyTo] = React14.useState(null), {
|
|
19593
19638
|
messages,
|
|
19594
19639
|
isLoading,
|
|
19595
19640
|
isSending,
|
|
@@ -19612,12 +19657,12 @@ function ChatWidget({
|
|
|
19612
19657
|
if (!client) return;
|
|
19613
19658
|
if (setAttachError(null), !isAllowedAttachment(file)) {
|
|
19614
19659
|
setAttachError(
|
|
19615
|
-
new
|
|
19660
|
+
new chunkNFXCKTE2_js.CimplifyError("invalid_attachment", "Only photos and documents can be attached.")
|
|
19616
19661
|
);
|
|
19617
19662
|
return;
|
|
19618
19663
|
}
|
|
19619
19664
|
if (file.size > MAX_ATTACHMENT_BYTES) {
|
|
19620
|
-
setAttachError(new
|
|
19665
|
+
setAttachError(new chunkNFXCKTE2_js.CimplifyError("attachment_too_large", "Files must be under 25MB."));
|
|
19621
19666
|
return;
|
|
19622
19667
|
}
|
|
19623
19668
|
let uploaded = await client.uploads.upload(file);
|
|
@@ -19642,9 +19687,7 @@ function ChatWidget({
|
|
|
19642
19687
|
return setReplyTo(null), send(content, target ? { replyTo: target } : void 0);
|
|
19643
19688
|
},
|
|
19644
19689
|
[send, replyTo]
|
|
19645
|
-
), unread = open ? 0 : messages.filter(
|
|
19646
|
-
(m) => m.sender_type !== "customer" && (!readAt || m.created_at > readAt)
|
|
19647
|
-
).length;
|
|
19690
|
+
), unread = open ? 0 : messages.filter((m) => m.sender_type !== "customer" && (!readAt || m.created_at > readAt)).length;
|
|
19648
19691
|
React14.useState(() => {
|
|
19649
19692
|
defaultOpen && openIfExisting();
|
|
19650
19693
|
});
|
|
@@ -19664,14 +19707,7 @@ function ChatWidget({
|
|
|
19664
19707
|
classNames?.root
|
|
19665
19708
|
),
|
|
19666
19709
|
children: [
|
|
19667
|
-
!open && /* @__PURE__ */ jsxRuntime.jsx(
|
|
19668
|
-
Bubble,
|
|
19669
|
-
{
|
|
19670
|
-
unread,
|
|
19671
|
-
onClick: handleOpen,
|
|
19672
|
-
className: classNames?.bubble
|
|
19673
|
-
}
|
|
19674
|
-
),
|
|
19710
|
+
!open && /* @__PURE__ */ jsxRuntime.jsx(Bubble, { unread, onClick: handleOpen, className: classNames?.bubble }),
|
|
19675
19711
|
open && /* @__PURE__ */ jsxRuntime.jsx(
|
|
19676
19712
|
Panel,
|
|
19677
19713
|
{
|
|
@@ -19878,8 +19914,7 @@ function Panel({
|
|
|
19878
19914
|
}
|
|
19879
19915
|
),
|
|
19880
19916
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-shrink-0 border-t border-border bg-background px-4 py-1.5 text-center text-[10px] text-muted-foreground", children: [
|
|
19881
|
-
"Powered by",
|
|
19882
|
-
" ",
|
|
19917
|
+
"Powered by ",
|
|
19883
19918
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-semibold text-foreground", children: "Cimplify" })
|
|
19884
19919
|
] })
|
|
19885
19920
|
]
|
|
@@ -20029,42 +20064,35 @@ function MessageList({
|
|
|
20029
20064
|
) }),
|
|
20030
20065
|
bubbles.map((msg, i) => {
|
|
20031
20066
|
let prev = bubbles[i - 1], newDay = !prev || !sameDay(prev.created_at, msg.created_at), group = groupPosition(timeline, i), startsRun = group === "single" || group === "first", delivery = deliveryState(msg, timeline, seenAt, isOptimistic);
|
|
20032
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
20033
|
-
"
|
|
20034
|
-
|
|
20035
|
-
|
|
20036
|
-
|
|
20037
|
-
|
|
20038
|
-
|
|
20039
|
-
|
|
20040
|
-
|
|
20041
|
-
|
|
20042
|
-
|
|
20043
|
-
|
|
20044
|
-
|
|
20045
|
-
|
|
20046
|
-
|
|
20047
|
-
|
|
20048
|
-
|
|
20049
|
-
|
|
20050
|
-
|
|
20051
|
-
|
|
20052
|
-
|
|
20053
|
-
|
|
20054
|
-
|
|
20055
|
-
|
|
20056
|
-
|
|
20057
|
-
|
|
20058
|
-
|
|
20059
|
-
|
|
20060
|
-
|
|
20061
|
-
}
|
|
20062
|
-
)
|
|
20063
|
-
] })
|
|
20064
|
-
]
|
|
20065
|
-
},
|
|
20066
|
-
msg.id
|
|
20067
|
-
);
|
|
20067
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("flex flex-col gap-1.5", startsRun && i > 0 && "mt-2.5"), children: [
|
|
20068
|
+
newDay && /* @__PURE__ */ jsxRuntime.jsx(Seam, { variant: "chip", label: dayLabel(msg.created_at) }),
|
|
20069
|
+
msg.id === firstUnreadId && /* @__PURE__ */ jsxRuntime.jsx(
|
|
20070
|
+
Seam,
|
|
20071
|
+
{
|
|
20072
|
+
variant: "unread",
|
|
20073
|
+
label: `${unreadOnOpen} new message${unreadOnOpen === 1 ? "" : "s"}`
|
|
20074
|
+
}
|
|
20075
|
+
),
|
|
20076
|
+
msg.id === firstAgentMessageId && /* @__PURE__ */ jsxRuntime.jsx(Seam, { label: "A person joined" }),
|
|
20077
|
+
msg.sender_type === "system" ? /* @__PURE__ */ jsxRuntime.jsx(Seam, { label: "Passing you to the team" }) : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "group relative", children: [
|
|
20078
|
+
msg.sender_type !== "customer" && !isOptimistic(msg) && /* @__PURE__ */ jsxRuntime.jsx(HoverRail, { message: msg, onReact, onReply }),
|
|
20079
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
20080
|
+
MessageBubble,
|
|
20081
|
+
{
|
|
20082
|
+
message: msg,
|
|
20083
|
+
reactions: reactionsByTarget.get(msg.id),
|
|
20084
|
+
businessName,
|
|
20085
|
+
group,
|
|
20086
|
+
delivery,
|
|
20087
|
+
onReply,
|
|
20088
|
+
avatar: /* @__PURE__ */ jsxRuntime.jsx(LetterAvatar, { name: businessName }),
|
|
20089
|
+
renderProgram: (source) => /* @__PURE__ */ jsxRuntime.jsx(ChatKitProgram, { source, onAction: onGenUIAction }),
|
|
20090
|
+
renderCards: (target) => /* @__PURE__ */ jsxRuntime.jsx(ChatReplyCards, { message: target, currency, onAction: onGenUIAction }),
|
|
20091
|
+
onQuoteMiss: async () => (onLoadOlder(), true)
|
|
20092
|
+
}
|
|
20093
|
+
)
|
|
20094
|
+
] })
|
|
20095
|
+
] }, msg.id);
|
|
20068
20096
|
}),
|
|
20069
20097
|
isSending && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mr-auto mt-1", children: /* @__PURE__ */ jsxRuntime.jsx(TypingDots, {}) }),
|
|
20070
20098
|
offerHuman && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-2", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -20954,12 +20982,12 @@ function PersonAvatar({
|
|
|
20954
20982
|
className,
|
|
20955
20983
|
fallback = null
|
|
20956
20984
|
}) {
|
|
20957
|
-
let drawStyle = style ?? DEFAULT_STYLE, pixelRatio = typeof window > "u" ? void 0 : window.devicePixelRatio, url =
|
|
20958
|
-
() => render.src === null ?
|
|
20985
|
+
let drawStyle = style ?? DEFAULT_STYLE, pixelRatio = typeof window > "u" ? void 0 : window.devicePixelRatio, url = chunkTWM6DLYF_js.avatarRenderUrl(source, apiBase, { style: drawStyle, size, kind, pixelRatio }), read = React14.useCallback(() => chunkTWM6DLYF_js.avatarRenders.state(url), [url]), render = React14.useSyncExternalStore(chunkTWM6DLYF_js.avatarRenders.subscribe, read, read), drawn = React14.useMemo(
|
|
20986
|
+
() => render.src === null ? chunkTWM6DLYF_js.drawnAvatarUri(source, { style: drawStyle, size, backdrop }) : null,
|
|
20959
20987
|
[render.src, source, drawStyle, size, backdrop]
|
|
20960
20988
|
), ask = React14.useCallback(
|
|
20961
20989
|
(node) => {
|
|
20962
|
-
node !== null && url !== null &&
|
|
20990
|
+
node !== null && url !== null && chunkTWM6DLYF_js.avatarRenders.request(url);
|
|
20963
20991
|
},
|
|
20964
20992
|
[url]
|
|
20965
20993
|
), src = render.src ?? drawn;
|