@oslokommune/punkt-elements 16.26.7 → 17.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (239) hide show
  1. package/CHANGELOG.md +93 -0
  2. package/dist/accordion-CbXDxOho.cjs +47 -0
  3. package/dist/{accordion-CBdIk9gw.js → accordion-DEUHQ4JD.js} +45 -35
  4. package/dist/{alert-HHTGY0sp.js → alert-CbtVGrHD.js} +31 -17
  5. package/dist/{alert-B8dLsiTz.cjs → alert-CkUnbPdA.cjs} +5 -5
  6. package/dist/base-elements/input-element.d.ts +1 -0
  7. package/dist/button-Cod17rKo.js +115 -0
  8. package/dist/{button-B5tQpKeG.cjs → button-gvDXtBMC.cjs} +5 -2
  9. package/dist/{calendar-DIzGBdbh.cjs → calendar-BVXW8DqC.cjs} +1 -1
  10. package/dist/{calendar-CjlUA-Lb.js → calendar-CjC4qlh6.js} +1 -1
  11. package/dist/{checkbox-Bt_sC_90.cjs → checkbox-8uxbeU30.cjs} +1 -1
  12. package/dist/{checkbox-D03BC2Va.js → checkbox-DJDphhqz.js} +1 -1
  13. package/dist/{combobox-CoQBTWqL.js → combobox-Du5yr-xM.js} +16 -2
  14. package/dist/combobox-hKrbYLUe.cjs +136 -0
  15. package/dist/components/accordion/accordion-context.d.ts +7 -0
  16. package/dist/components/accordion/accordion.d.ts +2 -0
  17. package/dist/components/accordion/accordionitem.d.ts +1 -0
  18. package/dist/components/alert/alert.d.ts +5 -0
  19. package/dist/components/alert/alert.test.d.ts +1 -0
  20. package/dist/components/button/button.d.ts +4 -1
  21. package/dist/components/datepicker/datepicker-base.d.ts +2 -0
  22. package/dist/components/datepicker/datepicker-utils.d.ts +2 -2
  23. package/dist/components/footer/footer-base.d.ts +44 -0
  24. package/dist/components/footer/footer-simple.d.ts +20 -0
  25. package/dist/components/footer/footer.accessibility.test.d.ts +0 -0
  26. package/dist/components/footer/footer.d.ts +22 -0
  27. package/dist/components/footer/footer.test.d.ts +0 -0
  28. package/dist/components/footer/index.d.ts +3 -0
  29. package/dist/components/footer/types.d.ts +16 -0
  30. package/dist/components/header/header-chrome-controller.d.ts +44 -0
  31. package/dist/components/header/header-global.accessibility.test.d.ts +0 -0
  32. package/dist/components/header/header-global.d.ts +78 -0
  33. package/dist/components/header/header-global.test.d.ts +0 -0
  34. package/dist/components/header/header-service.accessibility.test.d.ts +0 -0
  35. package/dist/components/header/header-service.d.ts +6 -21
  36. package/dist/components/header/header-service.test.d.ts +1 -1
  37. package/dist/components/header/header.d.ts +11 -3
  38. package/dist/components/header/header.test.d.ts +0 -0
  39. package/dist/components/header/index.d.ts +2 -1
  40. package/dist/components/header/types.d.ts +28 -2
  41. package/dist/components/header-menu/header-menu.d.ts +4 -5
  42. package/dist/components/header-menu/types.d.ts +1 -1
  43. package/dist/components/index.d.ts +5 -3
  44. package/dist/components/input-wrapper/input-wrapper.d.ts +2 -0
  45. package/dist/components/input-wrapper/input-wrapper.test.d.ts +1 -0
  46. package/dist/components/searchinput/searchinput.d.ts +5 -0
  47. package/dist/components/select/index.d.ts +1 -1
  48. package/dist/components/select/select.d.ts +2 -2
  49. package/dist/components/select/select.test.d.ts +1 -0
  50. package/dist/components/textarea/textarea.test.d.ts +2 -0
  51. package/dist/components/textinput/textinput.test.d.ts +1 -0
  52. package/dist/components/timepicker/timepicker.d.ts +2 -0
  53. package/dist/components/timepicker/timepicker.test.d.ts +3 -0
  54. package/dist/consent--Nw43WFU.cjs +18 -0
  55. package/dist/{consent-D5sY6JK3.js → consent-B2hSTCGC.js} +14 -7
  56. package/dist/consume-BiOhrhEy.js +167 -0
  57. package/dist/consume-DKf5SmP9.cjs +1 -0
  58. package/dist/{converters-BKGBRBpS.js → converters-BBfsEJV5.js} +25 -25
  59. package/dist/{converters-9jHlXDyy.cjs → converters-Cd0fPEly.cjs} +1 -1
  60. package/dist/{datepicker-BE5Ll0W4.js → datepicker--Fq8q-J3.js} +30 -12
  61. package/dist/{datepicker-x4xM3KQz.cjs → datepicker-CEoBYTBU.cjs} +11 -7
  62. package/dist/docs/components/alert.d.ts +3 -0
  63. package/dist/docs/components/footer.d.ts +9 -0
  64. package/dist/docs/components/form-sizes.d.ts +10 -0
  65. package/dist/docs/components/header-global-full.d.ts +20 -0
  66. package/dist/docs/components/header-global.d.ts +14 -0
  67. package/dist/docs/components/searchinput.d.ts +6 -3
  68. package/dist/fetch-header-footer-data-Pc32etrk.js +88 -0
  69. package/dist/fetch-header-footer-data-xohWFmYC.cjs +1 -0
  70. package/dist/fileupload-CGKUJrlj.cjs +401 -0
  71. package/dist/{fileupload-2hf8YNhO.js → fileupload-D4gQN64T.js} +156 -176
  72. package/dist/focus-trap-DG3pEuyJ.js +60 -0
  73. package/dist/focus-trap-DSv4Ifqm.cjs +1 -0
  74. package/dist/footer-BIrJeRuZ.js +303 -0
  75. package/dist/footer-Ber-jqM1.cjs +114 -0
  76. package/dist/footer.d.ts +1 -0
  77. package/dist/header-CrGRaoqe.js +1288 -0
  78. package/dist/header-DNeyR8DD.cjs +466 -0
  79. package/dist/header-menu-BHqK4QA6.cjs +126 -0
  80. package/dist/{header-menu-C8b5vd3n.js → header-menu-GFtJKM4j.js} +25 -97
  81. package/dist/{helptext-OfqH5npD.js → helptext-C_brWCIT.js} +1 -1
  82. package/dist/{helptext-eckq4JEX.cjs → helptext-Cq5rNaAC.cjs} +1 -1
  83. package/dist/{input-element-ZGOWsvKM.cjs → input-element-B0qLbEdF.cjs} +1 -1
  84. package/dist/{input-element-BFHpeoV8.js → input-element-C0RnXi-J.js} +5 -2
  85. package/dist/{input-wrapper-DwwE0JcO.js → input-wrapper-BweP6t3O.js} +12 -0
  86. package/dist/{input-wrapper-BRjQB4zM.cjs → input-wrapper-DPkkiG7S.cjs} +13 -11
  87. package/dist/{input-wrapper-DaA98B5l.js → input-wrapper-fWV5P4MN.js} +22 -15
  88. package/dist/{input-wrapper-LcZjpt0L.cjs → input-wrapper-wh3fWIhk.cjs} +1 -1
  89. package/dist/modal-CPnFteYS.cjs +35 -0
  90. package/dist/{modal-C6pScpdG.js → modal-xNK_wpHk.js} +11 -20
  91. package/dist/pkt-accordion.cjs +1 -1
  92. package/dist/pkt-accordion.js +1 -1
  93. package/dist/pkt-alert.cjs +1 -1
  94. package/dist/pkt-alert.js +1 -1
  95. package/dist/pkt-button.cjs +1 -1
  96. package/dist/pkt-button.js +1 -1
  97. package/dist/pkt-calendar.cjs +1 -1
  98. package/dist/pkt-calendar.js +1 -1
  99. package/dist/pkt-checkbox.cjs +1 -1
  100. package/dist/pkt-checkbox.js +1 -1
  101. package/dist/pkt-combobox.cjs +1 -1
  102. package/dist/pkt-combobox.js +1 -1
  103. package/dist/pkt-consent.cjs +1 -1
  104. package/dist/pkt-consent.js +1 -1
  105. package/dist/pkt-datepicker.cjs +1 -1
  106. package/dist/pkt-datepicker.js +1 -1
  107. package/dist/pkt-fileupload.cjs +1 -1
  108. package/dist/pkt-fileupload.js +1 -1
  109. package/dist/pkt-footer.cjs +1 -0
  110. package/dist/pkt-footer.js +2 -0
  111. package/dist/pkt-header-menu.cjs +1 -1
  112. package/dist/pkt-header-menu.js +1 -1
  113. package/dist/pkt-header.cjs +1 -1
  114. package/dist/pkt-header.js +2 -2
  115. package/dist/pkt-helptext.cjs +1 -1
  116. package/dist/pkt-helptext.js +1 -1
  117. package/dist/pkt-index.cjs +1 -1
  118. package/dist/pkt-index.js +27 -26
  119. package/dist/pkt-input-wrapper.cjs +1 -1
  120. package/dist/pkt-input-wrapper.js +1 -1
  121. package/dist/pkt-modal.cjs +1 -1
  122. package/dist/pkt-modal.js +1 -1
  123. package/dist/pkt-radiobutton.cjs +1 -1
  124. package/dist/pkt-radiobutton.js +1 -1
  125. package/dist/pkt-searchinput.cjs +1 -1
  126. package/dist/pkt-searchinput.js +1 -1
  127. package/dist/pkt-select.cjs +1 -1
  128. package/dist/pkt-select.js +1 -1
  129. package/dist/pkt-tabs.cjs +1 -1
  130. package/dist/pkt-tabs.js +1 -1
  131. package/dist/pkt-textarea.cjs +1 -1
  132. package/dist/pkt-textarea.js +1 -1
  133. package/dist/pkt-textinput.cjs +1 -1
  134. package/dist/pkt-textinput.js +1 -1
  135. package/dist/pkt-timepicker.cjs +1 -1
  136. package/dist/pkt-timepicker.js +1 -1
  137. package/dist/{radiobutton-DGO6H2Ki.js → radiobutton-C6htwDrT.js} +1 -1
  138. package/dist/{radiobutton-DY1WWepJ.cjs → radiobutton-DjWBoSHv.cjs} +1 -1
  139. package/dist/scroll-lock-BN8lOhV5.cjs +1 -0
  140. package/dist/scroll-lock-DAbNKAUy.js +18 -0
  141. package/dist/searchinput-CfUVfpqL.js +156 -0
  142. package/dist/searchinput-DGjeN1YI.cjs +60 -0
  143. package/dist/{select-D4_HQFkh.cjs → select-CZvAW7W2.cjs} +2 -1
  144. package/dist/{select-BwHUIlwQ.js → select-CsBXXbLP.js} +4 -3
  145. package/dist/setupTests.d.ts +0 -0
  146. package/dist/shared-types/footer.d.ts +95 -0
  147. package/dist/shared-types/{header-menu.d.ts → header-footer.d.ts} +51 -4
  148. package/dist/shared-types/header.d.ts +1 -1
  149. package/dist/shared-types/index.d.ts +6 -4
  150. package/dist/shared-types/searchinput.d.ts +2 -0
  151. package/dist/shared-types/select.d.ts +3 -2
  152. package/dist/shared-types/size.d.ts +4 -0
  153. package/dist/shared-types/timepicker.d.ts +0 -6
  154. package/dist/shared-utils/datepicker-utils.d.ts +5 -4
  155. package/dist/shared-utils/fileupload/focus-trap.d.ts +4 -10
  156. package/dist/shared-utils/focus-trap/index.d.ts +22 -0
  157. package/dist/shared-utils/{header-menu → header-footer}/example-data.d.ts +5 -4
  158. package/dist/shared-utils/header-footer/external-domain.d.ts +26 -0
  159. package/dist/shared-utils/{header-menu → header-footer}/fetch-header-footer-data.d.ts +6 -2
  160. package/dist/shared-utils/{header-menu → header-footer}/index.d.ts +2 -1
  161. package/dist/shared-utils/{header-menu → header-footer}/select-megamenu.d.ts +1 -1
  162. package/dist/shared-utils/scroll-lock/index.d.ts +24 -0
  163. package/dist/tabs-BqrKLCjd.js +214 -0
  164. package/dist/tabs-q62MK_-r.cjs +40 -0
  165. package/dist/{textarea-D6M7ZhtA.js → textarea-Cm392CEI.js} +5 -3
  166. package/dist/{textarea-Bt_Zs8gq.cjs → textarea-sTcZxOIB.cjs} +3 -2
  167. package/dist/{textinput-EDKjcUdg.cjs → textinput-DqJbTglM.cjs} +3 -2
  168. package/dist/{textinput-oU2EvFsi.js → textinput-TSPcBcih.js} +5 -3
  169. package/dist/{timepicker-CgOL2sd9.cjs → timepicker-CqFYMV8q.cjs} +8 -7
  170. package/dist/{timepicker-_G0V_HV3.js → timepicker-DWbgTDKq.js} +10 -9
  171. package/package.json +3 -3
  172. package/src/components/accordion/accordion-context.ts +8 -0
  173. package/src/components/accordion/accordion.test.ts +44 -0
  174. package/src/components/accordion/accordion.ts +13 -3
  175. package/src/components/accordion/accordionitem.ts +9 -1
  176. package/src/components/alert/alert.test.ts +51 -2
  177. package/src/components/alert/alert.ts +11 -5
  178. package/src/components/breadcrumbs/breadcrumbs.test.ts +11 -3
  179. package/src/components/button/button.test.ts +23 -0
  180. package/src/components/button/button.ts +28 -3
  181. package/src/components/combobox/combobox.core.test.ts +20 -0
  182. package/src/components/combobox/combobox.ts +2 -0
  183. package/src/components/consent/consent.test.ts +6 -3
  184. package/src/components/consent/consent.ts +15 -7
  185. package/src/components/datepicker/datepicker-base.ts +5 -1
  186. package/src/components/datepicker/datepicker-utils.test.ts +10 -0
  187. package/src/components/datepicker/datepicker.core.test.ts +17 -0
  188. package/src/components/datepicker/datepicker.ts +8 -0
  189. package/src/components/footer/footer-base.ts +238 -0
  190. package/src/components/footer/footer-simple.ts +71 -0
  191. package/src/components/footer/footer.accessibility.test.ts +66 -0
  192. package/src/components/footer/footer.test.ts +238 -0
  193. package/src/components/footer/footer.ts +81 -0
  194. package/src/components/footer/index.ts +4 -0
  195. package/src/components/footer/types.ts +21 -0
  196. package/src/components/header/header-chrome-controller.ts +123 -0
  197. package/src/components/header/header-global.accessibility.test.ts +110 -0
  198. package/src/components/header/header-global.test.ts +329 -0
  199. package/src/components/header/header-global.ts +648 -0
  200. package/src/components/header/header-service.accessibility.test.ts +79 -0
  201. package/src/components/header/header-service.test.ts +32 -12
  202. package/src/components/header/header-service.ts +38 -162
  203. package/src/components/header/header.test.ts +84 -0
  204. package/src/components/header/header.ts +52 -5
  205. package/src/components/header/index.ts +6 -0
  206. package/src/components/header/types.ts +38 -0
  207. package/src/components/header-menu/header-menu.test.ts +131 -10
  208. package/src/components/header-menu/header-menu.ts +23 -24
  209. package/src/components/header-menu/types.ts +1 -1
  210. package/src/components/index.ts +18 -2
  211. package/src/components/input-wrapper/input-wrapper.test.ts +45 -0
  212. package/src/components/input-wrapper/input-wrapper.ts +17 -9
  213. package/src/components/modal/modal.ts +8 -9
  214. package/src/components/searchinput/searchinput.test.ts +43 -0
  215. package/src/components/searchinput/searchinput.ts +29 -12
  216. package/src/components/select/index.ts +1 -1
  217. package/src/components/select/select.test.ts +28 -0
  218. package/src/components/select/select.ts +4 -3
  219. package/src/components/textarea/textarea.test.ts +16 -0
  220. package/src/components/textarea/textarea.ts +3 -1
  221. package/src/components/textinput/textinput.test.ts +28 -0
  222. package/src/components/textinput/textinput.ts +3 -1
  223. package/src/components/timepicker/timepicker.test.ts +26 -0
  224. package/src/components/timepicker/timepicker.ts +12 -6
  225. package/dist/accordion-FISAiAbX.cjs +0 -47
  226. package/dist/button-C_YzTSuU.js +0 -96
  227. package/dist/combobox-D6H9rWPV.cjs +0 -135
  228. package/dist/consent-X3wvhteO.cjs +0 -10
  229. package/dist/fileupload-BLVrslUX.cjs +0 -401
  230. package/dist/header-CFrsaq0c.cjs +0 -310
  231. package/dist/header-D_xvPR4R.js +0 -801
  232. package/dist/header-menu-DMdP_c6X.cjs +0 -126
  233. package/dist/modal-DKU7PnjJ.cjs +0 -35
  234. package/dist/searchinput-CyO5k4Q4.js +0 -148
  235. package/dist/searchinput-DG6YetL1.cjs +0 -60
  236. package/dist/shared-utils/modal-scroll-lock.d.ts +0 -10
  237. package/dist/tabs-CGo0ODPa.cjs +0 -40
  238. package/dist/tabs-ChdR0D1C.js +0 -379
  239. /package/dist/shared-utils/{header-menu → header-footer}/icon-map.d.ts +0 -0
