Poll, Survey, Quiz, Slideshow, Form, Story & Landing Page - Version 19.6.39

Version Description

  • fix WordPress 5.5 compatibility issues
Download this release

Release Info

Developer kucaahbe
Plugin Icon 128x128 Poll, Survey, Quiz, Slideshow, Form, Story & Landing Page
Version 19.6.39
Comparing to
See all releases

Code changes from version 19.6.38 to 19.6.39

admin/content-popup-gutenberg-template.html.php CHANGED
@@ -229,7 +229,7 @@ function opinionstage_create_new_href() {
229
  </template>
230
  <script>
231
  jQuery(document).ready(function ($) {
232
- $('.filter__itm').live('click', function(e) {
233
  var text = $(this).text();
234
  $("button#dropbtn span").text(text);
235
 
@@ -239,11 +239,11 @@ function opinionstage_create_new_href() {
239
  });
240
  });
241
 
242
- jQuery(document).live('click', function(e) {
243
  $('.dropdown_items .dropdown-content').attr('style', 'display: none !important');
244
  });
245
 
246
- $('div#show-templates').live('click', function(e) {
247
  var inputs = $(".filter__itm");
248
  for(var i = 0; i < inputs.length; i++){
249
  if($(inputs[i]).text() == 'story article'){
229
  </template>
230
  <script>
231
  jQuery(document).ready(function ($) {
232
+ $('.filter__itm').on('click', null, function(e) {
233
  var text = $(this).text();
234
  $("button#dropbtn span").text(text);
235
 
239
  });
240
  });
241
 
242
+ jQuery(document).on('click', null, function(e) {
243
  $('.dropdown_items .dropdown-content').attr('style', 'display: none !important');
244
  });
245
 
246
+ $('div#show-templates').on('click', null, function(e) {
247
  var inputs = $(".filter__itm");
248
  for(var i = 0; i < inputs.length; i++){
249
  if($(inputs[i]).text() == 'story article'){
admin/content-popup-template.html.php CHANGED
@@ -211,7 +211,7 @@ function opinionstage_create_new_href() {
211
  </template>
212
  <script>
213
  jQuery(document).ready(function ($) {
214
- $('.filter__itm').live('click', function(e) {
215
  var text = $(this).text();
216
  $("button#dropbtn span").text(text);
217
 
@@ -224,11 +224,11 @@ function opinionstage_create_new_href() {
224
  });
225
  },3000);
226
 
227
- jQuery(document).live('click', function(e) {
228
  $('.dropdown_items .dropdown-content').attr('style', 'display: none !important');
229
  });
230
 
231
- $('div#show-templates').live('click', function(e) {
232
  var inputs = $(".filter__itm");
233
  for(var i = 0; i < inputs.length; i++){
234
  if($(inputs[i]).text() == 'story article'){
211
  </template>
212
  <script>
213
  jQuery(document).ready(function ($) {
214
+ $('.filter__itm').on('click', null, function(e) {
215
  var text = $(this).text();
216
  $("button#dropbtn span").text(text);
217
 
224
  });
225
  },3000);
226
 
227
+ jQuery(document).on('click', null, function(e) {
228
  $('.dropdown_items .dropdown-content').attr('style', 'display: none !important');
229
  });
230
 
231
+ $('div#show-templates').on('click', null, function(e) {
232
  var inputs = $(".filter__itm");
233
  for(var i = 0; i < inputs.length; i++){
234
  if($(inputs[i]).text() == 'story article'){
admin/views/view_my_items.php CHANGED
@@ -211,7 +211,7 @@ defined( 'ABSPATH' ) or die(1); ?>
211
  $("#loadMore").hide(500);
212
  }
213
  });
214
- $('#showLess').live( 'click', function () {
215
  x=(x-0<0) ? 10 : x-0;
216
  if (item == 'all') {
217
  $('table#check tbody#count').not(':lt('+x+')').hide();
211
  $("#loadMore").hide(500);
212
  }
213
  });
214
+ $('#showLess').on('click', null, function () {
215
  x=(x-0<0) ? 10 : x-0;
216
  if (item == 'all') {
217
  $('table#check tbody#count').not(':lt('+x+')').hide();
gutenberg/form/dist/blocks.build.js CHANGED
@@ -1 +1 @@
1
- !function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var n={};e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=0)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});n(1)},function(t,e,n){"use strict";function r(t){return function(){var e=t.apply(this,arguments);return new Promise(function(t,n){function r(o,i){try{var a=e[o](i),s=a.value}catch(t){return void n(t)}if(!a.done)return Promise.resolve(s).then(function(t){r("next",t)},function(t){r("throw",t)});t(s)}return r("next")})}}var o=n(2),i=n.n(o),a=n(5),s=(n.n(a),n(6)),c=(n.n(s),wp.i18n.__),l=wp.blocks.registerBlockType,u=wp.components,m=(u.SelectControl,u.TextControl,wp.editor.RichText,!1);l("opinion-stage/block-os-form",{title:c("Form"),icon:"editor-justify",category:"opinion-stage",keywords:[c("Opinion Stage Form"),c("Opinion Stage Form")],attributes:{embedUrl:{source:"attribute",attribute:"data-test-url",selector:"div[data-test-url]"},lockEmbed:{source:"attribute",attribute:"data-lock-embed",selector:"div[data-lock-embed]"},buttonText:{source:"attribute",attribute:"data-button-text",selector:"div[data-button-text]"},insertItemImage:{source:"attribute",attribute:"data-image-url",selector:"div[data-image-url]"},insertItemOsTitle:{source:"attribute",attribute:"data-title-url",selector:"div[data-title-url]"},insertItemOsView:{source:"attribute",attribute:"data-view-url",selector:"div[data-view-url]"},insertItemOsEdit:{source:"attribute",attribute:"data-edit-url",selector:"div[data-edit-url]"},insertItemOsStatistics:{source:"attribute",attribute:"data-statistics-url",selector:"div[data-statistics-url]"}},edit:function(t){var e=t.attributes,n=e.embedUrl,o=(e.lockEmbed,e.buttonText),a=e.insertItemImage,s=e.insertItemOsTitle,c=e.insertItemOsView,l=e.insertItemOsEdit,u=e.insertItemOsStatistics,p=(t.setAttributes,osGutenData.callbackUrlOs),f=p,d=(osGutenData.getActionUrlOS,osGutenData.getLogoImageLink),h=function(e){window.verifyOSInsert=function(e){var n=this;t.setAttributes({embedUrl:e,buttonText:"Change"});var a=osGutenData.OswpPluginVersion,s=osGutenData.OswpClientToken,c=osGutenData.OswpFetchDataUrl+"?type=form&page=1&per_page=99";fetch(c,{method:"GET",headers:{Accept:"application/vnd.api+json","Content-Type":"application/vnd.api+json","OSWP-Plugin-Version":a,"OSWP-Client-Token":s}}).then(function(){var e=r(i.a.mark(function e(r){var a;return i.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.json();case 2:a=e.sent,a=a.data,m=a,t.setAttributes({buttonText:o});case 6:case"end":return e.stop()}},e,n)}));return function(t){return e.apply(this,arguments)}}()).catch(function(t){console.log("ERROR: "+t.message)})}},g=function(e){t.setAttributes({embedUrl:"",buttonText:"Embed",lockEmbed:!1,insertItemImage:!1,insertItemOsTitle:!1,insertItemOsView:!1,insertItemOsEdit:!1,insertItemOsStatistics:!1})},v=function(t){window.location.replace(f)},b=osGutenData.onCreateButtonClickOs+"?w_type=contact_form&amp;utm_source=wordpress&amp;utm_campaign=WPMainPI&amp;utm_medium=link&amp;o=wp35e8",w=function(t){window.open(b,"_blank").focus()};if(""==osGutenData.isOsConnected)return wp.element.createElement("div",{className:t.className},wp.element.createElement("div",{className:"os-form-wrapper components-placeholder"},wp.element.createElement("p",{className:"components-heading"},wp.element.createElement("img",{src:d,alt:""})),wp.element.createElement("p",{className:"components-heading"},"Please connect WordPress to Opinion Stage to start adding forms"),wp.element.createElement("button",{className:"components-button is-button is-default is-block is-primary",onClick:v},"Connect")),wp.element.createElement("div",null));if(jQuery(document).ready(function(){jQuery("span#oswpLauncherContentPopupform").live("click",function(t){t.preventDefault(),setTimeout(function(){jQuery(".editor-post-save-draft").trigger("click")},500);var e=jQuery(this).attr("data-os-block");jQuery("button#dropbtn span").text(e);for(var n=jQuery(".filter__itm"),r=0;r<n.length;r++){if(jQuery(n[r]).text()==e){setTimeout(function(){jQuery(n[r]).trigger("click")},1e3),setTimeout(function(){jQuery(".progress_message").css("display","none"),jQuery(".content__list").css("display","block")},2500),jQuery("button.content__links-itm").live("click",function(t){jQuery(".tingle-modal.opinionstage-content-popup").hide(),jQuery(".tingle-modal.opinionstage-content-popup.tingle-modal--visible").hide()});break}jQuery(".progress_message").css("display","block"),jQuery(".content__list").css("display","none")}})}),0!=m)for(var y=0;y<m.length;y++){var E=function(t){var e=document.createElement("a");return e.href=t,e}(m[y].attributes["landing-page-url"]),x=E.pathname;if(n==x){t.setAttributes({lockEmbed:!0,buttonText:"Change"}),t.setAttributes({insertItemImage:m[y].attributes["image-url"]}),t.setAttributes({insertItemOsTitle:m[y].attributes.title}),t.setAttributes({insertItemOsView:m[y].attributes["landing-page-url"]}),t.setAttributes({insertItemOsEdit:m[y].attributes["edit-url"]}),t.setAttributes({insertItemOsStatistics:m[y].attributes["stats-url"]});break}}var k=wp.element.createElement("div",{className:"os-form-wrapper components-placeholder"},wp.element.createElement("p",{className:"components-heading"},wp.element.createElement("img",{src:d,alt:""})),wp.element.createElement("span",{id:"oswpLauncherContentPopupform",className:"components-button is-button is-default is-block is-primary","data-opinionstage-content-launch":!0,"data-os-block":"form",onClick:h},"Select a Form"),wp.element.createElement("input",{type:"button",value:"Create a New form",className:"components-button is-button is-default is-block is-primary",onClick:w}),wp.element.createElement("span",null));return""!=n&&n?"Embed"==o||"Change"==o&&(k=wp.element.createElement("div",{className:"os-form-wrapper components-placeholder"},wp.element.createElement("p",{className:"components-heading"},wp.element.createElement("img",{src:d,alt:""})),wp.element.createElement("div",{className:"components-preview__block"},wp.element.createElement("div",{className:"components-preview__leftBlockImage"},wp.element.createElement("img",{src:a,alt:s,className:"image"}),wp.element.createElement("div",{className:"overlay"},wp.element.createElement("div",{className:"text"},wp.element.createElement("a",{href:c,target:"_blank"}," View "),wp.element.createElement("a",{href:l,target:"_blank"}," Edit "),wp.element.createElement("a",{href:u,target:"_blank"}," Statistics "),wp.element.createElement("input",{type:"button",value:o,className:"components-button is-button is-default is-large left-align",onClick:g})))),wp.element.createElement("div",{className:"components-preview__rightBlockContent"},wp.element.createElement("div",{className:"components-placeholder__label"},"Form: ",s))),wp.element.createElement("span",null))):""==n||"undefined"===jQuery.type(n)||t.setAttributes({buttonText:"Embed"}),wp.element.createElement("div",{className:t.className},k,wp.element.createElement("span",null))},save:function(t){var e=t.attributes,n=e.embedUrl,r=e.lockEmbed,o=e.buttonText,i=e.insertItemImage,a=e.insertItemOsTitle,s=e.insertItemOsView,c=e.insertItemOsEdit,l=e.insertItemOsStatistics;return wp.element.createElement("div",{class:"os-form-wrapper","data-type":"form","data-image-url":i,"data-title-url":a,"data-view-url":s,"data-statistics-url":l,"data-edit-url":c,"data-test-url":n,"data-lock-embed":r,"data-button-text":o},'[os-widget path="',n,'"]',wp.element.createElement("span",null))}})},function(t,e,n){t.exports=n(3)},function(t,e,n){var r=function(){return this}()||Function("return this")(),o=r.regeneratorRuntime&&Object.getOwnPropertyNames(r).indexOf("regeneratorRuntime")>=0,i=o&&r.regeneratorRuntime;if(r.regeneratorRuntime=void 0,t.exports=n(4),o)r.regeneratorRuntime=i;else try{delete r.regeneratorRuntime}catch(t){r.regeneratorRuntime=void 0}},function(t,e){!function(e){"use strict";function n(t,e,n,r){var i=e&&e.prototype instanceof o?e:o,a=Object.create(i.prototype),s=new f(r||[]);return a._invoke=l(t,n,s),a}function r(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}function o(){}function i(){}function a(){}function s(t){["next","throw","return"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function c(t){function e(n,o,i,a){var s=r(t[n],t,o);if("throw"!==s.type){var c=s.arg,l=c.value;return l&&"object"===typeof l&&b.call(l,"__await")?Promise.resolve(l.__await).then(function(t){e("next",t,i,a)},function(t){e("throw",t,i,a)}):Promise.resolve(l).then(function(t){c.value=t,i(c)},a)}a(s.arg)}function n(t,n){function r(){return new Promise(function(r,o){e(t,n,r,o)})}return o=o?o.then(r,r):r()}var o;this._invoke=n}function l(t,e,n){var o=_;return function(i,a){if(o===L)throw new Error("Generator is already running");if(o===N){if("throw"===i)throw a;return h()}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var c=u(s,n);if(c){if(c===T)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===_)throw o=N,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=L;var l=r(t,e,n);if("normal"===l.type){if(o=n.done?N:I,l.arg===T)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=N,n.method="throw",n.arg=l.arg)}}}function u(t,e){var n=t.iterator[e.method];if(n===g){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=g,u(t,e),"throw"===e.method))return T;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return T}var o=r(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,T;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=g),e.delegate=null,T):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,T)}function m(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function p(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function f(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(m,this),this.reset(!0)}function d(t){if(t){var e=t[y];if(e)return e.call(t);if("function"===typeof t.next)return t;if(!isNaN(t.length)){var n=-1,r=function e(){for(;++n<t.length;)if(b.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=g,e.done=!0,e};return r.next=r}}return{next:h}}function h(){return{value:g,done:!0}}var g,v=Object.prototype,b=v.hasOwnProperty,w="function"===typeof Symbol?Symbol:{},y=w.iterator||"@@iterator",E=w.asyncIterator||"@@asyncIterator",x=w.toStringTag||"@@toStringTag",k="object"===typeof t,O=e.regeneratorRuntime;if(O)return void(k&&(t.exports=O));O=e.regeneratorRuntime=k?t.exports:{},O.wrap=n;var _="suspendedStart",I="suspendedYield",L="executing",N="completed",T={},P={};P[y]=function(){return this};var S=Object.getPrototypeOf,j=S&&S(S(d([])));j&&j!==v&&b.call(j,y)&&(P=j);var C=a.prototype=o.prototype=Object.create(P);i.prototype=C.constructor=a,a.constructor=i,a[x]=i.displayName="GeneratorFunction",O.isGeneratorFunction=function(t){var e="function"===typeof t&&t.constructor;return!!e&&(e===i||"GeneratorFunction"===(e.displayName||e.name))},O.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,a):(t.__proto__=a,x in t||(t[x]="GeneratorFunction")),t.prototype=Object.create(C),t},O.awrap=function(t){return{__await:t}},s(c.prototype),c.prototype[E]=function(){return this},O.AsyncIterator=c,O.async=function(t,e,r,o){var i=new c(n(t,e,r,o));return O.isGeneratorFunction(e)?i:i.next().then(function(t){return t.done?t.value:i.next()})},s(C),C[x]="Generator",C[y]=function(){return this},C.toString=function(){return"[object Generator]"},O.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},O.values=d,f.prototype={constructor:f,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=g,this.done=!1,this.delegate=null,this.method="next",this.arg=g,this.tryEntries.forEach(p),!t)for(var e in this)"t"===e.charAt(0)&&b.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=g)},stop:function(){this.done=!0;var t=this.tryEntries[0],e=t.completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){function e(e,r){return i.type="throw",i.arg=t,n.next=e,r&&(n.method="next",n.arg=g),!!r}if(this.done)throw t;for(var n=this,r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r],i=o.completion;if("root"===o.tryLoc)return e("end");if(o.tryLoc<=this.prev){var a=b.call(o,"catchLoc"),s=b.call(o,"finallyLoc");if(a&&s){if(this.prev<o.catchLoc)return e(o.catchLoc,!0);if(this.prev<o.finallyLoc)return e(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return e(o.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return e(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&b.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,T):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),T},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),p(n),T}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;p(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:d(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=g),T}}}(function(){return this}()||Function("return this")())},function(t,e){},function(t,e){}]);
1
+ !function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var n={};e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=0)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});n(1)},function(t,e,n){"use strict";function r(t){return function(){var e=t.apply(this,arguments);return new Promise(function(t,n){function r(o,i){try{var a=e[o](i),s=a.value}catch(t){return void n(t)}if(!a.done)return Promise.resolve(s).then(function(t){r("next",t)},function(t){r("throw",t)});t(s)}return r("next")})}}var o=n(2),i=n.n(o),a=n(5),s=(n.n(a),n(6)),c=(n.n(s),wp.i18n.__),l=wp.blocks.registerBlockType,u=wp.components,m=(u.SelectControl,u.TextControl,wp.editor.RichText,!1);l("opinion-stage/block-os-form",{title:c("Form"),icon:"editor-justify",category:"opinion-stage",keywords:[c("Opinion Stage Form"),c("Opinion Stage Form")],attributes:{embedUrl:{source:"attribute",attribute:"data-test-url",selector:"div[data-test-url]"},lockEmbed:{source:"attribute",attribute:"data-lock-embed",selector:"div[data-lock-embed]"},buttonText:{source:"attribute",attribute:"data-button-text",selector:"div[data-button-text]"},insertItemImage:{source:"attribute",attribute:"data-image-url",selector:"div[data-image-url]"},insertItemOsTitle:{source:"attribute",attribute:"data-title-url",selector:"div[data-title-url]"},insertItemOsView:{source:"attribute",attribute:"data-view-url",selector:"div[data-view-url]"},insertItemOsEdit:{source:"attribute",attribute:"data-edit-url",selector:"div[data-edit-url]"},insertItemOsStatistics:{source:"attribute",attribute:"data-statistics-url",selector:"div[data-statistics-url]"}},edit:function(t){var e=t.attributes,n=e.embedUrl,o=(e.lockEmbed,e.buttonText),a=e.insertItemImage,s=e.insertItemOsTitle,c=e.insertItemOsView,l=e.insertItemOsEdit,u=e.insertItemOsStatistics,p=(t.setAttributes,osGutenData.callbackUrlOs),f=p,d=(osGutenData.getActionUrlOS,osGutenData.getLogoImageLink),h=function(e){window.verifyOSInsert=function(e){var n=this;t.setAttributes({embedUrl:e,buttonText:"Change"});var a=osGutenData.OswpPluginVersion,s=osGutenData.OswpClientToken,c=osGutenData.OswpFetchDataUrl+"?type=form&page=1&per_page=99";fetch(c,{method:"GET",headers:{Accept:"application/vnd.api+json","Content-Type":"application/vnd.api+json","OSWP-Plugin-Version":a,"OSWP-Client-Token":s}}).then(function(){var e=r(i.a.mark(function e(r){var a;return i.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.json();case 2:a=e.sent,a=a.data,m=a,t.setAttributes({buttonText:o});case 6:case"end":return e.stop()}},e,n)}));return function(t){return e.apply(this,arguments)}}()).catch(function(t){console.log("ERROR: "+t.message)})}},g=function(e){t.setAttributes({embedUrl:"",buttonText:"Embed",lockEmbed:!1,insertItemImage:!1,insertItemOsTitle:!1,insertItemOsView:!1,insertItemOsEdit:!1,insertItemOsStatistics:!1})},v=function(t){window.location.replace(f)},b=osGutenData.onCreateButtonClickOs+"?w_type=contact_form&amp;utm_source=wordpress&amp;utm_campaign=WPMainPI&amp;utm_medium=link&amp;o=wp35e8",w=function(t){window.open(b,"_blank").focus()};if(""==osGutenData.isOsConnected)return wp.element.createElement("div",{className:t.className},wp.element.createElement("div",{className:"os-form-wrapper components-placeholder"},wp.element.createElement("p",{className:"components-heading"},wp.element.createElement("img",{src:d,alt:""})),wp.element.createElement("p",{className:"components-heading"},"Please connect WordPress to Opinion Stage to start adding forms"),wp.element.createElement("button",{className:"components-button is-button is-default is-block is-primary",onClick:v},"Connect")),wp.element.createElement("div",null));if(jQuery(document).ready(function(){jQuery("span#oswpLauncherContentPopupform").on("click",null,function(t){t.preventDefault(),setTimeout(function(){jQuery(".editor-post-save-draft").trigger("click")},500);var e=jQuery(this).attr("data-os-block");jQuery("button#dropbtn span").text(e);for(var n=jQuery(".filter__itm"),r=0;r<n.length;r++){if(jQuery(n[r]).text()==e){setTimeout(function(){jQuery(n[r]).trigger("click")},1e3),setTimeout(function(){jQuery(".progress_message").css("display","none"),jQuery(".content__list").css("display","block")},2500),jQuery("button.content__links-itm").on("click",null,function(t){jQuery(".tingle-modal.opinionstage-content-popup").hide(),jQuery(".tingle-modal.opinionstage-content-popup.tingle-modal--visible").hide()});break}jQuery(".progress_message").css("display","block"),jQuery(".content__list").css("display","none")}})}),0!=m)for(var y=0;y<m.length;y++){var E=function(t){var e=document.createElement("a");return e.href=t,e}(m[y].attributes["landing-page-url"]),x=E.pathname;if(n==x){t.setAttributes({lockEmbed:!0,buttonText:"Change"}),t.setAttributes({insertItemImage:m[y].attributes["image-url"]}),t.setAttributes({insertItemOsTitle:m[y].attributes.title}),t.setAttributes({insertItemOsView:m[y].attributes["landing-page-url"]}),t.setAttributes({insertItemOsEdit:m[y].attributes["edit-url"]}),t.setAttributes({insertItemOsStatistics:m[y].attributes["stats-url"]});break}}var k=wp.element.createElement("div",{className:"os-form-wrapper components-placeholder"},wp.element.createElement("p",{className:"components-heading"},wp.element.createElement("img",{src:d,alt:""})),wp.element.createElement("span",{id:"oswpLauncherContentPopupform",className:"components-button is-button is-default is-block is-primary","data-opinionstage-content-launch":!0,"data-os-block":"form",onClick:h},"Select a Form"),wp.element.createElement("input",{type:"button",value:"Create a New form",className:"components-button is-button is-default is-block is-primary",onClick:w}),wp.element.createElement("span",null));return""!=n&&n?"Embed"==o||"Change"==o&&(k=wp.element.createElement("div",{className:"os-form-wrapper components-placeholder"},wp.element.createElement("p",{className:"components-heading"},wp.element.createElement("img",{src:d,alt:""})),wp.element.createElement("div",{className:"components-preview__block"},wp.element.createElement("div",{className:"components-preview__leftBlockImage"},wp.element.createElement("img",{src:a,alt:s,className:"image"}),wp.element.createElement("div",{className:"overlay"},wp.element.createElement("div",{className:"text"},wp.element.createElement("a",{href:c,target:"_blank"}," View "),wp.element.createElement("a",{href:l,target:"_blank"}," Edit "),wp.element.createElement("a",{href:u,target:"_blank"}," Statistics "),wp.element.createElement("input",{type:"button",value:o,className:"components-button is-button is-default is-large left-align",onClick:g})))),wp.element.createElement("div",{className:"components-preview__rightBlockContent"},wp.element.createElement("div",{className:"components-placeholder__label"},"Form: ",s))),wp.element.createElement("span",null))):""==n||"undefined"===jQuery.type(n)||t.setAttributes({buttonText:"Embed"}),wp.element.createElement("div",{className:t.className},k,wp.element.createElement("span",null))},save:function(t){var e=t.attributes,n=e.embedUrl,r=e.lockEmbed,o=e.buttonText,i=e.insertItemImage,a=e.insertItemOsTitle,s=e.insertItemOsView,c=e.insertItemOsEdit,l=e.insertItemOsStatistics;return wp.element.createElement("div",{class:"os-form-wrapper","data-type":"form","data-image-url":i,"data-title-url":a,"data-view-url":s,"data-statistics-url":l,"data-edit-url":c,"data-test-url":n,"data-lock-embed":r,"data-button-text":o},'[os-widget path="',n,'"]',wp.element.createElement("span",null))}})},function(t,e,n){t.exports=n(3)},function(t,e,n){var r=function(){return this}()||Function("return this")(),o=r.regeneratorRuntime&&Object.getOwnPropertyNames(r).indexOf("regeneratorRuntime")>=0,i=o&&r.regeneratorRuntime;if(r.regeneratorRuntime=void 0,t.exports=n(4),o)r.regeneratorRuntime=i;else try{delete r.regeneratorRuntime}catch(t){r.regeneratorRuntime=void 0}},function(t,e){!function(e){"use strict";function n(t,e,n,r){var i=e&&e.prototype instanceof o?e:o,a=Object.create(i.prototype),s=new f(r||[]);return a._invoke=l(t,n,s),a}function r(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}function o(){}function i(){}function a(){}function s(t){["next","throw","return"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function c(t){function e(n,o,i,a){var s=r(t[n],t,o);if("throw"!==s.type){var c=s.arg,l=c.value;return l&&"object"===typeof l&&b.call(l,"__await")?Promise.resolve(l.__await).then(function(t){e("next",t,i,a)},function(t){e("throw",t,i,a)}):Promise.resolve(l).then(function(t){c.value=t,i(c)},a)}a(s.arg)}function n(t,n){function r(){return new Promise(function(r,o){e(t,n,r,o)})}return o=o?o.then(r,r):r()}var o;this._invoke=n}function l(t,e,n){var o=_;return function(i,a){if(o===L)throw new Error("Generator is already running");if(o===N){if("throw"===i)throw a;return h()}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var c=u(s,n);if(c){if(c===T)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===_)throw o=N,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=L;var l=r(t,e,n);if("normal"===l.type){if(o=n.done?N:I,l.arg===T)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=N,n.method="throw",n.arg=l.arg)}}}function u(t,e){var n=t.iterator[e.method];if(n===g){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=g,u(t,e),"throw"===e.method))return T;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return T}var o=r(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,T;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=g),e.delegate=null,T):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,T)}function m(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function p(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function f(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(m,this),this.reset(!0)}function d(t){if(t){var e=t[y];if(e)return e.call(t);if("function"===typeof t.next)return t;if(!isNaN(t.length)){var n=-1,r=function e(){for(;++n<t.length;)if(b.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=g,e.done=!0,e};return r.next=r}}return{next:h}}function h(){return{value:g,done:!0}}var g,v=Object.prototype,b=v.hasOwnProperty,w="function"===typeof Symbol?Symbol:{},y=w.iterator||"@@iterator",E=w.asyncIterator||"@@asyncIterator",x=w.toStringTag||"@@toStringTag",k="object"===typeof t,O=e.regeneratorRuntime;if(O)return void(k&&(t.exports=O));O=e.regeneratorRuntime=k?t.exports:{},O.wrap=n;var _="suspendedStart",I="suspendedYield",L="executing",N="completed",T={},P={};P[y]=function(){return this};var S=Object.getPrototypeOf,j=S&&S(S(d([])));j&&j!==v&&b.call(j,y)&&(P=j);var C=a.prototype=o.prototype=Object.create(P);i.prototype=C.constructor=a,a.constructor=i,a[x]=i.displayName="GeneratorFunction",O.isGeneratorFunction=function(t){var e="function"===typeof t&&t.constructor;return!!e&&(e===i||"GeneratorFunction"===(e.displayName||e.name))},O.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,a):(t.__proto__=a,x in t||(t[x]="GeneratorFunction")),t.prototype=Object.create(C),t},O.awrap=function(t){return{__await:t}},s(c.prototype),c.prototype[E]=function(){return this},O.AsyncIterator=c,O.async=function(t,e,r,o){var i=new c(n(t,e,r,o));return O.isGeneratorFunction(e)?i:i.next().then(function(t){return t.done?t.value:i.next()})},s(C),C[x]="Generator",C[y]=function(){return this},C.toString=function(){return"[object Generator]"},O.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},O.values=d,f.prototype={constructor:f,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=g,this.done=!1,this.delegate=null,this.method="next",this.arg=g,this.tryEntries.forEach(p),!t)for(var e in this)"t"===e.charAt(0)&&b.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=g)},stop:function(){this.done=!0;var t=this.tryEntries[0],e=t.completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){function e(e,r){return i.type="throw",i.arg=t,n.next=e,r&&(n.method="next",n.arg=g),!!r}if(this.done)throw t;for(var n=this,r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r],i=o.completion;if("root"===o.tryLoc)return e("end");if(o.tryLoc<=this.prev){var a=b.call(o,"catchLoc"),s=b.call(o,"finallyLoc");if(a&&s){if(this.prev<o.catchLoc)return e(o.catchLoc,!0);if(this.prev<o.finallyLoc)return e(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return e(o.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return e(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&b.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,T):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),T},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),p(n),T}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;p(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:d(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=g),T}}}(function(){return this}()||Function("return this")())},function(t,e){},function(t,e){}]);
gutenberg/personality/dist/blocks.build.js CHANGED
@@ -1 +1 @@
1
- !function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var n={};e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=0)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});n(1)},function(t,e,n){"use strict";function r(t){return function(){var e=t.apply(this,arguments);return new Promise(function(t,n){function r(i,o){try{var a=e[i](o),s=a.value}catch(t){return void n(t)}if(!a.done)return Promise.resolve(s).then(function(t){r("next",t)},function(t){r("throw",t)});t(s)}return r("next")})}}var i=n(2),o=n.n(i),a=n(5),s=(n.n(a),n(6)),c=(n.n(s),wp.i18n.__),l=wp.blocks.registerBlockType,u=wp.components,p=(u.SelectControl,u.TextControl,wp.editor.RichText,!1);l("opinion-stage/block-os-personality",{title:c("Personality Quiz"),icon:"smiley",category:"opinion-stage",keywords:[c("Opinion Stage Personality Quiz"),c("Opinion Stage Personality")],attributes:{embedUrl:{source:"attribute",attribute:"data-test-url",selector:"div[data-test-url]"},lockEmbed:{source:"attribute",attribute:"data-lock-embed",selector:"div[data-lock-embed]"},buttonText:{source:"attribute",attribute:"data-button-text",selector:"div[data-button-text]"},insertItemImage:{source:"attribute",attribute:"data-image-url",selector:"div[data-image-url]"},insertItemOsTitle:{source:"attribute",attribute:"data-title-url",selector:"div[data-title-url]"},insertItemOsView:{source:"attribute",attribute:"data-view-url",selector:"div[data-view-url]"},insertItemOsEdit:{source:"attribute",attribute:"data-edit-url",selector:"div[data-edit-url]"},insertItemOsStatistics:{source:"attribute",attribute:"data-statistics-url",selector:"div[data-statistics-url]"}},edit:function(t){var e=t.attributes,n=e.embedUrl,i=(e.lockEmbed,e.buttonText),a=e.insertItemImage,s=e.insertItemOsTitle,c=e.insertItemOsView,l=e.insertItemOsEdit,u=e.insertItemOsStatistics,m=(t.setAttributes,osGutenData.callbackUrlOs),d=m,f=(osGutenData.getActionUrlOS,osGutenData.getLogoImageLink),h=function(e){window.verifyOSInsert=function(e){var n=this;t.setAttributes({embedUrl:e,buttonText:"Change"});var a=osGutenData.OswpPluginVersion,s=osGutenData.OswpClientToken,c=osGutenData.OswpFetchDataUrl+"?type=outcome&page=1&per_page=99";fetch(c,{method:"GET",headers:{Accept:"application/vnd.api+json","Content-Type":"application/vnd.api+json","OSWP-Plugin-Version":a,"OSWP-Client-Token":s}}).then(function(){var e=r(o.a.mark(function e(r){var a;return o.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.json();case 2:a=e.sent,a=a.data,p=a,t.setAttributes({buttonText:i});case 6:case"end":return e.stop()}},e,n)}));return function(t){return e.apply(this,arguments)}}()).catch(function(t){console.log("ERROR: "+t.message)})}},g=function(e){t.setAttributes({embedUrl:"",buttonText:"Embed",lockEmbed:!1,insertItemImage:!1,insertItemOsTitle:!1,insertItemOsView:!1,insertItemOsEdit:!1,insertItemOsStatistics:!1})},v=function(t){window.location.replace(d)},y=osGutenData.onCreateButtonClickOs+"?w_type=outcome&amp;utm_source=wordpress&amp;utm_campaign=WPMainPI&amp;utm_medium=link&amp;o=wp35e8",b=function(t){window.open(y,"_blank").focus()};if(""==osGutenData.isOsConnected)return wp.element.createElement("div",{className:t.className},wp.element.createElement("div",{className:"os-personality-wrapper components-placeholder"},wp.element.createElement("p",{className:"components-heading"},wp.element.createElement("img",{src:f,alt:""})),wp.element.createElement("p",{className:"components-heading"},"Please connect WordPress to Opinion Stage to start adding personality"),wp.element.createElement("button",{className:"components-button is-button is-default is-block is-primary",onClick:v},"Connect")),wp.element.createElement("div",null));if(jQuery(document).ready(function(){jQuery("span#oswpLauncherContentPopuppersonality").live("click",function(t){t.preventDefault(),setTimeout(function(){jQuery(".editor-post-save-draft").trigger("click")},500);var e=jQuery(this).attr("data-os-block");jQuery("button#dropbtn span").text(e);for(var n=jQuery(".filter__itm"),r=0;r<n.length;r++){if(jQuery(n[r]).text()==e){setTimeout(function(){jQuery(n[r]).trigger("click")},1e3),setTimeout(function(){jQuery(".progress_message").css("display","none"),jQuery(".content__list").css("display","block")},2500),jQuery("button.content__links-itm").live("click",function(t){jQuery(".tingle-modal.opinionstage-content-popup").hide(),jQuery(".tingle-modal.opinionstage-content-popup.tingle-modal--visible").hide()});break}jQuery(".progress_message").css("display","block"),jQuery(".content__list").css("display","none")}})}),0!=p)for(var w=0;w<p.length;w++){var E=function(t){var e=document.createElement("a");return e.href=t,e}(p[w].attributes["landing-page-url"]),x=E.pathname;if(n==x){t.setAttributes({lockEmbed:!0,buttonText:"Change"}),t.setAttributes({insertItemImage:p[w].attributes["image-url"]}),t.setAttributes({insertItemOsTitle:p[w].attributes.title}),t.setAttributes({insertItemOsView:p[w].attributes["landing-page-url"]}),t.setAttributes({insertItemOsEdit:p[w].attributes["edit-url"]}),t.setAttributes({insertItemOsStatistics:p[w].attributes["stats-url"]});break}}var k=wp.element.createElement("div",{className:"os-personality-wrapper components-placeholder"},wp.element.createElement("p",{className:"components-heading"},wp.element.createElement("img",{src:f,alt:""})),wp.element.createElement("span",{id:"oswpLauncherContentPopuppersonality",className:"components-button is-button is-default is-block is-primary","data-opinionstage-content-launch":!0,"data-os-block":"personality quiz",onClick:h},"Select a Personality Quiz"),wp.element.createElement("input",{type:"button",value:"Create a New Personality Quiz",className:"components-button is-button is-default is-block is-primary",onClick:b}),wp.element.createElement("span",null));return""!=n&&n?"Embed"==i||"Change"==i&&(k=wp.element.createElement("div",{className:"os-personality-wrapper components-placeholder"},wp.element.createElement("p",{className:"components-heading"},wp.element.createElement("img",{src:f,alt:""})),wp.element.createElement("div",{className:"components-preview__block"},wp.element.createElement("div",{className:"components-preview__leftBlockImage"},wp.element.createElement("img",{src:a,alt:s,className:"image"}),wp.element.createElement("div",{className:"overlay"},wp.element.createElement("div",{className:"text"},wp.element.createElement("a",{href:c,target:"_blank"}," View "),wp.element.createElement("a",{href:l,target:"_blank"}," Edit "),wp.element.createElement("a",{href:u,target:"_blank"}," Statistics "),wp.element.createElement("input",{type:"button",value:i,className:"components-button is-button is-default is-large left-align",onClick:g})))),wp.element.createElement("div",{className:"components-preview__rightBlockContent"},wp.element.createElement("div",{className:"components-placeholder__label"},"Personality Quiz: ",s))),wp.element.createElement("span",null))):""==n||"undefined"===jQuery.type(n)||t.setAttributes({buttonText:"Embed"}),wp.element.createElement("div",{className:t.className},k,wp.element.createElement("span",null))},save:function(t){var e=t.attributes,n=e.embedUrl,r=e.lockEmbed,i=e.buttonText,o=e.insertItemImage,a=e.insertItemOsTitle,s=e.insertItemOsView,c=e.insertItemOsEdit,l=e.insertItemOsStatistics;return wp.element.createElement("div",{class:"os-personality-wrapper","data-type":"personality","data-image-url":o,"data-title-url":a,"data-view-url":s,"data-statistics-url":l,"data-edit-url":c,"data-test-url":n,"data-lock-embed":r,"data-button-text":i},'[os-widget path="',n,'"]',wp.element.createElement("span",null))}})},function(t,e,n){t.exports=n(3)},function(t,e,n){var r=function(){return this}()||Function("return this")(),i=r.regeneratorRuntime&&Object.getOwnPropertyNames(r).indexOf("regeneratorRuntime")>=0,o=i&&r.regeneratorRuntime;if(r.regeneratorRuntime=void 0,t.exports=n(4),i)r.regeneratorRuntime=o;else try{delete r.regeneratorRuntime}catch(t){r.regeneratorRuntime=void 0}},function(t,e){!function(e){"use strict";function n(t,e,n,r){var o=e&&e.prototype instanceof i?e:i,a=Object.create(o.prototype),s=new d(r||[]);return a._invoke=l(t,n,s),a}function r(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}function i(){}function o(){}function a(){}function s(t){["next","throw","return"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function c(t){function e(n,i,o,a){var s=r(t[n],t,i);if("throw"!==s.type){var c=s.arg,l=c.value;return l&&"object"===typeof l&&y.call(l,"__await")?Promise.resolve(l.__await).then(function(t){e("next",t,o,a)},function(t){e("throw",t,o,a)}):Promise.resolve(l).then(function(t){c.value=t,o(c)},a)}a(s.arg)}function n(t,n){function r(){return new Promise(function(r,i){e(t,n,r,i)})}return i=i?i.then(r,r):r()}var i;this._invoke=n}function l(t,e,n){var i=_;return function(o,a){if(i===L)throw new Error("Generator is already running");if(i===N){if("throw"===o)throw a;return h()}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var c=u(s,n);if(c){if(c===P)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===_)throw i=N,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=L;var l=r(t,e,n);if("normal"===l.type){if(i=n.done?N:I,l.arg===P)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i=N,n.method="throw",n.arg=l.arg)}}}function u(t,e){var n=t.iterator[e.method];if(n===g){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=g,u(t,e),"throw"===e.method))return P;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return P}var i=r(n,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,P;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=g),e.delegate=null,P):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,P)}function p(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function m(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function d(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(p,this),this.reset(!0)}function f(t){if(t){var e=t[w];if(e)return e.call(t);if("function"===typeof t.next)return t;if(!isNaN(t.length)){var n=-1,r=function e(){for(;++n<t.length;)if(y.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=g,e.done=!0,e};return r.next=r}}return{next:h}}function h(){return{value:g,done:!0}}var g,v=Object.prototype,y=v.hasOwnProperty,b="function"===typeof Symbol?Symbol:{},w=b.iterator||"@@iterator",E=b.asyncIterator||"@@asyncIterator",x=b.toStringTag||"@@toStringTag",k="object"===typeof t,O=e.regeneratorRuntime;if(O)return void(k&&(t.exports=O));O=e.regeneratorRuntime=k?t.exports:{},O.wrap=n;var _="suspendedStart",I="suspendedYield",L="executing",N="completed",P={},T={};T[w]=function(){return this};var S=Object.getPrototypeOf,C=S&&S(S(f([])));C&&C!==v&&y.call(C,w)&&(T=C);var j=a.prototype=i.prototype=Object.create(T);o.prototype=j.constructor=a,a.constructor=o,a[x]=o.displayName="GeneratorFunction",O.isGeneratorFunction=function(t){var e="function"===typeof t&&t.constructor;return!!e&&(e===o||"GeneratorFunction"===(e.displayName||e.name))},O.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,a):(t.__proto__=a,x in t||(t[x]="GeneratorFunction")),t.prototype=Object.create(j),t},O.awrap=function(t){return{__await:t}},s(c.prototype),c.prototype[E]=function(){return this},O.AsyncIterator=c,O.async=function(t,e,r,i){var o=new c(n(t,e,r,i));return O.isGeneratorFunction(e)?o:o.next().then(function(t){return t.done?t.value:o.next()})},s(j),j[x]="Generator",j[w]=function(){return this},j.toString=function(){return"[object Generator]"},O.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},O.values=f,d.prototype={constructor:d,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=g,this.done=!1,this.delegate=null,this.method="next",this.arg=g,this.tryEntries.forEach(m),!t)for(var e in this)"t"===e.charAt(0)&&y.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=g)},stop:function(){this.done=!0;var t=this.tryEntries[0],e=t.completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){function e(e,r){return o.type="throw",o.arg=t,n.next=e,r&&(n.method="next",n.arg=g),!!r}if(this.done)throw t;for(var n=this,r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r],o=i.completion;if("root"===i.tryLoc)return e("end");if(i.tryLoc<=this.prev){var a=y.call(i,"catchLoc"),s=y.call(i,"finallyLoc");if(a&&s){if(this.prev<i.catchLoc)return e(i.catchLoc,!0);if(this.prev<i.finallyLoc)return e(i.finallyLoc)}else if(a){if(this.prev<i.catchLoc)return e(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return e(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&y.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=t,o.arg=e,i?(this.method="next",this.next=i.finallyLoc,P):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),P},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),m(n),P}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;m(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:f(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=g),P}}}(function(){return this}()||Function("return this")())},function(t,e){},function(t,e){}]);
1
+ !function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var n={};e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=0)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});n(1)},function(t,e,n){"use strict";function r(t){return function(){var e=t.apply(this,arguments);return new Promise(function(t,n){function r(i,o){try{var a=e[i](o),s=a.value}catch(t){return void n(t)}if(!a.done)return Promise.resolve(s).then(function(t){r("next",t)},function(t){r("throw",t)});t(s)}return r("next")})}}var i=n(2),o=n.n(i),a=n(5),s=(n.n(a),n(6)),c=(n.n(s),wp.i18n.__),l=wp.blocks.registerBlockType,u=wp.components,p=(u.SelectControl,u.TextControl,wp.editor.RichText,!1);l("opinion-stage/block-os-personality",{title:c("Personality Quiz"),icon:"smiley",category:"opinion-stage",keywords:[c("Opinion Stage Personality Quiz"),c("Opinion Stage Personality")],attributes:{embedUrl:{source:"attribute",attribute:"data-test-url",selector:"div[data-test-url]"},lockEmbed:{source:"attribute",attribute:"data-lock-embed",selector:"div[data-lock-embed]"},buttonText:{source:"attribute",attribute:"data-button-text",selector:"div[data-button-text]"},insertItemImage:{source:"attribute",attribute:"data-image-url",selector:"div[data-image-url]"},insertItemOsTitle:{source:"attribute",attribute:"data-title-url",selector:"div[data-title-url]"},insertItemOsView:{source:"attribute",attribute:"data-view-url",selector:"div[data-view-url]"},insertItemOsEdit:{source:"attribute",attribute:"data-edit-url",selector:"div[data-edit-url]"},insertItemOsStatistics:{source:"attribute",attribute:"data-statistics-url",selector:"div[data-statistics-url]"}},edit:function(t){var e=t.attributes,n=e.embedUrl,i=(e.lockEmbed,e.buttonText),a=e.insertItemImage,s=e.insertItemOsTitle,c=e.insertItemOsView,l=e.insertItemOsEdit,u=e.insertItemOsStatistics,m=(t.setAttributes,osGutenData.callbackUrlOs),d=m,f=(osGutenData.getActionUrlOS,osGutenData.getLogoImageLink),h=function(e){window.verifyOSInsert=function(e){var n=this;t.setAttributes({embedUrl:e,buttonText:"Change"});var a=osGutenData.OswpPluginVersion,s=osGutenData.OswpClientToken,c=osGutenData.OswpFetchDataUrl+"?type=outcome&page=1&per_page=99";fetch(c,{method:"GET",headers:{Accept:"application/vnd.api+json","Content-Type":"application/vnd.api+json","OSWP-Plugin-Version":a,"OSWP-Client-Token":s}}).then(function(){var e=r(o.a.mark(function e(r){var a;return o.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.json();case 2:a=e.sent,a=a.data,p=a,t.setAttributes({buttonText:i});case 6:case"end":return e.stop()}},e,n)}));return function(t){return e.apply(this,arguments)}}()).catch(function(t){console.log("ERROR: "+t.message)})}},g=function(e){t.setAttributes({embedUrl:"",buttonText:"Embed",lockEmbed:!1,insertItemImage:!1,insertItemOsTitle:!1,insertItemOsView:!1,insertItemOsEdit:!1,insertItemOsStatistics:!1})},v=function(t){window.location.replace(d)},y=osGutenData.onCreateButtonClickOs+"?w_type=outcome&amp;utm_source=wordpress&amp;utm_campaign=WPMainPI&amp;utm_medium=link&amp;o=wp35e8",b=function(t){window.open(y,"_blank").focus()};if(""==osGutenData.isOsConnected)return wp.element.createElement("div",{className:t.className},wp.element.createElement("div",{className:"os-personality-wrapper components-placeholder"},wp.element.createElement("p",{className:"components-heading"},wp.element.createElement("img",{src:f,alt:""})),wp.element.createElement("p",{className:"components-heading"},"Please connect WordPress to Opinion Stage to start adding personality"),wp.element.createElement("button",{className:"components-button is-button is-default is-block is-primary",onClick:v},"Connect")),wp.element.createElement("div",null));if(jQuery(document).ready(function(){jQuery("span#oswpLauncherContentPopuppersonality").on("click",null,function(t){t.preventDefault(),setTimeout(function(){jQuery(".editor-post-save-draft").trigger("click")},500);var e=jQuery(this).attr("data-os-block");jQuery("button#dropbtn span").text(e);for(var n=jQuery(".filter__itm"),r=0;r<n.length;r++){if(jQuery(n[r]).text()==e){setTimeout(function(){jQuery(n[r]).trigger("click")},1e3),setTimeout(function(){jQuery(".progress_message").css("display","none"),jQuery(".content__list").css("display","block")},2500),jQuery("button.content__links-itm").on("click",null,function(t){jQuery(".tingle-modal.opinionstage-content-popup").hide(),jQuery(".tingle-modal.opinionstage-content-popup.tingle-modal--visible").hide()});break}jQuery(".progress_message").css("display","block"),jQuery(".content__list").css("display","none")}})}),0!=p)for(var w=0;w<p.length;w++){var E=function(t){var e=document.createElement("a");return e.href=t,e}(p[w].attributes["landing-page-url"]),x=E.pathname;if(n==x){t.setAttributes({lockEmbed:!0,buttonText:"Change"}),t.setAttributes({insertItemImage:p[w].attributes["image-url"]}),t.setAttributes({insertItemOsTitle:p[w].attributes.title}),t.setAttributes({insertItemOsView:p[w].attributes["landing-page-url"]}),t.setAttributes({insertItemOsEdit:p[w].attributes["edit-url"]}),t.setAttributes({insertItemOsStatistics:p[w].attributes["stats-url"]});break}}var k=wp.element.createElement("div",{className:"os-personality-wrapper components-placeholder"},wp.element.createElement("p",{className:"components-heading"},wp.element.createElement("img",{src:f,alt:""})),wp.element.createElement("span",{id:"oswpLauncherContentPopuppersonality",className:"components-button is-button is-default is-block is-primary","data-opinionstage-content-launch":!0,"data-os-block":"personality quiz",onClick:h},"Select a Personality Quiz"),wp.element.createElement("input",{type:"button",value:"Create a New Personality Quiz",className:"components-button is-button is-default is-block is-primary",onClick:b}),wp.element.createElement("span",null));return""!=n&&n?"Embed"==i||"Change"==i&&(k=wp.element.createElement("div",{className:"os-personality-wrapper components-placeholder"},wp.element.createElement("p",{className:"components-heading"},wp.element.createElement("img",{src:f,alt:""})),wp.element.createElement("div",{className:"components-preview__block"},wp.element.createElement("div",{className:"components-preview__leftBlockImage"},wp.element.createElement("img",{src:a,alt:s,className:"image"}),wp.element.createElement("div",{className:"overlay"},wp.element.createElement("div",{className:"text"},wp.element.createElement("a",{href:c,target:"_blank"}," View "),wp.element.createElement("a",{href:l,target:"_blank"}," Edit "),wp.element.createElement("a",{href:u,target:"_blank"}," Statistics "),wp.element.createElement("input",{type:"button",value:i,className:"components-button is-button is-default is-large left-align",onClick:g})))),wp.element.createElement("div",{className:"components-preview__rightBlockContent"},wp.element.createElement("div",{className:"components-placeholder__label"},"Personality Quiz: ",s))),wp.element.createElement("span",null))):""==n||"undefined"===jQuery.type(n)||t.setAttributes({buttonText:"Embed"}),wp.element.createElement("div",{className:t.className},k,wp.element.createElement("span",null))},save:function(t){var e=t.attributes,n=e.embedUrl,r=e.lockEmbed,i=e.buttonText,o=e.insertItemImage,a=e.insertItemOsTitle,s=e.insertItemOsView,c=e.insertItemOsEdit,l=e.insertItemOsStatistics;return wp.element.createElement("div",{class:"os-personality-wrapper","data-type":"personality","data-image-url":o,"data-title-url":a,"data-view-url":s,"data-statistics-url":l,"data-edit-url":c,"data-test-url":n,"data-lock-embed":r,"data-button-text":i},'[os-widget path="',n,'"]',wp.element.createElement("span",null))}})},function(t,e,n){t.exports=n(3)},function(t,e,n){var r=function(){return this}()||Function("return this")(),i=r.regeneratorRuntime&&Object.getOwnPropertyNames(r).indexOf("regeneratorRuntime")>=0,o=i&&r.regeneratorRuntime;if(r.regeneratorRuntime=void 0,t.exports=n(4),i)r.regeneratorRuntime=o;else try{delete r.regeneratorRuntime}catch(t){r.regeneratorRuntime=void 0}},function(t,e){!function(e){"use strict";function n(t,e,n,r){var o=e&&e.prototype instanceof i?e:i,a=Object.create(o.prototype),s=new d(r||[]);return a._invoke=l(t,n,s),a}function r(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}function i(){}function o(){}function a(){}function s(t){["next","throw","return"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function c(t){function e(n,i,o,a){var s=r(t[n],t,i);if("throw"!==s.type){var c=s.arg,l=c.value;return l&&"object"===typeof l&&y.call(l,"__await")?Promise.resolve(l.__await).then(function(t){e("next",t,o,a)},function(t){e("throw",t,o,a)}):Promise.resolve(l).then(function(t){c.value=t,o(c)},a)}a(s.arg)}function n(t,n){function r(){return new Promise(function(r,i){e(t,n,r,i)})}return i=i?i.then(r,r):r()}var i;this._invoke=n}function l(t,e,n){var i=_;return function(o,a){if(i===L)throw new Error("Generator is already running");if(i===N){if("throw"===o)throw a;return h()}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var c=u(s,n);if(c){if(c===P)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===_)throw i=N,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=L;var l=r(t,e,n);if("normal"===l.type){if(i=n.done?N:I,l.arg===P)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i=N,n.method="throw",n.arg=l.arg)}}}function u(t,e){var n=t.iterator[e.method];if(n===g){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=g,u(t,e),"throw"===e.method))return P;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return P}var i=r(n,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,P;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=g),e.delegate=null,P):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,P)}function p(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function m(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function d(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(p,this),this.reset(!0)}function f(t){if(t){var e=t[w];if(e)return e.call(t);if("function"===typeof t.next)return t;if(!isNaN(t.length)){var n=-1,r=function e(){for(;++n<t.length;)if(y.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=g,e.done=!0,e};return r.next=r}}return{next:h}}function h(){return{value:g,done:!0}}var g,v=Object.prototype,y=v.hasOwnProperty,b="function"===typeof Symbol?Symbol:{},w=b.iterator||"@@iterator",E=b.asyncIterator||"@@asyncIterator",x=b.toStringTag||"@@toStringTag",k="object"===typeof t,O=e.regeneratorRuntime;if(O)return void(k&&(t.exports=O));O=e.regeneratorRuntime=k?t.exports:{},O.wrap=n;var _="suspendedStart",I="suspendedYield",L="executing",N="completed",P={},T={};T[w]=function(){return this};var S=Object.getPrototypeOf,C=S&&S(S(f([])));C&&C!==v&&y.call(C,w)&&(T=C);var j=a.prototype=i.prototype=Object.create(T);o.prototype=j.constructor=a,a.constructor=o,a[x]=o.displayName="GeneratorFunction",O.isGeneratorFunction=function(t){var e="function"===typeof t&&t.constructor;return!!e&&(e===o||"GeneratorFunction"===(e.displayName||e.name))},O.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,a):(t.__proto__=a,x in t||(t[x]="GeneratorFunction")),t.prototype=Object.create(j),t},O.awrap=function(t){return{__await:t}},s(c.prototype),c.prototype[E]=function(){return this},O.AsyncIterator=c,O.async=function(t,e,r,i){var o=new c(n(t,e,r,i));return O.isGeneratorFunction(e)?o:o.next().then(function(t){return t.done?t.value:o.next()})},s(j),j[x]="Generator",j[w]=function(){return this},j.toString=function(){return"[object Generator]"},O.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},O.values=f,d.prototype={constructor:d,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=g,this.done=!1,this.delegate=null,this.method="next",this.arg=g,this.tryEntries.forEach(m),!t)for(var e in this)"t"===e.charAt(0)&&y.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=g)},stop:function(){this.done=!0;var t=this.tryEntries[0],e=t.completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){function e(e,r){return o.type="throw",o.arg=t,n.next=e,r&&(n.method="next",n.arg=g),!!r}if(this.done)throw t;for(var n=this,r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r],o=i.completion;if("root"===i.tryLoc)return e("end");if(i.tryLoc<=this.prev){var a=y.call(i,"catchLoc"),s=y.call(i,"finallyLoc");if(a&&s){if(this.prev<i.catchLoc)return e(i.catchLoc,!0);if(this.prev<i.finallyLoc)return e(i.finallyLoc)}else if(a){if(this.prev<i.catchLoc)return e(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return e(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&y.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=t,o.arg=e,i?(this.method="next",this.next=i.finallyLoc,P):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),P},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),m(n),P}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;m(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:f(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=g),P}}}(function(){return this}()||Function("return this")())},function(t,e){},function(t,e){}]);
gutenberg/poll/dist/blocks.build.js CHANGED
@@ -1 +1 @@
1
- !function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var n={};e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=0)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});n(1)},function(t,e,n){"use strict";function r(t){return function(){var e=t.apply(this,arguments);return new Promise(function(t,n){function r(o,i){try{var a=e[o](i),s=a.value}catch(t){return void n(t)}if(!a.done)return Promise.resolve(s).then(function(t){r("next",t)},function(t){r("throw",t)});t(s)}return r("next")})}}var o=n(2),i=n.n(o),a=n(5),s=(n.n(a),n(6)),l=(n.n(s),wp.i18n.__),c=wp.blocks.registerBlockType,u=wp.components,p=(u.SelectControl,u.TextControl,wp.editor.RichText,!1);c("opinion-stage/block-os-poll",{title:l("Poll"),icon:"chart-bar",category:"opinion-stage",keywords:[l("Opinion Stage Poll"),l("Opinion Stage Poll")],attributes:{embedUrl:{source:"attribute",attribute:"data-test-url",selector:"div[data-test-url]"},lockEmbed:{source:"attribute",attribute:"data-lock-embed",selector:"div[data-lock-embed]"},buttonText:{source:"attribute",attribute:"data-button-text",selector:"div[data-button-text]"},insertItemImage:{source:"attribute",attribute:"data-image-url",selector:"div[data-image-url]"},insertItemOsTitle:{source:"attribute",attribute:"data-title-url",selector:"div[data-title-url]"},insertItemOsView:{source:"attribute",attribute:"data-view-url",selector:"div[data-view-url]"},insertItemOsEdit:{source:"attribute",attribute:"data-edit-url",selector:"div[data-edit-url]"},insertItemOsStatistics:{source:"attribute",attribute:"data-statistics-url",selector:"div[data-statistics-url]"}},edit:function(t){var e=t.attributes,n=e.embedUrl,o=(e.lockEmbed,e.buttonText),a=e.insertItemImage,s=e.insertItemOsTitle,l=e.insertItemOsView,c=e.insertItemOsEdit,u=e.insertItemOsStatistics,m=(t.setAttributes,osGutenData.callbackUrlOs),d=m,f=(osGutenData.getActionUrlOS,osGutenData.getLogoImageLink),h=function(e){window.verifyOSInsert=function(e){var n=this;t.setAttributes({embedUrl:e,buttonText:"Change"});var a=osGutenData.OswpPluginVersion,s=osGutenData.OswpClientToken,l=osGutenData.OswpFetchDataUrl+"?type=poll&page=1&per_page=99";fetch(l,{method:"GET",headers:{Accept:"application/vnd.api+json","Content-Type":"application/vnd.api+json","OSWP-Plugin-Version":a,"OSWP-Client-Token":s}}).then(function(){var e=r(i.a.mark(function e(r){var a;return i.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.json();case 2:a=e.sent,a=a.data,p=a,t.setAttributes({buttonText:o});case 6:case"end":return e.stop()}},e,n)}));return function(t){return e.apply(this,arguments)}}()).catch(function(t){console.log("ERROR: "+t.message)})}},g=function(e){t.setAttributes({embedUrl:"",buttonText:"Embed",lockEmbed:!1,insertItemImage:!1,insertItemOsTitle:!1,insertItemOsView:!1,insertItemOsEdit:!1,insertItemOsStatistics:!1})},v=function(t){window.location.replace(d)},b=osGutenData.onCreateButtonClickOs+"?w_type=poll&amp;utm_source=wordpress&amp;utm_campaign=WPMainPI&amp;utm_medium=link&amp;o=wp35e8",w=function(t){window.open(b,"_blank").focus()};if(""==osGutenData.isOsConnected)return wp.element.createElement("div",{className:t.className},wp.element.createElement("div",{className:"os-poll-wrapper components-placeholder"},wp.element.createElement("p",{className:"components-heading"},wp.element.createElement("img",{src:f,alt:""})),wp.element.createElement("p",{className:"components-heading"},"Please connect WordPress to Opinion Stage to start adding polls"),wp.element.createElement("button",{className:"components-button is-button is-default is-block is-primary",onClick:v},"Connect")),wp.element.createElement("div",null));if(jQuery(document).ready(function(){jQuery("span#oswpLauncherContentPopuppoll").live("click",function(t){t.preventDefault(),setTimeout(function(){jQuery(".editor-post-save-draft").trigger("click")},500);var e=jQuery(this).attr("data-os-block");jQuery("button#dropbtn span").text(e);for(var n=jQuery(".filter__itm"),r=0;r<n.length;r++){if(jQuery(n[r]).text()==e){setTimeout(function(){jQuery(n[r]).trigger("click")},1e3),setTimeout(function(){jQuery(".progress_message").css("display","none"),jQuery(".content__list").css("display","block")},2500),jQuery("button.content__links-itm").live("click",function(t){jQuery(".tingle-modal.opinionstage-content-popup").hide(),jQuery(".tingle-modal.opinionstage-content-popup.tingle-modal--visible").hide()});break}jQuery(".progress_message").css("display","block"),jQuery(".content__list").css("display","none")}})}),0!=p)for(var y=0;y<p.length;y++){var E=function(t){var e=document.createElement("a");return e.href=t,e}(p[y].attributes["landing-page-url"]),x=E.pathname;if(n==x){t.setAttributes({lockEmbed:!0,buttonText:"Change"}),t.setAttributes({insertItemImage:p[y].attributes["image-url"]}),t.setAttributes({insertItemOsTitle:p[y].attributes.title}),t.setAttributes({insertItemOsView:p[y].attributes["landing-page-url"]}),t.setAttributes({insertItemOsEdit:p[y].attributes["edit-url"]}),t.setAttributes({insertItemOsStatistics:p[y].attributes["stats-url"]});break}}var k=wp.element.createElement("div",{className:"os-poll-wrapper components-placeholder"},wp.element.createElement("p",{className:"components-heading"},wp.element.createElement("img",{src:f,alt:""})),wp.element.createElement("span",{id:"oswpLauncherContentPopuppoll",className:"components-button is-button is-default is-block is-primary","data-opinionstage-content-launch":!0,"data-os-block":"poll",onClick:h},"Select a Poll"),wp.element.createElement("input",{type:"button",value:"Create a New Poll",className:"components-button is-button is-default is-block is-primary",onClick:w}),wp.element.createElement("span",null));return""!=n&&n?"Embed"==o||"Change"==o&&(k=wp.element.createElement("div",{className:"os-poll-wrapper components-placeholder"},wp.element.createElement("p",{className:"components-heading"},wp.element.createElement("img",{src:f,alt:""})),wp.element.createElement("div",{className:"components-preview__block"},wp.element.createElement("div",{className:"components-preview__leftBlockImage"},wp.element.createElement("img",{src:a,alt:s,className:"image"}),wp.element.createElement("div",{className:"overlay"},wp.element.createElement("div",{className:"text"},wp.element.createElement("a",{href:l,target:"_blank"}," View "),wp.element.createElement("a",{href:c,target:"_blank"}," Edit "),wp.element.createElement("a",{href:u,target:"_blank"}," Statistics "),wp.element.createElement("input",{type:"button",value:o,className:"components-button is-button is-default is-large left-align",onClick:g})))),wp.element.createElement("div",{className:"components-preview__rightBlockContent"},wp.element.createElement("div",{className:"components-placeholder__label"},"Poll: ",s))),wp.element.createElement("span",null))):""==n||"undefined"===jQuery.type(n)||t.setAttributes({buttonText:"Embed"}),wp.element.createElement("div",{className:t.className},k,wp.element.createElement("span",null))},save:function(t){var e=t.attributes,n=e.embedUrl,r=e.lockEmbed,o=e.buttonText,i=e.insertItemImage,a=e.insertItemOsTitle,s=e.insertItemOsView,l=e.insertItemOsEdit,c=e.insertItemOsStatistics;return wp.element.createElement("div",{class:"os-poll-wrapper","data-type":"poll","data-image-url":i,"data-title-url":a,"data-view-url":s,"data-statistics-url":c,"data-edit-url":l,"data-test-url":n,"data-lock-embed":r,"data-button-text":o},'[os-widget path="',n,'"]',wp.element.createElement("span",null))}})},function(t,e,n){t.exports=n(3)},function(t,e,n){var r=function(){return this}()||Function("return this")(),o=r.regeneratorRuntime&&Object.getOwnPropertyNames(r).indexOf("regeneratorRuntime")>=0,i=o&&r.regeneratorRuntime;if(r.regeneratorRuntime=void 0,t.exports=n(4),o)r.regeneratorRuntime=i;else try{delete r.regeneratorRuntime}catch(t){r.regeneratorRuntime=void 0}},function(t,e){!function(e){"use strict";function n(t,e,n,r){var i=e&&e.prototype instanceof o?e:o,a=Object.create(i.prototype),s=new d(r||[]);return a._invoke=c(t,n,s),a}function r(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}function o(){}function i(){}function a(){}function s(t){["next","throw","return"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function l(t){function e(n,o,i,a){var s=r(t[n],t,o);if("throw"!==s.type){var l=s.arg,c=l.value;return c&&"object"===typeof c&&b.call(c,"__await")?Promise.resolve(c.__await).then(function(t){e("next",t,i,a)},function(t){e("throw",t,i,a)}):Promise.resolve(c).then(function(t){l.value=t,i(l)},a)}a(s.arg)}function n(t,n){function r(){return new Promise(function(r,o){e(t,n,r,o)})}return o=o?o.then(r,r):r()}var o;this._invoke=n}function c(t,e,n){var o=_;return function(i,a){if(o===L)throw new Error("Generator is already running");if(o===N){if("throw"===i)throw a;return h()}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var l=u(s,n);if(l){if(l===P)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===_)throw o=N,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=L;var c=r(t,e,n);if("normal"===c.type){if(o=n.done?N:I,c.arg===P)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=N,n.method="throw",n.arg=c.arg)}}}function u(t,e){var n=t.iterator[e.method];if(n===g){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=g,u(t,e),"throw"===e.method))return P;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return P}var o=r(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,P;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=g),e.delegate=null,P):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,P)}function p(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function m(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function d(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(p,this),this.reset(!0)}function f(t){if(t){var e=t[y];if(e)return e.call(t);if("function"===typeof t.next)return t;if(!isNaN(t.length)){var n=-1,r=function e(){for(;++n<t.length;)if(b.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=g,e.done=!0,e};return r.next=r}}return{next:h}}function h(){return{value:g,done:!0}}var g,v=Object.prototype,b=v.hasOwnProperty,w="function"===typeof Symbol?Symbol:{},y=w.iterator||"@@iterator",E=w.asyncIterator||"@@asyncIterator",x=w.toStringTag||"@@toStringTag",k="object"===typeof t,O=e.regeneratorRuntime;if(O)return void(k&&(t.exports=O));O=e.regeneratorRuntime=k?t.exports:{},O.wrap=n;var _="suspendedStart",I="suspendedYield",L="executing",N="completed",P={},T={};T[y]=function(){return this};var S=Object.getPrototypeOf,C=S&&S(S(f([])));C&&C!==v&&b.call(C,y)&&(T=C);var j=a.prototype=o.prototype=Object.create(T);i.prototype=j.constructor=a,a.constructor=i,a[x]=i.displayName="GeneratorFunction",O.isGeneratorFunction=function(t){var e="function"===typeof t&&t.constructor;return!!e&&(e===i||"GeneratorFunction"===(e.displayName||e.name))},O.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,a):(t.__proto__=a,x in t||(t[x]="GeneratorFunction")),t.prototype=Object.create(j),t},O.awrap=function(t){return{__await:t}},s(l.prototype),l.prototype[E]=function(){return this},O.AsyncIterator=l,O.async=function(t,e,r,o){var i=new l(n(t,e,r,o));return O.isGeneratorFunction(e)?i:i.next().then(function(t){return t.done?t.value:i.next()})},s(j),j[x]="Generator",j[y]=function(){return this},j.toString=function(){return"[object Generator]"},O.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},O.values=f,d.prototype={constructor:d,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=g,this.done=!1,this.delegate=null,this.method="next",this.arg=g,this.tryEntries.forEach(m),!t)for(var e in this)"t"===e.charAt(0)&&b.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=g)},stop:function(){this.done=!0;var t=this.tryEntries[0],e=t.completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){function e(e,r){return i.type="throw",i.arg=t,n.next=e,r&&(n.method="next",n.arg=g),!!r}if(this.done)throw t;for(var n=this,r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r],i=o.completion;if("root"===o.tryLoc)return e("end");if(o.tryLoc<=this.prev){var a=b.call(o,"catchLoc"),s=b.call(o,"finallyLoc");if(a&&s){if(this.prev<o.catchLoc)return e(o.catchLoc,!0);if(this.prev<o.finallyLoc)return e(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return e(o.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return e(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&b.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,P):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),P},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),m(n),P}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;m(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:f(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=g),P}}}(function(){return this}()||Function("return this")())},function(t,e){},function(t,e){}]);
1
+ !function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var n={};e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=0)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});n(1)},function(t,e,n){"use strict";function r(t){return function(){var e=t.apply(this,arguments);return new Promise(function(t,n){function r(o,i){try{var a=e[o](i),s=a.value}catch(t){return void n(t)}if(!a.done)return Promise.resolve(s).then(function(t){r("next",t)},function(t){r("throw",t)});t(s)}return r("next")})}}var o=n(2),i=n.n(o),a=n(5),s=(n.n(a),n(6)),l=(n.n(s),wp.i18n.__),c=wp.blocks.registerBlockType,u=wp.components,p=(u.SelectControl,u.TextControl,wp.editor.RichText,!1);c("opinion-stage/block-os-poll",{title:l("Poll"),icon:"chart-bar",category:"opinion-stage",keywords:[l("Opinion Stage Poll"),l("Opinion Stage Poll")],attributes:{embedUrl:{source:"attribute",attribute:"data-test-url",selector:"div[data-test-url]"},lockEmbed:{source:"attribute",attribute:"data-lock-embed",selector:"div[data-lock-embed]"},buttonText:{source:"attribute",attribute:"data-button-text",selector:"div[data-button-text]"},insertItemImage:{source:"attribute",attribute:"data-image-url",selector:"div[data-image-url]"},insertItemOsTitle:{source:"attribute",attribute:"data-title-url",selector:"div[data-title-url]"},insertItemOsView:{source:"attribute",attribute:"data-view-url",selector:"div[data-view-url]"},insertItemOsEdit:{source:"attribute",attribute:"data-edit-url",selector:"div[data-edit-url]"},insertItemOsStatistics:{source:"attribute",attribute:"data-statistics-url",selector:"div[data-statistics-url]"}},edit:function(t){var e=t.attributes,n=e.embedUrl,o=(e.lockEmbed,e.buttonText),a=e.insertItemImage,s=e.insertItemOsTitle,l=e.insertItemOsView,c=e.insertItemOsEdit,u=e.insertItemOsStatistics,m=(t.setAttributes,osGutenData.callbackUrlOs),d=m,f=(osGutenData.getActionUrlOS,osGutenData.getLogoImageLink),h=function(e){window.verifyOSInsert=function(e){var n=this;t.setAttributes({embedUrl:e,buttonText:"Change"});var a=osGutenData.OswpPluginVersion,s=osGutenData.OswpClientToken,l=osGutenData.OswpFetchDataUrl+"?type=poll&page=1&per_page=99";fetch(l,{method:"GET",headers:{Accept:"application/vnd.api+json","Content-Type":"application/vnd.api+json","OSWP-Plugin-Version":a,"OSWP-Client-Token":s}}).then(function(){var e=r(i.a.mark(function e(r){var a;return i.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.json();case 2:a=e.sent,a=a.data,p=a,t.setAttributes({buttonText:o});case 6:case"end":return e.stop()}},e,n)}));return function(t){return e.apply(this,arguments)}}()).catch(function(t){console.log("ERROR: "+t.message)})}},g=function(e){t.setAttributes({embedUrl:"",buttonText:"Embed",lockEmbed:!1,insertItemImage:!1,insertItemOsTitle:!1,insertItemOsView:!1,insertItemOsEdit:!1,insertItemOsStatistics:!1})},v=function(t){window.location.replace(d)},b=osGutenData.onCreateButtonClickOs+"?w_type=poll&amp;utm_source=wordpress&amp;utm_campaign=WPMainPI&amp;utm_medium=link&amp;o=wp35e8",w=function(t){window.open(b,"_blank").focus()};if(""==osGutenData.isOsConnected)return wp.element.createElement("div",{className:t.className},wp.element.createElement("div",{className:"os-poll-wrapper components-placeholder"},wp.element.createElement("p",{className:"components-heading"},wp.element.createElement("img",{src:f,alt:""})),wp.element.createElement("p",{className:"components-heading"},"Please connect WordPress to Opinion Stage to start adding polls"),wp.element.createElement("button",{className:"components-button is-button is-default is-block is-primary",onClick:v},"Connect")),wp.element.createElement("div",null));if(jQuery(document).ready(function(){jQuery("span#oswpLauncherContentPopuppoll").on("click",null,function(t){t.preventDefault(),setTimeout(function(){jQuery(".editor-post-save-draft").trigger("click")},500);var e=jQuery(this).attr("data-os-block");jQuery("button#dropbtn span").text(e);for(var n=jQuery(".filter__itm"),r=0;r<n.length;r++){if(jQuery(n[r]).text()==e){setTimeout(function(){jQuery(n[r]).trigger("click")},1e3),setTimeout(function(){jQuery(".progress_message").css("display","none"),jQuery(".content__list").css("display","block")},2500),jQuery("button.content__links-itm").on("click",null,function(t){jQuery(".tingle-modal.opinionstage-content-popup").hide(),jQuery(".tingle-modal.opinionstage-content-popup.tingle-modal--visible").hide()});break}jQuery(".progress_message").css("display","block"),jQuery(".content__list").css("display","none")}})}),0!=p)for(var y=0;y<p.length;y++){var E=function(t){var e=document.createElement("a");return e.href=t,e}(p[y].attributes["landing-page-url"]),x=E.pathname;if(n==x){t.setAttributes({lockEmbed:!0,buttonText:"Change"}),t.setAttributes({insertItemImage:p[y].attributes["image-url"]}),t.setAttributes({insertItemOsTitle:p[y].attributes.title}),t.setAttributes({insertItemOsView:p[y].attributes["landing-page-url"]}),t.setAttributes({insertItemOsEdit:p[y].attributes["edit-url"]}),t.setAttributes({insertItemOsStatistics:p[y].attributes["stats-url"]});break}}var k=wp.element.createElement("div",{className:"os-poll-wrapper components-placeholder"},wp.element.createElement("p",{className:"components-heading"},wp.element.createElement("img",{src:f,alt:""})),wp.element.createElement("span",{id:"oswpLauncherContentPopuppoll",className:"components-button is-button is-default is-block is-primary","data-opinionstage-content-launch":!0,"data-os-block":"poll",onClick:h},"Select a Poll"),wp.element.createElement("input",{type:"button",value:"Create a New Poll",className:"components-button is-button is-default is-block is-primary",onClick:w}),wp.element.createElement("span",null));return""!=n&&n?"Embed"==o||"Change"==o&&(k=wp.element.createElement("div",{className:"os-poll-wrapper components-placeholder"},wp.element.createElement("p",{className:"components-heading"},wp.element.createElement("img",{src:f,alt:""})),wp.element.createElement("div",{className:"components-preview__block"},wp.element.createElement("div",{className:"components-preview__leftBlockImage"},wp.element.createElement("img",{src:a,alt:s,className:"image"}),wp.element.createElement("div",{className:"overlay"},wp.element.createElement("div",{className:"text"},wp.element.createElement("a",{href:l,target:"_blank"}," View "),wp.element.createElement("a",{href:c,target:"_blank"}," Edit "),wp.element.createElement("a",{href:u,target:"_blank"}," Statistics "),wp.element.createElement("input",{type:"button",value:o,className:"components-button is-button is-default is-large left-align",onClick:g})))),wp.element.createElement("div",{className:"components-preview__rightBlockContent"},wp.element.createElement("div",{className:"components-placeholder__label"},"Poll: ",s))),wp.element.createElement("span",null))):""==n||"undefined"===jQuery.type(n)||t.setAttributes({buttonText:"Embed"}),wp.element.createElement("div",{className:t.className},k,wp.element.createElement("span",null))},save:function(t){var e=t.attributes,n=e.embedUrl,r=e.lockEmbed,o=e.buttonText,i=e.insertItemImage,a=e.insertItemOsTitle,s=e.insertItemOsView,l=e.insertItemOsEdit,c=e.insertItemOsStatistics;return wp.element.createElement("div",{class:"os-poll-wrapper","data-type":"poll","data-image-url":i,"data-title-url":a,"data-view-url":s,"data-statistics-url":c,"data-edit-url":l,"data-test-url":n,"data-lock-embed":r,"data-button-text":o},'[os-widget path="',n,'"]',wp.element.createElement("span",null))}})},function(t,e,n){t.exports=n(3)},function(t,e,n){var r=function(){return this}()||Function("return this")(),o=r.regeneratorRuntime&&Object.getOwnPropertyNames(r).indexOf("regeneratorRuntime")>=0,i=o&&r.regeneratorRuntime;if(r.regeneratorRuntime=void 0,t.exports=n(4),o)r.regeneratorRuntime=i;else try{delete r.regeneratorRuntime}catch(t){r.regeneratorRuntime=void 0}},function(t,e){!function(e){"use strict";function n(t,e,n,r){var i=e&&e.prototype instanceof o?e:o,a=Object.create(i.prototype),s=new d(r||[]);return a._invoke=c(t,n,s),a}function r(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}function o(){}function i(){}function a(){}function s(t){["next","throw","return"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function l(t){function e(n,o,i,a){var s=r(t[n],t,o);if("throw"!==s.type){var l=s.arg,c=l.value;return c&&"object"===typeof c&&b.call(c,"__await")?Promise.resolve(c.__await).then(function(t){e("next",t,i,a)},function(t){e("throw",t,i,a)}):Promise.resolve(c).then(function(t){l.value=t,i(l)},a)}a(s.arg)}function n(t,n){function r(){return new Promise(function(r,o){e(t,n,r,o)})}return o=o?o.then(r,r):r()}var o;this._invoke=n}function c(t,e,n){var o=_;return function(i,a){if(o===L)throw new Error("Generator is already running");if(o===N){if("throw"===i)throw a;return h()}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var l=u(s,n);if(l){if(l===P)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===_)throw o=N,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=L;var c=r(t,e,n);if("normal"===c.type){if(o=n.done?N:I,c.arg===P)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=N,n.method="throw",n.arg=c.arg)}}}function u(t,e){var n=t.iterator[e.method];if(n===g){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=g,u(t,e),"throw"===e.method))return P;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return P}var o=r(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,P;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=g),e.delegate=null,P):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,P)}function p(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function m(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function d(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(p,this),this.reset(!0)}function f(t){if(t){var e=t[y];if(e)return e.call(t);if("function"===typeof t.next)return t;if(!isNaN(t.length)){var n=-1,r=function e(){for(;++n<t.length;)if(b.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=g,e.done=!0,e};return r.next=r}}return{next:h}}function h(){return{value:g,done:!0}}var g,v=Object.prototype,b=v.hasOwnProperty,w="function"===typeof Symbol?Symbol:{},y=w.iterator||"@@iterator",E=w.asyncIterator||"@@asyncIterator",x=w.toStringTag||"@@toStringTag",k="object"===typeof t,O=e.regeneratorRuntime;if(O)return void(k&&(t.exports=O));O=e.regeneratorRuntime=k?t.exports:{},O.wrap=n;var _="suspendedStart",I="suspendedYield",L="executing",N="completed",P={},T={};T[y]=function(){return this};var S=Object.getPrototypeOf,C=S&&S(S(f([])));C&&C!==v&&b.call(C,y)&&(T=C);var j=a.prototype=o.prototype=Object.create(T);i.prototype=j.constructor=a,a.constructor=i,a[x]=i.displayName="GeneratorFunction",O.isGeneratorFunction=function(t){var e="function"===typeof t&&t.constructor;return!!e&&(e===i||"GeneratorFunction"===(e.displayName||e.name))},O.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,a):(t.__proto__=a,x in t||(t[x]="GeneratorFunction")),t.prototype=Object.create(j),t},O.awrap=function(t){return{__await:t}},s(l.prototype),l.prototype[E]=function(){return this},O.AsyncIterator=l,O.async=function(t,e,r,o){var i=new l(n(t,e,r,o));return O.isGeneratorFunction(e)?i:i.next().then(function(t){return t.done?t.value:i.next()})},s(j),j[x]="Generator",j[y]=function(){return this},j.toString=function(){return"[object Generator]"},O.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},O.values=f,d.prototype={constructor:d,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=g,this.done=!1,this.delegate=null,this.method="next",this.arg=g,this.tryEntries.forEach(m),!t)for(var e in this)"t"===e.charAt(0)&&b.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=g)},stop:function(){this.done=!0;var t=this.tryEntries[0],e=t.completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){function e(e,r){return i.type="throw",i.arg=t,n.next=e,r&&(n.method="next",n.arg=g),!!r}if(this.done)throw t;for(var n=this,r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r],i=o.completion;if("root"===o.tryLoc)return e("end");if(o.tryLoc<=this.prev){var a=b.call(o,"catchLoc"),s=b.call(o,"finallyLoc");if(a&&s){if(this.prev<o.catchLoc)return e(o.catchLoc,!0);if(this.prev<o.finallyLoc)return e(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return e(o.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return e(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&b.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,P):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),P},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),m(n),P}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;m(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:f(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=g),P}}}(function(){return this}()||Function("return this")())},function(t,e){},function(t,e){}]);
gutenberg/slideshow/dist/blocks.build.js CHANGED
@@ -1 +1 @@
1
- !function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var n={};e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=0)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});n(1)},function(t,e,n){"use strict";function r(t){return function(){var e=t.apply(this,arguments);return new Promise(function(t,n){function r(i,o){try{var a=e[i](o),s=a.value}catch(t){return void n(t)}if(!a.done)return Promise.resolve(s).then(function(t){r("next",t)},function(t){r("throw",t)});t(s)}return r("next")})}}var i=n(2),o=n.n(i),a=n(5),s=(n.n(a),n(6)),c=(n.n(s),wp.i18n.__),l=wp.blocks.registerBlockType,u=wp.components,p=(u.SelectControl,u.TextControl,wp.editor.RichText,!1);l("opinion-stage/block-os-slideshow",{title:c("Slideshow"),icon:"playlist-video",category:"opinion-stage",keywords:[c("Opinion Stage Slideshow"),c("Opinion Stage Slideshow")],attributes:{embedUrl:{source:"attribute",attribute:"data-test-url",selector:"div[data-test-url]"},lockEmbed:{source:"attribute",attribute:"data-lock-embed",selector:"div[data-lock-embed]"},buttonText:{source:"attribute",attribute:"data-button-text",selector:"div[data-button-text]"},insertItemImage:{source:"attribute",attribute:"data-image-url",selector:"div[data-image-url]"},insertItemOsTitle:{source:"attribute",attribute:"data-title-url",selector:"div[data-title-url]"},insertItemOsView:{source:"attribute",attribute:"data-view-url",selector:"div[data-view-url]"},insertItemOsEdit:{source:"attribute",attribute:"data-edit-url",selector:"div[data-edit-url]"},insertItemOsStatistics:{source:"attribute",attribute:"data-statistics-url",selector:"div[data-statistics-url]"}},edit:function(t){var e=t.attributes,n=e.embedUrl,i=(e.lockEmbed,e.buttonText),a=e.insertItemImage,s=e.insertItemOsTitle,c=e.insertItemOsView,l=e.insertItemOsEdit,u=e.insertItemOsStatistics,m=(t.setAttributes,osGutenData.callbackUrlOs),d=m,f=(osGutenData.getActionUrlOS,osGutenData.getLogoImageLink),h=function(e){window.verifyOSInsert=function(e){var n=this;t.setAttributes({embedUrl:e,buttonText:"Change"});var a=osGutenData.OswpPluginVersion,s=osGutenData.OswpClientToken,c=osGutenData.OswpFetchDataUrl+"?type=slideshow&page=1&per_page=99";fetch(c,{method:"GET",headers:{Accept:"application/vnd.api+json","Content-Type":"application/vnd.api+json","OSWP-Plugin-Version":a,"OSWP-Client-Token":s}}).then(function(){var e=r(o.a.mark(function e(r){var a;return o.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.json();case 2:a=e.sent,a=a.data,p=a,t.setAttributes({buttonText:i});case 6:case"end":return e.stop()}},e,n)}));return function(t){return e.apply(this,arguments)}}()).catch(function(t){console.log("ERROR: "+t.message)})}},g=function(e){t.setAttributes({embedUrl:"",buttonText:"Embed",lockEmbed:!1,insertItemImage:!1,insertItemOsTitle:!1,insertItemOsView:!1,insertItemOsEdit:!1,insertItemOsStatistics:!1})},w=function(t){window.location.replace(d)},v=osGutenData.onCreateButtonClickOs+"?w_type=slideshow&amp;utm_source=wordpress&amp;utm_campaign=WPMainPI&amp;utm_medium=link&amp;o=wp35e8",b=function(t){window.open(v,"_blank").focus()};if(""==osGutenData.isOsConnected)return wp.element.createElement("div",{className:t.className},wp.element.createElement("div",{className:"os-slideshow-wrapper components-placeholder"},wp.element.createElement("p",{className:"components-heading"},wp.element.createElement("img",{src:f,alt:""})),wp.element.createElement("p",{className:"components-heading"},"Please connect WordPress to Opinion Stage to start adding slideshows"),wp.element.createElement("button",{className:"components-button is-button is-default is-block is-primary",onClick:w},"Connect")),wp.element.createElement("div",null));if(jQuery(document).ready(function(jQuery){jQuery("span#oswpLauncherContentPopupslideshow").live("click",function(t){t.preventDefault(),setTimeout(function(){jQuery(".editor-post-save-draft").trigger("click")},500);var e=jQuery(this).attr("data-os-block");jQuery("button#dropbtn span").text(e);for(var n=jQuery(".filter__itm"),r=0;r<n.length;r++){if(jQuery(n[r]).text()==e){setTimeout(function(){jQuery(n[r]).trigger("click")},1e3),setTimeout(function(){jQuery(".progress_message").css("display","none"),jQuery(".content__list").css("display","block")},2500),jQuery("button.content__links-itm").live("click",function(t){jQuery(".tingle-modal.opinionstage-content-popup").hide(),jQuery(".tingle-modal.opinionstage-content-popup.tingle-modal--visible").hide()});break}jQuery(".progress_message").css("display","block"),jQuery(".content__list").css("display","none")}})}),0!=p)for(var y=0;y<p.length;y++){var E=function(t){var e=document.createElement("a");return e.href=t,e}(p[y].attributes["landing-page-url"]),x=E.pathname;if(n==x){t.setAttributes({lockEmbed:!0,buttonText:"Change"}),t.setAttributes({insertItemImage:p[y].attributes["image-url"]}),t.setAttributes({insertItemOsTitle:p[y].attributes.title}),t.setAttributes({insertItemOsView:p[y].attributes["landing-page-url"]}),t.setAttributes({insertItemOsEdit:p[y].attributes["edit-url"]}),t.setAttributes({insertItemOsStatistics:p[y].attributes["stats-url"]});break}}var k=wp.element.createElement("div",{className:"os-slideshow-wrapper components-placeholder"},wp.element.createElement("p",{className:"components-heading"},wp.element.createElement("img",{src:f,alt:""})),wp.element.createElement("span",{id:"oswpLauncherContentPopupslideshow",className:"components-button is-button is-default is-block is-primary","data-opinionstage-content-launch":!0,"data-os-block":"slideshow",onClick:h},"Select a Slideshow"),wp.element.createElement("input",{type:"button",value:"Create a New Slideshow",className:"components-button is-button is-default is-block is-primary",onClick:b}),wp.element.createElement("span",null));return""!=n&&n?"Embed"==i||"Change"==i&&(k=wp.element.createElement("div",{className:"os-slideshow-wrapper components-placeholder"},wp.element.createElement("p",{className:"components-heading"},wp.element.createElement("img",{src:f,alt:""})),wp.element.createElement("div",{className:"components-preview__block"},wp.element.createElement("div",{className:"components-preview__leftBlockImage"},wp.element.createElement("img",{src:a,alt:s,className:"image"}),wp.element.createElement("div",{className:"overlay"},wp.element.createElement("div",{className:"text"},wp.element.createElement("a",{href:c,target:"_blank"}," View "),wp.element.createElement("a",{href:l,target:"_blank"}," Edit "),wp.element.createElement("a",{href:u,target:"_blank"}," Statistics "),wp.element.createElement("input",{type:"button",value:i,className:"components-button is-button is-default is-large left-align",onClick:g})))),wp.element.createElement("div",{className:"components-preview__rightBlockContent"},wp.element.createElement("div",{className:"components-placeholder__label"},"Slideshow: ",s))),wp.element.createElement("span",null))):""==n||"undefined"===jQuery.type(n)||t.setAttributes({buttonText:"Embed"}),wp.element.createElement("div",{className:t.className},k,wp.element.createElement("span",null))},save:function(t){var e=t.attributes,n=e.embedUrl,r=e.lockEmbed,i=e.buttonText,o=e.insertItemImage,a=e.insertItemOsTitle,s=e.insertItemOsView,c=e.insertItemOsEdit,l=e.insertItemOsStatistics;return wp.element.createElement("div",{class:"os-slideshow-wrapper","data-type":"slideshow","data-image-url":o,"data-title-url":a,"data-view-url":s,"data-statistics-url":l,"data-edit-url":c,"data-test-url":n,"data-lock-embed":r,"data-button-text":i},'[os-widget path="',n,'"]',wp.element.createElement("span",null))}})},function(t,e,n){t.exports=n(3)},function(t,e,n){var r=function(){return this}()||Function("return this")(),i=r.regeneratorRuntime&&Object.getOwnPropertyNames(r).indexOf("regeneratorRuntime")>=0,o=i&&r.regeneratorRuntime;if(r.regeneratorRuntime=void 0,t.exports=n(4),i)r.regeneratorRuntime=o;else try{delete r.regeneratorRuntime}catch(t){r.regeneratorRuntime=void 0}},function(t,e){!function(e){"use strict";function n(t,e,n,r){var o=e&&e.prototype instanceof i?e:i,a=Object.create(o.prototype),s=new d(r||[]);return a._invoke=l(t,n,s),a}function r(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}function i(){}function o(){}function a(){}function s(t){["next","throw","return"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function c(t){function e(n,i,o,a){var s=r(t[n],t,i);if("throw"!==s.type){var c=s.arg,l=c.value;return l&&"object"===typeof l&&v.call(l,"__await")?Promise.resolve(l.__await).then(function(t){e("next",t,o,a)},function(t){e("throw",t,o,a)}):Promise.resolve(l).then(function(t){c.value=t,o(c)},a)}a(s.arg)}function n(t,n){function r(){return new Promise(function(r,i){e(t,n,r,i)})}return i=i?i.then(r,r):r()}var i;this._invoke=n}function l(t,e,n){var i=_;return function(o,a){if(i===L)throw new Error("Generator is already running");if(i===N){if("throw"===o)throw a;return h()}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var c=u(s,n);if(c){if(c===T)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===_)throw i=N,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=L;var l=r(t,e,n);if("normal"===l.type){if(i=n.done?N:I,l.arg===T)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i=N,n.method="throw",n.arg=l.arg)}}}function u(t,e){var n=t.iterator[e.method];if(n===g){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=g,u(t,e),"throw"===e.method))return T;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return T}var i=r(n,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,T;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=g),e.delegate=null,T):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,T)}function p(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function m(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function d(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(p,this),this.reset(!0)}function f(t){if(t){var e=t[y];if(e)return e.call(t);if("function"===typeof t.next)return t;if(!isNaN(t.length)){var n=-1,r=function e(){for(;++n<t.length;)if(v.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=g,e.done=!0,e};return r.next=r}}return{next:h}}function h(){return{value:g,done:!0}}var g,w=Object.prototype,v=w.hasOwnProperty,b="function"===typeof Symbol?Symbol:{},y=b.iterator||"@@iterator",E=b.asyncIterator||"@@asyncIterator",x=b.toStringTag||"@@toStringTag",k="object"===typeof t,O=e.regeneratorRuntime;if(O)return void(k&&(t.exports=O));O=e.regeneratorRuntime=k?t.exports:{},O.wrap=n;var _="suspendedStart",I="suspendedYield",L="executing",N="completed",T={},S={};S[y]=function(){return this};var P=Object.getPrototypeOf,C=P&&P(P(f([])));C&&C!==w&&v.call(C,y)&&(S=C);var j=a.prototype=i.prototype=Object.create(S);o.prototype=j.constructor=a,a.constructor=o,a[x]=o.displayName="GeneratorFunction",O.isGeneratorFunction=function(t){var e="function"===typeof t&&t.constructor;return!!e&&(e===o||"GeneratorFunction"===(e.displayName||e.name))},O.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,a):(t.__proto__=a,x in t||(t[x]="GeneratorFunction")),t.prototype=Object.create(j),t},O.awrap=function(t){return{__await:t}},s(c.prototype),c.prototype[E]=function(){return this},O.AsyncIterator=c,O.async=function(t,e,r,i){var o=new c(n(t,e,r,i));return O.isGeneratorFunction(e)?o:o.next().then(function(t){return t.done?t.value:o.next()})},s(j),j[x]="Generator",j[y]=function(){return this},j.toString=function(){return"[object Generator]"},O.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},O.values=f,d.prototype={constructor:d,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=g,this.done=!1,this.delegate=null,this.method="next",this.arg=g,this.tryEntries.forEach(m),!t)for(var e in this)"t"===e.charAt(0)&&v.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=g)},stop:function(){this.done=!0;var t=this.tryEntries[0],e=t.completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){function e(e,r){return o.type="throw",o.arg=t,n.next=e,r&&(n.method="next",n.arg=g),!!r}if(this.done)throw t;for(var n=this,r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r],o=i.completion;if("root"===i.tryLoc)return e("end");if(i.tryLoc<=this.prev){var a=v.call(i,"catchLoc"),s=v.call(i,"finallyLoc");if(a&&s){if(this.prev<i.catchLoc)return e(i.catchLoc,!0);if(this.prev<i.finallyLoc)return e(i.finallyLoc)}else if(a){if(this.prev<i.catchLoc)return e(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return e(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&v.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=t,o.arg=e,i?(this.method="next",this.next=i.finallyLoc,T):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),T},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),m(n),T}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;m(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:f(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=g),T}}}(function(){return this}()||Function("return this")())},function(t,e){},function(t,e){}]);
1
+ !function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var n={};e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=0)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});n(1)},function(t,e,n){"use strict";function r(t){return function(){var e=t.apply(this,arguments);return new Promise(function(t,n){function r(i,o){try{var a=e[i](o),s=a.value}catch(t){return void n(t)}if(!a.done)return Promise.resolve(s).then(function(t){r("next",t)},function(t){r("throw",t)});t(s)}return r("next")})}}var i=n(2),o=n.n(i),a=n(5),s=(n.n(a),n(6)),c=(n.n(s),wp.i18n.__),l=wp.blocks.registerBlockType,u=wp.components,p=(u.SelectControl,u.TextControl,wp.editor.RichText,!1);l("opinion-stage/block-os-slideshow",{title:c("Slideshow"),icon:"playlist-video",category:"opinion-stage",keywords:[c("Opinion Stage Slideshow"),c("Opinion Stage Slideshow")],attributes:{embedUrl:{source:"attribute",attribute:"data-test-url",selector:"div[data-test-url]"},lockEmbed:{source:"attribute",attribute:"data-lock-embed",selector:"div[data-lock-embed]"},buttonText:{source:"attribute",attribute:"data-button-text",selector:"div[data-button-text]"},insertItemImage:{source:"attribute",attribute:"data-image-url",selector:"div[data-image-url]"},insertItemOsTitle:{source:"attribute",attribute:"data-title-url",selector:"div[data-title-url]"},insertItemOsView:{source:"attribute",attribute:"data-view-url",selector:"div[data-view-url]"},insertItemOsEdit:{source:"attribute",attribute:"data-edit-url",selector:"div[data-edit-url]"},insertItemOsStatistics:{source:"attribute",attribute:"data-statistics-url",selector:"div[data-statistics-url]"}},edit:function(t){var e=t.attributes,n=e.embedUrl,i=(e.lockEmbed,e.buttonText),a=e.insertItemImage,s=e.insertItemOsTitle,c=e.insertItemOsView,l=e.insertItemOsEdit,u=e.insertItemOsStatistics,m=(t.setAttributes,osGutenData.callbackUrlOs),d=m,f=(osGutenData.getActionUrlOS,osGutenData.getLogoImageLink),h=function(e){window.verifyOSInsert=function(e){var n=this;t.setAttributes({embedUrl:e,buttonText:"Change"});var a=osGutenData.OswpPluginVersion,s=osGutenData.OswpClientToken,c=osGutenData.OswpFetchDataUrl+"?type=slideshow&page=1&per_page=99";fetch(c,{method:"GET",headers:{Accept:"application/vnd.api+json","Content-Type":"application/vnd.api+json","OSWP-Plugin-Version":a,"OSWP-Client-Token":s}}).then(function(){var e=r(o.a.mark(function e(r){var a;return o.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.json();case 2:a=e.sent,a=a.data,p=a,t.setAttributes({buttonText:i});case 6:case"end":return e.stop()}},e,n)}));return function(t){return e.apply(this,arguments)}}()).catch(function(t){console.log("ERROR: "+t.message)})}},g=function(e){t.setAttributes({embedUrl:"",buttonText:"Embed",lockEmbed:!1,insertItemImage:!1,insertItemOsTitle:!1,insertItemOsView:!1,insertItemOsEdit:!1,insertItemOsStatistics:!1})},w=function(t){window.location.replace(d)},v=osGutenData.onCreateButtonClickOs+"?w_type=slideshow&amp;utm_source=wordpress&amp;utm_campaign=WPMainPI&amp;utm_medium=link&amp;o=wp35e8",b=function(t){window.open(v,"_blank").focus()};if(""==osGutenData.isOsConnected)return wp.element.createElement("div",{className:t.className},wp.element.createElement("div",{className:"os-slideshow-wrapper components-placeholder"},wp.element.createElement("p",{className:"components-heading"},wp.element.createElement("img",{src:f,alt:""})),wp.element.createElement("p",{className:"components-heading"},"Please connect WordPress to Opinion Stage to start adding slideshows"),wp.element.createElement("button",{className:"components-button is-button is-default is-block is-primary",onClick:w},"Connect")),wp.element.createElement("div",null));if(jQuery(document).ready(function(jQuery){jQuery("span#oswpLauncherContentPopupslideshow").on("click",null,function(t){t.preventDefault(),setTimeout(function(){jQuery(".editor-post-save-draft").trigger("click")},500);var e=jQuery(this).attr("data-os-block");jQuery("button#dropbtn span").text(e);for(var n=jQuery(".filter__itm"),r=0;r<n.length;r++){if(jQuery(n[r]).text()==e){setTimeout(function(){jQuery(n[r]).trigger("click")},1e3),setTimeout(function(){jQuery(".progress_message").css("display","none"),jQuery(".content__list").css("display","block")},2500),jQuery("button.content__links-itm").on("click",null,function(t){jQuery(".tingle-modal.opinionstage-content-popup").hide(),jQuery(".tingle-modal.opinionstage-content-popup.tingle-modal--visible").hide()});break}jQuery(".progress_message").css("display","block"),jQuery(".content__list").css("display","none")}})}),0!=p)for(var y=0;y<p.length;y++){var E=function(t){var e=document.createElement("a");return e.href=t,e}(p[y].attributes["landing-page-url"]),x=E.pathname;if(n==x){t.setAttributes({lockEmbed:!0,buttonText:"Change"}),t.setAttributes({insertItemImage:p[y].attributes["image-url"]}),t.setAttributes({insertItemOsTitle:p[y].attributes.title}),t.setAttributes({insertItemOsView:p[y].attributes["landing-page-url"]}),t.setAttributes({insertItemOsEdit:p[y].attributes["edit-url"]}),t.setAttributes({insertItemOsStatistics:p[y].attributes["stats-url"]});break}}var k=wp.element.createElement("div",{className:"os-slideshow-wrapper components-placeholder"},wp.element.createElement("p",{className:"components-heading"},wp.element.createElement("img",{src:f,alt:""})),wp.element.createElement("span",{id:"oswpLauncherContentPopupslideshow",className:"components-button is-button is-default is-block is-primary","data-opinionstage-content-launch":!0,"data-os-block":"slideshow",onClick:h},"Select a Slideshow"),wp.element.createElement("input",{type:"button",value:"Create a New Slideshow",className:"components-button is-button is-default is-block is-primary",onClick:b}),wp.element.createElement("span",null));return""!=n&&n?"Embed"==i||"Change"==i&&(k=wp.element.createElement("div",{className:"os-slideshow-wrapper components-placeholder"},wp.element.createElement("p",{className:"components-heading"},wp.element.createElement("img",{src:f,alt:""})),wp.element.createElement("div",{className:"components-preview__block"},wp.element.createElement("div",{className:"components-preview__leftBlockImage"},wp.element.createElement("img",{src:a,alt:s,className:"image"}),wp.element.createElement("div",{className:"overlay"},wp.element.createElement("div",{className:"text"},wp.element.createElement("a",{href:c,target:"_blank"}," View "),wp.element.createElement("a",{href:l,target:"_blank"}," Edit "),wp.element.createElement("a",{href:u,target:"_blank"}," Statistics "),wp.element.createElement("input",{type:"button",value:i,className:"components-button is-button is-default is-large left-align",onClick:g})))),wp.element.createElement("div",{className:"components-preview__rightBlockContent"},wp.element.createElement("div",{className:"components-placeholder__label"},"Slideshow: ",s))),wp.element.createElement("span",null))):""==n||"undefined"===jQuery.type(n)||t.setAttributes({buttonText:"Embed"}),wp.element.createElement("div",{className:t.className},k,wp.element.createElement("span",null))},save:function(t){var e=t.attributes,n=e.embedUrl,r=e.lockEmbed,i=e.buttonText,o=e.insertItemImage,a=e.insertItemOsTitle,s=e.insertItemOsView,c=e.insertItemOsEdit,l=e.insertItemOsStatistics;return wp.element.createElement("div",{class:"os-slideshow-wrapper","data-type":"slideshow","data-image-url":o,"data-title-url":a,"data-view-url":s,"data-statistics-url":l,"data-edit-url":c,"data-test-url":n,"data-lock-embed":r,"data-button-text":i},'[os-widget path="',n,'"]',wp.element.createElement("span",null))}})},function(t,e,n){t.exports=n(3)},function(t,e,n){var r=function(){return this}()||Function("return this")(),i=r.regeneratorRuntime&&Object.getOwnPropertyNames(r).indexOf("regeneratorRuntime")>=0,o=i&&r.regeneratorRuntime;if(r.regeneratorRuntime=void 0,t.exports=n(4),i)r.regeneratorRuntime=o;else try{delete r.regeneratorRuntime}catch(t){r.regeneratorRuntime=void 0}},function(t,e){!function(e){"use strict";function n(t,e,n,r){var o=e&&e.prototype instanceof i?e:i,a=Object.create(o.prototype),s=new d(r||[]);return a._invoke=l(t,n,s),a}function r(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}function i(){}function o(){}function a(){}function s(t){["next","throw","return"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function c(t){function e(n,i,o,a){var s=r(t[n],t,i);if("throw"!==s.type){var c=s.arg,l=c.value;return l&&"object"===typeof l&&v.call(l,"__await")?Promise.resolve(l.__await).then(function(t){e("next",t,o,a)},function(t){e("throw",t,o,a)}):Promise.resolve(l).then(function(t){c.value=t,o(c)},a)}a(s.arg)}function n(t,n){function r(){return new Promise(function(r,i){e(t,n,r,i)})}return i=i?i.then(r,r):r()}var i;this._invoke=n}function l(t,e,n){var i=_;return function(o,a){if(i===L)throw new Error("Generator is already running");if(i===N){if("throw"===o)throw a;return h()}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var c=u(s,n);if(c){if(c===T)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===_)throw i=N,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=L;var l=r(t,e,n);if("normal"===l.type){if(i=n.done?N:I,l.arg===T)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i=N,n.method="throw",n.arg=l.arg)}}}function u(t,e){var n=t.iterator[e.method];if(n===g){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=g,u(t,e),"throw"===e.method))return T;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return T}var i=r(n,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,T;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=g),e.delegate=null,T):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,T)}function p(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function m(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function d(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(p,this),this.reset(!0)}function f(t){if(t){var e=t[y];if(e)return e.call(t);if("function"===typeof t.next)return t;if(!isNaN(t.length)){var n=-1,r=function e(){for(;++n<t.length;)if(v.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=g,e.done=!0,e};return r.next=r}}return{next:h}}function h(){return{value:g,done:!0}}var g,w=Object.prototype,v=w.hasOwnProperty,b="function"===typeof Symbol?Symbol:{},y=b.iterator||"@@iterator",E=b.asyncIterator||"@@asyncIterator",x=b.toStringTag||"@@toStringTag",k="object"===typeof t,O=e.regeneratorRuntime;if(O)return void(k&&(t.exports=O));O=e.regeneratorRuntime=k?t.exports:{},O.wrap=n;var _="suspendedStart",I="suspendedYield",L="executing",N="completed",T={},S={};S[y]=function(){return this};var P=Object.getPrototypeOf,C=P&&P(P(f([])));C&&C!==w&&v.call(C,y)&&(S=C);var j=a.prototype=i.prototype=Object.create(S);o.prototype=j.constructor=a,a.constructor=o,a[x]=o.displayName="GeneratorFunction",O.isGeneratorFunction=function(t){var e="function"===typeof t&&t.constructor;return!!e&&(e===o||"GeneratorFunction"===(e.displayName||e.name))},O.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,a):(t.__proto__=a,x in t||(t[x]="GeneratorFunction")),t.prototype=Object.create(j),t},O.awrap=function(t){return{__await:t}},s(c.prototype),c.prototype[E]=function(){return this},O.AsyncIterator=c,O.async=function(t,e,r,i){var o=new c(n(t,e,r,i));return O.isGeneratorFunction(e)?o:o.next().then(function(t){return t.done?t.value:o.next()})},s(j),j[x]="Generator",j[y]=function(){return this},j.toString=function(){return"[object Generator]"},O.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},O.values=f,d.prototype={constructor:d,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=g,this.done=!1,this.delegate=null,this.method="next",this.arg=g,this.tryEntries.forEach(m),!t)for(var e in this)"t"===e.charAt(0)&&v.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=g)},stop:function(){this.done=!0;var t=this.tryEntries[0],e=t.completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){function e(e,r){return o.type="throw",o.arg=t,n.next=e,r&&(n.method="next",n.arg=g),!!r}if(this.done)throw t;for(var n=this,r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r],o=i.completion;if("root"===i.tryLoc)return e("end");if(i.tryLoc<=this.prev){var a=v.call(i,"catchLoc"),s=v.call(i,"finallyLoc");if(a&&s){if(this.prev<i.catchLoc)return e(i.catchLoc,!0);if(this.prev<i.finallyLoc)return e(i.finallyLoc)}else if(a){if(this.prev<i.catchLoc)return e(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return e(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&v.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=t,o.arg=e,i?(this.method="next",this.next=i.finallyLoc,T):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),T},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),m(n),T}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;m(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:f(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=g),T}}}(function(){return this}()||Function("return this")())},function(t,e){},function(t,e){}]);
gutenberg/survey/dist/blocks.build.js CHANGED
@@ -1 +1 @@
1
- !function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var n={};e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=0)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});n(1)},function(t,e,n){"use strict";function r(t){return function(){var e=t.apply(this,arguments);return new Promise(function(t,n){function r(i,o){try{var a=e[i](o),s=a.value}catch(t){return void n(t)}if(!a.done)return Promise.resolve(s).then(function(t){r("next",t)},function(t){r("throw",t)});t(s)}return r("next")})}}var i=n(2),o=n.n(i),a=n(5),s=(n.n(a),n(6)),c=(n.n(s),wp.i18n.__),u=wp.blocks.registerBlockType,l=wp.components,p=(l.SelectControl,l.TextControl,wp.editor.RichText,!1);u("opinion-stage/block-os-survey",{title:c("Survey"),icon:"list-view",category:"opinion-stage",keywords:[c("Opinion Stage Survey"),c("Opinion Stage Survey")],attributes:{embedUrl:{source:"attribute",attribute:"data-test-url",selector:"div[data-test-url]"},lockEmbed:{source:"attribute",attribute:"data-lock-embed",selector:"div[data-lock-embed]"},buttonText:{source:"attribute",attribute:"data-button-text",selector:"div[data-button-text]"},insertItemImage:{source:"attribute",attribute:"data-image-url",selector:"div[data-image-url]"},insertItemOsTitle:{source:"attribute",attribute:"data-title-url",selector:"div[data-title-url]"},insertItemOsView:{source:"attribute",attribute:"data-view-url",selector:"div[data-view-url]"},insertItemOsEdit:{source:"attribute",attribute:"data-edit-url",selector:"div[data-edit-url]"},insertItemOsStatistics:{source:"attribute",attribute:"data-statistics-url",selector:"div[data-statistics-url]"}},edit:function(t){var e=t.attributes,n=e.embedUrl,i=(e.lockEmbed,e.buttonText),a=e.insertItemImage,s=e.insertItemOsTitle,c=e.insertItemOsView,u=e.insertItemOsEdit,l=e.insertItemOsStatistics,m=(t.setAttributes,osGutenData.callbackUrlOs),d=m,f=(osGutenData.getActionUrlOS,osGutenData.getLogoImageLink),h=function(e){window.verifyOSInsert=function(e){var n=this;t.setAttributes({embedUrl:e,buttonText:"Change"});var a=osGutenData.OswpPluginVersion,s=osGutenData.OswpClientToken,c=osGutenData.OswpFetchDataUrl+"?type=survey&page=1&per_page=99";fetch(c,{method:"GET",headers:{Accept:"application/vnd.api+json","Content-Type":"application/vnd.api+json","OSWP-Plugin-Version":a,"OSWP-Client-Token":s}}).then(function(){var e=r(o.a.mark(function e(r){var a;return o.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.json();case 2:a=e.sent,a=a.data,p=a,t.setAttributes({buttonText:i});case 6:case"end":return e.stop()}},e,n)}));return function(t){return e.apply(this,arguments)}}()).catch(function(t){console.log("ERROR: "+t.message)})}},v=function(e){t.setAttributes({embedUrl:"",buttonText:"Embed",lockEmbed:!1,insertItemImage:!1,insertItemOsTitle:!1,insertItemOsView:!1,insertItemOsEdit:!1,insertItemOsStatistics:!1})},g=function(t){window.location.replace(d)},y=osGutenData.onCreateButtonClickOs+"?w_type=survey&amp;utm_source=wordpress&amp;utm_campaign=WPMainPI&amp;utm_medium=link&amp;o=wp35e8",b=function(t){window.open(y,"_blank").focus()};if(""==osGutenData.isOsConnected)return wp.element.createElement("div",{className:t.className},wp.element.createElement("div",{className:"os-survey-wrapper components-placeholder"},wp.element.createElement("p",{className:"components-heading"},wp.element.createElement("img",{src:f,alt:""})),wp.element.createElement("p",{className:"components-heading"},"Please connect WordPress to Opinion Stage to start adding surveys"),wp.element.createElement("button",{className:"components-button is-button is-default is-block is-primary",onClick:g},"Connect")),wp.element.createElement("div",null));if(jQuery(document).ready(function(){jQuery("span#oswpLauncherContentPopupsurvey").live("click",function(t){t.preventDefault(),setTimeout(function(){jQuery(".editor-post-save-draft").trigger("click")},500);var e=jQuery(this).attr("data-os-block");jQuery("button#dropbtn span").text(e);for(var n=jQuery(".filter__itm"),r=0;r<n.length;r++){if(jQuery(n[r]).text()==e){setTimeout(function(){jQuery(n[r]).trigger("click")},1e3),setTimeout(function(){jQuery(".progress_message").css("display","none"),jQuery(".content__list").css("display","block")},2500),jQuery("button.content__links-itm").live("click",function(t){jQuery(".tingle-modal.opinionstage-content-popup").hide(),jQuery(".tingle-modal.opinionstage-content-popup.tingle-modal--visible").hide()});break}jQuery(".progress_message").css("display","block"),jQuery(".content__list").css("display","none")}})}),0!=p)for(var w=0;w<p.length;w++){var E=function(t){var e=document.createElement("a");return e.href=t,e}(p[w].attributes["landing-page-url"]),x=E.pathname;if(n==x){t.setAttributes({lockEmbed:!0,buttonText:"Change"}),t.setAttributes({insertItemImage:p[w].attributes["image-url"]}),t.setAttributes({insertItemOsTitle:p[w].attributes.title}),t.setAttributes({insertItemOsView:p[w].attributes["landing-page-url"]}),t.setAttributes({insertItemOsEdit:p[w].attributes["edit-url"]}),t.setAttributes({insertItemOsStatistics:p[w].attributes["stats-url"]});break}}var k=wp.element.createElement("div",{className:"os-survey-wrapper components-placeholder"},wp.element.createElement("p",{className:"components-heading"},wp.element.createElement("img",{src:f,alt:""})),wp.element.createElement("span",{id:"oswpLauncherContentPopupsurvey",className:"components-button is-button is-default is-block is-primary","data-opinionstage-content-launch":!0,"data-os-block":"survey",onClick:h},"Select a Survey"),wp.element.createElement("input",{type:"button",value:"Create a New survey",className:"components-button is-button is-default is-block is-primary",onClick:b}),wp.element.createElement("span",null));return""!=n&&n?"Embed"==i||"Change"==i&&(k=wp.element.createElement("div",{className:"os-survey-wrapper components-placeholder"},wp.element.createElement("p",{className:"components-heading"},wp.element.createElement("img",{src:f,alt:""})),wp.element.createElement("div",{className:"components-preview__block"},wp.element.createElement("div",{className:"components-preview__leftBlockImage"},wp.element.createElement("img",{src:a,alt:s,className:"image"}),wp.element.createElement("div",{className:"overlay"},wp.element.createElement("div",{className:"text"},wp.element.createElement("a",{href:c,target:"_blank"}," View "),wp.element.createElement("a",{href:u,target:"_blank"}," Edit "),wp.element.createElement("a",{href:l,target:"_blank"}," Statistics "),wp.element.createElement("input",{type:"button",value:i,className:"components-button is-button is-default is-large left-align",onClick:v})))),wp.element.createElement("div",{className:"components-preview__rightBlockContent"},wp.element.createElement("div",{className:"components-placeholder__label"},"Survey: ",s))),wp.element.createElement("span",null))):""==n||"undefined"===jQuery.type(n)||t.setAttributes({buttonText:"Embed"}),wp.element.createElement("div",{className:t.className},k,wp.element.createElement("span",null))},save:function(t){var e=t.attributes,n=e.embedUrl,r=e.lockEmbed,i=e.buttonText,o=e.insertItemImage,a=e.insertItemOsTitle,s=e.insertItemOsView,c=e.insertItemOsEdit,u=e.insertItemOsStatistics;return wp.element.createElement("div",{class:"os-survey-wrapper","data-type":"survey","data-image-url":o,"data-title-url":a,"data-view-url":s,"data-statistics-url":u,"data-edit-url":c,"data-test-url":n,"data-lock-embed":r,"data-button-text":i},'[os-widget path="',n,'"]',wp.element.createElement("span",null))}})},function(t,e,n){t.exports=n(3)},function(t,e,n){var r=function(){return this}()||Function("return this")(),i=r.regeneratorRuntime&&Object.getOwnPropertyNames(r).indexOf("regeneratorRuntime")>=0,o=i&&r.regeneratorRuntime;if(r.regeneratorRuntime=void 0,t.exports=n(4),i)r.regeneratorRuntime=o;else try{delete r.regeneratorRuntime}catch(t){r.regeneratorRuntime=void 0}},function(t,e){!function(e){"use strict";function n(t,e,n,r){var o=e&&e.prototype instanceof i?e:i,a=Object.create(o.prototype),s=new d(r||[]);return a._invoke=u(t,n,s),a}function r(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}function i(){}function o(){}function a(){}function s(t){["next","throw","return"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function c(t){function e(n,i,o,a){var s=r(t[n],t,i);if("throw"!==s.type){var c=s.arg,u=c.value;return u&&"object"===typeof u&&y.call(u,"__await")?Promise.resolve(u.__await).then(function(t){e("next",t,o,a)},function(t){e("throw",t,o,a)}):Promise.resolve(u).then(function(t){c.value=t,o(c)},a)}a(s.arg)}function n(t,n){function r(){return new Promise(function(r,i){e(t,n,r,i)})}return i=i?i.then(r,r):r()}var i;this._invoke=n}function u(t,e,n){var i=_;return function(o,a){if(i===L)throw new Error("Generator is already running");if(i===N){if("throw"===o)throw a;return h()}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var c=l(s,n);if(c){if(c===T)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===_)throw i=N,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=L;var u=r(t,e,n);if("normal"===u.type){if(i=n.done?N:I,u.arg===T)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(i=N,n.method="throw",n.arg=u.arg)}}}function l(t,e){var n=t.iterator[e.method];if(n===v){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=v,l(t,e),"throw"===e.method))return T;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return T}var i=r(n,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,T;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=v),e.delegate=null,T):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,T)}function p(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function m(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function d(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(p,this),this.reset(!0)}function f(t){if(t){var e=t[w];if(e)return e.call(t);if("function"===typeof t.next)return t;if(!isNaN(t.length)){var n=-1,r=function e(){for(;++n<t.length;)if(y.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=v,e.done=!0,e};return r.next=r}}return{next:h}}function h(){return{value:v,done:!0}}var v,g=Object.prototype,y=g.hasOwnProperty,b="function"===typeof Symbol?Symbol:{},w=b.iterator||"@@iterator",E=b.asyncIterator||"@@asyncIterator",x=b.toStringTag||"@@toStringTag",k="object"===typeof t,O=e.regeneratorRuntime;if(O)return void(k&&(t.exports=O));O=e.regeneratorRuntime=k?t.exports:{},O.wrap=n;var _="suspendedStart",I="suspendedYield",L="executing",N="completed",T={},S={};S[w]=function(){return this};var P=Object.getPrototypeOf,C=P&&P(P(f([])));C&&C!==g&&y.call(C,w)&&(S=C);var j=a.prototype=i.prototype=Object.create(S);o.prototype=j.constructor=a,a.constructor=o,a[x]=o.displayName="GeneratorFunction",O.isGeneratorFunction=function(t){var e="function"===typeof t&&t.constructor;return!!e&&(e===o||"GeneratorFunction"===(e.displayName||e.name))},O.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,a):(t.__proto__=a,x in t||(t[x]="GeneratorFunction")),t.prototype=Object.create(j),t},O.awrap=function(t){return{__await:t}},s(c.prototype),c.prototype[E]=function(){return this},O.AsyncIterator=c,O.async=function(t,e,r,i){var o=new c(n(t,e,r,i));return O.isGeneratorFunction(e)?o:o.next().then(function(t){return t.done?t.value:o.next()})},s(j),j[x]="Generator",j[w]=function(){return this},j.toString=function(){return"[object Generator]"},O.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},O.values=f,d.prototype={constructor:d,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=v,this.done=!1,this.delegate=null,this.method="next",this.arg=v,this.tryEntries.forEach(m),!t)for(var e in this)"t"===e.charAt(0)&&y.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=v)},stop:function(){this.done=!0;var t=this.tryEntries[0],e=t.completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){function e(e,r){return o.type="throw",o.arg=t,n.next=e,r&&(n.method="next",n.arg=v),!!r}if(this.done)throw t;for(var n=this,r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r],o=i.completion;if("root"===i.tryLoc)return e("end");if(i.tryLoc<=this.prev){var a=y.call(i,"catchLoc"),s=y.call(i,"finallyLoc");if(a&&s){if(this.prev<i.catchLoc)return e(i.catchLoc,!0);if(this.prev<i.finallyLoc)return e(i.finallyLoc)}else if(a){if(this.prev<i.catchLoc)return e(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return e(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&y.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=t,o.arg=e,i?(this.method="next",this.next=i.finallyLoc,T):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),T},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),m(n),T}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;m(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:f(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=v),T}}}(function(){return this}()||Function("return this")())},function(t,e){},function(t,e){}]);
1
+ !function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var n={};e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=0)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});n(1)},function(t,e,n){"use strict";function r(t){return function(){var e=t.apply(this,arguments);return new Promise(function(t,n){function r(i,o){try{var a=e[i](o),s=a.value}catch(t){return void n(t)}if(!a.done)return Promise.resolve(s).then(function(t){r("next",t)},function(t){r("throw",t)});t(s)}return r("next")})}}var i=n(2),o=n.n(i),a=n(5),s=(n.n(a),n(6)),c=(n.n(s),wp.i18n.__),u=wp.blocks.registerBlockType,l=wp.components,p=(l.SelectControl,l.TextControl,wp.editor.RichText,!1);u("opinion-stage/block-os-survey",{title:c("Survey"),icon:"list-view",category:"opinion-stage",keywords:[c("Opinion Stage Survey"),c("Opinion Stage Survey")],attributes:{embedUrl:{source:"attribute",attribute:"data-test-url",selector:"div[data-test-url]"},lockEmbed:{source:"attribute",attribute:"data-lock-embed",selector:"div[data-lock-embed]"},buttonText:{source:"attribute",attribute:"data-button-text",selector:"div[data-button-text]"},insertItemImage:{source:"attribute",attribute:"data-image-url",selector:"div[data-image-url]"},insertItemOsTitle:{source:"attribute",attribute:"data-title-url",selector:"div[data-title-url]"},insertItemOsView:{source:"attribute",attribute:"data-view-url",selector:"div[data-view-url]"},insertItemOsEdit:{source:"attribute",attribute:"data-edit-url",selector:"div[data-edit-url]"},insertItemOsStatistics:{source:"attribute",attribute:"data-statistics-url",selector:"div[data-statistics-url]"}},edit:function(t){var e=t.attributes,n=e.embedUrl,i=(e.lockEmbed,e.buttonText),a=e.insertItemImage,s=e.insertItemOsTitle,c=e.insertItemOsView,u=e.insertItemOsEdit,l=e.insertItemOsStatistics,m=(t.setAttributes,osGutenData.callbackUrlOs),d=m,f=(osGutenData.getActionUrlOS,osGutenData.getLogoImageLink),h=function(e){window.verifyOSInsert=function(e){var n=this;t.setAttributes({embedUrl:e,buttonText:"Change"});var a=osGutenData.OswpPluginVersion,s=osGutenData.OswpClientToken,c=osGutenData.OswpFetchDataUrl+"?type=survey&page=1&per_page=99";fetch(c,{method:"GET",headers:{Accept:"application/vnd.api+json","Content-Type":"application/vnd.api+json","OSWP-Plugin-Version":a,"OSWP-Client-Token":s}}).then(function(){var e=r(o.a.mark(function e(r){var a;return o.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.json();case 2:a=e.sent,a=a.data,p=a,t.setAttributes({buttonText:i});case 6:case"end":return e.stop()}},e,n)}));return function(t){return e.apply(this,arguments)}}()).catch(function(t){console.log("ERROR: "+t.message)})}},v=function(e){t.setAttributes({embedUrl:"",buttonText:"Embed",lockEmbed:!1,insertItemImage:!1,insertItemOsTitle:!1,insertItemOsView:!1,insertItemOsEdit:!1,insertItemOsStatistics:!1})},g=function(t){window.location.replace(d)},y=osGutenData.onCreateButtonClickOs+"?w_type=survey&amp;utm_source=wordpress&amp;utm_campaign=WPMainPI&amp;utm_medium=link&amp;o=wp35e8",b=function(t){window.open(y,"_blank").focus()};if(""==osGutenData.isOsConnected)return wp.element.createElement("div",{className:t.className},wp.element.createElement("div",{className:"os-survey-wrapper components-placeholder"},wp.element.createElement("p",{className:"components-heading"},wp.element.createElement("img",{src:f,alt:""})),wp.element.createElement("p",{className:"components-heading"},"Please connect WordPress to Opinion Stage to start adding surveys"),wp.element.createElement("button",{className:"components-button is-button is-default is-block is-primary",onClick:g},"Connect")),wp.element.createElement("div",null));if(jQuery(document).ready(function(){jQuery("span#oswpLauncherContentPopupsurvey").on("click",null,function(t){t.preventDefault(),setTimeout(function(){jQuery(".editor-post-save-draft").trigger("click")},500);var e=jQuery(this).attr("data-os-block");jQuery("button#dropbtn span").text(e);for(var n=jQuery(".filter__itm"),r=0;r<n.length;r++){if(jQuery(n[r]).text()==e){setTimeout(function(){jQuery(n[r]).trigger("click")},1e3),setTimeout(function(){jQuery(".progress_message").css("display","none"),jQuery(".content__list").css("display","block")},2500),jQuery("button.content__links-itm").on("click",null,function(t){jQuery(".tingle-modal.opinionstage-content-popup").hide(),jQuery(".tingle-modal.opinionstage-content-popup.tingle-modal--visible").hide()});break}jQuery(".progress_message").css("display","block"),jQuery(".content__list").css("display","none")}})}),0!=p)for(var w=0;w<p.length;w++){var E=function(t){var e=document.createElement("a");return e.href=t,e}(p[w].attributes["landing-page-url"]),x=E.pathname;if(n==x){t.setAttributes({lockEmbed:!0,buttonText:"Change"}),t.setAttributes({insertItemImage:p[w].attributes["image-url"]}),t.setAttributes({insertItemOsTitle:p[w].attributes.title}),t.setAttributes({insertItemOsView:p[w].attributes["landing-page-url"]}),t.setAttributes({insertItemOsEdit:p[w].attributes["edit-url"]}),t.setAttributes({insertItemOsStatistics:p[w].attributes["stats-url"]});break}}var k=wp.element.createElement("div",{className:"os-survey-wrapper components-placeholder"},wp.element.createElement("p",{className:"components-heading"},wp.element.createElement("img",{src:f,alt:""})),wp.element.createElement("span",{id:"oswpLauncherContentPopupsurvey",className:"components-button is-button is-default is-block is-primary","data-opinionstage-content-launch":!0,"data-os-block":"survey",onClick:h},"Select a Survey"),wp.element.createElement("input",{type:"button",value:"Create a New survey",className:"components-button is-button is-default is-block is-primary",onClick:b}),wp.element.createElement("span",null));return""!=n&&n?"Embed"==i||"Change"==i&&(k=wp.element.createElement("div",{className:"os-survey-wrapper components-placeholder"},wp.element.createElement("p",{className:"components-heading"},wp.element.createElement("img",{src:f,alt:""})),wp.element.createElement("div",{className:"components-preview__block"},wp.element.createElement("div",{className:"components-preview__leftBlockImage"},wp.element.createElement("img",{src:a,alt:s,className:"image"}),wp.element.createElement("div",{className:"overlay"},wp.element.createElement("div",{className:"text"},wp.element.createElement("a",{href:c,target:"_blank"}," View "),wp.element.createElement("a",{href:u,target:"_blank"}," Edit "),wp.element.createElement("a",{href:l,target:"_blank"}," Statistics "),wp.element.createElement("input",{type:"button",value:i,className:"components-button is-button is-default is-large left-align",onClick:v})))),wp.element.createElement("div",{className:"components-preview__rightBlockContent"},wp.element.createElement("div",{className:"components-placeholder__label"},"Survey: ",s))),wp.element.createElement("span",null))):""==n||"undefined"===jQuery.type(n)||t.setAttributes({buttonText:"Embed"}),wp.element.createElement("div",{className:t.className},k,wp.element.createElement("span",null))},save:function(t){var e=t.attributes,n=e.embedUrl,r=e.lockEmbed,i=e.buttonText,o=e.insertItemImage,a=e.insertItemOsTitle,s=e.insertItemOsView,c=e.insertItemOsEdit,u=e.insertItemOsStatistics;return wp.element.createElement("div",{class:"os-survey-wrapper","data-type":"survey","data-image-url":o,"data-title-url":a,"data-view-url":s,"data-statistics-url":u,"data-edit-url":c,"data-test-url":n,"data-lock-embed":r,"data-button-text":i},'[os-widget path="',n,'"]',wp.element.createElement("span",null))}})},function(t,e,n){t.exports=n(3)},function(t,e,n){var r=function(){return this}()||Function("return this")(),i=r.regeneratorRuntime&&Object.getOwnPropertyNames(r).indexOf("regeneratorRuntime")>=0,o=i&&r.regeneratorRuntime;if(r.regeneratorRuntime=void 0,t.exports=n(4),i)r.regeneratorRuntime=o;else try{delete r.regeneratorRuntime}catch(t){r.regeneratorRuntime=void 0}},function(t,e){!function(e){"use strict";function n(t,e,n,r){var o=e&&e.prototype instanceof i?e:i,a=Object.create(o.prototype),s=new d(r||[]);return a._invoke=u(t,n,s),a}function r(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}function i(){}function o(){}function a(){}function s(t){["next","throw","return"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function c(t){function e(n,i,o,a){var s=r(t[n],t,i);if("throw"!==s.type){var c=s.arg,u=c.value;return u&&"object"===typeof u&&y.call(u,"__await")?Promise.resolve(u.__await).then(function(t){e("next",t,o,a)},function(t){e("throw",t,o,a)}):Promise.resolve(u).then(function(t){c.value=t,o(c)},a)}a(s.arg)}function n(t,n){function r(){return new Promise(function(r,i){e(t,n,r,i)})}return i=i?i.then(r,r):r()}var i;this._invoke=n}function u(t,e,n){var i=_;return function(o,a){if(i===L)throw new Error("Generator is already running");if(i===N){if("throw"===o)throw a;return h()}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var c=l(s,n);if(c){if(c===T)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===_)throw i=N,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=L;var u=r(t,e,n);if("normal"===u.type){if(i=n.done?N:I,u.arg===T)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(i=N,n.method="throw",n.arg=u.arg)}}}function l(t,e){var n=t.iterator[e.method];if(n===v){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=v,l(t,e),"throw"===e.method))return T;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return T}var i=r(n,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,T;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=v),e.delegate=null,T):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,T)}function p(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function m(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function d(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(p,this),this.reset(!0)}function f(t){if(t){var e=t[w];if(e)return e.call(t);if("function"===typeof t.next)return t;if(!isNaN(t.length)){var n=-1,r=function e(){for(;++n<t.length;)if(y.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=v,e.done=!0,e};return r.next=r}}return{next:h}}function h(){return{value:v,done:!0}}var v,g=Object.prototype,y=g.hasOwnProperty,b="function"===typeof Symbol?Symbol:{},w=b.iterator||"@@iterator",E=b.asyncIterator||"@@asyncIterator",x=b.toStringTag||"@@toStringTag",k="object"===typeof t,O=e.regeneratorRuntime;if(O)return void(k&&(t.exports=O));O=e.regeneratorRuntime=k?t.exports:{},O.wrap=n;var _="suspendedStart",I="suspendedYield",L="executing",N="completed",T={},S={};S[w]=function(){return this};var P=Object.getPrototypeOf,C=P&&P(P(f([])));C&&C!==g&&y.call(C,w)&&(S=C);var j=a.prototype=i.prototype=Object.create(S);o.prototype=j.constructor=a,a.constructor=o,a[x]=o.displayName="GeneratorFunction",O.isGeneratorFunction=function(t){var e="function"===typeof t&&t.constructor;return!!e&&(e===o||"GeneratorFunction"===(e.displayName||e.name))},O.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,a):(t.__proto__=a,x in t||(t[x]="GeneratorFunction")),t.prototype=Object.create(j),t},O.awrap=function(t){return{__await:t}},s(c.prototype),c.prototype[E]=function(){return this},O.AsyncIterator=c,O.async=function(t,e,r,i){var o=new c(n(t,e,r,i));return O.isGeneratorFunction(e)?o:o.next().then(function(t){return t.done?t.value:o.next()})},s(j),j[x]="Generator",j[w]=function(){return this},j.toString=function(){return"[object Generator]"},O.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},O.values=f,d.prototype={constructor:d,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=v,this.done=!1,this.delegate=null,this.method="next",this.arg=v,this.tryEntries.forEach(m),!t)for(var e in this)"t"===e.charAt(0)&&y.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=v)},stop:function(){this.done=!0;var t=this.tryEntries[0],e=t.completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){function e(e,r){return o.type="throw",o.arg=t,n.next=e,r&&(n.method="next",n.arg=v),!!r}if(this.done)throw t;for(var n=this,r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r],o=i.completion;if("root"===i.tryLoc)return e("end");if(i.tryLoc<=this.prev){var a=y.call(i,"catchLoc"),s=y.call(i,"finallyLoc");if(a&&s){if(this.prev<i.catchLoc)return e(i.catchLoc,!0);if(this.prev<i.finallyLoc)return e(i.finallyLoc)}else if(a){if(this.prev<i.catchLoc)return e(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return e(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&y.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=t,o.arg=e,i?(this.method="next",this.next=i.finallyLoc,T):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),T},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),m(n),T}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;m(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:f(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=v),T}}}(function(){return this}()||Function("return this")())},function(t,e){},function(t,e){}]);
gutenberg/trivia/dist/blocks.build.js CHANGED
@@ -1 +1 @@
1
- !function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var n={};e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=0)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});n(1)},function(t,e,n){"use strict";function r(t){return function(){var e=t.apply(this,arguments);return new Promise(function(t,n){function r(i,a){try{var o=e[i](a),s=o.value}catch(t){return void n(t)}if(!o.done)return Promise.resolve(s).then(function(t){r("next",t)},function(t){r("throw",t)});t(s)}return r("next")})}}var i=n(2),a=n.n(i),o=n(5),s=(n.n(o),n(6)),c=(n.n(s),wp.i18n.__),l=wp.blocks.registerBlockType,u=wp.components,p=(u.SelectControl,u.TextControl,wp.editor.RichText,!1);l("opinion-stage/block-os-trivia",{title:c("Trivia Quiz"),icon:"yes",category:"opinion-stage",keywords:[c("Opinion Stage Trivia Quiz"),c("Opinion Stage Trivia Quiz Insert")],attributes:{embedUrl:{source:"attribute",attribute:"data-test-url",selector:"div[data-test-url]"},lockEmbed:{source:"attribute",attribute:"data-lock-embed",selector:"div[data-lock-embed]"},buttonText:{source:"attribute",attribute:"data-button-text",selector:"div[data-button-text]"},insertItemImage:{source:"attribute",attribute:"data-image-url",selector:"div[data-image-url]"},insertItemOsTitle:{source:"attribute",attribute:"data-title-url",selector:"div[data-title-url]"},insertItemOsView:{source:"attribute",attribute:"data-view-url",selector:"div[data-view-url]"},insertItemOsEdit:{source:"attribute",attribute:"data-edit-url",selector:"div[data-edit-url]"},insertItemOsStatistics:{source:"attribute",attribute:"data-statistics-url",selector:"div[data-statistics-url]"}},edit:function(t){var e=t.attributes,n=e.embedUrl,i=(e.lockEmbed,e.buttonText),o=e.insertItemImage,s=e.insertItemOsTitle,c=e.insertItemOsView,l=e.insertItemOsEdit,u=e.insertItemOsStatistics,m=(t.setAttributes,osGutenData.callbackUrlOs),d=m,f=(osGutenData.getActionUrlOS,osGutenData.getLogoImageLink),h=function(e){window.verifyOSInsert=function(e){var n=this;t.setAttributes({embedUrl:e,buttonText:"Change"});var o=osGutenData.OswpPluginVersion,s=osGutenData.OswpClientToken,c=osGutenData.OswpFetchDataUrl+"?type=trivia&page=1&per_page=99";fetch(c,{method:"GET",headers:{Accept:"application/vnd.api+json","Content-Type":"application/vnd.api+json","OSWP-Plugin-Version":o,"OSWP-Client-Token":s}}).then(function(){var e=r(a.a.mark(function e(r){var o;return a.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.json();case 2:o=e.sent,o=o.data,p=o,t.setAttributes({buttonText:i});case 6:case"end":return e.stop()}},e,n)}));return function(t){return e.apply(this,arguments)}}()).catch(function(t){console.log("ERROR: "+t.message)})}},v=function(e){t.setAttributes({embedUrl:"",buttonText:"Embed",lockEmbed:!1,insertItemImage:!1,insertItemOsTitle:!1,insertItemOsView:!1,insertItemOsEdit:!1,insertItemOsStatistics:!1})},g=function(t){window.location.replace(d)},b=osGutenData.onCreateButtonClickOs+"?w_type=quiz&amp;utm_source=wordpress&amp;utm_campaign=WPMainPI&amp;utm_medium=link&amp;o=wp35e8",w=function(t){window.open(b,"_blank").focus()};if(""==osGutenData.isOsConnected)return wp.element.createElement("div",{className:t.className},wp.element.createElement("div",{className:"os-trivia-wrapper components-placeholder"},wp.element.createElement("p",{className:"components-heading"},wp.element.createElement("img",{src:f,alt:""})),wp.element.createElement("p",{className:"components-heading"},"Please connect WordPress to Opinion Stage to start adding trivia"),wp.element.createElement("button",{className:"components-button is-button is-default is-block is-primary",onClick:g},"Connect")),wp.element.createElement("div",null));if(jQuery(document).ready(function(){jQuery("span#oswpLauncherContentPopuptrivia").live("click",function(t){t.preventDefault(),setTimeout(function(){jQuery(".editor-post-save-draft").trigger("click")},500);var e=jQuery(this).attr("data-os-block");jQuery("button#dropbtn span").text(e);for(var n=jQuery(".filter__itm"),r=0;r<n.length;r++){if(jQuery(n[r]).text()==e){setTimeout(function(){jQuery(n[r]).trigger("click")},1e3),setTimeout(function(){jQuery(".progress_message").css("display","none"),jQuery(".content__list").css("display","block")},2500),jQuery("button.content__links-itm").live("click",function(t){jQuery(".tingle-modal.opinionstage-content-popup").hide(),jQuery(".tingle-modal.opinionstage-content-popup.tingle-modal--visible").hide()});break}jQuery(".progress_message").css("display","block"),jQuery(".content__list").css("display","none")}})}),0!=p)for(var y=0;y<p.length;y++){var E=function(t){var e=document.createElement("a");return e.href=t,e}(p[y].attributes["landing-page-url"]),x=E.pathname;if(n==x){t.setAttributes({lockEmbed:!0,buttonText:"Change"}),t.setAttributes({insertItemImage:p[y].attributes["image-url"]}),t.setAttributes({insertItemOsTitle:p[y].attributes.title}),t.setAttributes({insertItemOsView:p[y].attributes["landing-page-url"]}),t.setAttributes({insertItemOsEdit:p[y].attributes["edit-url"]}),t.setAttributes({insertItemOsStatistics:p[y].attributes["stats-url"]});break}}var k=wp.element.createElement("div",{className:"os-trivia-wrapper components-placeholder"},wp.element.createElement("p",{className:"components-heading"},wp.element.createElement("img",{src:f,alt:""})),wp.element.createElement("span",{id:"oswpLauncherContentPopuptrivia",className:"components-button is-button is-default is-block is-primary","data-opinionstage-content-launch":!0,"data-os-block":"trivia quiz",onClick:h},"Select a Trivia Quiz"),wp.element.createElement("input",{type:"button",value:"Create a New Trivia Quiz",className:"components-button is-button is-default is-block is-primary",onClick:w}),wp.element.createElement("span",null));return""!=n&&n?"Embed"==i||"Change"==i&&(k=wp.element.createElement("div",{className:"os-trivia-wrapper components-placeholder"},wp.element.createElement("p",{className:"components-heading"},wp.element.createElement("img",{src:f,alt:""})),wp.element.createElement("div",{className:"components-preview__block"},wp.element.createElement("div",{className:"components-preview__leftBlockImage"},wp.element.createElement("img",{src:o,alt:s,className:"image"}),wp.element.createElement("div",{className:"overlay"},wp.element.createElement("div",{className:"text"},wp.element.createElement("a",{href:c,target:"_blank"}," View "),wp.element.createElement("a",{href:l,target:"_blank"}," Edit "),wp.element.createElement("a",{href:u,target:"_blank"}," Statistics "),wp.element.createElement("input",{type:"button",value:i,className:"components-button is-button is-default is-large left-align",onClick:v})))),wp.element.createElement("div",{className:"components-preview__rightBlockContent"},wp.element.createElement("div",{className:"components-placeholder__label"},"Trivia Quiz: ",s))),wp.element.createElement("span",null))):""==n||"undefined"===jQuery.type(n)||t.setAttributes({buttonText:"Embed"}),wp.element.createElement("div",{className:t.className},k,wp.element.createElement("span",null))},save:function(t){var e=t.attributes,n=e.embedUrl,r=e.lockEmbed,i=e.buttonText,a=e.insertItemImage,o=e.insertItemOsTitle,s=e.insertItemOsView,c=e.insertItemOsEdit,l=e.insertItemOsStatistics;return wp.element.createElement("div",{class:"os-trivia-wrapper","data-type":"trivia","data-image-url":a,"data-title-url":o,"data-view-url":s,"data-statistics-url":l,"data-edit-url":c,"data-test-url":n,"data-lock-embed":r,"data-button-text":i},'[os-widget path="',n,'"]',wp.element.createElement("span",null))}})},function(t,e,n){t.exports=n(3)},function(t,e,n){var r=function(){return this}()||Function("return this")(),i=r.regeneratorRuntime&&Object.getOwnPropertyNames(r).indexOf("regeneratorRuntime")>=0,a=i&&r.regeneratorRuntime;if(r.regeneratorRuntime=void 0,t.exports=n(4),i)r.regeneratorRuntime=a;else try{delete r.regeneratorRuntime}catch(t){r.regeneratorRuntime=void 0}},function(t,e){!function(e){"use strict";function n(t,e,n,r){var a=e&&e.prototype instanceof i?e:i,o=Object.create(a.prototype),s=new d(r||[]);return o._invoke=l(t,n,s),o}function r(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}function i(){}function a(){}function o(){}function s(t){["next","throw","return"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function c(t){function e(n,i,a,o){var s=r(t[n],t,i);if("throw"!==s.type){var c=s.arg,l=c.value;return l&&"object"===typeof l&&b.call(l,"__await")?Promise.resolve(l.__await).then(function(t){e("next",t,a,o)},function(t){e("throw",t,a,o)}):Promise.resolve(l).then(function(t){c.value=t,a(c)},o)}o(s.arg)}function n(t,n){function r(){return new Promise(function(r,i){e(t,n,r,i)})}return i=i?i.then(r,r):r()}var i;this._invoke=n}function l(t,e,n){var i=_;return function(a,o){if(i===T)throw new Error("Generator is already running");if(i===L){if("throw"===a)throw o;return h()}for(n.method=a,n.arg=o;;){var s=n.delegate;if(s){var c=u(s,n);if(c){if(c===N)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===_)throw i=L,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=T;var l=r(t,e,n);if("normal"===l.type){if(i=n.done?L:I,l.arg===N)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i=L,n.method="throw",n.arg=l.arg)}}}function u(t,e){var n=t.iterator[e.method];if(n===v){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=v,u(t,e),"throw"===e.method))return N;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return N}var i=r(n,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,N;var a=i.arg;return a?a.done?(e[t.resultName]=a.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=v),e.delegate=null,N):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,N)}function p(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function m(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function d(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(p,this),this.reset(!0)}function f(t){if(t){var e=t[y];if(e)return e.call(t);if("function"===typeof t.next)return t;if(!isNaN(t.length)){var n=-1,r=function e(){for(;++n<t.length;)if(b.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=v,e.done=!0,e};return r.next=r}}return{next:h}}function h(){return{value:v,done:!0}}var v,g=Object.prototype,b=g.hasOwnProperty,w="function"===typeof Symbol?Symbol:{},y=w.iterator||"@@iterator",E=w.asyncIterator||"@@asyncIterator",x=w.toStringTag||"@@toStringTag",k="object"===typeof t,O=e.regeneratorRuntime;if(O)return void(k&&(t.exports=O));O=e.regeneratorRuntime=k?t.exports:{},O.wrap=n;var _="suspendedStart",I="suspendedYield",T="executing",L="completed",N={},P={};P[y]=function(){return this};var S=Object.getPrototypeOf,C=S&&S(S(f([])));C&&C!==g&&b.call(C,y)&&(P=C);var j=o.prototype=i.prototype=Object.create(P);a.prototype=j.constructor=o,o.constructor=a,o[x]=a.displayName="GeneratorFunction",O.isGeneratorFunction=function(t){var e="function"===typeof t&&t.constructor;return!!e&&(e===a||"GeneratorFunction"===(e.displayName||e.name))},O.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,o):(t.__proto__=o,x in t||(t[x]="GeneratorFunction")),t.prototype=Object.create(j),t},O.awrap=function(t){return{__await:t}},s(c.prototype),c.prototype[E]=function(){return this},O.AsyncIterator=c,O.async=function(t,e,r,i){var a=new c(n(t,e,r,i));return O.isGeneratorFunction(e)?a:a.next().then(function(t){return t.done?t.value:a.next()})},s(j),j[x]="Generator",j[y]=function(){return this},j.toString=function(){return"[object Generator]"},O.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},O.values=f,d.prototype={constructor:d,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=v,this.done=!1,this.delegate=null,this.method="next",this.arg=v,this.tryEntries.forEach(m),!t)for(var e in this)"t"===e.charAt(0)&&b.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=v)},stop:function(){this.done=!0;var t=this.tryEntries[0],e=t.completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){function e(e,r){return a.type="throw",a.arg=t,n.next=e,r&&(n.method="next",n.arg=v),!!r}if(this.done)throw t;for(var n=this,r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r],a=i.completion;if("root"===i.tryLoc)return e("end");if(i.tryLoc<=this.prev){var o=b.call(i,"catchLoc"),s=b.call(i,"finallyLoc");if(o&&s){if(this.prev<i.catchLoc)return e(i.catchLoc,!0);if(this.prev<i.finallyLoc)return e(i.finallyLoc)}else if(o){if(this.prev<i.catchLoc)return e(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return e(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&b.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,N):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),N},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),m(n),N}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;m(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:f(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=v),N}}}(function(){return this}()||Function("return this")())},function(t,e){},function(t,e){}]);
1
+ !function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var n={};e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=0)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});n(1)},function(t,e,n){"use strict";function r(t){return function(){var e=t.apply(this,arguments);return new Promise(function(t,n){function r(i,a){try{var o=e[i](a),s=o.value}catch(t){return void n(t)}if(!o.done)return Promise.resolve(s).then(function(t){r("next",t)},function(t){r("throw",t)});t(s)}return r("next")})}}var i=n(2),a=n.n(i),o=n(5),s=(n.n(o),n(6)),c=(n.n(s),wp.i18n.__),l=wp.blocks.registerBlockType,u=wp.components,p=(u.SelectControl,u.TextControl,wp.editor.RichText,!1);l("opinion-stage/block-os-trivia",{title:c("Trivia Quiz"),icon:"yes",category:"opinion-stage",keywords:[c("Opinion Stage Trivia Quiz"),c("Opinion Stage Trivia Quiz Insert")],attributes:{embedUrl:{source:"attribute",attribute:"data-test-url",selector:"div[data-test-url]"},lockEmbed:{source:"attribute",attribute:"data-lock-embed",selector:"div[data-lock-embed]"},buttonText:{source:"attribute",attribute:"data-button-text",selector:"div[data-button-text]"},insertItemImage:{source:"attribute",attribute:"data-image-url",selector:"div[data-image-url]"},insertItemOsTitle:{source:"attribute",attribute:"data-title-url",selector:"div[data-title-url]"},insertItemOsView:{source:"attribute",attribute:"data-view-url",selector:"div[data-view-url]"},insertItemOsEdit:{source:"attribute",attribute:"data-edit-url",selector:"div[data-edit-url]"},insertItemOsStatistics:{source:"attribute",attribute:"data-statistics-url",selector:"div[data-statistics-url]"}},edit:function(t){var e=t.attributes,n=e.embedUrl,i=(e.lockEmbed,e.buttonText),o=e.insertItemImage,s=e.insertItemOsTitle,c=e.insertItemOsView,l=e.insertItemOsEdit,u=e.insertItemOsStatistics,m=(t.setAttributes,osGutenData.callbackUrlOs),d=m,f=(osGutenData.getActionUrlOS,osGutenData.getLogoImageLink),h=function(e){window.verifyOSInsert=function(e){var n=this;t.setAttributes({embedUrl:e,buttonText:"Change"});var o=osGutenData.OswpPluginVersion,s=osGutenData.OswpClientToken,c=osGutenData.OswpFetchDataUrl+"?type=trivia&page=1&per_page=99";fetch(c,{method:"GET",headers:{Accept:"application/vnd.api+json","Content-Type":"application/vnd.api+json","OSWP-Plugin-Version":o,"OSWP-Client-Token":s}}).then(function(){var e=r(a.a.mark(function e(r){var o;return a.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.json();case 2:o=e.sent,o=o.data,p=o,t.setAttributes({buttonText:i});case 6:case"end":return e.stop()}},e,n)}));return function(t){return e.apply(this,arguments)}}()).catch(function(t){console.log("ERROR: "+t.message)})}},v=function(e){t.setAttributes({embedUrl:"",buttonText:"Embed",lockEmbed:!1,insertItemImage:!1,insertItemOsTitle:!1,insertItemOsView:!1,insertItemOsEdit:!1,insertItemOsStatistics:!1})},g=function(t){window.location.replace(d)},b=osGutenData.onCreateButtonClickOs+"?w_type=quiz&amp;utm_source=wordpress&amp;utm_campaign=WPMainPI&amp;utm_medium=link&amp;o=wp35e8",w=function(t){window.open(b,"_blank").focus()};if(""==osGutenData.isOsConnected)return wp.element.createElement("div",{className:t.className},wp.element.createElement("div",{className:"os-trivia-wrapper components-placeholder"},wp.element.createElement("p",{className:"components-heading"},wp.element.createElement("img",{src:f,alt:""})),wp.element.createElement("p",{className:"components-heading"},"Please connect WordPress to Opinion Stage to start adding trivia"),wp.element.createElement("button",{className:"components-button is-button is-default is-block is-primary",onClick:g},"Connect")),wp.element.createElement("div",null));if(jQuery(document).ready(function(){jQuery("span#oswpLauncherContentPopuptrivia").on("click",null,function(t){t.preventDefault(),setTimeout(function(){jQuery(".editor-post-save-draft").trigger("click")},500);var e=jQuery(this).attr("data-os-block");jQuery("button#dropbtn span").text(e);for(var n=jQuery(".filter__itm"),r=0;r<n.length;r++){if(jQuery(n[r]).text()==e){setTimeout(function(){jQuery(n[r]).trigger("click")},1e3),setTimeout(function(){jQuery(".progress_message").css("display","none"),jQuery(".content__list").css("display","block")},2500),jQuery("button.content__links-itm").on("click",null,function(t){jQuery(".tingle-modal.opinionstage-content-popup").hide(),jQuery(".tingle-modal.opinionstage-content-popup.tingle-modal--visible").hide()});break}jQuery(".progress_message").css("display","block"),jQuery(".content__list").css("display","none")}})}),0!=p)for(var y=0;y<p.length;y++){var E=function(t){var e=document.createElement("a");return e.href=t,e}(p[y].attributes["landing-page-url"]),x=E.pathname;if(n==x){t.setAttributes({lockEmbed:!0,buttonText:"Change"}),t.setAttributes({insertItemImage:p[y].attributes["image-url"]}),t.setAttributes({insertItemOsTitle:p[y].attributes.title}),t.setAttributes({insertItemOsView:p[y].attributes["landing-page-url"]}),t.setAttributes({insertItemOsEdit:p[y].attributes["edit-url"]}),t.setAttributes({insertItemOsStatistics:p[y].attributes["stats-url"]});break}}var k=wp.element.createElement("div",{className:"os-trivia-wrapper components-placeholder"},wp.element.createElement("p",{className:"components-heading"},wp.element.createElement("img",{src:f,alt:""})),wp.element.createElement("span",{id:"oswpLauncherContentPopuptrivia",className:"components-button is-button is-default is-block is-primary","data-opinionstage-content-launch":!0,"data-os-block":"trivia quiz",onClick:h},"Select a Trivia Quiz"),wp.element.createElement("input",{type:"button",value:"Create a New Trivia Quiz",className:"components-button is-button is-default is-block is-primary",onClick:w}),wp.element.createElement("span",null));return""!=n&&n?"Embed"==i||"Change"==i&&(k=wp.element.createElement("div",{className:"os-trivia-wrapper components-placeholder"},wp.element.createElement("p",{className:"components-heading"},wp.element.createElement("img",{src:f,alt:""})),wp.element.createElement("div",{className:"components-preview__block"},wp.element.createElement("div",{className:"components-preview__leftBlockImage"},wp.element.createElement("img",{src:o,alt:s,className:"image"}),wp.element.createElement("div",{className:"overlay"},wp.element.createElement("div",{className:"text"},wp.element.createElement("a",{href:c,target:"_blank"}," View "),wp.element.createElement("a",{href:l,target:"_blank"}," Edit "),wp.element.createElement("a",{href:u,target:"_blank"}," Statistics "),wp.element.createElement("input",{type:"button",value:i,className:"components-button is-button is-default is-large left-align",onClick:v})))),wp.element.createElement("div",{className:"components-preview__rightBlockContent"},wp.element.createElement("div",{className:"components-placeholder__label"},"Trivia Quiz: ",s))),wp.element.createElement("span",null))):""==n||"undefined"===jQuery.type(n)||t.setAttributes({buttonText:"Embed"}),wp.element.createElement("div",{className:t.className},k,wp.element.createElement("span",null))},save:function(t){var e=t.attributes,n=e.embedUrl,r=e.lockEmbed,i=e.buttonText,a=e.insertItemImage,o=e.insertItemOsTitle,s=e.insertItemOsView,c=e.insertItemOsEdit,l=e.insertItemOsStatistics;return wp.element.createElement("div",{class:"os-trivia-wrapper","data-type":"trivia","data-image-url":a,"data-title-url":o,"data-view-url":s,"data-statistics-url":l,"data-edit-url":c,"data-test-url":n,"data-lock-embed":r,"data-button-text":i},'[os-widget path="',n,'"]',wp.element.createElement("span",null))}})},function(t,e,n){t.exports=n(3)},function(t,e,n){var r=function(){return this}()||Function("return this")(),i=r.regeneratorRuntime&&Object.getOwnPropertyNames(r).indexOf("regeneratorRuntime")>=0,a=i&&r.regeneratorRuntime;if(r.regeneratorRuntime=void 0,t.exports=n(4),i)r.regeneratorRuntime=a;else try{delete r.regeneratorRuntime}catch(t){r.regeneratorRuntime=void 0}},function(t,e){!function(e){"use strict";function n(t,e,n,r){var a=e&&e.prototype instanceof i?e:i,o=Object.create(a.prototype),s=new d(r||[]);return o._invoke=l(t,n,s),o}function r(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}function i(){}function a(){}function o(){}function s(t){["next","throw","return"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function c(t){function e(n,i,a,o){var s=r(t[n],t,i);if("throw"!==s.type){var c=s.arg,l=c.value;return l&&"object"===typeof l&&b.call(l,"__await")?Promise.resolve(l.__await).then(function(t){e("next",t,a,o)},function(t){e("throw",t,a,o)}):Promise.resolve(l).then(function(t){c.value=t,a(c)},o)}o(s.arg)}function n(t,n){function r(){return new Promise(function(r,i){e(t,n,r,i)})}return i=i?i.then(r,r):r()}var i;this._invoke=n}function l(t,e,n){var i=_;return function(a,o){if(i===T)throw new Error("Generator is already running");if(i===L){if("throw"===a)throw o;return h()}for(n.method=a,n.arg=o;;){var s=n.delegate;if(s){var c=u(s,n);if(c){if(c===N)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===_)throw i=L,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=T;var l=r(t,e,n);if("normal"===l.type){if(i=n.done?L:I,l.arg===N)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i=L,n.method="throw",n.arg=l.arg)}}}function u(t,e){var n=t.iterator[e.method];if(n===v){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=v,u(t,e),"throw"===e.method))return N;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return N}var i=r(n,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,N;var a=i.arg;return a?a.done?(e[t.resultName]=a.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=v),e.delegate=null,N):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,N)}function p(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function m(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function d(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(p,this),this.reset(!0)}function f(t){if(t){var e=t[y];if(e)return e.call(t);if("function"===typeof t.next)return t;if(!isNaN(t.length)){var n=-1,r=function e(){for(;++n<t.length;)if(b.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=v,e.done=!0,e};return r.next=r}}return{next:h}}function h(){return{value:v,done:!0}}var v,g=Object.prototype,b=g.hasOwnProperty,w="function"===typeof Symbol?Symbol:{},y=w.iterator||"@@iterator",E=w.asyncIterator||"@@asyncIterator",x=w.toStringTag||"@@toStringTag",k="object"===typeof t,O=e.regeneratorRuntime;if(O)return void(k&&(t.exports=O));O=e.regeneratorRuntime=k?t.exports:{},O.wrap=n;var _="suspendedStart",I="suspendedYield",T="executing",L="completed",N={},P={};P[y]=function(){return this};var S=Object.getPrototypeOf,C=S&&S(S(f([])));C&&C!==g&&b.call(C,y)&&(P=C);var j=o.prototype=i.prototype=Object.create(P);a.prototype=j.constructor=o,o.constructor=a,o[x]=a.displayName="GeneratorFunction",O.isGeneratorFunction=function(t){var e="function"===typeof t&&t.constructor;return!!e&&(e===a||"GeneratorFunction"===(e.displayName||e.name))},O.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,o):(t.__proto__=o,x in t||(t[x]="GeneratorFunction")),t.prototype=Object.create(j),t},O.awrap=function(t){return{__await:t}},s(c.prototype),c.prototype[E]=function(){return this},O.AsyncIterator=c,O.async=function(t,e,r,i){var a=new c(n(t,e,r,i));return O.isGeneratorFunction(e)?a:a.next().then(function(t){return t.done?t.value:a.next()})},s(j),j[x]="Generator",j[y]=function(){return this},j.toString=function(){return"[object Generator]"},O.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},O.values=f,d.prototype={constructor:d,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=v,this.done=!1,this.delegate=null,this.method="next",this.arg=v,this.tryEntries.forEach(m),!t)for(var e in this)"t"===e.charAt(0)&&b.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=v)},stop:function(){this.done=!0;var t=this.tryEntries[0],e=t.completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){function e(e,r){return a.type="throw",a.arg=t,n.next=e,r&&(n.method="next",n.arg=v),!!r}if(this.done)throw t;for(var n=this,r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r],a=i.completion;if("root"===i.tryLoc)return e("end");if(i.tryLoc<=this.prev){var o=b.call(i,"catchLoc"),s=b.call(i,"finallyLoc");if(o&&s){if(this.prev<i.catchLoc)return e(i.catchLoc,!0);if(this.prev<i.finallyLoc)return e(i.finallyLoc)}else if(o){if(this.prev<i.catchLoc)return e(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return e(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&b.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,N):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),N},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),m(n),N}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;m(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:f(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=v),N}}}(function(){return this}()||Function("return this")())},function(t,e){},function(t,e){}]);
opinionstage-polls.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Poll, Survey, Form & Quiz Maker by OpinionStage (Deprecated)
4
  Plugin URI: https://www.opinionstage.com
