Files
2024-09-25 09:25:31 -04:00

1 line
16 KiB
JavaScript
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(window.webpackJsonp_wp_schema_pro=window.webpackJsonp_wp_schema_pro||[]).push([[8],{36:function(e,t,o){var n=o(49);e.exports=function(e,t,o){return(t=n(t))in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e},e.exports.__esModule=!0,e.exports.default=e.exports},37:function(e,t){function o(t){return e.exports=o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,o(t)}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports},39:function(e,t,o){"use strict";var n,r=function(){var e={};return function(t){if(void 0===e[t]){var o=document.querySelector(t);if(window.HTMLIFrameElement&&o instanceof window.HTMLIFrameElement)try{o=o.contentDocument.head}catch(e){o=null}e[t]=o}return e[t]}}(),a=[];function i(e){for(var t=-1,o=0;o<a.length;o++)if(a[o].identifier===e){t=o;break}return t}function s(e,t){for(var o={},n=[],r=0;r<e.length;r++){var s=e[r],c=t.base?s[0]+t.base:s[0],l=o[c]||0,p="".concat(c," ").concat(l);o[c]=l+1;var u=i(p),m={css:s[1],media:s[2],sourceMap:s[3]};-1!==u?(a[u].references++,a[u].updater(m)):a.push({identifier:p,updater:w(m,t),references:1}),n.push(p)}return n}function c(e){var t=document.createElement("style"),n=e.attributes||{};if(void 0===n.nonce){var a=o.nc;a&&(n.nonce=a)}if(Object.keys(n).forEach((function(e){t.setAttribute(e,n[e])})),"function"==typeof e.insert)e.insert(t);else{var i=r(e.insert||"head");if(!i)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");i.appendChild(t)}return t}var l,p=(l=[],function(e,t){return l[e]=t,l.filter(Boolean).join("\n")});function u(e,t,o,n){var r=o?"":n.media?"@media ".concat(n.media," {").concat(n.css,"}"):n.css;if(e.styleSheet)e.styleSheet.cssText=p(t,r);else{var a=document.createTextNode(r),i=e.childNodes;i[t]&&e.removeChild(i[t]),i.length?e.insertBefore(a,i[t]):e.appendChild(a)}}function m(e,t,o){var n=o.css,r=o.media,a=o.sourceMap;if(r?e.setAttribute("media",r):e.removeAttribute("media"),a&&"undefined"!=typeof btoa&&(n+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(a))))," */")),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}var d=null,h=0;function w(e,t){var o,n,r;if(t.singleton){var a=h++;o=d||(d=c(t)),n=u.bind(null,o,a,!1),r=u.bind(null,o,a,!0)}else o=c(t),n=m.bind(null,o,t),r=function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(o)};return n(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;n(e=t)}else r()}}e.exports=function(e,t){(t=t||{}).singleton||"boolean"==typeof t.singleton||(t.singleton=(void 0===n&&(n=Boolean(window&&document&&document.all&&!window.atob)),n));var o=s(e=e||[],t);return function(e){if(e=e||[],"[object Array]"===Object.prototype.toString.call(e)){for(var n=0;n<o.length;n++){var r=i(o[n]);a[r].references--}for(var c=s(e,t),l=0;l<o.length;l++){var p=i(o[l]);0===a[p].references&&(a[p].updater(),a.splice(p,1))}o=c}}}},40:function(e,t,o){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var o=function(e,t){var o,n,r,a=e[1]||"",i=e[3];if(!i)return a;if(t&&"function"==typeof btoa){var s=(o=i,n=btoa(unescape(encodeURIComponent(JSON.stringify(o)))),r="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(n),"/*# ".concat(r," */")),c=i.sources.map((function(e){return"/*# sourceURL=".concat(i.sourceRoot||"").concat(e," */")}));return[a].concat(c).concat([s]).join("\n")}return[a].join("\n")}(t,e);return t[2]?"@media ".concat(t[2]," {").concat(o,"}"):o})).join("")},t.i=function(e,o,n){"string"==typeof e&&(e=[[null,e,""]]);var r={};if(n)for(var a=0;a<this.length;a++){var i=this[a][0];null!=i&&(r[i]=!0)}for(var s=0;s<e.length;s++){var c=[].concat(e[s]);n&&r[c[0]]||(o&&(c[2]?c[2]="".concat(o," and ").concat(c[2]):c[2]=o),t.push(c))}},t}},49:function(e,t,o){var n=o(37).default,r=o(51);e.exports=function(e){var t=r(e,"string");return"symbol"===n(t)?t:String(t)},e.exports.__esModule=!0,e.exports.default=e.exports},51:function(e,t,o){var n=o(37).default;e.exports=function(e,t){if("object"!==n(e)||null===e)return e;var o=e[Symbol.toPrimitive];if(void 0!==o){var r=o.call(e,t||"default");if("object"!==n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports},70:function(e,t,o){(t=o(40)(!1)).push([e.i,'.editor-styles-wrapper [data-type="wpsp/how-to"] .how-to-schema-notices{background-color:#fff8e5;border-left:5px solid #ffb901;padding:8px 10px;font-size:13px;line-height:20px;color:#32373c}.editor-styles-wrapper [data-type="wpsp/how-to"] .how-to-schema-notices ul{margin:0;padding-bottom:0}.editor-styles-wrapper [data-type="wpsp/how-to"] .how-to-schema-notices h6{margin:0;font-size:inherit;line-height:inherit}.editor-styles-wrapper [data-type="wpsp/how-to"] .how-to-schema-notices p{margin:0;margin-top:15px;font-size:inherit;color:#555d66}.wp-block-wpsp-how-to .block-editor-button-block-appender{margin-top:0;margin-left:20px;width:10%}.editor-styles-wrapper .wpsp-howto__time-wrap h3,.editor-styles-wrapper .wpsp-howto__cost-wrap h3,.editor-styles-wrapper .wpsp-how-to-tools__wrap h3,.editor-styles-wrapper .wpsp-how-to-steps__wrap h3{margin-bottom:20px;margin-top:20px}.editor-styles-wrapper .wpsp-howto__time-wrap p,.editor-styles-wrapper .wpsp-howto__cost-wrap p,.editor-styles-wrapper .wpsp-how-to-tools__wrap p,.editor-styles-wrapper .wpsp-how-to-steps__wrap p{margin-top:25px}.wpsp-howto__cost-wrap{display:block}.wpsp-howto__cost-wrap .wpsp-howto-estcost-text,.wpsp-howto__cost-wrap .wpsp-howto-estcost-value,.wpsp-howto__cost-wrap .wpsp-howto-estcost-type{display:inline-flex}.wpsp-howto__time-wrap{display:block}.wpsp-howto__time-wrap .wpsp-howto-timeNeeded-text,.wpsp-howto__time-wrap .wpsp-howto-timeNeeded-value,.wpsp-howto__time-wrap .wpsp-howto-timeINmin-text{display:inline-flex}.wpsp-howto__time-wrap .wpsp-howto-timeINmin-text{margin-left:5px}',""]),e.exports=t},77:function(e,t,o){"use strict";o.r(t),o.d(t,"default",(function(){return S}));var n,r=o(36),a=o.n(r),i=o(0),s=o(4),c=o.n(s),l=o(1),p=o(8),u=o(3),m=o.n(u).a.memo((function(e){var t=e.headingTitle,o=e.headingDesc,n=e.mainimage,r=e.showTotaltime,a=e.showTools,s=e.showMaterials,c=e.timeNeeded,u=e.time,m=e.timeIn,d=e.showEstcost,h=e.estCost,w=e.cost,f=e.currencyType,b=e.tools,g=e.materials,v=e.clientId,_=[],y=Object(p.select)("core/block-editor").getBlocks(v),j=!1;y.forEach((function(e){""===e.attributes.headingDesc&&(j=!0)})),void 0!==t&&""!==t||_.push("How-To Title"),void 0!==o&&""!==o||_.push("Description"),void 0!==n.url&&null!==n.url&&""!==n.url||_.push("Image"),!0!==r||void 0!==c&&""!==c||_.push("Time Needed Label"),!0!==r||void 0!==u&&""!==u||_.push("Time"),!0!==r||void 0!==m&&""!==m||_.push("Time Unit"),!0!==d||void 0!==h&&""!==h||_.push("Total Cost Label"),!0!==d||void 0!==w&&""!==w||_.push("Cost"),!0!==d||void 0!==f&&""!==f||_.push("Currency Unit"),!0!==a||void 0!==b&&0!==b.length&&""!==b[0].add_required_tools||_.push("Tools"),!0!==s||void 0!==g&&0!==g.length&&""!==g[0].add_required_materials||_.push("Materials"),(void 0===y||2>y.length)&&_.push("Atleast 2 Steps are required"),!0===j&&_.push("The Step Description is required for each Step.");var O=_.map((function(e){return Object(i.createElement)("li",{key:e}," ",e," ")}));return Object(i.createElement)(i.Fragment,null,0!==_.length?Object(i.createElement)("div",{className:"how-to-schema-notices"},Object(i.createElement)("h6",null," ",Object(l.__)("It seems the following fields are empty. This may generate Schema errors / warnings for your Page, we recommend you to fill these fields.")," "),Object(i.createElement)("ul",{className:"how-to-schema-notices-list"},O),Object(i.createElement)("p",null,Object(l.__)("P.S. Note that this notice is visible only in the editor. This will not be visible in frontend. Also, once the required fields are added, this notice will go away.")," ",Object(i.createElement)("a",{href:"https://developers.google.com/search/docs/data-types/how-to",target:"_blank",rel:"noreferrer"},Object(l.__)("Read more.")))):"")})),d=(o(19),o(5)),h=o(2),w=o(34),f=o(39),b=o.n(f),g=o(70),v=o.n(g),_=0,y={injectType:"lazySingletonStyleTag",attributes:{id:"wpsp-editor-styles"},insert:"head",singleton:!0},j={};j.locals=v.a.locals||{},j.use=function(){return _++||(n=b()(v.a,y)),j},j.unuse=function(){_>0&&!--_&&(n(),n=null)};var O=j;function N(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,n)}return o}function x(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?N(Object(o),!0).forEach((function(t){a()(e,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):N(Object(o)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))}))}return e}var T=["wpsp/how-to-child"],E=[];function S(e){Object(u.useLayoutEffect)((function(){return O.use(),function(){O.unuse()}}),[]);var t=e=e.parentProps,o=t.className,n=t.attributes,r=t.setAttributes,s=t.insertBlocksAfter,p=t.mergeBlocks,f=t.onReplace,b=t.attributes,g=b.currencyType,v=b.timeIn,_=b.headingTag,y=b.showEstcost,j=b.showTotaltime,N=b.showMaterials,S=b.showTools,R=b.toolsTitle,C=b.materialTitle,M=b.stepsTitle,k=b.tools,I=b.materials,q=b.timeNeeded,D=b.estCost,P=b.mainimage,B=b.headingTitle,A=b.headingDesc,L=b.time,U=b.cost,z=function(e,t){for(var o=arguments.length,a=new Array(o>2?o-2:0),i=2;i<o;i++)a[i-2]=arguments[i];t&&a.push(Object(d.createBlock)("core/paragraph",{content:t})),a.length&&s&&s(a);var c=n.content;e?c!==e&&r({content:e}):f([])},F="",H="",J="";if(void 0!==n.mainimage&&null!==n.mainimage&&""!==n.mainimage&&(F=n.mainimage.url,H=n.mainimage.title),""!==F){var G=n.mainimage.sizes,K=n.imgSize;J=void 0!==G&&void 0!==G[K]?G[K].url:F}var Q="";return P&&P.url&&(Q=Object(i.createElement)("img",{className:"wpsp-howto__source-image",src:J,title:H,alt:""})),Object(i.createElement)(i.Fragment,null,Object(i.createElement)(m,{headingTitle:B,headingDesc:A,mainimage:P,showTotaltime:j,timeNeeded:q,time:L,timeIn:v,showEstcost:y,estCost:D,cost:U,currencyType:g,tools:k,materials:I,clientId:e.clientId}),Object(i.createElement)("div",{className:c()(o,"wpsp-block-".concat(e.clientId.substr(0,8)))},Object(i.createElement)("div",{className:"wpsp-how-to-main-wrap"},Object(i.createElement)(h.RichText,{tagName:_,placeholder:Object(l.__)("Configure How-to Schema In Schema Pro."),value:B,className:"wpsp-howto-heading-text",multiline:!1,onChange:function(e){r({headingTitle:e})},onMerge:p,onSplit:s?function(e,t){r({content:e});for(var o=arguments.length,n=new Array(o>2?o-2:0),a=2;a<o;a++)n[a-2]=arguments[a];s([].concat(n,[Object(d.createBlock)("core/paragraph",{content:t})]))}:void 0,onRemove:function(){return f([])}}),Object(i.createElement)(h.RichText,{tagName:"p",placeholder:Object(l.__)("So to get started, you will just need to drag-n-drop the How-to Schema block in the Gutenberg editor."),value:A,className:"wpsp-howto-desc-text",onChange:function(e){return r({headingDesc:e})},onMerge:p,onSplit:z,onRemove:function(){return f([])}}),""!==P.url&&Object(i.createElement)("div",{className:"wpsp-howto__source-wrap"}," ",Q," "),Object(i.createElement)(h.MediaUpload,{title:Object(l.__)("Select Image"),onSelect:function(e){return r({mainimage:e})},allowedTypes:["image"],value:P,render:function(e){var t=e.open;return Object(i.createElement)(w.Button,{isDefault:!0,onClick:t},P.url?Object(l.__)("Replace image"):Object(l.__)("Select Image"))}}),P.url&&Object(i.createElement)(w.Button,{className:"wpsp-rm-btn",onClick:function(){return r({mainimage:""})},isLink:!0,isDestructive:!0},Object(l.__)("Remove Image")),Object(i.createElement)("span",{className:"wpsp-howto__time-wrap"},j&&Object(i.createElement)(h.RichText,{tagName:"h4",placeholder:Object(l.__)("Total Time Needed ( Minutes ):"),value:q,className:"wpsp-howto-timeNeeded-text",onChange:function(e){return r({timeNeeded:e})},onMerge:p,onSplit:z,onRemove:function(){return f([])}}),j&&Object(i.createElement)(h.RichText,{tagName:"p",placeholder:Object(l.__)("30"),value:L,className:"wpsp-howto-timeNeeded-value",onChange:function(e){return r({time:e})},onMerge:p,onSplit:z,onRemove:function(){return f([])}}),j&&Object(i.createElement)(h.RichText,{tagName:"p",placeholder:Object(l.__)("Minutes"),value:v,className:"wpsp-howto-timeINmin-text",onChange:function(e){return r({timeIn:e})},onMerge:p,onSplit:z,onRemove:function(){return f([])}})),Object(i.createElement)("span",{className:"wpsp-howto__cost-wrap"},y&&Object(i.createElement)(h.RichText,{tagName:"h4",placeholder:Object(l.__)("Total Cost:"),value:D,className:"wpsp-howto-estcost-text",onChange:function(e){return r({estCost:e})},onMerge:p,onSplit:z,onRemove:function(){return f([])}}),y&&Object(i.createElement)(h.RichText,{tagName:"p",placeholder:Object(l.__)("30"),value:U,className:"wpsp-howto-estcost-value",onChange:function(e){return r({cost:e})},onMerge:p,onSplit:z,onRemove:function(){return f([])}}),y&&Object(i.createElement)(h.RichText,{tagName:"p",placeholder:Object(l.__)("USD"),value:g,className:"wpsp-howto-estcost-type",onChange:function(e){return r({currencyType:e})},onMerge:p,onSplit:z,onRemove:function(){return f([])}})),Object(i.createElement)("div",{className:"wpsp-how-to-tools__wrap"},S&&Object(i.createElement)(h.RichText,{tagName:"h4",placeholder:Object(l.__)("requirements tools:"),value:R,className:"wpsp-howto-req-tools-text",onChange:function(e){return r({toolsTitle:e})},onMerge:p,onSplit:z,onRemove:function(){return f([])}}),S&&Object(i.createElement)("div",{className:"wpsp-how-to-tools"},k.map((function(e,t){var o;return Object(i.createElement)("div",{className:c()("wpsp-how-to-tools-".concat(t),"wpsp-how-to-tools-child__wrapper"),key:t},Object(i.createElement)("div",{className:"wpsp-tools"},Object(i.createElement)(h.RichText,(o={tagName:"div",placeholder:Object(l.__)("Requirements Tools:"),value:e.add_required_tools,onChange:function(e){!function(e,t){var o=k.map((function(o,n){return t===n&&(o=x(x({},o),e)),o}));r({tools:o})}({add_required_tools:e},t)},className:"wpsp-tools__label"},a()(o,"placeholder",Object(l.__)("Description")),a()(o,"multiline",!1),a()(o,"allowedFormats",["core/bold","core/italic","core/strikethrough"]),o))))}))),Object(i.createElement)("div",{className:"wpsp-how-to-materials__wrap"},N&&Object(i.createElement)(h.RichText,{tagName:"h4",placeholder:Object(l.__)("requirements materials:"),value:C,className:"wpsp-howto-req-materials-text",onChange:function(e){return r({materialTitle:e})},onMerge:p,onSplit:z,onRemove:function(){return f([])}})),N&&Object(i.createElement)("div",{className:"wpsp-how-to-materials"},I.map((function(e,t){var o;return Object(i.createElement)("div",{className:c()("wpsp-how-to-materials-".concat(t),"wpsp-how-to-materials-child__wrapper"),key:t},Object(i.createElement)("div",{className:"wpsp-materials"},Object(i.createElement)(h.RichText,(o={tagName:"div",placeholder:Object(l.__)("Requirements Materials:"),value:e.add_required_materials,onChange:function(e){!function(e,t){var o=I.map((function(o,n){return t===n&&(o=x(x({},o),e)),o}));r({materials:o})}({add_required_materials:e},t)},className:"wpsp-materials__label"},a()(o,"placeholder",Object(l.__)("Description")),a()(o,"multiline",!1),a()(o,"allowedFormats",["core/bold","core/italic","core/strikethrough"]),o))))})))),Object(i.createElement)("div",{className:"wpsp-how-to-steps__wrap"},Object(i.createElement)(h.RichText,{tagName:"h4",placeholder:Object(l.__)("requirements Steps:"),value:M,className:"wpsp-howto-req-steps-text",onChange:function(e){return r({stepsTitle:e})},onMerge:p,onSplit:z,onRemove:function(){return f([])}}),Object(i.createElement)("div",{className:"wpsp-howto-steps__wrap"},Object(i.createElement)(h.InnerBlocks,{template:function(e,t){for(var o=0,n=[];o<2;)n.push(["wpsp/how-to-child",t[o]]),o+=1;return n}(0,E),allowedBlocks:T}))))))}}}]);