@@ -0,0 +1,1288 @@
1
+ import { a as e, d as t, n, o as r, p as i, s as a, t as o } from "./element-BoJrqauR.js";
2
+ import { t as s } from "./class-map-CAQCRB1W.js";
3
+ import { n as c, t as l } from "./element-with-slot-mXLg8gg8.js";
4
+ import "./icon-DGFEIlco.js";
5
+ import { t as u } from "./if-defined-D0bnetLJ.js";
6
+ import "./button-Cod17rKo.js";
7
+ import { n as d, t as f } from "./ref-WGS0u7i2.js";
8
+ import { t as p } from "./booleanish-MfutDT_4.js";
9
+ import { n as m, o as h, t as g } from "./fetch-header-footer-data-Pc32etrk.js";
10
+ import { n as _, t as v } from "./focus-trap-DG3pEuyJ.js";
11
+ import { n as y, t as b } from "./scroll-lock-DAbNKAUy.js";
12
+ import "./link-FmkQvSQL.js";
13
+ import "./textinput-TSPcBcih.js";
14
+ import "./searchinput-CfUVfpqL.js";
15
+ import "./header-menu-GFtJKM4j.js";
16
+ //#region ../../shared-types/header.ts
17
+ var x = (e) => typeof e.target == "string" ? {
18
+ title: e.title,
19
+ iconName: e.iconName,
20
+ href: e.target
21
+ } : {
22
+ title: e.title,
23
+ iconName: e.iconName,
24
+ onClick: e.target
25
+ }, S = (e) => x(e), C = (e) => {
26
+ if (!e) return;
27
+ let t = typeof e == "string" ? new Date(e) : e;
28
+ if (!isNaN(t.getTime())) return t.toLocaleDateString("nb-NO", {
29
+ day: "numeric",
30
+ month: "long",
31
+ year: "numeric",
32
+ hour: "2-digit",
33
+ minute: "2-digit"
34
+ });
35
+ }, w = class {
36
+ constructor(e, t) {
37
+ this.isMobile = !1, this.isTablet = !1, this.isHidden = !1, this.pauseScrollHide = !1, this.componentWidth = typeof window < "u" ? window.innerWidth : 0, this.lastScrollPosition = 0, this.scrollLockToken = b(), this.lastFocusedElement = null, this.shouldRestoreFocus = !1, this.handleScroll = () => {
38
+ if (this.getOptions().scrollBehavior !== "hide" || this.pauseScrollHide) return;
39
+ let e = window.pageYOffset || document.documentElement.scrollTop;
40
+ if (e < 0 || Math.abs(e - this.lastScrollPosition) < 60) return;
41
+ let t = e > this.lastScrollPosition;
42
+ this.lastScrollPosition = e, t !== this.isHidden && (this.isHidden = t, this.host.requestUpdate());
43
+ }, this.host = e, this.getOptions = t, e.addController(this);
44
+ }
45
+ hostConnected() {
46
+ window.addEventListener("scroll", this.handleScroll);
47
+ }
48
+ hostDisconnected() {
49
+ this.resizeObserver?.disconnect(), window.removeEventListener("scroll", this.handleScroll), y(this.scrollLockToken, !1);
50
+ }
51
+ observe(e) {
52
+ e && (this.componentWidth = e.offsetWidth, this.refreshBreakpoints(), this.resizeObserver = new ResizeObserver((e) => {
53
+ for (let t of e) this.componentWidth = t.borderBoxSize && t.borderBoxSize.length > 0 ? t.borderBoxSize[0].inlineSize : t.contentRect.width, this.refreshBreakpoints();
54
+ }), this.resizeObserver.observe(e));
55
+ }
56
+ refreshBreakpoints() {
57
+ let { mobileBreakpoint: e, tabletBreakpoint: t } = this.getOptions(), n = this.componentWidth < e, r = this.componentWidth < t;
58
+ (n !== this.isMobile || r !== this.isTablet) && (this.isMobile = n, this.isTablet = r, this.host.requestUpdate());
59
+ }
60
+ setScrollLock(e) {
61
+ y(this.scrollLockToken, e);
62
+ }
63
+ captureFocus() {
64
+ this.lastFocusedElement = document.activeElement;
65
+ }
66
+ flagRestoreFocus() {
67
+ this.shouldRestoreFocus = !0;
68
+ }
69
+ restoreFocus() {
70
+ this.shouldRestoreFocus && this.lastFocusedElement && document.contains(this.lastFocusedElement) && this.lastFocusedElement.focus(), this.lastFocusedElement = null, this.shouldRestoreFocus = !1;
71
+ }
72
+ }, T = class extends o {
73
+ constructor(...e) {
74
+ super(...e), this.canChangeRepresentation = !1, this.logoutOnClick = !1;
75
+ }
76
+ handleChangeRepresentation() {
77
+ this.dispatchEvent(new CustomEvent("change-representation", {
78
+ bubbles: !0,
79
+ composed: !0
80
+ }));
81
+ }
82
+ handleLogout() {
83
+ this.dispatchEvent(new CustomEvent("log-out", {
84
+ bubbles: !0,
85
+ composed: !0
86
+ }));
87
+ }
88
+ handleMenuItemClick(e) {
89
+ "onClick" in e && typeof e.onClick == "function" && e.onClick();
90
+ }
91
+ renderLinkOrButton(e, n) {
92
+ let r = "href" in e, a = s({
93
+ "pkt-user-menu__link": !0,
94
+ "pkt-link-button": !r,
95
+ "pkt-link": !r,
96
+ "pkt-link--icon-left": !r,
97
+ [n || ""]: !!n
98
+ });
99
+ return r ? i`
100
+ <pkt-link
101
+ icon-name=${e.iconName || t}
102
+ href=${e.href}
103
+ aria-hidden="true"
104
+ class="pkt-user-menu__link ${n || ""}"
105
+ >
106
+ ${e.title}
107
+ </pkt-link>
108
+ ` : i`
109
+ <button class=${a} type="button" @click=${() => this.handleMenuItemClick(e)}>
110
+ ${e.iconName ? i`<pkt-icon
111
+ name=${e.iconName}
112
+ class="pkt-link__icon"
113
+ aria-hidden="true"
114
+ ></pkt-icon>` : t}
115
+ ${e.title}
116
+ </button>
117
+ `;
118
+ }
119
+ renderLinkSection(e) {
120
+ return i`
121
+ <ul class="pkt-user-menu__sublist">
122
+ ${e.map((e) => i`
123
+ <li class="pkt-user-menu__subitem">${this.renderLinkOrButton(e)}</li>
124
+ `)}
125
+ </ul>
126
+ `;
127
+ }
128
+ render() {
129
+ let e = this.userMenu?.map(S);
130
+ return i`
131
+ <nav class="pkt-user-menu" aria-label="Meny for innlogget bruker">
132
+ <ul class="pkt-user-menu__list">
133
+ <!-- User section -->
134
+ ${this.user ? i`
135
+ <li class="pkt-user-menu__item">
136
+ <div class="pkt-user-menu__label">Pålogget som</div>
137
+ <div class="pkt-user-menu__name" translate="no">${this.user.name}</div>
138
+ ${this.formattedLastLoggedIn ? i`
139
+ <div class="pkt-user-menu__last-logged-in">
140
+ Sist pålogget: <time>${this.formattedLastLoggedIn}</time>
141
+ </div>
142
+ ` : t}
143
+ </li>
144
+ ` : t}
145
+
146
+ <!-- User menu items -->
147
+ ${e && e.length > 0 ? i`
148
+ <li class="pkt-user-menu__item">${this.renderLinkSection(e)}</li>
149
+ ` : t}
150
+
151
+ <!-- Representing section -->
152
+ ${this.representing ? i`
153
+ <li class="pkt-user-menu__item">
154
+ <div class="pkt-user-menu__label">Representerer</div>
155
+ <div class="pkt-user-menu__name" translate="no">${this.representing.name}</div>
156
+ ${this.representing.orgNumber ? i`<div class="pkt-user-menu__org-number">
157
+ Org.nr. ${this.representing.orgNumber}
158
+ </div>` : t}
159
+ ${this.canChangeRepresentation ? i`
160
+ <ul class="pkt-user-menu__sublist mt-size-16">
161
+ <li class="pkt-user-menu__subitem">
162
+ ${this.renderLinkOrButton({
163
+ title: "Endre organisasjon",
164
+ iconName: "cogwheel",
165
+ onClick: () => this.handleChangeRepresentation()
166
+ })}
167
+ </li>
168
+ </ul>
169
+ ` : t}
170
+ </li>
171
+ ` : t}
172
+
173
+ <!-- Change representation without representing object -->
174
+ ${!this.representing && this.canChangeRepresentation ? i`
175
+ <li class="pkt-user-menu__item">
176
+ <ul class="pkt-user-menu__sublist">
177
+ <li class="pkt-user-menu__subitem">
178
+ ${this.renderLinkOrButton({
179
+ title: "Endre organisasjon",
180
+ iconName: "cogwheel",
181
+ onClick: () => this.handleChangeRepresentation()
182
+ })}
183
+ </li>
184
+ </ul>
185
+ </li>
186
+ ` : t}
187
+
188
+ <!-- Logout -->
189
+ ${this.logoutOnClick ? i`
190
+ <li class="pkt-user-menu__item">
191
+ ${this.renderLinkOrButton({
192
+ title: "Logg ut",
193
+ iconName: "exit",
194
+ onClick: () => this.handleLogout()
195
+ })}
196
+ </li>
197
+ ` : t}
198
+ </ul>
199
+ </nav>
200
+ `;
201
+ }
202
+ };
203
+ n([r({ type: Object })], T.prototype, "user", void 0), n([r({
204
+ type: String,
205
+ attribute: "formatted-last-logged-in"
206
+ })], T.prototype, "formattedLastLoggedIn", void 0), n([r({ type: Object })], T.prototype, "representing", void 0), n([r({
207
+ type: Array,
208
+ attribute: "user-menu"
209
+ })], T.prototype, "userMenu", void 0), n([r({
210
+ type: Boolean,
211
+ attribute: "can-change-representation",
212
+ converter: p
213
+ })], T.prototype, "canChangeRepresentation", void 0), n([r({
214
+ type: Boolean,
215
+ attribute: "logout-on-click",
216
+ converter: p
217
+ })], T.prototype, "logoutOnClick", void 0);
218
+ try {
219
+ a("pkt-header-user-menu")(T);
220
+ } catch {
221
+ console.warn("Forsøker å definere <pkt-header-user-menu>, men den er allerede definert");
222
+ }
223
+ //#endregion
224
+ //#region src/components/header/header-service.ts
225
+ var E = "https://punkt-cdn.oslo.kommune.no/latest/logos/";
226
+ typeof window < "u" && (window.pktLogoPath = window.pktLogoPath || E);
227
+ var D = class extends l {
228
+ constructor(...e) {
229
+ super(...e), this.logoLink = h, this.logoPath = typeof window < "u" ? window.pktLogoPath : E, this.searchPlaceholder = "Søk", this.searchValue = "", this.mobileBreakpoint = 768, this.tabletBreakpoint = 1280, this.openedMenu = "none", this.logOutButtonPlacement = "none", this.position = "fixed", this.scrollBehavior = "hide", this.slotMenuVariant = "icon-only", this.slotMenuText = "Meny", this.hideLogo = !1, this.compact = !1, this.showSearch = !1, this.canChangeRepresentation = !1, this.hasLogOut = !1, this.openMenu = "none", this.alignSlotRight = !1, this.alignSearchRight = !1, this.headerRef = f(), this.userContainerRef = f(), this.slotContainerRef = f(), this.searchContainerRef = f(), this.slotContentRef = f(), this.searchMenuRef = f(), this.chrome = new w(this, () => ({
230
+ mobileBreakpoint: this.mobileBreakpoint,
231
+ tabletBreakpoint: this.tabletBreakpoint,
232
+ position: this.position,
233
+ scrollBehavior: this.scrollBehavior
234
+ })), this.handleClickOutside = (e) => {
235
+ let t = e.target;
236
+ this.user && this.openMenu === "user" && !t.closest(".pkt-header-service__user-container") && (this.openMenu = "none"), this.openMenu === "slot" && !t.closest(".pkt-header-service__slot-container") && (this.openMenu = "none"), this.openMenu === "search" && !t.closest(".pkt-header-service__search-container") && !t.closest(".pkt-header-service__search-input") && (this.openMenu = "none");
237
+ }, this.handleSlotContentClick = (e) => {
238
+ if (!this.isTablet || this.openMenu !== "slot") return;
239
+ let t = e.target.closest("a[href], button, [role=\"link\"], [role=\"button\"], [role=\"menuitem\"], [role=\"menuitemradio\"], [role=\"menuitemcheckbox\"]");
240
+ !t || !this.slotContentRef.value?.contains(t) || t.closest("[data-pkt-header-keep-open]") || t.disabled || t.getAttribute("aria-disabled") === "true" || (this.openMenu = "none");
241
+ }, this.handleFocusOut = (e, t) => {
242
+ let n = e.relatedTarget, r;
243
+ switch (t) {
244
+ case "user":
245
+ r = this.userContainerRef;
246
+ break;
247
+ case "slot":
248
+ r = this.slotContainerRef;
249
+ break;
250
+ case "search":
251
+ r = this.searchContainerRef;
252
+ break;
253
+ default: return;
254
+ }
255
+ let i = r.value;
256
+ i && (!n || !i.contains(n)) && (this.openMenu = "none");
257
+ }, this.handleEscapeKey = (e) => {
258
+ e.key === "Escape" && this.openMenu !== "none" && (e.preventDefault(), this.chrome.flagRestoreFocus(), this.openMenu = "none");
259
+ };
260
+ }
261
+ get isMobile() {
262
+ return this.chrome.isMobile;
263
+ }
264
+ get isTablet() {
265
+ return this.chrome.isTablet;
266
+ }
267
+ get isHidden() {
268
+ return this.chrome.isHidden;
269
+ }
270
+ firstUpdated() {
271
+ this.chrome.observe(this.headerRef.value);
272
+ }
273
+ updated(e) {
274
+ if (super.updated(e), e.has("openedMenu") && this.openedMenu !== this.openMenu && (this.openMenu = this.openedMenu), (e.has("mobileBreakpoint") || e.has("tabletBreakpoint")) && this.chrome.refreshBreakpoints(), e.has("openMenu")) {
275
+ let t = e.get("openMenu");
276
+ this.openMenu !== "none" && (t === "none" || t === void 0) ? (document.addEventListener("mousedown", this.handleClickOutside), document.addEventListener("keydown", this.handleEscapeKey), (this.openMenu === "slot" || this.openMenu === "search") && requestAnimationFrame(() => {
277
+ this.checkDropdownAlignment(this.openMenu);
278
+ })) : this.openMenu === "none" && t !== "none" && (document.removeEventListener("mousedown", this.handleClickOutside), document.removeEventListener("keydown", this.handleEscapeKey), this.chrome.restoreFocus());
279
+ }
280
+ this.chrome.setScrollLock((this.isFixed || this.isSticky) && this.isMobile && this.openMenu !== "none");
281
+ }
282
+ checkDropdownAlignment(e) {
283
+ let t = e === "slot" ? this.slotContainerRef : this.searchContainerRef, n = e === "slot" ? this.slotContentRef : this.searchMenuRef;
284
+ if (!t.value || !n.value || !this.isTablet || this.isMobile) return;
285
+ let r = t.value.getBoundingClientRect(), i = n.value.offsetWidth, a = r.left + i > window.innerWidth;
286
+ e === "slot" ? this.alignSlotRight = a : this.alignSearchRight = a;
287
+ }
288
+ handleMenuToggle(e) {
289
+ this.openMenu === "none" ? (this.chrome.captureFocus(), this.openMenu = e) : this.openMenu = "none";
290
+ }
291
+ handleLogoClick(e) {
292
+ this.dispatchEvent(new CustomEvent("logo-click", {
293
+ bubbles: !0,
294
+ composed: !0,
295
+ detail: { originalEvent: e }
296
+ }));
297
+ }
298
+ handleServiceClick(e) {
299
+ this.dispatchEvent(new CustomEvent("service-click", {
300
+ bubbles: !0,
301
+ composed: !0,
302
+ detail: { originalEvent: e }
303
+ }));
304
+ }
305
+ handleLogout() {
306
+ this.dispatchEvent(new CustomEvent("log-out", {
307
+ bubbles: !0,
308
+ composed: !0
309
+ }));
310
+ }
311
+ handleSearch(e) {
312
+ this.dispatchEvent(new CustomEvent("search", {
313
+ detail: { query: e },
314
+ bubbles: !0,
315
+ composed: !0
316
+ }));
317
+ }
318
+ handleSearchChange(e) {
319
+ this.dispatchEvent(new CustomEvent("search-change", {
320
+ detail: { query: e },
321
+ bubbles: !0,
322
+ composed: !0
323
+ }));
324
+ }
325
+ handleSearchInputChange(e) {
326
+ let t = e.target.value;
327
+ this.handleSearchChange(t);
328
+ }
329
+ handleSearchKeyDown(e) {
330
+ e.key === "Enter" && this.handleSearch(e.target.value);
331
+ }
332
+ get formattedLastLoggedIn() {
333
+ return C(this.user?.lastLoggedIn);
334
+ }
335
+ get isFixed() {
336
+ return this.position === "fixed";
337
+ }
338
+ get isSticky() {
339
+ return this.position === "sticky";
340
+ }
341
+ get shouldHideOnScroll() {
342
+ return this.scrollBehavior === "hide";
343
+ }
344
+ get showLogoutInHeader() {
345
+ return this.hasLogOut && (this.logOutButtonPlacement === "header" || this.logOutButtonPlacement === "both");
346
+ }
347
+ get showLogoutInUserMenu() {
348
+ return this.hasLogOut && (this.logOutButtonPlacement === "userMenu" || this.logOutButtonPlacement === "both");
349
+ }
350
+ renderLogo() {
351
+ if (this.hideLogo) return t;
352
+ let e = i`
353
+ <pkt-icon name="oslologo" aria-hidden="true" path=${this.logoPath}></pkt-icon>
354
+ `;
355
+ return i`
356
+ <span class="pkt-header-service__logo">
357
+ <a href=${this.logoLink} aria-label="Tilbake til forside" @click=${this.handleLogoClick}>
358
+ ${e}
359
+ </a>
360
+ </span>
361
+ `;
362
+ }
363
+ renderServiceName() {
364
+ return this.serviceName ? this.serviceLink && typeof this.serviceLink == "string" ? i`
365
+ <span class="pkt-header-service__service-name" translate="no">
366
+ <pkt-link
367
+ href=${this.serviceLink}
368
+ class="pkt-header-service__service-link"
369
+ @click=${this.handleServiceClick}
370
+ >
371
+ ${this.serviceName}
372
+ </pkt-link>
373
+ </span>
374
+ ` : this.hasAttribute("service-link") ? i`
375
+ <span class="pkt-header-service__service-name" translate="no">
376
+ <button
377
+ class="pkt-link-button pkt-link pkt-header-service__service-link"
378
+ @click=${this.handleServiceClick}
379
+ >
380
+ ${this.serviceName}
381
+ </button>
382
+ </span>
383
+ ` : i`
384
+ <span
385
+ class="pkt-header-service__service-name"
386
+ translate="no"
387
+ @click=${this.handleServiceClick}
388
+ >
389
+ <span class="pkt-header-service__service-link">${this.serviceName}</span>
390
+ </span>
391
+ ` : t;
392
+ }
393
+ renderSlotContainer() {
394
+ if (!this.hasSlotContent()) return t;
395
+ let e = s({
396
+ "pkt-header-service__slot-container": !0,
397
+ "is-open": this.openMenu === "slot"
398
+ }), n = s({
399
+ "pkt-header-service__slot-content": !0,
400
+ "align-right": this.alignSlotRight
401
+ });
402
+ return i`
403
+ <div
404
+ class=${e}
405
+ @focusout=${(e) => this.handleFocusOut(e, "slot")}
406
+ ${d(this.slotContainerRef)}
407
+ >
408
+ ${this.isTablet && this.hasSlotContent() ? i`
409
+ <pkt-button
410
+ skin="secondary"
411
+ variant=${this.slotMenuVariant}
412
+ iconName="menu"
413
+ size=${this.isMobile ? "small" : "medium"}
414
+ state=${this.openMenu === "slot" ? "active" : "normal"}
415
+ @click=${() => this.handleMenuToggle("slot")}
416
+ aria-expanded=${this.openMenu === "slot"}
417
+ aria-controls="mobile-slot-menu"
418
+ aria-label="Åpne meny"
419
+ >
420
+ ${this.slotMenuText}
421
+ </pkt-button>
422
+ ` : t}
423
+ <div
424
+ class=${n}
425
+ id="mobile-slot-menu"
426
+ role=${this.isTablet ? "group" : t}
427
+ aria-label=${this.isTablet ? "Meny" : t}
428
+ @click=${this.handleSlotContentClick}
429
+ ${d(this.slotContentRef)}
430
+ >
431
+ ${c(this)}
432
+ </div>
433
+ </div>
434
+ `;
435
+ }
436
+ renderSearch() {
437
+ if (!this.showSearch) return t;
438
+ if (this.isTablet) {
439
+ let e = s({
440
+ "pkt-header-service__search-container": !0,
441
+ "is-open": this.openMenu === "search"
442
+ }), n = s({
443
+ "pkt-header-service__mobile-menu": !0,
444
+ "is-open": this.openMenu === "search",
445
+ "align-right": this.alignSearchRight
446
+ });
447
+ return i`
448
+ <div
449
+ class=${e}
450
+ @focusout=${(e) => this.handleFocusOut(e, "search")}
451
+ ${d(this.searchContainerRef)}
452
+ >
453
+ <pkt-button
454
+ skin="secondary"
455
+ variant="icon-only"
456
+ iconName="magnifying-glass-big"
457
+ size=${this.isMobile ? "small" : "medium"}
458
+ @click=${() => this.handleMenuToggle("search")}
459
+ state=${this.openMenu === "search" ? "active" : "normal"}
460
+ aria-expanded=${this.openMenu === "search"}
461
+ aria-controls="mobile-search-menu"
462
+ aria-label="Åpne søkefelt"
463
+ >
464
+ Søk
465
+ </pkt-button>
466
+ <div class=${n} ${d(this.searchMenuRef)}>
467
+ ${this.openMenu === "search" ? i`
468
+ <pkt-textinput
469
+ id="mobile-search-menu"
470
+ class="pkt-header-service__search-input"
471
+ type="search"
472
+ label="Søk"
473
+ useWrapper="false"
474
+ placeholder=${this.searchPlaceholder}
475
+ value=${this.searchValue}
476
+ autofocus
477
+ fullwidth
478
+ @input=${this.handleSearchInputChange}
479
+ @keydown=${(e) => {
480
+ e.key === "Enter" && this.handleSearch(e.target.value);
481
+ }}
482
+ ></pkt-textinput>
483
+ ` : t}
484
+ </div>
485
+ </div>
486
+ `;
487
+ }
488
+ return i`
489
+ <pkt-textinput
490
+ id="header-service-search"
491
+ class="pkt-header-service__search-input"
492
+ type="search"
493
+ label="Søk"
494
+ useWrapper="false"
495
+ placeholder=${this.searchPlaceholder}
496
+ value=${this.searchValue}
497
+ @input=${this.handleSearchInputChange}
498
+ @keydown=${this.handleSearchKeyDown}
499
+ ></pkt-textinput>
500
+ `;
501
+ }
502
+ renderUserButton() {
503
+ if (!this.user) return t;
504
+ let e = s({
505
+ "pkt-header-service__user-menu": this.isMobile === !1,
506
+ "pkt-header-service__mobile-menu": this.isMobile === !0,
507
+ "is-open": this.openMenu === "user"
508
+ });
509
+ return i`
510
+ <div
511
+ class="pkt-header-service__user-container"
512
+ @focusout=${(e) => this.handleFocusOut(e, "user")}
513
+ ${d(this.userContainerRef)}
514
+ >
515
+ <pkt-button
516
+ class=${s({
517
+ "pkt-header-service__user-button": !0,
518
+ "pkt-header-service__user-button--mobile": this.isMobile
519
+ })}
520
+ skin="secondary"
521
+ size=${this.isMobile ? "small" : "medium"}
522
+ state=${this.openMenu === "user" ? "active" : "normal"}
523
+ variant="icons-right-and-left"
524
+ iconName="user"
525
+ secondIconName=${this.openMenu === "user" ? "chevron-thin-up" : "chevron-thin-down"}
526
+ @click=${() => this.handleMenuToggle("user")}
527
+ >
528
+ <span class="pkt-sr-only">Brukermeny: </span>
529
+ <span translate="no">${this.representing?.name || this.user.name}</span>
530
+ </pkt-button>
531
+ ${this.openMenu === "user" && this.user ? i`
532
+ <div class=${e}>
533
+ <pkt-header-user-menu
534
+ .user=${this.user}
535
+ formatted-last-logged-in=${this.formattedLastLoggedIn || t}
536
+ .representing=${this.representing}
537
+ .userMenu=${this.userMenu}
538
+ ?can-change-representation=${this.canChangeRepresentation}
539
+ ?logout-on-click=${this.showLogoutInUserMenu}
540
+ @change-representation=${() => this.dispatchEvent(new CustomEvent("change-representation", {
541
+ bubbles: !0,
542
+ composed: !0
543
+ }))}
544
+ @log-out=${this.handleLogout}
545
+ ></pkt-header-user-menu>
546
+ </div>
547
+ ` : t}
548
+ </div>
549
+ `;
550
+ }
551
+ renderHeader() {
552
+ let e = s({
553
+ "pkt-header-service": !0,
554
+ "pkt-header-service--compact": this.compact,
555
+ "pkt-header-service--mobile": this.isMobile,
556
+ "pkt-header-service--tablet": this.isTablet,
557
+ "pkt-header-service--fixed": this.isFixed,
558
+ "pkt-header-service--sticky": this.isSticky,
559
+ "pkt-header-service--scroll-to-hide": this.shouldHideOnScroll,
560
+ "pkt-header-service--hidden": this.isHidden
561
+ }), n = s({
562
+ "pkt-header-service__logo-area": !0,
563
+ "pkt-header-service__logo-area--without-service": !this.serviceName
564
+ });
565
+ return i`
566
+ <header class=${e} ${d(this.headerRef)}>
567
+ <div class=${n}>${this.renderLogo()} ${this.renderServiceName()}</div>
568
+
569
+ ${this.hasSlotContent() || this.showSearch || this.showLogoutInHeader ? i`<div class="pkt-header-service__content">
570
+ ${this.renderSlotContainer()} ${this.renderSearch()}
571
+ ${this.isTablet && this.showLogoutInHeader ? i`
572
+ <pkt-button
573
+ skin="secondary"
574
+ size=${this.isMobile ? "small" : "medium"}
575
+ variant="icon-only"
576
+ iconName="exit"
577
+ @click=${this.handleLogout}
578
+ >
579
+ Logg ut
580
+ </pkt-button>
581
+ ` : t}
582
+ </div>` : t}
583
+ ${this.user || !this.isTablet && this.showLogoutInHeader ? i`<div class="pkt-header-service__user">
584
+ ${this.renderUserButton()}
585
+ ${!this.isTablet && this.showLogoutInHeader ? i`
586
+ <pkt-button
587
+ skin="tertiary"
588
+ size="medium"
589
+ variant="icon-right"
590
+ iconName="exit"
591
+ @click=${this.handleLogout}
592
+ >
593
+ Logg ut
594
+ </pkt-button>
595
+ ` : t}
596
+ </div>` : t}
597
+ </header>
598
+ `;
599
+ }
600
+ render() {
601
+ let e = this.renderHeader();
602
+ return this.isFixed ? i`
603
+ <div class="pkt-header-service-wrapper">
604
+ ${e}
605
+ <div class=${s({
606
+ "pkt-header-service-spacer": !0,
607
+ "pkt-header-service-spacer--compact": this.compact,
608
+ "pkt-header-service-spacer--has-user": !!this.user,
609
+ "pkt-header-service-spacer--mobile": this.isMobile,
610
+ "pkt-header-service-spacer--tablet": this.isTablet
611
+ })}></div>
612
+ </div>
613
+ ` : e;
614
+ }
615
+ };
616
+ n([r({
617
+ type: String,
618
+ attribute: "service-name"
619
+ })], D.prototype, "serviceName", void 0), n([r({
620
+ type: String,
621
+ attribute: "service-link"
622
+ })], D.prototype, "serviceLink", void 0), n([r({
623
+ type: String,
624
+ attribute: "logo-link"
625
+ })], D.prototype, "logoLink", void 0), n([r({
626
+ type: String,
627
+ attribute: "logo-path"
628
+ })], D.prototype, "logoPath", void 0), n([r({
629
+ type: String,
630
+ attribute: "search-placeholder"
631
+ })], D.prototype, "searchPlaceholder", void 0), n([r({
632
+ type: String,
633
+ attribute: "search-value"
634
+ })], D.prototype, "searchValue", void 0), n([r({
635
+ type: Number,
636
+ attribute: "mobile-breakpoint"
637
+ })], D.prototype, "mobileBreakpoint", void 0), n([r({
638
+ type: Number,
639
+ attribute: "tablet-breakpoint"
640
+ })], D.prototype, "tabletBreakpoint", void 0), n([r({
641
+ type: String,
642
+ attribute: "opened-menu"
643
+ })], D.prototype, "openedMenu", void 0), n([r({
644
+ type: String,
645
+ attribute: "log-out-button-placement"
646
+ })], D.prototype, "logOutButtonPlacement", void 0), n([r({ type: String })], D.prototype, "position", void 0), n([r({
647
+ type: String,
648
+ attribute: "scroll-behavior"
649
+ })], D.prototype, "scrollBehavior", void 0), n([r({
650
+ type: String,
651
+ attribute: "slot-menu-variant"
652
+ })], D.prototype, "slotMenuVariant", void 0), n([r({
653
+ type: String,
654
+ attribute: "slot-menu-text"
655
+ })], D.prototype, "slotMenuText", void 0), n([r({
656
+ type: Boolean,
657
+ attribute: "hide-logo",
658
+ converter: p
659
+ })], D.prototype, "hideLogo", void 0), n([r({
660
+ type: Boolean,
661
+ converter: p
662
+ })], D.prototype, "compact", void 0), n([r({
663
+ type: Boolean,
664
+ attribute: "show-search",
665
+ converter: p
666
+ })], D.prototype, "showSearch", void 0), n([r({
667
+ type: Boolean,
668
+ attribute: "can-change-representation",
669
+ converter: p
670
+ })], D.prototype, "canChangeRepresentation", void 0), n([r({
671
+ type: Boolean,
672
+ attribute: "has-log-out",
673
+ converter: p
674
+ })], D.prototype, "hasLogOut", void 0), n([r({ type: Object })], D.prototype, "user", void 0), n([r({
675
+ type: Array,
676
+ attribute: "user-menu"
677
+ })], D.prototype, "userMenu", void 0), n([r({ type: Object })], D.prototype, "representing", void 0), n([e()], D.prototype, "openMenu", void 0), n([e()], D.prototype, "alignSlotRight", void 0), n([e()], D.prototype, "alignSearchRight", void 0);
678
+ try {
679
+ a("pkt-header-service")(D);
680
+ } catch {
681
+ console.warn("Forsøker å definere <pkt-header-service>, men den er allerede definert");
682
+ }
683
+ //#endregion
684
+ //#region src/components/header/header-global.ts
685
+ var O = "https://punkt-cdn.oslo.kommune.no/latest/logos/";
686
+ typeof window < "u" && (window.pktLogoPath = window.pktLogoPath || O);
687
+ var k = "pkt-header-global-menu", A = "pkt-header-global-menu-toggle", j = "pkt-header-global-search-panel", M = "pkt-header-global-search-toggle", N = class extends o {
688
+ constructor(...e) {
689
+ super(...e), this.locale = "nb-NO", this.logoLink = h, this.logoPath = typeof window < "u" ? window.pktLogoPath : O, this.position = "fixed", this.scrollBehavior = "hide", this.mobileBreakpoint = 768, this.tabletBreakpoint = 1024, this.logOutButtonPlacement = "none", this.showSearch = !0, this.showContact = !0, this.canChangeRepresentation = !1, this.hasLogOut = !1, this.openMenu = "none", this.loadError = !1, this.headerAnchor = {
690
+ top: 0,
691
+ left: 0,
692
+ width: 0
693
+ }, this.headerRef = f(), this.menuContainerRef = f(), this.userContainerRef = f(), this.chrome = new w(this, () => ({
694
+ mobileBreakpoint: this.mobileBreakpoint,
695
+ tabletBreakpoint: this.tabletBreakpoint,
696
+ position: this.position,
697
+ scrollBehavior: this.scrollBehavior
698
+ })), this.handleClickOutside = (e) => {
699
+ let t = e.target;
700
+ this.openMenu === "user" && !t.closest(".pkt-header-global__user-container") && !t.closest(".pkt-header-global__user-menu") && (this.openMenu = "none"), this.openMenu === "menu" && !t.closest(".pkt-header-menu") && !t.closest(`#${A}`) && (this.openMenu = "none"), this.openMenu === "search" && !t.closest(".pkt-header-global__search-panel-inner") && !t.closest(`#${M}`) && (this.openMenu = "none");
701
+ }, this.handleEscapeKey = (e) => {
702
+ e.key === "Escape" && this.openMenu !== "none" && (e.preventDefault(), this.chrome.flagRestoreFocus(), this.openMenu = "none");
703
+ }, this.handleOverlayKeydown = (e) => {
704
+ if (e.key !== "Tab") return;
705
+ let t = this.activeOverlay;
706
+ if (!t || !t.panel || !t.toggle) return;
707
+ let { panel: n, toggle: r } = t, i = _(n), a = v();
708
+ if (a && r.contains(a)) {
709
+ !e.shiftKey && i.length > 0 && (e.preventDefault(), i[0].focus());
710
+ return;
711
+ }
712
+ if (i.length === 0) return;
713
+ let o = i[0], s = i[i.length - 1], c = !e.shiftKey && a === s, l = e.shiftKey && a === o;
714
+ (c || l) && (e.preventDefault(), this.openMenu = "none", this.focusToggle(r));
715
+ }, this.handleOverlayFocusIn = (e) => {
716
+ let t = this.activeOverlay;
717
+ if (!t || !t.panel) return;
718
+ let n = e.target;
719
+ n && (t.panel.contains(n) || t.toggle?.contains(n) || (this.openMenu = "none"));
720
+ };
721
+ }
722
+ get isMobile() {
723
+ return this.chrome.isMobile;
724
+ }
725
+ get isTablet() {
726
+ return this.chrome.isTablet;
727
+ }
728
+ get isHidden() {
729
+ return this.chrome.isHidden;
730
+ }
731
+ connectedCallback() {
732
+ super.connectedCallback(), this.classList.add("pkt-header-global-host"), this.data ? this.emitDataLoaded(this.data) : this.loadData();
733
+ }
734
+ disconnectedCallback() {
735
+ super.disconnectedCallback(), this.abortController?.abort(), document.removeEventListener("mousedown", this.handleClickOutside), document.removeEventListener("keydown", this.handleEscapeKey), document.removeEventListener("keydown", this.handleOverlayKeydown), document.removeEventListener("focusin", this.handleOverlayFocusIn);
736
+ }
737
+ firstUpdated() {
738
+ this.chrome.observe(this.headerRef.value);
739
+ }
740
+ willUpdate(e) {
741
+ if (super.willUpdate(e), this.openMenu === "menu" || this.openMenu === "search") {
742
+ let e = this.headerRef.value?.getBoundingClientRect();
743
+ e && (this.headerAnchor = {
744
+ top: e.top,
745
+ left: e.left,
746
+ width: e.width
747
+ });
748
+ }
749
+ }
750
+ get overlayAnchorStyle() {
751
+ let { top: e, left: t, width: n } = this.headerAnchor;
752
+ return `--pkt-header-global-top: ${e}px; --pkt-header-global-left: ${t}px; --pkt-header-global-width: ${n}px`;
753
+ }
754
+ updated(e) {
755
+ if (super.updated(e), (e.has("mobileBreakpoint") || e.has("tabletBreakpoint")) && this.chrome.refreshBreakpoints(), e.has("dataUrl") && e.get("dataUrl") !== void 0 && !this.data && this.loadData(), e.has("data") && this.data && this.emitDataLoaded(this.data), e.has("openMenu")) {
756
+ let t = e.get("openMenu");
757
+ this.openMenu !== "none" && (t === "none" || t === void 0) ? (document.addEventListener("mousedown", this.handleClickOutside), document.addEventListener("keydown", this.handleEscapeKey)) : this.openMenu === "none" && t && t !== "none" && (document.removeEventListener("mousedown", this.handleClickOutside), document.removeEventListener("keydown", this.handleEscapeKey), this.chrome.restoreFocus());
758
+ let n = t === "menu" || t === "search", r = this.openMenu === "menu" || this.openMenu === "search";
759
+ r && !n ? (document.addEventListener("keydown", this.handleOverlayKeydown), document.addEventListener("focusin", this.handleOverlayFocusIn)) : !r && n && (document.removeEventListener("keydown", this.handleOverlayKeydown), document.removeEventListener("focusin", this.handleOverlayFocusIn)), this.openMenu === "search" && t !== "search" && requestAnimationFrame(() => {
760
+ this.querySelector(`#${j} input`)?.focus();
761
+ }), this.chrome.pauseScrollHide = this.openMenu !== "none", this.chrome.setScrollLock(this.openMenu === "menu" || this.openMenu === "search");
762
+ }
763
+ }
764
+ async loadData() {
765
+ this.abortController?.abort(), this.abortController = new AbortController(), this.loadError = !1;
766
+ try {
767
+ let e = await g(this.dataUrl, this.abortController.signal);
768
+ this.fetchedData = e, this.emitDataLoaded(e);
769
+ } catch (e) {
770
+ if (e.name === "AbortError") return;
771
+ this.loadError = !0, this.dispatchEvent(new CustomEvent("data-error", {
772
+ detail: { error: e },
773
+ bubbles: !0,
774
+ composed: !0
775
+ }));
776
+ }
777
+ }
778
+ emitDataLoaded(e) {
779
+ this.dispatchEvent(new CustomEvent("data-loaded", {
780
+ detail: { data: e },
781
+ bubbles: !0,
782
+ composed: !0
783
+ }));
784
+ }
785
+ get effectiveData() {
786
+ return this.data ?? this.fetchedData;
787
+ }
788
+ get localeData() {
789
+ return m(this.effectiveData, this.locale);
790
+ }
791
+ get shouldHideOnScroll() {
792
+ return this.scrollBehavior === "hide";
793
+ }
794
+ get isFixed() {
795
+ return this.position === "fixed";
796
+ }
797
+ get isSticky() {
798
+ return this.position === "sticky";
799
+ }
800
+ toggleMenu(e) {
801
+ this.openMenu === e ? this.openMenu = "none" : (this.chrome.captureFocus(), this.openMenu = e);
802
+ }
803
+ get activeOverlay() {
804
+ return this.openMenu === "menu" ? {
805
+ panel: this.menuContainerRef.value ?? null,
806
+ toggle: this.querySelector(`#${A}`)
807
+ } : this.openMenu === "search" ? {
808
+ panel: this.querySelector(`#${j}`),
809
+ toggle: this.querySelector(`#${M}`)
810
+ } : null;
811
+ }
812
+ focusToggle(e) {
813
+ (e?.querySelector("button") ?? e)?.focus();
814
+ }
815
+ handleSearch(e) {
816
+ this.dispatchEvent(new CustomEvent("search", {
817
+ detail: { query: e },
818
+ bubbles: !0,
819
+ composed: !0
820
+ }));
821
+ }
822
+ handleLogout() {
823
+ this.dispatchEvent(new CustomEvent("log-out", {
824
+ bubbles: !0,
825
+ composed: !0
826
+ }));
827
+ }
828
+ handleChangeRepresentation() {
829
+ this.dispatchEvent(new CustomEvent("change-representation", {
830
+ bubbles: !0,
831
+ composed: !0
832
+ }));
833
+ }
834
+ get formattedLastLoggedIn() {
835
+ return C(this.user?.lastLoggedIn);
836
+ }
837
+ get showLogoutInUserMenu() {
838
+ return this.hasLogOut && (this.logOutButtonPlacement === "userMenu" || this.logOutButtonPlacement === "both");
839
+ }
840
+ handleLogoClick(e) {
841
+ this.dispatchEvent(new CustomEvent("logo-click", {
842
+ bubbles: !0,
843
+ composed: !0,
844
+ detail: { originalEvent: e }
845
+ }));
846
+ }
847
+ renderLogo() {
848
+ let e = i`
849
+ <pkt-icon name="oslologo" aria-hidden="true" path=${u(this.logoPath)}></pkt-icon>
850
+ `;
851
+ return i`
852
+ <span class="pkt-header-global__logo">
853
+ <a href=${this.logoLink} aria-label="Til hovedsiden" @click=${this.handleLogoClick}>
854
+ ${e}
855
+ </a>
856
+ </span>
857
+ `;
858
+ }
859
+ renderSearch(e) {
860
+ if (!this.showSearch) return t;
861
+ let n = e.search;
862
+ if (!n) return t;
863
+ let r = this.searchPlaceholder ?? n.input.placeholder;
864
+ return i`
865
+ <div class="pkt-header-global__search">
866
+ <pkt-searchinput
867
+ appearance="global"
868
+ input-size=${this.isTablet ? "small" : "medium"}
869
+ fullwidth
870
+ id=${n.input.id || "pkt-header-global-search"}
871
+ name=${u(n.input.name)}
872
+ placeholder=${u(r)}
873
+ aria-label=${u(e.i18n?.search)}
874
+ action=${n.endpoint}
875
+ method="get"
876
+ @pkt-search=${(e) => this.handleSearch(e.detail.value)}
877
+ ></pkt-searchinput>
878
+ </div>
879
+ `;
880
+ }
881
+ renderContact(e) {
882
+ if (!this.showContact || this.user) return t;
883
+ let n = e.header?.contact, r = s({
884
+ "pkt-header-global__contact": !0,
885
+ "pkt-btn": !0,
886
+ "pkt-btn--secondary": !0,
887
+ "pkt-btn--label-only": !0,
888
+ "pkt-btn--small": this.isMobile || this.isTablet,
889
+ "pkt-btn--medium": !this.isMobile && !this.isTablet
890
+ });
891
+ return n ? i`
892
+ <a class=${r} href=${n.url}>
893
+ <span class="pkt-btn__text">${n.text}</span>
894
+ </a>
895
+ ` : t;
896
+ }
897
+ get isLoading() {
898
+ return !this.localeData && !this.loadError;
899
+ }
900
+ renderMenuToggle(e) {
901
+ let t = e?.i18n?.menu || "Meny", n = this.openMenu === "menu";
902
+ return i`
903
+ <pkt-button
904
+ id=${A}
905
+ class="pkt-header-global__menu-toggle"
906
+ skin=${this.isMobile ? "tertiary" : "secondary"}
907
+ variant=${this.isMobile ? "icon-only" : "icon-right"}
908
+ iconName=${n ? "close" : "menu"}
909
+ size=${this.isTablet ? "small" : "medium"}
910
+ state=${n ? "active" : "normal"}
911
+ aria-expanded=${n}
912
+ aria-controls=${k}
913
+ ?disabled=${this.isLoading}
914
+ @click=${() => this.toggleMenu("menu")}
915
+ >
916
+ ${t}
917
+ </pkt-button>
918
+ `;
919
+ }
920
+ renderSearchToggle(e) {
921
+ if (!this.showSearch || !e.search) return t;
922
+ let n = this.openMenu === "search";
923
+ return i`
924
+ <pkt-button
925
+ id=${M}
926
+ class="pkt-header-global__search-toggle"
927
+ skin="primary"
928
+ color=${u(n ? void 0 : "yellow")}
929
+ variant="icon-only"
930
+ iconName=${n ? "close" : "magnifying-glass-big"}
931
+ size=${this.isMobile ? "small" : "medium"}
932
+ state=${n ? "active" : "normal"}
933
+ aria-expanded=${n}
934
+ aria-controls=${j}
935
+ @click=${() => this.toggleMenu("search")}
936
+ >
937
+ ${e.i18n?.search || "Søk"}
938
+ </pkt-button>
939
+ `;
940
+ }
941
+ renderSearchPanel(e) {
942
+ let n = e.search;
943
+ if (this.openMenu !== "search" || !this.showSearch || !n) return t;
944
+ let r = this.searchPlaceholder ?? n.input.placeholder;
945
+ return i`
946
+ <div class=${s({
947
+ "pkt-header-global__search-panel": !0,
948
+ [`pkt-header-global__search-panel--${this.overlayBreakpointClass}`]: !!this.overlayBreakpointClass
949
+ })} id=${j} style=${this.overlayAnchorStyle}>
950
+ <div class="pkt-header-global__search-panel-inner">
951
+ <pkt-searchinput
952
+ appearance="global"
953
+ fullwidth
954
+ id=${n.input.id || "pkt-header-global-search"}
955
+ name=${u(n.input.name)}
956
+ placeholder=${u(r)}
957
+ aria-label=${u(e.i18n?.search || "Søk")}
958
+ action=${n.endpoint}
959
+ method="get"
960
+ @pkt-search=${(e) => this.handleSearch(e.detail.value)}
961
+ ></pkt-searchinput>
962
+ </div>
963
+ </div>
964
+ `;
965
+ }
966
+ renderUser() {
967
+ if (!this.user) return t;
968
+ let e = this.openMenu === "user", n = s({
969
+ "pkt-header-global__user-menu": !0,
970
+ "is-open": e
971
+ });
972
+ return i`
973
+ <div class="pkt-header-global__user">
974
+ <div
975
+ class="pkt-header-global__user-container ${e ? "is-open" : ""}"
976
+ ${d(this.userContainerRef)}
977
+ >
978
+ <pkt-button
979
+ class="pkt-header-global__user-button"
980
+ skin="secondary"
981
+ size=${this.isTablet ? "small" : "medium"}
982
+ state=${e ? "active" : "normal"}
983
+ variant="icons-right-and-left"
984
+ iconName="user"
985
+ secondIconName=${e ? "chevron-thin-up" : "chevron-thin-down"}
986
+ @click=${() => this.toggleMenu("user")}
987
+ >
988
+ <span class="pkt-sr-only">Brukermeny: </span>
989
+ <span translate="no">${this.representing?.name || this.user.name}</span>
990
+ </pkt-button>
991
+ ${e ? i`
992
+ <div class=${n}>
993
+ <pkt-header-user-menu
994
+ .user=${this.user}
995
+ formatted-last-logged-in=${this.formattedLastLoggedIn || t}
996
+ .representing=${this.representing}
997
+ .userMenu=${this.userMenu}
998
+ ?can-change-representation=${this.canChangeRepresentation}
999
+ ?logout-on-click=${this.showLogoutInUserMenu}
1000
+ @change-representation=${() => this.handleChangeRepresentation()}
1001
+ @log-out=${() => this.handleLogout()}
1002
+ ></pkt-header-user-menu>
1003
+ </div>
1004
+ ` : t}
1005
+ </div>
1006
+ </div>
1007
+ `;
1008
+ }
1009
+ get overlayBreakpointClass() {
1010
+ return this.isMobile ? "mobile" : this.isTablet ? "tablet" : "";
1011
+ }
1012
+ renderMenu() {
1013
+ return this.openMenu === "menu" ? i`
1014
+ <div
1015
+ class=${s({
1016
+ "pkt-header-global__menu": !0,
1017
+ [`pkt-header-global__menu--${this.overlayBreakpointClass}`]: !!this.overlayBreakpointClass
1018
+ })}
1019
+ id=${k}
1020
+ style=${this.overlayAnchorStyle}
1021
+ ${d(this.menuContainerRef)}
1022
+ >
1023
+ ${this.localeData ? i`
1024
+ <pkt-header-menu
1025
+ .data=${this.effectiveData}
1026
+ locale=${this.locale}
1027
+ open
1028
+ mobile-breakpoint=${this.mobileBreakpoint}
1029
+ ></pkt-header-menu>
1030
+ ` : i`
1031
+ <nav class="pkt-header-menu pkt-header-menu--open">
1032
+ <p class="pkt-header-menu__error">Kunne ikke laste meny.</p>
1033
+ </nav>
1034
+ `}
1035
+ </div>
1036
+ ` : t;
1037
+ }
1038
+ renderHeader() {
1039
+ let e = s({
1040
+ "pkt-header-global": !0,
1041
+ "pkt-header-global--mobile": this.isMobile,
1042
+ "pkt-header-global--tablet": this.isTablet,
1043
+ "pkt-header-global--fixed": this.isFixed,
1044
+ "pkt-header-global--sticky": this.isSticky,
1045
+ "pkt-header-global--scroll-to-hide": this.shouldHideOnScroll,
1046
+ "pkt-header-global--hidden": this.isHidden
1047
+ }), n = this.localeData, r = this.isMobile;
1048
+ return i`
1049
+ <header class=${e} ${d(this.headerRef)}>
1050
+ <div class="pkt-header-global__logo-area">${this.renderLogo()}</div>
1051
+ <div class="pkt-header-global__content">
1052
+ ${!r && n ? this.renderSearch(n) : t}
1053
+ ${r && n ? this.renderSearchToggle(n) : t}
1054
+ ${this.renderMenuToggle(n)}
1055
+ ${!r && n ? this.renderContact(n) : t}
1056
+ </div>
1057
+ ${this.renderUser()}
1058
+ </header>
1059
+ `;
1060
+ }
1061
+ render() {
1062
+ let e = this.renderHeader(), n = this.localeData, r = this.renderMenu(), a = n ? this.renderSearchPanel(n) : t;
1063
+ return this.isFixed ? i`
1064
+ <div class="pkt-header-global-wrapper">
1065
+ ${e}
1066
+ <div class=${s({
1067
+ "pkt-header-global-spacer": !0,
1068
+ "pkt-header-global-spacer--mobile": this.isMobile,
1069
+ "pkt-header-global-spacer--tablet": this.isTablet && !this.isMobile,
1070
+ "pkt-header-global-spacer--has-user": !!this.user
1071
+ })}></div>
1072
+ ${a}${r}
1073
+ </div>
1074
+ ` : i`${e}${a}${r}`;
1075
+ }
1076
+ };
1077
+ n([r({
1078
+ type: String,
1079
+ attribute: "data-url"
1080
+ })], N.prototype, "dataUrl", void 0), n([r({
1081
+ type: Object,
1082
+ attribute: !1
1083
+ })], N.prototype, "data", void 0), n([r({ type: String })], N.prototype, "locale", void 0), n([r({
1084
+ type: String,
1085
+ attribute: "logo-link"
1086
+ })], N.prototype, "logoLink", void 0), n([r({
1087
+ type: String,
1088
+ attribute: "logo-path"
1089
+ })], N.prototype, "logoPath", void 0), n([r({
1090
+ type: String,
1091
+ attribute: "search-placeholder"
1092
+ })], N.prototype, "searchPlaceholder", void 0), n([r({ type: String })], N.prototype, "position", void 0), n([r({
1093
+ type: String,
1094
+ attribute: "scroll-behavior"
1095
+ })], N.prototype, "scrollBehavior", void 0), n([r({
1096
+ type: Number,
1097
+ attribute: "mobile-breakpoint"
1098
+ })], N.prototype, "mobileBreakpoint", void 0), n([r({
1099
+ type: Number,
1100
+ attribute: "tablet-breakpoint"
1101
+ })], N.prototype, "tabletBreakpoint", void 0), n([r({
1102
+ type: String,
1103
+ attribute: "log-out-button-placement"
1104
+ })], N.prototype, "logOutButtonPlacement", void 0), n([r({
1105
+ type: Boolean,
1106
+ attribute: "show-search",
1107
+ converter: p
1108
+ })], N.prototype, "showSearch", void 0), n([r({
1109
+ type: Boolean,
1110
+ attribute: "show-contact",
1111
+ converter: p
1112
+ })], N.prototype, "showContact", void 0), n([r({
1113
+ type: Boolean,
1114
+ attribute: "can-change-representation",
1115
+ converter: p
1116
+ })], N.prototype, "canChangeRepresentation", void 0), n([r({
1117
+ type: Boolean,
1118
+ attribute: "has-log-out",
1119
+ converter: p
1120
+ })], N.prototype, "hasLogOut", void 0), n([r({ type: Object })], N.prototype, "user", void 0), n([r({
1121
+ type: Array,
1122
+ attribute: "user-menu"
1123
+ })], N.prototype, "userMenu", void 0), n([r({ type: Object })], N.prototype, "representing", void 0), n([e()], N.prototype, "openMenu", void 0), n([e()], N.prototype, "fetchedData", void 0), n([e()], N.prototype, "loadError", void 0), n([e()], N.prototype, "headerAnchor", void 0);
1124
+ try {
1125
+ a("pkt-header-global")(N);
1126
+ } catch {
1127
+ console.warn("Forsøker å definere <pkt-header-global>, men den er allerede definert");
1128
+ }
1129
+ //#endregion
1130
+ //#region src/components/header/header.ts
1131
+ var P = class extends l {
1132
+ constructor(...e) {
1133
+ super(...e), this.type = "service", this.searchPlaceholder = "Søk", this.searchValue = "", this.mobileBreakpoint = 768, this.tabletBreakpoint = 1280, this.openedMenu = "none", this.logOutButtonPlacement = "none", this.position = "fixed", this.scrollBehavior = "hide", this.slotMenuVariant = "icon-only", this.slotMenuText = "Meny", this.hideLogo = !1, this.compact = !1, this.canChangeRepresentation = !1, this.hasLogOut = !1, this.showContact = !0;
1134
+ }
1135
+ firstUpdated(e) {
1136
+ super.firstUpdated(e), this.emitDeprecationWarnings();
1137
+ }
1138
+ emitDeprecationWarnings() {
1139
+ this.userMenuFooter !== void 0 && console.warn("[PktHeader] userMenuFooter is deprecated. Use userMenu instead."), this.userOptions !== void 0 && console.warn("[PktHeader] userOptions is deprecated. Use userMenu instead.");
1140
+ }
1141
+ get effectiveUserMenu() {
1142
+ let e = this.userMenu || [], t = this.userMenuFooter || [], n = this.userOptions || [];
1143
+ return t.length || n.length ? [
1144
+ ...e,
1145
+ ...n,
1146
+ ...t
1147
+ ] : this.userMenu;
1148
+ }
1149
+ renderGlobal() {
1150
+ return i`
1151
+ <pkt-header-global
1152
+ data-url=${u(this.dataUrl)}
1153
+ locale=${u(this.locale)}
1154
+ logo-link=${u(this.logoLink)}
1155
+ logo-path=${u(this.logoPath)}
1156
+ search-placeholder=${u(this.hasAttribute("search-placeholder") ? this.searchPlaceholder : void 0)}
1157
+ mobile-breakpoint=${u(this.hasAttribute("mobile-breakpoint") ? this.mobileBreakpoint : void 0)}
1158
+ tablet-breakpoint=${u(this.hasAttribute("tablet-breakpoint") ? this.tabletBreakpoint : void 0)}
1159
+ log-out-button-placement=${this.logOutButtonPlacement}
1160
+ position=${this.position}
1161
+ scroll-behavior=${this.scrollBehavior}
1162
+ .data=${this.data}
1163
+ .showSearch=${this.showSearch ?? !0}
1164
+ .showContact=${this.showContact}
1165
+ .canChangeRepresentation=${this.canChangeRepresentation}
1166
+ .hasLogOut=${this.hasLogOut}
1167
+ .user=${this.user}
1168
+ .userMenu=${this.effectiveUserMenu}
1169
+ .representing=${this.representing}
1170
+ ></pkt-header-global>
1171
+ `;
1172
+ }
1173
+ render() {
1174
+ return this.type === "global" ? this.renderGlobal() : i`
1175
+ <pkt-header-service
1176
+ service-name=${u(this.serviceName)}
1177
+ service-link=${u(this.serviceLink)}
1178
+ logo-link=${u(this.logoLink)}
1179
+ logo-path=${u(this.logoPath)}
1180
+ search-placeholder=${this.searchPlaceholder}
1181
+ search-value=${this.searchValue}
1182
+ mobile-breakpoint=${this.mobileBreakpoint}
1183
+ tablet-breakpoint=${this.tabletBreakpoint}
1184
+ opened-menu=${this.openedMenu}
1185
+ log-out-button-placement=${this.logOutButtonPlacement}
1186
+ position=${this.position}
1187
+ scroll-behavior=${this.scrollBehavior}
1188
+ slot-menu-variant=${this.slotMenuVariant}
1189
+ slot-menu-text=${this.slotMenuText}
1190
+ .hideLogo=${this.hideLogo}
1191
+ .compact=${this.compact}
1192
+ .showSearch=${this.showSearch ?? !1}
1193
+ .canChangeRepresentation=${this.canChangeRepresentation}
1194
+ .hasLogOut=${this.hasLogOut}
1195
+ .user=${this.user}
1196
+ .userMenu=${this.effectiveUserMenu}
1197
+ .representing=${this.representing}
1198
+ >
1199
+ ${this.hasSlotContent() ? i`<div class="pkt-contents">${c(this)}</div>` : t}
1200
+ </pkt-header-service>
1201
+ `;
1202
+ }
1203
+ };
1204
+ n([r({ type: String })], P.prototype, "type", void 0), n([r({
1205
+ type: String,
1206
+ attribute: "service-name"
1207
+ })], P.prototype, "serviceName", void 0), n([r({
1208
+ type: String,
1209
+ attribute: "service-link"
1210
+ })], P.prototype, "serviceLink", void 0), n([r({
1211
+ type: String,
1212
+ attribute: "logo-link"
1213
+ })], P.prototype, "logoLink", void 0), n([r({
1214
+ type: String,
1215
+ attribute: "logo-path"
1216
+ })], P.prototype, "logoPath", void 0), n([r({
1217
+ type: String,
1218
+ attribute: "search-placeholder"
1219
+ })], P.prototype, "searchPlaceholder", void 0), n([r({
1220
+ type: String,
1221
+ attribute: "search-value"
1222
+ })], P.prototype, "searchValue", void 0), n([r({
1223
+ type: Number,
1224
+ attribute: "mobile-breakpoint"
1225
+ })], P.prototype, "mobileBreakpoint", void 0), n([r({
1226
+ type: Number,
1227
+ attribute: "tablet-breakpoint"
1228
+ })], P.prototype, "tabletBreakpoint", void 0), n([r({
1229
+ type: String,
1230
+ attribute: "opened-menu"
1231
+ })], P.prototype, "openedMenu", void 0), n([r({
1232
+ type: String,
1233
+ attribute: "log-out-button-placement"
1234
+ })], P.prototype, "logOutButtonPlacement", void 0), n([r({ type: String })], P.prototype, "position", void 0), n([r({
1235
+ type: String,
1236
+ attribute: "scroll-behavior"
1237
+ })], P.prototype, "scrollBehavior", void 0), n([r({
1238
+ type: String,
1239
+ attribute: "slot-menu-variant"
1240
+ })], P.prototype, "slotMenuVariant", void 0), n([r({
1241
+ type: String,
1242
+ attribute: "slot-menu-text"
1243
+ })], P.prototype, "slotMenuText", void 0), n([r({
1244
+ type: Boolean,
1245
+ attribute: "hide-logo",
1246
+ converter: p
1247
+ })], P.prototype, "hideLogo", void 0), n([r({
1248
+ type: Boolean,
1249
+ converter: p
1250
+ })], P.prototype, "compact", void 0), n([r({
1251
+ type: Boolean,
1252
+ attribute: "show-search",
1253
+ converter: p
1254
+ })], P.prototype, "showSearch", void 0), n([r({
1255
+ type: Boolean,
1256
+ attribute: "can-change-representation",
1257
+ converter: p
1258
+ })], P.prototype, "canChangeRepresentation", void 0), n([r({
1259
+ type: Boolean,
1260
+ attribute: "has-log-out",
1261
+ converter: p
1262
+ })], P.prototype, "hasLogOut", void 0), n([r({ type: Object })], P.prototype, "user", void 0), n([r({
1263
+ type: Array,
1264
+ attribute: "user-menu"
1265
+ })], P.prototype, "userMenu", void 0), n([r({ type: Object })], P.prototype, "representing", void 0), n([r({
1266
+ type: String,
1267
+ attribute: "data-url"
1268
+ })], P.prototype, "dataUrl", void 0), n([r({
1269
+ type: Object,
1270
+ attribute: !1
1271
+ })], P.prototype, "data", void 0), n([r({ type: String })], P.prototype, "locale", void 0), n([r({
1272
+ type: Boolean,
1273
+ attribute: "show-contact",
1274
+ converter: p
1275
+ })], P.prototype, "showContact", void 0), n([r({
1276
+ type: Array,
1277
+ attribute: "user-menu-footer"
1278
+ })], P.prototype, "userMenuFooter", void 0), n([r({
1279
+ type: Array,
1280
+ attribute: "user-options"
1281
+ })], P.prototype, "userOptions", void 0);
1282
+ try {
1283
+ a("pkt-header")(P);
1284
+ } catch {
1285
+ console.warn("Forsøker å definere <pkt-header>, men den er allerede definert");
1286
+ }
1287
+ //#endregion
1288
+ export { C as a, T as i, N as n, D as r, P as t };