@quidgest/chatbot 0.6.4 → 0.6.5

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/index.js CHANGED
@@ -5,7 +5,7 @@
5
5
  * focus-trap 7.6.4
6
6
  * @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
7
7
  */function De(t,o){(o==null||o>t.length)&&(o=t.length);for(var n=0,a=Array(o);n<o;n++)a[n]=t[n];return a}function Pn(t){if(Array.isArray(t))return De(t)}function Fn(t,o,n){return(o=Gn(o))in t?Object.defineProperty(t,o,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[o]=n,t}function On(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function Un(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
8
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ot(t,o){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);o&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).enumerable})),n.push.apply(n,a)}return n}function at(t){for(var o=1;o<arguments.length;o++){var n=arguments[o]!=null?arguments[o]:{};o%2?ot(Object(n),!0).forEach(function(a){Fn(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ot(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}function zn(t){return Pn(t)||On(t)||Hn(t)||Un()}function jn(t,o){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var a=n.call(t,o);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(o==="string"?String:Number)(t)}function Gn(t){var o=jn(t,"string");return typeof o=="symbol"?o:o+""}function Hn(t,o){if(t){if(typeof t=="string")return De(t,o);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?De(t,o):void 0}}var rt={activateTrap:function(t,o){if(t.length>0){var n=t[t.length-1];n!==o&&n._setPausedState(!0)}var a=t.indexOf(o);a===-1||t.splice(a,1),t.push(o)},deactivateTrap:function(t,o){var n=t.indexOf(o);n!==-1&&t.splice(n,1),t.length>0&&!t[t.length-1]._isManuallyPaused()&&t[t.length-1]._setPausedState(!1)}},Zn=function(t){return t.tagName&&t.tagName.toLowerCase()==="input"&&typeof t.select=="function"},Qn=function(t){return(t==null?void 0:t.key)==="Escape"||(t==null?void 0:t.key)==="Esc"||(t==null?void 0:t.keyCode)===27},pe=function(t){return(t==null?void 0:t.key)==="Tab"||(t==null?void 0:t.keyCode)===9},Wn=function(t){return pe(t)&&!t.shiftKey},Jn=function(t){return pe(t)&&t.shiftKey},lt=function(t){return setTimeout(t,0)},fe=function(t){for(var o=arguments.length,n=new Array(o>1?o-1:0),a=1;a<o;a++)n[a-1]=arguments[a];return typeof t=="function"?t.apply(void 0,n):t},ye=function(t){return t.target.shadowRoot&&typeof t.composedPath=="function"?t.composedPath()[0]:t.target},Yn=[],Xn=function(t,o){var n=(o==null?void 0:o.document)||document,a=(o==null?void 0:o.trapStack)||Yn,l=at({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:Wn,isKeyBackward:Jn},o),r={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,manuallyPaused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},i,s=function(f,h,k){return f&&f[h]!==void 0?f[h]:l[k||h]},d=function(f,h){var k=typeof(h==null?void 0:h.composedPath)=="function"?h.composedPath():void 0;return r.containerGroups.findIndex(function(I){var $=I.container,E=I.tabbableNodes;return $.contains(f)||(k==null?void 0:k.includes($))||E.find(function(C){return C===f})})},u=function(f){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},k=h.hasFallback,I=k===void 0?!1:k,$=h.params,E=$===void 0?[]:$,C=l[f];if(typeof C=="function"&&(C=C.apply(void 0,zn(E))),C===!0&&(C=void 0),!C){if(C===void 0||C===!1)return C;throw new Error("`".concat(f,"` was specified but was not a node, or did not return a node"))}var R=C;if(typeof C=="string"){try{R=n.querySelector(C)}catch(V){throw new Error("`".concat(f,'` appears to be an invalid selector; error="').concat(V.message,'"'))}if(!R&&!I)throw new Error("`".concat(f,"` as selector refers to no known node"))}return R},p=function(){var f=u("initialFocus",{hasFallback:!0});if(f===!1)return!1;if(f===void 0||f&&!Ie(f,l.tabbableOptions))if(d(n.activeElement)>=0)f=n.activeElement;else{var h=r.tabbableGroups[0],k=h&&h.firstTabbableNode;f=k||u("fallbackFocus")}else f===null&&(f=u("fallbackFocus"));if(!f)throw new Error("Your focus-trap needs to have at least one focusable element");return f},c=function(){if(r.containerGroups=r.containers.map(function(f){var h=Mn(f,l.tabbableOptions),k=Tn(f,l.tabbableOptions),I=h.length>0?h[0]:void 0,$=h.length>0?h[h.length-1]:void 0,E=k.find(function(V){return se(V)}),C=k.slice().reverse().find(function(V){return se(V)}),R=!!h.find(function(V){return ne(V)>0});return{container:f,tabbableNodes:h,focusableNodes:k,posTabIndexesFound:R,firstTabbableNode:I,lastTabbableNode:$,firstDomTabbableNode:E,lastDomTabbableNode:C,nextTabbableNode:function(V){var H=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,J=h.indexOf(V);return J<0?H?k.slice(k.indexOf(V)+1).find(function(j){return se(j)}):k.slice(0,k.indexOf(V)).reverse().find(function(j){return se(j)}):h[J+(H?1:-1)]}}}),r.tabbableGroups=r.containerGroups.filter(function(f){return f.tabbableNodes.length>0}),r.tabbableGroups.length<=0&&!u("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(r.containerGroups.find(function(f){return f.posTabIndexesFound})&&r.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},y=function(f){var h=f.activeElement;if(h)return h.shadowRoot&&h.shadowRoot.activeElement!==null?y(h.shadowRoot):h},m=function(f){if(f!==!1&&f!==y(document)){if(!f||!f.focus){m(p());return}f.focus({preventScroll:!!l.preventScroll}),r.mostRecentlyFocusedNode=f,Zn(f)&&f.select()}},g=function(f){var h=u("setReturnFocus",{params:[f]});return h||(h===!1?!1:f)},w=function(f){var h=f.target,k=f.event,I=f.isBackward,$=I===void 0?!1:I;h=h||ye(k),c();var E=null;if(r.tabbableGroups.length>0){var C=d(h,k),R=C>=0?r.containerGroups[C]:void 0;if(C<0)$?E=r.tabbableGroups[r.tabbableGroups.length-1].lastTabbableNode:E=r.tabbableGroups[0].firstTabbableNode;else if($){var V=r.tabbableGroups.findIndex(function(ee){var le=ee.firstTabbableNode;return h===le});if(V<0&&(R.container===h||Ie(h,l.tabbableOptions)&&!se(h,l.tabbableOptions)&&!R.nextTabbableNode(h,!1))&&(V=C),V>=0){var H=V===0?r.tabbableGroups.length-1:V-1,J=r.tabbableGroups[H];E=ne(h)>=0?J.lastTabbableNode:J.lastDomTabbableNode}else pe(k)||(E=R.nextTabbableNode(h,!1))}else{var j=r.tabbableGroups.findIndex(function(ee){var le=ee.lastTabbableNode;return h===le});if(j<0&&(R.container===h||Ie(h,l.tabbableOptions)&&!se(h,l.tabbableOptions)&&!R.nextTabbableNode(h))&&(j=C),j>=0){var re=j===r.tabbableGroups.length-1?0:j+1,K=r.tabbableGroups[re];E=ne(h)>=0?K.firstTabbableNode:K.firstDomTabbableNode}else pe(k)||(E=R.nextTabbableNode(h))}}else E=u("fallbackFocus");return E},A=function(f){var h=ye(f);if(!(d(h,f)>=0)){if(fe(l.clickOutsideDeactivates,f)){i.deactivate({returnFocus:l.returnFocusOnDeactivate});return}fe(l.allowOutsideClick,f)||f.preventDefault()}},T=function(f){var h=ye(f),k=d(h,f)>=0;if(k||h instanceof Document)k&&(r.mostRecentlyFocusedNode=h);else{f.stopImmediatePropagation();var I,$=!0;if(r.mostRecentlyFocusedNode)if(ne(r.mostRecentlyFocusedNode)>0){var E=d(r.mostRecentlyFocusedNode),C=r.containerGroups[E].tabbableNodes;if(C.length>0){var R=C.findIndex(function(V){return V===r.mostRecentlyFocusedNode});R>=0&&(l.isKeyForward(r.recentNavEvent)?R+1<C.length&&(I=C[R+1],$=!1):R-1>=0&&(I=C[R-1],$=!1))}}else r.containerGroups.some(function(V){return V.tabbableNodes.some(function(H){return ne(H)>0})})||($=!1);else $=!1;$&&(I=w({target:r.mostRecentlyFocusedNode,isBackward:l.isKeyBackward(r.recentNavEvent)})),m(I||r.mostRecentlyFocusedNode||p())}r.recentNavEvent=void 0},q=function(f){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;r.recentNavEvent=f;var k=w({event:f,isBackward:h});k&&(pe(f)&&f.preventDefault(),m(k))},_=function(f){(l.isKeyForward(f)||l.isKeyBackward(f))&&q(f,l.isKeyBackward(f))},D=function(f){Qn(f)&&fe(l.escapeDeactivates,f)!==!1&&(f.preventDefault(),i.deactivate())},P=function(f){var h=ye(f);d(h,f)>=0||fe(l.clickOutsideDeactivates,f)||fe(l.allowOutsideClick,f)||(f.preventDefault(),f.stopImmediatePropagation())},S=function(){if(r.active)return rt.activateTrap(a,i),r.delayInitialFocusTimer=l.delayInitialFocus?lt(function(){m(p())}):m(p()),n.addEventListener("focusin",T,!0),n.addEventListener("mousedown",A,{capture:!0,passive:!1}),n.addEventListener("touchstart",A,{capture:!0,passive:!1}),n.addEventListener("click",P,{capture:!0,passive:!1}),n.addEventListener("keydown",_,{capture:!0,passive:!1}),n.addEventListener("keydown",D),i},x=function(){if(r.active)return n.removeEventListener("focusin",T,!0),n.removeEventListener("mousedown",A,!0),n.removeEventListener("touchstart",A,!0),n.removeEventListener("click",P,!0),n.removeEventListener("keydown",_,!0),n.removeEventListener("keydown",D),i},N=function(f){var h=f.some(function(k){var I=Array.from(k.removedNodes);return I.some(function($){return $===r.mostRecentlyFocusedNode})});h&&m(p())},Y=typeof window<"u"&&"MutationObserver"in window?new MutationObserver(N):void 0,Q=function(){Y&&(Y.disconnect(),r.active&&!r.paused&&r.containers.map(function(f){Y.observe(f,{subtree:!0,childList:!0})}))};return i={get active(){return r.active},get paused(){return r.paused},activate:function(f){if(r.active)return this;var h=s(f,"onActivate"),k=s(f,"onPostActivate"),I=s(f,"checkCanFocusTrap");I||c(),r.active=!0,r.paused=!1,r.nodeFocusedBeforeActivation=n.activeElement,h==null||h();var $=function(){I&&c(),S(),Q(),k==null||k()};return I?(I(r.containers.concat()).then($,$),this):($(),this)},deactivate:function(f){if(!r.active)return this;var h=at({onDeactivate:l.onDeactivate,onPostDeactivate:l.onPostDeactivate,checkCanReturnFocus:l.checkCanReturnFocus},f);clearTimeout(r.delayInitialFocusTimer),r.delayInitialFocusTimer=void 0,x(),r.active=!1,r.paused=!1,Q(),rt.deactivateTrap(a,i);var k=s(h,"onDeactivate"),I=s(h,"onPostDeactivate"),$=s(h,"checkCanReturnFocus"),E=s(h,"returnFocus","returnFocusOnDeactivate");k==null||k();var C=function(){lt(function(){E&&m(g(r.nodeFocusedBeforeActivation)),I==null||I()})};return E&&$?($(g(r.nodeFocusedBeforeActivation)).then(C,C),this):(C(),this)},pause:function(f){return r.active?(r.manuallyPaused=!0,this._setPausedState(!0,f)):this},unpause:function(f){return r.active?(r.manuallyPaused=!1,a[a.length-1]!==this?this:this._setPausedState(!1,f)):this},updateContainerElements:function(f){var h=[].concat(f).filter(Boolean);return r.containers=h.map(function(k){return typeof k=="string"?n.querySelector(k):k}),r.active&&c(),Q(),this}},Object.defineProperties(i,{_isManuallyPaused:{value:function(){return r.manuallyPaused}},_setPausedState:{value:function(f,h){if(r.paused===f)return this;if(r.paused=f,f){var k=s(h,"onPause"),I=s(h,"onPostPause");k==null||k(),x(),Q(),I==null||I()}else{var $=s(h,"onUnpause"),E=s(h,"onPostUnpause");$==null||$(),c(),S(),Q(),E==null||E()}return this}}}),i.updateContainerElements(t),i};const Kn=e.defineComponent({name:"UseFocusTrap",props:["as","options"],setup(t,{slots:o}){let n;const a=e.ref(),l=()=>n&&n.activate(),r=()=>n&&n.deactivate();return e.watch(()=>Ne(a),i=>{i&&(n=Xn(i,t.options||{}),l())},{flush:"post"}),e.onScopeDispose(()=>r()),()=>{if(o.default)return e.h(t.as||"div",{ref:a},o.default())}}}),eo=U(e.defineComponent({__name:"QFocusTrap",props:e.mergeModels({options:{},as:{}},{disabled:{type:Boolean},disabledModifiers:{}}),emits:["update:disabled"],setup(t){const o=t,n=e.useModel(t,"disabled");return(a,l)=>n.value?e.renderSlot(a.$slots,"default",{key:0}):(e.openBlock(),e.createBlock(e.unref(Kn),e.normalizeProps(e.mergeProps({key:1},o)),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default")]),_:3},16))}})),ce="data-scroll-locked",Ve="right-scroll-bar-position",Le="width-before-scroll-bar",to="with-scroll-bars-hidden",no="--removed-body-scroll-bar-size",oo={left:0,top:0,right:0,gap:0},Re=t=>parseInt(t||"",10)||0,ao=t=>{const o=window.getComputedStyle(document.body),n=o[t==="padding"?"paddingLeft":"marginLeft"],a=o[t==="padding"?"paddingTop":"marginTop"],l=o[t==="padding"?"paddingRight":"marginRight"];return[Re(n),Re(a),Re(l)]},ro=(t="margin")=>{if(typeof window>"u")return oo;const o=ao(t),n=document.documentElement.clientWidth,a=window.innerWidth;return{left:o[0],top:o[1],right:o[2],gap:Math.max(0,a-n+o[2]-o[0])}};function lo(){return document?document.createElement("style"):null}function io(t,o){t.appendChild(document.createTextNode(o))}function so(t){(document.head||document.getElementsByTagName("head")[0]).appendChild(t)}const co=()=>{let t=0,o=null;return{add:n=>{t===0&&(o=lo())&&(io(o,n),so(o)),t++},remove:()=>{var n;t--,!t&&o&&((n=o.parentNode)==null||n.removeChild(o),o=null)}}},uo=U(e.defineComponent({__name:"QRemoveScrollBar",props:{noRelative:{type:Boolean},noImportant:{type:Boolean},gapMode:{default:"margin"}},setup(t){const o=t,n=co(),a=()=>{const r=parseInt(document.body.getAttribute(ce)||"0",10);return isFinite(r)?r:0},l=({left:r,top:i,right:s,gap:d},u,p="margin",c)=>`
8
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ot(t,o){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);o&&(a=a.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).enumerable})),n.push.apply(n,a)}return n}function at(t){for(var o=1;o<arguments.length;o++){var n=arguments[o]!=null?arguments[o]:{};o%2?ot(Object(n),!0).forEach(function(a){Fn(t,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ot(Object(n)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(n,a))})}return t}function zn(t){return Pn(t)||On(t)||Hn(t)||Un()}function jn(t,o){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var a=n.call(t,o);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(o==="string"?String:Number)(t)}function Gn(t){var o=jn(t,"string");return typeof o=="symbol"?o:o+""}function Hn(t,o){if(t){if(typeof t=="string")return De(t,o);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?De(t,o):void 0}}var rt={activateTrap:function(t,o){if(t.length>0){var n=t[t.length-1];n!==o&&n._setPausedState(!0)}var a=t.indexOf(o);a===-1||t.splice(a,1),t.push(o)},deactivateTrap:function(t,o){var n=t.indexOf(o);n!==-1&&t.splice(n,1),t.length>0&&!t[t.length-1]._isManuallyPaused()&&t[t.length-1]._setPausedState(!1)}},Zn=function(t){return t.tagName&&t.tagName.toLowerCase()==="input"&&typeof t.select=="function"},Qn=function(t){return(t==null?void 0:t.key)==="Escape"||(t==null?void 0:t.key)==="Esc"||(t==null?void 0:t.keyCode)===27},pe=function(t){return(t==null?void 0:t.key)==="Tab"||(t==null?void 0:t.keyCode)===9},Wn=function(t){return pe(t)&&!t.shiftKey},Jn=function(t){return pe(t)&&t.shiftKey},lt=function(t){return setTimeout(t,0)},fe=function(t){for(var o=arguments.length,n=new Array(o>1?o-1:0),a=1;a<o;a++)n[a-1]=arguments[a];return typeof t=="function"?t.apply(void 0,n):t},ye=function(t){return t.target.shadowRoot&&typeof t.composedPath=="function"?t.composedPath()[0]:t.target},Yn=[],Xn=function(t,o){var n=(o==null?void 0:o.document)||document,a=(o==null?void 0:o.trapStack)||Yn,l=at({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:Wn,isKeyBackward:Jn},o),r={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,manuallyPaused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},i,s=function(f,h,k){return f&&f[h]!==void 0?f[h]:l[k||h]},d=function(f,h){var k=typeof(h==null?void 0:h.composedPath)=="function"?h.composedPath():void 0;return r.containerGroups.findIndex(function(I){var $=I.container,E=I.tabbableNodes;return $.contains(f)||(k==null?void 0:k.includes($))||E.find(function(C){return C===f})})},u=function(f){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},k=h.hasFallback,I=k===void 0?!1:k,$=h.params,E=$===void 0?[]:$,C=l[f];if(typeof C=="function"&&(C=C.apply(void 0,zn(E))),C===!0&&(C=void 0),!C){if(C===void 0||C===!1)return C;throw new Error("`".concat(f,"` was specified but was not a node, or did not return a node"))}var R=C;if(typeof C=="string"){try{R=n.querySelector(C)}catch(V){throw new Error("`".concat(f,'` appears to be an invalid selector; error="').concat(V.message,'"'))}if(!R&&!I)throw new Error("`".concat(f,"` as selector refers to no known node"))}return R},p=function(){var f=u("initialFocus",{hasFallback:!0});if(f===!1)return!1;if(f===void 0||f&&!Ie(f,l.tabbableOptions))if(d(n.activeElement)>=0)f=n.activeElement;else{var h=r.tabbableGroups[0],k=h&&h.firstTabbableNode;f=k||u("fallbackFocus")}else f===null&&(f=u("fallbackFocus"));if(!f)throw new Error("Your focus-trap needs to have at least one focusable element");return f},c=function(){if(r.containerGroups=r.containers.map(function(f){var h=Mn(f,l.tabbableOptions),k=Tn(f,l.tabbableOptions),I=h.length>0?h[0]:void 0,$=h.length>0?h[h.length-1]:void 0,E=k.find(function(V){return se(V)}),C=k.slice().reverse().find(function(V){return se(V)}),R=!!h.find(function(V){return ne(V)>0});return{container:f,tabbableNodes:h,focusableNodes:k,posTabIndexesFound:R,firstTabbableNode:I,lastTabbableNode:$,firstDomTabbableNode:E,lastDomTabbableNode:C,nextTabbableNode:function(V){var H=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,Y=h.indexOf(V);return Y<0?H?k.slice(k.indexOf(V)+1).find(function(j){return se(j)}):k.slice(0,k.indexOf(V)).reverse().find(function(j){return se(j)}):h[Y+(H?1:-1)]}}}),r.tabbableGroups=r.containerGroups.filter(function(f){return f.tabbableNodes.length>0}),r.tabbableGroups.length<=0&&!u("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(r.containerGroups.find(function(f){return f.posTabIndexesFound})&&r.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},y=function(f){var h=f.activeElement;if(h)return h.shadowRoot&&h.shadowRoot.activeElement!==null?y(h.shadowRoot):h},m=function(f){if(f!==!1&&f!==y(document)){if(!f||!f.focus){m(p());return}f.focus({preventScroll:!!l.preventScroll}),r.mostRecentlyFocusedNode=f,Zn(f)&&f.select()}},g=function(f){var h=u("setReturnFocus",{params:[f]});return h||(h===!1?!1:f)},w=function(f){var h=f.target,k=f.event,I=f.isBackward,$=I===void 0?!1:I;h=h||ye(k),c();var E=null;if(r.tabbableGroups.length>0){var C=d(h,k),R=C>=0?r.containerGroups[C]:void 0;if(C<0)$?E=r.tabbableGroups[r.tabbableGroups.length-1].lastTabbableNode:E=r.tabbableGroups[0].firstTabbableNode;else if($){var V=r.tabbableGroups.findIndex(function(ee){var le=ee.firstTabbableNode;return h===le});if(V<0&&(R.container===h||Ie(h,l.tabbableOptions)&&!se(h,l.tabbableOptions)&&!R.nextTabbableNode(h,!1))&&(V=C),V>=0){var H=V===0?r.tabbableGroups.length-1:V-1,Y=r.tabbableGroups[H];E=ne(h)>=0?Y.lastTabbableNode:Y.lastDomTabbableNode}else pe(k)||(E=R.nextTabbableNode(h,!1))}else{var j=r.tabbableGroups.findIndex(function(ee){var le=ee.lastTabbableNode;return h===le});if(j<0&&(R.container===h||Ie(h,l.tabbableOptions)&&!se(h,l.tabbableOptions)&&!R.nextTabbableNode(h))&&(j=C),j>=0){var re=j===r.tabbableGroups.length-1?0:j+1,K=r.tabbableGroups[re];E=ne(h)>=0?K.firstTabbableNode:K.firstDomTabbableNode}else pe(k)||(E=R.nextTabbableNode(h))}}else E=u("fallbackFocus");return E},A=function(f){var h=ye(f);if(!(d(h,f)>=0)){if(fe(l.clickOutsideDeactivates,f)){i.deactivate({returnFocus:l.returnFocusOnDeactivate});return}fe(l.allowOutsideClick,f)||f.preventDefault()}},T=function(f){var h=ye(f),k=d(h,f)>=0;if(k||h instanceof Document)k&&(r.mostRecentlyFocusedNode=h);else{f.stopImmediatePropagation();var I,$=!0;if(r.mostRecentlyFocusedNode)if(ne(r.mostRecentlyFocusedNode)>0){var E=d(r.mostRecentlyFocusedNode),C=r.containerGroups[E].tabbableNodes;if(C.length>0){var R=C.findIndex(function(V){return V===r.mostRecentlyFocusedNode});R>=0&&(l.isKeyForward(r.recentNavEvent)?R+1<C.length&&(I=C[R+1],$=!1):R-1>=0&&(I=C[R-1],$=!1))}}else r.containerGroups.some(function(V){return V.tabbableNodes.some(function(H){return ne(H)>0})})||($=!1);else $=!1;$&&(I=w({target:r.mostRecentlyFocusedNode,isBackward:l.isKeyBackward(r.recentNavEvent)})),m(I||r.mostRecentlyFocusedNode||p())}r.recentNavEvent=void 0},q=function(f){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;r.recentNavEvent=f;var k=w({event:f,isBackward:h});k&&(pe(f)&&f.preventDefault(),m(k))},_=function(f){(l.isKeyForward(f)||l.isKeyBackward(f))&&q(f,l.isKeyBackward(f))},D=function(f){Qn(f)&&fe(l.escapeDeactivates,f)!==!1&&(f.preventDefault(),i.deactivate())},P=function(f){var h=ye(f);d(h,f)>=0||fe(l.clickOutsideDeactivates,f)||fe(l.allowOutsideClick,f)||(f.preventDefault(),f.stopImmediatePropagation())},S=function(){if(r.active)return rt.activateTrap(a,i),r.delayInitialFocusTimer=l.delayInitialFocus?lt(function(){m(p())}):m(p()),n.addEventListener("focusin",T,!0),n.addEventListener("mousedown",A,{capture:!0,passive:!1}),n.addEventListener("touchstart",A,{capture:!0,passive:!1}),n.addEventListener("click",P,{capture:!0,passive:!1}),n.addEventListener("keydown",_,{capture:!0,passive:!1}),n.addEventListener("keydown",D),i},x=function(){if(r.active)return n.removeEventListener("focusin",T,!0),n.removeEventListener("mousedown",A,!0),n.removeEventListener("touchstart",A,!0),n.removeEventListener("click",P,!0),n.removeEventListener("keydown",_,!0),n.removeEventListener("keydown",D),i},N=function(f){var h=f.some(function(k){var I=Array.from(k.removedNodes);return I.some(function($){return $===r.mostRecentlyFocusedNode})});h&&m(p())},Q=typeof window<"u"&&"MutationObserver"in window?new MutationObserver(N):void 0,W=function(){Q&&(Q.disconnect(),r.active&&!r.paused&&r.containers.map(function(f){Q.observe(f,{subtree:!0,childList:!0})}))};return i={get active(){return r.active},get paused(){return r.paused},activate:function(f){if(r.active)return this;var h=s(f,"onActivate"),k=s(f,"onPostActivate"),I=s(f,"checkCanFocusTrap");I||c(),r.active=!0,r.paused=!1,r.nodeFocusedBeforeActivation=n.activeElement,h==null||h();var $=function(){I&&c(),S(),W(),k==null||k()};return I?(I(r.containers.concat()).then($,$),this):($(),this)},deactivate:function(f){if(!r.active)return this;var h=at({onDeactivate:l.onDeactivate,onPostDeactivate:l.onPostDeactivate,checkCanReturnFocus:l.checkCanReturnFocus},f);clearTimeout(r.delayInitialFocusTimer),r.delayInitialFocusTimer=void 0,x(),r.active=!1,r.paused=!1,W(),rt.deactivateTrap(a,i);var k=s(h,"onDeactivate"),I=s(h,"onPostDeactivate"),$=s(h,"checkCanReturnFocus"),E=s(h,"returnFocus","returnFocusOnDeactivate");k==null||k();var C=function(){lt(function(){E&&m(g(r.nodeFocusedBeforeActivation)),I==null||I()})};return E&&$?($(g(r.nodeFocusedBeforeActivation)).then(C,C),this):(C(),this)},pause:function(f){return r.active?(r.manuallyPaused=!0,this._setPausedState(!0,f)):this},unpause:function(f){return r.active?(r.manuallyPaused=!1,a[a.length-1]!==this?this:this._setPausedState(!1,f)):this},updateContainerElements:function(f){var h=[].concat(f).filter(Boolean);return r.containers=h.map(function(k){return typeof k=="string"?n.querySelector(k):k}),r.active&&c(),W(),this}},Object.defineProperties(i,{_isManuallyPaused:{value:function(){return r.manuallyPaused}},_setPausedState:{value:function(f,h){if(r.paused===f)return this;if(r.paused=f,f){var k=s(h,"onPause"),I=s(h,"onPostPause");k==null||k(),x(),W(),I==null||I()}else{var $=s(h,"onUnpause"),E=s(h,"onPostUnpause");$==null||$(),c(),S(),W(),E==null||E()}return this}}}),i.updateContainerElements(t),i};const Kn=e.defineComponent({name:"UseFocusTrap",props:["as","options"],setup(t,{slots:o}){let n;const a=e.ref(),l=()=>n&&n.activate(),r=()=>n&&n.deactivate();return e.watch(()=>Ne(a),i=>{i&&(n=Xn(i,t.options||{}),l())},{flush:"post"}),e.onScopeDispose(()=>r()),()=>{if(o.default)return e.h(t.as||"div",{ref:a},o.default())}}}),eo=U(e.defineComponent({__name:"QFocusTrap",props:e.mergeModels({options:{},as:{}},{disabled:{type:Boolean},disabledModifiers:{}}),emits:["update:disabled"],setup(t){const o=t,n=e.useModel(t,"disabled");return(a,l)=>n.value?e.renderSlot(a.$slots,"default",{key:0}):(e.openBlock(),e.createBlock(e.unref(Kn),e.normalizeProps(e.mergeProps({key:1},o)),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default")]),_:3},16))}})),ce="data-scroll-locked",Ve="right-scroll-bar-position",Le="width-before-scroll-bar",to="with-scroll-bars-hidden",no="--removed-body-scroll-bar-size",oo={left:0,top:0,right:0,gap:0},Re=t=>parseInt(t||"",10)||0,ao=t=>{const o=window.getComputedStyle(document.body),n=o[t==="padding"?"paddingLeft":"marginLeft"],a=o[t==="padding"?"paddingTop":"marginTop"],l=o[t==="padding"?"paddingRight":"marginRight"];return[Re(n),Re(a),Re(l)]},ro=(t="margin")=>{if(typeof window>"u")return oo;const o=ao(t),n=document.documentElement.clientWidth,a=window.innerWidth;return{left:o[0],top:o[1],right:o[2],gap:Math.max(0,a-n+o[2]-o[0])}};function lo(){return document?document.createElement("style"):null}function io(t,o){t.appendChild(document.createTextNode(o))}function so(t){(document.head||document.getElementsByTagName("head")[0]).appendChild(t)}const co=()=>{let t=0,o=null;return{add:n=>{t===0&&(o=lo())&&(io(o,n),so(o)),t++},remove:()=>{var n;t--,!t&&o&&((n=o.parentNode)==null||n.removeChild(o),o=null)}}},uo=U(e.defineComponent({__name:"QRemoveScrollBar",props:{noRelative:{type:Boolean},noImportant:{type:Boolean},gapMode:{default:"margin"}},setup(t){const o=t,n=co(),a=()=>{const r=parseInt(document.body.getAttribute(ce)||"0",10);return isFinite(r)?r:0},l=({left:r,top:i,right:s,gap:d},u,p="margin",c)=>`
9
9
  .${to} {
10
10
  overflow: hidden ${c};
11
11
  padding-right: ${d}px ${c};
@@ -42,8 +42,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
42
42
  body[${ce}] {
43
43
  ${no}: ${d}px;
44
44
  }
45
- `;return e.onMounted(()=>{document.body.setAttribute(ce,(a()+1).toString());const r=ro(o.gapMode);n.add(l(r,!o.noRelative,o.gapMode,o.noImportant?"":"!important"))}),e.onUnmounted(()=>{const r=a()-1;r<=0?document.body.removeAttribute(ce):document.body.setAttribute(ce,r.toString()),n.remove()}),(r,i)=>e.renderSlot(r.$slots,"default")}}));function po(t,o,n,a){const l=(a==null?void 0:a.offset)??0,r=(a==null?void 0:a.crossOffset)??0,i=(a==null?void 0:a.placement)??"bottom",s=t.getBoundingClientRect(),d=o.getBoundingClientRect(),u=n==null?void 0:n.getBoundingClientRect(),p=fo(s,d,i,l),c=yo(s,d,p),y=go(c,p,l),m=bo(y,p,r),g=mo(m,d,p);let w;if(a!=null&&a.arrow){if(!u)throw new Error("[Quidgest UI] The arrow element must exist to compute its position");w=ho(g,s,d,u,p)}return{overlayCoords:g,arrowCoords:w,placement:p}}function fo(t,o,n,a){const l=it(t,o,n,a);if(st(l)){const r=de(n),i={top:"bottom",bottom:"top",left:"right",right:"left"}[r],s=it(t,o,i,a);if(st(s))return n;const d=xo(n);return d?`${i}-${d}`:i}return n}function mo(t,o,n){const a=we(n),l=(i,s,d)=>Math.min(Math.max(i,s),d),r={...t};return a==="x"?r.x=l(t.x,8,window.innerWidth-o.width-8):r.y=l(t.y,8,window.innerHeight-o.height-8),r}function go(t,o,n){const a=de(o);return{x:t.x+(a==="left"?-n:a==="right"?n:0),y:t.y+(a==="top"?-n:a==="bottom"?n:0)}}function bo(t,o,n){const a=de(o);return{x:t.x+(a==="top"||a==="bottom"?n:0),y:t.y+(a==="right"||a==="left"?n:0)}}function ho(t,o,n,a,l){if(we(l)==="y"){const r=o.top+o.height/2,i=t.y+n.height/2,s=i-r,d=n.height/2-s-a.height/2+2;if(d>0&&d<n.height-a.height)return{y:d}}else{const r=o.left+o.width/2,i=t.x+n.width/2,s=i-r,d=n.width/2-s-a.width/2+2;if(d>0&&d<n.width-a.width)return{x:d}}}function yo(t,o,n){const[a,l]=n.split("-"),r=t.x+t.width/2-o.width/2,i=t.y+t.height/2-o.height/2;let s;switch(a){case"top":s={x:r,y:t.y-o.height};break;case"bottom":s={x:r,y:t.y+t.height};break;case"left":s={x:t.x-o.width,y:i};break;case"right":s={x:t.x+t.width,y:i};break;default:throw new Error(`[Quidgest UI] Invalid placement value: ${n}`)}if(!l)return s;const d=we(n)==="y"?"height":"width",u=we(n),p=t[d]/2-o[d]/2;switch(l){case"start":s[u]-=p;break;case"end":s[u]+=p;break;default:throw new Error(`[Quidgest UI] Invalid alignment value: ${l}`)}return s}function it(t,o,n,a){const l=de(n);let r=0;switch(l){case"top":r=t.top-(o.height+a);break;case"bottom":r=window.innerHeight-t.bottom-(o.height+a);break;case"left":r=t.left-(o.width+a);break;case"right":r=window.innerWidth-t.right-(o.width+a);break;default:throw new Error(`[Quidgest UI] Invalid side value: ${l}`)}return r}function wo(t){return t==="x"?"y":"x"}function ko(t){const o=de(t);return["left","right"].includes(o)?"x":"y"}function we(t){return wo(ko(t))}function de(t){const[o]=t.split("-");return o}function xo(t){const[,o]=t.split("-");return o}function st(t){return t<0}function _o(t){return typeof t=="string"?document.querySelector(t):t}const Bo=["id"],Co=["role"],Eo=U(e.defineComponent({inheritAttrs:!1,__name:"QOverlay",props:e.mergeModels({id:{},class:{},anchor:{},appearance:{default:"regular"},arrow:{type:Boolean},attach:{default:"body"},inline:{type:Boolean},backdropBlur:{type:Boolean},backdropClass:{},delay:{default:500},nonModal:{type:Boolean},scrollLock:{type:Boolean},offset:{default:8},crossOffset:{default:0},persistent:{type:Boolean},placement:{default:"right"},spy:{type:Boolean},transition:{default:"fade"},trigger:{default:"click"},width:{default:"auto"},focusTrap:{type:Boolean},centerVertically:{type:Boolean}},{modelValue:{type:Boolean},modelModifiers:{}}),emits:e.mergeModels(["enter","leave"],["update:modelValue"]),setup(t,{emit:o}){const n=t,a=o,l=e.useModel(t,"modelValue"),{class:r}=ze(),i=e.computed(()=>["q-overlay",`q-overlay--${de(c.placement)}`,r.value,{"q-overlay--independent":s.value,"q-overlay--inverted":n.appearance==="inverted","q-overlay--center":n.centerVertically},n.class]),s=e.computed(()=>n.anchor===void 0),d=e.computed(()=>l.value&&!n.nonModal),u=e.computed(()=>(l.value||c.animating)&&n.scrollLock),p=e.computed(()=>!n.inline&&(l.value||c.animating)),c=e.reactive({animating:!1,top:0,left:0,width:0,placement:n.placement}),y=e.reactive({top:void 0,left:void 0,hidden:!0});e.watch(l,k);const m=e.computed(()=>{if(s.value)return;const v=$(),X=n.width==="anchor",b=X?v==null?void 0:v.getBoundingClientRect().width:void 0;return{top:`${c.top}px`,left:`${c.left}px`,width:b!==void 0?`${b}px`:void 0}}),g=e.computed(()=>{if(n.arrow)return{top:y.top!==void 0?`${y.top}px`:void 0,left:y.left!==void 0?`${y.left}px`:void 0,opacity:y.hidden?0:1}}),w=e.ref(null),A=e.ref(null),T=e.ref(null);function q(){const v=$();if(!v||!A.value)return;const X={placement:n.placement,width:n.width,offset:n.offset,crossOffset:n.crossOffset,arrow:n.arrow},b=po(v,A.value,(w==null?void 0:w.value)??void 0,X);c.left=b.overlayCoords.x,c.top=b.overlayCoords.y,c.placement=b.placement,y.hidden=b.arrowCoords===void 0,b.arrowCoords&&(y.top=b.arrowCoords.y,y.left=b.arrowCoords.x)}e.watch(()=>n.placement,()=>e.nextTick(q));let _;function D(){S(0)}function P(){S(n.delay)}function S(v){_&&N(),_=window.setTimeout(()=>{l.value=!0},v)}function x(){if(_&&N(),l.value=!1,n.anchor&&n.trigger==="click"){const v=$();e.nextTick(()=>v==null?void 0:v.focus())}}function N(){clearTimeout(_),_=void 0}function Y(){e.nextTick(le),a("enter")}function Q(){I()}function f(){a("leave")}function h(){I(),Be()}function k(){c.animating=!0}function I(){c.animating=!1}function $(){return n.anchor?_o(n.anchor):null}function E(v){n.persistent&&v.preventDefault()}function C(v){var X;if(n.persistent){v.preventDefault();return}let b=!1;v.defaultPrevented||v.detail.originalEvent.type==="pointerdown"&&(b=!0);const B=v.detail.originalEvent.target;if((X=$())!=null&&X.contains(B)){v.preventDefault();return}v.detail.originalEvent.type==="focusin"&&b&&v.preventDefault()}function R(){x()}let V;function H(){const v=$();if(v)switch(V=new MutationObserver(q),V.observe(v,{attributes:!1,childList:!0,characterData:!0,subtree:!0}),n.trigger){case"click":v.addEventListener("click",D);break;case"hover":v.addEventListener("mouseenter",P),v.addEventListener("mouseleave",x),v.addEventListener("focusin",D),v.addEventListener("focusout",x);break}}function J(){const v=$();if(v)switch(V==null||V.disconnect(),n.trigger){case"click":v.removeEventListener("click",D);break;case"hover":v.removeEventListener("mouseenter",P),v.removeEventListener("mouseleave",x),v.removeEventListener("focusin",D),v.removeEventListener("focusout",x);break}}function j(){window.addEventListener("resize",q),n.scrollLock||window.addEventListener("scroll",q)}function re(){window.removeEventListener("resize",q),n.scrollLock||window.removeEventListener("scroll",q)}let K;function ee(){$()?(q(),K=window.setTimeout(ee,100)):x()}function le(){var v;s.value||(j(),n.spy?ee():q()),(s.value||n.trigger==="click")&&((v=A.value)==null||v.focus())}function Be(){s.value||re(),n.spy&&(clearTimeout(K),K=void 0)}return e.onMounted(()=>{e.nextTick(H)}),e.onBeforeUnmount(J),(v,X)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[(e.openBlock(),e.createBlock(e.Teleport,{disabled:!p.value,to:n.attach},[e.createVNode(e.Transition,{name:"fade",appear:""},{default:e.withCtx(()=>[d.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([n.backdropClass,"q-overlay__underlay",{"q-overlay__underlay--blur":n.backdropBlur}])},null,2)):e.createCommentVNode("v-if",!0)]),_:1}),e.createVNode(e.Transition,{name:n.transition,appear:"",onEnter:Y,onAfterEnter:Q,onLeave:f,onAfterLeave:h},{default:e.withCtx(()=>[l.value?(e.openBlock(),e.createElementBlock("div",{key:0,id:n.id,ref_key:"overlayContainerRef",ref:T,tabindex:"-1",class:e.normalizeClass(i.value),style:e.normalizeStyle(m.value)},[e.createVNode(e.unref(fn),{onDismiss:R,onInteractOutside:C,onPointerDownOutside:E},{default:e.withCtx(()=>[T.value?(e.openBlock(),e.createBlock(e.unref(eo),{key:0,disabled:n.nonModal||!l.value,options:{fallbackFocus:T.value}},{default:e.withCtx(()=>[e.createElementVNode("div",e.mergeProps({ref_key:"overlayRef",ref:A,class:"q-overlay__content",tabindex:"-1",role:d.value?"dialog":void 0},v.$attrs),[n.arrow?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"arrowRef",ref:w,role:"presentation",class:"q-overlay__arrow",style:e.normalizeStyle(g.value)},null,4)):e.createCommentVNode("v-if",!0),e.renderSlot(v.$slots,"default")],16,Co)]),_:3},8,["disabled","options"])):e.createCommentVNode("v-if",!0)]),_:3})],14,Bo)):e.createCommentVNode("v-if",!0)]),_:3},8,["name"])],8,["disabled","to"])),u.value?(e.openBlock(),e.createBlock(e.unref(uo),{key:0})):e.createCommentVNode("v-if",!0)],64))}})),vo=[{id:"button",icon:{icon:"check"},props:{variant:"bold",label:"Ok"}}],So={icon:"check-circle-outline"},$o={close:{icon:"close"}},No={key:0,class:"q-dialog__header"},Ao={key:0,class:"q-dialog__header-title"},Io={key:1,class:"q-dialog__body"},Do={key:0,class:"q-dialog__body-icon"},Vo={class:"q-dialog__body-text"},Lo=["innerHTML"],Ro={key:1},Mo={key:0,class:"q-dialog__input"},To={key:2,class:"q-dialog__footer"},qo={key:0,class:"q-dialog__footer-buttons"},Po=e.defineComponent({__name:"QDialog",props:e.mergeModels({id:{},class:{},title:{},text:{},icon:{default:()=>So},buttons:{default:()=>vo},attach:{default:"body"},inline:{type:Boolean},backdropBlur:{type:Boolean,default:!0},dismissible:{type:Boolean},html:{type:Boolean,default:!0},icons:{default:()=>$o},size:{default:"small"},centerVertically:{type:Boolean},input:{}},{modelValue:{type:Boolean},modelModifiers:{}}),emits:e.mergeModels(["enter","leave"],["update:modelValue"]),setup(t,{emit:o}){const n=t,a=o,l=e.useModel(t,"modelValue"),r=e.ref(""),i=e.ref(""),s=e.computed(()=>["q-dialog",n.class]),d=e.computed(()=>`q-overlay--${n.size}`);function u(){l.value=!1}function p(m){var g,w;if(m.action){if((g=n.input)!=null&&g.validator&&(i.value=n.input.validator(e.unref(r)),e.unref(i)))return;(w=m.action)==null||w.call(m,e.unref(r))}u()}function c(){a("enter")}function y(){a("leave")}return(m,g)=>(e.openBlock(),e.createBlock(e.unref(Eo),{id:n.id,modelValue:l.value,"onUpdate:modelValue":g[1]||(g[1]=w=>l.value=w),"backdrop-class":"q-dialog__underlay","scroll-lock":"",persistent:"",inline:n.inline,attach:n.attach,"backdrop-blur":n.backdropBlur,"center-vertically":n.centerVertically,class:e.normalizeClass(d.value),onEnter:c,onLeave:y},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(s.value)},[n.title||m.$slots.header||m.$slots["header.prepend"]||m.$slots["header.append"]?(e.openBlock(),e.createElementBlock("div",No,[e.renderSlot(m.$slots,"header",{},()=>[e.renderSlot(m.$slots,"header.prepend"),n.title?(e.openBlock(),e.createElementBlock("span",Ao,e.toDisplayString(n.title),1)):e.createCommentVNode("v-if",!0),e.renderSlot(m.$slots,"header.append")])])):e.createCommentVNode("v-if",!0),n.icon||n.text||m.$slots.body?(e.openBlock(),e.createElementBlock("div",Io,[e.renderSlot(m.$slots,"body",{},()=>{var w;return[e.renderSlot(m.$slots,"body.icon",{},()=>[n.icon?(e.openBlock(),e.createElementBlock("span",Do,[e.createVNode(e.unref(O),e.normalizeProps(e.guardReactiveProps(n.icon)),null,16)])):e.createCommentVNode("v-if",!0)]),e.createElementVNode("div",Vo,[n.html?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:n.text},null,8,Lo)):(e.openBlock(),e.createElementBlock("div",Ro,e.toDisplayString(n.text),1))]),n.input?(e.openBlock(),e.createElementBlock("div",Mo,[e.createVNode(e.unref(Qe),{modelValue:r.value,"onUpdate:modelValue":g[0]||(g[0]=A=>r.value=A),invalid:!!i.value,placeholder:(w=n.input)==null?void 0:w.placeholder,size:"block"},{extras:e.withCtx(()=>[i.value?(e.openBlock(),e.createBlock(e.unref(O),{key:0,icon:"exclamation-sign"})):e.createCommentVNode("v-if",!0),e.createTextVNode(" "+e.toDisplayString(i.value),1)]),_:1},8,["modelValue","invalid","placeholder"])])):e.createCommentVNode("v-if",!0),e.renderSlot(m.$slots,"body.append")]})])):e.createCommentVNode("v-if",!0),n.buttons||m.$slots["footer.append"]?(e.openBlock(),e.createElementBlock("div",To,[n.buttons?(e.openBlock(),e.createElementBlock("span",qo,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.buttons,w=>(e.openBlock(),e.createBlock(e.unref(G),e.mergeProps({ref_for:!0},w.props,{key:w.id,onClick:()=>p(w)}),{default:e.withCtx(()=>[w.icon?(e.openBlock(),e.createBlock(e.unref(O),e.mergeProps({key:0,ref_for:!0},w.icon),null,16)):e.createCommentVNode("v-if",!0)]),_:2},1040,["onClick"]))),128))])):e.createCommentVNode("v-if",!0),e.renderSlot(m.$slots,"footer.append")])):e.createCommentVNode("v-if",!0),n.dismissible?(e.openBlock(),e.createBlock(e.unref(G),{key:3,class:"q-dialog__close",variant:"text",onClick:u},{default:e.withCtx(()=>[e.createVNode(e.unref(O),e.normalizeProps(e.guardReactiveProps(n.icons.close)),null,16)]),_:1})):e.createCommentVNode("v-if",!0)],2)]),_:3},8,["id","modelValue","inline","attach","backdrop-blur","center-vertically","class"]))}}),ke=e.reactive({dialogs:[]});function Fo(){function t(n,a,l){const r=Se(a);return ke.dialogs.push({id:r,props:n,options:l}),r}function o(n){const a=ke.dialogs.findIndex(l=>l.id===n);a!==-1&&ke.dialogs.splice(a,1)}return{...ke,addDialog:t,removeDialog:o}}const Oo=e.defineComponent({inheritAttrs:!1,__name:"QDialogProvider",props:{inline:{type:Boolean}},emits:["leave"],setup(t,{emit:o}){const n=t,a=o,{dialogs:l,removeDialog:r}=Fo();function i(s){r(s),a("leave",s)}return(s,d)=>(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(l),u=>(e.openBlock(),e.createBlock(e.unref(ct),e.mergeProps({key:u.id,ref_for:!0},u.props,{"model-value":"",inline:n.inline,onLeave:()=>i(u.id)}),null,16,["inline","onLeave"]))),128))}}),ct=U(Po);U(Oo);const Uo=["id","required","placeholder","readonly","disabled","maxlength","rows","cols","resize","wrap"],zo=U(e.defineComponent({inheritAttrs:!1,__name:"QTextArea",props:e.mergeModels({id:{},class:{},label:{},for:{},required:{type:Boolean},size:{},readonly:{type:Boolean},disabled:{type:Boolean},invalid:{type:Boolean},placeholder:{},maxLength:{},rows:{default:3},cols:{},resize:{default:"vertical"},wrap:{default:"soft"},autosize:{type:Boolean}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const o=t,n=e.useModel(t,"modelValue"),a=e.computed({get:()=>n.value,set:u=>{const p=o.maxLength;n.value=p?u==null?void 0:u.slice(0,p):u}});e.watch(n,u=>a.value=u,{immediate:!0});const l=Se(o.id),r=e.computed(()=>o.readonly||o.disabled?void 0:o.placeholder),i=e.computed(()=>({input:o.autosize?d:null})),s=e.ref(),{triggerResize:d}=xn({element:e.computed(()=>o.autosize?s.value:void 0),styleProp:"minHeight"});return(u,p)=>(e.openBlock(),e.createBlock(e.unref(Ze),{class:e.normalizeClass(["q-text-area",o.class]),for:e.unref(l),label:o.label,size:o.size,readonly:o.readonly,disabled:o.disabled,required:o.required},e.createSlots({"label.prepend":e.withCtx(()=>[e.renderSlot(u.$slots,"label.prepend")]),"label.append":e.withCtx(()=>[e.renderSlot(u.$slots,"label.append")]),default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("textarea",e.mergeProps({id:e.unref(l),ref_key:"textareaRef",ref:s,"onUpdate:modelValue":p[0]||(p[0]=c=>a.value=c),class:"q-text-area__input",required:o.required,placeholder:r.value,readonly:o.readonly,disabled:o.disabled,maxlength:o.maxLength,rows:o.rows,cols:o.cols,resize:o.resize,wrap:o.wrap},u.$attrs,e.toHandlers(i.value,!0)),null,16,Uo),[[e.vModelText,a.value]])]),_:2},[u.$slots.prepend?{name:"prepend",fn:e.withCtx(()=>[e.renderSlot(u.$slots,"prepend")]),key:"0"}:void 0,u.$slots.append?{name:"append",fn:e.withCtx(()=>[e.renderSlot(u.$slots,"append")]),key:"1"}:void 0,u.$slots.extras?{name:"extras",fn:e.withCtx(()=>[e.renderSlot(u.$slots,"extras")]),key:"2"}:void 0]),1032,["class","for","label","size","readonly","disabled","required"]))}}));function oe(){return{copy:"Copy",apply:"Apply",applyAll:"Apply all",chatbotTitle:"ChatBot",sendMessage:"Send message",clearChat:"Clear chat",inputLabel:"What can I help with?",imageUpload:"Upload Image",imageUploadQButton:"Upload Image",goodResponse:"Good response",badResponse:"Bad response",initialMessage:"Howdy! I am GenioBot 👋, Quidgest's personal AI assistant! How can I help you?",initialAgentMessage:"Just a temporary message while we are working on the agent mode",loginError:"Uh oh, I could not authenticate with the Quidgest API endpoint 😓",botIsSick:"*cough cough* GenioBot is not feeling alright 🥴️🤒, looks like something failed!",commentDialogTitle:"Would you like to add a comment?",commentPlaceholder:"Type your comment here (optional)...",copyResponse:"Copy response",submitButton:"Submit",cancelButton:"Cancel",senderImage:"Sender Image",imagePreview:"Image preview",regenerateResponsePrompt:"Regenerate a new response for field {0}",regenerateResponse:"Regenerate response",generatingResponse:"Generating",suggestionsForField:"Suggestions for field:",fileUpload:"Upload File",approveProceed:"Approve & proceed",approveProceedPlan:"Approve & proceed with plan"}}async function dt(t,o){var u,p,c,y,m,g,w;const n=new AbortController,a=n.signal,r=(await ie({...t,headers:{Accept:"text/event-stream"},responseType:"stream",signal:a,adapter:"fetch"})).data;if(!r||!(r instanceof ReadableStream))throw new Error("Invalid stream response");const i=r.getReader(),s=new TextDecoder;let d="";for(;;){const{done:A,value:T}=await i.read();if(A){(u=o.onDone)==null||u.call(o);break}const q=s.decode(T,{stream:!0});d+=q;const _=d.split(/\n\n+/);d=_.pop()||"";for(const D of _){const P=D.trim().split(`
46
- `);let S="",x="";for(const N of P)N.startsWith("event:")?S=N.replace("event:","").trim():N.startsWith("data:")&&(x=N.replace("data:","").trim());if(S||(S="message"),!!x)try{const N=JSON.parse(x);switch(S){case"message":(p=o.onMessage)==null||p.call(o,N.value);break;case"tool-status":(c=o.onToolStatus)==null||c.call(o,N);break;case"error":(y=o.onError)==null||y.call(o,new Error(N.value));break;case"field_metadata":(m=o.onFieldMetadata)==null||m.call(o,N);break;case"done":(g=o.onDone)==null||g.call(o);break;default:console.warn(`Unknown event type: ${S}`)}}catch(N){(w=o.onError)==null||w.call(o,N),console.error("Error processing event:",N);continue}finally{A&&(i.releaseLock(),n.abort())}}}}function ut(t){const o=e.ref(!1),n=e.ref(null);async function a(p){o.value=!0,n.value=null;try{return{data:(await ie({...p,baseURL:t})).data,error:null}}catch(c){if(c instanceof Error)return n.value=c,console.error("Error in API request:",c),{data:null,error:c}}finally{o.value=!1}return{data:null,error:new Error("Unknown error occurred in baseRequest")}}async function l(p,c,y,m){return await a({method:"POST",url:"/prompt/load",data:{username:p,project:c,agentID:y,formId:m}})}async function r(p,c,y,m,g){o.value=!0;try{return await dt({method:"POST",url:`${t}/prompt/submit`,data:p},{onMessage:w=>{c(w)},onToolStatus:w=>{y==null||y(w)},onDone:()=>{o.value=!1,g==null||g()}})}catch(w){throw o.value=!1,m==null||m(w),console.error("Error in sendPrompt:",w),w}}async function i(p){return await a({method:"POST",url:"/prompt/cancel-execution",data:{sessionId:p}})}async function s(p,c,y,m){o.value=!0;try{return await dt({method:"POST",url:`${t}/get-job-result`,data:{jobId:p}},{onMessage:g=>c(g),onFieldMetadata:g=>y(g),onDone:()=>o.value=!1})}catch(g){n.value=g,m==null||m(g),o.value=!1}}async function d(p,c,y,m,g){return await a({method:"POST",url:"/prompt/clear",data:{username:p,project:c,agentId:y,formId:m,sessionId:g}})}async function u(p,c,y){return await a({method:"POST",url:"/prompt/feedback",data:{messageSessionID:y,feedbackValue:p,feedbackComment:c}})}return{isLoading:o,lastError:n,getChatData:l,clearChatData:d,getJobResultData:s,sendPrompt:r,cancelExecution:i,handleFeedback:u}}const jo=["innerHTML"],Go={key:1,class:"markdown-renderer"},Ho={class:"markdown-renderer__chat-summary"},Zo=["innerHTML"],Qo=["innerHTML"],Wo={key:2,class:"markdown-renderer"},Jo=["innerHTML"],Yo=["innerHTML"],Xo={key:3,class:"markdown-renderer"},Ko=["innerHTML"],ea=["innerHTML"],xe=e.defineComponent({__name:"MarkdownRender",props:{source:{},options:{},plugins:{}},setup(t){const o=t,n=e.ref(new yt({html:!0,breaks:!0,...o.options??{}}));o.plugins&&o.plugins.forEach(m=>n.value.use(m));const a=e.computed(()=>n.value.render(o.source)),l=e.computed(()=>o.source.includes('data-type="execution-plan"')),r=e.computed(()=>o.source.includes('data-type="chat-summary"')),i=e.computed(()=>{if(!r.value)return"";const g=o.source.split(/\n|<br>/).find(w=>w.includes('data-type="chat-summary"'));return n.value.render(g||"Conversation Summary")}),s=e.computed(()=>{if(!r.value)return"";const m=o.source.split(/\n|<br>/),g=m.findIndex(A=>A.includes('data-type="chat-summary"'));if(g===-1)return"";const w=m.slice(g+1).join(`
45
+ `;return e.onMounted(()=>{document.body.setAttribute(ce,(a()+1).toString());const r=ro(o.gapMode);n.add(l(r,!o.noRelative,o.gapMode,o.noImportant?"":"!important"))}),e.onUnmounted(()=>{const r=a()-1;r<=0?document.body.removeAttribute(ce):document.body.setAttribute(ce,r.toString()),n.remove()}),(r,i)=>e.renderSlot(r.$slots,"default")}}));function po(t,o,n,a){const l=(a==null?void 0:a.offset)??0,r=(a==null?void 0:a.crossOffset)??0,i=(a==null?void 0:a.placement)??"bottom",s=t.getBoundingClientRect(),d=o.getBoundingClientRect(),u=n==null?void 0:n.getBoundingClientRect(),p=fo(s,d,i,l),c=yo(s,d,p),y=go(c,p,l),m=bo(y,p,r),g=mo(m,d,p);let w;if(a!=null&&a.arrow){if(!u)throw new Error("[Quidgest UI] The arrow element must exist to compute its position");w=ho(g,s,d,u,p)}return{overlayCoords:g,arrowCoords:w,placement:p}}function fo(t,o,n,a){const l=it(t,o,n,a);if(st(l)){const r=de(n),i={top:"bottom",bottom:"top",left:"right",right:"left"}[r],s=it(t,o,i,a);if(st(s))return n;const d=xo(n);return d?`${i}-${d}`:i}return n}function mo(t,o,n){const a=we(n),l=(i,s,d)=>Math.min(Math.max(i,s),d),r={...t};return a==="x"?r.x=l(t.x,8,window.innerWidth-o.width-8):r.y=l(t.y,8,window.innerHeight-o.height-8),r}function go(t,o,n){const a=de(o);return{x:t.x+(a==="left"?-n:a==="right"?n:0),y:t.y+(a==="top"?-n:a==="bottom"?n:0)}}function bo(t,o,n){const a=de(o);return{x:t.x+(a==="top"||a==="bottom"?n:0),y:t.y+(a==="right"||a==="left"?n:0)}}function ho(t,o,n,a,l){if(we(l)==="y"){const r=o.top+o.height/2,i=t.y+n.height/2,s=i-r,d=n.height/2-s-a.height/2+2;if(d>0&&d<n.height-a.height)return{y:d}}else{const r=o.left+o.width/2,i=t.x+n.width/2,s=i-r,d=n.width/2-s-a.width/2+2;if(d>0&&d<n.width-a.width)return{x:d}}}function yo(t,o,n){const[a,l]=n.split("-"),r=t.x+t.width/2-o.width/2,i=t.y+t.height/2-o.height/2;let s;switch(a){case"top":s={x:r,y:t.y-o.height};break;case"bottom":s={x:r,y:t.y+t.height};break;case"left":s={x:t.x-o.width,y:i};break;case"right":s={x:t.x+t.width,y:i};break;default:throw new Error(`[Quidgest UI] Invalid placement value: ${n}`)}if(!l)return s;const d=we(n)==="y"?"height":"width",u=we(n),p=t[d]/2-o[d]/2;switch(l){case"start":s[u]-=p;break;case"end":s[u]+=p;break;default:throw new Error(`[Quidgest UI] Invalid alignment value: ${l}`)}return s}function it(t,o,n,a){const l=de(n);let r=0;switch(l){case"top":r=t.top-(o.height+a);break;case"bottom":r=window.innerHeight-t.bottom-(o.height+a);break;case"left":r=t.left-(o.width+a);break;case"right":r=window.innerWidth-t.right-(o.width+a);break;default:throw new Error(`[Quidgest UI] Invalid side value: ${l}`)}return r}function wo(t){return t==="x"?"y":"x"}function ko(t){const o=de(t);return["left","right"].includes(o)?"x":"y"}function we(t){return wo(ko(t))}function de(t){const[o]=t.split("-");return o}function xo(t){const[,o]=t.split("-");return o}function st(t){return t<0}function _o(t){return typeof t=="string"?document.querySelector(t):t}const Bo=["id"],Co=["role"],Eo=U(e.defineComponent({inheritAttrs:!1,__name:"QOverlay",props:e.mergeModels({id:{},class:{},anchor:{},appearance:{default:"regular"},arrow:{type:Boolean},attach:{default:"body"},inline:{type:Boolean},backdropBlur:{type:Boolean},backdropClass:{},delay:{default:500},nonModal:{type:Boolean},scrollLock:{type:Boolean},offset:{default:8},crossOffset:{default:0},persistent:{type:Boolean},placement:{default:"right"},spy:{type:Boolean},transition:{default:"fade"},trigger:{default:"click"},width:{default:"auto"},focusTrap:{type:Boolean},centerVertically:{type:Boolean}},{modelValue:{type:Boolean},modelModifiers:{}}),emits:e.mergeModels(["enter","leave"],["update:modelValue"]),setup(t,{emit:o}){const n=t,a=o,l=e.useModel(t,"modelValue"),{class:r}=ze(),i=e.computed(()=>["q-overlay",`q-overlay--${de(c.placement)}`,r.value,{"q-overlay--independent":s.value,"q-overlay--inverted":n.appearance==="inverted","q-overlay--center":n.centerVertically},n.class]),s=e.computed(()=>n.anchor===void 0),d=e.computed(()=>l.value&&!n.nonModal),u=e.computed(()=>(l.value||c.animating)&&n.scrollLock),p=e.computed(()=>!n.inline&&(l.value||c.animating)),c=e.reactive({animating:!1,top:0,left:0,width:0,placement:n.placement}),y=e.reactive({top:void 0,left:void 0,hidden:!0});e.watch(l,k);const m=e.computed(()=>{if(s.value)return;const v=$(),X=n.width==="anchor",b=X?v==null?void 0:v.getBoundingClientRect().width:void 0;return{top:`${c.top}px`,left:`${c.left}px`,width:b!==void 0?`${b}px`:void 0}}),g=e.computed(()=>{if(n.arrow)return{top:y.top!==void 0?`${y.top}px`:void 0,left:y.left!==void 0?`${y.left}px`:void 0,opacity:y.hidden?0:1}}),w=e.ref(null),A=e.ref(null),T=e.ref(null);function q(){const v=$();if(!v||!A.value)return;const X={placement:n.placement,width:n.width,offset:n.offset,crossOffset:n.crossOffset,arrow:n.arrow},b=po(v,A.value,(w==null?void 0:w.value)??void 0,X);c.left=b.overlayCoords.x,c.top=b.overlayCoords.y,c.placement=b.placement,y.hidden=b.arrowCoords===void 0,b.arrowCoords&&(y.top=b.arrowCoords.y,y.left=b.arrowCoords.x)}e.watch(()=>n.placement,()=>e.nextTick(q));let _;function D(){S(0)}function P(){S(n.delay)}function S(v){_&&N(),_=window.setTimeout(()=>{l.value=!0},v)}function x(){if(_&&N(),l.value=!1,n.anchor&&n.trigger==="click"){const v=$();e.nextTick(()=>v==null?void 0:v.focus())}}function N(){clearTimeout(_),_=void 0}function Q(){e.nextTick(le),a("enter")}function W(){I()}function f(){a("leave")}function h(){I(),Be()}function k(){c.animating=!0}function I(){c.animating=!1}function $(){return n.anchor?_o(n.anchor):null}function E(v){n.persistent&&v.preventDefault()}function C(v){var X;if(n.persistent){v.preventDefault();return}let b=!1;v.defaultPrevented||v.detail.originalEvent.type==="pointerdown"&&(b=!0);const B=v.detail.originalEvent.target;if((X=$())!=null&&X.contains(B)){v.preventDefault();return}v.detail.originalEvent.type==="focusin"&&b&&v.preventDefault()}function R(){x()}let V;function H(){const v=$();if(v)switch(V=new MutationObserver(q),V.observe(v,{attributes:!1,childList:!0,characterData:!0,subtree:!0}),n.trigger){case"click":v.addEventListener("click",D);break;case"hover":v.addEventListener("mouseenter",P),v.addEventListener("mouseleave",x),v.addEventListener("focusin",D),v.addEventListener("focusout",x);break}}function Y(){const v=$();if(v)switch(V==null||V.disconnect(),n.trigger){case"click":v.removeEventListener("click",D);break;case"hover":v.removeEventListener("mouseenter",P),v.removeEventListener("mouseleave",x),v.removeEventListener("focusin",D),v.removeEventListener("focusout",x);break}}function j(){window.addEventListener("resize",q),n.scrollLock||window.addEventListener("scroll",q)}function re(){window.removeEventListener("resize",q),n.scrollLock||window.removeEventListener("scroll",q)}let K;function ee(){$()?(q(),K=window.setTimeout(ee,100)):x()}function le(){var v;s.value||(j(),n.spy?ee():q()),(s.value||n.trigger==="click")&&((v=A.value)==null||v.focus())}function Be(){s.value||re(),n.spy&&(clearTimeout(K),K=void 0)}return e.onMounted(()=>{e.nextTick(H)}),e.onBeforeUnmount(Y),(v,X)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[(e.openBlock(),e.createBlock(e.Teleport,{disabled:!p.value,to:n.attach},[e.createVNode(e.Transition,{name:"fade",appear:""},{default:e.withCtx(()=>[d.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([n.backdropClass,"q-overlay__underlay",{"q-overlay__underlay--blur":n.backdropBlur}])},null,2)):e.createCommentVNode("v-if",!0)]),_:1}),e.createVNode(e.Transition,{name:n.transition,appear:"",onEnter:Q,onAfterEnter:W,onLeave:f,onAfterLeave:h},{default:e.withCtx(()=>[l.value?(e.openBlock(),e.createElementBlock("div",{key:0,id:n.id,ref_key:"overlayContainerRef",ref:T,tabindex:"-1",class:e.normalizeClass(i.value),style:e.normalizeStyle(m.value)},[e.createVNode(e.unref(fn),{onDismiss:R,onInteractOutside:C,onPointerDownOutside:E},{default:e.withCtx(()=>[T.value?(e.openBlock(),e.createBlock(e.unref(eo),{key:0,disabled:n.nonModal||!l.value,options:{fallbackFocus:T.value}},{default:e.withCtx(()=>[e.createElementVNode("div",e.mergeProps({ref_key:"overlayRef",ref:A,class:"q-overlay__content",tabindex:"-1",role:d.value?"dialog":void 0},v.$attrs),[n.arrow?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"arrowRef",ref:w,role:"presentation",class:"q-overlay__arrow",style:e.normalizeStyle(g.value)},null,4)):e.createCommentVNode("v-if",!0),e.renderSlot(v.$slots,"default")],16,Co)]),_:3},8,["disabled","options"])):e.createCommentVNode("v-if",!0)]),_:3})],14,Bo)):e.createCommentVNode("v-if",!0)]),_:3},8,["name"])],8,["disabled","to"])),u.value?(e.openBlock(),e.createBlock(e.unref(uo),{key:0})):e.createCommentVNode("v-if",!0)],64))}})),vo=[{id:"button",icon:{icon:"check"},props:{variant:"bold",label:"Ok"}}],So={icon:"check-circle-outline"},$o={close:{icon:"close"}},No={key:0,class:"q-dialog__header"},Ao={key:0,class:"q-dialog__header-title"},Io={key:1,class:"q-dialog__body"},Do={key:0,class:"q-dialog__body-icon"},Vo={class:"q-dialog__body-text"},Lo=["innerHTML"],Ro={key:1},Mo={key:0,class:"q-dialog__input"},To={key:2,class:"q-dialog__footer"},qo={key:0,class:"q-dialog__footer-buttons"},Po=e.defineComponent({__name:"QDialog",props:e.mergeModels({id:{},class:{},title:{},text:{},icon:{default:()=>So},buttons:{default:()=>vo},attach:{default:"body"},inline:{type:Boolean},backdropBlur:{type:Boolean,default:!0},dismissible:{type:Boolean},html:{type:Boolean,default:!0},icons:{default:()=>$o},size:{default:"small"},centerVertically:{type:Boolean},input:{}},{modelValue:{type:Boolean},modelModifiers:{}}),emits:e.mergeModels(["enter","leave"],["update:modelValue"]),setup(t,{emit:o}){const n=t,a=o,l=e.useModel(t,"modelValue"),r=e.ref(""),i=e.ref(""),s=e.computed(()=>["q-dialog",n.class]),d=e.computed(()=>`q-overlay--${n.size}`);function u(){l.value=!1}function p(m){var g,w;if(m.action){if((g=n.input)!=null&&g.validator&&(i.value=n.input.validator(e.unref(r)),e.unref(i)))return;(w=m.action)==null||w.call(m,e.unref(r))}u()}function c(){a("enter")}function y(){a("leave")}return(m,g)=>(e.openBlock(),e.createBlock(e.unref(Eo),{id:n.id,modelValue:l.value,"onUpdate:modelValue":g[1]||(g[1]=w=>l.value=w),"backdrop-class":"q-dialog__underlay","scroll-lock":"",persistent:"",inline:n.inline,attach:n.attach,"backdrop-blur":n.backdropBlur,"center-vertically":n.centerVertically,class:e.normalizeClass(d.value),onEnter:c,onLeave:y},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(s.value)},[n.title||m.$slots.header||m.$slots["header.prepend"]||m.$slots["header.append"]?(e.openBlock(),e.createElementBlock("div",No,[e.renderSlot(m.$slots,"header",{},()=>[e.renderSlot(m.$slots,"header.prepend"),n.title?(e.openBlock(),e.createElementBlock("span",Ao,e.toDisplayString(n.title),1)):e.createCommentVNode("v-if",!0),e.renderSlot(m.$slots,"header.append")])])):e.createCommentVNode("v-if",!0),n.icon||n.text||m.$slots.body?(e.openBlock(),e.createElementBlock("div",Io,[e.renderSlot(m.$slots,"body",{},()=>{var w;return[e.renderSlot(m.$slots,"body.icon",{},()=>[n.icon?(e.openBlock(),e.createElementBlock("span",Do,[e.createVNode(e.unref(O),e.normalizeProps(e.guardReactiveProps(n.icon)),null,16)])):e.createCommentVNode("v-if",!0)]),e.createElementVNode("div",Vo,[n.html?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:n.text},null,8,Lo)):(e.openBlock(),e.createElementBlock("div",Ro,e.toDisplayString(n.text),1))]),n.input?(e.openBlock(),e.createElementBlock("div",Mo,[e.createVNode(e.unref(Qe),{modelValue:r.value,"onUpdate:modelValue":g[0]||(g[0]=A=>r.value=A),invalid:!!i.value,placeholder:(w=n.input)==null?void 0:w.placeholder,size:"block"},{extras:e.withCtx(()=>[i.value?(e.openBlock(),e.createBlock(e.unref(O),{key:0,icon:"exclamation-sign"})):e.createCommentVNode("v-if",!0),e.createTextVNode(" "+e.toDisplayString(i.value),1)]),_:1},8,["modelValue","invalid","placeholder"])])):e.createCommentVNode("v-if",!0),e.renderSlot(m.$slots,"body.append")]})])):e.createCommentVNode("v-if",!0),n.buttons||m.$slots["footer.append"]?(e.openBlock(),e.createElementBlock("div",To,[n.buttons?(e.openBlock(),e.createElementBlock("span",qo,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.buttons,w=>(e.openBlock(),e.createBlock(e.unref(G),e.mergeProps({ref_for:!0},w.props,{key:w.id,onClick:()=>p(w)}),{default:e.withCtx(()=>[w.icon?(e.openBlock(),e.createBlock(e.unref(O),e.mergeProps({key:0,ref_for:!0},w.icon),null,16)):e.createCommentVNode("v-if",!0)]),_:2},1040,["onClick"]))),128))])):e.createCommentVNode("v-if",!0),e.renderSlot(m.$slots,"footer.append")])):e.createCommentVNode("v-if",!0),n.dismissible?(e.openBlock(),e.createBlock(e.unref(G),{key:3,class:"q-dialog__close",variant:"text",onClick:u},{default:e.withCtx(()=>[e.createVNode(e.unref(O),e.normalizeProps(e.guardReactiveProps(n.icons.close)),null,16)]),_:1})):e.createCommentVNode("v-if",!0)],2)]),_:3},8,["id","modelValue","inline","attach","backdrop-blur","center-vertically","class"]))}}),ke=e.reactive({dialogs:[]});function Fo(){function t(n,a,l){const r=Se(a);return ke.dialogs.push({id:r,props:n,options:l}),r}function o(n){const a=ke.dialogs.findIndex(l=>l.id===n);a!==-1&&ke.dialogs.splice(a,1)}return{...ke,addDialog:t,removeDialog:o}}const Oo=e.defineComponent({inheritAttrs:!1,__name:"QDialogProvider",props:{inline:{type:Boolean}},emits:["leave"],setup(t,{emit:o}){const n=t,a=o,{dialogs:l,removeDialog:r}=Fo();function i(s){r(s),a("leave",s)}return(s,d)=>(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(l),u=>(e.openBlock(),e.createBlock(e.unref(ct),e.mergeProps({key:u.id,ref_for:!0},u.props,{"model-value":"",inline:n.inline,onLeave:()=>i(u.id)}),null,16,["inline","onLeave"]))),128))}}),ct=U(Po);U(Oo);const Uo=["id","required","placeholder","readonly","disabled","maxlength","rows","cols","resize","wrap"],zo=U(e.defineComponent({inheritAttrs:!1,__name:"QTextArea",props:e.mergeModels({id:{},class:{},label:{},for:{},required:{type:Boolean},size:{},readonly:{type:Boolean},disabled:{type:Boolean},invalid:{type:Boolean},placeholder:{},maxLength:{},rows:{default:3},cols:{},resize:{default:"vertical"},wrap:{default:"soft"},autosize:{type:Boolean}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const o=t,n=e.useModel(t,"modelValue"),a=e.computed({get:()=>n.value,set:u=>{const p=o.maxLength;n.value=p?u==null?void 0:u.slice(0,p):u}});e.watch(n,u=>a.value=u,{immediate:!0});const l=Se(o.id),r=e.computed(()=>o.readonly||o.disabled?void 0:o.placeholder),i=e.computed(()=>({input:o.autosize?d:null})),s=e.ref(),{triggerResize:d}=xn({element:e.computed(()=>o.autosize?s.value:void 0),styleProp:"minHeight"});return(u,p)=>(e.openBlock(),e.createBlock(e.unref(Ze),{class:e.normalizeClass(["q-text-area",o.class]),for:e.unref(l),label:o.label,size:o.size,readonly:o.readonly,disabled:o.disabled,required:o.required},e.createSlots({"label.prepend":e.withCtx(()=>[e.renderSlot(u.$slots,"label.prepend")]),"label.append":e.withCtx(()=>[e.renderSlot(u.$slots,"label.append")]),default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("textarea",e.mergeProps({id:e.unref(l),ref_key:"textareaRef",ref:s,"onUpdate:modelValue":p[0]||(p[0]=c=>a.value=c),class:"q-text-area__input",required:o.required,placeholder:r.value,readonly:o.readonly,disabled:o.disabled,maxlength:o.maxLength,rows:o.rows,cols:o.cols,resize:o.resize,wrap:o.wrap},u.$attrs,e.toHandlers(i.value,!0)),null,16,Uo),[[e.vModelText,a.value]])]),_:2},[u.$slots.prepend?{name:"prepend",fn:e.withCtx(()=>[e.renderSlot(u.$slots,"prepend")]),key:"0"}:void 0,u.$slots.append?{name:"append",fn:e.withCtx(()=>[e.renderSlot(u.$slots,"append")]),key:"1"}:void 0,u.$slots.extras?{name:"extras",fn:e.withCtx(()=>[e.renderSlot(u.$slots,"extras")]),key:"2"}:void 0]),1032,["class","for","label","size","readonly","disabled","required"]))}}));function oe(){return{copy:"Copy",apply:"Apply",applyAll:"Apply all",chatbotTitle:"ChatBot",sendMessage:"Send message",clearChat:"Clear chat",inputLabel:"What can I help with?",imageUpload:"Upload Image",imageUploadQButton:"Upload Image",goodResponse:"Good response",badResponse:"Bad response",initialMessage:"Howdy! I am GenioBot 👋, Quidgest's personal AI assistant! How can I help you?",initialAgentMessage:"Just a temporary message while we are working on the agent mode",loginError:"Uh oh, I could not authenticate with the Quidgest API endpoint 😓",botIsSick:"*cough cough* GenioBot is not feeling alright 🥴️🤒, looks like something failed!",commentDialogTitle:"Would you like to add a comment?",commentPlaceholder:"Type your comment here (optional)...",copyResponse:"Copy response",submitButton:"Submit",cancelButton:"Cancel",senderImage:"Sender Image",imagePreview:"Image preview",regenerateResponsePrompt:"Regenerate a new response for field {0}",regenerateResponse:"Regenerate response",generatingResponse:"Generating",suggestionsForField:"Suggestions for field:",fileUpload:"Upload File",approveProceed:"Approve & proceed",approveProceedPlan:"Approve & proceed with plan"}}async function dt(t,o){var u,p,c,y,m,g,w;const n=new AbortController,a=n.signal,r=(await ie({...t,headers:{Accept:"text/event-stream"},responseType:"stream",signal:a,adapter:"fetch"})).data;if(!r||!(r instanceof ReadableStream))throw new Error("Invalid stream response");const i=r.getReader(),s=new TextDecoder;let d="";for(;;){const{done:A,value:T}=await i.read();if(A){(u=o.onDone)==null||u.call(o);break}const q=s.decode(T,{stream:!0});d+=q;const _=d.split(/\n\n+/);d=_.pop()||"";for(const D of _){const P=D.trim().split(`
46
+ `);let S="",x="";for(const N of P)N.startsWith("event:")?S=N.replace("event:","").trim():N.startsWith("data:")&&(x=N.replace("data:","").trim());if(S||(S="message"),!!x)try{const N=JSON.parse(x);switch(S){case"message":(p=o.onMessage)==null||p.call(o,N.value),await new Promise(Q=>setTimeout(Q,20));break;case"tool-status":(c=o.onToolStatus)==null||c.call(o,N);break;case"error":(y=o.onError)==null||y.call(o,new Error(N.value));break;case"field_metadata":(m=o.onFieldMetadata)==null||m.call(o,N);break;case"done":(g=o.onDone)==null||g.call(o);break;default:console.warn(`Unknown event type: ${S}`)}}catch(N){(w=o.onError)==null||w.call(o,N),console.error("Error processing event:",N);continue}finally{A&&(i.releaseLock(),n.abort())}}}}function ut(t){const o=e.ref(!1),n=e.ref(null);async function a(p){o.value=!0,n.value=null;try{return{data:(await ie({...p,baseURL:t})).data,error:null}}catch(c){if(c instanceof Error)return n.value=c,console.error("Error in API request:",c),{data:null,error:c}}finally{o.value=!1}return{data:null,error:new Error("Unknown error occurred in baseRequest")}}async function l(p,c,y,m){return await a({method:"POST",url:"/prompt/load",data:{username:p,project:c,agentID:y,formId:m}})}async function r(p,c,y,m,g){o.value=!0;try{return await dt({method:"POST",url:`${t}/prompt/submit`,data:p},{onMessage:w=>{c(w)},onToolStatus:w=>{y==null||y(w)},onDone:()=>{o.value=!1,g==null||g()}})}catch(w){throw o.value=!1,m==null||m(w),console.error("Error in sendPrompt:",w),w}}async function i(p){return await a({method:"POST",url:"/prompt/cancel-execution",data:{sessionId:p}})}async function s(p,c,y,m){o.value=!0;try{return await dt({method:"POST",url:`${t}/get-job-result`,data:{jobId:p}},{onMessage:g=>c(g),onFieldMetadata:g=>y(g),onDone:()=>o.value=!1})}catch(g){n.value=g,m==null||m(g),o.value=!1}}async function d(p,c,y,m,g){return await a({method:"POST",url:"/prompt/clear",data:{username:p,project:c,agentId:y,formId:m,sessionId:g}})}async function u(p,c,y){return await a({method:"POST",url:"/prompt/feedback",data:{messageSessionID:y,feedbackValue:p,feedbackComment:c}})}return{isLoading:o,lastError:n,getChatData:l,clearChatData:d,getJobResultData:s,sendPrompt:r,cancelExecution:i,handleFeedback:u}}const jo=["innerHTML"],Go={key:1,class:"markdown-renderer"},Ho={class:"markdown-renderer__chat-summary"},Zo=["innerHTML"],Qo=["innerHTML"],Wo={key:2,class:"markdown-renderer"},Jo=["innerHTML"],Yo=["innerHTML"],Xo={key:3,class:"markdown-renderer"},Ko=["innerHTML"],ea=["innerHTML"],xe=e.defineComponent({__name:"MarkdownRender",props:{source:{},options:{},plugins:{}},setup(t){const o=t,n=e.ref(new yt({html:!0,breaks:!0,...o.options??{}}));o.plugins&&o.plugins.forEach(m=>n.value.use(m));const a=e.computed(()=>n.value.render(o.source)),l=e.computed(()=>o.source.includes('data-type="execution-plan"')),r=e.computed(()=>o.source.includes('data-type="chat-summary"')),i=e.computed(()=>{if(!r.value)return"";const g=o.source.split(/\n|<br>/).find(w=>w.includes('data-type="chat-summary"'));return n.value.render(g||"Conversation Summary")}),s=e.computed(()=>{if(!r.value)return"";const m=o.source.split(/\n|<br>/),g=m.findIndex(A=>A.includes('data-type="chat-summary"'));if(g===-1)return"";const w=m.slice(g+1).join(`
47
47
  `);return n.value.render(w)}),d=e.computed(()=>{if(!l.value)return"";const g=o.source.split(/\n|<br>/).find(w=>w.includes('data-type="execution-plan"'));return g?n.value.render(g):""}),u=e.computed(()=>{if(!l.value)return"";const m=o.source.split(/\n|<br>/),g=m.findIndex(A=>A.includes('data-type="execution-plan"'));if(g===-1)return"";const w=m.slice(g+1).join(`
48
48
  `);return n.value.render(w)}),p=e.computed(()=>o.source.includes('data-type="execution-progress"')),c=e.computed(()=>{if(!p.value)return"";const g=o.source.split(/\n|<br>/).find(w=>w.includes('data-type="execution-progress"'));return g?n.value.render(g):""}),y=e.computed(()=>{if(!p.value)return"";const m=o.source.split(/\n|<br>/),g=m.findIndex(A=>A.includes('data-type="execution-progress"'));if(g===-1)return"";const w=m.slice(g+1).join(`
49
- `);return n.value.render(w)});return(m,g)=>!l.value&&!p.value&&!r.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"markdown-renderer",innerHTML:a.value},null,8,jo)):r.value?(e.openBlock(),e.createElementBlock("div",Go,[e.createElementVNode("details",Ho,[e.createElementVNode("summary",{class:"markdown-renderer__chat-summary-title",innerHTML:i.value},null,8,Zo),s.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"markdown-renderer__chat-summary-content",innerHTML:s.value},null,8,Qo)):e.createCommentVNode("",!0)])])):l.value?(e.openBlock(),e.createElementBlock("div",Wo,[e.createElementVNode("div",{innerHTML:d.value},null,8,Jo),u.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"markdown-renderer__execution-plan-content",innerHTML:u.value},null,8,Yo)):e.createCommentVNode("",!0)])):p.value?(e.openBlock(),e.createElementBlock("div",Xo,[e.createElementVNode("div",{innerHTML:c.value},null,8,Ko),y.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"markdown-renderer__execution-progress-content",innerHTML:y.value},null,8,ea)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)}});function pt(t,o){switch(t){case"date":return new Date(o).toLocaleDateString();case"number":return parseFloat(o);case"boolean":return o.toLowerCase()==="true";default:return o.toString()}}function ta(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase()}const na=["data-testid"],oa={class:"q-field-preview__toolbar"},aa={class:"q-field-preview__footer"},ra=e.defineComponent({__name:"FieldPreview",props:{name:{},text:{},type:{},disabled:{type:Boolean},applied:{type:Boolean}},emits:["apply","regenerate"],setup(t,{emit:o}){const n=t,a=o,l=oe(),r=e.ref(n.applied),i=e.ref(!1),s=e.computed(()=>n.disabled||r.value),d=e.computed(()=>n.disabled||i.value),u=e.computed(()=>n.type==="text"||n.type==="multiline_text"?xe:"div"),p=e.computed(()=>{const g={};return u.value===xe?g.source=n.text:g.innerHTML=n.text,g}),c=e.computed(()=>{const g=["q-field-preview__content"];return u.value!==xe&&g.push("preserve-whitespace"),g});function y(){if(r.value)return;r.value=!0;const g=pt(n.type,n.text);a("apply",g)}function m(){i.value||(i.value=!0,a("regenerate",n.name))}return(g,w)=>(e.openBlock(),e.createElementBlock("div",{class:"q-field-preview","data-testid":e.unref(ta)(n.name)},[e.createElementVNode("div",oa,[e.createElementVNode("span",null,[e.createTextVNode(e.toDisplayString(e.unref(l).suggestionsForField)+" ",1),e.createElementVNode("b",null,e.toDisplayString(n.name),1)])]),e.createElementVNode("div",{class:e.normalizeClass(c.value)},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(u.value),e.normalizeProps(e.guardReactiveProps(p.value)),null,16))],2),e.createElementVNode("div",aa,[e.createVNode(e.unref(Ge),{borderless:""},{default:e.withCtx(()=>[e.createVNode(e.unref(G),{title:e.unref(l).regenerateResponse,disabled:d.value,readonly:d.value,borderless:"",onClick:m},{default:e.withCtx(()=>[e.createVNode(e.unref(O),{icon:"reset"})]),_:1},8,["title","disabled","readonly"]),e.createVNode(e.unref(G),{label:e.unref(l).apply,"data-testid":"apply-button",disabled:s.value,readonly:s.value,onClick:y},{default:e.withCtx(()=>[e.createVNode(e.unref(O),{icon:"apply"})]),_:1},8,["label","disabled","readonly"])]),_:1})])],8,na))}}),la={class:"pulsing-dots"},ia=["innerHTML"],sa={class:"dots-container"},ft=e.defineComponent({__name:"PulseDots",props:{text:{}},setup(t){const o=t,n=[1,2,3],a=oe(),l=e.computed(()=>o.text||a.generatingResponse);return(r,i)=>(e.openBlock(),e.createElementBlock("div",la,[e.createElementVNode("span",{class:"generating-text",innerHTML:l.value},null,8,ia),e.createElementVNode("div",sa,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(n,(s,d)=>e.createElementVNode("span",{key:d,class:"dot",style:e.normalizeStyle({animationDelay:d*.2+"s"})}," • ",4)),64))])]))}}),ca={class:"q-chatbot__message-container"},da={class:"q-chatbot__message-wrapper"},ua={key:0,class:"q-chatbot__image-preview"},pa=["src","alt"],fa={key:1,class:"q-chatbot__file-preview-container"},ma={class:"q-chatbot__file-icon-container"},ga={class:"q-chatbot__file-info"},ba={class:"q-chatbot__file-name"},ha={class:"q-chatbot__file-extension"},ya={class:"q-chatbot__message"},wa={key:1,class:"q-chatbot__text q-chatbot__user-text"},ka={key:2,class:"q-chatbot__message"},xa=e.defineComponent({__name:"ChatBotMessage",props:{sender:{default:"user"},message:{},date:{default:()=>new Date},loading:{type:Boolean},dateFormat:{},file:{},apiEndpoint:{},sessionID:{},userImage:{default:void 0},chatbotImage:{},isWelcomeMessage:{type:Boolean},fields:{default:()=>[]},isLastMessage:{type:Boolean,default:!1},isStreaming:{type:Boolean},showCancelExecution:{type:Boolean},cancelExecutionDisabled:{type:Boolean}},emits:["apply-fields","regenerate","send-message","cancel-execution"],setup(t,{emit:o}){const n=t,a=o,l=oe(),{handleFeedback:r}=ut(n.apiEndpoint),i=e.computed(()=>n.sender==="bot"&&!Object.values(l||{}).includes(n.message||"")&&!n.isWelcomeMessage),s=e.computed(()=>{var _;return((_=n.file)==null?void 0:_.fileData.type.startsWith("image/"))??!1}),d=e.computed(()=>n.sender==="bot"?n.chatbotImage:n.userImage),u=e.computed(()=>{var D;const _=(D=n.message)==null?void 0:D.match(/<span data-type="tool-calling">(.*?)<\/span>/);return _?_[1]:""}),p=e.computed(()=>{var _;return((_=n.message)==null?void 0:_.replace(/<span data-type="tool-calling">.*?<\/span>/,""))??""}),c=e.computed(()=>{var D,P;return(D=n.file)!=null&&D.fileData?((P=n.file.fileData.name.split(".").pop())==null?void 0:P.toUpperCase())??"":""}),y=e.computed(()=>{var _;return((_=n.message)==null?void 0:_.includes('data-type="execution-plan"'))??!1});function m(){a("send-message",l.approveProceedPlan)}function g(){a("cancel-execution")}function w(){n.message&&navigator.clipboard.writeText(n.message).then(()=>{console.log("Response copied to clipboard")}).catch(_=>{console.error("Failed to copy response: ",_)})}function A(_,D){a("apply-fields",[{id:D.id,text:_}])}function T(){if(!n.fields||n.fields.length===0)return;const _=n.fields.map(D=>({id:D.id,text:pt(D.type,D.text)}));a("apply-fields",_)}function q(_,D){_===null||D===null||!n.sessionID||r(_,D,n.sessionID)}return(_,D)=>{var P,S,x;return e.openBlock(),e.createElementBlock("div",ca,[e.createVNode(e.unref(O),{type:"img",icon:d.value,alt:e.unref(l).senderImage,class:"q-chatbot__profile"},null,8,["icon","alt"]),e.createElementVNode("div",da,[s.value?(e.openBlock(),e.createElementBlock("div",ua,[e.createElementVNode("img",{src:(P=n.file)==null?void 0:P.previewUrl,alt:e.unref(l).imagePreview},null,8,pa)])):(S=n.file)!=null&&S.fileData&&!s.value?(e.openBlock(),e.createElementBlock("div",fa,[e.createElementVNode("div",ma,[e.createVNode(e.unref(O),{icon:"file",class:"q-chatbot__file-icon"})]),e.createElementVNode("div",ga,[e.createElementVNode("span",ba,e.toDisplayString((x=n.file)==null?void 0:x.fileData.name),1),e.createElementVNode("span",ha,e.toDisplayString(c.value),1)])])):e.createCommentVNode("",!0),e.createElementVNode("div",ya,[_.loading?(e.openBlock(),e.createBlock(ft,{key:0})):n.sender==="bot"&&n.fields.length>0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(n.fields,(N,Y)=>(e.openBlock(),e.createBlock(e.unref(ra),{key:Y,class:"q-chatbot__text",text:N.text||"",name:N.name,type:N.type,disabled:_.loading,onRegenerate:()=>a("regenerate",N.name),onApply:Q=>A(Q,N)},null,8,["text","name","type","disabled","onRegenerate","onApply"]))),128)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[n.sender==="bot"?(e.openBlock(),e.createBlock(e.unref(xe),{key:0,class:"q-chatbot__text",source:p.value||""},null,8,["source"])):(e.openBlock(),e.createElementBlock("div",wa,e.toDisplayString(n.message),1))],64))]),u.value?(e.openBlock(),e.createElementBlock("div",ka,[e.createVNode(ft,{class:"q-chatbot__text",text:u.value},null,8,["text"])])):e.createCommentVNode("",!0)]),e.createVNode(e.unref($a),{"show-buttons":i.value,loading:n.loading,"date-format":n.dateFormat,"is-last-message":n.isLastMessage,"is-execution-plan":y.value,"is-streaming":n.isStreaming,"show-cancel-execution":n.showCancelExecution,"cancel-execution-disabled":n.cancelExecutionDisabled,onCopyResponse:w,onSubmitFeedback:q,onApplyAll:T,onApproveProceedPlan:m,onCancelExecution:g},null,8,["show-buttons","loading","date-format","is-last-message","is-execution-plan","is-streaming","show-cancel-execution","cancel-execution-disabled"])])}}}),z=[];for(let t=0;t<256;++t)z.push((t+256).toString(16).slice(1));function _a(t,o=0){return(z[t[o+0]]+z[t[o+1]]+z[t[o+2]]+z[t[o+3]]+"-"+z[t[o+4]]+z[t[o+5]]+"-"+z[t[o+6]]+z[t[o+7]]+"-"+z[t[o+8]]+z[t[o+9]]+"-"+z[t[o+10]]+z[t[o+11]]+z[t[o+12]]+z[t[o+13]]+z[t[o+14]]+z[t[o+15]]).toLowerCase()}let Me;const Ba=new Uint8Array(16);function Ca(){if(!Me){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Me=crypto.getRandomValues.bind(crypto)}return Me(Ba)}const mt={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function gt(t,o,n){var l;if(mt.randomUUID&&!o&&!t)return mt.randomUUID();t=t||{};const a=t.random??((l=t.rng)==null?void 0:l.call(t))??Ca();if(a.length<16)throw new Error("Random bytes length must be >= 16");return a[6]=a[6]&15|64,a[8]=a[8]&63|128,_a(a)}const ae=e.ref([]),_e=e.ref(1);function bt(){function t(r,i,s,d,u){const p={id:_e.value++,message:r,date:new Date,sender:i||"bot",sessionID:d||gt(),file:s,isWelcomeMessage:u,fields:[]};return ae.value.push(p),p}function o(){return ae.value.find(r=>r.id===_e.value-1)}function n(){ae.value=[],_e.value=1}function a(r){ae.value=ae.value.filter(i=>i.id!==r)}function l(){return ae.value}return{messages:ae,nextMessageId:_e,addChatMessage:t,getLastMessage:o,clearMessages:n,getMessages:l,deleteMessageById:a}}const Ea={class:"q-chatbot__dialog-title"},va={key:0,class:"q-chatbot__feedback-buttons"},Sa={class:"q-chatbot__sender"},$a=e.defineComponent({__name:"ChatBotMessageButtons",props:{loading:{type:Boolean},showButtons:{type:Boolean},dateFormat:{},date:{},isLastMessage:{type:Boolean},isExecutionPlan:{type:Boolean},isStreaming:{type:Boolean},showCancelExecution:{type:Boolean},cancelExecutionDisabled:{type:Boolean}},emits:["submit-feedback","copy-response","apply-all","approve-proceed-plan","cancel-execution"],setup(t,{emit:o}){const n=t,a=o,l=oe(),{getLastMessage:r}=bt(),i=e.ref(!1),s=e.ref(""),d=e.ref(null),u=e.ref(!1),p=e.ref(!1),c=e.ref(!1),y=e.computed(()=>n.loading||u.value),m=e.computed(()=>p.value||!n.isLastMessage||n.loading||n.isStreaming),g=e.computed(()=>c.value||n.cancelExecutionDisabled||!n.isLastMessage||n.loading),w=n.date||new Date,A=r(),T=e.computed(()=>A?A.fields&&A.fields.length>1:!1),q=e.computed(()=>n.isExecutionPlan),_=e.computed(()=>n.showCancelExecution),D=[{id:"confirm-btn",action:I,props:{label:l.submitButton,class:"q-chatbot__dialog-confirm-button"},icon:{icon:"submit"}},{id:"cancel-btn",props:{label:l.cancelButton,class:"q-chatbot__dialog-cancel-button"},icon:{icon:"cancel"}}],P=e.computed(()=>n.dateFormat?x(w,"HH:mm"):w.toLocaleString()),S=e.computed(()=>`${P.value}`);function x(E,C){const R=E.getDate().toString().padStart(2,"0"),V=(E.getMonth()+1).toString().padStart(2,"0"),H=E.getFullYear().toString().padStart(2,"0"),J=E.getHours().toString().padStart(2,"0"),j=E.getMinutes().toString().padStart(2,"0"),re=E.getSeconds().toString().padStart(2,"0");return C.replace("dd",R).replace("MM",V).replace("yyyy",H).replace("HH",J).replace("mm",j).replace("ss",re)}function N(E){i.value=!0,s.value="",d.value=E}function Y(){N(0)}function Q(){N(1)}function f(){u.value||(u.value=!0,a("apply-all"))}function h(){p.value||(p.value=!0,a("approve-proceed-plan"))}function k(){c.value||(c.value=!0,a("cancel-execution"))}function I(){d.value&&(a("submit-feedback",d.value,s.value),i.value=!1,s.value="",d.value=null)}function $(){a("copy-response")}return(E,C)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(e.unref(ct),{modelValue:i.value,"onUpdate:modelValue":C[1]||(C[1]=R=>i.value=R),inline:"",buttons:D},{body:e.withCtx(()=>[e.createElementVNode("div",Ea,e.toDisplayString(e.unref(l).commentDialogTitle),1),e.createVNode(e.unref(Qe),{modelValue:s.value,"onUpdate:modelValue":C[0]||(C[0]=R=>s.value=R),class:"q-chatbot__dialog-comment-input","max-length":150,size:"large",placeholder:e.unref(l).commentPlaceholder},null,8,["modelValue","placeholder"])]),_:1},8,["modelValue"]),E.showButtons?(e.openBlock(),e.createElementBlock("div",va,[e.createVNode(e.unref(Ge),null,{default:e.withCtx(()=>[e.createVNode(e.unref(G),{title:e.unref(l).goodResponse,class:"q-chatbot__good-response-button",borderless:"",disabled:n.loading,onClick:Q},{default:e.withCtx(()=>[e.createVNode(e.unref(O),{icon:"thumb-up"})]),_:1},8,["title","disabled"]),e.createVNode(e.unref(G),{title:e.unref(l).badResponse,class:"q-chatbot__bad-response-button",borderless:"",disabled:n.loading,onClick:Y},{default:e.withCtx(()=>[e.createVNode(e.unref(O),{icon:"thumb-down"})]),_:1},8,["title","disabled"]),e.createVNode(e.unref(G),{title:e.unref(l).copyResponse,class:"q-chatbot__copy-button",borderless:"",disabled:n.loading,onClick:$},{default:e.withCtx(()=>[e.createVNode(e.unref(O),{icon:"copy-content"})]),_:1},8,["title","disabled"]),T.value?(e.openBlock(),e.createBlock(e.unref(G),{key:0,title:y.value?void 0:e.unref(l).applyAll,class:"q-chatbot__apply-all-button",variant:"bold",borderless:"",disabled:y.value,readonly:y.value,label:e.unref(l).applyAll,onClick:f},{default:e.withCtx(()=>[e.createVNode(e.unref(O),{icon:"apply"})]),_:1},8,["title","disabled","readonly","label"])):e.createCommentVNode("",!0),q.value?(e.openBlock(),e.createBlock(e.unref(G),{key:1,title:m.value?void 0:e.unref(l).approveProceed,class:"q-chatbot__approve-proceed-plan-button",variant:"bold",borderless:"",disabled:m.value,readonly:m.value,label:e.unref(l).approveProceed,onClick:h},{default:e.withCtx(()=>[e.createVNode(e.unref(O),{icon:"apply"})]),_:1},8,["title","disabled","readonly","label"])):e.createCommentVNode("",!0),_.value?(e.openBlock(),e.createBlock(e.unref(G),{key:2,title:g.value?void 0:e.unref(l).cancelButton,class:"q-chatbot__cancel-execution-button",borderless:"",disabled:g.value,readonly:g.value,label:e.unref(l).cancelButton,onClick:k},{default:e.withCtx(()=>[e.createVNode(e.unref(O),{icon:"cancel"})]),_:1},8,["title","disabled","readonly","label"])):e.createCommentVNode("",!0)]),_:1})])):e.createCommentVNode("",!0),e.createElementVNode("div",Sa,e.toDisplayString(S.value),1)],64))}}),Na={class:"q-chatbot__tools"},Aa={class:"q-chatbot__tools__select"},Ia=e.defineComponent({__name:"ChatToolBar",props:{disabled:{type:Boolean},availableAgents:{default:()=>[]},selectedAgentKey:{}},emits:["clear","change-chat"],setup(t,{emit:o}){const n=t,a=o,{clearChat:l}=oe(),r={key:"",value:"Default Chat",formId:""},i=e.computed(()=>n.availableAgents&&n.availableAgents.length>0),s=e.ref(n.selectedAgentKey||r.key);e.watch(()=>n.selectedAgentKey,c=>{s.value=c||r.key});const d=e.computed(()=>{var y;const c=(y=n.availableAgents)==null?void 0:y.map(m=>({key:m.key,value:m.value,formId:m.formId}));return c==null||c.push(r),c||[r]});function u(){a("clear")}function p(c){const y=d.value.find(m=>m.key===c);if(y){if(y.key===r.key){a("change-chat",{key:"",formId:""});return}a("change-chat",y)}}return(c,y)=>{const m=e.resolveComponent("q-select");return e.openBlock(),e.createElementBlock("div",Na,[e.createElementVNode("div",Aa,[i.value?(e.openBlock(),e.createBlock(m,{key:0,modelValue:s.value,"onUpdate:modelValue":[y[0]||(y[0]=g=>s.value=g),p],inline:"",required:"",class:"q-chatbot__tools-select-input",size:"medium",items:d.value},null,8,["modelValue","items"])):e.createCommentVNode("",!0)]),e.createVNode(e.unref(G),{title:e.unref(l),disabled:n.disabled,class:"q-chatbot__tools-clear",borderless:"",onClick:u},{default:e.withCtx(()=>[e.createVNode(e.unref(O),{icon:"bin"})]),_:1},8,["title","disabled"])])}}}),Da={class:"q-chatbot__input-wrapper"},Va={key:0,class:"q-chatbot__file-preview"},La=["src","alt"],Ra={key:1,class:"q-chatbot__file-preview",tabindex:"0"},Ma={class:"q-chatbot__file-name"},Ta={class:"q-chatbot__input"},qa={class:"q-chatbot__send-container"},Pa=["accept"],Fa=e.defineComponent({__name:"ChatBotInput",props:{disabled:{type:Boolean},loading:{type:Boolean},userPrompt:{},agentId:{}},emits:["send-message"],setup(t,{emit:o}){const n=t,a=o,l=oe(),r=e.ref(null),i=e.ref(null),s=e.ref(""),d=e.ref(!1),u=e.computed(()=>".png,.jpeg,.jpg,.svg,.webp,.pdf,.doc,.docx"),p=e.computed(()=>i.value?i.value.type.startsWith("image/")??!1:!1),c=e.ref(n.userPrompt??""),y=e.computed(()=>n.disabled||n.loading||c.value.trim().length===0);function m(S){S.preventDefault(),n.disabled||(d.value=!0)}const g=e.computed(()=>({"q-chatbot__footer-disabled":n.disabled,"drag-over":d.value&&!i.value}));function w(S){S.preventDefault(),d.value=!1}function A(S){var N;if(S.preventDefault(),d.value=!1,n.disabled||i.value)return;const x=(N=S.dataTransfer)==null?void 0:N.files;x&&T(x[0])}function T(S){i.value=S,S.type.startsWith("image/")?s.value=URL.createObjectURL(S):s.value=""}function q(){if(!(c.value.trim()===""||n.loading||n.disabled)){if(i.value){const S={fileData:i.value,previewUrl:s.value??""};a("send-message",c.value,S),_()}else a("send-message",c.value);c.value=""}}function _(){i.value=null,s.value="",r.value&&(r.value.value="",r.value.files=null)}function D(){var S;(S=r.value)==null||S.click()}function P(S){var N;const x=S.target;(N=x.files)!=null&&N[0]&&T(x.files[0])}return(S,x)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(e.unref(He),{label:e.unref(l).inputLabel},null,8,["label"]),e.createElementVNode("div",{class:e.normalizeClass(["q-chatbot__footer",g.value]),onDragover:e.withModifiers(m,["prevent"]),onDragleave:e.withModifiers(w,["prevent"]),onDrop:e.withModifiers(A,["prevent"])},[e.createElementVNode("div",Da,[i.value?(e.openBlock(),e.createElementBlock("div",Va,[p.value?(e.openBlock(),e.createElementBlock("img",{key:0,class:"q-chatbot__image-preview",src:s.value,tabindex:"0",alt:e.unref(l).imagePreview},null,8,La)):(e.openBlock(),e.createElementBlock("div",Ra,[e.createVNode(e.unref(O),{icon:"file",class:"q-chatbot__file-icon"}),e.createElementVNode("span",Ma,e.toDisplayString(i.value.name),1)])),e.createVNode(e.unref(G),{class:"q-chatbot__remove-file",tabindex:"0",flat:"",round:"",onClick:_},{default:e.withCtx(()=>[e.createVNode(e.unref(O),{icon:"remove"})]),_:1})])):e.createCommentVNode("",!0),e.createElementVNode("div",Ta,[e.createVNode(e.unref(zo),{id:"chatbot-input",modelValue:c.value,"onUpdate:modelValue":x[0]||(x[0]=N=>c.value=N),size:"block",autosize:"",resize:"none",rows:2,disabled:n.disabled,onKeyup:e.withKeys(q,["enter"])},null,8,["modelValue","disabled"])]),e.createElementVNode("div",qa,[e.createVNode(e.unref(G),{title:e.unref(l).imageUpload,class:"q-chatbot__upload",disabled:n.disabled||n.loading||!!i.value,onClick:D},{default:e.withCtx(()=>[e.createVNode(e.unref(O),{icon:"upload"})]),_:1},8,["title","disabled"]),e.createElementVNode("input",{id:"file-upload",ref_key:"fileInput",ref:r,type:"file",accept:u.value,class:"hidden-input",onChange:P},null,40,Pa),e.createVNode(e.unref(G),{title:e.unref(l).sendMessage,variant:"bold",class:"q-chatbot__send",disabled:y.value,readonly:y.value,onClick:q},{default:e.withCtx(()=>[e.createVNode(e.unref(O),{icon:"send"})]),_:1},8,["title","disabled","readonly"])])])],34)],64))}}),Oa="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20viewBox='0%200%20126.25%20110.36'%3e%3cdefs%3e%3cradialGradient%20id='radial-gradient'%20cx='45.24'%20cy='38.05'%20fx='45.24'%20fy='38.05'%20r='59.09'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%2331319e'/%3e%3cstop%20offset='.19'%20stop-color='%232e2e97'/%3e%3cstop%20offset='.45'%20stop-color='%23292985'/%3e%3cstop%20offset='.75'%20stop-color='%23202067'/%3e%3cstop%20offset='1'%20stop-color='%2317174a'/%3e%3c/radialGradient%3e%3clinearGradient%20id='linear-gradient'%20x1='82.65'%20y1='50.41'%20x2='82.65'%20y2='77.5'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='.02'%20stop-color='%2366ebfe'/%3e%3cstop%20offset='.96'%20stop-color='%2300bfdb'/%3e%3c/linearGradient%3e%3clinearGradient%20id='linear-gradient-2'%20x1='44.6'%20y1='50.01'%20x2='44.6'%20y2='77.1'%20xlink:href='%23linear-gradient'/%3e%3c/defs%3e%3cg%20isolation='isolate'%3e%3cg%20id='Layer_1'%3e%3cpath%20d='M126.2,61.4c-.2-3.69-2.61-17.39-5.92-22.09-2.42-3.44-5.89-4.03-7.96-4.38-.13-.02-.27-.05-.41-.07-.16-.28-.32-.58-.45-.81-.63-1.14-1.03-1.87-1.44-2.44-6.96-9.88-14.91-16.51-24.85-20.69-.25-2.29-.84-5.24-3.37-7.44-2.93-2.55-7.58-2.9-11.68-3.21-.93-.07-1.82-.14-2.4-.22l-.33-.05h-8.61l-.36.05c-.65.1-1.61.17-2.63.24-3.75.27-8.01.57-10.98,2.85-2.94,2.26-3.58,5.55-3.79,7.84-9.71,3.94-17.86,10.71-24.85,20.62-.4.57-.81,1.3-1.43,2.44-.13.23-.29.53-.45.81-.14.02-.28.05-.4.07-2.07.35-5.54.94-7.96,4.39-2.25,3.19-3.84,9.89-4.58,13.59-.6,2.97-1.9,10.3-1.08,14.26.79,3.78,3.66,5.6,5.37,6.68.12.08.26.16.39.25,1.65,10.03,6.98,18.56,15.52,24.77,9.23,6.72,20.2,9.43,27.78,10.52,4.49.65,9.15.97,13.85.97,9.67,0,23.77-1.39,36-8.02,11.58-6.27,18.81-16,21.04-28.24,4.52-2.76,6.36-5.67,5.98-12.71Z'%20fill='%2317174a'/%3e%3cpath%20d='M67.15,4.69c2.98.42,9.31.31,11.62,2.31,1.99,1.73,1.65,4.82,2.06,7.22,10.77,3.89,18.73,10.59,25.39,20.04.64.91,2.13,3.95,2.58,4.33,1.71,1.46,5.54.35,7.67,3.37,2.29,3.25,4.83,15.41,5.06,19.59.31,5.82-.76,6.9-5.58,9.44-3.28,26.16-29.7,34.5-52.68,34.5-4.6,0-9.06-.33-13.17-.93-18.13-2.61-37.11-12.11-39.51-33.08-1.7-1.92-4.96-2.54-5.55-5.39-.95-4.56,2.21-20.32,4.89-24.14,2.13-3.02,5.96-1.91,7.67-3.37.46-.39,1.94-3.42,2.58-4.33,6.54-9.28,14.55-16.22,25.21-19.87.85-.87-.3-5.45,2.43-7.55,2.52-1.94,8.35-1.69,11.42-2.16h7.91'%20fill='%23fff'/%3e%3cpath%20d='M121.86,61.51c-.22-4.2-2.78-16.43-5.07-19.7-1.77-2.51-4.71-2.18-6.64-2.83.1,1.18.16,2.37.16,3.57,0,26.85-25.96,48.61-57.98,48.61-15.83,0-30.17-5.32-40.63-13.94,4.91,17.1,22.06,25.14,38.51,27.52,4.12.59,8.6.93,13.21.93,23.06,0,49.57-8.38,52.85-34.68,4.83-2.56,5.91-3.63,5.6-9.49Z'%20fill='%23d0d7e2'%20mix-blend-mode='multiply'%20opacity='.4'/%3e%3cpath%20d='M62.91,97.68c5.82,0,11.67-.53,16.72-1.56,13.1-2.67,22.09-8.06,26.72-16.03,4.43-7.63,4.75-17.33.96-28.84-4.28-13-13.22-22.77-24.7-27.89-.13,4.51-3.84,8.16-8.38,8.16h-20.89c-4.61,0-8.39-3.78-8.39-8.39v-.14c-5.36,2.25-10.29,5.49-14.5,9.61-8.23,8.06-13.16,19.02-13.9,30.84-.59,9.44,2.67,17.53,9.43,23.42,6.27,5.46,15.68,9.02,27.2,10.3,3.13.35,6.43.52,9.73.52'%20fill='url(%23radial-gradient)'/%3e%3crect%20x='74.34'%20y='50.41'%20width='16.62'%20height='27.09'%20rx='4.06'%20ry='4.06'%20fill='url(%23linear-gradient)'/%3e%3crect%20x='36.29'%20y='50.01'%20width='16.62'%20height='27.09'%20rx='4.06'%20ry='4.06'%20fill='url(%23linear-gradient-2)'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e",Ua="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHgAAAB4CAYAAAA5ZDbSAAAACXBIWXMAAAsTAAALEwEAmpwYAAAF2GlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS42LWMxNDggNzkuMTY0MDM2LCAyMDE5LzA4LzEzLTAxOjA2OjU3ICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdEV2dD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlRXZlbnQjIiB4bWxuczpkYz0iaHR0cDovL3B1cmwub3JnL2RjL2VsZW1lbnRzLzEuMS8iIHhtbG5zOnBob3Rvc2hvcD0iaHR0cDovL25zLmFkb2JlLmNvbS9waG90b3Nob3AvMS4wLyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgMjEuMCAoV2luZG93cykiIHhtcDpDcmVhdGVEYXRlPSIyMDE5LTExLTI5VDEwOjI0OjU3WiIgeG1wOk1ldGFkYXRhRGF0ZT0iMjAxOS0xMS0yOVQxMDoyNDo1N1oiIHhtcDpNb2RpZnlEYXRlPSIyMDE5LTExLTI5VDEwOjI0OjU3WiIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDpiN2ViMDM0NC1hN2UzLTI3NGItODgwNi00ZjMxMzRiNDUwNDEiIHhtcE1NOkRvY3VtZW50SUQ9ImFkb2JlOmRvY2lkOnBob3Rvc2hvcDo2ODJkMGU1OC1kZmQyLTZkNDEtOGIwNy01ZWUxNjU4MWY2ZWEiIHht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",za={class:"q-chatbot"},ja={class:"q-chatbot__content"},Ga={class:"q-chatbot__footer-container"},Ha='<span data-type="execution-progress">';return e.defineComponent({name:"ChatBot",__name:"ChatBot",props:{apiEndpoint:{default:"http://localhost:3000"},controllerEndpoint:{},username:{},projectPath:{},userImage:{default:Ua},chatbotImage:{default:Oa},dateFormat:{},agentData:{default:()=>({id:"",formId:"",jobId:""})},availableAgents:{default:()=>[]}},emits:["apply-fields","direct-agent-chat"],setup(t,{emit:o}){const n=t,a=o,l=e.ref(!0),r=e.ref(null),i=e.ref(!0),s=e.ref(n.agentData.id),d=e.ref(n.agentData.formId),u=oe(),{isLoading:p,clearChatData:c,getChatData:y,getJobResultData:m,sendPrompt:g,cancelExecution:w}=ut(n.apiEndpoint),{messages:A,addChatMessage:T,clearMessages:q,getLastMessage:_,deleteMessageById:D}=bt(),P=e.computed(()=>l.value||p.value),S=/<span data-type="tool-calling">.*?<\/span>/,x=e.reactive({active:!1,sessionId:"",cancelling:!1,cancelled:!1,callingTools:!1});function N(b){return b.includes('data-type="execution-progress"')}function Y(b){return!N(b)||x.cancelling||x.cancelled||!x.active||!x.callingTools}async function Q(){if(!x.sessionId||x.cancelling)return;x.cancelling=!0;const b=_();if(b){const B='<span data-type="tool-calling">Cancelling</span>';S.test(b.message)&&(b.message=b.message.replace(S,B))}try{await w(x.sessionId),x.cancelled=!0}catch(B){console.error("Error cancelling execution: ",B)}finally{x.cancelling=!1}}function f(b){x.active=!0,x.sessionId=b,x.cancelling=!1,x.cancelled=!1}function h(){x.active=!1,x.sessionId="",x.cancelling=!1}function k(b,B){const M=`<span data-type="tool-calling">${B.replace(/<br\s*\/?>/gi,"")}</span>`;if(S.test(b.message))b.message=b.message.replace(S,M);else{const F=b.message.indexOf(Ha);F!==-1?b.message=b.message.slice(0,F)+M+b.message.slice(F):b.message=M+b.message}}function I(b,B){b.message.endsWith("<br>")||(b.message+="<br>"),b.message+=`${B}<br>`}function $(b){b.message=b.message.replace(S,"")}e.onBeforeMount(()=>{var b;(b=r.value)==null||b.removeEventListener("scroll",J)}),e.onMounted(()=>{C()});function E(b){l.value=b}async function C(){try{await R()}catch(b){T(u.loginError),console.error("Error logging in: "+b)}}async function R(){var M;E(!0);const{data:b,error:B}=await y(n.username,n.projectPath,s.value,d.value);if(B||!b||!b.success){E(!0),T(u.botIsSick),console.log("Error loading chat data: "+B);return}E(!1),((M=b.history)==null?void 0:M.some(F=>{var W;return(W=F.content)==null?void 0:W.includes('data-type="chat-summary"')}))||V(),b.history.forEach(async F=>{T(F.content,F.type==="ai"?"bot":"user",void 0,F.sessionID)})}function V(){const b=u.initialMessage;T(b,"bot",void 0,void 0,!0)}function H(){q(),E(!1),i.value=!0,h()}function J(){if(r.value){const{scrollTop:B,clientHeight:L,scrollHeight:M}=r.value;i.value=B+L>=M-20}}async function j(b,B){r.value&&r.value.scrollTo({top:r.value.scrollHeight,behavior:"smooth"}),T(b,"user",B),K(b,B==null?void 0:B.fileData)}async function re(b){r.value&&r.value.scrollTo({top:r.value.scrollHeight,behavior:"smooth"}),T("","bot");const B=_();B&&await m(b,L=>{if(B.message+=L,B.fields||(B.fields=[]),B.fields.length>0){const M=B.fields[B.fields.length-1];M.text=B.message}},L=>{var F;B.message="";const M=L;(F=B.fields)==null||F.push({id:M.id,type:M.type,name:M.name,text:M.text})},L=>{E(!0),T(u.botIsSick),console.error("Error getting job result: "+L),D(B.id)})}async function K(b,B){const L=gt(),M=b.trim().toLowerCase()===u.approveProceedPlan.toLowerCase(),F=new FormData;if(B&&F.append("file",B),F.append("message",b),F.append("project",n.projectPath),F.append("user",n.username),F.append("sessionID",L),s.value!=="")a("direct-agent-chat",s.value,b);else{T("","bot");const W=_();if(!W)return;M&&f(L);let Te=null;try{await g(F,Z=>{W&&(Te==="tools"&&Z.trim()&&($(W),Te="text",x.callingTools=!1),W.message+=Z)},Z=>{var ht;(ht=Z==null?void 0:Z.data)!=null&&ht.html&&(Z.event==="tool_start"?(k(W,Z.data.html),Te="tools",x.callingTools=!0):Z.event==="tool_end"&&(I(W,Z.data.html),k(W,u.generatingResponse),x.callingTools=!0))},Z=>{E(!0),T(u.botIsSick),console.error("Error sending message: "+Z),D(W.id),M&&h()},()=>{$(W),M&&h()})}catch(Z){M&&h(),console.error("Error sending prompt: ",Z)}}}async function ee(){const b=_(),B=b==null?void 0:b.sessionID,{data:L,error:M}=await c(n.username,n.projectPath,s.value,d.value,B);if(M||!L||!L.success){E(!0),T(u.loginError),console.log("Error clearing chat: "+M);return}H(),V()}function le(b){const B=["q-chatbot__messages-wrapper"];return b==="user"&&B.push("q-chatbot__messages-wrapper_right"),B}async function Be(b){s.value=b.key,d.value=b.formId,H(),await C()}function v(b){!b||b.length===0||a("apply-fields",b)}function X(b){const B=u.regenerateResponsePrompt.replace("{0}",b);a("direct-agent-chat",s.value,B)}return e.watch(()=>n.availableAgents,(b,B)=>{b.length===0&&B.length>0&&(s.value="",d.value="",H(),C())}),e.watch(()=>n.agentData,async(b,B)=>{if(P.value)return;const L=b.jobId,M=B.jobId,F=L!==M;b.id!==s.value&&await Be({formId:b.formId,key:b.id}),L&&F&&await re(L)},{deep:!0}),e.watch(()=>A.value,async()=>{i.value&&r.value&&(await new Promise(b=>setTimeout(b,0)),r.value.scrollTop=r.value.scrollHeight)},{deep:!0,flush:"post"}),(b,B)=>(e.openBlock(),e.createElementBlock("div",za,[e.createElementVNode("div",ja,[e.createVNode(e.unref(Ia),{disabled:P.value,"available-agents":n.availableAgents,"selected-agent-key":s.value,onClear:ee,onChangeChat:Be},null,8,["disabled","available-agents","selected-agent-key"]),e.createElementVNode("div",{ref_key:"messagesContainer",ref:r,class:"q-chatbot__messages-container",onScroll:J},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(A),(L,M)=>(e.openBlock(),e.createElementBlock("div",{key:L.id,class:e.normalizeClass(le(L.sender))},[e.createVNode(e.unref(xa),e.mergeProps({ref_for:!0},L,{"date-format":n.dateFormat,"user-image":n.userImage,"chatbot-image":n.chatbotImage,loading:e.unref(p)&&!L.message,file:L.file,"api-endpoint":n.apiEndpoint,"session-i-d":L.sessionID,fields:L.fields,"is-last-message":M===e.unref(A).length-1,"is-streaming":e.unref(p),"show-cancel-execution":N(L.message),"cancel-execution-disabled":Y(L.message),onRegenerate:X,onApplyFields:v,onSendMessage:j,onCancelExecution:Q}),null,16,["date-format","user-image","chatbot-image","loading","file","api-endpoint","session-i-d","fields","is-last-message","is-streaming","show-cancel-execution","cancel-execution-disabled"])],2))),128))],544)]),e.createElementVNode("div",Ga,[e.createVNode(e.unref(Fa),{disabled:P.value,loading:e.unref(p),onSendMessage:j},null,8,["disabled","loading"])])]))}})});
49
+ `);return n.value.render(w)});return(m,g)=>!l.value&&!p.value&&!r.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"markdown-renderer",innerHTML:a.value},null,8,jo)):r.value?(e.openBlock(),e.createElementBlock("div",Go,[e.createElementVNode("details",Ho,[e.createElementVNode("summary",{class:"markdown-renderer__chat-summary-title",innerHTML:i.value},null,8,Zo),s.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"markdown-renderer__chat-summary-content",innerHTML:s.value},null,8,Qo)):e.createCommentVNode("",!0)])])):l.value?(e.openBlock(),e.createElementBlock("div",Wo,[e.createElementVNode("div",{innerHTML:d.value},null,8,Jo),u.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"markdown-renderer__execution-plan-content",innerHTML:u.value},null,8,Yo)):e.createCommentVNode("",!0)])):p.value?(e.openBlock(),e.createElementBlock("div",Xo,[e.createElementVNode("div",{innerHTML:c.value},null,8,Ko),y.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"markdown-renderer__execution-progress-content",innerHTML:y.value},null,8,ea)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)}});function pt(t,o){switch(t){case"date":return new Date(o).toLocaleDateString();case"number":return parseFloat(o);case"boolean":return o.toLowerCase()==="true";default:return o.toString()}}function ta(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase()}const na=["data-testid"],oa={class:"q-field-preview__toolbar"},aa={class:"q-field-preview__footer"},ra=e.defineComponent({__name:"FieldPreview",props:{name:{},text:{},type:{},disabled:{type:Boolean},applied:{type:Boolean}},emits:["apply","regenerate"],setup(t,{emit:o}){const n=t,a=o,l=oe(),r=e.ref(n.applied),i=e.ref(!1),s=e.computed(()=>n.disabled||r.value),d=e.computed(()=>n.disabled||i.value),u=e.computed(()=>n.type==="text"||n.type==="multiline_text"?xe:"div"),p=e.computed(()=>{const g={};return u.value===xe?g.source=n.text:g.innerHTML=n.text,g}),c=e.computed(()=>{const g=["q-field-preview__content"];return u.value!==xe&&g.push("preserve-whitespace"),g});function y(){if(r.value)return;r.value=!0;const g=pt(n.type,n.text);a("apply",g)}function m(){i.value||(i.value=!0,a("regenerate",n.name))}return(g,w)=>(e.openBlock(),e.createElementBlock("div",{class:"q-field-preview","data-testid":e.unref(ta)(n.name)},[e.createElementVNode("div",oa,[e.createElementVNode("span",null,[e.createTextVNode(e.toDisplayString(e.unref(l).suggestionsForField)+" ",1),e.createElementVNode("b",null,e.toDisplayString(n.name),1)])]),e.createElementVNode("div",{class:e.normalizeClass(c.value)},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(u.value),e.normalizeProps(e.guardReactiveProps(p.value)),null,16))],2),e.createElementVNode("div",aa,[e.createVNode(e.unref(Ge),{borderless:""},{default:e.withCtx(()=>[e.createVNode(e.unref(G),{title:e.unref(l).regenerateResponse,disabled:d.value,readonly:d.value,borderless:"",onClick:m},{default:e.withCtx(()=>[e.createVNode(e.unref(O),{icon:"reset"})]),_:1},8,["title","disabled","readonly"]),e.createVNode(e.unref(G),{label:e.unref(l).apply,"data-testid":"apply-button",disabled:s.value,readonly:s.value,onClick:y},{default:e.withCtx(()=>[e.createVNode(e.unref(O),{icon:"apply"})]),_:1},8,["label","disabled","readonly"])]),_:1})])],8,na))}}),la={class:"pulsing-dots"},ia=["innerHTML"],sa={class:"dots-container"},ft=e.defineComponent({__name:"PulseDots",props:{text:{}},setup(t){const o=t,n=[1,2,3],a=oe(),l=e.computed(()=>o.text||a.generatingResponse);return(r,i)=>(e.openBlock(),e.createElementBlock("div",la,[e.createElementVNode("span",{class:"generating-text",innerHTML:l.value},null,8,ia),e.createElementVNode("div",sa,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(n,(s,d)=>e.createElementVNode("span",{key:d,class:"dot",style:e.normalizeStyle({animationDelay:d*.2+"s"})}," • ",4)),64))])]))}}),ca={class:"q-chatbot__message-container"},da={class:"q-chatbot__message-wrapper"},ua={key:0,class:"q-chatbot__image-preview"},pa=["src","alt"],fa={key:1,class:"q-chatbot__file-preview-container"},ma={class:"q-chatbot__file-icon-container"},ga={class:"q-chatbot__file-info"},ba={class:"q-chatbot__file-name"},ha={class:"q-chatbot__file-extension"},ya={class:"q-chatbot__message"},wa={key:1,class:"q-chatbot__text q-chatbot__user-text"},ka={key:2,class:"q-chatbot__message"},xa=e.defineComponent({__name:"ChatBotMessage",props:{sender:{default:"user"},message:{},date:{default:()=>new Date},loading:{type:Boolean},dateFormat:{},file:{},apiEndpoint:{},sessionID:{},userImage:{default:void 0},chatbotImage:{},isWelcomeMessage:{type:Boolean},fields:{default:()=>[]},isLastMessage:{type:Boolean,default:!1},isStreaming:{type:Boolean},showCancelExecution:{type:Boolean},cancelExecutionDisabled:{type:Boolean}},emits:["apply-fields","regenerate","send-message","cancel-execution"],setup(t,{emit:o}){const n=t,a=o,l=oe(),{handleFeedback:r}=ut(n.apiEndpoint),i=e.computed(()=>n.sender==="bot"&&!Object.values(l||{}).includes(n.message||"")&&!n.isWelcomeMessage),s=e.computed(()=>{var _;return((_=n.file)==null?void 0:_.fileData.type.startsWith("image/"))??!1}),d=e.computed(()=>n.sender==="bot"?n.chatbotImage:n.userImage),u=e.computed(()=>{var D;const _=(D=n.message)==null?void 0:D.match(/<span data-type="tool-calling">(.*?)<\/span>/);return _?_[1]:""}),p=e.computed(()=>{var _;return((_=n.message)==null?void 0:_.replace(/<span data-type="tool-calling">.*?<\/span>/,""))??""}),c=e.computed(()=>{var D,P;return(D=n.file)!=null&&D.fileData?((P=n.file.fileData.name.split(".").pop())==null?void 0:P.toUpperCase())??"":""}),y=e.computed(()=>{var _;return((_=n.message)==null?void 0:_.includes('data-type="execution-plan"'))??!1});function m(){a("send-message",l.approveProceedPlan)}function g(){a("cancel-execution")}function w(){n.message&&navigator.clipboard.writeText(n.message).then(()=>{console.log("Response copied to clipboard")}).catch(_=>{console.error("Failed to copy response: ",_)})}function A(_,D){a("apply-fields",[{id:D.id,text:_}])}function T(){if(!n.fields||n.fields.length===0)return;const _=n.fields.map(D=>({id:D.id,text:pt(D.type,D.text)}));a("apply-fields",_)}function q(_,D){_===null||D===null||!n.sessionID||r(_,D,n.sessionID)}return(_,D)=>{var P,S,x;return e.openBlock(),e.createElementBlock("div",ca,[e.createVNode(e.unref(O),{type:"img",icon:d.value,alt:e.unref(l).senderImage,class:"q-chatbot__profile"},null,8,["icon","alt"]),e.createElementVNode("div",da,[s.value?(e.openBlock(),e.createElementBlock("div",ua,[e.createElementVNode("img",{src:(P=n.file)==null?void 0:P.previewUrl,alt:e.unref(l).imagePreview},null,8,pa)])):(S=n.file)!=null&&S.fileData&&!s.value?(e.openBlock(),e.createElementBlock("div",fa,[e.createElementVNode("div",ma,[e.createVNode(e.unref(O),{icon:"file",class:"q-chatbot__file-icon"})]),e.createElementVNode("div",ga,[e.createElementVNode("span",ba,e.toDisplayString((x=n.file)==null?void 0:x.fileData.name),1),e.createElementVNode("span",ha,e.toDisplayString(c.value),1)])])):e.createCommentVNode("",!0),e.createElementVNode("div",ya,[_.loading?(e.openBlock(),e.createBlock(ft,{key:0})):n.sender==="bot"&&n.fields.length>0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(n.fields,(N,Q)=>(e.openBlock(),e.createBlock(e.unref(ra),{key:Q,class:"q-chatbot__text",text:N.text||"",name:N.name,type:N.type,disabled:_.loading,onRegenerate:()=>a("regenerate",N.name),onApply:W=>A(W,N)},null,8,["text","name","type","disabled","onRegenerate","onApply"]))),128)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[n.sender==="bot"?(e.openBlock(),e.createBlock(e.unref(xe),{key:0,class:"q-chatbot__text",source:p.value||""},null,8,["source"])):(e.openBlock(),e.createElementBlock("div",wa,e.toDisplayString(n.message),1))],64))]),u.value?(e.openBlock(),e.createElementBlock("div",ka,[e.createVNode(ft,{class:"q-chatbot__text",text:u.value},null,8,["text"])])):e.createCommentVNode("",!0)]),e.createVNode(e.unref($a),{"show-buttons":i.value,loading:n.loading,"date-format":n.dateFormat,"is-last-message":n.isLastMessage,"is-execution-plan":y.value,"is-streaming":n.isStreaming,"show-cancel-execution":n.showCancelExecution,"cancel-execution-disabled":n.cancelExecutionDisabled,onCopyResponse:w,onSubmitFeedback:q,onApplyAll:T,onApproveProceedPlan:m,onCancelExecution:g},null,8,["show-buttons","loading","date-format","is-last-message","is-execution-plan","is-streaming","show-cancel-execution","cancel-execution-disabled"])])}}}),z=[];for(let t=0;t<256;++t)z.push((t+256).toString(16).slice(1));function _a(t,o=0){return(z[t[o+0]]+z[t[o+1]]+z[t[o+2]]+z[t[o+3]]+"-"+z[t[o+4]]+z[t[o+5]]+"-"+z[t[o+6]]+z[t[o+7]]+"-"+z[t[o+8]]+z[t[o+9]]+"-"+z[t[o+10]]+z[t[o+11]]+z[t[o+12]]+z[t[o+13]]+z[t[o+14]]+z[t[o+15]]).toLowerCase()}let Me;const Ba=new Uint8Array(16);function Ca(){if(!Me){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Me=crypto.getRandomValues.bind(crypto)}return Me(Ba)}const mt={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function gt(t,o,n){var l;if(mt.randomUUID&&!o&&!t)return mt.randomUUID();t=t||{};const a=t.random??((l=t.rng)==null?void 0:l.call(t))??Ca();if(a.length<16)throw new Error("Random bytes length must be >= 16");return a[6]=a[6]&15|64,a[8]=a[8]&63|128,_a(a)}const ae=e.ref([]),_e=e.ref(1);function bt(){function t(r,i,s,d,u){const p={id:_e.value++,message:r,date:new Date,sender:i||"bot",sessionID:d||gt(),file:s,isWelcomeMessage:u,fields:[]};return ae.value.push(p),p}function o(){return ae.value.find(r=>r.id===_e.value-1)}function n(){ae.value=[],_e.value=1}function a(r){ae.value=ae.value.filter(i=>i.id!==r)}function l(){return ae.value}return{messages:ae,nextMessageId:_e,addChatMessage:t,getLastMessage:o,clearMessages:n,getMessages:l,deleteMessageById:a}}const Ea={class:"q-chatbot__dialog-title"},va={key:0,class:"q-chatbot__feedback-buttons"},Sa={class:"q-chatbot__sender"},$a=e.defineComponent({__name:"ChatBotMessageButtons",props:{loading:{type:Boolean},showButtons:{type:Boolean},dateFormat:{},date:{},isLastMessage:{type:Boolean},isExecutionPlan:{type:Boolean},isStreaming:{type:Boolean},showCancelExecution:{type:Boolean},cancelExecutionDisabled:{type:Boolean}},emits:["submit-feedback","copy-response","apply-all","approve-proceed-plan","cancel-execution"],setup(t,{emit:o}){const n=t,a=o,l=oe(),{getLastMessage:r}=bt(),i=e.ref(!1),s=e.ref(""),d=e.ref(null),u=e.ref(!1),p=e.ref(!1),c=e.ref(!1),y=e.computed(()=>n.loading||u.value),m=e.computed(()=>p.value||!n.isLastMessage||n.loading||n.isStreaming),g=e.computed(()=>c.value||n.cancelExecutionDisabled||!n.isLastMessage||n.loading),w=n.date||new Date,A=r(),T=e.computed(()=>A?A.fields&&A.fields.length>1:!1),q=e.computed(()=>n.isExecutionPlan),_=e.computed(()=>n.showCancelExecution),D=[{id:"confirm-btn",action:I,props:{label:l.submitButton,class:"q-chatbot__dialog-confirm-button"},icon:{icon:"submit"}},{id:"cancel-btn",props:{label:l.cancelButton,class:"q-chatbot__dialog-cancel-button"},icon:{icon:"cancel"}}],P=e.computed(()=>n.dateFormat?x(w,"HH:mm"):w.toLocaleString()),S=e.computed(()=>`${P.value}`);function x(E,C){const R=E.getDate().toString().padStart(2,"0"),V=(E.getMonth()+1).toString().padStart(2,"0"),H=E.getFullYear().toString().padStart(2,"0"),Y=E.getHours().toString().padStart(2,"0"),j=E.getMinutes().toString().padStart(2,"0"),re=E.getSeconds().toString().padStart(2,"0");return C.replace("dd",R).replace("MM",V).replace("yyyy",H).replace("HH",Y).replace("mm",j).replace("ss",re)}function N(E){i.value=!0,s.value="",d.value=E}function Q(){N(0)}function W(){N(1)}function f(){u.value||(u.value=!0,a("apply-all"))}function h(){p.value||(p.value=!0,a("approve-proceed-plan"))}function k(){c.value||(c.value=!0,a("cancel-execution"))}function I(){d.value&&(a("submit-feedback",d.value,s.value),i.value=!1,s.value="",d.value=null)}function $(){a("copy-response")}return(E,C)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(e.unref(ct),{modelValue:i.value,"onUpdate:modelValue":C[1]||(C[1]=R=>i.value=R),inline:"",buttons:D},{body:e.withCtx(()=>[e.createElementVNode("div",Ea,e.toDisplayString(e.unref(l).commentDialogTitle),1),e.createVNode(e.unref(Qe),{modelValue:s.value,"onUpdate:modelValue":C[0]||(C[0]=R=>s.value=R),class:"q-chatbot__dialog-comment-input","max-length":150,size:"large",placeholder:e.unref(l).commentPlaceholder},null,8,["modelValue","placeholder"])]),_:1},8,["modelValue"]),E.showButtons?(e.openBlock(),e.createElementBlock("div",va,[e.createVNode(e.unref(Ge),null,{default:e.withCtx(()=>[e.createVNode(e.unref(G),{title:e.unref(l).goodResponse,class:"q-chatbot__good-response-button",borderless:"",disabled:n.loading,onClick:W},{default:e.withCtx(()=>[e.createVNode(e.unref(O),{icon:"thumb-up"})]),_:1},8,["title","disabled"]),e.createVNode(e.unref(G),{title:e.unref(l).badResponse,class:"q-chatbot__bad-response-button",borderless:"",disabled:n.loading,onClick:Q},{default:e.withCtx(()=>[e.createVNode(e.unref(O),{icon:"thumb-down"})]),_:1},8,["title","disabled"]),e.createVNode(e.unref(G),{title:e.unref(l).copyResponse,class:"q-chatbot__copy-button",borderless:"",disabled:n.loading,onClick:$},{default:e.withCtx(()=>[e.createVNode(e.unref(O),{icon:"copy-content"})]),_:1},8,["title","disabled"]),T.value?(e.openBlock(),e.createBlock(e.unref(G),{key:0,title:y.value?void 0:e.unref(l).applyAll,class:"q-chatbot__apply-all-button",variant:"bold",borderless:"",disabled:y.value,readonly:y.value,label:e.unref(l).applyAll,onClick:f},{default:e.withCtx(()=>[e.createVNode(e.unref(O),{icon:"apply"})]),_:1},8,["title","disabled","readonly","label"])):e.createCommentVNode("",!0),q.value?(e.openBlock(),e.createBlock(e.unref(G),{key:1,title:m.value?void 0:e.unref(l).approveProceed,class:"q-chatbot__approve-proceed-plan-button",variant:"bold",borderless:"",disabled:m.value,readonly:m.value,label:e.unref(l).approveProceed,onClick:h},{default:e.withCtx(()=>[e.createVNode(e.unref(O),{icon:"apply"})]),_:1},8,["title","disabled","readonly","label"])):e.createCommentVNode("",!0),_.value?(e.openBlock(),e.createBlock(e.unref(G),{key:2,title:g.value?void 0:e.unref(l).cancelButton,class:"q-chatbot__cancel-execution-button",borderless:"",disabled:g.value,readonly:g.value,label:e.unref(l).cancelButton,onClick:k},{default:e.withCtx(()=>[e.createVNode(e.unref(O),{icon:"cancel"})]),_:1},8,["title","disabled","readonly","label"])):e.createCommentVNode("",!0)]),_:1})])):e.createCommentVNode("",!0),e.createElementVNode("div",Sa,e.toDisplayString(S.value),1)],64))}}),Na={class:"q-chatbot__tools"},Aa={class:"q-chatbot__tools__select"},Ia=e.defineComponent({__name:"ChatToolBar",props:{disabled:{type:Boolean},availableAgents:{default:()=>[]},selectedAgentKey:{}},emits:["clear","change-chat"],setup(t,{emit:o}){const n=t,a=o,{clearChat:l}=oe(),r={key:"",value:"Default Chat",formId:""},i=e.computed(()=>n.availableAgents&&n.availableAgents.length>0),s=e.ref(n.selectedAgentKey||r.key);e.watch(()=>n.selectedAgentKey,c=>{s.value=c||r.key});const d=e.computed(()=>{var y;const c=(y=n.availableAgents)==null?void 0:y.map(m=>({key:m.key,value:m.value,formId:m.formId}));return c==null||c.push(r),c||[r]});function u(){a("clear")}function p(c){const y=d.value.find(m=>m.key===c);if(y){if(y.key===r.key){a("change-chat",{key:"",formId:""});return}a("change-chat",y)}}return(c,y)=>{const m=e.resolveComponent("q-select");return e.openBlock(),e.createElementBlock("div",Na,[e.createElementVNode("div",Aa,[i.value?(e.openBlock(),e.createBlock(m,{key:0,modelValue:s.value,"onUpdate:modelValue":[y[0]||(y[0]=g=>s.value=g),p],inline:"",required:"",class:"q-chatbot__tools-select-input",size:"medium",items:d.value},null,8,["modelValue","items"])):e.createCommentVNode("",!0)]),e.createVNode(e.unref(G),{title:e.unref(l),disabled:n.disabled,class:"q-chatbot__tools-clear",borderless:"",onClick:u},{default:e.withCtx(()=>[e.createVNode(e.unref(O),{icon:"bin"})]),_:1},8,["title","disabled"])])}}}),Da={class:"q-chatbot__input-wrapper"},Va={key:0,class:"q-chatbot__file-preview"},La=["src","alt"],Ra={key:1,class:"q-chatbot__file-preview",tabindex:"0"},Ma={class:"q-chatbot__file-name"},Ta={class:"q-chatbot__input"},qa={class:"q-chatbot__send-container"},Pa=["accept"],Fa=e.defineComponent({__name:"ChatBotInput",props:{disabled:{type:Boolean},loading:{type:Boolean},userPrompt:{},agentId:{}},emits:["send-message"],setup(t,{emit:o}){const n=t,a=o,l=oe(),r=e.ref(null),i=e.ref(null),s=e.ref(""),d=e.ref(!1),u=e.computed(()=>".png,.jpeg,.jpg,.svg,.webp,.pdf,.doc,.docx"),p=e.computed(()=>i.value?i.value.type.startsWith("image/")??!1:!1),c=e.ref(n.userPrompt??""),y=e.computed(()=>n.disabled||n.loading||c.value.trim().length===0);function m(S){S.preventDefault(),n.disabled||(d.value=!0)}const g=e.computed(()=>({"q-chatbot__footer-disabled":n.disabled,"drag-over":d.value&&!i.value}));function w(S){S.preventDefault(),d.value=!1}function A(S){var N;if(S.preventDefault(),d.value=!1,n.disabled||i.value)return;const x=(N=S.dataTransfer)==null?void 0:N.files;x&&T(x[0])}function T(S){i.value=S,S.type.startsWith("image/")?s.value=URL.createObjectURL(S):s.value=""}function q(){if(!(c.value.trim()===""||n.loading||n.disabled)){if(i.value){const S={fileData:i.value,previewUrl:s.value??""};a("send-message",c.value,S),_()}else a("send-message",c.value);c.value=""}}function _(){i.value=null,s.value="",r.value&&(r.value.value="",r.value.files=null)}function D(){var S;(S=r.value)==null||S.click()}function P(S){var N;const x=S.target;(N=x.files)!=null&&N[0]&&T(x.files[0])}return(S,x)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(e.unref(He),{label:e.unref(l).inputLabel},null,8,["label"]),e.createElementVNode("div",{class:e.normalizeClass(["q-chatbot__footer",g.value]),onDragover:e.withModifiers(m,["prevent"]),onDragleave:e.withModifiers(w,["prevent"]),onDrop:e.withModifiers(A,["prevent"])},[e.createElementVNode("div",Da,[i.value?(e.openBlock(),e.createElementBlock("div",Va,[p.value?(e.openBlock(),e.createElementBlock("img",{key:0,class:"q-chatbot__image-preview",src:s.value,tabindex:"0",alt:e.unref(l).imagePreview},null,8,La)):(e.openBlock(),e.createElementBlock("div",Ra,[e.createVNode(e.unref(O),{icon:"file",class:"q-chatbot__file-icon"}),e.createElementVNode("span",Ma,e.toDisplayString(i.value.name),1)])),e.createVNode(e.unref(G),{class:"q-chatbot__remove-file",tabindex:"0",flat:"",round:"",onClick:_},{default:e.withCtx(()=>[e.createVNode(e.unref(O),{icon:"remove"})]),_:1})])):e.createCommentVNode("",!0),e.createElementVNode("div",Ta,[e.createVNode(e.unref(zo),{id:"chatbot-input",modelValue:c.value,"onUpdate:modelValue":x[0]||(x[0]=N=>c.value=N),size:"block",autosize:"",resize:"none",rows:2,disabled:n.disabled,onKeyup:e.withKeys(q,["enter"])},null,8,["modelValue","disabled"])]),e.createElementVNode("div",qa,[e.createVNode(e.unref(G),{title:e.unref(l).imageUpload,class:"q-chatbot__upload",disabled:n.disabled||n.loading||!!i.value,onClick:D},{default:e.withCtx(()=>[e.createVNode(e.unref(O),{icon:"upload"})]),_:1},8,["title","disabled"]),e.createElementVNode("input",{id:"file-upload",ref_key:"fileInput",ref:r,type:"file",accept:u.value,class:"hidden-input",onChange:P},null,40,Pa),e.createVNode(e.unref(G),{title:e.unref(l).sendMessage,variant:"bold",class:"q-chatbot__send",disabled:y.value,readonly:y.value,onClick:q},{default:e.withCtx(()=>[e.createVNode(e.unref(O),{icon:"send"})]),_:1},8,["title","disabled","readonly"])])])],34)],64))}}),Oa="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20viewBox='0%200%20126.25%20110.36'%3e%3cdefs%3e%3cradialGradient%20id='radial-gradient'%20cx='45.24'%20cy='38.05'%20fx='45.24'%20fy='38.05'%20r='59.09'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%2331319e'/%3e%3cstop%20offset='.19'%20stop-color='%232e2e97'/%3e%3cstop%20offset='.45'%20stop-color='%23292985'/%3e%3cstop%20offset='.75'%20stop-color='%23202067'/%3e%3cstop%20offset='1'%20stop-color='%2317174a'/%3e%3c/radialGradient%3e%3clinearGradient%20id='linear-gradient'%20x1='82.65'%20y1='50.41'%20x2='82.65'%20y2='77.5'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='.02'%20stop-color='%2366ebfe'/%3e%3cstop%20offset='.96'%20stop-color='%2300bfdb'/%3e%3c/linearGradient%3e%3clinearGradient%20id='linear-gradient-2'%20x1='44.6'%20y1='50.01'%20x2='44.6'%20y2='77.1'%20xlink:href='%23linear-gradient'/%3e%3c/defs%3e%3cg%20isolation='isolate'%3e%3cg%20id='Layer_1'%3e%3cpath%20d='M126.2,61.4c-.2-3.69-2.61-17.39-5.92-22.09-2.42-3.44-5.89-4.03-7.96-4.38-.13-.02-.27-.05-.41-.07-.16-.28-.32-.58-.45-.81-.63-1.14-1.03-1.87-1.44-2.44-6.96-9.88-14.91-16.51-24.85-20.69-.25-2.29-.84-5.24-3.37-7.44-2.93-2.55-7.58-2.9-11.68-3.21-.93-.07-1.82-.14-2.4-.22l-.33-.05h-8.61l-.36.05c-.65.1-1.61.17-2.63.24-3.75.27-8.01.57-10.98,2.85-2.94,2.26-3.58,5.55-3.79,7.84-9.71,3.94-17.86,10.71-24.85,20.62-.4.57-.81,1.3-1.43,2.44-.13.23-.29.53-.45.81-.14.02-.28.05-.4.07-2.07.35-5.54.94-7.96,4.39-2.25,3.19-3.84,9.89-4.58,13.59-.6,2.97-1.9,10.3-1.08,14.26.79,3.78,3.66,5.6,5.37,6.68.12.08.26.16.39.25,1.65,10.03,6.98,18.56,15.52,24.77,9.23,6.72,20.2,9.43,27.78,10.52,4.49.65,9.15.97,13.85.97,9.67,0,23.77-1.39,36-8.02,11.58-6.27,18.81-16,21.04-28.24,4.52-2.76,6.36-5.67,5.98-12.71Z'%20fill='%2317174a'/%3e%3cpath%20d='M67.15,4.69c2.98.42,9.31.31,11.62,2.31,1.99,1.73,1.65,4.82,2.06,7.22,10.77,3.89,18.73,10.59,25.39,20.04.64.91,2.13,3.95,2.58,4.33,1.71,1.46,5.54.35,7.67,3.37,2.29,3.25,4.83,15.41,5.06,19.59.31,5.82-.76,6.9-5.58,9.44-3.28,26.16-29.7,34.5-52.68,34.5-4.6,0-9.06-.33-13.17-.93-18.13-2.61-37.11-12.11-39.51-33.08-1.7-1.92-4.96-2.54-5.55-5.39-.95-4.56,2.21-20.32,4.89-24.14,2.13-3.02,5.96-1.91,7.67-3.37.46-.39,1.94-3.42,2.58-4.33,6.54-9.28,14.55-16.22,25.21-19.87.85-.87-.3-5.45,2.43-7.55,2.52-1.94,8.35-1.69,11.42-2.16h7.91'%20fill='%23fff'/%3e%3cpath%20d='M121.86,61.51c-.22-4.2-2.78-16.43-5.07-19.7-1.77-2.51-4.71-2.18-6.64-2.83.1,1.18.16,2.37.16,3.57,0,26.85-25.96,48.61-57.98,48.61-15.83,0-30.17-5.32-40.63-13.94,4.91,17.1,22.06,25.14,38.51,27.52,4.12.59,8.6.93,13.21.93,23.06,0,49.57-8.38,52.85-34.68,4.83-2.56,5.91-3.63,5.6-9.49Z'%20fill='%23d0d7e2'%20mix-blend-mode='multiply'%20opacity='.4'/%3e%3cpath%20d='M62.91,97.68c5.82,0,11.67-.53,16.72-1.56,13.1-2.67,22.09-8.06,26.72-16.03,4.43-7.63,4.75-17.33.96-28.84-4.28-13-13.22-22.77-24.7-27.89-.13,4.51-3.84,8.16-8.38,8.16h-20.89c-4.61,0-8.39-3.78-8.39-8.39v-.14c-5.36,2.25-10.29,5.49-14.5,9.61-8.23,8.06-13.16,19.02-13.9,30.84-.59,9.44,2.67,17.53,9.43,23.42,6.27,5.46,15.68,9.02,27.2,10.3,3.13.35,6.43.52,9.73.52'%20fill='url(%23radial-gradient)'/%3e%3crect%20x='74.34'%20y='50.41'%20width='16.62'%20height='27.09'%20rx='4.06'%20ry='4.06'%20fill='url(%23linear-gradient)'/%3e%3crect%20x='36.29'%20y='50.01'%20width='16.62'%20height='27.09'%20rx='4.06'%20ry='4.06'%20fill='url(%23linear-gradient-2)'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e",Ua="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHgAAAB4CAYAAAA5ZDbSAAAACXBIWXMAAAsTAAALEwEAmpwYAAAF2GlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS42LWMxNDggNzkuMTY0MDM2LCAyMDE5LzA4LzEzLTAxOjA2OjU3ICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdEV2dD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlRXZlbnQjIiB4bWxuczpkYz0iaHR0cDovL3B1cmwub3JnL2RjL2VsZW1lbnRzLzEuMS8iIHhtbG5zOnBob3Rvc2hvcD0iaHR0cDovL25zLmFkb2JlLmNvbS9waG90b3Nob3AvMS4wLyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgMjEuMCAoV2luZG93cykiIHhtcDpDcmVhdGVEYXRlPSIyMDE5LTExLTI5VDEwOjI0OjU3WiIgeG1wOk1ldGFkYXRhRGF0ZT0iMjAxOS0xMS0yOVQxMDoyNDo1N1oiIHhtcDpNb2RpZnlEYXRlPSIyMDE5LTExLTI5VDEwOjI0OjU3WiIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDpiN2ViMDM0NC1hN2UzLTI3NGItODgwNi00ZjMxMzRiNDUwNDEiIHhtcE1NOkRvY3VtZW50SUQ9ImFkb2JlOmRvY2lkOnBob3Rvc2hvcDo2ODJkMGU1OC1kZmQyLTZkNDEtOGIwNy01ZWUxNjU4MWY2ZWEiIHht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",za={class:"q-chatbot"},ja={class:"q-chatbot__content"},Ga={class:"q-chatbot__footer-container"},Ha='<span data-type="execution-progress">';return e.defineComponent({name:"ChatBot",__name:"ChatBot",props:{apiEndpoint:{default:"http://localhost:3000"},controllerEndpoint:{},username:{},projectPath:{},userImage:{default:Ua},chatbotImage:{default:Oa},dateFormat:{},agentData:{default:()=>({id:"",formId:"",jobId:""})},availableAgents:{default:()=>[]}},emits:["apply-fields","direct-agent-chat"],setup(t,{emit:o}){const n=t,a=o,l=e.ref(!0),r=e.ref(null),i=e.ref(!0),s=e.ref(n.agentData.id),d=e.ref(n.agentData.formId),u=oe(),{isLoading:p,clearChatData:c,getChatData:y,getJobResultData:m,sendPrompt:g,cancelExecution:w}=ut(n.apiEndpoint),{messages:A,addChatMessage:T,clearMessages:q,getLastMessage:_,deleteMessageById:D}=bt(),P=e.computed(()=>l.value||p.value),S=/<span data-type="tool-calling">.*?<\/span>/,x=e.reactive({active:!1,sessionId:"",cancelling:!1,cancelled:!1,callingTools:!1});function N(b){return b.includes('data-type="execution-progress"')}function Q(b){return!N(b)||x.cancelling||x.cancelled||!x.active||!x.callingTools}async function W(){if(!x.sessionId||x.cancelling)return;x.cancelling=!0;const b=_();if(b){const B='<span data-type="tool-calling">Cancelling</span>';S.test(b.message)&&(b.message=b.message.replace(S,B))}try{await w(x.sessionId),x.cancelled=!0}catch(B){console.error("Error cancelling execution: ",B)}finally{x.cancelling=!1}}function f(b){x.active=!0,x.sessionId=b,x.cancelling=!1,x.cancelled=!1}function h(){x.active=!1,x.sessionId="",x.cancelling=!1}function k(b,B){const M=`<span data-type="tool-calling">${B.replace(/<br\s*\/?>/gi,"")}</span>`;if(S.test(b.message))b.message=b.message.replace(S,M);else{const F=b.message.indexOf(Ha);F!==-1?b.message=b.message.slice(0,F)+M+b.message.slice(F):b.message=M+b.message}}function I(b,B){b.message.endsWith("<br>")||(b.message+="<br>"),b.message+=`${B}<br>`}function $(b){b.message=b.message.replace(S,"")}e.onBeforeMount(()=>{var b;(b=r.value)==null||b.removeEventListener("scroll",Y)}),e.onMounted(()=>{C()});function E(b){l.value=b}async function C(){try{await R()}catch(b){T(u.loginError),console.error("Error logging in: "+b)}}async function R(){var M;E(!0);const{data:b,error:B}=await y(n.username,n.projectPath,s.value,d.value);if(B||!b||!b.success){E(!0),T(u.botIsSick),console.log("Error loading chat data: "+B);return}E(!1),((M=b.history)==null?void 0:M.some(F=>{var J;return(J=F.content)==null?void 0:J.includes('data-type="chat-summary"')}))||V(),b.history.forEach(async F=>{T(F.content,F.type==="ai"?"bot":"user",void 0,F.sessionID)})}function V(){const b=u.initialMessage;T(b,"bot",void 0,void 0,!0)}function H(){q(),E(!1),i.value=!0,h()}function Y(){if(r.value){const{scrollTop:B,clientHeight:L,scrollHeight:M}=r.value;i.value=B+L>=M-20}}async function j(b,B){r.value&&r.value.scrollTo({top:r.value.scrollHeight,behavior:"smooth"}),T(b,"user",B),K(b,B==null?void 0:B.fileData)}async function re(b){r.value&&r.value.scrollTo({top:r.value.scrollHeight,behavior:"smooth"}),T("","bot");const B=_();B&&await m(b,L=>{if(B.message+=L,B.fields||(B.fields=[]),B.fields.length>0){const M=B.fields[B.fields.length-1];M.text=B.message}},L=>{var F;B.message="";const M=L;(F=B.fields)==null||F.push({id:M.id,type:M.type,name:M.name,text:M.text})},L=>{E(!0),T(u.botIsSick),console.error("Error getting job result: "+L),D(B.id)})}async function K(b,B){const L=gt(),M=b.trim().toLowerCase()===u.approveProceedPlan.toLowerCase(),F=new FormData;if(B&&F.append("file",B),F.append("message",b),F.append("project",n.projectPath),F.append("user",n.username),F.append("sessionID",L),s.value!=="")a("direct-agent-chat",s.value,b);else{T("","bot");const J=_();if(!J)return;M&&f(L);let Te=null;try{await g(F,Z=>{J&&(Te==="tools"&&Z.trim()&&($(J),Te="text",x.callingTools=!1),J.message+=Z)},Z=>{var ht;(ht=Z==null?void 0:Z.data)!=null&&ht.html&&(Z.event==="tool_start"?(k(J,Z.data.html),Te="tools",x.callingTools=!0):Z.event==="tool_end"&&(I(J,Z.data.html),k(J,u.generatingResponse),x.callingTools=!0))},Z=>{E(!0),T(u.botIsSick),console.error("Error sending message: "+Z),D(J.id),M&&h()},()=>{$(J),M&&h()})}catch(Z){M&&h(),console.error("Error sending prompt: ",Z)}}}async function ee(){const b=_(),B=b==null?void 0:b.sessionID,{data:L,error:M}=await c(n.username,n.projectPath,s.value,d.value,B);if(M||!L||!L.success){E(!0),T(u.loginError),console.log("Error clearing chat: "+M);return}H(),V()}function le(b){const B=["q-chatbot__messages-wrapper"];return b==="user"&&B.push("q-chatbot__messages-wrapper_right"),B}async function Be(b){s.value=b.key,d.value=b.formId,H(),await C()}function v(b){!b||b.length===0||a("apply-fields",b)}function X(b){const B=u.regenerateResponsePrompt.replace("{0}",b);a("direct-agent-chat",s.value,B)}return e.watch(()=>n.availableAgents,(b,B)=>{b.length===0&&B.length>0&&(s.value="",d.value="",H(),C())}),e.watch(()=>n.agentData,async(b,B)=>{if(P.value)return;const L=b.jobId,M=B.jobId,F=L!==M;b.id!==s.value&&await Be({formId:b.formId,key:b.id}),L&&F&&await re(L)},{deep:!0}),e.watch(()=>A.value,async()=>{i.value&&r.value&&(await new Promise(b=>setTimeout(b,0)),r.value.scrollTop=r.value.scrollHeight)},{deep:!0,flush:"post"}),(b,B)=>(e.openBlock(),e.createElementBlock("div",za,[e.createElementVNode("div",ja,[e.createVNode(e.unref(Ia),{disabled:P.value,"available-agents":n.availableAgents,"selected-agent-key":s.value,onClear:ee,onChangeChat:Be},null,8,["disabled","available-agents","selected-agent-key"]),e.createElementVNode("div",{ref_key:"messagesContainer",ref:r,class:"q-chatbot__messages-container",onScroll:Y},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(A),(L,M)=>(e.openBlock(),e.createElementBlock("div",{key:L.id,class:e.normalizeClass(le(L.sender))},[e.createVNode(e.unref(xa),e.mergeProps({ref_for:!0},L,{"date-format":n.dateFormat,"user-image":n.userImage,"chatbot-image":n.chatbotImage,loading:e.unref(p)&&!L.message,file:L.file,"api-endpoint":n.apiEndpoint,"session-i-d":L.sessionID,fields:L.fields,"is-last-message":M===e.unref(A).length-1,"is-streaming":e.unref(p),"show-cancel-execution":N(L.message),"cancel-execution-disabled":Q(L.message),onRegenerate:X,onApplyFields:v,onSendMessage:j,onCancelExecution:W}),null,16,["date-format","user-image","chatbot-image","loading","file","api-endpoint","session-i-d","fields","is-last-message","is-streaming","show-cancel-execution","cancel-execution-disabled"])],2))),128))],544)]),e.createElementVNode("div",Ga,[e.createVNode(e.unref(Fa),{disabled:P.value,loading:e.unref(p),onSendMessage:j},null,8,["disabled","loading"])])]))}})});
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { getCurrentInstance as ut, computed as w, inject as dt, ref as q, provide as an, defineComponent as V, openBlock as y, createElementBlock as x, normalizeClass as K, normalizeStyle as Ie, unref as f, toRef as Le, withModifiers as Ue, createVNode as D, createCommentVNode as O, createElementVNode as T, renderSlot as P, createTextVNode as Qe, toDisplayString as se, createBlock as W, resolveDynamicComponent as Bt, h as at, mergeProps as pe, useTemplateRef as Lt, withCtx as R, normalizeProps as Re, guardReactiveProps as Ge, mergeModels as be, useModel as Te, watch as ce, createSlots as Rt, withDirectives as Tt, vModelDynamic as ln, useId as rn, onMounted as Me, onUnmounted as Mt, readonly as sn, customRef as cn, getCurrentScope as un, onScopeDispose as qt, shallowRef as lt, nextTick as De, toValue as pt, reactive as ze, onBeforeUnmount as dn, Fragment as ve, Teleport as pn, Transition as bt, renderList as qe, toHandlers as fn, vModelText as vn, resolveComponent as mn, withKeys as gn, onBeforeMount as bn } from "vue";
1
+ import { getCurrentInstance as ut, computed as w, inject as dt, ref as q, provide as an, defineComponent as V, openBlock as y, createElementBlock as x, normalizeClass as K, normalizeStyle as Ie, unref as f, toRef as Le, withModifiers as Ue, createVNode as D, createCommentVNode as O, createElementVNode as T, renderSlot as P, createTextVNode as Qe, toDisplayString as ce, createBlock as W, resolveDynamicComponent as Bt, h as at, mergeProps as pe, useTemplateRef as Lt, withCtx as R, normalizeProps as Re, guardReactiveProps as Ge, mergeModels as be, useModel as Te, watch as ue, createSlots as Rt, withDirectives as Tt, vModelDynamic as ln, useId as rn, onMounted as Me, onUnmounted as Mt, readonly as sn, customRef as cn, getCurrentScope as un, onScopeDispose as qt, shallowRef as lt, nextTick as De, toValue as pt, reactive as ze, onBeforeUnmount as dn, Fragment as ve, Teleport as pn, Transition as bt, renderList as qe, toHandlers as fn, vModelText as vn, resolveComponent as mn, withKeys as gn, onBeforeMount as bn } from "vue";
2
2
  import Nt from "axios";
