@patientos/website-kit 0.2.0 → 0.2.1

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.
@@ -133,11 +133,17 @@ async function signOutOfPortal(fetchImpl) {
133
133
  return { ok: res.ok };
134
134
  }
135
135
  var PORTAL_RETURN_PATH = "/portal/return";
136
+ function encodeReturnTarget(url) {
137
+ const bytes = new TextEncoder().encode(url);
138
+ let binary = "";
139
+ for (const b of bytes) binary += String.fromCharCode(b);
140
+ return btoa(binary).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
141
+ }
136
142
  function currentPagePath() {
137
143
  if (typeof window === "undefined") return "/";
138
- const path = `${window.location.pathname || "/"}${window.location.search}`;
144
+ const path = `${window.location.pathname || "/"}${window.location.search}${window.location.hash}`;
139
145
  if (!apiOrigin) return path;
140
- return `${PORTAL_RETURN_PATH}?to=${encodeURIComponent(window.location.origin + path)}`;
146
+ return `${PORTAL_RETURN_PATH}?to=${encodeReturnTarget(window.location.origin + path)}`;
141
147
  }
142
148
  var LOCALE = "en-AU";
143
149
  function parseInstant(iso) {
@@ -6,7 +6,7 @@ import {
6
6
  PortalAccountClient,
7
7
  PortalPanelClient,
8
8
  StoreClient
9
- } from "./chunk-CRCCBM4F.js";
9
+ } from "./chunk-EO64UB5F.js";
10
10
  import {
11
11
  mountIslandsWith
12
12
  } from "./chunk-THMT43MV.js";
@@ -66,7 +66,7 @@ import {
66
66
  signOutOfPortal,
67
67
  writePortalSignedInHint,
68
68
  zoneAbbr
69
- } from "./chunk-TMW4R76E.js";
69
+ } from "./chunk-BW7YKCKH.js";
70
70
  import {
71
71
  __export
72
72
  } from "./chunk-MLKGABMK.js";
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  ISLANDS,
3
3
  mountIslands
4
- } from "./chunk-RUCVZ2C3.js";
4
+ } from "./chunk-CRYD7EXD.js";
5
5
  import {
6
6
  PortalAccount,
7
7
  PortalPanel,
@@ -10,7 +10,7 @@ import {
10
10
  getPublicApi,
11
11
  getServices,
12
12
  getThemeTokens
13
- } from "./chunk-CRCCBM4F.js";
13
+ } from "./chunk-EO64UB5F.js";
14
14
  import {
15
15
  BPOINT_SCRIPT_ORIGIN,
16
16
  BPOINT_SCRIPT_URL,
@@ -30,7 +30,7 @@ import {
30
30
  mountIslandsWith,
31
31
  readIslandProps
32
32
  } from "./chunk-THMT43MV.js";
33
- import "./chunk-TMW4R76E.js";
33
+ import "./chunk-BW7YKCKH.js";
34
34
  import {
35
35
  contrastRatio,
36
36
  deriveForeground,
@@ -6,11 +6,11 @@ import {
6
6
  PortalAccountClient,
7
7
  PortalPanelClient,
8
8
  StoreClient
9
- } from "./chunk-CRCCBM4F.js";
9
+ } from "./chunk-EO64UB5F.js";
10
10
  import "./chunk-ZOF22TJA.js";
11
11
  import "./chunk-QDO3SJWR.js";
12
12
  import "./chunk-THMT43MV.js";
13
- import "./chunk-TMW4R76E.js";
13
+ import "./chunk-BW7YKCKH.js";
14
14
  import "./chunk-MLKGABMK.js";
15
15
  export {
16
16
  BookingBlockClient,
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  ISLANDS,
3
3
  mountIslands
4
- } from "./chunk-RUCVZ2C3.js";
5
- import "./chunk-CRCCBM4F.js";
4
+ } from "./chunk-CRYD7EXD.js";
5
+ import "./chunk-EO64UB5F.js";
6
6
  import "./chunk-ZOF22TJA.js";
7
7
  import "./chunk-QDO3SJWR.js";
8
8
  import "./chunk-THMT43MV.js";
9
- import "./chunk-TMW4R76E.js";
9
+ import "./chunk-BW7YKCKH.js";
10
10
  import "./chunk-MLKGABMK.js";
11
11
  export {
12
12
  ISLANDS,
@@ -22,7 +22,7 @@ import {
22
22
  releasePortalHold,
23
23
  rescheduleContextTypeId,
24
24
  reschedulePortalAppointmentAndReload
25
- } from "./chunk-TMW4R76E.js";
25
+ } from "./chunk-BW7YKCKH.js";
26
26
  import "./chunk-MLKGABMK.js";
27
27
  export {
28
28
  AVAILABILITY_FAILED_COPY,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@patientos/website-kit",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "PatientOS clinic website components and patient-facing interactive islands.",
5
5
  "type": "module",
6
6
  "sideEffects": [