@dcl/builder-site 7.7.1 → 7.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/assets/{Back-BnLKsjJg.js → Back-duBveN1v.js} +1 -1
  2. package/assets/{CollectionProvider.container-zWqrIa8D.js → CollectionProvider.container-1_tR6kfQ.js} +1 -1
  3. package/assets/{CollectionStatus.container-BNlp_bRU.js → CollectionStatus.container-e7VZNzrW.js} +1 -1
  4. package/assets/{ConfirmDelete-Bh-3wumH.js → ConfirmDelete-BQZ7SrfT.js} +1 -1
  5. package/assets/{FileSaver.min-CIeNHKhl.js → FileSaver.min-B_8INcXC.js} +1 -1
  6. package/assets/{ItemProvider.container-Du-uhG3H.js → ItemProvider.container-CIp7ULqf.js} +1 -1
  7. package/assets/{JumpIn.container-AhXUZABn.js → JumpIn.container-Dv91gn2r.js} +1 -1
  8. package/assets/{LandAction-CRmhvdXH.js → LandAction-kYh3vvgN.js} +1 -1
  9. package/assets/{LandProviderPage-Dcehs5Bf.js → LandProviderPage-Cd3qFmFF.js} +1 -1
  10. package/assets/{LoggedInDetailPage.container-BCTPkcJo.js → LoggedInDetailPage.container-BruSpUoO.js} +1 -1
  11. package/assets/{Navigation-figDvp7W.css → Navigation-ByMG0t-i.css} +1 -1
  12. package/assets/{Navigation.container-BtUDUKbh.js → Navigation.container-B5eLCs3_.js} +1 -1
  13. package/assets/{NotFound-BXIeAny2.js → NotFound-0eSDrXM8.js} +1 -1
  14. package/assets/{OptionsDropdown-7j30I7Zt.js → OptionsDropdown-Duk7-nDc.js} +1 -1
  15. package/assets/{RentalPeriod-BtbsKvBX.js → RentalPeriod-eNLlWvjD.js} +1 -1
  16. package/assets/{SDKTag-B2tNwVk6.js → SDKTag-DV1_y9Sa.js} +1 -1
  17. package/assets/{SceneStats.container-DRxcGKHU.js → SceneStats.container-BsiesbcI.js} +1 -1
  18. package/assets/{SignInRequired-bbEwh8YN.js → SignInRequired-DHB6ilyW.js} +1 -1
  19. package/assets/{ThirdPartyKindBadge-B9ZaoTIb.js → ThirdPartyKindBadge-1P4cCz34.js} +1 -1
  20. package/assets/{dataReader-CaBZbWkA.js → dataReader-CDTsdj7e.js} +1 -1
  21. package/assets/{date-CUNUL8lj.js → date-B-CG1Fds.js} +1 -1
  22. package/assets/{fortmatic-DNFPCNF5.js → fortmatic-Cs9GoPQv.js} +1 -1
  23. package/assets/{index-CtMb0IUK.js → index-84vAZjQV.js} +2 -2
  24. package/assets/{index-AeEI72Ti.js → index-B1pUc9bG.js} +1 -1
  25. package/assets/index-B6d5uffD.js +1 -0
  26. package/assets/{index-CM9Crn-y.js → index-B6e_MkzA.js} +1 -1
  27. package/assets/{index-CQOeg-gy.js → index-BAhoeGLZ.js} +1 -1
  28. package/assets/{index-DAGqj9bY.css → index-BMOuxAbC.css} +7 -7
  29. package/assets/{index-BLQdPLNr.js → index-BVgrtigI.js} +1 -1
  30. package/assets/{index-Bqvdj0Ji.css → index-BWwx3ddr.css} +1 -1
  31. package/assets/{index-BH1EvltE.js → index-BcIV2Hdz.js} +1 -1
  32. package/assets/{index-CibkgWW9.js → index-Be9AtWtx.js} +1 -1
  33. package/assets/{index-DkkKP2bP.js → index-BeEAoUyL.js} +1 -1
  34. package/assets/{index-CzBRKWnC.js → index-BrNsrTGL.js} +1 -1
  35. package/assets/{index-BphcojnO.js → index-C-Zw7XLI.js} +1 -1
  36. package/assets/{index-DOXAbpH-.js → index-CA3hNH-_.js} +1 -1
  37. package/assets/{index-C3lvUr71.js → index-CAJGbTu6.js} +1 -1
  38. package/assets/{index-CF4ARreB.js → index-CRjxLl6T.js} +1 -1
  39. package/assets/{index-Bu8lsb0I.js → index-CW2qtnbh.js} +1 -1
  40. package/assets/{index-B5IAmvfM.css → index-CWrGN_ZG.css} +1 -1
  41. package/assets/{index-BJ4rTIkA.js → index-CX1bzxNG.js} +1 -1
  42. package/assets/{index-prGsQW6x.css → index-CYRheFcb.css} +1 -1
  43. package/assets/index-CZeeZW8s.js +1 -0
  44. package/assets/{index-CqMSvM9y.js → index-Cl1nwlEZ.js} +21 -21
  45. package/assets/{index-DuGI-PsP.js → index-CslRPxk2.js} +1 -1
  46. package/assets/{index-DuroTNyU.css → index-D1_NocLo.css} +1 -1
  47. package/assets/{index-3SsOcT1v.js → index-D2V4obys.js} +1 -1
  48. package/assets/{index-DSpmTSCv.js → index-DAHz2yzZ.js} +1 -1
  49. package/assets/{index-1rtfuqQE.js → index-DVfpakfB.js} +1 -1
  50. package/assets/{index-OwkIFq6_.js → index-DcMdC8qh.js} +1 -1
  51. package/assets/{index-DAH4WtZq.js → index-DguvhO86.js} +1 -1
  52. package/assets/{index-D37bPpNQ.js → index-Dhm7w7GV.js} +1 -1
  53. package/assets/{index-CHv0JBYT.css → index-Djmb-FCp.css} +1 -1
  54. package/assets/{index-DzyRTZBg.js → index-Dw-QquPj.js} +1 -1
  55. package/assets/{index-BqTjmh_T.js → index-GYXcGIH8.js} +1 -1
  56. package/assets/{index-Ccj0SHjO.js → index-Phe_EtKn.js} +1 -1
  57. package/assets/{index-C1I8ZAuM.js → index-REy84VWd.js} +1 -1
  58. package/assets/{index-CUDPPP2l.js → index-VRfOOr3_.js} +1 -1
  59. package/assets/{index-Du9_1YO6.css → index-WXooza1U.css} +1 -1
  60. package/assets/{index-BTQGQ-YH.js → index-XvziWw1P.js} +1 -1
  61. package/assets/{index-DY-McODA.js → index-_warck1u.js} +1 -1
  62. package/assets/{index-BXzkzpMl.js → index-aMqENNl3.js} +1 -1
  63. package/assets/{index-D6SmRk4Y.js → index-e-oSLOvi.js} +1 -1
  64. package/assets/{index-D2C2Zvfv.js → index-m0u0cY5i.js} +1 -1
  65. package/assets/{index-g8fFHPOy.js → index-nSLGaD4K.js} +1 -1
  66. package/assets/{index-CSuC87Db.js → index-pYZYwDun.js} +1 -1
  67. package/assets/{index-D1j1woDx.js → index-qgyJvqE3.js} +1 -1
  68. package/assets/{index-B9xXsRn5.js → index-syBlLWax.js} +1 -1
  69. package/assets/{index-DyCsNMXc.js → index-t3shXRJI.js} +1 -1
  70. package/assets/{index-B8t_rFW9.js → index-u2lX0BEc.js} +1 -1
  71. package/assets/{index-lZAafkQF.js → index-x7mkbxM3.js} +1 -1
  72. package/assets/{index.es-BFRyx10j.js → index.es-Z7htX9K-.js} +4 -4
  73. package/assets/{selectors-ChkqRJca.js → selectors-DuglPRAP.js} +1 -1
  74. package/index.html +3 -3
  75. package/package.json +3 -3
  76. package/assets/index-BnNqjHnZ.js +0 -1
  77. package/assets/index-unV3tmro.js +0 -1
