native-fn 1.0.53 → 1.0.55

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/dist/native.cjs +1 -1
  2. package/dist/native.min.cjs +1 -1
  3. package/dist/native.min.mjs +1 -1
  4. package/dist/native.mjs +1 -1
  5. package/dist/native.umd.js +1 -1
  6. package/dist/native.umd.min.js +1 -1
  7. package/dist/plugin/app/index.cjs +5 -9
  8. package/dist/plugin/app/index.min.cjs +1 -1
  9. package/dist/plugin/app/index.min.mjs +1 -1
  10. package/dist/plugin/app/index.mjs +5 -9
  11. package/dist/plugin/app/index.umd.js +5 -9
  12. package/dist/plugin/app/index.umd.min.js +1 -1
  13. package/dist/plugin/app/src/plugin/theme/types/theme.d.ts +2 -1
  14. package/dist/plugin/camera/src/plugin/theme/types/theme.d.ts +2 -1
  15. package/dist/plugin/clipboard/index.cjs +519 -2
  16. package/dist/plugin/clipboard/index.min.cjs +1 -1
  17. package/dist/plugin/clipboard/index.min.mjs +1 -1
  18. package/dist/plugin/clipboard/index.mjs +519 -2
  19. package/dist/plugin/clipboard/index.umd.js +519 -2
  20. package/dist/plugin/clipboard/index.umd.min.js +1 -1
  21. package/dist/plugin/clipboard/src/plugin/theme/types/theme.d.ts +2 -1
  22. package/dist/plugin/fullscreen/index.cjs +46 -22
  23. package/dist/plugin/fullscreen/index.min.cjs +1 -1
  24. package/dist/plugin/fullscreen/index.min.mjs +1 -1
  25. package/dist/plugin/fullscreen/index.mjs +46 -22
  26. package/dist/plugin/fullscreen/index.umd.js +46 -22
  27. package/dist/plugin/fullscreen/index.umd.min.js +1 -1
  28. package/dist/plugin/fullscreen/src/plugin/theme/types/theme.d.ts +2 -1
  29. package/dist/plugin/theme/index.cjs +32 -9
  30. package/dist/plugin/theme/index.d.ts +2 -1
  31. package/dist/plugin/theme/index.min.cjs +1 -1
  32. package/dist/plugin/theme/index.min.mjs +1 -1
  33. package/dist/plugin/theme/index.mjs +32 -9
  34. package/dist/plugin/theme/index.umd.js +32 -9
  35. package/dist/plugin/theme/index.umd.min.js +1 -1
  36. package/dist/plugin/theme/src/plugin/theme/types/theme.d.ts +2 -1
  37. package/dist/src/plugin/theme/types/theme.d.ts +2 -1
  38. package/package.json +1 -1
