import{_ as e}from"./index100.js?v=1753954525509";import{e as a,dF as s,dG as l,c as t}from"./page_layout.js?v=1753954525509";import{u as i}from"./public.js?v=1753954525509";import{L as n}from"./like.js?v=1753954525509";import{k as r,ac as o,U as d,a1 as c,a2 as u,W as p,V as v,F as m,O as f,H as x,a3 as b,P as _,r as g,e as y,Q as k,X as h,ah as j,j as C,al as w}from"./vue.js?v=1753954525509";import{bY as F,cA as q,cH as U,ay as H}from"./naive.js?v=1753954525509";import"./common.js?v=1753954525509";import"./__commonjsHelpers__.js?v=1753954525509";const P={class:"flex border-1px border-solid border-#f3adaa"},$=["onClick"],E={class:"flex border-1px border-solid border-#f4cf8f"},I=["onClick"],M={class:"flex border-1px border-solid border-#b8e29f"},N=["onClick"],O=a(r({__name:"rating",props:{value:{},valueModifiers:{}},emits:["update:value"],setup(e){const a=o(e,"value"),s=e=>{a.value=e};return(e,l)=>{const t=F;return d(),c(t,{class:"justify-center! mb-16px",size:20},{default:u((()=>[p("div",null,[p("div",P,[(d(),v(m,null,f(6,(e=>p("div",{key:e,class:x(["rating-item","danger-item",{active:a.value===e}]),onClick:a=>s(e)},[p("span",null,b(e),1)],10,$))),64))]),l[0]||(l[0]=p("div",{class:"rating-label danger-text"},"No",-1))]),p("div",null,[p("div",E,[(d(),v(m,null,f(2,(e=>p("div",{key:e+6,class:x(["rating-item","warning-item",{active:a.value===e+6}]),onClick:a=>s(e+6)},[p("span",null,b(e+6),1)],10,I))),64))]),l[1]||(l[1]=p("div",{class:"rating-label warning-text"},"Yes",-1))]),p("div",null,[p("div",M,[(d(),v(m,null,f(2,(e=>p("div",{key:e+8,class:x(["rating-item","success-item",{active:a.value===e+8}]),onClick:a=>s(e+8)},[p("span",null,b(e+8),1)],10,N))),64))]),l[2]||(l[2]=p("div",{class:"rating-label success-text"},"Must",-1))])])),_:1})}}}),[["__scopeId","data-v-c528e412"]]),S={class:"banner"},W={class:"banner-title"},Y={class:"ml-8px"},z={key:0,class:"px-24px"},A={class:"text-primary"},B={class:"flex justify-center my-20px"},G=a(r({__name:"form",emits:["close"],setup(a,{emit:r}){const{t:o}=_(),x=g(0),F=r,P=y({}),$=y({}),E=g(null),I=g([]),M=async()=>{var e;await(null==(e=E.value)?void 0:e.validate());const a={questions:JSON.stringify(I.value.reduce(((e,a)=>(e[a.id]=P[a.id],e)),{})),rate:x.value,product_type:1};await s(a),F("close"),N()},N=()=>{const e=i({hideClose:!0,content:()=>k("div",{class:"flex-center flex-col w-230px h-124px bg-#F1F9F3"},[k("img",{class:"w-56px",src:n},null),k("div",{class:"mt-16px"},[o("Component.Feedback.index_6")])])});setTimeout((()=>{e.hide()}),3e3)};return(async()=>{const{message:e}=await l();t(e)&&(I.value=e.res,e.res.forEach((e=>{P[e.id]=""})),e.res.forEach((e=>{1===e.required&&($[e.id]={required:!0,message:e.question,trigger:["blur","change"]})})))})(),(a,s)=>{const l=e,t=q,i=U,n=H;return d(),v("div",null,[p("div",S,[p("div",W,[p("span",Y,b(a.$t("Component.Feedback.index_1")),1)])]),s[1]||(s[1]=p("div",{class:"text-center text-20px font-bold my-20px"},"Would you recommend aaPanel?",-1)),k(O,{value:h(x),"onUpdate:value":s[0]||(s[0]=e=>j(x)?x.value=e:null)},null,8,["value"]),h(x)?(d(),v("div",z,[k(i,{model:h(P),rules:h($),ref_key:"formRef",ref:E},{default:u((()=>[(d(!0),v(m,null,f(h(I),(e=>(d(),c(t,{label:e.question,path:e.id,key:e.id},{default:u((()=>[k(l,{value:h(P)[e.id],"onUpdate:value":a=>h(P)[e.id]=a,placeholder:e.hint},null,8,["value","onUpdate:value","placeholder"])])),_:2},1032,["label","path"])))),128))])),_:1},8,["model","rules"]),p("div",A,b(a.$t("Component.Feedback.index_4")),1),p("div",B,[k(n,{type:"primary",class:"w-120px",onClick:M},{default:u((()=>[C(b(a.$t("Public.Btn.Submit")),1)])),_:1})])])):w("",!0)])}}}),[["__scopeId","data-v-cfb29806"]]);export{G as default};
