Server IP : 80.87.202.40 / Your IP : 216.73.216.169 Web Server : Apache System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64 User : bitrix ( 600) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/bitrix/ext_www/rospirotorg.ru/bitrix/js/landing/screenshoter/dist/ |
Upload File : |
this.BX=this.BX||{};(function(t,e,r){"use strict";function n(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */n=function e(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag";function f(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},"")}catch(t){f=function t(e,r,n){return e[r]=n}}function s(t,e,r,n){var i=e&&e.prototype instanceof d?e:d,a=Object.create(i.prototype),u=new k(n||[]);return o(a,"_invoke",{value:L(t,r,u)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var h={};function d(){}function p(){}function v(){}var y={};f(y,a,(function(){return this}));var g=Object.getPrototypeOf,m=g&&g(g(_([])));m&&m!==e&&r.call(m,a)&&(y=m);var w=v.prototype=d.prototype=Object.create(y);function b(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function n(o,i,a,u){var c=l(t[o],t,i);if("throw"!==c.type){var f=c.arg,s=f.value;return s&&"object"==babelHelpers["typeof"](s)&&r.call(s,"__await")?e.resolve(s.__await).then((function(t){n("next",t,a,u)}),(function(t){n("throw",t,a,u)})):e.resolve(s).then((function(t){f.value=t,a(f)}),(function(t){return n("throw",t,a,u)}))}u(c.arg)}var i;o(this,"_invoke",{value:function t(r,o){function a(){return new e((function(t,e){n(r,o,t,e)}))}return i=i?i.then(a,a):a()}})}function L(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return j()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=E(a,r);if(u){if(u===h)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=l(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===h)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function E(t,e){var r=e.method,n=t.iterator[r];if(undefined===n)return e.delegate=null,"throw"===r&&t.iterator["return"]&&(e.method="return",e.arg=undefined,E(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,h;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=undefined),e.delegate=null,h):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}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 S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function _(t){if(t){var e=t[a];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=undefined,e.done=!0,e};return o.next=o}}return{next:j}}function j(){return{value:undefined,done:!0}}return p.prototype=v,o(w,"constructor",{value:v,configurable:!0}),o(v,"constructor",{value:p,configurable:!0}),p.displayName=f(v,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,f(t,c,"GeneratorFunction")),t.prototype=Object.create(w),t},t.awrap=function(t){return{__await:t}},b(x.prototype),f(x.prototype,u,(function(){return this})),t.AsyncIterator=x,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new x(s(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(w),f(w,c,"Generator"),f(w,a,(function(){return this})),f(w,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=_,k.prototype={constructor:k,reset:function t(e){if(this.prev=0,this.next=0,this.sent=this._sent=undefined,this.done=!1,this.delegate=null,this.method="next",this.arg=undefined,this.tryEntries.forEach(S),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=undefined)},stop:function t(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function t(e){if(this.done)throw e;var n=this;function o(t,r){return u.type="throw",u.arg=e,n.next=t,r&&(n.method="next",n.arg=undefined),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),f=r.call(a,"finallyLoc");if(c&&f){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!f)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function t(e,n){for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=n&&n<=a.finallyLoc&&(a=null);var u=a?a.completion:{};return u.type=e,u.arg=n,a?(this.method="next",this.next=a.finallyLoc,h):this.complete(u)},complete:function t(e,r){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&r&&(this.next=r),h},finish:function t(e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),S(n),h}},catch:function t(e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc===e){var o=n.completion;if("throw"===o.type){var i=o.arg;S(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function t(e,r,n){return this.delegate={iterator:_(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=undefined),h}},t}var o=undefined&&undefined.__awaiter||function(t,e,r,n){function o(t){return t instanceof r?t:new r((function(e){e(t)}))}return new(r||(r=Promise))((function(r,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n["throw"](t))}catch(t){i(t)}}function c(t){t.done?r(t.value):o(t.value).then(a,u)}c((n=n.apply(t,e||[])).next())}))};var i="application/font-woff";var a="image/jpeg";var u={woff:i,woff2:i,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:a,jpeg:a,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml"};var c=function t(){var e=0;var r=function t(){return"0000".concat((Math.random()*Math.pow(36,4)<<0).toString(36)).slice(-4)};return function(){e+=1;return"u".concat(r()).concat(e)}}();function f(t){var e=/\.([^./]*?)$/g.exec(t);return e?e[1]:""}function s(t){var e=f(t).toLowerCase();return u[e]||""}function l(t){return function(e){return new Promise((function(r){setTimeout((function(){r(e)}),t)}))}}function h(t){return t.search(/^(data:)/)!==-1}function d(t,e){return"data:".concat(e,";base64,").concat(t)}function p(t){return t.split(/,/)[1]}function v(t){return new Promise((function(e){var r=window.atob(t.toDataURL().split(",")[1]);var n=r.length;var o=new Uint8Array(n);for(var i=0;i<n;i+=1){o[i]=r.charCodeAt(i)}e(new Blob([o],{type:"image/png"}))}))}function y(t){if(t.toBlob){return new Promise((function(e){return t.toBlob(e)}))}return v(t)}function g(t){var e=[];for(var r=0,n=t.length;r<n;r+=1){e.push(t[r])}return e}function m(t,e){var r=window.getComputedStyle(t).getPropertyValue(e);return parseFloat(r.replace("px",""))}function w(t){var e=m(t,"border-left-width");var r=m(t,"border-right-width");return t.clientWidth+e+r}function b(t){var e=m(t,"border-top-width");var r=m(t,"border-bottom-width");return t.clientHeight+e+r}function x(){var t;var e;try{e=process}catch(t){}var r=e&&e.env?e.env.devicePixelRatio:null;if(r){t=parseInt(r,10);if(isNaN(t)){t=1}}return t||window.devicePixelRatio||1}function L(t){return new Promise((function(e,r){var n=new Image;n.onload=function(){return e(n)};n.onerror=r;n.crossOrigin="anonymous";n.src=t}))}function E(t){return o(this,void 0,void 0,n().mark((function e(){return n().wrap((function e(r){while(1)switch(r.prev=r.next){case 0:return r.abrupt("return",Promise.resolve().then((function(){return(new XMLSerializer).serializeToString(t)})).then(encodeURIComponent).then((function(t){return"data:image/svg+xml;charset=utf-8,".concat(t)})));case 1:case"end":return r.stop()}}),e)})))}var P=3e4;var S={};function k(t){return/ttf|otf|eot|woff2?/i.test(t)}function _(t,e){var r=t;if(BX.Type.isStringFilled(t)&&t.startsWith("http")&&!t.startsWith(window.location.origin)&&(t.endsWith(".svg")||t.endsWith(".png")||t.endsWith(".jpg")||t.endsWith(".gif"))){t=BX.Uri.addParam("/bitrix/tools/landing/proxy.php",{sessid:BX.bitrix_sessid(),url:t})}if(k(r)){r=r.replace(/.*\//,"")}if(S[r]){return S[r]}if(e.cacheBust){t+=(/\?/.test(t)?"&":"?")+(new Date).getTime()}var n=function r(n){var o="";if(e.imagePlaceholder){var i=e.imagePlaceholder.split(/,/);if(i&&i[1]){o=i[1]}}var a="Failed to fetch resource: ".concat(t);if(n){a=typeof n==="string"?n:n.message}if(a){console.error(a)}return o};var o=window.fetch?window.fetch(t,{mode:"no-cors"}).then((function(t){return t.blob().then((function(e){return{blob:e,contentType:t.headers.get("Content-Type")||""}}))})).then((function(t){var e=t.blob,r=t.contentType;return new Promise((function(t,n){var o=new FileReader;o.onloadend=function(){return t({contentType:r,blob:o.result})};o.onerror=n;o.readAsDataURL(e)}))})).then((function(t){var e=t.blob,r=t.contentType;return{contentType:r,blob:p(e)}})):new Promise((function(e,r){var n=new XMLHttpRequest;var o=function e(){r(new Error("Timeout of ".concat(P,"ms occured while fetching resource: ").concat(t)))};var i=function o(){if(n.readyState!==4){return}if(n.status!==200){r(new Error("Failed to fetch resource: ".concat(t,", status: ").concat(n.status)));return}var i=new FileReader;i.onloadend=function(){e({blob:p(i.result),contentType:n.getResponseHeader("Content-Type")||""})};i.readAsDataURL(n.response)};n.onreadystatechange=i;n.ontimeout=o;n.responseType="blob";n.timeout=P;n.open("GET",t,true);n.send()}));var i=o["catch"](n);S[r]=i;return i}var j;(function(t){function e(t,e,n){var o=window.getComputedStyle(t,n);var i=o.getPropertyValue("content");if(i===""||i==="none"){return}var a=c();try{e.className="".concat(e.className," ").concat(a)}catch(t){return}var u=document.createElement("style");u.appendChild(r(a,n,o));e.appendChild(u)}t.clonePseudoElement=e;function r(t,e,r){var i=".".concat(t,":").concat(e);var a=r.cssText?n(r):o(r);return document.createTextNode("".concat(i,"{").concat(a,"}"))}function n(t){var e=t.getPropertyValue("content");return"".concat(t.cssText," content: '").concat(e.replace(/'|"/g,""),"';")}function o(t){return g(t).map((function(e){var r=t.getPropertyValue(e);var n=t.getPropertyPriority(e);return"".concat(e,": ").concat(r).concat(n?" !important":"",";")})).join(" ")}})(j||(j={}));function O(t,e){var r=[":before",":after"];r.forEach((function(r){return j.clonePseudoElement(t,e,r)}))}function T(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */T=function e(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function t(e,r,n){return e[r]=n}}function f(t,e,r,o){var i=e&&e.prototype instanceof h?e:h,a=Object.create(i.prototype),u=new S(o||[]);return n(a,"_invoke",{value:x(t,r,u)}),a}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=f;var l={};function h(){}function d(){}function p(){}var v={};c(v,i,(function(){return this}));var y=Object.getPrototypeOf,g=y&&y(y(k([])));g&&g!==e&&r.call(g,i)&&(v=g);var m=p.prototype=h.prototype=Object.create(v);function w(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){function o(n,i,a,u){var c=s(t[n],t,i);if("throw"!==c.type){var f=c.arg,l=f.value;return l&&"object"==babelHelpers["typeof"](l)&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){o("next",t,a,u)}),(function(t){o("throw",t,a,u)})):e.resolve(l).then((function(t){f.value=t,a(f)}),(function(t){return o("throw",t,a,u)}))}u(c.arg)}var i;n(this,"_invoke",{value:function t(r,n){function a(){return new e((function(t,e){o(r,n,t,e)}))}return i=i?i.then(a,a):a()}})}function x(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return _()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=L(a,r);if(u){if(u===l)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=s(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===l)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function L(t,e){var r=e.method,n=t.iterator[r];if(undefined===n)return e.delegate=null,"throw"===r&&t.iterator["return"]&&(e.method="return",e.arg=undefined,L(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),l;var o=s(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,l;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=undefined),e.delegate=null,l):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function E(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 S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function k(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=undefined,e.done=!0,e};return o.next=o}}return{next:_}}function _(){return{value:undefined,done:!0}}return d.prototype=p,n(m,"constructor",{value:p,configurable:!0}),n(p,"constructor",{value:d,configurable:!0}),d.displayName=c(p,u,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,c(t,u,"GeneratorFunction")),t.prototype=Object.create(m),t},t.awrap=function(t){return{__await:t}},w(b.prototype),c(b.prototype,a,(function(){return this})),t.AsyncIterator=b,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new b(f(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},w(m),c(m,u,"Generator"),c(m,i,(function(){return this})),c(m,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=k,S.prototype={constructor:S,reset:function t(e){if(this.prev=0,this.next=0,this.sent=this._sent=undefined,this.done=!1,this.delegate=null,this.method="next",this.arg=undefined,this.tryEntries.forEach(P),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=undefined)},stop:function t(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function t(e){if(this.done)throw e;var n=this;function o(t,r){return u.type="throw",u.arg=e,n.next=t,r&&(n.method="next",n.arg=undefined),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),f=r.call(a,"finallyLoc");if(c&&f){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!f)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function t(e,n){for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=n&&n<=a.finallyLoc&&(a=null);var u=a?a.completion:{};return u.type=e,u.arg=n,a?(this.method="next",this.next=a.finallyLoc,l):this.complete(u)},complete:function t(e,r){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&r&&(this.next=r),l},finish:function t(e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),l}},catch:function t(e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc===e){var o=n.completion;if("throw"===o.type){var i=o.arg;P(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function t(e,r,n){return this.delegate={iterator:k(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=undefined),l}},t}var N=undefined&&undefined.__awaiter||function(t,e,r,n){function o(t){return t instanceof r?t:new r((function(e){e(t)}))}return new(r||(r=Promise))((function(r,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n["throw"](t))}catch(t){i(t)}}function c(t){t.done?r(t.value):o(t.value).then(a,u)}c((n=n.apply(t,e||[])).next())}))};function G(t,e){return N(this,void 0,void 0,T().mark((function r(){var n;return T().wrap((function r(o){while(1)switch(o.prev=o.next){case 0:if(!(t instanceof HTMLCanvasElement)){o.next=5;break}n=t.toDataURL();if(!(n==="data:,")){o.next=4;break}return o.abrupt("return",Promise.resolve(t.cloneNode(false)));case 4:return o.abrupt("return",L(n));case 5:if(!(t instanceof HTMLVideoElement&&t.poster)){o.next=7;break}return o.abrupt("return",Promise.resolve(t.poster).then((function(t){return _(t,e)})).then((function(e){return d(e.blob,s(t.poster)||e.contentType)})).then((function(t){return L(t)})));case 7:return o.abrupt("return",Promise.resolve(t.cloneNode(false)));case 8:case"end":return o.stop()}}),r)})))}function C(t,e,r){var n;return N(this,void 0,void 0,T().mark((function o(){var i;return T().wrap((function o(a){while(1)switch(a.prev=a.next){case 0:i=g(((n=t.shadowRoot)!==null&&n!==void 0?n:t).childNodes);if(!(i.length===0)){a.next=3;break}return a.abrupt("return",Promise.resolve(e));case 3:return a.abrupt("return",i.reduce((function(t,n){return t.then((function(){return I(n,r)})).then((function(t){if(t){e.appendChild(t)}}))}),Promise.resolve()).then((function(){return e})));case 4:case"end":return a.stop()}}),o)})))}function R(t,e){return N(this,void 0,void 0,T().mark((function r(){return T().wrap((function r(n){while(1)switch(n.prev=n.next){case 0:if(e instanceof Element){n.next=2;break}return n.abrupt("return",e);case 2:return n.abrupt("return",Promise.resolve().then((function(){return F(t,e)})).then((function(){return O(t,e)})).then((function(){return A(t,e)})).then((function(){return e})));case 3:case"end":return n.stop()}}),r)})))}function F(t,e){var r=window.getComputedStyle(t);var n=e.style;if(!n){return}if(r.cssText){n.cssText=r.cssText}else{g(r).forEach((function(t){n.setProperty(t,r.getPropertyValue(t),r.getPropertyPriority(t))}))}}function A(t,e){if(t instanceof HTMLTextAreaElement){e.innerHTML=t.value}if(t instanceof HTMLInputElement){e.setAttribute("value",t.value)}}function I(t,e,r){return N(this,void 0,void 0,T().mark((function n(){return T().wrap((function n(o){while(1)switch(o.prev=o.next){case 0:if(!(!r&&e.filter&&!e.filter(t))){o.next=2;break}return o.abrupt("return",Promise.resolve(null));case 2:return o.abrupt("return",Promise.resolve(t).then((function(t){return G(t,e)})).then((function(r){return C(t,r,e)})).then((function(e){return R(t,e)})));case 3:case"end":return o.stop()}}),n)})))}var B=/url\((['"]?)([^'"]+?)\1\)/g;var H=/url\([^)]+\)\s*format\((["'])([^"']+)\1\)/g;var X=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function D(t){return t.search(B)!==-1}function M(t,e,r){if(!D(t)){return Promise.resolve(t)}var n=U(t,r);return Promise.resolve(n).then(W).then((function(t){return t.reduce((function(t,n){return t.then((function(t){return V(t,n,e,r)}))}),Promise.resolve(n))}))}function U(t,e){var r=e.preferredFontFormat;return!r?t:t.replace(X,(function(t){while(true){var e=H.exec(t)||[],n=babelHelpers.slicedToArray(e,3),o=n[0],i=n[2];if(!i){return""}if(i===r){return"src: ".concat(o,";")}}}))}function W(t){var e=[];t.replace(B,(function(t,r,n){e.push(n);return t}));return e.filter((function(t){return!h(t)}))}function V(t,e,r,n,o){var i=r?Y(e,r):e;return Promise.resolve(i).then((function(t){return o?o(t):_(t,n)})).then((function(t){if(typeof t==="string"){return d(t,s(e))}return d(t.blob,s(e)||t.contentType)})).then((function(r){return t.replace($(e),"$1".concat(r,"$3"))})).then((function(t){return t}),(function(){return i}))}function Y(t,e){if(t.match(/^[a-z]+:\/\//i)){return t}if(t.match(/^\/\//)){return window.location.protocol+t}if(t.match(/^[a-z]+:/i)){return t}var r=document.implementation.createHTMLDocument();var n=r.createElement("base");var o=r.createElement("a");r.head.appendChild(n);r.body.appendChild(o);if(e){n.href=e}o.href=t;return o.href}function $(t){return new RegExp("(url\\(['\"]?)(".concat(q(t),")(['\"]?\\))"),"g")}function q(t){return t.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1")}function z(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */z=function e(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function t(e,r,n){return e[r]=n}}function f(t,e,r,o){var i=e&&e.prototype instanceof h?e:h,a=Object.create(i.prototype),u=new S(o||[]);return n(a,"_invoke",{value:x(t,r,u)}),a}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=f;var l={};function h(){}function d(){}function p(){}var v={};c(v,i,(function(){return this}));var y=Object.getPrototypeOf,g=y&&y(y(k([])));g&&g!==e&&r.call(g,i)&&(v=g);var m=p.prototype=h.prototype=Object.create(v);function w(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){function o(n,i,a,u){var c=s(t[n],t,i);if("throw"!==c.type){var f=c.arg,l=f.value;return l&&"object"==babelHelpers["typeof"](l)&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){o("next",t,a,u)}),(function(t){o("throw",t,a,u)})):e.resolve(l).then((function(t){f.value=t,a(f)}),(function(t){return o("throw",t,a,u)}))}u(c.arg)}var i;n(this,"_invoke",{value:function t(r,n){function a(){return new e((function(t,e){o(r,n,t,e)}))}return i=i?i.then(a,a):a()}})}function x(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return _()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=L(a,r);if(u){if(u===l)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=s(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===l)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function L(t,e){var r=e.method,n=t.iterator[r];if(undefined===n)return e.delegate=null,"throw"===r&&t.iterator["return"]&&(e.method="return",e.arg=undefined,L(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),l;var o=s(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,l;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=undefined),e.delegate=null,l):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function E(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 S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function k(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=undefined,e.done=!0,e};return o.next=o}}return{next:_}}function _(){return{value:undefined,done:!0}}return d.prototype=p,n(m,"constructor",{value:p,configurable:!0}),n(p,"constructor",{value:d,configurable:!0}),d.displayName=c(p,u,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,c(t,u,"GeneratorFunction")),t.prototype=Object.create(m),t},t.awrap=function(t){return{__await:t}},w(b.prototype),c(b.prototype,a,(function(){return this})),t.AsyncIterator=b,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new b(f(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},w(m),c(m,u,"Generator"),c(m,i,(function(){return this})),c(m,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=k,S.prototype={constructor:S,reset:function t(e){if(this.prev=0,this.next=0,this.sent=this._sent=undefined,this.done=!1,this.delegate=null,this.method="next",this.arg=undefined,this.tryEntries.forEach(P),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=undefined)},stop:function t(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function t(e){if(this.done)throw e;var n=this;function o(t,r){return u.type="throw",u.arg=e,n.next=t,r&&(n.method="next",n.arg=undefined),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),f=r.call(a,"finallyLoc");if(c&&f){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!f)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function t(e,n){for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=n&&n<=a.finallyLoc&&(a=null);var u=a?a.completion:{};return u.type=e,u.arg=n,a?(this.method="next",this.next=a.finallyLoc,l):this.complete(u)},complete:function t(e,r){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&r&&(this.next=r),l},finish:function t(e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),l}},catch:function t(e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc===e){var o=n.completion;if("throw"===o.type){var i=o.arg;P(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function t(e,r,n){return this.delegate={iterator:k(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=undefined),l}},t}var J=undefined&&undefined.__awaiter||function(t,e,r,n){function o(t){return t instanceof r?t:new r((function(e){e(t)}))}return new(r||(r=Promise))((function(r,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n["throw"](t))}catch(t){i(t)}}function c(t){t.done?r(t.value):o(t.value).then(a,u)}c((n=n.apply(t,e||[])).next())}))};function K(t,e){return J(this,void 0,void 0,z().mark((function r(){return z().wrap((function r(n){while(1)switch(n.prev=n.next){case 0:if(t instanceof Element){n.next=2;break}return n.abrupt("return",Promise.resolve(t));case 2:return n.abrupt("return",Promise.resolve(t).then((function(t){return Q(t,e)})).then((function(t){return Z(t,e)})).then((function(t){return tt(t,e)})));case 3:case"end":return n.stop()}}),r)})))}function Q(t,e){var r;return J(this,void 0,void 0,z().mark((function n(){var o;return z().wrap((function n(i){while(1)switch(i.prev=i.next){case 0:o=(r=t.style)===null||r===void 0?void 0:r.getPropertyValue("background");if(o){i.next=3;break}return i.abrupt("return",Promise.resolve(t));case 3:return i.abrupt("return",Promise.resolve(o).then((function(t){return M(t,null,e)})).then((function(e){t.style.setProperty("background",e,t.style.getPropertyPriority("background"));return t})));case 4:case"end":return i.stop()}}),n)})))}function Z(t,e){if(!(t instanceof HTMLImageElement)||h(t.src)){return Promise.resolve(t)}var r=t.src;return Promise.resolve(r).then((function(t){return _(t,e)})).then((function(t){return d(t.blob,s(r)||t.contentType)})).then((function(e){return new Promise((function(r,n){t.onload=r;t.onerror=n;t.srcset="";t.src=e}))})).then((function(){return t}),(function(){return t}))}function tt(t,e){return J(this,void 0,void 0,z().mark((function r(){var n,o;return z().wrap((function r(i){while(1)switch(i.prev=i.next){case 0:n=g(t.childNodes);o=n.map((function(t){return K(t,e)}));return i.abrupt("return",Promise.all(o).then((function(){return t})));case 3:case"end":return i.stop()}}),r)})))}function et(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */et=function e(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function t(e,r,n){return e[r]=n}}function f(t,e,r,o){var i=e&&e.prototype instanceof h?e:h,a=Object.create(i.prototype),u=new S(o||[]);return n(a,"_invoke",{value:x(t,r,u)}),a}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=f;var l={};function h(){}function d(){}function p(){}var v={};c(v,i,(function(){return this}));var y=Object.getPrototypeOf,g=y&&y(y(k([])));g&&g!==e&&r.call(g,i)&&(v=g);var m=p.prototype=h.prototype=Object.create(v);function w(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){function o(n,i,a,u){var c=s(t[n],t,i);if("throw"!==c.type){var f=c.arg,l=f.value;return l&&"object"==babelHelpers["typeof"](l)&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){o("next",t,a,u)}),(function(t){o("throw",t,a,u)})):e.resolve(l).then((function(t){f.value=t,a(f)}),(function(t){return o("throw",t,a,u)}))}u(c.arg)}var i;n(this,"_invoke",{value:function t(r,n){function a(){return new e((function(t,e){o(r,n,t,e)}))}return i=i?i.then(a,a):a()}})}function x(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return _()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=L(a,r);if(u){if(u===l)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=s(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===l)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function L(t,e){var r=e.method,n=t.iterator[r];if(undefined===n)return e.delegate=null,"throw"===r&&t.iterator["return"]&&(e.method="return",e.arg=undefined,L(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),l;var o=s(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,l;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=undefined),e.delegate=null,l):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function E(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 S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function k(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=undefined,e.done=!0,e};return o.next=o}}return{next:_}}function _(){return{value:undefined,done:!0}}return d.prototype=p,n(m,"constructor",{value:p,configurable:!0}),n(p,"constructor",{value:d,configurable:!0}),d.displayName=c(p,u,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,c(t,u,"GeneratorFunction")),t.prototype=Object.create(m),t},t.awrap=function(t){return{__await:t}},w(b.prototype),c(b.prototype,a,(function(){return this})),t.AsyncIterator=b,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new b(f(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},w(m),c(m,u,"Generator"),c(m,i,(function(){return this})),c(m,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=k,S.prototype={constructor:S,reset:function t(e){if(this.prev=0,this.next=0,this.sent=this._sent=undefined,this.done=!1,this.delegate=null,this.method="next",this.arg=undefined,this.tryEntries.forEach(P),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=undefined)},stop:function t(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function t(e){if(this.done)throw e;var n=this;function o(t,r){return u.type="throw",u.arg=e,n.next=t,r&&(n.method="next",n.arg=undefined),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),f=r.call(a,"finallyLoc");if(c&&f){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!f)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function t(e,n){for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=n&&n<=a.finallyLoc&&(a=null);var u=a?a.completion:{};return u.type=e,u.arg=n,a?(this.method="next",this.next=a.finallyLoc,l):this.complete(u)},complete:function t(e,r){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&r&&(this.next=r),l},finish:function t(e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),l}},catch:function t(e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc===e){var o=n.completion;if("throw"===o.type){var i=o.arg;P(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function t(e,r,n){return this.delegate={iterator:k(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=undefined),l}},t}var rt=undefined&&undefined.__awaiter||function(t,e,r,n){function o(t){return t instanceof r?t:new r((function(e){e(t)}))}return new(r||(r=Promise))((function(r,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n["throw"](t))}catch(t){i(t)}}function c(t){t.done?r(t.value):o(t.value).then(a,u)}c((n=n.apply(t,e||[])).next())}))};var nt={};function ot(t){return rt(this,void 0,void 0,et().mark((function e(){return et().wrap((function e(r){while(1)switch(r.prev=r.next){case 0:return r.abrupt("return",new Promise((function(e,r){if(!t.ownerDocument){r(new Error("Provided element is not within a Document"))}e(g(t.ownerDocument.styleSheets))})).then((function(t){return ut(t)})).then(ct));case 1:case"end":return r.stop()}}),e)})))}function it(t,e){return rt(this,void 0,void 0,et().mark((function r(){return et().wrap((function r(n){while(1)switch(n.prev=n.next){case 0:return n.abrupt("return",(e.fontEmbedCss!=null?Promise.resolve(e.fontEmbedCss):at(t,e)).then((function(e){var r=document.createElement("style");var n=document.createTextNode(e);r.appendChild(n);if(t.firstChild){t.insertBefore(r,t.firstChild)}else{t.appendChild(r)}return t})));case 1:case"end":return n.stop()}}),r)})))}function at(t,e){return rt(this,void 0,void 0,et().mark((function r(){return et().wrap((function r(n){while(1)switch(n.prev=n.next){case 0:return n.abrupt("return",ot(t).then((function(t){return Promise.all(t.map((function(t){var r=t.parentStyleSheet?t.parentStyleSheet.href:null;return M(t.cssText,r,e)})))})).then((function(t){return t.join("\n")})));case 1:case"end":return n.stop()}}),r)})))}function ut(t){return rt(this,void 0,void 0,et().mark((function e(){var r,n;return et().wrap((function e(o){while(1)switch(o.prev=o.next){case 0:r=[];n=[];t.forEach((function(e){if("cssRules"in e){try{g(e.cssRules).forEach((function(t,r){if(t.type===CSSRule.IMPORT_RULE){var o=r+1;n.push(st(t.href,e).then(lt).then((function(t){var r=ft(t);r.forEach((function(t){try{e.insertRule(t,t.startsWith("@import")?o=o+1:e.cssRules.length)}catch(e){console.log("Error inserting rule from remote css",{rule:t,error:e})}}))}))["catch"]((function(t){console.log("Error loading remote css",t.toString())})))}}))}catch(o){var r=t.find((function(t){return t.href===null}))||document.styleSheets[0];if(e.href!=null){n.push(st(e.href,r).then(lt).then((function(t){var n=ft(t);n.forEach((function(t){r.insertRule(t,e.cssRules.length)}))}))["catch"]((function(t){console.log("Error loading remote stylesheet",t.toString())})))}console.log("Error inlining remote css file",o.toString())}}}));return o.abrupt("return",Promise.all(n).then((function(){t.forEach((function(t){if("cssRules"in t){try{g(t.cssRules).forEach((function(t){r.push(t)}))}catch(e){console.log("Error while reading CSS rules from ".concat(t.href),e.toString())}}}));return r})));case 4:case"end":return o.stop()}}),e)})))}function ct(t){return t.filter((function(t){return t.type===CSSRule.FONT_FACE_RULE})).filter((function(t){return D(t.style.getPropertyValue("src"))}))}function ft(t){if(t===undefined){return[]}var e=t;var r=[];var n="((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})";var o="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]"+"*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})";var i=/(\/\*[\s\S]*?\*\/)/gi;var a=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi;e=e.replace(i,"");var u=new RegExp(n,"gi");var c;while(true){c=u.exec(e);if(c===null){break}r.push(c[0])}e=e.replace(u,"");var f=new RegExp(o,"gi");while(true){c=a.exec(e);if(c===null){c=f.exec(e);if(c===null){break}else{a.lastIndex=f.lastIndex}}else{f.lastIndex=a.lastIndex}r.push(c[0])}return r}function st(t,e){if(nt[t]){return nt[t]}var r=fetch(t,{mode:"no-cors"}).then((function(e){return{url:t,cssText:e.text()}}),(function(t){console.log("ERROR FETCHING CSS: ",t.toString())}));nt[t]=r;return r}function lt(t){return rt(this,void 0,void 0,et().mark((function e(){return et().wrap((function e(r){while(1)switch(r.prev=r.next){case 0:return r.abrupt("return",t.cssText.then((function(e){var r=e;var n=/url\(["']?([^"')]+)["']?\)/g;var o=r.match(/url\([^)]+\)/g)||[];var i=o.map((function(e){var o=e.replace(n,"$1");if(!o.startsWith("https://")){var i=t.url;o=new URL(o,i).href}return new Promise((function(t,n){fetch(o,{mode:"no-cors"}).then((function(t){return t.blob()})).then((function(n){var o=new FileReader;o.addEventListener("load",(function(n){r=r.replace(e,"url(".concat(o.result,")"));t([e,o.result])}));o.readAsDataURL(n)}))["catch"](n)}))}));return Promise.all(i).then((function(){return r}))})));case 1:case"end":return r.stop()}}),e)})))}function ht(t,e,r){var n="http://www.w3.org/2000/svg";var o=document.createElementNS(n,"svg");var i=document.createElementNS(n,"foreignObject");o.setAttributeNS("","width","".concat(e));o.setAttributeNS("","height","".concat(r));o.setAttributeNS("","viewBox","0 0 ".concat(e," ").concat(r));i.setAttributeNS("","width","100%");i.setAttributeNS("","height","100%");i.setAttributeNS("","x","0");i.setAttributeNS("","y","0");i.setAttributeNS("","externalResourcesRequired","true");o.appendChild(i);i.appendChild(t);return E(o)}function dt(t,e){var r=t.style;if(e.backgroundColor){r.backgroundColor=e.backgroundColor}if(e.width){r.width="".concat(e.width,"px")}if(e.height){r.height="".concat(e.height,"px")}var n=e.style;if(n!=null){Object.keys(n).forEach((function(t){r[t]=n[t]}))}return t}function pt(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */pt=function e(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function t(e,r,n){return e[r]=n}}function f(t,e,r,o){var i=e&&e.prototype instanceof h?e:h,a=Object.create(i.prototype),u=new S(o||[]);return n(a,"_invoke",{value:x(t,r,u)}),a}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=f;var l={};function h(){}function d(){}function p(){}var v={};c(v,i,(function(){return this}));var y=Object.getPrototypeOf,g=y&&y(y(k([])));g&&g!==e&&r.call(g,i)&&(v=g);var m=p.prototype=h.prototype=Object.create(v);function w(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){function o(n,i,a,u){var c=s(t[n],t,i);if("throw"!==c.type){var f=c.arg,l=f.value;return l&&"object"==babelHelpers["typeof"](l)&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){o("next",t,a,u)}),(function(t){o("throw",t,a,u)})):e.resolve(l).then((function(t){f.value=t,a(f)}),(function(t){return o("throw",t,a,u)}))}u(c.arg)}var i;n(this,"_invoke",{value:function t(r,n){function a(){return new e((function(t,e){o(r,n,t,e)}))}return i=i?i.then(a,a):a()}})}function x(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return _()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=L(a,r);if(u){if(u===l)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=s(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===l)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function L(t,e){var r=e.method,n=t.iterator[r];if(undefined===n)return e.delegate=null,"throw"===r&&t.iterator["return"]&&(e.method="return",e.arg=undefined,L(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),l;var o=s(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,l;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=undefined),e.delegate=null,l):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function E(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 S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function k(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=undefined,e.done=!0,e};return o.next=o}}return{next:_}}function _(){return{value:undefined,done:!0}}return d.prototype=p,n(m,"constructor",{value:p,configurable:!0}),n(p,"constructor",{value:d,configurable:!0}),d.displayName=c(p,u,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,c(t,u,"GeneratorFunction")),t.prototype=Object.create(m),t},t.awrap=function(t){return{__await:t}},w(b.prototype),c(b.prototype,a,(function(){return this})),t.AsyncIterator=b,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new b(f(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},w(m),c(m,u,"Generator"),c(m,i,(function(){return this})),c(m,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=k,S.prototype={constructor:S,reset:function t(e){if(this.prev=0,this.next=0,this.sent=this._sent=undefined,this.done=!1,this.delegate=null,this.method="next",this.arg=undefined,this.tryEntries.forEach(P),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=undefined)},stop:function t(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function t(e){if(this.done)throw e;var n=this;function o(t,r){return u.type="throw",u.arg=e,n.next=t,r&&(n.method="next",n.arg=undefined),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),f=r.call(a,"finallyLoc");if(c&&f){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!f)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function t(e,n){for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var a=i;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=n&&n<=a.finallyLoc&&(a=null);var u=a?a.completion:{};return u.type=e,u.arg=n,a?(this.method="next",this.next=a.finallyLoc,l):this.complete(u)},complete:function t(e,r){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&r&&(this.next=r),l},finish:function t(e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),l}},catch:function t(e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc===e){var o=n.completion;if("throw"===o.type){var i=o.arg;P(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function t(e,r,n){return this.delegate={iterator:k(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=undefined),l}},t}var vt=undefined&&undefined.__awaiter||function(t,e,r,n){function o(t){return t instanceof r?t:new r((function(e){e(t)}))}return new(r||(r=Promise))((function(r,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function u(t){try{c(n["throw"](t))}catch(t){i(t)}}function c(t){t.done?r(t.value):o(t.value).then(a,u)}c((n=n.apply(t,e||[])).next())}))};function yt(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var r=e.width||w(t);var n=e.height||b(t);return{width:r,height:n}}function gt(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};return vt(this,void 0,void 0,pt().mark((function r(){var n,o,i;return pt().wrap((function r(a){while(1)switch(a.prev=a.next){case 0:n=yt(t,e),o=n.width,i=n.height;return a.abrupt("return",I(t,e,true).then((function(t){return it(t,e)})).then((function(t){return K(t,e)})).then((function(t){return dt(t,e)})).then((function(t){return ht(t,o,i)})));case 2:case"end":return a.stop()}}),r)})))}function mt(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};return vt(this,void 0,void 0,pt().mark((function r(){return pt().wrap((function r(n){while(1)switch(n.prev=n.next){case 0:return n.abrupt("return",gt(t,e).then(L).then(l(100)).then((function(r){var n=document.createElement("canvas");var o=n.getContext("2d");var i=e.pixelRatio||x();var a=yt(t,e),u=a.width,c=a.height;var f=e.canvasWidth||u;var s=e.canvasHeight||c;n.width=f*i;n.height=s*i;n.style.width="".concat(f);n.style.height="".concat(s);if(e.backgroundColor){o.fillStyle=e.backgroundColor;o.fillRect(0,0,n.width,n.height)}o.drawImage(r,0,0,n.width,n.height);return n})));case 1:case"end":return n.stop()}}),r)})))}function wt(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};return vt(this,void 0,void 0,pt().mark((function r(){return pt().wrap((function r(n){while(1)switch(n.prev=n.next){case 0:return n.abrupt("return",mt(t,e).then((function(t){return t.toDataURL("image/jpeg",e.quality||1)})));case 1:case"end":return n.stop()}}),r)})))}function bt(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};return vt(this,void 0,void 0,pt().mark((function r(){return pt().wrap((function r(n){while(1)switch(n.prev=n.next){case 0:return n.abrupt("return",mt(t,e).then(y));case 1:case"end":return n.stop()}}),r)})))}var xt=function(){function t(){babelHelpers.classCallCheck(this,t)}babelHelpers.createClass(t,null,[{key:"makeBlockScreenshot",value:function t(n){var o=e.PageObject.getEditorWindow();if(o!==window){return o.BX.Landing.Screenshoter.makeBlockScreenshot(n)}var i=document.querySelector("#block".concat(n));r.Dom.addClass(i,"landing-hide-ui-controls");var a=new Map;var u=r.Reflection.getClass("BX.Landing.OnscrollAnimationHelper");var c=u.getBlockAnimatedElements(i);var f=function(){if(r.Type.isArrayFilled(c)){return Promise.all(c.map((function(t){return u.animateElement(t)})))}return Promise.resolve()}();return f.then((function(){return wt(i,{backgroundColor:"#ffffff",cacheBust:true}).then((function(t){r.Dom.removeClass(i,"landing-hide-ui-controls");return fetch(t,{mode:"no-cors"}).then((function(t){return t.blob()})).then((function(t){a.forEach((function(t,e){e.setValue(t.sourceValue,true,true)}));return new File([t],"block-".concat(n,"-preview.jpg"),{type:"image/jpg"})}))}))}))}},{key:"makeElementScreenshot",value:function t(n){var o=e.PageObject.getEditorWindow();if(o!==window){return o.BX.Landing.Screenshoter.makeElementScreenshot(n)}return bt(n).then((function(t){return new File([t],"screenshot-".concat(r.Text.getRandom(16),".png"),{type:"image/png"})}))}}]);return t}();t.Screenshoter=xt})(this.BX.Landing=this.BX.Landing||{},BX.Landing,BX); //# sourceMappingURL=screenshoter.bundle.map.js