import{j as e,b as o}from"./BlockEditorTranslator-Do4trUgb.js";import"./index-CGoo2crO.js";import{S as x,b}from"./Icons-DvCYCYqp.js";const{InspectorControls:w}=wp.blockEditor,{CheckboxControl:l}=wp.components,g=({attributes:r,setAttributes:a})=>{const c=r.url_mode,s="new-tab",d="current-tab",h=r.category_mode,p=r.link_with_shop_app,i=t=>{a({url_mode:t})},m=()=>{const t=!r.category_mode;a({category_mode:!!t})},u=()=>{const t=!r.link_with_shop_app;a({link_with_shop_app:!!t})};return e.jsx(w,{children:e.jsxs("div",{className:"fluent-cart-searchbar-block-editor",children:[e.jsx("div",{className:"pb-4 px-4",children:e.jsxs("div",{className:"max-w-xs pl-5 mx-auto bg-white p-6 border border-solid border-neutral-200 rounded-md shadow-md",children:[e.jsx("h3",{className:"text-xs font-semibold mb-4",children:o("SearchBar")}),e.jsx(l,{type:"checkbox",label:o("New Tab"),value:s,checked:c===s,onChange:()=>i(s)}),e.jsx(l,{type:"checkbox",label:o("Current Tab"),value:d,checked:c===d,onChange:()=>i(d)})]})}),e.jsx("div",{className:"pb-4 px-4",children:e.jsxs("div",{className:"max-w-xs pl-5 mx-auto bg-white p-6 border border-solid border-neutral-200 rounded-md shadow-md",children:[e.jsx("h3",{className:"text-sm font-semibold mb-4",children:o("Category")}),e.jsx(l,{label:o("Category"),type:"checkbox",checked:h===!0,onChange:m})]})}),e.jsx("div",{className:"pb-4 px-4",children:e.jsxs("div",{className:"max-w-xs pl-5 mx-auto bg-white p-6 border border-solid border-neutral-200 rounded-md shadow-md",children:[e.jsx("h3",{className:"text-sm font-semibold mb-4",children:o("Link With Shop App")}),e.jsx(l,{label:o("Link With Shop App"),type:"checkbox",checked:p===!0,onChange:u})]})})]})})},j=({attributes:r})=>e.jsxs("div",{className:"flex",children:[r&&e.jsx("div",{className:"mr-4",children:e.jsx("select",{name:"termId",className:"border border-gray-300 rounded-md text-lg bg-white",children:e.jsx("option",{selected:!0,disabled:!0,children:o("Category")})})}),e.jsx("div",{className:"fct-searchbar-block-search-wrap w-full",children:e.jsxs("div",{className:"fct-input-group",children:[e.jsx("div",{className:"input-icon",children:e.jsx(x,{})}),e.jsx("input",{className:"fct-input text-sm w-full bg-white !shadow-none rounded border border-solid border-gray-outline py-2 px-3.5 m-0 leading-[1.43] placeholder:text-system-light placeholder:text-[13px] focus:border-primary-500",type:"text",placeholder:o("Search Products...")})]})})]}),_=""+new URL("assets/ProductCard-Cjop7KEd.png",import.meta.url).href,{registerBlockType:k}=wp.blocks,n=window.fluent_cart_fluent_products_search_bar_data;k(n.slug+"/"+n.name,{title:n.title,example:{attributes:{},innerBlocks:[{name:"core/image",attributes:{url:_,alt:"Product Search Preview",style:{width:"100%",height:"auto"}}}]},icon:{src:b},category:"fluent-cart",attributes:{url_mode:{type:"string",default:""},category_mode:{type:"boolean",default:!1},link_with_shop_app:{type:"boolean",default:!1}},edit:function({attributes:r,setAttributes:a}){const{useBlockProps:c}=wp.blockEditor,s=c();return e.jsx("div",{...s,children:e.jsxs("div",{className:"fluent-cart-searchbar-block-editor",children:[e.jsx(g,{attributes:r,setAttributes:a}),e.jsx(j,{attributes:r.category_mode,setAttributes:a})]})})},save:function(r){return null}});
