var h=(C,V,p)=>new Promise((a,i)=>{var m=n=>{try{d(p.next(n))}catch(f){i(f)}},t=n=>{try{d(p.throw(n))}catch(f){i(f)}},d=n=>n.done?a(n.value):Promise.resolve(n.value).then(m,t);d((p=p.apply(C,V)).next())});import{d as A,s as F,r as x,e as I,w as H,v as P,f as g,g as l,z as Q,ax as J,B as b,D as k,_ as K,o as c,J as L,F as u,E as N,h as y,j as M,G as S,H as z,I as T,L as R,M as Z,n as O,K as W}from"./index-q8TQmcfk.js";import{_ as X,a as Y}from"./wd-tabs.h-1Wlxi-.js";import{_ as ee}from"./z-paging.qf1jZGzy.js";import{u as ae}from"./useZPaging.CofbECAl.js";import{q as te,a as ne}from"./qa.Ciqr42Ak.js";import"./useTouch.BnlusLLU.js";const pe=A({name:"HelpCenter",__name:"helpCenter",setup(C){const p=F().safeAreaInsets,a=x(null);ae(a);const i=x([]),m=x([]),t=x(""),d=I(()=>J.global.locale),n=I(()=>d.value!=="bn");H(d,()=>{var e;(e=a.value)==null||e.reload()});function f(e){return n.value?e.enName||"":e.bnName||""}function q(e){return n.value?e.enTitle||"":e.bnTitle||""}function B(){return h(this,null,function*(){const e=yield te();if(e.code==="200"){const o=e.data||[];m.value=o,!t.value&&o.length&&(t.value=String(o[0].id))}})}function D(e,o){return h(this,null,function*(){var v,w;if(!t.value){(v=a.value)==null||v.complete([]);return}try{const s=yield ne({page:e,size:o,groupId:Number(t.value)});s.code==="200"?a.value.complete(((w=s.data)==null?void 0:w.list)||[]):a.value.complete(!1)}catch(s){a.value.complete(!1)}})}function E(){var e;(e=a.value)==null||e.reload()}function G(e){W({url:"/pages/mine/helpCenterDetail",params:{id:e.id}})}return P(()=>h(this,null,function*(){var e;m.value.length?(e=a.value)==null||e.reload():yield B()})),(e,o)=>{const v=b(k("wd-tab"),X),w=b(k("wd-tabs"),Y),s=M,U=b(k("wd-icon"),K),$=b(k("z-paging"),ee),j=Q("layout-default-uni");return c(),g(j,null,{default:l(()=>[u(t)?(c(),g($,{key:0,ref_key:"paging",ref:a,modelValue:u(i),"onUpdate:modelValue":o[1]||(o[1]=r=>N(i)?i.value=r:null),"show-loading-more-no-more-view":!1,"use-page-scroll":"",onQuery:D},{top:l(()=>{var r;return[y(s,{class:"bg-white",style:O({paddingTop:`${(r=u(p))==null?void 0:r.top}px`})},{default:l(()=>[u(m).length&&u(t)?(c(),g(w,{key:0,modelValue:u(t),"onUpdate:modelValue":o[0]||(o[0]=_=>N(t)?t.value=_:null),"auto-line-width":!0,"custom-class":"bg-transparent!",slidable:"always",onClick:E},{default:l(()=>[(c(!0),S(z,null,T(u(m),_=>(c(),g(v,{key:_.id,name:String(_.id),title:f(_)},null,8,["name","title"]))),128))]),_:1},8,["modelValue"])):L("",!0)]),_:1},8,["style"])]}),default:l(()=>[y(s,{class:"pt-20rpx"},{default:l(()=>[(c(!0),S(z,null,T(u(i),r=>(c(),g(s,{key:r.id,class:"mb-20rpx bg-white px-22rpx py-20rpx",onClick:_=>G(r)},{default:l(()=>[y(s,{class:"flex items-center justify-between"},{default:l(()=>[y(s,{class:"flex-1 pr-16rpx text-28rpx line-height-[2]"},{default:l(()=>[R(Z(q(r)),1)]),_:2},1024),y(U,{name:"chevron-right",class:"opacity-50",size:"28rpx"})]),_:2},1024)]),_:2},1032,["onClick"]))),128))]),_:1})]),_:1},8,["modelValue"])):L("",!0)]),_:1})}}});export{pe as default};
