@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/utils.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunkU6BVSJZ6_js = require('./chunk-U6BVSJZ6.js');
|
|
4
|
-
var
|
|
5
|
-
require('./chunk-
|
|
4
|
+
var chunkQOCHWR4V_js = require('./chunk-QOCHWR4V.js');
|
|
5
|
+
require('./chunk-NFXCKTE2.js');
|
|
6
6
|
require('./chunk-JGBCIKJV.js');
|
|
7
7
|
|
|
8
8
|
|
|
@@ -21,121 +21,133 @@ Object.defineProperty(exports, "resolvePhoneCountryCode", {
|
|
|
21
21
|
});
|
|
22
22
|
Object.defineProperty(exports, "CURRENCY_SYMBOLS", {
|
|
23
23
|
enumerable: true,
|
|
24
|
-
get: function () { return
|
|
24
|
+
get: function () { return chunkQOCHWR4V_js.CURRENCY_SYMBOLS; }
|
|
25
25
|
});
|
|
26
26
|
Object.defineProperty(exports, "MOBILE_MONEY_PROVIDERS", {
|
|
27
27
|
enumerable: true,
|
|
28
|
-
get: function () { return
|
|
28
|
+
get: function () { return chunkQOCHWR4V_js.MOBILE_MONEY_PROVIDERS; }
|
|
29
|
+
});
|
|
30
|
+
Object.defineProperty(exports, "PRICE_UNAVAILABLE_LABEL", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function () { return chunkQOCHWR4V_js.PRICE_UNAVAILABLE_LABEL; }
|
|
29
33
|
});
|
|
30
34
|
Object.defineProperty(exports, "canonicalMobileMoneyProvider", {
|
|
31
35
|
enumerable: true,
|
|
32
|
-
get: function () { return
|
|
36
|
+
get: function () { return chunkQOCHWR4V_js.canonicalMobileMoneyProvider; }
|
|
33
37
|
});
|
|
34
38
|
Object.defineProperty(exports, "categorizePaymentError", {
|
|
35
39
|
enumerable: true,
|
|
36
|
-
get: function () { return
|
|
40
|
+
get: function () { return chunkQOCHWR4V_js.categorizePaymentError; }
|
|
41
|
+
});
|
|
42
|
+
Object.defineProperty(exports, "currencyFractionDigits", {
|
|
43
|
+
enumerable: true,
|
|
44
|
+
get: function () { return chunkQOCHWR4V_js.currencyFractionDigits; }
|
|
37
45
|
});
|
|
38
46
|
Object.defineProperty(exports, "detectMobileMoneyProvider", {
|
|
39
47
|
enumerable: true,
|
|
40
|
-
get: function () { return
|
|
48
|
+
get: function () { return chunkQOCHWR4V_js.detectMobileMoneyProvider; }
|
|
49
|
+
});
|
|
50
|
+
Object.defineProperty(exports, "formatCurrencyAmount", {
|
|
51
|
+
enumerable: true,
|
|
52
|
+
get: function () { return chunkQOCHWR4V_js.formatCurrencyAmount; }
|
|
41
53
|
});
|
|
42
54
|
Object.defineProperty(exports, "formatMoney", {
|
|
43
55
|
enumerable: true,
|
|
44
|
-
get: function () { return
|
|
56
|
+
get: function () { return chunkQOCHWR4V_js.formatMoney; }
|
|
45
57
|
});
|
|
46
58
|
Object.defineProperty(exports, "formatNumberCompact", {
|
|
47
59
|
enumerable: true,
|
|
48
|
-
get: function () { return
|
|
60
|
+
get: function () { return chunkQOCHWR4V_js.formatNumberCompact; }
|
|
49
61
|
});
|
|
50
62
|
Object.defineProperty(exports, "formatPrice", {
|
|
51
63
|
enumerable: true,
|
|
52
|
-
get: function () { return
|
|
64
|
+
get: function () { return chunkQOCHWR4V_js.formatPrice; }
|
|
53
65
|
});
|
|
54
66
|
Object.defineProperty(exports, "formatPriceAdjustment", {
|
|
55
67
|
enumerable: true,
|
|
56
|
-
get: function () { return
|
|
68
|
+
get: function () { return chunkQOCHWR4V_js.formatPriceAdjustment; }
|
|
57
69
|
});
|
|
58
70
|
Object.defineProperty(exports, "formatPriceCompact", {
|
|
59
71
|
enumerable: true,
|
|
60
|
-
get: function () { return
|
|
72
|
+
get: function () { return chunkQOCHWR4V_js.formatPriceCompact; }
|
|
61
73
|
});
|
|
62
74
|
Object.defineProperty(exports, "formatPriceWithTax", {
|
|
63
75
|
enumerable: true,
|
|
64
|
-
get: function () { return
|
|
76
|
+
get: function () { return chunkQOCHWR4V_js.formatPriceWithTax; }
|
|
65
77
|
});
|
|
66
78
|
Object.defineProperty(exports, "formatProductPrice", {
|
|
67
79
|
enumerable: true,
|
|
68
|
-
get: function () { return
|
|
80
|
+
get: function () { return chunkQOCHWR4V_js.formatProductPrice; }
|
|
69
81
|
});
|
|
70
82
|
Object.defineProperty(exports, "getBasePrice", {
|
|
71
83
|
enumerable: true,
|
|
72
|
-
get: function () { return
|
|
84
|
+
get: function () { return chunkQOCHWR4V_js.getBasePrice; }
|
|
73
85
|
});
|
|
74
86
|
Object.defineProperty(exports, "getCurrencySymbol", {
|
|
75
87
|
enumerable: true,
|
|
76
|
-
get: function () { return
|
|
88
|
+
get: function () { return chunkQOCHWR4V_js.getCurrencySymbol; }
|
|
77
89
|
});
|
|
78
90
|
Object.defineProperty(exports, "getDiscountPercentage", {
|
|
79
91
|
enumerable: true,
|
|
80
|
-
get: function () { return
|
|
92
|
+
get: function () { return chunkQOCHWR4V_js.getDiscountPercentage; }
|
|
81
93
|
});
|
|
82
94
|
Object.defineProperty(exports, "getDisplayPrice", {
|
|
83
95
|
enumerable: true,
|
|
84
|
-
get: function () { return
|
|
96
|
+
get: function () { return chunkQOCHWR4V_js.getDisplayPrice; }
|
|
85
97
|
});
|
|
86
98
|
Object.defineProperty(exports, "getMarkupPercentage", {
|
|
87
99
|
enumerable: true,
|
|
88
|
-
get: function () { return
|
|
100
|
+
get: function () { return chunkQOCHWR4V_js.getMarkupPercentage; }
|
|
89
101
|
});
|
|
90
102
|
Object.defineProperty(exports, "getProductCurrency", {
|
|
91
103
|
enumerable: true,
|
|
92
|
-
get: function () { return
|
|
104
|
+
get: function () { return chunkQOCHWR4V_js.getProductCurrency; }
|
|
93
105
|
});
|
|
94
106
|
Object.defineProperty(exports, "getTaxAmount", {
|
|
95
107
|
enumerable: true,
|
|
96
|
-
get: function () { return
|
|
108
|
+
get: function () { return chunkQOCHWR4V_js.getTaxAmount; }
|
|
97
109
|
});
|
|
98
110
|
Object.defineProperty(exports, "hasTaxInfo", {
|
|
99
111
|
enumerable: true,
|
|
100
|
-
get: function () { return
|
|
112
|
+
get: function () { return chunkQOCHWR4V_js.hasTaxInfo; }
|
|
101
113
|
});
|
|
102
114
|
Object.defineProperty(exports, "isOnSale", {
|
|
103
115
|
enumerable: true,
|
|
104
|
-
get: function () { return
|
|
116
|
+
get: function () { return chunkQOCHWR4V_js.isOnSale; }
|
|
105
117
|
});
|
|
106
118
|
Object.defineProperty(exports, "isPaymentStatusFailure", {
|
|
107
119
|
enumerable: true,
|
|
108
|
-
get: function () { return
|
|
120
|
+
get: function () { return chunkQOCHWR4V_js.isPaymentStatusFailure; }
|
|
109
121
|
});
|
|
110
122
|
Object.defineProperty(exports, "isPaymentStatusRequiresAction", {
|
|
111
123
|
enumerable: true,
|
|
112
|
-
get: function () { return
|
|
124
|
+
get: function () { return chunkQOCHWR4V_js.isPaymentStatusRequiresAction; }
|
|
113
125
|
});
|
|
114
126
|
Object.defineProperty(exports, "isPaymentStatusSuccess", {
|
|
115
127
|
enumerable: true,
|
|
116
|
-
get: function () { return
|
|
128
|
+
get: function () { return chunkQOCHWR4V_js.isPaymentStatusSuccess; }
|
|
117
129
|
});
|
|
118
130
|
Object.defineProperty(exports, "isTaxInclusive", {
|
|
119
131
|
enumerable: true,
|
|
120
|
-
get: function () { return
|
|
132
|
+
get: function () { return chunkQOCHWR4V_js.isTaxInclusive; }
|
|
121
133
|
});
|
|
122
134
|
Object.defineProperty(exports, "normalizePaymentResponse", {
|
|
123
135
|
enumerable: true,
|
|
124
|
-
get: function () { return
|
|
136
|
+
get: function () { return chunkQOCHWR4V_js.normalizePaymentResponse; }
|
|
125
137
|
});
|
|
126
138
|
Object.defineProperty(exports, "normalizeStatusResponse", {
|
|
127
139
|
enumerable: true,
|
|
128
|
-
get: function () { return
|
|
140
|
+
get: function () { return chunkQOCHWR4V_js.normalizeStatusResponse; }
|
|
129
141
|
});
|
|
130
142
|
Object.defineProperty(exports, "parsePrice", {
|
|
131
143
|
enumerable: true,
|
|
132
|
-
get: function () { return
|
|
144
|
+
get: function () { return chunkQOCHWR4V_js.parsePrice; }
|
|
133
145
|
});
|
|
134
146
|
Object.defineProperty(exports, "paymentAuthorizationUrl", {
|
|
135
147
|
enumerable: true,
|
|
136
|
-
get: function () { return
|
|
148
|
+
get: function () { return chunkQOCHWR4V_js.paymentAuthorizationUrl; }
|
|
137
149
|
});
|
|
138
150
|
Object.defineProperty(exports, "purchaseIntentMobileMoneyNetwork", {
|
|
139
151
|
enumerable: true,
|
|
140
|
-
get: function () { return
|
|
152
|
+
get: function () { return chunkQOCHWR4V_js.purchaseIntentMobileMoneyNetwork; }
|
|
141
153
|
});
|
package/dist/utils.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { isValidPhoneForContext, normalizePhoneToE164, resolvePhoneCountryCode } from './chunk-WIZRUIZB.mjs';
|
|
2
|
-
export { CURRENCY_SYMBOLS, MOBILE_MONEY_PROVIDERS, canonicalMobileMoneyProvider, categorizePaymentError, detectMobileMoneyProvider, formatMoney, formatNumberCompact, formatPrice, formatPriceAdjustment, formatPriceCompact, formatPriceWithTax, formatProductPrice, getBasePrice, getCurrencySymbol, getDiscountPercentage, getDisplayPrice, getMarkupPercentage, getProductCurrency, getTaxAmount, hasTaxInfo, isOnSale, isPaymentStatusFailure, isPaymentStatusRequiresAction, isPaymentStatusSuccess, isTaxInclusive, normalizePaymentResponse, normalizeStatusResponse, parsePrice, paymentAuthorizationUrl, purchaseIntentMobileMoneyNetwork } from './chunk-
|
|
3
|
-
import './chunk-
|
|
2
|
+
export { CURRENCY_SYMBOLS, MOBILE_MONEY_PROVIDERS, PRICE_UNAVAILABLE_LABEL, canonicalMobileMoneyProvider, categorizePaymentError, currencyFractionDigits, detectMobileMoneyProvider, formatCurrencyAmount, formatMoney, formatNumberCompact, formatPrice, formatPriceAdjustment, formatPriceCompact, formatPriceWithTax, formatProductPrice, getBasePrice, getCurrencySymbol, getDiscountPercentage, getDisplayPrice, getMarkupPercentage, getProductCurrency, getTaxAmount, hasTaxInfo, isOnSale, isPaymentStatusFailure, isPaymentStatusRequiresAction, isPaymentStatusSuccess, isTaxInclusive, normalizePaymentResponse, normalizeStatusResponse, parsePrice, paymentAuthorizationUrl, purchaseIntentMobileMoneyNetwork } from './chunk-B45X3HPO.mjs';
|
|
3
|
+
import './chunk-FT6GFYJL.mjs';
|
|
4
4
|
import './chunk-25T4JHEA.mjs';
|
|
@@ -12,6 +12,15 @@ declare class PartialChunk {
|
|
|
12
12
|
reset(): void;
|
|
13
13
|
join(): Uint8Array;
|
|
14
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* A chunk source that takes the brotli twin of each chunk `caps` names, inflated under its cap, when the upstream
|
|
17
|
+
* serves twins, and the chunk itself when the twin is missing, unusable or wrong.
|
|
18
|
+
*/
|
|
19
|
+
/**
|
|
20
|
+
* Serves the digests `held` names from `local`, checked against the digest, and everything else, or any local
|
|
21
|
+
* failure, from `upstream`.
|
|
22
|
+
*/
|
|
23
|
+
declare function localFirstChunks(local: ChunkSource, held: Promise<ReadonlySet<string>>, upstream: ChunkSource): ChunkSource;
|
|
15
24
|
|
|
16
25
|
declare const PART_STORE_VERSION = 2;
|
|
17
26
|
declare const LEGACY_PART_STORE_VERSION = 1;
|
|
@@ -348,4 +357,4 @@ interface WeaveSession {
|
|
|
348
357
|
declare function openWeaveSession(store: SharedPartStore, game: string, head: WeaveHead, upstream: ChunkSource, old?: WeaveRoot | null, options?: InstallOptions): Promise<WeaveSession>;
|
|
349
358
|
declare function deliverSchedule(session: PartSession, upstream: ChunkSource, schedule: readonly WeaveScheduled[], signal?: AbortSignal): Promise<number>;
|
|
350
359
|
|
|
351
|
-
export { type
|
|
360
|
+
export { type WeaveWalk as $, WEAVE_NODE_ZONE as A, WEAVE_VERSION as B, type ChunkSource as C, DEFAULT_DISK_RESERVE_BYTES as D, type EvictionListener as E, type WeaveChunk as F, type GamePart as G, type WeaveHead as H, type InstallOptions as I, type WeaveHeadChunk as J, KEEP_REASONS as K, type WeaveHeadGroup as L, MemoryPartBackend as M, type WeaveLeaf as N, type WeaveLeafVisitor as O, type PartStoreBackend as P, type WeaveNodeSource as Q, type WeavePlan as R, SharedPartStore as S, WeaveRefusal as T, type WeaveRoot as U, type WeaveRuntimeTag as V, type WeaveTrust as W, type WeaveScheduled as X, type WeaveSession as Y, type WeaveTree as Z, WeaveVerifyError as _, type PartStoreSnapshot as a, type WovenIndex as a0, buildWeave as a1, childDigestAt as a2, chunkWeaveSource as a3, deliverSchedule as a4, leafAt as a5, leafDigest as a6, leafDigestAt as a7, leafFlags as a8, leafLength as a9, leafZone as aa, nodeMatches as ab, openWeaveHead as ac, openWeaveSession as ad, planWeave as ae, storeWeaveSource as af, unweaveIndex as ag, validWeaveRoot as ah, verifyChild as ai, verifyRoot as aj, walkWeave as ak, weaveHeadMessage as al, weaveNodeCount as am, weaveNodeLevel as an, weaveNodeValid as ao, weaveParts as ap, woven as aq, type PartStoreOptions as b, type PartStoreDisk as c, DEFAULT_KEPT_BUDGET_BYTES as d, DEFAULT_PART_STORE_BUDGET_BYTES as e, DEFAULT_PART_ZONE as f, type EvictionReason as g, type KeepReason as h, type PartEviction as i, PartSession as j, type PartStoreStats as k, PartVerifyError as l, localFirstChunks as m, type PackageWeaveRef as n, WEAVE_BOUNDARY_MASK as o, WEAVE_CHILD_ENTRY_BYTES as p, WEAVE_HEAD_DOMAIN as q, WEAVE_LEAF_DECORATED as r, WEAVE_LEAF_ENTRY_BYTES as s, WEAVE_LEAF_TWINNED as t, WEAVE_MAX_HEIGHT as u, WEAVE_MAX_NODE_BYTES as v, WEAVE_MAX_NODE_ENTRIES as w, WEAVE_MIN_NODE_ENTRIES as x, WEAVE_NODE_HEADER_BYTES as y, WEAVE_NODE_MAGIC as z };
|
|
@@ -12,6 +12,15 @@ declare class PartialChunk {
|
|
|
12
12
|
reset(): void;
|
|
13
13
|
join(): Uint8Array;
|
|
14
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* A chunk source that takes the brotli twin of each chunk `caps` names, inflated under its cap, when the upstream
|
|
17
|
+
* serves twins, and the chunk itself when the twin is missing, unusable or wrong.
|
|
18
|
+
*/
|
|
19
|
+
/**
|
|
20
|
+
* Serves the digests `held` names from `local`, checked against the digest, and everything else, or any local
|
|
21
|
+
* failure, from `upstream`.
|
|
22
|
+
*/
|
|
23
|
+
declare function localFirstChunks(local: ChunkSource, held: Promise<ReadonlySet<string>>, upstream: ChunkSource): ChunkSource;
|
|
15
24
|
|
|
16
25
|
declare const PART_STORE_VERSION = 2;
|
|
17
26
|
declare const LEGACY_PART_STORE_VERSION = 1;
|
|
@@ -348,4 +357,4 @@ interface WeaveSession {
|
|
|
348
357
|
declare function openWeaveSession(store: SharedPartStore, game: string, head: WeaveHead, upstream: ChunkSource, old?: WeaveRoot | null, options?: InstallOptions): Promise<WeaveSession>;
|
|
349
358
|
declare function deliverSchedule(session: PartSession, upstream: ChunkSource, schedule: readonly WeaveScheduled[], signal?: AbortSignal): Promise<number>;
|
|
350
359
|
|
|
351
|
-
export { type
|
|
360
|
+
export { type WeaveWalk as $, WEAVE_NODE_ZONE as A, WEAVE_VERSION as B, type ChunkSource as C, DEFAULT_DISK_RESERVE_BYTES as D, type EvictionListener as E, type WeaveChunk as F, type GamePart as G, type WeaveHead as H, type InstallOptions as I, type WeaveHeadChunk as J, KEEP_REASONS as K, type WeaveHeadGroup as L, MemoryPartBackend as M, type WeaveLeaf as N, type WeaveLeafVisitor as O, type PartStoreBackend as P, type WeaveNodeSource as Q, type WeavePlan as R, SharedPartStore as S, WeaveRefusal as T, type WeaveRoot as U, type WeaveRuntimeTag as V, type WeaveTrust as W, type WeaveScheduled as X, type WeaveSession as Y, type WeaveTree as Z, WeaveVerifyError as _, type PartStoreSnapshot as a, type WovenIndex as a0, buildWeave as a1, childDigestAt as a2, chunkWeaveSource as a3, deliverSchedule as a4, leafAt as a5, leafDigest as a6, leafDigestAt as a7, leafFlags as a8, leafLength as a9, leafZone as aa, nodeMatches as ab, openWeaveHead as ac, openWeaveSession as ad, planWeave as ae, storeWeaveSource as af, unweaveIndex as ag, validWeaveRoot as ah, verifyChild as ai, verifyRoot as aj, walkWeave as ak, weaveHeadMessage as al, weaveNodeCount as am, weaveNodeLevel as an, weaveNodeValid as ao, weaveParts as ap, woven as aq, type PartStoreOptions as b, type PartStoreDisk as c, DEFAULT_KEPT_BUDGET_BYTES as d, DEFAULT_PART_STORE_BUDGET_BYTES as e, DEFAULT_PART_ZONE as f, type EvictionReason as g, type KeepReason as h, type PartEviction as i, PartSession as j, type PartStoreStats as k, PartVerifyError as l, localFirstChunks as m, type PackageWeaveRef as n, WEAVE_BOUNDARY_MASK as o, WEAVE_CHILD_ENTRY_BYTES as p, WEAVE_HEAD_DOMAIN as q, WEAVE_LEAF_DECORATED as r, WEAVE_LEAF_ENTRY_BYTES as s, WEAVE_LEAF_TWINNED as t, WEAVE_MAX_HEIGHT as u, WEAVE_MAX_NODE_BYTES as v, WEAVE_MAX_NODE_ENTRIES as w, WEAVE_MIN_NODE_ENTRIES as x, WEAVE_NODE_HEADER_BYTES as y, WEAVE_NODE_MAGIC as z };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { a1 as ConsentKind, a2 as ReportTarget, a3 as ReportReason, a4 as MediaRef, w as ProgramInfo, a5 as ResponseEnvelope, a6 as ReplayMode, b as UiNode, x as LocaleInfo, a7 as SocialPostResult, a8 as ShareResult, M as UiEvent } from './local-
|
|
2
|
-
import {
|
|
3
|
-
import { D as DeviceTier, aJ as GPU_PASS_NAMES } from './backend-
|
|
4
|
-
import { I as InspectorReadout } from './world-
|
|
5
|
-
import { G as Game } from './game-
|
|
1
|
+
import { a1 as ConsentKind, a2 as ReportTarget, a3 as ReportReason, a4 as MediaRef, w as ProgramInfo, a5 as ResponseEnvelope, a6 as ReplayMode, b as UiNode, x as LocaleInfo, a7 as SocialPostResult, a8 as ShareResult, M as UiEvent } from './local-VZkqsCzR.js';
|
|
2
|
+
import { bf as WarmImage, be as ClipFailureCode, aK as UiCommand, ab as MessageListener, O as GuestFault, M as MilestoneName, aA as SessionCompleteMessage, J as FrameMark, a4 as LifecycleName, V as HotSwapResult } from './guest-wIdfoT05.js';
|
|
3
|
+
import { D as DeviceTier, aJ as GPU_PASS_NAMES } from './backend-gUCzs5Kg.js';
|
|
4
|
+
import { I as InspectorReadout } from './world-PvILHDR1.js';
|
|
5
|
+
import { G as Game } from './game-fgQy2YIm.js';
|
|
6
6
|
import { a as StudioMessage, b as StudioOutgoing } from './studio-CowqWqez.js';
|
|
7
|
-
import { c as TreePatch } from './tree-
|
|
8
|
-
import { C as ChunkSource, S as SharedPartStore,
|
|
7
|
+
import { c as TreePatch } from './tree-CP_qSW4H.js';
|
|
8
|
+
import { C as ChunkSource, S as SharedPartStore, n as PackageWeaveRef } from './weave-delivery-CW-Kstut.js';
|
|
9
9
|
import { N as NetworkHint } from './network-ZXLD7l1b.js';
|
|
10
10
|
|
|
11
11
|
interface DeviceRun {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { a1 as ConsentKind, a2 as ReportTarget, a3 as ReportReason, a4 as MediaRef, w as ProgramInfo, a5 as ResponseEnvelope, a6 as ReplayMode, b as UiNode, x as LocaleInfo, a7 as SocialPostResult, a8 as ShareResult, M as UiEvent } from './local-
|
|
2
|
-
import {
|
|
3
|
-
import { D as DeviceTier, aJ as GPU_PASS_NAMES } from './backend-
|
|
4
|
-
import { I as InspectorReadout } from './world-
|
|
5
|
-
import { G as Game } from './game-
|
|
1
|
+
import { a1 as ConsentKind, a2 as ReportTarget, a3 as ReportReason, a4 as MediaRef, w as ProgramInfo, a5 as ResponseEnvelope, a6 as ReplayMode, b as UiNode, x as LocaleInfo, a7 as SocialPostResult, a8 as ShareResult, M as UiEvent } from './local-D8_I6UeL.mjs';
|
|
2
|
+
import { bf as WarmImage, be as ClipFailureCode, aK as UiCommand, ab as MessageListener, O as GuestFault, M as MilestoneName, aA as SessionCompleteMessage, J as FrameMark, a4 as LifecycleName, V as HotSwapResult } from './guest-DrsA00XD.mjs';
|
|
3
|
+
import { D as DeviceTier, aJ as GPU_PASS_NAMES } from './backend-gUCzs5Kg.mjs';
|
|
4
|
+
import { I as InspectorReadout } from './world-qekkXjJv.mjs';
|
|
5
|
+
import { G as Game } from './game-Bx8onkhX.mjs';
|
|
6
6
|
import { a as StudioMessage, b as StudioOutgoing } from './studio-CowqWqez.mjs';
|
|
7
|
-
import { c as TreePatch } from './tree-
|
|
8
|
-
import { C as ChunkSource, S as SharedPartStore,
|
|
7
|
+
import { c as TreePatch } from './tree-C-Io2Hbx.mjs';
|
|
8
|
+
import { C as ChunkSource, S as SharedPartStore, n as PackageWeaveRef } from './weave-delivery-CW-Kstut.mjs';
|
|
9
9
|
import { N as NetworkHint } from './network-ZXLD7l1b.mjs';
|
|
10
10
|
|
|
11
11
|
interface DeviceRun {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { F as FluidMaterial } from './fluid-
|
|
2
|
-
import { D as DeviceTier } from './backend-
|
|
3
|
-
import { I as WorldLayer, d as CrowdCaps, H as WorldDoc } from './types-
|
|
1
|
+
import { F as FluidMaterial } from './fluid-ARr0qUIL.js';
|
|
2
|
+
import { D as DeviceTier } from './backend-gUCzs5Kg.js';
|
|
3
|
+
import { I as WorldLayer, d as CrowdCaps, H as WorldDoc } from './types-D_f6UUxM.js';
|
|
4
4
|
|
|
5
5
|
type ThingBreak = "never" | "dents" | "shatters" | "splinters" | "tears";
|
|
6
6
|
interface ThingLook {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { F as FluidMaterial } from './fluid-
|
|
2
|
-
import { D as DeviceTier } from './backend-
|
|
3
|
-
import { I as WorldLayer, d as CrowdCaps, H as WorldDoc } from './types-
|
|
1
|
+
import { F as FluidMaterial } from './fluid-DLlEj2cs.mjs';
|
|
2
|
+
import { D as DeviceTier } from './backend-gUCzs5Kg.mjs';
|
|
3
|
+
import { I as WorldLayer, d as CrowdCaps, H as WorldDoc } from './types-BQkxPwZP.mjs';
|
|
4
4
|
|
|
5
5
|
type ThingBreak = "never" | "dents" | "shatters" | "splinters" | "tears";
|
|
6
6
|
interface ThingLook {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { G as Game } from './game-
|
|
2
|
-
import { G as GameScene } from './fluid-
|
|
3
|
-
import { h as GenreTemplate } from './template-
|
|
1
|
+
import { G as Game } from './game-Bx8onkhX.mjs';
|
|
2
|
+
import { G as GameScene } from './fluid-DLlEj2cs.mjs';
|
|
3
|
+
import { h as GenreTemplate } from './template-AhCdB1kW.mjs';
|
|
4
4
|
|
|
5
5
|
declare const WORD: {
|
|
6
6
|
readonly length: 5;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { G as Game } from './game-
|
|
2
|
-
import { G as GameScene } from './fluid-
|
|
3
|
-
import { h as GenreTemplate } from './template-
|
|
1
|
+
import { G as Game } from './game-fgQy2YIm.js';
|
|
2
|
+
import { G as GameScene } from './fluid-ARr0qUIL.js';
|
|
3
|
+
import { h as GenreTemplate } from './template-BkEGVTQj.js';
|
|
4
4
|
|
|
5
5
|
declare const WORD: {
|
|
6
6
|
readonly length: 5;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { aL as NavPort, aM as NavDesc, aN as OffMeshLinkDesc, f as Vec3Like, aO as AgentDesc, aP as RoadGraphDesc, aQ as DriverDesc, F as FrameTime, aR as RayQuery, aS as RayHit, aT as SoaEngine,
|
|
1
|
+
import { aL as NavPort, aM as NavDesc, aN as OffMeshLinkDesc, f as Vec3Like, aO as AgentDesc, aP as RoadGraphDesc, aQ as DriverDesc, F as FrameTime, aR as RayQuery, aS as RayHit, aT as SoaEngine, a9 as PickHit, aU as SoaBulkExports, aV as ShapeCastQuery, aW as RollbackState, aX as Scalar, aY as ArrayFor, aZ as ComponentMemory, a_ as TransformColumns, a$ as TransformPort, aw as Quat, V as Vec3, b0 as CurveTable, b1 as SoftBodyPort, i as GeometryId, b2 as SoftBodyInfo, b3 as CraftPort, b4 as WaterDesc, b5 as SeaState, b6 as OceanDesc, b7 as OceanCascades, b8 as PuddleOptions, b9 as RippleOptions, ba as WaterSample, bb as ColliderDesc, bc as PhysicsPort, bd as WorldRollbackDesc, be as SolverSettings, bf as SleepThresholds, bg as WorldSnapshots, bh as BodyDesc, bi as JointPort, bj as RagdollDesc, bk as Ragdoll, bl as JointDesc, bm as ContactRuleDesc, bn as CharacterControllerDesc, bo as CharacterMove, au as VehicleDesc, av as Vehicle, bp as WorldStreamingPort, j as MaterialId, D as DeviceTier, bq as KernelEngine } from './backend-gUCzs5Kg.js';
|
|
2
2
|
import { K as KernelMeta } from './library-DXYaMFhi.js';
|
|
3
3
|
|
|
4
4
|
type ColumnArray = Float32Array | Int32Array | Uint32Array | Uint8Array;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { aL as NavPort, aM as NavDesc, aN as OffMeshLinkDesc, f as Vec3Like, aO as AgentDesc, aP as RoadGraphDesc, aQ as DriverDesc, F as FrameTime, aR as RayQuery, aS as RayHit, aT as SoaEngine,
|
|
1
|
+
import { aL as NavPort, aM as NavDesc, aN as OffMeshLinkDesc, f as Vec3Like, aO as AgentDesc, aP as RoadGraphDesc, aQ as DriverDesc, F as FrameTime, aR as RayQuery, aS as RayHit, aT as SoaEngine, a9 as PickHit, aU as SoaBulkExports, aV as ShapeCastQuery, aW as RollbackState, aX as Scalar, aY as ArrayFor, aZ as ComponentMemory, a_ as TransformColumns, a$ as TransformPort, aw as Quat, V as Vec3, b0 as CurveTable, b1 as SoftBodyPort, i as GeometryId, b2 as SoftBodyInfo, b3 as CraftPort, b4 as WaterDesc, b5 as SeaState, b6 as OceanDesc, b7 as OceanCascades, b8 as PuddleOptions, b9 as RippleOptions, ba as WaterSample, bb as ColliderDesc, bc as PhysicsPort, bd as WorldRollbackDesc, be as SolverSettings, bf as SleepThresholds, bg as WorldSnapshots, bh as BodyDesc, bi as JointPort, bj as RagdollDesc, bk as Ragdoll, bl as JointDesc, bm as ContactRuleDesc, bn as CharacterControllerDesc, bo as CharacterMove, au as VehicleDesc, av as Vehicle, bp as WorldStreamingPort, j as MaterialId, D as DeviceTier, bq as KernelEngine } from './backend-gUCzs5Kg.mjs';
|
|
2
2
|
import { K as KernelMeta } from './library-DXYaMFhi.mjs';
|
|
3
3
|
|
|
4
4
|
type ColumnArray = Float32Array | Int32Array | Uint32Array | Uint8Array;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { C as Ctx, B as CtxRequest } from './local-
|
|
2
|
-
import { F as WorldMirror, h as LocalWorld, y as WorldBuilder, B as WorldConnection } from './online-
|
|
3
|
-
import { G as Game,
|
|
4
|
-
import { G as GameScene } from './fluid-
|
|
5
|
-
import { bs as ThirdPersonRig } from './play-
|
|
6
|
-
import { h as GenreTemplate } from './template-
|
|
1
|
+
import { C as Ctx, B as CtxRequest } from './local-VZkqsCzR.js';
|
|
2
|
+
import { F as WorldMirror, h as LocalWorld, y as WorldBuilder, B as WorldConnection } from './online-XeymeM9s.js';
|
|
3
|
+
import { G as Game, aS as UiActionId } from './game-fgQy2YIm.js';
|
|
4
|
+
import { G as GameScene } from './fluid-ARr0qUIL.js';
|
|
5
|
+
import { bs as ThirdPersonRig } from './play-BRRlfLhX.js';
|
|
6
|
+
import { h as GenreTemplate } from './template-BkEGVTQj.js';
|
|
7
7
|
|
|
8
8
|
declare const WORLDS: {
|
|
9
9
|
readonly plazaHalf: 40;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { C as Ctx, B as CtxRequest } from './local-
|
|
2
|
-
import { F as WorldMirror, h as LocalWorld, y as WorldBuilder, B as WorldConnection } from './online-
|
|
3
|
-
import { G as Game,
|
|
4
|
-
import { G as GameScene } from './fluid-
|
|
5
|
-
import { bs as ThirdPersonRig } from './play-
|
|
6
|
-
import { h as GenreTemplate } from './template-
|
|
1
|
+
import { C as Ctx, B as CtxRequest } from './local-D8_I6UeL.mjs';
|
|
2
|
+
import { F as WorldMirror, h as LocalWorld, y as WorldBuilder, B as WorldConnection } from './online-d7W_Al9a.mjs';
|
|
3
|
+
import { G as Game, aS as UiActionId } from './game-Bx8onkhX.mjs';
|
|
4
|
+
import { G as GameScene } from './fluid-DLlEj2cs.mjs';
|
|
5
|
+
import { bs as ThirdPersonRig } from './play-ClrMd_e8.mjs';
|
|
6
|
+
import { h as GenreTemplate } from './template-AhCdB1kW.mjs';
|
|
7
7
|
|
|
8
8
|
declare const WORLDS: {
|
|
9
9
|
readonly plazaHalf: 40;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cimplify/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.111.0",
|
|
4
4
|
"description": "Cimplify Commerce SDK for storefronts",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cimplify",
|
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
"registry",
|
|
19
19
|
"engines",
|
|
20
20
|
"vendor/rapier3d-compat/LICENSE",
|
|
21
|
-
"vendor/rapier3d-compat/PATCHES.md"
|
|
21
|
+
"vendor/rapier3d-compat/PATCHES.md",
|
|
22
|
+
"CHANGELOG.md"
|
|
22
23
|
],
|
|
23
24
|
"main": "./dist/index.js",
|
|
24
25
|
"module": "./dist/index.mjs",
|
|
@@ -259,7 +260,8 @@
|
|
|
259
260
|
"build": "bun run build:engine-arity && bun run build:mock-assets && NODE_OPTIONS=--max-old-space-size=12288 tsup && bun run build:lint-rules && bun run build:css && bun run build:registry",
|
|
260
261
|
"build:engine-arity": "bun run scripts/build-engine-arity.ts",
|
|
261
262
|
"build:delivery-wasm": "bun scripts/build-delivery-wasm.ts",
|
|
262
|
-
"prepublishOnly": "bun run build",
|
|
263
|
+
"prepublishOnly": "bun run check:money-hazards && bun run build",
|
|
264
|
+
"check:money-hazards": "bun ../../scripts/check-client-money-hazards.ts --root src --baseline scripts/money-hazards-baseline.json",
|
|
263
265
|
"prepack": "bun run guard:pack",
|
|
264
266
|
"guard:pack": "bun run scripts/guard-pack.ts",
|
|
265
267
|
"build:mock-assets": "bun run scripts/build-mock-assets.ts",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"files": [
|
|
11
11
|
{
|
|
12
12
|
"path": "cart-summary.tsx",
|
|
13
|
-
"content": "\"use client\";\n\nimport React from \"react\";\nimport type { UseCartItem } from \"@cimplify/sdk/react\";\nimport type { DisplayCart } from \"@cimplify/sdk\";\nimport { useCart } from \"@cimplify/sdk/react\";\nimport { getVariantDisplayName } from \"@cimplify/sdk\";\nimport { INPUT_FIELD_TYPE } from \"@cimplify/sdk\";\nimport { currencyCode, type CurrencyCode } from \"@cimplify/sdk\";\nimport { parsePrice } from \"@cimplify/sdk\";\nimport { Price } from \"@cimplify/sdk/react\";\nimport { QuantitySelector } from \"@cimplify/sdk/react\";\nimport { useProductPrice } from \"@cimplify/sdk/react\";\nimport type { InternalUseCartItem } from \"./hooks/use-cart-types\";\nimport { cn } from \"@cimplify/sdk/react\";\n\nexport interface CartSummaryClassNames {\n root?: string;\n item?: string;\n itemName?: string;\n itemPrice?: string;\n quantity?: string;\n removeButton?: string;\n totals?: string;\n subtotal?: string;\n tax?: string;\n deliveryFee?: string;\n serviceCharge?: string;\n discount?: string;\n total?: string;\n checkout?: string;\n empty?: string;\n serviceInfo?: string;\n digitalInfo?: string;\n bundleBreakdown?: string;\n compositeBreakdown?: string;\n customerInputs?: string;\n}\n\nexport interface CartSummaryProps {\n /** Optional server cart for extended pricing details (delivery fee, service charge, discounts). */\n cart?: DisplayCart;\n onCheckout?: () => void;\n onItemRemove?: (itemId: string) => void;\n onQuantityChange?: (itemId: string, quantity: number) => void;\n emptyMessage?: string;\n /** Render the totals block (subtotal/tax/total) below the items. Default true. Hosts that show their own totals (drawer, page sidebar) should pass false. */\n showTotals?: boolean;\n /** Render the \"Proceed to Checkout\" button. Defaults to true if `onCheckout` is provided. */\n showCheckoutButton?: boolean;\n className?: string;\n classNames?: CartSummaryClassNames;\n}\n\nfunction CartLineItemRow({\n item,\n onRemove,\n onQuantityChange,\n currency,\n classNames,\n}: {\n item: UseCartItem;\n onRemove: (itemId: string) => void;\n onQuantityChange: (itemId: string, qty: number) => void;\n currency: CurrencyCode;\n classNames?: CartSummaryClassNames;\n}): React.ReactElement {\n const { unitPrice: locallyResolvedUnitPrice } = useProductPrice({\n product: item.product,\n variant: item.variant,\n addOnOptions: item.addOnOptions,\n });\n const pinnedUnitPrice = (item as InternalUseCartItem)._quotedUnitPrice;\n const unitPrice =\n pinnedUnitPrice === undefined ? locallyResolvedUnitPrice : parsePrice(pinnedUnitPrice);\n const hasComposite = item.compositeSelections && item.compositeSelections.length > 0;\n const hasBundle = item.bundleSelections && item.bundleSelections.length > 0;\n\n const isOptimistic = (item as { isOptimistic?: boolean }).isOptimistic === true;\n\n const lineTotal = parsePrice(unitPrice) * item.quantity;\n const imageUrl = item.product.image_url;\n const variantLabel = item.variant ? getVariantDisplayName(item.variant, item.product.name) : null;\n\n return (\n <div\n data-cimplify-cart-item\n data-optimistic={isOptimistic ? \"true\" : undefined}\n className={cn(\n \"group relative flex gap-3 py-4 border-b border-border last:border-b-0 transition-opacity\",\n isOptimistic && \"opacity-60\",\n classNames?.item,\n )}\n >\n {/* Thumbnail */}\n <div\n data-cimplify-cart-item-image\n className=\"relative w-20 h-20 shrink-0 rounded-md overflow-hidden bg-muted\"\n >\n {imageUrl ? (\n <img src={imageUrl} alt=\"\" className=\"w-full h-full object-cover\" loading=\"lazy\" />\n ) : (\n <div className=\"w-full h-full grid place-items-center text-muted-foreground/40\">\n <svg\n className=\"w-6 h-6\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n viewBox=\"0 0 24 24\"\n aria-hidden\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M2.25 15.75l5.159-5.159a2.25 2.25 0 013.182 0l5.159 5.159m-1.5-1.5l1.409-1.409a2.25 2.25 0 013.182 0l2.909 2.909m-18 3.75h16.5a1.5 1.5 0 001.5-1.5V6a1.5 1.5 0 00-1.5-1.5H3.75A1.5 1.5 0 002.25 6v12a1.5 1.5 0 001.5 1.5zm10.5-11.25h.008v.008h-.008V8.25zm.375 0a.375.375 0 11-.75 0 .375.375 0 01.75 0z\"\n />\n </svg>\n </div>\n )}\n </div>\n\n {/* Info column */}\n <div data-cimplify-cart-item-info className=\"flex-1 min-w-0 flex flex-col\">\n <div className=\"flex items-start justify-between gap-3\">\n <h3\n data-cimplify-cart-item-name\n className={cn(\"text-sm font-medium leading-tight m-0 truncate\", classNames?.itemName)}\n >\n {item.product.name}\n </h3>\n <button\n type=\"button\"\n onClick={() => onRemove(item.id)}\n data-cimplify-cart-item-remove\n className={cn(\n \"shrink-0 -mr-1 -mt-1 grid place-items-center w-7 h-7 rounded-full text-muted-foreground/60 hover:text-foreground hover:bg-muted transition-colors\",\n classNames?.removeButton,\n )}\n aria-label={`Remove ${item.product.name}`}\n >\n <svg\n className=\"w-3.5 h-3.5\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n viewBox=\"0 0 24 24\"\n aria-hidden\n >\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M6 18L18 6M6 6l12 12\" />\n </svg>\n </button>\n </div>\n\n {/* Pills row: variant, add-ons, badges */}\n {(variantLabel ||\n (item.addOnOptions && item.addOnOptions.length > 0) ||\n hasComposite ||\n hasBundle) && (\n <div data-cimplify-cart-item-pills className=\"flex flex-wrap gap-1.5 mt-1.5\">\n {variantLabel && (\n <span\n data-cimplify-cart-item-variant\n className=\"inline-flex items-center px-2 py-0.5 rounded-full bg-muted text-[11px] font-medium text-foreground\"\n >\n {variantLabel}\n </span>\n )}\n {item.addOnOptions?.map((opt) => (\n <span\n key={opt.id}\n data-cimplify-cart-item-addon\n className=\"inline-flex items-center px-2 py-0.5 rounded-full bg-muted text-[11px] font-medium text-muted-foreground\"\n >\n + {opt.name}\n </span>\n ))}\n {(hasComposite || hasBundle) && (\n <span\n data-cimplify-cart-item-badge\n className=\"inline-flex items-center px-2 py-0.5 rounded-full bg-primary/10 text-[11px] font-semibold uppercase tracking-wider text-primary\"\n >\n {hasComposite ? \"Custom\" : \"Bundle\"}\n </span>\n )}\n </div>\n )}\n\n {/* Special instructions */}\n {item.specialInstructions && (\n <p\n data-cimplify-cart-item-instructions\n className=\"mt-1.5 text-xs italic text-muted-foreground line-clamp-2\"\n >\n \\u201C{item.specialInstructions}\\u201D\n </p>\n )}\n\n {/* Customer input values */}\n {item.customerInputs && item.customerInputs.length > 0 && (\n <dl\n data-cimplify-cart-customer-inputs\n className={cn(\"mt-1.5 text-xs space-y-0.5\", classNames?.customerInputs)}\n >\n {item.customerInputs.map((input) => (\n <div key={input.field_id} data-cimplify-cart-input className=\"flex gap-1.5\">\n <dt data-cimplify-cart-input-label className=\"text-muted-foreground\">\n {input.field_name}:\n </dt>\n <dd data-cimplify-cart-input-value className=\"text-foreground m-0 truncate\">\n {input.field_type === INPUT_FIELD_TYPE.File ||\n input.field_type === INPUT_FIELD_TYPE.Image\n ? String(input.value).split(\"/\").pop() || \"Uploaded file\"\n : String(input.value)}\n </dd>\n </div>\n ))}\n </dl>\n )}\n\n {/* Service: scheduled details */}\n {(item.lineType === \"service\" || item.product.type === \"service\") &&\n item.scheduledStart && (\n <div\n data-cimplify-cart-service-info\n className={cn(\n \"mt-1.5 flex items-center gap-1.5 text-xs text-muted-foreground\",\n classNames?.serviceInfo,\n )}\n >\n <svg\n className=\"w-3.5 h-3.5 shrink-0\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n viewBox=\"0 0 24 24\"\n aria-hidden\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z\"\n />\n </svg>\n <span>\n {new Date(item.scheduledStart).toLocaleDateString(undefined, {\n month: \"short\",\n day: \"numeric\",\n })}{\" \"}\n at{\" \"}\n {new Date(item.scheduledStart).toLocaleTimeString([], {\n hour: \"2-digit\",\n minute: \"2-digit\",\n })}\n </span>\n {item.serviceStatus && (\n <span\n data-status={item.serviceStatus}\n className=\"ml-auto px-1.5 py-0.5 rounded-full bg-muted text-[10px] uppercase tracking-wider\"\n >\n {item.serviceStatus}\n </span>\n )}\n </div>\n )}\n\n {/* Digital: instant-delivery badge */}\n {(item.lineType === \"digital\" || item.product.type === \"digital\") && (\n <div\n data-cimplify-cart-digital-info\n className={cn(\n \"mt-1.5 flex items-center gap-1 text-xs text-muted-foreground\",\n classNames?.digitalInfo,\n )}\n >\n <svg\n className=\"w-3.5 h-3.5 shrink-0\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n viewBox=\"0 0 24 24\"\n aria-hidden\n >\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M13 10V3L4 14h7v7l9-11h-7z\" />\n </svg>\n <span>Instant digital delivery</span>\n </div>\n )}\n\n {/* Bundle / composite component breakdown */}\n {(item.bundleResolved || item.compositeResolved) && (\n <ul\n data-cimplify-cart-composite-breakdown={item.compositeResolved ? \"\" : undefined}\n data-cimplify-cart-bundle-breakdown={item.bundleResolved ? \"\" : undefined}\n className={cn(\n \"mt-1.5 pl-3 border-l border-border space-y-0.5 text-xs text-muted-foreground\",\n item.compositeResolved ? classNames?.compositeBreakdown : classNames?.bundleBreakdown,\n )}\n >\n {(\n (item.bundleResolved?.selections ??\n item.compositeResolved?.selections ??\n []) as Array<{\n component_id?: string;\n product_name?: string;\n component_name?: string;\n quantity: number;\n product_type?: string;\n }>\n ).map((sel) => {\n const name = sel.product_name ?? sel.component_name ?? \"\";\n const compId = sel.component_id ?? `${name}-${sel.quantity}`;\n return (\n <li\n key={compId}\n data-product-type={sel.product_type}\n className=\"flex items-baseline gap-1.5 m-0\"\n >\n <span className=\"font-medium text-foreground/80\">{sel.quantity}\\u00D7</span>\n <span className=\"truncate\">{name}</span>\n </li>\n );\n })}\n </ul>\n )}\n\n {/* Bottom row: line price + qty stepper */}\n <div className=\"mt-3 flex items-center justify-between gap-3\">\n <Price\n amount={lineTotal}\n currency={currency}\n className={cn(\"text-sm font-semibold tabular-nums\", classNames?.itemPrice)}\n />\n <div data-cimplify-cart-item-controls className={classNames?.quantity}>\n <QuantitySelector\n value={item.quantity}\n onChange={(qty) => onQuantityChange(item.id, qty)}\n min={0}\n />\n </div>\n </div>\n </div>\n </div>\n );\n}\n\n/**\n * CartSummary — renders cart line items + totals.\n *\n * NOT a drawer or modal — just the cart content. Templates wrap this in\n * their own drawer/modal shell with animations.\n */\nexport function CartSummary({\n cart: serverCart,\n onCheckout,\n onItemRemove,\n onQuantityChange,\n emptyMessage = \"Your cart is empty\",\n showTotals = true,\n showCheckoutButton,\n className,\n classNames,\n}: CartSummaryProps): React.ReactElement {\n const {\n items,\n itemCount,\n subtotal,\n tax,\n taxRate,\n taxInclusive,\n taxJurisdictionLabel,\n total,\n isEmpty,\n isOptimistic,\n pendingOpCount,\n currency,\n removeItem,\n updateQuantity,\n } = useCart();\n const displayCurrency = serverCart?.currency ?? currencyCode(currency);\n\n const deliveryFee = serverCart?.delivery_fee;\n const serviceCharge = serverCart?.service_charge;\n const totalDiscounts = serverCart?.total_discounts;\n\n const handleRemove = (itemId: string) => {\n if (onItemRemove) {\n onItemRemove(itemId);\n } else {\n void removeItem(itemId);\n }\n };\n\n const handleQuantityChange = (itemId: string, qty: number) => {\n if (onQuantityChange) {\n onQuantityChange(itemId, qty);\n } else {\n void updateQuantity(itemId, qty);\n }\n };\n\n return (\n <div\n data-cimplify-cart-summary\n data-optimistic={isOptimistic ? \"true\" : undefined}\n data-pending-ops={pendingOpCount > 0 ? pendingOpCount : undefined}\n className={cn(className, classNames?.root)}\n >\n {isEmpty ? (\n <div data-cimplify-cart-empty className={classNames?.empty}>\n <p>{emptyMessage}</p>\n </div>\n ) : (\n <>\n {/* Line items */}\n <div data-cimplify-cart-items>\n {items.map((item) => (\n <CartLineItemRow\n key={item.id}\n item={item}\n onRemove={handleRemove}\n onQuantityChange={handleQuantityChange}\n currency={displayCurrency}\n classNames={classNames}\n />\n ))}\n </div>\n\n {/* Totals */}\n {showTotals && (\n <div\n data-cimplify-cart-totals\n className={cn(\n \"mt-6 pt-4 border-t border-border space-y-2 text-sm\",\n classNames?.totals,\n )}\n >\n <div\n data-cimplify-cart-subtotal\n className={cn(\"flex items-baseline justify-between\", classNames?.subtotal)}\n >\n <span className=\"text-muted-foreground\">\n Subtotal ({itemCount} {itemCount === 1 ? \"item\" : \"items\"})\n </span>\n <Price amount={subtotal} currency={displayCurrency} className=\"tabular-nums\" />\n </div>\n\n {totalDiscounts != null && parsePrice(totalDiscounts) > 0 && (\n <div\n data-cimplify-cart-discount\n className={cn(\"flex items-baseline justify-between\", classNames?.discount)}\n >\n <span className=\"text-muted-foreground\">Discount</span>\n <Price\n amount={totalDiscounts}\n currency={displayCurrency}\n prefix=\"-\"\n className=\"tabular-nums text-primary\"\n />\n </div>\n )}\n\n {deliveryFee != null && (\n <div\n data-cimplify-cart-delivery-fee\n className={cn(\"flex items-baseline justify-between\", classNames?.deliveryFee)}\n >\n <span className=\"text-muted-foreground\">Delivery</span>\n {parsePrice(deliveryFee) > 0 ? (\n <Price\n amount={deliveryFee}\n currency={displayCurrency}\n className=\"tabular-nums\"\n />\n ) : (\n <span className=\"font-medium text-primary\">Free</span>\n )}\n </div>\n )}\n\n {serviceCharge != null && parsePrice(serviceCharge) > 0 && (\n <div\n data-cimplify-cart-service-charge\n className={cn(\"flex items-baseline justify-between\", classNames?.serviceCharge)}\n >\n <span className=\"text-muted-foreground\">Service charge</span>\n <Price\n amount={serviceCharge}\n currency={displayCurrency}\n className=\"tabular-nums\"\n />\n </div>\n )}\n\n <div\n data-cimplify-cart-tax\n className={cn(\"flex items-baseline justify-between\", classNames?.tax)}\n >\n <span className=\"flex items-baseline gap-1.5 text-muted-foreground\">\n {taxInclusive\n ? \"Tax, included in prices\"\n : taxJurisdictionLabel\n ? `Sales tax, ${taxJurisdictionLabel}`\n : \"Sales tax\"}\n {taxRate != null && taxRate > 0 && (\n <span className=\"rounded-full bg-muted px-1.5 py-0.5 text-[11px] font-medium\">\n {taxRate}%\n </span>\n )}\n </span>\n <Price amount={tax} currency={displayCurrency} className=\"tabular-nums\" />\n </div>\n\n <div\n data-cimplify-cart-total\n className={cn(\n \"flex items-baseline justify-between pt-3 mt-1 border-t border-border\",\n classNames?.total,\n )}\n >\n <span className=\"font-semibold\">Total</span>\n <Price\n amount={total}\n currency={displayCurrency}\n className=\"text-base font-bold tabular-nums\"\n />\n </div>\n </div>\n )}\n\n {(showCheckoutButton ?? Boolean(onCheckout)) && onCheckout && (\n <button\n type=\"button\"\n onClick={onCheckout}\n data-cimplify-cart-checkout\n className={cn(\n \"mt-4 w-full h-12 rounded-full bg-foreground text-background font-semibold text-sm hover:bg-foreground/90 active:scale-[0.99] transition-all\",\n classNames?.checkout,\n )}\n >\n Proceed to Checkout\n </button>\n )}\n </>\n )}\n </div>\n );\n}\n"
|
|
13
|
+
"content": "\"use client\";\n\nimport React from \"react\";\nimport type { UseCartItem } from \"@cimplify/sdk/react\";\nimport type { DisplayCart } from \"@cimplify/sdk\";\nimport { useCart } from \"@cimplify/sdk/react\";\nimport { getVariantDisplayName } from \"@cimplify/sdk\";\nimport { INPUT_FIELD_TYPE } from \"@cimplify/sdk\";\nimport { currencyCode, type CurrencyCode } from \"@cimplify/sdk\";\nimport { parsePrice } from \"@cimplify/sdk\";\nimport { Price } from \"@cimplify/sdk/react\";\nimport { QuantitySelector } from \"@cimplify/sdk/react\";\nimport { useProductPrice } from \"@cimplify/sdk/react\";\nimport type { InternalUseCartItem } from \"./hooks/use-cart-types\";\nimport { cn } from \"@cimplify/sdk/react\";\n\nexport interface CartSummaryClassNames {\n root?: string;\n item?: string;\n itemName?: string;\n itemPrice?: string;\n quantity?: string;\n removeButton?: string;\n totals?: string;\n subtotal?: string;\n tax?: string;\n deliveryFee?: string;\n serviceCharge?: string;\n discount?: string;\n total?: string;\n checkout?: string;\n empty?: string;\n serviceInfo?: string;\n digitalInfo?: string;\n bundleBreakdown?: string;\n compositeBreakdown?: string;\n customerInputs?: string;\n}\n\nexport interface CartSummaryProps {\n /** Optional server cart for extended pricing details (delivery fee, service charge, discounts). */\n cart?: DisplayCart;\n onCheckout?: () => void;\n onItemRemove?: (itemId: string) => void;\n onQuantityChange?: (itemId: string, quantity: number) => void;\n emptyMessage?: string;\n /** Render the totals block (subtotal/tax/total) below the items. Default true. Hosts that show their own totals (drawer, page sidebar) should pass false. */\n showTotals?: boolean;\n /** Render the \"Proceed to Checkout\" button. Defaults to true if `onCheckout` is provided. */\n showCheckoutButton?: boolean;\n className?: string;\n classNames?: CartSummaryClassNames;\n}\n\nfunction CartLineItemRow({\n item,\n onRemove,\n onQuantityChange,\n currency,\n classNames,\n}: {\n item: UseCartItem;\n onRemove: (itemId: string) => void;\n onQuantityChange: (itemId: string, qty: number) => void;\n currency: CurrencyCode | null;\n classNames?: CartSummaryClassNames;\n}): React.ReactElement {\n const { unitPrice: locallyResolvedUnitPrice } = useProductPrice({\n product: item.product,\n variant: item.variant,\n addOnOptions: item.addOnOptions,\n });\n const pinnedUnitPrice = (item as InternalUseCartItem)._quotedUnitPrice;\n const unitPrice =\n pinnedUnitPrice === undefined ? locallyResolvedUnitPrice : parsePrice(pinnedUnitPrice);\n const hasComposite = item.compositeSelections && item.compositeSelections.length > 0;\n const hasBundle = item.bundleSelections && item.bundleSelections.length > 0;\n\n const isOptimistic = (item as { isOptimistic?: boolean }).isOptimistic === true;\n\n const lineTotal = parsePrice(unitPrice) * item.quantity;\n const imageUrl = item.product.image_url;\n const variantLabel = item.variant ? getVariantDisplayName(item.variant, item.product.name) : null;\n\n return (\n <div\n data-cimplify-cart-item\n data-optimistic={isOptimistic ? \"true\" : undefined}\n className={cn(\n \"group relative flex gap-3 py-4 border-b border-border last:border-b-0 transition-opacity\",\n isOptimistic && \"opacity-60\",\n classNames?.item,\n )}\n >\n {/* Thumbnail */}\n <div\n data-cimplify-cart-item-image\n className=\"relative w-20 h-20 shrink-0 rounded-md overflow-hidden bg-muted\"\n >\n {imageUrl ? (\n <img src={imageUrl} alt=\"\" className=\"w-full h-full object-cover\" loading=\"lazy\" />\n ) : (\n <div className=\"w-full h-full grid place-items-center text-muted-foreground/40\">\n <svg\n className=\"w-6 h-6\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n viewBox=\"0 0 24 24\"\n aria-hidden\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M2.25 15.75l5.159-5.159a2.25 2.25 0 013.182 0l5.159 5.159m-1.5-1.5l1.409-1.409a2.25 2.25 0 013.182 0l2.909 2.909m-18 3.75h16.5a1.5 1.5 0 001.5-1.5V6a1.5 1.5 0 00-1.5-1.5H3.75A1.5 1.5 0 002.25 6v12a1.5 1.5 0 001.5 1.5zm10.5-11.25h.008v.008h-.008V8.25zm.375 0a.375.375 0 11-.75 0 .375.375 0 01.75 0z\"\n />\n </svg>\n </div>\n )}\n </div>\n\n {/* Info column */}\n <div data-cimplify-cart-item-info className=\"flex-1 min-w-0 flex flex-col\">\n <div className=\"flex items-start justify-between gap-3\">\n <h3\n data-cimplify-cart-item-name\n className={cn(\"text-sm font-medium leading-tight m-0 truncate\", classNames?.itemName)}\n >\n {item.product.name}\n </h3>\n <button\n type=\"button\"\n onClick={() => onRemove(item.id)}\n data-cimplify-cart-item-remove\n className={cn(\n \"shrink-0 -mr-1 -mt-1 grid place-items-center w-7 h-7 rounded-full text-muted-foreground/60 hover:text-foreground hover:bg-muted transition-colors\",\n classNames?.removeButton,\n )}\n aria-label={`Remove ${item.product.name}`}\n >\n <svg\n className=\"w-3.5 h-3.5\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n viewBox=\"0 0 24 24\"\n aria-hidden\n >\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M6 18L18 6M6 6l12 12\" />\n </svg>\n </button>\n </div>\n\n {/* Pills row: variant, add-ons, badges */}\n {(variantLabel ||\n (item.addOnOptions && item.addOnOptions.length > 0) ||\n hasComposite ||\n hasBundle) && (\n <div data-cimplify-cart-item-pills className=\"flex flex-wrap gap-1.5 mt-1.5\">\n {variantLabel && (\n <span\n data-cimplify-cart-item-variant\n className=\"inline-flex items-center px-2 py-0.5 rounded-full bg-muted text-[11px] font-medium text-foreground\"\n >\n {variantLabel}\n </span>\n )}\n {item.addOnOptions?.map((opt) => (\n <span\n key={opt.id}\n data-cimplify-cart-item-addon\n className=\"inline-flex items-center px-2 py-0.5 rounded-full bg-muted text-[11px] font-medium text-muted-foreground\"\n >\n + {opt.name}\n </span>\n ))}\n {(hasComposite || hasBundle) && (\n <span\n data-cimplify-cart-item-badge\n className=\"inline-flex items-center px-2 py-0.5 rounded-full bg-primary/10 text-[11px] font-semibold uppercase tracking-wider text-primary\"\n >\n {hasComposite ? \"Custom\" : \"Bundle\"}\n </span>\n )}\n </div>\n )}\n\n {/* Special instructions */}\n {item.specialInstructions && (\n <p\n data-cimplify-cart-item-instructions\n className=\"mt-1.5 text-xs italic text-muted-foreground line-clamp-2\"\n >\n \\u201C{item.specialInstructions}\\u201D\n </p>\n )}\n\n {/* Customer input values */}\n {item.customerInputs && item.customerInputs.length > 0 && (\n <dl\n data-cimplify-cart-customer-inputs\n className={cn(\"mt-1.5 text-xs space-y-0.5\", classNames?.customerInputs)}\n >\n {item.customerInputs.map((input) => (\n <div key={input.field_id} data-cimplify-cart-input className=\"flex gap-1.5\">\n <dt data-cimplify-cart-input-label className=\"text-muted-foreground\">\n {input.field_name}:\n </dt>\n <dd data-cimplify-cart-input-value className=\"text-foreground m-0 truncate\">\n {input.field_type === INPUT_FIELD_TYPE.File ||\n input.field_type === INPUT_FIELD_TYPE.Image\n ? String(input.value).split(\"/\").pop() || \"Uploaded file\"\n : String(input.value)}\n </dd>\n </div>\n ))}\n </dl>\n )}\n\n {/* Service: scheduled details */}\n {(item.lineType === \"service\" || item.product.type === \"service\") &&\n item.scheduledStart && (\n <div\n data-cimplify-cart-service-info\n className={cn(\n \"mt-1.5 flex items-center gap-1.5 text-xs text-muted-foreground\",\n classNames?.serviceInfo,\n )}\n >\n <svg\n className=\"w-3.5 h-3.5 shrink-0\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n viewBox=\"0 0 24 24\"\n aria-hidden\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z\"\n />\n </svg>\n <span>\n {new Date(item.scheduledStart).toLocaleDateString(undefined, {\n month: \"short\",\n day: \"numeric\",\n })}{\" \"}\n at{\" \"}\n {new Date(item.scheduledStart).toLocaleTimeString([], {\n hour: \"2-digit\",\n minute: \"2-digit\",\n })}\n </span>\n {item.serviceStatus && (\n <span\n data-status={item.serviceStatus}\n className=\"ml-auto px-1.5 py-0.5 rounded-full bg-muted text-[10px] uppercase tracking-wider\"\n >\n {item.serviceStatus}\n </span>\n )}\n </div>\n )}\n\n {/* Digital: instant-delivery badge */}\n {(item.lineType === \"digital\" || item.product.type === \"digital\") && (\n <div\n data-cimplify-cart-digital-info\n className={cn(\n \"mt-1.5 flex items-center gap-1 text-xs text-muted-foreground\",\n classNames?.digitalInfo,\n )}\n >\n <svg\n className=\"w-3.5 h-3.5 shrink-0\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n viewBox=\"0 0 24 24\"\n aria-hidden\n >\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M13 10V3L4 14h7v7l9-11h-7z\" />\n </svg>\n <span>Instant digital delivery</span>\n </div>\n )}\n\n {/* Bundle / composite component breakdown */}\n {(item.bundleResolved || item.compositeResolved) && (\n <ul\n data-cimplify-cart-composite-breakdown={item.compositeResolved ? \"\" : undefined}\n data-cimplify-cart-bundle-breakdown={item.bundleResolved ? \"\" : undefined}\n className={cn(\n \"mt-1.5 pl-3 border-l border-border space-y-0.5 text-xs text-muted-foreground\",\n item.compositeResolved ? classNames?.compositeBreakdown : classNames?.bundleBreakdown,\n )}\n >\n {(\n (item.bundleResolved?.selections ??\n item.compositeResolved?.selections ??\n []) as Array<{\n component_id?: string;\n product_name?: string;\n component_name?: string;\n quantity: number;\n product_type?: string;\n }>\n ).map((sel) => {\n const name = sel.product_name ?? sel.component_name ?? \"\";\n const compId = sel.component_id ?? `${name}-${sel.quantity}`;\n return (\n <li\n key={compId}\n data-product-type={sel.product_type}\n className=\"flex items-baseline gap-1.5 m-0\"\n >\n <span className=\"font-medium text-foreground/80\">{sel.quantity}\\u00D7</span>\n <span className=\"truncate\">{name}</span>\n </li>\n );\n })}\n </ul>\n )}\n\n {/* Bottom row: line price + qty stepper */}\n <div className=\"mt-3 flex items-center justify-between gap-3\">\n <Price\n amount={lineTotal}\n currency={currency}\n className={cn(\"text-sm font-semibold tabular-nums\", classNames?.itemPrice)}\n />\n <div data-cimplify-cart-item-controls className={classNames?.quantity}>\n <QuantitySelector\n value={item.quantity}\n onChange={(qty) => onQuantityChange(item.id, qty)}\n min={0}\n />\n </div>\n </div>\n </div>\n </div>\n );\n}\n\n/**\n * CartSummary — renders cart line items + totals.\n *\n * NOT a drawer or modal — just the cart content. Templates wrap this in\n * their own drawer/modal shell with animations.\n */\nexport function CartSummary({\n cart: serverCart,\n onCheckout,\n onItemRemove,\n onQuantityChange,\n emptyMessage = \"Your cart is empty\",\n showTotals = true,\n showCheckoutButton,\n className,\n classNames,\n}: CartSummaryProps): React.ReactElement {\n const {\n items,\n itemCount,\n subtotal,\n tax,\n taxRate,\n taxInclusive,\n taxJurisdictionLabel,\n total,\n isEmpty,\n isOptimistic,\n pendingOpCount,\n currency,\n removeItem,\n updateQuantity,\n } = useCart();\n const displayCurrency =\n serverCart?.currency ?? (currency === null ? null : currencyCode(currency));\n\n const deliveryFee = serverCart?.delivery_fee;\n const serviceCharge = serverCart?.service_charge;\n const totalDiscounts = serverCart?.total_discounts;\n\n const handleRemove = (itemId: string) => {\n if (onItemRemove) {\n onItemRemove(itemId);\n } else {\n void removeItem(itemId);\n }\n };\n\n const handleQuantityChange = (itemId: string, qty: number) => {\n if (onQuantityChange) {\n onQuantityChange(itemId, qty);\n } else {\n void updateQuantity(itemId, qty);\n }\n };\n\n return (\n <div\n data-cimplify-cart-summary\n data-optimistic={isOptimistic ? \"true\" : undefined}\n data-pending-ops={pendingOpCount > 0 ? pendingOpCount : undefined}\n className={cn(className, classNames?.root)}\n >\n {isEmpty ? (\n <div data-cimplify-cart-empty className={classNames?.empty}>\n <p>{emptyMessage}</p>\n </div>\n ) : (\n <>\n {/* Line items */}\n <div data-cimplify-cart-items>\n {items.map((item) => (\n <CartLineItemRow\n key={item.id}\n item={item}\n onRemove={handleRemove}\n onQuantityChange={handleQuantityChange}\n currency={displayCurrency}\n classNames={classNames}\n />\n ))}\n </div>\n\n {/* Totals */}\n {showTotals && (\n <div\n data-cimplify-cart-totals\n className={cn(\n \"mt-6 pt-4 border-t border-border space-y-2 text-sm\",\n classNames?.totals,\n )}\n >\n <div\n data-cimplify-cart-subtotal\n className={cn(\"flex items-baseline justify-between\", classNames?.subtotal)}\n >\n <span className=\"text-muted-foreground\">\n Subtotal ({itemCount} {itemCount === 1 ? \"item\" : \"items\"})\n </span>\n <Price amount={subtotal} currency={displayCurrency} className=\"tabular-nums\" />\n </div>\n\n {totalDiscounts != null && parsePrice(totalDiscounts) > 0 && (\n <div\n data-cimplify-cart-discount\n className={cn(\"flex items-baseline justify-between\", classNames?.discount)}\n >\n <span className=\"text-muted-foreground\">Discount</span>\n <Price\n amount={totalDiscounts}\n currency={displayCurrency}\n prefix=\"-\"\n className=\"tabular-nums text-primary\"\n />\n </div>\n )}\n\n {deliveryFee != null && (\n <div\n data-cimplify-cart-delivery-fee\n className={cn(\"flex items-baseline justify-between\", classNames?.deliveryFee)}\n >\n <span className=\"text-muted-foreground\">Delivery</span>\n {parsePrice(deliveryFee) > 0 ? (\n <Price\n amount={deliveryFee}\n currency={displayCurrency}\n className=\"tabular-nums\"\n />\n ) : (\n <span className=\"font-medium text-primary\">Free</span>\n )}\n </div>\n )}\n\n {serviceCharge != null && parsePrice(serviceCharge) > 0 && (\n <div\n data-cimplify-cart-service-charge\n className={cn(\"flex items-baseline justify-between\", classNames?.serviceCharge)}\n >\n <span className=\"text-muted-foreground\">Service charge</span>\n <Price\n amount={serviceCharge}\n currency={displayCurrency}\n className=\"tabular-nums\"\n />\n </div>\n )}\n\n <div\n data-cimplify-cart-tax\n className={cn(\"flex items-baseline justify-between\", classNames?.tax)}\n >\n <span className=\"flex items-baseline gap-1.5 text-muted-foreground\">\n {taxInclusive\n ? \"Tax, included in prices\"\n : taxJurisdictionLabel\n ? `Sales tax, ${taxJurisdictionLabel}`\n : \"Sales tax\"}\n {taxRate != null && taxRate > 0 && (\n <span className=\"rounded-full bg-muted px-1.5 py-0.5 text-[11px] font-medium\">\n {taxRate}%\n </span>\n )}\n </span>\n <Price amount={tax} currency={displayCurrency} className=\"tabular-nums\" />\n </div>\n\n <div\n data-cimplify-cart-total\n className={cn(\n \"flex items-baseline justify-between pt-3 mt-1 border-t border-border\",\n classNames?.total,\n )}\n >\n <span className=\"font-semibold\">Total</span>\n <Price\n amount={total}\n currency={displayCurrency}\n className=\"text-base font-bold tabular-nums\"\n />\n </div>\n </div>\n )}\n\n {(showCheckoutButton ?? Boolean(onCheckout)) && onCheckout && (\n <button\n type=\"button\"\n onClick={onCheckout}\n data-cimplify-cart-checkout\n className={cn(\n \"mt-4 w-full h-12 rounded-full bg-foreground text-background font-semibold text-sm hover:bg-foreground/90 active:scale-[0.99] transition-all\",\n classNames?.checkout,\n )}\n >\n Proceed to Checkout\n </button>\n )}\n </>\n )}\n </div>\n );\n}\n"
|
|
14
14
|
}
|
|
15
15
|
]
|
|
16
16
|
}
|