@eka-care/medassist-widget-embed 0.2.4 → 0.2.6

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.
@@ -26043,21 +26043,12 @@ var MedAssistWidget = (function(exports) {
26043
26043
  Component.displayName = toPascalCase(iconName);
26044
26044
  return Component;
26045
26045
  };
26046
- const __iconNode$h = [
26046
+ const __iconNode$k = [
26047
26047
  ["path", { d: "M5 12h14", key: "1ays0h" }],
26048
26048
  ["path", { d: "m12 5 7 7-7 7", key: "xquz4c" }]
26049
26049
  ];
26050
- const ArrowRight = createLucideIcon("arrow-right", __iconNode$h);
26051
- const __iconNode$g = [
26052
- ["path", { d: "M12 8V4H8", key: "hb8ula" }],
26053
- ["rect", { width: "16", height: "12", x: "4", y: "8", rx: "2", key: "enze0r" }],
26054
- ["path", { d: "M2 14h2", key: "vft8re" }],
26055
- ["path", { d: "M20 14h2", key: "4cs60a" }],
26056
- ["path", { d: "M15 13v2", key: "1xurst" }],
26057
- ["path", { d: "M9 13v2", key: "rq6x2g" }]
26058
- ];
26059
- const Bot = createLucideIcon("bot", __iconNode$g);
26060
- const __iconNode$f = [
26050
+ const ArrowRight = createLucideIcon("arrow-right", __iconNode$k);
26051
+ const __iconNode$j = [
26061
26052
  ["path", { d: "M10 12h4", key: "a56b0p" }],
26062
26053
  ["path", { d: "M10 8h4", key: "1sr2af" }],
26063
26054
  ["path", { d: "M14 21v-3a2 2 0 0 0-4 0v3", key: "1rgiei" }],
@@ -26070,28 +26061,28 @@ var MedAssistWidget = (function(exports) {
26070
26061
  ],
26071
26062
  ["path", { d: "M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16", key: "16ra0t" }]
26072
26063
  ];
26073
- const Building2 = createLucideIcon("building-2", __iconNode$f);
26074
- const __iconNode$e = [
26064
+ const Building2 = createLucideIcon("building-2", __iconNode$j);
26065
+ const __iconNode$i = [
26075
26066
  ["path", { d: "M8 2v4", key: "1cmpym" }],
26076
26067
  ["path", { d: "M16 2v4", key: "4m81vk" }],
26077
26068
  ["rect", { width: "18", height: "18", x: "3", y: "4", rx: "2", key: "1hopcy" }],
26078
26069
  ["path", { d: "M3 10h18", key: "8toen8" }]
26079
26070
  ];
26080
- const Calendar = createLucideIcon("calendar", __iconNode$e);
26081
- const __iconNode$d = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
26082
- const Check = createLucideIcon("check", __iconNode$d);
26083
- const __iconNode$c = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
26084
- const ChevronDown = createLucideIcon("chevron-down", __iconNode$c);
26085
- const __iconNode$b = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]];
26086
- const ChevronLeft = createLucideIcon("chevron-left", __iconNode$b);
26087
- const __iconNode$a = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]];
26088
- const ChevronRight = createLucideIcon("chevron-right", __iconNode$a);
26089
- const __iconNode$9 = [
26071
+ const Calendar = createLucideIcon("calendar", __iconNode$i);
26072
+ const __iconNode$h = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
26073
+ const Check = createLucideIcon("check", __iconNode$h);
26074
+ const __iconNode$g = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
26075
+ const ChevronDown = createLucideIcon("chevron-down", __iconNode$g);
26076
+ const __iconNode$f = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]];
26077
+ const ChevronLeft = createLucideIcon("chevron-left", __iconNode$f);
26078
+ const __iconNode$e = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]];
26079
+ const ChevronRight = createLucideIcon("chevron-right", __iconNode$e);
26080
+ const __iconNode$d = [
26090
26081
  ["path", { d: "M12 6v6l4 2", key: "mmk7yg" }],
26091
26082
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }]
26092
26083
  ];
