@progress/kendo-vue-conversational-ui 9.0.0-develop.1 → 9.0.0-develop.3
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.
|
@@ -12,4 +12,4 @@
|
|
|
12
12
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
13
13
|
*-------------------------------------------------------------------------------------------
|
|
14
14
|
*/
|
|
15
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue"),require("@progress/kendo-vue-common"),require("@progress/kendo-vue-buttons"),require("@progress/kendo-svg-icons"),require("@progress/kendo-vue-inputs"),require("@progress/kendo-vue-layout"),require("@progress/kendo-vue-intl"),require("@progress/kendo-vue-upload")):"function"==typeof define&&define.amd?define(["exports","vue","@progress/kendo-vue-common","@progress/kendo-vue-buttons","@progress/kendo-svg-icons","@progress/kendo-vue-inputs","@progress/kendo-vue-layout","@progress/kendo-vue-intl","@progress/kendo-vue-upload"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).KendoVueConversationalUi={},e.Vue,e.KendoVueCommon,e.KendoVueButtons,e.KendoSVGIcons,e.KendoVueInputs,e.KendoVueLayout,e.KendoVueIntl,e.KendoVueUpload)}(this,function(e,t,o,n,i,s,l,r,a){"use strict";function d(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!t.isVNode(e)}const u=t.defineComponent({name:"KendoAIPromptHeader",props:{activeView:String,toolbarItems:Array,onActiveviewchange:Function},methods:{handleClick(e){this.$emit("activeviewchange",e)}},render(){let e;const{activeView:i,toolbarItems:s}=this.$props;return t.createVNode("div",{class:"k-prompt-header"},[t.createVNode(n.Toolbar,{overflow:"none",keyboardNavigation:!1,class:"k-toolbar-flat"},d(e=s.map(function(e){const s=o.getTemplate.call(this,{h:t.h,template:e.content,defaultRendering:null,additionalProps:{item:e}});return e.content?s:t.createVNode(n.Button,{type:"button",key:e.name,class:o.classNames("k-toolbar-item",{"k-selected":i===e.name}),size:"medium",themeColor:"primary",fillMode:"flat",rounded:"full",title:e.buttonText,svgIcon:e.buttonIcon,onClick:()=>this.handleClick(e.name)},{default:()=>[e.buttonText]})},this))?e:{default:()=>[e]})])}}),c={name:"Output view",buttonText:"Output",buttonIcon:i.commentIcon},p={name:"Commands view",buttonIcon:i.moreHorizontalIcon},h={name:"Prompt view",buttonText:"Ask AI",buttonIcon:i.sparklesIcon},m={name:"@progress/kendo-vue-conversational-ui",productName:"Kendo UI for Vue",productCode:"KENDOUIVUE",productCodes:["KENDOUIVUE"],publishDate:0,version:"9.0.0-develop.1",licensingDocsUrl:"https://www.telerik.com/kendo-vue-ui/my-license/"},g=t.defineComponent({name:"KendoAIPrompt",props:{activeView:{type:String,required:!0},dir:String,toolbarItems:Array,outputs:Array,promptPlaceholder:String,streaming:Boolean,loading:Boolean,suggestionsView:{type:String,default:"classic"}},provide(){return{kendoAIPrompt:this.$data.contextState}},data(){return{showLicenseWatermark:!1,licenseMessage:"",contextState:{activeView:this.$props.activeView,streaming:this.$props.streaming,loading:this.$props.loading,onCancel:this.onCancel,onActiveViewChange:this.onActiveViewChange,onPromptRequest:this.onPromptRequest,onCommandExecute:this.onCommandExecute,onStateAction:this.onStateAction,suggestionsView:this.$props.suggestionsView}}},watch:{activeView(e){this.contextState.activeView=e},streaming(e){this.contextState.streaming=e},loading(e){this.contextState.loading=e}},methods:{onStateAction(e){this.contextState.activeView=e.activeView},onActiveViewChange(e){this.$emit("activeviewchange",e)},onPromptRequest(e,t){this.$emit("promptrequest",e,t)},onCommandExecute(e){this.$emit("commandexecute",e)},onCancel(){this.$emit("cancel")}},render(){o.validatePackage(m),this.showLicenseWatermark=o.shouldShowValidationUI(m),this.licenseMessage=o.getLicenseMessage(m);const e=o.getDefaultSlots(this),{toolbarItems:n,dir:i}=this.$props,s=(n||[h,c]).map(e=>{const t=o.templateRendering.call(this,e.content,o.getListeners.call(this));return{...e,content:t}}),l=this.showLicenseWatermark?t.createVNode(o.WatermarkOverlay,{message:this.licenseMessage},null):null;return t.createVNode("div",{class:"k-prompt",dir:i},[t.createVNode(u,{activeView:this.contextState.activeView,toolbarItems:s,onActiveviewchange:this.onActiveViewChange},null),e,l])}}),f=t.defineComponent({name:"KendoAIPromptFooter",render(){const e=o.getDefaultSlots(this);return t.createVNode("div",{class:"k-prompt-footer"},[t.createVNode("div",{class:"k-actions k-actions-start k-actions-horizontal k-prompt-actions"},[e])])}}),v=t.defineComponent({name:"KendoAIPromptContent",props:{onCancel:Function,streaming:Boolean},inject:{kendoAIPrompt:{default:null}},computed:{showFloatingButton(){var e;const t=(null==(e=this.kendoAIPrompt)?void 0:e.activeView)===c.name;return this.streaming&&t}},methods:{handleKeyDown(e){"Escape"===e.key&&this.showFloatingButton&&this.onCancel&&(e.preventDefault(),this.$props.onCancel())}},render(){const e=o.getDefaultSlots(this);return t.createVNode("div",{class:"k-prompt-content",onKeydown:this.handleKeyDown},[this.showFloatingButton&&t.createVNode(n.FloatingActionButton,{onClick:this.onCancel,svgIcon:i.stopIcon,size:"small",positionMode:"absolute",class:"k-prompt-stop-fab k-generating"},null),t.createVNode("div",{class:"k-prompt-view"},[e])])}}),k=t.defineComponent({name:"KendoAIPromptViewRender",inheritAttrs:!1,props:{name:String},inject:{kendoAIPrompt:{default:null}},render(){const e=o.getDefaultSlots(this);return this.kendoAIPrompt.activeView===this.$props.name?e:null}});function b(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!t.isVNode(e)}const V=t.defineComponent({name:"KendoAIPromptExpander",props:{title:String},data:()=>({expanded:!0}),methods:{buttonClick(){this.expanded=!this.expanded}},render(){const e=o.getDefaultSlots(this),{title:s}=this.$props;return t.createVNode("div",{class:"k-prompt-expander"},[t.createVNode(n.Button,{type:"button",fillMode:"flat",svgIcon:this.expanded?i.chevronUpIcon:i.chevronDownIcon,title:s,onClick:this.buttonClick},b(s)?s:{default:()=>[s]}),this.expanded&&t.createVNode("div",{class:"k-prompt-expander-content"},[e])])}}),x=t.defineComponent({name:"KendoSuggestionGroup",props:{suggestions:{type:Array,required:!0},onSuggestionClick:{type:Function,required:!0},suggestionsView:{type:String,default:"classic"}},methods:{handleSuggestionClick(e,t){t.disabled||this.onSuggestionClick(e,t)},handleKeyDown(e,t){("Enter"===e.key||" "===e.key)&&(e.preventDefault(),this.onSuggestionClick(e,t))}},render(){const{suggestions:e,suggestionsView:n}=this.$props,i=()=>e.map(e=>t.createVNode("span",{role:"button",tabindex:e.disabled?-1:0,"aria-label":e.description,"aria-disabled":e.disabled,onClick:t=>!e.disabled&&this.handleSuggestionClick(t,e),onKeydown:t=>!e.disabled&&this.handleKeyDown(t,e),key:e.id,title:e.description,class:o.classNames("classic"===n?"k-prompt-suggestion":"k-suggestion",{"k-disabled":e.disabled})},[e.text]));return"classic"===n?i():t.createVNode("div",{role:"group",class:"k-suggestion-group"},[i()])}});function y(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!t.isVNode(e)}const C=t.defineComponent({name:"KendoAIPromptView",props:{promptInput:[Object,String],generateButton:[Object,String],promptValue:String,promptSuggestions:Array,enableSpeechToText:[Boolean,Object]},inject:{kendoAIPrompt:{default:null}},computed:{computedValue(){return void 0!==this.$props.promptValue?this.$props.promptValue:this.value}},data:()=>({value:""}),methods:{handleOnRequest(){this.kendoAIPrompt.onPromptRequest&&this.kendoAIPrompt.onPromptRequest.call(null,this.computedValue),this.value=""},handleSuggestionSelect(e){this.value=e},onTextChange(e){this.value=e.value},onSpeechResult(e){if(e.isFinal&&e.alternatives.length>0){const t=e.alternatives[0].transcript,o=this.value,n=o&&!o.endsWith(" ")&&!o.endsWith("\n");this.value=o+(n?" ":"")+t}},onSpeechStart(){},onSpeechEnd(){},getButtonDisabledState(){const e=void 0!==this.$props.promptValue?this.$props.promptValue:this.value;return!(null!=e&&e.trim())}},render(){const e="Generate",{promptSuggestions:l,enableSpeechToText:r}=this.$props,a=o.templateRendering.call(this,this.$props.promptInput,o.getListeners.call(this)),d=t.createVNode(s.TextArea,{value:this.computedValue,onInput:this.onTextChange,placeholder:"Ask or generate content with AI ...",rows:2,class:"!k-flex-col",inputSuffix:()=>r?t.createVNode(t.Fragment,null,[t.createVNode(s.InputSeparator,{orientation:"horizontal"},null),t.createVNode("div",{class:"k-input-suffix k-input-suffix-horizontal"},[t.createVNode(n.SpeechToTextButton,t.mergeProps({fillMode:"flat",onStart:this.onSpeechStart,onEnd:this.onSpeechEnd,onResult:this.onSpeechResult},"object"==typeof r?r:{}),null)])]):null},null),u=o.getTemplate.call(this,{h:t.h,template:a,defaultRendering:d}),c=o.templateRendering.call(this,this.$props.generateButton,o.getListeners.call(this)),p=t.createVNode(n.Button,{type:"button",themeColor:"primary",fillMode:"solid","aria-hidden":"true",rounded:"full",size:"medium",onClick:this.handleOnRequest,disabled:this.getButtonDisabledState(),title:"Generate",svgIcon:i.sparklesIcon},y(e)?e:{default:()=>[e]}),m=o.getTemplate.call(this,{h:t.h,template:c,defaultRendering:p});return t.createVNode(k,{name:h.name},{default:()=>{var e,o;return[t.createVNode(v,{streaming:null==(e=this.kendoAIPrompt)?void 0:e.streaming,onCancel:null==(o=this.kendoAIPrompt)?void 0:o.onCancel},{default:()=>[u,l&&l.length>0&&t.createVNode(V,{title:"Prompt Suggestions"},{default:()=>{var e;return[t.createVNode(x,{suggestionsView:null==(e=this.kendoAIPrompt)?void 0:e.suggestionsView,suggestions:l.map((e,t)=>({id:t,text:e,description:e})),onSuggestionClick:(e,t)=>this.handleSuggestionSelect(t.text)},null)]}})]}),t.createVNode(f,null,y(m)?m:{default:()=>[m]})]}})}}),A="avatar.alt",S="messageList.ariaLabel",$="aIPrompt.noOutputs",I="promptBox.input",N="promptBox.sendButton",w="promptBox.attachFile",B="promptBox.removeFile",R="promptBox.stopGenerating",P="promptBox.ariaLabel",F={[A]:"Avatar",[S]:"Message list",[$]:"No output from Ai available",[I]:"Prompt",[N]:"Send",[w]:"Attach file",[B]:"Remove file",[R]:"Stop generating",[P]:"Prompt box"};function T(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!t.isVNode(e)}let O=function(e){return e.positive="positive",e.negative="negative",e}({});const z=t.defineComponent({name:"KendoAIPromptOutputView",emits:{copy:null,retry:null,rating:null},props:{outputs:Array,outputCard:Object,showOutputRating:Boolean},inject:{kendoAIPrompt:{default:null},kendoLocalizationService:{default:null}},data:()=>({copiedIndex:-1,copyButtonIcon:i.copyIcon,contentRef:null}),methods:{retryPrompt(e){this.$emit("retry",e),this.kendoAIPrompt.onPromptRequest&&this.kendoAIPrompt.onPromptRequest.call(null,e.prompt,{...e,isRetry:!0}),this.scrollToTopOutput()},copyToClipboard(e,t){null!=e&&e.responseContent&&navigator.clipboard.writeText(e.responseContent),this.copiedIndex=t,this.copyButtonIcon=i.checkIcon,this.$emit("copy",null==e?void 0:e.responseContent),setTimeout(()=>{this.copyButtonIcon=i.copyIcon,this.copiedIndex=-1},1e3)},outputRating(e,t){this.$emit("rating",e,t),this.kendoAIPrompt.onPromptRequest&&this.kendoAIPrompt.onPromptRequest.call(null,e.prompt,{...e,ratingType:t,isRetry:!1}),this.scrollToTopOutput()},scrollToTopOutput(){var e,t;null==(t=null==(e=this.contentRef)?void 0:e.scrollTo)||t.call(e,{top:0,behavior:"smooth"})}},render(){let e;const{outputs:o,showOutputRating:s,outputCard:a}=this.$props,d=r.provideLocalizationService(this),{header:u,body:p,actions:h}=a||{},m=t.createVNode(l.Card,null,{default:()=>[t.createVNode(l.CardHeader,null,{default:()=>[t.createVNode(l.CardTitle,null,{default:()=>[t.createVNode("span",{class:"k-skeleton k-skeleton-text k-skeleton-pulse",style:{width:"200px"}},null)]}),t.createVNode(l.CardSubtitle,null,{default:()=>[t.createVNode("span",{class:"k-skeleton k-skeleton-text k-skeleton-pulse",style:{width:"100%"}},null)]})]}),t.createVNode(l.CardBody,null,{default:()=>[t.createVNode("span",{class:"k-skeleton k-skeleton-rect k-skeleton-pulse",style:{height:"80px"}},null)]}),t.createVNode(l.CardActions,null,{default:()=>[t.createVNode("span",{class:"k-skeleton k-skeleton-text k-skeleton-pulse",style:{width:"100%"}},null)]})]}),g=null==o?void 0:o.map((e,o)=>t.createVNode(l.Card,{key:`${e.id}_${o}`,class:e.class},{default:()=>[t.createVNode(l.CardHeader,null,{default:()=>[u?u(e):t.createVNode(t.Fragment,null,[e.title&&t.createVNode(l.CardTitle,null,{default:()=>[e.title]}),e.subTitle&&t.createVNode(l.CardSubtitle,null,{default:()=>[e.subTitle]})])]}),t.createVNode(l.CardBody,null,{default:()=>[p?p(e):e.responseContent]}),t.createVNode(l.CardActions,null,{default:()=>[h?h(e):t.createVNode(t.Fragment,null,[t.createVNode(n.Button,{type:"button",size:"medium",themeColor:"primary",fillMode:"flat",rounded:"medium",title:"Copy",svgIcon:this.copiedIndex===o?this.copyButtonIcon:i.copyIcon,"aria-hidden":"true",onClick:()=>this.copyToClipboard(e,o)},{default:()=>["Copy"]}),t.createVNode(n.Button,{type:"button",size:"medium",themeColor:"base",fillMode:"flat",rounded:"medium",title:"Retry",svgIcon:i.arrowRotateCwIcon,"aria-hidden":"true",onClick:()=>this.retryPrompt(e)},{default:()=>["Retry"]}),s&&t.createVNode(t.Fragment,null,[t.createVNode("span",{class:"k-spacer"},null),t.createVNode(n.Button,{type:"button",size:"medium",themeColor:"positive"===e.ratingType?"primary":"base",fillMode:"flat",rounded:"medium",title:"Rate up",svgIcon:i.thumbUpIcon,"aria-hidden":"true",onClick:()=>this.outputRating(e,"positive")},null),t.createVNode(n.Button,{type:"button",size:"medium",themeColor:"negative"===e.ratingType?"primary":"base",fillMode:"flat",rounded:"medium",title:"Rate down",svgIcon:i.thumbDownIcon,"aria-hidden":"true",onClick:()=>this.outputRating(e,"negative")},null)])])]})]})),f=t.createVNode(l.Card,null,{default:()=>[t.createVNode(l.CardBody,null,T(e=d.toLanguageString($,F[$]))?e:{default:()=>[e]})]});return t.createVNode(k,{name:c.name},{default:()=>{var e,o;return[t.createVNode(v,{ref:e=>this.contentRef=e,streaming:null==(e=this.kendoAIPrompt)?void 0:e.streaming,onCancel:null==(o=this.kendoAIPrompt)?void 0:o.onCancel},{default:()=>{var e,o;return[t.createVNode("div",{class:"k-card-list"},[(null==(e=this.kendoAIPrompt)?void 0:e.loading)&&m,g,(!g||0===g.length)&&!(null!=(o=this.kendoAIPrompt)&&o.loading)&&f])]}})]}})}}),L=t.defineComponent({name:"KendoAIPromptCommandsView",props:{commands:Array},inject:{kendoAIPrompt:{default:null}},render(){const{commands:e}=this.$props,o=e=>{var t;const o=e.target;(null==(t=o.items)||!t.length)&&this.kendoAIPrompt.onCommandExecute&&(this.$emit("commandexecute",o),this.kendoAIPrompt.onCommandExecute.call(null,o))};return t.createVNode(k,{name:p.name},{default:()=>{var n,i;return[t.createVNode(v,{streaming:null==(n=this.kendoAIPrompt)?void 0:n.streaming,onCancel:null==(i=this.kendoAIPrompt)?void 0:i.onCancel},{default:()=>[t.createVNode("div",{class:"k-prompt-view"},[t.createVNode(l.PanelBar,{onSelect:o,items:e},null)])]})]}})}}),M=t.defineComponent({name:"KendoPromptBoxActionButton",inheritAttrs:!1,render(){return t.createVNode(n.Button,this.$attrs,null)}}),E=t.defineComponent({name:"KendoPromptBoxSpeechToTextButton",inheritAttrs:!1,render(){return t.createVNode(n.SpeechToTextButton,this.$attrs,null)}}),j=t.defineComponent({name:"KendoPromptBoxUploadButton",inheritAttrs:!1,props:{onFilesAdd:Function,files:{type:Array,default:()=>[]},restrictions:Object,multiple:{type:Boolean,default:!0},accept:String,onSelectAttachments:Function,onRemoveAttachment:Function,_registerRemoveCallback:Function},setup(e){const o=t.ref(null);return t.watch(()=>e.onRemoveAttachment,t=>{e._registerRemoveCallback&&t&&e._registerRemoveCallback(t)},{immediate:!0}),t.onUnmounted(()=>{e._registerRemoveCallback&&e.onRemoveAttachment&&e._registerRemoveCallback(void 0)}),{uploadRef:o,handleFilesAdd:t=>{e.onFilesAdd&&e.onFilesAdd(t),e.onSelectAttachments&&e.onSelectAttachments({selectedFiles:t.affectedFiles,allFiles:t.newState})}}},render(){const{onFilesAdd:e,files:o,restrictions:i,multiple:s,accept:l,onSelectAttachments:r,onRemoveAttachment:d,_registerRemoveCallback:u,_uploadRef:c,...p}=this.$attrs;return t.createVNode(t.Fragment,null,[t.createVNode(n.Button,p,null),t.createVNode(a.Upload,{ref:e=>{this.uploadRef=e,c&&(c.value=e)},files:this.files,onAdd:this.handleFilesAdd,autoUpload:!1,restrictions:this.restrictions,multiple:this.multiple,accept:this.accept,class:"k-hidden"},null)])}}),H=e=>"."+(e.split(".").pop()||""),K=e=>{if(null==e)return"";if(0===e)return"0 B";const t=Math.floor(Math.log(e)/Math.log(1024));return`${Number.parseFloat((e/Math.pow(1024,t)).toFixed(2))} ${["B","KB","MB","GB","TB"][t]}`},D=t.defineComponent({name:"KendoFileBox",props:{files:{type:Array,required:!0},onRemoveFile:{type:Function,required:!0},header:{type:[Object,Function,String],default:void 0}},inject:{kendoLocalizationService:{default:null}},data:()=>({canScrollRight:!1,canScrollLeft:!1,resizeObserver:null}),watch:{files:{handler(){t.nextTick(()=>{this.setupScrollListeners(),this.updateScrollState()})},deep:!0}},mounted(){t.nextTick(()=>{this.setupScrollListeners(),this.updateScrollState()})},beforeUnmount(){this.cleanupScrollListeners()},methods:{setupScrollListeners(){const e=this.$refs.scrollContainer;e?this._scrollContainer!==e&&(this.cleanupScrollListeners(),e.addEventListener("scroll",this.updateScrollState,{passive:!0}),this.resizeObserver=new ResizeObserver(()=>this.updateScrollState()),this.resizeObserver.observe(e),this._scrollContainer=e):this.cleanupScrollListeners()},cleanupScrollListeners(){this._scrollContainer&&(this._scrollContainer.removeEventListener("scroll",this.updateScrollState),this._scrollContainer=null),this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)},updateScrollState(){const e=this.$refs.scrollContainer;if(!e)return;const{scrollLeft:t,scrollWidth:o,clientWidth:n}=e,i=0===t,s=t+n>=o-1;this.canScrollLeft=!i,this.canScrollRight=!s},handleRemoveFile(e,t){t.stopPropagation(),this.$props.onRemoveFile&&this.$props.onRemoveFile(e)}},render(){const e=r.provideLocalizationService(this),{files:s,header:l}=this.$props;if(0===s.length&&!l)return null;const a=o.getTemplate.call(this,{h:t.h,template:l,defaultRendering:null}),d=e.toLanguageString(B,F[B]),u=s.length>0&&t.createVNode("ul",{class:o.classNames("k-file-box-wrapper",{"k-file-box-wrapper-scrollable-start":this.canScrollRight,"k-file-box-wrapper-scrollable-end":this.canScrollLeft})},[t.createVNode("div",{class:"k-files-scroll",ref:"scrollContainer"},[s.map(e=>t.createVNode("li",{key:e.name,class:"k-file-box"},[t.createVNode(o.Icon,t.mergeProps({size:"xlarge"},o.getFileExtensionIcon(H(e.name))),null),t.createVNode("div",{class:"k-file-info"},[t.createVNode("span",{class:"k-file-name"},[e.name]),t.createVNode("span",{class:"k-file-size"},[K(e.size)])]),t.createVNode(n.Button,{fillMode:"flat",svgIcon:i.xCircleIcon,onClick:t=>this.handleRemoveFile(e.name,t),"aria-label":`${d} ${e.name}`,title:`${d} ${e.name}`},null)]))])]);return t.createVNode("div",{class:"k-prompt-box-header"},[a,u])}}),q="k-prompt-box",U=t.defineComponent({name:"KendoPromptBox",emits:{change:e=>!0,focus:e=>!0,blur:e=>!0,promptaction:e=>!0},props:{value:String,defaultValue:{type:String,default:""},mode:{type:String,default:"auto"},rows:{type:Number,default:1},maxTextAreaHeight:String,title:String,disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},placeholder:String,maxLength:Number,inputAttributes:Object,fillMode:String,topAffix:[Object,Function,String],startAffix:[Object,Function,String],endAffix:[Object,Function,String],header:[Object,Function,String],loading:{type:Boolean,default:!1},uploadButtonConfig:{type:[Boolean,Object],default:!1},speechToTextButtonConfig:{type:[Boolean,Object],default:!0},actionButtonConfig:{type:[Boolean,Object],default:!0},attachments:Array},inject:{kendoLocalizationService:{default:null}},created(){o.validatePackage(m),this._uploadRef=t.ref(null)},data(){return{stateValue:this.$props.defaultValue||"",stateFiles:[],hasExpanded:!1,initialHeight:0,minMultiRowHeight:0,isResizing:!1,previousValueLength:0,singleLineWidth:0,resizeObserver:null,resizeTimeout:null,onRemoveAttachmentCallback:null}},computed:{isControlled(){return void 0!==this.$props.value},currentValue(){return this.isControlled?this.$props.value||"":this.stateValue},isFilesControlled(){return void 0!==this.$props.attachments},currentFiles(){return this.isFilesControlled?this.$props.attachments||[]:this.stateFiles},canSendMessage(){var e;return!!(null!=(e=this.currentValue)&&e.trim()||this.currentFiles.length>0)},isMultilineLayout(){return"multi"===this.$props.mode||"auto"===this.$props.mode&&this.hasExpanded},hasBuiltInButtons(){return!1!==this.$props.uploadButtonConfig||!1!==this.$props.speechToTextButtonConfig||!1!==this.$props.actionButtonConfig},hasEndAffixOrButtons(){return!!this.$props.endAffix||this.hasBuiltInButtons},hasStartAffixOrEndAffixOrButtons(){return!!this.$props.startAffix||!!this.$props.endAffix||this.hasBuiltInButtons},effectiveRows(){return"auto"===this.$props.mode?1:this.$props.rows}},watch:{currentValue(e){if("single"===this.$props.mode)return;const t=(null==e?void 0:e.length)||0;requestAnimationFrame(()=>{const e=this.$refs.inputElement;e&&("multi"===this.$props.mode?this.resizeMultiMode(e):"auto"===this.$props.mode&&this.resizeAutoMode(e,t),this.previousValueLength=t)})},rows(){"single"!==this.$props.mode&&(this.captureInitialDimensions(),this.resize())},maxTextAreaHeight(){"single"!==this.$props.mode&&this.resize()},mode(){"single"!==this.$props.mode&&t.nextTick(()=>{this.captureInitialDimensions(),this.resize()})},hasExpanded(e){if("auto"===this.$props.mode&&e&&requestAnimationFrame(()=>{const e=this.$refs.inputElement;e&&(this.updateHeight(e),this.isResizing=!1)}),"auto"===this.$props.mode&&!e){const e=this.$refs.inputElement;e&&(e.style.height="",e.style.overflow="",this.isResizing=!1)}}},mounted(){"single"!==this.$props.mode&&this.captureInitialDimensions(),this.setupResizeObserver()},beforeUnmount(){this.cleanupResizeObserver()},methods:{captureInitialDimensions(){const e=this.$refs.inputElement;if(!e||"single"===this.$props.mode)return;const t=globalThis.getComputedStyle(e),o=Number.parseFloat(t.lineHeight)||20,n=Number.parseFloat(t.paddingTop)||0,i=Number.parseFloat(t.paddingBottom)||0;this.initialHeight=e.offsetHeight||o+n+i,this.minMultiRowHeight=o*this.$props.rows+n+i,"auto"===this.$props.mode&&!this.hasExpanded&&(this.singleLineWidth=e.offsetWidth)},calculateHeight(e){if(this.$props.maxTextAreaHeight){const t=Number.parseInt(this.$props.maxTextAreaHeight,10);if(e>t)return t}return Math.max(this.minMultiRowHeight,e)},resizeMultiMode(e){e.style.overflow="hidden",e.style.height=`${this.initialHeight}px`;const t=e.scrollHeight,o=this.calculateHeight(t);e.style.height=`${o}px`,this.$props.maxTextAreaHeight&&t>Number.parseInt(this.$props.maxTextAreaHeight,10)&&(e.style.overflow="")},updateHeight(e){e.style.overflow="hidden",e.style.height=`${this.initialHeight}px`;const t=e.scrollHeight,o=this.$props.maxTextAreaHeight?Math.min(t,Number.parseInt(this.$props.maxTextAreaHeight,10)):t;e.style.height=`${o}px`,this.$props.maxTextAreaHeight&&t>Number.parseInt(this.$props.maxTextAreaHeight,10)&&(e.style.overflow="")},shouldCollapse(e){if(this.singleLineWidth<=0)return!1;const t=e.style.height,o=e.style.width;e.style.overflow="hidden",e.style.width=`${this.singleLineWidth}px`,e.style.height=`${this.initialHeight}px`;const n=e.scrollWidth<=this.singleLineWidth&&e.scrollHeight<=this.initialHeight;return e.style.overflow="",e.style.width=o||"",e.style.height=t||"",n},resizeAutoMode(e,t){if(!this.isResizing){if((e.scrollWidth>e.clientWidth||e.scrollHeight>e.clientHeight)&&!this.hasExpanded)return this.isResizing=!0,void(this.hasExpanded=!0);if(this.hasExpanded){this.updateHeight(e);t<this.previousValueLength&&this.shouldCollapse(e)&&(e.style.height="",this.isResizing=!0,this.hasExpanded=!1)}}},resize(){var e;if("single"===this.$props.mode)return;const t=this.$refs.inputElement;if(!t)return;const o=(null==(e=t.value)?void 0:e.length)||0;"multi"===this.$props.mode?this.resizeMultiMode(t):"auto"===this.$props.mode&&this.resizeAutoMode(t,o)},setupResizeObserver(){if("single"===this.$props.mode)return;const e=this.$refs.inputElement;e&&(this.resizeObserver=new ResizeObserver(()=>{this.resizeTimeout&&clearTimeout(this.resizeTimeout),this.resizeTimeout=setTimeout(()=>{"auto"===this.$props.mode&&!this.hasExpanded&&this.captureInitialDimensions(),this.resize()},50)}),this.resizeObserver.observe(e))},cleanupResizeObserver(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null),this.resizeTimeout&&(clearTimeout(this.resizeTimeout),this.resizeTimeout=null)},handleChange(e){const t=e.target.value;!this.isControlled&&!this.$props.disabled&&(this.stateValue=t),this.$props.disabled||this.$emit("change",{event:e,value:t}),"single"!==this.$props.mode&&this.resize()},handleFocus(e){this.$props.disabled||this.$emit("focus",{event:e})},handleBlur(e){this.$props.disabled||this.$emit("blur",{event:e})},handleButtonMouseDown(e){e.preventDefault()},handleActionButtonClick(e){this.$emit("promptaction",{event:e,value:this.currentValue,attachments:this.currentFiles}),this.isControlled||(this.stateValue=""),this.isFilesControlled||(this.stateFiles=[])},handleKeyDown(e){if("Enter"!==e.key||!e.shiftKey){if("ArrowUp"===e.key||"ArrowDown"===e.key)return void e.stopPropagation();if("Enter"===e.key){if(e.preventDefault(),this.$props.loading)return;this.canSendMessage&&this.handleActionButtonClick(e)}}},handleSpeechResult(e){var t;const{isFinal:o,alternatives:n}=e;if(n.length>0){const e=n[0];if(o){const t=this.$refs.inputElement,o=(null==t?void 0:t.value)||"",n=(o?`${o} `:"")+e.transcript;if(this.isControlled||(this.stateValue=n),!this.$props.disabled){const e={target:t,currentTarget:t};this.$emit("change",{event:e,value:n})}}}null==(t=this.$refs.inputElement)||t.focus()},handleUploadButtonClick(){const e=this._uploadRef.value;if(null!=e&&e.$el){const t=e.$el.querySelector('input[type="file"]');t&&t.click()}},onFilesSelect(e){var t;const o=Array.from(e.affectedFiles),n=this.$props.uploadButtonConfig,i="object"==typeof n&&n,s=i?i.onSelectAttachments:void 0;this.isFilesControlled||(this.stateFiles=[...this.stateFiles,...o]),s&&s({selectedFiles:e.affectedFiles,allFiles:e.newState}),null==(t=this.$refs.inputElement)||t.focus()},handleRemoveFile(e){this.isFilesControlled||(this.stateFiles=this.stateFiles.filter(t=>t.name!==e));const t=this.$props.uploadButtonConfig,o="object"==typeof t&&t,n=o?o.onRemoveAttachment:void 0;n&&(this.onRemoveAttachmentCallback=n),this.onRemoveAttachmentCallback&&this.onRemoveAttachmentCallback(e)},renderAffix:(e,t)=>e?"function"==typeof e?e(t):e:null},render(){const e=r.provideLocalizationService(this),{mode:n,fillMode:s,maxTextAreaHeight:l,disabled:a,readOnly:d,placeholder:u,title:c,maxLength:p,inputAttributes:h,topAffix:g,startAffix:f,endAffix:v,header:k,loading:b,speechToTextButtonConfig:V,actionButtonConfig:x,uploadButtonConfig:y}=this.$props,C={uploadButtonProps:{fillMode:"flat",svgIcon:i.paperclipIcon,size:"small",rounded:"full",onClick:this.handleUploadButtonClick,onFilesAdd:this.onFilesSelect,files:this.currentFiles,_uploadRef:this._uploadRef,"aria-label":e.toLanguageString(w,F[w]),title:e.toLanguageString(w,F[w]),_registerRemoveCallback:e=>{this.onRemoveAttachmentCallback=e||null}},speechToTextButtonProps:{fillMode:"flat",size:"small",rounded:"full",onResult:this.handleSpeechResult},actionButtonProps:{rounded:"full",size:"small",svgIcon:b?i.stopIcon:i.arrowUpIcon,class:b?"k-generating k-active":"",onClick:this.handleActionButtonClick,onMousedown:this.handleButtonMouseDown,disabled:!b&&!this.canSendMessage,"aria-disabled":!b&&!this.canSendMessage||void 0,"aria-label":b?e.toLanguageString(R,F[R]):e.toLanguageString(N,F[N]),title:b?e.toLanguageString(R,F[R]):e.toLanguageString(N,F[N]),"aria-live":"polite"}},A=()=>{const e=!1!==V,o=!1!==x,n=!1!==y,i="object"==typeof V?V:void 0,s="object"==typeof y?y:{},{restrictions:l,multiple:r=!0,accept:a,onSelectAttachments:d,onRemoveAttachment:u,...c}=s,p={restrictions:l,multiple:r,accept:a},h="object"==typeof x?x:void 0;return t.createVNode(t.Fragment,null,[n&&t.createVNode(j,t.mergeProps({ref:"uploadButton"},C.uploadButtonProps,{restrictions:p.restrictions,multiple:p.multiple,accept:p.accept},c),null),e&&t.createVNode(E,t.mergeProps(C.speechToTextButtonProps,i),null),o&&t.createVNode(M,t.mergeProps(C.actionButtonProps,h),null)])},S={disabled:a,readOnly:d,placeholder:u,title:c,maxLength:p,"aria-label":e.toLanguageString(I,F[I]),value:this.currentValue,onKeydown:this.handleKeyDown,...h,onInput:this.handleChange,onFocus:this.handleFocus,onBlur:this.handleBlur,ref:"inputElement"};return t.createVNode("div",{"aria-label":e.toLanguageString(P,F[P]),class:o.classNames("k-input",q,{[`k-input-${s}`]:s,"k-disabled":a,"k-prompt-box-singleline":"single"===n,"k-prompt-box-multiline":this.isMultilineLayout})},[t.createVNode(D,{files:this.currentFiles,onRemoveFile:this.handleRemoveFile,header:o.templateRendering.call(this,k,o.getListeners.call(this))},null),"single"===n?(()=>t.createVNode("div",{class:`${q}-content`},[f&&t.createVNode("div",{class:`${q}-affix`},[this.renderAffix(f,C)]),t.createVNode("input",t.mergeProps(S,{class:o.classNames("k-input-inner",`${q}-input`)}),null),this.hasEndAffixOrButtons?t.createVNode("div",{class:`${q}-affix`},[v&&this.renderAffix(v,C),A()]):null]))():(()=>t.createVNode("div",{class:`${q}-content`},["multi"===n&&g&&t.createVNode("div",{class:`${q}-affix`},[this.renderAffix(g,C)]),"auto"===n&&f&&t.createVNode("div",{class:`${q}-affix`,style:{display:this.hasExpanded?"none":void 0}},[this.renderAffix(f,C)]),t.createVNode("textarea",t.mergeProps(S,{class:o.classNames("k-input-inner",`${q}-textarea`),rows:this.effectiveRows,style:l?{maxHeight:l}:{}},"single"!==n&&{"aria-multiline":"true"}),null),"auto"===n&&this.hasEndAffixOrButtons?t.createVNode("div",{class:`${q}-affix`,style:{display:this.hasExpanded?"none":void 0}},[v&&this.renderAffix(v,C),A()]):null,this.hasStartAffixOrEndAffixOrButtons?t.createVNode("div",{class:`${q}-affix`,style:{display:this.isMultilineLayout?void 0:"none"}},[f&&this.renderAffix(f,C),(f||v)&&t.createVNode("div",{class:"k-spacer"},null),v&&this.renderAffix(v,C),A()]):null]))(),o.shouldShowValidationUI(m)&&t.createVNode(o.WatermarkOverlay,{message:o.getLicenseMessage(m)},null)])}});e.AIPrompt=g,e.AIPromptCommandsView=L,e.AIPromptContent=v,e.AIPromptFooter=f,e.AIPromptHeader=u,e.AIPromptOutputRating=O,e.AIPromptOutputView=z,e.AIPromptView=C,e.AIPromptViewRender=k,e.PromptBox=U,e.PromptBoxActionButton=M,e.PromptBoxSpeechToTextButton=E,e.PromptBoxUploadButton=j,e.SuggestionGroup=x,e.commandsViewDefaults=p,e.outputViewDefaults=c,e.promptViewDefaults=h});
|
|
15
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue"),require("@progress/kendo-vue-common"),require("@progress/kendo-vue-buttons"),require("@progress/kendo-svg-icons"),require("@progress/kendo-vue-inputs"),require("@progress/kendo-vue-layout"),require("@progress/kendo-vue-intl"),require("@progress/kendo-vue-upload")):"function"==typeof define&&define.amd?define(["exports","vue","@progress/kendo-vue-common","@progress/kendo-vue-buttons","@progress/kendo-svg-icons","@progress/kendo-vue-inputs","@progress/kendo-vue-layout","@progress/kendo-vue-intl","@progress/kendo-vue-upload"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).KendoVueConversationalUi={},e.Vue,e.KendoVueCommon,e.KendoVueButtons,e.KendoSVGIcons,e.KendoVueInputs,e.KendoVueLayout,e.KendoVueIntl,e.KendoVueUpload)}(this,function(e,t,o,n,i,s,l,r,a){"use strict";function d(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!t.isVNode(e)}const u=t.defineComponent({name:"KendoAIPromptHeader",props:{activeView:String,toolbarItems:Array,onActiveviewchange:Function},methods:{handleClick(e){this.$emit("activeviewchange",e)}},render(){let e;const{activeView:i,toolbarItems:s}=this.$props;return t.createVNode("div",{class:"k-prompt-header"},[t.createVNode(n.Toolbar,{overflow:"none",keyboardNavigation:!1,class:"k-toolbar-flat"},d(e=s.map(function(e){const s=o.getTemplate.call(this,{h:t.h,template:e.content,defaultRendering:null,additionalProps:{item:e}});return e.content?s:t.createVNode(n.Button,{type:"button",key:e.name,class:o.classNames("k-toolbar-item",{"k-selected":i===e.name}),size:"medium",themeColor:"primary",fillMode:"flat",rounded:"full",title:e.buttonText,svgIcon:e.buttonIcon,onClick:()=>this.handleClick(e.name)},{default:()=>[e.buttonText]})},this))?e:{default:()=>[e]})])}}),c={name:"Output view",buttonText:"Output",buttonIcon:i.commentIcon},p={name:"Commands view",buttonIcon:i.moreHorizontalIcon},h={name:"Prompt view",buttonText:"Ask AI",buttonIcon:i.sparklesIcon},m={name:"@progress/kendo-vue-conversational-ui",productName:"Kendo UI for Vue",productCode:"KENDOUIVUE",productCodes:["KENDOUIVUE"],publishDate:0,version:"9.0.0-develop.3",licensingDocsUrl:"https://www.telerik.com/kendo-vue-ui/my-license/"},g=t.defineComponent({name:"KendoAIPrompt",props:{activeView:{type:String,required:!0},dir:String,toolbarItems:Array,outputs:Array,promptPlaceholder:String,streaming:Boolean,loading:Boolean,suggestionsView:{type:String,default:"classic"}},provide(){return{kendoAIPrompt:this.$data.contextState}},data(){return{showLicenseWatermark:!1,licenseMessage:"",contextState:{activeView:this.$props.activeView,streaming:this.$props.streaming,loading:this.$props.loading,onCancel:this.onCancel,onActiveViewChange:this.onActiveViewChange,onPromptRequest:this.onPromptRequest,onCommandExecute:this.onCommandExecute,onStateAction:this.onStateAction,suggestionsView:this.$props.suggestionsView}}},watch:{activeView(e){this.contextState.activeView=e},streaming(e){this.contextState.streaming=e},loading(e){this.contextState.loading=e}},methods:{onStateAction(e){this.contextState.activeView=e.activeView},onActiveViewChange(e){this.$emit("activeviewchange",e)},onPromptRequest(e,t){this.$emit("promptrequest",e,t)},onCommandExecute(e){this.$emit("commandexecute",e)},onCancel(){this.$emit("cancel")}},render(){o.validatePackage(m),this.showLicenseWatermark=o.shouldShowValidationUI(m),this.licenseMessage=o.getLicenseMessage(m);const e=o.getDefaultSlots(this),{toolbarItems:n,dir:i}=this.$props,s=(n||[h,c]).map(e=>{const t=o.templateRendering.call(this,e.content,o.getListeners.call(this));return{...e,content:t}}),l=this.showLicenseWatermark?t.createVNode(o.WatermarkOverlay,{message:this.licenseMessage},null):null;return t.createVNode("div",{class:"k-prompt",dir:i},[t.createVNode(u,{activeView:this.contextState.activeView,toolbarItems:s,onActiveviewchange:this.onActiveViewChange},null),e,l])}}),f=t.defineComponent({name:"KendoAIPromptFooter",render(){const e=o.getDefaultSlots(this);return t.createVNode("div",{class:"k-prompt-footer"},[t.createVNode("div",{class:"k-actions k-actions-start k-actions-horizontal k-prompt-actions"},[e])])}}),v=t.defineComponent({name:"KendoAIPromptContent",props:{onCancel:Function,streaming:Boolean},inject:{kendoAIPrompt:{default:null}},computed:{showFloatingButton(){var e;const t=(null==(e=this.kendoAIPrompt)?void 0:e.activeView)===c.name;return this.streaming&&t}},methods:{handleKeyDown(e){"Escape"===e.key&&this.showFloatingButton&&this.onCancel&&(e.preventDefault(),this.$props.onCancel())}},render(){const e=o.getDefaultSlots(this);return t.createVNode("div",{class:"k-prompt-content",onKeydown:this.handleKeyDown},[this.showFloatingButton&&t.createVNode(n.FloatingActionButton,{onClick:this.onCancel,svgIcon:i.stopIcon,size:"small",positionMode:"absolute",class:"k-prompt-stop-fab k-generating"},null),t.createVNode("div",{class:"k-prompt-view"},[e])])}}),k=t.defineComponent({name:"KendoAIPromptViewRender",inheritAttrs:!1,props:{name:String},inject:{kendoAIPrompt:{default:null}},render(){const e=o.getDefaultSlots(this);return this.kendoAIPrompt.activeView===this.$props.name?e:null}});function b(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!t.isVNode(e)}const V=t.defineComponent({name:"KendoAIPromptExpander",props:{title:String},data:()=>({expanded:!0}),methods:{buttonClick(){this.expanded=!this.expanded}},render(){const e=o.getDefaultSlots(this),{title:s}=this.$props;return t.createVNode("div",{class:"k-prompt-expander"},[t.createVNode(n.Button,{type:"button",fillMode:"flat",svgIcon:this.expanded?i.chevronUpIcon:i.chevronDownIcon,title:s,onClick:this.buttonClick},b(s)?s:{default:()=>[s]}),this.expanded&&t.createVNode("div",{class:"k-prompt-expander-content"},[e])])}}),x=t.defineComponent({name:"KendoSuggestionGroup",props:{suggestions:{type:Array,required:!0},onSuggestionClick:{type:Function,required:!0},suggestionsView:{type:String,default:"classic"}},methods:{handleSuggestionClick(e,t){t.disabled||this.onSuggestionClick(e,t)},handleKeyDown(e,t){("Enter"===e.key||" "===e.key)&&(e.preventDefault(),this.onSuggestionClick(e,t))}},render(){const{suggestions:e,suggestionsView:n}=this.$props,i=()=>e.map(e=>t.createVNode("span",{role:"button",tabindex:e.disabled?-1:0,"aria-label":e.description,"aria-disabled":e.disabled,onClick:t=>!e.disabled&&this.handleSuggestionClick(t,e),onKeydown:t=>!e.disabled&&this.handleKeyDown(t,e),key:e.id,title:e.description,class:o.classNames("classic"===n?"k-prompt-suggestion":"k-suggestion",{"k-disabled":e.disabled})},[e.text]));return"classic"===n?i():t.createVNode("div",{role:"group",class:"k-suggestion-group"},[i()])}});function y(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!t.isVNode(e)}const C=t.defineComponent({name:"KendoAIPromptView",props:{promptInput:[Object,String],generateButton:[Object,String],promptValue:String,promptSuggestions:Array,enableSpeechToText:[Boolean,Object]},inject:{kendoAIPrompt:{default:null}},computed:{computedValue(){return void 0!==this.$props.promptValue?this.$props.promptValue:this.value}},data:()=>({value:""}),methods:{handleOnRequest(){this.kendoAIPrompt.onPromptRequest&&this.kendoAIPrompt.onPromptRequest.call(null,this.computedValue),this.value=""},handleSuggestionSelect(e){this.value=e},onTextChange(e){this.value=e.value},onSpeechResult(e){if(e.isFinal&&e.alternatives.length>0){const t=e.alternatives[0].transcript,o=this.value,n=o&&!o.endsWith(" ")&&!o.endsWith("\n");this.value=o+(n?" ":"")+t}},onSpeechStart(){},onSpeechEnd(){},getButtonDisabledState(){const e=void 0!==this.$props.promptValue?this.$props.promptValue:this.value;return!(null!=e&&e.trim())}},render(){const e="Generate",{promptSuggestions:l,enableSpeechToText:r}=this.$props,a=o.templateRendering.call(this,this.$props.promptInput,o.getListeners.call(this)),d=t.createVNode(s.TextArea,{value:this.computedValue,onInput:this.onTextChange,placeholder:"Ask or generate content with AI ...",rows:2,class:"!k-flex-col",inputSuffix:()=>r?t.createVNode(t.Fragment,null,[t.createVNode(s.InputSeparator,{orientation:"horizontal"},null),t.createVNode("div",{class:"k-input-suffix k-input-suffix-horizontal"},[t.createVNode(n.SpeechToTextButton,t.mergeProps({fillMode:"flat",onStart:this.onSpeechStart,onEnd:this.onSpeechEnd,onResult:this.onSpeechResult},"object"==typeof r?r:{}),null)])]):null},null),u=o.getTemplate.call(this,{h:t.h,template:a,defaultRendering:d}),c=o.templateRendering.call(this,this.$props.generateButton,o.getListeners.call(this)),p=t.createVNode(n.Button,{type:"button",themeColor:"primary",fillMode:"solid","aria-hidden":"true",rounded:"full",size:"medium",onClick:this.handleOnRequest,disabled:this.getButtonDisabledState(),title:"Generate",svgIcon:i.sparklesIcon},y(e)?e:{default:()=>[e]}),m=o.getTemplate.call(this,{h:t.h,template:c,defaultRendering:p});return t.createVNode(k,{name:h.name},{default:()=>{var e,o;return[t.createVNode(v,{streaming:null==(e=this.kendoAIPrompt)?void 0:e.streaming,onCancel:null==(o=this.kendoAIPrompt)?void 0:o.onCancel},{default:()=>[u,l&&l.length>0&&t.createVNode(V,{title:"Prompt Suggestions"},{default:()=>{var e;return[t.createVNode(x,{suggestionsView:null==(e=this.kendoAIPrompt)?void 0:e.suggestionsView,suggestions:l.map((e,t)=>({id:t,text:e,description:e})),onSuggestionClick:(e,t)=>this.handleSuggestionSelect(t.text)},null)]}})]}),t.createVNode(f,null,y(m)?m:{default:()=>[m]})]}})}}),A="avatar.alt",S="messageList.ariaLabel",$="aIPrompt.noOutputs",I="promptBox.input",N="promptBox.sendButton",w="promptBox.attachFile",B="promptBox.removeFile",R="promptBox.stopGenerating",P="promptBox.ariaLabel",F={[A]:"Avatar",[S]:"Message list",[$]:"No output from Ai available",[I]:"Prompt",[N]:"Send",[w]:"Attach file",[B]:"Remove file",[R]:"Stop generating",[P]:"Prompt box"};function T(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!t.isVNode(e)}let O=function(e){return e.positive="positive",e.negative="negative",e}({});const z=t.defineComponent({name:"KendoAIPromptOutputView",emits:{copy:null,retry:null,rating:null},props:{outputs:Array,outputCard:Object,showOutputRating:Boolean},inject:{kendoAIPrompt:{default:null},kendoLocalizationService:{default:null}},data:()=>({copiedIndex:-1,copyButtonIcon:i.copyIcon,contentRef:null}),methods:{retryPrompt(e){this.$emit("retry",e),this.kendoAIPrompt.onPromptRequest&&this.kendoAIPrompt.onPromptRequest.call(null,e.prompt,{...e,isRetry:!0}),this.scrollToTopOutput()},copyToClipboard(e,t){null!=e&&e.responseContent&&navigator.clipboard.writeText(e.responseContent),this.copiedIndex=t,this.copyButtonIcon=i.checkIcon,this.$emit("copy",null==e?void 0:e.responseContent),setTimeout(()=>{this.copyButtonIcon=i.copyIcon,this.copiedIndex=-1},1e3)},outputRating(e,t){this.$emit("rating",e,t),this.kendoAIPrompt.onPromptRequest&&this.kendoAIPrompt.onPromptRequest.call(null,e.prompt,{...e,ratingType:t,isRetry:!1}),this.scrollToTopOutput()},scrollToTopOutput(){var e,t;null==(t=null==(e=this.contentRef)?void 0:e.scrollTo)||t.call(e,{top:0,behavior:"smooth"})}},render(){let e;const{outputs:o,showOutputRating:s,outputCard:a}=this.$props,d=r.provideLocalizationService(this),{header:u,body:p,actions:h}=a||{},m=t.createVNode(l.Card,null,{default:()=>[t.createVNode(l.CardHeader,null,{default:()=>[t.createVNode(l.CardTitle,null,{default:()=>[t.createVNode("span",{class:"k-skeleton k-skeleton-text k-skeleton-pulse",style:{width:"200px"}},null)]}),t.createVNode(l.CardSubtitle,null,{default:()=>[t.createVNode("span",{class:"k-skeleton k-skeleton-text k-skeleton-pulse",style:{width:"100%"}},null)]})]}),t.createVNode(l.CardBody,null,{default:()=>[t.createVNode("span",{class:"k-skeleton k-skeleton-rect k-skeleton-pulse",style:{height:"80px"}},null)]}),t.createVNode(l.CardActions,null,{default:()=>[t.createVNode("span",{class:"k-skeleton k-skeleton-text k-skeleton-pulse",style:{width:"100%"}},null)]})]}),g=null==o?void 0:o.map((e,o)=>t.createVNode(l.Card,{key:`${e.id}_${o}`,class:e.class},{default:()=>[t.createVNode(l.CardHeader,null,{default:()=>[u?u(e):t.createVNode(t.Fragment,null,[e.title&&t.createVNode(l.CardTitle,null,{default:()=>[e.title]}),e.subTitle&&t.createVNode(l.CardSubtitle,null,{default:()=>[e.subTitle]})])]}),t.createVNode(l.CardBody,null,{default:()=>[p?p(e):e.responseContent]}),t.createVNode(l.CardActions,null,{default:()=>[h?h(e):t.createVNode(t.Fragment,null,[t.createVNode(n.Button,{type:"button",size:"medium",themeColor:"primary",fillMode:"flat",rounded:"medium",title:"Copy",svgIcon:this.copiedIndex===o?this.copyButtonIcon:i.copyIcon,"aria-hidden":"true",onClick:()=>this.copyToClipboard(e,o)},{default:()=>["Copy"]}),t.createVNode(n.Button,{type:"button",size:"medium",themeColor:"base",fillMode:"flat",rounded:"medium",title:"Retry",svgIcon:i.arrowRotateCwIcon,"aria-hidden":"true",onClick:()=>this.retryPrompt(e)},{default:()=>["Retry"]}),s&&t.createVNode(t.Fragment,null,[t.createVNode("span",{class:"k-spacer"},null),t.createVNode(n.Button,{type:"button",size:"medium",themeColor:"positive"===e.ratingType?"primary":"base",fillMode:"flat",rounded:"medium",title:"Rate up",svgIcon:i.thumbUpIcon,"aria-hidden":"true",onClick:()=>this.outputRating(e,"positive")},null),t.createVNode(n.Button,{type:"button",size:"medium",themeColor:"negative"===e.ratingType?"primary":"base",fillMode:"flat",rounded:"medium",title:"Rate down",svgIcon:i.thumbDownIcon,"aria-hidden":"true",onClick:()=>this.outputRating(e,"negative")},null)])])]})]})),f=t.createVNode(l.Card,null,{default:()=>[t.createVNode(l.CardBody,null,T(e=d.toLanguageString($,F[$]))?e:{default:()=>[e]})]});return t.createVNode(k,{name:c.name},{default:()=>{var e,o;return[t.createVNode(v,{ref:e=>this.contentRef=e,streaming:null==(e=this.kendoAIPrompt)?void 0:e.streaming,onCancel:null==(o=this.kendoAIPrompt)?void 0:o.onCancel},{default:()=>{var e,o;return[t.createVNode("div",{class:"k-card-list"},[(null==(e=this.kendoAIPrompt)?void 0:e.loading)&&m,g,(!g||0===g.length)&&!(null!=(o=this.kendoAIPrompt)&&o.loading)&&f])]}})]}})}}),L=t.defineComponent({name:"KendoAIPromptCommandsView",props:{commands:Array},inject:{kendoAIPrompt:{default:null}},render(){const{commands:e}=this.$props,o=e=>{var t;const o=e.target;(null==(t=o.items)||!t.length)&&this.kendoAIPrompt.onCommandExecute&&(this.$emit("commandexecute",o),this.kendoAIPrompt.onCommandExecute.call(null,o))};return t.createVNode(k,{name:p.name},{default:()=>{var n,i;return[t.createVNode(v,{streaming:null==(n=this.kendoAIPrompt)?void 0:n.streaming,onCancel:null==(i=this.kendoAIPrompt)?void 0:i.onCancel},{default:()=>[t.createVNode("div",{class:"k-prompt-view"},[t.createVNode(l.PanelBar,{onSelect:o,items:e},null)])]})]}})}}),M=t.defineComponent({name:"KendoPromptBoxActionButton",inheritAttrs:!1,render(){return t.createVNode(n.Button,this.$attrs,null)}}),E=t.defineComponent({name:"KendoPromptBoxSpeechToTextButton",inheritAttrs:!1,render(){return t.createVNode(n.SpeechToTextButton,this.$attrs,null)}}),j=t.defineComponent({name:"KendoPromptBoxUploadButton",inheritAttrs:!1,props:{onFilesAdd:Function,files:{type:Array,default:()=>[]},restrictions:Object,multiple:{type:Boolean,default:!0},accept:String,onSelectAttachments:Function,onRemoveAttachment:Function,_registerRemoveCallback:Function},setup(e){const o=t.ref(null);return t.watch(()=>e.onRemoveAttachment,t=>{e._registerRemoveCallback&&t&&e._registerRemoveCallback(t)},{immediate:!0}),t.onUnmounted(()=>{e._registerRemoveCallback&&e.onRemoveAttachment&&e._registerRemoveCallback(void 0)}),{uploadRef:o,handleFilesAdd:t=>{e.onFilesAdd&&e.onFilesAdd(t),e.onSelectAttachments&&e.onSelectAttachments({selectedFiles:t.affectedFiles,allFiles:t.newState})}}},render(){const{onFilesAdd:e,files:o,restrictions:i,multiple:s,accept:l,onSelectAttachments:r,onRemoveAttachment:d,_registerRemoveCallback:u,_uploadRef:c,...p}=this.$attrs;return t.createVNode(t.Fragment,null,[t.createVNode(n.Button,p,null),t.createVNode(a.Upload,{ref:e=>{this.uploadRef=e,c&&(c.value=e)},files:this.files,onAdd:this.handleFilesAdd,autoUpload:!1,restrictions:this.restrictions,multiple:this.multiple,accept:this.accept,class:"k-hidden"},null)])}}),H=e=>"."+(e.split(".").pop()||""),K=e=>{if(null==e)return"";if(0===e)return"0 B";const t=Math.floor(Math.log(e)/Math.log(1024));return`${Number.parseFloat((e/Math.pow(1024,t)).toFixed(2))} ${["B","KB","MB","GB","TB"][t]}`},D=t.defineComponent({name:"KendoFileBox",props:{files:{type:Array,required:!0},onRemoveFile:{type:Function,required:!0},header:{type:[Object,Function,String],default:void 0}},inject:{kendoLocalizationService:{default:null}},data:()=>({canScrollRight:!1,canScrollLeft:!1,resizeObserver:null}),watch:{files:{handler(){t.nextTick(()=>{this.setupScrollListeners(),this.updateScrollState()})},deep:!0}},mounted(){t.nextTick(()=>{this.setupScrollListeners(),this.updateScrollState()})},beforeUnmount(){this.cleanupScrollListeners()},methods:{setupScrollListeners(){const e=this.$refs.scrollContainer;e?this._scrollContainer!==e&&(this.cleanupScrollListeners(),e.addEventListener("scroll",this.updateScrollState,{passive:!0}),this.resizeObserver=new ResizeObserver(()=>this.updateScrollState()),this.resizeObserver.observe(e),this._scrollContainer=e):this.cleanupScrollListeners()},cleanupScrollListeners(){this._scrollContainer&&(this._scrollContainer.removeEventListener("scroll",this.updateScrollState),this._scrollContainer=null),this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)},updateScrollState(){const e=this.$refs.scrollContainer;if(!e)return;const{scrollLeft:t,scrollWidth:o,clientWidth:n}=e,i=0===t,s=t+n>=o-1;this.canScrollLeft=!i,this.canScrollRight=!s},handleRemoveFile(e,t){t.stopPropagation(),this.$props.onRemoveFile&&this.$props.onRemoveFile(e)}},render(){const e=r.provideLocalizationService(this),{files:s,header:l}=this.$props;if(0===s.length&&!l)return null;const a=o.getTemplate.call(this,{h:t.h,template:l,defaultRendering:null}),d=e.toLanguageString(B,F[B]),u=s.length>0&&t.createVNode("ul",{class:o.classNames("k-file-box-wrapper",{"k-file-box-wrapper-scrollable-start":this.canScrollRight,"k-file-box-wrapper-scrollable-end":this.canScrollLeft})},[t.createVNode("div",{class:"k-files-scroll",ref:"scrollContainer"},[s.map(e=>t.createVNode("li",{key:e.name,class:"k-file-box"},[t.createVNode(o.Icon,t.mergeProps({size:"xlarge"},o.getFileExtensionIcon(H(e.name))),null),t.createVNode("div",{class:"k-file-info"},[t.createVNode("span",{class:"k-file-name"},[e.name]),t.createVNode("span",{class:"k-file-size"},[K(e.size)])]),t.createVNode(n.Button,{fillMode:"flat",svgIcon:i.xCircleIcon,onClick:t=>this.handleRemoveFile(e.name,t),"aria-label":`${d} ${e.name}`,title:`${d} ${e.name}`},null)]))])]);return t.createVNode("div",{class:"k-prompt-box-header"},[a,u])}}),q="k-prompt-box",U=t.defineComponent({name:"KendoPromptBox",emits:{change:e=>!0,focus:e=>!0,blur:e=>!0,promptaction:e=>!0},props:{value:String,defaultValue:{type:String,default:""},mode:{type:String,default:"auto"},rows:{type:Number,default:1},maxTextAreaHeight:String,title:String,disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},placeholder:String,maxLength:Number,inputAttributes:Object,fillMode:String,topAffix:[Object,Function,String],startAffix:[Object,Function,String],endAffix:[Object,Function,String],header:[Object,Function,String],loading:{type:Boolean,default:!1},uploadButtonConfig:{type:[Boolean,Object],default:!1},speechToTextButtonConfig:{type:[Boolean,Object],default:!0},actionButtonConfig:{type:[Boolean,Object],default:!0},attachments:Array},inject:{kendoLocalizationService:{default:null}},created(){o.validatePackage(m),this._uploadRef=t.ref(null)},data(){return{stateValue:this.$props.defaultValue||"",stateFiles:[],hasExpanded:!1,initialHeight:0,minMultiRowHeight:0,isResizing:!1,previousValueLength:0,singleLineWidth:0,resizeObserver:null,resizeTimeout:null,onRemoveAttachmentCallback:null}},computed:{isControlled(){return void 0!==this.$props.value},currentValue(){return this.isControlled?this.$props.value||"":this.stateValue},isFilesControlled(){return void 0!==this.$props.attachments},currentFiles(){return this.isFilesControlled?this.$props.attachments||[]:this.stateFiles},canSendMessage(){var e;return!!(null!=(e=this.currentValue)&&e.trim()||this.currentFiles.length>0)},isMultilineLayout(){return"multi"===this.$props.mode||"auto"===this.$props.mode&&this.hasExpanded},hasBuiltInButtons(){return!1!==this.$props.uploadButtonConfig||!1!==this.$props.speechToTextButtonConfig||!1!==this.$props.actionButtonConfig},hasEndAffixOrButtons(){return!!this.$props.endAffix||this.hasBuiltInButtons},hasStartAffixOrEndAffixOrButtons(){return!!this.$props.startAffix||!!this.$props.endAffix||this.hasBuiltInButtons},effectiveRows(){return"auto"===this.$props.mode?1:this.$props.rows}},watch:{currentValue(e){if("single"===this.$props.mode)return;const t=(null==e?void 0:e.length)||0;requestAnimationFrame(()=>{const e=this.$refs.inputElement;e&&("multi"===this.$props.mode?this.resizeMultiMode(e):"auto"===this.$props.mode&&this.resizeAutoMode(e,t),this.previousValueLength=t)})},rows(){"single"!==this.$props.mode&&(this.captureInitialDimensions(),this.resize())},maxTextAreaHeight(){"single"!==this.$props.mode&&this.resize()},mode(){"single"!==this.$props.mode&&t.nextTick(()=>{this.captureInitialDimensions(),this.resize()})},hasExpanded(e){if("auto"===this.$props.mode&&e&&requestAnimationFrame(()=>{const e=this.$refs.inputElement;e&&(this.updateHeight(e),this.isResizing=!1)}),"auto"===this.$props.mode&&!e){const e=this.$refs.inputElement;e&&(e.style.height="",e.style.overflow="",this.isResizing=!1)}}},mounted(){"single"!==this.$props.mode&&this.captureInitialDimensions(),this.setupResizeObserver()},beforeUnmount(){this.cleanupResizeObserver()},methods:{captureInitialDimensions(){const e=this.$refs.inputElement;if(!e||"single"===this.$props.mode)return;const t=globalThis.getComputedStyle(e),o=Number.parseFloat(t.lineHeight)||20,n=Number.parseFloat(t.paddingTop)||0,i=Number.parseFloat(t.paddingBottom)||0;this.initialHeight=e.offsetHeight||o+n+i,this.minMultiRowHeight=o*this.$props.rows+n+i,"auto"===this.$props.mode&&!this.hasExpanded&&(this.singleLineWidth=e.offsetWidth)},calculateHeight(e){if(this.$props.maxTextAreaHeight){const t=Number.parseInt(this.$props.maxTextAreaHeight,10);if(e>t)return t}return Math.max(this.minMultiRowHeight,e)},resizeMultiMode(e){e.style.overflow="hidden",e.style.height=`${this.initialHeight}px`;const t=e.scrollHeight,o=this.calculateHeight(t);e.style.height=`${o}px`,this.$props.maxTextAreaHeight&&t>Number.parseInt(this.$props.maxTextAreaHeight,10)&&(e.style.overflow="")},updateHeight(e){e.style.overflow="hidden",e.style.height=`${this.initialHeight}px`;const t=e.scrollHeight,o=this.$props.maxTextAreaHeight?Math.min(t,Number.parseInt(this.$props.maxTextAreaHeight,10)):t;e.style.height=`${o}px`,this.$props.maxTextAreaHeight&&t>Number.parseInt(this.$props.maxTextAreaHeight,10)&&(e.style.overflow="")},shouldCollapse(e){if(this.singleLineWidth<=0)return!1;const t=e.style.height,o=e.style.width;e.style.overflow="hidden",e.style.width=`${this.singleLineWidth}px`,e.style.height=`${this.initialHeight}px`;const n=e.scrollWidth<=this.singleLineWidth&&e.scrollHeight<=this.initialHeight;return e.style.overflow="",e.style.width=o||"",e.style.height=t||"",n},resizeAutoMode(e,t){if(!this.isResizing){if((e.scrollWidth>e.clientWidth||e.scrollHeight>e.clientHeight)&&!this.hasExpanded)return this.isResizing=!0,void(this.hasExpanded=!0);if(this.hasExpanded){this.updateHeight(e);t<this.previousValueLength&&this.shouldCollapse(e)&&(e.style.height="",this.isResizing=!0,this.hasExpanded=!1)}}},resize(){var e;if("single"===this.$props.mode)return;const t=this.$refs.inputElement;if(!t)return;const o=(null==(e=t.value)?void 0:e.length)||0;"multi"===this.$props.mode?this.resizeMultiMode(t):"auto"===this.$props.mode&&this.resizeAutoMode(t,o)},setupResizeObserver(){if("single"===this.$props.mode)return;const e=this.$refs.inputElement;e&&(this.resizeObserver=new ResizeObserver(()=>{this.resizeTimeout&&clearTimeout(this.resizeTimeout),this.resizeTimeout=setTimeout(()=>{"auto"===this.$props.mode&&!this.hasExpanded&&this.captureInitialDimensions(),this.resize()},50)}),this.resizeObserver.observe(e))},cleanupResizeObserver(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null),this.resizeTimeout&&(clearTimeout(this.resizeTimeout),this.resizeTimeout=null)},handleChange(e){const t=e.target.value;!this.isControlled&&!this.$props.disabled&&(this.stateValue=t),this.$props.disabled||this.$emit("change",{event:e,value:t}),"single"!==this.$props.mode&&this.resize()},handleFocus(e){this.$props.disabled||this.$emit("focus",{event:e})},handleBlur(e){this.$props.disabled||this.$emit("blur",{event:e})},handleButtonMouseDown(e){e.preventDefault()},handleActionButtonClick(e){this.$emit("promptaction",{event:e,value:this.currentValue,attachments:this.currentFiles}),this.isControlled||(this.stateValue=""),this.isFilesControlled||(this.stateFiles=[])},handleKeyDown(e){if("Enter"!==e.key||!e.shiftKey){if("ArrowUp"===e.key||"ArrowDown"===e.key)return void e.stopPropagation();if("Enter"===e.key){if(e.preventDefault(),this.$props.loading)return;this.canSendMessage&&this.handleActionButtonClick(e)}}},handleSpeechResult(e){var t;const{isFinal:o,alternatives:n}=e;if(n.length>0){const e=n[0];if(o){const t=this.$refs.inputElement,o=(null==t?void 0:t.value)||"",n=(o?`${o} `:"")+e.transcript;if(this.isControlled||(this.stateValue=n),!this.$props.disabled){const e={target:t,currentTarget:t};this.$emit("change",{event:e,value:n})}}}null==(t=this.$refs.inputElement)||t.focus()},handleUploadButtonClick(){const e=this._uploadRef.value;if(null!=e&&e.$el){const t=e.$el.querySelector('input[type="file"]');t&&t.click()}},onFilesSelect(e){var t;const o=Array.from(e.affectedFiles),n=this.$props.uploadButtonConfig,i="object"==typeof n&&n,s=i?i.onSelectAttachments:void 0;this.isFilesControlled||(this.stateFiles=[...this.stateFiles,...o]),s&&s({selectedFiles:e.affectedFiles,allFiles:e.newState}),null==(t=this.$refs.inputElement)||t.focus()},handleRemoveFile(e){this.isFilesControlled||(this.stateFiles=this.stateFiles.filter(t=>t.name!==e));const t=this.$props.uploadButtonConfig,o="object"==typeof t&&t,n=o?o.onRemoveAttachment:void 0;n&&(this.onRemoveAttachmentCallback=n),this.onRemoveAttachmentCallback&&this.onRemoveAttachmentCallback(e)},renderAffix:(e,t)=>e?"function"==typeof e?e(t):e:null},render(){const e=r.provideLocalizationService(this),{mode:n,fillMode:s,maxTextAreaHeight:l,disabled:a,readOnly:d,placeholder:u,title:c,maxLength:p,inputAttributes:h,topAffix:g,startAffix:f,endAffix:v,header:k,loading:b,speechToTextButtonConfig:V,actionButtonConfig:x,uploadButtonConfig:y}=this.$props,C={uploadButtonProps:{fillMode:"flat",svgIcon:i.paperclipIcon,size:"small",rounded:"full",onClick:this.handleUploadButtonClick,onFilesAdd:this.onFilesSelect,files:this.currentFiles,_uploadRef:this._uploadRef,"aria-label":e.toLanguageString(w,F[w]),title:e.toLanguageString(w,F[w]),_registerRemoveCallback:e=>{this.onRemoveAttachmentCallback=e||null}},speechToTextButtonProps:{fillMode:"flat",size:"small",rounded:"full",onResult:this.handleSpeechResult},actionButtonProps:{rounded:"full",size:"small",svgIcon:b?i.stopIcon:i.arrowUpIcon,class:b?"k-generating k-active":"",onClick:this.handleActionButtonClick,onMousedown:this.handleButtonMouseDown,disabled:!b&&!this.canSendMessage,"aria-disabled":!b&&!this.canSendMessage||void 0,"aria-label":b?e.toLanguageString(R,F[R]):e.toLanguageString(N,F[N]),title:b?e.toLanguageString(R,F[R]):e.toLanguageString(N,F[N]),"aria-live":"polite"}},A=()=>{const e=!1!==V,o=!1!==x,n=!1!==y,i="object"==typeof V?V:void 0,s="object"==typeof y?y:{},{restrictions:l,multiple:r=!0,accept:a,onSelectAttachments:d,onRemoveAttachment:u,...c}=s,p={restrictions:l,multiple:r,accept:a},h="object"==typeof x?x:void 0;return t.createVNode(t.Fragment,null,[n&&t.createVNode(j,t.mergeProps({ref:"uploadButton"},C.uploadButtonProps,{restrictions:p.restrictions,multiple:p.multiple,accept:p.accept},c),null),e&&t.createVNode(E,t.mergeProps(C.speechToTextButtonProps,i),null),o&&t.createVNode(M,t.mergeProps(C.actionButtonProps,h),null)])},S={disabled:a,readOnly:d,placeholder:u,title:c,maxLength:p,"aria-label":e.toLanguageString(I,F[I]),value:this.currentValue,onKeydown:this.handleKeyDown,...h,onInput:this.handleChange,onFocus:this.handleFocus,onBlur:this.handleBlur,ref:"inputElement"};return t.createVNode("div",{"aria-label":e.toLanguageString(P,F[P]),class:o.classNames("k-input",q,{[`k-input-${s}`]:s,"k-disabled":a,"k-prompt-box-singleline":"single"===n,"k-prompt-box-multiline":this.isMultilineLayout})},[t.createVNode(D,{files:this.currentFiles,onRemoveFile:this.handleRemoveFile,header:o.templateRendering.call(this,k,o.getListeners.call(this))},null),"single"===n?(()=>t.createVNode("div",{class:`${q}-content`},[f&&t.createVNode("div",{class:`${q}-affix`},[this.renderAffix(f,C)]),t.createVNode("input",t.mergeProps(S,{class:o.classNames("k-input-inner",`${q}-input`)}),null),this.hasEndAffixOrButtons?t.createVNode("div",{class:`${q}-affix`},[v&&this.renderAffix(v,C),A()]):null]))():(()=>t.createVNode("div",{class:`${q}-content`},["multi"===n&&g&&t.createVNode("div",{class:`${q}-affix`},[this.renderAffix(g,C)]),"auto"===n&&f&&t.createVNode("div",{class:`${q}-affix`,style:{display:this.hasExpanded?"none":void 0}},[this.renderAffix(f,C)]),t.createVNode("textarea",t.mergeProps(S,{class:o.classNames("k-input-inner",`${q}-textarea`),rows:this.effectiveRows,style:l?{maxHeight:l}:{}},"single"!==n&&{"aria-multiline":"true"}),null),"auto"===n&&this.hasEndAffixOrButtons?t.createVNode("div",{class:`${q}-affix`,style:{display:this.hasExpanded?"none":void 0}},[v&&this.renderAffix(v,C),A()]):null,this.hasStartAffixOrEndAffixOrButtons?t.createVNode("div",{class:`${q}-affix`,style:{display:this.isMultilineLayout?void 0:"none"}},[f&&this.renderAffix(f,C),(f||v)&&t.createVNode("div",{class:"k-spacer"},null),v&&this.renderAffix(v,C),A()]):null]))(),o.shouldShowValidationUI(m)&&t.createVNode(o.WatermarkOverlay,{message:o.getLicenseMessage(m)},null)])}});e.AIPrompt=g,e.AIPromptCommandsView=L,e.AIPromptContent=v,e.AIPromptFooter=f,e.AIPromptHeader=u,e.AIPromptOutputRating=O,e.AIPromptOutputView=z,e.AIPromptView=C,e.AIPromptViewRender=k,e.PromptBox=U,e.PromptBoxActionButton=M,e.PromptBoxSpeechToTextButton=E,e.PromptBoxUploadButton=j,e.SuggestionGroup=x,e.commandsViewDefaults=p,e.outputViewDefaults=c,e.promptViewDefaults=h});
|
package/package-metadata.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={name:"@progress/kendo-vue-conversational-ui",productName:"Kendo UI for Vue",productCode:"KENDOUIVUE",productCodes:["KENDOUIVUE"],publishDate:
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={name:"@progress/kendo-vue-conversational-ui",productName:"Kendo UI for Vue",productCode:"KENDOUIVUE",productCodes:["KENDOUIVUE"],publishDate: 1779271865,version:"9.0.0-develop.3",licensingDocsUrl:"https://www.telerik.com/kendo-vue-ui/my-license/"};exports.packageMetadata=e;
|
package/package-metadata.mjs
CHANGED
|
@@ -10,8 +10,8 @@ const e = {
|
|
|
10
10
|
productName: "Kendo UI for Vue",
|
|
11
11
|
productCode: "KENDOUIVUE",
|
|
12
12
|
productCodes: ["KENDOUIVUE"],
|
|
13
|
-
publishDate:
|
|
14
|
-
version: "9.0.0-develop.
|
|
13
|
+
publishDate: 1779271865,
|
|
14
|
+
version: "9.0.0-develop.3",
|
|
15
15
|
licensingDocsUrl: "https://www.telerik.com/kendo-vue-ui/my-license/"
|
|
16
16
|
};
|
|
17
17
|
export {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-vue-conversational-ui",
|
|
3
|
-
"version": "9.0.0-develop.
|
|
3
|
+
"version": "9.0.0-develop.3",
|
|
4
4
|
"description": "TODO",
|
|
5
5
|
"author": "Progress",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
@@ -25,13 +25,13 @@
|
|
|
25
25
|
"sideEffects": false,
|
|
26
26
|
"peerDependencies": {
|
|
27
27
|
"@progress/kendo-licensing": "^1.7.2",
|
|
28
|
-
"@progress/kendo-vue-buttons": "9.0.0-develop.
|
|
29
|
-
"@progress/kendo-vue-common": "9.0.0-develop.
|
|
30
|
-
"@progress/kendo-vue-intl": "9.0.0-develop.
|
|
31
|
-
"@progress/kendo-vue-inputs": "9.0.0-develop.
|
|
32
|
-
"@progress/kendo-vue-layout": "9.0.0-develop.
|
|
33
|
-
"@progress/kendo-vue-popup": "9.0.0-develop.
|
|
34
|
-
"@progress/kendo-vue-upload": "9.0.0-develop.
|
|
28
|
+
"@progress/kendo-vue-buttons": "9.0.0-develop.3",
|
|
29
|
+
"@progress/kendo-vue-common": "9.0.0-develop.3",
|
|
30
|
+
"@progress/kendo-vue-intl": "9.0.0-develop.3",
|
|
31
|
+
"@progress/kendo-vue-inputs": "9.0.0-develop.3",
|
|
32
|
+
"@progress/kendo-vue-layout": "9.0.0-develop.3",
|
|
33
|
+
"@progress/kendo-vue-popup": "9.0.0-develop.3",
|
|
34
|
+
"@progress/kendo-vue-upload": "9.0.0-develop.3",
|
|
35
35
|
"@progress/kendo-svg-icons": "^4.9.0 || ^5.0.0",
|
|
36
36
|
"vue": "^3.0.2"
|
|
37
37
|
},
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"package": {
|
|
53
53
|
"productName": "Kendo UI for Vue",
|
|
54
54
|
"productCode": "KENDOUIVUE",
|
|
55
|
-
"publishDate":
|
|
55
|
+
"publishDate": 1779271865,
|
|
56
56
|
"licensingDocsUrl": "https://www.telerik.com/kendo-vue-ui/my-license/"
|
|
57
57
|
}
|
|
58
58
|
},
|