@ebrains/components 0.9.1-beta → 0.9.2-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{collection/utils/analytics.js → components/analytics-e29fcd53.js} +8 -6
- package/dist/components/{color.js → color-47266964.js} +1 -1
- package/dist/{collection/eds-docs-ui/colors/color-palette/primary.js → components/color-primary-palette.entry.js} +8 -8
- package/dist/{collection/eds-docs-ui/colors/color-palette/secondary.js → components/color-secondary-palette.entry.js} +8 -29
- package/dist/{collection/eds-docs-ui/colors/color-palette/support.js → components/color-support-palette.entry.js} +8 -8
- package/dist/{esm → components}/components-section.entry.js +1 -1
- package/dist/components/components.esm.js +47 -1
- package/dist/{esm → components}/correct-use-of-colors.entry.js +1 -1
- package/dist/{esm → components}/docs-palettes.entry.js +1 -1
- package/dist/{esm → components}/docs-tokens.entry.js +1 -1
- package/dist/{esm → components}/eds-accordion.entry.js +3 -4
- package/dist/{esm → components}/eds-alert.entry.js +3 -4
- package/dist/{esm → components}/eds-app-root.entry.js +1 -1
- package/dist/components/{eds-avatar2.js → eds-avatar.entry.js} +9 -36
- package/dist/components/eds-block-break.entry.js +16 -0
- package/dist/components/{eds-breadcrumb.js → eds-breadcrumb.entry.js} +16 -56
- package/dist/components/{eds-button2.js → eds-button.entry.js} +10 -46
- package/dist/components/{eds-card-desc2.js → eds-card-desc.entry.js} +7 -28
- package/dist/{esm → components}/eds-card-generic.entry.js +4 -5
- package/dist/{esm → components}/eds-card-project.entry.js +4 -4
- package/dist/{esm → components}/eds-card-section.entry.js +3 -4
- package/dist/{esm → components}/eds-card-tags.entry.js +2 -3
- package/dist/components/{eds-card-title2.js → eds-card-title.entry.js} +7 -30
- package/dist/{esm → components}/eds-card-tool.entry.js +3 -4
- package/dist/{esm → components}/eds-card-wrapper.entry.js +1 -1
- package/dist/{esm → components}/eds-code-block.entry.js +34 -4
- package/dist/{esm → components}/eds-cookies-preference.entry.js +2 -3
- package/dist/components/{eds-dropdown2.js → eds-dropdown.entry.js} +9 -48
- package/dist/{esm → components}/eds-feedback.entry.js +3 -4
- package/dist/components/{eds-footer2.js → eds-footer.entry.js} +7 -60
- package/dist/components/{eds-form.js → eds-form.entry.js} +66 -100
- package/dist/{esm → components}/eds-frame.entry.js +2 -3
- package/dist/components/{eds-fullscreen-menu.js → eds-fullscreen-menu.entry.js} +8 -81
- package/dist/components/{eds-header.js → eds-header.entry.js} +9 -60
- package/dist/{esm → components}/eds-icon-arrow-diagonal.entry.js +2 -2
- package/dist/{esm → components}/eds-icon-arrow-right.entry.js +2 -2
- package/dist/{esm → components}/eds-icon-bluesky.entry.js +2 -2
- package/dist/{esm → components}/eds-icon-bookmark.entry.js +2 -2
- package/dist/{esm → components}/eds-icon-chevron-down.entry.js +2 -2
- package/dist/{esm → components}/eds-icon-chevron-left.entry.js +2 -2
- package/dist/{esm → components}/eds-icon-chevron-right.entry.js +2 -2
- package/dist/{esm → components}/eds-icon-chevron-up.entry.js +2 -2
- package/dist/{esm → components}/eds-icon-close.entry.js +2 -2
- package/dist/{esm → components}/eds-icon-copy.entry.js +2 -2
- package/dist/{esm → components}/eds-icon-eu.entry.js +2 -2
- package/dist/{esm → components}/eds-icon-external.entry.js +2 -2
- package/dist/{esm → components}/eds-icon-facebook.entry.js +2 -2
- package/dist/{esm → components}/eds-icon-gitlab.entry.js +2 -2
- package/dist/{esm → components}/eds-icon-linkedin.entry.js +2 -2
- package/dist/{esm → components}/eds-icon-loader.entry.js +2 -2
- package/dist/{esm → components}/eds-icon-mastodon.entry.js +2 -2
- package/dist/{esm → components}/eds-icon-menu.entry.js +2 -2
- package/dist/{esm → components}/eds-icon-minus.entry.js +2 -2
- package/dist/{esm → components}/eds-icon-more.entry.js +2 -2
- package/dist/{esm → components}/eds-icon-paper.entry.js +2 -2
- package/dist/{esm → components}/eds-icon-plus.entry.js +2 -2
- package/dist/{esm → components}/eds-icon-portal.entry.js +2 -2
- package/dist/{esm → components}/eds-icon-private.entry.js +2 -2
- package/dist/{esm → components}/eds-icon-public.entry.js +2 -2
- package/dist/{esm → components}/eds-icon-search.entry.js +2 -2
- package/dist/{esm → components}/eds-icon-star.entry.js +2 -2
- package/dist/{esm → components}/eds-icon-success.entry.js +2 -2
- package/dist/{esm → components}/eds-icon-thumbs-down.entry.js +2 -2
- package/dist/{esm → components}/eds-icon-thumbs-up.entry.js +2 -2
- package/dist/{esm → components}/eds-icon-tutorial.entry.js +2 -2
- package/dist/{esm → components}/eds-icon-twitter.entry.js +2 -2
- package/dist/{esm → components}/eds-icon-unknown.entry.js +2 -2
- package/dist/{esm → components}/eds-icon-updown.entry.js +2 -2
- package/dist/{esm → components}/eds-icon-user.entry.js +2 -2
- package/dist/components/{eds-icon-wrapper2.js → eds-icon-wrapper.entry.js} +6 -26
- package/dist/{esm → components}/eds-icon-youtube.entry.js +2 -2
- package/dist/components/{eds-img2.js → eds-img.entry.js} +8 -36
- package/dist/components/{eds-input-field2.js → eds-input-field.entry.js} +8 -86
- package/dist/components/eds-input-footer.entry.js +17 -0
- package/dist/components/eds-input-label.entry.js +16 -0
- package/dist/components/{eds-input-range2.js → eds-input-range.entry.js} +7 -34
- package/dist/components/{eds-input-search2.js → eds-input-search.entry.js} +8 -38
- package/dist/components/{eds-input-select2.js → eds-input-select.entry.js} +7 -46
- package/dist/components/{eds-input2.js → eds-input.entry.js} +7 -46
- package/dist/components/{eds-link2.js → eds-link.entry.js} +10 -47
- package/dist/components/{eds-login2.js → eds-login.entry.js} +17 -41
- package/dist/components/{eds-logo2.js → eds-logo.entry.js} +10 -32
- package/dist/{esm → components}/eds-matomo-notice.entry.js +6 -7
- package/dist/{esm → components}/eds-modal.entry.js +3 -4
- package/dist/components/{eds-pagination2.js → eds-pagination.entry.js} +8 -51
- package/dist/{esm → components}/eds-progress-bar.entry.js +2 -3
- package/dist/{esm → components}/eds-rating.entry.js +2 -3
- package/dist/components/eds-section-core.entry.js +19 -0
- package/dist/{esm/eds-section-core_2.entry.js → components/eds-section-heading.entry.js} +2 -19
- package/dist/components/{eds-social-networks2.js → eds-social-networks.entry.js} +7 -37
- package/dist/{esm → components}/eds-spinner.entry.js +2 -3
- package/dist/components/{eds-splash-screen2.js → eds-splash-screen.entry.js} +7 -41
- package/dist/components/{eds-steps-v2.js → eds-steps-v2.entry.js} +9 -55
- package/dist/components/{eds-steps2.js → eds-steps.entry.js} +9 -43
- package/dist/{esm → components}/eds-switch.entry.js +2 -3
- package/dist/components/{eds-table2.js → eds-table.entry.js} +10 -105
- package/dist/{esm → components}/eds-tabs.entry.js +5 -6
- package/dist/components/{eds-tag2.js → eds-tag.entry.js} +8 -28
- package/dist/{esm → components}/eds-timeline.entry.js +3 -4
- package/dist/{esm → components}/eds-toast-manager.entry.js +3 -4
- package/dist/{esm → components}/eds-toast.entry.js +3 -4
- package/dist/{esm → components}/eds-tooltip.entry.js +3 -4
- package/dist/{esm → components}/eds-trl.entry.js +1 -1
- package/dist/components/{eds-user.js → eds-user.entry.js} +8 -59
- package/dist/{collection/eds-docs-ui/colors/gradient-palette/primary.js → components/gradient-primary-palette.entry.js} +8 -8
- package/dist/{collection/eds-docs-ui/colors/gradient-palette/secondary.js → components/gradient-secondary-palette.entry.js} +8 -8
- package/dist/{collection/eds-docs-ui/colors/gradient-palette/support.js → components/gradient-support-palette.entry.js} +8 -8
- package/dist/{esm → components}/incorrect-use-of-colors.entry.js +1 -1
- package/dist/{cjs/logo-white-no-bg-4a0e0f4b.js → components/index-7281d120.js} +941 -10
- package/dist/{esm/index-8a71b9a7.js → components/index-9d277061.js} +1332 -507
- package/dist/components/index.esm.js +1 -0
- package/dist/{esm → components}/logo-space.entry.js +3 -4
- package/dist/components/{logo-variations-horizontal2.js → logo-variations-horizontal.entry.js} +7 -29
- package/dist/{esm → components}/logo-variations-tabs.entry.js +1 -1
- package/dist/components/{logo-variations-vertical2.js → logo-variations-vertical.entry.js} +7 -32
- package/dist/{esm → components}/logo-wrong-usage.entry.js +3 -4
- package/dist/components/shadow-css-423dab2c.js +332 -0
- package/dist/{collection/eds-docs-ui/svg-repository/svg-repository.js → components/svg-repository.entry.js} +14 -20
- package/dist/components/{token-list2.js → token-list.entry.js} +6 -34
- package/dist/{collection/eds-docs-ui/design-tokens/token-radii/token-radii.js → components/token-radii.entry.js} +18 -8
- package/dist/{esm → components}/token-ratios.entry.js +1 -1
- package/dist/{collection/eds-docs-ui/design-tokens/token-shadows/token-shadows.js → components/token-shadows.entry.js} +27 -8
- package/dist/{collection/eds-docs-ui/design-tokens/token-spacing/token-spacing.js → components/token-spacing.entry.js} +9 -7
- package/dist/{esm → components}/token-typography.entry.js +1 -1
- package/package.json +1 -1
- package/dist/cjs/analytics-d8fb3fdd.js +0 -60
- package/dist/cjs/app-globals-3a1e7e63.js +0 -5
- package/dist/cjs/arrow-diagonal-black-0eb8640e.js +0 -5
- package/dist/cjs/arrow-right-3e38e8a9.js +0 -7
- package/dist/cjs/bluesky-eb0d6051.js +0 -16
- package/dist/cjs/bookmark-c61853d9.js +0 -18
- package/dist/cjs/chevron-down-27344777.js +0 -14
- package/dist/cjs/chevron-left-6fc9c6ef.js +0 -13
- package/dist/cjs/chevron-right-6d95a117.js +0 -7
- package/dist/cjs/chevron-up-e37d7713.js +0 -14
- package/dist/cjs/close-51284af5.js +0 -7
- package/dist/cjs/color-c00146a8.js +0 -134
- package/dist/cjs/color-primary-palette_6.cjs.entry.js +0 -340
- package/dist/cjs/components-section.cjs.entry.js +0 -139
- package/dist/cjs/components.cjs.js +0 -25
- package/dist/cjs/copy-53102d0c.js +0 -7
- package/dist/cjs/correct-use-of-colors.cjs.entry.js +0 -68
- package/dist/cjs/docs-palettes.cjs.entry.js +0 -27
- package/dist/cjs/docs-tokens.cjs.entry.js +0 -35
- package/dist/cjs/eds-accordion.cjs.entry.js +0 -86
- package/dist/cjs/eds-alert.cjs.entry.js +0 -104
- package/dist/cjs/eds-app-root.cjs.entry.js +0 -37
- package/dist/cjs/eds-avatar_26.cjs.entry.js +0 -2281
- package/dist/cjs/eds-card-desc_2.cjs.entry.js +0 -78
- package/dist/cjs/eds-card-generic.cjs.entry.js +0 -92
- package/dist/cjs/eds-card-project.cjs.entry.js +0 -68
- package/dist/cjs/eds-card-section.cjs.entry.js +0 -39
- package/dist/cjs/eds-card-tags.cjs.entry.js +0 -22
- package/dist/cjs/eds-card-tool.cjs.entry.js +0 -79
- package/dist/cjs/eds-card-wrapper.cjs.entry.js +0 -32
- package/dist/cjs/eds-code-block.cjs.entry.js +0 -2489
- package/dist/cjs/eds-cookies-preference.cjs.entry.js +0 -39
- package/dist/cjs/eds-feedback.cjs.entry.js +0 -66
- package/dist/cjs/eds-frame.cjs.entry.js +0 -85
- package/dist/cjs/eds-icon-arrow-diagonal.cjs.entry.js +0 -18
- package/dist/cjs/eds-icon-arrow-right.cjs.entry.js +0 -18
- package/dist/cjs/eds-icon-bluesky.cjs.entry.js +0 -18
- package/dist/cjs/eds-icon-bookmark.cjs.entry.js +0 -18
- package/dist/cjs/eds-icon-chevron-down.cjs.entry.js +0 -18
- package/dist/cjs/eds-icon-chevron-left.cjs.entry.js +0 -18
- package/dist/cjs/eds-icon-chevron-right.cjs.entry.js +0 -18
- package/dist/cjs/eds-icon-chevron-up.cjs.entry.js +0 -18
- package/dist/cjs/eds-icon-close.cjs.entry.js +0 -18
- package/dist/cjs/eds-icon-copy.cjs.entry.js +0 -18
- package/dist/cjs/eds-icon-eu.cjs.entry.js +0 -18
- package/dist/cjs/eds-icon-external.cjs.entry.js +0 -18
- package/dist/cjs/eds-icon-facebook.cjs.entry.js +0 -18
- package/dist/cjs/eds-icon-gitlab.cjs.entry.js +0 -18
- package/dist/cjs/eds-icon-linkedin.cjs.entry.js +0 -18
- package/dist/cjs/eds-icon-loader.cjs.entry.js +0 -18
- package/dist/cjs/eds-icon-mastodon.cjs.entry.js +0 -18
- package/dist/cjs/eds-icon-menu.cjs.entry.js +0 -18
- package/dist/cjs/eds-icon-minus.cjs.entry.js +0 -18
- package/dist/cjs/eds-icon-more.cjs.entry.js +0 -18
- package/dist/cjs/eds-icon-paper.cjs.entry.js +0 -18
- package/dist/cjs/eds-icon-plus.cjs.entry.js +0 -18
- package/dist/cjs/eds-icon-portal.cjs.entry.js +0 -18
- package/dist/cjs/eds-icon-private.cjs.entry.js +0 -18
- package/dist/cjs/eds-icon-public.cjs.entry.js +0 -18
- package/dist/cjs/eds-icon-search.cjs.entry.js +0 -18
- package/dist/cjs/eds-icon-star.cjs.entry.js +0 -18
- package/dist/cjs/eds-icon-success.cjs.entry.js +0 -18
- package/dist/cjs/eds-icon-thumbs-down.cjs.entry.js +0 -18
- package/dist/cjs/eds-icon-thumbs-up.cjs.entry.js +0 -18
- package/dist/cjs/eds-icon-tutorial.cjs.entry.js +0 -18
- package/dist/cjs/eds-icon-twitter.cjs.entry.js +0 -18
- package/dist/cjs/eds-icon-unknown.cjs.entry.js +0 -18
- package/dist/cjs/eds-icon-updown.cjs.entry.js +0 -18
- package/dist/cjs/eds-icon-user.cjs.entry.js +0 -18
- package/dist/cjs/eds-icon-youtube.cjs.entry.js +0 -18
- package/dist/cjs/eds-login_2.cjs.entry.js +0 -2100
- package/dist/cjs/eds-matomo-notice.cjs.entry.js +0 -123
- package/dist/cjs/eds-modal.cjs.entry.js +0 -109
- package/dist/cjs/eds-pagination_2.cjs.entry.js +0 -403
- package/dist/cjs/eds-progress-bar.cjs.entry.js +0 -29
- package/dist/cjs/eds-rating.cjs.entry.js +0 -64
- package/dist/cjs/eds-section-core_2.cjs.entry.js +0 -59
- package/dist/cjs/eds-spinner.cjs.entry.js +0 -54
- package/dist/cjs/eds-switch.cjs.entry.js +0 -38
- package/dist/cjs/eds-tabs.cjs.entry.js +0 -130
- package/dist/cjs/eds-timeline.cjs.entry.js +0 -63
- package/dist/cjs/eds-toast-manager.cjs.entry.js +0 -46
- package/dist/cjs/eds-toast.cjs.entry.js +0 -76
- package/dist/cjs/eds-tooltip.cjs.entry.js +0 -109
- package/dist/cjs/eds-trl.cjs.entry.js +0 -51
- package/dist/cjs/eu-b9665157.js +0 -32
- package/dist/cjs/facebook-7aa65e57.js +0 -16
- package/dist/cjs/incorrect-use-of-colors.cjs.entry.js +0 -50
- package/dist/cjs/index-2f63169d.js +0 -2227
- package/dist/cjs/index-ab9fbefe.js +0 -48
- package/dist/cjs/index.cjs.js +0 -2
- package/dist/cjs/linkedin-46b0dd56.js +0 -30
- package/dist/cjs/loader-72f9d178.js +0 -32
- package/dist/cjs/loader.cjs.js +0 -15
- package/dist/cjs/logo-color-6c787ac1.js +0 -117
- package/dist/cjs/logo-color-margins-b49c0f46.js +0 -120
- package/dist/cjs/logo-space.cjs.entry.js +0 -21
- package/dist/cjs/logo-variations-horizontal_2.cjs.entry.js +0 -36
- package/dist/cjs/logo-variations-tabs.cjs.entry.js +0 -27
- package/dist/cjs/logo-wrong-usage.cjs.entry.js +0 -21
- package/dist/cjs/mastodon-20c5bb7d.js +0 -16
- package/dist/cjs/menu-7050a6d1.js +0 -13
- package/dist/cjs/minus-1da6a98a.js +0 -13
- package/dist/cjs/mono-2f3cd653.js +0 -13
- package/dist/cjs/more-1d3dd8bc.js +0 -15
- package/dist/cjs/paper-0d6302f6.js +0 -17
- package/dist/cjs/plus-d0e00ad0.js +0 -14
- package/dist/cjs/portal-46212559.js +0 -20
- package/dist/cjs/private-38835fe7.js +0 -27
- package/dist/cjs/public-b519b1f6.js +0 -18
- package/dist/cjs/search-5533d877.js +0 -14
- package/dist/cjs/sharedUtils-8e287250.js +0 -21
- package/dist/cjs/star-942eee9f.js +0 -7
- package/dist/cjs/success-ef661a11.js +0 -20
- package/dist/cjs/svg-repository.cjs.entry.js +0 -337
- package/dist/cjs/thumbs-down-714036b1.js +0 -7
- package/dist/cjs/thumbs-up-411babb8.js +0 -8
- package/dist/cjs/toastManager-4e9535f3.js +0 -33
- package/dist/cjs/token-list_3.cjs.entry.js +0 -300
- package/dist/cjs/token-ratios.cjs.entry.js +0 -29
- package/dist/cjs/token-typography.cjs.entry.js +0 -230
- package/dist/cjs/tutotial-7855df3c.js +0 -29
- package/dist/cjs/twitter-73956e9a.js +0 -16
- package/dist/cjs/unknown-6814e551.js +0 -24
- package/dist/cjs/up-and-down-d71df67d.js +0 -14
- package/dist/cjs/user-a3c2230f.js +0 -18
- package/dist/cjs/youtube-c238a461.js +0 -16
- package/dist/collection/collection-manifest.json +0 -128
- package/dist/collection/components/eds-accordion/eds-accordion.css +0 -264
- package/dist/collection/components/eds-accordion/eds-accordion.js +0 -222
- package/dist/collection/components/eds-accordion/eds-accordion.stories.js +0 -87
- package/dist/collection/components/eds-alert/eds-alert.css +0 -739
- package/dist/collection/components/eds-alert/eds-alert.js +0 -230
- package/dist/collection/components/eds-alert/eds-alert.stories.js +0 -60
- package/dist/collection/components/eds-avatar/eds-avatar.css +0 -187
- package/dist/collection/components/eds-avatar/eds-avatar.js +0 -183
- package/dist/collection/components/eds-avatar/eds-avatar.stories.js +0 -40
- package/dist/collection/components/eds-block-break/eds-block-break.css +0 -49
- package/dist/collection/components/eds-block-break/eds-block-break.js +0 -51
- package/dist/collection/components/eds-breadcrump/eds-breadcrumb.css +0 -112
- package/dist/collection/components/eds-breadcrump/eds-breadcrumb.stories.js +0 -40
- package/dist/collection/components/eds-breadcrump/eds-breadcrump.js +0 -213
- package/dist/collection/components/eds-button/eds-button.css +0 -8904
- package/dist/collection/components/eds-button/eds-button.js +0 -487
- package/dist/collection/components/eds-button/eds-button.stories.js +0 -47
- package/dist/collection/components/eds-cards/eds-card-composer/eds-card-desc/eds-card-desc.css +0 -41
- package/dist/collection/components/eds-cards/eds-card-composer/eds-card-desc/eds-card-desc.js +0 -113
- package/dist/collection/components/eds-cards/eds-card-composer/eds-card-tags/eds-card-tags.css +0 -9
- package/dist/collection/components/eds-cards/eds-card-composer/eds-card-tags/eds-card-tags.js +0 -63
- package/dist/collection/components/eds-cards/eds-card-composer/eds-card-title/eds-card-title.css +0 -92
- package/dist/collection/components/eds-cards/eds-card-composer/eds-card-title/eds-card-title.js +0 -169
- package/dist/collection/components/eds-cards/eds-card-composer/eds-card-wrapper/eds-card-wrapper.js +0 -86
- package/dist/collection/components/eds-cards/eds-card-generic/eds-card-generic.css +0 -139
- package/dist/collection/components/eds-cards/eds-card-generic/eds-card-generic.js +0 -338
- package/dist/collection/components/eds-cards/eds-card-generic/eds-card-generic.stories.js +0 -133
- package/dist/collection/components/eds-cards/eds-card-project/eds-card-project.js +0 -228
- package/dist/collection/components/eds-cards/eds-card-tool/eds-card-tool.css +0 -103
- package/dist/collection/components/eds-cards/eds-card-tool/eds-card-tool.js +0 -314
- package/dist/collection/components/eds-code-block/eds-code-block.css +0 -204
- package/dist/collection/components/eds-code-block/eds-code-block.js +0 -141
- package/dist/collection/components/eds-code-block/eds-code-block.stories.js +0 -78
- package/dist/collection/components/eds-dropdown/eds-dropdown.css +0 -117
- package/dist/collection/components/eds-dropdown/eds-dropdown.js +0 -369
- package/dist/collection/components/eds-icon-wrapper/eds-icon-wrapper.js +0 -92
- package/dist/collection/components/eds-icons/chevron/eds-icon-chevron-down/eds-icon-chevron-down.js +0 -36
- package/dist/collection/components/eds-icons/chevron/eds-icon-chevron-left/eds-icon-chevron-left.js +0 -36
- package/dist/collection/components/eds-icons/chevron/eds-icon-chevron-right/eds-icon-chevron-right.js +0 -36
- package/dist/collection/components/eds-icons/chevron/eds-icon-chevron-up/eds-icon-chevron-up.js +0 -36
- package/dist/collection/components/eds-icons/eds-icon-arrow-diagonal/eds-icon-arrow-diagonal.js +0 -36
- package/dist/collection/components/eds-icons/eds-icon-arrow-right/eds-icon-arrow-right.js +0 -36
- package/dist/collection/components/eds-icons/eds-icon-bookmark/eds-icon-bookmark.js +0 -36
- package/dist/collection/components/eds-icons/eds-icon-close/eds-icon-close.js +0 -36
- package/dist/collection/components/eds-icons/eds-icon-copy/eds-icon-copy.js +0 -36
- package/dist/collection/components/eds-icons/eds-icon-eu/eds-icon-eu.js +0 -36
- package/dist/collection/components/eds-icons/eds-icon-external/eds-icon-external.js +0 -36
- package/dist/collection/components/eds-icons/eds-icon-gitlab/eds-icon-gitlab.js +0 -36
- package/dist/collection/components/eds-icons/eds-icon-loader/eds-icon-loader.js +0 -36
- package/dist/collection/components/eds-icons/eds-icon-menu/eds-icon-menu.js +0 -36
- package/dist/collection/components/eds-icons/eds-icon-minus/eds-icon-minus.js +0 -36
- package/dist/collection/components/eds-icons/eds-icon-more/eds-icon-more.js +0 -36
- package/dist/collection/components/eds-icons/eds-icon-paper/eds-icon-paper.js +0 -36
- package/dist/collection/components/eds-icons/eds-icon-plus/eds-icon-plus.js +0 -36
- package/dist/collection/components/eds-icons/eds-icon-portal/eds-icon-portal.js +0 -36
- package/dist/collection/components/eds-icons/eds-icon-private/eds-icon-private.js +0 -36
- package/dist/collection/components/eds-icons/eds-icon-public/eds-icon-public.js +0 -36
- package/dist/collection/components/eds-icons/eds-icon-search/eds-icon-search.js +0 -36
- package/dist/collection/components/eds-icons/eds-icon-star/eds-icon-star.js +0 -36
- package/dist/collection/components/eds-icons/eds-icon-success/eds-icon-success.js +0 -36
- package/dist/collection/components/eds-icons/eds-icon-thumbs-down/eds-icon-thumbs-down.js +0 -36
- package/dist/collection/components/eds-icons/eds-icon-thumbs-up/eds-icon-thumbs-up.js +0 -36
- package/dist/collection/components/eds-icons/eds-icon-tutorial/eds-icon-tutorial.js +0 -36
- package/dist/collection/components/eds-icons/eds-icon-unknown/eds-icon-unknown.js +0 -36
- package/dist/collection/components/eds-icons/eds-icon-updown/eds-icon-updown.js +0 -36
- package/dist/collection/components/eds-icons/eds-icon-user/eds-icon-user.js +0 -36
- package/dist/collection/components/eds-icons/social/eds-icon-bluesky/eds-icon-bluesky.js +0 -36
- package/dist/collection/components/eds-icons/social/eds-icon-facebook/eds-icon-facebook.js +0 -36
- package/dist/collection/components/eds-icons/social/eds-icon-linkedin/eds-icon-linkedin.js +0 -36
- package/dist/collection/components/eds-icons/social/eds-icon-mastodon/eds-icon-mastodon.js +0 -36
- package/dist/collection/components/eds-icons/social/eds-icon-twitter/eds-icon-twitter.js +0 -36
- package/dist/collection/components/eds-icons/social/eds-icon-youtube/eds-icon-youtube.js +0 -36
- package/dist/collection/components/eds-img/eds-img.css +0 -83
- package/dist/collection/components/eds-img/eds-img.js +0 -252
- package/dist/collection/components/eds-img/eds-img.stories.js +0 -101
- package/dist/collection/components/eds-input-elements/eds-input/eds-input.js +0 -317
- package/dist/collection/components/eds-input-elements/eds-input-footer/eds-input-footer.js +0 -105
- package/dist/collection/components/eds-input-elements/eds-input-label/eds-input-label.js +0 -90
- package/dist/collection/components/eds-input-elements/eds-input-range/eds-input-range.js +0 -252
- package/dist/collection/components/eds-input-elements/eds-input-search/eds-input-search.js +0 -263
- package/dist/collection/components/eds-input-elements/eds-input-select/eds-input-select.js +0 -343
- package/dist/collection/components/eds-input-field/eds-input-field.css +0 -7760
- package/dist/collection/components/eds-input-field/eds-input-field.js +0 -451
- package/dist/collection/components/eds-input-field/eds-input-field.stories.js +0 -206
- package/dist/collection/components/eds-link/eds-link.css +0 -7101
- package/dist/collection/components/eds-link/eds-link.js +0 -492
- package/dist/collection/components/eds-link/eds-link.stories.js +0 -86
- package/dist/collection/components/eds-logo/eds-logo.css +0 -47
- package/dist/collection/components/eds-logo/eds-logo.js +0 -169
- package/dist/collection/components/eds-logo/eds-logo.stories.js +0 -38
- package/dist/collection/components/eds-modal/eds-modal.css +0 -258
- package/dist/collection/components/eds-modal/eds-modal.js +0 -276
- package/dist/collection/components/eds-modal/eds-modal.stories.js +0 -80
- package/dist/collection/components/eds-pagination/eds-pagination.css +0 -148
- package/dist/collection/components/eds-pagination/eds-pagination.js +0 -418
- package/dist/collection/components/eds-pagination/eds-pagination.stories.js +0 -135
- package/dist/collection/components/eds-progress-bar/eds-progress-bar.css +0 -62
- package/dist/collection/components/eds-progress-bar/eds-progress-bar.js +0 -79
- package/dist/collection/components/eds-progress-bar/eds-progress-bar.stories.js +0 -25
- package/dist/collection/components/eds-rating/eds-rating.css +0 -79
- package/dist/collection/components/eds-rating/eds-rating.js +0 -126
- package/dist/collection/components/eds-rating/eds-rating.stories.js +0 -43
- package/dist/collection/components/eds-section/eds-section-core/eds-section-core.css +0 -0
- package/dist/collection/components/eds-section/eds-section-core/eds-section-core.js +0 -91
- package/dist/collection/components/eds-section/eds-section-core/eds-section-core.stories.js +0 -75
- package/dist/collection/components/eds-section/eds-section-heading/eds-section-heading.js +0 -140
- package/dist/collection/components/eds-spinner/eds-spinner.css +0 -17
- package/dist/collection/components/eds-spinner/eds-spinner.js +0 -166
- package/dist/collection/components/eds-spinner/eds-spinner.stories.js +0 -52
- package/dist/collection/components/eds-steps/eds-steps.css +0 -126
- package/dist/collection/components/eds-steps/eds-steps.js +0 -170
- package/dist/collection/components/eds-steps/eds-steps.stories.js +0 -35
- package/dist/collection/components/eds-switch/eds-switch.css +0 -58
- package/dist/collection/components/eds-switch/eds-switch.js +0 -131
- package/dist/collection/components/eds-switch/eds-switch.stories.js +0 -38
- package/dist/collection/components/eds-table/eds-table.css +0 -142
- package/dist/collection/components/eds-table/eds-table.js +0 -370
- package/dist/collection/components/eds-table/eds-table.stories.js +0 -99
- package/dist/collection/components/eds-tag/eds-tag.css +0 -101
- package/dist/collection/components/eds-tag/eds-tag.js +0 -110
- package/dist/collection/components/eds-tag/eds-tag.stories.js +0 -34
- package/dist/collection/components/eds-timeline/eds-timeline.css +0 -7796
- package/dist/collection/components/eds-timeline/eds-timeline.js +0 -93
- package/dist/collection/components/eds-timeline/eds-timeline.stories.js +0 -35
- package/dist/collection/components/eds-toast/eds-toast.css +0 -91
- package/dist/collection/components/eds-toast/eds-toast.js +0 -138
- package/dist/collection/components/eds-toast/eds-toast.stories.js +0 -38
- package/dist/collection/components/eds-tooltip/eds-tooltip.css +0 -94
- package/dist/collection/components/eds-tooltip/eds-tooltip.js +0 -179
- package/dist/collection/components/eds-tooltip/eds-tooltip.stories.js +0 -21
- package/dist/collection/components/eds-trl/eds-trl.js +0 -68
- package/dist/collection/eds-docs-ui/colors/use-of-colors/correct-use-of-colors.js +0 -66
- package/dist/collection/eds-docs-ui/colors/use-of-colors/incorrect-use-of-colors.js +0 -44
- package/dist/collection/eds-docs-ui/components-section/components-section.js +0 -55
- package/dist/collection/eds-docs-ui/components-section/functional/angular.js +0 -2
- package/dist/collection/eds-docs-ui/components-section/functional/installation.js +0 -2
- package/dist/collection/eds-docs-ui/components-section/functional/overview.js +0 -19
- package/dist/collection/eds-docs-ui/components-section/functional/react.js +0 -2
- package/dist/collection/eds-docs-ui/components-section/functional/usage.js +0 -2
- package/dist/collection/eds-docs-ui/components-section/functional/vue.js +0 -2
- package/dist/collection/eds-docs-ui/design-tokens/docs-tokens/docs-tokens.js +0 -52
- package/dist/collection/eds-docs-ui/design-tokens/token-list/token-list.js +0 -98
- package/dist/collection/eds-docs-ui/design-tokens/token-list/token-list.stories.js +0 -44
- package/dist/collection/eds-docs-ui/design-tokens/token-ratios/token-ratios.js +0 -15
- package/dist/collection/eds-docs-ui/design-tokens/token-typography/token-typography.js +0 -27
- package/dist/collection/eds-docs-ui/docs-palettes/docs-palettes.js +0 -44
- package/dist/collection/eds-docs-ui/logo/logo-space/logo-space.css +0 -154
- package/dist/collection/eds-docs-ui/logo/logo-space/logo-space.js +0 -22
- package/dist/collection/eds-docs-ui/logo/logo-variations/horizontal/logo-variations-horizontal.css +0 -161
- package/dist/collection/eds-docs-ui/logo/logo-variations/horizontal/logo-variations-horizontal.js +0 -21
- package/dist/collection/eds-docs-ui/logo/logo-variations/vertical/logo-variations-vertical.css +0 -169
- package/dist/collection/eds-docs-ui/logo/logo-variations/vertical/logo-variations-vertical.js +0 -64
- package/dist/collection/eds-docs-ui/logo/logo-variations-tabs/logo-variations.js +0 -44
- package/dist/collection/eds-docs-ui/logo/logo-wrong-usage/logo-wrong-usage.css +0 -240
- package/dist/collection/eds-docs-ui/logo/logo-wrong-usage/logo-wrong-usage.js +0 -22
- package/dist/collection/eds-docs-ui/svg-repository/svg-repository.css +0 -5
- package/dist/collection/index.js +0 -1
- package/dist/collection/shared-ui/eds-card-section/eds-card-section.css +0 -249
- package/dist/collection/shared-ui/eds-card-section/eds-card-section.js +0 -95
- package/dist/collection/shared-ui/eds-card-section/eds-card-section.stories.js +0 -71
- package/dist/collection/shared-ui/eds-cookies-preference/eds-cookies-preference.css +0 -0
- package/dist/collection/shared-ui/eds-cookies-preference/eds-cookies-preference.js +0 -86
- package/dist/collection/shared-ui/eds-cookies-preference/eds-cookies-preference.st.js +0 -31
- package/dist/collection/shared-ui/eds-feedback/eds-feedback.css +0 -163
- package/dist/collection/shared-ui/eds-feedback/eds-feedback.js +0 -191
- package/dist/collection/shared-ui/eds-feedback/eds-feedback.stories.js +0 -121
- package/dist/collection/shared-ui/eds-footer/eds-footer.css +0 -226
- package/dist/collection/shared-ui/eds-footer/eds-footer.js +0 -189
- package/dist/collection/shared-ui/eds-footer/eds-footer.stories.js +0 -44
- package/dist/collection/shared-ui/eds-form/eds-form.css +0 -3
- package/dist/collection/shared-ui/eds-form/eds-form.js +0 -441
- package/dist/collection/shared-ui/eds-form/eds-form.stories.js +0 -73
- package/dist/collection/shared-ui/eds-frame/eds-frame.css +0 -116
- package/dist/collection/shared-ui/eds-frame/eds-frame.js +0 -234
- package/dist/collection/shared-ui/eds-frame/eds-frame.stories.js +0 -52
- package/dist/collection/shared-ui/eds-fullscreen-menu/eds-fullscreen-menu.css +0 -120
- package/dist/collection/shared-ui/eds-fullscreen-menu/eds-fullscreen-menu.js +0 -192
- package/dist/collection/shared-ui/eds-fullscreen-menu/eds-fullscreen-menu.stories.js +0 -77
- package/dist/collection/shared-ui/eds-header/eds-header.css +0 -138
- package/dist/collection/shared-ui/eds-header/eds-header.js +0 -202
- package/dist/collection/shared-ui/eds-header/eds-header.stories.js +0 -40
- package/dist/collection/shared-ui/eds-login/eds-login.js +0 -190
- package/dist/collection/shared-ui/eds-login/eds-login.stories.js +0 -37
- package/dist/collection/shared-ui/eds-matomo-notice/eds-matomo-notice.css +0 -109
- package/dist/collection/shared-ui/eds-matomo-notice/eds-matomo-notice.js +0 -230
- package/dist/collection/shared-ui/eds-matomo-notice/eds-matomo-notice.stories.js +0 -36
- package/dist/collection/shared-ui/eds-social-networks/eds-social-networks.css +0 -124
- package/dist/collection/shared-ui/eds-social-networks/eds-social-networks.js +0 -92
- package/dist/collection/shared-ui/eds-social-networks/eds-social-networks.stories.js +0 -21
- package/dist/collection/shared-ui/eds-splash-screen/eds-splash-screen.css +0 -29
- package/dist/collection/shared-ui/eds-splash-screen/eds-splash-screen.js +0 -136
- package/dist/collection/shared-ui/eds-splash-screen/eds-splash-screen.stories.js +0 -23
- package/dist/collection/shared-ui/eds-steps-v2/eds-steps-v2.css +0 -361
- package/dist/collection/shared-ui/eds-steps-v2/eds-steps-v2.js +0 -219
- package/dist/collection/shared-ui/eds-tabs/eds-tabs.css +0 -7796
- package/dist/collection/shared-ui/eds-tabs/eds-tabs.js +0 -221
- package/dist/collection/shared-ui/eds-tabs/eds-tabs.stories.js +0 -54
- package/dist/collection/shared-ui/eds-toast-manager/eds-toast-manager.css +0 -51
- package/dist/collection/shared-ui/eds-toast-manager/eds-toast-manager.js +0 -54
- package/dist/collection/shared-ui/eds-toast-manager/eds-toast-manager.stories.js +0 -25
- package/dist/collection/shared-ui/eds-user/eds-user.css +0 -7796
- package/dist/collection/shared-ui/eds-user/eds-user.js +0 -77
- package/dist/collection/shared-ui/eds-user/eds-user.stories.js +0 -45
- package/dist/collection/shared-ui/examples/eds-app-root/eds-app-root.js +0 -39
- package/dist/collection/utils/api.js +0 -27
- package/dist/collection/utils/color.js +0 -129
- package/dist/collection/utils/eds-form/formUtils.js +0 -65
- package/dist/collection/utils/eds-form/formValidators.js +0 -64
- package/dist/collection/utils/eds-form/individualValidator.js +0 -46
- package/dist/collection/utils/eds-form/validateInput.js +0 -23
- package/dist/collection/utils/global.js +0 -8
- package/dist/collection/utils/keycloak.js +0 -85
- package/dist/collection/utils/sharedUtils.js +0 -17
- package/dist/collection/utils/toastManager.js +0 -29
- package/dist/components/analytics.js +0 -56
- package/dist/components/arrow-diagonal-black.js +0 -3
- package/dist/components/arrow-right.js +0 -5
- package/dist/components/bluesky.js +0 -14
- package/dist/components/bookmark.js +0 -16
- package/dist/components/chevron-down.js +0 -12
- package/dist/components/chevron-left.js +0 -11
- package/dist/components/chevron-right.js +0 -5
- package/dist/components/chevron-up.js +0 -12
- package/dist/components/close.js +0 -5
- package/dist/components/color-primary-palette.d.ts +0 -11
- package/dist/components/color-primary-palette.js +0 -6
- package/dist/components/color-secondary-palette.d.ts +0 -11
- package/dist/components/color-secondary-palette.js +0 -6
- package/dist/components/color-support-palette.d.ts +0 -11
- package/dist/components/color-support-palette.js +0 -6
- package/dist/components/components-section.d.ts +0 -11
- package/dist/components/components-section.js +0 -202
- package/dist/components/components.css +0 -7796
- package/dist/components/copy.js +0 -5
- package/dist/components/correct-use-of-colors.d.ts +0 -11
- package/dist/components/correct-use-of-colors.js +0 -93
- package/dist/components/docs-palettes.d.ts +0 -11
- package/dist/components/docs-palettes.js +0 -96
- package/dist/components/docs-tokens.d.ts +0 -11
- package/dist/components/docs-tokens.js +0 -80
- package/dist/components/eds-accordion.d.ts +0 -11
- package/dist/components/eds-accordion.js +0 -6
- package/dist/components/eds-accordion2.js +0 -119
- package/dist/components/eds-alert.d.ts +0 -11
- package/dist/components/eds-alert.js +0 -6
- package/dist/components/eds-alert2.js +0 -135
- package/dist/components/eds-app-root.d.ts +0 -11
- package/dist/components/eds-app-root.js +0 -89
- package/dist/components/eds-avatar.d.ts +0 -11
- package/dist/components/eds-avatar.js +0 -6
- package/dist/components/eds-block-break.d.ts +0 -11
- package/dist/components/eds-block-break.js +0 -6
- package/dist/components/eds-block-break2.js +0 -34
- package/dist/components/eds-breadcrumb.d.ts +0 -11
- package/dist/components/eds-button.d.ts +0 -11
- package/dist/components/eds-button.js +0 -6
- package/dist/components/eds-card-desc.d.ts +0 -11
- package/dist/components/eds-card-desc.js +0 -6
- package/dist/components/eds-card-generic.d.ts +0 -11
- package/dist/components/eds-card-generic.js +0 -6
- package/dist/components/eds-card-generic2.js +0 -147
- package/dist/components/eds-card-project.d.ts +0 -11
- package/dist/components/eds-card-project.js +0 -109
- package/dist/components/eds-card-section.d.ts +0 -11
- package/dist/components/eds-card-section.js +0 -92
- package/dist/components/eds-card-tags.d.ts +0 -11
- package/dist/components/eds-card-tags.js +0 -45
- package/dist/components/eds-card-title.d.ts +0 -11
- package/dist/components/eds-card-title.js +0 -6
- package/dist/components/eds-card-tool.d.ts +0 -11
- package/dist/components/eds-card-tool.js +0 -137
- package/dist/components/eds-card-wrapper.d.ts +0 -11
- package/dist/components/eds-card-wrapper.js +0 -49
- package/dist/components/eds-code-block.d.ts +0 -11
- package/dist/components/eds-code-block.js +0 -6
- package/dist/components/eds-code-block2.js +0 -2510
- package/dist/components/eds-cookies-preference.d.ts +0 -11
- package/dist/components/eds-cookies-preference.js +0 -87
- package/dist/components/eds-dropdown.d.ts +0 -11
- package/dist/components/eds-dropdown.js +0 -6
- package/dist/components/eds-feedback.d.ts +0 -11
- package/dist/components/eds-feedback.js +0 -105
- package/dist/components/eds-footer.d.ts +0 -11
- package/dist/components/eds-footer.js +0 -6
- package/dist/components/eds-form.d.ts +0 -11
- package/dist/components/eds-frame.d.ts +0 -11
- package/dist/components/eds-frame.js +0 -120
- package/dist/components/eds-fullscreen-menu.d.ts +0 -11
- package/dist/components/eds-header.d.ts +0 -11
- package/dist/components/eds-icon-arrow-diagonal.d.ts +0 -11
- package/dist/components/eds-icon-arrow-diagonal.js +0 -33
- package/dist/components/eds-icon-arrow-right.d.ts +0 -11
- package/dist/components/eds-icon-arrow-right.js +0 -33
- package/dist/components/eds-icon-bluesky.d.ts +0 -11
- package/dist/components/eds-icon-bluesky.js +0 -33
- package/dist/components/eds-icon-bookmark.d.ts +0 -11
- package/dist/components/eds-icon-bookmark.js +0 -33
- package/dist/components/eds-icon-chevron-down.d.ts +0 -11
- package/dist/components/eds-icon-chevron-down.js +0 -33
- package/dist/components/eds-icon-chevron-left.d.ts +0 -11
- package/dist/components/eds-icon-chevron-left.js +0 -33
- package/dist/components/eds-icon-chevron-right.d.ts +0 -11
- package/dist/components/eds-icon-chevron-right.js +0 -33
- package/dist/components/eds-icon-chevron-up.d.ts +0 -11
- package/dist/components/eds-icon-chevron-up.js +0 -33
- package/dist/components/eds-icon-close.d.ts +0 -11
- package/dist/components/eds-icon-close.js +0 -33
- package/dist/components/eds-icon-copy.d.ts +0 -11
- package/dist/components/eds-icon-copy.js +0 -33
- package/dist/components/eds-icon-eu.d.ts +0 -11
- package/dist/components/eds-icon-eu.js +0 -33
- package/dist/components/eds-icon-external.d.ts +0 -11
- package/dist/components/eds-icon-external.js +0 -33
- package/dist/components/eds-icon-facebook.d.ts +0 -11
- package/dist/components/eds-icon-facebook.js +0 -33
- package/dist/components/eds-icon-gitlab.d.ts +0 -11
- package/dist/components/eds-icon-gitlab.js +0 -33
- package/dist/components/eds-icon-linkedin.d.ts +0 -11
- package/dist/components/eds-icon-linkedin.js +0 -33
- package/dist/components/eds-icon-loader.d.ts +0 -11
- package/dist/components/eds-icon-loader.js +0 -33
- package/dist/components/eds-icon-mastodon.d.ts +0 -11
- package/dist/components/eds-icon-mastodon.js +0 -33
- package/dist/components/eds-icon-menu.d.ts +0 -11
- package/dist/components/eds-icon-menu.js +0 -33
- package/dist/components/eds-icon-minus.d.ts +0 -11
- package/dist/components/eds-icon-minus.js +0 -33
- package/dist/components/eds-icon-more.d.ts +0 -11
- package/dist/components/eds-icon-more.js +0 -33
- package/dist/components/eds-icon-paper.d.ts +0 -11
- package/dist/components/eds-icon-paper.js +0 -33
- package/dist/components/eds-icon-plus.d.ts +0 -11
- package/dist/components/eds-icon-plus.js +0 -33
- package/dist/components/eds-icon-portal.d.ts +0 -11
- package/dist/components/eds-icon-portal.js +0 -33
- package/dist/components/eds-icon-private.d.ts +0 -11
- package/dist/components/eds-icon-private.js +0 -33
- package/dist/components/eds-icon-public.d.ts +0 -11
- package/dist/components/eds-icon-public.js +0 -33
- package/dist/components/eds-icon-search.d.ts +0 -11
- package/dist/components/eds-icon-search.js +0 -33
- package/dist/components/eds-icon-star.d.ts +0 -11
- package/dist/components/eds-icon-star.js +0 -33
- package/dist/components/eds-icon-success.d.ts +0 -11
- package/dist/components/eds-icon-success.js +0 -33
- package/dist/components/eds-icon-thumbs-down.d.ts +0 -11
- package/dist/components/eds-icon-thumbs-down.js +0 -33
- package/dist/components/eds-icon-thumbs-up.d.ts +0 -11
- package/dist/components/eds-icon-thumbs-up.js +0 -33
- package/dist/components/eds-icon-tutorial.d.ts +0 -11
- package/dist/components/eds-icon-tutorial.js +0 -33
- package/dist/components/eds-icon-twitter.d.ts +0 -11
- package/dist/components/eds-icon-twitter.js +0 -33
- package/dist/components/eds-icon-unknown.d.ts +0 -11
- package/dist/components/eds-icon-unknown.js +0 -33
- package/dist/components/eds-icon-updown.d.ts +0 -11
- package/dist/components/eds-icon-updown.js +0 -33
- package/dist/components/eds-icon-user.d.ts +0 -11
- package/dist/components/eds-icon-user.js +0 -33
- package/dist/components/eds-icon-wrapper.d.ts +0 -11
- package/dist/components/eds-icon-wrapper.js +0 -6
- package/dist/components/eds-icon-youtube.d.ts +0 -11
- package/dist/components/eds-icon-youtube.js +0 -33
- package/dist/components/eds-img.d.ts +0 -11
- package/dist/components/eds-img.js +0 -6
- package/dist/components/eds-input-field.d.ts +0 -11
- package/dist/components/eds-input-field.js +0 -6
- package/dist/components/eds-input-footer.d.ts +0 -11
- package/dist/components/eds-input-footer.js +0 -6
- package/dist/components/eds-input-footer2.js +0 -43
- package/dist/components/eds-input-label.d.ts +0 -11
- package/dist/components/eds-input-label.js +0 -6
- package/dist/components/eds-input-label2.js +0 -35
- package/dist/components/eds-input-range.d.ts +0 -11
- package/dist/components/eds-input-range.js +0 -6
- package/dist/components/eds-input-search.d.ts +0 -11
- package/dist/components/eds-input-search.js +0 -6
- package/dist/components/eds-input-select.d.ts +0 -11
- package/dist/components/eds-input-select.js +0 -6
- package/dist/components/eds-input.d.ts +0 -11
- package/dist/components/eds-input.js +0 -6
- package/dist/components/eds-link.d.ts +0 -11
- package/dist/components/eds-link.js +0 -6
- package/dist/components/eds-login.d.ts +0 -11
- package/dist/components/eds-login.js +0 -6
- package/dist/components/eds-logo.d.ts +0 -11
- package/dist/components/eds-logo.js +0 -6
- package/dist/components/eds-matomo-notice.d.ts +0 -11
- package/dist/components/eds-matomo-notice.js +0 -6
- package/dist/components/eds-matomo-notice2.js +0 -158
- package/dist/components/eds-modal.d.ts +0 -11
- package/dist/components/eds-modal.js +0 -144
- package/dist/components/eds-pagination.d.ts +0 -11
- package/dist/components/eds-pagination.js +0 -6
- package/dist/components/eds-progress-bar.d.ts +0 -11
- package/dist/components/eds-progress-bar.js +0 -6
- package/dist/components/eds-progress-bar2.js +0 -43
- package/dist/components/eds-rating.d.ts +0 -11
- package/dist/components/eds-rating.js +0 -6
- package/dist/components/eds-rating2.js +0 -91
- package/dist/components/eds-section-core.d.ts +0 -11
- package/dist/components/eds-section-core.js +0 -6
- package/dist/components/eds-section-core2.js +0 -44
- package/dist/components/eds-section-heading.d.ts +0 -11
- package/dist/components/eds-section-heading.js +0 -6
- package/dist/components/eds-section-heading2.js +0 -57
- package/dist/components/eds-social-networks.d.ts +0 -11
- package/dist/components/eds-social-networks.js +0 -6
- package/dist/components/eds-spinner.d.ts +0 -11
- package/dist/components/eds-spinner.js +0 -6
- package/dist/components/eds-spinner2.js +0 -72
- package/dist/components/eds-splash-screen.d.ts +0 -11
- package/dist/components/eds-splash-screen.js +0 -6
- package/dist/components/eds-steps-v2.d.ts +0 -11
- package/dist/components/eds-steps.d.ts +0 -11
- package/dist/components/eds-steps.js +0 -6
- package/dist/components/eds-switch.d.ts +0 -11
- package/dist/components/eds-switch.js +0 -57
- package/dist/components/eds-table.d.ts +0 -11
- package/dist/components/eds-table.js +0 -6
- package/dist/components/eds-tabs.d.ts +0 -11
- package/dist/components/eds-tabs.js +0 -152
- package/dist/components/eds-tag.d.ts +0 -11
- package/dist/components/eds-tag.js +0 -6
- package/dist/components/eds-timeline.d.ts +0 -11
- package/dist/components/eds-timeline.js +0 -119
- package/dist/components/eds-toast-manager.d.ts +0 -11
- package/dist/components/eds-toast-manager.js +0 -80
- package/dist/components/eds-toast.d.ts +0 -11
- package/dist/components/eds-toast.js +0 -6
- package/dist/components/eds-toast2.js +0 -104
- package/dist/components/eds-tooltip.d.ts +0 -11
- package/dist/components/eds-tooltip.js +0 -129
- package/dist/components/eds-trl.d.ts +0 -11
- package/dist/components/eds-trl.js +0 -138
- package/dist/components/eds-user.d.ts +0 -11
- package/dist/components/eu.js +0 -30
- package/dist/components/facebook.js +0 -14
- package/dist/components/gradient-primary-palette.d.ts +0 -11
- package/dist/components/gradient-primary-palette.js +0 -6
- package/dist/components/gradient-secondary-palette.d.ts +0 -11
- package/dist/components/gradient-secondary-palette.js +0 -6
- package/dist/components/gradient-support-palette.d.ts +0 -11
- package/dist/components/gradient-support-palette.js +0 -6
- package/dist/components/incorrect-use-of-colors.d.ts +0 -11
- package/dist/components/incorrect-use-of-colors.js +0 -81
- package/dist/components/index.d.ts +0 -33
- package/dist/components/index.js +0 -1
- package/dist/components/linkedin.js +0 -28
- package/dist/components/loader.js +0 -30
- package/dist/components/logo-color-margins.js +0 -118
- package/dist/components/logo-color.js +0 -115
- package/dist/components/logo-space.d.ts +0 -11
- package/dist/components/logo-space.js +0 -101
- package/dist/components/logo-variations-horizontal.d.ts +0 -11
- package/dist/components/logo-variations-horizontal.js +0 -6
- package/dist/components/logo-variations-tabs.d.ts +0 -11
- package/dist/components/logo-variations-tabs.js +0 -60
- package/dist/components/logo-variations-vertical.d.ts +0 -11
- package/dist/components/logo-variations-vertical.js +0 -6
- package/dist/components/logo-white-no-bg.js +0 -1029
- package/dist/components/logo-wrong-usage.d.ts +0 -11
- package/dist/components/logo-wrong-usage.js +0 -35
- package/dist/components/mastodon.js +0 -14
- package/dist/components/menu.js +0 -11
- package/dist/components/minus.js +0 -11
- package/dist/components/mono.js +0 -11
- package/dist/components/more.js +0 -13
- package/dist/components/p-024c7937.js +0 -1
- package/dist/components/p-0467ceb5.entry.js +0 -1
- package/dist/components/p-05754401.js +0 -1
- package/dist/components/p-063b0683.entry.js +0 -1
- package/dist/components/p-0be28996.js +0 -1
- package/dist/components/p-0ce924b1.entry.js +0 -1
- package/dist/components/p-0e6d43c5.js +0 -1
- package/dist/components/p-112122d6.js +0 -1
- package/dist/components/p-1309a74c.entry.js +0 -1
- package/dist/components/p-13efafb9.js +0 -1
- package/dist/components/p-18eb23ff.entry.js +0 -1
- package/dist/components/p-1aab55cf.entry.js +0 -1
- package/dist/components/p-1b2913c8.js +0 -1
- package/dist/components/p-1ded61bd.js +0 -1
- package/dist/components/p-2066b033.js +0 -1
- package/dist/components/p-20b3a999.entry.js +0 -1
- package/dist/components/p-20e9ae7f.entry.js +0 -1
- package/dist/components/p-2117611b.js +0 -1
- package/dist/components/p-21a746a4.entry.js +0 -9
- package/dist/components/p-22f9e720.js +0 -1
- package/dist/components/p-2692f93d.js +0 -1
- package/dist/components/p-29041952.js +0 -1
- package/dist/components/p-29e807f5.entry.js +0 -1
- package/dist/components/p-2c1be2bb.entry.js +0 -1
- package/dist/components/p-32e6c4df.js +0 -1
- package/dist/components/p-35ed7ebf.entry.js +0 -1
- package/dist/components/p-373119b3.js +0 -1
- package/dist/components/p-376b706b.entry.js +0 -1
- package/dist/components/p-3932d0af.entry.js +0 -1
- package/dist/components/p-3a7be9a7.entry.js +0 -1
- package/dist/components/p-3af94671.entry.js +0 -1
- package/dist/components/p-3f480c3c.entry.js +0 -1
- package/dist/components/p-41e89554.entry.js +0 -1
- package/dist/components/p-435a8942.entry.js +0 -1
- package/dist/components/p-4587d0ef.js +0 -1
- package/dist/components/p-4620ebf5.entry.js +0 -1
- package/dist/components/p-4687b64c.js +0 -1
- package/dist/components/p-46d0716d.js +0 -1
- package/dist/components/p-4c7852f8.entry.js +0 -1
- package/dist/components/p-4e8a317b.entry.js +0 -1
- package/dist/components/p-50e27321.js +0 -1
- package/dist/components/p-526cdc57.entry.js +0 -1
- package/dist/components/p-52913e2e.entry.js +0 -1
- package/dist/components/p-54b8f143.js +0 -1
- package/dist/components/p-5ab1d64a.js +0 -1
- package/dist/components/p-5d046674.js +0 -1
- package/dist/components/p-622dd2a1.entry.js +0 -1
- package/dist/components/p-6404e157.entry.js +0 -1
- package/dist/components/p-66bb44c9.entry.js +0 -1
- package/dist/components/p-694fc085.js +0 -1
- package/dist/components/p-69c5074b.js +0 -1
- package/dist/components/p-6dc26e53.entry.js +0 -1
- package/dist/components/p-7198c024.js +0 -1
- package/dist/components/p-78fa7132.entry.js +0 -1
- package/dist/components/p-7dce734a.entry.js +0 -1
- package/dist/components/p-7fa88255.entry.js +0 -1
- package/dist/components/p-81899237.js +0 -1
- package/dist/components/p-83936521.entry.js +0 -1
- package/dist/components/p-83ff4a95.js +0 -1
- package/dist/components/p-8527ef5f.entry.js +0 -1
- package/dist/components/p-8653bc36.entry.js +0 -1
- package/dist/components/p-86bb73dc.js +0 -1
- package/dist/components/p-8983de37.js +0 -1
- package/dist/components/p-8baa7e01.entry.js +0 -1
- package/dist/components/p-8e3c6c63.entry.js +0 -1
- package/dist/components/p-91440d2f.entry.js +0 -1
- package/dist/components/p-923f67b5.entry.js +0 -1
- package/dist/components/p-93093977.entry.js +0 -1
- package/dist/components/p-941240b5.entry.js +0 -1
- package/dist/components/p-94b1f974.entry.js +0 -1
- package/dist/components/p-97e95520.entry.js +0 -1
- package/dist/components/p-9873ebec.entry.js +0 -1
- package/dist/components/p-9a1a6df1.entry.js +0 -1
- package/dist/components/p-9c5a453b.js +0 -1
- package/dist/components/p-9dc879c9.entry.js +0 -1
- package/dist/components/p-a1d55013.entry.js +0 -1
- package/dist/components/p-a56f0579.entry.js +0 -1
- package/dist/components/p-a8b0fe92.entry.js +0 -1
- package/dist/components/p-acc4d234.entry.js +0 -1
- package/dist/components/p-aefcb641.js +0 -1
- package/dist/components/p-b0b37831.entry.js +0 -1
- package/dist/components/p-b299b89a.entry.js +0 -1
- package/dist/components/p-b2b46793.entry.js +0 -1
- package/dist/components/p-b73410de.js +0 -1
- package/dist/components/p-b76aa402.entry.js +0 -1
- package/dist/components/p-b822abb7.js +0 -1
- package/dist/components/p-b8ba7e5c.entry.js +0 -1
- package/dist/components/p-b931a634.entry.js +0 -1
- package/dist/components/p-b96fc468.entry.js +0 -1
- package/dist/components/p-ba720bf3.js +0 -1
- package/dist/components/p-bab07ba6.entry.js +0 -1
- package/dist/components/p-c1e4ef92.js +0 -1
- package/dist/components/p-c5c782e7.entry.js +0 -1
- package/dist/components/p-c776b6f8.js +0 -1
- package/dist/components/p-c86243a3.entry.js +0 -1
- package/dist/components/p-c8abff96.entry.js +0 -1
- package/dist/components/p-c8e7c854.js +0 -1
- package/dist/components/p-c935aa46.entry.js +0 -1
- package/dist/components/p-c99745a8.entry.js +0 -1
- package/dist/components/p-cccacbd3.js +0 -2
- package/dist/components/p-cccff1e3.entry.js +0 -1
- package/dist/components/p-cd624044.entry.js +0 -1
- package/dist/components/p-cdc36ea8.entry.js +0 -1
- package/dist/components/p-cdf19579.js +0 -1
- package/dist/components/p-d525ed36.entry.js +0 -1
- package/dist/components/p-d94a44b9.entry.js +0 -1
- package/dist/components/p-d962849c.js +0 -1
- package/dist/components/p-dbcf1f0e.entry.js +0 -1
- package/dist/components/p-dcc08064.entry.js +0 -1
- package/dist/components/p-dcd4de1f.entry.js +0 -1
- package/dist/components/p-e1255160.js +0 -1
- package/dist/components/p-e2d5a487.js +0 -1
- package/dist/components/p-e42eb100.entry.js +0 -1
- package/dist/components/p-e64cd6f7.entry.js +0 -1
- package/dist/components/p-e710c860.entry.js +0 -1
- package/dist/components/p-ea089f4e.entry.js +0 -1
- package/dist/components/p-eb0b93d5.js +0 -1
- package/dist/components/p-ecbb679f.js +0 -1
- package/dist/components/p-ece618b3.js +0 -1
- package/dist/components/p-eebf7ebf.entry.js +0 -1
- package/dist/components/p-efc73304.entry.js +0 -1
- package/dist/components/p-f13e9ab1.entry.js +0 -1
- package/dist/components/p-f48a4313.entry.js +0 -1
- package/dist/components/p-f4ce515a.entry.js +0 -1
- package/dist/components/p-ff7acb55.entry.js +0 -1
- package/dist/components/paper.js +0 -15
- package/dist/components/plus.js +0 -12
- package/dist/components/portal.js +0 -18
- package/dist/components/primary.js +0 -65
- package/dist/components/primary2.js +0 -67
- package/dist/components/private.js +0 -25
- package/dist/components/public.js +0 -16
- package/dist/components/search.js +0 -12
- package/dist/components/secondary.js +0 -92
- package/dist/components/secondary2.js +0 -107
- package/dist/components/star.js +0 -5
- package/dist/components/success.js +0 -18
- package/dist/components/support.js +0 -94
- package/dist/components/support2.js +0 -85
- package/dist/components/svg-repository.d.ts +0 -11
- package/dist/components/svg-repository.js +0 -417
- package/dist/components/thumbs-down.js +0 -5
- package/dist/components/thumbs-up.js +0 -6
- package/dist/components/token-list.d.ts +0 -11
- package/dist/components/token-list.js +0 -6
- package/dist/components/token-radii.d.ts +0 -11
- package/dist/components/token-radii.js +0 -6
- package/dist/components/token-radii2.js +0 -47
- package/dist/components/token-ratios.d.ts +0 -11
- package/dist/components/token-ratios.js +0 -54
- package/dist/components/token-shadows.d.ts +0 -11
- package/dist/components/token-shadows.js +0 -6
- package/dist/components/token-shadows2.js +0 -56
- package/dist/components/token-spacing.d.ts +0 -11
- package/dist/components/token-spacing.js +0 -29
- package/dist/components/token-typography.d.ts +0 -11
- package/dist/components/token-typography.js +0 -255
- package/dist/components/tutotial.js +0 -27
- package/dist/components/twitter.js +0 -14
- package/dist/components/unknown.js +0 -22
- package/dist/components/up-and-down.js +0 -12
- package/dist/components/user.js +0 -16
- package/dist/components/youtube.js +0 -14
- package/dist/esm/analytics-44b1416b.js +0 -56
- package/dist/esm/arrow-diagonal-black-8f0494c3.js +0 -3
- package/dist/esm/arrow-right-9322ba8a.js +0 -5
- package/dist/esm/bluesky-cc5edd2d.js +0 -14
- package/dist/esm/bookmark-c200037c.js +0 -16
- package/dist/esm/chevron-down-6144c823.js +0 -12
- package/dist/esm/chevron-left-ca6c66e1.js +0 -11
- package/dist/esm/chevron-right-b88ed2d4.js +0 -5
- package/dist/esm/chevron-up-c66bd477.js +0 -12
- package/dist/esm/close-87fc0d63.js +0 -5
- package/dist/esm/color-2554aad6.js +0 -132
- package/dist/esm/color-primary-palette_6.entry.js +0 -331
- package/dist/esm/components.js +0 -20
- package/dist/esm/copy-03b72cb6.js +0 -5
- package/dist/esm/eds-avatar_26.entry.js +0 -2252
- package/dist/esm/eds-card-desc_2.entry.js +0 -73
- package/dist/esm/eds-login_2.entry.js +0 -2095
- package/dist/esm/eds-pagination_2.entry.js +0 -398
- package/dist/esm/eu-9ddde93a.js +0 -30
- package/dist/esm/facebook-9cb5c17f.js +0 -14
- package/dist/esm/index-39c58238.js +0 -46
- package/dist/esm/index.js +0 -1
- package/dist/esm/linkedin-e8650abb.js +0 -28
- package/dist/esm/loader-c9628637.js +0 -30
- package/dist/esm/loader.js +0 -11
- package/dist/esm/logo-color-7f1fd803.js +0 -115
- package/dist/esm/logo-color-margins-ff8ce71b.js +0 -118
- package/dist/esm/logo-variations-horizontal_2.entry.js +0 -31
- package/dist/esm/logo-white-no-bg-f382f86f.js +0 -1029
- package/dist/esm/mastodon-3703ec61.js +0 -14
- package/dist/esm/menu-340ea948.js +0 -11
- package/dist/esm/minus-b30a7c71.js +0 -11
- package/dist/esm/mono-53f70232.js +0 -11
- package/dist/esm/more-4449d549.js +0 -13
- package/dist/esm/paper-8e74ea31.js +0 -15
- package/dist/esm/plus-89c07be2.js +0 -12
- package/dist/esm/portal-d6c8ce56.js +0 -18
- package/dist/esm/private-1c25ff8e.js +0 -25
- package/dist/esm/public-d4d8c585.js +0 -16
- package/dist/esm/search-fbcd79c2.js +0 -12
- package/dist/esm/sharedUtils-a550989c.js +0 -19
- package/dist/esm/star-0da9b5e9.js +0 -5
- package/dist/esm/success-443809da.js +0 -18
- package/dist/esm/svg-repository.entry.js +0 -333
- package/dist/esm/thumbs-down-a18fd049.js +0 -5
- package/dist/esm/thumbs-up-c19a71bc.js +0 -6
- package/dist/esm/toastManager-d9eee791.js +0 -31
- package/dist/esm/token-list_3.entry.js +0 -294
- package/dist/esm/tutotial-150ee1fd.js +0 -27
- package/dist/esm/twitter-ac21b505.js +0 -14
- package/dist/esm/unknown-ed01a24c.js +0 -22
- package/dist/esm/up-and-down-d747abee.js +0 -12
- package/dist/esm/user-71ebdc15.js +0 -16
- package/dist/esm/youtube-efbfbdc4.js +0 -14
- package/dist/hydrate/index.d.ts +0 -242
- package/dist/hydrate/index.js +0 -32729
- package/dist/hydrate/index.mjs +0 -32721
- package/dist/hydrate/package.json +0 -12
- package/dist/index.cjs.js +0 -1
- package/dist/index.js +0 -1
- package/dist/stencil.config.js +0 -75
- package/loader/cdn.js +0 -1
- package/loader/index.cjs.js +0 -1
- package/loader/index.d.ts +0 -24
- package/loader/index.es2017.js +0 -1
- package/loader/index.js +0 -2
- package/loader/package.json +0 -11
- /package/dist/{esm → components}/app-globals-0f993ce5.js +0 -0
- /package/dist/components/{index2.js → index-144c9ae8.js} +0 -0
- /package/dist/components/{sharedUtils.js → sharedUtils-6a231dd4.js} +0 -0
- /package/dist/components/{toastManager.js → toastManager-b716afd8.js} +0 -0
|
@@ -1,2100 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
const index = require('./index-2f63169d.js');
|
|
6
|
-
const toastManager = require('./toastManager-4e9535f3.js');
|
|
7
|
-
|
|
8
|
-
/*
|
|
9
|
-
* Copyright 2016 Red Hat, Inc. and/or its affiliates
|
|
10
|
-
* and other contributors as indicated by the @author tags.
|
|
11
|
-
*
|
|
12
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
13
|
-
* you may not use this file except in compliance with the License.
|
|
14
|
-
* You may obtain a copy of the License at
|
|
15
|
-
*
|
|
16
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
17
|
-
*
|
|
18
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
19
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
20
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
21
|
-
* See the License for the specific language governing permissions and
|
|
22
|
-
* limitations under the License.
|
|
23
|
-
*/
|
|
24
|
-
function Keycloak (config) {
|
|
25
|
-
if (!(this instanceof Keycloak)) {
|
|
26
|
-
throw new Error("The 'Keycloak' constructor must be invoked with 'new'.")
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
if (typeof config !== 'string' && !isObject(config)) {
|
|
30
|
-
throw new Error("The 'Keycloak' constructor must be provided with a configuration object, or a URL to a JSON configuration file.");
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
if (isObject(config)) {
|
|
34
|
-
const requiredProperties = 'oidcProvider' in config
|
|
35
|
-
? ['clientId']
|
|
36
|
-
: ['url', 'realm', 'clientId'];
|
|
37
|
-
|
|
38
|
-
for (const property of requiredProperties) {
|
|
39
|
-
if (!config[property]) {
|
|
40
|
-
throw new Error(`The configuration object is missing the required '${property}' property.`);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
var kc = this;
|
|
46
|
-
var adapter;
|
|
47
|
-
var refreshQueue = [];
|
|
48
|
-
var callbackStorage;
|
|
49
|
-
|
|
50
|
-
var loginIframe = {
|
|
51
|
-
enable: true,
|
|
52
|
-
callbackList: [],
|
|
53
|
-
interval: 5
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
kc.didInitialize = false;
|
|
57
|
-
|
|
58
|
-
var useNonce = true;
|
|
59
|
-
var logInfo = createLogger(console.info);
|
|
60
|
-
var logWarn = createLogger(console.warn);
|
|
61
|
-
|
|
62
|
-
if (!globalThis.isSecureContext) {
|
|
63
|
-
logWarn(
|
|
64
|
-
"[KEYCLOAK] Keycloak JS must be used in a 'secure context' to function properly as it relies on browser APIs that are otherwise not available.\n" +
|
|
65
|
-
"Continuing to run your application insecurely will lead to unexpected behavior and breakage.\n\n" +
|
|
66
|
-
"For more information see: https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts"
|
|
67
|
-
);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
kc.init = function (initOptions = {}) {
|
|
71
|
-
if (kc.didInitialize) {
|
|
72
|
-
throw new Error("A 'Keycloak' instance can only be initialized once.");
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
kc.didInitialize = true;
|
|
76
|
-
|
|
77
|
-
kc.authenticated = false;
|
|
78
|
-
|
|
79
|
-
callbackStorage = createCallbackStorage();
|
|
80
|
-
var adapters = ['default', 'cordova', 'cordova-native'];
|
|
81
|
-
|
|
82
|
-
if (adapters.indexOf(initOptions.adapter) > -1) {
|
|
83
|
-
adapter = loadAdapter(initOptions.adapter);
|
|
84
|
-
} else if (typeof initOptions.adapter === "object") {
|
|
85
|
-
adapter = initOptions.adapter;
|
|
86
|
-
} else {
|
|
87
|
-
if (window.Cordova || window.cordova) {
|
|
88
|
-
adapter = loadAdapter('cordova');
|
|
89
|
-
} else {
|
|
90
|
-
adapter = loadAdapter();
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
if (typeof initOptions.useNonce !== 'undefined') {
|
|
95
|
-
useNonce = initOptions.useNonce;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
if (typeof initOptions.checkLoginIframe !== 'undefined') {
|
|
99
|
-
loginIframe.enable = initOptions.checkLoginIframe;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
if (initOptions.checkLoginIframeInterval) {
|
|
103
|
-
loginIframe.interval = initOptions.checkLoginIframeInterval;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
if (initOptions.onLoad === 'login-required') {
|
|
107
|
-
kc.loginRequired = true;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
if (initOptions.responseMode) {
|
|
111
|
-
if (initOptions.responseMode === 'query' || initOptions.responseMode === 'fragment') {
|
|
112
|
-
kc.responseMode = initOptions.responseMode;
|
|
113
|
-
} else {
|
|
114
|
-
throw 'Invalid value for responseMode';
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
if (initOptions.flow) {
|
|
119
|
-
switch (initOptions.flow) {
|
|
120
|
-
case 'standard':
|
|
121
|
-
kc.responseType = 'code';
|
|
122
|
-
break;
|
|
123
|
-
case 'implicit':
|
|
124
|
-
kc.responseType = 'id_token token';
|
|
125
|
-
break;
|
|
126
|
-
case 'hybrid':
|
|
127
|
-
kc.responseType = 'code id_token token';
|
|
128
|
-
break;
|
|
129
|
-
default:
|
|
130
|
-
throw 'Invalid value for flow';
|
|
131
|
-
}
|
|
132
|
-
kc.flow = initOptions.flow;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
if (initOptions.timeSkew != null) {
|
|
136
|
-
kc.timeSkew = initOptions.timeSkew;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
if(initOptions.redirectUri) {
|
|
140
|
-
kc.redirectUri = initOptions.redirectUri;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
if (initOptions.silentCheckSsoRedirectUri) {
|
|
144
|
-
kc.silentCheckSsoRedirectUri = initOptions.silentCheckSsoRedirectUri;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
if (typeof initOptions.silentCheckSsoFallback === 'boolean') {
|
|
148
|
-
kc.silentCheckSsoFallback = initOptions.silentCheckSsoFallback;
|
|
149
|
-
} else {
|
|
150
|
-
kc.silentCheckSsoFallback = true;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
if (typeof initOptions.pkceMethod !== "undefined") {
|
|
154
|
-
if (initOptions.pkceMethod !== "S256" && initOptions.pkceMethod !== false) {
|
|
155
|
-
throw new TypeError(`Invalid value for pkceMethod', expected 'S256' or false but got ${initOptions.pkceMethod}.`);
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
kc.pkceMethod = initOptions.pkceMethod;
|
|
159
|
-
} else {
|
|
160
|
-
kc.pkceMethod = "S256";
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
if (typeof initOptions.enableLogging === 'boolean') {
|
|
164
|
-
kc.enableLogging = initOptions.enableLogging;
|
|
165
|
-
} else {
|
|
166
|
-
kc.enableLogging = false;
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
if (initOptions.logoutMethod === 'POST') {
|
|
170
|
-
kc.logoutMethod = 'POST';
|
|
171
|
-
} else {
|
|
172
|
-
kc.logoutMethod = 'GET';
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
if (typeof initOptions.scope === 'string') {
|
|
176
|
-
kc.scope = initOptions.scope;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
if (typeof initOptions.acrValues === 'string') {
|
|
180
|
-
kc.acrValues = initOptions.acrValues;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
if (typeof initOptions.messageReceiveTimeout === 'number' && initOptions.messageReceiveTimeout > 0) {
|
|
184
|
-
kc.messageReceiveTimeout = initOptions.messageReceiveTimeout;
|
|
185
|
-
} else {
|
|
186
|
-
kc.messageReceiveTimeout = 10000;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
if (!kc.responseMode) {
|
|
190
|
-
kc.responseMode = 'fragment';
|
|
191
|
-
}
|
|
192
|
-
if (!kc.responseType) {
|
|
193
|
-
kc.responseType = 'code';
|
|
194
|
-
kc.flow = 'standard';
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
var promise = createPromise();
|
|
198
|
-
|
|
199
|
-
var initPromise = createPromise();
|
|
200
|
-
initPromise.promise.then(function() {
|
|
201
|
-
kc.onReady && kc.onReady(kc.authenticated);
|
|
202
|
-
promise.setSuccess(kc.authenticated);
|
|
203
|
-
}).catch(function(error) {
|
|
204
|
-
promise.setError(error);
|
|
205
|
-
});
|
|
206
|
-
|
|
207
|
-
var configPromise = loadConfig();
|
|
208
|
-
|
|
209
|
-
function onLoad() {
|
|
210
|
-
var doLogin = function(prompt) {
|
|
211
|
-
if (!prompt) {
|
|
212
|
-
options.prompt = 'none';
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
if (initOptions.locale) {
|
|
216
|
-
options.locale = initOptions.locale;
|
|
217
|
-
}
|
|
218
|
-
kc.login(options).then(function () {
|
|
219
|
-
initPromise.setSuccess();
|
|
220
|
-
}).catch(function (error) {
|
|
221
|
-
initPromise.setError(error);
|
|
222
|
-
});
|
|
223
|
-
};
|
|
224
|
-
|
|
225
|
-
var checkSsoSilently = async function() {
|
|
226
|
-
var ifrm = document.createElement("iframe");
|
|
227
|
-
var src = await kc.createLoginUrl({prompt: 'none', redirectUri: kc.silentCheckSsoRedirectUri});
|
|
228
|
-
ifrm.setAttribute("src", src);
|
|
229
|
-
ifrm.setAttribute("sandbox", "allow-storage-access-by-user-activation allow-scripts allow-same-origin");
|
|
230
|
-
ifrm.setAttribute("title", "keycloak-silent-check-sso");
|
|
231
|
-
ifrm.style.display = "none";
|
|
232
|
-
document.body.appendChild(ifrm);
|
|
233
|
-
|
|
234
|
-
var messageCallback = function(event) {
|
|
235
|
-
if (event.origin !== window.location.origin || ifrm.contentWindow !== event.source) {
|
|
236
|
-
return;
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
var oauth = parseCallback(event.data);
|
|
240
|
-
processCallback(oauth, initPromise);
|
|
241
|
-
|
|
242
|
-
document.body.removeChild(ifrm);
|
|
243
|
-
window.removeEventListener("message", messageCallback);
|
|
244
|
-
};
|
|
245
|
-
|
|
246
|
-
window.addEventListener("message", messageCallback);
|
|
247
|
-
};
|
|
248
|
-
|
|
249
|
-
var options = {};
|
|
250
|
-
switch (initOptions.onLoad) {
|
|
251
|
-
case 'check-sso':
|
|
252
|
-
if (loginIframe.enable) {
|
|
253
|
-
setupCheckLoginIframe().then(function() {
|
|
254
|
-
checkLoginIframe().then(function (unchanged) {
|
|
255
|
-
if (!unchanged) {
|
|
256
|
-
kc.silentCheckSsoRedirectUri ? checkSsoSilently() : doLogin(false);
|
|
257
|
-
} else {
|
|
258
|
-
initPromise.setSuccess();
|
|
259
|
-
}
|
|
260
|
-
}).catch(function (error) {
|
|
261
|
-
initPromise.setError(error);
|
|
262
|
-
});
|
|
263
|
-
});
|
|
264
|
-
} else {
|
|
265
|
-
kc.silentCheckSsoRedirectUri ? checkSsoSilently() : doLogin(false);
|
|
266
|
-
}
|
|
267
|
-
break;
|
|
268
|
-
case 'login-required':
|
|
269
|
-
doLogin(true);
|
|
270
|
-
break;
|
|
271
|
-
default:
|
|
272
|
-
throw 'Invalid value for onLoad';
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
function processInit() {
|
|
277
|
-
var callback = parseCallback(window.location.href);
|
|
278
|
-
|
|
279
|
-
if (callback) {
|
|
280
|
-
window.history.replaceState(window.history.state, null, callback.newUrl);
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
if (callback && callback.valid) {
|
|
284
|
-
return setupCheckLoginIframe().then(function() {
|
|
285
|
-
processCallback(callback, initPromise);
|
|
286
|
-
}).catch(function (error) {
|
|
287
|
-
initPromise.setError(error);
|
|
288
|
-
});
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
if (initOptions.token && initOptions.refreshToken) {
|
|
292
|
-
setToken(initOptions.token, initOptions.refreshToken, initOptions.idToken);
|
|
293
|
-
|
|
294
|
-
if (loginIframe.enable) {
|
|
295
|
-
setupCheckLoginIframe().then(function() {
|
|
296
|
-
checkLoginIframe().then(function (unchanged) {
|
|
297
|
-
if (unchanged) {
|
|
298
|
-
kc.onAuthSuccess && kc.onAuthSuccess();
|
|
299
|
-
initPromise.setSuccess();
|
|
300
|
-
scheduleCheckIframe();
|
|
301
|
-
} else {
|
|
302
|
-
initPromise.setSuccess();
|
|
303
|
-
}
|
|
304
|
-
}).catch(function (error) {
|
|
305
|
-
initPromise.setError(error);
|
|
306
|
-
});
|
|
307
|
-
});
|
|
308
|
-
} else {
|
|
309
|
-
kc.updateToken(-1).then(function() {
|
|
310
|
-
kc.onAuthSuccess && kc.onAuthSuccess();
|
|
311
|
-
initPromise.setSuccess();
|
|
312
|
-
}).catch(function(error) {
|
|
313
|
-
kc.onAuthError && kc.onAuthError();
|
|
314
|
-
if (initOptions.onLoad) {
|
|
315
|
-
onLoad();
|
|
316
|
-
} else {
|
|
317
|
-
initPromise.setError(error);
|
|
318
|
-
}
|
|
319
|
-
});
|
|
320
|
-
}
|
|
321
|
-
} else if (initOptions.onLoad) {
|
|
322
|
-
onLoad();
|
|
323
|
-
} else {
|
|
324
|
-
initPromise.setSuccess();
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
configPromise.then(function () {
|
|
329
|
-
check3pCookiesSupported()
|
|
330
|
-
.then(processInit)
|
|
331
|
-
.catch(function (error) {
|
|
332
|
-
promise.setError(error);
|
|
333
|
-
});
|
|
334
|
-
});
|
|
335
|
-
configPromise.catch(function (error) {
|
|
336
|
-
promise.setError(error);
|
|
337
|
-
});
|
|
338
|
-
|
|
339
|
-
return promise.promise;
|
|
340
|
-
};
|
|
341
|
-
|
|
342
|
-
kc.login = function (options) {
|
|
343
|
-
return adapter.login(options);
|
|
344
|
-
};
|
|
345
|
-
|
|
346
|
-
function generateRandomData(len) {
|
|
347
|
-
if (typeof crypto === "undefined" || typeof crypto.getRandomValues === "undefined") {
|
|
348
|
-
throw new Error("Web Crypto API is not available.");
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
return crypto.getRandomValues(new Uint8Array(len));
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
function generateCodeVerifier(len) {
|
|
355
|
-
return generateRandomString(len, 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789');
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
function generateRandomString(len, alphabet){
|
|
359
|
-
var randomData = generateRandomData(len);
|
|
360
|
-
var chars = new Array(len);
|
|
361
|
-
for (var i = 0; i < len; i++) {
|
|
362
|
-
chars[i] = alphabet.charCodeAt(randomData[i] % alphabet.length);
|
|
363
|
-
}
|
|
364
|
-
return String.fromCharCode.apply(null, chars);
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
async function generatePkceChallenge(pkceMethod, codeVerifier) {
|
|
368
|
-
if (pkceMethod !== "S256") {
|
|
369
|
-
throw new TypeError(`Invalid value for 'pkceMethod', expected 'S256' but got '${pkceMethod}'.`);
|
|
370
|
-
}
|
|
371
|
-
|
|
372
|
-
// hash codeVerifier, then encode as url-safe base64 without padding
|
|
373
|
-
const hashBytes = new Uint8Array(await sha256Digest(codeVerifier));
|
|
374
|
-
const encodedHash = bytesToBase64(hashBytes)
|
|
375
|
-
.replace(/\+/g, '-')
|
|
376
|
-
.replace(/\//g, '_')
|
|
377
|
-
.replace(/\=/g, '');
|
|
378
|
-
|
|
379
|
-
return encodedHash;
|
|
380
|
-
}
|
|
381
|
-
|
|
382
|
-
function buildClaimsParameter(requestedAcr){
|
|
383
|
-
var claims = {
|
|
384
|
-
id_token: {
|
|
385
|
-
acr: requestedAcr
|
|
386
|
-
}
|
|
387
|
-
};
|
|
388
|
-
return JSON.stringify(claims);
|
|
389
|
-
}
|
|
390
|
-
|
|
391
|
-
kc.createLoginUrl = async function(options) {
|
|
392
|
-
var state = createUUID();
|
|
393
|
-
var nonce = createUUID();
|
|
394
|
-
|
|
395
|
-
var redirectUri = adapter.redirectUri(options);
|
|
396
|
-
|
|
397
|
-
var callbackState = {
|
|
398
|
-
state: state,
|
|
399
|
-
nonce: nonce,
|
|
400
|
-
redirectUri: encodeURIComponent(redirectUri),
|
|
401
|
-
loginOptions: options
|
|
402
|
-
};
|
|
403
|
-
|
|
404
|
-
if (options && options.prompt) {
|
|
405
|
-
callbackState.prompt = options.prompt;
|
|
406
|
-
}
|
|
407
|
-
|
|
408
|
-
var baseUrl;
|
|
409
|
-
if (options && options.action == 'register') {
|
|
410
|
-
baseUrl = kc.endpoints.register();
|
|
411
|
-
} else {
|
|
412
|
-
baseUrl = kc.endpoints.authorize();
|
|
413
|
-
}
|
|
414
|
-
|
|
415
|
-
var scope = options && options.scope || kc.scope;
|
|
416
|
-
if (!scope) {
|
|
417
|
-
// if scope is not set, default to "openid"
|
|
418
|
-
scope = "openid";
|
|
419
|
-
} else if (scope.indexOf("openid") === -1) {
|
|
420
|
-
// if openid scope is missing, prefix the given scopes with it
|
|
421
|
-
scope = "openid " + scope;
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
var url = baseUrl
|
|
425
|
-
+ '?client_id=' + encodeURIComponent(kc.clientId)
|
|
426
|
-
+ '&redirect_uri=' + encodeURIComponent(redirectUri)
|
|
427
|
-
+ '&state=' + encodeURIComponent(state)
|
|
428
|
-
+ '&response_mode=' + encodeURIComponent(kc.responseMode)
|
|
429
|
-
+ '&response_type=' + encodeURIComponent(kc.responseType)
|
|
430
|
-
+ '&scope=' + encodeURIComponent(scope);
|
|
431
|
-
if (useNonce) {
|
|
432
|
-
url = url + '&nonce=' + encodeURIComponent(nonce);
|
|
433
|
-
}
|
|
434
|
-
|
|
435
|
-
if (options && options.prompt) {
|
|
436
|
-
url += '&prompt=' + encodeURIComponent(options.prompt);
|
|
437
|
-
}
|
|
438
|
-
|
|
439
|
-
if (options && typeof options.maxAge === 'number') {
|
|
440
|
-
url += '&max_age=' + encodeURIComponent(options.maxAge);
|
|
441
|
-
}
|
|
442
|
-
|
|
443
|
-
if (options && options.loginHint) {
|
|
444
|
-
url += '&login_hint=' + encodeURIComponent(options.loginHint);
|
|
445
|
-
}
|
|
446
|
-
|
|
447
|
-
if (options && options.idpHint) {
|
|
448
|
-
url += '&kc_idp_hint=' + encodeURIComponent(options.idpHint);
|
|
449
|
-
}
|
|
450
|
-
|
|
451
|
-
if (options && options.action && options.action != 'register') {
|
|
452
|
-
url += '&kc_action=' + encodeURIComponent(options.action);
|
|
453
|
-
}
|
|
454
|
-
|
|
455
|
-
if (options && options.locale) {
|
|
456
|
-
url += '&ui_locales=' + encodeURIComponent(options.locale);
|
|
457
|
-
}
|
|
458
|
-
|
|
459
|
-
if (options && options.acr) {
|
|
460
|
-
var claimsParameter = buildClaimsParameter(options.acr);
|
|
461
|
-
url += '&claims=' + encodeURIComponent(claimsParameter);
|
|
462
|
-
}
|
|
463
|
-
|
|
464
|
-
if ((options && options.acrValues) || kc.acrValues) {
|
|
465
|
-
url += '&acr_values=' + encodeURIComponent(options.acrValues || kc.acrValues);
|
|
466
|
-
}
|
|
467
|
-
|
|
468
|
-
if (kc.pkceMethod) {
|
|
469
|
-
try {
|
|
470
|
-
const codeVerifier = generateCodeVerifier(96);
|
|
471
|
-
const pkceChallenge = await generatePkceChallenge(kc.pkceMethod, codeVerifier);
|
|
472
|
-
|
|
473
|
-
callbackState.pkceCodeVerifier = codeVerifier;
|
|
474
|
-
|
|
475
|
-
url += '&code_challenge=' + pkceChallenge;
|
|
476
|
-
url += '&code_challenge_method=' + kc.pkceMethod;
|
|
477
|
-
} catch (error) {
|
|
478
|
-
throw new Error("Failed to generate PKCE challenge.", { cause: error });
|
|
479
|
-
}
|
|
480
|
-
}
|
|
481
|
-
|
|
482
|
-
callbackStorage.add(callbackState);
|
|
483
|
-
|
|
484
|
-
return url;
|
|
485
|
-
};
|
|
486
|
-
|
|
487
|
-
kc.logout = function(options) {
|
|
488
|
-
return adapter.logout(options);
|
|
489
|
-
};
|
|
490
|
-
|
|
491
|
-
kc.createLogoutUrl = function(options) {
|
|
492
|
-
|
|
493
|
-
const logoutMethod = options?.logoutMethod ?? kc.logoutMethod;
|
|
494
|
-
if (logoutMethod === 'POST') {
|
|
495
|
-
return kc.endpoints.logout();
|
|
496
|
-
}
|
|
497
|
-
|
|
498
|
-
var url = kc.endpoints.logout()
|
|
499
|
-
+ '?client_id=' + encodeURIComponent(kc.clientId)
|
|
500
|
-
+ '&post_logout_redirect_uri=' + encodeURIComponent(adapter.redirectUri(options, false));
|
|
501
|
-
|
|
502
|
-
if (kc.idToken) {
|
|
503
|
-
url += '&id_token_hint=' + encodeURIComponent(kc.idToken);
|
|
504
|
-
}
|
|
505
|
-
|
|
506
|
-
return url;
|
|
507
|
-
};
|
|
508
|
-
|
|
509
|
-
kc.register = function (options) {
|
|
510
|
-
return adapter.register(options);
|
|
511
|
-
};
|
|
512
|
-
|
|
513
|
-
kc.createRegisterUrl = async function(options) {
|
|
514
|
-
if (!options) {
|
|
515
|
-
options = {};
|
|
516
|
-
}
|
|
517
|
-
options.action = 'register';
|
|
518
|
-
return await kc.createLoginUrl(options);
|
|
519
|
-
};
|
|
520
|
-
|
|
521
|
-
kc.createAccountUrl = function(options) {
|
|
522
|
-
var realm = getRealmUrl();
|
|
523
|
-
var url = undefined;
|
|
524
|
-
if (typeof realm !== 'undefined') {
|
|
525
|
-
url = realm
|
|
526
|
-
+ '/account'
|
|
527
|
-
+ '?referrer=' + encodeURIComponent(kc.clientId)
|
|
528
|
-
+ '&referrer_uri=' + encodeURIComponent(adapter.redirectUri(options));
|
|
529
|
-
}
|
|
530
|
-
return url;
|
|
531
|
-
};
|
|
532
|
-
|
|
533
|
-
kc.accountManagement = function() {
|
|
534
|
-
return adapter.accountManagement();
|
|
535
|
-
};
|
|
536
|
-
|
|
537
|
-
kc.hasRealmRole = function (role) {
|
|
538
|
-
var access = kc.realmAccess;
|
|
539
|
-
return !!access && access.roles.indexOf(role) >= 0;
|
|
540
|
-
};
|
|
541
|
-
|
|
542
|
-
kc.hasResourceRole = function(role, resource) {
|
|
543
|
-
if (!kc.resourceAccess) {
|
|
544
|
-
return false;
|
|
545
|
-
}
|
|
546
|
-
|
|
547
|
-
var access = kc.resourceAccess[resource || kc.clientId];
|
|
548
|
-
return !!access && access.roles.indexOf(role) >= 0;
|
|
549
|
-
};
|
|
550
|
-
|
|
551
|
-
kc.loadUserProfile = function() {
|
|
552
|
-
var url = getRealmUrl() + '/account';
|
|
553
|
-
var req = new XMLHttpRequest();
|
|
554
|
-
req.open('GET', url, true);
|
|
555
|
-
req.setRequestHeader('Accept', 'application/json');
|
|
556
|
-
req.setRequestHeader('Authorization', 'bearer ' + kc.token);
|
|
557
|
-
|
|
558
|
-
var promise = createPromise();
|
|
559
|
-
|
|
560
|
-
req.onreadystatechange = function () {
|
|
561
|
-
if (req.readyState == 4) {
|
|
562
|
-
if (req.status == 200) {
|
|
563
|
-
kc.profile = JSON.parse(req.responseText);
|
|
564
|
-
promise.setSuccess(kc.profile);
|
|
565
|
-
} else {
|
|
566
|
-
promise.setError();
|
|
567
|
-
}
|
|
568
|
-
}
|
|
569
|
-
};
|
|
570
|
-
|
|
571
|
-
req.send();
|
|
572
|
-
|
|
573
|
-
return promise.promise;
|
|
574
|
-
};
|
|
575
|
-
|
|
576
|
-
kc.loadUserInfo = function() {
|
|
577
|
-
var url = kc.endpoints.userinfo();
|
|
578
|
-
var req = new XMLHttpRequest();
|
|
579
|
-
req.open('GET', url, true);
|
|
580
|
-
req.setRequestHeader('Accept', 'application/json');
|
|
581
|
-
req.setRequestHeader('Authorization', 'bearer ' + kc.token);
|
|
582
|
-
|
|
583
|
-
var promise = createPromise();
|
|
584
|
-
|
|
585
|
-
req.onreadystatechange = function () {
|
|
586
|
-
if (req.readyState == 4) {
|
|
587
|
-
if (req.status == 200) {
|
|
588
|
-
kc.userInfo = JSON.parse(req.responseText);
|
|
589
|
-
promise.setSuccess(kc.userInfo);
|
|
590
|
-
} else {
|
|
591
|
-
promise.setError();
|
|
592
|
-
}
|
|
593
|
-
}
|
|
594
|
-
};
|
|
595
|
-
|
|
596
|
-
req.send();
|
|
597
|
-
|
|
598
|
-
return promise.promise;
|
|
599
|
-
};
|
|
600
|
-
|
|
601
|
-
kc.isTokenExpired = function(minValidity) {
|
|
602
|
-
if (!kc.tokenParsed || (!kc.refreshToken && kc.flow != 'implicit' )) {
|
|
603
|
-
throw 'Not authenticated';
|
|
604
|
-
}
|
|
605
|
-
|
|
606
|
-
if (kc.timeSkew == null) {
|
|
607
|
-
logInfo('[KEYCLOAK] Unable to determine if token is expired as timeskew is not set');
|
|
608
|
-
return true;
|
|
609
|
-
}
|
|
610
|
-
|
|
611
|
-
var expiresIn = kc.tokenParsed['exp'] - Math.ceil(new Date().getTime() / 1000) + kc.timeSkew;
|
|
612
|
-
if (minValidity) {
|
|
613
|
-
if (isNaN(minValidity)) {
|
|
614
|
-
throw 'Invalid minValidity';
|
|
615
|
-
}
|
|
616
|
-
expiresIn -= minValidity;
|
|
617
|
-
}
|
|
618
|
-
return expiresIn < 0;
|
|
619
|
-
};
|
|
620
|
-
|
|
621
|
-
kc.updateToken = function(minValidity) {
|
|
622
|
-
var promise = createPromise();
|
|
623
|
-
|
|
624
|
-
if (!kc.refreshToken) {
|
|
625
|
-
promise.setError();
|
|
626
|
-
return promise.promise;
|
|
627
|
-
}
|
|
628
|
-
|
|
629
|
-
minValidity = minValidity || 5;
|
|
630
|
-
|
|
631
|
-
var exec = function() {
|
|
632
|
-
var refreshToken = false;
|
|
633
|
-
if (minValidity == -1) {
|
|
634
|
-
refreshToken = true;
|
|
635
|
-
logInfo('[KEYCLOAK] Refreshing token: forced refresh');
|
|
636
|
-
} else if (!kc.tokenParsed || kc.isTokenExpired(minValidity)) {
|
|
637
|
-
refreshToken = true;
|
|
638
|
-
logInfo('[KEYCLOAK] Refreshing token: token expired');
|
|
639
|
-
}
|
|
640
|
-
|
|
641
|
-
if (!refreshToken) {
|
|
642
|
-
promise.setSuccess(false);
|
|
643
|
-
} else {
|
|
644
|
-
var params = 'grant_type=refresh_token&' + 'refresh_token=' + kc.refreshToken;
|
|
645
|
-
var url = kc.endpoints.token();
|
|
646
|
-
|
|
647
|
-
refreshQueue.push(promise);
|
|
648
|
-
|
|
649
|
-
if (refreshQueue.length == 1) {
|
|
650
|
-
var req = new XMLHttpRequest();
|
|
651
|
-
req.open('POST', url, true);
|
|
652
|
-
req.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
|
|
653
|
-
req.withCredentials = true;
|
|
654
|
-
|
|
655
|
-
params += '&client_id=' + encodeURIComponent(kc.clientId);
|
|
656
|
-
|
|
657
|
-
var timeLocal = new Date().getTime();
|
|
658
|
-
|
|
659
|
-
req.onreadystatechange = function () {
|
|
660
|
-
if (req.readyState == 4) {
|
|
661
|
-
if (req.status == 200) {
|
|
662
|
-
logInfo('[KEYCLOAK] Token refreshed');
|
|
663
|
-
|
|
664
|
-
timeLocal = (timeLocal + new Date().getTime()) / 2;
|
|
665
|
-
|
|
666
|
-
var tokenResponse = JSON.parse(req.responseText);
|
|
667
|
-
|
|
668
|
-
setToken(tokenResponse['access_token'], tokenResponse['refresh_token'], tokenResponse['id_token'], timeLocal);
|
|
669
|
-
|
|
670
|
-
kc.onAuthRefreshSuccess && kc.onAuthRefreshSuccess();
|
|
671
|
-
for (var p = refreshQueue.pop(); p != null; p = refreshQueue.pop()) {
|
|
672
|
-
p.setSuccess(true);
|
|
673
|
-
}
|
|
674
|
-
} else {
|
|
675
|
-
logWarn('[KEYCLOAK] Failed to refresh token');
|
|
676
|
-
|
|
677
|
-
if (req.status == 400) {
|
|
678
|
-
kc.clearToken();
|
|
679
|
-
}
|
|
680
|
-
|
|
681
|
-
kc.onAuthRefreshError && kc.onAuthRefreshError();
|
|
682
|
-
for (var p = refreshQueue.pop(); p != null; p = refreshQueue.pop()) {
|
|
683
|
-
p.setError("Failed to refresh token: An unexpected HTTP error occurred while attempting to refresh the token.");
|
|
684
|
-
}
|
|
685
|
-
}
|
|
686
|
-
}
|
|
687
|
-
};
|
|
688
|
-
|
|
689
|
-
req.send(params);
|
|
690
|
-
}
|
|
691
|
-
}
|
|
692
|
-
};
|
|
693
|
-
|
|
694
|
-
if (loginIframe.enable) {
|
|
695
|
-
var iframePromise = checkLoginIframe();
|
|
696
|
-
iframePromise.then(function() {
|
|
697
|
-
exec();
|
|
698
|
-
}).catch(function(error) {
|
|
699
|
-
promise.setError(error);
|
|
700
|
-
});
|
|
701
|
-
} else {
|
|
702
|
-
exec();
|
|
703
|
-
}
|
|
704
|
-
|
|
705
|
-
return promise.promise;
|
|
706
|
-
};
|
|
707
|
-
|
|
708
|
-
kc.clearToken = function() {
|
|
709
|
-
if (kc.token) {
|
|
710
|
-
setToken(null, null, null);
|
|
711
|
-
kc.onAuthLogout && kc.onAuthLogout();
|
|
712
|
-
if (kc.loginRequired) {
|
|
713
|
-
kc.login();
|
|
714
|
-
}
|
|
715
|
-
}
|
|
716
|
-
};
|
|
717
|
-
|
|
718
|
-
function getRealmUrl() {
|
|
719
|
-
if (typeof kc.authServerUrl !== 'undefined') {
|
|
720
|
-
if (kc.authServerUrl.charAt(kc.authServerUrl.length - 1) == '/') {
|
|
721
|
-
return kc.authServerUrl + 'realms/' + encodeURIComponent(kc.realm);
|
|
722
|
-
} else {
|
|
723
|
-
return kc.authServerUrl + '/realms/' + encodeURIComponent(kc.realm);
|
|
724
|
-
}
|
|
725
|
-
} else {
|
|
726
|
-
return undefined;
|
|
727
|
-
}
|
|
728
|
-
}
|
|
729
|
-
|
|
730
|
-
function getOrigin() {
|
|
731
|
-
if (!window.location.origin) {
|
|
732
|
-
return window.location.protocol + "//" + window.location.hostname + (window.location.port ? ':' + window.location.port: '');
|
|
733
|
-
} else {
|
|
734
|
-
return window.location.origin;
|
|
735
|
-
}
|
|
736
|
-
}
|
|
737
|
-
|
|
738
|
-
function processCallback(oauth, promise) {
|
|
739
|
-
var code = oauth.code;
|
|
740
|
-
var error = oauth.error;
|
|
741
|
-
var prompt = oauth.prompt;
|
|
742
|
-
|
|
743
|
-
var timeLocal = new Date().getTime();
|
|
744
|
-
|
|
745
|
-
if (oauth['kc_action_status']) {
|
|
746
|
-
kc.onActionUpdate && kc.onActionUpdate(oauth['kc_action_status'], oauth['kc_action']);
|
|
747
|
-
}
|
|
748
|
-
|
|
749
|
-
if (error) {
|
|
750
|
-
if (prompt != 'none') {
|
|
751
|
-
if (oauth.error_description && oauth.error_description === "authentication_expired") {
|
|
752
|
-
kc.login(oauth.loginOptions);
|
|
753
|
-
} else {
|
|
754
|
-
var errorData = { error: error, error_description: oauth.error_description };
|
|
755
|
-
kc.onAuthError && kc.onAuthError(errorData);
|
|
756
|
-
promise && promise.setError(errorData);
|
|
757
|
-
}
|
|
758
|
-
} else {
|
|
759
|
-
promise && promise.setSuccess();
|
|
760
|
-
}
|
|
761
|
-
return;
|
|
762
|
-
} else if ((kc.flow != 'standard') && (oauth.access_token || oauth.id_token)) {
|
|
763
|
-
authSuccess(oauth.access_token, null, oauth.id_token, true);
|
|
764
|
-
}
|
|
765
|
-
|
|
766
|
-
if ((kc.flow != 'implicit') && code) {
|
|
767
|
-
var params = 'code=' + code + '&grant_type=authorization_code';
|
|
768
|
-
var url = kc.endpoints.token();
|
|
769
|
-
|
|
770
|
-
var req = new XMLHttpRequest();
|
|
771
|
-
req.open('POST', url, true);
|
|
772
|
-
req.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
|
|
773
|
-
|
|
774
|
-
params += '&client_id=' + encodeURIComponent(kc.clientId);
|
|
775
|
-
params += '&redirect_uri=' + oauth.redirectUri;
|
|
776
|
-
|
|
777
|
-
if (oauth.pkceCodeVerifier) {
|
|
778
|
-
params += '&code_verifier=' + oauth.pkceCodeVerifier;
|
|
779
|
-
}
|
|
780
|
-
|
|
781
|
-
req.withCredentials = true;
|
|
782
|
-
|
|
783
|
-
req.onreadystatechange = function() {
|
|
784
|
-
if (req.readyState == 4) {
|
|
785
|
-
if (req.status == 200) {
|
|
786
|
-
|
|
787
|
-
var tokenResponse = JSON.parse(req.responseText);
|
|
788
|
-
authSuccess(tokenResponse['access_token'], tokenResponse['refresh_token'], tokenResponse['id_token'], kc.flow === 'standard');
|
|
789
|
-
scheduleCheckIframe();
|
|
790
|
-
} else {
|
|
791
|
-
kc.onAuthError && kc.onAuthError();
|
|
792
|
-
promise && promise.setError();
|
|
793
|
-
}
|
|
794
|
-
}
|
|
795
|
-
};
|
|
796
|
-
|
|
797
|
-
req.send(params);
|
|
798
|
-
}
|
|
799
|
-
|
|
800
|
-
function authSuccess(accessToken, refreshToken, idToken, fulfillPromise) {
|
|
801
|
-
timeLocal = (timeLocal + new Date().getTime()) / 2;
|
|
802
|
-
|
|
803
|
-
setToken(accessToken, refreshToken, idToken, timeLocal);
|
|
804
|
-
|
|
805
|
-
if (useNonce && (kc.idTokenParsed && kc.idTokenParsed.nonce != oauth.storedNonce)) {
|
|
806
|
-
logInfo('[KEYCLOAK] Invalid nonce, clearing token');
|
|
807
|
-
kc.clearToken();
|
|
808
|
-
promise && promise.setError();
|
|
809
|
-
} else {
|
|
810
|
-
if (fulfillPromise) {
|
|
811
|
-
kc.onAuthSuccess && kc.onAuthSuccess();
|
|
812
|
-
promise && promise.setSuccess();
|
|
813
|
-
}
|
|
814
|
-
}
|
|
815
|
-
}
|
|
816
|
-
|
|
817
|
-
}
|
|
818
|
-
|
|
819
|
-
function loadConfig() {
|
|
820
|
-
var promise = createPromise();
|
|
821
|
-
var configUrl;
|
|
822
|
-
|
|
823
|
-
if (typeof config === 'string') {
|
|
824
|
-
configUrl = config;
|
|
825
|
-
}
|
|
826
|
-
|
|
827
|
-
function setupOidcEndoints(oidcConfiguration) {
|
|
828
|
-
if (! oidcConfiguration) {
|
|
829
|
-
kc.endpoints = {
|
|
830
|
-
authorize: function() {
|
|
831
|
-
return getRealmUrl() + '/protocol/openid-connect/auth';
|
|
832
|
-
},
|
|
833
|
-
token: function() {
|
|
834
|
-
return getRealmUrl() + '/protocol/openid-connect/token';
|
|
835
|
-
},
|
|
836
|
-
logout: function() {
|
|
837
|
-
return getRealmUrl() + '/protocol/openid-connect/logout';
|
|
838
|
-
},
|
|
839
|
-
checkSessionIframe: function() {
|
|
840
|
-
return getRealmUrl() + '/protocol/openid-connect/login-status-iframe.html';
|
|
841
|
-
},
|
|
842
|
-
thirdPartyCookiesIframe: function() {
|
|
843
|
-
return getRealmUrl() + '/protocol/openid-connect/3p-cookies/step1.html';
|
|
844
|
-
},
|
|
845
|
-
register: function() {
|
|
846
|
-
return getRealmUrl() + '/protocol/openid-connect/registrations';
|
|
847
|
-
},
|
|
848
|
-
userinfo: function() {
|
|
849
|
-
return getRealmUrl() + '/protocol/openid-connect/userinfo';
|
|
850
|
-
}
|
|
851
|
-
};
|
|
852
|
-
} else {
|
|
853
|
-
kc.endpoints = {
|
|
854
|
-
authorize: function() {
|
|
855
|
-
return oidcConfiguration.authorization_endpoint;
|
|
856
|
-
},
|
|
857
|
-
token: function() {
|
|
858
|
-
return oidcConfiguration.token_endpoint;
|
|
859
|
-
},
|
|
860
|
-
logout: function() {
|
|
861
|
-
if (!oidcConfiguration.end_session_endpoint) {
|
|
862
|
-
throw "Not supported by the OIDC server";
|
|
863
|
-
}
|
|
864
|
-
return oidcConfiguration.end_session_endpoint;
|
|
865
|
-
},
|
|
866
|
-
checkSessionIframe: function() {
|
|
867
|
-
if (!oidcConfiguration.check_session_iframe) {
|
|
868
|
-
throw "Not supported by the OIDC server";
|
|
869
|
-
}
|
|
870
|
-
return oidcConfiguration.check_session_iframe;
|
|
871
|
-
},
|
|
872
|
-
register: function() {
|
|
873
|
-
throw 'Redirection to "Register user" page not supported in standard OIDC mode';
|
|
874
|
-
},
|
|
875
|
-
userinfo: function() {
|
|
876
|
-
if (!oidcConfiguration.userinfo_endpoint) {
|
|
877
|
-
throw "Not supported by the OIDC server";
|
|
878
|
-
}
|
|
879
|
-
return oidcConfiguration.userinfo_endpoint;
|
|
880
|
-
}
|
|
881
|
-
};
|
|
882
|
-
}
|
|
883
|
-
}
|
|
884
|
-
|
|
885
|
-
if (configUrl) {
|
|
886
|
-
var req = new XMLHttpRequest();
|
|
887
|
-
req.open('GET', configUrl, true);
|
|
888
|
-
req.setRequestHeader('Accept', 'application/json');
|
|
889
|
-
|
|
890
|
-
req.onreadystatechange = function () {
|
|
891
|
-
if (req.readyState == 4) {
|
|
892
|
-
if (req.status == 200 || fileLoaded(req)) {
|
|
893
|
-
var config = JSON.parse(req.responseText);
|
|
894
|
-
|
|
895
|
-
kc.authServerUrl = config['auth-server-url'];
|
|
896
|
-
kc.realm = config['realm'];
|
|
897
|
-
kc.clientId = config['resource'];
|
|
898
|
-
setupOidcEndoints(null);
|
|
899
|
-
promise.setSuccess();
|
|
900
|
-
} else {
|
|
901
|
-
promise.setError();
|
|
902
|
-
}
|
|
903
|
-
}
|
|
904
|
-
};
|
|
905
|
-
|
|
906
|
-
req.send();
|
|
907
|
-
} else {
|
|
908
|
-
kc.clientId = config.clientId;
|
|
909
|
-
|
|
910
|
-
var oidcProvider = config['oidcProvider'];
|
|
911
|
-
if (!oidcProvider) {
|
|
912
|
-
kc.authServerUrl = config.url;
|
|
913
|
-
kc.realm = config.realm;
|
|
914
|
-
setupOidcEndoints(null);
|
|
915
|
-
promise.setSuccess();
|
|
916
|
-
} else {
|
|
917
|
-
if (typeof oidcProvider === 'string') {
|
|
918
|
-
var oidcProviderConfigUrl;
|
|
919
|
-
if (oidcProvider.charAt(oidcProvider.length - 1) == '/') {
|
|
920
|
-
oidcProviderConfigUrl = oidcProvider + '.well-known/openid-configuration';
|
|
921
|
-
} else {
|
|
922
|
-
oidcProviderConfigUrl = oidcProvider + '/.well-known/openid-configuration';
|
|
923
|
-
}
|
|
924
|
-
var req = new XMLHttpRequest();
|
|
925
|
-
req.open('GET', oidcProviderConfigUrl, true);
|
|
926
|
-
req.setRequestHeader('Accept', 'application/json');
|
|
927
|
-
|
|
928
|
-
req.onreadystatechange = function () {
|
|
929
|
-
if (req.readyState == 4) {
|
|
930
|
-
if (req.status == 200 || fileLoaded(req)) {
|
|
931
|
-
var oidcProviderConfig = JSON.parse(req.responseText);
|
|
932
|
-
setupOidcEndoints(oidcProviderConfig);
|
|
933
|
-
promise.setSuccess();
|
|
934
|
-
} else {
|
|
935
|
-
promise.setError();
|
|
936
|
-
}
|
|
937
|
-
}
|
|
938
|
-
};
|
|
939
|
-
|
|
940
|
-
req.send();
|
|
941
|
-
} else {
|
|
942
|
-
setupOidcEndoints(oidcProvider);
|
|
943
|
-
promise.setSuccess();
|
|
944
|
-
}
|
|
945
|
-
}
|
|
946
|
-
}
|
|
947
|
-
|
|
948
|
-
return promise.promise;
|
|
949
|
-
}
|
|
950
|
-
|
|
951
|
-
function fileLoaded(xhr) {
|
|
952
|
-
return xhr.status == 0 && xhr.responseText && xhr.responseURL.startsWith('file:');
|
|
953
|
-
}
|
|
954
|
-
|
|
955
|
-
function setToken(token, refreshToken, idToken, timeLocal) {
|
|
956
|
-
if (kc.tokenTimeoutHandle) {
|
|
957
|
-
clearTimeout(kc.tokenTimeoutHandle);
|
|
958
|
-
kc.tokenTimeoutHandle = null;
|
|
959
|
-
}
|
|
960
|
-
|
|
961
|
-
if (refreshToken) {
|
|
962
|
-
kc.refreshToken = refreshToken;
|
|
963
|
-
kc.refreshTokenParsed = decodeToken(refreshToken);
|
|
964
|
-
} else {
|
|
965
|
-
delete kc.refreshToken;
|
|
966
|
-
delete kc.refreshTokenParsed;
|
|
967
|
-
}
|
|
968
|
-
|
|
969
|
-
if (idToken) {
|
|
970
|
-
kc.idToken = idToken;
|
|
971
|
-
kc.idTokenParsed = decodeToken(idToken);
|
|
972
|
-
} else {
|
|
973
|
-
delete kc.idToken;
|
|
974
|
-
delete kc.idTokenParsed;
|
|
975
|
-
}
|
|
976
|
-
|
|
977
|
-
if (token) {
|
|
978
|
-
kc.token = token;
|
|
979
|
-
kc.tokenParsed = decodeToken(token);
|
|
980
|
-
kc.sessionId = kc.tokenParsed.sid;
|
|
981
|
-
kc.authenticated = true;
|
|
982
|
-
kc.subject = kc.tokenParsed.sub;
|
|
983
|
-
kc.realmAccess = kc.tokenParsed.realm_access;
|
|
984
|
-
kc.resourceAccess = kc.tokenParsed.resource_access;
|
|
985
|
-
|
|
986
|
-
if (timeLocal) {
|
|
987
|
-
kc.timeSkew = Math.floor(timeLocal / 1000) - kc.tokenParsed.iat;
|
|
988
|
-
}
|
|
989
|
-
|
|
990
|
-
if (kc.timeSkew != null) {
|
|
991
|
-
logInfo('[KEYCLOAK] Estimated time difference between browser and server is ' + kc.timeSkew + ' seconds');
|
|
992
|
-
|
|
993
|
-
if (kc.onTokenExpired) {
|
|
994
|
-
var expiresIn = (kc.tokenParsed['exp'] - (new Date().getTime() / 1000) + kc.timeSkew) * 1000;
|
|
995
|
-
logInfo('[KEYCLOAK] Token expires in ' + Math.round(expiresIn / 1000) + ' s');
|
|
996
|
-
if (expiresIn <= 0) {
|
|
997
|
-
kc.onTokenExpired();
|
|
998
|
-
} else {
|
|
999
|
-
kc.tokenTimeoutHandle = setTimeout(kc.onTokenExpired, expiresIn);
|
|
1000
|
-
}
|
|
1001
|
-
}
|
|
1002
|
-
}
|
|
1003
|
-
} else {
|
|
1004
|
-
delete kc.token;
|
|
1005
|
-
delete kc.tokenParsed;
|
|
1006
|
-
delete kc.subject;
|
|
1007
|
-
delete kc.realmAccess;
|
|
1008
|
-
delete kc.resourceAccess;
|
|
1009
|
-
|
|
1010
|
-
kc.authenticated = false;
|
|
1011
|
-
}
|
|
1012
|
-
}
|
|
1013
|
-
|
|
1014
|
-
function createUUID() {
|
|
1015
|
-
if (typeof crypto === "undefined" || typeof crypto.randomUUID === "undefined") {
|
|
1016
|
-
throw new Error("Web Crypto API is not available.");
|
|
1017
|
-
}
|
|
1018
|
-
|
|
1019
|
-
return crypto.randomUUID();
|
|
1020
|
-
}
|
|
1021
|
-
|
|
1022
|
-
function parseCallback(url) {
|
|
1023
|
-
var oauth = parseCallbackUrl(url);
|
|
1024
|
-
if (!oauth) {
|
|
1025
|
-
return;
|
|
1026
|
-
}
|
|
1027
|
-
|
|
1028
|
-
var oauthState = callbackStorage.get(oauth.state);
|
|
1029
|
-
|
|
1030
|
-
if (oauthState) {
|
|
1031
|
-
oauth.valid = true;
|
|
1032
|
-
oauth.redirectUri = oauthState.redirectUri;
|
|
1033
|
-
oauth.storedNonce = oauthState.nonce;
|
|
1034
|
-
oauth.prompt = oauthState.prompt;
|
|
1035
|
-
oauth.pkceCodeVerifier = oauthState.pkceCodeVerifier;
|
|
1036
|
-
oauth.loginOptions = oauthState.loginOptions;
|
|
1037
|
-
}
|
|
1038
|
-
|
|
1039
|
-
return oauth;
|
|
1040
|
-
}
|
|
1041
|
-
|
|
1042
|
-
function parseCallbackUrl(url) {
|
|
1043
|
-
var supportedParams;
|
|
1044
|
-
switch (kc.flow) {
|
|
1045
|
-
case 'standard':
|
|
1046
|
-
supportedParams = ['code', 'state', 'session_state', 'kc_action_status', 'kc_action', 'iss'];
|
|
1047
|
-
break;
|
|
1048
|
-
case 'implicit':
|
|
1049
|
-
supportedParams = ['access_token', 'token_type', 'id_token', 'state', 'session_state', 'expires_in', 'kc_action_status', 'kc_action', 'iss'];
|
|
1050
|
-
break;
|
|
1051
|
-
case 'hybrid':
|
|
1052
|
-
supportedParams = ['access_token', 'token_type', 'id_token', 'code', 'state', 'session_state', 'expires_in', 'kc_action_status', 'kc_action', 'iss'];
|
|
1053
|
-
break;
|
|
1054
|
-
}
|
|
1055
|
-
|
|
1056
|
-
supportedParams.push('error');
|
|
1057
|
-
supportedParams.push('error_description');
|
|
1058
|
-
supportedParams.push('error_uri');
|
|
1059
|
-
|
|
1060
|
-
var queryIndex = url.indexOf('?');
|
|
1061
|
-
var fragmentIndex = url.indexOf('#');
|
|
1062
|
-
|
|
1063
|
-
var newUrl;
|
|
1064
|
-
var parsed;
|
|
1065
|
-
|
|
1066
|
-
if (kc.responseMode === 'query' && queryIndex !== -1) {
|
|
1067
|
-
newUrl = url.substring(0, queryIndex);
|
|
1068
|
-
parsed = parseCallbackParams(url.substring(queryIndex + 1, fragmentIndex !== -1 ? fragmentIndex : url.length), supportedParams);
|
|
1069
|
-
if (parsed.paramsString !== '') {
|
|
1070
|
-
newUrl += '?' + parsed.paramsString;
|
|
1071
|
-
}
|
|
1072
|
-
if (fragmentIndex !== -1) {
|
|
1073
|
-
newUrl += url.substring(fragmentIndex);
|
|
1074
|
-
}
|
|
1075
|
-
} else if (kc.responseMode === 'fragment' && fragmentIndex !== -1) {
|
|
1076
|
-
newUrl = url.substring(0, fragmentIndex);
|
|
1077
|
-
parsed = parseCallbackParams(url.substring(fragmentIndex + 1), supportedParams);
|
|
1078
|
-
if (parsed.paramsString !== '') {
|
|
1079
|
-
newUrl += '#' + parsed.paramsString;
|
|
1080
|
-
}
|
|
1081
|
-
}
|
|
1082
|
-
|
|
1083
|
-
if (parsed && parsed.oauthParams) {
|
|
1084
|
-
if (kc.flow === 'standard' || kc.flow === 'hybrid') {
|
|
1085
|
-
if ((parsed.oauthParams.code || parsed.oauthParams.error) && parsed.oauthParams.state) {
|
|
1086
|
-
parsed.oauthParams.newUrl = newUrl;
|
|
1087
|
-
return parsed.oauthParams;
|
|
1088
|
-
}
|
|
1089
|
-
} else if (kc.flow === 'implicit') {
|
|
1090
|
-
if ((parsed.oauthParams.access_token || parsed.oauthParams.error) && parsed.oauthParams.state) {
|
|
1091
|
-
parsed.oauthParams.newUrl = newUrl;
|
|
1092
|
-
return parsed.oauthParams;
|
|
1093
|
-
}
|
|
1094
|
-
}
|
|
1095
|
-
}
|
|
1096
|
-
}
|
|
1097
|
-
|
|
1098
|
-
function parseCallbackParams(paramsString, supportedParams) {
|
|
1099
|
-
var p = paramsString.split('&');
|
|
1100
|
-
var result = {
|
|
1101
|
-
paramsString: '',
|
|
1102
|
-
oauthParams: {}
|
|
1103
|
-
};
|
|
1104
|
-
for (var i = 0; i < p.length; i++) {
|
|
1105
|
-
var split = p[i].indexOf("=");
|
|
1106
|
-
var key = p[i].slice(0, split);
|
|
1107
|
-
if (supportedParams.indexOf(key) !== -1) {
|
|
1108
|
-
result.oauthParams[key] = p[i].slice(split + 1);
|
|
1109
|
-
} else {
|
|
1110
|
-
if (result.paramsString !== '') {
|
|
1111
|
-
result.paramsString += '&';
|
|
1112
|
-
}
|
|
1113
|
-
result.paramsString += p[i];
|
|
1114
|
-
}
|
|
1115
|
-
}
|
|
1116
|
-
return result;
|
|
1117
|
-
}
|
|
1118
|
-
|
|
1119
|
-
function createPromise() {
|
|
1120
|
-
// Need to create a native Promise which also preserves the
|
|
1121
|
-
// interface of the custom promise type previously used by the API
|
|
1122
|
-
var p = {
|
|
1123
|
-
setSuccess: function(result) {
|
|
1124
|
-
p.resolve(result);
|
|
1125
|
-
},
|
|
1126
|
-
|
|
1127
|
-
setError: function(result) {
|
|
1128
|
-
p.reject(result);
|
|
1129
|
-
}
|
|
1130
|
-
};
|
|
1131
|
-
p.promise = new Promise(function(resolve, reject) {
|
|
1132
|
-
p.resolve = resolve;
|
|
1133
|
-
p.reject = reject;
|
|
1134
|
-
});
|
|
1135
|
-
|
|
1136
|
-
return p;
|
|
1137
|
-
}
|
|
1138
|
-
|
|
1139
|
-
// Function to extend existing native Promise with timeout
|
|
1140
|
-
function applyTimeoutToPromise(promise, timeout, errorMessage) {
|
|
1141
|
-
var timeoutHandle = null;
|
|
1142
|
-
var timeoutPromise = new Promise(function (resolve, reject) {
|
|
1143
|
-
timeoutHandle = setTimeout(function () {
|
|
1144
|
-
reject({ "error": errorMessage || "Promise is not settled within timeout of " + timeout + "ms" });
|
|
1145
|
-
}, timeout);
|
|
1146
|
-
});
|
|
1147
|
-
|
|
1148
|
-
return Promise.race([promise, timeoutPromise]).finally(function () {
|
|
1149
|
-
clearTimeout(timeoutHandle);
|
|
1150
|
-
});
|
|
1151
|
-
}
|
|
1152
|
-
|
|
1153
|
-
function setupCheckLoginIframe() {
|
|
1154
|
-
var promise = createPromise();
|
|
1155
|
-
|
|
1156
|
-
if (!loginIframe.enable) {
|
|
1157
|
-
promise.setSuccess();
|
|
1158
|
-
return promise.promise;
|
|
1159
|
-
}
|
|
1160
|
-
|
|
1161
|
-
if (loginIframe.iframe) {
|
|
1162
|
-
promise.setSuccess();
|
|
1163
|
-
return promise.promise;
|
|
1164
|
-
}
|
|
1165
|
-
|
|
1166
|
-
var iframe = document.createElement('iframe');
|
|
1167
|
-
loginIframe.iframe = iframe;
|
|
1168
|
-
|
|
1169
|
-
iframe.onload = function() {
|
|
1170
|
-
var authUrl = kc.endpoints.authorize();
|
|
1171
|
-
if (authUrl.charAt(0) === '/') {
|
|
1172
|
-
loginIframe.iframeOrigin = getOrigin();
|
|
1173
|
-
} else {
|
|
1174
|
-
loginIframe.iframeOrigin = authUrl.substring(0, authUrl.indexOf('/', 8));
|
|
1175
|
-
}
|
|
1176
|
-
promise.setSuccess();
|
|
1177
|
-
};
|
|
1178
|
-
|
|
1179
|
-
var src = kc.endpoints.checkSessionIframe();
|
|
1180
|
-
iframe.setAttribute('src', src );
|
|
1181
|
-
iframe.setAttribute('sandbox', 'allow-storage-access-by-user-activation allow-scripts allow-same-origin');
|
|
1182
|
-
iframe.setAttribute('title', 'keycloak-session-iframe' );
|
|
1183
|
-
iframe.style.display = 'none';
|
|
1184
|
-
document.body.appendChild(iframe);
|
|
1185
|
-
|
|
1186
|
-
var messageCallback = function(event) {
|
|
1187
|
-
if ((event.origin !== loginIframe.iframeOrigin) || (loginIframe.iframe.contentWindow !== event.source)) {
|
|
1188
|
-
return;
|
|
1189
|
-
}
|
|
1190
|
-
|
|
1191
|
-
if (!(event.data == 'unchanged' || event.data == 'changed' || event.data == 'error')) {
|
|
1192
|
-
return;
|
|
1193
|
-
}
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
if (event.data != 'unchanged') {
|
|
1197
|
-
kc.clearToken();
|
|
1198
|
-
}
|
|
1199
|
-
|
|
1200
|
-
var callbacks = loginIframe.callbackList.splice(0, loginIframe.callbackList.length);
|
|
1201
|
-
|
|
1202
|
-
for (var i = callbacks.length - 1; i >= 0; --i) {
|
|
1203
|
-
var promise = callbacks[i];
|
|
1204
|
-
if (event.data == 'error') {
|
|
1205
|
-
promise.setError();
|
|
1206
|
-
} else {
|
|
1207
|
-
promise.setSuccess(event.data == 'unchanged');
|
|
1208
|
-
}
|
|
1209
|
-
}
|
|
1210
|
-
};
|
|
1211
|
-
|
|
1212
|
-
window.addEventListener('message', messageCallback, false);
|
|
1213
|
-
|
|
1214
|
-
return promise.promise;
|
|
1215
|
-
}
|
|
1216
|
-
|
|
1217
|
-
function scheduleCheckIframe() {
|
|
1218
|
-
if (loginIframe.enable) {
|
|
1219
|
-
if (kc.token) {
|
|
1220
|
-
setTimeout(function() {
|
|
1221
|
-
checkLoginIframe().then(function(unchanged) {
|
|
1222
|
-
if (unchanged) {
|
|
1223
|
-
scheduleCheckIframe();
|
|
1224
|
-
}
|
|
1225
|
-
});
|
|
1226
|
-
}, loginIframe.interval * 1000);
|
|
1227
|
-
}
|
|
1228
|
-
}
|
|
1229
|
-
}
|
|
1230
|
-
|
|
1231
|
-
function checkLoginIframe() {
|
|
1232
|
-
var promise = createPromise();
|
|
1233
|
-
|
|
1234
|
-
if (loginIframe.iframe && loginIframe.iframeOrigin ) {
|
|
1235
|
-
var msg = kc.clientId + ' ' + (kc.sessionId ? kc.sessionId : '');
|
|
1236
|
-
loginIframe.callbackList.push(promise);
|
|
1237
|
-
var origin = loginIframe.iframeOrigin;
|
|
1238
|
-
if (loginIframe.callbackList.length == 1) {
|
|
1239
|
-
loginIframe.iframe.contentWindow.postMessage(msg, origin);
|
|
1240
|
-
}
|
|
1241
|
-
} else {
|
|
1242
|
-
promise.setSuccess();
|
|
1243
|
-
}
|
|
1244
|
-
|
|
1245
|
-
return promise.promise;
|
|
1246
|
-
}
|
|
1247
|
-
|
|
1248
|
-
function check3pCookiesSupported() {
|
|
1249
|
-
var promise = createPromise();
|
|
1250
|
-
|
|
1251
|
-
if ((loginIframe.enable || kc.silentCheckSsoRedirectUri) && typeof kc.endpoints.thirdPartyCookiesIframe === 'function') {
|
|
1252
|
-
var iframe = document.createElement('iframe');
|
|
1253
|
-
iframe.setAttribute('src', kc.endpoints.thirdPartyCookiesIframe());
|
|
1254
|
-
iframe.setAttribute('sandbox', 'allow-storage-access-by-user-activation allow-scripts allow-same-origin');
|
|
1255
|
-
iframe.setAttribute('title', 'keycloak-3p-check-iframe' );
|
|
1256
|
-
iframe.style.display = 'none';
|
|
1257
|
-
document.body.appendChild(iframe);
|
|
1258
|
-
|
|
1259
|
-
var messageCallback = function(event) {
|
|
1260
|
-
if (iframe.contentWindow !== event.source) {
|
|
1261
|
-
return;
|
|
1262
|
-
}
|
|
1263
|
-
|
|
1264
|
-
if (event.data !== "supported" && event.data !== "unsupported") {
|
|
1265
|
-
return;
|
|
1266
|
-
} else if (event.data === "unsupported") {
|
|
1267
|
-
logWarn(
|
|
1268
|
-
"[KEYCLOAK] Your browser is blocking access to 3rd-party cookies, this means:\n\n" +
|
|
1269
|
-
" - It is not possible to retrieve tokens without redirecting to the Keycloak server (a.k.a. no support for silent authentication).\n" +
|
|
1270
|
-
" - It is not possible to automatically detect changes to the session status (such as the user logging out in another tab).\n\n" +
|
|
1271
|
-
"For more information see: https://www.keycloak.org/securing-apps/javascript-adapter#_modern_browsers"
|
|
1272
|
-
);
|
|
1273
|
-
|
|
1274
|
-
loginIframe.enable = false;
|
|
1275
|
-
if (kc.silentCheckSsoFallback) {
|
|
1276
|
-
kc.silentCheckSsoRedirectUri = false;
|
|
1277
|
-
}
|
|
1278
|
-
}
|
|
1279
|
-
|
|
1280
|
-
document.body.removeChild(iframe);
|
|
1281
|
-
window.removeEventListener("message", messageCallback);
|
|
1282
|
-
promise.setSuccess();
|
|
1283
|
-
};
|
|
1284
|
-
|
|
1285
|
-
window.addEventListener('message', messageCallback, false);
|
|
1286
|
-
} else {
|
|
1287
|
-
promise.setSuccess();
|
|
1288
|
-
}
|
|
1289
|
-
|
|
1290
|
-
return applyTimeoutToPromise(promise.promise, kc.messageReceiveTimeout, "Timeout when waiting for 3rd party check iframe message.");
|
|
1291
|
-
}
|
|
1292
|
-
|
|
1293
|
-
function loadAdapter(type) {
|
|
1294
|
-
if (!type || type == 'default') {
|
|
1295
|
-
return {
|
|
1296
|
-
login: async function(options) {
|
|
1297
|
-
window.location.assign(await kc.createLoginUrl(options));
|
|
1298
|
-
return createPromise().promise;
|
|
1299
|
-
},
|
|
1300
|
-
|
|
1301
|
-
logout: async function(options) {
|
|
1302
|
-
|
|
1303
|
-
const logoutMethod = options?.logoutMethod ?? kc.logoutMethod;
|
|
1304
|
-
if (logoutMethod === "GET") {
|
|
1305
|
-
window.location.replace(kc.createLogoutUrl(options));
|
|
1306
|
-
return;
|
|
1307
|
-
}
|
|
1308
|
-
|
|
1309
|
-
// Create form to send POST request.
|
|
1310
|
-
const form = document.createElement("form");
|
|
1311
|
-
|
|
1312
|
-
form.setAttribute("method", "POST");
|
|
1313
|
-
form.setAttribute("action", kc.createLogoutUrl(options));
|
|
1314
|
-
form.style.display = "none";
|
|
1315
|
-
|
|
1316
|
-
// Add data to form as hidden input fields.
|
|
1317
|
-
const data = {
|
|
1318
|
-
id_token_hint: kc.idToken,
|
|
1319
|
-
client_id: kc.clientId,
|
|
1320
|
-
post_logout_redirect_uri: adapter.redirectUri(options, false)
|
|
1321
|
-
};
|
|
1322
|
-
|
|
1323
|
-
for (const [name, value] of Object.entries(data)) {
|
|
1324
|
-
const input = document.createElement("input");
|
|
1325
|
-
|
|
1326
|
-
input.setAttribute("type", "hidden");
|
|
1327
|
-
input.setAttribute("name", name);
|
|
1328
|
-
input.setAttribute("value", value);
|
|
1329
|
-
|
|
1330
|
-
form.appendChild(input);
|
|
1331
|
-
}
|
|
1332
|
-
|
|
1333
|
-
// Append form to page and submit it to perform logout and redirect.
|
|
1334
|
-
document.body.appendChild(form);
|
|
1335
|
-
form.submit();
|
|
1336
|
-
},
|
|
1337
|
-
|
|
1338
|
-
register: async function(options) {
|
|
1339
|
-
window.location.assign(await kc.createRegisterUrl(options));
|
|
1340
|
-
return createPromise().promise;
|
|
1341
|
-
},
|
|
1342
|
-
|
|
1343
|
-
accountManagement : function() {
|
|
1344
|
-
var accountUrl = kc.createAccountUrl();
|
|
1345
|
-
if (typeof accountUrl !== 'undefined') {
|
|
1346
|
-
window.location.href = accountUrl;
|
|
1347
|
-
} else {
|
|
1348
|
-
throw "Not supported by the OIDC server";
|
|
1349
|
-
}
|
|
1350
|
-
return createPromise().promise;
|
|
1351
|
-
},
|
|
1352
|
-
|
|
1353
|
-
redirectUri: function(options, encodeHash) {
|
|
1354
|
-
|
|
1355
|
-
if (options && options.redirectUri) {
|
|
1356
|
-
return options.redirectUri;
|
|
1357
|
-
} else if (kc.redirectUri) {
|
|
1358
|
-
return kc.redirectUri;
|
|
1359
|
-
} else {
|
|
1360
|
-
return location.href;
|
|
1361
|
-
}
|
|
1362
|
-
}
|
|
1363
|
-
};
|
|
1364
|
-
}
|
|
1365
|
-
|
|
1366
|
-
if (type == 'cordova') {
|
|
1367
|
-
loginIframe.enable = false;
|
|
1368
|
-
var cordovaOpenWindowWrapper = function(loginUrl, target, options) {
|
|
1369
|
-
if (window.cordova && window.cordova.InAppBrowser) {
|
|
1370
|
-
// Use inappbrowser for IOS and Android if available
|
|
1371
|
-
return window.cordova.InAppBrowser.open(loginUrl, target, options);
|
|
1372
|
-
} else {
|
|
1373
|
-
return window.open(loginUrl, target, options);
|
|
1374
|
-
}
|
|
1375
|
-
};
|
|
1376
|
-
|
|
1377
|
-
var shallowCloneCordovaOptions = function (userOptions) {
|
|
1378
|
-
if (userOptions && userOptions.cordovaOptions) {
|
|
1379
|
-
return Object.keys(userOptions.cordovaOptions).reduce(function (options, optionName) {
|
|
1380
|
-
options[optionName] = userOptions.cordovaOptions[optionName];
|
|
1381
|
-
return options;
|
|
1382
|
-
}, {});
|
|
1383
|
-
} else {
|
|
1384
|
-
return {};
|
|
1385
|
-
}
|
|
1386
|
-
};
|
|
1387
|
-
|
|
1388
|
-
var formatCordovaOptions = function (cordovaOptions) {
|
|
1389
|
-
return Object.keys(cordovaOptions).reduce(function (options, optionName) {
|
|
1390
|
-
options.push(optionName+"="+cordovaOptions[optionName]);
|
|
1391
|
-
return options;
|
|
1392
|
-
}, []).join(",");
|
|
1393
|
-
};
|
|
1394
|
-
|
|
1395
|
-
var createCordovaOptions = function (userOptions) {
|
|
1396
|
-
var cordovaOptions = shallowCloneCordovaOptions(userOptions);
|
|
1397
|
-
cordovaOptions.location = 'no';
|
|
1398
|
-
if (userOptions && userOptions.prompt == 'none') {
|
|
1399
|
-
cordovaOptions.hidden = 'yes';
|
|
1400
|
-
}
|
|
1401
|
-
return formatCordovaOptions(cordovaOptions);
|
|
1402
|
-
};
|
|
1403
|
-
|
|
1404
|
-
var getCordovaRedirectUri = function() {
|
|
1405
|
-
return kc.redirectUri || 'http://localhost';
|
|
1406
|
-
};
|
|
1407
|
-
|
|
1408
|
-
return {
|
|
1409
|
-
login: async function(options) {
|
|
1410
|
-
var promise = createPromise();
|
|
1411
|
-
|
|
1412
|
-
var cordovaOptions = createCordovaOptions(options);
|
|
1413
|
-
var loginUrl = await kc.createLoginUrl(options);
|
|
1414
|
-
var ref = cordovaOpenWindowWrapper(loginUrl, '_blank', cordovaOptions);
|
|
1415
|
-
var completed = false;
|
|
1416
|
-
|
|
1417
|
-
var closed = false;
|
|
1418
|
-
var closeBrowser = function() {
|
|
1419
|
-
closed = true;
|
|
1420
|
-
ref.close();
|
|
1421
|
-
};
|
|
1422
|
-
|
|
1423
|
-
ref.addEventListener('loadstart', function(event) {
|
|
1424
|
-
if (event.url.indexOf(getCordovaRedirectUri()) == 0) {
|
|
1425
|
-
var callback = parseCallback(event.url);
|
|
1426
|
-
processCallback(callback, promise);
|
|
1427
|
-
closeBrowser();
|
|
1428
|
-
completed = true;
|
|
1429
|
-
}
|
|
1430
|
-
});
|
|
1431
|
-
|
|
1432
|
-
ref.addEventListener('loaderror', function(event) {
|
|
1433
|
-
if (!completed) {
|
|
1434
|
-
if (event.url.indexOf(getCordovaRedirectUri()) == 0) {
|
|
1435
|
-
var callback = parseCallback(event.url);
|
|
1436
|
-
processCallback(callback, promise);
|
|
1437
|
-
closeBrowser();
|
|
1438
|
-
completed = true;
|
|
1439
|
-
} else {
|
|
1440
|
-
promise.setError();
|
|
1441
|
-
closeBrowser();
|
|
1442
|
-
}
|
|
1443
|
-
}
|
|
1444
|
-
});
|
|
1445
|
-
|
|
1446
|
-
ref.addEventListener('exit', function(event) {
|
|
1447
|
-
if (!closed) {
|
|
1448
|
-
promise.setError({
|
|
1449
|
-
reason: "closed_by_user"
|
|
1450
|
-
});
|
|
1451
|
-
}
|
|
1452
|
-
});
|
|
1453
|
-
|
|
1454
|
-
return promise.promise;
|
|
1455
|
-
},
|
|
1456
|
-
|
|
1457
|
-
logout: function(options) {
|
|
1458
|
-
var promise = createPromise();
|
|
1459
|
-
|
|
1460
|
-
var logoutUrl = kc.createLogoutUrl(options);
|
|
1461
|
-
var ref = cordovaOpenWindowWrapper(logoutUrl, '_blank', 'location=no,hidden=yes,clearcache=yes');
|
|
1462
|
-
|
|
1463
|
-
var error;
|
|
1464
|
-
|
|
1465
|
-
ref.addEventListener('loadstart', function(event) {
|
|
1466
|
-
if (event.url.indexOf(getCordovaRedirectUri()) == 0) {
|
|
1467
|
-
ref.close();
|
|
1468
|
-
}
|
|
1469
|
-
});
|
|
1470
|
-
|
|
1471
|
-
ref.addEventListener('loaderror', function(event) {
|
|
1472
|
-
if (event.url.indexOf(getCordovaRedirectUri()) == 0) {
|
|
1473
|
-
ref.close();
|
|
1474
|
-
} else {
|
|
1475
|
-
error = true;
|
|
1476
|
-
ref.close();
|
|
1477
|
-
}
|
|
1478
|
-
});
|
|
1479
|
-
|
|
1480
|
-
ref.addEventListener('exit', function(event) {
|
|
1481
|
-
if (error) {
|
|
1482
|
-
promise.setError();
|
|
1483
|
-
} else {
|
|
1484
|
-
kc.clearToken();
|
|
1485
|
-
promise.setSuccess();
|
|
1486
|
-
}
|
|
1487
|
-
});
|
|
1488
|
-
|
|
1489
|
-
return promise.promise;
|
|
1490
|
-
},
|
|
1491
|
-
|
|
1492
|
-
register : async function(options) {
|
|
1493
|
-
var promise = createPromise();
|
|
1494
|
-
var registerUrl = await kc.createRegisterUrl();
|
|
1495
|
-
var cordovaOptions = createCordovaOptions(options);
|
|
1496
|
-
var ref = cordovaOpenWindowWrapper(registerUrl, '_blank', cordovaOptions);
|
|
1497
|
-
ref.addEventListener('loadstart', function(event) {
|
|
1498
|
-
if (event.url.indexOf(getCordovaRedirectUri()) == 0) {
|
|
1499
|
-
ref.close();
|
|
1500
|
-
var oauth = parseCallback(event.url);
|
|
1501
|
-
processCallback(oauth, promise);
|
|
1502
|
-
}
|
|
1503
|
-
});
|
|
1504
|
-
return promise.promise;
|
|
1505
|
-
},
|
|
1506
|
-
|
|
1507
|
-
accountManagement : function() {
|
|
1508
|
-
var accountUrl = kc.createAccountUrl();
|
|
1509
|
-
if (typeof accountUrl !== 'undefined') {
|
|
1510
|
-
var ref = cordovaOpenWindowWrapper(accountUrl, '_blank', 'location=no');
|
|
1511
|
-
ref.addEventListener('loadstart', function(event) {
|
|
1512
|
-
if (event.url.indexOf(getCordovaRedirectUri()) == 0) {
|
|
1513
|
-
ref.close();
|
|
1514
|
-
}
|
|
1515
|
-
});
|
|
1516
|
-
} else {
|
|
1517
|
-
throw "Not supported by the OIDC server";
|
|
1518
|
-
}
|
|
1519
|
-
},
|
|
1520
|
-
|
|
1521
|
-
redirectUri: function(options) {
|
|
1522
|
-
return getCordovaRedirectUri();
|
|
1523
|
-
}
|
|
1524
|
-
}
|
|
1525
|
-
}
|
|
1526
|
-
|
|
1527
|
-
if (type == 'cordova-native') {
|
|
1528
|
-
loginIframe.enable = false;
|
|
1529
|
-
|
|
1530
|
-
return {
|
|
1531
|
-
login: async function(options) {
|
|
1532
|
-
var promise = createPromise();
|
|
1533
|
-
var loginUrl = await kc.createLoginUrl(options);
|
|
1534
|
-
|
|
1535
|
-
universalLinks.subscribe('keycloak', function(event) {
|
|
1536
|
-
universalLinks.unsubscribe('keycloak');
|
|
1537
|
-
window.cordova.plugins.browsertab.close();
|
|
1538
|
-
var oauth = parseCallback(event.url);
|
|
1539
|
-
processCallback(oauth, promise);
|
|
1540
|
-
});
|
|
1541
|
-
|
|
1542
|
-
window.cordova.plugins.browsertab.openUrl(loginUrl);
|
|
1543
|
-
return promise.promise;
|
|
1544
|
-
},
|
|
1545
|
-
|
|
1546
|
-
logout: function(options) {
|
|
1547
|
-
var promise = createPromise();
|
|
1548
|
-
var logoutUrl = kc.createLogoutUrl(options);
|
|
1549
|
-
|
|
1550
|
-
universalLinks.subscribe('keycloak', function(event) {
|
|
1551
|
-
universalLinks.unsubscribe('keycloak');
|
|
1552
|
-
window.cordova.plugins.browsertab.close();
|
|
1553
|
-
kc.clearToken();
|
|
1554
|
-
promise.setSuccess();
|
|
1555
|
-
});
|
|
1556
|
-
|
|
1557
|
-
window.cordova.plugins.browsertab.openUrl(logoutUrl);
|
|
1558
|
-
return promise.promise;
|
|
1559
|
-
},
|
|
1560
|
-
|
|
1561
|
-
register : async function(options) {
|
|
1562
|
-
var promise = createPromise();
|
|
1563
|
-
var registerUrl = await kc.createRegisterUrl(options);
|
|
1564
|
-
universalLinks.subscribe('keycloak' , function(event) {
|
|
1565
|
-
universalLinks.unsubscribe('keycloak');
|
|
1566
|
-
window.cordova.plugins.browsertab.close();
|
|
1567
|
-
var oauth = parseCallback(event.url);
|
|
1568
|
-
processCallback(oauth, promise);
|
|
1569
|
-
});
|
|
1570
|
-
window.cordova.plugins.browsertab.openUrl(registerUrl);
|
|
1571
|
-
return promise.promise;
|
|
1572
|
-
|
|
1573
|
-
},
|
|
1574
|
-
|
|
1575
|
-
accountManagement : function() {
|
|
1576
|
-
var accountUrl = kc.createAccountUrl();
|
|
1577
|
-
if (typeof accountUrl !== 'undefined') {
|
|
1578
|
-
window.cordova.plugins.browsertab.openUrl(accountUrl);
|
|
1579
|
-
} else {
|
|
1580
|
-
throw "Not supported by the OIDC server";
|
|
1581
|
-
}
|
|
1582
|
-
},
|
|
1583
|
-
|
|
1584
|
-
redirectUri: function(options) {
|
|
1585
|
-
if (options && options.redirectUri) {
|
|
1586
|
-
return options.redirectUri;
|
|
1587
|
-
} else if (kc.redirectUri) {
|
|
1588
|
-
return kc.redirectUri;
|
|
1589
|
-
} else {
|
|
1590
|
-
return "http://localhost";
|
|
1591
|
-
}
|
|
1592
|
-
}
|
|
1593
|
-
}
|
|
1594
|
-
}
|
|
1595
|
-
|
|
1596
|
-
throw 'invalid adapter type: ' + type;
|
|
1597
|
-
}
|
|
1598
|
-
|
|
1599
|
-
const STORAGE_KEY_PREFIX = 'kc-callback-';
|
|
1600
|
-
|
|
1601
|
-
var LocalStorage = function() {
|
|
1602
|
-
if (!(this instanceof LocalStorage)) {
|
|
1603
|
-
return new LocalStorage();
|
|
1604
|
-
}
|
|
1605
|
-
|
|
1606
|
-
localStorage.setItem('kc-test', 'test');
|
|
1607
|
-
localStorage.removeItem('kc-test');
|
|
1608
|
-
|
|
1609
|
-
var cs = this;
|
|
1610
|
-
|
|
1611
|
-
/**
|
|
1612
|
-
* Clears all values from local storage that are no longer valid.
|
|
1613
|
-
*/
|
|
1614
|
-
function clearInvalidValues() {
|
|
1615
|
-
const currentTime = Date.now();
|
|
1616
|
-
|
|
1617
|
-
for (const [key, value] of getStoredEntries()) {
|
|
1618
|
-
// Attempt to parse the expiry time from the value.
|
|
1619
|
-
const expiry = parseExpiry(value);
|
|
1620
|
-
|
|
1621
|
-
// Discard the value if it is malformed or expired.
|
|
1622
|
-
if (expiry === null || expiry < currentTime) {
|
|
1623
|
-
localStorage.removeItem(key);
|
|
1624
|
-
}
|
|
1625
|
-
}
|
|
1626
|
-
}
|
|
1627
|
-
|
|
1628
|
-
/**
|
|
1629
|
-
* Clears all known values from local storage.
|
|
1630
|
-
*/
|
|
1631
|
-
function clearAllValues() {
|
|
1632
|
-
for (const [key] of getStoredEntries()) {
|
|
1633
|
-
localStorage.removeItem(key);
|
|
1634
|
-
}
|
|
1635
|
-
}
|
|
1636
|
-
|
|
1637
|
-
/**
|
|
1638
|
-
* Gets all entries stored in local storage that are known to be managed by this class.
|
|
1639
|
-
* @returns {Array<[string, unknown]>} An array of key-value pairs.
|
|
1640
|
-
*/
|
|
1641
|
-
function getStoredEntries() {
|
|
1642
|
-
return Object.entries(localStorage).filter(([key]) => key.startsWith(STORAGE_KEY_PREFIX));
|
|
1643
|
-
}
|
|
1644
|
-
|
|
1645
|
-
/**
|
|
1646
|
-
* Parses the expiry time from a value stored in local storage.
|
|
1647
|
-
* @param {unknown} value
|
|
1648
|
-
* @returns {number | null} The expiry time in milliseconds, or `null` if the value is malformed.
|
|
1649
|
-
*/
|
|
1650
|
-
function parseExpiry(value) {
|
|
1651
|
-
let parsedValue;
|
|
1652
|
-
|
|
1653
|
-
// Attempt to parse the value as JSON.
|
|
1654
|
-
try {
|
|
1655
|
-
parsedValue = JSON.parse(value);
|
|
1656
|
-
} catch (error) {
|
|
1657
|
-
return null;
|
|
1658
|
-
}
|
|
1659
|
-
|
|
1660
|
-
// Attempt to extract the 'expires' property.
|
|
1661
|
-
if (isObject(parsedValue) && 'expires' in parsedValue && typeof parsedValue.expires === 'number') {
|
|
1662
|
-
return parsedValue.expires;
|
|
1663
|
-
}
|
|
1664
|
-
|
|
1665
|
-
return null;
|
|
1666
|
-
}
|
|
1667
|
-
|
|
1668
|
-
cs.get = function(state) {
|
|
1669
|
-
if (!state) {
|
|
1670
|
-
return;
|
|
1671
|
-
}
|
|
1672
|
-
|
|
1673
|
-
var key = STORAGE_KEY_PREFIX + state;
|
|
1674
|
-
var value = localStorage.getItem(key);
|
|
1675
|
-
if (value) {
|
|
1676
|
-
localStorage.removeItem(key);
|
|
1677
|
-
value = JSON.parse(value);
|
|
1678
|
-
}
|
|
1679
|
-
|
|
1680
|
-
clearInvalidValues();
|
|
1681
|
-
return value;
|
|
1682
|
-
};
|
|
1683
|
-
|
|
1684
|
-
cs.add = function(state) {
|
|
1685
|
-
clearInvalidValues();
|
|
1686
|
-
|
|
1687
|
-
const key = STORAGE_KEY_PREFIX + state.state;
|
|
1688
|
-
const value = JSON.stringify({
|
|
1689
|
-
...state,
|
|
1690
|
-
// Set the expiry time to 1 hour from now.
|
|
1691
|
-
expires: Date.now() + (60 * 60 * 1000)
|
|
1692
|
-
});
|
|
1693
|
-
|
|
1694
|
-
try {
|
|
1695
|
-
localStorage.setItem(key, value);
|
|
1696
|
-
} catch (error) {
|
|
1697
|
-
// If the storage is full, clear all known values and try again.
|
|
1698
|
-
clearAllValues();
|
|
1699
|
-
localStorage.setItem(key, value);
|
|
1700
|
-
}
|
|
1701
|
-
};
|
|
1702
|
-
};
|
|
1703
|
-
|
|
1704
|
-
var CookieStorage = function() {
|
|
1705
|
-
if (!(this instanceof CookieStorage)) {
|
|
1706
|
-
return new CookieStorage();
|
|
1707
|
-
}
|
|
1708
|
-
|
|
1709
|
-
var cs = this;
|
|
1710
|
-
|
|
1711
|
-
cs.get = function(state) {
|
|
1712
|
-
if (!state) {
|
|
1713
|
-
return;
|
|
1714
|
-
}
|
|
1715
|
-
|
|
1716
|
-
var value = getCookie(STORAGE_KEY_PREFIX + state);
|
|
1717
|
-
setCookie(STORAGE_KEY_PREFIX + state, '', cookieExpiration(-100));
|
|
1718
|
-
if (value) {
|
|
1719
|
-
return JSON.parse(value);
|
|
1720
|
-
}
|
|
1721
|
-
};
|
|
1722
|
-
|
|
1723
|
-
cs.add = function(state) {
|
|
1724
|
-
setCookie(STORAGE_KEY_PREFIX + state.state, JSON.stringify(state), cookieExpiration(60));
|
|
1725
|
-
};
|
|
1726
|
-
|
|
1727
|
-
cs.removeItem = function(key) {
|
|
1728
|
-
setCookie(key, '', cookieExpiration(-100));
|
|
1729
|
-
};
|
|
1730
|
-
|
|
1731
|
-
var cookieExpiration = function (minutes) {
|
|
1732
|
-
var exp = new Date();
|
|
1733
|
-
exp.setTime(exp.getTime() + (minutes*60*1000));
|
|
1734
|
-
return exp;
|
|
1735
|
-
};
|
|
1736
|
-
|
|
1737
|
-
var getCookie = function (key) {
|
|
1738
|
-
var name = key + '=';
|
|
1739
|
-
var ca = document.cookie.split(';');
|
|
1740
|
-
for (var i = 0; i < ca.length; i++) {
|
|
1741
|
-
var c = ca[i];
|
|
1742
|
-
while (c.charAt(0) == ' ') {
|
|
1743
|
-
c = c.substring(1);
|
|
1744
|
-
}
|
|
1745
|
-
if (c.indexOf(name) == 0) {
|
|
1746
|
-
return c.substring(name.length, c.length);
|
|
1747
|
-
}
|
|
1748
|
-
}
|
|
1749
|
-
return '';
|
|
1750
|
-
};
|
|
1751
|
-
|
|
1752
|
-
var setCookie = function (key, value, expirationDate) {
|
|
1753
|
-
var cookie = key + '=' + value + '; '
|
|
1754
|
-
+ 'expires=' + expirationDate.toUTCString() + '; ';
|
|
1755
|
-
document.cookie = cookie;
|
|
1756
|
-
};
|
|
1757
|
-
};
|
|
1758
|
-
|
|
1759
|
-
function createCallbackStorage() {
|
|
1760
|
-
try {
|
|
1761
|
-
return new LocalStorage();
|
|
1762
|
-
} catch (err) {
|
|
1763
|
-
}
|
|
1764
|
-
|
|
1765
|
-
return new CookieStorage();
|
|
1766
|
-
}
|
|
1767
|
-
|
|
1768
|
-
function createLogger(fn) {
|
|
1769
|
-
return function() {
|
|
1770
|
-
if (kc.enableLogging) {
|
|
1771
|
-
fn.apply(console, Array.prototype.slice.call(arguments));
|
|
1772
|
-
}
|
|
1773
|
-
};
|
|
1774
|
-
}
|
|
1775
|
-
}
|
|
1776
|
-
|
|
1777
|
-
/**
|
|
1778
|
-
* @param {ArrayBuffer} bytes
|
|
1779
|
-
* @see https://developer.mozilla.org/en-US/docs/Glossary/Base64#the_unicode_problem
|
|
1780
|
-
*/
|
|
1781
|
-
function bytesToBase64(bytes) {
|
|
1782
|
-
const binString = String.fromCodePoint(...bytes);
|
|
1783
|
-
return btoa(binString);
|
|
1784
|
-
}
|
|
1785
|
-
|
|
1786
|
-
/**
|
|
1787
|
-
* @param {string} message
|
|
1788
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/digest#basic_example
|
|
1789
|
-
*/
|
|
1790
|
-
async function sha256Digest(message) {
|
|
1791
|
-
const encoder = new TextEncoder();
|
|
1792
|
-
const data = encoder.encode(message);
|
|
1793
|
-
|
|
1794
|
-
if (typeof crypto === "undefined" || typeof crypto.subtle === "undefined") {
|
|
1795
|
-
throw new Error("Web Crypto API is not available.");
|
|
1796
|
-
}
|
|
1797
|
-
|
|
1798
|
-
return await crypto.subtle.digest("SHA-256", data);
|
|
1799
|
-
}
|
|
1800
|
-
|
|
1801
|
-
/**
|
|
1802
|
-
* @param {string} token
|
|
1803
|
-
*/
|
|
1804
|
-
function decodeToken(token) {
|
|
1805
|
-
const [header, payload] = token.split(".");
|
|
1806
|
-
|
|
1807
|
-
if (typeof payload !== "string") {
|
|
1808
|
-
throw new Error("Unable to decode token, payload not found.");
|
|
1809
|
-
}
|
|
1810
|
-
|
|
1811
|
-
let decoded;
|
|
1812
|
-
|
|
1813
|
-
try {
|
|
1814
|
-
decoded = base64UrlDecode(payload);
|
|
1815
|
-
} catch (error) {
|
|
1816
|
-
throw new Error("Unable to decode token, payload is not a valid Base64URL value.", { cause: error });
|
|
1817
|
-
}
|
|
1818
|
-
|
|
1819
|
-
try {
|
|
1820
|
-
return JSON.parse(decoded);
|
|
1821
|
-
} catch (error) {
|
|
1822
|
-
throw new Error("Unable to decode token, payload is not a valid JSON value.", { cause: error });
|
|
1823
|
-
}
|
|
1824
|
-
}
|
|
1825
|
-
|
|
1826
|
-
/**
|
|
1827
|
-
* @param {string} input
|
|
1828
|
-
*/
|
|
1829
|
-
function base64UrlDecode(input) {
|
|
1830
|
-
let output = input
|
|
1831
|
-
.replaceAll("-", "+")
|
|
1832
|
-
.replaceAll("_", "/");
|
|
1833
|
-
|
|
1834
|
-
switch (output.length % 4) {
|
|
1835
|
-
case 0:
|
|
1836
|
-
break;
|
|
1837
|
-
case 2:
|
|
1838
|
-
output += "==";
|
|
1839
|
-
break;
|
|
1840
|
-
case 3:
|
|
1841
|
-
output += "=";
|
|
1842
|
-
break;
|
|
1843
|
-
default:
|
|
1844
|
-
throw new Error("Input is not of the correct length.");
|
|
1845
|
-
}
|
|
1846
|
-
|
|
1847
|
-
try {
|
|
1848
|
-
return b64DecodeUnicode(output);
|
|
1849
|
-
} catch (error) {
|
|
1850
|
-
return atob(output);
|
|
1851
|
-
}
|
|
1852
|
-
}
|
|
1853
|
-
|
|
1854
|
-
/**
|
|
1855
|
-
* @param {string} input
|
|
1856
|
-
*/
|
|
1857
|
-
function b64DecodeUnicode(input) {
|
|
1858
|
-
return decodeURIComponent(atob(input).replace(/(.)/g, (m, p) => {
|
|
1859
|
-
let code = p.charCodeAt(0).toString(16).toUpperCase();
|
|
1860
|
-
|
|
1861
|
-
if (code.length < 2) {
|
|
1862
|
-
code = "0" + code;
|
|
1863
|
-
}
|
|
1864
|
-
|
|
1865
|
-
return "%" + code;
|
|
1866
|
-
}));
|
|
1867
|
-
}
|
|
1868
|
-
|
|
1869
|
-
/**
|
|
1870
|
-
* Check if the input is an object that can be operated on.
|
|
1871
|
-
* @param {unknown} input
|
|
1872
|
-
*/
|
|
1873
|
-
function isObject(input) {
|
|
1874
|
-
return typeof input === 'object' && input !== null;
|
|
1875
|
-
}
|
|
1876
|
-
|
|
1877
|
-
let keycloak = null;
|
|
1878
|
-
let keycloakInitPromise = null;
|
|
1879
|
-
// Initialize Keycloak with an optional silent check
|
|
1880
|
-
function initKeycloak(config, silentCheck = true) {
|
|
1881
|
-
// If already initializing or initialized, return the cached promise
|
|
1882
|
-
if (keycloakInitPromise) {
|
|
1883
|
-
// eslint-disable-next-line
|
|
1884
|
-
console.log('Keycloak already initialized, returning from cache');
|
|
1885
|
-
return keycloakInitPromise;
|
|
1886
|
-
}
|
|
1887
|
-
if (!keycloak) {
|
|
1888
|
-
keycloak = new Keycloak({
|
|
1889
|
-
url: config.url,
|
|
1890
|
-
realm: config.realm,
|
|
1891
|
-
clientId: config.clientId
|
|
1892
|
-
});
|
|
1893
|
-
}
|
|
1894
|
-
keycloakInitPromise = keycloak
|
|
1895
|
-
.init({
|
|
1896
|
-
onLoad: silentCheck ? 'check-sso' : 'login-required',
|
|
1897
|
-
checkLoginIframe: false
|
|
1898
|
-
//silentCheckSsoRedirectUri: `${window.location.origin}/silent-check-sso.html`, // Ensure this file is set up
|
|
1899
|
-
})
|
|
1900
|
-
.then((authenticated) => authenticated)
|
|
1901
|
-
.catch((error) => {
|
|
1902
|
-
// eslint-disable-next-line
|
|
1903
|
-
console.error('Failed to initialize Keycloak:', error);
|
|
1904
|
-
return false;
|
|
1905
|
-
});
|
|
1906
|
-
return keycloakInitPromise;
|
|
1907
|
-
}
|
|
1908
|
-
function getUser() {
|
|
1909
|
-
if ((keycloak === null || keycloak === void 0 ? void 0 : keycloak.authenticated) && (keycloak === null || keycloak === void 0 ? void 0 : keycloak.idTokenParsed)) {
|
|
1910
|
-
return {
|
|
1911
|
-
fullname: keycloak.idTokenParsed.name,
|
|
1912
|
-
email: keycloak.idTokenParsed.email,
|
|
1913
|
-
lastname: keycloak.idTokenParsed.family_name,
|
|
1914
|
-
firstname: keycloak.idTokenParsed.given_name,
|
|
1915
|
-
username: keycloak.idTokenParsed.preferred_username,
|
|
1916
|
-
background: 'grey', // Optional custom value
|
|
1917
|
-
token: keycloak.token,
|
|
1918
|
-
sub: keycloak.idTokenParsed.sub
|
|
1919
|
-
};
|
|
1920
|
-
}
|
|
1921
|
-
return {};
|
|
1922
|
-
}
|
|
1923
|
-
// Log in the user
|
|
1924
|
-
function login() {
|
|
1925
|
-
if (keycloak) {
|
|
1926
|
-
keycloak.login();
|
|
1927
|
-
}
|
|
1928
|
-
else {
|
|
1929
|
-
throw new Error('Keycloak is not initialized.');
|
|
1930
|
-
}
|
|
1931
|
-
}
|
|
1932
|
-
// Log out the user
|
|
1933
|
-
function logout() {
|
|
1934
|
-
if (keycloak) {
|
|
1935
|
-
keycloak.logout();
|
|
1936
|
-
}
|
|
1937
|
-
else {
|
|
1938
|
-
throw new Error('Keycloak is not initialized.');
|
|
1939
|
-
}
|
|
1940
|
-
}
|
|
1941
|
-
// Check if the user is authenticated
|
|
1942
|
-
function isAuthenticated() {
|
|
1943
|
-
return !!(keycloak === null || keycloak === void 0 ? void 0 : keycloak.authenticated);
|
|
1944
|
-
}
|
|
1945
|
-
async function checkServerAvailability(url) {
|
|
1946
|
-
try {
|
|
1947
|
-
const response = await fetch(url, { method: 'HEAD', mode: 'no-cors' });
|
|
1948
|
-
return response.ok || response.type === 'opaque';
|
|
1949
|
-
}
|
|
1950
|
-
catch (_a) {
|
|
1951
|
-
return false;
|
|
1952
|
-
}
|
|
1953
|
-
}
|
|
1954
|
-
|
|
1955
|
-
const EdsLogin = class {
|
|
1956
|
-
constructor(hostRef) {
|
|
1957
|
-
index.registerInstance(this, hostRef);
|
|
1958
|
-
this.keycloak = index.createEvent(this, "keycloak", 7);
|
|
1959
|
-
this.auth = index.createEvent(this, "auth", 7);
|
|
1960
|
-
/**
|
|
1961
|
-
* Handles user login by invoking the Keycloak `login` function.
|
|
1962
|
-
* Only triggers login if the user is not already authenticated.
|
|
1963
|
-
*/
|
|
1964
|
-
this.handleLogin = async () => {
|
|
1965
|
-
if (!this.authenticated) {
|
|
1966
|
-
try {
|
|
1967
|
-
await login();
|
|
1968
|
-
}
|
|
1969
|
-
catch (error) {
|
|
1970
|
-
toastManager.toast.show(error.message, 'error');
|
|
1971
|
-
}
|
|
1972
|
-
}
|
|
1973
|
-
};
|
|
1974
|
-
/**
|
|
1975
|
-
* Handles user logout by invoking the Keycloak `logout` function.
|
|
1976
|
-
* Resets the `authenticated` state to `false` after logout.
|
|
1977
|
-
*/
|
|
1978
|
-
this.handleLogout = async () => {
|
|
1979
|
-
try {
|
|
1980
|
-
await logout();
|
|
1981
|
-
}
|
|
1982
|
-
catch (error) {
|
|
1983
|
-
toastManager.toast.show(error.message, 'error');
|
|
1984
|
-
}
|
|
1985
|
-
this.authenticated = false;
|
|
1986
|
-
this.user = null;
|
|
1987
|
-
};
|
|
1988
|
-
this.keycloakUrl = undefined;
|
|
1989
|
-
this.keycloakRealm = undefined;
|
|
1990
|
-
this.keycloakClientId = undefined;
|
|
1991
|
-
this.authenticated = false;
|
|
1992
|
-
this.user = null;
|
|
1993
|
-
this.serverAvailable = false;
|
|
1994
|
-
}
|
|
1995
|
-
/**
|
|
1996
|
-
* Lifecycle method that runs when the component is about to load.
|
|
1997
|
-
* It initializes authentication by calling the `initAuth` method.
|
|
1998
|
-
*/
|
|
1999
|
-
async componentWillLoad() {
|
|
2000
|
-
// Check if required props are provided (optional check)
|
|
2001
|
-
if (!this.keycloakUrl || !this.keycloakRealm || !this.keycloakClientId) {
|
|
2002
|
-
// eslint-disable-next-line
|
|
2003
|
-
console.error('Keycloak configuration props are missing.');
|
|
2004
|
-
return;
|
|
2005
|
-
}
|
|
2006
|
-
this.serverAvailable = await checkServerAvailability(`${this.keycloakUrl}/realms/${this.keycloakRealm}`);
|
|
2007
|
-
if (!this.serverAvailable) {
|
|
2008
|
-
toastManager.toast.show('Keycloak server is unavailable.', 'error');
|
|
2009
|
-
return; // Do not proceed further
|
|
2010
|
-
}
|
|
2011
|
-
await this.initAuth();
|
|
2012
|
-
}
|
|
2013
|
-
/**
|
|
2014
|
-
* Initializes the Keycloak authentication by configuring Keycloak with the provided props.
|
|
2015
|
-
* Sets the `authenticated` state and `user` data if the user is authenticated.
|
|
2016
|
-
* Emits `authStatusChanged` event with the authentication status.
|
|
2017
|
-
*/
|
|
2018
|
-
async initAuth() {
|
|
2019
|
-
try {
|
|
2020
|
-
const res = await initKeycloak({
|
|
2021
|
-
url: this.keycloakUrl,
|
|
2022
|
-
realm: this.keycloakRealm,
|
|
2023
|
-
clientId: this.keycloakClientId
|
|
2024
|
-
}, true);
|
|
2025
|
-
this.keycloak.emit({
|
|
2026
|
-
init: res
|
|
2027
|
-
});
|
|
2028
|
-
if (isAuthenticated()) {
|
|
2029
|
-
this.user = getUser();
|
|
2030
|
-
this.authenticated = true;
|
|
2031
|
-
this.auth.emit({
|
|
2032
|
-
authenticated: this.authenticated,
|
|
2033
|
-
user: this.user
|
|
2034
|
-
}); // Emit auth status change
|
|
2035
|
-
}
|
|
2036
|
-
}
|
|
2037
|
-
catch (error) {
|
|
2038
|
-
toastManager.toast.show(error.message, 'error');
|
|
2039
|
-
}
|
|
2040
|
-
}
|
|
2041
|
-
render() {
|
|
2042
|
-
return (index.h("div", { key: 'ac10895096f36f2fb3a79622972d5a8c519685eb', class: "block" }, !this.authenticated && (index.h("eds-button", { key: '55aab5ee63214d6a1ccdefc303273df99aa309cf', label: "Login", intent: "primary", "extra-class": "text-default", "aria-label": "Login", triggerClick: this.handleLogin.bind(this) }))));
|
|
2043
|
-
}
|
|
2044
|
-
};
|
|
2045
|
-
|
|
2046
|
-
const edsSplashScreenCss = ".splash-overlay{position:fixed;top:0;left:0;width:100vw;height:100vh;z-index:9999999;background-color:var(--grey-200);display:flex;flex-direction:column;align-items:center;justify-content:center}.logo-container{width:200px;height:200px;margin-bottom:1rem}.content-container{position:relative;width:5rem;height:5rem;display:flex;align-items:center;justify-content:center}";
|
|
2047
|
-
const EdsSplashScreenStyle0 = edsSplashScreenCss;
|
|
2048
|
-
|
|
2049
|
-
const EdsSplashScreen = class {
|
|
2050
|
-
constructor(hostRef) {
|
|
2051
|
-
index.registerInstance(this, hostRef);
|
|
2052
|
-
this.splash = index.createEvent(this, "splash", 7);
|
|
2053
|
-
this.inverse = false;
|
|
2054
|
-
this.initPromise = undefined;
|
|
2055
|
-
this.isVisible = true;
|
|
2056
|
-
}
|
|
2057
|
-
// When the component loads, check if there is a promise.
|
|
2058
|
-
componentWillLoad() {
|
|
2059
|
-
if (this.initPromise) {
|
|
2060
|
-
this.handleInitPromise(this.initPromise);
|
|
2061
|
-
}
|
|
2062
|
-
}
|
|
2063
|
-
// Watch for changes on initPromise.
|
|
2064
|
-
async watchInitPromise(newPromise) {
|
|
2065
|
-
if (newPromise) {
|
|
2066
|
-
this.handleInitPromise(newPromise);
|
|
2067
|
-
}
|
|
2068
|
-
}
|
|
2069
|
-
async handleInitPromise(promise) {
|
|
2070
|
-
try {
|
|
2071
|
-
await promise;
|
|
2072
|
-
//console.log('Promises resolved');
|
|
2073
|
-
this.hideSplash();
|
|
2074
|
-
}
|
|
2075
|
-
catch (error) {
|
|
2076
|
-
//console.error('Initialization error:', error);
|
|
2077
|
-
this.splash.emit({ type: 'error', message: error.message || 'Unknown error' });
|
|
2078
|
-
}
|
|
2079
|
-
}
|
|
2080
|
-
handleHideSplash() {
|
|
2081
|
-
this.hideSplash();
|
|
2082
|
-
}
|
|
2083
|
-
hideSplash() {
|
|
2084
|
-
this.isVisible = false;
|
|
2085
|
-
this.splash.emit({ type: 'hidden', message: 'Splash screen hidden successfully' });
|
|
2086
|
-
}
|
|
2087
|
-
render() {
|
|
2088
|
-
if (!this.isVisible) {
|
|
2089
|
-
return null;
|
|
2090
|
-
}
|
|
2091
|
-
return (index.h(index.Host, null, index.h("div", { class: "splash-overlay", style: { background: this.inverse ? 'black' : 'var(--grey-200)' } }, index.h("div", { class: "logo-container" }, this.inverse ? (index.h("eds-logo", { orientation: "vertical", type: "color-white" })) : (index.h("eds-logo", { orientation: "vertical", type: "color" }))), index.h("div", { class: "content-container" }, index.h("eds-spinner", { size: "1rem", thickness: "3px", "border-color": "var(--grey-400)", "bottom-color": "var(--grey-900)", background: "none", fullscreen: false })))));
|
|
2092
|
-
}
|
|
2093
|
-
static get watchers() { return {
|
|
2094
|
-
"initPromise": ["watchInitPromise"]
|
|
2095
|
-
}; }
|
|
2096
|
-
};
|
|
2097
|
-
EdsSplashScreen.style = EdsSplashScreenStyle0;
|
|
2098
|
-
|
|
2099
|
-
exports.eds_login = EdsLogin;
|
|
2100
|
-
exports.eds_splash_screen = EdsSplashScreen;
|