@zengenti/contensis-react-base 4.0.0-beta.2 → 4.0.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (209) hide show
  1. package/LICENSE +7 -0
  2. package/README.md +18 -478
  3. package/cjs/{App-b56aca04.js → App-BNcmM8rN.js} +215 -234
  4. package/cjs/App-BNcmM8rN.js.map +1 -0
  5. package/cjs/{ChangePassword.container-ae35785e.js → ChangePassword.container-642SYfpS.js} +209 -286
  6. package/cjs/ChangePassword.container-642SYfpS.js.map +1 -0
  7. package/cjs/CookieHelper.class-BoY5TrIi.js +562 -0
  8. package/cjs/CookieHelper.class-BoY5TrIi.js.map +1 -0
  9. package/cjs/{RouteLoader-c06dccd5.js → RouteLoader-DvyYYyIE.js} +55 -68
  10. package/cjs/RouteLoader-DvyYYyIE.js.map +1 -0
  11. package/cjs/{ContensisDeliveryApi-4fcf049d.js → SSRContext-D66GKlH7.js} +165 -119
  12. package/cjs/SSRContext-D66GKlH7.js.map +1 -0
  13. package/cjs/{ToJs-a8d8f3f0.js → ToJs-C9jwV7YB.js} +26 -80
  14. package/cjs/ToJs-C9jwV7YB.js.map +1 -0
  15. package/cjs/{_commonjsHelpers-b3309d7b.js → _commonjsHelpers-BJu3ubxk.js} +1 -1
  16. package/cjs/_commonjsHelpers-BJu3ubxk.js.map +1 -0
  17. package/cjs/client.js +67 -65
  18. package/cjs/client.js.map +1 -1
  19. package/cjs/contensis-react-base.js +386 -3293
  20. package/cjs/contensis-react-base.js.map +1 -1
  21. package/cjs/{fromJSLeaveImmer-e74c673c.js → fromJSLeaveImmer-Blvlk4t2.js} +3 -7
  22. package/{esm/fromJSLeaveImmer-0114ffcf.js.map → cjs/fromJSLeaveImmer-Blvlk4t2.js.map} +1 -1
  23. package/cjs/redux.js +18 -19
  24. package/cjs/redux.js.map +1 -1
  25. package/cjs/routing.js +13 -6
  26. package/cjs/routing.js.map +1 -1
  27. package/cjs/sagas-CbZhaRNd.js +6010 -0
  28. package/cjs/sagas-CbZhaRNd.js.map +1 -0
  29. package/cjs/search.js +105 -305
  30. package/cjs/search.js.map +1 -1
  31. package/cjs/selectors-wCs5fHD4.js +460 -0
  32. package/cjs/selectors-wCs5fHD4.js.map +1 -0
  33. package/cjs/{version-34d91f68.js → store-CADDS7cV.js} +44 -111
  34. package/cjs/store-CADDS7cV.js.map +1 -0
  35. package/cjs/{urls-6fcaf4c6.js → urls-DVIwGZmd.js} +1 -1
  36. package/{esm/urls-eac9a747.js.map → cjs/urls-DVIwGZmd.js.map} +1 -1
  37. package/cjs/user.js +12 -20
  38. package/cjs/user.js.map +1 -1
  39. package/cjs/util.js +108 -115
  40. package/cjs/util.js.map +1 -1
  41. package/cjs/{version-a410c88e.js → version-ASZx0NDG.js} +19 -22
  42. package/{esm/version-9f29becb.js.map → cjs/version-ASZx0NDG.js.map} +1 -1
  43. package/cjs/version-CM-bJ62L.js +20 -0
  44. package/cjs/version-CM-bJ62L.js.map +1 -0
  45. package/esm/{App-83107d7e.js → App-CfIZbvU9.js} +176 -195
  46. package/esm/App-CfIZbvU9.js.map +1 -0
  47. package/esm/{ChangePassword.container-76fd5e9b.js → ChangePassword.container-Q7bElOVz.js} +191 -250
  48. package/esm/ChangePassword.container-Q7bElOVz.js.map +1 -0
  49. package/esm/CookieHelper.class-DzleKOOc.js +555 -0
  50. package/esm/CookieHelper.class-DzleKOOc.js.map +1 -0
  51. package/esm/{RouteLoader-29fd689a.js → RouteLoader-qJA3UqTM.js} +40 -53
  52. package/esm/RouteLoader-qJA3UqTM.js.map +1 -0
  53. package/esm/{ContensisDeliveryApi-fe57a037.js → SSRContext-C743Oeli.js} +159 -120
  54. package/esm/SSRContext-C743Oeli.js.map +1 -0
  55. package/esm/{ToJs-df57f31d.js → ToJs-CpPNdcXS.js} +24 -77
  56. package/esm/ToJs-CpPNdcXS.js.map +1 -0
  57. package/esm/{_commonjsHelpers-1789f0cf.js → _commonjsHelpers-BFTU3MAI.js} +1 -1
  58. package/esm/_commonjsHelpers-BFTU3MAI.js.map +1 -0
  59. package/esm/client.js +55 -53
  60. package/esm/client.js.map +1 -1
  61. package/esm/contensis-react-base.js +317 -3222
  62. package/esm/contensis-react-base.js.map +1 -1
  63. package/esm/{fromJSLeaveImmer-0114ffcf.js → fromJSLeaveImmer-C_YACmOf.js} +2 -6
  64. package/{cjs/fromJSLeaveImmer-e74c673c.js.map → esm/fromJSLeaveImmer-C_YACmOf.js.map} +1 -1
  65. package/esm/redux.js +9 -8
  66. package/esm/redux.js.map +1 -1
  67. package/esm/routing.js +13 -4
  68. package/esm/routing.js.map +1 -1
  69. package/esm/sagas-xJU-zOpn.js +5916 -0
  70. package/esm/sagas-xJU-zOpn.js.map +1 -0
  71. package/esm/search.js +113 -311
  72. package/esm/search.js.map +1 -1
  73. package/esm/selectors-CBdCY0u3.js +396 -0
  74. package/esm/selectors-CBdCY0u3.js.map +1 -0
  75. package/esm/{version-3d9911e2.js → store-uQZKjfA8.js} +36 -81
  76. package/esm/store-uQZKjfA8.js.map +1 -0
  77. package/esm/{urls-eac9a747.js → urls-DfCisos-.js} +1 -1
  78. package/{cjs/urls-6fcaf4c6.js.map → esm/urls-DfCisos-.js.map} +1 -1
  79. package/esm/user.js +7 -13
  80. package/esm/user.js.map +1 -1
  81. package/esm/util.js +66 -74
  82. package/esm/util.js.map +1 -1
  83. package/esm/{version-9f29becb.js → version-B9nPx4IF.js} +6 -9
  84. package/{cjs/version-a410c88e.js.map → esm/version-B9nPx4IF.js.map} +1 -1
  85. package/esm/version-D773TD9j.js +15 -0
  86. package/esm/version-D773TD9j.js.map +1 -0
  87. package/models/app/App.d.ts +1 -1
  88. package/models/app/pages/VersionInfo/components/VersionInfo.d.ts +1 -1
  89. package/models/app/pages/VersionInfo/components/VersionInfo.styled.d.ts +2 -1
  90. package/models/client/client.d.ts +1 -1
  91. package/models/index.d.ts +1 -2
  92. package/models/models/AppRouteProps.d.ts +11 -0
  93. package/models/models/ContentTypeMapping.d.ts +89 -0
  94. package/models/models/EntryMapper.d.ts +3 -0
  95. package/models/models/GetRouteActionArgs.d.ts +15 -0
  96. package/models/models/MatchedRoute.d.ts +4 -0
  97. package/models/models/ReduxInjector.d.ts +5 -0
  98. package/models/models/RequireLogin.d.ts +6 -0
  99. package/models/models/RouteComponent.d.ts +4 -0
  100. package/models/models/RouteComponentProps.d.ts +9 -0
  101. package/models/models/RouteLoaderProps.d.ts +9 -0
  102. package/models/models/RouteNode.d.ts +5 -0
  103. package/models/models/SSRContext.d.ts +11 -0
  104. package/models/models/StaticRoute.d.ts +60 -0
  105. package/models/models/WithEvents.d.ts +58 -0
  106. package/models/models/config/AppConfig.d.ts +12 -0
  107. package/models/{config.d.ts → models/config/ServerConfig.d.ts} +3 -12
  108. package/models/models/config/StateType.d.ts +1 -0
  109. package/models/models/config/index.d.ts +3 -0
  110. package/models/models/index.d.ts +16 -0
  111. package/models/redux/actions/index.d.ts +2 -2
  112. package/models/redux/sagas/navigation.d.ts +1 -3
  113. package/models/redux/selectors/index.d.ts +2 -2
  114. package/models/redux/store/injectors.d.ts +16 -4
  115. package/models/redux/store/store.d.ts +10 -4
  116. package/models/redux/types/index.d.ts +2 -2
  117. package/models/redux/types/navigation.d.ts +3 -3
  118. package/models/redux/types/version.d.ts +2 -2
  119. package/models/routing/components/Redirect.d.ts +1 -1
  120. package/models/routing/components/RouteLoader.d.ts +1 -1
  121. package/models/routing/components/StaticRouteLoader.d.ts +1 -1
  122. package/models/routing/components/Status.d.ts +1 -1
  123. package/models/routing/redux/actions.d.ts +3 -4
  124. package/models/routing/redux/selectors.d.ts +2 -2
  125. package/models/routing/redux/types.d.ts +11 -11
  126. package/models/routing/routes.d.ts +1 -1
  127. package/models/routing/util/find-contenttype-mapping.d.ts +1 -1
  128. package/models/routing/util/queries.d.ts +2 -2
  129. package/models/search/models/Queries.d.ts +4 -2
  130. package/models/search/models/Search.d.ts +8 -1
  131. package/models/search/models/SearchActions.d.ts +3 -2
  132. package/models/search/models/SearchState.d.ts +5 -1
  133. package/models/search/redux/reducers.d.ts +2 -257
  134. package/models/search/redux/schema.d.ts +1 -1
  135. package/models/search/redux/selectors.d.ts +5 -5
  136. package/models/search/search/ContensisDeliveryApi.d.ts +2 -2
  137. package/models/search/search/ToJs.d.ts +1 -1
  138. package/models/search/search/expressions.d.ts +3 -3
  139. package/models/search/search/util.d.ts +17 -2
  140. package/models/search/transformations/searchresult-to-state.mapper.d.ts +1 -2
  141. package/models/server/features/caching/cacheDuration.schema.d.ts +1 -0
  142. package/models/server/features/linkdepth-api/search.d.ts +1 -1
  143. package/models/server/features/static-assets/index.d.ts +1 -1
  144. package/models/server/internalServer.d.ts +1 -1
  145. package/models/server/util/bundles.d.ts +1 -1
  146. package/models/server/util/headers.d.ts +1 -1
  147. package/models/server/webApp.d.ts +1 -1
  148. package/models/user/components/Login.d.ts +1 -1
  149. package/models/user/components/LoginForm.d.ts +6 -6
  150. package/models/user/components/LogoutForm.d.ts +4 -4
  151. package/models/user/components.styled/Login.styled.d.ts +1 -1
  152. package/models/user/components.styled/LoginForm.styled.d.ts +1 -1
  153. package/models/user/hocs/withLogin.d.ts +4 -4
  154. package/models/user/hooks/useLogin.d.ts +4 -4
  155. package/models/user/redux/actions.d.ts +7 -6
  156. package/models/user/redux/sagas/index.d.ts +1 -1
  157. package/models/user/redux/sagas/login.d.ts +5 -17
  158. package/models/user/redux/selectors.d.ts +1 -2
  159. package/models/user/redux/types.d.ts +21 -21
  160. package/models/user/state.d.ts +12 -0
  161. package/models/user/transformations/mapClientCredentials.d.ts +3 -1
  162. package/models/user/util/ContensisManagementApi.d.ts +10 -9
  163. package/models/user/util/CookieConstants.d.ts +1 -0
  164. package/models/user/util/CookieHelper.class.d.ts +8 -4
  165. package/models/user/util/LoginHelper.class.d.ts +25 -37
  166. package/models/user/util/OidcUserManager.d.ts +1 -1
  167. package/models/user/util/matchGroups.d.ts +1 -1
  168. package/models/util/CachedDeliveryApi.d.ts +11 -10
  169. package/models/util/ContensisDeliveryApi.d.ts +11 -7
  170. package/models/util/SSRContext.d.ts +29 -0
  171. package/models/util/index.d.ts +1 -0
  172. package/models/util/json-mapper.d.ts +4 -5
  173. package/package.json +71 -92
  174. package/cjs/App-b56aca04.js.map +0 -1
  175. package/cjs/ChangePassword.container-ae35785e.js.map +0 -1
  176. package/cjs/ContensisDeliveryApi-4fcf049d.js.map +0 -1
  177. package/cjs/CookieConstants-000427db.js +0 -10
  178. package/cjs/CookieConstants-000427db.js.map +0 -1
  179. package/cjs/RouteLoader-c06dccd5.js.map +0 -1
  180. package/cjs/ToJs-a8d8f3f0.js.map +0 -1
  181. package/cjs/_commonjsHelpers-b3309d7b.js.map +0 -1
  182. package/cjs/forms.js +0 -5998
  183. package/cjs/forms.js.map +0 -1
  184. package/cjs/reducers-73a03ef4.js +0 -257
  185. package/cjs/reducers-73a03ef4.js.map +0 -1
  186. package/cjs/sagas-570f23ba.js +0 -2175
  187. package/cjs/sagas-570f23ba.js.map +0 -1
  188. package/cjs/selectors-14caa813.js +0 -228
  189. package/cjs/selectors-14caa813.js.map +0 -1
  190. package/cjs/version-34d91f68.js.map +0 -1
  191. package/esm/App-83107d7e.js.map +0 -1
  192. package/esm/ChangePassword.container-76fd5e9b.js.map +0 -1
  193. package/esm/ContensisDeliveryApi-fe57a037.js.map +0 -1
  194. package/esm/CookieConstants-3d3b6531.js +0 -6
  195. package/esm/CookieConstants-3d3b6531.js.map +0 -1
  196. package/esm/RouteLoader-29fd689a.js.map +0 -1
  197. package/esm/ToJs-df57f31d.js.map +0 -1
  198. package/esm/_commonjsHelpers-1789f0cf.js.map +0 -1
  199. package/esm/forms.js +0 -5984
  200. package/esm/forms.js.map +0 -1
  201. package/esm/reducers-aa8cef1e.js +0 -234
  202. package/esm/reducers-aa8cef1e.js.map +0 -1
  203. package/esm/sagas-07e82e18.js +0 -2083
  204. package/esm/sagas-07e82e18.js.map +0 -1
  205. package/esm/selectors-691caf02.js +0 -186
  206. package/esm/selectors-691caf02.js.map +0 -1
  207. package/esm/version-3d9911e2.js.map +0 -1
  208. package/models/forms/index.d.ts +0 -1
  209. /package/models/{redux/appstate.d.ts → models/AppState.d.ts} +0 -0
