@eka-care/medassist-widget-embed 0.2.115 → 0.2.116-0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -231,6 +231,42 @@ window.addEventListener("eka-medassist:side-panel-push", (e) => {
231
231
  });
232
232
  ```
233
233
 
234
+ ## Client tools
235
+
236
+ Give the agent functions that run **in your page** (read or edit your app's state). The page declares them; the backend tells the LLM they exist; when the LLM calls one, the SDK runs your `run` and sends the result back. Declarations follow MCP's `Tool` shape; only `name / description / inputSchema / outputSchema / annotations` leave the page — `run` never does.
237
+
238
+ ```js
239
+ EkaMedAssist.init({
240
+ agentId: "<agent-id>",
241
+ tools: [
242
+ {
243
+ name: "read_note",
244
+ description: "Read the note the user has open.",
245
+ inputSchema: { type: "object", properties: { section_keys: { type: "array", items: { type: "string" } } } },
246
+ annotations: { title: "Reading the note", readOnlyHint: true },
247
+ run: async (input, ctx) => {
248
+ ctx.progress({ message: "Collecting sections…" });
249
+ return { sections: getSections(input.section_keys) }; // plain object → structured result
250
+ },
251
+ },
252
+ ],
253
+ });
254
+
255
+ // Replace the list at any time (before or after the widget opens):
256
+ EkaMedAssist.registerTools([...]);
257
+ ```
258
+
259
+ Rules:
260
+
261
+ - `run` must read live page state at call time — tools are registered once and reused.
262
+ - Return a plain object (becomes `structuredContent`) or a full MCP `CallToolResult`.
263
+ - Report a failure the model should handle by throwing an `Error` with `code` (string) and optional `data` (object); it becomes `{ isError: true, structuredContent: { code, message, ...data } }`.
264
+ - `annotations.title` is the label shown while the tool runs; `ctx.progress({ message })` updates it live.
265
+ - `ctx.signal` aborts on timeout (`timeoutMs`, default 30 s), server cancel, or session end.
266
+ - Not supported in the iframe embed (functions cannot cross frames).
267
+
268
+ Protocol details: `docs/client-tools-plan.md` in the repo.
269
+
234
270
  ## How it works
235
271
 
236
272
  1. **Initial load** – The script registers the custom element `<eka-medassist-widget>`.
@@ -18,7 +18,7 @@
18
18
  CORS mode — the browser would download it twice. -->
19
19
  <link
20
20
  rel="modulepreload"
21
- href="https://cdn.jsdelivr.net/npm/@eka-care/medassist-widget@0.1.137/dist/medassist-widget.js"
21
+ href="https://cdn.jsdelivr.net/npm/@eka-care/medassist-widget@0.1.138-0/dist/medassist-widget.js"
22
22
  fetchpriority="high"
23
23
  crossorigin
24
24
  />
@@ -27,14 +27,14 @@
27
27
  <link
28
28
  rel="preload"
29
29
  as="style"
30
- href="https://cdn.jsdelivr.net/npm/@eka-care/medassist-widget@0.1.137/dist/medassist-widget.css"
30
+ href="https://cdn.jsdelivr.net/npm/@eka-care/medassist-widget@0.1.138-0/dist/medassist-widget.css"
31
31
  onload="this.rel='stylesheet'"
32
32
  crossorigin
33
33
  />
34
34
  <noscript>
35
35
  <link
36
36
  rel="stylesheet"
37
- href="https://cdn.jsdelivr.net/npm/@eka-care/medassist-widget@0.1.137/dist/medassist-widget.css"
37
+ href="https://cdn.jsdelivr.net/npm/@eka-care/medassist-widget@0.1.138-0/dist/medassist-widget.css"
38
38
  />
39
39
  </noscript>
40
40
 
@@ -149,7 +149,7 @@
149
149
  window.renderMedAssist would never be set. -->
150
150
  <script
151
151
  type="module"
152
- src="https://cdn.jsdelivr.net/npm/@eka-care/medassist-widget@0.1.137/dist/medassist-widget.js"
152
+ src="https://cdn.jsdelivr.net/npm/@eka-care/medassist-widget@0.1.138-0/dist/medassist-widget.js"
153
153
  onload="init()"
154
154
  fetchpriority="high"
155
155
  crossorigin
package/dist/iframe.js CHANGED
@@ -1 +1 @@
1
- "use strict";(function(){const $=()=>{if(typeof document=="undefined")return null;const{currentScript:e}=document;if(e instanceof HTMLScriptElement)return e;const t=document.getElementsByTagName("script");return t.length?t[t.length-1]:null},C=e=>{if(e==="production"||e==="development"||e==="staging")return e};function z(e){if(!e)return;const t=e.mode==="dark"?"white":e.mode==="light"?"black":void 0;return{...e.background&&{background:e.background},...e.background_img&&{backgroundImage:e.background_img},...e.accent&&{primary:e.accent},...t&&{textColor:t},...e.mode&&{mode:e.mode},...e.header_tinted!==void 0&&{headerTinted:e.header_tinted},...e.title_img&&{titleImg:e.title_img},...e.tagline&&{tagline:e.tagline},...e.consent_content&&{consentContent:e.consent_content},...e.feature!==void 0&&{feature:e.feature}}}function S(e){if(!(!e||typeof document=="undefined"))try{const t=document.createElement("link");t.rel="preload",t.as="image",t.href=e,document.head.appendChild(t)}catch{const t=new Image;t.src=e}}async function F(e,t,r){var n;try{return await h(),await((n=window.fetchAgentConfig)===null||n===void 0?void 0:n.call(window,{agentId:t,serverUrl:e,environment:r,channel:"web"}))}catch{return}}const U="https://cdn.jsdelivr.net/npm/@eka-care/medassist-widget@0.1.137/dist/",s=$(),b=(()=>{if(!s)return"";try{return new URL(".",s.src||window.location.href).href}catch{return""}})(),u=(()=>{if(!s)return U;const e=s.dataset.widgetAssets;if(e==="local")return`${b}src/`;if(e&&e.length>0)try{return new URL(e,b).href}catch{return e.endsWith("/")?e:`${e}/`}return U})(),a=`${u}medassist-widget.js`,g=`${u}medassist-widget.css`;let m=null,f=null;const i=new URLSearchParams(typeof window!="undefined"?window.location.search:""),A=i.get("agentId"),w=i.get("baseUrl")||"https://matrix.eka.care/reloaded";if(typeof document!="undefined"&&document.head){try{const e=new URL(u).origin,t=new URL(w).origin,r=document.createElement("link");if(r.rel="preconnect",r.href=e,r.crossOrigin="anonymous",document.head.appendChild(r),e!==t){const c=document.createElement("link");c.rel="preconnect",c.href=t,c.crossOrigin="anonymous",document.head.appendChild(c)}const n=document.createElement("link");n.rel="modulepreload",n.href=a,document.head.appendChild(n);const d=document.createElement("link");d.rel="preload",d.as="style",d.href=g,document.head.appendChild(d)}catch{}M(),h()}const L=A&&w?F(w,A,C(i.get("environment"))):Promise.resolve(void 0);if(typeof document!="undefined"&&document.head){const e=i.get("theme");if(e)try{const t=JSON.parse(e);t.backgroundImage&&S(t.backgroundImage)}catch{}L.then(t=>{var r;const n=(r=t==null?void 0:t.theme)===null||r===void 0?void 0:r.background_img;n&&S(n)})}const I=async()=>{var e,t,r,n,d,c,p;const P=i.get("agentId");if(!P){console.error("Agent ID is required in URL parameters");return}let v=i.get("title")||"Medi Clinic",y=i.get("iconUrl")||void 0;const x=i.get("context"),G=i.get("baseUrl")||"https://matrix.eka.care/reloaded",O=i.get("auth-token")||void 0;let k=i.get("resize")==="true"?!0:void 0;const J=(e=C(i.get("environment")))!==null&&e!==void 0?e:"production",_=i.get("connectivity"),N=_==="http_stream"||_==="socket"?_:void 0,E=i.get("theme")?(()=>{try{return JSON.parse(i.get("theme")||"{}")}catch{return}})():void 0,q=document.getElementById("root")||document.body;try{const[,,o]=await Promise.all([M(),h(),L]);if(!(window!=null&&window.renderMedAssist)||typeof(window==null?void 0:window.renderMedAssist)!="function")throw new Error("renderMedAssist is not available on window");let l,W,R,B,D=!1;o&&(v=(t=o==null?void 0:o.name)!==null&&t!==void 0?t:v,y=(n=(r=o==null?void 0:o.theme)===null||r===void 0?void 0:r.icon_img)!==null&&n!==void 0?n:y,l=z((d=o==null?void 0:o.theme)!==null&&d!==void 0?d:void 0),W=o==null?void 0:o.allowed,R=o==null?void 0:o.connectivity,B=o==null?void 0:o.initial_message,D=(p=(c=o==null?void 0:o.theme)===null||c===void 0?void 0:c.hide_watermark)!==null&&p!==void 0?p:!1,k=k||(o==null?void 0:o.resize)||void 0);const H={title:v,iconUrl:y,environment:J,connectionType:R||N||"socket",onClose:()=>{window.parent!==window&&window.parent.postMessage({type:"WIDGET_CLOSE"},"*")},context:x?JSON.parse(x):void 0,baseUrl:G,displayMode:"full",allowed:W,showCloseButton:!1,resize:k,initialMessage:B,hideWatermark:D,...O&&{authToken:O},theme:{...l!=null?l:{},...E!=null?E:{}}};window.renderMedAssist(q,P,H)}catch(o){throw console.error("Failed to initialize MedAssist widget",o),o}};async function M(){document.querySelector("link[data-medassist-style='true']")||(f||(f=new Promise((t,r)=>{const n=document.createElement("link");n.rel="stylesheet",n.href=g,n.setAttribute("data-medassist-style","true"),n.onload=()=>{t("")},n.onerror=()=>{r(new Error(`Failed to load ${g}`))},document.head.appendChild(n)})),await f)}function h(){return m||(m=new Promise((e,t)=>{const r=document.querySelector(`script[src="${a}"]`);if(r){if(r.dataset.loaded==="true"){e();return}r.addEventListener("load",()=>e()),r.addEventListener("error",d=>t(d.error||new Error("Unknown script loading error")));return}const n=document.createElement("script");n.src=a,n.type="module",n.async=!0,n.dataset.widget="medassist",n.onload=()=>{n.dataset.loaded="true",e()},n.onerror=d=>{if(d instanceof ErrorEvent&&d.error){t(d.error);return}t(new Error(`Failed to load ${a}`))},document.head.appendChild(n)})),m}if(typeof document!="undefined")if(document.readyState==="loading")document.addEventListener("DOMContentLoaded",I);else try{I()}catch(e){console.error("Failed to initialize MedAssist widget",e)}})();
1
+ "use strict";(function(){const $=()=>{if(typeof document=="undefined")return null;const{currentScript:e}=document;if(e instanceof HTMLScriptElement)return e;const t=document.getElementsByTagName("script");return t.length?t[t.length-1]:null},C=e=>{if(e==="production"||e==="development"||e==="staging")return e};function z(e){if(!e)return;const t=e.mode==="dark"?"white":e.mode==="light"?"black":void 0;return{...e.background&&{background:e.background},...e.background_img&&{backgroundImage:e.background_img},...e.accent&&{primary:e.accent},...t&&{textColor:t},...e.mode&&{mode:e.mode},...e.header_tinted!==void 0&&{headerTinted:e.header_tinted},...e.title_img&&{titleImg:e.title_img},...e.tagline&&{tagline:e.tagline},...e.consent_content&&{consentContent:e.consent_content},...e.feature!==void 0&&{feature:e.feature}}}function S(e){if(!(!e||typeof document=="undefined"))try{const t=document.createElement("link");t.rel="preload",t.as="image",t.href=e,document.head.appendChild(t)}catch{const t=new Image;t.src=e}}async function F(e,t,r){var n;try{return await h(),await((n=window.fetchAgentConfig)===null||n===void 0?void 0:n.call(window,{agentId:t,serverUrl:e,environment:r,channel:"web"}))}catch{return}}const U="https://cdn.jsdelivr.net/npm/@eka-care/medassist-widget@0.1.138-0/dist/",s=$(),b=(()=>{if(!s)return"";try{return new URL(".",s.src||window.location.href).href}catch{return""}})(),u=(()=>{if(!s)return U;const e=s.dataset.widgetAssets;if(e==="local")return`${b}src/`;if(e&&e.length>0)try{return new URL(e,b).href}catch{return e.endsWith("/")?e:`${e}/`}return U})(),a=`${u}medassist-widget.js`,g=`${u}medassist-widget.css`;let m=null,f=null;const i=new URLSearchParams(typeof window!="undefined"?window.location.search:""),A=i.get("agentId"),w=i.get("baseUrl")||"https://matrix.eka.care/reloaded";if(typeof document!="undefined"&&document.head){try{const e=new URL(u).origin,t=new URL(w).origin,r=document.createElement("link");if(r.rel="preconnect",r.href=e,r.crossOrigin="anonymous",document.head.appendChild(r),e!==t){const c=document.createElement("link");c.rel="preconnect",c.href=t,c.crossOrigin="anonymous",document.head.appendChild(c)}const n=document.createElement("link");n.rel="modulepreload",n.href=a,document.head.appendChild(n);const d=document.createElement("link");d.rel="preload",d.as="style",d.href=g,document.head.appendChild(d)}catch{}M(),h()}const L=A&&w?F(w,A,C(i.get("environment"))):Promise.resolve(void 0);if(typeof document!="undefined"&&document.head){const e=i.get("theme");if(e)try{const t=JSON.parse(e);t.backgroundImage&&S(t.backgroundImage)}catch{}L.then(t=>{var r;const n=(r=t==null?void 0:t.theme)===null||r===void 0?void 0:r.background_img;n&&S(n)})}const I=async()=>{var e,t,r,n,d,c,p;const P=i.get("agentId");if(!P){console.error("Agent ID is required in URL parameters");return}let v=i.get("title")||"Medi Clinic",y=i.get("iconUrl")||void 0;const x=i.get("context"),G=i.get("baseUrl")||"https://matrix.eka.care/reloaded",O=i.get("auth-token")||void 0;let k=i.get("resize")==="true"?!0:void 0;const J=(e=C(i.get("environment")))!==null&&e!==void 0?e:"production",_=i.get("connectivity"),N=_==="http_stream"||_==="socket"?_:void 0,E=i.get("theme")?(()=>{try{return JSON.parse(i.get("theme")||"{}")}catch{return}})():void 0,q=document.getElementById("root")||document.body;try{const[,,o]=await Promise.all([M(),h(),L]);if(!(window!=null&&window.renderMedAssist)||typeof(window==null?void 0:window.renderMedAssist)!="function")throw new Error("renderMedAssist is not available on window");let l,W,R,B,D=!1;o&&(v=(t=o==null?void 0:o.name)!==null&&t!==void 0?t:v,y=(n=(r=o==null?void 0:o.theme)===null||r===void 0?void 0:r.icon_img)!==null&&n!==void 0?n:y,l=z((d=o==null?void 0:o.theme)!==null&&d!==void 0?d:void 0),W=o==null?void 0:o.allowed,R=o==null?void 0:o.connectivity,B=o==null?void 0:o.initial_message,D=(p=(c=o==null?void 0:o.theme)===null||c===void 0?void 0:c.hide_watermark)!==null&&p!==void 0?p:!1,k=k||(o==null?void 0:o.resize)||void 0);const H={title:v,iconUrl:y,environment:J,connectionType:R||N||"socket",onClose:()=>{window.parent!==window&&window.parent.postMessage({type:"WIDGET_CLOSE"},"*")},context:x?JSON.parse(x):void 0,baseUrl:G,displayMode:"full",allowed:W,showCloseButton:!1,resize:k,initialMessage:B,hideWatermark:D,...O&&{authToken:O},theme:{...l!=null?l:{},...E!=null?E:{}}};window.renderMedAssist(q,P,H)}catch(o){throw console.error("Failed to initialize MedAssist widget",o),o}};async function M(){document.querySelector("link[data-medassist-style='true']")||(f||(f=new Promise((t,r)=>{const n=document.createElement("link");n.rel="stylesheet",n.href=g,n.setAttribute("data-medassist-style","true"),n.onload=()=>{t("")},n.onerror=()=>{r(new Error(`Failed to load ${g}`))},document.head.appendChild(n)})),await f)}function h(){return m||(m=new Promise((e,t)=>{const r=document.querySelector(`script[src="${a}"]`);if(r){if(r.dataset.loaded==="true"){e();return}r.addEventListener("load",()=>e()),r.addEventListener("error",d=>t(d.error||new Error("Unknown script loading error")));return}const n=document.createElement("script");n.src=a,n.type="module",n.async=!0,n.dataset.widget="medassist",n.onload=()=>{n.dataset.loaded="true",e()},n.onerror=d=>{if(d instanceof ErrorEvent&&d.error){t(d.error);return}t(new Error(`Failed to load ${a}`))},document.head.appendChild(n)})),m}if(typeof document!="undefined")if(document.readyState==="loading")document.addEventListener("DOMContentLoaded",I);else try{I()}catch(e){console.error("Failed to initialize MedAssist widget",e)}})();
package/dist/index.d.ts CHANGED
@@ -59,7 +59,38 @@ type AgentConfig = {
59
59
  /** Client-side flag set when the user clicks "Don't show again" on the feedback modal. */
60
60
  feedback_hidden?: boolean;
61
61
  };
62
+ /**
63
+ * Host-page function the LLM may call (MCP `Tool` declaration + `run`).
64
+ * Declared structurally — the loader is built without a bundler and cannot
65
+ * import @synapse/core. Kept in memory only, never serialised to an attribute.
66
+ */
67
+ type MedAssistClientTool = {
68
+ name: string;
69
+ description: string;
70
+ inputSchema: Record<string, unknown>;
71
+ outputSchema?: Record<string, unknown>;
72
+ annotations?: {
73
+ title?: string;
74
+ readOnlyHint?: boolean;
75
+ destructiveHint?: boolean;
76
+ idempotentHint?: boolean;
77
+ };
78
+ run: (input: Record<string, unknown>, ctx: {
79
+ requestId: string | number;
80
+ messageId?: string;
81
+ signal: AbortSignal;
82
+ progress: (update: {
83
+ message: string;
84
+ progress?: number;
85
+ total?: number;
86
+ }) => void;
87
+ }) => unknown;
88
+ parse?: (input: unknown) => Record<string, unknown>;
89
+ timeoutMs?: number;
90
+ };
62
91
  type MedAssistInitConfig = {
92
+ /** Client tools; replace later with `EkaMedAssist.registerTools()`. */
93
+ tools?: MedAssistClientTool[];
63
94
  /** Partner JWT/JWE — the only host-supplied credential; absent -> guest. */
64
95
  authToken?: string;
65
96
  agentId?: string;
@@ -195,6 +226,8 @@ type SidePanelPushDetail = {
195
226
  interface EkaMedAssistWindow extends Window {
196
227
  EkaMedAssist?: {
197
228
  init: (config: MedAssistInitConfig) => void;
229
+ /** Replace the client tools — before or after the widget renders. */
230
+ registerTools: (tools: MedAssistClientTool[]) => void;
198
231
  onClose?: () => void;
199
232
  /**
200
233
  * Side-panel push mode only. Called with `true` when the panel opens and
@@ -207,6 +240,8 @@ interface EkaMedAssistWindow extends Window {
207
240
  };
208
241
  __ekaMedAssistConfig__?: MedAssistInitConfig;
209
242
  renderMedAssist?: (container: HTMLElement, agentId: string, config: MedAssistInitConfig) => ReactRoot;
243
+ /** Exposed by the widget bundle once loaded; swaps tools in the running SDK. */
244
+ registerMedAssistTools?: (tools: MedAssistClientTool[]) => void;
210
245
  }
211
246
  declare const globalMedAssistConfig: MedAssistInitConfig;
212
247
  declare const getWidgetElement: () => HTMLElement | null;
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
- "use strict";const getCurrentScript=()=>{if(typeof document=="undefined")return console.error("document is not defined"),null;const{currentScript:e}=document;if(e instanceof HTMLScriptElement)return e;const t=Array.from(document.getElementsByTagName("script")),i=t.find(o=>o.hasAttribute("data-widget-assets"));if(i)return i;const n=t.filter(o=>/(^|\/)index\.js(\?.*)?$/.test(o.src));return n.length?n[n.length-1]:t.length?t[t.length-1]:null},getEnvironment=e=>{if(e==="production"||e==="development"||e==="staging")return e},scriptEl=getCurrentScript(),DEFAULT_WIDGET_ASSET_BASE=(()=>{var e;return!((e=scriptEl==null?void 0:scriptEl.src)===null||e===void 0)&&e.includes("@dev"),"https://cdn.jsdelivr.net/npm/@eka-care/medassist-widget@0.1.137/dist/"})();var FeedbackTypeEnum;(function(e){e.DEFAULT="default",e.NPS="nps"})(FeedbackTypeEnum||(FeedbackTypeEnum={}));function mapAgentConfigThemeToWidgetTheme(e){if(!e)return;const t=e.mode==="dark"?"white":e.mode==="light"?"black":void 0;return{...e.background_img&&{backgroundImage:e.background_img},...e.accent&&{primary:e.accent},...t&&{textColor:t},...e.mode&&{mode:e.mode},...e.header_tinted!==void 0&&{headerTinted:e.header_tinted},...e.title_img&&{titleImg:e.title_img},...e.tagline&&{tagline:e.tagline},...e.hide_watermark&&{hideWatermark:e.hide_watermark},...e.explicit_disclaimer&&{explicitDisclaimer:e.explicit_disclaimer},...e.consent_content&&{consentContent:e.consent_content},...e.upfront_consent&&{upfrontConsent:e.upfront_consent},...e.feature!==void 0&&{feature:e.feature}}}function preloadImage(e){if(!(!e||typeof document=="undefined"))try{const t=document.createElement("link");t.rel="preload",t.as="image",t.href=e,document.head.appendChild(t)}catch{const t=new Image;t.src=e}}function channelFromDisplayMode(e){return e==="full"?"web":e==="side_panel"?"side_panel":"widget"}function normalizeDisplayMode(e){return e==="full"?"full":e==="side_panel"?"side_panel":"widget"}const NUDGE_STORAGE_KEY="eka-medassist-nudges",AGENT_CONFIG_CACHE_KEY="eka-medassist-agent-config";function readAgentConfigCache(e){try{const t=localStorage.getItem(AGENT_CONFIG_CACHE_KEY);return(t?JSON.parse(t):{})[e]}catch{return}}function writeAgentConfigCache(e,t){try{const i=localStorage.getItem(AGENT_CONFIG_CACHE_KEY),n=i?JSON.parse(i):{};n[e]={...n[e]||{},...t},localStorage.setItem(AGENT_CONFIG_CACHE_KEY,JSON.stringify(n))}catch{}}function getNudgeStore(){try{const e=localStorage.getItem(NUDGE_STORAGE_KEY);return e?JSON.parse(e):{}}catch{return{}}}function setNudgeStore(e){try{localStorage.setItem(NUDGE_STORAGE_KEY,JSON.stringify(e))}catch{}}function normalizePath(e){let t=e.replace(/\/+$/,"");return t.startsWith("/")||(t="/"+t),t||"/"}function getNudgePathCandidates(e){const t=e.split("/").filter(Boolean),i=[];for(let n=t.length;n>=0;n--)i.push(n===0?"/":"/"+t.slice(0,n).join("/"));return i}function findCachedNudgeForCandidates(e,t,i){const o=getNudgeStore()[e];if(!o)return null;const s=t.host,r=o[s];if(!r)return null;for(const d of i){if(r[d]!==void 0)return{domain:s,path:d,data:r[d]};const a=d==="/"?"/*":d+"/*";if(r[a]!==void 0)return{domain:s,path:a,data:r[a]}}return null}function findFreshCachedNudge(e,t,i){const n=findCachedNudgeForCandidates(e,t,i);if(!n)return null;const o=Math.floor(Date.now()/1e3);return n.data.expiry<=o?(clearNudgeForPath(e,n.domain,n.path),null):n}function clearNudgeForPath(e,t,i){const n=getNudgeStore(),o=n[e];!o||!o[t]||(delete o[t][i],setNudgeStore(n))}function storeNudgeResponse(e,t,i){var n,o,s,r;const d=(n=t==null?void 0:t.url_pattern)===null||n===void 0?void 0:n.domain,a=(o=t==null?void 0:t.url_pattern)===null||o===void 0?void 0:o.path;if(!(!((s=t.nudges)===null||s===void 0)&&s.length)||!t.expiry||!d||!a)return;const c=getNudgeStore();c[e]||(c[e]={}),c[e][d]||(c[e][d]={});const h={nudges:t.nudges,expiry:t.expiry,delay:(r=t.delay)!==null&&r!==void 0?r:5};c[e][d][a]=h,i&&i!==a&&(c[e][d][i]=h),setNudgeStore(c)}const NUDGE_COOKIE_PREFIX="eka-nudge";function setNudgeCookie(e,t){const i=new Date(Date.now()+864e5).toUTCString();document.cookie=`${NUDGE_COOKIE_PREFIX}-${e}=${t}; expires=${i}; path=/; SameSite=Lax`}function getNudgeCookie(e){const t=document.cookie.split(";").map(n=>n.trim()).find(n=>n.startsWith(`${NUDGE_COOKIE_PREFIX}-${e}=`));if(!t)return null;const i=t.split("=")[1];return i==="open"||i==="closed"?i:null}const WIDGET_STORE_KEY_PREFIX="med-assist-store-";function readPersistedSessToken(e){var t,i;try{const n=sessionStorage.getItem(`${WIDGET_STORE_KEY_PREFIX}${e}`),o=n?(i=(t=JSON.parse(n))===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.sessToken:void 0;return typeof o=="string"&&o?o:void 0}catch{return}}async function fetchNudgeData(e,t,i,n="widget"){const o=`${i}/med-assist/user-nudge`,s=[];typeof document!="undefined"&&document.querySelectorAll("meta").forEach(r=>{var d,a,c;const h=(d=r.getAttribute("name"))!==null&&d!==void 0?d:void 0,f=(a=r.getAttribute("property"))!==null&&a!==void 0?a:void 0,p=(c=r.getAttribute("content"))!==null&&c!==void 0?c:void 0;(h||f)&&s.push({name:h,property:f,content:p})});try{const r=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json","x-agent-id":e,"x-channel":n,referer:typeof window!="undefined"?window.location.href:"",Authorization:`Bearer ${t}`},body:JSON.stringify({meta_tags:s,url:typeof window!="undefined"?window.location.href:""})});return r.ok?await r.json():void 0}catch{return}}const SIDE_PANEL_PUSH_EVENT="eka-medassist:side-panel-push",globalMedAssistConfig={},getWidgetElement=()=>typeof document=="undefined"?null:document.querySelector("eka-medassist-widget");if(typeof window!="undefined"){const e=window;e.__ekaMedAssistConfig__=globalMedAssistConfig,e.EkaMedAssist={init(t){var i,n,o;Object.assign(globalMedAssistConfig,t);const s=getWidgetElement();if(s){if(t.agentId&&s.setAttribute("agent-id",t.agentId),t.authToken&&s.setAttribute("auth-token",t.authToken),t.title&&s.setAttribute("title",t.title),t.iconUrl&&s.setAttribute("icon-url",t.iconUrl),t.baseUrl&&s.setAttribute("base-url",t.baseUrl),t.resize!==void 0&&s.setAttribute("resize",String(t.resize)),(t.displayMode==="full"||t.displayMode==="widget"||t.displayMode==="side_panel")&&s.setAttribute("display-mode",t.displayMode),t.sidePanelMode&&s.setAttribute("side-panel-mode",t.sidePanelMode),t.sidePanelWidth!==void 0&&s.setAttribute("side-panel-width",String(t.sidePanelWidth)),t.side&&s.setAttribute("side",t.side),t.context)try{s.setAttribute("context",JSON.stringify(t.context))}catch{console.warn("Failed to stringify context passed to init")}typeof t.customLauncherStyles=="string"&&s.setAttribute("custom-launcher-styles",t.customLauncherStyles),t.redirectUrl&&s.setAttribute("redirect-url",t.redirectUrl),!((i=t.theme)===null||i===void 0)&&i.backgroundImage&&preloadImage(t.theme.backgroundImage),(o=(n=s).openFromBridge)===null||o===void 0||o.call(n)}}}}const scriptBaseUrl=(()=>{if(!scriptEl)return"";try{return new URL(".",scriptEl.src||window.location.href).href}catch{return""}})(),widgetAssetBaseUrl=(()=>{if(!scriptEl)return DEFAULT_WIDGET_ASSET_BASE;const e=scriptEl.dataset.widgetAssets;if(e==="local")return`${scriptBaseUrl}src/`;if(e&&e.length>0)try{return new URL(e,scriptBaseUrl).href}catch{return e.endsWith("/")?e:`${e}/`}return DEFAULT_WIDGET_ASSET_BASE})(),WIDGET_JS_URL=`${widgetAssetBaseUrl}medassist-widget.js`,WIDGET_CSS_URL=`${widgetAssetBaseUrl}medassist-widget.css`;let widgetModulePromise=null,widgetCssTextPromise=null;function getWidgetCssTextPromise(){return widgetCssTextPromise||(widgetCssTextPromise=fetch(WIDGET_CSS_URL).then(e=>{if(!e.ok)throw new Error(`Unable to fetch widget styles from ${WIDGET_CSS_URL}`);return e.text()})),widgetCssTextPromise}class MedAssistWidgetLoader extends HTMLElement{setLauncherState(t){var i;const n=(i=this.shadowRoot)===null||i===void 0?void 0:i.getElementById("medassist-open-btn");n&&(n.classList.toggle("loading",t==="loading"),n.classList.toggle("hidden",t==="open"),t==="loading"?n.setAttribute("aria-busy","true"):n.removeAttribute("aria-busy"))}getChannel(){const t=this.getAttribute("display-mode");if(t)return channelFromDisplayMode(t);const i=typeof window!="undefined"?window.__ekaMedAssistConfig__:void 0;return channelFromDisplayMode(i==null?void 0:i.displayMode)}getAgentConfig(){var t;if(!this.agentConfigPromise){const i=(typeof window!="undefined"?window.__ekaMedAssistConfig__:void 0)||{},n=i.baseUrl||this.getAttribute("base-url")||"https://matrix.eka.care/reloaded",o=i.agentId||this.getAttribute("agent-id")||"";if(!o)return Promise.resolve(void 0);const s=(t=getEnvironment(this.getAttribute("environment")))!==null&&t!==void 0?t:"production";this.agentConfigPromise=this.loadWidgetModule().then(r=>{var d;return(d=r.fetchAgentConfig)===null||d===void 0?void 0:d.call(r,{agentId:o,serverUrl:n,environment:s,channel:this.getChannel()})}).catch(()=>{this.agentConfigPromise=null})}return this.agentConfigPromise}constructor(){super(),this.hostPushStyleEl=null,this.hostPushState=null,this.reactRoot=null,this.agentConfigPromise=null,this.loading=!1,this.authPrefetchPromise=null,this.attachShadow({mode:"open"}),this.defaultIconUrl="https://cdn.eka.care/bot-icon.svg",this.widgetLoaded=!1,this.displayMode=normalizeDisplayMode(this.getAttribute("display-mode")),this.setupAuthExpirationListener()}static get observedAttributes(){return["icon-url","display-mode","custom-launcher-styles","redirect-url","side-panel-mode","side-panel-width","side"]}connectedCallback(){this.displayMode==="full"?(this.initializeFullMode(),this.loadAndRender().catch(t=>{console.error("Failed to load MedAssist widget in full mode",t)})):(this.renderButton(),this.scheduleIdle(()=>{this.preloadWidgetAssets(),this.prefetchAuthTokens(),this.initNudge()}))}disconnectedCallback(){var t,i,n,o,s;(t=this.reactRoot)===null||t===void 0||t.unmount(),this.reactRoot=null,(i=document.body)===null||i===void 0||i.classList.remove("eka-medassist-pushed"),(n=document.documentElement)===null||n===void 0||n.style.removeProperty("--eka-medassist-panel-width"),(o=document.documentElement)===null||o===void 0||o.style.removeProperty("--eka-medassist-panel-side"),(s=this.hostPushStyleEl)===null||s===void 0||s.remove(),this.hostPushStyleEl=null,this.hostPushState=null}applyHostPush(t,i,n){var o;if(typeof document=="undefined")return;const s=t?{width:i,side:n}:null,r=this.hostPushState;if(r===s||r&&s&&r.width===s.width&&r.side===s.side)return;this.hostPushState=s,this.hostPushStyleEl||(this.hostPushStyleEl=document.createElement("style"),this.hostPushStyleEl.setAttribute("data-medassist-side-panel-push","true"),document.head.appendChild(this.hostPushStyleEl));const d=n==="left"?"margin-left":"margin-right";this.hostPushStyleEl.textContent=`
1
+ "use strict";const getCurrentScript=()=>{if(typeof document=="undefined")return console.error("document is not defined"),null;const{currentScript:e}=document;if(e instanceof HTMLScriptElement)return e;const t=Array.from(document.getElementsByTagName("script")),i=t.find(s=>s.hasAttribute("data-widget-assets"));if(i)return i;const n=t.filter(s=>/(^|\/)index\.js(\?.*)?$/.test(s.src));return n.length?n[n.length-1]:t.length?t[t.length-1]:null},getEnvironment=e=>{if(e==="production"||e==="development"||e==="staging")return e},scriptEl=getCurrentScript(),DEFAULT_WIDGET_ASSET_BASE=(()=>{var e;return!((e=scriptEl==null?void 0:scriptEl.src)===null||e===void 0)&&e.includes("@dev"),"https://cdn.jsdelivr.net/npm/@eka-care/medassist-widget@0.1.138-0/dist/"})();var FeedbackTypeEnum;(function(e){e.DEFAULT="default",e.NPS="nps"})(FeedbackTypeEnum||(FeedbackTypeEnum={}));function mapAgentConfigThemeToWidgetTheme(e){if(!e)return;const t=e.mode==="dark"?"white":e.mode==="light"?"black":void 0;return{...e.background_img&&{backgroundImage:e.background_img},...e.accent&&{primary:e.accent},...t&&{textColor:t},...e.mode&&{mode:e.mode},...e.header_tinted!==void 0&&{headerTinted:e.header_tinted},...e.title_img&&{titleImg:e.title_img},...e.tagline&&{tagline:e.tagline},...e.hide_watermark&&{hideWatermark:e.hide_watermark},...e.explicit_disclaimer&&{explicitDisclaimer:e.explicit_disclaimer},...e.consent_content&&{consentContent:e.consent_content},...e.upfront_consent&&{upfrontConsent:e.upfront_consent},...e.feature!==void 0&&{feature:e.feature}}}function preloadImage(e){if(!(!e||typeof document=="undefined"))try{const t=document.createElement("link");t.rel="preload",t.as="image",t.href=e,document.head.appendChild(t)}catch{const t=new Image;t.src=e}}function channelFromDisplayMode(e){return e==="full"?"web":e==="side_panel"?"side_panel":"widget"}function normalizeDisplayMode(e){return e==="full"?"full":e==="side_panel"?"side_panel":"widget"}const NUDGE_STORAGE_KEY="eka-medassist-nudges",AGENT_CONFIG_CACHE_KEY="eka-medassist-agent-config";function readAgentConfigCache(e){try{const t=localStorage.getItem(AGENT_CONFIG_CACHE_KEY);return(t?JSON.parse(t):{})[e]}catch{return}}function writeAgentConfigCache(e,t){try{const i=localStorage.getItem(AGENT_CONFIG_CACHE_KEY),n=i?JSON.parse(i):{};n[e]={...n[e]||{},...t},localStorage.setItem(AGENT_CONFIG_CACHE_KEY,JSON.stringify(n))}catch{}}function getNudgeStore(){try{const e=localStorage.getItem(NUDGE_STORAGE_KEY);return e?JSON.parse(e):{}}catch{return{}}}function setNudgeStore(e){try{localStorage.setItem(NUDGE_STORAGE_KEY,JSON.stringify(e))}catch{}}function normalizePath(e){let t=e.replace(/\/+$/,"");return t.startsWith("/")||(t="/"+t),t||"/"}function getNudgePathCandidates(e){const t=e.split("/").filter(Boolean),i=[];for(let n=t.length;n>=0;n--)i.push(n===0?"/":"/"+t.slice(0,n).join("/"));return i}function findCachedNudgeForCandidates(e,t,i){const s=getNudgeStore()[e];if(!s)return null;const o=t.host,d=s[o];if(!d)return null;for(const r of i){if(d[r]!==void 0)return{domain:o,path:r,data:d[r]};const a=r==="/"?"/*":r+"/*";if(d[a]!==void 0)return{domain:o,path:a,data:d[a]}}return null}function findFreshCachedNudge(e,t,i){const n=findCachedNudgeForCandidates(e,t,i);if(!n)return null;const s=Math.floor(Date.now()/1e3);return n.data.expiry<=s?(clearNudgeForPath(e,n.domain,n.path),null):n}function clearNudgeForPath(e,t,i){const n=getNudgeStore(),s=n[e];!s||!s[t]||(delete s[t][i],setNudgeStore(n))}function storeNudgeResponse(e,t,i){var n,s,o,d;const r=(n=t==null?void 0:t.url_pattern)===null||n===void 0?void 0:n.domain,a=(s=t==null?void 0:t.url_pattern)===null||s===void 0?void 0:s.path;if(!(!((o=t.nudges)===null||o===void 0)&&o.length)||!t.expiry||!r||!a)return;const c=getNudgeStore();c[e]||(c[e]={}),c[e][r]||(c[e][r]={});const h={nudges:t.nudges,expiry:t.expiry,delay:(d=t.delay)!==null&&d!==void 0?d:5};c[e][r][a]=h,i&&i!==a&&(c[e][r][i]=h),setNudgeStore(c)}const NUDGE_COOKIE_PREFIX="eka-nudge";function setNudgeCookie(e,t){const i=new Date(Date.now()+864e5).toUTCString();document.cookie=`${NUDGE_COOKIE_PREFIX}-${e}=${t}; expires=${i}; path=/; SameSite=Lax`}function getNudgeCookie(e){const t=document.cookie.split(";").map(n=>n.trim()).find(n=>n.startsWith(`${NUDGE_COOKIE_PREFIX}-${e}=`));if(!t)return null;const i=t.split("=")[1];return i==="open"||i==="closed"?i:null}const WIDGET_STORE_KEY_PREFIX="med-assist-store-";function readPersistedSessToken(e){var t,i;try{const n=sessionStorage.getItem(`${WIDGET_STORE_KEY_PREFIX}${e}`),s=n?(i=(t=JSON.parse(n))===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.sessToken:void 0;return typeof s=="string"&&s?s:void 0}catch{return}}async function fetchNudgeData(e,t,i,n="widget"){const s=`${i}/med-assist/user-nudge`,o=[];typeof document!="undefined"&&document.querySelectorAll("meta").forEach(d=>{var r,a,c;const h=(r=d.getAttribute("name"))!==null&&r!==void 0?r:void 0,f=(a=d.getAttribute("property"))!==null&&a!==void 0?a:void 0,p=(c=d.getAttribute("content"))!==null&&c!==void 0?c:void 0;(h||f)&&o.push({name:h,property:f,content:p})});try{const d=await fetch(s,{method:"POST",headers:{"Content-Type":"application/json","x-agent-id":e,"x-channel":n,referer:typeof window!="undefined"?window.location.href:"",Authorization:`Bearer ${t}`},body:JSON.stringify({meta_tags:o,url:typeof window!="undefined"?window.location.href:""})});return d.ok?await d.json():void 0}catch{return}}const SIDE_PANEL_PUSH_EVENT="eka-medassist:side-panel-push",globalMedAssistConfig={},getWidgetElement=()=>typeof document=="undefined"?null:document.querySelector("eka-medassist-widget");if(typeof window!="undefined"){const e=window;e.__ekaMedAssistConfig__=globalMedAssistConfig,e.EkaMedAssist={registerTools(t){var i;globalMedAssistConfig.tools=t,(i=e.registerMedAssistTools)===null||i===void 0||i.call(e,t)},init(t){var i,n,s,o;Object.assign(globalMedAssistConfig,t),t.tools&&((i=e.registerMedAssistTools)===null||i===void 0||i.call(e,t.tools));const d=getWidgetElement();if(d){if(t.agentId&&d.setAttribute("agent-id",t.agentId),t.authToken&&d.setAttribute("auth-token",t.authToken),t.title&&d.setAttribute("title",t.title),t.iconUrl&&d.setAttribute("icon-url",t.iconUrl),t.baseUrl&&d.setAttribute("base-url",t.baseUrl),t.resize!==void 0&&d.setAttribute("resize",String(t.resize)),(t.displayMode==="full"||t.displayMode==="widget"||t.displayMode==="side_panel")&&d.setAttribute("display-mode",t.displayMode),t.sidePanelMode&&d.setAttribute("side-panel-mode",t.sidePanelMode),t.sidePanelWidth!==void 0&&d.setAttribute("side-panel-width",String(t.sidePanelWidth)),t.side&&d.setAttribute("side",t.side),t.context)try{d.setAttribute("context",JSON.stringify(t.context))}catch{console.warn("Failed to stringify context passed to init")}typeof t.customLauncherStyles=="string"&&d.setAttribute("custom-launcher-styles",t.customLauncherStyles),t.redirectUrl&&d.setAttribute("redirect-url",t.redirectUrl),!((n=t.theme)===null||n===void 0)&&n.backgroundImage&&preloadImage(t.theme.backgroundImage),(o=(s=d).openFromBridge)===null||o===void 0||o.call(s)}}}}const scriptBaseUrl=(()=>{if(!scriptEl)return"";try{return new URL(".",scriptEl.src||window.location.href).href}catch{return""}})(),widgetAssetBaseUrl=(()=>{if(!scriptEl)return DEFAULT_WIDGET_ASSET_BASE;const e=scriptEl.dataset.widgetAssets;if(e==="local")return`${scriptBaseUrl}src/`;if(e&&e.length>0)try{return new URL(e,scriptBaseUrl).href}catch{return e.endsWith("/")?e:`${e}/`}return DEFAULT_WIDGET_ASSET_BASE})(),WIDGET_JS_URL=`${widgetAssetBaseUrl}medassist-widget.js`,WIDGET_CSS_URL=`${widgetAssetBaseUrl}medassist-widget.css`;let widgetModulePromise=null,widgetCssTextPromise=null;function getWidgetCssTextPromise(){return widgetCssTextPromise||(widgetCssTextPromise=fetch(WIDGET_CSS_URL).then(e=>{if(!e.ok)throw new Error(`Unable to fetch widget styles from ${WIDGET_CSS_URL}`);return e.text()})),widgetCssTextPromise}class MedAssistWidgetLoader extends HTMLElement{setLauncherState(t){var i;const n=(i=this.shadowRoot)===null||i===void 0?void 0:i.getElementById("medassist-open-btn");n&&(n.classList.toggle("loading",t==="loading"),n.classList.toggle("hidden",t==="open"),t==="loading"?n.setAttribute("aria-busy","true"):n.removeAttribute("aria-busy"))}getChannel(){const t=this.getAttribute("display-mode");if(t)return channelFromDisplayMode(t);const i=typeof window!="undefined"?window.__ekaMedAssistConfig__:void 0;return channelFromDisplayMode(i==null?void 0:i.displayMode)}getAgentConfig(){var t;if(!this.agentConfigPromise){const i=(typeof window!="undefined"?window.__ekaMedAssistConfig__:void 0)||{},n=i.baseUrl||this.getAttribute("base-url")||"https://matrix.eka.care/reloaded",s=i.agentId||this.getAttribute("agent-id")||"";if(!s)return Promise.resolve(void 0);const o=(t=getEnvironment(this.getAttribute("environment")))!==null&&t!==void 0?t:"production";this.agentConfigPromise=this.loadWidgetModule().then(d=>{var r;return(r=d.fetchAgentConfig)===null||r===void 0?void 0:r.call(d,{agentId:s,serverUrl:n,environment:o,channel:this.getChannel()})}).catch(()=>{this.agentConfigPromise=null})}return this.agentConfigPromise}constructor(){super(),this.hostPushStyleEl=null,this.hostPushState=null,this.reactRoot=null,this.agentConfigPromise=null,this.loading=!1,this.authPrefetchPromise=null,this.attachShadow({mode:"open"}),this.defaultIconUrl="https://cdn.eka.care/bot-icon.svg",this.widgetLoaded=!1,this.displayMode=normalizeDisplayMode(this.getAttribute("display-mode")),this.setupAuthExpirationListener()}static get observedAttributes(){return["icon-url","display-mode","custom-launcher-styles","redirect-url","side-panel-mode","side-panel-width","side"]}connectedCallback(){this.displayMode==="full"?(this.initializeFullMode(),this.loadAndRender().catch(t=>{console.error("Failed to load MedAssist widget in full mode",t)})):(this.renderButton(),this.scheduleIdle(()=>{this.preloadWidgetAssets(),this.prefetchAuthTokens(),this.initNudge()}))}disconnectedCallback(){var t,i,n,s,o;(t=this.reactRoot)===null||t===void 0||t.unmount(),this.reactRoot=null,(i=document.body)===null||i===void 0||i.classList.remove("eka-medassist-pushed"),(n=document.documentElement)===null||n===void 0||n.style.removeProperty("--eka-medassist-panel-width"),(s=document.documentElement)===null||s===void 0||s.style.removeProperty("--eka-medassist-panel-side"),(o=this.hostPushStyleEl)===null||o===void 0||o.remove(),this.hostPushStyleEl=null,this.hostPushState=null}applyHostPush(t,i,n){var s;if(typeof document=="undefined")return;const o=t?{width:i,side:n}:null,d=this.hostPushState;if(d===o||d&&o&&d.width===o.width&&d.side===o.side)return;this.hostPushState=o,this.hostPushStyleEl||(this.hostPushStyleEl=document.createElement("style"),this.hostPushStyleEl.setAttribute("data-medassist-side-panel-push","true"),document.head.appendChild(this.hostPushStyleEl));const r=n==="left"?"margin-left":"margin-right";this.hostPushStyleEl.textContent=`
2
2
  body.eka-medassist-pushed {
3
- ${d}: ${i}px;
3
+ ${r}: ${i}px;
4
4
  transition: margin 300ms ease;
5
5
  }
6
6
  body.eka-medassist-pushed > * {
@@ -9,7 +9,7 @@
9
9
  @media (prefers-reduced-motion: reduce) {
10
10
  body.eka-medassist-pushed { transition: none !important; }
11
11
  }
12
- `;const a=document.documentElement.style;t?(a.setProperty("--eka-medassist-panel-width",`${i}px`),a.setProperty("--eka-medassist-panel-side",n),document.body.classList.add("eka-medassist-pushed")):(document.body.classList.remove("eka-medassist-pushed"),a.removeProperty("--eka-medassist-panel-width"),a.removeProperty("--eka-medassist-panel-side"),this.hostPushStyleEl.remove(),this.hostPushStyleEl=null);const c={pushed:t,width:i,side:n};if(typeof window!="undefined"){try{window.dispatchEvent(new CustomEvent(SIDE_PANEL_PUSH_EVENT,{detail:c}))}catch{}const h=(o=window.EkaMedAssist)===null||o===void 0?void 0:o.onSidePanelPushChange;if(typeof h=="function")try{h(t,i,n)}catch(f){console.error("EkaMedAssist.onSidePanelPushChange threw",f)}}}scheduleIdle(t){if(typeof window=="undefined"){t();return}const i=window.requestIdleCallback;typeof i=="function"?i(t,{timeout:3e3}):setTimeout(t,200)}attributeChangedCallback(t){if(t==="icon-url"&&this.displayMode!=="full"&&this.renderButton(),t==="display-mode"){const i=normalizeDisplayMode(this.getAttribute("display-mode"));i!==this.displayMode&&(this.displayMode=i,i==="full"?this.initializeFullMode():this.renderButton())}t==="custom-launcher-styles"&&this.applyCustomLauncherStyles()}preloadWidgetAssets(){getWidgetCssTextPromise(),this.loadWidgetModule(),this.preloadBackgroundImage()}prefetchAuthTokens(){var t;if(this.authPrefetchPromise)return this.authPrefetchPromise;const i=(typeof window!="undefined"?window.__ekaMedAssistConfig__:void 0)||{},n=i.agentId||this.getAttribute("agent-id")||"";if(!n)return Promise.resolve(void 0);const o=i.authToken||this.getAttribute("auth-token")||void 0,s=i.baseUrl||this.getAttribute("base-url")||"https://matrix.eka.care/reloaded",r=(t=getEnvironment(this.getAttribute("environment")))!==null&&t!==void 0?t:"production";return this.authPrefetchPromise=this.loadWidgetModule().then(d=>{var a;return(a=d.prefetchAuth)===null||a===void 0?void 0:a.call(d,{agentId:n,authToken:o,serverUrl:s,environment:r,channel:this.getChannel()})}).catch(()=>{this.authPrefetchPromise=null}),this.authPrefetchPromise}async resolveSessToken(t){const i=readPersistedSessToken(t);if(i)return i;const n=await this.prefetchAuthTokens();return(n==null?void 0:n.sess_token)||readPersistedSessToken(t)}preloadBackgroundImage(){var t;const i=typeof window!="undefined"?window.__ekaMedAssistConfig__:void 0,n=this.getAttribute("theme")?(()=>{try{return JSON.parse(this.getAttribute("theme")||"{}")}catch{return}})():void 0,o=(t=i==null?void 0:i.theme)===null||t===void 0?void 0:t.backgroundImage,s=n==null?void 0:n.backgroundImage;o&&preloadImage(o),s&&s!==o&&preloadImage(s),this.getAgentConfig().then(r=>{var d;const a=(d=r==null?void 0:r.theme)===null||d===void 0?void 0:d.background_img;a&&preloadImage(a)}).catch(()=>{})}setupAuthExpirationListener(){if(typeof window=="undefined")return;const t=i=>{var n;((n=i.data)===null||n===void 0?void 0:n.type)==="AUTH_EXPIRED"&&window.parent!==window&&window.parent.postMessage({type:"AUTH_EXPIRED",message:"Authentication expired"},"*")};window.addEventListener("message",t)}openFromBridge(){this.displayMode=normalizeDisplayMode(this.getAttribute("display-mode")),this.displayMode==="full"?this.initializeFullMode():this.renderButton(),this.loadAndRender().catch(t=>{console.error("Failed to open MedAssist widget from bridge",t)})}async initNudge(){var t,i,n,o;const s=typeof window!="undefined"?window.__ekaMedAssistConfig__:void 0,r=(s==null?void 0:s.agentId)||this.getAttribute("agent-id")||"";if(!r)return;const d=await this.getAgentConfig();if(!(d!=null&&d.nudge))return;const a=(i=(t=d==null?void 0:d.theme)===null||t===void 0?void 0:t.nudge_color)!==null&&i!==void 0?i:"#ffffff",c=typeof window!="undefined"?window.location.href:"";let h;try{h=new URL(c)}catch{return}const f=getNudgePathCandidates(h.pathname),p=f.slice(0,1),y=f.slice(1);let g=findFreshCachedNudge(r,h,p);if(!g){const v=(s==null?void 0:s.baseUrl)||this.getAttribute("base-url")||"https://matrix.eka.care/reloaded",m=await this.resolveSessToken(r).catch(()=>{});if(m){const l=await fetchNudgeData(r,m,v,this.getChannel()).catch(()=>{});!((n=l==null?void 0:l.nudges)===null||n===void 0)&&n.length&&(storeNudgeResponse(r,l,normalizePath(h.pathname)),g=findFreshCachedNudge(r,h,f))}}if(g||(g=findFreshCachedNudge(r,h,y)),!g)return;const w=g.data.nudges[Math.floor(Math.random()*g.data.nudges.length)],b=(o=g.data.delay)!==null&&o!==void 0?o:5;setTimeout(()=>{this.showNudgePopup(w,a)},b*1e3)}showNudgePopup(t,i){var n,o;const s=this.shadowRoot;if(!s||!(!((n=s.getElementById("medassist-widget-root"))===null||n===void 0)&&n.classList.contains("hidden")))return;const d=((typeof window!="undefined"?window.__ekaMedAssistConfig__:void 0)||{}).agentId||this.getAttribute("agent-id")||"";if(d&&getNudgeCookie(d)!==null||s.getElementById("medassist-nudge-popup"))return;const c=s.getElementById("medassist-open-btn"),h=c==null?void 0:c.getBoundingClientRect(),f=272,p=12,y=8,g=16,w=16;let b=window.innerWidth-f-p,v=76,m=f-g-y*2;if(h&&h.width>0){const A=h.left+h.width/2,S=A-f/2,C=window.innerWidth-f-p;b=Math.max(p,Math.min(S,C)),v=window.innerHeight-h.top+w,m=Math.max(g,Math.min(A-b-y,f-g-y*2))}const l=document.createElement("div");l.id="medassist-nudge-popup",l.innerHTML=`
12
+ `;const a=document.documentElement.style;t?(a.setProperty("--eka-medassist-panel-width",`${i}px`),a.setProperty("--eka-medassist-panel-side",n),document.body.classList.add("eka-medassist-pushed")):(document.body.classList.remove("eka-medassist-pushed"),a.removeProperty("--eka-medassist-panel-width"),a.removeProperty("--eka-medassist-panel-side"),this.hostPushStyleEl.remove(),this.hostPushStyleEl=null);const c={pushed:t,width:i,side:n};if(typeof window!="undefined"){try{window.dispatchEvent(new CustomEvent(SIDE_PANEL_PUSH_EVENT,{detail:c}))}catch{}const h=(s=window.EkaMedAssist)===null||s===void 0?void 0:s.onSidePanelPushChange;if(typeof h=="function")try{h(t,i,n)}catch(f){console.error("EkaMedAssist.onSidePanelPushChange threw",f)}}}scheduleIdle(t){if(typeof window=="undefined"){t();return}const i=window.requestIdleCallback;typeof i=="function"?i(t,{timeout:3e3}):setTimeout(t,200)}attributeChangedCallback(t){if(t==="icon-url"&&this.displayMode!=="full"&&this.renderButton(),t==="display-mode"){const i=normalizeDisplayMode(this.getAttribute("display-mode"));i!==this.displayMode&&(this.displayMode=i,i==="full"?this.initializeFullMode():this.renderButton())}t==="custom-launcher-styles"&&this.applyCustomLauncherStyles()}preloadWidgetAssets(){getWidgetCssTextPromise(),this.loadWidgetModule(),this.preloadBackgroundImage()}prefetchAuthTokens(){var t;if(this.authPrefetchPromise)return this.authPrefetchPromise;const i=(typeof window!="undefined"?window.__ekaMedAssistConfig__:void 0)||{},n=i.agentId||this.getAttribute("agent-id")||"";if(!n)return Promise.resolve(void 0);const s=i.authToken||this.getAttribute("auth-token")||void 0,o=i.baseUrl||this.getAttribute("base-url")||"https://matrix.eka.care/reloaded",d=(t=getEnvironment(this.getAttribute("environment")))!==null&&t!==void 0?t:"production";return this.authPrefetchPromise=this.loadWidgetModule().then(r=>{var a;return(a=r.prefetchAuth)===null||a===void 0?void 0:a.call(r,{agentId:n,authToken:s,serverUrl:o,environment:d,channel:this.getChannel()})}).catch(()=>{this.authPrefetchPromise=null}),this.authPrefetchPromise}async resolveSessToken(t){const i=readPersistedSessToken(t);if(i)return i;const n=await this.prefetchAuthTokens();return(n==null?void 0:n.sess_token)||readPersistedSessToken(t)}preloadBackgroundImage(){var t;const i=typeof window!="undefined"?window.__ekaMedAssistConfig__:void 0,n=this.getAttribute("theme")?(()=>{try{return JSON.parse(this.getAttribute("theme")||"{}")}catch{return}})():void 0,s=(t=i==null?void 0:i.theme)===null||t===void 0?void 0:t.backgroundImage,o=n==null?void 0:n.backgroundImage;s&&preloadImage(s),o&&o!==s&&preloadImage(o),this.getAgentConfig().then(d=>{var r;const a=(r=d==null?void 0:d.theme)===null||r===void 0?void 0:r.background_img;a&&preloadImage(a)}).catch(()=>{})}setupAuthExpirationListener(){if(typeof window=="undefined")return;const t=i=>{var n;((n=i.data)===null||n===void 0?void 0:n.type)==="AUTH_EXPIRED"&&window.parent!==window&&window.parent.postMessage({type:"AUTH_EXPIRED",message:"Authentication expired"},"*")};window.addEventListener("message",t)}openFromBridge(){this.displayMode=normalizeDisplayMode(this.getAttribute("display-mode")),this.displayMode==="full"?this.initializeFullMode():this.renderButton(),this.loadAndRender().catch(t=>{console.error("Failed to open MedAssist widget from bridge",t)})}async initNudge(){var t,i,n,s;const o=typeof window!="undefined"?window.__ekaMedAssistConfig__:void 0,d=(o==null?void 0:o.agentId)||this.getAttribute("agent-id")||"";if(!d)return;const r=await this.getAgentConfig();if(!(r!=null&&r.nudge))return;const a=(i=(t=r==null?void 0:r.theme)===null||t===void 0?void 0:t.nudge_color)!==null&&i!==void 0?i:"#ffffff",c=typeof window!="undefined"?window.location.href:"";let h;try{h=new URL(c)}catch{return}const f=getNudgePathCandidates(h.pathname),p=f.slice(0,1),y=f.slice(1);let g=findFreshCachedNudge(d,h,p);if(!g){const v=(o==null?void 0:o.baseUrl)||this.getAttribute("base-url")||"https://matrix.eka.care/reloaded",m=await this.resolveSessToken(d).catch(()=>{});if(m){const l=await fetchNudgeData(d,m,v,this.getChannel()).catch(()=>{});!((n=l==null?void 0:l.nudges)===null||n===void 0)&&n.length&&(storeNudgeResponse(d,l,normalizePath(h.pathname)),g=findFreshCachedNudge(d,h,f))}}if(g||(g=findFreshCachedNudge(d,h,y)),!g)return;const w=g.data.nudges[Math.floor(Math.random()*g.data.nudges.length)],b=(s=g.data.delay)!==null&&s!==void 0?s:5;setTimeout(()=>{this.showNudgePopup(w,a)},b*1e3)}showNudgePopup(t,i){var n,s;const o=this.shadowRoot;if(!o||!(!((n=o.getElementById("medassist-widget-root"))===null||n===void 0)&&n.classList.contains("hidden")))return;const r=((typeof window!="undefined"?window.__ekaMedAssistConfig__:void 0)||{}).agentId||this.getAttribute("agent-id")||"";if(r&&getNudgeCookie(r)!==null||o.getElementById("medassist-nudge-popup"))return;const c=o.getElementById("medassist-open-btn"),h=c==null?void 0:c.getBoundingClientRect(),f=272,p=12,y=8,g=16,w=16;let b=window.innerWidth-f-p,v=76,m=f-g-y*2;if(h&&h.width>0){const A=h.left+h.width/2,S=A-f/2,C=window.innerWidth-f-p;b=Math.max(p,Math.min(S,C)),v=window.innerHeight-h.top+w,m=Math.max(g,Math.min(A-b-y,f-g-y*2))}const l=document.createElement("div");l.id="medassist-nudge-popup",l.innerHTML=`
13
13
  <style>
14
14
  @keyframes nudge-slide-up {
15
15
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
@@ -90,7 +90,7 @@
90
90
  <p class="nudge-text">${t.replace(/</g,"&lt;").replace(/>/g,"&gt;")}</p>
91
91
  <button class="nudge-close" aria-label="Dismiss">&#x2715;</button>
92
92
  </div>
93
- `,(o=l.querySelector(".nudge-close"))===null||o===void 0||o.addEventListener("click",A=>{A.stopPropagation(),d&&setNudgeCookie(d,"closed"),this.dismissNudgePopup()}),l.addEventListener("click",()=>{d&&setNudgeCookie(d,"closed"),this.dismissNudgePopup(),this.loadAndRender()}),s.appendChild(l)}dismissNudgePopup(){var t;const i=(t=this.shadowRoot)===null||t===void 0?void 0:t.getElementById("medassist-nudge-popup");i==null||i.remove()}applyCustomLauncherStyles(){var t;const i=this.shadowRoot;if(!i||this.displayMode==="full")return;const n=i.querySelector('style[data-medassist-custom-launcher="true"]'),o=(t=this.getAttribute("custom-launcher-styles"))!==null&&t!==void 0?t:"";if(!o){n==null||n.remove();return}if(n){n.textContent=o;return}const s=document.createElement("style");s.setAttribute("data-medassist-custom-launcher","true"),s.textContent=o,i.appendChild(s)}renderButton(){var t;const i=this.getAttribute("icon-url")||this.defaultIconUrl,n=this.shadowRoot;if(!n){console.error("Shadow root was not created");return}if(!n.querySelector("button"))n.innerHTML=`
93
+ `,(s=l.querySelector(".nudge-close"))===null||s===void 0||s.addEventListener("click",A=>{A.stopPropagation(),r&&setNudgeCookie(r,"closed"),this.dismissNudgePopup()}),l.addEventListener("click",()=>{r&&setNudgeCookie(r,"closed"),this.dismissNudgePopup(),this.loadAndRender()}),o.appendChild(l)}dismissNudgePopup(){var t;const i=(t=this.shadowRoot)===null||t===void 0?void 0:t.getElementById("medassist-nudge-popup");i==null||i.remove()}applyCustomLauncherStyles(){var t;const i=this.shadowRoot;if(!i||this.displayMode==="full")return;const n=i.querySelector('style[data-medassist-custom-launcher="true"]'),s=(t=this.getAttribute("custom-launcher-styles"))!==null&&t!==void 0?t:"";if(!s){n==null||n.remove();return}if(n){n.textContent=s;return}const o=document.createElement("style");o.setAttribute("data-medassist-custom-launcher","true"),o.textContent=s,i.appendChild(o)}renderButton(){var t;const i=this.getAttribute("icon-url")||this.defaultIconUrl,n=this.shadowRoot;if(!n){console.error("Shadow root was not created");return}if(!n.querySelector("button"))n.innerHTML=`
94
94
  <style>
95
95
  #medassist-open-btn {
96
96
  width: 60px;
@@ -164,7 +164,7 @@
164
164
  <span id="medassist-loader" aria-hidden="true"></span>
165
165
  </button>
166
166
  <div id="medassist-widget-root" class="hidden"></div>
167
- `,(t=n.getElementById("medassist-open-btn"))===null||t===void 0||t.addEventListener("click",()=>{const s=((typeof window!="undefined"?window.__ekaMedAssistConfig__:void 0)||{}).agentId||this.getAttribute("agent-id")||"";s&&setNudgeCookie(s,"closed"),this.dismissNudgePopup(),this.loadAndRender()});else{const o=n.querySelector("#medassist-open-btn img");o&&(o.src=i)}this.applyCustomLauncherStyles()}initializeFullMode(){const t=this.shadowRoot;if(!t){console.error("Shadow root is not available");return}t.getElementById("medassist-widget-root")||(t.innerHTML=`
167
+ `,(t=n.getElementById("medassist-open-btn"))===null||t===void 0||t.addEventListener("click",()=>{const o=((typeof window!="undefined"?window.__ekaMedAssistConfig__:void 0)||{}).agentId||this.getAttribute("agent-id")||"";o&&setNudgeCookie(o,"closed"),this.dismissNudgePopup(),this.loadAndRender()});else{const s=n.querySelector("#medassist-open-btn img");s&&(s.src=i)}this.applyCustomLauncherStyles()}initializeFullMode(){const t=this.shadowRoot;if(!t){console.error("Shadow root is not available");return}t.getElementById("medassist-widget-root")||(t.innerHTML=`
168
168
  <style>
169
169
  :host {
170
170
  display: block;
@@ -181,4 +181,4 @@
181
181
  }
182
182
  </style>
183
183
  <div id="medassist-widget-root"></div>
184
- `)}async loadAndRender(){var t,i,n;const o=this.shadowRoot;if(!o){console.error("Shadow root is not available");return}if(this.loading)return;this.prefetchAuthTokens(),this.style.display="";const s=o.getElementById("medassist-widget-root"),r=this.getAttribute("agent-id");let d=this.getAttribute("icon-url")||this.defaultIconUrl;const a=(t=getEnvironment(this.getAttribute("environment")))!==null&&t!==void 0?t:"production",c=this.getAttribute("connectivity"),h=c==="http_stream"||c==="socket"?c:void 0,f=this.getAttribute("force-start")==="true";let p=this.getAttribute("title")||"Medi Clinic";const y=this.getAttribute("base-url")||"https://matrix.eka.care/reloaded",g=this.getAttribute("display-mode"),w=normalizeDisplayMode(g),b=this.getAttribute("context")?JSON.parse(this.getAttribute("context")||"{}"):void 0,v=this.getAttribute("theme")?(()=>{try{return JSON.parse(this.getAttribute("theme")||"{}")}catch{return}})():void 0,m=this.getAttribute("feedback")?(()=>{try{return JSON.parse(this.getAttribute("feedback")||"{}")}catch{return}})():void 0,l=(typeof window!="undefined"?window.__ekaMedAssistConfig__:void 0)||{},A=this.getAttribute("side-panel-mode"),S=l.sidePanelMode||(A==="overlay"?"overlay":"push"),C=this.getAttribute("side-panel-width"),F=(i=l.sidePanelWidth)!==null&&i!==void 0?i:C?Number(C):void 0,O=l.side||this.getAttribute("side")||(typeof document!="undefined"&&document.dir==="rtl"?"left":"right"),D={...b||{},...l.context||{}},H=l.authToken||this.getAttribute("auth-token")||void 0,_=l.agentId||r,J=l.baseUrl||y,E=typeof window!="undefined"?(n=window.EkaMedAssist)===null||n===void 0?void 0:n.onClose:void 0,j=this.getAttribute("redirect-url")||void 0,P=l.redirectUrl||j,G=!!P||l.showCloseButton===!0;if(!_){console.error("Agent ID is required");return}if(!s){console.error("Widget root element is missing");return}this.loading=!0,this.setLauncherState("loading"),s.classList.remove("hidden");let L,U,N,R=!1,T,W=!1,M;const B=u=>{var x,k,I;p=u.name||p,d=((x=u.theme)===null||x===void 0?void 0:x.icon_img)||d,L=mapAgentConfigThemeToWidgetTheme(u.theme||void 0),U=u.allowed,N=u.connectivity,R=u.resize||(l==null?void 0:l.resize)||!1,T=u.initial_message,W=(I=(k=u.theme)===null||k===void 0?void 0:k.hide_watermark)!==null&&I!==void 0?I:!1,M=u.feedback},$=readAgentConfigCache(_);if($)B($),this.getAgentConfig().then(u=>{u&&writeAgentConfigCache(_,u)}).catch(()=>{});else try{const u=await this.getAgentConfig();u&&(writeAgentConfigCache(_,u),B(u))}catch{}const q=h||N||"socket",z={title:l.title||p,iconUrl:d||l.iconUrl,showCloseButton:G,allowed:U,environment:a,connectionType:q,onClose:()=>{var u;if((u=this.reactRoot)===null||u===void 0||u.unmount(),this.reactRoot=null,E&&typeof E=="function"&&E(),P){window.location.href=P;return}w==="full"?this.style.display="none":(this.setLauncherState("idle"),s.classList.add("hidden"))},baseUrl:J,context:D,displayMode:w,sidePanelMode:S,sidePanelWidth:F,side:O,onSidePanelPushChange:(u,x,k)=>this.applyHostPush(u,x,k),resize:R||this.getAttribute("resize")==="true",authToken:H,force:f,initialMessage:T,hideWatermark:W,...(m||M)&&{feedback:m||M},theme:{...L||{},...v||{},...l.theme||{}}},X=window;if(this.widgetLoaded){this.reactRoot=X.renderMedAssist(s,_,z),this.setLauncherState("open"),this.loading=!1;return}try{const[,u]=await Promise.all([this.loadWidgetCss(),this.loadWidgetModule()]);this.reactRoot=u.renderMedAssist(s,_,z),this.widgetLoaded=!0,this.setLauncherState("open")}catch(u){console.error("Failed to load MedAssist widget",u),this.setLauncherState("idle"),s.classList.add("hidden")}finally{this.loading=!1}}async loadWidgetCss(){const t=this.shadowRoot;if(!t)throw new Error("Shadow root is not available");if(t.querySelector("[data-medassist-style='true']"))return;const i=await getWidgetCssTextPromise(),n=document.createElement("style");n.setAttribute("data-medassist-style","true"),n.textContent=i,t.appendChild(n)}loadWidgetModule(){return widgetModulePromise||(widgetModulePromise=import(WIDGET_JS_URL)),widgetModulePromise}}customElements.define("eka-medassist-widget",MedAssistWidgetLoader);
184
+ `)}async loadAndRender(){var t,i,n;const s=this.shadowRoot;if(!s){console.error("Shadow root is not available");return}if(this.loading)return;this.prefetchAuthTokens(),this.style.display="";const o=s.getElementById("medassist-widget-root"),d=this.getAttribute("agent-id");let r=this.getAttribute("icon-url")||this.defaultIconUrl;const a=(t=getEnvironment(this.getAttribute("environment")))!==null&&t!==void 0?t:"production",c=this.getAttribute("connectivity"),h=c==="http_stream"||c==="socket"?c:void 0,f=this.getAttribute("force-start")==="true";let p=this.getAttribute("title")||"Medi Clinic";const y=this.getAttribute("base-url")||"https://matrix.eka.care/reloaded",g=this.getAttribute("display-mode"),w=normalizeDisplayMode(g),b=this.getAttribute("context")?JSON.parse(this.getAttribute("context")||"{}"):void 0,v=this.getAttribute("theme")?(()=>{try{return JSON.parse(this.getAttribute("theme")||"{}")}catch{return}})():void 0,m=this.getAttribute("feedback")?(()=>{try{return JSON.parse(this.getAttribute("feedback")||"{}")}catch{return}})():void 0,l=(typeof window!="undefined"?window.__ekaMedAssistConfig__:void 0)||{},A=this.getAttribute("side-panel-mode"),S=l.sidePanelMode||(A==="overlay"?"overlay":"push"),C=this.getAttribute("side-panel-width"),F=(i=l.sidePanelWidth)!==null&&i!==void 0?i:C?Number(C):void 0,O=l.side||this.getAttribute("side")||(typeof document!="undefined"&&document.dir==="rtl"?"left":"right"),D={...b||{},...l.context||{}},H=l.authToken||this.getAttribute("auth-token")||void 0,_=l.agentId||d,J=l.baseUrl||y,E=typeof window!="undefined"?(n=window.EkaMedAssist)===null||n===void 0?void 0:n.onClose:void 0,j=this.getAttribute("redirect-url")||void 0,P=l.redirectUrl||j,G=!!P||l.showCloseButton===!0;if(!_){console.error("Agent ID is required");return}if(!o){console.error("Widget root element is missing");return}this.loading=!0,this.setLauncherState("loading"),o.classList.remove("hidden");let L,U,N,R=!1,T,W=!1,M;const B=u=>{var x,k,I;p=u.name||p,r=((x=u.theme)===null||x===void 0?void 0:x.icon_img)||r,L=mapAgentConfigThemeToWidgetTheme(u.theme||void 0),U=u.allowed,N=u.connectivity,R=u.resize||(l==null?void 0:l.resize)||!1,T=u.initial_message,W=(I=(k=u.theme)===null||k===void 0?void 0:k.hide_watermark)!==null&&I!==void 0?I:!1,M=u.feedback},$=readAgentConfigCache(_);if($)B($),this.getAgentConfig().then(u=>{u&&writeAgentConfigCache(_,u)}).catch(()=>{});else try{const u=await this.getAgentConfig();u&&(writeAgentConfigCache(_,u),B(u))}catch{}const q=h||N||"socket",z={title:l.title||p,iconUrl:r||l.iconUrl,showCloseButton:G,allowed:U,environment:a,connectionType:q,onClose:()=>{var u;if((u=this.reactRoot)===null||u===void 0||u.unmount(),this.reactRoot=null,E&&typeof E=="function"&&E(),P){window.location.href=P;return}w==="full"?this.style.display="none":(this.setLauncherState("idle"),o.classList.add("hidden"))},baseUrl:J,context:D,...l.tools&&{tools:l.tools},displayMode:w,sidePanelMode:S,sidePanelWidth:F,side:O,onSidePanelPushChange:(u,x,k)=>this.applyHostPush(u,x,k),resize:R||this.getAttribute("resize")==="true",authToken:H,force:f,initialMessage:T,hideWatermark:W,...(m||M)&&{feedback:m||M},theme:{...L||{},...v||{},...l.theme||{}}},X=window;if(this.widgetLoaded){this.reactRoot=X.renderMedAssist(o,_,z),this.setLauncherState("open"),this.loading=!1;return}try{const[,u]=await Promise.all([this.loadWidgetCss(),this.loadWidgetModule()]);this.reactRoot=u.renderMedAssist(o,_,z),this.widgetLoaded=!0,this.setLauncherState("open")}catch(u){console.error("Failed to load MedAssist widget",u),this.setLauncherState("idle"),o.classList.add("hidden")}finally{this.loading=!1}}async loadWidgetCss(){const t=this.shadowRoot;if(!t)throw new Error("Shadow root is not available");if(t.querySelector("[data-medassist-style='true']"))return;const i=await getWidgetCssTextPromise(),n=document.createElement("style");n.setAttribute("data-medassist-style","true"),n.textContent=i,t.appendChild(n)}loadWidgetModule(){return widgetModulePromise||(widgetModulePromise=import(WIDGET_JS_URL)),widgetModulePromise}}customElements.define("eka-medassist-widget",MedAssistWidgetLoader);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eka-care/medassist-widget-embed",
3
- "version": "0.2.115",
3
+ "version": "0.2.116-0",
4
4
  "description": "Embeddable MedAssist widget loader built with Web Components.",
5
5
  "author": "Geethanjali S",
6
6
  "license": "MIT",