26093
- const Clock = createLucideIcon("clock", __iconNode$9);
26094
- const __iconNode$8 = [
26084
+ const Clock = createLucideIcon("clock", __iconNode$d);
26085
+ const __iconNode$c = [
26095
26086
  [
26096
26087
  "path",
26097
26088
  {
@@ -26104,8 +26095,8 @@ var MedAssistWidget = (function(exports) {
26104
26095
  ["path", { d: "M16 13H8", key: "t4e002" }],
26105
26096
  ["path", { d: "M16 17H8", key: "z1uh3a" }]
26106
26097
  ];
26107
- const FileText = createLucideIcon("file-text", __iconNode$8);
26108
- const __iconNode$7 = [
26098
+ const FileText = createLucideIcon("file-text", __iconNode$c);
26099
+ const __iconNode$b = [
26109
26100
  ["path", { d: "m5 8 6 6", key: "1wu5hv" }],
26110
26101
  ["path", { d: "m4 14 6-6 2-3", key: "1k1g8d" }],
26111
26102
  ["path", { d: "M2 5h12", key: "or177f" }],
@@ -26113,10 +26104,38 @@ var MedAssistWidget = (function(exports) {
26113
26104
  ["path", { d: "m22 22-5-10-5 10", key: "don7ne" }],
26114
26105
  ["path", { d: "M14 18h6", key: "1m8k6r" }]
26115
26106
  ];
26116
- const Languages = createLucideIcon("languages", __iconNode$7);
26117
- const __iconNode$6 = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]];
26118
- const LoaderCircle = createLucideIcon("loader-circle", __iconNode$6);
26119
- const __iconNode$5 = [
26107
+ const Languages = createLucideIcon("languages", __iconNode$b);
26108
+ const __iconNode$a = [
26109
+ ["path", { d: "M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71", key: "1cjeqo" }],
26110
+ ["path", { d: "M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71", key: "19qd67" }]
26111
+ ];
26112
+ const Link = createLucideIcon("link", __iconNode$a);
26113
+ const __iconNode$9 = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]];
26114
+ const LoaderCircle = createLucideIcon("loader-circle", __iconNode$9);
26115
+ const __iconNode$8 = [
26116
+ [
26117
+ "path",
26118
+ {
26119
+ d: "M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",
26120
+ key: "1r0f0z"
26121
+ }
26122
+ ],
26123
+ ["circle", { cx: "12", cy: "10", r: "3", key: "ilqhr7" }]
26124
+ ];
26125
+ const MapPin = createLucideIcon("map-pin", __iconNode$8);
26126
+ const __iconNode$7 = [
26127
+ [
26128
+ "path",
26129
+ {
26130
+ d: "M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z",
26131
+ key: "169xi5"
26132
+ }
26133
+ ],
26134
+ ["path", { d: "M15 5.764v15", key: "1pn4in" }],
26135
+ ["path", { d: "M9 3.236v15", key: "1uimfh" }]
26136
+ ];
26137
+ const Map$1 = createLucideIcon("map", __iconNode$7);
26138
+ const __iconNode$6 = [
26120
26139
  [
26121
26140
  "path",
26122
26141
  {
@@ -26127,38 +26146,52 @@ var MedAssistWidget = (function(exports) {
26127
26146
  ["path", { d: "M12 8v6", key: "1ib9pf" }],
26128
26147
  ["path", { d: "M9 11h6", key: "1fldmi" }]
26129
26148
  ];
26130
- const MessageSquarePlus = createLucideIcon("message-square-plus", __iconNode$5);
26131
- const __iconNode$4 = [
26149
+ const MessageSquarePlus = createLucideIcon("message-square-plus", __iconNode$6);
26150
+ const __iconNode$5 = [
26132
26151
  ["path", { d: "M12 19v3", key: "npa21l" }],
26133
26152
  ["path", { d: "M19 10v2a7 7 0 0 1-14 0v-2", key: "1vc78b" }],
26134
26153
  ["rect", { x: "9", y: "2", width: "6", height: "13", rx: "3", key: "s6n7sd" }]
26135
26154
  ];
26136
- const Mic = createLucideIcon("mic", __iconNode$4);
26155
+ const Mic = createLucideIcon("mic", __iconNode$5);
26156
+ const __iconNode$4 = [
26157
+ ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }]
26158
+ ];
26159
+ const Square = createLucideIcon("square", __iconNode$4);
26137
26160
  const __iconNode$3 = [
26161
+ ["path", { d: "M7 10v12", key: "1qc93n" }],
26138
26162
  [
26139
26163
  "path",
26140
26164
  {
26141
- d: "m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",
26142
- key: "1miecu"
26165
+ d: "M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z",
26166
+ key: "emmmcr"
26143
26167
  }
26144
26168
  ]
26145
26169
  ];
26146
- const Paperclip = createLucideIcon("paperclip", __iconNode$3);
26170
+ const ThumbsUp = createLucideIcon("thumbs-up", __iconNode$3);
26147
26171
  const __iconNode$2 = [
26172
+ ["path", { d: "M17 14V2", key: "8ymqnk" }],
26148
26173
  [
26149
26174
  "path",
26150
26175
  {
26151
- d: "M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",
26152
- key: "1ffxy3"
26176
+ d: "M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z",
26177
+ key: "m61m77"
26153
26178
  }
26154
- ],
26155
- ["path", { d: "m21.854 2.147-10.94 10.939", key: "12cjpa" }]
26179
+ ]
26156
26180
  ];
26157
- const Send = createLucideIcon("send", __iconNode$2);
26181
+ const ThumbsDown = createLucideIcon("thumbs-down", __iconNode$2);
26158
26182
  const __iconNode$1 = [
26159
- ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }]
26183
+ [
26184
+ "path",
26185
+ {
26186
+ d: "M2 9a3 3 0 0 1 0 6v2a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2a3 3 0 0 1 0-6V7a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2Z",
26187
+ key: "qn84l0"
26188
+ }
26189
+ ],
26190
+ ["path", { d: "M13 5v2", key: "dyzc3o" }],
26191
+ ["path", { d: "M13 17v2", key: "1ont0d" }],
26192
+ ["path", { d: "M13 11v2", key: "1wjjxi" }]
26160
26193
  ];
26161
- const Square = createLucideIcon("square", __iconNode$1);
26194
+ const Ticket = createLucideIcon("ticket", __iconNode$1);
26162
26195
  const __iconNode = [
26163
26196
  ["path", { d: "M18 6 6 18", key: "1bl5f8" }],
26164
26197
  ["path", { d: "m6 6 12 12", key: "d8bk6v" }]
@@ -26169,7 +26202,8 @@ var MedAssistWidget = (function(exports) {
26169
26202
  {
26170
26203
  ref,
26171
26204
  className: cn(
26172
- "rounded-xl border bg-card text-card-foreground shadow",
26205
+ "rounded-xl bg-card text-card-foreground shadow",
26206
+ // Border removed by default - add it explicitly if needed with border-border-subtle
26173
26207
  className
26174
26208
  ),
26175
26209
  ...props
@@ -27437,7 +27471,7 @@ var MedAssistWidget = (function(exports) {
27437
27471
  });
27438
27472
  }
27439
27473
  async feedback(sessionId, messageId, feedback, feedback_reason) {
27440
- return this.patch(`${this.basePath}/${sessionId}/${messageId}`, {
27474
+ return this.put(`${this.basePath}/${sessionId}/message/${messageId}/feedback`, {
27441
27475
  feedback,
27442
27476
  feedback_reason
27443
27477
  });
@@ -27467,7 +27501,8 @@ var MedAssistWidget = (function(exports) {
27467
27501
  MOBILE_VERIFICATION: "mobile_verification",
27468
27502
  PILL: "pills",
27469
27503
  MULTI: "multi",
27470
- DOCTOR_CARD: "doctor_card"
27504
+ DOCTOR_CARD: "doctor_card",
27505
+ CARD: "card"
27471
27506
  };
27472
27507
  var SYNAPSE_TOOL_CALLBACK_NAME;
27473
27508
  (function(SYNAPSE_TOOL_CALLBACK_NAME2) {
@@ -27535,6 +27570,23 @@ var MedAssistWidget = (function(exports) {
27535
27570
  ToolCall.ToolCall = ToolCall$1;
27536
27571
  return ToolCall;
27537
27572
  }
27573
+ var Config = {};
27574
+ var hasRequiredConfig;
27575
+ function requireConfig() {
27576
+ if (hasRequiredConfig) return Config;
27577
+ hasRequiredConfig = 1;
27578
+ Object.defineProperty(Config, "__esModule", { value: true });
27579
+ Config.Config = void 0;
27580
+ const BaseResource_1 = /* @__PURE__ */ requireBaseResource();
27581
+ let Config$1 = class Config extends BaseResource_1.BaseResource {
27582
+ basePath = "/med-assist/agent-config";
27583
+ async retrieve(agentId) {
27584
+ return this.get(`${this.basePath}/${agentId}`);
27585
+ }
27586
+ };
27587
+ Config.Config = Config$1;
27588
+ return Config;
27589
+ }
27538
27590
  var hasRequiredResources;
27539
27591
  function requireResources() {
27540
27592
  if (hasRequiredResources) return resources;
@@ -27545,11 +27597,13 @@ var MedAssistWidget = (function(exports) {
27545
27597
  const Session_1 = /* @__PURE__ */ requireSession();
27546
27598
  const Error_1 = /* @__PURE__ */ require_Error$1();
27547
27599
  const ToolCall_1 = /* @__PURE__ */ requireToolCall();
27600
+ const Config_1 = /* @__PURE__ */ requireConfig();
27548
27601
  class ResourceManager {
27549
27602
  resourceConfig;
27550
27603
  httpClient;
27551
27604
  session;
27552
27605
  toolCall = null;
27606
+ config;
27553
27607
  constructor(config) {
27554
27608
  this.resourceConfig = config;
27555
27609
  this.httpClient = new HttpClient_1.HttpClient({
@@ -27561,6 +27615,7 @@ var MedAssistWidget = (function(exports) {
27561
27615
  }
27562
27616
  // authorization: config.authorization,
27563
27617
  });
27618
+ this.config = new Config_1.Config(this.httpClient);
27564
27619
  this.session = new Session_1.Session(this.httpClient);
27565
27620
  }
27566
27621
  /**
@@ -27570,7 +27625,7 @@ var MedAssistWidget = (function(exports) {
27570
27625
  try {
27571
27626
  const { profile, intent, user_location, referer, ...extraContext } = context || {};
27572
27627
  const sessionRequest = {
27573
- user_id: userId,
27628
+ ...userId && { user_id: userId },
27574
27629
  ...profile && { user_context: profile },
27575
27630
  ...(intent || Object.keys(extraContext).length > 0) && {
27576
27631
  session_context: {
@@ -27594,6 +27649,16 @@ var MedAssistWidget = (function(exports) {
27594
27649
  throw new Error_1.APIError("Failed to start session.", 500, void 0, void 0);
27595
27650
  }
27596
27651
  }
27652
+ async getAgentConfig() {
27653
+ if (!this.config) {
27654
+ this.config = new Config_1.Config(this.httpClient);
27655
+ }
27656
+ try {
27657
+ return await this.config.retrieve(this.resourceConfig.agentId);
27658
+ } catch (error) {
27659
+ throw new Error_1.APIError("Failed to get agent config.", 500, void 0, void 0);
27660
+ }
27661
+ }
27597
27662
  /**
27598
27663
  * Validate a session if it's still active or not
27599
27664
  * GET /med-assist/session/:sessionId
@@ -28486,9 +28551,6 @@ var MedAssistWidget = (function(exports) {
28486
28551
  case types_1.SYNAPSE_REALTIME_ERROR_CODES.SESSION_EXPIRED:
28487
28552
  connection.emit(types_1.SYNAPSE_REALTIME_RESERVED_EVENTS.SESSION_EXPIRED);
28488
28553
  break;
28489
- case types_1.SYNAPSE_REALTIME_ERROR_CODES.INVALID_EVENT:
28490
- console.log("invalid event error", message);
28491
- break;
28492
28554
  default:
28493
28555
  const error = new Error_1.MessageError(message?.data?.msg || "Socket error received", {
28494
28556
  context: {
@@ -28844,6 +28906,32 @@ var MedAssistWidget = (function(exports) {
28844
28906
  throw error;
28845
28907
  }
28846
28908
  }
28909
+ /**
28910
+ * Send feedback on a message
28911
+ */
28912
+ async sendFeedback(messageId, feedback, reason) {
28913
+ if (!this.connection) {
28914
+ const error = new Error_2.ConnectionError("Connection not established. Session may not be initialized.", {
28915
+ context: { stage: "sendFeedback" },
28916
+ hint: "Call startSession() before attempting to send feedback."
28917
+ });
28918
+ this.emitError(error);
28919
+ throw error;
28920
+ }
28921
+ if (!this.sessionConfig?.session_id) {
28922
+ const error = new Error_2.SessionError("Session ID not found", {
28923
+ context: { stage: "sendFeedback" },
28924
+ hint: "Call startSession() before attempting to send feedback."
28925
+ });
28926
+ this.emitError(error);
28927
+ throw error;
28928
+ }
28929
+ switch (this.connectionType) {
28930
+ case ConnectionFactory_1.ConnectionType.SOCKET:
28931
+ this.resourceManager.sendFeedback(this.sessionConfig?.session_id, messageId, feedback, reason);
28932
+ break;
28933
+ }
28934
+ }
28847
28935
  /**
28848
28936
  * Register a listener for a specific event
28849
28937
  */
@@ -28972,9 +29060,9 @@ var MedAssistWidget = (function(exports) {
28972
29060
  // /**
28973
29061
  // * Get the agent configuration
28974
29062
  // */
28975
- // public getAgentConfig(): AgentConfig | null {
28976
- // return this.agentConfig;
28977
- // }
29063
+ async getAgentConfig() {
29064
+ return this.resourceManager.getAgentConfig();
29065
+ }
28978
29066
  isConnected() {
28979
29067
  return this.connection?.isConnected() ?? false;
28980
29068
  }
@@ -29084,7 +29172,7 @@ var MedAssistWidget = (function(exports) {
29084
29172
  * Create a new session
29085
29173
  */
29086
29174
  async createNewSession() {
29087
- return await this.resourceManager.createSession(this.config.userId || Date.now().toString(), this.config.context);
29175
+ return await this.resourceManager.createSession(this.config.userId, this.config.context);
29088
29176
  }
29089
29177
  /**
29090
29178
  * Set up event handlers for connection and messages
@@ -29784,6 +29872,7 @@ var MedAssistWidget = (function(exports) {
29784
29872
  function ProfileHeader({
29785
29873
  onClose,
29786
29874
  title,
29875
+ titleImg,
29787
29876
  iconUrl,
29788
29877
  startNewConversation
29789
29878
  }) {
@@ -29810,24 +29899,24 @@ var MedAssistWidget = (function(exports) {
29810
29899
  };
29811
29900
  default:
29812
29901
  return {
29813
- dotColor: "bg-gray-400",
29902
+ dotColor: "bg-text-tertiary",
29814
29903
  text: "Not Connected",
29815
- textColor: "text-gray-600"
29904
+ textColor: "text-text-secondary"
29816
29905
  };
29817
29906
  }
29818
29907
  };
29819
29908
  const statusConfig = getStatusConfig();
29820
- return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "bg-lavender-100/95 backdrop-blur-md shadow-lg border-b border-lavender-200/60 px-6 py-2", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between", children: [
29909
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "px-6 py-2", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between", children: [
29821
29910
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-3", children: [
29822
29911
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "relative flex-shrink-0", children: [
29823
- /* @__PURE__ */ jsxRuntimeExports.jsx(Avatar, { className: "w-12 h-12 bg-gradient-to-br from-lavender-400 to-lavender-500 flex-shrink-0 shadow-md ring-0", children: /* @__PURE__ */ jsxRuntimeExports.jsx(AvatarFallback, { className: "text-white font-bold text-lg bg-transparent", children: iconUrl ? /* @__PURE__ */ jsxRuntimeExports.jsx(
29912
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Avatar, { className: "w-12 h-12 bg-gradient-to-br from-primary to-primary flex-shrink-0 shadow-md ring-0", children: /* @__PURE__ */ jsxRuntimeExports.jsx(AvatarFallback, { className: "text-primary-foreground font-bold text-lg bg-transparent", children: iconUrl ? /* @__PURE__ */ jsxRuntimeExports.jsx(
29824
29913
  "img",
29825
29914
  {
29826
29915
  src: iconUrl,
29827
29916
  alt: "Bot Icon",
29828
29917
  className: "w-12 h-12 rounded-full object-cover"
29829
29918
  }
29830
- ) : /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-white font-bold text-lg bg-transparent", children: "MC" }) }) }),
29919
+ ) : /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-primary-foreground font-bold text-lg bg-transparent", children: "MC" }) }) }),
29831
29920
  /* @__PURE__ */ jsxRuntimeExports.jsx(
29832
29921
  "div",
29833
29922
  {
@@ -29840,7 +29929,7 @@ var MedAssistWidget = (function(exports) {
29840
29929
  )
29841
29930
  ] }),
29842
29931
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col", children: [
29843
- /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-lg font-semibold text-slate-900", children: title || "Health Assist" }),
29932
+ titleImg ? /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: titleImg, alt: "", className: "h-6 object-contain" }) : /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-lg font-semibold text-foreground", children: title || "Health Assist" }),
29844
29933
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center gap-1.5", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
29845
29934
  "span",
29846
29935
  {
@@ -29859,7 +29948,7 @@ var MedAssistWidget = (function(exports) {
29859
29948
  size: "icon",
29860
29949
  title: "Start New Chat",
29861
29950
  onClick: startNewConversation,
29862
- className: "h-8 w-8 text-slate-600 hover:text-slate-900 hover:bg-white/60 active:bg-white/80 rounded-xl transition-all duration-200",
29951
+ className: "h-8 w-8 text-foreground hover:bg-secondary rounded-xl transition-all duration-200",
29863
29952
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(MessageSquarePlus, { className: "w-8 h-8" })
29864
29953
  }
29865
29954
  ),
@@ -29871,7 +29960,7 @@ var MedAssistWidget = (function(exports) {
29871
29960
  variant: "ghost",
29872
29961
  size: "icon",
29873
29962
  title: "Close",
29874
- className: "h-8 w-8 text-slate-600 hover:text-slate-900 hover:bg-white/60 active:bg-white/80 rounded-xl transition-all duration-200",
29963
+ className: "h-8 w-8 text-foreground hover:bg-secondary rounded-xl transition-all duration-200",
29875
29964
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(X, { className: "w-8 h-8" })
29876
29965
  }
29877
29966
  )
@@ -29989,6 +30078,307 @@ var MedAssistWidget = (function(exports) {
29989
30078
  setPosition
29990
30079
  };
29991
30080
  }
30081
+ const DEFAULT_PRIMARY_HEX = "#6B5CE0";
30082
+ const DEFAULT_BACKGROUND_HEX = "#F0F0F0";
30083
+ const DEFAULT_THEME = {
30084
+ background: DEFAULT_BACKGROUND_HEX,
30085
+ // base-50 (#F0F0F0)
30086
+ backgroundImage: void 0,
30087
+ primary: DEFAULT_PRIMARY_HEX,
30088
+ textColor: "black"
30089
+ };
30090
+ const BACKGROUND_OVERLAY = "rgba(0, 0, 0, 0.4)";
30091
+ const BACKGROUND_BLUR = "24px";
30092
+ function textColorFromMode(mode) {
30093
+ if (mode === "dark") return "white";
30094
+ if (mode === "light") return "black";
30095
+ return void 0;
30096
+ }
30097
+ function mergeTheme(userTheme) {
30098
+ const primary = userTheme?.primary ?? userTheme?.primaryColor ?? DEFAULT_THEME.primary;
30099
+ const derivedTextColor = userTheme?.textColor ?? textColorFromMode(userTheme?.mode);
30100
+ return {
30101
+ background: userTheme?.background ?? DEFAULT_THEME.background,
30102
+ backgroundImage: userTheme?.backgroundImage ?? DEFAULT_THEME.backgroundImage,
30103
+ primary,
30104
+ primaryColor: primary,
30105
+ textColor: derivedTextColor ?? DEFAULT_THEME.textColor,
30106
+ secondaryColor: userTheme?.secondaryColor,
30107
+ tertiaryColor: userTheme?.tertiaryColor
30108
+ };
30109
+ }
30110
+ function hexToHSL(hex) {
30111
+ hex = hex.replace("#", "");
30112
+ const r2 = parseInt(hex.substring(0, 2), 16) / 255;
30113
+ const g = parseInt(hex.substring(2, 4), 16) / 255;
30114
+ const b = parseInt(hex.substring(4, 6), 16) / 255;
30115
+ const max = Math.max(r2, g, b);
30116
+ const min = Math.min(r2, g, b);
30117
+ let h = 0;
30118
+ let s = 0;
30119
+ const l = (max + min) / 2;
30120
+ if (max !== min) {
30121
+ const d = max - min;
30122
+ s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
30123
+ switch (max) {
30124
+ case r2:
30125
+ h = ((g - b) / d + (g < b ? 6 : 0)) / 6;
30126
+ break;
30127
+ case g:
30128
+ h = ((b - r2) / d + 2) / 6;
30129
+ break;
30130
+ case b:
30131
+ h = ((r2 - g) / d + 4) / 6;
30132
+ break;
30133
+ }
30134
+ }
30135
+ h = Math.round(h * 360);
30136
+ s = Math.round(s * 100);
30137
+ const lPercent = Math.round(l * 100);
30138
+ return `${h} ${s}% ${lPercent}%`;
30139
+ }
30140
+ function rgbToHSL(rgb) {
30141
+ const match = rgb.match(/rgb\((\d+),\s*(\d+),\s*(\d+)\)/);
30142
+ if (!match) throw new Error("Invalid RGB format");
30143
+ const r2 = parseInt(match[1], 10) / 255;
30144
+ const g = parseInt(match[2], 10) / 255;
30145
+ const b = parseInt(match[3], 10) / 255;
30146
+ const max = Math.max(r2, g, b);
30147
+ const min = Math.min(r2, g, b);
30148
+ let h = 0;
30149
+ let s = 0;
30150
+ const l = (max + min) / 2;
30151
+ if (max !== min) {
30152
+ const d = max - min;
30153
+ s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
30154
+ switch (max) {
30155
+ case r2:
30156
+ h = ((g - b) / d + (g < b ? 6 : 0)) / 6;
30157
+ break;
30158
+ case g:
30159
+ h = ((b - r2) / d + 2) / 6;
30160
+ break;
30161
+ case b:
30162
+ h = ((r2 - g) / d + 4) / 6;
30163
+ break;
30164
+ }
30165
+ }
30166
+ h = Math.round(h * 360);
30167
+ s = Math.round(s * 100);
30168
+ const lPercent = Math.round(l * 100);
30169
+ return `${h} ${s}% ${lPercent}%`;
30170
+ }
30171
+ function extractHSL(hsl) {
30172
+ const match = hsl.match(/hsl\((\d+),\s*(\d+)%,\s*(\d+)%\)/);
30173
+ if (!match) throw new Error("Invalid HSL format");
30174
+ return `${match[1]} ${match[2]}% ${match[3]}%`;
30175
+ }
30176
+ function normalizeColorToHSL(color2) {
30177
+ if (!color2 || typeof color2 !== "string") throw new Error("Color must be a non-empty string");
30178
+ const trimmedColor = color2.trim();
30179
+ if (trimmedColor.startsWith("#")) return hexToHSL(trimmedColor);
30180
+ if (trimmedColor.startsWith("rgb")) return rgbToHSL(trimmedColor);
30181
+ if (trimmedColor.startsWith("hsl")) return extractHSL(trimmedColor);
30182
+ if (/^\d+\s+\d+%\s+\d+%$/.test(trimmedColor)) return trimmedColor;
30183
+ throw new Error(`Unsupported color format: ${color2}`);
30184
+ }
30185
+ function getLuminance(hsl) {
30186
+ const match = hsl.match(/(\d+)\s+(\d+)%\s+(\d+)%/);
30187
+ if (!match) return 0.5;
30188
+ return parseInt(match[3], 10) / 100;
30189
+ }
30190
+ function calculateForegroundColor(backgroundColor) {
30191
+ const luminance = getLuminance(backgroundColor);
30192
+ return luminance > 0.5 ? "0 0% 9%" : "0 0% 98%";
30193
+ }
30194
+ function calculateBorderFromText(textColor) {
30195
+ const match = textColor.match(/(\d+)\s+(\d+)%\s+(\d+)%/);
30196
+ if (!match) return "0 0% 96%";
30197
+ const h = match[1];
30198
+ const s = Math.max(0, parseInt(match[2], 10) - 5);
30199
+ return `${h} ${s}% 96%`;
30200
+ }
30201
+ function generateColorScale(baseHsl) {
30202
+ const match = baseHsl.match(/(\d+)\s+(\d+)%\s+(\d+)%/);
30203
+ if (!match) {
30204
+ return {
30205
+ 50: "262 83% 98%",
30206
+ 100: "262 83% 96%",
30207
+ 200: "262 83% 92%",
30208
+ 300: "262 83% 85%",
30209
+ 400: "262 83% 75%",
30210
+ 500: "262 83% 58%",
30211
+ 600: "262 83% 50%",
30212
+ 700: "262 83% 40%",
30213
+ 800: "262 83% 30%",
30214
+ 900: "262 83% 20%"
30215
+ };
30216
+ }
30217
+ const h = parseInt(match[1], 10);
30218
+ const s = parseInt(match[2], 10);
30219
+ const l = parseInt(match[3], 10);
30220
+ return {
30221
+ 50: `${h} ${Math.max(0, s - 20)}% ${Math.min(98, l + 40)}%`,
30222
+ 100: `${h} ${Math.max(0, s - 15)}% ${Math.min(96, l + 35)}%`,
30223
+ 200: `${h} ${Math.max(0, s - 10)}% ${Math.min(92, l + 30)}%`,
30224
+ 300: `${h} ${Math.max(0, s - 5)}% ${Math.min(85, l + 20)}%`,
30225
+ 400: `${h} ${s}% ${Math.min(75, l + 10)}%`,
30226
+ 500: `${h} ${s}% ${l}%`,
30227
+ // Base color
30228
+ 600: `${h} ${Math.min(100, s + 5)}% ${Math.max(50, l - 10)}%`,
30229
+ 700: `${h} ${Math.min(100, s + 10)}% ${Math.max(40, l - 20)}%`,
30230
+ 800: `${h} ${Math.min(100, s + 15)}% ${Math.max(30, l - 30)}%`,
30231
+ 900: `${h} ${Math.min(100, s + 20)}% ${Math.max(20, l - 40)}%`
30232
+ };
30233
+ }
30234
+ function applyTheme(rootElement, theme) {
30235
+ const primaryInput = theme.primary ?? DEFAULT_PRIMARY_HEX;
30236
+ const textColor = theme.textColor ?? "black";
30237
+ const hasBackgroundImage = Boolean(theme.backgroundImage);
30238
+ const setProperty = (property, value) => {
30239
+ const el = rootElement instanceof ShadowRoot ? rootElement.host : rootElement;
30240
+ if (el instanceof HTMLElement) el.style.setProperty(property, value);
30241
+ };
30242
+ if (hasBackgroundImage) {
30243
+ setProperty("--background", "0 0% 0% / 0");
30244
+ } else {
30245
+ const bgColor = theme.background ?? DEFAULT_BACKGROUND_HEX;
30246
+ try {
30247
+ setProperty("--background", normalizeColorToHSL(bgColor));
30248
+ } catch (e) {
30249
+ console.warn("Failed to apply background color:", e);
30250
+ setProperty("--background", "0 0% 94.1%");
30251
+ }
30252
+ }
30253
+ let primaryHsl;
30254
+ try {
30255
+ primaryHsl = normalizeColorToHSL(primaryInput);
30256
+ setProperty("--primary", primaryHsl);
30257
+ setProperty("--primary-foreground", calculateForegroundColor(primaryHsl));
30258
+ setProperty("--ring", primaryHsl);
30259
+ setProperty("--border-primary", primaryHsl);
30260
+ const primaryScale = generateColorScale(primaryHsl);
30261
+ for (const [step, hslValue] of Object.entries(primaryScale)) {
30262
+ setProperty(`--primary-${step}`, hslValue);
30263
+ }
30264
+ } catch (e) {
30265
+ console.warn("Failed to apply primary color:", e);
30266
+ primaryHsl = normalizeColorToHSL(DEFAULT_PRIMARY_HEX);
30267
+ setProperty("--primary", primaryHsl);
30268
+ setProperty("--primary-foreground", calculateForegroundColor(primaryHsl));
30269
+ setProperty("--ring", primaryHsl);
30270
+ setProperty("--border-primary", primaryHsl);
30271
+ const defaultScale = generateColorScale(primaryHsl);
30272
+ for (const [step, hslValue] of Object.entries(defaultScale)) {
30273
+ setProperty(`--primary-${step}`, hslValue);
30274
+ }
30275
+ }
30276
+ if (textColor === "white") {
30277
+ setProperty("--foreground", "0 0% 100%");
30278
+ setProperty("--card-foreground", "0 0% 100%");
30279
+ setProperty("--popover-foreground", "0 0% 100%");
30280
+ setProperty("--muted-foreground", "0 0% 70%");
30281
+ } else {
30282
+ setProperty("--foreground", "0 0% 9%");
30283
+ setProperty("--card-foreground", "0 0% 9%");
30284
+ setProperty("--popover-foreground", "0 0% 9%");
30285
+ setProperty("--muted-foreground", "0 0% 30%");
30286
+ }
30287
+ const host = rootElement instanceof ShadowRoot ? rootElement.host : rootElement;
30288
+ if (host instanceof HTMLElement) {
30289
+ host.setAttribute("data-text-color", textColor);
30290
+ }
30291
+ if (hasBackgroundImage) {
30292
+ if (textColor === "white") {
30293
+ setProperty("--bot-message-bg", "rgba(0, 0, 0, 0.6)");
30294
+ } else {
30295
+ setProperty("--bot-message-bg", "rgba(255, 255, 255, 0.6)");
30296
+ }
30297
+ } else {
30298
+ if (textColor === "white") {
30299
+ setProperty("--bot-message-bg", "rgba(0, 0, 0, 0.6)");
30300
+ } else {
30301
+ setProperty("--bot-message-bg", "rgba(255, 255, 255, 0.6)");
30302
+ }
30303
+ }
30304
+ if (textColor === "white") {
30305
+ setProperty("--card", "0 0% 0% / 0.6");
30306
+ } else {
30307
+ setProperty("--card", "0 0% 100% / 0.6");
30308
+ }
30309
+ setProperty("--bot-message-border", calculateBorderFromText(textColor === "white" ? "0 0% 100%" : "0 0% 9%"));
30310
+ if (hasBackgroundImage) {
30311
+ setProperty("--popover", textColor === "white" ? "0 0% 0% / 0.5" : "0 0% 100% / 0.5");
30312
+ } else {
30313
+ if (textColor === "white") {
30314
+ setProperty("--popover", "0 0% 0%");
30315
+ } else {
30316
+ setProperty("--popover", "0 0% 100%");
30317
+ }
30318
+ }
30319
+ const popoverScale = textColor === "white" ? "white" : "black";
30320
+ for (const step of [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 1e3]) {
30321
+ setProperty(`--popover-${step}`, `var(--${popoverScale}-${step})`);
30322
+ }
30323
+ setProperty("--secondary", "0 0% 96.1%");
30324
+ setProperty("--surface-secondary", "0 0% 96.1%");
30325
+ setProperty("--secondary-foreground", textColor === "white" ? "0 0% 98%" : "0 0% 9%");
30326
+ setProperty("--muted", "0 0% 96.1%");
30327
+ setProperty("--accent", primaryInput ? normalizeColorToHSL(primaryInput) : "0 0% 96.1%");
30328
+ setProperty("--accent-foreground", primaryInput ? calculateForegroundColor(normalizeColorToHSL(primaryInput)) : "0 0% 9%");
30329
+ if (hasBackgroundImage) {
30330
+ if (textColor === "white") {
30331
+ setProperty("--surface", "0 0% 0% / 0.6");
30332
+ } else {
30333
+ setProperty("--surface", "0 0% 100% / 0.6");
30334
+ }
30335
+ } else {
30336
+ const bgColor = theme.background ?? DEFAULT_BACKGROUND_HEX;
30337
+ try {
30338
+ setProperty("--surface", normalizeColorToHSL(bgColor));
30339
+ } catch (e) {
30340
+ setProperty("--surface", "0 0% 94.1%");
30341
+ }
30342
+ }
30343
+ setProperty("--surface-tertiary", "0 0% 98%");
30344
+ setProperty("--border-subtle", "0 0% 89.8%");
30345
+ setProperty("--border-medium", "0 0% 80%");
30346
+ setProperty("--text-primary", textColor === "white" ? "0 0% 100%" : "0 0% 3.9%");
30347
+ setProperty("--text-secondary", textColor === "white" ? "0 0% 70%" : "0 0% 45.1%");
30348
+ setProperty("--text-tertiary", textColor === "white" ? "0 0% 60%" : "0 0% 63.9%");
30349
+ setProperty("--text-muted", textColor === "white" ? "0 0% 70%" : "0 0% 45.1%");
30350
+ setProperty("--border", "0 0% 89.8%");
30351
+ setProperty("--input", "0 0% 89.8%");
30352
+ if (hasBackgroundImage) {
30353
+ setProperty("--theme-background-image", `url(${theme.backgroundImage})`);
30354
+ setProperty("--theme-background-blur", BACKGROUND_BLUR);
30355
+ setProperty("--theme-background-overlay", BACKGROUND_OVERLAY);
30356
+ const host2 = rootElement instanceof ShadowRoot ? rootElement.host : rootElement;
30357
+ if (host2 instanceof HTMLElement) host2.classList.add("theme-with-background");
30358
+ } else {
30359
+ setProperty("--theme-background-image", "none");
30360
+ setProperty("--theme-background-blur", "0px");
30361
+ setProperty("--theme-background-overlay", "rgba(0, 0, 0, 0)");
30362
+ const host2 = rootElement instanceof ShadowRoot ? rootElement.host : rootElement;
30363
+ if (host2 instanceof HTMLElement) host2.classList.remove("theme-with-background");
30364
+ }
30365
+ }
30366
+ const EkaCareLogo = ({ className }) => {
30367
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("svg", { width: "42", height: "12", viewBox: "0 0 42 12", fill: "none", xmlns: "http://www.w3.org/2000/svg", className, children: [
30368
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("g", { "clip-path": "url(#clip0_988_2228)", children: [
30369
+ /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M10.3286 7.50625C10.2316 7.32816 10.1101 7.1655 9.96865 7.02251L9.20362 6.25748L8.46797 6.99311L9.22391 7.74906C9.42548 7.95041 9.55007 8.22876 9.55007 8.53631C9.55007 8.84384 9.43437 9.10189 9.24548 9.30156L9.24486 9.30219C9.23787 9.30939 9.23089 9.31658 9.22391 9.32376C8.73595 9.82378 8.13758 10.2159 7.46836 10.4609C6.96306 10.6457 6.41714 10.7466 5.84796 10.7466C5.3655 10.7466 4.90017 10.6743 4.46193 10.5395C4.10277 10.4296 3.76225 10.2775 3.44539 10.0897C2.06021 9.26793 1.13147 7.75751 1.13147 6.03011C1.13147 4.30269 2.06021 2.79208 3.44539 1.97035C3.76331 1.78189 4.10531 1.6296 4.46575 1.51939C4.90293 1.38529 5.36719 1.31338 5.84817 1.31338C6.41588 1.31338 6.96011 1.41363 7.46414 1.59745C8.13483 1.84217 8.73447 2.23451 9.22328 2.73559C9.22983 2.74214 9.23618 2.74871 9.24254 2.75526C9.43309 2.95514 9.55007 3.22566 9.55007 3.52369C9.55007 3.8217 9.42548 4.10935 9.22391 4.31092L9.0528 4.48225L8.24059 5.29424L6.4698 3.52348C6.41166 3.46593 6.35032 3.41179 6.28601 3.36104C5.91987 3.07337 5.45793 2.90163 4.95603 2.90163C4.77794 2.90163 4.60492 2.9232 4.43929 2.96422C4.32147 2.99299 4.20747 3.03169 4.09833 3.07929C4.08987 3.08289 4.08142 3.0867 4.07318 3.09049C3.32378 3.42745 2.80197 4.18064 2.80197 5.05566C2.80197 5.10917 2.80388 5.16227 2.80789 5.21493C2.80789 5.21706 2.80811 5.21916 2.80833 5.2215C2.80917 5.2344 2.81046 5.2473 2.81171 5.2602C2.83879 5.49074 2.97987 5.68661 3.177 5.78962C3.27218 5.83931 3.38046 5.86746 3.49533 5.86746H3.49637C3.69922 5.86724 3.88176 5.77904 4.0074 5.63902C4.11696 5.51738 4.18358 5.35623 4.18358 5.17939C4.18358 5.11784 4.17554 5.05841 4.16054 5.00174C4.12181 4.85684 4.03699 4.73057 3.92277 4.64005C4.08756 4.23098 4.48795 3.94228 4.95603 3.94228C5.26356 3.94228 5.5419 4.06686 5.74347 4.26843L7.50497 6.02989L7.04747 6.48739L5.73396 7.80088C5.53323 7.99697 5.2587 8.11773 4.95603 8.11773C4.79528 8.11773 4.64234 8.08367 4.50423 8.02233C4.50338 8.02192 4.50232 8.02149 4.50128 8.02108C4.239 7.90348 4.03045 7.6875 3.92277 7.42015C4.03699 7.32941 4.12181 7.20336 4.16054 7.05827C4.17554 7.00179 4.18358 6.94214 4.18358 6.8808C4.18358 6.70397 4.11696 6.54281 4.0074 6.42099C3.88176 6.28116 3.69963 6.19296 3.4968 6.19255H3.49533C3.38046 6.19255 3.27218 6.22067 3.177 6.27039C2.97922 6.3738 2.83795 6.57052 2.81149 6.8019C2.8113 6.80488 2.81087 6.80763 2.81065 6.81036C2.8098 6.81969 2.80896 6.82877 2.80833 6.83807C2.80833 6.8406 2.80833 6.84295 2.80789 6.84527C2.80388 6.89774 2.80197 6.95081 2.80197 7.0041C2.80197 7.87915 3.32378 8.63256 4.07318 8.96948L4.09833 8.98069C4.20747 9.02828 4.32147 9.06699 4.43929 9.09576C4.60492 9.1368 4.77794 9.15838 4.95603 9.15838C5.45921 9.15838 5.922 8.98598 6.28855 8.69684C6.32346 8.66935 6.35749 8.64058 6.39071 8.61077L6.39156 8.60992L7.99165 7.00983L8.23827 6.7632L8.9739 6.02758L9.19176 5.80991L9.38275 5.61892L9.95722 5.04426C10.103 4.89851 10.228 4.73185 10.3274 4.54931C10.4936 4.24367 10.5882 3.8934 10.5882 3.52116C10.5882 3.34432 10.5668 3.17259 10.5266 3.00824C10.4359 2.63659 10.2489 2.30283 9.99338 2.03507C9.98556 2.0268 9.97776 2.01879 9.96949 2.01074C9.96843 2.00968 9.96758 2.00883 9.96674 2.00777C9.96019 2.00144 9.95384 1.99487 9.94748 1.98854C9.94601 1.98685 9.94454 1.98557 9.94307 1.98429C8.89945 0.927795 7.45039 0.272949 5.84817 0.272949C5.07066 0.272949 4.3293 0.426931 3.65269 0.70634C3.31448 0.845949 2.99256 1.01684 2.69029 1.21525C1.12448 2.24447 0.0908203 4.01651 0.0908203 6.03011C0.0908203 8.04368 1.12448 9.81576 2.69029 10.8448C2.99149 11.0425 3.31236 11.213 3.64931 11.3522C4.32677 11.6326 5.0694 11.7872 5.84817 11.7872C7.45885 11.7872 8.9151 11.1256 9.95976 10.0594L9.96464 10.0546C9.96802 10.0511 9.9714 10.0476 9.97478 10.0442C9.98133 10.0376 9.9879 10.0309 9.99423 10.0241C9.99677 10.0217 9.99911 10.0192 10.0014 10.0165C10.2531 9.7506 10.4378 9.42044 10.5281 9.05302C10.5691 8.88742 10.5907 8.7144 10.5907 8.53631C10.5907 8.16319 10.4955 7.8123 10.3286 7.50625Z", fill: "currentColor" }),
30370
+ /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M16.9927 5.24012C16.9027 5.11131 16.7871 4.99534 16.6586 4.89231C16.5301 4.78924 16.4015 4.71195 16.2602 4.64753C16.1188 4.58312 15.9775 4.5316 15.8233 4.49295C15.6691 4.45431 15.5149 4.44141 15.3607 4.44141C15.1807 4.44141 14.988 4.46718 14.7952 4.5187C14.6282 4.57024 14.4611 4.63463 14.3069 4.72482C14.0113 4.90518 13.7543 5.16282 13.5872 5.45912C13.4973 5.6137 13.433 5.78118 13.3816 5.94866C13.3303 6.12901 13.3174 6.30937 13.3174 6.48972C13.3174 6.67005 13.3431 6.85041 13.3945 7.03076C13.4459 7.19824 13.5101 7.36572 13.613 7.52031C13.7929 7.8166 14.0499 8.07424 14.3583 8.2546C14.5125 8.34479 14.6796 8.42208 14.8466 8.46072C15.0137 8.51224 15.1936 8.53801 15.3735 8.53801H15.3863C15.502 8.53801 15.6305 8.52514 15.7462 8.49937C15.8618 8.4736 15.9775 8.44782 16.0803 8.40918C16.1831 8.37053 16.2859 8.31901 16.3887 8.2546C16.4787 8.20308 16.5815 8.13866 16.6586 8.07424C16.6971 8.0356 16.7357 7.99695 16.7742 7.95831C16.8128 7.90676 16.8256 7.85524 16.8385 7.79082C16.8385 7.75218 16.8256 7.72643 16.8128 7.68776C16.7999 7.66201 16.7871 7.63624 16.7742 7.62337L16.7228 7.55895C16.71 7.54608 16.6971 7.52031 16.6843 7.49453C16.6586 7.45589 16.6329 7.41724 16.5943 7.3786C16.5686 7.33995 16.5429 7.31418 16.5044 7.28841C16.4658 7.26266 16.4273 7.24976 16.3887 7.24976H16.3759H16.363C16.3116 7.24976 16.2602 7.26266 16.2217 7.30131C16.1959 7.31418 16.1702 7.33995 16.1574 7.35282C16.106 7.39147 16.0546 7.44302 15.9903 7.48166C15.9389 7.52031 15.8747 7.55895 15.8233 7.58472C15.759 7.61047 15.6948 7.63624 15.6177 7.64911C15.5406 7.66201 15.4634 7.67489 15.3735 7.67489H15.3607C15.2321 7.67489 15.1036 7.64911 14.988 7.5976C14.8595 7.54608 14.7567 7.48166 14.6539 7.39147C14.5511 7.30131 14.4611 7.19824 14.384 7.08231C14.3455 7.01789 14.3069 6.95347 14.2812 6.88905H17.1083C17.2754 6.88905 17.3911 6.77311 17.3911 6.60566C17.4039 6.34801 17.3654 6.07747 17.3011 5.8327C17.2497 5.6266 17.134 5.42047 16.9927 5.24012ZM16.4915 6.0517H14.2812C14.3197 5.96153 14.3583 5.88424 14.4226 5.79405C14.5125 5.66524 14.6282 5.54931 14.7567 5.45912C14.8466 5.3947 14.9623 5.35605 15.0651 5.33031C15.1679 5.30453 15.2836 5.29166 15.3992 5.29166C15.5406 5.29166 15.6691 5.31741 15.7976 5.35605C15.9261 5.3947 16.0417 5.45912 16.1446 5.54931C16.2473 5.6266 16.3373 5.72966 16.4015 5.8456C16.4401 5.91001 16.4658 5.97441 16.4915 6.0517Z", fill: "currentColor" }),
30371
+ /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M20.7832 8.04849L19.2925 6.27072L20.6033 4.9052C20.6418 4.85366 20.6675 4.77637 20.6675 4.72485C20.6675 4.6862 20.6675 4.66043 20.6547 4.63466C20.6418 4.60891 20.6161 4.58314 20.5904 4.54449C20.539 4.50585 20.4876 4.49298 20.4362 4.49298H20.0122C19.9479 4.49298 19.8965 4.50585 19.8451 4.53162C19.8065 4.55737 19.7808 4.58314 19.7423 4.60891L18.5086 5.92291V3.68137C18.5086 3.64272 18.5086 3.60408 18.4829 3.56543C18.4701 3.52679 18.4444 3.48814 18.4187 3.47527C18.3673 3.42372 18.303 3.39795 18.2259 3.39795H17.9303C17.8918 3.39795 17.8532 3.39795 17.8147 3.41085C17.7761 3.42372 17.7376 3.44949 17.7119 3.47527C17.6605 3.52679 17.6348 3.5912 17.6348 3.66849V8.16446C17.6348 8.2031 17.6348 8.24175 17.6476 8.26749C17.6605 8.30614 17.6862 8.34481 17.7119 8.37056C17.7376 8.39633 17.7761 8.4221 17.8147 8.43498C17.8404 8.44785 17.8661 8.44785 17.9046 8.44785C17.9175 8.44785 17.9175 8.44785 17.9303 8.44785H18.2002C18.3673 8.44785 18.4829 8.33191 18.4829 8.16446V7.0952L18.7014 6.8762L19.8708 8.29327C19.8965 8.33191 19.9222 8.38346 19.9736 8.4092C20.025 8.43498 20.0764 8.46075 20.1278 8.46075H20.6161C20.6675 8.46075 20.7061 8.46075 20.7446 8.43498L20.7575 8.4221C20.7832 8.4092 20.8603 8.35769 20.8603 8.24175C20.8603 8.21598 20.8603 8.1902 20.8474 8.16446C20.8474 8.12578 20.8217 8.08714 20.7832 8.04849Z", fill: "currentColor" }),
30372
+ /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M24.3442 4.49264H24.0615C24.0229 4.49264 23.9844 4.49264 23.9587 4.50551C23.9201 4.51839 23.8816 4.54416 23.8559 4.56993C23.8302 4.59568 23.8045 4.63435 23.7916 4.673C23.7788 4.71164 23.7788 4.75029 23.7788 4.77603V4.78893C23.6631 4.71164 23.5474 4.63435 23.4189 4.5828C23.1748 4.47974 22.9178 4.42822 22.6608 4.42822C22.6479 4.42822 22.6479 4.42822 22.6351 4.42822C22.4551 4.42822 22.2752 4.454 22.0953 4.50551C21.9283 4.55703 21.7612 4.62145 21.607 4.71164C21.4528 4.8018 21.3114 4.90487 21.1958 5.0337C21.0673 5.16251 20.9645 5.29135 20.8745 5.44593C20.7846 5.60051 20.7075 5.76799 20.6689 5.93545C20.5661 6.29616 20.5661 6.66977 20.6689 7.01758C20.7203 7.18506 20.7846 7.35251 20.8745 7.50712C21.0544 7.80341 21.3114 8.06106 21.607 8.24141C21.7612 8.33158 21.9283 8.40887 22.0953 8.44751C22.2752 8.49906 22.4551 8.52483 22.6351 8.52483C22.6479 8.52483 22.6479 8.52483 22.6608 8.52483C22.9178 8.52483 23.1748 8.47329 23.4189 8.37022C23.5474 8.3187 23.6631 8.24141 23.7788 8.16412V8.18987C23.7788 8.22851 23.7788 8.26716 23.8045 8.30583C23.8173 8.34448 23.843 8.37022 23.8687 8.396C23.8944 8.42177 23.933 8.44751 23.9715 8.46041C24.0101 8.47329 24.0486 8.48616 24.0743 8.47329H24.3699C24.447 8.47329 24.5113 8.44751 24.5626 8.396C24.5884 8.37022 24.6141 8.33158 24.6269 8.29293C24.6398 8.25429 24.6526 8.21564 24.6398 8.18987V4.77603C24.6398 4.673 24.6012 4.60858 24.5626 4.56993C24.5241 4.53129 24.4599 4.49264 24.3442 4.49264ZM23.7916 6.46364C23.7916 6.61822 23.7659 6.7728 23.7017 6.92741C23.6374 7.06912 23.5603 7.19793 23.4447 7.31387C23.3418 7.4298 23.2133 7.51999 23.072 7.58441C22.9306 7.6488 22.7764 7.68748 22.6222 7.68748C22.468 7.68748 22.3138 7.6488 22.1853 7.58441C22.0439 7.51999 21.9283 7.4298 21.8126 7.31387C21.7098 7.19793 21.6199 7.06912 21.5685 6.92741C21.4528 6.6311 21.4528 6.30906 21.5685 6.01274C21.6327 5.87106 21.7098 5.74222 21.8126 5.62629C21.9154 5.51035 22.0439 5.43303 22.1853 5.36864C22.3266 5.30422 22.4808 5.26558 22.6222 5.26558C22.7764 5.26558 22.9306 5.30422 23.072 5.36864C23.2133 5.43303 23.3418 5.52322 23.4447 5.62629C23.5474 5.74222 23.6374 5.87106 23.7017 6.01274C23.7659 6.15445 23.7916 6.30906 23.7916 6.46364Z", fill: "currentColor" }),
30373
+ /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M29.7915 7.67488C29.7787 7.662 29.7658 7.63623 29.753 7.62336L29.6246 7.45588C29.6115 7.4301 29.5858 7.40436 29.573 7.37859C29.5474 7.32704 29.4958 7.3013 29.4317 7.27552C29.3802 7.26265 29.3289 7.26265 29.2774 7.27552C29.2389 7.2884 29.2133 7.3013 29.1746 7.32704L29.1361 7.36571C29.0848 7.40436 29.0333 7.45588 28.9689 7.49452C28.9177 7.53317 28.8533 7.57181 28.802 7.59759C28.7377 7.62336 28.6736 7.6491 28.5964 7.662C28.5192 7.67488 28.4423 7.68775 28.3523 7.68775H28.3395C28.1979 7.68775 28.0438 7.6491 27.9154 7.59759C27.7738 7.53317 27.6454 7.443 27.5426 7.33994C27.4269 7.224 27.3497 7.09517 27.2856 6.95346C27.2213 6.81175 27.1957 6.65717 27.1957 6.48969C27.1957 6.3351 27.2341 6.16765 27.2985 6.02594C27.3628 5.88423 27.4526 5.74252 27.5554 5.63946C27.6582 5.52352 27.7869 5.43333 27.9282 5.36894C28.0566 5.30452 28.2107 5.26588 28.3523 5.26588C28.4292 5.26588 28.4936 5.27875 28.5707 5.29162C28.712 5.3174 28.8533 5.38181 28.9689 5.4591C29.0205 5.49775 29.0717 5.5364 29.1233 5.58794C29.1877 5.65233 29.2646 5.69098 29.3417 5.69098C29.393 5.69098 29.4702 5.66523 29.5346 5.57504L29.753 5.29162C29.7915 5.2401 29.7915 5.17569 29.7915 5.12417C29.7915 5.08552 29.7658 5.03398 29.7402 4.99533C29.7143 4.96959 29.6886 4.94381 29.663 4.91804L29.6115 4.8794C29.5346 4.81498 29.4446 4.76346 29.3546 4.71194C29.2517 4.6604 29.1617 4.60888 29.0589 4.57023C28.9561 4.53159 28.8405 4.50581 28.7248 4.48004C28.6092 4.45427 28.4936 4.4414 28.3779 4.45427C28.1979 4.45427 28.0182 4.48004 27.8382 4.53159C27.671 4.5831 27.5041 4.64752 27.3497 4.73769C27.0416 4.91804 26.7972 5.17569 26.6047 5.47198C26.5147 5.62659 26.4375 5.79404 26.3862 5.96152C26.2834 6.32223 26.2834 6.69581 26.3862 7.04365C26.4375 7.2111 26.5018 7.37859 26.6047 7.53317C26.7844 7.82946 27.0416 8.0871 27.3497 8.26746C27.5041 8.35765 27.671 8.43494 27.8382 8.47359C28.0182 8.5251 28.1851 8.55088 28.3651 8.55088H28.3779C28.4936 8.55088 28.622 8.538 28.7377 8.51223C28.8533 8.48646 28.9689 8.46071 29.0717 8.42207C29.1746 8.38342 29.2774 8.33188 29.3802 8.26746C29.4702 8.21594 29.5602 8.15152 29.6502 8.0871C29.6887 8.06136 29.7274 8.02271 29.753 7.98407C29.7787 7.9454 29.8043 7.90675 29.8171 7.8681C29.8299 7.81659 29.8299 7.76504 29.8171 7.72639L29.7915 7.67488Z", fill: "currentColor" }),
30374
+ /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M33.6473 4.49264H33.3645C33.326 4.49264 33.2873 4.49264 33.2616 4.50551C33.2232 4.51839 33.1847 4.54416 33.1588 4.56993C33.1332 4.59568 33.1076 4.63435 33.0947 4.673C33.0819 4.71164 33.0819 4.75029 33.0819 4.77603V4.78893C32.966 4.71164 32.8504 4.63435 32.7219 4.5828C32.4778 4.47974 32.2209 4.42822 31.9509 4.42822C31.7709 4.42822 31.5912 4.454 31.4112 4.50551C31.2443 4.55703 31.0771 4.62145 30.923 4.71164C30.7686 4.8018 30.6274 4.90487 30.5117 5.0337C30.3833 5.16251 30.2805 5.29135 30.1905 5.44593C30.1005 5.60051 30.0361 5.76799 29.9848 5.93545C29.882 6.29616 29.882 6.66977 29.9848 7.01758C30.1261 7.53287 30.473 7.97087 30.923 8.24141C31.0771 8.33158 31.2443 8.40887 31.4112 8.44751C31.5912 8.49906 31.7709 8.52483 31.9509 8.52483C31.9637 8.52483 31.9637 8.52483 31.9766 8.52483C32.2337 8.52483 32.4906 8.47329 32.7347 8.37022C32.8635 8.3187 32.9791 8.24141 33.0947 8.16412V8.18987C33.0947 8.22851 33.0947 8.26716 33.1204 8.30583C33.1332 8.34448 33.1588 8.37022 33.1847 8.396C33.2104 8.42177 33.2488 8.44751 33.2873 8.46041C33.326 8.47329 33.3645 8.48616 33.3901 8.47329H33.6857C33.7629 8.47329 33.827 8.44751 33.8786 8.396C33.9042 8.37022 33.9298 8.33158 33.9429 8.29293C33.9557 8.25429 33.9686 8.21564 33.9686 8.18987V4.77603C33.9686 4.673 33.9298 4.60858 33.8914 4.56993C33.827 4.53129 33.7629 4.49264 33.6473 4.49264ZM33.1076 6.46364C33.1076 6.61822 33.0819 6.7728 33.0176 6.92741C32.9532 7.06912 32.8763 7.2108 32.7606 7.31387C32.6578 7.4298 32.5291 7.51999 32.3878 7.58441C32.2466 7.6488 32.0922 7.68748 31.9381 7.68748C31.784 7.68748 31.6296 7.6488 31.5012 7.58441C31.3599 7.51999 31.2443 7.4298 31.1284 7.31387C31.0256 7.19793 30.9358 7.06912 30.8843 6.92741C30.7686 6.6311 30.7686 6.30906 30.8843 6.01274C30.9486 5.87106 31.0256 5.74222 31.1284 5.62629C31.2312 5.51035 31.3599 5.43303 31.5012 5.36864C31.6425 5.30422 31.7968 5.26558 31.9381 5.26558C32.0922 5.26558 32.2466 5.30422 32.3878 5.36864C32.5291 5.43303 32.6578 5.52322 32.7606 5.62629C32.8635 5.74222 32.9532 5.87106 33.0176 6.01274C33.0688 6.15445 33.1076 6.30906 33.1076 6.46364Z", fill: "currentColor" }),
30375
+ /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M37.0006 5.03399C37.0006 4.99534 36.9878 4.9567 36.975 4.91805C36.9622 4.87941 36.9363 4.85363 36.9106 4.82789C36.885 4.80212 36.8594 4.77634 36.8206 4.76347C36.7437 4.71195 36.6665 4.66041 36.5765 4.60889C36.4994 4.57024 36.4225 4.5316 36.3325 4.50582C36.2425 4.48005 36.1525 4.46718 36.0625 4.45431C35.9596 4.44141 35.8568 4.44141 35.7671 4.44141C35.6512 4.44141 35.5484 4.45431 35.4458 4.49295C35.3558 4.5316 35.2786 4.57024 35.2015 4.62176C35.1886 4.63463 35.1758 4.64753 35.163 4.64753C35.1502 4.62176 35.1374 4.59599 35.1115 4.57024C35.0858 4.54447 35.0474 4.5187 35.0086 4.50582C34.9702 4.49295 34.9317 4.48005 34.9061 4.49295H34.6105C34.5717 4.49295 34.5333 4.49295 34.5076 4.5187C34.4689 4.5316 34.4433 4.55734 34.4176 4.57024C34.392 4.59599 34.3664 4.63463 34.3533 4.67331C34.3405 4.71195 34.3276 4.7506 34.3276 4.77634V8.19018C34.3276 8.35766 34.4433 8.4736 34.6105 8.4736H34.9061C34.9189 8.4736 34.9189 8.4736 34.9317 8.4736C34.9574 8.4736 34.9958 8.4736 35.0217 8.46072C35.0602 8.44782 35.0986 8.42208 35.1245 8.39631C35.1502 8.37053 35.1758 8.33189 35.1886 8.29324C35.2015 8.2546 35.2015 8.21595 35.2015 8.19018V5.93576C35.2015 5.8327 35.2143 5.74253 35.253 5.65234C35.2786 5.57505 35.3299 5.51066 35.3815 5.44624C35.4327 5.3947 35.4971 5.35605 35.5615 5.31741C35.6255 5.29166 35.7027 5.27876 35.7799 5.27876C35.8827 5.27876 35.9855 5.29166 36.0881 5.33031C36.204 5.36895 36.3068 5.42047 36.3965 5.48489L36.4353 5.51066C36.4737 5.54931 36.5253 5.56218 36.5894 5.56218C36.6278 5.56218 36.6665 5.54931 36.6922 5.52353C36.7306 5.49776 36.7565 5.47199 36.7822 5.44624L36.9622 5.16282C36.9878 5.12418 37.0006 5.08553 37.0006 5.03399Z", fill: "currentColor" }),
30376
+ /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M40.9076 5.84529C40.8436 5.62629 40.7536 5.40729 40.6123 5.22693C40.5095 5.0981 40.4066 4.98216 40.2782 4.8791C40.1495 4.77603 40.021 4.69874 39.8797 4.63435C39.7385 4.56993 39.5969 4.51839 39.4428 4.47974C39.2885 4.4411 39.1344 4.42822 38.9803 4.42822H38.9672C38.7875 4.42822 38.5946 4.454 38.4146 4.50551C38.2477 4.55703 38.0806 4.62145 37.9265 4.71164C37.7721 4.8018 37.6308 4.90487 37.5152 5.0337C37.2711 5.29135 37.0911 5.60051 37.0011 5.93545C36.9498 6.1158 36.937 6.29616 36.937 6.47651C36.937 6.65687 36.9626 6.85009 37.0139 7.01758C37.0655 7.18506 37.1296 7.35251 37.2196 7.50712C37.3096 7.6617 37.4252 7.80341 37.5408 7.91935C37.6693 8.04816 37.8108 8.15122 37.9521 8.24141C38.1062 8.33158 38.2734 8.40887 38.4406 8.44751C38.6203 8.49906 38.7875 8.52483 38.9672 8.52483C38.9672 8.52483 38.9672 8.52483 38.9803 8.52483C39.1087 8.52483 39.2244 8.51193 39.34 8.48619C39.4556 8.46041 39.5713 8.43464 39.6741 8.396C39.7769 8.35735 39.8797 8.30583 39.9826 8.24141C40.0726 8.18987 40.1623 8.12548 40.2523 8.06106C40.291 8.02241 40.3423 7.98377 40.3679 7.94512C40.4066 7.90648 40.4195 7.85493 40.4195 7.77764C40.4195 7.73899 40.4066 7.71322 40.3938 7.67458C40.381 7.6488 40.3679 7.62306 40.3551 7.61016L40.3166 7.55864C40.3038 7.54577 40.291 7.51999 40.2651 7.49422L40.1754 7.37829C40.1623 7.35251 40.1366 7.32677 40.111 7.31387C40.0854 7.28812 40.0466 7.27522 40.0082 7.26235C39.9697 7.24945 39.931 7.24945 39.9054 7.26235C39.8669 7.27522 39.841 7.28812 39.8154 7.30099C39.7897 7.31387 39.7641 7.33964 39.7513 7.35251C39.6997 7.39116 39.6485 7.4427 39.5841 7.48135C39.5328 7.51999 39.4685 7.55864 39.4172 7.58441C39.3528 7.61016 39.2885 7.63593 39.2116 7.6488C39.1344 7.6617 39.0444 7.67458 38.9672 7.67458H38.9544C38.8259 7.67458 38.6975 7.6488 38.5818 7.59729C38.4534 7.54577 38.3506 7.48135 38.2477 7.39116C38.1449 7.301 38.0549 7.19793 37.9906 7.082C37.9521 7.01758 37.9136 6.95316 37.8877 6.88877H40.7151C40.882 6.88877 40.9976 6.7728 40.9976 6.60535C41.0105 6.36058 40.972 6.10293 40.9076 5.84529ZM40.0982 6.05141H37.8877C37.9265 5.96122 37.9649 5.88393 38.0293 5.79374C38.1193 5.66493 38.2349 5.549 38.3634 5.4588C38.4534 5.39439 38.5562 5.35574 38.6718 5.33C38.7746 5.30422 38.8903 5.29135 39.0059 5.29135C39.1472 5.29135 39.2756 5.3171 39.4041 5.35574C39.5328 5.39439 39.6485 5.4588 39.7513 5.549C39.8541 5.62629 39.9438 5.72935 40.0082 5.84529C40.0338 5.9097 40.0726 5.9741 40.0982 6.05141Z", fill: "currentColor" }),
30377
+ /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M25.7828 7.50791C25.6928 7.46926 25.59 7.45639 25.4872 7.48216C25.3845 7.50791 25.2945 7.54658 25.2174 7.62387C25.1403 7.70116 25.0889 7.79133 25.076 7.89439C25.0503 8.0361 25.076 8.16494 25.1531 8.28087C25.2302 8.39681 25.3459 8.4741 25.4744 8.49987C25.5131 8.51275 25.5387 8.51274 25.5772 8.51274C25.6415 8.51274 25.7056 8.49987 25.77 8.4741C25.86 8.43545 25.95 8.37104 26.0013 8.28087C26.0528 8.19068 26.0913 8.10052 26.0913 7.99745C26.0913 7.89439 26.0656 7.79133 26.0013 7.71404C25.9628 7.61097 25.8856 7.54658 25.7828 7.50791Z", fill: "currentColor" })
30378
+ ] }),
30379
+ /* @__PURE__ */ jsxRuntimeExports.jsx("defs", { children: /* @__PURE__ */ jsxRuntimeExports.jsx("clipPath", { id: "clip0_988_2228", children: /* @__PURE__ */ jsxRuntimeExports.jsx("rect", { width: "42", height: "12", fill: "currentColor" }) }) })
30380
+ ] });
30381
+ };
29992
30382
  const ChatComposer$2 = reactExports.lazy(() => Promise.resolve().then(() => ChatComposer$1));
29993
30383
  function WidgetContainer({
29994
30384
  isOpen,
@@ -29997,13 +30387,21 @@ var MedAssistWidget = (function(exports) {
29997
30387
  onStartNewSession,
29998
30388
  children,
29999
30389
  title,
30390
+ titleImg,
30000
30391
  sessionId,
30001
30392
  chatComposer,
30002
30393
  environment,
30003
- displayMode
30394
+ displayMode,
30395
+ theme
30004
30396
  }) {
30005
30397
  const [isMobile, setIsMobile] = reactExports.useState(false);
30006
30398
  const containerRef = reactExports.useRef(null);
30399
+ const mergedTheme = reactExports.useMemo(() => mergeTheme(theme), [theme]);
30400
+ reactExports.useEffect(() => {
30401
+ if (containerRef.current) {
30402
+ applyTheme(containerRef.current, mergedTheme);
30403
+ }
30404
+ }, [mergedTheme]);
30007
30405
  reactExports.useEffect(() => {
30008
30406
  const checkMobile = () => {
30009
30407
  const width = window?.innerWidth ?? 0;
@@ -30133,12 +30531,13 @@ var MedAssistWidget = (function(exports) {
30133
30531
  isOpen ? "opacity-100 pointer-events-auto" : "opacity-0 pointer-events-none scale-95"
30134
30532
  );
30135
30533
  const cardStyles = cn(
30136
- "w-full h-full",
30137
- isMobile ? "bg-white" : "bg-white/90 backdrop-blur-2xl",
30534
+ "w-full h-full relative",
30535
+ "bg-background",
30138
30536
  "shadow-2xl",
30139
30537
  "flex flex-col",
30140
30538
  "overflow-hidden",
30141
- "border border-white/50 ring-1 ring-white/60",
30539
+ "border-0",
30540
+ mergedTheme.backgroundImage ? "theme-with-background" : "",
30142
30541
  isMobile ? "rounded-none" : "rounded-3xl"
30143
30542
  );
30144
30543
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(
@@ -30178,8 +30577,7 @@ var MedAssistWidget = (function(exports) {
30178
30577
  width: "100vw",
30179
30578
  maxHeight: "100svh",
30180
30579
  height: "100svh",
30181
- backgroundColor: "white"
30182
- // Ensure full coverage of background
30580
+ backgroundColor: mergedTheme.backgroundImage ? "transparent" : "hsl(var(--background))"
30183
30581
  }
30184
30582
  // Ensure proper font rendering
30185
30583
  // WebkitFontSmoothing: "antialiased",
@@ -30220,18 +30618,43 @@ var MedAssistWidget = (function(exports) {
30220
30618
  }
30221
30619
  }
30222
30620
  ` }),
30223
- /* @__PURE__ */ jsxRuntimeExports.jsxs(Card, { className: cardStyles, children: [
30224
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-shrink-0 sticky top-0 z-50", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
30621
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(Card, { className: cn(cardStyles, "border-0"), "data-text-color": mergedTheme.textColor, children: [
30622
+ mergedTheme.backgroundImage && /* @__PURE__ */ jsxRuntimeExports.jsx(
30623
+ "div",
30624
+ {
30625
+ className: "absolute inset-0 -z-10",
30626
+ style: {
30627
+ backgroundImage: `url(${mergedTheme.backgroundImage})`,
30628
+ backgroundSize: "cover",
30629
+ backgroundPosition: "center",
30630
+ backgroundRepeat: "no-repeat",
30631
+ // filter: `blur(3px)`,
30632
+ transform: "scale(1.1)"
30633
+ // Scale up to cover blur edges
30634
+ }
30635
+ }
30636
+ ),
30637
+ mergedTheme.backgroundImage && mergedTheme.textColor === "black" && /* @__PURE__ */ jsxRuntimeExports.jsx(
30638
+ "div",
30639
+ {
30640
+ className: "absolute inset-0 -z-10",
30641
+ style: {
30642
+ backgroundColor: "rgba(0, 0, 0, 0.4)"
30643
+ }
30644
+ }
30645
+ ),
30646
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: cn("flex-shrink-0 sticky top-0 z-50 synapse-chat-widget-header", mergedTheme.backgroundImage ? "" : "bg-popover"), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
30225
30647
  ProfileHeader,
30226
30648
  {
30227
30649
  onClose,
30228
30650
  title,
30651
+ titleImg,
30229
30652
  iconUrl,
30230
30653
  startNewConversation: onStartNewSession
30231
30654
  }
30232
30655
  ) }),
30233
30656
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-1 min-h-0 overflow-hidden flex flex-col", children }),
30234
- chatComposer && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-shrink-0 sticky bottom-0 z-50", children: [
30657
+ chatComposer && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: cn("flex-shrink-0 sticky bottom-0 z-50 synapse-chat-widget-footer", mergedTheme.backgroundImage ? "" : "bg-popover"), children: [
30235
30658
  /* @__PURE__ */ jsxRuntimeExports.jsx(reactExports.Suspense, { fallback: null, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
30236
30659
  ChatComposer$2,
30237
30660
  {
@@ -30247,13 +30670,28 @@ var MedAssistWidget = (function(exports) {
30247
30670
  isDisabled: chatComposer.isDisabled,
30248
30671
  isMobile,
30249
30672
  placeholder: chatComposer.placeholder,
30250
- recordingStatus: chatComposer.recordingStatus
30673
+ recordingStatus: chatComposer.recordingStatus,
30674
+ theme: mergedTheme,
30675
+ allowed: chatComposer.allowed
30251
30676
  }
30252
30677
  ) }),
30253
- sessionId && environment === "development" && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "px-6 flex justify-center items-center", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-[8px] text-gray-600 font-mono opacity-50", children: [
30678
+ sessionId && environment === "development" && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "px-6 flex justify-center items-center", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-[8px] text-text-secondary font-mono opacity-50", children: [
30254
30679
  "Session ID: ",
30255
30680
  sessionId
30256
- ] }) })
30681
+ ] }) }),
30682
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "px-6 py-2 flex justify-center items-center gap-1.5 text-foreground opacity-90", children: [
30683
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
30684
+ "span",
30685
+ {
30686
+ className: "text-[10px] leading-[14px] font-medium",
30687
+ style: {
30688
+ fontFamily: "Inter, system-ui, -apple-system, sans-serif"
30689
+ },
30690
+ children: "Powered by"
30691
+ }
30692
+ ),
30693
+ /* @__PURE__ */ jsxRuntimeExports.jsx(EkaCareLogo, {})
30694
+ ] })
30257
30695
  ] })
30258
30696
  ] })
30259
30697
  ]
@@ -30316,6 +30754,7 @@ var MedAssistWidget = (function(exports) {
30316
30754
  updateMessageInSession,
30317
30755
  setInitialMessage,
30318
30756
  userId,
30757
+ setUserId,
30319
30758
  fileUploadPerSession,
30320
30759
  setFileUploadPerSession
30321
30760
  } = useMedAssistStore();
@@ -30332,10 +30771,37 @@ var MedAssistWidget = (function(exports) {
30332
30771
  reactExports.useEffect(() => {
30333
30772
  if (sessionId) {
30334
30773
  const messages2 = getMessagesForSession(sessionId) || [];
30335
- setMessages(messages2);
30774
+ if (messages2.length <= 0 && initialMessage?.text) {
30775
+ setMessages([{
30776
+ id: Date.now().toString(),
30777
+ content: initialMessage.text,
30778
+ role: MessageSender.ASSISTANT,
30779
+ timestamp: formatMessageTimestamp(Date.now()),
30780
+ isStored: false,
30781
+ ...initialMessage.suggestions?.length && {
30782
+ toolEscalationData: {
30783
+ tool_id: initialMessage.suggestions[0].value ?? null,
30784
+ tool_name: "elicitation",
30785
+ details: {
30786
+ component: distExports.SYNAPSE_COMPONENTS.PILL,
30787
+ input: {
30788
+ options: initialMessage.suggestions.map((suggestion) => ({
30789
+ id: suggestion.value || "",
30790
+ label: suggestion.label || "",
30791
+ value: suggestion.value || ""
30792
+ }))
30793
+ }
30794
+ },
30795
+ isResponded: false
30796
+ }
30797
+ }
30798
+ }]);
30799
+ } else {
30800
+ setMessages(messages2);
30801
+ }
30336
30802
  setInitialPrompts([]);
30337
30803
  }
30338
- }, [sessionId]);
30804
+ }, [sessionId, initialMessage]);
30339
30805
  reactExports.useEffect(() => {
30340
30806
  setIsReady(false);
30341
30807
  if (!agentId) {
@@ -30515,6 +30981,9 @@ var MedAssistWidget = (function(exports) {
30515
30981
  session
30516
30982
  );
30517
30983
  }
30984
+ if (session?.user_id) {
30985
+ setUserId(session.user_id);
30986
+ }
30518
30987
  setUpEventListeners();
30519
30988
  } catch (error) {
30520
30989
  console.error("useChat: Error starting session", error);
@@ -30583,6 +31052,7 @@ var MedAssistWidget = (function(exports) {
30583
31052
  synapseRef.current?.on(distExports.SYNAPSE_REALTIME_EVENTS.END_OF_STREAM, () => {
30584
31053
  setIsStreaming(false);
30585
31054
  setProgressMessage(null);
31055
+ setIsWaitingForResponse(false);
30586
31056
  });
30587
31057
  synapseRef.current?.on(distExports.SYNAPSE_REALTIME_EVENTS.CONNECTED, () => {
30588
31058
  resetConnectionStates();
@@ -31039,6 +31509,16 @@ var MedAssistWidget = (function(exports) {
31039
31509
  );
31040
31510
  setInitialPrompts([{ role: "user", text: message }, { role: "assistant", text: selectedMessage.response }]);
31041
31511
  };
31512
+ const handleToggleFeedback = async (feedback, messageId, reason) => {
31513
+ if (!isConnected()) {
31514
+ return;
31515
+ }
31516
+ try {
31517
+ await synapseRef.current?.sendFeedback(messageId, feedback, reason);
31518
+ } catch (error) {
31519
+ console.log("Error sending feedback", error);
31520
+ }
31521
+ };
31042
31522
  return {
31043
31523
  sendMessage,
31044
31524
  startSession,
@@ -31052,11 +31532,11 @@ var MedAssistWidget = (function(exports) {
31052
31532
  isValidFile,
31053
31533
  handleStartNewConnection,
31054
31534
  callTool,
31055
- handleInitialTaskClick
31535
+ handleInitialTaskClick,
31536
+ handleToggleFeedback
31056
31537
  };
31057
31538
  };
31058
31539
  const ChatMessages$2 = reactExports.lazy(() => Promise.resolve().then(() => ChatMessages$1));
31059
- const EmptyChatState$2 = reactExports.lazy(() => Promise.resolve().then(() => EmptyChatState$1));
31060
31540
  const ConnectionStatusBanner = reactExports.lazy(
31061
31541
  () => Promise.resolve().then(() => ConnectionStatus$1).then((module) => ({
31062
31542
  default: module.ConnectionStatus
@@ -31086,10 +31566,8 @@ var MedAssistWidget = (function(exports) {
31086
31566
  isWaitingForResponse,
31087
31567
  isStreaming,
31088
31568
  setError,
31089
- initialMessage,
31569
+ // initialMessage,
31090
31570
  sessionId,
31091
- setUserId,
31092
- userId,
31093
31571
  setContext
31094
31572
  } = useMedAssistStore();
31095
31573
  const {
@@ -31104,7 +31582,8 @@ var MedAssistWidget = (function(exports) {
31104
31582
  handleStartNewConnection,
31105
31583
  isValidFile,
31106
31584
  callTool,
31107
- handleInitialTaskClick
31585
+ // handleInitialTaskClick,
31586
+ handleToggleFeedback
31108
31587
  } = useChat({
31109
31588
  environment: "production",
31110
31589
  baseUrl: config.environment === "development" && config.baseUrl ? config.baseUrl : void 0,
@@ -31117,10 +31596,6 @@ var MedAssistWidget = (function(exports) {
31117
31596
  return;
31118
31597
  }
31119
31598
  setAgentId(agentId);
31120
- if (!userId) {
31121
- const uuid = crypto?.randomUUID?.() || Date.now().toString();
31122
- setUserId(uuid);
31123
- }
31124
31599
  if (config?.context && Object.keys(config?.context || {}).length) {
31125
31600
  setContext(config.context);
31126
31601
  }
@@ -31144,17 +31619,24 @@ var MedAssistWidget = (function(exports) {
31144
31619
  setShowScrollButton(false);
31145
31620
  }
31146
31621
  };
31147
- reactExports.useEffect(() => {
31148
- scrollToBottom();
31149
- }, [incomingMessages, isStreaming]);
31150
31622
  const inConversation = incomingMessages.length > 0;
31623
+ const isFirstMessage = incomingMessages.length === 1;
31624
+ reactExports.useEffect(() => {
31625
+ if (isFirstMessage) {
31626
+ setTimeout(() => {
31627
+ scrollToBottom();
31628
+ }, 0);
31629
+ } else {
31630
+ scrollToBottom();
31631
+ }
31632
+ }, [incomingMessages, isStreaming, isFirstMessage]);
31151
31633
  const isConnected = connectionStatus === distExports.ConnectionStatus.CONNECTED;
31152
31634
  const isComposerDisabled = loading || !isConnected || isWaitingForResponse || isStreaming;
31153
31635
  const isConnectionDisabled = loading || !isConnected;
31154
31636
  const recordingStatusPlaceholder = reactExports.useMemo(() => {
31155
31637
  return recordingStatus === AudioRecordingStatus.IDLE ? null : recordingStatus === AudioRecordingStatus.LISTENING ? "Listening..." : recordingStatus === AudioRecordingStatus.PROCESSING ? "Processing..." : recordingStatus === AudioRecordingStatus.TRANSCRIBING ? "Transcribing..." : null;
31156
31638
  }, [recordingStatus]);
31157
- const composerPlaceholder = isConnectionDisabled ? "Connecting..." : recordingStatusPlaceholder && recordingStatus !== AudioRecordingStatus.IDLE ? recordingStatusPlaceholder : isWaitingForResponse || isStreaming ? "Please wait for the response..." : "Ask me anything…";
31639
+ const composerPlaceholder = isConnectionDisabled ? "Connecting..." : recordingStatusPlaceholder && recordingStatus !== AudioRecordingStatus.IDLE ? recordingStatusPlaceholder : isWaitingForResponse || isStreaming ? "Please wait for the response..." : "Type a reply…";
31158
31640
  const handleSendMessage = async () => {
31159
31641
  if (isComposerDisabled) {
31160
31642
  return;
@@ -31180,10 +31662,6 @@ var MedAssistWidget = (function(exports) {
31180
31662
  }, 100);
31181
31663
  }
31182
31664
  };
31183
- const handleTaskClick = async (task) => {
31184
- if (!task) return;
31185
- await handleInitialTaskClick(task);
31186
- };
31187
31665
  const handleFileChange = (files) => {
31188
31666
  if (files && files.length > 0) {
31189
31667
  const validFiles = files.filter((file) => {
@@ -31247,11 +31725,13 @@ var MedAssistWidget = (function(exports) {
31247
31725
  isOpen,
31248
31726
  onClose: config.onClose,
31249
31727
  title: config.title,
31728
+ titleImg: config.theme?.titleImg,
31250
31729
  iconUrl: config.iconUrl,
31251
31730
  onStartNewSession: () => startSession(true),
31252
31731
  sessionId,
31253
31732
  environment: config.environment,
31254
31733
  displayMode: config.displayMode ?? "widget",
31734
+ theme: config.theme,
31255
31735
  chatComposer: {
31256
31736
  value: inputValue,
31257
31737
  onChange: setInputValue,
@@ -31264,46 +31744,61 @@ var MedAssistWidget = (function(exports) {
31264
31744
  attachmentFiles,
31265
31745
  isDisabled: isComposerDisabled,
31266
31746
  placeholder: composerPlaceholder,
31267
- recordingStatus
31747
+ recordingStatus,
31748
+ allowed: config.allowed
31268
31749
  },
31269
- children: !loading && /* @__PURE__ */ jsxRuntimeExports.jsx(reactExports.Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx(WidgetContentFallback, {}), children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1 flex flex-col min-h-0 overflow-hidden bg-white backdrop-blur-2xl relative", children: [
31270
- /* @__PURE__ */ jsxRuntimeExports.jsx(ScrollArea, { ref: scrollAreaRef, className: "flex-1 min-h-0", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
31271
- "div",
31750
+ children: !loading && /* @__PURE__ */ jsxRuntimeExports.jsx(reactExports.Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx(WidgetContentFallback, {}), children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: cn("flex-1 flex flex-col min-h-0 overflow-hidden relative synapse-chat-window", config.theme?.backgroundImage ? "" : "bg-surface"), children: [
31751
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
31752
+ ScrollArea,
31272
31753
  {
31754
+ ref: scrollAreaRef,
31273
31755
  className: cn(
31274
- "transition-all duration-300",
31275
- inConversation ? "p-4 space-y-3" : "p-6 space-y-6"
31756
+ "flex-1 min-h-0",
31757
+ isFirstMessage ? "[&>[data-radix-scroll-area-viewport]]:flex [&>[data-radix-scroll-area-viewport]]:flex-col [&>[data-radix-scroll-area-viewport]]:justify-end [&>[data-radix-scroll-area-viewport]]:min-h-full" : ""
31276
31758
  ),
31277
- children: [
31278
- !inConversation && initialMessage?.text ? /* @__PURE__ */ jsxRuntimeExports.jsx(
31279
- EmptyChatState$2,
31280
- {
31281
- profile: config.context?.profile,
31282
- tasks: initialMessage.suggestions,
31283
- initialPrompt: initialMessage.text,
31284
- onTaskClick: handleTaskClick,
31285
- disabled: isComposerDisabled
31286
- }
31287
- ) : /* @__PURE__ */ jsxRuntimeExports.jsx(
31288
- ChatMessages$2,
31289
- {
31290
- messages: incomingMessages,
31291
- onSendMessage: sendMessage,
31292
- iconUrl: config.iconUrl,
31293
- callTool
31294
- }
31295
- ),
31296
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: messagesEndRef })
31297
- ]
31759
+ children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
31760
+ "div",
31761
+ {
31762
+ className: cn(
31763
+ "transition-all duration-300 min-w-0 overflow-x-hidden",
31764
+ inConversation ? "p-4 space-y-3" : "p-4 space-y-4"
31765
+ ),
31766
+ children: [
31767
+ isFirstMessage && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-xs text-[var(--color-muted-foreground)] text-center mb-2", children: "Just now" }),
31768
+ !isFirstMessage && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-xs text-[var(--color-muted-foreground)] text-center", children: (() => {
31769
+ const now = /* @__PURE__ */ new Date();
31770
+ return now.toLocaleString("en-US", {
31771
+ weekday: "long",
31772
+ // month: "short",
31773
+ // day: "numeric",
31774
+ hour: "2-digit",
31775
+ minute: "2-digit",
31776
+ hour12: true
31777
+ });
31778
+ })() }),
31779
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
31780
+ ChatMessages$2,
31781
+ {
31782
+ messages: incomingMessages,
31783
+ onSendMessage: sendMessage,
31784
+ iconUrl: config.iconUrl,
31785
+ callTool,
31786
+ onToggleFeedback: handleToggleFeedback
31787
+ }
31788
+ ),
31789
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: messagesEndRef })
31790
+ ]
31791
+ }
31792
+ )
31298
31793
  }
31299
- ) }),
31794
+ ),
31300
31795
  showScrollButton && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "absolute bottom-[10px] left-1/2 transform -translate-x-1/2 z-10", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
31301
31796
  Button,
31302
31797
  {
31303
31798
  onClick: scrollToBottom,
31304
31799
  size: "icon",
31305
- className: "h-10 w-10 rounded-full bg-white/90 backdrop-blur-sm shadow-lg border border-lavender-200/60 hover:bg-white hover:shadow-xl transition-all duration-200",
31306
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronDown, { className: "w-5 h-5 text-slate-700" })
31800
+ className: "h-10 w-10 rounded-full bg-surface/90 backdrop-blur-sm shadow-lg border border-border-subtle hover:bg-surface hover:shadow-xl transition-all duration-200",
31801
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronDown, { className: "w-5 h-5 text-text-primary" })
31307
31802
  }
31308
31803
  ) }),
31309
31804
  /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -31324,13 +31819,13 @@ var MedAssistWidget = (function(exports) {
31324
31819
  );
31325
31820
  }
31326
31821
  function WidgetContentFallback() {
31327
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1 flex flex-col min-h-0 overflow-hidden bg-white backdrop-blur-2xl animate-pulse", children: [
31822
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1 flex flex-col min-h-0 overflow-hidden bg-surface backdrop-blur-2xl animate-pulse", children: [
31328
31823
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1 p-6 space-y-4", children: [
31329
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "h-16 bg-gray-100 rounded-2xl" }),
31330
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "h-16 bg-gray-100 rounded-2xl" }),
31331
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "h-16 bg-gray-100 rounded-2xl" })
31824
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "h-16 bg-surface/80 rounded-2xl border border-border-subtle/50" }),
31825
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "h-16 bg-surface/80 rounded-2xl border border-border-subtle/50" }),
31826
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "h-16 bg-surface/80 rounded-2xl border border-border-subtle/50" })
31332
31827
  ] }),
31333
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "h-24 border-t border-gray-100 bg-gray-50" })
31828
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "h-24 border-t border-border-subtle bg-surface/80" })
31334
31829
  ] });
31335
31830
  }
31336
31831
  function App({ agentId, config }) {
@@ -31347,7 +31842,14 @@ var MedAssistWidget = (function(exports) {
31347
31842
  {
31348
31843
  isOpen,
31349
31844
  agentId,
31350
- config: { ...config, environment: config.environment ?? "production", onClose: handleClose, title: config.title ?? "Medi Clinic", iconUrl: config.iconUrl ?? "https://cdn.eka.care/bot-icon.svg" }
31845
+ config: {
31846
+ ...config,
31847
+ environment: config.environment ?? "production",
31848
+ onClose: handleClose,
31849
+ title: config.title ?? "Medi Clinic",
31850
+ iconUrl: config.iconUrl ?? "https://cdn.eka.care/bot-icon.svg",
31851
+ theme: config.theme
31852
+ }
31351
31853
  }
31352
31854
  );
31353
31855
  }
@@ -31395,8 +31897,8 @@ var MedAssistWidget = (function(exports) {
31395
31897
  }, [file]);
31396
31898
  const getFileTypeColor = () => {
31397
31899
  if (isImage2) return "text-green-600";
31398
- if (isPDF) return "text-gray-600";
31399
- return "text-gray-600";
31900
+ if (isPDF) return "text-text-secondary";
31901
+ return "text-text-secondary";
31400
31902
  };
31401
31903
  const formatFileSize = (bytes) => {
31402
31904
  if (bytes === 0) return "0 B";
@@ -31493,6 +31995,9 @@ var MedAssistWidget = (function(exports) {
31493
31995
  }) })
31494
31996
  ] });
31495
31997
  }
31998
+ const SendIcon = ({ className }) => {
31999
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("svg", { width: "17", height: "16", viewBox: "0 0 17 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", className, children: /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M1.46875 0.09375L16.3125 6.9375C16.75 7.125 17 7.53125 17 8C17 8.46875 16.75 8.875 16.3125 9.0625L1.46875 15.9062C1.3125 15.9688 1.1875 16 1.03125 16C0.46875 16 0 15.5312 0 14.9688C0 14.8125 0.03125 14.6875 0.09375 14.5625L2.34375 9.5C2.5 9.15625 2.8125 8.9375 3.15625 8.90625L8.0625 8.46875C8.3125 8.46875 8.5 8.25 8.5 8C8.5 7.75 8.3125 7.5625 8.0625 7.53125L3.15625 7.09375C2.8125 7.0625 2.5 6.84375 2.34375 6.5L0.09375 1.4375C0.03125 1.3125 0 1.1875 0 1.03125C0 0.46875 0.46875 0 1.03125 0C1.1875 0 1.3125 0.03125 1.46875 0.09375Z", fill: "currentColor" }) });
32000
+ };
31496
32001
  function ChatComposer({
31497
32002
  value,
31498
32003
  onChange,
@@ -31506,15 +32011,19 @@ var MedAssistWidget = (function(exports) {
31506
32011
  isDisabled,
31507
32012
  placeholder,
31508
32013
  isMobile,
31509
- recordingStatus
32014
+ recordingStatus,
32015
+ theme,
32016
+ allowed
31510
32017
  }) {
31511
32018
  const fileInputRef = reactExports.useRef(null);
31512
32019
  const textareaRef = reactExports.useRef(null);
31513
32020
  const showSendButton = value.trim().length > 0 || hasAttachment;
32021
+ const showMic = allowed === void 0 || allowed.includes("audio");
32022
+ const showFileAttachment = allowed === void 0 || allowed.includes("file");
31514
32023
  const isMicDisabled = (isDisabled || recordingStatus !== AudioRecordingStatus.IDLE) && !isRecording;
31515
32024
  const micButtonClasses = cn(
31516
32025
  "rounded-full transition-all duration-200 ",
31517
- isRecording ? "bg-gradient-to-r from-rose-400 via-lavender-500 to-indigo-500 text-white ring-2 ring-white/60 animate-pulse shadow-[0_0_20px_rgba(139,92,246,0.45)]" : isMicDisabled ? "text-lavender-300 cursor-not-allowed shadow-none" : "text-lavender-600 hover:bg-gray-100"
32026
+ isRecording ? "bg-gradient-to-r from-rose-400 via-primary to-indigo-500 text-white ring-2 ring-white/60 animate-pulse shadow-[0_0_20px_rgba(139,92,246,0.45)]" : isMicDisabled ? "text-primary/50 cursor-not-allowed shadow-none" : "text-foreground hover:bg-secondary"
31518
32027
  );
31519
32028
  const handleFileChange = (e) => {
31520
32029
  const files = Array.from(e.target.files || []);
@@ -31561,8 +32070,8 @@ var MedAssistWidget = (function(exports) {
31561
32070
  textareaRef.current?.focus();
31562
32071
  }
31563
32072
  }, [isDisabled]);
31564
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "border-t border-white/20 bg-white/70 backdrop-blur-xl px-4 py-2", children: [
31565
- hasAttachment && attachmentFiles.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mb-2 pb-2 border-b border-white/20", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
32073
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "px-2 py-2", children: [
32074
+ hasAttachment && attachmentFiles.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mb-2 pb-2 border-b border-border-subtle", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
31566
32075
  FilePreviewList,
31567
32076
  {
31568
32077
  files: attachmentFiles,
@@ -31585,94 +32094,106 @@ var MedAssistWidget = (function(exports) {
31585
32094
  "aria-label": "Attach file"
31586
32095
  }
31587
32096
  ),
31588
- /* @__PURE__ */ jsxRuntimeExports.jsxs(
31589
- "div",
31590
- {
31591
- className: cn(
31592
- "flex items-center gap-2 bg-white/70 backdrop-blur rounded-xl px-4 py-2 shadow-md focus-within:border-lavender-100/50 focus-within:ring-2 focus-within:ring-lavender-400/50 transition-all",
31593
- isRecording || hasAttachment ? "ring-2 ring-lavender-200/40" : "ring-2 ring-lavender-300/40 backdrop-blur-xl",
31594
- isDisabled && "opacity-60"
31595
- ),
31596
- children: [
31597
- hasAttachment && attachmentFiles.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "text-xs text-lavender-600 mr-2", children: [
31598
- attachmentFiles.length,
31599
- " file(s)"
31600
- ] }),
31601
- /* @__PURE__ */ jsxRuntimeExports.jsx(
31602
- Textarea,
31603
- {
31604
- ref: textareaRef,
31605
- onInput: handleTextareaInput,
31606
- placeholder,
31607
- value,
31608
- onChange: (e) => onChange(e.target.value),
31609
- rows: 1,
31610
- maxLength: 1e3,
31611
- autoFocus: !isDisabled,
31612
- style: {
31613
- wordBreak: "break-word",
31614
- overflowWrap: "anywhere",
31615
- minHeight: "40px",
31616
- maxHeight: "120px",
31617
- fontSize: window.innerWidth <= 768 ? "16px" : "14px"
31618
- // Prevent iOS zoom
31619
- },
31620
- onKeyPress: handleKeyPress,
31621
- disabled: isDisabled,
31622
- title: "Enter your message",
31623
- className: "flex-1 border-0 outline-none focus-visible:ring-0 focus-visible:ring-offset-0 text-sm !placeholder:text-gray-400 bg-transparent disabled:cursor-not-allowed rounded-none break-words overflow-wrap-anywhere whitespace-pre-wrap"
31624
- }
31625
- ),
31626
- recordingStatus === AudioRecordingStatus.IDLE && /* @__PURE__ */ jsxRuntimeExports.jsx(
31627
- Button,
31628
- {
31629
- type: "button",
31630
- variant: "ghost",
31631
- size: "icon",
31632
- onClick: handleAttachmentClick,
31633
- disabled: isDisabled,
31634
- className: `rounded-full transition-all ${hasAttachment ? "bg-lavender-200/30 text-lavender-600 hover:bg-lavender-200/40" : "hover:bg-gray-100 text-lavender-600 hover:text-gray-700"}`,
31635
- title: "Attach file",
31636
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(Paperclip, { className: "w-5 h-5" })
31637
- }
32097
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2 w-full", children: [
32098
+ showFileAttachment && recordingStatus === AudioRecordingStatus.IDLE && /* @__PURE__ */ jsxRuntimeExports.jsx(
32099
+ Button,
32100
+ {
32101
+ type: "button",
32102
+ variant: "ghost",
32103
+ size: "icon",
32104
+ onClick: handleAttachmentClick,
32105
+ disabled: isDisabled,
32106
+ className: cn(
32107
+ "rounded-full transition-all shrink-0",
32108
+ hasAttachment ? "bg-primary text-foreground hover:bg-primary/15" : "hover:bg-secondary text-foreground"
31638
32109
  ),
31639
- isRecording ? /* @__PURE__ */ jsxRuntimeExports.jsx(
31640
- Button,
31641
- {
31642
- type: "button",
31643
- variant: "ghost",
31644
- size: "icon",
31645
- onClick: onRecording,
31646
- className: "rounded-full bg-gradient-to-r from-red-400 to-rose-500 text-white hover:from-red-500 hover:to-rose-600 shadow-lg transition-all duration-200 hover:scale-105 active:scale-95",
31647
- title: "Stop recording",
31648
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(Square, { className: "w-4 h-4" })
31649
- }
31650
- ) : !showSendButton && /* @__PURE__ */ jsxRuntimeExports.jsx(
31651
- Button,
31652
- {
31653
- type: "button",
31654
- variant: "ghost",
31655
- size: "icon",
31656
- onClick: onRecording,
31657
- disabled: isMicDisabled,
31658
- className: micButtonClasses,
31659
- title: "Start recording",
31660
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(Mic, { className: "w-5 h-5" })
31661
- }
32110
+ title: "Attach file",
32111
+ "aria-label": "Attach file",
32112
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(Link, { className: "w-5 h-5" })
32113
+ }
32114
+ ),
32115
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
32116
+ "div",
32117
+ {
32118
+ className: cn(
32119
+ "flex items-center gap-1 rounded-full px-2 py-2 flex-1 min-w-0",
32120
+ isDisabled && "opacity-60",
32121
+ // if text color is white, use bg-black-100/10, otherwise use bg-white-100/10
32122
+ theme?.textColor === "white" ? "bg-white-100" : "bg-black-100"
31662
32123
  ),
31663
- showSendButton && !isDisabled && /* @__PURE__ */ jsxRuntimeExports.jsx(
31664
- Button,
31665
- {
31666
- type: "button",
31667
- size: "icon",
31668
- onClick: onSend,
31669
- className: "h-10 w-10 bg-gradient-to-r from-lavender-400 to-lavender-500 hover:from-lavender-500 hover:to-lavender-600 rounded-full text-white transition-all duration-200 shadow-lg hover:shadow-xl hover:scale-105 active:scale-95",
31670
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(Send, { className: "w-4 h-4" })
31671
- }
31672
- )
31673
- ]
31674
- }
31675
- )
32124
+ children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1 relative min-w-0", children: [
32125
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
32126
+ Textarea,
32127
+ {
32128
+ ref: textareaRef,
32129
+ onInput: handleTextareaInput,
32130
+ placeholder,
32131
+ value,
32132
+ onChange: (e) => onChange(e.target.value),
32133
+ rows: 1,
32134
+ maxLength: 1e3,
32135
+ autoFocus: !isDisabled && !isMobile,
32136
+ style: {
32137
+ wordBreak: "break-word",
32138
+ overflowWrap: "anywhere",
32139
+ minHeight: "40px",
32140
+ maxHeight: "120px",
32141
+ fontSize: isMobile ? "16px" : "14px",
32142
+ // Prevent iOS zoom
32143
+ lineHeight: "1.5"
32144
+ },
32145
+ onKeyPress: handleKeyPress,
32146
+ disabled: isDisabled,
32147
+ title: "Enter your message",
32148
+ "aria-label": "Enter your message",
32149
+ className: "w-full shadow-none border-0 outline-none focus-visible:ring-0 focus-visible:ring-offset-0 text-sm placeholder:text-muted-foreground bg-transparent disabled:cursor-not-allowed rounded-none break-words overflow-wrap-anywhere whitespace-pre-wrap text-foreground resize-none pr-11"
32150
+ }
32151
+ ),
32152
+ isRecording ? /* @__PURE__ */ jsxRuntimeExports.jsx(
32153
+ Button,
32154
+ {
32155
+ type: "button",
32156
+ variant: "ghost",
32157
+ size: "icon",
32158
+ onClick: onRecording,
32159
+ className: "absolute right-0.5 top-1/2 -translate-y-1/2 rounded-full bg-gradient-to-r from-red-400 to-rose-500 text-white hover:from-red-500 hover:to-rose-600 shadow-lg transition-all duration-200 hover:scale-105 active:scale-95 shrink-0",
32160
+ title: "Stop recording",
32161
+ "aria-label": "Stop recording",
32162
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(Square, { className: "w-4 h-4" })
32163
+ }
32164
+ ) : showMic && !showSendButton && /* @__PURE__ */ jsxRuntimeExports.jsx(
32165
+ Button,
32166
+ {
32167
+ type: "button",
32168
+ variant: "ghost",
32169
+ size: "icon",
32170
+ onClick: onRecording,
32171
+ disabled: isMicDisabled,
32172
+ className: cn(
32173
+ "absolute right-0.5 top-1/2 -translate-y-1/2 shrink-0",
32174
+ micButtonClasses
32175
+ ),
32176
+ title: "Start recording",
32177
+ "aria-label": "Start recording",
32178
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(Mic, { className: "w-5 h-5" })
32179
+ }
32180
+ ),
32181
+ showSendButton && !isDisabled && /* @__PURE__ */ jsxRuntimeExports.jsx(
32182
+ Button,
32183
+ {
32184
+ type: "button",
32185
+ size: "icon",
32186
+ onClick: onSend,
32187
+ className: "absolute right-0.5 top-1/2 -translate-y-1/2 h-10 w-10 bg-primary hover:bg-primary/90 rounded-full text-primary-foreground transition-all duration-200 shadow-lg hover:shadow-xl hover:scale-105 active:scale-95 shrink-0",
32188
+ title: "Send message",
32189
+ "aria-label": "Send message",
32190
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(SendIcon, { className: "w-4 h-4 text-primary-foreground" })
32191
+ }
32192
+ )
32193
+ ] })
32194
+ }
32195
+ )
32196
+ ] })
31676
32197
  ] });
31677
32198
  }
31678
32199
  const ChatComposer$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
@@ -38470,8 +38991,9 @@ var MedAssistWidget = (function(exports) {
38470
38991
  function code(state, node2) {
38471
38992
  const value = node2.value ? node2.value + "\n" : "";
38472
38993
  const properties = {};
38473
- if (node2.lang) {
38474
- properties.className = ["language-" + node2.lang];
38994
+ const language = node2.lang ? node2.lang.split(/\s+/) : [];
38995
+ if (language.length > 0) {
38996
+ properties.className = ["language-" + language[0]];
38475
38997
  }
38476
38998
  let result = {
38477
38999
  type: "element",
@@ -41323,14 +41845,14 @@ var MedAssistWidget = (function(exports) {
41323
41845
  ref: containerRef,
41324
41846
  onClick: disabled ? void 0 : onClick,
41325
41847
  className: cn(
41326
- "inline-flex items-center gap-2 rounded-full border border-lavender-200/60 bg-white/80 px-3 py-1 shadow-sm text-xs text-slate-700 hover: cursor-pointer",
41848
+ "inline-flex items-center gap-2 rounded-lg border border-primary bg-popover px-3 py-2 shadow-sm text-xs text-primary hover:bg-primary hover:text-primary-foreground cursor-pointer transition-colors",
41327
41849
  className,
41328
41850
  disabled ? "opacity-50 cursor-not-allowed" : ""
41329
41851
  ),
41330
41852
  style: { maxWidth },
41331
41853
  title: text2,
41332
41854
  children: [
41333
- icon && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-lavender-500", children: icon }),
41855
+ icon && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-primary", children: icon }),
41334
41856
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "pill-marquee-wrapper", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
41335
41857
  "span",
41336
41858
  {
@@ -41743,7 +42265,7 @@ var MedAssistWidget = (function(exports) {
41743
42265
  className,
41744
42266
  required = true,
41745
42267
  maxSelections,
41746
- error,
42268
+ // error,
41747
42269
  disabled
41748
42270
  }) {
41749
42271
  const extraOption = additionalOption ? {
@@ -41758,7 +42280,6 @@ var MedAssistWidget = (function(exports) {
41758
42280
  const handleExtraOptionChange = (checked) => {
41759
42281
  if (!extraOption) return selectedValues;
41760
42282
  if (additionalOption === "none_of_the_above") {
41761
- console.log("extraOption.value", extraOption.value);
41762
42283
  return checked ? [extraOption.value] : [];
41763
42284
  }
41764
42285
  if (additionalOption === "all_of_the_above") {
@@ -41791,40 +42312,30 @@ var MedAssistWidget = (function(exports) {
41791
42312
  if (!isValidSelection(newSelection)) {
41792
42313
  return;
41793
42314
  }
41794
- console.log("newSelection", newSelection);
41795
42315
  onSelectionChange(newSelection);
41796
42316
  };
41797
- const isValid = !required || selectedValues.length > 0;
41798
42317
  const currentNonExtraSelections = extraOption ? selectedValues.filter((value) => value !== extraOption.value).length : selectedValues.length;
41799
42318
  if (!options.length) return null;
41800
42319
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(
41801
42320
  "div",
41802
42321
  {
41803
42322
  className: cn(
41804
- // Container styling matching the image and other components
41805
- "bg-gray-50",
41806
- // Light grey background like the image
41807
- "rounded-lg",
41808
- // Rounded corners
41809
- "p-4",
41810
- // Padding inside
41811
- "border border-gray-200",
41812
- // Subtle border
41813
42323
  className
41814
42324
  ),
41815
42325
  children: [
41816
42326
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-3", children: [
41817
42327
  options.map((option) => {
41818
42328
  const isDisabled = disabled || maxSelections && currentNonExtraSelections >= maxSelections && !selectedValues.includes(option.value);
42329
+ let isSelected = selectedValues.includes(option.value);
41819
42330
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center space-x-3", children: [
41820
42331
  /* @__PURE__ */ jsxRuntimeExports.jsx(
41821
42332
  Checkbox,
41822
42333
  {
41823
42334
  id: option.id,
41824
- checked: !!selectedValues.includes(option.value),
42335
+ checked: isSelected,
41825
42336
  disabled: !!isDisabled,
41826
42337
  onCheckedChange: (checked) => handleOptionChange(option.value, Boolean(checked)),
41827
- className: "mt-0.5 border border-muted-foreground"
42338
+ className: "mt-0.5 border border-muted-foreground text-primary-foreground"
41828
42339
  }
41829
42340
  ),
41830
42341
  /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -41833,8 +42344,8 @@ var MedAssistWidget = (function(exports) {
41833
42344
  htmlFor: option.id,
41834
42345
  className: cn(
41835
42346
  // Using the same muted color scheme as your other components
41836
- "text-sm font-medium leading-none cursor-pointer",
41837
- isDisabled ? "text-muted-foreground cursor-not-allowed" : "text-secondary-foreground"
42347
+ "text-sm font-normal leading-4 cursor-pointer",
42348
+ isDisabled ? "text-muted-foreground cursor-not-allowed" : isSelected ? "text-primary" : "text-secondary-foreground"
41838
42349
  // Dark grey like other components
41839
42350
  ),
41840
42351
  children: option.label
@@ -41843,7 +42354,7 @@ var MedAssistWidget = (function(exports) {
41843
42354
  ] }, option.id);
41844
42355
  }),
41845
42356
  extraOption && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
41846
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "border-t border-gray-300 my-3" }),
42357
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "border-t border-border-medium my-3" }),
41847
42358
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center space-x-3", children: [
41848
42359
  /* @__PURE__ */ jsxRuntimeExports.jsx(
41849
42360
  Checkbox,
@@ -41865,8 +42376,6 @@ var MedAssistWidget = (function(exports) {
41865
42376
  ] })
41866
42377
  ] })
41867
42378
  ] }),
41868
- error && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-red-500 mt-3", children: error }),
41869
- required && !isValid && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-red-500 mt-3", children: "Please select at least one option" }),
41870
42379
  maxSelections && currentNonExtraSelections >= maxSelections && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-blue-600 mt-3", children: maxSelections === 1 ? "You can select only 1 option" : `Maximum ${maxSelections} selections allowed` })
41871
42380
  ]
41872
42381
  }
@@ -42150,11 +42659,11 @@ var MedAssistWidget = (function(exports) {
42150
42659
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(
42151
42660
  Card,
42152
42661
  {
42153
- className: "max-w-md rounded-xl border-lavender-200 shadow-md p-0 bg-white overflow-hidden",
42662
+ className: "max-w-md rounded-xl border-primary/20 shadow-md p-0 bg-surface overflow-hidden",
42154
42663
  "aria-label": "Appointment card",
42155
42664
  children: [
42156
- /* @__PURE__ */ jsxRuntimeExports.jsx(CardHeader, { className: "flex flex-row items-center justify-between gap-3 bg-lavender-50 rounded-t-xl p-4 border-b border-lavender-100 overflow-hidden", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-3", children: [
42157
- doctorDetails.profile_pic && /* @__PURE__ */ jsxRuntimeExports.jsxs(Avatar, { className: "h-12 w-12 ring-2 ring-lavender-200", children: [
42665
+ /* @__PURE__ */ jsxRuntimeExports.jsx(CardHeader, { className: "flex flex-row items-center justify-between gap-3 bg-secondary rounded-t-xl p-4 border-b border-border-subtle overflow-hidden", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-3", children: [
42666
+ doctorDetails.profile_pic && /* @__PURE__ */ jsxRuntimeExports.jsxs(Avatar, { className: "h-12 w-12 ring-2 ring-primary/20", children: [
42158
42667
  /* @__PURE__ */ jsxRuntimeExports.jsx(
42159
42668
  AvatarImage,
42160
42669
  {
@@ -42163,7 +42672,7 @@ var MedAssistWidget = (function(exports) {
42163
42672
  crossOrigin: "anonymous"
42164
42673
  }
42165
42674
  ),
42166
- /* @__PURE__ */ jsxRuntimeExports.jsx(AvatarFallback, { className: "bg-lavender-100 text-lavender-700", children: getInitials(doctorDetails.name) })
42675
+ /* @__PURE__ */ jsxRuntimeExports.jsx(AvatarFallback, { className: "bg-secondary text-primary", children: getInitials(doctorDetails.name) })
42167
42676
  ] }),
42168
42677
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "min-w-0", children: [
42169
42678
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-wrap items-baseline gap-2", children: [
@@ -42174,7 +42683,7 @@ var MedAssistWidget = (function(exports) {
42174
42683
  href: doctorDetails.profile_link,
42175
42684
  target: "_blank",
42176
42685
  rel: "noreferrer",
42177
- className: "text-xs font-semibold text-lavender-600 hover:text-lavender-700 hover:underline",
42686
+ className: "text-xs font-semibold text-primary hover:text-primary/90 hover:underline",
42178
42687
  children: "View profile"
42179
42688
  }
42180
42689
  ) : null
@@ -42189,26 +42698,26 @@ var MedAssistWidget = (function(exports) {
42189
42698
  ] })
42190
42699
  ] }) }),
42191
42700
  /* @__PURE__ */ jsxRuntimeExports.jsxs(CardContent, { className: "px-4 py-2", children: [
42192
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid gap-2 border-b border-lavender-100 pb-3", children: [
42193
- doctorDetails?.timings && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-start gap-2 text-sm text-slate-900", children: [
42701
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid gap-2 border-b border-border-subtle pb-3", children: [
42702
+ doctorDetails?.timings && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-start gap-2 text-sm text-text-primary", children: [
42194
42703
  /* @__PURE__ */ jsxRuntimeExports.jsx(
42195
42704
  Clock,
42196
42705
  {
42197
- className: "h-4 w-4 text-lavender-600 mt-0.5 flex-shrink-0",
42706
+ className: "h-4 w-4 text-primary mt-0.5 flex-shrink-0",
42198
42707
  "aria-hidden": true
42199
42708
  }
42200
42709
  ),
42201
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-slate-600 text-xs", children: doctorDetails?.timings })
42710
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-text-secondary text-xs", children: doctorDetails?.timings })
42202
42711
  ] }),
42203
- doctorDetails.languages ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2 text-sm text-slate-900", children: [
42204
- /* @__PURE__ */ jsxRuntimeExports.jsx(Languages, { className: "h-4 w-4 text-lavender-600", "aria-hidden": true }),
42205
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-slate-600", children: doctorDetails.languages })
42712
+ doctorDetails.languages ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2 text-sm text-text-primary", children: [
42713
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Languages, { className: "h-4 w-4 text-primary", "aria-hidden": true }),
42714
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-text-secondary", children: doctorDetails.languages })
42206
42715
  ] }) : null,
42207
- doctorDetails?.hospitals && doctorDetails.hospitals?.length > 1 ? selectedHospital && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2 text-sm text-slate-900", children: [
42716
+ doctorDetails?.hospitals && doctorDetails.hospitals?.length > 1 ? selectedHospital && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2 text-sm text-text-primary", children: [
42208
42717
  /* @__PURE__ */ jsxRuntimeExports.jsx(
42209
42718
  Building2,
42210
42719
  {
42211
- className: "h-4 w-4 text-lavender-600",
42720
+ className: "h-4 w-4 text-primary",
42212
42721
  "aria-hidden": true
42213
42722
  }
42214
42723
  ),
@@ -42222,15 +42731,15 @@ var MedAssistWidget = (function(exports) {
42222
42731
  value: selectedHospital
42223
42732
  }
42224
42733
  )
42225
- ] }) : /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2 text-sm text-slate-900", children: [
42734
+ ] }) : /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2 text-sm text-text-primary", children: [
42226
42735
  /* @__PURE__ */ jsxRuntimeExports.jsx(
42227
42736
  Building2,
42228
42737
  {
42229
- className: "h-4 w-4 text-lavender-600",
42738
+ className: "h-4 w-4 text-primary",
42230
42739
  "aria-hidden": true
42231
42740
  }
42232
42741
  ),
42233
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-slate-600", children: doctorDetails.hospitals?.[0].name || "" })
42742
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-text-secondary", children: doctorDetails.hospitals?.[0].name || "" })
42234
42743
  ] })
42235
42744
  ] }),
42236
42745
  availabilityForSelectedHospital.length > 0 || loadingAvailabilityDates ? /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -42242,7 +42751,7 @@ var MedAssistWidget = (function(exports) {
42242
42751
  "aria-controls": "ap-slots",
42243
42752
  onClick: () => setOpen((o) => !o),
42244
42753
  disabled: loadingAvailabilityDates,
42245
- className: "mt-3 w-full border-lavender-500 text-lavender-600 hover:bg-lavender-50 hover:border-lavender-600 disabled:opacity-50",
42754
+ className: "mt-3 w-full border-primary text-primary hover:bg-secondary hover:border-primary/80 disabled:opacity-50",
42246
42755
  children: loadingAvailabilityDates ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
42247
42756
  /* @__PURE__ */ jsxRuntimeExports.jsx(LoaderCircle, { className: "h-4 w-4 mr-2 animate-spin" }),
42248
42757
  "Loading availability..."
@@ -42257,7 +42766,7 @@ var MedAssistWidget = (function(exports) {
42257
42766
  )
42258
42767
  ] })
42259
42768
  }
42260
- ) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-3 w-full flex items-center justify-center py-3 px-4 bg-lavender-50 border border-lavender-200 rounded-lg", children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-sm text-slate-600 font-medium", children: "No details available" }) }),
42769
+ ) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-3 w-full flex items-center justify-center py-3 px-4 bg-secondary border border-primary/20 rounded-lg", children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-sm text-slate-600 font-medium", children: "No details available" }) }),
42261
42770
  open && availabilityForSelectedHospital.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(
42262
42771
  "div",
42263
42772
  {
@@ -42276,7 +42785,7 @@ var MedAssistWidget = (function(exports) {
42276
42785
  onClick: prevCalendar,
42277
42786
  "aria-label": "Previous 3 days",
42278
42787
  disabled: disabled || !canGoPrevious,
42279
- className: "h-8 w-8 flex-shrink-0 rounded-md border-lavender-200 bg-white text-lavender-700 hover:bg-lavender-50 hover:border-lavender-300 disabled:opacity-50",
42788
+ className: "h-8 w-8 flex-shrink-0 rounded-md border-primary/20 bg-surface text-primary hover:bg-secondary hover:border-primary/30 disabled:opacity-50",
42280
42789
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronLeft, { className: "h-4 w-4" })
42281
42790
  }
42282
42791
  ),
@@ -42293,9 +42802,9 @@ var MedAssistWidget = (function(exports) {
42293
42802
  "aria-current": isSelected ? "date" : void 0,
42294
42803
  className: cn(
42295
42804
  "flex flex-col items-center justify-center h-12 rounded-lg border-2 p-2 gap-0.5 min-w-0 transition-all",
42296
- isSelected && "border-lavender-500 ring-2 ring-lavender-200 bg-lavender-50 shadow-sm",
42297
- isDisabled && "border-slate-200 bg-slate-50 text-slate-300 cursor-not-allowed",
42298
- !isSelected && !isDisabled && "border-slate-200 bg-white hover:bg-lavender-50 hover:border-lavender-300"
42805
+ isSelected && "border-primary ring-2 ring-primary/20 bg-secondary shadow-sm",
42806
+ isDisabled && "border-border-subtle bg-surface-secondary text-text-tertiary cursor-not-allowed",
42807
+ !isSelected && !isDisabled && "border-border-subtle bg-surface hover:bg-secondary hover:border-primary/30"
42299
42808
  ),
42300
42809
  children: [
42301
42810
  /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -42303,9 +42812,9 @@ var MedAssistWidget = (function(exports) {
42303
42812
  {
42304
42813
  className: cn(
42305
42814
  "text-[10px] tracking-wide w-full text-center font-medium",
42306
- isSelected && "text-lavender-700",
42307
- isDisabled && "text-slate-300",
42308
- !isSelected && !isDisabled && "text-slate-600"
42815
+ isSelected && "text-primary",
42816
+ isDisabled && "text-text-tertiary",
42817
+ !isSelected && !isDisabled && "text-text-secondary"
42309
42818
  ),
42310
42819
  children: day.weekday
42311
42820
  }
@@ -42315,9 +42824,9 @@ var MedAssistWidget = (function(exports) {
42315
42824
  {
42316
42825
  className: cn(
42317
42826
  "text-xs font-bold w-full text-center",
42318
- isSelected && "text-lavender-700",
42319
- isDisabled && "text-slate-300",
42320
- !isSelected && !isDisabled && "text-slate-900"
42827
+ isSelected && "text-primary",
42828
+ isDisabled && "text-text-tertiary",
42829
+ !isSelected && !isDisabled && "text-text-primary"
42321
42830
  ),
42322
42831
  children: day.dayNum
42323
42832
  }
@@ -42336,14 +42845,14 @@ var MedAssistWidget = (function(exports) {
42336
42845
  onClick: nextCalendar,
42337
42846
  "aria-label": "Next 3 days",
42338
42847
  disabled: disabled || !canGoNext,
42339
- className: "h-8 w-8 flex-shrink-0 rounded-md border-lavender-200 bg-white text-lavender-700 hover:bg-lavender-50 hover:border-lavender-300 disabled:opacity-50",
42848
+ className: "h-8 w-8 flex-shrink-0 rounded-md border-primary/20 bg-surface text-primary hover:bg-secondary hover:border-primary/30 disabled:opacity-50",
42340
42849
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronRight, { className: "h-4 w-4" })
42341
42850
  }
42342
42851
  )
42343
42852
  ] }),
42344
42853
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "px-0.5 py-3", children: loadingAvailabilitySlots ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-center py-4", children: [
42345
- /* @__PURE__ */ jsxRuntimeExports.jsx(LoaderCircle, { className: "h-4 w-4 animate-spin text-lavender-600 mr-2" }),
42346
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-sm text-slate-600", children: "Loading slots..." })
42854
+ /* @__PURE__ */ jsxRuntimeExports.jsx(LoaderCircle, { className: "h-4 w-4 animate-spin text-primary mr-2" }),
42855
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-sm text-text-secondary", children: "Loading slots..." })
42347
42856
  ] }) : selectedDateData?.slots?.length ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "grid grid-cols-2 gap-2 max-h-48 overflow-y-auto", children: selectedDateData.slots.map((t, index2) => {
42348
42857
  const selected = selectedSlot === t;
42349
42858
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(
@@ -42356,7 +42865,7 @@ var MedAssistWidget = (function(exports) {
42356
42865
  disabled,
42357
42866
  className: cn(
42358
42867
  "inline-flex h-9 items-center justify-center gap-2 rounded-lg px-3 text-xs font-semibold transition-all",
42359
- selected ? "border-lavender-600 bg-lavender-600 text-white shadow-sm hover:bg-lavender-700 hover:border-lavender-700" : "border-lavender-200 bg-white text-slate-900 hover:bg-lavender-50 hover:border-lavender-300"
42868
+ selected ? "border-primary bg-primary text-white shadow-sm hover:bg-primary/90 hover:border-primary/90" : "border-primary/20 bg-surface text-text-primary hover:bg-secondary hover:border-primary/30"
42360
42869
  ),
42361
42870
  children: [
42362
42871
  /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -42364,7 +42873,7 @@ var MedAssistWidget = (function(exports) {
42364
42873
  {
42365
42874
  className: cn(
42366
42875
  "h-3.5 w-3.5 flex-shrink-0",
42367
- selected ? "text-white" : "text-lavender-600"
42876
+ selected ? "text-white" : "text-primary"
42368
42877
  )
42369
42878
  }
42370
42879
  ),
@@ -42373,7 +42882,7 @@ var MedAssistWidget = (function(exports) {
42373
42882
  },
42374
42883
  t || `slot-${index2}`
42375
42884
  );
42376
- }) }) : /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "px-1 text-sm text-slate-600", children: "No slots available for this day." }) }),
42885
+ }) }) : /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "px-1 text-sm text-text-secondary", children: "No slots available for this day." }) }),
42377
42886
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "px-0.5 pb-1.5", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
42378
42887
  Button,
42379
42888
  {
@@ -42381,14 +42890,14 @@ var MedAssistWidget = (function(exports) {
42381
42890
  onClick: handleBook,
42382
42891
  disabled: !selectedSlot || disabled,
42383
42892
  "aria-disabled": !selectedSlot,
42384
- className: "w-full h-10 gap-2 bg-lavender-600 text-white hover:bg-lavender-700 disabled:opacity-60 shadow-sm font-semibold",
42893
+ className: "w-full h-10 gap-2 bg-primary text-white hover:bg-primary/90 disabled:opacity-60 shadow-sm font-semibold",
42385
42894
  children: [
42386
42895
  "Book appointment",
42387
42896
  /* @__PURE__ */ jsxRuntimeExports.jsx(ArrowRight, { className: "h-4 w-4" })
42388
42897
  ]
42389
42898
  }
42390
42899
  ) })
42391
- ] }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "px-1 pb-2 pt-1", children: /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-slate-600", children: error ? error : "No availability provided." }) })
42900
+ ] }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "px-1 pb-2 pt-1", children: /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-text-secondary", children: error ? error : "No availability provided." }) })
42392
42901
  }
42393
42902
  )
42394
42903
  ] })
@@ -42485,11 +42994,11 @@ var MedAssistWidget = (function(exports) {
42485
42994
  if (loading && loadedCount === 0) {
42486
42995
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center justify-center py-8", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-center", children: [
42487
42996
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "animate-spin rounded-full h-8 w-8 border-b-2 border-[var(--color-primary)] mx-auto mb-3" }),
42488
- /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-500", children: "Loading doctor details..." })
42997
+ /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-text-tertiary", children: "Loading doctor details..." })
42489
42998
  ] }) });
42490
42999
  }
42491
43000
  if (loadedCount === 0) {
42492
- return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center justify-center py-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-500", children: "No doctor details available." }) });
43001
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center justify-center py-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-text-tertiary", children: "No doctor details available." }) });
42493
43002
  }
42494
43003
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-4", children: [
42495
43004
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "space-y-4", children: doctorAvailabilities.map(
@@ -42534,21 +43043,196 @@ var MedAssistWidget = (function(exports) {
42534
43043
  ] })
42535
43044
  ] });
42536
43045
  }
43046
+ const CARD_ICONS = {
43047
+ voucher: Ticket,
43048
+ pharmacy: Building2,
43049
+ hospital: Building2,
43050
+ map: Map$1,
43051
+ location_pin: MapPin,
43052
+ "location pin": MapPin,
43053
+ check: Check,
43054
+ calendar: Calendar
43055
+ };
43056
+ const ICON_CDN_BASE = "https://cdn.jsdelivr.net/npm/lucide-static@0.263.1/icons";
43057
+ function CardIcon({
43058
+ name: name2,
43059
+ className,
43060
+ size = 16
43061
+ }) {
43062
+ const key = name2?.trim().toLowerCase().replace(/\s+/g, "_");
43063
+ if (!key) return null;
43064
+ const IconComponent = CARD_ICONS[key];
43065
+ if (IconComponent) {
43066
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(IconComponent, { className, size, "aria-hidden": true });
43067
+ }
43068
+ if (/^https?:\/\//i.test(name2) || name2.startsWith("//")) {
43069
+ const src = name2.startsWith("//") ? `https:${name2}` : name2;
43070
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
43071
+ "img",
43072
+ {
43073
+ src,
43074
+ alt: "",
43075
+ className,
43076
+ width: size,
43077
+ height: size,
43078
+ "aria-hidden": true,
43079
+ onError: (e) => {
43080
+ e.target.style.display = "none";
43081
+ }
43082
+ }
43083
+ );
43084
+ }
43085
+ const kebab2 = key.replace(/_/g, "-");
43086
+ const cdnUrl = `${ICON_CDN_BASE}/${kebab2}.svg`;
43087
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
43088
+ "img",
43089
+ {
43090
+ src: cdnUrl,
43091
+ alt: "",
43092
+ className,
43093
+ width: size,
43094
+ height: size,
43095
+ "aria-hidden": true,
43096
+ onError: (e) => {
43097
+ e.target.style.display = "none";
43098
+ }
43099
+ }
43100
+ );
43101
+ }
43102
+ const BANNER_THEME_CLASSES = {
43103
+ success: "bg-emerald-100 text-emerald-800",
43104
+ warning: "bg-amber-100 text-amber-800",
43105
+ danger: "bg-red-100 text-red-800",
43106
+ primary: "bg-primary/15 text-primary"
43107
+ };
43108
+ const CTA_VARIANT = {
43109
+ primary: "default",
43110
+ success: "default",
43111
+ warning: "default",
43112
+ danger: "destructive"
43113
+ };
43114
+ function GenericCard({
43115
+ card,
43116
+ onSendMessage,
43117
+ disabled = false
43118
+ }) {
43119
+ const {
43120
+ title,
43121
+ tags,
43122
+ icon,
43123
+ description,
43124
+ banner,
43125
+ items,
43126
+ ctas
43127
+ } = card;
43128
+ const handleCtaClick = (cta) => {
43129
+ if (disabled) return;
43130
+ if (cta.link) {
43131
+ window.open(cta.link, "_blank", "noopener,noreferrer");
43132
+ }
43133
+ const action = cta.action?.trim();
43134
+ if (action) {
43135
+ onSendMessage?.(action);
43136
+ }
43137
+ };
43138
+ const bannerTheme = banner?.theme ?? "success";
43139
+ const bannerClass = BANNER_THEME_CLASSES[bannerTheme];
43140
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(Card, { className: "overflow-hidden rounded-xl border border-border bg-card text-card-foreground shadow-sm", children: [
43141
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(CardHeader, { className: "flex flex-row items-start justify-between gap-3 pb-2", children: [
43142
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "min-w-0 flex-1", children: [
43143
+ title ? /* @__PURE__ */ jsxRuntimeExports.jsx(CardTitle, { className: "text-base font-bold leading-tight tracking-tight", children: title }) : null,
43144
+ tags?.length ? /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "mt-1 text-xs text-muted-foreground", children: tags.join(" • ") }) : null
43145
+ ] }),
43146
+ icon ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "shrink-0 text-muted-foreground", children: /* @__PURE__ */ jsxRuntimeExports.jsx(CardIcon, { name: icon, size: 24, className: "text-primary" }) }) : null
43147
+ ] }),
43148
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(CardContent, { className: "space-y-3 pt-0", children: [
43149
+ description ? /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-foreground leading-snug", children: description }) : null,
43150
+ banner?.text ? /* @__PURE__ */ jsxRuntimeExports.jsx(
43151
+ "div",
43152
+ {
43153
+ className: cn(
43154
+ "rounded-full px-4 py-2 text-center text-sm font-semibold",
43155
+ bannerClass
43156
+ ),
43157
+ children: banner.text
43158
+ }
43159
+ ) : null,
43160
+ items?.length ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-wrap gap-x-4 gap-y-1", children: items.map((item, i) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
43161
+ "div",
43162
+ {
43163
+ className: "flex items-center gap-1.5 text-xs text-foreground",
43164
+ children: [
43165
+ item.icon ? /* @__PURE__ */ jsxRuntimeExports.jsx(
43166
+ CardIcon,
43167
+ {
43168
+ name: item.icon,
43169
+ size: 12,
43170
+ className: "shrink-0 text-muted-foreground"
43171
+ }
43172
+ ) : null,
43173
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: item.text })
43174
+ ]
43175
+ },
43176
+ i
43177
+ )) }) : null
43178
+ ] }),
43179
+ ctas?.length ? /* @__PURE__ */ jsxRuntimeExports.jsx(CardFooter, { className: "flex justify-center flex-wrap gap-2 pt-0", children: ctas.map((cta, i) => {
43180
+ const variant = cta.theme ? CTA_VARIANT[cta.theme] : "default";
43181
+ const isOutline = i > 0 || cta.link && !cta.action;
43182
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(
43183
+ Button,
43184
+ {
43185
+ type: "button",
43186
+ variant: isOutline ? "outline" : variant,
43187
+ size: "sm",
43188
+ className: "gap-1.5",
43189
+ disabled,
43190
+ onClick: () => handleCtaClick(cta),
43191
+ children: [
43192
+ cta.icon ? /* @__PURE__ */ jsxRuntimeExports.jsx(CardIcon, { name: cta.icon, size: 14, className: "shrink-0" }) : null,
43193
+ cta.title
43194
+ ]
43195
+ },
43196
+ i
43197
+ );
43198
+ }) }) : null
43199
+ ] });
43200
+ }
43201
+ function CardList({
43202
+ cards,
43203
+ onSendMessage,
43204
+ disabled = false,
43205
+ className
43206
+ }) {
43207
+ if (!cards?.length) {
43208
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-muted-foreground py-2", children: "No options available." });
43209
+ }
43210
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: className ?? "flex flex-col gap-3 mt-3", children: cards.map((card, index2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
43211
+ GenericCard,
43212
+ {
43213
+ card,
43214
+ onSendMessage,
43215
+ disabled
43216
+ },
43217
+ index2
43218
+ )) });
43219
+ }
42537
43220
  function ChatMessage({
42538
43221
  role,
42539
43222
  content: content2,
42540
- timestamp,
42541
- iconUrl,
43223
+ // timestamp,
42542
43224
  files,
42543
43225
  isLastMessage,
42544
43226
  progressMessage,
42545
43227
  toolEscalationData,
42546
43228
  toolCallStatus,
42547
43229
  callTool,
42548
- onSendMessage
43230
+ onSendMessage,
43231
+ onToggleFeedback
42549
43232
  }) {
42550
43233
  const isUser = role === "user";
42551
43234
  const [selectedValues, setSelectedValues] = reactExports.useState([]);
43235
+ const [userFeedback, setUserFeedback] = reactExports.useState(distExports.USER_FEEDBACK.NONE);
42552
43236
  const { isStreaming } = useMedAssistStore();
42553
43237
  const handlePillClick = async (choice) => {
42554
43238
  const messageId = Date.now().toString();
@@ -42564,6 +43248,10 @@ var MedAssistWidget = (function(exports) {
42564
43248
  toolCalled: true
42565
43249
  });
42566
43250
  };
43251
+ const handleToggleFeedback = (feedback) => {
43252
+ setUserFeedback(feedback);
43253
+ onToggleFeedback(feedback);
43254
+ };
42567
43255
  const handleMultiSelectChange = (values) => {
42568
43256
  setSelectedValues(values);
42569
43257
  console.log("Multi-select changed:", values);
@@ -42615,101 +43303,153 @@ var MedAssistWidget = (function(exports) {
42615
43303
  });
42616
43304
  }
42617
43305
  };
42618
- return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: cn("flex", isUser ? "justify-end" : "justify-start"), children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
42619
- "div",
42620
- {
42621
- className: cn(
42622
- "flex gap-3",
42623
- isUser ? "flex-row-reverse" : "flex-row",
42624
- toolEscalationData?.details?.component === distExports.SYNAPSE_COMPONENTS.MULTI ? "max-w-md" : isUser ? "max-w-[60%]" : "max-w-xs"
42625
- ),
42626
- children: [
42627
- !isUser && /* @__PURE__ */ jsxRuntimeExports.jsx(Avatar, { className: "w-8 h-8 bg-gradient-to-br from-lavender-400 to-lavender-500 text-white text-xs font-bold flex-shrink-0", children: /* @__PURE__ */ jsxRuntimeExports.jsx(AvatarFallback, { className: "bg-transparent text-white text-xs font-bold", children: iconUrl ? /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: iconUrl, alt: "Bot Icon", className: "w-full h-full" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(Bot, { className: "w-full h-full" }) }) }),
42628
- /* @__PURE__ */ jsxRuntimeExports.jsxs(
42629
- Card,
43306
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
43307
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: cn("flex", isUser ? "justify-end" : "justify-start"), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
43308
+ "div",
43309
+ {
43310
+ className: cn(
43311
+ "flex gap-3",
43312
+ isUser ? "flex-row-reverse" : "flex-row",
43313
+ toolEscalationData?.details?.component === distExports.SYNAPSE_COMPONENTS.MULTI ? "max-w-md" : isUser ? "max-w-[60%]" : "max-w-xs"
43314
+ ),
43315
+ children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col", children: [
43316
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
43317
+ Card,
43318
+ {
43319
+ className: cn(
43320
+ "px-4 py-2 rounded-lg shadow-none break-words overflow-wrap-anywhere whitespace-pre-wrap",
43321
+ isUser ? "bg-primary text-primary-foreground shadow-sm" : cn(
43322
+ "text-foreground shadow-sm bg-botMessage blur-xs"
43323
+ ),
43324
+ toolEscalationData && "w-full"
43325
+ ),
43326
+ children: [
43327
+ toolCallStatus && !isUser && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-xs text-muted-foreground mb-2 pb-2 border-b border-border-subtle", children: toolCallStatus }),
43328
+ !toolCallStatus && progressMessage && !isUser && isLastMessage && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm font-medium text-muted-foreground pb-2", children: progressMessage }),
43329
+ content2 && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-sm markdown-content mb-3", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Markdown, { children: `${content2} ${!isUser && isStreaming && isLastMessage ? "..." : ""}` }) }),
43330
+ files && files.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx(FilePreviewList, { files, isPreview: false, className: "" }) }),
43331
+ progressMessage && !isUser && isLastMessage && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm font-medium text-muted-foreground", children: progressMessage })
43332
+ ]
43333
+ }
43334
+ ),
43335
+ !isUser && !isStreaming && isLastMessage && userFeedback === distExports.USER_FEEDBACK.NONE && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-1 self-start mt-1", children: [
43336
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
43337
+ Button,
43338
+ {
43339
+ variant: "ghost",
43340
+ size: "sm",
43341
+ className: "h-6 w-6 p-0 hover:bg-muted text-muted-foreground",
43342
+ onClick: () => handleToggleFeedback(distExports.USER_FEEDBACK.LIKE),
43343
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(ThumbsUp, { className: "h-3 w-3" })
43344
+ }
43345
+ ),
43346
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
43347
+ Button,
43348
+ {
43349
+ variant: "ghost",
43350
+ size: "sm",
43351
+ className: "h-6 w-6 p-0 hover:bg-muted text-muted-foreground",
43352
+ onClick: () => handleToggleFeedback(distExports.USER_FEEDBACK.DISLIKE),
43353
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(ThumbsDown, { className: "h-3 w-3" })
43354
+ }
43355
+ )
43356
+ ] }),
43357
+ !isUser && !isStreaming && isLastMessage && userFeedback === distExports.USER_FEEDBACK.LIKE && /* @__PURE__ */ jsxRuntimeExports.jsx(
43358
+ Button,
43359
+ {
43360
+ variant: "ghost",
43361
+ size: "sm",
43362
+ className: "h-6 w-6 p-0 self-start mt-1 hover:bg-muted text-primary",
43363
+ disabled: true,
43364
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(ThumbsUp, { className: "h-3 w-3" })
43365
+ }
43366
+ ),
43367
+ !isUser && !isStreaming && isLastMessage && userFeedback === distExports.USER_FEEDBACK.DISLIKE && /* @__PURE__ */ jsxRuntimeExports.jsx(
43368
+ Button,
43369
+ {
43370
+ variant: "ghost",
43371
+ size: "sm",
43372
+ className: "h-6 w-6 p-0 self-start mt-1 hover:bg-muted text-primary",
43373
+ disabled: true,
43374
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(ThumbsDown, { className: "h-3 w-3" })
43375
+ }
43376
+ )
43377
+ ] })
43378
+ }
43379
+ ) }),
43380
+ !toolEscalationData?.isResponded && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-end", children: [
43381
+ toolEscalationData?.details?.component === distExports.SYNAPSE_COMPONENTS.PILL && toolEscalationData?.details?.input?.options && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-wrap gap-2 mt-3", children: toolEscalationData.details?.input?.options.map(
43382
+ (choice, index2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
43383
+ Pills,
43384
+ {
43385
+ disabled: toolEscalationData?.isResponded,
43386
+ text: choice?.label || "",
43387
+ onClick: () => handlePillClick(choice?.value || ""),
43388
+ className: "cursor-pointer"
43389
+ },
43390
+ index2
43391
+ )
43392
+ ) }),
43393
+ toolEscalationData?.details?.component === distExports.SYNAPSE_COMPONENTS.MULTI && toolEscalationData?.details?.input?.options && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-3 space-y-3 break-words overflow-wrap-anywhere whitespace-pre-wrap bg-popover border border-primary/40 rounded-xl p-4", children: [
43394
+ /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-xs font-medium text-muted-foreground mb-2", children: "Select multiple options:" }),
43395
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
43396
+ MultiSelectGroup,
43397
+ {
43398
+ options: getMultiSelectOptions(),
43399
+ selectedValues,
43400
+ onSelectionChange: handleMultiSelectChange,
43401
+ additionalOption: getAdditionalOption(),
43402
+ disabled: toolEscalationData?.isResponded
43403
+ }
43404
+ ),
43405
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
43406
+ Button,
42630
43407
  {
43408
+ onClick: handleConfirm,
43409
+ disabled: selectedValues.length === 0 || toolEscalationData?.isResponded,
42631
43410
  className: cn(
42632
- "px-4 py-2 rounded-2xl shadow-none break-words overflow-wrap-anywhere whitespace-pre-wrap",
42633
- isUser ? "bg-lavender-100/95 backdrop-blur-md text-slate-900 rounded-br-none border border-lavender-200/60" : "bg-white/80 backdrop-blur-md text-slate-800 shadow-sm rounded-bl-none border border-lavender-200/40",
42634
- toolEscalationData && "w-full"
43411
+ "w-full rounded-lg px-4 py-2 text-sm font-medium transition-all",
43412
+ "bg-primary hover:bg-primary/90 text-primary-foreground",
43413
+ "disabled:opacity-50 disabled:cursor-not-allowed disabled:bg-surface-secondary disabled:text-text-tertiary",
43414
+ "shadow-sm hover:shadow-md active:scale-[0.98] "
42635
43415
  ),
42636
- children: [
42637
- toolCallStatus && !isUser && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-xs text-slate-500 mb-2 pb-2 border-b border-slate-200", children: toolCallStatus }),
42638
- !toolCallStatus && progressMessage && !isUser && isLastMessage && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm font-medium text-slate-500 pb-2", children: progressMessage }),
42639
- content2 && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-sm markdown-content mb-3", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Markdown, { children: `${content2} ${!isUser && isStreaming && isLastMessage ? "..." : ""}` }) }),
42640
- files && files.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx(FilePreviewList, { files, isPreview: false, className: "" }) }),
42641
- toolEscalationData?.details?.component === distExports.SYNAPSE_COMPONENTS.PILL && toolEscalationData?.details?.input?.options && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-wrap gap-2 mt-3", children: toolEscalationData.details?.input?.options.map(
42642
- (choice, index2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
42643
- Pills,
42644
- {
42645
- disabled: toolEscalationData?.isResponded,
42646
- text: choice?.label || "",
42647
- onClick: () => handlePillClick(choice?.value || ""),
42648
- className: "cursor-pointer hover:bg-lavender-100/80 transition-colors"
42649
- },
42650
- index2
42651
- )
42652
- ) }),
42653
- toolEscalationData?.details?.component === distExports.SYNAPSE_COMPONENTS.MULTI && toolEscalationData?.details?.input?.options && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-3 space-y-3 break-words overflow-wrap-anywhere whitespace-pre-wrap", children: [
42654
- /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-sm font-medium text-gray-700 mb-2", children: "Select multiple options:" }),
42655
- /* @__PURE__ */ jsxRuntimeExports.jsx(
42656
- MultiSelectGroup,
42657
- {
42658
- options: getMultiSelectOptions(),
42659
- selectedValues,
42660
- onSelectionChange: handleMultiSelectChange,
42661
- additionalOption: getAdditionalOption(),
42662
- disabled: toolEscalationData?.isResponded
42663
- }
42664
- ),
42665
- /* @__PURE__ */ jsxRuntimeExports.jsx(
42666
- Button,
42667
- {
42668
- onClick: handleConfirm,
42669
- disabled: selectedValues.length === 0 || toolEscalationData?.isResponded,
42670
- className: cn(
42671
- "w-full rounded-lg px-4 py-2 text-sm font-medium transition-all",
42672
- "bg-blue-100 hover:bg-blue-200 text-blue-600 border border-blue-200",
42673
- "disabled:opacity-50 disabled:cursor-not-allowed disabled:bg-gray-100 disabled:text-gray-400 disabled:border-gray-200",
42674
- "shadow-sm hover:shadow-md active:scale-[0.98] "
42675
- ),
42676
- children: "Confirm"
42677
- }
42678
- )
42679
- ] }),
42680
- toolEscalationData?.details?.component === distExports.SYNAPSE_COMPONENTS.DOCTOR_CARD && toolEscalationData?.details?.input?.doctors && callTool ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-3", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
42681
- DoctorCardList,
42682
- {
42683
- doctorAvailabilities: toolEscalationData?.details?.input?.doctors,
42684
- doctorDetails: toolEscalationData?.details?.input?.doctor_details,
42685
- callTool,
42686
- callbacks: toolEscalationData?.details?._meta?.callbacks,
42687
- onBook: handleBook,
42688
- disabled: toolEscalationData?.isResponded
42689
- }
42690
- ) }) : null,
42691
- progressMessage && !isUser && isLastMessage && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm font-medium text-teal-600", children: progressMessage }),
42692
- timestamp && /* @__PURE__ */ jsxRuntimeExports.jsx(
42693
- "p",
42694
- {
42695
- className: cn(
42696
- "text-xs mt-2 text-right",
42697
- isUser ? "text-slate-500" : "text-slate-500"
42698
- ),
42699
- children: timestamp
42700
- }
42701
- )
42702
- ]
43416
+ children: "Confirm"
42703
43417
  }
42704
43418
  )
42705
- ]
42706
- }
42707
- ) });
43419
+ ] }),
43420
+ toolEscalationData?.details?.component === distExports.SYNAPSE_COMPONENTS.DOCTOR_CARD && toolEscalationData?.details?.input?.doctors && callTool ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-3", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
43421
+ DoctorCardList,
43422
+ {
43423
+ doctorAvailabilities: toolEscalationData?.details?.input?.doctors,
43424
+ doctorDetails: toolEscalationData?.details?.input?.doctor_details,
43425
+ callTool,
43426
+ callbacks: toolEscalationData?.details?._meta?.callbacks,
43427
+ onBook: handleBook,
43428
+ disabled: toolEscalationData?.isResponded
43429
+ }
43430
+ ) }) : null,
43431
+ toolEscalationData?.details?.component === distExports.SYNAPSE_COMPONENTS.CARD && toolEscalationData?.details?.input?.cards && /* @__PURE__ */ jsxRuntimeExports.jsx(
43432
+ CardList,
43433
+ {
43434
+ cards: toolEscalationData.details.input.cards,
43435
+ onSendMessage: async (message) => {
43436
+ const messageId = Date.now().toString();
43437
+ await onSendMessage({
43438
+ message,
43439
+ messageId,
43440
+ toolCalled: true
43441
+ });
43442
+ },
43443
+ disabled: toolEscalationData?.isResponded
43444
+ }
43445
+ )
43446
+ ] })
43447
+ ] });
42708
43448
  }
42709
43449
  function ChatMessages({
42710
43450
  messages,
42711
43451
  onSendMessage,
42712
- iconUrl,
43452
+ onToggleFeedback,
42713
43453
  callTool
42714
43454
  }) {
42715
43455
  const isWaitingForResponse = useMedAssistStore(
@@ -42720,7 +43460,7 @@ var MedAssistWidget = (function(exports) {
42720
43460
  (messages && messages.length > 0 || progressMessage) && /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: messages.map((message, index2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
42721
43461
  "div",
42722
43462
  {
42723
- className: "animate-slideUp scroll-mt-[80px]",
43463
+ className: "animate-slideUp scroll-mt-[80px] min-w-0 overflow-hidden",
42724
43464
  id: index2 === messages.length - 1 ? "last-message" : void 0,
42725
43465
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(
42726
43466
  ChatMessage,
@@ -42728,101 +43468,43 @@ var MedAssistWidget = (function(exports) {
42728
43468
  role: message.role,
42729
43469
  content: message.content,
42730
43470
  files: message.files || [],
42731
- iconUrl,
42732
43471
  toolEscalationData: message.toolEscalationData,
42733
43472
  timestamp: message.timestamp,
42734
43473
  onSendMessage,
42735
43474
  isLastMessage: index2 === messages.length - 1,
42736
43475
  progressMessage,
42737
43476
  toolCallStatus: message.toolCallStatus,
42738
- callTool
43477
+ callTool,
43478
+ onToggleFeedback: (feedback) => onToggleFeedback(feedback, message.id)
42739
43479
  }
42740
43480
  )
42741
43481
  },
42742
43482
  message.id
42743
43483
  )) }),
42744
- isWaitingForResponse && /* @__PURE__ */ jsxRuntimeExports.jsx(TypingIndicator, { iconUrl })
43484
+ isWaitingForResponse && /* @__PURE__ */ jsxRuntimeExports.jsx(TypingIndicator, {})
42745
43485
  ] });
42746
43486
  }
42747
- function TypingIndicator({ iconUrl }) {
42748
- return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "animate-slideUp", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex justify-start", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex gap-3", children: [
42749
- /* @__PURE__ */ jsxRuntimeExports.jsx(Avatar, { className: "w-8 h-8 bg-gradient-to-br from-lavender-400 to-lavender-500 text-white text-xs font-bold flex-shrink-0", children: /* @__PURE__ */ jsxRuntimeExports.jsx(AvatarFallback, { className: "bg-transparent text-white text-xs font-bold", children: iconUrl ? /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: iconUrl, alt: "Bot Icon", className: "w-4 h-4", loading: "lazy" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(Bot, { className: "w-4 h-4" }) }) }),
42750
- /* @__PURE__ */ jsxRuntimeExports.jsx(Card, { className: "px-4 py-2 rounded-2xl shadow-none bg-white/80 backdrop-blur-md text-slate-800 shadow-sm rounded-bl-none border border-lavender-200/40", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
42751
- "div",
42752
- {
42753
- className: "flex items-center gap-1.5",
42754
- "aria-label": "Bot is typing",
42755
- children: [0, 1, 2].map((index2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
42756
- "span",
42757
- {
42758
- className: "w-2 h-2 rounded-full bg-slate-400 animate-pulse",
42759
- style: { animationDelay: `${index2 * 150}ms` }
42760
- },
42761
- index2
42762
- ))
42763
- }
42764
- ) })
42765
- ] }) }) });
43487
+ function TypingIndicator() {
43488
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "animate-slideUp", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex justify-start", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex gap-3", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Card, { className: "px-4 py-2 rounded-lg shadow-none bg-botMessage backdrop-blur-sm text-text-primary shadow-sm", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
43489
+ "div",
43490
+ {
43491
+ className: "flex items-center gap-1.5",
43492
+ "aria-label": "Bot is typing",
43493
+ children: [0, 1, 2].map((index2) => /* @__PURE__ */ jsxRuntimeExports.jsx(
43494
+ "span",
43495
+ {
43496
+ className: "w-2 h-2 rounded-full bg-foreground animate-pulse",
43497
+ style: { animationDelay: `${index2 * 150}ms` }
43498
+ },
43499
+ index2
43500
+ ))
43501
+ }
43502
+ ) }) }) }) });
42766
43503
  }
42767
43504
  const ChatMessages$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
42768
43505
  __proto__: null,
42769
43506
  default: ChatMessages
42770
43507
  }, Symbol.toStringTag, { value: "Module" }));
42771
- function TaskCards({
42772
- onTaskClick,
42773
- disabled,
42774
- tasks
42775
- }) {
42776
- if (!tasks?.length) {
42777
- return null;
42778
- }
42779
- return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "grid grid-cols-2 gap-3", children: tasks.map((task) => {
42780
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
42781
- Button,
42782
- {
42783
- type: "button",
42784
- variant: "ghost",
42785
- disabled,
42786
- onClick: () => onTaskClick(task.value || ""),
42787
- className: "h-auto w-full flex flex-col items-start bg-white shadow-lg ring-1 ring-lavender-100 backdrop-blur-sm rounded-2xl p-4 hover:bg-white/95 hover:border-lavender-300 hover:shadow-lg transition-all text-left group",
42788
- children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-start justify-between gap-3", children: /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "font-semibold text-sm text-slate-900 text-wrap group-hover:text-lavender-600 transition-colors", children: task.label || "" }) })
42789
- },
42790
- task.value
42791
- );
42792
- }) });
42793
- }
42794
- function EmptyChatState({
42795
- initialPrompt,
42796
- tasks,
42797
- onTaskClick,
42798
- disabled,
42799
- profile
42800
- }) {
42801
- return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
42802
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-center space-y-3 animate-fadeIn", children: [
42803
- profile?.name && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-center gap-2", children: [
42804
- /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-base font-medium bg-gradient-to-r from-lavender-500 via-lavender-400 to-lavender-500 bg-clip-text text-transparent tracking-wide", children: [
42805
- "Hello, ",
42806
- profile.name.split(" ")[0]
42807
- ] }),
42808
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-lavender-400 text-lg", children: "👋" })
42809
- ] }),
42810
- /* @__PURE__ */ jsxRuntimeExports.jsx("h1", { className: "text-xl-minus font-semibold text-slate-900", children: initialPrompt ? initialPrompt : "How can I assist you today?" })
42811
- ] }),
42812
- /* @__PURE__ */ jsxRuntimeExports.jsx(
42813
- TaskCards,
42814
- {
42815
- onTaskClick,
42816
- disabled,
42817
- tasks
42818
- }
42819
- )
42820
- ] });
42821
- }
42822
- const EmptyChatState$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
42823
- __proto__: null,
42824
- default: EmptyChatState
42825
- }, Symbol.toStringTag, { value: "Module" }));
42826
43508
  function ConnectionStatus({
42827
43509
  className = "",
42828
43510
  onRetry,
@@ -42855,8 +43537,8 @@ var MedAssistWidget = (function(exports) {
42855
43537
  children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-3", children: [
42856
43538
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-4 h-4 bg-[#F7B500] rounded-full flex items-center justify-center flex-shrink-0", children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-white text-sm font-bold", children: "!" }) }),
42857
43539
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1", children: [
42858
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-slate-700 font-semibold text-sm", children: error?.title ?? "Something went wrong" }),
42859
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-[#666666] text-xs mt-1", children: "Start a new session." })
43540
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-text-primary font-semibold text-sm", children: error?.title ?? "Something went wrong" }),
43541
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-text-secondary text-xs mt-1", children: "Start a new session." })
42860
43542
  ] }),
42861
43543
  /* @__PURE__ */ jsxRuntimeExports.jsxs(
42862
43544
  "button",
@@ -42865,7 +43547,7 @@ var MedAssistWidget = (function(exports) {
42865
43547
  clearError();
42866
43548
  onStartNewSession?.();
42867
43549
  },
42868
- className: "p-2 bg-[#3B71F7] text-white text-xs font-semibold rounded-lg hover:bg-[#2E5CD9] transition-colors flex items-center gap-2 flex-shrink-0",
43550
+ className: "p-2 bg-primary text-primary-foreground text-xs font-semibold rounded-lg hover:bg-primary/90 transition-colors flex items-center gap-2 flex-shrink-0",
42869
43551
  children: [
42870
43552
  /* @__PURE__ */ jsxRuntimeExports.jsx(
42871
43553
  "svg",
@@ -42899,14 +43581,14 @@ var MedAssistWidget = (function(exports) {
42899
43581
  "div",
42900
43582
  {
42901
43583
  className: cn(
42902
- "mx-4 mb-3 p-2 bg-[#FFFBEB] border border-[#FEE39B] rounded-lg",
43584
+ "mx-4 mb-3 p-2 bg-surface border border-[#F7B500] rounded-lg",
42903
43585
  className
42904
43586
  ),
42905
43587
  children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-3", children: [
42906
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-5 h-5 bg-[#F7B500] rounded-full flex items-center justify-center flex-shrink-0", children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-white text-sm font-bold", children: "!" }) }),
43588
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-5 h-5 bg-[#F7B500] rounded-full flex items-center justify-center flex-shrink-0", children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-primary-foreground text-sm font-bold", children: "!" }) }),
42907
43589
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1", children: [
42908
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-slate-700 font-semibold text-sm", children: error?.title }),
42909
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-slate-500 text-xs mt-1", children: error?.description ?? "Please check your connection and try again" })
43590
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-text-primary font-semibold text-sm", children: error?.title }),
43591
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-text-secondary text-xs mt-1", children: error?.description ?? "Please check your connection and try again" })
42910
43592
  ] }),
42911
43593
  /* @__PURE__ */ jsxRuntimeExports.jsxs(
42912
43594
  "button",
@@ -42915,7 +43597,7 @@ var MedAssistWidget = (function(exports) {
42915
43597
  clearError();
42916
43598
  onRetry?.();
42917
43599
  },
42918
- className: "px-4 py-2 bg-lavender-600 text-white text-sm font-semibold rounded-lg hover:bg-lavender-700 transition-colors flex items-center gap-2 flex-shrink-0",
43600
+ className: "px-4 py-2 bg-primary text-white text-sm font-semibold rounded-lg hover:bg-primary/90 transition-colors flex items-center gap-2 flex-shrink-0",
42919
43601
  children: [
42920
43602
  /* @__PURE__ */ jsxRuntimeExports.jsx(
42921
43603
  "svg",
@@ -42954,16 +43636,16 @@ var MedAssistWidget = (function(exports) {
42954
43636
  "div",
42955
43637
  {
42956
43638
  className: cn(
42957
- "mx-4 mb-3 p-2 bg-[#FFFBEB] border border-[#FDD835] rounded-lg transition-opacity duration-500",
43639
+ "mx-4 mb-3 p-2 bg-surface border border-border-subtle rounded-lg transition-opacity duration-500",
42958
43640
  className
42959
43641
  ),
42960
43642
  children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-3", children: [
42961
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-5 h-5 bg-[#FDD835] rounded-full flex items-center justify-center flex-shrink-0", children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-white text-sm font-bold", children: "!" }) }),
43643
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-5 h-5 bg-primary rounded-full flex items-center justify-center flex-shrink-0", children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-primary-foreground text-sm font-bold", children: "!" }) }),
42962
43644
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1", children: [
42963
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-slate-700 font-semibold text-sm", children: !isOnline ? "No internet connection" : error?.title || "Connecting..." }),
42964
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-slate-500 text-xs mt-1", children: !isOnline ? "Please check your internet connection" : error?.description ?? "Please wait while we try to connect" })
43645
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-text-primary font-semibold text-sm", children: !isOnline ? "No internet connection" : error?.title || "Connecting..." }),
43646
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-text-secondary text-xs mt-1", children: !isOnline ? "Please check your internet connection" : error?.description ?? "Please wait while we try to connect" })
42965
43647
  ] }),
42966
- !isConnected && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-shrink-0", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-6 h-6 border-2 border-[#FDD835] border-t-transparent rounded-full animate-spin" }) })
43648
+ !isConnected && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-shrink-0", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-6 h-6 border-2 border-primary border-t-transparent rounded-full animate-spin" }) })
42967
43649
  ] })
42968
43650
  }
42969
43651
  );