diff --git a/build/128.js b/build/128.js new file mode 100644 index 000000000..5c05c46ba --- /dev/null +++ b/build/128.js @@ -0,0 +1 @@ +"use strict";(self.webpackWcGzdBlocksJsonp=self.webpackWcGzdBlocksJsonp||[]).push([[128],{418:function(s,c,e){e.r(c);var l=e(236);c.default=l.Z}}]); \ No newline at end of file diff --git a/build/202.js b/build/202.js new file mode 100644 index 000000000..62899fd32 --- /dev/null +++ b/build/202.js @@ -0,0 +1 @@ +"use strict";(self.webpackWcGzdBlocksJsonp=self.webpackWcGzdBlocksJsonp||[]).push([[202],{353:function(s,c,e){e.r(c);var l=e(162);c.default=l.Z}}]); \ No newline at end of file diff --git a/build/284.js b/build/284.js new file mode 100644 index 000000000..3a26e2547 --- /dev/null +++ b/build/284.js @@ -0,0 +1 @@ +"use strict";(self.webpackWcGzdBlocksJsonp=self.webpackWcGzdBlocksJsonp||[]).push([[284],{135:function(s,c,e){e.r(c);var l=e(971);c.default=l.Z}}]); \ No newline at end of file diff --git a/build/297.js b/build/297.js new file mode 100644 index 000000000..d342008ef --- /dev/null +++ b/build/297.js @@ -0,0 +1 @@ +"use strict";(self.webpackWcGzdBlocksJsonp=self.webpackWcGzdBlocksJsonp||[]).push([[297],{984:function(s,c,e){e.r(c);var l=e(479);c.default=l.Z}}]); \ No newline at end of file diff --git a/build/412.js b/build/412.js new file mode 100644 index 000000000..65c6ce700 --- /dev/null +++ b/build/412.js @@ -0,0 +1 @@ +"use strict";(self.webpackWcGzdBlocksJsonp=self.webpackWcGzdBlocksJsonp||[]).push([[412],{757:function(s,c,e){e.r(c);var l=e(789);c.default=l.Z}}]); \ No newline at end of file diff --git a/build/518.js b/build/518.js new file mode 100644 index 000000000..b4703b2b1 --- /dev/null +++ b/build/518.js @@ -0,0 +1 @@ +"use strict";(self.webpackWcGzdBlocksJsonp=self.webpackWcGzdBlocksJsonp||[]).push([[518],{466:function(s,c,e){e.r(c);var l=e(14);c.default=l.Z}}]); \ No newline at end of file diff --git a/build/534.js b/build/534.js new file mode 100644 index 000000000..d76827c18 --- /dev/null +++ b/build/534.js @@ -0,0 +1 @@ +"use strict";(self.webpackWcGzdBlocksJsonp=self.webpackWcGzdBlocksJsonp||[]).push([[534],{41:function(s,c,e){e.r(c);var l=e(369);c.default=l.Z}}]); \ No newline at end of file diff --git a/build/545.js b/build/545.js new file mode 100644 index 000000000..0ff122e6b --- /dev/null +++ b/build/545.js @@ -0,0 +1 @@ +"use strict";(self.webpackWcGzdBlocksJsonp=self.webpackWcGzdBlocksJsonp||[]).push([[545],{899:function(s,c,e){e.r(c);var l=e(629);c.default=l.Z}}]); \ No newline at end of file diff --git a/build/6.js b/build/6.js new file mode 100644 index 000000000..f4dde39a4 --- /dev/null +++ b/build/6.js @@ -0,0 +1 @@ +"use strict";(self.webpackWcGzdBlocksJsonp=self.webpackWcGzdBlocksJsonp||[]).push([[6],{862:function(s,c,e){e.r(c);var l=e(140);c.default=l.Z}}]); \ No newline at end of file diff --git a/build/648.js b/build/648.js new file mode 100644 index 000000000..60e55b9c4 --- /dev/null +++ b/build/648.js @@ -0,0 +1 @@ +"use strict";(self.webpackWcGzdBlocksJsonp=self.webpackWcGzdBlocksJsonp||[]).push([[648],{949:function(s,c,e){e.r(c);var l=e(38);c.default=l.Z}}]); \ No newline at end of file diff --git a/build/700-frontend.js b/build/700-frontend.js new file mode 100644 index 000000000..04b032afd --- /dev/null +++ b/build/700-frontend.js @@ -0,0 +1 @@ +(self.webpackWcBlocksJsonp=self.webpackWcBlocksJsonp||[]).push([[700],{83:function(t,e,r){"use strict";r.d(e,{R:function(){return v}});var n=r(857);const o="var:",a="|",i="--",s=(t,e)=>{let r=t;return e.forEach((t=>{r=r?.[t]})),r};function u(t,e,r,n){const o=s(t,r);return o?[{selector:e?.selector,key:n,value:c(o)}]:[]}function l(t,e,r,n,o=["top","right","bottom","left"]){const a=s(t,r);if(!a)return[];const i=[];if("string"==typeof a)i.push({selector:e?.selector,key:n.default,value:a});else{const t=o.reduce(((t,r)=>{const o=c(s(a,[r]));return o&&t.push({selector:e?.selector,key:n?.individual.replace("%s",p(r)),value:o}),t}),[]);i.push(...t)}return i}function c(t){return"string"==typeof t&&t.startsWith(o)?`var(--wp--${t.slice(o.length).split(a).map((t=>(0,n.o)(t,{splitRegexp:[/([a-z0-9])([A-Z])/g,/([0-9])([a-z])/g,/([A-Za-z])([0-9])/g,/([A-Z])([A-Z][a-z])/g]}))).join(i)})`:t}function p(t){const[e,...r]=t;return e.toUpperCase()+r.join("")}function f(t){try{return decodeURI(t)}catch(e){return t}}function g(t){return(e,r)=>u(e,r,t,function(t){const[e,...r]=t;return e.toLowerCase()+r.map(p).join("")}(t))}function h(t){return(e,r)=>["color","style","width"].flatMap((n=>g(["border",t,n])(e,r)))}const m={name:"radius",generate:(t,e)=>l(t,e,["border","radius"],{default:"borderRadius",individual:"border%sRadius"},["topLeft","topRight","bottomLeft","bottomRight"])},d=[{name:"color",generate:g(["border","color"])},{name:"style",generate:g(["border","style"])},{name:"width",generate:g(["border","width"])},m,{name:"borderTop",generate:h("top")},{name:"borderRight",generate:h("right")},{name:"borderBottom",generate:h("bottom")},{name:"borderLeft",generate:h("left")},{name:"text",generate:(t,e)=>u(t,e,["color","text"],"color")},{name:"gradient",generate:(t,e)=>u(t,e,["color","gradient"],"background")},{name:"background",generate:(t,e)=>u(t,e,["color","background"],"backgroundColor")},{name:"minHeight",generate:(t,e)=>u(t,e,["dimensions","minHeight"],"minHeight")},{name:"color",generate:(t,e,r=["outline","color"],n="outlineColor")=>u(t,e,r,n)},{name:"style",generate:(t,e,r=["outline","style"],n="outlineStyle")=>u(t,e,r,n)},{name:"offset",generate:(t,e,r=["outline","offset"],n="outlineOffset")=>u(t,e,r,n)},{name:"width",generate:(t,e,r=["outline","width"],n="outlineWidth")=>u(t,e,r,n)},{name:"margin",generate:(t,e)=>l(t,e,["spacing","margin"],{default:"margin",individual:"margin%s"})},{name:"padding",generate:(t,e)=>l(t,e,["spacing","padding"],{default:"padding",individual:"padding%s"})},{name:"fontFamily",generate:(t,e)=>u(t,e,["typography","fontFamily"],"fontFamily")},{name:"fontSize",generate:(t,e)=>u(t,e,["typography","fontSize"],"fontSize")},{name:"fontStyle",generate:(t,e)=>u(t,e,["typography","fontStyle"],"fontStyle")},{name:"fontWeight",generate:(t,e)=>u(t,e,["typography","fontWeight"],"fontWeight")},{name:"letterSpacing",generate:(t,e)=>u(t,e,["typography","letterSpacing"],"letterSpacing")},{name:"lineHeight",generate:(t,e)=>u(t,e,["typography","lineHeight"],"lineHeight")},{name:"textColumns",generate:(t,e)=>u(t,e,["typography","textColumns"],"columnCount")},{name:"textDecoration",generate:(t,e)=>u(t,e,["typography","textDecoration"],"textDecoration")},{name:"textTransform",generate:(t,e)=>u(t,e,["typography","textTransform"],"textTransform")},{name:"writingMode",generate:(t,e)=>u(t,e,["typography","writingMode"],"writingMode")},{name:"shadow",generate:(t,e)=>u(t,e,["shadow"],"boxShadow")},{name:"backgroundImage",generate:(t,e)=>{const r=t?.background?.backgroundImage,n=t?.background?.backgroundSize,o=[];return r?("file"===r?.source&&r?.url&&o.push({selector:e.selector,key:"backgroundImage",value:`url( '${encodeURI(f(r.url))}' )`}),n||o.push({selector:e.selector,key:"backgroundSize",value:"cover"}),o):o}}];function v(t,e={}){const r=[];return d.forEach((n=>{"function"==typeof n.generate&&r.push(...n.generate(t,e))})),r}},184:function(t,e){var r;!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var t=[],e=0;el&&("#"!==s[p]||!i(t[p]));)p-=1;return!i(t[f])||"left"===r&&e!==l||e-p=i?n+=p("0",a-i):n=(n.substring(0,a)||"0")+"."+n.substring(a),e+n}(u),f=!0),"Infinity"===u&&f&&(u=""),f&&!r&&"number"==typeof n&&(u=function(t,e,r){if(-1!==["","-"].indexOf(t))return t;var n=-1!==t.indexOf(".")&&e,o=l(t),a=o.beforeDecimal,i=o.afterDecimal,s=o.hasNagation,u=parseFloat("0."+(i||"0")),p=(i.length<=e?"0."+i:u.toFixed(e)).split(".");return(s?"-":"")+a.split("").reverse().reduce((function(t,e,r){return t.length>r?(Number(t[0])+Number(e)).toString()+t.substring(1,t.length):e+t}),p[0])+(n?".":"")+c(p[1]||"",Math.min(e,i.length),r)}(u,n,o)),f?this.formatNumString(u):this.formatInput(u))},e.prototype.formatNegation=function(t){void 0===t&&(t="");var e=this.props.allowNegative,r=new RegExp("(-)"),n=new RegExp("(-)(.)*(-)"),o=r.test(t),a=n.test(t);return t=t.replace(/-/g,""),o&&!a&&e&&(t="-"+t),t},e.prototype.formatInput=function(t){return void 0===t&&(t=""),this.props.format||(t=this.removePrefixAndSuffix(t),t=this.formatNegation(t)),t=this.removeFormatting(t),this.formatNumString(t)},e.prototype.isCharacterAFormat=function(t,e){var r=this.props,n=r.format,o=r.prefix,a=r.suffix,i=r.decimalScale,s=r.fixedDecimalScale,u=this.getSeparators().decimalSeparator;return"string"==typeof n&&"#"!==n[t]||!(n||!(t=e.length-a.length||i&&s&&e[t]===u))},e.prototype.correctInputValue=function(t,e,r){var n=this,o=this.props,a=o.format,i=o.allowNegative,s=o.prefix,u=o.suffix,c=o.decimalScale,p=this.getSeparators(),f=p.allowedDecimalSeparators,g=p.decimalSeparator,h=this.state.numAsString||"",m=this.selectionBeforeInput,d=m.selectionStart,v=m.selectionEnd,y=function(t,e){for(var r=0,n=0,o=t.length,a=e.length;t[r]===e[r]&&rr&&o-n>r;)n++;return{start:r,end:o-n}}(e,r),S=y.start,b=y.end;if(!a&&S===b&&-1!==f.indexOf(r[d])){var x=0===c?"":g;return r.substr(0,d)+x+r.substr(d+1,r.length)}var w=a?0:s.length,P=e.length-(a?0:u.length);if(r.length>e.length||!r.length||S===b||0===d&&v===e.length||0===S&&b===e.length||d===w&&v===P)return r;var N=e.substr(S,b-S);if([].concat(N).find((function(t,r){return n.isCharacterAFormat(r+S,e)}))){var A=e.substr(S),C={},F=[];[].concat(A).forEach((function(t,r){n.isCharacterAFormat(r+S,e)?C[r]=t:r>N.length-1&&F.push(t)})),Object.keys(C).forEach((function(t){F.length>t?F.splice(t,0,C[t]):F.push(C[t])})),r=e.substr(0,S)+F.join("")}if(!a){var D=this.removeFormatting(r),O=l(D,i),E=O.beforeDecimal,R=O.afterDecimal,k=O.addNegation,j=tS;)y--;y=this.correctCaretPosition(i,y,"left")}}else for(;!m.test(i[y])&&yb)&&(t.preventDefault(),this.setPatchedCaretPosition(r,y,i)),t.isUnitTestRun&&this.setPatchedCaretPosition(r,y,i),g(t)}else g(t)},e.prototype.onMouseUp=function(t){var e=t.target,r=e.selectionStart,n=e.selectionEnd,o=e.value;if(void 0===o&&(o=""),r===n){var a=this.correctCaretPosition(o,r);a!==r&&this.setPatchedCaretPosition(e,a,o)}this.props.onMouseUp(t)},e.prototype.onFocus=function(t){var e=this;t.persist(),this.focusedElm=t.target,this.focusTimeout=setTimeout((function(){var r=t.target,n=r.selectionStart,o=r.selectionEnd,a=r.value;void 0===a&&(a="");var i=e.correctCaretPosition(a,n);i===n||0===n&&o===a.length||e.setPatchedCaretPosition(r,i,a),e.props.onFocus(t)}),0)},e.prototype.render=function(){var t=this.props,e=t.type,r=t.displayType,n=t.customInput,a=t.renderText,i=t.getInputRef,s=t.format,u=(t.thousandSeparator,t.decimalSeparator,t.allowedDecimalSeparators,t.thousandsGroupStyle,t.decimalScale,t.fixedDecimalScale,t.prefix,t.suffix,t.removeFormatting,t.mask,t.defaultValue,t.isNumericString,t.allowNegative,t.allowEmptyFormatting,t.allowLeadingZeros,t.onValueChange,t.isAllowed,t.customNumerals,t.onChange,t.onKeyDown,t.onMouseUp,t.onFocus,t.onBlur,t.value,function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&-1===e.indexOf(n)&&(r[n]=t[n]);return r}(t,["type","displayType","customInput","renderText","getInputRef","format","thousandSeparator","decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","decimalScale","fixedDecimalScale","prefix","suffix","removeFormatting","mask","defaultValue","isNumericString","allowNegative","allowEmptyFormatting","allowLeadingZeros","onValueChange","isAllowed","customNumerals","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value"])),l=this.state,c=l.value,p=l.mounted&&function(t){return t||"undefined"!=typeof navigator&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}(s)?"numeric":void 0,f=Object.assign({inputMode:p},u,{type:e,value:c,onChange:this.onChange,onKeyDown:this.onKeyDown,onMouseUp:this.onMouseUp,onFocus:this.onFocus,onBlur:this.onBlur});if("text"===r)return a?a(c,u)||null:o().createElement("span",Object.assign({},u,{ref:i}),c);if(n){var g=n;return o().createElement(g,Object.assign({},f,{ref:i}))}return o().createElement("input",Object.assign({},f,{ref:i}))},e}(o().Component);d.defaultProps=m,e.Z=d}}]); \ No newline at end of file diff --git a/build/710.js b/build/710.js new file mode 100644 index 000000000..5cfa5db60 --- /dev/null +++ b/build/710.js @@ -0,0 +1 @@ +"use strict";(self.webpackWcGzdBlocksJsonp=self.webpackWcGzdBlocksJsonp||[]).push([[710],{944:function(s,c,e){e.r(c);var l=e(567);c.default=l.Z}}]); \ No newline at end of file diff --git a/build/92.js b/build/92.js new file mode 100644 index 000000000..f4e0498a1 --- /dev/null +++ b/build/92.js @@ -0,0 +1 @@ +"use strict";(self.webpackWcGzdBlocksJsonp=self.webpackWcGzdBlocksJsonp||[]).push([[92],{313:function(s,c,e){e.r(c);var l=e(663);c.default=l.Z}}]); \ No newline at end of file diff --git a/build/cart-frontend.asset.php b/build/cart-frontend.asset.php new file mode 100644 index 000000000..7df80552a --- /dev/null +++ b/build/cart-frontend.asset.php @@ -0,0 +1 @@ + array('wc-blocks-checkout', 'wp-element'), 'version' => '74e3b05a07a5e07d2df1'); diff --git a/build/cart-frontend.js b/build/cart-frontend.js new file mode 100644 index 000000000..0ee5988d1 --- /dev/null +++ b/build/cart-frontend.js @@ -0,0 +1 @@ +!function(){var t={528:function(){}},n={};function o(r){var e=n[r];if(void 0!==e)return e.exports;var i=n[r]={exports:{}};return t[r](i,i.exports,o),i.exports}!function(){"use strict";window.wc.blocksCheckout,window.wp.element,o(528)}()}(); \ No newline at end of file diff --git a/build/cart-style.asset.php b/build/cart-style.asset.php new file mode 100644 index 000000000..c54edae2f --- /dev/null +++ b/build/cart-style.asset.php @@ -0,0 +1 @@ + array('react', 'wc-blocks-checkout', 'wc-gzd-blocks-settings', 'wp-element', 'wp-plugins'), 'version' => '9b621d847c88d2d7312b'); diff --git a/build/cart.asset.php b/build/cart.asset.php new file mode 100644 index 000000000..3ea4134f2 --- /dev/null +++ b/build/cart.asset.php @@ -0,0 +1 @@ + array('react', 'wc-blocks-checkout', 'wc-gzd-blocks-settings', 'wp-element', 'wp-plugins'), 'version' => 'a10d639dd5c4e6a126bf'); diff --git a/build/cart.css b/build/cart.css new file mode 100644 index 000000000..9c0a7351d --- /dev/null +++ b/build/cart.css @@ -0,0 +1 @@ +.wc-block-components-product-metadata ul.wc-block-components-product-details:first-child{display:flex;flex-direction:column}.wc-block-components-product-metadata ul.wc-block-components-product-details:first-child li{order:950}.wc-block-components-product-metadata ul.wc-block-components-product-details:first-child li[class*=wc-block-components-product-details__gzd-]{order:90;width:120%}.wc-block-components-product-metadata ul.wc-block-components-product-details:first-child li.wc-block-components-product-details__gzd-unit-price{order:0}.wc-block-components-product-metadata ul.wc-block-components-product-details:first-child li.wc-block-components-product-details__gzd-deposit-packaging-type{order:5;font-weight:bold;text-transform:uppercase}.wc-block-components-product-metadata ul.wc-block-components-product-details:first-child li.wc-block-components-product-details__gzd-deposit{order:10}.wc-block-components-product-metadata ul.wc-block-components-product-details:first-child li.wc-block-components-product-details__gzd-differential-taxation{order:10}.wc-block-components-product-metadata ul.wc-block-components-product-details:first-child li.wc-block-components-product-details__gzd-delivery-time{order:20}.wc-block-components-product-metadata ul.wc-block-components-product-details:first-child li.wc-block-components-product-details__gzd-item-desc{order:100}.wc-block-components-product-metadata ul.wc-block-components-product-details:first-child li.wc-gzd-summary-item-last{margin-bottom:1em}ul.wc-block-components-product-details li[class*=wc-block-components-product-details__gzd-] .wc-block-components-product-details__name{display:none}ul.wc-block-components-product-details li[class*=wc-block-components-product-details__gzd-] .wc-block-components-product-details__value{font-size:.8rem;color:#757575}.wc-gzd-small-business-info{font-size:.8rem;color:#757575}ul.wc-block-components-product-details li.wc-not-gzd-summary-item-first{margin-top:1em} diff --git a/build/cart.js b/build/cart.js new file mode 100644 index 000000000..9f859058d --- /dev/null +++ b/build/cart.js @@ -0,0 +1 @@ +!function(){"use strict";var e,t={750:function(e,t,n){n.r(t);var o=window.React,r=window.wc.blocksCheckout,c=window.wp.plugins,s=window.wp.element,l=window.wcGzd.blocks.wcGzdBlocksSettings,i=({extensions:e,cart:t})=>(0,l.getSetting)("isSmallBusiness")&&(0,l.getSetting)("smallBusinessNotice")?(0,o.createElement)("div",{className:"wc-gzd-small-business-info",dangerouslySetInnerHTML:{__html:(0,l.getSetting)("smallBusinessNotice")}}):null;const a=({extensions:e,cart:t})=>((0,s.useEffect)((()=>{const e=document.getElementsByClassName("wc-block-cart-items__row");for(let t of e){const e=t.querySelectorAll("li:not([class*=__gzd])")[0];e&&e.classList.add("wc-not-gzd-summary-item-first")}}),[t.cartItems]),null);(0,c.registerPlugin)("woocommerce-germanized-cart",{render:()=>(0,o.createElement)(r.ExperimentalOrderMeta,null,(0,o.createElement)(a,null),(0,o.createElement)(i,null)),scope:"woocommerce-checkout"})}},n={};function o(e){var r=n[e];if(void 0!==r)return r.exports;var c=n[e]={exports:{}};return t[e](c,c.exports,o),c.exports}o.m=t,e=[],o.O=function(t,n,r,c){if(!n){var s=1/0;for(u=0;u=c)&&Object.keys(o.O).every((function(e){return o.O[e](n[i])}))?n.splice(i--,1):(l=!1,c0&&e[u-1][2]>c;u--)e[u]=e[u-1];e[u]=[n,r,c]},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},function(){var e={511:0,378:0};o.O.j=function(t){return 0===e[t]};var t=function(t,n){var r,c,s=n[0],l=n[1],i=n[2],a=0;if(s.some((function(t){return 0!==e[t]}))){for(r in l)o.o(l,r)&&(o.m[r]=l[r]);if(i)var u=i(o)}for(t&&t(n);a{const[r,s]=(0,o.useState)(!0),[l,h]=(0,o.useState)("");let u="";if(a)h(a),s(!1);else if(t)try{const e=new URL(t);u=t.toString().substring(e.origin.length)}catch{}return(0,o.useEffect)((()=>{e?document.body.classList.add("checkout-modal-open"):document.body.classList.remove("checkout-modal-open"),u&&(s(!0),h(""),fetch(u,{method:"get"}).then((e=>e.text())).then((e=>{h(e),s(!1)})).catch((function(e){s(!1)})))}),[u,h,e]),e?(0,n.createElement)(n.Fragment,null,(0,n.createElement)("div",{className:"wc-gzd-checkout-modal-bg"}),(0,n.createElement)("div",{className:"wc-gzd-checkout-modal-wrapper"},(0,n.createElement)("div",{className:"wc-gzd-checkout-modal"},(0,n.createElement)("div",{className:"actions"},(0,n.createElement)("a",{className:"wc-gzd-checkout-modal-close",onClick:e=>{document.body.classList.remove("checkout-modal-open"),c(e)}},(0,n.createElement)(d,{className:"wc-gzd-checkout-modal-close-icon",icon:i,size:24}))),r?(0,n.createElement)("div",{className:"content is-loading"},(0,n.createElement)("span",{className:"wc-block-components-spinner","aria-hidden":"true"})):(0,n.createElement)(n.Fragment,null,(0,n.createElement)("div",{className:"content",dangerouslySetInnerHTML:{__html:l}}))))):null},u=c(184),m=c.n(u),k=c(818),b=c(801),g=({checkbox:e,setShowModal:t,setModalUrl:c,onChangeCheckbox:r})=>{const s="checkbox-"+e.id,{setValidationErrors:d,clearValidationError:l}=(0,k.useDispatch)(b.VALIDATION_STORE_KEY),i=!!e.hidden&&e.hidden,h=(0,k.useSelect)((e=>e(b.VALIDATION_STORE_KEY).getValidationError(s))),u=!(!h?.message||h?.hidden);(0,o.useEffect)((()=>{if(e.has_checkbox)return!0===e.checked||!0===e.hidden?l(s):e.is_required&&d({[s]:{message:e.error_message,hidden:!0}}),()=>{l(s)}}),[e.is_required,e.checked,e.hidden,s,l,d]);const g={id:`checkbox-${e.html_id}`,className:"wc-gzd-checkbox",name:`${e.name}`,checked:!!e.checked,hasError:e.is_required&&u,required:e.is_required};return i?null:(0,n.createElement)("div",{className:m()(`wc-gzd-block-checkout-checkboxes__${e.id}`,Object.values(e.wrapper_classes).join(" ")),key:`wrapper-${e.id}`},e.has_checkbox?(0,n.createElement)(n.Fragment,null,(0,n.createElement)(a.CheckboxControl,{key:`checkbox-${e.id}`,...g,onChange:t=>{r({...e,checked:t})}},(0,n.createElement)("span",{onClick:e=>{const n=e.target.closest("a");if(n&&e.currentTarget.contains(n)&&n.classList.contains("wc-gzd-modal")){e.stopPropagation(),e.preventDefault();let o=n.getAttribute("href");o&&(c(o),t(!0))}},dangerouslySetInnerHTML:{__html:e.label}}))):(0,n.createElement)("div",{className:"wc-gzd-checkbox has-no-checkbox"},(0,n.createElement)("span",{dangerouslySetInnerHTML:{__html:e.label}})))},p=c(617),_=e=>{const{onChangeCheckbox:t,checkbox:c}=e,{shouldCreateAccount:a,customerId:r}=(0,k.useSelect)((e=>{const t=e(b.CHECKOUT_STORE_KEY);return{customerId:t.getCustomerId(),shouldCreateAccount:t.getShouldCreateAccount()}})),s=!1===(0,p.getSetting)("checkoutAllowsGuest",!1)&&!r;return(0,o.useEffect)((()=>{t(a||s?{...c,hidden:!1}:{...c,hidden:!0})}),[a]),(0,n.createElement)(g,{...e})},E=e=>{const[t,c]=(0,o.useState)({}),{onChangeCheckbox:a,checkbox:r}=e,{billingAddress:s,paymentData:d,currentPaymentMethod:l}=(0,k.useSelect)((e=>{const t=e(b.CART_STORE_KEY),c=e(b.PAYMENT_STORE_KEY);return{billingAddress:t.getCartData().billingAddress,paymentData:c.getPaymentMethodData(),currentPaymentMethod:c.getActivePaymentMethod()}}));return(0,o.useEffect)((()=>{const e={country:s.country,postcode:s.postcode,city:s.city,street:s.address_1,address_2:s.address_2,account_holder:d.hasOwnProperty("direct_debit_account_holder")?d.direct_debit_account_holder:"",account_iban:d.hasOwnProperty("direct_debit_account_iban")?d.direct_debit_account_iban:"",account_swift:d.hasOwnProperty("direct_debit_account_bic")?d.direct_debit_account_bic:""};c(e),a("direct-debit"===l&&e.account_holder&&e.account_iban&&e.account_swift?{...r,hidden:!1}:{...r,hidden:!0})}),[s,d,l]),(0,n.createElement)(g,{...e,setModalUrl:c=>{c+="&"+new URLSearchParams(t).toString(),e.setModalUrl(c)}})},f=({children:e,checkoutExtensionData:t,extensions:c,cart:r})=>{const[d,l]=(0,o.useState)(!1),{setExtensionData:i}=t,u=c.hasOwnProperty("woocommerce-germanized")?c["woocommerce-germanized"]:{},m=u.hasOwnProperty("checkboxes")?u.checkboxes:[],k=m.reduce(((e,t)=>({...e,[t.id]:{...t,hidden:t.default_hidden,checked:t.default_checked}})),{}),[b,p]=(0,o.useState)(k),[f,w]=(0,o.useState)(""),x=(0,o.useRef)(!1),y=e=>Object.values(e).filter((e=>e.checked||!e.has_checkbox&&!e.hidden?e:null));(0,o.useEffect)((()=>{i("woocommerce-germanized","checkboxes",y(b))}),[b]);const C=(0,o.useCallback)((e=>{p((t=>{const c=t&&t.hasOwnProperty(e.id)&&t[e.id].checked!==e.checked,n={...t,[e.id]:{...e}};return c&&(0,a.extensionCartUpdate)({namespace:"woocommerce-germanized-checkboxes",data:{checkboxes:y(n)}}),n}))}),[i,b,p,a.extensionCartUpdate]);return(0,o.useEffect)((()=>{if(x.current){let e={};Object.keys(k).map((t=>{const c=b.hasOwnProperty(t)?{checked:b[t].checked,hidden:b[t].hidden}:{};e[t]={...k[t],...c}})),s().isEqual(e,b)||p(e)}x.current=!0}),[m]),(0,n.createElement)("div",{className:"wc-gzd-checkboxes"},(0,n.createElement)(h,{show:d,url:f,onClose:()=>{l(!1)}}),Object.keys(b).map((e=>{const t={...b[e]};return"sepa"===t.id?(0,n.createElement)(E,{checkbox:t,setShowModal:l,setModalUrl:w,key:t.id,onChangeCheckbox:C}):"privacy"===t.id?(0,n.createElement)(_,{checkbox:t,setShowModal:l,setModalUrl:w,key:t.id,onChangeCheckbox:C}):(0,n.createElement)(g,{checkbox:t,setShowModal:l,setModalUrl:w,key:t.id,onChangeCheckbox:C})})))}},184:function(e,t){var c;!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e=[],t=0;t{const[s,d]=(0,o.useState)(!0),[i,u]=(0,o.useState)("");let h="";if(a)u(a),d(!1);else if(t)try{const e=new URL(t);h=t.toString().substring(e.origin.length)}catch{}return(0,o.useEffect)((()=>{e?document.body.classList.add("checkout-modal-open"):document.body.classList.remove("checkout-modal-open"),h&&(d(!0),u(""),fetch(h,{method:"get"}).then((e=>e.text())).then((e=>{u(e),d(!1)})).catch((function(e){d(!1)})))}),[h,u,e]),e?(0,n.createElement)(n.Fragment,null,(0,n.createElement)("div",{className:"wc-gzd-checkout-modal-bg"}),(0,n.createElement)("div",{className:"wc-gzd-checkout-modal-wrapper"},(0,n.createElement)("div",{className:"wc-gzd-checkout-modal"},(0,n.createElement)("div",{className:"actions"},(0,n.createElement)("a",{className:"wc-gzd-checkout-modal-close",onClick:e=>{document.body.classList.remove("checkout-modal-open"),c(e)}},(0,n.createElement)(r.Z,{className:"wc-gzd-checkout-modal-close-icon",icon:l.Z,size:24}))),s?(0,n.createElement)("div",{className:"content is-loading"},(0,n.createElement)("span",{className:"wc-block-components-spinner","aria-hidden":"true"})):(0,n.createElement)(n.Fragment,null,(0,n.createElement)("div",{className:"content",dangerouslySetInnerHTML:{__html:i}}))))):null},u=c(6342),h=c(9818),m=c(4801),k=c(4617),b=e=>{const{onChangeCheckbox:t,checkbox:c}=e,{shouldCreateAccount:a,customerId:s}=(0,h.useSelect)((e=>{const t=e(m.CHECKOUT_STORE_KEY);return{customerId:t.getCustomerId(),shouldCreateAccount:t.getShouldCreateAccount()}})),d=!1===(0,k.getSetting)("checkoutAllowsGuest",!1)&&!s;return(0,o.useEffect)((()=>{t(a||d?{...c,hidden:!1}:{...c,hidden:!0})}),[a]),(0,n.createElement)(u.Z,{...e})},_=e=>{const[t,c]=(0,o.useState)({}),{onChangeCheckbox:a,checkbox:s}=e,{billingAddress:d,paymentData:r,currentPaymentMethod:l}=(0,h.useSelect)((e=>{const t=e(m.CART_STORE_KEY),c=e(m.PAYMENT_STORE_KEY);return{billingAddress:t.getCartData().billingAddress,paymentData:c.getPaymentMethodData(),currentPaymentMethod:c.getActivePaymentMethod()}}));return(0,o.useEffect)((()=>{const e={country:d.country,postcode:d.postcode,city:d.city,street:d.address_1,address_2:d.address_2,account_holder:r.hasOwnProperty("direct_debit_account_holder")?r.direct_debit_account_holder:"",account_iban:r.hasOwnProperty("direct_debit_account_iban")?r.direct_debit_account_iban:"",account_swift:r.hasOwnProperty("direct_debit_account_bic")?r.direct_debit_account_bic:""};c(e),a("direct-debit"===l&&e.account_holder&&e.account_iban&&e.account_swift?{...s,hidden:!1}:{...s,hidden:!0})}),[d,r,l]),(0,n.createElement)(u.Z,{...e,setModalUrl:c=>{c+="&"+new URLSearchParams(t).toString(),e.setModalUrl(c)}})},g=({children:e,checkoutExtensionData:t,extensions:c,cart:s})=>{const[r,l]=(0,o.useState)(!1),{setExtensionData:h}=t,m=c.hasOwnProperty("woocommerce-germanized")?c["woocommerce-germanized"]:{},k=m.hasOwnProperty("checkboxes")?m.checkboxes:[],g=k.reduce(((e,t)=>({...e,[t.id]:{...t,hidden:t.default_hidden,checked:t.default_checked}})),{}),[E,p]=(0,o.useState)(g),[w,y]=(0,o.useState)(""),f=(0,o.useRef)(!1),C=e=>Object.values(e).filter((e=>e.checked||!e.has_checkbox&&!e.hidden?e:null));(0,o.useEffect)((()=>{h("woocommerce-germanized","checkboxes",C(E))}),[E]);const x=(0,o.useCallback)((e=>{p((t=>{const c=t&&t.hasOwnProperty(e.id)&&t[e.id].checked!==e.checked,n={...t,[e.id]:{...e}};return c&&(0,a.extensionCartUpdate)({namespace:"woocommerce-germanized-checkboxes",data:{checkboxes:C(n)}}),n}))}),[h,E,p,a.extensionCartUpdate]);return(0,o.useEffect)((()=>{if(f.current){let e={};Object.keys(g).map((t=>{const c=E.hasOwnProperty(t)?{checked:E[t].checked,hidden:E[t].hidden}:{};e[t]={...g[t],...c}})),d().isEqual(e,E)||p(e)}f.current=!0}),[k]),(0,n.createElement)("div",{className:"wc-gzd-checkboxes"},(0,n.createElement)(i,{show:r,url:w,onClose:()=>{l(!1)}}),Object.keys(E).map((e=>{const t={...E[e]};return"sepa"===t.id?(0,n.createElement)(_,{checkbox:t,setShowModal:l,setModalUrl:y,key:t.id,onChangeCheckbox:x}):"privacy"===t.id?(0,n.createElement)(b,{checkbox:t,setShowModal:l,setModalUrl:y,key:t.id,onChangeCheckbox:x}):(0,n.createElement)(u.Z,{checkbox:t,setShowModal:l,setModalUrl:y,key:t.id,onChangeCheckbox:x})})))}}}]); \ No newline at end of file diff --git a/build/checkout-blocks/checkout-photovoltaic-system-notice-frontend.js b/build/checkout-blocks/checkout-photovoltaic-system-notice-frontend.js new file mode 100644 index 000000000..e572c7a23 --- /dev/null +++ b/build/checkout-blocks/checkout-photovoltaic-system-notice-frontend.js @@ -0,0 +1 @@ +"use strict";(self.webpackWcBlocksJsonp=self.webpackWcBlocksJsonp||[]).push([[86],{367:function(e,t,o){o.r(t),o.d(t,{default:function(){return r}});var c=o(196),n=o(307),a=(o(813),o(736)),r=({text:e,title:t,children:o,checkoutExtensionData:r,extensions:s,cart:i})=>{const[l,m]=(0,n.useState)(!1),p=s.hasOwnProperty("woocommerce-germanized")?s["woocommerce-germanized"]:{},_=p.applies_for_photovoltaic_system_vat_exempt,f=p.photovoltaic_system_law_details;if((0,n.useEffect)((()=>{m(!!_)}),[_,m]),!l)return null;const h=e?e.replace("{legal_text}",(0,a.sprintf)('%s',f.url,f.text)):(0,a.sprintf)((0,a.__)('To benefit from the tax exemption, please confirm the VAT exemption according to %2$s by activating the checkbox.',"woocommerce-germanized"),f.url,f.text),u=t||(0,a.__)("Your shopping cart is eligible for VAT exemption","woocommerce-germanized");return(0,c.createElement)("div",{className:"wc-gzd-block-checkout__photovoltaic-system-notice wc-block-components-notice-banner is-info"},(0,c.createElement)("h2",{className:"wc-block-components-title",dangerouslySetInnerHTML:{__html:u}}),(0,c.createElement)("p",{dangerouslySetInnerHTML:{__html:h}}))}}}]); \ No newline at end of file diff --git a/build/checkout-blocks/checkout-photovoltaic-system-notice-style.js b/build/checkout-blocks/checkout-photovoltaic-system-notice-style.js new file mode 100644 index 000000000..68cb99edc --- /dev/null +++ b/build/checkout-blocks/checkout-photovoltaic-system-notice-style.js @@ -0,0 +1 @@ +"use strict";(self.webpackWcGzdBlocksJsonp=self.webpackWcGzdBlocksJsonp||[]).push([[86],{7367:function(e,t,o){o.r(t),o.d(t,{default:function(){return r}});var c=o(9196),n=o(9307),a=(o(1813),o(5736)),r=({text:e,title:t,children:o,checkoutExtensionData:r,extensions:s,cart:i})=>{const[l,m]=(0,n.useState)(!1),p=s.hasOwnProperty("woocommerce-germanized")?s["woocommerce-germanized"]:{},_=p.applies_for_photovoltaic_system_vat_exempt,f=p.photovoltaic_system_law_details;if((0,n.useEffect)((()=>{m(!!_)}),[_,m]),!l)return null;const h=e?e.replace("{legal_text}",(0,a.sprintf)('%s',f.url,f.text)):(0,a.sprintf)((0,a.__)('To benefit from the tax exemption, please confirm the VAT exemption according to %2$s by activating the checkbox.',"woocommerce-germanized"),f.url,f.text),u=t||(0,a.__)("Your shopping cart is eligible for VAT exemption","woocommerce-germanized");return(0,c.createElement)("div",{className:"wc-gzd-block-checkout__photovoltaic-system-notice wc-block-components-notice-banner is-info"},(0,c.createElement)("h2",{className:"wc-block-components-title",dangerouslySetInnerHTML:{__html:u}}),(0,c.createElement)("p",{dangerouslySetInnerHTML:{__html:h}}))}}}]); \ No newline at end of file diff --git a/build/checkout-frontend.asset.php b/build/checkout-frontend.asset.php new file mode 100644 index 000000000..e6ec1d75a --- /dev/null +++ b/build/checkout-frontend.asset.php @@ -0,0 +1 @@ + array('lodash', 'react', 'wc-blocks-checkout', 'wc-blocks-data-store', 'wc-gzd-blocks-settings', 'wc-settings', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => '8a995216ef67dbf5a6bd'); diff --git a/build/checkout-frontend.js b/build/checkout-frontend.js new file mode 100644 index 000000000..c4c78d94b --- /dev/null +++ b/build/checkout-frontend.js @@ -0,0 +1 @@ +!function(){"use strict";var e,t,o,n,r,c={196:function(e){e.exports=window.React},819:function(e){e.exports=window.lodash},554:function(e){e.exports=window.wc.blocksCheckout},801:function(e){e.exports=window.wc.wcBlocksData},617:function(e){e.exports=window.wc.wcSettings},813:function(e){e.exports=window.wcGzd.blocks.wcGzdBlocksSettings},818:function(e){e.exports=window.wp.data},307:function(e){e.exports=window.wp.element},736:function(e){e.exports=window.wp.i18n},444:function(e){e.exports=window.wp.primitives}},i={};function a(e){var t=i[e];if(void 0!==t)return t.exports;var o=i[e]={exports:{}};return c[e](o,o.exports,a),o.exports}a.m=c,a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,{a:t}),t},a.d=function(e,t){for(var o in t)a.o(t,o)&&!a.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},a.f={},a.e=function(e){return Promise.all(Object.keys(a.f).reduce((function(t,o){return a.f[o](e,t),t}),[]))},a.u=function(e){return{86:"checkout-blocks/checkout-photovoltaic-system-notice",131:"checkout-blocks/checkout-checkboxes"}[e]+"-frontend.js?ver="+{86:"8b68b59387f0cc476fd9",131:"9ee69c4727c19d15b7a2"}[e]},a.miniCssF=function(e){},a.miniCssF=function(e){},a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},e={},t="woocommerce-germanized:",a.l=function(o,n,r,c){if(e[o])e[o].push(n);else{var i,s;if(void 0!==r)for(var u=document.getElementsByTagName("script"),l=0;l-1&&!e;)e=o[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a.p=e}(),function(){var e={231:0};a.f.j=function(t,o){var n=a.o(e,t)?e[t]:void 0;if(0!==n)if(n)o.push(n[2]);else{var r=new Promise((function(o,r){n=e[t]=[o,r]}));o.push(n[2]=r);var c=a.p+a.u(t),i=new Error;a.l(c,(function(o){if(a.o(e,t)&&(0!==(n=e[t])&&(e[t]=void 0),n)){var r=o&&("load"===o.type?"missing":o.type),c=o&&o.target&&o.target.src;i.message="Loading chunk "+t+" failed.\n("+r+": "+c+")",i.name="ChunkLoadError",i.type=r,i.request=c,n[1](i)}}),"chunk-"+t,t)}};var t=function(t,o){var n,r,c=o[0],i=o[1],s=o[2],u=0;if(c.some((function(t){return 0!==e[t]}))){for(n in i)a.o(i,n)&&(a.m[n]=i[n]);s&&s(a)}for(t&&t(o);ua.e(131).then(a.bind(a,225))))}),(0,o.registerCheckoutBlock)({metadata:r.CHECKOUT_PHOTOVOLTAIC_SYSTEM_NOTICE,component:(0,n.lazy)((()=>a.e(86).then(a.bind(a,367))))})}(); \ No newline at end of file diff --git a/build/checkout-style.asset.php b/build/checkout-style.asset.php new file mode 100644 index 000000000..893dc26e9 --- /dev/null +++ b/build/checkout-style.asset.php @@ -0,0 +1 @@ + array('lodash', 'react', 'wc-blocks-checkout', 'wc-blocks-data-store', 'wc-gzd-blocks-settings', 'wc-settings', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-dom', 'wp-element', 'wp-i18n', 'wp-plugins', 'wp-primitives'), 'version' => 'df8026f91a2d2ca07a74'); diff --git a/build/checkout-style.js.LICENSE.txt b/build/checkout-style.js.LICENSE.txt new file mode 100644 index 000000000..0c20a875d --- /dev/null +++ b/build/checkout-style.js.LICENSE.txt @@ -0,0 +1,5 @@ +/*! + Copyright (c) 2018 Jed Watson. + Licensed under the MIT License (MIT), see + http://jedwatson.github.io/classnames +*/ diff --git a/build/checkout.asset.php b/build/checkout.asset.php new file mode 100644 index 000000000..616124236 --- /dev/null +++ b/build/checkout.asset.php @@ -0,0 +1 @@ + array('lodash', 'react', 'wc-blocks-checkout', 'wc-blocks-data-store', 'wc-gzd-blocks-settings', 'wc-settings', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-dom', 'wp-element', 'wp-i18n', 'wp-plugins', 'wp-primitives'), 'version' => '18a4ec1295b4d90734d1'); diff --git a/build/checkout.css b/build/checkout.css new file mode 100644 index 000000000..198a20fff --- /dev/null +++ b/build/checkout.css @@ -0,0 +1,3 @@ +ul.wc-block-components-product-details li[class*=wc-block-components-product-details__gzd-] .wc-block-components-product-details__name{display:none}ul.wc-block-components-product-details li[class*=wc-block-components-product-details__gzd-] .wc-block-components-product-details__value{font-size:.8rem;color:#757575}.wc-gzd-small-business-info{font-size:.8rem;color:#757575}.wc-gzd-unit-price{font-weight:normal;font-size:.8rem;color:#757575}.wc-gzd-unit-price .wc-block-components-product-details__name{display:none}ul.wc-block-components-product-details li.wc-block-components-product-details__gzd-unit-price{display:none !important}ul.wc-block-components-product-details li.wc-not-gzd-summary-item-first{margin-top:1em}.wc-gzd-checkout .wp-block-woocommerce-checkout-fields-block .wc-block-checkout__actions{display:none}.wc-gzd-checkout .is-large .wc-block-checkout__sidebar{align-self:auto}.wc-gzd-checkout .is-large .wc-block-components-totals-wrapper.wc-gzd-hide-total-wrapper{display:none}.wc-gzd-checkout .is-large .wc-block-components-totals-wrapper.wc-gzd-show-total-wrapper{display:block}.wc-gzd-checkout .is-large .wc-gzd-checkout-submit{margin-top:1em;position:sticky;top:0}.wc-gzd-checkout .is-large .wc-gzd-checkout-submit .wc-block-components-totals-wrapper{display:none;border-top:none}.wc-gzd-checkout .is-large .wc-gzd-checkout-submit .wc-block-components-totals-wrapper.wc-gzd-show-total-wrapper{display:block}.wc-gzd-checkout .is-large .wc-gzd-checkout-submit .wc-block-components-panel__content .wc-block-components-totals-wrapper{display:block}.wc-gzd-checkout .is-large .wc-gzd-checkout-submit .wc-block-checkout__actions{border-top:none;padding:36px 0}.wc-gzd-checkout .is-large .wc-gzd-checkout-submit .wc-block-checkout__actions .wc-block-checkout__actions_row{display:flex;flex-wrap:wrap;flex-direction:column-reverse}.wc-gzd-checkout .is-large .wc-gzd-checkout-submit .wc-block-checkout__actions .wc-block-components-checkout-place-order-button{width:100%;margin-bottom:1em}.wc-gzd-checkout .wc-block-checkout.is-mobile,.wc-gzd-checkout .wc-block-checkout.is-medium,.wc-gzd-checkout .wc-block-checkout.is-small{flex-direction:column-reverse !important}.wc-gzd-checkout .wc-block-checkout.is-mobile .wc-gzd-checkout-submit,.wc-gzd-checkout .wc-block-checkout.is-medium .wc-gzd-checkout-submit,.wc-gzd-checkout .wc-block-checkout.is-small .wc-gzd-checkout-submit{position:relative;padding:1.5em 0}.wc-gzd-checkout .wc-block-checkout.is-mobile .wc-gzd-checkout-submit .wp-block-woocommerce-checkout-order-summary-block,.wc-gzd-checkout .wc-block-checkout.is-medium .wc-gzd-checkout-submit .wp-block-woocommerce-checkout-order-summary-block,.wc-gzd-checkout .wc-block-checkout.is-small .wc-gzd-checkout-submit .wp-block-woocommerce-checkout-order-summary-block{display:none}.wc-gzd-checkout .wc-block-checkout.is-mobile .wc-gzd-checkboxes,.wc-gzd-checkout .wc-block-checkout.is-medium .wc-gzd-checkboxes,.wc-gzd-checkout .wc-block-checkout.is-small .wc-gzd-checkboxes{padding-top:10px}.wc-gzd-checkout .wc-block-components-order-summary .wc-block-components-order-summary-item__total-price{min-width:55px}.wc-gzd-checkout .wc-block-components-product-metadata ul.wc-block-components-product-details:first-child{display:flex;flex-direction:column}.wc-gzd-checkout .wc-block-components-product-metadata ul.wc-block-components-product-details:first-child li{order:950}.wc-gzd-checkout .wc-block-components-product-metadata ul.wc-block-components-product-details:first-child li[class*=wc-block-components-product-details__gzd-]{order:90;width:130%}.wc-gzd-checkout .wc-block-components-product-metadata ul.wc-block-components-product-details:first-child li.wc-block-components-product-details__gzd-unit-price{order:0}.wc-gzd-checkout .wc-block-components-product-metadata ul.wc-block-components-product-details:first-child li.wc-block-components-product-details__gzd-deposit-packaging-type{order:5;font-weight:bold;text-transform:uppercase}.wc-gzd-checkout .wc-block-components-product-metadata ul.wc-block-components-product-details:first-child li.wc-block-components-product-details__gzd-deposit{order:10}.wc-gzd-checkout .wc-block-components-product-metadata ul.wc-block-components-product-details:first-child li.wc-block-components-product-details__gzd-differential-taxation{order:10}.wc-gzd-checkout .wc-block-components-product-metadata ul.wc-block-components-product-details:first-child li.wc-block-components-product-details__gzd-delivery-time{order:20}.wc-gzd-checkout .wc-block-components-product-metadata ul.wc-block-components-product-details:first-child li.wc-block-components-product-details__gzd-item-desc{order:100}.wc-gzd-checkout .wc-block-components-product-metadata ul.wc-block-components-product-details:first-child li.wc-gzd-summary-item-last{margin-bottom:1em} +.wc-gzd-checkboxes{margin-bottom:1em}.wc-gzd-checkboxes .wc-gzd-checkbox{color:inherit;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;text-decoration:inherit;text-transform:inherit;margin-top:1em}.wc-gzd-checkboxes .wc-gzd-checkbox.has-no-checkbox span{font-size:.875em}.wc-gzd-checkout-modal-bg{width:auto !important;position:fixed;background:rgba(0,0,0,.45);left:0;right:0;top:0;bottom:0;z-index:40}.wc-gzd-checkout-modal-wrapper{position:absolute;width:100%;height:100%;display:flex;justify-content:center;align-items:center;top:0;box-sizing:border-box}.wc-gzd-checkout-modal-wrapper .wc-gzd-checkout-modal{position:fixed;top:20%;max-height:60%;width:60%;background:#fff;z-index:41;border-radius:4px;border:1px solid #d5d5d5;transition:1.1s ease-out;box-shadow:-2rem 2rem 2rem rgba(0,0,0,.2);filter:blur(0);transform:scale(1);opacity:1;visibility:visible;overflow:hidden;display:flex;flex-wrap:nowrap}.wc-gzd-checkout-modal-wrapper .wc-gzd-checkout-modal .content{position:relative;padding:1rem;overflow-y:scroll;max-height:100%;width:100%}.wc-gzd-checkout-modal-wrapper .wc-gzd-checkout-modal .content.is-loading{display:flex;align-items:center;justify-content:center;min-height:200px}.wc-gzd-checkout-modal-wrapper .wc-gzd-checkout-modal .actions{position:fixed;width:100%;display:flex;justify-content:end;z-index:42}.wc-gzd-checkout-modal-wrapper .wc-gzd-checkout-modal .actions .wc-gzd-checkout-modal-close{margin:.25rem;display:inline-flex;cursor:pointer}.is-mobile .wc-gzd-checkout-modal-wrapper .wc-gzd-checkout-modal{top:2%;width:95%} +.wc-gzd-block-checkout__photovoltaic-system-notice{flex-direction:column} diff --git a/build/checkout.js b/build/checkout.js new file mode 100644 index 000000000..d21e5718d --- /dev/null +++ b/build/checkout.js @@ -0,0 +1 @@ +!function(){var e,t={226:function(e,t,r){"use strict";r.r(t);var n=window.React,c=window.wp.blocks,o=window.wp.element,a=function(e){let{icon:t,size:r=24,...n}=e;return(0,o.cloneElement)(t,{width:r,height:r,...n})},i=window.wp.primitives,s=(0,o.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(i.Path,{d:"M4 20h9v-1.5H4V20zm0-5.5V16h16v-1.5H4zm.8-4l.7.7 2-2V12h1V9.2l2 2 .7-.7-2-2H12v-1H9.2l2-2-.7-.7-2 2V4h-1v2.8l-2-2-.7.7 2 2H4v1h2.8l-2 2z"})),l=window.wp.i18n,u=window.wp.blockEditor,m=window.wp.components,d=window.wc.blocksCheckout,f=window.wc.wcSettings,p=window.wp.dom;const w=["BUTTON","FIELDSET","INPUT","OPTGROUP","OPTION","SELECT","TEXTAREA","A"];var h=({children:e,style:t={},...r})=>{const c=(0,o.useRef)(),a=()=>{c.current&&p.focus.focusable.find(c.current).forEach((e=>{w.includes(e.nodeName)&&e.setAttribute("tabindex","-1"),e.hasAttribute("contenteditable")&&e.setAttribute("contenteditable","false")}))},i=function(e,t,r){var c=this,o=(0,n.useRef)(null),a=(0,n.useRef)(0),i=(0,n.useRef)(null),s=(0,n.useRef)([]),l=(0,n.useRef)(),u=(0,n.useRef)(),m=(0,n.useRef)(e),d=(0,n.useRef)(!0);(0,n.useEffect)((function(){m.current=e}),[e]);var f=!t&&0!==t&&"undefined"!=typeof window;if("function"!=typeof e)throw new TypeError("Expected a function");t=+t||0;var p=!!(r=r||{}).leading,w=!("trailing"in r)||!!r.trailing,h="maxWait"in r,g=h?Math.max(+r.maxWait||0,t):null;(0,n.useEffect)((function(){return d.current=!0,function(){d.current=!1}}),[]);var b=(0,n.useMemo)((function(){var e=function(e){var t=s.current,r=l.current;return s.current=l.current=null,a.current=e,u.current=m.current.apply(r,t)},r=function(e,t){f&&cancelAnimationFrame(i.current),i.current=f?requestAnimationFrame(e):setTimeout(e,t)},n=function(e){if(!d.current)return!1;var r=e-o.current;return!o.current||r>=t||r<0||h&&e-a.current>=g},b=function(t){return i.current=null,w&&s.current?e(t):(s.current=l.current=null,u.current)},v=function e(){var c=Date.now();if(n(c))return b(c);if(d.current){var i=t-(c-o.current),s=h?Math.min(i,g-(c-a.current)):i;r(e,s)}},k=function(){var m=Date.now(),f=n(m);if(s.current=[].slice.call(arguments),l.current=c,o.current=m,f){if(!i.current&&d.current)return a.current=o.current,r(v,t),p?e(o.current):u.current;if(h)return r(v,t),e(o.current)}return i.current||r(v,t),u.current};return k.cancel=function(){i.current&&(f?cancelAnimationFrame(i.current):clearTimeout(i.current)),a.current=0,s.current=o.current=l.current=i.current=null},k.isPending=function(){return!!i.current},k.flush=function(){return i.current?b(Date.now()):u.current},k}),[p,h,t,g,w,f]);return b}(a,0,{leading:!0});return(0,o.useLayoutEffect)((()=>{let e;return a(),c.current&&(e=new window.MutationObserver(i),e.observe(c.current,{childList:!0,attributes:!0,subtree:!0})),()=>{e&&e.disconnect(),i.cancel()}}),[i]),(0,n.createElement)("div",{ref:c,"aria-disabled":"true",style:{userSelect:"none",pointerEvents:"none",cursor:"normal",...t},...r},e)},g=r(184),b=r.n(g),v=window.wp.data,k=window.wc.wcBlocksData,E=({checkbox:e,setShowModal:t,setModalUrl:r,onChangeCheckbox:c})=>{const a="checkbox-"+e.id,{setValidationErrors:i,clearValidationError:s}=(0,v.useDispatch)(k.VALIDATION_STORE_KEY),l=!!e.hidden&&e.hidden,u=(0,v.useSelect)((e=>e(k.VALIDATION_STORE_KEY).getValidationError(a))),m=!(!u?.message||u?.hidden);(0,o.useEffect)((()=>{if(e.has_checkbox)return!0===e.checked||!0===e.hidden?s(a):e.is_required&&i({[a]:{message:e.error_message,hidden:!0}}),()=>{s(a)}}),[e.is_required,e.checked,e.hidden,a,s,i]);const f={id:`checkbox-${e.html_id}`,className:"wc-gzd-checkbox",name:`${e.name}`,checked:!!e.checked,hasError:e.is_required&&m,required:e.is_required};return l?null:(0,n.createElement)("div",{className:b()(`wc-gzd-block-checkout-checkboxes__${e.id}`,Object.values(e.wrapper_classes).join(" ")),key:`wrapper-${e.id}`},e.has_checkbox?(0,n.createElement)(n.Fragment,null,(0,n.createElement)(d.CheckboxControl,{key:`checkbox-${e.id}`,...f,onChange:t=>{c({...e,checked:t})}},(0,n.createElement)("span",{onClick:e=>{const n=e.target.closest("a");if(n&&e.currentTarget.contains(n)&&n.classList.contains("wc-gzd-modal")){e.stopPropagation(),e.preventDefault();let c=n.getAttribute("href");c&&(r(c),t(!0))}},dangerouslySetInnerHTML:{__html:e.label}}))):(0,n.createElement)("div",{className:"wc-gzd-checkbox has-no-checkbox"},(0,n.createElement)("span",{dangerouslySetInnerHTML:{__html:e.label}})))},y=JSON.parse('{"apiVersion":2,"name":"woocommerce-germanized/checkout-checkboxes","version":"2.0.0","title":"Legal Checkboxes","category":"woocommerce","description":"Adds your checkboxes, registered via Germanized, to your checkout.","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"lock":false},"parent":["woocommerce/checkout-fields-block","woocommerce/checkout-totals-block"],"textdomain":"woocommerce-germanized","attributes":{"className":{"type":"string","default":""}}}');(0,c.registerBlockType)(y,{icon:{src:(0,n.createElement)(a,{icon:s,className:"wc-block-editor-components-block-icon"})},edit:({attributes:e,setAttributes:t})=>{const{text:r}=e,c=(0,u.useBlockProps)(),o={id:"preview",label:(0,l.__)("This is a label being printed next to your legal checkbox.","woocommerce-germanized"),hidden:!1,checked:!1,is_required:!0,name:"preview",has_checkbox:!0,wrapper_classes:[]};return(0,n.createElement)("div",{...c},(0,n.createElement)(u.InspectorControls,null,(0,n.createElement)(m.PanelBody,{title:(0,l.__)("Checkboxes","woocommerce-germanized")},(0,n.createElement)(m.ExternalLink,{href:`${f.ADMIN_URL}admin.php?page=wc-settings&tab=germanized-checkboxes`},(0,l.__)("Manage checkboxes","woocommerce-germanized")))),(0,n.createElement)("div",{className:"wc-gzd-editor-checkboxes"},(0,n.createElement)(h,null,(0,n.createElement)(E,{checkbox:o,key:o.id,onChangeCheckbox:()=>{}}))))},save:({attributes:e})=>{const{text:t}=e;return(0,n.createElement)("div",{...u.useBlockProps.save()})}});var x=(0,o.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(i.Path,{d:"M12 3.2c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8 0-4.8-4-8.8-8.8-8.8zm0 16c-4 0-7.2-3.3-7.2-7.2C4.8 8 8 4.8 12 4.8s7.2 3.3 7.2 7.2c0 4-3.2 7.2-7.2 7.2zM11 17h2v-6h-2v6zm0-8h2V7h-2v2z"})),_=JSON.parse('{"apiVersion":2,"name":"woocommerce-germanized/checkout-photovoltaic-system-notice","version":"2.0.0","title":"Photovoltaic system notice","category":"woocommerce","description":"Remind your customers of a possible vat exempt for a photovoltaic system contained within the current cart.","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"lock":false},"parent":["woocommerce/checkout-totals-block","woocommerce/checkout","woocommerce/checkout-fields-block"],"textdomain":"woocommerce-germanized","attributes":{"className":{"type":"string","default":""},"text":{"type":"string","required":false},"title":{"type":"string","required":false},"lock":{"type":"object","default":{"remove":false,"move":false}}}}');(0,c.registerBlockType)(_,{icon:{src:(0,n.createElement)(a,{icon:x,className:"wc-block-editor-components-block-icon"})},edit:({attributes:e,setAttributes:t})=>{const{text:r,title:c}=e,o=(0,u.useBlockProps)(),a=r||(0,l.sprintf)((0,l.__)("To benefit from the tax exemption, please confirm the VAT exemption according to {legal_text} by activating the checkbox.","woocommerce-germanized")),i=c||(0,l.__)("Your shopping cart is eligible for VAT exemption","woocommerce-germanized");return(0,n.createElement)("div",{...o},(0,n.createElement)("div",{className:"wc-gzd-block-checkout__photovoltaic-system-notice wc-block-components-notice-banner is-info"},(0,n.createElement)(u.RichText,{tagName:"h4",className:"wc-block-components-title",value:i,onChange:e=>t({title:e})}),(0,n.createElement)(u.RichText,{tagName:"p",value:a,onChange:e=>t({text:e})})))},save:()=>(0,n.createElement)("div",{...u.useBlockProps.save()})});var z=window.wp.plugins,T=window.wcGzd.blocks.wcGzdBlocksSettings,O=({extensions:e,cart:t})=>(0,T.getSetting)("isSmallBusiness")&&(0,T.getSetting)("smallBusinessNotice")?(0,n.createElement)("div",{className:"wc-gzd-small-business-info",dangerouslySetInnerHTML:{__html:(0,T.getSetting)("smallBusinessNotice")}}):null;const S=({extensions:e,cart:t})=>((0,o.useEffect)((()=>{(0,v.select)(k.CHECKOUT_STORE_KEY).getExtensionData().hasOwnProperty("woocommerce-germanized")||(0,v.dispatch)(k.CHECKOUT_STORE_KEY).__internalSetExtensionData("woocommerce-germanized",{})}),[]),(0,o.useEffect)((()=>{const e=document.getElementsByClassName("wc-block-components-order-summary-item");for(let t of e){const e=t.getElementsByClassName("wc-block-components-product-details__gzd-unit-price")[0],r=t.querySelectorAll("li:not([class*=__gzd])")[0];if(r&&r.classList.add("wc-not-gzd-summary-item-first"),e){const r=t.getElementsByClassName("wc-block-components-order-summary-item__total-price")[0],n=r.getElementsByClassName("wc-gzd-unit-price")[0];n&&r.removeChild(n);const c=document.createElement("div");c.className="wc-gzd-unit-price",c.innerHTML=e.innerHTML,e.classList.add("wc-gzd-unit-price-moved"),r.appendChild(c)}}}),[t.cartItems]),(0,o.useEffect)((()=>{const e=document.getElementsByClassName("wp-block-woocommerce-checkout-order-summary-block");for(let t of e){const e=t.getElementsByClassName("wc-block-components-totals-wrapper");let r=t.parentNode.classList.contains("wc-gzd-checkout-submit");for(let t of e)null!=t.querySelector(".wc-block-components-totals-footer-item")&&(r=!r),r?(t.classList.remove("wc-gzd-show-total-wrapper"),t.classList.add("wc-gzd-hide-total-wrapper")):(t.classList.remove("wc-gzd-hide-total-wrapper"),t.classList.add("wc-gzd-show-total-wrapper"))}}),[t.cartTotals]),null);(0,z.registerPlugin)("woocommerce-germanized-checkout-order-meta",{render:()=>(0,n.createElement)(d.ExperimentalOrderMeta,null,(0,n.createElement)(O,null),(0,n.createElement)(S,null)),scope:"woocommerce-checkout"}),window.lodash,(0,z.registerPlugin)("woocommerce-germanized-checkout-fees",{render:()=>{const{currentPaymentMethod:e}=(0,v.useSelect)((e=>({currentPaymentMethod:e(k.PAYMENT_STORE_KEY).getActivePaymentMethod()})));return(0,o.useEffect)((()=>{e&&(0,d.extensionCartUpdate)({namespace:"woocommerce-germanized-set-payment-method",data:{active_method:e}})}),[e]),null},scope:"woocommerce-checkout"}),(0,d.registerCheckoutFilters)("woocommerce-germanized",{placeOrderButtonLabel:(e,t,r)=>(0,T.getSetting)("buyNowButtonText")})},184:function(e,t){var r;!function(){"use strict";var n={}.hasOwnProperty;function c(){for(var e=[],t=0;t=o)&&Object.keys(n.O).every((function(e){return n.O[e](r[s])}))?r.splice(s--,1):(i=!1,o0&&e[u-1][2]>o;u--)e[u]=e[u-1];e[u]=[r,c,o]},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},function(){var e={231:0,863:0};n.O.j=function(t){return 0===e[t]};var t=function(t,r){var c,o,a=r[0],i=r[1],s=r[2],l=0;if(a.some((function(t){return 0!==e[t]}))){for(c in i)n.o(i,c)&&(n.m[c]=i[c]);if(s)var u=s(n)}for(t&&t(r);l{const t=(0,n.getSetting)("displayCartPricesIncludingTax",!1),i=(0,n.getSetting)("showMiniCartTaxNotice",!0),r=(0,n.getSetting)("showMiniCartShippingCostsNotice",!0),l=(0,n.getSetting)("isSmallBusiness",!1),m=(0,n.getSetting)("smallBusinessNotice",""),g=(0,a.useSelect)(((e,{dispatch:i})=>{const s=e(o.CART_STORE_KEY),n=s.getCartData(),a=s.getCartErrors(),r=s.getCartTotals(),l=!s.hasFinishedResolution("getCartData"),{receiveCart:m,receiveCartContents:g}=i(o.CART_STORE_KEY),p=n.extensions.hasOwnProperty("woocommerce-germanized")?n.extensions["woocommerce-germanized"]:{shipping_costs_notice:""},d=t?(0,c.__)("incl. VAT","woocommerce-germanized"):(0,c.__)("excl. VAT","woocommerce-germanized");return{cartItems:n.items,crossSellsProducts:n.crossSells,cartItemsCount:n.itemsCount,cartItemsWeight:n.itemsWeight,cartNeedsPayment:n.needsPayment,cartNeedsShipping:n.needsShipping,cartItemErrors:n.errors,cartTotals:r,cartIsLoading:l,cartErrors:a,extensions:n.extensions,shippingRates:n.shippingRates,cartHasCalculatedShipping:n.hasCalculatedShipping,paymentRequirements:n.paymentRequirements,shippingCostsNotice:n.needsShipping?p.shipping_costs_notice:"",taxNotice:r.total_tax>0?d:"",receiveCart:m,receiveCartContents:g}}),[t]);return(0,s.createElement)("div",{className:"wc-gzd-block-mini-cart-notices"},l&&m&&!i&&(0,s.createElement)("div",{className:"wc-gzd-block-mini-cart-notices__notice wc-gzd-block-mini-cart-notices__small-business-notice",dangerouslySetInnerHTML:{__html:m}}),(0,s.createElement)("div",{className:"wc-gzd-block-mini-cart-notices__notice-wrap"},g.taxNotice&&i&&(0,s.createElement)("div",{className:"wc-gzd-block-mini-cart-notices__notice wc-gzd-block-mini-cart-notices__tax-notice",dangerouslySetInnerHTML:{__html:g.taxNotice}}),g.shippingCostsNotice&&r&&(0,s.createElement)("div",{className:"wc-gzd-block-mini-cart-notices__notice wc-gzd-block-mini-cart-notices__shipping-notice",dangerouslySetInnerHTML:{__html:g.shippingCostsNotice}})))}}}]); \ No newline at end of file diff --git a/build/mini-cart-blocks/mini-cart-notices-style.js b/build/mini-cart-blocks/mini-cart-notices-style.js new file mode 100644 index 000000000..d5819a892 --- /dev/null +++ b/build/mini-cart-blocks/mini-cart-notices-style.js @@ -0,0 +1 @@ +"use strict";(self.webpackWcGzdBlocksJsonp=self.webpackWcGzdBlocksJsonp||[]).push([[930],{6473:function(e,t,i){i.r(t),i.d(t,{default:function(){return r}});var s=i(9196),n=(i(9307),i(1813)),c=i(5736),a=i(9818),o=i(4801),r=({className:e})=>{const t=(0,n.getSetting)("displayCartPricesIncludingTax",!1),i=(0,n.getSetting)("showMiniCartTaxNotice",!0),r=(0,n.getSetting)("showMiniCartShippingCostsNotice",!0),l=(0,n.getSetting)("isSmallBusiness",!1),m=(0,n.getSetting)("smallBusinessNotice",""),g=(0,a.useSelect)(((e,{dispatch:i})=>{const s=e(o.CART_STORE_KEY),n=s.getCartData(),a=s.getCartErrors(),r=s.getCartTotals(),l=!s.hasFinishedResolution("getCartData"),{receiveCart:m,receiveCartContents:g}=i(o.CART_STORE_KEY),p=n.extensions.hasOwnProperty("woocommerce-germanized")?n.extensions["woocommerce-germanized"]:{shipping_costs_notice:""},d=t?(0,c.__)("incl. VAT","woocommerce-germanized"):(0,c.__)("excl. VAT","woocommerce-germanized");return{cartItems:n.items,crossSellsProducts:n.crossSells,cartItemsCount:n.itemsCount,cartItemsWeight:n.itemsWeight,cartNeedsPayment:n.needsPayment,cartNeedsShipping:n.needsShipping,cartItemErrors:n.errors,cartTotals:r,cartIsLoading:l,cartErrors:a,extensions:n.extensions,shippingRates:n.shippingRates,cartHasCalculatedShipping:n.hasCalculatedShipping,paymentRequirements:n.paymentRequirements,shippingCostsNotice:n.needsShipping?p.shipping_costs_notice:"",taxNotice:r.total_tax>0?d:"",receiveCart:m,receiveCartContents:g}}),[t]);return(0,s.createElement)("div",{className:"wc-gzd-block-mini-cart-notices"},l&&m&&!i&&(0,s.createElement)("div",{className:"wc-gzd-block-mini-cart-notices__notice wc-gzd-block-mini-cart-notices__small-business-notice",dangerouslySetInnerHTML:{__html:m}}),(0,s.createElement)("div",{className:"wc-gzd-block-mini-cart-notices__notice-wrap"},g.taxNotice&&i&&(0,s.createElement)("div",{className:"wc-gzd-block-mini-cart-notices__notice wc-gzd-block-mini-cart-notices__tax-notice",dangerouslySetInnerHTML:{__html:g.taxNotice}}),g.shippingCostsNotice&&r&&(0,s.createElement)("div",{className:"wc-gzd-block-mini-cart-notices__notice wc-gzd-block-mini-cart-notices__shipping-notice",dangerouslySetInnerHTML:{__html:g.shippingCostsNotice}})))}}}]); \ No newline at end of file diff --git a/build/mini-cart-blocks/mini-cart-notices.css b/build/mini-cart-blocks/mini-cart-notices.css new file mode 100644 index 000000000..bf425c552 --- /dev/null +++ b/build/mini-cart-blocks/mini-cart-notices.css @@ -0,0 +1 @@ +.wc-block-mini-cart__footer-actions{flex-wrap:wrap}.wc-block-mini-cart__footer-actions .wc-gzd-block-mini-cart-notices{justify-content:right;margin-top:-7px;font-size:.8rem;color:#757575;flex:0 0 100%;display:inline-flex;text-align:right;flex-wrap:wrap}.wc-block-mini-cart__footer-actions .wc-gzd-block-mini-cart-notices .wc-gzd-block-mini-cart-notices__notice::after{content:" "}.wc-block-mini-cart__footer-actions .wc-gzd-block-mini-cart-notices .wc-gzd-block-mini-cart-notices__notice.wc-gzd-block-mini-cart-notices__small-business-notice{flex:0 0 100%}.wc-block-mini-cart__footer-actions .wc-gzd-block-mini-cart-notices .wc-gzd-block-mini-cart-notices__notice-wrap{text-align:left;display:flex;justify-content:right;flex:0 0 100%} diff --git a/build/mini-cart-blocks/style-mini-cart-notices.css b/build/mini-cart-blocks/style-mini-cart-notices.css new file mode 100644 index 000000000..bf425c552 --- /dev/null +++ b/build/mini-cart-blocks/style-mini-cart-notices.css @@ -0,0 +1 @@ +.wc-block-mini-cart__footer-actions{flex-wrap:wrap}.wc-block-mini-cart__footer-actions .wc-gzd-block-mini-cart-notices{justify-content:right;margin-top:-7px;font-size:.8rem;color:#757575;flex:0 0 100%;display:inline-flex;text-align:right;flex-wrap:wrap}.wc-block-mini-cart__footer-actions .wc-gzd-block-mini-cart-notices .wc-gzd-block-mini-cart-notices__notice::after{content:" "}.wc-block-mini-cart__footer-actions .wc-gzd-block-mini-cart-notices .wc-gzd-block-mini-cart-notices__notice.wc-gzd-block-mini-cart-notices__small-business-notice{flex:0 0 100%}.wc-block-mini-cart__footer-actions .wc-gzd-block-mini-cart-notices .wc-gzd-block-mini-cart-notices__notice-wrap{text-align:left;display:flex;justify-content:right;flex:0 0 100%} diff --git a/build/mini-cart-frontend.asset.php b/build/mini-cart-frontend.asset.php new file mode 100644 index 000000000..a0b685312 --- /dev/null +++ b/build/mini-cart-frontend.asset.php @@ -0,0 +1 @@ + array('react', 'wc-blocks-checkout', 'wc-blocks-data-store', 'wc-gzd-blocks-settings', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => '5052ad3173cf2d92e15b'); diff --git a/build/mini-cart-frontend.js b/build/mini-cart-frontend.js new file mode 100644 index 000000000..25a8e56a4 --- /dev/null +++ b/build/mini-cart-frontend.js @@ -0,0 +1 @@ +!function(){"use strict";var e,t,n,r={755:function(e,t,n){var r=window.wc.blocksCheckout,o=n(307),i={MINI_CART_NOTICES:JSON.parse('{"apiVersion":2,"name":"woocommerce-germanized/mini-cart-notices","version":"2.0.0","title":"Mini cart legal notices","category":"woocommerce","description":"Outputs mini cart legal notices.","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":true,"color":{"text":true,"background":true}},"parent":["woocommerce/mini-cart-footer-block"],"textdomain":"woocommerce-germanized","attributes":{"lock":{"type":"object","default":{"remove":false,"move":false}}}}')};(0,r.registerCheckoutBlock)({metadata:i.MINI_CART_NOTICES,component:(0,o.lazy)((()=>Promise.all([n.e(795),n.e(930)]).then(n.bind(n,473))))})},196:function(e){e.exports=window.React},801:function(e){e.exports=window.wc.wcBlocksData},813:function(e){e.exports=window.wcGzd.blocks.wcGzdBlocksSettings},818:function(e){e.exports=window.wp.data},307:function(e){e.exports=window.wp.element},736:function(e){e.exports=window.wp.i18n}},o={};function i(e){var t=o[e];if(void 0!==t)return t.exports;var n=o[e]={exports:{}};return r[e](n,n.exports,i),n.exports}i.m=r,e=[],i.O=function(t,n,r,o){if(!n){var a=1/0;for(l=0;l=o)&&Object.keys(i.O).every((function(e){return i.O[e](n[u])}))?n.splice(u--,1):(c=!1,o0&&e[l-1][2]>o;l--)e[l]=e[l-1];e[l]=[n,r,o]},i.d=function(e,t){for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.f={},i.e=function(e){return Promise.all(Object.keys(i.f).reduce((function(t,n){return i.f[n](e,t),t}),[]))},i.u=function(e){return{795:"mini-cart-blocks/style-mini-cart-notices",930:"mini-cart-blocks/mini-cart-notices"}[e]+"-frontend.js?ver="+{795:"e5adab5fa1cf92443cb4",930:"5b51c8d7148c16f46948"}[e]},i.miniCssF=function(e){return"mini-cart-blocks/style-mini-cart-notices.css"},i.miniCssF=function(e){return"mini-cart-blocks/style-mini-cart-notices.css"},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t={},n="woocommerce-germanized:",i.l=function(e,r,o,a){if(t[e])t[e].push(r);else{var c,u;if(void 0!==o)for(var s=document.getElementsByTagName("script"),l=0;l-1&&!e;)e=n[r--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),i.p=e}(),function(){if("undefined"!=typeof document){var e={398:0};i.f.miniCss=function(t,n){e[t]?n.push(e[t]):0!==e[t]&&{795:1}[t]&&n.push(e[t]=function(e){return new Promise((function(t,n){var r=i.miniCssF(e),o=i.p+r;if(function(e,t){for(var n=document.getElementsByTagName("link"),r=0;r array('react', 'wc-blocks-checkout', 'wc-blocks-data-store', 'wc-gzd-blocks-settings', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => '7207a925ec2aca2b8360'); diff --git a/build/mini-cart.asset.php b/build/mini-cart.asset.php new file mode 100644 index 000000000..e28cc84eb --- /dev/null +++ b/build/mini-cart.asset.php @@ -0,0 +1 @@ + array(), 'version' => '98c4af153956dc4cbc8c'); diff --git a/build/mini-cart.css b/build/mini-cart.css new file mode 100644 index 000000000..567f36e5d --- /dev/null +++ b/build/mini-cart.css @@ -0,0 +1 @@ +ul.wc-block-components-product-details li[class*=wc-block-components-product-details__gzd-] .wc-block-components-product-details__name{display:none}ul.wc-block-components-product-details li[class*=wc-block-components-product-details__gzd-] .wc-block-components-product-details__value{font-size:.8rem;color:#757575}.wc-gzd-small-business-info{font-size:.8rem;color:#757575}.wc-gzd-unit-price{font-weight:normal;font-size:.8rem;color:#757575}.wc-gzd-unit-price .wc-block-components-product-details__name{display:none}ul.wc-block-components-product-details li.wc-block-components-product-details__gzd-unit-price{display:none !important}ul.wc-block-components-product-details li.wc-not-gzd-summary-item-first{margin-top:1em}.wp-block-woocommerce-mini-cart-contents .wc-block-components-totals-item__description{display:none !important} diff --git a/build/mini-cart.js b/build/mini-cart.js new file mode 100644 index 000000000..f1e037a6a --- /dev/null +++ b/build/mini-cart.js @@ -0,0 +1 @@ +((window.wcGzd=window.wcGzd||{}).blocks=window.wcGzd.blocks||{})["mini-cart"]={}; \ No newline at end of file diff --git a/build/product-defect-description-frontend.js b/build/product-defect-description-frontend.js new file mode 100644 index 000000000..2d2bae6b8 --- /dev/null +++ b/build/product-defect-description-frontend.js @@ -0,0 +1 @@ +"use strict";(self.webpackWcBlocksJsonp=self.webpackWcBlocksJsonp||[]).push([[710],{575:function(e,t,r){r.r(t),r.d(t,{default:function(){return c}});var n=r(196),o=r(721),a=r(606),c=e=>(e={...e,labelType:"defect-description"}).isDescendentOfSingleProductTemplate?(0,n.createElement)(a.Z,{...e}):(0,o.withProductDataContext)(a.Z)(e)},606:function(e,t,r){r.d(t,{Z:function(){return h}});var n=r(196),o=r(184),a=r.n(o),c=r(293),l=r(864),s=r(736);const m=e=>!(e=>null===e)(e)&&e instanceof Object&&e.constructor===Object,i=e=>"string"==typeof e;var u=r(857),p=r(83);function d(e={}){const t={};return(0,p.R)(e,{selector:""}).forEach((e=>{t[e.key]=e.value})),t}function g(e,t){return e&&t?`has-${(0,u.o)(t)}-${e}`:""}const _=e=>{const t=(e=>{const t=m(e)?e:{style:{}};let r=t.style;return i(r)&&(r=JSON.parse(r)||{}),m(r)||(r={}),{...t,style:r}})(e),r=function(e){const{backgroundColor:t,textColor:r,gradient:n,style:o}=e,c=g("background-color",t),l=g("color",r),s=function(e){if(e)return`has-${e}-gradient-background`}(n),i=s||o?.color?.gradient;return{className:a()(l,s,{[c]:!i&&!!c,"has-text-color":r||o?.color?.text,"has-background":t||o?.color?.background||n||o?.color?.gradient,"has-link-color":m(o?.elements?.link)?o?.elements?.link?.color:void 0}),style:d({color:o?.color||{}})}}(t),n=function(e){const t=e.style?.border||{};return{className:function(e){const{borderColor:t,style:r}=e,n=t?g("border-color",t):"";return a()({"has-border-color":!!t||!!r?.border?.color,[n]:!!n})}(e),style:d({border:t})}}(t),o=function(e){return{className:void 0,style:d({spacing:e.style?.spacing||{}})}}(t),c=(e=>{const t=m(e.style.typography)?e.style.typography:{},r=i(t.fontFamily)?t.fontFamily:"";return{className:e.fontFamily?`has-${e.fontFamily}-font-family`:r,style:{fontSize:e.fontSize?`var(--wp--preset--font-size--${e.fontSize})`:t.fontSize,fontStyle:t.fontStyle,fontWeight:t.fontWeight,letterSpacing:t.letterSpacing,lineHeight:t.lineHeight,textDecoration:t.textDecoration,textTransform:t.textTransform}}})(t);return{className:a()(c.className,r.className,n.className,o.className),style:{...c.style,...r.style,...n.style,...o.style}}};var y=r(333);const f=e=>({thousandSeparator:e?.thousandSeparator,decimalSeparator:e?.decimalSeparator,fixedDecimalScale:!0,prefix:e?.prefix,suffix:e?.suffix,isNumericString:!0});var w=({className:e,value:t,currency:r,onValueChange:o,displayType:c="text",...l})=>{var s;const m="string"==typeof t?parseInt(t,10):t;if(!Number.isFinite(m))return null;const i=m/10**r.minorUnit;if(!Number.isFinite(i))return null;const u=a()("wc-block-formatted-money-amount","wc-block-components-formatted-money-amount",e),p=null!==(s=l.decimalScale)&&void 0!==s?s:r?.minorUnit,d={...l,...f(r),decimalScale:p,value:void 0,currency:void 0,onValueChange:void 0},g=o?e=>{const t=+e.value*10**r.minorUnit;o(t)}:()=>{};return(0,n.createElement)(y.Z,{className:u,displayType:c,...d,value:i,onValueChange:g})},b=r(307),v=({align:e,className:t,labelType:r,formattedLabel:o,labelClassName:c,labelStyle:l,style:s})=>{const m=a()(t,"wc-gzd-block-components-product-"+r,"wc-gzd-block-components-product-price-label",{[`wc-gzd-block-components-product-price-label--align-${e}`]:e});let i=(0,n.createElement)("span",{className:a()("wc-gzd-block-components-product-"+r+"__value",c)});return o&&(i=(0,b.isValidElement)(o)?(0,n.createElement)("span",{className:a()("wc-gzd-block-components-product-"+r+"__value",c),style:l},o):(0,n.createElement)("span",{className:a()("wc-gzd-block-components-product-"+r+"__value",c),style:l,dangerouslySetInnerHTML:{__html:o}})),(0,n.createElement)("span",{className:m,style:s},i)},h=e=>{const{className:t,textAlign:r,isDescendentOfSingleProductTemplate:o,labelType:m}=e,{parentName:i,parentClassName:u}=(0,l.useInnerBlockLayoutContext)(),{product:p}=(0,l.useProductDataContext)(),d=_(e),g="woocommerce/all-products"===i,y=a()("wc-gzd-block-components-product-"+m,t,d.className,{[`${u}__product-${m}`]:u});if(!p.id&&!o){const e=(0,n.createElement)(v,{align:r,className:y,labelType:m});if(g){const t=`wp-block-woocommerce-gzd-product-${m}`;return(0,n.createElement)("div",{className:t},e)}return e}const f=((e,t,r)=>{const o=t.hasOwnProperty("extensions")?t.extensions["woocommerce-germanized"]:{unit_price_html:"",unit_prices:{price:0,regular_price:0,sale_price:0},unit_product:0,unit_product_html:"",delivery_time_html:"",tax_info_html:"",shipping_costs_info_html:"",defect_description_html:"",nutri_score:"",nutri_score_html:"",deposit_html:"",deposit_prices:{price:0,quantity:0,amount:0},deposit_packaging_type_html:"",manufacturer_html:"",product_safety_attachments_html:"",safety_instructions_html:""},a=t.prices,l=r?(0,c.getCurrencyFromPriceResponse)():(0,c.getCurrencyFromPriceResponse)(a),m=e.replace(/-/g,"_"),i=o.hasOwnProperty(m+"_html")?o[m+"_html"]:"";let u="";return"unit_price"===m?u=(0,n.createElement)(n.Fragment,null,(0,n.createElement)(w,{currency:l,value:1e3})," / ",(0,n.createElement)("span",{className:"unit"},(0,s._x)("kg","unit","woocommerce-germanized"))):"delivery_time"===m?u=(0,s._x)("Delivery time: 2-3 days","preview","woocommerce-germanized"):"tax_info"===m?u=(0,s._x)("incl. 19 % VAT","preview","woocommerce-germanized"):"shipping_costs_info"===m?u=(0,s._x)("plus shipping costs","preview","woocommerce-germanized"):"unit_product"===m?u=(0,s.sprintf)((0,s._x)("Product includes: %1$s kg","preview","woocommerce-germanized"),10):"defect_description"===m?u=(0,s._x)("This product has a serious defect.","preview","woocommerce-germanized"):"deposit"===m?u=(0,n.createElement)(n.Fragment,null,(0,n.createElement)("span",{className:"additional"},(0,s._x)("Plus","preview","woocommerce-germanized"))," ",(0,n.createElement)(w,{currency:l,value:40})," ",(0,n.createElement)("span",{className:"deposit-notice"},(0,s._x)("deposit","preview","woocommerce-germanized"))):"deposit_packaging_type"===m?u=(0,s._x)("Disposable","preview","woocommerce-germanized"):"nutri_score"===m?u=(0,n.createElement)(n.Fragment,null,(0,n.createElement)("span",{className:"wc-gzd-nutri-score-value wc-gzd-nutri-score-value-a"},"A")):"manufacturer"===m?u=(0,n.createElement)(n.Fragment,null,(0,n.createElement)("p",null,(0,n.createElement)("stong",null,(0,s._x)("Sample company name","preview","woocommerce-germanized")),(0,n.createElement)("br",null),(0,s._x)("Sample address","preview","woocommerce-germanized"),(0,n.createElement)("br",null),(0,s._x)("12345 Berlin","preview","woocommerce-germanized"),(0,n.createElement)("br",null),(0,s._x)("sample@sample.com","preview","woocommerce-germanized")),(0,n.createElement)("h3",null,(0,s.__)("Person responsible for the EU","woocommerce-germanized")),(0,n.createElement)("p",null,(0,n.createElement)("stong",null,(0,s._x)("Sample company name","preview","woocommerce-germanized")),(0,n.createElement)("br",null),(0,s._x)("Sample address","preview","woocommerce-germanized"),(0,n.createElement)("br",null),(0,s._x)("12345 Berlin","preview","woocommerce-germanized"),(0,n.createElement)("br",null),(0,s._x)("sample@sample.com","preview","woocommerce-germanized"))):"product_safety_attachments"===m?u=(0,n.createElement)(n.Fragment,null,(0,n.createElement)("ul",null,(0,n.createElement)("li",null,(0,n.createElement)("a",{href:"#"},(0,s._x)("sample-filename.pdf","sample","woocommerce-germanized"))))):"safety_instructions"===m&&(u=(0,n.createElement)(n.Fragment,null,(0,n.createElement)("p",null,(0,s._x)("Sample safety instructions for a certain product.","preview","woocommerce-germanized"),(0,n.createElement)("br",null)))),{preview:u,data:i}})(m,p,o),b=(0,n.createElement)(v,{align:r,className:y,labelType:m,style:d.style,labelStyle:d.style,formattedLabel:o?f.preview:f.data});if(g){const e=`wp-block-woocommerce-gzd-product-${m}`;return(0,n.createElement)("div",{className:e},b)}return b}}}]); \ No newline at end of file diff --git a/build/product-defect-description.css b/build/product-defect-description.css new file mode 100644 index 000000000..1114283cc --- /dev/null +++ b/build/product-defect-description.css @@ -0,0 +1 @@ +.wc-gzd-block-components-product-price-label{display:block}.wc-gzd-block-components-product-price-label.wc-gzd-block-components-product-price-label--align-center{text-align:center}.wc-gzd-block-components-product-price-label.wc-gzd-block-components-product-price-label--align-right{text-align:right}.wc-gzd-block-components-product-deposit-packaging-type{text-transform:uppercase}.wc-gzd-block-components-product-nutri-score .wc-gzd-nutri-score-value{height:4rem;width:7.0625rem;display:block;text-indent:-9999px} diff --git a/build/product-delivery-time-frontend.js b/build/product-delivery-time-frontend.js new file mode 100644 index 000000000..a45650ac4 --- /dev/null +++ b/build/product-delivery-time-frontend.js @@ -0,0 +1 @@ +"use strict";(self.webpackWcBlocksJsonp=self.webpackWcBlocksJsonp||[]).push([[518],{351:function(e,t,r){r.r(t),r.d(t,{default:function(){return c}});var n=r(196),o=r(721),a=r(606),c=e=>(e={...e,labelType:"delivery-time"}).isDescendentOfSingleProductTemplate?(0,n.createElement)(a.Z,{...e}):(0,o.withProductDataContext)(a.Z)(e)},606:function(e,t,r){r.d(t,{Z:function(){return h}});var n=r(196),o=r(184),a=r.n(o),c=r(293),l=r(864),s=r(736);const m=e=>!(e=>null===e)(e)&&e instanceof Object&&e.constructor===Object,i=e=>"string"==typeof e;var u=r(857),p=r(83);function d(e={}){const t={};return(0,p.R)(e,{selector:""}).forEach((e=>{t[e.key]=e.value})),t}function g(e,t){return e&&t?`has-${(0,u.o)(t)}-${e}`:""}const _=e=>{const t=(e=>{const t=m(e)?e:{style:{}};let r=t.style;return i(r)&&(r=JSON.parse(r)||{}),m(r)||(r={}),{...t,style:r}})(e),r=function(e){const{backgroundColor:t,textColor:r,gradient:n,style:o}=e,c=g("background-color",t),l=g("color",r),s=function(e){if(e)return`has-${e}-gradient-background`}(n),i=s||o?.color?.gradient;return{className:a()(l,s,{[c]:!i&&!!c,"has-text-color":r||o?.color?.text,"has-background":t||o?.color?.background||n||o?.color?.gradient,"has-link-color":m(o?.elements?.link)?o?.elements?.link?.color:void 0}),style:d({color:o?.color||{}})}}(t),n=function(e){const t=e.style?.border||{};return{className:function(e){const{borderColor:t,style:r}=e,n=t?g("border-color",t):"";return a()({"has-border-color":!!t||!!r?.border?.color,[n]:!!n})}(e),style:d({border:t})}}(t),o=function(e){return{className:void 0,style:d({spacing:e.style?.spacing||{}})}}(t),c=(e=>{const t=m(e.style.typography)?e.style.typography:{},r=i(t.fontFamily)?t.fontFamily:"";return{className:e.fontFamily?`has-${e.fontFamily}-font-family`:r,style:{fontSize:e.fontSize?`var(--wp--preset--font-size--${e.fontSize})`:t.fontSize,fontStyle:t.fontStyle,fontWeight:t.fontWeight,letterSpacing:t.letterSpacing,lineHeight:t.lineHeight,textDecoration:t.textDecoration,textTransform:t.textTransform}}})(t);return{className:a()(c.className,r.className,n.className,o.className),style:{...c.style,...r.style,...n.style,...o.style}}};var y=r(333);const f=e=>({thousandSeparator:e?.thousandSeparator,decimalSeparator:e?.decimalSeparator,fixedDecimalScale:!0,prefix:e?.prefix,suffix:e?.suffix,isNumericString:!0});var w=({className:e,value:t,currency:r,onValueChange:o,displayType:c="text",...l})=>{var s;const m="string"==typeof t?parseInt(t,10):t;if(!Number.isFinite(m))return null;const i=m/10**r.minorUnit;if(!Number.isFinite(i))return null;const u=a()("wc-block-formatted-money-amount","wc-block-components-formatted-money-amount",e),p=null!==(s=l.decimalScale)&&void 0!==s?s:r?.minorUnit,d={...l,...f(r),decimalScale:p,value:void 0,currency:void 0,onValueChange:void 0},g=o?e=>{const t=+e.value*10**r.minorUnit;o(t)}:()=>{};return(0,n.createElement)(y.Z,{className:u,displayType:c,...d,value:i,onValueChange:g})},v=r(307),b=({align:e,className:t,labelType:r,formattedLabel:o,labelClassName:c,labelStyle:l,style:s})=>{const m=a()(t,"wc-gzd-block-components-product-"+r,"wc-gzd-block-components-product-price-label",{[`wc-gzd-block-components-product-price-label--align-${e}`]:e});let i=(0,n.createElement)("span",{className:a()("wc-gzd-block-components-product-"+r+"__value",c)});return o&&(i=(0,v.isValidElement)(o)?(0,n.createElement)("span",{className:a()("wc-gzd-block-components-product-"+r+"__value",c),style:l},o):(0,n.createElement)("span",{className:a()("wc-gzd-block-components-product-"+r+"__value",c),style:l,dangerouslySetInnerHTML:{__html:o}})),(0,n.createElement)("span",{className:m,style:s},i)},h=e=>{const{className:t,textAlign:r,isDescendentOfSingleProductTemplate:o,labelType:m}=e,{parentName:i,parentClassName:u}=(0,l.useInnerBlockLayoutContext)(),{product:p}=(0,l.useProductDataContext)(),d=_(e),g="woocommerce/all-products"===i,y=a()("wc-gzd-block-components-product-"+m,t,d.className,{[`${u}__product-${m}`]:u});if(!p.id&&!o){const e=(0,n.createElement)(b,{align:r,className:y,labelType:m});if(g){const t=`wp-block-woocommerce-gzd-product-${m}`;return(0,n.createElement)("div",{className:t},e)}return e}const f=((e,t,r)=>{const o=t.hasOwnProperty("extensions")?t.extensions["woocommerce-germanized"]:{unit_price_html:"",unit_prices:{price:0,regular_price:0,sale_price:0},unit_product:0,unit_product_html:"",delivery_time_html:"",tax_info_html:"",shipping_costs_info_html:"",defect_description_html:"",nutri_score:"",nutri_score_html:"",deposit_html:"",deposit_prices:{price:0,quantity:0,amount:0},deposit_packaging_type_html:"",manufacturer_html:"",product_safety_attachments_html:"",safety_instructions_html:""},a=t.prices,l=r?(0,c.getCurrencyFromPriceResponse)():(0,c.getCurrencyFromPriceResponse)(a),m=e.replace(/-/g,"_"),i=o.hasOwnProperty(m+"_html")?o[m+"_html"]:"";let u="";return"unit_price"===m?u=(0,n.createElement)(n.Fragment,null,(0,n.createElement)(w,{currency:l,value:1e3})," / ",(0,n.createElement)("span",{className:"unit"},(0,s._x)("kg","unit","woocommerce-germanized"))):"delivery_time"===m?u=(0,s._x)("Delivery time: 2-3 days","preview","woocommerce-germanized"):"tax_info"===m?u=(0,s._x)("incl. 19 % VAT","preview","woocommerce-germanized"):"shipping_costs_info"===m?u=(0,s._x)("plus shipping costs","preview","woocommerce-germanized"):"unit_product"===m?u=(0,s.sprintf)((0,s._x)("Product includes: %1$s kg","preview","woocommerce-germanized"),10):"defect_description"===m?u=(0,s._x)("This product has a serious defect.","preview","woocommerce-germanized"):"deposit"===m?u=(0,n.createElement)(n.Fragment,null,(0,n.createElement)("span",{className:"additional"},(0,s._x)("Plus","preview","woocommerce-germanized"))," ",(0,n.createElement)(w,{currency:l,value:40})," ",(0,n.createElement)("span",{className:"deposit-notice"},(0,s._x)("deposit","preview","woocommerce-germanized"))):"deposit_packaging_type"===m?u=(0,s._x)("Disposable","preview","woocommerce-germanized"):"nutri_score"===m?u=(0,n.createElement)(n.Fragment,null,(0,n.createElement)("span",{className:"wc-gzd-nutri-score-value wc-gzd-nutri-score-value-a"},"A")):"manufacturer"===m?u=(0,n.createElement)(n.Fragment,null,(0,n.createElement)("p",null,(0,n.createElement)("stong",null,(0,s._x)("Sample company name","preview","woocommerce-germanized")),(0,n.createElement)("br",null),(0,s._x)("Sample address","preview","woocommerce-germanized"),(0,n.createElement)("br",null),(0,s._x)("12345 Berlin","preview","woocommerce-germanized"),(0,n.createElement)("br",null),(0,s._x)("sample@sample.com","preview","woocommerce-germanized")),(0,n.createElement)("h3",null,(0,s.__)("Person responsible for the EU","woocommerce-germanized")),(0,n.createElement)("p",null,(0,n.createElement)("stong",null,(0,s._x)("Sample company name","preview","woocommerce-germanized")),(0,n.createElement)("br",null),(0,s._x)("Sample address","preview","woocommerce-germanized"),(0,n.createElement)("br",null),(0,s._x)("12345 Berlin","preview","woocommerce-germanized"),(0,n.createElement)("br",null),(0,s._x)("sample@sample.com","preview","woocommerce-germanized"))):"product_safety_attachments"===m?u=(0,n.createElement)(n.Fragment,null,(0,n.createElement)("ul",null,(0,n.createElement)("li",null,(0,n.createElement)("a",{href:"#"},(0,s._x)("sample-filename.pdf","sample","woocommerce-germanized"))))):"safety_instructions"===m&&(u=(0,n.createElement)(n.Fragment,null,(0,n.createElement)("p",null,(0,s._x)("Sample safety instructions for a certain product.","preview","woocommerce-germanized"),(0,n.createElement)("br",null)))),{preview:u,data:i}})(m,p,o),v=(0,n.createElement)(b,{align:r,className:y,labelType:m,style:d.style,labelStyle:d.style,formattedLabel:o?f.preview:f.data});if(g){const e=`wp-block-woocommerce-gzd-product-${m}`;return(0,n.createElement)("div",{className:e},v)}return v}}}]); \ No newline at end of file diff --git a/build/product-delivery-time.css b/build/product-delivery-time.css new file mode 100644 index 000000000..1114283cc --- /dev/null +++ b/build/product-delivery-time.css @@ -0,0 +1 @@ +.wc-gzd-block-components-product-price-label{display:block}.wc-gzd-block-components-product-price-label.wc-gzd-block-components-product-price-label--align-center{text-align:center}.wc-gzd-block-components-product-price-label.wc-gzd-block-components-product-price-label--align-right{text-align:right}.wc-gzd-block-components-product-deposit-packaging-type{text-transform:uppercase}.wc-gzd-block-components-product-nutri-score .wc-gzd-nutri-score-value{height:4rem;width:7.0625rem;display:block;text-indent:-9999px} diff --git a/build/product-deposit-frontend.js b/build/product-deposit-frontend.js new file mode 100644 index 000000000..01c808d82 --- /dev/null +++ b/build/product-deposit-frontend.js @@ -0,0 +1 @@ +"use strict";(self.webpackWcBlocksJsonp=self.webpackWcBlocksJsonp||[]).push([[412],{621:function(e,t,r){r.r(t),r.d(t,{default:function(){return c}});var n=r(196),o=r(721),a=r(606),c=e=>(e={...e,labelType:"deposit"}).isDescendentOfSingleProductTemplate?(0,n.createElement)(a.Z,{...e}):(0,o.withProductDataContext)(a.Z)(e)},606:function(e,t,r){r.d(t,{Z:function(){return h}});var n=r(196),o=r(184),a=r.n(o),c=r(293),l=r(864),s=r(736);const m=e=>!(e=>null===e)(e)&&e instanceof Object&&e.constructor===Object,i=e=>"string"==typeof e;var u=r(857),p=r(83);function d(e={}){const t={};return(0,p.R)(e,{selector:""}).forEach((e=>{t[e.key]=e.value})),t}function g(e,t){return e&&t?`has-${(0,u.o)(t)}-${e}`:""}const _=e=>{const t=(e=>{const t=m(e)?e:{style:{}};let r=t.style;return i(r)&&(r=JSON.parse(r)||{}),m(r)||(r={}),{...t,style:r}})(e),r=function(e){const{backgroundColor:t,textColor:r,gradient:n,style:o}=e,c=g("background-color",t),l=g("color",r),s=function(e){if(e)return`has-${e}-gradient-background`}(n),i=s||o?.color?.gradient;return{className:a()(l,s,{[c]:!i&&!!c,"has-text-color":r||o?.color?.text,"has-background":t||o?.color?.background||n||o?.color?.gradient,"has-link-color":m(o?.elements?.link)?o?.elements?.link?.color:void 0}),style:d({color:o?.color||{}})}}(t),n=function(e){const t=e.style?.border||{};return{className:function(e){const{borderColor:t,style:r}=e,n=t?g("border-color",t):"";return a()({"has-border-color":!!t||!!r?.border?.color,[n]:!!n})}(e),style:d({border:t})}}(t),o=function(e){return{className:void 0,style:d({spacing:e.style?.spacing||{}})}}(t),c=(e=>{const t=m(e.style.typography)?e.style.typography:{},r=i(t.fontFamily)?t.fontFamily:"";return{className:e.fontFamily?`has-${e.fontFamily}-font-family`:r,style:{fontSize:e.fontSize?`var(--wp--preset--font-size--${e.fontSize})`:t.fontSize,fontStyle:t.fontStyle,fontWeight:t.fontWeight,letterSpacing:t.letterSpacing,lineHeight:t.lineHeight,textDecoration:t.textDecoration,textTransform:t.textTransform}}})(t);return{className:a()(c.className,r.className,n.className,o.className),style:{...c.style,...r.style,...n.style,...o.style}}};var y=r(333);const f=e=>({thousandSeparator:e?.thousandSeparator,decimalSeparator:e?.decimalSeparator,fixedDecimalScale:!0,prefix:e?.prefix,suffix:e?.suffix,isNumericString:!0});var w=({className:e,value:t,currency:r,onValueChange:o,displayType:c="text",...l})=>{var s;const m="string"==typeof t?parseInt(t,10):t;if(!Number.isFinite(m))return null;const i=m/10**r.minorUnit;if(!Number.isFinite(i))return null;const u=a()("wc-block-formatted-money-amount","wc-block-components-formatted-money-amount",e),p=null!==(s=l.decimalScale)&&void 0!==s?s:r?.minorUnit,d={...l,...f(r),decimalScale:p,value:void 0,currency:void 0,onValueChange:void 0},g=o?e=>{const t=+e.value*10**r.minorUnit;o(t)}:()=>{};return(0,n.createElement)(y.Z,{className:u,displayType:c,...d,value:i,onValueChange:g})},b=r(307),v=({align:e,className:t,labelType:r,formattedLabel:o,labelClassName:c,labelStyle:l,style:s})=>{const m=a()(t,"wc-gzd-block-components-product-"+r,"wc-gzd-block-components-product-price-label",{[`wc-gzd-block-components-product-price-label--align-${e}`]:e});let i=(0,n.createElement)("span",{className:a()("wc-gzd-block-components-product-"+r+"__value",c)});return o&&(i=(0,b.isValidElement)(o)?(0,n.createElement)("span",{className:a()("wc-gzd-block-components-product-"+r+"__value",c),style:l},o):(0,n.createElement)("span",{className:a()("wc-gzd-block-components-product-"+r+"__value",c),style:l,dangerouslySetInnerHTML:{__html:o}})),(0,n.createElement)("span",{className:m,style:s},i)},h=e=>{const{className:t,textAlign:r,isDescendentOfSingleProductTemplate:o,labelType:m}=e,{parentName:i,parentClassName:u}=(0,l.useInnerBlockLayoutContext)(),{product:p}=(0,l.useProductDataContext)(),d=_(e),g="woocommerce/all-products"===i,y=a()("wc-gzd-block-components-product-"+m,t,d.className,{[`${u}__product-${m}`]:u});if(!p.id&&!o){const e=(0,n.createElement)(v,{align:r,className:y,labelType:m});if(g){const t=`wp-block-woocommerce-gzd-product-${m}`;return(0,n.createElement)("div",{className:t},e)}return e}const f=((e,t,r)=>{const o=t.hasOwnProperty("extensions")?t.extensions["woocommerce-germanized"]:{unit_price_html:"",unit_prices:{price:0,regular_price:0,sale_price:0},unit_product:0,unit_product_html:"",delivery_time_html:"",tax_info_html:"",shipping_costs_info_html:"",defect_description_html:"",nutri_score:"",nutri_score_html:"",deposit_html:"",deposit_prices:{price:0,quantity:0,amount:0},deposit_packaging_type_html:"",manufacturer_html:"",product_safety_attachments_html:"",safety_instructions_html:""},a=t.prices,l=r?(0,c.getCurrencyFromPriceResponse)():(0,c.getCurrencyFromPriceResponse)(a),m=e.replace(/-/g,"_"),i=o.hasOwnProperty(m+"_html")?o[m+"_html"]:"";let u="";return"unit_price"===m?u=(0,n.createElement)(n.Fragment,null,(0,n.createElement)(w,{currency:l,value:1e3})," / ",(0,n.createElement)("span",{className:"unit"},(0,s._x)("kg","unit","woocommerce-germanized"))):"delivery_time"===m?u=(0,s._x)("Delivery time: 2-3 days","preview","woocommerce-germanized"):"tax_info"===m?u=(0,s._x)("incl. 19 % VAT","preview","woocommerce-germanized"):"shipping_costs_info"===m?u=(0,s._x)("plus shipping costs","preview","woocommerce-germanized"):"unit_product"===m?u=(0,s.sprintf)((0,s._x)("Product includes: %1$s kg","preview","woocommerce-germanized"),10):"defect_description"===m?u=(0,s._x)("This product has a serious defect.","preview","woocommerce-germanized"):"deposit"===m?u=(0,n.createElement)(n.Fragment,null,(0,n.createElement)("span",{className:"additional"},(0,s._x)("Plus","preview","woocommerce-germanized"))," ",(0,n.createElement)(w,{currency:l,value:40})," ",(0,n.createElement)("span",{className:"deposit-notice"},(0,s._x)("deposit","preview","woocommerce-germanized"))):"deposit_packaging_type"===m?u=(0,s._x)("Disposable","preview","woocommerce-germanized"):"nutri_score"===m?u=(0,n.createElement)(n.Fragment,null,(0,n.createElement)("span",{className:"wc-gzd-nutri-score-value wc-gzd-nutri-score-value-a"},"A")):"manufacturer"===m?u=(0,n.createElement)(n.Fragment,null,(0,n.createElement)("p",null,(0,n.createElement)("stong",null,(0,s._x)("Sample company name","preview","woocommerce-germanized")),(0,n.createElement)("br",null),(0,s._x)("Sample address","preview","woocommerce-germanized"),(0,n.createElement)("br",null),(0,s._x)("12345 Berlin","preview","woocommerce-germanized"),(0,n.createElement)("br",null),(0,s._x)("sample@sample.com","preview","woocommerce-germanized")),(0,n.createElement)("h3",null,(0,s.__)("Person responsible for the EU","woocommerce-germanized")),(0,n.createElement)("p",null,(0,n.createElement)("stong",null,(0,s._x)("Sample company name","preview","woocommerce-germanized")),(0,n.createElement)("br",null),(0,s._x)("Sample address","preview","woocommerce-germanized"),(0,n.createElement)("br",null),(0,s._x)("12345 Berlin","preview","woocommerce-germanized"),(0,n.createElement)("br",null),(0,s._x)("sample@sample.com","preview","woocommerce-germanized"))):"product_safety_attachments"===m?u=(0,n.createElement)(n.Fragment,null,(0,n.createElement)("ul",null,(0,n.createElement)("li",null,(0,n.createElement)("a",{href:"#"},(0,s._x)("sample-filename.pdf","sample","woocommerce-germanized"))))):"safety_instructions"===m&&(u=(0,n.createElement)(n.Fragment,null,(0,n.createElement)("p",null,(0,s._x)("Sample safety instructions for a certain product.","preview","woocommerce-germanized"),(0,n.createElement)("br",null)))),{preview:u,data:i}})(m,p,o),b=(0,n.createElement)(v,{align:r,className:y,labelType:m,style:d.style,labelStyle:d.style,formattedLabel:o?f.preview:f.data});if(g){const e=`wp-block-woocommerce-gzd-product-${m}`;return(0,n.createElement)("div",{className:e},b)}return b}}}]); \ No newline at end of file diff --git a/build/product-deposit-packaging-type-frontend.js b/build/product-deposit-packaging-type-frontend.js new file mode 100644 index 000000000..5ecbae020 --- /dev/null +++ b/build/product-deposit-packaging-type-frontend.js @@ -0,0 +1 @@ +"use strict";(self.webpackWcBlocksJsonp=self.webpackWcBlocksJsonp||[]).push([[534],{775:function(e,t,r){r.r(t),r.d(t,{default:function(){return c}});var n=r(196),o=r(721),a=r(606),c=e=>(e={...e,labelType:"deposit-packaging-type"}).isDescendentOfSingleProductTemplate?(0,n.createElement)(a.Z,{...e}):(0,o.withProductDataContext)(a.Z)(e)},606:function(e,t,r){r.d(t,{Z:function(){return h}});var n=r(196),o=r(184),a=r.n(o),c=r(293),l=r(864),s=r(736);const m=e=>!(e=>null===e)(e)&&e instanceof Object&&e.constructor===Object,i=e=>"string"==typeof e;var p=r(857),u=r(83);function d(e={}){const t={};return(0,u.R)(e,{selector:""}).forEach((e=>{t[e.key]=e.value})),t}function g(e,t){return e&&t?`has-${(0,p.o)(t)}-${e}`:""}const _=e=>{const t=(e=>{const t=m(e)?e:{style:{}};let r=t.style;return i(r)&&(r=JSON.parse(r)||{}),m(r)||(r={}),{...t,style:r}})(e),r=function(e){const{backgroundColor:t,textColor:r,gradient:n,style:o}=e,c=g("background-color",t),l=g("color",r),s=function(e){if(e)return`has-${e}-gradient-background`}(n),i=s||o?.color?.gradient;return{className:a()(l,s,{[c]:!i&&!!c,"has-text-color":r||o?.color?.text,"has-background":t||o?.color?.background||n||o?.color?.gradient,"has-link-color":m(o?.elements?.link)?o?.elements?.link?.color:void 0}),style:d({color:o?.color||{}})}}(t),n=function(e){const t=e.style?.border||{};return{className:function(e){const{borderColor:t,style:r}=e,n=t?g("border-color",t):"";return a()({"has-border-color":!!t||!!r?.border?.color,[n]:!!n})}(e),style:d({border:t})}}(t),o=function(e){return{className:void 0,style:d({spacing:e.style?.spacing||{}})}}(t),c=(e=>{const t=m(e.style.typography)?e.style.typography:{},r=i(t.fontFamily)?t.fontFamily:"";return{className:e.fontFamily?`has-${e.fontFamily}-font-family`:r,style:{fontSize:e.fontSize?`var(--wp--preset--font-size--${e.fontSize})`:t.fontSize,fontStyle:t.fontStyle,fontWeight:t.fontWeight,letterSpacing:t.letterSpacing,lineHeight:t.lineHeight,textDecoration:t.textDecoration,textTransform:t.textTransform}}})(t);return{className:a()(c.className,r.className,n.className,o.className),style:{...c.style,...r.style,...n.style,...o.style}}};var y=r(333);const f=e=>({thousandSeparator:e?.thousandSeparator,decimalSeparator:e?.decimalSeparator,fixedDecimalScale:!0,prefix:e?.prefix,suffix:e?.suffix,isNumericString:!0});var w=({className:e,value:t,currency:r,onValueChange:o,displayType:c="text",...l})=>{var s;const m="string"==typeof t?parseInt(t,10):t;if(!Number.isFinite(m))return null;const i=m/10**r.minorUnit;if(!Number.isFinite(i))return null;const p=a()("wc-block-formatted-money-amount","wc-block-components-formatted-money-amount",e),u=null!==(s=l.decimalScale)&&void 0!==s?s:r?.minorUnit,d={...l,...f(r),decimalScale:u,value:void 0,currency:void 0,onValueChange:void 0},g=o?e=>{const t=+e.value*10**r.minorUnit;o(t)}:()=>{};return(0,n.createElement)(y.Z,{className:p,displayType:c,...d,value:i,onValueChange:g})},b=r(307),v=({align:e,className:t,labelType:r,formattedLabel:o,labelClassName:c,labelStyle:l,style:s})=>{const m=a()(t,"wc-gzd-block-components-product-"+r,"wc-gzd-block-components-product-price-label",{[`wc-gzd-block-components-product-price-label--align-${e}`]:e});let i=(0,n.createElement)("span",{className:a()("wc-gzd-block-components-product-"+r+"__value",c)});return o&&(i=(0,b.isValidElement)(o)?(0,n.createElement)("span",{className:a()("wc-gzd-block-components-product-"+r+"__value",c),style:l},o):(0,n.createElement)("span",{className:a()("wc-gzd-block-components-product-"+r+"__value",c),style:l,dangerouslySetInnerHTML:{__html:o}})),(0,n.createElement)("span",{className:m,style:s},i)},h=e=>{const{className:t,textAlign:r,isDescendentOfSingleProductTemplate:o,labelType:m}=e,{parentName:i,parentClassName:p}=(0,l.useInnerBlockLayoutContext)(),{product:u}=(0,l.useProductDataContext)(),d=_(e),g="woocommerce/all-products"===i,y=a()("wc-gzd-block-components-product-"+m,t,d.className,{[`${p}__product-${m}`]:p});if(!u.id&&!o){const e=(0,n.createElement)(v,{align:r,className:y,labelType:m});if(g){const t=`wp-block-woocommerce-gzd-product-${m}`;return(0,n.createElement)("div",{className:t},e)}return e}const f=((e,t,r)=>{const o=t.hasOwnProperty("extensions")?t.extensions["woocommerce-germanized"]:{unit_price_html:"",unit_prices:{price:0,regular_price:0,sale_price:0},unit_product:0,unit_product_html:"",delivery_time_html:"",tax_info_html:"",shipping_costs_info_html:"",defect_description_html:"",nutri_score:"",nutri_score_html:"",deposit_html:"",deposit_prices:{price:0,quantity:0,amount:0},deposit_packaging_type_html:"",manufacturer_html:"",product_safety_attachments_html:"",safety_instructions_html:""},a=t.prices,l=r?(0,c.getCurrencyFromPriceResponse)():(0,c.getCurrencyFromPriceResponse)(a),m=e.replace(/-/g,"_"),i=o.hasOwnProperty(m+"_html")?o[m+"_html"]:"";let p="";return"unit_price"===m?p=(0,n.createElement)(n.Fragment,null,(0,n.createElement)(w,{currency:l,value:1e3})," / ",(0,n.createElement)("span",{className:"unit"},(0,s._x)("kg","unit","woocommerce-germanized"))):"delivery_time"===m?p=(0,s._x)("Delivery time: 2-3 days","preview","woocommerce-germanized"):"tax_info"===m?p=(0,s._x)("incl. 19 % VAT","preview","woocommerce-germanized"):"shipping_costs_info"===m?p=(0,s._x)("plus shipping costs","preview","woocommerce-germanized"):"unit_product"===m?p=(0,s.sprintf)((0,s._x)("Product includes: %1$s kg","preview","woocommerce-germanized"),10):"defect_description"===m?p=(0,s._x)("This product has a serious defect.","preview","woocommerce-germanized"):"deposit"===m?p=(0,n.createElement)(n.Fragment,null,(0,n.createElement)("span",{className:"additional"},(0,s._x)("Plus","preview","woocommerce-germanized"))," ",(0,n.createElement)(w,{currency:l,value:40})," ",(0,n.createElement)("span",{className:"deposit-notice"},(0,s._x)("deposit","preview","woocommerce-germanized"))):"deposit_packaging_type"===m?p=(0,s._x)("Disposable","preview","woocommerce-germanized"):"nutri_score"===m?p=(0,n.createElement)(n.Fragment,null,(0,n.createElement)("span",{className:"wc-gzd-nutri-score-value wc-gzd-nutri-score-value-a"},"A")):"manufacturer"===m?p=(0,n.createElement)(n.Fragment,null,(0,n.createElement)("p",null,(0,n.createElement)("stong",null,(0,s._x)("Sample company name","preview","woocommerce-germanized")),(0,n.createElement)("br",null),(0,s._x)("Sample address","preview","woocommerce-germanized"),(0,n.createElement)("br",null),(0,s._x)("12345 Berlin","preview","woocommerce-germanized"),(0,n.createElement)("br",null),(0,s._x)("sample@sample.com","preview","woocommerce-germanized")),(0,n.createElement)("h3",null,(0,s.__)("Person responsible for the EU","woocommerce-germanized")),(0,n.createElement)("p",null,(0,n.createElement)("stong",null,(0,s._x)("Sample company name","preview","woocommerce-germanized")),(0,n.createElement)("br",null),(0,s._x)("Sample address","preview","woocommerce-germanized"),(0,n.createElement)("br",null),(0,s._x)("12345 Berlin","preview","woocommerce-germanized"),(0,n.createElement)("br",null),(0,s._x)("sample@sample.com","preview","woocommerce-germanized"))):"product_safety_attachments"===m?p=(0,n.createElement)(n.Fragment,null,(0,n.createElement)("ul",null,(0,n.createElement)("li",null,(0,n.createElement)("a",{href:"#"},(0,s._x)("sample-filename.pdf","sample","woocommerce-germanized"))))):"safety_instructions"===m&&(p=(0,n.createElement)(n.Fragment,null,(0,n.createElement)("p",null,(0,s._x)("Sample safety instructions for a certain product.","preview","woocommerce-germanized"),(0,n.createElement)("br",null)))),{preview:p,data:i}})(m,u,o),b=(0,n.createElement)(v,{align:r,className:y,labelType:m,style:d.style,labelStyle:d.style,formattedLabel:o?f.preview:f.data});if(g){const e=`wp-block-woocommerce-gzd-product-${m}`;return(0,n.createElement)("div",{className:e},b)}return b}}}]); \ No newline at end of file diff --git a/build/product-deposit-packaging-type.css b/build/product-deposit-packaging-type.css new file mode 100644 index 000000000..1114283cc --- /dev/null +++ b/build/product-deposit-packaging-type.css @@ -0,0 +1 @@ +.wc-gzd-block-components-product-price-label{display:block}.wc-gzd-block-components-product-price-label.wc-gzd-block-components-product-price-label--align-center{text-align:center}.wc-gzd-block-components-product-price-label.wc-gzd-block-components-product-price-label--align-right{text-align:right}.wc-gzd-block-components-product-deposit-packaging-type{text-transform:uppercase}.wc-gzd-block-components-product-nutri-score .wc-gzd-nutri-score-value{height:4rem;width:7.0625rem;display:block;text-indent:-9999px} diff --git a/build/product-deposit.css b/build/product-deposit.css new file mode 100644 index 000000000..1114283cc --- /dev/null +++ b/build/product-deposit.css @@ -0,0 +1 @@ +.wc-gzd-block-components-product-price-label{display:block}.wc-gzd-block-components-product-price-label.wc-gzd-block-components-product-price-label--align-center{text-align:center}.wc-gzd-block-components-product-price-label.wc-gzd-block-components-product-price-label--align-right{text-align:right}.wc-gzd-block-components-product-deposit-packaging-type{text-transform:uppercase}.wc-gzd-block-components-product-nutri-score .wc-gzd-nutri-score-value{height:4rem;width:7.0625rem;display:block;text-indent:-9999px} diff --git a/build/product-manufacturer-frontend.js b/build/product-manufacturer-frontend.js new file mode 100644 index 000000000..79c073137 --- /dev/null +++ b/build/product-manufacturer-frontend.js @@ -0,0 +1 @@ +"use strict";(self.webpackWcBlocksJsonp=self.webpackWcBlocksJsonp||[]).push([[284],{541:function(e,t,r){r.r(t),r.d(t,{default:function(){return c}});var n=r(196),o=r(721),a=r(606),c=e=>(e={...e,labelType:"manufacturer"}).isDescendentOfSingleProductTemplate?(0,n.createElement)(a.Z,{...e}):(0,o.withProductDataContext)(a.Z)(e)},606:function(e,t,r){r.d(t,{Z:function(){return h}});var n=r(196),o=r(184),a=r.n(o),c=r(293),l=r(864),s=r(736);const m=e=>!(e=>null===e)(e)&&e instanceof Object&&e.constructor===Object,i=e=>"string"==typeof e;var u=r(857),p=r(83);function d(e={}){const t={};return(0,p.R)(e,{selector:""}).forEach((e=>{t[e.key]=e.value})),t}function g(e,t){return e&&t?`has-${(0,u.o)(t)}-${e}`:""}const _=e=>{const t=(e=>{const t=m(e)?e:{style:{}};let r=t.style;return i(r)&&(r=JSON.parse(r)||{}),m(r)||(r={}),{...t,style:r}})(e),r=function(e){const{backgroundColor:t,textColor:r,gradient:n,style:o}=e,c=g("background-color",t),l=g("color",r),s=function(e){if(e)return`has-${e}-gradient-background`}(n),i=s||o?.color?.gradient;return{className:a()(l,s,{[c]:!i&&!!c,"has-text-color":r||o?.color?.text,"has-background":t||o?.color?.background||n||o?.color?.gradient,"has-link-color":m(o?.elements?.link)?o?.elements?.link?.color:void 0}),style:d({color:o?.color||{}})}}(t),n=function(e){const t=e.style?.border||{};return{className:function(e){const{borderColor:t,style:r}=e,n=t?g("border-color",t):"";return a()({"has-border-color":!!t||!!r?.border?.color,[n]:!!n})}(e),style:d({border:t})}}(t),o=function(e){return{className:void 0,style:d({spacing:e.style?.spacing||{}})}}(t),c=(e=>{const t=m(e.style.typography)?e.style.typography:{},r=i(t.fontFamily)?t.fontFamily:"";return{className:e.fontFamily?`has-${e.fontFamily}-font-family`:r,style:{fontSize:e.fontSize?`var(--wp--preset--font-size--${e.fontSize})`:t.fontSize,fontStyle:t.fontStyle,fontWeight:t.fontWeight,letterSpacing:t.letterSpacing,lineHeight:t.lineHeight,textDecoration:t.textDecoration,textTransform:t.textTransform}}})(t);return{className:a()(c.className,r.className,n.className,o.className),style:{...c.style,...r.style,...n.style,...o.style}}};var y=r(333);const f=e=>({thousandSeparator:e?.thousandSeparator,decimalSeparator:e?.decimalSeparator,fixedDecimalScale:!0,prefix:e?.prefix,suffix:e?.suffix,isNumericString:!0});var w=({className:e,value:t,currency:r,onValueChange:o,displayType:c="text",...l})=>{var s;const m="string"==typeof t?parseInt(t,10):t;if(!Number.isFinite(m))return null;const i=m/10**r.minorUnit;if(!Number.isFinite(i))return null;const u=a()("wc-block-formatted-money-amount","wc-block-components-formatted-money-amount",e),p=null!==(s=l.decimalScale)&&void 0!==s?s:r?.minorUnit,d={...l,...f(r),decimalScale:p,value:void 0,currency:void 0,onValueChange:void 0},g=o?e=>{const t=+e.value*10**r.minorUnit;o(t)}:()=>{};return(0,n.createElement)(y.Z,{className:u,displayType:c,...d,value:i,onValueChange:g})},b=r(307),v=({align:e,className:t,labelType:r,formattedLabel:o,labelClassName:c,labelStyle:l,style:s})=>{const m=a()(t,"wc-gzd-block-components-product-"+r,"wc-gzd-block-components-product-price-label",{[`wc-gzd-block-components-product-price-label--align-${e}`]:e});let i=(0,n.createElement)("span",{className:a()("wc-gzd-block-components-product-"+r+"__value",c)});return o&&(i=(0,b.isValidElement)(o)?(0,n.createElement)("span",{className:a()("wc-gzd-block-components-product-"+r+"__value",c),style:l},o):(0,n.createElement)("span",{className:a()("wc-gzd-block-components-product-"+r+"__value",c),style:l,dangerouslySetInnerHTML:{__html:o}})),(0,n.createElement)("span",{className:m,style:s},i)},h=e=>{const{className:t,textAlign:r,isDescendentOfSingleProductTemplate:o,labelType:m}=e,{parentName:i,parentClassName:u}=(0,l.useInnerBlockLayoutContext)(),{product:p}=(0,l.useProductDataContext)(),d=_(e),g="woocommerce/all-products"===i,y=a()("wc-gzd-block-components-product-"+m,t,d.className,{[`${u}__product-${m}`]:u});if(!p.id&&!o){const e=(0,n.createElement)(v,{align:r,className:y,labelType:m});if(g){const t=`wp-block-woocommerce-gzd-product-${m}`;return(0,n.createElement)("div",{className:t},e)}return e}const f=((e,t,r)=>{const o=t.hasOwnProperty("extensions")?t.extensions["woocommerce-germanized"]:{unit_price_html:"",unit_prices:{price:0,regular_price:0,sale_price:0},unit_product:0,unit_product_html:"",delivery_time_html:"",tax_info_html:"",shipping_costs_info_html:"",defect_description_html:"",nutri_score:"",nutri_score_html:"",deposit_html:"",deposit_prices:{price:0,quantity:0,amount:0},deposit_packaging_type_html:"",manufacturer_html:"",product_safety_attachments_html:"",safety_instructions_html:""},a=t.prices,l=r?(0,c.getCurrencyFromPriceResponse)():(0,c.getCurrencyFromPriceResponse)(a),m=e.replace(/-/g,"_"),i=o.hasOwnProperty(m+"_html")?o[m+"_html"]:"";let u="";return"unit_price"===m?u=(0,n.createElement)(n.Fragment,null,(0,n.createElement)(w,{currency:l,value:1e3})," / ",(0,n.createElement)("span",{className:"unit"},(0,s._x)("kg","unit","woocommerce-germanized"))):"delivery_time"===m?u=(0,s._x)("Delivery time: 2-3 days","preview","woocommerce-germanized"):"tax_info"===m?u=(0,s._x)("incl. 19 % VAT","preview","woocommerce-germanized"):"shipping_costs_info"===m?u=(0,s._x)("plus shipping costs","preview","woocommerce-germanized"):"unit_product"===m?u=(0,s.sprintf)((0,s._x)("Product includes: %1$s kg","preview","woocommerce-germanized"),10):"defect_description"===m?u=(0,s._x)("This product has a serious defect.","preview","woocommerce-germanized"):"deposit"===m?u=(0,n.createElement)(n.Fragment,null,(0,n.createElement)("span",{className:"additional"},(0,s._x)("Plus","preview","woocommerce-germanized"))," ",(0,n.createElement)(w,{currency:l,value:40})," ",(0,n.createElement)("span",{className:"deposit-notice"},(0,s._x)("deposit","preview","woocommerce-germanized"))):"deposit_packaging_type"===m?u=(0,s._x)("Disposable","preview","woocommerce-germanized"):"nutri_score"===m?u=(0,n.createElement)(n.Fragment,null,(0,n.createElement)("span",{className:"wc-gzd-nutri-score-value wc-gzd-nutri-score-value-a"},"A")):"manufacturer"===m?u=(0,n.createElement)(n.Fragment,null,(0,n.createElement)("p",null,(0,n.createElement)("stong",null,(0,s._x)("Sample company name","preview","woocommerce-germanized")),(0,n.createElement)("br",null),(0,s._x)("Sample address","preview","woocommerce-germanized"),(0,n.createElement)("br",null),(0,s._x)("12345 Berlin","preview","woocommerce-germanized"),(0,n.createElement)("br",null),(0,s._x)("sample@sample.com","preview","woocommerce-germanized")),(0,n.createElement)("h3",null,(0,s.__)("Person responsible for the EU","woocommerce-germanized")),(0,n.createElement)("p",null,(0,n.createElement)("stong",null,(0,s._x)("Sample company name","preview","woocommerce-germanized")),(0,n.createElement)("br",null),(0,s._x)("Sample address","preview","woocommerce-germanized"),(0,n.createElement)("br",null),(0,s._x)("12345 Berlin","preview","woocommerce-germanized"),(0,n.createElement)("br",null),(0,s._x)("sample@sample.com","preview","woocommerce-germanized"))):"product_safety_attachments"===m?u=(0,n.createElement)(n.Fragment,null,(0,n.createElement)("ul",null,(0,n.createElement)("li",null,(0,n.createElement)("a",{href:"#"},(0,s._x)("sample-filename.pdf","sample","woocommerce-germanized"))))):"safety_instructions"===m&&(u=(0,n.createElement)(n.Fragment,null,(0,n.createElement)("p",null,(0,s._x)("Sample safety instructions for a certain product.","preview","woocommerce-germanized"),(0,n.createElement)("br",null)))),{preview:u,data:i}})(m,p,o),b=(0,n.createElement)(v,{align:r,className:y,labelType:m,style:d.style,labelStyle:d.style,formattedLabel:o?f.preview:f.data});if(g){const e=`wp-block-woocommerce-gzd-product-${m}`;return(0,n.createElement)("div",{className:e},b)}return b}}}]); \ No newline at end of file diff --git a/build/product-manufacturer.css b/build/product-manufacturer.css new file mode 100644 index 000000000..1114283cc --- /dev/null +++ b/build/product-manufacturer.css @@ -0,0 +1 @@ +.wc-gzd-block-components-product-price-label{display:block}.wc-gzd-block-components-product-price-label.wc-gzd-block-components-product-price-label--align-center{text-align:center}.wc-gzd-block-components-product-price-label.wc-gzd-block-components-product-price-label--align-right{text-align:right}.wc-gzd-block-components-product-deposit-packaging-type{text-transform:uppercase}.wc-gzd-block-components-product-nutri-score .wc-gzd-nutri-score-value{height:4rem;width:7.0625rem;display:block;text-indent:-9999px} diff --git a/build/product-nutri-score-frontend.js b/build/product-nutri-score-frontend.js new file mode 100644 index 000000000..2a6839dae --- /dev/null +++ b/build/product-nutri-score-frontend.js @@ -0,0 +1 @@ +"use strict";(self.webpackWcBlocksJsonp=self.webpackWcBlocksJsonp||[]).push([[128],{744:function(e,t,r){r.r(t),r.d(t,{default:function(){return c}});var n=r(196),o=r(721),a=r(606),c=e=>(e={...e,labelType:"nutri-score"}).isDescendentOfSingleProductTemplate?(0,n.createElement)(a.Z,{...e}):(0,o.withProductDataContext)(a.Z)(e)},606:function(e,t,r){r.d(t,{Z:function(){return h}});var n=r(196),o=r(184),a=r.n(o),c=r(293),l=r(864),s=r(736);const m=e=>!(e=>null===e)(e)&&e instanceof Object&&e.constructor===Object,i=e=>"string"==typeof e;var u=r(857),p=r(83);function d(e={}){const t={};return(0,p.R)(e,{selector:""}).forEach((e=>{t[e.key]=e.value})),t}function g(e,t){return e&&t?`has-${(0,u.o)(t)}-${e}`:""}const _=e=>{const t=(e=>{const t=m(e)?e:{style:{}};let r=t.style;return i(r)&&(r=JSON.parse(r)||{}),m(r)||(r={}),{...t,style:r}})(e),r=function(e){const{backgroundColor:t,textColor:r,gradient:n,style:o}=e,c=g("background-color",t),l=g("color",r),s=function(e){if(e)return`has-${e}-gradient-background`}(n),i=s||o?.color?.gradient;return{className:a()(l,s,{[c]:!i&&!!c,"has-text-color":r||o?.color?.text,"has-background":t||o?.color?.background||n||o?.color?.gradient,"has-link-color":m(o?.elements?.link)?o?.elements?.link?.color:void 0}),style:d({color:o?.color||{}})}}(t),n=function(e){const t=e.style?.border||{};return{className:function(e){const{borderColor:t,style:r}=e,n=t?g("border-color",t):"";return a()({"has-border-color":!!t||!!r?.border?.color,[n]:!!n})}(e),style:d({border:t})}}(t),o=function(e){return{className:void 0,style:d({spacing:e.style?.spacing||{}})}}(t),c=(e=>{const t=m(e.style.typography)?e.style.typography:{},r=i(t.fontFamily)?t.fontFamily:"";return{className:e.fontFamily?`has-${e.fontFamily}-font-family`:r,style:{fontSize:e.fontSize?`var(--wp--preset--font-size--${e.fontSize})`:t.fontSize,fontStyle:t.fontStyle,fontWeight:t.fontWeight,letterSpacing:t.letterSpacing,lineHeight:t.lineHeight,textDecoration:t.textDecoration,textTransform:t.textTransform}}})(t);return{className:a()(c.className,r.className,n.className,o.className),style:{...c.style,...r.style,...n.style,...o.style}}};var y=r(333);const f=e=>({thousandSeparator:e?.thousandSeparator,decimalSeparator:e?.decimalSeparator,fixedDecimalScale:!0,prefix:e?.prefix,suffix:e?.suffix,isNumericString:!0});var w=({className:e,value:t,currency:r,onValueChange:o,displayType:c="text",...l})=>{var s;const m="string"==typeof t?parseInt(t,10):t;if(!Number.isFinite(m))return null;const i=m/10**r.minorUnit;if(!Number.isFinite(i))return null;const u=a()("wc-block-formatted-money-amount","wc-block-components-formatted-money-amount",e),p=null!==(s=l.decimalScale)&&void 0!==s?s:r?.minorUnit,d={...l,...f(r),decimalScale:p,value:void 0,currency:void 0,onValueChange:void 0},g=o?e=>{const t=+e.value*10**r.minorUnit;o(t)}:()=>{};return(0,n.createElement)(y.Z,{className:u,displayType:c,...d,value:i,onValueChange:g})},b=r(307),v=({align:e,className:t,labelType:r,formattedLabel:o,labelClassName:c,labelStyle:l,style:s})=>{const m=a()(t,"wc-gzd-block-components-product-"+r,"wc-gzd-block-components-product-price-label",{[`wc-gzd-block-components-product-price-label--align-${e}`]:e});let i=(0,n.createElement)("span",{className:a()("wc-gzd-block-components-product-"+r+"__value",c)});return o&&(i=(0,b.isValidElement)(o)?(0,n.createElement)("span",{className:a()("wc-gzd-block-components-product-"+r+"__value",c),style:l},o):(0,n.createElement)("span",{className:a()("wc-gzd-block-components-product-"+r+"__value",c),style:l,dangerouslySetInnerHTML:{__html:o}})),(0,n.createElement)("span",{className:m,style:s},i)},h=e=>{const{className:t,textAlign:r,isDescendentOfSingleProductTemplate:o,labelType:m}=e,{parentName:i,parentClassName:u}=(0,l.useInnerBlockLayoutContext)(),{product:p}=(0,l.useProductDataContext)(),d=_(e),g="woocommerce/all-products"===i,y=a()("wc-gzd-block-components-product-"+m,t,d.className,{[`${u}__product-${m}`]:u});if(!p.id&&!o){const e=(0,n.createElement)(v,{align:r,className:y,labelType:m});if(g){const t=`wp-block-woocommerce-gzd-product-${m}`;return(0,n.createElement)("div",{className:t},e)}return e}const f=((e,t,r)=>{const o=t.hasOwnProperty("extensions")?t.extensions["woocommerce-germanized"]:{unit_price_html:"",unit_prices:{price:0,regular_price:0,sale_price:0},unit_product:0,unit_product_html:"",delivery_time_html:"",tax_info_html:"",shipping_costs_info_html:"",defect_description_html:"",nutri_score:"",nutri_score_html:"",deposit_html:"",deposit_prices:{price:0,quantity:0,amount:0},deposit_packaging_type_html:"",manufacturer_html:"",product_safety_attachments_html:"",safety_instructions_html:""},a=t.prices,l=r?(0,c.getCurrencyFromPriceResponse)():(0,c.getCurrencyFromPriceResponse)(a),m=e.replace(/-/g,"_"),i=o.hasOwnProperty(m+"_html")?o[m+"_html"]:"";let u="";return"unit_price"===m?u=(0,n.createElement)(n.Fragment,null,(0,n.createElement)(w,{currency:l,value:1e3})," / ",(0,n.createElement)("span",{className:"unit"},(0,s._x)("kg","unit","woocommerce-germanized"))):"delivery_time"===m?u=(0,s._x)("Delivery time: 2-3 days","preview","woocommerce-germanized"):"tax_info"===m?u=(0,s._x)("incl. 19 % VAT","preview","woocommerce-germanized"):"shipping_costs_info"===m?u=(0,s._x)("plus shipping costs","preview","woocommerce-germanized"):"unit_product"===m?u=(0,s.sprintf)((0,s._x)("Product includes: %1$s kg","preview","woocommerce-germanized"),10):"defect_description"===m?u=(0,s._x)("This product has a serious defect.","preview","woocommerce-germanized"):"deposit"===m?u=(0,n.createElement)(n.Fragment,null,(0,n.createElement)("span",{className:"additional"},(0,s._x)("Plus","preview","woocommerce-germanized"))," ",(0,n.createElement)(w,{currency:l,value:40})," ",(0,n.createElement)("span",{className:"deposit-notice"},(0,s._x)("deposit","preview","woocommerce-germanized"))):"deposit_packaging_type"===m?u=(0,s._x)("Disposable","preview","woocommerce-germanized"):"nutri_score"===m?u=(0,n.createElement)(n.Fragment,null,(0,n.createElement)("span",{className:"wc-gzd-nutri-score-value wc-gzd-nutri-score-value-a"},"A")):"manufacturer"===m?u=(0,n.createElement)(n.Fragment,null,(0,n.createElement)("p",null,(0,n.createElement)("stong",null,(0,s._x)("Sample company name","preview","woocommerce-germanized")),(0,n.createElement)("br",null),(0,s._x)("Sample address","preview","woocommerce-germanized"),(0,n.createElement)("br",null),(0,s._x)("12345 Berlin","preview","woocommerce-germanized"),(0,n.createElement)("br",null),(0,s._x)("sample@sample.com","preview","woocommerce-germanized")),(0,n.createElement)("h3",null,(0,s.__)("Person responsible for the EU","woocommerce-germanized")),(0,n.createElement)("p",null,(0,n.createElement)("stong",null,(0,s._x)("Sample company name","preview","woocommerce-germanized")),(0,n.createElement)("br",null),(0,s._x)("Sample address","preview","woocommerce-germanized"),(0,n.createElement)("br",null),(0,s._x)("12345 Berlin","preview","woocommerce-germanized"),(0,n.createElement)("br",null),(0,s._x)("sample@sample.com","preview","woocommerce-germanized"))):"product_safety_attachments"===m?u=(0,n.createElement)(n.Fragment,null,(0,n.createElement)("ul",null,(0,n.createElement)("li",null,(0,n.createElement)("a",{href:"#"},(0,s._x)("sample-filename.pdf","sample","woocommerce-germanized"))))):"safety_instructions"===m&&(u=(0,n.createElement)(n.Fragment,null,(0,n.createElement)("p",null,(0,s._x)("Sample safety instructions for a certain product.","preview","woocommerce-germanized"),(0,n.createElement)("br",null)))),{preview:u,data:i}})(m,p,o),b=(0,n.createElement)(v,{align:r,className:y,labelType:m,style:d.style,labelStyle:d.style,formattedLabel:o?f.preview:f.data});if(g){const e=`wp-block-woocommerce-gzd-product-${m}`;return(0,n.createElement)("div",{className:e},b)}return b}}}]); \ No newline at end of file diff --git a/build/product-nutri-score.css b/build/product-nutri-score.css new file mode 100644 index 000000000..1114283cc --- /dev/null +++ b/build/product-nutri-score.css @@ -0,0 +1 @@ +.wc-gzd-block-components-product-price-label{display:block}.wc-gzd-block-components-product-price-label.wc-gzd-block-components-product-price-label--align-center{text-align:center}.wc-gzd-block-components-product-price-label.wc-gzd-block-components-product-price-label--align-right{text-align:right}.wc-gzd-block-components-product-deposit-packaging-type{text-transform:uppercase}.wc-gzd-block-components-product-nutri-score .wc-gzd-nutri-score-value{height:4rem;width:7.0625rem;display:block;text-indent:-9999px} diff --git a/build/product-safety-attachments-frontend.js b/build/product-safety-attachments-frontend.js new file mode 100644 index 000000000..badf6e14c --- /dev/null +++ b/build/product-safety-attachments-frontend.js @@ -0,0 +1 @@ +"use strict";(self.webpackWcBlocksJsonp=self.webpackWcBlocksJsonp||[]).push([[545],{895:function(e,t,r){r.r(t),r.d(t,{default:function(){return c}});var n=r(196),o=r(721),a=r(606),c=e=>(e={...e,labelType:"product_safety_attachments"}).isDescendentOfSingleProductTemplate?(0,n.createElement)(a.Z,{...e}):(0,o.withProductDataContext)(a.Z)(e)},606:function(e,t,r){r.d(t,{Z:function(){return v}});var n=r(196),o=r(184),a=r.n(o),c=r(293),l=r(864),s=r(736);const m=e=>!(e=>null===e)(e)&&e instanceof Object&&e.constructor===Object,i=e=>"string"==typeof e;var u=r(857),p=r(83);function d(e={}){const t={};return(0,p.R)(e,{selector:""}).forEach((e=>{t[e.key]=e.value})),t}function g(e,t){return e&&t?`has-${(0,u.o)(t)}-${e}`:""}const _=e=>{const t=(e=>{const t=m(e)?e:{style:{}};let r=t.style;return i(r)&&(r=JSON.parse(r)||{}),m(r)||(r={}),{...t,style:r}})(e),r=function(e){const{backgroundColor:t,textColor:r,gradient:n,style:o}=e,c=g("background-color",t),l=g("color",r),s=function(e){if(e)return`has-${e}-gradient-background`}(n),i=s||o?.color?.gradient;return{className:a()(l,s,{[c]:!i&&!!c,"has-text-color":r||o?.color?.text,"has-background":t||o?.color?.background||n||o?.color?.gradient,"has-link-color":m(o?.elements?.link)?o?.elements?.link?.color:void 0}),style:d({color:o?.color||{}})}}(t),n=function(e){const t=e.style?.border||{};return{className:function(e){const{borderColor:t,style:r}=e,n=t?g("border-color",t):"";return a()({"has-border-color":!!t||!!r?.border?.color,[n]:!!n})}(e),style:d({border:t})}}(t),o=function(e){return{className:void 0,style:d({spacing:e.style?.spacing||{}})}}(t),c=(e=>{const t=m(e.style.typography)?e.style.typography:{},r=i(t.fontFamily)?t.fontFamily:"";return{className:e.fontFamily?`has-${e.fontFamily}-font-family`:r,style:{fontSize:e.fontSize?`var(--wp--preset--font-size--${e.fontSize})`:t.fontSize,fontStyle:t.fontStyle,fontWeight:t.fontWeight,letterSpacing:t.letterSpacing,lineHeight:t.lineHeight,textDecoration:t.textDecoration,textTransform:t.textTransform}}})(t);return{className:a()(c.className,r.className,n.className,o.className),style:{...c.style,...r.style,...n.style,...o.style}}};var y=r(333);const f=e=>({thousandSeparator:e?.thousandSeparator,decimalSeparator:e?.decimalSeparator,fixedDecimalScale:!0,prefix:e?.prefix,suffix:e?.suffix,isNumericString:!0});var w=({className:e,value:t,currency:r,onValueChange:o,displayType:c="text",...l})=>{var s;const m="string"==typeof t?parseInt(t,10):t;if(!Number.isFinite(m))return null;const i=m/10**r.minorUnit;if(!Number.isFinite(i))return null;const u=a()("wc-block-formatted-money-amount","wc-block-components-formatted-money-amount",e),p=null!==(s=l.decimalScale)&&void 0!==s?s:r?.minorUnit,d={...l,...f(r),decimalScale:p,value:void 0,currency:void 0,onValueChange:void 0},g=o?e=>{const t=+e.value*10**r.minorUnit;o(t)}:()=>{};return(0,n.createElement)(y.Z,{className:u,displayType:c,...d,value:i,onValueChange:g})},b=r(307),h=({align:e,className:t,labelType:r,formattedLabel:o,labelClassName:c,labelStyle:l,style:s})=>{const m=a()(t,"wc-gzd-block-components-product-"+r,"wc-gzd-block-components-product-price-label",{[`wc-gzd-block-components-product-price-label--align-${e}`]:e});let i=(0,n.createElement)("span",{className:a()("wc-gzd-block-components-product-"+r+"__value",c)});return o&&(i=(0,b.isValidElement)(o)?(0,n.createElement)("span",{className:a()("wc-gzd-block-components-product-"+r+"__value",c),style:l},o):(0,n.createElement)("span",{className:a()("wc-gzd-block-components-product-"+r+"__value",c),style:l,dangerouslySetInnerHTML:{__html:o}})),(0,n.createElement)("span",{className:m,style:s},i)},v=e=>{const{className:t,textAlign:r,isDescendentOfSingleProductTemplate:o,labelType:m}=e,{parentName:i,parentClassName:u}=(0,l.useInnerBlockLayoutContext)(),{product:p}=(0,l.useProductDataContext)(),d=_(e),g="woocommerce/all-products"===i,y=a()("wc-gzd-block-components-product-"+m,t,d.className,{[`${u}__product-${m}`]:u});if(!p.id&&!o){const e=(0,n.createElement)(h,{align:r,className:y,labelType:m});if(g){const t=`wp-block-woocommerce-gzd-product-${m}`;return(0,n.createElement)("div",{className:t},e)}return e}const f=((e,t,r)=>{const o=t.hasOwnProperty("extensions")?t.extensions["woocommerce-germanized"]:{unit_price_html:"",unit_prices:{price:0,regular_price:0,sale_price:0},unit_product:0,unit_product_html:"",delivery_time_html:"",tax_info_html:"",shipping_costs_info_html:"",defect_description_html:"",nutri_score:"",nutri_score_html:"",deposit_html:"",deposit_prices:{price:0,quantity:0,amount:0},deposit_packaging_type_html:"",manufacturer_html:"",product_safety_attachments_html:"",safety_instructions_html:""},a=t.prices,l=r?(0,c.getCurrencyFromPriceResponse)():(0,c.getCurrencyFromPriceResponse)(a),m=e.replace(/-/g,"_"),i=o.hasOwnProperty(m+"_html")?o[m+"_html"]:"";let u="";return"unit_price"===m?u=(0,n.createElement)(n.Fragment,null,(0,n.createElement)(w,{currency:l,value:1e3})," / ",(0,n.createElement)("span",{className:"unit"},(0,s._x)("kg","unit","woocommerce-germanized"))):"delivery_time"===m?u=(0,s._x)("Delivery time: 2-3 days","preview","woocommerce-germanized"):"tax_info"===m?u=(0,s._x)("incl. 19 % VAT","preview","woocommerce-germanized"):"shipping_costs_info"===m?u=(0,s._x)("plus shipping costs","preview","woocommerce-germanized"):"unit_product"===m?u=(0,s.sprintf)((0,s._x)("Product includes: %1$s kg","preview","woocommerce-germanized"),10):"defect_description"===m?u=(0,s._x)("This product has a serious defect.","preview","woocommerce-germanized"):"deposit"===m?u=(0,n.createElement)(n.Fragment,null,(0,n.createElement)("span",{className:"additional"},(0,s._x)("Plus","preview","woocommerce-germanized"))," ",(0,n.createElement)(w,{currency:l,value:40})," ",(0,n.createElement)("span",{className:"deposit-notice"},(0,s._x)("deposit","preview","woocommerce-germanized"))):"deposit_packaging_type"===m?u=(0,s._x)("Disposable","preview","woocommerce-germanized"):"nutri_score"===m?u=(0,n.createElement)(n.Fragment,null,(0,n.createElement)("span",{className:"wc-gzd-nutri-score-value wc-gzd-nutri-score-value-a"},"A")):"manufacturer"===m?u=(0,n.createElement)(n.Fragment,null,(0,n.createElement)("p",null,(0,n.createElement)("stong",null,(0,s._x)("Sample company name","preview","woocommerce-germanized")),(0,n.createElement)("br",null),(0,s._x)("Sample address","preview","woocommerce-germanized"),(0,n.createElement)("br",null),(0,s._x)("12345 Berlin","preview","woocommerce-germanized"),(0,n.createElement)("br",null),(0,s._x)("sample@sample.com","preview","woocommerce-germanized")),(0,n.createElement)("h3",null,(0,s.__)("Person responsible for the EU","woocommerce-germanized")),(0,n.createElement)("p",null,(0,n.createElement)("stong",null,(0,s._x)("Sample company name","preview","woocommerce-germanized")),(0,n.createElement)("br",null),(0,s._x)("Sample address","preview","woocommerce-germanized"),(0,n.createElement)("br",null),(0,s._x)("12345 Berlin","preview","woocommerce-germanized"),(0,n.createElement)("br",null),(0,s._x)("sample@sample.com","preview","woocommerce-germanized"))):"product_safety_attachments"===m?u=(0,n.createElement)(n.Fragment,null,(0,n.createElement)("ul",null,(0,n.createElement)("li",null,(0,n.createElement)("a",{href:"#"},(0,s._x)("sample-filename.pdf","sample","woocommerce-germanized"))))):"safety_instructions"===m&&(u=(0,n.createElement)(n.Fragment,null,(0,n.createElement)("p",null,(0,s._x)("Sample safety instructions for a certain product.","preview","woocommerce-germanized"),(0,n.createElement)("br",null)))),{preview:u,data:i}})(m,p,o),b=(0,n.createElement)(h,{align:r,className:y,labelType:m,style:d.style,labelStyle:d.style,formattedLabel:o?f.preview:f.data});if(g){const e=`wp-block-woocommerce-gzd-product-${m}`;return(0,n.createElement)("div",{className:e},b)}return b}}}]); \ No newline at end of file diff --git a/build/product-safety-attachments.css b/build/product-safety-attachments.css new file mode 100644 index 000000000..1114283cc --- /dev/null +++ b/build/product-safety-attachments.css @@ -0,0 +1 @@ +.wc-gzd-block-components-product-price-label{display:block}.wc-gzd-block-components-product-price-label.wc-gzd-block-components-product-price-label--align-center{text-align:center}.wc-gzd-block-components-product-price-label.wc-gzd-block-components-product-price-label--align-right{text-align:right}.wc-gzd-block-components-product-deposit-packaging-type{text-transform:uppercase}.wc-gzd-block-components-product-nutri-score .wc-gzd-nutri-score-value{height:4rem;width:7.0625rem;display:block;text-indent:-9999px} diff --git a/build/product-safety-instructions-frontend.js b/build/product-safety-instructions-frontend.js new file mode 100644 index 000000000..a1e3bfa52 --- /dev/null +++ b/build/product-safety-instructions-frontend.js @@ -0,0 +1 @@ +"use strict";(self.webpackWcBlocksJsonp=self.webpackWcBlocksJsonp||[]).push([[202],{146:function(e,t,r){r.r(t),r.d(t,{default:function(){return c}});var n=r(196),o=r(721),a=r(606),c=e=>(e={...e,labelType:"safety_instructions"}).isDescendentOfSingleProductTemplate?(0,n.createElement)(a.Z,{...e}):(0,o.withProductDataContext)(a.Z)(e)},606:function(e,t,r){r.d(t,{Z:function(){return h}});var n=r(196),o=r(184),a=r.n(o),c=r(293),l=r(864),s=r(736);const m=e=>!(e=>null===e)(e)&&e instanceof Object&&e.constructor===Object,i=e=>"string"==typeof e;var u=r(857),p=r(83);function d(e={}){const t={};return(0,p.R)(e,{selector:""}).forEach((e=>{t[e.key]=e.value})),t}function g(e,t){return e&&t?`has-${(0,u.o)(t)}-${e}`:""}const _=e=>{const t=(e=>{const t=m(e)?e:{style:{}};let r=t.style;return i(r)&&(r=JSON.parse(r)||{}),m(r)||(r={}),{...t,style:r}})(e),r=function(e){const{backgroundColor:t,textColor:r,gradient:n,style:o}=e,c=g("background-color",t),l=g("color",r),s=function(e){if(e)return`has-${e}-gradient-background`}(n),i=s||o?.color?.gradient;return{className:a()(l,s,{[c]:!i&&!!c,"has-text-color":r||o?.color?.text,"has-background":t||o?.color?.background||n||o?.color?.gradient,"has-link-color":m(o?.elements?.link)?o?.elements?.link?.color:void 0}),style:d({color:o?.color||{}})}}(t),n=function(e){const t=e.style?.border||{};return{className:function(e){const{borderColor:t,style:r}=e,n=t?g("border-color",t):"";return a()({"has-border-color":!!t||!!r?.border?.color,[n]:!!n})}(e),style:d({border:t})}}(t),o=function(e){return{className:void 0,style:d({spacing:e.style?.spacing||{}})}}(t),c=(e=>{const t=m(e.style.typography)?e.style.typography:{},r=i(t.fontFamily)?t.fontFamily:"";return{className:e.fontFamily?`has-${e.fontFamily}-font-family`:r,style:{fontSize:e.fontSize?`var(--wp--preset--font-size--${e.fontSize})`:t.fontSize,fontStyle:t.fontStyle,fontWeight:t.fontWeight,letterSpacing:t.letterSpacing,lineHeight:t.lineHeight,textDecoration:t.textDecoration,textTransform:t.textTransform}}})(t);return{className:a()(c.className,r.className,n.className,o.className),style:{...c.style,...r.style,...n.style,...o.style}}};var y=r(333);const f=e=>({thousandSeparator:e?.thousandSeparator,decimalSeparator:e?.decimalSeparator,fixedDecimalScale:!0,prefix:e?.prefix,suffix:e?.suffix,isNumericString:!0});var w=({className:e,value:t,currency:r,onValueChange:o,displayType:c="text",...l})=>{var s;const m="string"==typeof t?parseInt(t,10):t;if(!Number.isFinite(m))return null;const i=m/10**r.minorUnit;if(!Number.isFinite(i))return null;const u=a()("wc-block-formatted-money-amount","wc-block-components-formatted-money-amount",e),p=null!==(s=l.decimalScale)&&void 0!==s?s:r?.minorUnit,d={...l,...f(r),decimalScale:p,value:void 0,currency:void 0,onValueChange:void 0},g=o?e=>{const t=+e.value*10**r.minorUnit;o(t)}:()=>{};return(0,n.createElement)(y.Z,{className:u,displayType:c,...d,value:i,onValueChange:g})},b=r(307),v=({align:e,className:t,labelType:r,formattedLabel:o,labelClassName:c,labelStyle:l,style:s})=>{const m=a()(t,"wc-gzd-block-components-product-"+r,"wc-gzd-block-components-product-price-label",{[`wc-gzd-block-components-product-price-label--align-${e}`]:e});let i=(0,n.createElement)("span",{className:a()("wc-gzd-block-components-product-"+r+"__value",c)});return o&&(i=(0,b.isValidElement)(o)?(0,n.createElement)("span",{className:a()("wc-gzd-block-components-product-"+r+"__value",c),style:l},o):(0,n.createElement)("span",{className:a()("wc-gzd-block-components-product-"+r+"__value",c),style:l,dangerouslySetInnerHTML:{__html:o}})),(0,n.createElement)("span",{className:m,style:s},i)},h=e=>{const{className:t,textAlign:r,isDescendentOfSingleProductTemplate:o,labelType:m}=e,{parentName:i,parentClassName:u}=(0,l.useInnerBlockLayoutContext)(),{product:p}=(0,l.useProductDataContext)(),d=_(e),g="woocommerce/all-products"===i,y=a()("wc-gzd-block-components-product-"+m,t,d.className,{[`${u}__product-${m}`]:u});if(!p.id&&!o){const e=(0,n.createElement)(v,{align:r,className:y,labelType:m});if(g){const t=`wp-block-woocommerce-gzd-product-${m}`;return(0,n.createElement)("div",{className:t},e)}return e}const f=((e,t,r)=>{const o=t.hasOwnProperty("extensions")?t.extensions["woocommerce-germanized"]:{unit_price_html:"",unit_prices:{price:0,regular_price:0,sale_price:0},unit_product:0,unit_product_html:"",delivery_time_html:"",tax_info_html:"",shipping_costs_info_html:"",defect_description_html:"",nutri_score:"",nutri_score_html:"",deposit_html:"",deposit_prices:{price:0,quantity:0,amount:0},deposit_packaging_type_html:"",manufacturer_html:"",product_safety_attachments_html:"",safety_instructions_html:""},a=t.prices,l=r?(0,c.getCurrencyFromPriceResponse)():(0,c.getCurrencyFromPriceResponse)(a),m=e.replace(/-/g,"_"),i=o.hasOwnProperty(m+"_html")?o[m+"_html"]:"";let u="";return"unit_price"===m?u=(0,n.createElement)(n.Fragment,null,(0,n.createElement)(w,{currency:l,value:1e3})," / ",(0,n.createElement)("span",{className:"unit"},(0,s._x)("kg","unit","woocommerce-germanized"))):"delivery_time"===m?u=(0,s._x)("Delivery time: 2-3 days","preview","woocommerce-germanized"):"tax_info"===m?u=(0,s._x)("incl. 19 % VAT","preview","woocommerce-germanized"):"shipping_costs_info"===m?u=(0,s._x)("plus shipping costs","preview","woocommerce-germanized"):"unit_product"===m?u=(0,s.sprintf)((0,s._x)("Product includes: %1$s kg","preview","woocommerce-germanized"),10):"defect_description"===m?u=(0,s._x)("This product has a serious defect.","preview","woocommerce-germanized"):"deposit"===m?u=(0,n.createElement)(n.Fragment,null,(0,n.createElement)("span",{className:"additional"},(0,s._x)("Plus","preview","woocommerce-germanized"))," ",(0,n.createElement)(w,{currency:l,value:40})," ",(0,n.createElement)("span",{className:"deposit-notice"},(0,s._x)("deposit","preview","woocommerce-germanized"))):"deposit_packaging_type"===m?u=(0,s._x)("Disposable","preview","woocommerce-germanized"):"nutri_score"===m?u=(0,n.createElement)(n.Fragment,null,(0,n.createElement)("span",{className:"wc-gzd-nutri-score-value wc-gzd-nutri-score-value-a"},"A")):"manufacturer"===m?u=(0,n.createElement)(n.Fragment,null,(0,n.createElement)("p",null,(0,n.createElement)("stong",null,(0,s._x)("Sample company name","preview","woocommerce-germanized")),(0,n.createElement)("br",null),(0,s._x)("Sample address","preview","woocommerce-germanized"),(0,n.createElement)("br",null),(0,s._x)("12345 Berlin","preview","woocommerce-germanized"),(0,n.createElement)("br",null),(0,s._x)("sample@sample.com","preview","woocommerce-germanized")),(0,n.createElement)("h3",null,(0,s.__)("Person responsible for the EU","woocommerce-germanized")),(0,n.createElement)("p",null,(0,n.createElement)("stong",null,(0,s._x)("Sample company name","preview","woocommerce-germanized")),(0,n.createElement)("br",null),(0,s._x)("Sample address","preview","woocommerce-germanized"),(0,n.createElement)("br",null),(0,s._x)("12345 Berlin","preview","woocommerce-germanized"),(0,n.createElement)("br",null),(0,s._x)("sample@sample.com","preview","woocommerce-germanized"))):"product_safety_attachments"===m?u=(0,n.createElement)(n.Fragment,null,(0,n.createElement)("ul",null,(0,n.createElement)("li",null,(0,n.createElement)("a",{href:"#"},(0,s._x)("sample-filename.pdf","sample","woocommerce-germanized"))))):"safety_instructions"===m&&(u=(0,n.createElement)(n.Fragment,null,(0,n.createElement)("p",null,(0,s._x)("Sample safety instructions for a certain product.","preview","woocommerce-germanized"),(0,n.createElement)("br",null)))),{preview:u,data:i}})(m,p,o),b=(0,n.createElement)(v,{align:r,className:y,labelType:m,style:d.style,labelStyle:d.style,formattedLabel:o?f.preview:f.data});if(g){const e=`wp-block-woocommerce-gzd-product-${m}`;return(0,n.createElement)("div",{className:e},b)}return b}}}]); \ No newline at end of file diff --git a/build/product-safety-instructions.css b/build/product-safety-instructions.css new file mode 100644 index 000000000..1114283cc --- /dev/null +++ b/build/product-safety-instructions.css @@ -0,0 +1 @@ +.wc-gzd-block-components-product-price-label{display:block}.wc-gzd-block-components-product-price-label.wc-gzd-block-components-product-price-label--align-center{text-align:center}.wc-gzd-block-components-product-price-label.wc-gzd-block-components-product-price-label--align-right{text-align:right}.wc-gzd-block-components-product-deposit-packaging-type{text-transform:uppercase}.wc-gzd-block-components-product-nutri-score .wc-gzd-nutri-score-value{height:4rem;width:7.0625rem;display:block;text-indent:-9999px} diff --git a/build/product-shipping-costs-info-frontend.js b/build/product-shipping-costs-info-frontend.js new file mode 100644 index 000000000..7a31800a7 --- /dev/null +++ b/build/product-shipping-costs-info-frontend.js @@ -0,0 +1 @@ +"use strict";(self.webpackWcBlocksJsonp=self.webpackWcBlocksJsonp||[]).push([[648],{606:function(e,t,r){r.d(t,{Z:function(){return v}});var n=r(196),o=r(184),a=r.n(o),c=r(293),l=r(864),s=r(736);const m=e=>!(e=>null===e)(e)&&e instanceof Object&&e.constructor===Object,i=e=>"string"==typeof e;var p=r(857),u=r(83);function d(e={}){const t={};return(0,u.R)(e,{selector:""}).forEach((e=>{t[e.key]=e.value})),t}function g(e,t){return e&&t?`has-${(0,p.o)(t)}-${e}`:""}const _=e=>{const t=(e=>{const t=m(e)?e:{style:{}};let r=t.style;return i(r)&&(r=JSON.parse(r)||{}),m(r)||(r={}),{...t,style:r}})(e),r=function(e){const{backgroundColor:t,textColor:r,gradient:n,style:o}=e,c=g("background-color",t),l=g("color",r),s=function(e){if(e)return`has-${e}-gradient-background`}(n),i=s||o?.color?.gradient;return{className:a()(l,s,{[c]:!i&&!!c,"has-text-color":r||o?.color?.text,"has-background":t||o?.color?.background||n||o?.color?.gradient,"has-link-color":m(o?.elements?.link)?o?.elements?.link?.color:void 0}),style:d({color:o?.color||{}})}}(t),n=function(e){const t=e.style?.border||{};return{className:function(e){const{borderColor:t,style:r}=e,n=t?g("border-color",t):"";return a()({"has-border-color":!!t||!!r?.border?.color,[n]:!!n})}(e),style:d({border:t})}}(t),o=function(e){return{className:void 0,style:d({spacing:e.style?.spacing||{}})}}(t),c=(e=>{const t=m(e.style.typography)?e.style.typography:{},r=i(t.fontFamily)?t.fontFamily:"";return{className:e.fontFamily?`has-${e.fontFamily}-font-family`:r,style:{fontSize:e.fontSize?`var(--wp--preset--font-size--${e.fontSize})`:t.fontSize,fontStyle:t.fontStyle,fontWeight:t.fontWeight,letterSpacing:t.letterSpacing,lineHeight:t.lineHeight,textDecoration:t.textDecoration,textTransform:t.textTransform}}})(t);return{className:a()(c.className,r.className,n.className,o.className),style:{...c.style,...r.style,...n.style,...o.style}}};var y=r(333);const f=e=>({thousandSeparator:e?.thousandSeparator,decimalSeparator:e?.decimalSeparator,fixedDecimalScale:!0,prefix:e?.prefix,suffix:e?.suffix,isNumericString:!0});var w=({className:e,value:t,currency:r,onValueChange:o,displayType:c="text",...l})=>{var s;const m="string"==typeof t?parseInt(t,10):t;if(!Number.isFinite(m))return null;const i=m/10**r.minorUnit;if(!Number.isFinite(i))return null;const p=a()("wc-block-formatted-money-amount","wc-block-components-formatted-money-amount",e),u=null!==(s=l.decimalScale)&&void 0!==s?s:r?.minorUnit,d={...l,...f(r),decimalScale:u,value:void 0,currency:void 0,onValueChange:void 0},g=o?e=>{const t=+e.value*10**r.minorUnit;o(t)}:()=>{};return(0,n.createElement)(y.Z,{className:p,displayType:c,...d,value:i,onValueChange:g})},b=r(307),h=({align:e,className:t,labelType:r,formattedLabel:o,labelClassName:c,labelStyle:l,style:s})=>{const m=a()(t,"wc-gzd-block-components-product-"+r,"wc-gzd-block-components-product-price-label",{[`wc-gzd-block-components-product-price-label--align-${e}`]:e});let i=(0,n.createElement)("span",{className:a()("wc-gzd-block-components-product-"+r+"__value",c)});return o&&(i=(0,b.isValidElement)(o)?(0,n.createElement)("span",{className:a()("wc-gzd-block-components-product-"+r+"__value",c),style:l},o):(0,n.createElement)("span",{className:a()("wc-gzd-block-components-product-"+r+"__value",c),style:l,dangerouslySetInnerHTML:{__html:o}})),(0,n.createElement)("span",{className:m,style:s},i)},v=e=>{const{className:t,textAlign:r,isDescendentOfSingleProductTemplate:o,labelType:m}=e,{parentName:i,parentClassName:p}=(0,l.useInnerBlockLayoutContext)(),{product:u}=(0,l.useProductDataContext)(),d=_(e),g="woocommerce/all-products"===i,y=a()("wc-gzd-block-components-product-"+m,t,d.className,{[`${p}__product-${m}`]:p});if(!u.id&&!o){const e=(0,n.createElement)(h,{align:r,className:y,labelType:m});if(g){const t=`wp-block-woocommerce-gzd-product-${m}`;return(0,n.createElement)("div",{className:t},e)}return e}const f=((e,t,r)=>{const o=t.hasOwnProperty("extensions")?t.extensions["woocommerce-germanized"]:{unit_price_html:"",unit_prices:{price:0,regular_price:0,sale_price:0},unit_product:0,unit_product_html:"",delivery_time_html:"",tax_info_html:"",shipping_costs_info_html:"",defect_description_html:"",nutri_score:"",nutri_score_html:"",deposit_html:"",deposit_prices:{price:0,quantity:0,amount:0},deposit_packaging_type_html:"",manufacturer_html:"",product_safety_attachments_html:"",safety_instructions_html:""},a=t.prices,l=r?(0,c.getCurrencyFromPriceResponse)():(0,c.getCurrencyFromPriceResponse)(a),m=e.replace(/-/g,"_"),i=o.hasOwnProperty(m+"_html")?o[m+"_html"]:"";let p="";return"unit_price"===m?p=(0,n.createElement)(n.Fragment,null,(0,n.createElement)(w,{currency:l,value:1e3})," / ",(0,n.createElement)("span",{className:"unit"},(0,s._x)("kg","unit","woocommerce-germanized"))):"delivery_time"===m?p=(0,s._x)("Delivery time: 2-3 days","preview","woocommerce-germanized"):"tax_info"===m?p=(0,s._x)("incl. 19 % VAT","preview","woocommerce-germanized"):"shipping_costs_info"===m?p=(0,s._x)("plus shipping costs","preview","woocommerce-germanized"):"unit_product"===m?p=(0,s.sprintf)((0,s._x)("Product includes: %1$s kg","preview","woocommerce-germanized"),10):"defect_description"===m?p=(0,s._x)("This product has a serious defect.","preview","woocommerce-germanized"):"deposit"===m?p=(0,n.createElement)(n.Fragment,null,(0,n.createElement)("span",{className:"additional"},(0,s._x)("Plus","preview","woocommerce-germanized"))," ",(0,n.createElement)(w,{currency:l,value:40})," ",(0,n.createElement)("span",{className:"deposit-notice"},(0,s._x)("deposit","preview","woocommerce-germanized"))):"deposit_packaging_type"===m?p=(0,s._x)("Disposable","preview","woocommerce-germanized"):"nutri_score"===m?p=(0,n.createElement)(n.Fragment,null,(0,n.createElement)("span",{className:"wc-gzd-nutri-score-value wc-gzd-nutri-score-value-a"},"A")):"manufacturer"===m?p=(0,n.createElement)(n.Fragment,null,(0,n.createElement)("p",null,(0,n.createElement)("stong",null,(0,s._x)("Sample company name","preview","woocommerce-germanized")),(0,n.createElement)("br",null),(0,s._x)("Sample address","preview","woocommerce-germanized"),(0,n.createElement)("br",null),(0,s._x)("12345 Berlin","preview","woocommerce-germanized"),(0,n.createElement)("br",null),(0,s._x)("sample@sample.com","preview","woocommerce-germanized")),(0,n.createElement)("h3",null,(0,s.__)("Person responsible for the EU","woocommerce-germanized")),(0,n.createElement)("p",null,(0,n.createElement)("stong",null,(0,s._x)("Sample company name","preview","woocommerce-germanized")),(0,n.createElement)("br",null),(0,s._x)("Sample address","preview","woocommerce-germanized"),(0,n.createElement)("br",null),(0,s._x)("12345 Berlin","preview","woocommerce-germanized"),(0,n.createElement)("br",null),(0,s._x)("sample@sample.com","preview","woocommerce-germanized"))):"product_safety_attachments"===m?p=(0,n.createElement)(n.Fragment,null,(0,n.createElement)("ul",null,(0,n.createElement)("li",null,(0,n.createElement)("a",{href:"#"},(0,s._x)("sample-filename.pdf","sample","woocommerce-germanized"))))):"safety_instructions"===m&&(p=(0,n.createElement)(n.Fragment,null,(0,n.createElement)("p",null,(0,s._x)("Sample safety instructions for a certain product.","preview","woocommerce-germanized"),(0,n.createElement)("br",null)))),{preview:p,data:i}})(m,u,o),b=(0,n.createElement)(h,{align:r,className:y,labelType:m,style:d.style,labelStyle:d.style,formattedLabel:o?f.preview:f.data});if(g){const e=`wp-block-woocommerce-gzd-product-${m}`;return(0,n.createElement)("div",{className:e},b)}return b}},26:function(e,t,r){r.r(t),r.d(t,{default:function(){return c}});var n=r(196),o=r(721),a=r(606),c=e=>(e={...e,labelType:"shipping-costs-info"}).isDescendentOfSingleProductTemplate?(0,n.createElement)(a.Z,{...e}):(0,o.withProductDataContext)(a.Z)(e)}}]); \ No newline at end of file diff --git a/build/product-shipping-costs-info.css b/build/product-shipping-costs-info.css new file mode 100644 index 000000000..1114283cc --- /dev/null +++ b/build/product-shipping-costs-info.css @@ -0,0 +1 @@ +.wc-gzd-block-components-product-price-label{display:block}.wc-gzd-block-components-product-price-label.wc-gzd-block-components-product-price-label--align-center{text-align:center}.wc-gzd-block-components-product-price-label.wc-gzd-block-components-product-price-label--align-right{text-align:right}.wc-gzd-block-components-product-deposit-packaging-type{text-transform:uppercase}.wc-gzd-block-components-product-nutri-score .wc-gzd-nutri-score-value{height:4rem;width:7.0625rem;display:block;text-indent:-9999px} diff --git a/build/product-tax-info-frontend.js b/build/product-tax-info-frontend.js new file mode 100644 index 000000000..a132d7606 --- /dev/null +++ b/build/product-tax-info-frontend.js @@ -0,0 +1 @@ +"use strict";(self.webpackWcBlocksJsonp=self.webpackWcBlocksJsonp||[]).push([[297],{606:function(e,t,r){r.d(t,{Z:function(){return h}});var n=r(196),o=r(184),a=r.n(o),c=r(293),l=r(864),s=r(736);const m=e=>!(e=>null===e)(e)&&e instanceof Object&&e.constructor===Object,i=e=>"string"==typeof e;var u=r(857),p=r(83);function d(e={}){const t={};return(0,p.R)(e,{selector:""}).forEach((e=>{t[e.key]=e.value})),t}function g(e,t){return e&&t?`has-${(0,u.o)(t)}-${e}`:""}const _=e=>{const t=(e=>{const t=m(e)?e:{style:{}};let r=t.style;return i(r)&&(r=JSON.parse(r)||{}),m(r)||(r={}),{...t,style:r}})(e),r=function(e){const{backgroundColor:t,textColor:r,gradient:n,style:o}=e,c=g("background-color",t),l=g("color",r),s=function(e){if(e)return`has-${e}-gradient-background`}(n),i=s||o?.color?.gradient;return{className:a()(l,s,{[c]:!i&&!!c,"has-text-color":r||o?.color?.text,"has-background":t||o?.color?.background||n||o?.color?.gradient,"has-link-color":m(o?.elements?.link)?o?.elements?.link?.color:void 0}),style:d({color:o?.color||{}})}}(t),n=function(e){const t=e.style?.border||{};return{className:function(e){const{borderColor:t,style:r}=e,n=t?g("border-color",t):"";return a()({"has-border-color":!!t||!!r?.border?.color,[n]:!!n})}(e),style:d({border:t})}}(t),o=function(e){return{className:void 0,style:d({spacing:e.style?.spacing||{}})}}(t),c=(e=>{const t=m(e.style.typography)?e.style.typography:{},r=i(t.fontFamily)?t.fontFamily:"";return{className:e.fontFamily?`has-${e.fontFamily}-font-family`:r,style:{fontSize:e.fontSize?`var(--wp--preset--font-size--${e.fontSize})`:t.fontSize,fontStyle:t.fontStyle,fontWeight:t.fontWeight,letterSpacing:t.letterSpacing,lineHeight:t.lineHeight,textDecoration:t.textDecoration,textTransform:t.textTransform}}})(t);return{className:a()(c.className,r.className,n.className,o.className),style:{...c.style,...r.style,...n.style,...o.style}}};var y=r(333);const f=e=>({thousandSeparator:e?.thousandSeparator,decimalSeparator:e?.decimalSeparator,fixedDecimalScale:!0,prefix:e?.prefix,suffix:e?.suffix,isNumericString:!0});var w=({className:e,value:t,currency:r,onValueChange:o,displayType:c="text",...l})=>{var s;const m="string"==typeof t?parseInt(t,10):t;if(!Number.isFinite(m))return null;const i=m/10**r.minorUnit;if(!Number.isFinite(i))return null;const u=a()("wc-block-formatted-money-amount","wc-block-components-formatted-money-amount",e),p=null!==(s=l.decimalScale)&&void 0!==s?s:r?.minorUnit,d={...l,...f(r),decimalScale:p,value:void 0,currency:void 0,onValueChange:void 0},g=o?e=>{const t=+e.value*10**r.minorUnit;o(t)}:()=>{};return(0,n.createElement)(y.Z,{className:u,displayType:c,...d,value:i,onValueChange:g})},b=r(307),v=({align:e,className:t,labelType:r,formattedLabel:o,labelClassName:c,labelStyle:l,style:s})=>{const m=a()(t,"wc-gzd-block-components-product-"+r,"wc-gzd-block-components-product-price-label",{[`wc-gzd-block-components-product-price-label--align-${e}`]:e});let i=(0,n.createElement)("span",{className:a()("wc-gzd-block-components-product-"+r+"__value",c)});return o&&(i=(0,b.isValidElement)(o)?(0,n.createElement)("span",{className:a()("wc-gzd-block-components-product-"+r+"__value",c),style:l},o):(0,n.createElement)("span",{className:a()("wc-gzd-block-components-product-"+r+"__value",c),style:l,dangerouslySetInnerHTML:{__html:o}})),(0,n.createElement)("span",{className:m,style:s},i)},h=e=>{const{className:t,textAlign:r,isDescendentOfSingleProductTemplate:o,labelType:m}=e,{parentName:i,parentClassName:u}=(0,l.useInnerBlockLayoutContext)(),{product:p}=(0,l.useProductDataContext)(),d=_(e),g="woocommerce/all-products"===i,y=a()("wc-gzd-block-components-product-"+m,t,d.className,{[`${u}__product-${m}`]:u});if(!p.id&&!o){const e=(0,n.createElement)(v,{align:r,className:y,labelType:m});if(g){const t=`wp-block-woocommerce-gzd-product-${m}`;return(0,n.createElement)("div",{className:t},e)}return e}const f=((e,t,r)=>{const o=t.hasOwnProperty("extensions")?t.extensions["woocommerce-germanized"]:{unit_price_html:"",unit_prices:{price:0,regular_price:0,sale_price:0},unit_product:0,unit_product_html:"",delivery_time_html:"",tax_info_html:"",shipping_costs_info_html:"",defect_description_html:"",nutri_score:"",nutri_score_html:"",deposit_html:"",deposit_prices:{price:0,quantity:0,amount:0},deposit_packaging_type_html:"",manufacturer_html:"",product_safety_attachments_html:"",safety_instructions_html:""},a=t.prices,l=r?(0,c.getCurrencyFromPriceResponse)():(0,c.getCurrencyFromPriceResponse)(a),m=e.replace(/-/g,"_"),i=o.hasOwnProperty(m+"_html")?o[m+"_html"]:"";let u="";return"unit_price"===m?u=(0,n.createElement)(n.Fragment,null,(0,n.createElement)(w,{currency:l,value:1e3})," / ",(0,n.createElement)("span",{className:"unit"},(0,s._x)("kg","unit","woocommerce-germanized"))):"delivery_time"===m?u=(0,s._x)("Delivery time: 2-3 days","preview","woocommerce-germanized"):"tax_info"===m?u=(0,s._x)("incl. 19 % VAT","preview","woocommerce-germanized"):"shipping_costs_info"===m?u=(0,s._x)("plus shipping costs","preview","woocommerce-germanized"):"unit_product"===m?u=(0,s.sprintf)((0,s._x)("Product includes: %1$s kg","preview","woocommerce-germanized"),10):"defect_description"===m?u=(0,s._x)("This product has a serious defect.","preview","woocommerce-germanized"):"deposit"===m?u=(0,n.createElement)(n.Fragment,null,(0,n.createElement)("span",{className:"additional"},(0,s._x)("Plus","preview","woocommerce-germanized"))," ",(0,n.createElement)(w,{currency:l,value:40})," ",(0,n.createElement)("span",{className:"deposit-notice"},(0,s._x)("deposit","preview","woocommerce-germanized"))):"deposit_packaging_type"===m?u=(0,s._x)("Disposable","preview","woocommerce-germanized"):"nutri_score"===m?u=(0,n.createElement)(n.Fragment,null,(0,n.createElement)("span",{className:"wc-gzd-nutri-score-value wc-gzd-nutri-score-value-a"},"A")):"manufacturer"===m?u=(0,n.createElement)(n.Fragment,null,(0,n.createElement)("p",null,(0,n.createElement)("stong",null,(0,s._x)("Sample company name","preview","woocommerce-germanized")),(0,n.createElement)("br",null),(0,s._x)("Sample address","preview","woocommerce-germanized"),(0,n.createElement)("br",null),(0,s._x)("12345 Berlin","preview","woocommerce-germanized"),(0,n.createElement)("br",null),(0,s._x)("sample@sample.com","preview","woocommerce-germanized")),(0,n.createElement)("h3",null,(0,s.__)("Person responsible for the EU","woocommerce-germanized")),(0,n.createElement)("p",null,(0,n.createElement)("stong",null,(0,s._x)("Sample company name","preview","woocommerce-germanized")),(0,n.createElement)("br",null),(0,s._x)("Sample address","preview","woocommerce-germanized"),(0,n.createElement)("br",null),(0,s._x)("12345 Berlin","preview","woocommerce-germanized"),(0,n.createElement)("br",null),(0,s._x)("sample@sample.com","preview","woocommerce-germanized"))):"product_safety_attachments"===m?u=(0,n.createElement)(n.Fragment,null,(0,n.createElement)("ul",null,(0,n.createElement)("li",null,(0,n.createElement)("a",{href:"#"},(0,s._x)("sample-filename.pdf","sample","woocommerce-germanized"))))):"safety_instructions"===m&&(u=(0,n.createElement)(n.Fragment,null,(0,n.createElement)("p",null,(0,s._x)("Sample safety instructions for a certain product.","preview","woocommerce-germanized"),(0,n.createElement)("br",null)))),{preview:u,data:i}})(m,p,o),b=(0,n.createElement)(v,{align:r,className:y,labelType:m,style:d.style,labelStyle:d.style,formattedLabel:o?f.preview:f.data});if(g){const e=`wp-block-woocommerce-gzd-product-${m}`;return(0,n.createElement)("div",{className:e},b)}return b}},471:function(e,t,r){r.r(t),r.d(t,{default:function(){return c}});var n=r(196),o=r(721),a=r(606),c=e=>(e={...e,labelType:"tax-info"}).isDescendentOfSingleProductTemplate?(0,n.createElement)(a.Z,{...e}):(0,o.withProductDataContext)(a.Z)(e)}}]); \ No newline at end of file diff --git a/build/product-tax-info.css b/build/product-tax-info.css new file mode 100644 index 000000000..1114283cc --- /dev/null +++ b/build/product-tax-info.css @@ -0,0 +1 @@ +.wc-gzd-block-components-product-price-label{display:block}.wc-gzd-block-components-product-price-label.wc-gzd-block-components-product-price-label--align-center{text-align:center}.wc-gzd-block-components-product-price-label.wc-gzd-block-components-product-price-label--align-right{text-align:right}.wc-gzd-block-components-product-deposit-packaging-type{text-transform:uppercase}.wc-gzd-block-components-product-nutri-score .wc-gzd-nutri-score-value{height:4rem;width:7.0625rem;display:block;text-indent:-9999px} diff --git a/build/product-unit-price-frontend.js b/build/product-unit-price-frontend.js new file mode 100644 index 000000000..cdf6bf07c --- /dev/null +++ b/build/product-unit-price-frontend.js @@ -0,0 +1 @@ +"use strict";(self.webpackWcBlocksJsonp=self.webpackWcBlocksJsonp||[]).push([[92],{606:function(e,t,r){r.d(t,{Z:function(){return h}});var n=r(196),o=r(184),a=r.n(o),c=r(293),l=r(864),s=r(736);const m=e=>!(e=>null===e)(e)&&e instanceof Object&&e.constructor===Object,i=e=>"string"==typeof e;var u=r(857),p=r(83);function d(e={}){const t={};return(0,p.R)(e,{selector:""}).forEach((e=>{t[e.key]=e.value})),t}function g(e,t){return e&&t?`has-${(0,u.o)(t)}-${e}`:""}const _=e=>{const t=(e=>{const t=m(e)?e:{style:{}};let r=t.style;return i(r)&&(r=JSON.parse(r)||{}),m(r)||(r={}),{...t,style:r}})(e),r=function(e){const{backgroundColor:t,textColor:r,gradient:n,style:o}=e,c=g("background-color",t),l=g("color",r),s=function(e){if(e)return`has-${e}-gradient-background`}(n),i=s||o?.color?.gradient;return{className:a()(l,s,{[c]:!i&&!!c,"has-text-color":r||o?.color?.text,"has-background":t||o?.color?.background||n||o?.color?.gradient,"has-link-color":m(o?.elements?.link)?o?.elements?.link?.color:void 0}),style:d({color:o?.color||{}})}}(t),n=function(e){const t=e.style?.border||{};return{className:function(e){const{borderColor:t,style:r}=e,n=t?g("border-color",t):"";return a()({"has-border-color":!!t||!!r?.border?.color,[n]:!!n})}(e),style:d({border:t})}}(t),o=function(e){return{className:void 0,style:d({spacing:e.style?.spacing||{}})}}(t),c=(e=>{const t=m(e.style.typography)?e.style.typography:{},r=i(t.fontFamily)?t.fontFamily:"";return{className:e.fontFamily?`has-${e.fontFamily}-font-family`:r,style:{fontSize:e.fontSize?`var(--wp--preset--font-size--${e.fontSize})`:t.fontSize,fontStyle:t.fontStyle,fontWeight:t.fontWeight,letterSpacing:t.letterSpacing,lineHeight:t.lineHeight,textDecoration:t.textDecoration,textTransform:t.textTransform}}})(t);return{className:a()(c.className,r.className,n.className,o.className),style:{...c.style,...r.style,...n.style,...o.style}}};var y=r(333);const f=e=>({thousandSeparator:e?.thousandSeparator,decimalSeparator:e?.decimalSeparator,fixedDecimalScale:!0,prefix:e?.prefix,suffix:e?.suffix,isNumericString:!0});var w=({className:e,value:t,currency:r,onValueChange:o,displayType:c="text",...l})=>{var s;const m="string"==typeof t?parseInt(t,10):t;if(!Number.isFinite(m))return null;const i=m/10**r.minorUnit;if(!Number.isFinite(i))return null;const u=a()("wc-block-formatted-money-amount","wc-block-components-formatted-money-amount",e),p=null!==(s=l.decimalScale)&&void 0!==s?s:r?.minorUnit,d={...l,...f(r),decimalScale:p,value:void 0,currency:void 0,onValueChange:void 0},g=o?e=>{const t=+e.value*10**r.minorUnit;o(t)}:()=>{};return(0,n.createElement)(y.Z,{className:u,displayType:c,...d,value:i,onValueChange:g})},b=r(307),v=({align:e,className:t,labelType:r,formattedLabel:o,labelClassName:c,labelStyle:l,style:s})=>{const m=a()(t,"wc-gzd-block-components-product-"+r,"wc-gzd-block-components-product-price-label",{[`wc-gzd-block-components-product-price-label--align-${e}`]:e});let i=(0,n.createElement)("span",{className:a()("wc-gzd-block-components-product-"+r+"__value",c)});return o&&(i=(0,b.isValidElement)(o)?(0,n.createElement)("span",{className:a()("wc-gzd-block-components-product-"+r+"__value",c),style:l},o):(0,n.createElement)("span",{className:a()("wc-gzd-block-components-product-"+r+"__value",c),style:l,dangerouslySetInnerHTML:{__html:o}})),(0,n.createElement)("span",{className:m,style:s},i)},h=e=>{const{className:t,textAlign:r,isDescendentOfSingleProductTemplate:o,labelType:m}=e,{parentName:i,parentClassName:u}=(0,l.useInnerBlockLayoutContext)(),{product:p}=(0,l.useProductDataContext)(),d=_(e),g="woocommerce/all-products"===i,y=a()("wc-gzd-block-components-product-"+m,t,d.className,{[`${u}__product-${m}`]:u});if(!p.id&&!o){const e=(0,n.createElement)(v,{align:r,className:y,labelType:m});if(g){const t=`wp-block-woocommerce-gzd-product-${m}`;return(0,n.createElement)("div",{className:t},e)}return e}const f=((e,t,r)=>{const o=t.hasOwnProperty("extensions")?t.extensions["woocommerce-germanized"]:{unit_price_html:"",unit_prices:{price:0,regular_price:0,sale_price:0},unit_product:0,unit_product_html:"",delivery_time_html:"",tax_info_html:"",shipping_costs_info_html:"",defect_description_html:"",nutri_score:"",nutri_score_html:"",deposit_html:"",deposit_prices:{price:0,quantity:0,amount:0},deposit_packaging_type_html:"",manufacturer_html:"",product_safety_attachments_html:"",safety_instructions_html:""},a=t.prices,l=r?(0,c.getCurrencyFromPriceResponse)():(0,c.getCurrencyFromPriceResponse)(a),m=e.replace(/-/g,"_"),i=o.hasOwnProperty(m+"_html")?o[m+"_html"]:"";let u="";return"unit_price"===m?u=(0,n.createElement)(n.Fragment,null,(0,n.createElement)(w,{currency:l,value:1e3})," / ",(0,n.createElement)("span",{className:"unit"},(0,s._x)("kg","unit","woocommerce-germanized"))):"delivery_time"===m?u=(0,s._x)("Delivery time: 2-3 days","preview","woocommerce-germanized"):"tax_info"===m?u=(0,s._x)("incl. 19 % VAT","preview","woocommerce-germanized"):"shipping_costs_info"===m?u=(0,s._x)("plus shipping costs","preview","woocommerce-germanized"):"unit_product"===m?u=(0,s.sprintf)((0,s._x)("Product includes: %1$s kg","preview","woocommerce-germanized"),10):"defect_description"===m?u=(0,s._x)("This product has a serious defect.","preview","woocommerce-germanized"):"deposit"===m?u=(0,n.createElement)(n.Fragment,null,(0,n.createElement)("span",{className:"additional"},(0,s._x)("Plus","preview","woocommerce-germanized"))," ",(0,n.createElement)(w,{currency:l,value:40})," ",(0,n.createElement)("span",{className:"deposit-notice"},(0,s._x)("deposit","preview","woocommerce-germanized"))):"deposit_packaging_type"===m?u=(0,s._x)("Disposable","preview","woocommerce-germanized"):"nutri_score"===m?u=(0,n.createElement)(n.Fragment,null,(0,n.createElement)("span",{className:"wc-gzd-nutri-score-value wc-gzd-nutri-score-value-a"},"A")):"manufacturer"===m?u=(0,n.createElement)(n.Fragment,null,(0,n.createElement)("p",null,(0,n.createElement)("stong",null,(0,s._x)("Sample company name","preview","woocommerce-germanized")),(0,n.createElement)("br",null),(0,s._x)("Sample address","preview","woocommerce-germanized"),(0,n.createElement)("br",null),(0,s._x)("12345 Berlin","preview","woocommerce-germanized"),(0,n.createElement)("br",null),(0,s._x)("sample@sample.com","preview","woocommerce-germanized")),(0,n.createElement)("h3",null,(0,s.__)("Person responsible for the EU","woocommerce-germanized")),(0,n.createElement)("p",null,(0,n.createElement)("stong",null,(0,s._x)("Sample company name","preview","woocommerce-germanized")),(0,n.createElement)("br",null),(0,s._x)("Sample address","preview","woocommerce-germanized"),(0,n.createElement)("br",null),(0,s._x)("12345 Berlin","preview","woocommerce-germanized"),(0,n.createElement)("br",null),(0,s._x)("sample@sample.com","preview","woocommerce-germanized"))):"product_safety_attachments"===m?u=(0,n.createElement)(n.Fragment,null,(0,n.createElement)("ul",null,(0,n.createElement)("li",null,(0,n.createElement)("a",{href:"#"},(0,s._x)("sample-filename.pdf","sample","woocommerce-germanized"))))):"safety_instructions"===m&&(u=(0,n.createElement)(n.Fragment,null,(0,n.createElement)("p",null,(0,s._x)("Sample safety instructions for a certain product.","preview","woocommerce-germanized"),(0,n.createElement)("br",null)))),{preview:u,data:i}})(m,p,o),b=(0,n.createElement)(v,{align:r,className:y,labelType:m,style:d.style,labelStyle:d.style,formattedLabel:o?f.preview:f.data});if(g){const e=`wp-block-woocommerce-gzd-product-${m}`;return(0,n.createElement)("div",{className:e},b)}return b}},263:function(e,t,r){r.r(t),r.d(t,{default:function(){return c}});var n=r(196),o=r(721),a=r(606),c=e=>(e={...e,labelType:"unit-price"}).isDescendentOfSingleProductTemplate?(0,n.createElement)(a.Z,{...e}):(0,o.withProductDataContext)(a.Z)(e)}}]); \ No newline at end of file diff --git a/build/product-unit-price.css b/build/product-unit-price.css new file mode 100644 index 000000000..1114283cc --- /dev/null +++ b/build/product-unit-price.css @@ -0,0 +1 @@ +.wc-gzd-block-components-product-price-label{display:block}.wc-gzd-block-components-product-price-label.wc-gzd-block-components-product-price-label--align-center{text-align:center}.wc-gzd-block-components-product-price-label.wc-gzd-block-components-product-price-label--align-right{text-align:right}.wc-gzd-block-components-product-deposit-packaging-type{text-transform:uppercase}.wc-gzd-block-components-product-nutri-score .wc-gzd-nutri-score-value{height:4rem;width:7.0625rem;display:block;text-indent:-9999px} diff --git a/build/product-unit-product-frontend.js b/build/product-unit-product-frontend.js new file mode 100644 index 000000000..faa7e85d2 --- /dev/null +++ b/build/product-unit-product-frontend.js @@ -0,0 +1 @@ +"use strict";(self.webpackWcBlocksJsonp=self.webpackWcBlocksJsonp||[]).push([[6],{606:function(e,t,r){r.d(t,{Z:function(){return h}});var n=r(196),o=r(184),a=r.n(o),c=r(293),l=r(864),s=r(736);const m=e=>!(e=>null===e)(e)&&e instanceof Object&&e.constructor===Object,i=e=>"string"==typeof e;var u=r(857),p=r(83);function d(e={}){const t={};return(0,p.R)(e,{selector:""}).forEach((e=>{t[e.key]=e.value})),t}function g(e,t){return e&&t?`has-${(0,u.o)(t)}-${e}`:""}const _=e=>{const t=(e=>{const t=m(e)?e:{style:{}};let r=t.style;return i(r)&&(r=JSON.parse(r)||{}),m(r)||(r={}),{...t,style:r}})(e),r=function(e){const{backgroundColor:t,textColor:r,gradient:n,style:o}=e,c=g("background-color",t),l=g("color",r),s=function(e){if(e)return`has-${e}-gradient-background`}(n),i=s||o?.color?.gradient;return{className:a()(l,s,{[c]:!i&&!!c,"has-text-color":r||o?.color?.text,"has-background":t||o?.color?.background||n||o?.color?.gradient,"has-link-color":m(o?.elements?.link)?o?.elements?.link?.color:void 0}),style:d({color:o?.color||{}})}}(t),n=function(e){const t=e.style?.border||{};return{className:function(e){const{borderColor:t,style:r}=e,n=t?g("border-color",t):"";return a()({"has-border-color":!!t||!!r?.border?.color,[n]:!!n})}(e),style:d({border:t})}}(t),o=function(e){return{className:void 0,style:d({spacing:e.style?.spacing||{}})}}(t),c=(e=>{const t=m(e.style.typography)?e.style.typography:{},r=i(t.fontFamily)?t.fontFamily:"";return{className:e.fontFamily?`has-${e.fontFamily}-font-family`:r,style:{fontSize:e.fontSize?`var(--wp--preset--font-size--${e.fontSize})`:t.fontSize,fontStyle:t.fontStyle,fontWeight:t.fontWeight,letterSpacing:t.letterSpacing,lineHeight:t.lineHeight,textDecoration:t.textDecoration,textTransform:t.textTransform}}})(t);return{className:a()(c.className,r.className,n.className,o.className),style:{...c.style,...r.style,...n.style,...o.style}}};var y=r(333);const f=e=>({thousandSeparator:e?.thousandSeparator,decimalSeparator:e?.decimalSeparator,fixedDecimalScale:!0,prefix:e?.prefix,suffix:e?.suffix,isNumericString:!0});var w=({className:e,value:t,currency:r,onValueChange:o,displayType:c="text",...l})=>{var s;const m="string"==typeof t?parseInt(t,10):t;if(!Number.isFinite(m))return null;const i=m/10**r.minorUnit;if(!Number.isFinite(i))return null;const u=a()("wc-block-formatted-money-amount","wc-block-components-formatted-money-amount",e),p=null!==(s=l.decimalScale)&&void 0!==s?s:r?.minorUnit,d={...l,...f(r),decimalScale:p,value:void 0,currency:void 0,onValueChange:void 0},g=o?e=>{const t=+e.value*10**r.minorUnit;o(t)}:()=>{};return(0,n.createElement)(y.Z,{className:u,displayType:c,...d,value:i,onValueChange:g})},b=r(307),v=({align:e,className:t,labelType:r,formattedLabel:o,labelClassName:c,labelStyle:l,style:s})=>{const m=a()(t,"wc-gzd-block-components-product-"+r,"wc-gzd-block-components-product-price-label",{[`wc-gzd-block-components-product-price-label--align-${e}`]:e});let i=(0,n.createElement)("span",{className:a()("wc-gzd-block-components-product-"+r+"__value",c)});return o&&(i=(0,b.isValidElement)(o)?(0,n.createElement)("span",{className:a()("wc-gzd-block-components-product-"+r+"__value",c),style:l},o):(0,n.createElement)("span",{className:a()("wc-gzd-block-components-product-"+r+"__value",c),style:l,dangerouslySetInnerHTML:{__html:o}})),(0,n.createElement)("span",{className:m,style:s},i)},h=e=>{const{className:t,textAlign:r,isDescendentOfSingleProductTemplate:o,labelType:m}=e,{parentName:i,parentClassName:u}=(0,l.useInnerBlockLayoutContext)(),{product:p}=(0,l.useProductDataContext)(),d=_(e),g="woocommerce/all-products"===i,y=a()("wc-gzd-block-components-product-"+m,t,d.className,{[`${u}__product-${m}`]:u});if(!p.id&&!o){const e=(0,n.createElement)(v,{align:r,className:y,labelType:m});if(g){const t=`wp-block-woocommerce-gzd-product-${m}`;return(0,n.createElement)("div",{className:t},e)}return e}const f=((e,t,r)=>{const o=t.hasOwnProperty("extensions")?t.extensions["woocommerce-germanized"]:{unit_price_html:"",unit_prices:{price:0,regular_price:0,sale_price:0},unit_product:0,unit_product_html:"",delivery_time_html:"",tax_info_html:"",shipping_costs_info_html:"",defect_description_html:"",nutri_score:"",nutri_score_html:"",deposit_html:"",deposit_prices:{price:0,quantity:0,amount:0},deposit_packaging_type_html:"",manufacturer_html:"",product_safety_attachments_html:"",safety_instructions_html:""},a=t.prices,l=r?(0,c.getCurrencyFromPriceResponse)():(0,c.getCurrencyFromPriceResponse)(a),m=e.replace(/-/g,"_"),i=o.hasOwnProperty(m+"_html")?o[m+"_html"]:"";let u="";return"unit_price"===m?u=(0,n.createElement)(n.Fragment,null,(0,n.createElement)(w,{currency:l,value:1e3})," / ",(0,n.createElement)("span",{className:"unit"},(0,s._x)("kg","unit","woocommerce-germanized"))):"delivery_time"===m?u=(0,s._x)("Delivery time: 2-3 days","preview","woocommerce-germanized"):"tax_info"===m?u=(0,s._x)("incl. 19 % VAT","preview","woocommerce-germanized"):"shipping_costs_info"===m?u=(0,s._x)("plus shipping costs","preview","woocommerce-germanized"):"unit_product"===m?u=(0,s.sprintf)((0,s._x)("Product includes: %1$s kg","preview","woocommerce-germanized"),10):"defect_description"===m?u=(0,s._x)("This product has a serious defect.","preview","woocommerce-germanized"):"deposit"===m?u=(0,n.createElement)(n.Fragment,null,(0,n.createElement)("span",{className:"additional"},(0,s._x)("Plus","preview","woocommerce-germanized"))," ",(0,n.createElement)(w,{currency:l,value:40})," ",(0,n.createElement)("span",{className:"deposit-notice"},(0,s._x)("deposit","preview","woocommerce-germanized"))):"deposit_packaging_type"===m?u=(0,s._x)("Disposable","preview","woocommerce-germanized"):"nutri_score"===m?u=(0,n.createElement)(n.Fragment,null,(0,n.createElement)("span",{className:"wc-gzd-nutri-score-value wc-gzd-nutri-score-value-a"},"A")):"manufacturer"===m?u=(0,n.createElement)(n.Fragment,null,(0,n.createElement)("p",null,(0,n.createElement)("stong",null,(0,s._x)("Sample company name","preview","woocommerce-germanized")),(0,n.createElement)("br",null),(0,s._x)("Sample address","preview","woocommerce-germanized"),(0,n.createElement)("br",null),(0,s._x)("12345 Berlin","preview","woocommerce-germanized"),(0,n.createElement)("br",null),(0,s._x)("sample@sample.com","preview","woocommerce-germanized")),(0,n.createElement)("h3",null,(0,s.__)("Person responsible for the EU","woocommerce-germanized")),(0,n.createElement)("p",null,(0,n.createElement)("stong",null,(0,s._x)("Sample company name","preview","woocommerce-germanized")),(0,n.createElement)("br",null),(0,s._x)("Sample address","preview","woocommerce-germanized"),(0,n.createElement)("br",null),(0,s._x)("12345 Berlin","preview","woocommerce-germanized"),(0,n.createElement)("br",null),(0,s._x)("sample@sample.com","preview","woocommerce-germanized"))):"product_safety_attachments"===m?u=(0,n.createElement)(n.Fragment,null,(0,n.createElement)("ul",null,(0,n.createElement)("li",null,(0,n.createElement)("a",{href:"#"},(0,s._x)("sample-filename.pdf","sample","woocommerce-germanized"))))):"safety_instructions"===m&&(u=(0,n.createElement)(n.Fragment,null,(0,n.createElement)("p",null,(0,s._x)("Sample safety instructions for a certain product.","preview","woocommerce-germanized"),(0,n.createElement)("br",null)))),{preview:u,data:i}})(m,p,o),b=(0,n.createElement)(v,{align:r,className:y,labelType:m,style:d.style,labelStyle:d.style,formattedLabel:o?f.preview:f.data});if(g){const e=`wp-block-woocommerce-gzd-product-${m}`;return(0,n.createElement)("div",{className:e},b)}return b}},0:function(e,t,r){r.r(t),r.d(t,{default:function(){return c}});var n=r(196),o=r(721),a=r(606),c=e=>(e={...e,labelType:"unit-product"}).isDescendentOfSingleProductTemplate?(0,n.createElement)(a.Z,{...e}):(0,o.withProductDataContext)(a.Z)(e)}}]); \ No newline at end of file diff --git a/build/product-unit-product.css b/build/product-unit-product.css new file mode 100644 index 000000000..1114283cc --- /dev/null +++ b/build/product-unit-product.css @@ -0,0 +1 @@ +.wc-gzd-block-components-product-price-label{display:block}.wc-gzd-block-components-product-price-label.wc-gzd-block-components-product-price-label--align-center{text-align:center}.wc-gzd-block-components-product-price-label.wc-gzd-block-components-product-price-label--align-right{text-align:right}.wc-gzd-block-components-product-deposit-packaging-type{text-transform:uppercase}.wc-gzd-block-components-product-nutri-score .wc-gzd-nutri-score-value{height:4rem;width:7.0625rem;display:block;text-indent:-9999px} diff --git a/build/static/add-to-cart-variation.asset.php b/build/static/add-to-cart-variation.asset.php new file mode 100644 index 000000000..368190509 --- /dev/null +++ b/build/static/add-to-cart-variation.asset.php @@ -0,0 +1 @@ + array(), 'version' => '9966cc6933821ef3ddd8'); diff --git a/build/static/add-to-cart-variation.js b/build/static/add-to-cart-variation.js new file mode 100644 index 000000000..bab1ff2fc --- /dev/null +++ b/build/static/add-to-cart-variation.js @@ -0,0 +1,237 @@ +/******/ (function() { // webpackBootstrap +var __webpack_exports__ = {}; +/*global wc_gzd_add_to_cart_variation_params */ +; +(function ($, window, document, undefined) { + /** + * VariationForm class which handles variation forms and attributes. + */ + var GermanizedVariationForm = function ($form) { + var self = this; + self.params = wc_gzd_add_to_cart_variation_params; + self.$form = $form; + self.$wrapper = $form.closest(self.params.wrapper); + self.$product = $form.closest('.product'); + self.variationData = $form.data('product_variations'); + self.$singleVariation = $form.find('.single_variation'); + self.$singleVariationWrap = $form.find('.single_variation_wrap'); + self.$resetVariations = $form.find('.reset_variations'); + self.$button = $form.find('.single_add_to_cart_button'); + self.$form.addClass('has-gzd-variation-form'); + self.$form.off('.wc-gzd-variation-form'); + if (self.$wrapper.length <= 0) { + self.$wrapper = self.$product; + } + self.showOrHideTabs(self); + self.isBlockLayout = self.$wrapper.find('.wp-block-woocommerce-product-price').length > 0; + self.replacePrice = self.$wrapper.hasClass('bundled_product') ? false : self.params.replace_price; + $form.on('click.wc-gzd-variation-form', '.reset_variations', { + GermanizedvariationForm: self + }, self.onReset); + $form.on('reset_data.wc-gzd-variation-form', { + GermanizedvariationForm: self + }, self.onReset); + $form.on('show_variation.wc-gzd-variation-form', { + GermanizedvariationForm: self + }, self.onShowVariation); + self.$wrapper.find('' + '.woocommerce-product-attributes-item--food_description, ' + '.woocommerce-product-attributes-item--alcohol_content, ' + '.woocommerce-product-attributes-item--net_filling_quantity, ' + '.woocommerce-product-attributes-item--drained_weight, ' + '.woocommerce-product-attributes-item--food_place_of_origin, ' + '.woocommerce-product-attributes-item--nutri_score, ' + '.woocommerce-product-attributes-item--food_distributor').each(function () { + var $tr = $(this); + if ($tr.find('.woocommerce-product-attributes-item__value').is(':empty') || $tr.find('.woocommerce-product-attributes-item__value .wc-gzd-additional-info-placeholder').is(':empty')) { + $tr.addClass('wc-gzd-additional-info-placeholder'); + } + }); + }; + GermanizedVariationForm.prototype.showOrHideTabs = function (self, has_product_safety_information = undefined) { + has_product_safety_information = undefined === has_product_safety_information ? self.$product.hasClass('has-product-safety-information') : has_product_safety_information; + if (has_product_safety_information) { + self.$product.find('.product_safety_tab').show().css('display', 'inline-block'); + } else { + self.$product.find('.product_safety_tab').hide(); + } + }; + GermanizedVariationForm.prototype.getPriceElement = function (self) { + var $wrapper = self.$wrapper; + + /** + * Ignore the price wrapper inside the variation form to make sure the right + * price is being replaced even if the price element is located beneath the form. + */ + return $wrapper.find(self.params.price_selector + ':not(.price-unit):visible').not('.variations_form .single_variation .price').first(); + }; + + /** + * Reset all fields. + */ + GermanizedVariationForm.prototype.onReset = function (event) { + var form = event.data.GermanizedvariationForm, + $wrapper = form.$wrapper; + $wrapper.find('.variation_gzd_modified').each(function () { + $(this).wc_gzd_reset_content(); + }); + $wrapper.find('.variation_gzd_modified').remove(); + form.showOrHideTabs(form); + event.data.GermanizedvariationForm.$form.trigger('germanized_reset_data'); + }; + GermanizedVariationForm.prototype.getElementOrBlock = function (self, element, innerElement) { + var $wrapper = self.$wrapper; + var blockSearch = '.wp-block-woocommerce-gzd-product-' + element + '[data-is-descendent-of-single-product-template]'; + if ($wrapper.find(blockSearch).length > 0) { + return $wrapper.find(blockSearch + ' ' + innerElement); + } else { + return $wrapper.find(innerElement); + } + }; + GermanizedVariationForm.prototype.onUpdate = function (event) { + setTimeout(function () { + if (typeof event.data === 'undefined' || !event.data.hasOwnProperty('GermanizedvariationForm')) { + return; + } else if (typeof event.data.GermanizedvariationForm === 'undefined') { + return; + } + + // If the button is diabled (or has disabled class) no variation can be added to the cart - reset has been triggered + if (event.data.GermanizedvariationForm.$button.is('[disabled]') || event.data.GermanizedvariationForm.$button.hasClass('disabled')) { + event.data.GermanizedvariationForm.onReset(event); + } + }, 250); + }; + GermanizedVariationForm.prototype.onShowVariation = function (event, variation, purchasable) { + var form = event.data.GermanizedvariationForm, + $wrapper = form.$wrapper, + hasCustomPrice = variation.hasOwnProperty('price_html') && variation.price_html !== '', + hasDisplayPrice = variation.hasOwnProperty('display_price') && variation.display_price !== ''; + if (hasCustomPrice && form.replacePrice) { + var $priceElement = form.getPriceElement(form); + form.$singleVariation.find('.price').hide(); + $priceElement.wc_gzd_set_content(variation.price_html); + $priceElement.find('.price').contents().unwrap(); + } + form.getElementOrBlock(form, 'delivery-time', '.delivery-time-info').wc_gzd_set_content(variation.delivery_time); + form.getElementOrBlock(form, 'defect-description', '.defect-description').wc_gzd_set_content(variation.defect_description); + form.getElementOrBlock(form, 'tax-info', '.tax-info').wc_gzd_set_content(hasDisplayPrice ? variation.tax_info : ''); + form.getElementOrBlock(form, 'manufacturer', '.manufacturer').wc_gzd_set_content(variation.manufacturer); + form.getElementOrBlock(form, 'manufacturer-heading', '.wc-gzd-product-manufacturer-heading').wc_gzd_set_content(variation.manufacturer_heading); + form.getElementOrBlock(form, 'product_safety_attachments', '.product-safety-attachments').wc_gzd_set_content(variation.product_safety_attachments); + form.getElementOrBlock(form, 'product-safety-attachments-heading', '.wc-gzd-product-safety-attachments-heading').wc_gzd_set_content(variation.product_safety_attachments_heading); + form.getElementOrBlock(form, 'safety_instructions', '.safety-instructions').wc_gzd_set_content(variation.safety_instructions); + form.getElementOrBlock(form, 'safety-instructions-heading', '.wc-gzd-product-safety-instructions-heading').wc_gzd_set_content(variation.safety_instructions_heading); + form.getElementOrBlock(form, 'deposit', '.deposit-amount').wc_gzd_set_content(hasDisplayPrice ? variation.deposit_amount : ''); + form.getElementOrBlock(form, 'deposit-packaging-type', '.deposit-packaging-type').wc_gzd_set_content(hasDisplayPrice ? variation.deposit_packaging_type : ''); + form.getElementOrBlock(form, 'food-description', '.wc-gzd-food-description').wc_gzd_set_content(variation.food_description); + form.getElementOrBlock(form, 'nutri-score', '.wc-gzd-nutri-score').wc_gzd_set_content(variation.nutri_score); + form.getElementOrBlock(form, 'food-distributor', '.wc-gzd-food-distributor').wc_gzd_set_content(variation.food_distributor); + form.getElementOrBlock(form, 'food-place-of-origin', '.wc-gzd-food-place-of-origin').wc_gzd_set_content(variation.food_place_of_origin); + form.getElementOrBlock(form, 'net-filling-quantity', '.wc-gzd-net-filling-quantity').wc_gzd_set_content(variation.net_filling_quantity); + form.getElementOrBlock(form, 'drained-weight', '.wc-gzd-drained-weight').wc_gzd_set_content(variation.drained_weight); + form.getElementOrBlock(form, 'alcohol-content', '.wc-gzd-alcohol-content').wc_gzd_set_content('no' === variation.includes_alcohol ? '' : variation.alcohol_content); + form.getElementOrBlock(form, 'nutrients', '.wc-gzd-nutrients').wc_gzd_set_content(variation.nutrients); + form.getElementOrBlock(form, 'nutrients-heading', '.wc-gzd-nutrients-heading').wc_gzd_set_content(variation.nutrients_heading); + form.getElementOrBlock(form, 'ingredients', '.wc-gzd-ingredients').wc_gzd_set_content(variation.ingredients); + form.getElementOrBlock(form, 'ingredients-heading', '.wc-gzd-ingredients-heading').wc_gzd_set_content(variation.ingredients_heading); + form.getElementOrBlock(form, 'allergenic', '.wc-gzd-allergenic').wc_gzd_set_content(variation.allergenic); + form.getElementOrBlock(form, 'allergenic-heading', '.wc-gzd-allergenic-heading').wc_gzd_set_content(variation.allergenic_heading); + form.getElementOrBlock(form, 'shipping-costs-info', '.shipping-costs-info').wc_gzd_set_content(hasDisplayPrice ? variation.shipping_costs_info : ''); + form.getElementOrBlock(form, 'unit-price', '.price-unit').wc_gzd_set_content(hasDisplayPrice ? variation.unit_price : ''); + form.getElementOrBlock(form, 'unit-product', '.product-units').wc_gzd_set_content(hasDisplayPrice ? variation.product_units : ''); + form.showOrHideTabs(form, variation.has_product_safety_information); + form.$form.trigger('germanized_variation_data', variation, $wrapper); + }; + + /** + * Function to call wc_gzd_variation_form on jquery selector. + */ + $.fn.wc_germanized_variation_form = function () { + new GermanizedVariationForm(this); + return this; + }; + + /** + * Stores the default text for an element so it can be reset later + */ + $.fn.wc_gzd_set_content = function (content) { + /** + * Explicitly exclude loop wrappers to prevent information + * to be replaced within the main product wrapper (e.g. cross-sells). + */ + var $this = this.not('.wc-gzd-additional-info-loop'); + content = undefined === content ? '' : content; + if (undefined === $this.attr('data-o_content')) { + $this.attr('data-o_content', $this.html()); + } + $this.html(content); + $this.addClass('variation_modified variation_gzd_modified').removeClass('wc-gzd-additional-info-placeholder').show(); + if ($this.is(':empty')) { + $this.hide(); + if ($this.parents('.wp-block-woocommerce-gzd-product-price-label').length > 0) { + $this.parents('.wp-block-woocommerce-gzd-product-price-label').addClass('wp-block-woocommerce-gzd-product-is-empty'); + } + if ($this.parents('.woocommerce-product-attributes-item').length > 0) { + $this.parents('.woocommerce-product-attributes-item').hide(); + } + } else { + if ($this.parents('.wp-block-woocommerce-gzd-product-price-label').length > 0) { + $this.parents('.wp-block-woocommerce-gzd-product-price-label').removeClass('wp-block-woocommerce-gzd-product-is-empty'); + } + if ($this.parents('.woocommerce-product-attributes-item').length > 0) { + $this.parents('.woocommerce-product-attributes-item').show(); + } + } + }; + + /** + * Stores the default text for an element so it can be reset later + */ + $.fn.wc_gzd_reset_content = function () { + var $this = this.not('.wc-gzd-additional-info-loop'); + if (undefined !== $this.attr('data-o_content')) { + $this.html($this.attr('data-o_content')); + $this.removeClass('variation_modified variation_gzd_modified').show(); + } + if ($this.is(':empty')) { + $this.addClass('wc-gzd-additional-info-placeholder').hide(); + if ($this.parents('.wp-block-woocommerce-gzd-product-price-label').length > 0) { + $this.parents('.wp-block-woocommerce-gzd-product-price-label').addClass('wp-block-woocommerce-gzd-product-is-empty'); + } + if ($this.parents('.woocommerce-product-attributes-item').length > 0) { + $this.parents('.woocommerce-product-attributes-item').hide(); + } + } else { + if ($this.parents('.wp-block-woocommerce-gzd-product-price-label').length > 0) { + $this.parents('.wp-block-woocommerce-gzd-product-price-label').removeClass('wp-block-woocommerce-gzd-product-is-empty'); + } + if ($this.parents('.woocommerce-product-attributes-item').length > 0) { + $this.parents('.woocommerce-product-attributes-item').show(); + } + } + }; + $(function () { + if (typeof wc_gzd_add_to_cart_variation_params !== 'undefined') { + $('.variations_form').each(function () { + $(this).wc_germanized_variation_form(); + }); + + /** + * Improve compatibility with custom implementations which might + * manually construct wc_variation_form() (e.g. quick view). + */ + $(document.body).on('wc_variation_form', function (e, variationForm) { + var $form; + if (typeof variationForm === 'undefined') { + $form = $(e.target); + } else { + $form = $(variationForm.$form); + } + if ($form.length > 0) { + if (!$form.hasClass('has-gzd-variation-form')) { + $form.wc_germanized_variation_form(); + // Make sure to reload variation to apply our logic + $form.trigger('check_variations'); + } + } + }); + } + }); +})(jQuery, window, document); +((window.germanized = window.germanized || {})["static"] = window.germanized["static"] || {})["add-to-cart-variation"] = __webpack_exports__; +/******/ })() +; \ No newline at end of file diff --git a/build/static/admin-activation-styles.asset.php b/build/static/admin-activation-styles.asset.php new file mode 100644 index 000000000..6a279e73a --- /dev/null +++ b/build/static/admin-activation-styles.asset.php @@ -0,0 +1 @@ + array(), 'version' => '6e7efac21fa22d0cf9f4'); diff --git a/build/static/admin-activation-styles.css b/build/static/admin-activation-styles.css new file mode 100644 index 000000000..018dc785b --- /dev/null +++ b/build/static/admin-activation-styles.css @@ -0,0 +1 @@ +.wc-gzd-news p{font-size:15px;line-height:1.8}.wc-gzd-news .about-logo-wrapper{display:flex;flex-wrap:wrap;justify-content:flex-start}.wc-gzd-news .about-logo-wrapper .wc-gzd-logo{background:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbDpzcGFjZT0icHJlc2VydmUiIHdpZHRoPSI1MDkuMTYiIGhlaWdodD0iMTY3LjA3IiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA1MDkuMTYgMTY3LjA3Ij48c3R5bGU+LnN0MHtmaWxsOm5vbmV9LnN0MXtlbmFibGUtYmFja2dyb3VuZDpuZXd9LnN0MntmaWxsOiMyNjI2MjZ9PC9zdHlsZT48cGF0aCBpZD0iWE1MSURfMTBfIiBkPSJNNTA5LjE0IDU5LjI5IDAgNjAuMTIuMDIuODMgNTA5LjE2IDB6IiBjbGFzcz0ic3QwIi8+PGcgY2xhc3M9InN0MSI+PHBhdGggZD0iTTU4LjAxIDI3LjA3YzAgMTcuMTgtMTEuMjEgMjkuMzgtMjcuNjYgMjkuMzgtMTYuMDggMC0yNy45Ny0xMS41Ni0yNy45Ny0yNy41M0MyLjM5IDEyLjk0IDE0LjA2IDEuMyAzMC4yMyAxLjNjMTMuNzYgMCAyNS4wMiA4LjYxIDI3LjI0IDIwLjgxSDQyLjMxYy0xLjktNC40Mi02LjYtNy4yNy0xMS45NS03LjI3LTcuODYgMC0xMy4xNiA1LjY5LTEzLjE2IDE0LjA3IDAgOC4zIDUuMjEgMTMuOTkgMTMuMTYgMTMuOTkgNS41MiAwIDEwLjI1LTIuNjcgMTEuOS02LjcySDI5LjIydi05LjEybDI4Ljc5LjAxek05OS41NCA0Mi41OHYxMi41NEg2NS4zMlYyLjYzaDMzLjU5djEyLjVINzkuNzJ2Ny43M2gxNy4yNHYxMS44Nkg3OS43MnY3Ljg2aDE5Ljgyek0xMjcuNTUgMzkuMDZoLTUuMjR2MTYuMDZoLTE0LjQ2VjIuNjNoMjIuNzVjMTEuMzIgMCAxOS41MiA3LjYgMTkuNTIgMTguNTggMCA2LjQ0LTMuMTUgMTEuNzItOC4zMyAxNC44M2wxMC40MiAxOS4wOWgtMTYuMTRsLTguNTItMTYuMDd6bS01LjI1LTEyLjE4aDYuNjFjNC4wNCAwIDYuMzctMi40MyA2LjM3LTUuNzIgMC0zLjI4LTIuMzMtNS42OC02LjM3LTUuNjhoLTYuNjF2MTEuNHpNMjEwLjQ2IDU1LjEybC00LjEtMzAuMjMtMTMuOTIgMzAuMzJoLTQuMjdMMTc0LjI1IDI0LjlsLTQuMDQgMzAuMjJoLTE0LjY2bDcuOTQtNTIuNWgxNC40NGwxMi4zNiAyOC41NyAxMi40NC0yOC41N2gxNC40NGw3Ljg3IDUyLjVoLTE0LjU4ek0yNjQuMTIgNDYuNmgtMTguNjFsLTIuOTEgOC41M2gtMTUuNWwyMC42Mi01Mi41aDE0LjE0bDIxLjA3IDUyLjVIMjY3bC0yLjg4LTguNTN6bS05LjM0LTI3LjU5LTUuNzUgMTYuMjdoMTEuNTZsLTUuODEtMTYuMjd6TTMzNC44MiAyLjYzdjUyLjVoLTExLjk2TDMwMiAyNi42NHYyOC40OWgtMTQuMDJWMi42M2gxMi42NmwyMC4xNiAyNy41NFYyLjYzaDE0LjAyek0zNDQuOTkgMi42M2gxNC42NXY1Mi41aC0xNC42NVYyLjYzek00MDguMDMgNDEuNjZ2MTMuNDdoLTQxLjU2di0zLjAxbDE5LjQ1LTM2LjAyaC0xOC4xOFYyLjYzaDM5LjM5VjUuOWwtMTkuMzUgMzUuNzZoMjAuMjV6TTQ0OS4yNyA0Mi41OHYxMi41NGgtMzQuMjNWMi42M2gzMy41OXYxMi41aC0xOS4xOXY3LjczaDE3LjI0djExLjg2aC0xNy4yNHY3Ljg2aDE5Ljgzek01MDUuOTEgMjguODNjMCAxNS4zMi0xMS4yNSAyNi4yOS0yNy4xIDI2LjI5aC0yMS4yNVYyLjYzaDIxLjI1YzE1LjkgMCAyNy4xIDEwLjg2IDI3LjEgMjYuMnptLTE0LjgzIDBjMC03Ljc5LTUuMTgtMTIuOTYtMTIuOTYtMTIuOTZoLTYuMDR2MjYuMDFoNi4wNGM3Ljc4IDAgMTIuOTYtNS4zIDEyLjk2LTEzLjA1eiIgY2xhc3M9InN0MiIvPjwvZz48cGF0aCBpZD0iWE1MSURfOV8iIGQ9Ik05NC42NCA2OC4zMWgxMDYuNXY4Ljc2SDk0LjY0eiIgY2xhc3M9InN0MiIvPjxwYXRoIGlkPSJYTUxJRF84XyIgZD0iTTIwMS4xNCA2OC4zMWgxMDYuNXY4Ljc2aC0xMDYuNXoiIHN0eWxlPSJmaWxsOiNmZTAwMDAiLz48cGF0aCBpZD0iWE1MSURfN18iIGQ9Ik0zMDcuNjQgNjguMzFoMTA2LjV2OC43NmgtMTA2LjV6IiBzdHlsZT0iZmlsbDojZmMwIi8+PHBhdGggaWQ9IlhNTElEXzFfIiBkPSJNODEuODMgODguMDdoMzQ1Ljk0djc5SDgxLjgzeiIgY2xhc3M9InN0MCIvPjxnIGNsYXNzPSJzdDEiPjxwYXRoIGQ9Ik0xMDUuODkgOTMuOTR2My4xMmg2LjN2NC43M2gtNi4zdjYuODdoLTUuNDV2LTE5LjZoMTIuNDd2NC44OWgtNy4wMnpNMTI1LjM2IDEwOS4xNWMtNi4zIDAtMTAuOC00LjMxLTEwLjgtMTAuM3M0LjUtMTAuMjkgMTAuOC0xMC4yOWM2LjI4IDAgMTAuNzYgNC4yOSAxMC43NiAxMC4yOS4wMSA2LjAxLTQuNDcgMTAuMy0xMC43NiAxMC4zem01LjE0LTEwLjNjMC0zLjA3LTIuMTYtNS4yNy01LjE0LTUuMjctMi45OCAwLTUuMTcgMi4yMi01LjE3IDUuMjcgMCAzLjA1IDIuMTkgNS4yNyA1LjE3IDUuMjdzNS4xNC0yLjIgNS4xNC01LjI3ek0xNDYuMjQgMTAyLjY1aC0xLjk2djZoLTUuNHYtMTkuNmg4LjVjNC4yMyAwIDcuMjkgMi44NCA3LjI5IDYuOTQgMCAyLjQtMS4xNyA0LjM4LTMuMTEgNS41NGwzLjg5IDcuMTNoLTYuMDNsLTMuMTgtNi4wMXptLTEuOTYtNC41NGgyLjQ3YzEuNTEgMCAyLjM4LS45MSAyLjM4LTIuMTMgMC0xLjIyLS44Ny0yLjEyLTIuMzgtMi4xMmgtMi40N3Y0LjI1ek0xOTAuNyA4OS4wNWwtNi4wNCAxOS42aC00Ljc1bC0zLjc2LTkuNDYtMy42OSA5LjQ2aC00Ljc1bC02LjE0LTE5LjZoNS44bDMuMTggMTEuMyA0LjY3LTExLjJoMS44N2w0Ljc1IDExLjIxIDMuMTItMTEuM2g1Ljc0ek0yMDEuOTEgMTA5LjE1Yy02LjMgMC0xMC44LTQuMzEtMTAuOC0xMC4zczQuNS0xMC4yOSAxMC44LTEwLjI5YzYuMjggMCAxMC43NiA0LjI5IDEwLjc2IDEwLjI5LjAxIDYuMDEtNC40NyAxMC4zLTEwLjc2IDEwLjN6bTUuMTQtMTAuM2MwLTMuMDctMi4xNi01LjI3LTUuMTQtNS4yNy0yLjk4IDAtNS4xNyAyLjIyLTUuMTcgNS4yNyAwIDMuMDUgMi4xOSA1LjI3IDUuMTcgNS4yN3M1LjE0LTIuMiA1LjE0LTUuMjd6TTIyNS4yMSAxMDkuMTVjLTYuMyAwLTEwLjgtNC4zMS0xMC44LTEwLjNzNC41LTEwLjI5IDEwLjgtMTAuMjljNi4yOCAwIDEwLjc2IDQuMjkgMTAuNzYgMTAuMjkgMCA2LjAxLTQuNDggMTAuMy0xMC43NiAxMC4zem01LjE0LTEwLjNjMC0zLjA3LTIuMTYtNS4yNy01LjE0LTUuMjctMi45OCAwLTUuMTcgMi4yMi01LjE3IDUuMjcgMCAzLjA1IDIuMTkgNS4yNyA1LjE3IDUuMjdzNS4xNC0yLjIgNS4xNC01LjI3ek0yNDguMTMgMTA5LjE1Yy01Ljk3IDAtMTAuNDItNC40Mi0xMC40Mi0xMC4yOCAwLTUuOSA0LjQ2LTEwLjMxIDEwLjQyLTEwLjMxIDUuMTQgMCA5LjEyIDMuMzkgOS45MSA4LjM2aC01LjQ3Yy0uNjctMi4wMS0yLjM3LTMuMzEtNC40My0zLjMxLTIuNzggMC00LjgxIDIuMjMtNC44MSA1LjI3IDAgMy4wMiAyLjA0IDUuMjIgNC44MSA1LjIyIDIuMTcgMCAzLjg4LTEuNDIgNC40My0zLjU5aDUuNTJjLS43NCA1LjE0LTQuNzQgOC42NC05Ljk2IDguNjR6TTI3MC40NiAxMDkuMTVjLTYuMyAwLTEwLjgtNC4zMS0xMC44LTEwLjNzNC41LTEwLjI5IDEwLjgtMTAuMjljNi4yOCAwIDEwLjc2IDQuMjkgMTAuNzYgMTAuMjkgMCA2LjAxLTQuNDggMTAuMy0xMC43NiAxMC4zem01LjE0LTEwLjNjMC0zLjA3LTIuMTYtNS4yNy01LjE0LTUuMjctMi45OCAwLTUuMTcgMi4yMi01LjE3IDUuMjcgMCAzLjA1IDIuMTkgNS4yNyA1LjE3IDUuMjdzNS4xNC0yLjIgNS4xNC01LjI3ek0zMDMuMTYgMTA4LjY1bC0xLjUzLTExLjI5LTUuMiAxMS4zMmgtMS42bC01LjItMTEuMzItMS41MSAxMS4yOGgtNS40N2wyLjk2LTE5LjZIMjkxbDQuNjIgMTAuNjcgNC42NS0xMC42N2g1LjM5bDIuOTQgMTkuNmgtNS40NHpNMzMwLjY2IDEwOC42NWwtMS41My0xMS4yOS01LjIgMTEuMzJoLTEuNmwtNS4yLTExLjMyLTEuNTEgMTEuMjhoLTUuNDdsMi45Ni0xOS42aDUuMzlsNC42MiAxMC42NyA0LjY1LTEwLjY3aDUuMzlsMi45NCAxOS42aC01LjQ0ek0zNTEuNTUgMTAzLjk3djQuNjhoLTEyLjc4di0xOS42aDEyLjU0djQuNjdoLTcuMTd2Mi44OWg2LjQ0djQuNDNoLTYuNDR2Mi45M2g3LjQxek0zNjIuMDEgMTAyLjY1aC0xLjk2djZoLTUuNHYtMTkuNmg4LjVjNC4yMyAwIDcuMjkgMi44NCA3LjI5IDYuOTQgMCAyLjQtMS4xNyA0LjM4LTMuMTEgNS41NGwzLjg5IDcuMTNoLTYuMDNsLTMuMTgtNi4wMXptLTEuOTYtNC41NGgyLjQ3YzEuNTEgMCAyLjM4LS45MSAyLjM4LTIuMTMgMC0xLjIyLS44Ny0yLjEyLTIuMzgtMi4xMmgtMi40N3Y0LjI1ek0zODIuODEgMTA5LjE1Yy01Ljk3IDAtMTAuNDItNC40Mi0xMC40Mi0xMC4yOCAwLTUuOSA0LjQ2LTEwLjMxIDEwLjQyLTEwLjMxIDUuMTQgMCA5LjEyIDMuMzkgOS45MSA4LjM2aC01LjQ3Yy0uNjctMi4wMS0yLjM3LTMuMzEtNC40My0zLjMxLTIuNzggMC00LjgxIDIuMjMtNC44MSA1LjI3IDAgMy4wMiAyLjA0IDUuMjIgNC44MSA1LjIyIDIuMTcgMCAzLjg4LTEuNDIgNC40My0zLjU5aDUuNTJjLS43NCA1LjE0LTQuNzQgOC42NC05Ljk2IDguNjR6TTQwOC4xNCAxMDMuOTd2NC42OGgtMTIuNzh2LTE5LjZoMTIuNTR2NC42N2gtNy4xN3YyLjg5aDYuNDR2NC40M2gtNi40NHYyLjkzaDcuNDF6IiBjbGFzcz0ic3QyIi8+PC9nPjwvc3ZnPg==) no-repeat;background-size:298px auto;display:inline-block!important;height:89px;margin-top:2rem;text-indent:-9999px;vertical-align:top;width:298px}.wc-gzd-news .about-logo-wrapper .about-text{display:inline-block;margin:1rem 0 0 3%;max-width:50%;padding:0;width:50%}.wc-gzd-news .new-feature img{align-self:center}.wc-gzd-news p.price{font-size:.8em}.wc-gzd-news .columns{display:flex;flex-wrap:wrap;margin-left:-1em;margin-right:-1em}.wc-gzd-news .columns *{box-sizing:border-box}.wc-gzd-news .columns .col{align-items:center;display:inline-flex;flex-wrap:wrap;margin-right:0;padding:0 1em;width:33.3333%}.wc-gzd-news .columns .col h4 .dashicons{margin-right:5px}.wc-gzd-news .columns .col.align-center{align-self:center;display:inline-flex}.wc-gzd-news .columns.two-col .col{width:50%}.dashboard_page_wc-gzd-about h1{margin-right:0;width:100%}.dashboard_page_wc-gzd-about h3 .wc-gzd-pro{background:transparent;border:1px solid #000;color:#000;font-size:.7em;margin-left:5px}.dashboard_page_wc-gzd-about .changelog{border-top:1px solid #ccc;margin-top:3em;padding-top:0}.dashboard_page_wc-gzd-about .feature-section{border:none}.wc-gzd-actions{clear:both;width:100%}.wc-gzd-actions.wc-gzd-actions-right{text-align:right}.wc-gzd-actions a.button{margin-right:.5em}.wc-gzd-actions .woocommerce-gzd-message .button-primary,.wc-gzd-actions a.wc-gzd-default-button{background-color:#262626!important;background-image:none!important;border:1px solid #000!important;text-shadow:none!important}.wc-gzd-actions .woocommerce-gzd-message .button-primary:hover,.wc-gzd-actions a.wc-gzd-default-button:hover{background-color:#363636!important;background-image:none!important;border:1px solid #000!important;text-shadow:none!important}.woocommerce-gzd-message .form-table tr td,.woocommerce-gzd-message .form-table tr th{margin:0;padding:.7rem 0}.woocommerce-gzd-message a.wc-gzd-skip{opacity:.7}div.woocommerce-gzd-message{border-left:4px solid #bb2525!important}div.woocommerce-gzd-message p{max-width:100%!important} \ No newline at end of file diff --git a/build/static/admin-activation-styles.js b/build/static/admin-activation-styles.js new file mode 100644 index 000000000..e06ec2148 --- /dev/null +++ b/build/static/admin-activation-styles.js @@ -0,0 +1,25 @@ +/******/ (function() { // webpackBootstrap +/******/ "use strict"; +/******/ // The require scope +/******/ var __webpack_require__ = {}; +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/make namespace object */ +/******/ !function() { +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ }(); +/******/ +/************************************************************************/ +var __webpack_exports__ = {}; +__webpack_require__.r(__webpack_exports__); +// extracted by mini-css-extract-plugin + +((window.germanized = window.germanized || {})["static"] = window.germanized["static"] || {})["admin-activation-styles"] = __webpack_exports__; +/******/ })() +; \ No newline at end of file diff --git a/build/static/admin-legal-checkboxes.asset.php b/build/static/admin-legal-checkboxes.asset.php new file mode 100644 index 000000000..e0d0878fc --- /dev/null +++ b/build/static/admin-legal-checkboxes.asset.php @@ -0,0 +1 @@ + array(), 'version' => '264aada418072496e07c'); diff --git a/build/static/admin-legal-checkboxes.js b/build/static/admin-legal-checkboxes.js new file mode 100644 index 000000000..27601336c --- /dev/null +++ b/build/static/admin-legal-checkboxes.js @@ -0,0 +1,276 @@ +/******/ (function() { // webpackBootstrap +var __webpack_exports__ = {}; +/* global shippingZonesLocalizeScript, ajaxurl */ +(function ($, data, wp, ajaxurl) { + $(function () { + var $table = $('.wc-gzd-legal-checkboxes'), + $tbody = $('.wc-gzd-legal-checkbox-rows'), + $save_button = $('.wc-shipping-zone-save'), + $row_template = wp.template('wc-gzd-legal-checkbox-row'), + // Backbone model + LegalCheckbox = Backbone.Model.extend({ + changes: {}, + logChanges: function (changedRows) { + var changes = this.changes || {}; + _.each(changedRows, function (row, id) { + changes[id] = _.extend(changes[id] || { + id: id + }, row); + }); + this.changes = changes; + this.trigger('change:checkboxes'); + }, + discardChanges: function (id) { + var changes = this.changes || {}, + set_position = null, + checkboxes = _.indexBy(this.get('checkboxes'), 'id'); + + // Find current set position if it has moved since last save + if (changes[id] && changes[id].priority !== undefined) { + set_position = changes[id].priority; + } + + // Delete all changes + delete changes[id]; + + // If the position was set, and this zone does exist in DB, set the position again so the changes are not lost. + if (set_position !== null && checkboxes[id] && checkboxes[id].priority !== set_position) { + changes[id] = _.extend(changes[id] || {}, { + id: id, + priority: set_position + }); + } + this.changes = changes; + + // No changes? Disable save button. + if (0 === _.size(this.changes)) { + legalCheckboxView.clearUnloadConfirmation(); + } + }, + save: function () { + if (_.size(this.changes)) { + $.post(ajaxurl + (ajaxurl.indexOf('?') > 0 ? '&' : '?') + 'action=woocommerce_gzd_legal_checkboxes_save_changes', { + wc_gzd_legal_checkbox_nonce: data.checkboxes_nonce, + changes: this.changes + }, this.onSaveResponse, 'json'); + } else { + legalCheckbox.trigger('saved:checkboxes'); + } + }, + onSaveResponse: function (response, textStatus) { + if ('success' === textStatus) { + if (response.success) { + legalCheckbox.set('checkboxes', response.data.checkboxes); + legalCheckbox.trigger('change:checkboxes'); + legalCheckbox.changes = {}; + legalCheckbox.trigger('saved:checkboxes'); + } else { + window.alert(data.strings.save_failed); + } + } + } + }), + // Backbone view + LegalCheckboxView = Backbone.View.extend({ + rowTemplate: $row_template, + initialize: function () { + this.listenTo(this.model, 'change:checkboxes', this.setUnloadConfirmation); + this.listenTo(this.model, 'saved:checkboxes', this.clearUnloadConfirmation); + this.listenTo(this.model, 'saved:checkboxes', this.render); + $tbody.on('change', { + view: this + }, this.updateModelOnChange); + $tbody.on('sortupdate', { + view: this + }, this.updateModelOnSort); + $(window).on('beforeunload', { + view: this + }, this.unloadConfirmation); + $(document.body).on('click', '.wc-gzd-legal-checkbox-add', { + view: this + }, this.onAddNewRow); + }, + block: function () { + $(this.el).block({ + message: null, + overlayCSS: { + background: '#fff', + opacity: 0.6 + } + }); + }, + unblock: function () { + $(this.el).unblock(); + }, + render: function () { + var checkboxes = _.indexBy(this.model.get('checkboxes'), 'id'), + view = this; + view.$el.empty(); + view.unblock(); + if (_.size(checkboxes)) { + // Sort zones + checkboxes = _(checkboxes).chain().sortBy(function (checkbox) { + return parseInt(checkbox.priority, 10); + }).value(); + + // Populate $tbody with the current zones + $.each(checkboxes, function (id, rowData) { + view.renderRow(rowData); + }); + } + view.initRows(); + }, + renderRow: function (rowData) { + var view = this; + view.$el.append(view.rowTemplate(rowData)); + view.initRow(rowData); + }, + initRow: function (rowData) { + var view = this; + var $tr = view.$el.find('tr[data-id="' + rowData.id + '"]'); + + // List shipping methods + view.renderLocations(rowData.id, rowData.location_titles); + view.renderStatus(rowData.id, rowData.is_enabled === 'yes', 'enabled'); + view.renderStatus(rowData.id, rowData.is_mandatory === 'yes', 'mandatory'); + view.disableDelete(rowData.id, rowData.is_core === 'yes'); + $tr.find('.wc-gzd-legal-checkbox-delete').on('click', { + view: this + }, this.onDeleteRow); + }, + initRows: function () { + // Tooltips + $('#tiptip_holder').removeAttr('style'); + $('#tiptip_arrow').removeAttr('style'); + $('.tips').tipTip({ + 'attribute': 'data-tip', + 'fadeIn': 50, + 'fadeOut': 50, + 'delay': 50 + }); + }, + disableDelete: function (id, is_core) { + var $tr = $('.wc-gzd-legal-checkboxes tr[data-id="' + id + '"]'); + if (is_core) { + $tr.find('.wc-gzd-legal-checkbox-delete').remove(); + $tr.find('.row-actions .sep').remove(); + } + }, + renderStatus: function (id, status, column) { + var $tr = $('.wc-gzd-legal-checkboxes tr[data-id="' + id + '"]'); + var $td = $tr.find('td.wc-gzd-legal-checkbox-' + column); + class_name = 'enabled'; + if (!status) { + class_name = 'disabled'; + } + $td.empty(); + $td.html(''); + }, + renderLocations: function (id, locations) { + var $tr = $('.wc-gzd-legal-checkboxes tr[data-id="' + id + '"]'); + var $location_list = $tr.find('td.wc-gzd-legal-checkbox-locations ul'); + $location_list.find('.wc-gzd-legal-checkbox-location').remove(); + if (_.size(locations)) { + _.each(locations, function (title, key) { + $location_list.append(''); + }); + } + }, + onDeleteRow: function (event) { + var view = event.data.view, + model = view.model, + checkboxes = _.indexBy(model.get('checkboxes'), 'id'), + changes = {}, + row = $(this).closest('tr'), + id = row.data('id'); + event.preventDefault(); + if (window.confirm(data.strings.delete_confirmation_msg)) { + if (checkboxes[id]) { + delete checkboxes[id]; + changes[id] = _.extend(changes[id] || {}, { + deleted: 'deleted' + }); + model.set('checkboxes', checkboxes); + model.logChanges(changes); + event.data.view.block(); + event.data.view.model.save(); + } + } + }, + setUnloadConfirmation: function () { + this.needsUnloadConfirm = true; + $save_button.prop('disabled', false); + }, + clearUnloadConfirmation: function () { + this.needsUnloadConfirm = false; + $save_button.prop('disabled', true); + }, + unloadConfirmation: function (event) { + if (event.data.view.needsUnloadConfirm) { + event.returnValue = data.strings.unload_confirmation_msg; + window.event.returnValue = data.strings.unload_confirmation_msg; + return data.strings.unload_confirmation_msg; + } + }, + updateModelOnChange: function (event) { + var model = event.data.view.model, + $target = $(event.target), + id = $target.closest('tr').data('id'), + attribute = $target.data('attribute'), + value = $target.val(), + checkboxes = _.indexBy(model.get('checkboxes'), 'id'), + changes = {}; + if (!checkboxes[id] || checkboxes[id][attribute] !== value) { + checkboxes[id] = {}; + checkboxes[id][attribute] = value; + } + model.logChanges(changes); + }, + updateModelOnSort: function (event) { + var view = event.data.view, + model = view.model, + checkboxes = _.indexBy(model.get('checkboxes'), 'id'), + rows = $('tbody.wc-gzd-legal-checkbox-rows tr'), + changes = {}; + + // Update sorted row position + _.each(rows, function (row) { + var id = $(row).data('id'), + old_position = null, + new_position = parseInt($(row).index(), 10); + if (checkboxes[id]) { + old_position = parseInt(checkboxes[id].priority, 10); + } + if (old_position !== new_position) { + changes[id] = _.extend(changes[id] || {}, { + priority: new_position + }); + } + }); + if (_.size(changes)) { + model.logChanges(changes); + event.data.view.block(); + event.data.view.model.save(); + } + } + }), + legalCheckbox = new LegalCheckbox({ + checkboxes: data.checkboxes + }), + legalCheckboxView = new LegalCheckboxView({ + model: legalCheckbox, + el: $tbody + }); + legalCheckboxView.render(); + $tbody.sortable({ + items: 'tr', + cursor: 'move', + axis: 'y', + handle: 'td.wc-gzd-legal-checkbox-sort', + scrollSensitivity: 40 + }); + }); +})(jQuery, wc_gzd_legal_checkboxes_params, wp, ajaxurl); +((window.germanized = window.germanized || {})["static"] = window.germanized["static"] || {})["admin-legal-checkboxes"] = __webpack_exports__; +/******/ })() +; \ No newline at end of file diff --git a/build/static/admin-product-variations.asset.php b/build/static/admin-product-variations.asset.php new file mode 100644 index 000000000..f9e1eff3b --- /dev/null +++ b/build/static/admin-product-variations.asset.php @@ -0,0 +1 @@ + array(), 'version' => '169fd782c11966896abe'); diff --git a/build/static/admin-product-variations.js b/build/static/admin-product-variations.js new file mode 100644 index 000000000..2ac54f387 --- /dev/null +++ b/build/static/admin-product-variations.js @@ -0,0 +1,135 @@ +/******/ (function() { // webpackBootstrap +var __webpack_exports__ = {}; +jQuery(function ($) { + var wc_gzd_product_variations_actions = { + params: {}, + init: function () { + this.params = wc_gzd_admin_product_variations_params; + $('#woocommerce-product-data').on('woocommerce_variations_loaded woocommerce_variations_added', this.variations_loaded); + $('#woocommerce-product-data').on('click', '.woocommerce_variation', this.show_or_hide_unit_variation); + $('#general_product_data').on('blur', 'input#_unit_base', this.show_or_hide_unit_variation); + $('#general_product_data').on('change', 'select#_unit', this.show_or_hide_unit_variation); + $(document).on('click', '.wc-gzd-general-product-data-tab', this.on_click_general_product_data); + $('select.variation_actions').on('variable_delivery_time_ajax_data', this.onSetDeliveryTime); + $('select.variation_actions').on('variable_unit_product_ajax_data', this.onSetProductUnit); + $(document).ajaxSend(this.appendParentUnitData); + $('#variable_product_options').on('change', 'input.variable_service', this.variable_is_service).on('change', 'input.variable_used_good', this.variable_is_used_good).on('change', 'input.variable_defective_copy', this.variable_is_defective_copy); + }, + parseAjaxData: function (rawData) { + var data = false; + try { + data = JSON.parse('{"' + rawData.replace(/&/g, '","').replace(/=/g, '":"') + '"}', function (key, value) { + return key === "" ? value : decodeURIComponent(value); + }); + } catch (e) { + data = false; + } + return data; + }, + /** + * Append variable parent data to the woocommerce_save_variations event. + * + * @param e + * @param jqXHR + * @param settings + */ + appendParentUnitData: function (e, jqXHR, settings) { + if (jqXHR != null) { + if (settings.hasOwnProperty('data')) { + var search = settings.data; + var data = wc_gzd_product_variations_actions.parseAjaxData(search); + if (data && data.hasOwnProperty('action') && data.action === 'woocommerce_save_variations') { + var fields = ['unit', 'unit_base', 'unit_product']; + var parent_data = {}; + $.each(fields, function (index, id) { + parent_data['_' + id] = $('#_' + id).val(); + }); + settings.data += '&' + $.param(parent_data); + } + } + } + }, + variations_loaded: function (event, needsUpdate) { + needsUpdate = needsUpdate || false; + var wrapper = $('#woocommerce-product-data'); + if (!needsUpdate) { + /** + * This will mark variations as needing updates (which is not the case) + */ + $('input.variable_service, input.variable_used_good, input.variable_defective_copy', wrapper).trigger('change'); + + // Remove variation-needs-update classes + $('.woocommerce_variations .variation-needs-update', wrapper).removeClass('variation-needs-update'); + + // Disable cancel and save buttons + $('button.cancel-variation-changes, button.save-variation-changes', wrapper).attr('disabled', 'disabled'); + } + $(document.body).trigger('wc-gzd-refresh-unit-placeholder'); + $(document.body).trigger('wc-gzd-show-hide-panels'); + }, + variable_is_service: function () { + $(this).closest('.woocommerce_variation').find('.show_if_variation_service').hide(); + if ($(this).is(':checked')) { + $(this).closest('.woocommerce_variation').find('.show_if_variation_service').show(); + } + }, + variable_is_used_good: function () { + $(this).closest('.woocommerce_variation').find('.show_if_variation_used_good').hide(); + if ($(this).is(':checked')) { + $(this).closest('.woocommerce_variation').find('.show_if_variation_used_good').show(); + } + }, + variable_is_defective_copy: function () { + $(this).closest('.woocommerce_variation').find('.show_if_variation_defective_copy').hide(); + if ($(this).is(':checked')) { + $(this).closest('.woocommerce_variation').find('.show_if_variation_defective_copy').show(); + } + }, + onSetDeliveryTime: function (e, data) { + return wc_gzd_product_variations_actions.onVariationAction(data, 'set_delivery_time'); + }, + onSetProductUnit: function (e, data) { + return wc_gzd_product_variations_actions.onVariationAction(data, 'set_product_unit'); + }, + onVariationAction: function (data, type) { + var value = window.prompt(wc_gzd_product_variations_actions.params['i18n_' + type]); + if (value !== null) { + data.value = value; + return data; + } else { + return; + } + }, + on_click_general_product_data: function () { + $('ul.wc-tabs > li.general_options > a').trigger('click'); + return false; + }, + show_or_hide_unit_variation: function () { + if (wc_gzd_product_variations_actions.is_variable()) { + $('.variable_pricing_unit .form-row').hide(); + $('.variable_pricing_unit .wc-gzd-unit-price-disabled-notice').show(); + if (!wc_gzd_product_variations_actions.has_unit_price() && wc_gzd_product_variations_actions.has_unit()) { + $('.variable_pricing_unit .form-row').hide(); + $('.variable_pricing_unit .wc-gzd-unit-price-disabled-notice').show(); + $('.variable_pricing_unit').find('input[name*=variable_unit_product]').parents('.form-row').show(); + } else if (wc_gzd_product_variations_actions.has_unit_price()) { + $('.variable_pricing_unit .form-row').show(); + $('.variable_pricing_unit .wc-gzd-unit-price-disabled-notice').hide(); + } + } + }, + is_variable: function () { + return $('select#product-type').val() === 'variable'; + }, + has_unit: function () { + return $('#_unit').val() !== '0'; + }, + has_unit_price: function () { + return $('#_unit').val() !== '0' && $('#_unit_base').val().length !== 0; + } + }; + wc_gzd_product_variations_actions.init(); +}); +((window.germanized = window.germanized || {})["static"] = window.germanized["static"] || {})["admin-product-variations"] = __webpack_exports__; +/******/ })() +; \ No newline at end of file diff --git a/build/static/admin-product.asset.php b/build/static/admin-product.asset.php new file mode 100644 index 000000000..ba3b65455 --- /dev/null +++ b/build/static/admin-product.asset.php @@ -0,0 +1 @@ + array(), 'version' => 'ae6e212ee652fabdac33'); diff --git a/build/static/admin-product.js b/build/static/admin-product.js new file mode 100644 index 000000000..f843020a9 --- /dev/null +++ b/build/static/admin-product.js @@ -0,0 +1,228 @@ +/******/ (function() { // webpackBootstrap +var __webpack_exports__ = {}; +jQuery(function ($) { + var wc_gzd_product = { + warranty_upload_file_frame: false, + upload_file_frame: false, + params: {}, + init: function () { + var self = wc_gzd_product; + self.params = wc_gzd_admin_product_params; + $(document).on('click', 'a.wc-gzd-add-new-country-specific-delivery-time', self.onAddNewDeliveryTime).on('click', 'a.wc-gzd-remove-country-specific-delivery-time', self.onRemoveDeliveryTime).on('click', '.wc-gzd-product-upload', self.onUpload).on('click', '.wc-gzd-product-upload-remove', self.onRemoveUpload).on('woocommerce-product-type-change wc-gzd-product-type-change', self.onProductTypeChange).on('wc-gzd-refresh-unit-placeholder', self.onRefreshProductUnitPlaceholder).on('change', ':input#_unit', self.onChangeUnit).on('wc-gzd-show-hide-panels', self.showHidePanels); + try { + $(document.body).on('wc-enhanced-select-init wc-gzd-enhanced-select-init', this.onEnhancedSelectInit).trigger('wc-gzd-enhanced-select-init'); + } catch (err) { + // If select2 failed (conflict?) log the error but don't stop other scripts breaking. + window.console.log(err); + } + $('input#_is_food, input#_defective_copy').on('change', function () { + self.showHidePanels(); + }); + $('input#_defective_copy').trigger('change'); + $('#the-list').on('click', '.editinline', self.onQuickEdit); + }, + onRefreshProductUnitPlaceholder: function () { + var $selected = $(':input#_unit').find(":selected"); + if ($selected.length > 0) { + $('.wc-gzd-unit-placeholder').text($selected.text()); + } else { + $('.wc-gzd-unit-placeholder').text(''); + } + }, + onChangeUnit: function () { + $(document.body).trigger('wc-gzd-refresh-unit-placeholder'); + }, + onEnhancedSelectInit: function () { + var self = wc_gzd_product; + + // Tag select + $(':input.wc-gzd-enhanced-nutri-score').filter(':not(.enhanced)').each(function () { + var select2_args = { + minimumResultsForSearch: 10, + allowClear: $(this).data('allow_clear') ? true : false, + placeholder: $(this).data('placeholder'), + // There seems to be a bug in WooSelect: https://github.com/woocommerce/selectWoo/issues/39 + // templateSelection: self.formatNutriScore, + templateResult: self.formatNutriScore + }; + $(this).selectWoo(select2_args).addClass('enhanced'); + }); + }, + formatNutriScore: function (nutriScore) { + if (!nutriScore.id) { + return nutriScore.text; + } + var $nutri = $(' ' + nutriScore.text + ''); + return $nutri; + }, + onProductTypeChange: function () { + wc_gzd_product.showHidePanels(); + }, + showHidePanels: function () { + var is_food = $('input#_is_food:checked').length, + is_defective_copy = $('input#_defective_copy:checked').length; + var hide_classes = '.hide_if_is_food, .hide_if_defective_copy'; + var show_classes = '.show_if_is_food, .show_if_defective_copy'; + $(hide_classes).show(); + $(show_classes).hide(); + if (is_food) { + $('.show_if_is_food').show(); + } else { + if ($('.food_options.food_tab').hasClass('active')) { + $('.general_options.general_tab > a').trigger('click'); + } + } + if (is_defective_copy) { + $('.show_if_defective_copy').show(); + $('#wc-gzd-product-defect-description').show(); + } else { + $('#wc-gzd-product-defect-description').hide(); + } + }, + onQuickEdit: function () { + var post_id = $(this).closest('tr').attr('id'); + post_id = post_id.replace('post-', ''); + var $inline_data = $('#inline_' + post_id); + if ($inline_data.find('.gzd_delivery_time_slug').length > 0) { + var delivery_time = $inline_data.find('.gzd_delivery_time_slug').text(), + delivery_time_name = $inline_data.find('.gzd_delivery_time_name').text(), + manufacturer = $inline_data.find('.gzd_manufacturer_slug').text(), + manufacturer_name = $inline_data.find('.gzd_manufacturer_name').text(), + unit = $inline_data.find('.gzd_unit_slug').text(); + $('select[name="_unit"] option:selected', '.inline-edit-row').attr('selected', false).trigger('change'); + $('select[name="_unit"] option[value="' + unit + '"]').attr('selected', 'selected').trigger('change'); + $('select[name="_delivery_time"] option').remove().trigger('change'); + $('select[name="_manufacturer"] option').remove().trigger('change'); + if (delivery_time) { + $('select[name="_delivery_time"]').append(''); + } + if (manufacturer) { + $('select[name="_manufacturer"]').append(''); + } + + /** + * Ugly hack to make sure select2 initialization happens after WP cloned the data to the new div + */ + setTimeout(function () { + var $select2 = $('tr#edit-' + post_id + ' .wc-gzd-term-search-quick-edit.enhanced'); + + /** + * Destroy the select2 element from template in case it still exists and has been initialized + */ + if ($select2.length > 0) { + $select2.selectWoo('destroy'); + $select2.removeClass('enhanced'); + } + $('tr#edit-' + post_id + ' .wc-gzd-delivery-time-select-placeholder').addClass('wc-product-search', 'wc-gzd-delivery-time-search').removeClass('wc-gzd-delivery-time-select-placeholder'); + $('tr#edit-' + post_id + ' .wc-gzd-manufacturer-select-placeholder').addClass('wc-product-search', 'wc-gzd-manufacturer-search').removeClass('wc-gzd-manufacturer-select-placeholder'); + $(document.body).trigger('wc-enhanced-select-init'); + }, 100); + } + }, + onUpload: function (e) { + var self = wc_gzd_product, + $el = $(this), + $wrapper = $el.parents('.wc-gzd-product-upload-wrapper'), + multiple = $el.data('multiple'), + $attachmentHolder = $wrapper.find('.wc-gzd-product-upload-attachments'), + attachmentInputName = $el.data('input_name'), + attachments = []; + $wrapper.find('input[name="' + attachmentInputName + '"]').each(function () { + attachments.push(wp.media.attachment(parseInt($(this).val()))); + }); + e.preventDefault(); + + // Create the media frame. + self.upload_file_frame = wp.media.frames.customHeader = wp.media({ + // Set the title of the modal. + title: $el.data('choose'), + library: { + type: $el.data('types').split(',') + }, + button: { + text: $el.data('update') + }, + multiple: $el.data('multiple') + }); + + // When an image is selected, run a callback. + self.upload_file_frame.on('select', function () { + var selection = self.upload_file_frame.state().get('selection'); + selection.map(function (attachment) { + attachment = attachment.toJSON(); + if (!multiple) { + $attachmentHolder.find('.wc-gzd-product-single-attachment').remove(); + $el.text(attachment.filename); + } else { + $el.text($el.data('update')); + } + if ($.inArray(parseInt(attachment.id), attachments) === -1) { + attachments.push(attachment.id); + if (attachment.filename) { + $attachmentHolder.append('' + (multiple ? attachment.filename : '') + ' ' + self.params.i18n_remove_attachment + ''); + } + } + }); + }); + self.upload_file_frame.on('open', function () { + var selection = self.upload_file_frame.state().get('selection'); + if (!multiple && attachments.length > 0) { + selection.add(attachments); + self.upload_file_frame.content.mode('browse'); + } else { + selection.remove(); + self.upload_file_frame.content.mode('upload'); + } + }); + + // Finally, open the modal. + self.upload_file_frame.open(); + }, + onRemoveUpload: function () { + var $field = $(this).closest('.wc-gzd-product-single-attachment'), + $wrapper = $(this).parents('.wc-gzd-product-upload-wrapper'), + $button = $wrapper.find('.wc-gzd-product-upload'), + multiple = $button.data('multiple'); + $field.remove(); + var hasAttachments = $wrapper.find('.wc-gzd-product-single-attachment').length > 0; + console.log($button); + console.log(hasAttachments); + if (!hasAttachments) { + $button.text($button.data('default_label')); + } + return false; + }, + onAddNewDeliveryTime: function () { + var $parent = $(this).parents('#shipping_product_data'); + if ($parent.length === 0) { + $parent = $(this).parents('.woocommerce_variable_attributes'); + } + var $select2 = $parent.find('.wc-gzd-add-country-specific-delivery-time-template .wc-gzd-delivery-time-search.enhanced'); + + /** + * Destroy the select2 element from template in case it still exists and has been initialized + */ + if ($select2.length > 0) { + $select2.selectWoo('destroy'); + $select2.removeClass('enhanced'); + } + var $template = $parent.find('.wc-gzd-add-country-specific-delivery-time-template:first').clone(); + $template.removeClass('wc-gzd-add-country-specific-delivery-time-template').addClass('wc-gzd-country-specific-delivery-time-new'); + $parent.find('.wc-gzd-new-country-specific-delivery-time-placeholder').append($template).show(); + $(document.body).trigger('wc-enhanced-select-init'); + return false; + }, + onRemoveDeliveryTime: function () { + var $parent = $(this).parents('.form-row, .form-field'); + + // Trigger change to notify Woo about an update (variations). + $parent.find('select').trigger('change'); + $parent.remove(); + return false; + } + }; + wc_gzd_product.init(); +}); +((window.germanized = window.germanized || {})["static"] = window.germanized["static"] || {})["admin-product"] = __webpack_exports__; +/******/ })() +; \ No newline at end of file diff --git a/build/static/admin-settings-styles.asset.php b/build/static/admin-settings-styles.asset.php new file mode 100644 index 000000000..aac0131df --- /dev/null +++ b/build/static/admin-settings-styles.asset.php @@ -0,0 +1 @@ + array(), 'version' => '0c9e2f3478dadb62e729'); diff --git a/build/static/admin-settings-styles.css b/build/static/admin-settings-styles.css new file mode 100644 index 000000000..6387aeef4 --- /dev/null +++ b/build/static/admin-settings-styles.css @@ -0,0 +1 @@ +.wc-gzd-settings .nav-tab-wrapper a.nav-tab[href*="tab=germanized"]{background:#f1f1f1;border-bottom:1px solid #f1f1f1;box-shadow:none;color:#000;margin-bottom:-1px}.wc-gzd-settings ul.subsubsub:not(.list-table-filters){margin-top:0}.wc-gzd-settings ul.subsubsub:not(.list-table-filters) li a .wc-gzd-pro{margin-left:3px}.wc-gzd-settings ul.subsubsub:not(.list-table-filters) li a.current .wc-gzd-pro{border:1px solid #222;color:#222}.wc-gzd-settings .wc-gzd-dash-button{display:inline-block;height:2em;margin-right:5px;min-height:25px;overflow:hidden;padding:0;position:relative;text-indent:9999px;vertical-align:middle;width:2em}.wc-gzd-settings .wc-gzd-dash-button:after{speak:none;content:"";font-family:Dashicons;font-variant:normal;font-weight:400;height:100%;left:0;line-height:1.85;margin:0;position:absolute;text-align:center;text-indent:0;text-transform:none;top:0;width:100%}.wc-gzd-settings .wc-gzd-dash-button.help-link:after{content:"?";font-family:inherit;font-weight:700}.wc-gzd-settings .wc-gzd-dash-button.install:after{content:""}.wc-gzd-settings .wc-gzd-dash-button.wc-gzd-is-loading:after{content:""}.wc-gzd-settings .wc-gzd-settings-breadcrumb{font-size:1.4em;justify-content:flex-start;margin-bottom:.5em}.wc-gzd-settings .wc-gzd-settings-breadcrumb,.wc-gzd-settings .wc-gzd-settings-breadcrumb li.breadcrumb-item{align-items:center;display:flex;flex-wrap:wrap}.wc-gzd-settings .wc-gzd-settings-breadcrumb li.breadcrumb-item a.page-title-action{margin-left:1em;position:inherit;top:0}.wc-gzd-settings .wc-gzd-settings-breadcrumb li.breadcrumb-item a.breadcrumb-link{align-items:center;color:#444;display:inline-flex;text-decoration:none;white-space:nowrap}.wc-gzd-settings .wc-gzd-settings-breadcrumb li.breadcrumb-item a.breadcrumb-link:hover{color:#000!important}.wc-gzd-settings .wc-gzd-settings-breadcrumb li.breadcrumb-item a.breadcrumb-link:after{content:"";font-family:Dashicons;font-size:.9em;font-weight:400;height:100%;line-height:1;margin:2px 2px 0;text-align:center;text-indent:0;text-transform:none;width:100%}.wc-gzd-settings .wc-gzd-settings-breadcrumb li.breadcrumb-item.breadcrumb-item-active{color:#000;font-weight:600}.wc-gzd-settings .wc-gzd-setting-header{font-size:1.4em}.wc-gzd-settings .wc-gzd-setting-header .page-title-action{top:-1px}.wc-gzd-settings .wc-gzd-ajax-loading-btn{align-items:center;display:inline-flex;justify-content:center;position:relative}.wc-gzd-settings .wc-gzd-ajax-loading-btn.wc-gzd-is-loading .btn-text{opacity:.3;z-index:0}.wc-gzd-settings .wc-gzd-ajax-loading-btn.wc-gzd-is-loading .spinner{background-size:16px 16px;float:none;height:16px;margin:0;position:absolute;text-align:center;vertical-align:middle;width:16px;z-index:5}.wc-gzd-settings .wc-gzd-setting-tabs{margin-top:1.5em}.wc-gzd-settings .wc-gzd-setting-tabs .wc-gzd-setting-tab-enabled .wc-gzd-install-extension-btn{height:26px;line-height:26px;min-height:26px}.wc-gzd-settings .wc-gzd-setting-tabs td,.wc-gzd-settings .wc-gzd-setting-tabs th{display:table-cell!important;font-size:14px;line-height:1.75em;padding:1em!important;vertical-align:top}.wc-gzd-settings .wc-gzd-setting-tabs th{font-weight:600}.wc-gzd-settings .wc-gzd-setting-tabs td.wc-gzd-setting-tab-enabled,.wc-gzd-settings .wc-gzd-setting-tabs th.wc-gzd-setting-tab-enabled{text-align:center;width:1%}.wc-gzd-settings .wc-gzd-setting-tabs td.wc-gzd-setting-tab-enabled .status-disabled,.wc-gzd-settings .wc-gzd-setting-tabs td.wc-gzd-setting-tab-enabled .status-enabled,.wc-gzd-settings .wc-gzd-setting-tabs th.wc-gzd-setting-tab-enabled .status-disabled,.wc-gzd-settings .wc-gzd-setting-tabs th.wc-gzd-setting-tab-enabled .status-enabled{display:inline-block;margin-top:3px}.wc-gzd-settings .wc-gzd-setting-tabs a .wc-gzd-pro{margin-left:3px}.wc-gzd-settings .wc-gzd-setting-tabs td.wc-gzd-setting-tab-actions,.wc-gzd-settings .wc-gzd-setting-tabs th.wc-gzd-setting-tab-actions{text-align:right;width:15%}.wc-gzd-settings .wc-gzd-setting-tabs td.wc-gzd-setting-tab-actions{display:flex;flex-wrap:wrap;justify-content:flex-end}.wc-gzd-settings .wc-gzd-setting-tabs td.wc-gzd-setting-tab-actions .button{margin-right:5px}.wc-gzd-settings .wc-gzd-setting-tabs td.wc-gzd-setting-tab-actions .button:last-child{margin-right:0}.wc-gzd-settings .wc-gzd-setting-tabs td.wc-gzd-setting-tab-name,.wc-gzd-settings .wc-gzd-setting-tabs th.wc-gzd-setting-tab-name{width:25ch}.wc-gzd-settings .wc-gzd-setting-tabs td.wc-gzd-setting-tab-name{font-weight:700;white-space:nowrap}.wc-gzd-settings .wc-gzd-setting-tabs tr:nth-child(odd) td{background:#f9f9f9}.wc-gzd-admin-settings{display:flex;flex-wrap:wrap;justify-content:flex-start}.wc-gzd-admin-settings.wc-gzd-admin-settings-has-sidebar{box-sizing:border-box}.wc-gzd-admin-settings.wc-gzd-admin-settings-has-sidebar .wc-gzd-admin-settings-fields{padding-right:5%;width:65%}.wc-gzd-admin-settings.wc-gzd-admin-settings-has-sidebar .wc-gzd-admin-settings-sidebar{width:30%}.wc-gzd-admin-settings tbody.ui-sortable tr:hover{cursor:move}.wc-gzd-admin-settings .forminp-radio fieldset p{margin-bottom:1em}.wc-gzd-admin-settings th.forminp-image{padding-right:0!important}.wc-gzd-admin-settings.wc-gzd-admin-settings-contract th.forminp-image,.wc-gzd-admin-settings.wc-gzd-admin-settings-germanized-emails-attachments th.forminp-image,.wc-gzd-admin-settings.wc-gzd-admin-settings-invoices th.forminp-image,.wc-gzd-admin-settings.wc-gzd-admin-settings-multistep_checkout th.forminp-image,.wc-gzd-admin-settings.wc-gzd-admin-settings-revocation_generator th.forminp-image,.wc-gzd-admin-settings.wc-gzd-admin-settings-terms_generator th.forminp-image{padding-top:0}.wc-gzd-admin-settings .forminp-image img,.wc-gzd-admin-settings .wc-gzd-premium img{height:auto;max-width:100%;opacity:.7}.wc-gzd-admin-settings #woocommerce_gzdp_terms_generator img{max-width:100%}.wc-gzd-admin-settings .woocommerce table.form-table th.forminp-image{padding-right:0}.wc-gzd-admin-settings tr.single_select_page .description{display:block;margin-top:.5em}.wc-gzd-admin-settings tr.wc-gzd-setting-invisible{display:none}.wc-gzd-admin-settings td .wc-gzd-additional-desc{background:#fff;box-shadow:0 1px 1px 0 rgba(0,0,0,.1);font-size:14px;font-style:normal;line-height:1.5em;margin-top:1em;padding:.5em}.wc-gzd-admin-settings td .wc-gzd-additional-desc .wc-gzd-tax-example{margin-top:.5em}.wc-gzd-admin-settings .wc-gzd-label-wrap{display:block;position:relative;vertical-align:middle}.wc-gzd-admin-settings .wc-gzd-label-wrap .woocommerce-help-tip{margin:-8px -24px 0 0!important;position:absolute;right:0;top:50%}.wc-gzd-admin-settings td.forminp-gzd_toggle p.description,.wc-gzd-admin-settings td.forminp-gzd_toggle span.description{display:inline-block;font-size:14px;font-style:normal;margin-left:5px}.wc-gzd-admin-settings td.forminp-gzd_toggle p.description .wc-gzd-additional-desc,.wc-gzd-admin-settings td.forminp-gzd_toggle span.description .wc-gzd-additional-desc{margin-bottom:-1em}.wc-gzd-admin-settings td.forminp-gzd_toggle fieldset{margin-top:1.25em}.wc-gzd-admin-settings td.forminp-gzd_toggle fieldset:first-child{margin-top:0}.wc-gzd-admin-settings a.woocommerce-gzd-input-toggle-trigger,.wc-gzd-setting-tabs a.woocommerce-gzd-input-toggle-trigger{border:none;color:transparent;text-decoration:none}.wc-gzd-admin-settings a.woocommerce-gzd-input-toggle-trigger:focus,.wc-gzd-setting-tabs a.woocommerce-gzd-input-toggle-trigger:focus{border:none;box-shadow:none;color:transparent}table.wc-gzd-legal-checkboxes thead th{vertical-align:middle}table.wc-gzd-legal-checkboxes thead th.wc-gzd-legal-checkbox-sort{text-align:center}table.wc-gzd-legal-checkboxes td,table.wc-gzd-legal-checkboxes th{background:#fff;display:table-cell!important;font-size:14px;line-height:24px;padding:1em!important;vertical-align:top}table.wc-gzd-legal-checkboxes td ul,table.wc-gzd-legal-checkboxes th ul{margin:0}table.wc-gzd-legal-checkboxes td .status-disabled,table.wc-gzd-legal-checkboxes td .status-enabled,table.wc-gzd-legal-checkboxes th .status-disabled,table.wc-gzd-legal-checkboxes th .status-enabled{margin-top:3px}table.wc-gzd-legal-checkboxes td.wc-gzd-legal-checkbox-locations ul li,table.wc-gzd-legal-checkboxes th.wc-gzd-legal-checkbox-locations ul li{color:#555;display:inline;font-size:14px;line-height:24px;margin:0}table.wc-gzd-legal-checkboxes td.wc-gzd-legal-checkbox-locations ul li:before,table.wc-gzd-legal-checkboxes th.wc-gzd-legal-checkbox-locations ul li:before{content:", "}table.wc-gzd-legal-checkboxes td.wc-gzd-legal-checkbox-locations ul li:first-child:before,table.wc-gzd-legal-checkboxes th.wc-gzd-legal-checkbox-locations ul li:first-child:before{content:""}table.wc-gzd-legal-checkboxes td.wc-gzd-legal-checkbox-sort:before{color:#999;content:"";display:block;float:left;font-family:Dashicons;height:100%;line-height:1;line-height:24px;text-align:center;width:17px}table.wc-gzd-legal-checkboxes tbody.wc-gzd-legal-checkbox-rows td{border-top:2px solid #f9f9f9}table.wc-gzd-legal-checkboxes tbody.wc-gzd-legal-checkbox-rows tr:first-child td{border-top:0}table.wc-gzd-legal-checkboxes tbody.wc-gzd-legal-checkbox-rows tr:nth-child(odd) td{background:#f9f9f9}.wc-gzd-premium-overlay{border-left-color:#639aff!important}.wc-gzd-admin-settings-sidebar{box-sizing:border-box}.wc-gzd-admin-settings-sidebar .wc-gzd-admin-settings-sidebar-inner{background:#fff;box-shadow:0 1px 1px 0 rgba(0,0,0,.1);padding:1em}.wc-gzd-admin-settings-sidebar .wc-gzd-admin-settings-sidebar-inner.sticky{position:sticky;top:50px}.wc-gzd-admin-settings-sidebar h1:first-of-type,.wc-gzd-admin-settings-sidebar h2:first-of-type,.wc-gzd-admin-settings-sidebar h3:first-of-type{margin-top:0}.wc-gzd-admin-settings-sidebar img{width:100%}.wc-gzd-admin-settings-sidebar .browser{border-radius:3px}.wc-gzd-admin-settings-sidebar .small{color:#888;display:block;font-size:.9em;margin-top:.5em}body.woocommerce-feature-enabled-store-alerts .wc-gzd-admin-settings-sidebar .wc-gzd-admin-settings-sidebar-inner.sticky{top:120px}.wc-gzd-admin-settings-checkboxes td.forminp-textarea p code{display:block;margin:.5em 0}.wc-gzd-admin-settings-checkboxes td.forminp-textarea p{margin-bottom:1em}.wc-gzd-admin-settings-checkboxes td.forminp-textarea .gzd-small-desc{display:block;font-size:12px;font-style:italic}.wc-gzd-admin-settings-checkboxes td.forminp-text .description{display:block;line-height:1.5em;margin-top:.5em} \ No newline at end of file diff --git a/build/static/admin-settings-styles.js b/build/static/admin-settings-styles.js new file mode 100644 index 000000000..a7d6798e4 --- /dev/null +++ b/build/static/admin-settings-styles.js @@ -0,0 +1,25 @@ +/******/ (function() { // webpackBootstrap +/******/ "use strict"; +/******/ // The require scope +/******/ var __webpack_require__ = {}; +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/make namespace object */ +/******/ !function() { +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ }(); +/******/ +/************************************************************************/ +var __webpack_exports__ = {}; +__webpack_require__.r(__webpack_exports__); +// extracted by mini-css-extract-plugin + +((window.germanized = window.germanized || {})["static"] = window.germanized["static"] || {})["admin-settings-styles"] = __webpack_exports__; +/******/ })() +; \ No newline at end of file diff --git a/build/static/admin-settings.asset.php b/build/static/admin-settings.asset.php new file mode 100644 index 000000000..21b48b396 --- /dev/null +++ b/build/static/admin-settings.asset.php @@ -0,0 +1 @@ + array(), 'version' => '689cc5bca3d333840b23'); diff --git a/build/static/admin-settings.js b/build/static/admin-settings.js new file mode 100644 index 000000000..78973e346 --- /dev/null +++ b/build/static/admin-settings.js @@ -0,0 +1,332 @@ +/******/ (function() { // webpackBootstrap +var __webpack_exports__ = {}; +/*global woocommerce_admin_meta_boxes, woocommerce_admin, accounting, woocommerce_admin_meta_boxes_order */ +window.germanized = window.germanized || {}; +(function ($, germanized) { + /** + * Order Data Panel + */ + germanized.settings = { + params: {}, + init: function () { + var self = this; + this.params = wc_gzd_admin_settings_params; + try { + $(document.body).on('wc-enhanced-select-init wc-gzd-enhanced-select-init', this.onEnhancedSelectInit).trigger('wc-gzd-enhanced-select-init'); + } catch (err) { + // If select2 failed (conflict?) log the error but don't stop other scripts breaking. + window.console.log(err); + } + $(document).on('change', 'input[name=woocommerce_gzd_dispute_resolution_type]', this.onChangeDisputeResolutionType).on('change', '.wc-gzd-setting-tabs input.woocommerce-gzd-tab-status-checkbox', this.onChangeTabStatus).on('change', '.wc-gzd-setting-tab-enabled :input', this.preventWarning).on('click', 'a.wc-gzd-install-extension-btn', this.onInstallExtension).on('change gzd_show_or_hide_fields', '.wc-gzd-admin-settings :input', this.onChangeInput); + $('.wc-gzd-admin-settings :input').trigger('gzd_show_or_hide_fields'); + $('input[name=woocommerce_gzd_dispute_resolution_type]:checked').trigger('change'); + this.initMailSortable(); + $(document.body).on('init_tooltips', function () { + self.initTipTips(); + }); + self.initTipTip(); + }, + /** + * Prevents the unsaved settings warning for the main germanized tab + * as these toggles use AJAX requests to save the settings. + */ + preventWarning: function () { + window.onbeforeunload = ''; + }, + initTipTip: function () { + $('.wc-gzd-setting-tab-actions a.button').tipTip({ + 'fadeIn': 50, + 'fadeOut': 50, + 'delay': 200 + }); + }, + onInstallExtension: function () { + var self = germanized.settings, + $this = $(this); + var data = { + action: 'woocommerce_gzd_install_extension', + security: self.params.install_extension_nonce, + extension: $this.data('extension') + }; + $this.addClass('wc-gzd-is-loading'); + $this.append(''); + $.ajax({ + url: self.params.ajax_url, + data: data, + dataType: 'json', + type: 'POST', + success: function (response) { + $this.find('.spinner').remove(); + $this.removeClass('wc-gzd-is-loading'); + if (response.success) { + if ($this.is("[href]") && '#' !== $this.attr('href')) { + window.location.href = $this.attr('href'); + } + } else if (response.hasOwnProperty('message')) { + var $wrapper = $('#wpbody-content').find('.wrap'); + if ($('.wc-gzd-setting-tabs').length > 0) { + $wrapper = $('.wc-gzd-setting-tabs'); + } + $wrapper.before('

' + response.message + '

'); + $('html, body').animate({ + scrollTop: $('#message').offset().top - 32 + }, 1000); + } + } + }); + return false; + }, + onChangeTabStatus: function () { + var $checkbox = $(this), + self = germanized.settings, + tab_id = $checkbox.data('tab'), + $toggle = $checkbox.parents('td').find('.woocommerce-gzd-input-toggle'), + $link = $toggle.parents('a'), + isEnabled = $checkbox.is(':checked') ? 'yes' : 'no'; + var data = { + action: 'woocommerce_gzd_toggle_tab_enabled', + security: self.params.tab_toggle_nonce, + enable: isEnabled, + tab: tab_id + }; + $toggle.addClass('woocommerce-input-toggle--loading'); + $.ajax({ + url: self.params.ajax_url, + data: data, + dataType: 'json', + type: 'POST', + success: function (response) { + if (true === response.data) { + $toggle.removeClass('woocommerce-input-toggle--enabled, woocommerce-input-toggle--disabled'); + $toggle.addClass('woocommerce-input-toggle--enabled'); + $toggle.removeClass('woocommerce-input-toggle--loading'); + if (response.hasOwnProperty('message') && response.message.length > 0) { + $('.wc-gzd-setting-tabs').before('

' + response.message + '

'); + $('html, body').animate({ + scrollTop: $('#message').offset().top - 32 + }, 1000); + } + } else if (false === response.data) { + $toggle.removeClass('woocommerce-input-toggle--enabled, woocommerce-input-toggle--disabled'); + $toggle.addClass('woocommerce-input-toggle--disabled'); + $toggle.removeClass('woocommerce-input-toggle--loading'); + } else if ('needs_setup' === response.data) { + window.location.href = $link.attr('href'); + } + } + }); + return false; + }, + onChangeInput: function () { + var self = germanized.settings, + $mainInput = $(this), + mainId = $mainInput.attr('id') ? $mainInput.attr('id') : $mainInput.attr('name'), + $dependentFields = $('.wc-gzd-admin-settings :input[data-show_if_' + $.escapeSelector(mainId) + ']'); + var $input, $field, data, meetsConditions, cleanName, $dependentField, valueExpected, val, isChecked; + $.each($dependentFields, function () { + $input = $(this); + $field = $input.parents('tr'); + data = $input.data(); + meetsConditions = true; + for (var dataName in data) { + if (data.hasOwnProperty(dataName)) { + /** + * Check all the conditions for a dependent field. + */ + if (dataName.substring(0, 8) === 'show_if_') { + cleanName = dataName.replace('show_if_', ''); + $dependentField = self.getInputByIdOrName(cleanName); + valueExpected = $input.data(dataName) ? $input.data(dataName).split(',') : []; + if ($dependentField.length > 0) { + val = $dependentField.val(); + isChecked = false; + if ($dependentField.is(':radio')) { + val = $dependentField.parents('fieldset').find(':checked').length > 0 ? $dependentField.parents('fieldset').find(':checked').val() : 'no'; + if ('no' !== val) { + isChecked = true; + } + } else if ($dependentField.is(':checkbox')) { + val = $dependentField.is(':checked') ? 'yes' : 'no'; + if ('yes' === val) { + isChecked = true; + } + } else { + isChecked = undefined !== val && '0' !== val && '' !== val; + } + if (valueExpected && valueExpected.length > 0) { + if ($.inArray(val, valueExpected) === -1) { + meetsConditions = false; + } + } else if (!isChecked) { + meetsConditions = false; + } + } + if (!meetsConditions) { + break; + } + } + } + } + $field.removeClass('wc-gzd-setting-visible wc-gzd-setting-invisible'); + if (meetsConditions) { + $field.addClass('wc-gzd-setting-visible'); + } else { + $field.addClass('wc-gzd-setting-invisible'); + } + }); + }, + /** + * Finds the input field by ID or name (some inputs, e.g. radio buttons may not have an id). + * + * @param cleanName + * @returns {*|jQuery} + */ + getInputByIdOrName: function (cleanName) { + var self = germanized.settings; + cleanName = self.getCleanDataId(cleanName); + var $field = $('.wc-gzd-admin-settings :input').filter(function () { + var id = $(this).attr('id') ? $(this).attr('id') : $(this).attr('name'); + if (!id) { + return false; + } + return self.getCleanDataId(id) === cleanName; + }); + return $field; + }, + /** + * Make sure to remove any hyphens as data-attributes are stored + * camel case without hyphens in the DOM. + */ + getCleanDataId: function (id) { + return id.toLowerCase().replace(/-/g, ''); + }, + onEnhancedSelectInit: function () { + var self = germanized.settings; + + // Tag select + $(':input.wc-gzd-enhanced-tags').filter(':not(.enhanced)').each(function () { + var select2_args = { + minimumResultsForSearch: 10, + allowClear: $(this).data('allow_clear') ? true : false, + placeholder: $(this).data('placeholder'), + tags: true + }; + $(this).selectWoo(select2_args).addClass('enhanced'); + }); + function display_result(self, select2_args) { + $(self).selectWoo(select2_args).addClass('enhanced'); + if ($(self).prop('multiple')) { + $(self).on('change', function () { + var $children = $(self).children(); + $children.sort(function (a, b) { + var atext = a.text.toLowerCase(); + var btext = b.text.toLowerCase(); + if (atext > btext) { + return 1; + } + if (atext < btext) { + return -1; + } + return 0; + }); + $(self).html($children); + }); + } + } + $(':input.gzd-select-term').filter(':not(.enhanced)').each(function () { + var select2_args = { + allowClear: $(this).data('allow_clear') ? true : false, + placeholder: $(this).data('placeholder'), + minimumInputLength: $(this).data('minimum_input_length') ? $(this).data('minimum_input_length') : '3', + escapeMarkup: function (m) { + return m; + }, + ajax: { + url: self.params.ajax_url, + dataType: 'json', + delay: 250, + data: function (params) { + return { + term: params.term, + action: $(this).data('action') || 'woocommerce_json_search_taxonomy_terms', + security: self.params.search_term_nonce, + exclude: $(this).data('exclude'), + taxonomy: $(this).data('taxonomy'), + limit: $(this).data('limit') + }; + }, + processResults: function (data) { + var terms = []; + if (data && !data.error) { + $.each(data, function (index, term) { + terms.push({ + id: term.term_id, + text: term.name + }); + }); + } + return { + results: terms + }; + }, + cache: true + } + }; + display_result(this, select2_args); + + //$( this ).selectWoo( select2_args ).addClass( 'enhanced' ); + }); + }, + + onParcelDeliveryShowSpecial: function () { + var val = $(this).val(); + if ('shipping_methods' === val) { + $('select#woocommerce_gzd_checkboxes_parcel_delivery_show_shipping_methods').parents('tr').show(); + } else { + $('select#woocommerce_gzd_checkboxes_parcel_delivery_show_shipping_methods').parents('tr').hide(); + } + }, + onChangeDisputeResolutionType: function () { + var val = $(this).val(); + var text = $('#woocommerce_gzd_alternative_complaints_text_' + val); + $('[id^=woocommerce_gzd_alternative_complaints_text_]').parents('tr').hide(); + $('#woocommerce_gzd_alternative_complaints_text_' + val).parents('tr').show(); + }, + initMailSortable: function () { + if ($('#woocommerce_gzd_mail_attach_imprint').length > 0) { + var table = $('#woocommerce_gzd_mail_attach_imprint').parents('table'); + $(table).find('tbody').sortable({ + items: 'tr', + cursor: 'move', + axis: 'y', + handle: 'td, th', + scrollSensitivity: 40, + helper: function (e, ui) { + ui.children().each(function () { + jQuery(this).width(jQuery(this).width()); + }); + ui.css('left', '0'); + return ui; + }, + start: function (event, ui) { + ui.item.css('background-color', '#f6f6f6'); + }, + stop: function (event, ui) { + ui.item.removeAttr('style'); + var pages = []; + $(table).find('tr select').each(function () { + pages.push($(this).attr('id').replace('woocommerce_gzd_mail_attach_', '')); + }); + $('#woocommerce_gzd_mail_attach_order').val(pages.join()); + } + }); + } + } + }; + $(document).ready(function () { + germanized.settings.init(); + }); +})(jQuery, window.germanized); +((window.germanized = window.germanized || {})["static"] = window.germanized["static"] || {})["admin-settings"] = __webpack_exports__; +/******/ })() +; \ No newline at end of file diff --git a/build/static/admin-setup.asset.php b/build/static/admin-setup.asset.php new file mode 100644 index 000000000..b2ae842c4 --- /dev/null +++ b/build/static/admin-setup.asset.php @@ -0,0 +1 @@ + array(), 'version' => '129b44f68c17be51c69b'); diff --git a/build/static/admin-setup.js b/build/static/admin-setup.js new file mode 100644 index 000000000..1c18e2c02 --- /dev/null +++ b/build/static/admin-setup.js @@ -0,0 +1,26 @@ +/******/ (function() { // webpackBootstrap +var __webpack_exports__ = {}; +/*global woocommerce_admin_meta_boxes, woocommerce_admin, accounting, woocommerce_admin_meta_boxes_order */ +window.germanized = window.germanized || {}; +(function ($, germanized) { + /** + * Order Data Panel + */ + germanized.setup = { + params: {}, + init: function () { + $('.woocommerce-help-tip').tipTip({ + 'attribute': 'data-tip', + 'fadeIn': 50, + 'fadeOut': 50, + 'delay': 200 + }); + } + }; + $(document).ready(function () { + germanized.setup.init(); + }); +})(jQuery, window.germanized); +((window.germanized = window.germanized || {})["static"] = window.germanized["static"] || {})["admin-setup"] = __webpack_exports__; +/******/ })() +; \ No newline at end of file diff --git a/build/static/admin-styles.asset.php b/build/static/admin-styles.asset.php new file mode 100644 index 000000000..4de518f43 --- /dev/null +++ b/build/static/admin-styles.asset.php @@ -0,0 +1 @@ + array(), 'version' => '5c779ad11e3f588b9c63'); diff --git a/build/static/admin-styles.css b/build/static/admin-styles.css new file mode 100644 index 000000000..7fd9d5628 --- /dev/null +++ b/build/static/admin-styles.css @@ -0,0 +1 @@ +table.data_table tr td p.form-field{margin:0!important;padding:0!important}a.woocommerce-gzd-input-toggle-trigger{border:none;color:transparent;text-decoration:none}a.woocommerce-gzd-input-toggle-trigger:focus{border:none;box-shadow:none;color:transparent}span.woocommerce-gzd-input-toggle{background-color:var(--wp-admin-theme-color,#007cba);border:2px solid var(--wp-admin-theme-color,#007cba);border-radius:10em;display:inline-block;height:16px;margin-top:-1px;position:relative;text-indent:-9999px;vertical-align:text-top;width:32px}span.woocommerce-gzd-input-toggle:before{background:#fff;border-radius:100%;content:"";display:block;height:16px;position:absolute;right:0;top:0;width:16px}span.woocommerce-gzd-input-toggle.woocommerce-input-toggle--disabled{background-color:#999;border-color:#999}span.woocommerce-gzd-input-toggle.woocommerce-input-toggle--disabled:before{left:0;right:auto}.woocommerce-gzd-message{overflow:hidden;position:relative}.woocommerce-gzd-message ul{list-style-type:disc;padding-left:1.5em}.woocommerce-gzd-message .notice-dismiss{float:right;font-size:13px;line-height:1.2em;margin-top:-10px;padding:0 15px 10px 28px;position:static;text-decoration:none}.woocommerce-gzd-message .notice-dismiss:before{left:-20px;position:relative;top:18px;transition:all .1s ease-in-out}.woocommerce-gzd-message p.submit .button{margin-right:1em}.variable_cart_mini_desc .wp-editor-tools{margin-top:-3em}.variable_cart_mini_desc_pre .wp-editor-tools{margin-top:-2em}.wc-gzd-resend-activation-link{margin-top:1em!important}#variable_product_options .notice.wc-gzd-unit-price-disabled-notice{border-left-color:#dba617!important;border-left-width:4px!important;border-top:none!important;box-sizing:border-box;display:none;margin:1em 0!important;padding:5px 12px}._billing_address_1_field,._billing_title_field,._shipping_address_1_field,._shipping_title_field{width:100%!important}.wc-gzd-button{background-color:#639aff!important;background-image:linear-gradient(120deg,#639aff,#9a4dff)!important;border:1px solid transparent!important;box-shadow:inset 0 0 30px hsla(0,0%,100%,0),0 19px 25px -17px rgba(3,39,64,.4)!important;color:#fff!important;text-shadow:none!important;transition:transform .3s,box-shadow .3s ease-in-out,color .3s ease-in-out}.wc-gzd-button:hover{cursor:pointer;transform:scale(1.02)}.wc-gzd-button .wc-gzd-pro{background:#fff;color:#000;margin:0 2px}.wc-gzd-button .wc-gzd-pro:hover{color:#000}.wc-gzd-button .wc-gzd-pro-outlined{background:transparent;border-color:#fff;color:#fff;margin:0 2px}.wc-gzd-button .wc-gzd-pro-outlined:hover{color:#fff}.wc-gzd-button-wrapper .button{margin-right:1em}.product_data .form-field-wc-gzd-wp-editor{display:flex;flex-wrap:wrap;padding-bottom:1em}.product_data .form-field-wc-gzd-wp-editor label{float:none;margin:0;padding:12px 0 12px 12px;width:150px}.product_data .form-field-wc-gzd-wp-editor .wc-gzd-product-editor-wrap{flex-grow:1;padding-right:20px}.product_tab_gzd_pro a:after,.product_type_gzd_pro:after,.wc-gzd-pro{background:#222;border-radius:3px;color:#fff;font-size:9px;font-style:normal;line-height:9px;opacity:1!important;padding:1px 3px;position:relative;text-align:center;text-decoration:none;text-transform:uppercase;top:-1px}a.wc-gzd-pro:not(.wc-gzd-pro-outlined):hover{background:#4a4a4a;color:#fff}.product_tab_gzd_pro a:after,.product_type_gzd_pro:after,.wc-gzd-pro-outlined{background:transparent;border:1px solid #222;color:#222;margin-left:5px;margin-top:3px}.product_tab_gzd_pro a:after:hover,.product_type_gzd_pro:after:hover,.wc-gzd-pro-outlined:hover{color:#222}.product_type_gzd_pro:after{content:"pro";font-weight:400}.product_tab_gzd_pro a:after{border-color:#2271b1;color:#2271b1;content:"pro";margin-left:0}.product_tab_gzd_pro a:hover:after{border-color:#135e96;color:#135e96}.product_tab_gzd_pro.active a:after{border-color:#555;color:#555}.wc-gzd-premium-overlay{border-left-color:#639aff!important}a .wc-gzd-pro-outlined{border:1px solid #0073aa;color:#0073aa;text-decoration:none}a .wc-gzd-pro-outlined:hover{color:#135e96}a.wc-gzd-pro-outlined{border:1px solid #0073aa;color:#0073aa!important;font-weight:700;margin:0 2px;text-decoration:none}a.wc-gzd-pro-outlined:hover{color:#135e96!important}a.page-title-action .wc-gzd-pro{background:#0073aa}a.page-title-action.invalid{border-color:#d63638;color:#d63638}a.page-title-action.invalid:hover{border-color:#b30e10;color:#b30e10}a.page-title-action:hover .wc-gzd-pro:not(.wc-gzd-pro-outlined){background:#0a4b78}.wc-gzd-premium-section-tab{background:#e4e4e4;border:1px solid #ccc;color:#555;padding:0 3px}.tourbus-leg-inner .wc-gzd-pro{top:-3px}p._variable_unit_price_auto_field input.checkbox{float:none!important;margin-right:5px!important}p._unit_price_auto_field label{display:block!important;margin-bottom:5px}p._unit_price_auto_field .wc-gzd-premium-desc{margin-right:5px}._unit_price_auto_field .wc-gzd-premium-desc,._unit_price_auto_field input,._unit_price_auto_field label{opacity:.6}table.wc-gzd-tax-example tr td,table.wc-gzd-tax-example tr th{font-size:.9em;padding:5px}table.wc-gzd-tax-example tr td:first-child,table.wc-gzd-tax-example tr th:first-child{padding-left:0}#gzd-admin-sepa{clear:both;display:block;padding-top:1em;width:100%}.wc-action-button-xml:after{content:""}#order_data .order_data_column a.download_sepa_xml{border:0;color:#999;float:right;height:0;margin:0 0 0 6px;overflow:hidden;padding:14px 0 0;position:relative;width:14px}#order_data .order_data_column a.download_sepa_xml:after{-webkit-font-smoothing:antialiased;content:"";font-family:Dashicons;font-size:14px;font-weight:400;left:0;line-height:14px;position:absolute;text-align:center;top:0;vertical-align:top}#order_data .order_data_column ._direct_debit_bic_field,#order_data .order_data_column ._direct_debit_holder_field,#order_data .order_data_column ._direct_debit_iban_field,#order_data .order_data_column ._direct_debit_mandate_id_field{clear:left;width:100%!important}#order_data .order_data_column ._direct_debit_bic_field input,#order_data .order_data_column ._direct_debit_holder_field input,#order_data .order_data_column ._direct_debit_iban_field input,#order_data .order_data_column ._direct_debit_mandate_id_field input{width:100%}#order_data ._shipping_parcelshop_post_number_field{clear:left;width:100%!important}.wc-gzd-text-red{color:red}.wc-gzd-status-text{font-weight:600}.wc-gzd-text-green{color:green}.order_actions .xml{display:block;height:2em!important;padding:0!important;position:relative;text-indent:-9999px;width:2em}.order_actions .xml:after{speak:none;-webkit-font-smoothing:antialiased;content:"";font-family:WooCommerce;font-variant:normal;font-weight:400;height:100%;left:0;line-height:1.85;margin:0;position:absolute;text-align:center;text-indent:0;text-transform:none;top:0;width:100%}.parcel-delivery-checkbox-status{clear:both;float:left;width:100%}.woocommerce_variation .variable-nutri-score .select2-container .select2-selection--single,.woocommerce_variation .variable_delivery_time .select2-container .select2-selection--single{height:40px}.woocommerce_variation .variable-nutri-score .select2-container .select2-selection--single .select2-selection__clear,.woocommerce_variation .variable_delivery_time .select2-container .select2-selection--single .select2-selection__clear{margin-right:10px}.woocommerce_variation .variable-nutri-score .select2-container .select2-selection--single .select2-selection__rendered,.woocommerce_variation .variable_delivery_time .select2-container .select2-selection--single .select2-selection__rendered{line-height:40px}.woocommerce_variation .variable-nutri-score .select2-container .select2-selection--single .select2-selection__arrow,.woocommerce_variation .variable_delivery_time .select2-container .select2-selection--single .select2-selection__arrow{height:36px;right:3px}.wc-gzd-dashicon{overflow:hidden;text-indent:-9999px}.wc-gzd-dashicon:before{display:block;text-indent:0}.wc-gzd-add-country-specific-delivery-time-template{display:none}#shipping_product_data .wc-gzd-add-country-specific-delivery-time{margin-bottom:-9px;margin-top:-9px}.woocommerce_variable_attributes .wc-gzd-add-country-specific-delivery-time{margin-bottom:0}.wc-metaboxes-wrapper .wc-metabox.woocommerce_variation .wc-gzd-inner-product-pro-tab-wrapper{margin:1em 0}.wc-metaboxes-wrapper .wc-metabox.woocommerce_variation .wc-gzd-inner-product-pro-tab-wrapper .wc-gzd-premium-overlay.notice{margin:0!important}.wc-metaboxes-wrapper .wc-metabox.woocommerce_variation .wc-gzd-inner-product-pro-tab-wrapper .wc-gzd-premium-overlay.notice p{font-size:13px;padding:2px}.wc-metaboxes-wrapper .wc-metabox.woocommerce_variation .wc-gzd-inner-product-pro-tab-wrapper .wc-gzd-premium-overlay.notice h3{padding-left:0!important}.wc-metaboxes-wrapper .wc-metabox.woocommerce_variation p.wc-gzd-product-settings-subtitle{background:#eee;clear:both;float:left;font-size:1em;font-weight:700;margin-left:-2em;padding:10px 2em;width:100%}.wc-metaboxes-wrapper .wc-metabox.woocommerce_variation p.wc-gzd-product-settings-subtitle .page-title-action{top:-1px}.wc-metaboxes-wrapper .wc-metabox.woocommerce_variation p.wc-gzd-product-settings-subtitle .wc-gzd-product-settings-action{float:right;font-weight:400;margin-left:1em;text-decoration:underline}.woocommerce_options_panel .wc-gzd-inner-product-pro-tab-wrapper{padding:20px}.woocommerce_options_panel .wc-gzd-inner-product-pro-tab-wrapper .wc-gzd-premium-overlay p{font-size:13px;padding:2px}.woocommerce_options_panel p.wc-gzd-product-settings-subtitle{background:#eee;font-size:1em;font-weight:700;margin-top:-1px;padding:10px 20px 10px 10px}.woocommerce_options_panel p.wc-gzd-product-settings-subtitle .page-title-action{top:-1px}.woocommerce_options_panel p.wc-gzd-product-settings-subtitle .wc-gzd-product-settings-action{float:right;font-weight:400;margin-left:1em;text-decoration:underline}.woocommerce_options_panel#food_product_data p.form-field span.description{clear:none;display:inline;margin-left:5px}.woocommerce_options_panel .nutrient_vitamins_field{width:50%}.woocommerce_options_panel .nutrient_vitamins_field .wrap input{width:30.75%}.woocommerce_options_panel .nutrient_vitamins_field .wrap .unit{float:left;margin-left:1%;margin-right:2.8%}.variable_warranty_attachment label{display:block;margin-bottom:2px;width:100%}.wc-gzd-product-upload-wrapper{display:flex;flex-wrap:wrap}.wc-gzd-product-upload-wrapper.wc-gzd-product-upload-wrapper-single{flex-direction:row-reverse;justify-content:flex-end}.wc-gzd-product-upload-wrapper.wc-gzd-product-upload-wrapper-single .wc-gzd-product-upload-remove{margin-left:.25em}.wc-gzd-product-upload-wrapper .wc-gzd-product-single-attachment{display:block}.wc-gzd-product-upload-wrapper .wc-gzd-product-upload-remove{color:#b32d2e;margin-right:1em;overflow:hidden;text-decoration:none;text-indent:0;vertical-align:middle}.wc-gzd-product-upload-wrapper .wc-gzd-product-upload-remove:before{content:""}.wc-gzd-product-upload-wrapper .wc-gzd-product-upload{align-self:flex-start;display:inline-flex}.wc-gzd-allergenic-field .select2-container .select2-selection--multiple{line-height:inherit}.wc-gzd-allergenic-field .select2-container--default .select2-selection--multiple li.select2-search--inline{line-height:1;margin-top:0}.wc-gzd-allergenic-field .select2-container--default .select2-selection--multiple li.select2-search--inline input.select2-search__field{min-height:25px}.wc-gzd-country-specific-delivery-time-field .wc-gzd-remove-country-specific-delivery-time{color:#b32d2e;overflow:hidden;text-decoration:none;text-indent:0;vertical-align:middle}.wc-gzd-country-specific-delivery-time-field.wc-gzd-country-specific-delivery-time-field-variation{align-items:center;display:flex;flex-wrap:wrap}.wc-gzd-country-specific-delivery-time-field.wc-gzd-country-specific-delivery-time-field-variation label{width:100%}.wc-gzd-country-specific-delivery-time-field.wc-gzd-country-specific-delivery-time-field-variation .select2-container{max-width:95%!important;width:95%!important}.wc-gzd-country-specific-delivery-time-field.wc-gzd-country-specific-delivery-time-field-variation .wc-gzd-remove-country-specific-delivery-time{margin-left:.5em}.wc-gzd-country-specific-delivery-time-field.wc-gzd-add-country-specific-delivery-time-field-variation{align-items:center;display:flex;width:100%}.wc-gzd-country-specific-delivery-time-field.wc-gzd-add-country-specific-delivery-time-field-variation label{flex-basis:30%;flex-grow:0;flex-shrink:0;margin-right:2%;width:auto}.wc-gzd-country-specific-delivery-time-field.wc-gzd-add-country-specific-delivery-time-field-variation .select2-container{max-width:63%!important;width:63%!important}.nutri-score-select-value.nutri-score-select-value-a{color:#038141}.nutri-score-select-value.nutri-score-select-value-b{color:#85bb2f}.nutri-score-select-value.nutri-score-select-value-c{color:#fecb02}.nutri-score-select-value.nutri-score-select-value-d{color:#ee8100}.nutri-score-select-value.nutri-score-select-value-e{color:#e63e11}.wrap .plugins p.wc-gzd-update-warning{border-top:1px solid #ffb900;margin:0 -12px;padding:.5em 0 .5em 12px}.wrap .plugins p.wc-gzd-update-warning:before{display:none}.wc-gzd-checkbox-log-list{max-width:400px}.wc-gzd-checkbox-log-list .wc-gzd-log-checkbox{display:flex;flex-wrap:wrap;justify-content:space-between;margin:1em 0}.wc-gzd-checkbox-log-list .wc-gzd-log-checkbox p.checkbox-status,.wc-gzd-checkbox-log-list .wc-gzd-log-checkbox p.checkbox-title{margin:0}.wc-gzd-checkbox-log-list .wc-gzd-log-checkbox:last-child{margin-bottom:0} \ No newline at end of file diff --git a/build/static/admin-styles.js b/build/static/admin-styles.js new file mode 100644 index 000000000..775529248 --- /dev/null +++ b/build/static/admin-styles.js @@ -0,0 +1,25 @@ +/******/ (function() { // webpackBootstrap +/******/ "use strict"; +/******/ // The require scope +/******/ var __webpack_require__ = {}; +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/make namespace object */ +/******/ !function() { +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ }(); +/******/ +/************************************************************************/ +var __webpack_exports__ = {}; +__webpack_require__.r(__webpack_exports__); +// extracted by mini-css-extract-plugin + +((window.germanized = window.germanized || {})["static"] = window.germanized["static"] || {})["admin-styles"] = __webpack_exports__; +/******/ })() +; \ No newline at end of file diff --git a/build/static/admin-wizard-styles.asset.php b/build/static/admin-wizard-styles.asset.php new file mode 100644 index 000000000..facb7db8a --- /dev/null +++ b/build/static/admin-wizard-styles.asset.php @@ -0,0 +1 @@ + array(), 'version' => '01241283ba589895ea47'); diff --git a/build/static/admin-wizard-styles.css b/build/static/admin-wizard-styles.css new file mode 100644 index 000000000..b99a0aa90 --- /dev/null +++ b/build/static/admin-wizard-styles.css @@ -0,0 +1 @@ +.step{display:flex;flex-wrap:nowrap;list-style:none;margin:.2rem 0;width:100%}.step .step-item{flex:1 1 0;margin-top:0;min-height:1rem;position:relative;text-align:center}.step .step-item:not(:first-child):before{background:#8865ff;content:"";height:2px;left:-50%;position:absolute;top:9px;width:100%}.step .step-item a{color:#8865ff;display:inline-block;padding:20px 10px 0;text-decoration:none}.step .step-item a:before{background:#8865ff;border:.1rem solid #f1f1f1;border-radius:50%;content:"";display:block;height:.6rem;left:50%;position:absolute;top:.2rem;transform:translateX(-50%);width:.6rem;z-index:1}.step .step-item.active a:before{background:#f1f1f1;border:.1rem solid #8865ff}.step .step-item.active~.step-item:before{background:#b5b5b5}.step .step-item.active~.step-item a{color:#b5b5b5}.step .step-item.active~.step-item a:before{background:#b5b5b5}body{background:#f1f1f1;border:none;box-shadow:none;margin:30px auto 24px;padding:0}.wc-gzd-setup .wc-gzd-setup-header{margin-top:5em;width:100%}.wc-gzd-setup .wc-gzd-setup-header .logo-wrapper{align-items:center;display:flex;justify-content:center;margin-bottom:1.5em}.wc-gzd-setup .wc-gzd-setup-header .logo-wrapper .logo{background:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI1MTIiIGhlaWdodD0iNTEyIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA1MTIgNTEyIj48Y2lyY2xlIGN4PSIyNTYiIGN5PSIyNTYiIHI9IjI1NiIgY2xhc3M9InN0MCIgc3R5bGU9ImZpbGw6IzlhNGRmZiIvPjxwYXRoIGQ9Ik0yNTEgMjQ1Ljg5VjI5N2g3Mi41NGMtOS4yNCAyMy0zNS43NSAzNy42LTY2LjY2IDM3LjYtNDQuNTIgMC03My43Mi0zMS44NS03My43Mi03OC4zNCAwLTQ2Ljk4IDI5LjY4LTc4Ljg5IDczLjcyLTc4Ljg5IDI5Ljk4IDAgNTYuMjkgMTUuNjMgNjYuOTMgNDAuNjNoODQuODhjLTUuMi0yOC0xOS4yNi01My41OC0zOS40OS03My4wNS0yOC4xNC0yNy4xMS02OC4yMi00My40LTExMy4wNS00My40LTQ1LjA5IDAtODMuOTEgMTYuMTgtMTExLjU0IDQzLjQ0LTI3Ljg4IDI3LjUtNDQuMzYgNjYuMzMtNDQuMzYgMTExLjI1IDAgODkuNDUgNjYuNTQgMTU0LjE5IDE1Ni42MiAxNTQuMTkgOTIuMDcgMCAxNTUuMTItNjguMzUgMTU1LjEyLTE2NC41NWwtMTYwLjk5LjAxeiIgY2xhc3M9InN0MSIgc3R5bGU9ImZpbGw6I2ZmZiIvPjxjbGlwUGF0aCBpZD0iYSI+PHBhdGggZD0iTTI1MSAyNDUuODlWMjk3aDcyLjU0Yy05LjI0IDIzLTM1Ljc1IDM3LjYtNjYuNjYgMzcuNi00NC41MiAwLTczLjcyLTMxLjg1LTczLjcyLTc4LjM0IDAtNDYuOTggMjkuNjgtNzguODkgNzMuNzItNzguODkgMjkuOTggMCA1Ni4yOSAxNS42MyA2Ni45MyA0MC42M2g4NC44OGMtNS4yLTI4LTE5LjI2LTUzLjU4LTM5LjQ5LTczLjA1LTI4LjE0LTI3LjExLTY4LjIyLTQzLjQtMTEzLjA1LTQzLjQtNDUuMDkgMC04My45MSAxNi4xOC0xMTEuNTQgNDMuNDQtMjcuODggMjcuNS00NC4zNiA2Ni4zMy00NC4zNiAxMTEuMjUgMCA4OS40NSA2Ni41NCAxNTQuMTkgMTU2LjYyIDE1NC4xOSA5Mi4wNyAwIDE1NS4xMi02OC4zNSAxNTUuMTItMTY0LjU1bC0xNjAuOTkuMDF6Ii8+PC9jbGlwUGF0aD48ZyBjbGFzcz0ic3QyIiBjbGlwLXBhdGg9InVybCgjYSkiPjxwYXRoIGQ9Ik04Ni42NyA5OC42M2gzMzcuMjJ2NDEuNzlIODYuNjd6IiBjbGFzcz0ic3QzIiBzdHlsZT0iZmlsbDojMjIyNzJjIi8+PHBhdGggZD0iTTg2LjY3IDE0MC4wNmgzMzcuMjJ2MzguODhIODYuNjd6IiBjbGFzcz0ic3Q0IiBzdHlsZT0iZmlsbDojZmUwMDAwIi8+PHBhdGggZD0iTTg2LjY3IDE3OC42NWgzMzcuMjJ2MzkuNUg4Ni42N3oiIGNsYXNzPSJzdDUiIHN0eWxlPSJmaWxsOiNmYzAiLz48L2c+PC9zdmc+) no-repeat;background-size:contain;display:inline-block;height:7em;text-indent:-9999px;vertical-align:top;width:7em}.step .step-item a:active,.step .step-item a:focus,.step .step-item a:visited{box-shadow:none}.wc-gzd-setup-content{zoom:1;background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.13);margin-top:1.5em;overflow:hidden;padding:24px}.wc-gzd-setup-content a{color:#8865ff}.wc-gzd-setup-content .error{box-shadow:none;margin:0 0 1.5em}.wc-gzd-setup-content h1{border-bottom:none;margin-top:0}.wc-gzd-setup-content .wc-gzd-admin-settings .woocommerce-input-toggle:not(.woocommerce-input-toggle--disabled){background-color:#8865ff;border-color:#8865ff}.wc-gzd-setup-content .wc-gzd-admin-settings .wc-gzd-additional-desc{background:rgba(136,101,255,.08)}.wc-gzd-setup-content .wc-gzd-admin-settings .wc-gzd-additional-desc a{color:#8865ff;text-decoration:none}.wc-gzd-setup-content .wc-gzd-admin-settings h2{display:none}.wc-gzd-setup-content .wc-gzd-admin-settings .wc-gzd-label-wrap{display:inline-block}.wc-gzd-setup-content .wc-gzd-admin-settings .form-table th{font-weight:600;line-height:1.3;padding:14px 14px 20px 0;position:relative;text-align:left;vertical-align:top;width:150px}.wc-gzd-setup-content .wc-gzd-admin-settings .form-table td{line-height:1.3;margin-bottom:9px;padding:15px 10px;vertical-align:middle}.wc-gzd-setup-content .wc-gzd-admin-settings .form-table td p.description{margin-top:0}.wc-gzd-setup-content .wc-gzd-admin-settings .form-table .status-disabled{display:inline-block}.wc-gzd-setup-content p.headliner{border-bottom:1px solid #b5b5b5;font-size:16px;line-height:2;margin-bottom:1.5em;padding-bottom:1em}.wc-gzd-setup-content p.headliner.no-border{border-bottom:none;margin-bottom:0;padding-bottom:0}.wc-gzd-setup-content p.desc{font-size:11px;line-height:2}.wc-gzd-setup-content p.desc code{font-size:inherit}.wc-gzd-setup-content p.form-wrapper input[type=text]{padding:10px;width:100%}.wc-gzd-setup-content h2{border-bottom:none;border-top:1px solid #b5b5b5;margin-top:1em;padding-top:1em}.wc-gzd-setup-content ul.demo-layouts{list-style:none;padding:0}.wc-gzd-setup-content ul.demo-layouts li.demo-layout{max-width:100%;overflow:hidden;width:33.3333333%}.wc-gzd-setup-content ul.demo-layouts li.demo-layout label .desc{font-size:16px;font-weight:600}.wc-gzd-setup-content ul.demo-layouts li.demo-layout img{height:auto;margin-top:1em;width:100%}.wc-gzd-setup-content .wc-gzd-setup-grid{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:flex-start;margin-left:-.5rem;margin-right:-.5rem}.wc-gzd-setup-content .wc-gzd-setup-grid .wc-gzd-setup-grid-item{box-sizing:border-box;flex:none;max-width:100%;padding-left:.5rem;padding-right:.5rem;width:50%}.wc-gzd-setup-content ul.more{padding-left:0}.wc-gzd-setup-content ul.more li a{color:#444;text-decoration:none}.wc-gzd-setup-footer{margin-top:1em;padding-bottom:1.5em}.wc-gzd-setup-footer .wc-gzd-setup-links{display:flex;flex-wrap:wrap;justify-content:flex-end}.wc-gzd-setup-footer .wc-gzd-setup-link{text-decoration:none}.wc-gzd-setup-footer .wc-gzd-setup-link.wc-gzd-setup-link-skip{color:#b5b5b5;margin-right:2em;margin-top:.5em}.wc-gzd-setup-footer .button-primary{font-size:1.25em;height:auto;line-height:1em;padding:.5em 1em}.wc-gzd-setup-footer .escape{margin-top:1em;text-align:center}.wc-gzd-setup-footer .escape a{color:#b5b5b5;font-size:11px} \ No newline at end of file diff --git a/build/static/admin-wizard-styles.js b/build/static/admin-wizard-styles.js new file mode 100644 index 000000000..c9a911be9 --- /dev/null +++ b/build/static/admin-wizard-styles.js @@ -0,0 +1,25 @@ +/******/ (function() { // webpackBootstrap +/******/ "use strict"; +/******/ // The require scope +/******/ var __webpack_require__ = {}; +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/make namespace object */ +/******/ !function() { +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ }(); +/******/ +/************************************************************************/ +var __webpack_exports__ = {}; +__webpack_require__.r(__webpack_exports__); +// extracted by mini-css-extract-plugin + +((window.germanized = window.germanized || {})["static"] = window.germanized["static"] || {})["admin-wizard-styles"] = __webpack_exports__; +/******/ })() +; \ No newline at end of file diff --git a/build/static/admin.asset.php b/build/static/admin.asset.php new file mode 100644 index 000000000..3fd59a280 --- /dev/null +++ b/build/static/admin.asset.php @@ -0,0 +1 @@ + array(), 'version' => 'f5c25238abb5db7f9c70'); diff --git a/build/static/admin.js b/build/static/admin.js new file mode 100644 index 000000000..2bc22a1b3 --- /dev/null +++ b/build/static/admin.js @@ -0,0 +1,40 @@ +/******/ (function() { // webpackBootstrap +var __webpack_exports__ = {}; +/*global woocommerce_admin_meta_boxes, woocommerce_admin, accounting, woocommerce_admin_meta_boxes_order */ +window.germanized = window.germanized || {}; +(function ($, germanized) { + /** + * Order Data Panel + */ + germanized.admin = { + params: {}, + init: function () { + var self = this; + this.params = wc_gzd_admin_params; + $(document).on('click', 'a.woocommerce-gzd-input-toggle-trigger', this.onInputToogleClick); + }, + onInputToogleClick: function () { + var $toggle = $(this).find('span.woocommerce-gzd-input-toggle'), + $row = $toggle.parents('fieldset'), + $checkbox = $row.find('input[type=checkbox]').length > 0 ? $row.find('input[type=checkbox]') : $toggle.parent().nextAll('input[type=checkbox]:first'), + $enabled = $toggle.hasClass('woocommerce-input-toggle--enabled'); + $toggle.removeClass('woocommerce-input-toggle--enabled'); + $toggle.removeClass('woocommerce-input-toggle--disabled'); + if ($enabled) { + $checkbox.prop('checked', false); + $toggle.addClass('woocommerce-input-toggle--disabled'); + } else { + $checkbox.prop('checked', true); + $toggle.addClass('woocommerce-input-toggle--enabled'); + } + $checkbox.trigger('change'); + return false; + } + }; + $(document).ready(function () { + germanized.admin.init(); + }); +})(jQuery, window.germanized); +((window.germanized = window.germanized || {})["static"] = window.germanized["static"] || {}).admin = __webpack_exports__; +/******/ })() +; \ No newline at end of file diff --git a/build/static/cart-voucher.asset.php b/build/static/cart-voucher.asset.php new file mode 100644 index 000000000..78b7fcdd4 --- /dev/null +++ b/build/static/cart-voucher.asset.php @@ -0,0 +1 @@ + array(), 'version' => 'db16911c064309ceb8d1'); diff --git a/build/static/cart-voucher.js b/build/static/cart-voucher.js new file mode 100644 index 000000000..80d883d6d --- /dev/null +++ b/build/static/cart-voucher.js @@ -0,0 +1,126 @@ +/******/ (function() { // webpackBootstrap +var __webpack_exports__ = {}; +/*global woocommerce_admin_meta_boxes, woocommerce_admin, accounting, woocommerce_admin_meta_boxes_order */ +window.germanized = window.germanized || {}; +(function ($, germanized) { + /** + * Order Data Panel + */ + germanized.cart_voucher = { + params: {}, + vouchers: {}, + init: function () { + this.params = wc_gzd_cart_voucher_params; + this.vouchers = wc_gzd_cart_voucher_params.vouchers; + if ($('.woocommerce-checkout').length) { + this.manipulate_checkout_totals(); + } + if ($('.woocommerce-cart-form').length) { + this.manipulate_cart_totals(); + } + $(document.body).on('updated_cart_totals', this.manipulate_cart_totals); + $(document.body).on('updated_checkout', this.manipulate_checkout_totals); + $(document.body).on('applied_coupon', this.refresh_cart_vouchers); + $(document.body).on('removed_coupon', this.refresh_cart_vouchers); + }, + refresh_cart_vouchers: function () { + var self = germanized.cart_voucher; + setTimeout(function () { + $.ajax({ + type: 'POST', + url: self.params.wc_ajax_url.toString().replace('%%endpoint%%', 'gzd_refresh_cart_vouchers'), + data: { + security: self.params.refresh_cart_vouchers_nonce + }, + success: function (data) { + self.vouchers = data.vouchers; + self.manipulate_cart_totals(); + }, + dataType: 'json' + }); + }, 75); + }, + manipulate_checkout_totals: function (e, ajaxData) { + var self = germanized.cart_voucher, + $table = $('.woocommerce-checkout #order_review table'); + ajaxData = typeof ajaxData === 'undefined' ? {} : ajaxData; + + /** + * Refresh new voucher data by fragments + */ + if (ajaxData.hasOwnProperty('fragments') && ajaxData.fragments.hasOwnProperty('.gzd-vouchers')) { + self.vouchers = ajaxData.fragments['.gzd-vouchers']; + } + if (!self.params.display_prices_including_tax) { + self.move_vouchers_before_total_checkout(); + } + self.manipulate_coupons($table); + }, + manipulate_cart_totals: function () { + var $table = $('.cart_totals table'), + $total = $table.find('tr.order-total'), + self = germanized.cart_voucher; + if (!self.params.display_prices_including_tax) { + self.move_vouchers_before_total($table, $total); + if ($('.woocommerce-checkout').length) { + self.move_vouchers_before_total_checkout(); + } + } + self.manipulate_coupons($table); + }, + manipulate_coupons: function ($table) { + var self = germanized.cart_voucher; + $.each(self.vouchers, function (voucherId, voucher) { + var $coupon = self.get_voucher_coupon(voucher, $table), + $fee = self.get_voucher_fee(voucher, $table); + $coupon.hide(); + if ($fee.length > 0 && $coupon.length > 0) { + var $remove_link = $coupon.find('a.woocommerce-remove-coupon'); + if ($remove_link.length > 0) { + $fee.find('td:last').append(" "); + $fee.find('td:last').append($remove_link); + } + } + }); + }, + move_vouchers_before_total_checkout: function () { + var $table = $('.woocommerce-checkout #order_review table'), + $total = $table.find('tr.order-total'), + self = germanized.cart_voucher; + self.move_vouchers_before_total($table, $total); + }, + get_voucher_fee: function (voucher, $table) { + var $fee = false; + $table.find('tr.fee').each(function () { + $tr = $(this); + var title = $tr.find('th').text(); + var maybeVoucherTitle = title.substr(title.length - voucher.code.length); + if (maybeVoucherTitle === voucher.code) { + $fee = $tr; + } + }); + if (!$fee) { + $fee = $table.find('tr.fee th:contains("' + voucher.name + '")').parents('tr'); + } + return $fee; + }, + get_voucher_coupon: function (voucher, $table) { + return $table.find('tr.' + voucher.coupon_class); + }, + move_vouchers_before_total: function ($table, $total) { + var self = germanized.cart_voucher; + $.each(self.vouchers, function (voucherId, voucher) { + var $fee = self.get_voucher_fee(voucher, $table); + if ($fee.length > 0) { + $fee.insertBefore($total); + } + }); + } + }; + $(document).ready(function () { + germanized.cart_voucher.init(); + }); +})(jQuery, window.germanized); +((window.germanized = window.germanized || {})["static"] = window.germanized["static"] || {})["cart-voucher"] = __webpack_exports__; +/******/ })() +; \ No newline at end of file diff --git a/build/static/checkout.asset.php b/build/static/checkout.asset.php new file mode 100644 index 000000000..f405c05dc --- /dev/null +++ b/build/static/checkout.asset.php @@ -0,0 +1 @@ + array(), 'version' => '8d65b96b7ad18596425f'); diff --git a/build/static/checkout.js b/build/static/checkout.js new file mode 100644 index 000000000..31224b34c --- /dev/null +++ b/build/static/checkout.js @@ -0,0 +1,176 @@ +/******/ (function() { // webpackBootstrap +var __webpack_exports__ = {}; +/*global woocommerce_admin_meta_boxes, woocommerce_admin, accounting, woocommerce_admin_meta_boxes_order */ +window.germanized = window.germanized || {}; +(function ($, germanized) { + /** + * Order Data Panel + */ + germanized.checkout = { + params: {}, + init: function () { + this.params = wc_gzd_checkout_params; + + /** + * Support lazy-disabling the checkout adjustments e.g. within compatibility scripts. + * Lazy-loading will lead to the input#wc_gzd_checkout_disabled to be rendered. + */ + if (this.checkoutAdjustmentsDisabled()) { + $('body').removeClass('woocommerce-gzd-checkout'); + } + if ($('.payment_methods:first').parents('#order_review').length) { + $(document.body).on('payment_method_selected', this.triggerCheckoutRefresh); + } + $(document.body).on('updated_checkout', this.onUpdateCheckout).on('checkout_error', this.onCheckoutError); + if (this.params.has_privacy_checkbox) { + $(document).on('change', 'input#createaccount', this.triggerCheckoutRefresh); + } + $(document).on('change', 'input#' + this.params.checkbox_photovoltaic_systems_id, this.triggerCheckoutRefresh); + if (this.params.checkbox_hidden) { + this.maybeSetTermsCheckbox(); + } else { + $(document).on('change', 'input#' + this.params.checkbox_id, this.onChangeLegalCheckbox); + } + this.adjustHeading(); + }, + checkoutAdjustmentsDisabled() { + return !$('body').hasClass('woocommerce-gzd-checkout') || $('input#wc_gzd_checkout_disabled').length > 0; + }, + adjustHeading() { + var self = germanized.checkout; + if (self.params.adjust_heading && !self.checkoutAdjustmentsDisabled()) { + var $form = $('form.checkout:visible'), + $heading = $form.find('#order_review_heading:first'); + if ($heading) { + $heading.removeClass('wc-gzd-heading-moved wc-gzd-maybe-show-heading'); + } + if (!self.params.custom_heading_container) { + var $visible = $form.find('.shop_table:visible, #payment:visible'); + var $theFirst = $visible.first(); + if ($heading.length > 0) { + // Move heading after payment block in case both shop table + payment wrap are visible + if ($theFirst.length > 0 && 2 === $visible.length && 'payment' === $theFirst.attr('id')) { + $heading.addClass('wc-gzd-heading-moved'); + $theFirst.after($heading); + } + if ($('#order_review:visible').length > 0) { + $form.find('#order_review_heading:first').show(); + } else { + $form.find('#order_review_heading:first').addClass('wc-gzd-maybe-show-heading'); + } + } + } else { + var $wrapper = $form.find(this.params.custom_heading_container); + if ($wrapper.length > 0 && $heading.length > 0) { + $wrapper.prepend($heading); + if ($wrapper.is(':visible')) { + $form.find('#order_review_heading:first').show(); + } else { + $form.find('#order_review_heading:first').addClass('wc-gzd-maybe-show-heading'); + } + } + } + $(document.body).trigger('wc_gzd_updated_checkout_heading'); + } + }, + onCheckoutError: function (e, errors) { + var self = germanized.checkout; + if (!self.params.mark_checkout_error_fields) { + return; + } + var $checkoutForm = $('form.checkout'), + $errorWrapper = $(errors), + $errors = $errorWrapper.length > 0 ? $errorWrapper.find('[data-id]') : null; + if ($errors && $errors.length > 0) { + $errors.each(function () { + var $el = $(this); + if ($el.data('id')) { + var error_id = $el.data('id'), + $input = $checkoutForm.find('#' + error_id); + if ($input.length > 0) { + var $parent = $input.closest('.form-row'); + if ($parent.length > 0) { + $parent.removeClass('woocommerce-validated').addClass('woocommerce-invalid woocommerce-invalid-required-field'); + } + } + } + }); + } + }, + maybeSetTermsCheckbox: function () { + var self = germanized.checkout, + $checkbox = $('input#' + self.params.checkbox_id), + $terms = $('input[name=terms]'); + if ($terms.length > 0) { + if (self.params.checkbox_hidden || $checkbox.is(':checked')) { + $terms.prop('checked', true); + } else { + $terms.prop('checked', false); + } + } + }, + onChangeLegalCheckbox: function () { + var self = germanized.checkout; + self.maybeSetTermsCheckbox(); + }, + triggerCheckoutRefresh: function () { + $('body').trigger('update_checkout'); + }, + onUpdateCheckout: function (e, data) { + var self = germanized.checkout; + if (self.params.adjust_heading) { + if ($('.woocommerce-checkout').find('#order_payment_heading').length > 0) { + if ($('.woocommerce-checkout').find('.wc_payment_methods').length <= 0) { + $('.woocommerce-checkout').find('#order_payment_heading').hide(); + } else { + $('.woocommerce-checkout').find('#order_payment_heading').show(); + } + } + self.adjustHeading(); + } + if ($('.wc-gzd-place-order').length > 0) { + if ($('.place-order:not(.wc-gzd-place-order)').length > 0) { + // Make sure we are removing the nonce from the old container to the new one. + $('.place-order:not(.wc-gzd-place-order)').find('#_wpnonce').appendTo('.wc-gzd-place-order'); + // Woo 3.4 + $('.place-order:not(.wc-gzd-place-order)').find('#woocommerce-process-checkout-nonce').appendTo('.wc-gzd-place-order'); + } + $('.place-order:not(.wc-gzd-place-order)').remove(); + + /** + * As a fallback in case the .woocommerce-checkout-payment fragment has not been replaced + * but the wc-gzd-place-order has been replaced (and thus misses a nonce), find the nonce in the fragment and add it. + */ + if (!$('.wc-gzd-place-order').find('#woocommerce-process-checkout-nonce, #_wpnonce').length) { + if (data.fragments.hasOwnProperty('.woocommerce-checkout-payment')) { + $payment_wrap = $(data.fragments['.woocommerce-checkout-payment']); + var $nonce = $payment_wrap.find('#woocommerce-process-checkout-nonce, #_wpnonce'); + if ($nonce.length > 0) { + $('.wc-gzd-place-order').append($nonce); + } + } + } + + /** + * Do only look for visible place-order items as some plugins/themes + * may add additional wrappers for mobile/desktop. + */ + var $all_nonces = $('.wc-gzd-place-order:visible').find('#woocommerce-process-checkout-nonce, #_wpnonce'); + + /** + * Keep the latest nonce only + */ + if ($all_nonces.length > 1) { + $all_nonces.not(':not(:first-child):not(:last-child)').remove(); + } + } + self.maybeSetTermsCheckbox(); + } + }; + $(document).ready(function () { + germanized.checkout.init(); + }); +})(jQuery, window.germanized); +((window.germanized = window.germanized || {})["static"] = window.germanized["static"] || {}).checkout = __webpack_exports__; +/******/ })() +; \ No newline at end of file diff --git a/build/static/direct-debit.asset.php b/build/static/direct-debit.asset.php new file mode 100644 index 000000000..eae86ab0e --- /dev/null +++ b/build/static/direct-debit.asset.php @@ -0,0 +1 @@ + array(), 'version' => 'debe6ee8ffbc4b719470'); diff --git a/build/static/direct-debit.js b/build/static/direct-debit.js new file mode 100644 index 000000000..26828fd47 --- /dev/null +++ b/build/static/direct-debit.js @@ -0,0 +1,104 @@ +/******/ (function() { // webpackBootstrap +var __webpack_exports__ = {}; +jQuery(function ($) { + var wc_gzd_direct_debit = { + $checkoutForm: $('form.checkout, form#order_review'), + params: {}, + init: function () { + this.params = direct_debit_params; + this.$checkoutForm.on('blur input change', '#direct-debit-form input#direct-debit-account-holder', this.onValidateHolder); + this.$checkoutForm.on('blur input change', '#direct-debit-form input#direct-debit-account-iban', this.onValidateIBAN); + this.$checkoutForm.on('blur input change', '#direct-debit-form input#direct-debit-account-bic', this.onValidateSWIFT); + this.$checkoutForm.on('blur input change', 'input, select', this.maybeShowCheckbox); + $(document.body).on('updated_checkout', this.maybeShowCheckbox); + $(document).on('click', 'a#show-direct-debit-trigger', this.onPrettyPhotoOpen); + this.initPrettyPhoto(); + }, + onValidateIBAN: function () { + var self = wc_gzd_direct_debit, + $wrapper = $(this).parents('p.form-row'); + if (!self.isValidIBAN($(this).val())) { + $wrapper.removeClass('woocommerce-validated'); + $wrapper.addClass('woocommerce-invalid woocommerce-invalid-required-field'); + } else { + $wrapper.addClass('woocommerce-validated'); + $wrapper.removeClass('woocommerce-invalid woocommerce-invalid-required-field'); + } + }, + onValidateSWIFT: function () { + var self = wc_gzd_direct_debit, + $wrapper = $(this).parents('p.form-row'); + if (!self.isValidSWIFT($(this).val())) { + $wrapper.removeClass('woocommerce-validated'); + $wrapper.addClass('woocommerce-invalid woocommerce-invalid-required-field'); + } else { + $wrapper.addClass('woocommerce-validated'); + $wrapper.removeClass('woocommerce-invalid woocommerce-invalid-required-field'); + } + }, + onValidateHolder: function () { + var self = wc_gzd_direct_debit, + $wrapper = $(this).parents('p.form-row'); + if (!$(this).val()) { + $wrapper.removeClass('woocommerce-validated'); + $wrapper.addClass('woocommerce-invalid woocommerce-invalid-required-field'); + } else { + $wrapper.addClass('woocommerce-validated'); + $wrapper.removeClass('woocommerce-invalid woocommerce-invalid-required-field'); + } + }, + isValidIBAN: function (iban) { + // Support legacy, non-bundled module loading + if (window.hasOwnProperty('IBAN')) { + return window.IBAN.isValid(iban); + } else { + return window.germanized.static.iban.isValid(iban); + } + }, + isValidSWIFT: function (swift) { + var regSWIFT = /^([a-zA-Z]){4}([a-zA-Z]){2}([0-9a-zA-Z]){2}([0-9a-zA-Z]{3})?$/; + return regSWIFT.test(swift); + }, + maybeShowCheckbox: function () { + var self = wc_gzd_direct_debit; + + // Hide by default + $('.direct-debit-checkbox').hide(); + if ($('#direct-debit-form').length) { + if ($('#payment_method_direct-debit').is(':checked') && $('input#direct-debit-account-holder').val() && $('input#direct-debit-account-iban').val() && $('input#direct-debit-account-bic').val()) { + $('.direct-debit-checkbox').show(); + self.initPrettyPhoto(); + } + } + }, + onPrettyPhotoOpen: function (e) { + var self = wc_gzd_direct_debit; + e.preventDefault(); + var url = $(this).attr('href'); + var data = {}; + $.each(self.params.mandate_fields, function (key, selector) { + if ($('input' + selector + ', select' + selector).length > 0) { + data[key] = $('input' + selector + ', select' + selector).val(); + } else { + data[key] = ''; + } + }); + url += '&ajax=true&' + jQuery.param(data); + $('#show-direct-debit-pretty').attr('href', url); + $('#show-direct-debit-pretty').trigger('click'); + }, + initPrettyPhoto: function () { + $('a#show-direct-debit-pretty').prettyPhoto({ + social_tools: false, + theme: 'pp_woocommerce', + horizontal_padding: 20, + opacity: 0.8, + deeplinking: false + }); + } + }; + wc_gzd_direct_debit.init(); +}); +((window.germanized = window.germanized || {})["static"] = window.germanized["static"] || {})["direct-debit"] = __webpack_exports__; +/******/ })() +; \ No newline at end of file diff --git a/build/static/force-pay-order.asset.php b/build/static/force-pay-order.asset.php new file mode 100644 index 000000000..1fcf2f56b --- /dev/null +++ b/build/static/force-pay-order.asset.php @@ -0,0 +1 @@ + array(), 'version' => '32a7a5031205d7098059'); diff --git a/build/static/force-pay-order.js b/build/static/force-pay-order.js new file mode 100644 index 000000000..5b6b41ee6 --- /dev/null +++ b/build/static/force-pay-order.js @@ -0,0 +1,34 @@ +/******/ (function() { // webpackBootstrap +var __webpack_exports__ = {}; +jQuery(function ($) { + if ($('#order_review').length > 0 && $('input#payment_method_' + wc_gzd_force_pay_order_params.gateway).length > 0) { + $payment_box = $('div.payment_method_' + wc_gzd_force_pay_order_params.gateway); + do_submit = wc_gzd_force_pay_order_params.auto_submit; + if ($payment_box.length > 0) { + if ($payment_box.find(':input').length > 0) { + // Do not submit if the payment requires inputs + do_submit = false; + } + } + + // Trigger click event because Woo listens to that + $('input#payment_method_' + wc_gzd_force_pay_order_params.gateway).prop('checked', true).trigger('click'); + if (do_submit) { + $('#order_review').block({ + message: wc_gzd_force_pay_order_params.block_message, + css: { + padding: '1em', + 'white-space': 'pre-wrap' + }, + overlayCSS: { + background: '#fff', + opacity: 0.6 + } + }); + $('#order_review').trigger('submit'); + } + } +}); +((window.germanized = window.germanized || {})["static"] = window.germanized["static"] || {})["force-pay-order"] = __webpack_exports__; +/******/ })() +; \ No newline at end of file diff --git a/build/static/iban.asset.php b/build/static/iban.asset.php new file mode 100644 index 000000000..2af6653c8 --- /dev/null +++ b/build/static/iban.asset.php @@ -0,0 +1 @@ + array(), 'version' => '7411408ef0a01eb00ab1'); diff --git a/build/static/iban.js b/build/static/iban.js new file mode 100644 index 000000000..6c05e0ee6 --- /dev/null +++ b/build/static/iban.js @@ -0,0 +1,427 @@ +/******/ (function() { // webpackBootstrap +/******/ var __webpack_modules__ = ({ + +/***/ 858: +/***/ (function(__unused_webpack_module, exports) { + +/** +The MIT License (MIT) +Copyright (c) 2013-2015 ARHS Developments SA +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ +(function (exports) { + // Array.prototype.map polyfill + // code from https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/map + if (!Array.prototype.map) { + Array.prototype.map = function (fun /*, thisArg */) { + "use strict"; + + if (this === void 0 || this === null) throw new TypeError(); + var t = Object(this); + var len = t.length >>> 0; + if (typeof fun !== "function") throw new TypeError(); + var res = new Array(len); + var thisArg = arguments.length >= 2 ? arguments[1] : void 0; + for (var i = 0; i < len; i++) { + // NOTE: Absolute correctness would demand Object.defineProperty + // be used. But this method is fairly new, and failure is + // possible only if Object.prototype or Array.prototype + // has a property |i| (very unlikely), so use a less-correct + // but more portable alternative. + if (i in t) res[i] = fun.call(thisArg, t[i], i, t); + } + return res; + }; + } + var A = 'A'.charCodeAt(0), + Z = 'Z'.charCodeAt(0); + + /** + * Prepare an IBAN for mod 97 computation by moving the first 4 chars to the end and transforming the letters to + * numbers (A = 10, B = 11, ..., Z = 35), as specified in ISO13616. + * + * @param {string} iban the IBAN + * @returns {string} the prepared IBAN + */ + function iso13616Prepare(iban) { + iban = iban.toUpperCase(); + iban = iban.substr(4) + iban.substr(0, 4); + return iban.split('').map(function (n) { + var code = n.charCodeAt(0); + if (code >= A && code <= Z) { + // A = 10, B = 11, ... Z = 35 + return code - A + 10; + } else { + return n; + } + }).join(''); + } + + /** + * Calculates the MOD 97 10 of the passed IBAN as specified in ISO7064. + * + * @param iban + * @returns {number} + */ + function iso7064Mod97_10(iban) { + var remainder = iban, + block; + while (remainder.length > 2) { + block = remainder.slice(0, 9); + remainder = parseInt(block, 10) % 97 + remainder.slice(block.length); + } + return parseInt(remainder, 10) % 97; + } + + /** + * Parse the BBAN structure used to configure each IBAN Specification and returns a matching regular expression. + * A structure is composed of blocks of 3 characters (one letter and 2 digits). Each block represents + * a logical group in the typical representation of the BBAN. For each group, the letter indicates which characters + * are allowed in this group and the following 2-digits number tells the length of the group. + * + * @param {string} structure the structure to parse + * @returns {RegExp} + */ + function parseStructure(structure) { + // split in blocks of 3 chars + var regex = structure.match(/(.{3})/g).map(function (block) { + // parse each structure block (1-char + 2-digits) + var format, + pattern = block.slice(0, 1), + repeats = parseInt(block.slice(1), 10); + switch (pattern) { + case "A": + format = "0-9A-Za-z"; + break; + case "B": + format = "0-9A-Z"; + break; + case "C": + format = "A-Za-z"; + break; + case "F": + format = "0-9"; + break; + case "L": + format = "a-z"; + break; + case "U": + format = "A-Z"; + break; + case "W": + format = "0-9a-z"; + break; + } + return '([' + format + ']{' + repeats + '})'; + }); + return new RegExp('^' + regex.join('') + '$'); + } + + /** + * Create a new Specification for a valid IBAN number. + * + * @param countryCode the code of the country + * @param length the length of the IBAN + * @param structure the structure of the undernying BBAN (for validation and formatting) + * @param example an example valid IBAN + * @constructor + */ + function Specification(countryCode, length, structure, example) { + this.countryCode = countryCode; + this.length = length; + this.structure = structure; + this.example = example; + } + + /** + * Lazy-loaded regex (parse the structure and construct the regular expression the first time we need it for validation) + */ + Specification.prototype._regex = function () { + return this._cachedRegex || (this._cachedRegex = parseStructure(this.structure)); + }; + + /** + * Check if the passed iban is valid according to this specification. + * + * @param {String} iban the iban to validate + * @returns {boolean} true if valid, false otherwise + */ + Specification.prototype.isValid = function (iban) { + return this.length == iban.length && this.countryCode === iban.slice(0, 2) && this._regex().test(iban.slice(4)) && iso7064Mod97_10(iso13616Prepare(iban)) == 1; + }; + + /** + * Convert the passed IBAN to a country-specific BBAN. + * + * @param iban the IBAN to convert + * @param separator the separator to use between BBAN blocks + * @returns {string} the BBAN + */ + Specification.prototype.toBBAN = function (iban, separator) { + return this._regex().exec(iban.slice(4)).slice(1).join(separator); + }; + + /** + * Convert the passed BBAN to an IBAN for this country specification. + * Please note that "generation of the IBAN shall be the exclusive responsibility of the bank/branch servicing the account". + * This method implements the preferred algorithm described in http://en.wikipedia.org/wiki/International_Bank_Account_Number#Generating_IBAN_check_digits + * + * @param bban the BBAN to convert to IBAN + * @returns {string} the IBAN + */ + Specification.prototype.fromBBAN = function (bban) { + if (!this.isValidBBAN(bban)) { + throw new Error('Invalid BBAN'); + } + var remainder = iso7064Mod97_10(iso13616Prepare(this.countryCode + '00' + bban)), + checkDigit = ('0' + (98 - remainder)).slice(-2); + return this.countryCode + checkDigit + bban; + }; + + /** + * Check of the passed BBAN is valid. + * This function only checks the format of the BBAN (length and matching the letetr/number specs) but does not + * verify the check digit. + * + * @param bban the BBAN to validate + * @returns {boolean} true if the passed bban is a valid BBAN according to this specification, false otherwise + */ + Specification.prototype.isValidBBAN = function (bban) { + return this.length - 4 == bban.length && this._regex().test(bban); + }; + var countries = {}; + function addSpecification(IBAN) { + countries[IBAN.countryCode] = IBAN; + } + addSpecification(new Specification("AD", 24, "F04F04A12", "AD1200012030200359100100")); + addSpecification(new Specification("AE", 23, "F03F16", "AE070331234567890123456")); + addSpecification(new Specification("AL", 28, "F08A16", "AL47212110090000000235698741")); + addSpecification(new Specification("AT", 20, "F05F11", "AT611904300234573201")); + addSpecification(new Specification("AZ", 28, "U04A20", "AZ21NABZ00000000137010001944")); + addSpecification(new Specification("BA", 20, "F03F03F08F02", "BA391290079401028494")); + addSpecification(new Specification("BE", 16, "F03F07F02", "BE68539007547034")); + addSpecification(new Specification("BG", 22, "U04F04F02A08", "BG80BNBG96611020345678")); + addSpecification(new Specification("BH", 22, "U04A14", "BH67BMAG00001299123456")); + addSpecification(new Specification("BR", 29, "F08F05F10U01A01", "BR9700360305000010009795493P1")); + addSpecification(new Specification("CH", 21, "F05A12", "CH9300762011623852957")); + addSpecification(new Specification("CR", 21, "F03F14", "CR0515202001026284066")); + addSpecification(new Specification("CY", 28, "F03F05A16", "CY17002001280000001200527600")); + addSpecification(new Specification("CZ", 24, "F04F06F10", "CZ6508000000192000145399")); + addSpecification(new Specification("DE", 22, "F08F10", "DE89370400440532013000")); + addSpecification(new Specification("DK", 18, "F04F09F01", "DK5000400440116243")); + addSpecification(new Specification("DO", 28, "U04F20", "DO28BAGR00000001212453611324")); + addSpecification(new Specification("EE", 20, "F02F02F11F01", "EE382200221020145685")); + addSpecification(new Specification("ES", 24, "F04F04F01F01F10", "ES9121000418450200051332")); + addSpecification(new Specification("FI", 18, "F06F07F01", "FI2112345600000785")); + addSpecification(new Specification("FO", 18, "F04F09F01", "FO6264600001631634")); + addSpecification(new Specification("FR", 27, "F05F05A11F02", "FR1420041010050500013M02606")); + addSpecification(new Specification("GB", 22, "U04F06F08", "GB29NWBK60161331926819")); + addSpecification(new Specification("GE", 22, "U02F16", "GE29NB0000000101904917")); + addSpecification(new Specification("GI", 23, "U04A15", "GI75NWBK000000007099453")); + addSpecification(new Specification("GL", 18, "F04F09F01", "GL8964710001000206")); + addSpecification(new Specification("GR", 27, "F03F04A16", "GR1601101250000000012300695")); + addSpecification(new Specification("GT", 28, "A04A20", "GT82TRAJ01020000001210029690")); + addSpecification(new Specification("HR", 21, "F07F10", "HR1210010051863000160")); + addSpecification(new Specification("HU", 28, "F03F04F01F15F01", "HU42117730161111101800000000")); + addSpecification(new Specification("IE", 22, "U04F06F08", "IE29AIBK93115212345678")); + addSpecification(new Specification("IL", 23, "F03F03F13", "IL620108000000099999999")); + addSpecification(new Specification("IS", 26, "F04F02F06F10", "IS140159260076545510730339")); + addSpecification(new Specification("IT", 27, "U01F05F05A12", "IT60X0542811101000000123456")); + addSpecification(new Specification("KW", 30, "U04A22", "KW81CBKU0000000000001234560101")); + addSpecification(new Specification("KZ", 20, "F03A13", "KZ86125KZT5004100100")); + addSpecification(new Specification("LB", 28, "F04A20", "LB62099900000001001901229114")); + addSpecification(new Specification("LI", 21, "F05A12", "LI21088100002324013AA")); + addSpecification(new Specification("LT", 20, "F05F11", "LT121000011101001000")); + addSpecification(new Specification("LU", 20, "F03A13", "LU280019400644750000")); + addSpecification(new Specification("LV", 21, "U04A13", "LV80BANK0000435195001")); + addSpecification(new Specification("MC", 27, "F05F05A11F02", "MC5811222000010123456789030")); + addSpecification(new Specification("MD", 24, "U02F18", "MD24AG000225100013104168")); + addSpecification(new Specification("ME", 22, "F03F13F02", "ME25505000012345678951")); + addSpecification(new Specification("MK", 19, "F03A10F02", "MK07250120000058984")); + addSpecification(new Specification("MR", 27, "F05F05F11F02", "MR1300020001010000123456753")); + addSpecification(new Specification("MT", 31, "U04F05A18", "MT84MALT011000012345MTLCAST001S")); + addSpecification(new Specification("MU", 30, "U04F02F02F12F03U03", "MU17BOMM0101101030300200000MUR")); + addSpecification(new Specification("NL", 18, "U04F10", "NL91ABNA0417164300")); + addSpecification(new Specification("NO", 15, "F04F06F01", "NO9386011117947")); + addSpecification(new Specification("PK", 24, "U04A16", "PK36SCBL0000001123456702")); + addSpecification(new Specification("PL", 28, "F08F16", "PL61109010140000071219812874")); + addSpecification(new Specification("PS", 29, "U04A21", "PS92PALS000000000400123456702")); + addSpecification(new Specification("PT", 25, "F04F04F11F02", "PT50000201231234567890154")); + addSpecification(new Specification("RO", 24, "U04A16", "RO49AAAA1B31007593840000")); + addSpecification(new Specification("RS", 22, "F03F13F02", "RS35260005601001611379")); + addSpecification(new Specification("SA", 24, "F02A18", "SA0380000000608010167519")); + addSpecification(new Specification("SE", 24, "F03F16F01", "SE4550000000058398257466")); + addSpecification(new Specification("SI", 19, "F05F08F02", "SI56263300012039086")); + addSpecification(new Specification("SK", 24, "F04F06F10", "SK3112000000198742637541")); + addSpecification(new Specification("SM", 27, "U01F05F05A12", "SM86U0322509800000000270100")); + addSpecification(new Specification("TN", 24, "F02F03F13F02", "TN5910006035183598478831")); + addSpecification(new Specification("TR", 26, "F05A01A16", "TR330006100519786457841326")); + addSpecification(new Specification("VG", 24, "U04F16", "VG96VPVG0000012345678901")); + + // Angola + addSpecification(new Specification("AO", 25, "F21", "AO69123456789012345678901")); + // Burkina + addSpecification(new Specification("BF", 27, "F23", "BF2312345678901234567890123")); + // Burundi + addSpecification(new Specification("BI", 16, "F12", "BI41123456789012")); + // Benin + addSpecification(new Specification("BJ", 28, "F24", "BJ39123456789012345678901234")); + // Ivory + addSpecification(new Specification("CI", 28, "U01F23", "CI17A12345678901234567890123")); + // Cameron + addSpecification(new Specification("CM", 27, "F23", "CM9012345678901234567890123")); + // Cape Verde + addSpecification(new Specification("CV", 25, "F21", "CV30123456789012345678901")); + // Algeria + addSpecification(new Specification("DZ", 24, "F20", "DZ8612345678901234567890")); + // Iran + addSpecification(new Specification("IR", 26, "F22", "IR861234568790123456789012")); + // Jordan + addSpecification(new Specification("JO", 30, "A04F22", "JO15AAAA1234567890123456789012")); + // Madagascar + addSpecification(new Specification("MG", 27, "F23", "MG1812345678901234567890123")); + // Mali + addSpecification(new Specification("ML", 28, "U01F23", "ML15A12345678901234567890123")); + // Mozambique + addSpecification(new Specification("MZ", 25, "F21", "MZ25123456789012345678901")); + // Quatar + addSpecification(new Specification("QA", 29, "U04A21", "QA30AAAA123456789012345678901")); + // Senegal + addSpecification(new Specification("SN", 28, "U01F23", "SN52A12345678901234567890123")); + // Ukraine + addSpecification(new Specification("UA", 29, "F25", "UA511234567890123456789012345")); + var NON_ALPHANUM = /[^a-zA-Z0-9]/g, + EVERY_FOUR_CHARS = /(.{4})(?!$)/g; + + /** + * Utility function to check if a variable is a String. + * + * @param v + * @returns {boolean} true if the passed variable is a String, false otherwise. + */ + function isString(v) { + return typeof v == 'string' || v instanceof String; + } + + /** + * Check if an IBAN is valid. + * + * @param {String} iban the IBAN to validate. + * @returns {boolean} true if the passed IBAN is valid, false otherwise + */ + exports.isValid = function (iban) { + if (!isString(iban)) { + return false; + } + iban = this.electronicFormat(iban); + var countryStructure = countries[iban.slice(0, 2)]; + return !!countryStructure && countryStructure.isValid(iban); + }; + + /** + * Convert an IBAN to a BBAN. + * + * @param iban + * @param {String} [separator] the separator to use between the blocks of the BBAN, defaults to ' ' + * @returns {string|*} + */ + exports.toBBAN = function (iban, separator) { + if (typeof separator == 'undefined') { + separator = ' '; + } + iban = this.electronicFormat(iban); + var countryStructure = countries[iban.slice(0, 2)]; + if (!countryStructure) { + throw new Error('No country with code ' + iban.slice(0, 2)); + } + return countryStructure.toBBAN(iban, separator); + }; + + /** + * Convert the passed BBAN to an IBAN for this country specification. + * Please note that "generation of the IBAN shall be the exclusive responsibility of the bank/branch servicing the account". + * This method implements the preferred algorithm described in http://en.wikipedia.org/wiki/International_Bank_Account_Number#Generating_IBAN_check_digits + * + * @param countryCode the country of the BBAN + * @param bban the BBAN to convert to IBAN + * @returns {string} the IBAN + */ + exports.fromBBAN = function (countryCode, bban) { + var countryStructure = countries[countryCode]; + if (!countryStructure) { + throw new Error('No country with code ' + countryCode); + } + return countryStructure.fromBBAN(this.electronicFormat(bban)); + }; + + /** + * Check the validity of the passed BBAN. + * + * @param countryCode the country of the BBAN + * @param bban the BBAN to check the validity of + */ + exports.isValidBBAN = function (countryCode, bban) { + if (!isString(bban)) { + return false; + } + var countryStructure = countries[countryCode]; + return countryStructure && countryStructure.isValidBBAN(this.electronicFormat(bban)); + }; + + /** + * + * @param iban + * @param separator + * @returns {string} + */ + exports.printFormat = function (iban, separator) { + if (typeof separator == 'undefined') { + separator = ' '; + } + return this.electronicFormat(iban).replace(EVERY_FOUR_CHARS, "$1" + separator); + }; + + /** + * + * @param iban + * @returns {string} + */ + exports.electronicFormat = function (iban) { + return iban.replace(NON_ALPHANUM, '').toUpperCase(); + }; + + /** + * An object containing all the known IBAN specifications. + */ + exports.countries = countries; +})( false ? 0 : exports); + +/***/ }) + +/******/ }); +/************************************************************************/ +/******/ +/******/ // startup +/******/ // Load entry module and return exports +/******/ // This entry module is referenced by other modules so it can't be inlined +/******/ var __webpack_exports__ = {}; +/******/ __webpack_modules__[858](0, __webpack_exports__); +/******/ ((window.germanized = window.germanized || {})["static"] = window.germanized["static"] || {}).iban = __webpack_exports__; +/******/ +/******/ })() +; \ No newline at end of file diff --git a/build/static/layout-styles.asset.php b/build/static/layout-styles.asset.php new file mode 100644 index 000000000..d009f4975 --- /dev/null +++ b/build/static/layout-styles.asset.php @@ -0,0 +1 @@ + array(), 'version' => 'cda4ebdc77d019232fba'); diff --git a/build/static/layout-styles.css b/build/static/layout-styles.css new file mode 100644 index 000000000..137926bc5 --- /dev/null +++ b/build/static/layout-styles.css @@ -0,0 +1 @@ +.product-type-variable div.product ul.tabs li.product_safety_tab,.wc-gzd-additional-info-placeholder,p.wc-gzd-additional-info:empty{display:none}#order_review .wc-gzd-checkbox-placeholder{clear:both}#order_review .wc-gzd-checkbox-placeholder p.form-row{float:none;padding:0 1em 0 0;text-align:left}#order_review .wc-gzd-checkbox-placeholder p.form-row label{display:inline}#order_review .wc-gzd-checkbox-placeholder:empty{display:none}.woocommerce-checkout .shop_table{background-color:#eee}@media(min-width:768px){table.woocommerce-checkout-review-order-table tr.wc-gzd-cart-item-has-thumbnail .wc-gzd-cart-item-name-wrapper{align-items:center;display:flex}}table.woocommerce-checkout-review-order-table tr.wc-gzd-cart-item-has-thumbnail .wc-gzd-cart-item-name-wrapper .wc-gzd-cart-item-thumbnail{margin-right:1em;max-width:15%;min-width:60px}table.woocommerce-checkout-review-order-table tr.wc-gzd-cart-item-has-thumbnail .wc-gzd-cart-item-name-wrapper .wc-gzd-cart-item-thumbnail img{margin:0}body.theme-astra table.woocommerce-checkout-review-order-table tr.wc-gzd-cart-item-has-thumbnail td.product-name{flex-wrap:wrap}.cart_totals tr.order-total-differential-taxation-notice td:before,.cart_totals tr.order-total-small-business-notice td:before{content:""!important}.includes_tax,.tax_label,.woocommerce-cart dl.variation dd[class*=variation-gzd-],.woocommerce-cart dl.variation dt[class*=variation-gzd-],.woocommerce-checkout dl.variation dd[class*=variation-gzd-],.woocommerce-checkout dl.variation dt[class*=variation-gzd-]{display:none!important}.wc-gzd-small-business-includes-tax{display:inline!important;font-size:.9em;padding-left:3px}.woocommerce-gzd-checkout #order_review_heading{display:none}.woocommerce-checkout .shop_table tr td p{margin-bottom:0}.woocommerce-checkout .shop_table td,.woocommerce-checkout .shop_table th{line-height:1.5}.more-variants-available-info{display:block;font-size:11px;font-weight:400}.shop_table .product-name-inner,.shop_table .product-name-inner tr td{border:none;margin:0;padding:0}.shop_table .product-name-inner tr td:last-child{text-align:right}.cart_totals .wc-gzd-additional-wrapper,.woocommerce-checkout table.shop_table .wc-gzd-additional-wrapper{clear:both;text-align:right}.cart_totals p.wc-gzd-additional-info,.woocommerce-checkout table.shop_table p.wc-gzd-additional-info{display:inline-block;font-size:.8em;font-weight:400;margin-bottom:0}.entry-content .woocommerce #payment{margin-bottom:1em}.woocommerce #payment .wc-terms-and-conditions{display:none!important}.entry-content .woocommerce .checkout-btn-wrap{text-align:right}.woocommerce-checkout p.direct-debit-checkbox{display:none}.unit-price-cart{display:block;font-size:.9em;margin-top:5px}.product_list_widget .wc-gzd-additional-info,.products .wc-gzd-additional-info{font-size:.8em;margin:.7rem 0;padding:0}.product_list_widget .wc-gzd-additional-info,.product_list_widget p.price-unit{line-height:1.8em;margin:.2rem 0}.product_list_widget .wc-gzd-additional-info a{display:inline!important}.product_list_widget .price-unit,.products .product .price-unit{font-size:.8em}.product_list_widget .price-unit{margin-bottom:.7em}.product p.wc-gzd-additional-info{clear:left;font-size:.9em;margin-bottom:.5rem}.product .defect-description:not(:empty){border:2px solid #4b4f58;margin:1em 0;padding:.5em}.product .defect-description:not(:empty) p:last-child{margin-bottom:0}.deposit-packaging-type{font-weight:700;text-transform:uppercase}.product p.deposit-packaging-type{font-size:1.2em!important}.wc-gzd-rating-authenticity-status{display:block;font-size:.9em}.woocommerce-product-rating .wc-gzd-rating-authenticity-status{display:inline-block}.product .product_meta{margin-top:1rem}p.footer-info{font-size:.9em;padding-bottom:.5rem;text-align:center}.wc-gzd-item-defect-description p,.wc-gzd-item-desc p{font-size:.9em;font-weight:400}.wc-gzd-edit-data-notice{background:#eee;display:inline-block;padding:1em}.wc-gzd-edit-data-notice p.wc-gzd-info{margin:0;padding:0}.wc-gzd-cart-info{display:block}table.product-details-inner{margin:0;padding:0;table-layout:fixed}table.product-details-inner,table.product-details-inner td,table.product-details-inner tr{background:transparent;border:none;margin-bottom:0;margin-top:0;padding-bottom:0;padding-top:0}table.product-details-inner tr td:last-child{text-align:right}.wc-gzd-product-name-left,.wc-gzd-product-name-right{float:left}.wc-gzd-product-name-left{margin-right:1em;max-width:15%}#order_review .blockMsg{line-height:1.5em}#shipping_parcelshop_post_number_field .optional{display:none!important}.wc-gzd-nutri-score-value{display:block;height:4rem;text-indent:-9999px;width:7.0625rem}.wc-gzd-placeholder-loading{display:flex;flex:0 0 100%;flex-flow:column;overflow:hidden;position:relative}.wc-gzd-placeholder-loading *{box-sizing:border-box}.wc-gzd-placeholder-loading:before{animation:phAnimation .8s linear infinite;background:linear-gradient(90deg,hsla(0,0%,100%,0) 46%,hsla(0,0%,100%,.35) 50%,hsla(0,0%,100%,0) 54%) 50% 50%;bottom:0;content:" ";left:50%;margin-left:-250%;pointer-events:none;position:absolute;right:0;top:0;width:500%;z-index:1}.wc-gzd-placeholder-loading .wc-gzd-placeholder-row{align-items:center;display:flex;vertical-align:middle}.wc-gzd-placeholder-loading .wc-gzd-placeholder-row>*{background-color:#e7e7e7;display:block;height:10px}.wc-gzd-placeholder-loading .wc-gzd-placeholder-row .wc-gzd-placeholder-row-col-4{min-width:100px}@keyframes phAnimation{0%{transform:translate3d(-30%,0,0)}to{transform:translate3d(30%,0,0)}}.wc-block-featured-product .wc-gzd-additional-info{color:inherit;font-size:.9em;margin:0;padding:5px 48px 0;text-align:center;width:100%;z-index:1}.wc-block-featured-product .wc-gzd-nutri-score{width:auto}ul.wc-block-grid__products li.wc-block-grid__product .wc-gzd-additional-info{margin:.5em 0}ul.wc-block-grid__products li.wc-block-grid__product .wc-gzd-additional-info:not(.deposit-packaging-type){font-size:.9em;font-weight:400}.theme-twentytwenty form.woocommerce-checkout #order_review_heading,.theme-twentytwentyone form.woocommerce-checkout #order_review_heading{margin-bottom:2rem;padding-left:0;text-align:left;width:100%} \ No newline at end of file diff --git a/build/static/layout-styles.js b/build/static/layout-styles.js new file mode 100644 index 000000000..33a90ca3f --- /dev/null +++ b/build/static/layout-styles.js @@ -0,0 +1,25 @@ +/******/ (function() { // webpackBootstrap +/******/ "use strict"; +/******/ // The require scope +/******/ var __webpack_require__ = {}; +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/make namespace object */ +/******/ !function() { +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ }(); +/******/ +/************************************************************************/ +var __webpack_exports__ = {}; +__webpack_require__.r(__webpack_exports__); +// extracted by mini-css-extract-plugin + +((window.germanized = window.germanized || {})["static"] = window.germanized["static"] || {})["layout-styles"] = __webpack_exports__; +/******/ })() +; \ No newline at end of file diff --git a/build/static/revocation.asset.php b/build/static/revocation.asset.php new file mode 100644 index 000000000..55d9ee6a5 --- /dev/null +++ b/build/static/revocation.asset.php @@ -0,0 +1 @@ + array(), 'version' => '7e96123ee7612fcb6b52'); diff --git a/build/static/revocation.js b/build/static/revocation.js new file mode 100644 index 000000000..d0bc4858e --- /dev/null +++ b/build/static/revocation.js @@ -0,0 +1,72 @@ +/******/ (function() { // webpackBootstrap +var __webpack_exports__ = {}; +jQuery(function ($) { + $('form#woocommerce-gzd-revocation') + + /* Inline validation */.on('blur input change', '.input-text, select', function () { + var $this = $(this), + $parent = $this.closest('.form-row'), + validated = true; + if ($parent.is('.validate-required')) { + if ($this.val() === '') { + $parent.removeClass('woocommerce-validated').addClass('woocommerce-invalid woocommerce-invalid-required-field'); + validated = false; + } + } + if ($parent.is('.validate-email')) { + if ($this.val()) { + /* http://stackoverflow.com/questions/2855865/jquery-validate-e-mail-address-regex */ + var pattern = new RegExp(/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i); + if (!pattern.test($this.val())) { + $parent.removeClass('woocommerce-validated').addClass('woocommerce-invalid woocommerce-invalid-email'); + validated = false; + } + } + } + if (validated) { + $parent.removeClass('woocommerce-invalid woocommerce-invalid-required-field').addClass('woocommerce-validated'); + } + }); + $('form#woocommerce-gzd-revocation').submit(function () { + var $form = $(this); + if ($form.is('.processing')) { + return false; + } + $form.addClass('processing').block({ + message: null, + overlayCSS: { + background: '#fff', + opacity: 0.6 + } + }); + $.ajax({ + type: 'POST', + url: wc_gzd_revocation_params.wc_ajax_url.toString().replace('%%endpoint%%', 'gzd_revocation'), + data: $form.serialize(), + dataType: 'json', + success: function (data) { + $('.woocommerce-error, .woocommerce-message').remove(); + $form.removeClass('processing').unblock(); + if (data.result === 'success') { + $form.before(data.messages); + $form.fadeOut('fast'); + $('html, body').animate({ + scrollTop: $('.woocommerce-message').offset().top - 100 + }, 1000); + } else { + // Add new errors + if (data.messages) { + $form.prepend(data.messages); + } + $('html, body').animate({ + scrollTop: $('form#woocommerce-gzd-revocation').offset().top - 100 + }, 1000); + } + } + }); + return false; + }); +}); +((window.germanized = window.germanized || {})["static"] = window.germanized["static"] || {}).revocation = __webpack_exports__; +/******/ })() +; \ No newline at end of file diff --git a/build/static/unit-price-observer-bundle.asset.php b/build/static/unit-price-observer-bundle.asset.php new file mode 100644 index 000000000..9425b232f --- /dev/null +++ b/build/static/unit-price-observer-bundle.asset.php @@ -0,0 +1 @@ + array(), 'version' => 'ef90362cbaa74454ed96'); diff --git a/build/static/unit-price-observer-bundle.js b/build/static/unit-price-observer-bundle.js new file mode 100644 index 000000000..b394bc44b --- /dev/null +++ b/build/static/unit-price-observer-bundle.js @@ -0,0 +1,19 @@ +/******/ (function() { // webpackBootstrap +var __webpack_exports__ = {}; +; +(function ($, window, document, undefined) { + $(function () { + /** + * Use a timeout here to allow custom scripts (e.g. bundles) to dynamically instantiate variation forms + */ + setTimeout(function () { + $('.bundled_product').each(function () { + $(this).wc_germanized_unit_price_observer(); + }); + }, 250); + }); +})(jQuery, window, document); +window.germanized = window.germanized || {}; +((window.germanized = window.germanized || {})["static"] = window.germanized["static"] || {})["unit-price-observer-bundle"] = __webpack_exports__; +/******/ })() +; \ No newline at end of file diff --git a/build/static/unit-price-observer-queue.asset.php b/build/static/unit-price-observer-queue.asset.php new file mode 100644 index 000000000..2bf93ff13 --- /dev/null +++ b/build/static/unit-price-observer-queue.asset.php @@ -0,0 +1 @@ + array(), 'version' => '7c701d1bacfd2d5847a2'); diff --git a/build/static/unit-price-observer-queue.js b/build/static/unit-price-observer-queue.js new file mode 100644 index 000000000..b8fdf8ea7 --- /dev/null +++ b/build/static/unit-price-observer-queue.js @@ -0,0 +1,141 @@ +/******/ (function() { // webpackBootstrap +var __webpack_exports__ = {}; +/*global woocommerce_admin_meta_boxes, woocommerce_admin, accounting, woocommerce_admin_meta_boxes_order */ +window.germanized = window.germanized || {}; +(function ($, germanized) { + germanized.unit_price_observer_queue = { + queue: {}, + timeout: null, + params: {}, + request: null, + init: function () { + this.params = wc_gzd_unit_price_observer_queue_params; + this.queue = {}; + this.timeout = null; + this.request = null; + }, + execute: function () { + var self = germanized.unit_price_observer_queue, + data = [], + currentQueue = { + ...self.queue + }; + self.queue = {}; + self.timeout = null; + + /** + * Reverse queue + */ + Object.keys(currentQueue).forEach(function (queueKey) { + data = data.concat([{ + 'product_id': currentQueue[queueKey].productId, + 'price': currentQueue[queueKey].priceData.price, + 'price_sale': currentQueue[queueKey].priceData.sale_price, + 'quantity': currentQueue[queueKey].priceData.quantity, + 'key': queueKey + }]); + }); + self.request = $.ajax({ + type: "POST", + url: self.params.wc_ajax_url.toString().replace('%%endpoint%%', 'gzd_refresh_unit_price'), + data: { + 'security': self.params.refresh_unit_price_nonce, + 'products': data + }, + success: function (data) { + Object.keys(currentQueue).forEach(function (queueId) { + var current = currentQueue[queueId], + observer = current.observer, + priceData = current.priceData, + priceSelector = current.priceSelector, + isPrimary = current.isPrimary, + unitPrices = self.getUnitPricesFromMap(priceData.unit_price); + if (observer) { + if (data.products.hasOwnProperty(queueId)) { + var response = data.products[queueId]; + observer.stopObserver(observer, priceSelector); + + /** + * Do only adjust unit price in case current product id has not changed + * in the meantime (e.g. variation change). + */ + if (parseInt(response.product_id) === observer.getCurrentProductId(observer)) { + if (response.hasOwnProperty('unit_price_html')) { + observer.unsetUnitPriceLoading(observer, unitPrices, response.unit_price_html); + } else { + observer.unsetUnitPriceLoading(observer, unitPrices); + } + } else { + observer.unsetUnitPriceLoading(observer, unitPrices); + } + observer.startObserver(observer, priceSelector, isPrimary); + } else { + observer.stopObserver(observer, priceSelector); + observer.unsetUnitPriceLoading(observer, unitPrices); + observer.startObserver(observer, priceSelector, isPrimary); + } + } + }); + }, + error: function () { + Object.keys(currentQueue).forEach(function (queueId) { + var current = currentQueue[queueId], + observer = current.observer, + priceData = current.priceData, + priceSelector = current.priceSelector, + isPrimary = current.isPrimary, + unitPrices = self.getUnitPricesFromMap(priceData.unit_price); + if (observer) { + observer.stopObserver(observer, priceSelector); + observer.unsetUnitPriceLoading(observer, unitPrices); + observer.startObserver(observer, priceSelector, isPrimary); + } + }); + }, + dataType: 'json' + }); + }, + getUnitPricesFromMap: function (unitPriceMap) { + let unitPrices = []; + unitPriceMap.forEach(function (unitPrice) { + unitPrices = $.merge(unitPrices, $(unitPrice)); + }); + return $(unitPrices); + }, + getQueueKey: function (productId) { + return (productId + '').replace(/[^a-zA-Z0-9]/g, ''); + }, + add: function (observer, productId, priceData, priceSelector, isPrimary) { + var self = germanized.unit_price_observer_queue, + queueKey = self.getQueueKey(productId); + if (self.queue.hasOwnProperty(queueKey)) { + priceData['unit_price'].each(function (i, obj) { + if (!self.queue[queueKey]['priceData']['unit_price'].has(obj)) { + self.queue[queueKey]['priceData']['unit_price'].set(obj, obj); + } + }); + } else { + var unitPrices = new Map(); + priceData['unit_price'].each(function (i, obj) { + unitPrices.set(obj, obj); + }); + priceData['unit_price'] = unitPrices; + self.queue[queueKey] = { + 'productId': productId, + 'observer': observer, + 'priceData': priceData, + 'priceSelector': priceSelector, + 'isPrimary': isPrimary + }; + } + clearTimeout(self.timeout); + self.timeout = setTimeout(self.execute, 500); + } + }; + $(document).ready(function () { + germanized.unit_price_observer_queue.init(); + }); +})(jQuery, window.germanized); +((window.germanized = window.germanized || {})["static"] = window.germanized["static"] || {})["unit-price-observer-queue"] = __webpack_exports__; +/******/ })() +; \ No newline at end of file diff --git a/build/static/unit-price-observer.asset.php b/build/static/unit-price-observer.asset.php new file mode 100644 index 000000000..b6874f8e2 --- /dev/null +++ b/build/static/unit-price-observer.asset.php @@ -0,0 +1 @@ + array(), 'version' => 'c414b81060d514eac5f8'); diff --git a/build/static/unit-price-observer.js b/build/static/unit-price-observer.js new file mode 100644 index 000000000..c857839af --- /dev/null +++ b/build/static/unit-price-observer.js @@ -0,0 +1,397 @@ +/******/ (function() { // webpackBootstrap +var __webpack_exports__ = {}; +/*global wc_gzd_unit_price_observer_params, accounting */ +; +(function ($, window, document, undefined) { + var GermanizedUnitPriceObserver = function ($wrapper) { + var self = this; + self.params = wc_gzd_unit_price_observer_params; + self.$wrapper = $wrapper.closest(self.params.wrapper); + self.$form = self.$wrapper.find('.variations_form, .cart').length > 0 ? self.$wrapper.find('.variations_form, .cart') : false; + self.isVar = self.$form ? self.$form.hasClass('variations_form') : false; + self.$product = self.$wrapper.closest('.product'); + self.requests = []; + self.observer = {}; + self.timeout = false; + self.priceData = false; + self.productId = 0; + if (self.$wrapper.length <= 0) { + self.$wrapper = self.$product; + } + self.replacePrice = self.$wrapper.hasClass('bundled_product') ? false : self.params.replace_price; + if ("MutationObserver" in window || "WebKitMutationObserver" in window || "MozMutationObserver" in window) { + self.$wrapper.addClass('has-unit-price-observer'); + self.initObservers(self); + if (self.isVar && self.$form) { + self.productId = parseInt(self.$form.find('input[name=product_id]').length > 0 ? self.$form.find('input[name=product_id]').val() : self.$form.data('product_id')); + self.variationId = parseInt(self.$form.find('input[name=variation_id]').length > 0 ? self.$form.find('input[name=variation_id]').val() : 0); + if (self.$form.find('input[name=variation_id]').length <= 0) { + self.variationId = parseInt(self.$form.find('input.variation_id').length > 0 ? self.$form.find('input.variation_id').val() : 0); + } + self.$form.on('reset_data.unit-price-observer', { + GermanizedUnitPriceObserver: self + }, self.onResetVariation); + self.$form.on('found_variation.unit-price-observer', { + GermanizedUnitPriceObserver: self + }, self.onFoundVariation); + } else { + if (self.$form && self.$form.find('*[name=add-to-cart][type=submit]').length > 0) { + self.productId = parseInt(self.$form.find('*[name=add-to-cart][type=submit]').val()); + } else if (self.$form && self.$form.data('product_id')) { + self.productId = parseInt(self.$form.data('product_id')); + } else { + var classList = self.$product.attr('class').split(/\s+/); + + /** + * Check whether we may find the post/product by a class added by Woo, e.g. post-64 + */ + $.each(classList, function (index, item) { + if ('post-' === item.substring(0, 5)) { + var postId = parseInt(item.substring(5).replace(/[^0-9]/g, '')); + if (postId > 0) { + self.productId = postId; + return true; + } + } + }); + + /** + * Do only use the add to cart button attribute as fallback as there might be a lot of + * other product/add to cart buttons within a single product main product wrap (e.g. related products). + */ + if (self.productId <= 0 && 1 === self.$product.find('a.ajax_add_to_cart[data-product_id], a.add_to_cart_button[data-product_id]').length) { + self.productId = parseInt(self.$product.find('a.ajax_add_to_cart, a.add_to_cart_button').data('product_id')); + } + } + } + if (self.productId <= 0) { + self.destroy(self); + return false; + } + if (self.params.refresh_on_load) { + $.each(self.params.price_selector, function (priceSelector, priceArgs) { + var isPrimary = priceArgs.hasOwnProperty('is_primary_selector') ? priceArgs['is_primary_selector'] : false, + $price = self.getPriceNode(self, priceSelector, isPrimary), + $unitPrice = self.getUnitPriceNode(self, $price); + + /** + * Do only refresh primary price nodes on load. + */ + if (!isPrimary) { + return; + } + if ($unitPrice.length > 0) { + self.stopObserver(self, priceSelector); + self.setUnitPriceLoading(self, $unitPrice); + setTimeout(function () { + self.stopObserver(self, priceSelector); + var priceData = self.getCurrentPriceData(self, priceSelector, priceArgs['is_total_price'], isPrimary, priceArgs['quantity_selector']); + if (priceData) { + self.refreshUnitPrice(self, priceData, priceSelector, isPrimary); + } else if ($unitPrice.length > 0) { + self.unsetUnitPriceLoading(self, $unitPrice); + } + self.startObserver(self, priceSelector, isPrimary); + }, 250); + } + }); + } + } + $wrapper.data('unitPriceObserver', self); + }; + GermanizedUnitPriceObserver.prototype.destroy = function (self) { + self = self || this; + self.cancelObservers(self); + if (self.$form) { + self.$form.off('.unit-price-observer'); + } + self.$wrapper.removeClass('has-unit-price-observer'); + }; + GermanizedUnitPriceObserver.prototype.getTextWidth = function ($element) { + var htmlOrg = $element.html(); + var html_calc = '' + htmlOrg + ''; + $element.html(html_calc); + var textWidth = $element.find('span:first').width(); + $element.html(htmlOrg); + return textWidth; + }; + GermanizedUnitPriceObserver.prototype.getPriceNode = function (self, priceSelector, isPrimarySelector) { + isPrimarySelector = typeof isPrimarySelector === 'undefined' ? false : isPrimarySelector; + var $node = self.$wrapper.find(priceSelector + ':not(.price-unit):visible').not('.variations_form .single_variation .price').first(); + if (isPrimarySelector && self.isVar && ($node.length <= 0 || !self.replacePrice)) { + $node = self.$wrapper.find('.woocommerce-variation-price span.price:not(.price-unit):visible:last'); + } else if (isPrimarySelector && $node.length <= 0) { + $node = self.$wrapper.find('.price:not(.price-unit):visible:last'); + } + return $node; + }; + GermanizedUnitPriceObserver.prototype.getObserverNode = function (self, priceSelector, isPrimarySelector) { + var $node = self.getPriceNode(self, priceSelector, isPrimarySelector); + if (isPrimarySelector && self.isVar && !self.replacePrice) { + $node = self.$wrapper.find('.single_variation:last'); + } + return $node; + }; + GermanizedUnitPriceObserver.prototype.getUnitPriceNode = function (self, $price) { + if ($price.length <= 0) { + return []; + } + var isSingleProductBlock = $price.parents('.wp-block-woocommerce-product-price[data-is-descendent-of-single-product-template]').length > 0; + if ('SPAN' === $price[0].tagName) { + return self.$wrapper.find('.price-unit'); + } else { + if (isSingleProductBlock) { + return self.$wrapper.find('.wp-block-woocommerce-gzd-product-unit-price[data-is-descendent-of-single-product-template] .price-unit'); + } else { + return self.$wrapper.find('.price-unit:not(.wc-gzd-additional-info-placeholder, .wc-gzd-additional-info-loop)'); + } + } + }; + GermanizedUnitPriceObserver.prototype.stopObserver = function (self, priceSelector) { + var observer = self.getObserver(self, priceSelector); + if (observer) { + observer.disconnect(); + } + }; + GermanizedUnitPriceObserver.prototype.startObserver = function (self, priceSelector, isPrimary) { + var observer = self.getObserver(self, priceSelector), + $node = self.getObserverNode(self, priceSelector, isPrimary); + if (observer) { + self.stopObserver(self, priceSelector); + if ($node.length > 0) { + observer.observe($node[0], { + childList: true, + subtree: true, + characterData: true + }); + } + return true; + } + return false; + }; + GermanizedUnitPriceObserver.prototype.initObservers = function (self) { + if (Object.keys(self.observer).length !== 0) { + return; + } + $.each(self.params.price_selector, function (priceSelector, priceArgs) { + var isPrimary = priceArgs.hasOwnProperty('is_primary_selector') ? priceArgs['is_primary_selector'] : false, + $observerNode = self.getObserverNode(self, priceSelector, isPrimary), + currentObserver = false; + if ($observerNode.length > 0) { + // Callback function to execute when mutations are observed + var callback = function (mutationsList, observer) { + var $node = self.getPriceNode(self, priceSelector, isPrimary); + + /** + * Clear the timeout and abort open AJAX requests as + * a new mutation has been observed + */ + if (self.timeout) { + clearTimeout(self.timeout); + } + if ($node.length <= 0) { + return false; + } + var $unitPrice = self.getUnitPriceNode(self, $node), + hasRefreshed = false; + self.stopObserver(self, priceSelector); + if ($unitPrice.length > 0) { + self.setUnitPriceLoading(self, $unitPrice); + } + + /** + * Need to use a tweak here to make sure our variation listener + * has already adjusted the variationId (in case necessary). + */ + self.timeout = setTimeout(function () { + self.stopObserver(self, priceSelector); + var priceData = self.getCurrentPriceData(self, priceSelector, priceArgs['is_total_price'], isPrimary, priceArgs['quantity_selector']); + if (priceData) { + /** + * Do only fire AJAX requests in case no other requests (e.g. from other plugins) are currently running. + */ + if ($.active <= 0) { + hasRefreshed = true; + self.refreshUnitPrice(self, priceData, priceSelector, isPrimary); + } + } + if (!hasRefreshed && $unitPrice.length > 0) { + self.unsetUnitPriceLoading(self, $unitPrice); + } + self.startObserver(self, priceSelector, isPrimary); + }, 500); + }; + if ("MutationObserver" in window) { + currentObserver = new window.MutationObserver(callback); + } else if ("WebKitMutationObserver" in window) { + currentObserver = new window.WebKitMutationObserver(callback); + } else if ("MozMutationObserver" in window) { + currentObserver = new window.MozMutationObserver(callback); + } + if (currentObserver) { + self.observer[priceSelector] = currentObserver; + self.startObserver(self, priceSelector, isPrimary); + } + } + }); + }; + GermanizedUnitPriceObserver.prototype.getObserver = function (self, priceSelector) { + if (self.observer.hasOwnProperty(priceSelector)) { + return self.observer[priceSelector]; + } + return false; + }; + GermanizedUnitPriceObserver.prototype.cancelObservers = function (self) { + for (var key in self.observer) { + if (self.observer.hasOwnProperty(key)) { + self.observer[key].disconnect(); + delete self.observer[key]; + } + } + }; + + /** + * Reset all fields. + */ + GermanizedUnitPriceObserver.prototype.onResetVariation = function (event) { + var self = event.data.GermanizedUnitPriceObserver; + self.variationId = 0; + }; + GermanizedUnitPriceObserver.prototype.onFoundVariation = function (event, variation) { + var self = event.data.GermanizedUnitPriceObserver; + if (variation.hasOwnProperty('variation_id')) { + self.variationId = parseInt(variation.variation_id); + } + self.initObservers(self); + }; + GermanizedUnitPriceObserver.prototype.getCurrentPriceData = function (self, priceSelector, isTotalPrice, isPrimary, quantitySelector) { + quantitySelector = quantitySelector && '' !== quantitySelector ? quantitySelector : self.params.qty_selector; + var $price = self.getPriceNode(self, priceSelector, isPrimary); + if ($price.length > 0) { + // Add a tmp hidden class to detect hidden elements in cloned obj + $price.find(':hidden').addClass('wc-gzd-is-hidden'); + var $unit_price = self.getUnitPriceNode(self, $price), + $priceCloned = $price.clone(); + + // Remove price suffix from cloned DOM element to prevent finding the wrong (sale) price + $priceCloned.find('.woocommerce-price-suffix').remove(); + $priceCloned.find('.wc-gzd-is-hidden').remove(); + var sale_price = '', + $priceInner = $priceCloned.find('.amount:first'), + $qty = $(self.params.wrapper + ' ' + quantitySelector + ':first'), + qty = 1; + if ($qty.length > 0) { + qty = parseFloat($qty.val()); + } + + /** + * In case the price element does not contain the default Woo price structure + * search the whole element. + */ + if ($priceInner.length <= 0) { + if ($priceCloned.find('.price').length > 0) { + $priceInner = $priceCloned.find('.price'); + } else { + $priceInner = $priceCloned; + } + } + var price = self.getRawPrice($priceInner, self.params.price_decimal_sep); + + /** + * Is sale? + */ + if ($priceCloned.find('.amount').length > 1) { + // The second .amount element is the sale price + var $sale_price = $($priceCloned.find('.amount')[1]); + sale_price = self.getRawPrice($sale_price, self.params.price_decimal_sep); + } + $price.find('.wc-gzd-is-hidden').removeClass('wc-gzd-is-hidden'); + if ($unit_price.length > 0 && price) { + if (isTotalPrice) { + price = parseFloat(price) / qty; + if (sale_price) { + sale_price = parseFloat(sale_price) / qty; + } + } + return { + 'price': price, + 'unit_price': $unit_price, + 'sale_price': sale_price, + 'quantity': qty + }; + } + } + return false; + }; + GermanizedUnitPriceObserver.prototype.getCurrentProductId = function (self) { + var productId = self.productId; + if (self.variationId > 0) { + productId = self.variationId; + } + return parseInt(productId); + }; + GermanizedUnitPriceObserver.prototype.getRawPrice = function ($el, decimal_sep) { + var price_raw = $el.length > 0 ? $el.text() : '', + price = false; + try { + price = accounting.unformat(price_raw, decimal_sep); + } catch (e) { + price = false; + } + return price; + }; + GermanizedUnitPriceObserver.prototype.setUnitPriceLoading = function (self, $unit_price) { + var unitPriceOrg = $unit_price.html(); + if (!$unit_price.hasClass('wc-gzd-loading')) { + var textWidth = self.getTextWidth($unit_price), + textHeight = $unit_price.find('span').length > 0 ? $unit_price.find('span').innerHeight() : $unit_price.height(); + /** + * @see https://github.com/zalog/placeholder-loading + */ + $unit_price.html(''); + $unit_price.addClass('wc-gzd-loading'); + $unit_price.data('org-html', unitPriceOrg); + } else { + unitPriceOrg = $unit_price.data('org-html'); + } + return unitPriceOrg; + }; + GermanizedUnitPriceObserver.prototype.unsetUnitPriceLoading = function (self, $unit_price, newHtml) { + newHtml = newHtml || $unit_price.data('org-html'); + $unit_price.html(newHtml); + if ($unit_price.hasClass('wc-gzd-loading')) { + $unit_price.removeClass('wc-gzd-loading'); + } + if (typeof newHtml === "string" && newHtml.length > 0) { + $unit_price.show(); + } + }; + GermanizedUnitPriceObserver.prototype.refreshUnitPrice = function (self, priceData, priceSelector, isPrimary) { + germanized.unit_price_observer_queue.add(self, self.getCurrentProductId(self), priceData, priceSelector, isPrimary); + }; + + /** + * Function to call wc_gzd_variation_form on jquery selector. + */ + $.fn.wc_germanized_unit_price_observer = function () { + if ($(this).data('unitPriceObserver')) { + $(this).data('unitPriceObserver').destroy(); + } + new GermanizedUnitPriceObserver(this); + return this; + }; + $(function () { + if (typeof wc_gzd_unit_price_observer_params !== 'undefined') { + $(wc_gzd_unit_price_observer_params.wrapper).each(function () { + if ($(this).is('body')) { + return; + } + $(this).wc_germanized_unit_price_observer(); + }); + } + }); +})(jQuery, window, document); +window.germanized = window.germanized || {}; +((window.germanized = window.germanized || {})["static"] = window.germanized["static"] || {})["unit-price-observer"] = __webpack_exports__; +/******/ })() +; \ No newline at end of file diff --git a/build/style-cart.css b/build/style-cart.css new file mode 100644 index 000000000..9c0a7351d --- /dev/null +++ b/build/style-cart.css @@ -0,0 +1 @@ +.wc-block-components-product-metadata ul.wc-block-components-product-details:first-child{display:flex;flex-direction:column}.wc-block-components-product-metadata ul.wc-block-components-product-details:first-child li{order:950}.wc-block-components-product-metadata ul.wc-block-components-product-details:first-child li[class*=wc-block-components-product-details__gzd-]{order:90;width:120%}.wc-block-components-product-metadata ul.wc-block-components-product-details:first-child li.wc-block-components-product-details__gzd-unit-price{order:0}.wc-block-components-product-metadata ul.wc-block-components-product-details:first-child li.wc-block-components-product-details__gzd-deposit-packaging-type{order:5;font-weight:bold;text-transform:uppercase}.wc-block-components-product-metadata ul.wc-block-components-product-details:first-child li.wc-block-components-product-details__gzd-deposit{order:10}.wc-block-components-product-metadata ul.wc-block-components-product-details:first-child li.wc-block-components-product-details__gzd-differential-taxation{order:10}.wc-block-components-product-metadata ul.wc-block-components-product-details:first-child li.wc-block-components-product-details__gzd-delivery-time{order:20}.wc-block-components-product-metadata ul.wc-block-components-product-details:first-child li.wc-block-components-product-details__gzd-item-desc{order:100}.wc-block-components-product-metadata ul.wc-block-components-product-details:first-child li.wc-gzd-summary-item-last{margin-bottom:1em}ul.wc-block-components-product-details li[class*=wc-block-components-product-details__gzd-] .wc-block-components-product-details__name{display:none}ul.wc-block-components-product-details li[class*=wc-block-components-product-details__gzd-] .wc-block-components-product-details__value{font-size:.8rem;color:#757575}.wc-gzd-small-business-info{font-size:.8rem;color:#757575}ul.wc-block-components-product-details li.wc-not-gzd-summary-item-first{margin-top:1em} diff --git a/build/style-checkout.css b/build/style-checkout.css new file mode 100644 index 000000000..198a20fff --- /dev/null +++ b/build/style-checkout.css @@ -0,0 +1,3 @@ +ul.wc-block-components-product-details li[class*=wc-block-components-product-details__gzd-] .wc-block-components-product-details__name{display:none}ul.wc-block-components-product-details li[class*=wc-block-components-product-details__gzd-] .wc-block-components-product-details__value{font-size:.8rem;color:#757575}.wc-gzd-small-business-info{font-size:.8rem;color:#757575}.wc-gzd-unit-price{font-weight:normal;font-size:.8rem;color:#757575}.wc-gzd-unit-price .wc-block-components-product-details__name{display:none}ul.wc-block-components-product-details li.wc-block-components-product-details__gzd-unit-price{display:none !important}ul.wc-block-components-product-details li.wc-not-gzd-summary-item-first{margin-top:1em}.wc-gzd-checkout .wp-block-woocommerce-checkout-fields-block .wc-block-checkout__actions{display:none}.wc-gzd-checkout .is-large .wc-block-checkout__sidebar{align-self:auto}.wc-gzd-checkout .is-large .wc-block-components-totals-wrapper.wc-gzd-hide-total-wrapper{display:none}.wc-gzd-checkout .is-large .wc-block-components-totals-wrapper.wc-gzd-show-total-wrapper{display:block}.wc-gzd-checkout .is-large .wc-gzd-checkout-submit{margin-top:1em;position:sticky;top:0}.wc-gzd-checkout .is-large .wc-gzd-checkout-submit .wc-block-components-totals-wrapper{display:none;border-top:none}.wc-gzd-checkout .is-large .wc-gzd-checkout-submit .wc-block-components-totals-wrapper.wc-gzd-show-total-wrapper{display:block}.wc-gzd-checkout .is-large .wc-gzd-checkout-submit .wc-block-components-panel__content .wc-block-components-totals-wrapper{display:block}.wc-gzd-checkout .is-large .wc-gzd-checkout-submit .wc-block-checkout__actions{border-top:none;padding:36px 0}.wc-gzd-checkout .is-large .wc-gzd-checkout-submit .wc-block-checkout__actions .wc-block-checkout__actions_row{display:flex;flex-wrap:wrap;flex-direction:column-reverse}.wc-gzd-checkout .is-large .wc-gzd-checkout-submit .wc-block-checkout__actions .wc-block-components-checkout-place-order-button{width:100%;margin-bottom:1em}.wc-gzd-checkout .wc-block-checkout.is-mobile,.wc-gzd-checkout .wc-block-checkout.is-medium,.wc-gzd-checkout .wc-block-checkout.is-small{flex-direction:column-reverse !important}.wc-gzd-checkout .wc-block-checkout.is-mobile .wc-gzd-checkout-submit,.wc-gzd-checkout .wc-block-checkout.is-medium .wc-gzd-checkout-submit,.wc-gzd-checkout .wc-block-checkout.is-small .wc-gzd-checkout-submit{position:relative;padding:1.5em 0}.wc-gzd-checkout .wc-block-checkout.is-mobile .wc-gzd-checkout-submit .wp-block-woocommerce-checkout-order-summary-block,.wc-gzd-checkout .wc-block-checkout.is-medium .wc-gzd-checkout-submit .wp-block-woocommerce-checkout-order-summary-block,.wc-gzd-checkout .wc-block-checkout.is-small .wc-gzd-checkout-submit .wp-block-woocommerce-checkout-order-summary-block{display:none}.wc-gzd-checkout .wc-block-checkout.is-mobile .wc-gzd-checkboxes,.wc-gzd-checkout .wc-block-checkout.is-medium .wc-gzd-checkboxes,.wc-gzd-checkout .wc-block-checkout.is-small .wc-gzd-checkboxes{padding-top:10px}.wc-gzd-checkout .wc-block-components-order-summary .wc-block-components-order-summary-item__total-price{min-width:55px}.wc-gzd-checkout .wc-block-components-product-metadata ul.wc-block-components-product-details:first-child{display:flex;flex-direction:column}.wc-gzd-checkout .wc-block-components-product-metadata ul.wc-block-components-product-details:first-child li{order:950}.wc-gzd-checkout .wc-block-components-product-metadata ul.wc-block-components-product-details:first-child li[class*=wc-block-components-product-details__gzd-]{order:90;width:130%}.wc-gzd-checkout .wc-block-components-product-metadata ul.wc-block-components-product-details:first-child li.wc-block-components-product-details__gzd-unit-price{order:0}.wc-gzd-checkout .wc-block-components-product-metadata ul.wc-block-components-product-details:first-child li.wc-block-components-product-details__gzd-deposit-packaging-type{order:5;font-weight:bold;text-transform:uppercase}.wc-gzd-checkout .wc-block-components-product-metadata ul.wc-block-components-product-details:first-child li.wc-block-components-product-details__gzd-deposit{order:10}.wc-gzd-checkout .wc-block-components-product-metadata ul.wc-block-components-product-details:first-child li.wc-block-components-product-details__gzd-differential-taxation{order:10}.wc-gzd-checkout .wc-block-components-product-metadata ul.wc-block-components-product-details:first-child li.wc-block-components-product-details__gzd-delivery-time{order:20}.wc-gzd-checkout .wc-block-components-product-metadata ul.wc-block-components-product-details:first-child li.wc-block-components-product-details__gzd-item-desc{order:100}.wc-gzd-checkout .wc-block-components-product-metadata ul.wc-block-components-product-details:first-child li.wc-gzd-summary-item-last{margin-bottom:1em} +.wc-gzd-checkboxes{margin-bottom:1em}.wc-gzd-checkboxes .wc-gzd-checkbox{color:inherit;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;text-decoration:inherit;text-transform:inherit;margin-top:1em}.wc-gzd-checkboxes .wc-gzd-checkbox.has-no-checkbox span{font-size:.875em}.wc-gzd-checkout-modal-bg{width:auto !important;position:fixed;background:rgba(0,0,0,.45);left:0;right:0;top:0;bottom:0;z-index:40}.wc-gzd-checkout-modal-wrapper{position:absolute;width:100%;height:100%;display:flex;justify-content:center;align-items:center;top:0;box-sizing:border-box}.wc-gzd-checkout-modal-wrapper .wc-gzd-checkout-modal{position:fixed;top:20%;max-height:60%;width:60%;background:#fff;z-index:41;border-radius:4px;border:1px solid #d5d5d5;transition:1.1s ease-out;box-shadow:-2rem 2rem 2rem rgba(0,0,0,.2);filter:blur(0);transform:scale(1);opacity:1;visibility:visible;overflow:hidden;display:flex;flex-wrap:nowrap}.wc-gzd-checkout-modal-wrapper .wc-gzd-checkout-modal .content{position:relative;padding:1rem;overflow-y:scroll;max-height:100%;width:100%}.wc-gzd-checkout-modal-wrapper .wc-gzd-checkout-modal .content.is-loading{display:flex;align-items:center;justify-content:center;min-height:200px}.wc-gzd-checkout-modal-wrapper .wc-gzd-checkout-modal .actions{position:fixed;width:100%;display:flex;justify-content:end;z-index:42}.wc-gzd-checkout-modal-wrapper .wc-gzd-checkout-modal .actions .wc-gzd-checkout-modal-close{margin:.25rem;display:inline-flex;cursor:pointer}.is-mobile .wc-gzd-checkout-modal-wrapper .wc-gzd-checkout-modal{top:2%;width:95%} +.wc-gzd-block-checkout__photovoltaic-system-notice{flex-direction:column} diff --git a/build/style-mini-cart.css b/build/style-mini-cart.css new file mode 100644 index 000000000..567f36e5d --- /dev/null +++ b/build/style-mini-cart.css @@ -0,0 +1 @@ +ul.wc-block-components-product-details li[class*=wc-block-components-product-details__gzd-] .wc-block-components-product-details__name{display:none}ul.wc-block-components-product-details li[class*=wc-block-components-product-details__gzd-] .wc-block-components-product-details__value{font-size:.8rem;color:#757575}.wc-gzd-small-business-info{font-size:.8rem;color:#757575}.wc-gzd-unit-price{font-weight:normal;font-size:.8rem;color:#757575}.wc-gzd-unit-price .wc-block-components-product-details__name{display:none}ul.wc-block-components-product-details li.wc-block-components-product-details__gzd-unit-price{display:none !important}ul.wc-block-components-product-details li.wc-not-gzd-summary-item-first{margin-top:1em}.wp-block-woocommerce-mini-cart-contents .wc-block-components-totals-item__description{display:none !important} diff --git a/build/style-wc-gzd-blocks.css b/build/style-wc-gzd-blocks.css new file mode 100644 index 000000000..215e8ede6 --- /dev/null +++ b/build/style-wc-gzd-blocks.css @@ -0,0 +1 @@ +.wc-gzd-block-grid__product-unit-price{display:block}.wc-gzd-block-components-product-deposit-packaging-type{text-transform:uppercase}.wp-block-woocommerce-gzd-product-is-empty{display:none} diff --git a/build/wc-gzd-blocks-editor-style.css b/build/wc-gzd-blocks-editor-style.css new file mode 100644 index 000000000..d1e3a5c49 --- /dev/null +++ b/build/wc-gzd-blocks-editor-style.css @@ -0,0 +1,3 @@ +.wc-gzd-block-components-product-price-label{display:block}.wc-gzd-block-components-product-price-label.wc-gzd-block-components-product-price-label--align-center{text-align:center}.wc-gzd-block-components-product-price-label.wc-gzd-block-components-product-price-label--align-right{text-align:right}.wc-gzd-block-components-product-deposit-packaging-type{text-transform:uppercase}.wc-gzd-block-components-product-nutri-score .wc-gzd-nutri-score-value{height:4rem;width:7.0625rem;display:block;text-indent:-9999px} +.wp-block-woocommerce-germanized-checkout-checkboxes{margin-top:20px;margin-bottom:20px;padding-top:4px;padding-bottom:4px} +.wc-gzd-block-checkout__photovoltaic-system-notice{flex-direction:column} diff --git a/build/wc-gzd-blocks-frontend.asset.php b/build/wc-gzd-blocks-frontend.asset.php new file mode 100644 index 000000000..03e2dc742 --- /dev/null +++ b/build/wc-gzd-blocks-frontend.asset.php @@ -0,0 +1 @@ + array('react', 'wc-blocks-registry', 'wc-blocks-shared-context', 'wc-blocks-shared-hocs', 'wc-price-format', 'wp-element', 'wp-i18n'), 'version' => '5f2b43309aae7635819f'); diff --git a/build/wc-gzd-blocks-frontend.js b/build/wc-gzd-blocks-frontend.js new file mode 100644 index 000000000..6f5106c1c --- /dev/null +++ b/build/wc-gzd-blocks-frontend.js @@ -0,0 +1 @@ +!function(){"use strict";var e,t,o,n,r={196:function(e){e.exports=window.React},293:function(e){e.exports=window.wc.priceFormat},864:function(e){e.exports=window.wc.wcBlocksSharedContext},721:function(e){e.exports=window.wc.wcBlocksSharedHocs},307:function(e){e.exports=window.wp.element},736:function(e){e.exports=window.wp.i18n}},c={};function i(e){var t=c[e];if(void 0!==t)return t.exports;var o=c[e]={exports:{}};return r[e](o,o.exports,i),o.exports}i.m=r,i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,{a:t}),t},i.d=function(e,t){for(var o in t)i.o(t,o)&&!i.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},i.f={},i.e=function(e){return Promise.all(Object.keys(i.f).reduce((function(t,o){return i.f[o](e,t),t}),[]))},i.u=function(e){return({6:"product-unit-product",92:"product-unit-price",128:"product-nutri-score",202:"product-safety-instructions",284:"product-manufacturer",297:"product-tax-info",412:"product-deposit",518:"product-delivery-time",534:"product-deposit-packaging-type",545:"product-safety-attachments",648:"product-shipping-costs-info",710:"product-defect-description"}[e]||e)+"-frontend.js?ver="+{6:"ac2b2a6f5e39a1373d42",92:"04589d82c5abdb998058",128:"41cbb0d83ecc64a2dade",202:"277cdd6fbfc32be9a756",284:"cc503045604d7b401e8d",297:"4220c749a7a8418883f2",412:"cb2c018e6e190051e837",518:"20aab4183b1990852845",534:"b6a29aac108e9c2e8a15",545:"c780482cc52cba886176",648:"bcd2bf58413bf08f62ac",700:"866940257754ccc7d38e",710:"e88771c7b155de6a8a77"}[e]},i.miniCssF=function(e){return{6:"product-unit-product",92:"product-unit-price",128:"product-nutri-score",202:"product-safety-instructions",284:"product-manufacturer",297:"product-tax-info",412:"product-deposit",518:"product-delivery-time",534:"product-deposit-packaging-type",545:"product-safety-attachments",648:"product-shipping-costs-info",710:"product-defect-description"}[e]+".css"},i.miniCssF=function(e){return{6:"product-unit-product",92:"product-unit-price",128:"product-nutri-score",202:"product-safety-instructions",284:"product-manufacturer",297:"product-tax-info",412:"product-deposit",518:"product-delivery-time",534:"product-deposit-packaging-type",545:"product-safety-attachments",648:"product-shipping-costs-info",710:"product-defect-description"}[e]+".css"},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},e={},t="woocommerce-germanized:",i.l=function(o,n,r,c){if(e[o])e[o].push(n);else{var a,u;if(void 0!==r)for(var d=document.getElementsByTagName("script"),p=0;p-1&&!e;)e=o[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),i.p=e}(),function(){if("undefined"!=typeof document){var e={70:0};i.f.miniCss=function(t,o){e[t]?o.push(e[t]):0!==e[t]&&{6:1,92:1,128:1,202:1,284:1,297:1,412:1,518:1,534:1,545:1,648:1,710:1}[t]&&o.push(e[t]=function(e){return new Promise((function(t,o){var n=i.miniCssF(e),r=i.p+n;if(function(e,t){for(var o=document.getElementsByTagName("link"),n=0;nPromise.all([i.e(700),i.e(92)]).then(i.bind(i,263))))}),(0,o.registerBlockComponent)({blockName:"woocommerce-germanized/product-delivery-time",component:(0,n.lazy)((()=>Promise.all([i.e(700),i.e(518)]).then(i.bind(i,351))))}),(0,o.registerBlockComponent)({blockName:"woocommerce-germanized/product-tax-info",component:(0,n.lazy)((()=>Promise.all([i.e(700),i.e(297)]).then(i.bind(i,471))))}),(0,o.registerBlockComponent)({blockName:"woocommerce-germanized/product-shipping-costs-info",component:(0,n.lazy)((()=>Promise.all([i.e(700),i.e(648)]).then(i.bind(i,26))))}),(0,o.registerBlockComponent)({blockName:"woocommerce-germanized/product-unit-product",component:(0,n.lazy)((()=>Promise.all([i.e(700),i.e(6)]).then(i.bind(i,0))))}),(0,o.registerBlockComponent)({blockName:"woocommerce-germanized/product-nutri-score",component:(0,n.lazy)((()=>Promise.all([i.e(700),i.e(128)]).then(i.bind(i,744))))}),(0,o.registerBlockComponent)({blockName:"woocommerce-germanized/product-deposit",component:(0,n.lazy)((()=>Promise.all([i.e(700),i.e(412)]).then(i.bind(i,621))))}),(0,o.registerBlockComponent)({blockName:"woocommerce-germanized/product-deposit-packaging-type",component:(0,n.lazy)((()=>Promise.all([i.e(700),i.e(534)]).then(i.bind(i,775))))}),(0,o.registerBlockComponent)({blockName:"woocommerce-germanized/product-defect-description",component:(0,n.lazy)((()=>Promise.all([i.e(700),i.e(710)]).then(i.bind(i,575))))}),(0,o.registerBlockComponent)({blockName:"woocommerce-germanized/product-manufacturer",component:(0,n.lazy)((()=>Promise.all([i.e(700),i.e(284)]).then(i.bind(i,541))))}),(0,o.registerBlockComponent)({blockName:"woocommerce-germanized/product-safety-attachments",component:(0,n.lazy)((()=>Promise.all([i.e(700),i.e(545)]).then(i.bind(i,895))))}),(0,o.registerBlockComponent)({blockName:"woocommerce-germanized/product-safety-instructions",component:(0,n.lazy)((()=>Promise.all([i.e(700),i.e(202)]).then(i.bind(i,146))))})}(); \ No newline at end of file diff --git a/build/wc-gzd-blocks-product-elements-style.asset.php b/build/wc-gzd-blocks-product-elements-style.asset.php new file mode 100644 index 000000000..b0b406539 --- /dev/null +++ b/build/wc-gzd-blocks-product-elements-style.asset.php @@ -0,0 +1 @@ + array('react', 'wc-blocks-registry', 'wc-blocks-shared-context', 'wc-blocks-shared-hocs', 'wc-gzd-blocks-settings', 'wc-price-format', 'wp-block-editor', 'wp-blocks', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => '56b8551e5913e8aacf73'); diff --git a/build/wc-gzd-blocks-product-elements-style.js.LICENSE.txt b/build/wc-gzd-blocks-product-elements-style.js.LICENSE.txt new file mode 100644 index 000000000..0c20a875d --- /dev/null +++ b/build/wc-gzd-blocks-product-elements-style.js.LICENSE.txt @@ -0,0 +1,5 @@ +/*! + Copyright (c) 2018 Jed Watson. + Licensed under the MIT License (MIT), see + http://jedwatson.github.io/classnames +*/ diff --git a/build/wc-gzd-blocks-product-elements.asset.php b/build/wc-gzd-blocks-product-elements.asset.php new file mode 100644 index 000000000..b65aa78a9 --- /dev/null +++ b/build/wc-gzd-blocks-product-elements.asset.php @@ -0,0 +1 @@ + array('react', 'wc-blocks-registry', 'wc-blocks-shared-context', 'wc-blocks-shared-hocs', 'wc-gzd-blocks-settings', 'wc-price-format', 'wp-block-editor', 'wp-blocks', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => '96ea2112e9d603e4feef'); diff --git a/build/wc-gzd-blocks-product-elements.css b/build/wc-gzd-blocks-product-elements.css new file mode 100644 index 000000000..1114283cc --- /dev/null +++ b/build/wc-gzd-blocks-product-elements.css @@ -0,0 +1 @@ +.wc-gzd-block-components-product-price-label{display:block}.wc-gzd-block-components-product-price-label.wc-gzd-block-components-product-price-label--align-center{text-align:center}.wc-gzd-block-components-product-price-label.wc-gzd-block-components-product-price-label--align-right{text-align:right}.wc-gzd-block-components-product-deposit-packaging-type{text-transform:uppercase}.wc-gzd-block-components-product-nutri-score .wc-gzd-nutri-score-value{height:4rem;width:7.0625rem;display:block;text-indent:-9999px} diff --git a/build/wc-gzd-blocks-product-elements.js b/build/wc-gzd-blocks-product-elements.js new file mode 100644 index 000000000..daa3f9f4f --- /dev/null +++ b/build/wc-gzd-blocks-product-elements.js @@ -0,0 +1 @@ +!function(){var e,t,o={567:function(e,t,o){"use strict";var n=o(196),r=o(721),i=o(16);t.Z=e=>(e={...e,labelType:"defect-description"}).isDescendentOfSingleProductTemplate?(0,n.createElement)(i.Z,{...e}):(0,r.withProductDataContext)(i.Z)(e)},14:function(e,t,o){"use strict";var n=o(196),r=o(721),i=o(16);t.Z=e=>(e={...e,labelType:"delivery-time"}).isDescendentOfSingleProductTemplate?(0,n.createElement)(i.Z,{...e}):(0,r.withProductDataContext)(i.Z)(e)},369:function(e,t,o){"use strict";var n=o(196),r=o(721),i=o(16);t.Z=e=>(e={...e,labelType:"deposit-packaging-type"}).isDescendentOfSingleProductTemplate?(0,n.createElement)(i.Z,{...e}):(0,r.withProductDataContext)(i.Z)(e)},789:function(e,t,o){"use strict";var n=o(196),r=o(721),i=o(16);t.Z=e=>(e={...e,labelType:"deposit"}).isDescendentOfSingleProductTemplate?(0,n.createElement)(i.Z,{...e}):(0,r.withProductDataContext)(i.Z)(e)},971:function(e,t,o){"use strict";var n=o(196),r=o(721),i=o(16);t.Z=e=>(e={...e,labelType:"manufacturer"}).isDescendentOfSingleProductTemplate?(0,n.createElement)(i.Z,{...e}):(0,r.withProductDataContext)(i.Z)(e)},236:function(e,t,o){"use strict";var n=o(196),r=o(721),i=o(16);t.Z=e=>(e={...e,labelType:"nutri-score"}).isDescendentOfSingleProductTemplate?(0,n.createElement)(i.Z,{...e}):(0,r.withProductDataContext)(i.Z)(e)},629:function(e,t,o){"use strict";var n=o(196),r=o(721),i=o(16);t.Z=e=>(e={...e,labelType:"product_safety_attachments"}).isDescendentOfSingleProductTemplate?(0,n.createElement)(i.Z,{...e}):(0,r.withProductDataContext)(i.Z)(e)},162:function(e,t,o){"use strict";var n=o(196),r=o(721),i=o(16);t.Z=e=>(e={...e,labelType:"safety_instructions"}).isDescendentOfSingleProductTemplate?(0,n.createElement)(i.Z,{...e}):(0,r.withProductDataContext)(i.Z)(e)},16:function(e,t,o){"use strict";o.d(t,{Z:function(){return J}});var n=o(196),r=o.n(n),i=o(184),a=o.n(i),c=window.wc.priceFormat,s=window.wc.wcBlocksSharedContext,l=o(736);const u=e=>!(e=>null===e)(e)&&e instanceof Object&&e.constructor===Object,m=e=>"string"==typeof e;var p=function(){return p=Object.assign||function(e){for(var t,o=1,n=arguments.length;o{let o=e;return t.forEach((e=>{o=o?.[e]})),o};function S(e,t,o,n){const r=x(e,o);return r?[{selector:t?.selector,key:n,value:k(r)}]:[]}function E(e,t,o,n,r=["top","right","bottom","left"]){const i=x(e,o);if(!i)return[];const a=[];if("string"==typeof i)a.push({selector:t?.selector,key:n.default,value:i});else{const e=r.reduce(((e,o)=>{const r=k(x(i,[o]));return r&&e.push({selector:t?.selector,key:n?.individual.replace("%s",z(o)),value:r}),e}),[]);a.push(...e)}return a}function k(e){return"string"==typeof e&&e.startsWith(w)?`var(--wp--${e.slice(w.length).split(y).map((e=>v(e,{splitRegexp:[/([a-z0-9])([A-Z])/g,/([0-9])([a-z])/g,/([A-Za-z])([0-9])/g,/([A-Z])([A-Z][a-z])/g]}))).join(b)})`:e}function z(e){const[t,...o]=e;return t.toUpperCase()+o.join("")}function _(e){try{return decodeURI(e)}catch(t){return e}}function P(e){return(t,o)=>S(t,o,e,function(e){const[t,...o]=e;return t.toLowerCase()+o.map(z).join("")}(e))}function N(e){return(t,o)=>["color","style","width"].flatMap((n=>P(["border",e,n])(t,o)))}const C={name:"radius",generate:(e,t)=>E(e,t,["border","radius"],{default:"borderRadius",individual:"border%sRadius"},["topLeft","topRight","bottomLeft","bottomRight"])},T=[{name:"color",generate:P(["border","color"])},{name:"style",generate:P(["border","style"])},{name:"width",generate:P(["border","width"])},C,{name:"borderTop",generate:N("top")},{name:"borderRight",generate:N("right")},{name:"borderBottom",generate:N("bottom")},{name:"borderLeft",generate:N("left")},{name:"text",generate:(e,t)=>S(e,t,["color","text"],"color")},{name:"gradient",generate:(e,t)=>S(e,t,["color","gradient"],"background")},{name:"background",generate:(e,t)=>S(e,t,["color","background"],"backgroundColor")},{name:"minHeight",generate:(e,t)=>S(e,t,["dimensions","minHeight"],"minHeight")},{name:"color",generate:(e,t,o=["outline","color"],n="outlineColor")=>S(e,t,o,n)},{name:"style",generate:(e,t,o=["outline","style"],n="outlineStyle")=>S(e,t,o,n)},{name:"offset",generate:(e,t,o=["outline","offset"],n="outlineOffset")=>S(e,t,o,n)},{name:"width",generate:(e,t,o=["outline","width"],n="outlineWidth")=>S(e,t,o,n)},{name:"margin",generate:(e,t)=>E(e,t,["spacing","margin"],{default:"margin",individual:"margin%s"})},{name:"padding",generate:(e,t)=>E(e,t,["spacing","padding"],{default:"padding",individual:"padding%s"})},{name:"fontFamily",generate:(e,t)=>S(e,t,["typography","fontFamily"],"fontFamily")},{name:"fontSize",generate:(e,t)=>S(e,t,["typography","fontSize"],"fontSize")},{name:"fontStyle",generate:(e,t)=>S(e,t,["typography","fontStyle"],"fontStyle")},{name:"fontWeight",generate:(e,t)=>S(e,t,["typography","fontWeight"],"fontWeight")},{name:"letterSpacing",generate:(e,t)=>S(e,t,["typography","letterSpacing"],"letterSpacing")},{name:"lineHeight",generate:(e,t)=>S(e,t,["typography","lineHeight"],"lineHeight")},{name:"textColumns",generate:(e,t)=>S(e,t,["typography","textColumns"],"columnCount")},{name:"textDecoration",generate:(e,t)=>S(e,t,["typography","textDecoration"],"textDecoration")},{name:"textTransform",generate:(e,t)=>S(e,t,["typography","textTransform"],"textTransform")},{name:"writingMode",generate:(e,t)=>S(e,t,["typography","writingMode"],"writingMode")},{name:"shadow",generate:(e,t)=>S(e,t,["shadow"],"boxShadow")},{name:"backgroundImage",generate:(e,t)=>{const o=e?.background?.backgroundImage,n=e?.background?.backgroundSize,r=[];return o?("file"===o?.source&&o?.url&&r.push({selector:t.selector,key:"backgroundImage",value:`url( '${encodeURI(_(o.url))}' )`}),n||r.push({selector:t.selector,key:"backgroundSize",value:"cover"}),r):r}}];function D(e={}){const t={};return function(e,t={}){const o=[];return T.forEach((n=>{"function"==typeof n.generate&&o.push(...n.generate(e,t))})),o}(e,{selector:""}).forEach((e=>{t[e.key]=e.value})),t}function O(e,t){return e&&t?`has-${v(t)}-${e}`:""}const A=e=>{const t=(e=>{const t=u(e)?e:{style:{}};let o=t.style;return m(o)&&(o=JSON.parse(o)||{}),u(o)||(o={}),{...t,style:o}})(e),o=function(e){const{backgroundColor:t,textColor:o,gradient:n,style:r}=e,i=O("background-color",t),c=O("color",o),s=function(e){if(e)return`has-${e}-gradient-background`}(n),l=s||r?.color?.gradient;return{className:a()(c,s,{[i]:!l&&!!i,"has-text-color":o||r?.color?.text,"has-background":t||r?.color?.background||n||r?.color?.gradient,"has-link-color":u(r?.elements?.link)?r?.elements?.link?.color:void 0}),style:D({color:r?.color||{}})}}(t),n=function(e){const t=e.style?.border||{};return{className:function(e){const{borderColor:t,style:o}=e,n=t?O("border-color",t):"";return a()({"has-border-color":!!t||!!o?.border?.color,[n]:!!n})}(e),style:D({border:t})}}(t),r=function(e){return{className:void 0,style:D({spacing:e.style?.spacing||{}})}}(t),i=(e=>{const t=u(e.style.typography)?e.style.typography:{},o=m(t.fontFamily)?t.fontFamily:"";return{className:e.fontFamily?`has-${e.fontFamily}-font-family`:o,style:{fontSize:e.fontSize?`var(--wp--preset--font-size--${e.fontSize})`:t.fontSize,fontStyle:t.fontStyle,fontWeight:t.fontWeight,letterSpacing:t.letterSpacing,lineHeight:t.lineHeight,textDecoration:t.textDecoration,textTransform:t.textTransform}}})(t);return{className:a()(i.className,o.className,n.className,r.className),style:{...i.style,...o.style,...n.style,...r.style}}};function B(){}function F(e){return!!(e||"").match(/\d/)}function V(e){return null==e}function I(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function Z(e,t){void 0===t&&(t=!0);var o="-"===e[0],n=o&&t,r=(e=e.replace("-","")).split(".");return{beforeDecimal:r[0],afterDecimal:r[1]||"",hasNagation:o,addNegation:n}}function M(e,t,o){for(var n="",r=o?"0":"",i=0;i<=t-1;i++)n+=e[i]||r;return n}function H(e,t){return Array(t+1).join(e)}function R(e,t){if(e.value=e.value,null!==e){if(e.createTextRange){var o=e.createTextRange();return o.move("character",t),o.select(),!0}return e.selectionStart||0===e.selectionStart?(e.focus(),e.setSelectionRange(t,t),!0):(e.focus(),!1)}}function j(e,t,o){return Math.min(Math.max(e,t),o)}function q(e){return Math.max(e.selectionStart,e.selectionEnd)}var L={displayType:"input",decimalSeparator:".",thousandsGroupStyle:"thousand",fixedDecimalScale:!1,prefix:"",suffix:"",allowNegative:!0,allowEmptyFormatting:!1,allowLeadingZeros:!1,isNumericString:!1,type:"text",onValueChange:B,onChange:B,onKeyDown:B,onMouseUp:B,onFocus:B,onBlur:B,isAllowed:function(){return!0}},G=function(e){function t(t){e.call(this,t);var o=t.defaultValue;this.validateProps();var n=this.formatValueProp(o);this.state={value:n,numAsString:this.removeFormatting(n),mounted:!1},this.selectionBeforeInput={selectionStart:0,selectionEnd:0},this.onChange=this.onChange.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.onMouseUp=this.onMouseUp.bind(this),this.onFocus=this.onFocus.bind(this),this.onBlur=this.onBlur.bind(this)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.componentDidMount=function(){this.setState({mounted:!0})},t.prototype.componentDidUpdate=function(e){this.updateValueIfRequired(e)},t.prototype.componentWillUnmount=function(){clearTimeout(this.focusTimeout),clearTimeout(this.caretPositionTimeout)},t.prototype.updateValueIfRequired=function(e){var t=this,o=t.props,n=t.state,r=t.focusedElm,i=n.value,a=n.numAsString;if(void 0===a&&(a=""),e!==o){this.validateProps();var c=this.formatNumString(a),s=V(o.value)?c:this.formatValueProp(),l=this.removeFormatting(s),u=parseFloat(l),m=parseFloat(a);(isNaN(u)&&isNaN(m)||u===m)&&c===i&&(null!==r||s===i)||this.updateValue({formattedValue:s,numAsString:l,input:r,source:"prop",event:null})}},t.prototype.getFloatString=function(e){void 0===e&&(e="");var t=this.props.decimalScale,o=this.getSeparators().decimalSeparator,n=this.getNumberRegex(!0),r="-"===e[0];r&&(e=e.replace("-","")),o&&0===t&&(e=e.split(o)[0]);var i=(e=(e.match(n)||[]).join("").replace(o,".")).indexOf(".");return-1!==i&&(e=e.substring(0,i)+"."+e.substring(i+1,e.length).replace(new RegExp(I(o),"g"),"")),r&&(e="-"+e),e},t.prototype.getNumberRegex=function(e,t){var o=this.props,n=o.format,r=o.decimalScale,i=o.customNumerals,a=this.getSeparators().decimalSeparator;return new RegExp("[0-9"+(i?i.join(""):"")+"]"+(!a||0===r||t||n?"":"|"+I(a)),e?"g":void 0)},t.prototype.getSeparators=function(){var e=this.props.decimalSeparator,t=this.props,o=t.thousandSeparator,n=t.allowedDecimalSeparators;return!0===o&&(o=","),n||(n=[e,"."]),{decimalSeparator:e,thousandSeparator:o,allowedDecimalSeparators:n}},t.prototype.getMaskAtIndex=function(e){var t=this.props.mask;return void 0===t&&(t=" "),"string"==typeof t?t:t[e]||" "},t.prototype.getValueObject=function(e,t){var o=parseFloat(t);return{formattedValue:e,value:t,floatValue:isNaN(o)?void 0:o}},t.prototype.validateProps=function(){var e=this.props.mask,t=this.getSeparators(),o=t.decimalSeparator,n=t.thousandSeparator;if(o===n)throw new Error("\n Decimal separator can't be same as thousand separator.\n thousandSeparator: "+n+' (thousandSeparator = {true} is same as thousandSeparator = ",")\n decimalSeparator: '+o+" (default value for decimalSeparator is .)\n ");if(e&&("string"===e?e:e.toString()).match(/\d/g))throw new Error("\n Mask "+e+" should not contain numeric character;\n ")},t.prototype.setPatchedCaretPosition=function(e,t,o){R(e,t),this.caretPositionTimeout=setTimeout((function(){e.value===o&&R(e,t)}),0)},t.prototype.correctCaretPosition=function(e,t,o){var n=this.props,r=n.prefix,i=n.suffix,a=n.format;if(""===e)return 0;if(t=j(t,0,e.length),!a){var c="-"===e[0];return j(t,r.length+(c?1:0),e.length-i.length)}if("function"==typeof a)return t;if("#"===a[t]&&F(e[t]))return t;if("#"===a[t-1]&&F(e[t-1]))return t;var s=a.indexOf("#");t=j(t,s,a.lastIndexOf("#")+1);for(var l=a.substring(t,a.length).indexOf("#"),u=t,m=t+(-1===l?0:l);u>s&&("#"!==a[u]||!F(e[u]));)u-=1;return!F(e[m])||"left"===o&&t!==s||t-u=a?n+=H("0",i-a):n=(n.substring(0,i)||"0")+"."+n.substring(i),t+n}(c),s=!0),"Infinity"===c&&s&&(c=""),s&&!o&&"number"==typeof n&&(c=function(e,t,o){if(-1!==["","-"].indexOf(e))return e;var n=-1!==e.indexOf(".")&&t,r=Z(e),i=r.beforeDecimal,a=r.afterDecimal,c=r.hasNagation,s=parseFloat("0."+(a||"0")),l=(a.length<=t?"0."+a:s.toFixed(t)).split(".");return(c?"-":"")+i.split("").reverse().reduce((function(e,t,o){return e.length>o?(Number(e[0])+Number(t)).toString()+e.substring(1,e.length):t+e}),l[0])+(n?".":"")+M(l[1]||"",Math.min(t,a.length),o)}(c,n,r)),s?this.formatNumString(c):this.formatInput(c))},t.prototype.formatNegation=function(e){void 0===e&&(e="");var t=this.props.allowNegative,o=new RegExp("(-)"),n=new RegExp("(-)(.)*(-)"),r=o.test(e),i=n.test(e);return e=e.replace(/-/g,""),r&&!i&&t&&(e="-"+e),e},t.prototype.formatInput=function(e){return void 0===e&&(e=""),this.props.format||(e=this.removePrefixAndSuffix(e),e=this.formatNegation(e)),e=this.removeFormatting(e),this.formatNumString(e)},t.prototype.isCharacterAFormat=function(e,t){var o=this.props,n=o.format,r=o.prefix,i=o.suffix,a=o.decimalScale,c=o.fixedDecimalScale,s=this.getSeparators().decimalSeparator;return"string"==typeof n&&"#"!==n[e]||!(n||!(e=t.length-i.length||a&&c&&t[e]===s))},t.prototype.correctInputValue=function(e,t,o){var n=this,r=this.props,i=r.format,a=r.allowNegative,c=r.prefix,s=r.suffix,l=r.decimalScale,u=this.getSeparators(),m=u.allowedDecimalSeparators,p=u.decimalSeparator,d=this.state.numAsString||"",g=this.selectionBeforeInput,f=g.selectionStart,h=g.selectionEnd,v=function(e,t){for(var o=0,n=0,r=e.length,i=t.length;e[o]===t[o]&&oo&&r-n>o;)n++;return{start:o,end:r-n}}(t,o),w=v.start,y=v.end;if(!i&&w===y&&-1!==m.indexOf(o[f])){var b=0===l?"":p;return o.substr(0,f)+b+o.substr(f+1,o.length)}var x=i?0:c.length,S=t.length-(i?0:s.length);if(o.length>t.length||!o.length||w===y||0===f&&h===t.length||0===w&&y===t.length||f===x&&h===S)return o;var E=t.substr(w,y-w);if([].concat(E).find((function(e,o){return n.isCharacterAFormat(o+w,t)}))){var k=t.substr(w),z={},_=[];[].concat(k).forEach((function(e,o){n.isCharacterAFormat(o+w,t)?z[o]=e:o>E.length-1&&_.push(e)})),Object.keys(z).forEach((function(e){_.length>e?_.splice(e,0,z[e]):_.push(z[e])})),o=t.substr(0,w)+_.join("")}if(!i){var P=this.removeFormatting(o),N=Z(P,a),C=N.beforeDecimal,T=N.afterDecimal,D=N.addNegation,O=ey;)w--;w=this.correctCaretPosition(a,w,"left")}}else for(;!f.test(a[w])&&wb)&&(e.preventDefault(),this.setPatchedCaretPosition(o,w,a)),e.isUnitTestRun&&this.setPatchedCaretPosition(o,w,a),d(e)}else d(e)},t.prototype.onMouseUp=function(e){var t=e.target,o=t.selectionStart,n=t.selectionEnd,r=t.value;if(void 0===r&&(r=""),o===n){var i=this.correctCaretPosition(r,o);i!==o&&this.setPatchedCaretPosition(t,i,r)}this.props.onMouseUp(e)},t.prototype.onFocus=function(e){var t=this;e.persist(),this.focusedElm=e.target,this.focusTimeout=setTimeout((function(){var o=e.target,n=o.selectionStart,r=o.selectionEnd,i=o.value;void 0===i&&(i="");var a=t.correctCaretPosition(i,n);a===n||0===n&&r===i.length||t.setPatchedCaretPosition(o,a,i),t.props.onFocus(e)}),0)},t.prototype.render=function(){var e=this.props,t=e.type,o=e.displayType,n=e.customInput,i=e.renderText,a=e.getInputRef,c=e.format,s=(e.thousandSeparator,e.decimalSeparator,e.allowedDecimalSeparators,e.thousandsGroupStyle,e.decimalScale,e.fixedDecimalScale,e.prefix,e.suffix,e.removeFormatting,e.mask,e.defaultValue,e.isNumericString,e.allowNegative,e.allowEmptyFormatting,e.allowLeadingZeros,e.onValueChange,e.isAllowed,e.customNumerals,e.onChange,e.onKeyDown,e.onMouseUp,e.onFocus,e.onBlur,e.value,function(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&-1===t.indexOf(n)&&(o[n]=e[n]);return o}(e,["type","displayType","customInput","renderText","getInputRef","format","thousandSeparator","decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","decimalScale","fixedDecimalScale","prefix","suffix","removeFormatting","mask","defaultValue","isNumericString","allowNegative","allowEmptyFormatting","allowLeadingZeros","onValueChange","isAllowed","customNumerals","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value"])),l=this.state,u=l.value,m=l.mounted&&function(e){return e||"undefined"!=typeof navigator&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}(c)?"numeric":void 0,p=Object.assign({inputMode:m},s,{type:t,value:u,onChange:this.onChange,onKeyDown:this.onKeyDown,onMouseUp:this.onMouseUp,onFocus:this.onFocus,onBlur:this.onBlur});if("text"===o)return i?i(u,s)||null:r().createElement("span",Object.assign({},s,{ref:a}),u);if(n){var d=n;return r().createElement(d,Object.assign({},p,{ref:a}))}return r().createElement("input",Object.assign({},p,{ref:a}))},t}(r().Component);G.defaultProps=L;var U=G;const $=e=>({thousandSeparator:e?.thousandSeparator,decimalSeparator:e?.decimalSeparator,fixedDecimalScale:!0,prefix:e?.prefix,suffix:e?.suffix,isNumericString:!0});var Q=({className:e,value:t,currency:o,onValueChange:r,displayType:i="text",...c})=>{var s;const l="string"==typeof t?parseInt(t,10):t;if(!Number.isFinite(l))return null;const u=l/10**o.minorUnit;if(!Number.isFinite(u))return null;const m=a()("wc-block-formatted-money-amount","wc-block-components-formatted-money-amount",e),p=null!==(s=c.decimalScale)&&void 0!==s?s:o?.minorUnit,d={...c,...$(o),decimalScale:p,value:void 0,currency:void 0,onValueChange:void 0},g=r?e=>{const t=+e.value*10**o.minorUnit;r(t)}:()=>{};return(0,n.createElement)(U,{className:m,displayType:i,...d,value:u,onValueChange:g})},W=o(307),K=({align:e,className:t,labelType:o,formattedLabel:r,labelClassName:i,labelStyle:c,style:s})=>{const l=a()(t,"wc-gzd-block-components-product-"+o,"wc-gzd-block-components-product-price-label",{[`wc-gzd-block-components-product-price-label--align-${e}`]:e});let u=(0,n.createElement)("span",{className:a()("wc-gzd-block-components-product-"+o+"__value",i)});return r&&(u=(0,W.isValidElement)(r)?(0,n.createElement)("span",{className:a()("wc-gzd-block-components-product-"+o+"__value",i),style:c},r):(0,n.createElement)("span",{className:a()("wc-gzd-block-components-product-"+o+"__value",i),style:c,dangerouslySetInnerHTML:{__html:r}})),(0,n.createElement)("span",{className:l,style:s},u)},J=e=>{const{className:t,textAlign:o,isDescendentOfSingleProductTemplate:r,labelType:i}=e,{parentName:u,parentClassName:m}=(0,s.useInnerBlockLayoutContext)(),{product:p}=(0,s.useProductDataContext)(),d=A(e),g="woocommerce/all-products"===u,f=a()("wc-gzd-block-components-product-"+i,t,d.className,{[`${m}__product-${i}`]:m});if(!p.id&&!r){const e=(0,n.createElement)(K,{align:o,className:f,labelType:i});if(g){const t=`wp-block-woocommerce-gzd-product-${i}`;return(0,n.createElement)("div",{className:t},e)}return e}const h=((e,t,o)=>{const r=t.hasOwnProperty("extensions")?t.extensions["woocommerce-germanized"]:{unit_price_html:"",unit_prices:{price:0,regular_price:0,sale_price:0},unit_product:0,unit_product_html:"",delivery_time_html:"",tax_info_html:"",shipping_costs_info_html:"",defect_description_html:"",nutri_score:"",nutri_score_html:"",deposit_html:"",deposit_prices:{price:0,quantity:0,amount:0},deposit_packaging_type_html:"",manufacturer_html:"",product_safety_attachments_html:"",safety_instructions_html:""},i=t.prices,a=o?(0,c.getCurrencyFromPriceResponse)():(0,c.getCurrencyFromPriceResponse)(i),s=e.replace(/-/g,"_"),u=r.hasOwnProperty(s+"_html")?r[s+"_html"]:"";let m="";return"unit_price"===s?m=(0,n.createElement)(n.Fragment,null,(0,n.createElement)(Q,{currency:a,value:1e3})," / ",(0,n.createElement)("span",{className:"unit"},(0,l._x)("kg","unit","woocommerce-germanized"))):"delivery_time"===s?m=(0,l._x)("Delivery time: 2-3 days","preview","woocommerce-germanized"):"tax_info"===s?m=(0,l._x)("incl. 19 % VAT","preview","woocommerce-germanized"):"shipping_costs_info"===s?m=(0,l._x)("plus shipping costs","preview","woocommerce-germanized"):"unit_product"===s?m=(0,l.sprintf)((0,l._x)("Product includes: %1$s kg","preview","woocommerce-germanized"),10):"defect_description"===s?m=(0,l._x)("This product has a serious defect.","preview","woocommerce-germanized"):"deposit"===s?m=(0,n.createElement)(n.Fragment,null,(0,n.createElement)("span",{className:"additional"},(0,l._x)("Plus","preview","woocommerce-germanized"))," ",(0,n.createElement)(Q,{currency:a,value:40})," ",(0,n.createElement)("span",{className:"deposit-notice"},(0,l._x)("deposit","preview","woocommerce-germanized"))):"deposit_packaging_type"===s?m=(0,l._x)("Disposable","preview","woocommerce-germanized"):"nutri_score"===s?m=(0,n.createElement)(n.Fragment,null,(0,n.createElement)("span",{className:"wc-gzd-nutri-score-value wc-gzd-nutri-score-value-a"},"A")):"manufacturer"===s?m=(0,n.createElement)(n.Fragment,null,(0,n.createElement)("p",null,(0,n.createElement)("stong",null,(0,l._x)("Sample company name","preview","woocommerce-germanized")),(0,n.createElement)("br",null),(0,l._x)("Sample address","preview","woocommerce-germanized"),(0,n.createElement)("br",null),(0,l._x)("12345 Berlin","preview","woocommerce-germanized"),(0,n.createElement)("br",null),(0,l._x)("sample@sample.com","preview","woocommerce-germanized")),(0,n.createElement)("h3",null,(0,l.__)("Person responsible for the EU","woocommerce-germanized")),(0,n.createElement)("p",null,(0,n.createElement)("stong",null,(0,l._x)("Sample company name","preview","woocommerce-germanized")),(0,n.createElement)("br",null),(0,l._x)("Sample address","preview","woocommerce-germanized"),(0,n.createElement)("br",null),(0,l._x)("12345 Berlin","preview","woocommerce-germanized"),(0,n.createElement)("br",null),(0,l._x)("sample@sample.com","preview","woocommerce-germanized"))):"product_safety_attachments"===s?m=(0,n.createElement)(n.Fragment,null,(0,n.createElement)("ul",null,(0,n.createElement)("li",null,(0,n.createElement)("a",{href:"#"},(0,l._x)("sample-filename.pdf","sample","woocommerce-germanized"))))):"safety_instructions"===s&&(m=(0,n.createElement)(n.Fragment,null,(0,n.createElement)("p",null,(0,l._x)("Sample safety instructions for a certain product.","preview","woocommerce-germanized"),(0,n.createElement)("br",null)))),{preview:m,data:u}})(i,p,r),v=(0,n.createElement)(K,{align:o,className:f,labelType:i,style:d.style,labelStyle:d.style,formattedLabel:r?h.preview:h.data});if(g){const e=`wp-block-woocommerce-gzd-product-${i}`;return(0,n.createElement)("div",{className:e},v)}return v}},38:function(e,t,o){"use strict";var n=o(196),r=o(721),i=o(16);t.Z=e=>(e={...e,labelType:"shipping-costs-info"}).isDescendentOfSingleProductTemplate?(0,n.createElement)(i.Z,{...e}):(0,r.withProductDataContext)(i.Z)(e)},479:function(e,t,o){"use strict";var n=o(196),r=o(721),i=o(16);t.Z=e=>(e={...e,labelType:"tax-info"}).isDescendentOfSingleProductTemplate?(0,n.createElement)(i.Z,{...e}):(0,r.withProductDataContext)(i.Z)(e)},663:function(e,t,o){"use strict";var n=o(196),r=o(721),i=o(16);t.Z=e=>(e={...e,labelType:"unit-price"}).isDescendentOfSingleProductTemplate?(0,n.createElement)(i.Z,{...e}):(0,r.withProductDataContext)(i.Z)(e)},140:function(e,t,o){"use strict";var n=o(196),r=o(721),i=o(16);t.Z=e=>(e={...e,labelType:"unit-product"}).isDescendentOfSingleProductTemplate?(0,n.createElement)(i.Z,{...e}):(0,r.withProductDataContext)(i.Z)(e)},184:function(e,t){var o;!function(){"use strict";var n={}.hasOwnProperty;function r(){for(var e=[],t=0;t-1&&!e;)e=o[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r.p=e}(),function(){var e={132:0};r.f.j=function(t,o){var n=r.o(e,t)?e[t]:void 0;if(0!==n)if(n)o.push(n[2]);else{var i=new Promise((function(o,r){n=e[t]=[o,r]}));o.push(n[2]=i);var a=r.p+r.u(t),c=new Error;r.l(a,(function(o){if(r.o(e,t)&&(0!==(n=e[t])&&(e[t]=void 0),n)){var i=o&&("load"===o.type?"missing":o.type),a=o&&o.target&&o.target.src;c.message="Loading chunk "+t+" failed.\n("+i+": "+a+")",c.name="ChunkLoadError",c.type=i,c.request=a,n[1](c)}}),"chunk-"+t,t)}};var t=function(t,o){var n,i,a=o[0],c=o[1],s=o[2],l=0;if(a.some((function(t){return 0!==e[t]}))){for(n in c)r.o(c,n)&&(r.m[n]=c[n]);s&&s(r)}for(t&&t(o);lt.isDescendentOfQueryLoop||t.isDescendentOfSingleProductBlock||t.isDescendentOfSingleProductTemplate?null:(0,e.createElement)("div",{className:p()("is-loading",t.className)})},g=r(663),f=window.wp.data;const h=()=>({isDescendentOfSingleProductTemplate:(0,f.useSelect)((e=>{const t=e("core/edit-site"),o=t?.getEditedPostId();return Boolean(o?.includes("//single-product"))}),[])});const{ancestor:v,...w}=d,y={...w,apiVersion:2,title:(0,s.__)("Unit Price","woocommerce-germanized"),description:(0,s.__)("Inserts the product's price per unit.","woocommerce-germanized"),usesContext:["query","queryId","postId"],icon:{src:(0,e.createElement)(n,{icon:c,className:"wc-block-editor-components-block-icon"})},supports:{...d.supports,__experimentalSelector:".wp-block-woocommerce-gzd-product-unit-price .wc-gzd-block-components-product-unit-price"},edit:({attributes:t,setAttributes:n,context:r})=>{const i=(0,u.useBlockProps)(),a={...t,...r},c=Number.isFinite(r.queryId);let{isDescendentOfSingleProductTemplate:s}=h();return c&&(s=!1),(0,o.useEffect)((()=>n({isDescendentOfQueryLoop:c,isDescendentOfSingleProductTemplate:s})),[c,s,n]),(0,e.createElement)(e.Fragment,null,(0,e.createElement)(u.BlockControls,null,(0,e.createElement)(u.AlignmentToolbar,{value:t.textAlign,onChange:e=>{n({textAlign:e})}})),(0,e.createElement)("div",{...i},(0,e.createElement)(g.Z,{...a})))}};(0,t.registerBlockType)("woocommerce-germanized/product-unit-price",y);var b=(0,o.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(a.Path,{d:"M11.696 13.972c.356-.546.599-.958.728-1.235a1.79 1.79 0 00.203-.783c0-.264-.077-.47-.23-.618-.148-.153-.354-.23-.618-.23-.295 0-.569.07-.82.212a3.413 3.413 0 00-.738.571l-.147-1.188c.289-.234.59-.41.903-.526.313-.117.66-.175 1.041-.175.375 0 .695.08.959.24.264.153.46.362.59.626.135.265.203.556.203.876 0 .362-.08.734-.24 1.115-.154.381-.427.87-.82 1.466l-.756 1.152H14v1.106h-4l1.696-2.609z"}),(0,o.createElement)(a.Path,{d:"M19.5 7h-15v12a.5.5 0 00.5.5h14a.5.5 0 00.5-.5V7zM3 7V5a2 2 0 012-2h14a2 2 0 012 2v14a2 2 0 01-2 2H5a2 2 0 01-2-2V7z"})),x=r(14);const{ancestor:S,...E}=d,k={...E,apiVersion:2,title:(0,s.__)("Delivery Time","woocommerce-germanized"),description:(0,s.__)("Inserts the product's delivery time.","woocommerce-germanized"),usesContext:["query","queryId","postId"],icon:{src:(0,e.createElement)(n,{icon:b,className:"wc-block-editor-components-block-icon"})},supports:{...d.supports,__experimentalSelector:".wp-block-woocommerce-gzd-product-delivery-time .wc-gzd-block-components-product-delivery-time"},edit:({attributes:t,setAttributes:n,context:r})=>{const i=(0,u.useBlockProps)(),a={...t,...r},c=Number.isFinite(r.queryId);let{isDescendentOfSingleProductTemplate:s}=h();return c&&(s=!1),(0,o.useEffect)((()=>n({isDescendentOfQueryLoop:c,isDescendentOfSingleProductTemplate:s})),[c,s,n]),(0,e.createElement)(e.Fragment,null,(0,e.createElement)(u.BlockControls,null,(0,e.createElement)(u.AlignmentToolbar,{value:t.textAlign,onChange:e=>{n({textAlign:e})}})),(0,e.createElement)("div",{...i},(0,e.createElement)(x.Z,{...a})))}};(0,t.registerBlockType)("woocommerce-germanized/product-delivery-time",k);var z=(0,o.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(a.Path,{d:"M12 3.176l6.75 3.068v4.574c0 3.9-2.504 7.59-6.035 8.755a2.283 2.283 0 01-1.43 0c-3.53-1.164-6.035-4.856-6.035-8.755V6.244L12 3.176zM6.75 7.21v3.608c0 3.313 2.145 6.388 5.005 7.33.159.053.331.053.49 0 2.86-.942 5.005-4.017 5.005-7.33V7.21L12 4.824 6.75 7.21z",fillRule:"evenodd",clipRule:"evenodd"})),_=r(479);const{ancestor:P,...N}=d,C={...N,apiVersion:2,title:(0,s.__)("Tax Notice","woocommerce-germanized"),description:(0,s.__)("Inserts the product's tax notice.","woocommerce-germanized"),usesContext:["query","queryId","postId"],icon:{src:(0,e.createElement)(n,{icon:z,className:"wc-block-editor-components-block-icon"})},supports:{...d.supports,__experimentalSelector:".wp-block-woocommerce-gzd-product-tax-info .wc-gzd-block-components-product-tax-info"},edit:({attributes:t,setAttributes:n,context:r})=>{const i=(0,u.useBlockProps)(),a={...t,...r},c=Number.isFinite(r.queryId);let{isDescendentOfSingleProductTemplate:s}=h();return c&&(s=!1),(0,o.useEffect)((()=>n({isDescendentOfQueryLoop:c,isDescendentOfSingleProductTemplate:s})),[c,s,n]),(0,e.createElement)(e.Fragment,null,(0,e.createElement)(u.BlockControls,null,(0,e.createElement)(u.AlignmentToolbar,{value:t.textAlign,onChange:e=>{n({textAlign:e})}})),(0,e.createElement)("div",{...i},(0,e.createElement)(_.Z,{...a})))}};(0,t.registerBlockType)("woocommerce-germanized/product-tax-info",C);var T=(0,o.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(a.Path,{d:"M3 6.75C3 5.784 3.784 5 4.75 5H15V7.313l.05.027 5.056 2.73.394.212v3.468a1.75 1.75 0 01-1.75 1.75h-.012a2.5 2.5 0 11-4.975 0H9.737a2.5 2.5 0 11-4.975 0H3V6.75zM13.5 14V6.5H4.75a.25.25 0 00-.25.25V14h.965a2.493 2.493 0 011.785-.75c.7 0 1.332.287 1.785.75H13.5zm4.535 0h.715a.25.25 0 00.25-.25v-2.573l-4-2.16v4.568a2.487 2.487 0 011.25-.335c.7 0 1.332.287 1.785.75zM6.282 15.5a1.002 1.002 0 00.968 1.25 1 1 0 10-.968-1.25zm9 0a1 1 0 101.937.498 1 1 0 00-1.938-.498z"})),D=r(38);const{ancestor:O,...A}=d,B={...A,apiVersion:2,title:(0,s.__)("Shipping Costs Notice","woocommerce-germanized"),description:(0,s.__)("Inserts the product's shipping costs notice.","woocommerce-germanized"),usesContext:["query","queryId","postId"],icon:{src:(0,e.createElement)(n,{icon:T,className:"wc-block-editor-components-block-icon"})},supports:{...d.supports,__experimentalSelector:".wp-block-woocommerce-gzd-product-shipping-costs-info .wc-gzd-block-components-product-shipping-costs-info"},edit:({attributes:t,setAttributes:n,context:r})=>{const i=(0,u.useBlockProps)(),a={...t,...r},c=Number.isFinite(r.queryId);let{isDescendentOfSingleProductTemplate:s}=h();return c&&(s=!1),(0,o.useEffect)((()=>n({isDescendentOfQueryLoop:c,isDescendentOfSingleProductTemplate:s})),[c,s,n]),(0,e.createElement)(e.Fragment,null,(0,e.createElement)(u.BlockControls,null,(0,e.createElement)(u.AlignmentToolbar,{value:t.textAlign,onChange:e=>{n({textAlign:e})}})),(0,e.createElement)("div",{...i},(0,e.createElement)(D.Z,{...a})))}};(0,t.registerBlockType)("woocommerce-germanized/product-shipping-costs-info",B);var F=(0,o.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(a.Path,{d:"M12 3.2c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8 0-4.8-4-8.8-8.8-8.8zm0 16c-4 0-7.2-3.3-7.2-7.2C4.8 8 8 4.8 12 4.8s7.2 3.3 7.2 7.2c0 4-3.2 7.2-7.2 7.2zM11 17h2v-6h-2v6zm0-8h2V7h-2v2z"})),V=r(140);const{ancestor:I,...Z}=d,M={...Z,apiVersion:2,title:(0,s.__)("Unit products","woocommerce-germanized"),description:(0,s.__)("Inserts the product's units.","woocommerce-germanized"),usesContext:["query","queryId","postId"],icon:{src:(0,e.createElement)(n,{icon:F,className:"wc-block-editor-components-block-icon"})},supports:{...d.supports,__experimentalSelector:".wp-block-woocommerce-gzd-product-unit-product .wc-gzd-block-components-product-unit-product"},edit:({attributes:t,setAttributes:n,context:r})=>{const i=(0,u.useBlockProps)(),a={...t,...r},c=Number.isFinite(r.queryId);let{isDescendentOfSingleProductTemplate:s}=h();return c&&(s=!1),(0,o.useEffect)((()=>n({isDescendentOfQueryLoop:c,isDescendentOfSingleProductTemplate:s})),[c,s,n]),(0,e.createElement)(e.Fragment,null,(0,e.createElement)(u.BlockControls,null,(0,e.createElement)(u.AlignmentToolbar,{value:t.textAlign,onChange:e=>{n({textAlign:e})}})),(0,e.createElement)("div",{...i},(0,e.createElement)(V.Z,{...a})))}};(0,t.registerBlockType)("woocommerce-germanized/product-unit-product",M);var H=(0,o.createElement)(a.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,o.createElement)(a.Path,{d:"M19 6.5H5c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-7c0-1.1-.9-2-2-2zm.5 9c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-7c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v7zM8 12.8h8v-1.5H8v1.5z"})),R=window.wcGzd.blocks.wcGzdBlocksSettings,j=r(236);const{ancestor:q,...L}=d,G={...L,apiVersion:2,title:(0,s.__)("Nutri-Score","woocommerce-germanized")+((0,R.getSetting)("isPro")?"":" (Pro)"),description:(0,s.__)("Inserts the product's Nutri-Score.","woocommerce-germanized"),usesContext:["query","queryId","postId"],icon:{src:(0,e.createElement)(n,{icon:H,className:"wc-block-editor-components-block-icon"})},supports:{...d.supports,__experimentalSelector:".wp-block-woocommerce-gzd-product-nutri-score .wc-gzd-block-components-product-nutri-score"},edit:({attributes:t,setAttributes:n,context:r})=>{const i=(0,u.useBlockProps)(),a={...t,...r},c=Number.isFinite(r.queryId);let{isDescendentOfSingleProductTemplate:s}=h();return c&&(s=!1),(0,o.useEffect)((()=>n({isDescendentOfQueryLoop:c,isDescendentOfSingleProductTemplate:s})),[c,s,n]),(0,e.createElement)(e.Fragment,null,(0,e.createElement)(u.BlockControls,null,(0,e.createElement)(u.AlignmentToolbar,{value:t.textAlign,onChange:e=>{n({textAlign:e})}})),(0,e.createElement)("div",{...i},(0,e.createElement)(j.Z,{...a})))}};(0,t.registerBlockType)("woocommerce-germanized/product-nutri-score",G);var U=r(789);const{ancestor:$,...Q}=d,W={...Q,apiVersion:2,title:(0,s.__)("Deposit amount","woocommerce-germanized")+((0,R.getSetting)("isPro")?"":" (Pro)"),description:(0,s.__)("Inserts the product's deposit amount.","woocommerce-germanized"),usesContext:["query","queryId","postId"],icon:{src:(0,e.createElement)(n,{icon:c,className:"wc-block-editor-components-block-icon"})},supports:{...d.supports,__experimentalSelector:".wp-block-woocommerce-gzd-product-deposit .wc-gzd-block-components-product-deposit"},edit:({attributes:t,setAttributes:n,context:r})=>{const i=(0,u.useBlockProps)(),a={...t,...r},c=Number.isFinite(r.queryId);let{isDescendentOfSingleProductTemplate:s}=h();return c&&(s=!1),(0,o.useEffect)((()=>n({isDescendentOfQueryLoop:c,isDescendentOfSingleProductTemplate:s})),[c,s,n]),(0,e.createElement)(e.Fragment,null,(0,e.createElement)(u.BlockControls,null,(0,e.createElement)(u.AlignmentToolbar,{value:t.textAlign,onChange:e=>{n({textAlign:e})}})),(0,e.createElement)("div",{...i},(0,e.createElement)(U.Z,{...a})))}};(0,t.registerBlockType)("woocommerce-germanized/product-deposit",W);var K=r(369);const{ancestor:J,...X}=d,Y={...X,apiVersion:2,title:(0,s.__)("Deposit packaging type","woocommerce-germanized")+((0,R.getSetting)("isPro")?"":" (Pro)"),description:(0,s.__)("Inserts the product's deposit packaging type.","woocommerce-germanized"),usesContext:["query","queryId","postId"],icon:{src:(0,e.createElement)(n,{icon:F,className:"wc-block-editor-components-block-icon"})},supports:{...d.supports,__experimentalSelector:".wp-block-woocommerce-gzd-product-deposit-packaging-type .wc-gzd-block-components-product-deposit-packaging-type"},edit:({attributes:t,setAttributes:n,context:r})=>{const i=(0,u.useBlockProps)(),a={...t,...r},c=Number.isFinite(r.queryId);let{isDescendentOfSingleProductTemplate:s}=h();return c&&(s=!1),(0,o.useEffect)((()=>n({isDescendentOfQueryLoop:c,isDescendentOfSingleProductTemplate:s})),[c,s,n]),(0,e.createElement)(e.Fragment,null,(0,e.createElement)(u.BlockControls,null,(0,e.createElement)(u.AlignmentToolbar,{value:t.textAlign,onChange:e=>{n({textAlign:e})}})),(0,e.createElement)("div",{...i},(0,e.createElement)(K.Z,{...a})))}};(0,t.registerBlockType)("woocommerce-germanized/product-deposit-packaging-type",Y);var ee=(0,o.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(a.Path,{d:"M7 5.5h10a.5.5 0 01.5.5v12a.5.5 0 01-.5.5H7a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM17 4H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V6a2 2 0 00-2-2zm-1 3.75H8v1.5h8v-1.5zM8 11h8v1.5H8V11zm6 3.25H8v1.5h6v-1.5z"})),te=r(567);const{ancestor:oe,...ne}=d,re={...ne,apiVersion:2,title:(0,s.__)("Defect Description","woocommerce-germanized"),description:(0,s.__)("Inserts the product's defect description.","woocommerce-germanized"),usesContext:["query","queryId","postId"],icon:{src:(0,e.createElement)(n,{icon:ee,className:"wc-block-editor-components-block-icon"})},supports:{...d.supports,__experimentalSelector:".wp-block-woocommerce-gzd-product-defect-description .wc-gzd-block-components-product-defect-description"},edit:({attributes:t,setAttributes:n,context:r})=>{const i=(0,u.useBlockProps)(),a={...t,...r},c=Number.isFinite(r.queryId);let{isDescendentOfSingleProductTemplate:s}=h();return c&&(s=!1),(0,o.useEffect)((()=>n({isDescendentOfQueryLoop:c,isDescendentOfSingleProductTemplate:s})),[c,s,n]),(0,e.createElement)(e.Fragment,null,(0,e.createElement)(u.BlockControls,null,(0,e.createElement)(u.AlignmentToolbar,{value:t.textAlign,onChange:e=>{n({textAlign:e})}})),(0,e.createElement)("div",{...i},(0,e.createElement)(te.Z,{...a})))}};(0,t.registerBlockType)("woocommerce-germanized/product-defect-description",re);var ie=(0,o.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(a.Path,{fillRule:"evenodd",d:"M19.75 11H21V8.667L19.875 4H4.125L3 8.667V11h1.25v8.75h15.5V11zm-1.5 0H5.75v7.25H10V13h4v5.25h4.25V11zm-5.5-5.5h2.067l.486 3.24.028.76H12.75v-4zm-3.567 0h2.067v4H8.669l.028-.76.486-3.24zm7.615 3.1l-.464-3.1h2.36l.806 3.345V9.5h-2.668l-.034-.9zM7.666 5.5h-2.36L4.5 8.845V9.5h2.668l.034-.9.464-3.1z",clipRule:"evenodd"})),ae=r(971);const{ancestor:ce,...se}=d,le={...se,apiVersion:2,title:(0,s.__)("Manufacturer","woocommerce-germanized")+((0,R.getSetting)("isPro")?"":" (Pro)"),description:(0,s.__)("Inserts the product's manufacturer information.","woocommerce-germanized"),usesContext:["query","queryId","postId"],icon:{src:(0,e.createElement)(n,{icon:ie,className:"wc-block-editor-components-block-icon"})},supports:{...d.supports,__experimentalSelector:".wp-block-woocommerce-gzd-product-manufacturer .wc-gzd-block-components-product-manufacturer"},edit:({attributes:t,setAttributes:n,context:r})=>{const i=(0,u.useBlockProps)(),a={...t,...r},c=Number.isFinite(r.queryId);let{isDescendentOfSingleProductTemplate:s}=h();return c&&(s=!1),(0,o.useEffect)((()=>n({isDescendentOfQueryLoop:c,isDescendentOfSingleProductTemplate:s})),[c,s,n]),(0,e.createElement)(e.Fragment,null,(0,e.createElement)(u.BlockControls,null,(0,e.createElement)(u.AlignmentToolbar,{value:t.textAlign,onChange:e=>{n({textAlign:e})}})),(0,e.createElement)("div",{...i},(0,e.createElement)(ae.Z,{...a})))}};(0,t.registerBlockType)("woocommerce-germanized/product-manufacturer",le);var ue=(0,o.createElement)(a.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,o.createElement)(a.Path,{d:"M19 6.2h-5.9l-.6-1.1c-.3-.7-1-1.1-1.8-1.1H5c-1.1 0-2 .9-2 2v11.8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V8.2c0-1.1-.9-2-2-2zm.5 11.6c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h5.8c.2 0 .4.1.4.3l1 2H19c.3 0 .5.2.5.5v9.5z"})),me=r(629);const{ancestor:pe,...de}=d,ge={...de,apiVersion:2,title:(0,s.__)("Product safety attachments","woocommerce-germanized")+((0,R.getSetting)("isPro")?"":" (Pro)"),description:(0,s.__)("Inserts the product's safety attachments list.","woocommerce-germanized"),usesContext:["query","queryId","postId"],icon:{src:(0,e.createElement)(n,{icon:ue,className:"wc-block-editor-components-block-icon"})},supports:{...d.supports,__experimentalSelector:".wp-block-woocommerce-gzd-product-safety-attachments .wc-gzd-block-components-product-safety-attachments"},edit:({attributes:t,setAttributes:n,context:r})=>{const i=(0,u.useBlockProps)(),a={...t,...r},c=Number.isFinite(r.queryId);let{isDescendentOfSingleProductTemplate:s}=h();return c&&(s=!1),(0,o.useEffect)((()=>n({isDescendentOfQueryLoop:c,isDescendentOfSingleProductTemplate:s})),[c,s,n]),(0,e.createElement)(e.Fragment,null,(0,e.createElement)(u.BlockControls,null,(0,e.createElement)(u.AlignmentToolbar,{value:t.textAlign,onChange:e=>{n({textAlign:e})}})),(0,e.createElement)("div",{...i},(0,e.createElement)(me.Z,{...a})))}};(0,t.registerBlockType)("woocommerce-germanized/product-safety-attachments",ge);var fe=r(162);const{ancestor:he,...ve}=d,we={...ve,apiVersion:2,title:(0,s.__)("Safety instructions","woocommerce-germanized")+((0,R.getSetting)("isPro")?"":" (Pro)"),description:(0,s.__)("Inserts the product's safety instructions.","woocommerce-germanized"),usesContext:["query","queryId","postId"],icon:{src:(0,e.createElement)(n,{icon:ee,className:"wc-block-editor-components-block-icon"})},supports:{...d.supports,__experimentalSelector:".wp-block-woocommerce-gzd-product-safety-instructions .wc-gzd-block-components-product-safety-instructions"},edit:({attributes:t,setAttributes:n,context:r})=>{const i=(0,u.useBlockProps)(),a={...t,...r},c=Number.isFinite(r.queryId);let{isDescendentOfSingleProductTemplate:s}=h();return c&&(s=!1),(0,o.useEffect)((()=>n({isDescendentOfQueryLoop:c,isDescendentOfSingleProductTemplate:s})),[c,s,n]),(0,e.createElement)(e.Fragment,null,(0,e.createElement)(u.BlockControls,null,(0,e.createElement)(u.AlignmentToolbar,{value:t.textAlign,onChange:e=>{n({textAlign:e})}})),(0,e.createElement)("div",{...i},(0,e.createElement)(fe.Z,{...a})))}};(0,t.registerBlockType)("woocommerce-germanized/product-safety-instructions",we);var ye=window.wc.wcBlocksRegistry;(0,ye.registerBlockComponent)({blockName:"woocommerce-germanized/product-unit-price",component:(0,o.lazy)((()=>r.e(92).then(r.bind(r,313))))}),(0,ye.registerBlockComponent)({blockName:"woocommerce-germanized/product-delivery-time",component:(0,o.lazy)((()=>r.e(518).then(r.bind(r,466))))}),(0,ye.registerBlockComponent)({blockName:"woocommerce-germanized/product-tax-info",component:(0,o.lazy)((()=>r.e(297).then(r.bind(r,984))))}),(0,ye.registerBlockComponent)({blockName:"woocommerce-germanized/product-shipping-costs-info",component:(0,o.lazy)((()=>r.e(648).then(r.bind(r,949))))}),(0,ye.registerBlockComponent)({blockName:"woocommerce-germanized/product-unit-product",component:(0,o.lazy)((()=>r.e(6).then(r.bind(r,862))))}),(0,ye.registerBlockComponent)({blockName:"woocommerce-germanized/product-nutri-score",component:(0,o.lazy)((()=>r.e(128).then(r.bind(r,418))))}),(0,ye.registerBlockComponent)({blockName:"woocommerce-germanized/product-deposit",component:(0,o.lazy)((()=>r.e(412).then(r.bind(r,757))))}),(0,ye.registerBlockComponent)({blockName:"woocommerce-germanized/product-deposit-packaging-type",component:(0,o.lazy)((()=>r.e(534).then(r.bind(r,41))))}),(0,ye.registerBlockComponent)({blockName:"woocommerce-germanized/product-defect-description",component:(0,o.lazy)((()=>r.e(710).then(r.bind(r,944))))}),(0,ye.registerBlockComponent)({blockName:"woocommerce-germanized/product-manufacturer",component:(0,o.lazy)((()=>r.e(284).then(r.bind(r,135))))}),(0,ye.registerBlockComponent)({blockName:"woocommerce-germanized/product-safety-attachments",component:(0,o.lazy)((()=>r.e(545).then(r.bind(r,899))))}),(0,ye.registerBlockComponent)({blockName:"woocommerce-germanized/product-safety-instructions",component:(0,o.lazy)((()=>r.e(202).then(r.bind(r,353))))})}(),((window.wcGzd=window.wcGzd||{}).blocks=window.wcGzd.blocks||{})["wc-gzd-blocks-product-elements"]=i}(); \ No newline at end of file diff --git a/build/wc-gzd-blocks-settings.asset.php b/build/wc-gzd-blocks-settings.asset.php new file mode 100644 index 000000000..b87a8bce6 --- /dev/null +++ b/build/wc-gzd-blocks-settings.asset.php @@ -0,0 +1 @@ + array('wc-settings'), 'version' => '04cffc5f543ace1b24b2'); diff --git a/build/wc-gzd-blocks-settings.js b/build/wc-gzd-blocks-settings.js new file mode 100644 index 000000000..3b217a529 --- /dev/null +++ b/build/wc-gzd-blocks-settings.js @@ -0,0 +1 @@ +!function(){"use strict";var t={d:function(e,n){for(var o in n)t.o(n,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:n[o]})},o:function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r:function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{allSettings:function(){return n},getSetting:function(){return c}});const n="object"==typeof window.wcGzdBlocksSettings?window.wcGzdBlocksSettings:{};var o=window.wc.wcSettings;const c=(t,e=!1)=>{let c=e;return c=t in n?n[t]:(0,o.getSetting)(t,e),c};((window.wcGzd=window.wcGzd||{}).blocks=window.wcGzd.blocks||{}).wcGzdBlocksSettings=e}(); \ No newline at end of file diff --git a/build/wc-gzd-blocks-style.asset.php b/build/wc-gzd-blocks-style.asset.php new file mode 100644 index 000000000..4b4fcc2f6 --- /dev/null +++ b/build/wc-gzd-blocks-style.asset.php @@ -0,0 +1 @@ + array(), 'version' => '840ef8dc0384a52d884f'); diff --git a/build/wc-gzd-blocks.asset.php b/build/wc-gzd-blocks.asset.php new file mode 100644 index 000000000..a01dfda49 --- /dev/null +++ b/build/wc-gzd-blocks.asset.php @@ -0,0 +1 @@ + array(), 'version' => '27998ec88e7610b85906'); diff --git a/build/wc-gzd-blocks.css b/build/wc-gzd-blocks.css new file mode 100644 index 000000000..215e8ede6 --- /dev/null +++ b/build/wc-gzd-blocks.css @@ -0,0 +1 @@ +.wc-gzd-block-grid__product-unit-price{display:block}.wc-gzd-block-components-product-deposit-packaging-type{text-transform:uppercase}.wp-block-woocommerce-gzd-product-is-empty{display:none} diff --git a/build/wc-gzd-blocks.js b/build/wc-gzd-blocks.js new file mode 100644 index 000000000..4f214343f --- /dev/null +++ b/build/wc-gzd-blocks.js @@ -0,0 +1 @@ +!function(){"use strict";var n,r={76:function(n,r,o){o.r(r)}},o={};function e(n){var t=o[n];if(void 0!==t)return t.exports;var i=o[n]={exports:{}};return r[n](i,i.exports,e),i.exports}e.m=r,n=[],e.O=function(r,o,t,i){if(!o){var c=1/0;for(s=0;s=i)&&Object.keys(e.O).every((function(n){return e.O[n](o[f])}))?o.splice(f--,1):(u=!1,i0&&n[s-1][2]>i;s--)n[s]=n[s-1];n[s]=[o,t,i]},e.o=function(n,r){return Object.prototype.hasOwnProperty.call(n,r)},e.r=function(n){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},function(){var n={70:0,617:0};e.O.j=function(r){return 0===n[r]};var r=function(r,o){var t,i,c=o[0],u=o[1],f=o[2],l=0;if(c.some((function(r){return 0!==n[r]}))){for(t in u)e.o(u,t)&&(e.m[t]=u[t]);if(f)var s=f(e)}for(r&&r(o);l array('react', 'wc-blocks-checkout', 'wc-blocks-data-store', 'wc-blocks-registry', 'wc-settings', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n'), 'version' => 'c7ab9ce4b0e50505cd73'); diff --git a/build/wc-gzd-payment-method-direct-debit.js b/build/wc-gzd-payment-method-direct-debit.js new file mode 100644 index 000000000..38b446f1d --- /dev/null +++ b/build/wc-gzd-payment-method-direct-debit.js @@ -0,0 +1 @@ +!function(){"use strict";var e={};(function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})})(e);var t,a=window.React,o=window.wc.wcBlocksRegistry,r=window.wp.i18n,i=window.wc.wcSettings,n=window.wp.htmlEntities,c=window.wp.element,d=window.wc.blocksCheckout,l=window.wp.data,s=window.wc.wcBlocksData;const u=(0,i.getPaymentMethodData)("direct-debit",{}),m=(0,r.__)("Direct debit","woocommerce-germanized"),w=(0,n.decodeEntities)(u?.title||"")||m,_=({billing:e,eventRegistration:t,emitResponse:o,components:i})=>{const{values:n}=(0,l.useSelect)((e=>({values:e(s.PAYMENT_STORE_KEY).getPaymentMethodData()})),[]),{__internalSetPaymentMethodData:u}=(0,l.useDispatch)(s.PAYMENT_STORE_KEY),{extensionData:m}=(0,l.useSelect)((e=>{const t=e(s.CHECKOUT_STORE_KEY).getExtensionData();return{extensionData:t.hasOwnProperty("woocommerce-germanized")?t["woocommerce-germanized"]:{}}})),{__internalSetExtensionData:w}=(0,l.useDispatch)(s.CHECKOUT_STORE_KEY),_=[{key:"direct_debit_account_holder",label:(0,r.__)("Account holder","woocommerce-germanized"),type:"text",required:!0,errorMessage:"",autocomplete:"",autocapitalize:""},{key:"direct_debit_account_iban",label:(0,r.__)("IBAN","woocommerce-germanized"),type:"text",required:!0,errorMessage:"",autocomplete:"",autocapitalize:""},{key:"direct_debit_account_bic",label:(0,r.__)("BIC/SWIFT","woocommerce-germanized"),type:"text",required:!0,errorMessage:"",autocomplete:"",autocapitalize:""}],p=(0,c.useRef)({});return(0,a.createElement)("div",{className:"wc-gzd-direct-debit-fields"},_.map((e=>{const t={id:`${e.key}`,errorId:`${e.key}`,label:e.required?e.label:e.optionalLabel,autoCapitalize:e.autocapitalize,autoComplete:e.autocomplete,errorMessage:e.errorMessage,required:e.required,className:`wc-gzd-direct-debit__${e.key}`},o=n.hasOwnProperty(e.key)?n[e.key]:"";return(0,a.createElement)(d.ValidatedTextInput,{key:e.key,ref:t=>p.current[e.key]=t,...t,value:o,onChange:t=>(u({...n,[e.key]:t}),t),customFormatter:t=>("direct_debit_account_bic"===e.key?t=(t=t.toUpperCase()).replace(/[^\w]/g,""):"direct_debit_account_iban"===e.key&&(t=(t=t.toUpperCase()).replace(/[^\w\s]/g,"")),t),customValidation:t=>{if("direct_debit_account_bic"===e.key){if(!/^([a-zA-Z]){4}([a-zA-Z]){2}([0-9a-zA-Z]){2}([0-9a-zA-Z]{3})?$/.test(t.value))return t.setCustomValidity((0,r.__)("Please enter a valid BIC/SWIFT","woocommerce-germanized")),!1}else if("direct_debit_account_iban"===e.key){const e=function(e){let t,a=e.slice(0,2);for(let o=2;oe.charCodeAt(0)-55)),c=1===e(n)):c=!1,!c)return t.setCustomValidity((0,r.__)("Please enter a valid IBAN","woocommerce-germanized")),!1}return!0}})})))},p={name:"direct-debit",label:(0,a.createElement)((e=>{const{PaymentMethodLabel:t}=e.components;return(0,a.createElement)(t,{text:w})}),null),content:(0,a.createElement)(_,null),edit:(0,a.createElement)(_,null),canMakePayment:()=>!0,ariaLabel:w,supports:{features:null!==(t=u?.supports)&&void 0!==t?t:[]}};(0,o.registerPaymentMethod)(p),((window.wcGzd=window.wcGzd||{}).blocks=window.wcGzd.blocks||{})["wc-gzd-payment-method-direct-debit"]=e}(); \ No newline at end of file diff --git a/build/wc-gzd-payment-method-invoice.asset.php b/build/wc-gzd-payment-method-invoice.asset.php new file mode 100644 index 000000000..13ad3d631 --- /dev/null +++ b/build/wc-gzd-payment-method-invoice.asset.php @@ -0,0 +1 @@ + array('react', 'wc-blocks-registry', 'wc-settings', 'wp-html-entities', 'wp-i18n'), 'version' => '0b6f1c913d809107041f'); diff --git a/build/wc-gzd-payment-method-invoice.js b/build/wc-gzd-payment-method-invoice.js new file mode 100644 index 000000000..58e538bf1 --- /dev/null +++ b/build/wc-gzd-payment-method-invoice.js @@ -0,0 +1 @@ +!function(){"use strict";var e={};(function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})})(e);var t,n=window.React,o=window.wc.wcBlocksRegistry,i=window.wp.i18n,c=window.wc.wcSettings,d=window.wp.htmlEntities;const a=(0,c.getPaymentMethodData)("invoice",{}),l=(0,i.__)("Pay by Invoice","woocommerce-germanized"),w=(0,d.decodeEntities)(a?.title||"")||l,r=()=>(0,d.decodeEntities)(a.description||""),s={name:"invoice",label:(0,n.createElement)((e=>{const{PaymentMethodLabel:t}=e.components;return(0,n.createElement)(t,{text:w})}),null),content:(0,n.createElement)(r,null),edit:(0,n.createElement)(r,null),canMakePayment:()=>!0,ariaLabel:w,supports:{features:null!==(t=a?.supports)&&void 0!==t?t:[]}};(0,o.registerPaymentMethod)(s),((window.wcGzd=window.wcGzd||{}).blocks=window.wcGzd.blocks||{})["wc-gzd-payment-method-invoice"]=e}(); \ No newline at end of file