"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.DownloadsMenu=void 0;const components_1=require("@wordpress/components"),element_1=require("@wordpress/element"),i18n_1=require("@wordpress/i18n"),icons_1=require("@wordpress/icons"),media_library_menu_item_1=require("../media-library-menu-item"),insert_url_menu_item_1=require("../insert-url-menu-item");function DownloadsMenu({allowedTypes:e,onUploadSuccess:n,onUploadError:o}){return(0,element_1.createElement)(components_1.Dropdown,{position:"bottom left",contentClassName:"woocommerce-downloads-menu__menu-content",renderToggle:({isOpen:e,onToggle:n})=>(0,element_1.createElement)(components_1.Button,{"aria-expanded":e,icon:e?icons_1.chevronUp:icons_1.chevronDown,variant:"secondary",onClick:n,className:"woocommerce-downloads-menu__toogle"},(0,element_1.createElement)("span",null,(0,i18n_1.__)("Add new","woocommerce"))),renderContent:({onClose:r})=>(0,element_1.createElement)("div",{className:"components-dropdown-menu__menu"},(0,element_1.createElement)(components_1.MenuGroup,null,(0,element_1.createElement)(media_library_menu_item_1.MediaLibraryMenuItem,{allowedTypes:e,onUploadSuccess:e=>{n(e),r()}}),(0,element_1.createElement)(insert_url_menu_item_1.InsertUrlMenuItem,{onUploadSuccess:e=>{n(e),r()},onUploadError:o})))})}exports.DownloadsMenu=DownloadsMenu;