@ks89/angular-modal-gallery 15.0.1 → 16.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +53 -0
- package/CONTRIBUTING.md +3 -3
- package/README.md +94 -101
- package/fesm2022/ks89-angular-modal-gallery.mjs +392 -306
- package/fesm2022/ks89-angular-modal-gallery.mjs.map +1 -1
- package/package.json +36 -29
- package/types/ks89-angular-modal-gallery.d.ts +76 -94
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ks89-angular-modal-gallery.mjs","sources":["../../../../projects/ks89/angular-modal-gallery/src/lib/utils/user-input.util.ts","../../../../projects/ks89/angular-modal-gallery/src/lib/components/accessible.component.ts","../../../../projects/ks89/angular-modal-gallery/src/lib/model/image.class.ts","../../../../projects/ks89/angular-modal-gallery/src/lib/model/action.enum.ts","../../../../projects/ks89/angular-modal-gallery/src/lib/utils/image.util.ts","../../../../projects/ks89/angular-modal-gallery/src/lib/model/description.interface.ts","../../../../projects/ks89/angular-modal-gallery/src/lib/components/accessibility-default.ts","../../../../projects/ks89/angular-modal-gallery/src/lib/model/buttons-config.interface.ts","../../../../projects/ks89/angular-modal-gallery/src/lib/model/plain-gallery-config.interface.ts","../../../../projects/ks89/angular-modal-gallery/src/lib/model/loading-config.interface.ts","../../../../projects/ks89/angular-modal-gallery/src/lib/model/keyboard.enum.ts","../../../../projects/ks89/angular-modal-gallery/src/lib/services/config.service.ts","../../../../projects/ks89/angular-modal-gallery/src/lib/directives/max-size.directive.ts","../../../../projects/ks89/angular-modal-gallery/src/lib/directives/size.directive.ts","../../../../projects/ks89/angular-modal-gallery/src/lib/directives/fallback-image.directive.ts","../../../../projects/ks89/angular-modal-gallery/src/lib/directives/description.directive.ts","../../../../projects/ks89/angular-modal-gallery/src/lib/components/dots/dots.component.ts","../../../../projects/ks89/angular-modal-gallery/src/lib/components/dots/dots.html","../../../../projects/ks89/angular-modal-gallery/src/lib/components/carousel/carousel-previews/carousel-previews.component.ts","../../../../projects/ks89/angular-modal-gallery/src/lib/components/carousel/carousel-previews/carousel-previews.html","../../../../projects/ks89/angular-modal-gallery/src/lib/components/carousel/carousel.component.ts","../../../../projects/ks89/angular-modal-gallery/src/lib/components/carousel/carousel.html","../../../../projects/ks89/angular-modal-gallery/src/lib/components/upper-buttons/upper-buttons-default.ts","../../../../projects/ks89/angular-modal-gallery/src/lib/components/upper-buttons/upper-buttons.component.ts","../../../../projects/ks89/angular-modal-gallery/src/lib/components/upper-buttons/upper-buttons.html","../../../../projects/ks89/angular-modal-gallery/src/lib/components/previews/previews.component.ts","../../../../projects/ks89/angular-modal-gallery/src/lib/components/previews/previews.html","../../../../projects/ks89/angular-modal-gallery/src/lib/directives/keyboard-navigation.directive.ts","../../../../projects/ks89/angular-modal-gallery/src/lib/directives/swipe.directive.ts","../../../../projects/ks89/angular-modal-gallery/src/lib/components/current-image/loading-spinner/loading-spinner.component.ts","../../../../projects/ks89/angular-modal-gallery/src/lib/components/current-image/loading-spinner/loading-spinner.html","../../../../projects/ks89/angular-modal-gallery/src/lib/components/current-image/current-image.component.ts","../../../../projects/ks89/angular-modal-gallery/src/lib/components/current-image/current-image.html","../../../../projects/ks89/angular-modal-gallery/src/lib/directives/wrap.directive.ts","../../../../projects/ks89/angular-modal-gallery/src/lib/directives/direction.directive.ts","../../../../projects/ks89/angular-modal-gallery/src/lib/directives/a-tag-bg-image.directive.ts","../../../../projects/ks89/angular-modal-gallery/src/lib/components/plain-gallery/plain-gallery.component.ts","../../../../projects/ks89/angular-modal-gallery/src/lib/components/plain-gallery/plain-gallery.html","../../../../projects/ks89/angular-modal-gallery/src/lib/components/modal-gallery/modal-gallery.tokens.ts","../../../../projects/ks89/angular-modal-gallery/src/lib/services/id-validator.service.ts","../../../../projects/ks89/angular-modal-gallery/src/lib/components/modal-gallery/modal-gallery-ref.ts","../../../../projects/ks89/angular-modal-gallery/src/lib/components/modal-gallery/modal-gallery.service.ts","../../../../projects/ks89/angular-modal-gallery/src/lib/directives/click-outside.directive.ts","../../../../projects/ks89/angular-modal-gallery/src/lib/components/modal-gallery/modal-gallery.component.ts","../../../../projects/ks89/angular-modal-gallery/src/lib/components/modal-gallery/modal-gallery.component.html","../../../../projects/ks89/angular-modal-gallery/src/lib/components/components.ts","../../../../projects/ks89/angular-modal-gallery/src/lib/directives/margin.directive.ts","../../../../projects/ks89/angular-modal-gallery/src/lib/directives/directives.ts","../../../../projects/ks89/angular-modal-gallery/src/lib/components/modal-gallery/attach-to-overlay.service.ts","../../../../projects/ks89/angular-modal-gallery/src/lib/modal-gallery.module.ts","../../../../projects/ks89/angular-modal-gallery/src/public-api.ts","../../../../projects/ks89/angular-modal-gallery/src/ks89-angular-modal-gallery.ts"],"sourcesContent":["/*\n The MIT License (MIT)\n\n Copyright (c) 2017-2026 Stefano Cappa (Ks89)\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\n\n/**\n * Key of the keyboard's key `enter`\n */\nexport const ENTER_KEY: string = 'Enter';\n/**\n * Code of the keyboard's key `enter`\n */\nexport const ENTER_CODE: string = 'Enter';\n\n/**\n * Key of the keyboard's key `esc`\n */\nexport const ESC_KEY: string = 'Escape';\n/**\n * Code of the keyboard's key `esc`\n */\nexport const ESC_CODE: string = 'Escape';\n/**\n * Key of the keyboard's key 'right arrow'\n */\nexport const RIGHT_ARROW_KEY: string = 'ArrowRight';\n/**\n * Code of the keyboard's key 'right arrow'\n */\nexport const RIGHT_ARROW_CODE: string = 'ArrowRight';\n/**\n * Key of the keyboard's key 'left arrow'\n */\nexport const LEFT_ARROW_KEY: string = 'ArrowLeft';\n/**\n * Code of the keyboard's key 'left arrow'\n */\nexport const LEFT_ARROW_CODE: string = 'ArrowLeft';\n/**\n * Key of the keyboard's key 'left arrow'\n */\nexport const UP_ARROW_KEY: string = 'ArrowUp';\n/**\n * Code of the keyboard's key 'left arrow'\n */\nexport const UP_ARROW_CODE: string = 'ArrowUp';\n/**\n * Key of the keyboard's key 'left arrow'\n */\nexport const DOWN_ARROW_KEY: string = 'ArrowDown';\n/**\n * Code of the keyboard's key 'left arrow'\n */\nexport const DOWN_ARROW_CODE: string = 'ArrowDown';\n/**\n * Key of the keyboard's key `space`\n */\nexport const SPACE_KEY : string= '';\n/**\n * Code of the keyboard's key `space`\n */\nexport const SPACE_CODE: string = 'Space';\n\n/**\n * Const to represent the right direction\n */\nexport const DIRECTION_RIGHT: string = 'right';\n/**\n * Const to represent the left direction\n */\nexport const DIRECTION_LEFT: string = 'left';\n\n\n/**\n * Keycode of the main mouse button\n */\nexport const MOUSE_MAIN_BUTTON_CLICK = 0;\n\n/**\n * Const NEXT\n */\nexport const NEXT = 1;\n/**\n * Const PREV\n */\nexport const PREV = -1;\n/**\n * Const NOTHING to represents a situation when it isn't both NEXT and PREV\n */\nexport const NOTHING = 0;\n","/*\n The MIT License (MIT)\n\n Copyright (c) 2017-2026 Stefano Cappa (Ks89)\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\n\nimport { ChangeDetectionStrategy, Component } from '@angular/core';\n\nimport { DIRECTION_RIGHT, MOUSE_MAIN_BUTTON_CLICK, NEXT, NOTHING, PREV, ENTER_CODE, SPACE_CODE } from '../utils/user-input.util';\n\n/**\n * Provides some useful methods to add accessibility features to subclasses.\n * In particular, it exposes a method to handle navigation event with both Keyboard and Mouse\n * and another with also the direction (right or left).\n */\n@Component({\n selector: 'ks-accessible',\n template: ``,\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class AccessibleComponent {\n /**\n * Method to handle navigation events with both Keyboard and Mouse.\n * @param direction string of the navigation that can be either 'next' or 'prev'\n * @param event KeyboardEvent | MouseEvent payload\n * @returns number -1 for PREV, 1 for NEXT and 0 for NOTHING\n */\n handleNavigationEvent(direction: string, event: KeyboardEvent | MouseEvent): number {\n if (!event) {\n return NOTHING;\n }\n if (event instanceof KeyboardEvent) {\n return this.handleKeyboardNavigationEvent(direction, event);\n } else if (event instanceof MouseEvent) {\n return this.handleMouseNavigationEvent(direction, event);\n }\n return NOTHING;\n }\n\n /**\n * Method to handle events over an image, for instance a keypress with the Keyboard or a Mouse click.\n * @param event KeyboardEvent | MouseEvent payload\n * @returns number 1 for NEXT and 0 for NOTHING\n */\n handleImageEvent(event: KeyboardEvent | MouseEvent): number {\n if (!event) {\n return NOTHING;\n }\n if (event instanceof KeyboardEvent) {\n return this.handleImageKeyboardEvent(event);\n } else if (event instanceof MouseEvent) {\n return this.handleImageMouseEvent(event);\n }\n return NOTHING;\n }\n\n /**\n * Private method to handle keyboard events over an image.\n * @param event KeyboardEvent payload\n * @returns number 1 for NEXT and 0 for NOTHING\n */\n private handleImageKeyboardEvent(event: KeyboardEvent): number {\n const key: string = event.code;\n if (key === SPACE_CODE || key === ENTER_CODE) {\n return NEXT;\n }\n return NOTHING;\n }\n\n /**\n * Private method to handle mouse events over an image.\n * @param event MouseEvent payload\n * @returns number 1 for NEXT and 0 for NOTHING\n */\n private handleImageMouseEvent(event: MouseEvent): number {\n const mouseBtn: number = event.button;\n if (mouseBtn === MOUSE_MAIN_BUTTON_CLICK) {\n return NEXT;\n }\n return NOTHING;\n }\n\n /**\n * Method to handle events over an image, for instance a keypress with the Keyboard or a Mouse click.\n * @param direction string of the navigation that can be either 'next' or 'prev'\n * @param event KeyboardEvent payload\n * @returns number -1 for PREV, 1 for NEXT and 0 for NOTHING\n */\n private handleKeyboardNavigationEvent(direction: string, event: KeyboardEvent): number {\n const key: string = event.code;\n if (key === SPACE_CODE || key === ENTER_CODE) {\n return direction === DIRECTION_RIGHT ? NEXT : PREV;\n }\n return NOTHING;\n }\n\n /**\n * Method to handle events over an image, for instance a keypress with the Keyboard or a Mouse click.\n * @param direction string of the navigation that can be either 'next' or 'prev'\n * @param event MouseEvent payload\n * @returns number -1 for PREV, 1 for NEXT and 0 for NOTHING\n */\n private handleMouseNavigationEvent(direction: string, event: MouseEvent): number {\n const mouseBtn: number = event.button;\n if (mouseBtn === MOUSE_MAIN_BUTTON_CLICK) {\n return direction === DIRECTION_RIGHT ? NEXT : PREV;\n }\n return NOTHING;\n }\n}\n","/*\n The MIT License (MIT)\n\n Copyright (c) 2017-2026 Stefano Cappa (Ks89)\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\n\nimport { Action } from './action.enum';\nimport { Size } from './size.interface';\nimport { SafeResourceUrl } from '@angular/platform-browser';\n\n/**\n * Class `Image` that represents an image with both `modal` and `plain` configurations.\n * Both image `id` and `modal` are mandatory, instead `plain` is optional.\n */\nexport class Image {\n id: number;\n loading: 'eager' | 'lazy';\n fetchpriority: 'high' | 'low' | 'auto';\n modal: ModalImage;\n plain?: PlainImage;\n\n constructor(id: number, modal: ModalImage, plain?: PlainImage, loading: 'eager' | 'lazy' = 'lazy', fetchpriority: 'high' | 'low' | 'auto' = 'auto') {\n this.id = id;\n this.modal = modal;\n this.plain = plain;\n this.loading = loading;\n this.fetchpriority = fetchpriority\n }\n}\n\n/**\n * Interface `ImageData` to configure an image, but it isn't used directly.\n * Please, refers to `PlainImage` or `ModalImage`.\n */\nexport interface ImageData {\n img: string | SafeResourceUrl;\n description?: string;\n title?: string;\n alt?: string;\n ariaLabel?: string;\n fallbackImg?: string | SafeResourceUrl;\n}\n\n/**\n * Interface `ModalImage` to configure the modal image.\n */\nexport interface ModalImage extends ImageData {\n extUrl?: string;\n downloadFileName?: string;\n sources?: Source[];\n}\n\n/**\n * Interface `PlainImage` to configure the plain image.\n */\nexport interface PlainImage extends ImageData {\n size?: Size;\n}\n\n/**\n * Class `ImageEvent` that represents the event payload with the result and the triggered action.\n * It also contains the source id of the gallery that emitted this event\n */\nexport class ImageEvent {\n galleryId: number;\n action: Action;\n result: number | boolean;\n\n constructor(galleryId: number, action: Action, result: number | boolean) {\n this.galleryId = galleryId;\n this.action = action;\n this.result = result;\n }\n}\n\n/**\n * Class `ImageModalEvent` that represents the event payload with galleryId, result and the triggered action.\n */\nexport class ImageModalEvent extends ImageEvent {\n constructor(galleryId: number, action: Action, result: number | boolean) {\n super(galleryId, action, result);\n }\n}\n\n/**\n * Interface `Source` to configure sources of picture element.\n */\nexport interface Source {\n srcset: string;\n media: string;\n}\n","/*\n The MIT License (MIT)\n\n Copyright (c) 2017-2026 Stefano Cappa (Ks89)\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\n\n/**\n * Enum `Action` with a list of possible actions, based on the source of the action.\n */\nexport enum Action {\n NORMAL, // default value\n CLICK, // mouse click\n KEYBOARD,\n SWIPE,\n LOAD,\n AUTOPLAY\n}\n","/*\n The MIT License (MIT)\n\n Copyright (c) 2017-2026 Stefano Cappa (Ks89)\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\n\nimport { Image } from '../model/image.class';\n\n/**\n * Utility function to get the index of the input `image` from `arrayOfImages`\n * @param image Image to get the index. The image 'id' must be a number >= 0\n * @param arrayOfImages Image[] to search the image within it\n * @returns number the index of the image. -1 if not found.\n * @throws an Error if either image or arrayOfImages are not valid,\n * or if the input image doesn't contain an 'id', or the 'id' is < 0\n */\nexport function getIndex(image: Image, arrayOfImages: Image[]): number {\n if (!image) {\n throw new Error('image must be a valid Image object');\n }\n\n if (!arrayOfImages) {\n throw new Error('arrayOfImages must be a valid Image[]');\n }\n\n if (!image.id && image.id !== 0) {\n // id = 0 is admitted\n throw new Error(`A numeric Image 'id' is mandatory`);\n }\n\n if (image.id < 0) {\n throw new Error(`Image 'id' must be >= 0`);\n }\n\n return arrayOfImages.findIndex((val: Image) => val.id === image.id);\n}\n","/*\n The MIT License (MIT)\n\n Copyright (c) 2017-2026 Stefano Cappa (Ks89)\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\n\n/**\n * Interface `Description` to change the description, either with a full custom\n * description or with a small and simple customization.\n * Also, you could change margins, background style and so on.\n */\nexport interface Description {\n strategy: DescriptionStrategy;\n customFullDescription?: string;\n imageText?: string;\n numberSeparator?: string;\n beforeTextDescription?: string;\n\n style?: DescriptionStyle;\n}\n\n/**\n * Enum `DescriptionStrategy` with keys and their relative key codes.\n */\nexport enum DescriptionStrategy {\n ALWAYS_HIDDEN = 1,\n ALWAYS_VISIBLE,\n HIDE_IF_EMPTY\n}\n\n/**\n * Interface to change css properties.\n */\nexport interface DescriptionStyle {\n bgColor?: string;\n textColor?: string;\n width?: string;\n height?: string;\n position?: string;\n top?: string;\n bottom?: string;\n left?: string;\n right?: string;\n marginTop?: string;\n marginBottom?: string;\n marginRight?: string;\n marginLeft?: string;\n}\n","import { AccessibilityConfig } from '../model/accessibility.interface';\n\n/**\n * Default accessibility configuration.\n */\nexport const KS_DEFAULT_ACCESSIBILITY_CONFIG: AccessibilityConfig = {\n backgroundAriaLabel: 'Modal gallery full screen background',\n backgroundTitle: '',\n\n plainGalleryContentAriaLabel: 'Plain gallery content',\n plainGalleryContentTitle: '',\n\n modalGalleryContentAriaLabel: 'Modal gallery content',\n modalGalleryContentTitle: '',\n\n loadingSpinnerAriaLabel: 'The current image is loading. Please be patient.',\n loadingSpinnerTitle: 'The current image is loading. Please be patient.',\n\n mainContainerAriaLabel: 'Current image and navigation',\n mainContainerTitle: '',\n mainPrevImageAriaLabel: 'Previous image',\n mainPrevImageTitle: 'Previous image',\n mainNextImageAriaLabel: 'Next image',\n mainNextImageTitle: 'Next image',\n\n dotsContainerAriaLabel: 'Image navigation dots',\n dotsContainerTitle: '',\n dotAriaLabel: 'Navigate to image number',\n\n previewsContainerAriaLabel: 'Image previews',\n previewsContainerTitle: '',\n previewScrollPrevAriaLabel: 'Scroll previous previews',\n previewScrollPrevTitle: 'Scroll previous previews',\n previewScrollNextAriaLabel: 'Scroll next previews',\n previewScrollNextTitle: 'Scroll next previews',\n\n carouselContainerAriaLabel: 'Current image and navigation',\n carouselContainerTitle: '',\n carouselPrevImageAriaLabel: 'Previous image',\n carouselPrevImageTitle: 'Previous image',\n carouselNextImageAriaLabel: 'Next image',\n carouselNextImageTitle: 'Next image',\n carouselPreviewsContainerAriaLabel: 'Image previews',\n carouselPreviewsContainerTitle: '',\n carouselPreviewScrollPrevAriaLabel: 'Scroll previous previews',\n carouselPreviewScrollPrevTitle: 'Scroll previous previews',\n carouselPreviewScrollNextAriaLabel: 'Scroll next previews',\n carouselPreviewScrollNextTitle: 'Scroll next previews'\n};\n","/*\n The MIT License (MIT)\n\n Copyright (c) 2017-2026 Stefano Cappa (Ks89)\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\n\nimport { Action } from './action.enum';\nimport { InternalLibImage } from './image-internal.class';\nimport { Size } from './size.interface';\n\n/**\n * Interface `ButtonsConfig` to add buttons, show/hide their, and to add the strategy.\n */\nexport interface ButtonsConfig {\n visible: boolean;\n strategy: ButtonsStrategy;\n buttons?: ButtonConfig[];\n}\n\n/**\n * Interface `ButtonConfig` to configure a single button.\n */\nexport interface ButtonConfig {\n className?: string;\n size?: Size;\n fontSize?: string;\n type: ButtonType;\n title?: string;\n ariaLabel?: string;\n extUrlInNewTab?: boolean; // to open the external url in a new tab, instead of the current one\n}\n\n/**\n * Interface `ButtonEvent` to represent the event payload when a button is clicked.\n */\nexport interface ButtonEvent {\n button: ButtonConfig;\n image: InternalLibImage | null;\n action: Action;\n galleryId: number;\n}\n\n/**\n * Enum `ButtonsStrategy` to configure the logic of a button.\n */\nexport enum ButtonsStrategy {\n // don't use 0 here\n // the first index is 1 and all of the following members are auto-incremented from that point on\n DEFAULT = 1,\n SIMPLE,\n ADVANCED,\n FULL,\n CUSTOM\n}\n\n/**\n * Enum `ButtonType` is the type of a button.\n */\nexport enum ButtonType {\n // don't use 0 here\n // the first index is 1 and all of the following members are auto-incremented from that point on\n DELETE = 1,\n EXTURL,\n DOWNLOAD,\n CLOSE,\n CUSTOM,\n FULLSCREEN\n}\n\n/**\n * Array of admitted types of buttons.\n */\nexport const WHITELIST_BUTTON_TYPES: ButtonType[] = [\n ButtonType.FULLSCREEN,\n ButtonType.DELETE,\n ButtonType.EXTURL,\n ButtonType.DOWNLOAD,\n ButtonType.CLOSE,\n ButtonType.CUSTOM\n];\n","/*\n The MIT License (MIT)\n\n Copyright (c) 2017-2026 Stefano Cappa (Ks89)\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\n\nimport { Size } from './size.interface';\n\n/**\n * Interface `PlainGalleryConfig` to configure plain-gallery features.\n */\nexport interface PlainGalleryConfig {\n strategy: PlainGalleryStrategy;\n layout: PlainGalleryLayout;\n advanced?: AdvancedConfig;\n}\n\n/**\n * Interface `PlainGalleryLayout` to configure the layout. This interface isn't used directly, instead\n * refers to either `LineLayout`, `GridLayout`.\n */\n// tslint:disable-next-line no-empty-interface\nexport interface PlainGalleryLayout {}\n\n/**\n * Class `LineLayout` to configure a linear plain gallery.\n */\nexport class LineLayout implements PlainGalleryLayout {\n breakConfig: BreakConfig;\n justify: string;\n size: Size;\n\n constructor(size: Size, breakConfig: BreakConfig, justify: string) {\n this.size = size;\n this.breakConfig = breakConfig;\n this.justify = justify;\n }\n}\n\n/**\n * Class `GridLayout` to configure a grid plain gallery.\n */\nexport class GridLayout implements PlainGalleryLayout {\n breakConfig: BreakConfig;\n size: Size;\n\n constructor(size: Size, breakConfig: BreakConfig) {\n this.size = size;\n this.breakConfig = breakConfig;\n }\n}\n\n/**\n * Enum `PlainGalleryStrategy` to choose the behaviour of the plain gallery.\n */\nexport enum PlainGalleryStrategy {\n // don't use 0 here\n // the first index is 1 and all of the following members are auto-incremented from that point on\n ROW = 1,\n COLUMN,\n GRID,\n CUSTOM // full custom strategy\n}\n\n/**\n * Interface `BreakConfig` to limit the number of items of the plain gallery or to force it to fill other lines.\n */\nexport interface BreakConfig {\n length: number;\n wrap: boolean;\n}\n\n/**\n * Interface `AdvancedConfig` to use `<a>` tags instead of `<img>`.\n * It also contains a string property to customize the css background property.\n * For more info check here https://www.w3schools.com/cssref/css3_pr_background.asp\n */\nexport interface AdvancedConfig {\n aTags: boolean;\n additionalBackground: string;\n}\n","/*\n The MIT License (MIT)\n\n Copyright (c) 2017-2026 Stefano Cappa (Ks89)\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\n\n/**\n * Interface `LoadingConfig` to configure loading icon.\n */\nexport interface LoadingConfig {\n enable: boolean;\n type: LoadingType;\n}\n\n/**\n * Enum `LoadingType` with a list of possible types.\n */\nexport enum LoadingType {\n STANDARD = 1,\n CIRCULAR,\n BARS,\n DOTS,\n CUBE_FLIPPING,\n CIRCLES,\n EXPLOSING_SQUARES\n}\n","/*\n The MIT License (MIT)\n\n Copyright (c) 2017-2026 Stefano Cappa (Ks89)\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\n\n/**\n * Enum `Keyboard` with keys and their relative codes.\n */\nimport { DOWN_ARROW_CODE, ESC_CODE, LEFT_ARROW_CODE, RIGHT_ARROW_CODE, UP_ARROW_CODE } from '../utils/user-input.util';\n\ntype Keyboard = Readonly<{\n ESC: typeof ESC_CODE,\n LEFT_ARROW: typeof LEFT_ARROW_CODE,\n RIGHT_ARROW: typeof RIGHT_ARROW_CODE,\n UP_ARROW: typeof UP_ARROW_CODE,\n DOWN_ARROW: typeof DOWN_ARROW_CODE\n}>;\n\nexport const Keyboard: Keyboard = {\n ESC: ESC_CODE,\n LEFT_ARROW: LEFT_ARROW_CODE,\n RIGHT_ARROW: RIGHT_ARROW_CODE,\n UP_ARROW: UP_ARROW_CODE,\n DOWN_ARROW: DOWN_ARROW_CODE\n};\n","/*\n The MIT License (MIT)\n\n Copyright (c) 2017-2026 Stefano Cappa (Ks89)\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\n\nimport { Injectable } from '@angular/core';\nimport { SidePreviewsConfig, SlideConfig } from '../model/slide-config.interface';\nimport { PlayConfig } from '../model/play-config.interface';\nimport { KS_DEFAULT_ACCESSIBILITY_CONFIG } from '../components/accessibility-default';\nimport { PreviewConfig } from '../model/preview-config.interface';\nimport { Size } from '../model/size.interface';\nimport { ButtonsConfig, ButtonsStrategy } from '../model/buttons-config.interface';\nimport { DotsConfig } from '../model/dots-config.interface';\nimport { GridLayout, LineLayout, PlainGalleryConfig, PlainGalleryStrategy } from '../model/plain-gallery-config.interface';\nimport { CurrentImageConfig } from '../model/current-image-config.interface';\nimport { LoadingConfig, LoadingType } from '../model/loading-config.interface';\nimport { Description, DescriptionStrategy, DescriptionStyle } from '../model/description.interface';\nimport { CarouselConfig } from '../model/carousel-config.interface';\nimport { CarouselImageConfig } from '../model/carousel-image-config.interface';\nimport { BreakpointsConfig, CarouselPreviewConfig } from '../model/carousel-preview-config.interface';\nimport { DeepRequired, LibConfig, LibConfigInternal } from '../model/lib-config.interface';\nimport { Keyboard } from '../model/keyboard.enum';\nimport { KeyboardConfig } from '../model/keyboard-config.interface';\n\nexport const DEFAULT_PREVIEW_SIZE: DeepRequired<Size> = { height: '50px', width: 'auto' };\nexport const DEFAULT_LAYOUT: LineLayout = new LineLayout(DEFAULT_PREVIEW_SIZE, { length: -1, wrap: false }, 'flex-start');\nexport const DEFAULT_PLAIN_CONFIG: DeepRequired<PlainGalleryConfig> = {\n strategy: PlainGalleryStrategy.ROW,\n layout: DEFAULT_LAYOUT,\n advanced: { aTags: false, additionalBackground: '50% 50%/cover' }\n};\nexport const DEFAULT_LOADING: DeepRequired<LoadingConfig> = { enable: true, type: LoadingType.STANDARD };\nexport const DEFAULT_DESCRIPTION_STYLE: DeepRequired<DescriptionStyle> = {\n bgColor: 'rgba(0, 0, 0, .5)',\n textColor: 'white',\n marginTop: '0px',\n marginBottom: '0px',\n marginLeft: '0px',\n marginRight: '0px',\n width: '',\n height: '',\n position: '',\n top: '',\n bottom: '',\n left: '',\n right: ''\n};\nexport const DEFAULT_DESCRIPTION: DeepRequired<Description> = {\n strategy: DescriptionStrategy.ALWAYS_VISIBLE,\n imageText: 'Image ',\n numberSeparator: '/',\n beforeTextDescription: ' - ',\n customFullDescription: '',\n style: DEFAULT_DESCRIPTION_STYLE\n};\nexport const DEFAULT_CAROUSEL_DESCRIPTION: DeepRequired<Description> = {\n strategy: DescriptionStrategy.ALWAYS_HIDDEN,\n imageText: 'Image ',\n numberSeparator: '/',\n beforeTextDescription: ' - ',\n customFullDescription: '',\n style: DEFAULT_DESCRIPTION_STYLE\n};\nexport const DEFAULT_CURRENT_IMAGE_CONFIG: DeepRequired<CurrentImageConfig> = {\n navigateOnClick: true,\n loadingConfig: DEFAULT_LOADING,\n description: DEFAULT_DESCRIPTION,\n downloadable: false,\n invertSwipe: false\n};\nexport const DEFAULT_CAROUSEL_IMAGE_CONFIG: DeepRequired<CarouselImageConfig> = {\n description: DEFAULT_CAROUSEL_DESCRIPTION,\n invertSwipe: false\n};\nexport const DEFAULT_CURRENT_CAROUSEL_CONFIG: DeepRequired<CarouselConfig> = {\n maxWidth: '100%',\n maxHeight: '400px',\n showArrows: true,\n objectFit: 'cover',\n keyboardEnable: true,\n modalGalleryEnable: false\n};\nexport const DEFAULT_CURRENT_CAROUSEL_PLAY: DeepRequired<PlayConfig> = {\n autoPlay: true,\n interval: 5000,\n pauseOnHover: true\n};\n\nexport const DEFAULT_CAROUSEL_BREAKPOINTS: DeepRequired<BreakpointsConfig> = { xSmall: 100, small: 100, medium: 150, large: 200, xLarge: 200 };\nexport const DEFAULT_CAROUSEL_PREVIEWS_CONFIG: DeepRequired<CarouselPreviewConfig> = {\n visible: true,\n number: 4,\n arrows: true,\n clickable: true,\n width: 100 / 4 + '%',\n maxHeight: '200px',\n breakpoints: DEFAULT_CAROUSEL_BREAKPOINTS\n};\nexport const DEFAULT_SLIDE_CONFIG: DeepRequired<SlideConfig> = {\n infinite: false,\n playConfig: { autoPlay: false, interval: 5000, pauseOnHover: true } as DeepRequired<PlayConfig>,\n sidePreviews: { show: true, size: { width: '100px', height: 'auto' } } as DeepRequired<SidePreviewsConfig>\n};\nexport const DEFAULT_PREVIEW_CONFIG: DeepRequired<PreviewConfig> = {\n visible: true,\n number: 3,\n arrows: true,\n clickable: true,\n size: DEFAULT_PREVIEW_SIZE,\n mobileVisible: false\n};\nexport const DEFAULT_KEYBOARD_CONFIG: DeepRequired<KeyboardConfig> = {\n esc: Keyboard.ESC,\n right: Keyboard.RIGHT_ARROW,\n left: Keyboard.LEFT_ARROW\n};\n\nconst DEFAULT_CONFIG: LibConfigInternal = Object.freeze({\n slideConfig: DEFAULT_SLIDE_CONFIG,\n accessibilityConfig: KS_DEFAULT_ACCESSIBILITY_CONFIG,\n previewConfig: DEFAULT_PREVIEW_CONFIG,\n buttonsConfig: { visible: true, strategy: ButtonsStrategy.DEFAULT } as DeepRequired<ButtonsConfig>,\n dotsConfig: { visible: true } as DeepRequired<DotsConfig>,\n plainGalleryConfig: DEFAULT_PLAIN_CONFIG,\n currentImageConfig: DEFAULT_CURRENT_IMAGE_CONFIG,\n keyboardConfig: DEFAULT_KEYBOARD_CONFIG,\n carouselConfig: DEFAULT_CURRENT_CAROUSEL_CONFIG,\n carouselImageConfig: DEFAULT_CAROUSEL_IMAGE_CONFIG,\n carouselPreviewsConfig: DEFAULT_CAROUSEL_PREVIEWS_CONFIG,\n carouselPlayConfig: DEFAULT_CURRENT_CAROUSEL_PLAY,\n carouselDotsConfig: { visible: true } as DeepRequired<DotsConfig>,\n carouselSlideInfinite: true,\n enableCloseOutside: true\n});\n\n/**\n * Service to handle library configuration in a unique place\n */\n@Injectable({ providedIn: 'root' })\nexport class ConfigService {\n configMap: Map<number, LibConfigInternal> = new Map<number, LibConfigInternal>();\n\n getConfig(id: number): LibConfig | undefined {\n this.initIfNotExists(id);\n return this.configMap.get(id);\n }\n\n setConfig(id: number, obj: LibConfig | undefined): void {\n this.initIfNotExists(id);\n if (!obj) {\n return;\n }\n\n if (\n !DEFAULT_CONFIG ||\n !DEFAULT_CONFIG.slideConfig ||\n !DEFAULT_CONFIG.slideConfig.sidePreviews ||\n !DEFAULT_CONFIG.previewConfig ||\n !DEFAULT_CONFIG.previewConfig.size ||\n !DEFAULT_CONFIG.previewConfig.number ||\n !DEFAULT_CONFIG.plainGalleryConfig ||\n !DEFAULT_CONFIG.currentImageConfig ||\n !DEFAULT_CONFIG.currentImageConfig ||\n !DEFAULT_CONFIG.currentImageConfig.description ||\n !DEFAULT_CONFIG.carouselImageConfig ||\n !DEFAULT_CONFIG.carouselImageConfig.description ||\n !DEFAULT_CONFIG.carouselPreviewsConfig ||\n !DEFAULT_CONFIG.carouselPreviewsConfig.breakpoints ||\n !DEFAULT_CAROUSEL_PREVIEWS_CONFIG.number\n ) {\n throw new Error('Internal library error - DEFAULT_CONFIG must be fully initialized!!!');\n }\n\n const newConfig: LibConfigInternal = Object.assign({}, this.configMap.get(id));\n if (obj.slideConfig) {\n let playConfig;\n let sidePreviews;\n let size;\n if (obj.slideConfig.playConfig) {\n playConfig = Object.assign({}, DEFAULT_CONFIG.slideConfig.playConfig, obj.slideConfig.playConfig);\n } else {\n playConfig = DEFAULT_CONFIG.slideConfig.playConfig;\n }\n if (obj.slideConfig.sidePreviews) {\n if (obj.slideConfig.sidePreviews.size) {\n size = Object.assign({}, DEFAULT_CONFIG.slideConfig.sidePreviews.size, obj.slideConfig.sidePreviews.size);\n } else {\n size = DEFAULT_CONFIG.slideConfig.sidePreviews.size;\n }\n sidePreviews = Object.assign({}, DEFAULT_CONFIG.slideConfig.sidePreviews, obj.slideConfig.sidePreviews);\n } else {\n sidePreviews = DEFAULT_CONFIG.slideConfig.sidePreviews;\n size = DEFAULT_CONFIG.slideConfig.sidePreviews.size;\n }\n const newSlideConfig: DeepRequired<SlideConfig> = Object.assign({}, DEFAULT_CONFIG.slideConfig, obj.slideConfig);\n newSlideConfig.playConfig = playConfig;\n newSlideConfig.sidePreviews = sidePreviews;\n newSlideConfig.sidePreviews.size = size;\n newConfig.slideConfig = newSlideConfig;\n }\n if (obj.accessibilityConfig) {\n newConfig.accessibilityConfig = Object.assign({}, DEFAULT_CONFIG.accessibilityConfig, obj.accessibilityConfig);\n }\n if (obj.previewConfig) {\n let size: DeepRequired<Size>;\n let num: number;\n if (obj.previewConfig.size) {\n size = Object.assign({}, DEFAULT_CONFIG.previewConfig.size, obj.previewConfig.size);\n } else {\n size = DEFAULT_CONFIG.previewConfig.size;\n }\n if (obj.previewConfig.number) {\n if (obj.previewConfig.number <= 0) {\n // if number is <= 0 reset to default\n num = DEFAULT_CONFIG.previewConfig.number;\n } else {\n num = obj.previewConfig.number;\n }\n } else {\n num = DEFAULT_CONFIG.previewConfig.number;\n }\n const newPreviewConfig: DeepRequired<PreviewConfig> = Object.assign({}, DEFAULT_CONFIG.previewConfig, obj.previewConfig);\n newPreviewConfig.size = size;\n newPreviewConfig.number = num;\n newConfig.previewConfig = newPreviewConfig;\n }\n if (obj.buttonsConfig) {\n newConfig.buttonsConfig = Object.assign({}, DEFAULT_CONFIG.buttonsConfig, obj.buttonsConfig);\n }\n if (obj.dotsConfig) {\n newConfig.dotsConfig = Object.assign({}, DEFAULT_CONFIG.dotsConfig, obj.dotsConfig);\n }\n if (obj.plainGalleryConfig) {\n let advanced;\n let layout;\n if (obj.plainGalleryConfig.advanced) {\n advanced = Object.assign({}, DEFAULT_CONFIG.plainGalleryConfig.advanced, obj.plainGalleryConfig.advanced);\n } else {\n advanced = DEFAULT_CONFIG.plainGalleryConfig.advanced;\n }\n if (obj.plainGalleryConfig.layout) {\n // it isn't mandatory to use assign, because obj.plainGalleryConfig.layout is an instance of class (LineaLayout, GridLayout)\n layout = obj.plainGalleryConfig.layout;\n } else {\n layout = DEFAULT_CONFIG.plainGalleryConfig.layout;\n }\n const newPlainGalleryConfig: DeepRequired<PlainGalleryConfig> = Object.assign({}, DEFAULT_CONFIG.plainGalleryConfig, obj.plainGalleryConfig);\n newPlainGalleryConfig.layout = layout;\n newPlainGalleryConfig.advanced = advanced;\n newConfig.plainGalleryConfig = initPlainGalleryConfig(newPlainGalleryConfig);\n }\n if (obj.currentImageConfig) {\n let loading;\n let description;\n let descriptionStyle;\n if (obj.currentImageConfig.loadingConfig) {\n loading = Object.assign({}, DEFAULT_CONFIG.currentImageConfig.loadingConfig, obj.currentImageConfig.loadingConfig);\n } else {\n loading = DEFAULT_CONFIG.currentImageConfig.loadingConfig;\n }\n if (obj.currentImageConfig.description) {\n description = Object.assign({}, DEFAULT_CONFIG.currentImageConfig.description, obj.currentImageConfig.description);\n if (obj.currentImageConfig.description.style) {\n descriptionStyle = Object.assign({}, DEFAULT_CONFIG.currentImageConfig.description.style, obj.currentImageConfig.description.style);\n } else {\n descriptionStyle = DEFAULT_CONFIG.currentImageConfig.description.style;\n }\n } else {\n description = DEFAULT_CONFIG.currentImageConfig.description;\n descriptionStyle = DEFAULT_CONFIG.currentImageConfig.description.style;\n }\n const newCurrentImageConfig: DeepRequired<CurrentImageConfig> = Object.assign({}, DEFAULT_CONFIG.currentImageConfig, obj.currentImageConfig);\n newCurrentImageConfig.loadingConfig = loading;\n newCurrentImageConfig.description = description;\n newCurrentImageConfig.description.style = descriptionStyle;\n newConfig.currentImageConfig = newCurrentImageConfig;\n }\n if (obj.keyboardConfig) {\n newConfig.keyboardConfig = Object.assign({}, DEFAULT_CONFIG.keyboardConfig, obj.keyboardConfig);\n }\n\n // carousel\n if (obj.carouselConfig) {\n newConfig.carouselConfig = Object.assign({}, DEFAULT_CONFIG.carouselConfig, obj.carouselConfig);\n }\n if (obj.carouselImageConfig) {\n let description;\n let descriptionStyle;\n if (obj.carouselImageConfig.description) {\n description = Object.assign({}, DEFAULT_CONFIG.carouselImageConfig.description, obj.carouselImageConfig.description);\n if (obj.carouselImageConfig.description.style) {\n descriptionStyle = Object.assign({}, DEFAULT_CONFIG.carouselImageConfig.description.style, obj.carouselImageConfig.description.style);\n } else {\n descriptionStyle = DEFAULT_CONFIG.carouselImageConfig.description.style;\n }\n } else {\n description = DEFAULT_CONFIG.carouselImageConfig.description;\n descriptionStyle = DEFAULT_CONFIG.carouselImageConfig.description.style;\n }\n const newCarouselImageConfig: DeepRequired<CarouselImageConfig> = Object.assign({}, DEFAULT_CONFIG.carouselImageConfig, obj.carouselImageConfig);\n newCarouselImageConfig.description = description;\n newCarouselImageConfig.description.style = descriptionStyle;\n newConfig.carouselImageConfig = newCarouselImageConfig;\n }\n if (obj.carouselPlayConfig) {\n // check values\n if (obj.carouselPlayConfig.interval <= 0) {\n throw new Error(`Carousel's interval must be a number >= 0`);\n }\n newConfig.carouselPlayConfig = Object.assign({}, DEFAULT_CONFIG.carouselPlayConfig, obj.carouselPlayConfig);\n }\n if (obj.carouselPreviewsConfig) {\n // check values\n let num: number;\n let breakpoints: BreakpointsConfig;\n if (!obj.carouselPreviewsConfig.number || obj.carouselPreviewsConfig.number <= 0) {\n num = DEFAULT_CAROUSEL_PREVIEWS_CONFIG.number;\n } else {\n num = obj.carouselPreviewsConfig.number;\n }\n if (obj.carouselPreviewsConfig.breakpoints) {\n breakpoints = Object.assign({}, DEFAULT_CONFIG.carouselPreviewsConfig.breakpoints, obj.carouselPreviewsConfig.breakpoints);\n } else {\n breakpoints = DEFAULT_CONFIG.carouselPreviewsConfig.breakpoints;\n }\n newConfig.carouselPreviewsConfig = Object.assign({}, DEFAULT_CONFIG.carouselPreviewsConfig, obj.carouselPreviewsConfig);\n newConfig.carouselPreviewsConfig.number = num;\n newConfig.carouselPreviewsConfig.breakpoints = breakpoints;\n // Init preview image width based on the number of previews in PreviewConfig\n // Don't move this line above, because I need to be sure that both configPreview.number\n // and configPreview.size are initialized\n newConfig.carouselPreviewsConfig.width = 100 / newConfig.carouselPreviewsConfig.number + '%';\n }\n if (obj.carouselDotsConfig) {\n newConfig.carouselDotsConfig = Object.assign({}, DEFAULT_CONFIG.carouselDotsConfig, obj.carouselDotsConfig);\n }\n if (obj.carouselSlideInfinite === undefined) {\n newConfig.carouselSlideInfinite = DEFAULT_CONFIG.carouselSlideInfinite;\n } else {\n newConfig.carouselSlideInfinite = obj.carouselSlideInfinite;\n }\n if (obj.enableCloseOutside === undefined) {\n newConfig.enableCloseOutside = DEFAULT_CONFIG.enableCloseOutside;\n } else {\n newConfig.enableCloseOutside = obj.enableCloseOutside;\n }\n this.configMap.set(id, newConfig);\n }\n\n private initIfNotExists(id: number): void {\n if (!this.configMap.has(id)) {\n this.configMap.set(id, DEFAULT_CONFIG);\n }\n }\n}\n\n/**\n * Function to build and return a `PlainGalleryConfig` object, proving also default values and validating the input object.\n * @param plainGalleryConfig object with the config requested by user\n * @returns PlainGalleryConfig the plain gallery configuration\n * @throws an Error if layout and strategy aren't compatible\n */\nfunction initPlainGalleryConfig(plainGalleryConfig: PlainGalleryConfig): DeepRequired<PlainGalleryConfig> {\n const newPlayGalleryConfig: DeepRequired<PlainGalleryConfig> = Object.assign({}, DEFAULT_CONFIG.plainGalleryConfig, plainGalleryConfig);\n\n if (newPlayGalleryConfig.layout instanceof LineLayout) {\n if (newPlayGalleryConfig.strategy !== PlainGalleryStrategy.ROW && newPlayGalleryConfig.strategy !== PlainGalleryStrategy.COLUMN) {\n throw new Error('LineLayout requires either ROW or COLUMN strategy');\n }\n if (!newPlayGalleryConfig.layout || !newPlayGalleryConfig.layout.breakConfig) {\n throw new Error('Both layout and breakConfig must be valid');\n }\n }\n\n if (newPlayGalleryConfig.layout instanceof GridLayout) {\n if (newPlayGalleryConfig.strategy !== PlainGalleryStrategy.GRID) {\n throw new Error('GridLayout requires GRID strategy');\n }\n if (!newPlayGalleryConfig.layout || !newPlayGalleryConfig.layout.breakConfig) {\n throw new Error('Both layout and breakConfig must be valid');\n }\n // force wrap for grid layout\n newPlayGalleryConfig.layout.breakConfig.wrap = true;\n }\n return newPlayGalleryConfig;\n}\n","/*\n The MIT License (MIT)\n\n Copyright (c) 2017-2026 Stefano Cappa (Ks89)\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\n\nimport { Directive, ElementRef, inject, OnChanges, OnInit, Renderer2, input } from '@angular/core';\nimport { MaxSize } from '../model/max-size.interface';\n\n/**\n * Directive to change the max size of an element.\n */\n@Directive({ selector: '[ksMaxSize]' })\nexport class MaxSizeDirective implements OnInit, OnChanges {\n /**\n * Object of type `MaxSize` to resize the element.\n */\n readonly maxSizeConfig = input<MaxSize>();\n\n private renderer: Renderer2 = inject(Renderer2);\n private el: ElementRef = inject(ElementRef);\n\n /**\n * Method ´ngOnInit´ to apply the style of this directive.\n * This is an angular lifecycle hook, so its called automatically by Angular itself.\n * In particular, it's called only one time!!!\n */\n ngOnInit(): void {\n this.applyStyle();\n }\n\n /**\n * Method ´ngOnChanges´ to apply the style of this directive.\n * This is an angular lifecycle hook, so its called automatically by Angular itself.\n * In particular, it's called when any data-bound property of a directive changes!!!\n */\n ngOnChanges(): void {\n this.applyStyle();\n }\n\n /**\n * Private method to change both max-width and max-height of an element.\n */\n private applyStyle(): void {\n const maxSizeConfig = this.maxSizeConfig();\n if (!maxSizeConfig) {\n return;\n }\n if (maxSizeConfig.maxWidth) {\n this.renderer.setStyle(this.el.nativeElement, 'max-width', maxSizeConfig.maxWidth);\n }\n if (maxSizeConfig.maxHeight) {\n this.renderer.setStyle(this.el.nativeElement, 'max-height', maxSizeConfig.maxHeight);\n }\n }\n}\n","/*\n The MIT License (MIT)\n\n Copyright (c) 2017-2026 Stefano Cappa (Ks89)\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\n\nimport { Directive, ElementRef, inject, OnChanges, OnInit, Renderer2, input } from '@angular/core';\nimport { Size } from '../model/size.interface';\n\n/**\n * Directive to change the size of an element.\n */\n@Directive({ selector: '[ksSize]' })\nexport class SizeDirective implements OnInit, OnChanges {\n /**\n * Object of type `Size` to resize the element.\n */\n readonly sizeConfig = input<Size>();\n\n private renderer: Renderer2 = inject(Renderer2);\n private el: ElementRef = inject(ElementRef);\n\n /**\n * Method ´ngOnInit´ to apply the style of this directive.\n * This is an Angular lifecycle hook, so its called automatically by Angular itself.\n * In particular, it's called only one time!!!\n */\n ngOnInit(): void {\n this.applyStyle();\n }\n\n /**\n * Method ´ngOnChanges´ to apply the style of this directive.\n * This is an Angular lifecycle hook, so its called automatically by Angular itself.\n * In particular, it's called when any data-bound property of a directive changes!!!\n */\n ngOnChanges(): void {\n this.applyStyle();\n }\n\n /**\n * Private method to change both width and height of an element.\n */\n private applyStyle(): void {\n const sizeConfig = this.sizeConfig();\n if (!sizeConfig) {\n return;\n }\n // apply [style.width]\n if (sizeConfig.width) {\n this.renderer.setStyle(this.el.nativeElement, 'width', sizeConfig.width);\n }\n if (sizeConfig.height) {\n this.renderer.setStyle(this.el.nativeElement, 'height', sizeConfig.height);\n }\n }\n}\n","/*\n The MIT License (MIT)\n\n Copyright (c) 2017-2026 Stefano Cappa (Ks89)\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\n\nimport { Directive, ElementRef, HostListener, inject, Renderer2, output, input } from '@angular/core';\nimport { SafeResourceUrl } from '@angular/platform-browser';\n\n/**\n * Directive to add fallback image if the original one is not reachable.\n */\n@Directive({ selector: '[ksFallbackImage]' })\nexport class FallbackImageDirective {\n readonly fallbackImg = input<string | SafeResourceUrl>();\n\n readonly fallbackApplied = output<boolean>();\n\n private renderer: Renderer2 = inject(Renderer2);\n private el: ElementRef = inject(ElementRef);\n\n @HostListener('error') onError(): void {\n const fallbackImg = this.fallbackImg();\n if (!fallbackImg) {\n this.fallbackApplied.emit(false);\n return;\n }\n this.renderer.setAttribute(this.el.nativeElement, 'src', fallbackImg.toString());\n this.fallbackApplied.emit(true);\n }\n}\n","/*\n The MIT License (MIT)\n\n Copyright (c) 2017-2026 Stefano Cappa (Ks89)\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\n\nimport { Directive, ElementRef, inject, OnChanges, OnInit, Renderer2, input } from '@angular/core';\nimport { Description } from '../model/description.interface';\n\n/**\n * Directive to customize the description.\n */\n@Directive({ selector: '[ksDescription]' })\nexport class DescriptionDirective implements OnInit, OnChanges {\n /**\n * Object of type `Description` to resize the element.\n */\n readonly description = input<Description>();\n\n private renderer: Renderer2 = inject(Renderer2);\n private el: ElementRef = inject(ElementRef);\n\n /**\n * Method ´ngOnInit´ to apply the style of this directive.\n * This is an angular lifecycle hook, so its called automatically by Angular itself.\n * In particular, it's called only one time!!!\n */\n ngOnInit(): void {\n this.applyStyle();\n }\n\n /**\n * Method ´ngOnChanges´ to apply the style of this directive.\n * This is an angular lifecycle hook, so its called automatically by Angular itself.\n * In particular, it's called when any data-bound property of a directive changes!!!\n */\n ngOnChanges(): void {\n this.applyStyle();\n }\n\n /**\n * Private method to change description's style.\n */\n private applyStyle(): void {\n const description = this.description();\n if (!description) {\n return;\n }\n if (description.style) {\n this.renderer.setStyle(this.el.nativeElement, 'background', description.style.bgColor);\n this.renderer.setStyle(this.el.nativeElement, 'color', description.style.textColor);\n\n if (description.style.width) {\n this.renderer.setStyle(this.el.nativeElement, 'width', description.style.width);\n }\n if (description.style.height) {\n this.renderer.setStyle(this.el.nativeElement, 'height', description.style.height);\n }\n if (description.style.position) {\n this.renderer.setStyle(this.el.nativeElement, 'position', description.style.position);\n }\n if (description.style.top) {\n this.renderer.setStyle(this.el.nativeElement, 'top', description.style.top);\n }\n if (description.style.bottom) {\n this.renderer.setStyle(this.el.nativeElement, 'bottom', description.style.bottom);\n }\n if (description.style.left) {\n this.renderer.setStyle(this.el.nativeElement, 'left', description.style.left);\n }\n if (description.style.right) {\n this.renderer.setStyle(this.el.nativeElement, 'right', description.style.right);\n }\n\n this.renderer.setStyle(this.el.nativeElement, 'margin-top', description.style.marginTop ? description.style.marginTop : '0px');\n this.renderer.setStyle(this.el.nativeElement, 'margin-bottom', description.style.marginBottom ? description.style.marginBottom : '0px');\n this.renderer.setStyle(this.el.nativeElement, 'margin-left', description.style.marginLeft ? description.style.marginLeft : '0px');\n this.renderer.setStyle(this.el.nativeElement, 'margin-right', description.style.marginRight ? description.style.marginRight : '0px');\n }\n }\n}\n","/*\n The MIT License (MIT)\n\n Copyright (c) 2017-2026 Stefano Cappa (Ks89)\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\n\nimport { ChangeDetectionStrategy, Component, output, input } from '@angular/core';\nimport { NgClass } from '@angular/common';\n\nimport { AccessibleComponent } from '../accessible.component';\n\nimport { AccessibilityConfig } from '../../model/accessibility.interface';\nimport { DotsConfig } from '../../model/dots-config.interface';\n\nimport { NEXT } from '../../utils/user-input.util';\nimport { getIndex } from '../../utils/image.util';\nimport { Image } from '../../model/image.class';\n\n/**\n * Component with clickable dots (small circles) to navigate between images inside the modal gallery.\n */\n@Component({\n selector: 'ks-dots',\n styleUrls: ['dots.scss'],\n templateUrl: 'dots.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [NgClass]\n})\nexport class DotsComponent extends AccessibleComponent {\n /**\n * Unique id (>=0) of the current instance of this library. This is required when you are using\n * the service to call modal gallery.\n */\n readonly id = input.required<number>();\n /**\n * Object of type `InternalLibImage` that represent the visible image.\n */\n readonly currentImage = input.required<Image>();\n /**\n * Array of `InternalLibImage` that represent the model of this library with all images,\n * thumbs and so on.\n */\n readonly images = input.required<Image[]>();\n /**\n * Object of type `DotsConfig` to init DotsComponent's features.\n * For instance, it contains a param to show/hide this component.\n */\n readonly dotsConfig = input.required<DotsConfig>();\n /**\n * Object of type `AccessibilityConfig` to init custom accessibility features.\n * For instance, it contains titles, alt texts, aria-labels and so on.\n */\n readonly accessibilityConfig = input.required<AccessibilityConfig>();\n\n /**\n * Output to emit clicks on dots. The payload contains a number that represent\n * the index of the clicked dot.\n */\n readonly clickDot = output<number>();\n\n /**\n * Method to check if an image is active (i.e. the current image).\n * It checks currentImage and images to prevent errors.\n * @param index number of the image to check if it's active or not\n * @returns boolean true if is active (and input params are valid), false otherwise\n */\n isActive(index: number): boolean {\n const currentImage = this.currentImage();\n const images = this.images();\n if (!currentImage || !images || images.length === 0) {\n return false;\n }\n let imageIndex: number;\n try {\n imageIndex = getIndex(currentImage, images);\n } catch (err) {\n console.error(`Internal error while trying to show the active 'dot'`, err);\n return false;\n }\n return index === imageIndex;\n }\n\n /**\n * Method called by events from keyboard and mouse.\n * @param index number of the dot\n * @param event KeyboardEvent | MouseEvent payload\n */\n onDotEvent(index: number, event: KeyboardEvent | MouseEvent): void {\n const result: number = super.handleImageEvent(event);\n if (result === NEXT) {\n this.clickDot.emit(index);\n }\n }\n}\n","@let accessibilityConf = accessibilityConfig();\n@let dotsConf = dotsConfig();\n<nav class=\"dots-container\" [attr.aria-label]=\"accessibilityConf?.dotsContainerAriaLabel\"\n [title]=\"accessibilityConf?.dotsContainerTitle\">\n @if (!dotsConf || dotsConf?.visible) {\n @for (img of images(); let index = $index; track img.id) {\n <div class=\"inside dot\"\n [ngClass]=\"{'active': isActive(index)}\"\n [attr.aria-label]=\"accessibilityConf?.dotAriaLabel + ' ' + (index + 1)\"\n [tabIndex]=\"0\" role=\"navigation\"\n (click)=\"onDotEvent(index, $event)\" (keyup)=\"onDotEvent(index, $event)\"></div>\n }\n }\n</nav>\n","/*\n The MIT License (MIT)\n\n Copyright (c) 2017-2026 Stefano Cappa (Ks89)\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\n\nimport {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n HostBinding,\n OnChanges,\n OnDestroy,\n OnInit,\n SimpleChange,\n SimpleChanges,\n output,\n input, inject\n} from '@angular/core';\nimport { DomSanitizer, SafeResourceUrl, SafeStyle } from '@angular/platform-browser';\nimport { BreakpointObserver, Breakpoints, BreakpointState } from '@angular/cdk/layout';\n\nimport { Subscription } from 'rxjs';\n\nimport { AccessibleComponent } from '../../accessible.component';\n\nimport { AccessibilityConfig } from '../../../model/accessibility.interface';\nimport { Image, ImageEvent } from '../../../model/image.class';\nimport { CarouselPreviewConfig } from '../../../model/carousel-preview-config.interface';\nimport { CarouselConfig } from '../../../model/carousel-config.interface';\n\nimport { NEXT, PREV } from '../../../utils/user-input.util';\nimport { getIndex } from '../../../utils/image.util';\nimport { Action } from '../../../model/action.enum';\nimport { ConfigService } from '../../../services/config.service';\nimport { LibConfig } from '../../../model/lib-config.interface';\nimport { FallbackImageDirective } from '../../../directives/fallback-image.directive';\nimport { SizeDirective } from '../../../directives/size.directive';\nimport { InternalLibImage } from '../../../model/image-internal.class';\n\n/**\n * Default max height of previews.\n */\nconst DEFAULT_MAX_HEIGHT = '200px';\n\n/**\n * Component with image previews for carousel\n */\n@Component({\n selector: 'ks-carousel-previews',\n styleUrls: ['carousel-previews.scss', '../../previews-arrows.scss'],\n templateUrl: 'carousel-previews.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [FallbackImageDirective, SizeDirective]\n})\nexport class CarouselPreviewsComponent extends AccessibleComponent implements OnInit, OnChanges, OnDestroy {\n /**\n * Variable to change the max-width of the host component\n */\n @HostBinding('style.max-width')\n hostMaxWidth = '100%';\n\n /**\n * Variable to set aria-label of the host component\n */\n @HostBinding('attr.aria-label')\n ariaLabel = `Carousel previews`;\n\n /**\n * Unique id (>=0) of the current instance of the carousel. This is useful when you are using\n * the carousel's feature to open modal gallery.\n */\n readonly id = input.required<number>();\n /**\n * Object of type `Image` that represent the visible image.\n */\n readonly currentImage = input.required<InternalLibImage>();\n /**\n * Array of `Image` that represent the model of this library with all images,\n * thumbs and so on.\n */\n readonly images = input<Image[]>([]);\n\n /**\n * Output to emit the clicked preview. The payload contains the `Image` associated to the clicked preview.\n */\n readonly clickPreview = output<ImageEvent>();\n\n /**\n * Object of type `CarouselConfig` to init CarouselComponent's features.\n * For instance, it contains parameters to change the style, how it navigates and so on.\n */\n carouselConfig: CarouselConfig | undefined;\n /**\n * Object of type `CarouselPreviewConfig` to init PreviewsComponent's features.\n * For instance, it contains a param to show/hide this component, sizes.\n */\n previewConfig: CarouselPreviewConfig | undefined;\n /**\n * Object of type `AccessibilityConfig` to init custom accessibility features.\n * For instance, it contains titles, alt texts, aria-labels and so on.\n */\n accessibilityConfig: AccessibilityConfig | undefined;\n /**\n * Enum of type `Action` that represents a mouse click on a button.\n * Declared here to be used inside the template.\n */\n clickAction: Action = Action.CLICK;\n /**\n * Enum of type `Action` that represents a keyboard action.\n * Declared here to be used inside the template.\n */\n keyboardAction: Action = Action.KEYBOARD;\n /**\n * Array of `Image` exposed to the template. This field is initialized\n * applying transformations, default values and so on to the input of the same type.\n */\n previews: Image[] = [];\n /**\n * Variable with the preview's maxHeight\n */\n previewMaxHeight: string = DEFAULT_MAX_HEIGHT;\n /**\n * Start index (inclusive) of the input images used to display previews.\n */\n // @ts-ignore\n start: number;\n /**\n * End index (non-inclusive) of the input images used to display previews.\n */\n // @ts-ignore\n end: number;\n\n private readonly breakpointSubscription: Subscription;\n\n private ref: ChangeDetectorRef = inject(ChangeDetectorRef);\n private breakpointObserver: BreakpointObserver = inject(BreakpointObserver);\n // sanitizer is used only to sanitize style before add it to background property when legacyIE11Mode is enabled\n private sanitizer: DomSanitizer = inject(DomSanitizer);\n private configService: ConfigService = inject(ConfigService);\n\n constructor() {\n super();\n\n // listen for width changes and update preview heights accordingly\n this.breakpointSubscription = this.breakpointObserver\n .observe([Breakpoints.XSmall, Breakpoints.Small, Breakpoints.Medium, Breakpoints.Large, Breakpoints.XLarge])\n .subscribe((result: BreakpointState) => {\n if (!this.previewConfig || !this.previewConfig.breakpoints) {\n return;\n }\n if (result.breakpoints[Breakpoints.XSmall]) {\n this.updateHeight(this.previewConfig.breakpoints.xSmall);\n } else if (result.breakpoints[Breakpoints.Small]) {\n this.updateHeight(this.previewConfig.breakpoints.small);\n } else if (result.breakpoints[Breakpoints.Medium]) {\n this.updateHeight(this.previewConfig.breakpoints.medium);\n } else if (result.breakpoints[Breakpoints.Large]) {\n this.updateHeight(this.previewConfig.breakpoints.large);\n } else if (result.breakpoints[Breakpoints.XLarge]) {\n this.updateHeight(this.previewConfig.breakpoints.xLarge);\n }\n });\n }\n\n /**\n * Method to update the height of previews, passing the desired height as input.\n * @param configBreakpointHeight is a number that represent the desired height to set.\n */\n private updateHeight(configBreakpointHeight: number): void {\n if (this.previewConfig && this.previewConfig.maxHeight) {\n const heightNum: number = +this.previewConfig.maxHeight.replace('/px/g', '').replace('/%/g', '');\n this.previewMaxHeight = Math.min(configBreakpointHeight, heightNum) + 'px';\n } else {\n const heightNum: number = +DEFAULT_MAX_HEIGHT.replace('/px/g', '').replace('/%/g', '');\n this.previewMaxHeight = Math.min(configBreakpointHeight, heightNum) + 'px';\n }\n this.ref.markForCheck();\n }\n\n /**\n * Method ´ngOnInit´ to build `configPreview` applying a default value and also to\n * init the `previews` array.\n * This is an angular lifecycle hook, so its called automatically by Angular itself.\n * In particular, it's called only one time!!!\n */\n ngOnInit(): void {\n const libConfig: LibConfig | undefined = this.configService.getConfig(this.id());\n if (!libConfig) {\n throw new Error('Internal library error - libConfig must be defined');\n }\n this.carouselConfig = libConfig.carouselConfig;\n this.previewConfig = libConfig.carouselPreviewsConfig;\n this.accessibilityConfig = libConfig.accessibilityConfig;\n\n if (!this.previewConfig || !this.previewConfig.maxHeight || !this.previewConfig.breakpoints) {\n throw new Error('Internal library error - previewConfig must be defined');\n }\n // change the max-width of this component if there is a specified width !== 100% in carouselConfig\n if (this.carouselConfig && this.carouselConfig.maxWidth !== '100%') {\n this.hostMaxWidth = this.carouselConfig.maxWidth;\n }\n\n this.previewMaxHeight = this.previewConfig.maxHeight;\n // init previews based on currentImage and the full array of images\n this.initPreviews(this.currentImage(), this.images());\n\n // apply custom height based on responsive breakpoints\n // This is required, because the breakpointSubscription is not triggered at creation,\n // but only when the width changes\n const isXsmallScreen = this.breakpointObserver.isMatched(Breakpoints.XSmall);\n const isSmallScreen = this.breakpointObserver.isMatched(Breakpoints.Small);\n const isMediumScreen = this.breakpointObserver.isMatched(Breakpoints.Medium);\n const isLargeScreen = this.breakpointObserver.isMatched(Breakpoints.Large);\n const isxLargeScreen = this.breakpointObserver.isMatched(Breakpoints.XLarge);\n if (isXsmallScreen) {\n this.updateHeight(this.previewConfig.breakpoints.xSmall);\n } else if (isSmallScreen) {\n this.updateHeight(this.previewConfig.breakpoints.small);\n } else if (isMediumScreen) {\n this.updateHeight(this.previewConfig.breakpoints.medium);\n } else if (isLargeScreen) {\n this.updateHeight(this.previewConfig.breakpoints.large);\n } else if (isxLargeScreen) {\n this.updateHeight(this.previewConfig.breakpoints.xLarge);\n }\n }\n\n /**\n * Method to check if an image is active (i.e. a preview image).\n * @param preview Image is an image to check if it's active or not\n * @returns boolean true if is active, false otherwise\n */\n isActive(preview: Image): boolean {\n const currentImage = this.currentImage();\n if (!preview || !currentImage) {\n return false;\n }\n return preview.id === currentImage.id;\n }\n\n /**\n * Method ´ngOnChanges´ to update `previews` array.\n * Also, both `start` and `end` local variables will be updated accordingly.\n * This is an angular lifecycle hook, so its called automatically by Angular itself.\n * In particular, it's called when any data-bound property of a directive changes!!!\n */\n ngOnChanges(changes: SimpleChanges): void {\n const simpleChange: SimpleChange = changes['currentImage'];\n if (!simpleChange) {\n return;\n }\n\n const prev: Image = simpleChange.previousValue;\n const current: Image = simpleChange.currentValue;\n\n if (current && changes['images'] && changes['images'].previousValue && changes['images'].currentValue) {\n // I'm in this if statement, if input images are changed (for instance, because I removed one of them with the 'delete button',\n // or because users changed the images array while modal gallery is still open).\n // In this case, I have to re-init previews, because the input array of images is changed.\n this.initPreviews(current, changes['images'].currentValue);\n }\n\n if (prev && current && prev.id !== current.id) {\n // to manage infinite sliding I have to reset both `start` and `end` at the beginning\n // to show again previews from the first image.\n // This happens when you navigate over the last image to return to the first one\n let prevIndex: number;\n let currentIndex: number;\n try {\n prevIndex = getIndex(prev, this.images());\n currentIndex = getIndex(current, this.images());\n } catch (err) {\n console.error('Cannot get previous and current image indexes in previews');\n throw err;\n }\n\n // apply a formula to get a values to be used to decide if go next, return back or stay without doing anything\n const calc = Math.floor((this.end - this.start) / 2) + this.start;\n\n const images = this.images();\n if (prevIndex === images.length - 1 && currentIndex === 0) {\n // first image\n this.setBeginningIndexesPreviews();\n this.previews = images.filter((img: Image, i: number) => i >= this.start && i < this.end);\n return;\n }\n // the same for the opposite case, when you navigate back from the fist image to go to the last one.\n if (prevIndex === 0 && currentIndex === images.length - 1) {\n // last image\n this.setEndIndexesPreviews();\n this.previews = images.filter((img: Image, i: number) => i >= this.start && i < this.end);\n return;\n }\n\n if (this.previewConfig && (this.previewConfig.number as number) % 2 === 0) {\n if (calc > currentIndex) {\n this.previous();\n } else {\n this.next();\n }\n } else {\n if (calc > currentIndex) {\n this.previous();\n }\n if (calc < currentIndex) {\n this.next();\n }\n }\n }\n }\n\n /**\n * Method called by events from both keyboard and mouse on a preview.\n * This will trigger the `clickpreview` output with the input preview as its payload.\n * @param preview Image that triggered this method\n * @param event KeyboardEvent | MouseEvent payload\n * @param action Action that triggered this event (Action.NORMAL by default)\n */\n onImageEvent(preview: Image, event: KeyboardEvent | MouseEvent, action: Action = Action.NORMAL): void {\n if (!this.previewConfig || !this.previewConfig.clickable) {\n return;\n }\n const clickedImageIndex: number = this.images().indexOf(preview);\n const result: number = super.handleImageEvent(event);\n if (result === NEXT) {\n this.clickPreview.emit({ action, result: clickedImageIndex } as ImageEvent);\n } else if (result === PREV) {\n this.clickPreview.emit({ action, result: clickedImageIndex } as ImageEvent);\n }\n }\n\n /**\n * Method called by events from both keyboard and mouse on a navigation arrow.\n * @param direction string of the navigation that can be either 'next' or 'prev'\n * @param event KeyboardEvent | MouseEvent payload\n */\n onNavigationEvent(direction: string, event: KeyboardEvent | MouseEvent): void {\n const result: number = super.handleNavigationEvent(direction, event);\n if (result === NEXT) {\n this.next();\n } else if (result === PREV) {\n this.previous();\n }\n }\n\n /**\n * Method to get aria-label text for a preview image.\n * @param preview Image is the preview\n */\n getAriaLabel(preview: Image): string {\n if (!preview.plain) {\n return preview.modal.ariaLabel || '';\n }\n return preview.plain.ariaLabel || preview.modal.ariaLabel || '';\n }\n\n /**\n * Method to get title text for a preview image.\n * @param preview Image is the preview\n */\n getTitle(preview: Image): string {\n if (!preview.plain) {\n return preview.modal.title || '';\n }\n return preview.plain.title || preview.modal.title || '';\n }\n\n /**\n * Method to get alt text for a preview image.\n * @param preview Image is the preview\n */\n getAlt(preview: Image): string {\n if (!preview.plain) {\n return preview.modal.alt || '';\n }\n return preview.plain.alt || preview.modal.alt || '';\n }\n\n /**\n * Method used in template to sanitize an url when you need legacyIE11Mode.\n * In this way you can set an url as background of a div.\n * @param unsafeStyle is a string or a SafeResourceUrl that represents the url to sanitize.\n * @param unsafeStyleFallback is a string or a SafeResourceUrl that represents the fallback url to sanitize.\n * @returns a SafeStyle object that can be used in template without problems.\n */\n sanitizeUrlBgStyle(unsafeStyle: string | SafeResourceUrl, unsafeStyleFallback: string | SafeResourceUrl): SafeStyle {\n // Method used only to sanitize background-image style before add it to background property when legacyIE11Mode is enabled\n let bg: string = 'url(' + unsafeStyle + ')';\n if (!!unsafeStyleFallback) {\n // if a fallback image is defined, append it. In this way, it will be used by the browser as fallback.\n bg += ', ' + 'url(' + unsafeStyleFallback + ')';\n }\n return this.sanitizer.bypassSecurityTrustStyle(bg);\n }\n\n /**\n * Method to cleanup resources. In fact, it cleans breakpointSubscription.\n * This is an angular lifecycle hook that is called when this component is destroyed.\n */\n ngOnDestroy(): void {\n if (this.breakpointSubscription) {\n this.breakpointSubscription.unsubscribe();\n }\n }\n\n /**\n * Private method to init previews based on the currentImage and the full array of images.\n * The current image in mandatory to show always the current preview (as highlighted).\n * @param currentImage Image to decide how to show previews, because I always want to see the current image as highlighted\n * @param images Image[] is the array of all images.\n */\n private initPreviews(currentImage: Image, images: Image[]): void {\n let index: number;\n try {\n index = getIndex(currentImage, images);\n } catch (err) {\n throw err;\n }\n switch (index) {\n case 0:\n // first image\n this.setBeginningIndexesPreviews();\n break;\n case images.length - 1:\n // last image\n this.setEndIndexesPreviews();\n break;\n // default:\n // // other images\n // // TODO unused because it starts always at image 0\n // this.setIndexesPreviews();\n // break;\n }\n this.previews = images.filter((img: Image, i: number) => i >= this.start && i < this.end);\n }\n\n /**\n * Private method to init both `start` and `end` to the beginning.\n */\n private setBeginningIndexesPreviews(): void {\n if (!this.previewConfig || this.previewConfig.number === undefined) {\n throw new Error('Internal library error - previewConfig and number must be defined');\n }\n\n this.start = 0;\n this.end = Math.min(this.previewConfig.number as number, this.images().length);\n }\n\n /**\n * Private method to init both `start` and `end` to the end.\n */\n private setEndIndexesPreviews(): void {\n if (!this.previewConfig || this.previewConfig.number === undefined) {\n throw new Error('Internal library error - previewConfig and number must be defined');\n }\n\n this.start = this.images().length - 1 - ((this.previewConfig.number as number) - 1);\n this.end = this.images().length;\n }\n\n /**\n * Private method to update the visible previews navigating to the right (next).\n */\n private next(): void {\n // check if nextImage should be blocked\n const images = this.images();\n if (this.isPreventSliding(images.length - 1)) {\n return;\n }\n\n if (this.end === images.length) {\n return;\n }\n\n this.start++;\n this.end = Math.min(this.end + 1, images.length);\n\n this.previews = images.filter((img: Image, i: number) => i >= this.start && i < this.end);\n }\n\n /**\n * Private method to update the visible previews navigating to the left (previous).\n */\n private previous(): void {\n // check if prevImage should be blocked\n if (this.isPreventSliding(0)) {\n return;\n }\n\n if (this.start === 0) {\n return;\n }\n\n this.start = Math.max(this.start - 1, 0);\n this.end = Math.min(this.end - 1, this.images().length);\n\n this.previews = this.images().filter((img: Image, i: number) => i >= this.start && i < this.end);\n }\n\n /**\n * Private method to block/permit sliding between previews.\n * @param boundaryIndex number is the first or the last index of `images` input array\n * @returns boolean if true block sliding, otherwise not\n */\n private isPreventSliding(boundaryIndex: number): boolean {\n return getIndex(this.currentImage(), this.images()) === boundaryIndex;\n }\n}\n","@if (previewConfig?.visible) {\n <nav class=\"previews-container\"\n [attr.aria-label]=\"accessibilityConfig?.carouselPreviewsContainerAriaLabel\"\n [title]=\"accessibilityConfig?.carouselPreviewsContainerTitle\">\n\n <a class=\"nav-left\"\n [attr.aria-label]=\"accessibilityConfig?.carouselPreviewScrollPrevAriaLabel\"\n [tabIndex]=\"previewConfig?.arrows && start > 0 ? 0 : -1\" role=\"button\"\n (click)=\"onNavigationEvent('left', $event)\" (keyup)=\"onNavigationEvent('left', $event)\">\n <div class=\"inside {{previewConfig?.arrows && start > 0 ? 'left-arrow-preview-image' : 'empty-arrow-preview-image'}}\"\n aria-hidden=\"true\"\n [title]=\"accessibilityConfig?.carouselPreviewScrollPrevTitle\"></div>\n </a>\n\n <div class=\"preview-inner-container\">\n @for (preview of previews; track preview.id) {\n @if (preview?.modal?.img) {\n <img loading=\"{{preview.loading}}\"\n [attr.fetchpriority]=\"preview.fetchpriority\"\n class=\"inside preview-image{{isActive(preview) ? ' active' : ''}}{{!previewConfig?.clickable ? ' unclickable' : ''}}\"\n [src]=\"preview.plain?.img ? preview.plain?.img : preview.modal.img\"\n ksFallbackImage [fallbackImg]=\"preview.plain?.fallbackImg ? preview.plain?.fallbackImg : preview.modal.fallbackImg\"\n ksSize [sizeConfig]=\"{width: previewConfig?.width!,\n height: previewMaxHeight}\"\n [attr.aria-label]=\"getAriaLabel(preview)\"\n [title]=\"getTitle(preview)\"\n alt=\"{{getAlt(preview)}}\"\n [tabIndex]=\"0\" role=\"img\"\n (click)=\"onImageEvent(preview, $event, clickAction)\" (keyup)=\"onImageEvent(preview, $event, keyboardAction)\" />\n }\n }\n </div>\n\n <a class=\"nav-right\"\n [attr.aria-label]=\"accessibilityConfig?.carouselPreviewScrollNextAriaLabel\"\n [tabIndex]=\"previewConfig?.arrows && end < images().length ? 0 : -1\" role=\"button\"\n (click)=\"onNavigationEvent('right', $event)\" (keyup)=\"onNavigationEvent('right', $event)\">\n <div class=\"inside {{previewConfig?.arrows && end < images().length ? 'right-arrow-preview-image' : 'empty-arrow-preview-image'}}\"\n aria-hidden=\"true\"\n [title]=\"accessibilityConfig?.carouselPreviewScrollNextTitle\"></div>\n </a>\n </nav>\n}\n","/*\n The MIT License (MIT)\n\n Copyright (c) 2017-2026 Stefano Cappa (Ks89)\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\n\n// The idea to create a carousel with two Subjects came from ng-bootstrap\n// So a big thank you to the ng-bootstrap team for the interesting implementation that I used here with some customizations.\n\nimport {\n AfterContentInit,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n HostBinding,\n HostListener, inject,\n NgZone,\n OnChanges,\n OnDestroy,\n OnInit,\n PLATFORM_ID,\n SimpleChange,\n SimpleChanges,\n output,\n input\n} from '@angular/core';\nimport { isPlatformBrowser, NgTemplateOutlet } from '@angular/common';\n\nimport { Subject, timer } from 'rxjs';\nimport { filter, map, switchMap, takeUntil } from 'rxjs/operators';\n\nimport { AccessibleComponent } from '../accessible.component';\n\nimport { AccessibilityConfig } from '../../model/accessibility.interface';\nimport { Image, ImageEvent } from '../../model/image.class';\nimport { Action } from '../../model/action.enum';\nimport { getIndex } from '../../utils/image.util';\nimport { NEXT, PREV } from '../../utils/user-input.util';\nimport { DescriptionStrategy } from '../../model/description.interface';\nimport { DotsConfig } from '../../model/dots-config.interface';\nimport { CarouselConfig } from '../../model/carousel-config.interface';\nimport { CarouselImageConfig } from '../../model/carousel-image-config.interface';\nimport { ConfigService } from '../../services/config.service';\nimport { CarouselLibConfig, LibConfig } from '../../model/lib-config.interface';\nimport { InternalLibImage } from '../../model/image-internal.class';\nimport { MaxSizeDirective } from '../../directives/max-size.directive';\nimport { SizeDirective } from '../../directives/size.directive';\nimport { FallbackImageDirective } from '../../directives/fallback-image.directive';\nimport { DescriptionDirective } from '../../directives/description.directive';\nimport { DotsComponent } from '../dots/dots.component';\nimport { CarouselPreviewsComponent } from './carousel-previews/carousel-previews.component';\n\n/**\n * Component with configurable inline/plain carousel.\n */\n@Component({\n selector: 'ks-carousel',\n styleUrls: ['carousel.scss', '../image-arrows.scss'],\n templateUrl: 'carousel.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [ConfigService],\n imports: [MaxSizeDirective, SizeDirective, NgTemplateOutlet,\n FallbackImageDirective, DescriptionDirective, DotsComponent, CarouselPreviewsComponent]\n})\nexport class CarouselComponent extends AccessibleComponent implements OnInit, AfterContentInit, OnDestroy, OnChanges {\n /**\n * Attribute to set ariaLabel of the host component\n */\n @HostBinding('attr.aria-label')\n ariaLabel = `Carousel`;\n /**\n * Unique id (>=0) of the current instance of the carousel. This is useful when you are using\n * the carousel's feature to open modal gallery.\n */\n readonly id = input.required<number>();\n /**\n * Array of `InternalLibImage` that represent the model of this library with all images,\n * thumbs and so on.\n */\n readonly images = input<Image[]>([]);\n /**\n * CarouselLibConfig object to configure carousel.\n */\n readonly config = input<CarouselLibConfig>();\n\n /**\n * Output to emit an event when an image is clicked.\n */\n readonly clickImage = output<number>();\n /**\n * Output to emit an event when current image is changed.\n */\n readonly changeImage = output<ImageEvent>();\n /**\n * Output to emit an event when the current image is the first one.\n */\n readonly firstImage = output<ImageEvent>();\n /**\n * Output to emit an event when the current image is the last one.\n */\n readonly lastImage = output<ImageEvent>();\n\n /**\n * Object of type `CarouselConfig` to init CarouselComponent's features.\n * For instance, it contains parameters to change the style, how it navigates and so on.\n */\n carouselConfig: CarouselConfig | undefined;\n\n /**\n * Object of type `DotsConfig` to init DotsComponent's features.\n * For instance, it contains a param to show/hide this component.\n */\n carouselDotsConfig: DotsConfig | undefined;\n /**\n * Object of type `AccessibilityConfig` to init custom accessibility features.\n * For instance, it contains titles, alt texts, aria-labels and so on.\n */\n accessibilityConfig: AccessibilityConfig | undefined;\n /**\n * Object of type `CarouselImageConfig` to configure the current image of the carousel.\n */\n carouselImageConfig: CarouselImageConfig | undefined;\n /**\n * Enable/disable infinite sliding.\n */\n carouselSlideInfinite: boolean | undefined;\n\n /**\n * Enum of type `Action` that represents a mouse click on a button.\n * Declared here to be used inside the template.\n */\n clickAction: Action = Action.CLICK;\n /**\n * Enum of type `Action` that represents a keyboard action.\n * Declared here to be used inside the template.\n */\n keyboardAction: Action = Action.KEYBOARD;\n /**\n * `Image` that is visible right now.\n */\n currentImage: InternalLibImage | undefined;\n /**\n * Boolean that it's true when you are watching the first image (currently visible).\n * False by default\n */\n isFirstImage = false;\n /**\n * Boolean that it's true when you are watching the last image (currently visible).\n * False by default\n */\n isLastImage = false;\n\n /**\n * Subject to play the carousel.\n */\n private start$ = new Subject<void>();\n /**\n * Subject to stop the carousel.\n */\n private stop$ = new Subject<void>();\n\n private readonly platformId: Object = inject(PLATFORM_ID);\n\n /**\n * Listener to stop the gallery when the mouse pointer is over the current image.\n */\n @HostListener('mouseenter')\n onMouseEnter(): void {\n const id = this.id();\n if (id === null || id === undefined) {\n throw new Error('Internal library error - id must be defined');\n }\n const libConfig: LibConfig | undefined = this.configService.getConfig(id);\n if (!libConfig) {\n throw new Error('Internal library error - libConfig must be defined');\n }\n if (!libConfig.carouselPlayConfig || !libConfig.carouselPlayConfig.pauseOnHover) {\n return;\n }\n this.stopCarousel();\n }\n\n /**\n * Listener to play the gallery when the mouse pointer leave the current image.\n */\n @HostListener('mouseleave')\n onMouseLeave(): void {\n const id = this.id();\n if (id === null || id === undefined) {\n throw new Error('Internal library error - id must be defined');\n }\n const libConfig: LibConfig | undefined = this.configService.getConfig(id);\n if (!libConfig) {\n throw new Error('Internal library error - libConfig must be defined');\n }\n if (!libConfig.carouselPlayConfig || !libConfig.carouselPlayConfig.pauseOnHover || !libConfig.carouselPlayConfig.autoPlay) {\n return;\n }\n this.playCarousel();\n }\n\n /**\n * Listener to navigate carousel images with keyboard (left).\n */\n @HostListener('keydown.arrowLeft')\n onKeyDownLeft(): void {\n const id = this.id();\n if (id === null || id === undefined) {\n throw new Error('Internal library error - id must be defined');\n }\n const libConfig: LibConfig | undefined = this.configService.getConfig(id);\n if (!libConfig) {\n throw new Error('Internal library error - libConfig must be defined');\n }\n if (!libConfig.carouselConfig || !libConfig.carouselConfig.keyboardEnable) {\n return;\n }\n this.prevImage();\n }\n\n /**\n * Listener to navigate carousel images with keyboard (right).\n */\n @HostListener('keydown.arrowRight')\n onKeyDownLRight(): void {\n const id = this.id();\n if (id === null || id === undefined) {\n throw new Error('Internal library error - id must be defined');\n }\n const libConfig: LibConfig | undefined = this.configService.getConfig(id);\n if (!libConfig) {\n throw new Error('Internal library error - libConfig must be defined');\n }\n if (!libConfig.carouselConfig || !libConfig.carouselConfig.keyboardEnable) {\n return;\n }\n this.nextImage();\n }\n\n constructor(\n private ngZone: NgZone,\n private configService: ConfigService,\n private ref: ChangeDetectorRef\n ) {\n super();\n }\n\n ngOnInit(): void {\n const id = this.id();\n if (id === null || id === undefined) {\n throw new Error('Internal library error - id must be defined');\n }\n const images = this.images();\n if (!images || images.length === 0) {\n throw new Error('Internal library error - images array must be defined and with at least an element');\n }\n this.configService.setConfig(id, this.config());\n\n const libConfig: LibConfig | undefined = this.configService.getConfig(id);\n if (!libConfig) {\n throw new Error('Internal library error - libConfig must be defined');\n }\n\n this.currentImage = images[0] as InternalLibImage;\n this.carouselDotsConfig = libConfig.carouselDotsConfig;\n this.accessibilityConfig = libConfig.accessibilityConfig;\n this.carouselSlideInfinite = libConfig.carouselSlideInfinite;\n this.carouselConfig = libConfig.carouselConfig;\n this.carouselImageConfig = libConfig.carouselImageConfig;\n\n this.manageSlideConfig();\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n const id = this.id();\n if (id === null || id === undefined) {\n throw new Error('Internal library error - id must be defined');\n }\n\n // this.configService.setConfig(this.id, this.config);\n const libConfig: LibConfig | undefined = this.configService.getConfig(id);\n if (!libConfig) {\n throw new Error('Internal library error - libConfig must be defined');\n }\n\n const configChange: SimpleChange = changes['config'];\n\n // handle changes of dotsConfig.visible\n if (configChange &&\n !configChange.firstChange &&\n (configChange.previousValue.carouselDotsConfig?.visible !== configChange.currentValue.carouselDotsConfig?.visible || (!configChange.previousValue.carouselDotsConfig && !configChange.currentValue.carouselDotsConfig))\n ) {\n this.configService.setConfig(id, {\n carouselDotsConfig: configChange.currentValue?.carouselDotsConfig\n });\n this.carouselDotsConfig = configChange.currentValue?.carouselDotsConfig;\n this.ref.markForCheck();\n }\n // handle changes of carouselConfig.showArrows\n if (configChange &&\n !configChange.firstChange &&\n (configChange.previousValue.carouselConfig?.showArrows !== configChange.currentValue.carouselConfig?.showArrows || (!configChange.previousValue.carouselConfig && !configChange.currentValue.carouselConfig))\n ) {\n this.configService.setConfig(id, {\n carouselConfig: configChange.currentValue?.carouselConfig\n });\n this.carouselConfig = configChange.currentValue?.carouselConfig;\n this.ref.markForCheck();\n }\n // handle changes of playConfig starting/stopping the carousel accordingly\n if (configChange &&\n !configChange.firstChange &&\n (configChange.previousValue.carouselPlayConfig?.autoPlay !== configChange.currentValue.carouselPlayConfig?.autoPlay || (!configChange.previousValue.carouselPlayConfig && !configChange.currentValue.carouselPlayConfig))\n ) {\n this.configService.setConfig(id, {\n carouselPlayConfig: configChange.currentValue?.carouselPlayConfig\n });\n // this.configPlay = playConfigChange.currentValue;\n // if autoplay is enabled, and this is not the\n // first change (to prevent multiple starts at the beginning)\n if (configChange.currentValue.carouselPlayConfig?.autoPlay && !configChange.firstChange) {\n this.start$.next();\n } else {\n this.stopCarousel();\n }\n this.ref.markForCheck();\n }\n }\n\n ngAfterContentInit(): void {\n // interval doesn't play well with SSR and protractor,\n // so we should run it in the browser and outside Angular\n if (isPlatformBrowser(this.platformId)) {\n const id = this.id();\n if (id === null || id === undefined) {\n throw new Error('Internal library error - id must be defined');\n }\n const libConfig: LibConfig | undefined = this.configService.getConfig(id);\n if (!libConfig || !libConfig.carouselPlayConfig) {\n throw new Error('Internal library error - libConfig and carouselPlayConfig must be defined');\n }\n this.ngZone.runOutsideAngular(() => {\n this.start$\n .pipe(\n map(() => libConfig?.carouselPlayConfig?.interval),\n // tslint:disable-next-line:no-any\n filter((interval: any) => interval > 0),\n switchMap(interval => timer(interval).pipe(takeUntil(this.stop$)))\n )\n .subscribe(() =>\n this.ngZone.run(() => {\n if (libConfig.carouselPlayConfig?.autoPlay) {\n this.nextImage();\n }\n this.ref.markForCheck();\n })\n );\n\n this.start$.next();\n });\n }\n }\n\n /**\n * Method called when a dot is clicked and used to update the current image.\n * @param index number of the clicked dot\n */\n onClickDot(index: number): void {\n this.changeCurrentImage(this.images()[index] as InternalLibImage, Action.NORMAL);\n }\n\n /**\n * Method called by events from both keyboard and mouse on a navigation arrow.\n * @param direction string of the navigation that can be either 'next' or 'prev'\n * @param event KeyboardEvent | MouseEvent payload\n * @param action Action that triggered the event or `Action.NORMAL` if not provided\n */\n onNavigationEvent(direction: string, event: KeyboardEvent | MouseEvent, action: Action = Action.NORMAL): void {\n const result: number = super.handleNavigationEvent(direction, event);\n if (result === NEXT) {\n this.nextImage(action);\n } else if (result === PREV) {\n this.prevImage(action);\n }\n }\n\n /**\n * Method triggered when you click on the current image.\n * Also, if modalGalleryEnable is true, you can open the modal-gallery.\n */\n onClickCurrentImage(): void {\n const id = this.id();\n if (id === null || id === undefined) {\n throw new Error('Internal library error - id must be defined');\n }\n const libConfig: LibConfig | undefined = this.configService.getConfig(id);\n if (!libConfig || !libConfig.carouselConfig || !this.currentImage) {\n throw new Error('Internal library error - libConfig, carouselConfig and currentImage must be defined');\n }\n if (!libConfig.carouselConfig.modalGalleryEnable) {\n return;\n }\n const index = getIndex(this.currentImage, this.images());\n this.clickImage.emit(index);\n }\n\n /**\n * Method to get the image description based on input params.\n * If you provide a full description this will be the visible description, otherwise,\n * it will be built using the `Description` object, concatenating its fields.\n * @param image Image to get its description. If not provided it will be the current image\n * @returns String description of the image (or the current image if not provided)\n * @throws an Error if description isn't available\n */\n getDescriptionToDisplay(image: Image | undefined = this.currentImage): string {\n const id = this.id();\n if (id === null || id === undefined) {\n throw new Error('Internal library error - id must be defined');\n }\n const libConfig: LibConfig | undefined = this.configService.getConfig(id);\n if (!libConfig) {\n throw new Error('Internal library error - libConfig must be defined');\n }\n const configCurrentImageCarousel: CarouselImageConfig | undefined = libConfig.carouselImageConfig;\n if (!configCurrentImageCarousel || !configCurrentImageCarousel.description) {\n throw new Error('Description input must be a valid object implementing the Description interface');\n }\n if (!image) {\n throw new Error('Internal library error - image must be defined');\n }\n const imageWithoutDescription: boolean = !image || !image.modal || !image.modal.description || image.modal.description === '';\n\n switch (configCurrentImageCarousel.description.strategy) {\n case DescriptionStrategy.HIDE_IF_EMPTY:\n return imageWithoutDescription ? '' : image.modal.description + '';\n case DescriptionStrategy.ALWAYS_HIDDEN:\n return '';\n default:\n // ----------- DescriptionStrategy.ALWAYS_VISIBLE -----------------\n return this.buildTextDescription(image, imageWithoutDescription);\n }\n }\n\n /**\n * Method used by SwipeDirective to support touch gestures (you can also invert the swipe direction with configCurrentImage.invertSwipe).\n * @param action String that represent the direction of the swipe action. 'swiperight' by default.\n */\n swipe(action = 'swiperight'): void {\n const id = this.id();\n if (id === null || id === undefined) {\n throw new Error('Internal library error - id must be defined');\n }\n const libConfig: LibConfig | undefined = this.configService.getConfig(id);\n if (!libConfig || !libConfig.carouselImageConfig) {\n throw new Error('Internal library error - libConfig and carouselImageConfig must be defined');\n }\n const configCurrentImageCarousel: CarouselImageConfig = libConfig.carouselImageConfig;\n switch (action) {\n case 'swiperight':\n if (configCurrentImageCarousel.invertSwipe) {\n this.prevImage(Action.SWIPE);\n } else {\n this.nextImage(Action.SWIPE);\n }\n break;\n case 'swipeleft':\n if (configCurrentImageCarousel.invertSwipe) {\n this.nextImage(Action.SWIPE);\n } else {\n this.prevImage(Action.SWIPE);\n }\n break;\n // case this.SWIPE_ACTION.UP:\n // break;\n // case this.SWIPE_ACTION.DOWN:\n // break;\n }\n }\n\n /**\n * Method to go back to the previous image.\n * @param action Enum of type `Action` that represents the source\n * action that moved back to the previous image. `Action.NORMAL` by default.\n */\n prevImage(action: Action = Action.NORMAL): void {\n // check if prevImage should be blocked\n if (this.isPreventSliding(0)) {\n return;\n }\n this.changeCurrentImage(this.getPrevImage(), action);\n\n this.manageSlideConfig();\n\n this.start$.next();\n }\n\n /**\n * Method to go back to the previous image.\n * @param action Enum of type `Action` that represents the source\n * action that moved to the next image. `Action.NORMAL` by default.\n */\n nextImage(action: Action = Action.NORMAL): void {\n // check if nextImage should be blocked\n if (this.isPreventSliding(this.images().length - 1)) {\n return;\n }\n this.changeCurrentImage(this.getNextImage(), action);\n\n this.manageSlideConfig();\n\n this.start$.next();\n }\n\n /**\n * Method called when an image preview is clicked and used to update the current image.\n * @param event an ImageEvent object with the relative action and the index of the clicked preview.\n */\n onClickPreview(event: ImageEvent): void {\n const imageFound: InternalLibImage = this.images()[event.result as number] as InternalLibImage;\n if (!!imageFound) {\n this.manageSlideConfig();\n this.changeCurrentImage(imageFound, event.action);\n }\n }\n\n /**\n * Method to play carousel.\n */\n playCarousel(): void {\n this.start$.next();\n }\n\n /**\n * Stops the carousel from cycling through items.\n */\n stopCarousel(): void {\n this.stop$.next();\n }\n\n // TODO remove this because duplicated\n /**\n * Method to get `alt attribute`.\n * `alt` specifies an alternate text for an image, if the image cannot be displayed.\n * @param image Image to get its alt description. If not provided it will be the current image\n * @returns String alt description of the image (or the current image if not provided)\n */\n getAltDescriptionByImage(image: Image | undefined = this.currentImage): string {\n if (!image) {\n return '';\n }\n return image.modal && image.modal.description ? image.modal.description : `Image ${getIndex(image, this.images()) + 1}`;\n }\n\n // TODO remove this because duplicated\n /**\n * Method to get the title attributes based on descriptions.\n * This is useful to prevent accessibility issues, because if DescriptionStrategy is ALWAYS_HIDDEN,\n * it prevents an empty string as title.\n * @param image Image to get its description. If not provided it will be the current image\n * @returns String title of the image based on descriptions\n * @throws an Error if description isn't available\n */\n getTitleToDisplay(image: Image | undefined = this.currentImage): string {\n const id = this.id();\n if (id === null || id === undefined) {\n throw new Error('Internal library error - id must be defined');\n }\n const libConfig: LibConfig | undefined = this.configService.getConfig(id);\n if (!libConfig || !libConfig.carouselImageConfig) {\n throw new Error('Internal library error - libConfig and carouselImageConfig must be defined');\n }\n const configCurrentImageCarousel: CarouselImageConfig = libConfig.carouselImageConfig;\n if (!configCurrentImageCarousel || !configCurrentImageCarousel.description) {\n throw new Error('Description input must be a valid object implementing the Description interface');\n }\n const imageWithoutDescription: boolean = !image || !image.modal || !image.modal.description || image.modal.description === '';\n return this.buildTextDescription(image, imageWithoutDescription);\n }\n\n /**\n * Method to reset carousel (force image with index 0 to be the current image and re-init also previews)\n */\n // temporary removed because never tested\n // reset() {\n // if (this.configPlay && this.configPlay.autoPlay) {\n // this.stopCarousel();\n // }\n // this.currentImage = this.images[0];\n // this.handleBoundaries(0);\n // if (this.configPlay && this.configPlay.autoPlay) {\n // this.playCarousel();\n // }\n // this.ref.markForCheck();\n // }\n\n /**\n * Method to clean up resources. In fact, this will stop the carousel.\n * This is an angular lifecycle hook that is called when this component is destroyed.\n */\n ngOnDestroy(): void {\n this.stopCarousel();\n }\n\n /**\n * Method to change the current image, receiving the new image as input the relative action.\n * @param image an Image object that represents the new image to set as current.\n * @param action Enum of type `Action` that represents the source action that triggered the change.\n */\n private changeCurrentImage(image: InternalLibImage, action: Action): void {\n const id = this.id();\n if (id === null || id === undefined) {\n throw new Error('Internal library error - id must be defined');\n }\n this.currentImage = image;\n const index: number = getIndex(image, this.images());\n\n // emit first/last event based on newIndex value\n this.emitBoundaryEvent(action, index);\n\n // emit current visible image index\n this.changeImage.emit(new ImageEvent(id, action, index + 1));\n }\n\n /**\n * Private method to get the next index.\n * This is necessary because at the end, when you call next again, you'll go to the first image.\n * That happens because all modal images are shown like in a circle.\n */\n private getNextImage(): InternalLibImage {\n if (!this.currentImage) {\n throw new Error('Internal library error - currentImage must be defined');\n }\n const currentIndex: number = getIndex(this.currentImage, this.images());\n let newIndex;\n if (currentIndex >= 0 && currentIndex < this.images().length - 1) {\n newIndex = currentIndex + 1;\n } else {\n newIndex = 0; // start from the first index\n }\n return this.images()[newIndex] as InternalLibImage;\n }\n\n /**\n * Private method to get the previous index.\n * This is necessary because at index 0, when you call prev again, you'll go to the last image.\n * That happens because all modal images are shown like in a circle.\n */\n private getPrevImage(): InternalLibImage {\n if (!this.currentImage) {\n throw new Error('Internal library error - currentImage must be defined');\n }\n const currentIndex: number = getIndex(this.currentImage, this.images());\n let newIndex;\n if (currentIndex > 0 && currentIndex <= this.images().length - 1) {\n newIndex = currentIndex - 1;\n } else {\n newIndex = this.images().length - 1; // start from the last index\n }\n return this.images()[newIndex] as InternalLibImage;\n }\n\n /**\n * Private method to build a text description.\n * This is used also to create titles.\n * @param image Image to get its description. If not provided it will be the current image.\n * @param imageWithoutDescription boolean is a boolean that it's true if the image hasn't a 'modal' description.\n * @returns String description built concatenating image fields with a specific logic.\n */\n private buildTextDescription(image: Image | undefined, imageWithoutDescription: boolean): string {\n const id = this.id();\n if (id === null || id === undefined) {\n throw new Error('Internal library error - id must be defined');\n }\n const libConfig: LibConfig | undefined = this.configService.getConfig(id);\n if (!libConfig || !libConfig.carouselImageConfig) {\n throw new Error('Internal library error - libConfig and carouselImageConfig must be defined');\n }\n const configCurrentImageCarousel: CarouselImageConfig | undefined = libConfig.carouselImageConfig;\n if (!configCurrentImageCarousel || !configCurrentImageCarousel.description) {\n throw new Error('Description input must be a valid object implementing the Description interface');\n }\n if (!image) {\n throw new Error('Internal library error - image must be defined');\n }\n\n // If customFullDescription use it, otherwise proceed to build a description\n if (configCurrentImageCarousel.description.customFullDescription && configCurrentImageCarousel.description.customFullDescription !== '') {\n return configCurrentImageCarousel.description.customFullDescription;\n }\n\n const currentIndex: number = getIndex(image, this.images());\n // If the current image hasn't a description,\n // prevent to write the ' - ' (or this.description.beforeTextDescription)\n\n const prevDescription: string = configCurrentImageCarousel.description.imageText ? configCurrentImageCarousel.description.imageText : '';\n const midSeparator: string = configCurrentImageCarousel.description.numberSeparator ? configCurrentImageCarousel.description.numberSeparator : '';\n const middleDescription: string = currentIndex + 1 + midSeparator + this.images().length;\n\n if (imageWithoutDescription) {\n return prevDescription + middleDescription;\n }\n\n const currImgDescription: string = image.modal && image.modal.description ? image.modal.description : '';\n const endDescription: string = configCurrentImageCarousel.description.beforeTextDescription + currImgDescription;\n return prevDescription + middleDescription + endDescription;\n }\n\n /**\n * Private method to update both `isFirstImage` and `isLastImage` based on\n * the index of the current image.\n * @param currentIndex number is the index of the current image\n */\n private handleBoundaries(currentIndex: number): void {\n const images = this.images();\n if (images.length === 1) {\n this.isFirstImage = true;\n this.isLastImage = true;\n return;\n }\n switch (currentIndex) {\n case 0:\n // execute this only if infinite sliding is disabled\n this.isFirstImage = true;\n this.isLastImage = false;\n break;\n case images.length - 1:\n // execute this only if infinite sliding is disabled\n this.isFirstImage = false;\n this.isLastImage = true;\n break;\n default:\n this.isFirstImage = false;\n this.isLastImage = false;\n break;\n }\n }\n\n /**\n * Private method to manage boundary arrows and sliding.\n * This is based on the slideConfig input to enable/disable 'infinite sliding'.\n */\n private manageSlideConfig(): void {\n const id = this.id();\n if (id === null || id === undefined) {\n throw new Error('Internal library error - id must be defined');\n }\n const libConfig: LibConfig | undefined = this.configService.getConfig(id);\n if (!libConfig) {\n throw new Error('Internal library error - libConfig must be defined');\n }\n if (!this.currentImage) {\n throw new Error('Internal library error - currentImage must be defined');\n }\n let index: number;\n try {\n index = getIndex(this.currentImage, this.images());\n } catch (err) {\n console.error('Cannot get the current image index in current-image');\n throw err;\n }\n\n if (libConfig.carouselSlideInfinite === true) {\n // enable infinite sliding\n this.isFirstImage = false;\n this.isLastImage = false;\n } else {\n this.handleBoundaries(index);\n }\n }\n\n /**\n * Private method to emit events when either the last or the first image are visible.\n * @param action Enum of type Action that represents the source of the event that changed the\n * current image to the first one or the last one.\n * @param indexToCheck is the index number of the image (the first or the last one).\n */\n private emitBoundaryEvent(action: Action, indexToCheck: number): void {\n const id = this.id();\n if (id === null || id === undefined) {\n return;\n }\n // to emit first/last event\n switch (indexToCheck) {\n case 0:\n this.firstImage.emit(new ImageEvent(id, action, true));\n break;\n case this.images().length - 1:\n this.lastImage.emit(new ImageEvent(id, action, true));\n break;\n }\n }\n\n /**\n * Private method to check if next/prev actions should be blocked.\n * It checks if carouselSlideInfinite === false and if the image index is equals to the input parameter.\n * If yes, it returns true to say that sliding should be blocked, otherwise not.\n * @param boundaryIndex number that could be either the beginning index (0) or the last index\n * of images (this.images.length - 1).\n * @returns boolean true if carouselSlideInfinite === false and the current index is\n * either the first or the last one.\n */\n private isPreventSliding(boundaryIndex: number): boolean {\n const id = this.id();\n if (id === null || id === undefined) {\n throw new Error('Internal library error - id must be defined');\n }\n const libConfig: LibConfig | undefined = this.configService.getConfig(id);\n if (!libConfig) {\n throw new Error('Internal library error - libConfig must be defined');\n }\n if (!this.currentImage) {\n throw new Error('Internal library error - currentImage must be defined');\n }\n return !libConfig.carouselSlideInfinite && getIndex(this.currentImage, this.images()) === boundaryIndex;\n }\n}\n","<main id=\"carousel-container\"\n [attr.aria-label]=\"accessibilityConfig?.carouselContainerAriaLabel\"\n [title]=\"accessibilityConfig?.carouselContainerTitle\"\n ksMaxSize [maxSizeConfig]=\"{maxWidth: carouselConfig?.maxWidth,\n maxHeight: ''}\">\n\n\n <!-- Workaround to support 2 ng-content in the same template in 2 @if (https://github.com/angular/angular/issues/22972) -->\n <!-- Is this still required??? Issue is closed!-->\n <ng-template #content>\n <ng-content />\n </ng-template>\n\n @if (currentImage && currentImage.modal) {\n <figure class=\"current-figure\"\n ksSize [sizeConfig]=\"{width: carouselConfig?.maxWidth, height: ''}\">\n\n @if (carouselConfig?.showArrows) {\n <a class=\"nav-left\"\n [attr.aria-label]=\"accessibilityConfig?.carouselPrevImageAriaLabel\"\n [tabIndex]=\"isLastImage && !carouselSlideInfinite ? -1 : 0\" role=\"button\"\n (click)=\"onNavigationEvent('left', $event, clickAction)\" (keyup)=\"onNavigationEvent('left', $event, keyboardAction)\">\n <div class=\"inside {{(isFirstImage && !carouselSlideInfinite) || !carouselConfig?.showArrows ? 'empty-arrow-image' : 'left-arrow-image'}}\"\n aria-hidden=\"true\"\n [title]=\"accessibilityConfig?.carouselPrevImageTitle\"></div>\n </a>\n }\n\n <ng-container *ngTemplateOutlet=\"content\" />\n <picture class=\"current-image\" ksMaxSize [maxSizeConfig]=\"{maxWidth: carouselConfig?.maxWidth,\n maxHeight: carouselConfig?.maxHeight}\">\n @for (source of currentImage.modal?.sources; let i = $index; track i) {\n <source [media]=\"source.media\" [srcset]=\"source.srcset\">\n }\n <img [id]=\"currentImage.id\"\n loading=\"{{ currentImage.loading }}\"\n [attr.fetchpriority]=\"currentImage.fetchpriority\"\n [style.object-fit]=\"carouselConfig?.objectFit\"\n ksMaxSize [maxSizeConfig]=\"{maxWidth: carouselConfig?.maxWidth,\n maxHeight: carouselConfig?.maxHeight}\"\n [src]=\"currentImage.modal.img\"\n ksFallbackImage [fallbackImg]=\"currentImage.modal.fallbackImg\"\n [attr.aria-label]=\"currentImage.modal.ariaLabel\"\n [title]=\"(currentImage.modal.title || currentImage.modal.title === '') ? currentImage.modal.title : getTitleToDisplay()\"\n alt=\"{{currentImage.modal.alt ? currentImage.modal.alt : getAltDescriptionByImage()}}\"\n [tabIndex]=\"0\" role=\"img\"\n (click)=\"onClickCurrentImage()\"\n (swipeleft)=\"swipe($event.type)\"\n (swiperight)=\"swipe($event.type)\" />\n </picture>\n @if (getDescriptionToDisplay() !== '') {\n <figcaption class=\"description\"\n ksDescription [description]=\"carouselImageConfig?.description\"\n [innerHTML]=\"getDescriptionToDisplay()\"></figcaption>\n }\n\n @if (carouselConfig?.showArrows) {\n <a class=\"nav-right\"\n [attr.aria-label]=\"accessibilityConfig?.carouselNextImageAriaLabel\"\n [tabIndex]=\"isLastImage && !carouselSlideInfinite ? -1 : 0\" role=\"button\"\n (click)=\"onNavigationEvent('right', $event, clickAction)\" (keyup)=\"onNavigationEvent('right', $event, keyboardAction)\">\n <div class=\"inside {{(isLastImage && !carouselSlideInfinite) || !carouselConfig?.showArrows ? 'empty-arrow-image' : 'right-arrow-image'}}\"\n aria-hidden=\"true\"\n [title]=\"accessibilityConfig?.carouselNextImageTitle\"></div>\n </a>\n }\n\n @if (carouselDotsConfig) {\n <div id=\"dots\">\n <ks-dots [id]=\"id()\"\n [currentImage]=\"currentImage\"\n [images]=\"images()\"\n [dotsConfig]=\"carouselDotsConfig\"\n [accessibilityConfig]=\"accessibilityConfig!\"\n (clickDot)=\"onClickDot($event)\" />\n </div>\n }\n\n </figure>\n }\n\n</main>\n\n@if (currentImage) {\n <ks-carousel-previews [id]=\"id()\"\n [images]=\"images()\"\n [currentImage]=\"currentImage\"\n (clickPreview)=\"onClickPreview($event)\" />\n}\n","import { ButtonConfig, ButtonType } from '../../model/buttons-config.interface';\nimport { Size } from '../../model/size.interface';\n\n/**\n * Default button size object\n */\nexport const KS_DEFAULT_SIZE: Size = { height: 'auto', width: '30px' };\n\n/**\n * Default close button object\n */\nexport const KS_DEFAULT_BTN_CLOSE: ButtonConfig = {\n className: 'close-image',\n size: KS_DEFAULT_SIZE,\n type: ButtonType.CLOSE,\n title: 'Close this modal image gallery',\n ariaLabel: 'Close this modal image gallery'\n};\n\n/**\n * Default download button object\n */\nexport const KS_DEFAULT_BTN_DOWNLOAD: ButtonConfig = {\n className: 'download-image',\n size: KS_DEFAULT_SIZE,\n type: ButtonType.DOWNLOAD,\n title: 'Download the current image',\n ariaLabel: 'Download the current image'\n};\n\n/**\n * Default exturl button object\n */\nexport const KS_DEFAULT_BTN_EXTURL: ButtonConfig = {\n className: 'ext-url-image',\n size: KS_DEFAULT_SIZE,\n type: ButtonType.EXTURL,\n title: 'Navigate the current image',\n ariaLabel: 'Navigate the current image'\n};\n// /**\n// * Default refresh button object\n// */\n// export const KS_DEFAULT_BTN_REFRESH: ButtonConfig = {\n// className: 'refresh-image',\n// size: KS_DEFAULT_SIZE,\n// type: ButtonType.REFRESH,\n// title: 'Refresh all images',\n// ariaLabel: 'Refresh all images'\n// };\n\n/**\n * Default delete button object\n */\nexport const KS_DEFAULT_BTN_DELETE: ButtonConfig = {\n className: 'delete-image',\n size: KS_DEFAULT_SIZE,\n type: ButtonType.DELETE,\n title: 'Delete the current image',\n ariaLabel: 'Delete the current image'\n};\n\n/**\n * Default full-screen button object\n */\nexport const KS_DEFAULT_BTN_FULL_SCREEN: ButtonConfig = {\n className: 'fullscreen-image',\n size: KS_DEFAULT_SIZE,\n type: ButtonType.FULLSCREEN,\n title: 'Switch to full-screen',\n ariaLabel: 'Switch to full-screen'\n};\n/**\n * Default rotate button object\n */\n// export const KS_DEFAULT_BTN_ROTATE: ButtonConfig = {\n// className: 'rotate-image',\n// size: KS_DEFAULT_SIZE,\n// type: ButtonType.ROTATE,\n// title: 'Rotate clockwise of 90 degrees the current image',\n// ariaLabel: 'Rotate clockwise of 90 degrees the current image'\n// };\n","/*\n The MIT License (MIT)\n\n Copyright (c) 2017-2026 Stefano Cappa (Ks89)\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\n\nimport { ChangeDetectionStrategy, Component, OnInit, output, OutputEmitterRef, input } from '@angular/core';\n\nimport { AccessibleComponent } from '../accessible.component';\n\nimport { Action } from '../../model/action.enum';\nimport { Image } from '../../model/image.class';\nimport { ButtonConfig, ButtonEvent, ButtonsConfig, ButtonsStrategy, ButtonType, WHITELIST_BUTTON_TYPES } from '../../model/buttons-config.interface';\n\nimport {\n KS_DEFAULT_BTN_CLOSE,\n KS_DEFAULT_BTN_DELETE,\n KS_DEFAULT_BTN_DOWNLOAD,\n KS_DEFAULT_BTN_EXTURL,\n KS_DEFAULT_BTN_FULL_SCREEN\n} from './upper-buttons-default';\n\nimport { NEXT } from '../../utils/user-input.util';\nimport { NgStyle } from '@angular/common';\nimport { SizeDirective } from '../../directives/size.directive';\n\n/**\n * Internal representation of `ButtonConfig` with an optional `id` field, used by trackId to improve performances.\n */\nexport interface InternalButtonConfig extends ButtonConfig {\n id?: number; // useful only for trackById, not needed by users\n}\n\n/**\n * Component with all upper buttons.\n * Also it emits click events as outputs.\n */\n@Component({\n selector: 'ks-upper-buttons',\n styleUrls: ['upper-buttons.scss'],\n templateUrl: 'upper-buttons.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [SizeDirective, NgStyle]\n})\nexport class UpperButtonsComponent extends AccessibleComponent implements OnInit {\n /**\n * Unique id (>=0) of the current instance of this library. This is required when you are using\n * the service to call modal gallery.\n */\n readonly id = input.required<number>();\n /**\n * Object of type `Image` that represent the visible image.\n */\n readonly currentImage = input.required<Image>();\n /**\n * Object of type `ButtonsConfig` to init UpperButtonsComponent's features.\n * For instance, it contains an array of buttons.\n */\n readonly buttonsConfig = input.required<ButtonsConfig>();\n /**\n * Output to emit clicks on refresh button. The payload contains a `ButtonEvent`.\n */\n readonly refresh = output<ButtonEvent>();\n /**\n * Output to emit clicks on delete button. The payload contains a `ButtonEvent`.\n */\n readonly delete = output<ButtonEvent>();\n /**\n * Output to emit clicks on navigate button. The payload contains a `ButtonEvent`.\n */\n readonly navigate = output<ButtonEvent>();\n /**\n * Output to emit clicks on download button. The payload contains a `ButtonEvent`.\n */\n readonly download = output<ButtonEvent>();\n /**\n * Output to emit clicks on close button. The payload contains a `ButtonEvent`.\n */\n readonly closeButton = output<ButtonEvent>();\n /**\n * Output to emit clicks on full-screen button. The payload contains a `ButtonEvent`.\n */\n readonly fullscreen = output<ButtonEvent>();\n /**\n * Output to emit clicks on all custom buttons. The payload contains a `ButtonEvent`.\n */\n readonly customEmit = output<ButtonEvent>();\n\n /**\n * Array of `InternalButtonConfig` exposed to the template. This field is initialized\n * applying transformations, default values and so on to the input of the same type.\n */\n buttons: InternalButtonConfig[] | undefined;\n\n /**\n * Default buttons array for standard configuration\n */\n private defaultButtonsDefault: ButtonConfig[] = [KS_DEFAULT_BTN_CLOSE];\n /**\n * Default buttons array for simple configuration\n */\n private simpleButtonsDefault: ButtonConfig[] = [KS_DEFAULT_BTN_DOWNLOAD, ...this.defaultButtonsDefault];\n /**\n * Default buttons array for advanced configuration\n */\n private advancedButtonsDefault: ButtonConfig[] = [KS_DEFAULT_BTN_EXTURL, ...this.simpleButtonsDefault];\n /**\n * Default buttons array for full configuration\n */\n private fullButtonsDefault: ButtonConfig[] = [\n KS_DEFAULT_BTN_FULL_SCREEN,\n KS_DEFAULT_BTN_DELETE,\n ...this.advancedButtonsDefault\n ];\n\n /**\n * Method ´ngOnInit´ to build `configButtons` applying a default value and also to\n * init the `buttons` array.\n * This is an angular lifecycle hook, so its called automatically by Angular itself.\n * In particular, it's called only one time!!!\n */\n ngOnInit(): void {\n if (!this.buttonsConfig()) {\n throw new Error('No buttons configured');\n }\n switch (this.buttonsConfig().strategy) {\n case ButtonsStrategy.SIMPLE:\n this.buttons = this.addButtonIds(this.simpleButtonsDefault);\n break;\n case ButtonsStrategy.ADVANCED:\n this.buttons = this.addButtonIds(this.advancedButtonsDefault);\n break;\n case ButtonsStrategy.FULL:\n this.buttons = this.addButtonIds(this.fullButtonsDefault);\n break;\n case ButtonsStrategy.CUSTOM:\n this.buttons = this.addButtonIds(this.validateCustomButtons(this.buttonsConfig().buttons));\n break;\n case ButtonsStrategy.DEFAULT:\n default:\n this.buttons = this.addButtonIds(this.defaultButtonsDefault);\n break;\n }\n }\n\n /**\n * Method called by events from both keyboard and mouse on a button.\n * This will call a private method to trigger an output with the right payload.\n * @param button InternalButtonConfig that called this method\n * @param event KeyboardEvent | MouseEvent payload\n * @param action Action that triggered the source event or `Action.CLICK` if not specified\n * @throws an error if the button type is unknown\n */\n onEvent(button: InternalButtonConfig, event: KeyboardEvent | MouseEvent, action: Action = Action.CLICK): void {\n if (!event) {\n return;\n }\n const dataToEmit: ButtonEvent = {\n button,\n // current image initialized as null\n // (I'll fill this value inside the parent of this component\n image: null,\n action,\n galleryId: this.id()\n };\n const currentImage = this.currentImage();\n switch (button.type) {\n case ButtonType.DELETE:\n this.triggerOnMouseAndKeyboard(this.delete, event, dataToEmit);\n break;\n case ButtonType.EXTURL:\n if (!currentImage || !currentImage.modal || !currentImage.modal.extUrl) {\n return;\n }\n this.triggerOnMouseAndKeyboard(this.navigate, event, dataToEmit);\n break;\n case ButtonType.DOWNLOAD:\n this.triggerOnMouseAndKeyboard(this.download, event, dataToEmit);\n break;\n case ButtonType.CLOSE:\n this.triggerOnMouseAndKeyboard(this.closeButton, event, dataToEmit);\n break;\n case ButtonType.CUSTOM:\n this.triggerOnMouseAndKeyboard(this.customEmit, event, dataToEmit);\n break;\n case ButtonType.FULLSCREEN:\n this.triggerOnMouseAndKeyboard(this.fullscreen, event, dataToEmit);\n break;\n default:\n throw new Error(`Unknown button's type into ButtonConfig`);\n }\n }\n\n /**\n * Method used in the template to track ids in @for.\n * @param index number of the array\n * @param item Image of the array\n * @returns number the id of the item or undefined if the item is not valid\n */\n trackById(index: number, item: InternalButtonConfig): number | undefined {\n return item ? item.id : undefined;\n }\n\n /**\n * Private method to emit an event using the specified output as an `EventEmitter`.\n * @param emitter EventEmitter<ButtonEvent> is the output to emit the `ButtonEvent`\n * @param event KeyboardEvent | MouseEvent is the source that triggered this method\n * @param dataToEmit ButtonEvent payload to emit\n */\n private triggerOnMouseAndKeyboard(emitter: OutputEmitterRef<ButtonEvent>, event: KeyboardEvent | MouseEvent, dataToEmit: ButtonEvent): void {\n if (!emitter) {\n throw new Error(`UpperButtonsComponent unknown emitter in triggerOnMouseAndKeyboard`);\n }\n\n const result: number = super.handleImageEvent(event);\n if (result === NEXT) {\n emitter.emit(dataToEmit);\n }\n }\n\n /**\n * Private method to add ids to the array of buttons.\n * It adds ids in a reverse way, to be sure that the last button will always have id = 0.\n * This is really useful in unit testing to be sure that close button always have id = 0, download 1 and so on...\n * It's totally transparent to the user.\n * @param buttons ButtonConfig[] config array\n * @returns ButtonConfig[] the input array with incremental numeric ids\n */\n private addButtonIds(buttons: ButtonConfig[]): ButtonConfig[] {\n return buttons.map((val: ButtonConfig, i: number) => Object.assign(val, { id: buttons.length - 1 - i }));\n }\n\n /**\n * Private method to validate custom buttons received as input.\n * @param buttons ButtonConfig[] config array. [] by default.\n * @returns ButtonConfig[] the same input buttons config array\n * @throws an error if exists a button with an unknown type\n */\n private validateCustomButtons(buttons: ButtonConfig[] = []): ButtonConfig[] {\n buttons.forEach((val: ButtonConfig) => {\n const indexOfButtonType: number = WHITELIST_BUTTON_TYPES.findIndex((type: ButtonType) => type === val.type);\n if (indexOfButtonType === -1) {\n throw new Error(`Unknown ButtonType. For custom types use ButtonType.CUSTOM`);\n }\n });\n return buttons;\n }\n}\n","<header class=\"buttons-container\">\n\n @if (!buttonsConfig() || buttonsConfig()?.visible) {\n @for (btn of buttons; track trackById) {\n <a class=\"upper-button\"\n ksSize [sizeConfig]=\"{width: btn.size?.width!, height: btn.size?.height!}\"\n [ngStyle]=\"{'font-size': btn.fontSize}\"\n [attr.aria-label]=\"btn.ariaLabel\"\n [tabIndex]=\"0\" role=\"button\"\n (click)=\"onEvent(btn, $event)\" (keyup)=\"onEvent(btn, $event)\">\n <div class=\"inside {{btn.className}}\" aria-hidden=\"true\" title=\"{{btn.title}}\"></div>\n </a>\n }\n }\n</header>\n","/*\n The MIT License (MIT)\n\n Copyright (c) 2017-2026 Stefano Cappa (Ks89)\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\n\nimport { ChangeDetectionStrategy, Component, inject, OnChanges, OnInit, SimpleChanges, TemplateRef, output, input } from '@angular/core';\nimport { NgTemplateOutlet } from '@angular/common';\n\nimport { AccessibleComponent } from '../accessible.component';\n\nimport { AccessibilityConfig } from '../../model/accessibility.interface';\nimport { ImageEvent, ImageModalEvent, Image } from '../../model/image.class';\nimport { PreviewConfig } from '../../model/preview-config.interface';\nimport { SlideConfig } from '../../model/slide-config.interface';\nimport { NEXT, PREV } from '../../utils/user-input.util';\nimport { getIndex } from '../../utils/image.util';\nimport { Action } from '../../model/action.enum';\nimport { ConfigService, DEFAULT_PREVIEW_SIZE } from '../../services/config.service';\nimport { Size } from '../../model/size.interface';\nimport { LibConfig } from '../../model/lib-config.interface';\nimport { FallbackImageDirective } from '../../directives/fallback-image.directive';\nimport { SizeDirective } from '../../directives/size.directive';\n\n/**\n * Component with image previews\n */\n@Component({\n selector: 'ks-previews',\n styleUrls: ['previews.scss', '../previews-arrows.scss'],\n templateUrl: 'previews.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [NgTemplateOutlet, FallbackImageDirective, SizeDirective]\n})\nexport class PreviewsComponent extends AccessibleComponent implements OnInit, OnChanges {\n /**\n * Unique id (>=0) of the current instance of this library. This is required when you are using\n * the service to call modal-gallery.\n */\n readonly id = input.required<number>();\n /**\n * Object of type `Image` that represent the visible image.\n */\n readonly currentImage = input.required<Image>();\n /**\n * Array of `Image` that represent the model of this library with all images,\n * thumbs and so on.\n */\n readonly images = input.required<Image[]>();\n\n /**\n * Optional template reference for the rendering of previews.\n * Template may access the following context variables:\n * - preview: the `Image` object\n * - defaultTemplate: the template used by default to render the preview (in case the need is to wrap it)\n */\n readonly customTemplate = input<TemplateRef<HTMLElement>>();\n\n /**\n * Output to emit the clicked preview. The payload contains the `ImageEvent` associated to the clicked preview.\n */\n readonly clickPreview = output<ImageEvent>();\n\n /**\n * Object of type `AccessibilityConfig` to init custom accessibility features.\n * For instance, it contains titles, alt texts, aria-labels and so on.\n */\n accessibilityConfig: AccessibilityConfig | undefined;\n /**\n * Object of type `SlideConfig` to get `infinite sliding`.\n */\n slideConfig: SlideConfig | undefined;\n /**\n * Object of type `PreviewConfig` to init PreviewsComponent's features.\n * For instance, it contains a param to show/hide this component, sizes.\n */\n previewConfig: PreviewConfig | undefined;\n /**\n * Enum of type `Action` that represents a mouse click on a button.\n * Declared here to be used inside the template.\n */\n clickAction: Action = Action.CLICK;\n /**\n * Enum of type `Action` that represents a keyboard action.\n * Declared here to be used inside the template.\n */\n keyboardAction: Action = Action.KEYBOARD;\n /**\n * Array of `Image` exposed to the template. This field is initialized\n * applying transformations, default values and so on to the input of the same type.\n */\n previews: Image[] = [];\n /**\n * Start index (included) of the input images used to display previews.\n */\n // @ts-ignore\n start: number;\n /**\n * End index (excluded) of the input images used to display previews.\n */\n // @ts-ignore\n end: number;\n\n defaultPreviewSize: Size = DEFAULT_PREVIEW_SIZE;\n\n private configService: ConfigService = inject(ConfigService);\n\n /**\n * Method ´ngOnInit´ to build `configPreview` applying a default value and also to\n * init the `previews` array.\n * This is an angular lifecycle hook, so its called automatically by Angular itself.\n * In particular, it's called only one time!!!\n */\n ngOnInit(): void {\n const libConfig: LibConfig | undefined = this.configService.getConfig(this.id());\n if (!libConfig) {\n throw new Error('Internal library error - libConfig must be defined');\n }\n this.accessibilityConfig = libConfig.accessibilityConfig;\n this.slideConfig = libConfig.slideConfig;\n this.previewConfig = libConfig.previewConfig;\n this.initPreviews(this.currentImage(), this.images());\n }\n\n /**\n * Method to check if an image is active (i.e. a preview image).\n * @param preview Image is an image to check if it's active or not\n * @returns boolean true if is active, false otherwise\n */\n isActive(preview: Image): boolean {\n if (!preview) {\n return false;\n }\n return preview.id === this.currentImage().id;\n }\n\n /**\n * Method ´ngOnChanges´ to update `previews` array.\n * Also, both `start` and `end` local variables will be updated accordingly.\n * This is an angular lifecycle hook, so it's called automatically by Angular itself.\n * In particular, it's called when any data-bound property of a directive changes!!!\n */\n ngOnChanges(changes: SimpleChanges): void {\n\n let currentImage = changes['currentImage']?.currentValue ?? this.currentImage();\n let images = changes['images']?.currentValue ?? this.images();\n\n if (this.previewConfig && currentImage && images) {\n this.initPreviews(currentImage, images);\n }\n }\n\n /**\n * Method called by events from both keyboard and mouse on a preview.\n * This will trigger the `clickpreview` output with the input preview as its payload.\n * @param preview Image that triggered this method\n * @param event KeyboardEvent | MouseEvent payload\n * @param action Action that triggered the source event or `Action.NORMAL` if not specified\n */\n onImageEvent(preview: Image, event: KeyboardEvent | MouseEvent, action: Action = Action.NORMAL): void {\n // It's suggested to stop propagation of the event, so the\n // Cdk background will not catch a click and close the modal (like it does on Windows Chrome/FF).\n event?.stopPropagation();\n if (!this.previewConfig || !this.previewConfig.clickable) {\n return;\n }\n const result: number = super.handleImageEvent(event);\n if (result === NEXT || result === PREV) {\n this.clickPreview.emit(new ImageModalEvent(this.id(), action, getIndex(preview, this.images())));\n }\n }\n\n /**\n * Method called by events from both keyboard and mouse on a navigation arrow.\n * It also emits an event to specify which arrow.\n * @param direction string of the navigation that can be either 'next' or 'prev'\n * @param event KeyboardEvent | MouseEvent payload\n * @param action Action that triggered the source event or `Action.NORMAL` if not specified\n */\n onNavigationEvent(direction: string, event: KeyboardEvent | MouseEvent, action: Action = Action.NORMAL): void {\n const result: number = super.handleNavigationEvent(direction, event);\n if (result === NEXT) {\n this.next();\n } else if (result === PREV) {\n this.previous();\n }\n }\n\n /**\n * Indicates if the previews 'left arrow' should be displayed or not.\n * @returns\n */\n isDisplayLeftPreviewsArrow(): boolean {\n // Don't show arrows if the preview number is greater or equals than total number of images\n const images = this.images();\n if (this.previewConfig?.number !== undefined && images && this.previewConfig?.number >= images?.length) {\n return false;\n }\n return (this.previewConfig?.arrows && this.start > 0) || !!this.slideConfig?.infinite;\n }\n\n /**\n * Indicates if the previews 'right arrow' should be displayed or not.\n * @returns\n */\n isDisplayRightPreviewsArrow(): boolean {\n // Don't show arrows if the preview number is greater or equals than total number of images\n const images = this.images();\n if (this.previewConfig?.number !== undefined && images && this.previewConfig?.number >= images?.length) {\n return false;\n }\n return (this.previewConfig?.arrows && images && this.end < images.length) || !!this.slideConfig?.infinite;\n }\n\n /**\n * Private method to init previews based on the currentImage and the full array of images.\n * The current image in mandatory to show always the current preview (as highlighted).\n * @param currentImage Image to decide how to show previews, because I always want to see the current image as highlighted\n * @param images Image[] is the array of all images.\n */\n private initPreviews(currentImage: Image, images: Image[]): void {\n this.setIndexesPreviews(currentImage, images);\n this.previews = images.filter((img: Image, i: number) => i >= this.start && i < this.end);\n }\n\n /**\n * Private method to update both `start` and `end` based on the currentImage.\n */\n private setIndexesPreviews(currentImage: Image, images: Image[]): void {\n if (!this.previewConfig || !images || !currentImage) {\n throw new Error('Internal library error - previewConfig, currentImage and images must be defined');\n }\n const previewsNumber = this.previewConfig.number as number;\n let start = getIndex(currentImage, images) - Math.floor(previewsNumber / 2);\n // start is, at a minimum, the first index\n if (start < 0) start = 0;\n // end index\n let end = start + previewsNumber;\n // end is, at a maximum, the last index\n if (end > images.length) {\n start -= end - images.length;\n if (start < 0) start = 0; // start is, at a minimum, the first index\n end = images.length;\n }\n this.start = start;\n this.end = end;\n }\n\n /**\n * Private method to update the visible previews navigating to the right (next).\n */\n private next(): void {\n if (!this.previewConfig) {\n throw new Error('Internal library error - previewConfig must be defined');\n }\n if (this.end >= this.images().length) {\n // check if nextImage should be blocked\n const preventSliding = !!this.slideConfig && this.slideConfig.infinite === false;\n if (preventSliding) {\n return;\n }\n this.start = 0;\n } else {\n this.start++;\n }\n this.end = this.start + Math.min((this.previewConfig.number as number), this.images().length);\n\n this.previews = this.images().filter((img: Image, i: number) => i >= this.start && i < this.end);\n }\n\n /**\n * Private method to update the visible previews navigating to the left (previous).\n */\n private previous(): void {\n if (!this.previewConfig) {\n throw new Error('Internal library error - previewConfig must be defined');\n }\n if (this.start <= 0) {\n // check if prevImage should be blocked\n const preventSliding = !!this.slideConfig && this.slideConfig.infinite === false;\n if (preventSliding) {\n return;\n }\n this.end = this.images().length;\n } else {\n this.end--;\n }\n this.start = this.end - Math.min((this.previewConfig.number as number), this.images().length);\n\n this.previews = this.images().filter((img: Image, i: number) => i >= this.start && i < this.end);\n }\n\n}\n","<nav class=\"previews-container\"\n [class.mobile-visible]=\"previewConfig?.mobileVisible\"\n [attr.aria-label]=\"accessibilityConfig?.previewsContainerAriaLabel\"\n [title]=\"accessibilityConfig?.previewsContainerTitle\">\n\n @if (previewConfig?.visible) {\n <a class=\"nav-left\"\n [attr.aria-label]=\"accessibilityConfig?.previewScrollPrevAriaLabel\"\n [tabIndex]=\"isDisplayLeftPreviewsArrow() ? 0 : -1\" role=\"button\"\n (click)=\"onNavigationEvent('left', $event)\" (keyup)=\"onNavigationEvent('left', $event)\">\n <div class=\"inside {{ isDisplayLeftPreviewsArrow() ? 'left-arrow-preview-image' : 'empty-arrow-preview-image'}}\"\n aria-hidden=\"true\"\n [title]=\"accessibilityConfig?.previewScrollPrevTitle\"></div>\n </a>\n\n @for (preview of previews; track preview.id) {\n <div class=\"preview-container {{!previewConfig?.clickable ? ' unclickable' : ''}}\"\n (click)=\"onImageEvent(preview, $event, clickAction)\"\n (keyup)=\"onImageEvent(preview, $event, keyboardAction)\"\n >\n <ng-container *ngTemplateOutlet=\"!customTemplate() ? defaultTemplate : customTemplate() ; context:{preview, defaultTemplate}\" />\n <ng-template #defaultTemplate>\n @if (preview?.modal?.img) {\n <img class=\"inside preview-image {{isActive(preview) ? 'active' : ''}}\"\n loading=\"{{preview.loading}}\"\n [attr.fetchpriority]=\"preview.fetchpriority\"\n [src]=\"preview.plain?.img ? preview.plain?.img! : preview.modal.img\"\n ksFallbackImage [fallbackImg]=\"preview.plain?.fallbackImg ? preview.plain?.fallbackImg : preview.modal.fallbackImg\"\n ksSize [sizeConfig]=\"{width: previewConfig?.size ? previewConfig?.size?.width! : defaultPreviewSize.width,\n height: previewConfig?.size ? previewConfig?.size?.height! : defaultPreviewSize.height}\"\n [attr.aria-label]=\"preview.modal.ariaLabel ? preview.modal.ariaLabel : ''\"\n [title]=\"(preview.modal.title || preview.modal.title === '') ? preview.modal.title : ''\"\n alt=\"{{preview.modal.alt ? preview.modal.alt : ''}}\"\n [tabIndex]=\"0\" role=\"img\"\n />\n }\n </ng-template>\n </div>\n }\n\n\n <a class=\"nav-right\"\n [attr.aria-label]=\"accessibilityConfig?.previewScrollNextAriaLabel\"\n [tabIndex]=\"isDisplayRightPreviewsArrow() ? 0 : -1\" role=\"button\"\n (click)=\"onNavigationEvent('right', $event)\" (keyup)=\"onNavigationEvent('right', $event)\">\n <div class=\"inside {{ isDisplayRightPreviewsArrow() ? 'right-arrow-preview-image' : 'empty-arrow-preview-image'}}\"\n aria-hidden=\"true\"\n [title]=\"accessibilityConfig?.previewScrollNextTitle\"></div>\n </a>\n }\n</nav>\n","/*\n The MIT License (MIT)\n\n Copyright (c) 2017-2026 Stefano Cappa (Ks89)\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\n\nimport { Directive, HostListener, output, input } from '@angular/core';\n\n/**\n * Directive to manage keyboard navigation.\n */\n@Directive({ selector: '[ksKeyboardNavigation]' })\nexport class KeyboardNavigationDirective {\n /**\n * Boolean input to skip keyboard navigation.\n */\n isOpen = input.required<boolean>();\n\n /**\n * Output to emit keyboard `code` of the pressed key (keydown).\n */\n readonly keyboardNavigation = output<string>();\n\n /**\n * Listener to catch keyboard's events and call the right method based on the key.\n * For instance, pressing esc, this will call `closeGallery(Action.KEYBOARD)` and so on.\n * If you passed a valid `keyboardConfig` esc, right and left buttons will be customized based on your data.\n * @param e KeyboardEvent caught by the listener.\n */\n @HostListener('window:keydown', ['$event'])\n onKeyDown(e: KeyboardEvent): void {\n if (!this.isOpen()) {\n return;\n }\n this.keyboardNavigation.emit(e.code);\n }\n}\n","/*\n The MIT License (MIT)\n\n Copyright (c) 2017-2026 Stefano Cappa (Ks89)\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\n\nimport { Directive, HostListener, output } from '@angular/core';\n\n\n// Inspired from https://stackblitz.com/edit/angular-swipe-events-with-hostlistner?file=src%2Fapp%2Fapp.component.ts\n\n/**\n * Directive to manage swipe events on touch devices.\n */\n@Directive({ selector: '[ksSwipe]' })\nexport class SwipeDirective {\n defaultTouch = { x: 0, y: 0, time: 0 };\n\n /**\n * Output to emit swipe left event. Payload is empty.\n */\n readonly swipeLeft = output();\n /**\n * Output to emit swipe right event. Payload is empty.\n */\n readonly swipeRight = output();\n /**\n * Output to emit swipe up event. Payload is empty.\n */\n readonly swipeUp = output();\n /**\n * Output to emit swipe down event. Payload is empty.\n */\n readonly swipeDown = output();\n\n /**\n * Method called by Angular itself every click thanks to `@HostListener`.\n * @param event TouchEvent payload received on touch\n */\n @HostListener('touchstart', ['$event'])\n @HostListener('touchend', ['$event'])\n @HostListener('touchcancel', ['$event'])\n handleTouch(event: TouchEvent) {\n let touch = event.touches[0] || event.changedTouches[0];\n // check the events\n if (event.type === 'touchstart') {\n this.defaultTouch.x = touch.pageX;\n this.defaultTouch.y = touch.pageY;\n this.defaultTouch.time = event.timeStamp;\n } else if (event.type === 'touchend') {\n let deltaX = touch.pageX - this.defaultTouch.x;\n let deltaY = touch.pageY - this.defaultTouch.y;\n let deltaTime = event.timeStamp - this.defaultTouch.time;\n\n // simulate a swipe -> less than 500 ms and more than 60 px\n if (deltaTime < 500) {\n // touch movement lasted less than 500 ms\n if (Math.abs(deltaX) > 60) {\n // delta x is at least 60 pixels\n if (deltaX > 0) {\n this.swipeRight.emit();\n } else {\n this.swipeLeft.emit();\n }\n }\n\n if (Math.abs(deltaY) > 60) {\n // delta y is at least 60 pixels\n if (deltaY > 0) {\n this.swipeDown.emit();\n } else {\n this.swipeUp.emit();\n }\n }\n }\n }\n }\n\n}\n","/*\n The MIT License (MIT)\n\n Copyright (c) 2017-2026 Stefano Cappa (Ks89)\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\n\nimport { ChangeDetectionStrategy, Component, input } from '@angular/core';\n\nimport { AccessibilityConfig } from '../../../model/accessibility.interface';\nimport { LoadingConfig, LoadingType } from '../../../model/loading-config.interface';\n\n/**\n * Component with the loading spinner\n */\n@Component({\n selector: 'ks-loading-spinner',\n styleUrls: [\n 'style-loading-spinner-standard.css',\n 'style-loading-spinner-dots.css',\n 'style-loading-spinner-bars.css',\n 'style-loading-spinner-circular.css',\n 'style-loading-spinner-cube-flipping.css',\n 'style-loading-spinner-circles.css',\n 'style-loading-spinner-exploding-squares.scss'\n ],\n templateUrl: 'loading-spinner.html',\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class LoadingSpinnerComponent {\n /**\n * Object of type `LoadingConfig` exposed to the template.\n * It contains a field to choose a loading spinner.\n */\n readonly loadingConfig = input<LoadingConfig>();\n /**\n * Object of type `AccessibilityConfig` to init custom accessibility features.\n * For instance, it contains titles, alt texts, aria-labels and so on.\n */\n readonly accessibilityConfig = input<AccessibilityConfig>();\n\n /**\n * Enum of type `LoadingType` to choose the standard loading spinner.\n * Declared here to be used inside the template.\n */\n loadingStandard: LoadingType = LoadingType.STANDARD;\n /**\n * Enum of type `LoadingType` to choose the bars loading spinner.\n * Declared here to be used inside the template.\n */\n loadingBars: LoadingType = LoadingType.BARS;\n /**\n * Enum of type `LoadingType` to choose the circular loading spinner.\n * Declared here to be used inside the template.\n */\n loadingCircular: LoadingType = LoadingType.CIRCULAR;\n /**\n * Enum of type `LoadingType` to choose the dots loading spinner.\n * Declared here to be used inside the template.\n */\n loadingDots: LoadingType = LoadingType.DOTS;\n /**\n * Enum of type `LoadingType` to choose the cube flipping loading spinner.\n * Declared here to be used inside the template.\n */\n loadingCubeFlipping: LoadingType = LoadingType.CUBE_FLIPPING;\n /**\n * Enum of type `LoadingType` to choose the circles loading spinner.\n * Declared here to be used inside the template.\n */\n loadingCircles: LoadingType = LoadingType.CIRCLES;\n /**\n * Enum of type `LoadingType` to choose the explosing squares loading spinner.\n * Declared here to be used inside the template.\n */\n loadingExplosingSquares: LoadingType = LoadingType.EXPLOSING_SQUARES;\n}\n","<div [attr.aria-label]=\"accessibilityConfig()?.loadingSpinnerAriaLabel\"\n [title]=\"accessibilityConfig()?.loadingSpinnerTitle\">\n\n @if (loadingConfig()) {\n @switch (loadingConfig()?.type) {\n @case (loadingStandard) {\n <div class=\"cssload-loader\">\n <div class=\"cssload-inner cssload-one\"></div>\n <div class=\"cssload-inner cssload-two\"></div>\n <div class=\"cssload-inner cssload-three\"></div>\n </div>\n }\n @case (loadingBars) {\n <div class=\"loader-bars\">\n </div>\n }\n @case (loadingCircular) {\n <div class=\"loader-circular\">\n </div>\n }\n @case (loadingDots) {\n <div class=\"loader-dots\">\n </div>\n }\n @case (loadingCubeFlipping) {\n <div class=\"cube-wrapper\">\n <div class=\"cube-folding\">\n <span class=\"leaf1\"></span>\n <span class=\"leaf2\"></span>\n <span class=\"leaf3\"></span>\n <span class=\"leaf4\"></span>\n </div>\n </div>\n }\n @case (loadingCircles) {\n <div id=\"preloader\">\n <div id=\"loader\"></div>\n </div>\n }\n @case (loadingExplosingSquares) {\n <div class=\"loader\">\n <span></span>\n <span></span>\n <span></span>\n <span></span>\n </div>\n }\n }\n }\n</div>\n","/*\n The MIT License (MIT)\n\n Copyright (c) 2017-2026 Stefano Cappa (Ks89)\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\n\nimport {\n AfterContentInit,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n HostListener,\n inject,\n NgZone,\n OnChanges,\n OnDestroy,\n OnInit,\n PLATFORM_ID,\n SimpleChange,\n SimpleChanges,\n output,\n input\n} from '@angular/core';\nimport { isPlatformBrowser, NgClass } from '@angular/common';\n\nimport { Subject, timer } from 'rxjs';\nimport { filter, map, switchMap, takeUntil } from 'rxjs/operators';\n\nimport { AccessibleComponent } from '../accessible.component';\nimport { AccessibilityConfig } from '../../model/accessibility.interface';\nimport { Action } from '../../model/action.enum';\nimport { DescriptionStrategy } from '../../model/description.interface';\nimport { Image, ImageModalEvent } from '../../model/image.class';\nimport { InternalLibImage } from '../../model/image-internal.class';\nimport { Keyboard } from '../../model/keyboard.enum';\nimport { KeyboardConfig } from '../../model/keyboard-config.interface';\nimport { SlideConfig } from '../../model/slide-config.interface';\nimport { NEXT, PREV } from '../../utils/user-input.util';\nimport { getIndex } from '../../utils/image.util';\nimport { CurrentImageConfig } from '../../model/current-image-config.interface';\nimport { ConfigService } from '../../services/config.service';\nimport { LibConfig } from '../../model/lib-config.interface';\nimport { KeyboardNavigationDirective } from '../../directives/keyboard-navigation.directive';\nimport { FallbackImageDirective } from '../../directives/fallback-image.directive';\nimport { SizeDirective } from '../../directives/size.directive';\nimport { SwipeDirective } from '../../directives/swipe.directive';\nimport { DescriptionDirective } from '../../directives/description.directive';\nimport { LoadingSpinnerComponent } from './loading-spinner/loading-spinner.component';\n\n/**\n * Interface to describe the Load Event, used to\n * emit an event when the image is finally loaded and the spinner has gone.\n */\nexport interface ImageLoadEvent {\n status: boolean;\n index: number;\n id: number;\n}\n\n/**\n * Component with the current image with some additional elements like arrows and side previews.\n */\n@Component({\n selector: 'ks-current-image',\n styleUrls: ['current-image.scss', '../image-arrows.scss', 'current-image-previews.scss'],\n templateUrl: 'current-image.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [KeyboardNavigationDirective, FallbackImageDirective, SizeDirective,\n SwipeDirective, NgClass, DescriptionDirective, LoadingSpinnerComponent]\n})\nexport class CurrentImageComponent extends AccessibleComponent implements OnInit, OnChanges, AfterContentInit, OnDestroy {\n /**\n * Unique id (>=0) of the current instance of this library. This is useful when you are using\n * the service to call modal gallery without open it manually.\n */\n id = input.required<number>();\n /**\n * Object of type `InternalLibImage` that represent the visible image.\n */\n currentImage = input.required<InternalLibImage>();\n /**\n * Array of `InternalLibImage` that represent the model of this library with all images,\n * thumbs and so on.\n */\n images = input.required<InternalLibImage[]>();\n /**\n * Boolean that it is true if the modal gallery is visible.\n * If yes, also this component should be visible.\n */\n isOpen = input<boolean>(false);\n\n /**\n * Output to emit an event when images are loaded. The payload contains an `ImageLoadEvent`.\n */\n readonly loadImage = output<ImageLoadEvent>();\n /**\n * Output to emit any changes of the current image. The payload contains an `ImageModalEvent`.\n */\n readonly changeImage = output<ImageModalEvent>();\n /**\n * Output to emit an event when the modal gallery is closed. The payload contains an `ImageModalEvent`.\n */\n readonly closeGallery = output<ImageModalEvent>();\n\n /**\n * Subject to play modal-gallery.\n */\n private start$ = new Subject<void>();\n /**\n * Subject to stop modal-gallery.\n */\n private stop$ = new Subject<void>();\n\n /**\n * Enum of type `Action` that represents a normal action.\n * Declared here to be used inside the template.\n */\n normalAction: Action = Action.NORMAL;\n /**\n * Object of type `AccessibilityConfig` to init custom accessibility features.\n * For instance, it contains titles, alt texts, aria-labels and so on.\n */\n accessibilityConfig: AccessibilityConfig | undefined;\n /**\n * Object of type `SlideConfig` to get `infinite sliding`.\n */\n slideConfig: SlideConfig | undefined;\n /**\n * Object to configure current image in modal-gallery.\n * For instance you can disable navigation on click on current image (enabled by default).\n */\n currentImageConfig: CurrentImageConfig | undefined;\n /**\n * Object of type `KeyboardConfig` to assign custom keys to both ESC, RIGHT and LEFT keyboard's actions.\n */\n keyboardConfig: KeyboardConfig | undefined;\n /**\n * Enum of type `Action` that represents a mouse click on a button.\n * Declared here to be used inside the template.\n */\n clickAction: Action = Action.CLICK;\n /**\n * Enum of type `Action` that represents a keyboard action.\n * Declared here to be used inside the template.\n */\n keyboardAction: Action = Action.KEYBOARD;\n /**\n * Boolean that it's true when you are watching the first image (currently visible).\n * False by default\n */\n isFirstImage = false;\n /**\n * Boolean that it's true when you are watching the last image (currently visible).\n * False by default\n */\n isLastImage = false;\n /**\n * Boolean that it's true if an image of the modal gallery is still loading.\n * True by default\n */\n loading = true;\n\n private readonly platformId: Object = inject(PLATFORM_ID);\n private ngZone: NgZone = inject(NgZone);\n private configService: ConfigService = inject(ConfigService);\n // this must be public for testing purposes\n ref: ChangeDetectorRef = inject(ChangeDetectorRef);\n\n /**\n * Listener to stop the gallery when the mouse pointer is over the current image.\n */\n @HostListener('mouseenter')\n onMouseEnter(): void {\n // if carousel feature is disable, don't do anything in any case\n if (!this.slideConfig || !this.slideConfig.playConfig) {\n return;\n }\n if (!this.slideConfig.playConfig.pauseOnHover) {\n return;\n }\n this.stopCarousel();\n }\n\n /**\n * Listener to play the gallery when the mouse pointer leave the current image.\n */\n @HostListener('mouseleave')\n onMouseLeave(): void {\n // if carousel feature is disable, don't do anything in any case\n if (!this.slideConfig || !this.slideConfig.playConfig) {\n return;\n }\n if (!this.slideConfig.playConfig.pauseOnHover || !this.slideConfig.playConfig.autoPlay) {\n return;\n }\n this.playCarousel();\n }\n\n /**\n * Method ´ngOnInit´ to init configuration.\n * This is an angular lifecycle hook, so its called automatically by Angular itself.\n * In particular, it's called only one time!!!\n */\n ngOnInit(): void {\n const libConfig: LibConfig | undefined = this.configService.getConfig(this.id());\n if (!libConfig || !libConfig.buttonsConfig) {\n throw new Error('Internal library error - libConfig and buttonsConfig must be defined');\n }\n this.slideConfig = libConfig.slideConfig;\n this.accessibilityConfig = libConfig.accessibilityConfig ;\n this.currentImageConfig = libConfig.currentImageConfig;\n this.keyboardConfig = libConfig.keyboardConfig;\n }\n\n /**\n * Method ´ngOnChanges´ to update `loading` status and emit events.\n * If the gallery is open, then it will also manage boundary arrows and sliding.\n * This is an angular lifecycle hook, so its called automatically by Angular itself.\n * In particular, it's called when any data-bound property of a directive changes!!!\n */\n ngOnChanges(changes: SimpleChanges): void {\n const libConfig: LibConfig | undefined = this.configService.getConfig(this.id());\n if (!libConfig) {\n throw new Error('Internal library error - libConfig must be defined');\n }\n const images: SimpleChange = changes['images'];\n const currentImage: SimpleChange = changes['currentImage'];\n\n if (currentImage && currentImage.previousValue !== currentImage.currentValue) {\n this.updateIndexes();\n } else if (images && images.previousValue !== images.currentValue) {\n this.updateIndexes();\n }\n\n const slideConfig: SimpleChange = changes['slideConfig'];\n if (slideConfig && slideConfig.previousValue !== slideConfig.currentValue) {\n this.slideConfig = libConfig.slideConfig;\n }\n }\n\n /**\n * This is an angular lifecycle hook, so its called automatically by Angular itself.\n */\n ngAfterContentInit(): void {\n // interval doesn't play well with SSR and protractor,\n // so we should run it in the browser and outside Angular\n if (isPlatformBrowser(this.platformId)) {\n this.ngZone.runOutsideAngular(() => {\n this.start$\n .pipe(\n map(() => this.slideConfig && this.slideConfig.playConfig && this.slideConfig.playConfig.autoPlay && this.slideConfig.playConfig.interval),\n // tslint:disable-next-line:no-any\n filter((interval: any) => interval > 0),\n switchMap(interval => timer(interval).pipe(takeUntil(this.stop$)))\n )\n .subscribe(() =>\n this.ngZone.run(() => {\n if (!this.isLastImage) {\n this.nextImage(Action.AUTOPLAY);\n }\n this.ref.markForCheck();\n })\n );\n\n this.start$.next();\n });\n }\n }\n\n /**\n * Method to handle keypress based on the `keyboardConfig` input. It gets the code of\n * the key that triggered the keypress event to navigate between images or to close the modal gallery.\n * @param code string of the key that triggered the keypress event\n */\n onKeyPress(code: string): void {\n const esc: string = this.keyboardConfig && this.keyboardConfig.esc ? this.keyboardConfig.esc : Keyboard.ESC;\n const right: string = this.keyboardConfig && this.keyboardConfig.right ? this.keyboardConfig.right : Keyboard.RIGHT_ARROW;\n const left: string = this.keyboardConfig && this.keyboardConfig.left ? this.keyboardConfig.left : Keyboard.LEFT_ARROW;\n\n switch (code) {\n case esc:\n this.closeGallery.emit(new ImageModalEvent(this.id(), Action.KEYBOARD, true));\n break;\n case right:\n this.nextImage(Action.KEYBOARD);\n break;\n case left:\n this.prevImage(Action.KEYBOARD);\n break;\n }\n }\n\n /**\n * Method to get the image description based on input params.\n * If you provide a full description this will be the visible description, otherwise,\n * it will be built using the `Description` object, concatenating its fields.\n * @param image image to get its description. If not provided it will be the current image\n * @returns String description of the image (or the current image if not provided)\n * @throws an Error if description isn't available\n */\n getDescriptionToDisplay(image: Image = this.currentImage()): string {\n if (!this.currentImageConfig || !this.currentImageConfig.description) {\n throw new Error('Description input must be a valid object implementing the Description interface');\n }\n\n const imageWithoutDescription: boolean = !image.modal || !image.modal.description || image.modal.description === '';\n\n switch (this.currentImageConfig.description.strategy) {\n case DescriptionStrategy.HIDE_IF_EMPTY:\n return imageWithoutDescription ? '' : image.modal.description + '';\n case DescriptionStrategy.ALWAYS_HIDDEN:\n return '';\n default:\n // ----------- DescriptionStrategy.ALWAYS_VISIBLE -----------------\n return this.buildTextDescription(image, imageWithoutDescription);\n }\n }\n\n /**\n * Method to get `alt attribute`.\n * `alt` specifies an alternate text for an image, if the image cannot be displayed.\n * @param image Image to get its alt description. If not provided it will be the current image\n * @returns String alt description of the image (or the current image if not provided)\n */\n getAltDescriptionByImage(image: Image = this.currentImage()): string {\n if (!image) {\n return '';\n }\n return image.modal && image.modal.description ? image.modal.description : `Image ${getIndex(image, this.images()) + 1}`;\n }\n\n /**\n * Method to get the title attributes based on descriptions.\n * This is useful to prevent accessibility issues, because if DescriptionStrategy is ALWAYS_HIDDEN,\n * it prevents an empty string as title.\n * @param image Image to get its description. If not provided it will be the current image\n * @returns String title of the image based on descriptions\n * @throws an Error if description isn't available\n */\n getTitleToDisplay(image: Image = this.currentImage()): string {\n if (!this.currentImageConfig || !this.currentImageConfig.description) {\n throw new Error('Description input must be a valid object implementing the Description interface');\n }\n const imageWithoutDescription: boolean = !image.modal || !image.modal.description || image.modal.description === '';\n return this.buildTextDescription(image, imageWithoutDescription);\n }\n\n /**\n * Method to get the left side preview image.\n * @returns Image the image to show as size preview on the left\n */\n getLeftPreviewImage(): Image {\n if (!this.slideConfig) {\n throw new Error('Internal library error - slideConfig must be defined');\n }\n const currentIndex: number = getIndex(this.currentImage(), this.images());\n if (currentIndex === 0 && this.slideConfig.infinite) {\n // the current image is the first one,\n // so the previous one is the last image\n // because infinite is true\n return this.images()[this.images().length - 1];\n }\n this.handleBoundaries(currentIndex);\n return this.images()[Math.max(currentIndex - 1, 0)];\n }\n\n /**\n * Method to get the right side preview image.\n * @returns Image the image to show as size preview on the right\n */\n getRightPreviewImage(): Image {\n if (!this.slideConfig) {\n throw new Error('Internal library error - slideConfig must be defined');\n }\n const currentIndex: number = getIndex(this.currentImage(), this.images());\n const images = this.images();\n if (currentIndex === images.length - 1 && this.slideConfig.infinite) {\n // the current image is the last one,\n // so the next one is the first image\n // because infinite is true\n return images[0];\n }\n this.handleBoundaries(currentIndex);\n return images[Math.min(currentIndex + 1, images.length - 1)];\n }\n\n /**\n * Method called by events from both keyboard and mouse on an image.\n * This will invoke the nextImage method.\n * @param event keyboardEvent | MouseEvent payload\n * @param action action that triggered the event or `Action.NORMAL` if not provided\n */\n onImageEvent(event: KeyboardEvent | MouseEvent, action: Action = Action.NORMAL): void {\n if (!this.currentImageConfig) {\n throw new Error('Internal library error - currentImageConfig must be defined');\n }\n // check if triggered by a mouse click\n // If yes, It should block navigation when navigateOnClick is false\n if (action === Action.CLICK && !this.currentImageConfig.navigateOnClick) {\n // a user has requested to block navigation via configCurrentImage.navigateOnClick property\n return;\n }\n\n const result: number = super.handleImageEvent(event);\n if (result === NEXT) {\n this.nextImage(action);\n }\n }\n\n /**\n * Method called by events from both keyboard and mouse on a navigation arrow.\n * @param direction string of the navigation that can be either 'next' or 'prev'\n * @param event KeyboardEvent | MouseEvent payload\n * @param action Action that triggered the event or `Action.NORMAL` if not provided\n * @param disable boolean to disable navigation\n */\n onNavigationEvent(direction: string, event: KeyboardEvent | MouseEvent, action: Action = Action.NORMAL, disable: boolean = false): void {\n if (disable) {\n return;\n }\n const result: number = super.handleNavigationEvent(direction, event);\n if (result === NEXT) {\n this.nextImage(action);\n } else if (result === PREV) {\n this.prevImage(action);\n }\n }\n\n /**\n * Method to go back to the previous image.\n * @param action Enum of type `Action` that represents the source\n * action that moved back to the previous image. `Action.NORMAL` by default.\n */\n prevImage(action: Action = Action.NORMAL): void {\n // check if prevImage should be blocked\n if (this.isPreventSliding(0)) {\n return;\n }\n const prevImage: InternalLibImage = this.getPrevImage();\n this.loading = !prevImage.previouslyLoaded;\n this.changeImage.emit(new ImageModalEvent(this.id(), action, getIndex(prevImage, this.images())));\n\n this.start$.next();\n }\n\n /**\n * Method to go back to the previous image.\n * @param action Enum of type `Action` that represents the source\n * action that moved to the next image. `Action.NORMAL` by default.\n */\n nextImage(action: Action = Action.NORMAL): void {\n // check if nextImage should be blocked\n const images = this.images();\n if (this.isPreventSliding(images.length - 1)) {\n return;\n }\n const nextImage: InternalLibImage = this.getNextImage();\n this.loading = !nextImage.previouslyLoaded;\n this.changeImage.emit(new ImageModalEvent(this.id(), action, getIndex(nextImage, images)));\n\n this.start$.next();\n }\n\n /**\n * Method to emit an event as loadImage output to say that the requested image if loaded.\n * This method is invoked by the javascript's 'load' event on an img tag.\n * @param event event that triggered the load\n */\n onImageLoad(event: Event): void {\n const loadImageData: ImageLoadEvent = {\n status: true,\n index: getIndex(this.currentImage(), this.images()),\n id: this.currentImage().id\n };\n\n this.loadImage.emit(loadImageData);\n\n this.loading = false;\n }\n\n /**\n * Method used by SwipeDirective to support touch gestures (you can also invert the swipe direction with configCurrentImage.invertSwipe).\n * @param action String that represent the direction of the swipe action. 'swiperight' by default.\n */\n swipe(action = 'swiperight'): void {\n if (!this.currentImageConfig) {\n throw new Error('Internal library error - currentImageConfig must be defined');\n }\n switch (action) {\n case 'swiperight':\n if (this.currentImageConfig.invertSwipe) {\n this.prevImage(Action.SWIPE);\n } else {\n this.nextImage(Action.SWIPE);\n }\n break;\n case 'swipeleft':\n if (this.currentImageConfig.invertSwipe) {\n this.nextImage(Action.SWIPE);\n } else {\n this.prevImage(Action.SWIPE);\n }\n break;\n // case this.SWIPE_ACTION.UP:\n // break;\n // case this.SWIPE_ACTION.DOWN:\n // break;\n }\n }\n\n /**\n * Method used in `modal-gallery.component` to get the index of an image to delete.\n * @param image image to get the index, or the visible image, if not passed\n * @returns number the index of the image\n */\n getIndexToDelete(image: Image = this.currentImage()): number {\n return getIndex(image, this.images());\n }\n\n /**\n * Method to play modal gallery.\n */\n playCarousel(): void {\n this.start$.next();\n }\n\n /**\n * Stops modal gallery from cycling through items.\n */\n stopCarousel(): void {\n this.stop$.next();\n }\n\n /**\n * Method to cleanup resources. In fact, this will stop the modal gallery.\n * This is an angular lifecycle hook that is called when this component is destroyed.\n */\n ngOnDestroy(): void {\n this.stopCarousel();\n }\n\n /**\n * Private method to update both `isFirstImage` and `isLastImage` based on\n * the index of the current image.\n * @param currentIndex number is the index of the current image\n */\n private handleBoundaries(currentIndex: number): void {\n const images = this.images();\n if (images.length === 1) {\n this.isFirstImage = true;\n this.isLastImage = true;\n this.ref.markForCheck();\n return;\n }\n if (!this.slideConfig || this.slideConfig.infinite === true) {\n // infinite sliding enabled\n this.isFirstImage = false;\n this.isLastImage = false;\n this.ref.markForCheck();\n } else {\n // execute this only if infinite sliding is disabled\n switch (currentIndex) {\n case 0:\n this.isFirstImage = true;\n this.isLastImage = false;\n this.ref.markForCheck();\n break;\n case images.length - 1:\n this.isFirstImage = false;\n this.isLastImage = true;\n this.ref.markForCheck();\n break;\n default:\n this.isFirstImage = false;\n this.isLastImage = false;\n this.ref.markForCheck();\n break;\n }\n }\n }\n\n /**\n * Private method to check if next/prev actions should be blocked.\n * It checks if slideConfig.infinite === false and if the image index is equals to the input parameter.\n * If yes, it returns true to say that sliding should be blocked, otherwise not.\n * @param boundaryIndex number that could be either the beginning index (0) or the last index\n * of images (this.images.length - 1).\n * @returns boolean true if slideConfig.infinite === false and the current index is\n * either the first or the last one.\n */\n private isPreventSliding(boundaryIndex: number): boolean {\n return !!this.slideConfig && this.slideConfig.infinite === false && getIndex(this.currentImage(), this.images()) === boundaryIndex;\n }\n\n /**\n * Private method to get the next index.\n * This is necessary because at the end, when you call next again, you'll go to the first image.\n * That happens because all modal images are shown like in a circle.\n */\n private getNextImage(): InternalLibImage {\n const currentIndex: number = getIndex(this.currentImage(), this.images());\n let newIndex;\n if (currentIndex >= 0 && currentIndex < this.images().length - 1) {\n newIndex = currentIndex + 1;\n } else {\n newIndex = 0; // start from the first index\n }\n return this.images()[newIndex];\n }\n\n /**\n * Private method to get the previous index.\n * This is necessary because at index 0, when you call prev again, you'll go to the last image.\n * That happens because all modal images are shown like in a circle.\n */\n private getPrevImage(): InternalLibImage {\n const currentIndex: number = getIndex(this.currentImage(), this.images());\n let newIndex;\n if (currentIndex > 0 && currentIndex <= this.images().length - 1) {\n newIndex = currentIndex - 1;\n } else {\n newIndex = this.images().length - 1; // start from the last index\n }\n return this.images()[newIndex];\n }\n\n /**\n * Private method to build a text description.\n * This is used also to create titles.\n * @param image Image to get its description. If not provided it will be the current image.\n * @param imageWithoutDescription boolean is a boolean that it's true if the image hasn't a 'modal' description.\n * @returns String description built concatenating image fields with a specific logic.\n */\n private buildTextDescription(image: Image, imageWithoutDescription: boolean): string {\n if (!this.currentImageConfig || !this.currentImageConfig.description) {\n throw new Error('Description input must be a valid object implementing the Description interface');\n }\n\n // If customFullDescription use it, otherwise proceed to build a description\n if (this.currentImageConfig.description.customFullDescription && this.currentImageConfig.description.customFullDescription !== '') {\n return this.currentImageConfig.description.customFullDescription;\n }\n\n const currentIndex: number = getIndex(image, this.images());\n // If the current image hasn't a description,\n // prevent to write the ' - ' (or this.description.beforeTextDescription)\n\n const prevDescription: string = this.currentImageConfig.description.imageText ? this.currentImageConfig.description.imageText : '';\n const midSeparator: string = this.currentImageConfig.description.numberSeparator ? this.currentImageConfig.description.numberSeparator : '';\n const middleDescription: string = currentIndex + 1 + midSeparator + this.images().length;\n\n if (imageWithoutDescription) {\n return prevDescription + middleDescription;\n }\n\n const currImgDescription: string = image.modal && image.modal.description ? image.modal.description : '';\n const endDescription: string = this.currentImageConfig.description.beforeTextDescription + currImgDescription;\n return prevDescription + middleDescription + endDescription;\n }\n\n /**\n * Private method to call handleBoundaries when ngOnChanges is called.\n */\n private updateIndexes(): void {\n try {\n if (this.isOpen()) {\n const index: number = getIndex(this.currentImage(), this.images());\n this.handleBoundaries(index);\n }\n } catch (err) {\n console.error('Cannot get the current image index in current-image');\n throw err;\n }\n }\n}\n","<main class=\"main-image-container\"\n ksKeyboardNavigation [isOpen]=\"isOpen()\" (keyboardNavigation)=\"onKeyPress($event)\"\n [attr.aria-label]=\"accessibilityConfig?.mainContainerAriaLabel\"\n [title]=\"accessibilityConfig?.mainContainerTitle\">\n\n <div class=\"left-sub-container\">\n <a class=\"nav-left {{isFirstImage ? 'no-pointer' : ''}}\"\n [attr.aria-label]=\"accessibilityConfig?.mainPrevImageAriaLabel\"\n [tabIndex]=\"isFirstImage ? -1 : 0\" role=\"button\"\n (click)=\"onNavigationEvent('left', $event)\" (keyup)=\"onNavigationEvent('left', $event)\">\n <div class=\"inside {{isFirstImage ? 'empty-arrow-image' : 'left-arrow-image'}}\"\n aria-hidden=\"true\"\n [title]=\"isFirstImage ? '' : accessibilityConfig?.mainPrevImageTitle\"></div>\n </a>\n\n @let leftPreview = getLeftPreviewImage();\n @if (slideConfig?.sidePreviews?.show && leftPreview) {\n @if (!isFirstImage) {\n <img class=\"inside current-image-previous\"\n loading=\"{{ leftPreview.loading }}\"\n [attr.fetchpriority]=\"leftPreview.fetchpriority\"\n [src]=\"leftPreview.plain?.img ? leftPreview.plain?.img : leftPreview.modal.img\"\n ksFallbackImage [fallbackImg]=\"leftPreview.plain?.fallbackImg ? leftPreview.plain?.fallbackImg : leftPreview.modal.fallbackImg\"\n [hidden]=\"loading\"\n ksSize [sizeConfig]=\"{width: slideConfig?.sidePreviews?.size?.width, height: slideConfig?.sidePreviews?.size?.height}\"\n [attr.aria-label]=\"leftPreview.modal.ariaLabel\"\n [title]=\"(leftPreview.modal.title || leftPreview.modal.title === '') ? leftPreview.modal.title : getDescriptionToDisplay(leftPreview)\"\n alt=\"{{leftPreview.modal.alt ? leftPreview.modal.alt : getAltDescriptionByImage(leftPreview)}}\"\n [tabIndex]=\"0\" role=\"img\"\n (click)=\"onNavigationEvent('left', $event, clickAction)\" (keyup)=\"onNavigationEvent('left', $event, keyboardAction)\" />\n } @else {\n <div class=\"current-image-previous hidden\"\n ksSize [sizeConfig]=\"{width: slideConfig?.sidePreviews?.size?.width, height: slideConfig?.sidePreviews?.size?.height}\"></div>\n }\n }\n </div>\n\n\n <figure id=\"current-figure\" [style.opacity]=\"loading ? '0' : '1'\">\n <picture class=\"current-image\">\n @for (source of currentImage().modal?.sources; let i = $index; track i) {\n <source [media]=\"source.media\" [srcset]=\"source.srcset\">\n }\n <img [id]=\"currentImage().id\"\n loading=\"{{ currentImage().loading }}\"\n [attr.fetchpriority]=\"currentImage().fetchpriority\"\n class=\"inside\"\n [ngClass]=\"currentImageConfig?.navigateOnClick ? '' : 'unclickable'\"\n [src]=\"currentImage().modal.img\"\n ksFallbackImage [fallbackImg]=\"currentImage().modal.fallbackImg\"\n [attr.aria-label]=\"currentImage().modal.ariaLabel\"\n [title]=\"(currentImage().modal.title || currentImage().modal.title === '') ? currentImage().modal.title : getTitleToDisplay()\"\n alt=\"{{currentImage().modal.alt ? currentImage().modal.alt : getAltDescriptionByImage()}}\"\n [tabIndex]=\"0\" role=\"img\"\n (load)=\"onImageLoad($event)\"\n (click)=\"onImageEvent($event, clickAction)\" (keyup)=\"onImageEvent($event, keyboardAction)\"\n ksSwipe\n (swipeLeft)=\"swipe('swipeleft')\"\n (swipeRight)=\"swipe('swiperight')\" />\n </picture>\n @if (getDescriptionToDisplay() !== '') {\n <figcaption class=\"inside description\"\n ksDescription [description]=\"currentImageConfig?.description\"\n [innerHTML]=\"getDescriptionToDisplay()\">\n </figcaption>\n }\n </figure>\n\n <div class=\"right-sub-container\">\n @let rightPreview = getRightPreviewImage();\n @if (slideConfig?.sidePreviews?.show && leftPreview) {\n @if (!isLastImage) {\n <img class=\"inside current-image-next\"\n loading=\"{{ rightPreview.loading }}\"\n [attr.fetchpriority]=\"rightPreview.fetchpriority\"\n [src]=\"rightPreview.plain?.img ? rightPreview.plain?.img : rightPreview.modal.img\"\n ksFallbackImage [fallbackImg]=\"rightPreview.plain?.fallbackImg ? rightPreview.plain?.fallbackImg : rightPreview.modal.fallbackImg\"\n [hidden]=\"loading\"\n ksSize [sizeConfig]=\"{width: slideConfig?.sidePreviews?.size?.width, height: slideConfig?.sidePreviews?.size?.height}\"\n [attr.aria-label]=\"rightPreview.modal.ariaLabel\"\n [title]=\"(rightPreview.modal.title || rightPreview.modal.title === '') ? rightPreview.modal.title : getDescriptionToDisplay(rightPreview)\"\n alt=\"{{rightPreview.modal.alt ? rightPreview.modal.alt : getAltDescriptionByImage(rightPreview)}}\"\n [tabIndex]=\"0\" role=\"img\"\n (click)=\"onNavigationEvent('right', $event, clickAction)\" (keyup)=\"onNavigationEvent('right', $event, keyboardAction)\" />\n } @else {\n <div class=\"current-image-next hidden\"\n ksSize [sizeConfig]=\"{width: slideConfig?.sidePreviews?.size?.width, height: slideConfig?.sidePreviews?.size?.height}\"></div>\n }\n }\n\n @if (loading && currentImageConfig?.loadingConfig?.enable) {\n <ks-loading-spinner [loadingConfig]=\"currentImageConfig?.loadingConfig\"\n [accessibilityConfig]=\"accessibilityConfig\" />\n }\n\n <a class=\"nav-right {{isFirstImage ? 'no-pointer' : ''}}\"\n [attr.aria-label]=\"accessibilityConfig?.mainNextImageAriaLabel\"\n [tabIndex]=\"isLastImage ? -1 : 0\" role=\"button\"\n (click)=\"onNavigationEvent('right', $event)\" (keyup)=\"onNavigationEvent('right', $event)\">\n <div class=\"inside {{isLastImage ? 'empty-arrow-image' : 'right-arrow-image'}}\"\n aria-hidden=\"true\"\n [title]=\"isLastImage ? '' : accessibilityConfig?.mainNextImageTitle\"></div>\n </a>\n </div>\n</main>\n","/*\n The MIT License (MIT)\n\n Copyright (c) 2017-2026 Stefano Cappa (Ks89)\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\n\nimport { Directive, ElementRef, inject, OnChanges, OnInit, Renderer2, input } from '@angular/core';\n\n/**\n * Directive to change the flex-wrap css property of an element.\n */\n@Directive({ selector: '[ksWrap]' })\nexport class WrapDirective implements OnInit, OnChanges {\n /**\n * Boolean input that it's true to add 'flex-wrap: wrap', 'flex-wrap: nowrap' otherwise.\n */\n readonly wrap = input.required<boolean>();\n /**\n * String input to force the width of the element to be able to see wrapping.\n */\n readonly width = input.required<string>();\n\n private renderer: Renderer2 = inject(Renderer2);\n private el: ElementRef = inject(ElementRef);\n\n /**\n * Method ´ngOnInit´ to apply the style of this directive.\n * This is an angular lifecycle hook, so its called automatically by Angular itself.\n * In particular, it's called only one time!!!\n */\n ngOnInit(): void {\n this.applyStyle();\n }\n\n /**\n * Method ´ngOnChanges´ to apply the style of this directive.\n * This is an angular lifecycle hook, so its called automatically by Angular itself.\n * In particular, it's called when any data-bound property of a directive changes!!!\n */\n ngOnChanges(): void {\n this.applyStyle();\n }\n\n /**\n * Private method to change both width and flex-wrap css properties.\n */\n private applyStyle(): void {\n this.renderer.setStyle(this.el.nativeElement, 'width', this.width());\n this.renderer.setStyle(this.el.nativeElement, 'flex-wrap', this.wrap() ? 'wrap' : 'nowrap');\n }\n}\n","/*\n The MIT License (MIT)\n\n Copyright (c) 2017-2026 Stefano Cappa (Ks89)\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\n\nimport { Directive, ElementRef, inject, OnChanges, OnInit, Renderer2, input } from '@angular/core';\n\n/**\n * Directive to change the flex-direction of an element, based on two inputs (`direction` and `justify`).\n */\n@Directive({ selector: '[ksDirection]' })\nexport class DirectionDirective implements OnInit, OnChanges {\n /**\n * String input to set the css flex-direction of an element.\n */\n readonly direction = input<string>();\n /**\n * String input to set the css justify-content of an element.\n */\n readonly justify = input<string>();\n\n private renderer: Renderer2 = inject(Renderer2);\n private el: ElementRef = inject(ElementRef);\n\n /**\n * Method ´ngOnInit´ to apply the style of this directive.\n * This is an angular lifecycle hook, so its called automatically by Angular itself.\n * In particular, it's called only one time!!!\n */\n ngOnInit(): void {\n this.applyStyle();\n }\n\n /**\n * Method ´ngOnChanges´ to apply the style of this directive.\n * This is an angular lifecycle hook, so its called automatically by Angular itself.\n * In particular, it's called when any data-bound property of a directive changes!!!\n */\n ngOnChanges(): void {\n this.applyStyle();\n }\n\n /**\n * Private method to change both direction and justify of an element.\n */\n private applyStyle(): void {\n const direction = this.direction();\n const justify = this.justify();\n if (!direction || !justify) {\n return;\n }\n this.renderer.setStyle(this.el.nativeElement, 'flex-direction', direction);\n this.renderer.setStyle(this.el.nativeElement, 'justify-content', justify);\n }\n}\n","/*\n The MIT License (MIT)\n\n Copyright (c) 2017-2026 Stefano Cappa (Ks89)\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\n\nimport { Directive, ElementRef, inject, OnChanges, OnInit, Renderer2, input } from '@angular/core';\n\nimport { Image } from '../model/image.class';\nimport { SafeResourceUrl } from '@angular/platform-browser';\n\n/**\n * Directive to add an image to an `<a>` tag with some additional custom properties.\n */\n@Directive({ selector: '[ksATagBgImage]' })\nexport class ATagBgImageDirective implements OnInit, OnChanges {\n /**\n * Object of type `Image` that represents the image to add to the `<a>` tag.\n */\n readonly image = input.required<Image>();\n /**\n * Additional style to customize the background attribute.\n * Empty string by default.\n */\n readonly style = input<string>();\n\n private renderer: Renderer2 = inject(Renderer2);\n private el: ElementRef = inject(ElementRef);\n\n /**\n * Method ´ngOnInit´ to apply the style of this directive.\n * This is an angular lifecycle hook, so its called automatically by Angular itself.\n * In particular, it's called only one time!!!\n */\n ngOnInit(): void {\n this.applyStyle();\n }\n\n /**\n * Method ´ngOnChanges´ to apply the style of this directive.\n * This is an angular lifecycle hook, so its called automatically by Angular itself.\n * In particular, it's called when any data-bound property of a directive changes!!!\n */\n ngOnChanges(): void {\n this.applyStyle();\n }\n\n /**\n * Private method to add an image as background of an `<a>` tag.\n */\n private applyStyle(): void {\n const image = this.image();\n if (!image || (!image.plain && !image.modal)) {\n return;\n }\n\n const imgPath: string | SafeResourceUrl = image.plain && image.plain.img ? image.plain.img : image.modal.img;\n let bg = `url(\"${imgPath}\") ${this.style()}`;\n\n const fallbackImgPath: string | SafeResourceUrl | undefined =\n image.plain && image.plain.fallbackImg ? image.plain.fallbackImg : image.modal.fallbackImg;\n if (!!fallbackImgPath) {\n bg += `, url(\"${fallbackImgPath}\") ${this.style()}`;\n }\n\n this.renderer.setStyle(this.el.nativeElement, 'background', bg);\n }\n}\n","/*\n The MIT License (MIT)\n\n Copyright (c) 2017-2026 Stefano Cappa (Ks89)\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\n\nimport { ChangeDetectionStrategy, Component, inject, OnChanges, OnInit, SimpleChange, SimpleChanges, output, input } from '@angular/core';\n\nimport { AccessibilityConfig } from '../../model/accessibility.interface';\nimport { Image } from '../../model/image.class';\nimport { Size } from '../../model/size.interface';\nimport { GridLayout, LineLayout, PlainGalleryConfig, PlainGalleryStrategy } from '../../model/plain-gallery-config.interface';\nimport { getIndex } from '../../utils/image.util';\nimport { ConfigService } from '../../services/config.service';\nimport { NEXT } from '../../utils/user-input.util';\nimport { AccessibleComponent } from '../accessible.component';\nimport { PlainLibConfig, LibConfig } from '../../model/lib-config.interface';\nimport { WrapDirective } from '../../directives/wrap.directive';\nimport { DirectionDirective } from '../../directives/direction.directive';\nimport { FallbackImageDirective } from '../../directives/fallback-image.directive';\nimport { SizeDirective } from '../../directives/size.directive';\nimport { ATagBgImageDirective } from '../../directives/a-tag-bg-image.directive';\n\n/**\n * Component with the gallery of thumbs.\n * In receives an array of Images, a boolean to show/hide\n * the gallery (feature used by imagePointer) and a config\n * object to customize the behaviour of this component.\n * Also, it emits click events as outputs.\n */\n@Component({\n selector: 'ks-plain-gallery',\n styleUrls: ['plain-gallery.scss'],\n templateUrl: 'plain-gallery.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [WrapDirective, DirectionDirective, FallbackImageDirective, SizeDirective, ATagBgImageDirective]\n})\nexport class PlainGalleryComponent extends AccessibleComponent implements OnInit, OnChanges {\n /**\n * Unique id (>=0) of the current instance of this library. This is required when you are using\n * the service to call modal gallery.\n */\n readonly id = input<number>();\n\n /**\n * Array of `Image` that represent the model of this library with all images, thumbs and so on.\n */\n readonly images = input<Image[]>([]);\n /**\n * PlainLibConfig object to configure plain-gallery.\n */\n readonly config = input<PlainLibConfig>();\n\n /**\n * Output to emit an event when an image is clicked.\n */\n readonly clickImage = output<number>();\n\n /**\n * Object of type `PlainGalleryConfig` to configure the plain gallery.\n */\n plainGalleryConfig: PlainGalleryConfig | undefined;\n\n /**\n * Object of type `AccessibilityConfig` to init custom accessibility features.\n * For instance, it contains titles, alt texts, aria-labels and so on.\n */\n accessibilityConfig: AccessibilityConfig | undefined;\n\n /**\n * Bi-dimensional array of `Image` object to store images to display as plain gallery.\n * [] by default.\n */\n imageGrid: Image[][] = [];\n /**\n * Size object used in the template to resize images.\n */\n size: Size | undefined;\n /**\n * Boolean passed as input to `ks-wrap` directive to configure flex-wrap css property.\n * However, it's not enough, because you need to limit the width using `widthStyle` public variable.\n * For more info check https://developer.mozilla.org/it/docs/Web/CSS/flex-wrap\n */\n wrapStyle = false;\n /**\n * String passed as input to `ks-wrap` directive to set width to be able to force overflow.\n * In this way, `wrapStyle` (flex-wrap css property) will be used as requested.\n */\n widthStyle = '';\n /**\n * String passed as input to `ks-direction` directive to set the flex-direction css property.\n * For more info check https://developer.mozilla.org/it/docs/Web/CSS/flex-direction\n */\n directionStyle: string | undefined;\n /**\n * String passed as input to `ks-direction` directive to set the justify-content css property.\n * For more info check https://developer.mozilla.org/it/docs/Web/CSS/justify-content\n */\n justifyStyle: string | undefined;\n\n private configService: ConfigService = inject(ConfigService);\n\n /**\n * Method ´ngOnInit´ to init both `configPlainGallery` calling `initPlainGalleryConfig()`\n * and `imageGrid invoking `initImageGrid()`.\n * This is an angular lifecycle hook, so its called automatically by Angular itself.\n * In particular, it's called only one time!!!\n */\n ngOnInit(): void {\n const id = this.id();\n if (id === null || id === undefined) {\n throw new Error('Internal library error - id must be defined');\n }\n this.configService.setConfig(id, this.config());\n\n const libConfig: LibConfig | undefined = this.configService.getConfig(id);\n if (!libConfig) {\n throw new Error('Internal library error - libConfig must be defined');\n }\n this.accessibilityConfig = libConfig.accessibilityConfig;\n this.plainGalleryConfig = libConfig.plainGalleryConfig;\n this.initImageGrid();\n }\n\n /**\n * Method ´ngOnChanges´ to update both `imageGrid` and`plainGalleryConfig`.\n * This is an angular lifecycle hook, so its called automatically by Angular itself.\n * In particular, it's called when any data-bound property of a directive changes!!!\n */\n ngOnChanges(changes: SimpleChanges): void {\n const id = this.id();\n if (id === null || id === undefined) {\n throw new Error('Internal library error - id must be defined');\n }\n const libConfig: LibConfig | undefined = this.configService.getConfig(id);\n if (!libConfig) {\n throw new Error('Internal library error - libConfig must be defined');\n }\n\n const imagesChange: SimpleChange = changes['images'];\n const configChange: SimpleChange = changes['config'];\n // I'm using !change.firstChange because the first time will be called both onInit and onChange and I don't\n // want to execute initialization two times.\n if (\n configChange &&\n !configChange.firstChange &&\n (configChange.previousValue !== configChange.currentValue || (!configChange.previousValue && !configChange.currentValue))\n ) {\n this.plainGalleryConfig = libConfig.plainGalleryConfig;\n // this.configPlainGallery = this.initPlainGalleryConfig();\n }\n if (imagesChange && !imagesChange.firstChange && imagesChange.previousValue !== imagesChange.currentValue) {\n this.initImageGrid();\n }\n }\n\n /**\n * Method called when you click on an image of the plain (or inline) gallery.\n * This will emit the show event with the image as payload.\n * @param img is the Image to show\n */\n showModalGalleryByImage(img: Image): void {\n const index: number = this.images().findIndex((val: Image) => val && img && val.id === img.id);\n this.showModalGallery(index);\n }\n\n /**\n * Method called when you navigate between images.\n * This will emit the show event with the image as payload.\n * @param event KeyboardEvent that triggered the navigation\n * @param img is the Image to show\n */\n onNavigationEvent(event: KeyboardEvent, img: Image): void {\n const result: number = super.handleImageEvent(event);\n if (result === NEXT) {\n this.showModalGalleryByImage(img);\n }\n }\n\n /**\n * Method to get `alt attribute`.\n * `alt` specifies an alternate text for an image, if the image cannot be displayed.\n * @param image to get its alt description.\n * @returns string alt description of the image\n */\n getAltPlainDescriptionByImage(image: Image): string {\n if (!image) {\n return '';\n }\n return image.plain && image.plain.description ? image.plain.description : `Image ${getIndex(image, this.images()) + 1}`;\n }\n\n /**\n * Method to get the title for an image.\n * @param image to get its title\n * @returns string the title of the input image\n */\n getTitleDisplay(image: Image): string {\n let description = '';\n\n if (image.plain && image.plain.description) {\n description = image.plain.description;\n } else if (image.modal && image.modal.description) {\n description = image.modal.description;\n }\n\n const currentIndex: number = getIndex(image, this.images());\n const prevDescription: string = 'Image ' + (currentIndex + 1) + '/' + this.images().length;\n let currImgDescription: string = description ? description : '';\n\n if (currImgDescription !== '') {\n currImgDescription = ' - ' + currImgDescription;\n }\n return prevDescription + currImgDescription;\n }\n\n /**\n * Method called when you click on an image of the plain (or inline) gallery.\n * This will emit the show event with the index number as payload.\n * @param index number of the clicked image\n */\n private showModalGallery(index: number): void {\n this.clickImage.emit(index);\n }\n\n /**\n * Private method to init both `imageGrid` and other style variables,\n * based on the layout type.\n */\n private initImageGrid(): void {\n if (!this.plainGalleryConfig) {\n throw new Error('Internal library error - plainGalleryConfig must be defined');\n }\n\n // reset the array to prevent issues in case of GridLayout\n this.imageGrid = [];\n\n if (this.plainGalleryConfig.layout instanceof LineLayout) {\n const layout: LineLayout = this.plainGalleryConfig.layout;\n const row: Image[] = this.images().filter((val: Image, i: number) => i < layout.breakConfig.length || layout.breakConfig.length === -1);\n this.imageGrid = [row];\n\n this.size = this.plainGalleryConfig.layout.size;\n\n switch (this.plainGalleryConfig.strategy) {\n case PlainGalleryStrategy.ROW:\n this.directionStyle = 'row';\n break;\n case PlainGalleryStrategy.COLUMN:\n this.directionStyle = 'column';\n this.wrapStyle = layout.breakConfig.wrap;\n break;\n }\n this.justifyStyle = layout.justify;\n }\n\n if (this.plainGalleryConfig.layout instanceof GridLayout) {\n const layout: GridLayout = this.plainGalleryConfig.layout;\n const count: number = Math.ceil(this.images().length / layout.breakConfig.length);\n let start = 0;\n let end: number = layout.breakConfig.length - 1;\n\n for (let j = 0; j < count; j++) {\n const row: Image[] = this.images().filter((val: Image, i: number) => i >= start && i <= end);\n this.imageGrid.push(row);\n start = end + 1;\n end = start + layout.breakConfig.length - 1;\n }\n\n this.size = this.plainGalleryConfig.layout.size;\n\n if (layout.size.width) {\n const pixels: number = +(layout.size.width).replace('px', '');\n this.widthStyle = pixels * layout.breakConfig.length + pixels / 2 + 'px';\n }\n this.wrapStyle = layout.breakConfig.wrap;\n\n this.directionStyle = 'row';\n }\n }\n}\n","<div class=\"plain-container\"\n ksWrap [wrap]=\"wrapStyle\" [width]=\"widthStyle\"\n ksDirection [direction]=\"directionStyle\" [justify]=\"justifyStyle\"\n [attr.aria-label]=\"accessibilityConfig?.plainGalleryContentAriaLabel\"\n [title]=\"accessibilityConfig?.plainGalleryContentTitle\">\n\n @for (imgRow of imageGrid; let i = $index; track i) {\n @for (imgCol of imgRow; let j = $index; track j) {\n @if (!plainGalleryConfig?.advanced?.aTags) {\n @if (imgCol?.modal?.img) {\n <img loading=\"{{imgCol.loading}}\"\n [attr.fetchpriority]=\"imgCol.fetchpriority\"\n [src]=\"imgCol.plain?.img! ? imgCol.plain?.img! : imgCol.modal.img\"\n ksFallbackImage [fallbackImg]=\"imgCol.plain?.fallbackImg ? imgCol.plain?.fallbackImg : imgCol.modal.fallbackImg\"\n class=\"image\"\n ksSize [sizeConfig]=\"{width: size?.width!, height: size?.height!}\"\n [attr.aria-label]=\"imgCol.plain?.ariaLabel\"\n [title]=\"(imgCol.plain?.title || imgCol.plain?.title === '') ? imgCol.plain?.title : getTitleDisplay(imgCol)\"\n alt=\"{{imgCol.plain?.alt! ? imgCol.plain?.alt! : getAltPlainDescriptionByImage(imgCol)}}\"\n [tabIndex]=\"0\" role=\"img\"\n (click)=\"showModalGalleryByImage(imgCol)\" (keyup)=\"onNavigationEvent($event, imgCol)\" />\n }\n } @else {\n <!-- Add directive to set background with the image url as param to pass thumb or img-->\n <!-- to do something like this <a style=\"background: url('path to image') 50% 50%/cover\">.-->\n @if (imgCol?.modal?.img) {\n <a class=\"a-tag-image\"\n ksATagBgImage [image]=\"imgCol\" [style]=\"plainGalleryConfig?.advanced?.additionalBackground\"\n ksSize [sizeConfig]=\"{width: size?.width!, height: size?.height!}\"\n [attr.aria-label]=\"imgCol.plain?.ariaLabel\"\n [title]=\"(imgCol.plain?.title || imgCol.plain?.title === '') ? imgCol.plain?.title : getTitleDisplay(imgCol)\"\n [tabIndex]=\"0\"\n (click)=\"showModalGalleryByImage(imgCol)\" (keyup)=\"onNavigationEvent($event, imgCol)\"></a>\n }\n }\n }\n }\n\n</div>\n\n","/*\n The MIT License (MIT)\n\n Copyright (c) 2017-2026 Stefano Cappa (Ks89)\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\n\nimport { InjectionToken } from '@angular/core';\n\nimport { ModalGalleryConfig } from '../../model/modal-gallery-config.interface';\n\nexport const DIALOG_DATA = new InjectionToken<ModalGalleryConfig>('DIALOG_DATA');\n","/*\n The MIT License (MIT)\n\n Copyright (c) 2017-2026 Stefano Cappa (Ks89)\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\n\nimport { Injectable } from '@angular/core';\n\n/**\n * Service to check if the provided id is unique\n */\n@Injectable({ providedIn: 'root' })\nexport class IdValidatorService {\n ids = new Map();\n\n /**\n * Method to check and reserve an id for the current instance of the library.\n * In this way, no other instances can use the same id.\n * @param galleryId number or undefined that represents the unique id of the gallery.\n * @return boolean true if success. false is never returned, instead an exception is thrown\n * @throws a error with a message if galleryId is neither unique, < 0 or an integer\n */\n checkAndAdd(galleryId: number | undefined): boolean {\n if (galleryId === undefined || !Number.isInteger(galleryId) || galleryId < 0) {\n throw new Error('You must provide a valid [id]=\"unique integer > 0 here\" to the gallery/carousel in your template');\n }\n if (this.ids.get(galleryId)) {\n throw new Error(`Cannot create gallery with id=${galleryId} because already used in your application. This must be a unique integer >= 0`);\n }\n this.ids.set(galleryId, galleryId);\n return true;\n }\n\n /**\n * Method to remove a reserved id. In this way you are able to use the id again for another instance of the library.\n * @param galleryId number or undefined that represents the unique id of the gallery.\n * @return boolean true if success. false is never returned, instead an exception is thrown*\n * @throws a error with a message if galleryId is neither integer or < 0\n * * this should be improved without return true, because it doesn't make sense! :(\n */\n remove(galleryId: number | undefined): boolean {\n if (galleryId === undefined || !Number.isInteger(galleryId) || galleryId < 0) {\n throw new Error('You must provide a valid [id]=\"unique integer > 0 here\" to the gallery/carousel in your template');\n }\n this.ids.delete(galleryId);\n return true;\n }\n}\n","/*\n The MIT License (MIT)\n\n Copyright (c) 2017-2026 Stefano Cappa (Ks89)\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\n\nimport { OverlayRef } from '@angular/cdk/overlay';\n\nimport { Subject } from 'rxjs';\nimport { ImageModalEvent } from '../../model/image.class';\nimport { ButtonEvent } from '../../model/buttons-config.interface';\n\n/**\n * Class that represents the modal dialog instance.\n * It is returned by the open method.\n */\nexport class ModalGalleryRef {\n private close = new Subject<ImageModalEvent>();\n close$ = this.close.asObservable();\n private show = new Subject<ImageModalEvent>();\n show$ = this.show.asObservable();\n private firstImage = new Subject<ImageModalEvent>();\n firstImage$ = this.firstImage.asObservable();\n private lastImage = new Subject<ImageModalEvent>();\n lastImage$ = this.lastImage.asObservable();\n private hasData = new Subject<ImageModalEvent>();\n hasData$ = this.hasData.asObservable();\n private buttonBeforeHook = new Subject<ButtonEvent>();\n buttonBeforeHook$ = this.buttonBeforeHook.asObservable();\n private buttonAfterHook = new Subject<ButtonEvent>();\n buttonAfterHook$ = this.buttonAfterHook.asObservable();\n\n private overlayRef: OverlayRef;\n\n constructor(overlayRef: OverlayRef) {\n this.overlayRef = overlayRef;\n }\n\n /**\n * Close modal dialog, disposing the Overlay.\n */\n closeModal(): void {\n this.overlayRef.dispose();\n }\n\n /**\n * Method to emit close event.\n * @param event ImageModalEvent event payload\n */\n emitClose(event: ImageModalEvent): void {\n this.close.next(event);\n }\n\n /**\n * Method to emit show event.\n * @param event ImageModalEvent event payload\n */\n emitShow(event: ImageModalEvent): void {\n this.show.next(event);\n }\n\n /**\n * Method to emit firstImage event.\n * @param event ImageModalEvent event payload\n */\n emitFirstImage(event: ImageModalEvent): void {\n this.firstImage.next(event);\n }\n\n /**\n * Method to emit lastImage event.\n * @param event ImageModalEvent event payload\n */\n emitLastImage(event: ImageModalEvent): void {\n this.lastImage.next(event);\n }\n\n /**\n * Method to emit hasData event.\n * @param event ImageModalEvent event payload\n */\n emitHasData(event: ImageModalEvent): void {\n this.hasData.next(event);\n }\n\n /**\n * Method to emit buttonBeforeHook event.\n * @param event ImageModalEvent event payload\n */\n emitButtonBeforeHook(event: ButtonEvent): void {\n this.buttonBeforeHook.next(event);\n }\n\n /**\n * Method to emit buttonAfterHook event.\n * @param event ImageModalEvent event payload\n */\n emitButtonAfterHook(event: ButtonEvent): void {\n this.buttonAfterHook.next(event);\n }\n}\n","import { EventEmitter, inject, Injectable } from '@angular/core';\nimport { GlobalPositionStrategy, Overlay, OverlayConfig, OverlayRef } from '@angular/cdk/overlay';\nimport { Subject } from 'rxjs';\n\nimport { ModalGalleryRef } from './modal-gallery-ref';\nimport { Image, ImageModalEvent } from '../../model/image.class';\nimport { ConfigService } from '../../services/config.service';\nimport { ButtonEvent } from '../../model/buttons-config.interface';\nimport { ModalGalleryConfig } from '../../model/modal-gallery-config.interface';\nimport { LibConfig } from '../../model/lib-config.interface';\n\n// private interface used only in this file\ninterface ModalDialogConfig {\n panelClass: string;\n hasBackdrop: boolean;\n backdropClass: string;\n}\n\n/**\n * Payload to be emitted via {@link triggerAttachToOverlay} to enable {@link AttachToOverlayService}\n * to attach the {@link ModalGalleryComponent} to the overlay\n */\nexport interface AttachToOverlayPayload {\n /**\n * Overlay object created using Angular CDK APIs\n */\n overlayRef: OverlayRef;\n /**\n * Dialog data to be injected into the {@link ModalGalleryComponent}\n * contains: id, array of images, current image and optionally the configuration object\n */\n config: ModalGalleryConfig;\n /**\n * Object to control the dialog instance\n */\n dialogRef: ModalGalleryRef;\n}\n\nconst DEFAULT_DIALOG_CONFIG: ModalDialogConfig = {\n hasBackdrop: true,\n backdropClass: 'ks-modal-gallery-backdrop',\n panelClass: 'ks-modal-gallery-panel'\n};\n\n@Injectable({providedIn: 'root'})\nexport class ModalGalleryService {\n private updateImages = new Subject<Image[]>();\n updateImages$ = this.updateImages.asObservable();\n\n private dialogRef: ModalGalleryRef | undefined;\n\n public triggerAttachToOverlay = new EventEmitter<AttachToOverlayPayload>();\n\n private overlay: Overlay = inject(Overlay);\n private configService: ConfigService = inject(ConfigService);\n\n /**\n * Method to open modal gallery passing the configuration\n * @param config ModalGalleryConfig that contains: id, array of images, current image and optionally the configuration object\n * @return ModalGalleryRef | undefined is the object used to listen for events.\n */\n open(config: ModalGalleryConfig): ModalGalleryRef | undefined {\n // Returns an OverlayRef which is a PortalHost\n const overlayRef: OverlayRef = this.createOverlay();\n // Instantiate a reference to the dialog\n this.dialogRef = new ModalGalleryRef(overlayRef);\n // Attach dialog container\n this.triggerAttachToOverlay.emit({\n overlayRef,\n config,\n dialogRef: this.dialogRef\n });\n overlayRef.backdropClick().subscribe(() => {\n if (this.dialogRef) {\n this.dialogRef.closeModal();\n }\n });\n return this.dialogRef;\n }\n\n /**\n * Method to close a modal gallery previously opened.\n * @param id Unique identifier of the modal gallery\n * @param clickOutside boolean is true if closed clicking on the modal backdrop, false otherwise.\n */\n close(id: number, clickOutside: boolean): void {\n const libConfig: LibConfig | undefined = this.configService.getConfig(id);\n if (clickOutside) {\n if (this.dialogRef && libConfig && libConfig.enableCloseOutside) {\n this.dialogRef.closeModal();\n }\n } else {\n if (this.dialogRef) {\n this.dialogRef.closeModal();\n }\n }\n }\n\n /**\n * Method to update images array.\n * @param images Image[] updated array of images\n */\n updateModalImages(images: Image[]): void {\n this.updateImages.next(images);\n }\n\n /**\n * Method to emit close event.\n * @param event ImageModalEvent is the event payload\n */\n emitClose(event: ImageModalEvent): void {\n if (!this.dialogRef) {\n return;\n }\n this.dialogRef.emitClose(event);\n }\n\n /**\n * Method to emit show event.\n * @param event ImageModalEvent is the event payload\n */\n emitShow(event: ImageModalEvent): void {\n if (!this.dialogRef) {\n return;\n }\n this.dialogRef.emitShow(event);\n }\n\n /**\n * Method to emit firstImage event.\n * @param event ImageModalEvent is the event payload\n */\n emitFirstImage(event: ImageModalEvent): void {\n if (!this.dialogRef) {\n return;\n }\n this.dialogRef.emitFirstImage(event);\n }\n\n /**\n * Method to emit lastImage event.\n * @param event ImageModalEvent is the event payload\n */\n emitLastImage(event: ImageModalEvent): void {\n if (!this.dialogRef) {\n return;\n }\n this.dialogRef.emitLastImage(event);\n }\n\n /**\n * Method to emit hasData event.\n * @param event ImageModalEvent is the event payload\n */\n emitHasData(event: ImageModalEvent): void {\n if (!this.dialogRef) {\n return;\n }\n this.dialogRef.emitHasData(event);\n }\n\n /**\n * Method to emit buttonBeforeHook event.\n * @param event ButtonEvent is the event payload\n */\n emitButtonBeforeHook(event: ButtonEvent): void {\n if (!this.dialogRef) {\n return;\n }\n this.dialogRef.emitButtonBeforeHook(event);\n }\n\n /**\n * Method to emit buttonAfterHook event.\n * @param event ButtonEvent is the event payload\n */\n emitButtonAfterHook(event: ButtonEvent): void {\n if (!this.dialogRef) {\n return;\n }\n this.dialogRef.emitButtonAfterHook(event);\n }\n\n /**\n * Private method to create an Overlay using Angular CDK APIs\n * @private\n */\n private createOverlay(): OverlayRef {\n const overlayConfig = this.getOverlayConfig();\n return this.overlay.create(overlayConfig);\n }\n\n /**\n * Private method to create an OverlayConfig instance\n * @private\n */\n private getOverlayConfig(): OverlayConfig {\n const positionStrategy: GlobalPositionStrategy = this.overlay.position().global().centerHorizontally().centerVertically();\n return new OverlayConfig({\n hasBackdrop: DEFAULT_DIALOG_CONFIG.hasBackdrop,\n backdropClass: DEFAULT_DIALOG_CONFIG.backdropClass,\n panelClass: DEFAULT_DIALOG_CONFIG.panelClass,\n scrollStrategy: this.overlay.scrollStrategies.block(),\n positionStrategy\n });\n }\n}\n","/*\n The MIT License (MIT)\n\n Copyright (c) 2017-2026 Stefano Cappa (Ks89)\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\n\nimport { Directive, HostListener, output, input } from '@angular/core';\n\n/**\n * Directive to close the modal gallery clicking on the semi-transparent background.\n * In fact, it listens for a click on all elements that aren't 'inside' and it emits\n * an event using `@Output clickOutside`.\n */\n@Directive({ selector: '[ksClickOutside]' })\nexport class ClickOutsideDirective {\n /**\n * Boolean to enable this directive.\n */\n clickOutsideEnable = input<boolean>();\n /**\n * Output to emit an event if the clicked element class doesn't contain 'inside' or it is 'hidden'. The payload is a boolean.\n */\n readonly clickOutside = output<boolean>();\n\n /**\n * Method called by Angular itself every click thanks to `@HostListener`.\n * @param event MouseEvent\n */\n @HostListener('click', ['$event'])\n onClick(event: MouseEvent): void {\n event.stopPropagation();\n\n // tslint:disable-next-line:no-any\n const target: any = event.target;\n\n if (!this.clickOutsideEnable() || !target) {\n return;\n }\n\n let isInside = false;\n let isHidden = false;\n\n if (typeof target.className !== 'string') {\n // it happens with @fortawesome/fontawesome 5\n // for some reason className is an object with 2 empty properties inside\n isInside = true;\n } else {\n // in normal scenarios, use classname, because it's a simple string\n isInside = target.className && target.className.includes('inside');\n isHidden = target.className.includes('hidden');\n }\n\n // if inside => don't close modal gallery\n // if hidden => close modal gallery\n /*\n i i' h | close\n 0 1 0 | 1 => close modal gallery\n 0 1 1 | 1 => close modal gallery\n 1 0 0 | 0\n 1 0 1 | 1 => close modal gallery\n */\n if (!isInside || isHidden) {\n // close modal gallery\n this.clickOutside.emit(true);\n }\n }\n}\n","import {\n ChangeDetectionStrategy, ChangeDetectorRef, Component,\n HostListener, OnDestroy, OnInit, PLATFORM_ID, SecurityContext, TemplateRef, inject,\n viewChild\n} from '@angular/core';\nimport { isPlatformBrowser } from '@angular/common';\nimport { DomSanitizer } from '@angular/platform-browser';\n\nimport { Subscription } from 'rxjs';\n\nimport { DIALOG_DATA } from './modal-gallery.tokens';\nimport { Image, ImageModalEvent } from '../../model/image.class';\nimport { ConfigService } from '../../services/config.service';\nimport { DotsConfig } from '../../model/dots-config.interface';\nimport { ButtonConfig, ButtonEvent, ButtonsConfig, ButtonType } from '../../model/buttons-config.interface';\nimport { InternalLibImage } from '../../model/image-internal.class';\nimport { Action } from '../../model/action.enum';\nimport { CurrentImageComponent, ImageLoadEvent } from '../current-image/current-image.component';\nimport { IdValidatorService } from '../../services/id-validator.service';\nimport { KeyboardConfig } from '../../model/keyboard-config.interface';\nimport { PreviewConfig } from '../../model/preview-config.interface';\nimport { SlideConfig } from '../../model/slide-config.interface';\nimport { AccessibilityConfig } from '../../model/accessibility.interface';\nimport { PlainGalleryConfig } from '../../model/plain-gallery-config.interface';\nimport { KS_DEFAULT_ACCESSIBILITY_CONFIG } from '../accessibility-default';\nimport { CurrentImageConfig } from '../../model/current-image-config.interface';\nimport { ModalGalleryService } from './modal-gallery.service';\nimport { LibConfig } from '../../model/lib-config.interface';\nimport { ModalGalleryConfig } from '../../model/modal-gallery-config.interface';\nimport { ClickOutsideDirective } from '../../directives/click-outside.directive';\nimport { UpperButtonsComponent } from '../upper-buttons/upper-buttons.component';\nimport { DotsComponent } from '../dots/dots.component';\nimport { PreviewsComponent } from '../previews/previews.component';\n\n@Component({\n selector: 'ks-modal-gallery',\n templateUrl: './modal-gallery.component.html',\n styleUrls: ['./modal-gallery.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [ClickOutsideDirective, UpperButtonsComponent, CurrentImageComponent, DotsComponent, PreviewsComponent]\n})\nexport class ModalGalleryComponent implements OnInit, OnDestroy {\n /**\n * Reference to the CurrentImageComponent to invoke methods on it.\n */\n readonly currentImageComponent = viewChild(CurrentImageComponent);\n\n /**\n * Unique id (>=0) of the current instance of this library. This is useful when you are using\n * the service to call modal gallery without open it manually.\n */\n id: number;\n /**\n * Object of type `ButtonsConfig` to show/hide buttons.\n */\n buttonsConfig!: ButtonsConfig;\n /**\n * Boolean to enable modal-gallery close behaviour when clicking\n * on the semi-transparent background. Enabled by default.\n */\n enableCloseOutside = true;\n /**\n * Object of type `DotsConfig` to init DotsComponent's features.\n * For instance, it contains a param to show/hide dots.\n */\n dotsConfig!: DotsConfig;\n /**\n * Object of type `PreviewConfig` to init PreviewsComponent's features.\n * For instance, it contains a param to show/hide previews.\n */\n previewConfig: PreviewConfig | undefined;\n /**\n * Object of type `SlideConfig` to init side previews and `infinite sliding`.\n */\n slideConfig: SlideConfig | undefined;\n /**\n * Object of type `AccessibilityConfig` to init custom accessibility features.\n * For instance, it contains titles, alt texts, aria-labels and so on.\n */\n accessibilityConfig: AccessibilityConfig = KS_DEFAULT_ACCESSIBILITY_CONFIG;\n /**\n * Object of type `KeyboardConfig` to assign custom keys to ESC, RIGHT and LEFT keyboard's actions.\n */\n keyboardConfig: KeyboardConfig | undefined;\n /**\n * Object of type `PlainGalleryConfig` to configure the plain gallery.\n */\n plainGalleryConfig: PlainGalleryConfig | undefined;\n /**\n * Array of `InternalLibImage` representing the model of this library with all images, thumbs and so on.\n */\n images: InternalLibImage[];\n\n /**\n * Optional template reference to use to render previews.\n */\n customPreviewsTemplate?: TemplateRef<HTMLElement>;\n\n /**\n * `Image` that is visible right now.\n */\n currentImage: InternalLibImage;\n /**\n * Boolean to open the modal gallery. False by default.\n */\n showGallery = false;\n /**\n * Object to configure this component.\n */\n libConfig: LibConfig | undefined;\n\n private readonly updateImagesSubscription: Subscription | undefined;\n\n private readonly dialogContent: ModalGalleryConfig = inject(DIALOG_DATA);\n private readonly platformId: Object = inject(PLATFORM_ID);\n\n /**\n * HostListener to catch the browser back button and destroy the gallery.\n * This prevents unexpected behavior about scrolling.\n * Added to fix this issue: https://github.com/Ks89/angular-modal-gallery/issues/159\n */\n @HostListener('window:popstate')\n onPopState(): void {\n this.closeGallery();\n }\n\n /**\n * HostListener to catch ctrl+s/meta+s and download the current image.\n * Inspired by https://netbasal.com/add-keyboard-shortcuts-to-your-angular-app-9bf2e89862b3\n */\n @HostListener('document:keydown.code.control.keyS', ['$event']) // windows\n @HostListener('document:keydown.code.meta.keyS', ['$event']) // macOS\n onSaveListener(event: Event): void {\n event.preventDefault();\n this.downloadImage();\n }\n\n private modalGalleryService: ModalGalleryService = inject(ModalGalleryService);\n private changeDetectorRef: ChangeDetectorRef = inject(ChangeDetectorRef);\n private idValidatorService: IdValidatorService = inject(IdValidatorService);\n private sanitizer: DomSanitizer = inject(DomSanitizer);\n private configService: ConfigService = inject(ConfigService);\n\n constructor() {\n this.id = (this.dialogContent as ModalGalleryConfig).id;\n this.images = (this.dialogContent as ModalGalleryConfig).images as InternalLibImage[];\n this.currentImage = (this.dialogContent as ModalGalleryConfig).currentImage as InternalLibImage;\n this.libConfig = (this.dialogContent as ModalGalleryConfig).libConfig;\n this.customPreviewsTemplate = (this.dialogContent as ModalGalleryConfig).previewsTemplate;\n this.configService.setConfig(this.id, this.libConfig);\n\n this.updateImagesSubscription = this.modalGalleryService.updateImages$.subscribe((images: Image[]) => {\n this.images = images.map((image: Image) => {\n const newImage: InternalLibImage = Object.assign({}, image, { previouslyLoaded: false });\n return newImage;\n });\n this.initImages();\n this.images.forEach((image: InternalLibImage) => {\n if (image.id === this.currentImage.id) {\n this.currentImage = image;\n }\n });\n this.changeDetectorRef.markForCheck();\n });\n }\n\n /**\n * Method ´ngOnInit´ to init images calling `initImages()`.\n * This is an angular lifecycle hook, so its called automatically by Angular itself.\n * In particular, it's called only one time!!!\n */\n ngOnInit(): void {\n this.idValidatorService.checkAndAdd(this.id);\n\n // id is a mandatory input and must a number > 0\n if ((!this.id && this.id !== 0) || this.id < 0) {\n throw new Error(\n `'[id]=\"a number >= 0\"' is a mandatory input in angular-modal-gallery.` +\n `If you are using multiple instances of this library, please be sure to use different ids`\n );\n }\n\n const libConfig: LibConfig | undefined = this.configService.getConfig(this.id);\n if (!libConfig || !libConfig.dotsConfig) {\n throw new Error('Internal library error - libConfig and dotsConfig must be defined');\n }\n this.dotsConfig = libConfig.dotsConfig;\n this.buttonsConfig = libConfig.buttonsConfig!;\n\n setTimeout(() => {\n this.initImages();\n }, 0);\n }\n\n /**\n * Method called by custom upper buttons.\n * @param event ButtonEvent event payload\n */\n onCustomEmit(event: ButtonEvent): void {\n const eventToEmit: ButtonEvent = this.getButtonEventToEmit(event);\n this.modalGalleryService.emitButtonBeforeHook(eventToEmit);\n this.modalGalleryService.emitButtonAfterHook(eventToEmit);\n }\n\n /**\n * Method called by the full-screen upper button.\n * @param event ButtonEvent event payload\n */\n onFullScreen(event: ButtonEvent): void {\n const eventToEmit: ButtonEvent = this.getButtonEventToEmit(event);\n this.modalGalleryService.emitButtonBeforeHook(eventToEmit);\n\n // tslint:disable-next-line:no-any\n const doc: any = document as any;\n // tslint:disable-next-line:no-any\n const docEl: any = document.documentElement as any;\n\n const fullscreenDisabled: boolean = !doc.fullscreenElement && !doc.webkitFullscreenElement;\n\n // In Safari `requestFullscreen` and `exitFullscreen` are undefined. Safari requires the prefixed version `webkit-`\n // and it doesn't return promises.\n\n // I cannot call `emitButtonAfterHook` only if requestFullScreen is successful, because there are no guarantees across browsers and\n // I should also handle the case with keyboard \"esc\" button.\n\n if (fullscreenDisabled) {\n if (docEl.requestFullscreen) {\n docEl\n .requestFullscreen()\n .then(() => {})\n .catch(() => {\n console.error('Cannot request full screen');\n });\n } else if (docEl.webkitRequestFullscreen) {\n // For Safari and it doesn't return a promise\n docEl.webkitRequestFullscreen();\n }\n } else {\n if (doc.exitFullscreen) {\n doc\n .exitFullscreen()\n .then(() => {})\n .catch(() => {\n console.error('Cannot request exit full screen');\n });\n } else if (doc.webkitExitFullscreen) {\n // For Safari and it doesn't return a promise\n doc.webkitExitFullscreen();\n }\n }\n\n this.modalGalleryService.emitButtonAfterHook(eventToEmit);\n }\n\n /**\n * Method called by the delete upper button.\n * @param event ButtonEvent event payload\n */\n onDelete(event: ButtonEvent): void {\n const eventToEmit: ButtonEvent = this.getButtonEventToEmit(event);\n this.modalGalleryService.emitButtonBeforeHook(eventToEmit);\n\n if (this.images.length === 1) {\n this.closeGallery();\n }\n\n const currentImageComponent = this.currentImageComponent();\n if (!currentImageComponent) {\n throw new Error('currentImageComponent must be defined');\n }\n\n const imageIndexToDelete: number = currentImageComponent.getIndexToDelete(event.image as InternalLibImage);\n if (imageIndexToDelete === this.images.length - 1) {\n // last image\n currentImageComponent.prevImage();\n } else {\n currentImageComponent.nextImage();\n }\n\n this.modalGalleryService.emitButtonAfterHook(eventToEmit);\n }\n\n /**\n * Method called by the navigate upper button.\n * @param event ButtonEvent event payload\n */\n onNavigate(event: ButtonEvent): void {\n const eventToEmit: ButtonEvent = this.getButtonEventToEmit(event);\n this.modalGalleryService.emitButtonBeforeHook(eventToEmit);\n // To support SSR\n if (isPlatformBrowser(this.platformId)) {\n if (eventToEmit.image && eventToEmit.image.modal.extUrl) {\n // where I should open this link? The current tab or another one?\n if (eventToEmit.button && eventToEmit.button.extUrlInNewTab) {\n // in this case I should use target _blank to open the url in a new tab, however these is a security issue.\n // Prevent Reverse Tabnabbing's attacks (https://www.owasp.org/index.php/Reverse_Tabnabbing)\n // Some resources:\n // - https://www.owasp.org/index.php/HTML5_Security_Cheat_Sheet#Tabnabbing\n // - https://medium.com/@jitbit/target-blank-the-most-underestimated-vulnerability-ever-96e328301f4c\n // - https://developer.mozilla.org/en-US/docs/Web/API/Window/open\n const newWindow: Window | null = window.open(eventToEmit.image.modal.extUrl, 'noopener,noreferrer,');\n // it returns null if the call failed, so I have to do this check\n if (newWindow) {\n newWindow.opener = null; // required to prevent security issues\n // emit only in case of success\n this.modalGalleryService.emitButtonAfterHook(eventToEmit);\n }\n } else {\n this.updateLocationHref(eventToEmit.image.modal.extUrl);\n // emit only in case of success\n this.modalGalleryService.emitButtonAfterHook(eventToEmit);\n }\n }\n }\n }\n\n /**\n * This method is defined to be spied and replaced in unit testing with a fake method call.\n * It must be public to be able to use jasmine spyOn method.\n * @param newHref string new url\n */\n updateLocationHref(newHref: string) {\n window.location.href = newHref;\n }\n\n /**\n * Method called by the download upper button.\n * @param event ButtonEvent event payload\n */\n onDownload(event: ButtonEvent): void {\n const eventToEmit: ButtonEvent = this.getButtonEventToEmit(event);\n this.modalGalleryService.emitButtonBeforeHook(eventToEmit);\n this.downloadImage();\n this.modalGalleryService.emitButtonAfterHook(eventToEmit);\n }\n\n /**\n * Method called by the close upper button.\n * @param event ButtonEvent event payload\n * @param action Action that triggered the close method. `Action.NORMAL` by default\n */\n onCloseGalleryButton(event: ButtonEvent, action: Action = Action.NORMAL): void {\n const eventToEmit: ButtonEvent = this.getButtonEventToEmit(event);\n this.modalGalleryService.emitButtonBeforeHook(eventToEmit);\n this.closeGallery(action, false);\n }\n\n /**\n * Method called by CurrentImageComponent.\n * @param event ImageModalEvent event payload\n * @param action Action that triggered the close method. `Action.NORMAL` by default\n */\n onCloseGallery(event: ImageModalEvent, action: Action = Action.NORMAL): void {\n // remap ImageModalEvent to ButtonEvent\n const buttonEvent: ButtonEvent = {\n button: {\n type: ButtonType.CLOSE\n } as ButtonConfig,\n image: null,\n action: event.action,\n galleryId: event.galleryId\n };\n this.modalGalleryService.emitButtonBeforeHook(buttonEvent);\n this.closeGallery(action, false);\n }\n\n /**\n * Method to close the modal gallery specifying the action.\n * @param action Action action type. `Action.NORMAL` by default\n * @param clickOutside boolean that is true if called clicking on the modal background. False by default.\n */\n closeGallery(action: Action = Action.NORMAL, clickOutside: boolean = false): void {\n const libConfig: LibConfig | undefined = this.configService.getConfig(this.id);\n if (!libConfig) {\n throw new Error('Internal library error - libConfig must be defined');\n }\n\n this.modalGalleryService.emitClose(new ImageModalEvent(this.id, action, true));\n this.modalGalleryService.close(this.id, clickOutside);\n }\n\n /**\n * Method called when the image changes and used to update the `currentImage` object.\n * @param event ImageModalEvent event payload\n */\n onChangeCurrentImage(event: ImageModalEvent): void {\n const newIndex: number = event.result as number;\n if (newIndex < 0 || newIndex >= this.images.length) {\n return;\n }\n\n this.currentImage = this.images[newIndex];\n\n // emit current visible image index\n this.modalGalleryService.emitShow(new ImageModalEvent(this.id, event.action, newIndex + 1));\n\n // emit first/last event based on newIndex value\n this.emitBoundaryEvent(event.action, newIndex);\n }\n\n /**\n * Method called when you click 'outside' (i.e. on the semi-transparent background)\n * to close the modal gallery if `enableCloseOutside` is true.\n * @param event boolean that is true to close the modal gallery, false otherwise\n */\n onClickOutside(event: boolean): void {\n if (event && this.enableCloseOutside) {\n this.closeGallery(Action.CLICK, true);\n }\n }\n\n /**\n * Method called when an image is loaded and the loading spinner has gone.\n * It sets the previouslyLoaded flag inside the Image to hide loading spinner when displayed again.\n * @param event ImageLoadEvent event payload\n */\n onImageLoad(event: ImageLoadEvent): void {\n // sets as previously loaded the image with index specified by `event.status`\n this.images = this.images.map((img: InternalLibImage) => {\n if (img && img.id === event.id) {\n return Object.assign({}, img, { previouslyLoaded: event.status });\n }\n return img;\n });\n }\n\n /**\n * Method called when a dot is clicked and used to update the current image.\n * @param index number index of the clicked dot\n */\n onClickDot(index: number): void {\n this.currentImage = this.images[index];\n }\n\n /**\n * Method called when an image preview is clicked and used to update the current image.\n * @param event ImageModalEvent preview image\n */\n onClickPreview(event: ImageModalEvent): void {\n this.onChangeCurrentImage(event);\n }\n\n /**\n * Method to cleanup resources.\n * This is an angular lifecycle hook that is called when this component is destroyed.\n */\n ngOnDestroy(): void {\n if (this.updateImagesSubscription) {\n this.updateImagesSubscription.unsubscribe();\n }\n this.idValidatorService.remove(this.id);\n }\n\n /**\n * Method to download the current image, only if `downloadable` is true.\n * @private\n */\n private downloadImage(): void {\n if (this.id === null || this.id === undefined) {\n throw new Error('Internal library error - id must be defined');\n }\n const libConfig: LibConfig | undefined = this.configService.getConfig(this.id);\n if (!libConfig) {\n throw new Error('Internal library error - libConfig must be defined');\n }\n\n const currentImageConfig: CurrentImageConfig | undefined = libConfig.currentImageConfig;\n if (currentImageConfig && !currentImageConfig.downloadable) {\n return;\n }\n this.downloadImageAllBrowsers();\n }\n\n /**\n * Method to convert a base64 to a Blob.\n * This should be upgraded with Uint8Array.fromBase64() from ES2025,\n * but first we need to upgrade `tsconfig` config.\n * @param base64Data string with base64 data\n * @param contentType string with the MIME type\n * @return Blob converted from the input base64Data\n * @private\n */\n private base64toBlob(base64Data: string, contentType: string = ''): Blob {\n const sliceSize = 1024;\n const byteCharacters: string = atob(base64Data);\n const bytesLength: number = byteCharacters.length;\n const slicesCount: number = Math.ceil(bytesLength / sliceSize);\n const byteArrays: Array<Uint8Array> = new Array(slicesCount);\n for (let sliceIndex = 0; sliceIndex < slicesCount; ++sliceIndex) {\n const begin: number = sliceIndex * sliceSize;\n const end: number = Math.min(begin + sliceSize, bytesLength);\n const bytes: Array<number> = new Array(end - begin);\n for (let offset = begin, i = 0; offset < end; ++i, ++offset) {\n bytes[i] = byteCharacters[offset].charCodeAt(0);\n }\n byteArrays[sliceIndex] = new Uint8Array(bytes);\n }\n return new Blob(byteArrays as BlobPart[], { type: contentType });\n }\n\n /**\n * Private method to download the current image for all browsers.\n * @private\n */\n private downloadImageAllBrowsers(): void {\n const link = document.createElement('a');\n let isBase64 = false;\n let img: string;\n // convert a SafeResourceUrl to a string\n if (typeof this.currentImage.modal.img === 'string') {\n img = this.currentImage.modal.img as string;\n } else {\n // if it's a SafeResourceUrl\n img = this.sanitizer.sanitize(SecurityContext.RESOURCE_URL, this.currentImage.modal.img) as string;\n }\n if (img.includes('data:image/') || img.includes(';base64,')) {\n const extension: string = img.replace('data:image/', '').split(';base64,')[0];\n const pureBase64: string = img.split(';base64,')[1];\n const blob: Blob = this.base64toBlob(pureBase64, 'image/' + extension);\n link.href = URL.createObjectURL(blob);\n isBase64 = true;\n link.setAttribute('download', this.getFileName(this.currentImage, isBase64, extension));\n } else {\n link.href = img;\n link.setAttribute('download', this.getFileName(this.currentImage, isBase64));\n }\n document.body.appendChild(link);\n link.click();\n document.body.removeChild(link);\n }\n\n /**\n * Private method to get the `ButtonEvent` to emit, merging the input `ButtonEvent`\n * with the current image.\n * @param event ButtonEvent event payload to return\n * @returns ButtonEvent event payload with the current image included\n * @private\n */\n private getButtonEventToEmit(event: ButtonEvent): ButtonEvent {\n return Object.assign(event, { image: this.currentImage });\n }\n\n /**\n * Private method to get the file name from an input path.\n * This is used either to get the image's name from its path or from the Image itself,\n * if specified as 'downloadFileName' by the user.\n * @param image Image image to extract its file name\n * @param isBase64 boolean to set if the image is a base64 file or not. False by default.\n * @param base64Extension string to force the extension of the base64 image. Empty string by default.\n * @returns string string file name of the input image.\n * @private\n */\n private getFileName(image: Image, isBase64: boolean = false, base64Extension: string = ''): string {\n if (!image.modal.downloadFileName || image.modal.downloadFileName.length === 0) {\n if (isBase64) {\n return `Image-${image.id}.${base64Extension !== '' ? base64Extension : 'png'}`;\n } else {\n return (image.modal.img as string).replace(/^.*[\\\\\\/]/, '');\n }\n } else {\n return image.modal.downloadFileName;\n }\n }\n\n /**\n * Private method to initialize `images` as array of `Image`s.\n * Also, it will emit ImageModalEvent to say that images are loaded.\n * @private\n */\n private initImages(): void {\n this.modalGalleryService.emitHasData(new ImageModalEvent(this.id, Action.LOAD, true));\n\n const currentIndex: number = this.images.indexOf(this.currentImage);\n // emit a new ImageModalEvent with the index of the current image\n this.modalGalleryService.emitShow(new ImageModalEvent(this.id, Action.LOAD, currentIndex + 1));\n\n // emit first/last event based on newIndex value\n this.emitBoundaryEvent(Action.NORMAL, currentIndex);\n\n this.showGallery = this.images.length > 0;\n }\n\n /**\n * Private method to emit events when either the last or the first image are visible.\n * @param action Action Enum of type Action that represents the source of the event that changed the\n * current image to the first one or the last one.\n * @param indexToCheck number is the index number of the image (the first or the last one).\n * @private\n */\n private emitBoundaryEvent(action: Action, indexToCheck: number): void {\n // to emit first/last event\n switch (indexToCheck) {\n case 0:\n this.modalGalleryService.emitFirstImage(new ImageModalEvent(this.id, action, true));\n break;\n case this.images.length - 1:\n this.modalGalleryService.emitLastImage(new ImageModalEvent(this.id, action, true));\n break;\n }\n }\n}\n","<div id=\"modal-gallery-wrapper\"\n [attr.aria-label]=\"accessibilityConfig.modalGalleryContentAriaLabel\"\n [title]=\"accessibilityConfig.modalGalleryContentTitle\"\n ksClickOutside [clickOutsideEnable]=\"enableCloseOutside\"\n (clickOutside)=\"onClickOutside($event)\">\n\n <div id=\"flex-min-height-ie-fix\">\n <div id=\"modal-gallery-container\">\n\n <ks-upper-buttons [id]=\"id\"\n [currentImage]=\"currentImage\"\n [buttonsConfig]=\"buttonsConfig\"\n (delete)=\"onDelete($event)\"\n (navigate)=\"onNavigate($event)\"\n (download)=\"onDownload($event)\"\n (closeButton)=\"onCloseGalleryButton($event)\"\n (fullscreen)=\"onFullScreen($event)\"\n (customEmit)=\"onCustomEmit($event)\" />\n\n <ks-current-image [id]=\"id\"\n [images]=\"images\"\n [currentImage]=\"currentImage\"\n [isOpen]=\"true\"\n (loadImage)=\"onImageLoad($event)\"\n (changeImage)=\"onChangeCurrentImage($event)\"\n (closeGallery)=\"onCloseGallery($event)\" />\n\n <div>\n <ks-dots [id]=\"id\"\n [images]=\"images\"\n [currentImage]=\"currentImage\"\n [dotsConfig]=\"dotsConfig\"\n [accessibilityConfig]=\"accessibilityConfig\"\n (clickDot)=\"onClickDot($event)\" />\n\n <ks-previews [id]=\"id\"\n [images]=\"images\"\n [currentImage]=\"currentImage\"\n [customTemplate]=\"customPreviewsTemplate\"\n (clickPreview)=\"onClickPreview($event)\" />\n </div>\n </div>\n </div>\n</div>\n","/*\n The MIT License (MIT)\n\n Copyright (c) 2017-2026 Stefano Cappa (Ks89)\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\n\nimport { CarouselComponent } from './carousel/carousel.component';\nimport { CarouselPreviewsComponent } from './carousel/carousel-previews/carousel-previews.component';\nimport { UpperButtonsComponent } from './upper-buttons/upper-buttons.component';\nimport { DotsComponent } from './dots/dots.component';\nimport { PreviewsComponent } from './previews/previews.component';\nimport { CurrentImageComponent } from './current-image/current-image.component';\nimport { LoadingSpinnerComponent } from './current-image/loading-spinner/loading-spinner.component';\nimport { AccessibleComponent } from './accessible.component';\nimport { PlainGalleryComponent } from './plain-gallery/plain-gallery.component';\nexport { CarouselComponent } from './carousel/carousel.component';\nimport { ModalGalleryComponent } from './modal-gallery/modal-gallery.component';\n\n/**\n * Array of all components.\n */\nexport const COMPONENTS = [\n PlainGalleryComponent,\n CarouselComponent,\n CarouselPreviewsComponent,\n UpperButtonsComponent,\n DotsComponent,\n PreviewsComponent,\n CurrentImageComponent,\n LoadingSpinnerComponent,\n AccessibleComponent,\n\n ModalGalleryComponent\n];\n","/*\n The MIT License (MIT)\n\n Copyright (c) 2017-2026 Stefano Cappa (Ks89)\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\n\nimport { Directive, ElementRef, inject, OnChanges, OnInit, Renderer2, input } from '@angular/core';\n\n/**\n * Directive to change margins of an element.\n */\n@Directive({ selector: '[ksMargin]' })\nexport class MarginDirective implements OnInit, OnChanges {\n /**\n * String to set the margin of an element.\n */\n readonly marginLeft = input<string>();\n /**\n * String to set the margin of an element.\n */\n readonly marginRight = input<string>();\n /**\n * String to set the margin of an element.\n */\n readonly marginTop = input<string>();\n /**\n * String to set the margin of an element.\n */\n readonly marginBottom = input<string>();\n\n private renderer: Renderer2 = inject(Renderer2);\n private el: ElementRef = inject(ElementRef);\n\n /**\n * Method ´ngOnInit´ to apply the style of this directive.\n * This is an angular lifecycle hook, so its called automatically by Angular itself.\n * In particular, it's called only one time!!!\n */\n ngOnInit(): void {\n this.applyStyle();\n }\n\n /**\n * Method ´ngOnChanges´ to apply the style of this directive.\n * This is an angular lifecycle hook, so its called automatically by Angular itself.\n * In particular, it's called when any data-bound property of a directive changes!!!\n */\n ngOnChanges(): void {\n this.applyStyle();\n }\n\n /**\n * Private method to change both width and height of an element.\n */\n private applyStyle(): void {\n const marginLeft = this.marginLeft();\n if (marginLeft) {\n this.renderer.setStyle(this.el.nativeElement, 'margin-left', marginLeft);\n }\n const marginRight = this.marginRight();\n if (marginRight) {\n this.renderer.setStyle(this.el.nativeElement, 'margin-right', marginRight);\n }\n const marginTop = this.marginTop();\n if (marginTop) {\n this.renderer.setStyle(this.el.nativeElement, 'margin-top', marginTop);\n }\n const marginBottom = this.marginBottom();\n if (marginBottom) {\n this.renderer.setStyle(this.el.nativeElement, 'margin-bottom', marginBottom);\n }\n }\n}\n","/*\n The MIT License (MIT)\n\n Copyright (c) 2017-2026 Stefano Cappa (Ks89)\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\n\nimport { ClickOutsideDirective } from './click-outside.directive';\nimport { SizeDirective } from './size.directive';\nimport { KeyboardNavigationDirective } from './keyboard-navigation.directive';\nimport { WrapDirective } from './wrap.directive';\nimport { DirectionDirective } from './direction.directive';\nimport { ATagBgImageDirective } from './a-tag-bg-image.directive';\nimport { DescriptionDirective } from './description.directive';\nimport { MarginDirective } from './margin.directive';\nimport { MaxSizeDirective } from './max-size.directive';\nimport { FallbackImageDirective } from './fallback-image.directive';\nimport { SwipeDirective } from './swipe.directive';\n\n/**\n * Array of all directives.\n */\nexport const DIRECTIVES = [\n ClickOutsideDirective,\n SizeDirective,\n KeyboardNavigationDirective,\n WrapDirective,\n DirectionDirective,\n ATagBgImageDirective,\n DescriptionDirective,\n MarginDirective,\n MaxSizeDirective,\n FallbackImageDirective,\n SwipeDirective\n];\n","import { inject, Injectable, Injector } from '@angular/core';\n\nimport { ComponentPortal } from '@angular/cdk/portal';\n\nimport { ModalGalleryRef } from './modal-gallery-ref';\nimport { ModalGalleryComponent } from './modal-gallery.component';\nimport { DIALOG_DATA } from './modal-gallery.tokens';\nimport { AttachToOverlayPayload, ModalGalleryService } from './modal-gallery.service';\n\n@Injectable({ providedIn: 'root' })\nexport class AttachToOverlayService {\n private injector: Injector = inject(Injector);\n private modalGalleryService: ModalGalleryService = inject(ModalGalleryService);\n\n /**\n * To be called by a provider with the APP_INITIALIZER token.\n */\n public initialize(): void {\n this.modalGalleryService.triggerAttachToOverlay.subscribe(payload => this.attachToOverlay(payload));\n }\n\n /**\n * Private method to attach ModalGalleryComponent to the overlay.\n * @param payload {@link AttachToOverlayPayload} with all necessary information\n * @private\n */\n private attachToOverlay(payload: AttachToOverlayPayload): void {\n const injector: Injector = Injector.create({\n parent: this.injector,\n providers: [\n { provide: ModalGalleryRef, useValue: payload.dialogRef },\n { provide: DIALOG_DATA, useValue: payload.config }\n ]\n });\n\n const containerPortal = new ComponentPortal(ModalGalleryComponent, null, injector);\n payload.overlayRef.attach(containerPortal);\n }\n}\n","/*\n The MIT License (MIT)\n\n Copyright (c) 2017-2026 Stefano Cappa (Ks89)\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\n\nimport { inject, NgModule, provideAppInitializer } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { OverlayModule } from '@angular/cdk/overlay';\n\nimport { COMPONENTS, CarouselComponent } from './components/components';\nimport { PlainGalleryComponent } from './components/plain-gallery/plain-gallery.component';\nimport { DIRECTIVES } from './directives/directives';\nimport { AttachToOverlayService } from './components/modal-gallery/attach-to-overlay.service';\n\n/**\n * Module to import it in the root module of your application.\n */\n@NgModule({\n imports: [CommonModule, OverlayModule, COMPONENTS, DIRECTIVES],\n providers: [\n provideAppInitializer(() => {\n const service = inject(AttachToOverlayService);\n service.initialize();\n })\n ],\n exports: [PlainGalleryComponent, CarouselComponent]\n})\nexport class GalleryModule {\n}\n","/*\n The MIT License (MIT)\n\n Copyright (c) 2017-2026 Stefano Cappa (Ks89)\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\n\n/**\n * Index file to export all interfaces, enums, classes and so on.\n * This file represents the public apis.\n */\n\nexport { GalleryModule } from './lib/modal-gallery.module';\n\nexport { Action } from './lib/model/action.enum';\nexport { Image, ImageEvent, ImageModalEvent } from './lib/model/image.class';\nexport type { PlainImage, ModalImage } from './lib/model/image.class';\nexport { DescriptionStrategy } from './lib/model/description.interface';\nexport type { Description } from './lib/model/description.interface';\nexport type { KeyboardConfig } from './lib/model/keyboard-config.interface';\nexport type { DotsConfig } from './lib/model/dots-config.interface';\nexport type { PreviewConfig } from './lib/model/preview-config.interface';\nexport type { AccessibilityConfig } from './lib/model/accessibility.interface';\n\nexport type { BreakpointsConfig, CarouselPreviewConfig } from './lib/model/carousel-preview-config.interface';\nexport type { CarouselConfig } from './lib/model/carousel-config.interface';\nexport type { PlayConfig } from './lib/model/play-config.interface';\nexport type { CarouselImageConfig } from './lib/model/carousel-image-config.interface';\n\nexport type { Size } from './lib/model/size.interface';\n\nexport { ButtonsStrategy, ButtonType } from './lib/model/buttons-config.interface';\nexport type { ButtonsConfig, ButtonConfig, ButtonEvent } from './lib/model/buttons-config.interface';\n\nexport type { ModalLibConfig, PlainLibConfig, CarouselLibConfig } from './lib/model/lib-config.interface';\n\nexport type { ModalGalleryConfig } from './lib/model/modal-gallery-config.interface';\n\nexport type { CurrentImageConfig } from './lib/model/current-image-config.interface';\n\nexport { LoadingType } from './lib/model/loading-config.interface';\nexport type { LoadingConfig } from './lib/model/loading-config.interface';\n\nexport type { InteractionEvent } from './lib/model/interaction-event.interface';\n\nexport type { SidePreviewsConfig, SlideConfig } from './lib/model/slide-config.interface';\n\nexport { KS_DEFAULT_ACCESSIBILITY_CONFIG } from './lib/components/accessibility-default';\nexport {\n KS_DEFAULT_BTN_FULL_SCREEN,\n KS_DEFAULT_BTN_CLOSE,\n KS_DEFAULT_BTN_DELETE,\n KS_DEFAULT_BTN_DOWNLOAD,\n KS_DEFAULT_BTN_EXTURL,\n KS_DEFAULT_SIZE\n} from './lib/components/upper-buttons/upper-buttons-default';\n\nexport {\n LineLayout,\n GridLayout,\n PlainGalleryStrategy\n} from './lib/model/plain-gallery-config.interface';\nexport type {\n PlainGalleryConfig,\n PlainGalleryLayout, BreakConfig\n} from './lib/model/plain-gallery-config.interface';\n\nexport { ModalGalleryComponent } from './lib/components/modal-gallery/modal-gallery.component';\nexport { PlainGalleryComponent } from './lib/components/plain-gallery/plain-gallery.component';\nexport { CarouselComponent } from './lib/components/carousel/carousel.component';\n\nexport { ModalGalleryService } from './lib/components/modal-gallery/modal-gallery.service';\nexport { ModalGalleryRef } from './lib/components/modal-gallery/modal-gallery-ref';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.ConfigService","i1.PlainGalleryComponent","i2.CarouselComponent","i3.CarouselPreviewsComponent","i4.UpperButtonsComponent","i5.DotsComponent","i6.PreviewsComponent","i7.CurrentImageComponent","i8.LoadingSpinnerComponent","i9.AccessibleComponent","i10.ModalGalleryComponent","i11.ClickOutsideDirective","i12.SizeDirective","i13.KeyboardNavigationDirective","i14.WrapDirective","i15.DirectionDirective","i16.ATagBgImageDirective","i17.DescriptionDirective","i18.MarginDirective","i19.MaxSizeDirective","i20.FallbackImageDirective","i21.SwipeDirective"],"mappings":";;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;;;;AAsBG;AAEH;;AAEG;AACI,MAAM,SAAS,GAAW,OAAO;AACxC;;AAEG;AACI,MAAM,UAAU,GAAW,OAAO;AAEzC;;AAEG;AACI,MAAM,OAAO,GAAW,QAAQ;AACvC;;AAEG;AACI,MAAM,QAAQ,GAAW,QAAQ;AACxC;;AAEG;AACI,MAAM,eAAe,GAAW,YAAY;AACnD;;AAEG;AACI,MAAM,gBAAgB,GAAW,YAAY;AACpD;;AAEG;AACI,MAAM,cAAc,GAAW,WAAW;AACjD;;AAEG;AACI,MAAM,eAAe,GAAW,WAAW;AAClD;;AAEG;AACI,MAAM,YAAY,GAAW,SAAS;AAC7C;;AAEG;AACI,MAAM,aAAa,GAAW,SAAS;AAC9C;;AAEG;AACI,MAAM,cAAc,GAAW,WAAW;AACjD;;AAEG;AACI,MAAM,eAAe,GAAW,WAAW;AAClD;;AAEG;AACI,MAAM,SAAS,GAAW,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EAAE,CAAC,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,UAAU,CAAC;AAC9D,oBAAA,SAAS,EAAE;wBACT,qBAAqB,CAAC,MAAK;AACzB,4BAAA,MAAM,OAAO,GAAG,MAAM,CAAC,sBAAsB,CAAC;4BAC9C,OAAO,CAAC,UAAU,EAAE;AACtB,wBAAA,CAAC;AACF,qBAAA;AACD,oBAAA,OAAO,EAAE,CAAC,qBAAqB,EAAE,iBAAiB;AACnD,iBAAA;;;AC7CD;;;;;;;;;;;;;;;;;;;;;;AAsBG;AAEH;;;AAGG;;AC3BH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ks89-angular-modal-gallery.mjs","sources":["../../../../projects/ks89/angular-modal-gallery/src/lib/utils/user-input.util.ts","../../../../projects/ks89/angular-modal-gallery/src/lib/components/accessible.component.ts","../../../../projects/ks89/angular-modal-gallery/src/lib/model/image.class.ts","../../../../projects/ks89/angular-modal-gallery/src/lib/model/action.enum.ts","../../../../projects/ks89/angular-modal-gallery/src/lib/utils/image.util.ts","../../../../projects/ks89/angular-modal-gallery/src/lib/model/description.interface.ts","../../../../projects/ks89/angular-modal-gallery/src/lib/components/accessibility-default.ts","../../../../projects/ks89/angular-modal-gallery/src/lib/model/buttons-config.interface.ts","../../../../projects/ks89/angular-modal-gallery/src/lib/model/plain-gallery-config.interface.ts","../../../../projects/ks89/angular-modal-gallery/src/lib/model/loading-config.interface.ts","../../../../projects/ks89/angular-modal-gallery/src/lib/model/keyboard.enum.ts","../../../../projects/ks89/angular-modal-gallery/src/lib/services/config.service.ts","../../../../projects/ks89/angular-modal-gallery/src/lib/directives/max-size.directive.ts","../../../../projects/ks89/angular-modal-gallery/src/lib/directives/size.directive.ts","../../../../projects/ks89/angular-modal-gallery/src/lib/directives/fallback-image.directive.ts","../../../../projects/ks89/angular-modal-gallery/src/lib/directives/description.directive.ts","../../../../projects/ks89/angular-modal-gallery/src/lib/components/dots/dots.component.ts","../../../../projects/ks89/angular-modal-gallery/src/lib/components/dots/dots.html","../../../../projects/ks89/angular-modal-gallery/src/lib/components/carousel/carousel-previews/carousel-previews.component.ts","../../../../projects/ks89/angular-modal-gallery/src/lib/components/carousel/carousel-previews/carousel-previews.html","../../../../projects/ks89/angular-modal-gallery/src/lib/components/carousel/carousel.component.ts","../../../../projects/ks89/angular-modal-gallery/src/lib/components/carousel/carousel.html","../../../../projects/ks89/angular-modal-gallery/src/lib/components/upper-buttons/upper-buttons-default.ts","../../../../projects/ks89/angular-modal-gallery/src/lib/components/upper-buttons/upper-buttons.component.ts","../../../../projects/ks89/angular-modal-gallery/src/lib/components/upper-buttons/upper-buttons.html","../../../../projects/ks89/angular-modal-gallery/src/lib/components/previews/previews.component.ts","../../../../projects/ks89/angular-modal-gallery/src/lib/components/previews/previews.html","../../../../projects/ks89/angular-modal-gallery/src/lib/directives/keyboard-navigation.directive.ts","../../../../projects/ks89/angular-modal-gallery/src/lib/directives/swipe.directive.ts","../../../../projects/ks89/angular-modal-gallery/src/lib/components/current-image/loading-spinner/loading-spinner.component.ts","../../../../projects/ks89/angular-modal-gallery/src/lib/components/current-image/loading-spinner/loading-spinner.html","../../../../projects/ks89/angular-modal-gallery/src/lib/components/current-image/current-image.component.ts","../../../../projects/ks89/angular-modal-gallery/src/lib/components/current-image/current-image.html","../../../../projects/ks89/angular-modal-gallery/src/lib/directives/wrap.directive.ts","../../../../projects/ks89/angular-modal-gallery/src/lib/directives/direction.directive.ts","../../../../projects/ks89/angular-modal-gallery/src/lib/directives/a-tag-bg-image.directive.ts","../../../../projects/ks89/angular-modal-gallery/src/lib/components/plain-gallery/plain-gallery.component.ts","../../../../projects/ks89/angular-modal-gallery/src/lib/components/plain-gallery/plain-gallery.html","../../../../projects/ks89/angular-modal-gallery/src/lib/components/modal-gallery/modal-gallery.tokens.ts","../../../../projects/ks89/angular-modal-gallery/src/lib/services/id-validator.service.ts","../../../../projects/ks89/angular-modal-gallery/src/lib/components/modal-gallery/modal-gallery-ref.ts","../../../../projects/ks89/angular-modal-gallery/src/lib/components/modal-gallery/modal-gallery.service.ts","../../../../projects/ks89/angular-modal-gallery/src/lib/directives/click-outside.directive.ts","../../../../projects/ks89/angular-modal-gallery/src/lib/components/modal-gallery/modal-gallery.component.ts","../../../../projects/ks89/angular-modal-gallery/src/lib/components/modal-gallery/modal-gallery.component.html","../../../../projects/ks89/angular-modal-gallery/src/lib/components/components.ts","../../../../projects/ks89/angular-modal-gallery/src/lib/directives/margin.directive.ts","../../../../projects/ks89/angular-modal-gallery/src/lib/directives/directives.ts","../../../../projects/ks89/angular-modal-gallery/src/lib/modal-gallery.module.ts","../../../../projects/ks89/angular-modal-gallery/src/public-api.ts","../../../../projects/ks89/angular-modal-gallery/src/ks89-angular-modal-gallery.ts"],"sourcesContent":["/*\n The MIT License (MIT)\n\n Copyright (c) 2017-2026 Stefano Cappa (Ks89)\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\n\n/**\n * Key of the keyboard's key `enter`\n */\nexport const ENTER_KEY: string = 'Enter';\n/**\n * Code of the keyboard's key `enter`\n */\nexport const ENTER_CODE: string = 'Enter';\n\n/**\n * Key of the keyboard's key `esc`\n */\nexport const ESC_KEY: string = 'Escape';\n/**\n * Code of the keyboard's key `esc`\n */\nexport const ESC_CODE: string = 'Escape';\n/**\n * Key of the keyboard's key 'right arrow'\n */\nexport const RIGHT_ARROW_KEY: string = 'ArrowRight';\n/**\n * Code of the keyboard's key 'right arrow'\n */\nexport const RIGHT_ARROW_CODE: string = 'ArrowRight';\n/**\n * Key of the keyboard's key 'left arrow'\n */\nexport const LEFT_ARROW_KEY: string = 'ArrowLeft';\n/**\n * Code of the keyboard's key 'left arrow'\n */\nexport const LEFT_ARROW_CODE: string = 'ArrowLeft';\n/**\n * Key of the keyboard's key 'left arrow'\n */\nexport const UP_ARROW_KEY: string = 'ArrowUp';\n/**\n * Code of the keyboard's key 'left arrow'\n */\nexport const UP_ARROW_CODE: string = 'ArrowUp';\n/**\n * Key of the keyboard's key 'left arrow'\n */\nexport const DOWN_ARROW_KEY: string = 'ArrowDown';\n/**\n * Code of the keyboard's key 'left arrow'\n */\nexport const DOWN_ARROW_CODE: string = 'ArrowDown';\n/**\n * Key of the keyboard's key `space`\n */\nexport const SPACE_KEY : string= '';\n/**\n * Code of the keyboard's key `space`\n */\nexport const SPACE_CODE: string = 'Space';\n\n/**\n * Const to represent the right direction\n */\nexport const DIRECTION_RIGHT: string = 'right';\n/**\n * Const to represent the left direction\n */\nexport const DIRECTION_LEFT: string = 'left';\n\n\n/**\n * Keycode of the main mouse button\n */\nexport const MOUSE_MAIN_BUTTON_CLICK = 0;\n\n/**\n * Const NEXT\n */\nexport const NEXT = 1;\n/**\n * Const PREV\n */\nexport const PREV = -1;\n/**\n * Const NOTHING to represents a situation when it isn't both NEXT and PREV\n */\nexport const NOTHING = 0;\n","/*\n The MIT License (MIT)\n\n Copyright (c) 2017-2026 Stefano Cappa (Ks89)\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\n\nimport { ChangeDetectionStrategy, Component } from '@angular/core';\n\nimport { DIRECTION_RIGHT, MOUSE_MAIN_BUTTON_CLICK, NEXT, NOTHING, PREV, ENTER_CODE, SPACE_CODE } from '../utils/user-input.util';\n\n/**\n * Provides some useful methods to add accessibility features to subclasses.\n * In particular, it exposes a method to handle navigation event with both Keyboard and Mouse\n * and another with also the direction (right or left).\n */\n@Component({\n selector: 'ks-accessible',\n template: ``,\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class AccessibleComponent {\n /**\n * Method to handle navigation events with both Keyboard and Mouse.\n * @param direction string of the navigation that can be either 'next' or 'prev'\n * @param event KeyboardEvent | MouseEvent payload\n * @returns number -1 for PREV, 1 for NEXT and 0 for NOTHING\n */\n handleNavigationEvent(direction: string, event: KeyboardEvent | MouseEvent): number {\n if (!event) {\n return NOTHING;\n }\n if (event instanceof KeyboardEvent) {\n return this.handleKeyboardNavigationEvent(direction, event);\n } else if (event instanceof MouseEvent) {\n return this.handleMouseNavigationEvent(direction, event);\n }\n return NOTHING;\n }\n\n /**\n * Method to handle events over an image, for instance a keypress with the Keyboard or a Mouse click.\n * @param event KeyboardEvent | MouseEvent payload\n * @returns number 1 for NEXT and 0 for NOTHING\n */\n handleImageEvent(event: KeyboardEvent | MouseEvent): number {\n if (!event) {\n return NOTHING;\n }\n if (event instanceof KeyboardEvent) {\n return this.handleImageKeyboardEvent(event);\n } else if (event instanceof MouseEvent) {\n return this.handleImageMouseEvent(event);\n }\n return NOTHING;\n }\n\n /**\n * Private method to handle keyboard events over an image.\n * @param event KeyboardEvent payload\n * @returns number 1 for NEXT and 0 for NOTHING\n */\n private handleImageKeyboardEvent(event: KeyboardEvent): number {\n const key: string = event.code;\n if (key === SPACE_CODE || key === ENTER_CODE) {\n return NEXT;\n }\n return NOTHING;\n }\n\n /**\n * Private method to handle mouse events over an image.\n * @param event MouseEvent payload\n * @returns number 1 for NEXT and 0 for NOTHING\n */\n private handleImageMouseEvent(event: MouseEvent): number {\n const mouseBtn: number = event.button;\n if (mouseBtn === MOUSE_MAIN_BUTTON_CLICK) {\n return NEXT;\n }\n return NOTHING;\n }\n\n /**\n * Method to handle events over an image, for instance a keypress with the Keyboard or a Mouse click.\n * @param direction string of the navigation that can be either 'next' or 'prev'\n * @param event KeyboardEvent payload\n * @returns number -1 for PREV, 1 for NEXT and 0 for NOTHING\n */\n private handleKeyboardNavigationEvent(direction: string, event: KeyboardEvent): number {\n const key: string = event.code;\n if (key === SPACE_CODE || key === ENTER_CODE) {\n return direction === DIRECTION_RIGHT ? NEXT : PREV;\n }\n return NOTHING;\n }\n\n /**\n * Method to handle events over an image, for instance a keypress with the Keyboard or a Mouse click.\n * @param direction string of the navigation that can be either 'next' or 'prev'\n * @param event MouseEvent payload\n * @returns number -1 for PREV, 1 for NEXT and 0 for NOTHING\n */\n private handleMouseNavigationEvent(direction: string, event: MouseEvent): number {\n const mouseBtn: number = event.button;\n if (mouseBtn === MOUSE_MAIN_BUTTON_CLICK) {\n return direction === DIRECTION_RIGHT ? NEXT : PREV;\n }\n return NOTHING;\n }\n}\n","/*\n The MIT License (MIT)\n\n Copyright (c) 2017-2026 Stefano Cappa (Ks89)\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\n\nimport { Action } from './action.enum';\nimport { Size } from './size.interface';\nimport { SafeResourceUrl } from '@angular/platform-browser';\n\n/**\n * Class `Image` that represents an image with both `modal` and `plain` configurations.\n * Both image `id` and `modal` are mandatory, instead `plain` is optional.\n */\nexport class Image {\n id: number;\n loading: 'eager' | 'lazy';\n fetchpriority: 'high' | 'low' | 'auto';\n modal: ModalImage;\n plain?: PlainImage;\n\n constructor(id: number, modal: ModalImage, plain?: PlainImage, loading: 'eager' | 'lazy' = 'lazy', fetchpriority: 'high' | 'low' | 'auto' = 'auto') {\n this.id = id;\n this.modal = modal;\n this.plain = plain;\n this.loading = loading;\n this.fetchpriority = fetchpriority\n }\n}\n\n/**\n * Interface `ImageData` to configure an image, but it isn't used directly.\n * Please, refers to `PlainImage` or `ModalImage`.\n */\nexport interface ImageData {\n img: string | SafeResourceUrl;\n description?: string;\n title?: string;\n alt?: string;\n ariaLabel?: string;\n fallbackImg?: string | SafeResourceUrl;\n}\n\n/**\n * Interface `ModalImage` to configure the modal image.\n */\nexport interface ModalImage extends ImageData {\n extUrl?: string;\n downloadFileName?: string;\n sources?: Source[];\n}\n\n/**\n * Interface `PlainImage` to configure the plain image.\n */\nexport interface PlainImage extends ImageData {\n size?: Size;\n}\n\n/**\n * Class `ImageEvent` that represents the event payload with the result and the triggered action.\n * It also contains the source id of the gallery that emitted this event\n */\nexport class ImageEvent {\n galleryId: number;\n action: Action;\n result: number | boolean;\n\n constructor(galleryId: number, action: Action, result: number | boolean) {\n this.galleryId = galleryId;\n this.action = action;\n this.result = result;\n }\n}\n\n/**\n * Class `ImageModalEvent` that represents the event payload with galleryId, result and the triggered action.\n */\nexport class ImageModalEvent extends ImageEvent {\n constructor(galleryId: number, action: Action, result: number | boolean) {\n super(galleryId, action, result);\n }\n}\n\n/**\n * Interface `Source` to configure sources of picture element.\n */\nexport interface Source {\n srcset: string;\n media: string;\n}\n","/*\n The MIT License (MIT)\n\n Copyright (c) 2017-2026 Stefano Cappa (Ks89)\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\n\n/**\n * Enum `Action` with a list of possible actions, based on the source of the action.\n */\nexport enum Action {\n NORMAL, // default value\n CLICK, // mouse click\n KEYBOARD,\n SWIPE,\n LOAD,\n AUTOPLAY\n}\n","/*\n The MIT License (MIT)\n\n Copyright (c) 2017-2026 Stefano Cappa (Ks89)\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\n\nimport { Image } from '../model/image.class';\n\n/**\n * Utility function to get the index of the input `image` from `arrayOfImages`\n * @param image Image to get the index. The image 'id' must be a number >= 0\n * @param arrayOfImages Image[] to search the image within it\n * @returns number the index of the image. -1 if not found.\n * @throws an Error if either image or arrayOfImages are not valid,\n * or if the input image doesn't contain an 'id', or the 'id' is < 0\n */\nexport function getIndex(image: Image, arrayOfImages: Image[]): number {\n if (!image) {\n throw new Error('image must be a valid Image object');\n }\n\n if (!arrayOfImages) {\n throw new Error('arrayOfImages must be a valid Image[]');\n }\n\n if (!image.id && image.id !== 0) {\n // id = 0 is admitted\n throw new Error(`A numeric Image 'id' is mandatory`);\n }\n\n if (image.id < 0) {\n throw new Error(`Image 'id' must be >= 0`);\n }\n\n return arrayOfImages.findIndex((val: Image) => val.id === image.id);\n}\n","/*\n The MIT License (MIT)\n\n Copyright (c) 2017-2026 Stefano Cappa (Ks89)\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\n\n/**\n * Interface `Description` to change the description, either with a full custom\n * description or with a small and simple customization.\n * Also, you could change margins, background style and so on.\n */\nexport interface Description {\n strategy: DescriptionStrategy;\n customFullDescription?: string;\n imageText?: string;\n numberSeparator?: string;\n beforeTextDescription?: string;\n\n style?: DescriptionStyle;\n}\n\n/**\n * Enum `DescriptionStrategy` with keys and their relative key codes.\n */\nexport enum DescriptionStrategy {\n ALWAYS_HIDDEN = 1,\n ALWAYS_VISIBLE,\n HIDE_IF_EMPTY\n}\n\n/**\n * Interface to change css properties.\n */\nexport interface DescriptionStyle {\n bgColor?: string;\n textColor?: string;\n width?: string;\n height?: string;\n position?: string;\n top?: string;\n bottom?: string;\n left?: string;\n right?: string;\n marginTop?: string;\n marginBottom?: string;\n marginRight?: string;\n marginLeft?: string;\n}\n","import { AccessibilityConfig } from '../model/accessibility.interface';\n\n/**\n * Default accessibility configuration.\n */\nexport const KS_DEFAULT_ACCESSIBILITY_CONFIG: AccessibilityConfig = {\n backgroundAriaLabel: 'Modal gallery full screen background',\n backgroundTitle: '',\n\n plainGalleryContentAriaLabel: 'Plain gallery content',\n plainGalleryContentTitle: '',\n\n modalGalleryContentAriaLabel: 'Modal gallery content',\n modalGalleryContentTitle: '',\n\n loadingSpinnerAriaLabel: 'The current image is loading. Please be patient.',\n loadingSpinnerTitle: 'The current image is loading. Please be patient.',\n\n mainContainerAriaLabel: 'Current image and navigation',\n mainContainerTitle: '',\n mainPrevImageAriaLabel: 'Previous image',\n mainPrevImageTitle: 'Previous image',\n mainNextImageAriaLabel: 'Next image',\n mainNextImageTitle: 'Next image',\n\n dotsContainerAriaLabel: 'Image navigation dots',\n dotsContainerTitle: '',\n dotAriaLabel: 'Navigate to image number',\n\n previewsContainerAriaLabel: 'Image previews',\n previewsContainerTitle: '',\n previewScrollPrevAriaLabel: 'Scroll previous previews',\n previewScrollPrevTitle: 'Scroll previous previews',\n previewScrollNextAriaLabel: 'Scroll next previews',\n previewScrollNextTitle: 'Scroll next previews',\n\n carouselContainerAriaLabel: 'Current image and navigation',\n carouselContainerTitle: '',\n carouselPrevImageAriaLabel: 'Previous image',\n carouselPrevImageTitle: 'Previous image',\n carouselNextImageAriaLabel: 'Next image',\n carouselNextImageTitle: 'Next image',\n carouselPreviewsContainerAriaLabel: 'Image previews',\n carouselPreviewsContainerTitle: '',\n carouselPreviewScrollPrevAriaLabel: 'Scroll previous previews',\n carouselPreviewScrollPrevTitle: 'Scroll previous previews',\n carouselPreviewScrollNextAriaLabel: 'Scroll next previews',\n carouselPreviewScrollNextTitle: 'Scroll next previews'\n};\n","/*\n The MIT License (MIT)\n\n Copyright (c) 2017-2026 Stefano Cappa (Ks89)\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\n\nimport { Action } from './action.enum';\nimport { InternalLibImage } from './image-internal.class';\nimport { Size } from './size.interface';\n\n/**\n * Interface `ButtonsConfig` to add buttons, show/hide their, and to add the strategy.\n */\nexport interface ButtonsConfig {\n visible: boolean;\n strategy: ButtonsStrategy;\n buttons?: ButtonConfig[];\n}\n\n/**\n * Interface `ButtonConfig` to configure a single button.\n */\nexport interface ButtonConfig {\n className?: string;\n size?: Size;\n fontSize?: string;\n type: ButtonType;\n title?: string;\n ariaLabel?: string;\n extUrlInNewTab?: boolean; // to open the external url in a new tab, instead of the current one\n}\n\n/**\n * Interface `ButtonEvent` to represent the event payload when a button is clicked.\n */\nexport interface ButtonEvent {\n button: ButtonConfig;\n image: InternalLibImage | null;\n action: Action;\n galleryId: number;\n}\n\n/**\n * Enum `ButtonsStrategy` to configure the logic of a button.\n */\nexport enum ButtonsStrategy {\n // don't use 0 here\n // the first index is 1 and all of the following members are auto-incremented from that point on\n DEFAULT = 1,\n SIMPLE,\n ADVANCED,\n FULL,\n CUSTOM\n}\n\n/**\n * Enum `ButtonType` is the type of a button.\n */\nexport enum ButtonType {\n // don't use 0 here\n // the first index is 1 and all of the following members are auto-incremented from that point on\n DELETE = 1,\n EXTURL,\n DOWNLOAD,\n CLOSE,\n CUSTOM,\n FULLSCREEN\n}\n\n/**\n * Array of admitted types of buttons.\n */\nexport const WHITELIST_BUTTON_TYPES: ButtonType[] = [\n ButtonType.FULLSCREEN,\n ButtonType.DELETE,\n ButtonType.EXTURL,\n ButtonType.DOWNLOAD,\n ButtonType.CLOSE,\n ButtonType.CUSTOM\n];\n","/*\n The MIT License (MIT)\n\n Copyright (c) 2017-2026 Stefano Cappa (Ks89)\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\n\nimport { Size } from './size.interface';\n\n/**\n * Interface `PlainGalleryConfig` to configure plain-gallery features.\n */\nexport interface PlainGalleryConfig {\n strategy: PlainGalleryStrategy;\n layout: PlainGalleryLayout;\n advanced?: AdvancedConfig;\n}\n\n/**\n * Interface `PlainGalleryLayout` to configure the layout. This interface isn't used directly, instead\n * refers to either `LineLayout`, `GridLayout`.\n */\n// tslint:disable-next-line no-empty-interface\nexport interface PlainGalleryLayout {}\n\n/**\n * Class `LineLayout` to configure a linear plain gallery.\n */\nexport class LineLayout implements PlainGalleryLayout {\n breakConfig: BreakConfig;\n justify: string;\n size: Size;\n\n constructor(size: Size, breakConfig: BreakConfig, justify: string) {\n this.size = size;\n this.breakConfig = breakConfig;\n this.justify = justify;\n }\n}\n\n/**\n * Class `GridLayout` to configure a grid plain gallery.\n */\nexport class GridLayout implements PlainGalleryLayout {\n breakConfig: BreakConfig;\n size: Size;\n\n constructor(size: Size, breakConfig: BreakConfig) {\n this.size = size;\n this.breakConfig = breakConfig;\n }\n}\n\n/**\n * Enum `PlainGalleryStrategy` to choose the behaviour of the plain gallery.\n */\nexport enum PlainGalleryStrategy {\n // don't use 0 here\n // the first index is 1 and all of the following members are auto-incremented from that point on\n ROW = 1,\n COLUMN,\n GRID,\n CUSTOM // full custom strategy\n}\n\n/**\n * Interface `BreakConfig` to limit the number of items of the plain gallery or to force it to fill other lines.\n */\nexport interface BreakConfig {\n length: number;\n wrap: boolean;\n}\n\n/**\n * Interface `AdvancedConfig` to use `<a>` tags instead of `<img>`.\n * It also contains a string property to customize the css background property.\n * For more info check here https://www.w3schools.com/cssref/css3_pr_background.asp\n */\nexport interface AdvancedConfig {\n aTags: boolean;\n additionalBackground: string;\n}\n","/*\n The MIT License (MIT)\n\n Copyright (c) 2017-2026 Stefano Cappa (Ks89)\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\n\n/**\n * Interface `LoadingConfig` to configure loading icon.\n */\nexport interface LoadingConfig {\n enable: boolean;\n type: LoadingType;\n}\n\n/**\n * Enum `LoadingType` with a list of possible types.\n */\nexport enum LoadingType {\n STANDARD = 1,\n CIRCULAR,\n BARS,\n DOTS,\n CUBE_FLIPPING,\n CIRCLES,\n EXPLOSING_SQUARES\n}\n","/*\n The MIT License (MIT)\n\n Copyright (c) 2017-2026 Stefano Cappa (Ks89)\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\n\n/**\n * Enum `Keyboard` with keys and their relative codes.\n */\nimport { DOWN_ARROW_CODE, ESC_CODE, LEFT_ARROW_CODE, RIGHT_ARROW_CODE, UP_ARROW_CODE } from '../utils/user-input.util';\n\ntype Keyboard = Readonly<{\n ESC: typeof ESC_CODE,\n LEFT_ARROW: typeof LEFT_ARROW_CODE,\n RIGHT_ARROW: typeof RIGHT_ARROW_CODE,\n UP_ARROW: typeof UP_ARROW_CODE,\n DOWN_ARROW: typeof DOWN_ARROW_CODE\n}>;\n\nexport const Keyboard: Keyboard = {\n ESC: ESC_CODE,\n LEFT_ARROW: LEFT_ARROW_CODE,\n RIGHT_ARROW: RIGHT_ARROW_CODE,\n UP_ARROW: UP_ARROW_CODE,\n DOWN_ARROW: DOWN_ARROW_CODE\n};\n","/*\n The MIT License (MIT)\n\n Copyright (c) 2017-2026 Stefano Cappa (Ks89)\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\n\nimport { Injectable } from '@angular/core';\nimport { SidePreviewsConfig, SlideConfig } from '../model/slide-config.interface';\nimport { PlayConfig } from '../model/play-config.interface';\nimport { KS_DEFAULT_ACCESSIBILITY_CONFIG } from '../components/accessibility-default';\nimport { PreviewConfig } from '../model/preview-config.interface';\nimport { Size } from '../model/size.interface';\nimport { ButtonsConfig, ButtonsStrategy } from '../model/buttons-config.interface';\nimport { DotsConfig } from '../model/dots-config.interface';\nimport { GridLayout, LineLayout, PlainGalleryConfig, PlainGalleryStrategy } from '../model/plain-gallery-config.interface';\nimport { CurrentImageConfig } from '../model/current-image-config.interface';\nimport { LoadingConfig, LoadingType } from '../model/loading-config.interface';\nimport { Description, DescriptionStrategy, DescriptionStyle } from '../model/description.interface';\nimport { CarouselConfig } from '../model/carousel-config.interface';\nimport { CarouselImageConfig } from '../model/carousel-image-config.interface';\nimport { BreakpointsConfig, CarouselPreviewConfig } from '../model/carousel-preview-config.interface';\nimport { DeepRequired, LibConfig, LibConfigInternal } from '../model/lib-config.interface';\nimport { Keyboard } from '../model/keyboard.enum';\nimport { KeyboardConfig } from '../model/keyboard-config.interface';\n\nexport const DEFAULT_PREVIEW_SIZE: DeepRequired<Size> = { height: '50px', width: 'auto' };\nexport const DEFAULT_LAYOUT: LineLayout = new LineLayout(DEFAULT_PREVIEW_SIZE, { length: -1, wrap: false }, 'flex-start');\nexport const DEFAULT_PLAIN_CONFIG: DeepRequired<PlainGalleryConfig> = {\n strategy: PlainGalleryStrategy.ROW,\n layout: DEFAULT_LAYOUT,\n advanced: { aTags: false, additionalBackground: '50% 50%/cover' }\n};\nexport const DEFAULT_LOADING: DeepRequired<LoadingConfig> = { enable: true, type: LoadingType.STANDARD };\nexport const DEFAULT_DESCRIPTION_STYLE: DeepRequired<DescriptionStyle> = {\n bgColor: 'rgba(0, 0, 0, .5)',\n textColor: 'white',\n marginTop: '0px',\n marginBottom: '0px',\n marginLeft: '0px',\n marginRight: '0px',\n width: '',\n height: '',\n position: '',\n top: '',\n bottom: '',\n left: '',\n right: ''\n};\nexport const DEFAULT_DESCRIPTION: DeepRequired<Description> = {\n strategy: DescriptionStrategy.ALWAYS_VISIBLE,\n imageText: 'Image ',\n numberSeparator: '/',\n beforeTextDescription: ' - ',\n customFullDescription: '',\n style: DEFAULT_DESCRIPTION_STYLE\n};\nexport const DEFAULT_CAROUSEL_DESCRIPTION: DeepRequired<Description> = {\n strategy: DescriptionStrategy.ALWAYS_HIDDEN,\n imageText: 'Image ',\n numberSeparator: '/',\n beforeTextDescription: ' - ',\n customFullDescription: '',\n style: DEFAULT_DESCRIPTION_STYLE\n};\nexport const DEFAULT_CURRENT_IMAGE_CONFIG: DeepRequired<CurrentImageConfig> = {\n navigateOnClick: true,\n loadingConfig: DEFAULT_LOADING,\n description: DEFAULT_DESCRIPTION,\n downloadable: false,\n invertSwipe: false\n};\nexport const DEFAULT_CAROUSEL_IMAGE_CONFIG: DeepRequired<CarouselImageConfig> = {\n description: DEFAULT_CAROUSEL_DESCRIPTION,\n invertSwipe: false\n};\nexport const DEFAULT_CURRENT_CAROUSEL_CONFIG: DeepRequired<CarouselConfig> = {\n maxWidth: '100%',\n maxHeight: '400px',\n showArrows: true,\n objectFit: 'cover',\n keyboardEnable: true,\n modalGalleryEnable: false\n};\nexport const DEFAULT_CURRENT_CAROUSEL_PLAY: DeepRequired<PlayConfig> = {\n autoPlay: true,\n interval: 5000,\n pauseOnHover: true\n};\n\nexport const DEFAULT_CAROUSEL_BREAKPOINTS: DeepRequired<BreakpointsConfig> = { xSmall: 100, small: 100, medium: 150, large: 200, xLarge: 200 };\nexport const DEFAULT_CAROUSEL_PREVIEWS_CONFIG: DeepRequired<CarouselPreviewConfig> = {\n visible: true,\n number: 4,\n arrows: true,\n clickable: true,\n width: 100 / 4 + '%',\n maxHeight: '200px',\n breakpoints: DEFAULT_CAROUSEL_BREAKPOINTS\n};\nexport const DEFAULT_SLIDE_CONFIG: DeepRequired<SlideConfig> = {\n infinite: false,\n playConfig: { autoPlay: false, interval: 5000, pauseOnHover: true } as DeepRequired<PlayConfig>,\n sidePreviews: { show: true, size: { width: '100px', height: 'auto' } } as DeepRequired<SidePreviewsConfig>\n};\nexport const DEFAULT_PREVIEW_CONFIG: DeepRequired<PreviewConfig> = {\n visible: true,\n number: 3,\n arrows: true,\n clickable: true,\n size: DEFAULT_PREVIEW_SIZE,\n mobileVisible: false\n};\nexport const DEFAULT_KEYBOARD_CONFIG: DeepRequired<KeyboardConfig> = {\n esc: Keyboard.ESC,\n right: Keyboard.RIGHT_ARROW,\n left: Keyboard.LEFT_ARROW\n};\n\nconst DEFAULT_CONFIG: LibConfigInternal = Object.freeze({\n slideConfig: DEFAULT_SLIDE_CONFIG,\n accessibilityConfig: KS_DEFAULT_ACCESSIBILITY_CONFIG,\n previewConfig: DEFAULT_PREVIEW_CONFIG,\n buttonsConfig: { visible: true, strategy: ButtonsStrategy.DEFAULT } as DeepRequired<ButtonsConfig>,\n dotsConfig: { visible: true } as DeepRequired<DotsConfig>,\n plainGalleryConfig: DEFAULT_PLAIN_CONFIG,\n currentImageConfig: DEFAULT_CURRENT_IMAGE_CONFIG,\n keyboardConfig: DEFAULT_KEYBOARD_CONFIG,\n carouselConfig: DEFAULT_CURRENT_CAROUSEL_CONFIG,\n carouselImageConfig: DEFAULT_CAROUSEL_IMAGE_CONFIG,\n carouselPreviewsConfig: DEFAULT_CAROUSEL_PREVIEWS_CONFIG,\n carouselPlayConfig: DEFAULT_CURRENT_CAROUSEL_PLAY,\n carouselDotsConfig: { visible: true } as DeepRequired<DotsConfig>,\n carouselSlideInfinite: true,\n enableCloseOutside: true\n});\n\n/**\n * Service to handle library configuration in a unique place\n */\n@Injectable({ providedIn: 'root' })\nexport class ConfigService {\n configMap: Map<number, LibConfigInternal> = new Map<number, LibConfigInternal>();\n\n getConfig(id: number): LibConfig | undefined {\n this.initIfNotExists(id);\n return this.configMap.get(id);\n }\n\n setConfig(id: number, obj: LibConfig | undefined): void {\n this.initIfNotExists(id);\n if (!obj) {\n return;\n }\n\n if (\n !DEFAULT_CONFIG ||\n !DEFAULT_CONFIG.slideConfig ||\n !DEFAULT_CONFIG.slideConfig.sidePreviews ||\n !DEFAULT_CONFIG.previewConfig ||\n !DEFAULT_CONFIG.previewConfig.size ||\n !DEFAULT_CONFIG.previewConfig.number ||\n !DEFAULT_CONFIG.plainGalleryConfig ||\n !DEFAULT_CONFIG.currentImageConfig ||\n !DEFAULT_CONFIG.currentImageConfig ||\n !DEFAULT_CONFIG.currentImageConfig.description ||\n !DEFAULT_CONFIG.carouselImageConfig ||\n !DEFAULT_CONFIG.carouselImageConfig.description ||\n !DEFAULT_CONFIG.carouselPreviewsConfig ||\n !DEFAULT_CONFIG.carouselPreviewsConfig.breakpoints ||\n !DEFAULT_CAROUSEL_PREVIEWS_CONFIG.number\n ) {\n throw new Error('Internal library error - DEFAULT_CONFIG must be fully initialized!!!');\n }\n\n const newConfig: LibConfigInternal = Object.assign({}, this.configMap.get(id));\n if (obj.slideConfig) {\n let playConfig;\n let sidePreviews;\n let size;\n if (obj.slideConfig.playConfig) {\n playConfig = Object.assign({}, DEFAULT_CONFIG.slideConfig.playConfig, obj.slideConfig.playConfig);\n } else {\n playConfig = DEFAULT_CONFIG.slideConfig.playConfig;\n }\n if (obj.slideConfig.sidePreviews) {\n if (obj.slideConfig.sidePreviews.size) {\n size = Object.assign({}, DEFAULT_CONFIG.slideConfig.sidePreviews.size, obj.slideConfig.sidePreviews.size);\n } else {\n size = DEFAULT_CONFIG.slideConfig.sidePreviews.size;\n }\n sidePreviews = Object.assign({}, DEFAULT_CONFIG.slideConfig.sidePreviews, obj.slideConfig.sidePreviews);\n } else {\n sidePreviews = DEFAULT_CONFIG.slideConfig.sidePreviews;\n size = DEFAULT_CONFIG.slideConfig.sidePreviews.size;\n }\n const newSlideConfig: DeepRequired<SlideConfig> = Object.assign({}, DEFAULT_CONFIG.slideConfig, obj.slideConfig);\n newSlideConfig.playConfig = playConfig;\n newSlideConfig.sidePreviews = sidePreviews;\n newSlideConfig.sidePreviews.size = size;\n newConfig.slideConfig = newSlideConfig;\n }\n if (obj.accessibilityConfig) {\n newConfig.accessibilityConfig = Object.assign({}, DEFAULT_CONFIG.accessibilityConfig, obj.accessibilityConfig);\n }\n if (obj.previewConfig) {\n let size: DeepRequired<Size>;\n let num: number;\n if (obj.previewConfig.size) {\n size = Object.assign({}, DEFAULT_CONFIG.previewConfig.size, obj.previewConfig.size);\n } else {\n size = DEFAULT_CONFIG.previewConfig.size;\n }\n if (obj.previewConfig.number) {\n if (obj.previewConfig.number <= 0) {\n // if number is <= 0 reset to default\n num = DEFAULT_CONFIG.previewConfig.number;\n } else {\n num = obj.previewConfig.number;\n }\n } else {\n num = DEFAULT_CONFIG.previewConfig.number;\n }\n const newPreviewConfig: DeepRequired<PreviewConfig> = Object.assign({}, DEFAULT_CONFIG.previewConfig, obj.previewConfig);\n newPreviewConfig.size = size;\n newPreviewConfig.number = num;\n newConfig.previewConfig = newPreviewConfig;\n }\n if (obj.buttonsConfig) {\n newConfig.buttonsConfig = Object.assign({}, DEFAULT_CONFIG.buttonsConfig, obj.buttonsConfig);\n }\n if (obj.dotsConfig) {\n newConfig.dotsConfig = Object.assign({}, DEFAULT_CONFIG.dotsConfig, obj.dotsConfig);\n }\n if (obj.plainGalleryConfig) {\n let advanced;\n let layout;\n if (obj.plainGalleryConfig.advanced) {\n advanced = Object.assign({}, DEFAULT_CONFIG.plainGalleryConfig.advanced, obj.plainGalleryConfig.advanced);\n } else {\n advanced = DEFAULT_CONFIG.plainGalleryConfig.advanced;\n }\n if (obj.plainGalleryConfig.layout) {\n // it isn't mandatory to use assign, because obj.plainGalleryConfig.layout is an instance of class (LineaLayout, GridLayout)\n layout = obj.plainGalleryConfig.layout;\n } else {\n layout = DEFAULT_CONFIG.plainGalleryConfig.layout;\n }\n const newPlainGalleryConfig: DeepRequired<PlainGalleryConfig> = Object.assign({}, DEFAULT_CONFIG.plainGalleryConfig, obj.plainGalleryConfig);\n newPlainGalleryConfig.layout = layout;\n newPlainGalleryConfig.advanced = advanced;\n newConfig.plainGalleryConfig = initPlainGalleryConfig(newPlainGalleryConfig);\n }\n if (obj.currentImageConfig) {\n let loading;\n let description;\n let descriptionStyle;\n if (obj.currentImageConfig.loadingConfig) {\n loading = Object.assign({}, DEFAULT_CONFIG.currentImageConfig.loadingConfig, obj.currentImageConfig.loadingConfig);\n } else {\n loading = DEFAULT_CONFIG.currentImageConfig.loadingConfig;\n }\n if (obj.currentImageConfig.description) {\n description = Object.assign({}, DEFAULT_CONFIG.currentImageConfig.description, obj.currentImageConfig.description);\n if (obj.currentImageConfig.description.style) {\n descriptionStyle = Object.assign({}, DEFAULT_CONFIG.currentImageConfig.description.style, obj.currentImageConfig.description.style);\n } else {\n descriptionStyle = DEFAULT_CONFIG.currentImageConfig.description.style;\n }\n } else {\n description = DEFAULT_CONFIG.currentImageConfig.description;\n descriptionStyle = DEFAULT_CONFIG.currentImageConfig.description.style;\n }\n const newCurrentImageConfig: DeepRequired<CurrentImageConfig> = Object.assign({}, DEFAULT_CONFIG.currentImageConfig, obj.currentImageConfig);\n newCurrentImageConfig.loadingConfig = loading;\n newCurrentImageConfig.description = description;\n newCurrentImageConfig.description.style = descriptionStyle;\n newConfig.currentImageConfig = newCurrentImageConfig;\n }\n if (obj.keyboardConfig) {\n newConfig.keyboardConfig = Object.assign({}, DEFAULT_CONFIG.keyboardConfig, obj.keyboardConfig);\n }\n\n // carousel\n if (obj.carouselConfig) {\n newConfig.carouselConfig = Object.assign({}, DEFAULT_CONFIG.carouselConfig, obj.carouselConfig);\n }\n if (obj.carouselImageConfig) {\n let description;\n let descriptionStyle;\n if (obj.carouselImageConfig.description) {\n description = Object.assign({}, DEFAULT_CONFIG.carouselImageConfig.description, obj.carouselImageConfig.description);\n if (obj.carouselImageConfig.description.style) {\n descriptionStyle = Object.assign({}, DEFAULT_CONFIG.carouselImageConfig.description.style, obj.carouselImageConfig.description.style);\n } else {\n descriptionStyle = DEFAULT_CONFIG.carouselImageConfig.description.style;\n }\n } else {\n description = DEFAULT_CONFIG.carouselImageConfig.description;\n descriptionStyle = DEFAULT_CONFIG.carouselImageConfig.description.style;\n }\n const newCarouselImageConfig: DeepRequired<CarouselImageConfig> = Object.assign({}, DEFAULT_CONFIG.carouselImageConfig, obj.carouselImageConfig);\n newCarouselImageConfig.description = description;\n newCarouselImageConfig.description.style = descriptionStyle;\n newConfig.carouselImageConfig = newCarouselImageConfig;\n }\n if (obj.carouselPlayConfig) {\n // check values\n if (obj.carouselPlayConfig.interval <= 0) {\n throw new Error(`Carousel's interval must be a number >= 0`);\n }\n newConfig.carouselPlayConfig = Object.assign({}, DEFAULT_CONFIG.carouselPlayConfig, obj.carouselPlayConfig);\n }\n if (obj.carouselPreviewsConfig) {\n // check values\n let num: number;\n let breakpoints: BreakpointsConfig;\n if (!obj.carouselPreviewsConfig.number || obj.carouselPreviewsConfig.number <= 0) {\n num = DEFAULT_CAROUSEL_PREVIEWS_CONFIG.number;\n } else {\n num = obj.carouselPreviewsConfig.number;\n }\n if (obj.carouselPreviewsConfig.breakpoints) {\n breakpoints = Object.assign({}, DEFAULT_CONFIG.carouselPreviewsConfig.breakpoints, obj.carouselPreviewsConfig.breakpoints);\n } else {\n breakpoints = DEFAULT_CONFIG.carouselPreviewsConfig.breakpoints;\n }\n newConfig.carouselPreviewsConfig = Object.assign({}, DEFAULT_CONFIG.carouselPreviewsConfig, obj.carouselPreviewsConfig);\n newConfig.carouselPreviewsConfig.number = num;\n newConfig.carouselPreviewsConfig.breakpoints = breakpoints;\n // Init preview image width based on the number of previews in PreviewConfig\n // Don't move this line above, because I need to be sure that both configPreview.number\n // and configPreview.size are initialized\n newConfig.carouselPreviewsConfig.width = 100 / newConfig.carouselPreviewsConfig.number + '%';\n }\n if (obj.carouselDotsConfig) {\n newConfig.carouselDotsConfig = Object.assign({}, DEFAULT_CONFIG.carouselDotsConfig, obj.carouselDotsConfig);\n }\n if (obj.carouselSlideInfinite === undefined) {\n newConfig.carouselSlideInfinite = DEFAULT_CONFIG.carouselSlideInfinite;\n } else {\n newConfig.carouselSlideInfinite = obj.carouselSlideInfinite;\n }\n if (obj.enableCloseOutside === undefined) {\n newConfig.enableCloseOutside = DEFAULT_CONFIG.enableCloseOutside;\n } else {\n newConfig.enableCloseOutside = obj.enableCloseOutside;\n }\n this.configMap.set(id, newConfig);\n }\n\n private initIfNotExists(id: number): void {\n if (!this.configMap.has(id)) {\n this.configMap.set(id, DEFAULT_CONFIG);\n }\n }\n}\n\n/**\n * Function to build and return a `PlainGalleryConfig` object, proving also default values and validating the input object.\n * @param plainGalleryConfig object with the config requested by user\n * @returns PlainGalleryConfig the plain gallery configuration\n * @throws an Error if layout and strategy aren't compatible\n */\nfunction initPlainGalleryConfig(plainGalleryConfig: PlainGalleryConfig): DeepRequired<PlainGalleryConfig> {\n const newPlayGalleryConfig: DeepRequired<PlainGalleryConfig> = Object.assign({}, DEFAULT_CONFIG.plainGalleryConfig, plainGalleryConfig);\n\n if (newPlayGalleryConfig.layout instanceof LineLayout) {\n if (newPlayGalleryConfig.strategy !== PlainGalleryStrategy.ROW && newPlayGalleryConfig.strategy !== PlainGalleryStrategy.COLUMN) {\n throw new Error('LineLayout requires either ROW or COLUMN strategy');\n }\n if (!newPlayGalleryConfig.layout || !newPlayGalleryConfig.layout.breakConfig) {\n throw new Error('Both layout and breakConfig must be valid');\n }\n }\n\n if (newPlayGalleryConfig.layout instanceof GridLayout) {\n if (newPlayGalleryConfig.strategy !== PlainGalleryStrategy.GRID) {\n throw new Error('GridLayout requires GRID strategy');\n }\n if (!newPlayGalleryConfig.layout || !newPlayGalleryConfig.layout.breakConfig) {\n throw new Error('Both layout and breakConfig must be valid');\n }\n // force wrap for grid layout\n newPlayGalleryConfig.layout.breakConfig.wrap = true;\n }\n return newPlayGalleryConfig;\n}\n","/*\n The MIT License (MIT)\n\n Copyright (c) 2017-2026 Stefano Cappa (Ks89)\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\n\nimport { Directive, ElementRef, inject, OnChanges, OnInit, Renderer2, input } from '@angular/core';\nimport { MaxSize } from '../model/max-size.interface';\n\n/**\n * Directive to change the max size of an element.\n */\n@Directive({ selector: '[ksMaxSize]' })\nexport class MaxSizeDirective implements OnInit, OnChanges {\n /**\n * Object of type `MaxSize` to resize the element.\n */\n readonly maxSizeConfig = input<MaxSize>();\n\n private renderer: Renderer2 = inject(Renderer2);\n private el: ElementRef = inject(ElementRef);\n\n /**\n * Method `ngOnInit` to apply the style of this directive.\n * This is an angular lifecycle hook, so it's called automatically by Angular itself.\n * In particular, it's called only one time!!!\n */\n ngOnInit(): void {\n this.applyStyle();\n }\n\n /**\n * Method `ngOnChanges` to apply the style of this directive.\n * This is an angular lifecycle hook, so it's called automatically by Angular itself.\n * In particular, it's called when any data-bound property of a directive changes!!!\n */\n ngOnChanges(): void {\n this.applyStyle();\n }\n\n /**\n * Private method to change both max-width and max-height of an element.\n */\n private applyStyle(): void {\n const maxSizeConfig = this.maxSizeConfig();\n if (!maxSizeConfig) {\n return;\n }\n if (maxSizeConfig.maxWidth) {\n this.renderer.setStyle(this.el.nativeElement, 'max-width', maxSizeConfig.maxWidth);\n }\n if (maxSizeConfig.maxHeight) {\n this.renderer.setStyle(this.el.nativeElement, 'max-height', maxSizeConfig.maxHeight);\n }\n }\n}\n","/*\n The MIT License (MIT)\n\n Copyright (c) 2017-2026 Stefano Cappa (Ks89)\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\n\nimport { Directive, ElementRef, inject, OnChanges, OnInit, Renderer2, input } from '@angular/core';\nimport { Size } from '../model/size.interface';\n\n/**\n * Directive to change the size of an element.\n */\n@Directive({ selector: '[ksSize]' })\nexport class SizeDirective implements OnInit, OnChanges {\n /**\n * Object of type `Size` to resize the element.\n */\n readonly sizeConfig = input<Size>();\n\n private renderer: Renderer2 = inject(Renderer2);\n private el: ElementRef = inject(ElementRef);\n\n /**\n * Method `ngOnInit` to apply the style of this directive.\n * This is an Angular lifecycle hook, so it's called automatically by Angular itself.\n * In particular, it's called only one time!!!\n */\n ngOnInit(): void {\n this.applyStyle();\n }\n\n /**\n * Method `ngOnChanges` to apply the style of this directive.\n * This is an Angular lifecycle hook, so it's called automatically by Angular itself.\n * In particular, it's called when any data-bound property of a directive changes!!!\n */\n ngOnChanges(): void {\n this.applyStyle();\n }\n\n /**\n * Private method to change both width and height of an element.\n */\n private applyStyle(): void {\n const sizeConfig = this.sizeConfig();\n if (!sizeConfig) {\n return;\n }\n // apply [style.width]\n if (sizeConfig.width) {\n this.renderer.setStyle(this.el.nativeElement, 'width', sizeConfig.width);\n }\n if (sizeConfig.height) {\n this.renderer.setStyle(this.el.nativeElement, 'height', sizeConfig.height);\n }\n }\n}\n","/*\n The MIT License (MIT)\n\n Copyright (c) 2017-2026 Stefano Cappa (Ks89)\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\n\nimport { Directive, ElementRef, HostListener, inject, Renderer2, output, input } from '@angular/core';\nimport { SafeResourceUrl } from '@angular/platform-browser';\n\n/**\n * Directive to add fallback image if the original one is not reachable.\n */\n@Directive({ selector: '[ksFallbackImage]' })\nexport class FallbackImageDirective {\n readonly fallbackImg = input<string | SafeResourceUrl>();\n\n readonly fallbackApplied = output<boolean>();\n\n private renderer: Renderer2 = inject(Renderer2);\n private el: ElementRef = inject(ElementRef);\n\n @HostListener('error') onError(): void {\n const fallbackImg = this.fallbackImg();\n if (!fallbackImg) {\n this.fallbackApplied.emit(false);\n return;\n }\n const fallbackUrl = fallbackImg.toString();\n if (!/^https?:\\/\\//i.test(fallbackUrl) && !fallbackUrl.startsWith('/') && !fallbackUrl.startsWith('./')) {\n this.fallbackApplied.emit(false);\n return;\n }\n this.renderer.setAttribute(this.el.nativeElement, 'src', fallbackUrl);\n this.fallbackApplied.emit(true);\n }\n}\n","/*\n The MIT License (MIT)\n\n Copyright (c) 2017-2026 Stefano Cappa (Ks89)\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\n\nimport { Directive, ElementRef, inject, OnChanges, OnInit, Renderer2, input } from '@angular/core';\nimport { Description } from '../model/description.interface';\n\n/**\n * Directive to customize the description.\n */\n@Directive({ selector: '[ksDescription]' })\nexport class DescriptionDirective implements OnInit, OnChanges {\n /**\n * Object of type `Description` to resize the element.\n */\n readonly description = input<Description>();\n\n private renderer: Renderer2 = inject(Renderer2);\n private el: ElementRef = inject(ElementRef);\n\n /**\n * Method `ngOnInit` to apply the style of this directive.\n * This is an angular lifecycle hook, so it's called automatically by Angular itself.\n * In particular, it's called only one time!!!\n */\n ngOnInit(): void {\n this.applyStyle();\n }\n\n /**\n * Method `ngOnChanges` to apply the style of this directive.\n * This is an angular lifecycle hook, so it's called automatically by Angular itself.\n * In particular, it's called when any data-bound property of a directive changes!!!\n */\n ngOnChanges(): void {\n this.applyStyle();\n }\n\n /**\n * Private method to change description's style.\n */\n private applyStyle(): void {\n const description = this.description();\n if (!description) {\n return;\n }\n if (description.style) {\n const bgColor = this.sanitizeCssValue(description.style.bgColor);\n if (bgColor) {\n this.renderer.setStyle(this.el.nativeElement, 'background', bgColor);\n }\n const textColor = this.sanitizeCssValue(description.style.textColor);\n if (textColor) {\n this.renderer.setStyle(this.el.nativeElement, 'color', textColor);\n }\n\n const width = this.sanitizeCssValue(description.style.width);\n if (width) {\n this.renderer.setStyle(this.el.nativeElement, 'width', width);\n }\n const height = this.sanitizeCssValue(description.style.height);\n if (height) {\n this.renderer.setStyle(this.el.nativeElement, 'height', height);\n }\n const position = this.sanitizePosition(description.style.position);\n if (position) {\n this.renderer.setStyle(this.el.nativeElement, 'position', position);\n }\n\n const top = this.sanitizeCssValue(description.style.top);\n if (top) {\n this.renderer.setStyle(this.el.nativeElement, 'top', top);\n }\n const bottom = this.sanitizeCssValue(description.style.bottom);\n if (bottom) {\n this.renderer.setStyle(this.el.nativeElement, 'bottom', bottom);\n }\n const left = this.sanitizeCssValue(description.style.left);\n if (left) {\n this.renderer.setStyle(this.el.nativeElement, 'left', left);\n }\n const right = this.sanitizeCssValue(description.style.right);\n if (right) {\n this.renderer.setStyle(this.el.nativeElement, 'right', right);\n }\n\n this.renderer.setStyle(this.el.nativeElement, 'margin-top', this.sanitizeCssValue(description.style.marginTop) ?? '0px');\n this.renderer.setStyle(this.el.nativeElement, 'margin-bottom', this.sanitizeCssValue(description.style.marginBottom) ?? '0px');\n this.renderer.setStyle(this.el.nativeElement, 'margin-left', this.sanitizeCssValue(description.style.marginLeft) ?? '0px');\n this.renderer.setStyle(this.el.nativeElement, 'margin-right', this.sanitizeCssValue(description.style.marginRight) ?? '0px');\n }\n }\n\n private sanitizeCssValue(value: string | undefined): string | undefined {\n if (!value) {\n return value;\n }\n if (/expression\\s*\\(/i.test(value) || /javascript\\s*:/i.test(value) || /[;{}]/.test(value)) {\n return undefined;\n }\n return value;\n }\n\n private sanitizePosition(value: string | undefined): string | undefined {\n if (!value) {\n return value;\n }\n const allowed = ['static', 'relative', 'absolute', 'fixed', 'sticky'];\n return allowed.includes(value.toLowerCase().trim()) ? value : undefined;\n }\n}\n","/*\n The MIT License (MIT)\n\n Copyright (c) 2017-2026 Stefano Cappa (Ks89)\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\n\nimport { ChangeDetectionStrategy, Component, output, input } from '@angular/core';\nimport { NgClass } from '@angular/common';\n\nimport { AccessibleComponent } from '../accessible.component';\n\nimport { AccessibilityConfig } from '../../model/accessibility.interface';\nimport { DotsConfig } from '../../model/dots-config.interface';\n\nimport { NEXT } from '../../utils/user-input.util';\nimport { getIndex } from '../../utils/image.util';\nimport { Image } from '../../model/image.class';\n\n/**\n * Component with clickable dots (small circles) to navigate between images inside the modal gallery.\n */\n@Component({\n selector: 'ks-dots',\n styleUrls: ['dots.scss'],\n templateUrl: 'dots.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [NgClass]\n})\nexport class DotsComponent extends AccessibleComponent {\n /**\n * Unique id (>=0) of the current instance of this library. This is required when you are using\n * the service to call modal gallery.\n */\n readonly id = input.required<number>();\n /**\n * Object of type `InternalLibImage` that represent the visible image.\n */\n readonly currentImage = input.required<Image>();\n /**\n * Array of `InternalLibImage` that represent the model of this library with all images,\n * thumbs and so on.\n */\n readonly images = input.required<Image[]>();\n /**\n * Object of type `DotsConfig` to init DotsComponent's features.\n * For instance, it contains a param to show/hide this component.\n */\n readonly dotsConfig = input.required<DotsConfig>();\n /**\n * Object of type `AccessibilityConfig` to init custom accessibility features.\n * For instance, it contains titles, alt texts, aria-labels and so on.\n */\n readonly accessibilityConfig = input.required<AccessibilityConfig>();\n\n /**\n * Output to emit clicks on dots. The payload contains a number that represent\n * the index of the clicked dot.\n */\n readonly clickDot = output<number>();\n\n /**\n * Method to check if an image is active (i.e. the current image).\n * It checks currentImage and images to prevent errors.\n * @param index number of the image to check if it's active or not\n * @returns boolean true if is active (and input params are valid), false otherwise\n */\n isActive(index: number): boolean {\n const currentImage = this.currentImage();\n const images = this.images();\n if (!currentImage || !images || images.length === 0) {\n return false;\n }\n let imageIndex: number;\n try {\n imageIndex = getIndex(currentImage, images);\n } catch (err) {\n console.error(`Internal error while trying to show the active 'dot'`, err);\n return false;\n }\n return index === imageIndex;\n }\n\n /**\n * Method called by events from keyboard and mouse.\n * @param index number of the dot\n * @param event KeyboardEvent | MouseEvent payload\n */\n onDotEvent(index: number, event: KeyboardEvent | MouseEvent): void {\n const result: number = super.handleImageEvent(event);\n if (result === NEXT) {\n this.clickDot.emit(index);\n }\n }\n}\n","@let accessibilityConf = accessibilityConfig();\n@let dotsConf = dotsConfig();\n<nav class=\"dots-container\" [attr.aria-label]=\"accessibilityConf?.dotsContainerAriaLabel\"\n [title]=\"$safeNavigationMigration(accessibilityConf?.dotsContainerTitle)\">\n @if (!dotsConf || dotsConf?.visible) {\n @for (img of images(); let index = $index; track img.id) {\n <div class=\"inside dot\"\n [ngClass]=\"{'active': isActive(index)}\"\n [attr.aria-label]=\"accessibilityConf?.dotAriaLabel + ' ' + (index + 1)\"\n [tabIndex]=\"0\" role=\"navigation\"\n (click)=\"onDotEvent(index, $event)\" (keyup)=\"onDotEvent(index, $event)\"></div>\n }\n }\n</nav>\n","/*\n The MIT License (MIT)\n\n Copyright (c) 2017-2026 Stefano Cappa (Ks89)\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\n\nimport {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n HostBinding,\n OnChanges,\n OnDestroy,\n OnInit,\n SimpleChange,\n SimpleChanges,\n output,\n input, inject\n} from '@angular/core';\nimport { DomSanitizer, SafeResourceUrl, SafeStyle } from '@angular/platform-browser';\nimport { BreakpointObserver, Breakpoints, BreakpointState } from '@angular/cdk/layout';\n\nimport { Subscription } from 'rxjs';\n\nimport { AccessibleComponent } from '../../accessible.component';\n\nimport { AccessibilityConfig } from '../../../model/accessibility.interface';\nimport { Image, ImageEvent } from '../../../model/image.class';\nimport { CarouselPreviewConfig } from '../../../model/carousel-preview-config.interface';\nimport { CarouselConfig } from '../../../model/carousel-config.interface';\n\nimport { NEXT, PREV } from '../../../utils/user-input.util';\nimport { getIndex } from '../../../utils/image.util';\nimport { Action } from '../../../model/action.enum';\nimport { ConfigService } from '../../../services/config.service';\nimport { LibConfig } from '../../../model/lib-config.interface';\nimport { FallbackImageDirective } from '../../../directives/fallback-image.directive';\nimport { SizeDirective } from '../../../directives/size.directive';\nimport { InternalLibImage } from '../../../model/image-internal.class';\n\n/**\n * Default max height of previews.\n */\nconst DEFAULT_MAX_HEIGHT = '200px';\n\n/**\n * Component with image previews for carousel\n */\n@Component({\n selector: 'ks-carousel-previews',\n styleUrls: ['carousel-previews.scss', '../../previews-arrows.scss'],\n templateUrl: 'carousel-previews.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [FallbackImageDirective, SizeDirective]\n})\nexport class CarouselPreviewsComponent extends AccessibleComponent implements OnInit, OnChanges, OnDestroy {\n /**\n * Variable to change the max-width of the host component\n */\n @HostBinding('style.max-width')\n hostMaxWidth = '100%';\n\n /**\n * Variable to set aria-label of the host component\n */\n @HostBinding('attr.aria-label')\n ariaLabel = `Carousel previews`;\n\n /**\n * Unique id (>=0) of the current instance of the carousel. This is useful when you are using\n * the carousel's feature to open modal gallery.\n */\n readonly id = input.required<number>();\n /**\n * Object of type `Image` that represent the visible image.\n */\n readonly currentImage = input.required<InternalLibImage>();\n /**\n * Array of `Image` that represent the model of this library with all images,\n * thumbs and so on.\n */\n readonly images = input<Image[]>([]);\n\n /**\n * Output to emit the clicked preview. The payload contains the `Image` associated to the clicked preview.\n */\n readonly clickPreview = output<ImageEvent>();\n\n /**\n * Object of type `CarouselConfig` to init CarouselComponent's features.\n * For instance, it contains parameters to change the style, how it navigates and so on.\n */\n carouselConfig: CarouselConfig | undefined;\n /**\n * Object of type `CarouselPreviewConfig` to init PreviewsComponent's features.\n * For instance, it contains a param to show/hide this component, sizes.\n */\n previewConfig: CarouselPreviewConfig | undefined;\n /**\n * Object of type `AccessibilityConfig` to init custom accessibility features.\n * For instance, it contains titles, alt texts, aria-labels and so on.\n */\n accessibilityConfig: AccessibilityConfig | undefined;\n /**\n * Enum of type `Action` that represents a mouse click on a button.\n * Declared here to be used inside the template.\n */\n clickAction: Action = Action.CLICK;\n /**\n * Enum of type `Action` that represents a keyboard action.\n * Declared here to be used inside the template.\n */\n keyboardAction: Action = Action.KEYBOARD;\n /**\n * Array of `Image` exposed to the template. This field is initialized\n * applying transformations, default values and so on to the input of the same type.\n */\n previews: Image[] = [];\n /**\n * Variable with the preview's maxHeight\n */\n previewMaxHeight: string = DEFAULT_MAX_HEIGHT;\n /**\n * Start index (inclusive) of the input images used to display previews.\n */\n // @ts-ignore\n start: number;\n /**\n * End index (exclusive) of the input images used to display previews.\n */\n // @ts-ignore\n end: number;\n\n private readonly breakpointSubscription: Subscription;\n\n private ref: ChangeDetectorRef = inject(ChangeDetectorRef);\n private breakpointObserver: BreakpointObserver = inject(BreakpointObserver);\n private configService: ConfigService = inject(ConfigService);\n\n constructor() {\n super();\n\n // listen for width changes and update preview heights accordingly\n this.breakpointSubscription = this.breakpointObserver\n .observe([Breakpoints.XSmall, Breakpoints.Small, Breakpoints.Medium, Breakpoints.Large, Breakpoints.XLarge])\n .subscribe((result: BreakpointState) => {\n if (!this.previewConfig || !this.previewConfig.breakpoints) {\n return;\n }\n if (result.breakpoints[Breakpoints.XSmall]) {\n this.updateHeight(this.previewConfig.breakpoints.xSmall);\n } else if (result.breakpoints[Breakpoints.Small]) {\n this.updateHeight(this.previewConfig.breakpoints.small);\n } else if (result.breakpoints[Breakpoints.Medium]) {\n this.updateHeight(this.previewConfig.breakpoints.medium);\n } else if (result.breakpoints[Breakpoints.Large]) {\n this.updateHeight(this.previewConfig.breakpoints.large);\n } else if (result.breakpoints[Breakpoints.XLarge]) {\n this.updateHeight(this.previewConfig.breakpoints.xLarge);\n }\n });\n }\n\n /**\n * Method to update the height of previews, passing the desired height as input.\n * @param configBreakpointHeight is a number that represent the desired height to set.\n */\n private updateHeight(configBreakpointHeight: number): void {\n if (this.previewConfig && this.previewConfig.maxHeight) {\n const heightNum: number = +this.previewConfig.maxHeight.replace(/px/g, '').replace(/%/g, '');\n this.previewMaxHeight = Math.min(configBreakpointHeight, heightNum) + 'px';\n } else {\n const heightNum: number = +DEFAULT_MAX_HEIGHT.replace(/px/g, '').replace(/%/g, '');\n this.previewMaxHeight = Math.min(configBreakpointHeight, heightNum) + 'px';\n }\n this.ref.markForCheck();\n }\n\n /**\n * Method `ngOnInit` to build `configPreview` applying a default value and also to\n * init the `previews` array.\n * This is an angular lifecycle hook, so it's called automatically by Angular itself.\n * In particular, it's called only one time!!!\n */\n ngOnInit(): void {\n const libConfig: LibConfig | undefined = this.configService.getConfig(this.id());\n if (!libConfig) {\n throw new Error('Internal library error - libConfig must be defined');\n }\n this.carouselConfig = libConfig.carouselConfig;\n this.previewConfig = libConfig.carouselPreviewsConfig;\n this.accessibilityConfig = libConfig.accessibilityConfig;\n\n if (!this.previewConfig || !this.previewConfig.maxHeight || !this.previewConfig.breakpoints) {\n throw new Error('Internal library error - previewConfig must be defined');\n }\n // change the max-width of this component if there is a specified width !== 100% in carouselConfig\n if (this.carouselConfig && this.carouselConfig.maxWidth !== '100%') {\n this.hostMaxWidth = this.carouselConfig.maxWidth;\n }\n\n this.previewMaxHeight = this.previewConfig.maxHeight;\n // init previews based on currentImage and the full array of images\n this.initPreviews(this.currentImage(), this.images());\n\n // apply custom height based on responsive breakpoints\n // This is required, because the breakpointSubscription is not triggered at creation,\n // but only when the width changes\n const isXsmallScreen = this.breakpointObserver.isMatched(Breakpoints.XSmall);\n const isSmallScreen = this.breakpointObserver.isMatched(Breakpoints.Small);\n const isMediumScreen = this.breakpointObserver.isMatched(Breakpoints.Medium);\n const isLargeScreen = this.breakpointObserver.isMatched(Breakpoints.Large);\n const isxLargeScreen = this.breakpointObserver.isMatched(Breakpoints.XLarge);\n if (isXsmallScreen) {\n this.updateHeight(this.previewConfig.breakpoints.xSmall);\n } else if (isSmallScreen) {\n this.updateHeight(this.previewConfig.breakpoints.small);\n } else if (isMediumScreen) {\n this.updateHeight(this.previewConfig.breakpoints.medium);\n } else if (isLargeScreen) {\n this.updateHeight(this.previewConfig.breakpoints.large);\n } else if (isxLargeScreen) {\n this.updateHeight(this.previewConfig.breakpoints.xLarge);\n }\n }\n\n /**\n * Method to check if an image is active (i.e. a preview image).\n * @param preview Image is an image to check if it's active or not\n * @returns boolean true if is active, false otherwise\n */\n isActive(preview: Image): boolean {\n const currentImage = this.currentImage();\n if (!preview || !currentImage) {\n return false;\n }\n return preview.id === currentImage.id;\n }\n\n /**\n * Method `ngOnChanges` to update `previews` array.\n * Also, both `start` and `end` local variables will be updated accordingly.\n * This is an angular lifecycle hook, so it's called automatically by Angular itself.\n * In particular, it's called when any data-bound property of a directive changes!!!\n */\n ngOnChanges(changes: SimpleChanges): void {\n const simpleChange: SimpleChange = changes['currentImage'];\n if (!simpleChange) {\n return;\n }\n\n const prev: Image = simpleChange.previousValue;\n const current: Image = simpleChange.currentValue;\n\n if (current && changes['images'] && changes['images'].previousValue && changes['images'].currentValue) {\n // I'm in this if statement, if input images are changed (for instance, because I removed one of them with the 'delete button',\n // or because users changed the images array while modal gallery is still open).\n // In this case, I have to re-init previews, because the input array of images is changed.\n this.initPreviews(current, changes['images'].currentValue);\n }\n\n if (prev && current && prev.id !== current.id) {\n // to manage infinite sliding I have to reset both `start` and `end` at the beginning\n // to show again previews from the first image.\n // This happens when you navigate over the last image to return to the first one\n let prevIndex: number;\n let currentIndex: number;\n try {\n prevIndex = getIndex(prev, this.images());\n currentIndex = getIndex(current, this.images());\n } catch (err) {\n console.error('Cannot get previous and current image indexes in previews');\n throw err;\n }\n\n // apply a formula to get a values to be used to decide if go next, return back or stay without doing anything\n const calc = Math.floor((this.end - this.start) / 2) + this.start;\n\n const images = this.images();\n if (prevIndex === images.length - 1 && currentIndex === 0) {\n // first image\n this.setBeginningIndexesPreviews();\n this.previews = images.filter((img: Image, i: number) => i >= this.start && i < this.end);\n return;\n }\n // the same for the opposite case, when you navigate back from the fist image to go to the last one.\n if (prevIndex === 0 && currentIndex === images.length - 1) {\n // last image\n this.setEndIndexesPreviews();\n this.previews = images.filter((img: Image, i: number) => i >= this.start && i < this.end);\n return;\n }\n\n if (this.previewConfig && (this.previewConfig.number as number) % 2 === 0) {\n if (calc > currentIndex) {\n this.previous();\n } else {\n this.next();\n }\n } else {\n if (calc > currentIndex) {\n this.previous();\n }\n if (calc < currentIndex) {\n this.next();\n }\n }\n }\n }\n\n /**\n * Method called by events from both keyboard and mouse on a preview.\n * This will trigger the `clickpreview` output with the input preview as its payload.\n * @param preview Image that triggered this method\n * @param event KeyboardEvent | MouseEvent payload\n * @param action Action that triggered this event (Action.NORMAL by default)\n */\n onImageEvent(preview: Image, event: KeyboardEvent | MouseEvent, action: Action = Action.NORMAL): void {\n if (!this.previewConfig || !this.previewConfig.clickable) {\n return;\n }\n const clickedImageIndex: number = this.images().indexOf(preview);\n const result: number = super.handleImageEvent(event);\n if (result === NEXT) {\n this.clickPreview.emit({ action, result: clickedImageIndex } as ImageEvent);\n } else if (result === PREV) {\n this.clickPreview.emit({ action, result: clickedImageIndex } as ImageEvent);\n }\n }\n\n /**\n * Method called by events from both keyboard and mouse on a navigation arrow.\n * @param direction string of the navigation that can be either 'next' or 'prev'\n * @param event KeyboardEvent | MouseEvent payload\n */\n onNavigationEvent(direction: string, event: KeyboardEvent | MouseEvent): void {\n const result: number = super.handleNavigationEvent(direction, event);\n if (result === NEXT) {\n this.next();\n } else if (result === PREV) {\n this.previous();\n }\n }\n\n /**\n * Method to get aria-label text for a preview image.\n * @param preview Image is the preview\n */\n getAriaLabel(preview: Image): string {\n if (!preview.plain) {\n return preview.modal.ariaLabel || '';\n }\n return preview.plain.ariaLabel || preview.modal.ariaLabel || '';\n }\n\n /**\n * Method to get title text for a preview image.\n * @param preview Image is the preview\n */\n getTitle(preview: Image): string {\n if (!preview.plain) {\n return preview.modal.title || '';\n }\n return preview.plain.title || preview.modal.title || '';\n }\n\n /**\n * Method to get alt text for a preview image.\n * @param preview Image is the preview\n */\n getAlt(preview: Image): string {\n if (!preview.plain) {\n return preview.modal.alt || '';\n }\n return preview.plain.alt || preview.modal.alt || '';\n }\n\n /**\n * Method to cleanup resources. In fact, it cleans breakpointSubscription.\n * This is an angular lifecycle hook that is called when this component is destroyed.\n */\n ngOnDestroy(): void {\n if (this.breakpointSubscription) {\n this.breakpointSubscription.unsubscribe();\n }\n }\n\n /**\n * Private method to init previews based on the currentImage and the full array of images.\n * The current image is mandatory to always show the current preview highlighted.\n * @param currentImage Image to decide how to show previews, because I always want to see the current image as highlighted\n * @param images Image[] is the array of all images.\n */\n private initPreviews(currentImage: Image, images: Image[]): void {\n let index: number;\n try {\n index = getIndex(currentImage, images);\n } catch (err) {\n throw err;\n }\n switch (index) {\n case 0:\n // first image\n this.setBeginningIndexesPreviews();\n break;\n case images.length - 1:\n // last image\n this.setEndIndexesPreviews();\n break;\n // default:\n // // other images\n // // TODO unused because it starts always at image 0\n // this.setIndexesPreviews();\n // break;\n }\n this.previews = images.filter((img: Image, i: number) => i >= this.start && i < this.end);\n }\n\n /**\n * Private method to init both `start` and `end` to the beginning.\n */\n private setBeginningIndexesPreviews(): void {\n if (!this.previewConfig || this.previewConfig.number === undefined) {\n throw new Error('Internal library error - previewConfig and number must be defined');\n }\n\n this.start = 0;\n this.end = Math.min(this.previewConfig.number as number, this.images().length);\n }\n\n /**\n * Private method to init both `start` and `end` to the end.\n */\n private setEndIndexesPreviews(): void {\n if (!this.previewConfig || this.previewConfig.number === undefined) {\n throw new Error('Internal library error - previewConfig and number must be defined');\n }\n\n this.start = this.images().length - 1 - ((this.previewConfig.number as number) - 1);\n this.end = this.images().length;\n }\n\n /**\n * Private method to update the visible previews navigating to the right (next).\n */\n private next(): void {\n // check if nextImage should be blocked\n const images = this.images();\n if (this.isPreventSliding(images.length - 1)) {\n return;\n }\n\n if (this.end === images.length) {\n return;\n }\n\n this.start++;\n this.end = Math.min(this.end + 1, images.length);\n\n this.previews = images.filter((img: Image, i: number) => i >= this.start && i < this.end);\n }\n\n /**\n * Private method to update the visible previews navigating to the left (previous).\n */\n private previous(): void {\n // check if prevImage should be blocked\n if (this.isPreventSliding(0)) {\n return;\n }\n\n if (this.start === 0) {\n return;\n }\n\n this.start = Math.max(this.start - 1, 0);\n this.end = Math.min(this.end - 1, this.images().length);\n\n this.previews = this.images().filter((img: Image, i: number) => i >= this.start && i < this.end);\n }\n\n /**\n * Private method to block/permit sliding between previews.\n * @param boundaryIndex number is the first or the last index of `images` input array\n * @returns boolean if true block sliding, otherwise not\n */\n private isPreventSliding(boundaryIndex: number): boolean {\n return getIndex(this.currentImage(), this.images()) === boundaryIndex;\n }\n}\n","@if (previewConfig?.visible) {\n <nav class=\"previews-container\"\n [attr.aria-label]=\"accessibilityConfig?.carouselPreviewsContainerAriaLabel\"\n [title]=\"$safeNavigationMigration(accessibilityConfig?.carouselPreviewsContainerTitle)\">\n\n <a class=\"nav-left\"\n [attr.aria-label]=\"accessibilityConfig?.carouselPreviewScrollPrevAriaLabel\"\n [tabIndex]=\"previewConfig?.arrows && start > 0 ? 0 : -1\" role=\"button\"\n (click)=\"onNavigationEvent('left', $event)\" (keyup)=\"onNavigationEvent('left', $event)\">\n <div class=\"inside {{previewConfig?.arrows && start > 0 ? 'left-arrow-preview-image' : 'empty-arrow-preview-image'}}\"\n aria-hidden=\"true\"\n [title]=\"$safeNavigationMigration(accessibilityConfig?.carouselPreviewScrollPrevTitle)\"></div>\n </a>\n\n <div class=\"preview-inner-container\">\n @for (preview of previews; track preview.id) {\n @if (preview?.modal?.img) {\n <img loading=\"{{preview.loading}}\"\n [attr.fetchpriority]=\"preview.fetchpriority\"\n class=\"inside preview-image{{isActive(preview) ? ' active' : ''}}{{!previewConfig?.clickable ? ' unclickable' : ''}}\"\n [src]=\"preview.plain?.img ? $safeNavigationMigration(preview.plain?.img) : preview.modal.img\"\n ksFallbackImage [fallbackImg]=\"preview.plain?.fallbackImg ? $safeNavigationMigration(preview.plain?.fallbackImg) : preview.modal.fallbackImg\"\n ksSize [sizeConfig]=\"{width: $safeNavigationMigration(previewConfig?.width)!,\n height: previewMaxHeight}\"\n [attr.aria-label]=\"getAriaLabel(preview)\"\n [title]=\"getTitle(preview)\"\n alt=\"{{getAlt(preview)}}\"\n [tabIndex]=\"0\" role=\"img\"\n (click)=\"onImageEvent(preview, $event, clickAction)\" (keyup)=\"onImageEvent(preview, $event, keyboardAction)\" />\n }\n }\n </div>\n\n <a class=\"nav-right\"\n [attr.aria-label]=\"accessibilityConfig?.carouselPreviewScrollNextAriaLabel\"\n [tabIndex]=\"previewConfig?.arrows && end < images().length ? 0 : -1\" role=\"button\"\n (click)=\"onNavigationEvent('right', $event)\" (keyup)=\"onNavigationEvent('right', $event)\">\n <div class=\"inside {{previewConfig?.arrows && end < images().length ? 'right-arrow-preview-image' : 'empty-arrow-preview-image'}}\"\n aria-hidden=\"true\"\n [title]=\"$safeNavigationMigration(accessibilityConfig?.carouselPreviewScrollNextTitle)\"></div>\n </a>\n </nav>\n}\n","/*\n The MIT License (MIT)\n\n Copyright (c) 2017-2026 Stefano Cappa (Ks89)\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\n\n// The idea to create a carousel with two Subjects came from ng-bootstrap\n// So a big thank you to the ng-bootstrap team for the interesting implementation that I used here with some customizations.\n\nimport {\n AfterContentInit,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n DestroyRef,\n HostBinding,\n HostListener, inject,\n NgZone,\n OnChanges,\n OnDestroy,\n OnInit,\n PLATFORM_ID,\n SimpleChange,\n SimpleChanges,\n output,\n input\n} from '@angular/core';\nimport { isPlatformBrowser, NgTemplateOutlet } from '@angular/common';\nimport { SecurityContext } from '@angular/core';\nimport { DomSanitizer, SafeHtml } from '@angular/platform-browser';\n\nimport { Subject, timer } from 'rxjs';\nimport { filter, map, switchMap, takeUntil } from 'rxjs/operators';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\n\nimport { AccessibleComponent } from '../accessible.component';\n\nimport { AccessibilityConfig } from '../../model/accessibility.interface';\nimport { Image, ImageEvent } from '../../model/image.class';\nimport { Action } from '../../model/action.enum';\nimport { getIndex } from '../../utils/image.util';\nimport { NEXT, PREV } from '../../utils/user-input.util';\nimport { DescriptionStrategy } from '../../model/description.interface';\nimport { DotsConfig } from '../../model/dots-config.interface';\nimport { CarouselConfig } from '../../model/carousel-config.interface';\nimport { CarouselImageConfig } from '../../model/carousel-image-config.interface';\nimport { ConfigService } from '../../services/config.service';\nimport { CarouselLibConfig, LibConfig } from '../../model/lib-config.interface';\nimport { InternalLibImage } from '../../model/image-internal.class';\nimport { MaxSizeDirective } from '../../directives/max-size.directive';\nimport { SizeDirective } from '../../directives/size.directive';\nimport { FallbackImageDirective } from '../../directives/fallback-image.directive';\nimport { DescriptionDirective } from '../../directives/description.directive';\nimport { DotsComponent } from '../dots/dots.component';\nimport { CarouselPreviewsComponent } from './carousel-previews/carousel-previews.component';\n\n/**\n * Component with configurable inline/plain carousel.\n */\n@Component({\n selector: 'ks-carousel',\n styleUrls: ['carousel.scss', '../image-arrows.scss'],\n templateUrl: 'carousel.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [ConfigService],\n imports: [MaxSizeDirective, SizeDirective, NgTemplateOutlet,\n FallbackImageDirective, DescriptionDirective, DotsComponent, CarouselPreviewsComponent]\n})\nexport class CarouselComponent extends AccessibleComponent implements OnInit, AfterContentInit, OnDestroy, OnChanges {\n /**\n * Attribute to set ariaLabel of the host component\n */\n @HostBinding('attr.aria-label')\n ariaLabel = `Carousel`;\n /**\n * Unique id (>=0) of the current instance of the carousel. This is useful when you are using\n * the carousel's feature to open modal gallery.\n */\n readonly id = input.required<number>();\n /**\n * Array of `InternalLibImage` that represent the model of this library with all images,\n * thumbs and so on.\n */\n readonly images = input<Image[]>([]);\n /**\n * CarouselLibConfig object to configure carousel.\n */\n readonly config = input<CarouselLibConfig>();\n\n /**\n * Output to emit an event when an image is clicked.\n */\n readonly clickImage = output<number>();\n /**\n * Output to emit an event when current image is changed.\n */\n readonly changeImage = output<ImageEvent>();\n /**\n * Output to emit an event when the current image is the first one.\n */\n readonly firstImage = output<ImageEvent>();\n /**\n * Output to emit an event when the current image is the last one.\n */\n readonly lastImage = output<ImageEvent>();\n\n /**\n * Object of type `CarouselConfig` to init CarouselComponent's features.\n * For instance, it contains parameters to change the style, how it navigates and so on.\n */\n carouselConfig: CarouselConfig | undefined;\n\n /**\n * Object of type `DotsConfig` to init DotsComponent's features.\n * For instance, it contains a param to show/hide this component.\n */\n carouselDotsConfig: DotsConfig | undefined;\n /**\n * Object of type `AccessibilityConfig` to init custom accessibility features.\n * For instance, it contains titles, alt texts, aria-labels and so on.\n */\n accessibilityConfig: AccessibilityConfig | undefined;\n /**\n * Object of type `CarouselImageConfig` to configure the current image of the carousel.\n */\n carouselImageConfig: CarouselImageConfig | undefined;\n /**\n * Enable/disable infinite sliding.\n */\n carouselSlideInfinite: boolean | undefined;\n\n /**\n * Enum of type `Action` that represents a mouse click on a button.\n * Declared here to be used inside the template.\n */\n clickAction: Action = Action.CLICK;\n /**\n * Enum of type `Action` that represents a keyboard action.\n * Declared here to be used inside the template.\n */\n keyboardAction: Action = Action.KEYBOARD;\n /**\n * `Image` that is visible right now.\n */\n currentImage: InternalLibImage | undefined;\n /**\n * Boolean that is true when you are viewing the first image (currently visible).\n * False by default\n */\n isFirstImage = false;\n /**\n * Boolean that is true when you are viewing the last image (currently visible).\n * False by default\n */\n isLastImage = false;\n\n /**\n * Subject to play the carousel.\n */\n private start$ = new Subject<void>();\n /**\n * Subject to stop the carousel.\n */\n private stop$ = new Subject<void>();\n\n private readonly platformId: Object = inject(PLATFORM_ID);\n private readonly destroyRef: DestroyRef = inject(DestroyRef);\n private readonly sanitizer: DomSanitizer = inject(DomSanitizer);\n\n /**\n * Listener to stop the gallery when the mouse pointer is over the current image.\n */\n @HostListener('mouseenter')\n onMouseEnter(): void {\n const id = this.id();\n if (id === null || id === undefined) {\n throw new Error('Internal library error - id must be defined');\n }\n const libConfig: LibConfig | undefined = this.configService.getConfig(id);\n if (!libConfig) {\n throw new Error('Internal library error - libConfig must be defined');\n }\n if (!libConfig.carouselPlayConfig || !libConfig.carouselPlayConfig.pauseOnHover) {\n return;\n }\n this.stopCarousel();\n }\n\n /**\n * Listener to play the gallery when the mouse pointer leave the current image.\n */\n @HostListener('mouseleave')\n onMouseLeave(): void {\n const id = this.id();\n if (id === null || id === undefined) {\n throw new Error('Internal library error - id must be defined');\n }\n const libConfig: LibConfig | undefined = this.configService.getConfig(id);\n if (!libConfig) {\n throw new Error('Internal library error - libConfig must be defined');\n }\n if (!libConfig.carouselPlayConfig || !libConfig.carouselPlayConfig.pauseOnHover || !libConfig.carouselPlayConfig.autoPlay) {\n return;\n }\n this.playCarousel();\n }\n\n /**\n * Listener to navigate carousel images with keyboard (left).\n */\n @HostListener('keydown.arrowLeft')\n onKeyDownLeft(): void {\n const id = this.id();\n if (id === null || id === undefined) {\n throw new Error('Internal library error - id must be defined');\n }\n const libConfig: LibConfig | undefined = this.configService.getConfig(id);\n if (!libConfig) {\n throw new Error('Internal library error - libConfig must be defined');\n }\n if (!libConfig.carouselConfig || !libConfig.carouselConfig.keyboardEnable) {\n return;\n }\n this.prevImage();\n }\n\n /**\n * Listener to navigate carousel images with keyboard (right).\n */\n @HostListener('keydown.arrowRight')\n onKeyDownLRight(): void {\n const id = this.id();\n if (id === null || id === undefined) {\n throw new Error('Internal library error - id must be defined');\n }\n const libConfig: LibConfig | undefined = this.configService.getConfig(id);\n if (!libConfig) {\n throw new Error('Internal library error - libConfig must be defined');\n }\n if (!libConfig.carouselConfig || !libConfig.carouselConfig.keyboardEnable) {\n return;\n }\n this.nextImage();\n }\n\n constructor(\n private ngZone: NgZone,\n private configService: ConfigService,\n private ref: ChangeDetectorRef\n ) {\n super();\n }\n\n ngOnInit(): void {\n const id = this.id();\n if (id === null || id === undefined) {\n throw new Error('Internal library error - id must be defined');\n }\n const images = this.images();\n if (!images || images.length === 0) {\n throw new Error('Internal library error - images array must be defined and with at least an element');\n }\n this.configService.setConfig(id, this.config());\n\n const libConfig: LibConfig | undefined = this.configService.getConfig(id);\n if (!libConfig) {\n throw new Error('Internal library error - libConfig must be defined');\n }\n\n this.currentImage = images[0] as InternalLibImage;\n this.carouselDotsConfig = libConfig.carouselDotsConfig;\n this.accessibilityConfig = libConfig.accessibilityConfig;\n this.carouselSlideInfinite = libConfig.carouselSlideInfinite;\n this.carouselConfig = libConfig.carouselConfig;\n this.carouselImageConfig = libConfig.carouselImageConfig;\n\n this.manageSlideConfig();\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n const id = this.id();\n if (id === null || id === undefined) {\n throw new Error('Internal library error - id must be defined');\n }\n\n // this.configService.setConfig(this.id, this.config);\n const libConfig: LibConfig | undefined = this.configService.getConfig(id);\n if (!libConfig) {\n throw new Error('Internal library error - libConfig must be defined');\n }\n\n const configChange: SimpleChange = changes['config'];\n\n // handle changes of dotsConfig.visible\n if (configChange &&\n !configChange.firstChange &&\n (configChange.previousValue.carouselDotsConfig?.visible !== configChange.currentValue.carouselDotsConfig?.visible || (!configChange.previousValue.carouselDotsConfig && !configChange.currentValue.carouselDotsConfig))\n ) {\n this.configService.setConfig(id, {\n carouselDotsConfig: configChange.currentValue?.carouselDotsConfig\n });\n this.carouselDotsConfig = configChange.currentValue?.carouselDotsConfig;\n this.ref.markForCheck();\n }\n // handle changes of carouselConfig.showArrows\n if (configChange &&\n !configChange.firstChange &&\n (configChange.previousValue.carouselConfig?.showArrows !== configChange.currentValue.carouselConfig?.showArrows || (!configChange.previousValue.carouselConfig && !configChange.currentValue.carouselConfig))\n ) {\n this.configService.setConfig(id, {\n carouselConfig: configChange.currentValue?.carouselConfig\n });\n this.carouselConfig = configChange.currentValue?.carouselConfig;\n this.ref.markForCheck();\n }\n // handle changes of playConfig starting/stopping the carousel accordingly\n if (configChange &&\n !configChange.firstChange &&\n (configChange.previousValue.carouselPlayConfig?.autoPlay !== configChange.currentValue.carouselPlayConfig?.autoPlay || (!configChange.previousValue.carouselPlayConfig && !configChange.currentValue.carouselPlayConfig))\n ) {\n this.configService.setConfig(id, {\n carouselPlayConfig: configChange.currentValue?.carouselPlayConfig\n });\n // this.configPlay = playConfigChange.currentValue;\n // if autoplay is enabled, and this is not the\n // first change (to prevent multiple starts at the beginning)\n if (configChange.currentValue.carouselPlayConfig?.autoPlay && !configChange.firstChange) {\n this.start$.next();\n } else {\n this.stopCarousel();\n }\n this.ref.markForCheck();\n }\n }\n\n ngAfterContentInit(): void {\n // interval doesn't play well with SSR and protractor,\n // so we should run it in the browser and outside Angular\n if (isPlatformBrowser(this.platformId)) {\n const id = this.id();\n if (id === null || id === undefined) {\n throw new Error('Internal library error - id must be defined');\n }\n const libConfig: LibConfig | undefined = this.configService.getConfig(id);\n if (!libConfig || !libConfig.carouselPlayConfig) {\n throw new Error('Internal library error - libConfig and carouselPlayConfig must be defined');\n }\n this.ngZone.runOutsideAngular(() => {\n this.start$\n .pipe(\n map(() => libConfig?.carouselPlayConfig?.interval),\n // tslint:disable-next-line:no-any\n filter((interval: any) => interval > 0),\n switchMap(interval => timer(interval).pipe(takeUntil(this.stop$))),\n takeUntilDestroyed(this.destroyRef)\n )\n .subscribe(() =>\n this.ngZone.run(() => {\n if (libConfig.carouselPlayConfig?.autoPlay) {\n this.nextImage();\n }\n this.ref.markForCheck();\n })\n );\n\n this.start$.next();\n });\n }\n }\n\n /**\n * Method called when a dot is clicked and used to update the current image.\n * @param index number of the clicked dot\n */\n onClickDot(index: number): void {\n this.changeCurrentImage(this.images()[index] as InternalLibImage, Action.NORMAL);\n }\n\n /**\n * Method called by events from both keyboard and mouse on a navigation arrow.\n * @param direction string of the navigation that can be either 'next' or 'prev'\n * @param event KeyboardEvent | MouseEvent payload\n * @param action Action that triggered the event or `Action.NORMAL` if not provided\n */\n onNavigationEvent(direction: string, event: KeyboardEvent | MouseEvent, action: Action = Action.NORMAL): void {\n const result: number = super.handleNavigationEvent(direction, event);\n if (result === NEXT) {\n this.nextImage(action);\n } else if (result === PREV) {\n this.prevImage(action);\n }\n }\n\n /**\n * Method triggered when you click on the current image.\n * Also, if modalGalleryEnable is true, you can open the modal-gallery.\n */\n onClickCurrentImage(): void {\n const id = this.id();\n if (id === null || id === undefined) {\n throw new Error('Internal library error - id must be defined');\n }\n const libConfig: LibConfig | undefined = this.configService.getConfig(id);\n if (!libConfig || !libConfig.carouselConfig || !this.currentImage) {\n throw new Error('Internal library error - libConfig, carouselConfig and currentImage must be defined');\n }\n if (!libConfig.carouselConfig.modalGalleryEnable) {\n return;\n }\n const index = getIndex(this.currentImage, this.images());\n this.clickImage.emit(index);\n }\n\n /**\n * Method to get the image description based on input params.\n * If you provide a full description this will be the visible description, otherwise,\n * it will be built using the `Description` object, concatenating its fields.\n * @param image Image to get its description. If not provided it will be the current image\n * @returns String description of the image (or the current image if not provided)\n * @throws an Error if description isn't available\n */\n getDescriptionToDisplay(image: Image | undefined = this.currentImage): SafeHtml {\n const id = this.id();\n if (id === null || id === undefined) {\n throw new Error('Internal library error - id must be defined');\n }\n const libConfig: LibConfig | undefined = this.configService.getConfig(id);\n if (!libConfig) {\n throw new Error('Internal library error - libConfig must be defined');\n }\n const configCurrentImageCarousel: CarouselImageConfig | undefined = libConfig.carouselImageConfig;\n if (!configCurrentImageCarousel || !configCurrentImageCarousel.description) {\n throw new Error('Description input must be a valid object implementing the Description interface');\n }\n if (!image) {\n throw new Error('Internal library error - image must be defined');\n }\n const imageWithoutDescription: boolean = !image || !image.modal || !image.modal.description || image.modal.description === '';\n\n switch (configCurrentImageCarousel.description.strategy) {\n case DescriptionStrategy.HIDE_IF_EMPTY:\n return this.sanitizer.sanitize(SecurityContext.HTML, imageWithoutDescription ? '' : image.modal.description + '') ?? '';\n case DescriptionStrategy.ALWAYS_HIDDEN:\n return '';\n default:\n // ----------- DescriptionStrategy.ALWAYS_VISIBLE -----------------\n return this.sanitizer.sanitize(SecurityContext.HTML, this.buildTextDescription(image, imageWithoutDescription)) ?? '';\n }\n }\n\n /**\n * Method used by SwipeDirective to support touch gestures (you can also invert the swipe direction with configCurrentImage.invertSwipe).\n * @param action String that represent the direction of the swipe action. 'swiperight' by default.\n */\n swipe(action = 'swiperight'): void {\n const id = this.id();\n if (id === null || id === undefined) {\n throw new Error('Internal library error - id must be defined');\n }\n const libConfig: LibConfig | undefined = this.configService.getConfig(id);\n if (!libConfig || !libConfig.carouselImageConfig) {\n throw new Error('Internal library error - libConfig and carouselImageConfig must be defined');\n }\n const configCurrentImageCarousel: CarouselImageConfig = libConfig.carouselImageConfig;\n switch (action) {\n case 'swiperight':\n if (configCurrentImageCarousel.invertSwipe) {\n this.prevImage(Action.SWIPE);\n } else {\n this.nextImage(Action.SWIPE);\n }\n break;\n case 'swipeleft':\n if (configCurrentImageCarousel.invertSwipe) {\n this.nextImage(Action.SWIPE);\n } else {\n this.prevImage(Action.SWIPE);\n }\n break;\n // case this.SWIPE_ACTION.UP:\n // break;\n // case this.SWIPE_ACTION.DOWN:\n // break;\n }\n }\n\n /**\n * Method to go back to the previous image.\n * @param action Enum of type `Action` that represents the source\n * action that moved back to the previous image. `Action.NORMAL` by default.\n */\n prevImage(action: Action = Action.NORMAL): void {\n // check if prevImage should be blocked\n if (this.isPreventSliding(0)) {\n return;\n }\n this.changeCurrentImage(this.getPrevImage(), action);\n\n this.manageSlideConfig();\n\n this.start$.next();\n }\n\n /**\n * Method to go back to the previous image.\n * @param action Enum of type `Action` that represents the source\n * action that moved to the next image. `Action.NORMAL` by default.\n */\n nextImage(action: Action = Action.NORMAL): void {\n // check if nextImage should be blocked\n if (this.isPreventSliding(this.images().length - 1)) {\n return;\n }\n this.changeCurrentImage(this.getNextImage(), action);\n\n this.manageSlideConfig();\n\n this.start$.next();\n }\n\n /**\n * Method called when an image preview is clicked and used to update the current image.\n * @param event an ImageEvent object with the relative action and the index of the clicked preview.\n */\n onClickPreview(event: ImageEvent): void {\n const imageFound: InternalLibImage = this.images()[event.result as number] as InternalLibImage;\n if (!!imageFound) {\n this.manageSlideConfig();\n this.changeCurrentImage(imageFound, event.action);\n }\n }\n\n /**\n * Method to play carousel.\n */\n playCarousel(): void {\n this.start$.next();\n }\n\n /**\n * Stops the carousel from cycling through items.\n */\n stopCarousel(): void {\n this.stop$.next();\n }\n\n // TODO remove this because duplicated\n /**\n * Method to get `alt attribute`.\n * `alt` specifies an alternate text for an image, if the image cannot be displayed.\n * @param image Image to get its alt description. If not provided it will be the current image\n * @returns String alt description of the image (or the current image if not provided)\n */\n getAltDescriptionByImage(image: Image | undefined = this.currentImage): string {\n if (!image) {\n return '';\n }\n return image.modal && image.modal.description ? image.modal.description : `Image ${getIndex(image, this.images()) + 1}`;\n }\n\n // TODO remove this because duplicated\n /**\n * Method to get the title attributes based on descriptions.\n * This is useful to prevent accessibility issues, because if DescriptionStrategy is ALWAYS_HIDDEN,\n * it prevents an empty string as title.\n * @param image Image to get its description. If not provided it will be the current image\n * @returns String title of the image based on descriptions\n * @throws an Error if description isn't available\n */\n getTitleToDisplay(image: Image | undefined = this.currentImage): string {\n const id = this.id();\n if (id === null || id === undefined) {\n throw new Error('Internal library error - id must be defined');\n }\n const libConfig: LibConfig | undefined = this.configService.getConfig(id);\n if (!libConfig || !libConfig.carouselImageConfig) {\n throw new Error('Internal library error - libConfig and carouselImageConfig must be defined');\n }\n const configCurrentImageCarousel: CarouselImageConfig = libConfig.carouselImageConfig;\n if (!configCurrentImageCarousel || !configCurrentImageCarousel.description) {\n throw new Error('Description input must be a valid object implementing the Description interface');\n }\n const imageWithoutDescription: boolean = !image || !image.modal || !image.modal.description || image.modal.description === '';\n return this.buildTextDescription(image, imageWithoutDescription);\n }\n\n /**\n * Method to reset carousel (force image with index 0 to be the current image and re-init also previews)\n */\n // temporary removed because never tested\n // reset() {\n // if (this.configPlay && this.configPlay.autoPlay) {\n // this.stopCarousel();\n // }\n // this.currentImage = this.images[0];\n // this.handleBoundaries(0);\n // if (this.configPlay && this.configPlay.autoPlay) {\n // this.playCarousel();\n // }\n // this.ref.markForCheck();\n // }\n\n /**\n * Method to clean up resources. In fact, this will stop the carousel.\n * This is an angular lifecycle hook that is called when this component is destroyed.\n */\n ngOnDestroy(): void {\n this.stopCarousel();\n this.start$.complete();\n this.stop$.complete();\n }\n\n /**\n * Method to change the current image, receiving the new image as input the relative action.\n * @param image an Image object that represents the new image to set as current.\n * @param action Enum of type `Action` that represents the source action that triggered the change.\n */\n private changeCurrentImage(image: InternalLibImage, action: Action): void {\n const id = this.id();\n if (id === null || id === undefined) {\n throw new Error('Internal library error - id must be defined');\n }\n this.currentImage = image;\n const index: number = getIndex(image, this.images());\n\n // emit first/last event based on newIndex value\n this.emitBoundaryEvent(action, index);\n\n // emit current visible image index\n this.changeImage.emit(new ImageEvent(id, action, index + 1));\n }\n\n /**\n * Private method to get the next index.\n * This is necessary because at the end, when you call next again, you will return to the first image.\n * That happens because all modal images are shown like in a circle.\n */\n private getNextImage(): InternalLibImage {\n if (!this.currentImage) {\n throw new Error('Internal library error - currentImage must be defined');\n }\n const currentIndex: number = getIndex(this.currentImage, this.images());\n let newIndex;\n if (currentIndex >= 0 && currentIndex < this.images().length - 1) {\n newIndex = currentIndex + 1;\n } else {\n newIndex = 0; // start from the first index\n }\n return this.images()[newIndex] as InternalLibImage;\n }\n\n /**\n * Private method to get the previous index.\n * This is necessary because at index 0, when you call prev again, you'll go to the last image.\n * That happens because all modal images are shown like in a circle.\n */\n private getPrevImage(): InternalLibImage {\n if (!this.currentImage) {\n throw new Error('Internal library error - currentImage must be defined');\n }\n const currentIndex: number = getIndex(this.currentImage, this.images());\n let newIndex;\n if (currentIndex > 0 && currentIndex <= this.images().length - 1) {\n newIndex = currentIndex - 1;\n } else {\n newIndex = this.images().length - 1; // start from the last index\n }\n return this.images()[newIndex] as InternalLibImage;\n }\n\n /**\n * Private method to build a text description.\n * This is used also to create titles.\n * @param image Image to get its description. If not provided it will be the current image.\n * @param imageWithoutDescription boolean is a boolean that it's true if the image hasn't a 'modal' description.\n * @returns String description built concatenating image fields with a specific logic.\n */\n private buildTextDescription(image: Image | undefined, imageWithoutDescription: boolean): string {\n const id = this.id();\n if (id === null || id === undefined) {\n throw new Error('Internal library error - id must be defined');\n }\n const libConfig: LibConfig | undefined = this.configService.getConfig(id);\n if (!libConfig || !libConfig.carouselImageConfig) {\n throw new Error('Internal library error - libConfig and carouselImageConfig must be defined');\n }\n const configCurrentImageCarousel: CarouselImageConfig | undefined = libConfig.carouselImageConfig;\n if (!configCurrentImageCarousel || !configCurrentImageCarousel.description) {\n throw new Error('Description input must be a valid object implementing the Description interface');\n }\n if (!image) {\n throw new Error('Internal library error - image must be defined');\n }\n\n // If customFullDescription use it, otherwise proceed to build a description\n if (configCurrentImageCarousel.description.customFullDescription && configCurrentImageCarousel.description.customFullDescription !== '') {\n return configCurrentImageCarousel.description.customFullDescription;\n }\n\n const currentIndex: number = getIndex(image, this.images());\n // If the current image hasn't a description,\n // prevent to write the ' - ' (or this.description.beforeTextDescription)\n\n const prevDescription: string = configCurrentImageCarousel.description.imageText ? configCurrentImageCarousel.description.imageText : '';\n const midSeparator: string = configCurrentImageCarousel.description.numberSeparator ? configCurrentImageCarousel.description.numberSeparator : '';\n const middleDescription: string = currentIndex + 1 + midSeparator + this.images().length;\n\n if (imageWithoutDescription) {\n return prevDescription + middleDescription;\n }\n\n const currImgDescription: string = image.modal && image.modal.description ? image.modal.description : '';\n const endDescription: string = configCurrentImageCarousel.description.beforeTextDescription + currImgDescription;\n return prevDescription + middleDescription + endDescription;\n }\n\n /**\n * Private method to update both `isFirstImage` and `isLastImage` based on\n * the index of the current image.\n * @param currentIndex number is the index of the current image\n */\n private handleBoundaries(currentIndex: number): void {\n const images = this.images();\n if (images.length === 1) {\n this.isFirstImage = true;\n this.isLastImage = true;\n return;\n }\n switch (currentIndex) {\n case 0:\n // execute this only if infinite sliding is disabled\n this.isFirstImage = true;\n this.isLastImage = false;\n break;\n case images.length - 1:\n // execute this only if infinite sliding is disabled\n this.isFirstImage = false;\n this.isLastImage = true;\n break;\n default:\n this.isFirstImage = false;\n this.isLastImage = false;\n break;\n }\n }\n\n /**\n * Private method to manage boundary arrows and sliding.\n * This is based on the slideConfig input to enable/disable 'infinite sliding'.\n */\n private manageSlideConfig(): void {\n const id = this.id();\n if (id === null || id === undefined) {\n throw new Error('Internal library error - id must be defined');\n }\n const libConfig: LibConfig | undefined = this.configService.getConfig(id);\n if (!libConfig) {\n throw new Error('Internal library error - libConfig must be defined');\n }\n if (!this.currentImage) {\n throw new Error('Internal library error - currentImage must be defined');\n }\n let index: number;\n try {\n index = getIndex(this.currentImage, this.images());\n } catch (err) {\n console.error('Cannot get the current image index in current-image');\n throw err;\n }\n\n if (libConfig.carouselSlideInfinite === true) {\n // enable infinite sliding\n this.isFirstImage = false;\n this.isLastImage = false;\n } else {\n this.handleBoundaries(index);\n }\n }\n\n /**\n * Private method to emit events when either the last or the first image are visible.\n * @param action Enum of type Action that represents the source of the event that changed the\n * current image to the first one or the last one.\n * @param indexToCheck is the index number of the image (the first or the last one).\n */\n private emitBoundaryEvent(action: Action, indexToCheck: number): void {\n const id = this.id();\n if (id === null || id === undefined) {\n return;\n }\n // to emit first/last event\n switch (indexToCheck) {\n case 0:\n this.firstImage.emit(new ImageEvent(id, action, true));\n break;\n case this.images().length - 1:\n this.lastImage.emit(new ImageEvent(id, action, true));\n break;\n }\n }\n\n /**\n * Private method to check if next/prev actions should be blocked.\n * It checks if carouselSlideInfinite === false and if the image index is equals to the input parameter.\n * If yes, it returns true to say that sliding should be blocked, otherwise not.\n * @param boundaryIndex number that could be either the beginning index (0) or the last index\n * of images (this.images.length - 1).\n * @returns boolean true if carouselSlideInfinite === false and the current index is\n * either the first or the last one.\n */\n private isPreventSliding(boundaryIndex: number): boolean {\n const id = this.id();\n if (id === null || id === undefined) {\n throw new Error('Internal library error - id must be defined');\n }\n const libConfig: LibConfig | undefined = this.configService.getConfig(id);\n if (!libConfig) {\n throw new Error('Internal library error - libConfig must be defined');\n }\n if (!this.currentImage) {\n throw new Error('Internal library error - currentImage must be defined');\n }\n return !libConfig.carouselSlideInfinite && getIndex(this.currentImage, this.images()) === boundaryIndex;\n }\n}\n","<main id=\"carousel-container\"\n [attr.aria-label]=\"accessibilityConfig?.carouselContainerAriaLabel\"\n [title]=\"$safeNavigationMigration(accessibilityConfig?.carouselContainerTitle)\"\n ksMaxSize [maxSizeConfig]=\"{maxWidth: $safeNavigationMigration(carouselConfig?.maxWidth),\n maxHeight: ''}\">\n\n\n <!-- Workaround to support 2 ng-content in the same template in 2 @if (https://github.com/angular/angular/issues/22972) -->\n <!-- Is this still required??? Issue is closed!-->\n <ng-template #content>\n <ng-content />\n </ng-template>\n\n @if (currentImage && currentImage.modal) {\n <figure class=\"current-figure\"\n ksSize [sizeConfig]=\"{width: $safeNavigationMigration(carouselConfig?.maxWidth), height: ''}\">\n\n @if (carouselConfig?.showArrows) {\n <a class=\"nav-left\"\n [attr.aria-label]=\"accessibilityConfig?.carouselPrevImageAriaLabel\"\n [tabIndex]=\"isLastImage && !carouselSlideInfinite ? -1 : 0\" role=\"button\"\n (click)=\"onNavigationEvent('left', $event, clickAction)\" (keyup)=\"onNavigationEvent('left', $event, keyboardAction)\">\n <div class=\"inside {{(isFirstImage && !carouselSlideInfinite) || !carouselConfig?.showArrows ? 'empty-arrow-image' : 'left-arrow-image'}}\"\n aria-hidden=\"true\"\n [title]=\"$safeNavigationMigration(accessibilityConfig?.carouselPrevImageTitle)\"></div>\n </a>\n }\n\n <ng-container *ngTemplateOutlet=\"content\" />\n <picture class=\"current-image\" ksMaxSize [maxSizeConfig]=\"{maxWidth: $safeNavigationMigration(carouselConfig?.maxWidth),\n maxHeight: $safeNavigationMigration(carouselConfig?.maxHeight)}\">\n @for (source of currentImage.modal?.sources; let i = $index; track i) {\n <source [media]=\"source.media\" [srcset]=\"source.srcset\">\n }\n <img [id]=\"currentImage.id\"\n loading=\"{{ currentImage.loading }}\"\n [attr.fetchpriority]=\"currentImage.fetchpriority\"\n [style.object-fit]=\"carouselConfig?.objectFit\"\n ksMaxSize [maxSizeConfig]=\"{maxWidth: $safeNavigationMigration(carouselConfig?.maxWidth),\n maxHeight: $safeNavigationMigration(carouselConfig?.maxHeight)}\"\n [src]=\"currentImage.modal.img\"\n ksFallbackImage [fallbackImg]=\"currentImage.modal.fallbackImg\"\n [attr.aria-label]=\"currentImage.modal.ariaLabel\"\n [title]=\"(currentImage.modal.title || currentImage.modal.title === '') ? currentImage.modal.title : getTitleToDisplay()\"\n alt=\"{{currentImage.modal.alt ? currentImage.modal.alt : getAltDescriptionByImage()}}\"\n [tabIndex]=\"0\" role=\"img\"\n (click)=\"onClickCurrentImage()\"\n (swipeleft)=\"swipe($event.type)\"\n (swiperight)=\"swipe($event.type)\" />\n </picture>\n @if (getDescriptionToDisplay() !== '') {\n <figcaption class=\"description\"\n ksDescription [description]=\"$safeNavigationMigration(carouselImageConfig?.description)\"\n [innerHTML]=\"getDescriptionToDisplay()\"></figcaption>\n }\n\n @if (carouselConfig?.showArrows) {\n <a class=\"nav-right\"\n [attr.aria-label]=\"accessibilityConfig?.carouselNextImageAriaLabel\"\n [tabIndex]=\"isLastImage && !carouselSlideInfinite ? -1 : 0\" role=\"button\"\n (click)=\"onNavigationEvent('right', $event, clickAction)\" (keyup)=\"onNavigationEvent('right', $event, keyboardAction)\">\n <div class=\"inside {{(isLastImage && !carouselSlideInfinite) || !carouselConfig?.showArrows ? 'empty-arrow-image' : 'right-arrow-image'}}\"\n aria-hidden=\"true\"\n [title]=\"$safeNavigationMigration(accessibilityConfig?.carouselNextImageTitle)\"></div>\n </a>\n }\n\n @if (carouselDotsConfig) {\n <div id=\"dots\">\n <ks-dots [id]=\"id()\"\n [currentImage]=\"currentImage\"\n [images]=\"images()\"\n [dotsConfig]=\"carouselDotsConfig\"\n [accessibilityConfig]=\"accessibilityConfig!\"\n (clickDot)=\"onClickDot($event)\" />\n </div>\n }\n\n </figure>\n }\n\n</main>\n\n@if (currentImage) {\n <ks-carousel-previews [id]=\"id()\"\n [images]=\"images()\"\n [currentImage]=\"currentImage\"\n (clickPreview)=\"onClickPreview($event)\" />\n}\n","import { ButtonConfig, ButtonType } from '../../model/buttons-config.interface';\nimport { Size } from '../../model/size.interface';\n\n/**\n * Default button size object\n */\nexport const KS_DEFAULT_SIZE: Size = { height: 'auto', width: '30px' };\n\n/**\n * Default close button object\n */\nexport const KS_DEFAULT_BTN_CLOSE: ButtonConfig = {\n className: 'close-image',\n size: KS_DEFAULT_SIZE,\n type: ButtonType.CLOSE,\n title: 'Close this modal image gallery',\n ariaLabel: 'Close this modal image gallery'\n};\n\n/**\n * Default download button object\n */\nexport const KS_DEFAULT_BTN_DOWNLOAD: ButtonConfig = {\n className: 'download-image',\n size: KS_DEFAULT_SIZE,\n type: ButtonType.DOWNLOAD,\n title: 'Download the current image',\n ariaLabel: 'Download the current image'\n};\n\n/**\n * Default exturl button object\n */\nexport const KS_DEFAULT_BTN_EXTURL: ButtonConfig = {\n className: 'ext-url-image',\n size: KS_DEFAULT_SIZE,\n type: ButtonType.EXTURL,\n title: 'Navigate the current image',\n ariaLabel: 'Navigate the current image'\n};\n// /**\n// * Default refresh button object\n// */\n// export const KS_DEFAULT_BTN_REFRESH: ButtonConfig = {\n// className: 'refresh-image',\n// size: KS_DEFAULT_SIZE,\n// type: ButtonType.REFRESH,\n// title: 'Refresh all images',\n// ariaLabel: 'Refresh all images'\n// };\n\n/**\n * Default delete button object\n */\nexport const KS_DEFAULT_BTN_DELETE: ButtonConfig = {\n className: 'delete-image',\n size: KS_DEFAULT_SIZE,\n type: ButtonType.DELETE,\n title: 'Delete the current image',\n ariaLabel: 'Delete the current image'\n};\n\n/**\n * Default full-screen button object\n */\nexport const KS_DEFAULT_BTN_FULL_SCREEN: ButtonConfig = {\n className: 'fullscreen-image',\n size: KS_DEFAULT_SIZE,\n type: ButtonType.FULLSCREEN,\n title: 'Switch to full-screen',\n ariaLabel: 'Switch to full-screen'\n};\n/**\n * Default rotate button object\n */\n// export const KS_DEFAULT_BTN_ROTATE: ButtonConfig = {\n// className: 'rotate-image',\n// size: KS_DEFAULT_SIZE,\n// type: ButtonType.ROTATE,\n// title: 'Rotate the current image clockwise 90 degrees',\n// ariaLabel: 'Rotate the current image clockwise 90 degrees'\n// };\n","/*\n The MIT License (MIT)\n\n Copyright (c) 2017-2026 Stefano Cappa (Ks89)\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\n\nimport { ChangeDetectionStrategy, Component, OnInit, output, OutputEmitterRef, input } from '@angular/core';\n\nimport { AccessibleComponent } from '../accessible.component';\n\nimport { Action } from '../../model/action.enum';\nimport { Image } from '../../model/image.class';\nimport { ButtonConfig, ButtonEvent, ButtonsConfig, ButtonsStrategy, ButtonType, WHITELIST_BUTTON_TYPES } from '../../model/buttons-config.interface';\n\nimport {\n KS_DEFAULT_BTN_CLOSE,\n KS_DEFAULT_BTN_DELETE,\n KS_DEFAULT_BTN_DOWNLOAD,\n KS_DEFAULT_BTN_EXTURL,\n KS_DEFAULT_BTN_FULL_SCREEN\n} from './upper-buttons-default';\n\nimport { NEXT } from '../../utils/user-input.util';\nimport { NgStyle } from '@angular/common';\nimport { SizeDirective } from '../../directives/size.directive';\n\n/**\n * Internal representation of `ButtonConfig` with an optional `id` field, used by trackId to improve performances.\n */\nexport interface InternalButtonConfig extends ButtonConfig {\n id?: number; // useful only for trackById, not needed by users\n}\n\n/**\n * Component with all upper buttons.\n * Also it emits click events as outputs.\n */\n@Component({\n selector: 'ks-upper-buttons',\n styleUrls: ['upper-buttons.scss'],\n templateUrl: 'upper-buttons.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [SizeDirective, NgStyle]\n})\nexport class UpperButtonsComponent extends AccessibleComponent implements OnInit {\n /**\n * Unique id (>=0) of the current instance of this library. This is required when you are using\n * the service to call modal gallery.\n */\n readonly id = input.required<number>();\n /**\n * Object of type `Image` that represent the visible image.\n */\n readonly currentImage = input.required<Image>();\n /**\n * Object of type `ButtonsConfig` to init UpperButtonsComponent's features.\n * For instance, it contains an array of buttons.\n */\n readonly buttonsConfig = input.required<ButtonsConfig>();\n /**\n * Output to emit clicks on refresh button. The payload contains a `ButtonEvent`.\n */\n readonly refresh = output<ButtonEvent>();\n /**\n * Output to emit clicks on delete button. The payload contains a `ButtonEvent`.\n */\n readonly delete = output<ButtonEvent>();\n /**\n * Output to emit clicks on navigate button. The payload contains a `ButtonEvent`.\n */\n readonly navigate = output<ButtonEvent>();\n /**\n * Output to emit clicks on download button. The payload contains a `ButtonEvent`.\n */\n readonly download = output<ButtonEvent>();\n /**\n * Output to emit clicks on close button. The payload contains a `ButtonEvent`.\n */\n readonly closeButton = output<ButtonEvent>();\n /**\n * Output to emit clicks on full-screen button. The payload contains a `ButtonEvent`.\n */\n readonly fullscreen = output<ButtonEvent>();\n /**\n * Output to emit clicks on all custom buttons. The payload contains a `ButtonEvent`.\n */\n readonly customEmit = output<ButtonEvent>();\n\n /**\n * Array of `InternalButtonConfig` exposed to the template. This field is initialized\n * applying transformations, default values and so on to the input of the same type.\n */\n buttons: InternalButtonConfig[] | undefined;\n\n /**\n * Default buttons array for standard configuration\n */\n private defaultButtonsDefault: ButtonConfig[] = [KS_DEFAULT_BTN_CLOSE];\n /**\n * Default buttons array for simple configuration\n */\n private simpleButtonsDefault: ButtonConfig[] = [KS_DEFAULT_BTN_DOWNLOAD, ...this.defaultButtonsDefault];\n /**\n * Default buttons array for advanced configuration\n */\n private advancedButtonsDefault: ButtonConfig[] = [KS_DEFAULT_BTN_EXTURL, ...this.simpleButtonsDefault];\n /**\n * Default buttons array for full configuration\n */\n private fullButtonsDefault: ButtonConfig[] = [\n KS_DEFAULT_BTN_FULL_SCREEN,\n KS_DEFAULT_BTN_DELETE,\n ...this.advancedButtonsDefault\n ];\n\n /**\n * Method `ngOnInit` to build `configButtons` applying a default value and also to\n * init the `buttons` array.\n * This is an angular lifecycle hook, so it's called automatically by Angular itself.\n * In particular, it's called only one time!!!\n */\n ngOnInit(): void {\n if (!this.buttonsConfig()) {\n throw new Error('No buttons configured');\n }\n switch (this.buttonsConfig().strategy) {\n case ButtonsStrategy.SIMPLE:\n this.buttons = this.addButtonIds(this.simpleButtonsDefault);\n break;\n case ButtonsStrategy.ADVANCED:\n this.buttons = this.addButtonIds(this.advancedButtonsDefault);\n break;\n case ButtonsStrategy.FULL:\n this.buttons = this.addButtonIds(this.fullButtonsDefault);\n break;\n case ButtonsStrategy.CUSTOM:\n this.buttons = this.addButtonIds(this.validateCustomButtons(this.buttonsConfig().buttons));\n break;\n case ButtonsStrategy.DEFAULT:\n default:\n this.buttons = this.addButtonIds(this.defaultButtonsDefault);\n break;\n }\n }\n\n /**\n * Method called by events from both keyboard and mouse on a button.\n * This will call a private method to trigger an output with the right payload.\n * @param button InternalButtonConfig that called this method\n * @param event KeyboardEvent | MouseEvent payload\n * @param action Action that triggered the source event or `Action.CLICK` if not specified\n * @throws an error if the button type is unknown\n */\n onEvent(button: InternalButtonConfig, event: KeyboardEvent | MouseEvent, action: Action = Action.CLICK): void {\n if (!event) {\n return;\n }\n const dataToEmit: ButtonEvent = {\n button,\n // current image initialized as null\n // (I'll fill this value inside the parent of this component\n image: null,\n action,\n galleryId: this.id()\n };\n const currentImage = this.currentImage();\n switch (button.type) {\n case ButtonType.DELETE:\n this.triggerOnMouseAndKeyboard(this.delete, event, dataToEmit);\n break;\n case ButtonType.EXTURL:\n if (!currentImage || !currentImage.modal || !currentImage.modal.extUrl) {\n return;\n }\n this.triggerOnMouseAndKeyboard(this.navigate, event, dataToEmit);\n break;\n case ButtonType.DOWNLOAD:\n this.triggerOnMouseAndKeyboard(this.download, event, dataToEmit);\n break;\n case ButtonType.CLOSE:\n this.triggerOnMouseAndKeyboard(this.closeButton, event, dataToEmit);\n break;\n case ButtonType.CUSTOM:\n this.triggerOnMouseAndKeyboard(this.customEmit, event, dataToEmit);\n break;\n case ButtonType.FULLSCREEN:\n this.triggerOnMouseAndKeyboard(this.fullscreen, event, dataToEmit);\n break;\n default:\n throw new Error(`Unknown button's type into ButtonConfig`);\n }\n }\n\n /**\n * Method used in the template to track ids in @for.\n * @param index number of the array\n * @param item Image of the array\n * @returns number the id of the item or undefined if the item is not valid\n */\n trackById(index: number, item: InternalButtonConfig): number | undefined {\n return item ? item.id : undefined;\n }\n\n /**\n * Private method to emit an event using the specified output emitter.\n * @param emitter OutputEmitterRef<ButtonEvent> is the output to emit the `ButtonEvent`\n * @param event KeyboardEvent | MouseEvent is the source that triggered this method\n * @param dataToEmit ButtonEvent payload to emit\n */\n private triggerOnMouseAndKeyboard(emitter: OutputEmitterRef<ButtonEvent>, event: KeyboardEvent | MouseEvent, dataToEmit: ButtonEvent): void {\n if (!emitter) {\n throw new Error(`UpperButtonsComponent unknown emitter in triggerOnMouseAndKeyboard`);\n }\n\n const result: number = super.handleImageEvent(event);\n if (result === NEXT) {\n emitter.emit(dataToEmit);\n }\n }\n\n /**\n * Private method to add ids to the array of buttons.\n * It adds ids in a reverse way, to be sure that the last button will always have id = 0.\n * This is really useful in unit testing to be sure that close button always have id = 0, download 1 and so on...\n * It's totally transparent to the user.\n * @param buttons ButtonConfig[] config array\n * @returns ButtonConfig[] the input array with incremental numeric ids\n */\n private addButtonIds(buttons: ButtonConfig[]): ButtonConfig[] {\n return buttons.map((val: ButtonConfig, i: number) => Object.assign(val, { id: buttons.length - 1 - i }));\n }\n\n /**\n * Private method to validate custom buttons received as input.\n * @param buttons ButtonConfig[] config array. [] by default.\n * @returns ButtonConfig[] the same input buttons config array\n * @throws an error if exists a button with an unknown type\n */\n private validateCustomButtons(buttons: ButtonConfig[] = []): ButtonConfig[] {\n buttons.forEach((val: ButtonConfig) => {\n const indexOfButtonType: number = WHITELIST_BUTTON_TYPES.findIndex((type: ButtonType) => type === val.type);\n if (indexOfButtonType === -1) {\n throw new Error(`Unknown ButtonType. For custom types use ButtonType.CUSTOM`);\n }\n });\n return buttons;\n }\n}\n","<header class=\"buttons-container\">\n\n @if (!buttonsConfig() || buttonsConfig()?.visible) {\n @for (btn of buttons; track btn.id) {\n <a class=\"upper-button\"\n ksSize [sizeConfig]=\"{width: $safeNavigationMigration(btn.size?.width)!, height: $safeNavigationMigration(btn.size?.height)!}\"\n [ngStyle]=\"{'font-size': btn.fontSize}\"\n [attr.aria-label]=\"btn.ariaLabel\"\n [tabIndex]=\"0\" role=\"button\"\n (click)=\"onEvent(btn, $event)\" (keyup)=\"onEvent(btn, $event)\">\n <div class=\"inside {{btn.className}}\" aria-hidden=\"true\" title=\"{{btn.title}}\"></div>\n </a>\n }\n }\n</header>\n","/*\n The MIT License (MIT)\n\n Copyright (c) 2017-2026 Stefano Cappa (Ks89)\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\n\nimport { ChangeDetectionStrategy, Component, inject, OnChanges, OnInit, SimpleChanges, TemplateRef, output, input } from '@angular/core';\nimport { NgTemplateOutlet } from '@angular/common';\n\nimport { AccessibleComponent } from '../accessible.component';\n\nimport { AccessibilityConfig } from '../../model/accessibility.interface';\nimport { ImageEvent, ImageModalEvent, Image } from '../../model/image.class';\nimport { PreviewConfig } from '../../model/preview-config.interface';\nimport { SlideConfig } from '../../model/slide-config.interface';\nimport { NEXT, PREV } from '../../utils/user-input.util';\nimport { getIndex } from '../../utils/image.util';\nimport { Action } from '../../model/action.enum';\nimport { ConfigService, DEFAULT_PREVIEW_SIZE } from '../../services/config.service';\nimport { Size } from '../../model/size.interface';\nimport { LibConfig } from '../../model/lib-config.interface';\nimport { FallbackImageDirective } from '../../directives/fallback-image.directive';\nimport { SizeDirective } from '../../directives/size.directive';\n\n/**\n * Component with image previews\n */\n@Component({\n selector: 'ks-previews',\n styleUrls: ['previews.scss', '../previews-arrows.scss'],\n templateUrl: 'previews.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [NgTemplateOutlet, FallbackImageDirective, SizeDirective]\n})\nexport class PreviewsComponent extends AccessibleComponent implements OnInit, OnChanges {\n /**\n * Unique id (>=0) of the current instance of this library. This is required when you are using\n * the service to call modal-gallery.\n */\n readonly id = input.required<number>();\n /**\n * Object of type `Image` that represent the visible image.\n */\n readonly currentImage = input.required<Image>();\n /**\n * Array of `Image` that represent the model of this library with all images,\n * thumbs and so on.\n */\n readonly images = input.required<Image[]>();\n\n /**\n * Optional template reference for the rendering of previews.\n * Template may access the following context variables:\n * - preview: the `Image` object\n * - defaultTemplate: the template used by default to render the preview (in case the need is to wrap it)\n */\n readonly customTemplate = input<TemplateRef<HTMLElement>>();\n\n /**\n * Output to emit the clicked preview. The payload contains the `ImageEvent` associated to the clicked preview.\n */\n readonly clickPreview = output<ImageEvent>();\n\n /**\n * Object of type `AccessibilityConfig` to init custom accessibility features.\n * For instance, it contains titles, alt texts, aria-labels and so on.\n */\n accessibilityConfig: AccessibilityConfig | undefined;\n /**\n * Object of type `SlideConfig` to get `infinite sliding`.\n */\n slideConfig: SlideConfig | undefined;\n /**\n * Object of type `PreviewConfig` to init PreviewsComponent's features.\n * For instance, it contains a param to show/hide this component, sizes.\n */\n previewConfig: PreviewConfig | undefined;\n /**\n * Enum of type `Action` that represents a mouse click on a button.\n * Declared here to be used inside the template.\n */\n clickAction: Action = Action.CLICK;\n /**\n * Enum of type `Action` that represents a keyboard action.\n * Declared here to be used inside the template.\n */\n keyboardAction: Action = Action.KEYBOARD;\n /**\n * Array of `Image` exposed to the template. This field is initialized\n * applying transformations, default values and so on to the input of the same type.\n */\n previews: Image[] = [];\n /**\n * Start index (included) of the input images used to display previews.\n */\n // @ts-ignore\n start: number;\n /**\n * End index (excluded) of the input images used to display previews.\n */\n // @ts-ignore\n end: number;\n\n defaultPreviewSize: Size = DEFAULT_PREVIEW_SIZE;\n\n private configService: ConfigService = inject(ConfigService);\n\n /**\n * Method `ngOnInit` to build `configPreview` applying a default value and also to\n * init the `previews` array.\n * This is an angular lifecycle hook, so it's called automatically by Angular itself.\n * In particular, it's called only one time!!!\n */\n ngOnInit(): void {\n const libConfig: LibConfig | undefined = this.configService.getConfig(this.id());\n if (!libConfig) {\n throw new Error('Internal library error - libConfig must be defined');\n }\n this.accessibilityConfig = libConfig.accessibilityConfig;\n this.slideConfig = libConfig.slideConfig;\n this.previewConfig = libConfig.previewConfig;\n this.initPreviews(this.currentImage(), this.images());\n }\n\n /**\n * Method to check if an image is active (i.e. a preview image).\n * @param preview Image is an image to check if it's active or not\n * @returns boolean true if is active, false otherwise\n */\n isActive(preview: Image): boolean {\n if (!preview) {\n return false;\n }\n return preview.id === this.currentImage().id;\n }\n\n /**\n * Method `ngOnChanges` to update `previews` array.\n * Also, both `start` and `end` local variables will be updated accordingly.\n * This is an angular lifecycle hook, so it's called automatically by Angular itself.\n * In particular, it's called when any data-bound property of a directive changes!!!\n */\n ngOnChanges(changes: SimpleChanges): void {\n\n let currentImage = changes['currentImage']?.currentValue ?? this.currentImage();\n let images = changes['images']?.currentValue ?? this.images();\n\n if (this.previewConfig && currentImage && images) {\n this.initPreviews(currentImage, images);\n }\n }\n\n /**\n * Method called by events from both keyboard and mouse on a preview.\n * This will trigger the `clickpreview` output with the input preview as its payload.\n * @param preview Image that triggered this method\n * @param event KeyboardEvent | MouseEvent payload\n * @param action Action that triggered the source event or `Action.NORMAL` if not specified\n */\n onImageEvent(preview: Image, event: KeyboardEvent | MouseEvent, action: Action = Action.NORMAL): void {\n // It's suggested to stop propagation of the event, so the\n // Cdk background will not catch a click and close the modal (like it does on Windows Chrome/FF).\n event?.stopPropagation();\n if (!this.previewConfig || !this.previewConfig.clickable) {\n return;\n }\n const result: number = super.handleImageEvent(event);\n if (result === NEXT || result === PREV) {\n this.clickPreview.emit(new ImageModalEvent(this.id(), action, getIndex(preview, this.images())));\n }\n }\n\n /**\n * Method called by events from both keyboard and mouse on a navigation arrow.\n * It also emits an event to specify which arrow.\n * @param direction string of the navigation that can be either 'next' or 'prev'\n * @param event KeyboardEvent | MouseEvent payload\n * @param action Action that triggered the source event or `Action.NORMAL` if not specified\n */\n onNavigationEvent(direction: string, event: KeyboardEvent | MouseEvent, action: Action = Action.NORMAL): void {\n const result: number = super.handleNavigationEvent(direction, event);\n if (result === NEXT) {\n this.next();\n } else if (result === PREV) {\n this.previous();\n }\n }\n\n /**\n * Indicates if the previews 'left arrow' should be displayed or not.\n * @returns\n */\n isDisplayLeftPreviewsArrow(): boolean {\n // Don't show arrows if the preview number is greater or equals than total number of images\n const images = this.images();\n if (this.previewConfig?.number !== undefined && images && this.previewConfig?.number >= images?.length) {\n return false;\n }\n return (this.previewConfig?.arrows && this.start > 0) || !!this.slideConfig?.infinite;\n }\n\n /**\n * Indicates if the previews 'right arrow' should be displayed or not.\n * @returns\n */\n isDisplayRightPreviewsArrow(): boolean {\n // Don't show arrows if the preview number is greater or equals than total number of images\n const images = this.images();\n if (this.previewConfig?.number !== undefined && images && this.previewConfig?.number >= images?.length) {\n return false;\n }\n return (this.previewConfig?.arrows && images && this.end < images.length) || !!this.slideConfig?.infinite;\n }\n\n /**\n * Private method to init previews based on the currentImage and the full array of images.\n * The current image in mandatory to show always the current preview (as highlighted).\n * @param currentImage Image to decide how to show previews, because I always want to see the current image as highlighted\n * @param images Image[] is the array of all images.\n */\n private initPreviews(currentImage: Image, images: Image[]): void {\n this.setIndexesPreviews(currentImage, images);\n this.previews = images.filter((img: Image, i: number) => i >= this.start && i < this.end);\n }\n\n /**\n * Private method to update both `start` and `end` based on the currentImage.\n */\n private setIndexesPreviews(currentImage: Image, images: Image[]): void {\n if (!this.previewConfig || !images || !currentImage) {\n throw new Error('Internal library error - previewConfig, currentImage and images must be defined');\n }\n const previewsNumber = this.previewConfig.number as number;\n let start = getIndex(currentImage, images) - Math.floor(previewsNumber / 2);\n // start is, at a minimum, the first index\n if (start < 0) start = 0;\n // end index\n let end = start + previewsNumber;\n // end is, at a maximum, the last index\n if (end > images.length) {\n start -= end - images.length;\n if (start < 0) start = 0; // start is, at a minimum, the first index\n end = images.length;\n }\n this.start = start;\n this.end = end;\n }\n\n /**\n * Private method to update the visible previews navigating to the right (next).\n */\n private next(): void {\n if (!this.previewConfig) {\n throw new Error('Internal library error - previewConfig must be defined');\n }\n if (this.end >= this.images().length) {\n // check if nextImage should be blocked\n const preventSliding = !!this.slideConfig && this.slideConfig.infinite === false;\n if (preventSliding) {\n return;\n }\n this.start = 0;\n } else {\n this.start++;\n }\n this.end = this.start + Math.min((this.previewConfig.number as number), this.images().length);\n\n this.previews = this.images().filter((img: Image, i: number) => i >= this.start && i < this.end);\n }\n\n /**\n * Private method to update the visible previews navigating to the left (previous).\n */\n private previous(): void {\n if (!this.previewConfig) {\n throw new Error('Internal library error - previewConfig must be defined');\n }\n if (this.start <= 0) {\n // check if prevImage should be blocked\n const preventSliding = !!this.slideConfig && this.slideConfig.infinite === false;\n if (preventSliding) {\n return;\n }\n this.end = this.images().length;\n } else {\n this.end--;\n }\n this.start = this.end - Math.min((this.previewConfig.number as number), this.images().length);\n\n this.previews = this.images().filter((img: Image, i: number) => i >= this.start && i < this.end);\n }\n\n}\n","<nav class=\"previews-container\"\n [class.mobile-visible]=\"previewConfig?.mobileVisible\"\n [attr.aria-label]=\"accessibilityConfig?.previewsContainerAriaLabel\"\n [title]=\"$safeNavigationMigration(accessibilityConfig?.previewsContainerTitle)\">\n\n @if (previewConfig?.visible) {\n <a class=\"nav-left\"\n [attr.aria-label]=\"accessibilityConfig?.previewScrollPrevAriaLabel\"\n [tabIndex]=\"isDisplayLeftPreviewsArrow() ? 0 : -1\" role=\"button\"\n (click)=\"onNavigationEvent('left', $event)\" (keyup)=\"onNavigationEvent('left', $event)\">\n <div class=\"inside {{ isDisplayLeftPreviewsArrow() ? 'left-arrow-preview-image' : 'empty-arrow-preview-image'}}\"\n aria-hidden=\"true\"\n [title]=\"$safeNavigationMigration(accessibilityConfig?.previewScrollPrevTitle)\"></div>\n </a>\n\n @for (preview of previews; track preview.id) {\n <div class=\"preview-container {{!previewConfig?.clickable ? ' unclickable' : ''}}\"\n (click)=\"onImageEvent(preview, $event, clickAction)\"\n (keyup)=\"onImageEvent(preview, $event, keyboardAction)\"\n >\n <ng-container *ngTemplateOutlet=\"!customTemplate() ? defaultTemplate : customTemplate() ; context:{preview, defaultTemplate}\" />\n <ng-template #defaultTemplate>\n @if (preview?.modal?.img) {\n <img class=\"inside preview-image {{isActive(preview) ? 'active' : ''}}\"\n loading=\"{{preview.loading}}\"\n [attr.fetchpriority]=\"preview.fetchpriority\"\n [src]=\"preview.plain?.img ? $safeNavigationMigration(preview.plain?.img)! : preview.modal.img\"\n ksFallbackImage [fallbackImg]=\"preview.plain?.fallbackImg ? $safeNavigationMigration(preview.plain?.fallbackImg) : preview.modal.fallbackImg\"\n ksSize [sizeConfig]=\"{width: previewConfig?.size ? $safeNavigationMigration(previewConfig?.size?.width)! : defaultPreviewSize.width,\n height: previewConfig?.size ? $safeNavigationMigration(previewConfig?.size?.height)! : defaultPreviewSize.height}\"\n [attr.aria-label]=\"preview.modal.ariaLabel ? preview.modal.ariaLabel : ''\"\n [title]=\"(preview.modal.title || preview.modal.title === '') ? preview.modal.title : ''\"\n alt=\"{{preview.modal.alt ? preview.modal.alt : ''}}\"\n [tabIndex]=\"0\" role=\"img\"\n />\n }\n </ng-template>\n </div>\n }\n\n\n <a class=\"nav-right\"\n [attr.aria-label]=\"accessibilityConfig?.previewScrollNextAriaLabel\"\n [tabIndex]=\"isDisplayRightPreviewsArrow() ? 0 : -1\" role=\"button\"\n (click)=\"onNavigationEvent('right', $event)\" (keyup)=\"onNavigationEvent('right', $event)\">\n <div class=\"inside {{ isDisplayRightPreviewsArrow() ? 'right-arrow-preview-image' : 'empty-arrow-preview-image'}}\"\n aria-hidden=\"true\"\n [title]=\"$safeNavigationMigration(accessibilityConfig?.previewScrollNextTitle)\"></div>\n </a>\n }\n</nav>\n","/*\n The MIT License (MIT)\n\n Copyright (c) 2017-2026 Stefano Cappa (Ks89)\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\n\nimport { Directive, HostListener, output, input } from '@angular/core';\n\n/**\n * Directive to manage keyboard navigation.\n */\n@Directive({ selector: '[ksKeyboardNavigation]' })\nexport class KeyboardNavigationDirective {\n /**\n * Boolean input to skip keyboard navigation.\n */\n isOpen = input.required<boolean>();\n\n /**\n * Output to emit keyboard `code` of the pressed key (keydown).\n */\n readonly keyboardNavigation = output<string>();\n\n /**\n * Listener to catch keyboard's events and call the right method based on the key.\n * For instance, pressing esc, this will call `closeGallery(Action.KEYBOARD)` and so on.\n * If you passed a valid `keyboardConfig` esc, right and left buttons will be customized based on your data.\n * @param e KeyboardEvent caught by the listener.\n */\n @HostListener('window:keydown', ['$event'])\n onKeyDown(e: KeyboardEvent): void {\n if (!this.isOpen()) {\n return;\n }\n this.keyboardNavigation.emit(e.code);\n }\n}\n","/*\n The MIT License (MIT)\n\n Copyright (c) 2017-2026 Stefano Cappa (Ks89)\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\n\nimport { Directive, HostListener, output } from '@angular/core';\n\n\n// Inspired from https://stackblitz.com/edit/angular-swipe-events-with-hostlistner?file=src%2Fapp%2Fapp.component.ts\n\n/**\n * Directive to manage swipe events on touch devices.\n */\n@Directive({ selector: '[ksSwipe]' })\nexport class SwipeDirective {\n defaultTouch = { x: 0, y: 0, time: 0 };\n\n /**\n * Output to emit swipe left event. Payload is empty.\n */\n readonly swipeLeft = output();\n /**\n * Output to emit swipe right event. Payload is empty.\n */\n readonly swipeRight = output();\n /**\n * Output to emit swipe up event. Payload is empty.\n */\n readonly swipeUp = output();\n /**\n * Output to emit swipe down event. Payload is empty.\n */\n readonly swipeDown = output();\n\n /**\n * Method called by Angular itself every click thanks to `@HostListener`.\n * @param event TouchEvent payload received on touch\n */\n @HostListener('touchstart', ['$event'])\n @HostListener('touchend', ['$event'])\n @HostListener('touchcancel', ['$event'])\n handleTouch(event: TouchEvent) {\n let touch = event.touches[0] || event.changedTouches[0];\n // check the events\n if (event.type === 'touchstart') {\n this.defaultTouch.x = touch.pageX;\n this.defaultTouch.y = touch.pageY;\n this.defaultTouch.time = event.timeStamp;\n } else if (event.type === 'touchend') {\n let deltaX = touch.pageX - this.defaultTouch.x;\n let deltaY = touch.pageY - this.defaultTouch.y;\n let deltaTime = event.timeStamp - this.defaultTouch.time;\n\n // simulate a swipe -> less than 500 ms and more than 60 px\n if (deltaTime < 500) {\n // touch movement lasted less than 500 ms\n if (Math.abs(deltaX) > 60) {\n // delta x is at least 60 pixels\n if (deltaX > 0) {\n this.swipeRight.emit();\n } else {\n this.swipeLeft.emit();\n }\n }\n\n if (Math.abs(deltaY) > 60) {\n // delta y is at least 60 pixels\n if (deltaY > 0) {\n this.swipeDown.emit();\n } else {\n this.swipeUp.emit();\n }\n }\n }\n }\n }\n\n}\n","/*\n The MIT License (MIT)\n\n Copyright (c) 2017-2026 Stefano Cappa (Ks89)\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\n\nimport { ChangeDetectionStrategy, Component, input } from '@angular/core';\n\nimport { AccessibilityConfig } from '../../../model/accessibility.interface';\nimport { LoadingConfig, LoadingType } from '../../../model/loading-config.interface';\n\n/**\n * Component with the loading spinner\n */\n@Component({\n selector: 'ks-loading-spinner',\n styleUrls: [\n 'style-loading-spinner-standard.css',\n 'style-loading-spinner-dots.css',\n 'style-loading-spinner-bars.css',\n 'style-loading-spinner-circular.css',\n 'style-loading-spinner-cube-flipping.css',\n 'style-loading-spinner-circles.css',\n 'style-loading-spinner-exploding-squares.scss'\n ],\n templateUrl: 'loading-spinner.html',\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class LoadingSpinnerComponent {\n /**\n * Object of type `LoadingConfig` exposed to the template.\n * It contains a field to choose a loading spinner.\n */\n readonly loadingConfig = input<LoadingConfig>();\n /**\n * Object of type `AccessibilityConfig` to init custom accessibility features.\n * For instance, it contains titles, alt texts, aria-labels and so on.\n */\n readonly accessibilityConfig = input<AccessibilityConfig>();\n\n /**\n * Enum of type `LoadingType` to choose the standard loading spinner.\n * Declared here to be used inside the template.\n */\n loadingStandard: LoadingType = LoadingType.STANDARD;\n /**\n * Enum of type `LoadingType` to choose the bars loading spinner.\n * Declared here to be used inside the template.\n */\n loadingBars: LoadingType = LoadingType.BARS;\n /**\n * Enum of type `LoadingType` to choose the circular loading spinner.\n * Declared here to be used inside the template.\n */\n loadingCircular: LoadingType = LoadingType.CIRCULAR;\n /**\n * Enum of type `LoadingType` to choose the dots loading spinner.\n * Declared here to be used inside the template.\n */\n loadingDots: LoadingType = LoadingType.DOTS;\n /**\n * Enum of type `LoadingType` to choose the cube flipping loading spinner.\n * Declared here to be used inside the template.\n */\n loadingCubeFlipping: LoadingType = LoadingType.CUBE_FLIPPING;\n /**\n * Enum of type `LoadingType` to choose the circles loading spinner.\n * Declared here to be used inside the template.\n */\n loadingCircles: LoadingType = LoadingType.CIRCLES;\n /**\n * Enum of type `LoadingType` to choose the explosing squares loading spinner.\n * Declared here to be used inside the template.\n */\n loadingExplosingSquares: LoadingType = LoadingType.EXPLOSING_SQUARES;\n}\n","<div [attr.aria-label]=\"accessibilityConfig()?.loadingSpinnerAriaLabel\"\n [title]=\"$safeNavigationMigration(accessibilityConfig()?.loadingSpinnerTitle)\">\n\n @if (loadingConfig()) {\n @switch ($safeNavigationMigration(loadingConfig()?.type)) {\n @case (loadingStandard) {\n <div class=\"cssload-loader\">\n <div class=\"cssload-inner cssload-one\"></div>\n <div class=\"cssload-inner cssload-two\"></div>\n <div class=\"cssload-inner cssload-three\"></div>\n </div>\n }\n @case (loadingBars) {\n <div class=\"loader-bars\">\n </div>\n }\n @case (loadingCircular) {\n <div class=\"loader-circular\">\n </div>\n }\n @case (loadingDots) {\n <div class=\"loader-dots\">\n </div>\n }\n @case (loadingCubeFlipping) {\n <div class=\"cube-wrapper\">\n <div class=\"cube-folding\">\n <span class=\"leaf1\"></span>\n <span class=\"leaf2\"></span>\n <span class=\"leaf3\"></span>\n <span class=\"leaf4\"></span>\n </div>\n </div>\n }\n @case (loadingCircles) {\n <div id=\"preloader\">\n <div id=\"loader\"></div>\n </div>\n }\n @case (loadingExplosingSquares) {\n <div class=\"loader\">\n <span></span>\n <span></span>\n <span></span>\n <span></span>\n </div>\n }\n }\n }\n</div>\n","/*\n The MIT License (MIT)\n\n Copyright (c) 2017-2026 Stefano Cappa (Ks89)\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\n\nimport {\n AfterContentInit,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n DestroyRef,\n HostListener,\n inject,\n NgZone,\n OnChanges,\n OnDestroy,\n OnInit,\n PLATFORM_ID,\n SimpleChange,\n SimpleChanges,\n output,\n input\n} from '@angular/core';\nimport { isPlatformBrowser, NgClass } from '@angular/common';\nimport { SecurityContext } from '@angular/core';\nimport { DomSanitizer, SafeHtml } from '@angular/platform-browser';\n\nimport { Subject, timer } from 'rxjs';\nimport { filter, map, switchMap, takeUntil } from 'rxjs/operators';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\n\nimport { AccessibleComponent } from '../accessible.component';\nimport { AccessibilityConfig } from '../../model/accessibility.interface';\nimport { Action } from '../../model/action.enum';\nimport { DescriptionStrategy } from '../../model/description.interface';\nimport { Image, ImageModalEvent } from '../../model/image.class';\nimport { InternalLibImage } from '../../model/image-internal.class';\nimport { Keyboard } from '../../model/keyboard.enum';\nimport { KeyboardConfig } from '../../model/keyboard-config.interface';\nimport { SlideConfig } from '../../model/slide-config.interface';\nimport { NEXT, PREV } from '../../utils/user-input.util';\nimport { getIndex } from '../../utils/image.util';\nimport { CurrentImageConfig } from '../../model/current-image-config.interface';\nimport { ConfigService } from '../../services/config.service';\nimport { LibConfig } from '../../model/lib-config.interface';\nimport { KeyboardNavigationDirective } from '../../directives/keyboard-navigation.directive';\nimport { FallbackImageDirective } from '../../directives/fallback-image.directive';\nimport { SizeDirective } from '../../directives/size.directive';\nimport { SwipeDirective } from '../../directives/swipe.directive';\nimport { DescriptionDirective } from '../../directives/description.directive';\nimport { LoadingSpinnerComponent } from './loading-spinner/loading-spinner.component';\n\n/**\n * Interface to describe the Load Event, used to\n * emit an event when the image is finally loaded and the spinner has gone.\n */\nexport interface ImageLoadEvent {\n status: boolean;\n index: number;\n id: number;\n}\n\n/**\n * Component with the current image with some additional elements like arrows and side previews.\n */\n@Component({\n selector: 'ks-current-image',\n styleUrls: ['current-image.scss', '../image-arrows.scss', 'current-image-previews.scss'],\n templateUrl: 'current-image.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [KeyboardNavigationDirective, FallbackImageDirective, SizeDirective,\n SwipeDirective, NgClass, DescriptionDirective, LoadingSpinnerComponent]\n})\nexport class CurrentImageComponent extends AccessibleComponent implements OnInit, OnChanges, AfterContentInit, OnDestroy {\n /**\n * Unique id (>=0) of the current instance of this library. This is useful when you are using\n * the service to call modal gallery without open it manually.\n */\n id = input.required<number>();\n /**\n * Object of type `InternalLibImage` that represent the visible image.\n */\n currentImage = input.required<InternalLibImage>();\n /**\n * Array of `InternalLibImage` that represent the model of this library with all images,\n * thumbs and so on.\n */\n images = input.required<InternalLibImage[]>();\n /**\n * Boolean that is true if the modal gallery is visible.\n * If yes, also this component should be visible.\n */\n isOpen = input<boolean>(false);\n\n /**\n * Output to emit an event when images are loaded. The payload contains an `ImageLoadEvent`.\n */\n readonly loadImage = output<ImageLoadEvent>();\n /**\n * Output to emit any changes of the current image. The payload contains an `ImageModalEvent`.\n */\n readonly changeImage = output<ImageModalEvent>();\n /**\n * Output to emit an event when the modal gallery is closed. The payload contains an `ImageModalEvent`.\n */\n readonly closeGallery = output<ImageModalEvent>();\n\n /**\n * Subject to play modal-gallery.\n */\n private start$ = new Subject<void>();\n /**\n * Subject to stop modal-gallery.\n */\n private stop$ = new Subject<void>();\n\n /**\n * Enum of type `Action` that represents a normal action.\n * Declared here to be used inside the template.\n */\n normalAction: Action = Action.NORMAL;\n /**\n * Object of type `AccessibilityConfig` to init custom accessibility features.\n * For instance, it contains titles, alt texts, aria-labels and so on.\n */\n accessibilityConfig: AccessibilityConfig | undefined;\n /**\n * Object of type `SlideConfig` to get `infinite sliding`.\n */\n slideConfig: SlideConfig | undefined;\n /**\n * Object to configure current image in modal-gallery.\n * For instance you can disable navigation on click on current image (enabled by default).\n */\n currentImageConfig: CurrentImageConfig | undefined;\n /**\n * Object of type `KeyboardConfig` to assign custom keys to both ESC, RIGHT and LEFT keyboard's actions.\n */\n keyboardConfig: KeyboardConfig | undefined;\n /**\n * Enum of type `Action` that represents a mouse click on a button.\n * Declared here to be used inside the template.\n */\n clickAction: Action = Action.CLICK;\n /**\n * Enum of type `Action` that represents a keyboard action.\n * Declared here to be used inside the template.\n */\n keyboardAction: Action = Action.KEYBOARD;\n /**\n * Boolean that is true when you are viewing the first image (currently visible).\n * False by default\n */\n isFirstImage = false;\n /**\n * Boolean that is true when you are viewing the last image (currently visible).\n * False by default\n */\n isLastImage = false;\n /**\n * Boolean that is true if an image of the modal gallery is still loading.\n * True by default\n */\n loading = true;\n\n private readonly platformId: Object = inject(PLATFORM_ID);\n private readonly destroyRef: DestroyRef = inject(DestroyRef);\n private ngZone: NgZone = inject(NgZone);\n private configService: ConfigService = inject(ConfigService);\n private readonly sanitizer: DomSanitizer = inject(DomSanitizer);\n // this must be public for testing purposes\n ref: ChangeDetectorRef = inject(ChangeDetectorRef);\n\n /**\n * Listener to stop the gallery when the mouse pointer is over the current image.\n */\n @HostListener('mouseenter')\n onMouseEnter(): void {\n // if carousel feature is disable, don't do anything in any case\n if (!this.slideConfig || !this.slideConfig.playConfig) {\n return;\n }\n if (!this.slideConfig.playConfig.pauseOnHover) {\n return;\n }\n this.stopCarousel();\n }\n\n /**\n * Listener to play the gallery when the mouse pointer leave the current image.\n */\n @HostListener('mouseleave')\n onMouseLeave(): void {\n // if carousel feature is disable, don't do anything in any case\n if (!this.slideConfig || !this.slideConfig.playConfig) {\n return;\n }\n if (!this.slideConfig.playConfig.pauseOnHover || !this.slideConfig.playConfig.autoPlay) {\n return;\n }\n this.playCarousel();\n }\n\n /**\n * Method `ngOnInit` to init configuration.\n * This is an angular lifecycle hook, so it's called automatically by Angular itself.\n * In particular, it's called only one time!!!\n */\n ngOnInit(): void {\n const libConfig: LibConfig | undefined = this.configService.getConfig(this.id());\n if (!libConfig || !libConfig.buttonsConfig) {\n throw new Error('Internal library error - libConfig and buttonsConfig must be defined');\n }\n this.slideConfig = libConfig.slideConfig;\n this.accessibilityConfig = libConfig.accessibilityConfig ;\n this.currentImageConfig = libConfig.currentImageConfig;\n this.keyboardConfig = libConfig.keyboardConfig;\n }\n\n /**\n * Method `ngOnChanges` to update `loading` status and emit events.\n * If the gallery is open, then it will also manage boundary arrows and sliding.\n * This is an angular lifecycle hook, so it's called automatically by Angular itself.\n * In particular, it's called when any data-bound property of a directive changes!!!\n */\n ngOnChanges(changes: SimpleChanges): void {\n const libConfig: LibConfig | undefined = this.configService.getConfig(this.id());\n if (!libConfig) {\n throw new Error('Internal library error - libConfig must be defined');\n }\n const images: SimpleChange = changes['images'];\n const currentImage: SimpleChange = changes['currentImage'];\n\n if (currentImage && currentImage.previousValue !== currentImage.currentValue) {\n this.updateIndexes();\n } else if (images && images.previousValue !== images.currentValue) {\n this.updateIndexes();\n }\n\n const slideConfig: SimpleChange = changes['slideConfig'];\n if (slideConfig && slideConfig.previousValue !== slideConfig.currentValue) {\n this.slideConfig = libConfig.slideConfig;\n }\n }\n\n /**\n * This is an angular lifecycle hook, so it's called automatically by Angular itself.\n */\n ngAfterContentInit(): void {\n // interval doesn't play well with SSR and protractor,\n // so we should run it in the browser and outside Angular\n if (isPlatformBrowser(this.platformId)) {\n this.ngZone.runOutsideAngular(() => {\n this.start$\n .pipe(\n map(() => this.slideConfig && this.slideConfig.playConfig && this.slideConfig.playConfig.autoPlay && this.slideConfig.playConfig.interval),\n // tslint:disable-next-line:no-any\n filter((interval: any) => interval > 0),\n switchMap(interval => timer(interval).pipe(takeUntil(this.stop$))),\n takeUntilDestroyed(this.destroyRef)\n )\n .subscribe(() =>\n this.ngZone.run(() => {\n if (!this.isLastImage) {\n this.nextImage(Action.AUTOPLAY);\n }\n this.ref.markForCheck();\n })\n );\n\n this.start$.next();\n });\n }\n }\n\n /**\n * Method to handle keypress based on the `keyboardConfig` input. It gets the code of\n * the key that triggered the keypress event to navigate between images or to close the modal gallery.\n * @param code string of the key that triggered the keypress event\n */\n onKeyPress(code: string): void {\n const esc: string = this.keyboardConfig && this.keyboardConfig.esc ? this.keyboardConfig.esc : Keyboard.ESC;\n const right: string = this.keyboardConfig && this.keyboardConfig.right ? this.keyboardConfig.right : Keyboard.RIGHT_ARROW;\n const left: string = this.keyboardConfig && this.keyboardConfig.left ? this.keyboardConfig.left : Keyboard.LEFT_ARROW;\n\n switch (code) {\n case esc:\n this.closeGallery.emit(new ImageModalEvent(this.id(), Action.KEYBOARD, true));\n break;\n case right:\n this.nextImage(Action.KEYBOARD);\n break;\n case left:\n this.prevImage(Action.KEYBOARD);\n break;\n }\n }\n\n /**\n * Method to get the image description based on input params.\n * If you provide a full description this will be the visible description, otherwise,\n * it will be built using the `Description` object, concatenating its fields.\n * @param image image to get its description. If not provided it will be the current image\n * @returns String description of the image (or the current image if not provided)\n * @throws an Error if description isn't available\n */\n getDescriptionToDisplay(image: Image = this.currentImage()): SafeHtml {\n if (!this.currentImageConfig || !this.currentImageConfig.description) {\n throw new Error('Description input must be a valid object implementing the Description interface');\n }\n\n const imageWithoutDescription: boolean = !image.modal || !image.modal.description || image.modal.description === '';\n\n switch (this.currentImageConfig.description.strategy) {\n case DescriptionStrategy.HIDE_IF_EMPTY:\n return this.sanitizer.sanitize(SecurityContext.HTML, imageWithoutDescription ? '' : image.modal.description + '') ?? '';\n case DescriptionStrategy.ALWAYS_HIDDEN:\n return '';\n default:\n // ----------- DescriptionStrategy.ALWAYS_VISIBLE -----------------\n return this.sanitizer.sanitize(SecurityContext.HTML, this.buildTextDescription(image, imageWithoutDescription)) ?? '';\n }\n }\n\n /**\n * Method to get `alt attribute`.\n * `alt` specifies an alternate text for an image, if the image cannot be displayed.\n * @param image Image to get its alt description. If not provided it will be the current image\n * @returns String alt description of the image (or the current image if not provided)\n */\n getAltDescriptionByImage(image: Image = this.currentImage()): string {\n if (!image) {\n return '';\n }\n return image.modal && image.modal.description ? image.modal.description : `Image ${getIndex(image, this.images()) + 1}`;\n }\n\n /**\n * Method to get the title attributes based on descriptions.\n * This is useful to prevent accessibility issues, because if DescriptionStrategy is ALWAYS_HIDDEN,\n * it prevents an empty string as title.\n * @param image Image to get its description. If not provided it will be the current image\n * @returns String title of the image based on descriptions\n * @throws an Error if description isn't available\n */\n getTitleToDisplay(image: Image = this.currentImage()): string {\n if (!this.currentImageConfig || !this.currentImageConfig.description) {\n throw new Error('Description input must be a valid object implementing the Description interface');\n }\n const imageWithoutDescription: boolean = !image.modal || !image.modal.description || image.modal.description === '';\n return this.buildTextDescription(image, imageWithoutDescription);\n }\n\n /**\n * Method to get the left side preview image.\n * @returns Image the image to show as size preview on the left\n */\n getLeftPreviewImage(): Image {\n if (!this.slideConfig) {\n throw new Error('Internal library error - slideConfig must be defined');\n }\n const currentIndex: number = getIndex(this.currentImage(), this.images());\n if (currentIndex === 0 && this.slideConfig.infinite) {\n // the current image is the first one,\n // so the previous one is the last image\n // because infinite is true\n return this.images()[this.images().length - 1];\n }\n this.handleBoundaries(currentIndex);\n return this.images()[Math.max(currentIndex - 1, 0)];\n }\n\n /**\n * Method to get the right side preview image.\n * @returns Image the image to show as size preview on the right\n */\n getRightPreviewImage(): Image {\n if (!this.slideConfig) {\n throw new Error('Internal library error - slideConfig must be defined');\n }\n const currentIndex: number = getIndex(this.currentImage(), this.images());\n const images = this.images();\n if (currentIndex === images.length - 1 && this.slideConfig.infinite) {\n // the current image is the last one,\n // so the next one is the first image\n // because infinite is true\n return images[0];\n }\n this.handleBoundaries(currentIndex);\n return images[Math.min(currentIndex + 1, images.length - 1)];\n }\n\n /**\n * Method called by events from both keyboard and mouse on an image.\n * This will invoke the nextImage method.\n * @param event keyboardEvent | MouseEvent payload\n * @param action action that triggered the event or `Action.NORMAL` if not provided\n */\n onImageEvent(event: KeyboardEvent | MouseEvent, action: Action = Action.NORMAL): void {\n if (!this.currentImageConfig) {\n throw new Error('Internal library error - currentImageConfig must be defined');\n }\n // check if triggered by a mouse click\n // If yes, It should block navigation when navigateOnClick is false\n if (action === Action.CLICK && !this.currentImageConfig.navigateOnClick) {\n // a user has requested to block navigation via configCurrentImage.navigateOnClick property\n return;\n }\n\n const result: number = super.handleImageEvent(event);\n if (result === NEXT) {\n this.nextImage(action);\n }\n }\n\n /**\n * Method called by events from both keyboard and mouse on a navigation arrow.\n * @param direction string of the navigation that can be either 'next' or 'prev'\n * @param event KeyboardEvent | MouseEvent payload\n * @param action Action that triggered the event or `Action.NORMAL` if not provided\n * @param disable boolean to disable navigation\n */\n onNavigationEvent(direction: string, event: KeyboardEvent | MouseEvent, action: Action = Action.NORMAL, disable: boolean = false): void {\n if (disable) {\n return;\n }\n const result: number = super.handleNavigationEvent(direction, event);\n if (result === NEXT) {\n this.nextImage(action);\n } else if (result === PREV) {\n this.prevImage(action);\n }\n }\n\n /**\n * Method to go back to the previous image.\n * @param action Enum of type `Action` that represents the source\n * action that moved back to the previous image. `Action.NORMAL` by default.\n */\n prevImage(action: Action = Action.NORMAL): void {\n // check if prevImage should be blocked\n if (this.isPreventSliding(0)) {\n return;\n }\n const prevImage: InternalLibImage = this.getPrevImage();\n this.loading = !prevImage.previouslyLoaded;\n this.changeImage.emit(new ImageModalEvent(this.id(), action, getIndex(prevImage, this.images())));\n\n this.start$.next();\n }\n\n /**\n * Method to go back to the previous image.\n * @param action Enum of type `Action` that represents the source\n * action that moved to the next image. `Action.NORMAL` by default.\n */\n nextImage(action: Action = Action.NORMAL): void {\n // check if nextImage should be blocked\n const images = this.images();\n if (this.isPreventSliding(images.length - 1)) {\n return;\n }\n const nextImage: InternalLibImage = this.getNextImage();\n this.loading = !nextImage.previouslyLoaded;\n this.changeImage.emit(new ImageModalEvent(this.id(), action, getIndex(nextImage, images)));\n\n this.start$.next();\n }\n\n /**\n * Method to emit an event as loadImage output to indicate that the requested image is loaded.\n * This method is invoked by the javascript's 'load' event on an img tag.\n * @param event event that triggered the load\n */\n onImageLoad(event: Event): void {\n const loadImageData: ImageLoadEvent = {\n status: true,\n index: getIndex(this.currentImage(), this.images()),\n id: this.currentImage().id\n };\n\n this.loadImage.emit(loadImageData);\n\n this.loading = false;\n }\n\n /**\n * Method used by SwipeDirective to support touch gestures (you can also invert the swipe direction with configCurrentImage.invertSwipe).\n * @param action String that represent the direction of the swipe action. 'swiperight' by default.\n */\n swipe(action = 'swiperight'): void {\n if (!this.currentImageConfig) {\n throw new Error('Internal library error - currentImageConfig must be defined');\n }\n switch (action) {\n case 'swiperight':\n if (this.currentImageConfig.invertSwipe) {\n this.prevImage(Action.SWIPE);\n } else {\n this.nextImage(Action.SWIPE);\n }\n break;\n case 'swipeleft':\n if (this.currentImageConfig.invertSwipe) {\n this.nextImage(Action.SWIPE);\n } else {\n this.prevImage(Action.SWIPE);\n }\n break;\n // case this.SWIPE_ACTION.UP:\n // break;\n // case this.SWIPE_ACTION.DOWN:\n // break;\n }\n }\n\n /**\n * Method used in `modal-gallery.component` to get the index of an image to delete.\n * @param image image to get the index, or the visible image, if not passed\n * @returns number the index of the image\n */\n getIndexToDelete(image: Image = this.currentImage()): number {\n return getIndex(image, this.images());\n }\n\n /**\n * Method to play modal gallery.\n */\n playCarousel(): void {\n this.start$.next();\n }\n\n /**\n * Stops modal gallery from cycling through items.\n */\n stopCarousel(): void {\n this.stop$.next();\n }\n\n /**\n * Method to cleanup resources. In fact, this will stop the modal gallery.\n * This is an angular lifecycle hook that is called when this component is destroyed.\n */\n ngOnDestroy(): void {\n this.stopCarousel();\n this.start$.complete();\n this.stop$.complete();\n }\n\n /**\n * Private method to update both `isFirstImage` and `isLastImage` based on\n * the index of the current image.\n * @param currentIndex number is the index of the current image\n */\n private handleBoundaries(currentIndex: number): void {\n const images = this.images();\n if (images.length === 1) {\n this.isFirstImage = true;\n this.isLastImage = true;\n this.ref.markForCheck();\n return;\n }\n if (!this.slideConfig || this.slideConfig.infinite === true) {\n // infinite sliding enabled\n this.isFirstImage = false;\n this.isLastImage = false;\n this.ref.markForCheck();\n } else {\n // execute this only if infinite sliding is disabled\n switch (currentIndex) {\n case 0:\n this.isFirstImage = true;\n this.isLastImage = false;\n this.ref.markForCheck();\n break;\n case images.length - 1:\n this.isFirstImage = false;\n this.isLastImage = true;\n this.ref.markForCheck();\n break;\n default:\n this.isFirstImage = false;\n this.isLastImage = false;\n this.ref.markForCheck();\n break;\n }\n }\n }\n\n /**\n * Private method to check if next/prev actions should be blocked.\n * It checks if slideConfig.infinite === false and if the image index is equals to the input parameter.\n * If yes, it returns true to indicate that sliding should be blocked, otherwise false.\n * @param boundaryIndex number that could be either the beginning index (0) or the last index\n * of images (this.images.length - 1).\n * @returns boolean true if slideConfig.infinite === false and the current index is\n * either the first or the last one.\n */\n private isPreventSliding(boundaryIndex: number): boolean {\n return !!this.slideConfig && this.slideConfig.infinite === false && getIndex(this.currentImage(), this.images()) === boundaryIndex;\n }\n\n /**\n * Private method to get the next index.\n * This is necessary because at the end, when you call next again, you'll go to the first image.\n * That happens because all modal images are shown like in a circle.\n */\n private getNextImage(): InternalLibImage {\n const currentIndex: number = getIndex(this.currentImage(), this.images());\n let newIndex;\n if (currentIndex >= 0 && currentIndex < this.images().length - 1) {\n newIndex = currentIndex + 1;\n } else {\n newIndex = 0; // start from the first index\n }\n return this.images()[newIndex];\n }\n\n /**\n * Private method to get the previous index.\n * This is necessary because at index 0, when you call prev again, you'll go to the last image.\n * That happens because all modal images are shown like in a circle.\n */\n private getPrevImage(): InternalLibImage {\n const currentIndex: number = getIndex(this.currentImage(), this.images());\n let newIndex;\n if (currentIndex > 0 && currentIndex <= this.images().length - 1) {\n newIndex = currentIndex - 1;\n } else {\n newIndex = this.images().length - 1; // start from the last index\n }\n return this.images()[newIndex];\n }\n\n /**\n * Private method to build a text description.\n * This is used also to create titles.\n * @param image Image to get its description. If not provided it will be the current image.\n * @param imageWithoutDescription boolean is a boolean that it's true if the image hasn't a 'modal' description.\n * @returns String description built concatenating image fields with a specific logic.\n */\n private buildTextDescription(image: Image, imageWithoutDescription: boolean): string {\n if (!this.currentImageConfig || !this.currentImageConfig.description) {\n throw new Error('Description input must be a valid object implementing the Description interface');\n }\n\n // If customFullDescription use it, otherwise proceed to build a description\n if (this.currentImageConfig.description.customFullDescription && this.currentImageConfig.description.customFullDescription !== '') {\n return this.currentImageConfig.description.customFullDescription;\n }\n\n const currentIndex: number = getIndex(image, this.images());\n // If the current image hasn't a description,\n // prevent to write the ' - ' (or this.description.beforeTextDescription)\n\n const prevDescription: string = this.currentImageConfig.description.imageText ? this.currentImageConfig.description.imageText : '';\n const midSeparator: string = this.currentImageConfig.description.numberSeparator ? this.currentImageConfig.description.numberSeparator : '';\n const middleDescription: string = currentIndex + 1 + midSeparator + this.images().length;\n\n if (imageWithoutDescription) {\n return prevDescription + middleDescription;\n }\n\n const currImgDescription: string = image.modal && image.modal.description ? image.modal.description : '';\n const endDescription: string = this.currentImageConfig.description.beforeTextDescription + currImgDescription;\n return prevDescription + middleDescription + endDescription;\n }\n\n /**\n * Private method to call handleBoundaries when ngOnChanges is called.\n */\n private updateIndexes(): void {\n try {\n if (this.isOpen()) {\n const index: number = getIndex(this.currentImage(), this.images());\n this.handleBoundaries(index);\n }\n } catch (err) {\n console.error('Cannot get the current image index in current-image');\n throw err;\n }\n }\n}\n","<main class=\"main-image-container\"\n ksKeyboardNavigation [isOpen]=\"isOpen()\" (keyboardNavigation)=\"onKeyPress($event)\"\n [attr.aria-label]=\"accessibilityConfig?.mainContainerAriaLabel\"\n [title]=\"$safeNavigationMigration(accessibilityConfig?.mainContainerTitle)\">\n\n <div class=\"left-sub-container\">\n <a class=\"nav-left {{isFirstImage ? 'no-pointer' : ''}}\"\n [attr.aria-label]=\"accessibilityConfig?.mainPrevImageAriaLabel\"\n [tabIndex]=\"isFirstImage ? -1 : 0\" role=\"button\"\n (click)=\"onNavigationEvent('left', $event)\" (keyup)=\"onNavigationEvent('left', $event)\">\n <div class=\"inside {{isFirstImage ? 'empty-arrow-image' : 'left-arrow-image'}}\"\n aria-hidden=\"true\"\n [title]=\"isFirstImage ? '' : $safeNavigationMigration(accessibilityConfig?.mainPrevImageTitle)\"></div>\n </a>\n\n @let leftPreview = getLeftPreviewImage();\n @if (slideConfig?.sidePreviews?.show && leftPreview) {\n @if (!isFirstImage) {\n <img class=\"inside current-image-previous\"\n loading=\"{{ leftPreview.loading }}\"\n [attr.fetchpriority]=\"leftPreview.fetchpriority\"\n [src]=\"leftPreview.plain?.img ? $safeNavigationMigration(leftPreview.plain?.img) : leftPreview.modal.img\"\n ksFallbackImage [fallbackImg]=\"leftPreview.plain?.fallbackImg ? $safeNavigationMigration(leftPreview.plain?.fallbackImg) : leftPreview.modal.fallbackImg\"\n [hidden]=\"loading\"\n ksSize [sizeConfig]=\"{width: $safeNavigationMigration(slideConfig?.sidePreviews?.size?.width), height: $safeNavigationMigration(slideConfig?.sidePreviews?.size?.height)}\"\n [attr.aria-label]=\"leftPreview.modal.ariaLabel\"\n [title]=\"(leftPreview.modal.title || leftPreview.modal.title === '') ? leftPreview.modal.title : getDescriptionToDisplay(leftPreview)\"\n alt=\"{{leftPreview.modal.alt ? leftPreview.modal.alt : getAltDescriptionByImage(leftPreview)}}\"\n [tabIndex]=\"0\" role=\"img\"\n (click)=\"onNavigationEvent('left', $event, clickAction)\" (keyup)=\"onNavigationEvent('left', $event, keyboardAction)\" />\n } @else {\n <div class=\"current-image-previous hidden\"\n ksSize [sizeConfig]=\"{width: $safeNavigationMigration(slideConfig?.sidePreviews?.size?.width), height: $safeNavigationMigration(slideConfig?.sidePreviews?.size?.height)}\"></div>\n }\n }\n </div>\n\n\n <figure id=\"current-figure\" [style.opacity]=\"loading ? '0' : '1'\">\n <picture class=\"current-image\">\n @for (source of currentImage().modal?.sources; let i = $index; track i) {\n <source [media]=\"source.media\" [srcset]=\"source.srcset\">\n }\n <img [id]=\"currentImage().id\"\n loading=\"{{ currentImage().loading }}\"\n [attr.fetchpriority]=\"currentImage().fetchpriority\"\n class=\"inside\"\n [ngClass]=\"currentImageConfig?.navigateOnClick ? '' : 'unclickable'\"\n [src]=\"currentImage().modal.img\"\n ksFallbackImage [fallbackImg]=\"currentImage().modal.fallbackImg\"\n [attr.aria-label]=\"currentImage().modal.ariaLabel\"\n [title]=\"(currentImage().modal.title || currentImage().modal.title === '') ? currentImage().modal.title : getTitleToDisplay()\"\n alt=\"{{currentImage().modal.alt ? currentImage().modal.alt : getAltDescriptionByImage()}}\"\n [tabIndex]=\"0\" role=\"img\"\n (load)=\"onImageLoad($event)\"\n (click)=\"onImageEvent($event, clickAction)\" (keyup)=\"onImageEvent($event, keyboardAction)\"\n ksSwipe\n (swipeLeft)=\"swipe('swipeleft')\"\n (swipeRight)=\"swipe('swiperight')\" />\n </picture>\n @if (getDescriptionToDisplay() !== '') {\n <figcaption class=\"inside description\"\n ksDescription [description]=\"$safeNavigationMigration(currentImageConfig?.description)\"\n [innerHTML]=\"getDescriptionToDisplay()\">\n </figcaption>\n }\n </figure>\n\n <div class=\"right-sub-container\">\n @let rightPreview = getRightPreviewImage();\n @if (slideConfig?.sidePreviews?.show && leftPreview) {\n @if (!isLastImage) {\n <img class=\"inside current-image-next\"\n loading=\"{{ rightPreview.loading }}\"\n [attr.fetchpriority]=\"rightPreview.fetchpriority\"\n [src]=\"rightPreview.plain?.img ? $safeNavigationMigration(rightPreview.plain?.img) : rightPreview.modal.img\"\n ksFallbackImage [fallbackImg]=\"rightPreview.plain?.fallbackImg ? $safeNavigationMigration(rightPreview.plain?.fallbackImg) : rightPreview.modal.fallbackImg\"\n [hidden]=\"loading\"\n ksSize [sizeConfig]=\"{width: $safeNavigationMigration(slideConfig?.sidePreviews?.size?.width), height: $safeNavigationMigration(slideConfig?.sidePreviews?.size?.height)}\"\n [attr.aria-label]=\"rightPreview.modal.ariaLabel\"\n [title]=\"(rightPreview.modal.title || rightPreview.modal.title === '') ? rightPreview.modal.title : getDescriptionToDisplay(rightPreview)\"\n alt=\"{{rightPreview.modal.alt ? rightPreview.modal.alt : getAltDescriptionByImage(rightPreview)}}\"\n [tabIndex]=\"0\" role=\"img\"\n (click)=\"onNavigationEvent('right', $event, clickAction)\" (keyup)=\"onNavigationEvent('right', $event, keyboardAction)\" />\n } @else {\n <div class=\"current-image-next hidden\"\n ksSize [sizeConfig]=\"{width: $safeNavigationMigration(slideConfig?.sidePreviews?.size?.width), height: $safeNavigationMigration(slideConfig?.sidePreviews?.size?.height)}\"></div>\n }\n }\n\n @if (loading && currentImageConfig?.loadingConfig?.enable) {\n <ks-loading-spinner [loadingConfig]=\"$safeNavigationMigration(currentImageConfig?.loadingConfig)\"\n [accessibilityConfig]=\"accessibilityConfig\" />\n }\n\n <a class=\"nav-right {{isFirstImage ? 'no-pointer' : ''}}\"\n [attr.aria-label]=\"accessibilityConfig?.mainNextImageAriaLabel\"\n [tabIndex]=\"isLastImage ? -1 : 0\" role=\"button\"\n (click)=\"onNavigationEvent('right', $event)\" (keyup)=\"onNavigationEvent('right', $event)\">\n <div class=\"inside {{isLastImage ? 'empty-arrow-image' : 'right-arrow-image'}}\"\n aria-hidden=\"true\"\n [title]=\"isLastImage ? '' : $safeNavigationMigration(accessibilityConfig?.mainNextImageTitle)\"></div>\n </a>\n </div>\n</main>\n","/*\n The MIT License (MIT)\n\n Copyright (c) 2017-2026 Stefano Cappa (Ks89)\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\n\nimport { Directive, ElementRef, inject, OnChanges, OnInit, Renderer2, input } from '@angular/core';\n\n/**\n * Directive to change the flex-wrap css property of an element.\n */\n@Directive({ selector: '[ksWrap]' })\nexport class WrapDirective implements OnInit, OnChanges {\n /**\n * Boolean input that it's true to add 'flex-wrap: wrap', 'flex-wrap: nowrap' otherwise.\n */\n readonly wrap = input.required<boolean>();\n /**\n * String input to force the width of the element to be able to see wrapping.\n */\n readonly width = input.required<string>();\n\n private renderer: Renderer2 = inject(Renderer2);\n private el: ElementRef = inject(ElementRef);\n\n /**\n * Method `ngOnInit` to apply the style of this directive.\n * This is an angular lifecycle hook, so it's called automatically by Angular itself.\n * In particular, it's called only one time!!!\n */\n ngOnInit(): void {\n this.applyStyle();\n }\n\n /**\n * Method `ngOnChanges` to apply the style of this directive.\n * This is an angular lifecycle hook, so it's called automatically by Angular itself.\n * In particular, it's called when any data-bound property of a directive changes!!!\n */\n ngOnChanges(): void {\n this.applyStyle();\n }\n\n /**\n * Private method to change both width and flex-wrap css properties.\n */\n private applyStyle(): void {\n this.renderer.setStyle(this.el.nativeElement, 'width', this.width());\n this.renderer.setStyle(this.el.nativeElement, 'flex-wrap', this.wrap() ? 'wrap' : 'nowrap');\n }\n}\n","/*\n The MIT License (MIT)\n\n Copyright (c) 2017-2026 Stefano Cappa (Ks89)\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\n\nimport { Directive, ElementRef, inject, OnChanges, OnInit, Renderer2, input } from '@angular/core';\n\n/**\n * Directive to change the flex-direction of an element, based on two inputs (`direction` and `justify`).\n */\n@Directive({ selector: '[ksDirection]' })\nexport class DirectionDirective implements OnInit, OnChanges {\n /**\n * String input to set the css flex-direction of an element.\n */\n readonly direction = input<string>();\n /**\n * String input to set the css justify-content of an element.\n */\n readonly justify = input<string>();\n\n private renderer: Renderer2 = inject(Renderer2);\n private el: ElementRef = inject(ElementRef);\n\n /**\n * Method `ngOnInit` to apply the style of this directive.\n * This is an angular lifecycle hook, so it's called automatically by Angular itself.\n * In particular, it's called only one time!!!\n */\n ngOnInit(): void {\n this.applyStyle();\n }\n\n /**\n * Method `ngOnChanges` to apply the style of this directive.\n * This is an angular lifecycle hook, so it's called automatically by Angular itself.\n * In particular, it's called when any data-bound property of a directive changes!!!\n */\n ngOnChanges(): void {\n this.applyStyle();\n }\n\n /**\n * Private method to change both direction and justify of an element.\n */\n private applyStyle(): void {\n const direction = this.direction();\n const justify = this.justify();\n if (!direction || !justify) {\n return;\n }\n this.renderer.setStyle(this.el.nativeElement, 'flex-direction', direction);\n this.renderer.setStyle(this.el.nativeElement, 'justify-content', justify);\n }\n}\n","/*\n The MIT License (MIT)\n\n Copyright (c) 2017-2026 Stefano Cappa (Ks89)\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\n\nimport { Directive, ElementRef, inject, OnChanges, OnInit, Renderer2, input } from '@angular/core';\n\nimport { Image } from '../model/image.class';\nimport { SafeResourceUrl } from '@angular/platform-browser';\n\n/**\n * Directive to add an image to an `<a>` tag with some additional custom properties.\n */\n@Directive({ selector: '[ksATagBgImage]' })\nexport class ATagBgImageDirective implements OnInit, OnChanges {\n /**\n * Object of type `Image` that represents the image to add to the `<a>` tag.\n */\n readonly image = input.required<Image>();\n /**\n * Additional style to customize the background attribute.\n * Empty string by default.\n */\n readonly style = input<string>();\n\n private renderer: Renderer2 = inject(Renderer2);\n private el: ElementRef = inject(ElementRef);\n\n /**\n * Method `ngOnInit` to apply the style of this directive.\n * This is an angular lifecycle hook, so it's called automatically by Angular itself.\n * In particular, it's called only one time!!!\n */\n ngOnInit(): void {\n this.applyStyle();\n }\n\n /**\n * Method `ngOnChanges` to apply the style of this directive.\n * This is an angular lifecycle hook, so it's called automatically by Angular itself.\n * In particular, it's called when any data-bound property of a directive changes!!!\n */\n ngOnChanges(): void {\n this.applyStyle();\n }\n\n /**\n * Private method to add an image as background of an `<a>` tag.\n */\n private applyStyle(): void {\n const image = this.image();\n if (!image || (!image.plain && !image.modal)) {\n return;\n }\n\n const imgPath: string | SafeResourceUrl = image.plain && image.plain.img ? image.plain.img : image.modal.img;\n // Encode double quotes to prevent breaking out of the CSS url(\"...\") context (CSS injection)\n const safeImgPath = imgPath.toString().replace(/\"/g, '%22');\n let bg = `url(\"${safeImgPath}\") ${this.style()}`;\n\n const fallbackImgPath: string | SafeResourceUrl | undefined =\n image.plain && image.plain.fallbackImg ? image.plain.fallbackImg : image.modal.fallbackImg;\n if (!!fallbackImgPath) {\n // Same encoding applied to fallback path for the same reason\n const safeFallbackPath = fallbackImgPath.toString().replace(/\"/g, '%22');\n bg += `, url(\"${safeFallbackPath}\") ${this.style()}`;\n }\n\n this.renderer.setStyle(this.el.nativeElement, 'background', bg);\n }\n}\n","/*\n The MIT License (MIT)\n\n Copyright (c) 2017-2026 Stefano Cappa (Ks89)\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\n\nimport { ChangeDetectionStrategy, Component, inject, OnChanges, OnInit, SimpleChange, SimpleChanges, output, input } from '@angular/core';\n\nimport { AccessibilityConfig } from '../../model/accessibility.interface';\nimport { Image } from '../../model/image.class';\nimport { Size } from '../../model/size.interface';\nimport { GridLayout, LineLayout, PlainGalleryConfig, PlainGalleryStrategy } from '../../model/plain-gallery-config.interface';\nimport { getIndex } from '../../utils/image.util';\nimport { ConfigService } from '../../services/config.service';\nimport { NEXT } from '../../utils/user-input.util';\nimport { AccessibleComponent } from '../accessible.component';\nimport { PlainLibConfig, LibConfig } from '../../model/lib-config.interface';\nimport { WrapDirective } from '../../directives/wrap.directive';\nimport { DirectionDirective } from '../../directives/direction.directive';\nimport { FallbackImageDirective } from '../../directives/fallback-image.directive';\nimport { SizeDirective } from '../../directives/size.directive';\nimport { ATagBgImageDirective } from '../../directives/a-tag-bg-image.directive';\n\n/**\n * Component with the gallery of thumbs.\n * In receives an array of Images, a boolean to show/hide\n * the gallery (feature used by imagePointer) and a config\n * object to customize the behaviour of this component.\n * Also, it emits click events as outputs.\n */\n@Component({\n selector: 'ks-plain-gallery',\n styleUrls: ['plain-gallery.scss'],\n templateUrl: 'plain-gallery.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [WrapDirective, DirectionDirective, FallbackImageDirective, SizeDirective, ATagBgImageDirective]\n})\nexport class PlainGalleryComponent extends AccessibleComponent implements OnInit, OnChanges {\n /**\n * Unique id (>=0) of the current instance of this library. This is required when you are using\n * the service to call modal gallery.\n */\n readonly id = input<number>();\n\n /**\n * Array of `Image` that represent the model of this library with all images, thumbs and so on.\n */\n readonly images = input<Image[]>([]);\n /**\n * PlainLibConfig object to configure plain-gallery.\n */\n readonly config = input<PlainLibConfig>();\n\n /**\n * Output to emit an event when an image is clicked.\n */\n readonly clickImage = output<number>();\n\n /**\n * Object of type `PlainGalleryConfig` to configure the plain gallery.\n */\n plainGalleryConfig: PlainGalleryConfig | undefined;\n\n /**\n * Object of type `AccessibilityConfig` to init custom accessibility features.\n * For instance, it contains titles, alt texts, aria-labels and so on.\n */\n accessibilityConfig: AccessibilityConfig | undefined;\n\n /**\n * Bi-dimensional array of `Image` object to store images to display as plain gallery.\n * [] by default.\n */\n imageGrid: Image[][] = [];\n /**\n * Size object used in the template to resize images.\n */\n size: Size | undefined;\n /**\n * Boolean passed as input to `ks-wrap` directive to configure flex-wrap css property.\n * However, it's not enough, because you need to limit the width using `widthStyle` public variable.\n * For more info check https://developer.mozilla.org/it/docs/Web/CSS/flex-wrap\n */\n wrapStyle = false;\n /**\n * String passed as input to `ks-wrap` directive to set width to be able to force overflow.\n * In this way, `wrapStyle` (flex-wrap css property) will be used as requested.\n */\n widthStyle = '';\n /**\n * String passed as input to `ks-direction` directive to set the flex-direction css property.\n * For more info check https://developer.mozilla.org/it/docs/Web/CSS/flex-direction\n */\n directionStyle: string | undefined;\n /**\n * String passed as input to `ks-direction` directive to set the justify-content css property.\n * For more info check https://developer.mozilla.org/it/docs/Web/CSS/justify-content\n */\n justifyStyle: string | undefined;\n\n private configService: ConfigService = inject(ConfigService);\n\n /**\n * Method `ngOnInit` to init both `configPlainGallery` calling `initPlainGalleryConfig()`\n * and `imageGrid invoking `initImageGrid()`.\n * This is an angular lifecycle hook, so it's called automatically by Angular itself.\n * In particular, it's called only one time!!!\n */\n ngOnInit(): void {\n const id = this.id();\n if (id === null || id === undefined) {\n throw new Error('Internal library error - id must be defined');\n }\n this.configService.setConfig(id, this.config());\n\n const libConfig: LibConfig | undefined = this.configService.getConfig(id);\n if (!libConfig) {\n throw new Error('Internal library error - libConfig must be defined');\n }\n this.accessibilityConfig = libConfig.accessibilityConfig;\n this.plainGalleryConfig = libConfig.plainGalleryConfig;\n this.initImageGrid();\n }\n\n /**\n * Method `ngOnChanges` to update both `imageGrid` and `plainGalleryConfig`.\n * This is an angular lifecycle hook, so it's called automatically by Angular itself.\n * In particular, it's called when any data-bound property of a directive changes!!!\n */\n ngOnChanges(changes: SimpleChanges): void {\n const id = this.id();\n if (id === null || id === undefined) {\n throw new Error('Internal library error - id must be defined');\n }\n const libConfig: LibConfig | undefined = this.configService.getConfig(id);\n if (!libConfig) {\n throw new Error('Internal library error - libConfig must be defined');\n }\n\n const imagesChange: SimpleChange = changes['images'];\n const configChange: SimpleChange = changes['config'];\n // I'm using !change.firstChange because the first time will be called both onInit and onChange and I don't\n // want to execute initialization two times.\n if (\n configChange &&\n !configChange.firstChange &&\n (configChange.previousValue !== configChange.currentValue || (!configChange.previousValue && !configChange.currentValue))\n ) {\n this.plainGalleryConfig = libConfig.plainGalleryConfig;\n // this.configPlainGallery = this.initPlainGalleryConfig();\n }\n if (imagesChange && !imagesChange.firstChange && imagesChange.previousValue !== imagesChange.currentValue) {\n this.initImageGrid();\n }\n }\n\n /**\n * Method called when you click on an image of the plain (or inline) gallery.\n * This will emit the show event with the image as payload.\n * @param img is the Image to show\n */\n showModalGalleryByImage(img: Image): void {\n const index: number = this.images().findIndex((val: Image) => val && img && val.id === img.id);\n this.showModalGallery(index);\n }\n\n /**\n * Method called when you navigate between images.\n * This will emit the show event with the image as payload.\n * @param event KeyboardEvent that triggered the navigation\n * @param img is the Image to show\n */\n onNavigationEvent(event: KeyboardEvent, img: Image): void {\n const result: number = super.handleImageEvent(event);\n if (result === NEXT) {\n this.showModalGalleryByImage(img);\n }\n }\n\n /**\n * Method to get `alt attribute`.\n * `alt` specifies an alternate text for an image, if the image cannot be displayed.\n * @param image to get its alt description.\n * @returns string alt description of the image\n */\n getAltPlainDescriptionByImage(image: Image): string {\n if (!image) {\n return '';\n }\n return image.plain && image.plain.description ? image.plain.description : `Image ${getIndex(image, this.images()) + 1}`;\n }\n\n /**\n * Method to get the title for an image.\n * @param image to get its title\n * @returns string the title of the input image\n */\n getTitleDisplay(image: Image): string {\n let description = '';\n\n if (image.plain && image.plain.description) {\n description = image.plain.description;\n } else if (image.modal && image.modal.description) {\n description = image.modal.description;\n }\n\n const currentIndex: number = getIndex(image, this.images());\n const prevDescription: string = 'Image ' + (currentIndex + 1) + '/' + this.images().length;\n let currImgDescription: string = description ? description : '';\n\n if (currImgDescription !== '') {\n currImgDescription = ' - ' + currImgDescription;\n }\n return prevDescription + currImgDescription;\n }\n\n /**\n * Method called when you click on an image of the plain (or inline) gallery.\n * This will emit the show event with the index number as payload.\n * @param index number of the clicked image\n */\n private showModalGallery(index: number): void {\n this.clickImage.emit(index);\n }\n\n /**\n * Private method to init both `imageGrid` and other style variables,\n * based on the layout type.\n */\n private initImageGrid(): void {\n if (!this.plainGalleryConfig) {\n throw new Error('Internal library error - plainGalleryConfig must be defined');\n }\n\n // reset the array to prevent issues in case of GridLayout\n this.imageGrid = [];\n\n if (this.plainGalleryConfig.layout instanceof LineLayout) {\n const layout: LineLayout = this.plainGalleryConfig.layout;\n const row: Image[] = this.images().filter((val: Image, i: number) => i < layout.breakConfig.length || layout.breakConfig.length === -1);\n this.imageGrid = [row];\n\n this.size = this.plainGalleryConfig.layout.size;\n\n switch (this.plainGalleryConfig.strategy) {\n case PlainGalleryStrategy.ROW:\n this.directionStyle = 'row';\n break;\n case PlainGalleryStrategy.COLUMN:\n this.directionStyle = 'column';\n this.wrapStyle = layout.breakConfig.wrap;\n break;\n }\n this.justifyStyle = layout.justify;\n }\n\n if (this.plainGalleryConfig.layout instanceof GridLayout) {\n const layout: GridLayout = this.plainGalleryConfig.layout;\n const count: number = Math.ceil(this.images().length / layout.breakConfig.length);\n let start = 0;\n let end: number = layout.breakConfig.length - 1;\n\n for (let j = 0; j < count; j++) {\n const row: Image[] = this.images().filter((val: Image, i: number) => i >= start && i <= end);\n this.imageGrid.push(row);\n start = end + 1;\n end = start + layout.breakConfig.length - 1;\n }\n\n this.size = this.plainGalleryConfig.layout.size;\n\n if (layout.size.width) {\n const pixels: number = +(layout.size.width).replace('px', '');\n if (isFinite(pixels) && pixels > 0 && pixels <= 10000 && layout.breakConfig.length > 0 && layout.breakConfig.length <= 1000) {\n this.widthStyle = pixels * layout.breakConfig.length + pixels / 2 + 'px';\n }\n }\n this.wrapStyle = layout.breakConfig.wrap;\n\n this.directionStyle = 'row';\n }\n }\n}\n","<div class=\"plain-container\"\n ksWrap [wrap]=\"wrapStyle\" [width]=\"widthStyle\"\n ksDirection [direction]=\"directionStyle\" [justify]=\"justifyStyle\"\n [attr.aria-label]=\"accessibilityConfig?.plainGalleryContentAriaLabel\"\n [title]=\"$safeNavigationMigration(accessibilityConfig?.plainGalleryContentTitle)\">\n\n @for (imgRow of imageGrid; let i = $index; track i) {\n @for (imgCol of imgRow; let j = $index; track j) {\n @if (!plainGalleryConfig?.advanced?.aTags) {\n @if (imgCol?.modal?.img) {\n <img loading=\"{{imgCol.loading}}\"\n [attr.fetchpriority]=\"imgCol.fetchpriority\"\n [src]=\"imgCol.plain?.img! ? $safeNavigationMigration(imgCol.plain?.img)! : imgCol.modal.img\"\n ksFallbackImage [fallbackImg]=\"imgCol.plain?.fallbackImg ? $safeNavigationMigration(imgCol.plain?.fallbackImg) : imgCol.modal.fallbackImg\"\n class=\"image\"\n ksSize [sizeConfig]=\"{width: $safeNavigationMigration(size?.width)!, height: $safeNavigationMigration(size?.height)!}\"\n [attr.aria-label]=\"imgCol.plain?.ariaLabel\"\n [title]=\"(imgCol.plain?.title || imgCol.plain?.title === '') ? $safeNavigationMigration(imgCol.plain?.title) : getTitleDisplay(imgCol)\"\n alt=\"{{imgCol.plain?.alt! ? imgCol.plain?.alt! : getAltPlainDescriptionByImage(imgCol)}}\"\n [tabIndex]=\"0\" role=\"img\"\n (click)=\"showModalGalleryByImage(imgCol)\" (keyup)=\"onNavigationEvent($event, imgCol)\" />\n }\n } @else {\n <!-- Add directive to set background with the image url as param to pass thumb or img-->\n <!-- to do something like this <a style=\"background: url('path to image') 50% 50%/cover\">.-->\n @if (imgCol?.modal?.img) {\n <a class=\"a-tag-image\"\n ksATagBgImage [image]=\"imgCol\" [style]=\"plainGalleryConfig?.advanced?.additionalBackground\"\n ksSize [sizeConfig]=\"{width: $safeNavigationMigration(size?.width)!, height: $safeNavigationMigration(size?.height)!}\"\n [attr.aria-label]=\"imgCol.plain?.ariaLabel\"\n [title]=\"(imgCol.plain?.title || imgCol.plain?.title === '') ? $safeNavigationMigration(imgCol.plain?.title) : getTitleDisplay(imgCol)\"\n [tabIndex]=\"0\"\n (click)=\"showModalGalleryByImage(imgCol)\" (keyup)=\"onNavigationEvent($event, imgCol)\"></a>\n }\n }\n }\n }\n\n</div>\n\n","/*\n The MIT License (MIT)\n\n Copyright (c) 2017-2026 Stefano Cappa (Ks89)\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\n\nimport { InjectionToken, Type } from '@angular/core';\n\nimport { ModalGalleryConfig } from '../../model/modal-gallery-config.interface';\n\nexport const DIALOG_DATA = new InjectionToken<ModalGalleryConfig>('DIALOG_DATA');\nexport const MODAL_GALLERY_COMPONENT = new InjectionToken<Type<unknown>>('MODAL_GALLERY_COMPONENT');\n","/*\n The MIT License (MIT)\n\n Copyright (c) 2017-2026 Stefano Cappa (Ks89)\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\n\nimport { Injectable } from '@angular/core';\n\n/**\n * Service to check if the provided id is unique\n */\n@Injectable({ providedIn: 'root' })\nexport class IdValidatorService {\n ids = new Map();\n\n /**\n * Method to check and reserve an id for the current instance of the library.\n * In this way, no other instances can use the same id.\n * @param galleryId number or undefined that represents the unique id of the gallery.\n * @return boolean true if success. false is never returned, instead an exception is thrown\n * @throws a error with a message if galleryId is neither unique, < 0 or an integer\n */\n checkAndAdd(galleryId: number | undefined): boolean {\n if (galleryId === undefined || !Number.isInteger(galleryId) || galleryId < 0) {\n throw new Error('You must provide a valid [id]=\"unique integer > 0 here\" to the gallery/carousel in your template');\n }\n if (this.ids.get(galleryId)) {\n throw new Error(`Cannot create gallery with id=${galleryId} because already used in your application. This must be a unique integer >= 0`);\n }\n this.ids.set(galleryId, galleryId);\n return true;\n }\n\n /**\n * Method to remove a reserved id. In this way you are able to use the id again for another instance of the library.\n * @param galleryId number or undefined that represents the unique id of the gallery.\n * @return boolean true if success. false is never returned, instead an exception is thrown*\n * @throws a error with a message if galleryId is neither integer or < 0\n * * this should be improved without return true, because it doesn't make sense! :(\n */\n remove(galleryId: number | undefined): boolean {\n if (galleryId === undefined || !Number.isInteger(galleryId) || galleryId < 0) {\n throw new Error('You must provide a valid [id]=\"unique integer > 0 here\" to the gallery/carousel in your template');\n }\n this.ids.delete(galleryId);\n return true;\n }\n}\n","/*\n The MIT License (MIT)\n\n Copyright (c) 2017-2026 Stefano Cappa (Ks89)\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\n\nimport { OverlayRef } from '@angular/cdk/overlay';\n\nimport { Subject } from 'rxjs';\nimport { ImageModalEvent } from '../../model/image.class';\nimport { ButtonEvent } from '../../model/buttons-config.interface';\n\n/**\n * Class that represents the modal dialog instance.\n * It is returned by the open method.\n */\nexport class ModalGalleryRef {\n private close = new Subject<ImageModalEvent>();\n close$ = this.close.asObservable();\n private show = new Subject<ImageModalEvent>();\n show$ = this.show.asObservable();\n private firstImage = new Subject<ImageModalEvent>();\n firstImage$ = this.firstImage.asObservable();\n private lastImage = new Subject<ImageModalEvent>();\n lastImage$ = this.lastImage.asObservable();\n private hasData = new Subject<ImageModalEvent>();\n hasData$ = this.hasData.asObservable();\n private buttonBeforeHook = new Subject<ButtonEvent>();\n buttonBeforeHook$ = this.buttonBeforeHook.asObservable();\n private buttonAfterHook = new Subject<ButtonEvent>();\n buttonAfterHook$ = this.buttonAfterHook.asObservable();\n\n private overlayRef: OverlayRef;\n private closed = false;\n\n constructor(overlayRef: OverlayRef) {\n this.overlayRef = overlayRef;\n }\n\n /**\n * Close modal dialog, disposing the Overlay.\n */\n closeModal(): void {\n if (this.closed) {\n return;\n }\n this.closed = true;\n this.overlayRef.dispose();\n this.completeSubjects();\n }\n\n /**\n * Method to emit close event.\n * @param event ImageModalEvent event payload\n */\n emitClose(event: ImageModalEvent): void {\n this.close.next(event);\n }\n\n /**\n * Method to emit show event.\n * @param event ImageModalEvent event payload\n */\n emitShow(event: ImageModalEvent): void {\n this.show.next(event);\n }\n\n /**\n * Method to emit firstImage event.\n * @param event ImageModalEvent event payload\n */\n emitFirstImage(event: ImageModalEvent): void {\n this.firstImage.next(event);\n }\n\n /**\n * Method to emit lastImage event.\n * @param event ImageModalEvent event payload\n */\n emitLastImage(event: ImageModalEvent): void {\n this.lastImage.next(event);\n }\n\n /**\n * Method to emit hasData event.\n * @param event ImageModalEvent event payload\n */\n emitHasData(event: ImageModalEvent): void {\n this.hasData.next(event);\n }\n\n /**\n * Method to emit buttonBeforeHook event.\n * @param event ImageModalEvent event payload\n */\n emitButtonBeforeHook(event: ButtonEvent): void {\n this.buttonBeforeHook.next(event);\n }\n\n /**\n * Method to emit buttonAfterHook event.\n * @param event ImageModalEvent event payload\n */\n emitButtonAfterHook(event: ButtonEvent): void {\n this.buttonAfterHook.next(event);\n }\n\n private completeSubjects(): void {\n this.close.complete();\n this.show.complete();\n this.firstImage.complete();\n this.lastImage.complete();\n this.hasData.complete();\n this.buttonBeforeHook.complete();\n this.buttonAfterHook.complete();\n }\n}\n","import { inject, Injectable, Injector } from '@angular/core';\nimport { ComponentPortal } from '@angular/cdk/portal';\nimport { GlobalPositionStrategy, Overlay, OverlayConfig, OverlayRef } from '@angular/cdk/overlay';\nimport { Subject, take } from 'rxjs';\n\nimport { ModalGalleryRef } from './modal-gallery-ref';\nimport { DIALOG_DATA, MODAL_GALLERY_COMPONENT } from './modal-gallery.tokens';\nimport { Image, ImageModalEvent } from '../../model/image.class';\nimport { ConfigService } from '../../services/config.service';\nimport { ButtonEvent } from '../../model/buttons-config.interface';\nimport { ModalGalleryConfig } from '../../model/modal-gallery-config.interface';\nimport { LibConfig } from '../../model/lib-config.interface';\n\n// private interface used only in this file\ninterface ModalDialogConfig {\n panelClass: string;\n hasBackdrop: boolean;\n backdropClass: string;\n}\n\nconst DEFAULT_DIALOG_CONFIG: ModalDialogConfig = {\n hasBackdrop: true,\n backdropClass: 'ks-modal-gallery-backdrop',\n panelClass: 'ks-modal-gallery-panel'\n};\n\n@Injectable({providedIn: 'root'})\nexport class ModalGalleryService {\n private updateImages = new Subject<Image[]>();\n updateImages$ = this.updateImages.asObservable();\n\n private dialogRef: ModalGalleryRef | undefined;\n\n private overlay: Overlay = inject(Overlay);\n private injector: Injector = inject(Injector);\n private modalGalleryComponent = inject(MODAL_GALLERY_COMPONENT);\n private configService: ConfigService = inject(ConfigService);\n\n /**\n * Method to open modal gallery passing the configuration\n * @param config ModalGalleryConfig that contains: id, array of images, current image and optionally the configuration object\n * @return ModalGalleryRef | undefined is the object used to listen for events.\n */\n open(config: ModalGalleryConfig): ModalGalleryRef | undefined {\n // Returns an OverlayRef which is a PortalHost\n const overlayRef: OverlayRef = this.createOverlay();\n // Instantiate a reference to the dialog\n this.dialogRef = new ModalGalleryRef(overlayRef);\n // Attach dialog container\n const injector: Injector = Injector.create({\n parent: this.injector,\n providers: [\n { provide: ModalGalleryRef, useValue: this.dialogRef },\n { provide: DIALOG_DATA, useValue: config }\n ]\n });\n overlayRef.attach(new ComponentPortal(this.modalGalleryComponent, null, injector));\n overlayRef.backdropClick().pipe(take(1)).subscribe(() => {\n if (this.dialogRef) {\n this.dialogRef.closeModal();\n }\n });\n return this.dialogRef;\n }\n\n /**\n * Method to close a modal gallery previously opened.\n * @param id Unique identifier of the modal gallery\n * @param clickOutside boolean is true if closed clicking on the modal backdrop, false otherwise.\n */\n close(id: number, clickOutside: boolean): void {\n const libConfig: LibConfig | undefined = this.configService.getConfig(id);\n if (clickOutside) {\n if (this.dialogRef && libConfig && libConfig.enableCloseOutside) {\n this.dialogRef.closeModal();\n }\n } else {\n if (this.dialogRef) {\n this.dialogRef.closeModal();\n }\n }\n }\n\n /**\n * Method to update images array.\n * @param images Image[] updated array of images\n */\n updateModalImages(images: Image[]): void {\n this.updateImages.next(images);\n }\n\n /**\n * Method to emit close event.\n * @param event ImageModalEvent is the event payload\n */\n emitClose(event: ImageModalEvent): void {\n if (!this.dialogRef) {\n return;\n }\n this.dialogRef.emitClose(event);\n }\n\n /**\n * Method to emit show event.\n * @param event ImageModalEvent is the event payload\n */\n emitShow(event: ImageModalEvent): void {\n if (!this.dialogRef) {\n return;\n }\n this.dialogRef.emitShow(event);\n }\n\n /**\n * Method to emit firstImage event.\n * @param event ImageModalEvent is the event payload\n */\n emitFirstImage(event: ImageModalEvent): void {\n if (!this.dialogRef) {\n return;\n }\n this.dialogRef.emitFirstImage(event);\n }\n\n /**\n * Method to emit lastImage event.\n * @param event ImageModalEvent is the event payload\n */\n emitLastImage(event: ImageModalEvent): void {\n if (!this.dialogRef) {\n return;\n }\n this.dialogRef.emitLastImage(event);\n }\n\n /**\n * Method to emit hasData event.\n * @param event ImageModalEvent is the event payload\n */\n emitHasData(event: ImageModalEvent): void {\n if (!this.dialogRef) {\n return;\n }\n this.dialogRef.emitHasData(event);\n }\n\n /**\n * Method to emit buttonBeforeHook event.\n * @param event ButtonEvent is the event payload\n */\n emitButtonBeforeHook(event: ButtonEvent): void {\n if (!this.dialogRef) {\n return;\n }\n this.dialogRef.emitButtonBeforeHook(event);\n }\n\n /**\n * Method to emit buttonAfterHook event.\n * @param event ButtonEvent is the event payload\n */\n emitButtonAfterHook(event: ButtonEvent): void {\n if (!this.dialogRef) {\n return;\n }\n this.dialogRef.emitButtonAfterHook(event);\n }\n\n /**\n * Private method to create an Overlay using Angular CDK APIs\n * @private\n */\n private createOverlay(): OverlayRef {\n const overlayConfig = this.getOverlayConfig();\n return this.overlay.create(overlayConfig);\n }\n\n /**\n * Private method to create an OverlayConfig instance\n * @private\n */\n private getOverlayConfig(): OverlayConfig {\n const positionStrategy: GlobalPositionStrategy = this.overlay.position().global().centerHorizontally().centerVertically();\n return new OverlayConfig({\n hasBackdrop: DEFAULT_DIALOG_CONFIG.hasBackdrop,\n backdropClass: DEFAULT_DIALOG_CONFIG.backdropClass,\n panelClass: DEFAULT_DIALOG_CONFIG.panelClass,\n scrollStrategy: this.overlay.scrollStrategies.block(),\n positionStrategy\n });\n }\n}\n","/*\n The MIT License (MIT)\n\n Copyright (c) 2017-2026 Stefano Cappa (Ks89)\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\n\nimport { Directive, HostListener, output, input } from '@angular/core';\n\n/**\n * Directive to close the modal gallery clicking on the semi-transparent background.\n * In fact, it listens for a click on all elements that aren't 'inside' and it emits\n * an event using `@Output clickOutside`.\n */\n@Directive({ selector: '[ksClickOutside]' })\nexport class ClickOutsideDirective {\n /**\n * Boolean to enable this directive.\n */\n clickOutsideEnable = input<boolean>();\n /**\n * Output to emit an event if the clicked element class doesn't contain 'inside' or it is 'hidden'. The payload is a boolean.\n */\n readonly clickOutside = output<boolean>();\n\n /**\n * Method called by Angular itself every click thanks to `@HostListener`.\n * @param event MouseEvent\n */\n @HostListener('click', ['$event'])\n onClick(event: MouseEvent): void {\n event.stopPropagation();\n\n // tslint:disable-next-line:no-any\n const target: any = event.target;\n\n if (!this.clickOutsideEnable() || !target) {\n return;\n }\n\n let isInside = false;\n let isHidden = false;\n\n if (typeof target.className !== 'string') {\n // it happens with @fortawesome/fontawesome 5\n // for some reason className is an object with 2 empty properties inside\n isInside = true;\n } else {\n // in normal scenarios, use classname, because it's a simple string\n isInside = target.className && target.className.includes('inside');\n isHidden = target.className.includes('hidden');\n }\n\n // if inside => don't close modal gallery\n // if hidden => close modal gallery\n /*\n i i' h | close\n 0 1 0 | 1 => close modal gallery\n 0 1 1 | 1 => close modal gallery\n 1 0 0 | 0\n 1 0 1 | 1 => close modal gallery\n */\n if (!isInside || isHidden) {\n // close modal gallery\n this.clickOutside.emit(true);\n }\n }\n}\n","import {\n afterNextRender,\n ChangeDetectionStrategy, ChangeDetectorRef, Component,\n HostListener, OnDestroy, OnInit, PLATFORM_ID, SecurityContext, TemplateRef, inject,\n viewChild\n} from '@angular/core';\nimport { DOCUMENT, isPlatformBrowser } from '@angular/common';\nimport { DomSanitizer } from '@angular/platform-browser';\n\nimport { Subscription } from 'rxjs';\n\nimport { DIALOG_DATA } from './modal-gallery.tokens';\nimport { Image, ImageModalEvent } from '../../model/image.class';\nimport { ConfigService } from '../../services/config.service';\nimport { DotsConfig } from '../../model/dots-config.interface';\nimport { ButtonConfig, ButtonEvent, ButtonsConfig, ButtonType } from '../../model/buttons-config.interface';\nimport { InternalLibImage } from '../../model/image-internal.class';\nimport { Action } from '../../model/action.enum';\nimport { CurrentImageComponent, ImageLoadEvent } from '../current-image/current-image.component';\nimport { IdValidatorService } from '../../services/id-validator.service';\nimport { KeyboardConfig } from '../../model/keyboard-config.interface';\nimport { PreviewConfig } from '../../model/preview-config.interface';\nimport { SlideConfig } from '../../model/slide-config.interface';\nimport { AccessibilityConfig } from '../../model/accessibility.interface';\nimport { PlainGalleryConfig } from '../../model/plain-gallery-config.interface';\nimport { KS_DEFAULT_ACCESSIBILITY_CONFIG } from '../accessibility-default';\nimport { CurrentImageConfig } from '../../model/current-image-config.interface';\nimport { ModalGalleryService } from './modal-gallery.service';\nimport { LibConfig } from '../../model/lib-config.interface';\nimport { ModalGalleryConfig } from '../../model/modal-gallery-config.interface';\nimport { ClickOutsideDirective } from '../../directives/click-outside.directive';\nimport { UpperButtonsComponent } from '../upper-buttons/upper-buttons.component';\nimport { DotsComponent } from '../dots/dots.component';\nimport { PreviewsComponent } from '../previews/previews.component';\n\n@Component({\n selector: 'ks-modal-gallery',\n templateUrl: './modal-gallery.component.html',\n styleUrls: ['./modal-gallery.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [ClickOutsideDirective, UpperButtonsComponent, CurrentImageComponent, DotsComponent, PreviewsComponent]\n})\nexport class ModalGalleryComponent implements OnInit, OnDestroy {\n /**\n * Reference to the CurrentImageComponent to invoke methods on it.\n */\n readonly currentImageComponent = viewChild(CurrentImageComponent);\n\n /**\n * Unique id (>=0) of the current instance of this library. This is useful when you are using\n * the service to call modal gallery without open it manually.\n */\n id: number;\n /**\n * Object of type `ButtonsConfig` to show/hide buttons.\n */\n buttonsConfig!: ButtonsConfig;\n /**\n * Boolean to enable modal-gallery close behaviour when clicking\n * on the semi-transparent background. Enabled by default.\n */\n enableCloseOutside = true;\n /**\n * Object of type `DotsConfig` to init DotsComponent's features.\n * For instance, it contains a param to show/hide dots.\n */\n dotsConfig!: DotsConfig;\n /**\n * Object of type `PreviewConfig` to init PreviewsComponent's features.\n * For instance, it contains a param to show/hide previews.\n */\n previewConfig: PreviewConfig | undefined;\n /**\n * Object of type `SlideConfig` to init side previews and `infinite sliding`.\n */\n slideConfig: SlideConfig | undefined;\n /**\n * Object of type `AccessibilityConfig` to init custom accessibility features.\n * For instance, it contains titles, alt texts, aria-labels and so on.\n */\n accessibilityConfig: AccessibilityConfig = KS_DEFAULT_ACCESSIBILITY_CONFIG;\n /**\n * Object of type `KeyboardConfig` to assign custom keys to ESC, RIGHT and LEFT keyboard's actions.\n */\n keyboardConfig: KeyboardConfig | undefined;\n /**\n * Object of type `PlainGalleryConfig` to configure the plain gallery.\n */\n plainGalleryConfig: PlainGalleryConfig | undefined;\n /**\n * Array of `InternalLibImage` representing the model of this library with all images, thumbs and so on.\n */\n images: InternalLibImage[];\n\n /**\n * Optional template reference to use to render previews.\n */\n customPreviewsTemplate?: TemplateRef<HTMLElement>;\n\n /**\n * `Image` that is visible right now.\n */\n currentImage: InternalLibImage;\n /**\n * Boolean to open the modal gallery. False by default.\n */\n showGallery = false;\n /**\n * Object to configure this component.\n */\n libConfig: LibConfig | undefined;\n\n private readonly updateImagesSubscription: Subscription | undefined;\n\n private readonly dialogContent: ModalGalleryConfig = inject(DIALOG_DATA);\n private readonly platformId: Object = inject(PLATFORM_ID);\n private readonly document: Document = inject(DOCUMENT);\n\n /**\n * HostListener to catch the browser back button and destroy the gallery.\n * This prevents unexpected behavior about scrolling.\n * Added to fix this issue: https://github.com/Ks89/angular-modal-gallery/issues/159\n */\n @HostListener('window:popstate')\n onPopState(): void {\n this.closeGallery();\n }\n\n /**\n * HostListener to catch ctrl+s/meta+s and download the current image.\n * Inspired by https://netbasal.com/add-keyboard-shortcuts-to-your-angular-app-9bf2e89862b3\n */\n @HostListener('document:keydown.code.control.keyS', ['$event']) // windows\n @HostListener('document:keydown.code.meta.keyS', ['$event']) // macOS\n onSaveListener(event: Event): void {\n event.preventDefault();\n this.downloadImage();\n }\n\n private modalGalleryService: ModalGalleryService = inject(ModalGalleryService);\n private changeDetectorRef: ChangeDetectorRef = inject(ChangeDetectorRef);\n private idValidatorService: IdValidatorService = inject(IdValidatorService);\n private sanitizer: DomSanitizer = inject(DomSanitizer);\n private configService: ConfigService = inject(ConfigService);\n\n constructor() {\n this.id = (this.dialogContent as ModalGalleryConfig).id;\n this.images = (this.dialogContent as ModalGalleryConfig).images as InternalLibImage[];\n this.currentImage = (this.dialogContent as ModalGalleryConfig).currentImage as InternalLibImage;\n this.libConfig = (this.dialogContent as ModalGalleryConfig).libConfig;\n this.customPreviewsTemplate = (this.dialogContent as ModalGalleryConfig).previewsTemplate;\n this.configService.setConfig(this.id, this.libConfig);\n\n this.updateImagesSubscription = this.modalGalleryService.updateImages$.subscribe((images: Image[]) => {\n this.images = images.map((image: Image) => {\n const newImage: InternalLibImage = Object.assign({}, image, { previouslyLoaded: false });\n return newImage;\n });\n this.initImages();\n this.images.forEach((image: InternalLibImage) => {\n if (image.id === this.currentImage.id) {\n this.currentImage = image;\n }\n });\n this.changeDetectorRef.markForCheck();\n });\n\n afterNextRender(() => {\n this.initImages();\n this.changeDetectorRef.markForCheck();\n });\n }\n\n /**\n * Method `ngOnInit` to init images calling `initImages()`.\n * This is an angular lifecycle hook, so it's called automatically by Angular itself.\n * In particular, it's called only one time!!!\n */\n ngOnInit(): void {\n this.idValidatorService.checkAndAdd(this.id);\n\n // id is a mandatory input and must a number > 0\n if ((!this.id && this.id !== 0) || this.id < 0) {\n throw new Error(\n `'[id]=\"a number >= 0\"' is a mandatory input in angular-modal-gallery.` +\n `If you are using multiple instances of this library, please be sure to use different ids`\n );\n }\n\n const libConfig: LibConfig | undefined = this.configService.getConfig(this.id);\n if (!libConfig || !libConfig.dotsConfig) {\n throw new Error('Internal library error - libConfig and dotsConfig must be defined');\n }\n this.dotsConfig = libConfig.dotsConfig;\n this.buttonsConfig = libConfig.buttonsConfig!;\n\n }\n\n /**\n * Method called by custom upper buttons.\n * @param event ButtonEvent event payload\n */\n onCustomEmit(event: ButtonEvent): void {\n const eventToEmit: ButtonEvent = this.getButtonEventToEmit(event);\n this.modalGalleryService.emitButtonBeforeHook(eventToEmit);\n this.modalGalleryService.emitButtonAfterHook(eventToEmit);\n }\n\n /**\n * Method called by the full-screen upper button.\n * @param event ButtonEvent event payload\n */\n onFullScreen(event: ButtonEvent): void {\n const eventToEmit: ButtonEvent = this.getButtonEventToEmit(event);\n this.modalGalleryService.emitButtonBeforeHook(eventToEmit);\n if (!isPlatformBrowser(this.platformId)) {\n return;\n }\n\n // tslint:disable-next-line:no-any\n const doc: any = this.document as any;\n // tslint:disable-next-line:no-any\n const docEl: any = this.document.documentElement as any;\n\n const fullscreenDisabled: boolean = !doc.fullscreenElement && !doc.webkitFullscreenElement;\n\n // In Safari `requestFullscreen` and `exitFullscreen` are undefined. Safari requires the prefixed version `webkit-`\n // and it doesn't return promises.\n\n // I cannot call `emitButtonAfterHook` only if requestFullScreen is successful, because there are no guarantees across browsers and\n // I should also handle the case with keyboard \"esc\" button.\n\n if (fullscreenDisabled) {\n if (docEl.requestFullscreen) {\n docEl\n .requestFullscreen()\n .then(() => {})\n .catch(() => {\n console.error('Cannot request full screen');\n });\n } else if (docEl.webkitRequestFullscreen) {\n // For Safari and it doesn't return a promise\n docEl.webkitRequestFullscreen();\n }\n } else {\n if (doc.exitFullscreen) {\n doc\n .exitFullscreen()\n .then(() => {})\n .catch(() => {\n console.error('Cannot request exit full screen');\n });\n } else if (doc.webkitExitFullscreen) {\n // For Safari and it doesn't return a promise\n doc.webkitExitFullscreen();\n }\n }\n\n this.modalGalleryService.emitButtonAfterHook(eventToEmit);\n }\n\n /**\n * Method called by the delete upper button.\n * @param event ButtonEvent event payload\n */\n onDelete(event: ButtonEvent): void {\n const eventToEmit: ButtonEvent = this.getButtonEventToEmit(event);\n this.modalGalleryService.emitButtonBeforeHook(eventToEmit);\n\n if (this.images.length === 1) {\n this.closeGallery();\n }\n\n const currentImageComponent = this.currentImageComponent();\n if (!currentImageComponent) {\n throw new Error('currentImageComponent must be defined');\n }\n\n const imageIndexToDelete: number = currentImageComponent.getIndexToDelete(event.image as InternalLibImage);\n if (imageIndexToDelete === this.images.length - 1) {\n // last image\n currentImageComponent.prevImage();\n } else {\n currentImageComponent.nextImage();\n }\n\n this.modalGalleryService.emitButtonAfterHook(eventToEmit);\n }\n\n /**\n * Method called by the navigate upper button.\n * @param event ButtonEvent event payload\n */\n onNavigate(event: ButtonEvent): void {\n const eventToEmit: ButtonEvent = this.getButtonEventToEmit(event);\n this.modalGalleryService.emitButtonBeforeHook(eventToEmit);\n // To support SSR\n if (isPlatformBrowser(this.platformId)) {\n if (eventToEmit.image && eventToEmit.image.modal.extUrl) {\n const browserWindow = this.document.defaultView;\n if (!browserWindow) {\n return;\n }\n const safeUrl: string = eventToEmit.image.modal.extUrl;\n if (!/^https?:\\/\\//i.test(safeUrl)) {\n return;\n }\n // where I should open this link? The current tab or another one?\n if (eventToEmit.button && eventToEmit.button.extUrlInNewTab) {\n // in this case I should use target _blank to open the url in a new tab, however these is a security issue.\n // Prevent Reverse Tabnabbing's attacks (https://www.owasp.org/index.php/Reverse_Tabnabbing)\n // Some resources:\n // - https://www.owasp.org/index.php/HTML5_Security_Cheat_Sheet#Tabnabbing\n // - https://medium.com/@jitbit/target-blank-the-most-underestimated-vulnerability-ever-96e328301f4c\n // - https://developer.mozilla.org/en-US/docs/Web/API/Window/open\n const newWindow: Window | null = browserWindow.open(safeUrl, '_blank', 'noopener,noreferrer');\n // it returns null if the call failed, so I have to do this check\n if (newWindow) {\n newWindow.opener = null; // required to prevent security issues\n // emit only in case of success\n this.modalGalleryService.emitButtonAfterHook(eventToEmit);\n }\n } else {\n this.updateLocationHref(safeUrl);\n // emit only in case of success\n this.modalGalleryService.emitButtonAfterHook(eventToEmit);\n }\n }\n }\n }\n\n /**\n * This method is defined to be spied and replaced in unit testing with a fake method call.\n * It must be public to be able to use jasmine spyOn method.\n * @param newHref string new url\n */\n updateLocationHref(newHref: string) {\n const browserWindow = this.document.defaultView;\n if (!browserWindow) {\n return;\n }\n browserWindow.location.href = newHref;\n }\n\n /**\n * Method called by the download upper button.\n * @param event ButtonEvent event payload\n */\n onDownload(event: ButtonEvent): void {\n const eventToEmit: ButtonEvent = this.getButtonEventToEmit(event);\n this.modalGalleryService.emitButtonBeforeHook(eventToEmit);\n this.downloadImage();\n this.modalGalleryService.emitButtonAfterHook(eventToEmit);\n }\n\n /**\n * Method called by the close upper button.\n * @param event ButtonEvent event payload\n * @param action Action that triggered the close method. `Action.NORMAL` by default\n */\n onCloseGalleryButton(event: ButtonEvent, action: Action = Action.NORMAL): void {\n const eventToEmit: ButtonEvent = this.getButtonEventToEmit(event);\n this.modalGalleryService.emitButtonBeforeHook(eventToEmit);\n this.closeGallery(action, false);\n }\n\n /**\n * Method called by CurrentImageComponent.\n * @param event ImageModalEvent event payload\n * @param action Action that triggered the close method. `Action.NORMAL` by default\n */\n onCloseGallery(event: ImageModalEvent, action: Action = Action.NORMAL): void {\n // remap ImageModalEvent to ButtonEvent\n const buttonEvent: ButtonEvent = {\n button: {\n type: ButtonType.CLOSE\n } as ButtonConfig,\n image: null,\n action: event.action,\n galleryId: event.galleryId\n };\n this.modalGalleryService.emitButtonBeforeHook(buttonEvent);\n this.closeGallery(action, false);\n }\n\n /**\n * Method to close the modal gallery specifying the action.\n * @param action Action action type. `Action.NORMAL` by default\n * @param clickOutside boolean that is true if called clicking on the modal background. False by default.\n */\n closeGallery(action: Action = Action.NORMAL, clickOutside: boolean = false): void {\n const libConfig: LibConfig | undefined = this.configService.getConfig(this.id);\n if (!libConfig) {\n throw new Error('Internal library error - libConfig must be defined');\n }\n\n this.modalGalleryService.emitClose(new ImageModalEvent(this.id, action, true));\n this.modalGalleryService.close(this.id, clickOutside);\n }\n\n /**\n * Method called when the image changes and used to update the `currentImage` object.\n * @param event ImageModalEvent event payload\n */\n onChangeCurrentImage(event: ImageModalEvent): void {\n const newIndex: number = event.result as number;\n if (newIndex < 0 || newIndex >= this.images.length) {\n return;\n }\n\n this.currentImage = this.images[newIndex];\n\n // emit current visible image index\n this.modalGalleryService.emitShow(new ImageModalEvent(this.id, event.action, newIndex + 1));\n\n // emit first/last event based on newIndex value\n this.emitBoundaryEvent(event.action, newIndex);\n }\n\n /**\n * Method called when you click 'outside' (i.e. on the semi-transparent background)\n * to close the modal gallery if `enableCloseOutside` is true.\n * @param event boolean that is true to close the modal gallery, false otherwise\n */\n onClickOutside(event: boolean): void {\n if (event && this.enableCloseOutside) {\n this.closeGallery(Action.CLICK, true);\n }\n }\n\n /**\n * Method called when an image is loaded and the loading spinner has gone.\n * It sets the previouslyLoaded flag inside the Image to hide loading spinner when displayed again.\n * @param event ImageLoadEvent event payload\n */\n onImageLoad(event: ImageLoadEvent): void {\n // sets as previously loaded the image with index specified by `event.status`\n this.images = this.images.map((img: InternalLibImage) => {\n if (img && img.id === event.id) {\n return Object.assign({}, img, { previouslyLoaded: event.status });\n }\n return img;\n });\n }\n\n /**\n * Method called when a dot is clicked and used to update the current image.\n * @param index number index of the clicked dot\n */\n onClickDot(index: number): void {\n this.currentImage = this.images[index];\n }\n\n /**\n * Method called when an image preview is clicked and used to update the current image.\n * @param event ImageModalEvent preview image\n */\n onClickPreview(event: ImageModalEvent): void {\n this.onChangeCurrentImage(event);\n }\n\n /**\n * Method to cleanup resources.\n * This is an angular lifecycle hook that is called when this component is destroyed.\n */\n ngOnDestroy(): void {\n if (this.updateImagesSubscription) {\n this.updateImagesSubscription.unsubscribe();\n }\n this.idValidatorService.remove(this.id);\n }\n\n /**\n * Method to download the current image, only if `downloadable` is true.\n * @private\n */\n private downloadImage(): void {\n if (this.id === null || this.id === undefined) {\n throw new Error('Internal library error - id must be defined');\n }\n const libConfig: LibConfig | undefined = this.configService.getConfig(this.id);\n if (!libConfig) {\n throw new Error('Internal library error - libConfig must be defined');\n }\n\n const currentImageConfig: CurrentImageConfig | undefined = libConfig.currentImageConfig;\n if (currentImageConfig && !currentImageConfig.downloadable) {\n return;\n }\n this.downloadImageAllBrowsers();\n }\n\n /**\n * Method to convert a base64 to a Blob.\n * This should be upgraded with Uint8Array.fromBase64() from ES2025,\n * but first we need to upgrade `tsconfig` config.\n * @param base64Data string with base64 data\n * @param contentType string with the MIME type\n * @return Blob converted from the input base64Data\n * @private\n */\n private base64toBlob(base64Data: string, contentType: string = ''): Blob {\n const sliceSize = 1024;\n // atob() throws a DOMException on invalid base64 input — guard to prevent uncaught crash\n let byteCharacters: string;\n try {\n byteCharacters = atob(base64Data);\n } catch {\n return new Blob([], { type: contentType });\n }\n const bytesLength: number = byteCharacters.length;\n const slicesCount: number = Math.ceil(bytesLength / sliceSize);\n const byteArrays: Array<Uint8Array> = new Array(slicesCount);\n for (let sliceIndex = 0; sliceIndex < slicesCount; ++sliceIndex) {\n const begin: number = sliceIndex * sliceSize;\n const end: number = Math.min(begin + sliceSize, bytesLength);\n const bytes: Array<number> = new Array(end - begin);\n for (let offset = begin, i = 0; offset < end; ++i, ++offset) {\n bytes[i] = byteCharacters[offset].charCodeAt(0);\n }\n byteArrays[sliceIndex] = new Uint8Array(bytes);\n }\n return new Blob(byteArrays as BlobPart[], { type: contentType });\n }\n\n /**\n * Private method to download the current image for all browsers.\n * @private\n */\n private downloadImageAllBrowsers(): void {\n if (!isPlatformBrowser(this.platformId)) {\n return;\n }\n const link = this.document.createElement('a');\n let isBase64 = false;\n let img: string;\n // convert a SafeResourceUrl to a string\n if (typeof this.currentImage.modal.img === 'string') {\n img = this.currentImage.modal.img as string;\n } else {\n // if it's a SafeResourceUrl\n img = this.sanitizer.sanitize(SecurityContext.RESOURCE_URL, this.currentImage.modal.img) as string;\n }\n if (img.startsWith('data:image/') && img.includes(';base64,')) {\n const extension: string = img.replace('data:image/', '').split(';base64,')[0];\n // Allowlist safe image MIME types to block data:image/svg+xml and data:text/html payloads\n const allowedExtensions = ['png', 'jpeg', 'jpg', 'gif', 'webp', 'bmp'];\n if (!allowedExtensions.includes(extension.toLowerCase())) {\n return;\n }\n const pureBase64: string = img.split(';base64,')[1];\n const blob: Blob = this.base64toBlob(pureBase64, 'image/' + extension);\n link.href = URL.createObjectURL(blob);\n isBase64 = true;\n link.setAttribute('download', this.getFileName(this.currentImage, isBase64, extension));\n } else {\n link.href = img;\n link.setAttribute('download', this.getFileName(this.currentImage, isBase64));\n }\n this.document.body.appendChild(link);\n link.click();\n this.document.body.removeChild(link);\n }\n\n /**\n * Private method to get the `ButtonEvent` to emit, merging the input `ButtonEvent`\n * with the current image.\n * @param event ButtonEvent event payload to return\n * @returns ButtonEvent event payload with the current image included\n * @private\n */\n private getButtonEventToEmit(event: ButtonEvent): ButtonEvent {\n return Object.assign(event, { image: this.currentImage });\n }\n\n /**\n * Private method to get the file name from an input path.\n * This is used either to get the image's name from its path or from the Image itself,\n * if specified as 'downloadFileName' by the user.\n * @param image Image image to extract its file name\n * @param isBase64 boolean to set if the image is a base64 file or not. False by default.\n * @param base64Extension string to force the extension of the base64 image. Empty string by default.\n * @returns string string file name of the input image.\n * @private\n */\n private getFileName(image: Image, isBase64: boolean = false, base64Extension: string = ''): string {\n if (!image.modal.downloadFileName || image.modal.downloadFileName.length === 0) {\n if (isBase64) {\n return `Image-${image.id}.${base64Extension !== '' ? base64Extension : 'png'}`;\n } else {\n return (image.modal.img as string).replace(/^.*[\\\\\\/]/, '');\n }\n } else {\n return image.modal.downloadFileName;\n }\n }\n\n /**\n * Private method to initialize `images` as array of `Image`s.\n * Also, it will emit ImageModalEvent to say that images are loaded.\n * @private\n */\n private initImages(): void {\n this.modalGalleryService.emitHasData(new ImageModalEvent(this.id, Action.LOAD, true));\n\n const currentIndex: number = this.images.indexOf(this.currentImage);\n // emit a new ImageModalEvent with the index of the current image\n this.modalGalleryService.emitShow(new ImageModalEvent(this.id, Action.LOAD, currentIndex + 1));\n\n // emit first/last event based on newIndex value\n this.emitBoundaryEvent(Action.NORMAL, currentIndex);\n\n this.showGallery = this.images.length > 0;\n }\n\n /**\n * Private method to emit events when either the last or the first image are visible.\n * @param action Action Enum of type Action that represents the source of the event that changed the\n * current image to the first one or the last one.\n * @param indexToCheck number is the index number of the image (the first or the last one).\n * @private\n */\n private emitBoundaryEvent(action: Action, indexToCheck: number): void {\n // to emit first/last event\n switch (indexToCheck) {\n case 0:\n this.modalGalleryService.emitFirstImage(new ImageModalEvent(this.id, action, true));\n break;\n case this.images.length - 1:\n this.modalGalleryService.emitLastImage(new ImageModalEvent(this.id, action, true));\n break;\n }\n }\n}\n","<div id=\"modal-gallery-wrapper\"\n [attr.aria-label]=\"accessibilityConfig.modalGalleryContentAriaLabel\"\n [title]=\"accessibilityConfig.modalGalleryContentTitle\"\n ksClickOutside [clickOutsideEnable]=\"enableCloseOutside\"\n (clickOutside)=\"onClickOutside($event)\">\n\n <div id=\"flex-min-height-ie-fix\">\n <div id=\"modal-gallery-container\">\n\n <ks-upper-buttons [id]=\"id\"\n [currentImage]=\"currentImage\"\n [buttonsConfig]=\"buttonsConfig\"\n (delete)=\"onDelete($event)\"\n (navigate)=\"onNavigate($event)\"\n (download)=\"onDownload($event)\"\n (closeButton)=\"onCloseGalleryButton($event)\"\n (fullscreen)=\"onFullScreen($event)\"\n (customEmit)=\"onCustomEmit($event)\" />\n\n <ks-current-image [id]=\"id\"\n [images]=\"images\"\n [currentImage]=\"currentImage\"\n [isOpen]=\"true\"\n (loadImage)=\"onImageLoad($event)\"\n (changeImage)=\"onChangeCurrentImage($event)\"\n (closeGallery)=\"onCloseGallery($event)\" />\n\n <div>\n <ks-dots [id]=\"id\"\n [images]=\"images\"\n [currentImage]=\"currentImage\"\n [dotsConfig]=\"dotsConfig\"\n [accessibilityConfig]=\"accessibilityConfig\"\n (clickDot)=\"onClickDot($event)\" />\n\n <ks-previews [id]=\"id\"\n [images]=\"images\"\n [currentImage]=\"currentImage\"\n [customTemplate]=\"customPreviewsTemplate\"\n (clickPreview)=\"onClickPreview($event)\" />\n </div>\n </div>\n </div>\n</div>\n","/*\n The MIT License (MIT)\n\n Copyright (c) 2017-2026 Stefano Cappa (Ks89)\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\n\nimport { CarouselComponent } from './carousel/carousel.component';\nimport { CarouselPreviewsComponent } from './carousel/carousel-previews/carousel-previews.component';\nimport { UpperButtonsComponent } from './upper-buttons/upper-buttons.component';\nimport { DotsComponent } from './dots/dots.component';\nimport { PreviewsComponent } from './previews/previews.component';\nimport { CurrentImageComponent } from './current-image/current-image.component';\nimport { LoadingSpinnerComponent } from './current-image/loading-spinner/loading-spinner.component';\nimport { AccessibleComponent } from './accessible.component';\nimport { PlainGalleryComponent } from './plain-gallery/plain-gallery.component';\nexport { CarouselComponent } from './carousel/carousel.component';\nimport { ModalGalleryComponent } from './modal-gallery/modal-gallery.component';\n\n/**\n * Array of all components.\n */\nexport const COMPONENTS = [\n PlainGalleryComponent,\n CarouselComponent,\n CarouselPreviewsComponent,\n UpperButtonsComponent,\n DotsComponent,\n PreviewsComponent,\n CurrentImageComponent,\n LoadingSpinnerComponent,\n AccessibleComponent,\n\n ModalGalleryComponent\n];\n","/*\n The MIT License (MIT)\n\n Copyright (c) 2017-2026 Stefano Cappa (Ks89)\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\n\nimport { Directive, ElementRef, inject, OnChanges, OnInit, Renderer2, input } from '@angular/core';\n\n/**\n * Directive to change margins of an element.\n */\n@Directive({ selector: '[ksMargin]' })\nexport class MarginDirective implements OnInit, OnChanges {\n /**\n * String to set the margin of an element.\n */\n readonly marginLeft = input<string>();\n /**\n * String to set the margin of an element.\n */\n readonly marginRight = input<string>();\n /**\n * String to set the margin of an element.\n */\n readonly marginTop = input<string>();\n /**\n * String to set the margin of an element.\n */\n readonly marginBottom = input<string>();\n\n private renderer: Renderer2 = inject(Renderer2);\n private el: ElementRef = inject(ElementRef);\n\n /**\n * Method `ngOnInit` to apply the style of this directive.\n * This is an angular lifecycle hook, so it's called automatically by Angular itself.\n * In particular, it's called only one time!!!\n */\n ngOnInit(): void {\n this.applyStyle();\n }\n\n /**\n * Method `ngOnChanges` to apply the style of this directive.\n * This is an angular lifecycle hook, so it's called automatically by Angular itself.\n * In particular, it's called when any data-bound property of a directive changes!!!\n */\n ngOnChanges(): void {\n this.applyStyle();\n }\n\n /**\n * Private method to change both width and height of an element.\n */\n private applyStyle(): void {\n const marginLeft = this.marginLeft();\n if (marginLeft) {\n this.renderer.setStyle(this.el.nativeElement, 'margin-left', marginLeft);\n }\n const marginRight = this.marginRight();\n if (marginRight) {\n this.renderer.setStyle(this.el.nativeElement, 'margin-right', marginRight);\n }\n const marginTop = this.marginTop();\n if (marginTop) {\n this.renderer.setStyle(this.el.nativeElement, 'margin-top', marginTop);\n }\n const marginBottom = this.marginBottom();\n if (marginBottom) {\n this.renderer.setStyle(this.el.nativeElement, 'margin-bottom', marginBottom);\n }\n }\n}\n","/*\n The MIT License (MIT)\n\n Copyright (c) 2017-2026 Stefano Cappa (Ks89)\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\n\nimport { ClickOutsideDirective } from './click-outside.directive';\nimport { SizeDirective } from './size.directive';\nimport { KeyboardNavigationDirective } from './keyboard-navigation.directive';\nimport { WrapDirective } from './wrap.directive';\nimport { DirectionDirective } from './direction.directive';\nimport { ATagBgImageDirective } from './a-tag-bg-image.directive';\nimport { DescriptionDirective } from './description.directive';\nimport { MarginDirective } from './margin.directive';\nimport { MaxSizeDirective } from './max-size.directive';\nimport { FallbackImageDirective } from './fallback-image.directive';\nimport { SwipeDirective } from './swipe.directive';\n\n/**\n * Array of all directives.\n */\nexport const DIRECTIVES = [\n ClickOutsideDirective,\n SizeDirective,\n KeyboardNavigationDirective,\n WrapDirective,\n DirectionDirective,\n ATagBgImageDirective,\n DescriptionDirective,\n MarginDirective,\n MaxSizeDirective,\n FallbackImageDirective,\n SwipeDirective\n];\n","/*\n The MIT License (MIT)\n\n Copyright (c) 2017-2026 Stefano Cappa (Ks89)\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\n\nimport { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { OverlayModule } from '@angular/cdk/overlay';\n\nimport { COMPONENTS, CarouselComponent } from './components/components';\nimport { PlainGalleryComponent } from './components/plain-gallery/plain-gallery.component';\nimport { DIRECTIVES } from './directives/directives';\nimport { MODAL_GALLERY_COMPONENT } from './components/modal-gallery/modal-gallery.tokens';\nimport { ModalGalleryComponent } from './components/modal-gallery/modal-gallery.component';\n\n/**\n * Module to import it in the root module of your application.\n */\n@NgModule({\n imports: [CommonModule, OverlayModule, COMPONENTS, DIRECTIVES],\n providers: [\n { provide: MODAL_GALLERY_COMPONENT, useValue: ModalGalleryComponent }\n ],\n exports: [PlainGalleryComponent, CarouselComponent]\n})\nexport class GalleryModule {\n}\n","/*\n The MIT License (MIT)\n\n Copyright (c) 2017-2026 Stefano Cappa (Ks89)\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\n\n/**\n * Index file to export all interfaces, enums, classes and so on.\n * This file represents the public apis.\n */\n\nexport { GalleryModule } from './lib/modal-gallery.module';\n\nexport { Action } from './lib/model/action.enum';\nexport { Image, ImageEvent, ImageModalEvent } from './lib/model/image.class';\nexport type { PlainImage, ModalImage } from './lib/model/image.class';\nexport { DescriptionStrategy } from './lib/model/description.interface';\nexport type { Description } from './lib/model/description.interface';\nexport type { KeyboardConfig } from './lib/model/keyboard-config.interface';\nexport type { DotsConfig } from './lib/model/dots-config.interface';\nexport type { PreviewConfig } from './lib/model/preview-config.interface';\nexport type { AccessibilityConfig } from './lib/model/accessibility.interface';\n\nexport type { BreakpointsConfig, CarouselPreviewConfig } from './lib/model/carousel-preview-config.interface';\nexport type { CarouselConfig } from './lib/model/carousel-config.interface';\nexport type { PlayConfig } from './lib/model/play-config.interface';\nexport type { CarouselImageConfig } from './lib/model/carousel-image-config.interface';\n\nexport type { Size } from './lib/model/size.interface';\n\nexport { ButtonsStrategy, ButtonType } from './lib/model/buttons-config.interface';\nexport type { ButtonsConfig, ButtonConfig, ButtonEvent } from './lib/model/buttons-config.interface';\n\nexport type { ModalLibConfig, PlainLibConfig, CarouselLibConfig } from './lib/model/lib-config.interface';\n\nexport type { ModalGalleryConfig } from './lib/model/modal-gallery-config.interface';\n\nexport type { CurrentImageConfig } from './lib/model/current-image-config.interface';\n\nexport { LoadingType } from './lib/model/loading-config.interface';\nexport type { LoadingConfig } from './lib/model/loading-config.interface';\n\nexport type { InteractionEvent } from './lib/model/interaction-event.interface';\n\nexport type { SidePreviewsConfig, SlideConfig } from './lib/model/slide-config.interface';\n\nexport { KS_DEFAULT_ACCESSIBILITY_CONFIG } from './lib/components/accessibility-default';\nexport {\n KS_DEFAULT_BTN_FULL_SCREEN,\n KS_DEFAULT_BTN_CLOSE,\n KS_DEFAULT_BTN_DELETE,\n KS_DEFAULT_BTN_DOWNLOAD,\n KS_DEFAULT_BTN_EXTURL,\n KS_DEFAULT_SIZE\n} from './lib/components/upper-buttons/upper-buttons-default';\n\nexport {\n LineLayout,\n GridLayout,\n PlainGalleryStrategy\n} from './lib/model/plain-gallery-config.interface';\nexport type {\n PlainGalleryConfig,\n PlainGalleryLayout, BreakConfig\n} from './lib/model/plain-gallery-config.interface';\n\nexport { ModalGalleryComponent } from './lib/components/modal-gallery/modal-gallery.component';\nexport { PlainGalleryComponent } from './lib/components/plain-gallery/plain-gallery.component';\nexport { CarouselComponent } from './lib/components/carousel/carousel.component';\n\nexport { ModalGalleryService } from './lib/components/modal-gallery/modal-gallery.service';\nexport { ModalGalleryRef } from './lib/components/modal-gallery/modal-gallery-ref';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.ConfigService","i1.PlainGalleryComponent","i2.CarouselComponent","i3.CarouselPreviewsComponent","i4.UpperButtonsComponent","i5.DotsComponent","i6.PreviewsComponent","i7.CurrentImageComponent","i8.LoadingSpinnerComponent","i9.AccessibleComponent","i10.ModalGalleryComponent","i11.ClickOutsideDirective","i12.SizeDirective","i13.KeyboardNavigationDirective","i14.WrapDirective","i15.DirectionDirective","i16.ATagBgImageDirective","i17.DescriptionDirective","i18.MarginDirective","i19.MaxSizeDirective","i20.FallbackImageDirective","i21.SwipeDirective"],"mappings":";;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;;;;AAsBG;AAEH;;AAEG;AACI,MAAM,SAAS,GAAW,OAAO;AACxC;;AAEG;AACI,MAAM,UAAU,GAAW,OAAO;AAEzC;;AAEG;AACI,MAAM,OAA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