@dioramajs/diorama 0.1.1 → 0.1.3
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/dist/cdn/{ambient-D9XlnBha.js → ambient-Bcfrp-0a.js} +1 -1
- package/dist/cdn/{assemble-D14Im2UN.js → assemble-VLTAzADl.js} +1 -1
- package/dist/cdn/auto.js +3 -3
- package/dist/cdn/{beam-VmgB6FLS.js → beam-DzvZ4-cm.js} +1 -1
- package/dist/cdn/{beat-C24ln4i2.js → beat-Bh4Pp0AR.js} +1 -1
- package/dist/cdn/{bitmap-B-zWPVnC-DU22YoJN.js → bitmap-B-zWPVnC-D9JrEGrZ.js} +1 -1
- package/dist/cdn/{blinds-Bk5uMM0-.js → blinds-Cfp4MlwN.js} +1 -1
- package/dist/cdn/{blobs-DnDOG6gi.js → blobs-Do3HpJCl.js} +1 -1
- package/dist/cdn/{book-Dhbt6TZr.js → book-DQdA0nHh.js} +1 -1
- package/dist/cdn/{box-CwDaEGbi.js → box-D16Z4Evl.js} +1 -1
- package/dist/cdn/{carousel-Dg0gymV1.js → carousel-B8W-k9q9.js} +1 -1
- package/dist/cdn/{chart-Dxvb8NTZ.js → chart-BW7QKOBq.js} +1 -1
- package/dist/cdn/{clouds-C07VT0se.js → clouds-D9YgdqLM.js} +1 -1
- package/dist/cdn/{coin-BqQf_34O.js → coin-mgZ4M3Xj.js} +1 -1
- package/dist/cdn/{compare-pozbfhux.js → compare-8vzwMgMl.js} +1 -1
- package/dist/cdn/{confetti-BZxAjlUW.js → confetti-XlvT_M7R.js} +1 -1
- package/dist/cdn/{counter-DGSouXYQ.js → counter-mHe41-Kb.js} +1 -1
- package/dist/cdn/{cover-sL1CQbeu.js → cover-D5GqRjKL.js} +1 -1
- package/dist/cdn/{coverflow-DhRMk_eT.js → coverflow-B_1fIzNZ.js} +1 -1
- package/dist/cdn/{curtain-BBafCfVM.js → curtain-RW-0G4V2.js} +1 -1
- package/dist/cdn/{deck-C1kqdqrs-BsIoTQP9.js → deck-C1kqdqrs-BZpMSwGl.js} +1 -1
- package/dist/cdn/{device-Ci2uv5OD.js → device-BIs2OdoL.js} +1 -1
- package/dist/cdn/{dist-Cs-A3G6z.js → dist-A2EwLNr3.js} +1 -1
- package/dist/cdn/dist-BCZV3A6K.js +1 -0
- package/dist/cdn/{dist-C-JNG8i5.js → dist-BWGkLlqr.js} +1 -1
- package/dist/cdn/{dist-CJVnx9gh.js → dist-C1g5IR7z.js} +1 -1
- package/dist/cdn/{dist-BHTLK8y2.js → dist-CP1XY3OV.js} +1 -1
- package/dist/cdn/{dist-Db6RjFbk.js → dist-CXu9CZ10.js} +1 -1
- package/dist/cdn/dist-CjhWCRrE.js +1 -0
- package/dist/cdn/dist-D3F4iUyc.js +1 -0
- package/dist/cdn/{dist-77NXfk7b.js → dist-DNaBWJWL.js} +1 -1
- package/dist/cdn/{dist-B9m2D8i7.js → dist-Dx6JmNJx.js} +1 -1
- package/dist/cdn/{dist-DGV8ItID.js → dist-X_Qg_oEP.js} +1 -1
- package/dist/cdn/{dist-BWPAV84C.js → dist-iMukwUQD.js} +1 -1
- package/dist/cdn/{dots-BXJrsWh3.js → dots-CtSXmEQF.js} +1 -1
- package/dist/cdn/{drops-BbylXN5V.js → drops-0Z_4vJgg.js} +1 -1
- package/dist/cdn/{dust-CDy7dxoO.js → dust-C3kvA3IL.js} +1 -1
- package/dist/cdn/{emboss-DUkxsex9.js → emboss-BCACs_Hc.js} +1 -1
- package/dist/cdn/{emoji-Cg4_FuSD.js → emoji-UwXABpxO.js} +1 -1
- package/dist/cdn/{expand-DoRLigJh.js → expand-CKDy_2WG.js} +1 -1
- package/dist/cdn/{explode-NNAZA3NK.js → explode-BqlaXfaX.js} +1 -1
- package/dist/cdn/{extrude-DDJqV0UO.js → extrude-ito7Xzp3.js} +1 -1
- package/dist/cdn/{fire-BI-HVaXp.js → fire-BqLf_28X.js} +1 -1
- package/dist/cdn/{flare-Dwz5riNj.js → flare-DCxWeKAq.js} +1 -1
- package/dist/cdn/{flipbook-C2rIYAlo.js → flipbook-ClUXqZdH.js} +1 -1
- package/dist/cdn/{focus-B2oqkeBA-BNKrapyF.js → focus-B2oqkeBA-PVpadIAp.js} +1 -1
- package/dist/cdn/{frost-DKbp2nYJ.js → frost-CI6gzTIk.js} +1 -1
- package/dist/cdn/{gallery-DNQAdpvv.js → gallery-u2qN6TpX.js} +1 -1
- package/dist/cdn/{glitch-vPvcgP6n.js → glitch-CyYhXbVf.js} +1 -1
- package/dist/cdn/{globe-DxTfOR8x.js → globe-BU7qa13F.js} +1 -1
- package/dist/cdn/{glow-abQAu0AK.js → glow-DOprbhYL.js} +1 -1
- package/dist/cdn/{gradient-qjcOv8xD.js → gradient-DlWLiAIB.js} +1 -1
- package/dist/cdn/{graph-BBREVOP2.js → graph-QN0JvEN5.js} +1 -1
- package/dist/cdn/{grid-BUHYCDMP.js → grid-BGQMSBhs.js} +1 -1
- package/dist/cdn/{heatmap-O_-9ZlUJ.js → heatmap-BAlNtCZs.js} +1 -1
- package/dist/cdn/{hologram-B4Csmbj2.js → hologram-DNSYtXyV.js} +1 -1
- package/dist/cdn/{horizontal-BlMB365o.js → horizontal-D_WilRKj.js} +1 -1
- package/dist/cdn/{hover-preview-Bw5ITAeO.js → hover-preview-BotltukD.js} +1 -1
- package/dist/cdn/image-BYW-JRjA.js +1 -0
- package/dist/cdn/{inflate-4s9DrJ-1.js → inflate-DWXCm_lZ.js} +1 -1
- package/dist/cdn/{ink-BuIqWW1a-DqBXQK08.js → ink-BuIqWW1a-jIX2G_M8.js} +1 -1
- package/dist/cdn/{inspect-CMJ44mep-V5hvLIlY.js → inspect-CMJ44mep-C83amJsc.js} +1 -1
- package/dist/cdn/instances-DqmbgxOT-TVTQ6q1q.js +1 -0
- package/dist/cdn/{keycaps-CTEki83p.js → keycaps-K9ynUNH6.js} +1 -1
- package/dist/cdn/{kit-BM0qCXzI.js → kit-DAFViSYh.js} +1 -1
- package/dist/cdn/{label-Bzitsbhe.js → label-BOXNWs00.js} +1 -1
- package/dist/cdn/{lens-C6mk3jjq.js → lens-i7hMBKr1.js} +1 -1
- package/dist/cdn/{lightbox-BnNL-BAD.js → lightbox-DAaw2XVl.js} +1 -1
- package/dist/cdn/{liquid-B3unrFqj.js → liquid-BBHOkeBl.js} +1 -1
- package/dist/cdn/{magnet-DL-1tu4W.js → magnet-FsTzNMLg.js} +1 -1
- package/dist/cdn/{map-pw1qOPsC.js → map-DBAQehdJ.js} +1 -1
- package/dist/cdn/{marquee-e8bzjMjR.js → marquee-BCgbw-V7.js} +1 -1
- package/dist/cdn/{melt-DcWKZz97.js → melt-ESf995Jj.js} +1 -1
- package/dist/cdn/{model-C8lYklQk.js → model-6i1EzlCa.js} +1 -1
- package/dist/cdn/{neon-CjJIyEY6.js → neon-qZ8SN9C2.js} +1 -1
- package/dist/cdn/{orbit-BIBD9AYi.js → orbit-DBZKIX-U.js} +1 -1
- package/dist/cdn/{paint-XpIPgN9_-CZPzy07M.js → paint-XpIPgN9_-BlJb2tT9.js} +1 -1
- package/dist/cdn/{panorama-CVPmRklf.js → panorama-BqeH0D7N.js} +1 -1
- package/dist/cdn/{parallax-BhNp9Z1E.js → parallax-BgMW0pb1.js} +1 -1
- package/dist/cdn/{physics-QayZbZMl.js → physics-BUGo8jx6.js} +1 -1
- package/dist/cdn/{pins-DJCbI3n7.js → pins-BYxRXd1W.js} +1 -1
- package/dist/cdn/{pixelate-BCXIwH_a.js → pixelate-5_dR-wOy.js} +1 -1
- package/dist/cdn/{points-3Fg6fQYz-CDGHYSao.js → points-3Fg6fQYz-CO2A_AE7.js} +1 -1
- package/dist/cdn/{polaroids-0cdwGu8x.js → polaroids-q_ne0Qfz.js} +1 -1
- package/dist/cdn/{prism-CwqCNr2M.js → prism-D42Cokzm.js} +1 -1
- package/dist/cdn/{reflection-24bwh_vr.js → reflection-DyU0S1La.js} +1 -1
- package/dist/cdn/{reveal-D_wnqM0Z.js → reveal-BA8N5-2P.js} +1 -1
- package/dist/cdn/{ribbon-BrA4STmy.js → ribbon-D36MksFx.js} +1 -1
- package/dist/cdn/runtime-B1JIfZSo.js +1 -0
- package/dist/cdn/{scramble-8VHS7KD3.js → scramble--SAk7Gje.js} +1 -1
- package/dist/cdn/{scrub-CBSYhc0m.js → scrub-t2IRRW0c.js} +1 -1
- package/dist/cdn/{sequence-CzA8DT9s.js → sequence-CCkUdVro.js} +1 -1
- package/dist/cdn/{shatter-C-4anYeT.js → shatter-CuQo3y4x.js} +1 -1
- package/dist/cdn/{shimmer-4KAhpqkx.js → shimmer-C17GRn87.js} +1 -1
- package/dist/cdn/{shine-PA3aTZe5.js → shine-DbMDtG1U.js} +1 -1
- package/dist/cdn/{smoke-6VXb_muy.js → smoke-DcL9Tgu8.js} +1 -1
- package/dist/cdn/{snow-Qirj8pYg.js → snow-BP6vA9-u.js} +1 -1
- package/dist/cdn/{sparkles-DI85yvM3.js → sparkles-DjzvM51I.js} +1 -1
- package/dist/cdn/{spin-CZ1cPYxi.js → spin-BldwAvsU.js} +1 -1
- package/dist/cdn/{split-flap-CWh71CY1.js → split-flap-DpUw1gnF.js} +1 -1
- package/dist/cdn/{spotlight-_4BVSvdY.js → spotlight-Cz01jhVU.js} +1 -1
- package/dist/cdn/{stack-DkcLqYg1.js → stack-B2oyS9vm.js} +1 -1
- package/dist/cdn/{stars-ugpczSZW.js → stars-DrEO7wCD.js} +1 -1
- package/dist/cdn/{studio-BuaMR-l8-C4L6wD0d.js → studio-BuaMR-l8-CsmTu0gU.js} +1 -1
- package/dist/cdn/{text-glitch-De0pWcUb.js → text-glitch-U4WGJ5u4.js} +1 -1
- package/dist/cdn/{text-reveal-DoxYa9Lk.js → text-reveal-BJmJjgHF.js} +1 -1
- package/dist/cdn/{tilt-CxO_nVkJ.js → tilt-Zp2tnT9H.js} +1 -1
- package/dist/cdn/{tone-DxOcjwm6.js → tone-rFWtRG7p.js} +1 -1
- package/dist/{esm/track-BeG2aIt_-CvOvbBt_.js → cdn/track-BeG2aIt_-BxlOBFEQ.js} +1 -1
- package/dist/cdn/{tunnel-D_G4C2_z.js → tunnel-BpAc9qXm.js} +1 -1
- package/dist/cdn/{turn-BIjT-ygb-3oM7rKcy.js → turn-BIjT-ygb-CBFxlGny.js} +1 -1
- package/dist/cdn/{unfold-D52Mm2nR.js → unfold-BlnBGJgY.js} +1 -1
- package/dist/cdn/{video-hover-CgmfEuxU.js → video-hover-Dg2wpuD-.js} +1 -1
- package/dist/cdn/{video-text-DZWRlKym.js → video-text-CtbM-fw1.js} +1 -1
- package/dist/cdn/{vinyl-CMwJkNCW.js → vinyl-g63s_sem.js} +1 -1
- package/dist/cdn/{visualizer-DhneEzbf.js → visualizer-DdfshOpm.js} +1 -1
- package/dist/cdn/{voxel-BCO-K4Ce.js → voxel-DQGwuXRZ.js} +1 -1
- package/dist/cdn/{water-Cv-2ML7B.js → water-DGR3R3mN.js} +1 -1
- package/dist/cdn/{wave-1kEzoGsE.js → wave-DRK0KNEj.js} +1 -1
- package/dist/cdn/{waves-dGbSw2jh.js → waves-BNELRAA0.js} +1 -1
- package/dist/cdn/{zoom-D8PBTLlq.js → zoom-aNYZw7lo.js} +1 -1
- package/dist/cdn/{zoom-scroll-gGlkUz0o.js → zoom-scroll-DJ-AQU_C.js} +1 -1
- package/dist/esm/{ambient-Qk1w8lYJ.js → ambient-FIwXXQD_.js} +1 -1
- package/dist/esm/{assemble-Ba1M1MVg.js → assemble-RkVuguM-.js} +1 -1
- package/dist/esm/{beam-ClQUAkE7.js → beam-B-gGeZmm.js} +1 -1
- package/dist/esm/{beat-CEiKdQdZ.js → beat-CrgxSmKh.js} +1 -1
- package/dist/esm/{bitmap-B-zWPVnC-CaZ1gd-a.js → bitmap-B-zWPVnC-B46ectLg.js} +1 -1
- package/dist/esm/{blinds-Dl5mOTKr.js → blinds-CxCSDmtn.js} +1 -1
- package/dist/esm/{blobs-B44mlwR6.js → blobs-m_c_rEwJ.js} +1 -1
- package/dist/esm/{book-D1wt_E6_.js → book-BfmkRJRc.js} +1 -1
- package/dist/esm/{box-DM44GR2O.js → box-CSiuh4YO.js} +1 -1
- package/dist/esm/{carousel-dmxUZFZv.js → carousel-QTpsWA7i.js} +1 -1
- package/dist/esm/{chart-Dh3Kacbi.js → chart-DhAhAq9r.js} +1 -1
- package/dist/esm/{clouds-Ct4hGDwZ.js → clouds-CEidKqUM.js} +1 -1
- package/dist/esm/{coin-DBJfFokf.js → coin-C9KACtCf.js} +1 -1
- package/dist/esm/{compare-B0hlKFqt.js → compare-uJe6AeIk.js} +1 -1
- package/dist/esm/{confetti-Cd1gRKJc.js → confetti-QNA71W6j.js} +1 -1
- package/dist/esm/{counter-DVu70mYg.js → counter-BcbsSbPz.js} +1 -1
- package/dist/esm/{cover-B6byVpLO.js → cover-BWk2udxY.js} +1 -1
- package/dist/esm/{coverflow-B4ML7z8_.js → coverflow-BgiY5eli.js} +1 -1
- package/dist/esm/{curtain-D7hBZ9Pm.js → curtain-BRd5ZoCw.js} +1 -1
- package/dist/esm/{deck-C1kqdqrs-Dt7ZbAPu.js → deck-C1kqdqrs-jV14smfL.js} +1 -1
- package/dist/esm/{device-CrXFH8xV.js → device-DPD5je72.js} +1 -1
- package/dist/esm/{dist-CHbggwLI.js → dist-9k4pPDEA.js} +1 -1
- package/dist/esm/{dist-BwDPR4Cj.js → dist-BHNPO-Fn.js} +1 -1
- package/dist/esm/{dist-Cdr7dxto.js → dist-BNBWBbk0.js} +1 -1
- package/dist/esm/{dist-CJVnx9gh.js → dist-C1g5IR7z.js} +1 -1
- package/dist/esm/{dist-C-YePnn3.js → dist-C9I-dsHy.js} +1 -1
- package/dist/esm/{dist-_6VGLQBA.js → dist-CYnsusuM.js} +1 -1
- package/dist/esm/{dist-rurRPzMV.js → dist-Chckc2DW.js} +1 -1
- package/dist/esm/dist-CvfugmSG.js +1 -0
- package/dist/esm/dist-D3F4iUyc.js +1 -0
- package/dist/esm/dist-VLStkW-H.js +1 -0
- package/dist/esm/{dist-DHF_Ykj5.js → dist-YBp6SSPO.js} +1 -1
- package/dist/esm/{dist-CJd5Mdwb.js → dist-tcYcoUtC.js} +1 -1
- package/dist/esm/{dots-DKjGzDRp.js → dots-6yWzjPXx.js} +1 -1
- package/dist/esm/{drops-D7a7wtcS.js → drops-CQg8JSz1.js} +1 -1
- package/dist/esm/{dust-C-bzAqLV.js → dust-C_EmrEBe.js} +1 -1
- package/dist/esm/{emboss-CWH1brl0.js → emboss-BTEXQMpl.js} +1 -1
- package/dist/esm/{emoji-DKgJAgmo.js → emoji-B6Cf_att.js} +1 -1
- package/dist/esm/{expand-Cga16EVG.js → expand-kIgRKhsr.js} +1 -1
- package/dist/esm/{explode-BqfxknJx.js → explode--_1vJuw4.js} +1 -1
- package/dist/esm/{extrude-cKg8PSTW.js → extrude-112eMenH.js} +1 -1
- package/dist/esm/{fire-zGK0eb7_.js → fire-CGkIUIbK.js} +1 -1
- package/dist/esm/{flare-Dxk9k98E.js → flare-PT2kAKv1.js} +1 -1
- package/dist/esm/{flipbook-Bhdttqn4.js → flipbook-C0KNLeU5.js} +1 -1
- package/dist/esm/{focus-B2oqkeBA-OpTt_TCP.js → focus-B2oqkeBA-C8AbZvF4.js} +1 -1
- package/dist/esm/{frost-Bg2bkU3J.js → frost-D0jXL370.js} +1 -1
- package/dist/esm/{gallery-CxKmSfaa.js → gallery-BsDW9JIa.js} +1 -1
- package/dist/esm/{glitch-e663rfbc.js → glitch-COV7q02S.js} +1 -1
- package/dist/esm/{globe-FyaOvpiz.js → globe-CD416cKn.js} +1 -1
- package/dist/esm/{glow-Dc2bf-cF.js → glow-HYMtKvOA.js} +1 -1
- package/dist/esm/{gradient-BufiXb8K.js → gradient-VFTwx9Zh.js} +1 -1
- package/dist/esm/{graph-DqgRpx2u.js → graph-ak-ab1uO.js} +1 -1
- package/dist/esm/{grid-gd48GpTT.js → grid-CVGlxc2S.js} +1 -1
- package/dist/esm/{heatmap-DoVICfdW.js → heatmap-BzBqLa2x.js} +1 -1
- package/dist/esm/{hologram-OMmy8aci.js → hologram-Cvd8vx_K.js} +1 -1
- package/dist/esm/{horizontal-tsslgB_5.js → horizontal-Cj3546vC.js} +1 -1
- package/dist/esm/{hover-preview-By-lZZYF.js → hover-preview-BG7sQAgX.js} +1 -1
- package/dist/esm/image-BThe_t_F.js +1 -0
- package/dist/esm/index.js +3 -3
- package/dist/esm/{inflate-D348p12R.js → inflate-jym-Ls2D.js} +1 -1
- package/dist/esm/{ink-BuIqWW1a-CwLkzSja.js → ink-BuIqWW1a-CbRB4MAz.js} +1 -1
- package/dist/esm/{inspect-CMJ44mep-C1Nt7pXw.js → inspect-CMJ44mep-X5ivuDgp.js} +1 -1
- package/dist/esm/instances-DqmbgxOT-TVTQ6q1q.js +1 -0
- package/dist/esm/{keycaps-BkkkrYAv.js → keycaps-Jn6TSzjC.js} +1 -1
- package/dist/esm/{kit-5IzkOXD0.js → kit-DyX1bRaH.js} +1 -1
- package/dist/esm/{label-Ba8KZ-8R.js → label-BcHwMYqa.js} +1 -1
- package/dist/esm/{lens-eWuubBny.js → lens-DonoYSM-.js} +1 -1
- package/dist/esm/{lightbox-CPMav-kX.js → lightbox-D3AUNtpt.js} +1 -1
- package/dist/esm/{liquid-BlqTaXK9.js → liquid-PUL2MzOC.js} +1 -1
- package/dist/esm/{magnet-4GjWvmON.js → magnet-pAhvRzkT.js} +1 -1
- package/dist/esm/{map-ByjTTYk8.js → map-DFaomsVq.js} +1 -1
- package/dist/esm/{marquee-Dso6ayor.js → marquee-B9dZYUqd.js} +1 -1
- package/dist/esm/{melt-DdarmsNG.js → melt-CdUGQXz9.js} +1 -1
- package/dist/esm/{model-SwCA4OEC.js → model-CDF5wh2l.js} +1 -1
- package/dist/esm/{neon-DvKOzW82.js → neon-BL6esd6C.js} +1 -1
- package/dist/esm/{orbit-CdHRKHM1.js → orbit-RsTjtgmz.js} +1 -1
- package/dist/esm/{paint-XpIPgN9_-BgvP0P5g.js → paint-XpIPgN9_-Ca5R04Ux.js} +1 -1
- package/dist/esm/{panorama-O5Ztwhvy.js → panorama-Yaemej-U.js} +1 -1
- package/dist/esm/{parallax-BziRgfl7.js → parallax-CCo_e_EB.js} +1 -1
- package/dist/esm/{physics-soZZBmlp.js → physics-uvtwwJ8x.js} +1 -1
- package/dist/esm/{pins-C-r9f95M.js → pins-B8HxOy9o.js} +1 -1
- package/dist/esm/{pixelate-B58MILZ3.js → pixelate-I6KUlzag.js} +1 -1
- package/dist/esm/{points-3Fg6fQYz-YV7m16tF.js → points-3Fg6fQYz-CbNcMA2U.js} +1 -1
- package/dist/esm/{polaroids-BuPAHO7O.js → polaroids-Ct37GhP5.js} +1 -1
- package/dist/esm/{prism-DScLVhKQ.js → prism-ROysXG6z.js} +1 -1
- package/dist/esm/{reflection-kujvoe7O.js → reflection-DA_lYYC_.js} +1 -1
- package/dist/esm/{reveal-CrpZIvcO.js → reveal-DyrSBI-v.js} +1 -1
- package/dist/esm/{ribbon-wM-wUNtq.js → ribbon-D6S48qBE.js} +1 -1
- package/dist/esm/runtime-BwRCtd8x.js +1 -0
- package/dist/esm/{scramble-BPnsD4vT.js → scramble-Cdq_HewD.js} +1 -1
- package/dist/esm/{scrub-CUe7bpvT.js → scrub-Bjb_Qevb.js} +1 -1
- package/dist/esm/{sequence-HqzSr0PQ.js → sequence-BYjp8e41.js} +1 -1
- package/dist/esm/{shatter-B3jwfOHN.js → shatter-8JuFNsn-.js} +1 -1
- package/dist/esm/{shimmer-DfMZglK5.js → shimmer-BV0-17Ni.js} +1 -1
- package/dist/esm/{shine-Ay1WACR4.js → shine-Cw8pFZ_M.js} +1 -1
- package/dist/esm/{smoke-Bv1_ncmq.js → smoke-BKsLZHTj.js} +1 -1
- package/dist/esm/{snow-GSqJdbHR.js → snow-B3JXwfcx.js} +1 -1
- package/dist/esm/{sparkles-D0VFzp-O.js → sparkles-CCRGOPV_.js} +1 -1
- package/dist/esm/{spin-3CaE6ZeJ.js → spin-FYn5TlEF.js} +1 -1
- package/dist/esm/{split-flap-xf6Wu6fi.js → split-flap-Qsg1RNHr.js} +1 -1
- package/dist/esm/{spotlight-DOME4rCd.js → spotlight-C1m1fibp.js} +1 -1
- package/dist/esm/{stack-AvQ0QZ_c.js → stack-WLQuNgam.js} +1 -1
- package/dist/esm/{stars-C2dU7VFw.js → stars-4T0UB3SU.js} +1 -1
- package/dist/esm/{studio-BuaMR-l8-tyeaa2Lj.js → studio-BuaMR-l8-Dwd-DJ2d.js} +1 -1
- package/dist/esm/{text-glitch-BkqEi4gB.js → text-glitch-6wQBOqdO.js} +1 -1
- package/dist/esm/{text-reveal-D7UoRND6.js → text-reveal-Bviq-r33.js} +1 -1
- package/dist/esm/{tilt-CGLwUbyT.js → tilt-CWGrDwgR.js} +1 -1
- package/dist/esm/{tone-CL6JiA7_.js → tone-B7v3Ihz_.js} +1 -1
- package/dist/{cdn/track-BeG2aIt_-BLqvFioo.js → esm/track-BeG2aIt_-DBg6DgEJ.js} +1 -1
- package/dist/esm/{tunnel-Cw3a7LuG.js → tunnel-I4xWco3j.js} +1 -1
- package/dist/esm/{turn-BIjT-ygb-NYN-Dbdm.js → turn-BIjT-ygb-DxGg2ZZc.js} +1 -1
- package/dist/esm/{unfold-BSjqKe5-.js → unfold-DG7b79-i.js} +1 -1
- package/dist/esm/{video-hover-3rs01JrX.js → video-hover-Ct1oKmZ5.js} +1 -1
- package/dist/esm/{video-text-q_2wgJid.js → video-text-s5FK6rQr.js} +1 -1
- package/dist/esm/{vinyl-DXRO3h2r.js → vinyl-LBs03Tor.js} +1 -1
- package/dist/esm/{visualizer-7VTstbsD.js → visualizer-IqR8gzbv.js} +1 -1
- package/dist/esm/{voxel-Bg-d9LUv.js → voxel-BqkEdubN.js} +1 -1
- package/dist/esm/{water-BwAStrxc.js → water-BjLOnKGB.js} +1 -1
- package/dist/esm/{wave-C0C_dRYT.js → wave-C_fMjBMN.js} +1 -1
- package/dist/esm/{waves-DUXDa0C1.js → waves-DWIWR56e.js} +1 -1
- package/dist/esm/{zoom-AkyIKgf4.js → zoom-AAwZCuSr.js} +1 -1
- package/dist/esm/{zoom-scroll-DYuRf_mR.js → zoom-scroll-DcRICJPI.js} +1 -1
- package/package.json +19 -19
- package/dist/cdn/dist-795LSiOz.js +0 -1
- package/dist/cdn/dist-BbuDFxNj.js +0 -1
- package/dist/cdn/dist-CR87ECQe.js +0 -1
- package/dist/cdn/image-kqGWJmx6.js +0 -1
- package/dist/cdn/instances-c3i719QK-CaL29HhG.js +0 -1
- package/dist/cdn/runtime-DpS-LDcC.js +0 -1
- package/dist/esm/dist-795LSiOz.js +0 -1
- package/dist/esm/dist-BBFulD4b.js +0 -1
- package/dist/esm/dist-CMGUWaxD.js +0 -1
- package/dist/esm/image-Unfr7Whu.js +0 -1
- package/dist/esm/instances-c3i719QK-CaL29HhG.js +0 -1
- package/dist/esm/runtime-fsXy2qz_.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{D as e,Er as t,G as n,Qn as r,Tr as i,h as a,kt as o,qt as s,wr as c}from"./three.core-B13DgFZS.js";import{i as l}from"./focus-B2oqkeBA-
|
|
1
|
+
import{D as e,Er as t,G as n,Qn as r,Tr as i,h as a,kt as o,qt as s,wr as c}from"./three.core-B13DgFZS.js";import{i as l}from"./focus-B2oqkeBA-PVpadIAp.js";import{t as u}from"./offaxis-pl12jVWD-CrocNlQs.js";import{Ai as d,Cr as f,Di as p,Pt as m,Qr as h,Rt as g,ai as _,ar as v,dt as y,fi as b,hi as ee,ji as te,ki as x,oi as ne,tr as S,vt as C,wi as w}from"./three.tsl-CmShpHGs.js";import{x as T}from"./kit-DAFViSYh.js";import{t as re}from"./three.webgpu-CChnXdxT.js";const ie=d(.86,.85,.83);function ae(e,t,n,r,i,a,o){if(!n||!r||!i||!a)return o.set(1,1,0,0);let s=e===`cover`?Math.max(i/n,a/r):e===`contain`?Math.min(i/n,a/r):e===`none`?1:e===`scale-down`?Math.min(1,i/n,a/r):0,c=s?n*s:i,l=s?r*s:a,u=(i-c)*t[0],d=(a-l)*t[1],f=a/l;return o.set(i/c,f,-u/c,1-f+d/l)}function E(e,t,n,r,i){let a=t*e.scale,o=n*e.scale,s=Math.cos(e.roll),c=Math.sin(e.roll),l=a*s-o*c,u=a*c+o*s,d=u*Math.cos(e.pitch),f=u*Math.sin(e.pitch),p=Math.cos(e.yaw),m=Math.sin(e.yaw),h=l*p+f*m+e.x,g=d+e.y,_=-l*m+f*p+e.z-i,v=Math.cos(r),y=Math.sin(r);return[h,g*v-_*y,g*y+_*v+i]}const D=(e,t,n,r)=>{let i=r/Math.max(r-n,1);return[e*i,t*i]};function O(e,t,n){let r=0;for(let i=0;i<e.length;i++){let[a,o]=e[i],[s,c]=e[(i+1)%e.length],l=(s-a)*(n-o)-(c-o)*(t-a);if(l!==0){if(r&&Math.sign(l)!==r)return!1;r=Math.sign(l)}}return!0}function k(e,t,n){let r=w(0),i=w(new a),o=w(2),s=w(0),c=e=>{try{return e.matches(`:focus-visible`)}catch{return e.matches(`:focus`)}},u=null,d=()=>{let a=document.activeElement,d=a&&t.contains(a)&&c(a)?a:null;if(d){let e=l(d);i.value.setStyle(e.color),o.value=e.width,s.value=e.offset}r.value=+!!d,d!==u&&(u=d,n(d),e.invalidate())};for(let n of[`focusin`,`focusout`,`keydown`,`keyup`])t.addEventListener(n,()=>queueMicrotask(d),{signal:e.signal});d();let f=r,p=o,m=s;return{color:i,alpha:e=>y(e.sub(m).add(.5),0,1).mul(y(m.add(p).sub(e).add(.5),0,1),f),pad:()=>s.value+o.value+2}}function A(l,A,j=()=>{}){let{u:M,render:N}=l,oe=M.size,se=M.opacity,ce=l.layer,le=e=>ce.clipMask?.(e)??m(1),ue=k(l,A,j),P={perspective:1e3,tilt:0,pivot:0,border:0,bottom:0,shadow:0,reflection:0,reach:.4},de=w(new t(0,0,1e3,1e3)),fe=w(new t(1,0,0,8)),F=w(new i),I=w(new c),L=w(new a(`#fbfaf6`)),R=de,z=fe,pe=z.x,me=z.y,he=z.z,B=F,V=B.x,ge=B.y,H=I,U=H.x,_e=H.y,ve=L,W=new e(new Uint8Array([0,0,0,0]),1,1);W.colorSpace=r,W.needsUpdate=!0,l.onDispose(()=>W.dispose());let ye=new n,be=[],G={x:0,y:0},xe=()=>{let e=w(new t),n=w(new t(0,0,1,0)),r=w(new t(1,1,0,0)),a=w(new i(1,1,0)),c=w(new t(1,1,0,0)),l=ee(W);l.mergeable=!1;let E=e,D=n,O=r,k=D.z,A=a,j=A.xy,M=c,N=z.w,ce=S(N,b(.001,U).mul(_e,j.y)),de=x(j.x.mul(-.5).sub(N),j.y.mul(-.5).sub(ce)),fe=x(j.x.mul(.5).add(N),j.y.mul(.5).add(N)),F=v(de,fe,f.xy.add(.5)),I=F.mul(k),L=C(D.y),H=_(D.y),G=I.x.mul(L).sub(I.y.mul(H)),xe=I.x.mul(H).add(I.y.mul(L)),Se=xe.mul(C(D.x)),Ce=xe.mul(_(D.x)),we=C(E.w),Te=_(E.w),Ee=G.mul(we).add(Ce.mul(Te)).add(E.x),De=Se.add(E.y),Oe=G.negate().mul(Te).add(Ce.mul(we)).add(E.z).sub(he),ke=d(Ee,De.mul(pe).sub(Oe.mul(me)),De.mul(me).add(Oe.mul(pe)).add(he)),Ae=u(ke,R.xy,R.z,R.w),K=new re({transparent:!0,depthTest:!1,depthWrite:!1,side:2});K.forceSinglePass=!0,K.positionNode=Ae;let je=O.w,q=p(F),Me=h(g,q.x,q.x.negate()),Ne=j.y.mul(-.5),Pe=q.y.lessThan(Ne).and(U.greaterThan(0)),Fe=h(Pe,j.y.negate().sub(q.y),q.y),Ie=x(Me,Fe),J=j.mul(.5),Y=A.z,Le=y(m(.5).sub(T(Ie,J,Y)),0,1),Re=x(J.x.negate().add(V),J.y.negate().add(ge)),ze=x(J.x.sub(V),J.y.sub(V)),Be=S(ze.sub(Re),x(1,1)),Ve=S(Y.sub(V),0).mul(b(V,.5)).add(b(.5,V).mul(1.5)),He=Re.add(ze).mul(.5),Ue=T(Ie.sub(He),Be.mul(.5),Ve),We=y(m(.5).sub(Ue),0,1),X=Ie.sub(Re).div(Be).mul(M.xy).add(M.zw),Ge=l.sample(y(X,0,1)),Ke=b(0,X.x).mul(b(X.x,1),b(0,X.y),b(X.y,1),Ge.a,O.z),qe=v(ie,Ge.rgb,Ke),Je=v(ve,qe,We).mul(O.y),Ye=y(Ne.sub(q.y).div(S(_e.mul(j.y),1)),0,1).oneMinus(),Xe=Le.mul(h(Pe,U.mul(Ye,Ye),m(1))),Ze=je.mul(10).add(3),Qe=je.mul(18).add(10),$e=x(H.negate(),L.negate()).mul(Ze),et=T(q.sub($e),J,Y),tt=ne(Qe,Qe.mul(-.4),et).mul(B.z,je.mul(.5).add(1),.6).mul(h(Pe,m(0),m(1))).mul(Xe.oneMinus()),nt=Xe.add(tt),rt=Je.mul(Xe).div(S(nt,1e-4)),Z=ue.alpha(T(q,J,Y).mul(k)).mul(D.w),it=Z.add(nt.mul(Z.oneMinus())),at=ue.color.mul(Z).add(rt.mul(nt,Z.oneMinus())).div(S(it,1e-4)),ot=p(Ae.xy).div(oe).add(.5);K.colorNode=te(at,it.mul(O.x,se,le(ot)));let Q=new o(new s(1,1),K);Q.frustumCulled=!1;let st={},$={mesh:Q,pose:{x:0,y:0,z:0,yaw:0,pitch:0,roll:0,scale:1},size:{w:1,h:1},radius:0,alpha:1,bright:1,lift:0,ring:!1,show(e,t){l.value=e??W,r.value.z=+!!e,st=t??{}},apply(){let{pose:t,size:i}=$;e.value.set(t.x,t.y,t.z,t.yaw),n.value.set(t.pitch,t.roll,t.scale,+!!$.ring);let o=r.value;o.set($.alpha,$.bright,o.z,$.lift),a.value.set(i.w,i.h,$.radius);let s=l.value.image,u=i.w-2*P.border,d=i.h-P.border-P.bottom;ae(st.fit??`cover`,st.position??[.5,.5],s?.width??0,s?.height??0,u,d,c.value),Q.visible=$.alpha>.001}};return ye.add(Q),be.push($),$},Se=e=>{let{w:t,h:n}=e.size;return[[-t/2,-n/2],[t/2,-n/2],[t/2,n/2],[-t/2,n/2]].map(([t,n])=>{let[r,i,a]=E(e.pose,t,n,P.tilt,P.pivot);return D(r,i,a,P.perspective)})};return{group:ye,cards:be,look:P,paper:e=>{L.value.setStyle(e)},add:xe,frame(e){N.toWorld(e.x+e.width/2,e.y+e.height/2,G),de.value.set(G.x,G.y,Math.max(P.perspective,1),N.camera.position.z||1e3);let t=Math.max(ue.pad(),P.shadow>0?48:0);fe.value.set(Math.cos(P.tilt),Math.sin(P.tilt),P.pivot,t),F.value.set(P.border,P.bottom,P.shadow),I.value.set(P.reflection,P.reach)},corners:Se,depth:e=>E(e.pose,0,0,P.tilt,P.pivot)[2],hit(e,t){return be.filter(e=>e.mesh.visible&&e.alpha>.5).sort((e,t)=>t.mesh.renderOrder-e.mesh.renderOrder).find(n=>O(Se(n),e,t))}}}function j(e,t,n){let r=e.getBoundingClientRect();return[t-r.left-r.width/2,r.top+r.height/2-n]}function M(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect();return{w:r.width,h:r.height,x:r.left+r.width/2-n.left-n.width/2,y:n.top+n.height/2-r.top-r.height/2}}const N=(e,t)=>{let n=t.closest(`a[href], button`);return n&&e.contains(n)&&n!==e?n:null};function oe(e,t,n){n.on=!0;try{e.dispatchEvent(new MouseEvent(`click`,{bubbles:!0,cancelable:!0,ctrlKey:t.ctrlKey,metaKey:t.metaKey,shiftKey:t.shiftKey,altKey:t.altKey,button:t.button}))}finally{n.on=!1}}const se=e=>!/auto|manipulation|pan-x/.test(getComputedStyle(e).touchAction||`auto`);export{M as a,j as i,oe as n,se as o,N as r,A as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,r as t}from"./contain-DZQSiTDn-QEMwSsdy.js";import{Er as n,G as r,Ot as i,Tr as a,kt as o,s,w as c}from"./three.core-B13DgFZS.js";import{n as l,r as u,t as d}from"./shapes-Dijwus5M-JtBN9JiC.js";import{a as f,n as p,o as m,s as h,t as g}from"./studio-BuaMR-l8-
|
|
1
|
+
import{n as e,r as t}from"./contain-DZQSiTDn-QEMwSsdy.js";import{Er as n,G as r,Ot as i,Tr as a,kt as o,s,w as c}from"./three.core-B13DgFZS.js";import{n as l,r as u,t as d}from"./shapes-Dijwus5M-JtBN9JiC.js";import{a as f,n as p,o as m,s as h,t as g}from"./studio-BuaMR-l8-CsmTu0gU.js";import{i as _,n as v}from"./effect-DJHvQTKy.js";import{a as y,s as b}from"./kit-DAFViSYh.js";import{Ai as x,Dr as S,Ei as C,Fr as w,Qr as T,_r as E,ar as D,dt as O,hi as k,ht as A,ji as j,jt as M,oi as N,rt as ee,wi as te,yr as ne}from"./three.tsl-CmShpHGs.js";import{r as re,t as ie}from"./three.webgpu-CChnXdxT.js";const P=Math.PI/180,ae=Math.PI/6,F=18*P,oe=15*P,se=.12,ce=e=>.96+.04*e,le={phone:[16/9,2.17],tablet:[4/3,1.6]},I=[1.25,2.4];function L(e,t){let n=Math.max(.05,t);if(e===`laptop`)return 1.6;if(e===`browser`)return Math.min(I[1],Math.max(I[0],n));let[r,i]=le[e],a=Math.min(i,Math.max(r,n<1?1/n:n));return n<1?1/a:a}function ue(e,t){return!(e>0)||!(t>0)?[1,1,0,0]:e>t?[t/e,1,(1-t/e)/2,0]:[1,e/t,0,1-e/t]}function de(e,t){let n=[Array(14).fill(15/14),[...Array(13).fill(1),2],[1.5,...Array(12).fill(1),1.5],[1.75,...Array(11).fill(1),2.25],[2.25,...Array(10).fill(1),2.75],[1,1,1,1.25,5.5,1.25,1,1,1,1]],r=e/15,i=t/5.55,a=.14*r,o=[],s=t/2;return n.forEach((t,n)=>{let c=n===0?i*.55:i,u=-e/2;for(let e of t){let t=l(e*r-a,c-a,.12*r,3);t.translate(u+e*r/2,s-c/2,0),o.push(t),u+=e*r}s-=c}),d(o)}function R(t,n,i,c){let l=L(t,n),u=new r,d=(e,t,n=0)=>{let r=new o(e,t);return r.position.z=n,u.add(r),r},{depth:f,corner:p}=t===`phone`||t===`tablet`?z(d,t===`phone`,l,i,c):t===`laptop`?B(u,l,i,c):V(d,l,i,c);u.updateMatrixWorld(!0);let m=new s().setFromObject(u),h=m.getSize(new a),g=m.getCenter(new a),_=new r;u.position.copy(g).negate(),_.add(u),_.updateMatrixWorld(!0);let v=[];return _.traverse(t=>{let n=t;if(!n.isMesh)return;n.geometry.computeBoundingBox();let r=n.geometry.boundingBox,i=r?e(r):[];for(let e of i)v.push(e.applyMatrix4(n.matrixWorld))}),{group:_,width:h.x,height:h.y,depth:Math.max(f,h.z),corner:p,base:t===`laptop`,aspect:l,points:v}}function z(e,t,n,r,i){let a=Math.min(n,1),o=(t?.042:.055)*a,s=n+2*o,c=1+2*o,d=(t?.1:.035)*Math.min(s,c),f=(t?.16:.085)*Math.min(s,c)*r;e(u(s,c,d,f,d*.4),[i.glass,i.satin,i.metal]);let p=d/2+.0015*a;e(l(n,1,Math.max(0,f-o*.9)),i.screen,p);let m=1>=n;if(!t){let t=.009*a,r=e(l(2*t,2*t,t),i.chrome,d/2+8e-4*a);return m?r.position.y=1/2+o/2:r.position.x=-n/2-o/2,{depth:d,corner:f}}let h=.32*a,g=.093*a,_=.028*a+g/2,v=e(l(m?h:g,m?g:h,g/2),i.glass,p+.001*a);m?v.position.y=1/2-_:v.position.x=-n/2+_;let y=d*.42,b=Math.max(s,c);for(let[t,n,r]of[[1,.16,.16],[-1,.2,.09],[-1,.06,.09]]){let a=r*b,o=e(u(m?y:a,m?a:y,y,y/2,y/3),i.metal),l=(m?s:c)/2-y*.3;m?o.position.set(t*l,n*b,0):o.position.set(-n*b,t*l,0)}return{depth:d,corner:f}}function B(e,t,n,i){let a=t,s=.026*a,d=.036*a,f=.052*a,p=t+2*s,m=1+d+f,h=.012*p,g=.03*p*n;e.rotation.x=oe;let _=new r;_.rotation.x=-F,e.add(_);let v=new o(u(p,m,h,g,h*.45),[i.glass,i.satin,i.metal]);v.position.y=m/2,_.add(v);let y=new o(l(t,1,Math.min(g*.25,.006*a)),i.screen);y.position.set(0,f+1/2,h/2+.0012*a),_.add(y);let b=new o(l(.009*a,.009*a,.0045*a),i.well);b.position.set(0,m-d/2,h/2+8e-4*a),_.add(b);let x=m*.92,S=.026*p,C=(t,n,r)=>{t.rotation.x=-Math.PI/2,t.position.set(0,n,r),e.add(t)},w=u(p,x,S,g,S*.4);C(new o(w,[i.satin,i.metal,i.metal]),-S/2,x/2-h);let T=p*.86,E=x*.42,D=x*.07-h+E/2,O=l(T*1.01,E*1.03,.01*p);C(new o(O,i.well),6e-4*a,D),C(new o(de(T*.985,E*.97),i.keys),.0016*a,D);let k=l(p*.4,x*.32,.012*p);C(new o(k,i.pad),8e-4*a,x*.71-h);let A=new o(new c(S*.42,S*.42,p*.72,24),i.well);return A.rotation.z=Math.PI/2,A.position.set(0,-S*.1,-h*.6),e.add(A),{depth:x,corner:g}}function V(e,t,n,r){let i=Math.max(t,1),a=.055*i,o=1+a,s=.012*i,c=.014*i*n;e(u(t,o,s,c,s*.45),[r.chrome,r.chrome,r.chrome]);let d=s/2+8e-4*i,f=Math.max(0,c-5e-4*i),p=e(l(t,1,[0,0,f,f]),r.screen,d);p.position.y=-a/2;let m=o/2-a/2,h=.115*a;r.lights.forEach((n,r)=>{e(l(2*h,2*h,h),n,d).position.set(-t/2+a*(.4+.38*r),m,d)});let g=e(l(Math.min(t*.42,a*9),a*.56,a*.28),r.pill,d);return g.position.y=m,{depth:s,corner:c}}function H(e,n,r,i,a){let o=t(e.points,U,[n[0]],n[1],r,i,a);return o.scale||=1,o}const U=new i;function fe(e){e.traverse(e=>e.geometry?.dispose())}const W=v({name:`device`,params:{frame:_(`phone`,`tablet`,`laptop`,`browser`),color:Object.freeze({"~kind":`color`,value:`#1d1e22`}),yaw:-18,pitch:6,tilt:6.9,turn:0,radius:1,shadow:.5,scale:.9},media:!0,bleed:80,presence:`custom`,quality:{},async setup(e){let{u:t,signal:i,element:a}=e,o=e.params.frame,s=p(t);m(e.map,e.render.renderer);let c=(e,t)=>{let n=new re(e);return n.colorNode=t,n.outputNode=h(),n.maskNode=s,n},l=e=>{let t=new ie;return t.colorNode=e,t.maskNode=s,t},u=t.color,d=ne(ee.sub(S)),_=N(.15,.95,M(w(d.negate(),E),ne(x(-.4,.8,.2)))),v=te(new n(1,1,0,0)),F=v,oe=k(e.map,O(C().mul(F.xy).add(F.zw),0,1)),le=l(j(oe.rgb.add(_.mul(.05)),1)),I=M(u,x(.2126,.7152,.0722)),L={glass:c({metalness:0,roughness:.12},A(328967)),metal:c(o===`browser`?{metalness:0,roughness:.6}:{metalness:.75,roughness:.32},u),satin:c({metalness:.4,roughness:.5},u),screen:le,well:c({metalness:.2,roughness:.7},u.mul(.22)),keys:c({metalness:0,roughness:.55},A(1447706)),pad:c({metalness:.6,roughness:.38},u.mul(.92)),chrome:c({metalness:0,roughness:.6},u),pill:c({metalness:0,roughness:.6},D(u,T(I.lessThan(.25),x(1),x(0)),.12)),lights:[16736087,16694318,2672704].map(e=>l(A(e)))},de=[...new Set(Object.values(L).flat())],z=new r,B=new r;z.add(B),e.place(z,{fit:`none`,replace:!0});let V=f(t);e.place(V.mesh,{fit:`none`}),e.onDispose(()=>{for(let e of de)e.dispose()});let U=()=>{let{width:t,height:n}=e.input;if(t>0&&n>0)return t/n;let r=a;return(r.naturalWidth||r.videoWidth||9)/(r.naturalHeight||r.videoHeight||16)},W=R(o,U(),e.params.radius,L),G=U(),K=e.params.radius;if(B.add(W.group),await e.compile(z),i.aborted)return;let pe=e=>Math.min(ae,Math.max(-ae,e)),me=e=>[e.yaw*P,pe(e.pitch*P)],q=me(e.params),J=q,Y=q,X=1,he=e.params.yaw,Z=e.params.pitch,Q=0,$=0,ge=new g(a,i,()=>e.invalidate()),_e=matchMedia(`(hover: hover)`).matches;return t=>{let n=e.params,r=t.reducedMotion,i=t.width>0&&t.height>0?t.width/t.height:G;(Math.abs(i-G)>G*.01||n.radius!==K)&&(G=i,K=n.radius,B.remove(W.group),fe(W.group),W=R(o,G,Math.max(0,K),L),B.add(W.group));let s=a,c=s.naturalWidth||s.videoWidth||0,l=s.naturalHeight||s.videoHeight||0,u=l>0?c/l:G;v.value.fromArray(ue(u,W.aspect)),(n.yaw!==he||n.pitch!==Z)&&(he=n.yaw,Z=n.pitch,J=q,Y=me(n),X=+!!r,X===1&&(q=Y));let d=_e&&!r&&n.tilt>0?ge.aim(t):void 0,f=d?d[0]*n.tilt*P:0,p=d?-d[1]*n.tilt*P:0,m=Math.min(t.delta,.1);if((Q!==f||$!==p)&&(Q=y(Q,f,se,m),$=y($,p,se,m),Math.abs(Q-f)+Math.abs($-p)<1e-4&&(Q=f,$=p)),X<1){X=r?1:Math.min(1,X+m/.45);let e=b(`cubicInOut`,X);q=X===1?Y:[J[0]+(Y[0]-J[0])*e,J[1]+(Y[1]-J[1])*e]}let h=!r&&n.turn!==0?n.turn*P*(t.progress-.5):0,g=q[0]+h+Q,_=pe(q[1]+$);B.rotation.set(_,g,0);let x=Math.max(0,n.scale),S=ce(t.presence),C=H(W,q,t.width*x,t.height*x,e.render.camera.position.z||1e3),w=C.scale*S,T=C.x*S,E=C.y*S;z.scale.setScalar(w),z.position.set(T,E,0);let{width:D,height:O,depth:k}=W,A=.06*Math.min(D,O)*w,j=Math.max(0,Math.min(1,n.shadow));if(W.base){let e=D*Math.abs(Math.cos(g))+k*Math.abs(Math.sin(g))*.8;V.set(e*w*.92,.1*O*w,A,T,E-.45*O*w,A*1.2,j)}else{let e=D*Math.abs(Math.cos(g))+k*Math.abs(Math.sin(g)),t=O*Math.abs(Math.cos(_))+k*Math.abs(Math.sin(_))*.3,n=-.03*O*w-A*.4;V.set(e*w*.94,t*w*.94,W.corner*w,T,E+n,A,j)}let M=X<1||Q!==f||$!==p,N=Math.min(1,(Math.abs(Q)+Math.abs($))/Math.max(n.tilt*P,.001));return N>0&&e.pose(e.layer,{above:1},N),M}}});export{R as build,ue as coverOf,W as default,H as fitOf,L as screenOf};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,t}from"./intro-BdismCiL.js";import{o as n}from"./define-BwEwaSnA-xcf1zhk4.js";const r={image:()=>import(`./image-
|
|
1
|
+
import{n as e,t}from"./intro-BdismCiL.js";import{o as n}from"./define-BwEwaSnA-xcf1zhk4.js";const r={image:()=>import(`./image-BYW-JRjA.js`),ripple:{load:()=>import(`./ripple-C133L4Vf.js`),params:{strength:1,frequency:40,speed:6},when:`hover`},bend:{load:()=>import(`./bend-D8TNkUYH.js`),params:{strength:1,split:1}},reveal:{load:()=>import(`./reveal-BA8N5-2P.js`),params:{duration:1.2,delay:0,threshold:.2,zoom:1.12,softness:.12},reducedMotion:`off`},parallax:{load:()=>import(`./parallax-BgMW0pb1.js`),params:{depth:.04,scroll:.12,ease:.12,focus:.5},reducedMotion:`off`},gallery:{load:()=>import(`./gallery-u2qN6TpX.js`),params:{index:0,duration:1.1,strength:.25,interval:0,click:!0,swipe:!0,loop:!0}},ambient:{load:()=>import(`./ambient-Bcfrp-0a.js`),params:{strength:.5,spread:.35,blur:.6,saturation:1.2,fps:10,ease:.5}},"hover-preview":{load:()=>import(`./hover-preview-BotltukD.js`),params:{width:320,ease:.15,stretch:.4,tilt:6,duration:.35,offset:[0,0],radius:0},when:`(hover: hover) and (pointer: fine)`},sequence:{load:()=>import(`./sequence-CCkUdVro.js`),params:{start:0,end:1,frame:0,blend:!1,ease:0,cache:6},reducedMotion:`off`},expand:{load:()=>import(`./expand-CKDy_2WG.js`),params:{position:0,start:0,end:.5,out:1,zoom:1.1,radius:0,ease:0},reducedMotion:`off`},"zoom-scroll":{load:()=>import(`./zoom-scroll-DJ-AQU_C.js`),params:{start:0,end:.7,zoom:1.2,radius:0,reverse:!1,ease:0},reducedMotion:`off`},compare:{load:()=>import(`./compare-8vzwMgMl.js`),params:{position:.5,radius:120,softness:0,thickness:2,color:n(`#ffffff`),handle:!0,start:.2,end:.8,hint:!0}},zoom:{load:()=>import(`./zoom-aNYZw7lo.js`),params:{zoom:2.5,radius:80,ease:.08},when:`(hover: hover) and (pointer: fine)`},lightbox:{load:()=>import(`./lightbox-DAaw2XVl.js`),params:{index:-1,margin:24,zoom:3,duration:.45,backdrop:n(`#0b0b0c`),dim:.92,loop:!1,swipe:!0}},panorama:{load:()=>import(`./panorama-BqeH0D7N.js`),params:{yaw:0,pitch:0,fov:75,range:[35,100],spin:0,drag:!0,zoom:!0,gyro:!1,marker:n(`#ffffff`),markerSize:28,fps:30}},tilt:{load:()=>import(`./tilt-Zp2tnT9H.js`),params:{tilt:12,lift:20,perspective:800,ease:.12,glare:.25,foil:0,shadow:.35,reverse:!1,gyro:!1}},tone:{load:()=>import(`./tone-rFWtRG7p.js`),params:{color:n(`#000000`),background:n(`#ffffff`),strength:1,contrast:1,cell:6,angle:45,radius:140,duration:.4}},flipbook:{load:()=>import(`./flipbook-ClUXqZdH.js`),params:{index:0,cover:!0,duration:.9,curl:.6,shade:.5,click:!0,swipe:!0}},spin:{load:()=>import(`./spin-BldwAvsU.js`),params:{frame:0,row:0,sensitivity:1,spin:0,inertia:0,loop:!0,reverse:!1,blend:!1,hint:!0,cache:8,fps:30}},glitch:{load:()=>import(`./glitch-CyYhXbVf.js`),params:{strength:1,blocks:12,split:8,interval:3,duration:.45,seed:1},reducedMotion:`off`},pixelate:{load:()=>import(`./pixelate-5_dR-wOy.js`),params:{cell:32,duration:1.2,delay:0},intro:e},"video-hover":{load:()=>import(`./video-hover-Dg2wpuD-.js`),params:{duration:.3,delay:.15,from:0,loop:!0},when:`(hover: hover) and (pointer: fine)`,reducedMotion:`off`},stack:{load:()=>import(`./stack-B2oyS9vm.js`),params:{index:0,rotate:6,offset:12,duration:.6,shadow:.35,loop:!0,swipe:!0,click:!0,seed:1}},coverflow:{load:()=>import(`./coverflow-B_1fIzNZ.js`),params:{index:0,angle:60,spacing:.3,depth:.6,shade:.4,reflection:0,perspective:900,duration:.5,loop:!1,drag:!0,wheel:!0,click:!0}},carousel:{load:()=>import(`./carousel-B8W-k9q9.js`),params:{index:0,interval:0,spacing:.4,tilt:8,focus:1.15,shade:.5,reflection:0,perspective:1200,duration:.7,drag:!0,wheel:!0,click:!0,pause:!0}},polaroids:{load:()=>import(`./polaroids-q_ne0Qfz.js`),params:{index:0,open:-1,rotate:8,spread:1,border:10,paper:n(`#fbfaf6`),shadow:.45,zoom:2,duration:.5,drag:!0,seed:1}},spotlight:{load:()=>import(`./spotlight-Cz01jhVU.js`),params:{radius:140,softness:.5,dim:.8,color:n(`#000000`),blur:12,rest:0,ease:.08,duration:.3}},scrub:{load:()=>import(`./scrub-t2IRRW0c.js`),params:{start:0,end:1,position:0,from:0,ease:.1,blend:.12},reducedMotion:`off`},chroma:{load:()=>import(`./chroma-BIq-O9IL.js`),params:{screen:n(`#00b140`),similarity:.45,softness:.1,spill:.5,blur:1,crop:[0,0,0,0]},intro:!0},liquid:{load:()=>import(`./liquid-BBHOkeBl.js`),params:{strength:1,radius:80,duration:1.5,swirl:.5,shine:.5,split:1},reducedMotion:`off`},horizontal:{load:()=>import(`./horizontal-D_WilRKj.js`),params:{strength:1,stretch:.15,parallax:.06,pace:1,reverse:!1,ease:.3},reducedMotion:`off`},curtain:{load:()=>import(`./curtain-RW-0G4V2.js`),params:{position:0,start:.15,end:.85,out:1,count:5,color:n(`#0b0b0c`),zoom:1.1,shade:.5,ease:0},reducedMotion:`off`,intro:t},flare:{load:()=>import(`./flare-DCxWeKAq.js`),params:{strength:.6,glow:.25,ghosts:4,streak:0,color:n(`#ffe8c8`),position:[.8,.2],travel:.6,angle:115,width:.3,rest:0,ease:.12,duration:.4}},frost:{load:()=>import(`./frost-CI6gzTIk.js`),params:{blur:22,strength:.45,grain:.5,radius:70,refog:4,refill:1,duration:1.2,start:.15,end:.5,cover:1,x:.5,y:.5,middle:0,color:n(`#eef3f7`)}},reflection:{load:()=>import(`./reflection-DyU0S1La.js`),params:{strength:.35,reach:.45,blur:8,gap:0,trim:!0,ripple:0,shadow:0,fps:30}}};export{r as media};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as e}from"./define-BwEwaSnA-xcf1zhk4.js";const t={chart:{load:()=>import(`./chart-BW7QKOBq.js`),params:{duration:1,stagger:.06,grid:!0,labels:!0}},graph:{load:()=>import(`./graph-QN0JvEN5.js`),params:{radius:6,thickness:1.25,labels:!0,arrows:!1,dim:.75,duration:.6,stagger:.12}},heatmap:{load:()=>import(`./heatmap-BAlNtCZs.js`),params:{steps:5,gap:2,radius:2,labels:!0,legend:!0,dim:.35,duration:.5,stagger:.02}},map:{load:()=>import(`./map-DBAQehdJ.js`),params:{center:0,zoom:1,color:e(`#8792a8`),sea:0,land:e(`#8792a8`),marker:e(`#ff5a36`),arc:e(`#ff5a36`),markerSize:8}}};export{t as data};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./define-BwEwaSnA-xcf1zhk4.js";const t={globe:{load:()=>import(`./globe-
|
|
1
|
+
import{o as e}from"./define-BwEwaSnA-xcf1zhk4.js";const t={globe:{load:()=>import(`./globe-BU7qa13F.js`),params:{lat:20,lng:0,spin:3.6,drag:!0,scale:.8,color:e(`#0d1220`),land:e(`#5b6b8c`),marker:e(`#ffb547`),arc:e(`#ffb547`),atmosphere:e(`#6ea8ff`),glow:.4,markerSize:6,fps:30}}};export{t as globe};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,s as t}from"./dist-
|
|
1
|
+
import{r as e,s as t}from"./dist-D3F4iUyc.js";const n=2e3,r=1.5;var i=class{period=0;#e=[];#t=[];#n=0;#r=0;#i;#a=-1/0;get share(){return this.#t.length?this.#r/this.#t.length:0}frame(e){let t=this.#i;if(this.#i=e,t===void 0)return!1;let i=e-t;if(t<this.#a||i>250)return!1;if(!this.period){if(this.#e.push(i),this.#e.reduce((e,t)=>e+t,0)>=1e3){let e=[...this.#e].sort((e,t)=>e-t);this.period=e[Math.floor(e.length*.1)]}return!1}for(this.#t.push(i),this.#n+=i,i>r*this.period&&this.#r++;this.#n-this.#t[0]>=n;)this.#o();return this.#n>=n&&this.share>=.25}stop(){this.#i=void 0}quiet(e){this.#a=Math.max(this.#a,e)}clear(){for(;this.#t.length;)this.#o()}#o(){let e=this.#t.shift();this.#n-=e,e>r*this.period&&this.#r--}};const a=[[`software`,/swiftshader|llvmpipe|lavapipe|basic render|software/i],[`mobile`,/mali|adreno|powervr|apple gpu|^(qualcomm|arm|imagination)\b/i],[`integrated`,/intel.*\b(hd|uhd|iris|gen-\d|xe-lp)|radeon\(tm\) graphics|apple m\d/i],[`discrete`,/nvidia|geforce|rtx|radeon rx|\barc\b|xe-hp/i]],o=e=>a.find(([,t])=>t.test(e))?.[0]??`unknown`;function s(e,t){let n=(t.memory??8)<=3||(t.cores??8)<=4,r=e.class===`software`?`low`:e.class===`mobile`?n?`low`:`medium`:e.class===`integrated`?/apple m\d/i.test(e.name)?`high`:`medium`:e.class===`discrete`||!t.coarse?`high`:`medium`;return r===`high`&&t.ratio>=3&&t.pixels>=15e5?`medium`:r}function c(e){let{backend:t}=e,n=e.renderer.backend,r=``;try{let e=n?.device?.adapterInfo,t=n?.gl;if(e)r=[e.vendor,e.architecture,e.description].filter(Boolean).join(` `);else if(t){let e=t.getExtension(`WEBGL_debug_renderer_info`);r=String(t.getParameter(e?e.UNMASKED_RENDERER_WEBGL:t.RENDERER)??``)}}catch{}return{backend:t,name:r,class:o(r)}}function l(){let e=typeof navigator>`u`?{}:navigator,t=typeof devicePixelRatio==`number`?devicePixelRatio:1,n=typeof window>`u`?void 0:window.screen;return{memory:e.deviceMemory,cores:e.hardwareConcurrency,coarse:typeof matchMedia==`function`&&matchMedia(`(pointer: coarse)`).matches,ratio:t,pixels:(n?.width??0)*(n?.height??0)*t*t}}const u=[`low`,`medium`,`high`],d={low:1,medium:1.5,high:1/0},f={tier:`auto`,adapt:!0,remember:!0,pixelRatio:d},p=`dio:quality`,m=()=>performance.now();function h(e){try{let t=JSON.parse(sessionStorage.getItem(p)??`null`);return t?.gpu===e&&t.tier&&u.includes(t.tier)?t.tier:void 0}catch{return}}function g(e,t){try{sessionStorage.setItem(p,JSON.stringify({gpu:e,tier:t}))}catch{}}const _=/*#__PURE__*/ e({name:`quality`,dependencies:[`render`,`stage`],defaults:f,setup(e,n){let{render:r}=e,a={...d,...n.pixelRatio},o=c(r),f=s(o,l()),p=n.remember?h(o.name):void 0,_=n.tier!==`auto`,v=t(_?n.tier:p??f),y=t(_?`pinned`:p?`remembered`:`detected`),b=new i,x=!_,S=0,C=-1/0,w=0,T=r.maxPixelRatio.peek();r.maxPixelRatio.value=a[v.peek()],e.onDispose(()=>{w&&cancelAnimationFrame(w),r.maxPixelRatio.value=T});let E=(t,i)=>{y.value=i,x&&n.remember&&g(o.name,t),t!==v.peek()&&(v.value=t,r.maxPixelRatio.value=a[t],b.quiet(m()+1e3),e.emit(`quality:tier`,{tier:t,reason:i}))},D=()=>x&&n.adapt&&S<2&&v.peek()!==`low`,O=()=>b.quiet(m()+500),k=/* @__PURE__ */ new Map;e.on(`effects:status`,({element:e,effect:t,status:n})=>{let r=k.get(e);n===`loading`?k.set(e,new Set(r).add(t)):r?.delete(t)&&!r.size&&k.delete(e)});let A=e=>{w=0,k.size&&b.quiet(e+500),D()&&b.frame(e)&&(S++,E(u[u.indexOf(v.peek())-1],`slow`),b.clear(),b.quiet(e+3e3)),D()&&m()-C<=100?w=requestAnimationFrame(A):b.stop()};e.system(`afterRender`,e=>{C=m(),e.resumed&&O(),!w&&D()&&(w=requestAnimationFrame(A))},{name:`quality`}),e.on(`effects:status`,({status:e})=>{e===`running`&&O()});for(let t of[`page:leave`,`page:enter`])e.on(t,O);let j=!1;return e.effect(()=>{e.stage.width.value,e.stage.height.value,j&&O(),j=!0}),{tier:v,reason:y,gpu:o,set(t){t!==`auto`&&!u.includes(t)?e.log.warn(`quality.set: "${String(t)}" is not a tier`):(S=0,b.clear(),x=t===`auto`,t===`auto`?E(s(o,l()),`detected`):E(t,`pinned`))},stats:()=>({refresh:b.period?1e3/b.period:0,slowShare:b.share,steps:S})}}});export{_ as quality};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./define-BwEwaSnA-xcf1zhk4.js";const t={beam:{load:()=>import(`./beam-
|
|
1
|
+
import{o as e}from"./define-BwEwaSnA-xcf1zhk4.js";const t={beam:{load:()=>import(`./beam-DzvZ4-cm.js`),params:{color:e(`#ffaa40`),color2:e(`#9c40ff`),length:240,speed:200,thickness:2,glow:.8,fps:60}},glow:{load:()=>import(`./glow-DOprbhYL.js`),params:{color:e(`#ffffff`),radius:320,border:1,fill:.12,ease:.1},when:`hover`},shine:{load:()=>import(`./shine-DbMDtG1U.js`),params:{angle:120,width:.35,color:e(`#ffffff`),duration:1.1,interval:4,strength:.5},reducedMotion:`off`}};export{t as blocks};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,c as t,d as n,f as r,i,l as a,n as o,o as s,p as c,r as l,s as u,t as d,u as f}from"./intro-Du94izRI.js";import{o as p}from"./define-BwEwaSnA-xcf1zhk4.js";const m={"text-reveal":{load:()=>import(`./text-reveal-
|
|
1
|
+
import{a as e,c as t,d as n,f as r,i,l as a,n as o,o as s,p as c,r as l,s as u,t as d,u as f}from"./intro-Du94izRI.js";import{o as p}from"./define-BwEwaSnA-xcf1zhk4.js";const m={"text-reveal":{load:()=>import(`./text-reveal-BJmJjgHF.js`),params:{duration:.9,stagger:.03,delay:0,rise:.6,tilt:35,blur:.5,threshold:.2},reducedMotion:`off`,intro:n},scramble:{load:()=>import(`./scramble--SAk7Gje.js`),params:{duration:.6,stagger:.03,delay:0,cycle:.06,threshold:.2},reducedMotion:`off`,intro:u},marquee:{load:()=>import(`./marquee-BCgbw-V7.js`),params:{speed:60,gap:0,boost:.3,skew:6,reverse:!1,pause:!0,fade:.08}},"video-text":{load:()=>import(`./video-text-CtbM-fw1.js`),params:{fps:30,loop:!0,dim:0}},wave:{load:()=>import(`./wave-DRK0KNEj.js`),params:{amplitude:.25,wavelength:6,speed:.5,duration:.7,stagger:.04,delay:0,threshold:.2,fps:30},reducedMotion:`off`},"split-flap":{load:()=>import(`./split-flap-DpUw1gnF.js`),params:{duration:.07,flips:10,stagger:.03,delay:0,threshold:.2,tile:p(`#1c1c1f`),gap:.08,shade:.5},reducedMotion:`static`,intro:f},magnet:{load:()=>import(`./magnet-FsTzNMLg.js`),params:{radius:2.5,strength:1,rotate:30,stiffness:180,damping:12},reducedMotion:`off`},assemble:{load:()=>import(`./assemble-VLTAzADl.js`),params:{dot:2.2,duration:1.4,stagger:.03,spread:1,delay:0,threshold:.2,color:p(`currentColor`),accent:p(`currentColor`)},reducedMotion:`off`,intro:d},dust:{load:()=>import(`./dust-C3kvA3IL.js`),params:{dot:1.6,duration:2.2,angle:15,turbulence:1,depth:1,shadow:.5}},"text-glitch":{load:()=>import(`./text-glitch-U4WGJ5u4.js`),params:{strength:1,split:6,slices:5,interval:3,duration:.7,seed:1},reducedMotion:`off`},neon:{load:()=>import(`./neon-qZ8SN9C2.js`),params:{glow:.5,strength:1,depth:.12,shadow:.6,tilt:5,flicker:.3,broken:0,seed:1},intro:!0},extrude:{load:()=>import(`./extrude-ito7Xzp3.js`),params:{depth:24,layers:4,tilt:12,light:315}},counter:{load:()=>import(`./counter-mHe41-Kb.js`),params:{duration:2,from:0,stagger:.12,delay:0,threshold:.3},reducedMotion:`off`,intro:l},shimmer:{load:()=>import(`./shimmer-C17GRn87.js`),params:{bevel:.08,angle:110,width:1,speed:1,strength:1,follow:1,shadow:.5},intro:!0},rotator:{load:()=>import(`./rotator-C0nKwxBs.js`),params:{interval:2.2,duration:.8,depth:1,shade:1,pause:!0,loop:!0}},inflate:{load:()=>import(`./inflate-DWXCm_lZ.js`),params:{depth:1,gloss:.7,squish:1,tilt:10,duration:1.1,stagger:.06,delay:0,threshold:.3},intro:i},ribbon:{load:()=>import(`./ribbon-D36MksFx.js`),params:{wind:1,speed:1,folds:2.5,twist:180,gloss:.6},intro:s},orbit:{load:()=>import(`./orbit-DBZKIX-U.js`),params:{radius:1,tilt:15,roll:0,speed:20,repeat:!0,fade:.55,pause:!0,fps:60,color:p(`currentColor`)},intro:!0},voxel:{load:()=>import(`./voxel-DQGwuXRZ.js`),params:{depth:1,drop:240,duration:.9,stagger:.1,bounce:1,radius:120,delay:0,threshold:.2,studs:!0},reducedMotion:`static`,intro:c},emboss:{load:()=>import(`./emboss-BCACs_Hc.js`),params:{depth:.05,bevel:.03,light:315,follow:1,grain:1},intro:!0},shatter:{load:()=>import(`./shatter-CuQo3y4x.js`),params:{strength:1,spin:1,gravity:1,depth:1,hold:1.5},intro:t},tunnel:{load:()=>import(`./tunnel-BpAc9qXm.js`),params:{depth:1,perspective:1,fade:.6,blur:10,streak:1,twist:50,lines:!0,color:p(`currentColor`)},reducedMotion:`off`,intro:!0},melt:{load:()=>import(`./melt-ESf995Jj.js`),params:{strength:1,speed:1,gloss:1}},unfold:{load:()=>import(`./unfold-BlnBGJgY.js`),params:{angle:180,duration:.9,stagger:.3,paper:p(`#f8f5ee`),shade:.7,delay:0,threshold:.2},reducedMotion:`off`,intro:r},pins:{load:()=>import(`./pins-BYxRXd1W.js`),params:{height:26,radius:70,duration:1.6,color:p(`currentColor`)},intro:!0},smoke:{load:()=>import(`./smoke-DcL9Tgu8.js`),params:{density:1,speed:1,rise:1,turbulence:1,duration:2.4,seed:1},reducedMotion:`off`,intro:a},blinds:{load:()=>import(`./blinds-Cfp4MlwN.js`),params:{gap:2,duration:.9,stagger:.07,delay:0,threshold:.3,angle:65,light:315,back:p(`currentColor`)},reducedMotion:`off`,intro:o},physics:{load:()=>import(`./physics-BUGo8jx6.js`),params:{gravity:1,bounce:.35,friction:.5,depth:.25,throw:1},reducedMotion:`off`,intro:e},fire:{load:()=>import(`./fire-BqLf_28X.js`),params:{strength:1,height:.9,speed:1,embers:30,char:.4}},water:{load:()=>import(`./water-DGR3R3mN.js`),params:{depth:1,caustics:1,ripples:1,rain:6,damping:.5,tint:.5},intro:!0},keycaps:{load:()=>import(`./keycaps-K9ynUNH6.js`),params:{depth:.22,gap:.07,radius:.16,speed:9,sound:!1},intro:!0},lens:{load:()=>import(`./lens-i7hMBKr1.js`),params:{radius:90,zoom:2,dispersion:1,thickness:.4,tilt:12,ease:.12}},prism:{load:()=>import(`./prism-D42Cokzm.js`),params:{dispersion:1,spread:1,strength:1,bevel:.07,light:300,follow:1,fps:30},intro:!0},hologram:{load:()=>import(`./hologram-DNSYtXyV.js`),params:{layers:6,depth:.3,scan:1,flicker:.4,sway:6,tilt:8},intro:!0}};export{m as text};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as e}from"./define-BwEwaSnA-xcf1zhk4.js";const t={model:{load:()=>import(`./model-6i1EzlCa.js`),params:{color:e(`#ffffff`),duration:.4,scale:.9,yaw:0,pitch:0,spin:0,turn:0,tilt:8.6,drag:!0,exposure:1}},device:{load:()=>import(`./device-BIs2OdoL.js`),params:{color:e(`#1d1e22`),yaw:-18,pitch:6,tilt:6.9,turn:0,radius:1,shadow:.5,scale:.9}},book:{load:()=>import(`./book-DQdA0nHh.js`),params:{pages:320,yaw:0,swing:36,open:12,tilt:5.7,drag:!0,shadow:.5}},explode:{load:()=>import(`./explode-BqlaXfaX.js`),params:{spread:1,start:0,end:1,position:0,cascade:.3,twist:0,ease:.15,contain:!0}},hotspots:{load:()=>import(`./hotspots-CEzJsuww.js`),params:{face:!0}},box:{load:()=>import(`./box-D16Z4Evl.js`),params:{yaw:0,pitch:0,swing:30,open:.6,tilt:5.7,spin:0,drag:!0,shadow:.5}},coin:{load:()=>import(`./coin-mgZ4M3Xj.js`),params:{metal:e(`#d4af5f`),ink:1,relief:.6,yaw:0,pitch:0,tilt:14.3,turn:0,spin:0,drag:!0,shadow:.5}},vinyl:{load:()=>import(`./vinyl-g63s_sem.js`),params:{color:e(`#c8323c`),out:.55,rpm:33,tilt:6.9,shadow:.5}},label:{load:()=>import(`./label-BOXNWs00.js`),params:{yaw:0,pitch:8,tilt:6.9,turn:180,spin:0,gloss:.5,drag:!0,shadow:.5}}};export{t as model};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./dev-CoKR705i.js";const t={config:`CONFIG_INVALID`,setup:`PLUGIN_SETUP`,listener:`LISTENER`,hook:`HOOK`,system:`SYSTEM`,effect:`EFFECT`,dispose:`DISPOSE`,loop:`LOOP`,report:`REPORTED`};var n=class extends Error{code;plugin;problems;constructor(t,n,r={}){let i=r.plugin?`[diorama:${r.plugin}]`:`[diorama]`;super(e(`${i} ${t}: ${n}`,t),r.cause===void 0?void 0:{cause:r.cause}),this.name=`DioramaError`,this.code=t,this.plugin=r.plugin,this.problems=r.problems??[]}};function r(e,t){if(typeof e!=`object`||!e)return!1;let n=e;return n.name===`DioramaError`&&typeof n.code==`string`&&(!t||n.code===t)}function i(e){return e instanceof Error?e.message:String(e)}function a(e,a,o){return r(e)?e:new n(t[a],i(e),{plugin:o,cause:e})}const o=e=>e===void 0?[]:typeof e==`string`?[e]:e;function s(e,t,n){let r=Array(e).fill(0);for(let e of t)for(let t of e)r[t]=(r[t]??0)+1;let i=Array(e).fill(!1),a=[];for(;;){let o=-1;for(let t=0;t<e;t++)!i[t]&&r[t]===0&&(o<0||n(t,o))&&(o=t);if(o<0)break;i[o]=!0,a.push(o);for(let e of t[o]??[])r[e]=(r[e]??0)-1}return a.length===e?a:{stuck:[...i.keys()].filter(e=>!i[e])}}function c(e,t){let n=new Set(t),r=/* @__PURE__ */ new Set,i=/* @__PURE__ */ new Set,a=[],o=t=>{r.add(t),a.push(t);for(let s of e[t]??[]){if(!n.has(s)||i.has(s))continue;if(r.has(s))return[...a.slice(a.indexOf(s)),s];let e=o(s);if(e)return e}a.pop(),r.delete(t),i.add(t)};for(let e of t){let t=i.has(e)?void 0:o(e);if(t)return t}return[...t]}function l(e){let t=e.map(()=>[]);e.forEach((n,r)=>{e.forEach((e,i)=>{r!==i&&(n.before.some(t=>e.labels.includes(t))&&t[r]?.push(i),n.after.some(t=>e.labels.includes(t))&&t[i]?.push(r))})});let n=s(e.length,t,(t,n)=>{let r=e[t],i=e[n];return r.rank===i.rank?r.seq<i.seq:r.rank<i.rank});return Array.isArray(n)?n.map(t=>e[t]):{cycle:c(t,n.stuck).map(t=>e[t])}}const u={debug:0,info:1,warn:2,error:3,silent:4},d=()=>{},f=Promise.resolve();function p(e){return(typeof e==`object`||typeof e==`function`)&&e!==null&&typeof e.then==`function`}function m(e,t){let n={...e};if(!t)return n;for(let[e,r]of Object.entries(t))r!==void 0&&(n[e]=r);return n}function h(e,t){let n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;let r=e,i=t;return n.every(e=>Object.is(r[e],i[e]))}function g(){return typeof performance>`u`?Date.now():performance.now()}function _(e,t,n){let r=u[t],i=t=>(...i)=>{u[t]<r||(n?e[t](n,...i):e[t](...i))};return{debug:i(`debug`),info:i(`info`),warn:i(`warn`),error:i(`error`)}}const v=Symbol.for(`diorama.plugin`),y=Symbol.for(`diorama.preset`),b=e=>{if(typeof e==`string`)return e;let t=e?.name;return typeof t==`string`?t:void 0},x=e=>typeof e==`function`?e[v]:void 0,ee=e=>typeof e==`object`&&!!e&&y in e;function te(e){let t=[];typeof e.name==`string`&&/^[a-z][A-Za-z0-9]*$/.test(e.name)||t.push(`name "${String(e.name)}" must be a lowerCamelCase identifier`),typeof e.setup!=`function`&&t.push(`setup must be a function`);let n=[e.dependencies??[],e.optionalDependencies??[]];return n.every(Array.isArray)?n.flat().some(e=>b(e)===void 0)&&t.push(`dependencies must be names or plugins`):t.push(`dependencies must be arrays`),e.core!==void 0&&typeof e.core!=`string`&&t.push(`core must be a semver range`),e.defaults!==void 0&&(typeof e.defaults!=`object`||e.defaults===null)&&t.push(`defaults must be an object`),e.schema!==void 0&&typeof e.schema?.[`~standard`]?.validate!=`function`&&t.push(`schema must implement Standard Schema`),t}function ne(e,t){let n=n=>ne(e,m(t,n)),r=e=>Object.freeze(Array.isArray(e)?e.map(e=>b(e)??``):[]);return Object.defineProperties(n,{name:{value:e.name},version:{value:e.version,enumerable:!0},options:{value:Object.freeze({...t}),enumerable:!0},defaults:{value:Object.freeze({...e.defaults}),enumerable:!0},schema:{value:e.schema,enumerable:!0},dependencies:{value:r(e.dependencies),enumerable:!0},optionalDependencies:{value:r(e.optionalDependencies),enumerable:!0},[v]:{value:e}}),Object.freeze(n)}function S(e){return ne(e,{})}function re(e){return Object.freeze({name:e.name,plugins:C(e.plugins),presets:C(e.presets),[y]:!0})}const C=e=>Array.isArray(e)?Object.freeze([...e]):e??[],ie=/^v?(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?(?:\+[0-9A-Za-z.-]+)?$/,w=`(\\*|x|X|\\d+)`,ae=RegExp(`^(\\^|~|>=|<=|>|<|=)?v?${w}(?:\\.${w})?(?:\\.${w})?(?:-([0-9A-Za-z.-]+))?(?:\\+[0-9A-Za-z.-]+)?$`);function oe(e,t){let n=ce(e);return n?t.split(`||`).some(e=>se(n,e)):!1}function se(e,t){let n=t.trim().replace(/(\^|~|>=|<=|>|<|=)\s+/g,`$1`).split(/\s+/).filter(Boolean),r=[];for(let e of n){let t=le(e);if(!t)return!1;r.push(...t)}if(!r.every(t=>de(e,t)))return!1;if(!e.pre.length)return!0;let i=E(...e.triple);return r.some(e=>e.version.pre.length>0&&fe(E(...e.version.triple),i)===0)}function ce(e){let t=ie.exec(e.trim());if(t)return{triple:[Number(t[1]),Number(t[2]),Number(t[3])],pre:t[4]?t[4].split(`.`):[]}}function le(e){let t=ae.exec(e);if(!t)return;let n=t[1]??``,[r,i,a]=[t[2],t[3],t[4]],o=t[5]?t[5].split(`.`):[];if(D(r))return n===``||n===`=`||n===`>=`||n===`<=`?[]:void 0;let s=Number(r),c=D(i)?void 0:Number(i),l=D(a)?void 0:Number(a);if(n===`^`){let e=E(s,c??0,l??0,o);return T(e,ue(s,c,l))}let u=c===void 0||l===void 0;if(n===`~`||(n===``||n===`=`)&&u){let e=E(s,c??0,l??0,o),t=c===void 0?E(s+1,0,0):E(s,c+1,0);return T(e,t)}if(u){let e=c===void 0?E(s+1,0,0):E(s,c+1,0),t=E(s,c??0,0);return n===`>`?[{op:`>=`,version:e}]:n===`<=`?[{op:`<`,version:e}]:[{op:n,version:t}]}return[{op:n===``?`=`:n,version:E(s,c,l,o)}]}function ue(e,t,n){return e>0||t===void 0?E(e+1,0,0):t>0||n===void 0?E(0,t+1,0):E(0,0,n+1)}const T=(e,t)=>[{op:`>=`,version:e},{op:`<`,version:t}];function de(e,t){let n=fe(e,t.version);switch(t.op){case`<`:return n<0;case`<=`:return n<=0;case`>`:return n>0;case`>=`:return n>=0;default:return n===0}}function fe(e,t){for(let n=0;n<3;n++){let r=(e.triple[n]??0)-(t.triple[n]??0);if(r!==0)return r}if(!e.pre.length||!t.pre.length)return t.pre.length-e.pre.length;for(let n=0;n<Math.max(e.pre.length,t.pre.length);n++){let r=e.pre[n],i=t.pre[n];if(r===void 0)return-1;if(i===void 0)return 1;let a=pe(r,i);if(a!==0)return a}return 0}function pe(e,t){let n=/^\d+$/.test(e),r=/^\d+$/.test(t);return n&&r?Number(e)-Number(t):n?-1:r?1:e<t?-1:+(e>t)}const E=(e,t,n,r=[])=>({triple:[e,t,n],pre:r}),D=e=>e===void 0||e===`*`||e===`x`||e===`X`,me=[`then`,`toJSON`,`spawn`,`query`,`tick`];function he(e,t){let r=[],i=(e,i)=>{if(!e)return;let a=x(e);a?r.push({plugin:e,def:a,layer:i,index:r.length}):t.push(new n(`PLUGIN_INVALID`,`not a plugin: ${String(e)}`))},a=(e,r)=>{if(e&&!r.has(e)){if(!ee(e))t.push(new n(`PLUGIN_INVALID`,`not a preset: ${String(e)}`));else if(r.add(e),!Array.isArray(e.presets)||!Array.isArray(e.plugins))t.push(new n(`PLUGIN_INVALID`,`preset "${e.name}" needs arrays`));else{for(let t of e.presets)a(t,r);for(let t of e.plugins)i(t,1)}}},o=r=>{let i=e.options[r];return i===void 0||Array.isArray(i)?i??[]:(t.push(new n(`CONFIG_INVALID`,`${r} must be an array`)),[])};if(e.options.defaults!==!1)for(let t of e.defaults)i(t,0);for(let e of o(`presets`))a(e,/* @__PURE__ */ new Set);for(let e of o(`plugins`))i(e,2);return r.filter(t=>t.layer===2||!e.disabled.has(String(t.def.name)))}function ge(e,t){return e.disabled.has(t)?` (removed via disable)`:e.options.defaults===!1&&e.defaults.some(e=>e.name===t)?` (defaults are off)`:``}async function _e(e,t,r){let i=/* @__PURE__ */ new Map;for(let e of t){let t=String(e.def.name);i.set(t,[...i.get(t)??[],e])}let a=[],o=/* @__PURE__ */ new Map;for(let[e,t]of i){let r=Math.max(...t.map(e=>e.layer)),i=t.find(e=>e.layer===r),s=Ce(i.def,be(t,i));a.push(s),t.some(e=>e.layer===r&&e.def!==i.def)&&o.set(s,new n(`PLUGIN_DUPLICATE`,`two different plugins named "${e}"`,{plugin:e}))}for(let t of a){let n=o.get(t)??await xe(t,e.reserved);n&&o.set(t,n)}let s=new Set(a.map(e=>e.name));for(let t of a){let i=t.deps.find(e=>!s.has(e)&&!r?.(e));i===void 0||o.has(t)||o.set(t,new n(`PLUGIN_MISSING_DEPENDENCY`,`requires "${i}"${ge(e,i)}`,{plugin:t.name}))}return{list:a,failures:o}}function ve(e){let t=t=>e[t],n=new Map(e.map((e,t)=>[e.name,t])),r=e.map(()=>[]),i=[];e.forEach((e,t)=>{for(let i of e.deps){let e=n.get(i);e!==void 0&&r[e]?.push(t)}e.optional.forEach((e,r)=>{let a=n.get(e);a!==void 0&&i.push({from:a,to:t,position:r})})});let a=s(e.length,r,O);if(!Array.isArray(a))return{cycle:c(r,a.stuck).map(t)};for(;;){let n=r.map(e=>[...e]);for(let e of i)n[e.from]?.push(e.to);let a=s(e.length,n,O);if(Array.isArray(a))return a.map(t);let o=we(i,n,new Set(a.stuck));if(!o)return{cycle:a.stuck.map(t)};i.splice(i.indexOf(o),1)}}const ye=e=>new n(`PLUGIN_CYCLE`,`required dependencies form a cycle: ${e.map(e=>e.name).join(` → `)}`);function be(e,t){let n=e.filter(e=>e.def===t.def).sort((e,t)=>e.layer-t.layer||e.index-t.index),r={...t.def.defaults};for(let e of n)r=m(r,e.plugin.options);return r}async function xe(e,t){let r=e.name,a=te(e.def);if(!a.length&&t(e.name)&&a.push(`name "${e.name}" is reserved by the App API`),a.length)return new n(`PLUGIN_INVALID`,a.join(`; `),{plugin:r});let{core:o,schema:s}=e.def;if(o!==void 0&&!oe(`0.1.3`,o))return new n(`PLUGIN_INCOMPATIBLE`,`requires core ${o}, running 0.1.3`,{plugin:r});let c=e.raw;if(s)try{let t=await s[`~standard`].validate(e.raw);if(t.issues)return new n(`PLUGIN_OPTIONS`,Se(t.issues),{plugin:r});c=t.value}catch(e){return new n(`PLUGIN_OPTIONS`,i(e),{plugin:r,cause:e})}e.options=Object.freeze({...c})}function Se(e){return e.map(e=>{let t=e.path?.map(e=>String(typeof e==`object`?e.key:e)).join(`.`);return t?`${t}: ${e.message}`:e.message}).join(`; `)}function Ce(e,t){let n=e=>Array.isArray(e)?e.map(e=>b(e)??``):[];return{name:String(e.name),def:e,deps:n(e.dependencies),optional:n(e.optionalDependencies),critical:e.critical===!0,raw:t,options:t,status:`pending`,ordinal:-1,service:void 0,hasService:!1,scope:void 0,error:void 0,release:void 0}}const O=(e,t)=>e<t;function we(e,t,n){let r=(e,r)=>{let i=/* @__PURE__ */ new Set,a=e=>e===r||!i.has(e)&&(i.add(e),(t[e]??[]).some(e=>n.has(e)&&a(e)));return a(e)},i;for(let t of e)n.has(t.from)&&n.has(t.to)&&(i&&(t.to<i.to||t.to===i.to&&t.position<=i.position)||r(t.to,t.from)&&(i=t));return i}var Te=class{#e=/* @__PURE__ */ new Map;#t;#n;constructor(e,t){this.#t=e,this.#n=t}on(e,t,n,r){if(!n.open())return d;let i={fn:t,owner:n,once:r,active:!0,off:d};return this.#e.set(e,[...this.#e.get(e)??[],i]),i.off=n.add(()=>{if(!i.active)return;i.active=!1;let t=(this.#e.get(e)??[]).filter(e=>e!==i);t.length?this.#e.set(e,t):this.#e.delete(e)}),i.off}emit(e,t){let r=this.#e.get(e);if(r){if(this.#n.value>=64)this.#t(new n(`RECURSION`,`"${e}" nested too deep`),`listener`,void 0,e);else{this.#n.value++;try{for(let n of r)if(n.active&&!n.owner.disposed){n.once&&n.off();try{let r=n.fn(t);p(r)&&r.then(void 0,t=>this.#t(t,`listener`,n.owner,e))}catch(t){this.#t(t,`listener`,n.owner,e)}}}finally{this.#n.value--}}}}};Object.freeze({"~cancel":!0,reason:void 0});function k(e){return typeof e==`object`&&!!e&&e[`~cancel`]===!0}function Ee(e,t){let n=t??e.label;return e.plugin&&e.plugin!==n?[n,e.plugin]:[n]}var De=class{#e=/* @__PURE__ */ new Map;#t=/* @__PURE__ */ new Map;#n=0;#r;#i;constructor(e,t){this.#r=e,this.#i=t}add(e,t,r,i){if(!r.open())return d;let a={fn:t,owner:r,active:!0,labels:Ee(r,i?.name),before:o(i?.before),after:o(i?.after),rank:r.rank,seq:this.#n++},s=l([...this.#e.get(e)??[],a]);if(!Array.isArray(s))throw new n(`ORDER_CYCLE`,`hook "${e}": ${s.cycle.map(e=>e.labels[0]).join(` → `)}`,{plugin:r.plugin});return this.#a(e,s),r.add(()=>{if(!a.active)return;a.active=!1;let t=(this.#e.get(e)??[]).filter(e=>e!==a);this.#a(e,t)})}call(e,t,r){let i=this.#e.get(e);if(!i)return t;if(this.#i.value>=64)return this.#r(new n(`RECURSION`,`hook "${e}" nested too deep`),`hook`,void 0,e),t;this.#i.value++;try{for(let n of i){if(!n.active||n.owner.disposed)continue;let i;try{i=n.fn(t,r)}catch(t){this.#r(t,`hook`,n.owner,e);continue}if(i!==void 0){if(p(i)){i.then(void 0,d);let t=/* @__PURE__ */ Error(`async handler in sync hook "${e}"`);this.#r(t,`hook`,n.owner,e)}else if(k(i))return i;else t=i}}return t}finally{this.#i.value--}}async callAsync(e,t,n){for(let r of this.#e.get(e)??[]){if(!r.active||r.owner.disposed)continue;let i;try{i=await r.fn(t,n)}catch(t){this.#r(t,`hook`,r.owner,e);continue}if(!(i===void 0||r.owner.disposed)){if(k(i))return i;t=i}}return t}version(e){return this.#t.get(e)??0}#a(e,t){t.length?this.#e.set(e,t):this.#e.delete(e),this.#t.set(e,this.version(e)+1)}};function Oe(e,t){let n=/* @__PURE__ */ new Set,r=()=>{for(let e of n)if(e.requested)return!0;return!1};return{all:n,attach:i=>{let a={tick:i,requested:!1,request(){n.has(a)&&(a.requested=!0,e())},cancel(){a.requested=!1,r()||t()},detach(){n.delete(a),a.cancel()}};return n.add(a),a},anyRequested:r,tickRequested:e=>{let t=!1;for(let r of n)r.requested&&(r.requested=!1,r.tick(e)&&(t=!0));return t}}}function ke(){let e,t=t=>{e=void 0,n.tickRequested(t)},n=Oe(()=>{e===void 0&&typeof requestAnimationFrame==`function`&&(e=requestAnimationFrame(t))},()=>{e!==void 0&&typeof cancelAnimationFrame==`function`&&(cancelAnimationFrame(e),e=void 0)});return{name:`raf`,now:g,attach:n.attach}}function Ae(e,t={}){let n=t.now??g,r,i=()=>{r?.(),r=void 0},a=e=>{s.tickRequested(e??n()),s.anyRequested()||i()},o=!1,s=Oe(()=>{if(!(r||o)){o=!0;try{r=e(a)}finally{o=!1}s.anyRequested()||i()}},i);return{name:t.name??`ticker`,now:n,attach:s.attach}}const je=[`input`,`layout`,`update`,`render`,`afterRender`],Me=1/60;var Ne=class{time;stats;#e={delta:0,rawDelta:0,elapsed:0,now:0,frame:0,resumed:!0};#t={frames:0,wakes:0,reason:`none`,invalidatedBy:``,interval:Me};#n;#r;#i=[];#a=je.map(e=>({name:e,afterOf:void 0,systems:[]}));#o=[];#s=/* @__PURE__ */ new Set;#c=/* @__PURE__ */ new Set;#l=/* @__PURE__ */ new Set;#u=[];#d=[];#f=[];#p=!0;#m;#h=!1;#g=!1;#_=!1;#v=!1;#y=!1;#b=!0;#x=0;#S;#C=Me;#w=0;#T;constructor(e,t,n){this.#T=t,this.time=this.#e,this.stats=this.#t,this.#n={mode:`demand`,maxDelta:.1,maxFps:0,timeScale:1,...Ie(e??{},n)},this.#r=e?.driver??ke()}#E(e){for(let t=this.#i.length;t--;){let n=this.#i[t]?.settings?.[e];if(n!==void 0)return n}return this.#n[e]}get mode(){return this.#E(`mode`)}get maxDelta(){return this.#E(`maxDelta`)}get maxFps(){return this.#E(`maxFps`)}get timeScale(){return this.#E(`timeScale`)}get driver(){for(let e=this.#i.length;e--;){let t=this.#i[e]?.driver;if(t)return t}return this.#r}get awake(){return this.#g||this.#_}get paused(){return this.#l.size>0}overrideLoop(e,t){return this.#D(e,{settings:Ie(t,t=>e.log.warn(t))})}setDriver(e,t){return this.#D(e,{driver:t})}#D(e,t){if(!e.open())return d;let n=e=>{let t=this.driver,n=this.#x-t.now();e(),this.driver!==t&&(this.#x=n>0?this.driver.now()+n:0,this.#h&&(this.#M(),this.#j())),this.#k()};return n(()=>this.#i.push(t)),e.add(()=>n(()=>A(this.#i,t)))}profile(e,t){return e.open()?(this.#u=[...this.#u,t],e.add(()=>{this.#u=this.#u.filter(e=>e!==t)})):d}addStage(e,t,r){if(!r.open())return d;let i=r.plugin;if(this.#a.some(t=>t.name===e))throw new n(`STAGE_DUPLICATE`,`stage "${e}" exists`,{plugin:i});let a=t.before??t.after,o=this.#a.findIndex(e=>e.name===a);if(o<0)throw new n(`STAGE_UNKNOWN`,`no stage "${a}"`,{plugin:i});if(t.after!==void 0)for(o++;this.#a[o]?.afterOf===a;)o++;let s=this.#o.filter(t=>t.stage===e),c={name:e,afterOf:t.after,systems:l(s)};for(let e of c.systems)A(this.#o,e),e.parked=!1;return this.#a.splice(o,0,c),this.#p=!0,r.add(()=>{if(A(this.#a,c)){for(let e of c.systems)e.parked=!0;this.#o.push(...c.systems),this.#p=!0}})}system(e,t,r,i){let a={name:r?.name??i.label,stage:e,owner:i.label,scope:i,run:t,labels:Ee(i,r?.name),before:o(r?.before),after:o(r?.after),rank:i.rank,seq:this.#w++,active:!1,parked:!1,enabled:!0,failures:0,error:void 0},s=d,c=Pe(a,()=>s());if(!i.open())return c;let u=this.#a.find(t=>t.name===e),f=l([...u?u.systems:this.#o.filter(t=>t.stage===e),a]);if(!Array.isArray(f))throw new n(`ORDER_CYCLE`,`stage "${e}": ${f.cycle.map(e=>e.name).join(` → `)}`,{plugin:i.plugin});return u?u.systems=f:(a.parked=!0,this.#o.push(a),this.#s.has(e)||(this.#s.add(e),i.log.warn(`stage "${e}" does not exist yet; system parked`))),a.active=!0,this.#p=!0,s=i.add(()=>{a.active=!1;for(let e of this.#a)e.systems=e.systems.filter(e=>e!==a);A(this.#o,a),this.#p=!0}),c}invalidate(e){this.#v=!0,this.#t.invalidatedBy=e.label,this.#k()}keepAwake(e,t){t>0&&(this.#x=Math.max(this.#x,this.driver.now()+t*1e3)),this.invalidate(e)}hold(e){if(!e.open())return d;let t={};return this.#c.add(t),this.#k(),e.add(()=>this.#c.delete(t)&&this.invalidate(e))}pause(e){if(!e.open())return d;let t={};return this.#l.add(t),this.#g&&=(this.#m?.cancel(),!1),e.add(()=>{this.#l.delete(t)&&!this.#l.size&&(this.#b=!0,this.#k())})}attach(){this.#h=!0,this.#j(),this.#v=!0,this.#k()}stop(){this.#h=!1,this.#M()}#O(){return this.#v||this.#c.size>0||this.mode===`always`||this.#x>0&&this.driver.now()<this.#x}#k(){!this.#h||this.#l.size||this.#g||this.#_||this.#O()&&this.#A()}#A(){this.#g=!0,this.#m?.request()}#j(){this.#m=this.driver.attach((e,t)=>this.#N(e,t)),this.#b=!0,this.#S=void 0,this.#g=!1}#M(){this.#m?.cancel(),this.#m?.detach(),this.#m=void 0,this.#g=!1}#N(e,t){if(this.#_||!this.#h)return!1;if(Number.isFinite(e)||(e=this.#S??0),this.#g=!1,t===void 0){if(this.#l.size||!this.#O())return this.#y=!1,!1;let t=this.maxFps,n=this.#S===void 0?1/0:e-this.#S;if(t>0&&!this.#b&&n>=0&&n<1e3/t-1)return this.#A(),!1}return this.#P(e,t),!0}#P(e,t){if(this.#t.reason=this.#L(t),this.#F(e,t),this.#v=!1,this.#p){this.#f.length=0;for(let e of this.#a)this.#f.push(...e.systems);this.#p=!1}this.#I(),this.#y=this.#h&&!this.#l.size&&this.#O(),this.#y&&this.#A()}#F(e,t){let n=this.#e,r=this.#t,i=this.#C,a=this.#S===void 0?i:Math.max(0,(e-this.#S)/1e3),o=this.#b||this.#S===void 0||!this.#y&&a>=3*i;this.#b=!1,n.delta=(t??Math.min(a,o?i:this.maxDelta))*this.timeScale,t===void 0&&!o&&(this.#C=Fe(i,a)),n.rawDelta=a,n.elapsed+=n.delta,n.now=e,n.frame++,n.resumed=o&&t===void 0,this.#S=e,r.frames++,n.resumed&&r.wakes++,r.interval=this.#C}#I(){this.#d=this.#u,this.#_=!0;try{this.#z(`frameStart`,this.#e);for(let e of this.#f){if(!this.#h)break;e.active&&!e.parked&&e.enabled&&e.scope.ready&&this.#R(e)}this.#z(`frameEnd`,this.#e)}finally{this.#_=!1}}#L(e){return e===void 0?this.#v?`invalidate`:this.#c.size?`hold`:this.mode===`always`?`always`:`timed`:`step`}#R(e){this.#z(`systemStart`,e);try{let t=e.run(this.#e);if(p(t))throw t.then(void 0,d),Error(`system "${e.name}" returned a promise`);e.failures=0}catch(t){if(++e.failures===1&&this.#T(t,`system`,e.scope,e.name),e.failures>=10){e.enabled=!1,e.error=t;let r=new n(`SYSTEM_DISABLED`,`"${e.name}" failed 10 frames in a row`,{plugin:e.scope.plugin,cause:t});this.#T(r,`system`,e.scope,e.name)}}this.#z(`systemEnd`,e)}#z(e,t){for(let n of this.#d)if(this.#u.includes(n))try{n[e](t)}catch(e){this.#u=this.#u.filter(e=>e!==n),this.#T(e,`loop`,void 0,`profiler`)}}};function Pe(e,t){let n=(()=>t());return Object.defineProperties(n,{name:{value:e.name},enabled:{get:()=>e.enabled,set:t=>{e.enabled=t,t&&(e.failures=0,e.error=void 0)}},error:{get:()=>e.error}}),n}function Fe(e,t){let n=t>0&&t<3*e?e+(t-e)*.1:e;return Math.min(Math.max(n,1/240),1/30)}function Ie(e,t){let n={},{mode:r}=e;r===`demand`||r===`always`?n.mode=r:r!==void 0&&t(`loop: invalid mode "${String(r)}" ignored`);for(let r of[`maxDelta`,`maxFps`,`timeScale`]){let i=e[r];Le(i)?n[r]=i:i!==void 0&&t(`loop: invalid ${r} ignored`)}return n}const Le=e=>typeof e==`number`&&Number.isFinite(e)&&e>=0;function A(e,t){let n=e.indexOf(t);return n>=0&&e.splice(n,1),n>=0}var Re=class e{env;label;rank;plugin;allowed;disposed=!1;abortOnAdd=!1;#e;#t;#n;#r=/* @__PURE__ */ new Set;#i;#a;#o;constructor(e){this.env=e.env,this.label=e.label,this.rank=e.rank,this.plugin=e.plugin,this.allowed=e.allowed}get ready(){return this.#e??this.#t?.ready??!0}set ready(e){this.#e=e}get signal(){return this.#i||(this.#i=new AbortController,this.disposed&&this.#i.abort()),this.#i.signal}get log(){return this.#o??=this.env.logFor(this),this.#o}open(){if(!this.disposed)return!0;if(this.abortOnAdd)throw new n(`ABORTED`,`setup was aborted`,{plugin:this.plugin});return this.log.warn(`registration on a closed scope ignored`),!1}add(e){return this.disposed?(this.#s(e),this.open(),d):(this.#r.add(e),()=>{this.#r.delete(e)&&this.#s(e)})}child(t){let n=new e({env:this.env,label:t?.label??this.label,rank:t?.rank??this.rank,plugin:t&&`plugin`in t?t.plugin:this.plugin,allowed:t&&`allowed`in t?t.allowed:this.allowed});if(n.#t=this,this.disposed)n.disposed=!0;else{let e=()=>n.dispose();this.#r.add(e),n.#n=()=>this.#r.delete(e)}return n}dispose(){if(this.#a)return this.#a;let e=d;this.#a=new Promise(t=>{e=t}),this.disposed=!0,this.#n?.();let t=[...this.#r].reverse();this.#r.clear(),this.#i?.abort();let n=t.map(e=>this.#s(e)).filter(p);return e(n.length?Promise.all(n).then(d):f),this.#a}#s(e){try{let t=e();return p(t)?Promise.resolve(t).then(void 0,e=>this.env.report(e,`dispose`,this)):void 0}catch(e){this.env.report(e,`dispose`,this)}}};let j,M=0,N=!1;const P=[];function ze(e){let t=globalThis.reportError;typeof t==`function`?t(e):console.error(e)}function Be(e){j&&!j.has(e)&&j.set(e,e.version)}function F(){if(!(N||M>0)){N=!0;try{let e=0;for(;P.length;){if(++e>100){for(let e of P)e.queued=!1;P.length=0,ze(new n(`SIGNAL_CYCLE`,`effects did not settle after 100 passes`));break}let t=P.splice(0);for(let e of t)e.queued=!1,e.stale()&&e.run()}}finally{N=!1}}}function Ve(e,t,n){if(n){for(let n of e.deps.keys())t.has(n)||n.unwatch(e);for(let n of t.keys())e.deps.has(n)||n.watch(e)}e.deps=t}var He=class{version=0;#e=/* @__PURE__ */ new Set;#t;#n;constructor(e,t){this.#t=e,this.#n=t?.equals??Object.is}get value(){return Be(this),this.#t}set value(e){if(!this.#n(this.#t,e)){this.#t=e,this.version++;for(let e of this.#e)e.notify();F()}}peek(){return this.#t}subscribe(e){return We(this,e)}refresh(){}watch(e){this.#e.add(e)}unwatch(e){this.#e.delete(e)}},Ue=class{deps=/* @__PURE__ */ new Map;queued=!1;#e=!1;#t;#n;#r;constructor(e,t){this.#n=e,this.#r=t}notify(){this.queued||this.#e||(this.queued=!0,P.push(this))}stale(){if(this.#e)return!1;for(let[e,t]of this.deps){try{e.refresh()}catch{return!0}if(e.version!==t)return!0}return!1}run(){if(this.#e)return;this.#a();let e=j,t=/* @__PURE__ */ new Map;j=t;try{let e=this.#n();typeof e==`function`?this.#t=e:p(e)&&e.then(void 0,this.#r)}catch(e){this.#r(e)}finally{j=e,this.#e?this.#a():this.#i(t)}}#i(e){Ve(this,e,!0);for(let[t,n]of e)if(t.version!==n){this.notify(),F();return}}dispose(){if(!this.#e){this.#e=!0;for(let e of this.deps.keys())e.unwatch(this);this.deps.clear(),this.#a()}}#a(){let e=this.#t;if(this.#t=void 0,!e)return;let t=j;j=void 0;try{e()}catch(e){this.#r(e)}finally{j=t}}};function We(e,t){let n=!0,r=new Ue(()=>{let n=e.value;qe(()=>t(n))},e=>{if(n)throw e;ze(e)});try{r.run()}catch(e){throw r.dispose(),e}finally{n=!1}return()=>r.dispose()}function I(e,t){return new He(e,t)}function Ge(e,t){let n=new Ue(e,t);return n.run(),()=>n.dispose()}function Ke(e){M++;try{return e()}finally{M--,F()}}function qe(e){let t=j;j=void 0;try{return e()}finally{j=t}}const L=Symbol(`diorama.owner`),R=Symbol(`diorama.kernel`),z=e=>e[R],B=e=>e[L],Je={use(e){return z(this).use(e,B(this))},remove(e,t){return z(this).remove(e,t,B(this))},has(e){return z(this).has(e)},get(e){return z(this).service(B(this),e,!0)},find(e){return z(this).service(B(this),e,!1)},on(e,t){return z(this).events.on(e,t,B(this),!1)},once(e,t){return z(this).events.on(e,t,B(this),!0)},emit(e,t){B(this).disposed||z(this).events.emit(e,t)},hook(e,t,n){return z(this).hooks.add(e,t,B(this),n)},callHook(e,t,n){return B(this).disposed?t:z(this).hooks.call(e,t,n)},callHookAsync(e,t,n){return B(this).disposed?Promise.resolve(t):z(this).hooks.callAsync(e,t,n)},hookVersion(e){return z(this).hooks.version(e)},get loop(){return z(this).loop},system(e,t,n){return z(this).loop.system(e,t,n,B(this))},addStage(e,t){return z(this).loop.addStage(e,t,B(this))},invalidate(){let e=B(this);e.disposed||z(this).loop.invalidate(e)},keepAwake(e){let t=B(this);t.disposed||z(this).loop.keepAwake(t,e)},hold(){return z(this).loop.hold(B(this))},pause(){return z(this).loop.pause(B(this))},overrideLoop(e){return z(this).loop.overrideLoop(B(this),e)},setDriver(e){return z(this).loop.setDriver(B(this),e)},profile(e){return z(this).loop.profile(B(this),e)},effect(e){let t=z(this),n=B(this);return n.open()?n.add(Ge(e,e=>t.report(e,`effect`,n))):d},scope(){return z(this).view(B(this).child(),!0)},onDispose(e){return B(this).add(typeof e==`function`?e:()=>e.dispose())},get abortSignal(){return B(this).signal},get log(){return B(this).log},report(e,t){let n=B(this);e?.name===`AbortError`&&n.signal.aborted||z(this).report(e,`report`,n,t)}},V={get name(){return z(this).name},get state(){return z(this).state},start(){return z(this).start()},destroy(){return z(this).destroy()}},Ye={dispose(){return B(this).dispose()},get disposed(){return B(this).disposed}},H=e=>Object.getOwnPropertyDescriptors(e),Xe=Object.defineProperties({},H(Je)),Ze=e=>e in Xe||e in V||e in Ye||me.includes(e),Qe=2**31-1,U=e=>new n(`ABORTED`,`start was aborted`,{plugin:e}),W=()=>new n(`APP_DESTROYED`,`the app is destroyed`);var $e=class{name;state=I(`idle`);events;hooks;loop;root;rootView;#e;#t;#n;#r;#i;#a;#o=/* @__PURE__ */ new Map;#s=/* @__PURE__ */ new Set;#c=[];#l;#u;#d=f;#f=new AbortController;#p=!1;#m=!1;#h=0;constructor(e,t){this.#e=e,this.#t={options:e,defaults:t,disabled:new Set(Array.isArray(e.disable)?e.disable:[]),reserved:Ze},this.name=e.name??`app`;let n=e.logger??console,r=e.logLevel??`warn`;this.#n=_(n,r,``);let i=e.setupTimeout;this.#r=typeof i==`number`&&i>0?i:30;let a={value:0},o=this.report.bind(this);this.events=new Te(o,a),this.hooks=new De(o,a);let s=t=>{let i=[`diorama`,e.name,t.plugin].filter(Boolean);return _(n,r,`[${i.join(`:`)}]`)};this.root=new Re({env:{report:o,logFor:s},label:`app`,rank:1/0}),this.loop=new Ne(e.loop,o,e=>this.root.log.warn(e)),this.#i=Object.create(Xe,{[R]:{value:this}}),this.#a=Object.create(this.#i,H(Ye)),this.rootView=Object.create(Object.create(this.#i,H(V)),{[L]:{value:this.root}})}view(e,t){return Object.create(t?this.#a:this.#i,{[L]:{value:e}})}report(e,t,n,r){let i=a(e,t,n?.plugin);if(this.#m)console.error(i);else{this.#m=!0;try{this.#n.error(i);let e={error:i,source:t,plugin:n?.plugin??i.plugin,target:r};this.events.emit(`app:error`,e),this.#e.onError?.(e)}catch(e){console.error(e)}finally{this.#m=!1}}}has(e){return this.#o.get(b(e)??``)?.status===`running`}service(e,t,r){let i=b(t)??String(t);if(e.allowed&&!e.allowed.has(i))throw new n(`UNDECLARED_DEPENDENCY`,`"${i}" is not a declared dependency`,{plugin:e.plugin});let a=this.#o.get(i);if(!e.disposed&&a?.status===`running`)return a.service;if(r)throw new n(`SERVICE_UNAVAILABLE`,this.#g(i,a,e),{plugin:e.plugin})}#g(e,t,n){return this.state.peek()===`destroyed`?`"${e}": the app is destroyed`:n.disposed?`"${e}": this view is closed`:t?`"${e}" is ${t.status}${t.error?`: ${t.error.message}`:``}`:`"${e}" is not installed${ge(this.#t,e)}`}start(){if(this.#l)return this.#l;if(this.#u)return Promise.reject(W());let e=d;return this.#d=new Promise(t=>{e=t}),this.#l=this.#_(),this.#l.then(e,e),this.#l}async#_(){this.state.value=`starting`;let{signal:e}=this.#f;try{let t=[],n=he(this.#t,t),{list:r,failures:i}=await _e(this.#t,n);if(e.aborted)throw U();let a=this.#v(r,i,t);for(let t of a){if(e.aborted)throw U();if(t.status===`failed`)continue;let n=t.deps.find(e=>!this.has(e)),r=n===void 0?await this.#C(t,e):this.#y(t,n);if(r&&(t.critical||this.#e.failFast&&n===void 0))return this.#b(r)}if(e.aborted)throw U()}catch(t){if(e.aborted||this.state.peek()!==`starting`)throw t;let n=a(t,`config`,void 0);return this.report(n,`config`,void 0),this.#b(n)}if(this.state.value=`running`,this.#u)throw U();return this.loop.attach(),this.events.emit(`app:start`,void 0),this.rootView}#v(e,t,r){let i=ve(e);Array.isArray(i)||r.push(ye(i.cycle));for(let[e,n]of t)(e.critical||this.#e.failFast)&&r.push(n);if(r.length||!Array.isArray(i)){let e=r.length===1?r[0]:new n(`CONFIG_INVALID`,`${r.length} configuration problems`,{problems:r});return this.report(e,`config`,void 0),this.#b(e)}for(let e of i)e.ordinal=this.#h++,this.#o.set(e.name,e);for(let[e,n]of t)e.error=n,this.#S(e,`failed`,n),this.report(n,`config`,void 0);return i}#y(e,t){let r=new n(`PLUGIN_DEPENDENCY_FAILED`,`dependency "${t}" is not running`,{plugin:e.name});return e.error=r,this.root.log.warn(r.message),this.#S(e,`skipped`,r),r}#b(e){for(let e of this.#x())this.#c.push(this.#E(e));throw this.#c.push(this.root.dispose()),this.loop.stop(),this.state.value=`failed`,e}#x(){return[...this.#o.values()].filter(e=>e.scope).sort((e,t)=>t.ordinal-e.ordinal)}#S(e,t,n){let r=e.status;e.status=t,this.events.emit(`plugin:status`,{name:e.name,status:t,previous:r,error:n})}async#C(e,t){let r=this.root.child({label:e.name,rank:e.ordinal,plugin:e.name,allowed:/* @__PURE__ */ new Set([e.name,...e.deps,...e.optional])});r.ready=!1,e.scope=r,e.error=void 0,this.#S(e,`starting`);let i;try{let a;this.#p=!0;try{a=e.def.setup(this.view(r,!1),e.options)}finally{this.#p=!1}if(i=p(a)?await this.#T(a,e.name,t,r):a,r.disposed)throw U(e.name);let o=e.deps.find(e=>!this.has(e));if(o!==void 0)throw new n(`PLUGIN_DEPENDENCY_FAILED`,`dependency "${o}" stopped during setup`,{plugin:e.name})}catch(n){return this.#w(e,r,t,n)}if(e.service=i,e.hasService=i!==void 0,r.ready=!0,e.hasService){let t=this;Object.defineProperty(this.#i,e.name,{configurable:!0,get(){return t.service(this[L],e.name,!1)}})}this.#S(e,`running`)}#w(e,t,a,o){if(t.abortOnAdd=!0,t.dispose(),e.scope===t&&(e.scope=void 0),r(o,`ABORTED`)&&(a.aborted||e.status!==`starting`))throw o;let s=r(o,`PLUGIN_TIMEOUT`)||r(o,`PLUGIN_DEPENDENCY_FAILED`)?o:new n(`PLUGIN_SETUP`,i(o),{plugin:e.name,cause:o});return e.error=s,this.#S(e,`failed`,s),this.report(s,`setup`,t),s}#T(e,t,r,i){let a=Promise.resolve(e),o=a.then(d,d);return this.#s.add(o),o.then(()=>this.#s.delete(o)),new Promise((e,o)=>{let s=[r,i.signal];if(s.some(e=>e.aborted))return o(U(t));let c=this.#r*1e3,l=c<=Qe?setTimeout(()=>{o(new n(`PLUGIN_TIMEOUT`,`setup did not finish in ${this.#r} s (awaiting use() or remove() from setup deadlocks)`,{plugin:t}))},c):void 0,u=()=>o(U(t));for(let e of s)e.addEventListener(`abort`,u,{once:!0});let d=()=>{clearTimeout(l);for(let e of s)e.removeEventListener(`abort`,u)};a.then(t=>{d(),e(t)},e=>{d(),o(e)})})}#E(e){let{scope:t}=e;if(!t)return f;e.status===`starting`&&(t.abortOnAdd=!0),this.#S(e,`stopping`),e.hasService&&Reflect.deleteProperty(this.#i,e.name),e.hasService=!1,e.service=void 0,e.scope=void 0,e.release?.(),e.release=void 0;let n=t.dispose();return this.#S(e,`stopped`),n}#D(e){if(this.#o.get(e.name)!==e)return f;let t=this.#M(e.name).sort((e,t)=>t.ordinal-e.ordinal);return Promise.all([...t,e].map(e=>this.#E(e)))}destroy(){if(this.#u)return this.#u;let e=d;this.#u=new Promise(t=>{e=t});let t=this.state.peek(),n=[...this.#c],r=/* @__PURE__ */ new Set;if(t!==`idle`&&t!==`failed`){this.state.value=`destroying`,this.#f.abort(),t===`running`&&this.events.emit(`app:destroy`,void 0),this.loop.stop();for(let e of this.#x())r.add(e.name),n.push(this.#E(e).finally(()=>r.delete(e.name)))}return n.push(this.root.dispose(),...this.#s),this.state.value=`destroyed`,e(this.#O(n,r)),this.#u}#O(e,t){let n=Promise.allSettled(e).then(d),r=this.#r*1e3;return r>Qe?n:new Promise(e=>{let i=setTimeout(()=>{let n=`destroy: cleanups still pending after ${this.#r} s`;this.root.log.warn(n,[...t]),e()},r);n.then(()=>{clearTimeout(i),e()})})}#k(e,t){let r=this.state.peek();if(r===`destroying`||r===`destroyed`)return Promise.reject(W());if(r===`idle`||r===`failed`)return Promise.reject(new n(`APP_STATE`,`the app is ${r}`));let i=e.plugin&&this.#o.get(e.plugin)?.status===`starting`;if(this.#p||i)return Promise.reject(new n(`PLUGIN_REENTRANT`,`use() and remove() cannot be called from setup`,{plugin:e.plugin}));let a=this.#d.then(()=>{if(this.#u)throw W();if(e.disposed)throw U();if(this.state.peek()!==`running`)throw new n(`APP_STATE`,`the app did not start`);return t()});return this.#d=a.then(d,d),a}use(e,t){return this.#k(t,()=>this.#A(e,t))}async#A(e,t){let r=tt(e).map((e,t)=>{let r=x(e);if(!r)throw new n(`PLUGIN_INVALID`,`not a plugin: ${String(e)}`);return{plugin:e,def:r,layer:3,index:t}}),{list:i,failures:a}=await _e(this.#t,r,e=>this.has(e)),o=()=>this.#f.signal.aborted||t.disposed;if(o())throw U();for(let e of a.values())throw e;let s=ve(i.filter(e=>this.#j(e)));if(!Array.isArray(s))throw ye(s.cycle);let c=[];try{for(let e of s){if(o())throw U();e.ordinal=this.#h++,this.#o.set(e.name,e),t!==this.root&&(e.release=t.add(()=>e.scope?this.#D(e):void 0));let n=await this.#C(e,this.#f.signal);if(n)throw n;c.push(e)}}catch(e){for(let e of c.reverse())await this.#E(e);for(let e of s)e.release?.(),e.release=void 0;throw e}return typeof e==`function`?this.#o.get(e.name)?.service:void 0}#j(e){let t=this.#o.get(e.name);if(t?.status!==`running`)return!0;if(t.def===e.def&&h(t.raw,e.raw))return!1;throw new n(`PLUGIN_DUPLICATE`,`"${e.name}" is already running with other options`,{plugin:e.name})}remove(e,t,r){return this.#k(r,async()=>{let r=b(e)??``,i=this.#o.get(r);if(!i)return!1;if(i.status===`running`){let e=this.#M(r);if(e.length&&!t?.cascade)throw new n(`PLUGIN_HAS_DEPENDENTS`,`required by ${e.map(e=>e.name).join(`, `)}`,{plugin:r});await this.#D(i)}return i.release?.(),this.#o.delete(r),!0})}#M(e){let t=/* @__PURE__ */ new Set,n=e=>{for(let r of this.#o.values())r.status===`running`&&r.deps.includes(e)&&!t.has(r)&&(t.add(r),n(r.name))};return n(e),[...t]}};function et(e,t){return new $e(e??{},t).rootView}function tt(e){let t=[],n=e=>{Array.isArray(e)?e.forEach(n):ee(e)?[...e.presets,...e.plugins].forEach(n):e&&t.push(e)};return n(e),t}function G(e,t){if(typeof document>`u`||typeof MutationObserver>`u`)return;let n=document.body,r=new MutationObserver(()=>{let e=document.body;if(!e||e===n)return;let r=n;n=e,t(e,r)});r.observe(document.documentElement,{childList:!0}),e.onDispose(()=>r.disconnect())}const nt=(e,t)=>{let n=null;for(let r=e;r;r=r.parentElement){let e=t.get(r);if(e===void 0&&(e=getComputedStyle(r).position,t.set(r,e)),e===`fixed`)return`fixed`;e===`sticky`&&(n=r.parentElement)}return n},rt=(e,t,n,r)=>e-n<2*r&&t-n>-r,it=/*#__PURE__*/ S({name:`anchors`,dependencies:[`stage`,`scroll`],setup(e){let{stage:t,scroll:n}=e,r=/* @__PURE__ */ new Set,i=!0,a=!1,o=0,s=()=>{i=!0,e.invalidate()},c=typeof ResizeObserver>`u`?void 0:new ResizeObserver(s),l=/* @__PURE__ */ new Map,u=e=>{let t=l.get(e)??0;l.set(e,t+1),t||c?.observe(e)},f=e=>{let t=(l.get(e)??1)-1;t?l.set(e,t):l.delete(e)&&c?.unobserve(e)};typeof document<`u`&&(u(document.body),window.addEventListener(`resize`,s,{signal:e.abortSignal}),document.fonts?.ready.then(s,d),G(e,(e,t)=>{f(t),u(e),s()})),e.onDispose(()=>{c?.disconnect(),l.clear(),r.clear()});let p=(e,t,n)=>{let r=e.element.getBoundingClientRect();e.pageX=r.left+t,e.pageY=r.top+n,e.width=r.width,e.height=r.height};return e.system(`layout`,()=>{let{x:e,y:s,axis:c}=n.state,l=t.width.peek(),u=t.height.peek();a!==(c===`x`)&&(a=!a,i=!0);let d=a?e:s,f=a?l:u,m=i?/* @__PURE__ */ new Map:void 0,h=Math.abs(d-o)>f;i=!1,o=d;for(let t of r){if(m){p(t,e,s),t.version++;let n=nt(t.element,m),r=n&&n!==`fixed`?n.getBoundingClientRect():void 0;t.live=t.manual||n!==null;let i=n?1/0:-1/0;t.start=r?(a?r.left:r.top)+d:-i,t.end=r?(a?r.right:r.bottom)+d:i}else if(t.live){let n=a?t.pageX:t.pageY,r=n+(a?t.width:t.height);(h||rt(t.start,t.end,d,f)||rt(n,r,d,f))&&p(t,e,s)}t.x=t.pageX-e,t.y=t.pageY-s,t.visible=t.width>0&&t.x<l&&t.x+t.width>0&&t.y<u&&t.y+t.height>0;let n=a?t.x:t.y,r=a?t.width:t.height;t.progress=Math.min(1,Math.max(0,(f-n)/(f+r||1)));let i=r-f;t.pin=i>0?Math.min(1,Math.max(0,-n/i)):+(n<=0)}},{name:`anchors`}),{refresh:s,track(e,t){let n=t?.live===!0,i={element:e,x:0,y:0,width:0,height:0,visible:!1,progress:0,pin:0,version:0,pageX:0,pageY:0,manual:n,live:n,start:1/0,end:-1/0,dispose(){r.delete(i)&&f(e)}};return r.add(i),u(e),s(),i}}}});function K(e){let t=0,n=0;return{get value(){return t&&(e.loop.driver.now()-n>100?t=0:e.invalidate()),t},update(e,r){let i=r.delta>0?e/r.delta:0;t+=(i-t)*(1-Math.exp(-r.delta*10)),Math.abs(t)<=1&&(t=0),n=r.now}}}const at=/*#__PURE__*/ S({name:`pointer`,dependencies:[`stage`],setup(e){let t=K(e),n=K(e),r=0,i=0,a=!1,o=-1,s=()=>{o=e.loop.time.frame},c={get x(){return s(),r},get y(){return s(),i},get nx(){return s(),r/(e.stage.width.peek()||1)*2-1},get ny(){return s(),1-i/(e.stage.height.peek()||1)*2},get vx(){return s(),t.value},get vy(){return s(),n.value},get inside(){return s(),a},type:`mouse`};if(typeof window>`u`)return{state:c};let l=()=>{o>=e.loop.time.frame&&e.invalidate()},u={signal:e.abortSignal,passive:!0},d=e=>{r=e.clientX,i=e.clientY;let{pointerType:t}=e;c.type=t===`touch`||t===`pen`?t:`mouse`,a=!0,l()},f=()=>{a=!1,l()},p=e=>{e.pointerType===`touch`&&f()};window.addEventListener(`pointermove`,d,u),window.addEventListener(`pointerdown`,d,u),window.addEventListener(`pointerup`,p,u),window.addEventListener(`pointercancel`,p,u),document.documentElement.addEventListener(`pointerleave`,f,u);let m=0,h=0,g=!1;return e.system(`input`,e=>{let o=a&&!g;g=a,t.update(o?0:r-m,e),n.update(o?0:i-h,e),m=r,h=i},{name:`pointer`}),{state:c}}}),q=(e,t)=>Number.isFinite(e)?e:t,ot=/*#__PURE__*/ S({name:`scroll`,setup(e){let t=K(e),n={x:0,y:0,get velocity(){return t.value},get direction(){return Math.sign(t.value)},progress:0,axis:`y`};if(typeof window>`u`)return{state:n,measure:d,source:()=>d};let r=document.documentElement,i=window.scrollX,a=window.scrollY,o=0,s=0;n.x=i,n.y=a;let c={signal:e.abortSignal,passive:!0};window.addEventListener(`scroll`,()=>{i=window.scrollX,a=window.scrollY,e.invalidate()},c);let l=()=>{o=Math.max(0,r.scrollWidth-r.clientWidth),s=Math.max(0,r.scrollHeight-r.clientHeight),e.invalidate()};l(),window.addEventListener(`resize`,l,c);let u=typeof ResizeObserver>`u`?void 0:new ResizeObserver(l);u?.observe(document.body),u&&e.onDispose(()=>u.disconnect()),G(e,(e,t)=>{u?.unobserve(t),u?.observe(e),l()});let f=[],p={x:0,y:0,travel:0},m=a,h=!0,g=!1,_=()=>{h=!0,g=!1,e.invalidate()},v=e=>(f.push(e),_(),()=>{let t=f.indexOf(e);t<0||(f.splice(t,1),_())}),y=t=>{p.x=i,p.y=a,p.travel=m;try{t.read(p);let e=t.limit?.();return p.x=q(p.x,i),p.y=q(p.y,a),p.travel=q(p.travel,m),g&&(h=!0),g=!1,e}catch(n){g||e.report(n,`scroll:${t.name}`),g=!0,p.x=i,p.y=a,p.travel=m;return}};return e.system(`input`,e=>{let r=f.at(-1),c;r?c=y(r):(p.x=i,p.y=a,p.travel=a);let l=r?.axis??`y`,u=p.travel-m;h||e.resumed||Math.abs(u)>(l===`x`?innerWidth:innerHeight)?h=!1:t.update(u,e),m=p.travel;let d=l===`x`?o:s;Number.isFinite(c)&&c>0&&(d=c);let g=l===`x`?p.x:p.y;n.axis=l,n.x=p.x,n.y=p.y,n.progress=d>0?Math.min(1,Math.max(0,g/d)):0},{name:`scroll`}),{state:n,measure:l,source:v}}}),J=`dio-stage-scroll`,Y=1e6,st=.5;let X,ct=0;function lt(e){let t=document.documentElement,n=/* @__PURE__ */ new Set,r=/* @__PURE__ */ new Set,i=++ct,a,o=!1,s=0,c=!1,l=0,u=[],d=J,f=0,p;e.system(`layout`,()=>{if(!a)return;if(Z(p),!c){let{animationName:e,animationTimeline:t}=a.computed;o=e.startsWith(J)&&t?.startsWith(`scroll(`)!==!1}let e=window.visualViewport?.height??t.clientHeight,n=t.scrollHeight-Math.max(e,0);s=o?Math.max(0,Math.min(window.scrollY,n,Y)):0},{name:`stage`}),e.system(`afterRender`,()=>{if(!a)return;let{canvas:e}=a,t=!1;if(o)for(let e of n)e()&&(t=!0);if(o&&!t){let e=ut(r);dt(e,u)||(u=e,u.length?(d=`${J}-${i}-${++f%2}`,p??=new CSSStyleSheet,p.replaceSync(pt(d,u)),Z(p)):d=J)}let m=t?`none`:d;(c!==t||e.style.animationName!==m)&&(e.style.animationName=m),c=t;let h=t?0:s-ft(u,s);h!==l&&(l=h,e.style.translate=h?`0px ${h}px`:``)},{name:`stage`}),e.onDispose(()=>{p&&(document.adoptedStyleSheets=document.adoptedStyleSheets.filter(e=>e!==p))});let m=(e=>{let t=mt(e);t&&(a={canvas:e,computed:t})});return m.hold=e=>{let t=()=>e();return n.add(t),()=>void n.delete(t)},m.pin=e=>{let t=()=>e();return r.add(t),()=>void r.delete(t)},m}function ut(e){let t=[];for(let n of e)for(let[e,r]of n()){let n=Math.max(0,e),i=Math.min(Y,r);i>n&&t.push([n,i])}t.sort((e,t)=>e[0]-t[0]);let n=[];for(let e of t){let t=n.at(-1);t&&e[0]<=t[1]?t[1]=Math.max(t[1],e[1]):n.push(e)}return n}const dt=(e,t)=>e.length===t.length&&e.every(([e,n],r)=>{let[i,a]=t[r];return Math.abs(e-i)<st&&Math.abs(n-a)<st});function ft(e,t){let n=0;for(let[r,i]of e)n+=Math.max(0,Math.min(t,i)-r);return n}function pt(e,t){let n=(e,t)=>`${(e/Y*100).toFixed(6)}%{transform:translateY(${-t}px)}`,r=[n(0,0)],i=0;for(let[e,a]of t)r.push(n(e,e-i)),i+=a-e,r.push(n(a,a-i));return r.push(n(Y,Y-i)),`@keyframes ${e}{${r.join(``)}}`}function Z(e){X||(X=new CSSStyleSheet,X.replaceSync(`@keyframes ${J} { to { transform: translateY(-${Y}px) } }`));let t=document.adoptedStyleSheets,n=[X,e].filter(e=>!!e&&!t.includes(e));n.length&&(document.adoptedStyleSheets=[...t,...n])}function mt(e){if(typeof CSS<`u`&&CSS.supports?.(`animation-timeline: scroll(root y)`))return Z(),e.style.cssText+=`animation:${J} linear both;animation-timeline:scroll(root y);animation-range:0px ${Y}px`,getComputedStyle(e)}const ht={canvas:void 0,zIndex:1,maxPixelRatio:2,followScroll:!0},Q=[`100vh`,`100lvh`];function gt(){let e=document.createElement(`div`);e.style.cssText=`position:fixed;top:0;left:0;width:0;visibility:hidden;pointer-events:none;height:${Q[0]};height:${Q[1]}`,document.documentElement.append(e);let{height:t}=e.getBoundingClientRect();return e.remove(),t}const $=/* @__PURE__ */ new WeakSet,_t=/*#__PURE__*/ S({name:`stage`,defaults:ht,setup(e,t){let n=I(0),r=I(0),i=I(1),a=I(!1),o={canvas:void 0,width:n,height:r,pixelRatio:i,reducedMotion:a,hold:()=>d,pin:()=>d};if(typeof document>`u`)return o;let s=document.documentElement,c=()=>{Ke(()=>{n.value=s.clientWidth,r.value=Math.max(s.clientHeight,gt()),i.value=Math.min(window.devicePixelRatio||1,t.maxPixelRatio)}),e.invalidate()};c();let l={signal:e.abortSignal};if(window.addEventListener(`resize`,c,l),typeof ResizeObserver<`u`){let t=new ResizeObserver(()=>{s.clientWidth!==n.peek()&&c()});t.observe(s),e.onDispose(()=>t.disconnect())}let u=window.matchMedia?.(`(prefers-reduced-motion: reduce)`);if(u){let e=()=>{a.value=u.matches};e(),u.addEventListener(`change`,e,l)}let f=lt(e),p,m=n=>{t.followScroll&&f(n),$.add(n),e.onDispose(()=>{$.delete(n),n.remove()}),G(e,t=>{for(let e of t.querySelectorAll(`canvas[data-dio-canvas]`))$.has(e)||e.remove();n.isConnected||t.append(n),e.invalidate()})};return{...o,hold:f.hold,pin:f.pin,get canvas(){return p??=vt(t,m),p}}}});function vt(e,t){let{canvas:r}=e;if(r instanceof HTMLCanvasElement)return r;if(typeof r==`string`){let e=document.querySelector(r);if(e instanceof HTMLCanvasElement)return e;throw new n(`PLUGIN_OPTIONS`,`no canvas matches "${r}"`,{plugin:`stage`})}let i=document.createElement(`canvas`);return i.setAttribute(`aria-hidden`,`true`),i.setAttribute(`data-dio-canvas`,``),i.setAttribute(`data-turbo-temporary`,``),Object.assign(i.style,{position:`fixed`,inset:`0`,width:`100%`,height:Q[0],pointerEvents:`none`,zIndex:String(e.zIndex)}),i.style.height=Q[1],document.body.append(i),t(i),i}const yt=[/* @__PURE__ */ S({name:`visibility`,defaults:{pause:!0},setup(e,t){let n=I(!0);if(typeof document>`u`)return{visible:n};let r,i=()=>{n.value=document.visibilityState!==`hidden`,!n.peek()&&t.pause?r??=e.pause(`hidden`):r&&=(r(),void 0)};return i(),document.addEventListener(`visibilitychange`,i,{signal:e.abortSignal}),{visible:n}}}),_t,ot,at,it];function bt(e){return et(e,yt)}export{k as a,_t as c,re as i,Ae as l,bt as n,r as o,S as r,I as s,n as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,s as t}from"./dist-
|
|
1
|
+
import{r as e,s as t}from"./dist-D3F4iUyc.js";import{D as n,Gt as r,Qn as i,dr as a,er as o,h as s,vt as c}from"./three.core-B13DgFZS.js";import{a as l}from"./three.webgpu-CChnXdxT.js";import{A as u,Br as d,D as f,N as p,Zr as m,hi as h}from"./three.tsl-CmShpHGs.js";const g=/* @__PURE__ */ new WeakMap;function _(){let e=typeof navigator>`u`?void 0:navigator.gpu;if(!e)return Promise.resolve(!1);let t=g.get(e);t||(t=Promise.resolve().then(()=>e.requestAdapter({featureLevel:`compatibility`})).then(e=>e!=null,()=>!1),g.set(e,t));let n,r=new Promise(e=>{n=setTimeout(e,1e3,!1)});return Promise.race([t,r]).finally(()=>clearTimeout(n))}const v=/^#([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i,y=/^(rgba?|hsla?)\(([^)]*)\)$/i,b={deg:1,grad:.9,rad:180/Math.PI,turn:360},x=(e,t,n)=>`#${[e,t,n].map(e=>Math.round(Math.min(255,Math.max(0,e))).toString(16).padStart(2,`0`)).join(``)}`;function S(e,t){if(e===`none`)return 0;let n=Number.parseFloat(e);return/^[-+]?(\d+\.?\d*|\.\d+)(e[-+]?\d+)?%?$/i.test(e)?e.endsWith(`%`)?n/100*t:n:NaN}function C(e){let[,t=``,n=`deg`]=/^([-+]?[\d.]+(?:e[-+]?\d+)?)([a-z]*)$/i.exec(e)??[],r=b[n.toLowerCase()||`deg`];return e===`none`?0:r?Number.parseFloat(t)*r:NaN}function w(e,t){let n=t.trim().split(/\s*[,/]\s*|\s+/);if(n.length<3||n.length>4)return;let[r=``,i=``,a=``]=n,o;if(e.startsWith(`rgb`))o=[S(r,255),S(i,255),S(a,255)];else{let e=(C(r)%360+360)%360/30,t=Math.min(1,Math.max(0,S(i,1)/(i.endsWith(`%`)?1:100))),n=Math.min(1,Math.max(0,S(a,1)/(a.endsWith(`%`)?1:100))),s=t*Math.min(n,1-n),c=t=>{let r=(t+e)%12;return(n-s*Math.max(-1,Math.min(r-3,9-r,1)))*255};o=[c(0),c(8),c(4)]}return o.every(Number.isFinite)?x(o[0],o[1],o[2]):void 0}let T;const E=/* @__PURE__ */ new Map;function D(e){if(E.has(e))return E.get(e);if(T===void 0)try{T=(typeof OffscreenCanvas==`function`?new OffscreenCanvas(1,1):typeof document>`u`?void 0:document.createElement(`canvas`))?.getContext(`2d`,{willReadFrequently:!0})??null}catch{T=null}let t;if(T){T.fillStyle=`#000`,T.fillStyle=e;let n=T.fillStyle;if(T.fillStyle=`#fff`,T.fillStyle=e,n===T.fillStyle){T.globalCompositeOperation=`copy`,T.fillRect(0,0,1,1);let[e=0,n=0,r=0]=Array.from(T.getImageData(0,0,1,1).data);t=x(e,n,r)}}return E.set(e,t),t}function O(e,t,n=0){let r=``,i=0;for(;;){let a=e.toLowerCase().indexOf(`var(`,i);if(a<0)break;let o=a+3;for(let t=0;o<e.length;o++)if(e[o]===`(`)t++;else if(e[o]===`)`&&--t===0)break;if(o>=e.length)break;let s=e.slice(a+4,o),c=s.indexOf(`,`),l=(c<0?s:s.slice(0,c)).trim(),u=c<0?``:s.slice(c+1),d=t.getPropertyValue(l).trim()||u.trim();r+=e.slice(i,a)+(n<8?O(d,t,n+1):``),i=o+1}return(r+e.slice(i)).replace(/\bcurrentcolor\b/gi,()=>t.color)}function k(e,t){let n=e.trim();t&&/var\(|currentcolor/i.test(n)&&(n=O(n,getComputedStyle(t)).trim());let r=v.exec(n)?.[1];if(r)return`#${(r.length<6?[...r].map(e=>e+e).join(``):r).slice(0,6).toLowerCase()}`;let i=y.exec(n);if(i)return w(i[1].toLowerCase(),i[2]);let a=s.NAMES[n.toLowerCase()];return a===void 0?n?D(n):void 0:`#${a.toString(16).padStart(6,`0`)}`}function A(e){let t=e.compileAsync;if(typeof t!=`function`)return;let n=Promise.resolve();e.compileAsync=(...r)=>{let i=n.then(()=>t.apply(e,r));return n=i.catch(()=>{}),i}}function j(e){let t=e._animation,n=t?.getContext?.();if(!n||typeof t?.setContext!=`function`||typeof t.getAnimationLoop!=`function`||typeof t.stop!=`function`)return;let r=t,i;return r.stop(),r.setContext({requestAnimationFrame(e){return r.getAnimationLoop()===null?(i=e,-1):n.requestAnimationFrame(e)},cancelAnimationFrame(e){i=void 0,e!==-1&&n.cancelAnimationFrame(e)}}),{tick(e){let t=i;i=void 0,t?.(e)}}}async function M(e){let t=new n(/* @__PURE__ */ new Uint8Array(4),1,1);t.needsUpdate=!0;let r=new f;r.fragmentNode=d(h(t,m),e.toneMapping,e.outputColorSpace);let i=new p(r);try{await e.compileAsync(i,i.camera)}catch{}try{r.dispose(),t.dispose()}catch{}await N(e)}async function N(e){if(typeof createImageBitmap==`function`&&typeof ImageData==`function`)for(let t of[i,``]){let n,r;try{n=await createImageBitmap(new ImageData(4,4),{imageOrientation:`flipY`}),r=new a(n),r.colorSpace=t,r.flipY=!1,r.minFilter=c,r.needsUpdate=!0,e.initTexture(r)}catch{}finally{r?.dispose(),n?.close()}}}const P=/*#__PURE__*/ e({name:`render`,dependencies:[`stage`],defaults:{antialias:!0,distance:1e3,maxPixels:4e6,forceWebGL:!1,background:null,environment:`none`},async setup(e,n){let{stage:i}=e,a=i.canvas;if(!a)throw Error(`render needs a DOM`);let s=await F(e,n,a),c=new o,{distance:l}=n,u=new r(45,1,1,l*10);u.position.z=l;let d=t(1/0);I(e,n,s,c,u,d);let f=(e,t,n={x:0,y:0})=>(n.x=e-i.width.peek()/2,n.y=i.height.peek()/2-t,n),p={x:0,y:0};return{maxPixelRatio:d,environment:L(e,n,s,c),renderer:s,scene:c,camera:u,backend:`isWebGPUBackend`in s.backend?`webgpu`:`webgl2`,toWorld:f,place(e,t){f(t.x+t.width/2,t.y+t.height/2,p),e.position.set(p.x,p.y,0),e.scale.set(t.width,t.height,1)}}}});async function F(e,t,n){let r=t.background;if(typeof r==`string`){let t=k(r);t||e.log.warn(`render: background "${r}" is not a colour, kept transparent`),r=t??null}let i=t.antialias===`auto`?e.stage.pixelRatio.peek()<2:t.antialias,a=t.forceWebGL||!await _(),o=new l({canvas:n,antialias:i,alpha:r===null,forceWebGL:a});await o.init(),A(o),e.onDispose(o),o.setClearColor(r??0,r===null?0:1),await M(o);let s=j(o);return s?e.system(`input`,e=>s.tick(e.now),{name:`render:three`}):e.log.warn(`render: unknown three.js frame loop, three keeps asking for frames at rest`),o}function I(e,t,n,r,i,a){let{stage:o}=e,{distance:s}=t,c=!0;e.effect(()=>{o.width.value,o.height.value,o.pixelRatio.value,a.value,c=!0,e.invalidate()});let l=()=>{let e=o.width.peek(),r=o.height.peek(),c=Math.sqrt(t.maxPixels/Math.max(1,e*r));n.setPixelRatio(Math.min(o.pixelRatio.peek(),c,a.peek())),n.setSize(e,r,!1),i.aspect=e/(r||1),i.fov=2*Math.atan(r/2/s)*180/Math.PI,i.updateProjectionMatrix()},u=()=>n.render(r,i);e.system(`render`,()=>{c&&(c=!1,l()),e.callHook(`render:frame`,u)()},{name:`render`})}function L(e,t,n,r){let i=0,a,o,s=()=>{r.environment===o?.texture&&(r.environment=null),o?.dispose(),o=void 0,a=void 0};return e.onDispose(()=>{i=0,s()}),()=>{if(t.environment!==`room`)return{ready:Promise.resolve(),off:()=>{}};i++,a??=import(`./RoomEnvironment-DFh6TGKE.js`).then(({RoomEnvironment:t})=>{if(!i||a!==c)return;let s=new t,l=new u(n);o=l.fromScene(s,.04),l.dispose(),s.dispose(),r.environment=o.texture,e.invalidate()});let c=a,l=!1;return{ready:c,off:()=>{l||(l=!0,--i===0&&s())}}}}export{P as n,k as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./define-BwEwaSnA-xcf1zhk4.js";const t={gradient:{load:()=>import(`./gradient-
|
|
1
|
+
import{o as e}from"./define-BwEwaSnA-xcf1zhk4.js";const t={gradient:{load:()=>import(`./gradient-DlWLiAIB.js`),params:{color1:e(`#0b1d3a`),color2:e(`#3a2b8c`),color3:e(`#e35d6a`),color4:e(`#f6c177`),speed:.2,scale:1,warp:.4,attract:.15,scroll:.25,grain:.03,fps:30}},dots:{load:()=>import(`./dots-CtSXmEQF.js`),params:{gap:24,dot:2,color:e(`#a3acb9`),accent:e(`#5b6cff`),radius:140,strength:.6,speed:0,fade:0}},waves:{load:()=>import(`./waves-BNELRAA0.js`),params:{lines:16,color:e(`#3b6a8f`),background:e(`#0c1424`),warp:.5,speed:.3,thickness:1.2,scroll:.3,fps:30}},stars:{load:()=>import(`./stars-DrEO7wCD.js`),params:{count:800,depth:.5,twinkle:.5,speed:.3,warp:.5,scale:1,color:e(`#ffffff`),background:e(`#04060f`),shooting:4,fps:30}},blobs:{load:()=>import(`./blobs-Do3HpJCl.js`),params:{count:6,color1:e(`#6d5dfc`),color2:e(`#22d3ee`),color3:e(`#f472b6`),color4:e(`#fbbf24`),background:e(`#0b1026`),scale:1,softness:.3,warp:.3,speed:.15,attract:.2,scroll:.25,grain:.03,fps:30}},clouds:{load:()=>import(`./clouds-D9YgdqLM.js`),params:{cover:.5,speed:.2,scale:1,sun:.6,depth:.2,scroll:.3,fps:30}},grid:{load:()=>import(`./grid-BGQMSBhs.js`),params:{color:e(`#ff4fd8`),background:e(`#0d0221`),accent:e(`#ff8a3d`),cells:14,horizon:.5,speed:.4,sun:.5,thickness:1.2,depth:.2,scroll:.3,fps:30}}};export{t as backgrounds};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./define-BwEwaSnA-xcf1zhk4.js";const t={confetti:{load:()=>import(`./confetti-
|
|
1
|
+
import{o as e}from"./define-BwEwaSnA-xcf1zhk4.js";const t={confetti:{load:()=>import(`./confetti-XlvT_M7R.js`),params:{fire:0,once:!1,count:200,angle:90,spread:70,speed:1400,gravity:1600,decay:1.2,duration:3,scale:1},reducedMotion:`off`},sparkles:{load:()=>import(`./sparkles-DjzvM51I.js`),params:{count:12,scale:1,color:e(`#ffd75e`),spread:24,duration:1.1,fps:30},reducedMotion:`off`},snow:{load:()=>import(`./snow-BP6vA9-u.js`),params:{count:160,scale:1,speed:1,wind:.2,pile:0,push:.5,fps:30},reducedMotion:`off`},emoji:{load:()=>import(`./emoji-UwXABpxO.js`),params:{fire:0,once:!1,count:8,scale:1,speed:1,spread:40,sway:12,spin:1,duration:2.4,interval:1.5},reducedMotion:`off`},drops:{load:()=>import(`./drops-0Z_4vJgg.js`),params:{fire:0,rate:10,count:140,scale:1,speed:1,trail:.6,dry:8,lifetime:0,merge:!0,x:.5,y:.5,duration:2.4,color:e(`#ffffff`)},reducedMotion:`off`}};export{t as particles};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./define-BwEwaSnA-xcf1zhk4.js";const t={beat:{load:()=>import(`./beat-
|
|
1
|
+
import{o as e}from"./define-BwEwaSnA-xcf1zhk4.js";const t={beat:{load:()=>import(`./beat-Bh4Pp0AR.js`),params:{color:e(`#ff5a36`),zoom:1.06,shake:0,glow:.8,spread:28,sensitivity:.5,duration:.25,fps:60}},visualizer:{load:()=>import(`./visualizer-DdfshOpm.js`),params:{bars:48,color:e(`#ffffff`),accent:e(`#ff5a36`),gap:.3,radius:2,range:[-90,-20],smooth:.75,mirror:!1,seek:!0,fps:30}}};export{t as audio};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./dev-CoKR705i.js";import{t}from"./target-CVFjw9e--rWdFTtdC.js";import{i as n,n as r}from"./effect-DJHvQTKy.js";import{a as i}from"./kit-
|
|
1
|
+
import{t as e}from"./dev-CoKR705i.js";import{t}from"./target-CVFjw9e--rWdFTtdC.js";import{i as n,n as r}from"./effect-DJHvQTKy.js";import{a as i}from"./kit-DAFViSYh.js";import{Ft as a,Mt as o,Pt as s,Qr as c,St as l,ar as u,dt as d,ir as f,ji as p,ki as m,oi as h,sn as g,tr as _,wi as v,xt as y,z as b}from"./three.tsl-CmShpHGs.js";import{h as x,wr as S}from"./three.core-B13DgFZS.js";import{t as C}from"./dist-DNaBWJWL.js";const w=e=>Object.freeze({"~kind":`color`,value:e}),T=.12,E=new S(-.8,-.6),D=r({name:`dots`,params:{style:n(`dots`,`plus`,`squares`),mode:n(`grow`,`push`,`glow`),gap:24,dot:2,color:w(`#a3acb9`),accent:w(`#5b6cff`),radius:140,strength:.6,speed:0,fade:0},animate:{fps:e=>e.params.speed>0?30:0},quality:{low:{speed:0}},setup(n){let{params:r,surface:C,u:w}=n;e&&t(n,`dots`);let D=v(new S(-1e4,-1e4)),k=v(0),A=v(new S),j=globalThis.matchMedia?.(`(hover: hover)`).matches??!0,[M,N]=O(n.element),P=v(new x(M));C.color((e,{box:t,radius:n})=>{let i=w.size,v=m(t.x.mul(i.x),s(1).sub(t.y).mul(i.y)),x=_(b(y(v.x)).add(b(l(v.x))),1e-4),S=_(w.gap,2),C=_(w.dot,.5).mul(.5),T=_(w.radius,1),E=a(v.add(A).div(S)).add(.5).mul(S).sub(A),O=(e,t)=>{let n=b(e);if(r.style===`squares`)return _(n.x,n.y).sub(t);if(r.style===`plus`){let e=t.mul(.5),r=t.mul(4),i=(t,n)=>_(t.sub(r),n.sub(e));return f(i(n.x,n.y),i(n.y,n.x))}return g(e).sub(t)},j=e=>{let t=d(s(1).sub(g(e.sub(D)).div(T)),0,1);return t.mul(t).mul(s(3).sub(t.mul(2))).mul(k)},M=e=>d(s(.5).sub(e.div(x)),0,1),F,I;if(r.mode===`push`){F=s(0),I=s(0);for(let e=-1;e<=1;e++)for(let t=-1;t<=1;t++){let n=E.add(m(t,e).mul(S)),r=n.sub(D),i=j(n),a=n.add(r.div(_(g(r),.001)).mul(i.mul(S).mul(.9))),o=M(O(v.sub(a),C));I=c(o.greaterThan(F),i,I),F=_(F,o)}}else{let e=j(E),t=v.sub(E),n=r.mode===`grow`?C.mul(e.mul(2.2).add(1)):C;if(F=M(O(t,f(n,S.mul(r.style===`plus`?.11:.45)))),I=e,r.mode===`glow`){let n=g(t).div(S.mul(.25));F=_(F,o(n.mul(n).negate()).mul(e).mul(.55))}}let L=g(t.sub(.5).mul(2)),R=s(1).sub(h(u(1.42,.25,w.fade),u(1.42,1,w.fade).add(.001),L)),z=F.mul(R),B=z.add(s(N).mul(s(1).sub(z))),V=u(w.color,w.accent,I).mul(z).add(P.mul(N).mul(s(1).sub(z))).div(_(B,1e-4));return p(V,B.mul(n))});let F=0,I=0,L=0,R=D.value,z=A.value;return e=>{let t=e.reducedMotion;if(r.speed>0&&!t){let t=r.speed*e.delta,n=Math.max(r.gap,2);z.x=(z.x+E.x*t)%n,z.y=(z.y+E.y*t)%n}let a=j&&!t&&r.strength>0&&r.radius>0&&e.over;if(a){let t=e.pointer;I=t.x*e.width,L=(1-t.y)*e.height,F<.01?R.set(I,L):(R.x=i(R.x,I,T*.5,e.delta),R.y=i(R.y,L,T*.5,e.delta),(R.x-I)**2+(R.y-L)**2<.01&&R.set(I,L))}let o=+!!a;F=i(F,o,T,e.delta,.001),k.value=F*Math.max(0,r.strength);let s=a&&(R.x!==I||R.y!==L);(F!==o||s)&&n.invalidate()}}});function O(e){let t=getComputedStyle(e).backgroundColor,n=/\(([^)]*)\)/.exec(t)?.[1]?.split(/[\s,/]+/).filter(Boolean)??[],r=n.length>3?Number.parseFloat(n[3]):t&&t!==`transparent`?1:0,i=r>0?C(t):void 0;return i?[i,Number.isFinite(r)?Math.min(1,r):1]:[`#000000`,0]}export{D as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e,n as t}from"./effect-DJHvQTKy.js";import{D as n,Er as r,F as i,Q as a,Z as o,an as s,gr as c,gt as l,kt as u,m as ee,qt as d}from"./three.core-B13DgFZS.js";import{b as f}from"./kit-
|
|
1
|
+
import{i as e,n as t}from"./effect-DJHvQTKy.js";import{D as n,Er as r,F as i,Q as a,Z as o,an as s,gr as c,gt as l,kt as u,m as ee,qt as d}from"./three.core-B13DgFZS.js";import{b as f}from"./kit-DAFViSYh.js";import{Ai as p,Cr as m,Di as h,J as te,Pt as g,Qr as ne,Qt as re,Z as _,ai as v,ar as y,dt as ie,fi as b,hi as ae,ji as oe,jt as se,ki as x,oi as S,qt as ce,sn as C,tr as w,ui as le,wi as ue,yr as de,zt as fe}from"./three.tsl-CmShpHGs.js";import{t as T}from"./three.webgpu-CChnXdxT.js";const E=e=>Object.freeze({"~kind":`color`,value:e}),D=480,O=1600,k=6,A=.5,j=1;var pe=class{pool;drops=[];trails=new Float32Array(O*6);head=0;laid=0;time=0;wet=-1/0;#e;#t=[];#n=0;constructor(e,t=480){this.pool=t,this.#e=f(e)}add(e,t,n,r){if(n<=0)return;if(r.merge){for(let r of this.drops)if(Math.hypot(r.x-e,r.y-t)<(r.r+n)*.8)return this.#l(r,e,t,n),r}if(this.drops.length>=this.pool){let e=-1;if(this.drops.forEach((t,n)=>{t.vy===0&&(e<0||t.life<this.drops[e].life)&&(e=n)}),e<0)return;this.drops.splice(e,1)}let i=this.#e,a={x:e,y:t,r:n,vy:0,lean:(i()-.5)*.25,hold:i()*.6,life:r.dry*A*(.6+.8*i()),age:0,fed:0,grow:0,running:!1,mx:e,my:t,seed:i()};return this.drops.push(a),a}radius(e,t=.1){let n=this.#e,r=n();return(r<.62-t/2?1.2+1.8*n()**1.5:r<1-t?3+2.5*n():6.3+4.3*n())*e}thaw(e,t,n,r){this.#t.push({x:e,y:t,t:0,duration:Math.max(r,.001),count:n,made:0})}shower(e,t){for(let n=0;n<e;n++)this.#i(t,.12)}get thawing(){return this.#t.length>0}step(e,t,n=0){let r=Math.min(Math.max(e,0),.1);this.time+=r;let i=this.#t.length>0||n>0;for(this.#n+=n*r;this.#n>=1;)this.#n--,this.#i(t,.08);this.#r(r,t);let{drops:a}=this,o=this.#e,s=6*t.scale;for(let e=0;e<a.length;e++){let n=a[e];if(n.age+=r,n.fed>0&&(n.fed-=r,n.r+=n.grow*r,i=!0),n.r>=s&&t.speed>0&&(n.running=!0),!n.running||n.r<s*.62||t.speed<=0){n.running&&(n.running=!1,n.vy=0,n.life=Math.max(1,t.dry*A*(.4+.4*o()))),n.life-=r;continue}if(i=!0,n.hold>0){n.hold-=r;continue}let c=t.speed*(120+380*Math.min(1,(n.r-s)/(2*s)));n.vy+=(c-n.vy)*Math.min(1,r*8);let l=n.vy*r;if(n.y+=l,n.x+=n.lean*l,o()<r*.6&&(n.hold=.03+o()*.12),o()<r*1.5&&(n.lean=(o()-.5)*.3),n.r=Math.max(0,n.r-l*.0018*t.scale),o()<l*.012){let e=n.r*(.1+.12*o());n.r=Math.sqrt(Math.max(0,n.r*n.r-e*e)),this.#o(n,e,t)}Math.hypot(n.x-n.mx,n.y-n.my)>=3*t.scale&&this.#s(n,t),t.merge&&this.#c(e)}let c=t.lifetime??0;for(let e=a.length-1;e>=0;e--){let n=a[e];(n.life<=0||n.r<.5||n.y-n.r>t.height+4||c>0&&n.age>=c)&&a.splice(e,1)}return i?`moving`:a.length||this.time-this.wet<t.dry?`drying`:`still`}#r(e,t){let{width:n,height:r}=t;for(let i=this.#t.length-1;i>=0;i--){let a=this.#t[i];a.t+=e;let o=Math.min(1,a.t/a.duration),s=Math.hypot(Math.max(a.x,n-a.x),Math.max(a.y,r-a.y)),c=1-(1-o)**2,l=c*(s+160)-40,u=Math.round(a.count*c);for(;a.made<u;a.made++)for(let e=0;e<6;e++){let e=this.#e()*Math.PI*2,i=l-this.#e()*80;if(i<=0)break;let o=a.x+Math.cos(e)*i,s=a.y+Math.sin(e)*i;if(o<0||s<0||o>n||s>r)continue;let c=this.add(o,s,this.radius(t.scale,.12),t);c&&this.#a(c,t);break}o>=1&&this.#t.splice(i,1)}}#i(e,t){let n=this.#e;this.add(n()*e.width,n()*e.height,this.radius(e.scale,t),e)}#a(e,t){let n=this.#e;e.fed=.4+n()*1.6;let r=6*t.scale,i=n()<.55?r*(1.05+n()*.6):e.r*(1+n()*.2);e.grow=Math.max(0,i-e.r)/e.fed,e.life=Math.max(e.life,e.fed+Math.max(1,t.dry*A*n()))}#o(e,t,n){if(t<.6||this.drops.length>=this.pool)return;let r=e.x-e.lean*e.r,i=e.y-e.r*1.3,a=this.add(r,i,t,{...n,merge:!1});a&&(a.hold=0,a.age=e.age,a.life=n.dry*A*(.3+.4*this.#e()))}#s(e,t){if(t.trail>0){let n=this.head*6,r=this.trails;r[n]=e.mx,r[n+1]=e.my,r[n+2]=e.x,r[n+3]=e.y,r[n+4]=e.r*.42*R(e,t.lifetime??0),r[n+5]=this.time,this.head=(this.head+1)%O,this.laid=Math.min(O,this.laid+1),this.wet=this.time}e.mx=e.x,e.my=e.y}#c(e){let{drops:t}=this,n=t[e];for(let r=t.length-1;r>=0;r--){if(r===e)continue;let i=t[r],a=n.r+i.r;Math.abs(i.y-n.y)>a||Math.hypot(i.x-n.x,i.y-n.y)>=a*.8||(this.#l(n,i.x,i.y,i.r),n.vy=Math.max(n.vy,i.vy),t.splice(r,1),r<e&&e--)}}#l(e,t,n,r){let i=e.r*e.r,a=r*r;e.x=(e.x*i+t*a)/(i+a),e.y=Math.max(e.y,(e.y*i+n*a)/(i+a)),e.r=Math.sqrt(i+a),e.life=Math.max(e.life,0)}};function M(e){let t=Math.min(1,Math.abs(e)),n=Math.min(1,Math.max(0,(t-.5)/.5)),r=(.05+.16*(n*n*(3-2*n)))*(1-t**6),i=Math.max(0,1-(t/.3)**2)*.16,a=r+i;return{alpha:a,light:a>0?i/a:0}}function me(){let e=/* @__PURE__ */ new Uint8Array(256);for(let t=0;t<64;t++){let{alpha:n,light:r}=M((t+.5)/64*2-1);e[t*4]=Math.round(n*255),e[t*4+1]=Math.round(r*255),e[t*4+3]=255}let t=new n(e,64,1,s,c);return t.magFilter=t.minFilter=l,t.wrapS=t.wrapT=ee,t.colorSpace=``,t.needsUpdate=!0,t}const N=/* @__PURE__ */ new WeakMap,P=t({name:`drops`,params:{motion:e(`rain`,`thaw`),trigger:e(`view`,`manual`),fire:0,rate:10,count:140,scale:1,speed:1,trail:.6,dry:8,lifetime:0,merge:!0,x:.5,y:.5,duration:2.4,color:E(`#ffffff`),seed:1},rebuild:[`seed`],reducedMotion:`off`,animate:{fps:e=>N.get(e.signal)??0},quality:{low:{count:70,rate:2}},async setup(e){let{params:t,u:n,element:i,app:a,signal:o}=e,s=i===document.body||i===document.documentElement,c=e.quality===`low`,l=new pe(t.seed,c?240:480),ee=c?30:60,d=ue(new r),f=e=>b(0,e.x).mul(b(e.x,d.z)).mul(b(0,e.y)).mul(b(e.y,d.w)),T=ue(0),E=/* @__PURE__ */ new Float32Array(1920),D=/* @__PURE__ */ new Float32Array(960),k=I([[`drop`,E,4],[`shape`,D,2]]),A=_(`drop`,`vec4`),j=_(`shape`,`vec2`),M=j.x.mul(2).add(1),P=m.x.mul(2.5),L=m.y.add(.5).mul(M.add(1.25)).sub(1.25),R=A.z,ge=x(d.x.add(A.x).add(P.mul(R)),d.y.sub(A.y).add(L.mul(R))),z=F();z.positionNode=p(ge,0);let _e=f(h(x(A.x.add(P.mul(R)),A.y.sub(L.mul(R))))),B=h(x(P,L)),ve=h(M),ye=h(A.w),V=h(j.y),H=x(B.x,ne(B.y.greaterThan(0),B.y.div(ve),B.y)),U=te(H.y,H.x),be=v(U.mul(3).add(V.mul(6.28))).mul(.05).add(v(U.mul(5).add(V.mul(17))).mul(.025)),W=C(H).mul(be.add(1)),xe=ie(g(1).sub(W).div(w(fe(W),.001)),0,1),Se=le(w(g(1).sub(W.mul(W)),0)),Ce=de(p(H.x,H.y,Se.mul(1.1))),we=w(se(Ce,de(p(-.42,.62,.66))),0).pow(70).mul(1.3),Te=S(.1,-.85,H.y),Ee=H.y.mul(-.5).add(.5).clamp(0,1),De=Ee.pow(1.6).mul(.32),Oe=Ee.oneMinus().mul(.2),ke=S(.74,.97,W).mul(Te.mul(.35).add(.32)),Ae=S(.58,.82,W).mul(S(.96,.84,W)).mul(Te).mul(.55),je=S(1.3,.95,C(H.sub(x(.1,-.32)))).mul(.16),Me=n.color,Ne=p(1).mul(we).add(Me.mul(De.add(Ae))),Pe=we.add(De).add(Oe).add(ke).add(Ae).clamp(0,1),Fe=y(je,Pe,xe);z.colorNode=oe(Ne.mul(xe).div(w(Fe,.001)),Fe.mul(ye).mul(n.presence).mul(_e));let G=new u(k,z);G.frustumCulled=!1,G.renderOrder=1;let Ie=me(),Le=new Float32Array(O*4),Re=new Float32Array(O*2),K=I([[`seg`,Le,4],[`wet`,Re,2]]),q=_(`seg`,`vec4`),ze=_(`wet`,`vec2`),Be=x(q.x,q.y),J=x(q.z,q.w).sub(Be),Ve=w(C(J),.001),Y=J.div(Ve),He=x(Y.y.negate(),Y.x),X=Be.add(J.mul(.5)).add(Y.mul(m.y.mul(Ve))).add(He.mul(m.x.mul(ze.x).mul(2))),Z=F();Z.positionNode=p(d.x.add(X.x),d.y.sub(X.y),0);let Ue=h(m.x.mul(2)),We=h(y(.3,1,ce(re))),Ge=h(T.sub(ze.y)),Ke=g(1).sub(Ge.div(w(n.dry,.05))).clamp(0,1).pow(.7),qe=ae(Ie,x(Ue.mul(.5).add(.5),.5)),Je=qe.r.mul(Ke).mul(We).mul(n.trail.clamp(0,1)).mul(n.presence).mul(f(h(X)));Z.colorNode=oe(p(qe.g),Je);let Ye=new u(K,Z);if(Ye.frustumCulled=!1,e.overlay.add(Ye,G),e.onDispose(()=>{k.dispose(),K.dispose(),z.dispose(),Z.dispose(),Ie.dispose()}),await e.compile(e.overlay),o.aborted)return;let Q=t.fire,Xe=!1,$=`still`;(s||getComputedStyle(i).position===`fixed`)&&e.onDispose(a.stage.hold(()=>$!==`still`));let Ze=(e,n)=>({width:e,height:n,scale:Math.max(t.scale,.1),speed:Math.max(t.speed,0),trail:t.trail,dry:Math.max(t.dry,.1),lifetime:Math.max(t.lifetime,0),merge:t.merge});return e=>{let n=a.stage.width.peek(),r=a.stage.height.peek(),[i,c,u,f]=s?[0,0,n,r]:[e.x,e.y,e.width,e.height];d.value.set(i-n/2,r/2-c,u,f);let p=Ze(u,f),m=()=>{t.motion===`thaw`?l.thaw(t.x*u,t.y*f,Math.max(0,Math.round(t.count)),t.duration):l.shower(Math.max(0,Math.round(t.count)),p)};Xe||(Xe=!0,t.trigger===`view`&&m()),t.trigger===`manual`&&t.fire!==Q&&(t.fire>Q&&m(),Q=t.fire);let h=t.motion===`rain`&&t.trigger===`view`;$=l.step(e.delta,p,h?Math.max(t.rate,0):0),T.value=l.time,he(l,p.lifetime??0,E,D,Le,Re),k.instanceCount=l.drops.length,K.instanceCount=l.laid;for(let e of[k,K])for(let t of Object.values(e.attributes))t.isInstancedBufferAttribute&&(t.needsUpdate=!0);N.set(o,$===`moving`?ee:$===`drying`?15:0)}}});function F(){let e=new T({transparent:!0,depthTest:!1,depthWrite:!1});return e.forceSinglePass=!0,e}function I(e){let t=new d(1,1),n=new a;n.setIndex(t.getIndex()),n.setAttribute(`position`,t.getAttribute(`position`)),n.setAttribute(`uv`,t.getAttribute(`uv`)),t.dispose();for(let[t,r,a]of e){let e=new o(r,a);e.setUsage(i),n.setAttribute(t,e)}return n.instanceCount=0,n}function L(e,t=0){let n=e.running||e.fed>0?1:Math.min(1,Math.max(0,e.life)/1);return Math.min(n,R(e,t))}function R(e,t){return t<=0?1:Math.min(1,Math.max(0,(t-e.age)/Math.max(1,t*.3333333333333333)))}function he(e,t,n,r,i,a){e.drops.forEach((e,i)=>{n[i*4]=e.x,n[i*4+1]=e.y,n[i*4+2]=e.r,n[i*4+3]=L(e,t),r[i*2]=e.vy>0?Math.min(1.4,e.vy/260):0,r[i*2+1]=e.seed});let o=e.trails;for(let t=0;t<e.laid;t++){let e=t*6;i[t*4]=o[e],i[t*4+1]=o[e+1],i[t*4+2]=o[e+2],i[t*4+3]=o[e+3],a[t*2]=o[e+4],a[t*2+1]=o[e+5]}}export{j as FADE,pe as Glass,D as POOL,k as SLIDE,O as TRAILS,P as default,L as opacity,M as trailProfile};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./dev-CoKR705i.js";import{a as t,i as n,n as r,s as i,t as a}from"./points-3Fg6fQYz-CDGHYSao.js";import{D as o,Er as s,G as c,f as l,kt as u,wr as d,zt as f}from"./three.core-B13DgFZS.js";import{a as p,l as m,u as h}from"./raster-Bf0CGQIc-CYX6ZFTt.js";import{i as g,n as _}from"./effect-DJHvQTKy.js";import{b as v,t as y}from"./kit-BM0qCXzI.js";import{Ai as b,Cr as x,Di as S,Ft as C,Gr as w,Mt as T,Or as E,Pt as D,Qr as ee,Z as O,ai as k,ar as A,fi as te,hi as ne,ir as j,ji as M,jt as N,ki as P,oi as F,sn as re,tr as I,vt as L,wi as R,yr as ie,yt as z,z as B,zt as ae}from"./three.tsl-CmShpHGs.js";import{t as V}from"./three.webgpu-CChnXdxT.js";const H=e=>e<=.04045?e/12.92:((e+.055)/1.055)**2.4,U=(e,t,n)=>Math.floor((e-t)/n);function oe(e,t,n){let[r,i,a,o]=e.frame,s=Math.max(.5,n.cell),c={count:0,home:/* @__PURE__ */ new Float32Array(4),ink:/* @__PURE__ */ new Float32Array(4),random:/* @__PURE__ */ new Float32Array(4),index:/* @__PURE__ */ new Uint32Array(1),cell:s,cols:1,rows:1,bounds:[0,0,0,0]};if(!t)return c;let{data:l,width:u,height:d}=t,f=u/a,p=d/o;for(let e=0;e<6;e++){let t=Math.max(1,Math.ceil(a/s)),m=Math.max(1,Math.ceil(o/s)),h=Int32Array.from({length:u},(e,n)=>Math.min(t-1,U(r+(n+.5)/f,r,s))),g=Int32Array.from({length:d},(e,t)=>Math.min(m-1,U(i+(t+.5)/p,i,s))),_=new Float64Array(t*m*5);for(let e=0;e<d;e++){let n=g[e]*t;for(let t=0;t<u;t++){let r=(e*u+t)*4,i=(n+h[t])*5,a=l[r+3];_[i+4]=_[i+4]+1,a&&(_[i]=_[i]+a,_[i+1]=_[i+1]+l[r]*a,_[i+2]=_[i+2]+l[r+1]*a,_[i+3]=_[i+3]+l[r+2]*a)}}let y=[];for(let e=0;e<t*m;e++){let t=_[e*5+4];t&&_[e*5]/(t*255)>=.02&&y.push(e)}if(!y.length)return c;if(y.length>n.max&&e<5){s*=Math.sqrt(y.length/n.max)*1.03;continue}let b=Math.min(y.length,n.max),x=new Float32Array(b*4),S=new Float32Array(b*4),C=new Float32Array(b*4),w=new Uint32Array(b),T=v(n.seed),E=[1/0,1/0,-1/0,-1/0];for(let e=0;e<b;e++){let n=y[e],a=n%t,o=Math.floor(n/t),c=r+(a+.5)*s,l=i+(o+.5)*s,u=n*5,d=_[u];x.set([c,l,0,Math.min(1,d/(_[u+4]*255))],e*4),S.set([H(_[u+1]/d/255),H(_[u+2]/d/255),H(_[u+3]/d/255),T()],e*4),C.set([T(),T(),T(),T()],e*4),w[e]=n,E[0]=Math.min(E[0],c-s/2),E[1]=Math.min(E[1],l-s/2),E[2]=Math.max(E[2],c+s/2),E[3]=Math.max(E[3],l+s/2)}return{count:b,home:x,ink:S,random:C,index:w,cell:s,cols:t,rows:m,bounds:E}}return c}const se=`grainHome`,ce=`grainInk`,le=`grainRandom`,W=(()=>{let e=[-.45,.6,.66],t=Math.hypot(...e);return e.map(e=>e/t)})(),ue=.5,de=ue+.5*W[2],G={wind:{flow:1.6,spin:2.5,round:[.04,.32]},rise:{flow:2.4,spin:1.2,round:[.15,.6]},explode:{flow:2,spin:3.2,round:[2,3]}};function fe(e,t,n){let r=L(n),i=k(n);return e.mul(r).add(z(t,e).mul(i)).add(t.mul(N(t,e).mul(r.oneMinus())))}function K(e,t){let n=v(e*7919+17),r=[1,2.1,4.3].map((e,t)=>{let r=n()*Math.PI*2,i=n()*Math.PI*2;return{frequency:e,weight:[1,.5,.25][t],direction:[Math.cos(r),Math.sin(r)],zDirection:[Math.cos(i),Math.sin(i)],phase:n()*Math.PI*2,zPhase:n()*Math.PI*2}}),i=[n()*6.28,n()*6.28],a=D(1).div(t);return e=>{let t=e.x.mul(a),n=e.y.mul(a),o=t.add(k(n.mul(1.7).add(i[0])).mul(.6)),s=n.add(k(t.mul(1.3).add(i[1])).mul(.6)),c=D(0),l=D(0),u=D(0);for(let e of r){let t=o.mul(e.direction[0]).add(s.mul(e.direction[1])).mul(e.frequency).add(e.phase),n=L(t).mul(e.weight);c=c.add(n.mul(e.direction[0])),l=l.add(n.mul(e.direction[1]));let r=o.mul(e.zDirection[0]).add(s.mul(e.zDirection[1])).mul(e.frequency).add(e.zPhase);u=u.add(k(r).mul(e.weight))}return b(l,c.negate(),u.mul(.6))}}function q(e){let t=O(se,`vec4`),n=O(ce,`vec4`),r=O(le,`vec4`),[i,a,o,s,c]=[n.w,r.x,r.y,r.z,r.w],l=G[e.motion],u=e.front.sub(t.z).div(e.span).clamp(0,1),d=te(1e-4,u).mul(te(u,.9999)).mul(e.calm.oneMinus()),f=b(t.x.sub(e.half.x),e.half.y.sub(t.y),0),p=e.reach.mul(a.mul(.9).add(.55)),m=b(0,1,0),h=b(e.way.x,e.way.y,0),g=o.mul(1.25).sub(.25),_=e=>T(e.mul(-3.2)).oneMinus().div(1-Math.exp(-3.2)),v;if(e.motion===`rise`)v=t=>m.mul(p.mul(.9).mul(E(t,1.3))).add(h.mul(p.mul(.15).mul(t))).add(b(0,0,p.mul(.5).mul(e.depth).mul(g).mul(t)));else if(e.motion===`explode`){let t=f.xy.sub(P(e.middle.x.sub(e.half.x),e.half.y.sub(e.middle.y))),n=I(re(t),e.em.mul(.5)),r=t.div(n),i=b(r.x.mul(.9).add(s.sub(.5).mul(.7)),r.y.mul(.9).add(c.sub(.5).mul(.7)),o.mul(.95).sub(.3).mul(e.depth));v=e=>i.mul(p.mul(_(e)).mul(s.mul(.6).add(.6))).sub(m.mul(p.mul(.25).mul(e).mul(e)))}else v=t=>h.mul(p.mul(E(t,1.6))).add(m.mul(p.mul(.16).mul(t).mul(t))).add(b(0,0,p.mul(.4).mul(e.depth).mul(g).mul(E(t,1.2))));let y=K(e.seed,e.em.mul(l.flow)),x=e.em.mul(e.motion===`explode`?.5:e.motion===`rise`?2:1.4).mul(e.turbulence).mul(s.mul(.8).add(.6)),S=b(0,0,0);for(let t=0;t<5;t++){let n=u.mul((t+.5)/5),r=y(f.add(v(n)).add(S)),i=F(0,.3,n);S=S.add(r.mul(b(1,1,e.depth)).mul(x.mul(i).mul(u).div(5)))}let C=f.add(v(u)).add(S),w=ie(b(L(c.mul(6.2832)),k(c.mul(6.2832)),i.mul(2).sub(1))),ee=u.mul(l.spin*6.2832).mul(i.mul(1.2).add(.4)),[ne,j]=l.round,M=F(ne,j,u),N=e.dot.mul(s.mul(.9).add(.55)),R=e.motion===`explode`?e.cell.mul(A(D(1),D(.6),u)):A(e.cell,N,F(0,.8,u)),z=a.mul(.3).add(.7);return{centre:C,progress:u,loose:d,axis:w,angle:ee,size:R,round:M,fade:F(z.mul(.6),z,u).oneMinus()}}function pe(e){let t=e=>{let t=new l(e);return t.premultiplyAlpha=!0,t},n=t(e),r=[];return{read:e=>{let t=ne(n,e);return r.push(t),t},set:e=>{let i=n;n=t(e);for(let e of r)e.value=n;i.dispose()},dispose:()=>n.dispose()}}const J=`dustBox`;function me(e){let t=new Float32Array(Math.max(1,e.quads.length)*4);return e.quads.forEach((e,n)=>{t.set([e.x,e.y,e.width,e.height],n*4)}),n(e.quads.length,{[J]:[t,4]})}function he(e,t,n,r,i,a){let o=O(J,`vec4`),s=x.xy.add(.5),c=o.x.add(s.x.mul(o.z)),l=o.y.add(s.y.oneMinus().mul(o.w)),d=new V({transparent:!0,depthTest:!1,depthWrite:!1});d.positionNode=b(c.sub(n.x),n.y.sub(l),0);let f=S(P(c.sub(r.x).div(r.z),l.sub(r.y).div(r.w).oneMinus())),p=S(P(c,l)),m=S(P(c.div(n.x.mul(2)),l.div(n.y.mul(2)).oneMinus())),h=t(f),g=w(h.rgb.div(I(h.a,1e-4)));d.colorNode=M(g,h.a.mul(i(p)).mul(a(m.clamp(0,1))));let _=new u(me(e),d);return _.frustumCulled=!1,_}const ge=(e,t)=>P(e.x.add(t.x).div(t.x.mul(2)),e.y.add(t.y).div(t.y.mul(2))).clamp(0,1);function _e(e,t,n){let r=O(se,`vec4`),i=O(ce,`vec4`),a=q(e),o=a.centre.z,s=B(o).mul(.006),c=a.size.add(s.mul(2)).add(2).mul(a.loose),l=x.xy.mul(c),u=fe(b(l.x,l.y,0),a.axis,a.angle),d=new V({transparent:!0,depthTest:!1,depthWrite:!1});d.positionNode=a.centre.add(u);let f=fe(b(0,0,1),a.axis,a.angle),p=ee(f.z.lessThan(0),f.negate(),f),m=b(...W),h=I(N(p,m),0).mul(.5).add(ue).div(de),g=ie(m.add(b(0,0,1))),_=N(i.xyz,b(.2126,.7152,.0722)),v=E(I(N(p,g),0),60).mul(A(D(.12),D(.6),_.sqrt())).mul(F(.02,.12,a.progress)),y=o.div(400).clamp(-1,1),C=S(h.mul(y.max(0).mul(.15).add(1))),T=S(v),[k,ne,L,R]=[e.frame.x,e.frame.y,e.frame.z,e.frame.w],z=S(l),H=S(a.size),U=S(s),oe=S(P(r.x.sub(k).div(L),r.y.sub(ne).div(R).oneMinus())),le=S(P(e.cell.div(L),e.cell.div(R))),G=t(oe.add(z.div(I(H,.001)).mul(le))),K=w(G.rgb.div(I(G.a,1e-4))),pe=te(B(z.x),H.mul(.5)).mul(te(B(z.y),H.mul(.5))),J=G.a.mul(pe),me=re(z).sub(H.mul(.5)),he=I(ae(me),U.mul(2)),_e=H.mul(H).div(H.mul(H).add(U.mul(U).mul(2))),ve=S(j(r.w.mul(e.cell.mul(e.cell)).div(I(a.size.mul(a.size).mul(.785),.001)),1)),Y=D(.5).sub(me.div(I(he,1e-4))).clamp(0,1).mul(ve).mul(_e),X=S(a.round),ye=A(K,S(i.xyz),X).mul(C).add(b(1,.96,.88).mul(T)),be=S(y.min(0).mul(.6).add(1)),xe=S(a.fade.mul(a.loose).mul(n(ge(a.centre,e.half))));return d.colorNode=M(ye,A(J,Y,X).mul(xe).mul(be).clamp(0,1)),d}function ve(e,t){let n=O(se,`vec4`),r=q(e),i=I(r.centre.z,0),a=r.size.add(i.mul(.05)),o=a.add(i.mul(.06)).add(2).mul(r.loose),s=x.xy.mul(o),c=r.centre.xy.add(P(-W[0]/W[2],-W[1]/W[2]).mul(i.mul(.5))),l=new V({transparent:!0,depthTest:!1,depthWrite:!1});l.positionNode=b(c.x.add(s.x),c.y.add(s.y),0);let u=S(s),d=S(a.mul(.5)),f=S(i.mul(.03).add(.5)),p=re(u).sub(d),m=D(.5).sub(p.div(I(ae(p),f.mul(2)))).clamp(0,1),h=r.size.div(a.add(i.mul(.06))),g=O(ce,`vec4`),_=N(g.xyz,b(.2126,.7152,.0722)).sqrt(),v=F(2,40,i).mul(h.mul(h).max(.04)).mul(A(D(1),D(.3),_)),y=S(r.fade.mul(r.loose).mul(n.w).mul(v).mul(e.shadow).mul(.3).mul(t(ge(b(c.x,c.y,0),e.half))));return l.colorNode=M(b(0,0,0),m.mul(y)),l}const Y={per:.02,min:1.4,max:2.2},X={wind:1,rise:1.15,explode:2.8},ye=(e,t,n)=>Math.min(Y.max,Math.max(Y.min,t*Y.per))*X[e]/Math.sqrt(Math.max(n,.05)),be=2e4,xe={wind:.6,rise:.65,explode:.7},Se={wind:1,rise:1,explode:.3},Ce=.4,we=65535,Te=/* @__PURE__ */ new WeakSet;function Ee(e,t,n,r,a){let o=i(a+13),[s,c,l,u]=e,d=(s+l)/2,f=(c+u)/2,p=1/Math.max(r*.7,4),m=(e,t)=>Math.min(1,Math.max(0,(o(e*p,t*p)-.5)*2.2+.5));if(t===`explode`){let e=Math.hypot(l-d,u-f)||1;return(t,n)=>Math.min(Se.explode,Math.hypot(t-d,n-f)/e*.24+m(t,n)*.06)}let h=n*Math.PI/180,g=Math.cos(h),_=-Math.sin(h),v=[s*g+c*_,l*g+c*_,s*g+u*_,l*g+u*_],y=Math.min(...v),b=Math.max(...v)-y||1;return(e,t)=>Math.min(1,Math.max(0,(y+b-e*g-t*_)/b*.72+m(e,t)*.28))}function De(e,t,n,r){return e===`rise`?Math.min(520,Math.max(90,n*1.6,r*2.6)):e===`explode`?Math.min(640,Math.max(100,t*.35,r*3.5)):Math.min(720,Math.max(100,t*.45,r*3))}const Oe=_({name:`dust`,params:{motion:g(`wind`,`rise`,`explode`),trigger:g(`scroll`,`click`,`view`),density:1,dot:1.6,duration:2.2,angle:15,turbulence:1,depth:1,shadow:.5,seed:1},rebuild:[`density`,`seed`],on:`:not(img, video, canvas, svg, input, textarea)`,presence:`custom`,bleed:600,quality:{low:{density:.6,shadow:0}},async setup(i){let{element:l,u:g,params:_,app:v,signal:b}=i,{stage:x}=v,{trigger:S,motion:w}=_,T=t=>{e&&v.log.warn(`dust: ${t}, the text stays as it is`,l)},E=i.quality===`low`?1:2,D=Math.round(be*a[i.quality]),ee=h(l)??await p(l),O=ee?void 0:m(l,`line`,E);if(b.aborted)return;let k=e=>oe(e,t(e),{cell:ye(w,r(e),_.density),max:D,seed:_.seed}),j=O?k(O):void 0;if(!O||!j?.count){ee&&T(`${ee} cannot be drawn`),i.showDom(!0);return}let M=xe[w],N=R(0),F=R(0),re=R(new d(1,0)),L=R(new d),ie=R(200),z=R(16),B=R(j.cell),ae=R(new d(1,1)),V=R(new s(...O.frame)),H=g.size.mul(.5),U=e=>i.mask(e),W=I(N,g.presence.oneMinus()),ue=W.mul(Se[w]+M),de=new o(/* @__PURE__ */ new Uint8Array(4),1,1),G=[],fe=(e,t,n)=>{let i=r(e),a=Ee(t.bounds,w,n,i,_.seed),s=new Uint8Array(t.cols*t.rows*4);for(let e=0;e<t.count;e++){let n=t.home[e*4],r=t.home[e*4+1],i=(t.ink[e*4+3]-.5)*.04,o=Math.round(Math.min(1,Math.max(0,a(n,r)+i))*we);t.home[e*4+2]=o/we;let c=t.index[e]*4;s[c]=o>>8,s[c+1]=o&255,s[c+3]=255}let c=new o(s,t.cols,t.rows);c.magFilter=c.minFilter=f,c.generateMipmaps=!1,c.colorSpace=``,c.needsUpdate=!0;let l=de;de=c;for(let e of G)e.value=c;l.dispose();let[u,d,p,m]=t.bounds;L.value.set((u+p)/2,(d+m)/2),B.value=t.cell,ae.value.set(t.cols,t.rows),z.value=i,ie.value=De(w,p-u,m-d,i)},K=_.angle;fe(O,j,K),i.onDispose(()=>de.dispose());let q=pe(O.canvas);i.onDispose(()=>q.dispose());let J=he(O,q.read,H,V,e=>{let t=C(e.x.sub(V.x).div(B)),n=C(e.y.sub(V.y).div(B)),r=ne(de,P(t.add(.5).div(ae.x),n.add(.5).div(ae.y)));G.push(r);let i=r,a=i.x.mul(65280).add(i.y.mul(255)).div(we);return A(te(ue,a),W.oneMinus(),F)},U),ge={motion:w,front:ue,span:M,way:re,middle:L,reach:ie,em:z,cell:B,dot:g.dot,turbulence:g.turbulence,depth:g.depth,shadow:g.shadow,calm:F,half:H,frame:V,seed:_.seed},Y=e=>n(e.count,{[se]:[e.home,4],[ce]:[e.ink,4],[le]:[e.random,4]}),X=Y(j),Oe=new u(X,_e(ge,q.read,U)),ke=new u(X,ve(ge,U));for(let e of[ke,Oe])e.frustumCulled=!1;J.renderOrder=1,Oe.renderOrder=2;let Ae=new c;if(Ae.add(J,ke,Oe),i.place(Ae,{fit:`none`,replace:!0}),await i.compile(Ae),b.aborted)return;let je=(e,t)=>{O=e,j=t,fe(e,t,K);let n=X;X=Y(t),Oe.geometry=ke.geometry=X,n.dispose();let r=J.geometry;J.geometry=me(e),r.dispose(),q.set(e.canvas),V.value.set(...e.frame)},Me=!0,Ne=e=>{Me=e,i.showDom(e)},Z=Te.has(l),Pe=e=>{Ae.visible=!e};Pe(Z),Ne(!Z);let Fe,Ie,Le=async()=>{Fe=void 0;let e=await p(l);if(b.aborted)return;if(e&&e!==Ie&&T(`${e} cannot be drawn`),Ie=e,e){i.invalidate();return}let t=m(l,`line`,E),n=t&&k(t);t&&n?.count&&(je(t,n),i.invalidate())},Re=()=>{if(Fe?.(),Me&&typeof requestIdleCallback==`function`){let e=requestIdleCallback(()=>void Le(),{timeout:1e3});Fe=()=>cancelIdleCallback(e)}else{let e=setTimeout(()=>void Le(),150);Fe=()=>clearTimeout(e)}};i.onDispose(()=>Fe?.());let ze=new MutationObserver(Re);ze.observe(l,{characterData:!0,childList:!0,subtree:!0}),i.onDispose(()=>ze.disconnect());let Be=new ResizeObserver(()=>{let e=l.getBoundingClientRect().width;Math.abs(e-(O?.width??e))>.5&&Re()});Be.observe(l),i.onDispose(()=>Be.disconnect()),document.fonts?.addEventListener(`loadingdone`,Re,{signal:b});let Q=+!!Z,$=Q,Ve=!1,He=()=>{Z||$===1||($=1,l.setAttribute(`data-dio-dust`,`playing`),Ve=!0,i.invalidate())};return S===`click`&&(l.addEventListener(`click`,He,{signal:b}),l.addEventListener(`keydown`,e=>{e.key===`Enter`&&e.target===l&&!l.matches(`button, a[href]`)&&He()},{signal:b})),e=>{let t=i.params,n=e.reducedMotion;if(F.value=+!!n,ke.visible=t.shadow>0,Ie||n&&S!==`click`)return Ne(!0),Ve;t.angle!==K&&j&&O&&(K=t.angle,fe(O,j,K),X.getAttribute(se).needsUpdate=!0);let r=K*Math.PI/180;re.value.set(Math.cos(r),Math.sin(r));let a=x.height.peek(),o=e.y+(typeof scrollY==`number`?scrollY:0),s=Math.max(0,Math.min(a*.3,o-1)),c=Math.min(1,Math.max(0,(s-e.y)/(s+e.height*.5||1)));if(S===`view`&&(c>.2?$=1:c<=0&&($=0),$!==Q&&(Ve=!0)),S===`scroll`)Q=c;else if(Q!==$){let r=n?Ce:Math.max(t.duration,.001)/($<Q?1.6:1);Q=y(Q,$,e.delta/r)}else Ve=!1;return N.value=Q,S===`click`&&Q>=1&&!Z&&(Z=!0,Te.add(l),Ve=!1,l.setAttribute(`data-dio-dust`,`done`),l.dispatchEvent(new CustomEvent(`dio:dust`,{bubbles:!0}))),Pe(Z),Ne(!Z&&Q<=0&&e.presence>=1),Ve}}});export{Ce as CALM,be as MAX_GRAINS,ye as cellSide,Oe as default,De as reachOf,Ee as sweep};
|
|
1
|
+
import{t as e}from"./dev-CoKR705i.js";import{a as t,i as n,n as r,s as i,t as a}from"./points-3Fg6fQYz-CO2A_AE7.js";import{D as o,Er as s,G as c,f as l,kt as u,wr as d,zt as f}from"./three.core-B13DgFZS.js";import{a as p,l as m,u as h}from"./raster-Bf0CGQIc-CYX6ZFTt.js";import{i as g,n as _}from"./effect-DJHvQTKy.js";import{b as v,t as y}from"./kit-DAFViSYh.js";import{Ai as b,Cr as x,Di as S,Ft as C,Gr as w,Mt as T,Or as E,Pt as D,Qr as ee,Z as O,ai as k,ar as A,fi as te,hi as ne,ir as j,ji as M,jt as N,ki as P,oi as F,sn as re,tr as I,vt as L,wi as R,yr as ie,yt as z,z as B,zt as ae}from"./three.tsl-CmShpHGs.js";import{t as V}from"./three.webgpu-CChnXdxT.js";const H=e=>e<=.04045?e/12.92:((e+.055)/1.055)**2.4,U=(e,t,n)=>Math.floor((e-t)/n);function oe(e,t,n){let[r,i,a,o]=e.frame,s=Math.max(.5,n.cell),c={count:0,home:/* @__PURE__ */ new Float32Array(4),ink:/* @__PURE__ */ new Float32Array(4),random:/* @__PURE__ */ new Float32Array(4),index:/* @__PURE__ */ new Uint32Array(1),cell:s,cols:1,rows:1,bounds:[0,0,0,0]};if(!t)return c;let{data:l,width:u,height:d}=t,f=u/a,p=d/o;for(let e=0;e<6;e++){let t=Math.max(1,Math.ceil(a/s)),m=Math.max(1,Math.ceil(o/s)),h=Int32Array.from({length:u},(e,n)=>Math.min(t-1,U(r+(n+.5)/f,r,s))),g=Int32Array.from({length:d},(e,t)=>Math.min(m-1,U(i+(t+.5)/p,i,s))),_=new Float64Array(t*m*5);for(let e=0;e<d;e++){let n=g[e]*t;for(let t=0;t<u;t++){let r=(e*u+t)*4,i=(n+h[t])*5,a=l[r+3];_[i+4]=_[i+4]+1,a&&(_[i]=_[i]+a,_[i+1]=_[i+1]+l[r]*a,_[i+2]=_[i+2]+l[r+1]*a,_[i+3]=_[i+3]+l[r+2]*a)}}let y=[];for(let e=0;e<t*m;e++){let t=_[e*5+4];t&&_[e*5]/(t*255)>=.02&&y.push(e)}if(!y.length)return c;if(y.length>n.max&&e<5){s*=Math.sqrt(y.length/n.max)*1.03;continue}let b=Math.min(y.length,n.max),x=new Float32Array(b*4),S=new Float32Array(b*4),C=new Float32Array(b*4),w=new Uint32Array(b),T=v(n.seed),E=[1/0,1/0,-1/0,-1/0];for(let e=0;e<b;e++){let n=y[e],a=n%t,o=Math.floor(n/t),c=r+(a+.5)*s,l=i+(o+.5)*s,u=n*5,d=_[u];x.set([c,l,0,Math.min(1,d/(_[u+4]*255))],e*4),S.set([H(_[u+1]/d/255),H(_[u+2]/d/255),H(_[u+3]/d/255),T()],e*4),C.set([T(),T(),T(),T()],e*4),w[e]=n,E[0]=Math.min(E[0],c-s/2),E[1]=Math.min(E[1],l-s/2),E[2]=Math.max(E[2],c+s/2),E[3]=Math.max(E[3],l+s/2)}return{count:b,home:x,ink:S,random:C,index:w,cell:s,cols:t,rows:m,bounds:E}}return c}const se=`grainHome`,ce=`grainInk`,le=`grainRandom`,W=(()=>{let e=[-.45,.6,.66],t=Math.hypot(...e);return e.map(e=>e/t)})(),ue=.5,de=ue+.5*W[2],G={wind:{flow:1.6,spin:2.5,round:[.04,.32]},rise:{flow:2.4,spin:1.2,round:[.15,.6]},explode:{flow:2,spin:3.2,round:[2,3]}};function fe(e,t,n){let r=L(n),i=k(n);return e.mul(r).add(z(t,e).mul(i)).add(t.mul(N(t,e).mul(r.oneMinus())))}function K(e,t){let n=v(e*7919+17),r=[1,2.1,4.3].map((e,t)=>{let r=n()*Math.PI*2,i=n()*Math.PI*2;return{frequency:e,weight:[1,.5,.25][t],direction:[Math.cos(r),Math.sin(r)],zDirection:[Math.cos(i),Math.sin(i)],phase:n()*Math.PI*2,zPhase:n()*Math.PI*2}}),i=[n()*6.28,n()*6.28],a=D(1).div(t);return e=>{let t=e.x.mul(a),n=e.y.mul(a),o=t.add(k(n.mul(1.7).add(i[0])).mul(.6)),s=n.add(k(t.mul(1.3).add(i[1])).mul(.6)),c=D(0),l=D(0),u=D(0);for(let e of r){let t=o.mul(e.direction[0]).add(s.mul(e.direction[1])).mul(e.frequency).add(e.phase),n=L(t).mul(e.weight);c=c.add(n.mul(e.direction[0])),l=l.add(n.mul(e.direction[1]));let r=o.mul(e.zDirection[0]).add(s.mul(e.zDirection[1])).mul(e.frequency).add(e.zPhase);u=u.add(k(r).mul(e.weight))}return b(l,c.negate(),u.mul(.6))}}function q(e){let t=O(se,`vec4`),n=O(ce,`vec4`),r=O(le,`vec4`),[i,a,o,s,c]=[n.w,r.x,r.y,r.z,r.w],l=G[e.motion],u=e.front.sub(t.z).div(e.span).clamp(0,1),d=te(1e-4,u).mul(te(u,.9999)).mul(e.calm.oneMinus()),f=b(t.x.sub(e.half.x),e.half.y.sub(t.y),0),p=e.reach.mul(a.mul(.9).add(.55)),m=b(0,1,0),h=b(e.way.x,e.way.y,0),g=o.mul(1.25).sub(.25),_=e=>T(e.mul(-3.2)).oneMinus().div(1-Math.exp(-3.2)),v;if(e.motion===`rise`)v=t=>m.mul(p.mul(.9).mul(E(t,1.3))).add(h.mul(p.mul(.15).mul(t))).add(b(0,0,p.mul(.5).mul(e.depth).mul(g).mul(t)));else if(e.motion===`explode`){let t=f.xy.sub(P(e.middle.x.sub(e.half.x),e.half.y.sub(e.middle.y))),n=I(re(t),e.em.mul(.5)),r=t.div(n),i=b(r.x.mul(.9).add(s.sub(.5).mul(.7)),r.y.mul(.9).add(c.sub(.5).mul(.7)),o.mul(.95).sub(.3).mul(e.depth));v=e=>i.mul(p.mul(_(e)).mul(s.mul(.6).add(.6))).sub(m.mul(p.mul(.25).mul(e).mul(e)))}else v=t=>h.mul(p.mul(E(t,1.6))).add(m.mul(p.mul(.16).mul(t).mul(t))).add(b(0,0,p.mul(.4).mul(e.depth).mul(g).mul(E(t,1.2))));let y=K(e.seed,e.em.mul(l.flow)),x=e.em.mul(e.motion===`explode`?.5:e.motion===`rise`?2:1.4).mul(e.turbulence).mul(s.mul(.8).add(.6)),S=b(0,0,0);for(let t=0;t<5;t++){let n=u.mul((t+.5)/5),r=y(f.add(v(n)).add(S)),i=F(0,.3,n);S=S.add(r.mul(b(1,1,e.depth)).mul(x.mul(i).mul(u).div(5)))}let C=f.add(v(u)).add(S),w=ie(b(L(c.mul(6.2832)),k(c.mul(6.2832)),i.mul(2).sub(1))),ee=u.mul(l.spin*6.2832).mul(i.mul(1.2).add(.4)),[ne,j]=l.round,M=F(ne,j,u),N=e.dot.mul(s.mul(.9).add(.55)),R=e.motion===`explode`?e.cell.mul(A(D(1),D(.6),u)):A(e.cell,N,F(0,.8,u)),z=a.mul(.3).add(.7);return{centre:C,progress:u,loose:d,axis:w,angle:ee,size:R,round:M,fade:F(z.mul(.6),z,u).oneMinus()}}function pe(e){let t=e=>{let t=new l(e);return t.premultiplyAlpha=!0,t},n=t(e),r=[];return{read:e=>{let t=ne(n,e);return r.push(t),t},set:e=>{let i=n;n=t(e);for(let e of r)e.value=n;i.dispose()},dispose:()=>n.dispose()}}const J=`dustBox`;function me(e){let t=new Float32Array(Math.max(1,e.quads.length)*4);return e.quads.forEach((e,n)=>{t.set([e.x,e.y,e.width,e.height],n*4)}),n(e.quads.length,{[J]:[t,4]})}function he(e,t,n,r,i,a){let o=O(J,`vec4`),s=x.xy.add(.5),c=o.x.add(s.x.mul(o.z)),l=o.y.add(s.y.oneMinus().mul(o.w)),d=new V({transparent:!0,depthTest:!1,depthWrite:!1});d.positionNode=b(c.sub(n.x),n.y.sub(l),0);let f=S(P(c.sub(r.x).div(r.z),l.sub(r.y).div(r.w).oneMinus())),p=S(P(c,l)),m=S(P(c.div(n.x.mul(2)),l.div(n.y.mul(2)).oneMinus())),h=t(f),g=w(h.rgb.div(I(h.a,1e-4)));d.colorNode=M(g,h.a.mul(i(p)).mul(a(m.clamp(0,1))));let _=new u(me(e),d);return _.frustumCulled=!1,_}const ge=(e,t)=>P(e.x.add(t.x).div(t.x.mul(2)),e.y.add(t.y).div(t.y.mul(2))).clamp(0,1);function _e(e,t,n){let r=O(se,`vec4`),i=O(ce,`vec4`),a=q(e),o=a.centre.z,s=B(o).mul(.006),c=a.size.add(s.mul(2)).add(2).mul(a.loose),l=x.xy.mul(c),u=fe(b(l.x,l.y,0),a.axis,a.angle),d=new V({transparent:!0,depthTest:!1,depthWrite:!1});d.positionNode=a.centre.add(u);let f=fe(b(0,0,1),a.axis,a.angle),p=ee(f.z.lessThan(0),f.negate(),f),m=b(...W),h=I(N(p,m),0).mul(.5).add(ue).div(de),g=ie(m.add(b(0,0,1))),_=N(i.xyz,b(.2126,.7152,.0722)),v=E(I(N(p,g),0),60).mul(A(D(.12),D(.6),_.sqrt())).mul(F(.02,.12,a.progress)),y=o.div(400).clamp(-1,1),C=S(h.mul(y.max(0).mul(.15).add(1))),T=S(v),[k,ne,L,R]=[e.frame.x,e.frame.y,e.frame.z,e.frame.w],z=S(l),H=S(a.size),U=S(s),oe=S(P(r.x.sub(k).div(L),r.y.sub(ne).div(R).oneMinus())),le=S(P(e.cell.div(L),e.cell.div(R))),G=t(oe.add(z.div(I(H,.001)).mul(le))),K=w(G.rgb.div(I(G.a,1e-4))),pe=te(B(z.x),H.mul(.5)).mul(te(B(z.y),H.mul(.5))),J=G.a.mul(pe),me=re(z).sub(H.mul(.5)),he=I(ae(me),U.mul(2)),_e=H.mul(H).div(H.mul(H).add(U.mul(U).mul(2))),ve=S(j(r.w.mul(e.cell.mul(e.cell)).div(I(a.size.mul(a.size).mul(.785),.001)),1)),Y=D(.5).sub(me.div(I(he,1e-4))).clamp(0,1).mul(ve).mul(_e),X=S(a.round),ye=A(K,S(i.xyz),X).mul(C).add(b(1,.96,.88).mul(T)),be=S(y.min(0).mul(.6).add(1)),xe=S(a.fade.mul(a.loose).mul(n(ge(a.centre,e.half))));return d.colorNode=M(ye,A(J,Y,X).mul(xe).mul(be).clamp(0,1)),d}function ve(e,t){let n=O(se,`vec4`),r=q(e),i=I(r.centre.z,0),a=r.size.add(i.mul(.05)),o=a.add(i.mul(.06)).add(2).mul(r.loose),s=x.xy.mul(o),c=r.centre.xy.add(P(-W[0]/W[2],-W[1]/W[2]).mul(i.mul(.5))),l=new V({transparent:!0,depthTest:!1,depthWrite:!1});l.positionNode=b(c.x.add(s.x),c.y.add(s.y),0);let u=S(s),d=S(a.mul(.5)),f=S(i.mul(.03).add(.5)),p=re(u).sub(d),m=D(.5).sub(p.div(I(ae(p),f.mul(2)))).clamp(0,1),h=r.size.div(a.add(i.mul(.06))),g=O(ce,`vec4`),_=N(g.xyz,b(.2126,.7152,.0722)).sqrt(),v=F(2,40,i).mul(h.mul(h).max(.04)).mul(A(D(1),D(.3),_)),y=S(r.fade.mul(r.loose).mul(n.w).mul(v).mul(e.shadow).mul(.3).mul(t(ge(b(c.x,c.y,0),e.half))));return l.colorNode=M(b(0,0,0),m.mul(y)),l}const Y={per:.02,min:1.4,max:2.2},X={wind:1,rise:1.15,explode:2.8},ye=(e,t,n)=>Math.min(Y.max,Math.max(Y.min,t*Y.per))*X[e]/Math.sqrt(Math.max(n,.05)),be=2e4,xe={wind:.6,rise:.65,explode:.7},Se={wind:1,rise:1,explode:.3},Ce=.4,we=65535,Te=/* @__PURE__ */ new WeakSet;function Ee(e,t,n,r,a){let o=i(a+13),[s,c,l,u]=e,d=(s+l)/2,f=(c+u)/2,p=1/Math.max(r*.7,4),m=(e,t)=>Math.min(1,Math.max(0,(o(e*p,t*p)-.5)*2.2+.5));if(t===`explode`){let e=Math.hypot(l-d,u-f)||1;return(t,n)=>Math.min(Se.explode,Math.hypot(t-d,n-f)/e*.24+m(t,n)*.06)}let h=n*Math.PI/180,g=Math.cos(h),_=-Math.sin(h),v=[s*g+c*_,l*g+c*_,s*g+u*_,l*g+u*_],y=Math.min(...v),b=Math.max(...v)-y||1;return(e,t)=>Math.min(1,Math.max(0,(y+b-e*g-t*_)/b*.72+m(e,t)*.28))}function De(e,t,n,r){return e===`rise`?Math.min(520,Math.max(90,n*1.6,r*2.6)):e===`explode`?Math.min(640,Math.max(100,t*.35,r*3.5)):Math.min(720,Math.max(100,t*.45,r*3))}const Oe=_({name:`dust`,params:{motion:g(`wind`,`rise`,`explode`),trigger:g(`scroll`,`click`,`view`),density:1,dot:1.6,duration:2.2,angle:15,turbulence:1,depth:1,shadow:.5,seed:1},rebuild:[`density`,`seed`],on:`:not(img, video, canvas, svg, input, textarea)`,presence:`custom`,bleed:600,quality:{low:{density:.6,shadow:0}},async setup(i){let{element:l,u:g,params:_,app:v,signal:b}=i,{stage:x}=v,{trigger:S,motion:w}=_,T=t=>{e&&v.log.warn(`dust: ${t}, the text stays as it is`,l)},E=i.quality===`low`?1:2,D=Math.round(be*a[i.quality]),ee=h(l)??await p(l),O=ee?void 0:m(l,`line`,E);if(b.aborted)return;let k=e=>oe(e,t(e),{cell:ye(w,r(e),_.density),max:D,seed:_.seed}),j=O?k(O):void 0;if(!O||!j?.count){ee&&T(`${ee} cannot be drawn`),i.showDom(!0);return}let M=xe[w],N=R(0),F=R(0),re=R(new d(1,0)),L=R(new d),ie=R(200),z=R(16),B=R(j.cell),ae=R(new d(1,1)),V=R(new s(...O.frame)),H=g.size.mul(.5),U=e=>i.mask(e),W=I(N,g.presence.oneMinus()),ue=W.mul(Se[w]+M),de=new o(/* @__PURE__ */ new Uint8Array(4),1,1),G=[],fe=(e,t,n)=>{let i=r(e),a=Ee(t.bounds,w,n,i,_.seed),s=new Uint8Array(t.cols*t.rows*4);for(let e=0;e<t.count;e++){let n=t.home[e*4],r=t.home[e*4+1],i=(t.ink[e*4+3]-.5)*.04,o=Math.round(Math.min(1,Math.max(0,a(n,r)+i))*we);t.home[e*4+2]=o/we;let c=t.index[e]*4;s[c]=o>>8,s[c+1]=o&255,s[c+3]=255}let c=new o(s,t.cols,t.rows);c.magFilter=c.minFilter=f,c.generateMipmaps=!1,c.colorSpace=``,c.needsUpdate=!0;let l=de;de=c;for(let e of G)e.value=c;l.dispose();let[u,d,p,m]=t.bounds;L.value.set((u+p)/2,(d+m)/2),B.value=t.cell,ae.value.set(t.cols,t.rows),z.value=i,ie.value=De(w,p-u,m-d,i)},K=_.angle;fe(O,j,K),i.onDispose(()=>de.dispose());let q=pe(O.canvas);i.onDispose(()=>q.dispose());let J=he(O,q.read,H,V,e=>{let t=C(e.x.sub(V.x).div(B)),n=C(e.y.sub(V.y).div(B)),r=ne(de,P(t.add(.5).div(ae.x),n.add(.5).div(ae.y)));G.push(r);let i=r,a=i.x.mul(65280).add(i.y.mul(255)).div(we);return A(te(ue,a),W.oneMinus(),F)},U),ge={motion:w,front:ue,span:M,way:re,middle:L,reach:ie,em:z,cell:B,dot:g.dot,turbulence:g.turbulence,depth:g.depth,shadow:g.shadow,calm:F,half:H,frame:V,seed:_.seed},Y=e=>n(e.count,{[se]:[e.home,4],[ce]:[e.ink,4],[le]:[e.random,4]}),X=Y(j),Oe=new u(X,_e(ge,q.read,U)),ke=new u(X,ve(ge,U));for(let e of[ke,Oe])e.frustumCulled=!1;J.renderOrder=1,Oe.renderOrder=2;let Ae=new c;if(Ae.add(J,ke,Oe),i.place(Ae,{fit:`none`,replace:!0}),await i.compile(Ae),b.aborted)return;let je=(e,t)=>{O=e,j=t,fe(e,t,K);let n=X;X=Y(t),Oe.geometry=ke.geometry=X,n.dispose();let r=J.geometry;J.geometry=me(e),r.dispose(),q.set(e.canvas),V.value.set(...e.frame)},Me=!0,Ne=e=>{Me=e,i.showDom(e)},Z=Te.has(l),Pe=e=>{Ae.visible=!e};Pe(Z),Ne(!Z);let Fe,Ie,Le=async()=>{Fe=void 0;let e=await p(l);if(b.aborted)return;if(e&&e!==Ie&&T(`${e} cannot be drawn`),Ie=e,e){i.invalidate();return}let t=m(l,`line`,E),n=t&&k(t);t&&n?.count&&(je(t,n),i.invalidate())},Re=()=>{if(Fe?.(),Me&&typeof requestIdleCallback==`function`){let e=requestIdleCallback(()=>void Le(),{timeout:1e3});Fe=()=>cancelIdleCallback(e)}else{let e=setTimeout(()=>void Le(),150);Fe=()=>clearTimeout(e)}};i.onDispose(()=>Fe?.());let ze=new MutationObserver(Re);ze.observe(l,{characterData:!0,childList:!0,subtree:!0}),i.onDispose(()=>ze.disconnect());let Be=new ResizeObserver(()=>{let e=l.getBoundingClientRect().width;Math.abs(e-(O?.width??e))>.5&&Re()});Be.observe(l),i.onDispose(()=>Be.disconnect()),document.fonts?.addEventListener(`loadingdone`,Re,{signal:b});let Q=+!!Z,$=Q,Ve=!1,He=()=>{Z||$===1||($=1,l.setAttribute(`data-dio-dust`,`playing`),Ve=!0,i.invalidate())};return S===`click`&&(l.addEventListener(`click`,He,{signal:b}),l.addEventListener(`keydown`,e=>{e.key===`Enter`&&e.target===l&&!l.matches(`button, a[href]`)&&He()},{signal:b})),e=>{let t=i.params,n=e.reducedMotion;if(F.value=+!!n,ke.visible=t.shadow>0,Ie||n&&S!==`click`)return Ne(!0),Ve;t.angle!==K&&j&&O&&(K=t.angle,fe(O,j,K),X.getAttribute(se).needsUpdate=!0);let r=K*Math.PI/180;re.value.set(Math.cos(r),Math.sin(r));let a=x.height.peek(),o=e.y+(typeof scrollY==`number`?scrollY:0),s=Math.max(0,Math.min(a*.3,o-1)),c=Math.min(1,Math.max(0,(s-e.y)/(s+e.height*.5||1)));if(S===`view`&&(c>.2?$=1:c<=0&&($=0),$!==Q&&(Ve=!0)),S===`scroll`)Q=c;else if(Q!==$){let r=n?Ce:Math.max(t.duration,.001)/($<Q?1.6:1);Q=y(Q,$,e.delta/r)}else Ve=!1;return N.value=Q,S===`click`&&Q>=1&&!Z&&(Z=!0,Te.add(l),Ve=!1,l.setAttribute(`data-dio-dust`,`done`),l.dispatchEvent(new CustomEvent(`dio:dust`,{bubbles:!0}))),Pe(Z),Ne(!Z&&Q<=0&&e.presence>=1),Ve}}});export{Ce as CALM,be as MAX_GRAINS,ye as cellSide,Oe as default,De as reachOf,Ee as sweep};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./dev-CoKR705i.js";import{a as t,l as n,t as r,u as i}from"./raster-Bf0CGQIc-CYX6ZFTt.js";import{D as a,Er as o,Gn as s,K as c,O as l,Qn as u,Tr as d,an as f,f as p,gt as m,h,kt as g,l as _,u as v}from"./three.core-B13DgFZS.js";import{n as y,r as b,t as x}from"./sdf-CQr4aUMC-C64-EhF4.js";import{t as S}from"./paint-XpIPgN9_-CZPzy07M.js";import{i as C,n as ee}from"./effect-DJHvQTKy.js";import{a as te,b as ne,o as re}from"./kit-BM0qCXzI.js";import{Ai as w,Cr as ie,Di as ae,Dr as oe,Jr as T,Lt as se,Or as E,Pt as D,ar as O,dt as k,hi as ce,ir as A,ji as le,jt as ue,ki as j,oi as de,rt as fe,sn as pe,tr as M,ui as me,wi as N,yr as P}from"./three.tsl-CmShpHGs.js";import{t as he}from"./three.webgpu-CChnXdxT.js";import{t as F}from"./dist-77NXfk7b.js";const ge={paper:{base:`#f3efe6`,relief:.2,spec:.035,shine:6,metal:!1,wrap:.25,pressed:.95,tint:0},leather:{base:`#6a4330`,relief:.32,spec:.12,shine:14,metal:!1,wrap:.1,pressed:.55,tint:.5},metal:{base:`#b4b8bf`,relief:.16,spec:.42,shine:60,metal:!0,wrap:0,pressed:.9,tint:.7},stone:{base:`#9a968f`,relief:.45,spec:.07,shine:14,metal:!1,wrap:.05,pressed:.9,tint:0},plaster:{base:`#ece8e1`,relief:.5,spec:.025,shine:5,metal:!1,wrap:.2,pressed:.94,tint:0}},I=(e,t,n)=>{let r=Math.min(1,Math.max(0,(n-e)/(t-e)));return r*r*r*(r*(r*6-15)+10)},_e=e=>e*e*e*(e*(e*6-15)+10);function ve(e,t,n){let r=new Float32Array(e*t);for(let e=0;e<r.length;e++)r[e]=n()*2-1;return{values:r,nx:e,ny:t}}function L(e,t,n){let r=t/512*e.nx,i=n/512*e.ny,a=Math.floor(r),o=Math.floor(i),s=_e(r-a),c=_e(i-o),l=(a%e.nx+e.nx)%e.nx,u=(o%e.ny+e.ny)%e.ny,d=(l+1)%e.nx,f=(u+1)%e.ny,p=e.values[u*e.nx+l],m=e.values[u*e.nx+d],h=e.values[f*e.nx+l],g=e.values[f*e.nx+d];return p+(m-p)*s+(h-p)*c+(p-m-h+g)*s*c}function R(e,t,n){for(let[r,i,a]of n){let n=ve(r,i,t);for(let t=0;t<512;t++)for(let r=0;r<512;r++){let i=t*512+r;e[i]=e[i]+L(n,r,t)*a}}}const z=(e,t)=>(t%512+512)%512*512+(e%512+512)%512;function B(e,t,n){let r=/* @__PURE__ */ new Float32Array(262144);for(let e=0;e<Se;e++){let e=n()*512,t=n()*512,i=n()*Math.PI*2,a=(n()-.5)*.08,o=5+n()**2*26,s=.4+n()*.4,c=.2+n()*.5;for(let n=0;n<o;n+=.5){e+=Math.cos(i)*.5,t+=Math.sin(i)*.5,i+=a;let n=Math.round(e),o=Math.round(t);for(let i=-2;i<=2;i++)for(let a=-2;a<=2;a++){let l=(n+a-e)**2+(o+i-t)**2,u=c*Math.exp(-l/(2*s*s)),d=z(n+a,o+i);u>r[d]&&(r[d]=u)}}}let i=/* @__PURE__ */ new Float32Array(262144);R(i,n,[[64,64,.25],[128,128,.4],[256,256,.3]]);let a=/* @__PURE__ */ new Float32Array(262144);R(a,n,[[8,8,.6],[16,16,.3],[32,32,.15]]);for(let n=0;n<e.length;n++)e[n]=r[n]*.45+i[n]+a[n]*.3,t[n]=1+a[n]*.02+r[n]*.01}function V(e,t,n){let r=512/96,i=/* @__PURE__ */ new Float32Array(18432);for(let e=0;e<9216;e++)i[e*2]=n(),i[e*2+1]=n();let a=/* @__PURE__ */ new Float32Array(262144);R(a,n,[[64,64,.5],[128,128,.3]]);let o=/* @__PURE__ */ new Float32Array(262144);R(o,n,[[16,16,1],[32,32,.5]]);let s=/* @__PURE__ */ new Float32Array(262144);R(s,n,[[6,6,1],[12,12,.5]]);for(let n=0;n<512;n++)for(let c=0;c<512;c++){let l=o[n*512+c]*.45,u=c/r+l,d=n/r-l*.7,f=Math.floor(u),p=Math.floor(d),m=9,h=9,g=0;for(let e=-1;e<=1;e++)for(let t=-1;t<=1;t++){let n=f+t,r=p+e,a=(r%96+96)%96*96+(n%96+96)%96,o=n+i[a*2]*.8+.1,s=r+i[a*2+1]*.8+.1,c=Math.hypot(o-u,s-d);c<m?(h=m,m=c,g=a):c<h&&(h=c)}let _=I(0,.6,h-m)*(.6+.4*i[g*2]),v=n*512+c,y=1-I(0,.25,h-m),b=a[v];e[v]=_*.8+b*.2+s[v]*.25,t[v]=1-y*.08+b*.04+s[v]*.05}}function ye(e,t,n){R(e,n,[[3,512,1],[7,512,.6],[16,256,.35],[2,128,.25]]);let r=/* @__PURE__ */ new Float32Array(262144);R(r,n,[[4,4,.5],[8,8,.25]]);for(let n=0;n<e.length;n++)t[n]=1+e[n]*.05+r[n]*.04}function be(e,t,n){R(e,n,[[32,32,.35],[96,96,.3],[256,256,.3]]);let r=/* @__PURE__ */ new Float32Array(262144);R(r,n,[[6,6,.6],[14,14,.35]]);for(let e=0;e<t.length;e++)t[e]=1+r[e]*.06;for(let r=0;r<U;r++){let r=n()*512,i=n()*512,a=.5+n()**3*2.2,o=n()<.62?-(.18+n()*.35):.12+n()*.22,s=n()<.25?-.6:0;for(let n=-3;n<=3;n++)for(let c=-3;c<=3;c++){let l=Math.hypot(Math.round(r)+c-r,Math.round(i)+n-i),u=Math.min(1,Math.max(0,a+.5-l));if(u<=0)continue;let d=z(Math.round(r)+c,Math.round(i)+n);t[d]=t[d]+o*u,e[d]=e[d]+s*u}}}function H(e,t,n){let r=/* @__PURE__ */ new Float32Array(262144);R(r,n,[[4,6,1.6],[8,10,.8],[16,16,.3]]),R(e,n,[[128,128,.25],[256,256,.2]]);for(let n=0;n<e.length;n++)e[n]=e[n]+r[n]*2.2,t[n]=1+r[n]*.02;for(let r=0;r<W;r++){let r=Math.round(n()*512),i=Math.round(n()*512),a=.6+n()*1.3;for(let n=-2;n<=2;n++)for(let o=-2;o<=2;o++){let s=Math.min(1,Math.max(0,a+.5-Math.hypot(o,n))),c=z(r+o,i+n);e[c]=e[c]-s*.7,t[c]=t[c]-s*.05}}}const xe={paper:B,leather:V,metal:ye,stone:be,plaster:H},Se=1800,U=9e3,W=500,Ce=/* @__PURE__ */ new Map;function we(e){let t=Ce.get(e);if(t)return t;let n=/* @__PURE__ */ new Float32Array(262144),r=(/* @__PURE__ */ new Float32Array(262144)).fill(1);xe[e](n,r,ne(24301+e.length*7919));let i=0,a=0;for(let e of n)i+=e,a+=e*e;let o=i/n.length,s=Math.sqrt(Math.max(1e-9,a/n.length-o*o)),c=ge[e].relief/s,u=l.toHalfFloat,d=/* @__PURE__ */ new Uint16Array(1048576);for(let e=0;e<512;e++)for(let t=0;t<512;t++){let i=e*512+t,a=i*4,o=(n[z(t+1,e)]-n[z(t-1,e)])*.5*c,s=(n[z(t,e+1)]-n[z(t,e-1)])*.5*c;d[a]=u(Math.max(-8,Math.min(8,o))),d[a+1]=u(Math.max(-8,Math.min(8,s))),d[a+2]=u(Math.max(.3,Math.min(1.7,r[i]))),d[a+3]=u(0)}return Ce.set(e,d),d}function Te(e,t,n){let r=Math.max(.35,n);if(e===`emboss`||e===`stamp`)return I(-.45*r,1.05*r,t);if(e===`deboss`)return-I(-.25*r,.85*r,t);let i=Math.exp(-(((t+1.9*r)/r)**2));return-.62*I(-1.1*r,.1*r,t)+.035*i}function Ee(e,t,n){let[r,i,a,o,s]=n,c=Math.abs(e-(r+a/2))-(a/2-s),l=Math.abs(t-(i+o/2))-(o/2-s);return-(Math.hypot(Math.max(c,0),Math.max(l,0))+Math.min(Math.max(c,l),0)-s)}function De(e,t,n,i){let[a,o,s,c]=e.frame,u=Math.max(1,...e.quads.map(e=>e.em)),d=t===`stamp`&&s<(c+u*.6)*2.4,f=Math.ceil(t===`stamp`?d?Math.max(s-c,0)/2+u*.8:u*.8:u*.45)+4,p=Math.min(2,i,r/Math.max(s+2*f,c+2*f)),m=Math.max(1,Math.ceil((s+2*f)*p)),h=Math.max(1,Math.ceil((c+2*f)*p)),g=a-f,_=o-f,v=document.createElement(`canvas`);v.width=m,v.height=h;let S=e.canvas.width/Math.max(1e-6,s);v.getContext(`2d`)?.drawImage(e.canvas,f*p,f*p,e.canvas.width/S*p,e.canvas.height/S*p);let C=y(v,m,h),ee=b(C,m,h),te=[...e.quads].sort((e,t)=>e.y-t.y),re=new Float32Array(h);for(let e=0;e<h;e++){let t=_+(e+.5)/p,n=u,r=1/0;for(let e of te){let i=t<e.y?e.y-t:t>e.y+e.height?t-e.y-e.height:0;i<r&&(r=i,n=e.em)}re[e]=n}let w=[0,0,0,0,0],ie;if(t===`stamp`){let e=1/0,t=1/0,n=-1/0,r=-1/0;for(let i=0;i<h;i++)for(let a=0;a<m;a++)C[i*m+a]>.3&&(e=Math.min(e,a),n=Math.max(n,a+1),t=Math.min(t,i),r=Math.max(r,i+1));Number.isFinite(e)||([e,t,n,r]=[f*p,f*p,m-f*p,h-f*p]);let i=(n-e)/p+u*.72,a=(r-t)/p+u*.6,o=g+(e+n)/2/p,s=_+(t+r)/2/p;d&&(i=Math.max(i,a)+u*.2,a=i),w=[o-i/2,s-a/2,i,a,d?i/2:Math.min(a/2,i/2,u*.38)];let[c,l]=w,v=ve(9,9,ne(1441));ie=(e,t)=>L(v,(e-c)/Math.max(1,i)*512,(t-l)/Math.max(1,a)*512)}let ae=new Float32Array(m*h);for(let e=0;e<h;e++){let r=re[e],i=Math.max(0,n)*r*(t===`stamp`?1.6:1),a=_+(e+.5)/p;for(let n=0;n<m;n++){let o=e*m+n,s=Te(t,-ee[o]/p,i),c=s*r;if(t===`stamp`){let e=g+(n+.5)/p,t=Ee(e,a,w)+(ie?.(e,a)??0)*u*.035;c=(I(-.05*u,.07*u,t)*.32+Math.exp(-(((t-.12*u)/(.045*u))**2))*.6+s*.62)*u}ae[o]=c}}let oe=Math.max(0,n)*u*p,T=x(ae,m,h,Math.max(.5,oe*.12)),se=x(T,m,h,Math.max(1,u*.06*p)),E=new Uint16Array(m*h*4),D=0,O=l.toHalfFloat;for(let e=0;e<h;e++){let t=Math.max(0,e-1)*m,n=Math.min(h-1,e+1)*m,r=e*m;for(let e=0;e<m;e++){let i=r+e,a=r+Math.max(0,e-1),o=r+Math.min(m-1,e+1),s=i*4;E[s]=O((T[o]-T[a])*p/2),E[s+1]=O((T[n+e]-T[t+e])*p/2),E[s+2]=O(T[i]),D=Math.max(D,T[i]),E[s+3]=O(Math.max(0,se[i]-T[i]))}}return{data:E,width:m,height:h,frame:[g,_,m/p,h/p],em:u,pad:w,top:D}}const Oe=22,ke=.12,Ae=Math.PI/180,je=.42,Me=.75;function Ne(e,t){let n=getComputedStyle(t),r=e.trim();for(let e=0;e<8;e++){let e=/^var\(\s*(--[\w-]+)\s*(?:,\s*(.*))?\)$/is.exec(r);if(!e)break;r=n.getPropertyValue(e[1]).trim()||(e[2]??``).trim()}if(!r||r.toLowerCase()===`currentcolor`){let e=n.getPropertyValue(`-webkit-text-fill-color`);r=e&&!/^(transparent|rgba\(.*,\s*0\))$/.test(e)?e:n.color}return F(r)}function Pe(e){let t=getComputedStyle(e).backgroundColor??``;return S(t)>=.5?F(t):void 0}function Fe(e){for(let t=e.parentElement;t;t=t.parentElement){let e=Pe(t);if(e)return e}return`#ffffff`}function Ie(e,t,n,r,i){let a=Math.max(t,n,240),o=a*.55,s=e*Ae,c=Math.max(-o,Math.min(o,(i/2-r)*.45));return[Math.sin(s)*o,-Math.cos(s)*o+c,Math.min(700,Math.max(140,a*.45))]}function Le(e,t,n,r){let i=Math.max(n,r,240)*.9+160,a=Math.hypot(e,t);if(a<1e-6)return[0,0];let o=i*Math.tanh(a/i)/a;return[e*o,t*o]}function Re(e){let t=new p(e);return t.premultiplyAlpha=!0,t.colorSpace=u,t.generateMipmaps=!1,t.minFilter=m,t.magFilter=m,t}function ze(e,t,n,r){let i=new a(e,t,n,f,c);return i.minFilter=m,i.magFilter=m,i.generateMipmaps=!1,r&&(i.wrapS=s,i.wrapT=s),i.needsUpdate=!0,i}function Be(e,t){if(t)return e.canvas;let n=document.createElement(`canvas`);n.width=e.canvas.width,n.height=e.canvas.height;let r=n.getContext(`2d`);if(!r)return n;let i=e.canvas.width/Math.max(1e-6,e.frame[2]);for(let t of e.quads){if(t.em>=22)continue;let a=Math.max(0,Math.floor((t.y-e.frame[1])*i)),o=Math.min(n.height-a,Math.ceil(t.height*i)+1);o>0&&r.drawImage(e.canvas,0,a,n.width,o,0,a,n.width,o)}return n}function Ve(){let e=new v;return e.setIndex([0,2,1,2,3,1]),e.setAttribute(`position`,new _(new Float32Array([-.5,.5,0,.5,.5,0,-.5,-.5,0,.5,-.5,0]),3)),e}const He=/* @__PURE__ */ new WeakMap,Ue=ee({name:`emboss`,params:{style:C(`emboss`,`deboss`,`letterpress`,`stamp`),material:C(`paper`,`leather`,`metal`,`stone`,`plaster`),depth:.05,bevel:.03,light:315,follow:1,grain:1,color:``},on:`:not(img, video, canvas, svg, input, textarea)`,bleed:60,quality:{},animate:{fps:e=>He.get(e.signal)?.()??0},async setup(r){let{element:a,u:s,params:c,app:l,signal:u}=r,{stage:f}=l,p=r.quality===`low`?1:2,m=r.quality===`low`?8:16,_=i(a),v=(_===`text-shadow`?void 0:_)??await t(a),y=v?void 0:n(a,`line`,p);if(u.aborted)return;if(!y?.quads.length){v&&e&&l.log.warn(`emboss: ${v} cannot be drawn, the text stays as it is`,a),r.showDom(!0);return}let b=c.style,x=ge[c.material],S=c.color.trim(),C=S?Ne(S,a):void 0;S&&!C&&e&&l.log.warn(`emboss: "${S}" is not a color, left out`,a);let ee=getComputedStyle(a).backgroundImage;e&&ee&&ee!==`none`&&l.log.warn(`emboss: a background image is not drawn, only the background color`,a);let ne=b===`letterpress`||b===`stamp`||!!C,F=De(y,b,r.params.bevel,p),I=r.params.bevel,_e=()=>Pe(a),ve=_e(),L=N(new o(...y.frame)),R=N(new o(...F.frame)),z=N(new d(0,-400,400)),B=N(+!!ve),V=N(new h(ve??Fe(a))),ye=N(new h(C??Ne(``,a)??`#222222`)),be=N(+!!C),H=N(F.em),xe=N(F.top),Se=N(1),U=s.size.mul(.5),W=w(U.x.add(z.x),U.y.add(z.y),z.z),Ce=O(A(R.x,0),D(0),B),Te=O(A(R.y,0),D(0),B),Ee=O(M(R.x.add(R.z),s.size.x),s.size.x,B),Oe=O(M(R.y.add(R.w),s.size.y),s.size.y,B),Ae=ie.xy.add(.5),Ue=Ce.add(Ae.x.mul(Ee.sub(Ce))),We=Te.add(Ae.y.oneMinus().mul(Oe.sub(Te))),Ge=new he({transparent:!0,depthTest:!1,depthWrite:!1});Ge.positionNode=w(Ue.sub(U.x),U.y.sub(We),0);let G=ae(j(Ue,We)),Ke=ze(F.data,F.width,F.height,!1),qe=ze(we(c.material),512,512,!0),Je=Re(Be(y,ne)),Ye=[],Xe=e=>{let t=ce(Ke,j(e.x.sub(R.x).div(R.z),e.y.sub(R.y).div(R.w)));return Ye.push(t),t},K=Xe(G),q=M(s.depth,0),Ze=K.z.mul(q),Qe=ce(qe,G.div(512)),$e=ce(qe,G.div(2406.4).add(j(.37,.61))),J=ce(Je,j(G.x.sub(L.x).div(L.z),G.y.sub(L.y).div(L.w).oneMinus())),et=K.z.div(H),tt=de(.08,.5,et.negate()),nt=b===`stamp`?de(.1,.26,et):D(0),rt=k(pe(j(K.x,K.y)).mul(q),0,2),it=O(k(J.a.mul(.6).add(nt.mul(.3)),0,1),D(1),B),Y=k(s.grain,0,3).mul(tt.mul(.45).oneMinus(),it);b===`letterpress`&&(Y=Y.mul(rt.mul(.8).add(1))),b===`stamp`&&(Y=Y.mul(O(1,.12,nt)));let at=K.x.mul(q).add(Qe.x.mul(Y)),ot=K.y.mul(q).add(Qe.y.mul(Y)),st=P(w(at.negate(),ot,1)),ct=w(W.x.sub(G.x),G.y.sub(W.y),W.z.sub(Ze)),lt=P(ct),ut=x.wrap,dt=k(ue(st,lt).add(ut).div(1+ut),0,1),ft=P(w(W.x.sub(G.x),G.y.sub(W.y),W.z)),pt=k(ft.z.add(ut).div(1+ut),0,1),mt=j(W.x.sub(G.x),W.y.sub(G.y)),ht=M(pe(mt),.001),gt=mt.div(ht),_t=W.z.sub(Ze).div(ht),vt=A(A(ht,H.mul(.7)),M(xe.mul(q).sub(Ze),0).div(M(_t,.001)).add(.5)),yt=se(se(T.x.mul(.06711056).add(T.y.mul(.00583715))).mul(52.9829189)),bt=D(0);for(let e=0;e<m;e++){let t=vt.mul(E(D(e+1).sub(yt).div(m),1.5)),n=Xe(G.add(gt.mul(t))).z.mul(q).sub(Ze.add(_t.mul(t)));bt=M(bt,de(0,t.mul(.16).add(.35),n))}let xt=bt.mul(.88).oneMinus(),St=k(K.w.mul(q).div(H.mul(.03)),0,1).mul(.4).oneMinus(),Ct=P(fe.sub(oe)),wt=P(lt.add(Ct)),Tt=M(ue(st,wt),0),Et=de(0,.15,ue(st,lt)),X;if(x.metal){let e=P(w(1,0,0).sub(st.mul(st.x))),t=ue(e,wt);X=E(me(M(t.mul(t).oneMinus(),0)),x.shine).mul(x.spec).add(E(Tt,20).mul(.08))}else X=E(Tt,x.shine).mul(x.spec);b===`stamp`&&(X=O(X,E(Tt,70).mul(.6).add(E(Tt,9).mul(.07)),nt)),X=X.mul(xt,Et);let Dt=P(ft.add(Ct)),Ot=x.metal?D(0):E(M(Dt.z,0),x.shine).mul(x.spec),kt=Qe.z.sub(1).add($e.z.sub(1).mul(.6)).mul(k(s.grain,0,3)).add(1),At=O(V,E(V,w(1.3)),x.tint),jt=O(V,At.mul(x.pressed),tt).mul(kt),Mt=J.a,Nt=J.rgb.div(M(Mt,.001)),Pt=O(Nt,ye,be),Ft=b===`letterpress`?k(Qe.z.sub(1).mul(1.5).add(.97).add(rt.mul(.05)),0,1):D(1),It=b===`stamp`?nt:Mt.mul(Ft),Lt=b===`stamp`?ye.mul(O(.9,1.06,$e.z)):Pt.mul(O(1,Qe.z,.4)),Rt=O(jt,Lt,It),zt=D(je).mul(St).add(dt.mul(Me,xt,O(1,St,.5))).mul(Se,x.metal?.85:1),Bt=D(je).add(pt.mul(Me)).mul(Se),Vt=O(w(1),V.div(M(V.x,M(V.y,V.z)).max(.05)),x.tint),Ht=Rt.mul(zt).add(Vt.mul(X)),Ut=zt.div(M(Bt,.001)),Wt=A(Ut,1),Gt=k(Ut.sub(1).mul(1.2),0,.7).add(M(X.sub(Ot),0)).clamp(0,1),Kt=Wt.mul(Gt.oneMinus()),qt=D(1).sub(It.oneMinus().mul(Kt)),Jt=Lt.mul(It,Kt).add(Gt).div(M(qt,1e-4)),Yt=j(G.x.div(s.size.x),G.y.div(s.size.y).oneMinus()),Xt=j(.5,.5).div(M(s.size,j(1,1))),Zt=r.mask(k(Yt,Xt,Xt.oneMinus()));Ge.colorNode=le(O(Jt,Ht,B).add(re()),O(qt,D(1),B).clamp(0,1).mul(Zt));let Qt=new g(Ve(),Ge);if(Qt.frustumCulled=!1,r.onDispose(()=>{(Ye[0]?.value)?.dispose(),qe.dispose(),J.value.dispose()}),r.place(Qt,{fit:`none`,replace:!0}),await r.compile(Qt),u.aborted)return;let $t=(e,t)=>{let n=Ye[0]?.value,i=ze(t.data,t.width,t.height,!1);for(let e of Ye)e.value=i;n?.dispose();let o=J.value;J.value=Re(Be(e,ne)),o.dispose(),L.value.set(...e.frame),R.value.set(...t.frame),H.value=t.em,xe.value=t.top;let s=_e();B.value=+!!s,V.value.set(s??Fe(a)),C||ye.value.set(Ne(``,a)??`#222222`),y=e,r.invalidate()},en,tn=async()=>{if(en=void 0,await t(a)||u.aborted)return;let e=n(a,`line`,p);e?.quads.length&&(I=r.params.bevel,$t(e,De(e,b,I,p)))},nn=()=>{clearTimeout(en),en=setTimeout(()=>void tn(),150)};r.onDispose(()=>clearTimeout(en));let rn=new MutationObserver(nn);rn.observe(a,{characterData:!0,childList:!0,subtree:!0}),r.onDispose(()=>rn.disconnect());let an=new ResizeObserver(()=>{let e=a.getBoundingClientRect().width;Math.abs(e-(y?.width??e))>.5&&nn()});an.observe(a),r.onDispose(()=>an.disconnect()),document.fonts?.addEventListener(`loadingdone`,nn,{signal:u});let Z,on=e=>{e.pointerType!==`touch`&&(Z={x:e.clientX,y:e.clientY},r.params.follow>0&&!f.reducedMotion.peek()&&r.invalidate())},sn=()=>{Z&&(Z=void 0,r.invalidate())};addEventListener(`pointermove`,on,{passive:!0,signal:u}),document.documentElement.addEventListener(`pointerleave`,sn,{signal:u}),addEventListener(`blur`,sn,{signal:u});let cn=0;He.set(u,()=>cn);let Q=0,$=0,ln=!1;return e=>{let t=r.params;Math.abs(t.bevel-I)>.001&&!en&&(I=t.bevel,nn());let n=e.reducedMotion,i=Math.min(e.delta,.1),a=e.width,o=e.height,s=f.height.peek()||o,c=e.y+o/2,[l,u,d]=Ie(t.light,a,o,n?s/2:c,s),p=l,m=u,h=n?0:Math.min(1,Math.max(0,t.follow));if(h>0&&Z){let[t,n]=Le(Z.x-(e.x+a/2),Z.y-c,a,o);p+=(t-l)*h,m+=(n-u)*h}!ln||n?(Q=p,$=m,ln=!0):(Q=te(Q,p,ke,i),$=te($,m,ke,i));let g=Math.abs(Q-p)>.5||Math.abs($-m)>.5;g||(Q=p,$=m),z.value.set(Q,$,d);let[_,v]=Ie(t.light,a,o,s/2,s),y=d/Math.hypot(_,v,d);Se.value=1/(je+Me*Math.min(1,(y+x.wrap)/(1+x.wrap))),cn=g?60:0}}});export{Oe as SMALL,Pe as backgroundOf,Ue as default,Le as reachOf,Ie as rest};
|
|
1
|
+
import{t as e}from"./dev-CoKR705i.js";import{a as t,l as n,t as r,u as i}from"./raster-Bf0CGQIc-CYX6ZFTt.js";import{D as a,Er as o,Gn as s,K as c,O as l,Qn as u,Tr as d,an as f,f as p,gt as m,h,kt as g,l as _,u as v}from"./three.core-B13DgFZS.js";import{n as y,r as b,t as x}from"./sdf-CQr4aUMC-C64-EhF4.js";import{t as S}from"./paint-XpIPgN9_-BlJb2tT9.js";import{i as C,n as ee}from"./effect-DJHvQTKy.js";import{a as te,b as ne,o as re}from"./kit-DAFViSYh.js";import{Ai as w,Cr as ie,Di as ae,Dr as oe,Jr as T,Lt as se,Or as E,Pt as D,ar as O,dt as k,hi as ce,ir as A,ji as le,jt as ue,ki as j,oi as de,rt as fe,sn as pe,tr as M,ui as me,wi as N,yr as P}from"./three.tsl-CmShpHGs.js";import{t as he}from"./three.webgpu-CChnXdxT.js";import{t as F}from"./dist-DNaBWJWL.js";const ge={paper:{base:`#f3efe6`,relief:.2,spec:.035,shine:6,metal:!1,wrap:.25,pressed:.95,tint:0},leather:{base:`#6a4330`,relief:.32,spec:.12,shine:14,metal:!1,wrap:.1,pressed:.55,tint:.5},metal:{base:`#b4b8bf`,relief:.16,spec:.42,shine:60,metal:!0,wrap:0,pressed:.9,tint:.7},stone:{base:`#9a968f`,relief:.45,spec:.07,shine:14,metal:!1,wrap:.05,pressed:.9,tint:0},plaster:{base:`#ece8e1`,relief:.5,spec:.025,shine:5,metal:!1,wrap:.2,pressed:.94,tint:0}},I=(e,t,n)=>{let r=Math.min(1,Math.max(0,(n-e)/(t-e)));return r*r*r*(r*(r*6-15)+10)},_e=e=>e*e*e*(e*(e*6-15)+10);function ve(e,t,n){let r=new Float32Array(e*t);for(let e=0;e<r.length;e++)r[e]=n()*2-1;return{values:r,nx:e,ny:t}}function L(e,t,n){let r=t/512*e.nx,i=n/512*e.ny,a=Math.floor(r),o=Math.floor(i),s=_e(r-a),c=_e(i-o),l=(a%e.nx+e.nx)%e.nx,u=(o%e.ny+e.ny)%e.ny,d=(l+1)%e.nx,f=(u+1)%e.ny,p=e.values[u*e.nx+l],m=e.values[u*e.nx+d],h=e.values[f*e.nx+l],g=e.values[f*e.nx+d];return p+(m-p)*s+(h-p)*c+(p-m-h+g)*s*c}function R(e,t,n){for(let[r,i,a]of n){let n=ve(r,i,t);for(let t=0;t<512;t++)for(let r=0;r<512;r++){let i=t*512+r;e[i]=e[i]+L(n,r,t)*a}}}const z=(e,t)=>(t%512+512)%512*512+(e%512+512)%512;function B(e,t,n){let r=/* @__PURE__ */ new Float32Array(262144);for(let e=0;e<Se;e++){let e=n()*512,t=n()*512,i=n()*Math.PI*2,a=(n()-.5)*.08,o=5+n()**2*26,s=.4+n()*.4,c=.2+n()*.5;for(let n=0;n<o;n+=.5){e+=Math.cos(i)*.5,t+=Math.sin(i)*.5,i+=a;let n=Math.round(e),o=Math.round(t);for(let i=-2;i<=2;i++)for(let a=-2;a<=2;a++){let l=(n+a-e)**2+(o+i-t)**2,u=c*Math.exp(-l/(2*s*s)),d=z(n+a,o+i);u>r[d]&&(r[d]=u)}}}let i=/* @__PURE__ */ new Float32Array(262144);R(i,n,[[64,64,.25],[128,128,.4],[256,256,.3]]);let a=/* @__PURE__ */ new Float32Array(262144);R(a,n,[[8,8,.6],[16,16,.3],[32,32,.15]]);for(let n=0;n<e.length;n++)e[n]=r[n]*.45+i[n]+a[n]*.3,t[n]=1+a[n]*.02+r[n]*.01}function V(e,t,n){let r=512/96,i=/* @__PURE__ */ new Float32Array(18432);for(let e=0;e<9216;e++)i[e*2]=n(),i[e*2+1]=n();let a=/* @__PURE__ */ new Float32Array(262144);R(a,n,[[64,64,.5],[128,128,.3]]);let o=/* @__PURE__ */ new Float32Array(262144);R(o,n,[[16,16,1],[32,32,.5]]);let s=/* @__PURE__ */ new Float32Array(262144);R(s,n,[[6,6,1],[12,12,.5]]);for(let n=0;n<512;n++)for(let c=0;c<512;c++){let l=o[n*512+c]*.45,u=c/r+l,d=n/r-l*.7,f=Math.floor(u),p=Math.floor(d),m=9,h=9,g=0;for(let e=-1;e<=1;e++)for(let t=-1;t<=1;t++){let n=f+t,r=p+e,a=(r%96+96)%96*96+(n%96+96)%96,o=n+i[a*2]*.8+.1,s=r+i[a*2+1]*.8+.1,c=Math.hypot(o-u,s-d);c<m?(h=m,m=c,g=a):c<h&&(h=c)}let _=I(0,.6,h-m)*(.6+.4*i[g*2]),v=n*512+c,y=1-I(0,.25,h-m),b=a[v];e[v]=_*.8+b*.2+s[v]*.25,t[v]=1-y*.08+b*.04+s[v]*.05}}function ye(e,t,n){R(e,n,[[3,512,1],[7,512,.6],[16,256,.35],[2,128,.25]]);let r=/* @__PURE__ */ new Float32Array(262144);R(r,n,[[4,4,.5],[8,8,.25]]);for(let n=0;n<e.length;n++)t[n]=1+e[n]*.05+r[n]*.04}function be(e,t,n){R(e,n,[[32,32,.35],[96,96,.3],[256,256,.3]]);let r=/* @__PURE__ */ new Float32Array(262144);R(r,n,[[6,6,.6],[14,14,.35]]);for(let e=0;e<t.length;e++)t[e]=1+r[e]*.06;for(let r=0;r<U;r++){let r=n()*512,i=n()*512,a=.5+n()**3*2.2,o=n()<.62?-(.18+n()*.35):.12+n()*.22,s=n()<.25?-.6:0;for(let n=-3;n<=3;n++)for(let c=-3;c<=3;c++){let l=Math.hypot(Math.round(r)+c-r,Math.round(i)+n-i),u=Math.min(1,Math.max(0,a+.5-l));if(u<=0)continue;let d=z(Math.round(r)+c,Math.round(i)+n);t[d]=t[d]+o*u,e[d]=e[d]+s*u}}}function H(e,t,n){let r=/* @__PURE__ */ new Float32Array(262144);R(r,n,[[4,6,1.6],[8,10,.8],[16,16,.3]]),R(e,n,[[128,128,.25],[256,256,.2]]);for(let n=0;n<e.length;n++)e[n]=e[n]+r[n]*2.2,t[n]=1+r[n]*.02;for(let r=0;r<W;r++){let r=Math.round(n()*512),i=Math.round(n()*512),a=.6+n()*1.3;for(let n=-2;n<=2;n++)for(let o=-2;o<=2;o++){let s=Math.min(1,Math.max(0,a+.5-Math.hypot(o,n))),c=z(r+o,i+n);e[c]=e[c]-s*.7,t[c]=t[c]-s*.05}}}const xe={paper:B,leather:V,metal:ye,stone:be,plaster:H},Se=1800,U=9e3,W=500,Ce=/* @__PURE__ */ new Map;function we(e){let t=Ce.get(e);if(t)return t;let n=/* @__PURE__ */ new Float32Array(262144),r=(/* @__PURE__ */ new Float32Array(262144)).fill(1);xe[e](n,r,ne(24301+e.length*7919));let i=0,a=0;for(let e of n)i+=e,a+=e*e;let o=i/n.length,s=Math.sqrt(Math.max(1e-9,a/n.length-o*o)),c=ge[e].relief/s,u=l.toHalfFloat,d=/* @__PURE__ */ new Uint16Array(1048576);for(let e=0;e<512;e++)for(let t=0;t<512;t++){let i=e*512+t,a=i*4,o=(n[z(t+1,e)]-n[z(t-1,e)])*.5*c,s=(n[z(t,e+1)]-n[z(t,e-1)])*.5*c;d[a]=u(Math.max(-8,Math.min(8,o))),d[a+1]=u(Math.max(-8,Math.min(8,s))),d[a+2]=u(Math.max(.3,Math.min(1.7,r[i]))),d[a+3]=u(0)}return Ce.set(e,d),d}function Te(e,t,n){let r=Math.max(.35,n);if(e===`emboss`||e===`stamp`)return I(-.45*r,1.05*r,t);if(e===`deboss`)return-I(-.25*r,.85*r,t);let i=Math.exp(-(((t+1.9*r)/r)**2));return-.62*I(-1.1*r,.1*r,t)+.035*i}function Ee(e,t,n){let[r,i,a,o,s]=n,c=Math.abs(e-(r+a/2))-(a/2-s),l=Math.abs(t-(i+o/2))-(o/2-s);return-(Math.hypot(Math.max(c,0),Math.max(l,0))+Math.min(Math.max(c,l),0)-s)}function De(e,t,n,i){let[a,o,s,c]=e.frame,u=Math.max(1,...e.quads.map(e=>e.em)),d=t===`stamp`&&s<(c+u*.6)*2.4,f=Math.ceil(t===`stamp`?d?Math.max(s-c,0)/2+u*.8:u*.8:u*.45)+4,p=Math.min(2,i,r/Math.max(s+2*f,c+2*f)),m=Math.max(1,Math.ceil((s+2*f)*p)),h=Math.max(1,Math.ceil((c+2*f)*p)),g=a-f,_=o-f,v=document.createElement(`canvas`);v.width=m,v.height=h;let S=e.canvas.width/Math.max(1e-6,s);v.getContext(`2d`)?.drawImage(e.canvas,f*p,f*p,e.canvas.width/S*p,e.canvas.height/S*p);let C=y(v,m,h),ee=b(C,m,h),te=[...e.quads].sort((e,t)=>e.y-t.y),re=new Float32Array(h);for(let e=0;e<h;e++){let t=_+(e+.5)/p,n=u,r=1/0;for(let e of te){let i=t<e.y?e.y-t:t>e.y+e.height?t-e.y-e.height:0;i<r&&(r=i,n=e.em)}re[e]=n}let w=[0,0,0,0,0],ie;if(t===`stamp`){let e=1/0,t=1/0,n=-1/0,r=-1/0;for(let i=0;i<h;i++)for(let a=0;a<m;a++)C[i*m+a]>.3&&(e=Math.min(e,a),n=Math.max(n,a+1),t=Math.min(t,i),r=Math.max(r,i+1));Number.isFinite(e)||([e,t,n,r]=[f*p,f*p,m-f*p,h-f*p]);let i=(n-e)/p+u*.72,a=(r-t)/p+u*.6,o=g+(e+n)/2/p,s=_+(t+r)/2/p;d&&(i=Math.max(i,a)+u*.2,a=i),w=[o-i/2,s-a/2,i,a,d?i/2:Math.min(a/2,i/2,u*.38)];let[c,l]=w,v=ve(9,9,ne(1441));ie=(e,t)=>L(v,(e-c)/Math.max(1,i)*512,(t-l)/Math.max(1,a)*512)}let ae=new Float32Array(m*h);for(let e=0;e<h;e++){let r=re[e],i=Math.max(0,n)*r*(t===`stamp`?1.6:1),a=_+(e+.5)/p;for(let n=0;n<m;n++){let o=e*m+n,s=Te(t,-ee[o]/p,i),c=s*r;if(t===`stamp`){let e=g+(n+.5)/p,t=Ee(e,a,w)+(ie?.(e,a)??0)*u*.035;c=(I(-.05*u,.07*u,t)*.32+Math.exp(-(((t-.12*u)/(.045*u))**2))*.6+s*.62)*u}ae[o]=c}}let oe=Math.max(0,n)*u*p,T=x(ae,m,h,Math.max(.5,oe*.12)),se=x(T,m,h,Math.max(1,u*.06*p)),E=new Uint16Array(m*h*4),D=0,O=l.toHalfFloat;for(let e=0;e<h;e++){let t=Math.max(0,e-1)*m,n=Math.min(h-1,e+1)*m,r=e*m;for(let e=0;e<m;e++){let i=r+e,a=r+Math.max(0,e-1),o=r+Math.min(m-1,e+1),s=i*4;E[s]=O((T[o]-T[a])*p/2),E[s+1]=O((T[n+e]-T[t+e])*p/2),E[s+2]=O(T[i]),D=Math.max(D,T[i]),E[s+3]=O(Math.max(0,se[i]-T[i]))}}return{data:E,width:m,height:h,frame:[g,_,m/p,h/p],em:u,pad:w,top:D}}const Oe=22,ke=.12,Ae=Math.PI/180,je=.42,Me=.75;function Ne(e,t){let n=getComputedStyle(t),r=e.trim();for(let e=0;e<8;e++){let e=/^var\(\s*(--[\w-]+)\s*(?:,\s*(.*))?\)$/is.exec(r);if(!e)break;r=n.getPropertyValue(e[1]).trim()||(e[2]??``).trim()}if(!r||r.toLowerCase()===`currentcolor`){let e=n.getPropertyValue(`-webkit-text-fill-color`);r=e&&!/^(transparent|rgba\(.*,\s*0\))$/.test(e)?e:n.color}return F(r)}function Pe(e){let t=getComputedStyle(e).backgroundColor??``;return S(t)>=.5?F(t):void 0}function Fe(e){for(let t=e.parentElement;t;t=t.parentElement){let e=Pe(t);if(e)return e}return`#ffffff`}function Ie(e,t,n,r,i){let a=Math.max(t,n,240),o=a*.55,s=e*Ae,c=Math.max(-o,Math.min(o,(i/2-r)*.45));return[Math.sin(s)*o,-Math.cos(s)*o+c,Math.min(700,Math.max(140,a*.45))]}function Le(e,t,n,r){let i=Math.max(n,r,240)*.9+160,a=Math.hypot(e,t);if(a<1e-6)return[0,0];let o=i*Math.tanh(a/i)/a;return[e*o,t*o]}function Re(e){let t=new p(e);return t.premultiplyAlpha=!0,t.colorSpace=u,t.generateMipmaps=!1,t.minFilter=m,t.magFilter=m,t}function ze(e,t,n,r){let i=new a(e,t,n,f,c);return i.minFilter=m,i.magFilter=m,i.generateMipmaps=!1,r&&(i.wrapS=s,i.wrapT=s),i.needsUpdate=!0,i}function Be(e,t){if(t)return e.canvas;let n=document.createElement(`canvas`);n.width=e.canvas.width,n.height=e.canvas.height;let r=n.getContext(`2d`);if(!r)return n;let i=e.canvas.width/Math.max(1e-6,e.frame[2]);for(let t of e.quads){if(t.em>=22)continue;let a=Math.max(0,Math.floor((t.y-e.frame[1])*i)),o=Math.min(n.height-a,Math.ceil(t.height*i)+1);o>0&&r.drawImage(e.canvas,0,a,n.width,o,0,a,n.width,o)}return n}function Ve(){let e=new v;return e.setIndex([0,2,1,2,3,1]),e.setAttribute(`position`,new _(new Float32Array([-.5,.5,0,.5,.5,0,-.5,-.5,0,.5,-.5,0]),3)),e}const He=/* @__PURE__ */ new WeakMap,Ue=ee({name:`emboss`,params:{style:C(`emboss`,`deboss`,`letterpress`,`stamp`),material:C(`paper`,`leather`,`metal`,`stone`,`plaster`),depth:.05,bevel:.03,light:315,follow:1,grain:1,color:``},on:`:not(img, video, canvas, svg, input, textarea)`,bleed:60,quality:{},animate:{fps:e=>He.get(e.signal)?.()??0},async setup(r){let{element:a,u:s,params:c,app:l,signal:u}=r,{stage:f}=l,p=r.quality===`low`?1:2,m=r.quality===`low`?8:16,_=i(a),v=(_===`text-shadow`?void 0:_)??await t(a),y=v?void 0:n(a,`line`,p);if(u.aborted)return;if(!y?.quads.length){v&&e&&l.log.warn(`emboss: ${v} cannot be drawn, the text stays as it is`,a),r.showDom(!0);return}let b=c.style,x=ge[c.material],S=c.color.trim(),C=S?Ne(S,a):void 0;S&&!C&&e&&l.log.warn(`emboss: "${S}" is not a color, left out`,a);let ee=getComputedStyle(a).backgroundImage;e&&ee&&ee!==`none`&&l.log.warn(`emboss: a background image is not drawn, only the background color`,a);let ne=b===`letterpress`||b===`stamp`||!!C,F=De(y,b,r.params.bevel,p),I=r.params.bevel,_e=()=>Pe(a),ve=_e(),L=N(new o(...y.frame)),R=N(new o(...F.frame)),z=N(new d(0,-400,400)),B=N(+!!ve),V=N(new h(ve??Fe(a))),ye=N(new h(C??Ne(``,a)??`#222222`)),be=N(+!!C),H=N(F.em),xe=N(F.top),Se=N(1),U=s.size.mul(.5),W=w(U.x.add(z.x),U.y.add(z.y),z.z),Ce=O(A(R.x,0),D(0),B),Te=O(A(R.y,0),D(0),B),Ee=O(M(R.x.add(R.z),s.size.x),s.size.x,B),Oe=O(M(R.y.add(R.w),s.size.y),s.size.y,B),Ae=ie.xy.add(.5),Ue=Ce.add(Ae.x.mul(Ee.sub(Ce))),We=Te.add(Ae.y.oneMinus().mul(Oe.sub(Te))),Ge=new he({transparent:!0,depthTest:!1,depthWrite:!1});Ge.positionNode=w(Ue.sub(U.x),U.y.sub(We),0);let G=ae(j(Ue,We)),Ke=ze(F.data,F.width,F.height,!1),qe=ze(we(c.material),512,512,!0),Je=Re(Be(y,ne)),Ye=[],Xe=e=>{let t=ce(Ke,j(e.x.sub(R.x).div(R.z),e.y.sub(R.y).div(R.w)));return Ye.push(t),t},K=Xe(G),q=M(s.depth,0),Ze=K.z.mul(q),Qe=ce(qe,G.div(512)),$e=ce(qe,G.div(2406.4).add(j(.37,.61))),J=ce(Je,j(G.x.sub(L.x).div(L.z),G.y.sub(L.y).div(L.w).oneMinus())),et=K.z.div(H),tt=de(.08,.5,et.negate()),nt=b===`stamp`?de(.1,.26,et):D(0),rt=k(pe(j(K.x,K.y)).mul(q),0,2),it=O(k(J.a.mul(.6).add(nt.mul(.3)),0,1),D(1),B),Y=k(s.grain,0,3).mul(tt.mul(.45).oneMinus(),it);b===`letterpress`&&(Y=Y.mul(rt.mul(.8).add(1))),b===`stamp`&&(Y=Y.mul(O(1,.12,nt)));let at=K.x.mul(q).add(Qe.x.mul(Y)),ot=K.y.mul(q).add(Qe.y.mul(Y)),st=P(w(at.negate(),ot,1)),ct=w(W.x.sub(G.x),G.y.sub(W.y),W.z.sub(Ze)),lt=P(ct),ut=x.wrap,dt=k(ue(st,lt).add(ut).div(1+ut),0,1),ft=P(w(W.x.sub(G.x),G.y.sub(W.y),W.z)),pt=k(ft.z.add(ut).div(1+ut),0,1),mt=j(W.x.sub(G.x),W.y.sub(G.y)),ht=M(pe(mt),.001),gt=mt.div(ht),_t=W.z.sub(Ze).div(ht),vt=A(A(ht,H.mul(.7)),M(xe.mul(q).sub(Ze),0).div(M(_t,.001)).add(.5)),yt=se(se(T.x.mul(.06711056).add(T.y.mul(.00583715))).mul(52.9829189)),bt=D(0);for(let e=0;e<m;e++){let t=vt.mul(E(D(e+1).sub(yt).div(m),1.5)),n=Xe(G.add(gt.mul(t))).z.mul(q).sub(Ze.add(_t.mul(t)));bt=M(bt,de(0,t.mul(.16).add(.35),n))}let xt=bt.mul(.88).oneMinus(),St=k(K.w.mul(q).div(H.mul(.03)),0,1).mul(.4).oneMinus(),Ct=P(fe.sub(oe)),wt=P(lt.add(Ct)),Tt=M(ue(st,wt),0),Et=de(0,.15,ue(st,lt)),X;if(x.metal){let e=P(w(1,0,0).sub(st.mul(st.x))),t=ue(e,wt);X=E(me(M(t.mul(t).oneMinus(),0)),x.shine).mul(x.spec).add(E(Tt,20).mul(.08))}else X=E(Tt,x.shine).mul(x.spec);b===`stamp`&&(X=O(X,E(Tt,70).mul(.6).add(E(Tt,9).mul(.07)),nt)),X=X.mul(xt,Et);let Dt=P(ft.add(Ct)),Ot=x.metal?D(0):E(M(Dt.z,0),x.shine).mul(x.spec),kt=Qe.z.sub(1).add($e.z.sub(1).mul(.6)).mul(k(s.grain,0,3)).add(1),At=O(V,E(V,w(1.3)),x.tint),jt=O(V,At.mul(x.pressed),tt).mul(kt),Mt=J.a,Nt=J.rgb.div(M(Mt,.001)),Pt=O(Nt,ye,be),Ft=b===`letterpress`?k(Qe.z.sub(1).mul(1.5).add(.97).add(rt.mul(.05)),0,1):D(1),It=b===`stamp`?nt:Mt.mul(Ft),Lt=b===`stamp`?ye.mul(O(.9,1.06,$e.z)):Pt.mul(O(1,Qe.z,.4)),Rt=O(jt,Lt,It),zt=D(je).mul(St).add(dt.mul(Me,xt,O(1,St,.5))).mul(Se,x.metal?.85:1),Bt=D(je).add(pt.mul(Me)).mul(Se),Vt=O(w(1),V.div(M(V.x,M(V.y,V.z)).max(.05)),x.tint),Ht=Rt.mul(zt).add(Vt.mul(X)),Ut=zt.div(M(Bt,.001)),Wt=A(Ut,1),Gt=k(Ut.sub(1).mul(1.2),0,.7).add(M(X.sub(Ot),0)).clamp(0,1),Kt=Wt.mul(Gt.oneMinus()),qt=D(1).sub(It.oneMinus().mul(Kt)),Jt=Lt.mul(It,Kt).add(Gt).div(M(qt,1e-4)),Yt=j(G.x.div(s.size.x),G.y.div(s.size.y).oneMinus()),Xt=j(.5,.5).div(M(s.size,j(1,1))),Zt=r.mask(k(Yt,Xt,Xt.oneMinus()));Ge.colorNode=le(O(Jt,Ht,B).add(re()),O(qt,D(1),B).clamp(0,1).mul(Zt));let Qt=new g(Ve(),Ge);if(Qt.frustumCulled=!1,r.onDispose(()=>{(Ye[0]?.value)?.dispose(),qe.dispose(),J.value.dispose()}),r.place(Qt,{fit:`none`,replace:!0}),await r.compile(Qt),u.aborted)return;let $t=(e,t)=>{let n=Ye[0]?.value,i=ze(t.data,t.width,t.height,!1);for(let e of Ye)e.value=i;n?.dispose();let o=J.value;J.value=Re(Be(e,ne)),o.dispose(),L.value.set(...e.frame),R.value.set(...t.frame),H.value=t.em,xe.value=t.top;let s=_e();B.value=+!!s,V.value.set(s??Fe(a)),C||ye.value.set(Ne(``,a)??`#222222`),y=e,r.invalidate()},en,tn=async()=>{if(en=void 0,await t(a)||u.aborted)return;let e=n(a,`line`,p);e?.quads.length&&(I=r.params.bevel,$t(e,De(e,b,I,p)))},nn=()=>{clearTimeout(en),en=setTimeout(()=>void tn(),150)};r.onDispose(()=>clearTimeout(en));let rn=new MutationObserver(nn);rn.observe(a,{characterData:!0,childList:!0,subtree:!0}),r.onDispose(()=>rn.disconnect());let an=new ResizeObserver(()=>{let e=a.getBoundingClientRect().width;Math.abs(e-(y?.width??e))>.5&&nn()});an.observe(a),r.onDispose(()=>an.disconnect()),document.fonts?.addEventListener(`loadingdone`,nn,{signal:u});let Z,on=e=>{e.pointerType!==`touch`&&(Z={x:e.clientX,y:e.clientY},r.params.follow>0&&!f.reducedMotion.peek()&&r.invalidate())},sn=()=>{Z&&(Z=void 0,r.invalidate())};addEventListener(`pointermove`,on,{passive:!0,signal:u}),document.documentElement.addEventListener(`pointerleave`,sn,{signal:u}),addEventListener(`blur`,sn,{signal:u});let cn=0;He.set(u,()=>cn);let Q=0,$=0,ln=!1;return e=>{let t=r.params;Math.abs(t.bevel-I)>.001&&!en&&(I=t.bevel,nn());let n=e.reducedMotion,i=Math.min(e.delta,.1),a=e.width,o=e.height,s=f.height.peek()||o,c=e.y+o/2,[l,u,d]=Ie(t.light,a,o,n?s/2:c,s),p=l,m=u,h=n?0:Math.min(1,Math.max(0,t.follow));if(h>0&&Z){let[t,n]=Le(Z.x-(e.x+a/2),Z.y-c,a,o);p+=(t-l)*h,m+=(n-u)*h}!ln||n?(Q=p,$=m,ln=!0):(Q=te(Q,p,ke,i),$=te($,m,ke,i));let g=Math.abs(Q-p)>.5||Math.abs($-m)>.5;g||(Q=p,$=m),z.value.set(Q,$,d);let[_,v]=Ie(t.light,a,o,s/2,s),y=d/Math.hypot(_,v,d);Se.value=1/(je+Me*Math.min(1,(y+x.wrap)/(1+x.wrap))),cn=g?60:0}}});export{Oe as SMALL,Pe as backgroundOf,Ue as default,Le as reachOf,Ie as rest};
|