import{aH as I,b as x,W as D,aJ as P,U}from"./vendor-ui-CGT0cG1n.js";import{z as F,m as p,T as G,i as m,u as d,B as N,t as f}from"./index-D88CvPWT.js";import{c as B,a as K}from"./index.vue_vue_type_script_setup_true_lang-CmmAEEXC.js";import{v as H,aA as M,y as $,aC as z,aD as J,ac as _,aF as V,af as Y,g as r,ao as g,Y as Q,a9 as W,aP as X,ax as l,ab as j,l as Z,r as u,aO as w}from"./vendor-core-BKehvho7.js";import{u as q}from"./useKeyword-CjhhChz4.js";import"./index-B9hCLAJk.js";import"./useCompMetaLocalStore-BKTMp_k8.js";import"./useCacheOssStore-OAoLDVbw.js";import"./useVscodeOpen-BBdyQ3W2.js";import"./useTeamHeaders-DxHN7-t0.js";/* empty css                */import"./BaseDialog.vue_vue_type_script_setup_true_lang-BROcUfEh.js";import"./EmptyStatusContainer.vue_vue_type_script_setup_true_lang-pswB5SUz.js";import"./useMessage-Cbhfk7Nk.js";const ee={class:"size-full p-[10px] pr-0"},ge=H({__name:"index",setup(ae){const{t:n}=M(),h=$()?.uid,v=z(),T=J(),y=F(),a=B(v.path)();_(p.PROVIDE_KEY_COMP_LIST_STORE,a);const C=new Map;_(p.PROVIDE_KEY_CALLBACKS,C);const i=I(`${G}`,"XTTJ"),E=V("compIframeContainer"),S=r(()=>f.DEFAULT_TAG_GROUP.map(e=>({label:n(e.label),value:e.value}))),c=Y({data:[],search:{column:[{prop:"keyword",component:g(x),label:r(()=>n("common.keyword")),value:"",autoQuery:!1,attributes:{placeholder:r(()=>n("comp.keywordPlaceholder")),fetchSuggestions:R,triggerOnFocus:!1,style:"width: 400px",fitInputWidth:!0}},{prop:"tag",component:g(D),label:r(()=>n("common.filter")),value:i.value,attributes:{options:S,style:"width: 200px",onChange:e=>{i.value=e,window?.umami?.track(m.FILTER_TAG,{tag:e,page:"share"})}}}]},pagination:{total:0,attributes:{pageSizes:[10,20,30]}},autoLoading:!1,fetchData:L}),b=r(()=>c.value?.search?.column[0]?.value??"");q(b,E);function k(e){return e===f.DEFAULT_TAG_GROUP[0].value?JSON.stringify(y?.deps||[]):"[]"}function R(e,o){if(e.length<=1)return o([]);d.v1Keyword.keywordcontrollerQuerykeywordscomp({keyword:e,type:"compShare"}).then(s=>{const{keywords:t=[]}=s.data||{};o(t)})}async function L(e){a.renderList([]),await Q(),a.setLoading(!0),e.keyword&&window?.umami?.track(m.SEARCH_COMPONENT,{keyword:e.keyword,tag:i.value,page:"share"});const o={...e,deps:k(i.value)},s=await d.v1Comp.compcontrollerComps({...o}),{rows:t,total:O}=s.data??{};a.renderList(t??[]),c.value.pagination.total=O??0,c.value.data=t??[]}function A(e){T.push({path:`/preview/${e}`})}return W(()=>{a.$reset()}),(e,o)=>{const s=U,t=P;return X((j(),Z("div",ee,[u(l(N),{tableConfig:c.value},{table:w(()=>[u(s,{always:"",wrapClass:"pr-[10px]"},{default:w(()=>[u(K,{ref:"compIframeContainer",iuid:l(h),compType:l(p).IFRAME_ROUTES.CONTAINER.SHARE,onPreview:A},null,8,["iuid","compType"])]),_:1})]),_:1},8,["tableConfig"])])),[[t,l(a).loading]])}}});export{ge as default};