@@ -1 +1 @@
1
- function t(t,e){if(void 0===e&&(e=!0),void 0!==globalThis.document){var n=globalThis.document.createElement(t);return"width"in n&&(n.width="0"),"height"in n&&(n.height="0"),"border"in n&&(n.border="0"),"frameBorder"in n&&(n.frameBorder="0"),"scrolling"in n&&(n.scrolling="no"),"cellPadding"in n&&(n.cellPadding="0"),"cellSpacing"in n&&(n.cellSpacing="0"),"frame"in n&&(n.frame="void"),"rules"in n&&(n.rules="none"),"noWrap"in n&&(n.noWrap=!0),n.tabIndex=-1,n.setAttribute("role","presentation"),e?(n.style.width="1px",n.style.height="1px"):(n.setAttribute("aria-hidden","true"),n.style.width="0",n.style.height="0",n.style.zIndex="-9999",n.style.display="none",n.style.visibility="hidden",n.style.pointerEvents="none"),n.style.position="absolute",n.style.top="0",n.style.left="0",n.style.padding="0",n.style.margin="0",n.style.border="none",n.style.outline="none",n.style.clip="rect(1px, 1px, 1px, 1px)",n.style.clipPath="inset(50%)",n.style.overflow="hidden",n.style.whiteSpace="nowrap",n}}function e(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r="",o=0;o<e.length-2;o++){var i=e[o];void 0!==i&&(r=r+i.charAt(0).toUpperCase()+i.slice(1))}return r}function n(){this.returnValue=!1}function r(){this.cancelBubble=!0}var o=/(animation)(start|iteration|end|cancel)|(transition)(start|run|end|cancel)|(fullscreen)(change|error)|(lost|got)(pointer)(capture)|(pointer)(lock)(change|error)|(pointer)(cancel|down|enter|leave|move|out|over|up)/i,i=["","webkit","moz","ms","MS","o","O"],a={wheel:["wheel","mousewheel","DOMMouseScroll"],focus:["focus","focusin"],blur:["blur","focusout"],beforeinput:["beforeinput","textInput"]},l={useStd:void 0!==globalThis.document&&"function"==typeof globalThis.document.addEventListener,add:function(t,e){void 0===e&&(e={callback:null,options:!1});var o=e.callback;if(void 0!==t&&null!==o){var i=l.withVender(t,e.type),a=e.options;if("function"==typeof t.addEventListener)try{return t.addEventListener(i,o,a)}catch(t){}if("function"==typeof t.addListener)if("boolean"==typeof t.matches)try{return t.addListener(o)}catch(t){}else try{return t.addListener(i,o)}catch(t){}return"function"==typeof t.attachEvent?o.__ieWrapper?t.attachEvent("on"+i,o.__ieWrapper):t.attachEvent("on"+i,o.__ieWrapper=function(e){void 0===e&&(e=globalThis.event),void 0!==e&&(e.currentTarget=t,"function"!=typeof e.preventDefault&&(e.preventDefault=n),"function"!=typeof e.stopPropagation&&(e.stopPropagation=r),"function"==typeof o?o.call(t,e):o&&"function"==typeof o.handleEvent&&o.handleEvent.call(t,e))}):void 0}},remove:function(t,e){void 0===e&&(e={callback:null,options:!1});var n=e.callback;if(void 0!==t&&null!==n){var r=l.withVender(t,e.type),o=e.options;if("function"==typeof t.removeEventListener)try{return t.removeEventListener(r,n,o)}catch(t){}if("function"==typeof t.removeListener)if("boolean"==typeof t.matches)try{return t.removeListener(n)}catch(t){}else try{return t.removeListener(r,n)}catch(t){}if("function"!=typeof t.detachEvent);else{var i=n.__ieWrapper;void 0!==i&&(t.detachEvent("on"+r,i),delete n.__ieWrapper)}}},withVender:function(t,n){if(void 0===n)return"";if("webkitEnterFullscreen"in t&&["webkitbeginfullscreen","webkitendfullscreen","webkitpresentationmodechanged"].indexOf(n)>-1)return n;var r;r=n in a?a[n]:o.test(n)?[n,n.replace(o,e)]:[n];for(var l=0;l<i.length;l++)for(var c=0;c<r.length;c++){var u=i[l]+r[c];if(void 0!==t["on"+u])return u}return""}};function c(t){return null!==t&&"object"==typeof t}function u(t){return c(t)||function(t){return Array.isArray(t)}(t)}function s(t){if(function(t){return c(t)&&"innerHTML"in t}(t))return t.innerHTML;if(u(t))try{return JSON.stringify(t)}catch(e){return""+t}else if("string"!=typeof t)return""+t;return t}function d(){return function(){if("isSecureContext"in window)return globalThis.isSecureContext;var t=location.protocol,e=location.hostname;return"https:"===t||"localhost"===e||"127.0.0.1"===e||"[::1]"===e}()&&"undefined"!=typeof navigator&&"clipboard"in navigator}function p(e){return function(e){if(!globalThis.getSelection||!globalThis.document.createRange)return!1;var n=t("div");if(void 0===n)return!1;n.contentEditable="true",n.innerHTML=e,n.style.whiteSpace="pre",n.style.userSelect="text",n.style.setProperty("-webkit-user-select","text"),n.style.setProperty("-moz-user-select","text"),n.style.setProperty("-ms-user-select","text"),globalThis.document.body.appendChild(n);var r=globalThis.getSelection(),o=globalThis.document.createRange(),i=function(t){try{null!==t.clipboardData&&"function"==typeof t.clipboardData.setData&&(t.preventDefault(),t.clipboardData.setData("text/html",e),t.clipboardData.setData("text/plain",e))}catch(t){}};l.add(globalThis.document,{type:"copy",callback:i,options:{once:!0,capture:!0}});try{if(null===r)return h(n,r,i),!1;r.removeAllRanges(),o.selectNodeContents(n),r.addRange(o);var a=globalThis.document.execCommand("copy");return h(n,r,i),a}catch(t){return h(n,r,i),!1}}(e)||function(t){var e=window.clipboardData;if(void 0!==e&&"function"==typeof e.setData)try{return e.setData("Text",t)}catch(t){return!1}return!1}(e)}function f(){return function(){var e=t("div");if(void 0===e)return null;e.contentEditable="true",globalThis.document.body.appendChild(e),e.focus();var n=null,r=function(t){try{null!==t.clipboardData&&"function"==typeof t.clipboardData.getData&&(t.preventDefault(),n=t.clipboardData.getData("text/html")||t.clipboardData.getData("text/plain")||null)}catch(t){}};l.add(globalThis.document,{type:"paste",callback:r,options:{once:!0,capture:!0}});try{return globalThis.document.execCommand("paste")||n||(n=e.innerHTML||e.textContent||null),v(e,r),n}catch(t){return v(e,r),null}}()||function(){var t=window.clipboardData;if(void 0!==t&&"function"==typeof t.getData)try{return t.getData("Text")||null}catch(t){return null}return null}()||""}function h(t,e,n){null!==e&&e.removeAllRanges(),globalThis.document.body.removeChild(t),l.remove(globalThis.document,{type:"copy",callback:n})}function v(t,e){globalThis.document.body.removeChild(t),l.remove(globalThis.document,{type:"paste",callback:e})}var b={installed:!1,name:"Clipboard",module:{copy:function(t){var e=s(t);return d()&&("write"in navigator.clipboard||"writeText"in navigator.clipboard)?function(t){try{if("ClipboardItem"in window&&"write"in navigator.clipboard)return navigator.clipboard.write([new ClipboardItem({"text/html":new Blob([t],{type:"text/html"}),"text/plain":new Blob([t],{type:"text/plain"})})]).then((function(){return!0})).catch((function(){return!1}));if("writeText"in navigator.clipboard)return navigator.clipboard.writeText(t).then((function(){return!0})).catch((function(){return!1}))}catch(t){return Promise.resolve(!1)}return Promise.resolve(!1)}(e).then((function(t){return!!t||p(e)})).catch((function(){return p(e)})):Promise.resolve(p(e))},paste:function(){return d()&&("read"in navigator.clipboard||"readText"in navigator.clipboard)?function(){try{if("ClipboardItem"in window&&"read"in navigator.clipboard)return navigator.clipboard.read().then((function(t){if(0===t.length)return Promise.resolve(null);for(var e=t[0],n=e.types,r=0;r<n.length;r++)if("text/html"===n[r])return e.getType("text/html").then((function(t){return t.text()})).catch((function(){return null}));for(r=0;r<n.length;r++)if("text/plain"===n[r])return e.getType("text/plain").then((function(t){return t.text()})).catch((function(){return null}));return Promise.resolve(null)})).catch((function(){return null}));if("readText"in navigator.clipboard)return navigator.clipboard.readText().then((function(t){return t})).catch((function(){return null}))}catch(t){return Promise.resolve(null)}return Promise.resolve(null)}().then((function(t){return null!==t?t:f()})).catch((function(){return f()})):Promise.resolve(f())}},Constants:{},Errors:{}};export{b as default};
1
+ function e(e,r){if(void 0===r&&(r=!0),void 0!==globalThis.document){var n=globalThis.document.createElement(e);return"width"in n&&(n.width="0"),"height"in n&&(n.height="0"),"border"in n&&(n.border="0"),"frameBorder"in n&&(n.frameBorder="0"),"scrolling"in n&&(n.scrolling="no"),"cellPadding"in n&&(n.cellPadding="0"),"cellSpacing"in n&&(n.cellSpacing="0"),"frame"in n&&(n.frame="void"),"rules"in n&&(n.rules="none"),"noWrap"in n&&(n.noWrap=!0),n.tabIndex=-1,n.setAttribute("role","presentation"),r?(n.style.width="1px",n.style.height="1px"):(n.setAttribute("aria-hidden","true"),n.style.width="0",n.style.height="0",n.style.zIndex="-9999",n.style.display="none",n.style.visibility="hidden",n.style.pointerEvents="none"),n.style.position="absolute",n.style.top="0",n.style.left="0",n.style.padding="0",n.style.margin="0",n.style.border="none",n.style.outline="none",n.style.clip="rect(1px, 1px, 1px, 1px)",n.style.clipPath="inset(50%)",n.style.overflow="hidden",n.style.whiteSpace="nowrap",n}}function r(e){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];for(var t="",o=0;o<r.length-2;o++){var i=r[o];void 0!==i&&(t=t+i.charAt(0).toUpperCase()+i.slice(1))}return t}function n(){this.returnValue=!1}function t(){this.cancelBubble=!0}var o,i,a,s,l=/(animation)(start|iteration|end|cancel)|(transition)(start|run|end|cancel)|(fullscreen)(change|error)|(lost|got)(pointer)(capture)|(pointer)(lock)(change|error)|(pointer)(cancel|down|enter|leave|move|out|over|up)/i,c=["","webkit","moz","ms","MS","o","O"],u={wheel:["wheel","mousewheel","DOMMouseScroll"],focus:["focus","focusin"],blur:["blur","focusout"],beforeinput:["beforeinput","textInput"]},d={useStd:void 0!==globalThis.document&&"function"==typeof globalThis.document.addEventListener,add:function(e,r){void 0===r&&(r={callback:null,options:!1});var o=r.callback;if(void 0!==e&&null!==o){var i=d.withVender(e,r.type),a=r.options;if("function"==typeof e.addEventListener)try{return e.addEventListener(i,o,a)}catch(e){}if("function"==typeof e.addListener)if("boolean"==typeof e.matches)try{return e.addListener(o)}catch(e){}else try{return e.addListener(i,o)}catch(e){}return"function"==typeof e.attachEvent?o.__ieWrapper?e.attachEvent("on"+i,o.__ieWrapper):e.attachEvent("on"+i,o.__ieWrapper=function(r){void 0===r&&(r=globalThis.event),void 0!==r&&(r.currentTarget=e,"function"!=typeof r.preventDefault&&(r.preventDefault=n),"function"!=typeof r.stopPropagation&&(r.stopPropagation=t),"function"==typeof o?o.call(e,r):o&&"function"==typeof o.handleEvent&&o.handleEvent.call(e,r))}):void 0}},remove:function(e,r){void 0===r&&(r={callback:null,options:!1});var n=r.callback;if(void 0!==e&&null!==n){var t=d.withVender(e,r.type),o=r.options;if("function"==typeof e.removeEventListener)try{return e.removeEventListener(t,n,o)}catch(e){}if("function"==typeof e.removeListener)if("boolean"==typeof e.matches)try{return e.removeListener(n)}catch(e){}else try{return e.removeListener(t,n)}catch(e){}if("function"!=typeof e.detachEvent);else{var i=n.__ieWrapper;void 0!==i&&(e.detachEvent("on"+t,i),delete n.__ieWrapper)}}},withVender:function(e,n){if(void 0===n)return"";if("webkitEnterFullscreen"in e&&["webkitbeginfullscreen","webkitendfullscreen","webkitpresentationmodechanged"].indexOf(n)>-1)return n;var t;t=n in u?u[n]:l.test(n)?[n,n.replace(l,r)]:[n];for(var o=0;o<c.length;o++)for(var i=0;i<t.length;i++){var a=c[o]+t[i];if(void 0!==e["on"+a])return a}return""}};!function(e){e.Unknown="Unknown",e.Android="Android",e.iOS="iOS",e.Windows="Windows",e.MacOS="MacOS"}(o||(o={})),function(e){e.Unknown="Unknown",e.Mobile="Mobile",e.Desktop="Desktop"}(i||(i={})),function(e){e.Unknown="Unknown",e.EdgeHTML="EdgeHTML",e.ArkWeb="ArkWeb",e.Blink="Blink",e.Presto="Presto",e.WebKit="WebKit",e.Trident="Trident",e.NetFront="NetFront",e.KHTML="KHTML",e.Tasman="Tasman",e.Gecko="Gecko"}(a||(a={})),function(e){e.Unknown="Unknown",e.Chrome="Chrome",e.Safari="Safari",e.Edge="Edge",e.Firefox="Firefox",e.Opera="Opera",e.IE="IE",e.SamsungInternet="SamsungInternet"}(s||(s={}));var m="undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:"",f={device:i.Unknown,os:o.Unknown,osVersion:"",engine:a.Unknown,engineVersion:"",browser:s.Unknown,browserVersion:"",renderer:function(){if(void 0===globalThis.document)return"";var e=globalThis.document.createElement("canvas");if("function"!=typeof e.getContext)return"";var r=e.getContext("webgl2")||e.getContext("experimental-webgl")||e.getContext("webgl");if(null===r)return"";if(r instanceof WebGLRenderingContext||"getParameter"in r&&"function"==typeof r.getParameter){var n=r.getExtension("WEBGL_debug_renderer_info");return null===n?r.getParameter(r.RENDERER):r.getParameter(n.UNMASKED_RENDERER_WEBGL)}return""}(),userAgent:m,isMobile:!1,isDesktop:!1,isStandalone:!1,isWebview:/; ?wv|applewebkit(?!.*safari)/i.test(m),isNodeJS:void 0!==globalThis.process&&void 0!==globalThis.process.versions&&void 0!==globalThis.process.versions.node,isElectron:void 0!==globalThis.process&&void 0!==globalThis.process.versions&&void 0!==globalThis.process.versions.electron||/ electron\//i.test(m),isReactNative:"undefined"!=typeof navigator&&"ReactNative"===navigator.product},p=[[/windows nt (6\.[23]); arm/i,o.Windows,h],[/windows (?:phone|mobile|iot)(?: os)?[\/ ]?([\d.]*( se)?)/i,o.Windows,h],[/windows[\/ ](1[01]|2000|3\.1|7|8(\.1)?|9[58]|me|server 20\d\d( r2)?|vista|xp)/i,o.Windows,h],[/windows nt ?([\d.)]*)(?!.+xbox)/i,o.Windows,h],[/\bwin(?=3| ?9|n)(?:nt| 9x )?([\d.;]*)/i,o.Windows,h],[/windows ce\/?([\d.]*)/i,o.Windows,h],[/[adehimnop]{4,7}\b(?:.*os (\w+) like mac|; opera)/i,o.iOS,g],[/(?:ios;fbsv|ios(?=.+ip(?:ad|hone))|ip(?:ad|hone)(?: |.+i(?:pad)?)os)[\/ ]([\w.]+)/i,o.iOS,g],[/cfnetwork\/.+darwin/i,o.iOS,g],[/mac os x ?([\w. ]*)/i,o.MacOS,g],[/(?:macintosh|mac_powerpc\b)(?!.+(haiku|morphos))/i,o.MacOS,g],[/droid ([\w.]+)\b.+(android[- ]x86)/i,o.Android],[/android\w*[-\/.; ]?([\d.]*)/i,o.Android]],b=[[/windows.+ edge\/([\w.]+)/i,a.EdgeHTML],[/arkweb\/([\w.]+)/i,a.ArkWeb],[/webkit\/537\.36.+chrome\/(?!27)([\w.]+)/i,a.Blink],[/presto\/([\w.]+)/i,a.Presto],[/webkit\/([\w.]+)/i,a.WebKit],[/trident\/([\w.]+)/i,a.Trident],[/netfront\/([\w.]+)/i,a.NetFront],[/khtml[\/ ]\(?([\w.]+)/i,a.KHTML],[/tasman[\/ ]\(?([\w.]+)/i,a.Tasman],[/rv:([\w.]{1,9})\b.+gecko/i,a.Gecko]],v=[[/\b(?:crmo|crios)\/([\w.]+)/i,s.Chrome],[/webview.+edge\/([\w.]+)/i,s.Edge],[/edg(?:e|ios|a)?\/([\w.]+)/i,s.Edge],[/opera mini\/([-\w.]+)/i,s.Opera],[/opera [mobileta]{3,6}\b.+version\/([-\w.]+)/i,s.Opera],[/opera(?:.+version\/|[\/ ]+)([\w.]+)/i,s.Opera],[/opios[\/ ]+([\w.]+)/i,s.Opera],[/\bop(?:rg)?x\/([\w.]+)/i,s.Opera],[/\bopr\/([\w.]+)/i,s.Opera],[/iemobile(?:browser|boat|jet)[\/ ]?([\d.]*)/i,s.IE],[/(?:ms|\()ie ([\w.]+)/i,s.IE],[/trident.+rv[: ]([\w.]{1,9})\b.+like gecko/i,s.IE],[/\bfocus\/([\w.]+)/i,s.Firefox],[/\bopt\/([\w.]+)/i,s.Opera],[/coast\/([\w.]+)/i,s.Opera],[/fxios\/([\w.-]+)/i,s.Firefox],[/samsungbrowser\/([\w.]+)/i,s.SamsungInternet],[/headlesschrome(?:\/([\w.]+)| )/i,s.Chrome],[/wv\).+chrome\/([\w.]+).+edgw\//i,s.Edge],[/ wv\).+(chrome)\/([\w.]+)/i,s.Chrome],[/chrome\/([\w.]+) mobile/i,s.Chrome],[/chrome\/v?([\w.]+)/i,s.Chrome],[/version\/([\w.,]+) .*mobile(?:\/\w+ | ?)safari/i,s.Safari],[/iphone .*mobile(?:\/\w+ | ?)safari/i,s.Safari],[/version\/([\w.,]+) .*safari/i,s.Safari],[/webkit.+?(?:mobile ?safari|safari)(\/[\w.]+)/i,s.Safari,"1"],[/(?:mobile|tablet);.*firefox\/([\w.-]+)/i,s.Firefox],[/mobile vr; rv:([\w.]+)\).+firefox/i,s.Firefox],[/firefox\/([\w.]+)/i,s.Firefox]];function h(e){if(void 0===e)return"";var r={"4.90":"ME","NT3.51":"NT 3.11","NT4.0":"NT 4.0","NT 5.0":"2000","NT 5.1":"XP","NT 5.2":"XP","NT 6.0":"Vista","NT 6.1":"7","NT 6.2":"8","NT 6.3":"8.1","NT 6.4":"10","NT 10.0":"10",ARM:"RT"}[e];return void 0!==r?r:e}function g(e){return void 0===e?"":e.replace(/_/g,".")}function w(e,r){return 10===e.major&&0===e.minor&&e.build>=22e3?"11":10===e.major&&0===e.minor&&e.build<22e3?"10":6===e.major&&3===e.minor?"8.1":6===e.major&&2===e.minor?"8":6===e.major&&1===e.minor?"7":6===e.major&&0===e.minor?"Vista":5===e.major&&1===e.minor||5===e.major&&2===e.minor?"XP":5===e.major&&0===e.minor?"2000":4===e.major&&90===e.minor?"ME":4===e.major&&0===e.minor?"NT 4.0":3===e.major&&51===e.minor?"NT 3.11":r}function y(e,r){return"function"==typeof r?r(e):"string"==typeof r?r:void 0===e?"":e}function T(e){var r=e.split(".");return{major:parseInt(r[0]||"0"),minor:parseInt(r[1]||"0"),build:parseInt(r[2]||"0")}}for(var x=0;x<p.length;x++){var j=(D=p[x])[0],k=D[1],E=D[2];if(null!==(M=f.userAgent.match(j))){f.os=k,f.osVersion=y(M[1],E);break}}f.os===o.iOS&&0===function(e,r){for(var n=e.split("."),t=r.split("."),o=Math.max(n.length,t.length),i=0;i<o;i++){var a=void 0,s=void 0;if((a=i<n.length?parseInt(n[i],10):0)>(s=i<t.length?parseInt(t[i],10):0))return 1;if(a<s)return-1}return 0}(f.osVersion,"18.6")&&(null!==(O=/\) Version\/([\d.]+)/.exec(f.userAgent))&&parseInt(O[1].substring(0,2),10)>=26&&(f.osVersion=O[1]));for(x=0;x<b.length;x++){j=(D=b[x])[0];var S=D[1];E=D[2];if(null!==(M=f.userAgent.match(j))){f.engine=S,f.engineVersion=y(M[1],E);break}}for(x=0;x<v.length;x++){j=(D=v[x])[0];var D,M,V=D[1];E=D[2];if(null!==(M=f.userAgent.match(j))){f.browser=V,f.browserVersion=y(M[1],E);break}}if(f.isReactNative)try{k=(A=require("react-native").Platform).OS;var O=T(P=""+A.Version);switch(k){case"android":f.os=o.Android,f.osVersion=function(e,r){return e.major>=36?"16":35===e.major?"15":34===e.major?"14":33===e.major?"13":32===e.major?"12.1":31===e.major?"12":30===e.major?"11":29===e.major?"10":28===e.major?"9":27===e.major?"8.1":26===e.major?"8.0":25===e.major?"7.1":24===e.major?"7.0":23===e.major?"6.0":22===e.major?"5.1":21===e.major?"5.0":20===e.major?"4.4W":19===e.major?"4.4":18===e.major?"4.3":17===e.major?"4.2":16===e.major?"4.1":15===e.major?"4.0.3":14===e.major?"4.0":13===e.major?"3.2":12===e.major?"3.1":11===e.major?"3.0":10===e.major?"2.3.3":9===e.major?"2.3":8===e.major?"2.2":7===e.major?"2.1":6===e.major?"2.0.1":5===e.major?"2.0":4===e.major?"1.6":3===e.major?"1.5":2===e.major?"1.1":1===e.major?"1.0":r}(O,P);break;case"ios":f.os=o.iOS,f.osVersion=P;break;case"windows":f.os=o.Windows,f.osVersion=w(O,P);break;case"macos":f.os=o.MacOS,f.osVersion=P}}catch(e){}if(f.isNodeJS)try{var P,A=(k=require("os")).platform();O=T(P=k.release());switch(A){case"win32":f.os=o.Windows,f.osVersion=w(O,P);break;case"darwin":f.os=o.MacOS,f.osVersion=function(e,r){return e.major>=24?e.major-9+"."+e.minor+"."+e.build:23===e.major?"14."+e.minor+"."+e.build:22===e.major?"13."+e.minor+"."+e.build:21===e.major?"12."+e.minor+"."+e.build:20===e.major?"11."+e.minor+"."+e.build:19===e.major?"10.15."+e.minor:18===e.major?"10.14."+e.minor:17===e.major?"10.13."+e.minor:16===e.major?"10.12."+e.minor:15===e.major?"10.11."+e.minor:14===e.major?"10.10."+e.minor:13===e.major?"10.9."+e.minor:e.major>=5&&e.major<=12?"10."+(e.major-4)+"."+e.minor:r}(O,P);break;case"android":f.os=o.Android,f.osVersion=P;break;case"linux":/android/i.test(P)&&(f.os=o.Android,f.osVersion=P)}}catch(e){}function W(e){return null!==e&&"object"==typeof e}function C(e){return W(e)||function(e){return Array.isArray(e)}(e)}function L(e){if(function(e){return W(e)&&"innerHTML"in e}(e))return e.innerHTML;if(C(e))try{return JSON.stringify(e)}catch(r){return""+e}else if("string"!=typeof e)return""+e;return e}function N(){return function(){if("isSecureContext"in window)return globalThis.isSecureContext;var e=location.protocol,r=location.hostname;return"https:"===e||"localhost"===r||"127.0.0.1"===r||"[::1]"===r}()&&"undefined"!=typeof navigator&&"clipboard"in navigator}function I(r){return function(r){if(!globalThis.getSelection||!globalThis.document.createRange)return!1;var n=e("div");if(void 0===n)return!1;n.contentEditable="true",n.innerHTML=r,n.style.whiteSpace="pre",n.style.userSelect="text",n.style.setProperty("-webkit-user-select","text"),n.style.setProperty("-moz-user-select","text"),n.style.setProperty("-ms-user-select","text"),globalThis.document.body.appendChild(n);var t=globalThis.getSelection(),o=globalThis.document.createRange(),i=function(e){try{null!==e.clipboardData&&"function"==typeof e.clipboardData.setData&&(e.preventDefault(),e.clipboardData.setData("text/html",r),e.clipboardData.setData("text/plain",r))}catch(e){}};d.add(globalThis.document,{type:"copy",callback:i,options:{once:!0,capture:!0}});try{if(null===t)return _(n,t,i),!1;t.removeAllRanges(),o.selectNodeContents(n),t.addRange(o);var a=globalThis.document.execCommand("copy");return _(n,t,i),a}catch(e){return _(n,t,i),!1}}(r)||function(e){var r=window.clipboardData;if(void 0!==r&&"function"==typeof r.setData)try{return r.setData("Text",e)}catch(e){return!1}return!1}(r)}function R(){return function(){var r=e("div");if(void 0===r)return null;r.contentEditable="true",globalThis.document.body.appendChild(r),r.focus();var n=null,t=function(e){try{null!==e.clipboardData&&"function"==typeof e.clipboardData.getData&&(e.preventDefault(),n=e.clipboardData.getData("text/html")||e.clipboardData.getData("text/plain")||null)}catch(e){}};d.add(globalThis.document,{type:"paste",callback:t,options:{once:!0,capture:!0}});try{return globalThis.document.execCommand("paste")||n||(n=r.innerHTML||r.textContent||null),U(r,t),n}catch(e){return U(r,t),null}}()||function(){var e=window.clipboardData;if(void 0!==e&&"function"==typeof e.getData)try{return e.getData("Text")||null}catch(e){return null}return null}()||""}function _(e,r,n){null!==r&&r.removeAllRanges(),globalThis.document.body.removeChild(e),d.remove(globalThis.document,{type:"copy",callback:n})}function U(e,r){globalThis.document.body.removeChild(e),d.remove(globalThis.document,{type:"paste",callback:r})}void 0!==navigator.userAgentData&&void 0!==navigator.userAgentData.getHighEntropyValues&&navigator.userAgentData.getHighEntropyValues(["brands","fullVersionList","mobile","model","platform","platformVersion","architecture","formFactors","bitness","uaFullVersion","wow64"]).then((function(e){for(var r,n=e.fullVersionList||e.brands||[],t=e.platformVersion,i=0;i<n.length;i++){var a=null==(r=n[i])?{brand:"",version:""}:"string"==typeof r?{brand:r,version:""}:{brand:r.brand,version:r.version},s=a.brand,l=a.version;/not.a.brand/i.test(s)||"Chromium"===s&&(f.engineVersion=l)}"string"==typeof t&&(f.os===o.Windows&&parseInt(t.replace(/[^\d.]/g,"").split(".")[0],10)>=13?f.osVersion="11":f.osVersion=t)})),f.device=f.os===o.iOS||f.os===o.Android?i.Mobile:f.os===o.Windows||f.os===o.MacOS?i.Desktop:i.Unknown,f.isMobile=f.device===i.Mobile,f.isDesktop=f.device===i.Desktop,f.isStandalone=function(e){return"matchMedia"in globalThis&&(e===o.iOS?"standalone"in navigator&&!!navigator.standalone:globalThis.matchMedia("(display-mode: standalone)").matches)}(f.os);var H={copy:function(e){var r=L(e);return f.isElectron?function(e){try{var r=require("electron");return new Promise((function(n){try{r.clipboard.writeText(e),r.clipboard.writeHTML(e),n(!0)}catch(e){n(!1)}}))}catch(e){return Promise.resolve(!1)}}(r):N()&&("write"in navigator.clipboard||"writeText"in navigator.clipboard)?function(e){try{if("ClipboardItem"in window&&"write"in navigator.clipboard)return navigator.clipboard.write([new ClipboardItem({"text/html":new Blob([e],{type:"text/html"}),"text/plain":new Blob([e],{type:"text/plain"})})]).then((function(){return!0})).catch((function(){return!1}));if("writeText"in navigator.clipboard)return navigator.clipboard.writeText(e).then((function(){return!0})).catch((function(){return!1}))}catch(e){return Promise.resolve(!1)}return Promise.resolve(!1)}(r).then((function(e){return!!e||I(r)})).catch((function(){return I(r)})):Promise.resolve(I(r))},paste:function(){return f.isElectron?function(){try{var e=require("electron");return new Promise((function(r){try{r(e.clipboard.readHTML()||e.clipboard.readText())}catch(e){r("")}}))}catch(e){return Promise.resolve("")}}():N()&&("read"in navigator.clipboard||"readText"in navigator.clipboard)?function(){try{if("ClipboardItem"in window&&"read"in navigator.clipboard)return navigator.clipboard.read().then((function(e){if(0===e.length)return Promise.resolve(null);for(var r=e[0],n=r.types,t=0;t<n.length;t++)if("text/html"===n[t])return r.getType("text/html").then((function(e){return e.text()})).catch((function(){return null}));for(t=0;t<n.length;t++)if("text/plain"===n[t])return r.getType("text/plain").then((function(e){return e.text()})).catch((function(){return null}));return Promise.resolve(null)})).catch((function(){return null}));if("readText"in navigator.clipboard)return navigator.clipboard.readText().then((function(e){return e})).catch((function(){return null}))}catch(e){return Promise.resolve(null)}return Promise.resolve(null)}().then((function(e){return null!==e?e:R()})).catch((function(){return R()})):Promise.resolve(R())}},F={installed:!1,name:"Clipboard",module:H,Constants:{},Errors:{}};export{F as default};
@@ -205,6 +205,483 @@ var EventListenerUtils = {
205
205
  }
