📁 File Manager Pro
v10.0.3 | PHP: 8.1.34
Server: LiteSpeed
2026-06-29 03:51:06
📂
/ (Root)
/
home
/
apkbfjox
/
2jbet.net.pk
/
wp-content
/
plugins
/
generateblocks-pro
/
dist
/
blocks
/
carousel-item
📍 /home/apkbfjox/2jbet.net.pk/wp-content/plugins/generateblocks-pro/dist/blocks/carousel-item
🔄 Refresh
✏️
Editing: index.js
Writable
(()=>{"use strict";var e={n:t=>{var s=t&&t.__esModule?()=>t.default:()=>t;return e.d(s,{a:s}),s},d:(t,s)=>{for(var l in s)e.o(s,l)&&!e.o(t,l)&&Object.defineProperty(t,l,{enumerable:!0,get:s[l]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.React,s=window.wp.blocks,l=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"generateblocks-pro/carousel-item","title":"Carousel Item","category":"generateblocks","parent":["generateblocks-pro/carousel-items"],"icon":"star","description":"A single carousel slide item.","keywords":["carousel","slide","item"],"version":"1.0.0","textdomain":"generateblocks-pro","attributes":{"uniqueId":{"type":"string","default":""},"tagName":{"type":"string","default":"","enum":["div","section","article","aside","header","footer","nav","main","figure","a","ul","ol","li","dl","dt","dd"]},"styles":{"type":"object","default":{}},"css":{"type":"string","default":""},"globalClasses":{"type":"array","default":[]},"htmlAttributes":{"type":"object","default":{}}},"supports":{"align":false,"className":false},"editorStyle":["file:./index.css"],"editorScript":"file:./index.js"}'),r=window.wp.blockEditor,n=window.wp.element,c=window.wp.compose,a=window.gbp.blockStyles;function o(e,t,s=!1){const{styles:l={},uniqueId:r="",globalClasses:n=[]}=t,c=[];return s&&c.push(e),n.length>0&&c.push(...n),Object.keys(l).length>0&&c.push(`${e}-${r}`),c}const i=window.gbp.stylesBuilder,u=window.wp.data,d=(0,u.createReduxStore)("gbp-current-style",{reducer:i.currentStyleReducer,actions:i.currentStyleActions,selectors:i.currentStyleSelectors}),y=(0,u.createReduxStore)("gbp-styles",{reducer:i.styleReducer,actions:i.styleActions,selectors:i.styleSelectors}),p=(0,u.createReduxStore)("gbp-styles-at-rule",{reducer:i.atRuleReducer,actions:i.atRuleActions,selectors:i.atRuleSelectors}),g=(0,u.createReduxStore)("gbp-styles-nested-rule",{reducer:i.nestedRuleReducer,actions:i.nestedRuleActions,selectors:i.nestedRuleSelectors}),b=window.wp.i18n,S=window.wp.apiFetch;var m=e.n(S);const f=window.wp.notices,h=window.wp.url,w=window.wp.coreData;var R;window.lodash;const v="undefined"!=typeof gbGlobalStylePermissions&&null!==(R=gbGlobalStylePermissions?.canManageStyles)&&void 0!==R&&R,L=window.wp.editPost;const A=(0,u.createReduxStore)("gbp-block-styles-current-style",{reducer:i.currentStyleReducer,actions:i.currentStyleActions,selectors:i.currentStyleSelectors}),k=(0,u.createReduxStore)("gbp-block-styles-at-rule",{reducer:i.atRuleReducer,actions:i.atRuleActions,selectors:i.atRuleSelectors}),E=(0,u.createReduxStore)("gbp-block-styles-nested-rule",{reducer:i.nestedRuleReducer,actions:i.nestedRuleActions,selectors:i.nestedRuleSelectors});function C(){const e=(0,u.useSelect)((e=>e(k).getAtRule())),{setAtRule:t}=(0,u.useDispatch)(k),s=(0,u.useSelect)((e=>e(E).getNestedRule())),{setNestedRule:l}=(0,u.useDispatch)(E),n=(0,a.useCurrentAtRule)(i.defaultAtRules),{setCurrentStyle:c}=(0,u.useDispatch)(A),o=(0,u.useSelect)((e=>e(A).currentStyle())),{deviceType:S,setDeviceType:R}=(0,a.useDeviceType)(),C=function(){const{setCurrentStyle:e}=(0,u.useDispatch)(d),{setStyles:t}=(0,u.useDispatch)(y),{createNotice:s,removeAllNotices:l}=(0,u.useDispatch)(f.store),{getEntityRecordEdits:n}=(0,u.useSelect)(w.store),{getSelectedBlock:c}=(0,u.useSelect)((e=>e(r.store)),[]),{setAtRule:a}=(0,u.useDispatch)(p),{setNestedRule:o}=(0,u.useDispatch)(g),{openGeneralSidebar:i}=(0,u.useDispatch)(L.store);return async(r,u={})=>{if(!v)return;const{classStyles:d,classPostId:y}=await async function(e){var t;const s=await m()({path:(0,h.addQueryArgs)("/generateblocks-pro/v1/global-classes/get_styles",{globalClass:e}),method:"GET"});let l=null!==(t=s?.response?.data?.styles)&&void 0!==t?t:{};return Array.isArray(l)&&0===l.length&&(l={}),{classStyles:l,classPostId:s?.response?.data?.postId}}(r);if(!y)return l("snackbar"),void s("error",(0,b.sprintf)( // Translators: Global class name. // Translators: Global class name. (0,b.__)("%s does not exist.","generateblocks-pro"),r),{type:"snackbar"});a(""),o(""),i("gblocks-editor-sidebar/gblocks-editor-sidebar"),e({postId:y,name:r,classStyles:d,clientId:c()?.clientId,options:u}),u.nestedRule&&o(u.nestedRule),u.atRule&&a(u.atRule);const p=n("postType","gblocks_styles",y);t(p?.gb_style_data||d),l("snackbar"),s("info",(0,b.sprintf)( // Translators: Global class name. // Translators: Global class name. (0,b.__)("Editing %s.","generateblocks-pro"),r),{type:"snackbar"})}}(),N=function(){const{setCurrentStyle:e}=(0,u.useDispatch)(d),{setStyles:t}=(0,u.useDispatch)(y),{setAtRule:s}=(0,u.useDispatch)(p),{setNestedRule:l}=(0,u.useDispatch)(g);return()=>{e({}),t({}),s(""),l("")}}();return{atRule:e,nestedRule:s,setAtRule:t,currentAtRule:n,setNestedRule:l,setDeviceType:R,deviceType:S,setCurrentStyle:c,currentStyle:o,getPreviewDevice:a.getPreviewDevice,setGlobalStyle:C,cancelEditGlobalStyle:N}}function N({attributes:e,setAttributes:s,shortcuts:l,onStyleChange:r}){const{atRule:n,setAtRule:c,nestedRule:o,setNestedRule:u,setDeviceType:d,getPreviewDevice:y,currentStyle:p,setGlobalStyle:g,cancelEditGlobalStyle:b}=C(),{styles:S,globalClasses:m=[]}=e,f=(0,i.getStylesObject)(S,n,o);return(0,t.createElement)(i.StylesBuilder,{currentSelector:p?.selector,styles:f,allStyles:S,onDeleteStyle:(e,t)=>{const l=(0,i.deleteStylesObjectKey)(S,e,t);s({styles:l})},nestedRule:o,atRule:n,onStyleChange:(e,t=null)=>r(e,t,n,o),onNestedRuleChange:e=>u(e),onAtRuleChange:e=>{c(e);const t=(0,i.getPreviewWidth)(e),s=y(t);s&&d(s)},onUpdateKey:(e,t,l)=>{const r=(0,i.updateStylesObjectKey)(S,e,t,l);s({styles:r})},selectorShortcuts:l.selectorShortcuts,visibleSelectors:l.visibleShortcuts,onEditStyle:g,cancelEditStyle:b,setLocalTab:e=>{sessionStorage.setItem(a.TABS_STORAGE_KEY,e)},scope:"local",appliedGlobalStyles:m})}const I=window.wp.components,O=window.wp.hooks,D=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","defer","disabled","download","formnovalidate","hidden","ismap","itemscope","loop","multiple","muted","nomodule","novalidate","open","readonly","required","reversed","selected"];function j(e){const t=e.trim().replace(/[^A-Za-z0-9-_:.]+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"");return t?/^[A-Za-z]/.test(t)?t:`id-${t}`:""}function x({value:e,options:l=[],onChange:r,blockName:n}){var c;const a=null!==(c=(0,s.getBlockType)(n)?.attributes?.tagName?.enum)&&void 0!==c?c:[],o=l.length?l:a.map((e=>({label:e,value:e})));return o.length?(0,t.createElement)(I.SelectControl,{label:(0,b.__)("Tag Name","generateblocks-pro"),value:e,options:o,onChange:r}):null}const T=window.gbp.components,P=(0,c.compose)((function(e){return s=>{var l,c,a,o;const{attributes:i,setAttributes:d,context:y}=s,{htmlAttributes:p={},uniqueId:g,className:b,align:S}=i,m=(0,u.useSelect)((e=>e("core/editor").isSavingPost())),{style:f="",href:h,...w}=p,R=Object.keys(w).reduce(((e,t)=>(e[t]=(e=>{if(null==e)return"";let t="";if("object"==typeof e)try{t=JSON.stringify(e)}catch(e){return""}else t=String(e);return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")})(w[t]),e)),{}),[v,L]=(0,n.useState)(f);var A,k,E,C;(0,n.useEffect)((()=>{!async function(){const e=await(0,O.applyFilters)("generateblocks.editor.htmlAttributes.style",f,{...s});L(e)}()}),[f,y,m]),A=()=>{const e=["alignwide","alignfull"],t=(b?.split(" ")||[]).filter((t=>!e.includes(t)));S&&t.push("align"+S),d({className:t.join(" ")})},k=[S],C=(E=(0,t.useRef)(!0)).current?(E.current=!1,!0):E.current,(0,t.useEffect)((function(){if(!C)return A()}),k);const N="string"==typeof v?v.split(";").reduce(((e,t)=>{const s=t.indexOf(":");if(-1===s)return e;let l=t.slice(0,s).trim();const r=t.slice(s+1).trim();return l&&r&&(l.startsWith("--")||(l=l.replace(/-([a-z])/g,(e=>e[1].toUpperCase()))),e[l]=r),e}),{}):"",x={...R,style:N,"data-gb-id":g,"data-context-post-id":null!==(l=null!==(c=y?.postId)&&void 0!==c?c:y?.["generateblocks/loopIndex"])&&void 0!==l?l:0,"data-align":S||void 0},T=(0,n.useMemo)((()=>Array.isArray(p)?{}:p),[JSON.stringify(p)]);return(0,n.useEffect)((()=>{const e={...p};Object.keys(e).forEach((t=>{const s=t.startsWith("data-"),l=e[t];D.includes(t)||""!==l||s||"alt"===t||delete e[t],"string"!=typeof l&&"boolean"!=typeof l&&delete e[t],"class"===t&&delete e[t]})),function(e,t){if(e===t)return!0;if(!e||!t)return!1;const s=Object.keys(e),l=Object.keys(t);if(s.length!==l.length)return!1;for(const l of s)if(e[l]!==t[l])return!1;return!0}(e,p)||d({htmlAttributes:e})}),[JSON.stringify(p)]),(0,t.createElement)(t.Fragment,null,(0,t.createElement)(e,{...s,editorHtmlAttributes:x,htmlAttributes:T}),(0,t.createElement)(r.InspectorAdvancedControls,null,(0,t.createElement)(I.TextControl,{label:"HTML ID",value:null!==(a=p.id)&&void 0!==a?a:"",onChange:e=>{d({htmlAttributes:{...p,id:e}})},onBlur:()=>{p.id&&d({htmlAttributes:{...p,id:j(p.id)}})}}),(0,t.createElement)(I.TextControl,{label:"ARIA Label",value:null!==(o=p["aria-label"])&&void 0!==o?o:"",onChange:e=>{d({htmlAttributes:{...p,"aria-label":e}})}})))}}),(function(e){return s=>{const{attributes:l,name:r,setAttributes:c,isSelected:o,clientId:u}=s,{uniqueId:d,styles:y,css:p}=l,{atRule:g,deviceType:b,setAtRule:S,currentStyle:m,setCurrentStyle:f,setNestedRule:h}=C(),w=(0,a.useSetStyles)(s,{cleanStylesObject:i.cleanStylesObject}),R=(0,n.useMemo)((()=>d?(0,a.getSelector)(r,d):""),[r,d]),v=Array.isArray(y)?{}:y;return(0,a.useAtRuleEffect)({deviceType:b,atRule:g,setAtRule:S,defaultAtRules:i.defaultAtRules,isSelected:o,getPreviewWidth:i.getPreviewWidth}),(0,a.useGenerateCSSEffect)({selector:R,styles:v,setAttributes:c,getCss:i.getCss,getSelector:a.getSelector,isSelected:o,blockCss:p,clientId:u}),(0,a.useStyleSelectorEffect)({isSelected:o,currentStyle:m,selector:R,setCurrentStyle:f,setNestedRule:h}),(0,a.useDecodeStyleKeys)({styles:y,setAttributes:c}),(0,t.createElement)(t.Fragment,null,(0,t.createElement)(a.Style,{selector:R,getCss:i.getCss,styles:v,clientId:u,name:r}),(0,t.createElement)(e,{...s,selector:R,onStyleChange:function(e,t="",s="",l=""){const r="object"==typeof e?e:{[e]:t},n=(0,a.buildChangedStylesObject)(r,s,l);w(n)},getStyleValue:function(e,t="",s=""){var l,r,n,c;return s?t?null!==(n=y?.[s]?.[t]?.[e])&&void 0!==n?n:"":null!==(r=y?.[s]?.[e])&&void 0!==r?r:"":t?null!==(c=y?.[t]?.[e])&&void 0!==c?c:"":null!==(l=y?.[e])&&void 0!==l?l:""},styles:v}))}}),a.withUniqueId)((function(e){const{attributes:s,setAttributes:l,editorHtmlAttributes:c,onStyleChange:i,getStyleValue:u,clientId:d,name:y}=e,{styles:p,tagName:g}=s,b=(0,n.useRef)(),S=o("gb-carousel-item",{...s,styles:p},!0),m=(0,r.useBlockProps)({className:S.filter((e=>e)).join(" ").trim(),...c,ref:b}),f=(0,r.useInnerBlocksProps)(m),h=g||"div";(0,n.useEffect)((()=>{g||l({tagName:"div"})}),[g]);const w={name:y,attributes:s,setAttributes:l,clientId:d,getStyleValue:u,onStyleChange:i};return(0,t.createElement)(t.Fragment,null,(0,t.createElement)(r.InspectorControls,null,(0,t.createElement)(a.BlockStyles,{settingsTab:(0,t.createElement)(T.OpenPanel,{...w,panelId:"settings"},(0,t.createElement)(x,{blockName:y,value:g,onChange:e=>{l({tagName:e})}})),stylesTab:(0,t.createElement)(N,{attributes:s,setAttributes:l,shortcuts:{},onStyleChange:i})})),(0,t.createElement)(h,{...f}))}));(0,s.registerBlockType)(l,{icon:(0,t.createElement)((function(){return(0,t.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24",className:"gblocks-block-icon","aria-hidden":"true",focusable:"false"},(0,t.createElement)("path",{d:"M22,14.312L22,15.6L19.4,15.6L19.4,8.4L22,8.4L22,9.687L20.75,9.687L20.75,14.312L22,14.312Z",style:{fillOpacity:.3}}),(0,t.createElement)("path",{d:"M2,9.687L2,8.4L4.6,8.4L4.6,15.6L2,15.6L2,14.312L3.3,14.312L3.3,9.687L2,9.687Z",style:{fillOpacity:.3}}),(0,t.createElement)("path",{d:"M17,7.9L17,16.1L7,16.1L7,7.9L17,7.9ZM15.7,9.2L8.3,9.2L8.3,14.8L15.7,14.8L15.7,9.2Z"}),(0,t.createElement)("path",{d:"M21.375,22L17.625,22L17.625,20.75L20.75,20.75L20.75,17.625L22,17.625L22,21.375C22,21.72 21.72,22 21.375,22ZM9.188,20.75L14.813,20.75L14.813,22L9.188,22L9.188,20.75ZM6.375,22L2.625,22C2.282,22 2,21.718 2,21.375L2,17.625L3.25,17.625L3.25,20.75L6.375,20.75L6.375,22ZM3.25,6.375L2,6.375L2,2.625C2,2.28 2.28,2 2.625,2L6.375,2L6.375,3.25L3.25,3.25L3.25,6.375ZM9.188,2L14.813,2L14.813,3.25L9.188,3.25L9.188,2ZM22,6.375L20.75,6.375L20.75,3.25L17.625,3.25L17.625,2L21.375,2C21.72,2 22,2.28 22,2.625L22,6.375Z",style:{fillOpacity:.3,fillRule:"nonzero"}}),(0,t.createElement)("rect",{x:"7",y:"17.567",width:"1.3",height:"1.3",style:{fillOpacity:.3}}),(0,t.createElement)("rect",{x:"15.7",y:"17.567",width:"1.3",height:"1.3",style:{fillOpacity:.3}}),(0,t.createElement)("rect",{x:"11.35",y:"17.567",width:"1.3",height:"1.3",style:{fillOpacity:.3}}))}),null),edit:P,save:function({attributes:e}){const{tagName:s,htmlAttributes:l}=e,n=o("gb-carousel-item",e,!0),c=r.useBlockProps.save({className:n.filter((e=>e)).join(" ").trim(),...l}),a=r.useInnerBlocksProps.save(c),i=s||"div";return(0,t.createElement)(i,{...a})}})})();
💾 Save Changes
❌ Cancel