5
  Description: Add a highly engaging poll, survey, quiz or contact form builder to your site. You can add the poll, survey, quiz or form to any post/page or to the sidebar.
6
- Version: 19.6.38
7
  Author: OpinionStage.com
8
  Author URI: https://www.opinionstage.com
9
  Text Domain: social-polls-by-opinionstage
3
  Plugin Name: Poll, Survey, Form & Quiz Maker by OpinionStage (Deprecated)
4
  Plugin URI: https://www.opinionstage.com
5
  Description: Add a highly engaging poll, survey, quiz or contact form builder to your site. You can add the poll, survey, quiz or form to any post/page or to the sidebar.
6
+ Version: 19.6.39
7
  Author: OpinionStage.com
8
  Author URI: https://www.opinionstage.com
9
  Text Domain: social-polls-by-opinionstage
plugin.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Poll, Survey, Form & Quiz Maker by OpinionStage
4
  Plugin URI: https://www.opinionstage.com
5
  Description: Add a highly engaging poll, survey, quiz or contact form builder to your site. You can add the poll, survey, quiz or form to any post/page or to the sidebar.
6
- Version: 19.6.38
7
  Author: OpinionStage.com
8
  Author URI: https://www.opinionstage.com
9
  Text Domain: social-polls-by-opinionstage
