import{j as e,b as r}from"./chunks/BlockEditorTranslator.js?ver=1.5.4";import"./chunks/index6.js?ver=1.5.4";import{S as w,b as _}from"./chunks/Icons.js?ver=1.5.4";const{InspectorControls:j}=wp.blockEditor,{CheckboxControl:t}=wp.components,k=({attributes:o,setAttributes:a})=>{const c=o.url_mode,s="new-tab",d="current-tab",p=o.category_mode,m=o.link_with_shop_app,h=o.show_thumbnail,i=l=>{a({url_mode:l})},b=()=>{const l=!o.category_mode;a({category_mode:!!l})},u=()=>{const l=!o.link_with_shop_app;a({link_with_shop_app:!!l})},x=()=>{a({show_thumbnail:!h})};return e.jsx(j,{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:r("SearchBar")}),e.jsx(t,{type:"checkbox",label:r("New Tab"),value:s,checked:c===s,onChange:()=>i(s)}),e.jsx(t,{type:"checkbox",label:r("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:r("Category")}),e.jsx(t,{label:r("Category"),type:"checkbox",checked:p===!0,onChange:b})]})}),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:r("Link With Shop App")}),e.jsx(t,{label:r("Link With Shop App"),type:"checkbox",checked:m===!0,onChange:u})]})}),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 mt-0",children:r("Show Thumbnail")}),e.jsx(t,{label:r("Show Thumbnail"),type:"checkbox",checked:h===!0,onChange:x})]})})]})})},g=({attributes:o})=>e.jsxs("div",{className:"flex",children:[o&&e.jsx("div",{className:"fct-searchbar-block-select-wrap",children:e.jsx("select",{name:"termId",children:e.jsx("option",{selected:!0,disabled:!0,children:r("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(w,{})}),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:r("Search Products...")})]})})]}),f=""+new URL("assets/ProductCard.png",import.meta.url).href,{registerBlockType:y}=wp.blocks,n=window.fluent_cart_fluent_products_search_bar_data;y(n.slug+"/"+n.name,{apiVersion:3,title:n.title,example:{attributes:{},innerBlocks:[{name:"core/image",attributes:{url:f,alt:"Product Search Preview",style:{width:"100%",height:"auto"}}}]},icon:{src:_},category:"fluent-cart",attributes:{url_mode:{type:"string",default:""},category_mode:{type:"boolean",default:!1},link_with_shop_app:{type:"boolean",default:!1},show_thumbnail:{type:"boolean",default:!0}},edit:function({attributes:o,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(k,{attributes:o,setAttributes:a}),e.jsx(g,{attributes:o.category_mode,setAttributes:a})]})})},save:function(o){return null}});
