1import{c as e,I as ae,u as oe,a as A,r as l,o as f,b as C,d as ne,w as t,e as w,n as j,f as x,t as _,h as k,g as m,P as H,i as le,j as q,k as L,l as G,m as T,p as V,q as se,s as re,v as P,D as ie,F as U,x as ce,y as ue,z as pe}from"./index-Ds-RRYYw.js";import{T as me,c as de,D as _e}from"./TileGrid-Bu90hcfq.js";import{_ as fe,u as ge,a as ye}from"./surveys-BTz56ux7.js";import{_ as z}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{I as ve}from"./Icon-BZOulYy9.js";import{u as he,R as be}from"./mcp.store-nlUkZS4L.js";import{_ as we}from"./ModalInvite-Nje15KOz.js";import{_ as xe}from"./ModalPlans-B4WYiYGm.js";import"./VLearnMore-DJ64Yx4w.js";var Se={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M536.1 273H488c-4.4 0-8 3.6-8 8v275.3c0 2.6 1.2 5 3.3 6.5l165.3 120.7c3.6 2.6 8.6 1.9 11.2-1.7l28.6-39c2.7-3.7 1.9-8.7-1.7-11.2L544.1 528.5V281c0-4.4-3.6-8-8-8zm219.8 75.2l156.8 38.3c5 1.2 9.9-2.6 9.9-7.7l.8-161.5c0-6.7-7.7-10.5-12.9-6.3L752.9 334.1a8 8 0 003 14.1zm167.7 301.1l-56.7-19.5a8 8 0 00-10.1 4.8c-1.9 5.1-3.9 10.1-6 15.1-17.8 42.1-43.3 80-75.9 112.5a353 353 0 01-112.5 75.9 352.18 352.18 0 01-137.7 27.8c-47.8 0-94.1-9.3-137.7-27.8a353 353 0 01-112.5-75.9c-32.5-32.5-58-70.4-75.9-112.5A353.44 353.44 0 01171 512c0-47.8 9.3-94.2 27.8-137.8 17.8-42.1 43.3-80 75.9-112.5a353 353 0 01112.5-75.9C430.6 167.3 477 158 524.8 158s94.1 9.3 137.7 27.8A353 353 0 01775 261.7c10.2 10.3 19.8 21 28.6 32.3l59.8-46.8C784.7 146.6 662.2 81.9 524.6 82 285 82.1 92.6 276.7 95 516.4 97.4 751.9 288.9 942 524.8 942c185.5 0 343.5-117.6 403.7-282.3 1.5-4.2-.7-8.9-4.9-10.4z"}}]},name:"history",theme:"outlined"};function D(a){for(var o=1;o<arguments.length;o++){var n=arguments[o]!=null?Object(arguments[o]):{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){Ie(a,i,n[i])})}return a}function Ie(a,o,n){return o in a?Object.defineProperty(a,o,{value:n,enumerable:!0,configurable:!0,writable:!0}):a[o]=n,a}var R=function(o,n){var r=D({},o,n.attrs);return e(ae,D({},r,{icon:Se}),null)};R.displayName="HistoryOutlined";R.inheritAttrs=!1;const Te={style:{padding:"12px 12px 0 12px"}},Ce={style:{"font-size":"32px","text-align":"center","letter-spacing":"4px","line-height":"2"}},ke={__name:"TemplateItem",props:{template:{type:Object,default:null},loading:{type:Boolean,default:!1},isCreating:{type:Boolean,default:!1}},emits:["create"],setup(a,{emit:o}){const n=a,r=o,{useToken:i}=le,{token:u}=i(),d=oe(),S=A(),I=()=>{d.preview({surveyId:n.template.survey_id})},y=()=>{r("create",{surveyId:n.template.survey_id,folderId:S.params.folderId,templateKey:n.template.slug||n.template.survey_id})};return(p,O)=>{const v=l("a-tag"),h=l("a-flex"),c=l("a-typography-paragraph"),b=l("a-button"),g=l("a-tooltip"),s=l("a-card");return f(),C(s,{size:"small",class:"template-card",loading:a.loading,style:j({"--color-border":m(u).colorBorder,"--color-text":m(u).colorText})},ne({default:t(()=>[e(h,{vertical:"",justify:"space-between",gap:"small",style:{height:"100%"}},{default:t(()=>[w("div",null,[e(c,{strong:"",ellipsis:{rows:1,expandable:!1},content:a.template?.title,style:{"margin-bottom":"8px"}},null,8,["content"]),e(c,{type:"secondary",ellipsis:{rows:3,expandable:!1},content:a.template?.description,style:{"margin-bottom":"0"}},null,8,["content"])]),e(h,{justify:"space-around"},{default:t(()=>[e(g,{title:p.$t("dashboard.modal.templates.tooltip.preview")},{default:t(()=>[e(b,{type:"text",icon:k(fe),onClick:I},null,8,["icon"])]),_:1},8,["title"]),e(g,{title:p.$t("dashboard.modal.templates.tooltip.useTemplate")},{default:t(()=>[e(b,{type:"text",icon:k(m(H)),loading:a.isCreating,onClick:y},null,8,["icon","loading"])]),_:1},8,["title"])]),_:1})]),_:1})]),_:2},[a.loading?void 0:{name:"cover",fn:t(()=>[w("div",{style:j({backgroundColor:a.template.color,borderRadius:"8px 8px 0 0"})},[w("div",Te,[e(h,{wrap:"wrap",gap:4},{default:t(()=>[e(v,{class:"template-tag"},{default:t(()=>[x(_(p.$t("dashboard.modal.templates.tag.questionsCount",{count:a.template.questionsCount})),1)]),_:1}),e(v,{class:"template-tag"},{default:t(()=>[x(_(p.$t("dashboard.modal.templates.tag.estTime",{time:a.template.estimatedTime})),1)]),_:1})]),_:1}),w("div",Ce,_(a.template.emoji),1)])],4)]),key:"0"}]),1032,["loading","style"])}}},Oe=z(ke,[["__scopeId","data-v-bd916abe"]]),$e={__name:"TemplateList",setup(a){const o=q(),n=A(),r=L(),i=T(!1),u=T(!1),d=T(null),S={xs:12,sm:12,md:8,lg:6},I=V(()=>i.value?de(_e):r.templates),{mutateAsync:y}=ge(),{mutateAsync:p}=ye(),O=c=>c.slug||c.survey_id,v=()=>{u.value=!0,y({folderId:n.params.folderId}).then(c=>{o.push({name:"SurveyQuestions",params:{surveyId:c._id}}),r.toggleModal()}).finally(()=>{u.value=!1})},h=({surveyId:c,folderId:b,templateKey:g})=>{d.value=g,p({surveyId:c,folderId:b}).then(s=>{o.push({name:"SurveyQuestions",params:{surveyId:s._id}}),r.toggleModal()}).finally(()=>{d.value=null})};return G(()=>{i.value=!0,r.fetch().finally(()=>{i.value=!1})}),(c,b)=>{const g=l("a-button");return f(),C(me,{items:I.value,"col-props":S,"tile-aspect-ratio":"4 / 5"},{prepend:t(()=>[e(g,{type:"dashed",class:"btn-create",icon:k(m(H)),loading:u.value,onClick:v},{default:t(()=>[x(_(c.$t("dashboard.modal.templates.button.create")),1)]),_:1},8,["icon","loading"])]),default:t(({item:s})=>[e(Oe,{template:s,loading:s.isSkeleton,"is-creating":!s.isSkeleton&&d.value===O(s),class:"template-item",onCreate:h},null,8,["template","loading","is-creating"])]),_:1},8,["items"])}}},Me={__name:"IconStarsAi",setup(a){return(o,n)=>(f(),C(m(ve),null,{component:t(()=>[...n[0]||(n[0]=[w("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"
1currentColor",viewBox:"0 0 16 16"},[w("path",{d:"M7.657 6.247c.11-.33.576-.33.686 0l.645 1.937a2.89 2.89 0 0 0 1.829 1.828l1.936.645c.33.11.33.576 0 .686l-1.937.645a2.89 2.89 0 0 0-1.828 1.829l-.645 1.936a.361.361 0 0 1-.686 0l-.645-1.937a2.89 2.89 0 0 0-1.828-1.828l-1.937-.645a.361.361 0 0 1 0-.686l1.937-.645a2.89 2.89 0 0 0 1.828-1.828zM3.794 1.148a.217.217 0 0 1 .412 0l.387 1.162c.173.518.579.924 1.097 1.097l1.162.387a.217.217 0 0 1 0 .412l-1.162.387A1.73 1.73 0 0 0 4.593 5.69l-.387 1.162a.217.217 0 0 1-.412 0L3.407 5.69A1.73 1.73 0 0 0 2.31 4.593l-1.162-.387a.217.217 0 0 1 0-.412l1.162-.387A1.73 1.73 0 0 0 3.407 2.31zM10.863.099a.145.145 0 0 1 .274 0l.258.774c.115.346.386.617.732.732l.774.258a.145.145 0 0 1 0 .274l-.774.258a1.16 1.16 0 0 0-.732.732l-.258.774a.145.145 0 0 1-.274 0l-.258-.774a1.16 1.16 0 0 0-.732-.732L9.1 2.137a.145.145 0 0 1 0-.274l.774-.258c.346-.115.617-.386.732-.732z"})],-1)])]),_:1}))}},Pe={class:"prompt-dropdown-item"},E=10,F=1e3,Ae={__name:"InputAi",setup(a){const{t:o}=se(),n=A(),r=q(),i=L(),u=re(),d=he(),S=T(),I=T(!0),y=T(!1),p=pe({prompt:""}),O=[{required:!0,message:o("ai.input.error.required")},{min:E,message:o("ai.input.error.minLength",{min:E})},{max:F,message:o("ai.input.error.maxLength",{max:F})}],v=V(()=>u.prompts);G(async()=>{try{await u.fetchPrompts()}finally{I.value=!1}});const h=s=>{p.prompt=s},c=({key:s})=>{h(s)},b=()=>{i.toggleModal(),d.openFromTemplates()},g=async s=>{y.value=!0;try{const{survey:$}=await u.generateSurvey({prompt:s.prompt,folderId:n.params.folderId});await r.push({name:"SurveyQuestions",params:{surveyId:$._id}}),i.toggleModal(),S.value?.resetFields()}finally{y.value=!1}};return(s,$)=>{const Q=l("a-textarea"),B=l("a-form-item"),N=l("a-button"),K=l("a-menu-item"),X=l("a-menu"),J=l("a-dropdown"),W=l("a-space"),Y=l("a-form"),Z=l("a-typography-link"),ee=l("a-tag"),te=l("a-typography-paragraph");return f(),P("div",null,[e(Y,{ref_key:"formRef",ref:S,model:p,layout:"vertical",autocomplete:"off","hide-required-mark":!0,onFinish:g},{default:t(()=>[e(B,{name:"prompt",rules:O,label:s.$t("ai.input.label.survey")},{default:t(()=>[e(Q,{value:p.prompt,"onUpdate:value":$[0]||($[0]=M=>p.prompt=M),placeholder:s.$t("ai.input.placeholder.survey"),"auto-size":{minRows:3}},null,8,["value","placeholder"])]),_:1},8,["label"]),e(B,{style:{"text-align":"right"}},{default:t(()=>[e(W,null,{default:t(()=>[v.value.length>0?(f(),C(J,{key:0,trigger:["click"],placement:"bottomRight"},{overlay:t(()=>[e(X,{onClick:c},{default:t(()=>[(f(!0),P(U,null,ce(v.value,M=>(f(),C(K,{key:M},{default:t(()=>[w("span",Pe,_(M),1)]),_:2},1024))),128))]),_:1})]),default:t(()=>[e(N,{icon:k(m(R)),loading:I.value},{default:t(()=>[x(_(s.$t("ai.title.recent"))+" ",1),e(m(ie))]),_:1},8,["icon","loading"])]),_:1})):ue("",!0),e(N,{"html-type":"submit",type:"primary",loading:y.value,icon:k(Me)},{default:t(()=>[x(_(s.$t("ai.button")),1)]),_:1},8,["loading","icon"])]),_:1})]),_:1})]),_:1},8,["model"]),e(te,{type:"secondary",style:{"text-align":"center"}},{default:t(()=>[e(Z,{onClick:b},{default:t(()=>[e(m(be)),x(" "+_(s.$t("ai.hint.agent")),1)]),_:1}),e(ee,{color:"success",style:{"margin-left":"8px","margin-right":"0"}},{default:t(()=>[x(_(s.$t("tag.new")),1)]),_:1})]),_:1})])}}},Le=z(Ae,[["__scopeId","data-v-5d144389"]]),ze={__name:"ModalTemplates",setup(a){const o=L();return(n,r)=>{const i=l("a-divider"),u=l("a-modal");return f(),C(u,{open:m(o).isModalOpen,"onUpdate:open":r[0]||(r[0]=d=>m(o).isModalOpen=d),width:1e3,footer:null},{default:t(()=>[e(Le,{style:{"max-width":"500px",margin:"0 auto"}}),e(i),e($e)]),_:1},8,["open"])}}},Re=z(ze,[["__scopeId","data-v-531f1c4a"]]),Ve={__name:"DashboardLayout",setup(a){return(o,n)=>{const r=l("router-view"),i=l("a-layout");return f(),P(U,null,[e(i,null,{default:t(()=>[e(r)]),_:1}),e(Re),e(we),e(xe)],64)}}};export{Ve as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.