HEX
Server: Apache/2.4.65 (Debian)
System: Linux 88f31f35b0b8 6.1.0-38-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.147-1 (2025-08-02) x86_64
User: www-data (33)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: /var/www/html/wp-content/plugins/feedzy-rss-feeds/build/loop/index.js
(()=>{var e,t={282:(e,t,a)=>{"use strict";const r=window.React,n=window.wp.i18n,l=window.wp.blocks,s=window.wp.blockEditor,o=window.wp.components,i=window.wp.compose,d=window.wp.data,c=window.wp.hooks,u=window.feedzyData.defaultImage,f=(0,i.createHigherOrderComponent)((e=>t=>{if("core/image"!==t.name)return(0,r.createElement)(e,{...t});const a=(0,d.useSelect)((e=>e(s.store).getBlockParentsByBlockName(t.clientId,"feedzy-rss-feeds/loop").length>0));return(0,r.createElement)(r.Fragment,null,(0,r.createElement)(e,{...t}),a&&(0,r.createElement)(s.BlockControls,null,(0,r.createElement)(o.ToolbarGroup,null,(0,r.createElement)(o.ToolbarButton,{onClick:()=>{t.setAttributes({url:u})}},(0,n.__)("Use as Feed Image","feedzy-rss-feeds")))))}),"withMasonryExtension");(0,c.addFilter)("editor.BlockEdit","feedzy-loop/image",f);const m=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"feedzy-rss-feeds/loop","version":"1.0.0","title":"Feedzy Loop","category":"common","icon":"rss","keywords":["rss","feed","feedzy"],"description":"Display curated RSS content in a dynamic, customizable loop directly in the Block Editor—no coding required.","attributes":{"feed":{"type":"object","properties":{"type":{"type":"string","enum":["url","group"],"default":"url"},"source":{"type":["number","array"],"default":""}}},"query":{"type":"object","properties":{"max":{"type":"number","default":5},"sort":{"type":"string","enum":["default","date_desc","date_asc","title_desc","title_asc"],"default":"default"},"refresh":{"type":"string","enum":["1_hours","3_hours","12_hours","1_days","3_days","15_days"],"default":"12_hours"}}},"layout":{"type":"object","properties":{"columnCount":{"type":"number","default":1}}},"thumb":{"type":"string","default":"auto"},"fallbackImage":{"type":"object"},"conditions":{"type":"object","properties":{"match":{"type":"string","enum":["all","any"],"default":"all"},"conditions":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string","default":"title"},"operator":{"type":"string","default":"contains"},"value":{"type":"string","default":""}}}}}},"innerBlocksContent":{"type":"string","default":""},"referral_url":{"type":"string","default":""}},"supports":{"align":["wide","full"],"anchor":true,"ariaLabel":true,"html":true,"color":{"gradients":true,"heading":true,"button":true,"link":true},"shadow":true,"spacing":{"margin":["top","bottom"],"padding":true,"blockGap":true},"dimensions":{"minHeight":true},"typography":{"fontSize":true,"lineHeight":true}},"editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css","textdomain":"feedzy-rss-feeds"}'),p=[{name:"feedzy-default",title:(0,n.__)("Default","feedzy-rss-feeds"),description:(0,n.__)("Display curated RSS content in a dynamic, customizable loop directly in the Block Editor—no coding required.","feedzy-rss-feeds"),icon:()=>(0,r.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 200 100",width:"100",height:"50"},(0,r.createElement)(o.Rect,{width:"200",height:"100",fill:"#F3F4F6"}),(0,r.createElement)(o.Rect,{x:"10",y:"10",width:"180",height:"45",fill:"#D1D5DB"}),(0,r.createElement)(o.Path,{d:"M95 25 L85 35 L105 35 Z",fill:"#9CA3AF"}),(0,r.createElement)(o.Circle,{cx:"110",cy:"28",r:"4",fill:"#9CA3AF"}),(0,r.createElement)(o.Rect,{x:"10",y:"65",width:"140",height:"6",rx:"2",fill:"#4B5563"}),(0,r.createElement)(o.Rect,{x:"10",y:"77",width:"180",height:"4",rx:"1",fill:"#9CA3AF"}),(0,r.createElement)(o.Rect,{x:"10",y:"85",width:"160",height:"4",rx:"1",fill:"#9CA3AF"})),isDefault:!0,innerBlocks:[["core/group",{layout:{type:"constrained"},style:{spacing:{padding:{top:"var:preset|spacing|30",bottom:"var:preset|spacing|30",left:"var:preset|spacing|30",right:"var:preset|spacing|30"},margin:{top:"var:preset|spacing|30",bottom:"var:preset|spacing|30"}}}},[["core/image",{url:window.feedzyData.defaultImage,alt:"{{feedzy_title}}",href:"{{feedzy_url}}"}],["core/paragraph",{content:'<a href="{{feedzy_url}}">{{feedzy_title}}</a>'}],["core/paragraph",{content:"{{feedzy_meta}}",fontSize:"medium"}],["core/paragraph",{content:"{{feedzy_description}}",fontSize:"small"}]]]],scope:["block"]},{name:"feedzy-round",title:(0,n.__)("Round","feedzy-rss-feeds"),description:(0,n.__)("Display the feed items in a round style.","feedzy-rss-feeds"),icon:()=>(0,r.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 200 100",width:"100",height:"50"},(0,r.createElement)(o.Rect,{width:"200",height:"100",fill:"#F3F4F6"}),(0,r.createElement)(o.Circle,{cx:"35",cy:"25",r:"15",fill:"#D1D5DB"}),(0,r.createElement)(o.Rect,{x:"10",y:"45",width:"50",height:"6",rx:"2",fill:"#4B5563"}),(0,r.createElement)(o.Rect,{x:"10",y:"55",width:"50",height:"4",rx:"1",fill:"#9CA3AF"}),(0,r.createElement)(o.Rect,{x:"10",y:"63",width:"45",height:"4",rx:"1",fill:"#9CA3AF"}),(0,r.createElement)(o.Rect,{x:"10",y:"71",width:"48",height:"4",rx:"1",fill:"#9CA3AF"}),(0,r.createElement)(o.Rect,{x:"10",y:"79",width:"42",height:"4",rx:"1",fill:"#9CA3AF"}),(0,r.createElement)(o.Circle,{cx:"100",cy:"25",r:"15",fill:"#D1D5DB"}),(0,r.createElement)(o.Rect,{x:"75",y:"45",width:"50",height:"6",rx:"2",fill:"#4B5563"}),(0,r.createElement)(o.Rect,{x:"75",y:"55",width:"50",height:"4",rx:"1",fill:"#9CA3AF"}),(0,r.createElement)(o.Rect,{x:"75",y:"63",width:"45",height:"4",rx:"1",fill:"#9CA3AF"}),(0,r.createElement)(o.Rect,{x:"75",y:"71",width:"48",height:"4",rx:"1",fill:"#9CA3AF"}),(0,r.createElement)(o.Rect,{x:"75",y:"79",width:"42",height:"4",rx:"1",fill:"#9CA3AF"}),(0,r.createElement)(o.Circle,{cx:"165",cy:"25",r:"15",fill:"#D1D5DB"}),(0,r.createElement)(o.Rect,{x:"140",y:"45",width:"50",height:"6",rx:"2",fill:"#4B5563"}),(0,r.createElement)(o.Rect,{x:"140",y:"55",width:"50",height:"4",rx:"1",fill:"#9CA3AF"}),(0,r.createElement)(o.Rect,{x:"140",y:"63",width:"45",height:"4",rx:"1",fill:"#9CA3AF"}),(0,r.createElement)(o.Rect,{x:"140",y:"71",width:"48",height:"4",rx:"1",fill:"#9CA3AF"}),(0,r.createElement)(o.Rect,{x:"140",y:"79",width:"42",height:"4",rx:"1",fill:"#9CA3AF"})),attributes:{layout:{columnCount:3}},isDefault:!1,innerBlocks:[["core/group",{layout:{type:"constrained"},style:{spacing:{padding:{top:"var:preset|spacing|30",bottom:"var:preset|spacing|30",left:"var:preset|spacing|30",right:"var:preset|spacing|30"},margin:{top:"var:preset|spacing|30",bottom:"var:preset|spacing|30"}}}},[["core/image",{url:window.feedzyData.defaultImage,alt:"{{feedzy_title}}",href:"{{feedzy_url}}",width:"150px",height:"150px",scale:"cover",align:"center",className:"is-style-rounded"}],["core/paragraph",{content:'<a href="{{feedzy_url}}">{{feedzy_title}}</a>'}],["core/paragraph",{content:"{{feedzy_meta}}",fontSize:"medium"}],["core/paragraph",{content:"{{feedzy_description}}",fontSize:"small"}]]]],scope:["block"]},{name:"feedzy-card",title:(0,n.__)("Card","feedzy-rss-feeds"),description:(0,n.__)("Display the feed items in a card style.","feedzy-rss-feeds"),icon:()=>(0,r.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 200 100",width:"100",height:"50"},(0,r.createElement)(o.Rect,{width:"200",height:"100",fill:"#F3F4F6"}),(0,r.createElement)(o.Rect,{x:"5",y:"5",width:"60",height:"90",rx:"3",fill:"white",stroke:"#E5E7EB"}),(0,r.createElement)(o.Rect,{x:"10",y:"10",width:"50",height:"50",fill:"#D1D5DB"}),(0,r.createElement)(o.Rect,{x:"10",y:"65",width:"50",height:"6",rx:"2",fill:"#4B5563"}),(0,r.createElement)(o.Rect,{x:"10",y:"75",width:"50",height:"4",rx:"1",fill:"#9CA3AF"}),(0,r.createElement)(o.Rect,{x:"10",y:"83",width:"45",height:"4",rx:"1",fill:"#9CA3AF"}),(0,r.createElement)(o.Rect,{x:"70",y:"5",width:"60",height:"90",rx:"3",fill:"white",stroke:"#E5E7EB"}),(0,r.createElement)(o.Rect,{x:"75",y:"10",width:"50",height:"50",fill:"#D1D5DB"}),(0,r.createElement)(o.Rect,{x:"75",y:"65",width:"50",height:"6",rx:"2",fill:"#4B5563"}),(0,r.createElement)(o.Rect,{x:"75",y:"75",width:"50",height:"4",rx:"1",fill:"#9CA3AF"}),(0,r.createElement)(o.Rect,{x:"75",y:"83",width:"45",height:"4",rx:"1",fill:"#9CA3AF"}),(0,r.createElement)(o.Rect,{x:"135",y:"5",width:"60",height:"90",rx:"3",fill:"white",stroke:"#E5E7EB"}),(0,r.createElement)(o.Rect,{x:"140",y:"10",width:"50",height:"50",fill:"#D1D5DB"}),(0,r.createElement)(o.Rect,{x:"140",y:"65",width:"50",height:"6",rx:"2",fill:"#4B5563"}),(0,r.createElement)(o.Rect,{x:"140",y:"75",width:"50",height:"4",rx:"1",fill:"#9CA3AF"}),(0,r.createElement)(o.Rect,{x:"140",y:"83",width:"45",height:"4",rx:"1",fill:"#9CA3AF"})),attributes:{layout:{columnCount:3}},isDefault:!1,innerBlocks:[["core/group",{layout:{type:"constrained"},style:{spacing:{margin:{top:"var:preset|spacing|30",bottom:"var:preset|spacing|30"}},border:{color:"#e3edeb",width:"1px",radius:"5px"}}},[["core/group",{layout:{type:"constrained"},style:{spacing:{padding:{top:"var:preset|spacing|30",bottom:"var:preset|spacing|30",left:"var:preset|spacing|30",right:"var:preset|spacing|30"}}}},[["core/image",{url:window.feedzyData.defaultImage,alt:"{{feedzy_title}}",href:"{{feedzy_url}}"}],["core/paragraph",{content:'<strong><a href="{{feedzy_url}}">{{feedzy_title}}</a></strong>'}]]],["core/group",{layout:{type:"constrained"},style:{spacing:{padding:{top:"var:preset|spacing|30",bottom:"var:preset|spacing|30",left:"var:preset|spacing|30",right:"var:preset|spacing|30"}},color:{background:"#f1f5f4"},border:{color:"#e3edeb",width:"1px",radius:"5px"}}},[["core/paragraph",{content:"{{feedzy_meta}}",fontSize:"medium"}]]],["core/group",{layout:{type:"constrained"},style:{spacing:{padding:{top:"var:preset|spacing|30",bottom:"var:preset|spacing|30",left:"var:preset|spacing|30",right:"var:preset|spacing|30"}}}},[["core/paragraph",{content:"{{feedzy_description}}",fontSize:"small"}]]]]]],scope:["block"]}],y=window.wp.element,g=window.wp.serverSideRender;var h=a.n(g);const _=window.wp.coreData,E=({value:e,options:t,onChange:a})=>{const[l,s]=(0,y.useState)(!1),[o,i]=(0,y.useState)(""),[d,c]=(0,y.useState)(null),u=(0,y.useRef)(null);return(0,y.useEffect)((()=>{if("group"===e?.type&&e.source){const a=t.find((t=>t.value===e.source));c(a||null),i("")}else"url"===e?.type&&Array.isArray(e.source)&&(c(null),i(e.source.join(", ")))}),[e,t]),(0,y.useEffect)((()=>{const e=e=>{u.current&&!u.current.contains(e.target)&&s(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)}),[]),(0,r.createElement)("div",{className:"fz-url-category-input",ref:u},(0,r.createElement)("input",{type:"text",value:d?d.label:o,onChange:e=>{const t=e.target.value;i(t),c(null)},onBlur:()=>{a({type:"url",source:o?o.split(",").map((e=>e.trim())).filter(Boolean):[]})},placeholder:(0,n.__)("Enter URLs or select a Feed Group","feedzy-rss-feeds"),disabled:null!==d,className:"fz-input-field"}),(0,r.createElement)("div",{className:"fz-buttons-container"},d&&(0,r.createElement)("button",{onClick:()=>{c(null),i(""),a({type:"url",source:[]})},className:"fz-clear-button",title:(0,n.__)("Clear","feedzy-rss-feeds")},(0,r.createElement)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,r.createElement)("path",{d:"M18 6L6 18M6 6l12 12",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}))),(0,r.createElement)("button",{onClick:()=>s(!l),className:"fz-dropdown-button",title:(0,n.__)("Select Feed Group","feedzy-rss-feeds")},(0,r.createElement)("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{transform:l?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s"}},(0,r.createElement)("path",{d:"M2 4L6 8L10 4",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})))),l&&(0,r.createElement)("div",{className:"fz-dropdown-menu"},t.map((e=>(0,r.createElement)("button",{key:e.value,onClick:()=>(e=>{c(e),i(""),s(!1),a({type:"group",source:e.value})})(e),className:"fz-dropdown-item "+(d?.value===e.value?"fz-selected":"")},e.label)))))},v=({attributes:e,setAttributes:t,onSaveFeed:a})=>{const[l,s]=(0,y.useState)(!1),[i,c]=(0,y.useState)([]),{categories:u,isLoading:f}=(0,d.useSelect)((e=>{var t;const{getEntityRecords:a,isResolving:r}=e(_.store);return{categories:null!==(t=a("postType","feedzy_categories"))&&void 0!==t?t:[],isLoading:r("getEntityRecords",["postType","feedzy_categories"])}}),[]);return(0,r.createElement)(o.Placeholder,{key:"placeholder",icon:"rss",label:(0,n.__)("Feedzy RSS Feeds","feedzy-rss-feeds")},(f||l)&&(0,r.createElement)("div",{key:"loading",className:"wp-block-embed is-loading"},(0,r.createElement)(o.Spinner,null),(0,r.createElement)("p",null,l?(0,n.__)("Validating and fetching feed…","feedzy-rss-feeds"):(0,n.__)("Loading…","feedzy-rss-feeds"))),!f&&!l&&(0,r.createElement)(r.Fragment,null,(0,r.createElement)(o.BaseControl,{label:(0,n.__)("Feed Source","feedzy-rss-feeds"),id:"feed-source-control"},(0,r.createElement)(E,{value:e?.feed,options:[...u.map((e=>({label:e?.title?.rendered,value:e.id})))],onChange:e=>{t({feed:e})}}),i&&0!==i.length?(0,r.createElement)("div",{className:"feedzy-validation-results",style:{display:"flex",flexDirection:"column",gap:"10px",marginTop:"15px"}},i.map(((e,t)=>(0,r.createElement)(o.Notice,{key:`result-${t}`,status:e.status,isDismissible:!1},e.url&&(0,r.createElement)(r.Fragment,null,(0,r.createElement)("strong",null,e.url),(0,r.createElement)("br",null)),e.message)))):null,(0,r.createElement)("p",null,(0,y.createInterpolateElement)((0,n.__)("Enter the full URL of the feed source you wish to display here, or select a Feed Group. Also you can add multiple URLs separated with a comma. You can manage your feed groups from <a>here</a>.","feedzy-rss-feeds"),{a:(0,r.createElement)("a",{href:"edit.php?post_type=feedzy_categories",title:(0,n.__)("Feedzy Groups","feedzy-rss-feeds"),target:"_blank"})}))),(0,r.createElement)("div",null,(0,r.createElement)(o.Button,{variant:"primary",onClick:()=>(async()=>{if(e?.feed?.source){if(s(!0),c([]),u.some((t=>t.id===e.feed.source))&&"group"===e.feed.type)return a(),void s(!1);try{const t=new FormData;t.append("action","feedzy_validate_feed"),t.append("feed_url",e.feed.source),t.append("nonce",window.feedzyData?.nonce);const r=await fetch(window.feedzyData?.url,{method:"POST",body:t}),l=await r.json();if(l.success&&l.data?.results){const e=l.data.results;c(e),e.some((e=>"error"===e.status))||a()}else l.success||c([{status:"error",message:l.data?.message||(0,n.__)("Validation failed","feedzy-rss-feeds")}])}catch(e){c([{status:"error",message:(0,n.__)("Failed to validate feed. Please check your connection and try again.","feedzy-rss-feeds")}])}finally{s(!1)}}})()},(0,n.__)("Load Feed","feedzy-rss-feeds")))))};var w=a(485),b=a.n(w);const z=(0,y.forwardRef)((function({icon:e,size:t=24,...a},r){return(0,y.cloneElement)(e,{width:t,height:t,...a,ref:r})})),k=window.wp.primitives,x=(0,r.createElement)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(k.Path,{d:"M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z"})),C=({label:e,onDelete:t,initialOpen:a=!1,children:l})=>{const[s,i]=(0,y.useState)(a);return(0,r.createElement)("div",{className:"fz-panel-tab"},(0,r.createElement)("div",{className:"fz-panel-tab__header"},(0,r.createElement)("div",{className:"fz-panel-tab__header__label",onClick:()=>i(!s)},e),(0,r.createElement)(o.Button,{icon:s?"arrow-up-alt2":"arrow-down-alt2",label:s?(0,n.__)("Close Settings","feedzy-rss-feeds"):(0,n.__)("Open Settings","feedzy-rss-feeds"),showTooltip:!0,onClick:()=>i(!s)}),(0,r.createElement)(o.Button,{icon:"no-alt",label:(0,n.__)("Delete","feedzy-rss-feeds"),showTooltip:!0,onClick:t})),s&&(0,r.createElement)("div",{className:"fz-panel-tab__content"},l))},B=window.wp.date,F=({index:e,label:t,value:a,onChange:l})=>{const s=(0,B.__experimentalGetSettings)();return(0,r.createElement)(o.BaseControl,{label:t,id:`date-time-control-${e}`},(0,r.createElement)(o.Dropdown,{position:"bottom left",renderToggle:({onToggle:e,isOpen:t})=>(0,r.createElement)(r.Fragment,null,(0,r.createElement)(o.Button,{onClick:e,variant:"secondary","aria-expanded":t},a?(0,B.format)(s.formats.datetime,a):(0,n.__)("Select Date","feedzy-rss-feeds"))),renderContent:()=>(0,r.createElement)(o.DateTimePicker,{currentDate:a,onChange:l})}))},S=window.feedzyData.isPro,D=[{label:(0,n.__)("Title","feedzy-rss-feeds"),value:"title"},{label:(0,n.__)("Description","feedzy-rss-feeds"),value:"description",disabled:!S},{label:(0,n.__)("Full Content","feedzy-rss-feeds"),value:"fullcontent",disabled:!S},{label:(0,n.__)("Author","feedzy-rss-feeds"),value:"author",unsupportedOperators:["greater_than","gte","less_than","lte"],disabled:!S},{label:(0,n.__)("Date","feedzy-rss-feeds"),value:"date",unsupportedOperators:["has_value","equals","not_equals","empty","contains","not_contains"],disabled:!S},{label:(0,n.__)("Featured Image","feedzy-rss-feeds"),value:"featured_image",unsupportedOperators:["greater_than","gte","less_than","lte"],disabled:!S},{label:(0,n.__)("Link","feedzy-rss-feeds"),value:"link",unsupportedOperators:["greater_than","gte","less_than","lte"],disabled:!S}],R=({conditions:e,setConditions:t})=>{const[a,l]=(0,y.useState)(!1),s=document.querySelector(".editor-sidebar__panel-tabs"),i=(a,r,n)=>{const l=[...e.conditions];if(l[a][n]=r,"field"===n){const e=D.find((e=>e.value===r));e.unsupportedOperators?.includes(l[a].operator)&&(l[a].operator=Object.keys(window?.feedzyConditionsData?.operators).filter((t=>!e.unsupportedOperators?.includes(t)))[0]),l[a].value=""}t({...e,conditions:l})};return(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",{className:"fz-condition-control"},(0,r.createElement)(o.SelectControl,{label:(0,n.__)("Include If","feedzy-rss-feeds"),value:e.match,options:[{label:(0,n.__)("All conditions are met","feedzy-rss-feeds"),value:"all"},{label:(0,n.__)("Any condition is met","feedzy-rss-feeds"),value:"any"}],onChange:a=>{t({...e,match:a})}}),e.conditions.map(((a,l)=>{const s=D.find((e=>e.value===a.field)),d=Object.keys(window?.feedzyConditionsData?.operators).filter((e=>!s?.unsupportedOperators?.includes(e))),c=D.map((e=>({label:`${e.label}${e.disabled?" (PRO)":""}`,value:e.value,disabled:e.disabled})));return(0,r.createElement)(C,{key:l,label:`${s?.label} ${window.feedzyConditionsData.operators[a.operator]} ${a?.value||""}`,onDelete:()=>(a=>{const r=[...e.conditions];r.splice(a,1),t({...e,conditions:r})})(l),initialOpen:0===l},(0,r.createElement)(o.SelectControl,{label:(0,n.__)("Field","feedzy-rss-feeds"),value:a?.field,options:c,onChange:e=>i(l,e,"field")}),(0,r.createElement)(o.SelectControl,{label:(0,n.__)("Compare Operator","feedzy-rss-feeds"),options:d.map((e=>({label:window.feedzyConditionsData.operators[e],value:e}))),help:["contains","not_contains"].includes(a?.operator)?(0,n.__)("You can use comma(,) and plus(+) keyword.","feedzy-rss-feeds"):"",value:a?.operator,onChange:e=>i(l,e,"operator")}),!["has_value","empty"].includes(a?.operator)&&(0,r.createElement)(r.Fragment,null,"date"===a?.field?(0,r.createElement)(F,{id:l,label:(0,n.__)("Value","feedzy-rss-feeds"),value:a?.value,onChange:e=>i(l,e,"value")}):(0,r.createElement)(o.TextControl,{label:(0,n.__)("Value","feedzy-rss-feeds"),value:a?.value,onChange:e=>i(l,e,"value")})))})),(0,r.createElement)("div",{className:b()("fz-action-btn mt-24",{"is-upsell":!S&&1<=e.conditions.length})},(0,r.createElement)(o.Button,{variant:"secondary",onClick:()=>{if(!S&&1<=e.conditions.length)return s&&(s.style.zIndex=0),void l(!0);const a=[...e.conditions];a.push({field:D[0].value,operator:"contains"}),t({...e,conditions:a})},className:"fz-new-action"},(0,n.__)("Add Condition","feedzy-rss-feeds")," ",(0,r.createElement)(z,{icon:x})))),a&&(0,r.createElement)("div",{id:"feedzy-add-filter-condition",className:"wp-core-ui feedzy-modal"},(0,r.createElement)("div",{className:"modal-content"},(0,r.createElement)("button",{className:"fz-notice close-modal",onClick:()=>{s&&(s.style.zIndex=0),l(!1)}},(0,r.createElement)("span",{className:"dashicons dashicons-no-alt"}),(0,r.createElement)("span",{className:"screen-reader-text"},(0,n.__)("Dismiss this dialog","feedzy-rss-feeds"))),(0,r.createElement)("div",{className:"modal-header"},(0,r.createElement)("h2",null,(0,n.__)("Upgrade to Use Unlimited Conditions","feedzy-rss-feeds")),(0,r.createElement)("p",{style:{color:"red"}},(0,n.__)("Filter Condition limit reached","feedzy-rss-feeds"),(0,r.createElement)("span",null,"("+(0,n.sprintf)(
// translators: %1$s is the number of imports used, %2$s is the total number of imports allowed.
// translators: %1$s is the number of imports used, %2$s is the total number of imports allowed.
(0,n.__)("%1$s/%2$s used","feedzy-rss-feeds"),"1","1")+")"))),(0,r.createElement)("div",{className:"modal-body"},(0,r.createElement)("p",null,(0,n.__)("Your current plan supports only one filter condition. Upgrade to unlock unlimited import configurations and make the most of Feedzy's powerful features!","feedzy-rss-feeds"))),(0,r.createElement)("div",{className:"modal-footer"},(0,r.createElement)("div",{className:"button-container"},(0,r.createElement)("a",{href:"https://themeisle.com/plugins/feedzy-rss-feeds/upgrade/?utm_source=wpadmin&utm_medium=post&utm_campaign=filterCondition&utm_content=feedzy-rss-feeds",target:"_blank",rel:"noreferrer ",className:"button button-primary button-large"},(0,n.__)("Upgrade to PRO","feedzy-rss-feeds"))),(0,r.createElement)("span",null,(0,n.__)("30-day money-back guarantee. No questions asked.","feedzy-rss-feeds"))))))},A=function({imageValue:e,onChangeImage:t,onRemoveImage:a,label:l=(0,n.__)("Fallback image if no image is found.","feedzy-rss-feeds")}){const i=()=>{a()};return(0,r.createElement)("div",{className:"feedzy-blocks-base-control"},(0,r.createElement)("label",{className:"blocks-base-control__label",htmlFor:"inspector-media-upload"},l),(0,r.createElement)(s.MediaUpload,{type:"image",id:"inspector-media-upload",value:e,onSelect:e=>{const a={url:e.url,width:e.width,height:e.height,id:e.id};t(a)},render:({open:t})=>(0,r.createElement)(y.Fragment,null,void 0!==e&&(0,r.createElement)(o.ResponsiveWrapper,{naturalWidth:e.width,naturalHeight:e.height},(0,r.createElement)("img",{src:e.url,alt:(0,n.__)("Featured image","feedzy-rss-feeds")})),(0,r.createElement)(o.__experimentalHStack,null,void 0!==e&&(0,r.createElement)(o.Button,{isLarge:!0,isSecondary:!0,onClick:i,style:{marginTop:"10px"}},(0,n.__)("Remove Image","feedzy-rss-feeds")),(0,r.createElement)(o.Button,{isLarge:!0,isPrimary:!0,onClick:t,style:{marginTop:"10px"},className:void 0===e&&"feedzy_image_upload"},(0,n.__)("Upload Image","feedzy-rss-feeds"))))}))};function N(e){if("string"!=typeof e)return e;const t=document.createElement("textarea");return t.innerHTML=e,t.value}function I({attributes:e,isEditing:t,setIsEditing:a,onChangeLayout:l,onChangeQuery:s,setAttributes:i,variations:d,setVariations:c}){return(0,r.createElement)(y.Fragment,null,(0,r.createElement)(o.PanelBody,{title:(0,n.__)("Settings","feedzy-rss-feeds"),key:"settings"},(0,r.createElement)(o.BaseControl,{label:(0,n.__)("Layout","feedzy-rss-feeds"),id:"feedzy-loop-layout"},(0,r.createElement)("div",{className:"fz-block-variation-picker"},d?.map((e=>(0,r.createElement)(o.Button,{key:e.name,variant:"link",onClick:()=>c(e)},e.icon?.()))))),(0,r.createElement)(o.RangeControl,{label:(0,n.__)("Column Count","feedzy-rss-feeds"),value:e?.layout?.columnCount||1,onChange:e=>l({type:"columnCount",value:e}),min:1,max:5}),(0,r.createElement)(o.RangeControl,{label:(0,n.__)("Number of Items","feedzy-rss-feeds"),value:e?.query?.max||5,onChange:e=>s({type:"max",value:e}),min:1,max:20}),(0,r.createElement)(o.ExternalLink,{href:"https://docs.themeisle.com/article/2217-feedzy-loop#magic_tags",target:"_blank"},(0,n.__)("Feedzy Loop Documentation","feedzy-rss-feeds"))),!t&&(0,r.createElement)(o.PanelBody,{initialOpen:!1,title:(0,n.__)("Feed Source","feedzy-rss-feeds"),key:"source"},(0,r.createElement)(o.Button,{variant:"secondary",onClick:()=>a(!0),style:{width:"100%",justifyContent:"center"}},(0,n.__)("Edit Feed","feedzy-rss-feeds"))),(0,r.createElement)(o.PanelBody,{title:(0,n.__)("Item Image Options","feedzy-rss-feeds"),initialOpen:!1,className:"feedzy-image-options"},(0,r.createElement)(o.SelectControl,{label:(0,n.__)("Display first image if available?","feedzy-rss-feeds"),value:e.thumb,options:[{label:(0,n.__)("Yes (without a fallback image)","feedzy-rss-feeds"),value:"auto"},{label:(0,n.__)("Yes (with a fallback image)","feedzy-rss-feeds"),value:"yes"},{label:(0,n.__)("No","feedzy-rss-feeds"),value:"no"}],onChange:e=>i({thumb:e}),className:"feedzy-thumb"}),"no"!==e?.thumb&&(0,r.createElement)(y.Fragment,null,"auto"!==e?.thumb&&(0,r.createElement)(A,{imageValue:e?.fallbackImage,onChangeImage:e=>i({fallbackImage:e}),onRemoveImage:()=>i({fallbackImage:void 0}),label:(0,n.__)("Fallback image if no image is found.","feedzy-rss-feeds")}))),(0,r.createElement)(o.PanelBody,{title:[(0,n.__)("Filter items","feedzy-rss-feeds")],initialOpen:!1,key:"filters",className:"feedzy-item-filter"},!window.feedzyData?.isPro&&(0,r.createElement)("div",{className:"fz-upsell-notice"},(0,y.createInterpolateElement)((0,n.__)("Unlock more advanced options with <a>Feedzy Pro</a>","feedzy-rss-feeds"),{a:(0,r.createElement)(o.ExternalLink,{href:"https://themeisle.com/plugins/feedzy-rss-feeds/upgrade/?utm_source=wpadmin&utm_medium=blockeditor&utm_campaign=keywordsfilter&utm_content=feedzy-rss-feeds"})})),(0,r.createElement)(R,{conditions:window.feedzyData?.isPro?e?.conditions||{conditions:[],match:"all"}:e?.conditions||{match:"all",conditions:[{field:"title",operator:"contains",value:"Sports"}]},setConditions:e=>{i({conditions:e})}})),(0,r.createElement)(o.PanelBody,{title:[(0,n.__)("Referral URL","feedzy-rss-feeds"),!window.feedzyData?.isPro&&(0,r.createElement)("span",{className:"fz-pro-label"},"Pro")],initialOpen:!1,className:window.feedzyData?.isPro?"feedzy-pro-options":"feedzy-pro-options fz-locked"},!window.feedzyData?.isPro&&(0,r.createElement)("div",{className:"fz-upsell-notice"},(0,y.createInterpolateElement)((0,n.__)("Unlock this feature and more advanced options with <a>Feedzy Pro</a>","feedzy-rss-feeds"),{a:(0,r.createElement)(o.ExternalLink,{href:"https://themeisle.com/plugins/feedzy-rss-feeds/upgrade/?utm_source=wpadmin&utm_medium=blockeditor&utm_campaign=refferal&utm_content=feedzy-rss-feeds"})})),(0,r.createElement)(o.TextControl,{label:(0,n.__)("Referral URL parameters.","feedzy-rss-feeds"),help:(0,n.__)('Without ("?")',"feedzy-rss-feeds"),placeholder:N("("+(0,n.sprintf)(
// translators: %s is the list of examples.
// translators: %s is the list of examples.
(0,n.__)("eg: %s","feedzy-rss-feeds"),"promo_code=feedzy_is_awesome")+")"),value:e?.referral_url,onChange:e=>{window.tiTrk?.with?.("feedzy")?.add?.({feature:"block-referral-url"}),i({referral_url:e})}})))}function P({attributes:e,onChangeQuery:t}){return(0,r.createElement)(y.Fragment,null,(0,r.createElement)(o.SelectControl,{label:(0,n.__)("Sorting Order","feedzy-rss-feeds"),value:e?.query?.sort,options:[{label:(0,n.__)("Default","feedzy-rss-feeds"),value:"default"},{label:(0,n.__)("Date Descending","feedzy-rss-feeds"),value:"date_desc"},{label:(0,n.__)("Date Ascending","feedzy-rss-feeds"),value:"date_asc"},{label:(0,n.__)("Title Descending","feedzy-rss-feeds"),value:"title_desc"},{label:(0,n.__)("Title Ascending","feedzy-rss-feeds"),value:"title_asc"}],onChange:e=>t({type:"sort",value:e})}),(0,r.createElement)(o.SelectControl,{label:(0,n.__)("Feed Caching Time","feedzy-rss-feeds"),value:e?.query?.refresh||"12_hours",options:[{label:(0,n.__)("1 Hour","feedzy-rss-feeds"),value:"1_hours"},{label:(0,n.__)("2 Hours","feedzy-rss-feeds"),value:"3_hours"},{label:(0,n.__)("12 Hours","feedzy-rss-feeds"),value:"12_hours"},{label:(0,n.__)("1 Day","feedzy-rss-feeds"),value:"1_days"},{label:(0,n.__)("3 Days","feedzy-rss-feeds"),value:"3_days"},{label:(0,n.__)("15 Days","feedzy-rss-feeds"),value:"15_days"}],onChange:e=>t({type:"refresh",value:e})}))}const L=({attributes:e,isEditing:t,isPreviewing:a,setAttributes:l,onChangeLayout:i,onChangeQuery:d,setIsEditing:c,setIsPreviewing:u,variations:f,setVariations:m})=>(0,r.createElement)(y.Fragment,null,(0,r.createElement)(s.BlockControls,null,(0,r.createElement)(o.ToolbarGroup,null,(0,r.createElement)(o.ToolbarButton,{icon:"edit",title:(0,n.__)("Edit Feed","feedzy-rss-feeds"),onClick:()=>c(!0)})),(0,r.createElement)(o.ToolbarGroup,null,(0,r.createElement)(o.ToolbarButton,{onClick:()=>u(!a)},a?(0,n.__)("Hide Preview","feedzy-rss-feeds"):(0,n.__)("Show Preview","feedzy-rss-feeds")))),(0,r.createElement)(s.InspectorControls,{key:"inspector"},(0,r.createElement)("div",null,!t&&(0,r.createElement)(I,{attributes:e,isEditing:t,setIsEditing:c,onChangeLayout:i,onChangeQuery:d,setAttributes:l,variations:f,setVariations:m}))),(0,r.createElement)(s.InspectorControls,{group:"advanced"},(0,r.createElement)("div",null,!t&&(0,r.createElement)(P,{attributes:e,onChangeQuery:d})))),{name:O}=m,T=()=>(0,r.createElement)(o.Placeholder,null,(0,r.createElement)(o.Spinner,null)),V=window.wp.domReady;let j={},H=!1;const U=["feedzy-rss-feeds/loop","feedzy-rss-feeds/feedzy-block","core/rss"];function G(){const e=function e(t){let a=[];return t.forEach((t=>{a.push(t),t.innerBlocks?.length>0&&(a=a.concat(e(t.innerBlocks)))})),a}((0,d.select)(s.store).getBlocks()),t={};U.forEach((e=>{t[e]=0})),e.forEach((e=>{U.includes(e.name)&&t[e.name]++})),H?U.forEach((e=>{const a=j[e]||0,r=t[e]||0;if(a===r)return;const n=r-a;window?.tiTrk?.with("feedzy")?.set(`${e}:${Date()}`,{feature:"block-usage",featureComponent:e,featureValue:n})})):H=!0,j=t}a.n(V)()((()=>{window.tiTrk&&(window.tiTrk?.start(),window.tiTrk.eventsLimit=6e4),setTimeout((()=>{(0,d.subscribe)(G,s.store)}),1e3)}));const{name:$}=m;(0,l.registerBlockType)($,{...m,variations:p,transforms:{from:[{type:"block",blocks:["core/rss"],transform:e=>{const{feedURL:t}=e;return t?(0,l.createBlock)($,{feed:{type:"url",source:[t]}}):(0,l.createBlock)($)}},{type:"block",blocks:["feedzy-rss-feeds/feedzy-block"],transform:e=>{const{feeds:t}=e;return t?(0,l.createBlock)($,{feed:{type:"url",source:[t]}}):(0,l.createBlock)($)}}]},edit:({attributes:e,setAttributes:t,clientId:a})=>{const i=(0,s.useBlockProps)(),[c,u]=(0,y.useState)(!e?.feed?.source),[f,m]=(0,y.useState)(!0),[p,g]=(0,y.useState)(!1),{clearSelectedBlock:_,replaceInnerBlocks:E}=(0,d.useDispatch)(s.store),w=(0,d.useSelect)((e=>{const{isBlockSelected:t,hasSelectedInnerBlock:r}=e(s.store);return t(a)||r(a,!0)}),[a]),b=(0,d.useSelect)((e=>{var t;const{getBlock:r}=e(s.store),n=r(a);return null!==(t=(0,l.serialize)(n?.innerBlocks))&&void 0!==t?t:""}),[a]),z=(0,d.useSelect)((e=>0<e(s.store).getBlocks(a).length),[a]),k=(0,d.useSelect)((e=>{const{getBlockVariations:t}=e(l.store);return t(O,"block")}),[]),x=(0,d.useSelect)((e=>{const{getDefaultBlockVariation:t}=e(l.store);return t(O,"block")}),[]);(0,y.useEffect)((()=>{localStorage.getItem("feedzy-hide-preview-notice")||g(!0)}),[]);const C=(e=x)=>{e&&(t({layout:{name:e.name},...e.attributes}),E(a,(0,l.createBlocksFromInnerBlocksTemplate)(e.innerBlocks),!0),_())};let B;return B=c?(0,r.createElement)(v,{attributes:e,setAttributes:t,onSaveFeed:()=>{u(!1)}}):w&&!f||!b?z||c?(0,r.createElement)(s.InnerBlocks,null):(0,r.createElement)(s.__experimentalBlockVariationPicker,{variations:k,onSelect:C}):(0,r.createElement)(y.Fragment,null,p&&(0,r.createElement)(o.Notice,{status:"info",isDismissible:!0,onRemove:()=>{g(!1),localStorage.setItem("feedzy-hide-preview-notice","true")}},(0,r.createElement)("p",null,(0,r.createElement)("strong",null,(0,n.__)("You're in Preview Mode – This shows how your feed will look to visitors.","feedzy-rss-feeds"))),(0,r.createElement)("p",null,(0,n.sprintf)(
// translators: %1$s is button label "Hide Preview".
// translators: %1$s is button label "Hide Preview".
(0,n.__)('To customize each element (title, meta, description) and adjust layouts, spacing, colors, and typography, click "%1$s" in the toolbar above to enter the advanced editor.',"feedzy-rss-feeds"),(0,n.__)("Hide Preview","feedzy-rss-feeds")))),(0,r.createElement)(h(),{block:"feedzy-rss-feeds/loop",attributes:{...e,innerBlocksContent:b},LoadingResponsePlaceholder:T})),(0,r.createElement)(y.Fragment,null,(0,r.createElement)(L,{attributes:e,isEditing:c,isPreviewing:f,setAttributes:t,onChangeLayout:({type:a,value:r})=>{t({layout:{...e.layout,[a]:r}})},onChangeQuery:({type:a,value:r})=>{t({query:{...e.query,[a]:r}})},setIsEditing:u,setIsPreviewing:m,variations:k,setVariations:C}),(0,r.createElement)("div",{...i},B))},save:()=>(0,r.createElement)(s.InnerBlocks.Content,null)})},485:(e,t)=>{var a;!function(){"use strict";var r={}.hasOwnProperty;function n(){for(var e=[],t=0;t<arguments.length;t++){var a=arguments[t];if(a){var l=typeof a;if("string"===l||"number"===l)e.push(a);else if(Array.isArray(a)){if(a.length){var s=n.apply(null,a);s&&e.push(s)}}else if("object"===l){if(a.toString!==Object.prototype.toString&&!a.toString.toString().includes("[native code]")){e.push(a.toString());continue}for(var o in a)r.call(a,o)&&a[o]&&e.push(o)}}}return e.join(" ")}e.exports?(n.default=n,e.exports=n):void 0===(a=function(){return n}.apply(t,[]))||(e.exports=a)}()}},a={};function r(e){var n=a[e];if(void 0!==n)return n.exports;var l=a[e]={exports:{}};return t[e](l,l.exports,r),l.exports}r.m=t,e=[],r.O=(t,a,n,l)=>{if(!a){var s=1/0;for(c=0;c<e.length;c++){for(var[a,n,l]=e[c],o=!0,i=0;i<a.length;i++)(!1&l||s>=l)&&Object.keys(r.O).every((e=>r.O[e](a[i])))?a.splice(i--,1):(o=!1,l<s&&(s=l));if(o){e.splice(c--,1);var d=n();void 0!==d&&(t=d)}}return t}l=l||0;for(var c=e.length;c>0&&e[c-1][2]>l;c--)e[c]=e[c-1];e[c]=[a,n,l]},r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var a in t)r.o(t,a)&&!r.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={57:0,350:0};r.O.j=t=>0===e[t];var t=(t,a)=>{var n,l,[s,o,i]=a,d=0;if(s.some((t=>0!==e[t]))){for(n in o)r.o(o,n)&&(r.m[n]=o[n]);if(i)var c=i(r)}for(t&&t(a);d<s.length;d++)l=s[d],r.o(e,l)&&e[l]&&e[l][0](),e[l]=0;return r.O(c)},a=globalThis.webpackChunkfeedzy_rss_feeds=globalThis.webpackChunkfeedzy_rss_feeds||[];a.forEach(t.bind(null,0)),a.push=t.bind(null,a.push.bind(a))})();var n=r.O(void 0,[350],(()=>r(282)));n=r.O(n)})();