AMP for WordPress - Version 2.0.9

Version Description

Download this release

Release Info

Developer westonruter
Plugin Icon 128x128 AMP for WordPress
Version 2.0.9
Comparing to
See all releases

Code changes from version 2.0.8 to 2.0.9

amp.php CHANGED
@@ -5,7 +5,7 @@
5
  * Plugin URI: https://amp-wp.org
6
  * Author: AMP Project Contributors
7
  * Author URI: https://github.com/ampproject/amp-wp/graphs/contributors
8
- * Version: 2.0.8
9
  * License: GPLv2 or later
10
  * Requires at least: 4.9
11
  * Requires PHP: 5.6
@@ -15,7 +15,7 @@
15
 
16
  define( 'AMP__FILE__', __FILE__ );
17
  define( 'AMP__DIR__', dirname( __FILE__ ) );
18
- define( 'AMP__VERSION', '2.0.8' );
19
 
20
  /**
21
  * Errors encountered while loading the plugin.
5
  * Plugin URI: https://amp-wp.org
6
  * Author: AMP Project Contributors
7
  * Author URI: https://github.com/ampproject/amp-wp/graphs/contributors
8
+ * Version: 2.0.9
9
  * License: GPLv2 or later
10
  * Requires at least: 4.9
11
  * Requires PHP: 5.6
15
 
16
  define( 'AMP__FILE__', __FILE__ );
17
  define( 'AMP__DIR__', dirname( __FILE__ ) );
18
+ define( 'AMP__VERSION', '2.0.9' );
19
 
20
  /**
21
  * Errors encountered while loading the plugin.
assets/js/amp-block-editor.asset.php CHANGED
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('lodash', 'moment', 'react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-edit-post', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-plugins', 'wp-polyfill', 'wp-url'), 'version' => 'b3b13ff8a758a8521f20837af7d556e3');
1
+ <?php return array('dependencies' => array('lodash', 'moment', 'react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-edit-post', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-plugins', 'wp-polyfill', 'wp-url'), 'version' => '2f1bc3e07d3de9b2451813c8881566dd');
assets/js/amp-block-editor.js CHANGED
@@ -1,17 +1,27 @@
1
- !function(e){var t={};function a(r){if(t[r])return t[r].exports;var n=t[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,a),n.l=!0,n.exports}a.m=e,a.c=t,a.d=function(e,t,r){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(a.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)a.d(r,n,function(t){return e[t]}.bind(null,n));return r},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="",a(a.s=37)}([function(e,t){!function(){e.exports=this.wp.element}()},function(e,t){!function(){e.exports=this.wp.i18n}()},function(e,t){!function(){e.exports=this.wp.components}()},function(e,t){!function(){e.exports=this.wp.data}()},function(e,t){!function(){e.exports=this.wp.blockEditor}()},function(e,t,a){e.exports=a(28)()},function(e,t,a){"use strict";a.d(t,"b",(function(){return o})),a.d(t,"a",(function(){return c})),a.d(t,"c",(function(){return T}));var r=a(0),n=(a(5),a(22),a(2)),i=a(1),o=function(e){var t=e.name,a=e.url;return Object(r.createElement)(n.Placeholder,{label:t},Object(r.createElement)("p",{className:"components-placeholder__error"},a),Object(r.createElement)("p",{className:"components-placeholder__error"},Object(i.__)("Previews for this are unavailable in the editor, sorry!","amp")))},c=function(e){var t=e.attributes,a=e.setAttributes,o=e.ampLayoutOptions,c=t.ampLayout,l=t.height,u=t.width,s=!l&&("fixed"===c||"fixed-height"===c),d=!u&&"fixed"===c;return Object(r.createElement)(r.Fragment,null,Object(r.createElement)(n.SelectControl,{label:Object(i.__)("Layout","amp"),value:c,options:o,onChange:function(e){return a({ampLayout:e})}}),d&&Object(r.createElement)(n.Notice,{status:"error",isDismissible:!1},Object(i.sprintf)(
2
  /* translators: %s is the layout name */
