@patternfly/patternfly-doc-core 1.13.1 → 1.13.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/.astro/content-modules.mjs +22 -22
- package/.astro/content.d.ts +43 -0
- package/cli/tsDocGen.js +33 -7
- package/dist/cli/tsDocGen.js +26 -6
- package/dist/cli/tsconfig.tsbuildinfo +1 -1
- package/dist/docs/_astro/ClientRouter.astro_astro_type_script_index_0_lang.DZnDNxNb.js +1 -0
- package/dist/docs/_astro/{LiveExample.B5R4Dzng.js → LiveExample.C43dqXje.js} +1 -1
- package/dist/docs/_astro/Navigation.x46lNg3Y.js +1 -0
- package/dist/docs/_astro/{SectionGallery.B0I2mi5J.js → SectionGallery.C8gQa3w3.js} +1 -1
- package/dist/docs/_astro/index.DF2PWfYV.js +16 -0
- package/dist/docs/_worker.js/_@astrojs-ssr-adapter.mjs +1 -1
- package/dist/docs/_worker.js/_astro-internal_middleware.mjs +3 -3
- package/dist/docs/_worker.js/chunks/{_@astro-renderers_D4IG6Oyo.mjs → _@astro-renderers_DuN_RQCZ.mjs} +1 -1
- package/dist/docs/_worker.js/chunks/{_@astrojs-ssr-adapter_B_x81DBq.mjs → _@astrojs-ssr-adapter_BOXzLyxA.mjs} +23 -15
- package/dist/docs/_worker.js/chunks/_astro_assets_COD8WDsm.mjs +1959 -0
- package/dist/docs/_worker.js/chunks/astro/{server_CVEnF9i1.mjs → server_DJAlTAUe.mjs} +126 -72
- package/dist/docs/_worker.js/chunks/{astro-designed-error-pages_CXRddWNa.mjs → astro-designed-error-pages_RucpOaTo.mjs} +52 -22
- package/dist/docs/_worker.js/chunks/consts_47CwkweC.mjs +33 -0
- package/dist/docs/_worker.js/chunks/{index_CYXMeXT4.mjs → index_CzaW3DU8.mjs} +194 -151
- package/dist/docs/_worker.js/chunks/{noop-middleware_DIXVCvyq.mjs → noop-middleware_BUlUjpRM.mjs} +1 -1
- package/dist/docs/_worker.js/chunks/{parse_EttCPxrw.mjs → parse_yL_293SP.mjs} +61 -26
- package/dist/docs/_worker.js/chunks/{path_C-ZOwaTP.mjs → path_u5O9njcM.mjs} +8 -2
- package/dist/docs/_worker.js/chunks/sharp_DdDF6upK.mjs +99 -0
- package/dist/docs/_worker.js/index.js +4 -4
- package/dist/docs/_worker.js/manifest_Cz7n9zdK.mjs +100 -0
- package/dist/docs/_worker.js/pages/_image.astro.mjs +10 -1
- package/dist/docs/_worker.js/pages/props.astro.mjs +1 -1
- package/dist/docs/_worker.js/renderers.mjs +1 -1
- package/dist/docs/components/about-modal/index.html +5 -5
- package/dist/docs/components/about-modal/react/index.html +5 -5
- package/dist/docs/components/accordion/index.html +7 -7
- package/dist/docs/components/accordion/react/index.html +7 -7
- package/dist/docs/components/action-list/index.html +13 -13
- package/dist/docs/components/action-list/react/index.html +13 -13
- package/dist/docs/components/alert/index.html +99 -99
- package/dist/docs/components/alert/react/index.html +99 -99
- package/dist/docs/components/avatar/index.html +5 -5
- package/dist/docs/components/avatar/react/index.html +5 -5
- package/dist/docs/components/back-to-top/index.html +3 -3
- package/dist/docs/components/back-to-top/react/index.html +3 -3
- package/dist/docs/components/backdrop/index.html +7 -7
- package/dist/docs/components/backdrop/react/index.html +7 -7
- package/dist/docs/components/background-image/index.html +7 -7
- package/dist/docs/components/background-image/react/index.html +7 -7
- package/dist/docs/components/badge/index.html +11 -11
- package/dist/docs/components/badge/react/index.html +11 -11
- package/dist/docs/components/banner/index.html +13 -13
- package/dist/docs/components/banner/react/index.html +13 -13
- package/dist/docs/components/brand/index.html +4 -4
- package/dist/docs/components/brand/react/index.html +4 -4
- package/dist/docs/components/breadcrumb/index.html +13 -13
- package/dist/docs/components/breadcrumb/react/index.html +13 -13
- package/dist/docs/components/button/index.html +15 -15
- package/dist/docs/components/button/react/index.html +15 -15
- package/dist/docs/components/calendar-month/index.html +11 -11
- package/dist/docs/components/calendar-month/react/index.html +11 -11
- package/dist/docs/components/card/index.html +20 -20
- package/dist/docs/components/card/react/index.html +20 -20
- package/dist/docs/components/checkbox/index.html +23 -23
- package/dist/docs/components/checkbox/react/index.html +23 -23
- package/dist/docs/components/chip/index.html +6 -6
- package/dist/docs/components/chip/react-deprecated/index.html +6 -6
- package/dist/docs/components/clipboard-copy/index.html +30 -30
- package/dist/docs/components/clipboard-copy/react/index.html +30 -30
- package/dist/docs/components/code-block/index.html +11 -11
- package/dist/docs/components/code-block/react/index.html +11 -11
- package/dist/docs/components/content/index.html +11 -11
- package/dist/docs/components/content/react/index.html +11 -11
- package/dist/docs/components/data-list/index.html +34 -34
- package/dist/docs/components/data-list/react/index.html +34 -34
- package/dist/docs/components/date-picker/index.html +11 -11
- package/dist/docs/components/date-picker/react/index.html +11 -11
- package/dist/docs/components/description-list/index.html +63 -63
- package/dist/docs/components/description-list/react/index.html +63 -63
- package/dist/docs/components/divider/index.html +20 -20
- package/dist/docs/components/divider/react/index.html +20 -20
- package/dist/docs/components/drag-and-drop/index.html +4 -4
- package/dist/docs/components/drag-and-drop/react-deprecated/index.html +4 -4
- package/dist/docs/components/drawer/index.html +47 -47
- package/dist/docs/components/drawer/react/index.html +47 -47
- package/dist/docs/components/dropdown/index.html +24 -24
- package/dist/docs/components/dropdown/react/index.html +24 -24
- package/dist/docs/components/dual-list-selector/index.html +26 -26
- package/dist/docs/components/dual-list-selector/react/index.html +23 -23
- package/dist/docs/components/dual-list-selector/react-deprecated/index.html +35 -35
- package/dist/docs/components/empty-state/index.html +18 -18
- package/dist/docs/components/empty-state/react/index.html +18 -18
- package/dist/docs/components/expandable-section/index.html +23 -23
- package/dist/docs/components/expandable-section/react/index.html +23 -23
- package/dist/docs/components/form/index.html +29 -29
- package/dist/docs/components/form/react/index.html +29 -29
- package/dist/docs/components/form-select/index.html +10 -10
- package/dist/docs/components/form-select/react/index.html +10 -10
- package/dist/docs/components/helper-text/index.html +12 -12
- package/dist/docs/components/helper-text/react/index.html +12 -12
- package/dist/docs/components/hint/index.html +11 -11
- package/dist/docs/components/hint/react/index.html +11 -11
- package/dist/docs/components/icon/index.html +26 -26
- package/dist/docs/components/icon/react/index.html +26 -26
- package/dist/docs/components/input-group/index.html +13 -13
- package/dist/docs/components/input-group/react/index.html +13 -13
- package/dist/docs/components/jump-links/index.html +15 -15
- package/dist/docs/components/jump-links/react/index.html +15 -15
- package/dist/docs/components/label/index.html +41 -41
- package/dist/docs/components/label/react/index.html +41 -41
- package/dist/docs/components/list/index.html +19 -19
- package/dist/docs/components/list/react/index.html +19 -19
- package/dist/docs/components/login-page/index.html +14 -14
- package/dist/docs/components/login-page/react/index.html +14 -14
- package/dist/docs/components/masthead/index.html +26 -26
- package/dist/docs/components/masthead/react/index.html +26 -26
- package/dist/docs/components/menu/index.html +107 -107
- package/dist/docs/components/menu/react/index.html +107 -107
- package/dist/docs/components/menu-toggle/index.html +74 -74
- package/dist/docs/components/menu-toggle/react/index.html +74 -74
- package/dist/docs/components/modal/index.html +56 -56
- package/dist/docs/components/modal/react/index.html +56 -56
- package/dist/docs/components/modal/react-deprecated/index.html +58 -58
- package/dist/docs/components/multiple-file-upload/index.html +31 -31
- package/dist/docs/components/multiple-file-upload/react/index.html +31 -31
- package/dist/docs/components/navigation/index.html +29 -29
- package/dist/docs/components/navigation/react/index.html +29 -29
- package/dist/docs/components/notification-badge/index.html +19 -19
- package/dist/docs/components/notification-badge/react/index.html +19 -19
- package/dist/docs/components/notification-drawer/index.html +8 -8
- package/dist/docs/components/notification-drawer/react/index.html +8 -8
- package/dist/docs/components/number-input/index.html +19 -19
- package/dist/docs/components/number-input/react/index.html +19 -19
- package/dist/docs/components/overflow-menu/index.html +14 -14
- package/dist/docs/components/overflow-menu/react/index.html +14 -14
- package/dist/docs/components/page/index.html +59 -59
- package/dist/docs/components/page/react/index.html +59 -59
- package/dist/docs/components/pagination/index.html +26 -26
- package/dist/docs/components/pagination/react/index.html +26 -26
- package/dist/docs/components/panel/index.html +26 -26
- package/dist/docs/components/panel/react/index.html +26 -26
- package/dist/docs/components/popover/index.html +32 -32
- package/dist/docs/components/popover/react/index.html +32 -32
- package/dist/docs/components/progress/index.html +38 -38
- package/dist/docs/components/progress/react/index.html +38 -38
- package/dist/docs/components/progress-stepper/index.html +21 -21
- package/dist/docs/components/progress-stepper/react/index.html +21 -21
- package/dist/docs/components/radio/index.html +21 -21
- package/dist/docs/components/radio/react/index.html +21 -21
- package/dist/docs/components/search-input/index.html +21 -21
- package/dist/docs/components/search-input/react/index.html +21 -21
- package/dist/docs/components/select/index.html +71 -71
- package/dist/docs/components/select/react/index.html +71 -71
- package/dist/docs/components/sidebar/index.html +26 -26
- package/dist/docs/components/sidebar/react/index.html +26 -26
- package/dist/docs/components/simple-file-upload/index.html +37 -37
- package/dist/docs/components/simple-file-upload/react/index.html +37 -37
- package/dist/docs/components/simple-list/index.html +10 -10
- package/dist/docs/components/simple-list/react/index.html +10 -10
- package/dist/docs/components/skeleton/index.html +15 -15
- package/dist/docs/components/skeleton/react/index.html +15 -15
- package/dist/docs/components/skip-to-content/index.html +4 -4
- package/dist/docs/components/skip-to-content/react/index.html +4 -4
- package/dist/docs/components/slider/index.html +26 -26
- package/dist/docs/components/slider/react/index.html +26 -26
- package/dist/docs/components/spinner/index.html +13 -13
- package/dist/docs/components/spinner/react/index.html +13 -13
- package/dist/docs/components/switch/index.html +18 -18
- package/dist/docs/components/switch/react/index.html +18 -18
- package/dist/docs/components/tabs/index.html +124 -124
- package/dist/docs/components/tabs/react/index.html +124 -124
- package/dist/docs/components/text-area/index.html +25 -25
- package/dist/docs/components/text-area/react/index.html +25 -25
- package/dist/docs/components/text-input/index.html +21 -21
- package/dist/docs/components/text-input/react/index.html +21 -21
- package/dist/docs/components/text-input-group/index.html +18 -18
- package/dist/docs/components/text-input-group/react/index.html +18 -18
- package/dist/docs/components/tile/index.html +8 -8
- package/dist/docs/components/tile/react-deprecated/index.html +8 -8
- package/dist/docs/components/time-picker/index.html +16 -16
- package/dist/docs/components/time-picker/react/index.html +16 -16
- package/dist/docs/components/timestamp/index.html +27 -27
- package/dist/docs/components/timestamp/react/index.html +27 -27
- package/dist/docs/components/title/index.html +9 -9
- package/dist/docs/components/title/react/index.html +9 -9
- package/dist/docs/components/toggle-group/index.html +26 -26
- package/dist/docs/components/toggle-group/react/index.html +26 -26
- package/dist/docs/components/toolbar/index.html +52 -52
- package/dist/docs/components/toolbar/react/index.html +52 -52
- package/dist/docs/components/tooltip/index.html +17 -17
- package/dist/docs/components/tooltip/react/index.html +17 -17
- package/dist/docs/components/tree-view/index.html +34 -34
- package/dist/docs/components/tree-view/react/index.html +34 -34
- package/dist/docs/components/truncate/index.html +11 -11
- package/dist/docs/components/truncate/react/index.html +11 -11
- package/dist/docs/components/wizard/index.html +21 -21
- package/dist/docs/components/wizard/react/index.html +49 -49
- package/dist/docs/components/wizard/react-deprecated/index.html +13 -13
- package/dist/docs/index.html +2 -2
- package/dist/props.json +1 -1
- package/package.json +8 -8
- package/src/components/Navigation.tsx +1 -1
- package/dist/docs/_astro/ClientRouter.astro_astro_type_script_index_0_lang.CtSceO8m.js +0 -1
- package/dist/docs/_astro/Navigation.B2RHZcqO.js +0 -1
- package/dist/docs/_astro/index.DGdw5tfb.js +0 -16
- package/dist/docs/_worker.js/chunks/content-modules_PMz0mfKv.mjs +0 -1
- package/dist/docs/_worker.js/chunks/sharp_CXlY1snz.mjs +0 -1
- package/dist/docs/_worker.js/manifest_CJjpUQ_9.mjs +0 -100
- /package/dist/docs/_worker.js/chunks/{AboutModal_CrdYiVZ2.mjs → AboutModal_Bq3UkWc8.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{AboutModal_D3R-r6ju.mjs → AboutModal_DZETQtiE.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Accordion_Dbx8tdfD.mjs → Accordion_ChuDfd26.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Accordion_sjy0EnPK.mjs → Accordion_DRoasdwW.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{ActionList_Bx7eAKgV.mjs → ActionList_DqDNZT3u.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{ActionList_CuygbYGp.mjs → ActionList_pAt5URX0.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Alert_Cgh0pfMA.mjs → Alert_CPdL1vUD.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Alert_CplJ22O9.mjs → Alert_DwPYvJAI.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Avatar_BszzDSZB.mjs → Avatar_BdN2tI4Z.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Avatar_DuNXB-Tl.mjs → Avatar_DjnLfcKy.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{BackToTop_B_0NN1kJ.mjs → BackToTop_B7k52guD.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{BackToTop_DKY1zHBL.mjs → BackToTop_CQrkN4vo.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Backdrop_ByJvccKQ.mjs → Backdrop_Bw8DXuQW.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Backdrop_D12wBLrB.mjs → Backdrop_D5VKp0Pn.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{BackgroundImage_7zaRIuh-.mjs → BackgroundImage_B95WtDtI.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{BackgroundImage_BFUrU51J.mjs → BackgroundImage_D25W0eG4.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Badge_DloPmeMn.mjs → Badge_9BXEKeIX.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Badge_DxGDbEGv.mjs → Badge_DY7mAZxX.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Banner_4Te4yy7I.mjs → Banner_BBMun_pf.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Banner_FbFCGml0.mjs → Banner_Bzf9E_Yg.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Brand_Cjeb58fX.mjs → Brand_BpBKJkui.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Brand_DZEvbkMH.mjs → Brand_BvV48K7K.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Breadcrumb_DkNDUMw0.mjs → Breadcrumb_7xVGXyOH.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Breadcrumb_bVSwIfTk.mjs → Breadcrumb_D0B5NecG.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Button_BqggYTWh.mjs → Button_B-jQM-mS.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Button_DbZb-z5h.mjs → Button_D4xV2ZHx.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{CalendarMonth_BdoIQD1o.mjs → CalendarMonth_BPH-iWlS.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{CalendarMonth_BqZc2rYW.mjs → CalendarMonth_CtyCDM_4.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Card_BW6WmwTW.mjs → Card_56uPtmT4.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Card_CEDol7Xx.mjs → Card_BL_KFAWY.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Checkbox_BqVpiIvF.mjs → Checkbox_CM-N3RVv.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Checkbox_DSYhfv7p.mjs → Checkbox_DaX-zjAc.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Chip_BciXepRF.mjs → Chip_BpeES5rc.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Chip_C23BxFTk.mjs → Chip_UaJGmwLY.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{ClipboardCopy_BjySfoK1.mjs → ClipboardCopy_761fbT2Y.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{ClipboardCopy_CvrD2b3T.mjs → ClipboardCopy_BHFbqYI-.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{CodeBlock_CuH1PrfL.mjs → CodeBlock_CwKrtp-D.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{CodeBlock_DK5AauFn.mjs → CodeBlock_DOqKbnLY.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Content_BfZIFUr8.mjs → Content_0CWGm4rN.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Content_lBUC3eEp.mjs → Content_CLL8cKDM.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{DataList_CSJAkMMZ.mjs → DataList_BN8khk3S.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{DataList_CaFvg0uz.mjs → DataList_CDy650B7.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{DatePicker_Cw2abdEU.mjs → DatePicker_BQOndvp6.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{DatePicker_bYwsFHXL.mjs → DatePicker_DpTevTA0.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{DescriptionList_BTTyevMb.mjs → DescriptionList_BJ6vItOU.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{DescriptionList_Dr51d-67.mjs → DescriptionList_CtWKTF3e.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Divider_BgOt1--F.mjs → Divider_CB0eK6ED.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Divider_Bh7n4QTo.mjs → Divider_CYqs87wx.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{DragDrop_BF-aF6Z8.mjs → DragDrop_CA9eI_rd.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{DragDrop_DId590rN.mjs → DragDrop_hMbQYdDP.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Drawer_BVywTMVo.mjs → Drawer_DNl2avZP.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Drawer_RrCnySEa.mjs → Drawer_QrI_Bnwl.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Dropdown_BjtqviYW.mjs → Dropdown_DN6hLqJ9.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Dropdown_GiUvjFPw.mjs → Dropdown_VLF3XzpL.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{DualListSelector_8uLukfP0.mjs → DualListSelector_BKTQQnIz.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{DualListSelector_Bgj1IWqe.mjs → DualListSelector_BlKIcmLH.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{DualListSelector_C5QjTplp.mjs → DualListSelector_CLgp74Kh.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{DualListSelector_DLgspM0s.mjs → DualListSelector_DhE2Hwgc.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{EmptyState_Ct_PJba3.mjs → EmptyState_CyuMXV7z.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{EmptyState_Dk3hKJlg.mjs → EmptyState__skv13AF.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{ExpandableSection_DSw76PjZ.mjs → ExpandableSection_CW95SdOW.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{ExpandableSection_vUQO3FgG.mjs → ExpandableSection_yNWV4j_1.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{FileUpload_CEvZ0G-d.mjs → FileUpload_BB5VBmj8.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{FileUpload_Ci_s8Ghd.mjs → FileUpload_Dz6qx2Au.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{FormSelect_C2YPRAlw.mjs → FormSelect_CMF2Pw8r.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{FormSelect_DWShl8Fb.mjs → FormSelect_ImdHPQ8r.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Form_Dyb98Nez.mjs → Form_BlqSvroo.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Form_olaoRN4o.mjs → Form_Dyfbp-xB.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{HelperText_2CcHVaih.mjs → HelperText_I6gDmQuM.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{HelperText_DthGttZo.mjs → HelperText_iuAAuAAX.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Hint_BXDZKYhJ.mjs → Hint_CmH0eX8e.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Hint_DHoiYdn6.mjs → Hint_JlGz6qCF.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Icon_C4IPnIAg.mjs → Icon_CVgO9TfB.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Icon_C_Dqbg9w.mjs → Icon_I_Jxay-o.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{InputGroup_CDKP-uXZ.mjs → InputGroup_C1qnMb39.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{InputGroup_CmZgaEyr.mjs → InputGroup_CO4BbgKK.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{JumpLinks_DvM3PVg0.mjs → JumpLinks_B6V7Oept.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{JumpLinks_Dvdlxdps.mjs → JumpLinks_xK6Xtd_P.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Label_C7fP9Jp9.mjs → Label_DDNQOBjJ.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Label_Cxir7_Q4.mjs → Label_DV6JdsMd.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{List_CUgwFnXa.mjs → List_BXSnNYCk.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{List_CWAsiYnN.mjs → List_D6-bxLhY.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{LoginPage_BDfliKtU.mjs → LoginPage_-uTxWToD.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{LoginPage_BjIl_nF9.mjs → LoginPage_C4Fpi4_3.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Masthead_BWjm5CFj.mjs → Masthead_rYGQQQdw.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Masthead_BZnYzDu_.mjs → Masthead_rpdMuWpg.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{MenuToggle_DeKwv469.mjs → MenuToggle_Cij7zNik.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{MenuToggle_DmJISlPR.mjs → MenuToggle_DVmAV48i.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Menu_DRRoq5PM.mjs → Menu_XN6Bsy-K.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Menu_Sl-QVQ_w.mjs → Menu_dxw3tZmM.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Modal_6WZzoDHU.mjs → Modal_BDIrTlau.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Modal_BI2dVPRJ.mjs → Modal_BbXa3EV6.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Modal_CdokBUDP.mjs → Modal_DXt8fdwv.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Modal_DJRobnfc.mjs → Modal_ya4p_Dn4.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{MultipleFileUpload_BaHVtkF_.mjs → MultipleFileUpload_BY7N0d2_.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{MultipleFileUpload_BznvLbsj.mjs → MultipleFileUpload_CJirO2Tv.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Nav_DwqATcJ4.mjs → Nav_B9aNkM3u.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Nav_GZ0nRYXE.mjs → Nav_Cv7y3tKr.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{NotificationBadge_DO4OLgvO.mjs → NotificationBadge_BdyrqrxS.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{NotificationBadge_DjINhOQ5.mjs → NotificationBadge_uLLBi7Nf.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{NotificationDrawer_BtpQ4pmZ.mjs → NotificationDrawer_C2D_vkJA.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{NotificationDrawer_D1lmMCgd.mjs → NotificationDrawer_DsOv-Bc1.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{NumberInput_CggpJ5ge.mjs → NumberInput_C_v8A68W.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{NumberInput_zMcSUUwH.mjs → NumberInput_M2Arq19A.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{OverflowMenu_BX4nwFvK.mjs → OverflowMenu_CgQ02tet.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{OverflowMenu_DnQ7wMy-.mjs → OverflowMenu_GhL_Hxhj.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Page_Cw_XTB6Y.mjs → Page_BmNS_HKl.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Page_UhywZXdY.mjs → Page_BqhHgZEf.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Pagination_7rr0n7-V.mjs → Pagination_6zsdJgjo.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Pagination_Dc5L6yaI.mjs → Pagination_EnfXcy1c.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Panel_Bl_LqCWS.mjs → Panel_Bns9Yczb.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Panel_s8-TwBlS.mjs → Panel_CAl9TttI.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Popover_CjipqBWs.mjs → Popover_Cq5GlG_u.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Popover_DvQgGJTf.mjs → Popover_DNBqVY6K.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{ProgressStepper_DXBI4K2w.mjs → ProgressStepper_Bj7xdcVW.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{ProgressStepper_lBd5mTHE.mjs → ProgressStepper_DLwBtQPD.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Progress_BZA5taDC.mjs → Progress_Bwa6IFCG.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Progress_CIgybc-D.mjs → Progress_Ct2ZmHWP.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Radio_3tPx1coq.mjs → Radio_BW36RoyQ.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Radio_BG7VZAk6.mjs → Radio_CD1tbLUH.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{SearchInput_BZ43-Elo.mjs → SearchInput_C5t7rgL8.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{SearchInput_aCFv-N1U.mjs → SearchInput_D5zVWGRR.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Select_B4cumL7U.mjs → Select_B7PClV22.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Select_CJ78kBVM.mjs → Select_DxSAnryc.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Sidebar_Bto2_gKJ.mjs → Sidebar_CBHc_qDs.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Sidebar_DOfifBRA.mjs → Sidebar_CUsSON01.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{SimpleList_CVkO5Odp.mjs → SimpleList_A4ZllarK.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{SimpleList_oJajk3_z.mjs → SimpleList_CA6-eKv7.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Skeleton_CCJNka-d.mjs → Skeleton_BCcNwA3X.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Skeleton_N02yA_k6.mjs → Skeleton_ppLKyrxA.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{SkipToContent_DvOYRCWm.mjs → SkipToContent_BRt-mxN_.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{SkipToContent_o7vh-U_u.mjs → SkipToContent_DJ0j9iWN.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Slider_C0bH-JMY.mjs → Slider_C9b3jjeF.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Slider_CWRDqhx4.mjs → Slider_XCexzUeI.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Spinner_B-x8bJt0.mjs → Spinner_9AYi3VBw.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Spinner_hzAAbZdS.mjs → Spinner_CP9Rq_gX.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Switch_Cpr1OETy.mjs → Switch_DXdLGDOE.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Switch_Du7AKJ4O.mjs → Switch_RNh98qtJ.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Tabs_CzDrfKA-.mjs → Tabs_DT6Yi6be.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Tabs_KXDkISY4.mjs → Tabs_DlM_bjlT.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{TextArea_C1dmG8mr.mjs → TextArea_Cf_R8jQK.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{TextArea_Dtm0m8LO.mjs → TextArea_ovxC_0Ab.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{TextInputGroup_D0NXU95v.mjs → TextInputGroup_080YBtEj.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{TextInputGroup_mJpBrogC.mjs → TextInputGroup_Br_i0HvU.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{TextInput_B0XLYaVA.mjs → TextInput_Db5MQT0r.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{TextInput_CmLcsUiv.mjs → TextInput_DmvzGSiB.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Tile_CF_12LPU.mjs → Tile_DSLiQefE.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Tile_DJ0LawLW.mjs → Tile_DuVi0Nxx.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{TimePicker_CijfSKJQ.mjs → TimePicker_DRkouY7Y.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{TimePicker_VX9VE-Uy.mjs → TimePicker_qLqDQt66.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Timestamp_D7uyrIK7.mjs → Timestamp_Bm1TmV0u.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Timestamp_c2Mozpr4.mjs → Timestamp_ByppCUVl.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Title_DbrwFEEy.mjs → Title_CbgR81X9.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Title_DlFn7G9R.mjs → Title_DEeLRIBp.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{ToggleGroup_DpLWzfAW.mjs → ToggleGroup_CLcoYGlf.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{ToggleGroup_j1ooRpX3.mjs → ToggleGroup_DZfpRXld.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Toolbar_BEIh7r7J.mjs → Toolbar_Ckexja0f.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Toolbar_mjrD3_l-.mjs → Toolbar_WEvlPE_Z.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Tooltip_Bp5XOVoV.mjs → Tooltip_ByLTXbvB.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Tooltip_BrFKk02i.mjs → Tooltip_C50yThxC.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{TreeView_BImfKPD_.mjs → TreeView_BepL2dW_.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{TreeView_CgO4iC1E.mjs → TreeView_CF9fMfij.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Truncate_Bn55QoeZ.mjs → Truncate_B5tvwEJU.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Truncate_S939OotH.mjs → Truncate_fFugxOSE.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Wizard_B28f3non.mjs → Wizard_BZDTr1GR.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Wizard_B4Dw5Yc8.mjs → Wizard_Bo1prwt4.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Wizard_BOCBVIjJ.mjs → Wizard_CUdz0SC3.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{Wizard_C2sit354.mjs → Wizard_CgLDSR4C.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{_astro_assets_gAZzkAab.mjs → _astro_data-layer-content_aS8_cRFJ.mjs} +0 -0
- /package/dist/docs/_worker.js/chunks/{_astro_data-layer-content_Dvh2cBdG.mjs → content-modules_BkNrgIXI.mjs} +0 -0
|
@@ -0,0 +1,1959 @@
|
|
|
1
|
+
globalThis.process ??= {}; globalThis.process.env ??= {};
|
|
2
|
+
import { j as joinPaths, i as isRemotePath } from './path_u5O9njcM.mjs';
|
|
3
|
+
import { A as AstroError, av as ExpectedImage, aw as LocalImageUsedWrongly, ax as MissingImageDimension, ay as UnsupportedImageFormat, az as IncompatibleDescriptorOptions, aA as UnsupportedImageConversion, aB as toStyleString, aC as NoImageMetadata, aD as FailedToFetchRemoteImageDimensions, aE as ExpectedImageOptions, aF as ExpectedNotESMImage, aG as InvalidImageService, c as createComponent, a as createAstro, aH as ImageMissingAlt, m as maybeRenderHead, d as addAttribute, aI as spreadAttributes, b as renderTemplate, aJ as ExperimentalFontsNotEnabled, aK as FontFamilyNotFound, u as unescapeHTML } from './astro/server_DJAlTAUe.mjs';
|
|
4
|
+
import { D as DEFAULT_OUTPUT_FORMAT, a as VALID_SUPPORTED_FORMATS, b as DEFAULT_HASH_PROPS } from './consts_47CwkweC.mjs';
|
|
5
|
+
|
|
6
|
+
const DEFAULT_RESOLUTIONS = [
|
|
7
|
+
640,
|
|
8
|
+
// older and lower-end phones
|
|
9
|
+
750,
|
|
10
|
+
// iPhone 6-8
|
|
11
|
+
828,
|
|
12
|
+
// iPhone XR/11
|
|
13
|
+
960,
|
|
14
|
+
// older horizontal phones
|
|
15
|
+
1080,
|
|
16
|
+
// iPhone 6-8 Plus
|
|
17
|
+
1280,
|
|
18
|
+
// 720p
|
|
19
|
+
1668,
|
|
20
|
+
// Various iPads
|
|
21
|
+
1920,
|
|
22
|
+
// 1080p
|
|
23
|
+
2048,
|
|
24
|
+
// QXGA
|
|
25
|
+
2560,
|
|
26
|
+
// WQXGA
|
|
27
|
+
3200,
|
|
28
|
+
// QHD+
|
|
29
|
+
3840,
|
|
30
|
+
// 4K
|
|
31
|
+
4480,
|
|
32
|
+
// 4.5K
|
|
33
|
+
5120,
|
|
34
|
+
// 5K
|
|
35
|
+
6016
|
|
36
|
+
// 6K
|
|
37
|
+
];
|
|
38
|
+
const LIMITED_RESOLUTIONS = [
|
|
39
|
+
640,
|
|
40
|
+
// older and lower-end phones
|
|
41
|
+
750,
|
|
42
|
+
// iPhone 6-8
|
|
43
|
+
828,
|
|
44
|
+
// iPhone XR/11
|
|
45
|
+
1080,
|
|
46
|
+
// iPhone 6-8 Plus
|
|
47
|
+
1280,
|
|
48
|
+
// 720p
|
|
49
|
+
1668,
|
|
50
|
+
// Various iPads
|
|
51
|
+
2048,
|
|
52
|
+
// QXGA
|
|
53
|
+
2560
|
|
54
|
+
// WQXGA
|
|
55
|
+
];
|
|
56
|
+
const getWidths = ({
|
|
57
|
+
width,
|
|
58
|
+
layout,
|
|
59
|
+
breakpoints = DEFAULT_RESOLUTIONS,
|
|
60
|
+
originalWidth
|
|
61
|
+
}) => {
|
|
62
|
+
const smallerThanOriginal = (w) => !originalWidth || w <= originalWidth;
|
|
63
|
+
if (layout === "full-width") {
|
|
64
|
+
return breakpoints.filter(smallerThanOriginal);
|
|
65
|
+
}
|
|
66
|
+
if (!width) {
|
|
67
|
+
return [];
|
|
68
|
+
}
|
|
69
|
+
const doubleWidth = width * 2;
|
|
70
|
+
const maxSize = originalWidth ? Math.min(doubleWidth, originalWidth) : doubleWidth;
|
|
71
|
+
if (layout === "fixed") {
|
|
72
|
+
return originalWidth && width > originalWidth ? [originalWidth] : [width, maxSize];
|
|
73
|
+
}
|
|
74
|
+
if (layout === "constrained") {
|
|
75
|
+
return [
|
|
76
|
+
// Always include the image at 1x and 2x the specified width
|
|
77
|
+
width,
|
|
78
|
+
doubleWidth,
|
|
79
|
+
...breakpoints
|
|
80
|
+
].filter((w) => w <= maxSize).sort((a, b) => a - b);
|
|
81
|
+
}
|
|
82
|
+
return [];
|
|
83
|
+
};
|
|
84
|
+
const getSizesAttribute = ({
|
|
85
|
+
width,
|
|
86
|
+
layout
|
|
87
|
+
}) => {
|
|
88
|
+
if (!width || !layout) {
|
|
89
|
+
return void 0;
|
|
90
|
+
}
|
|
91
|
+
switch (layout) {
|
|
92
|
+
// If screen is wider than the max size then image width is the max size,
|
|
93
|
+
// otherwise it's the width of the screen
|
|
94
|
+
case "constrained":
|
|
95
|
+
return `(min-width: ${width}px) ${width}px, 100vw`;
|
|
96
|
+
// Image is always the same width, whatever the size of the screen
|
|
97
|
+
case "fixed":
|
|
98
|
+
return `${width}px`;
|
|
99
|
+
// Image is always the width of the screen
|
|
100
|
+
case "full-width":
|
|
101
|
+
return `100vw`;
|
|
102
|
+
case "none":
|
|
103
|
+
default:
|
|
104
|
+
return void 0;
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
function matchPattern(url, remotePattern) {
|
|
109
|
+
return matchProtocol(url, remotePattern.protocol) && matchHostname(url, remotePattern.hostname, true) && matchPort(url, remotePattern.port) && matchPathname(url, remotePattern.pathname, true);
|
|
110
|
+
}
|
|
111
|
+
function matchPort(url, port) {
|
|
112
|
+
return !port || port === url.port;
|
|
113
|
+
}
|
|
114
|
+
function matchProtocol(url, protocol) {
|
|
115
|
+
return !protocol || protocol === url.protocol.slice(0, -1);
|
|
116
|
+
}
|
|
117
|
+
function matchHostname(url, hostname, allowWildcard = false) {
|
|
118
|
+
if (!hostname) {
|
|
119
|
+
return true;
|
|
120
|
+
} else if (!allowWildcard || !hostname.startsWith("*")) {
|
|
121
|
+
return hostname === url.hostname;
|
|
122
|
+
} else if (hostname.startsWith("**.")) {
|
|
123
|
+
const slicedHostname = hostname.slice(2);
|
|
124
|
+
return slicedHostname !== url.hostname && url.hostname.endsWith(slicedHostname);
|
|
125
|
+
} else if (hostname.startsWith("*.")) {
|
|
126
|
+
const slicedHostname = hostname.slice(1);
|
|
127
|
+
const additionalSubdomains = url.hostname.replace(slicedHostname, "").split(".").filter(Boolean);
|
|
128
|
+
return additionalSubdomains.length === 1;
|
|
129
|
+
}
|
|
130
|
+
return false;
|
|
131
|
+
}
|
|
132
|
+
function matchPathname(url, pathname, allowWildcard = false) {
|
|
133
|
+
if (!pathname) {
|
|
134
|
+
return true;
|
|
135
|
+
} else if (!allowWildcard || !pathname.endsWith("*")) {
|
|
136
|
+
return pathname === url.pathname;
|
|
137
|
+
} else if (pathname.endsWith("/**")) {
|
|
138
|
+
const slicedPathname = pathname.slice(0, -2);
|
|
139
|
+
return slicedPathname !== url.pathname && url.pathname.startsWith(slicedPathname);
|
|
140
|
+
} else if (pathname.endsWith("/*")) {
|
|
141
|
+
const slicedPathname = pathname.slice(0, -1);
|
|
142
|
+
const additionalPathChunks = url.pathname.replace(slicedPathname, "").split("/").filter(Boolean);
|
|
143
|
+
return additionalPathChunks.length === 1;
|
|
144
|
+
}
|
|
145
|
+
return false;
|
|
146
|
+
}
|
|
147
|
+
function isRemoteAllowed(src, {
|
|
148
|
+
domains,
|
|
149
|
+
remotePatterns
|
|
150
|
+
}) {
|
|
151
|
+
if (!URL.canParse(src)) {
|
|
152
|
+
return false;
|
|
153
|
+
}
|
|
154
|
+
const url = new URL(src);
|
|
155
|
+
return domains.some((domain) => matchHostname(url, domain)) || remotePatterns.some((remotePattern) => matchPattern(url, remotePattern));
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
function isESMImportedImage(src) {
|
|
159
|
+
return typeof src === "object" || typeof src === "function" && "src" in src;
|
|
160
|
+
}
|
|
161
|
+
function isRemoteImage(src) {
|
|
162
|
+
return typeof src === "string";
|
|
163
|
+
}
|
|
164
|
+
async function resolveSrc(src) {
|
|
165
|
+
if (typeof src === "object" && "then" in src) {
|
|
166
|
+
const resource = await src;
|
|
167
|
+
return resource.default ?? resource;
|
|
168
|
+
}
|
|
169
|
+
return src;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
function isLocalService(service) {
|
|
173
|
+
if (!service) {
|
|
174
|
+
return false;
|
|
175
|
+
}
|
|
176
|
+
return "transform" in service;
|
|
177
|
+
}
|
|
178
|
+
function parseQuality(quality) {
|
|
179
|
+
let result = parseInt(quality);
|
|
180
|
+
if (Number.isNaN(result)) {
|
|
181
|
+
return quality;
|
|
182
|
+
}
|
|
183
|
+
return result;
|
|
184
|
+
}
|
|
185
|
+
const sortNumeric = (a, b) => a - b;
|
|
186
|
+
const baseService = {
|
|
187
|
+
validateOptions(options) {
|
|
188
|
+
if (!options.src || !isRemoteImage(options.src) && !isESMImportedImage(options.src)) {
|
|
189
|
+
throw new AstroError({
|
|
190
|
+
...ExpectedImage,
|
|
191
|
+
message: ExpectedImage.message(
|
|
192
|
+
JSON.stringify(options.src),
|
|
193
|
+
typeof options.src,
|
|
194
|
+
JSON.stringify(options, (_, v) => v === void 0 ? null : v)
|
|
195
|
+
)
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
if (!isESMImportedImage(options.src)) {
|
|
199
|
+
if (options.src.startsWith("/@fs/") || !isRemotePath(options.src) && !options.src.startsWith("/")) {
|
|
200
|
+
throw new AstroError({
|
|
201
|
+
...LocalImageUsedWrongly,
|
|
202
|
+
message: LocalImageUsedWrongly.message(options.src)
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
let missingDimension;
|
|
206
|
+
if (!options.width && !options.height) {
|
|
207
|
+
missingDimension = "both";
|
|
208
|
+
} else if (!options.width && options.height) {
|
|
209
|
+
missingDimension = "width";
|
|
210
|
+
} else if (options.width && !options.height) {
|
|
211
|
+
missingDimension = "height";
|
|
212
|
+
}
|
|
213
|
+
if (missingDimension) {
|
|
214
|
+
throw new AstroError({
|
|
215
|
+
...MissingImageDimension,
|
|
216
|
+
message: MissingImageDimension.message(missingDimension, options.src)
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
} else {
|
|
220
|
+
if (!VALID_SUPPORTED_FORMATS.includes(options.src.format)) {
|
|
221
|
+
throw new AstroError({
|
|
222
|
+
...UnsupportedImageFormat,
|
|
223
|
+
message: UnsupportedImageFormat.message(
|
|
224
|
+
options.src.format,
|
|
225
|
+
options.src.src,
|
|
226
|
+
VALID_SUPPORTED_FORMATS
|
|
227
|
+
)
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
if (options.widths && options.densities) {
|
|
231
|
+
throw new AstroError(IncompatibleDescriptorOptions);
|
|
232
|
+
}
|
|
233
|
+
if (options.src.format === "svg") {
|
|
234
|
+
options.format = "svg";
|
|
235
|
+
}
|
|
236
|
+
if (options.src.format === "svg" && options.format !== "svg" || options.src.format !== "svg" && options.format === "svg") {
|
|
237
|
+
throw new AstroError(UnsupportedImageConversion);
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
if (!options.format) {
|
|
241
|
+
options.format = DEFAULT_OUTPUT_FORMAT;
|
|
242
|
+
}
|
|
243
|
+
if (options.width) options.width = Math.round(options.width);
|
|
244
|
+
if (options.height) options.height = Math.round(options.height);
|
|
245
|
+
if (options.layout && options.width && options.height) {
|
|
246
|
+
options.fit ??= "cover";
|
|
247
|
+
delete options.layout;
|
|
248
|
+
}
|
|
249
|
+
if (options.fit === "none") {
|
|
250
|
+
delete options.fit;
|
|
251
|
+
}
|
|
252
|
+
return options;
|
|
253
|
+
},
|
|
254
|
+
getHTMLAttributes(options) {
|
|
255
|
+
const { targetWidth, targetHeight } = getTargetDimensions(options);
|
|
256
|
+
const {
|
|
257
|
+
src,
|
|
258
|
+
width,
|
|
259
|
+
height,
|
|
260
|
+
format,
|
|
261
|
+
quality,
|
|
262
|
+
densities,
|
|
263
|
+
widths,
|
|
264
|
+
formats,
|
|
265
|
+
layout,
|
|
266
|
+
priority,
|
|
267
|
+
fit,
|
|
268
|
+
position,
|
|
269
|
+
...attributes
|
|
270
|
+
} = options;
|
|
271
|
+
return {
|
|
272
|
+
...attributes,
|
|
273
|
+
width: targetWidth,
|
|
274
|
+
height: targetHeight,
|
|
275
|
+
loading: attributes.loading ?? "lazy",
|
|
276
|
+
decoding: attributes.decoding ?? "async"
|
|
277
|
+
};
|
|
278
|
+
},
|
|
279
|
+
getSrcSet(options) {
|
|
280
|
+
const { targetWidth, targetHeight } = getTargetDimensions(options);
|
|
281
|
+
const aspectRatio = targetWidth / targetHeight;
|
|
282
|
+
const { widths, densities } = options;
|
|
283
|
+
const targetFormat = options.format ?? DEFAULT_OUTPUT_FORMAT;
|
|
284
|
+
let transformedWidths = (widths ?? []).sort(sortNumeric);
|
|
285
|
+
let imageWidth = options.width;
|
|
286
|
+
let maxWidth = Infinity;
|
|
287
|
+
if (isESMImportedImage(options.src)) {
|
|
288
|
+
imageWidth = options.src.width;
|
|
289
|
+
maxWidth = imageWidth;
|
|
290
|
+
if (transformedWidths.length > 0 && transformedWidths.at(-1) > maxWidth) {
|
|
291
|
+
transformedWidths = transformedWidths.filter((width) => width <= maxWidth);
|
|
292
|
+
transformedWidths.push(maxWidth);
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
transformedWidths = Array.from(new Set(transformedWidths));
|
|
296
|
+
const {
|
|
297
|
+
width: transformWidth,
|
|
298
|
+
height: transformHeight,
|
|
299
|
+
...transformWithoutDimensions
|
|
300
|
+
} = options;
|
|
301
|
+
let allWidths = [];
|
|
302
|
+
if (densities) {
|
|
303
|
+
const densityValues = densities.map((density) => {
|
|
304
|
+
if (typeof density === "number") {
|
|
305
|
+
return density;
|
|
306
|
+
} else {
|
|
307
|
+
return parseFloat(density);
|
|
308
|
+
}
|
|
309
|
+
});
|
|
310
|
+
const densityWidths = densityValues.sort(sortNumeric).map((density) => Math.round(targetWidth * density));
|
|
311
|
+
allWidths = densityWidths.map((width, index) => ({
|
|
312
|
+
width,
|
|
313
|
+
descriptor: `${densityValues[index]}x`
|
|
314
|
+
}));
|
|
315
|
+
} else if (transformedWidths.length > 0) {
|
|
316
|
+
allWidths = transformedWidths.map((width) => ({
|
|
317
|
+
width,
|
|
318
|
+
descriptor: `${width}w`
|
|
319
|
+
}));
|
|
320
|
+
}
|
|
321
|
+
return allWidths.map(({ width, descriptor }) => {
|
|
322
|
+
const height = Math.round(width / aspectRatio);
|
|
323
|
+
const transform = { ...transformWithoutDimensions, width, height };
|
|
324
|
+
return {
|
|
325
|
+
transform,
|
|
326
|
+
descriptor,
|
|
327
|
+
attributes: {
|
|
328
|
+
type: `image/${targetFormat}`
|
|
329
|
+
}
|
|
330
|
+
};
|
|
331
|
+
});
|
|
332
|
+
},
|
|
333
|
+
getURL(options, imageConfig) {
|
|
334
|
+
const searchParams = new URLSearchParams();
|
|
335
|
+
if (isESMImportedImage(options.src)) {
|
|
336
|
+
searchParams.append("href", options.src.src);
|
|
337
|
+
} else if (isRemoteAllowed(options.src, imageConfig)) {
|
|
338
|
+
searchParams.append("href", options.src);
|
|
339
|
+
} else {
|
|
340
|
+
return options.src;
|
|
341
|
+
}
|
|
342
|
+
const params = {
|
|
343
|
+
w: "width",
|
|
344
|
+
h: "height",
|
|
345
|
+
q: "quality",
|
|
346
|
+
f: "format",
|
|
347
|
+
fit: "fit",
|
|
348
|
+
position: "position"
|
|
349
|
+
};
|
|
350
|
+
Object.entries(params).forEach(([param, key]) => {
|
|
351
|
+
options[key] && searchParams.append(param, options[key].toString());
|
|
352
|
+
});
|
|
353
|
+
const imageEndpoint = joinPaths("/", imageConfig.endpoint.route);
|
|
354
|
+
return `${imageEndpoint}?${searchParams}`;
|
|
355
|
+
},
|
|
356
|
+
parseURL(url) {
|
|
357
|
+
const params = url.searchParams;
|
|
358
|
+
if (!params.has("href")) {
|
|
359
|
+
return void 0;
|
|
360
|
+
}
|
|
361
|
+
const transform = {
|
|
362
|
+
src: params.get("href"),
|
|
363
|
+
width: params.has("w") ? parseInt(params.get("w")) : void 0,
|
|
364
|
+
height: params.has("h") ? parseInt(params.get("h")) : void 0,
|
|
365
|
+
format: params.get("f"),
|
|
366
|
+
quality: params.get("q"),
|
|
367
|
+
fit: params.get("fit"),
|
|
368
|
+
position: params.get("position") ?? void 0
|
|
369
|
+
};
|
|
370
|
+
return transform;
|
|
371
|
+
}
|
|
372
|
+
};
|
|
373
|
+
function getTargetDimensions(options) {
|
|
374
|
+
let targetWidth = options.width;
|
|
375
|
+
let targetHeight = options.height;
|
|
376
|
+
if (isESMImportedImage(options.src)) {
|
|
377
|
+
const aspectRatio = options.src.width / options.src.height;
|
|
378
|
+
if (targetHeight && !targetWidth) {
|
|
379
|
+
targetWidth = Math.round(targetHeight * aspectRatio);
|
|
380
|
+
} else if (targetWidth && !targetHeight) {
|
|
381
|
+
targetHeight = Math.round(targetWidth / aspectRatio);
|
|
382
|
+
} else if (!targetWidth && !targetHeight) {
|
|
383
|
+
targetWidth = options.src.width;
|
|
384
|
+
targetHeight = options.src.height;
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
return {
|
|
388
|
+
targetWidth,
|
|
389
|
+
targetHeight
|
|
390
|
+
};
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
function isImageMetadata(src) {
|
|
394
|
+
return src.fsPath && !("fsPath" in src);
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
const cssFitValues = ["fill", "contain", "cover", "scale-down"];
|
|
398
|
+
function addCSSVarsToStyle(vars, styles) {
|
|
399
|
+
const cssVars = Object.entries(vars).filter(([_, value]) => value !== void 0 && value !== false).map(([key, value]) => `--${key}: ${value};`).join(" ");
|
|
400
|
+
if (!styles) {
|
|
401
|
+
return cssVars;
|
|
402
|
+
}
|
|
403
|
+
const style = typeof styles === "string" ? styles : toStyleString(styles);
|
|
404
|
+
return `${cssVars} ${style}`;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
const decoder = new TextDecoder();
|
|
408
|
+
const toUTF8String = (input, start = 0, end = input.length) => decoder.decode(input.slice(start, end));
|
|
409
|
+
const toHexString = (input, start = 0, end = input.length) => input.slice(start, end).reduce((memo, i) => memo + ("0" + i.toString(16)).slice(-2), "");
|
|
410
|
+
const readInt16LE = (input, offset = 0) => {
|
|
411
|
+
const val = input[offset] + input[offset + 1] * 2 ** 8;
|
|
412
|
+
return val | (val & 2 ** 15) * 131070;
|
|
413
|
+
};
|
|
414
|
+
const readUInt16BE = (input, offset = 0) => input[offset] * 2 ** 8 + input[offset + 1];
|
|
415
|
+
const readUInt16LE = (input, offset = 0) => input[offset] + input[offset + 1] * 2 ** 8;
|
|
416
|
+
const readUInt24LE = (input, offset = 0) => input[offset] + input[offset + 1] * 2 ** 8 + input[offset + 2] * 2 ** 16;
|
|
417
|
+
const readInt32LE = (input, offset = 0) => input[offset] + input[offset + 1] * 2 ** 8 + input[offset + 2] * 2 ** 16 + (input[offset + 3] << 24);
|
|
418
|
+
const readUInt32BE = (input, offset = 0) => input[offset] * 2 ** 24 + input[offset + 1] * 2 ** 16 + input[offset + 2] * 2 ** 8 + input[offset + 3];
|
|
419
|
+
const readUInt32LE = (input, offset = 0) => input[offset] + input[offset + 1] * 2 ** 8 + input[offset + 2] * 2 ** 16 + input[offset + 3] * 2 ** 24;
|
|
420
|
+
const methods = {
|
|
421
|
+
readUInt16BE,
|
|
422
|
+
readUInt16LE,
|
|
423
|
+
readUInt32BE,
|
|
424
|
+
readUInt32LE
|
|
425
|
+
};
|
|
426
|
+
function readUInt(input, bits, offset, isBigEndian) {
|
|
427
|
+
offset = offset || 0;
|
|
428
|
+
const endian = isBigEndian ? "BE" : "LE";
|
|
429
|
+
const methodName = "readUInt" + bits + endian;
|
|
430
|
+
return methods[methodName](input, offset);
|
|
431
|
+
}
|
|
432
|
+
function readBox(buffer, offset) {
|
|
433
|
+
if (buffer.length - offset < 4) return;
|
|
434
|
+
const boxSize = readUInt32BE(buffer, offset);
|
|
435
|
+
if (buffer.length - offset < boxSize) return;
|
|
436
|
+
return {
|
|
437
|
+
name: toUTF8String(buffer, 4 + offset, 8 + offset),
|
|
438
|
+
offset,
|
|
439
|
+
size: boxSize
|
|
440
|
+
};
|
|
441
|
+
}
|
|
442
|
+
function findBox(buffer, boxName, offset) {
|
|
443
|
+
while (offset < buffer.length) {
|
|
444
|
+
const box = readBox(buffer, offset);
|
|
445
|
+
if (!box) break;
|
|
446
|
+
if (box.name === boxName) return box;
|
|
447
|
+
offset += box.size;
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
const BMP = {
|
|
452
|
+
validate: (input) => toUTF8String(input, 0, 2) === "BM",
|
|
453
|
+
calculate: (input) => ({
|
|
454
|
+
height: Math.abs(readInt32LE(input, 22)),
|
|
455
|
+
width: readUInt32LE(input, 18)
|
|
456
|
+
})
|
|
457
|
+
};
|
|
458
|
+
|
|
459
|
+
const TYPE_ICON = 1;
|
|
460
|
+
const SIZE_HEADER$1 = 2 + 2 + 2;
|
|
461
|
+
const SIZE_IMAGE_ENTRY = 1 + 1 + 1 + 1 + 2 + 2 + 4 + 4;
|
|
462
|
+
function getSizeFromOffset(input, offset) {
|
|
463
|
+
const value = input[offset];
|
|
464
|
+
return value === 0 ? 256 : value;
|
|
465
|
+
}
|
|
466
|
+
function getImageSize$1(input, imageIndex) {
|
|
467
|
+
const offset = SIZE_HEADER$1 + imageIndex * SIZE_IMAGE_ENTRY;
|
|
468
|
+
return {
|
|
469
|
+
height: getSizeFromOffset(input, offset + 1),
|
|
470
|
+
width: getSizeFromOffset(input, offset)
|
|
471
|
+
};
|
|
472
|
+
}
|
|
473
|
+
const ICO = {
|
|
474
|
+
validate(input) {
|
|
475
|
+
const reserved = readUInt16LE(input, 0);
|
|
476
|
+
const imageCount = readUInt16LE(input, 4);
|
|
477
|
+
if (reserved !== 0 || imageCount === 0) return false;
|
|
478
|
+
const imageType = readUInt16LE(input, 2);
|
|
479
|
+
return imageType === TYPE_ICON;
|
|
480
|
+
},
|
|
481
|
+
calculate(input) {
|
|
482
|
+
const nbImages = readUInt16LE(input, 4);
|
|
483
|
+
const imageSize = getImageSize$1(input, 0);
|
|
484
|
+
if (nbImages === 1) return imageSize;
|
|
485
|
+
const imgs = [imageSize];
|
|
486
|
+
for (let imageIndex = 1; imageIndex < nbImages; imageIndex += 1) {
|
|
487
|
+
imgs.push(getImageSize$1(input, imageIndex));
|
|
488
|
+
}
|
|
489
|
+
return {
|
|
490
|
+
height: imageSize.height,
|
|
491
|
+
images: imgs,
|
|
492
|
+
width: imageSize.width
|
|
493
|
+
};
|
|
494
|
+
}
|
|
495
|
+
};
|
|
496
|
+
|
|
497
|
+
const TYPE_CURSOR = 2;
|
|
498
|
+
const CUR = {
|
|
499
|
+
validate(input) {
|
|
500
|
+
const reserved = readUInt16LE(input, 0);
|
|
501
|
+
const imageCount = readUInt16LE(input, 4);
|
|
502
|
+
if (reserved !== 0 || imageCount === 0) return false;
|
|
503
|
+
const imageType = readUInt16LE(input, 2);
|
|
504
|
+
return imageType === TYPE_CURSOR;
|
|
505
|
+
},
|
|
506
|
+
calculate: (input) => ICO.calculate(input)
|
|
507
|
+
};
|
|
508
|
+
|
|
509
|
+
const DDS = {
|
|
510
|
+
validate: (input) => readUInt32LE(input, 0) === 542327876,
|
|
511
|
+
calculate: (input) => ({
|
|
512
|
+
height: readUInt32LE(input, 12),
|
|
513
|
+
width: readUInt32LE(input, 16)
|
|
514
|
+
})
|
|
515
|
+
};
|
|
516
|
+
|
|
517
|
+
const gifRegexp = /^GIF8[79]a/;
|
|
518
|
+
const GIF = {
|
|
519
|
+
validate: (input) => gifRegexp.test(toUTF8String(input, 0, 6)),
|
|
520
|
+
calculate: (input) => ({
|
|
521
|
+
height: readUInt16LE(input, 8),
|
|
522
|
+
width: readUInt16LE(input, 6)
|
|
523
|
+
})
|
|
524
|
+
};
|
|
525
|
+
|
|
526
|
+
const brandMap = {
|
|
527
|
+
avif: "avif",
|
|
528
|
+
avis: "avif",
|
|
529
|
+
// avif-sequence
|
|
530
|
+
mif1: "heif",
|
|
531
|
+
msf1: "heif",
|
|
532
|
+
// heif-sequence
|
|
533
|
+
heic: "heic",
|
|
534
|
+
heix: "heic",
|
|
535
|
+
hevc: "heic",
|
|
536
|
+
// heic-sequence
|
|
537
|
+
hevx: "heic"
|
|
538
|
+
// heic-sequence
|
|
539
|
+
};
|
|
540
|
+
function detectBrands(buffer, start, end) {
|
|
541
|
+
let brandsDetected = {};
|
|
542
|
+
for (let i = start; i <= end; i += 4) {
|
|
543
|
+
const brand = toUTF8String(buffer, i, i + 4);
|
|
544
|
+
if (brand in brandMap) {
|
|
545
|
+
brandsDetected[brand] = 1;
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
if ("avif" in brandsDetected || "avis" in brandsDetected) {
|
|
549
|
+
return "avif";
|
|
550
|
+
} else if ("heic" in brandsDetected || "heix" in brandsDetected || "hevc" in brandsDetected || "hevx" in brandsDetected) {
|
|
551
|
+
return "heic";
|
|
552
|
+
} else if ("mif1" in brandsDetected || "msf1" in brandsDetected) {
|
|
553
|
+
return "heif";
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
const HEIF = {
|
|
557
|
+
validate(buffer) {
|
|
558
|
+
const ftype = toUTF8String(buffer, 4, 8);
|
|
559
|
+
const brand = toUTF8String(buffer, 8, 12);
|
|
560
|
+
return "ftyp" === ftype && brand in brandMap;
|
|
561
|
+
},
|
|
562
|
+
calculate(buffer) {
|
|
563
|
+
const metaBox = findBox(buffer, "meta", 0);
|
|
564
|
+
const iprpBox = metaBox && findBox(buffer, "iprp", metaBox.offset + 12);
|
|
565
|
+
const ipcoBox = iprpBox && findBox(buffer, "ipco", iprpBox.offset + 8);
|
|
566
|
+
const ispeBox = ipcoBox && findBox(buffer, "ispe", ipcoBox.offset + 8);
|
|
567
|
+
if (ispeBox) {
|
|
568
|
+
return {
|
|
569
|
+
height: readUInt32BE(buffer, ispeBox.offset + 16),
|
|
570
|
+
width: readUInt32BE(buffer, ispeBox.offset + 12),
|
|
571
|
+
type: detectBrands(buffer, 8, metaBox.offset)
|
|
572
|
+
};
|
|
573
|
+
}
|
|
574
|
+
throw new TypeError("Invalid HEIF, no size found");
|
|
575
|
+
}
|
|
576
|
+
};
|
|
577
|
+
|
|
578
|
+
const SIZE_HEADER = 4 + 4;
|
|
579
|
+
const FILE_LENGTH_OFFSET = 4;
|
|
580
|
+
const ENTRY_LENGTH_OFFSET = 4;
|
|
581
|
+
const ICON_TYPE_SIZE = {
|
|
582
|
+
ICON: 32,
|
|
583
|
+
"ICN#": 32,
|
|
584
|
+
// m => 16 x 16
|
|
585
|
+
"icm#": 16,
|
|
586
|
+
icm4: 16,
|
|
587
|
+
icm8: 16,
|
|
588
|
+
// s => 16 x 16
|
|
589
|
+
"ics#": 16,
|
|
590
|
+
ics4: 16,
|
|
591
|
+
ics8: 16,
|
|
592
|
+
is32: 16,
|
|
593
|
+
s8mk: 16,
|
|
594
|
+
icp4: 16,
|
|
595
|
+
// l => 32 x 32
|
|
596
|
+
icl4: 32,
|
|
597
|
+
icl8: 32,
|
|
598
|
+
il32: 32,
|
|
599
|
+
l8mk: 32,
|
|
600
|
+
icp5: 32,
|
|
601
|
+
ic11: 32,
|
|
602
|
+
// h => 48 x 48
|
|
603
|
+
ich4: 48,
|
|
604
|
+
ich8: 48,
|
|
605
|
+
ih32: 48,
|
|
606
|
+
h8mk: 48,
|
|
607
|
+
// . => 64 x 64
|
|
608
|
+
icp6: 64,
|
|
609
|
+
ic12: 32,
|
|
610
|
+
// t => 128 x 128
|
|
611
|
+
it32: 128,
|
|
612
|
+
t8mk: 128,
|
|
613
|
+
ic07: 128,
|
|
614
|
+
// . => 256 x 256
|
|
615
|
+
ic08: 256,
|
|
616
|
+
ic13: 256,
|
|
617
|
+
// . => 512 x 512
|
|
618
|
+
ic09: 512,
|
|
619
|
+
ic14: 512,
|
|
620
|
+
// . => 1024 x 1024
|
|
621
|
+
ic10: 1024
|
|
622
|
+
};
|
|
623
|
+
function readImageHeader(input, imageOffset) {
|
|
624
|
+
const imageLengthOffset = imageOffset + ENTRY_LENGTH_OFFSET;
|
|
625
|
+
return [
|
|
626
|
+
toUTF8String(input, imageOffset, imageLengthOffset),
|
|
627
|
+
readUInt32BE(input, imageLengthOffset)
|
|
628
|
+
];
|
|
629
|
+
}
|
|
630
|
+
function getImageSize(type) {
|
|
631
|
+
const size = ICON_TYPE_SIZE[type];
|
|
632
|
+
return { width: size, height: size, type };
|
|
633
|
+
}
|
|
634
|
+
const ICNS = {
|
|
635
|
+
validate: (input) => toUTF8String(input, 0, 4) === "icns",
|
|
636
|
+
calculate(input) {
|
|
637
|
+
const inputLength = input.length;
|
|
638
|
+
const fileLength = readUInt32BE(input, FILE_LENGTH_OFFSET);
|
|
639
|
+
let imageOffset = SIZE_HEADER;
|
|
640
|
+
let imageHeader = readImageHeader(input, imageOffset);
|
|
641
|
+
let imageSize = getImageSize(imageHeader[0]);
|
|
642
|
+
imageOffset += imageHeader[1];
|
|
643
|
+
if (imageOffset === fileLength) return imageSize;
|
|
644
|
+
const result = {
|
|
645
|
+
height: imageSize.height,
|
|
646
|
+
images: [imageSize],
|
|
647
|
+
width: imageSize.width
|
|
648
|
+
};
|
|
649
|
+
while (imageOffset < fileLength && imageOffset < inputLength) {
|
|
650
|
+
imageHeader = readImageHeader(input, imageOffset);
|
|
651
|
+
imageSize = getImageSize(imageHeader[0]);
|
|
652
|
+
imageOffset += imageHeader[1];
|
|
653
|
+
result.images.push(imageSize);
|
|
654
|
+
}
|
|
655
|
+
return result;
|
|
656
|
+
}
|
|
657
|
+
};
|
|
658
|
+
|
|
659
|
+
const J2C = {
|
|
660
|
+
// TODO: this doesn't seem right. SIZ marker doesn't have to be right after the SOC
|
|
661
|
+
validate: (input) => toHexString(input, 0, 4) === "ff4fff51",
|
|
662
|
+
calculate: (input) => ({
|
|
663
|
+
height: readUInt32BE(input, 12),
|
|
664
|
+
width: readUInt32BE(input, 8)
|
|
665
|
+
})
|
|
666
|
+
};
|
|
667
|
+
|
|
668
|
+
const JP2 = {
|
|
669
|
+
validate(input) {
|
|
670
|
+
if (readUInt32BE(input, 4) !== 1783636e3 || readUInt32BE(input, 0) < 1) return false;
|
|
671
|
+
const ftypBox = findBox(input, "ftyp", 0);
|
|
672
|
+
if (!ftypBox) return false;
|
|
673
|
+
return readUInt32BE(input, ftypBox.offset + 4) === 1718909296;
|
|
674
|
+
},
|
|
675
|
+
calculate(input) {
|
|
676
|
+
const jp2hBox = findBox(input, "jp2h", 0);
|
|
677
|
+
const ihdrBox = jp2hBox && findBox(input, "ihdr", jp2hBox.offset + 8);
|
|
678
|
+
if (ihdrBox) {
|
|
679
|
+
return {
|
|
680
|
+
height: readUInt32BE(input, ihdrBox.offset + 8),
|
|
681
|
+
width: readUInt32BE(input, ihdrBox.offset + 12)
|
|
682
|
+
};
|
|
683
|
+
}
|
|
684
|
+
throw new TypeError("Unsupported JPEG 2000 format");
|
|
685
|
+
}
|
|
686
|
+
};
|
|
687
|
+
|
|
688
|
+
const EXIF_MARKER = "45786966";
|
|
689
|
+
const APP1_DATA_SIZE_BYTES = 2;
|
|
690
|
+
const EXIF_HEADER_BYTES = 6;
|
|
691
|
+
const TIFF_BYTE_ALIGN_BYTES = 2;
|
|
692
|
+
const BIG_ENDIAN_BYTE_ALIGN = "4d4d";
|
|
693
|
+
const LITTLE_ENDIAN_BYTE_ALIGN = "4949";
|
|
694
|
+
const IDF_ENTRY_BYTES = 12;
|
|
695
|
+
const NUM_DIRECTORY_ENTRIES_BYTES = 2;
|
|
696
|
+
function isEXIF(input) {
|
|
697
|
+
return toHexString(input, 2, 6) === EXIF_MARKER;
|
|
698
|
+
}
|
|
699
|
+
function extractSize(input, index) {
|
|
700
|
+
return {
|
|
701
|
+
height: readUInt16BE(input, index),
|
|
702
|
+
width: readUInt16BE(input, index + 2)
|
|
703
|
+
};
|
|
704
|
+
}
|
|
705
|
+
function extractOrientation(exifBlock, isBigEndian) {
|
|
706
|
+
const idfOffset = 8;
|
|
707
|
+
const offset = EXIF_HEADER_BYTES + idfOffset;
|
|
708
|
+
const idfDirectoryEntries = readUInt(exifBlock, 16, offset, isBigEndian);
|
|
709
|
+
for (let directoryEntryNumber = 0; directoryEntryNumber < idfDirectoryEntries; directoryEntryNumber++) {
|
|
710
|
+
const start = offset + NUM_DIRECTORY_ENTRIES_BYTES + directoryEntryNumber * IDF_ENTRY_BYTES;
|
|
711
|
+
const end = start + IDF_ENTRY_BYTES;
|
|
712
|
+
if (start > exifBlock.length) {
|
|
713
|
+
return;
|
|
714
|
+
}
|
|
715
|
+
const block = exifBlock.slice(start, end);
|
|
716
|
+
const tagNumber = readUInt(block, 16, 0, isBigEndian);
|
|
717
|
+
if (tagNumber === 274) {
|
|
718
|
+
const dataFormat = readUInt(block, 16, 2, isBigEndian);
|
|
719
|
+
if (dataFormat !== 3) {
|
|
720
|
+
return;
|
|
721
|
+
}
|
|
722
|
+
const numberOfComponents = readUInt(block, 32, 4, isBigEndian);
|
|
723
|
+
if (numberOfComponents !== 1) {
|
|
724
|
+
return;
|
|
725
|
+
}
|
|
726
|
+
return readUInt(block, 16, 8, isBigEndian);
|
|
727
|
+
}
|
|
728
|
+
}
|
|
729
|
+
}
|
|
730
|
+
function validateExifBlock(input, index) {
|
|
731
|
+
const exifBlock = input.slice(APP1_DATA_SIZE_BYTES, index);
|
|
732
|
+
const byteAlign = toHexString(
|
|
733
|
+
exifBlock,
|
|
734
|
+
EXIF_HEADER_BYTES,
|
|
735
|
+
EXIF_HEADER_BYTES + TIFF_BYTE_ALIGN_BYTES
|
|
736
|
+
);
|
|
737
|
+
const isBigEndian = byteAlign === BIG_ENDIAN_BYTE_ALIGN;
|
|
738
|
+
const isLittleEndian = byteAlign === LITTLE_ENDIAN_BYTE_ALIGN;
|
|
739
|
+
if (isBigEndian || isLittleEndian) {
|
|
740
|
+
return extractOrientation(exifBlock, isBigEndian);
|
|
741
|
+
}
|
|
742
|
+
}
|
|
743
|
+
function validateInput(input, index) {
|
|
744
|
+
if (index > input.length) {
|
|
745
|
+
throw new TypeError("Corrupt JPG, exceeded buffer limits");
|
|
746
|
+
}
|
|
747
|
+
}
|
|
748
|
+
const JPG = {
|
|
749
|
+
validate: (input) => toHexString(input, 0, 2) === "ffd8",
|
|
750
|
+
calculate(input) {
|
|
751
|
+
input = input.slice(4);
|
|
752
|
+
let orientation;
|
|
753
|
+
let next;
|
|
754
|
+
while (input.length) {
|
|
755
|
+
const i = readUInt16BE(input, 0);
|
|
756
|
+
if (input[i] !== 255) {
|
|
757
|
+
input = input.slice(i);
|
|
758
|
+
continue;
|
|
759
|
+
}
|
|
760
|
+
if (isEXIF(input)) {
|
|
761
|
+
orientation = validateExifBlock(input, i);
|
|
762
|
+
}
|
|
763
|
+
validateInput(input, i);
|
|
764
|
+
next = input[i + 1];
|
|
765
|
+
if (next === 192 || next === 193 || next === 194) {
|
|
766
|
+
const size = extractSize(input, i + 5);
|
|
767
|
+
if (!orientation) {
|
|
768
|
+
return size;
|
|
769
|
+
}
|
|
770
|
+
return {
|
|
771
|
+
height: size.height,
|
|
772
|
+
orientation,
|
|
773
|
+
width: size.width
|
|
774
|
+
};
|
|
775
|
+
}
|
|
776
|
+
input = input.slice(i + 2);
|
|
777
|
+
}
|
|
778
|
+
throw new TypeError("Invalid JPG, no size found");
|
|
779
|
+
}
|
|
780
|
+
};
|
|
781
|
+
|
|
782
|
+
const KTX = {
|
|
783
|
+
validate: (input) => {
|
|
784
|
+
const signature = toUTF8String(input, 1, 7);
|
|
785
|
+
return ["KTX 11", "KTX 20"].includes(signature);
|
|
786
|
+
},
|
|
787
|
+
calculate: (input) => {
|
|
788
|
+
const type = input[5] === 49 ? "ktx" : "ktx2";
|
|
789
|
+
const offset = type === "ktx" ? 36 : 20;
|
|
790
|
+
return {
|
|
791
|
+
height: readUInt32LE(input, offset + 4),
|
|
792
|
+
width: readUInt32LE(input, offset),
|
|
793
|
+
type
|
|
794
|
+
};
|
|
795
|
+
}
|
|
796
|
+
};
|
|
797
|
+
|
|
798
|
+
const pngSignature = "PNG\r\n\n";
|
|
799
|
+
const pngImageHeaderChunkName = "IHDR";
|
|
800
|
+
const pngFriedChunkName = "CgBI";
|
|
801
|
+
const PNG = {
|
|
802
|
+
validate(input) {
|
|
803
|
+
if (pngSignature === toUTF8String(input, 1, 8)) {
|
|
804
|
+
let chunkName = toUTF8String(input, 12, 16);
|
|
805
|
+
if (chunkName === pngFriedChunkName) {
|
|
806
|
+
chunkName = toUTF8String(input, 28, 32);
|
|
807
|
+
}
|
|
808
|
+
if (chunkName !== pngImageHeaderChunkName) {
|
|
809
|
+
throw new TypeError("Invalid PNG");
|
|
810
|
+
}
|
|
811
|
+
return true;
|
|
812
|
+
}
|
|
813
|
+
return false;
|
|
814
|
+
},
|
|
815
|
+
calculate(input) {
|
|
816
|
+
if (toUTF8String(input, 12, 16) === pngFriedChunkName) {
|
|
817
|
+
return {
|
|
818
|
+
height: readUInt32BE(input, 36),
|
|
819
|
+
width: readUInt32BE(input, 32)
|
|
820
|
+
};
|
|
821
|
+
}
|
|
822
|
+
return {
|
|
823
|
+
height: readUInt32BE(input, 20),
|
|
824
|
+
width: readUInt32BE(input, 16)
|
|
825
|
+
};
|
|
826
|
+
}
|
|
827
|
+
};
|
|
828
|
+
|
|
829
|
+
const PNMTypes = {
|
|
830
|
+
P1: "pbm/ascii",
|
|
831
|
+
P2: "pgm/ascii",
|
|
832
|
+
P3: "ppm/ascii",
|
|
833
|
+
P4: "pbm",
|
|
834
|
+
P5: "pgm",
|
|
835
|
+
P6: "ppm",
|
|
836
|
+
P7: "pam",
|
|
837
|
+
PF: "pfm"
|
|
838
|
+
};
|
|
839
|
+
const handlers = {
|
|
840
|
+
default: (lines) => {
|
|
841
|
+
let dimensions = [];
|
|
842
|
+
while (lines.length > 0) {
|
|
843
|
+
const line = lines.shift();
|
|
844
|
+
if (line[0] === "#") {
|
|
845
|
+
continue;
|
|
846
|
+
}
|
|
847
|
+
dimensions = line.split(" ");
|
|
848
|
+
break;
|
|
849
|
+
}
|
|
850
|
+
if (dimensions.length === 2) {
|
|
851
|
+
return {
|
|
852
|
+
height: parseInt(dimensions[1], 10),
|
|
853
|
+
width: parseInt(dimensions[0], 10)
|
|
854
|
+
};
|
|
855
|
+
} else {
|
|
856
|
+
throw new TypeError("Invalid PNM");
|
|
857
|
+
}
|
|
858
|
+
},
|
|
859
|
+
pam: (lines) => {
|
|
860
|
+
const size = {};
|
|
861
|
+
while (lines.length > 0) {
|
|
862
|
+
const line = lines.shift();
|
|
863
|
+
if (line.length > 16 || line.charCodeAt(0) > 128) {
|
|
864
|
+
continue;
|
|
865
|
+
}
|
|
866
|
+
const [key, value] = line.split(" ");
|
|
867
|
+
if (key && value) {
|
|
868
|
+
size[key.toLowerCase()] = parseInt(value, 10);
|
|
869
|
+
}
|
|
870
|
+
if (size.height && size.width) {
|
|
871
|
+
break;
|
|
872
|
+
}
|
|
873
|
+
}
|
|
874
|
+
if (size.height && size.width) {
|
|
875
|
+
return {
|
|
876
|
+
height: size.height,
|
|
877
|
+
width: size.width
|
|
878
|
+
};
|
|
879
|
+
} else {
|
|
880
|
+
throw new TypeError("Invalid PAM");
|
|
881
|
+
}
|
|
882
|
+
}
|
|
883
|
+
};
|
|
884
|
+
const PNM = {
|
|
885
|
+
validate: (input) => toUTF8String(input, 0, 2) in PNMTypes,
|
|
886
|
+
calculate(input) {
|
|
887
|
+
const signature = toUTF8String(input, 0, 2);
|
|
888
|
+
const type = PNMTypes[signature];
|
|
889
|
+
const lines = toUTF8String(input, 3).split(/[\r\n]+/);
|
|
890
|
+
const handler = handlers[type] || handlers.default;
|
|
891
|
+
return handler(lines);
|
|
892
|
+
}
|
|
893
|
+
};
|
|
894
|
+
|
|
895
|
+
const PSD = {
|
|
896
|
+
validate: (input) => toUTF8String(input, 0, 4) === "8BPS",
|
|
897
|
+
calculate: (input) => ({
|
|
898
|
+
height: readUInt32BE(input, 14),
|
|
899
|
+
width: readUInt32BE(input, 18)
|
|
900
|
+
})
|
|
901
|
+
};
|
|
902
|
+
|
|
903
|
+
const svgReg = /<svg\s([^>"']|"[^"]*"|'[^']*')*>/;
|
|
904
|
+
const extractorRegExps = {
|
|
905
|
+
height: /\sheight=(['"])([^%]+?)\1/,
|
|
906
|
+
root: svgReg,
|
|
907
|
+
viewbox: /\sviewBox=(['"])(.+?)\1/i,
|
|
908
|
+
width: /\swidth=(['"])([^%]+?)\1/
|
|
909
|
+
};
|
|
910
|
+
const INCH_CM = 2.54;
|
|
911
|
+
const units = {
|
|
912
|
+
in: 96,
|
|
913
|
+
cm: 96 / INCH_CM,
|
|
914
|
+
em: 16,
|
|
915
|
+
ex: 8,
|
|
916
|
+
m: 96 / INCH_CM * 100,
|
|
917
|
+
mm: 96 / INCH_CM / 10,
|
|
918
|
+
pc: 96 / 72 / 12,
|
|
919
|
+
pt: 96 / 72,
|
|
920
|
+
px: 1
|
|
921
|
+
};
|
|
922
|
+
const unitsReg = new RegExp(
|
|
923
|
+
`^([0-9.]+(?:e\\d+)?)(${Object.keys(units).join("|")})?$`
|
|
924
|
+
);
|
|
925
|
+
function parseLength(len) {
|
|
926
|
+
const m = unitsReg.exec(len);
|
|
927
|
+
if (!m) {
|
|
928
|
+
return void 0;
|
|
929
|
+
}
|
|
930
|
+
return Math.round(Number(m[1]) * (units[m[2]] || 1));
|
|
931
|
+
}
|
|
932
|
+
function parseViewbox(viewbox) {
|
|
933
|
+
const bounds = viewbox.split(" ");
|
|
934
|
+
return {
|
|
935
|
+
height: parseLength(bounds[3]),
|
|
936
|
+
width: parseLength(bounds[2])
|
|
937
|
+
};
|
|
938
|
+
}
|
|
939
|
+
function parseAttributes(root) {
|
|
940
|
+
const width = extractorRegExps.width.exec(root);
|
|
941
|
+
const height = extractorRegExps.height.exec(root);
|
|
942
|
+
const viewbox = extractorRegExps.viewbox.exec(root);
|
|
943
|
+
return {
|
|
944
|
+
height: height && parseLength(height[2]),
|
|
945
|
+
viewbox: viewbox && parseViewbox(viewbox[2]),
|
|
946
|
+
width: width && parseLength(width[2])
|
|
947
|
+
};
|
|
948
|
+
}
|
|
949
|
+
function calculateByDimensions(attrs) {
|
|
950
|
+
return {
|
|
951
|
+
height: attrs.height,
|
|
952
|
+
width: attrs.width
|
|
953
|
+
};
|
|
954
|
+
}
|
|
955
|
+
function calculateByViewbox(attrs, viewbox) {
|
|
956
|
+
const ratio = viewbox.width / viewbox.height;
|
|
957
|
+
if (attrs.width) {
|
|
958
|
+
return {
|
|
959
|
+
height: Math.floor(attrs.width / ratio),
|
|
960
|
+
width: attrs.width
|
|
961
|
+
};
|
|
962
|
+
}
|
|
963
|
+
if (attrs.height) {
|
|
964
|
+
return {
|
|
965
|
+
height: attrs.height,
|
|
966
|
+
width: Math.floor(attrs.height * ratio)
|
|
967
|
+
};
|
|
968
|
+
}
|
|
969
|
+
return {
|
|
970
|
+
height: viewbox.height,
|
|
971
|
+
width: viewbox.width
|
|
972
|
+
};
|
|
973
|
+
}
|
|
974
|
+
const SVG = {
|
|
975
|
+
// Scan only the first kilo-byte to speed up the check on larger files
|
|
976
|
+
validate: (input) => svgReg.test(toUTF8String(input, 0, 1e3)),
|
|
977
|
+
calculate(input) {
|
|
978
|
+
const root = extractorRegExps.root.exec(toUTF8String(input));
|
|
979
|
+
if (root) {
|
|
980
|
+
const attrs = parseAttributes(root[0]);
|
|
981
|
+
if (attrs.width && attrs.height) {
|
|
982
|
+
return calculateByDimensions(attrs);
|
|
983
|
+
}
|
|
984
|
+
if (attrs.viewbox) {
|
|
985
|
+
return calculateByViewbox(attrs, attrs.viewbox);
|
|
986
|
+
}
|
|
987
|
+
}
|
|
988
|
+
throw new TypeError("Invalid SVG");
|
|
989
|
+
}
|
|
990
|
+
};
|
|
991
|
+
|
|
992
|
+
const TGA = {
|
|
993
|
+
validate(input) {
|
|
994
|
+
return readUInt16LE(input, 0) === 0 && readUInt16LE(input, 4) === 0;
|
|
995
|
+
},
|
|
996
|
+
calculate(input) {
|
|
997
|
+
return {
|
|
998
|
+
height: readUInt16LE(input, 14),
|
|
999
|
+
width: readUInt16LE(input, 12)
|
|
1000
|
+
};
|
|
1001
|
+
}
|
|
1002
|
+
};
|
|
1003
|
+
|
|
1004
|
+
function readIFD(input, isBigEndian) {
|
|
1005
|
+
const ifdOffset = readUInt(input, 32, 4, isBigEndian);
|
|
1006
|
+
return input.slice(ifdOffset + 2);
|
|
1007
|
+
}
|
|
1008
|
+
function readValue(input, isBigEndian) {
|
|
1009
|
+
const low = readUInt(input, 16, 8, isBigEndian);
|
|
1010
|
+
const high = readUInt(input, 16, 10, isBigEndian);
|
|
1011
|
+
return (high << 16) + low;
|
|
1012
|
+
}
|
|
1013
|
+
function nextTag(input) {
|
|
1014
|
+
if (input.length > 24) {
|
|
1015
|
+
return input.slice(12);
|
|
1016
|
+
}
|
|
1017
|
+
}
|
|
1018
|
+
function extractTags(input, isBigEndian) {
|
|
1019
|
+
const tags = {};
|
|
1020
|
+
let temp = input;
|
|
1021
|
+
while (temp && temp.length) {
|
|
1022
|
+
const code = readUInt(temp, 16, 0, isBigEndian);
|
|
1023
|
+
const type = readUInt(temp, 16, 2, isBigEndian);
|
|
1024
|
+
const length = readUInt(temp, 32, 4, isBigEndian);
|
|
1025
|
+
if (code === 0) {
|
|
1026
|
+
break;
|
|
1027
|
+
} else {
|
|
1028
|
+
if (length === 1 && (type === 3 || type === 4)) {
|
|
1029
|
+
tags[code] = readValue(temp, isBigEndian);
|
|
1030
|
+
}
|
|
1031
|
+
temp = nextTag(temp);
|
|
1032
|
+
}
|
|
1033
|
+
}
|
|
1034
|
+
return tags;
|
|
1035
|
+
}
|
|
1036
|
+
function determineEndianness(input) {
|
|
1037
|
+
const signature = toUTF8String(input, 0, 2);
|
|
1038
|
+
if ("II" === signature) {
|
|
1039
|
+
return "LE";
|
|
1040
|
+
} else if ("MM" === signature) {
|
|
1041
|
+
return "BE";
|
|
1042
|
+
}
|
|
1043
|
+
}
|
|
1044
|
+
const signatures = [
|
|
1045
|
+
// '492049', // currently not supported
|
|
1046
|
+
"49492a00",
|
|
1047
|
+
// Little endian
|
|
1048
|
+
"4d4d002a"
|
|
1049
|
+
// Big Endian
|
|
1050
|
+
// '4d4d002a', // BigTIFF > 4GB. currently not supported
|
|
1051
|
+
];
|
|
1052
|
+
const TIFF = {
|
|
1053
|
+
validate: (input) => signatures.includes(toHexString(input, 0, 4)),
|
|
1054
|
+
calculate(input) {
|
|
1055
|
+
const isBigEndian = determineEndianness(input) === "BE";
|
|
1056
|
+
const ifdBuffer = readIFD(input, isBigEndian);
|
|
1057
|
+
const tags = extractTags(ifdBuffer, isBigEndian);
|
|
1058
|
+
const width = tags[256];
|
|
1059
|
+
const height = tags[257];
|
|
1060
|
+
if (!width || !height) {
|
|
1061
|
+
throw new TypeError("Invalid Tiff. Missing tags");
|
|
1062
|
+
}
|
|
1063
|
+
return { height, width };
|
|
1064
|
+
}
|
|
1065
|
+
};
|
|
1066
|
+
|
|
1067
|
+
function calculateExtended(input) {
|
|
1068
|
+
return {
|
|
1069
|
+
height: 1 + readUInt24LE(input, 7),
|
|
1070
|
+
width: 1 + readUInt24LE(input, 4)
|
|
1071
|
+
};
|
|
1072
|
+
}
|
|
1073
|
+
function calculateLossless(input) {
|
|
1074
|
+
return {
|
|
1075
|
+
height: 1 + ((input[4] & 15) << 10 | input[3] << 2 | (input[2] & 192) >> 6),
|
|
1076
|
+
width: 1 + ((input[2] & 63) << 8 | input[1])
|
|
1077
|
+
};
|
|
1078
|
+
}
|
|
1079
|
+
function calculateLossy(input) {
|
|
1080
|
+
return {
|
|
1081
|
+
height: readInt16LE(input, 8) & 16383,
|
|
1082
|
+
width: readInt16LE(input, 6) & 16383
|
|
1083
|
+
};
|
|
1084
|
+
}
|
|
1085
|
+
const WEBP = {
|
|
1086
|
+
validate(input) {
|
|
1087
|
+
const riffHeader = "RIFF" === toUTF8String(input, 0, 4);
|
|
1088
|
+
const webpHeader = "WEBP" === toUTF8String(input, 8, 12);
|
|
1089
|
+
const vp8Header = "VP8" === toUTF8String(input, 12, 15);
|
|
1090
|
+
return riffHeader && webpHeader && vp8Header;
|
|
1091
|
+
},
|
|
1092
|
+
calculate(input) {
|
|
1093
|
+
const chunkHeader = toUTF8String(input, 12, 16);
|
|
1094
|
+
input = input.slice(20, 30);
|
|
1095
|
+
if (chunkHeader === "VP8X") {
|
|
1096
|
+
const extendedHeader = input[0];
|
|
1097
|
+
const validStart = (extendedHeader & 192) === 0;
|
|
1098
|
+
const validEnd = (extendedHeader & 1) === 0;
|
|
1099
|
+
if (validStart && validEnd) {
|
|
1100
|
+
return calculateExtended(input);
|
|
1101
|
+
} else {
|
|
1102
|
+
throw new TypeError("Invalid WebP");
|
|
1103
|
+
}
|
|
1104
|
+
}
|
|
1105
|
+
if (chunkHeader === "VP8 " && input[0] !== 47) {
|
|
1106
|
+
return calculateLossy(input);
|
|
1107
|
+
}
|
|
1108
|
+
const signature = toHexString(input, 3, 6);
|
|
1109
|
+
if (chunkHeader === "VP8L" && signature !== "9d012a") {
|
|
1110
|
+
return calculateLossless(input);
|
|
1111
|
+
}
|
|
1112
|
+
throw new TypeError("Invalid WebP");
|
|
1113
|
+
}
|
|
1114
|
+
};
|
|
1115
|
+
|
|
1116
|
+
const typeHandlers = /* @__PURE__ */ new Map([
|
|
1117
|
+
["bmp", BMP],
|
|
1118
|
+
["cur", CUR],
|
|
1119
|
+
["dds", DDS],
|
|
1120
|
+
["gif", GIF],
|
|
1121
|
+
["heif", HEIF],
|
|
1122
|
+
["icns", ICNS],
|
|
1123
|
+
["ico", ICO],
|
|
1124
|
+
["j2c", J2C],
|
|
1125
|
+
["jp2", JP2],
|
|
1126
|
+
["jpg", JPG],
|
|
1127
|
+
["ktx", KTX],
|
|
1128
|
+
["png", PNG],
|
|
1129
|
+
["pnm", PNM],
|
|
1130
|
+
["psd", PSD],
|
|
1131
|
+
["svg", SVG],
|
|
1132
|
+
["tga", TGA],
|
|
1133
|
+
["tiff", TIFF],
|
|
1134
|
+
["webp", WEBP]
|
|
1135
|
+
]);
|
|
1136
|
+
const types = Array.from(typeHandlers.keys());
|
|
1137
|
+
|
|
1138
|
+
const firstBytes = /* @__PURE__ */ new Map([
|
|
1139
|
+
[56, "psd"],
|
|
1140
|
+
[66, "bmp"],
|
|
1141
|
+
[68, "dds"],
|
|
1142
|
+
[71, "gif"],
|
|
1143
|
+
[73, "tiff"],
|
|
1144
|
+
[77, "tiff"],
|
|
1145
|
+
[82, "webp"],
|
|
1146
|
+
[105, "icns"],
|
|
1147
|
+
[137, "png"],
|
|
1148
|
+
[255, "jpg"]
|
|
1149
|
+
]);
|
|
1150
|
+
function detector(input) {
|
|
1151
|
+
const byte = input[0];
|
|
1152
|
+
const type = firstBytes.get(byte);
|
|
1153
|
+
if (type && typeHandlers.get(type).validate(input)) {
|
|
1154
|
+
return type;
|
|
1155
|
+
}
|
|
1156
|
+
return types.find((fileType) => typeHandlers.get(fileType).validate(input));
|
|
1157
|
+
}
|
|
1158
|
+
|
|
1159
|
+
function lookup$1(input) {
|
|
1160
|
+
const type = detector(input);
|
|
1161
|
+
if (typeof type !== "undefined") {
|
|
1162
|
+
const size = typeHandlers.get(type).calculate(input);
|
|
1163
|
+
if (size !== void 0) {
|
|
1164
|
+
size.type = size.type ?? type;
|
|
1165
|
+
return size;
|
|
1166
|
+
}
|
|
1167
|
+
}
|
|
1168
|
+
throw new TypeError("unsupported file type: " + type);
|
|
1169
|
+
}
|
|
1170
|
+
|
|
1171
|
+
async function imageMetadata(data, src) {
|
|
1172
|
+
let result;
|
|
1173
|
+
try {
|
|
1174
|
+
result = lookup$1(data);
|
|
1175
|
+
} catch {
|
|
1176
|
+
throw new AstroError({
|
|
1177
|
+
...NoImageMetadata,
|
|
1178
|
+
message: NoImageMetadata.message(src)
|
|
1179
|
+
});
|
|
1180
|
+
}
|
|
1181
|
+
if (!result.height || !result.width || !result.type) {
|
|
1182
|
+
throw new AstroError({
|
|
1183
|
+
...NoImageMetadata,
|
|
1184
|
+
message: NoImageMetadata.message(src)
|
|
1185
|
+
});
|
|
1186
|
+
}
|
|
1187
|
+
const { width, height, type, orientation } = result;
|
|
1188
|
+
const isPortrait = (orientation || 0) >= 5;
|
|
1189
|
+
return {
|
|
1190
|
+
width: isPortrait ? height : width,
|
|
1191
|
+
height: isPortrait ? width : height,
|
|
1192
|
+
format: type,
|
|
1193
|
+
orientation
|
|
1194
|
+
};
|
|
1195
|
+
}
|
|
1196
|
+
|
|
1197
|
+
async function inferRemoteSize(url) {
|
|
1198
|
+
const response = await fetch(url);
|
|
1199
|
+
if (!response.body || !response.ok) {
|
|
1200
|
+
throw new AstroError({
|
|
1201
|
+
...FailedToFetchRemoteImageDimensions,
|
|
1202
|
+
message: FailedToFetchRemoteImageDimensions.message(url)
|
|
1203
|
+
});
|
|
1204
|
+
}
|
|
1205
|
+
const reader = response.body.getReader();
|
|
1206
|
+
let done, value;
|
|
1207
|
+
let accumulatedChunks = new Uint8Array();
|
|
1208
|
+
while (!done) {
|
|
1209
|
+
const readResult = await reader.read();
|
|
1210
|
+
done = readResult.done;
|
|
1211
|
+
if (done) break;
|
|
1212
|
+
if (readResult.value) {
|
|
1213
|
+
value = readResult.value;
|
|
1214
|
+
let tmp = new Uint8Array(accumulatedChunks.length + value.length);
|
|
1215
|
+
tmp.set(accumulatedChunks, 0);
|
|
1216
|
+
tmp.set(value, accumulatedChunks.length);
|
|
1217
|
+
accumulatedChunks = tmp;
|
|
1218
|
+
try {
|
|
1219
|
+
const dimensions = await imageMetadata(accumulatedChunks, url);
|
|
1220
|
+
if (dimensions) {
|
|
1221
|
+
await reader.cancel();
|
|
1222
|
+
return dimensions;
|
|
1223
|
+
}
|
|
1224
|
+
} catch {
|
|
1225
|
+
}
|
|
1226
|
+
}
|
|
1227
|
+
}
|
|
1228
|
+
throw new AstroError({
|
|
1229
|
+
...NoImageMetadata,
|
|
1230
|
+
message: NoImageMetadata.message(url)
|
|
1231
|
+
});
|
|
1232
|
+
}
|
|
1233
|
+
|
|
1234
|
+
async function getConfiguredImageService() {
|
|
1235
|
+
if (!globalThis?.astroAsset?.imageService) {
|
|
1236
|
+
const { default: service } = await import(
|
|
1237
|
+
// @ts-expect-error
|
|
1238
|
+
'./sharp_DdDF6upK.mjs'
|
|
1239
|
+
).catch((e) => {
|
|
1240
|
+
const error = new AstroError(InvalidImageService);
|
|
1241
|
+
error.cause = e;
|
|
1242
|
+
throw error;
|
|
1243
|
+
});
|
|
1244
|
+
if (!globalThis.astroAsset) globalThis.astroAsset = {};
|
|
1245
|
+
globalThis.astroAsset.imageService = service;
|
|
1246
|
+
return service;
|
|
1247
|
+
}
|
|
1248
|
+
return globalThis.astroAsset.imageService;
|
|
1249
|
+
}
|
|
1250
|
+
async function getImage$1(options, imageConfig) {
|
|
1251
|
+
if (!options || typeof options !== "object") {
|
|
1252
|
+
throw new AstroError({
|
|
1253
|
+
...ExpectedImageOptions,
|
|
1254
|
+
message: ExpectedImageOptions.message(JSON.stringify(options))
|
|
1255
|
+
});
|
|
1256
|
+
}
|
|
1257
|
+
if (typeof options.src === "undefined") {
|
|
1258
|
+
throw new AstroError({
|
|
1259
|
+
...ExpectedImage,
|
|
1260
|
+
message: ExpectedImage.message(
|
|
1261
|
+
options.src,
|
|
1262
|
+
"undefined",
|
|
1263
|
+
JSON.stringify(options)
|
|
1264
|
+
)
|
|
1265
|
+
});
|
|
1266
|
+
}
|
|
1267
|
+
if (isImageMetadata(options)) {
|
|
1268
|
+
throw new AstroError(ExpectedNotESMImage);
|
|
1269
|
+
}
|
|
1270
|
+
const service = await getConfiguredImageService();
|
|
1271
|
+
const resolvedOptions = {
|
|
1272
|
+
...options,
|
|
1273
|
+
src: await resolveSrc(options.src)
|
|
1274
|
+
};
|
|
1275
|
+
let originalWidth;
|
|
1276
|
+
let originalHeight;
|
|
1277
|
+
if (options.inferSize && isRemoteImage(resolvedOptions.src) && isRemotePath(resolvedOptions.src)) {
|
|
1278
|
+
const result = await inferRemoteSize(resolvedOptions.src);
|
|
1279
|
+
resolvedOptions.width ??= result.width;
|
|
1280
|
+
resolvedOptions.height ??= result.height;
|
|
1281
|
+
originalWidth = result.width;
|
|
1282
|
+
originalHeight = result.height;
|
|
1283
|
+
delete resolvedOptions.inferSize;
|
|
1284
|
+
}
|
|
1285
|
+
const originalFilePath = isESMImportedImage(resolvedOptions.src) ? resolvedOptions.src.fsPath : void 0;
|
|
1286
|
+
const clonedSrc = isESMImportedImage(resolvedOptions.src) ? (
|
|
1287
|
+
// @ts-expect-error - clone is a private, hidden prop
|
|
1288
|
+
resolvedOptions.src.clone ?? resolvedOptions.src
|
|
1289
|
+
) : resolvedOptions.src;
|
|
1290
|
+
if (isESMImportedImage(clonedSrc)) {
|
|
1291
|
+
originalWidth = clonedSrc.width;
|
|
1292
|
+
originalHeight = clonedSrc.height;
|
|
1293
|
+
}
|
|
1294
|
+
if (originalWidth && originalHeight) {
|
|
1295
|
+
const aspectRatio = originalWidth / originalHeight;
|
|
1296
|
+
if (resolvedOptions.height && !resolvedOptions.width) {
|
|
1297
|
+
resolvedOptions.width = Math.round(resolvedOptions.height * aspectRatio);
|
|
1298
|
+
} else if (resolvedOptions.width && !resolvedOptions.height) {
|
|
1299
|
+
resolvedOptions.height = Math.round(resolvedOptions.width / aspectRatio);
|
|
1300
|
+
} else if (!resolvedOptions.width && !resolvedOptions.height) {
|
|
1301
|
+
resolvedOptions.width = originalWidth;
|
|
1302
|
+
resolvedOptions.height = originalHeight;
|
|
1303
|
+
}
|
|
1304
|
+
}
|
|
1305
|
+
resolvedOptions.src = clonedSrc;
|
|
1306
|
+
const layout = options.layout ?? imageConfig.layout ?? "none";
|
|
1307
|
+
if (resolvedOptions.priority) {
|
|
1308
|
+
resolvedOptions.loading ??= "eager";
|
|
1309
|
+
resolvedOptions.decoding ??= "sync";
|
|
1310
|
+
resolvedOptions.fetchpriority ??= "high";
|
|
1311
|
+
delete resolvedOptions.priority;
|
|
1312
|
+
} else {
|
|
1313
|
+
resolvedOptions.loading ??= "lazy";
|
|
1314
|
+
resolvedOptions.decoding ??= "async";
|
|
1315
|
+
resolvedOptions.fetchpriority ??= "auto";
|
|
1316
|
+
}
|
|
1317
|
+
if (layout !== "none") {
|
|
1318
|
+
resolvedOptions.widths ||= getWidths({
|
|
1319
|
+
width: resolvedOptions.width,
|
|
1320
|
+
layout,
|
|
1321
|
+
originalWidth,
|
|
1322
|
+
breakpoints: imageConfig.breakpoints?.length ? imageConfig.breakpoints : isLocalService(service) ? LIMITED_RESOLUTIONS : DEFAULT_RESOLUTIONS
|
|
1323
|
+
});
|
|
1324
|
+
resolvedOptions.sizes ||= getSizesAttribute({ width: resolvedOptions.width, layout });
|
|
1325
|
+
delete resolvedOptions.densities;
|
|
1326
|
+
resolvedOptions.style = addCSSVarsToStyle(
|
|
1327
|
+
{
|
|
1328
|
+
fit: cssFitValues.includes(resolvedOptions.fit ?? "") && resolvedOptions.fit,
|
|
1329
|
+
pos: resolvedOptions.position
|
|
1330
|
+
},
|
|
1331
|
+
resolvedOptions.style
|
|
1332
|
+
);
|
|
1333
|
+
resolvedOptions["data-astro-image"] = layout;
|
|
1334
|
+
}
|
|
1335
|
+
const validatedOptions = service.validateOptions ? await service.validateOptions(resolvedOptions, imageConfig) : resolvedOptions;
|
|
1336
|
+
const srcSetTransforms = service.getSrcSet ? await service.getSrcSet(validatedOptions, imageConfig) : [];
|
|
1337
|
+
let imageURL = await service.getURL(validatedOptions, imageConfig);
|
|
1338
|
+
const matchesValidatedTransform = (transform) => transform.width === validatedOptions.width && transform.height === validatedOptions.height && transform.format === validatedOptions.format;
|
|
1339
|
+
let srcSets = await Promise.all(
|
|
1340
|
+
srcSetTransforms.map(async (srcSet) => {
|
|
1341
|
+
return {
|
|
1342
|
+
transform: srcSet.transform,
|
|
1343
|
+
url: matchesValidatedTransform(srcSet.transform) ? imageURL : await service.getURL(srcSet.transform, imageConfig),
|
|
1344
|
+
descriptor: srcSet.descriptor,
|
|
1345
|
+
attributes: srcSet.attributes
|
|
1346
|
+
};
|
|
1347
|
+
})
|
|
1348
|
+
);
|
|
1349
|
+
if (isLocalService(service) && globalThis.astroAsset.addStaticImage && !(isRemoteImage(validatedOptions.src) && imageURL === validatedOptions.src)) {
|
|
1350
|
+
const propsToHash = service.propertiesToHash ?? DEFAULT_HASH_PROPS;
|
|
1351
|
+
imageURL = globalThis.astroAsset.addStaticImage(
|
|
1352
|
+
validatedOptions,
|
|
1353
|
+
propsToHash,
|
|
1354
|
+
originalFilePath
|
|
1355
|
+
);
|
|
1356
|
+
srcSets = srcSetTransforms.map((srcSet) => {
|
|
1357
|
+
return {
|
|
1358
|
+
transform: srcSet.transform,
|
|
1359
|
+
url: matchesValidatedTransform(srcSet.transform) ? imageURL : globalThis.astroAsset.addStaticImage(srcSet.transform, propsToHash, originalFilePath),
|
|
1360
|
+
descriptor: srcSet.descriptor,
|
|
1361
|
+
attributes: srcSet.attributes
|
|
1362
|
+
};
|
|
1363
|
+
});
|
|
1364
|
+
}
|
|
1365
|
+
return {
|
|
1366
|
+
rawOptions: resolvedOptions,
|
|
1367
|
+
options: validatedOptions,
|
|
1368
|
+
src: imageURL,
|
|
1369
|
+
srcSet: {
|
|
1370
|
+
values: srcSets,
|
|
1371
|
+
attribute: srcSets.map((srcSet) => `${srcSet.url} ${srcSet.descriptor}`).join(", ")
|
|
1372
|
+
},
|
|
1373
|
+
attributes: service.getHTMLAttributes !== void 0 ? await service.getHTMLAttributes(validatedOptions, imageConfig) : {}
|
|
1374
|
+
};
|
|
1375
|
+
}
|
|
1376
|
+
|
|
1377
|
+
const $$Astro$2 = createAstro();
|
|
1378
|
+
const $$Image = createComponent(async ($$result, $$props, $$slots) => {
|
|
1379
|
+
const Astro2 = $$result.createAstro($$Astro$2, $$props, $$slots);
|
|
1380
|
+
Astro2.self = $$Image;
|
|
1381
|
+
const props = Astro2.props;
|
|
1382
|
+
if (props.alt === void 0 || props.alt === null) {
|
|
1383
|
+
throw new AstroError(ImageMissingAlt);
|
|
1384
|
+
}
|
|
1385
|
+
if (typeof props.width === "string") {
|
|
1386
|
+
props.width = parseInt(props.width);
|
|
1387
|
+
}
|
|
1388
|
+
if (typeof props.height === "string") {
|
|
1389
|
+
props.height = parseInt(props.height);
|
|
1390
|
+
}
|
|
1391
|
+
const layout = props.layout ?? imageConfig.layout ?? "none";
|
|
1392
|
+
if (layout !== "none") {
|
|
1393
|
+
props.layout ??= imageConfig.layout;
|
|
1394
|
+
props.fit ??= imageConfig.objectFit ?? "cover";
|
|
1395
|
+
props.position ??= imageConfig.objectPosition ?? "center";
|
|
1396
|
+
}
|
|
1397
|
+
const image = await getImage(props);
|
|
1398
|
+
const additionalAttributes = {};
|
|
1399
|
+
if (image.srcSet.values.length > 0) {
|
|
1400
|
+
additionalAttributes.srcset = image.srcSet.attribute;
|
|
1401
|
+
}
|
|
1402
|
+
const { class: className, ...attributes } = { ...additionalAttributes, ...image.attributes };
|
|
1403
|
+
return renderTemplate`${maybeRenderHead()}<img${addAttribute(image.src, "src")}${spreadAttributes(attributes)}${addAttribute(className, "class")}>`;
|
|
1404
|
+
}, "/home/runner/work/patternfly-doc-core/patternfly-doc-core/node_modules/astro/components/Image.astro", void 0);
|
|
1405
|
+
|
|
1406
|
+
const mimes = {
|
|
1407
|
+
"3g2": "video/3gpp2",
|
|
1408
|
+
"3gp": "video/3gpp",
|
|
1409
|
+
"3gpp": "video/3gpp",
|
|
1410
|
+
"3mf": "model/3mf",
|
|
1411
|
+
"aac": "audio/aac",
|
|
1412
|
+
"ac": "application/pkix-attr-cert",
|
|
1413
|
+
"adp": "audio/adpcm",
|
|
1414
|
+
"adts": "audio/aac",
|
|
1415
|
+
"ai": "application/postscript",
|
|
1416
|
+
"aml": "application/automationml-aml+xml",
|
|
1417
|
+
"amlx": "application/automationml-amlx+zip",
|
|
1418
|
+
"amr": "audio/amr",
|
|
1419
|
+
"apng": "image/apng",
|
|
1420
|
+
"appcache": "text/cache-manifest",
|
|
1421
|
+
"appinstaller": "application/appinstaller",
|
|
1422
|
+
"appx": "application/appx",
|
|
1423
|
+
"appxbundle": "application/appxbundle",
|
|
1424
|
+
"asc": "application/pgp-keys",
|
|
1425
|
+
"atom": "application/atom+xml",
|
|
1426
|
+
"atomcat": "application/atomcat+xml",
|
|
1427
|
+
"atomdeleted": "application/atomdeleted+xml",
|
|
1428
|
+
"atomsvc": "application/atomsvc+xml",
|
|
1429
|
+
"au": "audio/basic",
|
|
1430
|
+
"avci": "image/avci",
|
|
1431
|
+
"avcs": "image/avcs",
|
|
1432
|
+
"avif": "image/avif",
|
|
1433
|
+
"aw": "application/applixware",
|
|
1434
|
+
"bdoc": "application/bdoc",
|
|
1435
|
+
"bin": "application/octet-stream",
|
|
1436
|
+
"bmp": "image/bmp",
|
|
1437
|
+
"bpk": "application/octet-stream",
|
|
1438
|
+
"btf": "image/prs.btif",
|
|
1439
|
+
"btif": "image/prs.btif",
|
|
1440
|
+
"buffer": "application/octet-stream",
|
|
1441
|
+
"ccxml": "application/ccxml+xml",
|
|
1442
|
+
"cdfx": "application/cdfx+xml",
|
|
1443
|
+
"cdmia": "application/cdmi-capability",
|
|
1444
|
+
"cdmic": "application/cdmi-container",
|
|
1445
|
+
"cdmid": "application/cdmi-domain",
|
|
1446
|
+
"cdmio": "application/cdmi-object",
|
|
1447
|
+
"cdmiq": "application/cdmi-queue",
|
|
1448
|
+
"cer": "application/pkix-cert",
|
|
1449
|
+
"cgm": "image/cgm",
|
|
1450
|
+
"cjs": "application/node",
|
|
1451
|
+
"class": "application/java-vm",
|
|
1452
|
+
"coffee": "text/coffeescript",
|
|
1453
|
+
"conf": "text/plain",
|
|
1454
|
+
"cpl": "application/cpl+xml",
|
|
1455
|
+
"cpt": "application/mac-compactpro",
|
|
1456
|
+
"crl": "application/pkix-crl",
|
|
1457
|
+
"css": "text/css",
|
|
1458
|
+
"csv": "text/csv",
|
|
1459
|
+
"cu": "application/cu-seeme",
|
|
1460
|
+
"cwl": "application/cwl",
|
|
1461
|
+
"cww": "application/prs.cww",
|
|
1462
|
+
"davmount": "application/davmount+xml",
|
|
1463
|
+
"dbk": "application/docbook+xml",
|
|
1464
|
+
"deb": "application/octet-stream",
|
|
1465
|
+
"def": "text/plain",
|
|
1466
|
+
"deploy": "application/octet-stream",
|
|
1467
|
+
"dib": "image/bmp",
|
|
1468
|
+
"disposition-notification": "message/disposition-notification",
|
|
1469
|
+
"dist": "application/octet-stream",
|
|
1470
|
+
"distz": "application/octet-stream",
|
|
1471
|
+
"dll": "application/octet-stream",
|
|
1472
|
+
"dmg": "application/octet-stream",
|
|
1473
|
+
"dms": "application/octet-stream",
|
|
1474
|
+
"doc": "application/msword",
|
|
1475
|
+
"dot": "application/msword",
|
|
1476
|
+
"dpx": "image/dpx",
|
|
1477
|
+
"drle": "image/dicom-rle",
|
|
1478
|
+
"dsc": "text/prs.lines.tag",
|
|
1479
|
+
"dssc": "application/dssc+der",
|
|
1480
|
+
"dtd": "application/xml-dtd",
|
|
1481
|
+
"dump": "application/octet-stream",
|
|
1482
|
+
"dwd": "application/atsc-dwd+xml",
|
|
1483
|
+
"ear": "application/java-archive",
|
|
1484
|
+
"ecma": "application/ecmascript",
|
|
1485
|
+
"elc": "application/octet-stream",
|
|
1486
|
+
"emf": "image/emf",
|
|
1487
|
+
"eml": "message/rfc822",
|
|
1488
|
+
"emma": "application/emma+xml",
|
|
1489
|
+
"emotionml": "application/emotionml+xml",
|
|
1490
|
+
"eps": "application/postscript",
|
|
1491
|
+
"epub": "application/epub+zip",
|
|
1492
|
+
"exe": "application/octet-stream",
|
|
1493
|
+
"exi": "application/exi",
|
|
1494
|
+
"exp": "application/express",
|
|
1495
|
+
"exr": "image/aces",
|
|
1496
|
+
"ez": "application/andrew-inset",
|
|
1497
|
+
"fdf": "application/fdf",
|
|
1498
|
+
"fdt": "application/fdt+xml",
|
|
1499
|
+
"fits": "image/fits",
|
|
1500
|
+
"g3": "image/g3fax",
|
|
1501
|
+
"gbr": "application/rpki-ghostbusters",
|
|
1502
|
+
"geojson": "application/geo+json",
|
|
1503
|
+
"gif": "image/gif",
|
|
1504
|
+
"glb": "model/gltf-binary",
|
|
1505
|
+
"gltf": "model/gltf+json",
|
|
1506
|
+
"gml": "application/gml+xml",
|
|
1507
|
+
"gpx": "application/gpx+xml",
|
|
1508
|
+
"gram": "application/srgs",
|
|
1509
|
+
"grxml": "application/srgs+xml",
|
|
1510
|
+
"gxf": "application/gxf",
|
|
1511
|
+
"gz": "application/gzip",
|
|
1512
|
+
"h261": "video/h261",
|
|
1513
|
+
"h263": "video/h263",
|
|
1514
|
+
"h264": "video/h264",
|
|
1515
|
+
"heic": "image/heic",
|
|
1516
|
+
"heics": "image/heic-sequence",
|
|
1517
|
+
"heif": "image/heif",
|
|
1518
|
+
"heifs": "image/heif-sequence",
|
|
1519
|
+
"hej2": "image/hej2k",
|
|
1520
|
+
"held": "application/atsc-held+xml",
|
|
1521
|
+
"hjson": "application/hjson",
|
|
1522
|
+
"hlp": "application/winhlp",
|
|
1523
|
+
"hqx": "application/mac-binhex40",
|
|
1524
|
+
"hsj2": "image/hsj2",
|
|
1525
|
+
"htm": "text/html",
|
|
1526
|
+
"html": "text/html",
|
|
1527
|
+
"ics": "text/calendar",
|
|
1528
|
+
"ief": "image/ief",
|
|
1529
|
+
"ifb": "text/calendar",
|
|
1530
|
+
"iges": "model/iges",
|
|
1531
|
+
"igs": "model/iges",
|
|
1532
|
+
"img": "application/octet-stream",
|
|
1533
|
+
"in": "text/plain",
|
|
1534
|
+
"ini": "text/plain",
|
|
1535
|
+
"ink": "application/inkml+xml",
|
|
1536
|
+
"inkml": "application/inkml+xml",
|
|
1537
|
+
"ipfix": "application/ipfix",
|
|
1538
|
+
"iso": "application/octet-stream",
|
|
1539
|
+
"its": "application/its+xml",
|
|
1540
|
+
"jade": "text/jade",
|
|
1541
|
+
"jar": "application/java-archive",
|
|
1542
|
+
"jhc": "image/jphc",
|
|
1543
|
+
"jls": "image/jls",
|
|
1544
|
+
"jp2": "image/jp2",
|
|
1545
|
+
"jpe": "image/jpeg",
|
|
1546
|
+
"jpeg": "image/jpeg",
|
|
1547
|
+
"jpf": "image/jpx",
|
|
1548
|
+
"jpg": "image/jpeg",
|
|
1549
|
+
"jpg2": "image/jp2",
|
|
1550
|
+
"jpgm": "image/jpm",
|
|
1551
|
+
"jpgv": "video/jpeg",
|
|
1552
|
+
"jph": "image/jph",
|
|
1553
|
+
"jpm": "image/jpm",
|
|
1554
|
+
"jpx": "image/jpx",
|
|
1555
|
+
"js": "text/javascript",
|
|
1556
|
+
"json": "application/json",
|
|
1557
|
+
"json5": "application/json5",
|
|
1558
|
+
"jsonld": "application/ld+json",
|
|
1559
|
+
"jsonml": "application/jsonml+json",
|
|
1560
|
+
"jsx": "text/jsx",
|
|
1561
|
+
"jt": "model/jt",
|
|
1562
|
+
"jxl": "image/jxl",
|
|
1563
|
+
"jxr": "image/jxr",
|
|
1564
|
+
"jxra": "image/jxra",
|
|
1565
|
+
"jxrs": "image/jxrs",
|
|
1566
|
+
"jxs": "image/jxs",
|
|
1567
|
+
"jxsc": "image/jxsc",
|
|
1568
|
+
"jxsi": "image/jxsi",
|
|
1569
|
+
"jxss": "image/jxss",
|
|
1570
|
+
"kar": "audio/midi",
|
|
1571
|
+
"ktx": "image/ktx",
|
|
1572
|
+
"ktx2": "image/ktx2",
|
|
1573
|
+
"less": "text/less",
|
|
1574
|
+
"lgr": "application/lgr+xml",
|
|
1575
|
+
"list": "text/plain",
|
|
1576
|
+
"litcoffee": "text/coffeescript",
|
|
1577
|
+
"log": "text/plain",
|
|
1578
|
+
"lostxml": "application/lost+xml",
|
|
1579
|
+
"lrf": "application/octet-stream",
|
|
1580
|
+
"m1v": "video/mpeg",
|
|
1581
|
+
"m21": "application/mp21",
|
|
1582
|
+
"m2a": "audio/mpeg",
|
|
1583
|
+
"m2t": "video/mp2t",
|
|
1584
|
+
"m2ts": "video/mp2t",
|
|
1585
|
+
"m2v": "video/mpeg",
|
|
1586
|
+
"m3a": "audio/mpeg",
|
|
1587
|
+
"m4a": "audio/mp4",
|
|
1588
|
+
"m4p": "application/mp4",
|
|
1589
|
+
"m4s": "video/iso.segment",
|
|
1590
|
+
"ma": "application/mathematica",
|
|
1591
|
+
"mads": "application/mads+xml",
|
|
1592
|
+
"maei": "application/mmt-aei+xml",
|
|
1593
|
+
"man": "text/troff",
|
|
1594
|
+
"manifest": "text/cache-manifest",
|
|
1595
|
+
"map": "application/json",
|
|
1596
|
+
"mar": "application/octet-stream",
|
|
1597
|
+
"markdown": "text/markdown",
|
|
1598
|
+
"mathml": "application/mathml+xml",
|
|
1599
|
+
"mb": "application/mathematica",
|
|
1600
|
+
"mbox": "application/mbox",
|
|
1601
|
+
"md": "text/markdown",
|
|
1602
|
+
"mdx": "text/mdx",
|
|
1603
|
+
"me": "text/troff",
|
|
1604
|
+
"mesh": "model/mesh",
|
|
1605
|
+
"meta4": "application/metalink4+xml",
|
|
1606
|
+
"metalink": "application/metalink+xml",
|
|
1607
|
+
"mets": "application/mets+xml",
|
|
1608
|
+
"mft": "application/rpki-manifest",
|
|
1609
|
+
"mid": "audio/midi",
|
|
1610
|
+
"midi": "audio/midi",
|
|
1611
|
+
"mime": "message/rfc822",
|
|
1612
|
+
"mj2": "video/mj2",
|
|
1613
|
+
"mjp2": "video/mj2",
|
|
1614
|
+
"mjs": "text/javascript",
|
|
1615
|
+
"mml": "text/mathml",
|
|
1616
|
+
"mods": "application/mods+xml",
|
|
1617
|
+
"mov": "video/quicktime",
|
|
1618
|
+
"mp2": "audio/mpeg",
|
|
1619
|
+
"mp21": "application/mp21",
|
|
1620
|
+
"mp2a": "audio/mpeg",
|
|
1621
|
+
"mp3": "audio/mpeg",
|
|
1622
|
+
"mp4": "video/mp4",
|
|
1623
|
+
"mp4a": "audio/mp4",
|
|
1624
|
+
"mp4s": "application/mp4",
|
|
1625
|
+
"mp4v": "video/mp4",
|
|
1626
|
+
"mpd": "application/dash+xml",
|
|
1627
|
+
"mpe": "video/mpeg",
|
|
1628
|
+
"mpeg": "video/mpeg",
|
|
1629
|
+
"mpf": "application/media-policy-dataset+xml",
|
|
1630
|
+
"mpg": "video/mpeg",
|
|
1631
|
+
"mpg4": "video/mp4",
|
|
1632
|
+
"mpga": "audio/mpeg",
|
|
1633
|
+
"mpp": "application/dash-patch+xml",
|
|
1634
|
+
"mrc": "application/marc",
|
|
1635
|
+
"mrcx": "application/marcxml+xml",
|
|
1636
|
+
"ms": "text/troff",
|
|
1637
|
+
"mscml": "application/mediaservercontrol+xml",
|
|
1638
|
+
"msh": "model/mesh",
|
|
1639
|
+
"msi": "application/octet-stream",
|
|
1640
|
+
"msix": "application/msix",
|
|
1641
|
+
"msixbundle": "application/msixbundle",
|
|
1642
|
+
"msm": "application/octet-stream",
|
|
1643
|
+
"msp": "application/octet-stream",
|
|
1644
|
+
"mtl": "model/mtl",
|
|
1645
|
+
"mts": "video/mp2t",
|
|
1646
|
+
"musd": "application/mmt-usd+xml",
|
|
1647
|
+
"mxf": "application/mxf",
|
|
1648
|
+
"mxmf": "audio/mobile-xmf",
|
|
1649
|
+
"mxml": "application/xv+xml",
|
|
1650
|
+
"n3": "text/n3",
|
|
1651
|
+
"nb": "application/mathematica",
|
|
1652
|
+
"nq": "application/n-quads",
|
|
1653
|
+
"nt": "application/n-triples",
|
|
1654
|
+
"obj": "model/obj",
|
|
1655
|
+
"oda": "application/oda",
|
|
1656
|
+
"oga": "audio/ogg",
|
|
1657
|
+
"ogg": "audio/ogg",
|
|
1658
|
+
"ogv": "video/ogg",
|
|
1659
|
+
"ogx": "application/ogg",
|
|
1660
|
+
"omdoc": "application/omdoc+xml",
|
|
1661
|
+
"onepkg": "application/onenote",
|
|
1662
|
+
"onetmp": "application/onenote",
|
|
1663
|
+
"onetoc": "application/onenote",
|
|
1664
|
+
"onetoc2": "application/onenote",
|
|
1665
|
+
"opf": "application/oebps-package+xml",
|
|
1666
|
+
"opus": "audio/ogg",
|
|
1667
|
+
"otf": "font/otf",
|
|
1668
|
+
"owl": "application/rdf+xml",
|
|
1669
|
+
"oxps": "application/oxps",
|
|
1670
|
+
"p10": "application/pkcs10",
|
|
1671
|
+
"p7c": "application/pkcs7-mime",
|
|
1672
|
+
"p7m": "application/pkcs7-mime",
|
|
1673
|
+
"p7s": "application/pkcs7-signature",
|
|
1674
|
+
"p8": "application/pkcs8",
|
|
1675
|
+
"pdf": "application/pdf",
|
|
1676
|
+
"pfr": "application/font-tdpfr",
|
|
1677
|
+
"pgp": "application/pgp-encrypted",
|
|
1678
|
+
"pkg": "application/octet-stream",
|
|
1679
|
+
"pki": "application/pkixcmp",
|
|
1680
|
+
"pkipath": "application/pkix-pkipath",
|
|
1681
|
+
"pls": "application/pls+xml",
|
|
1682
|
+
"png": "image/png",
|
|
1683
|
+
"prc": "model/prc",
|
|
1684
|
+
"prf": "application/pics-rules",
|
|
1685
|
+
"provx": "application/provenance+xml",
|
|
1686
|
+
"ps": "application/postscript",
|
|
1687
|
+
"pskcxml": "application/pskc+xml",
|
|
1688
|
+
"pti": "image/prs.pti",
|
|
1689
|
+
"qt": "video/quicktime",
|
|
1690
|
+
"raml": "application/raml+yaml",
|
|
1691
|
+
"rapd": "application/route-apd+xml",
|
|
1692
|
+
"rdf": "application/rdf+xml",
|
|
1693
|
+
"relo": "application/p2p-overlay+xml",
|
|
1694
|
+
"rif": "application/reginfo+xml",
|
|
1695
|
+
"rl": "application/resource-lists+xml",
|
|
1696
|
+
"rld": "application/resource-lists-diff+xml",
|
|
1697
|
+
"rmi": "audio/midi",
|
|
1698
|
+
"rnc": "application/relax-ng-compact-syntax",
|
|
1699
|
+
"rng": "application/xml",
|
|
1700
|
+
"roa": "application/rpki-roa",
|
|
1701
|
+
"roff": "text/troff",
|
|
1702
|
+
"rq": "application/sparql-query",
|
|
1703
|
+
"rs": "application/rls-services+xml",
|
|
1704
|
+
"rsat": "application/atsc-rsat+xml",
|
|
1705
|
+
"rsd": "application/rsd+xml",
|
|
1706
|
+
"rsheet": "application/urc-ressheet+xml",
|
|
1707
|
+
"rss": "application/rss+xml",
|
|
1708
|
+
"rtf": "text/rtf",
|
|
1709
|
+
"rtx": "text/richtext",
|
|
1710
|
+
"rusd": "application/route-usd+xml",
|
|
1711
|
+
"s3m": "audio/s3m",
|
|
1712
|
+
"sbml": "application/sbml+xml",
|
|
1713
|
+
"scq": "application/scvp-cv-request",
|
|
1714
|
+
"scs": "application/scvp-cv-response",
|
|
1715
|
+
"sdp": "application/sdp",
|
|
1716
|
+
"senmlx": "application/senml+xml",
|
|
1717
|
+
"sensmlx": "application/sensml+xml",
|
|
1718
|
+
"ser": "application/java-serialized-object",
|
|
1719
|
+
"setpay": "application/set-payment-initiation",
|
|
1720
|
+
"setreg": "application/set-registration-initiation",
|
|
1721
|
+
"sgi": "image/sgi",
|
|
1722
|
+
"sgm": "text/sgml",
|
|
1723
|
+
"sgml": "text/sgml",
|
|
1724
|
+
"shex": "text/shex",
|
|
1725
|
+
"shf": "application/shf+xml",
|
|
1726
|
+
"shtml": "text/html",
|
|
1727
|
+
"sieve": "application/sieve",
|
|
1728
|
+
"sig": "application/pgp-signature",
|
|
1729
|
+
"sil": "audio/silk",
|
|
1730
|
+
"silo": "model/mesh",
|
|
1731
|
+
"siv": "application/sieve",
|
|
1732
|
+
"slim": "text/slim",
|
|
1733
|
+
"slm": "text/slim",
|
|
1734
|
+
"sls": "application/route-s-tsid+xml",
|
|
1735
|
+
"smi": "application/smil+xml",
|
|
1736
|
+
"smil": "application/smil+xml",
|
|
1737
|
+
"snd": "audio/basic",
|
|
1738
|
+
"so": "application/octet-stream",
|
|
1739
|
+
"spdx": "text/spdx",
|
|
1740
|
+
"spp": "application/scvp-vp-response",
|
|
1741
|
+
"spq": "application/scvp-vp-request",
|
|
1742
|
+
"spx": "audio/ogg",
|
|
1743
|
+
"sql": "application/sql",
|
|
1744
|
+
"sru": "application/sru+xml",
|
|
1745
|
+
"srx": "application/sparql-results+xml",
|
|
1746
|
+
"ssdl": "application/ssdl+xml",
|
|
1747
|
+
"ssml": "application/ssml+xml",
|
|
1748
|
+
"stk": "application/hyperstudio",
|
|
1749
|
+
"stl": "model/stl",
|
|
1750
|
+
"stpx": "model/step+xml",
|
|
1751
|
+
"stpxz": "model/step-xml+zip",
|
|
1752
|
+
"stpz": "model/step+zip",
|
|
1753
|
+
"styl": "text/stylus",
|
|
1754
|
+
"stylus": "text/stylus",
|
|
1755
|
+
"svg": "image/svg+xml",
|
|
1756
|
+
"svgz": "image/svg+xml",
|
|
1757
|
+
"swidtag": "application/swid+xml",
|
|
1758
|
+
"t": "text/troff",
|
|
1759
|
+
"t38": "image/t38",
|
|
1760
|
+
"td": "application/urc-targetdesc+xml",
|
|
1761
|
+
"tei": "application/tei+xml",
|
|
1762
|
+
"teicorpus": "application/tei+xml",
|
|
1763
|
+
"text": "text/plain",
|
|
1764
|
+
"tfi": "application/thraud+xml",
|
|
1765
|
+
"tfx": "image/tiff-fx",
|
|
1766
|
+
"tif": "image/tiff",
|
|
1767
|
+
"tiff": "image/tiff",
|
|
1768
|
+
"toml": "application/toml",
|
|
1769
|
+
"tr": "text/troff",
|
|
1770
|
+
"trig": "application/trig",
|
|
1771
|
+
"ts": "video/mp2t",
|
|
1772
|
+
"tsd": "application/timestamped-data",
|
|
1773
|
+
"tsv": "text/tab-separated-values",
|
|
1774
|
+
"ttc": "font/collection",
|
|
1775
|
+
"ttf": "font/ttf",
|
|
1776
|
+
"ttl": "text/turtle",
|
|
1777
|
+
"ttml": "application/ttml+xml",
|
|
1778
|
+
"txt": "text/plain",
|
|
1779
|
+
"u3d": "model/u3d",
|
|
1780
|
+
"u8dsn": "message/global-delivery-status",
|
|
1781
|
+
"u8hdr": "message/global-headers",
|
|
1782
|
+
"u8mdn": "message/global-disposition-notification",
|
|
1783
|
+
"u8msg": "message/global",
|
|
1784
|
+
"ubj": "application/ubjson",
|
|
1785
|
+
"uri": "text/uri-list",
|
|
1786
|
+
"uris": "text/uri-list",
|
|
1787
|
+
"urls": "text/uri-list",
|
|
1788
|
+
"vcard": "text/vcard",
|
|
1789
|
+
"vrml": "model/vrml",
|
|
1790
|
+
"vtt": "text/vtt",
|
|
1791
|
+
"vxml": "application/voicexml+xml",
|
|
1792
|
+
"war": "application/java-archive",
|
|
1793
|
+
"wasm": "application/wasm",
|
|
1794
|
+
"wav": "audio/wav",
|
|
1795
|
+
"weba": "audio/webm",
|
|
1796
|
+
"webm": "video/webm",
|
|
1797
|
+
"webmanifest": "application/manifest+json",
|
|
1798
|
+
"webp": "image/webp",
|
|
1799
|
+
"wgsl": "text/wgsl",
|
|
1800
|
+
"wgt": "application/widget",
|
|
1801
|
+
"wif": "application/watcherinfo+xml",
|
|
1802
|
+
"wmf": "image/wmf",
|
|
1803
|
+
"woff": "font/woff",
|
|
1804
|
+
"woff2": "font/woff2",
|
|
1805
|
+
"wrl": "model/vrml",
|
|
1806
|
+
"wsdl": "application/wsdl+xml",
|
|
1807
|
+
"wspolicy": "application/wspolicy+xml",
|
|
1808
|
+
"x3d": "model/x3d+xml",
|
|
1809
|
+
"x3db": "model/x3d+fastinfoset",
|
|
1810
|
+
"x3dbz": "model/x3d+binary",
|
|
1811
|
+
"x3dv": "model/x3d-vrml",
|
|
1812
|
+
"x3dvz": "model/x3d+vrml",
|
|
1813
|
+
"x3dz": "model/x3d+xml",
|
|
1814
|
+
"xaml": "application/xaml+xml",
|
|
1815
|
+
"xav": "application/xcap-att+xml",
|
|
1816
|
+
"xca": "application/xcap-caps+xml",
|
|
1817
|
+
"xcs": "application/calendar+xml",
|
|
1818
|
+
"xdf": "application/xcap-diff+xml",
|
|
1819
|
+
"xdssc": "application/dssc+xml",
|
|
1820
|
+
"xel": "application/xcap-el+xml",
|
|
1821
|
+
"xenc": "application/xenc+xml",
|
|
1822
|
+
"xer": "application/patch-ops-error+xml",
|
|
1823
|
+
"xfdf": "application/xfdf",
|
|
1824
|
+
"xht": "application/xhtml+xml",
|
|
1825
|
+
"xhtml": "application/xhtml+xml",
|
|
1826
|
+
"xhvml": "application/xv+xml",
|
|
1827
|
+
"xlf": "application/xliff+xml",
|
|
1828
|
+
"xm": "audio/xm",
|
|
1829
|
+
"xml": "text/xml",
|
|
1830
|
+
"xns": "application/xcap-ns+xml",
|
|
1831
|
+
"xop": "application/xop+xml",
|
|
1832
|
+
"xpl": "application/xproc+xml",
|
|
1833
|
+
"xsd": "application/xml",
|
|
1834
|
+
"xsf": "application/prs.xsf+xml",
|
|
1835
|
+
"xsl": "application/xml",
|
|
1836
|
+
"xslt": "application/xml",
|
|
1837
|
+
"xspf": "application/xspf+xml",
|
|
1838
|
+
"xvm": "application/xv+xml",
|
|
1839
|
+
"xvml": "application/xv+xml",
|
|
1840
|
+
"yaml": "text/yaml",
|
|
1841
|
+
"yang": "application/yang",
|
|
1842
|
+
"yin": "application/yin+xml",
|
|
1843
|
+
"yml": "text/yaml",
|
|
1844
|
+
"zip": "application/zip"
|
|
1845
|
+
};
|
|
1846
|
+
|
|
1847
|
+
function lookup(extn) {
|
|
1848
|
+
let tmp = ('' + extn).trim().toLowerCase();
|
|
1849
|
+
let idx = tmp.lastIndexOf('.');
|
|
1850
|
+
return mimes[!~idx ? tmp : tmp.substring(++idx)];
|
|
1851
|
+
}
|
|
1852
|
+
|
|
1853
|
+
const $$Astro$1 = createAstro();
|
|
1854
|
+
const $$Picture = createComponent(async ($$result, $$props, $$slots) => {
|
|
1855
|
+
const Astro2 = $$result.createAstro($$Astro$1, $$props, $$slots);
|
|
1856
|
+
Astro2.self = $$Picture;
|
|
1857
|
+
const defaultFormats = ["webp"];
|
|
1858
|
+
const defaultFallbackFormat = "png";
|
|
1859
|
+
const specialFormatsFallback = ["gif", "svg", "jpg", "jpeg"];
|
|
1860
|
+
const { formats = defaultFormats, pictureAttributes = {}, fallbackFormat, ...props } = Astro2.props;
|
|
1861
|
+
if (props.alt === void 0 || props.alt === null) {
|
|
1862
|
+
throw new AstroError(ImageMissingAlt);
|
|
1863
|
+
}
|
|
1864
|
+
const scopedStyleClass = props.class?.match(/\bastro-\w{8}\b/)?.[0];
|
|
1865
|
+
if (scopedStyleClass) {
|
|
1866
|
+
if (pictureAttributes.class) {
|
|
1867
|
+
pictureAttributes.class = `${pictureAttributes.class} ${scopedStyleClass}`;
|
|
1868
|
+
} else {
|
|
1869
|
+
pictureAttributes.class = scopedStyleClass;
|
|
1870
|
+
}
|
|
1871
|
+
}
|
|
1872
|
+
const layout = props.layout ?? imageConfig.layout ?? "none";
|
|
1873
|
+
const useResponsive = layout !== "none";
|
|
1874
|
+
if (useResponsive) {
|
|
1875
|
+
props.layout ??= imageConfig.layout;
|
|
1876
|
+
props.fit ??= imageConfig.objectFit ?? "cover";
|
|
1877
|
+
props.position ??= imageConfig.objectPosition ?? "center";
|
|
1878
|
+
}
|
|
1879
|
+
for (const key in props) {
|
|
1880
|
+
if (key.startsWith("data-astro-cid")) {
|
|
1881
|
+
pictureAttributes[key] = props[key];
|
|
1882
|
+
}
|
|
1883
|
+
}
|
|
1884
|
+
const originalSrc = await resolveSrc(props.src);
|
|
1885
|
+
const optimizedImages = await Promise.all(
|
|
1886
|
+
formats.map(
|
|
1887
|
+
async (format) => await getImage({
|
|
1888
|
+
...props,
|
|
1889
|
+
src: originalSrc,
|
|
1890
|
+
format,
|
|
1891
|
+
widths: props.widths,
|
|
1892
|
+
densities: props.densities
|
|
1893
|
+
})
|
|
1894
|
+
)
|
|
1895
|
+
);
|
|
1896
|
+
let resultFallbackFormat = fallbackFormat ?? defaultFallbackFormat;
|
|
1897
|
+
if (!fallbackFormat && isESMImportedImage(originalSrc) && specialFormatsFallback.includes(originalSrc.format)) {
|
|
1898
|
+
resultFallbackFormat = originalSrc.format;
|
|
1899
|
+
}
|
|
1900
|
+
const fallbackImage = await getImage({
|
|
1901
|
+
...props,
|
|
1902
|
+
format: resultFallbackFormat,
|
|
1903
|
+
widths: props.widths,
|
|
1904
|
+
densities: props.densities
|
|
1905
|
+
});
|
|
1906
|
+
const imgAdditionalAttributes = {};
|
|
1907
|
+
const sourceAdditionalAttributes = {};
|
|
1908
|
+
if (props.sizes) {
|
|
1909
|
+
sourceAdditionalAttributes.sizes = props.sizes;
|
|
1910
|
+
}
|
|
1911
|
+
if (fallbackImage.srcSet.values.length > 0) {
|
|
1912
|
+
imgAdditionalAttributes.srcset = fallbackImage.srcSet.attribute;
|
|
1913
|
+
}
|
|
1914
|
+
const { class: className, ...attributes } = {
|
|
1915
|
+
...imgAdditionalAttributes,
|
|
1916
|
+
...fallbackImage.attributes
|
|
1917
|
+
};
|
|
1918
|
+
return renderTemplate`${maybeRenderHead()}<picture${spreadAttributes(pictureAttributes)}> ${Object.entries(optimizedImages).map(([_, image]) => {
|
|
1919
|
+
const srcsetAttribute = props.densities || !props.densities && !props.widths && !useResponsive ? `${image.src}${image.srcSet.values.length > 0 ? ", " + image.srcSet.attribute : ""}` : image.srcSet.attribute;
|
|
1920
|
+
return renderTemplate`<source${addAttribute(srcsetAttribute, "srcset")}${addAttribute(lookup(image.options.format ?? image.src) ?? `image/${image.options.format}`, "type")}${spreadAttributes(sourceAdditionalAttributes)}>`;
|
|
1921
|
+
})} <img${addAttribute(fallbackImage.src, "src")}${spreadAttributes(attributes)}${addAttribute(className, "class")}> </picture>`;
|
|
1922
|
+
}, "/home/runner/work/patternfly-doc-core/patternfly-doc-core/node_modules/astro/components/Picture.astro", void 0);
|
|
1923
|
+
|
|
1924
|
+
const mod = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
|
|
1925
|
+
__proto__: null
|
|
1926
|
+
}, Symbol.toStringTag, { value: 'Module' }));
|
|
1927
|
+
|
|
1928
|
+
const $$Astro = createAstro();
|
|
1929
|
+
const $$Font = createComponent(($$result, $$props, $$slots) => {
|
|
1930
|
+
const Astro2 = $$result.createAstro($$Astro, $$props, $$slots);
|
|
1931
|
+
Astro2.self = $$Font;
|
|
1932
|
+
const { fontsData } = mod;
|
|
1933
|
+
if (!fontsData) {
|
|
1934
|
+
throw new AstroError(ExperimentalFontsNotEnabled);
|
|
1935
|
+
}
|
|
1936
|
+
const { cssVariable, preload = false } = Astro2.props;
|
|
1937
|
+
const data = fontsData.get(cssVariable);
|
|
1938
|
+
if (!data) {
|
|
1939
|
+
throw new AstroError({
|
|
1940
|
+
...FontFamilyNotFound,
|
|
1941
|
+
message: FontFamilyNotFound.message(cssVariable)
|
|
1942
|
+
});
|
|
1943
|
+
}
|
|
1944
|
+
return renderTemplate`${preload && data.preloadData.map(({ url, type }) => renderTemplate`<link rel="preload"${addAttribute(url, "href")} as="font"${addAttribute(`font/${type}`, "type")} crossorigin>`)}<style>${unescapeHTML(data.css)}</style>`;
|
|
1945
|
+
}, "/home/runner/work/patternfly-doc-core/patternfly-doc-core/node_modules/astro/components/Font.astro", void 0);
|
|
1946
|
+
|
|
1947
|
+
const imageConfig = {"endpoint":{"route":"/_image","entrypoint":"@astrojs/cloudflare/image-endpoint"},"service":{"entrypoint":"astro/assets/services/sharp","config":{}},"domains":[],"remotePatterns":[],"responsiveStyles":false};
|
|
1948
|
+
const getImage = async (options) => await getImage$1(options, imageConfig);
|
|
1949
|
+
|
|
1950
|
+
const _astro_assets = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
|
|
1951
|
+
__proto__: null,
|
|
1952
|
+
getConfiguredImageService,
|
|
1953
|
+
getImage,
|
|
1954
|
+
imageConfig,
|
|
1955
|
+
inferRemoteSize,
|
|
1956
|
+
isLocalService
|
|
1957
|
+
}, Symbol.toStringTag, { value: 'Module' }));
|
|
1958
|
+
|
|
1959
|
+
export { _astro_assets as _, imageConfig as a, baseService as b, isRemoteAllowed as i, parseQuality as p };
|