3
3
  import hn from "markdown-it";
4
4
  function it(e) {
@@ -278,7 +278,7 @@ const qn = ["id", "disabled"], Nn = {
278
278
  T("span", Fn, [
279
279
  P(d.$slots, "default"),
280
280
  Qe(
281
- " " + se(t.label),
281
+ " " + ce(t.label),
282
282
  1
283
283
  /* TEXT */
284
284
  )
@@ -569,7 +569,7 @@ const Kn = ["id"], eo = /* @__PURE__ */ V({
569
569
  }, o.$attrs), [
570
570
  P(o.$slots, "default", {}, () => [
571
571
  Qe(
572
- se(n.label),
572
+ ce(n.label),
573
573
  1
574
574
  /* TEXT */
575
575
  )
@@ -734,7 +734,7 @@ const Kn = ["id"], eo = /* @__PURE__ */ V({
734
734
  a.value = _ ? m == null ? void 0 : m.slice(0, _) : m;
735
735
  }
736
736
  });
737
- ce(a, (m) => i.value = m, { immediate: !0 });
737
+ ue(a, (m) => i.value = m, { immediate: !0 });
738
738
  const r = vt(o.id), c = q(null), u = q(null), d = w(
739
739
  () => o.readonly || o.disabled ? void 0 : o.placeholder
740
740
  ), s = w(() => o.clearable && !o.readonly && !o.disabled), h = w(() => s.value && a.value);
@@ -929,7 +929,7 @@ function Io(e, n, t = {}) {
929
929
  }, c = w(() => {
930
930
  const s = pt(e);
931
931
  return Array.isArray(s) ? s.map((h) => rt(h)) : [rt(s)];
932
- }), u = ce(
932
+ }), u = ue(
933
933
  c,
934
934
  (s) => {
935
935
  if (r(), i.value && o) {
@@ -962,14 +962,14 @@ function Co(e = {}) {
962
962
  const h = pt(e == null ? void 0 : e.styleTarget);
963
963
  h ? h.style[i] = `${r.value}px` : s = `${r.value}px`, l.value.style[i] = s;
964
964
  }
965
- return ce([a, l], () => De(u), { immediate: !0 }), ce(r, () => {
965
+ return ue([a, l], () => De(u), { immediate: !0 }), ue(r, () => {
966
966
  var d;
967
967
  return (d = e == null ? void 0 : e.onResize) == null ? void 0 : d.call(e);
968
968
  }), Io(l, ([{ contentRect: d }]) => {
969
969
  c.value !== d.width && Eo(o, () => {
970
970
  c.value = d.width, u();
971
971
  });
972
- }), e != null && e.watch && ce(e.watch, u, { immediate: !0, deep: !0 }), {
972
+ }), e != null && e.watch && ue(e.watch, u, { immediate: !0, deep: !0 }), {
973
973
  textarea: l,
974
974
  input: a,
975
975
  triggerResize: u
@@ -1405,12 +1405,12 @@ var $t = {
1405
1405
  * @returns {HTMLElement|undefined} The next tabbable node, if any.
1406
1406
  */
1407
1407
  nextTabbableNode: function(j) {
1408
- var ae = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0, ue = b.indexOf(j);
1409
- return ue < 0 ? ae ? k.slice(k.indexOf(j) + 1).find(function(ne) {
1408
+ var ae = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0, de = b.indexOf(j);
1409
+ return de < 0 ? ae ? k.slice(k.indexOf(j) + 1).find(function(ne) {
1410
1410
  return $e(ne);
1411
1411
  }) : k.slice(0, k.indexOf(j)).reverse().find(function(ne) {
1412
1412
  return $e(ne);
1413
- }) : b[ue + (ae ? 1 : -1)];
1413
+ }) : b[de + (ae ? 1 : -1)];
1414
1414
  }
1415
1415
  };
1416
1416
  }), a.tabbableGroups = a.containerGroups.filter(function(p) {
@@ -1454,8 +1454,8 @@ var $t = {
1454
1454
  return b === ye;
1455
1455
  });
1456
1456
  if (j < 0 && (z.container === b || Ke(b, l.tabbableOptions) && !$e(b, l.tabbableOptions) && !z.nextTabbableNode(b, !1)) && (j = E), j >= 0) {
1457
- var ae = j === 0 ? a.tabbableGroups.length - 1 : j - 1, ue = a.tabbableGroups[ae];
1458
- C = _e(b) >= 0 ? ue.lastTabbableNode : ue.lastDomTabbableNode;
1457
+ var ae = j === 0 ? a.tabbableGroups.length - 1 : j - 1, de = a.tabbableGroups[ae];
1458
+ C = _e(b) >= 0 ? de.lastTabbableNode : de.lastDomTabbableNode;
1459
1459
  } else Be(k) || (C = z.nextTabbableNode(b, !1));
1460
1460
  } else {
1461
1461
  var ne = a.tabbableGroups.findIndex(function(ge) {
@@ -1562,9 +1562,9 @@ var $t = {
1562
1562
  });
1563
1563
  });
1564
1564
  b && v(d());
1565
- }, de = typeof window < "u" && "MutationObserver" in window ? new MutationObserver(M) : void 0, ie = function() {
1566
- de && (de.disconnect(), a.active && !a.paused && a.containers.map(function(p) {
1567
- de.observe(p, {
1565
+ }, ie = typeof window < "u" && "MutationObserver" in window ? new MutationObserver(M) : void 0, re = function() {
1566
+ ie && (ie.disconnect(), a.active && !a.paused && a.containers.map(function(p) {
1567
+ ie.observe(p, {
1568
1568
  subtree: !0,
1569
1569
  childList: !0
1570
1570
  });
@@ -1583,7 +1583,7 @@ var $t = {
1583
1583
  var b = r(p, "onActivate"), k = r(p, "onPostActivate"), F = r(p, "checkCanFocusTrap");
1584
1584
  F || s(), a.active = !0, a.paused = !1, a.nodeFocusedBeforeActivation = t.activeElement, b == null || b();
1585
1585
  var L = function() {
1586
- F && s(), B(), ie(), k == null || k();
1586
+ F && s(), B(), re(), k == null || k();
1587
1587
  };
1588
1588
  return F ? (F(a.containers.concat()).then(L, L), this) : (L(), this);
1589
1589
  },
@@ -1595,7 +1595,7 @@ var $t = {
1595
1595
  onPostDeactivate: l.onPostDeactivate,
1596
1596
  checkCanReturnFocus: l.checkCanReturnFocus
1597
1597
  }, p);
1598
- clearTimeout(a.delayInitialFocusTimer), a.delayInitialFocusTimer = void 0, $(), a.active = !1, a.paused = !1, ie(), $t.deactivateTrap(o, i);
1598
+ clearTimeout(a.delayInitialFocusTimer), a.delayInitialFocusTimer = void 0, $(), a.active = !1, a.paused = !1, re(), $t.deactivateTrap(o, i);
1599
1599
  var k = r(b, "onDeactivate"), F = r(b, "onPostDeactivate"), L = r(b, "checkCanReturnFocus"), C = r(b, "returnFocus", "returnFocusOnDeactivate");
1600
1600
  k == null || k();
1601
1601
  var E = function() {
@@ -1615,7 +1615,7 @@ var $t = {
1615
1615
  var b = [].concat(p).filter(Boolean);
1616
1616
  return a.containers = b.map(function(k) {
1617
1617
  return typeof k == "string" ? t.querySelector(k) : k;
1618
- }), a.active && s(), ie(), this;
1618
+ }), a.active && s(), re(), this;
1619
1619
  }
1620
1620
  }, Object.defineProperties(i, {
1621
1621
  _isManuallyPaused: {
@@ -1629,10 +1629,10 @@ var $t = {
1629
1629
  return this;
1630
1630
  if (a.paused = p, p) {
1631
1631
  var k = r(b, "onPause"), F = r(b, "onPostPause");
1632
- k == null || k(), $(), ie(), F == null || F();
1632
+ k == null || k(), $(), re(), F == null || F();
1633
1633
  } else {
1634
1634
  var L = r(b, "onUnpause"), C = r(b, "onPostUnpause");
1635
- L == null || L(), s(), B(), ie(), C == null || C();
1635
+ L == null || L(), s(), B(), re(), C == null || C();
1636
1636
  }
1637
1637
  return this;
1638
1638
  }
@@ -1645,7 +1645,7 @@ const ia = /* @__PURE__ */ V({
1645
1645
  setup(e, { slots: n }) {
1646
1646
  let t;
1647
1647
  const o = q(), l = () => t && t.activate(), a = () => t && t.deactivate();
1648
- return ce(
1648
+ return ue(
1649
1649
  () => rt(o),
1650
1650
  (i) => {
1651
1651
  i && (t = la(i, e.options || {}), l());
@@ -1982,7 +1982,7 @@ const Ba = ["id"], La = ["role"], Ra = /* @__PURE__ */ V({
1982
1982
  left: void 0,
1983
1983
  hidden: !0
1984
1984
  });
1985
- ce(l, k);
1985
+ ue(l, k);
1986
1986
  const v = w(() => {
1987
1987
  if (r.value) return;
1988
1988
  const S = L(), fe = t.width === "anchor", g = fe ? S == null ? void 0 : S.getBoundingClientRect().width : void 0;
@@ -2017,7 +2017,7 @@ const Ba = ["id"], La = ["role"], Ra = /* @__PURE__ */ V({
2017
2017
  );
2018
2018
  s.left = g.overlayCoords.x, s.top = g.overlayCoords.y, s.placement = g.placement, h.hidden = g.arrowCoords === void 0, g.arrowCoords && (h.top = g.arrowCoords.y, h.left = g.arrowCoords.x);
2019
2019
  }
2020
- ce(
2020
+ ue(
2021
2021
  () => t.placement,
2022
2022
  () => De(J)
2023
2023
  );
@@ -2042,10 +2042,10 @@ const Ba = ["id"], La = ["role"], Ra = /* @__PURE__ */ V({
2042
2042
  function M() {
2043
2043
  clearTimeout(A), A = void 0;
2044
2044
  }
2045
- function de() {
2045
+ function ie() {
2046
2046
  De(ye), o("enter");
2047
2047
  }
2048
- function ie() {
2048
+ function re() {
2049
2049
  F();
2050
2050
  }
2051
2051
  function p() {
@@ -2102,7 +2102,7 @@ const Ba = ["id"], La = ["role"], Ra = /* @__PURE__ */ V({
2102
2102
  break;
2103
2103
  }
2104
2104
  }
2105
- function ue() {
2105
+ function de() {
2106
2106
  const S = L();
2107
2107
  if (S)
2108
2108
  switch (j == null || j.disconnect(), t.trigger) {
@@ -2133,7 +2133,7 @@ const Ba = ["id"], La = ["role"], Ra = /* @__PURE__ */ V({
2133
2133
  }
2134
2134
  return Me(() => {
2135
2135
  De(ae);
2136
- }), dn(ue), (S, fe) => (y(), x(
2136
+ }), dn(de), (S, fe) => (y(), x(
2137
2137
  ve,
2138
2138
  null,
2139
2139
  [
@@ -2167,8 +2167,8 @@ const Ba = ["id"], La = ["role"], Ra = /* @__PURE__ */ V({
2167
2167
  D(bt, {
2168
2168
  name: t.transition,
2169
2169
  appear: "",
2170
- onEnter: de,
2171
- onAfterEnter: ie,
2170
+ onEnter: ie,
2171
+ onAfterEnter: re,
2172
2172
  onLeave: p,
2173
2173
  onAfterLeave: b
2174
2174
  }, {
@@ -2346,7 +2346,7 @@ const Ba = ["id"], La = ["role"], Ra = /* @__PURE__ */ V({
2346
2346
  t.title ? (y(), x(
2347
2347
  "span",
2348
2348
  Pa,
2349
- se(t.title),
2349
+ ce(t.title),
2350
2350
  1
2351
2351
  /* TEXT */
2352
2352
  )) : O("v-if", !0),
@@ -2375,7 +2375,7 @@ const Ba = ["id"], La = ["role"], Ra = /* @__PURE__ */ V({
2375
2375
  }, null, 8, Ga)) : (y(), x(
2376
2376
  "div",
2377
2377
  za,
2378
- se(t.text),
2378
+ ce(t.text),
2379
2379
  1
2380
2380
  /* TEXT */
2381
2381
  ))
@@ -2394,7 +2394,7 @@ const Ba = ["id"], La = ["role"], Ra = /* @__PURE__ */ V({
2394
2394
  icon: "exclamation-sign"
2395
2395
  })) : O("v-if", !0),
2396
2396
  Qe(
2397
- " " + se(i.value),
2397
+ " " + ce(i.value),
2398
2398
  1
2399
2399
  /* TEXT */
2400
2400
  )
@@ -2542,7 +2542,7 @@ const Ya = ["id", "required", "placeholder", "readonly", "disabled", "maxlength"
2542
2542
  t.value = d ? u == null ? void 0 : u.slice(0, d) : u;
2543
2543
  }
2544
2544
  });
2545
- ce(t, (u) => o.value = u, { immediate: !0 });
2545
+ ue(t, (u) => o.value = u, { immediate: !0 });
2546
2546
  const l = vt(n.id), a = w(
2547
2547
  () => n.readonly || n.disabled ? void 0 : n.placeholder
2548
2548
  ), i = w(() => ({ input: n.autosize ? c : null })), r = q(), { triggerResize: c } = Co({
@@ -2680,7 +2680,7 @@ async function Ct(e, n) {
2680
2680
  const M = JSON.parse($);
2681
2681
  switch (B) {
2682
2682
  case "message":
2683
- (d = n.onMessage) == null || d.call(n, M.value);
2683
+ (d = n.onMessage) == null || d.call(n, M.value), await new Promise((ie) => setTimeout(ie, 20));
2684
2684
  break;
2685
2685
  case "tool-status":
2686
2686
  (s = n.onToolStatus) == null || s.call(
@@ -2970,8 +2970,8 @@ const pl = ["data-testid"], fl = { class: "q-field-preview__toolbar" }, vl = { c
2970
2970
  }, [
2971
2971
  T("div", fl, [
2972
2972
  T("span", null, [
2973
- Qe(se(f(l).suggestionsForField) + " ", 1),
2974
- T("b", null, se(t.name), 1)
2973
+ Qe(ce(f(l).suggestionsForField) + " ", 1),
2974
+ T("b", null, ce(t.name), 1)
2975
2975
  ])
2976
2976
  ]),
2977
2977
  T("div", {
@@ -3138,26 +3138,26 @@ const pl = ["data-testid"], fl = { class: "q-field-preview__toolbar" }, vl = { c
3138
3138
  })
3139
3139
  ]),
3140
3140
  T("div", Al, [
3141
- T("span", Il, se(($ = t.file) == null ? void 0 : $.fileData.name), 1),
3142
- T("span", El, se(s.value), 1)
3141
+ T("span", Il, ce(($ = t.file) == null ? void 0 : $.fileData.name), 1),
3142
+ T("span", El, ce(s.value), 1)
3143
3143
  ])
3144
3144
  ])) : O("", !0),
3145
3145
  T("div", Cl, [
3146
- A.loading ? (y(), W(St, { key: 0 })) : t.sender === "bot" && t.fields.length > 0 ? (y(!0), x(ve, { key: 1 }, qe(t.fields, (M, de) => (y(), W(f(ml), {
3147
- key: de,
3146
+ A.loading ? (y(), W(St, { key: 0 })) : t.sender === "bot" && t.fields.length > 0 ? (y(!0), x(ve, { key: 1 }, qe(t.fields, (M, ie) => (y(), W(f(ml), {
3147
+ key: ie,
3148
3148
  class: "q-chatbot__text",
3149
3149
  text: M.text || "",
3150
3150
  name: M.name,
3151
3151
  type: M.type,
3152
3152
  disabled: A.loading,
3153
3153
  onRegenerate: () => o("regenerate", M.name),
3154
- onApply: (ie) => N(ie, M)
3154
+ onApply: (re) => N(re, M)
3155
3155
  }, null, 8, ["text", "name", "type", "disabled", "onRegenerate", "onApply"]))), 128)) : (y(), x(ve, { key: 2 }, [
3156
3156
  t.sender === "bot" ? (y(), W(f(je), {
3157
3157
  key: 0,
3158
3158
  class: "q-chatbot__text",
3159
3159
  source: d.value || ""
3160
- }, null, 8, ["source"])) : (y(), x("div", Sl, se(t.message), 1))
3160
+ }, null, 8, ["source"])) : (y(), x("div", Sl, ce(t.message), 1))
3161
3161
  ], 64))
3162
3162
  ]),
3163
3163
  u.value ? (y(), x("div", Dl, [
@@ -3291,16 +3291,16 @@ const ql = { class: "q-chatbot__dialog-title" }, Nl = {
3291
3291
  }
3292
3292
  ], Q = w(() => t.dateFormat ? $(_, "HH:mm") : _.toLocaleString()), B = w(() => `${Q.value}`);
3293
3293
  function $(C, E) {
3294
- const z = C.getDate().toString().padStart(2, "0"), j = (C.getMonth() + 1).toString().padStart(2, "0"), ae = C.getFullYear().toString().padStart(2, "0"), ue = C.getHours().toString().padStart(2, "0"), ne = C.getMinutes().toString().padStart(2, "0"), he = C.getSeconds().toString().padStart(2, "0");
3295
- return E.replace("dd", z).replace("MM", j).replace("yyyy", ae).replace("HH", ue).replace("mm", ne).replace("ss", he);
3294
+ const z = C.getDate().toString().padStart(2, "0"), j = (C.getMonth() + 1).toString().padStart(2, "0"), ae = C.getFullYear().toString().padStart(2, "0"), de = C.getHours().toString().padStart(2, "0"), ne = C.getMinutes().toString().padStart(2, "0"), he = C.getSeconds().toString().padStart(2, "0");
3295
+ return E.replace("dd", z).replace("MM", j).replace("yyyy", ae).replace("HH", de).replace("mm", ne).replace("ss", he);
3296
3296
  }
3297
3297
  function M(C) {
3298
3298
  i.value = !0, r.value = "", c.value = C;
3299
3299
  }
3300
- function de() {
3300
+ function ie() {
3301
3301
  M(0);
3302
3302
  }
3303
- function ie() {
3303
+ function re() {
3304
3304
  M(1);
3305
3305
  }
3306
3306
  function p() {
@@ -3326,7 +3326,7 @@ const ql = { class: "q-chatbot__dialog-title" }, Nl = {
3326
3326
  buttons: U
3327
3327
  }, {
3328
3328
  body: R(() => [
3329
- T("div", ql, se(f(l).commentDialogTitle), 1),
3329
+ T("div", ql, ce(f(l).commentDialogTitle), 1),
3330
3330
  D(f(Ht), {
3331
3331
  modelValue: r.value,
3332
3332
  "onUpdate:modelValue": E[0] || (E[0] = (z) => r.value = z),
@@ -3346,7 +3346,7 @@ const ql = { class: "q-chatbot__dialog-title" }, Nl = {
3346
3346
  class: "q-chatbot__good-response-button",
3347
3347
  borderless: "",
3348
3348
  disabled: t.loading,
3349
- onClick: ie
3349
+ onClick: re
3350
3350
  }, {
3351
3351
  default: R(() => [
3352
3352
  D(f(X), { icon: "thumb-up" })
@@ -3358,7 +3358,7 @@ const ql = { class: "q-chatbot__dialog-title" }, Nl = {
3358
3358
  class: "q-chatbot__bad-response-button",
3359
3359
  borderless: "",
3360
3360
  disabled: t.loading,
3361
- onClick: de
3361
+ onClick: ie
3362
3362
  }, {
3363
3363
  default: R(() => [
3364
3364
  D(f(X), { icon: "thumb-down" })
@@ -3428,7 +3428,7 @@ const ql = { class: "q-chatbot__dialog-title" }, Nl = {
3428
3428
  _: 1
3429
3429
  })
3430
3430
  ])) : O("", !0),
3431
- T("div", Fl, se(B.value), 1)
3431
+ T("div", Fl, ce(B.value), 1)
3432
3432
  ], 64));
3433
3433
  }
3434
3434
  }), Ol = { class: "q-chatbot__tools" }, Ul = { class: "q-chatbot__tools__select" }, jl = /* @__PURE__ */ V({
@@ -3445,7 +3445,7 @@ const ql = { class: "q-chatbot__dialog-title" }, Nl = {
3445
3445
  value: "Default Chat",
3446
3446
  formId: ""
3447
3447
  }, i = w(() => t.availableAgents && t.availableAgents.length > 0), r = q(t.selectedAgentKey || a.key);
3448
- ce(
3448
+ ue(
3449
3449
  () => t.selectedAgentKey,
3450
3450
  (s) => {
3451
3451
  r.value = s || a.key;
@@ -3590,7 +3590,7 @@ const ql = { class: "q-chatbot__dialog-title" }, Nl = {
3590
3590
  icon: "file",
3591
3591
  class: "q-chatbot__file-icon"
3592
3592
  }),
3593
- T("span", Zl, se(i.value.name), 1)
3593
+ T("span", Zl, ce(i.value.name), 1)
3594
3594
  ])),
3595
3595
  D(f(oe), {
3596
3596
  class: "q-chatbot__remove-file",
@@ -3687,10 +3687,10 @@ const ql = { class: "q-chatbot__dialog-title" }, Nl = {
3687
3687
  function M(g) {
3688
3688
  return g.includes('data-type="execution-progress"');
3689
3689
  }
3690
- function de(g) {
3690
+ function ie(g) {
3691
3691
  return !M(g) || $.cancelling || $.cancelled || !$.active || !$.callingTools;
3692
3692
  }
3693
- async function ie() {
3693
+ async function re() {
3694
3694
  if (!$.sessionId || $.cancelling) return;
3695
3695
  $.cancelling = !0;
3696
3696
  const g = A();
@@ -3729,7 +3729,7 @@ const ql = { class: "q-chatbot__dialog-title" }, Nl = {
3729
3729
  }
3730
3730
  bn(() => {
3731
3731
  var g;
3732
- (g = a.value) == null || g.removeEventListener("scroll", ue);
3732
+ (g = a.value) == null || g.removeEventListener("scroll", de);
3733
3733
  }), Me(() => {
3734
3734
  E();
3735
3735
  });
@@ -3758,8 +3758,8 @@ const ql = { class: "q-chatbot__dialog-title" }, Nl = {
3758
3758
  }
3759
3759
  C(!1), ((H = g.history) == null ? void 0 : H.some(
3760
3760
  (Y) => {
3761
- var re;
3762
- return (re = Y.content) == null ? void 0 : re.includes('data-type="chat-summary"');
3761
+ var se;
3762
+ return (se = Y.content) == null ? void 0 : se.includes('data-type="chat-summary"');
3763
3763
  }
3764
3764
  )) || j(), g.history.forEach(async (Y) => {
3765
3765
  Z(
@@ -3778,7 +3778,7 @@ const ql = { class: "q-chatbot__dialog-title" }, Nl = {
3778
3778
  function ae() {
3779
3779
  J(), C(!1), i.value = !0, b();
3780
3780
  }
3781
- function ue() {
3781
+ function de() {
3782
3782
  if (a.value) {
3783
3783
  const { scrollTop: I, clientHeight: G, scrollHeight: H } = a.value;
3784
3784
  i.value = I + G >= H - 20;
@@ -3826,25 +3826,25 @@ const ql = { class: "q-chatbot__dialog-title" }, Nl = {
3826
3826
  o("direct-agent-chat", r.value, g);
3827
3827
  else {
3828
3828
  Z("", "bot");
3829
- const re = A();
3830
- if (!re) return;
3829
+ const se = A();
3830
+ if (!se) return;
3831
3831
  H && p(G);
3832
3832
  let Ye = null;
3833
3833
  try {
3834
3834
  await m(
3835
3835
  Y,
3836
3836
  (le) => {
3837
- re && (Ye === "tools" && le.trim() && (L(re), Ye = "text", $.callingTools = !1), re.message += le);
3837
+ se && (Ye === "tools" && le.trim() && (L(se), Ye = "text", $.callingTools = !1), se.message += le);
3838
3838
  },
3839
3839
  (le) => {
3840
3840
  var gt;
3841
- (gt = le == null ? void 0 : le.data) != null && gt.html && (le.event === "tool_start" ? (k(re, le.data.html), Ye = "tools", $.callingTools = !0) : le.event === "tool_end" && (F(re, le.data.html), k(re, u.generatingResponse), $.callingTools = !0));
3841
+ (gt = le == null ? void 0 : le.data) != null && gt.html && (le.event === "tool_start" ? (k(se, le.data.html), Ye = "tools", $.callingTools = !0) : le.event === "tool_end" && (F(se, le.data.html), k(se, u.generatingResponse), $.callingTools = !0));
3842
3842
  },
3843
3843
  (le) => {
3844
- C(!0), Z(u.botIsSick), console.error("Error sending message: " + le), U(re.id), H && b();
3844
+ C(!0), Z(u.botIsSick), console.error("Error sending message: " + le), U(se.id), H && b();
3845
3845
  },
3846
3846
  () => {
3847
- L(re), H && b();
3847
+ L(se), H && b();
3848
3848
  }
3849
3849
  );
3850
3850
  } catch (le) {
@@ -3880,12 +3880,12 @@ const ql = { class: "q-chatbot__dialog-title" }, Nl = {
3880
3880
  const I = u.regenerateResponsePrompt.replace("{0}", g);
3881
3881
  o("direct-agent-chat", r.value, I);
3882
3882
  }
3883
- return ce(
3883
+ return ue(
3884
3884
  () => t.availableAgents,
3885
3885
  (g, I) => {
3886
3886
  g.length === 0 && I.length > 0 && (r.value = "", c.value = "", ae(), E());
3887
3887
  }
3888
- ), ce(
3888
+ ), ue(
3889
3889
  () => t.agentData,
3890
3890
  async (g, I) => {
3891
3891
  if (Q.value) return;
@@ -3893,7 +3893,7 @@ const ql = { class: "q-chatbot__dialog-title" }, Nl = {
3893
3893
  g.id !== r.value && await Ne({ formId: g.formId, key: g.id }), G && Y && await he(G);
3894
3894
  },
3895
3895
  { deep: !0 }
3896
- ), ce(
3896
+ ), ue(
3897
3897
  () => N.value,
3898
3898
  async () => {
3899
3899
  i.value && a.value && (await new Promise((g) => setTimeout(g, 0)), a.value.scrollTop = a.value.scrollHeight);
@@ -3912,7 +3912,7 @@ const ql = { class: "q-chatbot__dialog-title" }, Nl = {
3912
3912
  ref_key: "messagesContainer",
3913
3913
  ref: a,
3914
3914
  class: "q-chatbot__messages-container",
3915
- onScroll: ue
3915
+ onScroll: de
3916
3916
  }, [
3917
3917
  (y(!0), x(ve, null, qe(f(N), (G, H) => (y(), x("div", {
3918
3918
  key: G.id,
@@ -3930,11 +3930,11 @@ const ql = { class: "q-chatbot__dialog-title" }, Nl = {
3930
3930
  "is-last-message": H === f(N).length - 1,
3931
3931
  "is-streaming": f(d),
3932
3932
  "show-cancel-execution": M(G.message),
3933
- "cancel-execution-disabled": de(G.message),
3933
+ "cancel-execution-disabled": ie(G.message),
3934
3934
  onRegenerate: fe,
3935
3935
  onApplyFields: S,
3936
3936
  onSendMessage: ne,
3937
- onCancelExecution: ie
3937
+ onCancelExecution: re
3938
3938
  }), null, 16, ["date-format", "user-image", "chatbot-image", "loading", "file", "api-endpoint", "session-i-d", "fields", "is-last-message", "is-streaming", "show-cancel-execution", "cancel-execution-disabled"])
3939
3939
  ], 2))), 128))
3940
3940
  ], 544)
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@quidgest/chatbot",
3
3
  "private": false,
4
- "version": "0.6.4",
4
+ "version": "0.6.5",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",
7
7
  "main": "dist/index.cjs",
@@ -70,6 +70,7 @@ export async function useSSE(config: AxiosRequestConfig, handlers: SSEvents) {
70
70
  switch (name) {
71
71
  case 'message':
72
72
  handlers.onMessage?.(parsedData.value)
73
+ await new Promise((resolve) => setTimeout(resolve, 20))
73
74
  break
74
75
  case 'tool-status':
75
76
  handlers.onToolStatus?.(