!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self).ThumbmarkJS={})}(this,(function(e){"use strict";function n(e,n,r,t){return new(r||(r=Promise))((function(o,a){function i(e){try{c(t.next(e))}catch(e){a(e)}}function u(e){try{c(t.throw(e))}catch(e){a(e)}}function c(e){var n;e.done?o(e.value):(n=e.value,n instanceof r?n:new r((function(e){e(n)}))).then(i,u)}c((t=t.apply(e,n||[])).next())}))}function r(e,n){var r,t,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(u){return function(c){return function(u){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(i=0)),i;)try{if(r=1,t&&(o=2&u[0]?t.return:u[0]?t.throw||((o=t.return)&&o.call(t),0):t.next)&&!(o=o.call(t,u[1])).done)return o;switch(t=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,t=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==u[0]&&2!==u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]>>16,e=Math.imul(e,2246822507),e^=e>>>13,e=Math.imul(e,3266489909),(e^=e>>>16)>>>0}var s=new Uint32Array([597399067,2869860233,951274213,2716044179]);function l(e,n){return e<>>32-n}function d(e,n){var r;if(void 0===n&&(n=0),n=n?0|n:0,"string"==typeof e&&(r=e,e=(new TextEncoder).encode(r).buffer),!(e instanceof ArrayBuffer))throw new TypeError("Expected key to be ArrayBuffer or string");var t=new Uint32Array([n,n,n,n]);!function(e,n){for(var r=e.byteLength/16|0,t=new Uint32Array(e,0,4*r),o=0;o0&&(o[e]=s)}},i=0,u=Object.entries(e);in[o]&&(o=parseInt(a,10));return o}function M(){if("undefined"==typeof navigator)return{name:"unknown",version:"unknown"};for(var e=navigator.userAgent,n={Edg:"Edge",OPR:"Opera"},r=0,t=[/(?Edge|Edg)\/(?\d+(?:\.\d+)?)/,/(?(?:Chrome|Chromium|OPR|Opera|Vivaldi|Brave))\/(?\d+(?:\.\d+)?)/,/(?(?:Firefox|Waterfox|Iceweasel|IceCat))\/(?\d+(?:\.\d+)?)/,/(?Safari)\/(?\d+(?:\.\d+)?)/,/(?MSIE|Trident|IEMobile).+?(?\d+(?:\.\d+)?)/,/(?[A-Za-z]+)\/(?\d+(?:\.\d+)?)/,/(?SamsungBrowser)\/(?\d+(?:\.\d+)?)/];rt&&(r=e,t=n[e])})),r}(e.map((function(e){return n in e?e[n]:void 0})).filter((function(e){return void 0!==e})));t&&(r[n]=t)})),r}function _(){var e=[],n={"prefers-contrast":["high","more","low","less","forced","no-preference"],"any-hover":["hover","none"],"any-pointer":["none","coarse","fine"],pointer:["none","coarse","fine"],hover:["hover","none"],update:["fast","slow"],"inverted-colors":["inverted","none"],"prefers-reduced-motion":["reduce","no-preference"],"prefers-reduced-transparency":["reduce","no-preference"],scripting:["none","initial-only","enabled"],"forced-colors":["active","none"]};return Object.keys(n).forEach((function(r){n[r].forEach((function(n){matchMedia("(".concat(r,": ").concat(n,")")).matches&&e.push("".concat(r,": ").concat(n))}))})),e}function L(){if("https:"===window.location.protocol&&"function"==typeof window.ApplePaySession)try{for(var e=window.ApplePaySession.supportsVersion,n=15;n>0;n--)if(e(n))return n}catch(e){return 0}return 0}"Firefox"!=M().name&&i("fonts",(function(){var e=this;return new Promise((function(t,o){try{!function(e){var t;n(this,void 0,void 0,(function(){var n,o,a;return r(this,(function(r){switch(r.label){case 0:return document.body?[3,2]:[4,(i=50,new Promise((function(e){return setTimeout(e,i,u)})))];case 1:return r.sent(),[3,0];case 2:if((n=document.createElement("iframe")).setAttribute("frameBorder","0"),(o=n.style).setProperty("position","fixed"),o.setProperty("display","block","important"),o.setProperty("visibility","visible"),o.setProperty("border","0"),o.setProperty("opacity","0"),n.src="about:blank",document.body.appendChild(n),!(a=n.contentDocument||(null===(t=n.contentWindow)||void 0===t?void 0:t.document)))throw new Error("Iframe document is not accessible");return e({iframe:a}),setTimeout((function(){document.body.removeChild(n)}),0),[2]}var i,u}))}))}((function(o){var a=o.iframe;return n(e,void 0,void 0,(function(){var e,n,o,i;return r(this,(function(r){return"Hello, world!",e=a.createElement("canvas"),n=e.getContext("2d"),o=T.map((function(e){return k(n,e)})),i={},x.forEach((function(e){var r=k(n,e);o.includes(r)||(i[e]=r)})),t(i),[2]}))}))}))}catch(e){o({error:"unsupported"})}}))})),i("hardware",(function(){return new Promise((function(e,n){var r=void 0!==navigator.deviceMemory?navigator.deviceMemory:0,t=window.performance&&window.performance.memory?window.performance.memory:0;e({videocard:R(),architecture:I(),deviceMemory:r.toString()||"undefined",jsHeapSizeLimit:t.jsHeapSizeLimit||0})}))})),i("locales",(function(){return new Promise((function(e){e({languages:navigator.language,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone})}))})),i("permissions",(function(){return n(this,void 0,void 0,(function(){var e;return r(this,(function(o){return C=(null==t?void 0:t.permissions_to_check)||["accelerometer","accessibility","accessibility-events","ambient-light-sensor","background-fetch","background-sync","bluetooth","camera","clipboard-read","clipboard-write","device-info","display-capture","gyroscope","geolocation","local-fonts","magnetometer","microphone","midi","nfc","notifications","payment-handler","persistent-storage","push","speaker","storage-access","top-level-storage-access","window-management","query"],e=Array.from({length:(null==t?void 0:t.retries)||3},(function(){return function(){return n(this,void 0,void 0,(function(){var e,n,t,o,a;return r(this,(function(r){switch(r.label){case 0:e={},n=0,t=C,r.label=1;case 1:if(!(n0,maxTouchPoints:navigator.maxTouchPoints,colorDepth:screen.colorDepth,mediaMatches:_()})}))})),i("system",(function(){return new Promise((function(e){var n=M();e({platform:window.navigator.platform,cookieEnabled:window.navigator.cookieEnabled,productSub:navigator.productSub,product:navigator.product,useragent:navigator.userAgent,hardwareConcurrency:navigator.hardwareConcurrency,browser:{name:n.name,version:n.version},applePayVersion:L()})}))}));var D,B="SamsungBrowser"!==M().name?1:3,F=null;i("webgl",(function(){return n(this,void 0,void 0,(function(){var e;return r(this,(function(n){"undefined"!=typeof document&&((D=document.createElement("canvas")).width=200,D.height=100,F=D.getContext("webgl"));try{if(!F)throw new Error("WebGL not supported");return e=Array.from({length:B},(function(){return function(){try{if(!F)throw new Error("WebGL not supported");var e="\n attribute vec2 position;\n void main() {\n gl_Position = vec4(position, 0.0, 1.0);\n }\n ",n="\n precision mediump float;\n void main() {\n gl_FragColor = vec4(0.812, 0.195, 0.553, 0.921); // Set line color\n }\n ",r=F.createShader(F.VERTEX_SHADER),t=F.createShader(F.FRAGMENT_SHADER);if(!r||!t)throw new Error("Failed to create shaders");if(F.shaderSource(r,e),F.shaderSource(t,n),F.compileShader(r),!F.getShaderParameter(r,F.COMPILE_STATUS))throw new Error("Vertex shader compilation failed: "+F.getShaderInfoLog(r));if(F.compileShader(t),!F.getShaderParameter(t,F.COMPILE_STATUS))throw new Error("Fragment shader compilation failed: "+F.getShaderInfoLog(t));var o=F.createProgram();if(!o)throw new Error("Failed to create shader program");if(F.attachShader(o,r),F.attachShader(o,t),F.linkProgram(o),!F.getProgramParameter(o,F.LINK_STATUS))throw new Error("Shader program linking failed: "+F.getProgramInfoLog(o));F.useProgram(o);for(var a=137,i=new Float32Array(4*a),u=2*Math.PI/a,c=0;c