"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),g=require("@antsoo-lib/icons"),l=require("../_util/classNames.js"),P=require("../_util/util.js");require("../button/index.js");const R=require("../locale/LocaleReceiver.js"),S=require("../locale/en_US.js"),_=require("./interface.js"),C=require("../button/button.js"),F=t.defineComponent({name:"ATourPanel",inheritAttrs:!1,props:_.tourStepProps(),setup(r,{attrs:v,slots:f}){const{current:c,total:s}=t.toRefs(r),p=t.computed(()=>c.value===s.value-1),h=e=>{const n=r.prevButtonProps;r.onPrev?.(e),typeof n?.onClick=="function"&&n?.onClick()},k=e=>{const n=r.nextButtonProps;p.value?r.onFinish?.(e):r.onNext?.(e),typeof n?.onClick=="function"&&n?.onClick()};return()=>{const{prefixCls:e,title:n,onClose:B,cover:N,description:m,type:u,arrow:q}=r,o=r.prevButtonProps,i=r.nextButtonProps;let y;n&&(y=t.createVNode("div",{class:`${e}-header`},[t.createVNode("div",{class:`${e}-title`},[n])]));let $;m&&($=t.createVNode("div",{class:`${e}-description`},[m]));let V;N&&(V=t.createVNode("div",{class:`${e}-cover`},[N]));let d;f.indicatorsRender?d=f.indicatorsRender({current:c.value,total:s}):d=[...Array.from({length:s.value}).keys()].map((a,T)=>t.createVNode("span",{key:a,class:l.default(T===c.value&&`${e}-indicator-active`,`${e}-indicator`)},null));const x=u==="primary"?"default":"primary",b={type:"default",ghost:u==="primary"};return t.createVNode(R.default,{componentName:"Tour",defaultLocale:S.default.Tour},{default:a=>t.createVNode("div",{...v,class:l.default(u==="primary"?`${e}-primary`:"",v.class,`${e}-content`)},[q&&t.createVNode("div",{class:`${e}-arrow`,key:"arrow"},null),t.createVNode("div",{class:`${e}-inner`},[t.createVNode(g.CloseOutlined,{class:`${e}-close`,onClick:B},null),V,y,$,t.createVNode("div",{class:`${e}-footer`},[s.value>1&&t.createVNode("div",{class:`${e}-indicators`},[d]),t.createVNode("div",{class:`${e}-buttons`},[c.value!==0?t.createVNode(C.default,{...b,...o,onClick:h,size:"small",class:l.default(`${e}-prev-btn`,o?.className)},{default:()=>[P.isFunction(o?.children)?o.children():o?.children??a.Previous]}):null,t.createVNode(C.default,{type:x,...i,onClick:k,size:"small",class:l.default(`${e}-next-btn`,i?.className)},{default:()=>[P.isFunction(i?.children)?i?.children():p.value?a.Finish:a.Next]})])])])])})}}});exports.default=F;
