diff --git a/dynamicpolyfill.min.js b/dynamicpolyfill.min.js index 5070409..cc6001a 100644 --- a/dynamicpolyfill.min.js +++ b/dynamicpolyfill.min.js @@ -1 +1 @@ -function dynamicPolyfill(n,i,o){return t(n,i,o)}function t(n,t,o){i(n).then(r(t,o)).catch(function(n){return n})}function i(n){for(var t=n.length,i=[],r=0;r=1&&f in c||e in this||i.push(e)}if(i.length>0)return o(i)}function o(n){return new Promise(function(t,i){var o=document.t("script");o.i="https://polyfill.io/v3/polyfill.min.js?features="+encodeURIComponent(n),document.r.o(o),o.e=function(n){return i("Loading the polyfill(s) failed!",n)},o.u=function(){return t("Polyfill(s) loaded!")}})}function r(n,t){if(Array.isArray(n)){var i=[];n.forEach(function(n){i.push(e(n))}),Promise.all(i).then(()=>u(t)).catch(function(n){return n})}else{if(Array.isArray(n)||null===n||""===n)return u(t);e(n).then(()=>u(t)).catch(function(n){return n})}}function e(n){return new Promise(function(t,i){var o=document.t("script");o.i=encodeURI(n),document.r.o(o),o.e=function(n){return i("Loading the script failed!",n)},o.u=function(){return t(n)}})}function u(n){function t(n){try{new Function(n)()}catch(n){}}Array.isArray(n)?n.forEach(function(n){t(n)}):t(n)} +function dynamicPolyfill(n,i,t){var o=[];if(Array.isArray(n)){n.forEach(function(n){o.push(e(n))})}else{o.push(e(n))}Promise.all(o).then(function(){u(i,t)}).catch(function(n){return n})}function e(n){var i=".";var t=n.split(i);var o=window[t[0]];var e=new Object(t[t.length-1]);if(typeof window.i=="undefined"||!n in window||n.indexOf(i)>=1&&!e in o||!n in this){r(n)}}function r(o){return new Promise(function(n,i){var t=document.createElement("script");t.src="https://polyfill.io/v3/polyfill.min.js?features="+encodeURIComponent(o);document.body.appendChild(t);t.onerror=function(n){return i("Loading the polyfill(s) failed!",n)};t.onload=function(){return n}})}function u(n,i){if(Array.isArray(n)){var t=[];n.forEach(function(n){t.push(o(n))});Promise.all(t).then(function(){c(i)}).catch(function(n){return n})}else if(!Array.isArray(n)&&n!==null&&n!==""){o(n).then(function(){c(i)}).catch(function(n){return n})}else{c(i)}}function o(o){return new Promise(function(n,i){var t=document.createElement("script");t.src=encodeURI(o);document.body.appendChild(t);t.onerror=function(n){return i("Loading the script failed!",n)};t.onload=function(){return n(o)}})}function c(n){if(Array.isArray(n)){n.forEach(function(n){i(n)})}else{i(n)}function i(n){try{window[n]}catch(n){console.error("There was an error: ",n,n.name,n.stack)}}}