206
206
  };
207
207
 
208
+ function compareVersion(lhs, rhs) {
209
+ var pa = lhs.split('.');
210
+ var pb = rhs.split('.');
211
+ var length = Math.max(pa.length, pb.length);
212
+ for (var i = 0; i < length; i++) {
213
+ var a = void 0;
214
+ var b = void 0;
215
+ if (i < pa.length)
216
+ a = parseInt(pa[i], 10);
217
+ else
218
+ a = 0;
219
+ if (i < pb.length)
220
+ b = parseInt(pb[i], 10);
221
+ else
222
+ b = 0;
223
+ if (a > b)
224
+ return 1;
225
+ if (a < b)
226
+ return -1;
227
+ }
228
+ return 0;
229
+ }
230
+
231
+ var OS;
232
+ (function (OS) {
233
+ OS["Unknown"] = "Unknown";
234
+ OS["Android"] = "Android";
235
+ OS["iOS"] = "iOS";
236
+ OS["Windows"] = "Windows";
237
+ OS["MacOS"] = "MacOS";
238
+ })(OS || (OS = {}));
239
+ var Devices;
240
+ (function (Devices) {
241
+ Devices["Unknown"] = "Unknown";
242
+ Devices["Mobile"] = "Mobile";
243
+ Devices["Desktop"] = "Desktop";
244
+ })(Devices || (Devices = {}));
245
+ var Engines;
246
+ (function (Engines) {
247
+ Engines["Unknown"] = "Unknown";
248
+ Engines["EdgeHTML"] = "EdgeHTML";
249
+ Engines["ArkWeb"] = "ArkWeb";
250
+ Engines["Blink"] = "Blink";
251
+ Engines["Presto"] = "Presto";
252
+ Engines["WebKit"] = "WebKit";
253
+ Engines["Trident"] = "Trident";
254
+ Engines["NetFront"] = "NetFront";
255
+ Engines["KHTML"] = "KHTML";
256
+ Engines["Tasman"] = "Tasman";
257
+ Engines["Gecko"] = "Gecko";
258
+ })(Engines || (Engines = {}));
259
+ var Browsers;
260
+ (function (Browsers) {
261
+ Browsers["Unknown"] = "Unknown";
262
+ Browsers["Chrome"] = "Chrome";
263
+ Browsers["Safari"] = "Safari";
264
+ Browsers["Edge"] = "Edge";
265
+ Browsers["Firefox"] = "Firefox";
266
+ Browsers["Opera"] = "Opera";
267
+ Browsers["IE"] = "IE";
268
+ Browsers["SamsungInternet"] = "SamsungInternet";
269
+ })(Browsers || (Browsers = {}));
270
+ var userAgent = typeof navigator !== 'undefined' && typeof navigator.userAgent === 'string' ? navigator.userAgent : '';
271
+ var Platform = {
272
+ device: Devices.Unknown,
273
+ os: OS.Unknown,
274
+ osVersion: '',
275
+ engine: Engines.Unknown,
276
+ engineVersion: '',
277
+ browser: Browsers.Unknown,
278
+ browserVersion: '',
279
+ renderer: getRenderer(),
280
+ userAgent: userAgent,
281
+ isMobile: false,
282
+ isDesktop: false,
283
+ isStandalone: false,
284
+ isWebview: /; ?wv|applewebkit(?!.*safari)/i.test(userAgent),
285
+ isNodeJS: typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && globalThis.process.versions.node !== undefined,
286
+ isElectron: (typeof globalThis.process !== 'undefined' && typeof globalThis.process.versions !== 'undefined' && globalThis.process.versions.electron !== undefined) || (/ electron\//i.test(userAgent)),
287
+ isReactNative: typeof navigator !== 'undefined' && navigator.product === 'ReactNative'
288
+ };
289
+ var OS_RESOLVER_MAP = [
290
+ [/windows nt (6\.[23]); arm/i, OS.Windows, resolveWindowsVersion],
291
+ [/windows (?:phone|mobile|iot)(?: os)?[\/ ]?([\d.]*( se)?)/i, OS.Windows, resolveWindowsVersion],
292
+ [/windows[\/ ](1[01]|2000|3\.1|7|8(\.1)?|9[58]|me|server 20\d\d( r2)?|vista|xp)/i, OS.Windows, resolveWindowsVersion],
293
+ [/windows nt ?([\d.)]*)(?!.+xbox)/i, OS.Windows, resolveWindowsVersion],
294
+ [/\bwin(?=3| ?9|n)(?:nt| 9x )?([\d.;]*)/i, OS.Windows, resolveWindowsVersion],
295
+ [/windows ce\/?([\d.]*)/i, OS.Windows, resolveWindowsVersion],
296
+ [/[adehimnop]{4,7}\b(?:.*os (\w+) like mac|; opera)/i, OS.iOS, resolveUnderscoreVersion],
297
+ [/(?:ios;fbsv|ios(?=.+ip(?:ad|hone))|ip(?:ad|hone)(?: |.+i(?:pad)?)os)[\/ ]([\w.]+)/i, OS.iOS, resolveUnderscoreVersion],
298
+ [/cfnetwork\/.+darwin/i, OS.iOS, resolveUnderscoreVersion],
299
+ [/mac os x ?([\w. ]*)/i, OS.MacOS, resolveUnderscoreVersion],
300
+ [/(?:macintosh|mac_powerpc\b)(?!.+(haiku|morphos))/i, OS.MacOS, resolveUnderscoreVersion],
301
+ [/droid ([\w.]+)\b.+(android[- ]x86)/i, OS.Android],
302
+ [/android\w*[-\/.; ]?([\d.]*)/i, OS.Android],
303
+ ];
304
+ var ENGINE_RESOLVER_MAP = [
305
+ [/windows.+ edge\/([\w.]+)/i, Engines.EdgeHTML],
306
+ [/arkweb\/([\w.]+)/i, Engines.ArkWeb],
307
+ [/webkit\/537\.36.+chrome\/(?!27)([\w.]+)/i, Engines.Blink],
308
+ [/presto\/([\w.]+)/i, Engines.Presto],
309
+ [/webkit\/([\w.]+)/i, Engines.WebKit],
310
+ [/trident\/([\w.]+)/i, Engines.Trident],
311
+ [/netfront\/([\w.]+)/i, Engines.NetFront],
312
+ [/khtml[\/ ]\(?([\w.]+)/i, Engines.KHTML],
313
+ [/tasman[\/ ]\(?([\w.]+)/i, Engines.Tasman],
314
+ [/rv:([\w.]{1,9})\b.+gecko/i, Engines.Gecko]
315
+ ];
316
+ var BROWSER_RESOLVER_MAP = [
317
+ [/\b(?:crmo|crios)\/([\w.]+)/i, Browsers.Chrome],
318
+ [/webview.+edge\/([\w.]+)/i, Browsers.Edge],
319
+ [/edg(?:e|ios|a)?\/([\w.]+)/i, Browsers.Edge],
320
+ [/opera mini\/([-\w.]+)/i, Browsers.Opera],
321
+ [/opera [mobileta]{3,6}\b.+version\/([-\w.]+)/i, Browsers.Opera],
322
+ [/opera(?:.+version\/|[\/ ]+)([\w.]+)/i, Browsers.Opera],
323
+ [/opios[\/ ]+([\w.]+)/i, Browsers.Opera],
324
+ [/\bop(?:rg)?x\/([\w.]+)/i, Browsers.Opera],
325
+ [/\bopr\/([\w.]+)/i, Browsers.Opera],
326
+ [/iemobile(?:browser|boat|jet)[\/ ]?([\d.]*)/i, Browsers.IE],
327
+ [/(?:ms|\()ie ([\w.]+)/i, Browsers.IE],
328
+ [/trident.+rv[: ]([\w.]{1,9})\b.+like gecko/i, Browsers.IE],
329
+ [/\bfocus\/([\w.]+)/i, Browsers.Firefox],
330
+ [/\bopt\/([\w.]+)/i, Browsers.Opera],
331
+ [/coast\/([\w.]+)/i, Browsers.Opera],
332
+ [/fxios\/([\w.-]+)/i, Browsers.Firefox],
333
+ [/samsungbrowser\/([\w.]+)/i, Browsers.SamsungInternet],
334
+ [/headlesschrome(?:\/([\w.]+)| )/i, Browsers.Chrome],
335
+ [/wv\).+chrome\/([\w.]+).+edgw\//i, Browsers.Edge],
336
+ [/ wv\).+(chrome)\/([\w.]+)/i, Browsers.Chrome],
337
+ [/chrome\/([\w.]+) mobile/i, Browsers.Chrome],
338
+ [/chrome\/v?([\w.]+)/i, Browsers.Chrome],
339
+ [/version\/([\w.,]+) .*mobile(?:\/\w+ | ?)safari/i, Browsers.Safari],
340
+ [/iphone .*mobile(?:\/\w+ | ?)safari/i, Browsers.Safari],
341
+ [/version\/([\w.,]+) .*safari/i, Browsers.Safari],
342
+ [/webkit.+?(?:mobile ?safari|safari)(\/[\w.]+)/i, Browsers.Safari, '1'],
343
+ [/(?:mobile|tablet);.*firefox\/([\w.-]+)/i, Browsers.Firefox],
344
+ [/mobile vr; rv:([\w.]+)\).+firefox/i, Browsers.Firefox],
345
+ [/firefox\/([\w.]+)/i, Browsers.Firefox],
346
+ ];
347
+ function resolveWindowsVersion(string) {
348
+ if (string === undefined)
349
+ return '';
350
+ var mapped = {
351
+ '4.90': 'ME',
352
+ 'NT3.51': 'NT 3.11',
353
+ 'NT4.0': 'NT 4.0',
354
+ 'NT 5.0': '2000',
355
+ 'NT 5.1': 'XP',
356
+ 'NT 5.2': 'XP',
357
+ 'NT 6.0': 'Vista',
358
+ 'NT 6.1': '7',
359
+ 'NT 6.2': '8',
360
+ 'NT 6.3': '8.1',
361
+ 'NT 6.4': '10',
362
+ 'NT 10.0': '10',
363
+ 'ARM': 'RT'
364
+ }[string];
365
+ if (mapped !== undefined)
366
+ return mapped;
367
+ return string;
368
+ }
369
+ function resolveUnderscoreVersion(string) {
370
+ if (string === undefined)
371
+ return '';
372
+ return string.replace(/_/g, '.');
373
+ }
374
+ function resolveSemanticWindowsVersion(version, defaultValue) {
375
+ if (version.major === 10 && version.minor === 0 && version.build >= 22000)
376
+ return '11';
377
+ if (version.major === 10 && version.minor === 0 && version.build < 22000)
378
+ return '10';
379
+ if (version.major === 6 && version.minor === 3)
380
+ return '8.1';
381
+ if (version.major === 6 && version.minor === 2)
382
+ return '8';
383
+ if (version.major === 6 && version.minor === 1)
384
+ return '7';
385
+ if (version.major === 6 && version.minor === 0)
386
+ return 'Vista';
387
+ if (version.major === 5 && version.minor === 1)
388
+ return 'XP';
389
+ if (version.major === 5 && version.minor === 2)
390
+ return 'XP';
391
+ if (version.major === 5 && version.minor === 0)
392
+ return '2000';
393
+ if (version.major === 4 && version.minor === 90)
394
+ return 'ME';
395
+ if (version.major === 4 && version.minor === 0)
396
+ return 'NT 4.0';
397
+ if (version.major === 3 && version.minor === 51)
398
+ return 'NT 3.11';
399
+ return defaultValue;
400
+ }
401
+ function resolveSemanticDarwinVersion(version, defaultValue) {
402
+ if (version.major >= 24)
403
+ return '' + (version.major - 9) + '.' + version.minor + '.' + version.build;
404
+ if (version.major === 23)
405
+ return '14.' + version.minor + '.' + version.build;
406
+ if (version.major === 22)
407
+ return '13.' + version.minor + '.' + version.build;
408
+ if (version.major === 21)
409
+ return '12.' + version.minor + '.' + version.build;
410
+ if (version.major === 20)
411
+ return '11.' + version.minor + '.' + version.build;
412
+ if (version.major === 19)
413
+ return '10.15.' + version.minor;
414
+ if (version.major === 18)
415
+ return '10.14.' + version.minor;
416
+ if (version.major === 17)
417
+ return '10.13.' + version.minor;
418
+ if (version.major === 16)
419
+ return '10.12.' + version.minor;
420
+ if (version.major === 15)
421
+ return '10.11.' + version.minor;
422
+ if (version.major === 14)
423
+ return '10.10.' + version.minor;
424
+ if (version.major === 13)
425
+ return '10.9.' + version.minor;
426
+ if (version.major >= 5 && version.major <= 12)
427
+ return '10.' + (version.major - 4) + '.' + version.minor;
428
+ return defaultValue;
429
+ }
430
+ function resolveSemanticAndroidVersion(version, defaultValue) {
431
+ if (version.major >= 36)
432
+ return '16';
433
+ if (version.major === 35)
434
+ return '15';
435
+ if (version.major === 34)
436
+ return '14';
437
+ if (version.major === 33)
438
+ return '13';
439
+ if (version.major === 32)
440
+ return '12.1';
441
+ if (version.major === 31)
442
+ return '12';
443
+ if (version.major === 30)
444
+ return '11';
445
+ if (version.major === 29)
446
+ return '10';
447
+ if (version.major === 28)
448
+ return '9';
449
+ if (version.major === 27)
450
+ return '8.1';
451
+ if (version.major === 26)
452
+ return '8.0';
453
+ if (version.major === 25)
454
+ return '7.1';
455
+ if (version.major === 24)
456
+ return '7.0';
457
+ if (version.major === 23)
458
+ return '6.0';
459
+ if (version.major === 22)
460
+ return '5.1';
461
+ if (version.major === 21)
462
+ return '5.0';
463
+ if (version.major === 20)
464
+ return '4.4W';
465
+ if (version.major === 19)
466
+ return '4.4';
467
+ if (version.major === 18)
468
+ return '4.3';
469
+ if (version.major === 17)
470
+ return '4.2';
471
+ if (version.major === 16)
472
+ return '4.1';
473
+ if (version.major === 15)
474
+ return '4.0.3';
475
+ if (version.major === 14)
476
+ return '4.0';
477
+ if (version.major === 13)
478
+ return '3.2';
479
+ if (version.major === 12)
480
+ return '3.1';
481
+ if (version.major === 11)
482
+ return '3.0';
483
+ if (version.major === 10)
484
+ return '2.3.3';
485
+ if (version.major === 9)
486
+ return '2.3';
487
+ if (version.major === 8)
488
+ return '2.2';
489
+ if (version.major === 7)
490
+ return '2.1';
491
+ if (version.major === 6)
492
+ return '2.0.1';
493
+ if (version.major === 5)
494
+ return '2.0';
495
+ if (version.major === 4)
496
+ return '1.6';
497
+ if (version.major === 3)
498
+ return '1.5';
499
+ if (version.major === 2)
500
+ return '1.1';
501
+ if (version.major === 1)
502
+ return '1.0';
503
+ return defaultValue;
504
+ }
505
+ function resolveVersion(string, resolver) {
506
+ if (typeof resolver === 'function')
507
+ return resolver(string);
508
+ if (typeof resolver === 'string')
509
+ return resolver;
510
+ if (string === undefined)
511
+ return '';
512
+ return string;
513
+ }
514
+ function normalizeBrand(entry) {
515
+ if (entry === null || entry === undefined)
516
+ return { brand: '', version: '' };
517
+ if (typeof entry === 'string')
518
+ return { brand: entry, version: '' };
519
+ return { brand: entry.brand, version: entry.version };
520
+ }
521
+ function getRenderer() {
522
+ if (typeof globalThis.document === 'undefined')
523
+ return '';
524
+ var canvas = globalThis.document.createElement('canvas');
525
+ if (typeof canvas.getContext !== 'function')
526
+ return '';
527
+ var context = canvas.getContext('webgl2') || canvas.getContext('experimental-webgl') || canvas.getContext('webgl');
528
+ if (context === null)
529
+ return '';
530
+ if (context instanceof WebGLRenderingContext || 'getParameter' in context && typeof context.getParameter === 'function') {
531
+ var extension = context.getExtension('WEBGL_debug_renderer_info');
532
+ if (extension === null)
533
+ return context.getParameter(context.RENDERER);
534
+ else
535
+ return context.getParameter(extension.UNMASKED_RENDERER_WEBGL);
536
+ }
537
+ else {
538
+ return '';
539
+ }
540
+ }
541
+ function getIsStandalone(os) {
542
+ if (!('matchMedia' in globalThis))
543
+ return false;
544
+ if (os === OS.iOS)
545
+ return 'standalone' in navigator && !!navigator.standalone;
546
+ return globalThis.matchMedia('(display-mode: standalone)').matches;
547
+ }
548
+ function getSemanticVersion(string) {
549
+ var parts = string.split('.');
550
+ return {
551
+ major: parseInt(parts[0] || '0'),
552
+ minor: parseInt(parts[1] || '0'),
553
+ build: parseInt(parts[2] || '0')
554
+ };
555
+ }
556
+ for (var i = 0; i < OS_RESOLVER_MAP.length; i++) {
557
+ var map = OS_RESOLVER_MAP[i];
558
+ var regexp = map[0];
559
+ var os = map[1];
560
+ var resolver = map[2];
561
+ var matched = Platform.userAgent.match(regexp);
562
+ if (matched !== null) {
563
+ Platform.os = os;
564
+ Platform.osVersion = resolveVersion(matched[1], resolver);
565
+ break;
566
+ }
567
+ }
568
+ if (Platform.os === OS.iOS && compareVersion(Platform.osVersion, '18.6') === 0) {
569
+ var version = /\) Version\/([\d.]+)/.exec(Platform.userAgent);
570
+ if (version !== null && parseInt(version[1].substring(0, 2), 10) >= 26)
571
+ Platform.osVersion = version[1];
572
+ }
573
+ for (var i = 0; i < ENGINE_RESOLVER_MAP.length; i++) {
574
+ var map = ENGINE_RESOLVER_MAP[i];
575
+ var regexp = map[0];
576
+ var engine = map[1];
577
+ var resolver = map[2];
578
+ var matched = Platform.userAgent.match(regexp);
579
+ if (matched !== null) {
580
+ Platform.engine = engine;
581
+ Platform.engineVersion = resolveVersion(matched[1], resolver);
582
+ break;
583
+ }
584
+ }
585
+ for (var i = 0; i < BROWSER_RESOLVER_MAP.length; i++) {
586
+ var map = BROWSER_RESOLVER_MAP[i];
587
+ var regexp = map[0];
588
+ var browser = map[1];
589
+ var resolver = map[2];
590
+ var matched = Platform.userAgent.match(regexp);
591
+ if (matched !== null) {
592
+ Platform.browser = browser;
593
+ Platform.browserVersion = resolveVersion(matched[1], resolver);
594
+ break;
595
+ }
596
+ }
597
+ if (Platform.isReactNative) {
598
+ try {
599
+ var reactNative = require('react-native');
600
+ var platform = reactNative.Platform;
601
+ var os = platform.OS;
602
+ var release = '' + platform.Version;
603
+ var version = getSemanticVersion(release);
604
+ switch (os) {
605
+ case 'android':
606
+ Platform.os = OS.Android;
607
+ Platform.osVersion = resolveSemanticAndroidVersion(version, release);
608
+ break;
609
+ case 'ios':
610
+ Platform.os = OS.iOS;
611
+ Platform.osVersion = release;
612
+ break;
613
+ case 'windows':
614
+ Platform.os = OS.Windows;
615
+ Platform.osVersion = resolveSemanticWindowsVersion(version, release);
616
+ break;
617
+ case 'macos':
618
+ Platform.os = OS.MacOS;
619
+ Platform.osVersion = release;
620
+ break;
621
+ }
622
+ }
623
+ catch (_) {
624
+ }
625
+ }
626
+ if (Platform.isNodeJS) {
627
+ try {
628
+ var os = require('os');
629
+ var platform = os.platform();
630
+ var release = os.release();
631
+ var version = getSemanticVersion(release);
632
+ switch (platform) {
633
+ case 'win32':
634
+ Platform.os = OS.Windows;
635
+ Platform.osVersion = resolveSemanticWindowsVersion(version, release);
636
+ break;
637
+ case 'darwin':
638
+ Platform.os = OS.MacOS;
639
+ Platform.osVersion = resolveSemanticDarwinVersion(version, release);
640
+ break;
641
+ case 'android':
642
+ Platform.os = OS.Android;
643
+ Platform.osVersion = release;
644
+ break;
645
+ case 'linux':
646
+ if (/android/i.test(release)) {
647
+ Platform.os = OS.Android;
648
+ Platform.osVersion = release;
649
+ }
650
+ break;
651
+ }
652
+ }
653
+ catch (_) {
654
+ }
655
+ }
656
+ if (navigator.userAgentData !== undefined && navigator.userAgentData.getHighEntropyValues !== undefined) {
657
+ navigator
658
+ .userAgentData
659
+ .getHighEntropyValues(['brands', 'fullVersionList', 'mobile', 'model', 'platform', 'platformVersion', 'architecture', 'formFactors', 'bitness', 'uaFullVersion', 'wow64'])
660
+ .then(function (result) {
661
+ var brands = result.fullVersionList || result.brands || [];
662
+ var platformVersion = result.platformVersion;
663
+ for (var i = 0; i < brands.length; i++) {
664
+ var brand = normalizeBrand(brands[i]);
665
+ var brandName = brand.brand;
666
+ var brandVersion = brand.version;
667
+ if (/not.a.brand/i.test(brandName))
668
+ continue;
669
+ if (brandName === "Chromium")
670
+ Platform.engineVersion = brandVersion;
671
+ }
672
+ if (typeof platformVersion === 'string') {
673
+ if (Platform.os === OS.Windows && parseInt(platformVersion.replace(/[^\d.]/g, '').split('.')[0], 10) >= 13)
674
+ Platform.osVersion = '11';
675
+ else
676
+ Platform.osVersion = platformVersion;
677
+ }
678
+ });
679
+ }
680
+ Platform.device = Platform.os === OS.iOS || Platform.os === OS.Android ? Devices.Mobile : Platform.os === OS.Windows || Platform.os === OS.MacOS ? Devices.Desktop : Devices.Unknown;
681
+ Platform.isMobile = Platform.device === Devices.Mobile;
682
+ Platform.isDesktop = Platform.device === Devices.Desktop;
683
+ Platform.isStandalone = getIsStandalone(Platform.os);
684
+
208
685
  function isObject(item) {
209
686
  return item !== null && typeof item === 'object';
210
687
  }
