@cas0570/chat-widget 0.0.7 → 0.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ChatWidget.d.ts +1 -1
- package/dist/components/Icons.d.ts +0 -6
- package/dist/components/PopoutWindow.d.ts +1 -1
- package/dist/components/index.d.ts +1 -2
- package/dist/geoapps-chat-widget.js +732 -652
- package/dist/geoapps-chat-widget.umd.cjs +22 -11
- package/dist/hooks/__tests__/useAuth.test.d.ts +1 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/useAuth.d.ts +30 -0
- package/dist/types.d.ts +12 -3
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/token.d.ts +9 -0
- package/package.json +1 -1
|
@@ -1,289 +1,360 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var r=document.createElement("style");r.appendChild(document.createTextNode(':root{--gcw-color-white: #fff;--gcw-color-gray-50: #f9fafb;--gcw-color-gray-100: #f3f4f6;--gcw-color-gray-200: #e5e7eb;--gcw-color-gray-300: #d1d5db;--gcw-color-gray-400: #9ca3af;--gcw-color-gray-500: #6b7280;--gcw-color-gray-600: #4b5563;--gcw-color-gray-700: #374151;--gcw-color-gray-800: #1f2937;--gcw-color-gray-900: #111827;--gcw-color-primary: #3b82f6;--gcw-color-primary-hover: #2563eb;--gcw-color-primary-light: #eff6ff;--gcw-color-error: #ef4444;--gcw-color-success: #22c55e;--gcw-font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;--gcw-font-size-xs: .625rem;--gcw-font-size-sm: .75rem;--gcw-font-size-base: .875rem;--gcw-font-size-lg: 1rem;--gcw-spacing-1: .25rem;--gcw-spacing-2: .5rem;--gcw-spacing-3: .75rem;--gcw-spacing-4: 1rem;--gcw-spacing-6: 1.5rem;--gcw-spacing-8: 2rem;--gcw-spacing-10: 2.5rem;--gcw-spacing-12: 3rem;--gcw-spacing-16: 4rem;--gcw-spacing-20: 5rem;--gcw-radius-sm: .25rem;--gcw-radius-md: .5rem;--gcw-radius-lg: .75rem;--gcw-radius-xl: 1rem;--gcw-radius-2xl: 1.25rem;--gcw-radius-full: 9999px;--gcw-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / .05);--gcw-shadow-md: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--gcw-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--gcw-shadow-xl: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--gcw-shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / .25);--gcw-transition-fast: .15s ease;--gcw-transition-base: .2s ease;--gcw-transition-slow: .3s ease;--gcw-z-widget: 9999}.gcw-widget,.gcw-widget *,.gcw-widget *:before,.gcw-widget *:after{box-sizing:border-box;margin:0;padding:0;font-family:var(--gcw-font-family);line-height:1.5}.gcw-widget{font-family:var(--gcw-font-family);font-size:var(--gcw-font-size-base);line-height:1.5;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;color:var(--gcw-color-gray-800);text-align:left;letter-spacing:normal;word-spacing:normal;text-transform:none;text-indent:0;text-shadow:none;font-weight:400;font-style:normal}.gcw-container{position:fixed;z-index:var(--gcw-z-widget);display:flex;gap:var(--gcw-spacing-4)}.gcw-container--bottom-right{right:var(--gcw-spacing-4);bottom:var(--gcw-spacing-4);flex-direction:column-reverse;align-items:flex-end}.gcw-container--bottom-left{left:var(--gcw-spacing-4);bottom:var(--gcw-spacing-4);flex-direction:column-reverse;align-items:flex-start}.gcw-container--top-right{right:var(--gcw-spacing-4);top:var(--gcw-spacing-4);flex-direction:column;align-items:flex-end}.gcw-container--top-left{left:var(--gcw-spacing-4);top:var(--gcw-spacing-4);flex-direction:column;align-items:flex-start}.gcw-container--custom{flex-direction:column-reverse;align-items:flex-end}.gcw-container--custom.gcw-container--align-left{align-items:flex-start}.gcw-container--custom.gcw-container--flow-down{flex-direction:column}.gcw-toggle{position:relative;width:3.5rem;height:3.5rem;border:none;border-radius:var(--gcw-radius-full);background-color:var(--gcw-color-primary);color:var(--gcw-color-white);cursor:pointer;display:flex;align-items:center;justify-content:center;box-shadow:var(--gcw-shadow-lg);transition:transform var(--gcw-transition-base),box-shadow var(--gcw-transition-base)}.gcw-toggle:hover{transform:scale(1.1);box-shadow:var(--gcw-shadow-xl)}.gcw-toggle:active{transform:scale(.95)}.gcw-toggle__icon{width:1.5rem;height:1.5rem;transition:transform var(--gcw-transition-slow)}.gcw-toggle__badge{position:absolute;top:-.25rem;right:-.25rem;width:1rem;height:1rem;border-radius:var(--gcw-radius-full);display:flex;align-items:center;justify-content:center;font-size:var(--gcw-font-size-xs);font-weight:700;animation:gcw-pulse 2s infinite}.gcw-toggle__badge--unread{background-color:var(--gcw-color-error);color:var(--gcw-color-white)}.gcw-toggle__badge--popout{background-color:var(--gcw-color-success)}.gcw-window{position:relative;display:flex;flex-direction:column;background-color:var(--gcw-color-white);border-radius:var(--gcw-radius-2xl);box-shadow:var(--gcw-shadow-2xl);border:1px solid var(--gcw-color-gray-200);overflow:hidden;animation:gcw-slide-up var(--gcw-transition-slow) ease-out}.gcw-window--small{width:365px;height:450px}.gcw-window--medium{width:380px;height:560px}.gcw-window--large{width:480px;height:680px}.gcw-window--fullscreen{width:calc(100vw - 2rem);height:calc(100vh - 6rem);max-width:56rem}.gcw-window{max-height:90vh;transition:width var(--gcw-transition-base),height var(--gcw-transition-base)}.gcw-header{display:flex;align-items:center;justify-content:space-between;padding:var(--gcw-spacing-3) var(--gcw-spacing-4);color:var(--gcw-color-white);flex-shrink:0}.gcw-header__left{display:flex;align-items:center;gap:var(--gcw-spacing-3)}.gcw-header__avatar{width:2.5rem;height:2.5rem;border-radius:var(--gcw-radius-full);background-color:#fff3;display:flex;align-items:center;justify-content:center}.gcw-header__avatar-icon{width:1.25rem;height:1.25rem}.gcw-header__info{display:flex;flex-direction:column;min-width:0;flex:1}.gcw-header__title{font-size:var(--gcw-font-size-base);font-weight:600;line-height:1.4;margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.gcw-header__subtitle{font-size:var(--gcw-font-size-sm);font-weight:400;line-height:1.4;opacity:.9;margin:0;word-wrap:break-word;overflow-wrap:break-word}.gcw-header__actions{display:flex;align-items:center;gap:.125rem}.gcw-header__btn{width:2rem;height:2rem;border:none;border-radius:var(--gcw-radius-full);background-color:transparent;color:inherit;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:background-color var(--gcw-transition-fast)}.gcw-header__btn:hover{background-color:#fff3}.gcw-header__btn-icon{width:1rem;height:1rem}.gcw-header-menu{position:relative}.gcw-header-menu__dropdown{position:absolute;top:calc(100% + .25rem);right:0;min-width:12rem;background-color:var(--gcw-color-white);border-radius:var(--gcw-radius-lg);box-shadow:var(--gcw-shadow-xl);border:1px solid var(--gcw-color-gray-200);padding:var(--gcw-spacing-1) 0;z-index:10;animation:gcw-menu-appear var(--gcw-transition-fast) ease-out}.gcw-header-menu__item{display:flex;align-items:center;gap:var(--gcw-spacing-3);width:100%;padding:var(--gcw-spacing-2) var(--gcw-spacing-3);border:none;background:none;color:var(--gcw-color-gray-700);font-family:var(--gcw-font-family);font-size:var(--gcw-font-size-sm);cursor:pointer;transition:background-color var(--gcw-transition-fast);text-align:left;white-space:nowrap}.gcw-header-menu__item:hover{background-color:var(--gcw-color-gray-100)}.gcw-header-menu__item--danger{color:var(--gcw-color-error)}.gcw-header-menu__item--danger:hover{background-color:#fef2f2}.gcw-header-menu__icon{width:1rem;height:1rem;flex-shrink:0}.gcw-header-menu__divider{height:1px;background-color:var(--gcw-color-gray-200);margin:var(--gcw-spacing-1) 0}@keyframes gcw-menu-appear{0%{opacity:0;transform:translateY(-.25rem)}to{opacity:1;transform:translateY(0)}}.gcw-messages{flex:1;overflow-y:auto;padding:var(--gcw-spacing-4);display:flex;flex-direction:column;gap:var(--gcw-spacing-4)}.gcw-messages::-webkit-scrollbar{width:6px}.gcw-messages::-webkit-scrollbar-track{background:transparent}.gcw-messages::-webkit-scrollbar-thumb{background-color:var(--gcw-color-gray-300);border-radius:3px}.gcw-messages::-webkit-scrollbar-thumb:hover{background-color:var(--gcw-color-gray-400)}.gcw-empty{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:var(--gcw-spacing-6);color:var(--gcw-color-gray-400);text-align:center}.gcw-empty__icon{width:4rem;height:4rem;margin-bottom:var(--gcw-spacing-4);opacity:.5}.gcw-empty__text{font-size:var(--gcw-font-size-base);font-weight:400;line-height:1.5;margin:0}.gcw-session-loading{display:flex;flex-direction:column;align-items:center;gap:var(--gcw-spacing-3)}.gcw-session-loading__spinner{width:2rem;height:2rem;border:3px solid var(--gcw-color-gray-200);border-top-color:var(--gcw-color-primary);border-radius:50%;animation:gcw-spin .8s linear infinite}@keyframes gcw-spin{to{transform:rotate(360deg)}}.gcw-bubble-row{display:flex}.gcw-bubble-row--user{justify-content:flex-end}.gcw-bubble-row--assistant{justify-content:flex-start}.gcw-bubble-wrapper{max-width:85%;display:flex;flex-direction:column}.gcw-bubble-wrapper--user{align-items:flex-end}.gcw-bubble-wrapper--assistant{align-items:flex-start}.gcw-bubble{padding:var(--gcw-spacing-2) var(--gcw-spacing-4);border-radius:var(--gcw-radius-2xl);font-size:var(--gcw-font-size-base);font-weight:400;line-height:1.6;letter-spacing:normal;word-wrap:break-word}.gcw-bubble--user{color:var(--gcw-color-white);border-bottom-right-radius:var(--gcw-radius-sm)}.gcw-bubble--assistant{background-color:var(--gcw-color-gray-100);color:var(--gcw-color-gray-800);border-bottom-left-radius:var(--gcw-radius-sm)}.gcw-bubble__timestamp{font-size:var(--gcw-font-size-xs);color:var(--gcw-color-gray-400);margin-top:var(--gcw-spacing-1);padding:0 var(--gcw-spacing-1)}.gcw-content p{margin-bottom:var(--gcw-spacing-2)}.gcw-content p:last-child{margin-bottom:0}.gcw-content strong{font-weight:600}.gcw-content em{font-style:italic}.gcw-content ul,.gcw-content ol{margin:var(--gcw-spacing-2) 0;padding-left:var(--gcw-spacing-6)}.gcw-content li{margin-bottom:var(--gcw-spacing-1)}.gcw-content code{background-color:#0000001a;padding:.125rem .375rem;border-radius:var(--gcw-radius-sm);font-size:.875em;font-family:SF Mono,Monaco,Consolas,monospace}.gcw-bubble--user .gcw-content code{background-color:#fff3}.gcw-content pre{background-color:var(--gcw-color-gray-800);color:var(--gcw-color-gray-100);padding:var(--gcw-spacing-3);border-radius:var(--gcw-radius-md);overflow-x:auto;margin:var(--gcw-spacing-2) 0}.gcw-content pre code{background-color:transparent;padding:0;font-size:var(--gcw-font-size-sm)}.gcw-content a{color:var(--gcw-color-primary);text-decoration:underline}.gcw-content a:hover{color:var(--gcw-color-primary-hover)}.gcw-bubble--user .gcw-content a{color:#ffffffe6}.gcw-md-heading{font-weight:600;margin-top:var(--gcw-spacing-3);margin-bottom:var(--gcw-spacing-1)}.gcw-md-heading--h2{font-size:var(--gcw-font-size-lg);font-weight:700}.gcw-md-heading--h3,.gcw-md-heading--h4{font-size:var(--gcw-font-size-base)}.gcw-md-heading--h5{font-size:var(--gcw-font-size-sm)}.gcw-md-paragraph{margin-bottom:var(--gcw-spacing-2)}.gcw-md-paragraph:last-child{margin-bottom:0}.gcw-md-list{margin:var(--gcw-spacing-2) 0;padding-left:var(--gcw-spacing-4)}.gcw-md-list--ul{list-style-type:disc}.gcw-md-list--ol{list-style-type:decimal}.gcw-md-list__item{font-size:var(--gcw-font-size-base);margin-bottom:var(--gcw-spacing-1)}.gcw-md-bold{font-weight:600}.gcw-md-italic{font-style:italic}.gcw-md-code{background-color:var(--gcw-color-gray-200);padding:.125rem var(--gcw-spacing-2);border-radius:var(--gcw-radius-sm);font-size:var(--gcw-font-size-sm);font-family:SF Mono,Monaco,Consolas,monospace}.gcw-bubble--user .gcw-md-code{background-color:#fff3}.gcw-md-code-block{background-color:var(--gcw-color-gray-800);color:var(--gcw-color-gray-100);padding:var(--gcw-spacing-3);border-radius:var(--gcw-radius-lg);font-size:var(--gcw-font-size-sm);overflow-x:auto;margin:var(--gcw-spacing-2) 0}.gcw-md-code-block code{font-family:SF Mono,Monaco,Consolas,monospace}.gcw-md-link{color:var(--gcw-color-primary);text-decoration:underline}.gcw-md-link:hover{color:var(--gcw-color-primary-hover)}.gcw-bubble--user .gcw-md-link{color:#ffffffe6}.gcw-sources{display:flex;flex-wrap:wrap;gap:var(--gcw-spacing-2);margin-top:var(--gcw-spacing-2)}.gcw-source{display:inline-flex;align-items:center;gap:var(--gcw-spacing-1);padding:var(--gcw-spacing-1) var(--gcw-spacing-2);border-radius:var(--gcw-radius-full);background-color:var(--gcw-color-primary-light);color:var(--gcw-color-primary);font-size:var(--gcw-font-size-sm);text-decoration:none;transition:background-color var(--gcw-transition-fast)}.gcw-source:hover{background-color:#dbeafe}.gcw-source__icon{width:.75rem;height:.75rem}.gcw-typing{display:flex;justify-content:flex-start}.gcw-typing__bubble{background-color:var(--gcw-color-gray-100);padding:var(--gcw-spacing-3) var(--gcw-spacing-4);border-radius:var(--gcw-radius-2xl);border-bottom-left-radius:var(--gcw-radius-sm)}.gcw-typing__dots{display:flex;gap:var(--gcw-spacing-1)}.gcw-typing__dot{width:.5rem;height:.5rem;background-color:var(--gcw-color-gray-400);border-radius:var(--gcw-radius-full);animation:gcw-typing-bounce 1.4s infinite ease-in-out both}.gcw-typing__dot:nth-child(1){animation-delay:-.32s}.gcw-typing__dot:nth-child(2){animation-delay:-.16s}.gcw-input-area{padding:var(--gcw-spacing-3);border-top:1px solid var(--gcw-color-gray-200);background-color:var(--gcw-color-white);flex-shrink:0}.gcw-input-row{display:flex;align-items:flex-end;gap:var(--gcw-spacing-2)}.gcw-input{flex:1;min-height:44px;max-height:120px;padding:var(--gcw-spacing-2) var(--gcw-spacing-4);border:1px solid var(--gcw-color-gray-200);border-radius:var(--gcw-radius-xl);background-color:var(--gcw-color-white);color:var(--gcw-color-gray-800);font-family:var(--gcw-font-family);font-size:var(--gcw-font-size-base);font-weight:400;line-height:1.5;letter-spacing:normal;resize:none;outline:none;transition:border-color var(--gcw-transition-fast),box-shadow var(--gcw-transition-fast)}.gcw-input:focus{border-color:var(--gcw-color-primary);box-shadow:0 0 0 3px #3b82f61a}.gcw-input:disabled{background-color:var(--gcw-color-gray-50);cursor:not-allowed}.gcw-input::placeholder{color:var(--gcw-color-gray-400)}.gcw-send-btn{width:2.5rem;height:2.5rem;flex-shrink:0;border:none;border-radius:var(--gcw-radius-lg);color:var(--gcw-color-white);cursor:pointer;display:flex;align-items:center;justify-content:center;transition:opacity var(--gcw-transition-fast),transform var(--gcw-transition-fast)}.gcw-send-btn:hover:not(:disabled){opacity:.9}.gcw-send-btn:active:not(:disabled){transform:scale(.95)}.gcw-send-btn:disabled{opacity:.5;cursor:not-allowed}.gcw-send-btn__icon{width:1.25rem;height:1.25rem}.gcw-input-hint{font-size:var(--gcw-font-size-xs);color:var(--gcw-color-gray-400);text-align:center;margin-top:var(--gcw-spacing-2)}@keyframes gcw-slide-up{0%{opacity:0;transform:translateY(1rem)}to{opacity:1;transform:translateY(0)}}@keyframes gcw-pulse{0%,to{opacity:1}50%{opacity:.5}}@keyframes gcw-typing-bounce{0%,80%,to{transform:scale(0)}40%{transform:scale(1)}}@keyframes gcw-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.gcw-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.gcw-spin{animation:gcw-spin 1s linear infinite}.gcw-history{display:flex;flex-direction:column;flex:1;overflow:hidden;animation:gcw-slide-in-left var(--gcw-transition-base) ease-out}.gcw-history__header{display:flex;align-items:center;gap:var(--gcw-spacing-3);padding:var(--gcw-spacing-2) var(--gcw-spacing-3);color:var(--gcw-color-white);flex-shrink:0}.gcw-history__title{flex:1;font-size:var(--gcw-font-size-base);font-weight:600;margin:0}.gcw-history__list{flex:1;overflow-y:auto;padding:var(--gcw-spacing-2) 0}.gcw-history__list::-webkit-scrollbar{width:6px}.gcw-history__list::-webkit-scrollbar-track{background:transparent}.gcw-history__list::-webkit-scrollbar-thumb{background-color:var(--gcw-color-gray-300);border-radius:3px}.gcw-history__loading{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--gcw-spacing-3);padding:var(--gcw-spacing-8);color:var(--gcw-color-gray-400);font-size:var(--gcw-font-size-sm)}.gcw-history__empty{display:flex;align-items:center;justify-content:center;padding:var(--gcw-spacing-8);color:var(--gcw-color-gray-400);font-size:var(--gcw-font-size-sm)}.gcw-history__item{display:flex;align-items:center;justify-content:space-between;gap:var(--gcw-spacing-2);width:100%;padding:var(--gcw-spacing-3) var(--gcw-spacing-4);border:none;border-left:3px solid transparent;background:none;cursor:pointer;text-align:left;transition:background-color var(--gcw-transition-fast);font-family:var(--gcw-font-family)}.gcw-history__item:hover{background-color:var(--gcw-color-gray-50)}.gcw-history__item--active{background-color:var(--gcw-color-primary-light)}.gcw-history__item-content{display:flex;flex-direction:column;gap:.125rem;min-width:0;flex:1}.gcw-history__item-title{font-size:var(--gcw-font-size-sm);font-weight:500;color:var(--gcw-color-gray-800);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.gcw-history__item-meta{font-size:var(--gcw-font-size-xs);color:var(--gcw-color-gray-400)}.gcw-history__item-delete{flex-shrink:0;width:1.75rem;height:1.75rem;border:none;border-radius:var(--gcw-radius-md);background:transparent;color:var(--gcw-color-gray-300);cursor:pointer;display:flex;align-items:center;justify-content:center;opacity:0;transition:opacity var(--gcw-transition-fast),color var(--gcw-transition-fast),background-color var(--gcw-transition-fast)}.gcw-history__item:hover .gcw-history__item-delete{opacity:1}.gcw-history__item-delete:hover{color:var(--gcw-color-error);background-color:#ef44441a}.gcw-history__item-delete-icon{width:.875rem;height:.875rem}@keyframes gcw-slide-in-left{0%{opacity:0;transform:translate(-1rem)}to{opacity:1;transform:translate(0)}}.gcw-modal-overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:#0006;display:flex;align-items:center;justify-content:center;z-index:100;animation:gcw-fade-in .15s ease-out;border-radius:var(--gcw-radius-2xl)}.gcw-modal{background:#fff;border-radius:.75rem;padding:1.25rem;margin:1rem;max-width:20rem;width:100%;box-shadow:0 8px 24px #00000026;animation:gcw-scale-in .15s ease-out}.gcw-modal__title{font-size:.9375rem;font-weight:600;color:#1f2937;margin:0 0 .5rem}.gcw-modal__message{font-size:.8125rem;color:#6b7280;line-height:1.5;margin:0 0 1.25rem}.gcw-modal__actions{display:flex;gap:.5rem;justify-content:flex-end}.gcw-modal__btn{padding:.4375rem .875rem;border-radius:.375rem;font-size:.8125rem;font-weight:500;cursor:pointer;border:1px solid #e5e7eb;transition:background-color .15s,border-color .15s}.gcw-modal__btn--cancel{background:#fff;color:#374151}.gcw-modal__btn--cancel:hover{background:#f9fafb;border-color:#d1d5db}.gcw-modal__btn--confirm{background:#3b82f6;color:#fff;border-color:#3b82f6}.gcw-modal__btn--confirm:hover{background:#2563eb;border-color:#2563eb}.gcw-modal__btn--danger{background:#ef4444;border-color:#ef4444}.gcw-modal__btn--danger:hover{background:#dc2626;border-color:#dc2626}@keyframes gcw-fade-in{0%{opacity:0}to{opacity:1}}@keyframes gcw-scale-in{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}')),document.head.appendChild(r)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import
|
|
4
|
-
const
|
|
5
|
-
function
|
|
6
|
-
return `${
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var r=document.createElement("style");r.appendChild(document.createTextNode(':root{--gcw-color-white: #fff;--gcw-color-gray-50: #f9fafb;--gcw-color-gray-100: #f3f4f6;--gcw-color-gray-200: #e5e7eb;--gcw-color-gray-300: #d1d5db;--gcw-color-gray-400: #9ca3af;--gcw-color-gray-500: #6b7280;--gcw-color-gray-600: #4b5563;--gcw-color-gray-700: #374151;--gcw-color-gray-800: #1f2937;--gcw-color-gray-900: #111827;--gcw-color-primary: #3b82f6;--gcw-color-primary-hover: #2563eb;--gcw-color-primary-light: #eff6ff;--gcw-color-error: #ef4444;--gcw-color-success: #22c55e;--gcw-font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;--gcw-font-size-xs: .625rem;--gcw-font-size-sm: .75rem;--gcw-font-size-base: .875rem;--gcw-font-size-lg: 1rem;--gcw-spacing-1: .25rem;--gcw-spacing-2: .5rem;--gcw-spacing-3: .75rem;--gcw-spacing-4: 1rem;--gcw-spacing-6: 1.5rem;--gcw-spacing-8: 2rem;--gcw-spacing-10: 2.5rem;--gcw-spacing-12: 3rem;--gcw-spacing-16: 4rem;--gcw-spacing-20: 5rem;--gcw-radius-sm: .25rem;--gcw-radius-md: .5rem;--gcw-radius-lg: .75rem;--gcw-radius-xl: 1rem;--gcw-radius-2xl: 1.25rem;--gcw-radius-full: 9999px;--gcw-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / .05);--gcw-shadow-md: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--gcw-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--gcw-shadow-xl: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--gcw-shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / .25);--gcw-transition-fast: .15s ease;--gcw-transition-base: .2s ease;--gcw-transition-slow: .3s ease;--gcw-z-widget: 9999}.gcw-widget,.gcw-widget *,.gcw-widget *:before,.gcw-widget *:after{box-sizing:border-box;margin:0;padding:0;font-family:var(--gcw-font-family);line-height:1.5}.gcw-widget{font-family:var(--gcw-font-family);font-size:var(--gcw-font-size-base);line-height:1.5;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;color:var(--gcw-color-gray-800);text-align:left;letter-spacing:normal;word-spacing:normal;text-transform:none;text-indent:0;text-shadow:none;font-weight:400;font-style:normal}.gcw-container{position:fixed;z-index:var(--gcw-z-widget);display:flex;gap:var(--gcw-spacing-4)}.gcw-container--bottom-right{right:var(--gcw-spacing-4);bottom:var(--gcw-spacing-4);flex-direction:column-reverse;align-items:flex-end}.gcw-container--bottom-left{left:var(--gcw-spacing-4);bottom:var(--gcw-spacing-4);flex-direction:column-reverse;align-items:flex-start}.gcw-container--top-right{right:var(--gcw-spacing-4);top:var(--gcw-spacing-4);flex-direction:column;align-items:flex-end}.gcw-container--top-left{left:var(--gcw-spacing-4);top:var(--gcw-spacing-4);flex-direction:column;align-items:flex-start}.gcw-container--custom{flex-direction:column-reverse;align-items:flex-end}.gcw-container--custom.gcw-container--align-left{align-items:flex-start}.gcw-container--custom.gcw-container--flow-down{flex-direction:column}.gcw-toggle{position:relative;width:3.5rem;height:3.5rem;border:none;border-radius:var(--gcw-radius-full);background-color:var(--gcw-color-primary);color:var(--gcw-color-white);cursor:pointer;display:flex;align-items:center;justify-content:center;box-shadow:var(--gcw-shadow-lg);transition:transform var(--gcw-transition-base),box-shadow var(--gcw-transition-base)}.gcw-toggle:hover{transform:scale(1.1);box-shadow:var(--gcw-shadow-xl)}.gcw-toggle:active{transform:scale(.95)}.gcw-toggle__icon{width:1.5rem;height:1.5rem;transition:transform var(--gcw-transition-slow)}.gcw-toggle__badge{position:absolute;top:-.25rem;right:-.25rem;width:1rem;height:1rem;border-radius:var(--gcw-radius-full);display:flex;align-items:center;justify-content:center;font-size:var(--gcw-font-size-xs);font-weight:700;animation:gcw-pulse 2s infinite}.gcw-toggle__badge--unread{background-color:var(--gcw-color-error);color:var(--gcw-color-white)}.gcw-toggle__badge--popout{background-color:var(--gcw-color-success)}.gcw-window{position:relative;display:flex;flex-direction:column;background-color:var(--gcw-color-white);border-radius:var(--gcw-radius-2xl);box-shadow:var(--gcw-shadow-2xl);border:1px solid var(--gcw-color-gray-200);overflow:hidden;animation:gcw-slide-up var(--gcw-transition-slow) ease-out}.gcw-window--small{width:365px;height:450px}.gcw-window--medium{width:380px;height:560px}.gcw-window--large{width:480px;height:680px}.gcw-window--fullscreen{width:calc(100vw - 2rem);height:calc(100vh - 6rem);max-width:56rem}.gcw-window{max-height:90vh;transition:width var(--gcw-transition-base),height var(--gcw-transition-base)}.gcw-header{display:flex;align-items:center;justify-content:space-between;padding:var(--gcw-spacing-3) var(--gcw-spacing-4);color:var(--gcw-color-white);flex-shrink:0}.gcw-header__left{display:flex;align-items:center;gap:var(--gcw-spacing-3)}.gcw-header__avatar{width:2.5rem;height:2.5rem;border-radius:var(--gcw-radius-full);background-color:#fff3;display:flex;align-items:center;justify-content:center}.gcw-header__avatar-icon{width:1.25rem;height:1.25rem}.gcw-header__info{display:flex;flex-direction:column;min-width:0;flex:1}.gcw-header__title{font-size:var(--gcw-font-size-base);font-weight:600;line-height:1.4;margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.gcw-header__subtitle{font-size:var(--gcw-font-size-sm);font-weight:400;line-height:1.4;opacity:.9;margin:0;word-wrap:break-word;overflow-wrap:break-word}.gcw-header__actions{display:flex;align-items:center;gap:.125rem}.gcw-header__btn{width:2rem;height:2rem;border:none;border-radius:var(--gcw-radius-full);background-color:transparent;color:inherit;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:background-color var(--gcw-transition-fast)}.gcw-header__btn:hover{background-color:#fff3}.gcw-header__btn-icon{width:1rem;height:1rem}.gcw-header-menu{position:relative}.gcw-header-menu__dropdown{position:absolute;top:calc(100% + .25rem);right:0;min-width:12rem;background-color:var(--gcw-color-white);border-radius:var(--gcw-radius-lg);box-shadow:var(--gcw-shadow-xl);border:1px solid var(--gcw-color-gray-200);padding:var(--gcw-spacing-1) 0;z-index:10;animation:gcw-menu-appear var(--gcw-transition-fast) ease-out}.gcw-header-menu__item{display:flex;align-items:center;gap:var(--gcw-spacing-3);width:100%;padding:var(--gcw-spacing-2) var(--gcw-spacing-3);border:none;background:none;color:var(--gcw-color-gray-700);font-family:var(--gcw-font-family);font-size:var(--gcw-font-size-sm);cursor:pointer;transition:background-color var(--gcw-transition-fast);text-align:left;white-space:nowrap}.gcw-header-menu__item:hover{background-color:var(--gcw-color-gray-100)}.gcw-header-menu__item--danger{color:var(--gcw-color-error)}.gcw-header-menu__item--danger:hover{background-color:#fef2f2}.gcw-header-menu__icon{width:1rem;height:1rem;flex-shrink:0}.gcw-header-menu__divider{height:1px;background-color:var(--gcw-color-gray-200);margin:var(--gcw-spacing-1) 0}@keyframes gcw-menu-appear{0%{opacity:0;transform:translateY(-.25rem)}to{opacity:1;transform:translateY(0)}}.gcw-messages{flex:1;overflow-y:auto;padding:var(--gcw-spacing-4);display:flex;flex-direction:column;gap:var(--gcw-spacing-4)}.gcw-messages::-webkit-scrollbar{width:6px}.gcw-messages::-webkit-scrollbar-track{background:transparent}.gcw-messages::-webkit-scrollbar-thumb{background-color:var(--gcw-color-gray-300);border-radius:3px}.gcw-messages::-webkit-scrollbar-thumb:hover{background-color:var(--gcw-color-gray-400)}.gcw-empty{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:var(--gcw-spacing-6);color:var(--gcw-color-gray-400);text-align:center}.gcw-empty__icon{width:4rem;height:4rem;margin-bottom:var(--gcw-spacing-4);opacity:.5}.gcw-empty__text{font-size:var(--gcw-font-size-base);font-weight:400;line-height:1.5;margin:0}.gcw-session-loading{display:flex;flex-direction:column;align-items:center;gap:var(--gcw-spacing-3)}.gcw-session-loading__spinner{width:2rem;height:2rem;border:3px solid var(--gcw-color-gray-200);border-top-color:var(--gcw-color-primary);border-radius:50%;animation:gcw-spin .8s linear infinite}.gcw-bubble-row{display:flex}.gcw-bubble-row--user{justify-content:flex-end}.gcw-bubble-row--assistant{justify-content:flex-start}.gcw-bubble-wrapper{max-width:85%;display:flex;flex-direction:column}.gcw-bubble-wrapper--user{align-items:flex-end}.gcw-bubble-wrapper--assistant{align-items:flex-start}.gcw-bubble{padding:var(--gcw-spacing-2) var(--gcw-spacing-4);border-radius:var(--gcw-radius-2xl);font-size:var(--gcw-font-size-base);font-weight:400;line-height:1.6;letter-spacing:normal;word-wrap:break-word}.gcw-bubble--user{color:var(--gcw-color-white);border-bottom-right-radius:var(--gcw-radius-sm)}.gcw-bubble--assistant{background-color:var(--gcw-color-gray-100);color:var(--gcw-color-gray-800);border-bottom-left-radius:var(--gcw-radius-sm)}.gcw-bubble__timestamp{font-size:var(--gcw-font-size-xs);color:var(--gcw-color-gray-400);margin-top:var(--gcw-spacing-1);padding:0 var(--gcw-spacing-1)}.gcw-content p{margin-bottom:var(--gcw-spacing-2)}.gcw-content p:last-child{margin-bottom:0}.gcw-content strong{font-weight:600}.gcw-content em{font-style:italic}.gcw-content ul,.gcw-content ol{margin:var(--gcw-spacing-2) 0;padding-left:var(--gcw-spacing-6)}.gcw-content li{margin-bottom:var(--gcw-spacing-1)}.gcw-content code{background-color:#0000001a;padding:.125rem .375rem;border-radius:var(--gcw-radius-sm);font-size:.875em;font-family:SF Mono,Monaco,Consolas,monospace}.gcw-bubble--user .gcw-content code{background-color:#fff3}.gcw-content pre{background-color:var(--gcw-color-gray-800);color:var(--gcw-color-gray-100);padding:var(--gcw-spacing-3);border-radius:var(--gcw-radius-md);overflow-x:auto;margin:var(--gcw-spacing-2) 0}.gcw-content pre code{background-color:transparent;padding:0;font-size:var(--gcw-font-size-sm)}.gcw-content a{color:var(--gcw-color-primary);text-decoration:underline}.gcw-content a:hover{color:var(--gcw-color-primary-hover)}.gcw-bubble--user .gcw-content a{color:#ffffffe6}.gcw-md-heading{font-weight:600;margin-top:var(--gcw-spacing-3);margin-bottom:var(--gcw-spacing-1)}.gcw-md-heading--h2{font-size:var(--gcw-font-size-lg);font-weight:700}.gcw-md-heading--h3,.gcw-md-heading--h4{font-size:var(--gcw-font-size-base)}.gcw-md-heading--h5{font-size:var(--gcw-font-size-sm)}.gcw-md-paragraph{margin-bottom:var(--gcw-spacing-2)}.gcw-md-paragraph:last-child{margin-bottom:0}.gcw-md-list{margin:var(--gcw-spacing-2) 0;padding-left:var(--gcw-spacing-4)}.gcw-md-list--ul{list-style-type:disc}.gcw-md-list--ol{list-style-type:decimal}.gcw-md-list__item{font-size:var(--gcw-font-size-base);margin-bottom:var(--gcw-spacing-1)}.gcw-md-bold{font-weight:600}.gcw-md-italic{font-style:italic}.gcw-md-code{background-color:var(--gcw-color-gray-200);padding:.125rem var(--gcw-spacing-2);border-radius:var(--gcw-radius-sm);font-size:var(--gcw-font-size-sm);font-family:SF Mono,Monaco,Consolas,monospace}.gcw-bubble--user .gcw-md-code{background-color:#fff3}.gcw-md-code-block{background-color:var(--gcw-color-gray-800);color:var(--gcw-color-gray-100);padding:var(--gcw-spacing-3);border-radius:var(--gcw-radius-lg);font-size:var(--gcw-font-size-sm);overflow-x:auto;margin:var(--gcw-spacing-2) 0}.gcw-md-code-block code{font-family:SF Mono,Monaco,Consolas,monospace}.gcw-md-link{color:var(--gcw-color-primary);text-decoration:underline}.gcw-md-link:hover{color:var(--gcw-color-primary-hover)}.gcw-bubble--user .gcw-md-link{color:#ffffffe6}.gcw-sources{display:flex;flex-wrap:wrap;gap:var(--gcw-spacing-2);margin-top:var(--gcw-spacing-2)}.gcw-source{display:inline-flex;align-items:center;gap:var(--gcw-spacing-1);padding:var(--gcw-spacing-1) var(--gcw-spacing-2);border-radius:var(--gcw-radius-full);background-color:var(--gcw-color-primary-light);color:var(--gcw-color-primary);font-size:var(--gcw-font-size-sm);text-decoration:none;transition:background-color var(--gcw-transition-fast)}.gcw-source:hover{background-color:#dbeafe}.gcw-source__icon{width:.75rem;height:.75rem}.gcw-typing{display:flex;justify-content:flex-start}.gcw-typing__bubble{background-color:var(--gcw-color-gray-100);padding:var(--gcw-spacing-3) var(--gcw-spacing-4);border-radius:var(--gcw-radius-2xl);border-bottom-left-radius:var(--gcw-radius-sm)}.gcw-typing__dots{display:flex;gap:var(--gcw-spacing-1)}.gcw-typing__dot{width:.5rem;height:.5rem;background-color:var(--gcw-color-gray-400);border-radius:var(--gcw-radius-full);animation:gcw-typing-bounce 1.4s infinite ease-in-out both}.gcw-typing__dot:nth-child(1){animation-delay:-.32s}.gcw-typing__dot:nth-child(2){animation-delay:-.16s}.gcw-input-area{padding:var(--gcw-spacing-3);border-top:1px solid var(--gcw-color-gray-200);background-color:var(--gcw-color-white);flex-shrink:0}.gcw-input-row{display:flex;align-items:flex-end;gap:var(--gcw-spacing-2)}.gcw-input{flex:1;min-height:44px;max-height:120px;padding:var(--gcw-spacing-2) var(--gcw-spacing-4);border:1px solid var(--gcw-color-gray-200);border-radius:var(--gcw-radius-xl);background-color:var(--gcw-color-white);color:var(--gcw-color-gray-800);font-family:var(--gcw-font-family);font-size:var(--gcw-font-size-base);font-weight:400;line-height:1.5;letter-spacing:normal;resize:none;outline:none;transition:border-color var(--gcw-transition-fast),box-shadow var(--gcw-transition-fast)}.gcw-input:focus{border-color:var(--gcw-color-primary);box-shadow:0 0 0 3px #3b82f61a}.gcw-input:disabled{background-color:var(--gcw-color-gray-50);cursor:not-allowed}.gcw-input::placeholder{color:var(--gcw-color-gray-400)}.gcw-send-btn{width:2.5rem;height:2.5rem;flex-shrink:0;border:none;border-radius:var(--gcw-radius-lg);color:var(--gcw-color-white);cursor:pointer;display:flex;align-items:center;justify-content:center;transition:opacity var(--gcw-transition-fast),transform var(--gcw-transition-fast)}.gcw-send-btn:hover:not(:disabled){opacity:.9}.gcw-send-btn:active:not(:disabled){transform:scale(.95)}.gcw-send-btn:disabled{opacity:.5;cursor:not-allowed}.gcw-send-btn__icon{width:1.25rem;height:1.25rem}.gcw-input-hint{font-size:var(--gcw-font-size-xs);color:var(--gcw-color-gray-400);text-align:center;margin-top:var(--gcw-spacing-2)}@keyframes gcw-slide-up{0%{opacity:0;transform:translateY(1rem)}to{opacity:1;transform:translateY(0)}}@keyframes gcw-pulse{0%,to{opacity:1}50%{opacity:.5}}@keyframes gcw-typing-bounce{0%,80%,to{transform:scale(0)}40%{transform:scale(1)}}@keyframes gcw-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.gcw-spin{animation:gcw-spin 1s linear infinite}.gcw-history{display:flex;flex-direction:column;flex:1;overflow:hidden;animation:gcw-slide-in-left var(--gcw-transition-base) ease-out}.gcw-history__header{display:flex;align-items:center;gap:var(--gcw-spacing-3);padding:var(--gcw-spacing-2) var(--gcw-spacing-3);color:var(--gcw-color-white);flex-shrink:0}.gcw-history__title{flex:1;font-size:var(--gcw-font-size-base);font-weight:600;margin:0}.gcw-history__list{flex:1;overflow-y:auto;padding:var(--gcw-spacing-2) 0}.gcw-history__list::-webkit-scrollbar{width:6px}.gcw-history__list::-webkit-scrollbar-track{background:transparent}.gcw-history__list::-webkit-scrollbar-thumb{background-color:var(--gcw-color-gray-300);border-radius:3px}.gcw-history__loading{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--gcw-spacing-3);padding:var(--gcw-spacing-8);color:var(--gcw-color-gray-400);font-size:var(--gcw-font-size-sm)}.gcw-history__empty{display:flex;align-items:center;justify-content:center;padding:var(--gcw-spacing-8);color:var(--gcw-color-gray-400);font-size:var(--gcw-font-size-sm)}.gcw-history__item{display:flex;align-items:center;justify-content:space-between;gap:var(--gcw-spacing-2);width:100%;padding:var(--gcw-spacing-3) var(--gcw-spacing-4);border:none;border-left:3px solid transparent;background:none;cursor:pointer;text-align:left;transition:background-color var(--gcw-transition-fast);font-family:var(--gcw-font-family)}.gcw-history__item:hover{background-color:var(--gcw-color-gray-50)}.gcw-history__item--active{background-color:var(--gcw-color-primary-light)}.gcw-history__item-content{display:flex;flex-direction:column;gap:.125rem;min-width:0;flex:1}.gcw-history__item-title{font-size:var(--gcw-font-size-sm);font-weight:500;color:var(--gcw-color-gray-800);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.gcw-history__item-meta{font-size:var(--gcw-font-size-xs);color:var(--gcw-color-gray-400)}.gcw-history__item-delete{flex-shrink:0;width:1.75rem;height:1.75rem;border:none;border-radius:var(--gcw-radius-md);background:transparent;color:var(--gcw-color-gray-300);cursor:pointer;display:flex;align-items:center;justify-content:center;opacity:0;transition:opacity var(--gcw-transition-fast),color var(--gcw-transition-fast),background-color var(--gcw-transition-fast)}.gcw-history__item:hover .gcw-history__item-delete{opacity:1}.gcw-history__item-delete:hover{color:var(--gcw-color-error);background-color:#ef44441a}.gcw-history__item-delete-icon{width:.875rem;height:.875rem}@keyframes gcw-slide-in-left{0%{opacity:0;transform:translate(-1rem)}to{opacity:1;transform:translate(0)}}.gcw-modal-overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:#0006;display:flex;align-items:center;justify-content:center;z-index:100;animation:gcw-fade-in .15s ease-out;border-radius:var(--gcw-radius-2xl)}.gcw-modal{background:#fff;border-radius:.75rem;padding:1.25rem;margin:1rem;max-width:20rem;width:100%;box-shadow:0 8px 24px #00000026;animation:gcw-scale-in .15s ease-out}.gcw-modal__title{font-size:.9375rem;font-weight:600;color:#1f2937;margin:0 0 .5rem}.gcw-modal__message{font-size:.8125rem;color:#6b7280;line-height:1.5;margin:0 0 1.25rem}.gcw-modal__actions{display:flex;gap:.5rem;justify-content:flex-end}.gcw-modal__btn{padding:.4375rem .875rem;border-radius:.375rem;font-size:.8125rem;font-weight:500;cursor:pointer;border:1px solid #e5e7eb;transition:background-color .15s,border-color .15s}.gcw-modal__btn--cancel{background:#fff;color:#374151}.gcw-modal__btn--cancel:hover{background:#f9fafb;border-color:#d1d5db}.gcw-modal__btn--confirm{background:#3b82f6;color:#fff;border-color:#3b82f6}.gcw-modal__btn--confirm:hover{background:#2563eb;border-color:#2563eb}.gcw-modal__btn--danger{background:#ef4444;border-color:#ef4444}.gcw-modal__btn--danger:hover{background:#dc2626;border-color:#dc2626}@keyframes gcw-fade-in{0%{opacity:0}to{opacity:1}}@keyframes gcw-scale-in{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}')),document.head.appendChild(r)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
|
|
2
|
+
import { jsxs as u, jsx as n, Fragment as ke } from "react/jsx-runtime";
|
|
3
|
+
import _e, { useState as v, useCallback as L, useEffect as M, useRef as O } from "react";
|
|
4
|
+
const xe = "gcw_session_", Ne = "gcw_popout_", Se = "gcw_read_";
|
|
5
|
+
function ee(e) {
|
|
6
|
+
return `${xe}${e || "default"}`;
|
|
7
7
|
}
|
|
8
|
-
function
|
|
8
|
+
function Me(e, s) {
|
|
9
9
|
try {
|
|
10
|
-
const
|
|
11
|
-
e ? localStorage.setItem(
|
|
12
|
-
} catch (
|
|
13
|
-
console.warn("Failed to save session ID:",
|
|
10
|
+
const t = ee(s);
|
|
11
|
+
e ? localStorage.setItem(t, e) : localStorage.removeItem(t);
|
|
12
|
+
} catch (t) {
|
|
13
|
+
console.warn("Failed to save session ID:", t);
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
|
-
function
|
|
16
|
+
function Ie(e) {
|
|
17
17
|
try {
|
|
18
|
-
return localStorage.getItem(
|
|
18
|
+
return localStorage.getItem(ee(e));
|
|
19
19
|
} catch {
|
|
20
20
|
return null;
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
-
function
|
|
23
|
+
function P(e) {
|
|
24
24
|
try {
|
|
25
|
-
localStorage.removeItem(
|
|
25
|
+
localStorage.removeItem(ee(e)), localStorage.removeItem(Q(e));
|
|
26
26
|
} catch (s) {
|
|
27
27
|
console.warn("Failed to clear session:", s);
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
|
-
function
|
|
31
|
-
const
|
|
32
|
-
i.key ===
|
|
30
|
+
function Ce(e, s) {
|
|
31
|
+
const t = ee(e), a = (i) => {
|
|
32
|
+
i.key === t && s(i.newValue);
|
|
33
33
|
};
|
|
34
34
|
return window.addEventListener("storage", a), () => window.removeEventListener("storage", a);
|
|
35
35
|
}
|
|
36
|
-
function
|
|
37
|
-
return `${
|
|
36
|
+
function oe(e) {
|
|
37
|
+
return `${Ne}${e || "default"}`;
|
|
38
38
|
}
|
|
39
|
-
function
|
|
39
|
+
function Y(e, s) {
|
|
40
40
|
try {
|
|
41
|
-
e ? localStorage.setItem(
|
|
42
|
-
} catch (
|
|
43
|
-
console.warn("Failed to save popout state:",
|
|
41
|
+
e ? localStorage.setItem(oe(s), "true") : localStorage.removeItem(oe(s));
|
|
42
|
+
} catch (t) {
|
|
43
|
+
console.warn("Failed to save popout state:", t);
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
-
function
|
|
46
|
+
function Le(e) {
|
|
47
47
|
try {
|
|
48
|
-
return localStorage.getItem(
|
|
48
|
+
return localStorage.getItem(oe(e)) === "true";
|
|
49
49
|
} catch {
|
|
50
50
|
return !1;
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
|
-
function
|
|
54
|
-
return `${
|
|
53
|
+
function Q(e) {
|
|
54
|
+
return `${Se}${e || "default"}`;
|
|
55
55
|
}
|
|
56
|
-
function
|
|
56
|
+
function q(e, s) {
|
|
57
57
|
try {
|
|
58
|
-
e > 0 ? localStorage.setItem(
|
|
59
|
-
} catch (
|
|
60
|
-
console.warn("Failed to save read state:",
|
|
58
|
+
e > 0 ? localStorage.setItem(Q(s), String(e)) : localStorage.removeItem(Q(s));
|
|
59
|
+
} catch (t) {
|
|
60
|
+
console.warn("Failed to save read state:", t);
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
|
-
function
|
|
63
|
+
function Ee(e) {
|
|
64
64
|
try {
|
|
65
|
-
const s = localStorage.getItem(
|
|
65
|
+
const s = localStorage.getItem(Q(e));
|
|
66
66
|
return s && parseInt(s, 10) || 0;
|
|
67
67
|
} catch {
|
|
68
68
|
return 0;
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
|
-
function
|
|
72
|
-
|
|
73
|
-
|
|
71
|
+
function U(e) {
|
|
72
|
+
if (!e)
|
|
73
|
+
return console.log("test"), {};
|
|
74
|
+
try {
|
|
75
|
+
const s = sessionStorage.getItem(e);
|
|
76
|
+
if (console.log("raw", s), !s) return {};
|
|
77
|
+
const t = JSON.parse(s);
|
|
78
|
+
if (console.log("token", t), t != null && t.access_token)
|
|
79
|
+
return { Authorization: `Bearer ${t.access_token}` };
|
|
80
|
+
console.log("No access_token found in token object");
|
|
81
|
+
} catch {
|
|
82
|
+
}
|
|
83
|
+
return {};
|
|
84
|
+
}
|
|
85
|
+
const se = /* @__PURE__ */ new Map();
|
|
86
|
+
function Te(e) {
|
|
87
|
+
return {
|
|
88
|
+
id: e.Id ?? e.id ?? "",
|
|
89
|
+
email: e.Email ?? e.email ?? "",
|
|
90
|
+
fullName: e.FullName ?? e.fullName ?? "",
|
|
91
|
+
roles: Array.isArray(e.Roles ?? e.roles) ? (e.Roles ?? e.roles).map(
|
|
92
|
+
(s) => typeof s == "string" ? s : s.name ?? ""
|
|
93
|
+
) : []
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
function $e(e, s) {
|
|
97
|
+
const t = se.get(e);
|
|
98
|
+
if (t) return t;
|
|
99
|
+
const a = (async () => {
|
|
74
100
|
try {
|
|
75
|
-
const
|
|
101
|
+
const i = await fetch(e, {
|
|
102
|
+
method: "GET",
|
|
103
|
+
headers: {
|
|
104
|
+
Accept: "application/json",
|
|
105
|
+
...U(s)
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
if (i.ok) {
|
|
109
|
+
const r = await i.json();
|
|
110
|
+
return { ok: !0, user: Te(r), error: null };
|
|
111
|
+
}
|
|
112
|
+
return {
|
|
113
|
+
ok: !1,
|
|
114
|
+
user: null,
|
|
115
|
+
error: i.status === 401 ? "Niet ingelogd" : "Geen toegang"
|
|
116
|
+
};
|
|
117
|
+
} catch {
|
|
118
|
+
return { ok: !1, user: null, error: "Authenticatie verificatie mislukt" };
|
|
119
|
+
}
|
|
120
|
+
})();
|
|
121
|
+
return se.set(e, a), a.finally(() => se.delete(e)), a;
|
|
122
|
+
}
|
|
123
|
+
function je({ authUrl: e, tokenStorageKey: s }) {
|
|
124
|
+
const [t, a] = v(!e), [i, r] = v(!!e), [o, m] = v(null), [c, l] = v(null), d = L((f) => {
|
|
125
|
+
m(f.user), a(f.ok), l(f.error);
|
|
126
|
+
}, []), g = L(async () => {
|
|
127
|
+
if (!e) return !0;
|
|
128
|
+
const f = await $e(e, s);
|
|
129
|
+
return d(f), f.ok;
|
|
130
|
+
}, [e, s, d]);
|
|
131
|
+
M(() => {
|
|
132
|
+
if (!e) return;
|
|
133
|
+
let f = !1;
|
|
134
|
+
return (async () => {
|
|
135
|
+
r(!0), await g(), f || r(!1);
|
|
136
|
+
})(), () => {
|
|
137
|
+
f = !0;
|
|
138
|
+
};
|
|
139
|
+
}, [e, g]);
|
|
140
|
+
const S = L(async () => g(), [g]);
|
|
141
|
+
return { isAuthenticated: t, isLoading: i, user: o, error: c, recheckAuth: S };
|
|
142
|
+
}
|
|
143
|
+
function De(e) {
|
|
144
|
+
const { apiUrl: s, tenantId: t, sessionId: a, tokenStorageKey: i, onError: r, persist: o = !0 } = e, [m, c] = v([]), [l, d] = v(!1), [g, S] = v(!1), [f, w] = v(null), [b, x] = v(() => a || (o ? Ie(t) : null)), h = O(null), k = O(!1), p = L(() => s.replace(/\/chat\/?$/, ""), [s]), z = L(async (y) => {
|
|
145
|
+
S(!0);
|
|
146
|
+
try {
|
|
147
|
+
const _ = p(), T = await fetch(`${_}/sessions/${y}`, {
|
|
76
148
|
method: "GET",
|
|
77
149
|
headers: {
|
|
78
150
|
"Content-Type": "application/json",
|
|
79
|
-
...
|
|
80
|
-
...i
|
|
151
|
+
...t && { "X-Tenant-ID": t },
|
|
152
|
+
...U(i)
|
|
81
153
|
}
|
|
82
154
|
});
|
|
83
|
-
if (
|
|
155
|
+
if (T.status === 500)
|
|
84
156
|
return console.error("Server error while loading session, will retry later"), !1;
|
|
85
|
-
if (
|
|
86
|
-
return console.info("Unauthorized while loading session, clearing session"),
|
|
87
|
-
if (
|
|
88
|
-
return console.info("Session not found, starting fresh"),
|
|
89
|
-
if (
|
|
157
|
+
if (T.status === 401)
|
|
158
|
+
return console.info("Unauthorized while loading session, clearing session"), o && P(t), x(null), !1;
|
|
159
|
+
if (T.status === 404)
|
|
160
|
+
return console.info("Session not found, starting fresh"), o && P(t), x(null), !1;
|
|
161
|
+
if (T.status === 429)
|
|
90
162
|
return console.info("Rate limited while loading session, will retry later"), !1;
|
|
91
|
-
if (!
|
|
92
|
-
throw new Error(`Failed to load session: ${
|
|
93
|
-
const
|
|
94
|
-
var
|
|
163
|
+
if (!T.ok)
|
|
164
|
+
throw new Error(`Failed to load session: ${T.status}`);
|
|
165
|
+
const $ = (await T.json()).messages.map((B) => {
|
|
166
|
+
var R;
|
|
95
167
|
return {
|
|
96
168
|
id: B.id,
|
|
97
169
|
role: B.role,
|
|
98
170
|
content: B.content,
|
|
99
171
|
timestamp: new Date(B.timestamp),
|
|
100
|
-
sources: (
|
|
101
|
-
title:
|
|
102
|
-
url:
|
|
103
|
-
relevance:
|
|
172
|
+
sources: (R = B.citations) == null ? void 0 : R.map((C) => ({
|
|
173
|
+
title: C.title,
|
|
174
|
+
url: C.url,
|
|
175
|
+
relevance: C.relevance_score
|
|
104
176
|
}))
|
|
105
177
|
};
|
|
106
178
|
});
|
|
107
|
-
return c(
|
|
108
|
-
} catch (
|
|
109
|
-
return console.error("Failed to load session:",
|
|
179
|
+
return c($), x(y), !0;
|
|
180
|
+
} catch (_) {
|
|
181
|
+
return console.error("Failed to load session:", _), o && P(t), x(null), !1;
|
|
110
182
|
} finally {
|
|
111
|
-
|
|
112
|
-
}
|
|
113
|
-
}, [
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
}, []),
|
|
117
|
-
|
|
118
|
-
}, [
|
|
119
|
-
|
|
120
|
-
}) : void 0, [
|
|
121
|
-
const
|
|
122
|
-
var
|
|
123
|
-
if (!
|
|
124
|
-
|
|
125
|
-
const
|
|
183
|
+
S(!1);
|
|
184
|
+
}
|
|
185
|
+
}, [p, t, o]);
|
|
186
|
+
M(() => {
|
|
187
|
+
k.current || (k.current = !0, b && z(b));
|
|
188
|
+
}, []), M(() => {
|
|
189
|
+
o && Me(b, t);
|
|
190
|
+
}, [b, t, o]), M(() => o ? Ce(t, (_) => {
|
|
191
|
+
_ && _ !== b ? z(_) : _ || (c([]), x(null));
|
|
192
|
+
}) : void 0, [t, o, b, z]);
|
|
193
|
+
const H = L(async (y) => {
|
|
194
|
+
var T;
|
|
195
|
+
if (!y.trim() || l) return;
|
|
196
|
+
h.current && h.current.abort(), h.current = new AbortController();
|
|
197
|
+
const _ = {
|
|
126
198
|
id: `temp_${Date.now()}`,
|
|
127
199
|
role: "user",
|
|
128
|
-
content:
|
|
200
|
+
content: y.trim(),
|
|
129
201
|
timestamp: /* @__PURE__ */ new Date()
|
|
130
202
|
};
|
|
131
|
-
c((
|
|
203
|
+
c((I) => [...I, _]), d(!0), w(null);
|
|
132
204
|
try {
|
|
133
|
-
const
|
|
205
|
+
const I = await fetch(s, {
|
|
134
206
|
method: "POST",
|
|
135
207
|
headers: {
|
|
136
208
|
"Content-Type": "application/json",
|
|
137
|
-
...
|
|
138
|
-
...i
|
|
209
|
+
...t && { "X-Tenant-ID": t },
|
|
210
|
+
...U(i)
|
|
139
211
|
},
|
|
140
212
|
body: JSON.stringify({
|
|
141
|
-
message:
|
|
142
|
-
session_id:
|
|
213
|
+
message: y.trim(),
|
|
214
|
+
session_id: b
|
|
143
215
|
}),
|
|
144
|
-
signal:
|
|
216
|
+
signal: h.current.signal
|
|
145
217
|
});
|
|
146
|
-
if (!
|
|
147
|
-
if (
|
|
148
|
-
|
|
149
|
-
const O = {
|
|
218
|
+
if (!I.ok) {
|
|
219
|
+
if (I.status === 500) {
|
|
220
|
+
const j = {
|
|
150
221
|
id: `temp_${Date.now()}_servererror`,
|
|
151
222
|
role: "assistant",
|
|
152
223
|
content: "Er is een fout opgetreden bij het verwerken van je bericht. Probeer het later opnieuw.",
|
|
153
224
|
timestamp: /* @__PURE__ */ new Date()
|
|
154
225
|
};
|
|
155
|
-
c((
|
|
226
|
+
c((W) => [...W, j]);
|
|
156
227
|
return;
|
|
157
228
|
}
|
|
158
|
-
if (
|
|
159
|
-
const
|
|
229
|
+
if (I.status === 401) {
|
|
230
|
+
const j = {
|
|
160
231
|
id: `temp_${Date.now()}_unauthorized`,
|
|
161
232
|
role: "assistant",
|
|
162
233
|
content: "Je sessie is verlopen of je hebt geen toegang. Vernieuw de pagina om opnieuw te verbinden.",
|
|
163
234
|
timestamp: /* @__PURE__ */ new Date()
|
|
164
235
|
};
|
|
165
|
-
c((
|
|
236
|
+
c((W) => [...W, j]), o && P(t), x(null);
|
|
166
237
|
return;
|
|
167
238
|
}
|
|
168
|
-
if (
|
|
169
|
-
const
|
|
239
|
+
if (I.status === 429) {
|
|
240
|
+
const j = {
|
|
170
241
|
id: `temp_${Date.now()}_ratelimit`,
|
|
171
242
|
role: "assistant",
|
|
172
243
|
content: "Je stuurt te veel berichten achter elkaar. Wacht even en probeer het dan opnieuw.",
|
|
173
244
|
timestamp: /* @__PURE__ */ new Date()
|
|
174
245
|
};
|
|
175
|
-
c((
|
|
246
|
+
c((W) => [...W, j]);
|
|
176
247
|
return;
|
|
177
248
|
}
|
|
178
|
-
const
|
|
179
|
-
throw new Error(
|
|
249
|
+
const C = await I.json().catch(() => ({}));
|
|
250
|
+
throw new Error(C.detail || `Request failed with status ${I.status}`);
|
|
180
251
|
}
|
|
181
|
-
const
|
|
182
|
-
title:
|
|
183
|
-
url:
|
|
184
|
-
relevance:
|
|
185
|
-
})),
|
|
252
|
+
const $ = await I.json(), B = (T = $.message.citations) == null ? void 0 : T.map((C) => ({
|
|
253
|
+
title: C.title,
|
|
254
|
+
url: C.url,
|
|
255
|
+
relevance: C.relevance_score
|
|
256
|
+
})), R = {
|
|
186
257
|
id: `temp_${Date.now()}_assistant`,
|
|
187
258
|
role: "assistant",
|
|
188
|
-
content:
|
|
259
|
+
content: $.message.content,
|
|
189
260
|
timestamp: /* @__PURE__ */ new Date(),
|
|
190
261
|
sources: B
|
|
191
262
|
};
|
|
192
|
-
c((
|
|
193
|
-
} catch (
|
|
194
|
-
if (
|
|
263
|
+
c((C) => [...C, R]), $.session_id && x($.session_id);
|
|
264
|
+
} catch (I) {
|
|
265
|
+
if (I.name === "AbortError")
|
|
195
266
|
return;
|
|
196
|
-
const
|
|
197
|
-
w(
|
|
267
|
+
const $ = I instanceof Error ? I : new Error("An error occurred");
|
|
268
|
+
w($), r == null || r($);
|
|
198
269
|
} finally {
|
|
199
|
-
|
|
270
|
+
d(!1), h.current = null;
|
|
200
271
|
}
|
|
201
|
-
}, [s,
|
|
202
|
-
c([]),
|
|
203
|
-
}, [
|
|
204
|
-
if (
|
|
272
|
+
}, [s, t, b, l, r]), J = L(() => {
|
|
273
|
+
c([]), x(null), w(null), k.current = !1, o && P(t);
|
|
274
|
+
}, [o, t]), F = L(async () => {
|
|
275
|
+
if (b)
|
|
205
276
|
try {
|
|
206
|
-
const
|
|
207
|
-
await fetch(`${
|
|
277
|
+
const y = p();
|
|
278
|
+
await fetch(`${y}/sessions/${b}`, {
|
|
208
279
|
method: "DELETE",
|
|
209
280
|
headers: {
|
|
210
281
|
"Content-Type": "application/json",
|
|
211
|
-
...
|
|
212
|
-
...i
|
|
282
|
+
...t && { "X-Tenant-ID": t },
|
|
283
|
+
...U(i)
|
|
213
284
|
}
|
|
214
285
|
});
|
|
215
|
-
} catch (
|
|
216
|
-
console.error("Failed to delete session:",
|
|
286
|
+
} catch (y) {
|
|
287
|
+
console.error("Failed to delete session:", y);
|
|
217
288
|
}
|
|
218
|
-
c([]),
|
|
219
|
-
}, [
|
|
289
|
+
c([]), x(null), w(null), k.current = !1, o && P(t);
|
|
290
|
+
}, [b, p, t, o]), A = L(async (y) => {
|
|
220
291
|
try {
|
|
221
|
-
const
|
|
222
|
-
await fetch(`${
|
|
292
|
+
const _ = p();
|
|
293
|
+
await fetch(`${_}/sessions/${y}`, {
|
|
223
294
|
method: "DELETE",
|
|
224
295
|
headers: {
|
|
225
296
|
"Content-Type": "application/json",
|
|
226
|
-
...
|
|
227
|
-
...i
|
|
297
|
+
...t && { "X-Tenant-ID": t },
|
|
298
|
+
...U(i)
|
|
228
299
|
}
|
|
229
300
|
});
|
|
230
|
-
} catch (
|
|
231
|
-
console.error("Failed to delete session:",
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
}, [
|
|
235
|
-
c([]),
|
|
236
|
-
}, [
|
|
237
|
-
await
|
|
238
|
-
}, [
|
|
301
|
+
} catch (_) {
|
|
302
|
+
console.error("Failed to delete session:", _);
|
|
303
|
+
}
|
|
304
|
+
y === b && (c([]), x(null), w(null), k.current = !1, o && P(t));
|
|
305
|
+
}, [p, t, b, o]), N = L(() => {
|
|
306
|
+
c([]), x(null), w(null), k.current = !1, o && P(t);
|
|
307
|
+
}, [o, t]), te = L(async (y) => {
|
|
308
|
+
await z(y);
|
|
309
|
+
}, [z]), ne = L(async () => {
|
|
239
310
|
try {
|
|
240
|
-
const
|
|
311
|
+
const y = p(), _ = await fetch(`${y}/sessions`, {
|
|
241
312
|
method: "GET",
|
|
242
313
|
headers: {
|
|
243
314
|
"Content-Type": "application/json",
|
|
244
|
-
...
|
|
245
|
-
...i
|
|
315
|
+
...t && { "X-Tenant-ID": t },
|
|
316
|
+
...U(i)
|
|
246
317
|
}
|
|
247
318
|
});
|
|
248
|
-
return
|
|
249
|
-
} catch (
|
|
250
|
-
return console.error("Failed to list sessions:",
|
|
319
|
+
return _.ok ? await _.json() : (console.error("Failed to list sessions:", _.status), []);
|
|
320
|
+
} catch (y) {
|
|
321
|
+
return console.error("Failed to list sessions:", y), [];
|
|
251
322
|
}
|
|
252
|
-
}, [
|
|
323
|
+
}, [p, t]);
|
|
253
324
|
return {
|
|
254
|
-
messages:
|
|
325
|
+
messages: m,
|
|
255
326
|
isLoading: l,
|
|
256
|
-
isLoadingSession:
|
|
257
|
-
error:
|
|
258
|
-
sendMessage:
|
|
259
|
-
clearMessages:
|
|
260
|
-
deleteSession:
|
|
261
|
-
deleteSessionById:
|
|
262
|
-
startNewSession:
|
|
263
|
-
switchSession:
|
|
264
|
-
listSessions:
|
|
265
|
-
sessionId:
|
|
327
|
+
isLoadingSession: g,
|
|
328
|
+
error: f,
|
|
329
|
+
sendMessage: H,
|
|
330
|
+
clearMessages: J,
|
|
331
|
+
deleteSession: F,
|
|
332
|
+
deleteSessionById: A,
|
|
333
|
+
startNewSession: N,
|
|
334
|
+
switchSession: te,
|
|
335
|
+
listSessions: ne,
|
|
336
|
+
sessionId: b
|
|
266
337
|
};
|
|
267
338
|
}
|
|
268
|
-
let
|
|
269
|
-
function
|
|
270
|
-
const [a, i] =
|
|
271
|
-
|
|
272
|
-
if (a && !
|
|
339
|
+
let X = null;
|
|
340
|
+
function ze(e, s, t) {
|
|
341
|
+
const [a, i] = v(() => Le(e.tenantId)), r = O(X);
|
|
342
|
+
M(() => {
|
|
343
|
+
if (a && !r.current) {
|
|
273
344
|
const l = window.open("", "GeoAppsChatPopout");
|
|
274
|
-
l && l.location.href !== "about:blank" && !l.closed ? (
|
|
345
|
+
l && l.location.href !== "about:blank" && !l.closed ? (r.current = l, X = l) : (i(!1), Y(!1, e.tenantId));
|
|
275
346
|
}
|
|
276
|
-
}, [a, e.tenantId]),
|
|
277
|
-
if (!
|
|
347
|
+
}, [a, e.tenantId]), M(() => {
|
|
348
|
+
if (!r.current) return;
|
|
278
349
|
const l = setInterval(() => {
|
|
279
|
-
var
|
|
280
|
-
(
|
|
350
|
+
var d;
|
|
351
|
+
(d = r.current) != null && d.closed && (i(!1), r.current = null, X = null, Y(!1, e.tenantId), t == null || t());
|
|
281
352
|
}, 500);
|
|
282
353
|
return () => clearInterval(l);
|
|
283
|
-
}, [e.tenantId,
|
|
284
|
-
const
|
|
285
|
-
if (
|
|
286
|
-
|
|
354
|
+
}, [e.tenantId, t]);
|
|
355
|
+
const o = L(() => {
|
|
356
|
+
if (r.current && !r.current.closed) {
|
|
357
|
+
r.current.focus();
|
|
287
358
|
return;
|
|
288
359
|
}
|
|
289
360
|
const l = {
|
|
@@ -291,240 +362,253 @@ function Ne(e, s, n) {
|
|
|
291
362
|
medium: { width: 440, height: 660 },
|
|
292
363
|
large: { width: 560, height: 780 },
|
|
293
364
|
fullscreen: { width: 700, height: 800 }
|
|
294
|
-
}, { width:
|
|
365
|
+
}, { width: d, height: g } = l[s], S = (window.screen.width - d) / 2, f = (window.screen.height - g) / 2, w = window.open(
|
|
295
366
|
"",
|
|
296
367
|
"GeoAppsChatPopout",
|
|
297
|
-
`width=${
|
|
368
|
+
`width=${d},height=${g},left=${S},top=${f},resizable=yes,scrollbars=no`
|
|
298
369
|
);
|
|
299
370
|
if (!w) {
|
|
300
371
|
console.error("Failed to open popup window. Check if popups are blocked.");
|
|
301
372
|
return;
|
|
302
373
|
}
|
|
303
|
-
w.__CHAT_CONFIG__ = e, w.document.write(
|
|
304
|
-
}, [e, s]),
|
|
305
|
-
|
|
306
|
-
}, [e.tenantId]), c =
|
|
307
|
-
|
|
374
|
+
w.__CHAT_CONFIG__ = e, w.document.write(Ze(e)), w.document.close(), r.current = w, X = w, i(!0), Y(!0, e.tenantId);
|
|
375
|
+
}, [e, s]), m = L(() => {
|
|
376
|
+
r.current && !r.current.closed && r.current.close(), r.current = null, X = null, i(!1), Y(!1, e.tenantId);
|
|
377
|
+
}, [e.tenantId]), c = L(() => {
|
|
378
|
+
r.current && !r.current.closed && r.current.focus();
|
|
308
379
|
}, []);
|
|
309
380
|
return {
|
|
310
381
|
isPoppedOut: a,
|
|
311
|
-
openPopout:
|
|
312
|
-
closePopout:
|
|
382
|
+
openPopout: o,
|
|
383
|
+
closePopout: m,
|
|
313
384
|
focusPopout: c
|
|
314
385
|
};
|
|
315
386
|
}
|
|
316
|
-
const
|
|
317
|
-
function
|
|
318
|
-
return typeof e == "string" &&
|
|
387
|
+
const Ae = ["bottom-right", "bottom-left", "top-right", "top-left"];
|
|
388
|
+
function Be(e) {
|
|
389
|
+
return typeof e == "string" && Ae.includes(e);
|
|
319
390
|
}
|
|
320
|
-
function
|
|
321
|
-
if (
|
|
391
|
+
function He(e) {
|
|
392
|
+
if (Be(e))
|
|
322
393
|
return { className: `gcw-container--${e}`, style: {} };
|
|
323
|
-
const s = e,
|
|
324
|
-
return s.top != null && (
|
|
394
|
+
const s = e, t = {}, a = ["gcw-container--custom"];
|
|
395
|
+
return s.top != null && (t.top = s.top), s.bottom != null && (t.bottom = s.bottom), s.left != null && (t.left = s.left), s.right != null && (t.right = s.right), s.top != null && s.bottom == null && a.push("gcw-container--flow-down"), s.left != null && s.right == null && a.push("gcw-container--align-left"), { className: a.join(" "), style: t };
|
|
325
396
|
}
|
|
326
|
-
function
|
|
397
|
+
function dt({
|
|
327
398
|
apiUrl: e,
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
399
|
+
authUrl: s,
|
|
400
|
+
tenantId: t,
|
|
401
|
+
title: a = "Chat Assistent",
|
|
402
|
+
subtitle: i = "Hoe kan ik je helpen?",
|
|
403
|
+
placeholder: r = "Typ een bericht...",
|
|
332
404
|
greeting: o,
|
|
333
|
-
primaryColor:
|
|
334
|
-
position:
|
|
335
|
-
defaultOpen:
|
|
336
|
-
defaultSize:
|
|
337
|
-
|
|
338
|
-
onOpen:
|
|
339
|
-
onClose:
|
|
340
|
-
onMessageSent:
|
|
341
|
-
onResponseReceived:
|
|
405
|
+
primaryColor: m = "#3b82f6",
|
|
406
|
+
position: c = "bottom-right",
|
|
407
|
+
defaultOpen: l = !1,
|
|
408
|
+
defaultSize: d = "medium",
|
|
409
|
+
tokenStorageKey: g = "geoapps-token",
|
|
410
|
+
onOpen: S,
|
|
411
|
+
onClose: f,
|
|
412
|
+
onMessageSent: w,
|
|
413
|
+
onResponseReceived: b
|
|
342
414
|
}) {
|
|
343
|
-
const
|
|
415
|
+
const { isAuthenticated: x, isLoading: h, recheckAuth: k } = je({ authUrl: s, tokenStorageKey: g }), [p, z] = v(l), [H, J] = v(d), [F, A] = v(!1), { messages: N, isLoading: te, isLoadingSession: ne, sendMessage: y, deleteSession: _, deleteSessionById: T, startNewSession: I, switchSession: $, listSessions: B, sessionId: R } = De({
|
|
344
416
|
apiUrl: e,
|
|
345
|
-
tenantId:
|
|
346
|
-
|
|
347
|
-
}), [
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
}, [
|
|
351
|
-
|
|
352
|
-
}, [
|
|
353
|
-
|
|
417
|
+
tenantId: t,
|
|
418
|
+
tokenStorageKey: g
|
|
419
|
+
}), [C, j] = v(() => N.length > 0), [W, K] = v([]);
|
|
420
|
+
M(() => {
|
|
421
|
+
p && o && !C && N.length === 0 && j(!0);
|
|
422
|
+
}, [p, o, C, N.length]), M(() => {
|
|
423
|
+
N.length > 0 && j(!0);
|
|
424
|
+
}, [N.length]), M(() => {
|
|
425
|
+
C && o && N.length === 0 ? K([
|
|
354
426
|
{
|
|
355
427
|
id: "greeting",
|
|
356
428
|
role: "assistant",
|
|
357
429
|
content: o,
|
|
358
430
|
timestamp: /* @__PURE__ */ new Date()
|
|
359
431
|
}
|
|
360
|
-
]) : o &&
|
|
432
|
+
]) : o && N.length > 0 ? K([
|
|
361
433
|
{
|
|
362
434
|
id: "greeting",
|
|
363
435
|
role: "assistant",
|
|
364
436
|
content: o,
|
|
365
437
|
timestamp: /* @__PURE__ */ new Date()
|
|
366
438
|
},
|
|
367
|
-
...
|
|
368
|
-
]) :
|
|
369
|
-
}, [
|
|
370
|
-
const { isPoppedOut:
|
|
439
|
+
...N
|
|
440
|
+
]) : K(N);
|
|
441
|
+
}, [N, C, o]);
|
|
442
|
+
const { isPoppedOut: V, openPopout: de, focusPopout: ue } = ze(
|
|
371
443
|
{
|
|
372
444
|
apiUrl: e,
|
|
373
|
-
tenantId:
|
|
374
|
-
title:
|
|
375
|
-
subtitle:
|
|
376
|
-
placeholder:
|
|
377
|
-
primaryColor:
|
|
378
|
-
sessionId:
|
|
379
|
-
messages:
|
|
380
|
-
|
|
445
|
+
tenantId: t,
|
|
446
|
+
title: a,
|
|
447
|
+
subtitle: i,
|
|
448
|
+
placeholder: r,
|
|
449
|
+
primaryColor: m,
|
|
450
|
+
sessionId: R,
|
|
451
|
+
messages: W,
|
|
452
|
+
tokenStorageKey: g
|
|
381
453
|
},
|
|
382
|
-
|
|
454
|
+
H,
|
|
383
455
|
() => {
|
|
384
456
|
}
|
|
385
457
|
);
|
|
386
|
-
|
|
387
|
-
const
|
|
388
|
-
if (
|
|
389
|
-
|
|
458
|
+
M(() => {
|
|
459
|
+
const E = N.filter((D) => D.role === "assistant").length;
|
|
460
|
+
if (E === 0) {
|
|
461
|
+
A(!1);
|
|
390
462
|
return;
|
|
391
463
|
}
|
|
392
|
-
if (
|
|
393
|
-
|
|
464
|
+
if (p || V)
|
|
465
|
+
q(E, t), A(!1);
|
|
394
466
|
else {
|
|
395
|
-
const D =
|
|
396
|
-
|
|
467
|
+
const D = Ee(t);
|
|
468
|
+
A(E > D);
|
|
397
469
|
}
|
|
398
|
-
}, [
|
|
399
|
-
const
|
|
400
|
-
if (
|
|
401
|
-
|
|
470
|
+
}, [p, V, N, t]);
|
|
471
|
+
const re = () => {
|
|
472
|
+
if (V) {
|
|
473
|
+
ue();
|
|
402
474
|
return;
|
|
403
475
|
}
|
|
404
|
-
const
|
|
405
|
-
if (
|
|
406
|
-
|
|
407
|
-
const D =
|
|
408
|
-
D > 0 &&
|
|
476
|
+
const E = !p;
|
|
477
|
+
if (z(E), E) {
|
|
478
|
+
S == null || S();
|
|
479
|
+
const D = N.filter((ie) => ie.role === "assistant").length;
|
|
480
|
+
D > 0 && q(D, t), A(!1);
|
|
409
481
|
} else
|
|
410
|
-
|
|
411
|
-
},
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
482
|
+
f == null || f();
|
|
483
|
+
}, me = async (E) => {
|
|
484
|
+
if (s && !await k()) {
|
|
485
|
+
K((ve) => [
|
|
486
|
+
...ve,
|
|
487
|
+
{
|
|
488
|
+
id: `auth-error-${Date.now()}`,
|
|
489
|
+
role: "assistant",
|
|
490
|
+
content: "Je sessie is verlopen of je hebt geen toegang. Vernieuw de pagina om opnieuw te verbinden.",
|
|
491
|
+
timestamp: /* @__PURE__ */ new Date()
|
|
492
|
+
}
|
|
493
|
+
]);
|
|
494
|
+
return;
|
|
495
|
+
}
|
|
496
|
+
w == null || w(E), await y(E);
|
|
497
|
+
const D = N[N.length - 1];
|
|
498
|
+
(D == null ? void 0 : D.role) === "assistant" && (b == null || b(D.content));
|
|
499
|
+
}, he = async () => {
|
|
500
|
+
await _(), j(!1), K([]), A(!1), q(0, t);
|
|
501
|
+
}, ge = () => {
|
|
502
|
+
I(), j(!1), K([]), A(!1), q(0, t);
|
|
503
|
+
}, pe = async (E) => {
|
|
504
|
+
await $(E), j(!0);
|
|
505
|
+
}, fe = (E) => {
|
|
506
|
+
J(E);
|
|
507
|
+
}, we = () => {
|
|
508
|
+
z(!1), de();
|
|
509
|
+
}, { className: be, style: ye } = He(c);
|
|
510
|
+
return h || !x ? null : /* @__PURE__ */ u("div", { className: `gcw-widget gcw-container ${be}`, style: ye, children: [
|
|
511
|
+
/* @__PURE__ */ n(
|
|
512
|
+
Ue,
|
|
429
513
|
{
|
|
430
|
-
isOpen:
|
|
431
|
-
onClick:
|
|
432
|
-
primaryColor:
|
|
433
|
-
hasUnread:
|
|
434
|
-
isPoppedOut:
|
|
514
|
+
isOpen: p,
|
|
515
|
+
onClick: re,
|
|
516
|
+
primaryColor: m,
|
|
517
|
+
hasUnread: F && !p && !V,
|
|
518
|
+
isPoppedOut: V
|
|
435
519
|
}
|
|
436
520
|
),
|
|
437
|
-
|
|
438
|
-
|
|
521
|
+
p && !V && /* @__PURE__ */ n(
|
|
522
|
+
Pe,
|
|
439
523
|
{
|
|
440
|
-
title:
|
|
441
|
-
subtitle:
|
|
442
|
-
placeholder:
|
|
443
|
-
messages:
|
|
444
|
-
isLoading:
|
|
445
|
-
isLoadingSession:
|
|
446
|
-
onSendMessage:
|
|
447
|
-
onClose:
|
|
448
|
-
onClear:
|
|
449
|
-
onSizeChange:
|
|
450
|
-
onPopout:
|
|
451
|
-
onNewSession:
|
|
452
|
-
onSelectSession:
|
|
453
|
-
onListSessions:
|
|
454
|
-
onDeleteSession:
|
|
455
|
-
currentSessionId:
|
|
456
|
-
primaryColor:
|
|
457
|
-
size:
|
|
524
|
+
title: a,
|
|
525
|
+
subtitle: i,
|
|
526
|
+
placeholder: r,
|
|
527
|
+
messages: W,
|
|
528
|
+
isLoading: te,
|
|
529
|
+
isLoadingSession: ne,
|
|
530
|
+
onSendMessage: me,
|
|
531
|
+
onClose: re,
|
|
532
|
+
onClear: he,
|
|
533
|
+
onSizeChange: fe,
|
|
534
|
+
onPopout: we,
|
|
535
|
+
onNewSession: ge,
|
|
536
|
+
onSelectSession: pe,
|
|
537
|
+
onListSessions: B,
|
|
538
|
+
onDeleteSession: T,
|
|
539
|
+
currentSessionId: R,
|
|
540
|
+
primaryColor: m,
|
|
541
|
+
size: H
|
|
458
542
|
}
|
|
459
543
|
)
|
|
460
544
|
] });
|
|
461
545
|
}
|
|
462
|
-
const
|
|
546
|
+
const We = {
|
|
463
547
|
small: "gcw-window--small",
|
|
464
548
|
medium: "gcw-window--medium",
|
|
465
549
|
large: "gcw-window--large",
|
|
466
550
|
fullscreen: "gcw-window--fullscreen"
|
|
467
551
|
};
|
|
468
|
-
function
|
|
552
|
+
function Pe({
|
|
469
553
|
title: e,
|
|
470
554
|
subtitle: s,
|
|
471
|
-
placeholder:
|
|
555
|
+
placeholder: t,
|
|
472
556
|
messages: a,
|
|
473
557
|
isLoading: i,
|
|
474
|
-
isLoadingSession:
|
|
475
|
-
onSendMessage:
|
|
476
|
-
onClose:
|
|
558
|
+
isLoadingSession: r = !1,
|
|
559
|
+
onSendMessage: o,
|
|
560
|
+
onClose: m,
|
|
477
561
|
onClear: c,
|
|
478
562
|
onSizeChange: l,
|
|
479
|
-
onPopout:
|
|
480
|
-
onNewSession:
|
|
481
|
-
onSelectSession:
|
|
482
|
-
onListSessions:
|
|
563
|
+
onPopout: d,
|
|
564
|
+
onNewSession: g,
|
|
565
|
+
onSelectSession: S,
|
|
566
|
+
onListSessions: f,
|
|
483
567
|
onDeleteSession: w,
|
|
484
|
-
currentSessionId:
|
|
485
|
-
primaryColor:
|
|
486
|
-
size:
|
|
568
|
+
currentSessionId: b,
|
|
569
|
+
primaryColor: x,
|
|
570
|
+
size: h
|
|
487
571
|
}) {
|
|
488
|
-
const [
|
|
489
|
-
const
|
|
490
|
-
l(
|
|
572
|
+
const [k, p] = v(!1), [z, H] = v(!1), J = () => {
|
|
573
|
+
const F = ["small", "medium", "large", "fullscreen"], N = (F.indexOf(h) + 1) % F.length;
|
|
574
|
+
l(F[N]);
|
|
491
575
|
};
|
|
492
|
-
return /* @__PURE__ */
|
|
493
|
-
/* @__PURE__ */
|
|
494
|
-
/* @__PURE__ */
|
|
495
|
-
/* @__PURE__ */
|
|
496
|
-
/* @__PURE__ */
|
|
497
|
-
/* @__PURE__ */
|
|
498
|
-
/* @__PURE__ */
|
|
576
|
+
return /* @__PURE__ */ u("div", { className: `gcw-window ${We[h]}`, children: [
|
|
577
|
+
/* @__PURE__ */ u("div", { className: "gcw-header", style: { backgroundColor: x }, children: [
|
|
578
|
+
/* @__PURE__ */ u("div", { className: "gcw-header__left", children: [
|
|
579
|
+
/* @__PURE__ */ n("div", { className: "gcw-header__avatar", children: /* @__PURE__ */ n(rt, { className: "gcw-header__avatar-icon" }) }),
|
|
580
|
+
/* @__PURE__ */ u("div", { className: "gcw-header__info", children: [
|
|
581
|
+
/* @__PURE__ */ n("h3", { className: "gcw-header__title", children: e }),
|
|
582
|
+
/* @__PURE__ */ n("p", { className: "gcw-header__subtitle", children: s })
|
|
499
583
|
] })
|
|
500
584
|
] }),
|
|
501
|
-
/* @__PURE__ */
|
|
502
|
-
/* @__PURE__ */
|
|
503
|
-
|
|
585
|
+
/* @__PURE__ */ u("div", { className: "gcw-header__actions", children: [
|
|
586
|
+
/* @__PURE__ */ n(
|
|
587
|
+
tt,
|
|
504
588
|
{
|
|
505
|
-
size:
|
|
506
|
-
onCycleSize:
|
|
507
|
-
onPopout:
|
|
508
|
-
onClear: () =>
|
|
589
|
+
size: h,
|
|
590
|
+
onCycleSize: J,
|
|
591
|
+
onPopout: d,
|
|
592
|
+
onClear: () => H(!0),
|
|
509
593
|
onNewSession: () => {
|
|
510
|
-
|
|
594
|
+
g(), p(!1);
|
|
511
595
|
},
|
|
512
|
-
onShowHistory: () =>
|
|
596
|
+
onShowHistory: () => p(!0)
|
|
513
597
|
}
|
|
514
598
|
),
|
|
515
|
-
/* @__PURE__ */
|
|
599
|
+
/* @__PURE__ */ n(
|
|
516
600
|
"button",
|
|
517
601
|
{
|
|
518
|
-
onClick:
|
|
602
|
+
onClick: m,
|
|
519
603
|
className: "gcw-header__btn",
|
|
520
604
|
title: "Sluiten",
|
|
521
|
-
children: /* @__PURE__ */
|
|
605
|
+
children: /* @__PURE__ */ n(ot, { className: "gcw-header__btn-icon" })
|
|
522
606
|
}
|
|
523
607
|
)
|
|
524
608
|
] })
|
|
525
609
|
] }),
|
|
526
|
-
|
|
527
|
-
|
|
610
|
+
z && /* @__PURE__ */ n(
|
|
611
|
+
ae,
|
|
528
612
|
{
|
|
529
613
|
title: "Chat verwijderen",
|
|
530
614
|
message: "Weet je zeker dat je dit gesprek wilt verwijderen? Dit kan niet ongedaan worden gemaakt.",
|
|
@@ -532,65 +616,65 @@ function Ee({
|
|
|
532
616
|
cancelLabel: "Annuleren",
|
|
533
617
|
variant: "danger",
|
|
534
618
|
onConfirm: () => {
|
|
535
|
-
|
|
619
|
+
H(!1), c();
|
|
536
620
|
},
|
|
537
|
-
onCancel: () =>
|
|
621
|
+
onCancel: () => H(!1)
|
|
538
622
|
}
|
|
539
623
|
),
|
|
540
|
-
|
|
541
|
-
|
|
624
|
+
k ? /* @__PURE__ */ n(
|
|
625
|
+
Xe,
|
|
542
626
|
{
|
|
543
|
-
currentSessionId:
|
|
544
|
-
onBack: () =>
|
|
545
|
-
onSelectSession:
|
|
546
|
-
onNewSession:
|
|
547
|
-
onListSessions:
|
|
627
|
+
currentSessionId: b,
|
|
628
|
+
onBack: () => p(!1),
|
|
629
|
+
onSelectSession: S,
|
|
630
|
+
onNewSession: g,
|
|
631
|
+
onListSessions: f,
|
|
548
632
|
onDeleteSession: w,
|
|
549
|
-
primaryColor:
|
|
633
|
+
primaryColor: x
|
|
550
634
|
}
|
|
551
|
-
) : /* @__PURE__ */
|
|
552
|
-
/* @__PURE__ */
|
|
553
|
-
|
|
635
|
+
) : /* @__PURE__ */ u(ke, { children: [
|
|
636
|
+
/* @__PURE__ */ n(
|
|
637
|
+
Ke,
|
|
554
638
|
{
|
|
555
639
|
messages: a,
|
|
556
640
|
isLoading: i,
|
|
557
|
-
isLoadingSession:
|
|
558
|
-
primaryColor:
|
|
641
|
+
isLoadingSession: r,
|
|
642
|
+
primaryColor: x
|
|
559
643
|
}
|
|
560
644
|
),
|
|
561
|
-
/* @__PURE__ */
|
|
562
|
-
|
|
645
|
+
/* @__PURE__ */ n(
|
|
646
|
+
Ve,
|
|
563
647
|
{
|
|
564
|
-
placeholder:
|
|
648
|
+
placeholder: t,
|
|
565
649
|
isLoading: i,
|
|
566
|
-
onSendMessage:
|
|
567
|
-
primaryColor:
|
|
650
|
+
onSendMessage: o,
|
|
651
|
+
primaryColor: x
|
|
568
652
|
}
|
|
569
653
|
)
|
|
570
654
|
] })
|
|
571
655
|
] });
|
|
572
656
|
}
|
|
573
|
-
function
|
|
574
|
-
return /* @__PURE__ */
|
|
657
|
+
function Oe({ className: e }) {
|
|
658
|
+
return /* @__PURE__ */ n("svg", { className: e, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1" }) });
|
|
575
659
|
}
|
|
576
|
-
function
|
|
660
|
+
function Fe(e) {
|
|
577
661
|
return e.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" });
|
|
578
662
|
}
|
|
579
|
-
function
|
|
663
|
+
function Re(e, s) {
|
|
580
664
|
return e.length <= s ? e : e.slice(0, s - 3) + "...";
|
|
581
665
|
}
|
|
582
|
-
function
|
|
583
|
-
const
|
|
584
|
-
return /* @__PURE__ */
|
|
585
|
-
/* @__PURE__ */
|
|
666
|
+
function Ge({ message: e, primaryColor: s }) {
|
|
667
|
+
const t = e.role === "user", a = t ? "user" : "assistant";
|
|
668
|
+
return /* @__PURE__ */ n("div", { className: `gcw-bubble-row gcw-bubble-row--${a}`, children: /* @__PURE__ */ u("div", { className: `gcw-bubble-wrapper gcw-bubble-wrapper--${a}`, children: [
|
|
669
|
+
/* @__PURE__ */ n(
|
|
586
670
|
"div",
|
|
587
671
|
{
|
|
588
672
|
className: `gcw-bubble gcw-bubble--${a}`,
|
|
589
|
-
style:
|
|
590
|
-
children: /* @__PURE__ */
|
|
673
|
+
style: t ? { backgroundColor: s } : void 0,
|
|
674
|
+
children: /* @__PURE__ */ n(Ye, { content: e.content, className: "gcw-content" })
|
|
591
675
|
}
|
|
592
676
|
),
|
|
593
|
-
e.sources && e.sources.length > 0 && /* @__PURE__ */
|
|
677
|
+
e.sources && e.sources.length > 0 && /* @__PURE__ */ n("div", { className: "gcw-sources", children: e.sources.slice(0, 3).map((i, r) => /* @__PURE__ */ u(
|
|
594
678
|
"a",
|
|
595
679
|
{
|
|
596
680
|
href: i.url,
|
|
@@ -598,59 +682,59 @@ function De({ message: e, primaryColor: s }) {
|
|
|
598
682
|
rel: "noopener noreferrer",
|
|
599
683
|
className: "gcw-source",
|
|
600
684
|
children: [
|
|
601
|
-
/* @__PURE__ */
|
|
602
|
-
|
|
685
|
+
/* @__PURE__ */ n(Oe, { className: "gcw-source__icon" }),
|
|
686
|
+
Re(i.title, 25)
|
|
603
687
|
]
|
|
604
688
|
},
|
|
605
|
-
|
|
689
|
+
r
|
|
606
690
|
)) }),
|
|
607
|
-
/* @__PURE__ */
|
|
691
|
+
/* @__PURE__ */ n("span", { className: "gcw-bubble__timestamp", children: Fe(e.timestamp) })
|
|
608
692
|
] }) });
|
|
609
693
|
}
|
|
610
|
-
function
|
|
611
|
-
var
|
|
612
|
-
const i =
|
|
613
|
-
return
|
|
614
|
-
var
|
|
615
|
-
(
|
|
616
|
-
}, [e, s]),
|
|
617
|
-
/* @__PURE__ */
|
|
618
|
-
/* @__PURE__ */
|
|
619
|
-
] }) }) : e.length === 0 && !s ? /* @__PURE__ */
|
|
620
|
-
/* @__PURE__ */
|
|
621
|
-
/* @__PURE__ */
|
|
622
|
-
] }) : /* @__PURE__ */
|
|
623
|
-
e.map((
|
|
624
|
-
|
|
694
|
+
function Ke({ messages: e, isLoading: s, isLoadingSession: t = !1, primaryColor: a }) {
|
|
695
|
+
var r;
|
|
696
|
+
const i = O(null);
|
|
697
|
+
return M(() => {
|
|
698
|
+
var o;
|
|
699
|
+
(o = i.current) == null || o.scrollIntoView({ behavior: "smooth" });
|
|
700
|
+
}, [e, s]), t ? /* @__PURE__ */ n("div", { className: "gcw-empty", children: /* @__PURE__ */ u("div", { className: "gcw-session-loading", children: [
|
|
701
|
+
/* @__PURE__ */ n("div", { className: "gcw-session-loading__spinner" }),
|
|
702
|
+
/* @__PURE__ */ n("p", { className: "gcw-empty__text", children: "Chatgeschiedenis laden..." })
|
|
703
|
+
] }) }) : e.length === 0 && !s ? /* @__PURE__ */ u("div", { className: "gcw-empty", children: [
|
|
704
|
+
/* @__PURE__ */ n("svg", { className: "gcw-empty__icon", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 1.5, d: "M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }),
|
|
705
|
+
/* @__PURE__ */ n("p", { className: "gcw-empty__text", children: "Begin een gesprek door hieronder een bericht te typen" })
|
|
706
|
+
] }) : /* @__PURE__ */ u("div", { className: "gcw-messages", children: [
|
|
707
|
+
e.map((o) => /* @__PURE__ */ n(
|
|
708
|
+
Ge,
|
|
625
709
|
{
|
|
626
|
-
message:
|
|
710
|
+
message: o,
|
|
627
711
|
primaryColor: a
|
|
628
712
|
},
|
|
629
|
-
|
|
713
|
+
o.id
|
|
630
714
|
)),
|
|
631
|
-
s && ((
|
|
632
|
-
/* @__PURE__ */
|
|
715
|
+
s && ((r = e[e.length - 1]) == null ? void 0 : r.role) !== "assistant" && /* @__PURE__ */ n(Qe, {}),
|
|
716
|
+
/* @__PURE__ */ n("div", { ref: i })
|
|
633
717
|
] });
|
|
634
718
|
}
|
|
635
|
-
function
|
|
636
|
-
const [i,
|
|
637
|
-
|
|
638
|
-
const l =
|
|
719
|
+
function Ve({ placeholder: e, isLoading: s, onSendMessage: t, primaryColor: a }) {
|
|
720
|
+
const [i, r] = v(""), o = O(null);
|
|
721
|
+
M(() => {
|
|
722
|
+
const l = o.current;
|
|
639
723
|
l && (l.style.height = "auto", l.style.height = `${Math.min(l.scrollHeight, 120)}px`);
|
|
640
724
|
}, [i]);
|
|
641
|
-
const
|
|
642
|
-
i.trim() && !s && (
|
|
725
|
+
const m = () => {
|
|
726
|
+
i.trim() && !s && (t(i), r(""), o.current && (o.current.style.height = "auto"));
|
|
643
727
|
};
|
|
644
|
-
return /* @__PURE__ */
|
|
645
|
-
/* @__PURE__ */
|
|
646
|
-
/* @__PURE__ */
|
|
728
|
+
return /* @__PURE__ */ u("div", { className: "gcw-input-area", children: [
|
|
729
|
+
/* @__PURE__ */ u("div", { className: "gcw-input-row", children: [
|
|
730
|
+
/* @__PURE__ */ n(
|
|
647
731
|
"textarea",
|
|
648
732
|
{
|
|
649
|
-
ref:
|
|
733
|
+
ref: o,
|
|
650
734
|
value: i,
|
|
651
|
-
onChange: (l) =>
|
|
735
|
+
onChange: (l) => r(l.target.value),
|
|
652
736
|
onKeyDown: (l) => {
|
|
653
|
-
l.key === "Enter" && !l.shiftKey && (l.preventDefault(),
|
|
737
|
+
l.key === "Enter" && !l.shiftKey && (l.preventDefault(), m());
|
|
654
738
|
},
|
|
655
739
|
placeholder: e,
|
|
656
740
|
disabled: s,
|
|
@@ -658,84 +742,84 @@ function ze({ placeholder: e, isLoading: s, onSendMessage: n, primaryColor: a })
|
|
|
658
742
|
className: "gcw-input"
|
|
659
743
|
}
|
|
660
744
|
),
|
|
661
|
-
/* @__PURE__ */
|
|
745
|
+
/* @__PURE__ */ n(
|
|
662
746
|
"button",
|
|
663
747
|
{
|
|
664
|
-
onClick:
|
|
748
|
+
onClick: m,
|
|
665
749
|
disabled: !i.trim() || s,
|
|
666
750
|
className: "gcw-send-btn",
|
|
667
751
|
style: { backgroundColor: a },
|
|
668
752
|
title: "Verstuur bericht",
|
|
669
|
-
children: s ? /* @__PURE__ */
|
|
670
|
-
/* @__PURE__ */
|
|
671
|
-
/* @__PURE__ */
|
|
672
|
-
] }) : /* @__PURE__ */
|
|
753
|
+
children: s ? /* @__PURE__ */ u("svg", { className: "gcw-send-btn__icon gcw-spin", fill: "none", viewBox: "0 0 24 24", children: [
|
|
754
|
+
/* @__PURE__ */ n("circle", { style: { opacity: 0.25 }, cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }),
|
|
755
|
+
/* @__PURE__ */ n("path", { style: { opacity: 0.75 }, fill: "currentColor", d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z" })
|
|
756
|
+
] }) : /* @__PURE__ */ n("svg", { className: "gcw-send-btn__icon", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 19l9 2-9-18-9 18 9-2zm0 0v-8" }) })
|
|
673
757
|
}
|
|
674
758
|
)
|
|
675
759
|
] }),
|
|
676
|
-
/* @__PURE__ */
|
|
760
|
+
/* @__PURE__ */ n("p", { className: "gcw-input-hint", children: "Druk op Enter om te verzenden, Shift+Enter voor een nieuwe regel" })
|
|
677
761
|
] });
|
|
678
762
|
}
|
|
679
|
-
function
|
|
680
|
-
return /* @__PURE__ */
|
|
763
|
+
function Ue({ isOpen: e, onClick: s, primaryColor: t, hasUnread: a, isPoppedOut: i }) {
|
|
764
|
+
return /* @__PURE__ */ u(
|
|
681
765
|
"button",
|
|
682
766
|
{
|
|
683
767
|
onClick: s,
|
|
684
768
|
className: "gcw-toggle",
|
|
685
|
-
style: { backgroundColor:
|
|
769
|
+
style: { backgroundColor: t },
|
|
686
770
|
title: i ? "Chat is open in een ander venster" : e ? "Sluit chat" : "Open chat",
|
|
687
771
|
children: [
|
|
688
|
-
a && !e && /* @__PURE__ */
|
|
689
|
-
i && /* @__PURE__ */
|
|
690
|
-
/* @__PURE__ */
|
|
772
|
+
a && !e && /* @__PURE__ */ n("span", { className: "gcw-toggle__badge gcw-toggle__badge--unread", children: "!" }),
|
|
773
|
+
i && /* @__PURE__ */ n("span", { className: "gcw-toggle__badge gcw-toggle__badge--popout" }),
|
|
774
|
+
/* @__PURE__ */ n("div", { className: "gcw-toggle__icon", children: i ? /* @__PURE__ */ n("svg", { fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14" }) }) : e ? /* @__PURE__ */ n("svg", { fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) }) : /* @__PURE__ */ n("svg", { fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }) })
|
|
691
775
|
]
|
|
692
776
|
}
|
|
693
777
|
);
|
|
694
778
|
}
|
|
695
|
-
function
|
|
696
|
-
const s = new Date(e), a = (/* @__PURE__ */ new Date()).getTime() - s.getTime(), i = Math.floor(a / 6e4),
|
|
697
|
-
return i < 1 ? "Zojuist" : i < 60 ? `${i} min geleden` :
|
|
779
|
+
function Je(e) {
|
|
780
|
+
const s = new Date(e), a = (/* @__PURE__ */ new Date()).getTime() - s.getTime(), i = Math.floor(a / 6e4), r = Math.floor(a / 36e5), o = Math.floor(a / 864e5);
|
|
781
|
+
return i < 1 ? "Zojuist" : i < 60 ? `${i} min geleden` : r < 24 ? `${r} uur geleden` : o < 7 ? `${o} ${o === 1 ? "dag" : "dagen"} geleden` : s.toLocaleDateString("nl-NL", { day: "numeric", month: "short" });
|
|
698
782
|
}
|
|
699
|
-
function
|
|
783
|
+
function Xe({
|
|
700
784
|
currentSessionId: e,
|
|
701
785
|
onBack: s,
|
|
702
|
-
onSelectSession:
|
|
786
|
+
onSelectSession: t,
|
|
703
787
|
onNewSession: a,
|
|
704
788
|
onDeleteSession: i,
|
|
705
|
-
onListSessions:
|
|
706
|
-
primaryColor:
|
|
789
|
+
onListSessions: r,
|
|
790
|
+
primaryColor: o
|
|
707
791
|
}) {
|
|
708
|
-
const [
|
|
709
|
-
|
|
710
|
-
let
|
|
711
|
-
return
|
|
712
|
-
|
|
792
|
+
const [m, c] = v([]), [l, d] = v(!0), [g, S] = v(null);
|
|
793
|
+
M(() => {
|
|
794
|
+
let h = !1;
|
|
795
|
+
return d(!0), r().then((k) => {
|
|
796
|
+
h || (c(k), d(!1));
|
|
713
797
|
}), () => {
|
|
714
|
-
|
|
798
|
+
h = !0;
|
|
715
799
|
};
|
|
716
|
-
}, [
|
|
717
|
-
const
|
|
718
|
-
|
|
719
|
-
}, w = (
|
|
720
|
-
|
|
721
|
-
},
|
|
722
|
-
if (!
|
|
723
|
-
const
|
|
724
|
-
|
|
800
|
+
}, [r]);
|
|
801
|
+
const f = (h) => {
|
|
802
|
+
t(h), s();
|
|
803
|
+
}, w = (h, k) => {
|
|
804
|
+
h.stopPropagation(), S(k);
|
|
805
|
+
}, b = async () => {
|
|
806
|
+
if (!g) return;
|
|
807
|
+
const h = g;
|
|
808
|
+
S(null), await i(h), c((k) => k.filter((p) => p.id !== h));
|
|
725
809
|
};
|
|
726
|
-
return /* @__PURE__ */
|
|
727
|
-
/* @__PURE__ */
|
|
728
|
-
/* @__PURE__ */
|
|
810
|
+
return /* @__PURE__ */ u("div", { className: "gcw-history", children: [
|
|
811
|
+
/* @__PURE__ */ u("div", { className: "gcw-history__header", style: { backgroundColor: o }, children: [
|
|
812
|
+
/* @__PURE__ */ n(
|
|
729
813
|
"button",
|
|
730
814
|
{
|
|
731
815
|
className: "gcw-header__btn",
|
|
732
816
|
onClick: s,
|
|
733
817
|
title: "Terug",
|
|
734
|
-
children: /* @__PURE__ */
|
|
818
|
+
children: /* @__PURE__ */ n(at, { className: "gcw-header__btn-icon" })
|
|
735
819
|
}
|
|
736
820
|
),
|
|
737
|
-
/* @__PURE__ */
|
|
738
|
-
/* @__PURE__ */
|
|
821
|
+
/* @__PURE__ */ n("h3", { className: "gcw-history__title", children: "Gesprekken" }),
|
|
822
|
+
/* @__PURE__ */ n(
|
|
739
823
|
"button",
|
|
740
824
|
{
|
|
741
825
|
className: "gcw-header__btn",
|
|
@@ -743,223 +827,223 @@ function Pe({
|
|
|
743
827
|
a(), s();
|
|
744
828
|
},
|
|
745
829
|
title: "Nieuw gesprek",
|
|
746
|
-
children: /* @__PURE__ */
|
|
830
|
+
children: /* @__PURE__ */ n(ce, { className: "gcw-header__btn-icon" })
|
|
747
831
|
}
|
|
748
832
|
)
|
|
749
833
|
] }),
|
|
750
|
-
/* @__PURE__ */
|
|
751
|
-
/* @__PURE__ */
|
|
752
|
-
/* @__PURE__ */
|
|
753
|
-
] }) :
|
|
834
|
+
/* @__PURE__ */ n("div", { className: "gcw-history__list", children: l ? /* @__PURE__ */ u("div", { className: "gcw-history__loading", children: [
|
|
835
|
+
/* @__PURE__ */ n("div", { className: "gcw-session-loading__spinner" }),
|
|
836
|
+
/* @__PURE__ */ n("span", { children: "Gesprekken laden..." })
|
|
837
|
+
] }) : m.length === 0 ? /* @__PURE__ */ n("div", { className: "gcw-history__empty", children: /* @__PURE__ */ n("p", { children: "Geen eerdere gesprekken" }) }) : m.map((h) => /* @__PURE__ */ u(
|
|
754
838
|
"div",
|
|
755
839
|
{
|
|
756
|
-
className: `gcw-history__item ${
|
|
757
|
-
onClick: () =>
|
|
758
|
-
style:
|
|
840
|
+
className: `gcw-history__item ${h.id === e ? "gcw-history__item--active" : ""}`,
|
|
841
|
+
onClick: () => f(h.id),
|
|
842
|
+
style: h.id === e ? { borderLeftColor: o } : void 0,
|
|
759
843
|
role: "button",
|
|
760
844
|
tabIndex: 0,
|
|
761
|
-
onKeyDown: (
|
|
762
|
-
|
|
845
|
+
onKeyDown: (k) => {
|
|
846
|
+
k.key === "Enter" && f(h.id);
|
|
763
847
|
},
|
|
764
848
|
children: [
|
|
765
|
-
/* @__PURE__ */
|
|
766
|
-
/* @__PURE__ */
|
|
767
|
-
/* @__PURE__ */
|
|
768
|
-
|
|
849
|
+
/* @__PURE__ */ u("div", { className: "gcw-history__item-content", children: [
|
|
850
|
+
/* @__PURE__ */ n("span", { className: "gcw-history__item-title", children: h.title || "Naamloos gesprek" }),
|
|
851
|
+
/* @__PURE__ */ u("span", { className: "gcw-history__item-meta", children: [
|
|
852
|
+
h.message_count,
|
|
769
853
|
" ",
|
|
770
|
-
|
|
854
|
+
h.message_count === 1 ? "bericht" : "berichten",
|
|
771
855
|
" · ",
|
|
772
|
-
|
|
856
|
+
Je(h.updated_at)
|
|
773
857
|
] })
|
|
774
858
|
] }),
|
|
775
|
-
/* @__PURE__ */
|
|
859
|
+
/* @__PURE__ */ n(
|
|
776
860
|
"button",
|
|
777
861
|
{
|
|
778
862
|
className: "gcw-history__item-delete",
|
|
779
|
-
onClick: (
|
|
863
|
+
onClick: (k) => w(k, h.id),
|
|
780
864
|
title: "Verwijder gesprek",
|
|
781
|
-
children: /* @__PURE__ */
|
|
865
|
+
children: /* @__PURE__ */ n(le, { className: "gcw-history__item-delete-icon" })
|
|
782
866
|
}
|
|
783
867
|
)
|
|
784
868
|
]
|
|
785
869
|
},
|
|
786
|
-
|
|
870
|
+
h.id
|
|
787
871
|
)) }),
|
|
788
|
-
|
|
789
|
-
|
|
872
|
+
g && /* @__PURE__ */ n(
|
|
873
|
+
ae,
|
|
790
874
|
{
|
|
791
875
|
title: "Gesprek verwijderen",
|
|
792
876
|
message: "Weet je zeker dat je dit gesprek wilt verwijderen? Dit kan niet ongedaan worden gemaakt.",
|
|
793
877
|
confirmLabel: "Verwijderen",
|
|
794
878
|
cancelLabel: "Annuleren",
|
|
795
879
|
variant: "danger",
|
|
796
|
-
onConfirm:
|
|
797
|
-
onCancel: () =>
|
|
880
|
+
onConfirm: b,
|
|
881
|
+
onCancel: () => S(null)
|
|
798
882
|
}
|
|
799
883
|
)
|
|
800
884
|
] });
|
|
801
885
|
}
|
|
802
|
-
function
|
|
886
|
+
function ae({
|
|
803
887
|
title: e,
|
|
804
888
|
message: s,
|
|
805
|
-
confirmLabel:
|
|
889
|
+
confirmLabel: t = "Bevestigen",
|
|
806
890
|
cancelLabel: a = "Annuleren",
|
|
807
891
|
onConfirm: i,
|
|
808
|
-
onCancel:
|
|
809
|
-
variant:
|
|
892
|
+
onCancel: r,
|
|
893
|
+
variant: o = "default"
|
|
810
894
|
}) {
|
|
811
|
-
const
|
|
812
|
-
return
|
|
813
|
-
var
|
|
814
|
-
(
|
|
815
|
-
}, []),
|
|
816
|
-
const
|
|
817
|
-
|
|
895
|
+
const m = O(null), c = O(null);
|
|
896
|
+
return M(() => {
|
|
897
|
+
var d;
|
|
898
|
+
(d = c.current) == null || d.focus();
|
|
899
|
+
}, []), M(() => {
|
|
900
|
+
const d = (g) => {
|
|
901
|
+
g.key === "Escape" && r();
|
|
818
902
|
};
|
|
819
|
-
return document.addEventListener("keydown",
|
|
820
|
-
}, [
|
|
821
|
-
|
|
822
|
-
}, children: /* @__PURE__ */
|
|
823
|
-
/* @__PURE__ */
|
|
824
|
-
/* @__PURE__ */
|
|
825
|
-
/* @__PURE__ */
|
|
826
|
-
/* @__PURE__ */
|
|
827
|
-
/* @__PURE__ */
|
|
903
|
+
return document.addEventListener("keydown", d), () => document.removeEventListener("keydown", d);
|
|
904
|
+
}, [r]), /* @__PURE__ */ n("div", { className: "gcw-modal-overlay", ref: m, onClick: (d) => {
|
|
905
|
+
d.target === m.current && r();
|
|
906
|
+
}, children: /* @__PURE__ */ u("div", { className: "gcw-modal", role: "dialog", "aria-modal": "true", "aria-labelledby": "gcw-modal-title", children: [
|
|
907
|
+
/* @__PURE__ */ n("h4", { className: "gcw-modal__title", id: "gcw-modal-title", children: e }),
|
|
908
|
+
/* @__PURE__ */ n("p", { className: "gcw-modal__message", children: s }),
|
|
909
|
+
/* @__PURE__ */ u("div", { className: "gcw-modal__actions", children: [
|
|
910
|
+
/* @__PURE__ */ n("button", { className: "gcw-modal__btn gcw-modal__btn--cancel", onClick: r, children: a }),
|
|
911
|
+
/* @__PURE__ */ n(
|
|
828
912
|
"button",
|
|
829
913
|
{
|
|
830
|
-
className: `gcw-modal__btn gcw-modal__btn--confirm ${
|
|
914
|
+
className: `gcw-modal__btn gcw-modal__btn--confirm ${o === "danger" ? "gcw-modal__btn--danger" : ""}`,
|
|
831
915
|
onClick: i,
|
|
832
916
|
ref: c,
|
|
833
|
-
children:
|
|
917
|
+
children: t
|
|
834
918
|
}
|
|
835
919
|
)
|
|
836
920
|
] })
|
|
837
921
|
] }) });
|
|
838
922
|
}
|
|
839
|
-
function
|
|
923
|
+
function Ye({ content: e, className: s }) {
|
|
840
924
|
if (!e) return null;
|
|
841
|
-
const
|
|
842
|
-
return /* @__PURE__ */
|
|
925
|
+
const t = qe(e);
|
|
926
|
+
return /* @__PURE__ */ n("div", { className: s, children: t.map((a, i) => /* @__PURE__ */ n(_e.Fragment, { children: a }, i)) });
|
|
843
927
|
}
|
|
844
|
-
function
|
|
928
|
+
function qe(e) {
|
|
845
929
|
const s = e.split(`
|
|
846
|
-
`),
|
|
930
|
+
`), t = [];
|
|
847
931
|
let a = null;
|
|
848
932
|
const i = () => {
|
|
849
|
-
a && (a.type === "ul" ?
|
|
850
|
-
/* @__PURE__ */
|
|
851
|
-
) :
|
|
852
|
-
/* @__PURE__ */
|
|
933
|
+
a && (a.type === "ul" ? t.push(
|
|
934
|
+
/* @__PURE__ */ n("ul", { className: "gcw-md-list gcw-md-list--ul", children: a.items.map((r, o) => /* @__PURE__ */ n("li", { className: "gcw-md-list__item", children: r }, o)) }, `list-${t.length}`)
|
|
935
|
+
) : t.push(
|
|
936
|
+
/* @__PURE__ */ n("ol", { className: "gcw-md-list gcw-md-list--ol", children: a.items.map((r, o) => /* @__PURE__ */ n("li", { className: "gcw-md-list__item", children: r }, o)) }, `list-${t.length}`)
|
|
853
937
|
), a = null);
|
|
854
938
|
};
|
|
855
|
-
for (let
|
|
856
|
-
const
|
|
857
|
-
if (
|
|
858
|
-
i(),
|
|
859
|
-
/* @__PURE__ */
|
|
939
|
+
for (let r = 0; r < s.length; r++) {
|
|
940
|
+
const o = s[r];
|
|
941
|
+
if (o.startsWith("#### ")) {
|
|
942
|
+
i(), t.push(
|
|
943
|
+
/* @__PURE__ */ n("h5", { className: "gcw-md-heading gcw-md-heading--h5", children: G(o.slice(5)) }, r)
|
|
860
944
|
);
|
|
861
945
|
continue;
|
|
862
946
|
}
|
|
863
|
-
if (
|
|
864
|
-
i(),
|
|
865
|
-
/* @__PURE__ */
|
|
947
|
+
if (o.startsWith("### ")) {
|
|
948
|
+
i(), t.push(
|
|
949
|
+
/* @__PURE__ */ n("h4", { className: "gcw-md-heading gcw-md-heading--h4", children: G(o.slice(4)) }, r)
|
|
866
950
|
);
|
|
867
951
|
continue;
|
|
868
952
|
}
|
|
869
|
-
if (
|
|
870
|
-
i(),
|
|
871
|
-
/* @__PURE__ */
|
|
953
|
+
if (o.startsWith("## ")) {
|
|
954
|
+
i(), t.push(
|
|
955
|
+
/* @__PURE__ */ n("h3", { className: "gcw-md-heading gcw-md-heading--h3", children: G(o.slice(3)) }, r)
|
|
872
956
|
);
|
|
873
957
|
continue;
|
|
874
958
|
}
|
|
875
|
-
if (
|
|
876
|
-
i(),
|
|
877
|
-
/* @__PURE__ */
|
|
959
|
+
if (o.startsWith("# ")) {
|
|
960
|
+
i(), t.push(
|
|
961
|
+
/* @__PURE__ */ n("h2", { className: "gcw-md-heading gcw-md-heading--h2", children: G(o.slice(2)) }, r)
|
|
878
962
|
);
|
|
879
963
|
continue;
|
|
880
964
|
}
|
|
881
|
-
const
|
|
882
|
-
if (
|
|
883
|
-
(!a || a.type !== "ul") && (i(), a = { type: "ul", items: [] }), a.items.push(
|
|
965
|
+
const m = o.match(/^[\s]*[-*•]\s+(.+)/);
|
|
966
|
+
if (m) {
|
|
967
|
+
(!a || a.type !== "ul") && (i(), a = { type: "ul", items: [] }), a.items.push(G(m[1]));
|
|
884
968
|
continue;
|
|
885
969
|
}
|
|
886
|
-
const c =
|
|
970
|
+
const c = o.match(/^[\s]*(\d+)[.)]\s+(.+)/);
|
|
887
971
|
if (c) {
|
|
888
|
-
(!a || a.type !== "ol") && (i(), a = { type: "ol", items: [] }), a.items.push(
|
|
972
|
+
(!a || a.type !== "ol") && (i(), a = { type: "ol", items: [] }), a.items.push(G(c[2]));
|
|
889
973
|
continue;
|
|
890
974
|
}
|
|
891
|
-
if (
|
|
975
|
+
if (o.startsWith("```")) {
|
|
892
976
|
i();
|
|
893
977
|
const l = [];
|
|
894
|
-
for (
|
|
895
|
-
l.push(s[
|
|
896
|
-
|
|
897
|
-
/* @__PURE__ */
|
|
898
|
-
`) }) }, `code-${
|
|
978
|
+
for (r++; r < s.length && !s[r].startsWith("```"); )
|
|
979
|
+
l.push(s[r]), r++;
|
|
980
|
+
t.push(
|
|
981
|
+
/* @__PURE__ */ n("pre", { className: "gcw-md-code-block", children: /* @__PURE__ */ n("code", { children: l.join(`
|
|
982
|
+
`) }) }, `code-${t.length}`)
|
|
899
983
|
);
|
|
900
984
|
continue;
|
|
901
985
|
}
|
|
902
|
-
if (
|
|
986
|
+
if (o.trim() === "") {
|
|
903
987
|
i();
|
|
904
988
|
continue;
|
|
905
989
|
}
|
|
906
|
-
i(),
|
|
907
|
-
/* @__PURE__ */
|
|
990
|
+
i(), t.push(
|
|
991
|
+
/* @__PURE__ */ n("p", { className: "gcw-md-paragraph", children: G(o) }, r)
|
|
908
992
|
);
|
|
909
993
|
}
|
|
910
|
-
return i(),
|
|
994
|
+
return i(), t;
|
|
911
995
|
}
|
|
912
|
-
function
|
|
996
|
+
function G(e) {
|
|
913
997
|
if (!e) return null;
|
|
914
998
|
const s = [];
|
|
915
|
-
let
|
|
916
|
-
for (;
|
|
917
|
-
const i =
|
|
999
|
+
let t = e, a = 0;
|
|
1000
|
+
for (; t.length > 0; ) {
|
|
1001
|
+
const i = t.match(/^\*\*(.+?)\*\*/);
|
|
918
1002
|
if (i) {
|
|
919
|
-
s.push(/* @__PURE__ */
|
|
1003
|
+
s.push(/* @__PURE__ */ n("strong", { className: "gcw-md-bold", children: i[1] }, a++)), t = t.slice(i[0].length);
|
|
920
1004
|
continue;
|
|
921
1005
|
}
|
|
922
|
-
const
|
|
923
|
-
if (
|
|
924
|
-
s.push(/* @__PURE__ */
|
|
1006
|
+
const r = t.match(/^\*([^*]+?)\*/);
|
|
1007
|
+
if (r) {
|
|
1008
|
+
s.push(/* @__PURE__ */ n("em", { className: "gcw-md-italic", children: r[1] }, a++)), t = t.slice(r[0].length);
|
|
925
1009
|
continue;
|
|
926
1010
|
}
|
|
927
|
-
const
|
|
928
|
-
if (
|
|
1011
|
+
const o = t.match(/^`([^`]+)`/);
|
|
1012
|
+
if (o) {
|
|
929
1013
|
s.push(
|
|
930
|
-
/* @__PURE__ */
|
|
931
|
-
),
|
|
1014
|
+
/* @__PURE__ */ n("code", { className: "gcw-md-code", children: o[1] }, a++)
|
|
1015
|
+
), t = t.slice(o[0].length);
|
|
932
1016
|
continue;
|
|
933
1017
|
}
|
|
934
|
-
const
|
|
935
|
-
if (
|
|
1018
|
+
const m = t.match(/^\[([^\]]+)\]\(([^)]+)\)/);
|
|
1019
|
+
if (m) {
|
|
936
1020
|
s.push(
|
|
937
|
-
/* @__PURE__ */
|
|
1021
|
+
/* @__PURE__ */ n(
|
|
938
1022
|
"a",
|
|
939
1023
|
{
|
|
940
|
-
href:
|
|
1024
|
+
href: m[2],
|
|
941
1025
|
target: "_blank",
|
|
942
1026
|
rel: "noopener noreferrer",
|
|
943
1027
|
className: "gcw-md-link",
|
|
944
|
-
children:
|
|
1028
|
+
children: m[1]
|
|
945
1029
|
},
|
|
946
1030
|
a++
|
|
947
1031
|
)
|
|
948
|
-
),
|
|
1032
|
+
), t = t.slice(m[0].length);
|
|
949
1033
|
continue;
|
|
950
1034
|
}
|
|
951
|
-
const c =
|
|
1035
|
+
const c = t.search(/[\*`\[]/);
|
|
952
1036
|
if (c === -1) {
|
|
953
|
-
s.push(
|
|
1037
|
+
s.push(t);
|
|
954
1038
|
break;
|
|
955
|
-
} else c === 0 ? (s.push(
|
|
1039
|
+
} else c === 0 ? (s.push(t[0]), t = t.slice(1)) : (s.push(t.slice(0, c)), t = t.slice(c));
|
|
956
1040
|
}
|
|
957
1041
|
return s.length === 1 ? s[0] : s;
|
|
958
1042
|
}
|
|
959
|
-
function
|
|
960
|
-
const s = e.messages.map((
|
|
961
|
-
...
|
|
962
|
-
timestamp:
|
|
1043
|
+
function Ze(e) {
|
|
1044
|
+
const s = e.messages.map((t) => ({
|
|
1045
|
+
...t,
|
|
1046
|
+
timestamp: t.timestamp.toISOString()
|
|
963
1047
|
}));
|
|
964
1048
|
return `
|
|
965
1049
|
<!DOCTYPE html>
|
|
@@ -967,7 +1051,7 @@ function Ae(e) {
|
|
|
967
1051
|
<head>
|
|
968
1052
|
<meta charset="UTF-8">
|
|
969
1053
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
970
|
-
<title>${
|
|
1054
|
+
<title>${Z(e.title)}</title>
|
|
971
1055
|
<style>
|
|
972
1056
|
* { margin: 0; padding: 0; box-sizing: border-box; }
|
|
973
1057
|
html, body, #chat-root { height: 100%; width: 100%; }
|
|
@@ -1242,8 +1326,8 @@ function Ae(e) {
|
|
|
1242
1326
|
</svg>
|
|
1243
1327
|
</div>
|
|
1244
1328
|
<div class="popout-header-info">
|
|
1245
|
-
<div class="popout-title">${
|
|
1246
|
-
<div class="popout-subtitle">${
|
|
1329
|
+
<div class="popout-title">${Z(e.title)}</div>
|
|
1330
|
+
<div class="popout-subtitle">${Z(e.subtitle)}</div>
|
|
1247
1331
|
</div>
|
|
1248
1332
|
</div>
|
|
1249
1333
|
<div class="popout-messages" id="messages-container"></div>
|
|
@@ -1252,7 +1336,7 @@ function Ae(e) {
|
|
|
1252
1336
|
<textarea
|
|
1253
1337
|
class="popout-textarea"
|
|
1254
1338
|
id="message-input"
|
|
1255
|
-
placeholder="${
|
|
1339
|
+
placeholder="${Z(e.placeholder)}"
|
|
1256
1340
|
rows="1"
|
|
1257
1341
|
></textarea>
|
|
1258
1342
|
<button
|
|
@@ -1276,8 +1360,19 @@ function Ae(e) {
|
|
|
1276
1360
|
tenantId: e.tenantId,
|
|
1277
1361
|
sessionId: e.sessionId,
|
|
1278
1362
|
primaryColor: e.primaryColor,
|
|
1279
|
-
|
|
1363
|
+
tokenStorageKey: e.tokenStorageKey || "geoapps-token"
|
|
1280
1364
|
})};
|
|
1365
|
+
|
|
1366
|
+
function getAuthHeaders() {
|
|
1367
|
+
try {
|
|
1368
|
+
const raw = window.opener?.sessionStorage?.getItem(config.tokenStorageKey)
|
|
1369
|
+
|| sessionStorage.getItem(config.tokenStorageKey);
|
|
1370
|
+
if (!raw) return {};
|
|
1371
|
+
const token = JSON.parse(raw);
|
|
1372
|
+
if (token?.access_token) return { Authorization: 'Bearer ' + token.access_token };
|
|
1373
|
+
} catch (e) {}
|
|
1374
|
+
return {};
|
|
1375
|
+
}
|
|
1281
1376
|
|
|
1282
1377
|
const STORAGE_KEY = 'gcw_chat_' + (config.tenantId || 'default');
|
|
1283
1378
|
|
|
@@ -1447,7 +1542,7 @@ function Ae(e) {
|
|
|
1447
1542
|
headers: {
|
|
1448
1543
|
'Content-Type': 'application/json',
|
|
1449
1544
|
...(config.tenantId && { 'X-Tenant-ID': config.tenantId }),
|
|
1450
|
-
...
|
|
1545
|
+
...getAuthHeaders()
|
|
1451
1546
|
},
|
|
1452
1547
|
body: JSON.stringify({
|
|
1453
1548
|
message: content.trim(),
|
|
@@ -1531,199 +1626,184 @@ function Ae(e) {
|
|
|
1531
1626
|
</html>
|
|
1532
1627
|
`;
|
|
1533
1628
|
}
|
|
1534
|
-
function
|
|
1629
|
+
function Z(e) {
|
|
1535
1630
|
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
1536
1631
|
}
|
|
1537
|
-
function
|
|
1538
|
-
return /* @__PURE__ */
|
|
1539
|
-
/* @__PURE__ */
|
|
1540
|
-
/* @__PURE__ */
|
|
1541
|
-
/* @__PURE__ */
|
|
1632
|
+
function Qe() {
|
|
1633
|
+
return /* @__PURE__ */ n("div", { className: "gcw-typing", children: /* @__PURE__ */ n("div", { className: "gcw-typing__bubble", children: /* @__PURE__ */ u("div", { className: "gcw-typing__dots", children: [
|
|
1634
|
+
/* @__PURE__ */ n("span", { className: "gcw-typing__dot" }),
|
|
1635
|
+
/* @__PURE__ */ n("span", { className: "gcw-typing__dot" }),
|
|
1636
|
+
/* @__PURE__ */ n("span", { className: "gcw-typing__dot" })
|
|
1542
1637
|
] }) }) });
|
|
1543
1638
|
}
|
|
1544
|
-
const
|
|
1639
|
+
const et = {
|
|
1545
1640
|
small: "Klein",
|
|
1546
1641
|
medium: "Middel",
|
|
1547
1642
|
large: "Groot",
|
|
1548
1643
|
fullscreen: "Volledig scherm"
|
|
1549
1644
|
};
|
|
1550
|
-
function
|
|
1551
|
-
const [
|
|
1552
|
-
|
|
1553
|
-
if (!
|
|
1554
|
-
const
|
|
1555
|
-
c.current && !c.current.contains(
|
|
1556
|
-
},
|
|
1557
|
-
document.addEventListener("click",
|
|
1645
|
+
function tt({ size: e, onCycleSize: s, onPopout: t, onClear: a, onNewSession: i, onShowHistory: r }) {
|
|
1646
|
+
const [o, m] = v(!1), c = O(null);
|
|
1647
|
+
M(() => {
|
|
1648
|
+
if (!o) return;
|
|
1649
|
+
const d = (S) => {
|
|
1650
|
+
c.current && !c.current.contains(S.target) && m(!1);
|
|
1651
|
+
}, g = setTimeout(() => {
|
|
1652
|
+
document.addEventListener("click", d);
|
|
1558
1653
|
}, 0);
|
|
1559
1654
|
return () => {
|
|
1560
|
-
clearTimeout(
|
|
1655
|
+
clearTimeout(g), document.removeEventListener("click", d);
|
|
1561
1656
|
};
|
|
1562
|
-
}, [
|
|
1563
|
-
if (!
|
|
1564
|
-
const
|
|
1565
|
-
|
|
1657
|
+
}, [o]), M(() => {
|
|
1658
|
+
if (!o) return;
|
|
1659
|
+
const d = (g) => {
|
|
1660
|
+
g.key === "Escape" && m(!1);
|
|
1566
1661
|
};
|
|
1567
|
-
return document.addEventListener("keydown",
|
|
1568
|
-
}, [
|
|
1569
|
-
const l = (
|
|
1570
|
-
|
|
1662
|
+
return document.addEventListener("keydown", d), () => document.removeEventListener("keydown", d);
|
|
1663
|
+
}, [o]);
|
|
1664
|
+
const l = (d) => {
|
|
1665
|
+
d(), m(!1);
|
|
1571
1666
|
};
|
|
1572
|
-
return /* @__PURE__ */
|
|
1573
|
-
/* @__PURE__ */
|
|
1667
|
+
return /* @__PURE__ */ u("div", { className: "gcw-header-menu", ref: c, children: [
|
|
1668
|
+
/* @__PURE__ */ n(
|
|
1574
1669
|
"button",
|
|
1575
1670
|
{
|
|
1576
|
-
onClick: () =>
|
|
1671
|
+
onClick: () => m(!o),
|
|
1577
1672
|
className: "gcw-header__btn",
|
|
1578
1673
|
title: "Menu",
|
|
1579
|
-
"aria-expanded":
|
|
1674
|
+
"aria-expanded": o,
|
|
1580
1675
|
"aria-haspopup": "true",
|
|
1581
|
-
children: /* @__PURE__ */
|
|
1582
|
-
/* @__PURE__ */
|
|
1583
|
-
/* @__PURE__ */
|
|
1584
|
-
/* @__PURE__ */
|
|
1676
|
+
children: /* @__PURE__ */ u("svg", { className: "gcw-header__btn-icon", fill: "currentColor", viewBox: "0 0 24 24", children: [
|
|
1677
|
+
/* @__PURE__ */ n("circle", { cx: "12", cy: "5", r: "2" }),
|
|
1678
|
+
/* @__PURE__ */ n("circle", { cx: "12", cy: "12", r: "2" }),
|
|
1679
|
+
/* @__PURE__ */ n("circle", { cx: "12", cy: "19", r: "2" })
|
|
1585
1680
|
] })
|
|
1586
1681
|
}
|
|
1587
1682
|
),
|
|
1588
|
-
|
|
1589
|
-
/* @__PURE__ */
|
|
1683
|
+
o && /* @__PURE__ */ u("div", { className: "gcw-header-menu__dropdown", role: "menu", children: [
|
|
1684
|
+
/* @__PURE__ */ u(
|
|
1590
1685
|
"button",
|
|
1591
1686
|
{
|
|
1592
1687
|
className: "gcw-header-menu__item",
|
|
1593
1688
|
onClick: () => l(i),
|
|
1594
1689
|
role: "menuitem",
|
|
1595
1690
|
children: [
|
|
1596
|
-
/* @__PURE__ */
|
|
1597
|
-
/* @__PURE__ */
|
|
1691
|
+
/* @__PURE__ */ n(ce, { className: "gcw-header-menu__icon" }),
|
|
1692
|
+
/* @__PURE__ */ n("span", { children: "Nieuwe chat" })
|
|
1598
1693
|
]
|
|
1599
1694
|
}
|
|
1600
1695
|
),
|
|
1601
|
-
/* @__PURE__ */
|
|
1696
|
+
/* @__PURE__ */ u(
|
|
1602
1697
|
"button",
|
|
1603
1698
|
{
|
|
1604
1699
|
className: "gcw-header-menu__item",
|
|
1605
|
-
onClick: () => l(
|
|
1700
|
+
onClick: () => l(r),
|
|
1606
1701
|
role: "menuitem",
|
|
1607
1702
|
children: [
|
|
1608
|
-
/* @__PURE__ */
|
|
1609
|
-
/* @__PURE__ */
|
|
1703
|
+
/* @__PURE__ */ n(it, { className: "gcw-header-menu__icon" }),
|
|
1704
|
+
/* @__PURE__ */ n("span", { children: "Chat geschiedenis" })
|
|
1610
1705
|
]
|
|
1611
1706
|
}
|
|
1612
1707
|
),
|
|
1613
|
-
/* @__PURE__ */
|
|
1614
|
-
/* @__PURE__ */
|
|
1708
|
+
/* @__PURE__ */ n("div", { className: "gcw-header-menu__divider" }),
|
|
1709
|
+
/* @__PURE__ */ u(
|
|
1615
1710
|
"button",
|
|
1616
1711
|
{
|
|
1617
1712
|
className: "gcw-header-menu__item",
|
|
1618
1713
|
onClick: () => l(s),
|
|
1619
1714
|
role: "menuitem",
|
|
1620
1715
|
children: [
|
|
1621
|
-
/* @__PURE__ */
|
|
1622
|
-
/* @__PURE__ */
|
|
1716
|
+
/* @__PURE__ */ n(nt, { size: e, className: "gcw-header-menu__icon" }),
|
|
1717
|
+
/* @__PURE__ */ u("span", { children: [
|
|
1623
1718
|
"Grootte: ",
|
|
1624
|
-
|
|
1719
|
+
et[e]
|
|
1625
1720
|
] })
|
|
1626
1721
|
]
|
|
1627
1722
|
}
|
|
1628
1723
|
),
|
|
1629
|
-
/* @__PURE__ */
|
|
1724
|
+
/* @__PURE__ */ u(
|
|
1630
1725
|
"button",
|
|
1631
1726
|
{
|
|
1632
1727
|
className: "gcw-header-menu__item",
|
|
1633
|
-
onClick: () => l(
|
|
1728
|
+
onClick: () => l(t),
|
|
1634
1729
|
role: "menuitem",
|
|
1635
1730
|
children: [
|
|
1636
|
-
/* @__PURE__ */
|
|
1637
|
-
/* @__PURE__ */
|
|
1731
|
+
/* @__PURE__ */ n(st, { className: "gcw-header-menu__icon" }),
|
|
1732
|
+
/* @__PURE__ */ n("span", { children: "Open in nieuw venster" })
|
|
1638
1733
|
]
|
|
1639
1734
|
}
|
|
1640
1735
|
),
|
|
1641
|
-
/* @__PURE__ */
|
|
1642
|
-
/* @__PURE__ */
|
|
1736
|
+
/* @__PURE__ */ n("div", { className: "gcw-header-menu__divider" }),
|
|
1737
|
+
/* @__PURE__ */ u(
|
|
1643
1738
|
"button",
|
|
1644
1739
|
{
|
|
1645
1740
|
className: "gcw-header-menu__item gcw-header-menu__item--danger",
|
|
1646
1741
|
onClick: () => l(a),
|
|
1647
1742
|
role: "menuitem",
|
|
1648
1743
|
children: [
|
|
1649
|
-
/* @__PURE__ */
|
|
1650
|
-
/* @__PURE__ */
|
|
1744
|
+
/* @__PURE__ */ n(le, { className: "gcw-header-menu__icon" }),
|
|
1745
|
+
/* @__PURE__ */ n("span", { children: "Chat verwijderen" })
|
|
1651
1746
|
]
|
|
1652
1747
|
}
|
|
1653
1748
|
)
|
|
1654
1749
|
] })
|
|
1655
1750
|
] });
|
|
1656
1751
|
}
|
|
1657
|
-
function
|
|
1658
|
-
|
|
1659
|
-
case "small":
|
|
1660
|
-
return /* @__PURE__ */ t("svg", { className: s, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ t("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5l-5-5m5 5v-4m0 4h-4" }) });
|
|
1661
|
-
case "medium":
|
|
1662
|
-
return /* @__PURE__ */ t("svg", { className: s, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ t("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5l-5-5m5 5v-4m0 4h-4" }) });
|
|
1663
|
-
case "large":
|
|
1664
|
-
return /* @__PURE__ */ t("svg", { className: s, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ t("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5l-5-5m5 5v-4m0 4h-4" }) });
|
|
1665
|
-
case "fullscreen":
|
|
1666
|
-
return /* @__PURE__ */ t("svg", { className: s, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ t("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 9V4.5M9 9H4.5M9 9L3.75 3.75M9 15v4.5M9 15H4.5M9 15l-5.25 5.25M15 9h4.5M15 9V4.5M15 9l5.25-5.25M15 15h4.5M15 15v4.5m0-4.5l5.25 5.25" }) });
|
|
1667
|
-
}
|
|
1668
|
-
}
|
|
1669
|
-
function tt({ className: e = "gcw-w-4 gcw-h-4" }) {
|
|
1670
|
-
return /* @__PURE__ */ t("svg", { className: e, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ t("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5l-5-5m5 5v-4m0 4h-4" }) });
|
|
1671
|
-
}
|
|
1672
|
-
function nt({ className: e = "gcw-w-4 gcw-h-4" }) {
|
|
1673
|
-
return /* @__PURE__ */ t("svg", { className: e, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ t("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 9V4.5M9 9H4.5M9 9L3.75 3.75M9 15v4.5M9 15H4.5M9 15l-5.25 5.25M15 9h4.5M15 9V4.5M15 9l5.25-5.25M15 15h4.5M15 15v4.5m0-4.5l5.25 5.25" }) });
|
|
1752
|
+
function nt({ size: e, className: s }) {
|
|
1753
|
+
return /* @__PURE__ */ n("svg", { className: s, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: e === "fullscreen" ? "M9 9V4.5M9 9H4.5M9 9L3.75 3.75M9 15v4.5M9 15H4.5M9 15l-5.25 5.25M15 9h4.5M15 9V4.5M15 9l5.25-5.25M15 15h4.5M15 15v4.5m0-4.5l5.25 5.25" : "M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5l-5-5m5 5v-4m0 4h-4" }) });
|
|
1674
1754
|
}
|
|
1675
|
-
function
|
|
1676
|
-
return /* @__PURE__ */
|
|
1755
|
+
function st({ className: e }) {
|
|
1756
|
+
return /* @__PURE__ */ n("svg", { className: e, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14" }) });
|
|
1677
1757
|
}
|
|
1678
|
-
function
|
|
1679
|
-
return /* @__PURE__ */
|
|
1758
|
+
function ot({ className: e }) {
|
|
1759
|
+
return /* @__PURE__ */ n("svg", { className: e, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) });
|
|
1680
1760
|
}
|
|
1681
|
-
function
|
|
1682
|
-
return /* @__PURE__ */
|
|
1761
|
+
function le({ className: e }) {
|
|
1762
|
+
return /* @__PURE__ */ n("svg", { className: e, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16" }) });
|
|
1683
1763
|
}
|
|
1684
|
-
function
|
|
1685
|
-
return /* @__PURE__ */
|
|
1764
|
+
function rt({ className: e }) {
|
|
1765
|
+
return /* @__PURE__ */ n("svg", { className: e, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M8 10h.01M12 10h.01M16 10h.01M9 16H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-5l-5 5v-5z" }) });
|
|
1686
1766
|
}
|
|
1687
|
-
function
|
|
1688
|
-
return /* @__PURE__ */
|
|
1767
|
+
function ce({ className: e }) {
|
|
1768
|
+
return /* @__PURE__ */ n("svg", { className: e, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z" }) });
|
|
1689
1769
|
}
|
|
1690
|
-
function
|
|
1691
|
-
return /* @__PURE__ */
|
|
1770
|
+
function it({ className: e }) {
|
|
1771
|
+
return /* @__PURE__ */ n("svg", { className: e, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z" }) });
|
|
1692
1772
|
}
|
|
1693
|
-
function
|
|
1694
|
-
return /* @__PURE__ */
|
|
1773
|
+
function at({ className: e }) {
|
|
1774
|
+
return /* @__PURE__ */ n("svg", { className: e, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M10 19l-7-7m0 0l7-7m-7 7h18" }) });
|
|
1695
1775
|
}
|
|
1696
1776
|
export {
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1777
|
+
at as ArrowLeftIcon,
|
|
1778
|
+
Ge as ChatBubble,
|
|
1779
|
+
rt as ChatIcon,
|
|
1780
|
+
dt as ChatWidget,
|
|
1781
|
+
Pe as ChatWindow,
|
|
1782
|
+
ot as CloseIcon,
|
|
1783
|
+
ae as ConfirmModal,
|
|
1784
|
+
tt as HeaderMenu,
|
|
1785
|
+
it as HistoryIcon,
|
|
1786
|
+
Ye as MarkdownRenderer,
|
|
1787
|
+
Ve as MessageInput,
|
|
1788
|
+
Ke as MessageList,
|
|
1789
|
+
ce as NewChatIcon,
|
|
1790
|
+
st as PopoutIcon,
|
|
1791
|
+
nt as ResizeIcon,
|
|
1792
|
+
Xe as SessionHistory,
|
|
1793
|
+
Ue as ToggleButton,
|
|
1794
|
+
le as TrashIcon,
|
|
1795
|
+
Qe as TypingIndicator,
|
|
1796
|
+
P as clearSession,
|
|
1797
|
+
U as getAuthHeaders,
|
|
1798
|
+
Ze as getPopoutHTML,
|
|
1799
|
+
Le as loadPopoutState,
|
|
1800
|
+
Ee as loadSeenAssistantCount,
|
|
1801
|
+
Ie as loadSessionId,
|
|
1802
|
+
Y as savePopoutState,
|
|
1803
|
+
q as saveSeenAssistantCount,
|
|
1804
|
+
Me as saveSessionId,
|
|
1805
|
+
Ce as subscribeToSessionChanges,
|
|
1806
|
+
je as useAuth,
|
|
1807
|
+
De as useChat,
|
|
1808
|
+
ze as usePopout
|
|
1729
1809
|
};
|