web-launch-kit 0.0.1 → 0.0.2
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.
- package/README.md +55 -43
- package/dist/index.d.ts +15 -1
- package/dist/launch-kit.cjs +169 -14
- package/dist/launch-kit.cjs.map +1 -1
- package/dist/launch-kit.min.cjs +1 -1
- package/dist/launch-kit.min.cjs.map +1 -1
- package/dist/launch-kit.min.mjs +1 -1
- package/dist/launch-kit.min.mjs.map +1 -1
- package/dist/launch-kit.mjs +169 -14
- package/dist/launch-kit.mjs.map +1 -1
- package/dist/launch-kit.umd.js +169 -14
- package/dist/launch-kit.umd.js.map +1 -1
- package/dist/launch-kit.umd.min.js +1 -1
- package/dist/launch-kit.umd.min.js.map +1 -1
- package/package.json +7 -2
package/dist/launch-kit.min.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var e,t="0.0.1",n="0.0.4",i=globalThis.navigator,o=void 0!==i?i.userAgent:"",r=void 0!==i?i.userAgentData:void 0,a=[[/windows nt (6\.[23]); arm/i,"windows",b],[/windows (?:phone|mobile|iot)(?: os)?[\/ ]?([\d.]*( se)?)/i,"windows",b],[/windows[\/ ](1[01]|2000|3\.1|7|8(\.1)?|9[58]|me|server 20\d\d( r2)?|vista|xp)/i,"windows",b],[/windows nt ?([\d.)]*)(?!.+xbox)/i,"windows",b],[/\bwin(?=3| ?9|n)(?:nt| 9x )?([\d.;]*)/i,"windows",b],[/windows ce\/?([\d.]*)/i,"windows",b],[/[adehimnop]{4,7}\b(?:.*os (\w+) like mac|; opera)/i,"ios",w],[/(?:ios;fbsv|ios(?=.+ip(?:ad|hone))|ip(?:ad|hone)(?: |.+i(?:pad)?)os)[\/ ]([\w.]+)/i,"ios",w],[/cfnetwork\/.+darwin/i,"ios",w],[/mac os x ?([\w. ]*)/i,"macos",w],[/(?:macintosh|mac_powerpc\b)(?!.+(haiku|morphos))/i,"macos",w],[/droid ([\w.]+)\b.+(android[- ]x86)/i,"android"],[/android\w*[-\/.; ]?([\d.]*)/i,"android"]],s=[[/\b(?:crmo|crios)\/([\w.]+)/i,"chrome"],[/webview.+edge\/([\w.]+)/i,"edge"],[/edg(?:e|ios|a)?\/([\w.]+)/i,"edge"],[/opera mini\/([-\w.]+)/i,"opera"],[/opera [mobileta]{3,6}\b.+version\/([-\w.]+)/i,"opera"],[/opera(?:.+version\/|[\/ ]+)([\w.]+)/i,"opera"],[/opios[\/ ]+([\w.]+)/i,"opera"],[/\bop(?:rg)?x\/([\w.]+)/i,"opera"],[/\bopr\/([\w.]+)/i,"opera"],[/iemobile(?:browser|boat|jet)[\/ ]?([\d.]*)/i,"ie"],[/(?:ms|\()ie ([\w.]+)/i,"ie"],[/trident.+rv[: ]([\w.]{1,9})\b.+like gecko/i,"ie"],[/\bfocus\/([\w.]+)/i,"firefox"],[/\bopt\/([\w.]+)/i,"opera"],[/coast\/([\w.]+)/i,"opera"],[/fxios\/([\w.-]+)/i,"firefox"],[/samsungbrowser\/([\w.]+)/i,"samsung"],[/headlesschrome(?:\/([\w.]+)| )/i,"chrome"],[/wv\).+chrome\/([\w.]+).+edgw\//i,"edge"],[/ wv\).+(chrome)\/([\w.]+)/i,"chrome"],[/chrome\/([\w.]+) mobile/i,"chrome"],[/chrome\/v?([\w.]+)/i,"chrome"],[/version\/([\w.,]+) .*mobile(?:\/\w+ | ?)safari/i,"safari"],[/iphone .*mobile(?:\/\w+ | ?)safari/i,"safari"],[/version\/([\w.,]+) .*safari/i,"safari"],[/webkit.+?(?:mobile ?safari|safari)(\/[\w.]+)/i,"safari","1"],[/(?:mobile|tablet);.*firefox\/([\w.-]+)/i,"firefox"],[/mobile vr; rv:([\w.]+)\).+firefox/i,"firefox"],[/firefox\/([\w.]+)/i,"firefox"]],c=[[/windows.+ edge\/([\w.]+)/i,"edgeHtml"],[/arkweb\/([\w.]+)/i,"arkWeb"],[/webkit\/537\.36.+chrome\/(?!27)([\w.]+)/i,"blink"],[/presto\/([\w.]+)/i,"presto"],[/webkit\/([\w.]+)/i,"webKit"],[/trident\/([\w.]+)/i,"trident"],[/netfront\/([\w.]+)/i,"netFront"],[/khtml[\/ ]\(?([\w.]+)/i,"khtml"],[/tasman[\/ ]\(?([\w.]+)/i,"tasman"],[/rv:([\w.]{1,9})\b.+gecko/i,"gecko"]],l={"Google Chrome":"Chrome","Microsoft Edge":"Edge","Microsoft Edge WebView2":"Edge WebView2","Android WebView":"Chrome WebView",HeadlessChrome:"Chrome Headless",OperaMobile:"Opera Mobi"},d=o,u=null,p=void 0,f=void 0,v=void 0,g=void 0,h=void 0,m=null;function b(e){if(void 0===e)return"";var t={"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!==t?t:e}function w(e){return void 0===e?"":e.replace(/_/g,".")}function y(e,t){return"function"==typeof t?t(e):"string"==typeof t?t:void 0===e?"":e}function T(){for(var e="unknown",t="",n=0;n<a.length;n++){var i=a[n],r=d.match(i[0]);if(null!==r){e=i[1],t=y(r[1],i[2]);break}}if("ios"===e&&0===A.compareVersion(t,"18.6")){var s=/\) Version\/([\d.]+)/.exec(d);if(null!==s)parseInt(s[1].split(".")[0],10)>=26&&(t=s[1])}return d===o&&(void 0!==p&&(e=p),void 0!==f&&(t=f),"macos"===e&&void 0!==globalThis.navigator.standalone&&void 0!==globalThis.navigator.maxTouchPoints&&globalThis.navigator.maxTouchPoints>2&&(e="ios")),{name:e,version:t}}function k(){for(var e="unknown",t="",n=0;n<s.length;n++){var i=s[n],r=d.match(i[0]);if(null!==r){e=i[1],t=y(r[1],i[2]);break}}return d===o&&(void 0!==v&&(e=v),void 0!==g&&(t=g)),{name:e,version:t}}function I(){for(var e="unknown",t="",n=0;n<c.length;n++){var i=c[n],r=d.match(i[0]);if(null!==r){e=i[1],t=y(r[1],i[2]);break}}return d===o&&void 0!==h&&(t=h),{name:e,version:t}}function x(){return null!==u&&u.userAgent===d?u:u={userAgent:d,os:T(),browser:k(),engine:I()}}function S(e){return null==e?{brand:"",version:""}:"string"==typeof e?{brand:e,version:""}:{brand:e.brand,version:e.version}}function E(){return void 0===r||void 0===r.getHighEntropyValues?Promise.resolve():r.getHighEntropyValues(["brands","fullVersionList","mobile","model","platform","platformVersion","architecture","formFactors","bitness","uaFullVersion","wow64"]).then(function(e){try{for(var t=e.fullVersionList||e.brands||[],n=e.platformVersion,i=e.platform,o=x().browser.name,r=null,a=0;a<t.length;a++){var s=S(t[a]),c=s.version,d=s.brand;/not.a.brand/i.test(d)||((null===r||/Chrom/.test(r)&&"Chromium"!==d||"Edge"===r&&/WebView2/.test(d))&&(d=l[d]||d,null!==(r=o)&&!/Chrom/.test(r)&&/Chrom/.test(d)||("Chrome"===(o=d)||"Chrome WebView"===o||"Chrome Headless"===o?v="chrome":"Edge"===o||"Edge WebView2"===o?v="edge":"Opera Mobi"===o&&(v="opera"),g=c),r=d),"Chromium"===d&&(h=c))}"string"==typeof n&&(f="windows"===x().os.name?parseInt(n.split(".")[0],10)>=13?"11":"10":n),"string"==typeof i&&(/android/i.test(i)?p="android":/ios|iphone|ipad/i.test(i)?p="ios":/windows|win32/i.test(i)?p="windows":/macos|macintel/i.test(i)&&(p="macos")),!0===e.mobile&&(m="mobile"),u=null}catch(e){}}).catch(function(){u=null})}e=E();var A={version:n,get ready(){return e},set userAgent(t){d!==t&&(d=t,u=null,p=void 0,f=void 0,v=void 0,g=void 0,h=void 0,m=null,e=E())},get userAgent(){return d},get os(){return x().os},get browser(){return x().browser},get engine(){return x().engine},get device(){if(d===o&&null!==m)return m;var e=x().os.name;return"ios"===e||"android"===e?"mobile":"windows"===e||"macos"===e?"desktop":"unknown"},get webview(){return/; ?wv|applewebkit(?!.*safari)/i.test(d)},get node(){return void 0!==globalThis.process&&void 0!==globalThis.process.versions&&void 0!==globalThis.process.versions.node},get standalone(){return"ios"===x().os.name?!0===globalThis.navigator.standalone:void 0!==globalThis.matchMedia&&globalThis.matchMedia("(display-mode: standalone)").matches},compareVersion:function(e,t){for(var n=e.split("."),i=t.split("."),o=Math.max(n.length,i.length),r=0;r<o;r++){var a=void 0,s=void 0;if((a=r<n.length?parseInt(n[r],10):0)>(s=r<i.length?parseInt(i[r],10):0))return 1;if(a<s)return-1}return 0}};function P(e,t){void 0===t&&(t=!0);var n=globalThis.document.createElement(e);return void 0!==n.width&&(n.width="0"),void 0!==n.height&&(n.height="0"),void 0!==n.border&&(n.border="0"),void 0!==n.frameBorder&&(n.frameBorder="0"),void 0!==n.scrolling&&(n.scrolling="no"),void 0!==n.cellPadding&&(n.cellPadding="0"),void 0!==n.cellSpacing&&(n.cellSpacing="0"),void 0!==n.frame&&(n.frame="void"),void 0!==n.rules&&(n.rules="none"),void 0!==n.noWrap&&(n.noWrap=!0),n.tabIndex=-1,n.setAttribute("role","presentation"),t?(n.setAttribute("aria-hidden","false"),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="hidden",n.style.clip="rect(1px, 1px, 1px, 1px)",n.style.clipPath="inset(50%)",n.style.overflow="hidden",n.style.whiteSpace="nowrap",n}var C=["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","iw","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"];function V(e){if(null==e)return e;if(0===e.length)return null;if("C"===(e=e.replace(/_/g,"-"))||"posix"===e.toLowerCase())return"en-US";if(-1!==e.indexOf("."))return V(e.split(".")[0]);if(-1!==e.indexOf("@"))return V(e.split("@")[0]);var t=e.split("-");return 0===t.length?null:(t[0]=t[0].toLowerCase(),t.length>1&&2===t[1].length&&(t[1]=t[1].toUpperCase()),t.length>2&&4===t[1].length&&(t[1]=t[1].charAt(0).toUpperCase()+t[1].slice(1).toLowerCase()),t.join("-"))}var N=null,L=[],_=null;function O(e){"string"==typeof(e=V(e))&&-1===L.indexOf(e)&&(null===N&&(N=e),L.push(e))}if("undefined"!=typeof Intl){try{O(Intl.DateTimeFormat().resolvedOptions().locale)}catch(e){}try{Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){}}void 0!==globalThis.navigator&&(void 0!==globalThis.navigator.languages&&function(e){for(var t=0;t<e.length;t++)O(e[t])}(globalThis.navigator.languages),void 0!==globalThis.navigator.language&&O(globalThis.navigator.language),void 0!==globalThis.navigator.userLanguage&&O(globalThis.navigator.userLanguage),void 0!==globalThis.navigator.browserLanguage&&O(globalThis.navigator.browserLanguage),void 0!==globalThis.navigator.systemLanguage&&O(globalThis.navigator.systemLanguage));try{-1*(new Date).getTimezoneOffset()}catch(e){}if("string"==typeof N){if("undefined"!=typeof Intl&&void 0!==Intl.Locale)try{var R=new Intl.Locale(N);"function"==typeof R.getTextInfo?_="rtl"===R.getTextInfo().direction:void 0!==R.textInfo&&(_="rtl"===R.textInfo.direction)}catch(e){}if("boolean"!=typeof _){var U=/^([A-Za-z]{1,8})(?:[-_][A-Za-z0-9]{1,8})*$/.exec(N);if(null!==U)for(var M=U[1].toLowerCase(),D=0;D<C.length;D++)if(C[D]===M){_=!0;break}}}var F={languages:L},j="track-id",W="bundle-id",G=36e5,H=function(){var e;try{if(void 0===globalThis.localStorage)e=!1;else{var t="__id_cache_test__";globalThis.localStorage.setItem(t,""),globalThis.localStorage.removeItem(t),e=!0}}catch(t){e=!1}if(e)return{get:function(e,t){try{var n=globalThis.localStorage.getItem(e+":"+t);if(null==n)return;var i=n.split("|");if(2!==i.length)return;var o=+i[0];return z(o)||o<B()?void globalThis.localStorage.removeItem(e+":"+t):i[1]}catch(e){return}},set:function(e,t,n){try{globalThis.localStorage.setItem(e+":"+t,B()+G+"|"+n)}catch(e){return}}};if(void 0!==globalThis.Map){var n=new Map;return{get:function(e,t){var i=n.get(e+":"+t);if(void 0!==i){var o=i.split("|");if(2===o.length){var r=+o[0];if(!(z(r)||r<B()))return o[1];n.delete(e+":"+t)}}},set:function(e,t,i){n.set(e+":"+t,B()+G+"|"+i)}}}var i=Object.create(null);return{get:function(e,t){var n=i[e+":"+t];if(void 0!==n){var o=n.split("|");if(2===o.length){var r=+o[0];if(!(z(r)||r<B()))return o[1];try{delete i[e+":"+t]}catch(n){i[e+":"+t]=void 0}}}},set:function(e,t,n){i[e+":"+t]=B()+G+"|"+n}}}();function z(e){return e!=e}function B(){return void 0!==Date.now?Date.now():(new Date).getTime()}function Y(e,t){if(void 0===t&&(t=!1),"function"==typeof globalThis.fetch&&t)return globalThis.fetch(e).then(function(e){return e.json()}).catch(function(e){});try{var n=new XMLHttpRequest;n.open("GET",e,t),n.send();var i=n.status;return i>=200&&i<300?JSON.parse(n.response):void 0}catch(e){return}}function X(e){for(var t=F.languages,n="en-US",i="US",o=0;o<t.length;o++){var r=t[o];if(-1!==r.indexOf("-")){for(var a=r.split("-"),s=1;s<a.length;s++){var c=a[s];if(/^[A-Za-z]{2}$/.test(c)||/^\d{3}$/.test(c)){n=r,i=c;break}}if(n===r)break}}return"https://displaycatalog.md.mp.microsoft.com/v7.0/products/lookup?value="+globalThis.encodeURIComponent(e)+"&market="+globalThis.encodeURIComponent(i)+"&languages="+globalThis.encodeURIComponent(n)+"&alternateId=PackageFamilyName"}function Z(e){return"https://itunes.apple.com/lookup?bundleId="+globalThis.encodeURIComponent(e)}function $(e){if(void 0!==e){var t=void 0;if(void 0!==e.Products?t=e.Products[0]:void 0!==e.Product&&(t=e.Product),null!=t)return t.ProductId}}function q(e){if(void 0!==e&&void 0!==e.results){var t=e.results;if(0!==t.length){var n=t[0];if(void 0!==n)return""+n.trackId}}}function J(e){var t=H.get(j,e);if(void 0!==t)return t;try{var n=q(Y(Z(e)));if(void 0===n)return;return H.set(j,e,n),n}catch(e){return}}function K(){try{if(null!==globalThis.top&&globalThis.top!==globalThis.window)return globalThis.top.location.href,globalThis.top}catch(e){}return globalThis}var Q,ee=[],te=["","webkit","moz","ms","MS","o","O"],ne={focus:["focus","focusin"],blur:["blur","focusout"]};function ie(e,t){var n,i=ne[t];n=void 0!==i?i:[t];for(var o=0;o<te.length;o++)for(var r=0;r<n.length;r++){var a=te[o]+n[r];if(void 0!==e["on"+a])return a}return t}function oe(){this.returnValue=!1}function re(){this.cancelBubble=!0}function ae(e,t,n){if(void 0!==e&&void 0!==t){if(t=ie(e,t),"function"==typeof e.addEventListener)return e.addEventListener(t,n);if("function"==typeof e.attachEvent){var i=function(e,t,n){for(var i=0;i<ee.length;i++){var o=ee[i];if(o.target===e&&o.type===t&&o.callback===n)return o.wrapper}}(e,t,n);if("function"==typeof i)return;var o=function(t){if(void 0===t&&(t=globalThis.event),void 0!==t){try{Object.defineProperty(t,"currentTarget",{value:e,configurable:!0})}catch(e){}"function"!=typeof t.preventDefault&&(t.preventDefault=oe.bind(t)),"function"!=typeof t.stopPropagation&&(t.stopPropagation=re.bind(t)),n.call(e,t)}};return function(e,t,n,i){ee.push({target:e,type:t,callback:n,wrapper:i})}(e,t,n,o),e.attachEvent("on"+t,o)}}}function se(e,t,n){if(void 0!==e&&void 0!==t){if(t=ie(e,t),"function"==typeof e.removeEventListener)return e.removeEventListener(t,n);if("function"!=typeof e.detachEvent);else{var i=function(e,t,n){for(var i=0;i<ee.length;i++){var o=ee[i];if(o.target===e&&o.type===t&&o.callback===n)return ee.splice(i,1),o.wrapper}}(e,t,n);"function"==typeof i&&e.detachEvent("on"+t,i)}}}!function(e){e.General="general",e.Network="network",e.Display="display",e.Appearance="appearance",e.Accessibility="accessibility",e.Battery="battery",e.Datetime="datetime",e.Language="language",e.Accounts="accounts",e.Storage="storage"}(Q||(Q={}));var ce={android:{general:"intent:#Intent;action=android.settings.SETTINGS;end",network:"intent:#Intent;action=android.settings.WIFI_SETTINGS;end",display:"intent:#Intent;action=android.settings.DISPLAY_SETTINGS;end",appearance:"intent:#Intent;action=android.settings.DISPLAY_SETTINGS;end",accessibility:"intent:#Intent;action=android.settings.ACCESSIBILITY_SETTINGS;end",battery:"intent:#Intent;action=android.settings.BATTERY_SAVER_SETTINGS;end",datetime:"intent:#Intent;action=android.settings.DATE_SETTINGS;end",language:"intent:#Intent;action=android.settings.LOCALE_SETTINGS;end",accounts:"intent:#Intent;action=android.settings.SYNC_SETTINGS;end",storage:"intent:#Intent;action=android.settings.INTERNAL_STORAGE_SETTINGS;end"},windows:{general:"ms-settings:system",network:"ms-settings:network",display:"ms-settings:display",appearance:"ms-settings:colors",accessibility:"ms-settings:easeofaccess",battery:"ms-settings:batterysaver",datetime:"ms-settings:dateandtime",language:"ms-settings:regionlanguage",accounts:"ms-settings:emailandaccounts",storage:"ms-settings:storagesense"},macos:{general:"x-apple.systempreferences:",network:"x-apple.systempreferences:com.apple.preference.network",display:"x-apple.systempreferences:com.apple.preference.displays",appearance:"x-apple.systempreferences:com.apple.preference.general",accessibility:"x-apple.systempreferences:com.apple.preference.universalaccess",battery:"x-apple.systempreferences:com.apple.preference.energysaver",datetime:"x-apple.systempreferences:com.apple.preference.datetime",language:"x-apple.systempreferences:com.apple.Localization",accounts:"x-apple.systempreferences:com.apple.preferences.internetaccounts",storage:"x-apple.systempreferences:"},macos13:{general:"x-apple.systempreferences:com.apple.General-Settings.extension",network:"x-apple.systempreferences:com.apple.Network-Settings.extension",display:"x-apple.systempreferences:com.apple.Displays-Settings.extension",appearance:"x-apple.systempreferences:com.apple.Appearance-Settings.extension",accessibility:"x-apple.systempreferences:com.apple.Accessibility-Settings.extension",battery:"x-apple.systempreferences:com.apple.Battery-Settings.extension",datetime:"x-apple.systempreferences:com.apple.Date-Time-Settings.extension",language:"x-apple.systempreferences:com.apple.Localization-Settings.extension",accounts:"x-apple.systempreferences:com.apple.Internet-Accounts-Settings.extension",storage:"x-apple.systempreferences:com.apple.settings.Storage"}},le=globalThis.navigator,de=null;function ue(e){return function(t){return Object.prototype.toString.call(t)==="[object "+e+"]"}}var pe=ue("URL"),fe=ue("DOMException"),ve=ue("Array"),ge=ue("Promise"),he=ue("HTMLInputElement");function me(){switch(A.os.name){case"android":return 1e3;case"ios":return 2e3;default:return 750}}function be(){var e=K().document;return"hidden"===e.visibilityState||("hidden"===e.webkitVisibilityState||("hidden"===e.mozVisibilityState||("hidden"===e.msVisibilityState||(void 0!==e.hidden?e.hidden:void 0!==e.webkitHidden?e.webkitHidden:void 0!==e.mozHidden?e.mozHidden:void 0!==e.msHidden?e.msHidden:"function"!=typeof e.hasFocus||!e.hasFocus()))))}function we(e,t){var n;void 0===t&&(t=globalThis);try{n=new MouseEvent("click",{bubbles:!0,cancelable:!0,view:t})}catch(e){(n=globalThis.document.createEvent("MouseEvents")).initMouseEvent("click",!0,!0,t,0,0,0,0,0,!1,!1,!1,!1,0,null)}e.dispatchEvent(n)}function ye(e){return"function"==typeof e.hasFocus&&e.hasFocus()}function Te(e){try{e.focus({preventScroll:!0})}catch(t){try{e.focus()}catch(e){}}}function ke(e){return void 0===e?void 0:pe(e)?e.toString():e}function Ie(){var e=K(),t=e.document;return void 0!==globalThis.cordova?{focus:{target:t,type:"resume"},blur:{target:t,type:"pause"},visibilitychange:{}}:"ios"===A.os.name?A.compareVersion(A.os.version,"8.0")>=0?{focus:{},blur:{},visibilitychange:{target:t,type:"visibilitychange"}}:{focus:{target:e,type:"pageshow"},blur:{target:e,type:"pagehide"},visibilitychange:{}}:"function"==typeof globalThis.document.addEventListener?{focus:{target:e,type:"focus"},blur:{target:e,type:"blur"},visibilitychange:{target:t,type:"visibilitychange"}}:{focus:{target:t,type:"focus"},blur:{target:t,type:"blur"},visibilitychange:{target:t,type:"visibilitychange"}}}function xe(e,t,n){var i=Ie(),o=K(),r=o.document,a=void 0,s=void 0;function c(){if(void 0===globalThis.cordova){if(void 0!==le&&void 0!==le.userActivation&&le.userActivation.isActive||0===e)o.location.href=t;else try{(a=P("a")).href=t,r.body.appendChild(a),we(a,o)}catch(e){}finally{if(void 0!==a)try{r.body.removeChild(a)}catch(e){}}try{return(s=P("iframe")).src=t,r.body.appendChild(s),void globalThis.setTimeout(function(){if(void 0!==s)try{r.body.removeChild(s)}catch(e){}},500)}catch(e){}}else void 0!==globalThis.cordova.InAppBrowser?globalThis.cordova.InAppBrowser.open(t,"_system"):globalThis.open(t,"_system")}return new Promise(function(e,t){var o,l=!1;function d(n){l||(l=!0,function(){void 0!==o&&(clearTimeout(o),o=void 0);try{se(i.blur.target,i.blur.type,u),se(i.focus.target,i.focus.type,p),se(i.visibilitychange.target,i.visibilitychange.type,f)}catch(e){}if(void 0!==a)try{r.body.removeChild(a)}catch(e){}if(void 0!==s)try{r.body.removeChild(s)}catch(e){}}(),n?e():t())}function u(){void 0!==o&&(clearTimeout(o),o=void 0),se(i.blur.target,i.blur.type,u),ae(i.focus.target,i.focus.type,p)}function p(){d(!0)}function f(){be()?u():p()}o=globalThis.setTimeout(function(){d(!1)},n),ae(i.blur.target,i.blur.type,u),ae(i.visibilitychange.target,i.visibilitychange.type,f),ye(r)||function(){var e=K(),t=e.document;if(Te(e),ye(t))return!0;if(t.body.tabIndex<0&&(t.body.tabIndex=-1),Te(t.body),ye(t))return!0;var n=void 0;try{if(void 0===(n=P("input")))return!1;n.type="text",n.readOnly=!0,t.body.appendChild(n),Te(n);try{n.select()}catch(e){}if(ye(t))return!0}catch(e){}finally{if(null!=n){try{n.blur()}catch(e){}try{t.body.removeChild(n)}catch(e){}}}ye(t)}();try{c()}catch(e){d(!1)}})}function Se(e){var t,n,i,o,r,a,s,c,l,d,u,p,f=[],v=A.os.name;if("unknown"===v)throw new Error('Cannot resolve app open options: unsupported or undetected OS. (userAgent: "'+A.userAgent+'")');switch(v){case"android":if(void 0===e.android)return[[],0];if(a=ke(e.android.intent),t=ke(e.android.scheme),n=ke(e.android.fallback),s=e.android.packageName,i=e.android.allowAppStore,o=e.android.allowWebStore,r=e.android.timeout,void 0!==a&&(void 0===t||void 0===s||void 0===n)){var g=function(e){var t={},n=e.split("#Intent;");if(2!==n.length)return t;for(var i=n[0].replace(/^intent:\/\//i,""),o=n[1].replace(/;?end\s*$/i,"").split(";"),r={},a=0;a<o.length;a++){var s=o[a],c=s.indexOf("=");-1!==c&&(r[s.substring(0,c)]=s.substring(c+1))}void 0!==r.scheme&&(i.length>0?t.scheme=r.scheme+"://"+i:t.scheme=r.scheme+"://");void 0!==r.package&&(t.packageName=r.package);if(void 0!==r["S.browser_fallback_url"]){var l=r["S.browser_fallback_url"];try{l=globalThis.decodeURIComponent(l)}catch(e){}/^https?:\/\//i.test(l)&&(t.fallback=l)}return t}(a);void 0!==g.scheme&&void 0===t&&(t=g.scheme),void 0!==g.packageName&&void 0===s&&(s=g.packageName),void 0!==g.fallback&&void 0===n&&(n=g.fallback)}return void 0!==t&&void 0===a&&(a=function(e,t,n){var i=e.split("://"),o=i[0],r=i[1],a="intent://";void 0!==r&&(a+=r);a+="#Intent;scheme="+o+";action=android.intent.action.VIEW;category=android.intent.category.BROWSABLE;",void 0!==t&&(a+="package="+t+";");void 0!==n&&"string"==typeof n?a+="S.browser_fallback_url="+globalThis.encodeURIComponent(n)+";":void 0!==t&&(a+="S.browser_fallback_url="+globalThis.encodeURIComponent(Ce(t,"android"))+";");return a+"end"}(t,s,n)),void 0===r&&(r=1e3),void 0!==a&&Ee()&&f.push(["intent",a]),void 0!==t&&f.push(["scheme",t]),void 0!==n&&f.push(["fallback",n]),void 0!==s&&(i&&f.push(["store",Ce(s,v)]),o&&f.push(["store",Ve(s,v)])),[f,r];case"ios":return void 0===e.ios?[[],0]:(d=ke(e.ios.universal),t=ke(e.ios.scheme),n=ke(e.ios.fallback),c=e.ios.bundleId,l=e.ios.trackId,i=e.ios.allowAppStore,o=e.ios.allowWebStore,r=e.ios.timeout,void 0!==c&&void 0===l&&(l=J(c)),void 0===r&&(r=2e3),void 0!==d&&Ae()&&f.push(["universal",d]),void 0!==t&&f.push(["scheme",t]),void 0!==n&&f.push(["fallback",n]),void 0!==l&&(i&&f.push(["store",Ce(l,v)]),o&&f.push(["store",Ve(l,v)])),[f,r]);case"windows":return void 0===e.windows?[[],0]:(t=ke(e.windows.scheme),n=ke(e.windows.fallback),u=e.windows.packageFamilyName,p=e.windows.productId,i=e.windows.allowAppStore,o=e.windows.allowWebStore,r=e.windows.timeout,void 0!==u&&void 0===p&&(p=function(e){var t=H.get(W,e);if(void 0!==t)return t;try{var n=$(Y(X(e)));if(void 0===n)return;return H.set(W,e,n),n}catch(e){return}}(u)),void 0===r&&(r=750),void 0!==t&&f.push(["scheme",t]),void 0!==n&&f.push(["fallback",n]),void 0!==p&&(i&&f.push(["store",Ce(p,v)]),o&&f.push(["store",Ve(p,v)])),[f,r]);case"macos":return void 0===e.macos?[[],0]:(t=ke(e.macos.scheme),n=ke(e.macos.fallback),c=e.macos.bundleId,l=e.macos.trackId,i=e.macos.allowAppStore,o=e.macos.allowWebStore,r=e.macos.timeout,void 0!==c&&void 0===l&&(l=J(c)),void 0===r&&(r=750),void 0!==t&&f.push(["scheme",t]),void 0!==n&&f.push(["fallback",n]),void 0!==l&&(i&&f.push(["store",Ce(l,v)]),o&&f.push(["store",Ve(l,v)])),[f,r])}}function Ee(){if("android"!==A.os.name)return!1;var e=A.browser.name,t=A.browser.version;return!("firefox"===e&&A.compareVersion(t,"41.0")<0)&&(!("firefox"===e&&A.compareVersion(t,"59.0")>=0&&A.compareVersion(t,"68.11.0")<0)&&(!("firefox"===e&&A.compareVersion(t,"80.0")>=0&&A.compareVersion(t,"82.0")<0)&&(!("firefox"===e&&A.compareVersion(t,"96.0")>=0&&A.compareVersion(t,"107.0")<0)&&(!("opera"===e&&A.compareVersion(t,"14.0")<0)&&!(/(?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/[\w.]+;/i.test(A.userAgent)||/instagram[\/ ][-\w.]+/i.test(A.userAgent)||/micromessenger\/([\w.]+)/i.test(A.userAgent)||/musical_ly(?:.+app_?version\/|_)[\w.]+/i.test(A.userAgent)||/ultralite app_version\/[\w.]+/i.test(A.userAgent))))))}function Ae(){return"ios"===A.os.name&&A.compareVersion(A.os.version,"9.0")>=0}function Pe(){var e=A.os.name,t=A.os.version;return!("unknown"===e||"android"===e&&!Ee()||"ios"===e||"windows"===e&&("Vista"===t||"XP"===t||"2000"===t||"NT 4.0"===t||"NT 3.11"===t||"ME"===t||A.compareVersion(t,"10")<0)||"macos"===e&&A.compareVersion(t,"10.10")<0)}function Ce(e,t){switch(t){case"android":return"market://details?id="+e;case"ios":return"itms-apps://itunes.apple.com/app/id"+e+"?mt=8";case"windows":return"ms-windows-store://pdp/?ProductId="+e;case"macos":return"macappstore://itunes.apple.com/app/id"+e+"?mt=12";default:return t}}function Ve(e,t){switch(t){case"android":return"https://play.google.com/store/apps/details?id="+e;case"ios":return"https://itunes.apple.com/app/id"+e+"?mt=8";case"windows":return"https://apps.microsoft.com/detail/"+e;case"macos":return"https://apps.apple.com/app/id"+e+"?mt=12";default:return t}}function Ne(e){return globalThis.encodeURIComponent(e).replace(/[!'()*]/g,function(e){return"%"+e.charCodeAt(0).toString(16)})}function Le(e){return e.replace(/[^\d+\-.]/g,"")}function _e(e){return Ne(e).replace(/%40/g,"@").replace(/%2C/gi,",")}function Oe(e){return void 0===e?[]:"string"==typeof e?[e]:e}function Re(e,t,n){void 0===t&&(t=void 0),void 0===n&&(n=",");for(var i=e.length,o="",r=0;r<i;r++)0!==r&&(o+=n),o+=void 0!==t?t(e[r]):e[r];return o}function Ue(e){for(var t=[],n=0;n<e.length;n++)for(var i=e[n],o=0;o<i.length;o++)t.push(i[o]);return t}function Me(e){return"directory"===e.kind}function De(e,t){return void 0===t&&(t=e.webkitRelativePath),Object.defineProperty(e,"webkitRelativePath",{value:t,writable:!1,configurable:!0,enumerable:!0}),e}function Fe(e){var t=K().document,n=Ie();function i(e,t,n){e.then(function(e){if(ve(e)){for(var i=[],o=0;o<e.length;o++)i[o]=e[o].getFile();return Promise.all(i).then(t).catch(n)}if(Me(e))return je(e,e.name).then(t).catch(n)}).catch(function(e){if(fe(e)&&"AbortError"===e.name)return t([]);n(e)})}function o(e,i){var o=!1;function r(r){if(!o){if(o=!0,function(){de=null;try{se(n.focus.target,n.focus.type,a),se(n.visibilitychange.target,n.visibilitychange.type,s),se(t,"click",c)}catch(e){}}(),!r)return i([]);i(function(e){var t=[];if(null===e)return t;for(var n=0;n<e.length;n++){var i=e[n];t.push(i)}return t}(e.files))}}function a(){globalThis.setTimeout(function(){e.value.length>0?r(!0):r(!1)},1e3)}function s(){be()||a()}function c(){r(!1)}e.onchange=function(){r(!0)},null!==de&&de(),void 0!==e.oncancel?e.oncancel=function(){r(!1)}:e.onclick=function(){ae(n.focus.target,n.focus.type,a),ae(n.visibilitychange.target,n.visibilitychange.type,s),globalThis.setTimeout(function(){ae(t,"click",c)},100),de=function(){r(!1)}},we(e)}return new Promise(function(t,n){return ge(e)?i(e,t,n):function(e){if(he(e))return!0;var t=e;return"object"==typeof t&&null!==t&&1===t.nodeType&&"string"==typeof t.tagName&&"INPUT"===t.tagName.toUpperCase()}(e)?o(e,t):void n(new TypeError("resolveFile expects an HTMLInputElement or a file-system handle Promise, but received: "+Object.prototype.toString.call(e)))})}function je(e,t){return void 0===t&&(t=""),new Promise(function(n,i){var o=e.values(),r=[];!function e(){o.next().then(function(o){o.done?function(){for(var e=[],o=function(n){var i,o=r[n],a=o.name;if(i=""===t?a:t+"/"+a,function(e){return"file"===e.kind}(o)){var s=o.getFile().then(function(e){return[De(e,i)]});e.push(s)}else Me(o)&&e.push(je(o,i))},a=0;a<r.length;a++)o(a);Promise.all(e).then(Ue).then(n).catch(i)}():(r.push(o.value),e())}).catch(i)}()})}var We={SettingType:Q,version:t,utils:{get canOpenIntent(){return Ee()},get canOpenUniversal(){return Ae()},get canOpenSetting(){return Pe()},getTrackId:function(e){var t=H.get(j,e);if(void 0!==t)return Promise.resolve(t);try{return Y(Z(e),!0).then(q).then(function(t){if(void 0!==t)return H.set(j,e,t),t})}catch(e){return Promise.resolve(void 0)}},getProductId:function(e){var t=H.get(W,e);if(void 0!==t)return Promise.resolve(t);try{return Y(X(e),!0).then($).then(function(t){if(void 0!==t)return H.set(W,e,t),t})}catch(e){return Promise.resolve(void 0)}}},app:function(e){var t;void 0===e&&(e={});try{t=Se(e)}catch(e){return Promise.reject(e)}var n=[],i=t[0],o=t[1];return 0===i.length?Promise.reject(new Error('No openable URL candidates were resolved for the current OS ("'+A.os.name+'"). Provide at least one of: scheme, intent, universal, fallback, or store id for this platform.')):new Promise(function(e,t){return function r(a){if(void 0===a&&(a=0),a>=i.length)return t(new Error("Failed to open the application using all available URLs.\n\nAttempted URLs:\n"+Re(n,void 0,"\n↓\n")));var s=i[a],c=s[0],l=s[1];if("string"==typeof l)return n[a]=l,xe(a,l,o).then(function(){e(c)}).catch(function(){r(a+1)});n[a]="[function fallback]",l(),e(c)}()})},telephone:function(e){void 0===e&&(e={});var t="tel:";return void 0!==e.to&&(t+=e.to.replace(/[^\d+*#]/g,"")),xe(0,t,me())},message:function(e){void 0===e&&(e={});var t=Oe(e.to),n="sms:";return t.length>0&&(n+=Re(t,Le)),void 0!==e.body&&("ios"!==A.os.name?n+="?":A.compareVersion(A.os.version,"8.0")>=0?n+="&":n+=";",n+="body="+Ne(e.body)),xe(0,n,me())},mail:function(e){void 0===e&&(e={});var t=[],n=Oe(e.to),i=Oe(e.cc),o=Oe(e.bcc),r="mailto:";return n.length>0&&(r+=Re(n,_e)),i.length>0&&t.push("cc="+Re(i,_e)),o.length>0&&t.push("bcc="+Re(o,_e)),"string"==typeof e.subject&&t.push("subject="+Ne(e.subject)),"string"==typeof e.body&&t.push("body="+Ne(e.body.replace(/\r\n|\n|\r/g,"\r\n"))),t.length>0&&(r+="?"+Re(t,void 0,"&")),xe(0,r,me())},filepicker:function(e){var t;void 0===e&&(e={});var n,i=[];if(ve(e.accept)?i=e.accept:"string"==typeof e.accept&&(i=""===(n=e.accept)?[]:n.split(/\s*[,,]\s*/).filter(function(e){return""!==e})),e.directory)if("function"==typeof globalThis.showDirectoryPicker){var o={mode:"read"};void 0!==e.id&&(o.id=e.id),void 0!==e.startIn&&(o.startIn=e.startIn),t=globalThis.showDirectoryPicker(o)}else{(c=P("input")).type="file",c.webkitdirectory=!0,c.accept=i.join(","),t=c}else if("function"==typeof globalThis.showOpenFilePicker){o={};if(void 0!==e.id&&(o.id=e.id),void 0!==e.startIn&&(o.startIn=e.startIn),void 0!==e.multiple&&(o.multiple=e.multiple),i.length>0){var r={};o.excludeAcceptAllOption=!0,o.types=[{description:"",accept:r}];for(var a=0;a<i.length;a++){var s=i[a];s.startsWith(".")?(void 0===r["application/octet-stream"]&&(r["application/octet-stream"]=[]),r["application/octet-stream"].push(s)):s.includes("/")&&(r[s]=[])}}t=globalThis.showOpenFilePicker(o)}else{var c;(c=P("input")).type="file",c.accept=i.join(","),void 0!==e.multiple&&(c.multiple=e.multiple),t=c}return Fe(t)},setting:function(e){void 0===e&&(e=Q.General);var t=A.os.name,n=A.os.version,i=[];if(!Pe())return Promise.reject(new Error('Opening system settings is not supported on this platform. (userAgent: "'+A.userAgent+'")'));switch(t){case"android":if("accessibility"===e&&A.compareVersion(n,"2.0")<0||"battery"===e&&A.compareVersion(n,"5.1")<0||"accounts"===e&&A.compareVersion(n,"1.5")<0||"storage"===e&&A.compareVersion(n,"1.5")<0||"general"===e){i.push(ce.android.general);break}i.push(ce.android[e]),i.push(ce.android.general);break;case"windows":i.push(ce.windows[e]);break;case"macos":"appearance"===e&&A.compareVersion(n,"10.14")<0?i.push(ce.macos.general):A.compareVersion(n,"13.0")<0?i.push(ce.macos[e]):i.push(ce.macos13[e])}return new Promise(function(t,n){return function o(r){return void 0===r&&(r=0),r>=i.length?n(new Error('Failed to open the "'+e+'" settings pane using all available URLs.\n\nAttempted URLs:\n'+Re(i,void 0,"\n↓\n"))):xe(r,i[r],750).then(function(){t()}).catch(function(){o(r+1)})}()})}};export{Q as SettingType,We as default};
|
|
1
|
+
var e,t="0.0.2",i="0.0.4",n=globalThis.navigator,o=void 0!==n?n.userAgent:"",r=void 0!==n?n.userAgentData:void 0,a=[[/windows nt (6\.[23]); arm/i,"windows",b],[/windows (?:phone|mobile|iot)(?: os)?[\/ ]?([\d.]*( se)?)/i,"windows",b],[/windows[\/ ](1[01]|2000|3\.1|7|8(\.1)?|9[58]|me|server 20\d\d( r2)?|vista|xp)/i,"windows",b],[/windows nt ?([\d.)]*)(?!.+xbox)/i,"windows",b],[/\bwin(?=3| ?9|n)(?:nt| 9x )?([\d.;]*)/i,"windows",b],[/windows ce\/?([\d.]*)/i,"windows",b],[/[adehimnop]{4,7}\b(?:.*os (\w+) like mac|; opera)/i,"ios",w],[/(?:ios;fbsv|ios(?=.+ip(?:ad|hone))|ip(?:ad|hone)(?: |.+i(?:pad)?)os)[\/ ]([\w.]+)/i,"ios",w],[/cfnetwork\/.+darwin/i,"ios",w],[/mac os x ?([\w. ]*)/i,"macos",w],[/(?:macintosh|mac_powerpc\b)(?!.+(haiku|morphos))/i,"macos",w],[/droid ([\w.]+)\b.+(android[- ]x86)/i,"android"],[/android\w*[-\/.; ]?([\d.]*)/i,"android"]],s=[[/\b(?:crmo|crios)\/([\w.]+)/i,"chrome"],[/webview.+edge\/([\w.]+)/i,"edge"],[/edg(?:e|ios|a)?\/([\w.]+)/i,"edge"],[/opera mini\/([-\w.]+)/i,"opera"],[/opera [mobileta]{3,6}\b.+version\/([-\w.]+)/i,"opera"],[/opera(?:.+version\/|[\/ ]+)([\w.]+)/i,"opera"],[/opios[\/ ]+([\w.]+)/i,"opera"],[/\bop(?:rg)?x\/([\w.]+)/i,"opera"],[/\bopr\/([\w.]+)/i,"opera"],[/iemobile(?:browser|boat|jet)[\/ ]?([\d.]*)/i,"ie"],[/(?:ms|\()ie ([\w.]+)/i,"ie"],[/trident.+rv[: ]([\w.]{1,9})\b.+like gecko/i,"ie"],[/\bfocus\/([\w.]+)/i,"firefox"],[/\bopt\/([\w.]+)/i,"opera"],[/coast\/([\w.]+)/i,"opera"],[/fxios\/([\w.-]+)/i,"firefox"],[/samsungbrowser\/([\w.]+)/i,"samsung"],[/headlesschrome(?:\/([\w.]+)| )/i,"chrome"],[/wv\).+chrome\/([\w.]+).+edgw\//i,"edge"],[/ wv\).+(chrome)\/([\w.]+)/i,"chrome"],[/chrome\/([\w.]+) mobile/i,"chrome"],[/chrome\/v?([\w.]+)/i,"chrome"],[/version\/([\w.,]+) .*mobile(?:\/\w+ | ?)safari/i,"safari"],[/iphone .*mobile(?:\/\w+ | ?)safari/i,"safari"],[/version\/([\w.,]+) .*safari/i,"safari"],[/webkit.+?(?:mobile ?safari|safari)(\/[\w.]+)/i,"safari","1"],[/(?:mobile|tablet);.*firefox\/([\w.-]+)/i,"firefox"],[/mobile vr; rv:([\w.]+)\).+firefox/i,"firefox"],[/firefox\/([\w.]+)/i,"firefox"]],c=[[/windows.+ edge\/([\w.]+)/i,"edgeHtml"],[/arkweb\/([\w.]+)/i,"arkWeb"],[/webkit\/537\.36.+chrome\/(?!27)([\w.]+)/i,"blink"],[/presto\/([\w.]+)/i,"presto"],[/webkit\/([\w.]+)/i,"webKit"],[/trident\/([\w.]+)/i,"trident"],[/netfront\/([\w.]+)/i,"netFront"],[/khtml[\/ ]\(?([\w.]+)/i,"khtml"],[/tasman[\/ ]\(?([\w.]+)/i,"tasman"],[/rv:([\w.]{1,9})\b.+gecko/i,"gecko"]],l={"Google Chrome":"Chrome","Microsoft Edge":"Edge","Microsoft Edge WebView2":"Edge WebView2","Android WebView":"Chrome WebView",HeadlessChrome:"Chrome Headless",OperaMobile:"Opera Mobi"},d=o,u=null,p=void 0,f=void 0,v=void 0,g=void 0,h=void 0,m=null;function b(e){if(void 0===e)return"";var t={"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!==t?t:e}function w(e){return void 0===e?"":e.replace(/_/g,".")}function y(e,t){return"function"==typeof t?t(e):"string"==typeof t?t:void 0===e?"":e}function T(){for(var e="unknown",t="",i=0;i<a.length;i++){var n=a[i],r=d.match(n[0]);if(null!==r){e=n[1],t=y(r[1],n[2]);break}}if("ios"===e&&0===E.compareVersion(t,"18.6")){var s=/\) Version\/([\d.]+)/.exec(d);if(null!==s)parseInt(s[1].split(".")[0],10)>=26&&(t=s[1])}return d===o&&(void 0!==p&&(e=p),void 0!==f&&(t=f),"macos"===e&&void 0!==globalThis.navigator.standalone&&void 0!==globalThis.navigator.maxTouchPoints&&globalThis.navigator.maxTouchPoints>2&&(e="ios")),{name:e,version:t}}function k(){for(var e="unknown",t="",i=0;i<s.length;i++){var n=s[i],r=d.match(n[0]);if(null!==r){e=n[1],t=y(r[1],n[2]);break}}return d===o&&(void 0!==v&&(e=v),void 0!==g&&(t=g)),{name:e,version:t}}function I(){for(var e="unknown",t="",i=0;i<c.length;i++){var n=c[i],r=d.match(n[0]);if(null!==r){e=n[1],t=y(r[1],n[2]);break}}return d===o&&void 0!==h&&(t=h),{name:e,version:t}}function x(){return null!==u&&u.userAgent===d?u:u={userAgent:d,os:T(),browser:k(),engine:I()}}function S(e){return null==e?{brand:"",version:""}:"string"==typeof e?{brand:e,version:""}:{brand:e.brand,version:e.version}}function A(){return void 0===r||void 0===r.getHighEntropyValues?Promise.resolve():r.getHighEntropyValues(["brands","fullVersionList","mobile","model","platform","platformVersion","architecture","formFactors","bitness","uaFullVersion","wow64"]).then(function(e){try{for(var t=e.fullVersionList||e.brands||[],i=e.platformVersion,n=e.platform,o=x().browser.name,r=null,a=0;a<t.length;a++){var s=S(t[a]),c=s.version,d=s.brand;/not.a.brand/i.test(d)||((null===r||/Chrom/.test(r)&&"Chromium"!==d||"Edge"===r&&/WebView2/.test(d))&&(d=l[d]||d,null!==(r=o)&&!/Chrom/.test(r)&&/Chrom/.test(d)||("Chrome"===(o=d)||"Chrome WebView"===o||"Chrome Headless"===o?v="chrome":"Edge"===o||"Edge WebView2"===o?v="edge":"Opera Mobi"===o&&(v="opera"),g=c),r=d),"Chromium"===d&&(h=c))}"string"==typeof i&&(f="windows"===x().os.name?parseInt(i.split(".")[0],10)>=13?"11":"10":i),"string"==typeof n&&(/android/i.test(n)?p="android":/ios|iphone|ipad/i.test(n)?p="ios":/windows|win32/i.test(n)?p="windows":/macos|macintel/i.test(n)&&(p="macos")),!0===e.mobile&&(m="mobile"),u=null}catch(e){}}).catch(function(){u=null})}e=A();var E={version:i,get ready(){return e},set userAgent(t){d!==t&&(d=t,u=null,p=void 0,f=void 0,v=void 0,g=void 0,h=void 0,m=null,e=A())},get userAgent(){return d},get os(){return x().os},get browser(){return x().browser},get engine(){return x().engine},get device(){if(d===o&&null!==m)return m;var e=x().os.name;return"ios"===e||"android"===e?"mobile":"windows"===e||"macos"===e?"desktop":"unknown"},get webview(){return/; ?wv|applewebkit(?!.*safari)/i.test(d)},get node(){return void 0!==globalThis.process&&void 0!==globalThis.process.versions&&void 0!==globalThis.process.versions.node},get standalone(){return"ios"===x().os.name?!0===globalThis.navigator.standalone:void 0!==globalThis.matchMedia&&globalThis.matchMedia("(display-mode: standalone)").matches},compareVersion:function(e,t){for(var i=e.split("."),n=t.split("."),o=Math.max(i.length,n.length),r=0;r<o;r++){var a=void 0,s=void 0;if((a=r<i.length?parseInt(i[r],10):0)>(s=r<n.length?parseInt(n[r],10):0))return 1;if(a<s)return-1}return 0}};function P(e,t){void 0===t&&(t=!0);var i=globalThis.document.createElement(e);return void 0!==i.width&&(i.width="0"),void 0!==i.height&&(i.height="0"),void 0!==i.border&&(i.border="0"),void 0!==i.frameBorder&&(i.frameBorder="0"),void 0!==i.scrolling&&(i.scrolling="no"),void 0!==i.cellPadding&&(i.cellPadding="0"),void 0!==i.cellSpacing&&(i.cellSpacing="0"),void 0!==i.frame&&(i.frame="void"),void 0!==i.rules&&(i.rules="none"),void 0!==i.noWrap&&(i.noWrap=!0),i.tabIndex=-1,i.setAttribute("role","presentation"),t?(i.setAttribute("aria-hidden","false"),i.style.width="1px",i.style.height="1px"):(i.setAttribute("aria-hidden","true"),i.style.width="0",i.style.height="0",i.style.zIndex="-9999",i.style.display="none",i.style.visibility="hidden",i.style.pointerEvents="none"),i.style.position="absolute",i.style.top="0",i.style.left="0",i.style.padding="0",i.style.margin="0",i.style.border="none",i.style.outline="hidden",i.style.clip="rect(1px, 1px, 1px, 1px)",i.style.clipPath="inset(50%)",i.style.overflow="hidden",i.style.whiteSpace="nowrap",i}var V=["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","iw","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"];function C(e){if(null==e)return e;if(0===e.length)return null;if("C"===(e=e.replace(/_/g,"-"))||"posix"===e.toLowerCase())return"en-US";if(-1!==e.indexOf("."))return C(e.split(".")[0]);if(-1!==e.indexOf("@"))return C(e.split("@")[0]);var t=e.split("-");return 0===t.length?null:(t[0]=t[0].toLowerCase(),t.length>1&&2===t[1].length&&(t[1]=t[1].toUpperCase()),t.length>2&&4===t[1].length&&(t[1]=t[1].charAt(0).toUpperCase()+t[1].slice(1).toLowerCase()),t.join("-"))}var _=null,N=[],L=null;function O(e){"string"==typeof(e=C(e))&&-1===N.indexOf(e)&&(null===_&&(_=e),N.push(e))}if("undefined"!=typeof Intl){try{O(Intl.DateTimeFormat().resolvedOptions().locale)}catch(e){}try{Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){}}void 0!==globalThis.navigator&&(void 0!==globalThis.navigator.languages&&function(e){for(var t=0;t<e.length;t++)O(e[t])}(globalThis.navigator.languages),void 0!==globalThis.navigator.language&&O(globalThis.navigator.language),void 0!==globalThis.navigator.userLanguage&&O(globalThis.navigator.userLanguage),void 0!==globalThis.navigator.browserLanguage&&O(globalThis.navigator.browserLanguage),void 0!==globalThis.navigator.systemLanguage&&O(globalThis.navigator.systemLanguage));try{-1*(new Date).getTimezoneOffset()}catch(e){}if("string"==typeof _){if("undefined"!=typeof Intl&&void 0!==Intl.Locale)try{var q=new Intl.Locale(_);"function"==typeof q.getTextInfo?L="rtl"===q.getTextInfo().direction:void 0!==q.textInfo&&(L="rtl"===q.textInfo.direction)}catch(e){}if("boolean"!=typeof L){var z=/^([A-Za-z]{1,8})(?:[-_][A-Za-z0-9]{1,8})*$/.exec(_);if(null!==z)for(var R=z[1].toLowerCase(),U=0;U<V.length;U++)if(V[U]===R){L=!0;break}}}var M={languages:N},F="track-id",D="bundle-id",j=36e5,W=function(){var e;try{if(void 0===globalThis.localStorage)e=!1;else{var t="__id_cache_test__";globalThis.localStorage.setItem(t,""),globalThis.localStorage.removeItem(t),e=!0}}catch(t){e=!1}if(e)return{get:function(e,t){try{var i=globalThis.localStorage.getItem(e+":"+t);if(null==i)return;var n=i.split("|");if(2!==n.length)return;var o=+n[0];return G(o)||o<H()?void globalThis.localStorage.removeItem(e+":"+t):n[1]}catch(e){return}},set:function(e,t,i){try{globalThis.localStorage.setItem(e+":"+t,H()+j+"|"+i)}catch(e){return}}};if(void 0!==globalThis.Map){var i=new Map;return{get:function(e,t){var n=i.get(e+":"+t);if(void 0!==n){var o=n.split("|");if(2===o.length){var r=+o[0];if(!(G(r)||r<H()))return o[1];i.delete(e+":"+t)}}},set:function(e,t,n){i.set(e+":"+t,H()+j+"|"+n)}}}var n=Object.create(null);return{get:function(e,t){var i=n[e+":"+t];if(void 0!==i){var o=i.split("|");if(2===o.length){var r=+o[0];if(!(G(r)||r<H()))return o[1];try{delete n[e+":"+t]}catch(i){n[e+":"+t]=void 0}}}},set:function(e,t,i){n[e+":"+t]=H()+j+"|"+i}}}();function G(e){return e!=e}function H(){return void 0!==Date.now?Date.now():(new Date).getTime()}function B(e,t){if(void 0===t&&(t=!1),"function"==typeof globalThis.fetch&&t)return globalThis.fetch(e).then(function(e){return e.json()}).catch(function(e){});try{var i=new XMLHttpRequest;i.open("GET",e,t),i.send();var n=i.status;return n>=200&&n<300?JSON.parse(i.response):void 0}catch(e){return}}function Y(e){for(var t=M.languages,i="en-US",n="US",o=0;o<t.length;o++){var r=t[o];if(-1!==r.indexOf("-")){for(var a=r.split("-"),s=1;s<a.length;s++){var c=a[s];if(/^[A-Za-z]{2}$/.test(c)||/^\d{3}$/.test(c)){i=r,n=c;break}}if(i===r)break}}return"https://displaycatalog.md.mp.microsoft.com/v7.0/products/lookup?value="+globalThis.encodeURIComponent(e)+"&market="+globalThis.encodeURIComponent(n)+"&languages="+globalThis.encodeURIComponent(i)+"&alternateId=PackageFamilyName"}function X(e){return"https://itunes.apple.com/lookup?bundleId="+globalThis.encodeURIComponent(e)}function Z(e){if(void 0!==e){var t=void 0;if(void 0!==e.Products?t=e.Products[0]:void 0!==e.Product&&(t=e.Product),null!=t)return t.ProductId}}function $(e){if(void 0!==e&&void 0!==e.results){var t=e.results;if(0!==t.length){var i=t[0];if(void 0!==i)return""+i.trackId}}}function J(e){var t=W.get(F,e);if(void 0!==t)return t;try{var i=$(B(X(e)));if(void 0===i)return;return W.set(F,e,i),i}catch(e){return}}function K(){try{if(null!==globalThis.top&&globalThis.top!==globalThis.window)return globalThis.top.location.href,globalThis.top}catch(e){}return globalThis}var Q,ee=[],te=["","webkit","moz","ms","MS","o","O"],ie={focus:["focus","focusin"],blur:["blur","focusout"]};function ne(e,t){var i,n=ie[t];i=void 0!==n?n:[t];for(var o=0;o<te.length;o++)for(var r=0;r<i.length;r++){var a=te[o]+i[r];if(void 0!==e["on"+a])return a}return t}function oe(){this.returnValue=!1}function re(){this.cancelBubble=!0}function ae(e,t,i){if(void 0!==e&&void 0!==t){if(t=ne(e,t),"function"==typeof e.addEventListener)return e.addEventListener(t,i);if("function"==typeof e.attachEvent){var n=function(e,t,i){for(var n=0;n<ee.length;n++){var o=ee[n];if(o.target===e&&o.type===t&&o.callback===i)return o.wrapper}}(e,t,i);if("function"==typeof n)return;var o=function(t){if(void 0===t&&(t=globalThis.event),void 0!==t){try{Object.defineProperty(t,"currentTarget",{value:e,configurable:!0})}catch(e){}"function"!=typeof t.preventDefault&&(t.preventDefault=oe.bind(t)),"function"!=typeof t.stopPropagation&&(t.stopPropagation=re.bind(t)),i.call(e,t)}};return function(e,t,i,n){ee.push({target:e,type:t,callback:i,wrapper:n})}(e,t,i,o),e.attachEvent("on"+t,o)}}}function se(e,t,i){if(void 0!==e&&void 0!==t){if(t=ne(e,t),"function"==typeof e.removeEventListener)return e.removeEventListener(t,i);if("function"!=typeof e.detachEvent);else{var n=function(e,t,i){for(var n=0;n<ee.length;n++){var o=ee[n];if(o.target===e&&o.type===t&&o.callback===i)return ee.splice(n,1),o.wrapper}}(e,t,i);"function"==typeof n&&e.detachEvent("on"+t,n)}}}!function(e){e.General="general",e.Network="network",e.Display="display",e.Appearance="appearance",e.Accessibility="accessibility",e.Battery="battery",e.Datetime="datetime",e.Language="language",e.Accounts="accounts",e.Storage="storage"}(Q||(Q={}));var ce={android:{general:"intent:#Intent;action=android.settings.SETTINGS;end",network:"intent:#Intent;action=android.settings.WIFI_SETTINGS;end",display:"intent:#Intent;action=android.settings.DISPLAY_SETTINGS;end",appearance:"intent:#Intent;action=android.settings.DISPLAY_SETTINGS;end",accessibility:"intent:#Intent;action=android.settings.ACCESSIBILITY_SETTINGS;end",battery:"intent:#Intent;action=android.settings.BATTERY_SAVER_SETTINGS;end",datetime:"intent:#Intent;action=android.settings.DATE_SETTINGS;end",language:"intent:#Intent;action=android.settings.LOCALE_SETTINGS;end",accounts:"intent:#Intent;action=android.settings.SYNC_SETTINGS;end",storage:"intent:#Intent;action=android.settings.INTERNAL_STORAGE_SETTINGS;end"},windows:{general:"ms-settings:system",network:"ms-settings:network",display:"ms-settings:display",appearance:"ms-settings:colors",accessibility:"ms-settings:easeofaccess",battery:"ms-settings:batterysaver",datetime:"ms-settings:dateandtime",language:"ms-settings:regionlanguage",accounts:"ms-settings:emailandaccounts",storage:"ms-settings:storagesense"},macos:{general:"x-apple.systempreferences:",network:"x-apple.systempreferences:com.apple.preference.network",display:"x-apple.systempreferences:com.apple.preference.displays",appearance:"x-apple.systempreferences:com.apple.preference.general",accessibility:"x-apple.systempreferences:com.apple.preference.universalaccess",battery:"x-apple.systempreferences:com.apple.preference.energysaver",datetime:"x-apple.systempreferences:com.apple.preference.datetime",language:"x-apple.systempreferences:com.apple.Localization",accounts:"x-apple.systempreferences:com.apple.preferences.internetaccounts",storage:"x-apple.systempreferences:"},macos13:{general:"x-apple.systempreferences:com.apple.General-Settings.extension",network:"x-apple.systempreferences:com.apple.Network-Settings.extension",display:"x-apple.systempreferences:com.apple.Displays-Settings.extension",appearance:"x-apple.systempreferences:com.apple.Appearance-Settings.extension",accessibility:"x-apple.systempreferences:com.apple.Accessibility-Settings.extension",battery:"x-apple.systempreferences:com.apple.Battery-Settings.extension",datetime:"x-apple.systempreferences:com.apple.Date-Time-Settings.extension",language:"x-apple.systempreferences:com.apple.Localization-Settings.extension",accounts:"x-apple.systempreferences:com.apple.Internet-Accounts-Settings.extension",storage:"x-apple.systempreferences:com.apple.settings.Storage"}},le=globalThis.navigator,de=null;function ue(e){return function(t){return Object.prototype.toString.call(t)==="[object "+e+"]"}}var pe=ue("URL"),fe=ue("DOMException"),ve=ue("Array"),ge=ue("Promise"),he=ue("HTMLInputElement");function me(){switch(E.os.name){case"android":return 1e3;case"ios":return 2e3;default:return 750}}function be(){var e=K().document;return"hidden"===e.visibilityState||("hidden"===e.webkitVisibilityState||("hidden"===e.mozVisibilityState||("hidden"===e.msVisibilityState||(void 0!==e.hidden?e.hidden:void 0!==e.webkitHidden?e.webkitHidden:void 0!==e.mozHidden?e.mozHidden:void 0!==e.msHidden?e.msHidden:"function"!=typeof e.hasFocus||!e.hasFocus()))))}function we(e,t){var i;void 0===t&&(t=globalThis);try{i=new MouseEvent("click",{bubbles:!0,cancelable:!0,view:t})}catch(e){(i=globalThis.document.createEvent("MouseEvents")).initMouseEvent("click",!0,!0,t,0,0,0,0,0,!1,!1,!1,!1,0,null)}e.dispatchEvent(i)}function ye(e){return"function"==typeof e.hasFocus&&e.hasFocus()}function Te(e){try{e.focus({preventScroll:!0})}catch(t){try{e.focus()}catch(e){}}}function ke(e){return pe(e)?e.toString():e}function Ie(){var e=K(),t=e.document;return void 0!==globalThis.cordova?{focus:{target:t,type:"resume"},blur:{target:t,type:"pause"},visibilitychange:{}}:"ios"===E.os.name?E.compareVersion(E.os.version,"8.0")>=0?{focus:{},blur:{},visibilitychange:{target:t,type:"visibilitychange"}}:{focus:{target:e,type:"pageshow"},blur:{target:e,type:"pagehide"},visibilitychange:{}}:"function"==typeof globalThis.document.addEventListener?{focus:{target:e,type:"focus"},blur:{target:e,type:"blur"},visibilitychange:{target:t,type:"visibilitychange"}}:{focus:{target:t,type:"focus"},blur:{target:t,type:"blur"},visibilitychange:{target:t,type:"visibilitychange"}}}function xe(e,t,i){var n=Ie(),o=K(),r=o.document,a=void 0,s=void 0;function c(){if(void 0===globalThis.cordova){if(void 0!==le&&void 0!==le.userActivation&&le.userActivation.isActive||0===e)o.location.href=t;else try{(a=P("a")).href=t,r.body.appendChild(a),we(a,o)}catch(e){}finally{if(void 0!==a)try{r.body.removeChild(a)}catch(e){}}try{return(s=P("iframe")).src=t,r.body.appendChild(s),void globalThis.setTimeout(function(){if(void 0!==s)try{r.body.removeChild(s)}catch(e){}},500)}catch(e){}}else void 0!==globalThis.cordova.InAppBrowser?globalThis.cordova.InAppBrowser.open(t,"_system"):globalThis.open(t,"_system")}return new Promise(function(e,t){var o,l=!1;function d(i){l||(l=!0,function(){void 0!==o&&(clearTimeout(o),o=void 0);try{se(n.blur.target,n.blur.type,u),se(n.focus.target,n.focus.type,p),se(n.visibilitychange.target,n.visibilitychange.type,f)}catch(e){}if(void 0!==a)try{r.body.removeChild(a)}catch(e){}if(void 0!==s)try{r.body.removeChild(s)}catch(e){}}(),i?e():t())}function u(){void 0!==o&&(clearTimeout(o),o=void 0),se(n.blur.target,n.blur.type,u),ae(n.focus.target,n.focus.type,p)}function p(){d(!0)}function f(){be()?u():p()}o=globalThis.setTimeout(function(){d(!1)},i),ae(n.blur.target,n.blur.type,u),ae(n.visibilitychange.target,n.visibilitychange.type,f),ye(r)||function(){var e=K(),t=e.document;if(Te(e),ye(t))return!0;if(t.body.tabIndex<0&&(t.body.tabIndex=-1),Te(t.body),ye(t))return!0;var i=void 0;try{if(void 0===(i=P("input")))return!1;i.type="text",i.readOnly=!0,t.body.appendChild(i),Te(i);try{i.select()}catch(e){}if(ye(t))return!0}catch(e){}finally{if(null!=i){try{i.blur()}catch(e){}try{t.body.removeChild(i)}catch(e){}}}ye(t)}();try{c()}catch(e){d(!1)}})}function Se(e){var t,i,n,o,r,a,s,c,l,d,u,p,f,v,g=[],h=E.os.name;if("unknown"===h)throw new Error('Cannot resolve app open options: unsupported or undetected OS. (userAgent: "'+E.userAgent+'")');switch(h){case"android":if(void 0===e.android)return[[],0];if(c=ke(e.android.intent),t=ke(e.android.scheme),i=ke(e.android.fallback),l=e.android.packageName,a=!0===e.android.assumeAllowedInApp,n=e.android.allowAppStore,o=e.android.allowWebStore,r=Pe(a),s=e.android.timeout,void 0!==c&&(void 0===t||void 0===l||void 0===i)){var m=function(e){var t={},i=e.split("#Intent;");if(2!==i.length)return t;for(var n=i[0].replace(/^intent:\/\//i,""),o=i[1].replace(/;?end\s*$/i,"").split(";"),r={},a=0;a<o.length;a++){var s=o[a],c=s.indexOf("=");-1!==c&&(r[s.substring(0,c)]=s.substring(c+1))}void 0!==r.scheme&&(n.length>0?t.scheme=r.scheme+"://"+n:t.scheme=r.scheme+"://");void 0!==r.package&&(t.packageName=r.package);if(void 0!==r["S.browser_fallback_url"]){var l=r["S.browser_fallback_url"];try{l=globalThis.decodeURIComponent(l)}catch(e){}/^https?:\/\//i.test(l)&&(t.fallback=l)}return t}(c);void 0!==m.scheme&&void 0===t&&(t=m.scheme),void 0!==m.packageName&&void 0===l&&(l=m.packageName),void 0!==m.fallback&&void 0===i&&(i=m.fallback)}return void 0!==t&&void 0===c&&(c=function(e,t,i){var n=e.split("://"),o=n[0],r=n[1],a="intent://";void 0!==r&&(a+=r);a+="#Intent;scheme="+o+";action=android.intent.action.VIEW;category=android.intent.category.BROWSABLE;",void 0!==t&&(a+="package="+t+";");void 0!==i&&"string"==typeof i?a+="S.browser_fallback_url="+globalThis.encodeURIComponent(i)+";":void 0!==t&&(a+="S.browser_fallback_url="+globalThis.encodeURIComponent(Ne(t,"android"))+";");return a+"end"}(t,l,i)),void 0===s&&(s=1e3),void 0!==c&&Ae()&&g.push(["intent",c]),void 0!==t&&r&&g.push(["scheme",t]),void 0!==i&&g.push(["fallback",i]),void 0!==l&&(n&&r&&g.push(["store",Ne(l,h)]),o&&g.push(["store",Le(l,h)])),[g,s];case"ios":return void 0===e.ios?[[],0]:(p=ke(e.ios.universal),t=ke(e.ios.scheme),i=ke(e.ios.fallback),d=e.ios.bundleId,u=e.ios.trackId,a=!0===e.ios.assumeAllowedInApp,n=e.ios.allowAppStore,o=e.ios.allowWebStore,r=Pe(a),s=e.ios.timeout,void 0!==d&&void 0===u&&(u=J(d)),void 0===s&&(s=2e3),void 0!==p&&Ee(a)&&g.push(["universal",p]),void 0!==t&&r&&g.push(["scheme",t]),void 0!==i&&g.push(["fallback",i]),void 0!==u&&(n&&r&&g.push(["store",Ne(u,h)]),o&&g.push(["store",Le(u,h)])),[g,s]);case"windows":return void 0===e.windows?[[],0]:(t=ke(e.windows.scheme),i=ke(e.windows.fallback),f=e.windows.packageFamilyName,v=e.windows.productId,n=e.windows.allowAppStore,o=e.windows.allowWebStore,s=e.windows.timeout,void 0!==f&&void 0===v&&(v=function(e){var t=W.get(D,e);if(void 0!==t)return t;try{var i=Z(B(Y(e)));if(void 0===i)return;return W.set(D,e,i),i}catch(e){return}}(f)),void 0===s&&(s=750),void 0!==t&&g.push(["scheme",t]),void 0!==i&&g.push(["fallback",i]),void 0!==v&&(n&&g.push(["store",Ne(v,h)]),o&&g.push(["store",Le(v,h)])),[g,s]);case"macos":return void 0===e.macos?[[],0]:(t=ke(e.macos.scheme),i=ke(e.macos.fallback),d=e.macos.bundleId,u=e.macos.trackId,n=e.macos.allowAppStore,o=e.macos.allowWebStore,s=e.macos.timeout,void 0!==d&&void 0===u&&(u=J(d)),void 0===s&&(s=750),void 0!==t&&g.push(["scheme",t]),void 0!==i&&g.push(["fallback",i]),void 0!==u&&(n&&g.push(["store",Ne(u,h)]),o&&g.push(["store",Le(u,h)])),[g,s])}}function Ae(){if("android"!==E.os.name)return!1;var e=E.browser.name,t=E.browser.version;return!("firefox"===e&&E.compareVersion(t,"41.0")<0)&&(!("firefox"===e&&E.compareVersion(t,"59.0")>=0&&E.compareVersion(t,"68.11.0")<0)&&(!("firefox"===e&&E.compareVersion(t,"80.0")>=0&&E.compareVersion(t,"82.0")<0)&&(!("firefox"===e&&E.compareVersion(t,"96.0")>=0&&E.compareVersion(t,"107.0")<0)&&(!("opera"===e&&E.compareVersion(t,"14.0")<0)&&(!Ve()&&!Ce()&&!(/(?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/[\w.]+;/i.test(E.userAgent)||/instagram[\/ ][-\w.]+/i.test(E.userAgent)||/musical_ly(?:.+app_?version\/|_)[\w.]+/i.test(E.userAgent)||/ultralite app_version\/[\w.]+/i.test(E.userAgent)))))))}function Ee(e){if(void 0===e&&(e=!1),"ios"!==E.os.name||E.compareVersion(E.os.version,"9.0")<0)return!1;if(Ce()&&!e)return!1;var t=E.userAgent,i=t.match(/micromessenger\/(\d+(?:\.\d+)*)/i);return!(null!==i&&E.compareVersion(i[1],"7.0.5")<0)&&(!(/ qq\/[\d.]+/i.test(t)||/m?qqbrowser\/[\d.]+/i.test(t)||/ucbrowser\/[\d.]+/i.test(t))&&!/qzone\/.*_qz_[\d.]+/i.test(t))}function Pe(e){void 0===e&&(e=!1);var t=E.os.name;return"android"===t?!Ve()&&(!Ce()||e):"ios"!==t||!/micromessenger\/[\w.]+/i.test(E.userAgent)&&(!Ce()||e)}function Ve(){if("android"!==E.os.name)return!1;var e=E.userAgent;return/micromessenger\/[\w.]+/i.test(e)||/ qq\/[\d.]+/i.test(e)||/qzone\/.*_qz_[\d.]+/i.test(e)||/baiduboxapp\/[\d.]+/i.test(e)}function Ce(){return/weibo.*weibo__[\d.]+/i.test(E.userAgent)}function _e(){var e=E.os.name,t=E.os.version;return!("unknown"===e||"android"===e&&!Ae()||"ios"===e||"windows"===e&&("Vista"===t||"XP"===t||"2000"===t||"NT 4.0"===t||"NT 3.11"===t||"ME"===t||E.compareVersion(t,"10")<0)||"macos"===e&&E.compareVersion(t,"10.10")<0)}function Ne(e,t){switch(t){case"android":return"market://details?id="+e;case"ios":return"itms-apps://itunes.apple.com/app/id"+e+"?mt=8";case"windows":return"ms-windows-store://pdp/?ProductId="+e;case"macos":return"macappstore://itunes.apple.com/app/id"+e+"?mt=12";default:return t}}function Le(e,t){switch(t){case"android":return"https://play.google.com/store/apps/details?id="+e;case"ios":return"https://itunes.apple.com/app/id"+e+"?mt=8";case"windows":return"https://apps.microsoft.com/detail/"+e;case"macos":return"https://apps.apple.com/app/id"+e+"?mt=12";default:return t}}function Oe(e){return globalThis.encodeURIComponent(e).replace(/[!'()*]/g,function(e){return"%"+e.charCodeAt(0).toString(16)})}function qe(e){return e.replace(/[^\d+\-.]/g,"")}function ze(e){return Oe(e).replace(/%40/g,"@").replace(/%2C/gi,",")}function Re(e){return ve(e)?e[0]+","+e[1]:Oe(e)}function Ue(e){return void 0===e?"":ve(e)?"pos."+e[0]+"_"+e[1]:Oe(e)}function Me(e){return void 0===e?[]:"string"==typeof e?[e]:e}function Fe(e,t,i){void 0===t&&(t=void 0),void 0===i&&(i=",");for(var n=e.length,o="",r=0;r<n;r++)0!==r&&(o+=i),o+=void 0!==t?t(e[r]):e[r];return o}function De(e){for(var t=[],i=0;i<e.length;i++)for(var n=e[i],o=0;o<n.length;o++)t.push(n[o]);return t}function je(e){return"directory"===e.kind}function We(e,t){return void 0===t&&(t=e.webkitRelativePath),Object.defineProperty(e,"webkitRelativePath",{value:t,writable:!1,configurable:!0,enumerable:!0}),e}function Ge(e){var t=K().document,i=Ie();function n(e,t,i){e.then(function(e){if(ve(e)){for(var n=[],o=0;o<e.length;o++)n[o]=e[o].getFile();return Promise.all(n).then(t).catch(i)}if(je(e))return He(e,e.name).then(t).catch(i)}).catch(function(e){if(fe(e)&&"AbortError"===e.name)return t([]);i(e)})}function o(e,n){var o=!1;function r(r){if(!o){if(o=!0,function(){de=null;try{se(i.focus.target,i.focus.type,a),se(i.visibilitychange.target,i.visibilitychange.type,s),se(t,"click",c)}catch(e){}}(),!r)return n([]);n(function(e){var t=[];if(null===e)return t;for(var i=0;i<e.length;i++){var n=e[i];t.push(n)}return t}(e.files))}}function a(){globalThis.setTimeout(function(){e.value.length>0?r(!0):r(!1)},1e3)}function s(){be()||a()}function c(){r(!1)}e.onchange=function(){r(!0)},null!==de&&de(),void 0!==e.oncancel?e.oncancel=function(){r(!1)}:e.onclick=function(){ae(i.focus.target,i.focus.type,a),ae(i.visibilitychange.target,i.visibilitychange.type,s),globalThis.setTimeout(function(){ae(t,"click",c)},100),de=function(){r(!1)}},we(e)}return new Promise(function(t,i){return ge(e)?n(e,t,i):function(e){if(he(e))return!0;var t=e;return"object"==typeof t&&null!==t&&1===t.nodeType&&"string"==typeof t.tagName&&"INPUT"===t.tagName.toUpperCase()}(e)?o(e,t):void i(new TypeError("resolveFile expects an HTMLInputElement or a file-system handle Promise, but received: "+Object.prototype.toString.call(e)))})}function He(e,t){return void 0===t&&(t=""),new Promise(function(i,n){var o=e.values(),r=[];!function e(){o.next().then(function(o){o.done?function(){for(var e=[],o=function(i){var n,o=r[i],a=o.name;if(n=""===t?a:t+"/"+a,function(e){return"file"===e.kind}(o)){var s=o.getFile().then(function(e){return[We(e,n)]});e.push(s)}else je(o)&&e.push(He(o,n))},a=0;a<r.length;a++)o(a);Promise.all(e).then(De).then(i).catch(n)}():(r.push(o.value),e())}).catch(n)}()})}var Be={SettingType:Q,version:t,utils:{get canOpenIntent(){return Ae()},get canOpenUniversal(){return Ee()},get canOpenSetting(){return _e()},getTrackId:function(e){var t=W.get(F,e);if(void 0!==t)return Promise.resolve(t);try{return B(X(e),!0).then($).then(function(t){if(void 0!==t)return W.set(F,e,t),t})}catch(e){return Promise.resolve(void 0)}},getProductId:function(e){var t=W.get(D,e);if(void 0!==t)return Promise.resolve(t);try{return B(Y(e),!0).then(Z).then(function(t){if(void 0!==t)return W.set(D,e,t),t})}catch(e){return Promise.resolve(void 0)}}},app:function(e){var t;void 0===e&&(e={});try{t=Se(e)}catch(e){return Promise.reject(e)}var i=t[0],n=t[1];return 0===i.length?Promise.reject(new Error('No openable URL candidates were resolved for the current OS ("'+E.os.name+'"). Provide at least one of: scheme, intent, universal, fallback, or store id for this platform.')):new Promise(function(e,t){var o=[];return function r(a){if(void 0===a&&(a=0),a>=i.length)return t(new Error("Failed to open the application using all available URLs.\n\nAttempted URLs:\n"+Fe(o,void 0,"\n↓\n")));var s=i[a],c=s[0],l=s[1];if("string"==typeof l)return o[a]=l,xe(a,l,n).then(function(){e(c)}).catch(function(){r(a+1)});o[a]="[function fallback]",l(),e(c)}()})},telephone:function(e){void 0===e&&(e={});var t="tel:";return void 0!==e.to&&(t+=e.to.replace(/[^\d+*#]/g,"")),xe(0,t,me())},message:function(e){void 0===e&&(e={});var t=Me(e.to),i="sms:";return t.length>0&&(i+=Fe(t,qe)),void 0!==e.body&&("ios"!==E.os.name?i+="?":E.compareVersion(E.os.version,"8.0")>=0?i+="&":i+=";",i+="body="+Oe(e.body)),xe(0,i,me())},mail:function(e){void 0===e&&(e={});var t=[],i=Me(e.to),n=Me(e.cc),o=Me(e.bcc),r="mailto:";return i.length>0&&(r+=Fe(i,ze)),n.length>0&&t.push("cc="+Fe(n,ze)),o.length>0&&t.push("bcc="+Fe(o,ze)),"string"==typeof e.subject&&t.push("subject="+Oe(e.subject)),"string"==typeof e.body&&t.push("body="+Oe(e.body.replace(/\r\n|\n|\r/g,"\r\n"))),t.length>0&&(r+="?"+Fe(t,void 0,"&")),xe(0,r,me())},map:function(e){void 0===e&&(e={});var t=[],i=[],n="";switch(E.os.name){case"android":void 0!==e.coordinate?n="geo:"+e.coordinate[0]+","+e.coordinate[1]:void 0!==e.query?(n="geo:0,0",t.push("q="+Oe(e.query))):n="geo:0,0",void 0!==e.zoom&&t.push("z="+e.zoom),t.length>0&&(n=n+"?"+Fe(t,void 0,"&")),i.push(n);break;case"ios":case"macos":void 0!==e.directions?(void 0!==e.directions.destination&&t.push("daddr="+Re(e.directions.destination)),void 0!==e.directions.origin&&t.push("saddr="+Re(e.directions.origin))):void 0!==e.coordinate?(t.push("ll="+e.coordinate[0]+","+e.coordinate[1]),void 0!==e.label&&t.push("q="+Oe(e.label))):void 0!==e.query&&t.push("q="+Oe(e.query)),void 0!==e.zoom&&t.push("z="+e.zoom),i.push("maps://?"+Fe(t,void 0,"&"));break;case"windows":void 0!==e.directions?t.push("rtp="+Ue(e.directions.origin)+"~"+Ue(e.directions.destination)):void 0!==e.coordinate?(t.push("cp="+e.coordinate[0]+"~"+e.coordinate[1]),void 0!==e.label&&t.push("q="+Oe(e.label))):void 0!==e.query&&t.push("where="+Oe(e.query)),void 0!==e.zoom&&t.push("lvl="+e.zoom),i.push("bingmaps:?"+Fe(t,void 0,"&"))}if(void 0!==e.fallback)i.push(ke(e.fallback));else{var o=["api=1"];void 0!==e.directions?(o.push("destination="+Re(e.directions.destination)),void 0!==e.directions.origin&&o.push("origin="+Re(e.directions.origin)),i.push("https://www.google.com/maps/dir/?"+Fe(o,void 0,"&"))):(void 0!==e.coordinate?o.push("query="+e.coordinate[0]+","+e.coordinate[1]):void 0!==e.query&&o.push("query="+Oe(e.query)),void 0!==e.zoom&&o.push("zoom="+e.zoom),i.push("https://www.google.com/maps/search/?"+Fe(o,void 0,"&")))}return new Promise(function(e,t){var n=[];return function o(r){if(void 0===r&&(r=0),r>=i.length)return t(new Error("Failed to open a map using all available URLs.\n\nAttempted URLs:\n"+Fe(n,void 0,"\n↓\n")));var a=i[r];if("string"==typeof a)return n[r]=a,xe(r,a,me()).then(function(){e()}).catch(function(){o(r+1)});n[r]="[function fallback]",a(),e()}()})},filepicker:function(e){var t;void 0===e&&(e={});var i,n=[];if(ve(e.accept)?n=e.accept:"string"==typeof e.accept&&(n=""===(i=e.accept)?[]:i.split(/\s*[,,]\s*/).filter(function(e){return""!==e})),e.directory)if("function"==typeof globalThis.showDirectoryPicker){var o={mode:"read"};void 0!==e.id&&(o.id=e.id),void 0!==e.startIn&&(o.startIn=e.startIn),t=globalThis.showDirectoryPicker(o)}else{(c=P("input")).type="file",c.webkitdirectory=!0,c.accept=n.join(","),t=c}else if("function"==typeof globalThis.showOpenFilePicker){o={};if(void 0!==e.id&&(o.id=e.id),void 0!==e.startIn&&(o.startIn=e.startIn),void 0!==e.multiple&&(o.multiple=e.multiple),n.length>0){var r={};o.excludeAcceptAllOption=!0,o.types=[{description:"",accept:r}];for(var a=0;a<n.length;a++){var s=n[a];s.startsWith(".")?(void 0===r["application/octet-stream"]&&(r["application/octet-stream"]=[]),r["application/octet-stream"].push(s)):s.includes("/")&&(r[s]=[])}}t=globalThis.showOpenFilePicker(o)}else{var c;(c=P("input")).type="file",c.accept=n.join(","),void 0!==e.multiple&&(c.multiple=e.multiple),t=c}return Ge(t)},setting:function(e){void 0===e&&(e=Q.General);var t=E.os.name,i=E.os.version,n=[];if(!_e())return Promise.reject(new Error('Opening system settings is not supported on this platform. (userAgent: "'+E.userAgent+'")'));switch(t){case"android":if("accessibility"===e&&E.compareVersion(i,"2.0")<0||"battery"===e&&E.compareVersion(i,"5.1")<0||"accounts"===e&&E.compareVersion(i,"1.5")<0||"storage"===e&&E.compareVersion(i,"1.5")<0||"general"===e){n.push(ce.android.general);break}n.push(ce.android[e]),n.push(ce.android.general);break;case"windows":n.push(ce.windows[e]);break;case"macos":"appearance"===e&&E.compareVersion(i,"10.14")<0?n.push(ce.macos.general):E.compareVersion(i,"13.0")<0?n.push(ce.macos[e]):n.push(ce.macos13[e])}return new Promise(function(t,i){return function o(r){return void 0===r&&(r=0),r>=n.length?i(new Error('Failed to open the "'+e+'" settings pane using all available URLs.\n\nAttempted URLs:\n'+Fe(n,void 0,"\n↓\n"))):xe(r,n[r],750).then(function(){t()}).catch(function(){o(r+1)})}()})}};export{Q as SettingType,Be as default};
|
|
2
2
|
//# sourceMappingURL=launch-kit.min.mjs.map
|