Current File : /home/resuelf/www/wp-content/plugins/aawp/assets/block/dist/index.js |
!function(){"use strict";var e={n:function(a){var t=a&&a.__esModule?function(){return a.default}:function(){return a};return e.d(t,{a:t}),t},d:function(a,t){for(var l in t)e.o(t,l)&&!e.o(a,l)&&Object.defineProperty(a,l,{enumerable:!0,get:t[l]})},o:function(e,a){return Object.prototype.hasOwnProperty.call(e,a)}},a=window.wp.element,t=window.wp.blocks;window.React;var l=window.wp.i18n,n=window.wp.blockEditor,o=window.wp.components,i=window.wp.serverSideRender,r=e.n(i);(0,t.registerBlockType)("aawp/aawp-block",{icon:(0,a.createElement)("img",{src:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNjMiIGhlaWdodD0iNTAiIHZpZXdCb3g9IjAgMCA2MyA1MCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4NCjxwYXRoIGQ9Ik0yMC45NyAyNC41NzNIOS42MDUwMUw3LjcyIDMwLjEwNUgwLjAwMTAwNzA4TDExLjEwOCAwSDE5LjU1NkwzMC42NjMgMzAuMTA1SDIyLjg1OEwyMC45NyAyNC41NzNaTTE5LjA4MyAxOC45OThMMTUuMzA5IDcuODQ3OTlMMTEuNDkzIDE4Ljk5OEgxOS4wODNaIiBmaWxsPSIjMTIwQjQ1Ii8+DQo8cGF0aCBkPSJNNTMuMDcgMjQuNTczSDQxLjcwNUwzOS44MTUgMzAuMTA1SDMyLjA5Nkw0My4yMDMgMEg1MS42NTFMNjIuNzU4IDMwLjEwNUg1NC45NTNMNTMuMDcgMjQuNTczWk01MS4xODMgMTguOTk4TDQ3LjQwOSA3Ljg0Nzk5TDQzLjU5MiAxOC45OThINTEuMTgzWiIgZmlsbD0iIzEyMEI0NSIvPg0KPHBhdGggZD0iTTU5LjExMyAzNS4yNzlMNTguOTI1IDM1LjQwM0M1MC43NDcgNDAuNzg3IDQxLjIyNSA0Mi44NiAzMS4zOCA0Mi44NkMyMS41MzUgNDIuODYgMTIuMDE1IDQwLjc4NyAzLjgzNzAxIDM1LjQwM0wzLjY0OTAyIDM1LjI3OUwwIDQwLjgyMkwwLjE4ODAxOSA0MC45NDZDOS40NTIwMiA0Ny4wNDYgMjAuMjM5IDQ5LjQ5NyAzMS4zOCA0OS40OTdDNDIuNTIxIDQ5LjQ5NyA1My4zMDkgNDcuMDQ2IDYyLjU3NCA0MC45NDZMNjIuNzYyIDQwLjgyMkw1OS4xMTMgMzUuMjc5WiIgZmlsbD0iI0ZFNjU3OCIvPg0KPC9zdmc+DQo=",alt:"AAWP Logo",height:"24",width:"24"}),name:"aawp/aawp-block",title:"AAWP",category:"widgets",description:"The best WordPress plugin for Amazon Affiliates.",textdomain:"aawp",edit:function(e){const{attributes:{look:t="",asin:i="",keywords:p="",items:s=10,order:_="ASC",orderby:c="",order_items:w=10,filterby:u="",filter:b="",filter_items:g=10,filter_type:d="include",filter_compare:m="equal",ribbon:h=!0,ribbon_text:k="",title:y="",title_length:v=(void 0!==aawp_data.options.output.title_length?aawp_data.options.output.title_length:"100"),link_title:C="",link_overwrite:x="",link_type:E="",link_icon:T="",link_class:f="",description:M="",description_items:S=(void 0!==aawp_data.options.output.description_items?parseInt(aawp_data.options.output.description_items):5),description_length:N=(void 0!==aawp_data.options.output.description_length?aawp_data.options.output.description_length:"200"),image:D="",image_size:A=(void 0!==aawp_data.options.output.image_size?aawp_data.options.output.image_size:"medium"),image_alt:O="",image_title:I="",image_align:L="center",image_width:z="",image_height:j="",image_class:P="",button:B=!0,button_text:R=(void 0!==aawp_data.options.output.button_text?aawp_data.options.output.button_text:"Buy on Amazon"),button_detail:Q="",button_detail_text:U=(void 0!==aawp_data.options.output.button_detail_text?aawp_data.options.output.button_detail_text:"Details"),button_detail_title:F="",button_detail_target:H="",button_detail_rel:W="",price:Z="",sale_ribbon_text:G=(void 0!==aawp_data.options.output.pricing_sale_ribbon_text?aawp_data.options.output.pricing_sale_ribbon_text:"Sale"),rating:Y="",star_rating:q=!0,reviews:X=!0,template:K="",grid:V="",class_attr:J="",numbering:$=!0,tracking_id:ee="",value_attr:ae="",apply_link:te=!1,table:le=""},setAttributes:ne}=e;let oe,ie,re,pe=[];const se=Object.entries(aawp_data.tables).map((function(e){let[a,t]=e;return{value:a,label:t}}));se.unshift({value:"",label:"-- Select A Table --"}),["box","fields","link"].includes(t)?(ie=(0,a.createElement)(o.TextControl,{ref:e=>e&&""===i&&e.focus(),key:"aawp-asin-input-control",className:"aawp-asin-input-control",label:(0,l.__)("ASIN","aawp"),value:i,placeholder:(0,l.__)("Enter ASIN here...","aawp"),onChange:e=>ne({asin:e}),help:(0,l.__)("Multiple ASIN values can be separated by comma.","aawp")}),ie=[ie,"OR",(0,a.createElement)("div",{key:"components-base-control aawp-products-search-container",className:"aawp-products-search-container"},(0,a.createElement)(o.Button,{variant:"secondary",key:"aawp-table-add-products-search",className:"aawp-table-add-products-search",href:"#aawp-modal-table-product-search","data-aawp-modal":"true","data-aawp-table-add-products-search":"true"},(0,a.createElement)("span",{className:"dashicons dashicons-search"}),(0,l.__)(" Search for product(s) without ASIN","aawp")))],"fields"===t&&(re=(0,a.createElement)(o.SelectControl,{key:"aawp-fields-value-input-control",className:"aawp-fields-value-input-control",label:(0,l.__)("Value","aawp"),value:ae,options:[{value:"",label:(0,l.__)("-- Select An Option --","aawp")},{value:"title",label:(0,l.__)("Title","aawp")},{value:"description",label:(0,l.__)("Description","aawp")},{value:"thumb",label:(0,l.__)("Thumbnail","aawp")},{value:"star_rating",label:(0,l.__)("Star Rating","aawp")},{value:"price",label:(0,l.__)("Price","aawp")},{value:"button",label:(0,l.__)("Button","aawp")}],onChange:e=>ne({value_attr:e}),help:(0,l.__)("To display single product data e.g. title, description or price.","aawp")}))):"bestseller"===t||"new"===t?ie=(0,a.createElement)(o.TextControl,{ref:e=>e&&""===p&&e.focus(),key:"aawp-keywords-input-control",label:(0,l.__)("Keywords","aawp"),value:p,placeholder:(0,l.__)('Enter keywords here. E.g. "top 4k monitors"',"aawp"),onChange:e=>ne({keywords:e})}):"table"===t&&(ie=(0,a.createElement)(o.SelectControl,{autoFocus:!0,key:"aawp-comparison-table-select-control",label:(0,l.__)("Select A Table","aawp"),value:le,options:se,onChange:e=>ne({table:e}),help:(0,l.__)("To display the comparison table.","aawp")}));let _e=(0,a.createElement)(o.RangeControl,{key:"aawp-items-number-control",label:(0,l.__)("Number of items","aawp"),value:s,onChange:e=>ne({items:e}),min:1,max:25,help:(0,l.__)("Defines the maximum amount of products which will be shown.","aawp")}),ce=(0,a.createElement)(o.SelectControl,{label:(0,l.__)("Order By","aawp"),key:"aawp-orderby-selector-select-control",value:c,options:[{value:"",label:(0,l.__)("-- Select An Option --","aawp")},{value:"amount_saved",label:(0,l.__)("Amount Saved","aawp")},{value:"percentage_saved",label:(0,l.__)("Percentage Saved","aawp")},{value:"price",label:(0,l.__)("Price","aawp")},{value:"rating",label:(0,l.__)("Rating","aawp")},{value:"title",label:(0,l.__)("Title","aawp")}],onChange:e=>ne({orderby:e}),help:(0,l.__)("Ordering on the basis of certain attributes.","aawp")}),we=(0,a.createElement)(o.SelectControl,{label:(0,l.__)("Order","aawp"),key:"aawp-order-selector-select-control",value:_,options:[{value:"ASC",label:(0,l.__)("Ascending","aawp")},{value:"DESC",label:(0,l.__)("Descending","aawp")}],onChange:e=>ne({order:e}),help:(0,l.__)("Direction of ordering.","aawp")}),ue=(0,a.createElement)(o.RangeControl,{label:(0,l.__)("Order Items","aawp"),key:"aawp-order-items-text-control",value:w,onChange:e=>ne({order_items:e}),min:1,max:10,help:(0,l.__)('Similar to the global "items" attribute but defining the maximum order (search) radius.',"aawp")}),be=(0,a.createElement)(o.SelectControl,{label:(0,l.__)("Filter By","aawp"),key:"aawp-filterby-selector-select-control",value:u,options:[{value:"",label:(0,l.__)("-- Select A Filter --","aawp")},{value:"price",label:(0,l.__)("Price","aawp")},{value:"title",label:(0,l.__)("Title","aawp")}],onChange:e=>ne({filterby:e}),help:(0,l.__)("Filtering on the basis of certain attributes.","aawp")}),ge=(0,a.createElement)(o.TextControl,{label:(0,l.__)("Filter","aawp"),key:"aawp-filter-text-control",value:b,onChange:e=>ne({filter:e}),help:(0,l.__)("Defining the characteristic for applying the filter.","aawp")}),de=(0,a.createElement)(o.RangeControl,{label:(0,l.__)("Filter Items","aawp"),type:"number",key:"aawp-filter-items-text-control",value:g,onChange:e=>ne({filter_items:e}),min:1,max:10,help:(0,l.__)('Similar to the global "items" attribute but defining the maximum filter (search) radius.',"aawp")}),me=(0,a.createElement)(o.SelectControl,{label:(0,l.__)("Filter Type","aawp"),key:"aawp-filter-type-selector-select-control",value:d,options:[{value:"include",label:(0,l.__)("Include","aawp")},{value:"exclude",label:(0,l.__)("Exclude","aawp")}],onChange:e=>ne({filter_type:e}),help:(0,l.__)("Defining the filter direction.","aawp")}),he=(0,a.createElement)(o.SelectControl,{label:(0,l.__)("Filter Compare","aawp"),key:"aawp-filter-compare-selector-select-control",value:m,options:[{value:"equal",label:(0,l.__)("Equal","aawp")},{value:"less",label:(0,l.__)("Less","aawp")},{value:"more",label:(0,l.__)("More","aawp")},{value:"range",label:(0,l.__)("Range","aawp")}],onChange:e=>ne({filter_compare:e}),help:(0,l.__)("Required for comparing prices.","aawp")}),ke=(0,a.createElement)(o.ToggleControl,{label:(0,l.__)("Show Ribbon","aawp"),key:"aawp-ribbon-selector-select-control",checked:h,onChange:e=>ne({ribbon:e}),help:(0,l.__)("Showing the ribbon (e.g. bestseller no X) on the top left.","aawp")}),ye=(0,a.createElement)(o.TextControl,{label:(0,l.__)("Custom Ribbon Text","aawp"),key:"aawp-ribbon-text-text-control",value:k,onChange:e=>ne({ribbon_text:e}),help:(0,l.__)("Overwriting the ribbon text (e.g. bestseller no X) on the top left.","aawp")}),ve=(0,a.createElement)(o.TextControl,{label:(0,l.__)("Title","aawp"),key:"aawp-title-text-control",value:y,onChange:e=>ne({title:e}),help:(0,l.__)("Overwriting the original product title.","aawp")}),Ce=(0,a.createElement)(o.TextControl,{label:(0,l.__)("Title Length","aawp"),type:"number",key:"aawp-title-length-text-control",value:v,onChange:e=>ne({title_length:e}),help:(0,l.__)("Specifies a maximum amount of characters for the product title.","aawp")}),xe=(0,a.createElement)(o.TextControl,{label:(0,l.__)("Link Title","aawp"),key:"aawp-link-title-text-control",value:C,onChange:e=>ne({link_title:e}),help:(0,l.__)('Overwriting HTML link "title“ attribute.',"aawp")}),Ee=(0,a.createElement)(o.TextControl,{label:(0,l.__)("Link Overwrite","aawp"),key:"aawp-link-overwrite-text-control",type:"url",value:x,onChange:e=>ne({link_overwrite:e}),help:(0,l.__)("Replacing the links.","aawp")}),Te=(0,a.createElement)(o.SelectControl,{label:(0,l.__)("Link Type","aawp"),key:"aawp-link-type-select-control",value:E,options:[{value:"basic",label:(0,l.__)("Basic","aawp")},{value:"reviews",label:(0,l.__)("Reviews","aawp")},{value:"cart",label:(0,l.__)("Cart","aawp")}],onChange:e=>ne({link_type:e}),help:(0,l.__)("Specify the link type.","aawp")}),fe=(0,a.createElement)(o.SelectControl,{label:(0,l.__)("Link Icon","aawp"),key:"aawp-link-icon-select-control",value:T,options:[{value:"none",label:(0,l.__)("None","aawp")},{value:"amazon",label:(0,l.__)("Amazon","aawp")},{value:"amazon-logo",label:(0,l.__)("Amazon Logo","aawp")},{value:"cart",label:(0,l.__)("Cart","aawp")}],onChange:e=>ne({link_icon:e}),help:(0,l.__)("Specify the link icon.","aawp")}),Me=(0,a.createElement)(o.TextControl,{label:(0,l.__)("Link Class","aawp"),key:"aawp-link-class-text-control",value:f,onChange:e=>ne({link_class:e}),help:(0,l.__)("Specify your own link CSS classes.","aawp")}),Se=(0,a.createElement)(o.TextareaControl,{label:(0,l.__)("Custom Description","aawp"),key:"aawp-description-text-control",value:M,onChange:e=>ne({description:e}),help:(0,l.__)("Using a custom product description.","aawp")}),Ne=(0,a.createElement)(o.RangeControl,{label:(0,l.__)("Description Items","aawp"),type:"number",key:"aawp-description-items-text-control",value:S,onChange:e=>ne({description_items:e}),min:1,max:10,help:(0,l.__)("Specify a maximum amount for list items.","aawp")}),De=(0,a.createElement)(o.TextControl,{label:(0,l.__)("Description Length","aawp"),type:"number",key:"aawp-description-length-text-control",value:N,onChange:e=>ne({description_length:e}),help:(0,l.__)("Specifies a maximum amount of characters for each list item.","aawp")}),Ae=(0,a.createElement)(o.TextControl,{label:(0,l.__)("Image Selection","aawp"),key:"aawp-image-text-control",value:D,onChange:e=>ne({image:e}),help:(0,l.__)("You can select another product image by entering a number from 1 to 5 or a direct link to an image file.","aawp")}),Oe=(0,a.createElement)(o.SelectControl,{label:(0,l.__)("Image Size","aawp"),key:"aawp-image-size-select-control",value:A,options:[{value:"small",label:(0,l.__)("Small","aawp")},{value:"medium",label:(0,l.__)("Medium","aawp")},{value:"large",label:(0,l.__)("Large","aawp")}],onChange:e=>ne({image_size:e}),help:(0,l.__)("Overwriting the thumbnail size.","aawp")}),Ie=(0,a.createElement)(o.TextControl,{label:(0,l.__)("Image Alt","aawp"),key:"aawp-image-alt-text-control",value:O,onChange:e=>ne({image_alt:e}),help:(0,l.__)('Overwriting HTML image "alt" attribute..',"aawp")}),Le=(0,a.createElement)(o.TextControl,{label:(0,l.__)("Image Title","aawp"),key:"aawp-image-title-text-control",value:I,onChange:e=>ne({image_title:e}),help:(0,l.__)('Adding HTML image "title" attribute.',"aawp")}),ze=(0,a.createElement)(o.SelectControl,{label:(0,l.__)("Image Align","aawp"),key:"aawp-image-align-select-control",value:L,options:[{value:"center",label:(0,l.__)("Center","aawp")},{value:"left",label:(0,l.__)("Left","aawp")},{value:"right",label:(0,l.__)("Right","aawp")}],onChange:e=>ne({image_align:e}),help:(0,l.__)("Align images right or left","aawp")}),je=(0,a.createElement)(o.TextControl,{label:(0,l.__)("Image Width","aawp"),type:"number",key:"aawp-image-width-text-control",value:z,onChange:e=>ne({image_width:e}),help:(0,l.__)("Specifies the width of a single image.","aawp")}),Pe=(0,a.createElement)(o.TextControl,{label:(0,l.__)("Image Height","aawp"),key:"aawp-image-height-text-control",value:j,onChange:e=>ne({image_height:e}),help:(0,l.__)("Specifies the height of a single image.","aawp")}),Be=(0,a.createElement)(o.TextControl,{label:(0,l.__)("Image Class","aawp"),key:"aawp-image-class-text-control",value:P,onChange:e=>ne({image_class:e}),help:(0,l.__)('Adding HTML image "title" attribute.',"aawp")}),Re=(0,a.createElement)(o.ToggleControl,{label:(0,l.__)('Display "Buy on Amazon" Button',"aawp"),key:"aawp-button-select-control",checked:B,onChange:e=>ne({button:e}),help:(0,l.__)('Showing or hiding the "Buy on Amazon" button.',"aawp")}),Qe=(0,a.createElement)(o.TextControl,{label:(0,l.__)("Button Text","aawp"),key:"aawp-button-text-text-control",value:R,onChange:e=>ne({button_text:e}),help:(0,l.__)("Overwriting the button text.","aawp")}),Ue=(0,a.createElement)(o.TextControl,{label:(0,l.__)("Link","aawp"),key:"aawp-button-detail-text-control",value:Q,onChange:e=>ne({button_detail:e}),help:(0,l.__)("Displaying an extra button and setting up the link target.","aawp")}),Fe=(0,a.createElement)(o.TextControl,{label:(0,l.__)("Text","aawp"),key:"aawp-button-detail-text-text-control",value:U,onChange:e=>ne({button_detail_text:e}),help:(0,l.__)("Overwriting the button detail text.","aawp")}),He=(0,a.createElement)(o.TextControl,{label:(0,l.__)("Title","aawp"),key:"aawp-button-detail-title-text-control",value:F,onChange:e=>ne({button_detail_title:e}),help:(0,l.__)('Overwriting HTML link "title" attribute.',"aawp")}),We=(0,a.createElement)(o.TextControl,{label:(0,l.__)("Target","aawp"),key:"aawp-button-detail-target-text-control",value:H,onChange:e=>ne({button_detail_target:e}),help:(0,l.__)('Overwriting HTML link "target" attribute (standard = current window).',"aawp")}),Ze=(0,a.createElement)(o.TextControl,{label:(0,l.__)("Rel","aawp"),key:"aawp-button-detail-rel-text-control",value:W,onChange:e=>ne({button_detail_rel:e}),help:(0,l.__)('Setting a custom HTML link "rel" attribute',"aawp")}),Ge=(0,a.createElement)(o.TextControl,{label:(0,l.__)("Custom Price","aawp"),key:"aawp-price-text-control",value:Z,onChange:e=>ne({price:e}),help:(0,l.__)("Overwriting the price text.","aawp")}),Ye=(0,a.createElement)(o.TextControl,{label:(0,l.__)("Sale Ribbon Text","aawp"),key:"aawp-sale-ribbon-text-text-control",value:G,onChange:e=>ne({sale_ribbon_text:e}),help:(0,l.__)("Overwriting the sale ribbon text on the top right.","aawp")}),qe=(0,a.createElement)(o.TextControl,{label:(0,l.__)("Custom Rating","aawp"),key:"aawp-rating-text-control",value:Y,onChange:e=>ne({rating:e}),help:(0,l.__)("Overwriting the rating value.","aawp")}),Xe=(0,a.createElement)(o.ToggleControl,{label:(0,l.__)("Show Star Rating","aawp"),key:"aawp-star-rating-select-control",checked:q,onChange:e=>ne({star_rating:e}),help:(0,l.__)("Showing or hiding the star rating.","aawp")}),Ke=(0,a.createElement)(o.ToggleControl,{label:(0,l.__)("Show Reviews","aawp"),key:"aawp-reviews-rating-select-control",checked:X,onChange:e=>ne({reviews:e}),help:(0,l.__)("Showing or hiding the amount of reviews.","aawp")}),Ve=(0,a.createElement)(o.SelectControl,{label:(0,l.__)("Template","aawp"),key:"aawp-template-select-control",value:K,options:[{value:"",label:(0,l.__)("Default","aawp")},{value:"horizontal",label:(0,l.__)("Horizontal","aawp")},{value:"vertical",label:(0,l.__)("Vertical","aawp")},{value:"list",label:(0,l.__)("List","aawp")},{value:"table",label:(0,l.__)("Table","aawp")},{value:"widget",label:(0,l.__)("Widget","aawp")},{value:"widget-vertical",label:(0,l.__)("Widget Vertical","aawp")},{value:"widget-small",label:(0,l.__)("Widget Small","aawp")}],onChange:e=>ne({template:e}),help:(0,l.__)("Replacing the PHP template which will be used for the output.","aawp")}),Je=(0,a.createElement)(o.SelectControl,{label:(0,l.__)("Grid","aawp"),key:"aawp-grid-select-control",value:V,onChange:e=>ne({grid:e}),options:[{value:"0",label:(0,l.__)("Default","aawp")},{value:"2",label:(0,l.__)("2 Columns","aawp")},{value:"3",label:(0,l.__)("3 Columns","aawp")},{value:"4",label:(0,l.__)("4 Columns","aawp")},{value:"5",label:(0,l.__)("5 Columns","aawp")},{value:"6",label:(0,l.__)("6 Columns","aawp")}],help:(0,l.__)("Displaying product boxes side by side.","aawp")}),$e=(0,a.createElement)(o.ToggleControl,{label:(0,l.__)("Show Numbering","aawp"),key:"aawp-show-numbering-toggle-control",checked:$,onChange:e=>ne({numbering:e}),help:(0,l.__)("Shows the numbering col when using table template for unordered lists.","aawp")}),ea=(0,a.createElement)(o.TextControl,{label:(0,l.__)("Custom CSS Class","aawp"),key:"aawp-class-text-control",value:J,onChange:e=>ne({class_attr:e}),help:(0,l.__)("Adding a new class to the product container.","aawp")}),aa=(0,a.createElement)(o.TextControl,{label:(0,l.__)("Tracking ID","aawp"),key:"aawp-tracking-id-text-control",value:ee,onChange:e=>ne({tracking_id:e}),help:(0,l.__)("Replacing the tracking id which will be used for affiliate links.","aawp")});switch(t){case"box":_e=fe=Me=ze=je=Pe=Be=[];break;case"bestseller":case"new":ve=xe=Ee=fe=Me=Se=Ae=Le=Ie=ze=je=Pe=Be=qe=[];break;case"fields":_e=we=ce=ue=be=ge=de=me=he=ke=ye=fe=Me=Re=Ye=Xe=Ke=Je=$e=ea=[];break;case"link":_e=we=ce=ue=be=ge=de=me=he=ke=ye=qe=Xe=Ke=Je=$e=ea=[]}("bestseller"===t||"new"===t||"box"===t&&i.includes(","))&&(pe=[...pe,(0,a.createElement)(o.PanelBody,{key:"lists",title:(0,l.__)("Lists","aawp"),initialOpen:!1},"box"!==t?_e:"",ke,!0===h?ye:"",Ye)],pe=[...pe,(0,a.createElement)(o.PanelBody,{key:"order-products",title:(0,l.__)("Order Products","aawp"),initialOpen:!1},[ce,we,ue])],pe=[...pe,(0,a.createElement)(o.PanelBody,{key:"filter-products",title:(0,l.__)("Filter Products","aawp"),initialOpen:!1},[be,ge,de,me,he])]),("fields"!==t||"fields"===t&&"title"===ae)&&(pe=[...pe,(0,a.createElement)(o.PanelBody,{key:"title",title:(0,l.__)("Title","aawp"),initialOpen:!1},i.includes(",")?"":ve,Ce)]),"fields"!==t?pe=[...pe,(0,a.createElement)(o.PanelBody,{key:"links",title:(0,l.__)("Links","aawp"),initialOpen:!1},i.includes(",")?"":[xe,Ee],[Te,fe,Me])]:["title","thumb","star_rating","price","button"].includes(ae)&&(pe=[...pe,(0,a.createElement)(o.PanelBody,{key:"links",title:(0,l.__)("Links","aawp"),initialOpen:!1},["button","thumb"].includes(ae)?"":(0,a.createElement)(o.ToggleControl,{label:(0,l.__)("Apply a link to the output","aawp"),key:"aawp-apply-link-toggle-control",checked:te,onChange:e=>ne({apply_link:e})}),!0===te||["button","thumb"].includes(ae)?[xe,Ee,Te]:"")]),"link"!==t&&(("fields"!==t||"fields"===t&&"description"===ae)&&(pe=[...pe,(0,a.createElement)(o.PanelBody,{key:"description",title:(0,l.__)("Description","aawp"),initialOpen:!1},i.includes(",")?"":Se,[Ne,De])]),("fields"!==t||"fields"===t&&"thumb"===ae)&&(i.includes(",")&&(Ae=Ie=Le=ze=je=Pe=Be=[]),pe=[...pe,(0,a.createElement)(o.PanelBody,{key:"images",title:(0,l.__)("Thumbnail","aawp"),initialOpen:!1},[Ae,Oe,Ie,Le,ze,je,Pe,Be])]),("fields"!==t||"fields"===t&&"button"===ae)&&(pe=[...pe,(0,a.createElement)(o.PanelBody,{key:"button",title:(0,l.__)("Amazon Button","aawp"),initialOpen:!1},Re,!0===B?Qe:"")]),i.includes(",")||"bestseller"===t||"new"===t||("fields"!==t&&(pe=[...pe,(0,a.createElement)(o.PanelBody,{key:"extra-detail",title:(0,l.__)("Extra Button","aawp"),initialOpen:!1},[Ue,Fe,He,We,Ze])]),("fields"!==t||"fields"===t&&"price"===ae)&&(pe=[...pe,(0,a.createElement)(o.PanelBody,{key:"pricing",title:(0,l.__)("Price","aawp"),initialOpen:!1},Ge,Ye)]))),("fields"!==t||"fields"===t&&"star_rating"===ae)&&(pe=[...pe,(0,a.createElement)(o.PanelBody,{key:"star-ratings",title:(0,l.__)("Rating","aawp"),initialOpen:!1},Xe,!0!==q||i.includes(",")?"":qe,Ke)]),"fields"!==t&&(pe=[...pe,(0,a.createElement)(o.PanelBody,{key:"templates-and-styles",title:(0,l.__)("Templates & Styles","aawp"),initialOpen:!1},Ve,i.includes(",")||"bestseller"===t||"new"===t?Je:"","table"===K?$e:"",ea)]);let ta=(0,a.createElement)(o.PanelBody,{key:"other",title:(0,l.__)("Other","aawp"),initialOpen:!1},aa);return pe=[...pe,ta],"table"===t&&(pe=ta),oe=[(0,a.createElement)(n.InspectorControls,{key:"aawp-look-selector-inspector-controls"},(0,a.createElement)(o.PanelBody,{title:(0,l.__)("General Settings","aawp")},(0,a.createElement)(o.SelectControl,{label:(0,l.__)("Select A Display Type","aawp"),value:t,options:[{value:"",label:(0,l.__)("-- Select A Display Type --","aawp")},{value:"box",label:(0,l.__)("Product Boxes","aawp")},{value:"bestseller",label:(0,l.__)("Bestseller (Lists)","aawp")},{value:"new",label:(0,l.__)("New Releases (Lists)","aawp")},{value:"fields",label:(0,l.__)("Fields (Single product data)","aawp")},{value:"link",label:(0,l.__)("Text Links","aawp")},{value:"table",label:(0,l.__)("Comparison Table","aawp")}],onChange:e=>ne({look:e})}),"fields"!==t?ie:[ie,re]),""===t?[]:pe)],t&&(i||p||le)?oe.push((0,a.createElement)(r(),{key:"aawp-server-side-renderer",block:"aawp/aawp-block",attributes:e.attributes})):oe.push((0,a.createElement)(o.Placeholder,{key:"aawp-look-selector-wrap",className:"aawp-look-selector-wrap"},(0,a.createElement)("img",{src:aawp_data.icons.logo}),(0,a.createElement)("p",{className:"block-selector-text"},(0,l.__)("Choose your display variant:","aawp")),(0,a.createElement)(o.RadioControl,{key:"aawp-look-selector-radio-control",className:"aawp-look-selector-radio-control",selected:t,options:[{value:"box",label:[(0,a.createElement)("img",{key:"aawp-look-selector-box-image",src:aawp_data.icons.box,alt:"Product Boxes"}),(0,a.createElement)("p",{key:"aawp-look-selector-box-label"}," ",(0,l.__)("Product Boxes","aawp")," ")]},{value:"bestseller",label:[(0,a.createElement)("img",{src:aawp_data.icons.bestseller,key:"aawp-look-selector-bestseller-image",alt:"Bestseller (Lists)"}),(0,a.createElement)("p",{key:"aawp-look-selector-bestseller-label"}," ",(0,l.__)("Bestseller Lists","aawp")," ")]},{value:"new",label:[(0,a.createElement)("img",{src:aawp_data.icons.new,key:"aawp-look-selector-new-image",alt:"New Releases (Lists)"}),(0,a.createElement)("p",{key:"aawp-look-selector-new-label"}," ",(0,l.__)("New Releases","aawp")," ")]},{value:"fields",label:[(0,a.createElement)("img",{src:aawp_data.icons.fields,key:"aawp-look-selector-fields-image",alt:"Fields (Single product data)"}),(0,a.createElement)("p",{key:"aawp-look-selector-fields-label"}," ",(0,l.__)("Data Fields","aawp")," ")]},{value:"link",label:[(0,a.createElement)("img",{src:aawp_data.icons.link,key:"aawp-look-selector-links-image",alt:"Text Links"}),(0,a.createElement)("p",{key:"aawp-look-selector-links-label"}," ",(0,l.__)("Text Links","aawp")," ")]},{value:"table",label:[(0,a.createElement)("img",{src:aawp_data.icons.table,key:"aawp-look-selector-table-image",alt:"Table"}),(0,a.createElement)("p",{key:"aawp-look-selector-table-label"}," ",(0,l.__)("Comparison Tables","aawp")," ")]}],onChange:e=>{ne({look:e}),wp.data.select("core/edit-post").isEditorSidebarOpened()||wp.data.dispatch("core/edit-post").openGeneralSidebar("edit-post/document")}}))),(0,a.createElement)("div",(0,n.useBlockProps)(),oe)},save:function(){return null}})}();