@@ -245,7 +722,10 @@ function supportsClipboardReadAPI() {
245
722
  }
246
723
  function copy(item) {
247
724
  var text = convertToString(item);
248
- if (supportsClipboardWriteAPI()) {
725
+ if (Platform.isElectron) {
726
+ return copyViaElectron(text);
727
+ }
728
+ else if (supportsClipboardWriteAPI()) {
249
729
  return copyViaClipboardAPI(text)
250
730
  .then(function (success) {
251
731
  if (success)
@@ -258,6 +738,24 @@ function copy(item) {
258
738
  }
259
739
  return Promise.resolve(copyViaLegacy(text));
260
740
  }
741
+ function copyViaElectron(text) {
742
+ try {
743
+ var electron_1 = require('electron');
744
+ return new Promise(function (resolve) {
745
+ try {
746
+ electron_1.clipboard.writeText(text);
747
+ electron_1.clipboard.writeHTML(text);
748
+ resolve(true);
749
+ }
750
+ catch (_) {
751
+ resolve(false);
752
+ }
753
+ });
754
+ }
755
+ catch (_) {
756
+ return Promise.resolve(false);
757
+ }
758
+ }
261
759
  function copyViaClipboardAPI(text) {
262
760
  try {
263
761
  if ('ClipboardItem' in window && 'write' in navigator.clipboard) {
@@ -351,7 +849,10 @@ function copyViaLegacy(text) {
351
849
  return copyViaSelection(text) || copyViaClipboardData(text);
352
850
  }
353
851
  function paste() {
354
- if (supportsClipboardReadAPI()) {
852
+ if (Platform.isElectron) {
853
+ return pasteViaElectron();
854
+ }
855
+ else if (supportsClipboardReadAPI()) {
355
856
  return pasteViaClipboardAPI()
356
857
  .then(function (text) {
357
858
  if (text !== null)
@@ -364,6 +865,22 @@ function paste() {
364
865
  }
365
866
  return Promise.resolve(pasteViaLegacy());
366
867
  }
868
+ function pasteViaElectron() {
869
+ try {
870
+ var electron_2 = require('electron');
871
+ return new Promise(function (resolve) {
872
+ try {
873
+ resolve(electron_2.clipboard.readHTML() || electron_2.clipboard.readText());
874
+ }
875
+ catch (_) {
876
+ resolve('');
877
+ }
878
+ });
879
+ }
880
+ catch (_) {
881
+ return Promise.resolve('');
882
+ }
883
+ }
367
884
  function pasteViaClipboardAPI() {
368
885
  try {
369
886
  if ('ClipboardItem' in window && 'read' in navigator.clipboard) {