Plugin Directory

Changeset 3249307


Ignore:
Timestamp:
03/02/2025 08:55:00 PM (12 months ago)
Author:
dplugins
Message:

Update to version 1.2.4 from GitHub

Location:
dblocks-youtube-lazyload
Files:
12 edited
1 copied

Legend:

Unmodified
Added
Removed
  • dblocks-youtube-lazyload/tags/1.2.4/build/index.asset.php

    r3249306 r3249307  
    1 <?php return array('dependencies' => array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-media-utils'), 'version' => 'c327d5d3297ce7384c5d');
     1<?php return array('dependencies' => array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-media-utils'), 'version' => 'c453e4d3b6b6067ab3ed');
  • dblocks-youtube-lazyload/tags/1.2.4/build/index.js

    r3249306 r3249307  
    1 (()=>{"use strict";var e,t={388:(e,t)=>{const l=["a","animate","color-profile","cursor","discard","fedropshadow","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"],o=()=>"undefined"==typeof window?null:window,n=e=>void 0!==e.size;t.A=async(e,t=o())=>{if(!t)throw new Error("DOM window required");if(n(e)&&"image/svg+xml"!==e.type)return e;const a=await(e=>new Promise((t=>{if(n(e)){const l=new FileReader;l.onload=()=>{t(l.result)},l.readAsText(e)}else t(e.toString("utf-8"))})))(e);if(!a)throw new Error("Image corrupt");const r=t.document.createElement("template");r.innerHTML=a;const i=r.content.firstElementChild,s=!!Array.from(i.attributes).map((({name:e})=>e)).find((e=>e.startsWith("on")));return 0!==i.querySelectorAll(l.join(",")).length||s?null:e}},599:(e,t,l)=>{const o=window.wp.blocks,n=window.React,a=window.wp.element,r=window.wp.components,i=window.wp.blockEditor,s=window.wp.data,c=[{label:"Max Resolution",value:"maxresdefault"},{label:"Standard Definition",value:"sddefault"},{label:"Medium Quality",value:"mqdefault"},{label:"High Quality",value:"hqdefault"},{label:"Default Quality",value:"default"}],u="maxresdefault",d=e=>e&&e.match(/(?:youtube\.com\/(?:[^\/]+\/.+\/|(?:v|e(?:mbed)?)\/|.*[?&]v=)|youtu\.be\/)([^\"&?\/ ]{11})/)?.[1]||"",m=['<svg width="25" height="24" viewBox="0 0 25 24" fill="none">\n        <path d="M24.2423 6.26118C23.967 5.22707 23.3635 4.35177 22.3294 4.07648C20.4552 3.5753 12.7646 3.52942 12.7646 3.52942C12.7646 3.52942 5.07406 3.5753 3.19994 4.07648C2.16582 4.35177 1.56582 5.22707 1.287 6.26118C0.785825 8.1353 0.764648 12 0.764648 12C0.764648 12 0.785825 15.8647 1.287 17.7388C1.5623 18.7729 2.16582 19.6482 3.19994 19.9235C5.07406 20.4247 12.7646 20.4706 12.7646 20.4706C12.7646 20.4706 20.4552 20.4247 22.3294 19.9235C23.3635 19.6482 23.967 18.7729 24.2423 17.7388C24.7435 15.8647 24.7646 12 24.7646 12C24.7646 12 24.7435 8.1353 24.2423 6.26118Z" fill="{{playBackground}}"/>\n        <path d="M10.2941 15.5294V8.47058L16.647 12L10.2941 15.5294Z" fill="{{playIcon}}"/>\n    </svg>','<svg width="25" height="24" viewBox="0 0 25 24" fill="none">\n        <circle cx="12.353" cy="12" r="11.2941" fill="{{playBackground}}"/>\n        <path d="M9.88232 15.5294V8.47058L16.2353 12L9.88232 15.5294Z" fill="{{playIcon}}"/>\n    </svg>','<svg width="25" height="24" viewBox="0 0 25 24" fill="none">\n        <rect x="0.176392" width="24" height="24" fill="{{playBackground}}"/>\n        <path d="M6.5293 19.0588V4.94116L19.2352 12L6.5293 19.0588Z" fill="{{playIcon}}"/>\n    </svg>','<svg width="25" height="24" viewBox="0 0 25 24" fill="none">\n        <rect x="0.470581" width="24" height="24" rx="2.82353" fill="{{playBackground}}"/>\n        <path d="M6.82349 18.3096V5.69037C6.82349 4.88109 7.69454 4.37098 8.40034 4.76692L19.6479 11.0765C20.369 11.481 20.369 12.5189 19.6479 12.9234L8.40034 19.2331C7.69454 19.629 6.82349 19.1189 6.82349 18.3096Z" fill="{{playIcon}}"/>\n    </svg>','<svg width="24" height="24" viewBox="0 0 24 24" fill="none">\n        <path d="M0.705933 24V0L22.7059 12L0.705933 24Z" fill="{{playBackground}}"/>\n    </svg>','<svg width="24" height="24" viewBox="0 0 24 24" fill="none">\n        <path d="M1.76471 21.6157V2.3843C1.76471 1.31128 2.91446 0.630508 3.8553 1.14645L21.3898 10.7621C22.3671 11.2981 22.3671 12.7019 21.3898 13.2379L3.8553 22.8535C2.91446 23.3695 1.76471 22.6887 1.76471 21.6157Z" fill="{{playBackground}}"/>\n    </svg>'],p=({url:e,quality:t="maxresdefault",playButtonSize:l,playButtonStyle:o=0,color:a,textColor:r,svgContent:i,iconType:s,customThumbnail:p})=>{const y=d(e),g=((e,t=u)=>e?(c.map((e=>e.value)).includes(t)||(t=u),`https://img.youtube.com/vi/${e}/${t}.jpg`):"")(y,t),b=m[o].replace(/{{playBackground}}/g,a).replace(/{{playIcon}}/g,r);return(0,n.createElement)(n.Fragment,null,(0,n.createElement)("button",{className:"play-button","data-youtube-id":y},(0,n.createElement)("div",{className:"play-icon-wrap play-icon-custom",style:{width:l,height:l}},"custom"===s&&(0,n.createElement)("div",{dangerouslySetInnerHTML:{__html:i||b}}),"iconPresets"===s&&(0,n.createElement)("div",{dangerouslySetInnerHTML:{__html:b}}))),(0,n.createElement)("img",{src:p||g,alt:"YouTube Video Placeholder",className:"youtube-placeholder-image "+(p?"youtube-placeholder-image--custom-thumbnail":"")}))},y=({handlePlayerStyleChange:e,initialStyleIndex:t})=>{const l=["Original","Rounded","Box","Box Rounded","Play","Play Rounded"],[o,a]=(0,n.useState)(t);return(0,n.useEffect)((()=>{console.log("Initial Style Index:",t),a(t)}),[t]),(0,n.createElement)("fieldset",{className:"player-style-buttons"},(0,n.createElement)("legend",{className:"block-sidebar-legend"},"Style"),m.map(((t,r)=>{const i=t.replace(/{{playBackground}}/g,"#3c3c3c").replace(/{{playIcon}}/g,"#FFFFFF"),s=r==o;return(0,n.createElement)("button",{key:r,"aria-label":l[r],onClick:()=>{e(`style${r+1}`),a(r)},className:"player-style-button "+(s?"active":""),dangerouslySetInnerHTML:{__html:i}})})))},g=({url:e,quality:t,playButtonSize:l,playButtonStyle:o,color:a,textColor:r,svgContent:i,iconType:s,customThumbnail:c})=>(0,n.createElement)("div",{className:"youtube-preview"},(0,n.createElement)(p,{url:e,quality:t,playButtonSize:l,playButtonStyle:o,color:a,textColor:r,svgContent:i,iconType:s,customThumbnail:c})),b=({youtubeId:e,isEditing:t,setIsEditing:l})=>(0,n.createElement)(r.ToolbarGroup,null,e&&(0,n.createElement)(r.ToolbarButton,{icon:t?"visibility":"edit",label:t?"Edit URL":"View Image",onClick:()=>l((e=>!e))}));var h=l(388);window.wp.mediaUtils;const f="dblocks/global-settings",v={color:"#800080",textColor:"#FFFFFF",playButtonSize:"100px",playButtonStyle:0,minHeight:"100px"};(0,s.registerStore)(f,{reducer(e=v,t){switch(t.type){case"SET_GLOBAL_SETTING":return{...e,[t.attribute]:t.value};case"SET_GLOBAL_SETTINGS":return{...e,...t.settings};default:return e}},actions:{setGlobalSetting:(e,t)=>({type:"SET_GLOBAL_SETTING",attribute:e,value:t}),setGlobalSettings:e=>({type:"SET_GLOBAL_SETTINGS",settings:e})},selectors:{getGlobalSettings:e=>e,getGlobalSetting:(e,t)=>e[t]},resolvers:{*getGlobalSettings(){const e=yield fetch("/wp-json/dblocks-lazyload-for-youtube/v1/global-settings",{headers:{"X-WP-Nonce":wpApiSettings.nonce}});return{type:"SET_GLOBAL_SETTINGS",settings:yield e.json()}}}});const w=JSON.parse('{"UU":"dblocks/dblocks-lazyload-for-youtube"}');(0,o.registerBlockType)(w.UU,{transforms:{from:[{type:"block",blocks:["core/embed"],transform:e=>{const{url:t}=e;return t&&(t.includes("youtube.com")||t.includes("youtu.be"))?(0,o.createBlock)("dblocks/lazyload-for-youtube",{url:t}):(0,o.createBlock)("core/embed",e)}}],from:[{type:"block",blocks:["create-block/dp-lazy-youtube"],transform:e=>(0,o.createBlock)("dblocks/lazyload-for-youtube",{...e})}]},edit:({attributes:e,setAttributes:t,isSelected:l})=>{const{url:o="",quality:u,playButtonSize:m,minHeight:p,playButtonStyle:v,color:w,textColor:S,iconType:C,customThumbnail:E}=e;let{containerId:_}=e;const[B,T]=(0,a.useState)(!o),k=(0,a.useRef)(!1),[x,I]=(0,a.useState)(""),[N,z]=(0,a.useState)(!1),[L,O]=(0,a.useState)(""),P=(0,s.useSelect)((e=>e(f).getGlobalSettings()),[]),{setGlobalSetting:G,setGlobalSettings:F}=(0,s.useDispatch)(f),[M,A]=(0,a.useState)(!1);(0,a.useEffect)((()=>{(async()=>{try{const e=await fetch("/wp-json/dblocks-lazyload-for-youtube/v1/global-settings",{headers:{"X-WP-Nonce":wpApiSettings.nonce}}),l=await e.json();F(l),t((e=>({...e,...l}))),l.svgContent&&(O(l.svgContent),z(!0),t({svgContent:l.svgContent})),k.current=!0,A(!0)}catch(e){console.error("Failed to fetch global settings:",e)}})()}),[F,t]),(0,a.useEffect)((()=>{k.current&&t({color:P.color,textColor:P.textColor,playButtonSize:P.playButtonSize,playButtonStyle:P.playButtonStyle,minHeight:P.minHeight,iconType:P.iconType})}),[P,t,M]),(0,a.useEffect)((()=>{const e=`youtube-container-${Math.floor(1e6*Math.random())}`;t({containerId:e})}),[t]);const H=async(e,l)=>{G(e,l),t({[e]:l});try{await fetch("/wp-json/dblocks-lazyload-for-youtube/v1/global-settings",{method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":wpApiSettings.nonce},body:JSON.stringify({[e]:l})})}catch(t){console.error(`Failed to update global ${e}:`,t)}},R=d(o),D=()=>{const e=wp.media({title:"Select or Upload Media",button:{text:"Use this media"},multiple:!1});e.on("select",(()=>{const l=e.state().get("selection").first().toJSON();t({customThumbnail:l.url})})),e.open()};return(0,n.createElement)(n.Fragment,null,(0,n.createElement)(i.InspectorControls,null,(0,n.createElement)(r.PanelBody,{title:"Thumbnail",initialOpen:!0},(0,n.createElement)(r.SelectControl,{label:"Image Quality",value:u,options:c,onChange:e=>{t({quality:e})}}),E?(0,n.createElement)(n.Fragment,null,(0,n.createElement)("div",{className:"custom-thumbnail-preview"},(0,n.createElement)("img",{src:E,alt:"Custom Thumbnail Preview",style:{width:"100%",marginTop:"10px"}}),(0,n.createElement)("div",{className:"custom-thumbnail-preview__buttons"},(0,n.createElement)(r.Button,{className:"editor-post-featured-image__toggle editor-post-featured-image__toggle",onClick:D},"Replace"),(0,n.createElement)(r.Button,{className:"editor-post-featured-image__toggle editor-post-featured-image__toggle",onClick:()=>{t({customThumbnail:""})}},"Remove")))):(0,n.createElement)(r.Button,{className:"editor-post-featured-image__toggle editor-post-featured-image__toggle",onClick:D},"Add Custom Thumbnail")),(0,n.createElement)(r.PanelBody,{title:"Player Icon",initialOpen:!0},(0,n.createElement)(r.__experimentalToggleGroupControl,{label:"Icon Type",value:C,onChange:e=>{H("iconType",e)},isBlock:!0,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0},(0,n.createElement)(r.__experimentalToggleGroupControlOption,{value:"iconPresets",label:"Icon Presets"}),(0,n.createElement)(r.__experimentalToggleGroupControlOption,{value:"custom",label:"Custom SVG"})),"iconPresets"===C&&(0,n.createElement)(y,{handlePlayerStyleChange:e=>{const t=parseInt(e.replace("style",""),10)-1;H("playButtonStyle",t)},initialStyleIndex:P.playButtonStyle,color:w,textColor:S}),"custom"===C&&!L&&!N&&(0,n.createElement)("div",{className:"drop-zone-wrapper"},N?"Dropped!":"Drop something here",(0,n.createElement)(r.DropZone,{onFilesDrop:async e=>{const t=e[0];if(t&&"image/svg+xml"===t.type){const e=new FileReader;e.onload=async e=>{let t=e.target.result;const l=await(0,h.A)(t);if(!l)return void alert("Invalid SVG content detected.");const o=l.indexOf("<svg"),n=l.lastIndexOf("</svg>")+6;-1!==o&&-1!==n&&(t=l.substring(o,n)),O(t),z(!0),await H("svgContent",t)},e.readAsText(t)}},onHTMLDrop:()=>z(!0),onDrop:()=>z(!0)})),"custom"===C&&N&&L&&(0,n.createElement)("div",{className:"svg-preview-wrapper"},(0,n.createElement)("div",{className:"svg-preview drop-zone-wrapper",dangerouslySetInnerHTML:{__html:L}}),(0,n.createElement)(r.Button,{variant:"secondary",onClick:()=>{O(""),z(!1),t({playButtonStyle:0,svgContent:""}),H("svgContent","")}},"Remove Icon")),(0,n.createElement)(i.HeightControl,{label:"Size",value:m||"64px",onChange:e=>{H("playButtonSize",e)}}),"iconPresets"===C&&(0,n.createElement)(i.PanelColorSettings,{className:"color-settings-youtubelazyload",title:"Color Settings",colorSettings:[{value:S,onChange:e=>{H("textColor",e)},label:"Play Color"},{value:w,onChange:e=>{H("color",e)},label:"Play Background Color"}]}))),(0,n.createElement)(i.BlockControls,null,(0,n.createElement)(b,{youtubeId:R,isEditing:B,setIsEditing:T})),(0,n.createElement)("div",{...(0,i.useBlockProps)(),style:{minHeight:p,"--play-background":w,"--play-icon-color":S,"--play-button-size":m}},B?(0,n.createElement)("div",{className:"lazy-load-edit-wrapper"},(0,n.createElement)("div",{className:"lazy-load__title"},"YouTube URL"),(0,n.createElement)("div",{className:"lazy-load__title__instructions"},"Paste a link to the content you want to display on your site."),(0,n.createElement)("div",{className:"lazy-load__title__input-wrapper"},(0,n.createElement)(r.TextControl,{value:o,onChange:e=>{const l=d(e);t({url:e,urlExtract:l}),I("")},placeholder:"Enter YouTube URL"}),(0,n.createElement)(r.Button,{variant:"primary",onClick:()=>{R?(T(!1),console.log("svg:",L),M&&g({url:o,quality:u,playButtonSize:m,playButtonStyle:v,color:w,textColor:S,svgContent:L,iconType:C})):I("Sorry, this content could not be embedded.")}},"Preview")),(0,n.createElement)("a",{className:"lazy-load__title__instructions text-link",href:"https://github.com/DBlocks-by-DPlugins/dblocks-lazyload-for-youtube/blob/main/embeds.md",target:"_blank"},"Learn more about embeds ",(0,n.createElement)("span",{"aria-label":"(opens in a new tab)"},"↗")),x&&(0,n.createElement)("p",{className:"lazy-load__title__instructions"},x)):R&&M?g({url:o,quality:u,playButtonSize:m,playButtonStyle:v,color:w,textColor:S,svgContent:L,iconType:C,customThumbnail:E}):null))}})}},l={};function o(e){var n=l[e];if(void 0!==n)return n.exports;var a=l[e]={exports:{}};return t[e](a,a.exports,o),a.exports}o.m=t,e=[],o.O=(t,l,n,a)=>{if(!l){var r=1/0;for(u=0;u<e.length;u++){l=e[u][0],n=e[u][1],a=e[u][2];for(var i=!0,s=0;s<l.length;s++)(!1&a||r>=a)&&Object.keys(o.O).every((e=>o.O[e](l[s])))?l.splice(s--,1):(i=!1,a<r&&(r=a));if(i){e.splice(u--,1);var c=n();void 0!==c&&(t=c)}}return t}a=a||0;for(var u=e.length;u>0&&e[u-1][2]>a;u--)e[u]=e[u-1];e[u]=[l,n,a]},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={57:0,350:0};o.O.j=t=>0===e[t];var t=(t,l)=>{var n,a,r=l[0],i=l[1],s=l[2],c=0;if(r.some((t=>0!==e[t]))){for(n in i)o.o(i,n)&&(o.m[n]=i[n]);if(s)var u=s(o)}for(t&&t(l);c<r.length;c++)a=r[c],o.o(e,a)&&e[a]&&e[a][0](),e[a]=0;return o.O(u)},l=self.webpackChunkdblocks_lazyload_for_youtube=self.webpackChunkdblocks_lazyload_for_youtube||[];l.forEach(t.bind(null,0)),l.push=t.bind(null,l.push.bind(l))})();var n=o.O(void 0,[350],(()=>o(599)));n=o.O(n)})();
     1(()=>{"use strict";var e,t={388:(e,t)=>{const l=["a","animate","color-profile","cursor","discard","fedropshadow","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"],o=()=>"undefined"==typeof window?null:window,n=e=>void 0!==e.size;t.A=async(e,t=o())=>{if(!t)throw new Error("DOM window required");if(n(e)&&"image/svg+xml"!==e.type)return e;const a=await(e=>new Promise((t=>{if(n(e)){const l=new FileReader;l.onload=()=>{t(l.result)},l.readAsText(e)}else t(e.toString("utf-8"))})))(e);if(!a)throw new Error("Image corrupt");const r=t.document.createElement("template");r.innerHTML=a;const i=r.content.firstElementChild,s=!!Array.from(i.attributes).map((({name:e})=>e)).find((e=>e.startsWith("on")));return 0!==i.querySelectorAll(l.join(",")).length||s?null:e}},599:(e,t,l)=>{const o=window.wp.blocks,n=window.React,a=window.wp.element,r=window.wp.components,i=window.wp.blockEditor,s=window.wp.data,c=[{label:"Max Resolution",value:"maxresdefault"},{label:"Standard Definition",value:"sddefault"},{label:"Medium Quality",value:"mqdefault"},{label:"High Quality",value:"hqdefault"},{label:"Default Quality",value:"default"}],u="maxresdefault",d=e=>e&&e.match(/(?:youtube\.com\/(?:[^\/]+\/.+\/|(?:v|e(?:mbed)?)\/|.*[?&]v=)|youtu\.be\/)([^\"&?\/ ]{11})/)?.[1]||"",m=['<svg width="25" height="24" viewBox="0 0 25 24" fill="none">\n        <path d="M24.2423 6.26118C23.967 5.22707 23.3635 4.35177 22.3294 4.07648C20.4552 3.5753 12.7646 3.52942 12.7646 3.52942C12.7646 3.52942 5.07406 3.5753 3.19994 4.07648C2.16582 4.35177 1.56582 5.22707 1.287 6.26118C0.785825 8.1353 0.764648 12 0.764648 12C0.764648 12 0.785825 15.8647 1.287 17.7388C1.5623 18.7729 2.16582 19.6482 3.19994 19.9235C5.07406 20.4247 12.7646 20.4706 12.7646 20.4706C12.7646 20.4706 20.4552 20.4247 22.3294 19.9235C23.3635 19.6482 23.967 18.7729 24.2423 17.7388C24.7435 15.8647 24.7646 12 24.7646 12C24.7646 12 24.7435 8.1353 24.2423 6.26118Z" fill="{{playBackground}}"/>\n        <path d="M10.2941 15.5294V8.47058L16.647 12L10.2941 15.5294Z" fill="{{playIcon}}"/>\n    </svg>','<svg width="25" height="24" viewBox="0 0 25 24" fill="none">\n        <circle cx="12.353" cy="12" r="11.2941" fill="{{playBackground}}"/>\n        <path d="M9.88232 15.5294V8.47058L16.2353 12L9.88232 15.5294Z" fill="{{playIcon}}"/>\n    </svg>','<svg width="25" height="24" viewBox="0 0 25 24" fill="none">\n        <rect x="0.176392" width="24" height="24" fill="{{playBackground}}"/>\n        <path d="M6.5293 19.0588V4.94116L19.2352 12L6.5293 19.0588Z" fill="{{playIcon}}"/>\n    </svg>','<svg width="25" height="24" viewBox="0 0 25 24" fill="none">\n        <rect x="0.470581" width="24" height="24" rx="2.82353" fill="{{playBackground}}"/>\n        <path d="M6.82349 18.3096V5.69037C6.82349 4.88109 7.69454 4.37098 8.40034 4.76692L19.6479 11.0765C20.369 11.481 20.369 12.5189 19.6479 12.9234L8.40034 19.2331C7.69454 19.629 6.82349 19.1189 6.82349 18.3096Z" fill="{{playIcon}}"/>\n    </svg>','<svg width="24" height="24" viewBox="0 0 24 24" fill="none">\n        <path d="M0.705933 24V0L22.7059 12L0.705933 24Z" fill="{{playBackground}}"/>\n    </svg>','<svg width="24" height="24" viewBox="0 0 24 24" fill="none">\n        <path d="M1.76471 21.6157V2.3843C1.76471 1.31128 2.91446 0.630508 3.8553 1.14645L21.3898 10.7621C22.3671 11.2981 22.3671 12.7019 21.3898 13.2379L3.8553 22.8535C2.91446 23.3695 1.76471 22.6887 1.76471 21.6157Z" fill="{{playBackground}}"/>\n    </svg>'],p=({url:e,quality:t="maxresdefault",playButtonSize:l,playButtonStyle:o=0,color:a,textColor:r,svgContent:i,iconType:s,customThumbnail:p})=>{const y=d(e),g=((e,t=u)=>e?(c.map((e=>e.value)).includes(t)||(t=u),`https://img.youtube.com/vi/${e}/${t}.jpg`):"")(y,t),b=m[o].replace(/{{playBackground}}/g,a).replace(/{{playIcon}}/g,r);return(0,n.createElement)(n.Fragment,null,(0,n.createElement)("button",{className:"play-button","data-youtube-id":y},(0,n.createElement)("div",{className:"play-icon-wrap play-icon-custom",style:{width:l,height:l}},"custom"===s&&(0,n.createElement)("div",{dangerouslySetInnerHTML:{__html:i||b}}),"iconPresets"===s&&(0,n.createElement)("div",{dangerouslySetInnerHTML:{__html:b}}))),(0,n.createElement)("img",{src:p||g,alt:"YouTube Video Placeholder",className:"youtube-placeholder-image "+(p?"youtube-placeholder-image--custom-thumbnail":"")}))},y=({handlePlayerStyleChange:e,initialStyleIndex:t})=>{const l=["Original","Rounded","Box","Box Rounded","Play","Play Rounded"],[o,a]=(0,n.useState)(t);return(0,n.useEffect)((()=>{console.log("Initial Style Index:",t),a(t)}),[t]),(0,n.createElement)("fieldset",{className:"player-style-buttons"},(0,n.createElement)("legend",{className:"block-sidebar-legend"},"Style"),m.map(((t,r)=>{const i=t.replace(/{{playBackground}}/g,"#3c3c3c").replace(/{{playIcon}}/g,"#FFFFFF"),s=r==o;return(0,n.createElement)("button",{key:r,"aria-label":l[r],onClick:()=>{e(`style${r+1}`),a(r)},className:"player-style-button "+(s?"active":""),dangerouslySetInnerHTML:{__html:i}})})))},g=({url:e,quality:t,playButtonSize:l,playButtonStyle:o,color:a,textColor:r,svgContent:i,iconType:s,customThumbnail:c})=>(0,n.createElement)("div",{className:"youtube-preview"},(0,n.createElement)(p,{url:e,quality:t,playButtonSize:l,playButtonStyle:o,color:a,textColor:r,svgContent:i,iconType:s,customThumbnail:c})),b=({youtubeId:e,isEditing:t,setIsEditing:l})=>(0,n.createElement)(r.ToolbarGroup,null,e&&(0,n.createElement)(r.ToolbarButton,{icon:t?"visibility":"edit",label:t?"Edit URL":"View Image",onClick:()=>l((e=>!e))}));var h=l(388);window.wp.mediaUtils;const v="dblocks/global-settings",f={color:"#800080",textColor:"#FFFFFF",playButtonSize:"100px",playButtonStyle:0,minHeight:"100px"};(0,s.registerStore)(v,{reducer(e=f,t){switch(t.type){case"SET_GLOBAL_SETTING":return{...e,[t.attribute]:t.value};case"SET_GLOBAL_SETTINGS":return{...e,...t.settings};default:return e}},actions:{setGlobalSetting:(e,t)=>({type:"SET_GLOBAL_SETTING",attribute:e,value:t}),setGlobalSettings:e=>({type:"SET_GLOBAL_SETTINGS",settings:e})},selectors:{getGlobalSettings:e=>e,getGlobalSetting:(e,t)=>e[t]},resolvers:{*getGlobalSettings(){const e=yield fetch("/wp-json/dblocks-lazyload-for-youtube/v1/global-settings",{headers:{"X-WP-Nonce":wpApiSettings.nonce}});return{type:"SET_GLOBAL_SETTINGS",settings:yield e.json()}}}});const w=JSON.parse('{"UU":"dblocks/dblocks-lazyload-for-youtube"}');(0,o.registerBlockType)(w.UU,{transforms:{from:[{type:"block",blocks:["core/embed"],transform:e=>{const{url:t}=e;return t&&(t.includes("youtube.com")||t.includes("youtu.be"))?(0,o.createBlock)("dblocks/dblocks-lazyload-for-youtube",{url:t}):(0,o.createBlock)("core/embed",e)}},{type:"block",blocks:["create-block/dp-lazy-youtube"],transform:e=>(0,o.createBlock)("dblocks/dblocks-lazyload-for-youtube",{...e})}]},edit:({attributes:e,setAttributes:t,isSelected:l})=>{const{url:o="",quality:u,playButtonSize:m,minHeight:p,playButtonStyle:f,color:w,textColor:S,iconType:C,customThumbnail:E}=e;let{containerId:_}=e;const[B,k]=(0,a.useState)(!o),T=(0,a.useRef)(!1),[x,I]=(0,a.useState)(""),[N,z]=(0,a.useState)(!1),[L,O]=(0,a.useState)(""),P=(0,s.useSelect)((e=>e(v).getGlobalSettings()),[]),{setGlobalSetting:G,setGlobalSettings:F}=(0,s.useDispatch)(v),[M,A]=(0,a.useState)(!1);(0,a.useEffect)((()=>{(async()=>{try{const e=await fetch("/wp-json/dblocks-lazyload-for-youtube/v1/global-settings",{headers:{"X-WP-Nonce":wpApiSettings.nonce}}),l=await e.json();F(l),t((e=>({...e,...l}))),l.svgContent&&(O(l.svgContent),z(!0),t({svgContent:l.svgContent})),T.current=!0,A(!0)}catch(e){console.error("Failed to fetch global settings:",e)}})()}),[F,t]),(0,a.useEffect)((()=>{T.current&&t({color:P.color,textColor:P.textColor,playButtonSize:P.playButtonSize,playButtonStyle:P.playButtonStyle,minHeight:P.minHeight,iconType:P.iconType})}),[P,t,M]),(0,a.useEffect)((()=>{const e=`youtube-container-${Math.floor(1e6*Math.random())}`;t({containerId:e})}),[t]);const H=async(e,l)=>{G(e,l),t({[e]:l});try{await fetch("/wp-json/dblocks-lazyload-for-youtube/v1/global-settings",{method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":wpApiSettings.nonce},body:JSON.stringify({[e]:l})})}catch(t){console.error(`Failed to update global ${e}:`,t)}},R=d(o),D=()=>{const e=wp.media({title:"Select or Upload Media",button:{text:"Use this media"},multiple:!1});e.on("select",(()=>{const l=e.state().get("selection").first().toJSON();t({customThumbnail:l.url})})),e.open()};return(0,n.createElement)(n.Fragment,null,(0,n.createElement)(i.InspectorControls,null,(0,n.createElement)(r.PanelBody,{title:"Thumbnail",initialOpen:!0},(0,n.createElement)(r.SelectControl,{label:"Image Quality",value:u,options:c,onChange:e=>{t({quality:e})}}),E?(0,n.createElement)(n.Fragment,null,(0,n.createElement)("div",{className:"custom-thumbnail-preview"},(0,n.createElement)("img",{src:E,alt:"Custom Thumbnail Preview",style:{width:"100%",marginTop:"10px"}}),(0,n.createElement)("div",{className:"custom-thumbnail-preview__buttons"},(0,n.createElement)(r.Button,{className:"editor-post-featured-image__toggle editor-post-featured-image__toggle",onClick:D},"Replace"),(0,n.createElement)(r.Button,{className:"editor-post-featured-image__toggle editor-post-featured-image__toggle",onClick:()=>{t({customThumbnail:""})}},"Remove")))):(0,n.createElement)(r.Button,{className:"editor-post-featured-image__toggle editor-post-featured-image__toggle",onClick:D},"Add Custom Thumbnail")),(0,n.createElement)(r.PanelBody,{title:"Player Icon",initialOpen:!0},(0,n.createElement)(r.__experimentalToggleGroupControl,{label:"Icon Type",value:C,onChange:e=>{H("iconType",e)},isBlock:!0,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0},(0,n.createElement)(r.__experimentalToggleGroupControlOption,{value:"iconPresets",label:"Icon Presets"}),(0,n.createElement)(r.__experimentalToggleGroupControlOption,{value:"custom",label:"Custom SVG"})),"iconPresets"===C&&(0,n.createElement)(y,{handlePlayerStyleChange:e=>{const t=parseInt(e.replace("style",""),10)-1;H("playButtonStyle",t)},initialStyleIndex:P.playButtonStyle,color:w,textColor:S}),"custom"===C&&!L&&!N&&(0,n.createElement)("div",{className:"drop-zone-wrapper"},N?"Dropped!":"Drop something here",(0,n.createElement)(r.DropZone,{onFilesDrop:async e=>{const t=e[0];if(t&&"image/svg+xml"===t.type){const e=new FileReader;e.onload=async e=>{let t=e.target.result;const l=await(0,h.A)(t);if(!l)return void alert("Invalid SVG content detected.");const o=l.indexOf("<svg"),n=l.lastIndexOf("</svg>")+6;-1!==o&&-1!==n&&(t=l.substring(o,n)),O(t),z(!0),await H("svgContent",t)},e.readAsText(t)}},onHTMLDrop:()=>z(!0),onDrop:()=>z(!0)})),"custom"===C&&N&&L&&(0,n.createElement)("div",{className:"svg-preview-wrapper"},(0,n.createElement)("div",{className:"svg-preview drop-zone-wrapper",dangerouslySetInnerHTML:{__html:L}}),(0,n.createElement)(r.Button,{variant:"secondary",onClick:()=>{O(""),z(!1),t({playButtonStyle:0,svgContent:""}),H("svgContent","")}},"Remove Icon")),(0,n.createElement)(i.HeightControl,{label:"Size",value:m||"64px",onChange:e=>{H("playButtonSize",e)}}),"iconPresets"===C&&(0,n.createElement)(i.PanelColorSettings,{className:"color-settings-youtubelazyload",title:"Color Settings",colorSettings:[{value:S,onChange:e=>{H("textColor",e)},label:"Play Color"},{value:w,onChange:e=>{H("color",e)},label:"Play Background Color"}]}))),(0,n.createElement)(i.BlockControls,null,(0,n.createElement)(b,{youtubeId:R,isEditing:B,setIsEditing:k})),(0,n.createElement)("div",{...(0,i.useBlockProps)(),style:{minHeight:p,"--play-background":w,"--play-icon-color":S,"--play-button-size":m}},B?(0,n.createElement)("div",{className:"lazy-load-edit-wrapper"},(0,n.createElement)("div",{className:"lazy-load__title"},"YouTube URL"),(0,n.createElement)("div",{className:"lazy-load__title__instructions"},"Paste a link to the content you want to display on your site."),(0,n.createElement)("div",{className:"lazy-load__title__input-wrapper"},(0,n.createElement)(r.TextControl,{value:o,onChange:e=>{const l=d(e);t({url:e,urlExtract:l}),I("")},placeholder:"Enter YouTube URL"}),(0,n.createElement)(r.Button,{variant:"primary",onClick:()=>{R?(k(!1),console.log("svg:",L),M&&g({url:o,quality:u,playButtonSize:m,playButtonStyle:f,color:w,textColor:S,svgContent:L,iconType:C})):I("Sorry, this content could not be embedded.")}},"Preview")),(0,n.createElement)("a",{className:"lazy-load__title__instructions text-link",href:"https://github.com/DBlocks-by-DPlugins/dblocks-lazyload-for-youtube/blob/main/embeds.md",target:"_blank"},"Learn more about embeds ",(0,n.createElement)("span",{"aria-label":"(opens in a new tab)"},"↗")),x&&(0,n.createElement)("p",{className:"lazy-load__title__instructions"},x)):R&&M?g({url:o,quality:u,playButtonSize:m,playButtonStyle:f,color:w,textColor:S,svgContent:L,iconType:C,customThumbnail:E}):null))}})}},l={};function o(e){var n=l[e];if(void 0!==n)return n.exports;var a=l[e]={exports:{}};return t[e](a,a.exports,o),a.exports}o.m=t,e=[],o.O=(t,l,n,a)=>{if(!l){var r=1/0;for(u=0;u<e.length;u++){l=e[u][0],n=e[u][1],a=e[u][2];for(var i=!0,s=0;s<l.length;s++)(!1&a||r>=a)&&Object.keys(o.O).every((e=>o.O[e](l[s])))?l.splice(s--,1):(i=!1,a<r&&(r=a));if(i){e.splice(u--,1);var c=n();void 0!==c&&(t=c)}}return t}a=a||0;for(var u=e.length;u>0&&e[u-1][2]>a;u--)e[u]=e[u-1];e[u]=[l,n,a]},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={57:0,350:0};o.O.j=t=>0===e[t];var t=(t,l)=>{var n,a,r=l[0],i=l[1],s=l[2],c=0;if(r.some((t=>0!==e[t]))){for(n in i)o.o(i,n)&&(o.m[n]=i[n]);if(s)var u=s(o)}for(t&&t(l);c<r.length;c++)a=r[c],o.o(e,a)&&e[a]&&e[a][0](),e[a]=0;return o.O(u)},l=self.webpackChunkdblocks_lazyload_for_youtube=self.webpackChunkdblocks_lazyload_for_youtube||[];l.forEach(t.bind(null,0)),l.push=t.bind(null,l.push.bind(l))})();var n=o.O(void 0,[350],(()=>o(599)));n=o.O(n)})();
  • dblocks-youtube-lazyload/tags/1.2.4/dblocks-lazyload-for-youtube.php

    r3249306 r3249307  
    66 * Requires at least: 6.5.2
    77 * Requires PHP:      7.4
    8  * Version:           1.2.3
     8 * Version:           1.2.4
    99 * Author:            DPlugins
    1010 * Author URI:        https://dplugins.com/
  • dblocks-youtube-lazyload/tags/1.2.4/package-lock.json

    r3226388 r3249307  
    11{
    22    "name": "dblocks-lazyload-for-youtube",
    3     "version": "1.2.2",
     3    "version": "1.2.4",
    44    "lockfileVersion": 3,
    55    "requires": true,
     
    77        "": {
    88            "name": "dblocks-lazyload-for-youtube",
    9             "version": "1.2.2",
     9            "version": "1.2.4",
    1010            "license": "GPL-2.0-or-later",
    1111            "dependencies": {
  • dblocks-youtube-lazyload/tags/1.2.4/package.json

    r3226388 r3249307  
    11{
    22    "name": "dblocks-lazyload-for-youtube",
    3     "version": "1.2.2",
     3    "version": "1.2.4",
    44    "description": "Block that load YouTube video scripts only if user clicks on the play button",
    55    "author": "DPlugins",
  • dblocks-youtube-lazyload/tags/1.2.4/readme.txt

    r3249306 r3249307  
    44Requires at least: 4.0
    55Tested up to: 6.7.1
    6 Stable tag: 1.2.3
     6Stable tag: 1.2.4
    77Requires PHP: 7.4
    88License: GPL-2.0-or-later
     
    6262== Changelog ==
    6363
     64= 1.2.4 =
     65* Fox for Added one more transform.
    6466
    6567= 1.2.3 =
  • dblocks-youtube-lazyload/trunk/build/index.asset.php

    r3249306 r3249307  
    1 <?php return array('dependencies' => array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-media-utils'), 'version' => 'c327d5d3297ce7384c5d');
     1<?php return array('dependencies' => array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-media-utils'), 'version' => 'c453e4d3b6b6067ab3ed');
  • dblocks-youtube-lazyload/trunk/build/index.js

    r3249306 r3249307  
    1 (()=>{"use strict";var e,t={388:(e,t)=>{const l=["a","animate","color-profile","cursor","discard","fedropshadow","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"],o=()=>"undefined"==typeof window?null:window,n=e=>void 0!==e.size;t.A=async(e,t=o())=>{if(!t)throw new Error("DOM window required");if(n(e)&&"image/svg+xml"!==e.type)return e;const a=await(e=>new Promise((t=>{if(n(e)){const l=new FileReader;l.onload=()=>{t(l.result)},l.readAsText(e)}else t(e.toString("utf-8"))})))(e);if(!a)throw new Error("Image corrupt");const r=t.document.createElement("template");r.innerHTML=a;const i=r.content.firstElementChild,s=!!Array.from(i.attributes).map((({name:e})=>e)).find((e=>e.startsWith("on")));return 0!==i.querySelectorAll(l.join(",")).length||s?null:e}},599:(e,t,l)=>{const o=window.wp.blocks,n=window.React,a=window.wp.element,r=window.wp.components,i=window.wp.blockEditor,s=window.wp.data,c=[{label:"Max Resolution",value:"maxresdefault"},{label:"Standard Definition",value:"sddefault"},{label:"Medium Quality",value:"mqdefault"},{label:"High Quality",value:"hqdefault"},{label:"Default Quality",value:"default"}],u="maxresdefault",d=e=>e&&e.match(/(?:youtube\.com\/(?:[^\/]+\/.+\/|(?:v|e(?:mbed)?)\/|.*[?&]v=)|youtu\.be\/)([^\"&?\/ ]{11})/)?.[1]||"",m=['<svg width="25" height="24" viewBox="0 0 25 24" fill="none">\n        <path d="M24.2423 6.26118C23.967 5.22707 23.3635 4.35177 22.3294 4.07648C20.4552 3.5753 12.7646 3.52942 12.7646 3.52942C12.7646 3.52942 5.07406 3.5753 3.19994 4.07648C2.16582 4.35177 1.56582 5.22707 1.287 6.26118C0.785825 8.1353 0.764648 12 0.764648 12C0.764648 12 0.785825 15.8647 1.287 17.7388C1.5623 18.7729 2.16582 19.6482 3.19994 19.9235C5.07406 20.4247 12.7646 20.4706 12.7646 20.4706C12.7646 20.4706 20.4552 20.4247 22.3294 19.9235C23.3635 19.6482 23.967 18.7729 24.2423 17.7388C24.7435 15.8647 24.7646 12 24.7646 12C24.7646 12 24.7435 8.1353 24.2423 6.26118Z" fill="{{playBackground}}"/>\n        <path d="M10.2941 15.5294V8.47058L16.647 12L10.2941 15.5294Z" fill="{{playIcon}}"/>\n    </svg>','<svg width="25" height="24" viewBox="0 0 25 24" fill="none">\n        <circle cx="12.353" cy="12" r="11.2941" fill="{{playBackground}}"/>\n        <path d="M9.88232 15.5294V8.47058L16.2353 12L9.88232 15.5294Z" fill="{{playIcon}}"/>\n    </svg>','<svg width="25" height="24" viewBox="0 0 25 24" fill="none">\n        <rect x="0.176392" width="24" height="24" fill="{{playBackground}}"/>\n        <path d="M6.5293 19.0588V4.94116L19.2352 12L6.5293 19.0588Z" fill="{{playIcon}}"/>\n    </svg>','<svg width="25" height="24" viewBox="0 0 25 24" fill="none">\n        <rect x="0.470581" width="24" height="24" rx="2.82353" fill="{{playBackground}}"/>\n        <path d="M6.82349 18.3096V5.69037C6.82349 4.88109 7.69454 4.37098 8.40034 4.76692L19.6479 11.0765C20.369 11.481 20.369 12.5189 19.6479 12.9234L8.40034 19.2331C7.69454 19.629 6.82349 19.1189 6.82349 18.3096Z" fill="{{playIcon}}"/>\n    </svg>','<svg width="24" height="24" viewBox="0 0 24 24" fill="none">\n        <path d="M0.705933 24V0L22.7059 12L0.705933 24Z" fill="{{playBackground}}"/>\n    </svg>','<svg width="24" height="24" viewBox="0 0 24 24" fill="none">\n        <path d="M1.76471 21.6157V2.3843C1.76471 1.31128 2.91446 0.630508 3.8553 1.14645L21.3898 10.7621C22.3671 11.2981 22.3671 12.7019 21.3898 13.2379L3.8553 22.8535C2.91446 23.3695 1.76471 22.6887 1.76471 21.6157Z" fill="{{playBackground}}"/>\n    </svg>'],p=({url:e,quality:t="maxresdefault",playButtonSize:l,playButtonStyle:o=0,color:a,textColor:r,svgContent:i,iconType:s,customThumbnail:p})=>{const y=d(e),g=((e,t=u)=>e?(c.map((e=>e.value)).includes(t)||(t=u),`https://img.youtube.com/vi/${e}/${t}.jpg`):"")(y,t),b=m[o].replace(/{{playBackground}}/g,a).replace(/{{playIcon}}/g,r);return(0,n.createElement)(n.Fragment,null,(0,n.createElement)("button",{className:"play-button","data-youtube-id":y},(0,n.createElement)("div",{className:"play-icon-wrap play-icon-custom",style:{width:l,height:l}},"custom"===s&&(0,n.createElement)("div",{dangerouslySetInnerHTML:{__html:i||b}}),"iconPresets"===s&&(0,n.createElement)("div",{dangerouslySetInnerHTML:{__html:b}}))),(0,n.createElement)("img",{src:p||g,alt:"YouTube Video Placeholder",className:"youtube-placeholder-image "+(p?"youtube-placeholder-image--custom-thumbnail":"")}))},y=({handlePlayerStyleChange:e,initialStyleIndex:t})=>{const l=["Original","Rounded","Box","Box Rounded","Play","Play Rounded"],[o,a]=(0,n.useState)(t);return(0,n.useEffect)((()=>{console.log("Initial Style Index:",t),a(t)}),[t]),(0,n.createElement)("fieldset",{className:"player-style-buttons"},(0,n.createElement)("legend",{className:"block-sidebar-legend"},"Style"),m.map(((t,r)=>{const i=t.replace(/{{playBackground}}/g,"#3c3c3c").replace(/{{playIcon}}/g,"#FFFFFF"),s=r==o;return(0,n.createElement)("button",{key:r,"aria-label":l[r],onClick:()=>{e(`style${r+1}`),a(r)},className:"player-style-button "+(s?"active":""),dangerouslySetInnerHTML:{__html:i}})})))},g=({url:e,quality:t,playButtonSize:l,playButtonStyle:o,color:a,textColor:r,svgContent:i,iconType:s,customThumbnail:c})=>(0,n.createElement)("div",{className:"youtube-preview"},(0,n.createElement)(p,{url:e,quality:t,playButtonSize:l,playButtonStyle:o,color:a,textColor:r,svgContent:i,iconType:s,customThumbnail:c})),b=({youtubeId:e,isEditing:t,setIsEditing:l})=>(0,n.createElement)(r.ToolbarGroup,null,e&&(0,n.createElement)(r.ToolbarButton,{icon:t?"visibility":"edit",label:t?"Edit URL":"View Image",onClick:()=>l((e=>!e))}));var h=l(388);window.wp.mediaUtils;const f="dblocks/global-settings",v={color:"#800080",textColor:"#FFFFFF",playButtonSize:"100px",playButtonStyle:0,minHeight:"100px"};(0,s.registerStore)(f,{reducer(e=v,t){switch(t.type){case"SET_GLOBAL_SETTING":return{...e,[t.attribute]:t.value};case"SET_GLOBAL_SETTINGS":return{...e,...t.settings};default:return e}},actions:{setGlobalSetting:(e,t)=>({type:"SET_GLOBAL_SETTING",attribute:e,value:t}),setGlobalSettings:e=>({type:"SET_GLOBAL_SETTINGS",settings:e})},selectors:{getGlobalSettings:e=>e,getGlobalSetting:(e,t)=>e[t]},resolvers:{*getGlobalSettings(){const e=yield fetch("/wp-json/dblocks-lazyload-for-youtube/v1/global-settings",{headers:{"X-WP-Nonce":wpApiSettings.nonce}});return{type:"SET_GLOBAL_SETTINGS",settings:yield e.json()}}}});const w=JSON.parse('{"UU":"dblocks/dblocks-lazyload-for-youtube"}');(0,o.registerBlockType)(w.UU,{transforms:{from:[{type:"block",blocks:["core/embed"],transform:e=>{const{url:t}=e;return t&&(t.includes("youtube.com")||t.includes("youtu.be"))?(0,o.createBlock)("dblocks/lazyload-for-youtube",{url:t}):(0,o.createBlock)("core/embed",e)}}],from:[{type:"block",blocks:["create-block/dp-lazy-youtube"],transform:e=>(0,o.createBlock)("dblocks/lazyload-for-youtube",{...e})}]},edit:({attributes:e,setAttributes:t,isSelected:l})=>{const{url:o="",quality:u,playButtonSize:m,minHeight:p,playButtonStyle:v,color:w,textColor:S,iconType:C,customThumbnail:E}=e;let{containerId:_}=e;const[B,T]=(0,a.useState)(!o),k=(0,a.useRef)(!1),[x,I]=(0,a.useState)(""),[N,z]=(0,a.useState)(!1),[L,O]=(0,a.useState)(""),P=(0,s.useSelect)((e=>e(f).getGlobalSettings()),[]),{setGlobalSetting:G,setGlobalSettings:F}=(0,s.useDispatch)(f),[M,A]=(0,a.useState)(!1);(0,a.useEffect)((()=>{(async()=>{try{const e=await fetch("/wp-json/dblocks-lazyload-for-youtube/v1/global-settings",{headers:{"X-WP-Nonce":wpApiSettings.nonce}}),l=await e.json();F(l),t((e=>({...e,...l}))),l.svgContent&&(O(l.svgContent),z(!0),t({svgContent:l.svgContent})),k.current=!0,A(!0)}catch(e){console.error("Failed to fetch global settings:",e)}})()}),[F,t]),(0,a.useEffect)((()=>{k.current&&t({color:P.color,textColor:P.textColor,playButtonSize:P.playButtonSize,playButtonStyle:P.playButtonStyle,minHeight:P.minHeight,iconType:P.iconType})}),[P,t,M]),(0,a.useEffect)((()=>{const e=`youtube-container-${Math.floor(1e6*Math.random())}`;t({containerId:e})}),[t]);const H=async(e,l)=>{G(e,l),t({[e]:l});try{await fetch("/wp-json/dblocks-lazyload-for-youtube/v1/global-settings",{method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":wpApiSettings.nonce},body:JSON.stringify({[e]:l})})}catch(t){console.error(`Failed to update global ${e}:`,t)}},R=d(o),D=()=>{const e=wp.media({title:"Select or Upload Media",button:{text:"Use this media"},multiple:!1});e.on("select",(()=>{const l=e.state().get("selection").first().toJSON();t({customThumbnail:l.url})})),e.open()};return(0,n.createElement)(n.Fragment,null,(0,n.createElement)(i.InspectorControls,null,(0,n.createElement)(r.PanelBody,{title:"Thumbnail",initialOpen:!0},(0,n.createElement)(r.SelectControl,{label:"Image Quality",value:u,options:c,onChange:e=>{t({quality:e})}}),E?(0,n.createElement)(n.Fragment,null,(0,n.createElement)("div",{className:"custom-thumbnail-preview"},(0,n.createElement)("img",{src:E,alt:"Custom Thumbnail Preview",style:{width:"100%",marginTop:"10px"}}),(0,n.createElement)("div",{className:"custom-thumbnail-preview__buttons"},(0,n.createElement)(r.Button,{className:"editor-post-featured-image__toggle editor-post-featured-image__toggle",onClick:D},"Replace"),(0,n.createElement)(r.Button,{className:"editor-post-featured-image__toggle editor-post-featured-image__toggle",onClick:()=>{t({customThumbnail:""})}},"Remove")))):(0,n.createElement)(r.Button,{className:"editor-post-featured-image__toggle editor-post-featured-image__toggle",onClick:D},"Add Custom Thumbnail")),(0,n.createElement)(r.PanelBody,{title:"Player Icon",initialOpen:!0},(0,n.createElement)(r.__experimentalToggleGroupControl,{label:"Icon Type",value:C,onChange:e=>{H("iconType",e)},isBlock:!0,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0},(0,n.createElement)(r.__experimentalToggleGroupControlOption,{value:"iconPresets",label:"Icon Presets"}),(0,n.createElement)(r.__experimentalToggleGroupControlOption,{value:"custom",label:"Custom SVG"})),"iconPresets"===C&&(0,n.createElement)(y,{handlePlayerStyleChange:e=>{const t=parseInt(e.replace("style",""),10)-1;H("playButtonStyle",t)},initialStyleIndex:P.playButtonStyle,color:w,textColor:S}),"custom"===C&&!L&&!N&&(0,n.createElement)("div",{className:"drop-zone-wrapper"},N?"Dropped!":"Drop something here",(0,n.createElement)(r.DropZone,{onFilesDrop:async e=>{const t=e[0];if(t&&"image/svg+xml"===t.type){const e=new FileReader;e.onload=async e=>{let t=e.target.result;const l=await(0,h.A)(t);if(!l)return void alert("Invalid SVG content detected.");const o=l.indexOf("<svg"),n=l.lastIndexOf("</svg>")+6;-1!==o&&-1!==n&&(t=l.substring(o,n)),O(t),z(!0),await H("svgContent",t)},e.readAsText(t)}},onHTMLDrop:()=>z(!0),onDrop:()=>z(!0)})),"custom"===C&&N&&L&&(0,n.createElement)("div",{className:"svg-preview-wrapper"},(0,n.createElement)("div",{className:"svg-preview drop-zone-wrapper",dangerouslySetInnerHTML:{__html:L}}),(0,n.createElement)(r.Button,{variant:"secondary",onClick:()=>{O(""),z(!1),t({playButtonStyle:0,svgContent:""}),H("svgContent","")}},"Remove Icon")),(0,n.createElement)(i.HeightControl,{label:"Size",value:m||"64px",onChange:e=>{H("playButtonSize",e)}}),"iconPresets"===C&&(0,n.createElement)(i.PanelColorSettings,{className:"color-settings-youtubelazyload",title:"Color Settings",colorSettings:[{value:S,onChange:e=>{H("textColor",e)},label:"Play Color"},{value:w,onChange:e=>{H("color",e)},label:"Play Background Color"}]}))),(0,n.createElement)(i.BlockControls,null,(0,n.createElement)(b,{youtubeId:R,isEditing:B,setIsEditing:T})),(0,n.createElement)("div",{...(0,i.useBlockProps)(),style:{minHeight:p,"--play-background":w,"--play-icon-color":S,"--play-button-size":m}},B?(0,n.createElement)("div",{className:"lazy-load-edit-wrapper"},(0,n.createElement)("div",{className:"lazy-load__title"},"YouTube URL"),(0,n.createElement)("div",{className:"lazy-load__title__instructions"},"Paste a link to the content you want to display on your site."),(0,n.createElement)("div",{className:"lazy-load__title__input-wrapper"},(0,n.createElement)(r.TextControl,{value:o,onChange:e=>{const l=d(e);t({url:e,urlExtract:l}),I("")},placeholder:"Enter YouTube URL"}),(0,n.createElement)(r.Button,{variant:"primary",onClick:()=>{R?(T(!1),console.log("svg:",L),M&&g({url:o,quality:u,playButtonSize:m,playButtonStyle:v,color:w,textColor:S,svgContent:L,iconType:C})):I("Sorry, this content could not be embedded.")}},"Preview")),(0,n.createElement)("a",{className:"lazy-load__title__instructions text-link",href:"https://github.com/DBlocks-by-DPlugins/dblocks-lazyload-for-youtube/blob/main/embeds.md",target:"_blank"},"Learn more about embeds ",(0,n.createElement)("span",{"aria-label":"(opens in a new tab)"},"↗")),x&&(0,n.createElement)("p",{className:"lazy-load__title__instructions"},x)):R&&M?g({url:o,quality:u,playButtonSize:m,playButtonStyle:v,color:w,textColor:S,svgContent:L,iconType:C,customThumbnail:E}):null))}})}},l={};function o(e){var n=l[e];if(void 0!==n)return n.exports;var a=l[e]={exports:{}};return t[e](a,a.exports,o),a.exports}o.m=t,e=[],o.O=(t,l,n,a)=>{if(!l){var r=1/0;for(u=0;u<e.length;u++){l=e[u][0],n=e[u][1],a=e[u][2];for(var i=!0,s=0;s<l.length;s++)(!1&a||r>=a)&&Object.keys(o.O).every((e=>o.O[e](l[s])))?l.splice(s--,1):(i=!1,a<r&&(r=a));if(i){e.splice(u--,1);var c=n();void 0!==c&&(t=c)}}return t}a=a||0;for(var u=e.length;u>0&&e[u-1][2]>a;u--)e[u]=e[u-1];e[u]=[l,n,a]},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={57:0,350:0};o.O.j=t=>0===e[t];var t=(t,l)=>{var n,a,r=l[0],i=l[1],s=l[2],c=0;if(r.some((t=>0!==e[t]))){for(n in i)o.o(i,n)&&(o.m[n]=i[n]);if(s)var u=s(o)}for(t&&t(l);c<r.length;c++)a=r[c],o.o(e,a)&&e[a]&&e[a][0](),e[a]=0;return o.O(u)},l=self.webpackChunkdblocks_lazyload_for_youtube=self.webpackChunkdblocks_lazyload_for_youtube||[];l.forEach(t.bind(null,0)),l.push=t.bind(null,l.push.bind(l))})();var n=o.O(void 0,[350],(()=>o(599)));n=o.O(n)})();
     1(()=>{"use strict";var e,t={388:(e,t)=>{const l=["a","animate","color-profile","cursor","discard","fedropshadow","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"],o=()=>"undefined"==typeof window?null:window,n=e=>void 0!==e.size;t.A=async(e,t=o())=>{if(!t)throw new Error("DOM window required");if(n(e)&&"image/svg+xml"!==e.type)return e;const a=await(e=>new Promise((t=>{if(n(e)){const l=new FileReader;l.onload=()=>{t(l.result)},l.readAsText(e)}else t(e.toString("utf-8"))})))(e);if(!a)throw new Error("Image corrupt");const r=t.document.createElement("template");r.innerHTML=a;const i=r.content.firstElementChild,s=!!Array.from(i.attributes).map((({name:e})=>e)).find((e=>e.startsWith("on")));return 0!==i.querySelectorAll(l.join(",")).length||s?null:e}},599:(e,t,l)=>{const o=window.wp.blocks,n=window.React,a=window.wp.element,r=window.wp.components,i=window.wp.blockEditor,s=window.wp.data,c=[{label:"Max Resolution",value:"maxresdefault"},{label:"Standard Definition",value:"sddefault"},{label:"Medium Quality",value:"mqdefault"},{label:"High Quality",value:"hqdefault"},{label:"Default Quality",value:"default"}],u="maxresdefault",d=e=>e&&e.match(/(?:youtube\.com\/(?:[^\/]+\/.+\/|(?:v|e(?:mbed)?)\/|.*[?&]v=)|youtu\.be\/)([^\"&?\/ ]{11})/)?.[1]||"",m=['<svg width="25" height="24" viewBox="0 0 25 24" fill="none">\n        <path d="M24.2423 6.26118C23.967 5.22707 23.3635 4.35177 22.3294 4.07648C20.4552 3.5753 12.7646 3.52942 12.7646 3.52942C12.7646 3.52942 5.07406 3.5753 3.19994 4.07648C2.16582 4.35177 1.56582 5.22707 1.287 6.26118C0.785825 8.1353 0.764648 12 0.764648 12C0.764648 12 0.785825 15.8647 1.287 17.7388C1.5623 18.7729 2.16582 19.6482 3.19994 19.9235C5.07406 20.4247 12.7646 20.4706 12.7646 20.4706C12.7646 20.4706 20.4552 20.4247 22.3294 19.9235C23.3635 19.6482 23.967 18.7729 24.2423 17.7388C24.7435 15.8647 24.7646 12 24.7646 12C24.7646 12 24.7435 8.1353 24.2423 6.26118Z" fill="{{playBackground}}"/>\n        <path d="M10.2941 15.5294V8.47058L16.647 12L10.2941 15.5294Z" fill="{{playIcon}}"/>\n    </svg>','<svg width="25" height="24" viewBox="0 0 25 24" fill="none">\n        <circle cx="12.353" cy="12" r="11.2941" fill="{{playBackground}}"/>\n        <path d="M9.88232 15.5294V8.47058L16.2353 12L9.88232 15.5294Z" fill="{{playIcon}}"/>\n    </svg>','<svg width="25" height="24" viewBox="0 0 25 24" fill="none">\n        <rect x="0.176392" width="24" height="24" fill="{{playBackground}}"/>\n        <path d="M6.5293 19.0588V4.94116L19.2352 12L6.5293 19.0588Z" fill="{{playIcon}}"/>\n    </svg>','<svg width="25" height="24" viewBox="0 0 25 24" fill="none">\n        <rect x="0.470581" width="24" height="24" rx="2.82353" fill="{{playBackground}}"/>\n        <path d="M6.82349 18.3096V5.69037C6.82349 4.88109 7.69454 4.37098 8.40034 4.76692L19.6479 11.0765C20.369 11.481 20.369 12.5189 19.6479 12.9234L8.40034 19.2331C7.69454 19.629 6.82349 19.1189 6.82349 18.3096Z" fill="{{playIcon}}"/>\n    </svg>','<svg width="24" height="24" viewBox="0 0 24 24" fill="none">\n        <path d="M0.705933 24V0L22.7059 12L0.705933 24Z" fill="{{playBackground}}"/>\n    </svg>','<svg width="24" height="24" viewBox="0 0 24 24" fill="none">\n        <path d="M1.76471 21.6157V2.3843C1.76471 1.31128 2.91446 0.630508 3.8553 1.14645L21.3898 10.7621C22.3671 11.2981 22.3671 12.7019 21.3898 13.2379L3.8553 22.8535C2.91446 23.3695 1.76471 22.6887 1.76471 21.6157Z" fill="{{playBackground}}"/>\n    </svg>'],p=({url:e,quality:t="maxresdefault",playButtonSize:l,playButtonStyle:o=0,color:a,textColor:r,svgContent:i,iconType:s,customThumbnail:p})=>{const y=d(e),g=((e,t=u)=>e?(c.map((e=>e.value)).includes(t)||(t=u),`https://img.youtube.com/vi/${e}/${t}.jpg`):"")(y,t),b=m[o].replace(/{{playBackground}}/g,a).replace(/{{playIcon}}/g,r);return(0,n.createElement)(n.Fragment,null,(0,n.createElement)("button",{className:"play-button","data-youtube-id":y},(0,n.createElement)("div",{className:"play-icon-wrap play-icon-custom",style:{width:l,height:l}},"custom"===s&&(0,n.createElement)("div",{dangerouslySetInnerHTML:{__html:i||b}}),"iconPresets"===s&&(0,n.createElement)("div",{dangerouslySetInnerHTML:{__html:b}}))),(0,n.createElement)("img",{src:p||g,alt:"YouTube Video Placeholder",className:"youtube-placeholder-image "+(p?"youtube-placeholder-image--custom-thumbnail":"")}))},y=({handlePlayerStyleChange:e,initialStyleIndex:t})=>{const l=["Original","Rounded","Box","Box Rounded","Play","Play Rounded"],[o,a]=(0,n.useState)(t);return(0,n.useEffect)((()=>{console.log("Initial Style Index:",t),a(t)}),[t]),(0,n.createElement)("fieldset",{className:"player-style-buttons"},(0,n.createElement)("legend",{className:"block-sidebar-legend"},"Style"),m.map(((t,r)=>{const i=t.replace(/{{playBackground}}/g,"#3c3c3c").replace(/{{playIcon}}/g,"#FFFFFF"),s=r==o;return(0,n.createElement)("button",{key:r,"aria-label":l[r],onClick:()=>{e(`style${r+1}`),a(r)},className:"player-style-button "+(s?"active":""),dangerouslySetInnerHTML:{__html:i}})})))},g=({url:e,quality:t,playButtonSize:l,playButtonStyle:o,color:a,textColor:r,svgContent:i,iconType:s,customThumbnail:c})=>(0,n.createElement)("div",{className:"youtube-preview"},(0,n.createElement)(p,{url:e,quality:t,playButtonSize:l,playButtonStyle:o,color:a,textColor:r,svgContent:i,iconType:s,customThumbnail:c})),b=({youtubeId:e,isEditing:t,setIsEditing:l})=>(0,n.createElement)(r.ToolbarGroup,null,e&&(0,n.createElement)(r.ToolbarButton,{icon:t?"visibility":"edit",label:t?"Edit URL":"View Image",onClick:()=>l((e=>!e))}));var h=l(388);window.wp.mediaUtils;const v="dblocks/global-settings",f={color:"#800080",textColor:"#FFFFFF",playButtonSize:"100px",playButtonStyle:0,minHeight:"100px"};(0,s.registerStore)(v,{reducer(e=f,t){switch(t.type){case"SET_GLOBAL_SETTING":return{...e,[t.attribute]:t.value};case"SET_GLOBAL_SETTINGS":return{...e,...t.settings};default:return e}},actions:{setGlobalSetting:(e,t)=>({type:"SET_GLOBAL_SETTING",attribute:e,value:t}),setGlobalSettings:e=>({type:"SET_GLOBAL_SETTINGS",settings:e})},selectors:{getGlobalSettings:e=>e,getGlobalSetting:(e,t)=>e[t]},resolvers:{*getGlobalSettings(){const e=yield fetch("/wp-json/dblocks-lazyload-for-youtube/v1/global-settings",{headers:{"X-WP-Nonce":wpApiSettings.nonce}});return{type:"SET_GLOBAL_SETTINGS",settings:yield e.json()}}}});const w=JSON.parse('{"UU":"dblocks/dblocks-lazyload-for-youtube"}');(0,o.registerBlockType)(w.UU,{transforms:{from:[{type:"block",blocks:["core/embed"],transform:e=>{const{url:t}=e;return t&&(t.includes("youtube.com")||t.includes("youtu.be"))?(0,o.createBlock)("dblocks/dblocks-lazyload-for-youtube",{url:t}):(0,o.createBlock)("core/embed",e)}},{type:"block",blocks:["create-block/dp-lazy-youtube"],transform:e=>(0,o.createBlock)("dblocks/dblocks-lazyload-for-youtube",{...e})}]},edit:({attributes:e,setAttributes:t,isSelected:l})=>{const{url:o="",quality:u,playButtonSize:m,minHeight:p,playButtonStyle:f,color:w,textColor:S,iconType:C,customThumbnail:E}=e;let{containerId:_}=e;const[B,k]=(0,a.useState)(!o),T=(0,a.useRef)(!1),[x,I]=(0,a.useState)(""),[N,z]=(0,a.useState)(!1),[L,O]=(0,a.useState)(""),P=(0,s.useSelect)((e=>e(v).getGlobalSettings()),[]),{setGlobalSetting:G,setGlobalSettings:F}=(0,s.useDispatch)(v),[M,A]=(0,a.useState)(!1);(0,a.useEffect)((()=>{(async()=>{try{const e=await fetch("/wp-json/dblocks-lazyload-for-youtube/v1/global-settings",{headers:{"X-WP-Nonce":wpApiSettings.nonce}}),l=await e.json();F(l),t((e=>({...e,...l}))),l.svgContent&&(O(l.svgContent),z(!0),t({svgContent:l.svgContent})),T.current=!0,A(!0)}catch(e){console.error("Failed to fetch global settings:",e)}})()}),[F,t]),(0,a.useEffect)((()=>{T.current&&t({color:P.color,textColor:P.textColor,playButtonSize:P.playButtonSize,playButtonStyle:P.playButtonStyle,minHeight:P.minHeight,iconType:P.iconType})}),[P,t,M]),(0,a.useEffect)((()=>{const e=`youtube-container-${Math.floor(1e6*Math.random())}`;t({containerId:e})}),[t]);const H=async(e,l)=>{G(e,l),t({[e]:l});try{await fetch("/wp-json/dblocks-lazyload-for-youtube/v1/global-settings",{method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":wpApiSettings.nonce},body:JSON.stringify({[e]:l})})}catch(t){console.error(`Failed to update global ${e}:`,t)}},R=d(o),D=()=>{const e=wp.media({title:"Select or Upload Media",button:{text:"Use this media"},multiple:!1});e.on("select",(()=>{const l=e.state().get("selection").first().toJSON();t({customThumbnail:l.url})})),e.open()};return(0,n.createElement)(n.Fragment,null,(0,n.createElement)(i.InspectorControls,null,(0,n.createElement)(r.PanelBody,{title:"Thumbnail",initialOpen:!0},(0,n.createElement)(r.SelectControl,{label:"Image Quality",value:u,options:c,onChange:e=>{t({quality:e})}}),E?(0,n.createElement)(n.Fragment,null,(0,n.createElement)("div",{className:"custom-thumbnail-preview"},(0,n.createElement)("img",{src:E,alt:"Custom Thumbnail Preview",style:{width:"100%",marginTop:"10px"}}),(0,n.createElement)("div",{className:"custom-thumbnail-preview__buttons"},(0,n.createElement)(r.Button,{className:"editor-post-featured-image__toggle editor-post-featured-image__toggle",onClick:D},"Replace"),(0,n.createElement)(r.Button,{className:"editor-post-featured-image__toggle editor-post-featured-image__toggle",onClick:()=>{t({customThumbnail:""})}},"Remove")))):(0,n.createElement)(r.Button,{className:"editor-post-featured-image__toggle editor-post-featured-image__toggle",onClick:D},"Add Custom Thumbnail")),(0,n.createElement)(r.PanelBody,{title:"Player Icon",initialOpen:!0},(0,n.createElement)(r.__experimentalToggleGroupControl,{label:"Icon Type",value:C,onChange:e=>{H("iconType",e)},isBlock:!0,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0},(0,n.createElement)(r.__experimentalToggleGroupControlOption,{value:"iconPresets",label:"Icon Presets"}),(0,n.createElement)(r.__experimentalToggleGroupControlOption,{value:"custom",label:"Custom SVG"})),"iconPresets"===C&&(0,n.createElement)(y,{handlePlayerStyleChange:e=>{const t=parseInt(e.replace("style",""),10)-1;H("playButtonStyle",t)},initialStyleIndex:P.playButtonStyle,color:w,textColor:S}),"custom"===C&&!L&&!N&&(0,n.createElement)("div",{className:"drop-zone-wrapper"},N?"Dropped!":"Drop something here",(0,n.createElement)(r.DropZone,{onFilesDrop:async e=>{const t=e[0];if(t&&"image/svg+xml"===t.type){const e=new FileReader;e.onload=async e=>{let t=e.target.result;const l=await(0,h.A)(t);if(!l)return void alert("Invalid SVG content detected.");const o=l.indexOf("<svg"),n=l.lastIndexOf("</svg>")+6;-1!==o&&-1!==n&&(t=l.substring(o,n)),O(t),z(!0),await H("svgContent",t)},e.readAsText(t)}},onHTMLDrop:()=>z(!0),onDrop:()=>z(!0)})),"custom"===C&&N&&L&&(0,n.createElement)("div",{className:"svg-preview-wrapper"},(0,n.createElement)("div",{className:"svg-preview drop-zone-wrapper",dangerouslySetInnerHTML:{__html:L}}),(0,n.createElement)(r.Button,{variant:"secondary",onClick:()=>{O(""),z(!1),t({playButtonStyle:0,svgContent:""}),H("svgContent","")}},"Remove Icon")),(0,n.createElement)(i.HeightControl,{label:"Size",value:m||"64px",onChange:e=>{H("playButtonSize",e)}}),"iconPresets"===C&&(0,n.createElement)(i.PanelColorSettings,{className:"color-settings-youtubelazyload",title:"Color Settings",colorSettings:[{value:S,onChange:e=>{H("textColor",e)},label:"Play Color"},{value:w,onChange:e=>{H("color",e)},label:"Play Background Color"}]}))),(0,n.createElement)(i.BlockControls,null,(0,n.createElement)(b,{youtubeId:R,isEditing:B,setIsEditing:k})),(0,n.createElement)("div",{...(0,i.useBlockProps)(),style:{minHeight:p,"--play-background":w,"--play-icon-color":S,"--play-button-size":m}},B?(0,n.createElement)("div",{className:"lazy-load-edit-wrapper"},(0,n.createElement)("div",{className:"lazy-load__title"},"YouTube URL"),(0,n.createElement)("div",{className:"lazy-load__title__instructions"},"Paste a link to the content you want to display on your site."),(0,n.createElement)("div",{className:"lazy-load__title__input-wrapper"},(0,n.createElement)(r.TextControl,{value:o,onChange:e=>{const l=d(e);t({url:e,urlExtract:l}),I("")},placeholder:"Enter YouTube URL"}),(0,n.createElement)(r.Button,{variant:"primary",onClick:()=>{R?(k(!1),console.log("svg:",L),M&&g({url:o,quality:u,playButtonSize:m,playButtonStyle:f,color:w,textColor:S,svgContent:L,iconType:C})):I("Sorry, this content could not be embedded.")}},"Preview")),(0,n.createElement)("a",{className:"lazy-load__title__instructions text-link",href:"https://github.com/DBlocks-by-DPlugins/dblocks-lazyload-for-youtube/blob/main/embeds.md",target:"_blank"},"Learn more about embeds ",(0,n.createElement)("span",{"aria-label":"(opens in a new tab)"},"↗")),x&&(0,n.createElement)("p",{className:"lazy-load__title__instructions"},x)):R&&M?g({url:o,quality:u,playButtonSize:m,playButtonStyle:f,color:w,textColor:S,svgContent:L,iconType:C,customThumbnail:E}):null))}})}},l={};function o(e){var n=l[e];if(void 0!==n)return n.exports;var a=l[e]={exports:{}};return t[e](a,a.exports,o),a.exports}o.m=t,e=[],o.O=(t,l,n,a)=>{if(!l){var r=1/0;for(u=0;u<e.length;u++){l=e[u][0],n=e[u][1],a=e[u][2];for(var i=!0,s=0;s<l.length;s++)(!1&a||r>=a)&&Object.keys(o.O).every((e=>o.O[e](l[s])))?l.splice(s--,1):(i=!1,a<r&&(r=a));if(i){e.splice(u--,1);var c=n();void 0!==c&&(t=c)}}return t}a=a||0;for(var u=e.length;u>0&&e[u-1][2]>a;u--)e[u]=e[u-1];e[u]=[l,n,a]},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={57:0,350:0};o.O.j=t=>0===e[t];var t=(t,l)=>{var n,a,r=l[0],i=l[1],s=l[2],c=0;if(r.some((t=>0!==e[t]))){for(n in i)o.o(i,n)&&(o.m[n]=i[n]);if(s)var u=s(o)}for(t&&t(l);c<r.length;c++)a=r[c],o.o(e,a)&&e[a]&&e[a][0](),e[a]=0;return o.O(u)},l=self.webpackChunkdblocks_lazyload_for_youtube=self.webpackChunkdblocks_lazyload_for_youtube||[];l.forEach(t.bind(null,0)),l.push=t.bind(null,l.push.bind(l))})();var n=o.O(void 0,[350],(()=>o(599)));n=o.O(n)})();
  • dblocks-youtube-lazyload/trunk/dblocks-lazyload-for-youtube.php

    r3249306 r3249307  
    66 * Requires at least: 6.5.2
    77 * Requires PHP:      7.4
    8  * Version:           1.2.3
     8 * Version:           1.2.4
    99 * Author:            DPlugins
    1010 * Author URI:        https://dplugins.com/
  • dblocks-youtube-lazyload/trunk/package-lock.json

    r3226388 r3249307  
    11{
    22    "name": "dblocks-lazyload-for-youtube",
    3     "version": "1.2.2",
     3    "version": "1.2.4",
    44    "lockfileVersion": 3,
    55    "requires": true,
     
    77        "": {
    88            "name": "dblocks-lazyload-for-youtube",
    9             "version": "1.2.2",
     9            "version": "1.2.4",
    1010            "license": "GPL-2.0-or-later",
    1111            "dependencies": {
  • dblocks-youtube-lazyload/trunk/package.json

    r3226388 r3249307  
    11{
    22    "name": "dblocks-lazyload-for-youtube",
    3     "version": "1.2.2",
     3    "version": "1.2.4",
    44    "description": "Block that load YouTube video scripts only if user clicks on the play button",
    55    "author": "DPlugins",
  • dblocks-youtube-lazyload/trunk/readme.txt

    r3249306 r3249307  
    44Requires at least: 4.0
    55Tested up to: 6.7.1
    6 Stable tag: 1.2.3
     6Stable tag: 1.2.4
    77Requires PHP: 7.4
    88License: GPL-2.0-or-later
     
    6262== Changelog ==
    6363
     64= 1.2.4 =
     65* Fox for Added one more transform.
    6466
    6567= 1.2.3 =
Note: See TracChangeset for help on using the changeset viewer.