"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),y=require("@ant-design/icons-vue/QuestionCircleOutlined"),b=require("../_util/classNames.js"),_=require("../grid/Col.js"),I=require("../locale/LocaleReceiver.js"),M=require("../locale/en_US.js"),S=require("../tooltip/index.js"),j=require("./context.js"),c=(a,{slots:r,emit:p,attrs:C})=>{const{prefixCls:l,htmlFor:v,labelCol:N,labelAlign:g,colon:s,required:u,requiredMark:d}={...a,...C},[q]=I.useLocaleReceiver("Form"),t=a.label??r.label?.();if(!t)return null;const{vertical:$,labelAlign:L,labelCol:F,labelWrap:V,colon:x}=j.useInjectForm(),m=N||F?.value||{},h=g||L?.value,n=`${l}-item-label`,A=b.default(n,h==="left"&&`${n}-left`,m.class,{[`${n}-wrap`]:!!V.value});let o=t;const f=s===!0||x?.value!==!1&&s!==!1;if(f&&!$.value&&typeof t=="string"&&t.trim()!==""&&(o=t.replace(/[:|：]\s*$/,"")),a.tooltip||r.tooltip){const i=e.createVNode("span",{class:`${l}-item-tooltip`},[e.createVNode(S.default,{title:a.tooltip},{default:()=>[e.createVNode(y,null,null)]})]);o=e.createVNode(e.Fragment,null,[o,r.tooltip?r.tooltip?.({class:`${l}-item-tooltip`}):i])}d==="optional"&&!u&&(o=e.createVNode(e.Fragment,null,[o,e.createVNode("span",{class:`${l}-item-optional`},[q.value?.optional||M.default.Form?.optional])]));const k=b.default({[`${l}-item-required`]:u,[`${l}-item-required-mark-optional`]:d==="optional",[`${l}-item-no-colon`]:!f});return e.createVNode(_.default,{...m,class:A},{default:()=>[e.createVNode("label",{for:v,class:k,title:typeof t=="string"?t:"",onClick:i=>p("click",i)},[o])]})};c.displayName="FormItemLabel";c.inheritAttrs=!1;exports.default=c;
