hocmai-feedback-widget 0.2.0 → 0.2.1

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.
@@ -1,4 +1,4 @@
1
- (function(R,w){typeof exports=="object"&&typeof module<"u"?w(exports,require("react/jsx-runtime"),require("react")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react"],w):(R=typeof globalThis<"u"?globalThis:R||self,w(R.SupportFeedbackLib={},R.jsxRuntime,R.React))})(this,(function(R,w,A){"use strict";var kn="2.0.7",En=500,kt="user-agent",ue="",Et="?",_={FUNCTION:"function",OBJECT:"object",STRING:"string",UNDEFINED:"undefined"},z="browser",Y="cpu",j="device",W="engine",H="os",fe="result",f="name",c="type",g="vendor",h="version",U="architecture",Se="major",u="model",Le="console",E="mobile",N="tablet",D="smarttv",G="wearable",Ue="xr",Ce="embedded",ge="inapp",tt="brands",le="formFactors",nt="fullVersionList",he="platform",rt="platformVersion",ze="bitness",te="sec-ch-ua",Tn=te+"-full-version-list",In=te+"-arch",An=te+"-"+ze,Nn=te+"-form-factors",Mn=te+"-"+E,On=te+"-"+u,Tt=te+"-"+he,_n=Tt+"-version",It=[tt,nt,E,u,he,rt,U,le,ze],Be="Amazon",pe="Apple",At="ASUS",Nt="BlackBerry",ce="Google",Mt="Huawei",it="Lenovo",Ot="Honor",Pe="LG",ot="Microsoft",st="Motorola",_t="Nvidia",Dt="OnePlus",at="OPPO",ke="Samsung",Ft="Sharp",Ee="Sony",lt="Xiaomi",ct="Zebra",Lt="Chrome",Ut="Chromium",ne="Chromecast",He="Edge",Te="Firefox",Ie="Opera",dt="Facebook",zt="Sogou",we="Mobile ",Ae=" Browser",ut="Windows",Dn=typeof window!==_.UNDEFINED,B=Dn&&window.navigator?window.navigator:void 0,de=B&&B.userAgentData?B.userAgentData:void 0,Fn=function(e,t){var n={},r=t;if(!We(t)){r={};for(var a in t)for(var o in t[a])r[o]=t[a][o].concat(r[o]?r[o]:[])}for(var i in e)n[i]=r[i]&&r[i].length%2===0?r[i].concat(e[i]):e[i];return n},$e=function(e){for(var t={},n=0;n<e.length;n++)t[e[n].toUpperCase()]=e[n];return t},ft=function(e,t){if(typeof e===_.OBJECT&&e.length>0){for(var n in e)if(re(t)==re(e[n]))return!0;return!1}return Ne(e)?re(t)==re(e):!1},We=function(e,t){for(var n in e)return/^(browser|cpu|device|engine|os)$/.test(n)||(t?We(e[n]):!1)},Ne=function(e){return typeof e===_.STRING},gt=function(e){if(e){for(var t=[],n=me(/\\?\"/g,e).split(","),r=0;r<n.length;r++)if(n[r].indexOf(";")>-1){var a=qe(n[r]).split(";v=");t[r]={brand:a[0],version:a[1]}}else t[r]=qe(n[r]);return t}},re=function(e){return Ne(e)?e.toLowerCase():e},ht=function(e){return Ne(e)?me(/[^\d\.]/g,e).split(".")[0]:void 0},J=function(e){for(var t in e)if(e.hasOwnProperty(t)){var n=e[t];typeof n==_.OBJECT&&n.length==2?this[n[0]]=n[1]:this[n]=void 0}return this},me=function(e,t){return Ne(t)?t.replace(e,ue):t},Me=function(e){return me(/\\?\"/g,e)},qe=function(e,t){return e=me(/^\s\s*/,String(e)),typeof t===_.UNDEFINED?e:e.substring(0,t)},pt=function(e,t){if(!(!e||!t))for(var n=0,r,a,o,i,s,d;n<t.length&&!s;){var p=t[n],l=t[n+1];for(r=a=0;r<p.length&&!s&&p[r];)if(s=p[r++].exec(e),s)for(o=0;o<l.length;o++)d=s[++a],i=l[o],typeof i===_.OBJECT&&i.length>0?i.length===2?typeof i[1]==_.FUNCTION?this[i[0]]=i[1].call(this,d):this[i[0]]=i[1]:i.length>=3&&(typeof i[1]===_.FUNCTION&&!(i[1].exec&&i[1].test)?i.length>3?this[i[0]]=d?i[1].apply(this,i.slice(2)):void 0:this[i[0]]=d?i[1].call(this,d,i[2]):void 0:i.length==3?this[i[0]]=d?d.replace(i[1],i[2]):void 0:i.length==4?this[i[0]]=d?i[3].call(this,d.replace(i[1],i[2])):void 0:i.length>4&&(this[i[0]]=d?i[3].apply(this,[d.replace(i[1],i[2])].concat(i.slice(4))):void 0)):this[i]=d||void 0;n+=2}},q=function(e,t){for(var n in t)if(typeof t[n]===_.OBJECT&&t[n].length>0){for(var r=0;r<t[n].length;r++)if(ft(t[n][r],e))return n===Et?void 0:n}else if(ft(t[n],e))return n===Et?void 0:n;return t.hasOwnProperty("*")?t["*"]:e},Bt={ME:"4.90","NT 3.51":"3.51","NT 4.0":"4.0",2e3:["5.0","5.01"],XP:["5.1","5.2"],Vista:"6.0",7:"6.1",8:"6.2","8.1":"6.3",10:["6.4","10.0"],NT:""},Pt={embedded:"Automotive",mobile:"Mobile",tablet:["Tablet","EInk"],smarttv:"TV",wearable:"Watch",xr:["VR","XR"],"?":["Desktop","Unknown"],"*":void 0},Ln={Chrome:"Google Chrome",Edge:"Microsoft Edge","Edge WebView2":"Microsoft Edge WebView2","Chrome WebView":"Android WebView","Chrome Headless":"HeadlessChrome","Huawei Browser":"HuaweiBrowser","MIUI Browser":"Miui Browser","Opera Mobi":"OperaMobile",Yandex:"YaBrowser"},Ht={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[h,[f,we+"Chrome"]],[/webview.+edge\/([\w\.]+)/i],[h,[f,He+" WebView"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[h,[f,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[f,h],[/opios[\/ ]+([\w\.]+)/i],[h,[f,Ie+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[h,[f,Ie+" GX"]],[/\bopr\/([\w\.]+)/i],[h,[f,Ie]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[h,[f,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[h,[f,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(atlas|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon|otter|dooble|(?:lg |qute)browser|palemoon)\/([-\w\.]+)/i,/(heytap|ovi|115|surf|qwant)browser\/([\d\.]+)/i,/(qwant)(?:ios|mobile)\/([\d\.]+)/i,/(ecosia|weibo)(?:__| \w+@)([\d\.]+)/i],[f,h],[/quark(?:pc)?\/([-\w\.]+)/i],[h,[f,"Quark"]],[/\bddg\/([\w\.]+)/i],[h,[f,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[h,[f,"UCBrowser"]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[h,[f,"WeChat"]],[/konqueror\/([\w\.]+)/i],[h,[f,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[h,[f,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[h,[f,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[h,[f,"Smart "+it+Ae]],[/(avast|avg)\/([\w\.]+)/i],[[f,/(.+)/,"$1 Secure"+Ae],h],[/\bfocus\/([\w\.]+)/i],[h,[f,Te+" Focus"]],[/\bopt\/([\w\.]+)/i],[h,[f,Ie+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[h,[f,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[h,[f,"Dolphin"]],[/coast\/([\w\.]+)/i],[h,[f,Ie+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[h,[f,"MIUI"+Ae]],[/fxios\/([\w\.-]+)/i],[h,[f,we+Te]],[/\bqihoobrowser\/?([\w\.]*)/i],[h,[f,"360"]],[/\b(qq)\/([\w\.]+)/i],[[f,/(.+)/,"$1Browser"],h],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[f,/(.+)/,"$1"+Ae],h],[/samsungbrowser\/([\w\.]+)/i],[h,[f,ke+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[h,[f,zt+" Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[f,zt+" Mobile"],h],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[f,h],[/(lbbrowser|rekonq|steam(?= (clie|tenf|gameo)))/i],[f],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[h,f],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[f,dt],h,[c,ge]],[/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/(daum)apps[\/ ]([\w\.]+)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(bing)(?:web|sapphire)\/([\w\.]+)/i,/(instagram|snapchat|klarna)[\/ ]([-\w\.]+)/i],[f,h,[c,ge]],[/\bgsa\/([\w\.]+) .*safari\//i],[h,[f,"GSA"],[c,ge]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[h,[f,"TikTok"],[c,ge]],[/\[(linkedin)app\]/i],[f,[c,ge]],[/(zalo(?:app)?)[\/\sa-z]*([\w\.-]+)/i],[[f,/(.+)/,"Zalo"],h,[c,ge]],[/(chromium)[\/ ]([-\w\.]+)/i],[f,h],[/headlesschrome(?:\/([\w\.]+)| )/i],[h,[f,Lt+" Headless"]],[/wv\).+chrome\/([\w\.]+).+edgw\//i],[h,[f,He+" WebView2"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[f,Lt+" WebView"],h],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[h,[f,"Android"+Ae]],[/chrome\/([\w\.]+) mobile/i],[h,[f,we+"Chrome"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[f,h],[/version\/([\w\.\,]+) .*mobile(?:\/\w+ | ?)safari/i],[h,[f,we+"Safari"]],[/iphone .*mobile(?:\/\w+ | ?)safari/i],[[f,we+"Safari"]],[/version\/([\w\.\,]+) .*(safari)/i],[h,f],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[f,[h,"1"]],[/(webkit|khtml)\/([\w\.]+)/i],[f,h],[/(?:mobile|tablet);.*(firefox)\/([\w\.-]+)/i],[[f,we+Te],h],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[f,"Netscape"],h],[/(wolvic|librewolf)\/([\w\.]+)/i],[f,h],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[h,[f,Te+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+(?= .+rv\:.+gecko\/\d+)|[0-4][\w\.]+(?!.+compatible))/i,/(amaya|dillo|doris|icab|ladybird|lynx|mosaic|netsurf|obigo|polaris|w3m|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/\b(links) \(([\w\.]+)/i],[f,[h,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[f,[h,/[^\d\.]+./,ue]]],cpu:[[/\b((amd|x|x86[-_]?|wow|win)64)\b/i],[[U,"amd64"]],[/(ia32(?=;))/i,/\b((i[346]|x)86)(pc)?\b/i],[[U,"ia32"]],[/\b(aarch64|arm(v?[89]e?l?|_?64))\b/i],[[U,"arm64"]],[/\b(arm(v[67])?ht?n?[fl]p?)\b/i],[[U,"armhf"]],[/( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i],[[U,"arm"]],[/ sun4\w[;\)]/i],[[U,"sparc"]],[/\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i,/((ppc|powerpc)(64)?)( mac|;|\))/i,/(?:osf1|[freopnt]{3,4}bsd) (alpha)/i],[[U,/ower/,ue,re]],[/mc680.0/i],[[U,"68k"]],[/winnt.+\[axp/i],[[U,"alpha"]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[u,[g,ke],[c,N]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr]|browser)[-\w]+)/i,/sec-(sgh\w+)/i],[u,[g,ke],[c,E]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)[\/\);]/i],[u,[g,pe],[c,E]],[/\b(?:ios|apple\w+)\/.+[\(\/](ipad)/i,/\b(ipad)[\d,]*[;\] ].+(mac |i(pad)?)os/i],[u,[g,pe],[c,N]],[/(macintosh);/i],[u,[g,pe]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[u,[g,Ft],[c,E]],[/\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i],[u,[g,Ot],[c,N]],[/honor([-\w ]+)[;\)]/i],[u,[g,Ot],[c,E]],[/\b((?:ag[rs][2356]?k?|bah[234]?|bg[2o]|bt[kv]|cmr|cpn|db[ry]2?|jdn2|got|kob2?k?|mon|pce|scm|sht?|[tw]gr|vrd)-[ad]?[lw][0125][09]b?|605hw|bg2-u03|(?:gem|fdr|m2|ple|t1)-[7a]0[1-4][lu]|t1-a2[13][lw]|mediapad[\w\. ]*(?= bui|\)))\b(?!.+d\/s)/i],[u,[g,Mt],[c,N]],[/(?:huawei) ?([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][\dc][adnt]?)\b(?!.+d\/s)/i],[u,[g,Mt],[c,E]],[/oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i,/\b(?:xiao)?((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i],[[u,/_/g," "],[g,lt],[c,N]],[/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/oid[^\)]+; (redmi[\-_ ]?(?:note|k)?[\w_ ]+|m?[12]\d[01]\d\w{3,6}|poco[\w ]+|(shark )?\w{3}-[ah]0|qin ?[1-3](s\+|ultra| pro)?)( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note|max|cc)?[_ ]?(?:\d{0,2}\w?)[_ ]?(?:plus|se|lite|pro)?( 5g|lte)?)(?: bui|\))/i,/ ([\w ]+) miui\/v?\d/i],[[u,/_/g," "],[g,lt],[c,E]],[/droid.+; (cph2[3-6]\d[13579]|((gm|hd)19|(ac|be|in|kb)20|(d[en]|eb|le|mt)21|ne22)[0-2]\d|p[g-k]\w[1m]10)\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[u,[g,Dt],[c,E]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[u,[g,at],[c,E]],[/\b(opd2(\d{3}a?))(?: bui|\))/i],[u,[g,q,{OnePlus:["203","304","403","404","413","415"],"*":at}],[c,N]],[/(vivo (5r?|6|8l?|go|one|s|x[il]?[2-4]?)[\w\+ ]*)(?: bui|\))/i],[u,[g,"BLU"],[c,E]],[/; vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[u,[g,"Vivo"],[c,E]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[u,[g,"Realme"],[c,E]],[/(ideatab[-\w ]+|602lv|d-42a|a101lv|a2109a|a3500-hv|s[56]000|pb-6505[my]|tb-?x?\d{3,4}(?:f[cu]|xu|[av])|yt\d?-[jx]?\d+[lfmx])( bui|;|\)|\/)/i,/lenovo ?(b[68]0[08]0-?[hf]?|tab(?:[\w- ]+?)|tb[\w-]{6,7})( bui|;|\)|\/)/i],[u,[g,it],[c,N]],[/lenovo[-_ ]?([-\w ]+?)(?: bui|\)|\/)/i],[u,[g,it],[c,E]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ]([\w\s]+)(\)| bui)/i,/((?:moto(?! 360)[-\w\(\) ]+|xt\d{3,4}[cgkosw\+]?[-\d]*|nexus 6)(?= bui|\)))/i],[u,[g,st],[c,E]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[u,[g,st],[c,N]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[u,[g,Pe],[c,N]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+(?!.*(?:browser|netcast|android tv|watch|webos))(\w+)/i,/\blg-?([\d\w]+) bui/i],[u,[g,Pe],[c,E]],[/(nokia) (t[12][01])/i],[g,u,[c,N]],[/(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i,/nokia[-_ ]?(([-\w\. ]*?))( bui|\)|;|\/)/i],[[u,/_/g," "],[c,E],[g,"Nokia"]],[/(pixel (c|tablet))\b/i],[u,[g,ce],[c,N]],[/droid.+;(?: google)? (g(01[13]a|020[aem]|025[jn]|1b60|1f8f|2ybb|4s1m|576d|5nz6|8hhn|8vou|a02099|c15s|d1yq|e2ae|ec77|gh2x|kv4x|p4bc|pj41|r83y|tt9q|ur25|wvk6)|pixel[\d ]*a?( pro)?( xl)?( fold)?( \(5g\))?)( bui|\))/i],[u,[g,ce],[c,E]],[/(google) (pixelbook( go)?)/i],[g,u],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-\w\w\d\d)(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[u,[g,Ee],[c,E]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[u,"Xperia Tablet"],[g,Ee],[c,N]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[u,[g,Be],[c,N]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[u,/(.+)/g,"Fire Phone $1"],[g,Be],[c,E]],[/(playbook);[-\w\),; ]+(rim)/i],[u,g,[c,N]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/(?:blackberry|\(bb10;) (\w+)/i],[u,[g,Nt],[c,E]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[u,[g,At],[c,N]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[u,[g,At],[c,E]],[/(nexus 9)/i],[u,[g,"HTC"],[c,N]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[g,[u,/_/g," "],[c,E]],[/tcl (xess p17aa)/i,/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])(_\w(\w|\w\w))?(\)| bui)/i],[u,[g,"TCL"],[c,N]],[/droid [\w\.]+; (418(?:7d|8v)|5087z|5102l|61(?:02[dh]|25[adfh]|27[ai]|56[dh]|59k|65[ah])|a509dl|t(?:43(?:0w|1[adepqu])|50(?:6d|7[adju])|6(?:09dl|10k|12b|71[efho]|76[hjk])|7(?:66[ahju]|67[hw]|7[045][bh]|71[hk]|73o|76[ho]|79w|81[hks]?|82h|90[bhsy]|99b)|810[hs]))(_\w(\w|\w\w))?(\)| bui)/i],[u,[g,"TCL"],[c,E]],[/(itel) ((\w+))/i],[[g,re],u,[c,q,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[u,[g,"Acer"],[c,N]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[u,[g,"Meizu"],[c,E]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[u,[g,"Ulefone"],[c,E]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[u,[g,"Energizer"],[c,E]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[u,[g,"Cat"],[c,E]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[u,[g,"Smartfren"],[c,E]],[/droid.+; (a(in)?(0(15|59|6[35])|142)p?)/i],[u,[g,"Nothing"],[c,E]],[/; (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i,/archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i],[u,[g,"Archos"],[c,N]],[/archos ([\w ]+)( b|\))/i,/; (ac[3-6]\d\w{2,8})( b|\))/i],[u,[g,"Archos"],[c,E]],[/; (n159v)/i],[u,[g,"HMD"],[c,E]],[/(imo) (tab \w+)/i,/(infinix|tecno) (x1101b?|p904|dp(7c|8d|10a)( pro)?|p70[1-3]a?|p904|t1101)/i],[g,u,[c,N]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus(?! zenw)|dell|jolla|meizu|motorola|polytron|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (blu|hmd|imo|infinix|lava|oneplus|tcl|wiko)[_ ]([\w\+ ]+?)(?: bui|\)|; r)/i,/(hp) ([\w ]+\w)/i,/(microsoft); (lumia[\w ]+)/i,/(oppo) ?([\w ]+) bui/i,/(hisense) ([ehv][\w ]+)\)/i,/droid[^;]+; (philips)[_ ]([sv-x][\d]{3,4}[xz]?)/i],[g,u,[c,E]],[/(kobo)\s(ereader|touch)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i],[g,u,[c,N]],[/(surface duo)/i],[u,[g,ot],[c,N]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[u,[g,"Fairphone"],[c,E]],[/((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i],[u,[g,_t],[c,N]],[/(sprint) (\w+)/i],[g,u,[c,E]],[/(kin\.[onetw]{3})/i],[[u,/\./g," "],[g,ot],[c,E]],[/droid.+; ([c6]+|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[u,[g,ct],[c,N]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[u,[g,ct],[c,E]],[/(philips)[\w ]+tv/i,/smart-tv.+(samsung)/i],[g,[c,D]],[/hbbtv.+maple;(\d+)/i],[[u,/^/,"SmartTV"],[g,ke],[c,D]],[/(vizio)(?: |.+model\/)(\w+-\w+)/i,/tcast.+(lg)e?. ([-\w]+)/i],[g,u,[c,D]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[g,Pe],[c,D]],[/(apple) ?tv/i],[g,[u,pe+" TV"],[c,D]],[/crkey.*devicetype\/chromecast/i],[[u,ne+" Third Generation"],[g,ce],[c,D]],[/crkey.*devicetype\/([^/]*)/i],[[u,/^/,"Chromecast "],[g,ce],[c,D]],[/fuchsia.*crkey/i],[[u,ne+" Nest Hub"],[g,ce],[c,D]],[/crkey/i],[[u,ne],[g,ce],[c,D]],[/(portaltv)/i],[u,[g,dt],[c,D]],[/droid.+aft(\w+)( bui|\))/i],[u,[g,Be],[c,D]],[/(shield \w+ tv)/i],[u,[g,_t],[c,D]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[u,[g,Ft],[c,D]],[/(bravia[\w ]+)( bui|\))/i],[u,[g,Ee],[c,D]],[/(mi(tv|box)-?\w+) bui/i],[u,[g,lt],[c,D]],[/Hbbtv.*(technisat) (.*);/i],[g,u,[c,D]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[g,/.+\/(\w+)/,"$1",q,{LG:"lge"}],[u,qe],[c,D]],[/(playstation \w+)/i],[u,[g,Ee],[c,Le]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[u,[g,ot],[c,Le]],[/(ouya)/i,/(nintendo) (\w+)/i,/(retroid) (pocket ([^\)]+))/i,/(valve).+(steam deck)/i,/droid.+; ((shield|rgcube|gr0006))( bui|\))/i],[[g,q,{Nvidia:"Shield",Anbernic:"RGCUBE",Logitech:"GR0006"}],u,[c,Le]],[/\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i],[u,[g,ke],[c,G]],[/((pebble))app/i,/(asus|google|lg|oppo|xiaomi) ((pixel |zen)?watch[\w ]*)( bui|\))/i],[g,u,[c,G]],[/(ow(?:19|20)?we?[1-3]{1,3})/i],[u,[g,at],[c,G]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[u,[g,pe],[c,G]],[/(opwwe\d{3})/i],[u,[g,Dt],[c,G]],[/(moto 360)/i],[u,[g,st],[c,G]],[/(smartwatch 3)/i],[u,[g,Ee],[c,G]],[/(g watch r)/i],[u,[g,Pe],[c,G]],[/droid.+; (wt63?0{2,3})\)/i],[u,[g,ct],[c,G]],[/droid.+; (glass) \d/i],[u,[g,ce],[c,Ue]],[/(pico) ([\w ]+) os\d/i],[g,u,[c,Ue]],[/(quest( \d| pro)?s?).+vr/i],[u,[g,dt],[c,Ue]],[/mobile vr; rv.+firefox/i],[[c,Ue]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[g,[c,Ce]],[/(aeobc)\b/i],[u,[g,Be],[c,Ce]],[/(homepod).+mac os/i],[u,[g,pe],[c,Ce]],[/windows iot/i],[[c,Ce]],[/droid.+; ([\w- ]+) (4k|android|smart|google)[- ]?tv/i],[u,[c,D]],[/\b((4k|android|smart|opera)[- ]?tv|tv; rv:|large screen[\w ]+safari)\b/i],[[c,D]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew|; hmsc).+?(mobile|vr|\d) safari/i],[u,[c,q,{mobile:"Mobile",xr:"VR","*":N}]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[c,N]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[c,E]],[/droid .+?; ([\w\. -]+)( bui|\))/i],[u,[g,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[h,[f,He+"HTML"]],[/(arkweb)\/([\w\.]+)/i],[f,h],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[h,[f,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[f,h],[/ladybird\//i],[[f,"LibWeb"]],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[h,f]],os:[[/(windows nt) (6\.[23]); arm/i],[[f,/N/,"R"],[h,q,Bt]],[/(windows (?:phone|mobile|iot))(?: os)?[\/ ]?([\d\.]*( se)?)/i,/(windows)[\/ ](1[01]|2000|3\.1|7|8(\.1)?|9[58]|me|server 20\d\d( r2)?|vista|xp)/i],[f,h],[/windows nt ?([\d\.\)]*)(?!.+xbox)/i,/\bwin(?=3| ?9|n)(?:nt| 9x )?([\d\.;]*)/i],[[h,/(;|\))/g,"",q,Bt],[f,ut]],[/(windows ce)\/?([\d\.]*)/i],[f,h],[/[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv|ios(?=.+ip(?:ad|hone)|.+apple ?tv)|ip(?:ad|hone)(?: |.+i(?:pad)?)os|apple ?tv.+ios)[\/ ]([\w\.]+)/i,/\btvos ?([\w\.]+)/i,/cfnetwork\/.+darwin/i],[[h,/_/g,"."],[f,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+(haiku|morphos))/i],[[f,"macOS"],[h,/_/g,"."]],[/android ([\d\.]+).*crkey/i],[h,[f,ne+" Android"]],[/fuchsia.*crkey\/([\d\.]+)/i],[h,[f,ne+" Fuchsia"]],[/crkey\/([\d\.]+).*devicetype\/smartspeaker/i],[h,[f,ne+" SmartSpeaker"]],[/linux.*crkey\/([\d\.]+)/i],[h,[f,ne+" Linux"]],[/crkey\/([\d\.]+)/i],[h,[f,ne]],[/droid ([\w\.]+)\b.+(android[- ]x86)/i],[h,f],[/(ubuntu) ([\w\.]+) like android/i],[[f,/(.+)/,"$1 Touch"],h],[/(harmonyos)[\/ ]?([\d\.]*)/i,/(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen)\w*[-\/\.; ]?([\d\.]*)/i],[f,h],[/\(bb(10);/i],[h,[f,Nt]],[/(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i],[h,[f,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[h,[f,Te+" OS"]],[/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i,/webos(?:[ \/]?|\.tv-20(?=2[2-9]))(\d[\d\.]*)/i],[h,[f,"webOS"]],[/web0s;.+?(?:chr[o0]me|safari)\/(\d+)/i],[[h,q,{25:"120",24:"108",23:"94",22:"87",6:"79",5:"68",4:"53",3:"38",2:"538",1:"537","*":"TV"}],[f,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[h,[f,"watchOS"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[f,"Chrome OS"],h],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) (\w+)/i,/(xbox); +xbox ([^\);]+)/i,/(pico) .+os([\w\.]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/linux.+(mint)[\/\(\) ]?([\w\.]*)/i,/(mageia|vectorlinux|fuchsia|arcaos|arch(?= ?linux))[;l ]([\d\.]*)/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire|knoppix)(?: gnu[\/ ]linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/\b(aix)[; ]([1-9\.]{0,4})/i,/(hurd|linux|morphos)(?: (?:arm|x86|ppc)\w*| ?)([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) ?(r\d)?/i],[f,h],[/(sunos) ?([\d\.]*)/i],[[f,"Solaris"],h],[/\b(beos|os\/2|amigaos|openvms|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[f,h]]},Ve=(function(){var e={init:{},isIgnore:{},isIgnoreRgx:{},toString:{}};return J.call(e.init,[[z,[f,h,Se,c]],[Y,[U]],[j,[c,u,g]],[W,[f,h]],[H,[f,h]]]),J.call(e.isIgnore,[[z,[h,Se]],[W,[h]],[H,[h]]]),J.call(e.isIgnoreRgx,[[z,/ ?browser$/i],[H,/ ?os$/i]]),J.call(e.toString,[[z,[f,h]],[Y,[U]],[j,[g,u]],[W,[f,h]],[H,[f,h]]]),e})(),Un=function(e,t){var n=Ve.init[t],r=Ve.isIgnore[t]||0,a=Ve.isIgnoreRgx[t]||0,o=Ve.toString[t]||0;function i(){J.call(this,n)}return i.prototype.getItem=function(){return e},i.prototype.withClientHints=function(){return de?de.getHighEntropyValues(It).then(function(s){return e.setCH(new $t(s,!1)).parseCH().get()}):e.parseCH().get()},i.prototype.withFeatureCheck=function(){return e.detectFeature().get()},t!=fe&&(i.prototype.is=function(s){var d=!1;for(var p in this)if(this.hasOwnProperty(p)&&!ft(r,p)&&re(a?me(a,this[p]):this[p])==re(a?me(a,s):s)){if(d=!0,s!=_.UNDEFINED)break}else if(s==_.UNDEFINED&&d){d=!d;break}return d},i.prototype.toString=function(){var s=ue;for(var d in o)typeof this[o[d]]!==_.UNDEFINED&&(s+=(s?" ":ue)+this[o[d]]);return s||_.UNDEFINED}),i.prototype.then=function(s){var d=this,p=function(){for(var m in d)d.hasOwnProperty(m)&&(this[m]=d[m])};p.prototype={is:i.prototype.is,toString:i.prototype.toString,withClientHints:i.prototype.withClientHints,withFeatureCheck:i.prototype.withFeatureCheck};var l=new p;return s(l),l},new i};function $t(e,t){if(e=e||{},J.call(this,It),t)J.call(this,[[tt,gt(e[te])],[nt,gt(e[Tn])],[E,/\?1/.test(e[Mn])],[u,Me(e[On])],[he,Me(e[Tt])],[rt,Me(e[_n])],[U,Me(e[In])],[le,gt(e[Nn])],[ze,Me(e[An])]]);else for(var n in e)this.hasOwnProperty(n)&&typeof e[n]!==_.UNDEFINED&&(this[n]=e[n])}function ie(e,t,n,r){return J.call(this,[["itemType",e],["ua",t],["uaCH",r],["rgxMap",n],["data",Un(this,e)]]),this}ie.prototype.get=function(e){return e?this.data.hasOwnProperty(e)?this.data[e]:void 0:this.data},ie.prototype.set=function(e,t){return this.data[e]=t,this},ie.prototype.setCH=function(e){return this.uaCH=e,this},ie.prototype.detectFeature=function(){if(B&&B.userAgent==this.ua)switch(this.itemType){case z:B.brave&&typeof B.brave.isBrave==_.FUNCTION&&this.set(f,"Brave");break;case j:!this.get(c)&&de&&de[E]&&this.set(c,E),this.get(u)=="Macintosh"&&B&&typeof B.standalone!==_.UNDEFINED&&B.maxTouchPoints&&B.maxTouchPoints>2&&this.set(u,"iPad").set(c,N);break;case H:!this.get(f)&&de&&de[he]&&this.set(f,de[he]);break;case fe:var e=this.data,t=function(n){return e[n].getItem().detectFeature().get()};this.set(z,t(z)).set(Y,t(Y)).set(j,t(j)).set(W,t(W)).set(H,t(H))}return this},ie.prototype.parseUA=function(){switch(this.itemType!=fe&&pt.call(this.data,this.ua,this.rgxMap),this.itemType){case z:this.set(Se,ht(this.get(h)));break;case H:if(this.get(f)=="iOS"&&this.get(h)=="18.6"){var e=/\) Version\/([\d\.]+)/.exec(this.ua);e&&parseInt(e[1].substring(0,2),10)>=26&&this.set(h,e[1])}break}return this},ie.prototype.parseCH=function(){var e=this.uaCH,t=this.rgxMap;switch(this.itemType){case z:case W:var n=e[nt]||e[tt],r;if(n)for(var a=0;a<n.length;a++){var o=n[a].brand||n[a],i=n[a].version;this.itemType==z&&!/not.a.brand/i.test(o)&&(!r||/Chrom/.test(r)&&o!=Ut||r==He&&/WebView2/.test(o))&&(o=q(o,Ln),r=this.get(f),r&&!/Chrom/.test(r)&&/Chrom/.test(o)||this.set(f,o).set(h,i).set(Se,ht(i)),r=o),this.itemType==W&&o==Ut&&this.set(h,i)}break;case Y:var s=e[U];s&&(s&&e[ze]=="64"&&(s+="64"),pt.call(this.data,s+";",t));break;case j:if(e[E]&&this.set(c,E),e[u]&&(this.set(u,e[u]),!this.get(c)||!this.get(g))){var d={};pt.call(d,"droid 9; "+e[u]+")",t),!this.get(c)&&d.type&&this.set(c,d.type),!this.get(g)&&d.vendor&&this.set(g,d.vendor)}if(e[le]){var p;if(typeof e[le]!="string")for(var l=0;!p&&l<e[le].length;)p=q(e[le][l++],Pt);else p=q(e[le],Pt);this.set(c,p)}break;case H:var m=e[he];if(m){var y=e[rt];m==ut&&(y=parseInt(ht(y),10)>=13?"11":"10"),this.set(f,m).set(h,y)}this.get(f)==ut&&e[u]=="Xbox"&&this.set(f,"Xbox").set(h,void 0);break;case fe:var S=this.data,C=function(b){return S[b].getItem().setCH(e).parseCH().get()};this.set(z,C(z)).set(Y,C(Y)).set(j,C(j)).set(W,C(W)).set(H,C(H))}return this};function Q(e,t,n){if(typeof e===_.OBJECT?(We(e,!0)?(typeof t===_.OBJECT&&(n=t),t=e):(n=e,t=void 0),e=void 0):typeof e===_.STRING&&!We(t,!0)&&(n=t,t=void 0),n)if(typeof n.append===_.FUNCTION){var r={};n.forEach(function(l,m){r[String(m).toLowerCase()]=l}),n=r}else{var a={};for(var o in n)n.hasOwnProperty(o)&&(a[String(o).toLowerCase()]=n[o]);n=a}if(!(this instanceof Q))return new Q(e,t,n).getResult();var i=typeof e===_.STRING?e:n&&n[kt]?n[kt]:B&&B.userAgent?B.userAgent:ue,s=new $t(n,!0),d=t?Fn(Ht,t):Ht,p=function(l){return l==fe?function(){return new ie(l,i,d,s).set("ua",i).set(z,this.getBrowser()).set(Y,this.getCPU()).set(j,this.getDevice()).set(W,this.getEngine()).set(H,this.getOS()).get()}:function(){return new ie(l,i,d[l],s).parseUA().get()}};return J.call(this,[["getBrowser",p(z)],["getCPU",p(Y)],["getDevice",p(j)],["getEngine",p(W)],["getOS",p(H)],["getResult",p(fe)],["getUA",function(){return i}],["setUA",function(l){return Ne(l)&&(i=qe(l,En)),this}]]).setUA(i),this}Q.VERSION=kn,Q.BROWSER=$e([f,h,Se,c]),Q.CPU=$e([U]),Q.DEVICE=$e([u,g,c,Le,E,D,N,G,Ce]),Q.ENGINE=Q.OS=$e([f,h]);const zn=()=>{const t=new Q().getResult();return{os:t.os.name||"unknown",osVersion:t.os.version||"unknown",browser:t.browser.name||"unknown",browserVersion:t.browser.version||"unknown",deviceType:t.device.type||"desktop"}};function Bn(){const e=navigator.userAgent.toLowerCase(),t=/iphone|ipod|android.*mobile/.test(e),n=/ipad|android(?!.*mobile)/.test(e),a=(navigator.deviceMemory||4)<4;return t?{maxCanvasSize:4096,recommendedScale:a?.8:1,recommendedQuality:a?.7:.8,chunkSize:30,yieldInterval:16,maxTimeout:5e3}:n?{maxCanvasSize:8192,recommendedScale:1,recommendedQuality:.85,chunkSize:50,yieldInterval:16,maxTimeout:4e3}:{maxCanvasSize:16384,recommendedScale:1,recommendedQuality:.9,chunkSize:100,yieldInterval:8,maxTimeout:3e3}}function Pn(){return{objectUrls:[],tempCanvases:[]}}function Hn(e){e.objectUrls.forEach(t=>{try{URL.revokeObjectURL(t)}catch{console.warn("[Screenshot] Failed to revoke URL:",t)}}),e.tempCanvases.forEach(t=>{const n=t.getContext("2d");n&&n.clearRect(0,0,t.width,t.height),t.width=0,t.height=0}),e.objectUrls.length=0,e.tempCanvases.length=0}function $n(e,t){const n=e?e.x:0,r=e?e.y:0,a=e?e.width:window.innerWidth,o=e?e.height:window.innerHeight;return{left:n-t,top:r-t,right:n+a+t,bottom:r+o+t}}function Wn(e,t){const n=e.getBoundingClientRect();return!(n.bottom<t.top||n.top>t.bottom||n.right<t.left||n.left>t.right||n.width===0||n.height===0)}function qn(e){return Array.from(document.body.getElementsByTagName("*")).filter(n=>{if(!(n instanceof HTMLElement))return!1;const r=n.tagName;return["SCRIPT","STYLE","LINK","IFRAME","NOSCRIPT"].includes(r)?!1:r==="HTML"||r==="BODY"?!0:Wn(n,e)})}function Vn(e){const t=e.getElementsByTagName("*"),n=e.getElementsByTagName("img"),r=e.getElementsByTagName("svg"),a=t.length,o=n.length,i=r.length,s=a>1e3||o>50||i>10;return{nodeCount:a,imageCount:o,svgCount:i,isComplex:s}}function Re(){return new Promise(e=>{"scheduler"in window&&"yield"in window.scheduler?window.scheduler.yield().then(e):setTimeout(e,0)})}function Rn(e,t,n){return new Promise((r,a)=>{const o=setTimeout(()=>{a(new Error("Image load timeout"))},n);e.onload=()=>{clearTimeout(o),r()},e.onerror=()=>{clearTimeout(o),a(new Error("Image load error"))},e.src=t})}async function jn(e,t){const n=e.getBoundingClientRect(),r=window.getComputedStyle(e),a=n.left,o=n.top,i=n.width,s=n.height,d=r.backgroundColor;d&&d!=="transparent"&&d!=="rgba(0, 0, 0, 0)"&&(t.fillStyle=d,t.fillRect(a,o,i,s));const p=parseFloat(r.borderWidth)||0;if(p>0){const l=r.borderColor;l&&l!=="transparent"&&(t.strokeStyle=l,t.lineWidth=p,t.strokeRect(a,o,i,s))}}async function Gn(e,t){for(const n of e)n instanceof HTMLElement&&await jn(n,t)}async function Xn(e,t,n,r,a,o){try{const i=new Image;return i.crossOrigin="anonymous",await Rn(i,e.src,3e3),t.drawImage(i,n,r,a,o),{success:!0,method:"canvas"}}catch(i){return{success:!1,error:i instanceof Error?i.message:"Canvas render failed"}}}function Yn(e,t,n,r,a){return e.fillStyle="#f0f0f0",e.fillRect(t,n,r,a),e.strokeStyle="#ccc",e.lineWidth=1,e.strokeRect(t,n,r,a),e.fillStyle="#999",e.font="12px sans-serif",e.textAlign="center",e.textBaseline="middle",e.fillText("Image",t+r/2,n+a/2),{success:!0,method:"placeholder"}}function Jn(e,t){return e<5||t<5}async function Qn(e,t){const n=e.getBoundingClientRect(),r=n.left,a=n.top,o=n.width,i=n.height;if(Jn(o,i))return{success:!0,method:"skip"};const s=await Xn(e,t,r,a,o,i);return s.success?s:Yn(t,r,a,o,i)}async function Kn(e,t,n){for(let r=0;r<e.length;r++)await Qn(e[r],t),n&&n(r+1,e.length)}function Zn(e){const t=[];for(const n of e)n instanceof HTMLImageElement&&n.src&&t.push(n);return t}function er(e){let n=new XMLSerializer().serializeToString(e);return n.includes("xmlns=")||(n=n.replace("<svg",'<svg xmlns="http://www.w3.org/2000/svg"')),n}async function tr(e,t){try{const n=e.getBoundingClientRect(),r=n.left,a=n.top,o=n.width,i=n.height;if(o<1||i<1)return{success:!0};const s=er(e),d=new Blob([s],{type:"image/svg+xml;charset=utf-8"}),p=URL.createObjectURL(d);try{const l=new Image;return await new Promise((m,y)=>{l.onload=()=>m(),l.onerror=()=>y(new Error("SVG image load failed")),l.src=p}),t.drawImage(l,r,a,o,i),{success:!0}}finally{URL.revokeObjectURL(p)}}catch(n){return{success:!1,error:n instanceof Error?n.message:"SVG render failed"}}}async function nr(e,t,n){for(let r=0;r<e.length;r++)await tr(e[r],t),n&&n(r+1,e.length)}function rr(e){return e.classList.contains("MathJax")||e.classList.contains("MathJax_Display")||e.classList.contains("MJX-TeXAtom-ORD")||e.hasAttribute("data-mathml")}function ir(e){const t=[];for(const n of e)n instanceof SVGElement&&t.push(n);return t}function or(e){return e.filter(t=>rr(t))}async function sr(e,t){try{const n=e.getBoundingClientRect(),r=n.left,a=n.top,o=n.width,i=n.height;if(o<1||i<1)return{success:!0};const s=window.getComputedStyle(e),d=e.cloneNode(!0),p=["color","font-family","font-size","font-weight","font-style","line-height","text-align","text-decoration","text-transform","letter-spacing","word-spacing","white-space","padding","margin","display","flex-direction","align-items","justify-content"];let l="";p.forEach(C=>{const b=s.getPropertyValue(C);b&&(l+=`${C}: ${b}; `)}),d.setAttribute("style",l);const m=`
1
+ (function(j,w){typeof exports=="object"&&typeof module<"u"?w(exports,require("react/jsx-runtime"),require("react")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react"],w):(j=typeof globalThis<"u"?globalThis:j||self,w(j.SupportFeedbackLib={},j.jsxRuntime,j.React))})(this,(function(j,w,A){"use strict";var An="2.0.7",Nn=500,kt="user-agent",fe="",Et="?",_={FUNCTION:"function",OBJECT:"object",STRING:"string",UNDEFINED:"undefined"},H="browser",K="cpu",Y="device",G="engine",W="os",ge="result",f="name",c="type",g="vendor",p="version",B="architecture",ke="major",u="model",ze="console",I="mobile",N="tablet",D="smarttv",J="wearable",Be="xr",Ee="embedded",he="inapp",tt="brands",le="formFactors",nt="fullVersionList",pe="platform",rt="platformVersion",Pe="bitness",ne="sec-ch-ua",Mn=ne+"-full-version-list",On=ne+"-arch",_n=ne+"-"+Pe,Dn=ne+"-form-factors",Fn=ne+"-"+I,Ln=ne+"-"+u,Tt=ne+"-"+pe,Un=Tt+"-version",It=[tt,nt,I,u,pe,rt,B,le,Pe],He="Amazon",we="Apple",At="ASUS",Nt="BlackBerry",ce="Google",Mt="Huawei",it="Lenovo",Ot="Honor",Ve="LG",ot="Microsoft",st="Motorola",_t="Nvidia",Dt="OnePlus",at="OPPO",Te="Samsung",Ft="Sharp",Ie="Sony",lt="Xiaomi",ct="Zebra",Lt="Chrome",Ut="Chromium",re="Chromecast",$e="Edge",Ae="Firefox",Ne="Opera",dt="Facebook",zt="Sogou",me="Mobile ",Me=" Browser",ut="Windows",zn=typeof window!==_.UNDEFINED,V=zn&&window.navigator?window.navigator:void 0,de=V&&V.userAgentData?V.userAgentData:void 0,Bn=function(e,n){var t={},r=n;if(!qe(n)){r={};for(var s in n)for(var o in n[s])r[o]=n[s][o].concat(r[o]?r[o]:[])}for(var i in e)t[i]=r[i]&&r[i].length%2===0?r[i].concat(e[i]):e[i];return t},We=function(e){for(var n={},t=0;t<e.length;t++)n[e[t].toUpperCase()]=e[t];return n},ft=function(e,n){if(typeof e===_.OBJECT&&e.length>0){for(var t in e)if(ie(n)==ie(e[t]))return!0;return!1}return Oe(e)?ie(n)==ie(e):!1},qe=function(e,n){for(var t in e)return/^(browser|cpu|device|engine|os)$/.test(t)||(n?qe(e[t]):!1)},Oe=function(e){return typeof e===_.STRING},gt=function(e){if(e){for(var n=[],t=be(/\\?\"/g,e).split(","),r=0;r<t.length;r++)if(t[r].indexOf(";")>-1){var s=Re(t[r]).split(";v=");n[r]={brand:s[0],version:s[1]}}else n[r]=Re(t[r]);return n}},ie=function(e){return Oe(e)?e.toLowerCase():e},ht=function(e){return Oe(e)?be(/[^\d\.]/g,e).split(".")[0]:void 0},Z=function(e){for(var n in e)if(e.hasOwnProperty(n)){var t=e[n];typeof t==_.OBJECT&&t.length==2?this[t[0]]=t[1]:this[t]=void 0}return this},be=function(e,n){return Oe(n)?n.replace(e,fe):n},_e=function(e){return be(/\\?\"/g,e)},Re=function(e,n){return e=be(/^\s\s*/,String(e)),typeof n===_.UNDEFINED?e:e.substring(0,n)},pt=function(e,n){if(!(!e||!n))for(var t=0,r,s,o,i,a,d;t<n.length&&!a;){var h=n[t],l=n[t+1];for(r=s=0;r<h.length&&!a&&h[r];)if(a=h[r++].exec(e),a)for(o=0;o<l.length;o++)d=a[++s],i=l[o],typeof i===_.OBJECT&&i.length>0?i.length===2?typeof i[1]==_.FUNCTION?this[i[0]]=i[1].call(this,d):this[i[0]]=i[1]:i.length>=3&&(typeof i[1]===_.FUNCTION&&!(i[1].exec&&i[1].test)?i.length>3?this[i[0]]=d?i[1].apply(this,i.slice(2)):void 0:this[i[0]]=d?i[1].call(this,d,i[2]):void 0:i.length==3?this[i[0]]=d?d.replace(i[1],i[2]):void 0:i.length==4?this[i[0]]=d?i[3].call(this,d.replace(i[1],i[2])):void 0:i.length>4&&(this[i[0]]=d?i[3].apply(this,[d.replace(i[1],i[2])].concat(i.slice(4))):void 0)):this[i]=d||void 0;t+=2}},X=function(e,n){for(var t in n)if(typeof n[t]===_.OBJECT&&n[t].length>0){for(var r=0;r<n[t].length;r++)if(ft(n[t][r],e))return t===Et?void 0:t}else if(ft(n[t],e))return t===Et?void 0:t;return n.hasOwnProperty("*")?n["*"]:e},Bt={ME:"4.90","NT 3.51":"3.51","NT 4.0":"4.0",2e3:["5.0","5.01"],XP:["5.1","5.2"],Vista:"6.0",7:"6.1",8:"6.2","8.1":"6.3",10:["6.4","10.0"],NT:""},Pt={embedded:"Automotive",mobile:"Mobile",tablet:["Tablet","EInk"],smarttv:"TV",wearable:"Watch",xr:["VR","XR"],"?":["Desktop","Unknown"],"*":void 0},Pn={Chrome:"Google Chrome",Edge:"Microsoft Edge","Edge WebView2":"Microsoft Edge WebView2","Chrome WebView":"Android WebView","Chrome Headless":"HeadlessChrome","Huawei Browser":"HuaweiBrowser","MIUI Browser":"Miui Browser","Opera Mobi":"OperaMobile",Yandex:"YaBrowser"},Ht={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[p,[f,me+"Chrome"]],[/webview.+edge\/([\w\.]+)/i],[p,[f,$e+" WebView"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[p,[f,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[f,p],[/opios[\/ ]+([\w\.]+)/i],[p,[f,Ne+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[p,[f,Ne+" GX"]],[/\bopr\/([\w\.]+)/i],[p,[f,Ne]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[p,[f,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[p,[f,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(atlas|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon|otter|dooble|(?:lg |qute)browser|palemoon)\/([-\w\.]+)/i,/(heytap|ovi|115|surf|qwant)browser\/([\d\.]+)/i,/(qwant)(?:ios|mobile)\/([\d\.]+)/i,/(ecosia|weibo)(?:__| \w+@)([\d\.]+)/i],[f,p],[/quark(?:pc)?\/([-\w\.]+)/i],[p,[f,"Quark"]],[/\bddg\/([\w\.]+)/i],[p,[f,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[p,[f,"UCBrowser"]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[p,[f,"WeChat"]],[/konqueror\/([\w\.]+)/i],[p,[f,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[p,[f,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[p,[f,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[p,[f,"Smart "+it+Me]],[/(avast|avg)\/([\w\.]+)/i],[[f,/(.+)/,"$1 Secure"+Me],p],[/\bfocus\/([\w\.]+)/i],[p,[f,Ae+" Focus"]],[/\bopt\/([\w\.]+)/i],[p,[f,Ne+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[p,[f,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[p,[f,"Dolphin"]],[/coast\/([\w\.]+)/i],[p,[f,Ne+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[p,[f,"MIUI"+Me]],[/fxios\/([\w\.-]+)/i],[p,[f,me+Ae]],[/\bqihoobrowser\/?([\w\.]*)/i],[p,[f,"360"]],[/\b(qq)\/([\w\.]+)/i],[[f,/(.+)/,"$1Browser"],p],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[f,/(.+)/,"$1"+Me],p],[/samsungbrowser\/([\w\.]+)/i],[p,[f,Te+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[p,[f,zt+" Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[f,zt+" Mobile"],p],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[f,p],[/(lbbrowser|rekonq|steam(?= (clie|tenf|gameo)))/i],[f],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[p,f],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[f,dt],p,[c,he]],[/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/(daum)apps[\/ ]([\w\.]+)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(bing)(?:web|sapphire)\/([\w\.]+)/i,/(instagram|snapchat|klarna)[\/ ]([-\w\.]+)/i],[f,p,[c,he]],[/\bgsa\/([\w\.]+) .*safari\//i],[p,[f,"GSA"],[c,he]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[p,[f,"TikTok"],[c,he]],[/\[(linkedin)app\]/i],[f,[c,he]],[/(zalo(?:app)?)[\/\sa-z]*([\w\.-]+)/i],[[f,/(.+)/,"Zalo"],p,[c,he]],[/(chromium)[\/ ]([-\w\.]+)/i],[f,p],[/headlesschrome(?:\/([\w\.]+)| )/i],[p,[f,Lt+" Headless"]],[/wv\).+chrome\/([\w\.]+).+edgw\//i],[p,[f,$e+" WebView2"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[f,Lt+" WebView"],p],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[p,[f,"Android"+Me]],[/chrome\/([\w\.]+) mobile/i],[p,[f,me+"Chrome"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[f,p],[/version\/([\w\.\,]+) .*mobile(?:\/\w+ | ?)safari/i],[p,[f,me+"Safari"]],[/iphone .*mobile(?:\/\w+ | ?)safari/i],[[f,me+"Safari"]],[/version\/([\w\.\,]+) .*(safari)/i],[p,f],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[f,[p,"1"]],[/(webkit|khtml)\/([\w\.]+)/i],[f,p],[/(?:mobile|tablet);.*(firefox)\/([\w\.-]+)/i],[[f,me+Ae],p],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[f,"Netscape"],p],[/(wolvic|librewolf)\/([\w\.]+)/i],[f,p],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[p,[f,Ae+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+(?= .+rv\:.+gecko\/\d+)|[0-4][\w\.]+(?!.+compatible))/i,/(amaya|dillo|doris|icab|ladybird|lynx|mosaic|netsurf|obigo|polaris|w3m|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/\b(links) \(([\w\.]+)/i],[f,[p,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[f,[p,/[^\d\.]+./,fe]]],cpu:[[/\b((amd|x|x86[-_]?|wow|win)64)\b/i],[[B,"amd64"]],[/(ia32(?=;))/i,/\b((i[346]|x)86)(pc)?\b/i],[[B,"ia32"]],[/\b(aarch64|arm(v?[89]e?l?|_?64))\b/i],[[B,"arm64"]],[/\b(arm(v[67])?ht?n?[fl]p?)\b/i],[[B,"armhf"]],[/( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i],[[B,"arm"]],[/ sun4\w[;\)]/i],[[B,"sparc"]],[/\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i,/((ppc|powerpc)(64)?)( mac|;|\))/i,/(?:osf1|[freopnt]{3,4}bsd) (alpha)/i],[[B,/ower/,fe,ie]],[/mc680.0/i],[[B,"68k"]],[/winnt.+\[axp/i],[[B,"alpha"]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[u,[g,Te],[c,N]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr]|browser)[-\w]+)/i,/sec-(sgh\w+)/i],[u,[g,Te],[c,I]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)[\/\);]/i],[u,[g,we],[c,I]],[/\b(?:ios|apple\w+)\/.+[\(\/](ipad)/i,/\b(ipad)[\d,]*[;\] ].+(mac |i(pad)?)os/i],[u,[g,we],[c,N]],[/(macintosh);/i],[u,[g,we]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[u,[g,Ft],[c,I]],[/\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i],[u,[g,Ot],[c,N]],[/honor([-\w ]+)[;\)]/i],[u,[g,Ot],[c,I]],[/\b((?:ag[rs][2356]?k?|bah[234]?|bg[2o]|bt[kv]|cmr|cpn|db[ry]2?|jdn2|got|kob2?k?|mon|pce|scm|sht?|[tw]gr|vrd)-[ad]?[lw][0125][09]b?|605hw|bg2-u03|(?:gem|fdr|m2|ple|t1)-[7a]0[1-4][lu]|t1-a2[13][lw]|mediapad[\w\. ]*(?= bui|\)))\b(?!.+d\/s)/i],[u,[g,Mt],[c,N]],[/(?:huawei) ?([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][\dc][adnt]?)\b(?!.+d\/s)/i],[u,[g,Mt],[c,I]],[/oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i,/\b(?:xiao)?((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i],[[u,/_/g," "],[g,lt],[c,N]],[/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/oid[^\)]+; (redmi[\-_ ]?(?:note|k)?[\w_ ]+|m?[12]\d[01]\d\w{3,6}|poco[\w ]+|(shark )?\w{3}-[ah]0|qin ?[1-3](s\+|ultra| pro)?)( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note|max|cc)?[_ ]?(?:\d{0,2}\w?)[_ ]?(?:plus|se|lite|pro)?( 5g|lte)?)(?: bui|\))/i,/ ([\w ]+) miui\/v?\d/i],[[u,/_/g," "],[g,lt],[c,I]],[/droid.+; (cph2[3-6]\d[13579]|((gm|hd)19|(ac|be|in|kb)20|(d[en]|eb|le|mt)21|ne22)[0-2]\d|p[g-k]\w[1m]10)\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[u,[g,Dt],[c,I]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[u,[g,at],[c,I]],[/\b(opd2(\d{3}a?))(?: bui|\))/i],[u,[g,X,{OnePlus:["203","304","403","404","413","415"],"*":at}],[c,N]],[/(vivo (5r?|6|8l?|go|one|s|x[il]?[2-4]?)[\w\+ ]*)(?: bui|\))/i],[u,[g,"BLU"],[c,I]],[/; vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[u,[g,"Vivo"],[c,I]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[u,[g,"Realme"],[c,I]],[/(ideatab[-\w ]+|602lv|d-42a|a101lv|a2109a|a3500-hv|s[56]000|pb-6505[my]|tb-?x?\d{3,4}(?:f[cu]|xu|[av])|yt\d?-[jx]?\d+[lfmx])( bui|;|\)|\/)/i,/lenovo ?(b[68]0[08]0-?[hf]?|tab(?:[\w- ]+?)|tb[\w-]{6,7})( bui|;|\)|\/)/i],[u,[g,it],[c,N]],[/lenovo[-_ ]?([-\w ]+?)(?: bui|\)|\/)/i],[u,[g,it],[c,I]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ]([\w\s]+)(\)| bui)/i,/((?:moto(?! 360)[-\w\(\) ]+|xt\d{3,4}[cgkosw\+]?[-\d]*|nexus 6)(?= bui|\)))/i],[u,[g,st],[c,I]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[u,[g,st],[c,N]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[u,[g,Ve],[c,N]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+(?!.*(?:browser|netcast|android tv|watch|webos))(\w+)/i,/\blg-?([\d\w]+) bui/i],[u,[g,Ve],[c,I]],[/(nokia) (t[12][01])/i],[g,u,[c,N]],[/(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i,/nokia[-_ ]?(([-\w\. ]*?))( bui|\)|;|\/)/i],[[u,/_/g," "],[c,I],[g,"Nokia"]],[/(pixel (c|tablet))\b/i],[u,[g,ce],[c,N]],[/droid.+;(?: google)? (g(01[13]a|020[aem]|025[jn]|1b60|1f8f|2ybb|4s1m|576d|5nz6|8hhn|8vou|a02099|c15s|d1yq|e2ae|ec77|gh2x|kv4x|p4bc|pj41|r83y|tt9q|ur25|wvk6)|pixel[\d ]*a?( pro)?( xl)?( fold)?( \(5g\))?)( bui|\))/i],[u,[g,ce],[c,I]],[/(google) (pixelbook( go)?)/i],[g,u],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-\w\w\d\d)(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[u,[g,Ie],[c,I]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[u,"Xperia Tablet"],[g,Ie],[c,N]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[u,[g,He],[c,N]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[u,/(.+)/g,"Fire Phone $1"],[g,He],[c,I]],[/(playbook);[-\w\),; ]+(rim)/i],[u,g,[c,N]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/(?:blackberry|\(bb10;) (\w+)/i],[u,[g,Nt],[c,I]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[u,[g,At],[c,N]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[u,[g,At],[c,I]],[/(nexus 9)/i],[u,[g,"HTC"],[c,N]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[g,[u,/_/g," "],[c,I]],[/tcl (xess p17aa)/i,/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])(_\w(\w|\w\w))?(\)| bui)/i],[u,[g,"TCL"],[c,N]],[/droid [\w\.]+; (418(?:7d|8v)|5087z|5102l|61(?:02[dh]|25[adfh]|27[ai]|56[dh]|59k|65[ah])|a509dl|t(?:43(?:0w|1[adepqu])|50(?:6d|7[adju])|6(?:09dl|10k|12b|71[efho]|76[hjk])|7(?:66[ahju]|67[hw]|7[045][bh]|71[hk]|73o|76[ho]|79w|81[hks]?|82h|90[bhsy]|99b)|810[hs]))(_\w(\w|\w\w))?(\)| bui)/i],[u,[g,"TCL"],[c,I]],[/(itel) ((\w+))/i],[[g,ie],u,[c,X,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[u,[g,"Acer"],[c,N]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[u,[g,"Meizu"],[c,I]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[u,[g,"Ulefone"],[c,I]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[u,[g,"Energizer"],[c,I]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[u,[g,"Cat"],[c,I]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[u,[g,"Smartfren"],[c,I]],[/droid.+; (a(in)?(0(15|59|6[35])|142)p?)/i],[u,[g,"Nothing"],[c,I]],[/; (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i,/archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i],[u,[g,"Archos"],[c,N]],[/archos ([\w ]+)( b|\))/i,/; (ac[3-6]\d\w{2,8})( b|\))/i],[u,[g,"Archos"],[c,I]],[/; (n159v)/i],[u,[g,"HMD"],[c,I]],[/(imo) (tab \w+)/i,/(infinix|tecno) (x1101b?|p904|dp(7c|8d|10a)( pro)?|p70[1-3]a?|p904|t1101)/i],[g,u,[c,N]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus(?! zenw)|dell|jolla|meizu|motorola|polytron|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (blu|hmd|imo|infinix|lava|oneplus|tcl|wiko)[_ ]([\w\+ ]+?)(?: bui|\)|; r)/i,/(hp) ([\w ]+\w)/i,/(microsoft); (lumia[\w ]+)/i,/(oppo) ?([\w ]+) bui/i,/(hisense) ([ehv][\w ]+)\)/i,/droid[^;]+; (philips)[_ ]([sv-x][\d]{3,4}[xz]?)/i],[g,u,[c,I]],[/(kobo)\s(ereader|touch)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i],[g,u,[c,N]],[/(surface duo)/i],[u,[g,ot],[c,N]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[u,[g,"Fairphone"],[c,I]],[/((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i],[u,[g,_t],[c,N]],[/(sprint) (\w+)/i],[g,u,[c,I]],[/(kin\.[onetw]{3})/i],[[u,/\./g," "],[g,ot],[c,I]],[/droid.+; ([c6]+|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[u,[g,ct],[c,N]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[u,[g,ct],[c,I]],[/(philips)[\w ]+tv/i,/smart-tv.+(samsung)/i],[g,[c,D]],[/hbbtv.+maple;(\d+)/i],[[u,/^/,"SmartTV"],[g,Te],[c,D]],[/(vizio)(?: |.+model\/)(\w+-\w+)/i,/tcast.+(lg)e?. ([-\w]+)/i],[g,u,[c,D]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[g,Ve],[c,D]],[/(apple) ?tv/i],[g,[u,we+" TV"],[c,D]],[/crkey.*devicetype\/chromecast/i],[[u,re+" Third Generation"],[g,ce],[c,D]],[/crkey.*devicetype\/([^/]*)/i],[[u,/^/,"Chromecast "],[g,ce],[c,D]],[/fuchsia.*crkey/i],[[u,re+" Nest Hub"],[g,ce],[c,D]],[/crkey/i],[[u,re],[g,ce],[c,D]],[/(portaltv)/i],[u,[g,dt],[c,D]],[/droid.+aft(\w+)( bui|\))/i],[u,[g,He],[c,D]],[/(shield \w+ tv)/i],[u,[g,_t],[c,D]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[u,[g,Ft],[c,D]],[/(bravia[\w ]+)( bui|\))/i],[u,[g,Ie],[c,D]],[/(mi(tv|box)-?\w+) bui/i],[u,[g,lt],[c,D]],[/Hbbtv.*(technisat) (.*);/i],[g,u,[c,D]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[g,/.+\/(\w+)/,"$1",X,{LG:"lge"}],[u,Re],[c,D]],[/(playstation \w+)/i],[u,[g,Ie],[c,ze]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[u,[g,ot],[c,ze]],[/(ouya)/i,/(nintendo) (\w+)/i,/(retroid) (pocket ([^\)]+))/i,/(valve).+(steam deck)/i,/droid.+; ((shield|rgcube|gr0006))( bui|\))/i],[[g,X,{Nvidia:"Shield",Anbernic:"RGCUBE",Logitech:"GR0006"}],u,[c,ze]],[/\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i],[u,[g,Te],[c,J]],[/((pebble))app/i,/(asus|google|lg|oppo|xiaomi) ((pixel |zen)?watch[\w ]*)( bui|\))/i],[g,u,[c,J]],[/(ow(?:19|20)?we?[1-3]{1,3})/i],[u,[g,at],[c,J]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[u,[g,we],[c,J]],[/(opwwe\d{3})/i],[u,[g,Dt],[c,J]],[/(moto 360)/i],[u,[g,st],[c,J]],[/(smartwatch 3)/i],[u,[g,Ie],[c,J]],[/(g watch r)/i],[u,[g,Ve],[c,J]],[/droid.+; (wt63?0{2,3})\)/i],[u,[g,ct],[c,J]],[/droid.+; (glass) \d/i],[u,[g,ce],[c,Be]],[/(pico) ([\w ]+) os\d/i],[g,u,[c,Be]],[/(quest( \d| pro)?s?).+vr/i],[u,[g,dt],[c,Be]],[/mobile vr; rv.+firefox/i],[[c,Be]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[g,[c,Ee]],[/(aeobc)\b/i],[u,[g,He],[c,Ee]],[/(homepod).+mac os/i],[u,[g,we],[c,Ee]],[/windows iot/i],[[c,Ee]],[/droid.+; ([\w- ]+) (4k|android|smart|google)[- ]?tv/i],[u,[c,D]],[/\b((4k|android|smart|opera)[- ]?tv|tv; rv:|large screen[\w ]+safari)\b/i],[[c,D]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew|; hmsc).+?(mobile|vr|\d) safari/i],[u,[c,X,{mobile:"Mobile",xr:"VR","*":N}]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[c,N]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[c,I]],[/droid .+?; ([\w\. -]+)( bui|\))/i],[u,[g,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[p,[f,$e+"HTML"]],[/(arkweb)\/([\w\.]+)/i],[f,p],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[p,[f,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[f,p],[/ladybird\//i],[[f,"LibWeb"]],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[p,f]],os:[[/(windows nt) (6\.[23]); arm/i],[[f,/N/,"R"],[p,X,Bt]],[/(windows (?:phone|mobile|iot))(?: os)?[\/ ]?([\d\.]*( se)?)/i,/(windows)[\/ ](1[01]|2000|3\.1|7|8(\.1)?|9[58]|me|server 20\d\d( r2)?|vista|xp)/i],[f,p],[/windows nt ?([\d\.\)]*)(?!.+xbox)/i,/\bwin(?=3| ?9|n)(?:nt| 9x )?([\d\.;]*)/i],[[p,/(;|\))/g,"",X,Bt],[f,ut]],[/(windows ce)\/?([\d\.]*)/i],[f,p],[/[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv|ios(?=.+ip(?:ad|hone)|.+apple ?tv)|ip(?:ad|hone)(?: |.+i(?:pad)?)os|apple ?tv.+ios)[\/ ]([\w\.]+)/i,/\btvos ?([\w\.]+)/i,/cfnetwork\/.+darwin/i],[[p,/_/g,"."],[f,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+(haiku|morphos))/i],[[f,"macOS"],[p,/_/g,"."]],[/android ([\d\.]+).*crkey/i],[p,[f,re+" Android"]],[/fuchsia.*crkey\/([\d\.]+)/i],[p,[f,re+" Fuchsia"]],[/crkey\/([\d\.]+).*devicetype\/smartspeaker/i],[p,[f,re+" SmartSpeaker"]],[/linux.*crkey\/([\d\.]+)/i],[p,[f,re+" Linux"]],[/crkey\/([\d\.]+)/i],[p,[f,re]],[/droid ([\w\.]+)\b.+(android[- ]x86)/i],[p,f],[/(ubuntu) ([\w\.]+) like android/i],[[f,/(.+)/,"$1 Touch"],p],[/(harmonyos)[\/ ]?([\d\.]*)/i,/(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen)\w*[-\/\.; ]?([\d\.]*)/i],[f,p],[/\(bb(10);/i],[p,[f,Nt]],[/(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i],[p,[f,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[p,[f,Ae+" OS"]],[/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i,/webos(?:[ \/]?|\.tv-20(?=2[2-9]))(\d[\d\.]*)/i],[p,[f,"webOS"]],[/web0s;.+?(?:chr[o0]me|safari)\/(\d+)/i],[[p,X,{25:"120",24:"108",23:"94",22:"87",6:"79",5:"68",4:"53",3:"38",2:"538",1:"537","*":"TV"}],[f,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[p,[f,"watchOS"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[f,"Chrome OS"],p],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) (\w+)/i,/(xbox); +xbox ([^\);]+)/i,/(pico) .+os([\w\.]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/linux.+(mint)[\/\(\) ]?([\w\.]*)/i,/(mageia|vectorlinux|fuchsia|arcaos|arch(?= ?linux))[;l ]([\d\.]*)/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire|knoppix)(?: gnu[\/ ]linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/\b(aix)[; ]([1-9\.]{0,4})/i,/(hurd|linux|morphos)(?: (?:arm|x86|ppc)\w*| ?)([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) ?(r\d)?/i],[f,p],[/(sunos) ?([\d\.]*)/i],[[f,"Solaris"],p],[/\b(beos|os\/2|amigaos|openvms|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[f,p]]},je=(function(){var e={init:{},isIgnore:{},isIgnoreRgx:{},toString:{}};return Z.call(e.init,[[H,[f,p,ke,c]],[K,[B]],[Y,[c,u,g]],[G,[f,p]],[W,[f,p]]]),Z.call(e.isIgnore,[[H,[p,ke]],[G,[p]],[W,[p]]]),Z.call(e.isIgnoreRgx,[[H,/ ?browser$/i],[W,/ ?os$/i]]),Z.call(e.toString,[[H,[f,p]],[K,[B]],[Y,[g,u]],[G,[f,p]],[W,[f,p]]]),e})(),Hn=function(e,n){var t=je.init[n],r=je.isIgnore[n]||0,s=je.isIgnoreRgx[n]||0,o=je.toString[n]||0;function i(){Z.call(this,t)}return i.prototype.getItem=function(){return e},i.prototype.withClientHints=function(){return de?de.getHighEntropyValues(It).then(function(a){return e.setCH(new Vt(a,!1)).parseCH().get()}):e.parseCH().get()},i.prototype.withFeatureCheck=function(){return e.detectFeature().get()},n!=ge&&(i.prototype.is=function(a){var d=!1;for(var h in this)if(this.hasOwnProperty(h)&&!ft(r,h)&&ie(s?be(s,this[h]):this[h])==ie(s?be(s,a):a)){if(d=!0,a!=_.UNDEFINED)break}else if(a==_.UNDEFINED&&d){d=!d;break}return d},i.prototype.toString=function(){var a=fe;for(var d in o)typeof this[o[d]]!==_.UNDEFINED&&(a+=(a?" ":fe)+this[o[d]]);return a||_.UNDEFINED}),i.prototype.then=function(a){var d=this,h=function(){for(var m in d)d.hasOwnProperty(m)&&(this[m]=d[m])};h.prototype={is:i.prototype.is,toString:i.prototype.toString,withClientHints:i.prototype.withClientHints,withFeatureCheck:i.prototype.withFeatureCheck};var l=new h;return a(l),l},new i};function Vt(e,n){if(e=e||{},Z.call(this,It),n)Z.call(this,[[tt,gt(e[ne])],[nt,gt(e[Mn])],[I,/\?1/.test(e[Fn])],[u,_e(e[Ln])],[pe,_e(e[Tt])],[rt,_e(e[Un])],[B,_e(e[On])],[le,gt(e[Dn])],[Pe,_e(e[_n])]]);else for(var t in e)this.hasOwnProperty(t)&&typeof e[t]!==_.UNDEFINED&&(this[t]=e[t])}function oe(e,n,t,r){return Z.call(this,[["itemType",e],["ua",n],["uaCH",r],["rgxMap",t],["data",Hn(this,e)]]),this}oe.prototype.get=function(e){return e?this.data.hasOwnProperty(e)?this.data[e]:void 0:this.data},oe.prototype.set=function(e,n){return this.data[e]=n,this},oe.prototype.setCH=function(e){return this.uaCH=e,this},oe.prototype.detectFeature=function(){if(V&&V.userAgent==this.ua)switch(this.itemType){case H:V.brave&&typeof V.brave.isBrave==_.FUNCTION&&this.set(f,"Brave");break;case Y:!this.get(c)&&de&&de[I]&&this.set(c,I),this.get(u)=="Macintosh"&&V&&typeof V.standalone!==_.UNDEFINED&&V.maxTouchPoints&&V.maxTouchPoints>2&&this.set(u,"iPad").set(c,N);break;case W:!this.get(f)&&de&&de[pe]&&this.set(f,de[pe]);break;case ge:var e=this.data,n=function(t){return e[t].getItem().detectFeature().get()};this.set(H,n(H)).set(K,n(K)).set(Y,n(Y)).set(G,n(G)).set(W,n(W))}return this},oe.prototype.parseUA=function(){switch(this.itemType!=ge&&pt.call(this.data,this.ua,this.rgxMap),this.itemType){case H:this.set(ke,ht(this.get(p)));break;case W:if(this.get(f)=="iOS"&&this.get(p)=="18.6"){var e=/\) Version\/([\d\.]+)/.exec(this.ua);e&&parseInt(e[1].substring(0,2),10)>=26&&this.set(p,e[1])}break}return this},oe.prototype.parseCH=function(){var e=this.uaCH,n=this.rgxMap;switch(this.itemType){case H:case G:var t=e[nt]||e[tt],r;if(t)for(var s=0;s<t.length;s++){var o=t[s].brand||t[s],i=t[s].version;this.itemType==H&&!/not.a.brand/i.test(o)&&(!r||/Chrom/.test(r)&&o!=Ut||r==$e&&/WebView2/.test(o))&&(o=X(o,Pn),r=this.get(f),r&&!/Chrom/.test(r)&&/Chrom/.test(o)||this.set(f,o).set(p,i).set(ke,ht(i)),r=o),this.itemType==G&&o==Ut&&this.set(p,i)}break;case K:var a=e[B];a&&(a&&e[Pe]=="64"&&(a+="64"),pt.call(this.data,a+";",n));break;case Y:if(e[I]&&this.set(c,I),e[u]&&(this.set(u,e[u]),!this.get(c)||!this.get(g))){var d={};pt.call(d,"droid 9; "+e[u]+")",n),!this.get(c)&&d.type&&this.set(c,d.type),!this.get(g)&&d.vendor&&this.set(g,d.vendor)}if(e[le]){var h;if(typeof e[le]!="string")for(var l=0;!h&&l<e[le].length;)h=X(e[le][l++],Pt);else h=X(e[le],Pt);this.set(c,h)}break;case W:var m=e[pe];if(m){var y=e[rt];m==ut&&(y=parseInt(ht(y),10)>=13?"11":"10"),this.set(f,m).set(p,y)}this.get(f)==ut&&e[u]=="Xbox"&&this.set(f,"Xbox").set(p,void 0);break;case ge:var S=this.data,C=function(b){return S[b].getItem().setCH(e).parseCH().get()};this.set(H,C(H)).set(K,C(K)).set(Y,C(Y)).set(G,C(G)).set(W,C(W))}return this};function ee(e,n,t){if(typeof e===_.OBJECT?(qe(e,!0)?(typeof n===_.OBJECT&&(t=n),n=e):(t=e,n=void 0),e=void 0):typeof e===_.STRING&&!qe(n,!0)&&(t=n,n=void 0),t)if(typeof t.append===_.FUNCTION){var r={};t.forEach(function(l,m){r[String(m).toLowerCase()]=l}),t=r}else{var s={};for(var o in t)t.hasOwnProperty(o)&&(s[String(o).toLowerCase()]=t[o]);t=s}if(!(this instanceof ee))return new ee(e,n,t).getResult();var i=typeof e===_.STRING?e:t&&t[kt]?t[kt]:V&&V.userAgent?V.userAgent:fe,a=new Vt(t,!0),d=n?Bn(Ht,n):Ht,h=function(l){return l==ge?function(){return new oe(l,i,d,a).set("ua",i).set(H,this.getBrowser()).set(K,this.getCPU()).set(Y,this.getDevice()).set(G,this.getEngine()).set(W,this.getOS()).get()}:function(){return new oe(l,i,d[l],a).parseUA().get()}};return Z.call(this,[["getBrowser",h(H)],["getCPU",h(K)],["getDevice",h(Y)],["getEngine",h(G)],["getOS",h(W)],["getResult",h(ge)],["getUA",function(){return i}],["setUA",function(l){return Oe(l)&&(i=Re(l,Nn)),this}]]).setUA(i),this}ee.VERSION=An,ee.BROWSER=We([f,p,ke,c]),ee.CPU=We([B]),ee.DEVICE=We([u,g,c,ze,I,D,N,J,Ee]),ee.ENGINE=ee.OS=We([f,p]);const Vn=()=>{const n=new ee().getResult();return{os:n.os.name||"unknown",osVersion:n.os.version||"unknown",browser:n.browser.name||"unknown",browserVersion:n.browser.version||"unknown",deviceType:n.device.type||"desktop"}};function $n(){const e=navigator.userAgent.toLowerCase(),n=/iphone|ipod|android.*mobile/.test(e),t=/ipad|android(?!.*mobile)/.test(e),s=(navigator.deviceMemory||4)<4;return n?{maxCanvasSize:4096,recommendedScale:s?.8:1,recommendedQuality:s?.7:.8,chunkSize:30,yieldInterval:16,maxTimeout:5e3}:t?{maxCanvasSize:8192,recommendedScale:1,recommendedQuality:.85,chunkSize:50,yieldInterval:16,maxTimeout:4e3}:{maxCanvasSize:16384,recommendedScale:1,recommendedQuality:.9,chunkSize:100,yieldInterval:8,maxTimeout:3e3}}function Wn(){return{objectUrls:[],tempCanvases:[]}}function qn(e){e.objectUrls.forEach(n=>{try{URL.revokeObjectURL(n)}catch{console.warn("[Screenshot] Failed to revoke URL:",n)}}),e.tempCanvases.forEach(n=>{const t=n.getContext("2d");t&&t.clearRect(0,0,n.width,n.height),n.width=0,n.height=0}),e.objectUrls.length=0,e.tempCanvases.length=0}function Rn(e,n,t,r){const s=()=>t!==void 0?t:window.visualViewport?window.visualViewport.width:document.documentElement.clientWidth||window.innerWidth,o=()=>r!==void 0?r:window.visualViewport?window.visualViewport.height:document.documentElement.clientHeight||window.innerHeight,i=e?e.x:0,a=e?e.y:0,d=e?e.width:s(),h=e?e.height:o(),l={left:i-n,top:a-n,right:i+d+n,bottom:a+h+n};return console.log("[ElementCollector] calculateCaptureBounds:",{viewportWidth:t||"auto",viewportHeight:r||"auto",targetWidth:d,targetHeight:h,bounds:l,scroll:{x:window.scrollX,y:window.scrollY}}),l}function jn(e,n){const t=e.getBoundingClientRect(),r=window.scrollX||window.pageXOffset,s=window.scrollY||window.pageYOffset,o={left:n.left-r,top:n.top-s,right:n.right-r,bottom:n.bottom-s};return!(t.bottom<o.top||t.top>o.bottom||t.right<o.left||t.left>o.right||t.width===0||t.height===0)}function Gn(e){const n=Array.from(document.body.getElementsByTagName("*")),t=n.filter(r=>{if(!(r instanceof HTMLElement))return!1;const s=r.tagName;return["SCRIPT","STYLE","LINK","IFRAME","NOSCRIPT"].includes(s)?!1:s==="HTML"||s==="BODY"?!0:jn(r,e)});return console.log("[ElementCollector] collectVisibleElements:",{total:n.length,filtered:t.length,bounds:e,sampleElements:t.slice(0,5).map(r=>({tag:r.tagName,rect:r.getBoundingClientRect()}))}),t}function Xn(e){const n=e.getElementsByTagName("*"),t=e.getElementsByTagName("img"),r=e.getElementsByTagName("svg"),s=n.length,o=t.length,i=r.length,a=s>1e3||o>50||i>10;return{nodeCount:s,imageCount:o,svgCount:i,isComplex:a}}function ue(){return new Promise(e=>{"scheduler"in window&&"yield"in window.scheduler?window.scheduler.yield().then(e):setTimeout(e,0)})}function Yn(e,n,t){return new Promise((r,s)=>{const o=setTimeout(()=>{s(new Error("Image load timeout"))},t);e.onload=()=>{clearTimeout(o),r()},e.onerror=()=>{clearTimeout(o),s(new Error("Image load error"))},e.src=n})}async function Jn(e,n){const t=e.getBoundingClientRect(),r=window.getComputedStyle(e),s=t.left,o=t.top,i=t.width,a=t.height,d=r.backgroundColor;d&&d!=="transparent"&&d!=="rgba(0, 0, 0, 0)"&&(n.fillStyle=d,n.fillRect(s,o,i,a));const h=parseFloat(r.borderWidth)||0;if(h>0){const l=r.borderColor;l&&l!=="transparent"&&(n.strokeStyle=l,n.lineWidth=h,n.strokeRect(s,o,i,a))}}async function $t(e,n){for(const t of e)t instanceof HTMLElement&&await Jn(t,n)}async function Qn(e,n,t,r,s,o){try{const i=new Image;return i.crossOrigin="anonymous",await Yn(i,e.src,3e3),n.drawImage(i,t,r,s,o),{success:!0,method:"canvas"}}catch(i){return{success:!1,error:i instanceof Error?i.message:"Canvas render failed"}}}function Kn(e,n,t,r,s){return e.fillStyle="#f0f0f0",e.fillRect(n,t,r,s),e.strokeStyle="#ccc",e.lineWidth=1,e.strokeRect(n,t,r,s),e.fillStyle="#999",e.font="12px sans-serif",e.textAlign="center",e.textBaseline="middle",e.fillText("Image",n+r/2,t+s/2),{success:!0,method:"placeholder"}}function Zn(e,n){return e<5||n<5}async function er(e,n){const t=e.getBoundingClientRect(),r=t.left,s=t.top,o=t.width,i=t.height;if(Zn(o,i))return{success:!0,method:"skip"};const a=await Qn(e,n,r,s,o,i);return a.success?a:Kn(n,r,s,o,i)}async function Wt(e,n,t){for(let r=0;r<e.length;r++)await er(e[r],n),t&&t(r+1,e.length)}function tr(e){const n=[];for(const t of e)t instanceof HTMLImageElement&&t.src&&n.push(t);return n}function nr(e){let t=new XMLSerializer().serializeToString(e);return t.includes("xmlns=")||(t=t.replace("<svg",'<svg xmlns="http://www.w3.org/2000/svg"')),t}function rr(e){return!!(e.includes('xlink:href="http')||e.includes('href="http')||e.includes("@font-face")&&e.includes("url(http"))}async function ir(e,n){try{const t=e.getBoundingClientRect(),r=t.left,s=t.top,o=t.width,i=t.height;if(o<1||i<1)return{success:!0};const a=nr(e);if(rr(a))return console.warn("[SVG] Skipping SVG with external resources to prevent canvas tainting"),{success:!0};const d=new Blob([a],{type:"image/svg+xml;charset=utf-8"}),h=URL.createObjectURL(d);try{const l=new Image;return await new Promise((m,y)=>{l.onload=()=>m(),l.onerror=()=>y(new Error("SVG image load failed")),l.src=h}),n.drawImage(l,r,s,o,i),{success:!0}}finally{URL.revokeObjectURL(h)}}catch(t){return{success:!1,error:t instanceof Error?t.message:"SVG render failed"}}}async function qt(e,n,t){for(let r=0;r<e.length;r++)await ir(e[r],n),t&&t(r+1,e.length)}function or(e){return e.classList.contains("MathJax")||e.classList.contains("MathJax_Display")||e.classList.contains("MJX-TeXAtom-ORD")||e.hasAttribute("data-mathml")}function sr(e){const n=[];for(const t of e)t instanceof SVGElement&&n.push(t);return n}function ar(e){return e.filter(n=>or(n))}async function lr(e,n){try{const t=e.getBoundingClientRect(),r=t.left,s=t.top,o=t.width,i=t.height;if(o<1||i<1)return{success:!0};const a=window.getComputedStyle(e),d=e.cloneNode(!0),h=["color","font-family","font-size","font-weight","font-style","line-height","text-align","text-decoration","text-transform","letter-spacing","word-spacing","white-space","padding","margin","display","flex-direction","align-items","justify-content"];let l="";h.forEach(C=>{const b=a.getPropertyValue(C);b&&(l+=`${C}: ${b}; `)}),d.setAttribute("style",l);const m=`
2
2
  <svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${i}">
3
3
  <foreignObject width="100%" height="100%">
4
4
  <div xmlns="http://www.w3.org/1999/xhtml" style="width: ${o}px; height: ${i}px; overflow: hidden;">
@@ -6,20 +6,20 @@
6
6
  </div>
7
7
  </foreignObject>
8
8
  </svg>
9
- `,y=new Blob([m],{type:"image/svg+xml;charset=utf-8"}),S=URL.createObjectURL(y);try{const C=new Image;return await new Promise((b,k)=>{const v=setTimeout(()=>{k(new Error("Text element render timeout"))},1e3);C.onload=()=>{clearTimeout(v),b()},C.onerror=()=>{clearTimeout(v),k(new Error("Text element image load failed"))},C.src=S}),t.drawImage(C,r,a,o,i),{success:!0}}finally{URL.revokeObjectURL(S)}}catch(n){return console.warn("[TextRenderer] Failed to render text element:",n),{success:!1,error:n instanceof Error?n.message:"Text render failed"}}}function ar(e){const t=window.getComputedStyle(e);if(t.display==="none"||t.visibility==="hidden")return!1;const n=e.textContent?.trim();return!(!n||n.length===0)}function lr(e){const t=[];for(const n of e){if(!(n instanceof HTMLElement))continue;const r=n.tagName;if(["IMG","SVG","CANVAS","VIDEO","IFRAME","SCRIPT","STYLE","NOSCRIPT"].includes(r))continue;["P","SPAN","DIV","A","BUTTON","LABEL","LI","H1","H2","H3","H4","H5","H6","TD","TH","STRONG","EM","B","I","U","CODE","PRE","BLOCKQUOTE"].includes(r)&&ar(n)&&(Array.from(n.children).some(i=>{const s=i.tagName;return["DIV","P","H1","H2","H3","H4","H5","H6","UL","OL","TABLE"].includes(s)})||t.push(n))}return t}async function cr(e,t,n){const r=lr(e);console.log("[TextRenderer] Rendering",r.length,"text elements");for(let a=0;a<r.length;a++){const o=await sr(r[a],t);o.success||console.warn("[TextRenderer] Failed to render element:",r[a],o.error)}}async function dr(e,t,n){const r=Pn();try{const a=Bn(),o=t.quality??a.recommendedQuality,i=t.scale??a.recommendedScale,s=t.includeMathJax??!0;n?.({phase:"analyzing",progress:10,message:"Analyzing DOM structure..."});const d=document.documentElement,p=Vn(d);console.log("[Canvas] DOM complexity:",p);let l=o;p.isComplex&&(l=Math.max(.6,o-.1),console.log("[Canvas] Complex DOM detected, reducing quality to",l));const m=e?e.x:0,y=e?e.y:0,S=e?e.width:window.innerWidth,C=e?e.height:window.innerHeight;let b=i;(S*b>a.maxCanvasSize||C*b>a.maxCanvasSize)&&(console.warn("[Canvas] Size exceeds device limits, reducing scale"),b=Math.min(a.maxCanvasSize/S,a.maxCanvasSize/C,b));const k=document.createElement("canvas");k.width=S*b,k.height=C*b,r.tempCanvases.push(k);const v=k.getContext("2d",{alpha:!1,willReadFrequently:!1});if(!v)throw new Error("Failed to get canvas context");v.scale(b,b),v.fillStyle="#ffffff",v.fillRect(0,0,S,C),n?.({phase:"analyzing",progress:20,message:"Collecting visible elements..."});const I=$n(e,a.maxCanvasSize>8192?500:300),T=qn(I);console.log("[Canvas] Visible elements:",T.length);const O=Zn(T),L=ir(T),$=s?or(T):[];console.log("[Canvas] Images:",O.length,"SVGs:",L.length,"MathJax:",$.length),n?.({phase:"rendering",progress:30,message:"Rendering backgrounds..."}),v.translate(-m,-y),await Gn(T,v),await Re(),n?.({phase:"rendering",progress:50,message:`Rendering ${O.length} images...`}),await Kn(O,v,(F,V)=>{const ae=50+Math.round(F/V*30);n?.({phase:"rendering",progress:ae,message:`Rendering images (${F}/${V})...`})}),await Re(),n?.({phase:"rendering",progress:80,message:`Rendering ${L.length} SVG elements...`}),await nr(L,v,(F,V)=>{const ae=80+Math.round(F/V*10);n?.({phase:"rendering",progress:ae,message:`Rendering SVG (${F}/${V})...`})}),await Re(),n?.({phase:"rendering",progress:90,message:"Rendering text content..."}),await cr(T,v,(F,V)=>{const ae=90+Math.round(F/V*5);n?.({phase:"rendering",progress:ae,message:`Rendering text (${F}/${V})...`})}),await Re(),n?.({phase:"exporting",progress:95,message:"Exporting canvas to image..."});const K=k.toDataURL("image/png",l);return n?.({phase:"exporting",progress:100,message:"Capture complete"}),console.log("[Canvas] Capture successful"),K}catch(a){return console.error("[Canvas] Capture failed:",a),null}finally{Hn(r)}}function ur(e,t){return e[13]=1,e[14]=t>>8,e[15]=t&255,e[16]=t>>8,e[17]=t&255,e}const Wt=112,qt=72,Vt=89,Rt=115;let wt;function fr(){const e=new Int32Array(256);for(let t=0;t<256;t++){let n=t;for(let r=0;r<8;r++)n=n&1?3988292384^n>>>1:n>>>1;e[t]=n}return e}function gr(e){let t=-1;wt||(wt=fr());for(let n=0;n<e.length;n++)t=wt[(t^e[n])&255]^t>>>8;return t^-1}function hr(e){const t=e.length-1;for(let n=t;n>=4;n--)if(e[n-4]===9&&e[n-3]===Wt&&e[n-2]===qt&&e[n-1]===Vt&&e[n]===Rt)return n-3;return 0}function pr(e,t,n=!1){const r=new Uint8Array(13);t*=39.3701,r[0]=Wt,r[1]=qt,r[2]=Vt,r[3]=Rt,r[4]=t>>>24,r[5]=t>>>16,r[6]=t>>>8,r[7]=t&255,r[8]=r[4],r[9]=r[5],r[10]=r[6],r[11]=r[7],r[12]=1;const a=gr(r),o=new Uint8Array(4);if(o[0]=a>>>24,o[1]=a>>>16,o[2]=a>>>8,o[3]=a&255,n){const i=hr(e);return e.set(r,i),e.set(o,i+13),e}else{const i=new Uint8Array(4);i[0]=0,i[1]=0,i[2]=0,i[3]=9;const s=new Uint8Array(54);return s.set(e,0),s.set(i,33),s.set(r,37),s.set(o,50),s}}const wr="AAlwSFlz",mr="AAAJcEhZ",br="AAAACXBI";function yr(e){let t=e.indexOf(wr);return t===-1&&(t=e.indexOf(mr)),t===-1&&(t=e.indexOf(br)),t}const jt="[modern-screenshot]",oe=typeof window<"u",vr=oe&&"Worker"in window,xr=oe&&"atob"in window,Sr=oe&&"btoa"in window,mt=oe?window.navigator?.userAgent:"",Gt=mt.includes("Chrome"),je=mt.includes("AppleWebKit")&&!Gt,bt=mt.includes("Firefox"),Cr=e=>e&&"__CONTEXT__"in e,kr=e=>e.constructor.name==="CSSFontFaceRule",Er=e=>e.constructor.name==="CSSImportRule",X=e=>e.nodeType===1,Oe=e=>typeof e.className=="object",Xt=e=>e.tagName==="image",Tr=e=>e.tagName==="use",_e=e=>X(e)&&typeof e.style<"u"&&!Oe(e),Ir=e=>e.nodeType===8,Ar=e=>e.nodeType===3,be=e=>e.tagName==="IMG",Ge=e=>e.tagName==="VIDEO",Nr=e=>e.tagName==="CANVAS",Mr=e=>e.tagName==="TEXTAREA",Or=e=>e.tagName==="INPUT",_r=e=>e.tagName==="STYLE",Dr=e=>e.tagName==="SCRIPT",Fr=e=>e.tagName==="SELECT",Lr=e=>e.tagName==="SLOT",Ur=e=>e.tagName==="IFRAME",zr=(...e)=>console.warn(jt,...e);function Br(e){const t=e?.createElement?.("canvas");return t&&(t.height=t.width=1),!!t&&"toDataURL"in t&&!!t.toDataURL("image/webp").includes("image/webp")}const yt=e=>e.startsWith("data:");function Yt(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(oe&&e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i)||!oe)return e;const n=Xe().implementation.createHTMLDocument(),r=n.createElement("base"),a=n.createElement("a");return n.head.appendChild(r),n.body.appendChild(a),t&&(r.href=t),a.href=e,a.href}function Xe(e){return(e&&X(e)?e?.ownerDocument:e)??window.document}const Ye="http://www.w3.org/2000/svg";function Pr(e,t,n){const r=Xe(n).createElementNS(Ye,"svg");return r.setAttributeNS(null,"width",e.toString()),r.setAttributeNS(null,"height",t.toString()),r.setAttributeNS(null,"viewBox",`0 0 ${e} ${t}`),r}function Hr(e,t){let n=new XMLSerializer().serializeToString(e);return t&&(n=n.replace(/[\u0000-\u0008\v\f\u000E-\u001F\uD800-\uDFFF\uFFFE\uFFFF]/gu,"")),`data:image/svg+xml;charset=utf-8,${encodeURIComponent(n)}`}function $r(e,t){return new Promise((n,r)=>{const a=new FileReader;a.onload=()=>n(a.result),a.onerror=()=>r(a.error),a.onabort=()=>r(new Error(`Failed read blob to ${t}`)),a.readAsDataURL(e)})}const Wr=e=>$r(e,"dataUrl");function ye(e,t){const n=Xe(t).createElement("img");return n.decoding="sync",n.loading="eager",n.src=e,n}function De(e,t){return new Promise(n=>{const{timeout:r,ownerDocument:a,onError:o,onWarn:i}=t??{},s=typeof e=="string"?ye(e,Xe(a)):e;let d=null,p=null;function l(){n(s),d&&clearTimeout(d),p?.()}if(r&&(d=setTimeout(l,r)),Ge(s)){const m=s.currentSrc||s.src;if(!m)return s.poster?De(s.poster,t).then(n):l();if(s.readyState>=2)return l();const y=l,S=C=>{i?.("Failed video load",m,C),o?.(C),l()};p=()=>{s.removeEventListener("loadeddata",y),s.removeEventListener("error",S)},s.addEventListener("loadeddata",y,{once:!0}),s.addEventListener("error",S,{once:!0})}else{const m=Xt(s)?s.href.baseVal:s.currentSrc||s.src;if(!m)return l();const y=async()=>{if(be(s)&&"decode"in s)try{await s.decode()}catch(C){i?.("Failed to decode image, trying to render anyway",s.dataset.originalSrc||m,C)}l()},S=C=>{i?.("Failed image load",s.dataset.originalSrc||m,C),l()};if(be(s)&&s.complete)return y();p=()=>{s.removeEventListener("load",y),s.removeEventListener("error",S)},s.addEventListener("load",y,{once:!0}),s.addEventListener("error",S,{once:!0})}})}async function qr(e,t){_e(e)&&(be(e)||Ge(e)?await De(e,t):await Promise.all(["img","video"].flatMap(n=>Array.from(e.querySelectorAll(n)).map(r=>De(r,t)))))}const Jt=(function(){let t=0;const n=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(t+=1,`u${n()}${t}`)})();function Qt(e){return e?.split(",").map(t=>t.trim().replace(/"|'/g,"").toLowerCase()).filter(Boolean)}let Kt=0;function Vr(e){const t=`${jt}[#${Kt}]`;return Kt++,{time:n=>e&&console.time(`${t} ${n}`),timeEnd:n=>e&&console.timeEnd(`${t} ${n}`),warn:(...n)=>e&&zr(...n)}}function Rr(e){return{cache:e?"no-cache":"force-cache"}}async function Je(e,t){return Cr(e)?e:jr(e,{...t,autoDestruct:!0})}async function jr(e,t){const{scale:n=1,workerUrl:r,workerNumber:a=1}=t||{},o=!!t?.debug,i=t?.features??!0,s=e.ownerDocument??(oe?window.document:void 0),d=e.ownerDocument?.defaultView??(oe?window:void 0),p=new Map,l={width:0,height:0,quality:1,type:"image/png",scale:n,backgroundColor:null,style:null,filter:null,maximumCanvasSize:0,timeout:3e4,progress:null,debug:o,fetch:{requestInit:Rr(t?.fetch?.bypassingCache),placeholderImage:"data:image/png;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",bypassingCache:!1,...t?.fetch},fetchFn:null,font:{},drawImageInterval:100,workerUrl:null,workerNumber:a,onCloneEachNode:null,onCloneNode:null,onEmbedNode:null,onCreateForeignObjectSvg:null,includeStyleProperties:null,autoDestruct:!1,...t,__CONTEXT__:!0,log:Vr(o),node:e,ownerDocument:s,ownerWindow:d,dpi:n===1?null:96*n,svgStyleElement:Zt(s),svgDefsElement:s?.createElementNS(Ye,"defs"),svgStyles:new Map,defaultComputedStyles:new Map,workers:[...Array.from({length:vr&&r&&a?a:0})].map(()=>{try{const S=new Worker(r);return S.onmessage=async C=>{const{url:b,result:k}=C.data;k?p.get(b)?.resolve?.(k):p.get(b)?.reject?.(new Error(`Error receiving message from worker: ${b}`))},S.onmessageerror=C=>{const{url:b}=C.data;p.get(b)?.reject?.(new Error(`Error receiving message from worker: ${b}`))},S}catch(S){return l.log.warn("Failed to new Worker",S),null}}).filter(Boolean),fontFamilies:new Map,fontCssTexts:new Map,acceptOfImage:`${[Br(s)&&"image/webp","image/svg+xml","image/*","*/*"].filter(Boolean).join(",")};q=0.8`,requests:p,drawImageCount:0,tasks:[],features:i,isEnable:S=>S==="restoreScrollPosition"?typeof i=="boolean"?!1:i[S]??!1:typeof i=="boolean"?i:i[S]??!0,shadowRoots:[]};l.log.time("wait until load"),await qr(e,{timeout:l.timeout,onWarn:l.log.warn}),l.log.timeEnd("wait until load");const{width:m,height:y}=Gr(e,l);return l.width=m,l.height=y,l}function Zt(e){if(!e)return;const t=e.createElement("style"),n=t.ownerDocument.createTextNode(`
9
+ `,y=new Blob([m],{type:"image/svg+xml;charset=utf-8"}),S=URL.createObjectURL(y);try{const C=new Image;return await new Promise((b,E)=>{const v=setTimeout(()=>{E(new Error("Text element render timeout"))},1e3);C.onload=()=>{clearTimeout(v),b()},C.onerror=()=>{clearTimeout(v),E(new Error("Text element image load failed"))},C.src=S}),n.drawImage(C,r,s,o,i),{success:!0}}finally{URL.revokeObjectURL(S)}}catch(t){return console.warn("[TextRenderer] Failed to render text element:",t),{success:!1,error:t instanceof Error?t.message:"Text render failed"}}}function cr(e){const n=window.getComputedStyle(e);if(n.display==="none"||n.visibility==="hidden")return!1;const t=e.textContent?.trim();return!(!t||t.length===0)}function dr(e){const n=[];for(const t of e){if(!(t instanceof HTMLElement))continue;const r=t.tagName;if(["IMG","SVG","CANVAS","VIDEO","IFRAME","SCRIPT","STYLE","NOSCRIPT"].includes(r))continue;["P","SPAN","DIV","A","BUTTON","LABEL","LI","H1","H2","H3","H4","H5","H6","TD","TH","STRONG","EM","B","I","U","CODE","PRE","BLOCKQUOTE"].includes(r)&&cr(t)&&(Array.from(t.children).some(i=>{const a=i.tagName;return["DIV","P","H1","H2","H3","H4","H5","H6","UL","OL","TABLE"].includes(a)})||n.push(t))}return n}async function ur(e,n,t){const r=dr(e);console.log("[TextRenderer] Rendering",r.length,"text elements");for(let s=0;s<r.length;s++){const o=await lr(r[s],n);o.success||console.warn("[TextRenderer] Failed to render element:",r[s],o.error),t&&t(s+1,r.length)}}async function fr(e,n,t){const r=Wn();try{const s=$n(),o=n.quality??s.recommendedQuality,i=n.scale??s.recommendedScale,a=n.includeMathJax??!0;t?.({phase:"analyzing",progress:10,message:"Analyzing DOM structure..."});const d=document.documentElement,h=Xn(d);console.log("[Canvas] DOM complexity:",h);let l=o;h.isComplex&&(l=Math.max(.6,o-.1),console.log("[Canvas] Complex DOM detected, reducing quality to",l));const m=()=>window.visualViewport?window.visualViewport.width:document.documentElement.clientWidth||window.innerWidth,y=()=>window.visualViewport?window.visualViewport.height:document.documentElement.clientHeight||window.innerHeight,S=e?e.x:0,C=e?e.y:0,b=e?e.width:m(),E=e?e.height:y();let v=i;(b*v>s.maxCanvasSize||E*v>s.maxCanvasSize)&&(console.warn("[Canvas] Size exceeds device limits, reducing scale"),v=Math.min(s.maxCanvasSize/b,s.maxCanvasSize/E,v));const T=document.createElement("canvas");T.width=b*v,T.height=E*v,r.tempCanvases.push(T);const k=T.getContext("2d",{alpha:!1,willReadFrequently:!1});if(!k)throw new Error("Failed to get canvas context");k.scale(v,v),k.fillStyle="#ffffff",k.fillRect(0,0,b,E),t?.({phase:"analyzing",progress:20,message:"Collecting visible elements..."});const F=Rn(e,s.maxCanvasSize>8192?500:300,b,E),L=Gn(F);console.log("[Canvas] Visible elements:",L.length);const z=tr(L),q=sr(L),R=a?ar(L):[];console.log("[Canvas] Images:",z.length,"SVGs:",q.length,"MathJax:",R.length),t?.({phase:"rendering",progress:30,message:"Rendering backgrounds..."}),k.translate(-S,-C);const xe=()=>{try{return k.getImageData(0,0,1,1),!1}catch{return!0}};if(await $t(L,k),await ue(),xe())return console.warn("[Canvas] Canvas tainted after background rendering"),null;if(t?.({phase:"rendering",progress:50,message:`Rendering ${z.length} images...`}),await Wt(z,k,(M,U)=>{const P=50+Math.round(M/U*30);t?.({phase:"rendering",progress:P,message:`Rendering images (${M}/${U})...`})}),await ue(),xe()){console.warn("[Canvas] Canvas tainted after image rendering, skipping SVG and text layers"),t?.({phase:"exporting",progress:95,message:"Exporting canvas (images tainted, skipping remaining layers)..."});try{const M=T.toDataURL("image/png",l);return M.length<5e3?(console.warn("[Canvas] Canvas appears blank"),null):(console.log("[Canvas] Capture successful (backgrounds + images only, skipped SVG/text due to taint)"),M)}catch(M){return console.error("[Canvas] Export failed after image layer:",M),null}}if(t?.({phase:"rendering",progress:80,message:`Rendering ${q.length} SVG elements...`}),await qt(q,k,(M,U)=>{const P=80+Math.round(M/U*10);t?.({phase:"rendering",progress:P,message:`Rendering SVG (${M}/${U})...`})}),await ue(),xe()){console.warn("[Canvas] Canvas tainted after SVG rendering, skipping text layer"),t?.({phase:"exporting",progress:95,message:"Exporting canvas (SVG tainted, skipping text)..."});try{const M=T.toDataURL("image/png",l);return M.length<5e3?(console.warn("[Canvas] Canvas appears blank"),null):(console.log("[Canvas] Capture successful (backgrounds + images + SVG, skipped text due to taint)"),M)}catch(M){return console.error("[Canvas] Export failed after SVG layer:",M),null}}t?.({phase:"rendering",progress:90,message:"Rendering text content..."}),await ur(L,k,(M,U)=>{const P=90+Math.round(M/U*5);t?.({phase:"rendering",progress:P,message:`Rendering text (${M}/${U})...`})}),await ue(),t?.({phase:"exporting",progress:95,message:"Exporting canvas to image..."});try{k.getImageData(0,0,1,1);const M=T.toDataURL("image/png",l);return M.length<5e3?(console.warn("[Canvas] Canvas export appears to be blank or too small"),null):(t?.({phase:"exporting",progress:100,message:"Capture complete"}),console.log("[Canvas] Capture successful (all layers)"),M)}catch{console.warn("[Canvas] Canvas tainted after text rendering, retrying without text layer"),k.clearRect(0,0,T.width,T.height),k.fillStyle="#ffffff",k.fillRect(0,0,b,E),k.translate(-S,-C),await $t(L,k),await ue(),await Wt(z,k,()=>{}),await ue(),await qt(q,k,()=>{}),await ue();try{const U=T.toDataURL("image/png",l);return U.length<5e3?(console.warn("[Canvas] Canvas still appears blank after retry"),null):(console.log("[Canvas] Capture successful (without text layer)"),U)}catch(U){return console.error("[Canvas] Export failed even without text layer:",U),null}}}catch(s){return console.error("[Canvas] Capture failed:",s),null}finally{qn(r)}}function gr(e,n){return e[13]=1,e[14]=n>>8,e[15]=n&255,e[16]=n>>8,e[17]=n&255,e}const Rt=112,jt=72,Gt=89,Xt=115;let wt;function hr(){const e=new Int32Array(256);for(let n=0;n<256;n++){let t=n;for(let r=0;r<8;r++)t=t&1?3988292384^t>>>1:t>>>1;e[n]=t}return e}function pr(e){let n=-1;wt||(wt=hr());for(let t=0;t<e.length;t++)n=wt[(n^e[t])&255]^n>>>8;return n^-1}function wr(e){const n=e.length-1;for(let t=n;t>=4;t--)if(e[t-4]===9&&e[t-3]===Rt&&e[t-2]===jt&&e[t-1]===Gt&&e[t]===Xt)return t-3;return 0}function mr(e,n,t=!1){const r=new Uint8Array(13);n*=39.3701,r[0]=Rt,r[1]=jt,r[2]=Gt,r[3]=Xt,r[4]=n>>>24,r[5]=n>>>16,r[6]=n>>>8,r[7]=n&255,r[8]=r[4],r[9]=r[5],r[10]=r[6],r[11]=r[7],r[12]=1;const s=pr(r),o=new Uint8Array(4);if(o[0]=s>>>24,o[1]=s>>>16,o[2]=s>>>8,o[3]=s&255,t){const i=wr(e);return e.set(r,i),e.set(o,i+13),e}else{const i=new Uint8Array(4);i[0]=0,i[1]=0,i[2]=0,i[3]=9;const a=new Uint8Array(54);return a.set(e,0),a.set(i,33),a.set(r,37),a.set(o,50),a}}const br="AAlwSFlz",yr="AAAJcEhZ",vr="AAAACXBI";function xr(e){let n=e.indexOf(br);return n===-1&&(n=e.indexOf(yr)),n===-1&&(n=e.indexOf(vr)),n}const Yt="[modern-screenshot]",se=typeof window<"u",Sr=se&&"Worker"in window,Cr=se&&"atob"in window,kr=se&&"btoa"in window,mt=se?window.navigator?.userAgent:"",Jt=mt.includes("Chrome"),Ge=mt.includes("AppleWebKit")&&!Jt,bt=mt.includes("Firefox"),Er=e=>e&&"__CONTEXT__"in e,Tr=e=>e.constructor.name==="CSSFontFaceRule",Ir=e=>e.constructor.name==="CSSImportRule",Q=e=>e.nodeType===1,De=e=>typeof e.className=="object",Qt=e=>e.tagName==="image",Ar=e=>e.tagName==="use",Fe=e=>Q(e)&&typeof e.style<"u"&&!De(e),Nr=e=>e.nodeType===8,Mr=e=>e.nodeType===3,ye=e=>e.tagName==="IMG",Xe=e=>e.tagName==="VIDEO",Or=e=>e.tagName==="CANVAS",_r=e=>e.tagName==="TEXTAREA",Dr=e=>e.tagName==="INPUT",Fr=e=>e.tagName==="STYLE",Lr=e=>e.tagName==="SCRIPT",Ur=e=>e.tagName==="SELECT",zr=e=>e.tagName==="SLOT",Br=e=>e.tagName==="IFRAME",Pr=(...e)=>console.warn(Yt,...e);function Hr(e){const n=e?.createElement?.("canvas");return n&&(n.height=n.width=1),!!n&&"toDataURL"in n&&!!n.toDataURL("image/webp").includes("image/webp")}const yt=e=>e.startsWith("data:");function Kt(e,n){if(e.match(/^[a-z]+:\/\//i))return e;if(se&&e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i)||!se)return e;const t=Ye().implementation.createHTMLDocument(),r=t.createElement("base"),s=t.createElement("a");return t.head.appendChild(r),t.body.appendChild(s),n&&(r.href=n),s.href=e,s.href}function Ye(e){return(e&&Q(e)?e?.ownerDocument:e)??window.document}const Je="http://www.w3.org/2000/svg";function Vr(e,n,t){const r=Ye(t).createElementNS(Je,"svg");return r.setAttributeNS(null,"width",e.toString()),r.setAttributeNS(null,"height",n.toString()),r.setAttributeNS(null,"viewBox",`0 0 ${e} ${n}`),r}function $r(e,n){let t=new XMLSerializer().serializeToString(e);return n&&(t=t.replace(/[\u0000-\u0008\v\f\u000E-\u001F\uD800-\uDFFF\uFFFE\uFFFF]/gu,"")),`data:image/svg+xml;charset=utf-8,${encodeURIComponent(t)}`}function Wr(e,n){return new Promise((t,r)=>{const s=new FileReader;s.onload=()=>t(s.result),s.onerror=()=>r(s.error),s.onabort=()=>r(new Error(`Failed read blob to ${n}`)),s.readAsDataURL(e)})}const qr=e=>Wr(e,"dataUrl");function ve(e,n){const t=Ye(n).createElement("img");return t.decoding="sync",t.loading="eager",t.src=e,t}function Le(e,n){return new Promise(t=>{const{timeout:r,ownerDocument:s,onError:o,onWarn:i}=n??{},a=typeof e=="string"?ve(e,Ye(s)):e;let d=null,h=null;function l(){t(a),d&&clearTimeout(d),h?.()}if(r&&(d=setTimeout(l,r)),Xe(a)){const m=a.currentSrc||a.src;if(!m)return a.poster?Le(a.poster,n).then(t):l();if(a.readyState>=2)return l();const y=l,S=C=>{i?.("Failed video load",m,C),o?.(C),l()};h=()=>{a.removeEventListener("loadeddata",y),a.removeEventListener("error",S)},a.addEventListener("loadeddata",y,{once:!0}),a.addEventListener("error",S,{once:!0})}else{const m=Qt(a)?a.href.baseVal:a.currentSrc||a.src;if(!m)return l();const y=async()=>{if(ye(a)&&"decode"in a)try{await a.decode()}catch(C){i?.("Failed to decode image, trying to render anyway",a.dataset.originalSrc||m,C)}l()},S=C=>{i?.("Failed image load",a.dataset.originalSrc||m,C),l()};if(ye(a)&&a.complete)return y();h=()=>{a.removeEventListener("load",y),a.removeEventListener("error",S)},a.addEventListener("load",y,{once:!0}),a.addEventListener("error",S,{once:!0})}})}async function Rr(e,n){Fe(e)&&(ye(e)||Xe(e)?await Le(e,n):await Promise.all(["img","video"].flatMap(t=>Array.from(e.querySelectorAll(t)).map(r=>Le(r,n)))))}const Zt=(function(){let n=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(n+=1,`u${t()}${n}`)})();function en(e){return e?.split(",").map(n=>n.trim().replace(/"|'/g,"").toLowerCase()).filter(Boolean)}let tn=0;function jr(e){const n=`${Yt}[#${tn}]`;return tn++,{time:t=>e&&console.time(`${n} ${t}`),timeEnd:t=>e&&console.timeEnd(`${n} ${t}`),warn:(...t)=>e&&Pr(...t)}}function Gr(e){return{cache:e?"no-cache":"force-cache"}}async function Qe(e,n){return Er(e)?e:Xr(e,{...n,autoDestruct:!0})}async function Xr(e,n){const{scale:t=1,workerUrl:r,workerNumber:s=1}=n||{},o=!!n?.debug,i=n?.features??!0,a=e.ownerDocument??(se?window.document:void 0),d=e.ownerDocument?.defaultView??(se?window:void 0),h=new Map,l={width:0,height:0,quality:1,type:"image/png",scale:t,backgroundColor:null,style:null,filter:null,maximumCanvasSize:0,timeout:3e4,progress:null,debug:o,fetch:{requestInit:Gr(n?.fetch?.bypassingCache),placeholderImage:"data:image/png;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",bypassingCache:!1,...n?.fetch},fetchFn:null,font:{},drawImageInterval:100,workerUrl:null,workerNumber:s,onCloneEachNode:null,onCloneNode:null,onEmbedNode:null,onCreateForeignObjectSvg:null,includeStyleProperties:null,autoDestruct:!1,...n,__CONTEXT__:!0,log:jr(o),node:e,ownerDocument:a,ownerWindow:d,dpi:t===1?null:96*t,svgStyleElement:nn(a),svgDefsElement:a?.createElementNS(Je,"defs"),svgStyles:new Map,defaultComputedStyles:new Map,workers:[...Array.from({length:Sr&&r&&s?s:0})].map(()=>{try{const S=new Worker(r);return S.onmessage=async C=>{const{url:b,result:E}=C.data;E?h.get(b)?.resolve?.(E):h.get(b)?.reject?.(new Error(`Error receiving message from worker: ${b}`))},S.onmessageerror=C=>{const{url:b}=C.data;h.get(b)?.reject?.(new Error(`Error receiving message from worker: ${b}`))},S}catch(S){return l.log.warn("Failed to new Worker",S),null}}).filter(Boolean),fontFamilies:new Map,fontCssTexts:new Map,acceptOfImage:`${[Hr(a)&&"image/webp","image/svg+xml","image/*","*/*"].filter(Boolean).join(",")};q=0.8`,requests:h,drawImageCount:0,tasks:[],features:i,isEnable:S=>S==="restoreScrollPosition"?typeof i=="boolean"?!1:i[S]??!1:typeof i=="boolean"?i:i[S]??!0,shadowRoots:[]};l.log.time("wait until load"),await Rr(e,{timeout:l.timeout,onWarn:l.log.warn}),l.log.timeEnd("wait until load");const{width:m,height:y}=Yr(e,l);return l.width=m,l.height=y,l}function nn(e){if(!e)return;const n=e.createElement("style"),t=n.ownerDocument.createTextNode(`
10
10
  .______background-clip--text {
11
11
  background-clip: text;
12
12
  -webkit-background-clip: text;
13
13
  }
14
- `);return t.appendChild(n),t}function Gr(e,t){let{width:n,height:r}=t;if(X(e)&&(!n||!r)){const a=e.getBoundingClientRect();n=n||a.width||Number(e.getAttribute("width"))||0,r=r||a.height||Number(e.getAttribute("height"))||0}return{width:n,height:r}}async function Xr(e,t){const{log:n,timeout:r,drawImageCount:a,drawImageInterval:o}=t;n.time("image to canvas");const i=await De(e,{timeout:r,onWarn:t.log.warn}),{canvas:s,context2d:d}=Yr(e.ownerDocument,t),p=()=>{try{d?.drawImage(i,0,0,s.width,s.height)}catch(l){t.log.warn("Failed to drawImage",l)}};if(p(),t.isEnable("fixSvgXmlDecode"))for(let l=0;l<a;l++)await new Promise(m=>{setTimeout(()=>{d?.clearRect(0,0,s.width,s.height),p(),m()},l+o)});return t.drawImageCount=0,n.timeEnd("image to canvas"),s}function Yr(e,t){const{width:n,height:r,scale:a,backgroundColor:o,maximumCanvasSize:i}=t,s=e.createElement("canvas");s.width=Math.floor(n*a),s.height=Math.floor(r*a),s.style.width=`${n}px`,s.style.height=`${r}px`,i&&(s.width>i||s.height>i)&&(s.width>i&&s.height>i?s.width>s.height?(s.height*=i/s.width,s.width=i):(s.width*=i/s.height,s.height=i):s.width>i?(s.height*=i/s.width,s.width=i):(s.width*=i/s.height,s.height=i));const d=s.getContext("2d");return d&&o&&(d.fillStyle=o,d.fillRect(0,0,s.width,s.height)),{canvas:s,context2d:d}}function en(e,t){if(e.ownerDocument)try{const o=e.toDataURL();if(o!=="data:,")return ye(o,e.ownerDocument)}catch(o){t.log.warn("Failed to clone canvas",o)}const n=e.cloneNode(!1),r=e.getContext("2d"),a=n.getContext("2d");try{return r&&a&&a.putImageData(r.getImageData(0,0,e.width,e.height),0,0),n}catch(o){t.log.warn("Failed to clone canvas",o)}return n}function Jr(e,t){try{if(e?.contentDocument?.body)return vt(e.contentDocument.body,t)}catch(n){t.log.warn("Failed to clone iframe",n)}return e.cloneNode(!1)}function Qr(e){const t=e.cloneNode(!1);return e.currentSrc&&e.currentSrc!==e.src&&(t.src=e.currentSrc,t.srcset=""),t.loading==="lazy"&&(t.loading="eager"),t}async function Kr(e,t){if(e.ownerDocument&&!e.currentSrc&&e.poster)return ye(e.poster,e.ownerDocument);const n=e.cloneNode(!1);n.crossOrigin="anonymous",e.currentSrc&&e.currentSrc!==e.src&&(n.src=e.currentSrc);const r=n.ownerDocument;if(r){let a=!0;if(await De(n,{onError:()=>a=!1,onWarn:t.log.warn}),!a)return e.poster?ye(e.poster,e.ownerDocument):n;n.currentTime=e.currentTime,await new Promise(i=>{n.addEventListener("seeked",i,{once:!0})});const o=r.createElement("canvas");o.width=e.offsetWidth,o.height=e.offsetHeight;try{const i=o.getContext("2d");i&&i.drawImage(n,0,0,o.width,o.height)}catch(i){return t.log.warn("Failed to clone video",i),e.poster?ye(e.poster,e.ownerDocument):n}return en(o,t)}return n}function Zr(e,t){return Nr(e)?en(e,t):Ur(e)?Jr(e,t):be(e)?Qr(e):Ge(e)?Kr(e,t):e.cloneNode(!1)}function ei(e){let t=e.sandbox;if(!t){const{ownerDocument:n}=e;try{n&&(t=n.createElement("iframe"),t.id=`__SANDBOX__${Jt()}`,t.width="0",t.height="0",t.style.visibility="hidden",t.style.position="fixed",n.body.appendChild(t),t.srcdoc='<!DOCTYPE html><meta charset="UTF-8"><title></title><body>',e.sandbox=t)}catch(r){e.log.warn("Failed to getSandBox",r)}}return t}const ti=["width","height","-webkit-text-fill-color"],ni=["stroke","fill"];function tn(e,t,n){const{defaultComputedStyles:r}=n,a=e.nodeName.toLowerCase(),o=Oe(e)&&a!=="svg",i=o?ni.map(b=>[b,e.getAttribute(b)]).filter(([,b])=>b!==null):[],s=[o&&"svg",a,i.map((b,k)=>`${b}=${k}`).join(","),t].filter(Boolean).join(":");if(r.has(s))return r.get(s);const p=ei(n)?.contentWindow;if(!p)return new Map;const l=p?.document;let m,y;o?(m=l.createElementNS(Ye,"svg"),y=m.ownerDocument.createElementNS(m.namespaceURI,a),i.forEach(([b,k])=>{y.setAttributeNS(null,b,k)}),m.appendChild(y)):m=y=l.createElement(a),y.textContent=" ",l.body.appendChild(m);const S=p.getComputedStyle(y,t),C=new Map;for(let b=S.length,k=0;k<b;k++){const v=S.item(k);ti.includes(v)||C.set(v,S.getPropertyValue(v))}return l.body.removeChild(m),r.set(s,C),C}function nn(e,t,n){const r=new Map,a=[],o=new Map;if(n)for(const s of n)i(s);else for(let s=e.length,d=0;d<s;d++){const p=e.item(d);i(p)}for(let s=a.length,d=0;d<s;d++)o.get(a[d])?.forEach((p,l)=>r.set(l,p));function i(s){const d=e.getPropertyValue(s),p=e.getPropertyPriority(s),l=s.lastIndexOf("-"),m=l>-1?s.substring(0,l):void 0;if(m){let y=o.get(m);y||(y=new Map,o.set(m,y)),y.set(s,[d,p])}t.get(s)===d&&!p||(m?a.push(m):r.set(s,[d,p]))}return r}function ri(e,t,n,r){const{ownerWindow:a,includeStyleProperties:o,currentParentNodeStyle:i}=r,s=t.style,d=a.getComputedStyle(e),p=tn(e,null,r);i?.forEach((m,y)=>{p.delete(y)});const l=nn(d,p,o);l.delete("transition-property"),l.delete("all"),l.delete("d"),l.delete("content"),n&&(l.delete("margin-top"),l.delete("margin-right"),l.delete("margin-bottom"),l.delete("margin-left"),l.delete("margin-block-start"),l.delete("margin-block-end"),l.delete("margin-inline-start"),l.delete("margin-inline-end"),l.set("box-sizing",["border-box",""])),l.get("background-clip")?.[0]==="text"&&t.classList.add("______background-clip--text"),Gt&&(l.has("font-kerning")||l.set("font-kerning",["normal",""]),(l.get("overflow-x")?.[0]==="hidden"||l.get("overflow-y")?.[0]==="hidden")&&l.get("text-overflow")?.[0]==="ellipsis"&&e.scrollWidth===e.clientWidth&&l.set("text-overflow",["clip",""]));for(let m=s.length,y=0;y<m;y++)s.removeProperty(s.item(y));return l.forEach(([m,y],S)=>{s.setProperty(S,m,y)}),l}function ii(e,t){(Mr(e)||Or(e)||Fr(e))&&t.setAttribute("value",e.value)}const oi=["::before","::after"],si=["::-webkit-scrollbar","::-webkit-scrollbar-button","::-webkit-scrollbar-thumb","::-webkit-scrollbar-track","::-webkit-scrollbar-track-piece","::-webkit-scrollbar-corner","::-webkit-resizer"];function ai(e,t,n,r,a){const{ownerWindow:o,svgStyleElement:i,svgStyles:s,currentNodeStyle:d}=r;if(!i||!o)return;function p(l){const m=o.getComputedStyle(e,l);let y=m.getPropertyValue("content");if(!y||y==="none")return;a?.(y),y=y.replace(/(')|(")|(counter\(.+\))/g,"");const S=[Jt()],C=tn(e,l,r);d?.forEach((T,O)=>{C.delete(O)});const b=nn(m,C,r.includeStyleProperties);b.delete("content"),b.delete("-webkit-locale"),b.get("background-clip")?.[0]==="text"&&t.classList.add("______background-clip--text");const k=[`content: '${y}';`];if(b.forEach(([T,O],L)=>{k.push(`${L}: ${T}${O?" !important":""};`)}),k.length===1)return;try{t.className=[t.className,...S].join(" ")}catch(T){r.log.warn("Failed to copyPseudoClass",T);return}const v=k.join(`
15
- `);let I=s.get(v);I||(I=[],s.set(v,I)),I.push(`.${S[0]}${l}`)}oi.forEach(p),n&&si.forEach(p)}const rn=new Set(["symbol"]);async function on(e,t,n,r,a){if(X(n)&&(_r(n)||Dr(n))||r.filter&&!r.filter(n))return;rn.has(t.nodeName)||rn.has(n.nodeName)?r.currentParentNodeStyle=void 0:r.currentParentNodeStyle=r.currentNodeStyle;const o=await vt(n,r,!1,a);r.isEnable("restoreScrollPosition")&&li(e,o),t.appendChild(o)}async function sn(e,t,n,r){let a=e.firstChild;X(e)&&e.shadowRoot&&(a=e.shadowRoot?.firstChild,n.shadowRoots.push(e.shadowRoot));for(let o=a;o;o=o.nextSibling)if(!Ir(o))if(X(o)&&Lr(o)&&typeof o.assignedNodes=="function"){const i=o.assignedNodes();for(let s=0;s<i.length;s++)await on(e,t,i[s],n,r)}else await on(e,t,o,n,r)}function li(e,t){if(!_e(e)||!_e(t))return;const{scrollTop:n,scrollLeft:r}=e;if(!n&&!r)return;const{transform:a}=t.style,o=new DOMMatrix(a),{a:i,b:s,c:d,d:p}=o;o.a=1,o.b=0,o.c=0,o.d=1,o.translateSelf(-r,-n),o.a=i,o.b=s,o.c=d,o.d=p,t.style.transform=o.toString()}function ci(e,t){const{backgroundColor:n,width:r,height:a,style:o}=t,i=e.style;if(n&&i.setProperty("background-color",n,"important"),r&&i.setProperty("width",`${r}px`,"important"),a&&i.setProperty("height",`${a}px`,"important"),o)for(const s in o)i[s]=o[s]}const di=/^[\w-:]+$/;async function vt(e,t,n=!1,r){const{ownerDocument:a,ownerWindow:o,fontFamilies:i,onCloneEachNode:s}=t;if(a&&Ar(e))return r&&/\S/.test(e.data)&&r(e.data),a.createTextNode(e.data);if(a&&o&&X(e)&&(_e(e)||Oe(e))){const p=await Zr(e,t);if(t.isEnable("removeAbnormalAttributes")){const b=p.getAttributeNames();for(let k=b.length,v=0;v<k;v++){const I=b[v];di.test(I)||p.removeAttribute(I)}}const l=t.currentNodeStyle=ri(e,p,n,t);n&&ci(p,t);let m=!1;if(t.isEnable("copyScrollbar")){const b=[l.get("overflow-x")?.[0],l.get("overflow-y")?.[0]];m=b.includes("scroll")||(b.includes("auto")||b.includes("overlay"))&&(e.scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth)}const y=l.get("text-transform")?.[0],S=Qt(l.get("font-family")?.[0]),C=S?b=>{y==="uppercase"?b=b.toUpperCase():y==="lowercase"?b=b.toLowerCase():y==="capitalize"&&(b=b[0].toUpperCase()+b.substring(1)),S.forEach(k=>{let v=i.get(k);v||i.set(k,v=new Set),b.split("").forEach(I=>v.add(I))})}:void 0;return ai(e,p,m,t,C),ii(e,p),Ge(e)||await sn(e,p,t,C),await s?.(p),p}const d=e.cloneNode(!1);return await sn(e,d,t),await s?.(d),d}function ui(e){if(e.ownerDocument=void 0,e.ownerWindow=void 0,e.svgStyleElement=void 0,e.svgDefsElement=void 0,e.svgStyles.clear(),e.defaultComputedStyles.clear(),e.sandbox){try{e.sandbox.remove()}catch(t){e.log.warn("Failed to destroyContext",t)}e.sandbox=void 0}e.workers=[],e.fontFamilies.clear(),e.fontCssTexts.clear(),e.requests.clear(),e.tasks=[],e.shadowRoots=[]}function fi(e){const{url:t,timeout:n,responseType:r,...a}=e,o=new AbortController,i=n?setTimeout(()=>o.abort(),n):void 0;return fetch(t,{signal:o.signal,...a}).then(s=>{if(!s.ok)throw new Error("Failed fetch, not 2xx response",{cause:s});switch(r){case"arrayBuffer":return s.arrayBuffer();case"dataUrl":return s.blob().then(Wr);default:return s.text()}}).finally(()=>clearTimeout(i))}function Fe(e,t){const{url:n,requestType:r="text",responseType:a="text",imageDom:o}=t;let i=n;const{timeout:s,acceptOfImage:d,requests:p,fetchFn:l,fetch:{requestInit:m,bypassingCache:y,placeholderImage:S},font:C,workers:b,fontFamilies:k}=e;r==="image"&&(je||bt)&&e.drawImageCount++;let v=p.get(n);if(!v){y&&y instanceof RegExp&&y.test(i)&&(i+=(/\?/.test(i)?"&":"?")+new Date().getTime());const I=r.startsWith("font")&&C&&C.minify,T=new Set;I&&r.split(";")[1].split(",").forEach(K=>{k.has(K)&&k.get(K).forEach(F=>T.add(F))});const O=I&&T.size,L={url:i,timeout:s,responseType:O?"arrayBuffer":a,headers:r==="image"?{accept:d}:void 0,...m};v={type:r,resolve:void 0,reject:void 0,response:null},v.response=(async()=>{if(l&&r==="image"){const $=await l(n);if($)return $}return!je&&n.startsWith("http")&&b.length?new Promise(($,K)=>{b[p.size&b.length-1].postMessage({rawUrl:n,...L}),v.resolve=$,v.reject=K}):fi(L)})().catch($=>{if(p.delete(n),r==="image"&&S)return e.log.warn("Failed to fetch image base64, trying to use placeholder image",i),typeof S=="string"?S:S(o);throw $}),p.set(n,v)}return v.response}async function an(e,t,n,r){if(!ln(e))return e;for(const[a,o]of gi(e,t))try{const i=await Fe(n,{url:o,requestType:r?"image":"text",responseType:"dataUrl"});e=e.replace(hi(a),`$1${i}$3`)}catch(i){n.log.warn("Failed to fetch css data url",a,i)}return e}function ln(e){return/url\((['"]?)([^'"]+?)\1\)/.test(e)}const cn=/url\((['"]?)([^'"]+?)\1\)/g;function gi(e,t){const n=[];return e.replace(cn,(r,a,o)=>(n.push([o,Yt(o,t)]),r)),n.filter(([r])=>!yt(r))}function hi(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}const pi=["background-image","border-image-source","-webkit-border-image","-webkit-mask-image","list-style-image"];function wi(e,t){return pi.map(n=>{const r=e.getPropertyValue(n);return!r||r==="none"?null:((je||bt)&&t.drawImageCount++,an(r,null,t,!0).then(a=>{!a||r===a||e.setProperty(n,a,e.getPropertyPriority(n))}))}).filter(Boolean)}function mi(e,t){if(be(e)){const n=e.currentSrc||e.src;if(!yt(n))return[Fe(t,{url:n,imageDom:e,requestType:"image",responseType:"dataUrl"}).then(r=>{r&&(e.srcset="",e.dataset.originalSrc=n,e.src=r||"")})];(je||bt)&&t.drawImageCount++}else if(Oe(e)&&!yt(e.href.baseVal)){const n=e.href.baseVal;return[Fe(t,{url:n,imageDom:e,requestType:"image",responseType:"dataUrl"}).then(r=>{r&&(e.dataset.originalSrc=n,e.href.baseVal=r||"")})]}return[]}function bi(e,t){const{ownerDocument:n,svgDefsElement:r}=t,a=e.getAttribute("href")??e.getAttribute("xlink:href");if(!a)return[];const[o,i]=a.split("#");if(i){const s=`#${i}`,d=t.shadowRoots.reduce((p,l)=>p??l.querySelector(`svg ${s}`),n?.querySelector(`svg ${s}`));if(o&&e.setAttribute("href",s),r?.querySelector(s))return[];if(d)return r?.appendChild(d.cloneNode(!0)),[];if(o)return[Fe(t,{url:o,responseType:"text"}).then(p=>{r?.insertAdjacentHTML("beforeend",p)})]}return[]}function dn(e,t){const{tasks:n}=t;X(e)&&((be(e)||Xt(e))&&n.push(...mi(e,t)),Tr(e)&&n.push(...bi(e,t))),_e(e)&&n.push(...wi(e.style,t)),e.childNodes.forEach(r=>{dn(r,t)})}async function yi(e,t){const{ownerDocument:n,svgStyleElement:r,fontFamilies:a,fontCssTexts:o,tasks:i,font:s}=t;if(!(!n||!r||!a.size))if(s&&s.cssText){const d=fn(s.cssText,t);r.appendChild(n.createTextNode(`${d}
16
- `))}else{const d=Array.from(n.styleSheets).filter(l=>{try{return"cssRules"in l&&!!l.cssRules.length}catch(m){return t.log.warn(`Error while reading CSS rules from ${l.href}`,m),!1}});await Promise.all(d.flatMap(l=>Array.from(l.cssRules).map(async(m,y)=>{if(Er(m)){let S=y+1;const C=m.href;let b="";try{b=await Fe(t,{url:C,requestType:"text",responseType:"text"})}catch(v){t.log.warn(`Error fetch remote css import from ${C}`,v)}const k=b.replace(cn,(v,I,T)=>v.replace(T,Yt(T,C)));for(const v of xi(k))try{l.insertRule(v,v.startsWith("@import")?S+=1:l.cssRules.length)}catch(I){t.log.warn("Error inserting rule from remote css import",{rule:v,error:I})}}}))),d.flatMap(l=>Array.from(l.cssRules)).filter(l=>kr(l)&&ln(l.style.getPropertyValue("src"))&&Qt(l.style.getPropertyValue("font-family"))?.some(m=>a.has(m))).forEach(l=>{const m=l,y=o.get(m.cssText);y?r.appendChild(n.createTextNode(`${y}
17
- `)):i.push(an(m.cssText,m.parentStyleSheet?m.parentStyleSheet.href:null,t).then(S=>{S=fn(S,t),o.set(m.cssText,S),r.appendChild(n.createTextNode(`${S}
18
- `))}))})}}const vi=/(\/\*[\s\S]*?\*\/)/g,un=/((@.*?keyframes [\s\S]*?){([\s\S]*?}\s*?)})/gi;function xi(e){if(e==null)return[];const t=[];let n=e.replace(vi,"");for(;;){const o=un.exec(n);if(!o)break;t.push(o[0])}n=n.replace(un,"");const r=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,a=new RegExp("((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})","gi");for(;;){let o=r.exec(n);if(o)a.lastIndex=r.lastIndex;else if(o=a.exec(n),o)r.lastIndex=a.lastIndex;else break;t.push(o[0])}return t}const Si=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,Ci=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function fn(e,t){const{font:n}=t,r=n?n?.preferredFormat:void 0;return r?e.replace(Ci,a=>{for(;;){const[o,,i]=Si.exec(a)||[];if(!i)return"";if(i===r)return`src: ${o};`}}):e}async function ki(e,t){const n=await Je(e,t);if(X(n.node)&&Oe(n.node))return n.node;const{ownerDocument:r,log:a,tasks:o,svgStyleElement:i,svgDefsElement:s,svgStyles:d,font:p,progress:l,autoDestruct:m,onCloneNode:y,onEmbedNode:S,onCreateForeignObjectSvg:C}=n;a.time("clone node");const b=await vt(n.node,n,!0);if(i&&r){let O="";d.forEach((L,$)=>{O+=`${L.join(`,
14
+ `);return n.appendChild(t),n}function Yr(e,n){let{width:t,height:r}=n;if(Q(e)&&(!t||!r)){const s=e.getBoundingClientRect();t=t||s.width||Number(e.getAttribute("width"))||0,r=r||s.height||Number(e.getAttribute("height"))||0}return{width:t,height:r}}async function Jr(e,n){const{log:t,timeout:r,drawImageCount:s,drawImageInterval:o}=n;t.time("image to canvas");const i=await Le(e,{timeout:r,onWarn:n.log.warn}),{canvas:a,context2d:d}=Qr(e.ownerDocument,n),h=()=>{try{d?.drawImage(i,0,0,a.width,a.height)}catch(l){n.log.warn("Failed to drawImage",l)}};if(h(),n.isEnable("fixSvgXmlDecode"))for(let l=0;l<s;l++)await new Promise(m=>{setTimeout(()=>{d?.clearRect(0,0,a.width,a.height),h(),m()},l+o)});return n.drawImageCount=0,t.timeEnd("image to canvas"),a}function Qr(e,n){const{width:t,height:r,scale:s,backgroundColor:o,maximumCanvasSize:i}=n,a=e.createElement("canvas");a.width=Math.floor(t*s),a.height=Math.floor(r*s),a.style.width=`${t}px`,a.style.height=`${r}px`,i&&(a.width>i||a.height>i)&&(a.width>i&&a.height>i?a.width>a.height?(a.height*=i/a.width,a.width=i):(a.width*=i/a.height,a.height=i):a.width>i?(a.height*=i/a.width,a.width=i):(a.width*=i/a.height,a.height=i));const d=a.getContext("2d");return d&&o&&(d.fillStyle=o,d.fillRect(0,0,a.width,a.height)),{canvas:a,context2d:d}}function rn(e,n){if(e.ownerDocument)try{const o=e.toDataURL();if(o!=="data:,")return ve(o,e.ownerDocument)}catch(o){n.log.warn("Failed to clone canvas",o)}const t=e.cloneNode(!1),r=e.getContext("2d"),s=t.getContext("2d");try{return r&&s&&s.putImageData(r.getImageData(0,0,e.width,e.height),0,0),t}catch(o){n.log.warn("Failed to clone canvas",o)}return t}function Kr(e,n){try{if(e?.contentDocument?.body)return vt(e.contentDocument.body,n)}catch(t){n.log.warn("Failed to clone iframe",t)}return e.cloneNode(!1)}function Zr(e){const n=e.cloneNode(!1);return e.currentSrc&&e.currentSrc!==e.src&&(n.src=e.currentSrc,n.srcset=""),n.loading==="lazy"&&(n.loading="eager"),n}async function ei(e,n){if(e.ownerDocument&&!e.currentSrc&&e.poster)return ve(e.poster,e.ownerDocument);const t=e.cloneNode(!1);t.crossOrigin="anonymous",e.currentSrc&&e.currentSrc!==e.src&&(t.src=e.currentSrc);const r=t.ownerDocument;if(r){let s=!0;if(await Le(t,{onError:()=>s=!1,onWarn:n.log.warn}),!s)return e.poster?ve(e.poster,e.ownerDocument):t;t.currentTime=e.currentTime,await new Promise(i=>{t.addEventListener("seeked",i,{once:!0})});const o=r.createElement("canvas");o.width=e.offsetWidth,o.height=e.offsetHeight;try{const i=o.getContext("2d");i&&i.drawImage(t,0,0,o.width,o.height)}catch(i){return n.log.warn("Failed to clone video",i),e.poster?ve(e.poster,e.ownerDocument):t}return rn(o,n)}return t}function ti(e,n){return Or(e)?rn(e,n):Br(e)?Kr(e,n):ye(e)?Zr(e):Xe(e)?ei(e,n):e.cloneNode(!1)}function ni(e){let n=e.sandbox;if(!n){const{ownerDocument:t}=e;try{t&&(n=t.createElement("iframe"),n.id=`__SANDBOX__${Zt()}`,n.width="0",n.height="0",n.style.visibility="hidden",n.style.position="fixed",t.body.appendChild(n),n.srcdoc='<!DOCTYPE html><meta charset="UTF-8"><title></title><body>',e.sandbox=n)}catch(r){e.log.warn("Failed to getSandBox",r)}}return n}const ri=["width","height","-webkit-text-fill-color"],ii=["stroke","fill"];function on(e,n,t){const{defaultComputedStyles:r}=t,s=e.nodeName.toLowerCase(),o=De(e)&&s!=="svg",i=o?ii.map(b=>[b,e.getAttribute(b)]).filter(([,b])=>b!==null):[],a=[o&&"svg",s,i.map((b,E)=>`${b}=${E}`).join(","),n].filter(Boolean).join(":");if(r.has(a))return r.get(a);const h=ni(t)?.contentWindow;if(!h)return new Map;const l=h?.document;let m,y;o?(m=l.createElementNS(Je,"svg"),y=m.ownerDocument.createElementNS(m.namespaceURI,s),i.forEach(([b,E])=>{y.setAttributeNS(null,b,E)}),m.appendChild(y)):m=y=l.createElement(s),y.textContent=" ",l.body.appendChild(m);const S=h.getComputedStyle(y,n),C=new Map;for(let b=S.length,E=0;E<b;E++){const v=S.item(E);ri.includes(v)||C.set(v,S.getPropertyValue(v))}return l.body.removeChild(m),r.set(a,C),C}function sn(e,n,t){const r=new Map,s=[],o=new Map;if(t)for(const a of t)i(a);else for(let a=e.length,d=0;d<a;d++){const h=e.item(d);i(h)}for(let a=s.length,d=0;d<a;d++)o.get(s[d])?.forEach((h,l)=>r.set(l,h));function i(a){const d=e.getPropertyValue(a),h=e.getPropertyPriority(a),l=a.lastIndexOf("-"),m=l>-1?a.substring(0,l):void 0;if(m){let y=o.get(m);y||(y=new Map,o.set(m,y)),y.set(a,[d,h])}n.get(a)===d&&!h||(m?s.push(m):r.set(a,[d,h]))}return r}function oi(e,n,t,r){const{ownerWindow:s,includeStyleProperties:o,currentParentNodeStyle:i}=r,a=n.style,d=s.getComputedStyle(e),h=on(e,null,r);i?.forEach((m,y)=>{h.delete(y)});const l=sn(d,h,o);l.delete("transition-property"),l.delete("all"),l.delete("d"),l.delete("content"),t&&(l.delete("margin-top"),l.delete("margin-right"),l.delete("margin-bottom"),l.delete("margin-left"),l.delete("margin-block-start"),l.delete("margin-block-end"),l.delete("margin-inline-start"),l.delete("margin-inline-end"),l.set("box-sizing",["border-box",""])),l.get("background-clip")?.[0]==="text"&&n.classList.add("______background-clip--text"),Jt&&(l.has("font-kerning")||l.set("font-kerning",["normal",""]),(l.get("overflow-x")?.[0]==="hidden"||l.get("overflow-y")?.[0]==="hidden")&&l.get("text-overflow")?.[0]==="ellipsis"&&e.scrollWidth===e.clientWidth&&l.set("text-overflow",["clip",""]));for(let m=a.length,y=0;y<m;y++)a.removeProperty(a.item(y));return l.forEach(([m,y],S)=>{a.setProperty(S,m,y)}),l}function si(e,n){(_r(e)||Dr(e)||Ur(e))&&n.setAttribute("value",e.value)}const ai=["::before","::after"],li=["::-webkit-scrollbar","::-webkit-scrollbar-button","::-webkit-scrollbar-thumb","::-webkit-scrollbar-track","::-webkit-scrollbar-track-piece","::-webkit-scrollbar-corner","::-webkit-resizer"];function ci(e,n,t,r,s){const{ownerWindow:o,svgStyleElement:i,svgStyles:a,currentNodeStyle:d}=r;if(!i||!o)return;function h(l){const m=o.getComputedStyle(e,l);let y=m.getPropertyValue("content");if(!y||y==="none")return;s?.(y),y=y.replace(/(')|(")|(counter\(.+\))/g,"");const S=[Zt()],C=on(e,l,r);d?.forEach((k,F)=>{C.delete(F)});const b=sn(m,C,r.includeStyleProperties);b.delete("content"),b.delete("-webkit-locale"),b.get("background-clip")?.[0]==="text"&&n.classList.add("______background-clip--text");const E=[`content: '${y}';`];if(b.forEach(([k,F],L)=>{E.push(`${L}: ${k}${F?" !important":""};`)}),E.length===1)return;try{n.className=[n.className,...S].join(" ")}catch(k){r.log.warn("Failed to copyPseudoClass",k);return}const v=E.join(`
15
+ `);let T=a.get(v);T||(T=[],a.set(v,T)),T.push(`.${S[0]}${l}`)}ai.forEach(h),t&&li.forEach(h)}const an=new Set(["symbol"]);async function ln(e,n,t,r,s){if(Q(t)&&(Fr(t)||Lr(t))||r.filter&&!r.filter(t))return;an.has(n.nodeName)||an.has(t.nodeName)?r.currentParentNodeStyle=void 0:r.currentParentNodeStyle=r.currentNodeStyle;const o=await vt(t,r,!1,s);r.isEnable("restoreScrollPosition")&&di(e,o),n.appendChild(o)}async function cn(e,n,t,r){let s=e.firstChild;Q(e)&&e.shadowRoot&&(s=e.shadowRoot?.firstChild,t.shadowRoots.push(e.shadowRoot));for(let o=s;o;o=o.nextSibling)if(!Nr(o))if(Q(o)&&zr(o)&&typeof o.assignedNodes=="function"){const i=o.assignedNodes();for(let a=0;a<i.length;a++)await ln(e,n,i[a],t,r)}else await ln(e,n,o,t,r)}function di(e,n){if(!Fe(e)||!Fe(n))return;const{scrollTop:t,scrollLeft:r}=e;if(!t&&!r)return;const{transform:s}=n.style,o=new DOMMatrix(s),{a:i,b:a,c:d,d:h}=o;o.a=1,o.b=0,o.c=0,o.d=1,o.translateSelf(-r,-t),o.a=i,o.b=a,o.c=d,o.d=h,n.style.transform=o.toString()}function ui(e,n){const{backgroundColor:t,width:r,height:s,style:o}=n,i=e.style;if(t&&i.setProperty("background-color",t,"important"),r&&i.setProperty("width",`${r}px`,"important"),s&&i.setProperty("height",`${s}px`,"important"),o)for(const a in o)i[a]=o[a]}const fi=/^[\w-:]+$/;async function vt(e,n,t=!1,r){const{ownerDocument:s,ownerWindow:o,fontFamilies:i,onCloneEachNode:a}=n;if(s&&Mr(e))return r&&/\S/.test(e.data)&&r(e.data),s.createTextNode(e.data);if(s&&o&&Q(e)&&(Fe(e)||De(e))){const h=await ti(e,n);if(n.isEnable("removeAbnormalAttributes")){const b=h.getAttributeNames();for(let E=b.length,v=0;v<E;v++){const T=b[v];fi.test(T)||h.removeAttribute(T)}}const l=n.currentNodeStyle=oi(e,h,t,n);t&&ui(h,n);let m=!1;if(n.isEnable("copyScrollbar")){const b=[l.get("overflow-x")?.[0],l.get("overflow-y")?.[0]];m=b.includes("scroll")||(b.includes("auto")||b.includes("overlay"))&&(e.scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth)}const y=l.get("text-transform")?.[0],S=en(l.get("font-family")?.[0]),C=S?b=>{y==="uppercase"?b=b.toUpperCase():y==="lowercase"?b=b.toLowerCase():y==="capitalize"&&(b=b[0].toUpperCase()+b.substring(1)),S.forEach(E=>{let v=i.get(E);v||i.set(E,v=new Set),b.split("").forEach(T=>v.add(T))})}:void 0;return ci(e,h,m,n,C),si(e,h),Xe(e)||await cn(e,h,n,C),await a?.(h),h}const d=e.cloneNode(!1);return await cn(e,d,n),await a?.(d),d}function gi(e){if(e.ownerDocument=void 0,e.ownerWindow=void 0,e.svgStyleElement=void 0,e.svgDefsElement=void 0,e.svgStyles.clear(),e.defaultComputedStyles.clear(),e.sandbox){try{e.sandbox.remove()}catch(n){e.log.warn("Failed to destroyContext",n)}e.sandbox=void 0}e.workers=[],e.fontFamilies.clear(),e.fontCssTexts.clear(),e.requests.clear(),e.tasks=[],e.shadowRoots=[]}function hi(e){const{url:n,timeout:t,responseType:r,...s}=e,o=new AbortController,i=t?setTimeout(()=>o.abort(),t):void 0;return fetch(n,{signal:o.signal,...s}).then(a=>{if(!a.ok)throw new Error("Failed fetch, not 2xx response",{cause:a});switch(r){case"arrayBuffer":return a.arrayBuffer();case"dataUrl":return a.blob().then(qr);default:return a.text()}}).finally(()=>clearTimeout(i))}function Ue(e,n){const{url:t,requestType:r="text",responseType:s="text",imageDom:o}=n;let i=t;const{timeout:a,acceptOfImage:d,requests:h,fetchFn:l,fetch:{requestInit:m,bypassingCache:y,placeholderImage:S},font:C,workers:b,fontFamilies:E}=e;r==="image"&&(Ge||bt)&&e.drawImageCount++;let v=h.get(t);if(!v){y&&y instanceof RegExp&&y.test(i)&&(i+=(/\?/.test(i)?"&":"?")+new Date().getTime());const T=r.startsWith("font")&&C&&C.minify,k=new Set;T&&r.split(";")[1].split(",").forEach(q=>{E.has(q)&&E.get(q).forEach(R=>k.add(R))});const F=T&&k.size,L={url:i,timeout:a,responseType:F?"arrayBuffer":s,headers:r==="image"?{accept:d}:void 0,...m};v={type:r,resolve:void 0,reject:void 0,response:null},v.response=(async()=>{if(l&&r==="image"){const z=await l(t);if(z)return z}return!Ge&&t.startsWith("http")&&b.length?new Promise((z,q)=>{b[h.size&b.length-1].postMessage({rawUrl:t,...L}),v.resolve=z,v.reject=q}):hi(L)})().catch(z=>{if(h.delete(t),r==="image"&&S)return e.log.warn("Failed to fetch image base64, trying to use placeholder image",i),typeof S=="string"?S:S(o);throw z}),h.set(t,v)}return v.response}async function dn(e,n,t,r){if(!un(e))return e;for(const[s,o]of pi(e,n))try{const i=await Ue(t,{url:o,requestType:r?"image":"text",responseType:"dataUrl"});e=e.replace(wi(s),`$1${i}$3`)}catch(i){t.log.warn("Failed to fetch css data url",s,i)}return e}function un(e){return/url\((['"]?)([^'"]+?)\1\)/.test(e)}const fn=/url\((['"]?)([^'"]+?)\1\)/g;function pi(e,n){const t=[];return e.replace(fn,(r,s,o)=>(t.push([o,Kt(o,n)]),r)),t.filter(([r])=>!yt(r))}function wi(e){const n=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${n})(['"]?\\))`,"g")}const mi=["background-image","border-image-source","-webkit-border-image","-webkit-mask-image","list-style-image"];function bi(e,n){return mi.map(t=>{const r=e.getPropertyValue(t);return!r||r==="none"?null:((Ge||bt)&&n.drawImageCount++,dn(r,null,n,!0).then(s=>{!s||r===s||e.setProperty(t,s,e.getPropertyPriority(t))}))}).filter(Boolean)}function yi(e,n){if(ye(e)){const t=e.currentSrc||e.src;if(!yt(t))return[Ue(n,{url:t,imageDom:e,requestType:"image",responseType:"dataUrl"}).then(r=>{r&&(e.srcset="",e.dataset.originalSrc=t,e.src=r||"")})];(Ge||bt)&&n.drawImageCount++}else if(De(e)&&!yt(e.href.baseVal)){const t=e.href.baseVal;return[Ue(n,{url:t,imageDom:e,requestType:"image",responseType:"dataUrl"}).then(r=>{r&&(e.dataset.originalSrc=t,e.href.baseVal=r||"")})]}return[]}function vi(e,n){const{ownerDocument:t,svgDefsElement:r}=n,s=e.getAttribute("href")??e.getAttribute("xlink:href");if(!s)return[];const[o,i]=s.split("#");if(i){const a=`#${i}`,d=n.shadowRoots.reduce((h,l)=>h??l.querySelector(`svg ${a}`),t?.querySelector(`svg ${a}`));if(o&&e.setAttribute("href",a),r?.querySelector(a))return[];if(d)return r?.appendChild(d.cloneNode(!0)),[];if(o)return[Ue(n,{url:o,responseType:"text"}).then(h=>{r?.insertAdjacentHTML("beforeend",h)})]}return[]}function gn(e,n){const{tasks:t}=n;Q(e)&&((ye(e)||Qt(e))&&t.push(...yi(e,n)),Ar(e)&&t.push(...vi(e,n))),Fe(e)&&t.push(...bi(e.style,n)),e.childNodes.forEach(r=>{gn(r,n)})}async function xi(e,n){const{ownerDocument:t,svgStyleElement:r,fontFamilies:s,fontCssTexts:o,tasks:i,font:a}=n;if(!(!t||!r||!s.size))if(a&&a.cssText){const d=pn(a.cssText,n);r.appendChild(t.createTextNode(`${d}
16
+ `))}else{const d=Array.from(t.styleSheets).filter(l=>{try{return"cssRules"in l&&!!l.cssRules.length}catch(m){return n.log.warn(`Error while reading CSS rules from ${l.href}`,m),!1}});await Promise.all(d.flatMap(l=>Array.from(l.cssRules).map(async(m,y)=>{if(Ir(m)){let S=y+1;const C=m.href;let b="";try{b=await Ue(n,{url:C,requestType:"text",responseType:"text"})}catch(v){n.log.warn(`Error fetch remote css import from ${C}`,v)}const E=b.replace(fn,(v,T,k)=>v.replace(k,Kt(k,C)));for(const v of Ci(E))try{l.insertRule(v,v.startsWith("@import")?S+=1:l.cssRules.length)}catch(T){n.log.warn("Error inserting rule from remote css import",{rule:v,error:T})}}}))),d.flatMap(l=>Array.from(l.cssRules)).filter(l=>Tr(l)&&un(l.style.getPropertyValue("src"))&&en(l.style.getPropertyValue("font-family"))?.some(m=>s.has(m))).forEach(l=>{const m=l,y=o.get(m.cssText);y?r.appendChild(t.createTextNode(`${y}
17
+ `)):i.push(dn(m.cssText,m.parentStyleSheet?m.parentStyleSheet.href:null,n).then(S=>{S=pn(S,n),o.set(m.cssText,S),r.appendChild(t.createTextNode(`${S}
18
+ `))}))})}}const Si=/(\/\*[\s\S]*?\*\/)/g,hn=/((@.*?keyframes [\s\S]*?){([\s\S]*?}\s*?)})/gi;function Ci(e){if(e==null)return[];const n=[];let t=e.replace(Si,"");for(;;){const o=hn.exec(t);if(!o)break;n.push(o[0])}t=t.replace(hn,"");const r=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,s=new RegExp("((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})","gi");for(;;){let o=r.exec(t);if(o)s.lastIndex=r.lastIndex;else if(o=s.exec(t),o)r.lastIndex=s.lastIndex;else break;n.push(o[0])}return n}const ki=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,Ei=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function pn(e,n){const{font:t}=n,r=t?t?.preferredFormat:void 0;return r?e.replace(Ei,s=>{for(;;){const[o,,i]=ki.exec(s)||[];if(!i)return"";if(i===r)return`src: ${o};`}}):e}async function Ti(e,n){const t=await Qe(e,n);if(Q(t.node)&&De(t.node))return t.node;const{ownerDocument:r,log:s,tasks:o,svgStyleElement:i,svgDefsElement:a,svgStyles:d,font:h,progress:l,autoDestruct:m,onCloneNode:y,onEmbedNode:S,onCreateForeignObjectSvg:C}=t;s.time("clone node");const b=await vt(t.node,t,!0);if(i&&r){let F="";d.forEach((L,z)=>{F+=`${L.join(`,
19
19
  `)} {
20
- ${$}
20
+ ${z}
21
21
  }
22
- `}),i.appendChild(r.createTextNode(O))}a.timeEnd("clone node"),await y?.(b),p!==!1&&X(b)&&(a.time("embed web font"),await yi(b,n),a.timeEnd("embed web font")),a.time("embed node"),dn(b,n);const k=o.length;let v=0;const I=async()=>{for(;;){const O=o.pop();if(!O)break;try{await O}catch(L){n.log.warn("Failed to run task",L)}l?.(++v,k)}};l?.(v,k),await Promise.all([...Array.from({length:4})].map(I)),a.timeEnd("embed node"),await S?.(b);const T=Ei(b,n);return s&&T.insertBefore(s,T.children[0]),i&&T.insertBefore(i,T.children[0]),m&&ui(n),await C?.(T),T}function Ei(e,t){const{width:n,height:r}=t,a=Pr(n,r,e.ownerDocument),o=a.ownerDocument.createElementNS(a.namespaceURI,"foreignObject");return o.setAttributeNS(null,"x","0%"),o.setAttributeNS(null,"y","0%"),o.setAttributeNS(null,"width","100%"),o.setAttributeNS(null,"height","100%"),o.append(e),a.appendChild(o),a}async function Ti(e,t){const n=await Je(e,t),r=await ki(n),a=Hr(r,n.isEnable("removeControlCharacter"));n.autoDestruct||(n.svgStyleElement=Zt(n.ownerDocument),n.svgDefsElement=n.ownerDocument?.createElementNS(Ye,"defs"),n.svgStyles.clear());const o=ye(a,r.ownerDocument);return await Xr(o,n)}async function Ii(e,t){const n=await Je(e,t),{log:r,quality:a,type:o,dpi:i}=n,s=await Ti(n);r.time("canvas to data url");let d=s.toDataURL(o,a);if(["image/png","image/jpeg"].includes(o)&&i&&xr&&Sr){const[p,l]=d.split(",");let m=0,y=!1;if(o==="image/png"){const T=yr(l);T>=0?(m=Math.ceil((T+28)/3)*4,y=!0):m=33/3*4}else o==="image/jpeg"&&(m=18/3*4);const S=l.substring(0,m),C=l.substring(m),b=window.atob(S),k=new Uint8Array(b.length);for(let T=0;T<k.length;T++)k[T]=b.charCodeAt(T);const v=o==="image/png"?pr(k,i,y):ur(k,i),I=window.btoa(String.fromCharCode(...v));d=[p,",",I,C].join("")}return r.timeEnd("canvas to data url"),d}async function Ai(e,t){return Ii(await Je(e,{...t,type:"image/png"}))}const Ni=async(e,t)=>{console.log("[Screenshot] Starting capture with 3-tier fallback strategy");try{console.log("[Screenshot] Tier 1: Attempting canvas-based capture...");const n=await dr(e,{},t);if(n)return console.log("[Screenshot] Tier 1 successful - canvas-based capture"),n;console.warn("[Screenshot] Tier 1 failed, falling back to Tier 2")}catch(n){console.warn("[Screenshot] Tier 1 error:",n)}try{console.log("[Screenshot] Tier 2: Attempting modern-screenshot...");const n=document.documentElement,r=e?e.x:0,a=e?e.y:0,o=e?e.width:window.innerWidth,i=e?e.height:window.innerHeight,s=window.scrollX,d=window.scrollY,p=s+r,l=d+a,m=await Ai(n,{quality:.9,width:o,height:i,style:{transform:`translate(${-p}px, ${-l}px)`}});return console.log("[Screenshot] Tier 2 successful - modern-screenshot"),m}catch(n){console.error("[Screenshot] Tier 2 failed:",n)}return console.error("[Screenshot] All capture methods failed"),null};const Mi=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Oi=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),gn=e=>{const t=Oi(e);return t.charAt(0).toUpperCase()+t.slice(1)},hn=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),_i=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var Di={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const Fi=A.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:a="",children:o,iconNode:i,...s},d)=>A.createElement("svg",{ref:d,...Di,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:hn("lucide",a),...!o&&!_i(s)&&{"aria-hidden":"true"},...s},[...i.map(([p,l])=>A.createElement(p,l)),...Array.isArray(o)?o:[o]]));const se=(e,t)=>{const n=A.forwardRef(({className:r,...a},o)=>A.createElement(Fi,{ref:o,iconNode:t,className:hn(`lucide-${Mi(gn(e))}`,`lucide-${e}`,r),...a}));return n.displayName=gn(e),n};const Li=se("crop",[["path",{d:"M6 2v14a2 2 0 0 0 2 2h14",key:"ron5a4"}],["path",{d:"M18 22V8a2 2 0 0 0-2-2H2",key:"7s9ehn"}]]);const pn=se("hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]);const Ui=se("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);const zi=se("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);const Bi=se("message-square-plus",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M12 8v6",key:"1ib9pf"}],["path",{d:"M9 11h6",key:"1fldmi"}]]);const Pi=se("monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);const Hi=se("text-align-start",[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M17 19H3",key:"z6ezky"}]]);const wn=se("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),$i=({onConfirm:e,onCancel:t})=>{const[n,r]=A.useState(!1),[a,o]=A.useState({x:0,y:0}),[i,s]=A.useState({x:0,y:0}),[d,p]=A.useState(!1);A.useEffect(()=>(d?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[d]);const l=v=>{r(!0),o({x:v.clientX,y:v.clientY}),s({x:v.clientX,y:v.clientY})},m=v=>{n&&s({x:v.clientX,y:v.clientY})},y=()=>{k()},S=v=>{if(v.touches.length===1){r(!0);const I=v.touches[0];o({x:I.clientX,y:I.clientY}),s({x:I.clientX,y:I.clientY}),p(!0)}},C=v=>{if(n&&v.touches.length===1){const I=v.touches[0];s({x:I.clientX,y:I.clientY})}},b=()=>{k(),p(!1)},k=()=>{if(n){r(!1);const v=Math.min(a.x,i.x),I=Math.min(a.y,i.y),T=Math.abs(i.x-a.x),O=Math.abs(i.y-a.y);T>10&&O>10&&e({x:v,y:I,width:T,height:O})}};return A.useEffect(()=>{const v=I=>{I.key==="Escape"&&t()};return window.addEventListener("keydown",v),()=>window.removeEventListener("keydown",v)},[t]),w.jsxs("div",{style:{position:"fixed",inset:0,zIndex:99999,cursor:"crosshair",userSelect:"none"},onMouseDown:l,onMouseMove:m,onMouseUp:y,onTouchStart:S,onTouchMove:C,onTouchEnd:b,children:[w.jsx("div",{style:{position:"absolute",inset:0,backgroundColor:"rgba(0, 0, 0, 0.4)"}}),!n&&w.jsx("div",{style:{position:"absolute",top:"20px",left:"50%",transform:"translateX(-50%)",background:"rgba(0,0,0,0.8)",color:"white",padding:"8px 16px",borderRadius:"20px",pointerEvents:"none",fontSize:"14px"},children:"Kéo chuột hoặc chạm để chọn vùng chụp ảnh (ESC để hủy)"}),n&&w.jsx("div",{style:{position:"absolute",left:Math.min(a.x,i.x),top:Math.min(a.y,i.y),width:Math.abs(i.x-a.x),height:Math.abs(i.y-a.y),border:"2px solid #fff",backgroundColor:"rgba(255, 255, 255, 0.1)",boxShadow:"0 0 0 9999px rgba(0, 0, 0, 0.5)"}})]})},mn=({questionId:e,contextData:t,onSubmit:n,themeColor:r="#3b82f6",triggerComponent:a,isOpen:o,onOpen:i,onClose:s,isEnableCaptureFull:d=!0,isEnableCaptureElement:p=!0})=>{const[l,m]=A.useState(!1),[y,S]=A.useState(""),[C,b]=A.useState(e),[k,v]=A.useState(t?.questionIdChild||""),[I,T]=A.useState([]),[O,L]=A.useState(null),[$,K]=A.useState(!1),[F,V]=A.useState(!1),[ae,Qe]=A.useState(!1),[Z,ve]=A.useState(null),[P,xe]=A.useState({}),[yn,Ke]=A.useState("incorrect_content"),[Vi,xt]=A.useState(!1),vn=A.useRef(null),St=o!==void 0?o:l,Ri=St&&!Vi;A.useEffect(()=>{St&&(xe({}),b(e),v(t?.questionIdChild||""),T([]),S(""),Ke("incorrect_content"))},[St,e,t]);const ji=()=>{if(I.length>=3){alert("Bạn chỉ có thể chụp tối đa 3 ảnh.");return}vn.current?.click()},Gi=x=>{const M=x.target.files?.[0];if(!M)return;if(!M.type.startsWith("image/")){alert("Vui lòng chọn file ảnh.");return}if(M.size>5*1024*1024){alert("Ảnh quá lớn. Vui lòng chọn ảnh dưới 5MB.");return}const ee=new FileReader;ee.onload=Ze=>{const et=Ze.target?.result;et&&T(Cn=>[...Cn,et])},ee.readAsDataURL(M),x.target.value=""},Xi=()=>{T([]),S(""),b(e),v(t?.questionIdChild||""),Ke("incorrect_content"),xe({}),o===void 0&&m(!0)},xn=async x=>{if(console.log("click capture",performance.now()),I.length>=3){alert("Bạn chỉ có thể chụp tối đa 3 ảnh.");return}if(xt(!0),x==="crop"){setTimeout(()=>Qe(!0),150);return}setTimeout(async()=>{await Sn()},150)},Sn=async x=>{console.log("performCapture start",performance.now()),K(!0);try{const M=await Ni(x);console.log("performCapture end",performance.now()),M?T(ee=>[...ee,M]):alert("Không thể chụp ảnh màn hình. Vui lòng thử lại.")}catch(M){console.error(M)}finally{K(!1),xt(!1)}},Yi=x=>{Qe(!1),Sn(x)},Ji=()=>{Qe(!1),xt(!1)},Qi=x=>{T(M=>M.filter((ee,Ze)=>Ze!==x))},Ct=()=>{s&&s(),m(!1),T([]),Qe(!1),L(null),S(""),xe({}),Ke("incorrect_content")},Ki=async()=>{const x={};if(C?isNaN(Number(C))&&(x.questionId="ID câu hỏi phải là số"):x.questionId="Vui lòng nhập ID câu hỏi",k&&isNaN(Number(k))&&(x.questionIdChild="ID câu hỏi con phải là số"),y.trim()||(x.description="Vui lòng nhập mô tả lỗi"),Object.keys(x).length>0){xe(x);return}V(!0);try{const M=zn(),ee=await Promise.all(I.map(async et=>(await(await fetch("https://lcms.icanwork.vn/api/upload-to-s3/upload-image-error-to-s3",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({base64:et})})).json()).file_url));await n({idQuestion:C,idChildQuestion:k,errorType:yn,errorDescription:y,listImage:ee,deviceInfo:M,contextData:t}),Ct()}catch(M){console.error("Submit feedback failed",M)}finally{V(!1)}};return w.jsxs(w.Fragment,{children:[w.jsx("style",{id:"feedback-widget-styles",children:`
22
+ `}),i.appendChild(r.createTextNode(F))}s.timeEnd("clone node"),await y?.(b),h!==!1&&Q(b)&&(s.time("embed web font"),await xi(b,t),s.timeEnd("embed web font")),s.time("embed node"),gn(b,t);const E=o.length;let v=0;const T=async()=>{for(;;){const F=o.pop();if(!F)break;try{await F}catch(L){t.log.warn("Failed to run task",L)}l?.(++v,E)}};l?.(v,E),await Promise.all([...Array.from({length:4})].map(T)),s.timeEnd("embed node"),await S?.(b);const k=Ii(b,t);return a&&k.insertBefore(a,k.children[0]),i&&k.insertBefore(i,k.children[0]),m&&gi(t),await C?.(k),k}function Ii(e,n){const{width:t,height:r}=n,s=Vr(t,r,e.ownerDocument),o=s.ownerDocument.createElementNS(s.namespaceURI,"foreignObject");return o.setAttributeNS(null,"x","0%"),o.setAttributeNS(null,"y","0%"),o.setAttributeNS(null,"width","100%"),o.setAttributeNS(null,"height","100%"),o.append(e),s.appendChild(o),s}async function Ai(e,n){const t=await Qe(e,n),r=await Ti(t),s=$r(r,t.isEnable("removeControlCharacter"));t.autoDestruct||(t.svgStyleElement=nn(t.ownerDocument),t.svgDefsElement=t.ownerDocument?.createElementNS(Je,"defs"),t.svgStyles.clear());const o=ve(s,r.ownerDocument);return await Jr(o,t)}async function Ni(e,n){const t=await Qe(e,n),{log:r,quality:s,type:o,dpi:i}=t,a=await Ai(t);r.time("canvas to data url");let d=a.toDataURL(o,s);if(["image/png","image/jpeg"].includes(o)&&i&&Cr&&kr){const[h,l]=d.split(",");let m=0,y=!1;if(o==="image/png"){const k=xr(l);k>=0?(m=Math.ceil((k+28)/3)*4,y=!0):m=33/3*4}else o==="image/jpeg"&&(m=18/3*4);const S=l.substring(0,m),C=l.substring(m),b=window.atob(S),E=new Uint8Array(b.length);for(let k=0;k<E.length;k++)E[k]=b.charCodeAt(k);const v=o==="image/png"?mr(E,i,y):gr(E,i),T=window.btoa(String.fromCharCode(...v));d=[h,",",T,C].join("")}return r.timeEnd("canvas to data url"),d}async function Mi(e,n){return Ni(await Qe(e,{...n,type:"image/png"}))}const wn=async(e,n)=>{console.log("[Screenshot] Starting capture with 3-tier fallback strategy");try{console.log("[Screenshot] Tier 1: Attempting canvas-based capture...");const t=await fr(e,{},n);if(t)return console.log("[Screenshot] Tier 1 successful - canvas-based capture"),t;console.warn("[Screenshot] Tier 1 failed, falling back to Tier 2")}catch(t){console.warn("[Screenshot] Tier 1 error:",t)}try{console.log("[Screenshot] Tier 2: Attempting modern-screenshot...");const t=()=>window.visualViewport?window.visualViewport.width:document.documentElement.clientWidth||window.innerWidth,r=()=>window.visualViewport?window.visualViewport.height:document.documentElement.clientHeight||window.innerHeight,s=document.documentElement,o=e?e.x:0,i=e?e.y:0,a=e?e.width:t(),d=e?e.height:r(),h=window.scrollX,l=window.scrollY,m=h+o,y=l+i,S=await Mi(s,{quality:.9,width:a,height:d,style:{transform:`translate(${-m}px, ${-y}px)`}});return console.log("[Screenshot] Tier 2 successful - modern-screenshot"),S}catch(t){console.error("[Screenshot] Tier 2 failed:",t)}return console.error("[Screenshot] All capture methods failed"),null};const Oi=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),_i=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(n,t,r)=>r?r.toUpperCase():t.toLowerCase()),mn=e=>{const n=_i(e);return n.charAt(0).toUpperCase()+n.slice(1)},bn=(...e)=>e.filter((n,t,r)=>!!n&&n.trim()!==""&&r.indexOf(n)===t).join(" ").trim(),Di=e=>{for(const n in e)if(n.startsWith("aria-")||n==="role"||n==="title")return!0};var Fi={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const Li=A.forwardRef(({color:e="currentColor",size:n=24,strokeWidth:t=2,absoluteStrokeWidth:r,className:s="",children:o,iconNode:i,...a},d)=>A.createElement("svg",{ref:d,...Fi,width:n,height:n,stroke:e,strokeWidth:r?Number(t)*24/Number(n):t,className:bn("lucide",s),...!o&&!Di(a)&&{"aria-hidden":"true"},...a},[...i.map(([h,l])=>A.createElement(h,l)),...Array.isArray(o)?o:[o]]));const ae=(e,n)=>{const t=A.forwardRef(({className:r,...s},o)=>A.createElement(Li,{ref:o,iconNode:n,className:bn(`lucide-${Oi(mn(e))}`,`lucide-${e}`,r),...s}));return t.displayName=mn(e),t};const Ui=ae("crop",[["path",{d:"M6 2v14a2 2 0 0 0 2 2h14",key:"ron5a4"}],["path",{d:"M18 22V8a2 2 0 0 0-2-2H2",key:"7s9ehn"}]]);const yn=ae("hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]);const zi=ae("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);const Bi=ae("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);const Pi=ae("message-square-plus",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M12 8v6",key:"1ib9pf"}],["path",{d:"M9 11h6",key:"1fldmi"}]]);const Hi=ae("monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);const Vi=ae("text-align-start",[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M17 19H3",key:"z6ezky"}]]);const vn=ae("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),$i=({onConfirm:e,onCancel:n})=>{const[t,r]=A.useState(!1),[s,o]=A.useState({x:0,y:0}),[i,a]=A.useState({x:0,y:0}),[d,h]=A.useState(!1);A.useEffect(()=>(d?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[d]);const l=v=>{r(!0),o({x:v.clientX,y:v.clientY}),a({x:v.clientX,y:v.clientY})},m=v=>{t&&a({x:v.clientX,y:v.clientY})},y=()=>{E()},S=v=>{if(v.touches.length===1){r(!0);const T=v.touches[0];o({x:T.clientX,y:T.clientY}),a({x:T.clientX,y:T.clientY}),h(!0)}},C=v=>{if(t&&v.touches.length===1){const T=v.touches[0];a({x:T.clientX,y:T.clientY})}},b=()=>{E(),h(!1)},E=()=>{if(t){r(!1);const v=Math.min(s.x,i.x),T=Math.min(s.y,i.y),k=Math.abs(i.x-s.x),F=Math.abs(i.y-s.y);k>10&&F>10&&e({x:v,y:T,width:k,height:F})}};return A.useEffect(()=>{const v=T=>{T.key==="Escape"&&n()};return window.addEventListener("keydown",v),()=>window.removeEventListener("keydown",v)},[n]),w.jsxs("div",{style:{position:"fixed",inset:0,zIndex:99999,cursor:"crosshair",userSelect:"none"},onMouseDown:l,onMouseMove:m,onMouseUp:y,onTouchStart:S,onTouchMove:C,onTouchEnd:b,children:[w.jsx("div",{style:{position:"absolute",inset:0,backgroundColor:"rgba(0, 0, 0, 0.4)"}}),!t&&w.jsx("div",{style:{position:"absolute",top:"20px",left:"50%",transform:"translateX(-50%)",background:"rgba(0,0,0,0.8)",color:"white",padding:"8px 16px",borderRadius:"20px",pointerEvents:"none",fontSize:"14px"},children:"Kéo chuột hoặc chạm để chọn vùng chụp ảnh (ESC để hủy)"}),t&&w.jsx("div",{style:{position:"absolute",left:Math.min(s.x,i.x),top:Math.min(s.y,i.y),width:Math.abs(i.x-s.x),height:Math.abs(i.y-s.y),border:"2px solid #fff",backgroundColor:"rgba(255, 255, 255, 0.1)",boxShadow:"0 0 0 9999px rgba(0, 0, 0, 0.5)"}})]})},xn=({questionId:e,contextData:n,onSubmit:t,themeColor:r="#3b82f6",triggerComponent:s,isOpen:o,onOpen:i,onClose:a,isEnableCaptureFull:d=!0,isEnableCaptureElement:h=!0})=>{const[l,m]=A.useState(!1),[y,S]=A.useState(""),[C,b]=A.useState(e),[E,v]=A.useState(n?.questionIdChild||""),[T,k]=A.useState([]),[F,L]=A.useState(null),[z,q]=A.useState(!1),[R,xe]=A.useState(!1),[M,U]=A.useState(!1),[P,Se]=A.useState(null),[$,Ce]=A.useState({}),[Cn,Ke]=A.useState("incorrect_content"),[Ri,xt]=A.useState(!1),kn=A.useRef(null),St=o!==void 0?o:l,ji=St&&!Ri;A.useEffect(()=>{St&&(Ce({}),b(e),v(n?.questionIdChild||""),k([]),S(""),Ke("incorrect_content"))},[St,e,n]);const Gi=()=>{if(T.length>=3){alert("Bạn chỉ có thể chụp tối đa 3 ảnh.");return}kn.current?.click()},Xi=x=>{const O=x.target.files?.[0];if(!O)return;if(!O.type.startsWith("image/")){alert("Vui lòng chọn file ảnh.");return}if(O.size>5*1024*1024){alert("Ảnh quá lớn. Vui lòng chọn ảnh dưới 5MB.");return}const te=new FileReader;te.onload=Ze=>{const et=Ze.target?.result;et&&k(In=>[...In,et])},te.readAsDataURL(O),x.target.value=""},Yi=()=>{k([]),S(""),b(e),v(n?.questionIdChild||""),Ke("incorrect_content"),Ce({}),o===void 0&&m(!0)},En=async x=>{if(console.log("click capture",performance.now()),T.length>=3){alert("Bạn chỉ có thể chụp tối đa 3 ảnh.");return}if(xt(!0),x==="crop"){setTimeout(()=>U(!0),150);return}setTimeout(async()=>{await Tn()},150)},Tn=async x=>{console.log("performCapture start",performance.now()),q(!0);try{const O=await wn(x);console.log("performCapture end",performance.now()),O?k(te=>[...te,O]):alert("Không thể chụp ảnh màn hình. Vui lòng thử lại.")}catch(O){console.error(O)}finally{q(!1),xt(!1)}},Ji=x=>{U(!1),Tn(x)},Qi=()=>{U(!1),xt(!1)},Ki=x=>{k(O=>O.filter((te,Ze)=>Ze!==x))},Ct=()=>{a&&a(),m(!1),k([]),U(!1),L(null),S(""),Ce({}),Ke("incorrect_content")},Zi=async()=>{const x={};if(C?isNaN(Number(C))&&(x.questionId="ID câu hỏi phải là số"):x.questionId="Vui lòng nhập ID câu hỏi",E&&isNaN(Number(E))&&(x.questionIdChild="ID câu hỏi con phải là số"),y.trim()||(x.description="Vui lòng nhập mô tả lỗi"),Object.keys(x).length>0){Ce(x);return}xe(!0);try{const O=Vn(),te=await Promise.all(T.map(async et=>(await(await fetch("https://lcms.icanwork.vn/api/upload-to-s3/upload-image-error-to-s3",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({base64:et})})).json()).file_url));await t({idQuestion:C,idChildQuestion:E,errorType:Cn,errorDescription:y,listImage:te,deviceInfo:O,contextData:n}),Ct()}catch(O){console.error("Submit feedback failed",O)}finally{xe(!1)}};return w.jsxs(w.Fragment,{children:[w.jsx("style",{id:"feedback-widget-styles",children:`
23
23
  @keyframes fb-fade-in {
24
24
  from { opacity: 0; transform: translateY(10px); }
25
25
  to { opacity: 1; transform: translateY(0); }
@@ -81,4 +81,4 @@
81
81
 
82
82
  }
83
83
  }