@@ -0,0 +1,562 @@
1
+ 'use strict';
2
+
3
+ const BEARER_TOKEN_COOKIE = 'ContensisSecurityBearerToken';
4
+ const LOGIN_COOKIE = 'ContensisCMSUserName';
5
+ const REFRESH_TOKEN_COOKIE = 'RefreshToken';
6
+ const findLoginCookies = cookies => typeof cookies === 'object' ? Object.fromEntries(Object.entries(cookies).filter(([name]) => [LOGIN_COOKIE, REFRESH_TOKEN_COOKIE].includes(name))) : cookies;
7
+
8
+ var cookie = {};
9
+
10
+ /*!
11
+ * cookie
12
+ * Copyright(c) 2012-2014 Roman Shtylman
13
+ * Copyright(c) 2015 Douglas Christopher Wilson
14
+ * MIT Licensed
15
+ */
16
+
17
+ var hasRequiredCookie;
18
+
19
+ function requireCookie () {
20
+ if (hasRequiredCookie) return cookie;
21
+ hasRequiredCookie = 1;
22
+
23
+ /**
24
+ * Module exports.
25
+ * @public
26
+ */
27
+
28
+ cookie.parse = parse;
29
+ cookie.serialize = serialize;
30
+
31
+ /**
32
+ * Module variables.
33
+ * @private
34
+ */
35
+
36
+ var __toString = Object.prototype.toString;
37
+ var __hasOwnProperty = Object.prototype.hasOwnProperty;
38
+
39
+ /**
40
+ * RegExp to match cookie-name in RFC 6265 sec 4.1.1
41
+ * This refers out to the obsoleted definition of token in RFC 2616 sec 2.2
42
+ * which has been replaced by the token definition in RFC 7230 appendix B.
43
+ *
44
+ * cookie-name = token
45
+ * token = 1*tchar
46
+ * tchar = "!" / "#" / "$" / "%" / "&" / "'" /
47
+ * "*" / "+" / "-" / "." / "^" / "_" /
48
+ * "`" / "|" / "~" / DIGIT / ALPHA
49
+ */
50
+
51
+ var cookieNameRegExp = /^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;
52
+
53
+ /**
54
+ * RegExp to match cookie-value in RFC 6265 sec 4.1.1
55
+ *
56
+ * cookie-value = *cookie-octet / ( DQUOTE *cookie-octet DQUOTE )
57
+ * cookie-octet = %x21 / %x23-2B / %x2D-3A / %x3C-5B / %x5D-7E
58
+ * ; US-ASCII characters excluding CTLs,
59
+ * ; whitespace DQUOTE, comma, semicolon,
60
+ * ; and backslash
61
+ */
62
+
63
+ var cookieValueRegExp = /^("?)[\u0021\u0023-\u002B\u002D-\u003A\u003C-\u005B\u005D-\u007E]*\1$/;
64
+
65
+ /**
66
+ * RegExp to match domain-value in RFC 6265 sec 4.1.1
67
+ *
68
+ * domain-value = <subdomain>
69
+ * ; defined in [RFC1034], Section 3.5, as
70
+ * ; enhanced by [RFC1123], Section 2.1
71
+ * <subdomain> = <label> | <subdomain> "." <label>
72
+ * <label> = <let-dig> [ [ <ldh-str> ] <let-dig> ]
73
+ * Labels must be 63 characters or less.
74
+ * 'let-dig' not 'letter' in the first char, per RFC1123
75
+ * <ldh-str> = <let-dig-hyp> | <let-dig-hyp> <ldh-str>
76
+ * <let-dig-hyp> = <let-dig> | "-"
77
+ * <let-dig> = <letter> | <digit>
78
+ * <letter> = any one of the 52 alphabetic characters A through Z in
79
+ * upper case and a through z in lower case
80
+ * <digit> = any one of the ten digits 0 through 9
81
+ *
82
+ * Keep support for leading dot: https://github.com/jshttp/cookie/issues/173
83
+ *
84
+ * > (Note that a leading %x2E ("."), if present, is ignored even though that
85
+ * character is not permitted, but a trailing %x2E ("."), if present, will
86
+ * cause the user agent to ignore the attribute.)
87
+ */
88
+
89
+ var domainValueRegExp = /^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i;
90
+
91
+ /**
92
+ * RegExp to match path-value in RFC 6265 sec 4.1.1
93
+ *
94
+ * path-value = <any CHAR except CTLs or ";">
95
+ * CHAR = %x01-7F
96
+ * ; defined in RFC 5234 appendix B.1
97
+ */
98
+
99
+ var pathValueRegExp = /^[\u0020-\u003A\u003D-\u007E]*$/;
100
+
101
+ /**
102
+ * Parse a cookie header.
103
+ *
104
+ * Parse the given cookie header string into an object
105
+ * The object has the various cookies as keys(names) => values
106
+ *
107
+ * @param {string} str
108
+ * @param {object} [opt]
109
+ * @return {object}
110
+ * @public
111
+ */
112
+
113
+ function parse(str, opt) {
114
+ if (typeof str !== 'string') {
115
+ throw new TypeError('argument str must be a string');
116
+ }
117
+
118
+ var obj = {};
119
+ var len = str.length;
120
+ // RFC 6265 sec 4.1.1, RFC 2616 2.2 defines a cookie name consists of one char minimum, plus '='.
121
+ if (len < 2) return obj;
122
+
123
+ var dec = (opt && opt.decode) || decode;
124
+ var index = 0;
125
+ var eqIdx = 0;
126
+ var endIdx = 0;
127
+
128
+ do {
129
+ eqIdx = str.indexOf('=', index);
130
+ if (eqIdx === -1) break; // No more cookie pairs.
131
+
132
+ endIdx = str.indexOf(';', index);
133
+
134
+ if (endIdx === -1) {
135
+ endIdx = len;
136
+ } else if (eqIdx > endIdx) {
137
+ // backtrack on prior semicolon
138
+ index = str.lastIndexOf(';', eqIdx - 1) + 1;
139
+ continue;
140
+ }
141
+
142
+ var keyStartIdx = startIndex(str, index, eqIdx);
143
+ var keyEndIdx = endIndex(str, eqIdx, keyStartIdx);
144
+ var key = str.slice(keyStartIdx, keyEndIdx);
145
+
146
+ // only assign once
147
+ if (!__hasOwnProperty.call(obj, key)) {
148
+ var valStartIdx = startIndex(str, eqIdx + 1, endIdx);
149
+ var valEndIdx = endIndex(str, endIdx, valStartIdx);
150
+
151
+ if (str.charCodeAt(valStartIdx) === 0x22 /* " */ && str.charCodeAt(valEndIdx - 1) === 0x22 /* " */) {
152
+ valStartIdx++;
153
+ valEndIdx--;
154
+ }
155
+
156
+ var val = str.slice(valStartIdx, valEndIdx);
157
+ obj[key] = tryDecode(val, dec);
158
+ }
159
+
160
+ index = endIdx + 1;
161
+ } while (index < len);
162
+
163
+ return obj;
164
+ }
165
+
166
+ function startIndex(str, index, max) {
167
+ do {
168
+ var code = str.charCodeAt(index);
169
+ if (code !== 0x20 /* */ && code !== 0x09 /* \t */) return index;
170
+ } while (++index < max);
171
+ return max;
172
+ }
173
+
174
+ function endIndex(str, index, min) {
175
+ while (index > min) {
176
+ var code = str.charCodeAt(--index);
177
+ if (code !== 0x20 /* */ && code !== 0x09 /* \t */) return index + 1;
178
+ }
179
+ return min;
180
+ }
181
+
182
+ /**
183
+ * Serialize data into a cookie header.
184
+ *
185
+ * Serialize a name value pair into a cookie string suitable for
186
+ * http headers. An optional options object specifies cookie parameters.
187
+ *
188
+ * serialize('foo', 'bar', { httpOnly: true })
189
+ * => "foo=bar; httpOnly"
190
+ *
191
+ * @param {string} name
192
+ * @param {string} val
193
+ * @param {object} [opt]
194
+ * @return {string}
195
+ * @public
196
+ */
197
+
198
+ function serialize(name, val, opt) {
199
+ var enc = (opt && opt.encode) || encodeURIComponent;
200
+
201
+ if (typeof enc !== 'function') {
202
+ throw new TypeError('option encode is invalid');
203
+ }
204
+
205
+ if (!cookieNameRegExp.test(name)) {
206
+ throw new TypeError('argument name is invalid');
207
+ }
208
+
209
+ var value = enc(val);
210
+
211
+ if (!cookieValueRegExp.test(value)) {
212
+ throw new TypeError('argument val is invalid');
213
+ }
214
+
215
+ var str = name + '=' + value;
216
+ if (!opt) return str;
217
+
218
+ if (null != opt.maxAge) {
219
+ var maxAge = Math.floor(opt.maxAge);
220
+
221
+ if (!isFinite(maxAge)) {
222
+ throw new TypeError('option maxAge is invalid')
223
+ }
224
+
225
+ str += '; Max-Age=' + maxAge;
226
+ }
227
+
228
+ if (opt.domain) {
229
+ if (!domainValueRegExp.test(opt.domain)) {
230
+ throw new TypeError('option domain is invalid');
231
+ }
232
+
233
+ str += '; Domain=' + opt.domain;
234
+ }
235
+
236
+ if (opt.path) {
237
+ if (!pathValueRegExp.test(opt.path)) {
238
+ throw new TypeError('option path is invalid');
239
+ }
240
+
241
+ str += '; Path=' + opt.path;
242
+ }
243
+
244
+ if (opt.expires) {
245
+ var expires = opt.expires;
246
+
247
+ if (!isDate(expires) || isNaN(expires.valueOf())) {
248
+ throw new TypeError('option expires is invalid');
249
+ }
250
+
251
+ str += '; Expires=' + expires.toUTCString();
252
+ }
253
+
254
+ if (opt.httpOnly) {
255
+ str += '; HttpOnly';
256
+ }
257
+
258
+ if (opt.secure) {
259
+ str += '; Secure';
260
+ }
261
+
262
+ if (opt.partitioned) {
263
+ str += '; Partitioned';
264
+ }
265
+
266
+ if (opt.priority) {
267
+ var priority = typeof opt.priority === 'string'
268
+ ? opt.priority.toLowerCase() : opt.priority;
269
+
270
+ switch (priority) {
271
+ case 'low':
272
+ str += '; Priority=Low';
273
+ break
274
+ case 'medium':
275
+ str += '; Priority=Medium';
276
+ break
277
+ case 'high':
278
+ str += '; Priority=High';
279
+ break
280
+ default:
281
+ throw new TypeError('option priority is invalid')
282
+ }
283
+ }
284
+
285
+ if (opt.sameSite) {
286
+ var sameSite = typeof opt.sameSite === 'string'
287
+ ? opt.sameSite.toLowerCase() : opt.sameSite;
288
+
289
+ switch (sameSite) {
290
+ case true:
291
+ str += '; SameSite=Strict';
292
+ break;
293
+ case 'lax':
294
+ str += '; SameSite=Lax';
295
+ break;
296
+ case 'strict':
297
+ str += '; SameSite=Strict';
298
+ break;
299
+ case 'none':
300
+ str += '; SameSite=None';
301
+ break;
302
+ default:
303
+ throw new TypeError('option sameSite is invalid');
304
+ }
305
+ }
306
+
307
+ return str;
308
+ }
309
+
310
+ /**
311
+ * URL-decode string value. Optimized to skip native call when no %.
312
+ *
313
+ * @param {string} str
314
+ * @returns {string}
315
+ */
316
+
317
+ function decode (str) {
318
+ return str.indexOf('%') !== -1
319
+ ? decodeURIComponent(str)
320
+ : str
321
+ }
322
+
323
+ /**
324
+ * Determine if value is a Date.
325
+ *
326
+ * @param {*} val
327
+ * @private
328
+ */
329
+
330
+ function isDate (val) {
331
+ return __toString.call(val) === '[object Date]';
332
+ }
333
+
334
+ /**
335
+ * Try decoding a string using a decoding function.
336
+ *
337
+ * @param {string} str
338
+ * @param {function} decode
339
+ * @private
340
+ */
341
+
342
+ function tryDecode(str, decode) {
343
+ try {
344
+ return decode(str);
345
+ } catch (e) {
346
+ return str;
347
+ }
348
+ }
349
+ return cookie;
350
+ }
351
+
352
+ var cookieExports = requireCookie();
353
+
354
+ function hasDocumentCookie() {
355
+ const testingValue = typeof global === 'undefined'
356
+ ? undefined
357
+ : global.TEST_HAS_DOCUMENT_COOKIE;
358
+ if (typeof testingValue === 'boolean') {
359
+ return testingValue;
360
+ }
361
+ // Can we get/set cookies on document.cookie?
362
+ return typeof document === 'object' && typeof document.cookie === 'string';
363
+ }
364
+ function parseCookies(cookies) {
365
+ if (typeof cookies === 'string') {
366
+ return cookieExports.parse(cookies);
367
+ }
368
+ else if (typeof cookies === 'object' && cookies !== null) {
369
+ return cookies;
370
+ }
371
+ else {
372
+ return {};
373
+ }
374
+ }
375
+ function readCookie(value, options = {}) {
376
+ const cleanValue = cleanupCookieValue(value);
377
+ if (!options.doNotParse) {
378
+ try {
379
+ return JSON.parse(cleanValue);
380
+ }
381
+ catch (e) {
382
+ // At least we tried
383
+ }
384
+ }
385
+ // Ignore clean value if we failed the deserialization
386
+ // It is not relevant anymore to trim those values
387
+ return value;
388
+ }
389
+ function cleanupCookieValue(value) {
390
+ // express prepend j: before serializing a cookie
391
+ if (value && value[0] === 'j' && value[1] === ':') {
392
+ return value.substr(2);
393
+ }
394
+ return value;
395
+ }
396
+
397
+ class Cookies {
398
+ constructor(cookies, defaultSetOptions = {}) {
399
+ this.changeListeners = [];
400
+ this.HAS_DOCUMENT_COOKIE = false;
401
+ this.update = () => {
402
+ if (!this.HAS_DOCUMENT_COOKIE) {
403
+ return;
404
+ }
405
+ const previousCookies = this.cookies;
406
+ this.cookies = cookieExports.parse(document.cookie);
407
+ this._checkChanges(previousCookies);
408
+ };
409
+ const domCookies = typeof document === 'undefined' ? '' : document.cookie;
410
+ this.cookies = parseCookies(cookies || domCookies);
411
+ this.defaultSetOptions = defaultSetOptions;
412
+ this.HAS_DOCUMENT_COOKIE = hasDocumentCookie();
413
+ }
414
+ _emitChange(params) {
415
+ for (let i = 0; i < this.changeListeners.length; ++i) {
416
+ this.changeListeners[i](params);
417
+ }
418
+ }
419
+ _checkChanges(previousCookies) {
420
+ const names = new Set(Object.keys(previousCookies).concat(Object.keys(this.cookies)));
421
+ names.forEach((name) => {
422
+ if (previousCookies[name] !== this.cookies[name]) {
423
+ this._emitChange({
424
+ name,
425
+ value: readCookie(this.cookies[name]),
426
+ });
427
+ }
428
+ });
429
+ }
430
+ _startPolling() {
431
+ this.pollingInterval = setInterval(this.update, 300);
432
+ }
433
+ _stopPolling() {
434
+ if (this.pollingInterval) {
435
+ clearInterval(this.pollingInterval);
436
+ }
437
+ }
438
+ get(name, options = {}) {
439
+ if (!options.doNotUpdate) {
440
+ this.update();
441
+ }
442
+ return readCookie(this.cookies[name], options);
443
+ }
444
+ getAll(options = {}) {
445
+ if (!options.doNotUpdate) {
446
+ this.update();
447
+ }
448
+ const result = {};
449
+ for (let name in this.cookies) {
450
+ result[name] = readCookie(this.cookies[name], options);
451
+ }
452
+ return result;
453
+ }
454
+ set(name, value, options) {
455
+ if (options) {
456
+ options = Object.assign(Object.assign({}, this.defaultSetOptions), options);
457
+ }
458
+ else {
459
+ options = this.defaultSetOptions;
460
+ }
461
+ const stringValue = typeof value === 'string' ? value : JSON.stringify(value);
462
+ this.cookies = Object.assign(Object.assign({}, this.cookies), { [name]: stringValue });
463
+ if (this.HAS_DOCUMENT_COOKIE) {
464
+ document.cookie = cookieExports.serialize(name, stringValue, options);
465
+ }
466
+ this._emitChange({ name, value, options });
467
+ }
468
+ remove(name, options) {
469
+ const finalOptions = (options = Object.assign(Object.assign(Object.assign({}, this.defaultSetOptions), options), { expires: new Date(1970, 1, 1, 0, 0, 1), maxAge: 0 }));
470
+ this.cookies = Object.assign({}, this.cookies);
471
+ delete this.cookies[name];
472
+ if (this.HAS_DOCUMENT_COOKIE) {
473
+ document.cookie = cookieExports.serialize(name, '', finalOptions);
474
+ }
475
+ this._emitChange({ name, value: undefined, options });
476
+ }
477
+ addChangeListener(callback) {
478
+ this.changeListeners.push(callback);
479
+ if (this.HAS_DOCUMENT_COOKIE && this.changeListeners.length === 1) {
480
+ if (typeof window === 'object' && 'cookieStore' in window) {
481
+ window.cookieStore.addEventListener('change', this.update);
482
+ }
483
+ else {
484
+ this._startPolling();
485
+ }
486
+ }
487
+ }
488
+ removeChangeListener(callback) {
489
+ const idx = this.changeListeners.indexOf(callback);
490
+ if (idx >= 0) {
491
+ this.changeListeners.splice(idx, 1);
492
+ }
493
+ if (this.HAS_DOCUMENT_COOKIE && this.changeListeners.length === 0) {
494
+ if (typeof window === 'object' && 'cookieStore' in window) {
495
+ window.cookieStore.removeEventListener('change', this.update);
496
+ }
497
+ else {
498
+ this._stopPolling();
499
+ }
500
+ }
501
+ }
502
+ }
503
+
504
+ const COOKIE_VALID_DAYS = 1; // 0 = Session cookie
505
+
506
+ // CookieHelper is a class that takes in and lets us pass around the methods provided
507
+ // by `useCookie` react hook in backend code that is connected to the universal-cookies
508
+ // instance created in SSR middleware (and provides browser cookies)
509
+ class CookieHelper {
510
+ get raw() {
511
+ return this.cookies;
512
+ }
513
+ get cookie() {
514
+ return this.set ? this : this.fallback;
515
+ }
516
+ constructor(cookies, setCookie, removeCookie, updateCookies) {
517
+ // Add fallback methods if global cookies not supplied
518
+ if (!cookies || !setCookie || !removeCookie) this.fallback = new Cookies();
519
+ this.cookies = cookies || this.fallback.getAll();
520
+ if (setCookie) this.set = setCookie;
521
+ if (removeCookie) this.remove = removeCookie;
522
+ if (updateCookies) this.update = updateCookies;
523
+ }
524
+ GetCookie(name) {
525
+ const cookie = this.cookies[name];
526
+ if (typeof cookie === 'undefined') {
527
+ return null;
528
+ }
529
+ return cookie;
530
+ }
531
+ SetCookie(name, value, maxAgeDays = COOKIE_VALID_DAYS) {
532
+ // update local cookies object as this is provided as a clone of `req.universalCookies`
533
+ this.cookies[name] = value;
534
+
535
+ // call the passed setCookie method so we can update the `universal-cookie` instance
536
+ // with the change listener attached so the cookies can be set in SSR response
537
+ if (maxAgeDays === 0) this.cookie.set(name, value);else this.cookie.set(name, value, {
538
+ expires: addDays(new Date(), maxAgeDays),
539
+ path: '/'
540
+ });
541
+ }
542
+ DeleteCookie(name) {
543
+ // update local cookies object as this is provided as a clone of `req.universalCookies`
544
+ delete this.cookies[name];
545
+ this.cookie.remove(name, {
546
+ path: '/'
547
+ });
548
+ }
549
+ }
550
+ const addDays = (date = new Date(), days) => {
551
+ const result = new Date(date);
552
+ result.setDate(result.getDate() + days);
553
+ return result;
554
+ };
555
+
556
+ exports.BEARER_TOKEN_COOKIE = BEARER_TOKEN_COOKIE;
557
+ exports.CookieHelper = CookieHelper;
558
+ exports.Cookies = Cookies;
559
+ exports.LOGIN_COOKIE = LOGIN_COOKIE;
560
+ exports.REFRESH_TOKEN_COOKIE = REFRESH_TOKEN_COOKIE;
561
+ exports.findLoginCookies = findLoginCookies;
562
+ //# sourceMappingURL=CookieHelper.class-BoY5TrIi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CookieHelper.class-BoY5TrIi.js","sources":["../src/user/util/CookieConstants.ts","../node_modules/universal-cookie/esm/index.mjs","../src/user/util/CookieHelper.class.ts"],"sourcesContent":["export const BEARER_TOKEN_COOKIE = 'ContensisSecurityBearerToken';\nexport const LOGIN_COOKIE = 'ContensisCMSUserName';\nexport const REFRESH_TOKEN_COOKIE = 'RefreshToken';\n\nexport type CookieObject = { [name: string]: any };\n\nexport const findLoginCookies = (cookies: CookieObject | string) =>\n typeof cookies === 'object'\n ? Object.fromEntries(\n Object.entries(cookies).filter(([name]) =>\n [LOGIN_COOKIE, REFRESH_TOKEN_COOKIE].includes(name)\n )\n )\n : cookies;\n","var cookie = {};\n\n/*!\n * cookie\n * Copyright(c) 2012-2014 Roman Shtylman\n * Copyright(c) 2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\nvar hasRequiredCookie;\n\nfunction requireCookie () {\n\tif (hasRequiredCookie) return cookie;\n\thasRequiredCookie = 1;\n\n\t/**\n\t * Module exports.\n\t * @public\n\t */\n\n\tcookie.parse = parse;\n\tcookie.serialize = serialize;\n\n\t/**\n\t * Module variables.\n\t * @private\n\t */\n\n\tvar __toString = Object.prototype.toString;\n\tvar __hasOwnProperty = Object.prototype.hasOwnProperty;\n\n\t/**\n\t * RegExp to match cookie-name in RFC 6265 sec 4.1.1\n\t * This refers out to the obsoleted definition of token in RFC 2616 sec 2.2\n\t * which has been replaced by the token definition in RFC 7230 appendix B.\n\t *\n\t * cookie-name = token\n\t * token = 1*tchar\n\t * tchar = \"!\" / \"#\" / \"$\" / \"%\" / \"&\" / \"'\" /\n\t * \"*\" / \"+\" / \"-\" / \".\" / \"^\" / \"_\" /\n\t * \"`\" / \"|\" / \"~\" / DIGIT / ALPHA\n\t */\n\n\tvar cookieNameRegExp = /^[!#$%&'*+\\-.^_`|~0-9A-Za-z]+$/;\n\n\t/**\n\t * RegExp to match cookie-value in RFC 6265 sec 4.1.1\n\t *\n\t * cookie-value = *cookie-octet / ( DQUOTE *cookie-octet DQUOTE )\n\t * cookie-octet = %x21 / %x23-2B / %x2D-3A / %x3C-5B / %x5D-7E\n\t * ; US-ASCII characters excluding CTLs,\n\t * ; whitespace DQUOTE, comma, semicolon,\n\t * ; and backslash\n\t */\n\n\tvar cookieValueRegExp = /^(\"?)[\\u0021\\u0023-\\u002B\\u002D-\\u003A\\u003C-\\u005B\\u005D-\\u007E]*\\1$/;\n\n\t/**\n\t * RegExp to match domain-value in RFC 6265 sec 4.1.1\n\t *\n\t * domain-value = <subdomain>\n\t * ; defined in [RFC1034], Section 3.5, as\n\t * ; enhanced by [RFC1123], Section 2.1\n\t * <subdomain> = <label> | <subdomain> \".\" <label>\n\t * <label> = <let-dig> [ [ <ldh-str> ] <let-dig> ]\n\t * Labels must be 63 characters or less.\n\t * 'let-dig' not 'letter' in the first char, per RFC1123\n\t * <ldh-str> = <let-dig-hyp> | <let-dig-hyp> <ldh-str>\n\t * <let-dig-hyp> = <let-dig> | \"-\"\n\t * <let-dig> = <letter> | <digit>\n\t * <letter> = any one of the 52 alphabetic characters A through Z in\n\t * upper case and a through z in lower case\n\t * <digit> = any one of the ten digits 0 through 9\n\t *\n\t * Keep support for leading dot: https://github.com/jshttp/cookie/issues/173\n\t *\n\t * > (Note that a leading %x2E (\".\"), if present, is ignored even though that\n\t * character is not permitted, but a trailing %x2E (\".\"), if present, will\n\t * cause the user agent to ignore the attribute.)\n\t */\n\n\tvar domainValueRegExp = /^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i;\n\n\t/**\n\t * RegExp to match path-value in RFC 6265 sec 4.1.1\n\t *\n\t * path-value = <any CHAR except CTLs or \";\">\n\t * CHAR = %x01-7F\n\t * ; defined in RFC 5234 appendix B.1\n\t */\n\n\tvar pathValueRegExp = /^[\\u0020-\\u003A\\u003D-\\u007E]*$/;\n\n\t/**\n\t * Parse a cookie header.\n\t *\n\t * Parse the given cookie header string into an object\n\t * The object has the various cookies as keys(names) => values\n\t *\n\t * @param {string} str\n\t * @param {object} [opt]\n\t * @return {object}\n\t * @public\n\t */\n\n\tfunction parse(str, opt) {\n\t if (typeof str !== 'string') {\n\t throw new TypeError('argument str must be a string');\n\t }\n\n\t var obj = {};\n\t var len = str.length;\n\t // RFC 6265 sec 4.1.1, RFC 2616 2.2 defines a cookie name consists of one char minimum, plus '='.\n\t if (len < 2) return obj;\n\n\t var dec = (opt && opt.decode) || decode;\n\t var index = 0;\n\t var eqIdx = 0;\n\t var endIdx = 0;\n\n\t do {\n\t eqIdx = str.indexOf('=', index);\n\t if (eqIdx === -1) break; // No more cookie pairs.\n\n\t endIdx = str.indexOf(';', index);\n\n\t if (endIdx === -1) {\n\t endIdx = len;\n\t } else if (eqIdx > endIdx) {\n\t // backtrack on prior semicolon\n\t index = str.lastIndexOf(';', eqIdx - 1) + 1;\n\t continue;\n\t }\n\n\t var keyStartIdx = startIndex(str, index, eqIdx);\n\t var keyEndIdx = endIndex(str, eqIdx, keyStartIdx);\n\t var key = str.slice(keyStartIdx, keyEndIdx);\n\n\t // only assign once\n\t if (!__hasOwnProperty.call(obj, key)) {\n\t var valStartIdx = startIndex(str, eqIdx + 1, endIdx);\n\t var valEndIdx = endIndex(str, endIdx, valStartIdx);\n\n\t if (str.charCodeAt(valStartIdx) === 0x22 /* \" */ && str.charCodeAt(valEndIdx - 1) === 0x22 /* \" */) {\n\t valStartIdx++;\n\t valEndIdx--;\n\t }\n\n\t var val = str.slice(valStartIdx, valEndIdx);\n\t obj[key] = tryDecode(val, dec);\n\t }\n\n\t index = endIdx + 1;\n\t } while (index < len);\n\n\t return obj;\n\t}\n\n\tfunction startIndex(str, index, max) {\n\t do {\n\t var code = str.charCodeAt(index);\n\t if (code !== 0x20 /* */ && code !== 0x09 /* \\t */) return index;\n\t } while (++index < max);\n\t return max;\n\t}\n\n\tfunction endIndex(str, index, min) {\n\t while (index > min) {\n\t var code = str.charCodeAt(--index);\n\t if (code !== 0x20 /* */ && code !== 0x09 /* \\t */) return index + 1;\n\t }\n\t return min;\n\t}\n\n\t/**\n\t * Serialize data into a cookie header.\n\t *\n\t * Serialize a name value pair into a cookie string suitable for\n\t * http headers. An optional options object specifies cookie parameters.\n\t *\n\t * serialize('foo', 'bar', { httpOnly: true })\n\t * => \"foo=bar; httpOnly\"\n\t *\n\t * @param {string} name\n\t * @param {string} val\n\t * @param {object} [opt]\n\t * @return {string}\n\t * @public\n\t */\n\n\tfunction serialize(name, val, opt) {\n\t var enc = (opt && opt.encode) || encodeURIComponent;\n\n\t if (typeof enc !== 'function') {\n\t throw new TypeError('option encode is invalid');\n\t }\n\n\t if (!cookieNameRegExp.test(name)) {\n\t throw new TypeError('argument name is invalid');\n\t }\n\n\t var value = enc(val);\n\n\t if (!cookieValueRegExp.test(value)) {\n\t throw new TypeError('argument val is invalid');\n\t }\n\n\t var str = name + '=' + value;\n\t if (!opt) return str;\n\n\t if (null != opt.maxAge) {\n\t var maxAge = Math.floor(opt.maxAge);\n\n\t if (!isFinite(maxAge)) {\n\t throw new TypeError('option maxAge is invalid')\n\t }\n\n\t str += '; Max-Age=' + maxAge;\n\t }\n\n\t if (opt.domain) {\n\t if (!domainValueRegExp.test(opt.domain)) {\n\t throw new TypeError('option domain is invalid');\n\t }\n\n\t str += '; Domain=' + opt.domain;\n\t }\n\n\t if (opt.path) {\n\t if (!pathValueRegExp.test(opt.path)) {\n\t throw new TypeError('option path is invalid');\n\t }\n\n\t str += '; Path=' + opt.path;\n\t }\n\n\t if (opt.expires) {\n\t var expires = opt.expires;\n\n\t if (!isDate(expires) || isNaN(expires.valueOf())) {\n\t throw new TypeError('option expires is invalid');\n\t }\n\n\t str += '; Expires=' + expires.toUTCString();\n\t }\n\n\t if (opt.httpOnly) {\n\t str += '; HttpOnly';\n\t }\n\n\t if (opt.secure) {\n\t str += '; Secure';\n\t }\n\n\t if (opt.partitioned) {\n\t str += '; Partitioned';\n\t }\n\n\t if (opt.priority) {\n\t var priority = typeof opt.priority === 'string'\n\t ? opt.priority.toLowerCase() : opt.priority;\n\n\t switch (priority) {\n\t case 'low':\n\t str += '; Priority=Low';\n\t break\n\t case 'medium':\n\t str += '; Priority=Medium';\n\t break\n\t case 'high':\n\t str += '; Priority=High';\n\t break\n\t default:\n\t throw new TypeError('option priority is invalid')\n\t }\n\t }\n\n\t if (opt.sameSite) {\n\t var sameSite = typeof opt.sameSite === 'string'\n\t ? opt.sameSite.toLowerCase() : opt.sameSite;\n\n\t switch (sameSite) {\n\t case true:\n\t str += '; SameSite=Strict';\n\t break;\n\t case 'lax':\n\t str += '; SameSite=Lax';\n\t break;\n\t case 'strict':\n\t str += '; SameSite=Strict';\n\t break;\n\t case 'none':\n\t str += '; SameSite=None';\n\t break;\n\t default:\n\t throw new TypeError('option sameSite is invalid');\n\t }\n\t }\n\n\t return str;\n\t}\n\n\t/**\n\t * URL-decode string value. Optimized to skip native call when no %.\n\t *\n\t * @param {string} str\n\t * @returns {string}\n\t */\n\n\tfunction decode (str) {\n\t return str.indexOf('%') !== -1\n\t ? decodeURIComponent(str)\n\t : str\n\t}\n\n\t/**\n\t * Determine if value is a Date.\n\t *\n\t * @param {*} val\n\t * @private\n\t */\n\n\tfunction isDate (val) {\n\t return __toString.call(val) === '[object Date]';\n\t}\n\n\t/**\n\t * Try decoding a string using a decoding function.\n\t *\n\t * @param {string} str\n\t * @param {function} decode\n\t * @private\n\t */\n\n\tfunction tryDecode(str, decode) {\n\t try {\n\t return decode(str);\n\t } catch (e) {\n\t return str;\n\t }\n\t}\n\treturn cookie;\n}\n\nvar cookieExports = requireCookie();\n\nfunction hasDocumentCookie() {\n const testingValue = typeof global === 'undefined'\n ? undefined\n : global.TEST_HAS_DOCUMENT_COOKIE;\n if (typeof testingValue === 'boolean') {\n return testingValue;\n }\n // Can we get/set cookies on document.cookie?\n return typeof document === 'object' && typeof document.cookie === 'string';\n}\nfunction parseCookies(cookies) {\n if (typeof cookies === 'string') {\n return cookieExports.parse(cookies);\n }\n else if (typeof cookies === 'object' && cookies !== null) {\n return cookies;\n }\n else {\n return {};\n }\n}\nfunction readCookie(value, options = {}) {\n const cleanValue = cleanupCookieValue(value);\n if (!options.doNotParse) {\n try {\n return JSON.parse(cleanValue);\n }\n catch (e) {\n // At least we tried\n }\n }\n // Ignore clean value if we failed the deserialization\n // It is not relevant anymore to trim those values\n return value;\n}\nfunction cleanupCookieValue(value) {\n // express prepend j: before serializing a cookie\n if (value && value[0] === 'j' && value[1] === ':') {\n return value.substr(2);\n }\n return value;\n}\n\nclass Cookies {\n constructor(cookies, defaultSetOptions = {}) {\n this.changeListeners = [];\n this.HAS_DOCUMENT_COOKIE = false;\n this.update = () => {\n if (!this.HAS_DOCUMENT_COOKIE) {\n return;\n }\n const previousCookies = this.cookies;\n this.cookies = cookieExports.parse(document.cookie);\n this._checkChanges(previousCookies);\n };\n const domCookies = typeof document === 'undefined' ? '' : document.cookie;\n this.cookies = parseCookies(cookies || domCookies);\n this.defaultSetOptions = defaultSetOptions;\n this.HAS_DOCUMENT_COOKIE = hasDocumentCookie();\n }\n _emitChange(params) {\n for (let i = 0; i < this.changeListeners.length; ++i) {\n this.changeListeners[i](params);\n }\n }\n _checkChanges(previousCookies) {\n const names = new Set(Object.keys(previousCookies).concat(Object.keys(this.cookies)));\n names.forEach((name) => {\n if (previousCookies[name] !== this.cookies[name]) {\n this._emitChange({\n name,\n value: readCookie(this.cookies[name]),\n });\n }\n });\n }\n _startPolling() {\n this.pollingInterval = setInterval(this.update, 300);\n }\n _stopPolling() {\n if (this.pollingInterval) {\n clearInterval(this.pollingInterval);\n }\n }\n get(name, options = {}) {\n if (!options.doNotUpdate) {\n this.update();\n }\n return readCookie(this.cookies[name], options);\n }\n getAll(options = {}) {\n if (!options.doNotUpdate) {\n this.update();\n }\n const result = {};\n for (let name in this.cookies) {\n result[name] = readCookie(this.cookies[name], options);\n }\n return result;\n }\n set(name, value, options) {\n if (options) {\n options = Object.assign(Object.assign({}, this.defaultSetOptions), options);\n }\n else {\n options = this.defaultSetOptions;\n }\n const stringValue = typeof value === 'string' ? value : JSON.stringify(value);\n this.cookies = Object.assign(Object.assign({}, this.cookies), { [name]: stringValue });\n if (this.HAS_DOCUMENT_COOKIE) {\n document.cookie = cookieExports.serialize(name, stringValue, options);\n }\n this._emitChange({ name, value, options });\n }\n remove(name, options) {\n const finalOptions = (options = Object.assign(Object.assign(Object.assign({}, this.defaultSetOptions), options), { expires: new Date(1970, 1, 1, 0, 0, 1), maxAge: 0 }));\n this.cookies = Object.assign({}, this.cookies);\n delete this.cookies[name];\n if (this.HAS_DOCUMENT_COOKIE) {\n document.cookie = cookieExports.serialize(name, '', finalOptions);\n }\n this._emitChange({ name, value: undefined, options });\n }\n addChangeListener(callback) {\n this.changeListeners.push(callback);\n if (this.HAS_DOCUMENT_COOKIE && this.changeListeners.length === 1) {\n if (typeof window === 'object' && 'cookieStore' in window) {\n window.cookieStore.addEventListener('change', this.update);\n }\n else {\n this._startPolling();\n }\n }\n }\n removeChangeListener(callback) {\n const idx = this.changeListeners.indexOf(callback);\n if (idx >= 0) {\n this.changeListeners.splice(idx, 1);\n }\n if (this.HAS_DOCUMENT_COOKIE && this.changeListeners.length === 0) {\n if (typeof window === 'object' && 'cookieStore' in window) {\n window.cookieStore.removeEventListener('change', this.update);\n }\n else {\n this._stopPolling();\n }\n }\n }\n}\n\nexport { Cookies as default };\n","import { useCookies } from 'react-cookie';\nimport FallbackCookies from 'universal-cookie';\n\nconst COOKIE_VALID_DAYS = 1; // 0 = Session cookie\n\ntype CookieHook = ReturnType<typeof useCookies>;\ntype Cookies = { [k: string]: string };\ntype SetCookie = CookieHook[1];\ntype RemoveCookie = CookieHook[2];\ntype UpdateCookie = CookieHook[3];\n\n// CookieHelper is a class that takes in and lets us pass around the methods provided\n// by `useCookie` react hook in backend code that is connected to the universal-cookies\n// instance created in SSR middleware (and provides browser cookies)\nexport class CookieHelper {\n private cookies: Cookies;\n private set?: SetCookie;\n private remove?: RemoveCookie;\n private update?: UpdateCookie;\n private fallback!: FallbackCookies;\n\n get raw() {\n return this.cookies;\n }\n\n get cookie(): FallbackCookies {\n return (this.set ? this : this.fallback) as FallbackCookies;\n }\n\n constructor(\n cookies?: { [k: string]: string },\n setCookie?: CookieHelper['set'],\n removeCookie?: CookieHelper['remove'],\n updateCookies?: CookieHelper['update']\n ) {\n // Add fallback methods if global cookies not supplied\n if (!cookies || !setCookie || !removeCookie)\n this.fallback = new FallbackCookies();\n\n this.cookies = cookies || this.fallback.getAll();\n if (setCookie) this.set = setCookie;\n if (removeCookie) this.remove = removeCookie;\n if (updateCookies) this.update = updateCookies;\n }\n\n GetCookie(name: string) {\n const cookie = this.cookies[name];\n if (typeof cookie === 'undefined') {\n return null;\n }\n return cookie;\n }\n\n SetCookie(name: string, value: string, maxAgeDays = COOKIE_VALID_DAYS) {\n // update local cookies object as this is provided as a clone of `req.universalCookies`\n this.cookies[name] = value;\n\n // call the passed setCookie method so we can update the `universal-cookie` instance\n // with the change listener attached so the cookies can be set in SSR response\n if (maxAgeDays === 0) this.cookie.set(name, value);\n else\n this.cookie.set(name, value, {\n expires: addDays(new Date(), maxAgeDays),\n path: '/',\n });\n }\n\n DeleteCookie(name: string) {\n // update local cookies object as this is provided as a clone of `req.universalCookies`\n delete this.cookies[name];\n\n this.cookie.remove(name, {\n path: '/',\n });\n }\n}\nconst addDays = (date = new Date(), days: number) => {\n const result = new Date(date);\n result.setDate(result.getDate() + days);\n return result;\n};\n\nexport const mapCookieHeader = cookies =>\n typeof cookies === 'object'\n ? Object.entries(cookies)\n .map(([name, value]) => `${name}=${value}`)\n .join('; ')\n : cookies;\n"],"names":["BEARER_TOKEN_COOKIE","LOGIN_COOKIE","REFRESH_TOKEN_COOKIE","findLoginCookies","cookies","Object","fromEntries","entries","filter","name","includes","COOKIE_VALID_DAYS","CookieHelper","raw","cookie","set","fallback","constructor","setCookie","removeCookie","updateCookies","FallbackCookies","getAll","remove","update","GetCookie","SetCookie","value","maxAgeDays","expires","addDays","Date","path","DeleteCookie","date","days","result","setDate","getDate"],"mappings":";;AAAO,MAAMA,mBAAmB,GAAG;AAC5B,MAAMC,YAAY,GAAG;AACrB,MAAMC,oBAAoB,GAAG;MAIvBC,gBAAgB,GAAIC,OAA8B,IAC7D,OAAOA,OAAO,KAAK,QAAQ,GACvBC,MAAM,CAACC,WAAW,CAChBD,MAAM,CAACE,OAAO,CAACH,OAAO,CAAC,CAACI,MAAM,CAAC,CAAC,CAACC,IAAI,CAAC,KACpC,CAACR,YAAY,EAAEC,oBAAoB,CAAC,CAACQ,QAAQ,CAACD,IAAI,CACpD,CACF,CAAC,GACDL;;ACbN,IAAI,MAAM,GAAG,EAAE;;AAEf;AACA;AACA;AACA;AACA;AACA;;AAEA,IAAI,iBAAiB;;AAErB,SAAS,aAAa,IAAI;AAC1B,CAAC,IAAI,iBAAiB,EAAE,OAAO,MAAM;AACrC,CAAC,iBAAiB,GAAG,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