AMP for WordPress - Version 2.0.4

Version Description

Download this release

Release Info

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

Code changes from version 2.0.3 to 2.0.4

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.3
9
  * Text Domain: amp
10
  * Domain Path: /languages/
11
  * License: GPLv2 or later
@@ -17,7 +17,7 @@
17
 
18
  define( 'AMP__FILE__', __FILE__ );
19
  define( 'AMP__DIR__', dirname( __FILE__ ) );
20
- define( 'AMP__VERSION', '2.0.3' );
21
 
22
  /**
23
  * 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.4
9
  * Text Domain: amp
10
  * Domain Path: /languages/
11
  * License: GPLv2 or later
17
 
18
  define( 'AMP__FILE__', __FILE__ );
19
  define( 'AMP__DIR__', dirname( __FILE__ ) );
20
+ define( 'AMP__VERSION', '2.0.4' );
21
 
22
  /**
23
  * 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-dom-ready', 'wp-edit-post', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-plugins', 'wp-polyfill', 'wp-url'), 'version' => '3cb593802d9557b1e6d38cb71e9cea89');
1
+ <?php return array('dependencies' => array('lodash', 'moment', 'react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-dom-ready', 'wp-edit-post', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-plugins', 'wp-polyfill', 'wp-url'), 'version' => 'cf180aca5165c763d077e6323453c3c8');
assets/js/amp-block-editor.js CHANGED
@@ -1,17 +1,17 @@
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,"a",(function(){return C})),a.d(t,"c",(function(){return I})),a.d(t,"b",(function(){return k})),a.d(t,"d",(function(){return R}));var r=a(20),n=a.n(r),i=a(25),o=a.n(i),c=a(16),l=a.n(c),u=a(21),s=a.n(u),d=a(22),m=a.n(d),b=a(18),p=a.n(b),f=a(0),h=(a(19),a(12)),O=(a(5),a(2)),y=a(1),g=a(3),j=a(15),v=a(31),_=a(14),w=a(7);function E(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=p()(e);if(t){var n=p()(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return m()(this,a)}}var P=function(e){return Object(f.createElement)("svg",e,Object(f.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(f.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"}))};P.defaultProps={xmlns:"http://www.w3.org/2000/svg"};var x=function(e){return Object(f.createElement)("svg",e,Object(f.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"}))};x.defaultProps={width:"62",height:"62",viewBox:"0 0 62 62",xmlns:"http://www.w3.org/2000/svg"};var S=function(e){s()(a,e);var t=E(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))).moveButton=e.moveButton.bind(l()(e)),e.openPreviewWindow=e.openPreviewWindow.bind(l()(e)),e.buttonRef=Object(f.createRef)(),e}return o()(a,[{key:"componentDidUpdate",value:function(e){var t=this.props.previewLink;t&&!e.previewLink&&this.setPreviewWindowLink(t),this.moveButton()}},{key:"moveButton",value:function(){var e=Object(h.get)(this,["buttonRef","current","parentNode"],!1);if(e&&(!e.previousSibling||!e.previousSibling.classList.contains(w.d))){var t=document.querySelector(".".concat(w.d));Object(h.get)(t,"nextSibling")&&e.parentNode.insertBefore(e,t.nextSibling)}}},{key:"setPreviewWindowLink",value:function(e){var t=this.previewWindow;t&&!t.closed&&(t.location=e)}},{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(f.renderToString)(Object(f.createElement)("div",{className:"editor-post-preview-button__interstitial-message"},Object(f.createElement)(O.Icon,{icon:P({viewBox:"0 0 98 98"})}),Object(f.createElement)("p",null,Object(y.__)("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(y.__)("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(f.createElement)(O.Button,{className:"amp-editor-post-preview",href:c,title:Object(y.__)("Preview AMP","amp"),isSecondary:!0,disabled:!i,onClick:this.openPreviewWindow,ref:this.buttonRef},x({viewBox:"0 0 62 62",width:18,height:18}),Object(f.createElement)("span",{className:"screen-reader-text"},
2
  /* translators: accessibility text */