84
- `}),ae&&w.jsx($i,{onConfirm:Yi,onCancel:Ji}),O&&w.jsx("div",{style:{position:"fixed",inset:0,backgroundColor:"rgba(0,0,0,0.8)",zIndex:1e4,display:"flex",alignItems:"center",justifyContent:"center",cursor:"zoom-out",animation:"fb-fade-in 0.2s ease-out",backdropFilter:"blur(4px)"},onClick:()=>L(null),children:w.jsx("img",{src:O,alt:"Zoomed",draggable:!1,onContextMenu:x=>x.preventDefault(),style:{maxWidth:"90vw",maxHeight:"90vh",objectFit:"contain",borderRadius:"8px",boxShadow:"0 20px 25px -5px rgba(0, 0, 0, 0.1)",backgroundColor:"white",userSelect:"none",WebkitUserSelect:"none"}})}),w.jsx("div",{onClick:()=>{o===void 0?Xi():i&&i()},style:{cursor:"pointer",display:"inline-block"},children:a||w.jsx("button",{className:"fb-widget-trigger",style:{position:"fixed",bottom:"24px",right:"24px",backgroundColor:r,color:"white",border:"none",borderRadius:"50%",width:"48px",height:"48px",display:"flex",alignItems:"center",justifyContent:"center",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",cursor:"pointer",zIndex:9990,transition:"transform 0.2s"},title:"Báo lỗi",onMouseEnter:x=>x.currentTarget.style.transform="scale(1.1)",onMouseLeave:x=>x.currentTarget.style.transform="scale(1)",children:w.jsx(Bi,{size:24})})}),$&&w.jsx("div",{style:{position:"fixed",top:20,right:20,background:"rgba(0,0,0,0.8)",color:"white",padding:"8px 12px",borderRadius:"8px",zIndex:1e4,fontWeight:500,backdropFilter:"blur(4px)",fontSize:"0.8rem"},children:"Đang chụp..."}),Ri&&!ae&&!O&&w.jsxs("div",{className:"fb-widget-modal",children:[w.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[w.jsx("h2",{style:{margin:0,fontSize:"1rem",fontWeight:700,color:"#111827"},children:"Báo lỗi"}),w.jsx("button",{onClick:Ct,style:{background:"transparent",border:"none",cursor:"pointer",color:"#6b7280",padding:"4px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"50%",transition:"background-color 0.2s"},onMouseEnter:x=>x.currentTarget.style.backgroundColor="#f3f4f6",onMouseLeave:x=>x.currentTarget.style.backgroundColor="transparent",children:w.jsx(wn,{size:18})})]}),w.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"10px"},children:[w.jsxs("div",{children:[w.jsxs("label",{style:{display:"block",marginBottom:"2px",fontSize:"0.8rem",fontWeight:600,color:"#374151"},children:["ID Câu hỏi ",t?.questionIdChild?"bài đọc":""," ",w.jsx("span",{style:{color:"#ef4444"},children:"*"})]}),w.jsxs("div",{style:{position:"relative",display:"flex",alignItems:"center",transition:"all 0.2s"},children:[w.jsx(pn,{size:12,style:{position:"absolute",left:"10px",color:Z==="id"?r:P.questionId?"#ef4444":"#9ca3af",transition:"color 0.2s",pointerEvents:"none"}}),w.jsx("input",{type:"text",value:C,onFocus:()=>ve("id"),onBlur:()=>ve(null),onChange:x=>{b(x.target.value),P.questionId&&xe(M=>({...M,questionId:void 0}))},disabled:!!e,placeholder:"Nhập ID (ví dụ: 101)",style:{width:"100%",padding:"6px 10px 6px 28px",borderRadius:"6px",border:`1px solid ${P.questionId?"#ef4444":Z==="id"?r:"#e5e7eb"}`,boxShadow:Z==="id"?`0 0 0 2px ${r}20`:"none",outline:"none",fontSize:"0.85rem",color:"#1f2937",transition:"all 0.2s",backgroundColor:"#f9fafb"}})]}),P.questionId&&w.jsx("span",{style:{display:"block",marginTop:"2px",fontSize:"0.7rem",color:"#ef4444"},children:P.questionId})]}),t?.questionIdChild?w.jsxs("div",{children:[w.jsx("label",{style:{display:"block",marginBottom:"2px",fontSize:"0.8rem",fontWeight:600,color:"#374151"},children:"ID Câu hỏi"}),w.jsxs("div",{style:{position:"relative",display:"flex",alignItems:"center",transition:"all 0.2s"},children:[w.jsx(pn,{size:12,style:{position:"absolute",left:"10px",color:Z==="idChild"?r:P.questionIdChild?"#ef4444":"#9ca3af",transition:"color 0.2s",pointerEvents:"none"}}),w.jsx("input",{type:"text",value:k,onFocus:()=>ve("idChild"),onBlur:()=>ve(null),onChange:x=>{v(x.target.value)},placeholder:"Nhập ID (ví dụ: 101)",disabled:!!t?.questionIdChild,style:{width:"100%",padding:"6px 10px 6px 28px",borderRadius:"6px",border:`1px solid ${P.questionIdChild?"#ef4444":Z==="idChild"?r:"#e5e7eb"}`,boxShadow:Z==="idChild"?`0 0 0 2px ${r}20`:"none",outline:"none",fontSize:"0.85rem",color:"#1f2937",transition:"all 0.2s",backgroundColor:"#f9fafb"}})]}),P.questionIdChild&&w.jsx("span",{style:{display:"block",marginTop:"2px",fontSize:"0.7rem",color:"#ef4444"},children:P.questionIdChild})]}):w.jsx(w.Fragment,{}),w.jsxs("div",{children:[w.jsxs("label",{style:{display:"block",marginBottom:"2px",fontSize:"0.8rem",fontWeight:600,color:"#374151"},children:["Loại lỗi ",w.jsx("span",{style:{color:"#ef4444"},children:"*"})]}),w.jsxs("select",{value:yn,onChange:x=>Ke(x.target.value),style:{width:"100%",padding:"6px 10px",borderRadius:"6px",border:"1px solid #e5e7eb",backgroundColor:"#f9fafb",fontSize:"0.85rem",color:"#1f2937",outline:"none",cursor:"pointer",appearance:"none",backgroundImage:`url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'/%3e%3c/svg%3e")`,backgroundRepeat:"no-repeat",backgroundPosition:"right 10px center",backgroundSize:"14px"},children:[w.jsx("option",{value:"incorrect_content",children:"Lỗi nội dung"}),w.jsx("option",{value:"display_error",children:"Lỗi hiển thị"}),w.jsx("option",{value:"missing_data",children:"Thiếu thông tin"}),w.jsx("option",{value:"technical_issue",children:"Lỗi kỹ thuật"}),w.jsx("option",{value:"other",children:"Khác"})]})]}),w.jsxs("div",{children:[w.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"2px"},children:[w.jsxs("label",{style:{fontSize:"0.8rem",fontWeight:600,color:"#374151"},children:["Mô tả lỗi ",w.jsx("span",{style:{color:"#ef4444"},children:"*"})]}),w.jsxs("span",{style:{fontSize:"0.7rem",color:"#9ca3af"},children:[y.length,"/1000"]})]}),w.jsxs("div",{style:{position:"relative"},children:[w.jsx("div",{style:{position:"absolute",left:"10px",top:"8px",pointerEvents:"none"},children:w.jsx(Hi,{size:12,style:{color:Z==="desc"?r:P.description?"#ef4444":"#9ca3af",transition:"color 0.2s"}})}),w.jsx("textarea",{value:y,onFocus:()=>ve("desc"),onBlur:()=>ve(null),onChange:x=>{S(x.target.value),P.description&&xe(M=>({...M,description:void 0}))},maxLength:1e3,placeholder:"Mô tả chi tiết...",style:{width:"100%",minHeight:"80px",padding:"6px 10px 6px 28px",borderRadius:"6px",border:`1px solid ${P.description?"#ef4444":Z==="desc"?r:"#e5e7eb"}`,boxShadow:Z==="desc"?`0 0 0 2px ${r}20`:"none",outline:"none",fontSize:"0.85rem",color:"#1f2937",resize:"vertical",boxSizing:"border-box",transition:"all 0.2s",backgroundColor:"#f9fafb",lineHeight:"1.4",fontFamily:"inherit"}})]}),P.description&&w.jsx("span",{style:{display:"block",marginTop:"2px",fontSize:"0.7rem",color:"#ef4444"},children:P.description})]})]}),w.jsxs("div",{style:{marginBottom:"2px"},children:[w.jsx("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"6px"},children:w.jsxs("label",{style:{fontWeight:600,fontSize:"0.8rem",color:"#374151"},children:["Ảnh chụp (",I.length,"/3)"]})}),I.length>0&&w.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:"6px",marginBottom:"8px"},children:I.map((x,M)=>w.jsxs("div",{style:{position:"relative",aspectRatio:"16/9",border:"1px solid #e5e7eb",borderRadius:"6px",overflow:"hidden",boxShadow:"0 1px 2px rgba(0,0,0,0.05)"},children:[w.jsx("img",{src:x,alt:`Screenshot ${M+1}`,draggable:!1,onContextMenu:ee=>ee.preventDefault(),style:{width:"100%",height:"100%",objectFit:"cover",cursor:"zoom-in",transition:"transform 0.2s",userSelect:"none",WebkitUserSelect:"none"},onClick:()=>L(x)}),w.jsx("button",{onClick:()=>Qi(M),title:"Xóa ảnh",style:{position:"absolute",top:"2px",right:"2px",background:"rgba(239, 68, 68, 0.9)",color:"white",border:"none",borderRadius:"50%",width:"16px",height:"16px",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",padding:0,boxShadow:"0 1px 2px rgba(0,0,0,0.2)"},children:w.jsx(wn,{size:10})})]},M))}),w.jsxs("div",{style:{display:"flex",gap:"8px"},children:[w.jsx("input",{type:"file",ref:vn,style:{display:"none"},accept:"image/*",onChange:Gi}),d?w.jsxs("button",{onClick:()=>xn("full"),style:{flex:1,padding:"12px",textAlign:"center",background:"white",border:"1px dashed #d1d5db",borderRadius:"8px",color:"#4b5563",cursor:"pointer",display:"flex",flexDirection:"column",alignItems:"center",gap:"4px",transition:"all 0.2s",minWidth:"60px"},onMouseOver:x=>{x.currentTarget.style.borderColor=r,x.currentTarget.style.color=r,x.currentTarget.style.backgroundColor="#f9fafb"},onMouseOut:x=>{x.currentTarget.style.borderColor="#d1d5db",x.currentTarget.style.color="#4b5563",x.currentTarget.style.backgroundColor="white"},children:[w.jsx(Pi,{size:18}),w.jsx("span",{style:{fontSize:"0.8rem",fontWeight:500},children:"Toàn màn hình"})]}):w.jsx(w.Fragment,{}),p?w.jsxs("button",{onClick:()=>xn("crop"),className:"fb-btn-crop",style:{flex:1,padding:"12px",textAlign:"center",background:"white",border:"1px dashed #d1d5db",borderRadius:"8px",color:"#4b5563",cursor:"pointer",display:"flex",flexDirection:"column",alignItems:"center",gap:"4px",transition:"all 0.2s",minWidth:"60px"},onMouseOver:x=>{x.currentTarget.style.borderColor=r,x.currentTarget.style.color=r,x.currentTarget.style.backgroundColor="#f9fafb"},onMouseOut:x=>{x.currentTarget.style.borderColor="#d1d5db",x.currentTarget.style.color="#4b5563",x.currentTarget.style.backgroundColor="white"},children:[w.jsx(Li,{size:18}),w.jsx("span",{style:{fontSize:"0.8rem",fontWeight:500},children:"Chọn vùng"})]}):w.jsx(w.Fragment,{}),w.jsxs("button",{onClick:ji,className:"fb-btn-upload",style:{flex:1,padding:"12px",textAlign:"center",background:"white",border:"1px dashed #d1d5db",borderRadius:"8px",color:"#4b5563",cursor:"pointer",display:"flex",flexDirection:"column",alignItems:"center",gap:"4px",transition:"all 0.2s",minWidth:"60px"},onMouseOver:x=>{x.currentTarget.style.borderColor=r,x.currentTarget.style.color=r,x.currentTarget.style.backgroundColor="#f9fafb"},onMouseOut:x=>{x.currentTarget.style.borderColor="#d1d5db",x.currentTarget.style.color="#4b5563",x.currentTarget.style.backgroundColor="white"},children:[w.jsx(Ui,{size:18}),w.jsx("span",{style:{fontSize:"0.8rem",fontWeight:500},children:"Chọn ảnh"})]})]})]}),w.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:"8px",marginTop:"auto",paddingTop:"8px",borderTop:"1px solid #f3f4f6"},children:[w.jsx("button",{onClick:Ct,disabled:F,style:{padding:"8px 16px",borderRadius:"8px",border:"1px solid #d1d5db",background:"white",cursor:"pointer",color:"#374151",fontWeight:500,fontSize:"0.85rem",transition:"background-color 0.2s"},onMouseEnter:x=>x.currentTarget.style.background="#f9fafb",onMouseLeave:x=>x.currentTarget.style.background="white",children:"Hủy bỏ"}),w.jsx("button",{onClick:Ki,disabled:F,style:{padding:"8px 16px",borderRadius:"8px",border:"none",background:r,color:"white",cursor:F?"not-allowed":"pointer",fontWeight:600,fontSize:"0.85rem",opacity:F?.7:1,boxShadow:"0 2px 4px -1px rgba(0, 0, 0, 0.1)",transition:"transform 0.1s, opacity 0.2s"},onMouseDown:x=>!F&&(x.currentTarget.style.transform="scale(0.98)"),onMouseUp:x=>!F&&(x.currentTarget.style.transform="scale(1)"),children:F?w.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[w.jsx(zi,{size:16,style:{animation:"fb-spin 1s linear infinite"}}),w.jsx("span",{children:"Đang gửi..."})]}):"Gửi báo lỗi"})]})]})]})},bn=A.createContext(void 0),Wi=()=>{const e=A.useContext(bn);if(!e)throw new Error("useFeedback must be used within a FeedbackProvider");return e},qi=({children:e,onSubmit:t,themeColor:n})=>{const[r,a]=A.useState(!1),[o,i]=A.useState(null),[s,d]=A.useState(void 0),p=(m,y)=>{i(m),d(y),a(!0)},l=()=>{a(!1)};return w.jsxs(bn.Provider,{value:{openFeedback:p,closeFeedback:l,isOpen:r,activeQuestionId:o},children:[e,o&&w.jsx(mn,{questionId:o,contextData:s,onSubmit:t,themeColor:n,isOpen:r,onClose:l,triggerComponent:w.jsx(w.Fragment,{})})]})};R.FeedbackProvider=qi,R.FeedbackWidget=mn,R.useFeedback=Wi,Object.defineProperty(R,Symbol.toStringTag,{value:"Module"})}));
84
+ `}),M&&w.jsx($i,{onConfirm:Ji,onCancel:Qi}),F&&w.jsx("div",{style:{position:"fixed",inset:0,backgroundColor:"rgba(0,0,0,0.8)",zIndex:1e4,display:"flex",alignItems:"center",justifyContent:"center",cursor:"zoom-out",animation:"fb-fade-in 0.2s ease-out",backdropFilter:"blur(4px)"},onClick:()=>L(null),children:w.jsx("img",{src:F,alt:"Zoomed",draggable:!1,onContextMenu:x=>x.preventDefault(),style:{maxWidth:"90vw",maxHeight:"90vh",objectFit:"contain",borderRadius:"8px",boxShadow:"0 20px 25px -5px rgba(0, 0, 0, 0.1)",backgroundColor:"white",userSelect:"none",WebkitUserSelect:"none"}})}),w.jsx("div",{onClick:()=>{o===void 0?Yi():i&&i()},style:{cursor:"pointer",display:"inline-block"},children:s||w.jsx("button",{className:"fb-widget-trigger",style:{position:"fixed",bottom:"24px",right:"24px",backgroundColor:r,color:"white",border:"none",borderRadius:"50%",width:"48px",height:"48px",display:"flex",alignItems:"center",justifyContent:"center",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",cursor:"pointer",zIndex:9990,transition:"transform 0.2s"},title:"Báo lỗi",onMouseEnter:x=>x.currentTarget.style.transform="scale(1.1)",onMouseLeave:x=>x.currentTarget.style.transform="scale(1)",children:w.jsx(Pi,{size:24})})}),z&&w.jsx("div",{style:{position:"fixed",top:20,right:20,background:"rgba(0,0,0,0.8)",color:"white",padding:"8px 12px",borderRadius:"8px",zIndex:1e4,fontWeight:500,backdropFilter:"blur(4px)",fontSize:"0.8rem"},children:"Đang chụp..."}),ji&&!M&&!F&&w.jsxs("div",{className:"fb-widget-modal",children:[w.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[w.jsx("h2",{style:{margin:0,fontSize:"1rem",fontWeight:700,color:"#111827"},children:"Báo lỗi"}),w.jsx("button",{onClick:Ct,style:{background:"transparent",border:"none",cursor:"pointer",color:"#6b7280",padding:"4px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"50%",transition:"background-color 0.2s"},onMouseEnter:x=>x.currentTarget.style.backgroundColor="#f3f4f6",onMouseLeave:x=>x.currentTarget.style.backgroundColor="transparent",children:w.jsx(vn,{size:18})})]}),w.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"10px"},children:[w.jsxs("div",{children:[w.jsxs("label",{style:{display:"block",marginBottom:"2px",fontSize:"0.8rem",fontWeight:600,color:"#374151"},children:["ID Câu hỏi ",n?.questionIdChild?"bài đọc":""," ",w.jsx("span",{style:{color:"#ef4444"},children:"*"})]}),w.jsxs("div",{style:{position:"relative",display:"flex",alignItems:"center",transition:"all 0.2s"},children:[w.jsx(yn,{size:12,style:{position:"absolute",left:"10px",color:P==="id"?r:$.questionId?"#ef4444":"#9ca3af",transition:"color 0.2s",pointerEvents:"none"}}),w.jsx("input",{type:"text",value:C,onFocus:()=>Se("id"),onBlur:()=>Se(null),onChange:x=>{b(x.target.value),$.questionId&&Ce(O=>({...O,questionId:void 0}))},disabled:!!e,placeholder:"Nhập ID (ví dụ: 101)",style:{width:"100%",padding:"6px 10px 6px 28px",borderRadius:"6px",border:`1px solid ${$.questionId?"#ef4444":P==="id"?r:"#e5e7eb"}`,boxShadow:P==="id"?`0 0 0 2px ${r}20`:"none",outline:"none",fontSize:"0.85rem",color:"#1f2937",transition:"all 0.2s",backgroundColor:"#f9fafb"}})]}),$.questionId&&w.jsx("span",{style:{display:"block",marginTop:"2px",fontSize:"0.7rem",color:"#ef4444"},children:$.questionId})]}),n?.questionIdChild?w.jsxs("div",{children:[w.jsx("label",{style:{display:"block",marginBottom:"2px",fontSize:"0.8rem",fontWeight:600,color:"#374151"},children:"ID Câu hỏi"}),w.jsxs("div",{style:{position:"relative",display:"flex",alignItems:"center",transition:"all 0.2s"},children:[w.jsx(yn,{size:12,style:{position:"absolute",left:"10px",color:P==="idChild"?r:$.questionIdChild?"#ef4444":"#9ca3af",transition:"color 0.2s",pointerEvents:"none"}}),w.jsx("input",{type:"text",value:E,onFocus:()=>Se("idChild"),onBlur:()=>Se(null),onChange:x=>{v(x.target.value)},placeholder:"Nhập ID (ví dụ: 101)",disabled:!!n?.questionIdChild,style:{width:"100%",padding:"6px 10px 6px 28px",borderRadius:"6px",border:`1px solid ${$.questionIdChild?"#ef4444":P==="idChild"?r:"#e5e7eb"}`,boxShadow:P==="idChild"?`0 0 0 2px ${r}20`:"none",outline:"none",fontSize:"0.85rem",color:"#1f2937",transition:"all 0.2s",backgroundColor:"#f9fafb"}})]}),$.questionIdChild&&w.jsx("span",{style:{display:"block",marginTop:"2px",fontSize:"0.7rem",color:"#ef4444"},children:$.questionIdChild})]}):w.jsx(w.Fragment,{}),w.jsxs("div",{children:[w.jsxs("label",{style:{display:"block",marginBottom:"2px",fontSize:"0.8rem",fontWeight:600,color:"#374151"},children:["Loại lỗi ",w.jsx("span",{style:{color:"#ef4444"},children:"*"})]}),w.jsxs("select",{value:Cn,onChange:x=>Ke(x.target.value),style:{width:"100%",padding:"6px 10px",borderRadius:"6px",border:"1px solid #e5e7eb",backgroundColor:"#f9fafb",fontSize:"0.85rem",color:"#1f2937",outline:"none",cursor:"pointer",appearance:"none",backgroundImage:`url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'/%3e%3c/svg%3e")`,backgroundRepeat:"no-repeat",backgroundPosition:"right 10px center",backgroundSize:"14px"},children:[w.jsx("option",{value:"incorrect_content",children:"Lỗi nội dung"}),w.jsx("option",{value:"display_error",children:"Lỗi hiển thị"}),w.jsx("option",{value:"missing_data",children:"Thiếu thông tin"}),w.jsx("option",{value:"technical_issue",children:"Lỗi kỹ thuật"}),w.jsx("option",{value:"other",children:"Khác"})]})]}),w.jsxs("div",{children:[w.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"2px"},children:[w.jsxs("label",{style:{fontSize:"0.8rem",fontWeight:600,color:"#374151"},children:["Mô tả lỗi ",w.jsx("span",{style:{color:"#ef4444"},children:"*"})]}),w.jsxs("span",{style:{fontSize:"0.7rem",color:"#9ca3af"},children:[y.length,"/1000"]})]}),w.jsxs("div",{style:{position:"relative"},children:[w.jsx("div",{style:{position:"absolute",left:"10px",top:"8px",pointerEvents:"none"},children:w.jsx(Vi,{size:12,style:{color:P==="desc"?r:$.description?"#ef4444":"#9ca3af",transition:"color 0.2s"}})}),w.jsx("textarea",{value:y,onFocus:()=>Se("desc"),onBlur:()=>Se(null),onChange:x=>{S(x.target.value),$.description&&Ce(O=>({...O,description:void 0}))},maxLength:1e3,placeholder:"Mô tả chi tiết...",style:{width:"100%",minHeight:"80px",padding:"6px 10px 6px 28px",borderRadius:"6px",border:`1px solid ${$.description?"#ef4444":P==="desc"?r:"#e5e7eb"}`,boxShadow:P==="desc"?`0 0 0 2px ${r}20`:"none",outline:"none",fontSize:"0.85rem",color:"#1f2937",resize:"vertical",boxSizing:"border-box",transition:"all 0.2s",backgroundColor:"#f9fafb",lineHeight:"1.4",fontFamily:"inherit"}})]}),$.description&&w.jsx("span",{style:{display:"block",marginTop:"2px",fontSize:"0.7rem",color:"#ef4444"},children:$.description})]})]}),w.jsxs("div",{style:{marginBottom:"2px"},children:[w.jsx("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"6px"},children:w.jsxs("label",{style:{fontWeight:600,fontSize:"0.8rem",color:"#374151"},children:["Ảnh chụp (",T.length,"/3)"]})}),T.length>0&&w.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:"6px",marginBottom:"8px"},children:T.map((x,O)=>w.jsxs("div",{style:{position:"relative",aspectRatio:"16/9",border:"1px solid #e5e7eb",borderRadius:"6px",overflow:"hidden",boxShadow:"0 1px 2px rgba(0,0,0,0.05)"},children:[w.jsx("img",{src:x,alt:`Screenshot ${O+1}`,draggable:!1,onContextMenu:te=>te.preventDefault(),style:{width:"100%",height:"100%",objectFit:"cover",cursor:"zoom-in",transition:"transform 0.2s",userSelect:"none",WebkitUserSelect:"none"},onClick:()=>L(x)}),w.jsx("button",{onClick:()=>Ki(O),title:"Xóa ảnh",style:{position:"absolute",top:"2px",right:"2px",background:"rgba(239, 68, 68, 0.9)",color:"white",border:"none",borderRadius:"50%",width:"16px",height:"16px",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",padding:0,boxShadow:"0 1px 2px rgba(0,0,0,0.2)"},children:w.jsx(vn,{size:10})})]},O))}),w.jsxs("div",{style:{display:"flex",gap:"8px"},children:[w.jsx("input",{type:"file",ref:kn,style:{display:"none"},accept:"image/*",onChange:Xi}),d?w.jsxs("button",{onClick:()=>En("full"),style:{flex:1,padding:"12px",textAlign:"center",background:"white",border:"1px dashed #d1d5db",borderRadius:"8px",color:"#4b5563",cursor:"pointer",display:"flex",flexDirection:"column",alignItems:"center",gap:"4px",transition:"all 0.2s",minWidth:"60px"},onMouseOver:x=>{x.currentTarget.style.borderColor=r,x.currentTarget.style.color=r,x.currentTarget.style.backgroundColor="#f9fafb"},onMouseOut:x=>{x.currentTarget.style.borderColor="#d1d5db",x.currentTarget.style.color="#4b5563",x.currentTarget.style.backgroundColor="white"},children:[w.jsx(Hi,{size:18}),w.jsx("span",{style:{fontSize:"0.8rem",fontWeight:500},children:"Toàn màn hình"})]}):w.jsx(w.Fragment,{}),h?w.jsxs("button",{onClick:()=>En("crop"),className:"fb-btn-crop",style:{flex:1,padding:"12px",textAlign:"center",background:"white",border:"1px dashed #d1d5db",borderRadius:"8px",color:"#4b5563",cursor:"pointer",display:"flex",flexDirection:"column",alignItems:"center",gap:"4px",transition:"all 0.2s",minWidth:"60px"},onMouseOver:x=>{x.currentTarget.style.borderColor=r,x.currentTarget.style.color=r,x.currentTarget.style.backgroundColor="#f9fafb"},onMouseOut:x=>{x.currentTarget.style.borderColor="#d1d5db",x.currentTarget.style.color="#4b5563",x.currentTarget.style.backgroundColor="white"},children:[w.jsx(Ui,{size:18}),w.jsx("span",{style:{fontSize:"0.8rem",fontWeight:500},children:"Chọn vùng"})]}):w.jsx(w.Fragment,{}),w.jsxs("button",{onClick:Gi,className:"fb-btn-upload",style:{flex:1,padding:"12px",textAlign:"center",background:"white",border:"1px dashed #d1d5db",borderRadius:"8px",color:"#4b5563",cursor:"pointer",display:"flex",flexDirection:"column",alignItems:"center",gap:"4px",transition:"all 0.2s",minWidth:"60px"},onMouseOver:x=>{x.currentTarget.style.borderColor=r,x.currentTarget.style.color=r,x.currentTarget.style.backgroundColor="#f9fafb"},onMouseOut:x=>{x.currentTarget.style.borderColor="#d1d5db",x.currentTarget.style.color="#4b5563",x.currentTarget.style.backgroundColor="white"},children:[w.jsx(zi,{size:18}),w.jsx("span",{style:{fontSize:"0.8rem",fontWeight:500},children:"Chọn ảnh"})]})]})]}),w.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:"8px",marginTop:"auto",paddingTop:"8px",borderTop:"1px solid #f3f4f6"},children:[w.jsx("button",{onClick:Ct,disabled:R,style:{padding:"8px 16px",borderRadius:"8px",border:"1px solid #d1d5db",background:"white",cursor:"pointer",color:"#374151",fontWeight:500,fontSize:"0.85rem",transition:"background-color 0.2s"},onMouseEnter:x=>x.currentTarget.style.background="#f9fafb",onMouseLeave:x=>x.currentTarget.style.background="white",children:"Hủy bỏ"}),w.jsx("button",{onClick:Zi,disabled:R,style:{padding:"8px 16px",borderRadius:"8px",border:"none",background:r,color:"white",cursor:R?"not-allowed":"pointer",fontWeight:600,fontSize:"0.85rem",opacity:R?.7:1,boxShadow:"0 2px 4px -1px rgba(0, 0, 0, 0.1)",transition:"transform 0.1s, opacity 0.2s"},onMouseDown:x=>!R&&(x.currentTarget.style.transform="scale(0.98)"),onMouseUp:x=>!R&&(x.currentTarget.style.transform="scale(1)"),children:R?w.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[w.jsx(Bi,{size:16,style:{animation:"fb-spin 1s linear infinite"}}),w.jsx("span",{children:"Đang gửi..."})]}):"Gửi báo lỗi"})]})]})]})},Sn=A.createContext(void 0),Wi=()=>{const e=A.useContext(Sn);if(!e)throw new Error("useFeedback must be used within a FeedbackProvider");return e},qi=({children:e,onSubmit:n,themeColor:t})=>{const[r,s]=A.useState(!1),[o,i]=A.useState(null),[a,d]=A.useState(void 0),h=(m,y)=>{i(m),d(y),s(!0)},l=()=>{s(!1)};return w.jsxs(Sn.Provider,{value:{openFeedback:h,closeFeedback:l,isOpen:r,activeQuestionId:o},children:[e,o&&w.jsx(xn,{questionId:o,contextData:a,onSubmit:n,themeColor:t,isOpen:r,onClose:l,triggerComponent:w.jsx(w.Fragment,{})})]})};j.FeedbackProvider=qi,j.FeedbackWidget=xn,j.captureScreenshot=wn,j.useFeedback=Wi,Object.defineProperty(j,Symbol.toStringTag,{value:"Module"})}));