@apple-pie/slice 0.1.51 → 0.1.53
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/cjs/chunks/{AudioBubble-CWG0JYyG.js → AudioBubble-BSceAgq8.js} +4 -4
- package/dist/cjs/chunks/{Avatar-DyIIYHth.js → Avatar-LhoIzZYs.js} +2 -2
- package/dist/cjs/chunks/{AvatarGroup--zAf-dNr.js → AvatarGroup-6rYDbrq0.js} +3 -3
- package/dist/cjs/chunks/{Badge-Ca3fUHzW.js → Badge-DNzsgQk9.js} +1 -1
- package/dist/cjs/chunks/{Button-Cep3SqsR.js → Button-GrPLJIBP.js} +6 -5
- package/dist/cjs/chunks/{ButtonBar-CDoTe2KT.js → ButtonBar-Df0iGtC3.js} +2 -2
- package/dist/cjs/chunks/{Camera-BilzVJC-.js → Camera-BN2emgEV.js} +6 -6
- package/dist/cjs/chunks/{CheckBox-DlRmdo4F.js → CheckBox-DOTWw9VH.js} +1 -1
- package/dist/cjs/chunks/{Chip-Bcn3P9vI.js → Chip-BjzBZU6j.js} +4 -3
- package/dist/cjs/chunks/{DivInput-CPoU2IlK.js → DivInput-DXpi201k.js} +5 -5
- package/dist/cjs/chunks/{Dot-W1TQ5vfI.js → Dot-nWPzJqlj.js} +1 -1
- package/dist/cjs/chunks/{DrggablePanel--LSNphoy.js → DrggablePanel-Bi4cmUh5.js} +20 -16
- package/dist/cjs/chunks/{DropDown-AUxguryP.js → DropDown-K6xOYkfl.js} +5 -4
- package/dist/cjs/chunks/{ErrorSummary-D-eB1h3-.js → ErrorSummary-pWO_o2MN.js} +7 -6
- package/dist/cjs/chunks/{FileIcon-D7hcykwe.js → FileIcon-BXmM4L3A.js} +4 -4
- package/dist/cjs/chunks/{FileList-CBGZ8PsW.js → FileList-NDj9e_To.js} +3 -3
- package/dist/cjs/chunks/{FlexDiv-DsN5tGEG.js → FlexDiv-Dfp6NfR-.js} +1 -1
- package/dist/cjs/chunks/{Grouper-DzGrJo5i.js → Grouper-DJP2JXUi.js} +5 -5
- package/dist/cjs/chunks/{Icon-NDphOLR6.js → Icon-VcvTUkMA.js} +4 -4
- package/dist/cjs/chunks/{IconButton-DFk-yVc6.js → IconButton-Cz7iTVhO.js} +3 -3
- package/dist/cjs/chunks/{IndexedDB-CpCbUa22.js → IndexedDB-D7TVb0pF.js} +8 -4
- package/dist/cjs/chunks/{Label-DkUq49nx.js → Label-E7350HYG.js} +4 -3
- package/dist/cjs/chunks/{Level-MO3XuoBp.js → Level-ZmAb4JQ9.js} +3 -3
- package/dist/cjs/chunks/{Modal-o7KtPH6D.js → Modal-BKZ9fgWF.js} +5 -4
- package/dist/cjs/chunks/{ModalController-Bh4HjLKC.js → ModalController-CCcRXYUs.js} +3 -3
- package/dist/cjs/chunks/{Overlay-CxVrTI2z.js → Overlay-B0jNgBu3.js} +2 -2
- package/dist/cjs/chunks/{Pager-DkpPXtWt.js → Pager-CwOhw4nE.js} +1 -1
- package/dist/cjs/chunks/{ProgressIndicator-a4uthp1C.js → ProgressIndicator--Ph78ZSe.js} +4 -4
- package/dist/cjs/chunks/{PromptInput-DJ3sMLAK.js → PromptInput-8TqoRRtq.js} +16 -10
- package/dist/cjs/chunks/{RadioButton-J0dfBuuZ.js → RadioButton-oZxMZCpd.js} +1 -1
- package/dist/cjs/chunks/{RadioButtonList-CovzfXBb.js → RadioButtonList-C0zngoe4.js} +1 -1
- package/dist/cjs/chunks/{Slider-CLQ0GSie.js → Slider-BfiaN55A.js} +4 -4
- package/dist/cjs/chunks/{Spacer-hd4zs1jA.js → Spacer-D9SULpcV.js} +1 -1
- package/dist/cjs/chunks/{Switch-Bk0OdvjZ.js → Switch-Bax_lPw4.js} +2 -2
- package/dist/cjs/chunks/{TabBar-DqkCgnSR.js → TabBar-C9NycMo8.js} +18 -18
- package/dist/cjs/chunks/{TextArea-BCeor0hV.js → TextArea-BSo1K02e.js} +5 -5
- package/dist/cjs/chunks/{TextField-CtbfTAmK.js → TextField-TpzwNrB3.js} +13 -8
- package/dist/cjs/chunks/{Tip-D7gtWmNi.js → Tip-CtobkAG3.js} +6 -5
- package/dist/cjs/chunks/{Toast-D3Hd0AMU.js → Toast-BRvp6HeI.js} +10 -8
- package/dist/cjs/chunks/{ToggleButton-DnDRKdTq.js → ToggleButton-BGsKt1uz.js} +5 -5
- package/dist/cjs/chunks/{UploadArea-BHTAfz-P.js → UploadArea-BVIOxAk0.js} +8 -7
- package/dist/cjs/chunks/{Video-B7bisMIA.js → Video-B9BWFeiN.js} +15 -15
- package/dist/cjs/chunks/{VideoController-QMAJKhPH.js → VideoController-D5J76aQJ.js} +8 -8
- package/dist/cjs/chunks/{WSConnection-BAltqes7.js → WSConnection-BrwlAScO.js} +1 -1
- package/dist/cjs/chunks/{WebRTCConnection-dL2SK3_2.js → WebRTCConnection-nx-EhtdY.js} +1 -1
- package/dist/cjs/chunks/{browserChannelsStore-BTPpbDRA.js → browserChannelsStore-C8C4qb7h.js} +2 -2
- package/dist/cjs/chunks/{localDBStore-C3NUtnhe.js → localDBStore-DhruyXfz.js} +2 -2
- package/dist/cjs/chunks/magic-string.es-DXiBW6ft.js +724 -0
- package/dist/cjs/chunks/{microphoneStore-Ds2J_e1I.js → microphoneStore-axA5TgKM.js} +1 -1
- package/dist/cjs/chunks/{misc-LAaHE64b.js → misc-B2oK3rIL.js} +1 -1
- package/dist/cjs/chunks/{sseStore-DPzXXIbg.js → sseStore-DaJgRKej.js} +3 -3
- package/dist/cjs/chunks/{uploads-worker-BpfjZ_xT.js → uploads-worker-B_12HqmC.js} +1 -1
- package/dist/cjs/chunks/{uploadsStore-Dek7g7dl.js → uploadsStore-hFHe0RDh.js} +2 -2
- package/dist/cjs/chunks/{viewState--I3LaDpn.js → viewState-BzvJJA68.js} +7 -7
- package/dist/cjs/chunks/{volumeStore-DbLg_-L9.js → volumeStore-D64ziNWo.js} +1 -1
- package/dist/cjs/chunks/{webRTCStore-B-ZZdCuw.js → webRTCStore-XciamNCa.js} +2 -2
- package/dist/cjs/chunks/{windowStore-CjjP9E2z.js → windowStore-DRgyVg9e.js} +1 -1
- package/dist/cjs/components/AudioBubble/index.js +6 -6
- package/dist/cjs/components/Avatar/index.js +3 -3
- package/dist/cjs/components/AvatarGroup/index.js +3 -3
- package/dist/cjs/components/Badge/index.js +2 -2
- package/dist/cjs/components/Button/index.js +12 -12
- package/dist/cjs/components/ButtonBar/index.js +9 -9
- package/dist/cjs/components/Camera/index.js +8 -8
- package/dist/cjs/components/CheckBox/index.js +6 -6
- package/dist/cjs/components/Chip/index.js +9 -10
- package/dist/cjs/components/DataTable/index.js +13 -14
- package/dist/cjs/components/DivInput/index.js +4 -3
- package/dist/cjs/components/Dot/index.js +2 -2
- package/dist/cjs/components/DraggablePanel/index.js +6 -6
- package/dist/cjs/components/DropDown/index.js +9 -9
- package/dist/cjs/components/ErrorSummary/index.js +6 -6
- package/dist/cjs/components/FileIcon/index.js +6 -6
- package/dist/cjs/components/FileList/index.js +7 -7
- package/dist/cjs/components/FlexDiv/index.js +2 -2
- package/dist/cjs/components/Grouper/index.js +7 -7
- package/dist/cjs/components/Icon/index.js +6 -6
- package/dist/cjs/components/IconButton/index.js +12 -11
- package/dist/cjs/components/Label/index.js +4 -3
- package/dist/cjs/components/Level/index.js +4 -4
- package/dist/cjs/components/Modal/index.js +12 -13
- package/dist/cjs/components/ModalController/index.js +6 -6
- package/dist/cjs/components/Overlay/index.js +2 -2
- package/dist/cjs/components/Pager/index.js +3 -3
- package/dist/cjs/components/Progress/index.js +6 -6
- package/dist/cjs/components/PromptInput/index.js +10 -10
- package/dist/cjs/components/RadioButton/index.js +6 -6
- package/dist/cjs/components/RadioButtonList/index.js +7 -7
- package/dist/cjs/components/Slider/index.js +6 -6
- package/dist/cjs/components/Spacer/index.js +2 -2
- package/dist/cjs/components/Switch/index.js +2 -2
- package/dist/cjs/components/TabBar/index.js +9 -9
- package/dist/cjs/components/TextArea/index.js +12 -13
- package/dist/cjs/components/Textfield/index.js +10 -10
- package/dist/cjs/components/Tip/index.js +4 -3
- package/dist/cjs/components/Toast/index.js +7 -7
- package/dist/cjs/components/ToggleButton/index.js +12 -13
- package/dist/cjs/components/UploadArea/index.js +12 -11
- package/dist/cjs/components/Video/index.js +15 -14
- package/dist/cjs/components/VideoController/index.js +13 -13
- package/dist/cjs/hooks/useAudioRecorder.js +1 -1
- package/dist/cjs/hooks/useBindWebRTC.js +2 -2
- package/dist/cjs/hooks/useClipboard.js +2 -2
- package/dist/cjs/hooks/useMdStreamBuffer.js +2 -2
- package/dist/cjs/hooks/useMicrophone.js +1 -1
- package/dist/cjs/hooks/useTrackRenders.js +2 -2
- package/dist/cjs/hooks.js +4 -4
- package/dist/cjs/index.js +10 -10
- package/dist/cjs/providers/themeServer.test.js +10574 -0
- package/dist/cjs/stores/LocalDB.js +3 -3
- package/dist/cjs/stores/SSE.js +3 -3
- package/dist/cjs/stores/WS.js +3 -3
- package/dist/cjs/stores/WebRTC.js +3 -3
- package/dist/cjs/stores/browserChannel.js +2 -2
- package/dist/cjs/stores/microphone.js +2 -2
- package/dist/cjs/stores/modal.js +1 -1
- package/dist/cjs/stores/tip.js +1 -1
- package/dist/cjs/stores/toast.js +1 -1
- package/dist/cjs/stores/uploads.js +2 -2
- package/dist/cjs/stores/video.js +1 -1
- package/dist/cjs/stores/volume.js +2 -2
- package/dist/cjs/stores/window.js +2 -2
- package/dist/cjs/stores.js +5 -5
- package/dist/cjs/theme/corners.js +8 -8
- package/dist/cjs/theme/type.js +5 -5
- package/dist/cjs/utils/index.js +2 -2
- package/dist/cjs/utils/objects/index.js +2 -2
- package/dist/cjs/workers/uploads/uploads.js +2 -2
- package/dist/css/type.module.css +10 -10
- package/dist/esm/chunks/{AudioBubble-DFYw0nQU.mjs → AudioBubble-CdmLKDhc.mjs} +7 -7
- package/dist/esm/chunks/{Avatar-EkYvqFJa.mjs → Avatar-CblCPiom.mjs} +3 -3
- package/dist/esm/chunks/{AvatarGroup-B8EnFBX3.mjs → AvatarGroup-DgNd60cP.mjs} +4 -4
- package/dist/esm/chunks/{Badge-C6kNwu4r.mjs → Badge-DIru-w6O.mjs} +1 -1
- package/dist/esm/chunks/{Button-Bvgo8DRW.mjs → Button-BYALDfuE.mjs} +13 -10
- package/dist/esm/chunks/{ButtonBar-CqXWLImb.mjs → ButtonBar-DUDK-0Y4.mjs} +6 -4
- package/dist/esm/chunks/{Camera-9gSj5JCt.mjs → Camera-BOgxXxRV.mjs} +10 -10
- package/dist/esm/chunks/{CheckBox-BxI_tTid.mjs → CheckBox-xLveo-Lt.mjs} +3 -3
- package/dist/esm/chunks/{Chip-Cy_9aGFx.mjs → Chip-COWEFzyh.mjs} +9 -6
- package/dist/esm/chunks/{DivInput-C1kmP54k.mjs → DivInput-faLHJ1b9.mjs} +8 -6
- package/dist/esm/chunks/{Dot-m6fw22Z0.mjs → Dot-CWVfujdC.mjs} +1 -1
- package/dist/esm/chunks/{DrggablePanel-C73eGSsp.mjs → DrggablePanel-DCA9LeNq.mjs} +22 -18
- package/dist/esm/chunks/{DropDown-BczM9aTO.mjs → DropDown-C9fS9E6c.mjs} +9 -6
- package/dist/esm/chunks/{ErrorSummary-Co3vVXxA.mjs → ErrorSummary-D1WbASIx.mjs} +9 -8
- package/dist/esm/chunks/{FileIcon-SKFp6-Eh.mjs → FileIcon-CBNQckHc.mjs} +6 -6
- package/dist/esm/chunks/{FileList-Dt5V9YPs.mjs → FileList-CK96tECm.mjs} +7 -7
- package/dist/esm/chunks/{FlexDiv-BoxzmKqk.mjs → FlexDiv-Cglvd-xT.mjs} +1 -1
- package/dist/esm/chunks/{Grouper-Do8rpPZb.mjs → Grouper-CivlTYk2.mjs} +7 -7
- package/dist/esm/chunks/{Icon-BMT9cn9A.mjs → Icon-CGqm8lg7.mjs} +6 -6
- package/dist/esm/chunks/{IconButton-DEcW36kF.mjs → IconButton-LsCK8HUU.mjs} +9 -7
- package/dist/esm/chunks/{IndexedDB-BvJLLZU8.mjs → IndexedDB-DNFNyOit.mjs} +8 -4
- package/dist/esm/chunks/{Label-Etcumudw.mjs → Label-CFUlmEKM.mjs} +7 -4
- package/dist/esm/chunks/{Level-C2rSTZAQ.mjs → Level-CAZN_Xt7.mjs} +7 -5
- package/dist/esm/chunks/{Modal-C1g7ceSt.mjs → Modal-DAU9VnrP.mjs} +11 -8
- package/dist/esm/chunks/{ModalController-CkPCQeYU.mjs → ModalController-axF12LqY.mjs} +5 -5
- package/dist/esm/chunks/{Overlay-CZxlviV2.mjs → Overlay-CYvVXNU5.mjs} +2 -2
- package/dist/esm/chunks/{Pager-aLZXhX_w.mjs → Pager-BvFWzAok.mjs} +2 -2
- package/dist/esm/chunks/{ProgressIndicator-CGbLu2wM.mjs → ProgressIndicator-CNTW0t8s.mjs} +6 -6
- package/dist/esm/chunks/{PromptInput-rsGyHTJb.mjs → PromptInput-PJIXJMCp.mjs} +17 -13
- package/dist/esm/chunks/{RadioButton-DPKvT5yo.mjs → RadioButton-DipoEV9R.mjs} +3 -3
- package/dist/esm/chunks/{RadioButtonList-Brl_h2Nx.mjs → RadioButtonList-CDysnTjd.mjs} +3 -3
- package/dist/esm/chunks/{Slider-BJ9mifdr.mjs → Slider-BzX_jQ27.mjs} +7 -7
- package/dist/esm/chunks/{Spacer-pZIEZfkL.mjs → Spacer-DJKkJpdX.mjs} +1 -1
- package/dist/esm/chunks/{Switch-Cbl6iesb.mjs → Switch-C8FXGMlJ.mjs} +2 -2
- package/dist/esm/chunks/{TabBar-b8Dqmz0l.mjs → TabBar-B_pwLZcy.mjs} +23 -23
- package/dist/esm/chunks/{TextArea-Ml2KuVpk.mjs → TextArea-BbveliHo.mjs} +8 -6
- package/dist/esm/chunks/{TextField-BS3bOQj-.mjs → TextField-D-680Ah3.mjs} +14 -11
- package/dist/esm/chunks/{Tip-BrBts6HZ.mjs → Tip-IdoSsqpu.mjs} +9 -6
- package/dist/esm/chunks/{Toast-BL0jO3nb.mjs → Toast-DNN0M8ds.mjs} +13 -11
- package/dist/esm/chunks/{ToggleButton-dZPHYzZH.mjs → ToggleButton-BhRGIiQz.mjs} +6 -6
- package/dist/esm/chunks/{UploadArea-voCl4jpT.mjs → UploadArea-BFEjUf7n.mjs} +13 -10
- package/dist/esm/chunks/{Video-CRBP0r2b.mjs → Video-DBF6un3N.mjs} +19 -19
- package/dist/esm/chunks/{VideoController-kYO0CqYG.mjs → VideoController-lNXxiYAp.mjs} +14 -12
- package/dist/esm/chunks/{WSConnection-e7-nSYVD.mjs → WSConnection-Bd3_THiB.mjs} +1 -1
- package/dist/esm/chunks/{WebRTCConnection-DtIhWGrY.mjs → WebRTCConnection-DvF2ENaH.mjs} +1 -1
- package/dist/esm/chunks/{browserChannelsStore-DGDANcLP.mjs → browserChannelsStore-Dkg2yF-s.mjs} +2 -2
- package/dist/esm/chunks/{localDBStore-DwusxhIq.mjs → localDBStore-DmM1xv6W.mjs} +3 -3
- package/dist/esm/chunks/magic-string.es-w54Wbyiz.mjs +722 -0
- package/dist/esm/chunks/{microphoneStore-CDNQZJzG.mjs → microphoneStore-B9HEjn8x.mjs} +1 -1
- package/dist/esm/chunks/{misc-CV0SS-jF.mjs → misc-O5ZSVDP0.mjs} +1 -1
- package/dist/esm/chunks/{sseStore-BaLy2MK1.mjs → sseStore-CWOB35p7.mjs} +3 -3
- package/dist/esm/chunks/{uploads-worker-F-je70Dd.mjs → uploads-worker-C4I-bc63.mjs} +1 -1
- package/dist/esm/chunks/{uploadsStore-CPylq__a.mjs → uploadsStore-Bx9nAcin.mjs} +1 -1
- package/dist/esm/chunks/{viewState-CAAi7sd6.mjs → viewState-Dv3Y_pc4.mjs} +12 -10
- package/dist/esm/chunks/{volumeStore-C-rKyxRG.mjs → volumeStore-C2AnBA5B.mjs} +1 -1
- package/dist/esm/chunks/{webRTCStore-B2GPjQX6.mjs → webRTCStore-fNJiXwLR.mjs} +3 -3
- package/dist/esm/chunks/{windowStore-NdbQt4lG.mjs → windowStore-CYsBH-_Y.mjs} +1 -1
- package/dist/esm/components/AudioBubble/index.mjs +9 -9
- package/dist/esm/components/Avatar/index.mjs +3 -3
- package/dist/esm/components/AvatarGroup/index.mjs +4 -4
- package/dist/esm/components/Badge/index.mjs +2 -2
- package/dist/esm/components/Button/index.mjs +15 -15
- package/dist/esm/components/ButtonBar/index.mjs +11 -11
- package/dist/esm/components/Camera/index.mjs +11 -11
- package/dist/esm/components/CheckBox/index.mjs +9 -9
- package/dist/esm/components/Chip/index.mjs +12 -12
- package/dist/esm/components/DataTable/index.mjs +12 -12
- package/dist/esm/components/DivInput/index.mjs +5 -3
- package/dist/esm/components/Dot/index.mjs +2 -2
- package/dist/esm/components/DraggablePanel/index.mjs +8 -8
- package/dist/esm/components/DropDown/index.mjs +11 -11
- package/dist/esm/components/ErrorSummary/index.mjs +8 -8
- package/dist/esm/components/FileIcon/index.mjs +8 -8
- package/dist/esm/components/FileList/index.mjs +11 -11
- package/dist/esm/components/FlexDiv/index.mjs +2 -2
- package/dist/esm/components/Grouper/index.mjs +10 -10
- package/dist/esm/components/Icon/index.mjs +9 -9
- package/dist/esm/components/IconButton/index.mjs +14 -14
- package/dist/esm/components/Label/index.mjs +5 -3
- package/dist/esm/components/Level/index.mjs +7 -5
- package/dist/esm/components/Modal/index.mjs +17 -17
- package/dist/esm/components/ModalController/index.mjs +9 -9
- package/dist/esm/components/Overlay/index.mjs +2 -2
- package/dist/esm/components/Pager/index.mjs +3 -3
- package/dist/esm/components/Progress/index.mjs +9 -9
- package/dist/esm/components/PromptInput/index.mjs +16 -16
- package/dist/esm/components/RadioButton/index.mjs +9 -9
- package/dist/esm/components/RadioButtonList/index.mjs +10 -10
- package/dist/esm/components/Slider/index.mjs +9 -9
- package/dist/esm/components/Spacer/index.mjs +2 -2
- package/dist/esm/components/Switch/index.mjs +2 -2
- package/dist/esm/components/TabBar/index.mjs +13 -13
- package/dist/esm/components/TextArea/index.mjs +16 -16
- package/dist/esm/components/Textfield/index.mjs +15 -15
- package/dist/esm/components/Tip/index.mjs +5 -3
- package/dist/esm/components/Toast/index.mjs +10 -10
- package/dist/esm/components/ToggleButton/index.mjs +16 -16
- package/dist/esm/components/UploadArea/index.mjs +15 -15
- package/dist/esm/components/Video/index.mjs +19 -19
- package/dist/esm/components/VideoController/index.mjs +17 -17
- package/dist/esm/hooks/useAudioRecorder.mjs +1 -1
- package/dist/esm/hooks/useBindWebRTC.mjs +6 -6
- package/dist/esm/hooks/useClipboard.mjs +3 -3
- package/dist/esm/hooks/useMdStreamBuffer.mjs +3 -3
- package/dist/esm/hooks/useMicrophone.mjs +1 -1
- package/dist/esm/hooks/useTrackRenders.mjs +2 -2
- package/dist/esm/hooks.mjs +8 -8
- package/dist/esm/index.mjs +59 -59
- package/dist/esm/providers/themeServer.test.mjs +10572 -0
- package/dist/esm/stores/LocalDB.mjs +4 -4
- package/dist/esm/stores/SSE.mjs +4 -4
- package/dist/esm/stores/WS.mjs +3 -3
- package/dist/esm/stores/WebRTC.mjs +4 -4
- package/dist/esm/stores/browserChannel.mjs +3 -3
- package/dist/esm/stores/microphone.mjs +2 -2
- package/dist/esm/stores/modal.mjs +1 -1
- package/dist/esm/stores/tip.mjs +1 -1
- package/dist/esm/stores/toast.mjs +1 -1
- package/dist/esm/stores/uploads.mjs +3 -3
- package/dist/esm/stores/video.mjs +1 -1
- package/dist/esm/stores/volume.mjs +2 -2
- package/dist/esm/stores/window.mjs +2 -2
- package/dist/esm/stores.mjs +18 -18
- package/dist/esm/theme/corners.mjs +8 -8
- package/dist/esm/theme/type.mjs +5 -5
- package/dist/esm/utils/index.mjs +12 -12
- package/dist/esm/utils/objects/index.mjs +8 -8
- package/dist/esm/workers/uploads/uploads.mjs +2 -2
- package/dist/styles.css +2400 -2349
- package/dist/types/components/Avatar/_types.d.ts +0 -1
- package/dist/types/components/AvatarGroup/_types.d.ts +0 -1
- package/dist/types/components/Button/Button.d.ts +2 -6
- package/dist/types/components/Button/_types.d.ts +1 -3
- package/dist/types/components/ButtonBar/_types.d.ts +0 -3
- package/dist/types/components/Chip/_types.d.ts +1 -3
- package/dist/types/components/DataTable/_types.d.ts +2 -2
- package/dist/types/components/DataTable/_useResizeColumn.test.d.ts +1 -0
- package/dist/types/components/DataTable/columnHelper.test.d.ts +1 -0
- package/dist/types/components/DivInput/_types.d.ts +0 -1
- package/dist/types/components/DraggablePanel/DrggablePanel.d.ts +13 -1
- package/dist/types/components/DropDown/_types.d.ts +1 -2
- package/dist/types/components/ErrorSummary/_types.d.ts +1 -2
- package/dist/types/components/FileList/_types.d.ts +1 -2
- package/dist/types/components/Icon/iconRegistry.test.d.ts +1 -0
- package/dist/types/components/IconButton/_animation.test.d.ts +1 -0
- package/dist/types/components/IconButton/_types.d.ts +3 -3
- package/dist/types/components/Label/_types.d.ts +1 -2
- package/dist/types/components/Modal/_types.d.ts +2 -2
- package/dist/types/components/PromptInput/PromptInput.d.ts +2 -2
- package/dist/types/components/PromptInput/_types.d.ts +1 -1
- package/dist/types/components/Switch/_types.d.ts +0 -2
- package/dist/types/components/TabBar/_types.d.ts +5 -6
- package/dist/types/components/TextArea/_types.d.ts +1 -2
- package/dist/types/components/Textfield/_types.d.ts +2 -2
- package/dist/types/components/Tip/_types.d.ts +1 -2
- package/dist/types/components/Toast/_types.d.ts +1 -1
- package/dist/types/components/ToggleButton/_types.d.ts +4 -4
- package/dist/types/components/UploadArea/UploadArea.d.ts +2 -6
- package/dist/types/components/UploadArea/_types.d.ts +1 -3
- package/dist/types/components/playHelpers.d.ts +353 -0
- package/dist/types/hooks/useBindWebRTC/useBindWebRTC.test.d.ts +1 -0
- package/dist/types/hooks/useTrackRenders/useTrackRenders.test.d.ts +1 -0
- package/dist/types/providers/themeServer.test.d.ts +1 -0
- package/dist/types/stores/LocalDB/localDBStore.test.d.ts +1 -0
- package/dist/types/theme/corners/types.d.ts +8 -8
- package/dist/types/utils/objects/IndexedDB/IndexedDB.d.ts +3 -0
- package/dist/types/utils/objects/IndexedDB/IndexedDB.test.d.ts +1 -0
- package/dist/types/utils/objects/MDStreamBuffer/MdStreamBuffer.test.d.ts +1 -0
- package/dist/types/utils/objects/WebRTCConnection/WebRTCConnection.test.d.ts +1 -0
- package/dist/types/workers/uploads/uploads-worker.test.d.ts +1 -0
- package/package.json +2 -1
- /package/dist/cjs/chunks/{MdStreamBuffer-BIlyoz-U.js → MdStreamBuffer-BiFYXGu6.js} +0 -0
- /package/dist/cjs/chunks/{SSEConnection-B2qZwRe5.js → SSEConnection-CygPbs0L.js} +0 -0
- /package/dist/cjs/chunks/{_types-KVtz1JIf.js → _types-jaI3KEVY.js} +0 -0
- /package/dist/cjs/chunks/{audioVisualizer-COtQiyA7.js → audioVisualizer-Dmtjjosj.js} +0 -0
- /package/dist/cjs/chunks/{broadcastChannel-Cqzs7sXX.js → broadcastChannel-CRR59lw6.js} +0 -0
- /package/dist/cjs/chunks/{colors-CmJHFEI7.js → colors-Dok44sXW.js} +0 -0
- /package/dist/cjs/chunks/{debounce-TfVmWD0v.js → debounce-C3P6vOcn.js} +0 -0
- /package/dist/cjs/chunks/{modalStore-C6J4X4Z_.js → modalStore--QHdUyuE.js} +0 -0
- /package/dist/cjs/chunks/{rafThrottle-QTFO3TjH.js → rafThrottle-DlDdrddz.js} +0 -0
- /package/dist/cjs/chunks/{sharedTypes-BeP4wu1R.js → sharedTypes-BW_hw-Vb.js} +0 -0
- /package/dist/cjs/chunks/{tipStore-DksXXZ-l.js → tipStore-DAb0BV40.js} +0 -0
- /package/dist/cjs/chunks/{toastStore-DaSJFhEz.js → toastStore-6OcUl7VL.js} +0 -0
- /package/dist/cjs/chunks/{tslib.es6-B8RWDz3P.js → tslib.es6-Y3RzGMQw.js} +0 -0
- /package/dist/cjs/chunks/{videoStore-COp8iv9F.js → videoStore-B2FtqVfG.js} +0 -0
- /package/dist/esm/chunks/{MdStreamBuffer-BzkkcjT9.mjs → MdStreamBuffer-D3J2CXWe.mjs} +0 -0
- /package/dist/esm/chunks/{SSEConnection-BpZWD_YR.mjs → SSEConnection-5GuqCTf8.mjs} +0 -0
- /package/dist/esm/chunks/{_types-BEg4q3Ct.mjs → _types-CLPtELrL.mjs} +0 -0
- /package/dist/esm/chunks/{audioVisualizer-B7i2Eluw.mjs → audioVisualizer-BO_hMyyp.mjs} +0 -0
- /package/dist/esm/chunks/{broadcastChannel-Bw5Pck80.mjs → broadcastChannel-B8FxWRVj.mjs} +0 -0
- /package/dist/esm/chunks/{colors-6NoVF74x.mjs → colors-Pe71RB3l.mjs} +0 -0
- /package/dist/esm/chunks/{debounce-BXeBit77.mjs → debounce-O12UHVJH.mjs} +0 -0
- /package/dist/esm/chunks/{modalStore-CC-D_muU.mjs → modalStore-CBW78_cT.mjs} +0 -0
- /package/dist/esm/chunks/{rafThrottle-B25fapDv.mjs → rafThrottle-Cf-gEuLq.mjs} +0 -0
- /package/dist/esm/chunks/{sharedTypes-h1aSeCm2.mjs → sharedTypes-ySBopm8X.mjs} +0 -0
- /package/dist/esm/chunks/{tipStore-B1G8sE05.mjs → tipStore-DHu8QqNR.mjs} +0 -0
- /package/dist/esm/chunks/{toastStore-9muAYcgx.mjs → toastStore-EbAo-Cjj.mjs} +0 -0
- /package/dist/esm/chunks/{tslib.es6-p9eD9VLE.mjs → tslib.es6-uJhEruZV.mjs} +0 -0
- /package/dist/esm/chunks/{videoStore-Z2NndKsG.mjs → videoStore-TxVsMj8s.mjs} +0 -0
|
@@ -0,0 +1,724 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var comma = ",".charCodeAt(0), semicolon = ";".charCodeAt(0), chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", intToChar = new Uint8Array(64), charToInt = new Uint8Array(128);
|
|
4
|
+
|
|
5
|
+
for (let i = 0; i < 64; i++) {
|
|
6
|
+
const c = chars.charCodeAt(i);
|
|
7
|
+
intToChar[i] = c, charToInt[c] = i;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
function encodeInteger(builder, num) {
|
|
11
|
+
do {
|
|
12
|
+
let clamped = 31 & num;
|
|
13
|
+
(num >>>= 5) > 0 && (clamped |= 32), builder.write(intToChar[clamped]);
|
|
14
|
+
} while (num > 0);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function encodeSign(num) {
|
|
18
|
+
return num < 0 ? -num << 1 | 1 : num << 1;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
var td = "undefined" != typeof TextDecoder ? new TextDecoder : "undefined" != typeof Buffer ? {
|
|
22
|
+
decode: buf => Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength).toString()
|
|
23
|
+
} : {
|
|
24
|
+
decode(buf) {
|
|
25
|
+
let out = "";
|
|
26
|
+
for (let i = 0; i < buf.length; i++) out += String.fromCharCode(buf[i]);
|
|
27
|
+
return out;
|
|
28
|
+
}
|
|
29
|
+
}, StringWriter = class {
|
|
30
|
+
constructor() {
|
|
31
|
+
this.pos = 0, this.out = "", this.buffer = new Uint8Array(16384);
|
|
32
|
+
}
|
|
33
|
+
write(v) {
|
|
34
|
+
const {buffer: buffer} = this;
|
|
35
|
+
buffer[this.pos++] = v, 16384 === this.pos && (this.out += td.decode(buffer), this.pos = 0);
|
|
36
|
+
}
|
|
37
|
+
flush() {
|
|
38
|
+
const {buffer: buffer, out: out, pos: pos} = this;
|
|
39
|
+
return pos > 0 ? out + td.decode(buffer.subarray(0, pos)) : out;
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
class BitSet {
|
|
44
|
+
constructor(arg) {
|
|
45
|
+
this.bits = arg instanceof BitSet ? arg.bits.slice() : [];
|
|
46
|
+
}
|
|
47
|
+
add(n) {
|
|
48
|
+
this.bits[n >> 5] |= 1 << (31 & n);
|
|
49
|
+
}
|
|
50
|
+
has(n) {
|
|
51
|
+
return !!(this.bits[n >> 5] & 1 << (31 & n));
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
class Chunk {
|
|
56
|
+
constructor(start, end, content) {
|
|
57
|
+
this.start = start, this.end = end, this.original = content, this.intro = "", this.outro = "",
|
|
58
|
+
this.content = content, this.storeName = !1, this.edited = !1, this.previous = null,
|
|
59
|
+
this.next = null;
|
|
60
|
+
}
|
|
61
|
+
appendLeft(content) {
|
|
62
|
+
this.outro += content;
|
|
63
|
+
}
|
|
64
|
+
appendRight(content) {
|
|
65
|
+
this.intro = this.intro + content;
|
|
66
|
+
}
|
|
67
|
+
clone() {
|
|
68
|
+
const chunk = new Chunk(this.start, this.end, this.original);
|
|
69
|
+
return chunk.intro = this.intro, chunk.outro = this.outro, chunk.content = this.content,
|
|
70
|
+
chunk.storeName = this.storeName, chunk.edited = this.edited, chunk;
|
|
71
|
+
}
|
|
72
|
+
contains(index) {
|
|
73
|
+
return this.start < index && index < this.end;
|
|
74
|
+
}
|
|
75
|
+
eachNext(fn) {
|
|
76
|
+
let chunk = this;
|
|
77
|
+
for (;chunk; ) fn(chunk), chunk = chunk.next;
|
|
78
|
+
}
|
|
79
|
+
eachPrevious(fn) {
|
|
80
|
+
let chunk = this;
|
|
81
|
+
for (;chunk; ) fn(chunk), chunk = chunk.previous;
|
|
82
|
+
}
|
|
83
|
+
edit(content, storeName, contentOnly) {
|
|
84
|
+
return this.content = content, contentOnly || (this.intro = "", this.outro = ""),
|
|
85
|
+
this.storeName = storeName, this.edited = !0, this;
|
|
86
|
+
}
|
|
87
|
+
prependLeft(content) {
|
|
88
|
+
this.outro = content + this.outro;
|
|
89
|
+
}
|
|
90
|
+
prependRight(content) {
|
|
91
|
+
this.intro = content + this.intro;
|
|
92
|
+
}
|
|
93
|
+
reset() {
|
|
94
|
+
this.intro = "", this.outro = "", this.edited && (this.content = this.original,
|
|
95
|
+
this.storeName = !1, this.edited = !1);
|
|
96
|
+
}
|
|
97
|
+
split(index) {
|
|
98
|
+
const sliceIndex = index - this.start, originalBefore = this.original.slice(0, sliceIndex), originalAfter = this.original.slice(sliceIndex);
|
|
99
|
+
this.original = originalBefore;
|
|
100
|
+
const newChunk = new Chunk(index, this.end, originalAfter);
|
|
101
|
+
return newChunk.outro = this.outro, this.outro = "", this.end = index, this.edited ? (newChunk.edit("", !1),
|
|
102
|
+
this.content = "") : this.content = originalBefore, newChunk.next = this.next, newChunk.next && (newChunk.next.previous = newChunk),
|
|
103
|
+
newChunk.previous = this, this.next = newChunk, newChunk;
|
|
104
|
+
}
|
|
105
|
+
toString() {
|
|
106
|
+
return this.intro + this.content + this.outro;
|
|
107
|
+
}
|
|
108
|
+
trimEnd(rx) {
|
|
109
|
+
if (this.outro = this.outro.replace(rx, ""), this.outro.length) return !0;
|
|
110
|
+
const trimmed = this.content.replace(rx, "");
|
|
111
|
+
return trimmed.length ? (trimmed !== this.content && (this.split(this.start + trimmed.length).edit("", void 0, !0),
|
|
112
|
+
this.edited && this.edit(trimmed, this.storeName, !0)), !0) : (this.edit("", void 0, !0),
|
|
113
|
+
this.intro = this.intro.replace(rx, ""), !!this.intro.length || void 0);
|
|
114
|
+
}
|
|
115
|
+
trimStart(rx) {
|
|
116
|
+
if (this.intro = this.intro.replace(rx, ""), this.intro.length) return !0;
|
|
117
|
+
const trimmed = this.content.replace(rx, "");
|
|
118
|
+
if (trimmed.length) {
|
|
119
|
+
if (trimmed !== this.content) {
|
|
120
|
+
const newChunk = this.split(this.end - trimmed.length);
|
|
121
|
+
this.edited && newChunk.edit(trimmed, this.storeName, !0), this.edit("", void 0, !0);
|
|
122
|
+
}
|
|
123
|
+
return !0;
|
|
124
|
+
}
|
|
125
|
+
return this.edit("", void 0, !0), this.outro = this.outro.replace(rx, ""), !!this.outro.length || void 0;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
function getBtoa() {
|
|
130
|
+
return "undefined" != typeof globalThis && "function" == typeof globalThis.btoa ? str => globalThis.btoa(unescape(encodeURIComponent(str))) : "function" == typeof Buffer ? str => Buffer.from(str, "utf-8").toString("base64") : () => {
|
|
131
|
+
throw new Error("Unsupported environment: `window.btoa` or `Buffer` should be supported.");
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
const btoa = getBtoa();
|
|
136
|
+
|
|
137
|
+
class SourceMap {
|
|
138
|
+
constructor(properties) {
|
|
139
|
+
this.version = 3, this.file = properties.file, this.sources = properties.sources,
|
|
140
|
+
this.sourcesContent = properties.sourcesContent, this.names = properties.names,
|
|
141
|
+
this.mappings = function(decoded) {
|
|
142
|
+
const writer = new StringWriter;
|
|
143
|
+
let sourcesIndex = 0, sourceLine = 0, sourceColumn = 0, namesIndex = 0;
|
|
144
|
+
for (let i = 0; i < decoded.length; i++) {
|
|
145
|
+
const line = decoded[i];
|
|
146
|
+
if (i > 0 && writer.write(semicolon), 0 === line.length) continue;
|
|
147
|
+
let genColumn = 0;
|
|
148
|
+
for (let j = 0; j < line.length; j++) {
|
|
149
|
+
const segment = line[j];
|
|
150
|
+
j > 0 && writer.write(comma), encodeInteger(writer, encodeSign(segment[0] - genColumn)),
|
|
151
|
+
genColumn = segment[0], 1 !== segment.length && (encodeInteger(writer, encodeSign(segment[1] - sourcesIndex)),
|
|
152
|
+
encodeInteger(writer, encodeSign(segment[2] - sourceLine)), encodeInteger(writer, encodeSign(segment[3] - sourceColumn)),
|
|
153
|
+
sourcesIndex = segment[1], sourceLine = segment[2], sourceColumn = segment[3], 4 !== segment.length && (encodeInteger(writer, encodeSign(segment[4] - namesIndex)),
|
|
154
|
+
namesIndex = segment[4]));
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
return writer.flush();
|
|
158
|
+
}(properties.mappings), void 0 !== properties.x_google_ignoreList && (this.x_google_ignoreList = properties.x_google_ignoreList),
|
|
159
|
+
void 0 !== properties.debugId && (this.debugId = properties.debugId);
|
|
160
|
+
}
|
|
161
|
+
toString() {
|
|
162
|
+
return JSON.stringify(this);
|
|
163
|
+
}
|
|
164
|
+
toUrl() {
|
|
165
|
+
return "data:application/json;charset=utf-8;base64," + btoa(this.toString());
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
function getRelativePath(from, to) {
|
|
170
|
+
const fromParts = from.split(/[/\\]/), toParts = to.split(/[/\\]/);
|
|
171
|
+
for (fromParts.pop(); fromParts[0] === toParts[0]; ) fromParts.shift(), toParts.shift();
|
|
172
|
+
if (fromParts.length) {
|
|
173
|
+
let i = fromParts.length;
|
|
174
|
+
for (;i--; ) fromParts[i] = "..";
|
|
175
|
+
}
|
|
176
|
+
return fromParts.concat(toParts).join("/");
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
const toString = Object.prototype.toString;
|
|
180
|
+
|
|
181
|
+
function getLocator(source) {
|
|
182
|
+
const originalLines = source.split("\n"), lineOffsets = [];
|
|
183
|
+
for (let i = 0, pos = 0; i < originalLines.length; i++) lineOffsets.push(pos), pos += originalLines[i].length + 1;
|
|
184
|
+
return function(index) {
|
|
185
|
+
let i = 0, j = lineOffsets.length;
|
|
186
|
+
for (;i < j; ) {
|
|
187
|
+
const m = i + j >> 1;
|
|
188
|
+
index < lineOffsets[m] ? j = m : i = m + 1;
|
|
189
|
+
}
|
|
190
|
+
const line = i - 1;
|
|
191
|
+
return {
|
|
192
|
+
line: line,
|
|
193
|
+
column: index - lineOffsets[line]
|
|
194
|
+
};
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
const wordRegex = /\w/;
|
|
199
|
+
|
|
200
|
+
class Mappings {
|
|
201
|
+
constructor(hires) {
|
|
202
|
+
this.hires = hires, this.generatedCodeLine = 0, this.generatedCodeColumn = 0, this.raw = [],
|
|
203
|
+
this.rawSegments = this.raw[this.generatedCodeLine] = [], this.pending = null;
|
|
204
|
+
}
|
|
205
|
+
addEdit(sourceIndex, content, loc, nameIndex) {
|
|
206
|
+
if (content.length) {
|
|
207
|
+
const contentLengthMinusOne = content.length - 1;
|
|
208
|
+
let contentLineEnd = content.indexOf("\n", 0), previousContentLineEnd = -1;
|
|
209
|
+
for (;contentLineEnd >= 0 && contentLengthMinusOne > contentLineEnd; ) {
|
|
210
|
+
const segment = [ this.generatedCodeColumn, sourceIndex, loc.line, loc.column ];
|
|
211
|
+
nameIndex >= 0 && segment.push(nameIndex), this.rawSegments.push(segment), this.generatedCodeLine += 1,
|
|
212
|
+
this.raw[this.generatedCodeLine] = this.rawSegments = [], this.generatedCodeColumn = 0,
|
|
213
|
+
previousContentLineEnd = contentLineEnd, contentLineEnd = content.indexOf("\n", contentLineEnd + 1);
|
|
214
|
+
}
|
|
215
|
+
const segment = [ this.generatedCodeColumn, sourceIndex, loc.line, loc.column ];
|
|
216
|
+
nameIndex >= 0 && segment.push(nameIndex), this.rawSegments.push(segment), this.advance(content.slice(previousContentLineEnd + 1));
|
|
217
|
+
} else this.pending && (this.rawSegments.push(this.pending), this.advance(content));
|
|
218
|
+
this.pending = null;
|
|
219
|
+
}
|
|
220
|
+
addUneditedChunk(sourceIndex, chunk, original, loc, sourcemapLocations) {
|
|
221
|
+
let originalCharIndex = chunk.start, first = !0, charInHiresBoundary = !1;
|
|
222
|
+
for (;originalCharIndex < chunk.end; ) {
|
|
223
|
+
if ("\n" === original[originalCharIndex]) loc.line += 1, loc.column = 0, this.generatedCodeLine += 1,
|
|
224
|
+
this.raw[this.generatedCodeLine] = this.rawSegments = [], this.generatedCodeColumn = 0,
|
|
225
|
+
first = !0, charInHiresBoundary = !1; else {
|
|
226
|
+
if (this.hires || first || sourcemapLocations.has(originalCharIndex)) {
|
|
227
|
+
const segment = [ this.generatedCodeColumn, sourceIndex, loc.line, loc.column ];
|
|
228
|
+
"boundary" === this.hires ? wordRegex.test(original[originalCharIndex]) ? charInHiresBoundary || (this.rawSegments.push(segment),
|
|
229
|
+
charInHiresBoundary = !0) : (this.rawSegments.push(segment), charInHiresBoundary = !1) : this.rawSegments.push(segment);
|
|
230
|
+
}
|
|
231
|
+
loc.column += 1, this.generatedCodeColumn += 1, first = !1;
|
|
232
|
+
}
|
|
233
|
+
originalCharIndex += 1;
|
|
234
|
+
}
|
|
235
|
+
this.pending = null;
|
|
236
|
+
}
|
|
237
|
+
advance(str) {
|
|
238
|
+
if (!str) return;
|
|
239
|
+
const lines = str.split("\n");
|
|
240
|
+
if (lines.length > 1) {
|
|
241
|
+
for (let i = 0; i < lines.length - 1; i++) this.generatedCodeLine++, this.raw[this.generatedCodeLine] = this.rawSegments = [];
|
|
242
|
+
this.generatedCodeColumn = 0;
|
|
243
|
+
}
|
|
244
|
+
this.generatedCodeColumn += lines[lines.length - 1].length;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
const n = "\n", warned = {
|
|
249
|
+
insertLeft: !1,
|
|
250
|
+
insertRight: !1,
|
|
251
|
+
storeName: !1
|
|
252
|
+
};
|
|
253
|
+
|
|
254
|
+
class MagicString {
|
|
255
|
+
constructor(string, options = {}) {
|
|
256
|
+
const chunk = new Chunk(0, string.length, string);
|
|
257
|
+
Object.defineProperties(this, {
|
|
258
|
+
original: {
|
|
259
|
+
writable: !0,
|
|
260
|
+
value: string
|
|
261
|
+
},
|
|
262
|
+
outro: {
|
|
263
|
+
writable: !0,
|
|
264
|
+
value: ""
|
|
265
|
+
},
|
|
266
|
+
intro: {
|
|
267
|
+
writable: !0,
|
|
268
|
+
value: ""
|
|
269
|
+
},
|
|
270
|
+
firstChunk: {
|
|
271
|
+
writable: !0,
|
|
272
|
+
value: chunk
|
|
273
|
+
},
|
|
274
|
+
lastChunk: {
|
|
275
|
+
writable: !0,
|
|
276
|
+
value: chunk
|
|
277
|
+
},
|
|
278
|
+
lastSearchedChunk: {
|
|
279
|
+
writable: !0,
|
|
280
|
+
value: chunk
|
|
281
|
+
},
|
|
282
|
+
byStart: {
|
|
283
|
+
writable: !0,
|
|
284
|
+
value: {}
|
|
285
|
+
},
|
|
286
|
+
byEnd: {
|
|
287
|
+
writable: !0,
|
|
288
|
+
value: {}
|
|
289
|
+
},
|
|
290
|
+
filename: {
|
|
291
|
+
writable: !0,
|
|
292
|
+
value: options.filename
|
|
293
|
+
},
|
|
294
|
+
indentExclusionRanges: {
|
|
295
|
+
writable: !0,
|
|
296
|
+
value: options.indentExclusionRanges
|
|
297
|
+
},
|
|
298
|
+
sourcemapLocations: {
|
|
299
|
+
writable: !0,
|
|
300
|
+
value: new BitSet
|
|
301
|
+
},
|
|
302
|
+
storedNames: {
|
|
303
|
+
writable: !0,
|
|
304
|
+
value: {}
|
|
305
|
+
},
|
|
306
|
+
indentStr: {
|
|
307
|
+
writable: !0,
|
|
308
|
+
value: void 0
|
|
309
|
+
},
|
|
310
|
+
ignoreList: {
|
|
311
|
+
writable: !0,
|
|
312
|
+
value: options.ignoreList
|
|
313
|
+
},
|
|
314
|
+
offset: {
|
|
315
|
+
writable: !0,
|
|
316
|
+
value: options.offset || 0
|
|
317
|
+
}
|
|
318
|
+
}), this.byStart[0] = chunk, this.byEnd[string.length] = chunk;
|
|
319
|
+
}
|
|
320
|
+
addSourcemapLocation(char) {
|
|
321
|
+
this.sourcemapLocations.add(char);
|
|
322
|
+
}
|
|
323
|
+
append(content) {
|
|
324
|
+
if ("string" != typeof content) throw new TypeError("outro content must be a string");
|
|
325
|
+
return this.outro += content, this;
|
|
326
|
+
}
|
|
327
|
+
appendLeft(index, content) {
|
|
328
|
+
if (index += this.offset, "string" != typeof content) throw new TypeError("inserted content must be a string");
|
|
329
|
+
this._split(index);
|
|
330
|
+
const chunk = this.byEnd[index];
|
|
331
|
+
return chunk ? chunk.appendLeft(content) : this.intro += content, this;
|
|
332
|
+
}
|
|
333
|
+
appendRight(index, content) {
|
|
334
|
+
if (index += this.offset, "string" != typeof content) throw new TypeError("inserted content must be a string");
|
|
335
|
+
this._split(index);
|
|
336
|
+
const chunk = this.byStart[index];
|
|
337
|
+
return chunk ? chunk.appendRight(content) : this.outro += content, this;
|
|
338
|
+
}
|
|
339
|
+
clone() {
|
|
340
|
+
const cloned = new MagicString(this.original, {
|
|
341
|
+
filename: this.filename,
|
|
342
|
+
offset: this.offset
|
|
343
|
+
});
|
|
344
|
+
let originalChunk = this.firstChunk, clonedChunk = cloned.firstChunk = cloned.lastSearchedChunk = originalChunk.clone();
|
|
345
|
+
for (;originalChunk; ) {
|
|
346
|
+
cloned.byStart[clonedChunk.start] = clonedChunk, cloned.byEnd[clonedChunk.end] = clonedChunk;
|
|
347
|
+
const nextOriginalChunk = originalChunk.next, nextClonedChunk = nextOriginalChunk && nextOriginalChunk.clone();
|
|
348
|
+
nextClonedChunk && (clonedChunk.next = nextClonedChunk, nextClonedChunk.previous = clonedChunk,
|
|
349
|
+
clonedChunk = nextClonedChunk), originalChunk = nextOriginalChunk;
|
|
350
|
+
}
|
|
351
|
+
return cloned.lastChunk = clonedChunk, this.indentExclusionRanges && (cloned.indentExclusionRanges = this.indentExclusionRanges.slice()),
|
|
352
|
+
cloned.sourcemapLocations = new BitSet(this.sourcemapLocations), cloned.intro = this.intro,
|
|
353
|
+
cloned.outro = this.outro, cloned;
|
|
354
|
+
}
|
|
355
|
+
generateDecodedMap(options) {
|
|
356
|
+
options = options || {};
|
|
357
|
+
const names = Object.keys(this.storedNames), mappings = new Mappings(options.hires), locate = getLocator(this.original);
|
|
358
|
+
return this.intro && mappings.advance(this.intro), this.firstChunk.eachNext(chunk => {
|
|
359
|
+
const loc = locate(chunk.start);
|
|
360
|
+
chunk.intro.length && mappings.advance(chunk.intro), chunk.edited ? mappings.addEdit(0, chunk.content, loc, chunk.storeName ? names.indexOf(chunk.original) : -1) : mappings.addUneditedChunk(0, chunk, this.original, loc, this.sourcemapLocations),
|
|
361
|
+
chunk.outro.length && mappings.advance(chunk.outro);
|
|
362
|
+
}), this.outro && mappings.advance(this.outro), {
|
|
363
|
+
file: options.file ? options.file.split(/[/\\]/).pop() : void 0,
|
|
364
|
+
sources: [ options.source ? getRelativePath(options.file || "", options.source) : options.file || "" ],
|
|
365
|
+
sourcesContent: options.includeContent ? [ this.original ] : void 0,
|
|
366
|
+
names: names,
|
|
367
|
+
mappings: mappings.raw,
|
|
368
|
+
x_google_ignoreList: this.ignoreList ? [ 0 ] : void 0
|
|
369
|
+
};
|
|
370
|
+
}
|
|
371
|
+
generateMap(options) {
|
|
372
|
+
return new SourceMap(this.generateDecodedMap(options));
|
|
373
|
+
}
|
|
374
|
+
_ensureindentStr() {
|
|
375
|
+
void 0 === this.indentStr && (this.indentStr = function(code) {
|
|
376
|
+
const lines = code.split("\n"), tabbed = lines.filter(line => /^\t+/.test(line)), spaced = lines.filter(line => /^ {2,}/.test(line));
|
|
377
|
+
if (0 === tabbed.length && 0 === spaced.length) return null;
|
|
378
|
+
if (tabbed.length >= spaced.length) return "\t";
|
|
379
|
+
const min = spaced.reduce((previous, current) => {
|
|
380
|
+
const numSpaces = /^ +/.exec(current)[0].length;
|
|
381
|
+
return Math.min(numSpaces, previous);
|
|
382
|
+
}, 1 / 0);
|
|
383
|
+
return new Array(min + 1).join(" ");
|
|
384
|
+
}(this.original));
|
|
385
|
+
}
|
|
386
|
+
_getRawIndentString() {
|
|
387
|
+
return this._ensureindentStr(), this.indentStr;
|
|
388
|
+
}
|
|
389
|
+
getIndentString() {
|
|
390
|
+
return this._ensureindentStr(), null === this.indentStr ? "\t" : this.indentStr;
|
|
391
|
+
}
|
|
392
|
+
indent(indentStr, options) {
|
|
393
|
+
const pattern = /^[^\r\n]/gm;
|
|
394
|
+
var thing;
|
|
395
|
+
if (thing = indentStr, "[object Object]" === toString.call(thing) && (options = indentStr,
|
|
396
|
+
indentStr = void 0), void 0 === indentStr && (this._ensureindentStr(), indentStr = this.indentStr || "\t"),
|
|
397
|
+
"" === indentStr) return this;
|
|
398
|
+
const isExcluded = {};
|
|
399
|
+
if ((options = options || {}).exclude) {
|
|
400
|
+
("number" == typeof options.exclude[0] ? [ options.exclude ] : options.exclude).forEach(exclusion => {
|
|
401
|
+
for (let i = exclusion[0]; i < exclusion[1]; i += 1) isExcluded[i] = !0;
|
|
402
|
+
});
|
|
403
|
+
}
|
|
404
|
+
let shouldIndentNextCharacter = !1 !== options.indentStart;
|
|
405
|
+
const replacer = match => shouldIndentNextCharacter ? `${indentStr}${match}` : (shouldIndentNextCharacter = !0,
|
|
406
|
+
match);
|
|
407
|
+
this.intro = this.intro.replace(pattern, replacer);
|
|
408
|
+
let charIndex = 0, chunk = this.firstChunk;
|
|
409
|
+
for (;chunk; ) {
|
|
410
|
+
const end = chunk.end;
|
|
411
|
+
if (chunk.edited) isExcluded[charIndex] || (chunk.content = chunk.content.replace(pattern, replacer),
|
|
412
|
+
chunk.content.length && (shouldIndentNextCharacter = "\n" === chunk.content[chunk.content.length - 1])); else for (charIndex = chunk.start; charIndex < end; ) {
|
|
413
|
+
if (!isExcluded[charIndex]) {
|
|
414
|
+
const char = this.original[charIndex];
|
|
415
|
+
"\n" === char ? shouldIndentNextCharacter = !0 : "\r" !== char && shouldIndentNextCharacter && (shouldIndentNextCharacter = !1,
|
|
416
|
+
charIndex === chunk.start || (this._splitChunk(chunk, charIndex), chunk = chunk.next),
|
|
417
|
+
chunk.prependRight(indentStr));
|
|
418
|
+
}
|
|
419
|
+
charIndex += 1;
|
|
420
|
+
}
|
|
421
|
+
charIndex = chunk.end, chunk = chunk.next;
|
|
422
|
+
}
|
|
423
|
+
return this.outro = this.outro.replace(pattern, replacer), this;
|
|
424
|
+
}
|
|
425
|
+
insert() {
|
|
426
|
+
throw new Error("magicString.insert(...) is deprecated. Use prependRight(...) or appendLeft(...)");
|
|
427
|
+
}
|
|
428
|
+
insertLeft(index, content) {
|
|
429
|
+
return warned.insertLeft || (console.warn("magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead"),
|
|
430
|
+
warned.insertLeft = !0), this.appendLeft(index, content);
|
|
431
|
+
}
|
|
432
|
+
insertRight(index, content) {
|
|
433
|
+
return warned.insertRight || (console.warn("magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead"),
|
|
434
|
+
warned.insertRight = !0), this.prependRight(index, content);
|
|
435
|
+
}
|
|
436
|
+
move(start, end, index) {
|
|
437
|
+
if (start += this.offset, end += this.offset, (index += this.offset) >= start && index <= end) throw new Error("Cannot move a selection inside itself");
|
|
438
|
+
this._split(start), this._split(end), this._split(index);
|
|
439
|
+
const first = this.byStart[start], last = this.byEnd[end], oldLeft = first.previous, oldRight = last.next, newRight = this.byStart[index];
|
|
440
|
+
if (!newRight && last === this.lastChunk) return this;
|
|
441
|
+
const newLeft = newRight ? newRight.previous : this.lastChunk;
|
|
442
|
+
return oldLeft && (oldLeft.next = oldRight), oldRight && (oldRight.previous = oldLeft),
|
|
443
|
+
newLeft && (newLeft.next = first), newRight && (newRight.previous = last), first.previous || (this.firstChunk = last.next),
|
|
444
|
+
last.next || (this.lastChunk = first.previous, this.lastChunk.next = null), first.previous = newLeft,
|
|
445
|
+
last.next = newRight || null, newLeft || (this.firstChunk = first), newRight || (this.lastChunk = last),
|
|
446
|
+
this;
|
|
447
|
+
}
|
|
448
|
+
overwrite(start, end, content, options) {
|
|
449
|
+
return options = options || {}, this.update(start, end, content, {
|
|
450
|
+
...options,
|
|
451
|
+
overwrite: !options.contentOnly
|
|
452
|
+
});
|
|
453
|
+
}
|
|
454
|
+
update(start, end, content, options) {
|
|
455
|
+
if (start += this.offset, end += this.offset, "string" != typeof content) throw new TypeError("replacement content must be a string");
|
|
456
|
+
if (0 !== this.original.length) {
|
|
457
|
+
for (;start < 0; ) start += this.original.length;
|
|
458
|
+
for (;end < 0; ) end += this.original.length;
|
|
459
|
+
}
|
|
460
|
+
if (end > this.original.length) throw new Error("end is out of bounds");
|
|
461
|
+
if (start === end) throw new Error("Cannot overwrite a zero-length range – use appendLeft or prependRight instead");
|
|
462
|
+
this._split(start), this._split(end), !0 === options && (warned.storeName || (console.warn("The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string"),
|
|
463
|
+
warned.storeName = !0), options = {
|
|
464
|
+
storeName: !0
|
|
465
|
+
});
|
|
466
|
+
const storeName = void 0 !== options && options.storeName, overwrite = void 0 !== options && options.overwrite;
|
|
467
|
+
if (storeName) {
|
|
468
|
+
const original = this.original.slice(start, end);
|
|
469
|
+
Object.defineProperty(this.storedNames, original, {
|
|
470
|
+
writable: !0,
|
|
471
|
+
value: !0,
|
|
472
|
+
enumerable: !0
|
|
473
|
+
});
|
|
474
|
+
}
|
|
475
|
+
const first = this.byStart[start], last = this.byEnd[end];
|
|
476
|
+
if (first) {
|
|
477
|
+
let chunk = first;
|
|
478
|
+
for (;chunk !== last; ) {
|
|
479
|
+
if (chunk.next !== this.byStart[chunk.end]) throw new Error("Cannot overwrite across a split point");
|
|
480
|
+
chunk = chunk.next, chunk.edit("", !1);
|
|
481
|
+
}
|
|
482
|
+
first.edit(content, storeName, !overwrite);
|
|
483
|
+
} else {
|
|
484
|
+
const newChunk = new Chunk(start, end, "").edit(content, storeName);
|
|
485
|
+
last.next = newChunk, newChunk.previous = last;
|
|
486
|
+
}
|
|
487
|
+
return this;
|
|
488
|
+
}
|
|
489
|
+
prepend(content) {
|
|
490
|
+
if ("string" != typeof content) throw new TypeError("outro content must be a string");
|
|
491
|
+
return this.intro = content + this.intro, this;
|
|
492
|
+
}
|
|
493
|
+
prependLeft(index, content) {
|
|
494
|
+
if (index += this.offset, "string" != typeof content) throw new TypeError("inserted content must be a string");
|
|
495
|
+
this._split(index);
|
|
496
|
+
const chunk = this.byEnd[index];
|
|
497
|
+
return chunk ? chunk.prependLeft(content) : this.intro = content + this.intro, this;
|
|
498
|
+
}
|
|
499
|
+
prependRight(index, content) {
|
|
500
|
+
if (index += this.offset, "string" != typeof content) throw new TypeError("inserted content must be a string");
|
|
501
|
+
this._split(index);
|
|
502
|
+
const chunk = this.byStart[index];
|
|
503
|
+
return chunk ? chunk.prependRight(content) : this.outro = content + this.outro,
|
|
504
|
+
this;
|
|
505
|
+
}
|
|
506
|
+
remove(start, end) {
|
|
507
|
+
if (start += this.offset, end += this.offset, 0 !== this.original.length) {
|
|
508
|
+
for (;start < 0; ) start += this.original.length;
|
|
509
|
+
for (;end < 0; ) end += this.original.length;
|
|
510
|
+
}
|
|
511
|
+
if (start === end) return this;
|
|
512
|
+
if (start < 0 || end > this.original.length) throw new Error("Character is out of bounds");
|
|
513
|
+
if (start > end) throw new Error("end must be greater than start");
|
|
514
|
+
this._split(start), this._split(end);
|
|
515
|
+
let chunk = this.byStart[start];
|
|
516
|
+
for (;chunk; ) chunk.intro = "", chunk.outro = "", chunk.edit(""), chunk = end > chunk.end ? this.byStart[chunk.end] : null;
|
|
517
|
+
return this;
|
|
518
|
+
}
|
|
519
|
+
reset(start, end) {
|
|
520
|
+
if (start += this.offset, end += this.offset, 0 !== this.original.length) {
|
|
521
|
+
for (;start < 0; ) start += this.original.length;
|
|
522
|
+
for (;end < 0; ) end += this.original.length;
|
|
523
|
+
}
|
|
524
|
+
if (start === end) return this;
|
|
525
|
+
if (start < 0 || end > this.original.length) throw new Error("Character is out of bounds");
|
|
526
|
+
if (start > end) throw new Error("end must be greater than start");
|
|
527
|
+
this._split(start), this._split(end);
|
|
528
|
+
let chunk = this.byStart[start];
|
|
529
|
+
for (;chunk; ) chunk.reset(), chunk = end > chunk.end ? this.byStart[chunk.end] : null;
|
|
530
|
+
return this;
|
|
531
|
+
}
|
|
532
|
+
lastChar() {
|
|
533
|
+
if (this.outro.length) return this.outro[this.outro.length - 1];
|
|
534
|
+
let chunk = this.lastChunk;
|
|
535
|
+
do {
|
|
536
|
+
if (chunk.outro.length) return chunk.outro[chunk.outro.length - 1];
|
|
537
|
+
if (chunk.content.length) return chunk.content[chunk.content.length - 1];
|
|
538
|
+
if (chunk.intro.length) return chunk.intro[chunk.intro.length - 1];
|
|
539
|
+
} while (chunk = chunk.previous);
|
|
540
|
+
return this.intro.length ? this.intro[this.intro.length - 1] : "";
|
|
541
|
+
}
|
|
542
|
+
lastLine() {
|
|
543
|
+
let lineIndex = this.outro.lastIndexOf(n);
|
|
544
|
+
if (-1 !== lineIndex) return this.outro.substr(lineIndex + 1);
|
|
545
|
+
let lineStr = this.outro, chunk = this.lastChunk;
|
|
546
|
+
do {
|
|
547
|
+
if (chunk.outro.length > 0) {
|
|
548
|
+
if (lineIndex = chunk.outro.lastIndexOf(n), -1 !== lineIndex) return chunk.outro.substr(lineIndex + 1) + lineStr;
|
|
549
|
+
lineStr = chunk.outro + lineStr;
|
|
550
|
+
}
|
|
551
|
+
if (chunk.content.length > 0) {
|
|
552
|
+
if (lineIndex = chunk.content.lastIndexOf(n), -1 !== lineIndex) return chunk.content.substr(lineIndex + 1) + lineStr;
|
|
553
|
+
lineStr = chunk.content + lineStr;
|
|
554
|
+
}
|
|
555
|
+
if (chunk.intro.length > 0) {
|
|
556
|
+
if (lineIndex = chunk.intro.lastIndexOf(n), -1 !== lineIndex) return chunk.intro.substr(lineIndex + 1) + lineStr;
|
|
557
|
+
lineStr = chunk.intro + lineStr;
|
|
558
|
+
}
|
|
559
|
+
} while (chunk = chunk.previous);
|
|
560
|
+
return lineIndex = this.intro.lastIndexOf(n), -1 !== lineIndex ? this.intro.substr(lineIndex + 1) + lineStr : this.intro + lineStr;
|
|
561
|
+
}
|
|
562
|
+
slice(start = 0, end = this.original.length - this.offset) {
|
|
563
|
+
if (start += this.offset, end += this.offset, 0 !== this.original.length) {
|
|
564
|
+
for (;start < 0; ) start += this.original.length;
|
|
565
|
+
for (;end < 0; ) end += this.original.length;
|
|
566
|
+
}
|
|
567
|
+
let result = "", chunk = this.firstChunk;
|
|
568
|
+
for (;chunk && (chunk.start > start || chunk.end <= start); ) {
|
|
569
|
+
if (chunk.start < end && chunk.end >= end) return result;
|
|
570
|
+
chunk = chunk.next;
|
|
571
|
+
}
|
|
572
|
+
if (chunk && chunk.edited && chunk.start !== start) throw new Error(`Cannot use replaced character ${start} as slice start anchor.`);
|
|
573
|
+
const startChunk = chunk;
|
|
574
|
+
for (;chunk; ) {
|
|
575
|
+
!chunk.intro || startChunk === chunk && chunk.start !== start || (result += chunk.intro);
|
|
576
|
+
const containsEnd = chunk.start < end && chunk.end >= end;
|
|
577
|
+
if (containsEnd && chunk.edited && chunk.end !== end) throw new Error(`Cannot use replaced character ${end} as slice end anchor.`);
|
|
578
|
+
const sliceStart = startChunk === chunk ? start - chunk.start : 0, sliceEnd = containsEnd ? chunk.content.length + end - chunk.end : chunk.content.length;
|
|
579
|
+
if (result += chunk.content.slice(sliceStart, sliceEnd), !chunk.outro || containsEnd && chunk.end !== end || (result += chunk.outro),
|
|
580
|
+
containsEnd) break;
|
|
581
|
+
chunk = chunk.next;
|
|
582
|
+
}
|
|
583
|
+
return result;
|
|
584
|
+
}
|
|
585
|
+
snip(start, end) {
|
|
586
|
+
const clone = this.clone();
|
|
587
|
+
return clone.remove(0, start), clone.remove(end, clone.original.length), clone;
|
|
588
|
+
}
|
|
589
|
+
_split(index) {
|
|
590
|
+
if (this.byStart[index] || this.byEnd[index]) return;
|
|
591
|
+
let chunk = this.lastSearchedChunk, previousChunk = chunk;
|
|
592
|
+
const searchForward = index > chunk.end;
|
|
593
|
+
for (;chunk; ) {
|
|
594
|
+
if (chunk.contains(index)) return this._splitChunk(chunk, index);
|
|
595
|
+
if (chunk = searchForward ? this.byStart[chunk.end] : this.byEnd[chunk.start], chunk === previousChunk) return;
|
|
596
|
+
previousChunk = chunk;
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
_splitChunk(chunk, index) {
|
|
600
|
+
if (chunk.edited && chunk.content.length) {
|
|
601
|
+
const loc = getLocator(this.original)(index);
|
|
602
|
+
throw new Error(`Cannot split a chunk that has already been edited (${loc.line}:${loc.column} – "${chunk.original}")`);
|
|
603
|
+
}
|
|
604
|
+
const newChunk = chunk.split(index);
|
|
605
|
+
return this.byEnd[index] = chunk, this.byStart[index] = newChunk, this.byEnd[newChunk.end] = newChunk,
|
|
606
|
+
chunk === this.lastChunk && (this.lastChunk = newChunk), this.lastSearchedChunk = chunk,
|
|
607
|
+
!0;
|
|
608
|
+
}
|
|
609
|
+
toString() {
|
|
610
|
+
let str = this.intro, chunk = this.firstChunk;
|
|
611
|
+
for (;chunk; ) str += chunk.toString(), chunk = chunk.next;
|
|
612
|
+
return str + this.outro;
|
|
613
|
+
}
|
|
614
|
+
isEmpty() {
|
|
615
|
+
let chunk = this.firstChunk;
|
|
616
|
+
do {
|
|
617
|
+
if (chunk.intro.length && chunk.intro.trim() || chunk.content.length && chunk.content.trim() || chunk.outro.length && chunk.outro.trim()) return !1;
|
|
618
|
+
} while (chunk = chunk.next);
|
|
619
|
+
return !0;
|
|
620
|
+
}
|
|
621
|
+
length() {
|
|
622
|
+
let chunk = this.firstChunk, length = 0;
|
|
623
|
+
do {
|
|
624
|
+
length += chunk.intro.length + chunk.content.length + chunk.outro.length;
|
|
625
|
+
} while (chunk = chunk.next);
|
|
626
|
+
return length;
|
|
627
|
+
}
|
|
628
|
+
trimLines() {
|
|
629
|
+
return this.trim("[\\r\\n]");
|
|
630
|
+
}
|
|
631
|
+
trim(charType) {
|
|
632
|
+
return this.trimStart(charType).trimEnd(charType);
|
|
633
|
+
}
|
|
634
|
+
trimEndAborted(charType) {
|
|
635
|
+
const rx = new RegExp((charType || "\\s") + "+$");
|
|
636
|
+
if (this.outro = this.outro.replace(rx, ""), this.outro.length) return !0;
|
|
637
|
+
let chunk = this.lastChunk;
|
|
638
|
+
do {
|
|
639
|
+
const end = chunk.end, aborted = chunk.trimEnd(rx);
|
|
640
|
+
if (chunk.end !== end && (this.lastChunk === chunk && (this.lastChunk = chunk.next),
|
|
641
|
+
this.byEnd[chunk.end] = chunk, this.byStart[chunk.next.start] = chunk.next, this.byEnd[chunk.next.end] = chunk.next),
|
|
642
|
+
aborted) return !0;
|
|
643
|
+
chunk = chunk.previous;
|
|
644
|
+
} while (chunk);
|
|
645
|
+
return !1;
|
|
646
|
+
}
|
|
647
|
+
trimEnd(charType) {
|
|
648
|
+
return this.trimEndAborted(charType), this;
|
|
649
|
+
}
|
|
650
|
+
trimStartAborted(charType) {
|
|
651
|
+
const rx = new RegExp("^" + (charType || "\\s") + "+");
|
|
652
|
+
if (this.intro = this.intro.replace(rx, ""), this.intro.length) return !0;
|
|
653
|
+
let chunk = this.firstChunk;
|
|
654
|
+
do {
|
|
655
|
+
const end = chunk.end, aborted = chunk.trimStart(rx);
|
|
656
|
+
if (chunk.end !== end && (chunk === this.lastChunk && (this.lastChunk = chunk.next),
|
|
657
|
+
this.byEnd[chunk.end] = chunk, this.byStart[chunk.next.start] = chunk.next, this.byEnd[chunk.next.end] = chunk.next),
|
|
658
|
+
aborted) return !0;
|
|
659
|
+
chunk = chunk.next;
|
|
660
|
+
} while (chunk);
|
|
661
|
+
return !1;
|
|
662
|
+
}
|
|
663
|
+
trimStart(charType) {
|
|
664
|
+
return this.trimStartAborted(charType), this;
|
|
665
|
+
}
|
|
666
|
+
hasChanged() {
|
|
667
|
+
return this.original !== this.toString();
|
|
668
|
+
}
|
|
669
|
+
_replaceRegexp(searchValue, replacement) {
|
|
670
|
+
function getReplacement(match, str) {
|
|
671
|
+
return "string" == typeof replacement ? replacement.replace(/\$(\$|&|\d+)/g, (_, i) => {
|
|
672
|
+
if ("$" === i) return "$";
|
|
673
|
+
if ("&" === i) return match[0];
|
|
674
|
+
return +i < match.length ? match[+i] : `$${i}`;
|
|
675
|
+
}) : replacement(...match, match.index, str, match.groups);
|
|
676
|
+
}
|
|
677
|
+
if (searchValue.global) {
|
|
678
|
+
(function(re, str) {
|
|
679
|
+
let match;
|
|
680
|
+
const matches = [];
|
|
681
|
+
for (;match = re.exec(str); ) matches.push(match);
|
|
682
|
+
return matches;
|
|
683
|
+
})(searchValue, this.original).forEach(match => {
|
|
684
|
+
if (null != match.index) {
|
|
685
|
+
const replacement = getReplacement(match, this.original);
|
|
686
|
+
replacement !== match[0] && this.overwrite(match.index, match.index + match[0].length, replacement);
|
|
687
|
+
}
|
|
688
|
+
});
|
|
689
|
+
} else {
|
|
690
|
+
const match = this.original.match(searchValue);
|
|
691
|
+
if (match && null != match.index) {
|
|
692
|
+
const replacement = getReplacement(match, this.original);
|
|
693
|
+
replacement !== match[0] && this.overwrite(match.index, match.index + match[0].length, replacement);
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
return this;
|
|
697
|
+
}
|
|
698
|
+
_replaceString(string, replacement) {
|
|
699
|
+
const {original: original} = this, index = original.indexOf(string);
|
|
700
|
+
return -1 !== index && ("function" == typeof replacement && (replacement = replacement(string, index, original)),
|
|
701
|
+
string !== replacement && this.overwrite(index, index + string.length, replacement)),
|
|
702
|
+
this;
|
|
703
|
+
}
|
|
704
|
+
replace(searchValue, replacement) {
|
|
705
|
+
return "string" == typeof searchValue ? this._replaceString(searchValue, replacement) : this._replaceRegexp(searchValue, replacement);
|
|
706
|
+
}
|
|
707
|
+
_replaceAllString(string, replacement) {
|
|
708
|
+
const {original: original} = this, stringLength = string.length;
|
|
709
|
+
for (let index = original.indexOf(string); -1 !== index; index = original.indexOf(string, index + stringLength)) {
|
|
710
|
+
const previous = original.slice(index, index + stringLength);
|
|
711
|
+
let _replacement = replacement;
|
|
712
|
+
"function" == typeof replacement && (_replacement = replacement(previous, index, original)),
|
|
713
|
+
previous !== _replacement && this.overwrite(index, index + stringLength, _replacement);
|
|
714
|
+
}
|
|
715
|
+
return this;
|
|
716
|
+
}
|
|
717
|
+
replaceAll(searchValue, replacement) {
|
|
718
|
+
if ("string" == typeof searchValue) return this._replaceAllString(searchValue, replacement);
|
|
719
|
+
if (!searchValue.global) throw new TypeError("MagicString.prototype.replaceAll called with a non-global RegExp argument");
|
|
720
|
+
return this._replaceRegexp(searchValue, replacement);
|
|
721
|
+
}
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
exports.SourceMap = SourceMap, exports.default = MagicString;
|