@@ -24,7 +24,7 @@ if ( defined('WP_DEBUG') && true === WP_DEBUG ) {
24
  }
25
  }
26
 
27
- define('OPINIONSTAGE_WIDGET_VERSION', '19.6.37');
28
 
29
  define('OPINIONSTAGE_TEXT_DOMAIN', 'social-polls-by-opinionstage');
30
 
3
  Plugin Name: Poll, Survey, Form & Quiz Maker by OpinionStage
4
  Plugin URI: https://www.opinionstage.com
5
  Description: Add a highly engaging poll, survey, quiz or contact form builder to your site. You can add the poll, survey, quiz or form to any post/page or to the sidebar.
6
+ Version: 19.6.39
7
  Author: OpinionStage.com
8
  Author URI: https://www.opinionstage.com
9
  Text Domain: social-polls-by-opinionstage
24
  }
25
  }
26
 
27
+ define('OPINIONSTAGE_WIDGET_VERSION', '19.6.39');
28
 
29
  define('OPINIONSTAGE_TEXT_DOMAIN', 'social-polls-by-opinionstage');
30
 
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.opinionstage.com
4
  Tags: poll, quiz, survey, poll plugin, quiz plugin, survey plugin
5
  Requires at least: 2.8
6
  Tested up to: 5.4
7
- Stable tag: 19.6.38
8
  Requires PHP: 5.2
9
 
10
  Add a Poll, Survey, or Quiz to your Wordpress site. Create a poll, quiz, or survey from scratch or based on templates.
@@ -138,6 +138,8 @@ Opinion Stage makes it easy for you to comply with the GDPR regulation. For more
138
  N/A
139
 
140
  == Changelog ==
 
 
141
  = 19.6.38 =
142
  * readme update
143
  = 19.6.37 =
4
  Tags: poll, quiz, survey, poll plugin, quiz plugin, survey plugin
5
  Requires at least: 2.8
6
  Tested up to: 5.4
7
+ Stable tag: 19.6.39
8
  Requires PHP: 5.2
9
 
10
  Add a Poll, Survey, or Quiz to your Wordpress site. Create a poll, quiz, or survey from scratch or based on templates.
138
  N/A
139
 
140
  == Changelog ==
141
+ = 19.6.39 =
142
+ * fix WordPress 5.5 compatibility issues
143
  = 19.6.38 =
144
  * readme update
145
  = 19.6.37 =