3
  Object(y.__)("(opens in a new tab)","amp")))}}]),a}(f.Component),C=Object(j.compose)([Object(g.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(v.addQueryArgs)(h,f):void 0;return{postId:i(),currentPostLink:Object(v.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(_.d)(),errorMessages:b(),isStandardMode:p()}})),Object(g.withDispatch)((function(e){return{autosave:e("core/editor").autosave,savePost:e("core/editor").savePost}}))])(S),I=function(e){var t=e.name,a=e.url;return Object(f.createElement)(O.Placeholder,{label:t},Object(f.createElement)("p",{className:"components-placeholder__error"},a),Object(f.createElement)("p",{className:"components-placeholder__error"},Object(y.__)("Previews for this are unavailable in the editor, sorry!","amp")))},k=function(e){var t=e.attributes,a=e.setAttributes,r=e.ampLayoutOptions,n=t.ampLayout,i=t.height,o=t.width,c=!i&&("fixed"===n||"fixed-height"===n),l=!o&&"fixed"===n;return Object(f.createElement)(f.Fragment,null,Object(f.createElement)(O.SelectControl,{label:Object(y.__)("Layout","amp"),value:n,options:r,onChange:function(e){return a({ampLayout:e})}}),l&&Object(f.createElement)(O.Notice,{status:"error",isDismissible:!1},Object(y.sprintf)(
4
  /* translators: %s is the layout name */
5
  Object(y.__)("Width is required for %s layout","amp"),n)),Object(f.createElement)(O.TextControl,{type:"number",label:Object(y.__)("Width (px)","amp"),value:void 0!==o?o:"",onChange:function(e){return a({width:e})}}),c&&Object(f.createElement)(O.Notice,{status:"error",isDismissible:!1},Object(y.sprintf)(
6
  /* translators: %s is the layout name */
7
- Object(y.__)("Height is required for %s layout","amp"),n)),Object(f.createElement)(O.TextControl,{type:"number",label:Object(y.__)("Height (px)","amp"),value:i,onChange:function(e){return a({height:e})}}))},T=a(8),A=a.n(T),M=a(23),F=a(9);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}function L(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){A()(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}function B(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=p()(e);if(t){var n=p()(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return m()(this,a)}}var N=window.wp,R=function(e,t){var a=t.width,r=t.height;return function(e){s()(i,e);var t=B(i);function i(){var e;n()(this,i);for(var a=arguments.length,r=new Array(a),o=0;o<a;o++)r[o]=arguments[o];return"editor-post-featured-image__media-modal"===(e=t.call.apply(t,[this].concat(r))).props.modalClass&&(e.initFeaturedImage=e.initFeaturedImage.bind(l()(e)),e.initFeaturedImage()),e}return o()(i,[{key:"initFeaturedImage",value:function(){var e=Object(M.c)(M.b),t=N.media.controller.FeaturedImage.extend({defaults:L(L({},N.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 N.media.controller.EditImage]}),this.frame.on("toolbar:create:featured-image",(function(e){this.createSelectToolbar(e,{text:N.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),N.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(F.d)({url:a,id:r,width:n,height:i,onSelect:t,dispatchImage:function(e){Object(g.dispatch)("core/editor").editPost({featured_media:e})}}),N.media.view.settings.post.featuredImageId&&N.media.featuredImage.set(e?e.id:-1)}}]),i}(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(
8
  /* translators: 1: .jpg, 2: .png. 3: .gif */
9
  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(
10
  /* translators: 1: minimum width, 2: minimum height. */
11
- 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.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})),a.d(t,"e",(function(){return S}));var r=a(0),n=(a(5),a(19),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},O=function(e){return function(t){var a,n=t.attributes.ampLayout,i=t.name;return"core/gallery"===i?a=P(t):"core/image"===i?a=E(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.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})}})},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)(g,e),Object(r.createElement)(j,e),Object(r.createElement)(_,e))):null},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)(w,e),Object(r.createElement)(_,e))):null},x=function(){return(0,Object(c.select)("core/editor").getEditedPostAttribute)("amp_enabled")||!1},S=function(e){var t=document.querySelector(".".concat(l.d));if(t&&t.nextSibling){var a=document.createElement("div");a.id="amp-wrapper-post-preview",Object(r.render)(Object(r.createElement)(e,null),a),t.parentNode.insertBefore(a,t.nextSibling)}}},function(e,t){!function(){e.exports=this.wp.compose}()},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){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.React}()},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(16);e.exports=function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?n(e):t}},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)(
12
  /* translators: 1: image width in pixels. 2: image height in pixels. 3: required minimum width in pixels. 4: required minimum height in pixels. */
13
  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)(
14
  /* translators: 1: the selected file type. */
15
  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)(
16
  /* translators: 1: the recommended max MB per second for videos. 2: the actual MB per second of the video. */
17
- 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){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,"a",(function(){return u})),a.d(t,"b",(function(){return d}));var r=a(0),n=(a(5),a(2)),i=a(24),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(15),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(20),a(16),a(21),a(22),a(18),a(8),a(12),a(23);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){!function(){e.exports=this.wp.domReady}()},,function(e,t,a){"use strict";a.r(t);var r=a(17),n=a(33),i=a(34),o=a(3),c=a(35),l=a.n(c),u=a(26),s=a(9),d=a(6),m=a(14),b=(a(30),Object(o.select)("amp/block-editor").isStandardMode),p=a(40);p.keys().forEach((function(e){var t=p(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",m.a),Object(r.addFilter)("blocks.getSaveElement","ampEditorBlocks/filterSave",m.c),Object(r.addFilter)("editor.BlockEdit","ampEditorBlocks/filterEdit",m.b,20),Object(r.addFilter)("editor.PostFeaturedImage","ampEditorBlocks/withFeaturedImageNotice",u.b),Object(r.addFilter)("editor.MediaUpload","ampEditorBlocks/withMediaLibraryNotice",(function(e){return Object(d.d)(e,Object(s.b)())}));var f=["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"],h=a(43);h.keys().forEach((function(e){var t=h(e),a=t.name,r=t.settings;b()&&f.includes(a)&&Object(i.registerBlockType)(a,r)})),l()((function(){Object(m.e)(d.a)}))},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={"./amp-toggle.js":41,"./pre-publish-panel.js":42};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=40},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(24),u=a(15),s=a(14);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":50,"./amp-ima-video/index.js":51,"./amp-jwplayer/index.js":52,"./amp-mathml/index.js":53,"./amp-o2-player/index.js":54,"./amp-ooyala-player/index.js":55,"./amp-reach-player/index.js":56,"./amp-springboard-player/index.js":57,"./amp-timeago/index.js":58};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=43},,,,,,,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.b,i()({},e,{ampLayoutOptions:f})))),h&&Object(o.createElement)(u.c,{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.b,i()({},e,{ampLayoutOptions:b})))),p&&Object(o.createElement)(u.c,{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.b,i()({},e,{ampLayoutOptions:m})))),b&&Object(o.createElement)(u.c,{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.b,i()({},e,{ampLayoutOptions:p})))),f&&Object(o.createElement)(u.c,{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.b,i()({},e,{ampLayoutOptions:b})))),p&&Object(o.createElement)(u.c,{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.b,i()({},e,{ampLayoutOptions:s})))),d&&Object(o.createElement)(u.c,{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.b,i()({},e,{ampLayoutOptions:f})))),h&&Object(o.createElement)(u.c,{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(13),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.b,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}}]);
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=38)}([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,"a",(function(){return C})),a.d(t,"c",(function(){return I})),a.d(t,"b",(function(){return k})),a.d(t,"d",(function(){return z}));var r=a(20),n=a.n(r),i=a(25),o=a.n(i),c=a(15),l=a.n(c),u=a(21),s=a.n(u),d=a(22),m=a.n(d),b=a(16),p=a.n(b),f=a(0),h=(a(19),a(12)),O=(a(5),a(2)),y=a(1),g=a(3),j=a(17),v=a(31),_=a(14),w=a(7);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=p()(e);if(t){var n=p()(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return m()(this,a)}}var E=function(e){return Object(f.createElement)("svg",e,Object(f.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(f.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"}))};E.defaultProps={xmlns:"http://www.w3.org/2000/svg"};var x=function(e){return Object(f.createElement)("svg",e,Object(f.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"}))};x.defaultProps={width:"62",height:"62",viewBox:"0 0 62 62",xmlns:"http://www.w3.org/2000/svg"};var S=function(e){s()(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))).moveButton=e.moveButton.bind(l()(e)),e.openPreviewWindow=e.openPreviewWindow.bind(l()(e)),e.buttonRef=Object(f.createRef)(),e}return o()(a,[{key:"componentDidUpdate",value:function(e){var t=this.props.previewLink;t&&!e.previewLink&&this.setPreviewWindowLink(t),this.moveButton()}},{key:"moveButton",value:function(){var e=Object(h.get)(this,["buttonRef","current","parentNode"],!1);if(e&&(!e.previousSibling||!e.previousSibling.classList.contains(w.d))){var t=document.querySelector(".".concat(w.d));Object(h.get)(t,"nextSibling")&&e.parentNode.insertBefore(e,t.nextSibling)}}},{key:"setPreviewWindowLink",value:function(e){var t=this.previewWindow;t&&!t.closed&&(t.location=e)}},{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(f.renderToString)(Object(f.createElement)("div",{className:"editor-post-preview-button__interstitial-message"},Object(f.createElement)(O.Icon,{icon:E({viewBox:"0 0 98 98"})}),Object(f.createElement)("p",null,Object(y.__)("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(y.__)("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(f.createElement)(O.Button,{className:"amp-editor-post-preview",href:c,title:Object(y.__)("Preview AMP","amp"),isSecondary:!0,disabled:!i,onClick:this.openPreviewWindow,ref:this.buttonRef},x({viewBox:"0 0 62 62",width:18,height:18}),Object(f.createElement)("span",{className:"screen-reader-text"},
2
  /* translators: accessibility text */
3
  Object(y.__)("(opens in a new tab)","amp")))}}]),a}(f.Component),C=Object(j.compose)([Object(g.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(v.addQueryArgs)(h,f):void 0;return{postId:i(),currentPostLink:Object(v.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(_.d)(),errorMessages:b(),isStandardMode:p()}})),Object(g.withDispatch)((function(e){return{autosave:e("core/editor").autosave,savePost:e("core/editor").savePost}}))])(S),I=function(e){var t=e.name,a=e.url;return Object(f.createElement)(O.Placeholder,{label:t},Object(f.createElement)("p",{className:"components-placeholder__error"},a),Object(f.createElement)("p",{className:"components-placeholder__error"},Object(y.__)("Previews for this are unavailable in the editor, sorry!","amp")))},k=function(e){var t=e.attributes,a=e.setAttributes,r=e.ampLayoutOptions,n=t.ampLayout,i=t.height,o=t.width,c=!i&&("fixed"===n||"fixed-height"===n),l=!o&&"fixed"===n;return Object(f.createElement)(f.Fragment,null,Object(f.createElement)(O.SelectControl,{label:Object(y.__)("Layout","amp"),value:n,options:r,onChange:function(e){return a({ampLayout:e})}}),l&&Object(f.createElement)(O.Notice,{status:"error",isDismissible:!1},Object(y.sprintf)(
4
  /* translators: %s is the layout name */
5
  Object(y.__)("Width is required for %s layout","amp"),n)),Object(f.createElement)(O.TextControl,{type:"number",label:Object(y.__)("Width (px)","amp"),value:void 0!==o?o:"",onChange:function(e){return a({width:e})}}),c&&Object(f.createElement)(O.Notice,{status:"error",isDismissible:!1},Object(y.sprintf)(
6
  /* translators: %s is the layout name */
7
+ Object(y.__)("Height is required for %s layout","amp"),n)),Object(f.createElement)(O.TextControl,{type:"number",label:Object(y.__)("Height (px)","amp"),value:i,onChange:function(e){return a({height:e})}}))},T=a(8),A=a.n(T),M=a(36),D=a.n(M),F=a(23),L=a(9);function B(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 R(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?B(Object(a),!0).forEach((function(t){A()(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):B(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}function N(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=p()(e);if(t){var n=p()(this).constructor;a=Reflect.construct(r,arguments,n)}else a=r.apply(this,arguments);return m()(this,a)}}var q=window.wp,z=function(e,t){var a=t.width,r=t.height;return function(e){s()(i,e);var t=N(i);function i(){var e,a;n()(this,i);for(var r=arguments.length,o=new Array(r),c=0;c<r;c++)o[c]=arguments[c];return"editor-post-featured-image__media-modal"===(a=t.call.apply(t,[this].concat(o))).props.modalClass?(a.initFeaturedImage=a.initFeaturedImage.bind(l()(a)),a.initFeaturedImage()):(a.frame.off("open",a.onOpen),a.frame.on("open",D()((e=l()(a),p()(i.prototype)),"onOpen",e).bind(l()(a)))),a}return o()(i,[{key:"initFeaturedImage",value:function(){var e=Object(F.c)(F.b),t=q.media.controller.FeaturedImage.extend({defaults:R(R({},q.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 q.media.controller.EditImage]}),this.frame.on("toolbar:create:featured-image",(function(e){this.createSelectToolbar(e,{text:q.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),q.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(L.d)({url:a,id:r,width:n,height:i,onSelect:t,dispatchImage:function(e){Object(g.dispatch)("core/editor").editPost({featured_media:e})}}),q.media.view.settings.post.featuredImageId&&q.media.featuredImage.set(e?e.id:-1)}}]),i}(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(
8
  /* translators: 1: .jpg, 2: .png. 3: .gif */
9
  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(
10
  /* translators: 1: minimum width, 2: minimum height. */
11
+ 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.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})),a.d(t,"e",(function(){return S}));var r=a(0),n=(a(5),a(19),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},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.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},S=function(e){var t=document.querySelector(".".concat(l.d));if(t&&t.nextSibling){var a=document.createElement("div");a.id="amp-wrapper-post-preview",Object(r.render)(Object(r.createElement)(e,null),a),t.parentNode.insertBefore(a,t.nextSibling)}}},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 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.wp.compose}()},function(e,t){!function(){e.exports=this.wp.hooks}()},function(e,t){!function(){e.exports=this.React}()},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(39);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(40),n=a(15);e.exports=function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?n(e):t}},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)(
12
  /* translators: 1: image width in pixels. 2: image height in pixels. 3: required minimum width in pixels. 4: required minimum height in pixels. */
13
  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)(
14
  /* translators: 1: the selected file type. */
15
  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)(
16
  /* translators: 1: the recommended max MB per second for videos. 2: the actual MB per second of the video. */
17
+ 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){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,"a",(function(){return u})),a.d(t,"b",(function(){return d}));var r=a(0),n=(a(5),a(2)),i=a(24),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(17),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(20),a(15),a(21),a(22),a(16),a(8),a(12),a(23);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){!function(){e.exports=this.wp.domReady}()},function(e,t,a){var r=a(41);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(35),l=a.n(c),u=a(26),s=a(9),d=a(6),m=a(14),b=(a(30),Object(o.select)("amp/block-editor").isStandardMode),p=a(42);p.keys().forEach((function(e){var t=p(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",m.a),Object(r.addFilter)("blocks.getSaveElement","ampEditorBlocks/filterSave",m.c),Object(r.addFilter)("editor.BlockEdit","ampEditorBlocks/filterEdit",m.b,20),Object(r.addFilter)("editor.PostFeaturedImage","ampEditorBlocks/withFeaturedImageNotice",u.b),Object(r.addFilter)("editor.MediaUpload","ampEditorBlocks/withMediaLibraryNotice",(function(e){return Object(d.d)(e,Object(s.b)())}));var f=["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"],h=a(45);h.keys().forEach((function(e){var t=h(e),a=t.name,r=t.settings;b()&&f.includes(a)&&Object(i.registerBlockType)(a,r)})),l()((function(){Object(m.e)(d.a)}))},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(16);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":43,"./pre-publish-panel.js":44};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=42},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(24),u=a(17),s=a(14);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":52,"./amp-ima-video/index.js":53,"./amp-jwplayer/index.js":54,"./amp-mathml/index.js":55,"./amp-o2-player/index.js":56,"./amp-ooyala-player/index.js":57,"./amp-reach-player/index.js":58,"./amp-springboard-player/index.js":59,"./amp-timeago/index.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=45},,,,,,,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.b,i()({},e,{ampLayoutOptions:f})))),h&&Object(o.createElement)(u.c,{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.b,i()({},e,{ampLayoutOptions:b})))),p&&Object(o.createElement)(u.c,{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.b,i()({},e,{ampLayoutOptions:m})))),b&&Object(o.createElement)(u.c,{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.b,i()({},e,{ampLayoutOptions:p})))),f&&Object(o.createElement)(u.c,{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.b,i()({},e,{ampLayoutOptions:b})))),p&&Object(o.createElement)(u.c,{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.b,i()({},e,{ampLayoutOptions:s})))),d&&Object(o.createElement)(u.c,{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.b,i()({},e,{ampLayoutOptions:f})))),h&&Object(o.createElement)(u.c,{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(13),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.b,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}}]);
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' => '94208ce6bef7fbe05162e4f1f93e07c7');
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' => '04f97a2d2c7c0d376e785001416679cf');
assets/js/amp-block-validation.js CHANGED
@@ -1,7 +1,7 @@
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=49)}([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,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 S})),r.d(t,"e",(function(){return P}));var n=r(0),o=(r(5),r(19),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},S=function(){return(0,Object(c.select)("core/editor").getEditedPostAttribute)("amp_enabled")||!1},P=function(e){var t=document.querySelector(".".concat(u.d));if(t&&t.nextSibling){var r=document.createElement("div");r.id="amp-wrapper-post-preview",Object(n.render)(Object(n.createElement)(e,null),r),t.parentNode.insertBefore(r,t.nextSibling)}}},function(e,t){!function(){e.exports=this.wp.compose}()},,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(45),o=r(46),i=r(47),a=r(48);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(17),a=r(3),c=r(14),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. */
5
- Object(f._n)("%s issue is directly due to content here.","%s issues are directly due to content here.",l,"amp"),l):1===i.length?e+=" "+Object(f.__)("The issue is not directly due to content here.","amp"):e+=" "+Object(f.__)("The issues are not directly due to content here.","amp"),e+=" ";var s=u.filter((function(e){return 0===e.status||2===e.status})),b=i.filter((function(e){return 0===e.status||2===e.status}));e+=0===s.length+b.length?Object(f.__)("The invalid markup has been automatically removed.","amp"):Object(f._n)("You will have to remove the invalid markup (or allow the plugin to remove it) to serve AMP.","You will have to remove the invalid markup (or allow the plugin to remove it) to serve AMP.",i.length,"amp");var m={id:"amp-errors-notice"},p=n();p&&(m.actions=[{label:Object(f.__)("Review issues","amp"),className:"is-link",onClick:function(){window.open(p,"_blank")}}]),o(e,m)},y=r(0),g=(r(5),r(19),function(e){var t=e.title,r=e.message,n=e.code;return r||(t?Object(y.createElement)("span",{dangerouslySetInnerHTML:{__html:t}}):Object(y.createElement)(y.Fragment,null,Object(f.__)("Error code: ","amp"),Object(y.createElement)("code",null,n||Object(f.__)("unknown","amp"))))}),j=r(2),_=r(15),E=(r(44),Object(a.withSelect)((function(e,t){var r=t.clientId,n=(0,e("amp/block-validation").getBlockValidationErrors)(r);return{blockValidationErrors:n.length?n:void 0}}))),w=Object(_.createHigherOrderComponent)((function(e){return E((function(t){var r=t.blockValidationErrors,n=t.onReplace;if(!r)return Object(y.createElement)(e,t);var o=r.length,i=[{label:Object(f.__)("Remove Block","amp"),onClick:function(){return n([])}}];return Object(y.createElement)(y.Fragment,null,Object(y.createElement)(j.Notice,{status:"warning",isDismissible:!1,actions:i},Object(y.createElement)("details",{className:"amp-block-validation-errors"},Object(y.createElement)("summary",{className:"amp-block-validation-errors__summary"},Object(f.sprintf)(
6
  /* translators: %s is the number of issues */
7
- Object(f._n)("There is %s issue from AMP validation.","There are %s issues from AMP validation.",o,"amp"),o)),Object(y.createElement)("ul",{className:"amp-block-validation-errors__list"},r.map((function(e,t){return Object(y.createElement)("li",{key:t},Object(y.createElement)(g,e))}))))),Object(y.createElement)(e,t))}))}),"withValidationErrorNotice"),x=r(36),S=r.n(x);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 k(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}function A(e,t){return{type:"ADD_VALIDATION_ERROR",error:e,clientId:t}}function T(){return{type:"RESET_VALIDATION_ERRORS"}}function I(e){return{type:"UPDATE_REVIEW_LINK",url:e}}function D(e){return e.errors}function L(e,t){return e.errors.filter((function(e){return e.clientId===t}))}function C(e){return e.reviewLink}function M(e){return Boolean(e.isSanitizationAutoAccepted)}function R(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 F(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?R(Object(r),!0).forEach((function(t){l()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):R(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}Object(a.registerStore)("amp/block-validation",{reducer:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,t=arguments.length>1?arguments[1]:void 0,r=t.type,n=t.url,o=t.error,i=t.clientId;switch(r){case"ADD_VALIDATION_ERROR":var a=e?e.errors:[],c=k(k({},o),{},{clientId:i});return k(k({},e),{},{errors:[].concat(S()(a),[c])});case"RESET_VALIDATION_ERRORS":return k(k({},e),{},{errors:[]});case"UPDATE_REVIEW_LINK":return k(k({},e),{},{reviewLink:n});default:return e}},selectors:o,actions:n,initialState:F(F({},window.ampBlockValidation),{},{errors:[],reviewLink:void 0})}),r(30);var N=Object(a.select)("core/editor").isEditedPostDirty;Object(a.subscribe)((function(){try{N()||(Object(c.d)()?function(){var e=Object(a.select)("core/block-editor"),t=e.getBlockCount,r=e.getClientIdsWithDescendants,n=e.getBlock,o=Object(a.dispatch)("amp/block-validation"),i=o.resetValidationErrors,c=o.addValidationError,u=o.updateReviewLink;if(0!==t()){var l=(0,Object(a.select)("core/editor").getCurrentPost)(),f=l.amp_validity||{};if(f.results&&f.review_link){var m=f.results.filter((function(e){return 3!==e.term_status})).map((function(e){var t=e.error,r=e.status,n=e.title;return d(d({},t),{},{status:r,title:n})}));if(!Object(s.isEqual)(m,h))if(h=m,i(),0!==m.length){u(f.review_link);var p,y=r(),g=b(m);try{for(g.s();!(p=g.n()).done;){var j=p.value;if(!j.sources){c(j);break}var _,E=void 0,w=b(j.sources);try{for(w.s();!(_=w.n()).done;){var x=_.value;if(x.block_name&&void 0!==x.block_content_index&&l.id===x.post_id){var S=y[x.block_content_index];if(S){var P=n(S);P&&P.name===x.block_name&&(E=S)}}}}catch(e){w.e(e)}finally{w.f()}c(j,E)}}catch(e){g.e(e)}finally{g.f()}v()}else O()}}}():(e=Object(a.select)("amp/block-validation").getValidationErrors,t=Object(a.dispatch)("amp/block-validation").resetValidationErrors,e().length>0&&(t(),O(),h=[])))}catch(e){}var e,t})),Object(i.addFilter)("editor.BlockEdit","amp/add-notice",w,99)}]);
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=51)}([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,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 S})),r.d(t,"e",(function(){return P}));var n=r(0),o=(r(5),r(19),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},S=function(){return(0,Object(c.select)("core/editor").getEditedPostAttribute)("amp_enabled")||!1},P=function(e){var t=document.querySelector(".".concat(u.d));if(t&&t.nextSibling){var r=document.createElement("div");r.id="amp-wrapper-post-preview",Object(n.render)(Object(n.createElement)(e,null),r),t.parentNode.insertBefore(r,t.nextSibling)}}},,,function(e,t){!function(){e.exports=this.wp.compose}()},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(47),o=r(48),i=r(49),a=r(50);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(14),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. */
5
+ Object(f._n)("%s issue is directly due to content here.","%s issues are directly due to content here.",l,"amp"),l):1===i.length?e+=" "+Object(f.__)("The issue is not directly due to content here.","amp"):e+=" "+Object(f.__)("The issues are not directly due to content here.","amp"),e+=" ";var s=u.filter((function(e){return 0===e.status||2===e.status})),b=i.filter((function(e){return 0===e.status||2===e.status}));e+=0===s.length+b.length?Object(f.__)("The invalid markup has been automatically removed.","amp"):Object(f._n)("You will have to remove the invalid markup (or allow the plugin to remove it) to serve AMP.","You will have to remove the invalid markup (or allow the plugin to remove it) to serve AMP.",i.length,"amp");var m={id:"amp-errors-notice"},p=n();p&&(m.actions=[{label:Object(f.__)("Review issues","amp"),className:"is-link",onClick:function(){window.open(p,"_blank")}}]),o(e,m)},y=r(0),g=(r(5),r(19),function(e){var t=e.title,r=e.message,n=e.code;return r||(t?Object(y.createElement)("span",{dangerouslySetInnerHTML:{__html:t}}):Object(y.createElement)(y.Fragment,null,Object(f.__)("Error code: ","amp"),Object(y.createElement)("code",null,n||Object(f.__)("unknown","amp"))))}),j=r(2),_=r(17),E=(r(46),Object(a.withSelect)((function(e,t){var r=t.clientId,n=(0,e("amp/block-validation").getBlockValidationErrors)(r);return{blockValidationErrors:n.length?n:void 0}}))),w=Object(_.createHigherOrderComponent)((function(e){return E((function(t){var r=t.blockValidationErrors,n=t.onReplace;if(!r)return Object(y.createElement)(e,t);var o=r.length,i=[{label:Object(f.__)("Remove Block","amp"),onClick:function(){return n([])}}];return Object(y.createElement)(y.Fragment,null,Object(y.createElement)(j.Notice,{status:"warning",isDismissible:!1,actions:i},Object(y.createElement)("details",{className:"amp-block-validation-errors"},Object(y.createElement)("summary",{className:"amp-block-validation-errors__summary"},Object(f.sprintf)(
6
  /* translators: %s is the number of issues */
7
+ Object(f._n)("There is %s issue from AMP validation.","There are %s issues from AMP validation.",o,"amp"),o)),Object(y.createElement)("ul",{className:"amp-block-validation-errors__list"},r.map((function(e,t){return Object(y.createElement)("li",{key:t},Object(y.createElement)(g,e))}))))),Object(y.createElement)(e,t))}))}),"withValidationErrorNotice"),x=r(37),S=r.n(x);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 k(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}function A(e,t){return{type:"ADD_VALIDATION_ERROR",error:e,clientId:t}}function T(){return{type:"RESET_VALIDATION_ERRORS"}}function I(e){return{type:"UPDATE_REVIEW_LINK",url:e}}function D(e){return e.errors}function L(e,t){return e.errors.filter((function(e){return e.clientId===t}))}function C(e){return e.reviewLink}function M(e){return Boolean(e.isSanitizationAutoAccepted)}function R(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 F(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?R(Object(r),!0).forEach((function(t){l()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):R(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}Object(a.registerStore)("amp/block-validation",{reducer:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,t=arguments.length>1?arguments[1]:void 0,r=t.type,n=t.url,o=t.error,i=t.clientId;switch(r){case"ADD_VALIDATION_ERROR":var a=e?e.errors:[],c=k(k({},o),{},{clientId:i});return k(k({},e),{},{errors:[].concat(S()(a),[c])});case"RESET_VALIDATION_ERRORS":return k(k({},e),{},{errors:[]});case"UPDATE_REVIEW_LINK":return k(k({},e),{},{reviewLink:n});default:return e}},selectors:o,actions:n,initialState:F(F({},window.ampBlockValidation),{},{errors:[],reviewLink:void 0})}),r(30);var N=Object(a.select)("core/editor").isEditedPostDirty;Object(a.subscribe)((function(){try{N()||(Object(c.d)()?function(){var e=Object(a.select)("core/block-editor"),t=e.getBlockCount,r=e.getClientIdsWithDescendants,n=e.getBlock,o=Object(a.dispatch)("amp/block-validation"),i=o.resetValidationErrors,c=o.addValidationError,u=o.updateReviewLink;if(0!==t()){var l=(0,Object(a.select)("core/editor").getCurrentPost)(),f=l.amp_validity||{};if(f.results&&f.review_link){var m=f.results.filter((function(e){return 3!==e.term_status})).map((function(e){var t=e.error,r=e.status,n=e.title;return d(d({},t),{},{status:r,title:n})}));if(!Object(s.isEqual)(m,h))if(h=m,i(),0!==m.length){u(f.review_link);var p,y=r(),g=b(m);try{for(g.s();!(p=g.n()).done;){var j=p.value;if(!j.sources){c(j);break}var _,E=void 0,w=b(j.sources);try{for(w.s();!(_=w.n()).done;){var x=_.value;if(x.block_name&&void 0!==x.block_content_index&&l.id===x.post_id){var S=y[x.block_content_index];if(S){var P=n(S);P&&P.name===x.block_name&&(E=S)}}}}catch(e){w.e(e)}finally{w.f()}c(j,E)}}catch(e){g.e(e)}finally{g.f()}v()}else O()}}}():(e=Object(a.select)("amp/block-validation").getValidationErrors,t=Object(a.dispatch)("amp/block-validation").resetValidationErrors,e().length>0&&(t(),O(),h=[])))}catch(e){}var e,t})),Object(i.addFilter)("editor.BlockEdit","amp/add-notice",w,99)}]);
includes/admin/class-amp-template-customizer.php CHANGED
@@ -71,12 +71,14 @@ class AMP_Template_Customizer {
71
  * @since 0.4
72
  * @access public
73
  *
74
- * @param WP_Customize_Manager $wp_customize Customizer instance.
 
75
  * @return AMP_Template_Customizer Instance.
76
  */
77
- public static function init( WP_Customize_Manager $wp_customize ) {
78
- $reader_theme_loader = Services::get( 'reader_theme_loader' );
79
-
 
80
  $self = new self( $wp_customize, $reader_theme_loader );
81
 
82
  $is_reader_mode = ( AMP_Theme_Support::READER_MODE_SLUG === AMP_Options_Manager::get_option( Option::THEME_SUPPORT ) );
71
  * @since 0.4
72
  * @access public
73
  *
74
+ * @param WP_Customize_Manager $wp_customize Customizer instance.
75
+ * @param ReaderThemeLoader $reader_theme_loader Reader theme loader.
76
  * @return AMP_Template_Customizer Instance.
77
  */
78
+ public static function init( WP_Customize_Manager $wp_customize, ReaderThemeLoader $reader_theme_loader = null ) {
79
+ if ( null === $reader_theme_loader ) {
80
+ $reader_theme_loader = Services::get( 'reader_theme_loader' );
81
+ }
82
  $self = new self( $wp_customize, $reader_theme_loader );
83
 
84
  $is_reader_mode = ( AMP_Theme_Support::READER_MODE_SLUG === AMP_Options_Manager::get_option( Option::THEME_SUPPORT ) );
includes/options/class-amp-options-manager.php CHANGED
@@ -241,8 +241,8 @@ class AMP_Options_Manager {
241
  (array) get_post_types_by_support( AMP_Post_Type_Support::SLUG )
242
  );
243
 
244
- // Make sure that all post types get enabled if all templates were supported since they are now independently controlled.
245
- if ( ! empty( $options[ Option::ALL_TEMPLATES_SUPPORTED ] ) ) {
246
  $options[ Option::SUPPORTED_POST_TYPES ] = array_merge(
247
  $options[ Option::SUPPORTED_POST_TYPES ],
248
  AMP_Post_Type_Support::get_eligible_post_types()
241
  (array) get_post_types_by_support( AMP_Post_Type_Support::SLUG )
242
  );
243
 
244
+ // Make sure that all post types get enabled if all templates were supported since they are now independently controlled. This only applies to non-Reader mode.
245
+ if ( ! empty( $options[ Option::ALL_TEMPLATES_SUPPORTED ] ) && AMP_Theme_Support::READER_MODE_SLUG !== $options[ Option::THEME_SUPPORT ] ) {
246
  $options[ Option::SUPPORTED_POST_TYPES ] = array_merge(
247
  $options[ Option::SUPPORTED_POST_TYPES ],
248
  AMP_Post_Type_Support::get_eligible_post_types()
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.5
6
- Stable tag: 2.0.3
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.5
6
+ Stable tag: 2.0.4
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
  Requires PHP: 5.6
src/AmpWpPlugin.php CHANGED
@@ -160,6 +160,7 @@ final class AmpWpPlugin extends ServiceBasedPlugin {
160
  Instrumentation\StopWatch::class,
161
  DevTools\CallbackReflection::class,
162
  DevTools\FileReflection::class,
 
163
  ];
164
  }
165
 
160
  Instrumentation\StopWatch::class,
161
  DevTools\CallbackReflection::class,
162
  DevTools\FileReflection::class,
163
+ ReaderThemeLoader::class,
164
  ];
165
  }
166
 
src/DevTools/FileReflection.php CHANGED
@@ -168,9 +168,18 @@ final class FileReflection implements Service, Registerable {
168
  * }
169
  */
170
  public function get_file_source( $file ) {
 
 
 
 
 
 
 
 
171
  $matches = [];
172
 
173
  if ( $this->is_parent_theme_file( $file, $matches ) ) {
 
174
  return $this->get_file_source_array(
175
  self::TYPE_THEME,
176
  $this->get_template_slug(),
@@ -179,6 +188,7 @@ final class FileReflection implements Service, Registerable {
179
  }
180
 
181
  if ( $this->is_child_theme_file( $file, $matches ) ) {
 
182
  return $this->get_file_source_array(
183
  self::TYPE_THEME,
184
  $this->get_stylesheet_slug(),
@@ -187,6 +197,7 @@ final class FileReflection implements Service, Registerable {
187
  }
188
 
189
  if ( $this->is_plugin_file( $file, $matches ) ) {
 
190
  return $this->get_file_source_array(
191
  self::TYPE_PLUGIN,
192
  $matches['slug'],
@@ -195,6 +206,7 @@ final class FileReflection implements Service, Registerable {
195
  }
196
 
197
  if ( $this->is_mu_plugin_file( $file, $matches ) ) {
 
198
  return $this->get_file_source_array(
199
  self::TYPE_MU_PLUGIN,
200
  $matches['slug'],
@@ -203,6 +215,7 @@ final class FileReflection implements Service, Registerable {
203
  }
204
 
205
  if ( $this->is_core_file( $file, $matches ) ) {
 
206
  return $this->get_file_source_array(
207
  self::TYPE_CORE,
208
  $matches['slug'],
@@ -210,6 +223,7 @@ final class FileReflection implements Service, Registerable {
210
  );
211
  }
212
 
 
213
  return [];
214
  }
215
 
168
  * }
169
  */
170
  public function get_file_source( $file ) {
171
+ static $recursion_protection = false;
172
+
173
+ if ( $recursion_protection ) {
174
+ return [];
175
+ }
176
+
177
+ $recursion_protection = true;
178
+
179
  $matches = [];
180
 
181
  if ( $this->is_parent_theme_file( $file, $matches ) ) {
182
+ $recursion_protection = false;
183
  return $this->get_file_source_array(
184
  self::TYPE_THEME,
185
  $this->get_template_slug(),
188
  }
189
 
190
  if ( $this->is_child_theme_file( $file, $matches ) ) {
191
+ $recursion_protection = false;
192
  return $this->get_file_source_array(
193
  self::TYPE_THEME,
194
  $this->get_stylesheet_slug(),
197
  }
198
 
199
  if ( $this->is_plugin_file( $file, $matches ) ) {
200
+ $recursion_protection = false;
201
  return $this->get_file_source_array(
202
  self::TYPE_PLUGIN,
203
  $matches['slug'],
206
  }
207
 
208
  if ( $this->is_mu_plugin_file( $file, $matches ) ) {
209
+ $recursion_protection = false;
210
  return $this->get_file_source_array(
211
  self::TYPE_MU_PLUGIN,
212
  $matches['slug'],
215
  }
216
 
217
  if ( $this->is_core_file( $file, $matches ) ) {
218
+ $recursion_protection = false;
219
  return $this->get_file_source_array(
220
  self::TYPE_CORE,
221
  $matches['slug'],
223
  );
224
  }
225
 
226
+ $recursion_protection = false;
227
  return [];
228
  }
229
 
src/ReaderThemeLoader.php CHANGED
@@ -128,7 +128,12 @@ final class ReaderThemeLoader implements Service, Registerable {
128
  return $prepared_themes;
129
  }
130
 
131
- $reader_theme = AMP_Options_Manager::get_option( Option::READER_THEME );
 
 
 
 
 
132
  if ( isset( $prepared_themes[ $reader_theme ] ) ) {
133
 
134
  // Make sure the AMP Reader theme appears right after the active theme in the list.
@@ -164,7 +169,7 @@ final class ReaderThemeLoader implements Service, Registerable {
164
  'a' => [ 'href' => true ],
165
  ]
166
  ),
167
- esc_url( add_query_arg( 'page', AMP_Options_Manager::OPTION_NAME, admin_url( 'admin.php' ) ) )
168
  );
169
  }
170
 
@@ -181,7 +186,11 @@ final class ReaderThemeLoader implements Service, Registerable {
181
  return;
182
  }
183
 
184
- $reader_theme = AMP_Options_Manager::get_option( Option::READER_THEME );
 
 
 
 
185
  ?>
186
  <script>
187
  (function( themeSingleTmpl ) {
@@ -249,7 +258,7 @@ final class ReaderThemeLoader implements Service, Registerable {
249
  }
250
  }) (
251
  document.getElementById( 'tmpl-theme' ),
252
- document.querySelector( <?php echo wp_json_encode( sprintf( '#%s-name > span', $reader_theme ) ); ?> )
253
  );
254
  </script>
255
  <?php
@@ -264,6 +273,10 @@ final class ReaderThemeLoader implements Service, Registerable {
264
  * @return WP_Theme|null Theme if selected and no errors.
265
  */
266
  public function get_reader_theme() {
 
 
 
 
267
  $reader_theme_slug = AMP_Options_Manager::get_option( Option::READER_THEME );
268
  if ( ! $reader_theme_slug ) {
269
  return null;
128
  return $prepared_themes;
129
  }
130
 
131
+ $reader_theme_obj = $this->get_reader_theme();
132
+ if ( ! $reader_theme_obj instanceof WP_Theme ) {
133
+ return $prepared_themes;
134
+ }
135
+ $reader_theme = $reader_theme_obj->get_stylesheet();
136
+
137
  if ( isset( $prepared_themes[ $reader_theme ] ) ) {
138
 
139
  // Make sure the AMP Reader theme appears right after the active theme in the list.
169
  'a' => [ 'href' => true ],
170
  ]
171
  ),
172
+ esc_url( add_query_arg( 'page', AMP_Options_Manager::OPTION_NAME, admin_url( 'admin.php' ) ) . '#reader-themes' )
173
  );
174
  }
175
 
186
  return;
187
  }
188
 
189
+ $reader_theme = $this->get_reader_theme();
190
+ if ( ! $reader_theme instanceof WP_Theme ) {
191
+ return;
192
+ }
193
+
194
  ?>
195
  <script>
196
  (function( themeSingleTmpl ) {
258
  }
259
  }) (
260
  document.getElementById( 'tmpl-theme' ),
261
+ document.querySelector( <?php echo wp_json_encode( sprintf( '#%s-name > span', $reader_theme->get_stylesheet() ) ); ?> )
262
  );
263
  </script>
264
  <?php
273
  * @return WP_Theme|null Theme if selected and no errors.
274
  */
275
  public function get_reader_theme() {
276
+ if ( $this->reader_theme instanceof WP_Theme ) {
277
+ return $this->reader_theme;
278
+ }
279
+
280
  $reader_theme_slug = AMP_Options_Manager::get_option( Option::READER_THEME );
281
  if ( ! $reader_theme_slug ) {
282
  return null;
src/Services.php CHANGED
@@ -7,6 +7,8 @@
7
 
8
  namespace AmpProject\AmpWP;
9
 
 
 
10
  use AmpProject\AmpWP\Infrastructure\Service;
11
  use AmpProject\AmpWP\Infrastructure\ServiceContainer;
12
 
@@ -22,6 +24,27 @@ use AmpProject\AmpWP\Infrastructure\ServiceContainer;
22
  */
23
  final class Services {
24
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25
  /**
26
  * Get a particular service out of the service container.
27
  *
@@ -32,18 +55,42 @@ final class Services {
32
  return self::get_container()->get( $service );
33
  }
34
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
  /**
36
  * Get an instance of the service container.
37
  *
38
- * @return ServiceContainer
39
  */
40
  public static function get_container() {
41
- static $container = null;
 
 
 
 
 
42
 
43
- if ( null === $container ) {
44
- $container = AmpWpPluginFactory::create()->get_container();
 
 
 
 
 
 
45
  }
46
 
47
- return $container;
48
  }
49
  }
7
 
8
  namespace AmpProject\AmpWP;
9
 
10
+ use AmpProject\AmpWP\Infrastructure\Injector;
11
+ use AmpProject\AmpWP\Infrastructure\Plugin;
12
  use AmpProject\AmpWP\Infrastructure\Service;
13
  use AmpProject\AmpWP\Infrastructure\ServiceContainer;
14
 
24
  */
25
  final class Services {
26
 
27
+ /**
28
+ * Plugin object instance.
29
+ *
30
+ * @var Plugin
31
+ */
32
+ private static $plugin;
33
+
34
+ /**
35
+ * Service container object instance.
36
+ *
37
+ * @var ServiceContainer
38
+ */
39
+ private static $container;
40
+
41
+ /**
42
+ * Dependency injector object instance.
43
+ *
44
+ * @var Injector
45
+ */
46
+ private static $injector;
47
+
48
  /**
49
  * Get a particular service out of the service container.
50
  *
55
  return self::get_container()->get( $service );
56
  }
57
 
58
+ /**
59
+ * Get an instance of the plugin.
60
+ *
61
+ * @return Plugin Plugin object instance.
62
+ */
63
+ public static function get_plugin() {
64
+ if ( null === self::$plugin ) {
65
+ self::$plugin = AmpWpPluginFactory::create();
66
+ }
67
+
68
+ return self::$plugin;
69
+ }
70
+
71
  /**
72
  * Get an instance of the service container.
73
  *
74
+ * @return ServiceContainer Service container object instance.
75
  */
76
  public static function get_container() {
77
+ if ( null === self::$container ) {
78
+ self::$container = self::get_plugin()->get_container();
79
+ }
80
+
81
+ return self::$container;
82
+ }
83
 
84
+ /**
85
+ * Get an instance of the dependency injector.
86
+ *
87
+ * @return Injector Dependency injector object instance.
88
+ */
89
+ public static function get_injector() {
90
+ if ( null === self::$injector ) {
91
+ self::$injector = self::get_container()->get( 'injector' );
92
  }
93
 
94
+ return self::$injector;
95
  }
96
  }
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
- return ComposerAutoloaderInitd061898e66f01c516f51a6aa8955d0b7::getLoader();
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInit077d68b2d63f451581ca59f0f5e291a0::getLoader();
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInitd061898e66f01c516f51a6aa8955d0b7
6
  {
7
  private static $loader;
8
 
@@ -22,15 +22,15 @@ class ComposerAutoloaderInitd061898e66f01c516f51a6aa8955d0b7
22
  return self::$loader;
23
  }
24
 
25
- spl_autoload_register(array('ComposerAutoloaderInitd061898e66f01c516f51a6aa8955d0b7', 'loadClassLoader'), true, true);
26
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
27
- spl_autoload_unregister(array('ComposerAutoloaderInitd061898e66f01c516f51a6aa8955d0b7', '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\ComposerStaticInitd061898e66f01c516f51a6aa8955d0b7::getInitializer($loader));
34
  } else {
35
  $map = require __DIR__ . '/autoload_namespaces.php';
36
  foreach ($map as $namespace => $path) {
@@ -51,19 +51,19 @@ class ComposerAutoloaderInitd061898e66f01c516f51a6aa8955d0b7
51
  $loader->register(true);
52
 
53
  if ($useStaticLoader) {
54
- $includeFiles = Composer\Autoload\ComposerStaticInitd061898e66f01c516f51a6aa8955d0b7::$files;
55
  } else {
56
  $includeFiles = require __DIR__ . '/autoload_files.php';
57
  }
58
  foreach ($includeFiles as $fileIdentifier => $file) {
59
- composerRequired061898e66f01c516f51a6aa8955d0b7($fileIdentifier, $file);
60
  }
61
 
62
  return $loader;
63
  }
64
  }
65
 
66
- function composerRequired061898e66f01c516f51a6aa8955d0b7($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 ComposerAutoloaderInit077d68b2d63f451581ca59f0f5e291a0
6
  {
7
  private static $loader;
8
 
22
  return self::$loader;
23
  }
24
 
25
+ spl_autoload_register(array('ComposerAutoloaderInit077d68b2d63f451581ca59f0f5e291a0', 'loadClassLoader'), true, true);
26
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
27
+ spl_autoload_unregister(array('ComposerAutoloaderInit077d68b2d63f451581ca59f0f5e291a0', '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\ComposerStaticInit077d68b2d63f451581ca59f0f5e291a0::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\ComposerStaticInit077d68b2d63f451581ca59f0f5e291a0::$files;
55
  } else {
56
  $includeFiles = require __DIR__ . '/autoload_files.php';
57
  }
58
  foreach ($includeFiles as $fileIdentifier => $file) {
59
+ composerRequire077d68b2d63f451581ca59f0f5e291a0($fileIdentifier, $file);
60
  }
61
 
62
  return $loader;
63
  }
64
  }
65
 
66
+ function composerRequire077d68b2d63f451581ca59f0f5e291a0($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 ComposerStaticInitd061898e66f01c516f51a6aa8955d0b7
8
  {
9
  public static $files = array (
10
  '6f5653f9af3eab04254ad2c7f20515c8' => __DIR__ . '/../..' . '/back-compat/back-compat.php',
@@ -338,9 +338,9 @@ class ComposerStaticInitd061898e66f01c516f51a6aa8955d0b7
338
  public static function getInitializer(ClassLoader $loader)
339
  {
340
  return \Closure::bind(function () use ($loader) {
341
- $loader->prefixLengthsPsr4 = ComposerStaticInitd061898e66f01c516f51a6aa8955d0b7::$prefixLengthsPsr4;
342
- $loader->prefixDirsPsr4 = ComposerStaticInitd061898e66f01c516f51a6aa8955d0b7::$prefixDirsPsr4;
343
- $loader->classMap = ComposerStaticInitd061898e66f01c516f51a6aa8955d0b7::$classMap;
344
 
345
  }, null, ClassLoader::class);
346
  }
4
 
5
  namespace Composer\Autoload;
6
 
7
+ class ComposerStaticInit077d68b2d63f451581ca59f0f5e291a0
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 = ComposerStaticInit077d68b2d63f451581ca59f0f5e291a0::$prefixLengthsPsr4;
342
+ $loader->prefixDirsPsr4 = ComposerStaticInit077d68b2d63f451581ca59f0f5e291a0::$prefixDirsPsr4;
343
+ $loader->classMap = ComposerStaticInit077d68b2d63f451581ca59f0f5e291a0::$classMap;
344
 
345
  }, null, ClassLoader::class);
346
  }