@@ -1 +1 @@
1
- import{bO as g,ca as D,bP as C,cb as S,G as f}from"./index-CqMSvM9y.js";import{g as T,f as j,b as s,a as o,c as k,d,l as y}from"./index-CzBRKWnC.js";function p(t,e){var r,a,n,i,l,c,h,v;g(1,arguments);var b=T(),u=D((r=(a=(n=(i=e==null?void 0:e.weekStartsOn)!==null&&i!==void 0?i:e==null||(l=e.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&n!==void 0?n:b.weekStartsOn)!==null&&a!==void 0?a:(h=b.locale)===null||h===void 0||(v=h.options)===null||v===void 0?void 0:v.weekStartsOn)!==null&&r!==void 0?r:0);if(!(u>=0&&u<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var m=C(t),w=m.getUTCDay(),$=(w<u?7:0)+w-u;return m.setUTCDate(m.getUTCDate()-$),m.setUTCHours(0,0,0,0),m}function x(t,e){return g(1,arguments),j(t,Date.now(),e)}var N={lessThanXSeconds:{one:"menos de un segundo",other:"menos de {{count}} segundos"},xSeconds:{one:"1 segundo",other:"{{count}} segundos"},halfAMinute:"medio minuto",lessThanXMinutes:{one:"menos de un minuto",other:"menos de {{count}} minutos"},xMinutes:{one:"1 minuto",other:"{{count}} minutos"},aboutXHours:{one:"alrededor de 1 hora",other:"alrededor de {{count}} horas"},xHours:{one:"1 hora",other:"{{count}} horas"},xDays:{one:"1 día",other:"{{count}} días"},aboutXWeeks:{one:"alrededor de 1 semana",other:"alrededor de {{count}} semanas"},xWeeks:{one:"1 semana",other:"{{count}} semanas"},aboutXMonths:{one:"alrededor de 1 mes",other:"alrededor de {{count}} meses"},xMonths:{one:"1 mes",other:"{{count}} meses"},aboutXYears:{one:"alrededor de 1 año",other:"alrededor de {{count}} años"},xYears:{one:"1 año",other:"{{count}} años"},overXYears:{one:"más de 1 año",other:"más de {{count}} años"},almostXYears:{one:"casi 1 año",other:"casi {{count}} años"}},O=function(e,r,a){var n,i=N[e];return typeof i=="string"?n=i:r===1?n=i.one:n=i.other.replace("{{count}}",r.toString()),a!=null&&a.addSuffix?a.comparison&&a.comparison>0?"en "+n:"hace "+n:n},z={full:"EEEE, d 'de' MMMM 'de' y",long:"d 'de' MMMM 'de' y",medium:"d MMM y",short:"dd/MM/y"},V={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},X={full:"{{date}} 'a las' {{time}}",long:"{{date}} 'a las' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},E={date:s({formats:z,defaultWidth:"full"}),time:s({formats:V,defaultWidth:"full"}),dateTime:s({formats:X,defaultWidth:"full"})},F={lastWeek:"'el' eeee 'pasado a la' p",yesterday:"'ayer a la' p",today:"'hoy a la' p",tomorrow:"'mañana a la' p",nextWeek:"eeee 'a la' p",other:"P"},L={lastWeek:"'el' eeee 'pasado a las' p",yesterday:"'ayer a las' p",today:"'hoy a las' p",tomorrow:"'mañana a las' p",nextWeek:"eeee 'a las' p",other:"P"},H=function(e,r,a,n){return r.getUTCHours()!==1?L[e]:F[e]},R={narrow:["AC","DC"],abbreviated:["AC","DC"],wide:["antes de cristo","después de cristo"]},_={narrow:["1","2","3","4"],abbreviated:["T1","T2","T3","T4"],wide:["1º trimestre","2º trimestre","3º trimestre","4º trimestre"]},Y={narrow:["e","f","m","a","m","j","j","a","s","o","n","d"],abbreviated:["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],wide:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"]},q={narrow:["d","l","m","m","j","v","s"],short:["do","lu","ma","mi","ju","vi","sá"],abbreviated:["dom","lun","mar","mié","jue","vie","sáb"],wide:["domingo","lunes","martes","miércoles","jueves","viernes","sábado"]},A={narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"mañana",afternoon:"tarde",evening:"tarde",night:"noche"},abbreviated:{am:"AM",pm:"PM",midnight:"medianoche",noon:"mediodia",morning:"mañana",afternoon:"tarde",evening:"tarde",night:"noche"},wide:{am:"a.m.",pm:"p.m.",midnight:"medianoche",noon:"mediodia",morning:"mañana",afternoon:"tarde",evening:"tarde",night:"noche"}},U={narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"de la mañana",afternoon:"de la tarde",evening:"de la tarde",night:"de la noche"},abbreviated:{am:"AM",pm:"PM",midnight:"medianoche",noon:"mediodia",morning:"de la mañana",afternoon:"de la tarde",evening:"de la tarde",night:"de la noche"},wide:{am:"a.m.",pm:"p.m.",midnight:"medianoche",noon:"mediodia",morning:"de la mañana",afternoon:"de la tarde",evening:"de la tarde",night:"de la noche"}},Q=function(e,r){var a=Number(e);return a+"º"},I={ordinalNumber:Q,era:o({values:R,defaultWidth:"wide"}),quarter:o({values:_,defaultWidth:"wide",argumentCallback:function(e){return Number(e)-1}}),month:o({values:Y,defaultWidth:"wide"}),day:o({values:q,defaultWidth:"wide"}),dayPeriod:o({values:A,defaultWidth:"wide",formattingValues:U,defaultFormattingWidth:"wide"})},G=/^(\d+)(º)?/i,B=/\d+/i,J={narrow:/^(ac|dc|a|d)/i,abbreviated:/^(a\.?\s?c\.?|a\.?\s?e\.?\s?c\.?|d\.?\s?c\.?|e\.?\s?c\.?)/i,wide:/^(antes de cristo|antes de la era com[uú]n|despu[eé]s de cristo|era com[uú]n)/i},K={any:[/^ac/i,/^dc/i],wide:[/^(antes de cristo|antes de la era com[uú]n)/i,/^(despu[eé]s de cristo|era com[uú]n)/i]},Z={narrow:/^[1234]/i,abbreviated:/^T[1234]/i,wide:/^[1234](º)? trimestre/i},ee={any:[/1/i,/2/i,/3/i,/4/i]},ae={narrow:/^[efmajsond]/i,abbreviated:/^(ene|feb|mar|abr|may|jun|jul|ago|sep|oct|nov|dic)/i,wide:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i},te={narrow:[/^e/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^en/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i]},re={narrow:/^[dlmjvs]/i,short:/^(do|lu|ma|mi|ju|vi|s[áa])/i,abbreviated:/^(dom|lun|mar|mi[ée]|jue|vie|s[áa]b)/i,wide:/^(domingo|lunes|martes|mi[ée]rcoles|jueves|viernes|s[áa]bado)/i},ne={narrow:[/^d/i,/^l/i,/^m/i,/^m/i,/^j/i,/^v/i,/^s/i],any:[/^do/i,/^lu/i,/^ma/i,/^mi/i,/^ju/i,/^vi/i,/^sa/i]},ie={narrow:/^(a|p|mn|md|(de la|a las) (mañana|tarde|noche))/i,any:/^([ap]\.?\s?m\.?|medianoche|mediodia|(de la|a las) (mañana|tarde|noche))/i},oe={any:{am:/^a/i,pm:/^p/i,midnight:/^mn/i,noon:/^md/i,morning:/mañana/i,afternoon:/tarde/i,evening:/tarde/i,night:/noche/i}},de={ordinalNumber:k({matchPattern:G,parsePattern:B,valueCallback:function(e){return parseInt(e,10)}}),era:d({matchPatterns:J,defaultMatchWidth:"wide",parsePatterns:K,defaultParseWidth:"any"}),quarter:d({matchPatterns:Z,defaultMatchWidth:"wide",parsePatterns:ee,defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:d({matchPatterns:ae,defaultMatchWidth:"wide",parsePatterns:te,defaultParseWidth:"any"}),day:d({matchPatterns:re,defaultMatchWidth:"wide",parsePatterns:ne,defaultParseWidth:"any"}),dayPeriod:d({matchPatterns:ie,defaultMatchWidth:"any",parsePatterns:oe,defaultParseWidth:"any"})},P={code:"es",formatDistance:O,formatLong:E,formatRelative:H,localize:I,match:de,options:{weekStartsOn:1,firstWeekContainsDate:1}},se={lessThanXSeconds:{one:"不到 1 秒",other:"不到 {{count}} 秒"},xSeconds:{one:"1 秒",other:"{{count}} 秒"},halfAMinute:"半分钟",lessThanXMinutes:{one:"不到 1 分钟",other:"不到 {{count}} 分钟"},xMinutes:{one:"1 分钟",other:"{{count}} 分钟"},xHours:{one:"1 小时",other:"{{count}} 小时"},aboutXHours:{one:"大约 1 小时",other:"大约 {{count}} 小时"},xDays:{one:"1 天",other:"{{count}} 天"},aboutXWeeks:{one:"大约 1 个星期",other:"大约 {{count}} 个星期"},xWeeks:{one:"1 个星期",other:"{{count}} 个星期"},aboutXMonths:{one:"大约 1 个月",other:"大约 {{count}} 个月"},xMonths:{one:"1 个月",other:"{{count}} 个月"},aboutXYears:{one:"大约 1 年",other:"大约 {{count}} 年"},xYears:{one:"1 年",other:"{{count}} 年"},overXYears:{one:"超过 1 年",other:"超过 {{count}} 年"},almostXYears:{one:"将近 1 年",other:"将近 {{count}} 年"}},me=function(e,r,a){var n,i=se[e];return typeof i=="string"?n=i:r===1?n=i.one:n=i.other.replace("{{count}}",String(r)),a!=null&&a.addSuffix?a.comparison&&a.comparison>0?n+"内":n+"前":n},ue={full:"y'年'M'月'd'日' EEEE",long:"y'年'M'月'd'日'",medium:"yyyy-MM-dd",short:"yy-MM-dd"},le={full:"zzzz a h:mm:ss",long:"z a h:mm:ss",medium:"a h:mm:ss",short:"a h:mm"},ce={full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},he={date:s({formats:ue,defaultWidth:"full"}),time:s({formats:le,defaultWidth:"full"}),dateTime:s({formats:ce,defaultWidth:"full"})};function ve(t,e,r){g(2,arguments);var a=p(t,r),n=p(e,r);return a.getTime()===n.getTime()}function W(t,e,r){var a="eeee p";return ve(t,e,r)?a:t.getTime()>e.getTime()?"'下个'"+a:"'上个'"+a}var fe={lastWeek:W,yesterday:"'昨天' p",today:"'今天' p",tomorrow:"'明天' p",nextWeek:W,other:"PP p"},ge=function(e,r,a,n){var i=fe[e];return typeof i=="function"?i(r,a,n):i},be={narrow:["前","公元"],abbreviated:["前","公元"],wide:["公元前","公元"]},we={narrow:["1","2","3","4"],abbreviated:["第一季","第二季","第三季","第四季"],wide:["第一季度","第二季度","第三季度","第四季度"]},ye={narrow:["一","二","三","四","五","六","七","八","九","十","十一","十二"],abbreviated:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],wide:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]},pe={narrow:["日","一","二","三","四","五","六"],short:["日","一","二","三","四","五","六"],abbreviated:["周日","周一","周二","周三","周四","周五","周六"],wide:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"]},Pe={narrow:{am:"上",pm:"下",midnight:"凌晨",noon:"午",morning:"早",afternoon:"下午",evening:"晚",night:"夜"},abbreviated:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"},wide:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"}},We={narrow:{am:"上",pm:"下",midnight:"凌晨",noon:"午",morning:"早",afternoon:"下午",evening:"晚",night:"夜"},abbreviated:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"},wide:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"}},Me=function(e,r){var a=Number(e);switch(r==null?void 0:r.unit){case"date":return a.toString()+"日";case"hour":return a.toString()+"时";case"minute":return a.toString()+"分";case"second":return a.toString()+"秒";default:return"第 "+a.toString()}},ke={ordinalNumber:Me,era:o({values:be,defaultWidth:"wide"}),quarter:o({values:we,defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:o({values:ye,defaultWidth:"wide"}),day:o({values:pe,defaultWidth:"wide"}),dayPeriod:o({values:Pe,defaultWidth:"wide",formattingValues:We,defaultFormattingWidth:"wide"})},$e=/^(第\s*)?\d+(日|时|分|秒)?/i,De=/\d+/i,Ce={narrow:/^(前)/i,abbreviated:/^(前)/i,wide:/^(公元前|公元)/i},Se={any:[/^(前)/i,/^(公元)/i]},Te={narrow:/^[1234]/i,abbreviated:/^第[一二三四]刻/i,wide:/^第[一二三四]刻钟/i},je={any:[/(1|一)/i,/(2|二)/i,/(3|三)/i,/(4|四)/i]},xe={narrow:/^(一|二|三|四|五|六|七|八|九|十[二一])/i,abbreviated:/^(一|二|三|四|五|六|七|八|九|十[二一]|\d|1[12])月/i,wide:/^(一|二|三|四|五|六|七|八|九|十[二一])月/i},Ne={narrow:[/^一/i,/^二/i,/^三/i,/^四/i,/^五/i,/^六/i,/^七/i,/^八/i,/^九/i,/^十(?!(一|二))/i,/^十一/i,/^十二/i],any:[/^一|1/i,/^二|2/i,/^三|3/i,/^四|4/i,/^五|5/i,/^六|6/i,/^七|7/i,/^八|8/i,/^九|9/i,/^十(?!(一|二))|10/i,/^十一|11/i,/^十二|12/i]},Oe={narrow:/^[一二三四五六日]/i,short:/^[一二三四五六日]/i,abbreviated:/^周[一二三四五六日]/i,wide:/^星期[一二三四五六日]/i},ze={any:[/日/i,/一/i,/二/i,/三/i,/四/i,/五/i,/六/i]},Ve={any:/^(上午?|下午?|午夜|[中正]午|早上?|下午|晚上?|凌晨|)/i},Xe={any:{am:/^上午?/i,pm:/^下午?/i,midnight:/^午夜/i,noon:/^[中正]午/i,morning:/^早上/i,afternoon:/^下午/i,evening:/^晚上?/i,night:/^凌晨/i}},Ee={ordinalNumber:k({matchPattern:$e,parsePattern:De,valueCallback:function(e){return parseInt(e,10)}}),era:d({matchPatterns:Ce,defaultMatchWidth:"wide",parsePatterns:Se,defaultParseWidth:"any"}),quarter:d({matchPatterns:Te,defaultMatchWidth:"wide",parsePatterns:je,defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:d({matchPatterns:xe,defaultMatchWidth:"wide",parsePatterns:Ne,defaultParseWidth:"any"}),day:d({matchPatterns:Oe,defaultMatchWidth:"wide",parsePatterns:ze,defaultParseWidth:"any"}),dayPeriod:d({matchPatterns:Ve,defaultMatchWidth:"any",parsePatterns:Xe,defaultParseWidth:"any"})},M={code:"zh-CN",formatDistance:me,formatLong:he,formatRelative:ge,localize:ke,match:Ee,options:{weekStartsOn:1,firstWeekContainsDate:4}};const Fe={en:y,"en-EN":y,es:P,"es-ES":P,zh:M,"zh-CN":M};function _e(t,e={}){return x(t,Le(e))}function Ye(t){return t>3600?f("time.hours",{amount:Number((t/3600).toFixed(1)).toLocaleString()}):t>60?f("time.minutes",{amount:Math.round(t/60)}):f("time.seconds",{amount:Math.round(t)})}function Le(t){const e=Fe[S().locale];return e?{...t,locale:e}:{...t}}export{_e as a,Ye as f,p as s};
1
+ import{bO as g,ca as D,bP as C,cb as S,G as f}from"./index-Cl1nwlEZ.js";import{g as T,f as j,b as s,a as o,c as k,d,l as y}from"./index-BrNsrTGL.js";function p(t,e){var r,a,n,i,l,c,h,v;g(1,arguments);var b=T(),u=D((r=(a=(n=(i=e==null?void 0:e.weekStartsOn)!==null&&i!==void 0?i:e==null||(l=e.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&n!==void 0?n:b.weekStartsOn)!==null&&a!==void 0?a:(h=b.locale)===null||h===void 0||(v=h.options)===null||v===void 0?void 0:v.weekStartsOn)!==null&&r!==void 0?r:0);if(!(u>=0&&u<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var m=C(t),w=m.getUTCDay(),$=(w<u?7:0)+w-u;return m.setUTCDate(m.getUTCDate()-$),m.setUTCHours(0,0,0,0),m}function x(t,e){return g(1,arguments),j(t,Date.now(),e)}var N={lessThanXSeconds:{one:"menos de un segundo",other:"menos de {{count}} segundos"},xSeconds:{one:"1 segundo",other:"{{count}} segundos"},halfAMinute:"medio minuto",lessThanXMinutes:{one:"menos de un minuto",other:"menos de {{count}} minutos"},xMinutes:{one:"1 minuto",other:"{{count}} minutos"},aboutXHours:{one:"alrededor de 1 hora",other:"alrededor de {{count}} horas"},xHours:{one:"1 hora",other:"{{count}} horas"},xDays:{one:"1 día",other:"{{count}} días"},aboutXWeeks:{one:"alrededor de 1 semana",other:"alrededor de {{count}} semanas"},xWeeks:{one:"1 semana",other:"{{count}} semanas"},aboutXMonths:{one:"alrededor de 1 mes",other:"alrededor de {{count}} meses"},xMonths:{one:"1 mes",other:"{{count}} meses"},aboutXYears:{one:"alrededor de 1 año",other:"alrededor de {{count}} años"},xYears:{one:"1 año",other:"{{count}} años"},overXYears:{one:"más de 1 año",other:"más de {{count}} años"},almostXYears:{one:"casi 1 año",other:"casi {{count}} años"}},O=function(e,r,a){var n,i=N[e];return typeof i=="string"?n=i:r===1?n=i.one:n=i.other.replace("{{count}}",r.toString()),a!=null&&a.addSuffix?a.comparison&&a.comparison>0?"en "+n:"hace "+n:n},z={full:"EEEE, d 'de' MMMM 'de' y",long:"d 'de' MMMM 'de' y",medium:"d MMM y",short:"dd/MM/y"},V={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},X={full:"{{date}} 'a las' {{time}}",long:"{{date}} 'a las' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},E={date:s({formats:z,defaultWidth:"full"}),time:s({formats:V,defaultWidth:"full"}),dateTime:s({formats:X,defaultWidth:"full"})},F={lastWeek:"'el' eeee 'pasado a la' p",yesterday:"'ayer a la' p",today:"'hoy a la' p",tomorrow:"'mañana a la' p",nextWeek:"eeee 'a la' p",other:"P"},L={lastWeek:"'el' eeee 'pasado a las' p",yesterday:"'ayer a las' p",today:"'hoy a las' p",tomorrow:"'mañana a las' p",nextWeek:"eeee 'a las' p",other:"P"},H=function(e,r,a,n){return r.getUTCHours()!==1?L[e]:F[e]},R={narrow:["AC","DC"],abbreviated:["AC","DC"],wide:["antes de cristo","después de cristo"]},_={narrow:["1","2","3","4"],abbreviated:["T1","T2","T3","T4"],wide:["1º trimestre","2º trimestre","3º trimestre","4º trimestre"]},Y={narrow:["e","f","m","a","m","j","j","a","s","o","n","d"],abbreviated:["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],wide:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"]},q={narrow:["d","l","m","m","j","v","s"],short:["do","lu","ma","mi","ju","vi","sá"],abbreviated:["dom","lun","mar","mié","jue","vie","sáb"],wide:["domingo","lunes","martes","miércoles","jueves","viernes","sábado"]},A={narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"mañana",afternoon:"tarde",evening:"tarde",night:"noche"},abbreviated:{am:"AM",pm:"PM",midnight:"medianoche",noon:"mediodia",morning:"mañana",afternoon:"tarde",evening:"tarde",night:"noche"},wide:{am:"a.m.",pm:"p.m.",midnight:"medianoche",noon:"mediodia",morning:"mañana",afternoon:"tarde",evening:"tarde",night:"noche"}},U={narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"de la mañana",afternoon:"de la tarde",evening:"de la tarde",night:"de la noche"},abbreviated:{am:"AM",pm:"PM",midnight:"medianoche",noon:"mediodia",morning:"de la mañana",afternoon:"de la tarde",evening:"de la tarde",night:"de la noche"},wide:{am:"a.m.",pm:"p.m.",midnight:"medianoche",noon:"mediodia",morning:"de la mañana",afternoon:"de la tarde",evening:"de la tarde",night:"de la noche"}},Q=function(e,r){var a=Number(e);return a+"º"},I={ordinalNumber:Q,era:o({values:R,defaultWidth:"wide"}),quarter:o({values:_,defaultWidth:"wide",argumentCallback:function(e){return Number(e)-1}}),month:o({values:Y,defaultWidth:"wide"}),day:o({values:q,defaultWidth:"wide"}),dayPeriod:o({values:A,defaultWidth:"wide",formattingValues:U,defaultFormattingWidth:"wide"})},G=/^(\d+)(º)?/i,B=/\d+/i,J={narrow:/^(ac|dc|a|d)/i,abbreviated:/^(a\.?\s?c\.?|a\.?\s?e\.?\s?c\.?|d\.?\s?c\.?|e\.?\s?c\.?)/i,wide:/^(antes de cristo|antes de la era com[uú]n|despu[eé]s de cristo|era com[uú]n)/i},K={any:[/^ac/i,/^dc/i],wide:[/^(antes de cristo|antes de la era com[uú]n)/i,/^(despu[eé]s de cristo|era com[uú]n)/i]},Z={narrow:/^[1234]/i,abbreviated:/^T[1234]/i,wide:/^[1234](º)? trimestre/i},ee={any:[/1/i,/2/i,/3/i,/4/i]},ae={narrow:/^[efmajsond]/i,abbreviated:/^(ene|feb|mar|abr|may|jun|jul|ago|sep|oct|nov|dic)/i,wide:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i},te={narrow:[/^e/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^en/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i]},re={narrow:/^[dlmjvs]/i,short:/^(do|lu|ma|mi|ju|vi|s[áa])/i,abbreviated:/^(dom|lun|mar|mi[ée]|jue|vie|s[áa]b)/i,wide:/^(domingo|lunes|martes|mi[ée]rcoles|jueves|viernes|s[áa]bado)/i},ne={narrow:[/^d/i,/^l/i,/^m/i,/^m/i,/^j/i,/^v/i,/^s/i],any:[/^do/i,/^lu/i,/^ma/i,/^mi/i,/^ju/i,/^vi/i,/^sa/i]},ie={narrow:/^(a|p|mn|md|(de la|a las) (mañana|tarde|noche))/i,any:/^([ap]\.?\s?m\.?|medianoche|mediodia|(de la|a las) (mañana|tarde|noche))/i},oe={any:{am:/^a/i,pm:/^p/i,midnight:/^mn/i,noon:/^md/i,morning:/mañana/i,afternoon:/tarde/i,evening:/tarde/i,night:/noche/i}},de={ordinalNumber:k({matchPattern:G,parsePattern:B,valueCallback:function(e){return parseInt(e,10)}}),era:d({matchPatterns:J,defaultMatchWidth:"wide",parsePatterns:K,defaultParseWidth:"any"}),quarter:d({matchPatterns:Z,defaultMatchWidth:"wide",parsePatterns:ee,defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:d({matchPatterns:ae,defaultMatchWidth:"wide",parsePatterns:te,defaultParseWidth:"any"}),day:d({matchPatterns:re,defaultMatchWidth:"wide",parsePatterns:ne,defaultParseWidth:"any"}),dayPeriod:d({matchPatterns:ie,defaultMatchWidth:"any",parsePatterns:oe,defaultParseWidth:"any"})},P={code:"es",formatDistance:O,formatLong:E,formatRelative:H,localize:I,match:de,options:{weekStartsOn:1,firstWeekContainsDate:1}},se={lessThanXSeconds:{one:"不到 1 秒",other:"不到 {{count}} 秒"},xSeconds:{one:"1 秒",other:"{{count}} 秒"},halfAMinute:"半分钟",lessThanXMinutes:{one:"不到 1 分钟",other:"不到 {{count}} 分钟"},xMinutes:{one:"1 分钟",other:"{{count}} 分钟"},xHours:{one:"1 小时",other:"{{count}} 小时"},aboutXHours:{one:"大约 1 小时",other:"大约 {{count}} 小时"},xDays:{one:"1 天",other:"{{count}} 天"},aboutXWeeks:{one:"大约 1 个星期",other:"大约 {{count}} 个星期"},xWeeks:{one:"1 个星期",other:"{{count}} 个星期"},aboutXMonths:{one:"大约 1 个月",other:"大约 {{count}} 个月"},xMonths:{one:"1 个月",other:"{{count}} 个月"},aboutXYears:{one:"大约 1 年",other:"大约 {{count}} 年"},xYears:{one:"1 年",other:"{{count}} 年"},overXYears:{one:"超过 1 年",other:"超过 {{count}} 年"},almostXYears:{one:"将近 1 年",other:"将近 {{count}} 年"}},me=function(e,r,a){var n,i=se[e];return typeof i=="string"?n=i:r===1?n=i.one:n=i.other.replace("{{count}}",String(r)),a!=null&&a.addSuffix?a.comparison&&a.comparison>0?n+"内":n+"前":n},ue={full:"y'年'M'月'd'日' EEEE",long:"y'年'M'月'd'日'",medium:"yyyy-MM-dd",short:"yy-MM-dd"},le={full:"zzzz a h:mm:ss",long:"z a h:mm:ss",medium:"a h:mm:ss",short:"a h:mm"},ce={full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},he={date:s({formats:ue,defaultWidth:"full"}),time:s({formats:le,defaultWidth:"full"}),dateTime:s({formats:ce,defaultWidth:"full"})};function ve(t,e,r){g(2,arguments);var a=p(t,r),n=p(e,r);return a.getTime()===n.getTime()}function W(t,e,r){var a="eeee p";return ve(t,e,r)?a:t.getTime()>e.getTime()?"'下个'"+a:"'上个'"+a}var fe={lastWeek:W,yesterday:"'昨天' p",today:"'今天' p",tomorrow:"'明天' p",nextWeek:W,other:"PP p"},ge=function(e,r,a,n){var i=fe[e];return typeof i=="function"?i(r,a,n):i},be={narrow:["前","公元"],abbreviated:["前","公元"],wide:["公元前","公元"]},we={narrow:["1","2","3","4"],abbreviated:["第一季","第二季","第三季","第四季"],wide:["第一季度","第二季度","第三季度","第四季度"]},ye={narrow:["一","二","三","四","五","六","七","八","九","十","十一","十二"],abbreviated:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],wide:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]},pe={narrow:["日","一","二","三","四","五","六"],short:["日","一","二","三","四","五","六"],abbreviated:["周日","周一","周二","周三","周四","周五","周六"],wide:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"]},Pe={narrow:{am:"上",pm:"下",midnight:"凌晨",noon:"午",morning:"早",afternoon:"下午",evening:"晚",night:"夜"},abbreviated:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"},wide:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"}},We={narrow:{am:"上",pm:"下",midnight:"凌晨",noon:"午",morning:"早",afternoon:"下午",evening:"晚",night:"夜"},abbreviated:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"},wide:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"}},Me=function(e,r){var a=Number(e);switch(r==null?void 0:r.unit){case"date":return a.toString()+"日";case"hour":return a.toString()+"时";case"minute":return a.toString()+"分";case"second":return a.toString()+"秒";default:return"第 "+a.toString()}},ke={ordinalNumber:Me,era:o({values:be,defaultWidth:"wide"}),quarter:o({values:we,defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:o({values:ye,defaultWidth:"wide"}),day:o({values:pe,defaultWidth:"wide"}),dayPeriod:o({values:Pe,defaultWidth:"wide",formattingValues:We,defaultFormattingWidth:"wide"})},$e=/^(第\s*)?\d+(日|时|分|秒)?/i,De=/\d+/i,Ce={narrow:/^(前)/i,abbreviated:/^(前)/i,wide:/^(公元前|公元)/i},Se={any:[/^(前)/i,/^(公元)/i]},Te={narrow:/^[1234]/i,abbreviated:/^第[一二三四]刻/i,wide:/^第[一二三四]刻钟/i},je={any:[/(1|一)/i,/(2|二)/i,/(3|三)/i,/(4|四)/i]},xe={narrow:/^(一|二|三|四|五|六|七|八|九|十[二一])/i,abbreviated:/^(一|二|三|四|五|六|七|八|九|十[二一]|\d|1[12])月/i,wide:/^(一|二|三|四|五|六|七|八|九|十[二一])月/i},Ne={narrow:[/^一/i,/^二/i,/^三/i,/^四/i,/^五/i,/^六/i,/^七/i,/^八/i,/^九/i,/^十(?!(一|二))/i,/^十一/i,/^十二/i],any:[/^一|1/i,/^二|2/i,/^三|3/i,/^四|4/i,/^五|5/i,/^六|6/i,/^七|7/i,/^八|8/i,/^九|9/i,/^十(?!(一|二))|10/i,/^十一|11/i,/^十二|12/i]},Oe={narrow:/^[一二三四五六日]/i,short:/^[一二三四五六日]/i,abbreviated:/^周[一二三四五六日]/i,wide:/^星期[一二三四五六日]/i},ze={any:[/日/i,/一/i,/二/i,/三/i,/四/i,/五/i,/六/i]},Ve={any:/^(上午?|下午?|午夜|[中正]午|早上?|下午|晚上?|凌晨|)/i},Xe={any:{am:/^上午?/i,pm:/^下午?/i,midnight:/^午夜/i,noon:/^[中正]午/i,morning:/^早上/i,afternoon:/^下午/i,evening:/^晚上?/i,night:/^凌晨/i}},Ee={ordinalNumber:k({matchPattern:$e,parsePattern:De,valueCallback:function(e){return parseInt(e,10)}}),era:d({matchPatterns:Ce,defaultMatchWidth:"wide",parsePatterns:Se,defaultParseWidth:"any"}),quarter:d({matchPatterns:Te,defaultMatchWidth:"wide",parsePatterns:je,defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:d({matchPatterns:xe,defaultMatchWidth:"wide",parsePatterns:Ne,defaultParseWidth:"any"}),day:d({matchPatterns:Oe,defaultMatchWidth:"wide",parsePatterns:ze,defaultParseWidth:"any"}),dayPeriod:d({matchPatterns:Ve,defaultMatchWidth:"any",parsePatterns:Xe,defaultParseWidth:"any"})},M={code:"zh-CN",formatDistance:me,formatLong:he,formatRelative:ge,localize:ke,match:Ee,options:{weekStartsOn:1,firstWeekContainsDate:4}};const Fe={en:y,"en-EN":y,es:P,"es-ES":P,zh:M,"zh-CN":M};function _e(t,e={}){return x(t,Le(e))}function Ye(t){return t>3600?f("time.hours",{amount:Number((t/3600).toFixed(1)).toLocaleString()}):t>60?f("time.minutes",{amount:Math.round(t/60)}):f("time.seconds",{amount:Math.round(t)})}function Le(t){const e=Fe[S().locale];return e?{...t,locale:e}:{...t}}export{_e as a,Ye as f,p as s};
@@ -1,4 +1,4 @@
1
- import{q as J}from"./index-CqMSvM9y.js";var Z=function(y){var b={};function a(r){if(b[r])return b[r].exports;var o=b[r]={i:r,l:!1,exports:{}};return y[r].call(o.exports,o,o.exports,a),o.l=!0,o.exports}return a.m=y,a.c=b,a.d=function(r,o,l){a.o(r,o)||Object.defineProperty(r,o,{enumerable:!0,get:l})},a.r=function(r){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})},a.t=function(r,o){if(1&o&&(r=a(r)),8&o||4&o&&typeof r=="object"&&r&&r.__esModule)return r;var l=Object.create(null);if(a.r(l),Object.defineProperty(l,"default",{enumerable:!0,value:r}),2&o&&typeof r!="string")for(var u in r)a.d(l,u,(function(R){return r[R]}).bind(null,u));return l},a.n=function(r){var o=r&&r.__esModule?function(){return r.default}:function(){return r};return a.d(o,"a",o),o},a.o=function(r,o){return Object.prototype.hasOwnProperty.call(r,o)},a.p="",a(a.s=3)}([function(y,b){y.exports=function(a){return a&&a.__esModule?a:{default:a}}},function(y,b){y.exports=function(a,r){if(!(a instanceof r))throw new TypeError("Cannot call a class as a function")}},function(y,b,a){function r(){return Math.floor(9e4*Math.random())+1e4}Object.defineProperty(b,"__esModule",{value:!0}),b.sendAsyncWrapper=function(o,l){var u=this;return new Promise(function(R,x){u.sendAsync({jsonrpc:"2.0",id:r(),method:o,params:l||[]},function(T,A){T?x(T):R(A.result)})})},b.sendFortmaticAsyncWrapper=function(o){var l=this;return new Promise(function(u,R){l.getProvider().sendFortmaticAsync(o,function(x,T){x?R(x):u(T?T.result:{})})})},b.randomId=r,b.findExistingResponse=function(o,l){for(var u=0;u<o.length;u++)if(o[u].id===l)return o[u];return null}},function(y,b,a){y.exports=a(4)},function(y,b,a){var r=a(0),o=r(a(1)),l=r(a(5)),u=a(2),R="fm_composeSend",x="fm_logout",T="fm_get_balances",A="fm_get_transactions",w="fm_is_logged_in",P="fm_accountSettings",n="fm_deposit",s="fm_get_user",c="fm_configure",f={};y.exports=function g(_,O,I){var m=this;if((0,o.default)(this,g),this.fortmaticClient="https://x2.fortmatic.com",!_)throw new Error("Please provide a Fortmatic API key that you acquired from the developer dashboard.");this.apiKey=_,this.options=I,this.ethNetwork=O,this.queryParams=btoa(JSON.stringify({API_KEY:_,ETH_NETWORK:O})),this.transactions={send:function(h,M){var C=new v(R,{to:h.to,value:h.amount});m.getProvider().sendFortmaticAsync(C,M)}},this.getProvider=function(){return f["fortmatic-".concat(m.queryParams)]||(f["fortmatic-".concat(m.queryParams)]=new l.default(m.fortmaticClient,{API_KEY:_,ETH_NETWORK:O})),f["fortmatic-".concat(m.queryParams)]},this.user={login:function(){return m.getProvider().enable()},logout:function(){m.getProvider().account=null,m.getProvider().network=null;var h=new v(x);return u.sendFortmaticAsyncWrapper.call(m,h)},getUser:function(){var h=new v(s);return u.sendFortmaticAsyncWrapper.call(m,h)},getBalances:function(){var h=new v(T);return u.sendFortmaticAsyncWrapper.call(m,h)},getTransactions:function(){var h=new v(A);return u.sendFortmaticAsyncWrapper.call(m,h)},isLoggedIn:function(){var h=new v(w);return u.sendFortmaticAsyncWrapper.call(m,h)},settings:function(){var h=new v(P);return u.sendFortmaticAsyncWrapper.call(m,h)},deposit:function(h){var M=new v(n,h);return u.sendFortmaticAsyncWrapper.call(m,M)}},this.configure=function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},M=new v(c);return M.params=[h],u.sendFortmaticAsyncWrapper.call(m,M)}};var v=function g(_,O){(0,o.default)(this,g),this.id=(0,u.randomId)(),this.method=_,this.params=O?[O]:[{}]}},function(y,b,a){var r=a(0);Object.defineProperty(b,"__esModule",{value:!0}),b.default=void 0;var o=r(a(6)),l=r(a(9)),u=r(a(1)),R=r(a(10)),x=a(11),T=r(a(12)),A=a(2),w=function(){function P(n,s){if((0,u.default)(this,P),this.fortmaticClient=n,this.requests={},this.queue=[],this.account=null,this.network=null,this.isFortmatic=!0,this.overlayReady=!1,this.isLoggedIn=!1,this.postMessages={FORTMATIC_HANDLE_BATCH_REQUEST:"FORTMATIC_HANDLE_BATCH_REQUEST",FORTMATIC_HANDLE_REQUEST:"FORTMATIC_HANDLE_REQUEST",FORTMATIC_HANDLE_FORTMATIC_REQUEST:"FORTMATIC_HANDLE_FORTMATIC_REQUEST",FORTMATIC_HANDLE_RESPONSE:"FORTMATIC_HANDLE_RESPONSE",FORTMATIC_OVERLAY_READY:"FORTMATIC_OVERLAY_READY",FORTMATIC_SHOW_OVERLAY:"FORTMATIC_SHOW_OVERLAY",FORTMATIC_HIDE_OVERLAY:"FORTMATIC_HIDE_OVERLAY",FORTMATIC_USER_DENIED:"FORTMATIC_USER_DENIED",FORTMATIC_USER_LOGOUT:"FORTMATIC_USER_LOGOUT",FORTMATIC_UNAUTHORIZED_API_KEY:"FORTMATIC_UNAUTHORIZED_API_KEY"},!s.API_KEY)throw new Error("Please provide a Fortmatic API key that you acquired from the developer dashboard.");this.options={API_KEY:s.API_KEY,ETH_NETWORK:s.ETH_NETWORK,DOMAIN_ORIGIN:window.location?window.location.origin:"",version:x.version},this.queryParams=btoa(JSON.stringify(this.options)),this.constructPostMessage(),this.overlay=this.createOverlay(),this.listenMessage()}return(0,R.default)(P,[{key:"constructPostMessage",value:function(){var n=this;Object.keys(this.postMessages).map(function(s){n.postMessages[s]+="-".concat(n.queryParams)})}},{key:"createOverlay",value:function(){var n=this;return new Promise(function(s,c){var f=function(){if(function(){var O=!0,I=!1,m=void 0;try{for(var h,M=document.getElementsByClassName("fortmatic-iframe")[Symbol.iterator]();!(O=(h=M.next()).done);O=!0)if(h.value.src.includes(n.queryParams))return!1}catch(C){I=!0,m=C}finally{try{O||M.return==null||M.return()}finally{if(I)throw m}}return!0}()){var v=document.createElement("style");v.innerHTML=T.default.css,v.type="text/css",document.head.appendChild(v);var g=document.createElement("iframe");g.className="fortmatic-iframe",g.src="".concat(n.fortmaticClient,"/send?params=").concat(n.queryParams),document.body.appendChild(g);var _=document.createElement("img");_.src="https://static.fortmatic.com/assets/trans.gif",document.body.appendChild(_),s({iframe:g})}else console.error("Fortmatic: Duplicate instances found.")};["loaded","interactive","complete"].indexOf(document.readyState)>-1?f():window.addEventListener("load",f.bind(n),!1)})}},{key:"showOverlay",value:function(){var n=(0,l.default)(o.default.mark(function s(){return o.default.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return c.next=2,this.overlay;case 2:c.sent.iframe.style.display="block";case 4:case"end":return c.stop()}},s,this)}));return function(){return n.apply(this,arguments)}}()},{key:"hideOverlay",value:function(){var n=(0,l.default)(o.default.mark(function s(){return o.default.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return c.next=2,this.overlay;case 2:c.sent.iframe.style.display="none";case 4:case"end":return c.stop()}},s,this)}));return function(){return n.apply(this,arguments)}}()},{key:"sendAsync",value:function(n,s){n.length>0?this.enqueue({payload:{id:(0,A.randomId)(),batch:n.map(function(c){return c.id=(0,A.randomId)(),c}),method:"eth_batchRequest"},cb:s}):this.enqueue({payload:n,cb:s})}},{key:"sendFortmaticAsync",value:function(n,s){this.enqueue({payload:n,cb:s,isNative:!0})}},{key:"send",value:function(n,s){if(typeof n=="string")return A.sendAsyncWrapper.call(this,n,s);if(!s){console.warn("Non-async web3 methods will be deprecated in web3 > 1.0, and are not supported by the Fortmatic provider. An async method to be used instead."),this.sendAsync(n,function(){});var c={};switch(n.method){case"eth_accounts":c=this.account?[this.account]:[];break;case"eth_coinbase":c=this.account;break;case"net_version":c=this.network||(this.options.API_KEY.startsWith("pk_live")?1:4);break;case"eth_uninstallFilter":c=!0;break;default:c={}}return{id:n.id,jsonrpc:n.jsonrpc,result:c}}this.sendAsync(n,s)}},{key:"enqueue",value:function(n){this.queue.push(n),this.overlayReady&&this.dequeue()}},{key:"dequeue",value:function(){var n=(0,l.default)(o.default.mark(function s(){var c,f,v,g=this;return o.default.wrap(function(_){for(;;)switch(_.prev=_.next){case 0:if(this.queue.length!==0){_.next=2;break}return _.abrupt("return");case 2:if(!(c=this.queue.shift())){_.next=11;break}return f=c.payload,v=c.cb,f.id=(0,A.randomId)(),_.next=9,this.postMessage(c.isNative?this.postMessages.FORTMATIC_HANDLE_FORTMATIC_REQUEST:this.postMessages.FORTMATIC_HANDLE_REQUEST,c.payload);case 9:f.batch&&f.batch.length>0?(f.batch.forEach(function(O){g.requests[O.id]={parentId:f.id,payload:O,cb:function(I,m){var h=g.requests[f.id].batchResponse;if(I&&I.response&&!(0,A.findExistingResponse)(h,I.response.id))throw h.push({jsonrpc:"2.0",id:I.response.id,error:{code:I.response.code,message:I.response.message}}),g.requests[f.id].cb(null,h),I.response;if(m&&m.result&&!(0,A.findExistingResponse)(h,m.id))return h.push(m);throw new Error("Fortmatic: unexpected callback behavior")}}}),this.requests[f.id]={payload:f,cb:v,batchResponse:[]}):this.requests[f.id]={payload:f,cb:v},this.dequeue();case 11:case"end":return _.stop()}},s,this)}));return function(){return n.apply(this,arguments)}}()},{key:"postMessage",value:function(){var n=(0,l.default)(o.default.mark(function s(c,f){var v;return o.default.wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return g.next=2,this.overlay;case 2:if(!(v=g.sent).iframe.contentWindow){g.next=7;break}v.iframe.contentWindow.postMessage({msgType:c,payload:f},"*"),g.next=8;break;case 7:throw new Error("Fortmatic: Modal is not ready.");case 8:case"end":return g.stop()}},s,this)}));return function(s,c){return n.apply(this,arguments)}}()},{key:"enable",value:function(){return A.sendAsyncWrapper.call(this,"eth_accounts")}},{key:"listenMessage",value:function(){var n=this;window.addEventListener("message",function(s){if(s.origin===n.fortmaticClient){var c=s.data.response?s.data.response.id:null;switch(s.data.msgType){case n.postMessages.FORTMATIC_OVERLAY_READY:n.overlayReady=!0,n.dequeue();break;case n.postMessages.FORTMATIC_HANDLE_RESPONSE:try{n.requests[c].cb(null,s.data.response);var f=n.requests[c].parentId;f&&n.requests[f].payload.batch.length===n.requests[f].batchResponse.length&&n.requests[f].cb(null,n.requests[f].batchResponse),n.requests[c].payload.method==="eth_accounts"?n.account=s.data.response.result[0]:n.requests[c].payload.method==="eth_coinbase"?n.account=s.data.response.result:n.requests[c].payload.method==="net_version"&&(n.network=s.data.response.result)}catch{}n.isLoggedIn=!0,n.dequeue();break;case n.postMessages.FORTMATIC_HIDE_OVERLAY:n.hideOverlay();break;case n.postMessages.FORTMATIC_SHOW_OVERLAY:n.showOverlay();break;case n.postMessages.FORTMATIC_USER_LOGOUT:n.account=null,n.network=null,n.isLoggedIn=!1;break;case n.postMessages.FORTMATIC_UNAUTHORIZED_API_KEY:throw n.overlayReady=!1,new Error("Given API key is not authorized to access the resource.");case n.postMessages.FORTMATIC_USER_DENIED:if(c){var v=s.data.response&&s.data.response.message?s.data.response.message:"Fortmatic: Modal was closed without executing action!",g=s.data.response&&s.data.response.code?s.data.response.code:1;n.requests[c].cb({message:v,code:g,response:s.data.response})}else n.queue.forEach(function(_){return _.cb({message:"Fortmatic: Modal was closed without executing action!",code:1})});n.dequeue()}}})}}]),P}();b.default=w},function(y,b,a){y.exports=a(7)},function(y,b,a){var r=function(){return this||typeof self=="object"&&self}()||Function("return this")(),o=r.regeneratorRuntime&&Object.getOwnPropertyNames(r).indexOf("regeneratorRuntime")>=0,l=o&&r.regeneratorRuntime;if(r.regeneratorRuntime=void 0,y.exports=a(8),o)r.regeneratorRuntime=l;else try{delete r.regeneratorRuntime}catch{r.regeneratorRuntime=void 0}},function(y,b){(function(a){var r,o=Object.prototype,l=o.hasOwnProperty,u=typeof Symbol=="function"?Symbol:{},R=u.iterator||"@@iterator",x=u.asyncIterator||"@@asyncIterator",T=u.toStringTag||"@@toStringTag",A=typeof y=="object",w=a.regeneratorRuntime;if(w)A&&(y.exports=w);else{(w=a.regeneratorRuntime=A?y.exports:{}).wrap=I;var P="suspendedStart",n="suspendedYield",s="executing",c="completed",f={},v={};v[R]=function(){return this};var g=Object.getPrototypeOf,_=g&&g(g(G([])));_&&_!==o&&l.call(_,R)&&(v=_);var O=C.prototype=h.prototype=Object.create(v);M.prototype=O.constructor=C,C.constructor=M,C[T]=M.displayName="GeneratorFunction",w.isGeneratorFunction=function(t){var e=typeof t=="function"&&t.constructor;return!!e&&(e===M||(e.displayName||e.name)==="GeneratorFunction")},w.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,C):(t.__proto__=C,T in t||(t[T]="GeneratorFunction")),t.prototype=Object.create(O),t},w.awrap=function(t){return{__await:t}},V(U.prototype),U.prototype[x]=function(){return this},w.AsyncIterator=U,w.async=function(t,e,d,p){var i=new U(I(t,e,d,p));return w.isGeneratorFunction(e)?i:i.next().then(function(F){return F.done?F.value:i.next()})},V(O),O[T]="Generator",O[R]=function(){return this},O.toString=function(){return"[object Generator]"},w.keys=function(t){var e=[];for(var d in t)e.push(d);return e.reverse(),function p(){for(;e.length;){var i=e.pop();if(i in t)return p.value=i,p.done=!1,p}return p.done=!0,p}},w.values=G,K.prototype={constructor:K,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(Y),!t)for(var e in this)e.charAt(0)==="t"&&l.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=r)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if(t.type==="throw")throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function d(W,E){return F.type="throw",F.arg=t,e.next=W,E&&(e.method="next",e.arg=r),!!E}for(var p=this.tryEntries.length-1;p>=0;--p){var i=this.tryEntries[p],F=i.completion;if(i.tryLoc==="root")return d("end");if(i.tryLoc<=this.prev){var j=l.call(i,"catchLoc"),q=l.call(i,"finallyLoc");if(j&&q){if(this.prev<i.catchLoc)return d(i.catchLoc,!0);if(this.prev<i.finallyLoc)return d(i.finallyLoc)}else if(j){if(this.prev<i.catchLoc)return d(i.catchLoc,!0)}else{if(!q)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return d(i.finallyLoc)}}}},abrupt:function(t,e){for(var d=this.tryEntries.length-1;d>=0;--d){var p=this.tryEntries[d];if(p.tryLoc<=this.prev&&l.call(p,"finallyLoc")&&this.prev<p.finallyLoc){var i=p;break}}i&&(t==="break"||t==="continue")&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var F=i?i.completion:{};return F.type=t,F.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(F)},complete:function(t,e){if(t.type==="throw")throw t.arg;return t.type==="break"||t.type==="continue"?this.next=t.arg:t.type==="return"?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):t.type==="normal"&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var d=this.tryEntries[e];if(d.finallyLoc===t)return this.complete(d.completion,d.afterLoc),Y(d),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var d=this.tryEntries[e];if(d.tryLoc===t){var p=d.completion;if(p.type==="throw"){var i=p.arg;Y(d)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,d){return this.delegate={iterator:G(t),resultName:e,nextLoc:d},this.method==="next"&&(this.arg=r),f}}}function I(t,e,d,p){var i=e&&e.prototype instanceof h?e:h,F=Object.create(i.prototype),j=new K(p||[]);return F._invoke=function(q,W,E){var k=P;return function(S,D){if(k===s)throw new Error("Generator is already running");if(k===c){if(S==="throw")throw D;return Q()}for(E.method=S,E.arg=D;;){var H=E.delegate;if(H){var N=B(H,E);if(N){if(N===f)continue;return N}}if(E.method==="next")E.sent=E._sent=E.arg;else if(E.method==="throw"){if(k===P)throw k=c,E.arg;E.dispatchException(E.arg)}else E.method==="return"&&E.abrupt("return",E.arg);k=s;var L=m(q,W,E);if(L.type==="normal"){if(k=E.done?c:n,L.arg===f)continue;return{value:L.arg,done:E.done}}L.type==="throw"&&(k=c,E.method="throw",E.arg=L.arg)}}}(t,d,j),F}function m(t,e,d){try{return{type:"normal",arg:t.call(e,d)}}catch(p){return{type:"throw",arg:p}}}function h(){}function M(){}function C(){}function V(t){["next","throw","return"].forEach(function(e){t[e]=function(d){return this._invoke(e,d)}})}function U(t){var e;this._invoke=function(d,p){function i(){return new Promise(function(F,j){(function q(W,E,k,S){var D=m(t[W],t,E);if(D.type!=="throw"){var H=D.arg,N=H.value;return N&&typeof N=="object"&&l.call(N,"__await")?Promise.resolve(N.__await).then(function(L){q("next",L,k,S)},function(L){q("throw",L,k,S)}):Promise.resolve(N).then(function(L){H.value=L,k(H)},function(L){return q("throw",L,k,S)})}S(D.arg)})(d,p,F,j)})}return e=e?e.then(i,i):i()}}function B(t,e){var d=t.iterator[e.method];if(d===r){if(e.delegate=null,e.method==="throw"){if(t.iterator.return&&(e.method="return",e.arg=r,B(t,e),e.method==="throw"))return f;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var p=m(d,t.iterator,e.arg);if(p.type==="throw")return e.method="throw",e.arg=p.arg,e.delegate=null,f;var i=p.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,e.method!=="return"&&(e.method="next",e.arg=r),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function z(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function Y(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function K(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(z,this),this.reset(!0)}function G(t){if(t){var e=t[R];if(e)return e.call(t);if(typeof t.next=="function")return t;if(!isNaN(t.length)){var d=-1,p=function i(){for(;++d<t.length;)if(l.call(t,d))return i.value=t[d],i.done=!1,i;return i.value=r,i.done=!0,i};return p.next=p}}return{next:Q}}function Q(){return{value:r,done:!0}}})(function(){return this||typeof self=="object"&&self}()||Function("return this")())},function(y,b){function a(r,o,l,u,R,x,T){try{var A=r[x](T),w=A.value}catch(P){return void l(P)}A.done?o(w):Promise.resolve(w).then(u,R)}y.exports=function(r){return function(){var o=this,l=arguments;return new Promise(function(u,R){var x=r.apply(o,l);function T(w){a(x,u,R,T,A,"next",w)}function A(w){a(x,u,R,T,A,"throw",w)}T(void 0)})}}},function(y,b){function a(r,o){for(var l=0;l<o.length;l++){var u=o[l];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(r,u.key,u)}}y.exports=function(r,o,l){return o&&a(r.prototype,o),l&&a(r,l),r}},function(y){y.exports={name:"fortmatic",version:"1.1.3",description:"Fortmatic Javascript SDK",main:"lib/fortmatic.js",scripts:{build:"WEBPACK_ENV=production webpack","build:dev":"WEBPACK_ENV=development BABEL_ENV=development webpack --progress --colors --watch",test:"nyc --reporter=lcov --reporter=text-summary ava"},author:"Fortmatic <team@fortmatic.com> (https://fortmatic.com/)",license:"MIT",repository:{type:"git",url:"https://github.com/fortmatic/fortmatic-js"},keywords:["Auth","Login","Web3","Crypto","Ethereum","MetaMask","Wallet","Blockchain","Dapp"],homepage:"https://www.fortmatic.com",ava:{require:["@babel/register"],files:["test/**/*.spec.js"],babel:{testOptions:{presets:["@babel/env"],plugins:["@babel/plugin-proposal-function-bind","@babel/plugin-transform-runtime"]}},verbose:!0},nyc:{all:!1,"check-coverage":!0,"per-file":!0,lines:80,statements:80,functions:80,branches:80,include:["src/**/*.js"],exclude:["*/style.js"],require:[],reporter:["html","lcov"]},dependencies:{"@babel/runtime":"7.3.4"},devDependencies:{"@babel/core":"7.3.4","@babel/plugin-proposal-function-bind":"7.2.0","@babel/plugin-transform-modules-commonjs":"7.2.0","@babel/plugin-transform-runtime":"7.3.4","@babel/preset-env":"7.3.4","@babel/register":"7.0.0",ava:"2.2.0","babel-eslint":"10.0.1","babel-loader":"8.0.5",eslint:"5.9.0",lodash:"4.17.11",nyc:"13.1.0",sinon:"7.1.1",webpack:"4.26.1","webpack-cli":"3.1.2"}}},function(y,b,a){b.css=`
1
+ import{q as J}from"./index-Cl1nwlEZ.js";var Z=function(y){var b={};function a(r){if(b[r])return b[r].exports;var o=b[r]={i:r,l:!1,exports:{}};return y[r].call(o.exports,o,o.exports,a),o.l=!0,o.exports}return a.m=y,a.c=b,a.d=function(r,o,l){a.o(r,o)||Object.defineProperty(r,o,{enumerable:!0,get:l})},a.r=function(r){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})},a.t=function(r,o){if(1&o&&(r=a(r)),8&o||4&o&&typeof r=="object"&&r&&r.__esModule)return r;var l=Object.create(null);if(a.r(l),Object.defineProperty(l,"default",{enumerable:!0,value:r}),2&o&&typeof r!="string")for(var u in r)a.d(l,u,(function(R){return r[R]}).bind(null,u));return l},a.n=function(r){var o=r&&r.__esModule?function(){return r.default}:function(){return r};return a.d(o,"a",o),o},a.o=function(r,o){return Object.prototype.hasOwnProperty.call(r,o)},a.p="",a(a.s=3)}([function(y,b){y.exports=function(a){return a&&a.__esModule?a:{default:a}}},function(y,b){y.exports=function(a,r){if(!(a instanceof r))throw new TypeError("Cannot call a class as a function")}},function(y,b,a){function r(){return Math.floor(9e4*Math.random())+1e4}Object.defineProperty(b,"__esModule",{value:!0}),b.sendAsyncWrapper=function(o,l){var u=this;return new Promise(function(R,x){u.sendAsync({jsonrpc:"2.0",id:r(),method:o,params:l||[]},function(T,A){T?x(T):R(A.result)})})},b.sendFortmaticAsyncWrapper=function(o){var l=this;return new Promise(function(u,R){l.getProvider().sendFortmaticAsync(o,function(x,T){x?R(x):u(T?T.result:{})})})},b.randomId=r,b.findExistingResponse=function(o,l){for(var u=0;u<o.length;u++)if(o[u].id===l)return o[u];return null}},function(y,b,a){y.exports=a(4)},function(y,b,a){var r=a(0),o=r(a(1)),l=r(a(5)),u=a(2),R="fm_composeSend",x="fm_logout",T="fm_get_balances",A="fm_get_transactions",w="fm_is_logged_in",P="fm_accountSettings",n="fm_deposit",s="fm_get_user",c="fm_configure",f={};y.exports=function g(_,O,I){var m=this;if((0,o.default)(this,g),this.fortmaticClient="https://x2.fortmatic.com",!_)throw new Error("Please provide a Fortmatic API key that you acquired from the developer dashboard.");this.apiKey=_,this.options=I,this.ethNetwork=O,this.queryParams=btoa(JSON.stringify({API_KEY:_,ETH_NETWORK:O})),this.transactions={send:function(h,M){var C=new v(R,{to:h.to,value:h.amount});m.getProvider().sendFortmaticAsync(C,M)}},this.getProvider=function(){return f["fortmatic-".concat(m.queryParams)]||(f["fortmatic-".concat(m.queryParams)]=new l.default(m.fortmaticClient,{API_KEY:_,ETH_NETWORK:O})),f["fortmatic-".concat(m.queryParams)]},this.user={login:function(){return m.getProvider().enable()},logout:function(){m.getProvider().account=null,m.getProvider().network=null;var h=new v(x);return u.sendFortmaticAsyncWrapper.call(m,h)},getUser:function(){var h=new v(s);return u.sendFortmaticAsyncWrapper.call(m,h)},getBalances:function(){var h=new v(T);return u.sendFortmaticAsyncWrapper.call(m,h)},getTransactions:function(){var h=new v(A);return u.sendFortmaticAsyncWrapper.call(m,h)},isLoggedIn:function(){var h=new v(w);return u.sendFortmaticAsyncWrapper.call(m,h)},settings:function(){var h=new v(P);return u.sendFortmaticAsyncWrapper.call(m,h)},deposit:function(h){var M=new v(n,h);return u.sendFortmaticAsyncWrapper.call(m,M)}},this.configure=function(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},M=new v(c);return M.params=[h],u.sendFortmaticAsyncWrapper.call(m,M)}};var v=function g(_,O){(0,o.default)(this,g),this.id=(0,u.randomId)(),this.method=_,this.params=O?[O]:[{}]}},function(y,b,a){var r=a(0);Object.defineProperty(b,"__esModule",{value:!0}),b.default=void 0;var o=r(a(6)),l=r(a(9)),u=r(a(1)),R=r(a(10)),x=a(11),T=r(a(12)),A=a(2),w=function(){function P(n,s){if((0,u.default)(this,P),this.fortmaticClient=n,this.requests={},this.queue=[],this.account=null,this.network=null,this.isFortmatic=!0,this.overlayReady=!1,this.isLoggedIn=!1,this.postMessages={FORTMATIC_HANDLE_BATCH_REQUEST:"FORTMATIC_HANDLE_BATCH_REQUEST",FORTMATIC_HANDLE_REQUEST:"FORTMATIC_HANDLE_REQUEST",FORTMATIC_HANDLE_FORTMATIC_REQUEST:"FORTMATIC_HANDLE_FORTMATIC_REQUEST",FORTMATIC_HANDLE_RESPONSE:"FORTMATIC_HANDLE_RESPONSE",FORTMATIC_OVERLAY_READY:"FORTMATIC_OVERLAY_READY",FORTMATIC_SHOW_OVERLAY:"FORTMATIC_SHOW_OVERLAY",FORTMATIC_HIDE_OVERLAY:"FORTMATIC_HIDE_OVERLAY",FORTMATIC_USER_DENIED:"FORTMATIC_USER_DENIED",FORTMATIC_USER_LOGOUT:"FORTMATIC_USER_LOGOUT",FORTMATIC_UNAUTHORIZED_API_KEY:"FORTMATIC_UNAUTHORIZED_API_KEY"},!s.API_KEY)throw new Error("Please provide a Fortmatic API key that you acquired from the developer dashboard.");this.options={API_KEY:s.API_KEY,ETH_NETWORK:s.ETH_NETWORK,DOMAIN_ORIGIN:window.location?window.location.origin:"",version:x.version},this.queryParams=btoa(JSON.stringify(this.options)),this.constructPostMessage(),this.overlay=this.createOverlay(),this.listenMessage()}return(0,R.default)(P,[{key:"constructPostMessage",value:function(){var n=this;Object.keys(this.postMessages).map(function(s){n.postMessages[s]+="-".concat(n.queryParams)})}},{key:"createOverlay",value:function(){var n=this;return new Promise(function(s,c){var f=function(){if(function(){var O=!0,I=!1,m=void 0;try{for(var h,M=document.getElementsByClassName("fortmatic-iframe")[Symbol.iterator]();!(O=(h=M.next()).done);O=!0)if(h.value.src.includes(n.queryParams))return!1}catch(C){I=!0,m=C}finally{try{O||M.return==null||M.return()}finally{if(I)throw m}}return!0}()){var v=document.createElement("style");v.innerHTML=T.default.css,v.type="text/css",document.head.appendChild(v);var g=document.createElement("iframe");g.className="fortmatic-iframe",g.src="".concat(n.fortmaticClient,"/send?params=").concat(n.queryParams),document.body.appendChild(g);var _=document.createElement("img");_.src="https://static.fortmatic.com/assets/trans.gif",document.body.appendChild(_),s({iframe:g})}else console.error("Fortmatic: Duplicate instances found.")};["loaded","interactive","complete"].indexOf(document.readyState)>-1?f():window.addEventListener("load",f.bind(n),!1)})}},{key:"showOverlay",value:function(){var n=(0,l.default)(o.default.mark(function s(){return o.default.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return c.next=2,this.overlay;case 2:c.sent.iframe.style.display="block";case 4:case"end":return c.stop()}},s,this)}));return function(){return n.apply(this,arguments)}}()},{key:"hideOverlay",value:function(){var n=(0,l.default)(o.default.mark(function s(){return o.default.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return c.next=2,this.overlay;case 2:c.sent.iframe.style.display="none";case 4:case"end":return c.stop()}},s,this)}));return function(){return n.apply(this,arguments)}}()},{key:"sendAsync",value:function(n,s){n.length>0?this.enqueue({payload:{id:(0,A.randomId)(),batch:n.map(function(c){return c.id=(0,A.randomId)(),c}),method:"eth_batchRequest"},cb:s}):this.enqueue({payload:n,cb:s})}},{key:"sendFortmaticAsync",value:function(n,s){this.enqueue({payload:n,cb:s,isNative:!0})}},{key:"send",value:function(n,s){if(typeof n=="string")return A.sendAsyncWrapper.call(this,n,s);if(!s){console.warn("Non-async web3 methods will be deprecated in web3 > 1.0, and are not supported by the Fortmatic provider. An async method to be used instead."),this.sendAsync(n,function(){});var c={};switch(n.method){case"eth_accounts":c=this.account?[this.account]:[];break;case"eth_coinbase":c=this.account;break;case"net_version":c=this.network||(this.options.API_KEY.startsWith("pk_live")?1:4);break;case"eth_uninstallFilter":c=!0;break;default:c={}}return{id:n.id,jsonrpc:n.jsonrpc,result:c}}this.sendAsync(n,s)}},{key:"enqueue",value:function(n){this.queue.push(n),this.overlayReady&&this.dequeue()}},{key:"dequeue",value:function(){var n=(0,l.default)(o.default.mark(function s(){var c,f,v,g=this;return o.default.wrap(function(_){for(;;)switch(_.prev=_.next){case 0:if(this.queue.length!==0){_.next=2;break}return _.abrupt("return");case 2:if(!(c=this.queue.shift())){_.next=11;break}return f=c.payload,v=c.cb,f.id=(0,A.randomId)(),_.next=9,this.postMessage(c.isNative?this.postMessages.FORTMATIC_HANDLE_FORTMATIC_REQUEST:this.postMessages.FORTMATIC_HANDLE_REQUEST,c.payload);case 9:f.batch&&f.batch.length>0?(f.batch.forEach(function(O){g.requests[O.id]={parentId:f.id,payload:O,cb:function(I,m){var h=g.requests[f.id].batchResponse;if(I&&I.response&&!(0,A.findExistingResponse)(h,I.response.id))throw h.push({jsonrpc:"2.0",id:I.response.id,error:{code:I.response.code,message:I.response.message}}),g.requests[f.id].cb(null,h),I.response;if(m&&m.result&&!(0,A.findExistingResponse)(h,m.id))return h.push(m);throw new Error("Fortmatic: unexpected callback behavior")}}}),this.requests[f.id]={payload:f,cb:v,batchResponse:[]}):this.requests[f.id]={payload:f,cb:v},this.dequeue();case 11:case"end":return _.stop()}},s,this)}));return function(){return n.apply(this,arguments)}}()},{key:"postMessage",value:function(){var n=(0,l.default)(o.default.mark(function s(c,f){var v;return o.default.wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return g.next=2,this.overlay;case 2:if(!(v=g.sent).iframe.contentWindow){g.next=7;break}v.iframe.contentWindow.postMessage({msgType:c,payload:f},"*"),g.next=8;break;case 7:throw new Error("Fortmatic: Modal is not ready.");case 8:case"end":return g.stop()}},s,this)}));return function(s,c){return n.apply(this,arguments)}}()},{key:"enable",value:function(){return A.sendAsyncWrapper.call(this,"eth_accounts")}},{key:"listenMessage",value:function(){var n=this;window.addEventListener("message",function(s){if(s.origin===n.fortmaticClient){var c=s.data.response?s.data.response.id:null;switch(s.data.msgType){case n.postMessages.FORTMATIC_OVERLAY_READY:n.overlayReady=!0,n.dequeue();break;case n.postMessages.FORTMATIC_HANDLE_RESPONSE:try{n.requests[c].cb(null,s.data.response);var f=n.requests[c].parentId;f&&n.requests[f].payload.batch.length===n.requests[f].batchResponse.length&&n.requests[f].cb(null,n.requests[f].batchResponse),n.requests[c].payload.method==="eth_accounts"?n.account=s.data.response.result[0]:n.requests[c].payload.method==="eth_coinbase"?n.account=s.data.response.result:n.requests[c].payload.method==="net_version"&&(n.network=s.data.response.result)}catch{}n.isLoggedIn=!0,n.dequeue();break;case n.postMessages.FORTMATIC_HIDE_OVERLAY:n.hideOverlay();break;case n.postMessages.FORTMATIC_SHOW_OVERLAY:n.showOverlay();break;case n.postMessages.FORTMATIC_USER_LOGOUT:n.account=null,n.network=null,n.isLoggedIn=!1;break;case n.postMessages.FORTMATIC_UNAUTHORIZED_API_KEY:throw n.overlayReady=!1,new Error("Given API key is not authorized to access the resource.");case n.postMessages.FORTMATIC_USER_DENIED:if(c){var v=s.data.response&&s.data.response.message?s.data.response.message:"Fortmatic: Modal was closed without executing action!",g=s.data.response&&s.data.response.code?s.data.response.code:1;n.requests[c].cb({message:v,code:g,response:s.data.response})}else n.queue.forEach(function(_){return _.cb({message:"Fortmatic: Modal was closed without executing action!",code:1})});n.dequeue()}}})}}]),P}();b.default=w},function(y,b,a){y.exports=a(7)},function(y,b,a){var r=function(){return this||typeof self=="object"&&self}()||Function("return this")(),o=r.regeneratorRuntime&&Object.getOwnPropertyNames(r).indexOf("regeneratorRuntime")>=0,l=o&&r.regeneratorRuntime;if(r.regeneratorRuntime=void 0,y.exports=a(8),o)r.regeneratorRuntime=l;else try{delete r.regeneratorRuntime}catch{r.regeneratorRuntime=void 0}},function(y,b){(function(a){var r,o=Object.prototype,l=o.hasOwnProperty,u=typeof Symbol=="function"?Symbol:{},R=u.iterator||"@@iterator",x=u.asyncIterator||"@@asyncIterator",T=u.toStringTag||"@@toStringTag",A=typeof y=="object",w=a.regeneratorRuntime;if(w)A&&(y.exports=w);else{(w=a.regeneratorRuntime=A?y.exports:{}).wrap=I;var P="suspendedStart",n="suspendedYield",s="executing",c="completed",f={},v={};v[R]=function(){return this};var g=Object.getPrototypeOf,_=g&&g(g(G([])));_&&_!==o&&l.call(_,R)&&(v=_);var O=C.prototype=h.prototype=Object.create(v);M.prototype=O.constructor=C,C.constructor=M,C[T]=M.displayName="GeneratorFunction",w.isGeneratorFunction=function(t){var e=typeof t=="function"&&t.constructor;return!!e&&(e===M||(e.displayName||e.name)==="GeneratorFunction")},w.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,C):(t.__proto__=C,T in t||(t[T]="GeneratorFunction")),t.prototype=Object.create(O),t},w.awrap=function(t){return{__await:t}},V(U.prototype),U.prototype[x]=function(){return this},w.AsyncIterator=U,w.async=function(t,e,d,p){var i=new U(I(t,e,d,p));return w.isGeneratorFunction(e)?i:i.next().then(function(F){return F.done?F.value:i.next()})},V(O),O[T]="Generator",O[R]=function(){return this},O.toString=function(){return"[object Generator]"},w.keys=function(t){var e=[];for(var d in t)e.push(d);return e.reverse(),function p(){for(;e.length;){var i=e.pop();if(i in t)return p.value=i,p.done=!1,p}return p.done=!0,p}},w.values=G,K.prototype={constructor:K,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(Y),!t)for(var e in this)e.charAt(0)==="t"&&l.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=r)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if(t.type==="throw")throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function d(W,E){return F.type="throw",F.arg=t,e.next=W,E&&(e.method="next",e.arg=r),!!E}for(var p=this.tryEntries.length-1;p>=0;--p){var i=this.tryEntries[p],F=i.completion;if(i.tryLoc==="root")return d("end");if(i.tryLoc<=this.prev){var j=l.call(i,"catchLoc"),q=l.call(i,"finallyLoc");if(j&&q){if(this.prev<i.catchLoc)return d(i.catchLoc,!0);if(this.prev<i.finallyLoc)return d(i.finallyLoc)}else if(j){if(this.prev<i.catchLoc)return d(i.catchLoc,!0)}else{if(!q)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return d(i.finallyLoc)}}}},abrupt:function(t,e){for(var d=this.tryEntries.length-1;d>=0;--d){var p=this.tryEntries[d];if(p.tryLoc<=this.prev&&l.call(p,"finallyLoc")&&this.prev<p.finallyLoc){var i=p;break}}i&&(t==="break"||t==="continue")&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var F=i?i.completion:{};return F.type=t,F.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(F)},complete:function(t,e){if(t.type==="throw")throw t.arg;return t.type==="break"||t.type==="continue"?this.next=t.arg:t.type==="return"?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):t.type==="normal"&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var d=this.tryEntries[e];if(d.finallyLoc===t)return this.complete(d.completion,d.afterLoc),Y(d),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var d=this.tryEntries[e];if(d.tryLoc===t){var p=d.completion;if(p.type==="throw"){var i=p.arg;Y(d)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,d){return this.delegate={iterator:G(t),resultName:e,nextLoc:d},this.method==="next"&&(this.arg=r),f}}}function I(t,e,d,p){var i=e&&e.prototype instanceof h?e:h,F=Object.create(i.prototype),j=new K(p||[]);return F._invoke=function(q,W,E){var k=P;return function(S,D){if(k===s)throw new Error("Generator is already running");if(k===c){if(S==="throw")throw D;return Q()}for(E.method=S,E.arg=D;;){var H=E.delegate;if(H){var N=B(H,E);if(N){if(N===f)continue;return N}}if(E.method==="next")E.sent=E._sent=E.arg;else if(E.method==="throw"){if(k===P)throw k=c,E.arg;E.dispatchException(E.arg)}else E.method==="return"&&E.abrupt("return",E.arg);k=s;var L=m(q,W,E);if(L.type==="normal"){if(k=E.done?c:n,L.arg===f)continue;return{value:L.arg,done:E.done}}L.type==="throw"&&(k=c,E.method="throw",E.arg=L.arg)}}}(t,d,j),F}function m(t,e,d){try{return{type:"normal",arg:t.call(e,d)}}catch(p){return{type:"throw",arg:p}}}function h(){}function M(){}function C(){}function V(t){["next","throw","return"].forEach(function(e){t[e]=function(d){return this._invoke(e,d)}})}function U(t){var e;this._invoke=function(d,p){function i(){return new Promise(function(F,j){(function q(W,E,k,S){var D=m(t[W],t,E);if(D.type!=="throw"){var H=D.arg,N=H.value;return N&&typeof N=="object"&&l.call(N,"__await")?Promise.resolve(N.__await).then(function(L){q("next",L,k,S)},function(L){q("throw",L,k,S)}):Promise.resolve(N).then(function(L){H.value=L,k(H)},function(L){return q("throw",L,k,S)})}S(D.arg)})(d,p,F,j)})}return e=e?e.then(i,i):i()}}function B(t,e){var d=t.iterator[e.method];if(d===r){if(e.delegate=null,e.method==="throw"){if(t.iterator.return&&(e.method="return",e.arg=r,B(t,e),e.method==="throw"))return f;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var p=m(d,t.iterator,e.arg);if(p.type==="throw")return e.method="throw",e.arg=p.arg,e.delegate=null,f;var i=p.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,e.method!=="return"&&(e.method="next",e.arg=r),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function z(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function Y(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function K(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(z,this),this.reset(!0)}function G(t){if(t){var e=t[R];if(e)return e.call(t);if(typeof t.next=="function")return t;if(!isNaN(t.length)){var d=-1,p=function i(){for(;++d<t.length;)if(l.call(t,d))return i.value=t[d],i.done=!1,i;return i.value=r,i.done=!0,i};return p.next=p}}return{next:Q}}function Q(){return{value:r,done:!0}}})(function(){return this||typeof self=="object"&&self}()||Function("return this")())},function(y,b){function a(r,o,l,u,R,x,T){try{var A=r[x](T),w=A.value}catch(P){return void l(P)}A.done?o(w):Promise.resolve(w).then(u,R)}y.exports=function(r){return function(){var o=this,l=arguments;return new Promise(function(u,R){var x=r.apply(o,l);function T(w){a(x,u,R,T,A,"next",w)}function A(w){a(x,u,R,T,A,"throw",w)}T(void 0)})}}},function(y,b){function a(r,o){for(var l=0;l<o.length;l++){var u=o[l];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(r,u.key,u)}}y.exports=function(r,o,l){return o&&a(r.prototype,o),l&&a(r,l),r}},function(y){y.exports={name:"fortmatic",version:"1.1.3",description:"Fortmatic Javascript SDK",main:"lib/fortmatic.js",scripts:{build:"WEBPACK_ENV=production webpack","build:dev":"WEBPACK_ENV=development BABEL_ENV=development webpack --progress --colors --watch",test:"nyc --reporter=lcov --reporter=text-summary ava"},author:"Fortmatic <team@fortmatic.com> (https://fortmatic.com/)",license:"MIT",repository:{type:"git",url:"https://github.com/fortmatic/fortmatic-js"},keywords:["Auth","Login","Web3","Crypto","Ethereum","MetaMask","Wallet","Blockchain","Dapp"],homepage:"https://www.fortmatic.com",ava:{require:["@babel/register"],files:["test/**/*.spec.js"],babel:{testOptions:{presets:["@babel/env"],plugins:["@babel/plugin-proposal-function-bind","@babel/plugin-transform-runtime"]}},verbose:!0},nyc:{all:!1,"check-coverage":!0,"per-file":!0,lines:80,statements:80,functions:80,branches:80,include:["src/**/*.js"],exclude:["*/style.js"],require:[],reporter:["html","lcov"]},dependencies:{"@babel/runtime":"7.3.4"},devDependencies:{"@babel/core":"7.3.4","@babel/plugin-proposal-function-bind":"7.2.0","@babel/plugin-transform-modules-commonjs":"7.2.0","@babel/plugin-transform-runtime":"7.3.4","@babel/preset-env":"7.3.4","@babel/register":"7.0.0",ava:"2.2.0","babel-eslint":"10.0.1","babel-loader":"8.0.5",eslint:"5.9.0",lodash:"4.17.11",nyc:"13.1.0",sinon:"7.1.1",webpack:"4.26.1","webpack-cli":"3.1.2"}}},function(y,b,a){b.css=`
2
2
  .fortmatic-iframe {
3
3
  display: none;
4
4
  position: fixed;
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-D6SmRk4Y.js","assets/index-CqMSvM9y.js","assets/index-DAGqj9bY.css"])))=>i.map(i=>d[i]);
2
- import{B as pe,_ as me}from"./index-CqMSvM9y.js";const he=Symbol(),ee=Object.getPrototypeOf,Y=new WeakMap,ge=e=>e&&(Y.has(e)?Y.get(e):ee(e)===Object.prototype||ee(e)===Array.prototype),ye=e=>ge(e)&&e[he]||null,te=(e,t=!0)=>{Y.set(e,t)},z={BASE_URL:"https://cdn.decentraland.org/@dcl/builder-site/7.7.1",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_BASE_URL:"https://cdn.decentraland.org/@dcl/builder-site/7.7.1",VITE_REACT_APP_WEBSITE_VERSION:"7.7.1"},F=e=>typeof e=="object"&&e!==null,C=new WeakMap,x=new WeakSet,ve=(e=Object.is,t=(o,g)=>new Proxy(o,g),s=o=>F(o)&&!x.has(o)&&(Array.isArray(o)||!(Symbol.iterator in o))&&!(o instanceof WeakMap)&&!(o instanceof WeakSet)&&!(o instanceof Error)&&!(o instanceof Number)&&!(o instanceof Date)&&!(o instanceof String)&&!(o instanceof RegExp)&&!(o instanceof ArrayBuffer),n=o=>{switch(o.status){case"fulfilled":return o.value;case"rejected":throw o.reason;default:throw o}},l=new WeakMap,c=(o,g,I=n)=>{const v=l.get(o);if((v==null?void 0:v[0])===g)return v[1];const b=Array.isArray(o)?[]:Object.create(Object.getPrototypeOf(o));return te(b,!0),l.set(o,[g,b]),Reflect.ownKeys(o).forEach(j=>{if(Object.getOwnPropertyDescriptor(b,j))return;const O=Reflect.get(o,j),A={value:O,enumerable:!0,configurable:!0};if(x.has(O))te(O,!1);else if(O instanceof Promise)delete A.value,A.get=()=>I(O);else if(C.has(O)){const[y,H]=C.get(O);A.value=c(y,H(),I)}Object.defineProperty(b,j,A)}),Object.preventExtensions(b)},d=new WeakMap,f=[1,1],W=o=>{if(!F(o))throw new Error("object required");const g=d.get(o);if(g)return g;let I=f[0];const v=new Set,b=(i,a=++f[0])=>{I!==a&&(I=a,v.forEach(r=>r(i,a)))};let j=f[1];const O=(i=++f[1])=>(j!==i&&!v.size&&(j=i,y.forEach(([a])=>{const r=a[1](i);r>I&&(I=r)})),I),A=i=>(a,r)=>{const h=[...a];h[1]=[i,...h[1]],b(h,r)},y=new Map,H=(i,a)=>{if((z?"production":void 0)!=="production"&&y.has(i))throw new Error("prop listener already exists");if(v.size){const r=a[3](A(i));y.set(i,[a,r])}else y.set(i,[a])},Z=i=>{var a;const r=y.get(i);r&&(y.delete(i),(a=r[1])==null||a.call(r))},ue=i=>(v.add(i),v.size===1&&y.forEach(([r,h],U)=>{if((z?"production":void 0)!=="production"&&h)throw new Error("remove already exists");const N=r[3](A(U));y.set(U,[r,N])}),()=>{v.delete(i),v.size===0&&y.forEach(([r,h],U)=>{h&&(h(),y.set(U,[r]))})}),q=Array.isArray(o)?[]:Object.create(Object.getPrototypeOf(o)),k=t(q,{deleteProperty(i,a){const r=Reflect.get(i,a);Z(a);const h=Reflect.deleteProperty(i,a);return h&&b(["delete",[a],r]),h},set(i,a,r,h){const U=Reflect.has(i,a),N=Reflect.get(i,a,h);if(U&&(e(N,r)||d.has(r)&&e(N,d.get(r))))return!0;Z(a),F(r)&&(r=ye(r)||r);let V=r;if(r instanceof Promise)r.then(L=>{r.status="fulfilled",r.value=L,b(["resolve",[a],L])}).catch(L=>{r.status="rejected",r.reason=L,b(["reject",[a],L])});else{!C.has(r)&&s(r)&&(V=W(r));const L=!x.has(V)&&C.get(V);L&&H(a,L)}return Reflect.set(i,a,V,h),b(["set",[a],r,N]),!0}});d.set(o,k);const fe=[q,O,c,ue];return C.set(k,fe),Reflect.ownKeys(o).forEach(i=>{const a=Object.getOwnPropertyDescriptor(o,i);"value"in a&&(k[i]=o[i],delete a.value,delete a.writable),Object.defineProperty(q,i,a)}),k})=>[W,C,x,e,t,s,n,l,c,d,f],[be]=ve();function P(e={}){return be(e)}function D(e,t,s){const n=C.get(e);(z?"production":void 0)!=="production"&&!n&&console.warn("Please use proxy object");let l;const c=[],d=n[3];let f=!1;const o=d(g=>{c.push(g),l||(l=Promise.resolve().then(()=>{l=void 0,f&&t(c.splice(0))}))});return f=!0,()=>{f=!1,o()}}function we(e,t){const s=C.get(e);(z?"production":void 0)!=="production"&&!s&&console.warn("Please use proxy object");const[n,l,c]=s;return c(n,l(),t)}const u=P({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),de={state:u,subscribe(e){return D(u,()=>e(u))},push(e,t){e!==u.view&&(u.view=e,t&&(u.data=t),u.history.push(e))},reset(e){u.view=e,u.history=[e]},replace(e){u.history.length>1&&(u.history[u.history.length-1]=e,u.view=e)},goBack(){if(u.history.length>1){u.history.pop();const[e]=u.history.slice(-1);u.view=e}},setData(e){u.data=e}},m={WALLETCONNECT_DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE",WCM_VERSION:"WCM_VERSION",RECOMMENDED_WALLET_AMOUNT:9,isMobile(){return typeof window<"u"?!!(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)):!1},isAndroid(){return m.isMobile()&&navigator.userAgent.toLowerCase().includes("android")},isIos(){const e=navigator.userAgent.toLowerCase();return m.isMobile()&&(e.includes("iphone")||e.includes("ipad"))},isHttpUrl(e){return e.startsWith("http://")||e.startsWith("https://")},isArray(e){return Array.isArray(e)&&e.length>0},isTelegram(){return typeof window<"u"&&(!!window.TelegramWebviewProxy||!!window.Telegram||!!window.TelegramWebviewProxyProto)},formatNativeUrl(e,t,s){if(m.isHttpUrl(e))return this.formatUniversalUrl(e,t,s);let n=e;n.includes("://")||(n=e.replaceAll("/","").replaceAll(":",""),n=`${n}://`),n.endsWith("/")||(n=`${n}/`),this.setWalletConnectDeepLink(n,s);const l=encodeURIComponent(t);return`${n}wc?uri=${l}`},formatUniversalUrl(e,t,s){if(!m.isHttpUrl(e))return this.formatNativeUrl(e,t,s);let n=e;if(n.startsWith("https://t.me")){const c=pe.from(t).toString("base64").replace(/[=]/g,"");n.endsWith("/")&&(n=n.slice(0,-1)),this.setWalletConnectDeepLink(n,s);const d=new URL(n);return d.searchParams.set("startapp",c),d.toString()}n.endsWith("/")||(n=`${n}/`),this.setWalletConnectDeepLink(n,s);const l=encodeURIComponent(t);return`${n}wc?uri=${l}`},async wait(e){return new Promise(t=>{setTimeout(t,e)})},openHref(e,t){const s=this.isTelegram()?"_blank":t;window.open(e,s,"noreferrer noopener")},setWalletConnectDeepLink(e,t){try{localStorage.setItem(m.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:e,name:t}))}catch{console.info("Unable to set WalletConnect deep link")}},setWalletConnectAndroidDeepLink(e){try{const[t]=e.split("?");localStorage.setItem(m.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:t,name:"Android"}))}catch{console.info("Unable to set WalletConnect android deep link")}},removeWalletConnectDeepLink(){try{localStorage.removeItem(m.WALLETCONNECT_DEEPLINK_CHOICE)}catch{console.info("Unable to remove WalletConnect deep link")}},setModalVersionInStorage(){try{typeof localStorage<"u"&&localStorage.setItem(m.WCM_VERSION,"2.7.0")}catch{console.info("Unable to set Web3Modal version in storage")}},getWalletRouterData(){var e;const t=(e=de.state.data)==null?void 0:e.Wallet;if(!t)throw new Error('Missing "Wallet" view data');return t}},Ie=typeof location<"u"&&(location.hostname.includes("localhost")||location.protocol.includes("https")),p=P({enabled:Ie,userSessionId:"",events:[],connectedWalletId:void 0}),_e={state:p,subscribe(e){return D(p.events,()=>e(we(p.events[p.events.length-1])))},initialize(){p.enabled&&typeof(crypto==null?void 0:crypto.randomUUID)<"u"&&(p.userSessionId=crypto.randomUUID())},setConnectedWalletId(e){p.connectedWalletId=e},click(e){if(p.enabled){const t={type:"CLICK",name:e.name,userSessionId:p.userSessionId,timestamp:Date.now(),data:e};p.events.push(t)}},track(e){if(p.enabled){const t={type:"TRACK",name:e.name,userSessionId:p.userSessionId,timestamp:Date.now(),data:e};p.events.push(t)}},view(e){if(p.enabled){const t={type:"VIEW",name:e.name,userSessionId:p.userSessionId,timestamp:Date.now(),data:e};p.events.push(t)}}},_=P({chains:void 0,walletConnectUri:void 0,isAuth:!1,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1}),w={state:_,subscribe(e){return D(_,()=>e(_))},setChains(e){_.chains=e},setWalletConnectUri(e){_.walletConnectUri=e},setIsCustomDesktop(e){_.isCustomDesktop=e},setIsCustomMobile(e){_.isCustomMobile=e},setIsDataLoaded(e){_.isDataLoaded=e},setIsUiLoaded(e){_.isUiLoaded=e},setIsAuth(e){_.isAuth=e}},B=P({projectId:"",mobileWallets:void 0,desktopWallets:void 0,walletImages:void 0,chains:void 0,enableAuthMode:!1,enableExplorer:!0,explorerExcludedWalletIds:void 0,explorerRecommendedWalletIds:void 0,termsOfServiceUrl:void 0,privacyPolicyUrl:void 0}),$={state:B,subscribe(e){return D(B,()=>e(B))},setConfig(e){var t,s;_e.initialize(),w.setChains(e.chains),w.setIsAuth(!!e.enableAuthMode),w.setIsCustomMobile(!!((t=e.mobileWallets)!=null&&t.length)),w.setIsCustomDesktop(!!((s=e.desktopWallets)!=null&&s.length)),m.setModalVersionInStorage(),Object.assign(B,e)}};var Ee=Object.defineProperty,se=Object.getOwnPropertySymbols,Oe=Object.prototype.hasOwnProperty,We=Object.prototype.propertyIsEnumerable,ne=(e,t,s)=>t in e?Ee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Le=(e,t)=>{for(var s in t||(t={}))Oe.call(t,s)&&ne(e,s,t[s]);if(se)for(var s of se(t))We.call(t,s)&&ne(e,s,t[s]);return e};const G="https://explorer-api.walletconnect.com",Q="wcm",X="js-2.7.0";async function K(e,t){const s=Le({sdkType:Q,sdkVersion:X},t),n=new URL(e,G);return n.searchParams.append("projectId",$.state.projectId),Object.entries(s).forEach(([c,d])=>{d&&n.searchParams.append(c,String(d))}),(await fetch(n)).json()}const S={async getDesktopListings(e){return K("/w3m/v1/getDesktopListings",e)},async getMobileListings(e){return K("/w3m/v1/getMobileListings",e)},async getInjectedListings(e){return K("/w3m/v1/getInjectedListings",e)},async getAllListings(e){return K("/w3m/v1/getAllListings",e)},getWalletImageUrl(e){return`${G}/w3m/v1/getWalletImage/${e}?projectId=${$.state.projectId}&sdkType=${Q}&sdkVersion=${X}`},getAssetImageUrl(e){return`${G}/w3m/v1/getAssetImage/${e}?projectId=${$.state.projectId}&sdkType=${Q}&sdkVersion=${X}`}};var Ce=Object.defineProperty,oe=Object.getOwnPropertySymbols,Pe=Object.prototype.hasOwnProperty,Ae=Object.prototype.propertyIsEnumerable,re=(e,t,s)=>t in e?Ce(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Se=(e,t)=>{for(var s in t||(t={}))Pe.call(t,s)&&re(e,s,t[s]);if(oe)for(var s of oe(t))Ae.call(t,s)&&re(e,s,t[s]);return e};const ae=m.isMobile(),E=P({wallets:{listings:[],total:0,page:1},search:{listings:[],total:0,page:1},recomendedWallets:[]}),ke={state:E,async getRecomendedWallets(){const{explorerRecommendedWalletIds:e,explorerExcludedWalletIds:t}=$.state;if(e==="NONE"||t==="ALL"&&!e)return E.recomendedWallets;if(m.isArray(e)){const n={recommendedIds:e.join(",")},{listings:l}=await S.getAllListings(n),c=Object.values(l);c.sort((d,f)=>{const W=e.indexOf(d.id),o=e.indexOf(f.id);return W-o}),E.recomendedWallets=c}else{const{chains:s,isAuth:n}=w.state,l=s==null?void 0:s.join(","),c=m.isArray(t),d={page:1,sdks:n?"auth_v1":void 0,entries:m.RECOMMENDED_WALLET_AMOUNT,chains:l,version:2,excludedIds:c?t.join(","):void 0},{listings:f}=ae?await S.getMobileListings(d):await S.getDesktopListings(d);E.recomendedWallets=Object.values(f)}return E.recomendedWallets},async getWallets(e){const t=Se({},e),{explorerRecommendedWalletIds:s,explorerExcludedWalletIds:n}=$.state,{recomendedWallets:l}=E;if(n==="ALL")return E.wallets;l.length?t.excludedIds=l.map(I=>I.id).join(","):m.isArray(s)&&(t.excludedIds=s.join(",")),m.isArray(n)&&(t.excludedIds=[t.excludedIds,n].filter(Boolean).join(",")),w.state.isAuth&&(t.sdks="auth_v1");const{page:c,search:d}=e,{listings:f,total:W}=ae?await S.getMobileListings(t):await S.getDesktopListings(t),o=Object.values(f),g=d?"search":"wallets";return E[g]={listings:[...E[g].listings,...o],total:W,page:c??1},{listings:o,total:W}},getWalletImageUrl(e){return S.getWalletImageUrl(e)},getAssetImageUrl(e){return S.getAssetImageUrl(e)},resetSearch(){E.search={listings:[],total:0,page:1}}},T=P({open:!1}),J={state:T,subscribe(e){return D(T,()=>e(T))},async open(e){return new Promise(t=>{const{isUiLoaded:s,isDataLoaded:n}=w.state;if(m.removeWalletConnectDeepLink(),w.setWalletConnectUri(e==null?void 0:e.uri),w.setChains(e==null?void 0:e.chains),de.reset("ConnectWallet"),s&&n)T.open=!0,t();else{const l=setInterval(()=>{const c=w.state;c.isUiLoaded&&c.isDataLoaded&&(clearInterval(l),T.open=!0,t())},200)}})},close(){T.open=!1}};var Me=Object.defineProperty,ie=Object.getOwnPropertySymbols,De=Object.prototype.hasOwnProperty,je=Object.prototype.propertyIsEnumerable,le=(e,t,s)=>t in e?Me(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Ue=(e,t)=>{for(var s in t||(t={}))De.call(t,s)&&le(e,s,t[s]);if(ie)for(var s of ie(t))je.call(t,s)&&le(e,s,t[s]);return e};function Te(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}const R=P({themeMode:Te()?"dark":"light"}),ce={state:R,subscribe(e){return D(R,()=>e(R))},setThemeConfig(e){const{themeMode:t,themeVariables:s}=e;t&&(R.themeMode=t),s&&(R.themeVariables=Ue({},s))}},M=P({open:!1,message:"",variant:"success"}),Ve={state:M,subscribe(e){return D(M,()=>e(M))},openToast(e,t){M.open=!0,M.message=e,M.variant=t},closeToast(){M.open=!1}};class $e{constructor(t){this.openModal=J.open,this.closeModal=J.close,this.subscribeModal=J.subscribe,this.setTheme=ce.setThemeConfig,ce.setThemeConfig(t),$.setConfig(t),this.initUi()}async initUi(){if(typeof window<"u"){await me(()=>import("./index-D6SmRk4Y.js"),__vite__mapDeps([0,1,2]));const t=document.createElement("wcm-modal");document.body.insertAdjacentElement("beforeend",t),w.setIsUiLoaded(!0)}}}const xe=Object.freeze(Object.defineProperty({__proto__:null,WalletConnectModal:$e},Symbol.toStringTag,{value:"Module"}));export{m as C,ke as E,J as M,w as O,de as R,ce as T,Ve as a,_e as b,$ as c,xe as i};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-e-oSLOvi.js","assets/index-Cl1nwlEZ.js","assets/index-BMOuxAbC.css"])))=>i.map(i=>d[i]);
2
+ import{B as pe,_ as me}from"./index-Cl1nwlEZ.js";const he=Symbol(),ee=Object.getPrototypeOf,Y=new WeakMap,ge=e=>e&&(Y.has(e)?Y.get(e):ee(e)===Object.prototype||ee(e)===Array.prototype),ye=e=>ge(e)&&e[he]||null,te=(e,t=!0)=>{Y.set(e,t)},z={BASE_URL:"https://cdn.decentraland.org/@dcl/builder-site/7.7.2",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_BASE_URL:"https://cdn.decentraland.org/@dcl/builder-site/7.7.2",VITE_REACT_APP_WEBSITE_VERSION:"7.7.2"},F=e=>typeof e=="object"&&e!==null,C=new WeakMap,x=new WeakSet,ve=(e=Object.is,t=(o,g)=>new Proxy(o,g),s=o=>F(o)&&!x.has(o)&&(Array.isArray(o)||!(Symbol.iterator in o))&&!(o instanceof WeakMap)&&!(o instanceof WeakSet)&&!(o instanceof Error)&&!(o instanceof Number)&&!(o instanceof Date)&&!(o instanceof String)&&!(o instanceof RegExp)&&!(o instanceof ArrayBuffer),n=o=>{switch(o.status){case"fulfilled":return o.value;case"rejected":throw o.reason;default:throw o}},l=new WeakMap,c=(o,g,I=n)=>{const v=l.get(o);if((v==null?void 0:v[0])===g)return v[1];const b=Array.isArray(o)?[]:Object.create(Object.getPrototypeOf(o));return te(b,!0),l.set(o,[g,b]),Reflect.ownKeys(o).forEach(j=>{if(Object.getOwnPropertyDescriptor(b,j))return;const O=Reflect.get(o,j),A={value:O,enumerable:!0,configurable:!0};if(x.has(O))te(O,!1);else if(O instanceof Promise)delete A.value,A.get=()=>I(O);else if(C.has(O)){const[y,H]=C.get(O);A.value=c(y,H(),I)}Object.defineProperty(b,j,A)}),Object.preventExtensions(b)},d=new WeakMap,f=[1,1],W=o=>{if(!F(o))throw new Error("object required");const g=d.get(o);if(g)return g;let I=f[0];const v=new Set,b=(i,a=++f[0])=>{I!==a&&(I=a,v.forEach(r=>r(i,a)))};let j=f[1];const O=(i=++f[1])=>(j!==i&&!v.size&&(j=i,y.forEach(([a])=>{const r=a[1](i);r>I&&(I=r)})),I),A=i=>(a,r)=>{const h=[...a];h[1]=[i,...h[1]],b(h,r)},y=new Map,H=(i,a)=>{if((z?"production":void 0)!=="production"&&y.has(i))throw new Error("prop listener already exists");if(v.size){const r=a[3](A(i));y.set(i,[a,r])}else y.set(i,[a])},Z=i=>{var a;const r=y.get(i);r&&(y.delete(i),(a=r[1])==null||a.call(r))},ue=i=>(v.add(i),v.size===1&&y.forEach(([r,h],U)=>{if((z?"production":void 0)!=="production"&&h)throw new Error("remove already exists");const N=r[3](A(U));y.set(U,[r,N])}),()=>{v.delete(i),v.size===0&&y.forEach(([r,h],U)=>{h&&(h(),y.set(U,[r]))})}),q=Array.isArray(o)?[]:Object.create(Object.getPrototypeOf(o)),k=t(q,{deleteProperty(i,a){const r=Reflect.get(i,a);Z(a);const h=Reflect.deleteProperty(i,a);return h&&b(["delete",[a],r]),h},set(i,a,r,h){const U=Reflect.has(i,a),N=Reflect.get(i,a,h);if(U&&(e(N,r)||d.has(r)&&e(N,d.get(r))))return!0;Z(a),F(r)&&(r=ye(r)||r);let V=r;if(r instanceof Promise)r.then(L=>{r.status="fulfilled",r.value=L,b(["resolve",[a],L])}).catch(L=>{r.status="rejected",r.reason=L,b(["reject",[a],L])});else{!C.has(r)&&s(r)&&(V=W(r));const L=!x.has(V)&&C.get(V);L&&H(a,L)}return Reflect.set(i,a,V,h),b(["set",[a],r,N]),!0}});d.set(o,k);const fe=[q,O,c,ue];return C.set(k,fe),Reflect.ownKeys(o).forEach(i=>{const a=Object.getOwnPropertyDescriptor(o,i);"value"in a&&(k[i]=o[i],delete a.value,delete a.writable),Object.defineProperty(q,i,a)}),k})=>[W,C,x,e,t,s,n,l,c,d,f],[be]=ve();function P(e={}){return be(e)}function D(e,t,s){const n=C.get(e);(z?"production":void 0)!=="production"&&!n&&console.warn("Please use proxy object");let l;const c=[],d=n[3];let f=!1;const o=d(g=>{c.push(g),l||(l=Promise.resolve().then(()=>{l=void 0,f&&t(c.splice(0))}))});return f=!0,()=>{f=!1,o()}}function we(e,t){const s=C.get(e);(z?"production":void 0)!=="production"&&!s&&console.warn("Please use proxy object");const[n,l,c]=s;return c(n,l(),t)}const u=P({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),de={state:u,subscribe(e){return D(u,()=>e(u))},push(e,t){e!==u.view&&(u.view=e,t&&(u.data=t),u.history.push(e))},reset(e){u.view=e,u.history=[e]},replace(e){u.history.length>1&&(u.history[u.history.length-1]=e,u.view=e)},goBack(){if(u.history.length>1){u.history.pop();const[e]=u.history.slice(-1);u.view=e}},setData(e){u.data=e}},m={WALLETCONNECT_DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE",WCM_VERSION:"WCM_VERSION",RECOMMENDED_WALLET_AMOUNT:9,isMobile(){return typeof window<"u"?!!(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)):!1},isAndroid(){return m.isMobile()&&navigator.userAgent.toLowerCase().includes("android")},isIos(){const e=navigator.userAgent.toLowerCase();return m.isMobile()&&(e.includes("iphone")||e.includes("ipad"))},isHttpUrl(e){return e.startsWith("http://")||e.startsWith("https://")},isArray(e){return Array.isArray(e)&&e.length>0},isTelegram(){return typeof window<"u"&&(!!window.TelegramWebviewProxy||!!window.Telegram||!!window.TelegramWebviewProxyProto)},formatNativeUrl(e,t,s){if(m.isHttpUrl(e))return this.formatUniversalUrl(e,t,s);let n=e;n.includes("://")||(n=e.replaceAll("/","").replaceAll(":",""),n=`${n}://`),n.endsWith("/")||(n=`${n}/`),this.setWalletConnectDeepLink(n,s);const l=encodeURIComponent(t);return`${n}wc?uri=${l}`},formatUniversalUrl(e,t,s){if(!m.isHttpUrl(e))return this.formatNativeUrl(e,t,s);let n=e;if(n.startsWith("https://t.me")){const c=pe.from(t).toString("base64").replace(/[=]/g,"");n.endsWith("/")&&(n=n.slice(0,-1)),this.setWalletConnectDeepLink(n,s);const d=new URL(n);return d.searchParams.set("startapp",c),d.toString()}n.endsWith("/")||(n=`${n}/`),this.setWalletConnectDeepLink(n,s);const l=encodeURIComponent(t);return`${n}wc?uri=${l}`},async wait(e){return new Promise(t=>{setTimeout(t,e)})},openHref(e,t){const s=this.isTelegram()?"_blank":t;window.open(e,s,"noreferrer noopener")},setWalletConnectDeepLink(e,t){try{localStorage.setItem(m.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:e,name:t}))}catch{console.info("Unable to set WalletConnect deep link")}},setWalletConnectAndroidDeepLink(e){try{const[t]=e.split("?");localStorage.setItem(m.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:t,name:"Android"}))}catch{console.info("Unable to set WalletConnect android deep link")}},removeWalletConnectDeepLink(){try{localStorage.removeItem(m.WALLETCONNECT_DEEPLINK_CHOICE)}catch{console.info("Unable to remove WalletConnect deep link")}},setModalVersionInStorage(){try{typeof localStorage<"u"&&localStorage.setItem(m.WCM_VERSION,"2.7.0")}catch{console.info("Unable to set Web3Modal version in storage")}},getWalletRouterData(){var e;const t=(e=de.state.data)==null?void 0:e.Wallet;if(!t)throw new Error('Missing "Wallet" view data');return t}},Ie=typeof location<"u"&&(location.hostname.includes("localhost")||location.protocol.includes("https")),p=P({enabled:Ie,userSessionId:"",events:[],connectedWalletId:void 0}),_e={state:p,subscribe(e){return D(p.events,()=>e(we(p.events[p.events.length-1])))},initialize(){p.enabled&&typeof(crypto==null?void 0:crypto.randomUUID)<"u"&&(p.userSessionId=crypto.randomUUID())},setConnectedWalletId(e){p.connectedWalletId=e},click(e){if(p.enabled){const t={type:"CLICK",name:e.name,userSessionId:p.userSessionId,timestamp:Date.now(),data:e};p.events.push(t)}},track(e){if(p.enabled){const t={type:"TRACK",name:e.name,userSessionId:p.userSessionId,timestamp:Date.now(),data:e};p.events.push(t)}},view(e){if(p.enabled){const t={type:"VIEW",name:e.name,userSessionId:p.userSessionId,timestamp:Date.now(),data:e};p.events.push(t)}}},_=P({chains:void 0,walletConnectUri:void 0,isAuth:!1,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1}),w={state:_,subscribe(e){return D(_,()=>e(_))},setChains(e){_.chains=e},setWalletConnectUri(e){_.walletConnectUri=e},setIsCustomDesktop(e){_.isCustomDesktop=e},setIsCustomMobile(e){_.isCustomMobile=e},setIsDataLoaded(e){_.isDataLoaded=e},setIsUiLoaded(e){_.isUiLoaded=e},setIsAuth(e){_.isAuth=e}},B=P({projectId:"",mobileWallets:void 0,desktopWallets:void 0,walletImages:void 0,chains:void 0,enableAuthMode:!1,enableExplorer:!0,explorerExcludedWalletIds:void 0,explorerRecommendedWalletIds:void 0,termsOfServiceUrl:void 0,privacyPolicyUrl:void 0}),$={state:B,subscribe(e){return D(B,()=>e(B))},setConfig(e){var t,s;_e.initialize(),w.setChains(e.chains),w.setIsAuth(!!e.enableAuthMode),w.setIsCustomMobile(!!((t=e.mobileWallets)!=null&&t.length)),w.setIsCustomDesktop(!!((s=e.desktopWallets)!=null&&s.length)),m.setModalVersionInStorage(),Object.assign(B,e)}};var Ee=Object.defineProperty,se=Object.getOwnPropertySymbols,Oe=Object.prototype.hasOwnProperty,We=Object.prototype.propertyIsEnumerable,ne=(e,t,s)=>t in e?Ee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Le=(e,t)=>{for(var s in t||(t={}))Oe.call(t,s)&&ne(e,s,t[s]);if(se)for(var s of se(t))We.call(t,s)&&ne(e,s,t[s]);return e};const G="https://explorer-api.walletconnect.com",Q="wcm",X="js-2.7.0";async function K(e,t){const s=Le({sdkType:Q,sdkVersion:X},t),n=new URL(e,G);return n.searchParams.append("projectId",$.state.projectId),Object.entries(s).forEach(([c,d])=>{d&&n.searchParams.append(c,String(d))}),(await fetch(n)).json()}const S={async getDesktopListings(e){return K("/w3m/v1/getDesktopListings",e)},async getMobileListings(e){return K("/w3m/v1/getMobileListings",e)},async getInjectedListings(e){return K("/w3m/v1/getInjectedListings",e)},async getAllListings(e){return K("/w3m/v1/getAllListings",e)},getWalletImageUrl(e){return`${G}/w3m/v1/getWalletImage/${e}?projectId=${$.state.projectId}&sdkType=${Q}&sdkVersion=${X}`},getAssetImageUrl(e){return`${G}/w3m/v1/getAssetImage/${e}?projectId=${$.state.projectId}&sdkType=${Q}&sdkVersion=${X}`}};var Ce=Object.defineProperty,oe=Object.getOwnPropertySymbols,Pe=Object.prototype.hasOwnProperty,Ae=Object.prototype.propertyIsEnumerable,re=(e,t,s)=>t in e?Ce(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Se=(e,t)=>{for(var s in t||(t={}))Pe.call(t,s)&&re(e,s,t[s]);if(oe)for(var s of oe(t))Ae.call(t,s)&&re(e,s,t[s]);return e};const ae=m.isMobile(),E=P({wallets:{listings:[],total:0,page:1},search:{listings:[],total:0,page:1},recomendedWallets:[]}),ke={state:E,async getRecomendedWallets(){const{explorerRecommendedWalletIds:e,explorerExcludedWalletIds:t}=$.state;if(e==="NONE"||t==="ALL"&&!e)return E.recomendedWallets;if(m.isArray(e)){const n={recommendedIds:e.join(",")},{listings:l}=await S.getAllListings(n),c=Object.values(l);c.sort((d,f)=>{const W=e.indexOf(d.id),o=e.indexOf(f.id);return W-o}),E.recomendedWallets=c}else{const{chains:s,isAuth:n}=w.state,l=s==null?void 0:s.join(","),c=m.isArray(t),d={page:1,sdks:n?"auth_v1":void 0,entries:m.RECOMMENDED_WALLET_AMOUNT,chains:l,version:2,excludedIds:c?t.join(","):void 0},{listings:f}=ae?await S.getMobileListings(d):await S.getDesktopListings(d);E.recomendedWallets=Object.values(f)}return E.recomendedWallets},async getWallets(e){const t=Se({},e),{explorerRecommendedWalletIds:s,explorerExcludedWalletIds:n}=$.state,{recomendedWallets:l}=E;if(n==="ALL")return E.wallets;l.length?t.excludedIds=l.map(I=>I.id).join(","):m.isArray(s)&&(t.excludedIds=s.join(",")),m.isArray(n)&&(t.excludedIds=[t.excludedIds,n].filter(Boolean).join(",")),w.state.isAuth&&(t.sdks="auth_v1");const{page:c,search:d}=e,{listings:f,total:W}=ae?await S.getMobileListings(t):await S.getDesktopListings(t),o=Object.values(f),g=d?"search":"wallets";return E[g]={listings:[...E[g].listings,...o],total:W,page:c??1},{listings:o,total:W}},getWalletImageUrl(e){return S.getWalletImageUrl(e)},getAssetImageUrl(e){return S.getAssetImageUrl(e)},resetSearch(){E.search={listings:[],total:0,page:1}}},T=P({open:!1}),J={state:T,subscribe(e){return D(T,()=>e(T))},async open(e){return new Promise(t=>{const{isUiLoaded:s,isDataLoaded:n}=w.state;if(m.removeWalletConnectDeepLink(),w.setWalletConnectUri(e==null?void 0:e.uri),w.setChains(e==null?void 0:e.chains),de.reset("ConnectWallet"),s&&n)T.open=!0,t();else{const l=setInterval(()=>{const c=w.state;c.isUiLoaded&&c.isDataLoaded&&(clearInterval(l),T.open=!0,t())},200)}})},close(){T.open=!1}};var Me=Object.defineProperty,ie=Object.getOwnPropertySymbols,De=Object.prototype.hasOwnProperty,je=Object.prototype.propertyIsEnumerable,le=(e,t,s)=>t in e?Me(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Ue=(e,t)=>{for(var s in t||(t={}))De.call(t,s)&&le(e,s,t[s]);if(ie)for(var s of ie(t))je.call(t,s)&&le(e,s,t[s]);return e};function Te(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}const R=P({themeMode:Te()?"dark":"light"}),ce={state:R,subscribe(e){return D(R,()=>e(R))},setThemeConfig(e){const{themeMode:t,themeVariables:s}=e;t&&(R.themeMode=t),s&&(R.themeVariables=Ue({},s))}},M=P({open:!1,message:"",variant:"success"}),Ve={state:M,subscribe(e){return D(M,()=>e(M))},openToast(e,t){M.open=!0,M.message=e,M.variant=t},closeToast(){M.open=!1}};class $e{constructor(t){this.openModal=J.open,this.closeModal=J.close,this.subscribeModal=J.subscribe,this.setTheme=ce.setThemeConfig,ce.setThemeConfig(t),$.setConfig(t),this.initUi()}async initUi(){if(typeof window<"u"){await me(()=>import("./index-e-oSLOvi.js"),__vite__mapDeps([0,1,2]));const t=document.createElement("wcm-modal");document.body.insertAdjacentElement("beforeend",t),w.setIsUiLoaded(!0)}}}const xe=Object.freeze(Object.defineProperty({__proto__:null,WalletConnectModal:$e},Symbol.toStringTag,{value:"Module"}));export{m as C,ke as E,J as M,w as O,de as R,ce as T,Ve as a,_e as b,$ as c,xe as i};
@@ -1 +1 @@
1
- import{K as Wr,$ as qr,B as Kr,m as Vr,q as Xr,J as Ye}from"./index-DkkKP2bP.js";import{g as st,R as lt,T as dt,k as vt,E as ht,a as yt,V as pt,s as mt,I as bt,b as gt,c as _t,N as wt,f as It,d as Et,v as St,_ as Ot,e as jt,h as Nt,O as At,y as Bt,A as kt,i as xt,W as Dt,p as Rt,U as Ct,L as Lt,u as Mt,x as Tt}from"./index-DkkKP2bP.js";import"./index-CqMSvM9y.js";var se={},Yr=Object.create,Qe=Object.defineProperty,Jr=Object.getOwnPropertyDescriptor,Qr=Object.getOwnPropertyNames,Zr=Object.getPrototypeOf,Hr=Object.prototype.hasOwnProperty,pe=(_=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(_,{get:(O,m)=>(typeof require<"u"?require:O)[m]}):_)(function(_){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+_+'" is not supported')}),Ze=(_,O)=>()=>(O||_((O={exports:{}}).exports,O),O.exports),Gr=(_,O,m,x)=>{if(O&&typeof O=="object"||typeof O=="function")for(let q of Qr(O))!Hr.call(_,q)&&q!==m&&Qe(_,q,{get:()=>O[q],enumerable:!(x=Jr(O,q))||x.enumerable});return _},He=(_,O,m)=>(m=_!=null?Yr(Zr(_)):{},Gr(!_||!_.__esModule?Qe(m,"default",{value:_,enumerable:!0}):m,_)),me=(_,O,m)=>new Promise((x,q)=>{var C=D=>{try{j(m.next(D))}catch(L){q(L)}},P=D=>{try{j(m.throw(D))}catch(L){q(L)}},j=D=>D.done?x(D.value):Promise.resolve(D.value).then(C,P);j((m=m.apply(_,O)).next())}),$r=Ze((_,O)=>{(function(m){if(typeof _=="object"&&typeof O<"u")O.exports=m();else if(typeof define=="function"&&define.amd)define([],m);else{var x;typeof window<"u"?x=window:typeof se<"u"?x=se:typeof self<"u"?x=self:x=this,x.localforage=m()}})(function(){return function m(x,q,C){function P(L,Y){if(!q[L]){if(!x[L]){var y=typeof pe=="function"&&pe;if(!Y&&y)return y(L,!0);if(j)return j(L,!0);var w=new Error("Cannot find module '"+L+"'");throw w.code="MODULE_NOT_FOUND",w}var z=q[L]={exports:{}};x[L][0].call(z.exports,function(F){var Z=x[L][1][F];return P(Z||F)},z,z.exports,m,x,q,C)}return q[L].exports}for(var j=typeof pe=="function"&&pe,D=0;D<C.length;D++)P(C[D]);return P}({1:[function(m,x,q){(function(C){var P=C.MutationObserver||C.WebKitMutationObserver,j;if(P){var D=0,L=new P(F),Y=C.document.createTextNode("");L.observe(Y,{characterData:!0}),j=function(){Y.data=D=++D%2}}else if(!C.setImmediate&&typeof C.MessageChannel<"u"){var y=new C.MessageChannel;y.port1.onmessage=F,j=function(){y.port2.postMessage(0)}}else"document"in C&&"onreadystatechange"in C.document.createElement("script")?j=function(){var A=C.document.createElement("script");A.onreadystatechange=function(){F(),A.onreadystatechange=null,A.parentNode.removeChild(A),A=null},C.document.documentElement.appendChild(A)}:j=function(){setTimeout(F,0)};var w,z=[];function F(){w=!0;for(var A,G,U=z.length;U;){for(G=z,z=[],A=-1;++A<U;)G[A]();U=z.length}w=!1}x.exports=Z;function Z(A){z.push(A)===1&&!w&&j()}}).call(this,typeof se<"u"?se:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(m,x,q){var C=m(1);function P(){}var j={},D=["REJECTED"],L=["FULFILLED"],Y=["PENDING"];x.exports=y;function y(v){if(typeof v!="function")throw new TypeError("resolver must be a function");this.state=Y,this.queue=[],this.outcome=void 0,v!==P&&Z(this,v)}y.prototype.catch=function(v){return this.then(null,v)},y.prototype.then=function(v,N){if(typeof v!="function"&&this.state===L||typeof N!="function"&&this.state===D)return this;var E=new this.constructor(P);if(this.state!==Y){var B=this.state===L?v:N;z(E,B,this.outcome)}else this.queue.push(new w(E,v,N));return E};function w(v,N,E){this.promise=v,typeof N=="function"&&(this.onFulfilled=N,this.callFulfilled=this.otherCallFulfilled),typeof E=="function"&&(this.onRejected=E,this.callRejected=this.otherCallRejected)}w.prototype.callFulfilled=function(v){j.resolve(this.promise,v)},w.prototype.otherCallFulfilled=function(v){z(this.promise,this.onFulfilled,v)},w.prototype.callRejected=function(v){j.reject(this.promise,v)},w.prototype.otherCallRejected=function(v){z(this.promise,this.onRejected,v)};function z(v,N,E){C(function(){var B;try{B=N(E)}catch(K){return j.reject(v,K)}B===v?j.reject(v,new TypeError("Cannot resolve promise with itself")):j.resolve(v,B)})}j.resolve=function(v,N){var E=A(F,N);if(E.status==="error")return j.reject(v,E.value);var B=E.value;if(B)Z(v,B);else{v.state=L,v.outcome=N;for(var K=-1,X=v.queue.length;++K<X;)v.queue[K].callFulfilled(N)}return v},j.reject=function(v,N){v.state=D,v.outcome=N;for(var E=-1,B=v.queue.length;++E<B;)v.queue[E].callRejected(N);return v};function F(v){var N=v&&v.then;if(v&&(typeof v=="object"||typeof v=="function")&&typeof N=="function")return function(){N.apply(v,arguments)}}function Z(v,N){var E=!1;function B(Q){E||(E=!0,j.reject(v,Q))}function K(Q){E||(E=!0,j.resolve(v,Q))}function X(){N(K,B)}var J=A(X);J.status==="error"&&B(J.value)}function A(v,N){var E={};try{E.value=v(N),E.status="success"}catch(B){E.status="error",E.value=B}return E}y.resolve=G;function G(v){return v instanceof this?v:j.resolve(new this(P),v)}y.reject=U;function U(v){var N=new this(P);return j.reject(N,v)}y.all=oe;function oe(v){var N=this;if(Object.prototype.toString.call(v)!=="[object Array]")return this.reject(new TypeError("must be an array"));var E=v.length,B=!1;if(!E)return this.resolve([]);for(var K=new Array(E),X=0,J=-1,Q=new this(P);++J<E;)$(v[J],J);return Q;function $(ie,ue){N.resolve(ie).then(le,function(re){B||(B=!0,j.reject(Q,re))});function le(re){K[ue]=re,++X===E&&!B&&(B=!0,j.resolve(Q,K))}}}y.race=ee;function ee(v){var N=this;if(Object.prototype.toString.call(v)!=="[object Array]")return this.reject(new TypeError("must be an array"));var E=v.length,B=!1;if(!E)return this.resolve([]);for(var K=-1,X=new this(P);++K<E;)J(v[K]);return X;function J(Q){N.resolve(Q).then(function($){B||(B=!0,j.resolve(X,$))},function($){B||(B=!0,j.reject(X,$))})}}},{1:1}],3:[function(m,x,q){(function(C){typeof C.Promise!="function"&&(C.Promise=m(2))}).call(this,typeof se<"u"?se:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(m,x,q){var C=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function P(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function j(){try{if(typeof indexedDB<"u")return indexedDB;if(typeof webkitIndexedDB<"u")return webkitIndexedDB;if(typeof mozIndexedDB<"u")return mozIndexedDB;if(typeof OIndexedDB<"u")return OIndexedDB;if(typeof msIndexedDB<"u")return msIndexedDB}catch{return}}var D=j();function L(){try{if(!D||!D.open)return!1;var e=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),r=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!e||r)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}function Y(e,r){e=e||[],r=r||{};try{return new Blob(e,r)}catch(i){if(i.name!=="TypeError")throw i;for(var t=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,o=new t,n=0;n<e.length;n+=1)o.append(e[n]);return o.getBlob(r.type)}}typeof Promise>"u"&&m(3);var y=Promise;function w(e,r){r&&e.then(function(t){r(null,t)},function(t){r(t)})}function z(e,r,t){typeof r=="function"&&e.then(r),typeof t=="function"&&e.catch(t)}function F(e){return typeof e!="string"&&(console.warn(e+" used as a key, but it is not a string."),e=String(e)),e}function Z(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var A="local-forage-detect-blob-support",G=void 0,U={},oe=Object.prototype.toString,ee="readonly",v="readwrite";function N(e){for(var r=e.length,t=new ArrayBuffer(r),o=new Uint8Array(t),n=0;n<r;n++)o[n]=e.charCodeAt(n);return t}function E(e){return new y(function(r){var t=e.transaction(A,v),o=Y([""]);t.objectStore(A).put(o,"key"),t.onabort=function(n){n.preventDefault(),n.stopPropagation(),r(!1)},t.oncomplete=function(){var n=navigator.userAgent.match(/Chrome\/(\d+)/),i=navigator.userAgent.match(/Edge\//);r(i||!n||parseInt(n[1],10)>=43)}}).catch(function(){return!1})}function B(e){return typeof G=="boolean"?y.resolve(G):E(e).then(function(r){return G=r,G})}function K(e){var r=U[e.name],t={};t.promise=new y(function(o,n){t.resolve=o,t.reject=n}),r.deferredOperations.push(t),r.dbReady?r.dbReady=r.dbReady.then(function(){return t.promise}):r.dbReady=t.promise}function X(e){var r=U[e.name],t=r.deferredOperations.pop();if(t)return t.resolve(),t.promise}function J(e,r){var t=U[e.name],o=t.deferredOperations.pop();if(o)return o.reject(r),o.promise}function Q(e,r){return new y(function(t,o){if(U[e.name]=U[e.name]||g(),e.db)if(r)K(e),e.db.close();else return t(e.db);var n=[e.name];r&&n.push(e.version);var i=D.open.apply(D,n);r&&(i.onupgradeneeded=function(u){var c=i.result;try{c.createObjectStore(e.storeName),u.oldVersion<=1&&c.createObjectStore(A)}catch(d){if(d.name==="ConstraintError")console.warn('The database "'+e.name+'" has been upgraded from version '+u.oldVersion+" to version "+u.newVersion+', but the storage "'+e.storeName+'" already exists.');else throw d}}),i.onerror=function(u){u.preventDefault(),o(i.error)},i.onsuccess=function(){var u=i.result;u.onversionchange=function(c){c.target.close()},t(u),X(e)}})}function $(e){return Q(e,!1)}function ie(e){return Q(e,!0)}function ue(e,r){if(!e.db)return!0;var t=!e.db.objectStoreNames.contains(e.storeName),o=e.version<e.db.version,n=e.version>e.db.version;if(o&&(e.version!==r&&console.warn('The database "'+e.name+`" can't be downgraded from version `+e.db.version+" to version "+e.version+"."),e.version=e.db.version),n||t){if(t){var i=e.db.version+1;i>e.version&&(e.version=i)}return!0}return!1}function le(e){return new y(function(r,t){var o=new FileReader;o.onerror=t,o.onloadend=function(n){var i=btoa(n.target.result||"");r({__local_forage_encoded_blob:!0,data:i,type:e.type})},o.readAsBinaryString(e)})}function re(e){var r=N(atob(e.data));return Y([r],{type:e.type})}function a(e){return e&&e.__local_forage_encoded_blob}function f(e){var r=this,t=r._initReady().then(function(){var o=U[r._dbInfo.name];if(o&&o.dbReady)return o.dbReady});return z(t,e,e),t}function h(e){K(e);for(var r=U[e.name],t=r.forages,o=0;o<t.length;o++){var n=t[o];n._dbInfo.db&&(n._dbInfo.db.close(),n._dbInfo.db=null)}return e.db=null,$(e).then(function(i){return e.db=i,ue(e)?ie(e):i}).then(function(i){e.db=r.db=i;for(var u=0;u<t.length;u++)t[u]._dbInfo.db=i}).catch(function(i){throw J(e,i),i})}function p(e,r,t,o){o===void 0&&(o=1);try{var n=e.db.transaction(e.storeName,r);t(null,n)}catch(i){if(o>0&&(!e.db||i.name==="InvalidStateError"||i.name==="NotFoundError"))return y.resolve().then(function(){if(!e.db||i.name==="NotFoundError"&&!e.db.objectStoreNames.contains(e.storeName)&&e.version<=e.db.version)return e.db&&(e.version=e.db.version+1),ie(e)}).then(function(){return h(e).then(function(){p(e,r,t,o-1)})}).catch(t);t(i)}}function g(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function I(e){var r=this,t={db:null};if(e)for(var o in e)t[o]=e[o];var n=U[t.name];n||(n=g(),U[t.name]=n),n.forages.push(r),r._initReady||(r._initReady=r.ready,r.ready=f);var i=[];function u(){return y.resolve()}for(var c=0;c<n.forages.length;c++){var d=n.forages[c];d!==r&&i.push(d._initReady().catch(u))}var l=n.forages.slice(0);return y.all(i).then(function(){return t.db=n.db,$(t)}).then(function(s){return t.db=s,ue(t,r._defaultConfig.version)?ie(t):s}).then(function(s){t.db=n.db=s,r._dbInfo=t;for(var b=0;b<l.length;b++){var S=l[b];S!==r&&(S._dbInfo.db=t.db,S._dbInfo.version=t.version)}})}function M(e,r){var t=this;e=F(e);var o=new y(function(n,i){t.ready().then(function(){p(t._dbInfo,ee,function(u,c){if(u)return i(u);try{var d=c.objectStore(t._dbInfo.storeName),l=d.get(e);l.onsuccess=function(){var s=l.result;s===void 0&&(s=null),a(s)&&(s=re(s)),n(s)},l.onerror=function(){i(l.error)}}catch(s){i(s)}})}).catch(i)});return w(o,r),o}function V(e,r){var t=this,o=new y(function(n,i){t.ready().then(function(){p(t._dbInfo,ee,function(u,c){if(u)return i(u);try{var d=c.objectStore(t._dbInfo.storeName),l=d.openCursor(),s=1;l.onsuccess=function(){var b=l.result;if(b){var S=b.value;a(S)&&(S=re(S));var R=e(S,b.key,s++);R!==void 0?n(R):b.continue()}else n()},l.onerror=function(){i(l.error)}}catch(b){i(b)}})}).catch(i)});return w(o,r),o}function ce(e,r,t){var o=this;e=F(e);var n=new y(function(i,u){var c;o.ready().then(function(){return c=o._dbInfo,oe.call(r)==="[object Blob]"?B(c.db).then(function(d){return d?r:le(r)}):r}).then(function(d){p(o._dbInfo,v,function(l,s){if(l)return u(l);try{var b=s.objectStore(o._dbInfo.storeName);d===null&&(d=void 0);var S=b.put(d,e);s.oncomplete=function(){d===void 0&&(d=null),i(d)},s.onabort=s.onerror=function(){var R=S.error?S.error:S.transaction.error;u(R)}}catch(R){u(R)}})}).catch(u)});return w(n,t),n}function ae(e,r){var t=this;e=F(e);var o=new y(function(n,i){t.ready().then(function(){p(t._dbInfo,v,function(u,c){if(u)return i(u);try{var d=c.objectStore(t._dbInfo.storeName),l=d.delete(e);c.oncomplete=function(){n()},c.onerror=function(){i(l.error)},c.onabort=function(){var s=l.error?l.error:l.transaction.error;i(s)}}catch(s){i(s)}})}).catch(i)});return w(o,r),o}function de(e){var r=this,t=new y(function(o,n){r.ready().then(function(){p(r._dbInfo,v,function(i,u){if(i)return n(i);try{var c=u.objectStore(r._dbInfo.storeName),d=c.clear();u.oncomplete=function(){o()},u.onabort=u.onerror=function(){var l=d.error?d.error:d.transaction.error;n(l)}}catch(l){n(l)}})}).catch(n)});return w(t,e),t}function Ge(e){var r=this,t=new y(function(o,n){r.ready().then(function(){p(r._dbInfo,ee,function(i,u){if(i)return n(i);try{var c=u.objectStore(r._dbInfo.storeName),d=c.count();d.onsuccess=function(){o(d.result)},d.onerror=function(){n(d.error)}}catch(l){n(l)}})}).catch(n)});return w(t,e),t}function $e(e,r){var t=this,o=new y(function(n,i){if(e<0){n(null);return}t.ready().then(function(){p(t._dbInfo,ee,function(u,c){if(u)return i(u);try{var d=c.objectStore(t._dbInfo.storeName),l=!1,s=d.openKeyCursor();s.onsuccess=function(){var b=s.result;if(!b){n(null);return}e===0||l?n(b.key):(l=!0,b.advance(e))},s.onerror=function(){i(s.error)}}catch(b){i(b)}})}).catch(i)});return w(o,r),o}function er(e){var r=this,t=new y(function(o,n){r.ready().then(function(){p(r._dbInfo,ee,function(i,u){if(i)return n(i);try{var c=u.objectStore(r._dbInfo.storeName),d=c.openKeyCursor(),l=[];d.onsuccess=function(){var s=d.result;if(!s){o(l);return}l.push(s.key),s.continue()},d.onerror=function(){n(d.error)}}catch(s){n(s)}})}).catch(n)});return w(t,e),t}function rr(e,r){r=Z.apply(this,arguments);var t=this.config();e=typeof e!="function"&&e||{},e.name||(e.name=e.name||t.name,e.storeName=e.storeName||t.storeName);var o=this,n;if(!e.name)n=y.reject("Invalid arguments");else{var i=e.name===t.name&&o._dbInfo.db,u=i?y.resolve(o._dbInfo.db):$(e).then(function(c){var d=U[e.name],l=d.forages;d.db=c;for(var s=0;s<l.length;s++)l[s]._dbInfo.db=c;return c});e.storeName?n=u.then(function(c){if(c.objectStoreNames.contains(e.storeName)){var d=c.version+1;K(e);var l=U[e.name],s=l.forages;c.close();for(var b=0;b<s.length;b++){var S=s[b];S._dbInfo.db=null,S._dbInfo.version=d}var R=new y(function(k,W){var T=D.open(e.name,d);T.onerror=function(H){var Oe=T.result;Oe.close(),W(H)},T.onupgradeneeded=function(){var H=T.result;H.deleteObjectStore(e.storeName)},T.onsuccess=function(){var H=T.result;H.close(),k(H)}});return R.then(function(k){l.db=k;for(var W=0;W<s.length;W++){var T=s[W];T._dbInfo.db=k,X(T._dbInfo)}}).catch(function(k){throw(J(e,k)||y.resolve()).catch(function(){}),k})}}):n=u.then(function(c){K(e);var d=U[e.name],l=d.forages;c.close();for(var s=0;s<l.length;s++){var b=l[s];b._dbInfo.db=null}var S=new y(function(R,k){var W=D.deleteDatabase(e.name);W.onerror=function(){var T=W.result;T&&T.close(),k(W.error)},W.onblocked=function(){console.warn('dropInstance blocked for database "'+e.name+'" until all open connections are closed')},W.onsuccess=function(){var T=W.result;T&&T.close(),R(T)}});return S.then(function(R){d.db=R;for(var k=0;k<l.length;k++){var W=l[k];X(W._dbInfo)}}).catch(function(R){throw(J(e,R)||y.resolve()).catch(function(){}),R})})}return w(n,r),n}var tr={_driver:"asyncStorage",_initStorage:I,_support:L(),iterate:V,getItem:M,setItem:ce,removeItem:ae,clear:de,length:Ge,key:$e,keys:er,dropInstance:rr};function nr(){return typeof openDatabase=="function"}var te="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",or="~~local_forage_type~",Ae=/^~~local_forage_type~([^~]+)~/,he="__lfsc__:",be=he.length,ge="arbf",_e="blob",Be="si08",ke="ui08",xe="uic8",De="si16",Re="si32",Ce="ur16",Le="ui32",Me="fl32",Te="fl64",ze=be+ge.length,Fe=Object.prototype.toString;function Pe(e){var r=e.length*.75,t=e.length,o,n=0,i,u,c,d;e[e.length-1]==="="&&(r--,e[e.length-2]==="="&&r--);var l=new ArrayBuffer(r),s=new Uint8Array(l);for(o=0;o<t;o+=4)i=te.indexOf(e[o]),u=te.indexOf(e[o+1]),c=te.indexOf(e[o+2]),d=te.indexOf(e[o+3]),s[n++]=i<<2|u>>4,s[n++]=(u&15)<<4|c>>2,s[n++]=(c&3)<<6|d&63;return l}function we(e){var r=new Uint8Array(e),t="",o;for(o=0;o<r.length;o+=3)t+=te[r[o]>>2],t+=te[(r[o]&3)<<4|r[o+1]>>4],t+=te[(r[o+1]&15)<<2|r[o+2]>>6],t+=te[r[o+2]&63];return r.length%3===2?t=t.substring(0,t.length-1)+"=":r.length%3===1&&(t=t.substring(0,t.length-2)+"=="),t}function ir(e,r){var t="";if(e&&(t=Fe.call(e)),e&&(t==="[object ArrayBuffer]"||e.buffer&&Fe.call(e.buffer)==="[object ArrayBuffer]")){var o,n=he;e instanceof ArrayBuffer?(o=e,n+=ge):(o=e.buffer,t==="[object Int8Array]"?n+=Be:t==="[object Uint8Array]"?n+=ke:t==="[object Uint8ClampedArray]"?n+=xe:t==="[object Int16Array]"?n+=De:t==="[object Uint16Array]"?n+=Ce:t==="[object Int32Array]"?n+=Re:t==="[object Uint32Array]"?n+=Le:t==="[object Float32Array]"?n+=Me:t==="[object Float64Array]"?n+=Te:r(new Error("Failed to get type for BinaryArray"))),r(n+we(o))}else if(t==="[object Blob]"){var i=new FileReader;i.onload=function(){var u=or+e.type+"~"+we(this.result);r(he+_e+u)},i.readAsArrayBuffer(e)}else try{r(JSON.stringify(e))}catch(u){console.error("Couldn't convert value into a JSON string: ",e),r(null,u)}}function ar(e){if(e.substring(0,be)!==he)return JSON.parse(e);var r=e.substring(ze),t=e.substring(be,ze),o;if(t===_e&&Ae.test(r)){var n=r.match(Ae);o=n[1],r=r.substring(n[0].length)}var i=Pe(r);switch(t){case ge:return i;case _e:return Y([i],{type:o});case Be:return new Int8Array(i);case ke:return new Uint8Array(i);case xe:return new Uint8ClampedArray(i);case De:return new Int16Array(i);case Ce:return new Uint16Array(i);case Re:return new Int32Array(i);case Le:return new Uint32Array(i);case Me:return new Float32Array(i);case Te:return new Float64Array(i);default:throw new Error("Unkown type: "+t)}}var Ie={serialize:ir,deserialize:ar,stringToBuffer:Pe,bufferToString:we};function Ue(e,r,t,o){e.executeSql("CREATE TABLE IF NOT EXISTS "+r.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],t,o)}function ur(e){var r=this,t={db:null};if(e)for(var o in e)t[o]=typeof e[o]!="string"?e[o].toString():e[o];var n=new y(function(i,u){try{t.db=openDatabase(t.name,String(t.version),t.description,t.size)}catch(c){return u(c)}t.db.transaction(function(c){Ue(c,t,function(){r._dbInfo=t,i()},function(d,l){u(l)})},u)});return t.serializer=Ie,n}function ne(e,r,t,o,n,i){e.executeSql(t,o,n,function(u,c){c.code===c.SYNTAX_ERR?u.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[r.storeName],function(d,l){l.rows.length?i(d,c):Ue(d,r,function(){d.executeSql(t,o,n,i)},i)},i):i(u,c)},i)}function cr(e,r){var t=this;e=F(e);var o=new y(function(n,i){t.ready().then(function(){var u=t._dbInfo;u.db.transaction(function(c){ne(c,u,"SELECT * FROM "+u.storeName+" WHERE key = ? LIMIT 1",[e],function(d,l){var s=l.rows.length?l.rows.item(0).value:null;s&&(s=u.serializer.deserialize(s)),n(s)},function(d,l){i(l)})})}).catch(i)});return w(o,r),o}function fr(e,r){var t=this,o=new y(function(n,i){t.ready().then(function(){var u=t._dbInfo;u.db.transaction(function(c){ne(c,u,"SELECT * FROM "+u.storeName,[],function(d,l){for(var s=l.rows,b=s.length,S=0;S<b;S++){var R=s.item(S),k=R.value;if(k&&(k=u.serializer.deserialize(k)),k=e(k,R.key,S+1),k!==void 0){n(k);return}}n()},function(d,l){i(l)})})}).catch(i)});return w(o,r),o}function We(e,r,t,o){var n=this;e=F(e);var i=new y(function(u,c){n.ready().then(function(){r===void 0&&(r=null);var d=r,l=n._dbInfo;l.serializer.serialize(r,function(s,b){b?c(b):l.db.transaction(function(S){ne(S,l,"INSERT OR REPLACE INTO "+l.storeName+" (key, value) VALUES (?, ?)",[e,s],function(){u(d)},function(R,k){c(k)})},function(S){if(S.code===S.QUOTA_ERR){if(o>0){u(We.apply(n,[e,d,t,o-1]));return}c(S)}})})}).catch(c)});return w(i,t),i}function sr(e,r,t){return We.apply(this,[e,r,t,1])}function lr(e,r){var t=this;e=F(e);var o=new y(function(n,i){t.ready().then(function(){var u=t._dbInfo;u.db.transaction(function(c){ne(c,u,"DELETE FROM "+u.storeName+" WHERE key = ?",[e],function(){n()},function(d,l){i(l)})})}).catch(i)});return w(o,r),o}function dr(e){var r=this,t=new y(function(o,n){r.ready().then(function(){var i=r._dbInfo;i.db.transaction(function(u){ne(u,i,"DELETE FROM "+i.storeName,[],function(){o()},function(c,d){n(d)})})}).catch(n)});return w(t,e),t}function vr(e){var r=this,t=new y(function(o,n){r.ready().then(function(){var i=r._dbInfo;i.db.transaction(function(u){ne(u,i,"SELECT COUNT(key) as c FROM "+i.storeName,[],function(c,d){var l=d.rows.item(0).c;o(l)},function(c,d){n(d)})})}).catch(n)});return w(t,e),t}function hr(e,r){var t=this,o=new y(function(n,i){t.ready().then(function(){var u=t._dbInfo;u.db.transaction(function(c){ne(c,u,"SELECT key FROM "+u.storeName+" WHERE id = ? LIMIT 1",[e+1],function(d,l){var s=l.rows.length?l.rows.item(0).key:null;n(s)},function(d,l){i(l)})})}).catch(i)});return w(o,r),o}function yr(e){var r=this,t=new y(function(o,n){r.ready().then(function(){var i=r._dbInfo;i.db.transaction(function(u){ne(u,i,"SELECT key FROM "+i.storeName,[],function(c,d){for(var l=[],s=0;s<d.rows.length;s++)l.push(d.rows.item(s).key);o(l)},function(c,d){n(d)})})}).catch(n)});return w(t,e),t}function pr(e){return new y(function(r,t){e.transaction(function(o){o.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(n,i){for(var u=[],c=0;c<i.rows.length;c++)u.push(i.rows.item(c).name);r({db:e,storeNames:u})},function(n,i){t(i)})},function(o){t(o)})})}function mr(e,r){r=Z.apply(this,arguments);var t=this.config();e=typeof e!="function"&&e||{},e.name||(e.name=e.name||t.name,e.storeName=e.storeName||t.storeName);var o=this,n;return e.name?n=new y(function(i){var u;e.name===t.name?u=o._dbInfo.db:u=openDatabase(e.name,"","",0),e.storeName?i({db:u,storeNames:[e.storeName]}):i(pr(u))}).then(function(i){return new y(function(u,c){i.db.transaction(function(d){function l(R){return new y(function(k,W){d.executeSql("DROP TABLE IF EXISTS "+R,[],function(){k()},function(T,H){W(H)})})}for(var s=[],b=0,S=i.storeNames.length;b<S;b++)s.push(l(i.storeNames[b]));y.all(s).then(function(){u()}).catch(function(R){c(R)})},function(d){c(d)})})}):n=y.reject("Invalid arguments"),w(n,r),n}var br={_driver:"webSQLStorage",_initStorage:ur,_support:nr(),iterate:fr,getItem:cr,setItem:sr,removeItem:lr,clear:dr,length:vr,key:hr,keys:yr,dropInstance:mr};function gr(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function qe(e,r){var t=e.name+"/";return e.storeName!==r.storeName&&(t+=e.storeName+"/"),t}function _r(){var e="_localforage_support_test";try{return localStorage.setItem(e,!0),localStorage.removeItem(e),!1}catch{return!0}}function wr(){return!_r()||localStorage.length>0}function Ir(e){var r=this,t={};if(e)for(var o in e)t[o]=e[o];return t.keyPrefix=qe(e,r._defaultConfig),wr()?(r._dbInfo=t,t.serializer=Ie,y.resolve()):y.reject()}function Er(e){var r=this,t=r.ready().then(function(){for(var o=r._dbInfo.keyPrefix,n=localStorage.length-1;n>=0;n--){var i=localStorage.key(n);i.indexOf(o)===0&&localStorage.removeItem(i)}});return w(t,e),t}function Sr(e,r){var t=this;e=F(e);var o=t.ready().then(function(){var n=t._dbInfo,i=localStorage.getItem(n.keyPrefix+e);return i&&(i=n.serializer.deserialize(i)),i});return w(o,r),o}function Or(e,r){var t=this,o=t.ready().then(function(){for(var n=t._dbInfo,i=n.keyPrefix,u=i.length,c=localStorage.length,d=1,l=0;l<c;l++){var s=localStorage.key(l);if(s.indexOf(i)===0){var b=localStorage.getItem(s);if(b&&(b=n.serializer.deserialize(b)),b=e(b,s.substring(u),d++),b!==void 0)return b}}});return w(o,r),o}function jr(e,r){var t=this,o=t.ready().then(function(){var n=t._dbInfo,i;try{i=localStorage.key(e)}catch{i=null}return i&&(i=i.substring(n.keyPrefix.length)),i});return w(o,r),o}function Nr(e){var r=this,t=r.ready().then(function(){for(var o=r._dbInfo,n=localStorage.length,i=[],u=0;u<n;u++){var c=localStorage.key(u);c.indexOf(o.keyPrefix)===0&&i.push(c.substring(o.keyPrefix.length))}return i});return w(t,e),t}function Ar(e){var r=this,t=r.keys().then(function(o){return o.length});return w(t,e),t}function Br(e,r){var t=this;e=F(e);var o=t.ready().then(function(){var n=t._dbInfo;localStorage.removeItem(n.keyPrefix+e)});return w(o,r),o}function kr(e,r,t){var o=this;e=F(e);var n=o.ready().then(function(){r===void 0&&(r=null);var i=r;return new y(function(u,c){var d=o._dbInfo;d.serializer.serialize(r,function(l,s){if(s)c(s);else try{localStorage.setItem(d.keyPrefix+e,l),u(i)}catch(b){(b.name==="QuotaExceededError"||b.name==="NS_ERROR_DOM_QUOTA_REACHED")&&c(b),c(b)}})})});return w(n,t),n}function xr(e,r){if(r=Z.apply(this,arguments),e=typeof e!="function"&&e||{},!e.name){var t=this.config();e.name=e.name||t.name,e.storeName=e.storeName||t.storeName}var o=this,n;return e.name?n=new y(function(i){e.storeName?i(qe(e,o._defaultConfig)):i(e.name+"/")}).then(function(i){for(var u=localStorage.length-1;u>=0;u--){var c=localStorage.key(u);c.indexOf(i)===0&&localStorage.removeItem(c)}}):n=y.reject("Invalid arguments"),w(n,r),n}var Dr={_driver:"localStorageWrapper",_initStorage:Ir,_support:gr(),iterate:Or,getItem:Sr,setItem:kr,removeItem:Br,clear:Er,length:Ar,key:jr,keys:Nr,dropInstance:xr},Rr=function(e,r){return e===r||typeof e=="number"&&typeof r=="number"&&isNaN(e)&&isNaN(r)},Cr=function(e,r){for(var t=e.length,o=0;o<t;){if(Rr(e[o],r))return!0;o++}return!1},Ke=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"},ve={},Ve={},fe={INDEXEDDB:tr,WEBSQL:br,LOCALSTORAGE:Dr},Lr=[fe.INDEXEDDB._driver,fe.WEBSQL._driver,fe.LOCALSTORAGE._driver],ye=["dropInstance"],Ee=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(ye),Mr={description:"",driver:Lr.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function Tr(e,r){e[r]=function(){var t=arguments;return e.ready().then(function(){return e[r].apply(e,t)})}}function Se(){for(var e=1;e<arguments.length;e++){var r=arguments[e];if(r)for(var t in r)r.hasOwnProperty(t)&&(Ke(r[t])?arguments[0][t]=r[t].slice():arguments[0][t]=r[t])}return arguments[0]}var zr=function(){function e(r){P(this,e);for(var t in fe)if(fe.hasOwnProperty(t)){var o=fe[t],n=o._driver;this[t]=n,ve[n]||this.defineDriver(o)}this._defaultConfig=Se({},Mr),this._config=Se({},this._defaultConfig,r),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return e.prototype.config=function(r){if((typeof r>"u"?"undefined":C(r))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var t in r){if(t==="storeName"&&(r[t]=r[t].replace(/\W/g,"_")),t==="version"&&typeof r[t]!="number")return new Error("Database version must be a number.");this._config[t]=r[t]}return"driver"in r&&r.driver?this.setDriver(this._config.driver):!0}else return typeof r=="string"?this._config[r]:this._config},e.prototype.defineDriver=function(r,t,o){var n=new y(function(i,u){try{var c=r._driver,d=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!r._driver){u(d);return}for(var l=Ee.concat("_initStorage"),s=0,b=l.length;s<b;s++){var S=l[s],R=!Cr(ye,S);if((R||r[S])&&typeof r[S]!="function"){u(d);return}}var k=function(){for(var T=function(Pr){return function(){var Ur=new Error("Method "+Pr+" is not implemented by the current driver"),Xe=y.reject(Ur);return w(Xe,arguments[arguments.length-1]),Xe}},H=0,Oe=ye.length;H<Oe;H++){var je=ye[H];r[je]||(r[je]=T(je))}};k();var W=function(T){ve[c]&&console.info("Redefining LocalForage driver: "+c),ve[c]=r,Ve[c]=T,i()};"_support"in r?r._support&&typeof r._support=="function"?r._support().then(W,u):W(!!r._support):W(!0)}catch(T){u(T)}});return z(n,t,o),n},e.prototype.driver=function(){return this._driver||null},e.prototype.getDriver=function(r,t,o){var n=ve[r]?y.resolve(ve[r]):y.reject(new Error("Driver not found."));return z(n,t,o),n},e.prototype.getSerializer=function(r){var t=y.resolve(Ie);return z(t,r),t},e.prototype.ready=function(r){var t=this,o=t._driverSet.then(function(){return t._ready===null&&(t._ready=t._initDriver()),t._ready});return z(o,r,r),o},e.prototype.setDriver=function(r,t,o){var n=this;Ke(r)||(r=[r]);var i=this._getSupportedDrivers(r);function u(){n._config.driver=n.driver()}function c(s){return n._extend(s),u(),n._ready=n._initStorage(n._config),n._ready}function d(s){return function(){var b=0;function S(){for(;b<s.length;){var R=s[b];return b++,n._dbInfo=null,n._ready=null,n.getDriver(R).then(c).catch(S)}u();var k=new Error("No available storage method found.");return n._driverSet=y.reject(k),n._driverSet}return S()}}var l=this._driverSet!==null?this._driverSet.catch(function(){return y.resolve()}):y.resolve();return this._driverSet=l.then(function(){var s=i[0];return n._dbInfo=null,n._ready=null,n.getDriver(s).then(function(b){n._driver=b._driver,u(),n._wrapLibraryMethodsWithReady(),n._initDriver=d(i)})}).catch(function(){u();var s=new Error("No available storage method found.");return n._driverSet=y.reject(s),n._driverSet}),z(this._driverSet,t,o),this._driverSet},e.prototype.supports=function(r){return!!Ve[r]},e.prototype._extend=function(r){Se(this,r)},e.prototype._getSupportedDrivers=function(r){for(var t=[],o=0,n=r.length;o<n;o++){var i=r[o];this.supports(i)&&t.push(i)}return t},e.prototype._wrapLibraryMethodsWithReady=function(){for(var r=0,t=Ee.length;r<t;r++)Tr(this,Ee[r])},e.prototype.createInstance=function(r){return new e(r)},e}(),Fr=new zr;x.exports=Fr},{3:3}]},{},[4])(4)})}),et=Ze((_,O)=>{(function(m,x){typeof _=="object"&&typeof O<"u"?x(_):typeof define=="function"&&define.amd?define("localforage-driver-memory",["exports"],x):x(m.LocalforageDriverMemory={})})(typeof self<"u"?self:_,function(m){var x="localforage-driver-memory";function q(a){var f=typeof Symbol=="function"&&a[Symbol.iterator],h=0;return f?f.call(a):{next:function(){return a&&h>=a.length&&(a=void 0),{value:a&&a[h++],done:!a}}}}function C(a,f){a=a||[],f=f||{};try{return new Blob(a,f)}catch(I){if(I.name!=="TypeError")throw I;for(var h=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,p=new h,g=0;g<a.length;g+=1)p.append(a[g]);return p.getBlob(f.type)}}var P=/^~~local_forage_type~([^~]+)~/,j=9,D=j+4,L=Object.prototype.toString;function Y(a){var f=a.length*.75,h=a.length;a[a.length-1]==="="&&(f--,a[a.length-2]==="="&&f--);for(var p=new ArrayBuffer(f),g=new Uint8Array(p),I=0,M=0;I<h;I+=4){var V="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(a[I]),ce="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(a[I+1]),ae="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(a[I+2]),de="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(a[I+3]);g[M++]=V<<2|ce>>4,g[M++]=(ce&15)<<4|ae>>2,g[M++]=(ae&3)<<6|de&63}return p}function y(a){for(var f=new Uint8Array(a),h="",p=0;p<f.length;p+=3)h+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[f[p]>>2],h+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(f[p]&3)<<4|f[p+1]>>4],h+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(f[p+1]&15)<<2|f[p+2]>>6],h+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[f[p+2]&63];return f.length%3===2?h=h.substring(0,h.length-1)+"=":f.length%3===1&&(h=h.substring(0,h.length-2)+"=="),h}function w(a,f){var h="";if(a&&(h=L.call(a)),a&&(h==="[object ArrayBuffer]"||a.buffer&&L.call(a.buffer)==="[object ArrayBuffer]")){var p=void 0,g="__lfsc__:";a instanceof ArrayBuffer?(p=a,g+="arbf"):(p=a.buffer,h==="[object Int8Array]"?g+="si08":h==="[object Uint8Array]"?g+="ui08":h==="[object Uint8ClampedArray]"?g+="uic8":h==="[object Int16Array]"?g+="si16":h==="[object Uint16Array]"?g+="ur16":h==="[object Int32Array]"?g+="si32":h==="[object Uint32Array]"?g+="ui32":h==="[object Float32Array]"?g+="fl32":h==="[object Float64Array]"?g+="fl64":f(new Error("Failed to get type for BinaryArray"))),f(g+y(p))}else if(h==="[object Blob]"){var I=new FileReader;I.onload=function(){var M="~~local_forage_type~"+a.type+"~"+y(this.result);f("__lfsc__:blob"+M)},I.readAsArrayBuffer(a)}else try{f(JSON.stringify(a))}catch(M){console.error("Couldn't convert value into a JSON string: ",a),f(null,M)}}function z(a){if(a.substring(0,j)!=="__lfsc__:")return JSON.parse(a);var f=a.substring(D),h=a.substring(j,D),p;if(h==="blob"&&P.test(f)){var g=f.match(P);p=g[1],f=f.substring(g[0].length)}var I=Y(f);switch(h){case"arbf":return I;case"blob":return C([I],{type:p});case"si08":return new Int8Array(I);case"ui08":return new Uint8Array(I);case"uic8":return new Uint8ClampedArray(I);case"si16":return new Int16Array(I);case"ur16":return new Uint16Array(I);case"si32":return new Int32Array(I);case"ui32":return new Uint32Array(I);case"fl32":return new Float32Array(I);case"fl64":return new Float64Array(I);default:throw new Error("Unkown type: "+h)}}function F(a){var f,h;if(a===null||typeof a!="object"||"isActiveClone"in a)return a;var p=a instanceof Date?new Date(a):a.constructor();try{for(var g=q(Object.keys(a)),I=g.next();!I.done;I=g.next()){var M=I.value;Object.prototype.hasOwnProperty.call(a,M)&&(a.isActiveClone=null,p[M]=F(a[M]),delete a.isActiveClone)}}catch(V){f={error:V}}finally{try{I&&!I.done&&(h=g.return)&&h.call(g)}finally{if(f)throw f.error}}return p}function Z(a,f){return(a.name||f.name)+"/"+(a.storeName||f.storeName)+"/"}function A(a,f){f&&a.then(function(h){f(null,h)},function(h){f(h)})}function G(){for(var a=[],f=0;f<arguments.length;f++)a[f]=arguments[f];if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}function U(a,f){var h=this;if(f=G.apply(this,arguments),a=typeof a!="function"&&a||{},!a.name){var p=this.config();a.name=a.name||p.name,a.storeName=a.storeName||p.storeName}var g;return a.name?g=new Promise(function(I){a.storeName?I(Z(a,h._defaultConfig)):I(a.name+"/")}):g=Promise.reject("Invalid arguments"),{promise:g,callback:f}}function oe(a){return typeof a!="string"&&(console.warn(a+" used as a key, but it is not a string."),a=String(a)),a}var ee={bufferToString:y,deserialize:z,serialize:w,stringToBuffer:Y},v={},N=function(){function a(f){this.kp=f,this.data={}}return a.resolve=function(f){return v[f]||(v[f]=new a(f)),v[f]},a.prototype.clear=function(){this.data={}},a.prototype.drop=function(){this.clear(),delete v[this.kp]},a.prototype.get=function(f){return this.data[f]},a.prototype.key=function(f){return this.keys()[f]},a.prototype.keys=function(){return Object.keys(this.data)},a.prototype.rm=function(f){delete this.data[f]},a.prototype.set=function(f,h){this.data[f]=h},a}();function E(a){var f=a?F(a):{},h=Z(f,this._defaultConfig),p=N.resolve(h);return this._dbInfo=f,this._dbInfo.serializer=ee,this._dbInfo.keyPrefix=h,this._dbInfo.mStore=p,Promise.resolve()}function B(a){var f=this,h=this.ready().then(function(){f._dbInfo.mStore.clear()});return A(h,a),h}function K(a,f){var h=U.apply(this,arguments),p=h.promise,g=h.callback,I=p.then(function(M){N.resolve(M).drop()});return A(I,g),p}function X(a,f){var h=this;a=oe(a);var p=this.ready().then(function(){var g=h._dbInfo.mStore.get(a);return g==null?null:h._dbInfo.serializer.deserialize(g)});return A(p,f),p}function J(a,f){var h=this,p=this.ready().then(function(){for(var g=h._dbInfo.mStore,I=g.keys(),M=0;M<I.length;M++){var V=g.get(I[M]);if(V&&(V=h._dbInfo.serializer.deserialize(V)),V=a(V,I[M],M+1),V!==void 0)return V}});return A(p,f),p}function Q(a,f){var h=this,p=this.ready().then(function(){var g;try{g=h._dbInfo.mStore.key(a),g===void 0&&(g=null)}catch{g=null}return g});return A(p,f),p}function $(a){var f=this,h=this.ready().then(function(){return f._dbInfo.mStore.keys()});return A(h,a),h}function ie(a){var f=this.keys().then(function(h){return h.length});return A(f,a),f}function ue(a,f){var h=this;a=oe(a);var p=this.ready().then(function(){h._dbInfo.mStore.rm(a)});return A(p,f),p}function le(a,f,h){var p=this;a=oe(a);var g=this.ready().then(function(){f===void 0&&(f=null);var I=f;return new Promise(function(M,V){p._dbInfo.serializer.serialize(f,function(ce,ae){if(ae)V(ae);else try{p._dbInfo.mStore.set(a,ce),M(I)}catch(de){V(de)}})})});return A(g,h),g}var re=!0;m._support=re,m._driver=x,m._initStorage=E,m.clear=B,m.dropInstance=K,m.getItem=X,m.iterate=J,m.key=Q,m.keys=$,m.length=ie,m.removeItem=ue,m.setItem=le,Object.defineProperty(m,"__esModule",{value:!0})})}),Ne=He($r()),Je=He(et()),rt={display:"none",position:"fixed",top:"0",right:"0",width:"100%",height:"100%",borderRadius:"0",border:"none",zIndex:"2147483647"};function tt(_){for(let[O,m]of Object.entries(rt))_.style[O]=m}function nt(_){return!![].slice.call(document.querySelectorAll(".magic-iframe")).find(m=>m.src.includes(_))}var ot=class extends Kr{constructor(){super(...arguments),this.activeElement=null}init(){this.test="hello",this.iframe=new Promise(_=>{let O=()=>{if(nt(encodeURIComponent(this.parameters)))Xr().log();else{let m=document.createElement("iframe");m.classList.add("magic-iframe"),m.dataset.magicIframeLabel=Ye(this.endpoint).host,m.title="Secure Modal",m.src=Ye(`/send?params=${encodeURIComponent(this.parameters)}`,this.endpoint).href,tt(m),document.body.appendChild(m),_(m)}};["loaded","interactive","complete"].includes(document.readyState)?O():window.addEventListener("load",O,!1)}),window.addEventListener("message",_=>{var O;if(_.origin===this.endpoint&&_.data&&_.data.msgType&&this.messageHandlers.size){_.data.response=(O=_.data.response)!=null?O:{};for(let m of this.messageHandlers.values())m(_)}})}showOverlay(){return me(this,null,function*(){let _=yield this.iframe;_.style.display="block",this.activeElement=document.activeElement,_.focus()})}hideOverlay(){return me(this,null,function*(){var _;let O=yield this.iframe;O.style.display="none",(_=this.activeElement)!=null&&_.focus&&this.activeElement.focus(),this.activeElement=null})}_post(_){return me(this,null,function*(){let O=yield this.iframe;if(O&&O.contentWindow)O.contentWindow.postMessage(_,this.endpoint);else throw Vr()})}},ut=Wr(qr,{platform:"web",sdkName:"magic-sdk",version:"27.0.0",defaultEndpoint:"https://auth.magic.link/",ViewController:ot,configureStorage:()=>me(void 0,null,function*(){let _=Ne.default.createInstance({name:"MagicAuthLocalStorageDB",storeName:"MagicAuthLocalStorage"});return yield _.defineDriver(Je),yield _.setDriver([Ne.default.INDEXEDDB,Ne.default.LOCALSTORAGE,Je._driver]),_})});export{st as DeepLinkPage,lt as DeviceVerificationEventEmit,dt as DeviceVerificationEventOnReceived,vt as EthChainType,ht as Events,yt as Extension,pt as ExtensionError,mt as ExtensionWarning,bt as LoginWithEmailOTPEventEmit,gt as LoginWithEmailOTPEventOnReceived,_t as LoginWithMagicLinkEventEmit,wt as LoginWithMagicLinkEventOnReceived,ut as Magic,It as MagicIncomingWindowMessage,Et as MagicOutgoingWindowMessage,St as MagicPayloadMethod,Ot as RPCError,jt as RPCErrorCode,Nt as RecencyCheckEventEmit,At as RecencyCheckEventOnReceived,Bt as RecoveryMethodType,kt as SDKError,xt as SDKErrorCode,Dt as SDKWarning,Rt as SDKWarningCode,Ct as UpdateEmailEventEmit,Lt as UpdateEmailEventOnReceived,Mt as Wallets,Tt as isPromiEvent};
1
+ import{K as Wr,$ as qr,B as Kr,m as Vr,q as Xr,J as Ye}from"./index-BeEAoUyL.js";import{g as st,R as lt,T as dt,k as vt,E as ht,a as yt,V as pt,s as mt,I as bt,b as gt,c as _t,N as wt,f as It,d as Et,v as St,_ as Ot,e as jt,h as Nt,O as At,y as Bt,A as kt,i as xt,W as Dt,p as Rt,U as Ct,L as Lt,u as Mt,x as Tt}from"./index-BeEAoUyL.js";import"./index-Cl1nwlEZ.js";var se={},Yr=Object.create,Qe=Object.defineProperty,Jr=Object.getOwnPropertyDescriptor,Qr=Object.getOwnPropertyNames,Zr=Object.getPrototypeOf,Hr=Object.prototype.hasOwnProperty,pe=(_=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(_,{get:(O,m)=>(typeof require<"u"?require:O)[m]}):_)(function(_){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+_+'" is not supported')}),Ze=(_,O)=>()=>(O||_((O={exports:{}}).exports,O),O.exports),Gr=(_,O,m,x)=>{if(O&&typeof O=="object"||typeof O=="function")for(let q of Qr(O))!Hr.call(_,q)&&q!==m&&Qe(_,q,{get:()=>O[q],enumerable:!(x=Jr(O,q))||x.enumerable});return _},He=(_,O,m)=>(m=_!=null?Yr(Zr(_)):{},Gr(!_||!_.__esModule?Qe(m,"default",{value:_,enumerable:!0}):m,_)),me=(_,O,m)=>new Promise((x,q)=>{var C=D=>{try{j(m.next(D))}catch(L){q(L)}},P=D=>{try{j(m.throw(D))}catch(L){q(L)}},j=D=>D.done?x(D.value):Promise.resolve(D.value).then(C,P);j((m=m.apply(_,O)).next())}),$r=Ze((_,O)=>{(function(m){if(typeof _=="object"&&typeof O<"u")O.exports=m();else if(typeof define=="function"&&define.amd)define([],m);else{var x;typeof window<"u"?x=window:typeof se<"u"?x=se:typeof self<"u"?x=self:x=this,x.localforage=m()}})(function(){return function m(x,q,C){function P(L,Y){if(!q[L]){if(!x[L]){var y=typeof pe=="function"&&pe;if(!Y&&y)return y(L,!0);if(j)return j(L,!0);var w=new Error("Cannot find module '"+L+"'");throw w.code="MODULE_NOT_FOUND",w}var z=q[L]={exports:{}};x[L][0].call(z.exports,function(F){var Z=x[L][1][F];return P(Z||F)},z,z.exports,m,x,q,C)}return q[L].exports}for(var j=typeof pe=="function"&&pe,D=0;D<C.length;D++)P(C[D]);return P}({1:[function(m,x,q){(function(C){var P=C.MutationObserver||C.WebKitMutationObserver,j;if(P){var D=0,L=new P(F),Y=C.document.createTextNode("");L.observe(Y,{characterData:!0}),j=function(){Y.data=D=++D%2}}else if(!C.setImmediate&&typeof C.MessageChannel<"u"){var y=new C.MessageChannel;y.port1.onmessage=F,j=function(){y.port2.postMessage(0)}}else"document"in C&&"onreadystatechange"in C.document.createElement("script")?j=function(){var A=C.document.createElement("script");A.onreadystatechange=function(){F(),A.onreadystatechange=null,A.parentNode.removeChild(A),A=null},C.document.documentElement.appendChild(A)}:j=function(){setTimeout(F,0)};var w,z=[];function F(){w=!0;for(var A,G,U=z.length;U;){for(G=z,z=[],A=-1;++A<U;)G[A]();U=z.length}w=!1}x.exports=Z;function Z(A){z.push(A)===1&&!w&&j()}}).call(this,typeof se<"u"?se:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(m,x,q){var C=m(1);function P(){}var j={},D=["REJECTED"],L=["FULFILLED"],Y=["PENDING"];x.exports=y;function y(v){if(typeof v!="function")throw new TypeError("resolver must be a function");this.state=Y,this.queue=[],this.outcome=void 0,v!==P&&Z(this,v)}y.prototype.catch=function(v){return this.then(null,v)},y.prototype.then=function(v,N){if(typeof v!="function"&&this.state===L||typeof N!="function"&&this.state===D)return this;var E=new this.constructor(P);if(this.state!==Y){var B=this.state===L?v:N;z(E,B,this.outcome)}else this.queue.push(new w(E,v,N));return E};function w(v,N,E){this.promise=v,typeof N=="function"&&(this.onFulfilled=N,this.callFulfilled=this.otherCallFulfilled),typeof E=="function"&&(this.onRejected=E,this.callRejected=this.otherCallRejected)}w.prototype.callFulfilled=function(v){j.resolve(this.promise,v)},w.prototype.otherCallFulfilled=function(v){z(this.promise,this.onFulfilled,v)},w.prototype.callRejected=function(v){j.reject(this.promise,v)},w.prototype.otherCallRejected=function(v){z(this.promise,this.onRejected,v)};function z(v,N,E){C(function(){var B;try{B=N(E)}catch(K){return j.reject(v,K)}B===v?j.reject(v,new TypeError("Cannot resolve promise with itself")):j.resolve(v,B)})}j.resolve=function(v,N){var E=A(F,N);if(E.status==="error")return j.reject(v,E.value);var B=E.value;if(B)Z(v,B);else{v.state=L,v.outcome=N;for(var K=-1,X=v.queue.length;++K<X;)v.queue[K].callFulfilled(N)}return v},j.reject=function(v,N){v.state=D,v.outcome=N;for(var E=-1,B=v.queue.length;++E<B;)v.queue[E].callRejected(N);return v};function F(v){var N=v&&v.then;if(v&&(typeof v=="object"||typeof v=="function")&&typeof N=="function")return function(){N.apply(v,arguments)}}function Z(v,N){var E=!1;function B(Q){E||(E=!0,j.reject(v,Q))}function K(Q){E||(E=!0,j.resolve(v,Q))}function X(){N(K,B)}var J=A(X);J.status==="error"&&B(J.value)}function A(v,N){var E={};try{E.value=v(N),E.status="success"}catch(B){E.status="error",E.value=B}return E}y.resolve=G;function G(v){return v instanceof this?v:j.resolve(new this(P),v)}y.reject=U;function U(v){var N=new this(P);return j.reject(N,v)}y.all=oe;function oe(v){var N=this;if(Object.prototype.toString.call(v)!=="[object Array]")return this.reject(new TypeError("must be an array"));var E=v.length,B=!1;if(!E)return this.resolve([]);for(var K=new Array(E),X=0,J=-1,Q=new this(P);++J<E;)$(v[J],J);return Q;function $(ie,ue){N.resolve(ie).then(le,function(re){B||(B=!0,j.reject(Q,re))});function le(re){K[ue]=re,++X===E&&!B&&(B=!0,j.resolve(Q,K))}}}y.race=ee;function ee(v){var N=this;if(Object.prototype.toString.call(v)!=="[object Array]")return this.reject(new TypeError("must be an array"));var E=v.length,B=!1;if(!E)return this.resolve([]);for(var K=-1,X=new this(P);++K<E;)J(v[K]);return X;function J(Q){N.resolve(Q).then(function($){B||(B=!0,j.resolve(X,$))},function($){B||(B=!0,j.reject(X,$))})}}},{1:1}],3:[function(m,x,q){(function(C){typeof C.Promise!="function"&&(C.Promise=m(2))}).call(this,typeof se<"u"?se:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(m,x,q){var C=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function P(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function j(){try{if(typeof indexedDB<"u")return indexedDB;if(typeof webkitIndexedDB<"u")return webkitIndexedDB;if(typeof mozIndexedDB<"u")return mozIndexedDB;if(typeof OIndexedDB<"u")return OIndexedDB;if(typeof msIndexedDB<"u")return msIndexedDB}catch{return}}var D=j();function L(){try{if(!D||!D.open)return!1;var e=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),r=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!e||r)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}function Y(e,r){e=e||[],r=r||{};try{return new Blob(e,r)}catch(i){if(i.name!=="TypeError")throw i;for(var t=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,o=new t,n=0;n<e.length;n+=1)o.append(e[n]);return o.getBlob(r.type)}}typeof Promise>"u"&&m(3);var y=Promise;function w(e,r){r&&e.then(function(t){r(null,t)},function(t){r(t)})}function z(e,r,t){typeof r=="function"&&e.then(r),typeof t=="function"&&e.catch(t)}function F(e){return typeof e!="string"&&(console.warn(e+" used as a key, but it is not a string."),e=String(e)),e}function Z(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var A="local-forage-detect-blob-support",G=void 0,U={},oe=Object.prototype.toString,ee="readonly",v="readwrite";function N(e){for(var r=e.length,t=new ArrayBuffer(r),o=new Uint8Array(t),n=0;n<r;n++)o[n]=e.charCodeAt(n);return t}function E(e){return new y(function(r){var t=e.transaction(A,v),o=Y([""]);t.objectStore(A).put(o,"key"),t.onabort=function(n){n.preventDefault(),n.stopPropagation(),r(!1)},t.oncomplete=function(){var n=navigator.userAgent.match(/Chrome\/(\d+)/),i=navigator.userAgent.match(/Edge\//);r(i||!n||parseInt(n[1],10)>=43)}}).catch(function(){return!1})}function B(e){return typeof G=="boolean"?y.resolve(G):E(e).then(function(r){return G=r,G})}function K(e){var r=U[e.name],t={};t.promise=new y(function(o,n){t.resolve=o,t.reject=n}),r.deferredOperations.push(t),r.dbReady?r.dbReady=r.dbReady.then(function(){return t.promise}):r.dbReady=t.promise}function X(e){var r=U[e.name],t=r.deferredOperations.pop();if(t)return t.resolve(),t.promise}function J(e,r){var t=U[e.name],o=t.deferredOperations.pop();if(o)return o.reject(r),o.promise}function Q(e,r){return new y(function(t,o){if(U[e.name]=U[e.name]||g(),e.db)if(r)K(e),e.db.close();else return t(e.db);var n=[e.name];r&&n.push(e.version);var i=D.open.apply(D,n);r&&(i.onupgradeneeded=function(u){var c=i.result;try{c.createObjectStore(e.storeName),u.oldVersion<=1&&c.createObjectStore(A)}catch(d){if(d.name==="ConstraintError")console.warn('The database "'+e.name+'" has been upgraded from version '+u.oldVersion+" to version "+u.newVersion+', but the storage "'+e.storeName+'" already exists.');else throw d}}),i.onerror=function(u){u.preventDefault(),o(i.error)},i.onsuccess=function(){var u=i.result;u.onversionchange=function(c){c.target.close()},t(u),X(e)}})}function $(e){return Q(e,!1)}function ie(e){return Q(e,!0)}function ue(e,r){if(!e.db)return!0;var t=!e.db.objectStoreNames.contains(e.storeName),o=e.version<e.db.version,n=e.version>e.db.version;if(o&&(e.version!==r&&console.warn('The database "'+e.name+`" can't be downgraded from version `+e.db.version+" to version "+e.version+"."),e.version=e.db.version),n||t){if(t){var i=e.db.version+1;i>e.version&&(e.version=i)}return!0}return!1}function le(e){return new y(function(r,t){var o=new FileReader;o.onerror=t,o.onloadend=function(n){var i=btoa(n.target.result||"");r({__local_forage_encoded_blob:!0,data:i,type:e.type})},o.readAsBinaryString(e)})}function re(e){var r=N(atob(e.data));return Y([r],{type:e.type})}function a(e){return e&&e.__local_forage_encoded_blob}function f(e){var r=this,t=r._initReady().then(function(){var o=U[r._dbInfo.name];if(o&&o.dbReady)return o.dbReady});return z(t,e,e),t}function h(e){K(e);for(var r=U[e.name],t=r.forages,o=0;o<t.length;o++){var n=t[o];n._dbInfo.db&&(n._dbInfo.db.close(),n._dbInfo.db=null)}return e.db=null,$(e).then(function(i){return e.db=i,ue(e)?ie(e):i}).then(function(i){e.db=r.db=i;for(var u=0;u<t.length;u++)t[u]._dbInfo.db=i}).catch(function(i){throw J(e,i),i})}function p(e,r,t,o){o===void 0&&(o=1);try{var n=e.db.transaction(e.storeName,r);t(null,n)}catch(i){if(o>0&&(!e.db||i.name==="InvalidStateError"||i.name==="NotFoundError"))return y.resolve().then(function(){if(!e.db||i.name==="NotFoundError"&&!e.db.objectStoreNames.contains(e.storeName)&&e.version<=e.db.version)return e.db&&(e.version=e.db.version+1),ie(e)}).then(function(){return h(e).then(function(){p(e,r,t,o-1)})}).catch(t);t(i)}}function g(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function I(e){var r=this,t={db:null};if(e)for(var o in e)t[o]=e[o];var n=U[t.name];n||(n=g(),U[t.name]=n),n.forages.push(r),r._initReady||(r._initReady=r.ready,r.ready=f);var i=[];function u(){return y.resolve()}for(var c=0;c<n.forages.length;c++){var d=n.forages[c];d!==r&&i.push(d._initReady().catch(u))}var l=n.forages.slice(0);return y.all(i).then(function(){return t.db=n.db,$(t)}).then(function(s){return t.db=s,ue(t,r._defaultConfig.version)?ie(t):s}).then(function(s){t.db=n.db=s,r._dbInfo=t;for(var b=0;b<l.length;b++){var S=l[b];S!==r&&(S._dbInfo.db=t.db,S._dbInfo.version=t.version)}})}function M(e,r){var t=this;e=F(e);var o=new y(function(n,i){t.ready().then(function(){p(t._dbInfo,ee,function(u,c){if(u)return i(u);try{var d=c.objectStore(t._dbInfo.storeName),l=d.get(e);l.onsuccess=function(){var s=l.result;s===void 0&&(s=null),a(s)&&(s=re(s)),n(s)},l.onerror=function(){i(l.error)}}catch(s){i(s)}})}).catch(i)});return w(o,r),o}function V(e,r){var t=this,o=new y(function(n,i){t.ready().then(function(){p(t._dbInfo,ee,function(u,c){if(u)return i(u);try{var d=c.objectStore(t._dbInfo.storeName),l=d.openCursor(),s=1;l.onsuccess=function(){var b=l.result;if(b){var S=b.value;a(S)&&(S=re(S));var R=e(S,b.key,s++);R!==void 0?n(R):b.continue()}else n()},l.onerror=function(){i(l.error)}}catch(b){i(b)}})}).catch(i)});return w(o,r),o}function ce(e,r,t){var o=this;e=F(e);var n=new y(function(i,u){var c;o.ready().then(function(){return c=o._dbInfo,oe.call(r)==="[object Blob]"?B(c.db).then(function(d){return d?r:le(r)}):r}).then(function(d){p(o._dbInfo,v,function(l,s){if(l)return u(l);try{var b=s.objectStore(o._dbInfo.storeName);d===null&&(d=void 0);var S=b.put(d,e);s.oncomplete=function(){d===void 0&&(d=null),i(d)},s.onabort=s.onerror=function(){var R=S.error?S.error:S.transaction.error;u(R)}}catch(R){u(R)}})}).catch(u)});return w(n,t),n}function ae(e,r){var t=this;e=F(e);var o=new y(function(n,i){t.ready().then(function(){p(t._dbInfo,v,function(u,c){if(u)return i(u);try{var d=c.objectStore(t._dbInfo.storeName),l=d.delete(e);c.oncomplete=function(){n()},c.onerror=function(){i(l.error)},c.onabort=function(){var s=l.error?l.error:l.transaction.error;i(s)}}catch(s){i(s)}})}).catch(i)});return w(o,r),o}function de(e){var r=this,t=new y(function(o,n){r.ready().then(function(){p(r._dbInfo,v,function(i,u){if(i)return n(i);try{var c=u.objectStore(r._dbInfo.storeName),d=c.clear();u.oncomplete=function(){o()},u.onabort=u.onerror=function(){var l=d.error?d.error:d.transaction.error;n(l)}}catch(l){n(l)}})}).catch(n)});return w(t,e),t}function Ge(e){var r=this,t=new y(function(o,n){r.ready().then(function(){p(r._dbInfo,ee,function(i,u){if(i)return n(i);try{var c=u.objectStore(r._dbInfo.storeName),d=c.count();d.onsuccess=function(){o(d.result)},d.onerror=function(){n(d.error)}}catch(l){n(l)}})}).catch(n)});return w(t,e),t}function $e(e,r){var t=this,o=new y(function(n,i){if(e<0){n(null);return}t.ready().then(function(){p(t._dbInfo,ee,function(u,c){if(u)return i(u);try{var d=c.objectStore(t._dbInfo.storeName),l=!1,s=d.openKeyCursor();s.onsuccess=function(){var b=s.result;if(!b){n(null);return}e===0||l?n(b.key):(l=!0,b.advance(e))},s.onerror=function(){i(s.error)}}catch(b){i(b)}})}).catch(i)});return w(o,r),o}function er(e){var r=this,t=new y(function(o,n){r.ready().then(function(){p(r._dbInfo,ee,function(i,u){if(i)return n(i);try{var c=u.objectStore(r._dbInfo.storeName),d=c.openKeyCursor(),l=[];d.onsuccess=function(){var s=d.result;if(!s){o(l);return}l.push(s.key),s.continue()},d.onerror=function(){n(d.error)}}catch(s){n(s)}})}).catch(n)});return w(t,e),t}function rr(e,r){r=Z.apply(this,arguments);var t=this.config();e=typeof e!="function"&&e||{},e.name||(e.name=e.name||t.name,e.storeName=e.storeName||t.storeName);var o=this,n;if(!e.name)n=y.reject("Invalid arguments");else{var i=e.name===t.name&&o._dbInfo.db,u=i?y.resolve(o._dbInfo.db):$(e).then(function(c){var d=U[e.name],l=d.forages;d.db=c;for(var s=0;s<l.length;s++)l[s]._dbInfo.db=c;return c});e.storeName?n=u.then(function(c){if(c.objectStoreNames.contains(e.storeName)){var d=c.version+1;K(e);var l=U[e.name],s=l.forages;c.close();for(var b=0;b<s.length;b++){var S=s[b];S._dbInfo.db=null,S._dbInfo.version=d}var R=new y(function(k,W){var T=D.open(e.name,d);T.onerror=function(H){var Oe=T.result;Oe.close(),W(H)},T.onupgradeneeded=function(){var H=T.result;H.deleteObjectStore(e.storeName)},T.onsuccess=function(){var H=T.result;H.close(),k(H)}});return R.then(function(k){l.db=k;for(var W=0;W<s.length;W++){var T=s[W];T._dbInfo.db=k,X(T._dbInfo)}}).catch(function(k){throw(J(e,k)||y.resolve()).catch(function(){}),k})}}):n=u.then(function(c){K(e);var d=U[e.name],l=d.forages;c.close();for(var s=0;s<l.length;s++){var b=l[s];b._dbInfo.db=null}var S=new y(function(R,k){var W=D.deleteDatabase(e.name);W.onerror=function(){var T=W.result;T&&T.close(),k(W.error)},W.onblocked=function(){console.warn('dropInstance blocked for database "'+e.name+'" until all open connections are closed')},W.onsuccess=function(){var T=W.result;T&&T.close(),R(T)}});return S.then(function(R){d.db=R;for(var k=0;k<l.length;k++){var W=l[k];X(W._dbInfo)}}).catch(function(R){throw(J(e,R)||y.resolve()).catch(function(){}),R})})}return w(n,r),n}var tr={_driver:"asyncStorage",_initStorage:I,_support:L(),iterate:V,getItem:M,setItem:ce,removeItem:ae,clear:de,length:Ge,key:$e,keys:er,dropInstance:rr};function nr(){return typeof openDatabase=="function"}var te="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",or="~~local_forage_type~",Ae=/^~~local_forage_type~([^~]+)~/,he="__lfsc__:",be=he.length,ge="arbf",_e="blob",Be="si08",ke="ui08",xe="uic8",De="si16",Re="si32",Ce="ur16",Le="ui32",Me="fl32",Te="fl64",ze=be+ge.length,Fe=Object.prototype.toString;function Pe(e){var r=e.length*.75,t=e.length,o,n=0,i,u,c,d;e[e.length-1]==="="&&(r--,e[e.length-2]==="="&&r--);var l=new ArrayBuffer(r),s=new Uint8Array(l);for(o=0;o<t;o+=4)i=te.indexOf(e[o]),u=te.indexOf(e[o+1]),c=te.indexOf(e[o+2]),d=te.indexOf(e[o+3]),s[n++]=i<<2|u>>4,s[n++]=(u&15)<<4|c>>2,s[n++]=(c&3)<<6|d&63;return l}function we(e){var r=new Uint8Array(e),t="",o;for(o=0;o<r.length;o+=3)t+=te[r[o]>>2],t+=te[(r[o]&3)<<4|r[o+1]>>4],t+=te[(r[o+1]&15)<<2|r[o+2]>>6],t+=te[r[o+2]&63];return r.length%3===2?t=t.substring(0,t.length-1)+"=":r.length%3===1&&(t=t.substring(0,t.length-2)+"=="),t}function ir(e,r){var t="";if(e&&(t=Fe.call(e)),e&&(t==="[object ArrayBuffer]"||e.buffer&&Fe.call(e.buffer)==="[object ArrayBuffer]")){var o,n=he;e instanceof ArrayBuffer?(o=e,n+=ge):(o=e.buffer,t==="[object Int8Array]"?n+=Be:t==="[object Uint8Array]"?n+=ke:t==="[object Uint8ClampedArray]"?n+=xe:t==="[object Int16Array]"?n+=De:t==="[object Uint16Array]"?n+=Ce:t==="[object Int32Array]"?n+=Re:t==="[object Uint32Array]"?n+=Le:t==="[object Float32Array]"?n+=Me:t==="[object Float64Array]"?n+=Te:r(new Error("Failed to get type for BinaryArray"))),r(n+we(o))}else if(t==="[object Blob]"){var i=new FileReader;i.onload=function(){var u=or+e.type+"~"+we(this.result);r(he+_e+u)},i.readAsArrayBuffer(e)}else try{r(JSON.stringify(e))}catch(u){console.error("Couldn't convert value into a JSON string: ",e),r(null,u)}}function ar(e){if(e.substring(0,be)!==he)return JSON.parse(e);var r=e.substring(ze),t=e.substring(be,ze),o;if(t===_e&&Ae.test(r)){var n=r.match(Ae);o=n[1],r=r.substring(n[0].length)}var i=Pe(r);switch(t){case ge:return i;case _e:return Y([i],{type:o});case Be:return new Int8Array(i);case ke:return new Uint8Array(i);case xe:return new Uint8ClampedArray(i);case De:return new Int16Array(i);case Ce:return new Uint16Array(i);case Re:return new Int32Array(i);case Le:return new Uint32Array(i);case Me:return new Float32Array(i);case Te:return new Float64Array(i);default:throw new Error("Unkown type: "+t)}}var Ie={serialize:ir,deserialize:ar,stringToBuffer:Pe,bufferToString:we};function Ue(e,r,t,o){e.executeSql("CREATE TABLE IF NOT EXISTS "+r.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],t,o)}function ur(e){var r=this,t={db:null};if(e)for(var o in e)t[o]=typeof e[o]!="string"?e[o].toString():e[o];var n=new y(function(i,u){try{t.db=openDatabase(t.name,String(t.version),t.description,t.size)}catch(c){return u(c)}t.db.transaction(function(c){Ue(c,t,function(){r._dbInfo=t,i()},function(d,l){u(l)})},u)});return t.serializer=Ie,n}function ne(e,r,t,o,n,i){e.executeSql(t,o,n,function(u,c){c.code===c.SYNTAX_ERR?u.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[r.storeName],function(d,l){l.rows.length?i(d,c):Ue(d,r,function(){d.executeSql(t,o,n,i)},i)},i):i(u,c)},i)}function cr(e,r){var t=this;e=F(e);var o=new y(function(n,i){t.ready().then(function(){var u=t._dbInfo;u.db.transaction(function(c){ne(c,u,"SELECT * FROM "+u.storeName+" WHERE key = ? LIMIT 1",[e],function(d,l){var s=l.rows.length?l.rows.item(0).value:null;s&&(s=u.serializer.deserialize(s)),n(s)},function(d,l){i(l)})})}).catch(i)});return w(o,r),o}function fr(e,r){var t=this,o=new y(function(n,i){t.ready().then(function(){var u=t._dbInfo;u.db.transaction(function(c){ne(c,u,"SELECT * FROM "+u.storeName,[],function(d,l){for(var s=l.rows,b=s.length,S=0;S<b;S++){var R=s.item(S),k=R.value;if(k&&(k=u.serializer.deserialize(k)),k=e(k,R.key,S+1),k!==void 0){n(k);return}}n()},function(d,l){i(l)})})}).catch(i)});return w(o,r),o}function We(e,r,t,o){var n=this;e=F(e);var i=new y(function(u,c){n.ready().then(function(){r===void 0&&(r=null);var d=r,l=n._dbInfo;l.serializer.serialize(r,function(s,b){b?c(b):l.db.transaction(function(S){ne(S,l,"INSERT OR REPLACE INTO "+l.storeName+" (key, value) VALUES (?, ?)",[e,s],function(){u(d)},function(R,k){c(k)})},function(S){if(S.code===S.QUOTA_ERR){if(o>0){u(We.apply(n,[e,d,t,o-1]));return}c(S)}})})}).catch(c)});return w(i,t),i}function sr(e,r,t){return We.apply(this,[e,r,t,1])}function lr(e,r){var t=this;e=F(e);var o=new y(function(n,i){t.ready().then(function(){var u=t._dbInfo;u.db.transaction(function(c){ne(c,u,"DELETE FROM "+u.storeName+" WHERE key = ?",[e],function(){n()},function(d,l){i(l)})})}).catch(i)});return w(o,r),o}function dr(e){var r=this,t=new y(function(o,n){r.ready().then(function(){var i=r._dbInfo;i.db.transaction(function(u){ne(u,i,"DELETE FROM "+i.storeName,[],function(){o()},function(c,d){n(d)})})}).catch(n)});return w(t,e),t}function vr(e){var r=this,t=new y(function(o,n){r.ready().then(function(){var i=r._dbInfo;i.db.transaction(function(u){ne(u,i,"SELECT COUNT(key) as c FROM "+i.storeName,[],function(c,d){var l=d.rows.item(0).c;o(l)},function(c,d){n(d)})})}).catch(n)});return w(t,e),t}function hr(e,r){var t=this,o=new y(function(n,i){t.ready().then(function(){var u=t._dbInfo;u.db.transaction(function(c){ne(c,u,"SELECT key FROM "+u.storeName+" WHERE id = ? LIMIT 1",[e+1],function(d,l){var s=l.rows.length?l.rows.item(0).key:null;n(s)},function(d,l){i(l)})})}).catch(i)});return w(o,r),o}function yr(e){var r=this,t=new y(function(o,n){r.ready().then(function(){var i=r._dbInfo;i.db.transaction(function(u){ne(u,i,"SELECT key FROM "+i.storeName,[],function(c,d){for(var l=[],s=0;s<d.rows.length;s++)l.push(d.rows.item(s).key);o(l)},function(c,d){n(d)})})}).catch(n)});return w(t,e),t}function pr(e){return new y(function(r,t){e.transaction(function(o){o.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(n,i){for(var u=[],c=0;c<i.rows.length;c++)u.push(i.rows.item(c).name);r({db:e,storeNames:u})},function(n,i){t(i)})},function(o){t(o)})})}function mr(e,r){r=Z.apply(this,arguments);var t=this.config();e=typeof e!="function"&&e||{},e.name||(e.name=e.name||t.name,e.storeName=e.storeName||t.storeName);var o=this,n;return e.name?n=new y(function(i){var u;e.name===t.name?u=o._dbInfo.db:u=openDatabase(e.name,"","",0),e.storeName?i({db:u,storeNames:[e.storeName]}):i(pr(u))}).then(function(i){return new y(function(u,c){i.db.transaction(function(d){function l(R){return new y(function(k,W){d.executeSql("DROP TABLE IF EXISTS "+R,[],function(){k()},function(T,H){W(H)})})}for(var s=[],b=0,S=i.storeNames.length;b<S;b++)s.push(l(i.storeNames[b]));y.all(s).then(function(){u()}).catch(function(R){c(R)})},function(d){c(d)})})}):n=y.reject("Invalid arguments"),w(n,r),n}var br={_driver:"webSQLStorage",_initStorage:ur,_support:nr(),iterate:fr,getItem:cr,setItem:sr,removeItem:lr,clear:dr,length:vr,key:hr,keys:yr,dropInstance:mr};function gr(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function qe(e,r){var t=e.name+"/";return e.storeName!==r.storeName&&(t+=e.storeName+"/"),t}function _r(){var e="_localforage_support_test";try{return localStorage.setItem(e,!0),localStorage.removeItem(e),!1}catch{return!0}}function wr(){return!_r()||localStorage.length>0}function Ir(e){var r=this,t={};if(e)for(var o in e)t[o]=e[o];return t.keyPrefix=qe(e,r._defaultConfig),wr()?(r._dbInfo=t,t.serializer=Ie,y.resolve()):y.reject()}function Er(e){var r=this,t=r.ready().then(function(){for(var o=r._dbInfo.keyPrefix,n=localStorage.length-1;n>=0;n--){var i=localStorage.key(n);i.indexOf(o)===0&&localStorage.removeItem(i)}});return w(t,e),t}function Sr(e,r){var t=this;e=F(e);var o=t.ready().then(function(){var n=t._dbInfo,i=localStorage.getItem(n.keyPrefix+e);return i&&(i=n.serializer.deserialize(i)),i});return w(o,r),o}function Or(e,r){var t=this,o=t.ready().then(function(){for(var n=t._dbInfo,i=n.keyPrefix,u=i.length,c=localStorage.length,d=1,l=0;l<c;l++){var s=localStorage.key(l);if(s.indexOf(i)===0){var b=localStorage.getItem(s);if(b&&(b=n.serializer.deserialize(b)),b=e(b,s.substring(u),d++),b!==void 0)return b}}});return w(o,r),o}function jr(e,r){var t=this,o=t.ready().then(function(){var n=t._dbInfo,i;try{i=localStorage.key(e)}catch{i=null}return i&&(i=i.substring(n.keyPrefix.length)),i});return w(o,r),o}function Nr(e){var r=this,t=r.ready().then(function(){for(var o=r._dbInfo,n=localStorage.length,i=[],u=0;u<n;u++){var c=localStorage.key(u);c.indexOf(o.keyPrefix)===0&&i.push(c.substring(o.keyPrefix.length))}return i});return w(t,e),t}function Ar(e){var r=this,t=r.keys().then(function(o){return o.length});return w(t,e),t}function Br(e,r){var t=this;e=F(e);var o=t.ready().then(function(){var n=t._dbInfo;localStorage.removeItem(n.keyPrefix+e)});return w(o,r),o}function kr(e,r,t){var o=this;e=F(e);var n=o.ready().then(function(){r===void 0&&(r=null);var i=r;return new y(function(u,c){var d=o._dbInfo;d.serializer.serialize(r,function(l,s){if(s)c(s);else try{localStorage.setItem(d.keyPrefix+e,l),u(i)}catch(b){(b.name==="QuotaExceededError"||b.name==="NS_ERROR_DOM_QUOTA_REACHED")&&c(b),c(b)}})})});return w(n,t),n}function xr(e,r){if(r=Z.apply(this,arguments),e=typeof e!="function"&&e||{},!e.name){var t=this.config();e.name=e.name||t.name,e.storeName=e.storeName||t.storeName}var o=this,n;return e.name?n=new y(function(i){e.storeName?i(qe(e,o._defaultConfig)):i(e.name+"/")}).then(function(i){for(var u=localStorage.length-1;u>=0;u--){var c=localStorage.key(u);c.indexOf(i)===0&&localStorage.removeItem(c)}}):n=y.reject("Invalid arguments"),w(n,r),n}var Dr={_driver:"localStorageWrapper",_initStorage:Ir,_support:gr(),iterate:Or,getItem:Sr,setItem:kr,removeItem:Br,clear:Er,length:Ar,key:jr,keys:Nr,dropInstance:xr},Rr=function(e,r){return e===r||typeof e=="number"&&typeof r=="number"&&isNaN(e)&&isNaN(r)},Cr=function(e,r){for(var t=e.length,o=0;o<t;){if(Rr(e[o],r))return!0;o++}return!1},Ke=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"},ve={},Ve={},fe={INDEXEDDB:tr,WEBSQL:br,LOCALSTORAGE:Dr},Lr=[fe.INDEXEDDB._driver,fe.WEBSQL._driver,fe.LOCALSTORAGE._driver],ye=["dropInstance"],Ee=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(ye),Mr={description:"",driver:Lr.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function Tr(e,r){e[r]=function(){var t=arguments;return e.ready().then(function(){return e[r].apply(e,t)})}}function Se(){for(var e=1;e<arguments.length;e++){var r=arguments[e];if(r)for(var t in r)r.hasOwnProperty(t)&&(Ke(r[t])?arguments[0][t]=r[t].slice():arguments[0][t]=r[t])}return arguments[0]}var zr=function(){function e(r){P(this,e);for(var t in fe)if(fe.hasOwnProperty(t)){var o=fe[t],n=o._driver;this[t]=n,ve[n]||this.defineDriver(o)}this._defaultConfig=Se({},Mr),this._config=Se({},this._defaultConfig,r),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return e.prototype.config=function(r){if((typeof r>"u"?"undefined":C(r))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var t in r){if(t==="storeName"&&(r[t]=r[t].replace(/\W/g,"_")),t==="version"&&typeof r[t]!="number")return new Error("Database version must be a number.");this._config[t]=r[t]}return"driver"in r&&r.driver?this.setDriver(this._config.driver):!0}else return typeof r=="string"?this._config[r]:this._config},e.prototype.defineDriver=function(r,t,o){var n=new y(function(i,u){try{var c=r._driver,d=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!r._driver){u(d);return}for(var l=Ee.concat("_initStorage"),s=0,b=l.length;s<b;s++){var S=l[s],R=!Cr(ye,S);if((R||r[S])&&typeof r[S]!="function"){u(d);return}}var k=function(){for(var T=function(Pr){return function(){var Ur=new Error("Method "+Pr+" is not implemented by the current driver"),Xe=y.reject(Ur);return w(Xe,arguments[arguments.length-1]),Xe}},H=0,Oe=ye.length;H<Oe;H++){var je=ye[H];r[je]||(r[je]=T(je))}};k();var W=function(T){ve[c]&&console.info("Redefining LocalForage driver: "+c),ve[c]=r,Ve[c]=T,i()};"_support"in r?r._support&&typeof r._support=="function"?r._support().then(W,u):W(!!r._support):W(!0)}catch(T){u(T)}});return z(n,t,o),n},e.prototype.driver=function(){return this._driver||null},e.prototype.getDriver=function(r,t,o){var n=ve[r]?y.resolve(ve[r]):y.reject(new Error("Driver not found."));return z(n,t,o),n},e.prototype.getSerializer=function(r){var t=y.resolve(Ie);return z(t,r),t},e.prototype.ready=function(r){var t=this,o=t._driverSet.then(function(){return t._ready===null&&(t._ready=t._initDriver()),t._ready});return z(o,r,r),o},e.prototype.setDriver=function(r,t,o){var n=this;Ke(r)||(r=[r]);var i=this._getSupportedDrivers(r);function u(){n._config.driver=n.driver()}function c(s){return n._extend(s),u(),n._ready=n._initStorage(n._config),n._ready}function d(s){return function(){var b=0;function S(){for(;b<s.length;){var R=s[b];return b++,n._dbInfo=null,n._ready=null,n.getDriver(R).then(c).catch(S)}u();var k=new Error("No available storage method found.");return n._driverSet=y.reject(k),n._driverSet}return S()}}var l=this._driverSet!==null?this._driverSet.catch(function(){return y.resolve()}):y.resolve();return this._driverSet=l.then(function(){var s=i[0];return n._dbInfo=null,n._ready=null,n.getDriver(s).then(function(b){n._driver=b._driver,u(),n._wrapLibraryMethodsWithReady(),n._initDriver=d(i)})}).catch(function(){u();var s=new Error("No available storage method found.");return n._driverSet=y.reject(s),n._driverSet}),z(this._driverSet,t,o),this._driverSet},e.prototype.supports=function(r){return!!Ve[r]},e.prototype._extend=function(r){Se(this,r)},e.prototype._getSupportedDrivers=function(r){for(var t=[],o=0,n=r.length;o<n;o++){var i=r[o];this.supports(i)&&t.push(i)}return t},e.prototype._wrapLibraryMethodsWithReady=function(){for(var r=0,t=Ee.length;r<t;r++)Tr(this,Ee[r])},e.prototype.createInstance=function(r){return new e(r)},e}(),Fr=new zr;x.exports=Fr},{3:3}]},{},[4])(4)})}),et=Ze((_,O)=>{(function(m,x){typeof _=="object"&&typeof O<"u"?x(_):typeof define=="function"&&define.amd?define("localforage-driver-memory",["exports"],x):x(m.LocalforageDriverMemory={})})(typeof self<"u"?self:_,function(m){var x="localforage-driver-memory";function q(a){var f=typeof Symbol=="function"&&a[Symbol.iterator],h=0;return f?f.call(a):{next:function(){return a&&h>=a.length&&(a=void 0),{value:a&&a[h++],done:!a}}}}function C(a,f){a=a||[],f=f||{};try{return new Blob(a,f)}catch(I){if(I.name!=="TypeError")throw I;for(var h=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,p=new h,g=0;g<a.length;g+=1)p.append(a[g]);return p.getBlob(f.type)}}var P=/^~~local_forage_type~([^~]+)~/,j=9,D=j+4,L=Object.prototype.toString;function Y(a){var f=a.length*.75,h=a.length;a[a.length-1]==="="&&(f--,a[a.length-2]==="="&&f--);for(var p=new ArrayBuffer(f),g=new Uint8Array(p),I=0,M=0;I<h;I+=4){var V="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(a[I]),ce="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(a[I+1]),ae="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(a[I+2]),de="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(a[I+3]);g[M++]=V<<2|ce>>4,g[M++]=(ce&15)<<4|ae>>2,g[M++]=(ae&3)<<6|de&63}return p}function y(a){for(var f=new Uint8Array(a),h="",p=0;p<f.length;p+=3)h+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[f[p]>>2],h+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(f[p]&3)<<4|f[p+1]>>4],h+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(f[p+1]&15)<<2|f[p+2]>>6],h+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[f[p+2]&63];return f.length%3===2?h=h.substring(0,h.length-1)+"=":f.length%3===1&&(h=h.substring(0,h.length-2)+"=="),h}function w(a,f){var h="";if(a&&(h=L.call(a)),a&&(h==="[object ArrayBuffer]"||a.buffer&&L.call(a.buffer)==="[object ArrayBuffer]")){var p=void 0,g="__lfsc__:";a instanceof ArrayBuffer?(p=a,g+="arbf"):(p=a.buffer,h==="[object Int8Array]"?g+="si08":h==="[object Uint8Array]"?g+="ui08":h==="[object Uint8ClampedArray]"?g+="uic8":h==="[object Int16Array]"?g+="si16":h==="[object Uint16Array]"?g+="ur16":h==="[object Int32Array]"?g+="si32":h==="[object Uint32Array]"?g+="ui32":h==="[object Float32Array]"?g+="fl32":h==="[object Float64Array]"?g+="fl64":f(new Error("Failed to get type for BinaryArray"))),f(g+y(p))}else if(h==="[object Blob]"){var I=new FileReader;I.onload=function(){var M="~~local_forage_type~"+a.type+"~"+y(this.result);f("__lfsc__:blob"+M)},I.readAsArrayBuffer(a)}else try{f(JSON.stringify(a))}catch(M){console.error("Couldn't convert value into a JSON string: ",a),f(null,M)}}function z(a){if(a.substring(0,j)!=="__lfsc__:")return JSON.parse(a);var f=a.substring(D),h=a.substring(j,D),p;if(h==="blob"&&P.test(f)){var g=f.match(P);p=g[1],f=f.substring(g[0].length)}var I=Y(f);switch(h){case"arbf":return I;case"blob":return C([I],{type:p});case"si08":return new Int8Array(I);case"ui08":return new Uint8Array(I);case"uic8":return new Uint8ClampedArray(I);case"si16":return new Int16Array(I);case"ur16":return new Uint16Array(I);case"si32":return new Int32Array(I);case"ui32":return new Uint32Array(I);case"fl32":return new Float32Array(I);case"fl64":return new Float64Array(I);default:throw new Error("Unkown type: "+h)}}function F(a){var f,h;if(a===null||typeof a!="object"||"isActiveClone"in a)return a;var p=a instanceof Date?new Date(a):a.constructor();try{for(var g=q(Object.keys(a)),I=g.next();!I.done;I=g.next()){var M=I.value;Object.prototype.hasOwnProperty.call(a,M)&&(a.isActiveClone=null,p[M]=F(a[M]),delete a.isActiveClone)}}catch(V){f={error:V}}finally{try{I&&!I.done&&(h=g.return)&&h.call(g)}finally{if(f)throw f.error}}return p}function Z(a,f){return(a.name||f.name)+"/"+(a.storeName||f.storeName)+"/"}function A(a,f){f&&a.then(function(h){f(null,h)},function(h){f(h)})}function G(){for(var a=[],f=0;f<arguments.length;f++)a[f]=arguments[f];if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}function U(a,f){var h=this;if(f=G.apply(this,arguments),a=typeof a!="function"&&a||{},!a.name){var p=this.config();a.name=a.name||p.name,a.storeName=a.storeName||p.storeName}var g;return a.name?g=new Promise(function(I){a.storeName?I(Z(a,h._defaultConfig)):I(a.name+"/")}):g=Promise.reject("Invalid arguments"),{promise:g,callback:f}}function oe(a){return typeof a!="string"&&(console.warn(a+" used as a key, but it is not a string."),a=String(a)),a}var ee={bufferToString:y,deserialize:z,serialize:w,stringToBuffer:Y},v={},N=function(){function a(f){this.kp=f,this.data={}}return a.resolve=function(f){return v[f]||(v[f]=new a(f)),v[f]},a.prototype.clear=function(){this.data={}},a.prototype.drop=function(){this.clear(),delete v[this.kp]},a.prototype.get=function(f){return this.data[f]},a.prototype.key=function(f){return this.keys()[f]},a.prototype.keys=function(){return Object.keys(this.data)},a.prototype.rm=function(f){delete this.data[f]},a.prototype.set=function(f,h){this.data[f]=h},a}();function E(a){var f=a?F(a):{},h=Z(f,this._defaultConfig),p=N.resolve(h);return this._dbInfo=f,this._dbInfo.serializer=ee,this._dbInfo.keyPrefix=h,this._dbInfo.mStore=p,Promise.resolve()}function B(a){var f=this,h=this.ready().then(function(){f._dbInfo.mStore.clear()});return A(h,a),h}function K(a,f){var h=U.apply(this,arguments),p=h.promise,g=h.callback,I=p.then(function(M){N.resolve(M).drop()});return A(I,g),p}function X(a,f){var h=this;a=oe(a);var p=this.ready().then(function(){var g=h._dbInfo.mStore.get(a);return g==null?null:h._dbInfo.serializer.deserialize(g)});return A(p,f),p}function J(a,f){var h=this,p=this.ready().then(function(){for(var g=h._dbInfo.mStore,I=g.keys(),M=0;M<I.length;M++){var V=g.get(I[M]);if(V&&(V=h._dbInfo.serializer.deserialize(V)),V=a(V,I[M],M+1),V!==void 0)return V}});return A(p,f),p}function Q(a,f){var h=this,p=this.ready().then(function(){var g;try{g=h._dbInfo.mStore.key(a),g===void 0&&(g=null)}catch{g=null}return g});return A(p,f),p}function $(a){var f=this,h=this.ready().then(function(){return f._dbInfo.mStore.keys()});return A(h,a),h}function ie(a){var f=this.keys().then(function(h){return h.length});return A(f,a),f}function ue(a,f){var h=this;a=oe(a);var p=this.ready().then(function(){h._dbInfo.mStore.rm(a)});return A(p,f),p}function le(a,f,h){var p=this;a=oe(a);var g=this.ready().then(function(){f===void 0&&(f=null);var I=f;return new Promise(function(M,V){p._dbInfo.serializer.serialize(f,function(ce,ae){if(ae)V(ae);else try{p._dbInfo.mStore.set(a,ce),M(I)}catch(de){V(de)}})})});return A(g,h),g}var re=!0;m._support=re,m._driver=x,m._initStorage=E,m.clear=B,m.dropInstance=K,m.getItem=X,m.iterate=J,m.key=Q,m.keys=$,m.length=ie,m.removeItem=ue,m.setItem=le,Object.defineProperty(m,"__esModule",{value:!0})})}),Ne=He($r()),Je=He(et()),rt={display:"none",position:"fixed",top:"0",right:"0",width:"100%",height:"100%",borderRadius:"0",border:"none",zIndex:"2147483647"};function tt(_){for(let[O,m]of Object.entries(rt))_.style[O]=m}function nt(_){return!![].slice.call(document.querySelectorAll(".magic-iframe")).find(m=>m.src.includes(_))}var ot=class extends Kr{constructor(){super(...arguments),this.activeElement=null}init(){this.test="hello",this.iframe=new Promise(_=>{let O=()=>{if(nt(encodeURIComponent(this.parameters)))Xr().log();else{let m=document.createElement("iframe");m.classList.add("magic-iframe"),m.dataset.magicIframeLabel=Ye(this.endpoint).host,m.title="Secure Modal",m.src=Ye(`/send?params=${encodeURIComponent(this.parameters)}`,this.endpoint).href,tt(m),document.body.appendChild(m),_(m)}};["loaded","interactive","complete"].includes(document.readyState)?O():window.addEventListener("load",O,!1)}),window.addEventListener("message",_=>{var O;if(_.origin===this.endpoint&&_.data&&_.data.msgType&&this.messageHandlers.size){_.data.response=(O=_.data.response)!=null?O:{};for(let m of this.messageHandlers.values())m(_)}})}showOverlay(){return me(this,null,function*(){let _=yield this.iframe;_.style.display="block",this.activeElement=document.activeElement,_.focus()})}hideOverlay(){return me(this,null,function*(){var _;let O=yield this.iframe;O.style.display="none",(_=this.activeElement)!=null&&_.focus&&this.activeElement.focus(),this.activeElement=null})}_post(_){return me(this,null,function*(){let O=yield this.iframe;if(O&&O.contentWindow)O.contentWindow.postMessage(_,this.endpoint);else throw Vr()})}},ut=Wr(qr,{platform:"web",sdkName:"magic-sdk",version:"27.0.0",defaultEndpoint:"https://auth.magic.link/",ViewController:ot,configureStorage:()=>me(void 0,null,function*(){let _=Ne.default.createInstance({name:"MagicAuthLocalStorageDB",storeName:"MagicAuthLocalStorage"});return yield _.defineDriver(Je),yield _.setDriver([Ne.default.INDEXEDDB,Ne.default.LOCALSTORAGE,Je._driver]),_})});export{st as DeepLinkPage,lt as DeviceVerificationEventEmit,dt as DeviceVerificationEventOnReceived,vt as EthChainType,ht as Events,yt as Extension,pt as ExtensionError,mt as ExtensionWarning,bt as LoginWithEmailOTPEventEmit,gt as LoginWithEmailOTPEventOnReceived,_t as LoginWithMagicLinkEventEmit,wt as LoginWithMagicLinkEventOnReceived,ut as Magic,It as MagicIncomingWindowMessage,Et as MagicOutgoingWindowMessage,St as MagicPayloadMethod,Ot as RPCError,jt as RPCErrorCode,Nt as RecencyCheckEventEmit,At as RecencyCheckEventOnReceived,Bt as RecoveryMethodType,kt as SDKError,xt as SDKErrorCode,Dt as SDKWarning,Rt as SDKWarningCode,Ct as UpdateEmailEventEmit,Lt as UpdateEmailEventOnReceived,Mt as Wallets,Tt as isPromiEvent};
@@ -0,0 +1 @@
1
+ import{al as o}from"./index-Cl1nwlEZ.js";export{o as default};
@@ -1 +1 @@
1
- import{N as n,am as s,an as r,ao as i,ap as m,aq as g,ar as t,ae as d,as as c,at as u,au as S,X as I,av as P,aw as l,ax as p,ay as y,az as O}from"./index-CqMSvM9y.js";const R=a=>({isPreviewing:r(a),isSidebarOpen:i(a),isReady:m(a),isLoading:g(a),isFetching:t(a),isLoggedIn:d(a),isScreenshotReady:c(a),currentProject:u(a),numItems:S(a)}),C=a=>({onOpenModal:(e,o)=>a(I(e,o)),onCloseEditor:()=>a(P()),onZoomIn:()=>a(l()),onZoomOut:()=>a(p()),onResetCamera:()=>a(y()),onTakeScreenshot:()=>a(O())}),L=n(R,C)(s);export{L as default};
1
+ import{N as n,am as s,an as r,ao as i,ap as m,aq as g,ar as t,ae as d,as as c,at as u,au as S,X as I,av as P,aw as l,ax as p,ay as y,az as O}from"./index-Cl1nwlEZ.js";const R=a=>({isPreviewing:r(a),isSidebarOpen:i(a),isReady:m(a),isLoading:g(a),isFetching:t(a),isLoggedIn:d(a),isScreenshotReady:c(a),currentProject:u(a),numItems:S(a)}),C=a=>({onOpenModal:(e,o)=>a(I(e,o)),onCloseEditor:()=>a(P()),onZoomIn:()=>a(l()),onZoomOut:()=>a(p()),onResetCamera:()=>a(y()),onTakeScreenshot:()=>a(O())}),L=n(R,C)(s);export{L as default};