3
  Object(i.__)("Width is required for %s layout","amp"),c)),Object(r.createElement)(n.TextControl,{type:"number",label:Object(i.__)("Width (px)","amp"),value:void 0!==u?u:"",onChange:function(e){return a({width:e})}}),s&&Object(r.createElement)(n.Notice,{status:"error",isDismissible:!1},Object(i.sprintf)(
4
  /* translators: %s is the layout name */
5
- Object(i.__)("Height is required for %s layout","amp"),c)),Object(r.createElement)(n.TextControl,{type:"number",label:Object(i.__)("Height (px)","amp"),value:l,onChange:function(e){return a({height:e})}}))},l=a(8),u=a.n(l),s=a(19),d=a.n(s),m=a(23),b=a.n(m),p=a(17),f=a.n(p),h=a(20),y=a.n(h),O=a(21),g=a.n(O),j=a(35),v=a.n(j),_=a(14),w=a.n(_),P=a(3),E=a(24),x=a(9);function C(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,r)}return a}function S(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?C(Object(a),!0).forEach((function(t){u()(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):C(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}function I(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=w()(e);if(t){var n=w()(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return g()(this,a)}}var k=window.wp,T=function(e,t){var a=t.width,r=t.height;return function(e){y()(n,e);var t=I(n);function n(){var e,a;d()(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return"editor-post-featured-image__media-modal"===(a=t.call.apply(t,[this].concat(i))).props.modalClass?(a.initFeaturedImage=a.initFeaturedImage.bind(f()(a)),a.initFeaturedImage()):(a.frame.off("open",a.onOpen),a.frame.on("open",v()((e=f()(a),w()(n.prototype)),"onOpen",e).bind(f()(a)))),a}return b()(n,[{key:"initFeaturedImage",value:function(){var e=Object(E.c)(E.b),t=k.media.controller.FeaturedImage.extend({defaults:S(S({},k.media.controller.FeaturedImage.prototype.defaults),{},{date:!1,filterable:!1,suggestedWidth:a,suggestedHeight:r})});this.frame=new e({allowedTypes:this.props.allowedTypes,state:"featured-image",states:[new t,new k.media.controller.EditImage]}),this.frame.on("toolbar:create:featured-image",(function(e){this.createSelectToolbar(e,{text:k.media.view.l10n.setFeaturedImage,state:this.options.state})}),this.frame),this.frame.on("open",this.onOpen),this.frame.state("featured-image").on("select",this.onSelectImage,this),k.media.frame=this.frame}},{key:"onOpen",value:function(){var e=this.frame.content.get();if(e&&e.collection){var t=e.collection;t.toArray().forEach((function(e){return e.trigger("destroy",e)})),t.mirroring._hasMore=!0,t.more()}}},{key:"onSelectImage",value:function(){var e=this.frame.state("featured-image").get("selection").first().toJSON(),t=this.props.onSelect,a=e.url,r=e.id,n=e.width,i=e.height;Object(x.d)({url:a,id:r,width:n,height:i,onSelect:t,dispatchImage:function(e){Object(P.dispatch)("core/editor").editPost({featured_media:e})}}),k.media.view.settings.post.featuredImageId&&k.media.featuredImage.set(e?e.id:-1)}}]),n}(e)}},function(e,t,a){"use strict";a.d(t,"e",(function(){return r})),a.d(t,"c",(function(){return n})),a.d(t,"b",(function(){return i})),a.d(t,"a",(function(){return o})),a.d(t,"d",(function(){return c}));var r=["core/paragraph","core/heading","core/code","core/quote","core/subhead"],n=["core/image","core/video"],i=608,o=400,c="editor-post-preview"},function(e,t){e.exports=function(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}},function(e,t,a){"use strict";a.d(t,"b",(function(){return o})),a.d(t,"e",(function(){return c})),a.d(t,"c",(function(){return l})),a.d(t,"a",(function(){return u})),a.d(t,"d",(function(){return s}));var r=a(12),n=a(1),i=a(10),o=function(){var e=i.c;return{width:e,height:e*(9/16)}},c=function(e,t,a){if(!e)return a?[Object(n.__)("Selecting a featured image is required.","amp")]:[Object(n.__)("Selecting a featured image is recommended for an optimal user experience.","amp")];var r=[];if(["image/png","image/gif","image/jpeg"].includes(e.mime_type)||r.push(
6
  /* translators: 1: .jpg, 2: .png. 3: .gif */
7
- Object(n.sprintf)(Object(n.__)("The featured image must be in %1$s, %2$s, or %3$s format.","amp"),".jpg",".png",".gif")),!function(e,t){if(!e||!e.width||!e.height)return!1;var a=t.width,r=t.height;return e.width>=a&&e.height>=r}(e.media_details,t)){var i=t.width,o=t.height;r.push(
8
  /* translators: 1: minimum width, 2: minimum height. */
9
- Object(n.sprintf)(Object(n.__)("The featured image should have a size of at least %1$s by %2$s pixels.","amp"),Math.ceil(i),Math.ceil(o)))}return 0===r.length?null:r},l=function(e){var t=Object(r.template)("<p>".concat(e,"</p>"),{evaluate:/<#([\s\S]+?)#>/g,interpolate:/\{\{\{([\s\S]+?)\}\}\}/g,escape:/\{\{([^\}]+?)\}\}(?!\})/g});return function(e){return t(e)}},u=function(e,t){if(e){var a=Object(r.get)(this,["options","allowedTypes"],null),n=this.get("select");a&&e.get("type")&&!function(e,t){var a=e.get("type"),r=e.get("mime");return!(!t.includes(a)&&!t.includes(r))&&"video"!==a}(e,a)?(this.secondary.set(i.a,new t({mimeType:e.get("mime")})),n&&n.model&&n.model.set("disabled",!0)):(this.secondary.unset(i.a),n&&n.model&&n.model.set("disabled",!1))}},s=function(e){var t=e.url,a=e.id,n=e.width,i=e.height,o=e.onSelect,c=e.dispatchImage,l={};l.url=t,l.thumbnail_url=t,l.timestamp=Object(r.now)(),a&&(l.attachment_id=a),n&&(l.width=n),i&&(l.height=i),o(l),c(a)}},function(e,t,a){"use strict";a.d(t,"d",(function(){return r})),a.d(t,"b",(function(){return n})),a.d(t,"c",(function(){return i})),a.d(t,"a",(function(){return o}));var r=6,n=72,i=1200,o="select-file-type-error"},function(e,t){function a(){return e.exports=a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},a.apply(this,arguments)}e.exports=a},function(e,t){!function(){e.exports=this.lodash}()},function(e,t){!function(){e.exports=this.wp.compose}()},function(e,t){function a(t){return e.exports=a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},a(t)}e.exports=a},function(e,t){!function(){e.exports=this.moment}()},function(e,t,a){"use strict";a.d(t,"a",(function(){return b})),a.d(t,"c",(function(){return p})),a.d(t,"b",(function(){return y})),a.d(t,"d",(function(){return x}));var r=a(0),n=(a(5),a(22),a(1)),i=a(2),o=a(4),c=a(3),l=a(7),u=a(10);function s(e,t){var a;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(a=function(e,t){if(!e)return;if("string"==typeof e)return d(e,t);var a=Object.prototype.toString.call(e).slice(8,-1);"Object"===a&&e.constructor&&(a=e.constructor.name);if("Map"===a||"Set"===a)return Array.from(e);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return d(e,t)}(e))||t&&e&&"number"==typeof e.length){a&&(e=a);var r=0,n=function(){};return{s:n,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,c=!1;return{s:function(){a=e[Symbol.iterator]()},n:function(){var e=a.next();return o=e.done,e},e:function(e){c=!0,i=e},f:function(){try{o||null==a.return||a.return()}finally{if(c)throw i}}}}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,r=new Array(t);a<t;a++)r[a]=e[a];return r}var m=[{value:"nodisplay",label:Object(n.__)("No Display","amp"),notAvailable:["core-embed/vimeo","core-embed/dailymotion","core-embed/reddit","core-embed/soundcloud"]},{value:"fixed",label:Object(n.__)("Fixed","amp"),notAvailable:["core-embed/soundcloud"]},{value:"responsive",label:Object(n.__)("Responsive","amp"),notAvailable:["core-embed/soundcloud"]},{value:"fixed-height",label:Object(n.__)("Fixed Height","amp"),notAvailable:[]},{value:"fill",label:Object(n.__)("Fill","amp"),notAvailable:["core-embed/soundcloud"]},{value:"flex-item",label:Object(n.__)("Flex Item","amp"),notAvailable:["core-embed/soundcloud"]},{value:"intrinsic",label:Object(n.__)("Intrinsic","amp"),notAvailable:["core/video","core-embed/youtube","core-embed/facebook","core-embed/instagram","core-embed/vimeo","core-embed/dailymotion","core-embed/reddit","core-embed/soundcloud"]}],b=function(e,t){return"core/gallery"===t&&(e.attributes||(e.attributes={}),e.attributes.ampCarousel={type:"boolean",default:!Object(c.select)("amp/block-editor").hasThemeSupport()},e.attributes.ampLightbox={type:"boolean",default:!1}),"core/image"===t&&(e.attributes||(e.attributes={}),e.attributes.ampLightbox={type:"boolean",default:!1}),l.e.includes(t)&&(e.attributes||(e.attributes={}),e.attributes.ampFitText={type:"boolean",default:!1},e.attributes.minFont={default:u.d,source:"attribute",selector:"amp-fit-text",attribute:"min-font-size"},e.attributes.maxFont={default:u.b,source:"attribute",selector:"amp-fit-text",attribute:"max-font-size"},e.attributes.height={default:"core/image"===t?200:10*Math.ceil(u.b/10),source:"attribute",selector:"amp-fit-text",attribute:"height"}),(0===t.indexOf("core-embed")||l.c.includes(t))&&(e.attributes||(e.attributes={}),e.attributes.ampLayout={type:"string"},e.attributes.ampNoLoading={type:"boolean"}),e},p=function(e,t,a){var n={layout:"fixed-height"};if("core/paragraph"!==t.name||a.ampFitText){if(l.e.includes(t.name)&&a.ampFitText)return a.minFont&&(n["min-font-size"]=a.minFont),a.maxFont&&(n["max-font-size"]=a.maxFont),a.height&&(n.height=a.height),n.children=e,Object(r.createElement)("amp-fit-text",n)}else{var i=f(a.content);if(i!==a.content)return Object(r.cloneElement)(e,{key:"new",value:i})}return e},f=function(e){var t=/<amp-fit-text\b[^>]*>(.*?)<\/amp-fit-text>/.exec(e),a=e;return t&&t[1]&&(a=t[1]),a},h=function(e){var t,a=[{value:"",label:Object(n.__)("Default","amp")}],r=s(m);try{for(r.s();!(t=r.n()).done;){var i=t.value;!i.notAvailable.includes(e)&&a.push({value:i.value,label:i.label})}}catch(e){r.e(e)}finally{r.f()}return a},y=function(e){return function(t){var a,n=t.attributes.ampLayout,i=t.name;return"core/gallery"===i?a=E(t):"core/image"===i?a=P(t):l.c.includes(i)||0===i.indexOf("core-embed/")?a=O(t):l.e.includes(i)&&(a=v(t)),n&&"nodisplay"===n?[a]:Object(r.createElement)(r.Fragment,null,Object(r.createElement)(e,t),a)}},O=function(e){return e.isSelected?Object(r.createElement)(o.InspectorControls,null,Object(r.createElement)(i.PanelBody,{title:Object(n.__)("AMP Settings","amp")},Object(r.createElement)(g,e),Object(r.createElement)(j,e))):null},g=function(e){var t=e.name,a=e.attributes.ampLayout,o=e.setAttributes,c=Object(n.__)("AMP Layout","amp");return"core/image"===t&&(c=Object(n.__)("AMP Layout (modifies width/height)","amp")),Object(r.createElement)(i.SelectControl,{label:c,value:a,options:h(t),onChange:function(t){o({ampLayout:t}),"core/image"===e.name&&function(e,t){var a=e.attributes,r=e.setAttributes;switch(t){case"fixed-height":a.height||r({height:l.a}),a.ampLightbox&&r({ampLightbox:!1});break;case"fixed":a.height||r({height:l.a}),a.width||r({width:l.b})}}(e,t)}})},j=function(e){var t=e.attributes.ampNoLoading,a=e.setAttributes,o=Object(n.__)("AMP Noloading","amp");return Object(r.createElement)(i.ToggleControl,{label:o,checked:t,onChange:function(){return a({ampNoLoading:!t})}})},v=function(e){var t=e.isSelected,a=e.attributes,c=e.setAttributes,l=a.ampFitText,s=a.minFont,d=a.maxFont,m=a.height,b=[{name:"small",shortName:Object(n._x)("S","font size","amp"),size:14},{name:"regular",shortName:Object(n._x)("M","font size","amp"),size:16},{name:"large",shortName:Object(n._x)("L","font size","amp"),size:36},{name:"larger",shortName:Object(n._x)("XL","font size","amp"),size:48}];if(!t)return null;var p=Object(n.__)("Automatically fit text to container","amp");return l&&(d=parseInt(d),m=parseInt(m),s=parseInt(s)),Object(r.createElement)(o.InspectorControls,null,Object(r.createElement)(i.PanelBody,{title:Object(n.__)("AMP Settings","amp"),className:l?"is-amp-fit-text":""},Object(r.createElement)(i.ToggleControl,{label:p,checked:l,onChange:function(){return c({ampFitText:!l})}})),l&&Object(r.createElement)(r.Fragment,null,Object(r.createElement)(i.TextControl,{label:Object(n.__)("Height","amp"),value:m,min:1,onChange:function(e){c({height:e})}}),d>m&&Object(r.createElement)(i.Notice,{status:"error",isDismissible:!1},Object(n.__)("The height must be greater than the max font size.","amp")),Object(r.createElement)(i.PanelBody,{title:Object(n.__)("Minimum font size","amp")},Object(r.createElement)(i.FontSizePicker,{fallbackFontSize:14,value:s,fontSizes:b,onChange:function(e){e||(e=u.d),parseInt(e)<=d&&c({minFont:e})}})),s>d&&Object(r.createElement)(i.Notice,{status:"error",isDismissible:!1},Object(n.__)("The min font size must less than the max font size.","amp")),Object(r.createElement)(i.PanelBody,{title:Object(n.__)("Maximum font size","amp")},Object(r.createElement)(i.FontSizePicker,{fallbackFontSize:48,value:d,fontSizes:b,onChange:function(e){e||(e=u.b),c({maxFont:e,height:Math.max(e,m)})}}))))},_=function(e){var t=e.attributes,a=t.ampLightbox,o=t.linkTo,c=t.ampLayout,l=e.setAttributes;return Object(r.createElement)(i.ToggleControl,{label:Object(n.__)("Add lightbox effect","amp"),checked:a,onChange:function(e){l({ampLightbox:!a}),e&&("fixed-height"===c&&l({ampLayout:"fixed"}),o&&"none"!==o&&l({linkTo:"none"}))}})},w=function(e){var t=e.attributes.ampCarousel,a=e.setAttributes;return Object(r.createElement)(i.ToggleControl,{label:Object(n.__)("Display as carousel","amp"),checked:t,onChange:function(){return a({ampCarousel:!t})}})},P=function(e){return e.isSelected?Object(r.createElement)(o.InspectorControls,null,Object(r.createElement)(i.PanelBody,{title:Object(n.__)("AMP Settings","amp")},Object(r.createElement)(g,e),Object(r.createElement)(j,e),Object(r.createElement)(_,e))):null},E=function(e){return e.isSelected?Object(r.createElement)(o.InspectorControls,null,Object(r.createElement)(i.PanelBody,{title:Object(n.__)("AMP Settings","amp")},Object(r.createElement)(w,e),Object(r.createElement)(_,e))):null},x=function(){return(0,Object(c.select)("core/editor").getEditedPostAttribute)("amp_enabled")||!1}},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},function(e,t){!function(){e.exports=this.wp.hooks}()},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t,a){var r=a(38);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t)}},function(e,t,a){var r=a(39),n=a(17);e.exports=function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?n(e):t}},function(e,t){!function(){e.exports=this.React}()},function(e,t){function a(e,t){for(var a=0;a<t.length;a++){var r=t[a];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}e.exports=function(e,t,r){return t&&a(e.prototype,t),r&&a(e,r),e}},function(e,t,a){"use strict";a.d(t,"b",(function(){return p})),a.d(t,"a",(function(){return f})),a.d(t,"c",(function(){return h}));var r=a(8),n=a.n(r),i=a(12),o=a(1),c=a(9);function l(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,r)}return a}function u(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?l(Object(a),!0).forEach((function(t){n()(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):l(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}var s,d=window.wp,m=d.media.View.extend({className:"notice notice-warning notice-alt inline",template:(s=Object(o.sprintf)(
10
- /* translators: 1: image width in pixels. 2: image height in pixels. 3: required minimum width in pixels. 4: required minimum height in pixels. */
11
- Object(o.__)("The selected image is too small (%1$s by %2$s pixels). It should have a size of at least %3$s by %4$s pixels.","amp"),"{{width}}","{{height}}","{{minWidth}}","{{minHeight}}"),Object(c.c)(s))}),b=d.media.View.extend({className:"notice notice-warning notice-alt inline",template:function(){var e=Object(o.sprintf)(
 
 
 
 
 
 
 
 
 
 
12
  /* translators: 1: the selected file type. */
13
  Object(o.__)("The selected file mime type, %1$s, is not allowed.","amp"),"{{mimeType}}");return Object(c.c)(e)}()}),p=(d.media.View.extend({className:"notice notice-warning notice-alt inline",template:function(){var e=Object(o.sprintf)(
14
  /* translators: 1: the recommended max MB per second for videos. 2: the actual MB per second of the video. */
15
- Object(o.__)("A video size of less than %1$s MB per second is recommended. The selected video is %2$s MB per second.","amp"),"{{maxVideoMegabytesPerSecond}}","{{actualVideoMegabytesPerSecond}}");return Object(c.c)(e)}()}),d.media.view.Toolbar.Select.extend({refresh:function(){d.media.view.Toolbar.Select.prototype.refresh.call(this);var e=this.controller.state(),t=e.get("selection").models[0],a=e.collection.get("featured-image").get("suggestedWidth"),r=e.collection.get("featured-image").get("suggestedHeight");!t||"image"!==t.get("type")||!t.get("width")||t.get("width")>=a&&t.get("height")>=r?this.secondary.unset("select-error"):this.secondary.set("select-error",new m({minWidth:a,minHeight:r,width:t.get("width"),height:t.get("height")})),c.a.call(this,t,b)}})),f=d.media.view.Toolbar.Select.extend({refresh:function(){d.media.view.Toolbar.Select.prototype.refresh.call(this);var e=this.controller.state().get("selection").models[0];c.a.call(this,e,b)}}),h=function(e){return d.media.view.MediaFrame.Select.extend({createSelectToolbar:function(t,a){(a=a||this.options.button||{}).controller=this,a=u(u({},a),{},{allowedTypes:Object(i.get)(this,["options","allowedTypes"],null)}),t.view=new e(a)}})}},function(e,t){!function(){e.exports=this.wp.editPost}()},function(e,t,a){"use strict";a.d(t,"a",(function(){return u})),a.d(t,"b",(function(){return d}));var r=a(0),n=(a(5),a(2)),i=a(25),o=a(3),c=a(1),l=a(9),u=Object(o.withSelect)((function(e){var t=e("core/editor").getCurrentPost(),a=e("core/editor").getEditedPostAttribute("featured_media"),r=t.featured_media||a;return{featuredMedia:r?e("core").getMedia(r):null}}))((function(e){var t=e.featuredMedia,a=e.dimensions,o=e.required,u=Object(l.e)(t,a,o);return u?Object(r.createElement)(i.PluginPrePublishPanel,{title:Object(c.__)("Featured Image","amp"),initialOpen:"true"},Object(r.createElement)(n.Notice,{status:o?"warning":"notice",isDismissible:!1},u.map((function(e,t){return Object(r.createElement)("p",{key:"error-".concat(t)},e)})))):null})),s=a(13),d=Object(s.createHigherOrderComponent)((function(e){return function(t){var a=t.media,i=Object(l.e)(a,Object(l.b)(),!1);return i?Object(r.createElement)(r.Fragment,null,Object(r.createElement)(n.Notice,{status:"notice",isDismissible:!1},i.map((function(e,t){return Object(r.createElement)("p",{key:"error-".concat(t)},e)}))),Object(r.createElement)(e,t)):Object(r.createElement)(e,t)}}),"withFeaturedImageNotice");a(19),a(17),a(20),a(21),a(14),a(8),a(12),a(24);window.wp},function(e,t){e.exports=ampBlockEditor},function(e,t,a){"use strict";var r=a(29);function n(){}function i(){}i.resetWarningCache=n,e.exports=function(){function e(e,t,a,n,i,o){if(o!==r){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}function t(){return e}e.isRequired=e;var a={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:n};return a.PropTypes=a,a}},function(e,t,a){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,a){"use strict";var r={};a.r(r),a.d(r,"hasThemeSupport",(function(){return c})),a.d(r,"isStandardMode",(function(){return l})),a.d(r,"getErrorMessages",(function(){return u})),a.d(r,"getAmpSlug",(function(){return s}));var n=a(8),i=a.n(n),o=a(3);function c(e){return Boolean(e.hasThemeSupport)}function l(e){return Boolean(e.isStandardMode)}function u(e){return e.errorMessages}function s(e){return e.ampSlug}function d(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,r)}return a}Object(o.registerStore)("amp/block-editor",{reducer:function(e){return e},selectors:r,initialState:function(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?d(Object(a),!0).forEach((function(t){i()(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):d(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}({},window.ampBlockEditor)})},function(e,t){!function(){e.exports=this.wp.url}()},,function(e,t){!function(){e.exports=this.wp.plugins}()},function(e,t){!function(){e.exports=this.wp.blocks}()},function(e,t,a){var r=a(40);function n(t,a,i){return"undefined"!=typeof Reflect&&Reflect.get?e.exports=n=Reflect.get:e.exports=n=function(e,t,a){var n=r(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(a):i.value}},n(t,a,i||t)}e.exports=n},,function(e,t,a){"use strict";a.r(t);var r=a(18),n=a(33),i=a(34),o=a(3),c=a(26),l=a(9),u=a(6),s=a(16),d=(a(30),Object(o.select)("amp/block-editor").isStandardMode),m=a(41);m.keys().forEach((function(e){var t=m(e),a=t.name,r=t.render,i=t.icon;Object(n.registerPlugin)(a,{icon:i,render:r})})),Object(r.addFilter)("blocks.registerBlockType","ampEditorBlocks/addAttributes",s.a),Object(r.addFilter)("blocks.getSaveElement","ampEditorBlocks/filterSave",s.c),Object(r.addFilter)("editor.BlockEdit","ampEditorBlocks/filterEdit",s.b,20),Object(r.addFilter)("editor.PostFeaturedImage","ampEditorBlocks/withFeaturedImageNotice",c.b),Object(r.addFilter)("editor.MediaUpload","ampEditorBlocks/withMediaLibraryNotice",(function(e){return Object(u.c)(e,Object(l.b)())}));var b=["amp/amp-brid-player","amp/amp-ima-video","amp/amp-jwplayer","amp/amp-mathml","amp/amp-o2-player","amp/amp-ooyala-player","amp/amp-reach-player","amp/amp-springboard-player","amp/amp-timeago"],p=a(44);p.keys().forEach((function(e){var t=p(e),a=t.name,r=t.settings;d()&&b.includes(a)&&Object(i.registerBlockType)(a,r)}))},function(e,t){function a(t,r){return e.exports=a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},a(t,r)}e.exports=a},function(e,t){function a(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?e.exports=a=function(e){return typeof e}:e.exports=a=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(t)}e.exports=a},function(e,t,a){var r=a(14);e.exports=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=r(e)););return e}},function(e,t,a){var r={"./amp-toggle.js":42,"./pre-publish-panel.js":43,"./wrapped-amp-preview-button.js":60};function n(e){var t=i(e);return a(t)}function i(e){if(!a.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}n.keys=function(){return Object.keys(r)},n.resolve=i,e.exports=n,n.id=41},function(e,t,a){"use strict";a.r(t),a.d(t,"name",(function(){return d})),a.d(t,"icon",(function(){return m})),a.d(t,"render",(function(){return b}));var r=a(0),n=a(27),i=(a(5),a(1)),o=a(2),c=a(3),l=a(25),u=a(13),s=a(16);var d="amp",m="hidden",b=Object(u.compose)(Object(c.withSelect)((function(){return{isEnabled:Object(s.d)()}})),Object(c.withDispatch)((function(e){return{onChange:function(t){e("core/editor").editPost({amp_enabled:t})}}})),u.withInstanceId)((function(e){var t=e.isEnabled,a=e.onChange;return Object(r.createElement)(l.PluginPostStatusInfo,null,!n.errorMessages.length&&Object(r.createElement)(r.Fragment,null,Object(r.createElement)("label",{htmlFor:"amp-enabled"},Object(i.__)("Enable AMP","amp")),Object(r.createElement)(o.FormToggle,{checked:t,onChange:function(){return a(!t)},id:"amp-enabled"})),Boolean(n.errorMessages.length)&&Object(r.createElement)(o.Notice,{status:"info",isDismissible:!1,className:"amp-unavailable-notice"},Object(r.createElement)("details",null,Object(r.createElement)("summary",null,Object(i.__)("AMP Unavailable","amp")),n.errorMessages.map((function(e,t){return Object(r.createElement)(r.RawHTML,{key:t},e)})))))}))},function(e,t,a){"use strict";a.r(t),a.d(t,"name",(function(){return o})),a.d(t,"render",(function(){return c}));var r=a(0),n=a(26),i=a(9),o="amp-post-featured-image-pre-publish-panel",c=function(){return Object(r.createElement)(n.a,{dimensions:Object(i.b)(),required:!1})}},function(e,t,a){var r={"./amp-brid-player/index.js":51,"./amp-ima-video/index.js":52,"./amp-jwplayer/index.js":53,"./amp-mathml/index.js":54,"./amp-o2-player/index.js":55,"./amp-ooyala-player/index.js":56,"./amp-reach-player/index.js":57,"./amp-springboard-player/index.js":58,"./amp-timeago/index.js":59};function n(e){var t=i(e);return a(t)}function i(e){if(!a.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}n.keys=function(){return Object.keys(r)},n.resolve=i,e.exports=n,n.id=44},,,,,,,function(e,t,a){"use strict";a.r(t),a.d(t,"name",(function(){return m})),a.d(t,"settings",(function(){return b}));var r=a(1),n=a(11),i=a.n(n),o=a(0),c=(a(5),a(4)),l=a(2),u=a(6),s=function(e){var t=e.attributes,a=e.setAttributes,n=t.autoPlay,s=t.dataPartner,d=t.dataPlayer,m=t.dataVideo,b=t.dataPlaylist,p=t.dataOutstream,f=[{value:"responsive",label:Object(r.__)("Responsive","amp")},{value:"fixed-height",label:Object(r.__)("Fixed Height","amp")},{value:"fixed",label:Object(r.__)("Fixed","amp")},{value:"fill",label:Object(r.__)("Fill","amp")},{value:"flex-item",label:Object(r.__)("Flex-item","amp")},{value:"nodisplay",label:Object(r.__)("No Display","amp")}],h=!1;return s&&d&&(m||b||p)&&(h="http://cdn.brid.tv/live/partners/".concat(s)),Object(o.createElement)(o.Fragment,null,Object(o.createElement)(c.InspectorControls,null,Object(o.createElement)(l.PanelBody,{title:Object(r.__)("Brid Player Settings","amp")},Object(o.createElement)(l.TextControl,{label:Object(r.__)("Partner ID (required)","amp"),value:s,onChange:function(e){return a({dataPartner:e})}}),Object(o.createElement)(l.TextControl,{label:Object(r.__)("Player ID (required)","amp"),value:d,onChange:function(e){return a({dataPlayer:e})}}),Object(o.createElement)(l.TextControl,{label:Object(r.__)("Video ID (one of video / playlist / outstream ID is required)","amp"),value:m,onChange:function(e){return a({dataVideo:e})}}),Object(o.createElement)(l.TextControl,{label:Object(r.__)("Outstream unit ID (one of video / playlist / outstream ID is required)","amp"),value:p,onChange:function(e){return a({dataOutstream:e})}}),Object(o.createElement)(l.TextControl,{label:Object(r.__)("Playlist ID (one of video / playlist / outstream ID is required)","amp"),value:b,onChange:function(e){return a({dataPlaylist:e})}}),Object(o.createElement)(l.ToggleControl,{label:Object(r.__)("Autoplay","amp"),checked:n,onChange:function(){return a({autoPlay:!n})}}),Object(o.createElement)(u.a,i()({},e,{ampLayoutOptions:f})))),h&&Object(o.createElement)(u.b,{name:Object(r.__)("Brid Player","amp"),url:h}),!h&&Object(o.createElement)(l.Placeholder,{label:Object(r.__)("Brid Player","amp")},Object(o.createElement)("p",null,Object(r.__)("Add required data to use the block.","amp"))))},d=function(e){var t=e.attributes,a=t.dataPlayer,r=t.dataOutstream,n=t.dataPartner,i=t.ampLayout,c=t.width,l=t.height,u=t.dataVideo,s=t.autoPlay,d=t.dataPlaylist,m={layout:i,height:l,"data-player":a,"data-partner":n};return"fixed-height"!==i&&c&&(m.width=c),d&&(m["data-playlist"]=d),u&&(m["data-video"]=u),r&&(m["data-outstream"]=r),s&&(m.autoplay=s),Object(o.createElement)("amp-brid-player",m)},m="amp/amp-brid-player",b={title:Object(r.__)("AMP Brid Player","amp"),description:Object(r.__)("Displays the Brid Player used in Brid.tv Video Platform.","amp"),category:"embed",icon:"embed-generic",keywords:[Object(r.__)("Embed","amp")],attributes:{autoPlay:{type:"boolean"},dataPartner:{source:"attribute",selector:"amp-brid-player",attribute:"data-partner"},dataPlayer:{source:"attribute",selector:"amp-brid-player",attribute:"data-player"},dataVideo:{source:"attribute",selector:"amp-brid-player",attribute:"data-video"},dataPlaylist:{source:"attribute",selector:"amp-brid-player",attribute:"data-playlist"},dataOutstream:{source:"attribute",selector:"amp-brid-player",attribute:"data-outstream"},ampLayout:{default:"responsive",source:"attribute",selector:"amp-brid-player",attribute:"layout"},width:{type:"number",default:600},height:{default:400,source:"attribute",selector:"amp-brid-player",attribute:"height"}},edit:s,save:d}},function(e,t,a){"use strict";a.r(t),a.d(t,"name",(function(){return m})),a.d(t,"settings",(function(){return b}));var r=a(1),n=a(11),i=a.n(n),o=a(0),c=(a(5),a(4)),l=a(2),u=a(6),s=function(e){var t=e.attributes,a=e.setAttributes,n=t.dataDelayAdRequest,s=t.dataTag,d=t.dataSrc,m=t.dataPoster,b=[{value:"responsive",label:Object(r.__)("Responsive","amp")},{value:"fixed",label:Object(r.__)("Fixed","amp")}],p=!1;return s&&d&&(p=!0),Object(o.createElement)(o.Fragment,null,Object(o.createElement)(c.InspectorControls,null,Object(o.createElement)(l.PanelBody,{title:Object(r.__)("IMA Video Settings","amp")},Object(o.createElement)(l.TextControl,{label:Object(r.__)("HTTPS URL for your VAST ad document (required)","amp"),value:s,onChange:function(e){return a({dataTag:e})}}),Object(o.createElement)(l.TextControl,{label:Object(r.__)("HTTPS URL of your video content (required)","amp"),value:d,onChange:function(e){return a({dataSrc:e})}}),Object(o.createElement)(l.TextControl,{label:Object(r.__)("HTTPS URL to preview image","amp"),value:m,onChange:function(e){return a({dataPoster:e})}}),Object(o.createElement)(l.ToggleControl,{label:Object(r.__)("Delay Ad Request","amp"),checked:n,onChange:function(){return a({dataDelayAdRequest:!n})}}),Object(o.createElement)(u.a,i()({},e,{ampLayoutOptions:b})))),p&&Object(o.createElement)(u.b,{name:Object(r.__)("IMA Video","amp"),url:d}),!p&&Object(o.createElement)(l.Placeholder,{label:Object(r.__)("IMA Video","amp")},Object(o.createElement)("p",null,Object(r.__)("Add required data to use the block.","amp"))))},d=function(e){var t=e.attributes,a=t.width,r=t.dataSrc,n=t.ampLayout,i=t.dataTag,c=t.dataDelayAdRequest,l=t.height,u=t.dataPoster,s={layout:n,height:l,width:a,"data-tag":i,"data-src":r};return u&&(s["data-poster"]=u),c&&(s["data-delay-ad-request"]=c),Object(o.createElement)("amp-ima-video",s)},m="amp/amp-ima-video",b={title:Object(r.__)("AMP IMA Video","amp"),description:Object(r.__)("Embeds a video player for instream video ads that are integrated with the IMA SDK","amp"),category:"embed",icon:"embed-generic",keywords:[Object(r.__)("Embed","amp")],attributes:{dataDelayAdRequest:{default:!1,source:"attribute",selector:"amp-ima-video",attribute:"data-delay-ad-request"},dataTag:{source:"attribute",selector:"amp-ima-video",attribute:"data-tag"},dataSrc:{source:"attribute",selector:"amp-ima-video",attribute:"data-src"},dataPoster:{source:"attribute",selector:"amp-ima-video",attribute:"data-poster"},ampLayout:{default:"responsive",source:"attribute",selector:"amp-ima-video",attribute:"layout"},width:{default:600,source:"attribute",selector:"amp-ima-video",attribute:"width"},height:{default:400,source:"attribute",selector:"amp-ima-video",attribute:"height"}},edit:s,save:d}},function(e,t,a){"use strict";a.r(t),a.d(t,"name",(function(){return m})),a.d(t,"settings",(function(){return b}));var r=a(1),n=a(11),i=a.n(n),o=a(0),c=(a(5),a(4)),l=a(2),u=a(6),s=function(e){var t=e.attributes,a=e.setAttributes,n=t.dataPlayerId,s=t.dataMediaId,d=t.dataPlaylistId,m=[{value:"responsive",label:Object(r.__)("Responsive","amp")},{value:"fixed-height",label:Object(r.__)("Fixed Height","amp")},{value:"fixed",label:Object(r.__)("Fixed","amp")},{value:"fill",label:Object(r.__)("Fill","amp")},{value:"flex-item",label:Object(r.__)("Flex-item","amp")},{value:"nodisplay",label:Object(r.__)("No Display","amp")}],b=!1;return n&&(s||d)&&(b=d?"https://content.jwplatform.com/players/".concat(d,"-").concat(n):"https://content.jwplatform.com/players/".concat(s,"-").concat(n)),Object(o.createElement)(o.Fragment,null,Object(o.createElement)(c.InspectorControls,null,Object(o.createElement)(l.PanelBody,{title:Object(r.__)("JW Player Settings","amp")},Object(o.createElement)(l.TextControl,{label:Object(r.__)("Player ID (required)","amp"),value:n,onChange:function(e){return a({dataPlayerId:e})}}),Object(o.createElement)(l.TextControl,{label:Object(r.__)("Media ID (required if playlist ID not set)","amp"),value:s,onChange:function(e){return a({dataMediaId:e})}}),Object(o.createElement)(l.TextControl,{label:Object(r.__)("Playlist ID (required if media ID not set)","amp"),value:d,onChange:function(e){return a({dataPlaylistId:e})}}),Object(o.createElement)(u.a,i()({},e,{ampLayoutOptions:m})))),b&&Object(o.createElement)(u.b,{name:Object(r.__)("JW Player","amp"),url:b}),!b&&Object(o.createElement)(l.Placeholder,{label:Object(r.__)("JW Player","amp")},Object(o.createElement)("p",null,Object(r.__)("Add required data to use the block.","amp"))))},d=function(e){var t=e.attributes,a=t.width,r=t.height,n=t.ampLayout,i=t.dataPlaylistId,c=t.dataPlayerId,l=t.dataMediaId,u={layout:n,height:r,"data-player-id":c};return"fixed-height"!==n&&a&&(u.width=a),i&&(u["data-playlist-id"]=i),l&&(u["data-media-id"]=l),Object(o.createElement)("amp-jwplayer",u)},m="amp/amp-jwplayer",b={title:Object(r.__)("AMP JW Player","amp"),description:Object(r.__)("Displays a cloud-hosted JW Player.","amp"),category:"embed",icon:"embed-generic",keywords:[Object(r.__)("Embed","amp")],attributes:{dataPlayerId:{source:"attribute",selector:"amp-jwplayer",attribute:"data-player-id"},dataMediaId:{source:"attribute",selector:"amp-jwplayer",attribute:"data-media-id"},dataPlaylistId:{source:"attribute",selector:"amp-jwplayer",attribute:"data-playlist-id"},ampLayout:{default:"responsive",source:"attribute",selector:"amp-jwplayer",attribute:"layout"},width:{default:600,source:"attribute",selector:"amp-jwplayer",attribute:"width"},height:{default:400,source:"attribute",selector:"amp-jwplayer",attribute:"height"}},edit:s,save:d}},function(e,t,a){"use strict";a.r(t),a.d(t,"name",(function(){return l})),a.d(t,"settings",(function(){return u}));var r=a(1),n=a(0),i=(a(5),a(4)),o=function(e){var t=e.attributes,a=e.setAttributes,o=t.dataFormula;return Object(n.createElement)(i.PlainText,{value:o,placeholder:Object(r.__)("Insert formula","amp"),onChange:function(e){return a({dataFormula:e})}})},c=function(e){var t={"data-formula":e.attributes.dataFormula,layout:"container"};return Object(n.createElement)("amp-mathml",t)},l="amp/amp-mathml",u={title:Object(r.__)("AMP MathML","amp"),category:"common",icon:"welcome-learn-more",keywords:[Object(r.__)("Mathematical formula","amp"),Object(r.__)("Scientific content ","amp")],attributes:{dataFormula:{source:"attribute",selector:"amp-mathml",attribute:"data-formula"}},edit:o,save:c}},function(e,t,a){"use strict";a.r(t),a.d(t,"name",(function(){return m})),a.d(t,"settings",(function(){return b}));var r=a(1),n=a(11),i=a.n(n),o=a(0),c=(a(5),a(4)),l=a(2),u=a(6),s=function(e){var t=e.attributes,a=e.setAttributes,n=t.autoPlay,s=t.dataPid,d=t.dataVid,m=t.dataBcid,b=t.dataBid,p=[{value:"responsive",label:Object(r.__)("Responsive","amp")},{value:"fixed-height",label:Object(r.__)("Fixed Height","amp")},{value:"fixed",label:Object(r.__)("Fixed","amp")},{value:"fill",label:Object(r.__)("Fill","amp")},{value:"flex-item",label:Object(r.__)("Flex-item","amp")},{value:"nodisplay",label:Object(r.__)("No Display","amp")}],f=!1;return s&&(m||d)&&(f="https://delivery.vidible.tv/htmlembed/pid=".concat(s,"/")),Object(o.createElement)(o.Fragment,null,Object(o.createElement)(c.InspectorControls,null,Object(o.createElement)(l.PanelBody,{title:Object(r.__)("O2 Player Settings","amp")},Object(o.createElement)(l.TextControl,{label:Object(r.__)("Player ID (required)","amp"),value:s,onChange:function(e){return a({dataPid:e})}}),Object(o.createElement)(l.TextControl,{label:Object(r.__)("Buyer Company ID (either buyer or video ID is required)","amp"),value:m,onChange:function(e){return a({dataBcid:e})}}),Object(o.createElement)(l.TextControl,{label:Object(r.__)("Video ID (either buyer or video ID is required)","amp"),value:d,onChange:function(e){return a({dataVid:e})}}),Object(o.createElement)(l.TextControl,{label:Object(r.__)("Playlist ID","amp"),value:b,onChange:function(e){return a({dataBid:e})}}),Object(o.createElement)(l.ToggleControl,{label:Object(r.__)("Autoplay","amp"),checked:n,onChange:function(){return a({autoPlay:!n})}}),Object(o.createElement)(u.a,i()({},e,{ampLayoutOptions:p})))),f&&Object(o.createElement)(u.b,{name:Object(r.__)("O2 Player","amp"),url:f}),!f&&Object(o.createElement)(l.Placeholder,{label:Object(r.__)("O2 Player","amp")},Object(o.createElement)("p",null,Object(r.__)("Add required data to use the block.","amp"))))},d=function(e){var t=e.attributes,a=t.dataPid,r=t.width,n=t.height,i=t.ampLayout,c=t.dataBid,l=t.autoPlay,u=t.dataBcid,s=t.dataVid,d={layout:i,height:n,"data-pid":a};return"fixed-height"!==i&&r&&(d.width=r),l||(d["data-macros"]="m.playback=click"),s?d["data-vid"]=s:u&&(d["data-bcid"]=u),c&&(d["data-bid"]=c),Object(o.createElement)("amp-o2-player",d)},m="amp/amp-o2-player",b={title:Object(r.__)("AMP O2 Player","amp"),category:"embed",icon:"embed-generic",keywords:[Object(r.__)("Embed","amp"),Object(r.__)("AOL O2Player","amp")],attributes:{dataPid:{source:"attribute",selector:"amp-o2-player",attribute:"data-pid"},dataVid:{source:"attribute",selector:"amp-o2-player",attribute:"data-vid"},dataBcid:{source:"attribute",selector:"amp-o2-player",attribute:"data-bcid"},dataBid:{source:"attribute",selector:"amp-o2-player",attribute:"data-bid"},autoPlay:{default:!1},ampLayout:{default:"responsive",source:"attribute",selector:"amp-o2-player",attribute:"layout"},width:{default:600,source:"attribute",selector:"amp-o2-player",attribute:"width"},height:{default:400,source:"attribute",selector:"amp-o2-player",attribute:"height"}},edit:s,save:d}},function(e,t,a){"use strict";a.r(t),a.d(t,"name",(function(){return m})),a.d(t,"settings",(function(){return b}));var r=a(1),n=a(11),i=a.n(n),o=a(0),c=(a(5),a(4)),l=a(2),u=a(6),s=function(e){var t=e.attributes,a=e.setAttributes,n=t.dataEmbedCode,s=t.dataPlayerId,d=t.dataPcode,m=t.dataPlayerVersion,b=[{value:"responsive",label:Object(r.__)("Responsive","amp")},{value:"fixed",label:Object(r.__)("Fixed","amp")},{value:"fill",label:Object(r.__)("Fill","amp")},{value:"flex-item",label:Object(r.__)("Flex-item","amp")}],p=!1;return n&&s&&d&&(p="http://cf.c.ooyala.com/".concat(n)),Object(o.createElement)(o.Fragment,null,Object(o.createElement)(c.InspectorControls,null,Object(o.createElement)(l.PanelBody,{title:Object(r.__)("Ooyala Settings","amp")},Object(o.createElement)(l.TextControl,{label:Object(r.__)("Video embed code (required)","amp"),value:n,onChange:function(e){return a({dataEmbedCode:e})}}),Object(o.createElement)(l.TextControl,{label:Object(r.__)("Player ID (required)","amp"),value:s,onChange:function(e){return a({dataPlayerId:e})}}),Object(o.createElement)(l.TextControl,{label:Object(r.__)("Provider code for the account (required)","amp"),value:d,onChange:function(e){return a({dataPcode:e})}}),Object(o.createElement)(l.SelectControl,{label:Object(r.__)("Player version","amp"),value:m,options:[{value:"v3",label:Object(r.__)("V3","amp")},{value:"v4",label:Object(r.__)("V4","amp")}],onChange:function(e){return a({dataPlayerVersion:e})}}),Object(o.createElement)(u.a,i()({},e,{ampLayoutOptions:b})))),p&&Object(o.createElement)(u.b,{name:Object(r.__)("Ooyala Player","amp"),url:p}),!p&&Object(o.createElement)(l.Placeholder,{label:Object(r.__)("Ooyala Player","amp")},Object(o.createElement)("p",null,Object(r.__)("Add required data to use the block.","amp"))))},d=function(e){var t=e.attributes,a=t.dataEmbedCode,r=t.dataPlayerId,n=t.dataPcode,i=t.dataPlayerVersion,c=t.ampLayout,l=t.height,u=t.width,s={layout:c,height:l,"data-embedcode":a,"data-playerid":r,"data-pcode":n,"data-playerversion":i};return"fixed-height"!==c&&u&&(s.width=u),Object(o.createElement)("amp-ooyala-player",s)},m="amp/amp-ooyala-player",b={title:Object(r.__)("AMP Ooyala Player","amp"),description:Object(r.__)("Displays an Ooyala video.","amp"),category:"embed",icon:"embed-generic",keywords:[Object(r.__)("Embed","amp"),Object(r.__)("Ooyala video","amp")],attributes:{dataEmbedCode:{source:"attribute",selector:"amp-ooyala-player",attribute:"data-embedcode"},dataPlayerId:{source:"attribute",selector:"amp-ooyala-player",attribute:"data-playerid"},dataPcode:{source:"attribute",selector:"amp-ooyala-player",attribute:"data-pcode"},dataPlayerVersion:{default:"v3",source:"attribute",selector:"amp-ooyala-player",attribute:"data-playerversion"},ampLayout:{default:"responsive",source:"attribute",selector:"amp-ooyala-player",attribute:"layout"},width:{default:600,source:"attribute",selector:"amp-ooyala-player",attribute:"width"},height:{default:400,source:"attribute",selector:"amp-ooyala-player",attribute:"height"}},edit:s,save:d}},function(e,t,a){"use strict";a.r(t),a.d(t,"name",(function(){return m})),a.d(t,"settings",(function(){return b}));var r=a(1),n=a(11),i=a.n(n),o=a(0),c=(a(5),a(4)),l=a(2),u=a(6),s=function(e){var t=e.attributes,a=e.setAttributes,n=t.dataEmbedId,s=[{value:"responsive",label:Object(r.__)("Responsive","amp")},{value:"fixed-height",label:Object(r.__)("Fixed Height","amp")},{value:"fixed",label:Object(r.__)("Fixed","amp")},{value:"fill",label:Object(r.__)("Fill","amp")},{value:"flex-item",label:Object(r.__)("Flex-item","amp")}],d=!1;return n&&(d="https://media-cdn.beachfrontreach.com/acct_1/video/"),Object(o.createElement)(o.Fragment,null,Object(o.createElement)(c.InspectorControls,null,Object(o.createElement)(l.PanelBody,{title:Object(r.__)("Reach Settings","amp")},Object(o.createElement)(l.TextControl,{label:Object(r.__)("Embed ID (required)","amp"),value:n,onChange:function(e){return a({dataEmbedId:e})}}),Object(o.createElement)(u.a,i()({},e,{ampLayoutOptions:s})))),d&&Object(o.createElement)(u.b,{name:Object(r.__)("Reach Player","amp"),url:d}),!d&&Object(o.createElement)(l.Placeholder,{label:Object(r.__)("Reach Player","amp")},Object(o.createElement)("p",null,Object(r.__)("Add Reach player embed ID to use the block.","amp"))))},d=function(e){var t=e.attributes,a=t.dataEmbedId,r=t.ampLayout,n=t.height,i=t.width,c={layout:r,height:n,"data-embed-id":a};return"fixed-height"!==r&&i&&(c.width=i),Object(o.createElement)("amp-reach-player",c)},m="amp/amp-reach-player",b={title:Object(r.__)("AMP Reach Player","amp"),description:Object(r.__)("Displays the Reach Player configured in the Beachfront Reach platform.","amp"),category:"embed",icon:"embed-generic",keywords:[Object(r.__)("Embed","amp"),Object(r.__)("Beachfront Reach video","amp")],attributes:{dataEmbedId:{source:"attribute",selector:"amp-reach-player",attribute:"data-embed-id"},ampLayout:{default:"fixed-height",source:"attribute",selector:"amp-reach-player",attribute:"layout"},width:{default:600,source:"attribute",selector:"amp-reach-player",attribute:"width"},height:{default:400,source:"attribute",selector:"amp-reach-player",attribute:"height"}},edit:s,save:d}},function(e,t,a){"use strict";a.r(t),a.d(t,"name",(function(){return m})),a.d(t,"settings",(function(){return b}));var r=a(1),n=a(11),i=a.n(n),o=a(0),c=(a(5),a(4)),l=a(2),u=a(6),s=function(e){var t=e.attributes,a=e.setAttributes,n=t.dataSiteId,s=t.dataPlayerId,d=t.dataContentId,m=t.dataDomain,b=t.dataMode,p=t.dataItems,f=[{value:"responsive",label:Object(r.__)("Responsive","amp")},{value:"fixed",label:Object(r.__)("Fixed","amp")},{value:"fill",label:Object(r.__)("Fill","amp")},{value:"flex-item",label:Object(r.__)("Flex-item","amp")}],h=!1;return n&&d&&m&&b&&p&&(h="https://cms.springboardplatform.com/embed_iframe/"),Object(o.createElement)(o.Fragment,null,Object(o.createElement)(c.InspectorControls,null,Object(o.createElement)(l.PanelBody,{title:Object(r.__)("Springboard Player Settings","amp")},Object(o.createElement)(l.TextControl,{label:Object(r.__)("Site ID (required)","amp"),value:n,onChange:function(e){return a({dataSiteId:e})}}),Object(o.createElement)(l.TextControl,{label:Object(r.__)("Content ID (required)","amp"),value:d,onChange:function(e){return a({dataContentId:e})}}),Object(o.createElement)(l.TextControl,{label:Object(r.__)("Player ID","amp"),value:s,onChange:function(e){return a({dataPlayerId:e})}}),Object(o.createElement)(l.TextControl,{label:Object(r.__)("Springboard partner domain","amp"),value:m,onChange:function(e){return a({dataDomain:e})}}),Object(o.createElement)(l.SelectControl,{label:Object(r.__)("Mode (required)","amp"),value:b,options:[{value:"video",label:Object(r.__)("Video","amp")},{value:"playlist",label:Object(r.__)("Playlist","amp")}],onChange:function(e){return a({dataMode:e})}}),Object(o.createElement)(l.TextControl,{type:"number",label:Object(r.__)("Number of video is playlist (required)","amp"),value:p,onChange:function(e){return a({dataItems:e})}}),Object(o.createElement)(u.a,i()({},e,{ampLayoutOptions:f})))),h&&Object(o.createElement)(u.b,{name:Object(r.__)("Springboard Player","amp"),url:h}),!h&&Object(o.createElement)(l.Placeholder,{label:Object(r.__)("Springboard Player","amp")},Object(o.createElement)("p",null,Object(r.__)("Add required data to use the block.","amp"))))},d=function(e){var t=e.attributes,a=t.dataSiteId,r=t.dataPlayerId,n=t.dataContentId,i=t.dataDomain,c=t.dataMode,l=t.dataItems,u=t.ampLayout,s=t.height,d=t.width,m={layout:u,height:s,"data-site-id":a,"data-mode":c,"data-content-id":n,"data-player-id":r,"data-domain":i,"data-items":l};return"fixed-height"!==u&&d&&(m.width=t.width),Object(o.createElement)("amp-springboard-player",m)},m="amp/amp-springboard-player",b={title:Object(r.__)("AMP Springboard Player","amp"),description:Object(r.__)("Displays the Springboard Player used in the Springboard Video Platform","amp"),category:"embed",icon:"embed-generic",keywords:[Object(r.__)("Embed","amp")],attributes:{dataSiteId:{source:"attribute",selector:"amp-springboard-player",attribute:"data-site-id"},dataContentId:{source:"attribute",selector:"amp-springboard-player",attribute:"data-content-id"},dataPlayerId:{source:"attribute",selector:"amp-springboard-player",attribute:"data-player-id"},dataDomain:{source:"attribute",selector:"amp-springboard-player",attribute:"data-domain"},dataMode:{default:"video",source:"attribute",selector:"amp-springboard-player",attribute:"data-mode"},dataItems:{default:1,source:"attribute",selector:"amp-springboard-player",attribute:"data-items"},ampLayout:{default:"responsive",source:"attribute",selector:"amp-springboard-player",attribute:"layout"},width:{default:600,source:"attribute",selector:"amp-springboard-player",attribute:"width"},height:{default:400,source:"attribute",selector:"amp-springboard-player",attribute:"height"}},edit:s,save:d}},function(e,t,a){"use strict";a.r(t),a.d(t,"name",(function(){return p})),a.d(t,"settings",(function(){return f}));var r=a(1),n=a(11),i=a.n(n),o=a(0),c=a(15),l=a.n(c),u=(a(5),a(4)),s=a(2),d=a(6),m=function(e){var t,a=e.attributes,n=e.setAttributes,c=a.align,m=a.cutoff,b=a.dateTime;b?t=m&&parseInt(m)<Math.abs(l()(b).diff(l()(),"seconds"))?l()(b).format("dddd D MMMM HH:mm"):l()(b).fromNow():(t=l()(Date.now()).fromNow(),n({dateTime:l()(l()(),l.a.ISO_8601,!0).format()}));var p=[{value:"",label:Object(r.__)("Responsive","amp")},{value:"fixed",label:Object(r.__)("Fixed","amp")},{value:"fixed-height",label:Object(r.__)("Fixed Height","amp")}];return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(u.InspectorControls,null,Object(o.createElement)(s.PanelBody,{title:Object(r.__)("AMP Timeago Settings","amp")},Object(o.createElement)(s.DateTimePicker,{locale:"en",currentDate:b||l()(),onChange:function(e){return n({dateTime:l()(e,l.a.ISO_8601,!0).format()})}}),Object(o.createElement)(d.a,i()({},e,{ampLayoutOptions:p})),Object(o.createElement)(s.TextControl,{type:"number",className:"blocks-amp-timeout__cutoff",label:Object(r.__)("Cutoff (seconds)","amp"),value:void 0!==m?m:"",onChange:function(e){return n({cutoff:e})}}))),Object(o.createElement)(u.BlockControls,null,Object(o.createElement)(u.BlockAlignmentToolbar,{value:c,onChange:function(e){n({align:e})},controls:["left","center","right"]})),Object(o.createElement)("time",{dateTime:b},t))},b=function(e){var t=e.attributes,a=t.ampLayout,r=t.width,n=t.height,i=t.align,c=t.cutoff,u={layout:"responsive",className:"align"+(i||"none"),datetime:t.dateTime,locale:"en"};if(c&&(u.cutoff=c),a)switch(a){case"fixed-height":n&&(u.height=n,u.layout=a);break;case"fixed":n&&r&&(u.height=n,u.width=r,u.layout=a)}return Object(o.createElement)("amp-timeago",u,l()(t.dateTime).format("dddd D MMMM HH:mm"))},p="amp/amp-timeago",f={title:Object(r.__)("AMP Timeago","amp"),category:"common",icon:"backup",keywords:[Object(r.__)("Time difference","amp"),Object(r.__)("Time ago","amp"),Object(r.__)("Date","amp")],attributes:{align:{type:"string"},cutoff:{source:"attribute",selector:"amp-timeago",attribute:"cutoff"},dateTime:{source:"attribute",selector:"amp-timeago",attribute:"datetime"},ampLayout:{default:"fixed-height",source:"attribute",selector:"amp-timeago",attribute:"layout"},width:{source:"attribute",selector:"amp-timeago",attribute:"width"},height:{default:20,source:"attribute",selector:"amp-timeago",attribute:"height"}},getEditWrapperProps:function(e){var t=e.align;if("left"===t||"right"===t||"center"===t)return{"data-align":t}},edit:m,save:b}},function(e,t,a){"use strict";a.r(t),a.d(t,"name",(function(){return T})),a.d(t,"render",(function(){return A}));var r=a(19),n=a.n(r),i=a(23),o=a.n(i),c=a(20),l=a.n(c),u=a(21),s=a.n(u),d=a(14),m=a.n(d),b=a(0),p=a(12),f=a(3),h=a(13),y=a(7),O=a(17),g=a.n(O),j=(a(22),a(5),a(2)),v=a(1),_=a(31),w=a(16);function P(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=m()(e);if(t){var n=m()(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return s()(this,a)}}var E=function(e){return Object(b.createElement)("svg",e,Object(b.createElement)("path",{d:"M41.629 28.161L28.624 49.804h-2.356l2.33-14.102-7.214.009-.1.002c-.65 0-1.176-.526-1.176-1.176 0-.279.259-.751.259-.751L33.329 12.17l2.395.01-2.388 14.123 7.251-.009h.115c.65 0 1.176.525 1.176 1.175 0 .264-.103.495-.25.691v.001zM31 0C13.879 0 0 13.88 0 31c0 17.121 13.879 31 31 31 17.12 0 31-13.879 31-31C62 13.88 48.12 0 31 0z",fill:"#82878c"}))};E.defaultProps={width:"62",height:"62",viewBox:"0 0 62 62",xmlns:"http://www.w3.org/2000/svg"};var x=function(e){return Object(b.createElement)("svg",e,Object(b.createElement)("path",{className:"outer",d:"M48 12c19.9 0 36 16.1 36 36S67.9 84 48 84 12 67.9 12 48s16.1-36 36-36",fill:"none"}),Object(b.createElement)("path",{className:"inner",d:"M48 33c8.285 0 15 6.716 15 15 0 8.284-6.715 15-15 15-8.284 0-15-6.716-15-15 0-8.284 6.716-15 15-15zm-1.15 24.098l6.293-10.472a.555.555 0 0 0 .12-.335.569.569 0 0 0-.624-.568l-3.508.004 1.155-6.834-1.159-.005-6.272 10.46s-.125.228-.125.363c0 .314.255.57.569.57l.048-.001 3.49-.005-1.126 6.823h1.14z",fill:"none"}))};x.defaultProps={xmlns:"http://www.w3.org/2000/svg"};var C=function(e){l()(a,e);var t=P(a);function a(){var e;n()(this,a);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return(e=t.call.apply(t,[this].concat(i))).buttonRef=Object(b.createRef)(),e.openPreviewWindow=e.openPreviewWindow.bind(g()(e)),e}return o()(a,[{key:"componentDidUpdate",value:function(e){var t=this.props.previewLink;t&&!e.previewLink&&this.setPreviewWindowLink(t)}},{key:"setPreviewWindowLink",value:function(e){var t=this.previewWindow;t&&!t.closed&&(t.location=e,this.buttonRef.current&&this.buttonRef.current.focus())}},{key:"getWindowTarget",value:function(){var e=this.props.postId;return"amp-preview-".concat(e)}},{key:"openPreviewWindow",value:function(e){var t,a;(e.preventDefault(),this.previewWindow&&!this.previewWindow.closed||(this.previewWindow=window.open("",this.getWindowTarget())),this.previewWindow.focus(),this.props.isAutosaveable)?(this.props.isDraft?this.props.savePost({isPreview:!0}):this.props.autosave({isPreview:!0}),t=this.previewWindow.document,a=Object(b.renderToString)(Object(b.createElement)("div",{className:"editor-post-preview-button__interstitial-message"},Object(b.createElement)(j.Icon,{icon:x({viewBox:"0 0 98 98"})}),Object(b.createElement)("p",null,Object(v.__)("Generating AMP preview…","amp")))),a+='\n\t\t<style>\n\t\t\tbody {\n\t\t\t\tmargin: 0;\n\t\t\t}\n\t\t\t.editor-post-preview-button__interstitial-message {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: column;\n\t\t\t\talign-items: center;\n\t\t\t\tjustify-content: center;\n\t\t\t\theight: 100vh;\n\t\t\t\twidth: 100vw;\n\t\t\t}\n\t\t\t@-webkit-keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@-moz-keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@-o-keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t.editor-post-preview-button__interstitial-message svg {\n\t\t\t\twidth: 198px;\n\t\t\t\theight: 198px;\n\t\t\t\tstroke: #555d66;\n\t\t\t\tstroke-width: 0.75;\n\t\t\t}\n\t\t\t.editor-post-preview-button__interstitial-message svg .outer,\n\t\t\t.editor-post-preview-button__interstitial-message svg .inner {\n\t\t\t\tstroke-dasharray: 280;\n\t\t\t\tstroke-dashoffset: 280;\n\t\t\t\t-webkit-animation: paint 1.5s ease infinite alternate;\n\t\t\t\t-moz-animation: paint 1.5s ease infinite alternate;\n\t\t\t\t-o-animation: paint 1.5s ease infinite alternate;\n\t\t\t\tanimation: paint 1.5s ease infinite alternate;\n\t\t\t}\n\t\t\tp {\n\t\t\t\ttext-align: center;\n\t\t\t\tfont-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;\n\t\t\t}\n\t\t</style>\n\t',t.write(a),t.title=Object(v.__)("Generating AMP preview…","amp"),t.close()):this.setPreviewWindowLink(e.target.href)}},{key:"render",value:function(){var e=this.props,t=e.previewLink,a=e.currentPostLink,r=e.errorMessages,n=e.isEnabled,i=e.isSaveable,o=e.isStandardMode,c=t||a;return n&&!r.length&&!o&&Object(b.createElement)(j.Button,{className:"amp-editor-post-preview",href:c,title:Object(v.__)("Preview AMP","amp"),isSecondary:!0,disabled:!i,onClick:this.openPreviewWindow,ref:this.buttonRef},E({viewBox:"0 0 62 62",width:18,height:18}),Object(b.createElement)("span",{className:"screen-reader-text"},
16
  /* translators: accessibility text */
17
- Object(v.__)("(opens in a new tab)","amp")))}}]),a}(b.Component),S=Object(h.compose)([Object(f.withSelect)((function(e,t){var a=t.forcePreviewLink,r=t.forceIsAutosaveable,n=e("core/editor"),i=n.getCurrentPostId,o=n.getCurrentPostAttribute,c=n.getEditedPostAttribute,l=n.isEditedPostSaveable,u=n.isEditedPostAutosaveable,s=n.getEditedPostPreviewLink,d=e("amp/block-editor"),m=d.getAmpSlug,b=d.getErrorMessages,p=d.isStandardMode,f={};f[m()]=1;var h=s(),y=h?Object(_.addQueryArgs)(h,f):void 0;return{postId:i(),currentPostLink:Object(_.addQueryArgs)(o("link"),f),previewLink:void 0!==a?a:y,isSaveable:l(),isAutosaveable:r||u(),isDraft:-1!==["draft","auto-draft"].indexOf(c("status")),isEnabled:Object(w.d)(),errorMessages:b(),isStandardMode:p()}})),Object(f.withDispatch)((function(e){return{autosave:e("core/editor").autosave,savePost:e("core/editor").savePost}}))])(C);function I(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=m()(e);if(t){var n=m()(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return s()(this,a)}}var k=function(e){l()(a,e);var t=I(a);function a(){var e;n()(this,a);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return(e=t.call.apply(t,[this].concat(i))).root=document.createElement("div"),e.root.className="amp-wrapper-post-preview",e.postPreviewButton=document.querySelector(".".concat(y.d)),e}return o()(a,[{key:"componentDidMount",value:function(){this.postPreviewButton&&this.postPreviewButton.parentNode.insertBefore(this.root,this.postPreviewButton.nextSibling)}},{key:"componentWillUnmount",value:function(){this.postPreviewButton&&this.postPreviewButton.parentNode.removeChild(this.root)}},{key:"render",value:function(){return this.postPreviewButton?Object(b.createPortal)(Object(b.createElement)(S,null),this.root):null}}]),a}(b.Component),T="amp-preview-button-wrapper",A=Object(h.pure)(Object(h.compose)([Object(f.withSelect)((function(e){var t=(0,e("core").getPostType)((0,e("core/editor").getEditedPostAttribute)("type"));return{isViewable:Object(p.get)(t,["viewable"],!1)}})),Object(h.ifCondition)((function(e){return e.isViewable}))])(k))}]);
1
+ !function(e){var t={};function a(r){if(t[r])return t[r].exports;var n=t[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,a),n.l=!0,n.exports}a.m=e,a.c=t,a.d=function(e,t,r){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(a.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)a.d(r,n,function(t){return e[t]}.bind(null,n));return r},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="",a(a.s=37)}([function(e,t){!function(){e.exports=this.wp.element}()},function(e,t){!function(){e.exports=this.wp.i18n}()},function(e,t){!function(){e.exports=this.wp.components}()},function(e,t){!function(){e.exports=this.wp.data}()},function(e,t){!function(){e.exports=this.wp.blockEditor}()},function(e,t,a){e.exports=a(28)()},function(e,t,a){"use strict";a.d(t,"b",(function(){return o})),a.d(t,"a",(function(){return c})),a.d(t,"c",(function(){return k}));var r=a(0),n=(a(5),a(22),a(2)),i=a(1),o=function(e){var t=e.name,a=e.url;return Object(r.createElement)(n.Placeholder,{label:t},Object(r.createElement)("p",{className:"components-placeholder__error"},a),Object(r.createElement)("p",{className:"components-placeholder__error"},Object(i.__)("Previews for this are unavailable in the editor, sorry!","amp")))},c=function(e){var t=e.attributes,a=e.setAttributes,o=e.ampLayoutOptions,c=t.ampLayout,l=t.height,u=t.width,s=!l&&("fixed"===c||"fixed-height"===c),d=!u&&"fixed"===c;return Object(r.createElement)(r.Fragment,null,Object(r.createElement)(n.SelectControl,{label:Object(i.__)("Layout","amp"),value:c,options:o,onChange:function(e){return a({ampLayout:e})}}),d&&Object(r.createElement)(n.Notice,{status:"error",isDismissible:!1},Object(i.sprintf)(
2
  /* translators: %s is the layout name */
3
  Object(i.__)("Width is required for %s layout","amp"),c)),Object(r.createElement)(n.TextControl,{type:"number",label:Object(i.__)("Width (px)","amp"),value:void 0!==u?u:"",onChange:function(e){return a({width:e})}}),s&&Object(r.createElement)(n.Notice,{status:"error",isDismissible:!1},Object(i.sprintf)(
4
  /* translators: %s is the layout name */
5
+ Object(i.__)("Height is required for %s layout","amp"),c)),Object(r.createElement)(n.TextControl,{type:"number",label:Object(i.__)("Height (px)","amp"),value:l,onChange:function(e){return a({height:e})}}))},l=a(9),u=a.n(l),s=a(19),d=a.n(s),m=a(24),b=a.n(m),p=a(17),f=a.n(p),h=a(20),O=a.n(h),y=a(21),g=a.n(y),j=a(35),v=a.n(j),_=a(14),w=a.n(_),P=a(3),E=a(25),x=a(8);function C(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,r)}return a}function S(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?C(Object(a),!0).forEach((function(t){u()(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):C(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}function I(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=w()(e);if(t){var n=w()(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return g()(this,a)}}var T=window.wp,k=function(e,t){var a=t.width,r=t.height;return function(e){O()(n,e);var t=I(n);function n(){var e,a;d()(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return"editor-post-featured-image__media-modal"===(a=t.call.apply(t,[this].concat(i))).props.modalClass?(a.initFeaturedImage=a.initFeaturedImage.bind(f()(a)),a.initFeaturedImage()):(a.frame.off("open",a.onOpen),a.frame.on("open",v()((e=f()(a),w()(n.prototype)),"onOpen",e).bind(f()(a)))),a}return b()(n,[{key:"initFeaturedImage",value:function(){var e=Object(E.c)(E.b),t=T.media.controller.FeaturedImage.extend({defaults:S(S({},T.media.controller.FeaturedImage.prototype.defaults),{},{date:!1,filterable:!1,suggestedWidth:a,suggestedHeight:r})});this.frame=new e({allowedTypes:this.props.allowedTypes,state:"featured-image",states:[new t,new T.media.controller.EditImage]}),this.frame.on("toolbar:create:featured-image",(function(e){this.createSelectToolbar(e,{text:T.media.view.l10n.setFeaturedImage,state:this.options.state})}),this.frame),this.frame.on("open",this.onOpen),this.frame.state("featured-image").on("select",this.onSelectImage,this),T.media.frame=this.frame}},{key:"onOpen",value:function(){var e=this.frame.content.get();if(e&&e.collection){var t=e.collection;t.toArray().forEach((function(e){return e.trigger("destroy",e)})),t.mirroring._hasMore=!0,t.more()}}},{key:"onSelectImage",value:function(){var e=this.frame.state("featured-image").get("selection").first().toJSON(),t=this.props.onSelect,a=e.url,r=e.id,n=e.width,i=e.height;Object(x.e)({url:a,id:r,width:n,height:i,onSelect:t,dispatchImage:function(e){Object(P.dispatch)("core/editor").editPost({featured_media:e})}}),T.media.view.settings.post.featuredImageId&&T.media.featuredImage.set(e?e.id:-1)}}]),n}(e)}},function(e,t,a){"use strict";a.d(t,"e",(function(){return r})),a.d(t,"c",(function(){return n})),a.d(t,"b",(function(){return i})),a.d(t,"a",(function(){return o})),a.d(t,"d",(function(){return c}));var r=["core/paragraph","core/heading","core/code","core/quote","core/subhead"],n=["core/image","core/video"],i=608,o=400,c="editor-post-preview"},function(e,t,a){"use strict";a.d(t,"d",(function(){return c})),a.d(t,"b",(function(){return l})),a.d(t,"f",(function(){return u})),a.d(t,"c",(function(){return s})),a.d(t,"a",(function(){return d})),a.d(t,"e",(function(){return m}));var r=a(12),n=a(23),i=a(1),o=a(11),c=function(e,t){if(!e||!e.width||!e.height)return!1;var a=t.width,r=t.height;return(!a||e.width>=a)&&(!r||e.height>=r)},l=function(){return{width:n.featuredImageMinimumWidth,height:n.featuredImageMinimumHeight}},u=function(e,t,a){if(!e)return a?[Object(i.__)("Selecting a featured image is required.","amp")]:[Object(i.__)("Selecting a featured image is recommended for an optimal user experience.","amp")];var r=[];if(["image/png","image/gif","image/jpeg"].includes(e.mime_type)||r.push(
6
  /* translators: 1: .jpg, 2: .png. 3: .gif */
7
+ Object(i.sprintf)(Object(i.__)("The featured image must be in %1$s, %2$s, or %3$s format.","amp"),".jpg",".png",".gif")),!c(e.media_details,t)){var n=t.width,o=t.height;n&&o?r.push(
8
  /* translators: 1: minimum width, 2: minimum height. */
9
+ Object(i.sprintf)(Object(i.__)("The featured image should have a size of at least %1$s by %2$s pixels.","amp"),Math.ceil(n),Math.ceil(o))):t.width?r.push(
10
+ /* translators: placeholder is minimum width. */
11
+ Object(i.sprintf)(Object(i.__)("The featured image should have a width of at least %s pixels.","amp"),Math.ceil(n))):t.height&&r.push(
12
+ /* translators: placeholder is minimum height. */
13
+ Object(i.sprintf)(Object(i.__)("The featured image should have a height of at least %s pixels.","amp"),Math.ceil(o)))}return 0===r.length?null:r},s=function(e){var t=Object(r.template)("<p>".concat(e,"</p>"),{evaluate:/<#([\s\S]+?)#>/g,interpolate:/\{\{\{([\s\S]+?)\}\}\}/g,escape:/\{\{([^\}]+?)\}\}(?!\})/g});return function(e){return t(e)}},d=function(e,t){if(e){var a=Object(r.get)(this,["options","allowedTypes"],null),n=this.get("select");a&&e.get("type")&&!function(e,t){var a=e.get("type"),r=e.get("mime");return!(!t.includes(a)&&!t.includes(r))&&"video"!==a}(e,a)?(this.secondary.set(o.a,new t({mimeType:e.get("mime")})),n&&n.model&&n.model.set("disabled",!0)):(this.secondary.unset(o.a),n&&n.model&&n.model.set("disabled",!1))}},m=function(e){var t=e.url,a=e.id,n=e.width,i=e.height,o=e.onSelect,c=e.dispatchImage,l={};l.url=t,l.thumbnail_url=t,l.timestamp=Object(r.now)(),a&&(l.attachment_id=a),n&&(l.width=n),i&&(l.height=i),o(l),c(a)}},function(e,t){e.exports=function(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}},function(e,t){function a(){return e.exports=a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},a.apply(this,arguments)}e.exports=a},function(e,t,a){"use strict";a.d(t,"c",(function(){return r})),a.d(t,"b",(function(){return n})),a.d(t,"a",(function(){return i}));var r=6,n=72,i="select-file-type-error"},function(e,t){!function(){e.exports=this.lodash}()},function(e,t){!function(){e.exports=this.wp.compose}()},function(e,t){function a(t){return e.exports=a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},a(t)}e.exports=a},function(e,t){!function(){e.exports=this.moment}()},function(e,t,a){"use strict";a.d(t,"a",(function(){return b})),a.d(t,"c",(function(){return p})),a.d(t,"b",(function(){return O})),a.d(t,"d",(function(){return x}));var r=a(0),n=(a(5),a(22),a(1)),i=a(2),o=a(4),c=a(3),l=a(7),u=a(11);function s(e,t){var a;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(a=function(e,t){if(!e)return;if("string"==typeof e)return d(e,t);var a=Object.prototype.toString.call(e).slice(8,-1);"Object"===a&&e.constructor&&(a=e.constructor.name);if("Map"===a||"Set"===a)return Array.from(e);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return d(e,t)}(e))||t&&e&&"number"==typeof e.length){a&&(e=a);var r=0,n=function(){};return{s:n,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,c=!1;return{s:function(){a=e[Symbol.iterator]()},n:function(){var e=a.next();return o=e.done,e},e:function(e){c=!0,i=e},f:function(){try{o||null==a.return||a.return()}finally{if(c)throw i}}}}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,r=new Array(t);a<t;a++)r[a]=e[a];return r}var m=[{value:"nodisplay",label:Object(n.__)("No Display","amp"),notAvailable:["core-embed/vimeo","core-embed/dailymotion","core-embed/reddit","core-embed/soundcloud"]},{value:"fixed",label:Object(n.__)("Fixed","amp"),notAvailable:["core-embed/soundcloud"]},{value:"responsive",label:Object(n.__)("Responsive","amp"),notAvailable:["core-embed/soundcloud"]},{value:"fixed-height",label:Object(n.__)("Fixed Height","amp"),notAvailable:[]},{value:"fill",label:Object(n.__)("Fill","amp"),notAvailable:["core-embed/soundcloud"]},{value:"flex-item",label:Object(n.__)("Flex Item","amp"),notAvailable:["core-embed/soundcloud"]},{value:"intrinsic",label:Object(n.__)("Intrinsic","amp"),notAvailable:["core/video","core-embed/youtube","core-embed/facebook","core-embed/instagram","core-embed/vimeo","core-embed/dailymotion","core-embed/reddit","core-embed/soundcloud"]}],b=function(e,t){return"core/gallery"===t&&(e.attributes||(e.attributes={}),e.attributes.ampCarousel={type:"boolean",default:!Object(c.select)("amp/block-editor").hasThemeSupport()},e.attributes.ampLightbox={type:"boolean",default:!1}),"core/image"===t&&(e.attributes||(e.attributes={}),e.attributes.ampLightbox={type:"boolean",default:!1}),l.e.includes(t)&&(e.attributes||(e.attributes={}),e.attributes.ampFitText={type:"boolean",default:!1},e.attributes.minFont={default:u.c,source:"attribute",selector:"amp-fit-text",attribute:"min-font-size"},e.attributes.maxFont={default:u.b,source:"attribute",selector:"amp-fit-text",attribute:"max-font-size"},e.attributes.height={default:"core/image"===t?200:10*Math.ceil(u.b/10),source:"attribute",selector:"amp-fit-text",attribute:"height"}),(0===t.indexOf("core-embed")||l.c.includes(t))&&(e.attributes||(e.attributes={}),e.attributes.ampLayout={type:"string"},e.attributes.ampNoLoading={type:"boolean"}),e},p=function(e,t,a){var n={layout:"fixed-height"};if("core/paragraph"!==t.name||a.ampFitText){if(l.e.includes(t.name)&&a.ampFitText)return a.minFont&&(n["min-font-size"]=a.minFont),a.maxFont&&(n["max-font-size"]=a.maxFont),a.height&&(n.height=a.height),n.children=e,Object(r.createElement)("amp-fit-text",n)}else{var i=f(a.content);if(i!==a.content)return Object(r.cloneElement)(e,{key:"new",value:i})}return e},f=function(e){var t=/<amp-fit-text\b[^>]*>(.*?)<\/amp-fit-text>/.exec(e),a=e;return t&&t[1]&&(a=t[1]),a},h=function(e){var t,a=[{value:"",label:Object(n.__)("Default","amp")}],r=s(m);try{for(r.s();!(t=r.n()).done;){var i=t.value;!i.notAvailable.includes(e)&&a.push({value:i.value,label:i.label})}}catch(e){r.e(e)}finally{r.f()}return a},O=function(e){return function(t){var a,n=t.attributes.ampLayout,i=t.name;return"core/gallery"===i?a=E(t):"core/image"===i?a=P(t):l.c.includes(i)||0===i.indexOf("core-embed/")?a=y(t):l.e.includes(i)&&(a=v(t)),n&&"nodisplay"===n?[a]:Object(r.createElement)(r.Fragment,null,Object(r.createElement)(e,t),a)}},y=function(e){return e.isSelected?Object(r.createElement)(o.InspectorControls,null,Object(r.createElement)(i.PanelBody,{title:Object(n.__)("AMP Settings","amp")},Object(r.createElement)(g,e),Object(r.createElement)(j,e))):null},g=function(e){var t=e.name,a=e.attributes.ampLayout,o=e.setAttributes,c=Object(n.__)("AMP Layout","amp");return"core/image"===t&&(c=Object(n.__)("AMP Layout (modifies width/height)","amp")),Object(r.createElement)(i.SelectControl,{label:c,value:a,options:h(t),onChange:function(t){o({ampLayout:t}),"core/image"===e.name&&function(e,t){var a=e.attributes,r=e.setAttributes;switch(t){case"fixed-height":a.height||r({height:l.a}),a.ampLightbox&&r({ampLightbox:!1});break;case"fixed":a.height||r({height:l.a}),a.width||r({width:l.b})}}(e,t)}})},j=function(e){var t=e.attributes.ampNoLoading,a=e.setAttributes,o=Object(n.__)("AMP Noloading","amp");return Object(r.createElement)(i.ToggleControl,{label:o,checked:t,onChange:function(){return a({ampNoLoading:!t})}})},v=function(e){var t=e.isSelected,a=e.attributes,c=e.setAttributes,l=a.ampFitText,s=a.minFont,d=a.maxFont,m=a.height,b=[{name:"small",shortName:Object(n._x)("S","font size","amp"),size:14},{name:"regular",shortName:Object(n._x)("M","font size","amp"),size:16},{name:"large",shortName:Object(n._x)("L","font size","amp"),size:36},{name:"larger",shortName:Object(n._x)("XL","font size","amp"),size:48}];if(!t)return null;var p=Object(n.__)("Automatically fit text to container","amp");return l&&(d=parseInt(d),m=parseInt(m),s=parseInt(s)),Object(r.createElement)(o.InspectorControls,null,Object(r.createElement)(i.PanelBody,{title:Object(n.__)("AMP Settings","amp"),className:l?"is-amp-fit-text":""},Object(r.createElement)(i.ToggleControl,{label:p,checked:l,onChange:function(){return c({ampFitText:!l})}})),l&&Object(r.createElement)(r.Fragment,null,Object(r.createElement)(i.TextControl,{label:Object(n.__)("Height","amp"),value:m,min:1,onChange:function(e){c({height:e})}}),d>m&&Object(r.createElement)(i.Notice,{status:"error",isDismissible:!1},Object(n.__)("The height must be greater than the max font size.","amp")),Object(r.createElement)(i.PanelBody,{title:Object(n.__)("Minimum font size","amp")},Object(r.createElement)(i.FontSizePicker,{fallbackFontSize:14,value:s,fontSizes:b,onChange:function(e){e||(e=u.c),parseInt(e)<=d&&c({minFont:e})}})),s>d&&Object(r.createElement)(i.Notice,{status:"error",isDismissible:!1},Object(n.__)("The min font size must less than the max font size.","amp")),Object(r.createElement)(i.PanelBody,{title:Object(n.__)("Maximum font size","amp")},Object(r.createElement)(i.FontSizePicker,{fallbackFontSize:48,value:d,fontSizes:b,onChange:function(e){e||(e=u.b),c({maxFont:e,height:Math.max(e,m)})}}))))},_=function(e){var t=e.attributes,a=t.ampLightbox,o=t.linkTo,c=t.ampLayout,l=e.setAttributes;return Object(r.createElement)(i.ToggleControl,{label:Object(n.__)("Add lightbox effect","amp"),checked:a,onChange:function(e){l({ampLightbox:!a}),e&&("fixed-height"===c&&l({ampLayout:"fixed"}),o&&"none"!==o&&l({linkTo:"none"}))}})},w=function(e){var t=e.attributes.ampCarousel,a=e.setAttributes;return Object(r.createElement)(i.ToggleControl,{label:Object(n.__)("Display as carousel","amp"),checked:t,onChange:function(){return a({ampCarousel:!t})}})},P=function(e){return e.isSelected?Object(r.createElement)(o.InspectorControls,null,Object(r.createElement)(i.PanelBody,{title:Object(n.__)("AMP Settings","amp")},Object(r.createElement)(g,e),Object(r.createElement)(j,e),Object(r.createElement)(_,e))):null},E=function(e){return e.isSelected?Object(r.createElement)(o.InspectorControls,null,Object(r.createElement)(i.PanelBody,{title:Object(n.__)("AMP Settings","amp")},Object(r.createElement)(w,e),Object(r.createElement)(_,e))):null},x=function(){return(0,Object(c.select)("core/editor").getEditedPostAttribute)("amp_enabled")||!1}},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},function(e,t){!function(){e.exports=this.wp.hooks}()},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t,a){var r=a(38);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t)}},function(e,t,a){var r=a(39),n=a(17);e.exports=function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?n(e):t}},function(e,t){!function(){e.exports=this.React}()},function(e,t){e.exports=ampBlockEditor},function(e,t){function a(e,t){for(var a=0;a<t.length;a++){var r=t[a];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}e.exports=function(e,t,r){return t&&a(e.prototype,t),r&&a(e,r),e}},function(e,t,a){"use strict";a.d(t,"b",(function(){return p})),a.d(t,"a",(function(){return f})),a.d(t,"c",(function(){return h}));var r=a(9),n=a.n(r),i=a(12),o=a(1),c=a(8);function l(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,r)}return a}function u(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?l(Object(a),!0).forEach((function(t){n()(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):l(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}var s,d=window.wp,m=d.media.View.extend({className:"notice notice-warning notice-alt inline",template:(s=Object(o.sprintf)(
14
+ /* translators: 1: image width in pixels. 2: image height in pixels. */
15
+ Object(o.__)("The selected image is too small (%1$s by %2$s pixels).","amp"),"{{width}}","{{height}}"),s+=" <# if ( minWidth && minHeight ) { #>",s+=Object(o.sprintf)(
16
+ /* translators: 1: required minimum width in pixels. 2: required minimum height in pixels. */
17
+ Object(o.__)("It should have a size of at least %1$s by %2$s pixels.","amp"),"{{minWidth}}","{{minHeight}}"),s+="<# } else if ( minWidth ) { #>",s+=Object(o.sprintf)(
18
+ /* translators: placeholder is required minimum width in pixels. */
19
+ Object(o.__)("It should have a width of at least %s pixels.","amp"),"{{minWidth}}"),s+="<# } else if ( minHeight ) { #>",s+=Object(o.sprintf)(
20
+ /* translators: placeholder is required minimum height in pixels. */
21
+ Object(o.__)("It should have a height of at least %s pixels.","amp"),"{{minHeight}}"),s+="<# } #>",Object(c.c)(s))}),b=d.media.View.extend({className:"notice notice-warning notice-alt inline",template:function(){var e=Object(o.sprintf)(
22
  /* translators: 1: the selected file type. */
23
  Object(o.__)("The selected file mime type, %1$s, is not allowed.","amp"),"{{mimeType}}");return Object(c.c)(e)}()}),p=(d.media.View.extend({className:"notice notice-warning notice-alt inline",template:function(){var e=Object(o.sprintf)(
24
  /* translators: 1: the recommended max MB per second for videos. 2: the actual MB per second of the video. */
25
+ Object(o.__)("A video size of less than %1$s MB per second is recommended. The selected video is %2$s MB per second.","amp"),"{{maxVideoMegabytesPerSecond}}","{{actualVideoMegabytesPerSecond}}");return Object(c.c)(e)}()}),d.media.view.Toolbar.Select.extend({refresh:function(){d.media.view.Toolbar.Select.prototype.refresh.call(this);var e=this.controller.state(),t=e.get("selection").models[0],a=e.collection.get("featured-image").get("suggestedWidth"),r=e.collection.get("featured-image").get("suggestedHeight");t&&"image"===t.get("type")&&t.get("width")&&!Object(c.d)({width:t.get("width"),height:t.get("height")},{width:a,height:r})?this.secondary.set("select-error",new m({minWidth:a,minHeight:r,width:t.get("width"),height:t.get("height")})):this.secondary.unset("select-error"),c.a.call(this,t,b)}})),f=d.media.view.Toolbar.Select.extend({refresh:function(){d.media.view.Toolbar.Select.prototype.refresh.call(this);var e=this.controller.state().get("selection").models[0];c.a.call(this,e,b)}}),h=function(e){return d.media.view.MediaFrame.Select.extend({createSelectToolbar:function(t,a){(a=a||this.options.button||{}).controller=this,a=u(u({},a),{},{allowedTypes:Object(i.get)(this,["options","allowedTypes"],null)}),t.view=new e(a)}})}},function(e,t){!function(){e.exports=this.wp.editPost}()},function(e,t,a){"use strict";a.d(t,"a",(function(){return u})),a.d(t,"b",(function(){return d}));var r=a(0),n=(a(5),a(2)),i=a(26),o=a(3),c=a(1),l=a(8),u=Object(o.withSelect)((function(e){var t=e("core/editor").getCurrentPost(),a=e("core/editor").getEditedPostAttribute("featured_media"),r=t.featured_media||a;return{featuredMedia:r?e("core").getMedia(r):null}}))((function(e){var t=e.featuredMedia,a=e.dimensions,o=e.required,u=Object(l.f)(t,a,o);return u?Object(r.createElement)(i.PluginPrePublishPanel,{title:Object(c.__)("Featured Image","amp"),initialOpen:"true"},Object(r.createElement)(n.Notice,{status:o?"warning":"notice",isDismissible:!1},u.map((function(e,t){return Object(r.createElement)("p",{key:"error-".concat(t)},e)})))):null})),s=a(13),d=Object(s.createHigherOrderComponent)((function(e){return function(t){var a=t.media,i=Object(l.f)(a,Object(l.b)(),!1);return i?Object(r.createElement)(r.Fragment,null,Object(r.createElement)(n.Notice,{status:"notice",isDismissible:!1},i.map((function(e,t){return Object(r.createElement)("p",{key:"error-".concat(t)},e)}))),Object(r.createElement)(e,t)):Object(r.createElement)(e,t)}}),"withFeaturedImageNotice");a(19),a(17),a(20),a(21),a(14),a(9),a(12),a(25);window.wp},function(e,t,a){"use strict";var r=a(29);function n(){}function i(){}i.resetWarningCache=n,e.exports=function(){function e(e,t,a,n,i,o){if(o!==r){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}function t(){return e}e.isRequired=e;var a={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:n};return a.PropTypes=a,a}},function(e,t,a){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,a){"use strict";var r={};a.r(r),a.d(r,"hasThemeSupport",(function(){return c})),a.d(r,"isStandardMode",(function(){return l})),a.d(r,"getErrorMessages",(function(){return u})),a.d(r,"getAmpSlug",(function(){return s}));var n=a(9),i=a.n(n),o=a(3);function c(e){return Boolean(e.hasThemeSupport)}function l(e){return Boolean(e.isStandardMode)}function u(e){return e.errorMessages}function s(e){return e.ampSlug}function d(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,r)}return a}Object(o.registerStore)("amp/block-editor",{reducer:function(e){return e},selectors:r,initialState:function(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?d(Object(a),!0).forEach((function(t){i()(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):d(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}({},window.ampBlockEditor)})},function(e,t){!function(){e.exports=this.wp.url}()},,function(e,t){!function(){e.exports=this.wp.plugins}()},function(e,t){!function(){e.exports=this.wp.blocks}()},function(e,t,a){var r=a(40);function n(t,a,i){return"undefined"!=typeof Reflect&&Reflect.get?e.exports=n=Reflect.get:e.exports=n=function(e,t,a){var n=r(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(a):i.value}},n(t,a,i||t)}e.exports=n},,function(e,t,a){"use strict";a.r(t);var r=a(18),n=a(33),i=a(34),o=a(3),c=a(27),l=a(8),u=a(6),s=a(16),d=(a(30),Object(o.select)("amp/block-editor").isStandardMode),m=a(41);m.keys().forEach((function(e){var t=m(e),a=t.name,r=t.render,i=t.icon;Object(n.registerPlugin)(a,{icon:i,render:r})})),Object(r.addFilter)("blocks.registerBlockType","ampEditorBlocks/addAttributes",s.a),Object(r.addFilter)("blocks.getSaveElement","ampEditorBlocks/filterSave",s.c),Object(r.addFilter)("editor.BlockEdit","ampEditorBlocks/filterEdit",s.b,20),Object(r.addFilter)("editor.PostFeaturedImage","ampEditorBlocks/withFeaturedImageNotice",c.b),Object(r.addFilter)("editor.MediaUpload","ampEditorBlocks/withMediaLibraryNotice",(function(e){return Object(u.c)(e,Object(l.b)())}));var b=["amp/amp-brid-player","amp/amp-ima-video","amp/amp-jwplayer","amp/amp-mathml","amp/amp-o2-player","amp/amp-ooyala-player","amp/amp-reach-player","amp/amp-springboard-player","amp/amp-timeago"],p=a(44);p.keys().forEach((function(e){var t=p(e),a=t.name,r=t.settings;d()&&b.includes(a)&&Object(i.registerBlockType)(a,r)}))},function(e,t){function a(t,r){return e.exports=a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},a(t,r)}e.exports=a},function(e,t){function a(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?e.exports=a=function(e){return typeof e}:e.exports=a=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(t)}e.exports=a},function(e,t,a){var r=a(14);e.exports=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=r(e)););return e}},function(e,t,a){var r={"./amp-toggle.js":42,"./pre-publish-panel.js":43,"./wrapped-amp-preview-button.js":60};function n(e){var t=i(e);return a(t)}function i(e){if(!a.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}n.keys=function(){return Object.keys(r)},n.resolve=i,e.exports=n,n.id=41},function(e,t,a){"use strict";a.r(t),a.d(t,"name",(function(){return d})),a.d(t,"icon",(function(){return m})),a.d(t,"render",(function(){return b}));var r=a(0),n=a(23),i=(a(5),a(1)),o=a(2),c=a(3),l=a(26),u=a(13),s=a(16);var d="amp",m="hidden",b=Object(u.compose)(Object(c.withSelect)((function(){return{isEnabled:Object(s.d)()}})),Object(c.withDispatch)((function(e){return{onChange:function(t){e("core/editor").editPost({amp_enabled:t})}}})),u.withInstanceId)((function(e){var t=e.isEnabled,a=e.onChange;return Object(r.createElement)(l.PluginPostStatusInfo,null,!n.errorMessages.length&&Object(r.createElement)(r.Fragment,null,Object(r.createElement)("label",{htmlFor:"amp-enabled"},Object(i.__)("Enable AMP","amp")),Object(r.createElement)(o.FormToggle,{checked:t,onChange:function(){return a(!t)},id:"amp-enabled"})),Boolean(n.errorMessages.length)&&Object(r.createElement)(o.Notice,{status:"info",isDismissible:!1,className:"amp-unavailable-notice"},Object(r.createElement)("details",null,Object(r.createElement)("summary",null,Object(i.__)("AMP Unavailable","amp")),n.errorMessages.map((function(e,t){return Object(r.createElement)(r.RawHTML,{key:t},e)})))))}))},function(e,t,a){"use strict";a.r(t),a.d(t,"name",(function(){return o})),a.d(t,"render",(function(){return c}));var r=a(0),n=a(27),i=a(8),o="amp-post-featured-image-pre-publish-panel",c=function(){return Object(r.createElement)(n.a,{dimensions:Object(i.b)(),required:!1})}},function(e,t,a){var r={"./amp-brid-player/index.js":51,"./amp-ima-video/index.js":52,"./amp-jwplayer/index.js":53,"./amp-mathml/index.js":54,"./amp-o2-player/index.js":55,"./amp-ooyala-player/index.js":56,"./amp-reach-player/index.js":57,"./amp-springboard-player/index.js":58,"./amp-timeago/index.js":59};function n(e){var t=i(e);return a(t)}function i(e){if(!a.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}n.keys=function(){return Object.keys(r)},n.resolve=i,e.exports=n,n.id=44},,,,,,,function(e,t,a){"use strict";a.r(t),a.d(t,"name",(function(){return m})),a.d(t,"settings",(function(){return b}));var r=a(1),n=a(10),i=a.n(n),o=a(0),c=(a(5),a(4)),l=a(2),u=a(6),s=function(e){var t=e.attributes,a=e.setAttributes,n=t.autoPlay,s=t.dataPartner,d=t.dataPlayer,m=t.dataVideo,b=t.dataPlaylist,p=t.dataOutstream,f=[{value:"responsive",label:Object(r.__)("Responsive","amp")},{value:"fixed-height",label:Object(r.__)("Fixed Height","amp")},{value:"fixed",label:Object(r.__)("Fixed","amp")},{value:"fill",label:Object(r.__)("Fill","amp")},{value:"flex-item",label:Object(r.__)("Flex-item","amp")},{value:"nodisplay",label:Object(r.__)("No Display","amp")}],h=!1;return s&&d&&(m||b||p)&&(h="http://cdn.brid.tv/live/partners/".concat(s)),Object(o.createElement)(o.Fragment,null,Object(o.createElement)(c.InspectorControls,null,Object(o.createElement)(l.PanelBody,{title:Object(r.__)("Brid Player Settings","amp")},Object(o.createElement)(l.TextControl,{label:Object(r.__)("Partner ID (required)","amp"),value:s,onChange:function(e){return a({dataPartner:e})}}),Object(o.createElement)(l.TextControl,{label:Object(r.__)("Player ID (required)","amp"),value:d,onChange:function(e){return a({dataPlayer:e})}}),Object(o.createElement)(l.TextControl,{label:Object(r.__)("Video ID (one of video / playlist / outstream ID is required)","amp"),value:m,onChange:function(e){return a({dataVideo:e})}}),Object(o.createElement)(l.TextControl,{label:Object(r.__)("Outstream unit ID (one of video / playlist / outstream ID is required)","amp"),value:p,onChange:function(e){return a({dataOutstream:e})}}),Object(o.createElement)(l.TextControl,{label:Object(r.__)("Playlist ID (one of video / playlist / outstream ID is required)","amp"),value:b,onChange:function(e){return a({dataPlaylist:e})}}),Object(o.createElement)(l.ToggleControl,{label:Object(r.__)("Autoplay","amp"),checked:n,onChange:function(){return a({autoPlay:!n})}}),Object(o.createElement)(u.a,i()({},e,{ampLayoutOptions:f})))),h&&Object(o.createElement)(u.b,{name:Object(r.__)("Brid Player","amp"),url:h}),!h&&Object(o.createElement)(l.Placeholder,{label:Object(r.__)("Brid Player","amp")},Object(o.createElement)("p",null,Object(r.__)("Add required data to use the block.","amp"))))},d=function(e){var t=e.attributes,a=t.dataPlayer,r=t.dataOutstream,n=t.dataPartner,i=t.ampLayout,c=t.width,l=t.height,u=t.dataVideo,s=t.autoPlay,d=t.dataPlaylist,m={layout:i,height:l,"data-player":a,"data-partner":n};return"fixed-height"!==i&&c&&(m.width=c),d&&(m["data-playlist"]=d),u&&(m["data-video"]=u),r&&(m["data-outstream"]=r),s&&(m.autoplay=s),Object(o.createElement)("amp-brid-player",m)},m="amp/amp-brid-player",b={title:Object(r.__)("AMP Brid Player","amp"),description:Object(r.__)("Displays the Brid Player used in Brid.tv Video Platform.","amp"),category:"embed",icon:"embed-generic",keywords:[Object(r.__)("Embed","amp")],attributes:{autoPlay:{type:"boolean"},dataPartner:{source:"attribute",selector:"amp-brid-player",attribute:"data-partner"},dataPlayer:{source:"attribute",selector:"amp-brid-player",attribute:"data-player"},dataVideo:{source:"attribute",selector:"amp-brid-player",attribute:"data-video"},dataPlaylist:{source:"attribute",selector:"amp-brid-player",attribute:"data-playlist"},dataOutstream:{source:"attribute",selector:"amp-brid-player",attribute:"data-outstream"},ampLayout:{default:"responsive",source:"attribute",selector:"amp-brid-player",attribute:"layout"},width:{type:"number",default:600},height:{default:400,source:"attribute",selector:"amp-brid-player",attribute:"height"}},edit:s,save:d}},function(e,t,a){"use strict";a.r(t),a.d(t,"name",(function(){return m})),a.d(t,"settings",(function(){return b}));var r=a(1),n=a(10),i=a.n(n),o=a(0),c=(a(5),a(4)),l=a(2),u=a(6),s=function(e){var t=e.attributes,a=e.setAttributes,n=t.dataDelayAdRequest,s=t.dataTag,d=t.dataSrc,m=t.dataPoster,b=[{value:"responsive",label:Object(r.__)("Responsive","amp")},{value:"fixed",label:Object(r.__)("Fixed","amp")}],p=!1;return s&&d&&(p=!0),Object(o.createElement)(o.Fragment,null,Object(o.createElement)(c.InspectorControls,null,Object(o.createElement)(l.PanelBody,{title:Object(r.__)("IMA Video Settings","amp")},Object(o.createElement)(l.TextControl,{label:Object(r.__)("HTTPS URL for your VAST ad document (required)","amp"),value:s,onChange:function(e){return a({dataTag:e})}}),Object(o.createElement)(l.TextControl,{label:Object(r.__)("HTTPS URL of your video content (required)","amp"),value:d,onChange:function(e){return a({dataSrc:e})}}),Object(o.createElement)(l.TextControl,{label:Object(r.__)("HTTPS URL to preview image","amp"),value:m,onChange:function(e){return a({dataPoster:e})}}),Object(o.createElement)(l.ToggleControl,{label:Object(r.__)("Delay Ad Request","amp"),checked:n,onChange:function(){return a({dataDelayAdRequest:!n})}}),Object(o.createElement)(u.a,i()({},e,{ampLayoutOptions:b})))),p&&Object(o.createElement)(u.b,{name:Object(r.__)("IMA Video","amp"),url:d}),!p&&Object(o.createElement)(l.Placeholder,{label:Object(r.__)("IMA Video","amp")},Object(o.createElement)("p",null,Object(r.__)("Add required data to use the block.","amp"))))},d=function(e){var t=e.attributes,a=t.width,r=t.dataSrc,n=t.ampLayout,i=t.dataTag,c=t.dataDelayAdRequest,l=t.height,u=t.dataPoster,s={layout:n,height:l,width:a,"data-tag":i,"data-src":r};return u&&(s["data-poster"]=u),c&&(s["data-delay-ad-request"]=c),Object(o.createElement)("amp-ima-video",s)},m="amp/amp-ima-video",b={title:Object(r.__)("AMP IMA Video","amp"),description:Object(r.__)("Embeds a video player for instream video ads that are integrated with the IMA SDK","amp"),category:"embed",icon:"embed-generic",keywords:[Object(r.__)("Embed","amp")],attributes:{dataDelayAdRequest:{default:!1,source:"attribute",selector:"amp-ima-video",attribute:"data-delay-ad-request"},dataTag:{source:"attribute",selector:"amp-ima-video",attribute:"data-tag"},dataSrc:{source:"attribute",selector:"amp-ima-video",attribute:"data-src"},dataPoster:{source:"attribute",selector:"amp-ima-video",attribute:"data-poster"},ampLayout:{default:"responsive",source:"attribute",selector:"amp-ima-video",attribute:"layout"},width:{default:600,source:"attribute",selector:"amp-ima-video",attribute:"width"},height:{default:400,source:"attribute",selector:"amp-ima-video",attribute:"height"}},edit:s,save:d}},function(e,t,a){"use strict";a.r(t),a.d(t,"name",(function(){return m})),a.d(t,"settings",(function(){return b}));var r=a(1),n=a(10),i=a.n(n),o=a(0),c=(a(5),a(4)),l=a(2),u=a(6),s=function(e){var t=e.attributes,a=e.setAttributes,n=t.dataPlayerId,s=t.dataMediaId,d=t.dataPlaylistId,m=[{value:"responsive",label:Object(r.__)("Responsive","amp")},{value:"fixed-height",label:Object(r.__)("Fixed Height","amp")},{value:"fixed",label:Object(r.__)("Fixed","amp")},{value:"fill",label:Object(r.__)("Fill","amp")},{value:"flex-item",label:Object(r.__)("Flex-item","amp")},{value:"nodisplay",label:Object(r.__)("No Display","amp")}],b=!1;return n&&(s||d)&&(b=d?"https://content.jwplatform.com/players/".concat(d,"-").concat(n):"https://content.jwplatform.com/players/".concat(s,"-").concat(n)),Object(o.createElement)(o.Fragment,null,Object(o.createElement)(c.InspectorControls,null,Object(o.createElement)(l.PanelBody,{title:Object(r.__)("JW Player Settings","amp")},Object(o.createElement)(l.TextControl,{label:Object(r.__)("Player ID (required)","amp"),value:n,onChange:function(e){return a({dataPlayerId:e})}}),Object(o.createElement)(l.TextControl,{label:Object(r.__)("Media ID (required if playlist ID not set)","amp"),value:s,onChange:function(e){return a({dataMediaId:e})}}),Object(o.createElement)(l.TextControl,{label:Object(r.__)("Playlist ID (required if media ID not set)","amp"),value:d,onChange:function(e){return a({dataPlaylistId:e})}}),Object(o.createElement)(u.a,i()({},e,{ampLayoutOptions:m})))),b&&Object(o.createElement)(u.b,{name:Object(r.__)("JW Player","amp"),url:b}),!b&&Object(o.createElement)(l.Placeholder,{label:Object(r.__)("JW Player","amp")},Object(o.createElement)("p",null,Object(r.__)("Add required data to use the block.","amp"))))},d=function(e){var t=e.attributes,a=t.width,r=t.height,n=t.ampLayout,i=t.dataPlaylistId,c=t.dataPlayerId,l=t.dataMediaId,u={layout:n,height:r,"data-player-id":c};return"fixed-height"!==n&&a&&(u.width=a),i&&(u["data-playlist-id"]=i),l&&(u["data-media-id"]=l),Object(o.createElement)("amp-jwplayer",u)},m="amp/amp-jwplayer",b={title:Object(r.__)("AMP JW Player","amp"),description:Object(r.__)("Displays a cloud-hosted JW Player.","amp"),category:"embed",icon:"embed-generic",keywords:[Object(r.__)("Embed","amp")],attributes:{dataPlayerId:{source:"attribute",selector:"amp-jwplayer",attribute:"data-player-id"},dataMediaId:{source:"attribute",selector:"amp-jwplayer",attribute:"data-media-id"},dataPlaylistId:{source:"attribute",selector:"amp-jwplayer",attribute:"data-playlist-id"},ampLayout:{default:"responsive",source:"attribute",selector:"amp-jwplayer",attribute:"layout"},width:{default:600,source:"attribute",selector:"amp-jwplayer",attribute:"width"},height:{default:400,source:"attribute",selector:"amp-jwplayer",attribute:"height"}},edit:s,save:d}},function(e,t,a){"use strict";a.r(t),a.d(t,"name",(function(){return l})),a.d(t,"settings",(function(){return u}));var r=a(1),n=a(0),i=(a(5),a(4)),o=function(e){var t=e.attributes,a=e.setAttributes,o=t.dataFormula;return Object(n.createElement)(i.PlainText,{value:o,placeholder:Object(r.__)("Insert formula","amp"),onChange:function(e){return a({dataFormula:e})}})},c=function(e){var t={"data-formula":e.attributes.dataFormula,layout:"container"};return Object(n.createElement)("amp-mathml",t)},l="amp/amp-mathml",u={title:Object(r.__)("AMP MathML","amp"),category:"common",icon:"welcome-learn-more",keywords:[Object(r.__)("Mathematical formula","amp"),Object(r.__)("Scientific content ","amp")],attributes:{dataFormula:{source:"attribute",selector:"amp-mathml",attribute:"data-formula"}},edit:o,save:c}},function(e,t,a){"use strict";a.r(t),a.d(t,"name",(function(){return m})),a.d(t,"settings",(function(){return b}));var r=a(1),n=a(10),i=a.n(n),o=a(0),c=(a(5),a(4)),l=a(2),u=a(6),s=function(e){var t=e.attributes,a=e.setAttributes,n=t.autoPlay,s=t.dataPid,d=t.dataVid,m=t.dataBcid,b=t.dataBid,p=[{value:"responsive",label:Object(r.__)("Responsive","amp")},{value:"fixed-height",label:Object(r.__)("Fixed Height","amp")},{value:"fixed",label:Object(r.__)("Fixed","amp")},{value:"fill",label:Object(r.__)("Fill","amp")},{value:"flex-item",label:Object(r.__)("Flex-item","amp")},{value:"nodisplay",label:Object(r.__)("No Display","amp")}],f=!1;return s&&(m||d)&&(f="https://delivery.vidible.tv/htmlembed/pid=".concat(s,"/")),Object(o.createElement)(o.Fragment,null,Object(o.createElement)(c.InspectorControls,null,Object(o.createElement)(l.PanelBody,{title:Object(r.__)("O2 Player Settings","amp")},Object(o.createElement)(l.TextControl,{label:Object(r.__)("Player ID (required)","amp"),value:s,onChange:function(e){return a({dataPid:e})}}),Object(o.createElement)(l.TextControl,{label:Object(r.__)("Buyer Company ID (either buyer or video ID is required)","amp"),value:m,onChange:function(e){return a({dataBcid:e})}}),Object(o.createElement)(l.TextControl,{label:Object(r.__)("Video ID (either buyer or video ID is required)","amp"),value:d,onChange:function(e){return a({dataVid:e})}}),Object(o.createElement)(l.TextControl,{label:Object(r.__)("Playlist ID","amp"),value:b,onChange:function(e){return a({dataBid:e})}}),Object(o.createElement)(l.ToggleControl,{label:Object(r.__)("Autoplay","amp"),checked:n,onChange:function(){return a({autoPlay:!n})}}),Object(o.createElement)(u.a,i()({},e,{ampLayoutOptions:p})))),f&&Object(o.createElement)(u.b,{name:Object(r.__)("O2 Player","amp"),url:f}),!f&&Object(o.createElement)(l.Placeholder,{label:Object(r.__)("O2 Player","amp")},Object(o.createElement)("p",null,Object(r.__)("Add required data to use the block.","amp"))))},d=function(e){var t=e.attributes,a=t.dataPid,r=t.width,n=t.height,i=t.ampLayout,c=t.dataBid,l=t.autoPlay,u=t.dataBcid,s=t.dataVid,d={layout:i,height:n,"data-pid":a};return"fixed-height"!==i&&r&&(d.width=r),l||(d["data-macros"]="m.playback=click"),s?d["data-vid"]=s:u&&(d["data-bcid"]=u),c&&(d["data-bid"]=c),Object(o.createElement)("amp-o2-player",d)},m="amp/amp-o2-player",b={title:Object(r.__)("AMP O2 Player","amp"),category:"embed",icon:"embed-generic",keywords:[Object(r.__)("Embed","amp"),Object(r.__)("AOL O2Player","amp")],attributes:{dataPid:{source:"attribute",selector:"amp-o2-player",attribute:"data-pid"},dataVid:{source:"attribute",selector:"amp-o2-player",attribute:"data-vid"},dataBcid:{source:"attribute",selector:"amp-o2-player",attribute:"data-bcid"},dataBid:{source:"attribute",selector:"amp-o2-player",attribute:"data-bid"},autoPlay:{default:!1},ampLayout:{default:"responsive",source:"attribute",selector:"amp-o2-player",attribute:"layout"},width:{default:600,source:"attribute",selector:"amp-o2-player",attribute:"width"},height:{default:400,source:"attribute",selector:"amp-o2-player",attribute:"height"}},edit:s,save:d}},function(e,t,a){"use strict";a.r(t),a.d(t,"name",(function(){return m})),a.d(t,"settings",(function(){return b}));var r=a(1),n=a(10),i=a.n(n),o=a(0),c=(a(5),a(4)),l=a(2),u=a(6),s=function(e){var t=e.attributes,a=e.setAttributes,n=t.dataEmbedCode,s=t.dataPlayerId,d=t.dataPcode,m=t.dataPlayerVersion,b=[{value:"responsive",label:Object(r.__)("Responsive","amp")},{value:"fixed",label:Object(r.__)("Fixed","amp")},{value:"fill",label:Object(r.__)("Fill","amp")},{value:"flex-item",label:Object(r.__)("Flex-item","amp")}],p=!1;return n&&s&&d&&(p="http://cf.c.ooyala.com/".concat(n)),Object(o.createElement)(o.Fragment,null,Object(o.createElement)(c.InspectorControls,null,Object(o.createElement)(l.PanelBody,{title:Object(r.__)("Ooyala Settings","amp")},Object(o.createElement)(l.TextControl,{label:Object(r.__)("Video embed code (required)","amp"),value:n,onChange:function(e){return a({dataEmbedCode:e})}}),Object(o.createElement)(l.TextControl,{label:Object(r.__)("Player ID (required)","amp"),value:s,onChange:function(e){return a({dataPlayerId:e})}}),Object(o.createElement)(l.TextControl,{label:Object(r.__)("Provider code for the account (required)","amp"),value:d,onChange:function(e){return a({dataPcode:e})}}),Object(o.createElement)(l.SelectControl,{label:Object(r.__)("Player version","amp"),value:m,options:[{value:"v3",label:Object(r.__)("V3","amp")},{value:"v4",label:Object(r.__)("V4","amp")}],onChange:function(e){return a({dataPlayerVersion:e})}}),Object(o.createElement)(u.a,i()({},e,{ampLayoutOptions:b})))),p&&Object(o.createElement)(u.b,{name:Object(r.__)("Ooyala Player","amp"),url:p}),!p&&Object(o.createElement)(l.Placeholder,{label:Object(r.__)("Ooyala Player","amp")},Object(o.createElement)("p",null,Object(r.__)("Add required data to use the block.","amp"))))},d=function(e){var t=e.attributes,a=t.dataEmbedCode,r=t.dataPlayerId,n=t.dataPcode,i=t.dataPlayerVersion,c=t.ampLayout,l=t.height,u=t.width,s={layout:c,height:l,"data-embedcode":a,"data-playerid":r,"data-pcode":n,"data-playerversion":i};return"fixed-height"!==c&&u&&(s.width=u),Object(o.createElement)("amp-ooyala-player",s)},m="amp/amp-ooyala-player",b={title:Object(r.__)("AMP Ooyala Player","amp"),description:Object(r.__)("Displays an Ooyala video.","amp"),category:"embed",icon:"embed-generic",keywords:[Object(r.__)("Embed","amp"),Object(r.__)("Ooyala video","amp")],attributes:{dataEmbedCode:{source:"attribute",selector:"amp-ooyala-player",attribute:"data-embedcode"},dataPlayerId:{source:"attribute",selector:"amp-ooyala-player",attribute:"data-playerid"},dataPcode:{source:"attribute",selector:"amp-ooyala-player",attribute:"data-pcode"},dataPlayerVersion:{default:"v3",source:"attribute",selector:"amp-ooyala-player",attribute:"data-playerversion"},ampLayout:{default:"responsive",source:"attribute",selector:"amp-ooyala-player",attribute:"layout"},width:{default:600,source:"attribute",selector:"amp-ooyala-player",attribute:"width"},height:{default:400,source:"attribute",selector:"amp-ooyala-player",attribute:"height"}},edit:s,save:d}},function(e,t,a){"use strict";a.r(t),a.d(t,"name",(function(){return m})),a.d(t,"settings",(function(){return b}));var r=a(1),n=a(10),i=a.n(n),o=a(0),c=(a(5),a(4)),l=a(2),u=a(6),s=function(e){var t=e.attributes,a=e.setAttributes,n=t.dataEmbedId,s=[{value:"responsive",label:Object(r.__)("Responsive","amp")},{value:"fixed-height",label:Object(r.__)("Fixed Height","amp")},{value:"fixed",label:Object(r.__)("Fixed","amp")},{value:"fill",label:Object(r.__)("Fill","amp")},{value:"flex-item",label:Object(r.__)("Flex-item","amp")}],d=!1;return n&&(d="https://media-cdn.beachfrontreach.com/acct_1/video/"),Object(o.createElement)(o.Fragment,null,Object(o.createElement)(c.InspectorControls,null,Object(o.createElement)(l.PanelBody,{title:Object(r.__)("Reach Settings","amp")},Object(o.createElement)(l.TextControl,{label:Object(r.__)("Embed ID (required)","amp"),value:n,onChange:function(e){return a({dataEmbedId:e})}}),Object(o.createElement)(u.a,i()({},e,{ampLayoutOptions:s})))),d&&Object(o.createElement)(u.b,{name:Object(r.__)("Reach Player","amp"),url:d}),!d&&Object(o.createElement)(l.Placeholder,{label:Object(r.__)("Reach Player","amp")},Object(o.createElement)("p",null,Object(r.__)("Add Reach player embed ID to use the block.","amp"))))},d=function(e){var t=e.attributes,a=t.dataEmbedId,r=t.ampLayout,n=t.height,i=t.width,c={layout:r,height:n,"data-embed-id":a};return"fixed-height"!==r&&i&&(c.width=i),Object(o.createElement)("amp-reach-player",c)},m="amp/amp-reach-player",b={title:Object(r.__)("AMP Reach Player","amp"),description:Object(r.__)("Displays the Reach Player configured in the Beachfront Reach platform.","amp"),category:"embed",icon:"embed-generic",keywords:[Object(r.__)("Embed","amp"),Object(r.__)("Beachfront Reach video","amp")],attributes:{dataEmbedId:{source:"attribute",selector:"amp-reach-player",attribute:"data-embed-id"},ampLayout:{default:"fixed-height",source:"attribute",selector:"amp-reach-player",attribute:"layout"},width:{default:600,source:"attribute",selector:"amp-reach-player",attribute:"width"},height:{default:400,source:"attribute",selector:"amp-reach-player",attribute:"height"}},edit:s,save:d}},function(e,t,a){"use strict";a.r(t),a.d(t,"name",(function(){return m})),a.d(t,"settings",(function(){return b}));var r=a(1),n=a(10),i=a.n(n),o=a(0),c=(a(5),a(4)),l=a(2),u=a(6),s=function(e){var t=e.attributes,a=e.setAttributes,n=t.dataSiteId,s=t.dataPlayerId,d=t.dataContentId,m=t.dataDomain,b=t.dataMode,p=t.dataItems,f=[{value:"responsive",label:Object(r.__)("Responsive","amp")},{value:"fixed",label:Object(r.__)("Fixed","amp")},{value:"fill",label:Object(r.__)("Fill","amp")},{value:"flex-item",label:Object(r.__)("Flex-item","amp")}],h=!1;return n&&d&&m&&b&&p&&(h="https://cms.springboardplatform.com/embed_iframe/"),Object(o.createElement)(o.Fragment,null,Object(o.createElement)(c.InspectorControls,null,Object(o.createElement)(l.PanelBody,{title:Object(r.__)("Springboard Player Settings","amp")},Object(o.createElement)(l.TextControl,{label:Object(r.__)("Site ID (required)","amp"),value:n,onChange:function(e){return a({dataSiteId:e})}}),Object(o.createElement)(l.TextControl,{label:Object(r.__)("Content ID (required)","amp"),value:d,onChange:function(e){return a({dataContentId:e})}}),Object(o.createElement)(l.TextControl,{label:Object(r.__)("Player ID","amp"),value:s,onChange:function(e){return a({dataPlayerId:e})}}),Object(o.createElement)(l.TextControl,{label:Object(r.__)("Springboard partner domain","amp"),value:m,onChange:function(e){return a({dataDomain:e})}}),Object(o.createElement)(l.SelectControl,{label:Object(r.__)("Mode (required)","amp"),value:b,options:[{value:"video",label:Object(r.__)("Video","amp")},{value:"playlist",label:Object(r.__)("Playlist","amp")}],onChange:function(e){return a({dataMode:e})}}),Object(o.createElement)(l.TextControl,{type:"number",label:Object(r.__)("Number of video is playlist (required)","amp"),value:p,onChange:function(e){return a({dataItems:e})}}),Object(o.createElement)(u.a,i()({},e,{ampLayoutOptions:f})))),h&&Object(o.createElement)(u.b,{name:Object(r.__)("Springboard Player","amp"),url:h}),!h&&Object(o.createElement)(l.Placeholder,{label:Object(r.__)("Springboard Player","amp")},Object(o.createElement)("p",null,Object(r.__)("Add required data to use the block.","amp"))))},d=function(e){var t=e.attributes,a=t.dataSiteId,r=t.dataPlayerId,n=t.dataContentId,i=t.dataDomain,c=t.dataMode,l=t.dataItems,u=t.ampLayout,s=t.height,d=t.width,m={layout:u,height:s,"data-site-id":a,"data-mode":c,"data-content-id":n,"data-player-id":r,"data-domain":i,"data-items":l};return"fixed-height"!==u&&d&&(m.width=t.width),Object(o.createElement)("amp-springboard-player",m)},m="amp/amp-springboard-player",b={title:Object(r.__)("AMP Springboard Player","amp"),description:Object(r.__)("Displays the Springboard Player used in the Springboard Video Platform","amp"),category:"embed",icon:"embed-generic",keywords:[Object(r.__)("Embed","amp")],attributes:{dataSiteId:{source:"attribute",selector:"amp-springboard-player",attribute:"data-site-id"},dataContentId:{source:"attribute",selector:"amp-springboard-player",attribute:"data-content-id"},dataPlayerId:{source:"attribute",selector:"amp-springboard-player",attribute:"data-player-id"},dataDomain:{source:"attribute",selector:"amp-springboard-player",attribute:"data-domain"},dataMode:{default:"video",source:"attribute",selector:"amp-springboard-player",attribute:"data-mode"},dataItems:{default:1,source:"attribute",selector:"amp-springboard-player",attribute:"data-items"},ampLayout:{default:"responsive",source:"attribute",selector:"amp-springboard-player",attribute:"layout"},width:{default:600,source:"attribute",selector:"amp-springboard-player",attribute:"width"},height:{default:400,source:"attribute",selector:"amp-springboard-player",attribute:"height"}},edit:s,save:d}},function(e,t,a){"use strict";a.r(t),a.d(t,"name",(function(){return p})),a.d(t,"settings",(function(){return f}));var r=a(1),n=a(10),i=a.n(n),o=a(0),c=a(15),l=a.n(c),u=(a(5),a(4)),s=a(2),d=a(6),m=function(e){var t,a=e.attributes,n=e.setAttributes,c=a.align,m=a.cutoff,b=a.dateTime;b?t=m&&parseInt(m)<Math.abs(l()(b).diff(l()(),"seconds"))?l()(b).format("dddd D MMMM HH:mm"):l()(b).fromNow():(t=l()(Date.now()).fromNow(),n({dateTime:l()(l()(),l.a.ISO_8601,!0).format()}));var p=[{value:"",label:Object(r.__)("Responsive","amp")},{value:"fixed",label:Object(r.__)("Fixed","amp")},{value:"fixed-height",label:Object(r.__)("Fixed Height","amp")}];return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(u.InspectorControls,null,Object(o.createElement)(s.PanelBody,{title:Object(r.__)("AMP Timeago Settings","amp")},Object(o.createElement)(s.DateTimePicker,{locale:"en",currentDate:b||l()(),onChange:function(e){return n({dateTime:l()(e,l.a.ISO_8601,!0).format()})}}),Object(o.createElement)(d.a,i()({},e,{ampLayoutOptions:p})),Object(o.createElement)(s.TextControl,{type:"number",className:"blocks-amp-timeout__cutoff",label:Object(r.__)("Cutoff (seconds)","amp"),value:void 0!==m?m:"",onChange:function(e){return n({cutoff:e})}}))),Object(o.createElement)(u.BlockControls,null,Object(o.createElement)(u.BlockAlignmentToolbar,{value:c,onChange:function(e){n({align:e})},controls:["left","center","right"]})),Object(o.createElement)("time",{dateTime:b},t))},b=function(e){var t=e.attributes,a=t.ampLayout,r=t.width,n=t.height,i=t.align,c=t.cutoff,u={layout:"responsive",className:"align"+(i||"none"),datetime:t.dateTime,locale:"en"};if(c&&(u.cutoff=c),a)switch(a){case"fixed-height":n&&(u.height=n,u.layout=a);break;case"fixed":n&&r&&(u.height=n,u.width=r,u.layout=a)}return Object(o.createElement)("amp-timeago",u,l()(t.dateTime).format("dddd D MMMM HH:mm"))},p="amp/amp-timeago",f={title:Object(r.__)("AMP Timeago","amp"),category:"common",icon:"backup",keywords:[Object(r.__)("Time difference","amp"),Object(r.__)("Time ago","amp"),Object(r.__)("Date","amp")],attributes:{align:{type:"string"},cutoff:{source:"attribute",selector:"amp-timeago",attribute:"cutoff"},dateTime:{source:"attribute",selector:"amp-timeago",attribute:"datetime"},ampLayout:{default:"fixed-height",source:"attribute",selector:"amp-timeago",attribute:"layout"},width:{source:"attribute",selector:"amp-timeago",attribute:"width"},height:{default:20,source:"attribute",selector:"amp-timeago",attribute:"height"}},getEditWrapperProps:function(e){var t=e.align;if("left"===t||"right"===t||"center"===t)return{"data-align":t}},edit:m,save:b}},function(e,t,a){"use strict";a.r(t),a.d(t,"name",(function(){return k})),a.d(t,"render",(function(){return M}));var r=a(19),n=a.n(r),i=a(24),o=a.n(i),c=a(20),l=a.n(c),u=a(21),s=a.n(u),d=a(14),m=a.n(d),b=a(0),p=a(12),f=a(3),h=a(13),O=a(7),y=a(17),g=a.n(y),j=(a(22),a(5),a(2)),v=a(1),_=a(31),w=a(16);function P(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=m()(e);if(t){var n=m()(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return s()(this,a)}}var E=function(e){return Object(b.createElement)("svg",e,Object(b.createElement)("path",{d:"M41.629 28.161L28.624 49.804h-2.356l2.33-14.102-7.214.009-.1.002c-.65 0-1.176-.526-1.176-1.176 0-.279.259-.751.259-.751L33.329 12.17l2.395.01-2.388 14.123 7.251-.009h.115c.65 0 1.176.525 1.176 1.175 0 .264-.103.495-.25.691v.001zM31 0C13.879 0 0 13.88 0 31c0 17.121 13.879 31 31 31 17.12 0 31-13.879 31-31C62 13.88 48.12 0 31 0z",fill:"#82878c"}))};E.defaultProps={width:"62",height:"62",viewBox:"0 0 62 62",xmlns:"http://www.w3.org/2000/svg"};var x=function(e){return Object(b.createElement)("svg",e,Object(b.createElement)("path",{className:"outer",d:"M48 12c19.9 0 36 16.1 36 36S67.9 84 48 84 12 67.9 12 48s16.1-36 36-36",fill:"none"}),Object(b.createElement)("path",{className:"inner",d:"M48 33c8.285 0 15 6.716 15 15 0 8.284-6.715 15-15 15-8.284 0-15-6.716-15-15 0-8.284 6.716-15 15-15zm-1.15 24.098l6.293-10.472a.555.555 0 0 0 .12-.335.569.569 0 0 0-.624-.568l-3.508.004 1.155-6.834-1.159-.005-6.272 10.46s-.125.228-.125.363c0 .314.255.57.569.57l.048-.001 3.49-.005-1.126 6.823h1.14z",fill:"none"}))};x.defaultProps={xmlns:"http://www.w3.org/2000/svg"};var C=function(e){l()(a,e);var t=P(a);function a(){var e;n()(this,a);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return(e=t.call.apply(t,[this].concat(i))).buttonRef=Object(b.createRef)(),e.openPreviewWindow=e.openPreviewWindow.bind(g()(e)),e}return o()(a,[{key:"componentDidUpdate",value:function(e){var t=this.props.previewLink;t&&!e.previewLink&&this.setPreviewWindowLink(t)}},{key:"setPreviewWindowLink",value:function(e){var t=this.previewWindow;t&&!t.closed&&(t.location=e,this.buttonRef.current&&this.buttonRef.current.focus())}},{key:"getWindowTarget",value:function(){var e=this.props.postId;return"amp-preview-".concat(e)}},{key:"openPreviewWindow",value:function(e){var t,a;(e.preventDefault(),this.previewWindow&&!this.previewWindow.closed||(this.previewWindow=window.open("",this.getWindowTarget())),this.previewWindow.focus(),this.props.isAutosaveable)?(this.props.isDraft?this.props.savePost({isPreview:!0}):this.props.autosave({isPreview:!0}),t=this.previewWindow.document,a=Object(b.renderToString)(Object(b.createElement)("div",{className:"editor-post-preview-button__interstitial-message"},Object(b.createElement)(j.Icon,{icon:x({viewBox:"0 0 98 98"})}),Object(b.createElement)("p",null,Object(v.__)("Generating AMP preview…","amp")))),a+='\n\t\t<style>\n\t\t\tbody {\n\t\t\t\tmargin: 0;\n\t\t\t}\n\t\t\t.editor-post-preview-button__interstitial-message {\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-direction: column;\n\t\t\t\talign-items: center;\n\t\t\t\tjustify-content: center;\n\t\t\t\theight: 100vh;\n\t\t\t\twidth: 100vw;\n\t\t\t}\n\t\t\t@-webkit-keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@-moz-keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@-o-keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t@keyframes paint {\n\t\t\t\t0% {\n\t\t\t\t\tstroke-dashoffset: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t.editor-post-preview-button__interstitial-message svg {\n\t\t\t\twidth: 198px;\n\t\t\t\theight: 198px;\n\t\t\t\tstroke: #555d66;\n\t\t\t\tstroke-width: 0.75;\n\t\t\t}\n\t\t\t.editor-post-preview-button__interstitial-message svg .outer,\n\t\t\t.editor-post-preview-button__interstitial-message svg .inner {\n\t\t\t\tstroke-dasharray: 280;\n\t\t\t\tstroke-dashoffset: 280;\n\t\t\t\t-webkit-animation: paint 1.5s ease infinite alternate;\n\t\t\t\t-moz-animation: paint 1.5s ease infinite alternate;\n\t\t\t\t-o-animation: paint 1.5s ease infinite alternate;\n\t\t\t\tanimation: paint 1.5s ease infinite alternate;\n\t\t\t}\n\t\t\tp {\n\t\t\t\ttext-align: center;\n\t\t\t\tfont-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;\n\t\t\t}\n\t\t</style>\n\t',t.write(a),t.title=Object(v.__)("Generating AMP preview…","amp"),t.close()):this.setPreviewWindowLink(e.target.href)}},{key:"render",value:function(){var e=this.props,t=e.previewLink,a=e.currentPostLink,r=e.errorMessages,n=e.isEnabled,i=e.isSaveable,o=e.isStandardMode,c=t||a;return n&&!r.length&&!o&&Object(b.createElement)(j.Button,{className:"amp-editor-post-preview",href:c,title:Object(v.__)("Preview AMP","amp"),isSecondary:!0,disabled:!i,onClick:this.openPreviewWindow,ref:this.buttonRef},E({viewBox:"0 0 62 62",width:18,height:18}),Object(b.createElement)("span",{className:"screen-reader-text"},
26
  /* translators: accessibility text */
27
+ Object(v.__)("(opens in a new tab)","amp")))}}]),a}(b.Component),S=Object(h.compose)([Object(f.withSelect)((function(e,t){var a=t.forcePreviewLink,r=t.forceIsAutosaveable,n=e("core/editor"),i=n.getCurrentPostId,o=n.getCurrentPostAttribute,c=n.getEditedPostAttribute,l=n.isEditedPostSaveable,u=n.isEditedPostAutosaveable,s=n.getEditedPostPreviewLink,d=e("amp/block-editor"),m=d.getAmpSlug,b=d.getErrorMessages,p=d.isStandardMode,f={};f[m()]=1;var h=s(),O=h?Object(_.addQueryArgs)(h,f):void 0;return{postId:i(),currentPostLink:Object(_.addQueryArgs)(o("link"),f),previewLink:void 0!==a?a:O,isSaveable:l(),isAutosaveable:r||u(),isDraft:-1!==["draft","auto-draft"].indexOf(c("status")),isEnabled:Object(w.d)(),errorMessages:b(),isStandardMode:p()}})),Object(f.withDispatch)((function(e){return{autosave:e("core/editor").autosave,savePost:e("core/editor").savePost}}))])(C);function I(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var a,r=m()(e);if(t){var n=m()(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return s()(this,a)}}var T=function(e){l()(a,e);var t=I(a);function a(){var e;n()(this,a);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return(e=t.call.apply(t,[this].concat(i))).root=document.createElement("div"),e.root.className="amp-wrapper-post-preview",e.postPreviewButton=document.querySelector(".".concat(O.d)),e}return o()(a,[{key:"componentDidMount",value:function(){this.postPreviewButton&&this.postPreviewButton.parentNode.insertBefore(this.root,this.postPreviewButton.nextSibling)}},{key:"componentWillUnmount",value:function(){this.postPreviewButton&&this.postPreviewButton.parentNode.removeChild(this.root)}},{key:"render",value:function(){return this.postPreviewButton?Object(b.createPortal)(Object(b.createElement)(S,null),this.root):null}}]),a}(b.Component),k="amp-preview-button-wrapper",M=Object(h.pure)(Object(h.compose)([Object(f.withSelect)((function(e){var t=(0,e("core").getPostType)((0,e("core/editor").getEditedPostAttribute)("type"));return{isViewable:Object(p.get)(t,["viewable"],!1)}})),Object(h.ifCondition)((function(e){return e.isViewable}))])(T))}]);
assets/js/amp-block-validation.asset.php CHANGED
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('lodash', 'react', 'wp-block-editor', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-polyfill'), 'version' => '5b5ff98a1b63606fc46cd490ce12327a');
1
+ <?php return array('dependencies' => array('lodash', 'react', 'wp-block-editor', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-polyfill'), 'version' => '275c6fea236f39058c10e2c2a0cf2f61');
assets/js/amp-block-validation.js CHANGED
@@ -1,4 +1,4 @@
1
- !function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=50)}([function(e,t){!function(){e.exports=this.wp.element}()},function(e,t){!function(){e.exports=this.wp.i18n}()},function(e,t){!function(){e.exports=this.wp.components}()},function(e,t){!function(){e.exports=this.wp.data}()},function(e,t){!function(){e.exports=this.wp.blockEditor}()},function(e,t,r){e.exports=r(28)()},,function(e,t,r){"use strict";r.d(t,"e",(function(){return n})),r.d(t,"c",(function(){return o})),r.d(t,"b",(function(){return i})),r.d(t,"a",(function(){return a})),r.d(t,"d",(function(){return c}));var n=["core/paragraph","core/heading","core/code","core/quote","core/subhead"],o=["core/image","core/video"],i=608,a=400,c="editor-post-preview"},function(e,t){e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}},,function(e,t,r){"use strict";r.d(t,"d",(function(){return n})),r.d(t,"b",(function(){return o})),r.d(t,"c",(function(){return i})),r.d(t,"a",(function(){return a}));var n=6,o=72,i=1200,a="select-file-type-error"},,function(e,t){!function(){e.exports=this.lodash}()},function(e,t){!function(){e.exports=this.wp.compose}()},,,function(e,t,r){"use strict";r.d(t,"a",(function(){return m})),r.d(t,"c",(function(){return p})),r.d(t,"b",(function(){return h})),r.d(t,"d",(function(){return P}));var n=r(0),o=(r(5),r(22),r(1)),i=r(2),a=r(4),c=r(3),u=r(7),l=r(10);function s(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return f(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return f(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return a=e.done,e},e:function(e){c=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw i}}}}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var b=[{value:"nodisplay",label:Object(o.__)("No Display","amp"),notAvailable:["core-embed/vimeo","core-embed/dailymotion","core-embed/reddit","core-embed/soundcloud"]},{value:"fixed",label:Object(o.__)("Fixed","amp"),notAvailable:["core-embed/soundcloud"]},{value:"responsive",label:Object(o.__)("Responsive","amp"),notAvailable:["core-embed/soundcloud"]},{value:"fixed-height",label:Object(o.__)("Fixed Height","amp"),notAvailable:[]},{value:"fill",label:Object(o.__)("Fill","amp"),notAvailable:["core-embed/soundcloud"]},{value:"flex-item",label:Object(o.__)("Flex Item","amp"),notAvailable:["core-embed/soundcloud"]},{value:"intrinsic",label:Object(o.__)("Intrinsic","amp"),notAvailable:["core/video","core-embed/youtube","core-embed/facebook","core-embed/instagram","core-embed/vimeo","core-embed/dailymotion","core-embed/reddit","core-embed/soundcloud"]}],m=function(e,t){return"core/gallery"===t&&(e.attributes||(e.attributes={}),e.attributes.ampCarousel={type:"boolean",default:!Object(c.select)("amp/block-editor").hasThemeSupport()},e.attributes.ampLightbox={type:"boolean",default:!1}),"core/image"===t&&(e.attributes||(e.attributes={}),e.attributes.ampLightbox={type:"boolean",default:!1}),u.e.includes(t)&&(e.attributes||(e.attributes={}),e.attributes.ampFitText={type:"boolean",default:!1},e.attributes.minFont={default:l.d,source:"attribute",selector:"amp-fit-text",attribute:"min-font-size"},e.attributes.maxFont={default:l.b,source:"attribute",selector:"amp-fit-text",attribute:"max-font-size"},e.attributes.height={default:"core/image"===t?200:10*Math.ceil(l.b/10),source:"attribute",selector:"amp-fit-text",attribute:"height"}),(0===t.indexOf("core-embed")||u.c.includes(t))&&(e.attributes||(e.attributes={}),e.attributes.ampLayout={type:"string"},e.attributes.ampNoLoading={type:"boolean"}),e},p=function(e,t,r){var o={layout:"fixed-height"};if("core/paragraph"!==t.name||r.ampFitText){if(u.e.includes(t.name)&&r.ampFitText)return r.minFont&&(o["min-font-size"]=r.minFont),r.maxFont&&(o["max-font-size"]=r.maxFont),r.height&&(o.height=r.height),o.children=e,Object(n.createElement)("amp-fit-text",o)}else{var i=d(r.content);if(i!==r.content)return Object(n.cloneElement)(e,{key:"new",value:i})}return e},d=function(e){var t=/<amp-fit-text\b[^>]*>(.*?)<\/amp-fit-text>/.exec(e),r=e;return t&&t[1]&&(r=t[1]),r},O=function(e){var t,r=[{value:"",label:Object(o.__)("Default","amp")}],n=s(b);try{for(n.s();!(t=n.n()).done;){var i=t.value;!i.notAvailable.includes(e)&&r.push({value:i.value,label:i.label})}}catch(e){n.e(e)}finally{n.f()}return r},h=function(e){return function(t){var r,o=t.attributes.ampLayout,i=t.name;return"core/gallery"===i?r=x(t):"core/image"===i?r=w(t):u.c.includes(i)||0===i.indexOf("core-embed/")?r=v(t):u.e.includes(i)&&(r=j(t)),o&&"nodisplay"===o?[r]:Object(n.createElement)(n.Fragment,null,Object(n.createElement)(e,t),r)}},v=function(e){return e.isSelected?Object(n.createElement)(a.InspectorControls,null,Object(n.createElement)(i.PanelBody,{title:Object(o.__)("AMP Settings","amp")},Object(n.createElement)(y,e),Object(n.createElement)(g,e))):null},y=function(e){var t=e.name,r=e.attributes.ampLayout,a=e.setAttributes,c=Object(o.__)("AMP Layout","amp");return"core/image"===t&&(c=Object(o.__)("AMP Layout (modifies width/height)","amp")),Object(n.createElement)(i.SelectControl,{label:c,value:r,options:O(t),onChange:function(t){a({ampLayout:t}),"core/image"===e.name&&function(e,t){var r=e.attributes,n=e.setAttributes;switch(t){case"fixed-height":r.height||n({height:u.a}),r.ampLightbox&&n({ampLightbox:!1});break;case"fixed":r.height||n({height:u.a}),r.width||n({width:u.b})}}(e,t)}})},g=function(e){var t=e.attributes.ampNoLoading,r=e.setAttributes,a=Object(o.__)("AMP Noloading","amp");return Object(n.createElement)(i.ToggleControl,{label:a,checked:t,onChange:function(){return r({ampNoLoading:!t})}})},j=function(e){var t=e.isSelected,r=e.attributes,c=e.setAttributes,u=r.ampFitText,s=r.minFont,f=r.maxFont,b=r.height,m=[{name:"small",shortName:Object(o._x)("S","font size","amp"),size:14},{name:"regular",shortName:Object(o._x)("M","font size","amp"),size:16},{name:"large",shortName:Object(o._x)("L","font size","amp"),size:36},{name:"larger",shortName:Object(o._x)("XL","font size","amp"),size:48}];if(!t)return null;var p=Object(o.__)("Automatically fit text to container","amp");return u&&(f=parseInt(f),b=parseInt(b),s=parseInt(s)),Object(n.createElement)(a.InspectorControls,null,Object(n.createElement)(i.PanelBody,{title:Object(o.__)("AMP Settings","amp"),className:u?"is-amp-fit-text":""},Object(n.createElement)(i.ToggleControl,{label:p,checked:u,onChange:function(){return c({ampFitText:!u})}})),u&&Object(n.createElement)(n.Fragment,null,Object(n.createElement)(i.TextControl,{label:Object(o.__)("Height","amp"),value:b,min:1,onChange:function(e){c({height:e})}}),f>b&&Object(n.createElement)(i.Notice,{status:"error",isDismissible:!1},Object(o.__)("The height must be greater than the max font size.","amp")),Object(n.createElement)(i.PanelBody,{title:Object(o.__)("Minimum font size","amp")},Object(n.createElement)(i.FontSizePicker,{fallbackFontSize:14,value:s,fontSizes:m,onChange:function(e){e||(e=l.d),parseInt(e)<=f&&c({minFont:e})}})),s>f&&Object(n.createElement)(i.Notice,{status:"error",isDismissible:!1},Object(o.__)("The min font size must less than the max font size.","amp")),Object(n.createElement)(i.PanelBody,{title:Object(o.__)("Maximum font size","amp")},Object(n.createElement)(i.FontSizePicker,{fallbackFontSize:48,value:f,fontSizes:m,onChange:function(e){e||(e=l.b),c({maxFont:e,height:Math.max(e,b)})}}))))},_=function(e){var t=e.attributes,r=t.ampLightbox,a=t.linkTo,c=t.ampLayout,u=e.setAttributes;return Object(n.createElement)(i.ToggleControl,{label:Object(o.__)("Add lightbox effect","amp"),checked:r,onChange:function(e){u({ampLightbox:!r}),e&&("fixed-height"===c&&u({ampLayout:"fixed"}),a&&"none"!==a&&u({linkTo:"none"}))}})},E=function(e){var t=e.attributes.ampCarousel,r=e.setAttributes;return Object(n.createElement)(i.ToggleControl,{label:Object(o.__)("Display as carousel","amp"),checked:t,onChange:function(){return r({ampCarousel:!t})}})},w=function(e){return e.isSelected?Object(n.createElement)(a.InspectorControls,null,Object(n.createElement)(i.PanelBody,{title:Object(o.__)("AMP Settings","amp")},Object(n.createElement)(y,e),Object(n.createElement)(g,e),Object(n.createElement)(_,e))):null},x=function(e){return e.isSelected?Object(n.createElement)(a.InspectorControls,null,Object(n.createElement)(i.PanelBody,{title:Object(o.__)("AMP Settings","amp")},Object(n.createElement)(E,e),Object(n.createElement)(_,e))):null},P=function(){return(0,Object(c.select)("core/editor").getEditedPostAttribute)("amp_enabled")||!1}},,function(e,t){!function(){e.exports=this.wp.hooks}()},,,,function(e,t){!function(){e.exports=this.React}()},,,,,,function(e,t,r){"use strict";var n=r(29);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,t,r,o,i,a){if(a!==n){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}function t(){return e}e.isRequired=e;var r={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:o};return r.PropTypes=r,r}},function(e,t,r){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,r){"use strict";var n={};r.r(n),r.d(n,"hasThemeSupport",(function(){return c})),r.d(n,"isStandardMode",(function(){return u})),r.d(n,"getErrorMessages",(function(){return l})),r.d(n,"getAmpSlug",(function(){return s}));var o=r(8),i=r.n(o),a=r(3);function c(e){return Boolean(e.hasThemeSupport)}function u(e){return Boolean(e.isStandardMode)}function l(e){return e.errorMessages}function s(e){return e.ampSlug}function f(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}Object(a.registerStore)("amp/block-editor",{reducer:function(e){return e},selectors:n,initialState:function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?f(Object(r),!0).forEach((function(t){i()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):f(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},window.ampBlockEditor)})},,function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}},,,,function(e,t,r){var n=r(46),o=r(47),i=r(48),a=r(49);e.exports=function(e){return n(e)||o(e)||i(e)||a()}},,,,,,,,,function(e,t,r){},function(e,t,r){var n=r(32);e.exports=function(e){if(Array.isArray(e))return n(e)}},function(e,t){e.exports=function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}},function(e,t,r){var n=r(32);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},function(e,t,r){"use strict";r.r(t);var n={};r.r(n),r.d(n,"addValidationError",(function(){return A})),r.d(n,"resetValidationErrors",(function(){return T})),r.d(n,"updateReviewLink",(function(){return I}));var o={};r.r(o),r.d(o,"getValidationErrors",(function(){return D})),r.d(o,"getBlockValidationErrors",(function(){return L})),r.d(o,"getReviewLink",(function(){return C})),r.d(o,"isSanitizationAutoAccepted",(function(){return M}));var i=r(18),a=r(3),c=r(16),u=r(8),l=r.n(u),s=r(12),f=r(1);function b(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return m(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return m(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return a=e.done,e},e:function(e){c=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw i}}}}function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function p(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function d(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?p(Object(r),!0).forEach((function(t){l()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var O=function(){var e=Object(a.select)("core/notices").getNotices,t=Object(a.dispatch)("core/notices").removeNotice;e().filter((function(e){return"amp-errors-notice"===e.id}))&&t("amp-errors-notice")},h=[],v=function(){var e,t=Object(a.select)("amp/block-validation"),r=t.getValidationErrors,n=t.getReviewLink,o=Object(a.dispatch)("core/notices").createWarningNotice,i=r(),c=i.length;e=Object(f.sprintf)(
2
  /* translators: %s: number of issues */
3
  Object(f._n)("There is %s issue from AMP validation which needs review.","There are %s issues from AMP validation which need review.",c,"amp"),c);var u=i.filter((function(e){return e.clientId})),l=u.length;l>0?e+=" "+Object(f.sprintf)(
4
  /* translators: %s: number of block errors. */
1
+ !function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=50)}([function(e,t){!function(){e.exports=this.wp.element}()},function(e,t){!function(){e.exports=this.wp.i18n}()},function(e,t){!function(){e.exports=this.wp.components}()},function(e,t){!function(){e.exports=this.wp.data}()},function(e,t){!function(){e.exports=this.wp.blockEditor}()},function(e,t,r){e.exports=r(28)()},,function(e,t,r){"use strict";r.d(t,"e",(function(){return n})),r.d(t,"c",(function(){return o})),r.d(t,"b",(function(){return i})),r.d(t,"a",(function(){return a})),r.d(t,"d",(function(){return c}));var n=["core/paragraph","core/heading","core/code","core/quote","core/subhead"],o=["core/image","core/video"],i=608,a=400,c="editor-post-preview"},,function(e,t){e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}},,function(e,t,r){"use strict";r.d(t,"c",(function(){return n})),r.d(t,"b",(function(){return o})),r.d(t,"a",(function(){return i}));var n=6,o=72,i="select-file-type-error"},function(e,t){!function(){e.exports=this.lodash}()},function(e,t){!function(){e.exports=this.wp.compose}()},,,function(e,t,r){"use strict";r.d(t,"a",(function(){return m})),r.d(t,"c",(function(){return p})),r.d(t,"b",(function(){return h})),r.d(t,"d",(function(){return P}));var n=r(0),o=(r(5),r(22),r(1)),i=r(2),a=r(4),c=r(3),u=r(7),l=r(11);function s(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return f(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return f(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return a=e.done,e},e:function(e){c=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw i}}}}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var b=[{value:"nodisplay",label:Object(o.__)("No Display","amp"),notAvailable:["core-embed/vimeo","core-embed/dailymotion","core-embed/reddit","core-embed/soundcloud"]},{value:"fixed",label:Object(o.__)("Fixed","amp"),notAvailable:["core-embed/soundcloud"]},{value:"responsive",label:Object(o.__)("Responsive","amp"),notAvailable:["core-embed/soundcloud"]},{value:"fixed-height",label:Object(o.__)("Fixed Height","amp"),notAvailable:[]},{value:"fill",label:Object(o.__)("Fill","amp"),notAvailable:["core-embed/soundcloud"]},{value:"flex-item",label:Object(o.__)("Flex Item","amp"),notAvailable:["core-embed/soundcloud"]},{value:"intrinsic",label:Object(o.__)("Intrinsic","amp"),notAvailable:["core/video","core-embed/youtube","core-embed/facebook","core-embed/instagram","core-embed/vimeo","core-embed/dailymotion","core-embed/reddit","core-embed/soundcloud"]}],m=function(e,t){return"core/gallery"===t&&(e.attributes||(e.attributes={}),e.attributes.ampCarousel={type:"boolean",default:!Object(c.select)("amp/block-editor").hasThemeSupport()},e.attributes.ampLightbox={type:"boolean",default:!1}),"core/image"===t&&(e.attributes||(e.attributes={}),e.attributes.ampLightbox={type:"boolean",default:!1}),u.e.includes(t)&&(e.attributes||(e.attributes={}),e.attributes.ampFitText={type:"boolean",default:!1},e.attributes.minFont={default:l.c,source:"attribute",selector:"amp-fit-text",attribute:"min-font-size"},e.attributes.maxFont={default:l.b,source:"attribute",selector:"amp-fit-text",attribute:"max-font-size"},e.attributes.height={default:"core/image"===t?200:10*Math.ceil(l.b/10),source:"attribute",selector:"amp-fit-text",attribute:"height"}),(0===t.indexOf("core-embed")||u.c.includes(t))&&(e.attributes||(e.attributes={}),e.attributes.ampLayout={type:"string"},e.attributes.ampNoLoading={type:"boolean"}),e},p=function(e,t,r){var o={layout:"fixed-height"};if("core/paragraph"!==t.name||r.ampFitText){if(u.e.includes(t.name)&&r.ampFitText)return r.minFont&&(o["min-font-size"]=r.minFont),r.maxFont&&(o["max-font-size"]=r.maxFont),r.height&&(o.height=r.height),o.children=e,Object(n.createElement)("amp-fit-text",o)}else{var i=d(r.content);if(i!==r.content)return Object(n.cloneElement)(e,{key:"new",value:i})}return e},d=function(e){var t=/<amp-fit-text\b[^>]*>(.*?)<\/amp-fit-text>/.exec(e),r=e;return t&&t[1]&&(r=t[1]),r},O=function(e){var t,r=[{value:"",label:Object(o.__)("Default","amp")}],n=s(b);try{for(n.s();!(t=n.n()).done;){var i=t.value;!i.notAvailable.includes(e)&&r.push({value:i.value,label:i.label})}}catch(e){n.e(e)}finally{n.f()}return r},h=function(e){return function(t){var r,o=t.attributes.ampLayout,i=t.name;return"core/gallery"===i?r=x(t):"core/image"===i?r=w(t):u.c.includes(i)||0===i.indexOf("core-embed/")?r=v(t):u.e.includes(i)&&(r=j(t)),o&&"nodisplay"===o?[r]:Object(n.createElement)(n.Fragment,null,Object(n.createElement)(e,t),r)}},v=function(e){return e.isSelected?Object(n.createElement)(a.InspectorControls,null,Object(n.createElement)(i.PanelBody,{title:Object(o.__)("AMP Settings","amp")},Object(n.createElement)(y,e),Object(n.createElement)(g,e))):null},y=function(e){var t=e.name,r=e.attributes.ampLayout,a=e.setAttributes,c=Object(o.__)("AMP Layout","amp");return"core/image"===t&&(c=Object(o.__)("AMP Layout (modifies width/height)","amp")),Object(n.createElement)(i.SelectControl,{label:c,value:r,options:O(t),onChange:function(t){a({ampLayout:t}),"core/image"===e.name&&function(e,t){var r=e.attributes,n=e.setAttributes;switch(t){case"fixed-height":r.height||n({height:u.a}),r.ampLightbox&&n({ampLightbox:!1});break;case"fixed":r.height||n({height:u.a}),r.width||n({width:u.b})}}(e,t)}})},g=function(e){var t=e.attributes.ampNoLoading,r=e.setAttributes,a=Object(o.__)("AMP Noloading","amp");return Object(n.createElement)(i.ToggleControl,{label:a,checked:t,onChange:function(){return r({ampNoLoading:!t})}})},j=function(e){var t=e.isSelected,r=e.attributes,c=e.setAttributes,u=r.ampFitText,s=r.minFont,f=r.maxFont,b=r.height,m=[{name:"small",shortName:Object(o._x)("S","font size","amp"),size:14},{name:"regular",shortName:Object(o._x)("M","font size","amp"),size:16},{name:"large",shortName:Object(o._x)("L","font size","amp"),size:36},{name:"larger",shortName:Object(o._x)("XL","font size","amp"),size:48}];if(!t)return null;var p=Object(o.__)("Automatically fit text to container","amp");return u&&(f=parseInt(f),b=parseInt(b),s=parseInt(s)),Object(n.createElement)(a.InspectorControls,null,Object(n.createElement)(i.PanelBody,{title:Object(o.__)("AMP Settings","amp"),className:u?"is-amp-fit-text":""},Object(n.createElement)(i.ToggleControl,{label:p,checked:u,onChange:function(){return c({ampFitText:!u})}})),u&&Object(n.createElement)(n.Fragment,null,Object(n.createElement)(i.TextControl,{label:Object(o.__)("Height","amp"),value:b,min:1,onChange:function(e){c({height:e})}}),f>b&&Object(n.createElement)(i.Notice,{status:"error",isDismissible:!1},Object(o.__)("The height must be greater than the max font size.","amp")),Object(n.createElement)(i.PanelBody,{title:Object(o.__)("Minimum font size","amp")},Object(n.createElement)(i.FontSizePicker,{fallbackFontSize:14,value:s,fontSizes:m,onChange:function(e){e||(e=l.c),parseInt(e)<=f&&c({minFont:e})}})),s>f&&Object(n.createElement)(i.Notice,{status:"error",isDismissible:!1},Object(o.__)("The min font size must less than the max font size.","amp")),Object(n.createElement)(i.PanelBody,{title:Object(o.__)("Maximum font size","amp")},Object(n.createElement)(i.FontSizePicker,{fallbackFontSize:48,value:f,fontSizes:m,onChange:function(e){e||(e=l.b),c({maxFont:e,height:Math.max(e,b)})}}))))},_=function(e){var t=e.attributes,r=t.ampLightbox,a=t.linkTo,c=t.ampLayout,u=e.setAttributes;return Object(n.createElement)(i.ToggleControl,{label:Object(o.__)("Add lightbox effect","amp"),checked:r,onChange:function(e){u({ampLightbox:!r}),e&&("fixed-height"===c&&u({ampLayout:"fixed"}),a&&"none"!==a&&u({linkTo:"none"}))}})},E=function(e){var t=e.attributes.ampCarousel,r=e.setAttributes;return Object(n.createElement)(i.ToggleControl,{label:Object(o.__)("Display as carousel","amp"),checked:t,onChange:function(){return r({ampCarousel:!t})}})},w=function(e){return e.isSelected?Object(n.createElement)(a.InspectorControls,null,Object(n.createElement)(i.PanelBody,{title:Object(o.__)("AMP Settings","amp")},Object(n.createElement)(y,e),Object(n.createElement)(g,e),Object(n.createElement)(_,e))):null},x=function(e){return e.isSelected?Object(n.createElement)(a.InspectorControls,null,Object(n.createElement)(i.PanelBody,{title:Object(o.__)("AMP Settings","amp")},Object(n.createElement)(E,e),Object(n.createElement)(_,e))):null},P=function(){return(0,Object(c.select)("core/editor").getEditedPostAttribute)("amp_enabled")||!1}},,function(e,t){!function(){e.exports=this.wp.hooks}()},,,,function(e,t){!function(){e.exports=this.React}()},,,,,,function(e,t,r){"use strict";var n=r(29);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,t,r,o,i,a){if(a!==n){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}function t(){return e}e.isRequired=e;var r={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:o};return r.PropTypes=r,r}},function(e,t,r){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,r){"use strict";var n={};r.r(n),r.d(n,"hasThemeSupport",(function(){return c})),r.d(n,"isStandardMode",(function(){return u})),r.d(n,"getErrorMessages",(function(){return l})),r.d(n,"getAmpSlug",(function(){return s}));var o=r(9),i=r.n(o),a=r(3);function c(e){return Boolean(e.hasThemeSupport)}function u(e){return Boolean(e.isStandardMode)}function l(e){return e.errorMessages}function s(e){return e.ampSlug}function f(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}Object(a.registerStore)("amp/block-editor",{reducer:function(e){return e},selectors:n,initialState:function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?f(Object(r),!0).forEach((function(t){i()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):f(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},window.ampBlockEditor)})},,function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}},,,,function(e,t,r){var n=r(46),o=r(47),i=r(48),a=r(49);e.exports=function(e){return n(e)||o(e)||i(e)||a()}},,,,,,,,,function(e,t,r){},function(e,t,r){var n=r(32);e.exports=function(e){if(Array.isArray(e))return n(e)}},function(e,t){e.exports=function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}},function(e,t,r){var n=r(32);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},function(e,t,r){"use strict";r.r(t);var n={};r.r(n),r.d(n,"addValidationError",(function(){return A})),r.d(n,"resetValidationErrors",(function(){return T})),r.d(n,"updateReviewLink",(function(){return I}));var o={};r.r(o),r.d(o,"getValidationErrors",(function(){return D})),r.d(o,"getBlockValidationErrors",(function(){return L})),r.d(o,"getReviewLink",(function(){return C})),r.d(o,"isSanitizationAutoAccepted",(function(){return M}));var i=r(18),a=r(3),c=r(16),u=r(9),l=r.n(u),s=r(12),f=r(1);function b(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return m(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return m(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return a=e.done,e},e:function(e){c=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw i}}}}function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function p(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function d(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?p(Object(r),!0).forEach((function(t){l()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var O=function(){var e=Object(a.select)("core/notices").getNotices,t=Object(a.dispatch)("core/notices").removeNotice;e().filter((function(e){return"amp-errors-notice"===e.id}))&&t("amp-errors-notice")},h=[],v=function(){var e,t=Object(a.select)("amp/block-validation"),r=t.getValidationErrors,n=t.getReviewLink,o=Object(a.dispatch)("core/notices").createWarningNotice,i=r(),c=i.length;e=Object(f.sprintf)(
2
  /* translators: %s: number of issues */
3
  Object(f._n)("There is %s issue from AMP validation which needs review.","There are %s issues from AMP validation which need review.",c,"amp"),c);var u=i.filter((function(e){return e.clientId})),l=u.length;l>0?e+=" "+Object(f.sprintf)(
4
  /* translators: %s: number of block errors. */
assets/js/amp-onboarding-wizard.asset.php CHANGED
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('lodash', 'wp-api-fetch', 'wp-dom-ready', 'wp-html-entities', 'wp-i18n', 'wp-url'), 'version' => '061b6c6816a863aa79b50fd6bd60db42');
1
+ <?php return array('dependencies' => array('lodash', 'wp-api-fetch', 'wp-dom-ready', 'wp-html-entities', 'wp-i18n', 'wp-url'), 'version' => 'd0bdcf1a53c0de54aa0ce19623a48ea3');
assets/js/amp-settings.asset.php CHANGED
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('lodash', 'wp-api-fetch', 'wp-i18n'), 'version' => '11ccf123ab5c196aba13a1a1142edc1c');
1
+ <?php return array('dependencies' => array('lodash', 'wp-api-fetch', 'wp-i18n'), 'version' => 'b84345d93e67b1e2a43964d53e433f3e');
includes/admin/class-amp-post-meta-box.php CHANGED
@@ -265,17 +265,21 @@ class AMP_Post_Meta_Box {
265
  true
266
  );
267
 
 
 
268
  $data = [
269
- 'ampSlug' => amp_get_slug(),
270
- 'errorMessages' => $this->get_error_messages( $status_and_errors['errors'] ),
271
- 'hasThemeSupport' => ! amp_is_legacy(),
272
- 'isStandardMode' => amp_is_canonical(),
 
 
273
  ];
274
 
275
- wp_localize_script(
276
  self::BLOCK_ASSET_HANDLE,
277
- 'ampBlockEditor',
278
- $data
279
  );
280
 
281
  if ( function_exists( 'wp_set_script_translations' ) ) {
@@ -292,6 +296,46 @@ class AMP_Post_Meta_Box {
292
  }
293
  }
294
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
295
  /**
296
  * Render AMP status.
297
  *
265
  true
266
  );
267
 
268
+ list( $featured_image_minimum_width, $featured_image_minimum_height ) = self::get_featured_image_dimensions();
269
+
270
  $data = [
271
+ 'ampSlug' => amp_get_slug(),
272
+ 'errorMessages' => $this->get_error_messages( $status_and_errors['errors'] ),
273
+ 'hasThemeSupport' => ! amp_is_legacy(),
274
+ 'isStandardMode' => amp_is_canonical(),
275
+ 'featuredImageMinimumWidth' => $featured_image_minimum_width,
276
+ 'featuredImageMinimumHeight' => $featured_image_minimum_height,
277
  ];
278
 
279
+ wp_add_inline_script(
280
  self::BLOCK_ASSET_HANDLE,
281
+ sprintf( 'var ampBlockEditor = %s;', wp_json_encode( $data ) ),
282
+ 'before'
283
  );
284
 
285
  if ( function_exists( 'wp_set_script_translations' ) ) {
296
  }
297
  }
298
 
299
+ /**
300
+ * Returns a tuple of width and height featured image dimensions after filtering.
301
+ *
302
+ * @return int[] {
303
+ * Minimum dimensions.
304
+ *
305
+ * @type int $0 Image width in pixels. May be zero to disable the dimension constraint.
306
+ * @type int $1 Image height in pixels. May be zero to disable the dimension constraint.
307
+ * }
308
+ */
309
+ public static function get_featured_image_dimensions() {
310
+ $default_width = 1200;
311
+ $default_height = 675;
312
+
313
+ /**
314
+ * Filters the minimum height required for a featured image.
315
+ *
316
+ * @since 2.0.9
317
+ *
318
+ * @param int $featured_image_minimum_height The minimum height of the image, defaults to 675.
319
+ * Returning a number less than or equal to zero disables the minimum constraint.
320
+ */
321
+ $featured_image_minimum_height = (int) apply_filters( 'amp_featured_image_minimum_height', $default_height );
322
+
323
+ /**
324
+ * Filters the minimum width required for a featured image.
325
+ *
326
+ * @since 2.0.9
327
+ *
328
+ * @param int $featured_image_minimum_width The minimum width of the image, defaults to 1200.
329
+ * Returning a number less than or equal to zero disables the minimum constraint.
330
+ */
331
+ $featured_image_minimum_width = (int) apply_filters( 'amp_featured_image_minimum_width', $default_width );
332
+
333
+ return [
334
+ max( $featured_image_minimum_width, 0 ),
335
+ max( $featured_image_minimum_height, 0 ),
336
+ ];
337
+ }
338
+
339
  /**
340
  * Render AMP status.
341
  *
includes/amp-helper-functions.php CHANGED
@@ -7,6 +7,7 @@
7
 
8
  use AmpProject\AmpWP\Admin\ReaderThemes;
9
  use AmpProject\AmpWP\AmpWpPluginFactory;
 
10
  use AmpProject\AmpWP\Icon;
11
  use AmpProject\AmpWP\Option;
12
  use AmpProject\AmpWP\QueryVar;
@@ -417,9 +418,16 @@ function amp_is_available() {
417
  $warn = static function () {
418
  static $already_warned_sources = [];
419
 
420
- $likely_culprit_detector = Services::get( 'dev_tools.likely_culprit_detector' );
 
 
 
 
 
 
 
 
421
 
422
- $closest_source = $likely_culprit_detector->analyze_backtrace();
423
  $closest_source_identifier = $closest_source['type'] . ':' . $closest_source['name'];
424
  if ( in_array( $closest_source_identifier, $already_warned_sources, true ) ) {
425
  return;
@@ -433,10 +441,20 @@ function amp_is_available() {
433
  '`is_amp_endpoint()`'
434
  );
435
 
 
 
 
 
 
 
 
 
 
 
 
436
  $message .= ' ' . sprintf(
437
- /* translators: 1: the current hook, 2: the wp action, 4: the WP_Query class, 4: the amp_skip_post() function */
438
- __( 'WordPress is currently doing the %1$s hook. Calling this function before the %2$s action means it will not have access to %3$s and the queried object to determine if it is an AMP response, thus neither the %4$s filter nor the AMP enabled toggle will be considered.', 'amp' ),
439
- '`' . current_action() . '`',
440
  '`wp`',
441
  '`WP_Query`',
442
  '`amp_skip_post()`'
@@ -458,6 +476,9 @@ function amp_is_available() {
458
  /* translators: placeholder is the slug of the theme */
459
  $translated_string = __( 'It appears the theme with slug %s is responsible; please contact the author.', 'amp' );
460
  break;
 
 
 
461
  }
462
 
463
  if ( $translated_string ) {
7
 
8
  use AmpProject\AmpWP\Admin\ReaderThemes;
9
  use AmpProject\AmpWP\AmpWpPluginFactory;
10
+ use AmpProject\AmpWP\Exception\InvalidService;
11
  use AmpProject\AmpWP\Icon;
12
  use AmpProject\AmpWP\Option;
13
  use AmpProject\AmpWP\QueryVar;
418
  $warn = static function () {
419
  static $already_warned_sources = [];
420
 
421
+ try {
422
+ $likely_culprit_detector = Services::get( 'dev_tools.likely_culprit_detector' );
423
+ $closest_source = $likely_culprit_detector->analyze_backtrace();
424
+ } catch ( InvalidService $e ) {
425
+ $closest_source = [
426
+ 'type' => 'exception',
427
+ 'name' => 'invalid_service',
428
+ ];
429
+ }
430
 
 
431
  $closest_source_identifier = $closest_source['type'] . ':' . $closest_source['name'];
432
  if ( in_array( $closest_source_identifier, $already_warned_sources, true ) ) {
433
  return;
441
  '`is_amp_endpoint()`'
442
  );
443
 
444
+ $current_hook = current_action();
445
+ if ( $current_hook ) {
446
+ /* translators: placeholder is the current hook */
447
+ $message .= ' ' . sprintf(
448
+ 'WordPress is currently doing the %s hook.',
449
+ '`' . $current_hook . '`'
450
+ );
451
+ } else {
452
+ $message .= ' ' . __( 'WordPress is not currently doing any hook.', 'amp' );
453
+ }
454
+
455
  $message .= ' ' . sprintf(
456
+ /* translators: 1: the wp action, 2: the WP_Query class, 3: the amp_skip_post() function */
457
+ __( 'Calling this function before the %1$s action means it will not have access to %2$s and the queried object to determine if it is an AMP response, thus neither the %3$s filter nor the AMP enabled toggle will be considered.', 'amp' ),
 
458
  '`wp`',
459
  '`WP_Query`',
460
  '`amp_skip_post()`'
476
  /* translators: placeholder is the slug of the theme */
477
  $translated_string = __( 'It appears the theme with slug %s is responsible; please contact the author.', 'amp' );
478
  break;
479
+ case 'exception':
480
+ $translated_string = __( 'The function was called too early (before the plugins_loaded action) to determine the plugin source.', 'amp' );
481
+ break;
482
  }
483
 
484
  if ( $translated_string ) {
includes/class-amp-service-worker.php CHANGED
@@ -65,6 +65,27 @@ class AMP_Service_Worker {
65
  }
66
  }
67
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
68
  /**
69
  * Add query var for iframe service worker request.
70
  *
@@ -111,11 +132,10 @@ class AMP_Service_Worker {
111
  );
112
 
113
  // Serve the AMP Runtime from cache and check for an updated version in the background. See <https://github.com/ampproject/amp-by-example/blob/4593af61609898043302a101826ddafe7206bfd9/boilerplate-generator/templates/files/serviceworkerJs.js#L54-L58>.
114
- $service_workers->caching_routes()->register(
 
115
  '^https:\/\/cdn\.ampproject\.org\/.*',
116
- [
117
- 'strategy' => WP_Service_Worker_Caching_Routes::STRATEGY_STALE_WHILE_REVALIDATE,
118
- ]
119
  );
120
  }
121
 
@@ -132,19 +152,20 @@ class AMP_Service_Worker {
132
  return;
133
  }
134
 
135
- $service_workers->caching_routes()->register(
 
136
  '^' . preg_quote( set_url_scheme( content_url( '/' ), 'https' ), '/' ) . '[^\?]+?\.(?:png|gif|jpg|jpeg|svg|webp)(\?.*)?$',
 
137
  [
138
- 'strategy' => WP_Service_Worker_Caching_Routes::STRATEGY_CACHE_FIRST,
139
  'cacheName' => 'images',
140
- 'plugins' => [
141
- 'cacheableResponse' => [
142
- 'statuses' => [ 0, 200 ],
143
- ],
144
- 'expiration' => [
145
- 'maxEntries' => 60,
146
- 'maxAgeSeconds' => MONTH_IN_SECONDS,
147
- ],
148
  ],
149
  ]
150
  );
@@ -171,28 +192,30 @@ class AMP_Service_Worker {
171
  }
172
 
173
  // Cache the Google Fonts stylesheets with a stale while revalidate strategy.
174
- $service_workers->caching_routes()->register(
 
175
  '^https:\/\/fonts\.googleapis\.com',
 
176
  [
177
- 'strategy' => WP_Service_Worker_Caching_Routes::STRATEGY_STALE_WHILE_REVALIDATE,
178
  'cacheName' => 'google-fonts-stylesheets',
179
  ]
180
  );
181
 
182
  // Cache the Google Fonts webfont files with a cache first strategy for 1 year.
183
- $service_workers->caching_routes()->register(
 
184
  '^https:\/\/fonts\.gstatic\.com',
 
185
  [
186
- 'strategy' => WP_Service_Worker_Caching_Routes::STRATEGY_CACHE_FIRST,
187
  'cacheName' => 'google-fonts-webfonts',
188
- 'plugins' => [
189
- 'cacheableResponse' => [
190
- 'statuses' => [ 0, 200 ],
191
- ],
192
- 'expiration' => [
193
- 'maxAgeSeconds' => YEAR_IN_SECONDS,
194
- 'maxEntries' => 30,
195
- ],
196
  ],
197
  ]
198
  );
65
  }
66
  }
67
 
68
+ /**
69
+ * Register a caching route.
70
+ *
71
+ * @param WP_Service_Worker_Scripts $service_workers Service workers.
72
+ * @param string $route Route.
73
+ * @param string $strategy Strategy name.
74
+ * @param array $args Strategy args.
75
+ * @param array $plugins Plugins.
76
+ */
77
+ private static function register_caching_route( WP_Service_Worker_Scripts $service_workers, $route, $strategy, $args = [], $plugins = [] ) {
78
+ $caching_routes = $service_workers->caching_routes();
79
+ if ( defined( 'PWA_VERSION' ) && version_compare( PWA_VERSION, '0.6', '<' ) ) {
80
+ $args['strategy'] = $strategy;
81
+ $args['plugins'] = $plugins;
82
+ $caching_routes->register( $route, $args );
83
+ } else {
84
+ $args = array_merge( $args, $plugins );
85
+ $caching_routes->register( $route, $strategy, $args );
86
+ }
87
+ }
88
+
89
  /**
90
  * Add query var for iframe service worker request.
91
  *
132
  );
133
 
134
  // Serve the AMP Runtime from cache and check for an updated version in the background. See <https://github.com/ampproject/amp-by-example/blob/4593af61609898043302a101826ddafe7206bfd9/boilerplate-generator/templates/files/serviceworkerJs.js#L54-L58>.
135
+ self::register_caching_route(
136
+ $service_workers,
137
  '^https:\/\/cdn\.ampproject\.org\/.*',
138
+ WP_Service_Worker_Caching_Routes::STRATEGY_STALE_WHILE_REVALIDATE
 
 
139
  );
140
  }
141
 
152
  return;
153
  }
154
 
155
+ self::register_caching_route(
156
+ $service_workers,
157
  '^' . preg_quote( set_url_scheme( content_url( '/' ), 'https' ), '/' ) . '[^\?]+?\.(?:png|gif|jpg|jpeg|svg|webp)(\?.*)?$',
158
+ WP_Service_Worker_Caching_Routes::STRATEGY_CACHE_FIRST,
159
  [
 
160
  'cacheName' => 'images',
161
+ ],
162
+ [
163
+ 'cacheableResponse' => [
164
+ 'statuses' => [ 0, 200 ],
165
+ ],
166
+ 'expiration' => [
167
+ 'maxEntries' => 60,
168
+ 'maxAgeSeconds' => MONTH_IN_SECONDS,
169
  ],
170
  ]
171
  );
192
  }
193
 
194
  // Cache the Google Fonts stylesheets with a stale while revalidate strategy.
195
+ self::register_caching_route(
196
+ $service_workers,
197
  '^https:\/\/fonts\.googleapis\.com',
198
+ WP_Service_Worker_Caching_Routes::STRATEGY_STALE_WHILE_REVALIDATE,
199
  [
 
200
  'cacheName' => 'google-fonts-stylesheets',
201
  ]
202
  );
203
 
204
  // Cache the Google Fonts webfont files with a cache first strategy for 1 year.
205
+ self::register_caching_route(
206
+ $service_workers,
207
  '^https:\/\/fonts\.gstatic\.com',
208
+ WP_Service_Worker_Caching_Routes::STRATEGY_CACHE_FIRST,
209
  [
 
210
  'cacheName' => 'google-fonts-webfonts',
211
+ ],
212
+ [
213
+ 'cacheableResponse' => [
214
+ 'statuses' => [ 0, 200 ],
215
+ ],
216
+ 'expiration' => [
217
+ 'maxAgeSeconds' => YEAR_IN_SECONDS,
218
+ 'maxEntries' => 30,
219
  ],
220
  ]
221
  );
includes/sanitizers/class-amp-core-theme-sanitizer.php CHANGED
@@ -2011,7 +2011,7 @@ class AMP_Core_Theme_Sanitizer extends AMP_Base_Sanitizer {
2011
  static function() {
2012
  // Bail if the dark mode stylesheet is not enqueued.
2013
  if ( ! wp_style_is( 'tt1-dark-mode' ) ) {
2014
- return;
2015
  }
2016
 
2017
  wp_dequeue_style( 'tt1-dark-mode' );
@@ -2021,7 +2021,7 @@ class AMP_Core_Theme_Sanitizer extends AMP_Base_Sanitizer {
2021
  );
2022
 
2023
  if ( ! file_exists( $dark_mode_css_file ) ) {
2024
- return;
2025
  }
2026
 
2027
  $styles = file_get_contents( $dark_mode_css_file ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents
@@ -2050,7 +2050,7 @@ class AMP_Core_Theme_Sanitizer extends AMP_Base_Sanitizer {
2050
 
2051
  // Bail if the stylesheet is not enqueued.
2052
  if ( ! wp_style_is( $style_handle ) ) {
2053
- return;
2054
  }
2055
 
2056
  $css_file = get_theme_file_path(
@@ -2058,7 +2058,7 @@ class AMP_Core_Theme_Sanitizer extends AMP_Base_Sanitizer {
2058
  );
2059
 
2060
  if ( ! file_exists( $css_file ) ) {
2061
- return;
2062
  }
2063
 
2064
  /** @var _WP_Dependency $dependency */
@@ -2069,43 +2069,34 @@ class AMP_Core_Theme_Sanitizer extends AMP_Base_Sanitizer {
2069
 
2070
  $styles = file_get_contents( $css_file ); //phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents
2071
 
2072
- // Make the rules for the mobile menu less specific so that it can also be applied to the
2073
- // amp-lightbox mobile menu also.
2074
- $new_styles = str_replace( '.primary-navigation > .primary-menu-container', '.primary-navigation .primary-menu-container', $styles );
2075
- $new_styles = str_replace( '.primary-navigation > div > .menu-wrapper', '.primary-navigation div > .menu-wrapper', $new_styles );
2076
-
2077
  // Append any extra rules that may be needed.
2078
- $new_styles .= '
2079
- .primary-navigation-open .menu-button-container {
2080
- /* Needs to be shown above amp-lightbox, which has a z-index of 1000. */
2081
- z-index: 1001;
2082
- }
2083
-
2084
  @media only screen and (max-width: 481px) {
2085
- /* Hide the desktop menu so that it does not interfere when the amo-lightbox mobile menu is open. */
2086
- .primary-navigation > .primary-menu-container {
2087
- display: none;
2088
  }
2089
 
2090
- /* Accommodate for the admin bar height */
2091
- .admin-bar amp-lightbox .primary-menu-container {
2092
- margin-top: var(--global--admin-bar--height);
2093
  }
2094
  }
2095
 
2096
- /* Show the sub-menu on hover of menu item */
2097
- .primary-navigation > div > .menu-wrapper > .menu-item-has-children:hover > .sub-menu {
2098
- display: block;
2099
- }
 
2100
 
2101
- /* Hide the plus icon on hover of menu item */
2102
- .primary-navigation > div > .menu-wrapper > .menu-item-has-children:hover > .sub-menu-toggle > .icon-plus {
2103
- display: none;
2104
- }
2105
 
2106
- /* Show the minus icon on hover of menu item */
2107
- .primary-navigation > div > .menu-wrapper > .menu-item-has-children:hover > .sub-menu-toggle > .icon-minus {
2108
- display: flex;
 
2109
  }
2110
  ';
2111
 
@@ -2115,7 +2106,7 @@ class AMP_Core_Theme_Sanitizer extends AMP_Base_Sanitizer {
2115
  if ( ! isset( $dependency->extra['after'] ) ) {
2116
  $dependency->extra['after'] = [];
2117
  }
2118
- array_unshift( $dependency->extra['after'], $new_styles );
2119
  },
2120
  11
2121
  );
@@ -2155,43 +2146,19 @@ class AMP_Core_Theme_Sanitizer extends AMP_Base_Sanitizer {
2155
  * Make the mobile menu for the Twenty Twenty-One theme AMP compatible.
2156
  */
2157
  public function add_twentytwentyone_mobile_modal() {
2158
- $menu_query = $this->dom->xpath->query( "//div[ @class and contains( concat( ' ', normalize-space( @class ), ' ' ), ' primary-menu-container ' ) ]" );
2159
  $menu_toggle = $this->dom->getElementById( 'primary-mobile-menu' );
2160
 
2161
- if ( 1 !== $menu_query->length || ! $menu_toggle ) {
2162
  return;
2163
  }
2164
 
2165
- /** @var DOMElement $primary_menu */
2166
- $primary_menu = $menu_query->item( 0 );
2167
- $primary_menu_copy = $primary_menu->cloneNode( true );
2168
- foreach ( $this->dom->xpath->query( './/*[ @id ]', $primary_menu_copy ) as $element ) {
2169
- /** @var DOMElement $element */
2170
- $element->setAttribute( 'id', $element->getAttribute( 'id' ) . '-mobile' );
2171
- }
2172
-
2173
- $body_id = $this->dom->getElementId( $this->dom->body, 'body' );
2174
-
2175
- // Create an <amp-lightbox> element that will contain the modal.
2176
- $amp_lightbox = $this->dom->createElement( 'amp-lightbox' );
2177
- $amp_lightbox->setAttribute( 'layout', 'nodisplay' );
2178
- $amp_lightbox->setAttribute( 'animate-in', 'fade-in' );
2179
- $amp_lightbox->setAttribute( 'scrollable', true );
2180
- $amp_lightbox_id = $this->dom->getElementId( $amp_lightbox );
2181
-
2182
- $state_string = str_replace( '-', '_', $amp_lightbox_id );
2183
-
2184
- AMP_DOM_Utils::add_amp_action( $menu_toggle, 'tap', "{$amp_lightbox_id}.open" );
2185
- AMP_DOM_Utils::add_amp_action( $menu_toggle, 'tap', "{$body_id}.toggleClass(class=primary-navigation-open,force=true)" );
2186
-
2187
- AMP_DOM_Utils::add_amp_action( $amp_lightbox, 'lightboxOpen', "AMP.setState({{$state_string}:true})" );
2188
- AMP_DOM_Utils::add_amp_action( $amp_lightbox, 'lightboxClose', "AMP.setState({{$state_string}:false})" );
2189
- AMP_DOM_Utils::add_amp_action( $amp_lightbox, 'lightboxClose', "{$body_id}.toggleClass(class=primary-navigation-open,force=false)" );
2190
 
 
 
 
2191
  $menu_toggle->setAttribute( 'data-amp-bind-aria-expanded', "{$state_string} ? 'true' : 'false'" );
2192
-
2193
- $amp_lightbox->appendChild( $primary_menu_copy );
2194
- $primary_menu->parentNode->insertBefore( $amp_lightbox, $primary_menu );
2195
  }
2196
 
2197
  /**
@@ -2202,8 +2169,7 @@ class AMP_Core_Theme_Sanitizer extends AMP_Base_Sanitizer {
2202
  * @see amend_twentytwentyone_styles()
2203
  */
2204
  public function add_twentytwentyone_sub_menu_fix() {
2205
- // The XPath query has to be specific enough to not interfere with the mobile menu.
2206
- $menu_toggles = $this->dom->xpath->query( '//nav/div/ul//button[ @class and contains( concat( " ", normalize-space( @class ), " " ), " sub-menu-toggle " ) ]' );
2207
 
2208
  if ( 0 === $menu_toggles->length ) {
2209
  return;
2011
  static function() {
2012
  // Bail if the dark mode stylesheet is not enqueued.
2013
  if ( ! wp_style_is( 'tt1-dark-mode' ) ) {
2014
+ return; // @codeCoverageIgnore
2015
  }
2016
 
2017
  wp_dequeue_style( 'tt1-dark-mode' );
2021
  );
2022
 
2023
  if ( ! file_exists( $dark_mode_css_file ) ) {
2024
+ return; // @codeCoverageIgnore
2025
  }
2026
 
2027
  $styles = file_get_contents( $dark_mode_css_file ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents
2050
 
2051
  // Bail if the stylesheet is not enqueued.
2052
  if ( ! wp_style_is( $style_handle ) ) {
2053
+ return; // @codeCoverageIgnore
2054
  }
2055
 
2056
  $css_file = get_theme_file_path(
2058
  );
2059
 
2060
  if ( ! file_exists( $css_file ) ) {
2061
+ return; // @codeCoverageIgnore
2062
  }
2063
 
2064
  /** @var _WP_Dependency $dependency */
2069
 
2070
  $styles = file_get_contents( $css_file ); //phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents
2071
 
 
 
 
 
 
2072
  // Append any extra rules that may be needed.
2073
+ $styles .= '
2074
+ /* Trap keyboard navigation within mobile menu when it\'s open */
 
 
 
 
2075
  @media only screen and (max-width: 481px) {
2076
+ .primary-navigation-open #page {
2077
+ visibility: hidden;
 
2078
  }
2079
 
2080
+ .primary-navigation-open .menu-button-container {
2081
+ visibility: visible;
 
2082
  }
2083
  }
2084
 
2085
+ @media (min-width: 482px) {
2086
+ /* Show the sub-menu on hover of menu item */
2087
+ .primary-menu-container > .menu-wrapper > .menu-item-has-children:hover > .sub-menu {
2088
+ display: block;
2089
+ }
2090
 
2091
+ /* Hide the plus icon on hover of menu item */
2092
+ .primary-menu-container > .menu-wrapper > .menu-item-has-children:hover > .sub-menu-toggle > .icon-plus {
2093
+ display: none;
2094
+ }
2095
 
2096
+ /* Show the minus icon on hover of menu item */
2097
+ .primary-menu-container > .menu-wrapper > .menu-item-has-children:hover > .sub-menu-toggle > .icon-minus {
2098
+ display: flex;
2099
+ }
2100
  }
2101
  ';
2102
 
2106
  if ( ! isset( $dependency->extra['after'] ) ) {
2107
  $dependency->extra['after'] = [];
2108
  }
2109
+ array_unshift( $dependency->extra['after'], $styles );
2110
  },
2111
  11
2112
  );
2146
  * Make the mobile menu for the Twenty Twenty-One theme AMP compatible.
2147
  */
2148
  public function add_twentytwentyone_mobile_modal() {
 
2149
  $menu_toggle = $this->dom->getElementById( 'primary-mobile-menu' );
2150
 
2151
+ if ( ! $menu_toggle ) {
2152
  return;
2153
  }
2154
 
2155
+ $state_string = 'mobile_menu_toggled';
2156
+ $body_id = $this->dom->getElementId( $this->dom->body, 'body' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2157
 
2158
+ AMP_DOM_Utils::add_amp_action( $menu_toggle, 'tap', "AMP.setState({{$state_string}: !{$state_string}})" );
2159
+ AMP_DOM_Utils::add_amp_action( $menu_toggle, 'tap', "{$body_id}.toggleClass(class=primary-navigation-open)" );
2160
+ AMP_DOM_Utils::add_amp_action( $menu_toggle, 'tap', "{$body_id}.toggleClass(class=lock-scrolling)" );
2161
  $menu_toggle->setAttribute( 'data-amp-bind-aria-expanded', "{$state_string} ? 'true' : 'false'" );
 
 
 
2162
  }
2163
 
2164
  /**
2169
  * @see amend_twentytwentyone_styles()
2170
  */
2171
  public function add_twentytwentyone_sub_menu_fix() {
2172
+ $menu_toggles = $this->dom->xpath->query( '//nav//button[ @class and contains( concat( " ", normalize-space( @class ), " " ), " sub-menu-toggle " ) ]' );
 
2173
 
2174
  if ( 0 === $menu_toggles->length ) {
2175
  return;
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: google, xwp, automattic, westonruter, albertomedina, schlessera, s
3
  Tags: amp, mobile, optimization, accelerated mobile pages, framework, components, blocks, performance, ux, seo, official
4
  Requires at least: 4.9
5
  Tested up to: 5.6
6
- Stable tag: 2.0.8
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
  Requires PHP: 5.6
3
  Tags: amp, mobile, optimization, accelerated mobile pages, framework, components, blocks, performance, ux, seo, official
4
  Requires at least: 4.9
5
  Tested up to: 5.6
6
+ Stable tag: 2.0.9
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
  Requires PHP: 5.6
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
- return ComposerAutoloaderInit5744ddd98fd0cf1987c37bad69f6fba4::getLoader();
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInitbe01305164cb00d8e2490f2257b43397::getLoader();
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInit5744ddd98fd0cf1987c37bad69f6fba4
6
  {
7
  private static $loader;
8
 
@@ -22,15 +22,15 @@ class ComposerAutoloaderInit5744ddd98fd0cf1987c37bad69f6fba4
22
  return self::$loader;
23
  }
24
 
25
- spl_autoload_register(array('ComposerAutoloaderInit5744ddd98fd0cf1987c37bad69f6fba4', 'loadClassLoader'), true, true);
26
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
27
- spl_autoload_unregister(array('ComposerAutoloaderInit5744ddd98fd0cf1987c37bad69f6fba4', 'loadClassLoader'));
28
 
29
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
30
  if ($useStaticLoader) {
31
  require_once __DIR__ . '/autoload_static.php';
32
 
33
- call_user_func(\Composer\Autoload\ComposerStaticInit5744ddd98fd0cf1987c37bad69f6fba4::getInitializer($loader));
34
  } else {
35
  $map = require __DIR__ . '/autoload_namespaces.php';
36
  foreach ($map as $namespace => $path) {
@@ -51,19 +51,19 @@ class ComposerAutoloaderInit5744ddd98fd0cf1987c37bad69f6fba4
51
  $loader->register(true);
52
 
53
  if ($useStaticLoader) {
54
- $includeFiles = Composer\Autoload\ComposerStaticInit5744ddd98fd0cf1987c37bad69f6fba4::$files;
55
  } else {
56
  $includeFiles = require __DIR__ . '/autoload_files.php';
57
  }
58
  foreach ($includeFiles as $fileIdentifier => $file) {
59
- composerRequire5744ddd98fd0cf1987c37bad69f6fba4($fileIdentifier, $file);
60
  }
61
 
62
  return $loader;
63
  }
64
  }
65
 
66
- function composerRequire5744ddd98fd0cf1987c37bad69f6fba4($fileIdentifier, $file)
67
  {
68
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
69
  require $file;
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInitbe01305164cb00d8e2490f2257b43397
6
  {
7
  private static $loader;
8
 
22
  return self::$loader;
23
  }
24
 
25
+ spl_autoload_register(array('ComposerAutoloaderInitbe01305164cb00d8e2490f2257b43397', 'loadClassLoader'), true, true);
26
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
27
+ spl_autoload_unregister(array('ComposerAutoloaderInitbe01305164cb00d8e2490f2257b43397', 'loadClassLoader'));
28
 
29
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
30
  if ($useStaticLoader) {
31
  require_once __DIR__ . '/autoload_static.php';
32
 
33
+ call_user_func(\Composer\Autoload\ComposerStaticInitbe01305164cb00d8e2490f2257b43397::getInitializer($loader));
34
  } else {
35
  $map = require __DIR__ . '/autoload_namespaces.php';
36
  foreach ($map as $namespace => $path) {
51
  $loader->register(true);
52
 
53
  if ($useStaticLoader) {
54
+ $includeFiles = Composer\Autoload\ComposerStaticInitbe01305164cb00d8e2490f2257b43397::$files;
55
  } else {
56
  $includeFiles = require __DIR__ . '/autoload_files.php';
57
  }
58
  foreach ($includeFiles as $fileIdentifier => $file) {
59
+ composerRequirebe01305164cb00d8e2490f2257b43397($fileIdentifier, $file);
60
  }
61
 
62
  return $loader;
63
  }
64
  }
65
 
66
+ function composerRequirebe01305164cb00d8e2490f2257b43397($fileIdentifier, $file)
67
  {
68
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
69
  require $file;
vendor/composer/autoload_static.php CHANGED
@@ -4,7 +4,7 @@
4
 
5
  namespace Composer\Autoload;
6
 
7
- class ComposerStaticInit5744ddd98fd0cf1987c37bad69f6fba4
8
  {
9
  public static $files = array (
10
  '6f5653f9af3eab04254ad2c7f20515c8' => __DIR__ . '/../..' . '/back-compat/back-compat.php',
@@ -338,9 +338,9 @@ class ComposerStaticInit5744ddd98fd0cf1987c37bad69f6fba4
338
  public static function getInitializer(ClassLoader $loader)
339
  {
340
  return \Closure::bind(function () use ($loader) {
341
- $loader->prefixLengthsPsr4 = ComposerStaticInit5744ddd98fd0cf1987c37bad69f6fba4::$prefixLengthsPsr4;
342
- $loader->prefixDirsPsr4 = ComposerStaticInit5744ddd98fd0cf1987c37bad69f6fba4::$prefixDirsPsr4;
343
- $loader->classMap = ComposerStaticInit5744ddd98fd0cf1987c37bad69f6fba4::$classMap;
344
 
345
  }, null, ClassLoader::class);
346
  }
4
 
5
  namespace Composer\Autoload;
6
 
7
+ class ComposerStaticInitbe01305164cb00d8e2490f2257b43397
8
  {
9
  public static $files = array (
10
  '6f5653f9af3eab04254ad2c7f20515c8' => __DIR__ . '/../..' . '/back-compat/back-compat.php',
338
  public static function getInitializer(ClassLoader $loader)
339
  {
340
  return \Closure::bind(function () use ($loader) {
341
+ $loader->prefixLengthsPsr4 = ComposerStaticInitbe01305164cb00d8e2490f2257b43397::$prefixLengthsPsr4;
342
+ $loader->prefixDirsPsr4 = ComposerStaticInitbe01305164cb00d8e2490f2257b43397::$prefixDirsPsr4;
343
+ $loader->classMap = ComposerStaticInitbe01305164cb00d8e2490f2257b43397::$classMap;
344
 
345
  }, null, ClassLoader::class);
346
  }