"use strict";var __create=Object.create,__defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(e,t)=>{for(var o in t)__defProp(e,o,{get:t[o],enumerable:!0})},__copyProps=(e,t,o,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let _ of __getOwnPropNames(t))__hasOwnProp.call(e,_)||_===o||__defProp(e,_,{get:()=>t[_],enumerable:!(r=__getOwnPropDesc(t,_))||r.enumerable});return e},__toESM=(e,t,o)=>(o=null!=e?__create(__getProtoOf(e)):{},__copyProps(!t&&e&&e.__esModule?o:__defProp(o,"default",{value:e,enumerable:!0}),e)),__toCommonJS=e=>__copyProps(__defProp({},"__esModule",{value:!0}),e),tab_button_exports={};__export(tab_button_exports,{DEFAULT_TAB_ORDER:()=>DEFAULT_TAB_ORDER,TabButton:()=>TabButton}),module.exports=__toCommonJS(tab_button_exports);var import_components=require("@wordpress/components"),import_clsx=__toESM(require("clsx")),import_element=require("@wordpress/element"),import_constants=require("../../../components/tabs/constants");const DEFAULT_TAB_ORDER=100,OrderedWrapper=({children:e})=>(0,import_element.createElement)(import_element.Fragment,null,e);function TabButton({children:e,className:t,id:o,order:r=DEFAULT_TAB_ORDER,selected:_=!1}){const n=(0,import_clsx.default)("wp-block-woocommerce-product-tab__button",t,{"is-selected":_});return(0,import_element.createElement)(import_components.Fill,{name:import_constants.TABS_SLOT_NAME},t=>{const{onClick:p}=t;return(0,import_element.createElement)(OrderedWrapper,{order:r},(0,import_element.createElement)(import_components.Button,{key:o,className:n,onClick:()=>p(o),id:`woocommerce-product-tab__${o}`,"aria-controls":`woocommerce-product-tab__${o}-content`,"aria-selected":_,tabIndex:_?void 0:-1,role:"tab"},e))})}