-
Notifications
You must be signed in to change notification settings - Fork 18
/
imgix-js-core.umd.js
1 lines (1 loc) · 18.8 KB
/
imgix-js-core.umd.js
1
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).ImgixClient=e()}(this,function(){"use strict";function i(e,t){var r,n=Object.keys(e);return Object.getOwnPropertySymbols&&(r=Object.getOwnPropertySymbols(e),t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)),n}function c(n){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?i(Object(o),!0).forEach(function(t){var e,r;e=n,r=o[t=t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):i(Object(o)).forEach(function(t){Object.defineProperty(n,t,Object.getOwnPropertyDescriptor(o,t))})}return n}function f(t){return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function h(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function d(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i=[],a=!0,u=!1;try{for(r=r.call(t);!(a=(n=r.next()).done)&&(i.push(n.value),!e||i.length!==e);a=!0);}catch(t){u=!0,o=t}finally{try{a||null==r.return||r.return()}finally{if(u)throw o}}return i}}(t,e)||y(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(t){return function(t){if(Array.isArray(t))return n(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||y(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function y(t,e){if(t){if("string"==typeof t)return n(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(r="Object"===r&&t.constructor?t.constructor.name:r)||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(t,e):void 0}}function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var p="3.7.2",g="function"==typeof atob,t="function"==typeof btoa,e="function"==typeof Buffer;const b="function"==typeof TextDecoder?new TextDecoder:void 0,v="function"==typeof TextEncoder?new TextEncoder:void 0;const u=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),a=(t=>{let r={};return t.forEach((t,e)=>r[t]=e),r})(u),m=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,s=String.fromCharCode.bind(String),w="function"==typeof Uint8Array.from?Uint8Array.from.bind(Uint8Array):(t,e=t=>t)=>new Uint8Array(Array.prototype.slice.call(t,0).map(e)),A=t=>t.replace(/=/g,"").replace(/[+\/]/g,t=>"+"==t?"-":"_"),S=t=>t.replace(/[^A-Za-z0-9\+\/]/g,"");var x=e=>{let r,n,o,i,a="";var t=e.length%3;for(let t=0;t<e.length;){if(255<(n=e.charCodeAt(t++))||255<(o=e.charCodeAt(t++))||255<(i=e.charCodeAt(t++)))throw new TypeError("invalid character found");r=n<<16|o<<8|i,a+=u[r>>18&63]+u[r>>12&63]+u[r>>6&63]+u[63&r]}return t?a.slice(0,t-3)+"===".substring(t):a};const T=t?t=>btoa(t):e?t=>Buffer.from(t,"binary").toString("base64"):x,P=e?t=>Buffer.from(t).toString("base64"):r=>{let n=[];for(let t=0,e=r.length;t<e;t+=4096)n.push(s.apply(null,r.subarray(t,t+4096)));return T(n.join(""))},r=(t,e=!1)=>e?A(P(t)):P(t),U=t=>{var e;return t.length<2?(e=t.charCodeAt(0))<128?t:e<2048?s(192|e>>>6)+s(128|63&e):s(224|e>>>12&15)+s(128|e>>>6&63)+s(128|63&e):(e=65536+1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320),s(240|e>>>18&7)+s(128|e>>>12&63)+s(128|e>>>6&63)+s(128|63&e))},B=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,C=t=>t.replace(B,U),R=e?t=>Buffer.from(t,"utf8").toString("base64"):v?t=>P(v.encode(t)):t=>T(C(t)),o=(t,e=!1)=>e?A(R(t)):R(t);t=t=>o(t,!0);const E=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,j=t=>{switch(t.length){case 4:var e=((7&t.charCodeAt(0))<<18|(63&t.charCodeAt(1))<<12|(63&t.charCodeAt(2))<<6|63&t.charCodeAt(3))-65536;return s(55296+(e>>>10))+s(56320+(1023&e));case 3:return s((15&t.charCodeAt(0))<<12|(63&t.charCodeAt(1))<<6|63&t.charCodeAt(2));default:return s((31&t.charCodeAt(0))<<6|63&t.charCodeAt(1))}},_=t=>t.replace(E,j);var O=e=>{if(e=e.replace(/\s+/g,""),!m.test(e))throw new TypeError("malformed base64.");e+="==".slice(2-(3&e.length));let r,n="",o,i;for(let t=0;t<e.length;)r=a[e.charAt(t++)]<<18|a[e.charAt(t++)]<<12|(o=a[e.charAt(t++)])<<6|(i=a[e.charAt(t++)]),n+=64===o?s(r>>16&255):64===i?s(r>>16&255,r>>8&255):s(r>>16&255,r>>8&255,255&r);return n};const I=g?t=>atob(S(t)):e?t=>Buffer.from(t,"base64").toString("binary"):O,L=e?t=>w(Buffer.from(t,"base64")):t=>w(I(t),t=>t.charCodeAt(0)),k=t=>L(z(t)),F=e?t=>Buffer.from(t,"base64").toString("utf8"):b?t=>b.decode(L(t)):t=>_(I(t)),z=t=>S(t.replace(/[-_]/g,t=>"-"==t?"+":"/")),D=t=>F(z(t));function W(){var t=(t,e)=>Object.defineProperty(String.prototype,t,M(e));t("fromBase64",function(){return D(this)}),t("toBase64",function(t){return o(this,t)}),t("toBase64URI",function(){return o(this,!0)}),t("toBase64URL",function(){return o(this,!0)}),t("toUint8Array",function(){return k(this)})}function H(){var t=(t,e)=>Object.defineProperty(Uint8Array.prototype,t,M(e));t("toBase64",function(t){return r(this,t)}),t("toBase64URI",function(){return r(this,!0)}),t("toBase64URL",function(){return r(this,!0)})}const M=t=>({value:t,enumerable:!1,writable:!0,configurable:!0});const Z={version:p,VERSION:"3.7.2",atob:I,atobPolyfill:O,btoa:T,btoaPolyfill:x,fromBase64:D,toBase64:o,encode:o,encodeURI:t,encodeURL:t,utob:C,btou:_,decode:D,isValid:t=>{if("string"!=typeof t)return!1;t=t.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(t)||!/[^\s0-9a-zA-Z\-_]/.test(t)},fromUint8Array:r,toUint8Array:k,extendString:W,extendUint8Array:H,extendBuiltins:()=>{W(),H()}};function q(t,e){return t(e={exports:{}},e.exports),e.exports}function N(t){return null!=t&&(G(t)||"function"==typeof(e=t).readFloatLE&&"function"==typeof e.slice&&G(e.slice(0,0))||!!t._isBuffer);var e}var Q=q(function(t){var i,r;i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r={rotl:function(t,e){return t<<e|t>>>32-e},rotr:function(t,e){return t<<32-e|t>>>e},endian:function(t){if(t.constructor==Number)return 16711935&r.rotl(t,8)|4278255360&r.rotl(t,24);for(var e=0;e<t.length;e++)t[e]=r.endian(t[e]);return t},randomBytes:function(t){for(var e=[];0<t;t--)e.push(Math.floor(256*Math.random()));return e},bytesToWords:function(t){for(var e=[],r=0,n=0;r<t.length;r++,n+=8)e[n>>>5]|=t[r]<<24-n%32;return e},wordsToBytes:function(t){for(var e=[],r=0;r<32*t.length;r+=8)e.push(t[r>>>5]>>>24-r%32&255);return e},bytesToHex:function(t){for(var e=[],r=0;r<t.length;r++)e.push((t[r]>>>4).toString(16)),e.push((15&t[r]).toString(16));return e.join("")},hexToBytes:function(t){for(var e=[],r=0;r<t.length;r+=2)e.push(parseInt(t.substr(r,2),16));return e},bytesToBase64:function(t){for(var e=[],r=0;r<t.length;r+=3)for(var n=t[r]<<16|t[r+1]<<8|t[r+2],o=0;o<4;o++)8*r+6*o<=8*t.length?e.push(i.charAt(n>>>6*(3-o)&63)):e.push("=");return e.join("")},base64ToBytes:function(t){t=t.replace(/[^A-Z0-9+\/]/gi,"");for(var e=[],r=0,n=0;r<t.length;n=++r%4)0!=n&&e.push((i.indexOf(t.charAt(r-1))&Math.pow(2,-2*n+8)-1)<<2*n|i.indexOf(t.charAt(r))>>>6-2*n);return e}},t.exports=r}),V={utf8:{stringToBytes:function(t){return V.bin.stringToBytes(unescape(encodeURIComponent(t)))},bytesToString:function(t){return decodeURIComponent(escape(V.bin.bytesToString(t)))}},bin:{stringToBytes:function(t){for(var e=[],r=0;r<t.length;r++)e.push(255&t.charCodeAt(r));return e},bytesToString:function(t){for(var e=[],r=0;r<t.length;r++)e.push(String.fromCharCode(t[r]));return e.join("")}}},$=V;function G(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}var J=q(function(t){function g(l,f){l.constructor==String?l=(f&&"binary"===f.encoding?w:v).stringToBytes(l):m(l)?l=Array.prototype.slice.call(l,0):Array.isArray(l)||(l=l.toString());for(var t=b.bytesToWords(l),f=8*l.length,e=1732584193,r=-271733879,n=-1732584194,o=271733878,i=0;i<t.length;i++)t[i]=16711935&(t[i]<<8|t[i]>>>24)|4278255360&(t[i]<<24|t[i]>>>8);t[f>>>5]|=128<<f%32,t[14+(64+f>>>9<<4)]=f;for(var a=g._ff,u=g._gg,s=g._hh,c=g._ii,i=0;i<t.length;i+=16){var h=e,d=r,y=n,p=o,e=a(e,r,n,o,t[i+0],7,-680876936),o=a(o,e,r,n,t[i+1],12,-389564586),n=a(n,o,e,r,t[i+2],17,606105819),r=a(r,n,o,e,t[i+3],22,-1044525330);e=a(e,r,n,o,t[i+4],7,-176418897),o=a(o,e,r,n,t[i+5],12,1200080426),n=a(n,o,e,r,t[i+6],17,-1473231341),r=a(r,n,o,e,t[i+7],22,-45705983),e=a(e,r,n,o,t[i+8],7,1770035416),o=a(o,e,r,n,t[i+9],12,-1958414417),n=a(n,o,e,r,t[i+10],17,-42063),r=a(r,n,o,e,t[i+11],22,-1990404162),e=a(e,r,n,o,t[i+12],7,1804603682),o=a(o,e,r,n,t[i+13],12,-40341101),n=a(n,o,e,r,t[i+14],17,-1502002290),e=u(e,r=a(r,n,o,e,t[i+15],22,1236535329),n,o,t[i+1],5,-165796510),o=u(o,e,r,n,t[i+6],9,-1069501632),n=u(n,o,e,r,t[i+11],14,643717713),r=u(r,n,o,e,t[i+0],20,-373897302),e=u(e,r,n,o,t[i+5],5,-701558691),o=u(o,e,r,n,t[i+10],9,38016083),n=u(n,o,e,r,t[i+15],14,-660478335),r=u(r,n,o,e,t[i+4],20,-405537848),e=u(e,r,n,o,t[i+9],5,568446438),o=u(o,e,r,n,t[i+14],9,-1019803690),n=u(n,o,e,r,t[i+3],14,-187363961),r=u(r,n,o,e,t[i+8],20,1163531501),e=u(e,r,n,o,t[i+13],5,-1444681467),o=u(o,e,r,n,t[i+2],9,-51403784),n=u(n,o,e,r,t[i+7],14,1735328473),e=s(e,r=u(r,n,o,e,t[i+12],20,-1926607734),n,o,t[i+5],4,-378558),o=s(o,e,r,n,t[i+8],11,-2022574463),n=s(n,o,e,r,t[i+11],16,1839030562),r=s(r,n,o,e,t[i+14],23,-35309556),e=s(e,r,n,o,t[i+1],4,-1530992060),o=s(o,e,r,n,t[i+4],11,1272893353),n=s(n,o,e,r,t[i+7],16,-155497632),r=s(r,n,o,e,t[i+10],23,-1094730640),e=s(e,r,n,o,t[i+13],4,681279174),o=s(o,e,r,n,t[i+0],11,-358537222),n=s(n,o,e,r,t[i+3],16,-722521979),r=s(r,n,o,e,t[i+6],23,76029189),e=s(e,r,n,o,t[i+9],4,-640364487),o=s(o,e,r,n,t[i+12],11,-421815835),n=s(n,o,e,r,t[i+15],16,530742520),e=c(e,r=s(r,n,o,e,t[i+2],23,-995338651),n,o,t[i+0],6,-198630844),o=c(o,e,r,n,t[i+7],10,1126891415),n=c(n,o,e,r,t[i+14],15,-1416354905),r=c(r,n,o,e,t[i+5],21,-57434055),e=c(e,r,n,o,t[i+12],6,1700485571),o=c(o,e,r,n,t[i+3],10,-1894986606),n=c(n,o,e,r,t[i+10],15,-1051523),r=c(r,n,o,e,t[i+1],21,-2054922799),e=c(e,r,n,o,t[i+8],6,1873313359),o=c(o,e,r,n,t[i+15],10,-30611744),n=c(n,o,e,r,t[i+6],15,-1560198380),r=c(r,n,o,e,t[i+13],21,1309151649),e=c(e,r,n,o,t[i+4],6,-145523070),o=c(o,e,r,n,t[i+11],10,-1120210379),n=c(n,o,e,r,t[i+2],15,718787259),r=c(r,n,o,e,t[i+9],21,-343485551),e=e+h>>>0,r=r+d>>>0,n=n+y>>>0,o=o+p>>>0}return b.endian([e,r,n,o])}var b,v,m,w;b=Q,v=$.utf8,m=N,w=$.bin,g._ff=function(t,e,r,n,o,i,a){t=t+(e&r|~e&n)+(o>>>0)+a;return(t<<i|t>>>32-i)+e},g._gg=function(t,e,r,n,o,i,a){t=t+(e&n|r&~n)+(o>>>0)+a;return(t<<i|t>>>32-i)+e},g._hh=function(t,e,r,n,o,i,a){t=t+(e^r^n)+(o>>>0)+a;return(t<<i|t>>>32-i)+e},g._ii=function(t,e,r,n,o,i,a){t=t+(r^(e|~n))+(o>>>0)+a;return(t<<i|t>>>32-i)+e},g._blocksize=16,g._digestsize=16,t.exports=function(t,e){if(null==t)throw new Error("Illegal argument "+t);t=b.wordsToBytes(g(t,e));return e&&e.asBytes?t:e&&e.asString?w.bytesToString(t):b.bytesToHex(t)}});const K=/\+/g;function X(e=""){try{return decodeURIComponent(""+e)}catch(t){return""+e}}function Y(t=""){const e={};for(const o of(t="?"===t[0]?t.substr(1):t).split("&")){var r,n=o.match(/([^=]+)=?(.*)/)||[];n.length<2||"__proto__"!==(r=X(n[1]))&&"constructor"!==r&&(n=X((n[2]||"").replace(K," ")),e[r]?Array.isArray(e[r])?e[r].push(n):e[r]=[e[r],n]:e[r]=n)}return e}function tt(t,e=!1){return/^\w+:\/\/.+/.test(t)||e&&/^\/\/[^/]+/.test(t)}function et(t){return Y(rt(t).search)}function rt(t="",e){if(!tt(t,!0))return e?rt(e+t):nt(t);const[r="",n,o]=(t.replace(/\\/g,"/").match(/([^:/]+:)?\/\/([^/@]+@)?(.*)/)||[]).splice(1);var[e="",t=""]=(o.match(/([^/?]*)(.*)?/)||[]).splice(1),{pathname:t,search:i,hash:a}=nt(t);return{protocol:r,auth:n?n.substr(0,n.length-1):"",host:e,pathname:t,search:i,hash:a}}function nt(t=""){var[t="",e="",r=""]=(t.match(/([^#?]*)(\?[^#]*)?(#.*)?/)||[]).splice(1);return{pathname:t,search:e,hash:r}}var ot=/^(?:[a-z\d\-_]{1,62}\.){0,125}(?:[a-z\d](?:\-(?=\-*[a-z\d])|[a-z]|\d){0,62}\.)[a-z\d]{1,63}$/i,it={1:75,2:50,3:35,4:23,5:20},at=[1,2,3,4,5],ut={domain:null,useHTTPS:!0,includeLibraryParam:!0,urlPrefix:"https://",secureURLToken:null};function st(t){var e=t.url,e=void 0===e?"":e,t=t.useHttps,t=void 0!==t&&t?"https://":"http://";return tt(e,!0)?rt(e):st({url:t+e})}function ct(t,e){if(!Number.isInteger(t)||!Number.isInteger(e)||t<=0||e<=0||e<t)throw new Error("The min and max srcset widths can only be passed positive Number values, and min must be less than max. Found min: ".concat(t," and max: ").concat(e,"."))}function lt(t){if("number"!=typeof t||t<.01)throw new Error("The srcset widthTolerance must be a number greater than or equal to 0.01")}return function(){function s(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},e=this,r=s;if(!(e instanceof r))throw new TypeError("Cannot call a class as a function");if(this.settings=c(c({},ut),t),this.targetWidthsCache={},"string"!=typeof this.settings.domain)throw new Error("ImgixClient must be passed a valid string domain");if(null==ot.exec(this.settings.domain))throw new Error('Domain must be passed in as fully-qualified domain name and should not include a protocol or any path element, i.e. "example.imgix.net".');this.settings.includeLibraryParam&&(this.settings.libraryParam="js-"+s.version()),this.settings.urlPrefix=this.settings.useHTTPS?"https://":"http://"}var t,e,r;return t=s,r=[{key:"version",value:function(){return"3.5.1"}},{key:"_buildURL",value:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{};if(null==t)return"";var t=st({url:t,useHTTPS:r.useHTTPS}),n=t.host,o=t.pathname,t=c(c({},et(t.search)),e);if(!n.length||!o.length)throw new Error("_buildURL: URL must match {host}/{pathname}?{query}");return new s(c({domain:n},r)).buildURL(o,t)}},{key:"_buildSrcSet",value:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{},n=3<arguments.length&&void 0!==arguments[3]?arguments[3]:{};if(null==t)return"";var t=st({url:t,useHTTPS:n.useHTTPS}),o=t.host,i=t.pathname,t=c(c({},et(t.search)),e);if(!o.length||!i.length)throw new Error("_buildOneStepURL: URL must match {host}/{pathname}?{query}");return new s(c({domain:o},n)).buildSrcSet(i,t,r)}},{key:"targetWidths",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:100,e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:8192,r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:.08,n=3<arguments.length&&void 0!==arguments[3]?arguments[3]:{},o=Math.floor(t),i=Math.floor(e),t=(ct(t,e),lt(r),r+"/"+o+"/"+i);if(t in n)return n[t];if(o===i)return[o];for(var a=[],u=o;u<i;)a.push(Math.round(u)),u*=1+2*r;return a[a.length-1]<i&&a.push(i),n[t]=a}}],(e=[{key:"buildURL",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"",e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},t=this._sanitizePath(t,{encode:!(2<arguments.length&&void 0!==arguments[2]?arguments[2]:{}).disablePathEncoding}),e=this._buildParams(e);return this.settings.secureURLToken&&(e=this._signParams(t,e)),this.settings.urlPrefix+this.settings.domain+t+e}},{key:"_buildParams",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},t=[].concat(l(this.settings.libraryParam?["ixlib=".concat(this.settings.libraryParam)]:[]),l(Object.entries(t).reduce(function(t,e){var e=d(e,2),r=e[0],e=e[1];if(null==e)return t;var n=encodeURIComponent(r),r="64"===r.substr(-2)?Z.encodeURI(e):encodeURIComponent(e);return t.push("".concat(n,"=").concat(r)),t},[])));return"".concat(0<t.length?"?":"").concat(t.join("&"))}},{key:"_signParams",value:function(t,e){t=this.settings.secureURLToken+t+e,t=J(t);return 0<e.length?e+"&s="+t:"?s="+t}},{key:"_sanitizePath",value:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},t=t.replace(/^\//,"");return"/"+(t=!1!==e.encode?/^https?:\/\//.test(t)?encodeURIComponent(t):encodeURI(t).replace(/[#?:+]/g,encodeURIComponent):t)}},{key:"buildSrcSet",value:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{},n=e.w,o=e.h;return n||o?this._buildDPRSrcSet(t,e,r):this._buildSrcSetPairs(t,e,r)}},{key:"_buildSrcSetPairs",value:function(e){var r=this,n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},o=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{};t=void 0!==(a=o).widthTolerance?(lt(a.widthTolerance),a.widthTolerance):.08,i=void 0===a.minWidth?100:a.minWidth,a=void 0===a.maxWidth?8192:a.maxWidth,100==i&&8192==a||ct(i,a);var t=d([t,i,a],3),i=t[0],a=t[1],t=t[2];if(o.widths){var u=o.widths;if(!Array.isArray(u)||!u.length)throw new Error("The widths argument can only be passed a valid non-empty array of integers");if(!u.every(function(t){return Number.isInteger(t)&&0<t}))throw new Error("A custom widths argument can only contain positive integer values");u=l(o.widths)}else u=s.targetWidths(a,t,i,this.targetWidthsCache);return u.map(function(t){return"".concat(r.buildURL(e,c(c({},n),{},{w:t}),{disablePathEncoding:o.disablePathEncoding})," ").concat(t,"w")}).join(",\n")}},{key:"_buildDPRSrcSet",value:function(r){var n=this,o=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},i=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{};if(i.devicePixelRatios){var t=i.devicePixelRatios;if(!Array.isArray(t)||!t.length)throw new Error("The devicePixelRatios argument can only be passed a valid non-empty array of integers");if(!t.every(function(t){return"number"==typeof t&&1<=t&&t<=5}))throw new Error("The devicePixelRatios argument can only contain positive integer values between 1 and 5")}var t=i.devicePixelRatios||at,e=i.disableVariableQuality||!1;if(!e){var a=e;if("boolean"!=typeof a)throw new Error("The disableVariableQuality argument can only be passed a Boolean value")}if(i.variableQualities){a=i.variableQualities;if("object"!==f(a))throw new Error("The variableQualities argument can only be an object")}var u=c(c({},it),i.variableQualities);return(e?t.map(function(t){return"".concat(n.buildURL(r,c(c({},o),{},{dpr:t}),{disablePathEncoding:i.disablePathEncoding})," ").concat(t,"x")}):t.map(function(t){return e=o,t=t,"".concat(n.buildURL(r,c(c({},e),{},{dpr:t,q:e.q||u[t]||u[Math.floor(t)]}),{disablePathEncoding:i.disablePathEncoding})," ").concat(t,"x");var e})).join(",\n")}}])&&h(t.prototype,e),r&&h(t,r),Object.defineProperty(t,"prototype",{writable:!1}),s}()});