@zeniai/web-components 4.4.71-beta0AN → 4.4.71-beta1AN

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 (155) hide show
  1. package/dist/Editor-D-c5837t.cjs +269 -0
  2. package/dist/SessionTimeoutPopup-s0x7Vm3o.cjs +92288 -0
  3. package/dist/TaskDescriptionEditor-CrJpcIGy.cjs +197 -0
  4. package/dist/apple-wallet-XaR4in25.cjs +1 -0
  5. package/dist/bank-verification-BZ12rqd4.cjs +1 -0
  6. package/dist/cockpit.cjs.js +5805 -0
  7. package/dist/index.cjs.js +1 -0
  8. package/dist/mcdonalds-logo-C1NFh2Ez.cjs +1 -0
  9. package/dist/mercury-logo-dark-BRVowa2J.cjs +1 -0
  10. package/dist/mercury-logo-xgN_aDpK.cjs +1 -0
  11. package/dist/more-providers-avatars-BZLPP6Y9.cjs +1 -0
  12. package/dist/netsuite-logo-DHDrmdbD.cjs +1 -0
  13. package/dist/netsuite-logo-dark-D6cSqiEo.cjs +1 -0
  14. package/dist/paypal-logo-D1cnBL7r.cjs +1 -0
  15. package/dist/paypal-logo-dark-tdlNDmVK.cjs +1 -0
  16. package/dist/phone-otp-DKOLSS9E.cjs +1 -0
  17. package/dist/subway-logo-D6HsJAOS.cjs +1 -0
  18. package/dist/underline-BaTuFJW8.cjs +76 -0
  19. package/dist/vendor-@babel-runtime-_D8QudKm.cjs +4 -0
  20. package/dist/vendor-@floating-ui-core-Dyvby5gX.cjs +1 -0
  21. package/dist/vendor-@floating-ui-dom-CexqkosJ.cjs +1 -0
  22. package/dist/vendor-@floating-ui-utils-sUr78tUz.cjs +1 -0
  23. package/dist/vendor-@popperjs-core-Da5z8R8_.cjs +1 -0
  24. package/dist/vendor-@react-oauth-google-RY6l5Pdi.cjs +1 -0
  25. package/dist/vendor-@statsig-client-core-CcuuGlfw.cjs +1 -0
  26. package/dist/vendor-@statsig-js-client-C6n1oYZG.cjs +1 -0
  27. package/dist/vendor-@statsig-react-bindings-DVuaLZfm.cjs +1 -0
  28. package/dist/vendor-@stripe-stripe-js-Bg6HyFI3.cjs +8 -0
  29. package/dist/vendor-@ungap-structured-clone-BSqP9FP7.cjs +1 -0
  30. package/dist/vendor-@zeniai-client-epic-state-DWdyw6ma.cjs +1 -0
  31. package/dist/vendor-autosuggest-highlight-BrLUL75m.cjs +1 -0
  32. package/dist/vendor-bail-CPU4onRe.cjs +1 -0
  33. package/dist/vendor-big.js-BfsYTtpv.cjs +1 -0
  34. package/dist/vendor-browser-image-compression-BZPRtRQ2.cjs +20 -0
  35. package/dist/vendor-ccount-B3JMtXU-.cjs +1 -0
  36. package/dist/vendor-clsx-CAED27AB.cjs +1 -0
  37. package/dist/vendor-color-BlJDv7Qx.cjs +1 -0
  38. package/dist/vendor-color-convert-DNxf_t0v.cjs +1 -0
  39. package/dist/vendor-color-name-DMfyNIC_.cjs +1 -0
  40. package/dist/vendor-color-string-DlngRZWO.cjs +1 -0
  41. package/dist/vendor-comma-separated-tokens-CM2uar_0.cjs +1 -0
  42. package/dist/vendor-countries-list-DdDJCIea.cjs +1 -0
  43. package/dist/vendor-country-flag-icons-CaT9dyG0.cjs +1 -0
  44. package/dist/vendor-cross-fetch-BcrCP3uC.cjs +2 -0
  45. package/dist/vendor-decode-named-character-reference-CpsLJx05.cjs +1 -0
  46. package/dist/vendor-devlop-IYc_KfOj.cjs +1 -0
  47. package/dist/vendor-escape-string-regexp-CXe2COqk.cjs +1 -0
  48. package/dist/vendor-estree-util-is-identifier-name-DqXb06tQ.cjs +1 -0
  49. package/dist/vendor-extend-Xv02IcfV.cjs +1 -0
  50. package/dist/vendor-fast-deep-equal-xp5wgv1k.cjs +1 -0
  51. package/dist/vendor-hast-util-to-jsx-runtime-Cn0tASh-.cjs +1 -0
  52. package/dist/vendor-hast-util-whitespace-B7YrIln0.cjs +1 -0
  53. package/dist/vendor-html-url-attributes-B55Ir3vo.cjs +1 -0
  54. package/dist/vendor-inline-style-parser-BwLpyraz.cjs +2 -0
  55. package/dist/vendor-input-format-B4RKCxE4.cjs +3 -0
  56. package/dist/vendor-is-arrayish-DfXUb1DJ.cjs +1 -0
  57. package/dist/vendor-is-plain-obj-DH-Kh8FX.cjs +1 -0
  58. package/dist/vendor-js-file-download-Cbb6agEb.cjs +1 -0
  59. package/dist/vendor-libphonenumber-js-DkZ7WT-u.cjs +13 -0
  60. package/dist/vendor-lodash-CNz95YDD.cjs +1 -0
  61. package/dist/vendor-lodash.debounce-C9YP0rOk.cjs +1 -0
  62. package/dist/vendor-longest-streak-CpfJ7Pkv.cjs +1 -0
  63. package/dist/vendor-lottie-web-Cnpvoe-Q.cjs +2 -0
  64. package/dist/vendor-markdown-table-BIbVC1pY.cjs +2 -0
  65. package/dist/vendor-mdast-util-find-and-replace-BqOMYvvg.cjs +1 -0
  66. package/dist/vendor-mdast-util-from-markdown-DmcqmoHq.cjs +1 -0
  67. package/dist/vendor-mdast-util-gfm-DYVYZtQo.cjs +1 -0
  68. package/dist/vendor-mdast-util-gfm-autolink-literal-B7Jk_6Zc.cjs +1 -0
  69. package/dist/vendor-mdast-util-gfm-footnote-BqZr5GmF.cjs +2 -0
  70. package/dist/vendor-mdast-util-gfm-strikethrough-DkmBmVZz.cjs +1 -0
  71. package/dist/vendor-mdast-util-gfm-table-GRkZEL2K.cjs +3 -0
  72. package/dist/vendor-mdast-util-gfm-task-list-item-COkL7umh.cjs +1 -0
  73. package/dist/vendor-mdast-util-phrasing-B3pE6Gyd.cjs +1 -0
  74. package/dist/vendor-mdast-util-to-hast-DZGTy4jY.cjs +11 -0
  75. package/dist/vendor-mdast-util-to-markdown-CFDJSkr8.cjs +12 -0
  76. package/dist/vendor-mdast-util-to-string-epeputJu.cjs +1 -0
  77. package/dist/vendor-memoize-one-DetCWhre.cjs +1 -0
  78. package/dist/vendor-micromark-QT1lJ_9G.cjs +3 -0
  79. package/dist/vendor-micromark-core-commonmark-CHMYvCou.cjs +1 -0
  80. package/dist/vendor-micromark-extension-gfm-DOHEv_Ow.cjs +1 -0
  81. package/dist/vendor-micromark-extension-gfm-autolink-literal-BIi53Rt2.cjs +1 -0
  82. package/dist/vendor-micromark-extension-gfm-footnote-CuTbB2_e.cjs +1 -0
  83. package/dist/vendor-micromark-extension-gfm-strikethrough-CcuQ-v4I.cjs +1 -0
  84. package/dist/vendor-micromark-extension-gfm-table-CoYdjDBk.cjs +1 -0
  85. package/dist/vendor-micromark-extension-gfm-tagfilter-Dyvby5gX.cjs +1 -0
  86. package/dist/vendor-micromark-extension-gfm-task-list-item-eGtf7dwN.cjs +1 -0
  87. package/dist/vendor-micromark-factory-destination-DODxvNwQ.cjs +1 -0
  88. package/dist/vendor-micromark-factory-label-DRCYHbTp.cjs +1 -0
  89. package/dist/vendor-micromark-factory-space-BxE8R4nI.cjs +1 -0
  90. package/dist/vendor-micromark-factory-title-HTScd-95.cjs +1 -0
  91. package/dist/vendor-micromark-factory-whitespace-Cfovfawt.cjs +1 -0
  92. package/dist/vendor-micromark-util-character-ThpXZ0p5.cjs +1 -0
  93. package/dist/vendor-micromark-util-chunked-CCaF1jRh.cjs +1 -0
  94. package/dist/vendor-micromark-util-classify-character-BXzv_u9-.cjs +1 -0
  95. package/dist/vendor-micromark-util-combine-extensions-ymdtWEAr.cjs +1 -0
  96. package/dist/vendor-micromark-util-decode-numeric-character-reference-sKQehvtv.cjs +1 -0
  97. package/dist/vendor-micromark-util-decode-string-Coo2FPbM.cjs +1 -0
  98. package/dist/vendor-micromark-util-encode-Dyvby5gX.cjs +1 -0
  99. package/dist/vendor-micromark-util-html-tag-name-BqwwRvi2.cjs +1 -0
  100. package/dist/vendor-micromark-util-normalize-identifier-CZzRW9lF.cjs +1 -0
  101. package/dist/vendor-micromark-util-resolve-all-B1vkj8Lj.cjs +1 -0
  102. package/dist/vendor-micromark-util-sanitize-uri-fWsohj9C.cjs +1 -0
  103. package/dist/vendor-micromark-util-subtokenize-B5hanNMp.cjs +1 -0
  104. package/dist/vendor-object-assign-5rXDT7QN.cjs +1 -0
  105. package/dist/vendor-prop-types-D7ILSZ36.cjs +2 -0
  106. package/dist/vendor-property-information-B58jd_xz.cjs +1 -0
  107. package/dist/vendor-react-CzqSQR9J.cjs +14 -0
  108. package/dist/vendor-react-circular-progressbar-BnDuoTgW.cjs +6 -0
  109. package/dist/vendor-react-datepicker-GIiaQhgI.cjs +2 -0
  110. package/dist/vendor-react-draggable-rHHMjzs1.cjs +3 -0
  111. package/dist/vendor-react-error-boundary-DUjnAjoQ.cjs +1 -0
  112. package/dist/vendor-react-fast-compare-DjJCSAPj.cjs +1 -0
  113. package/dist/vendor-react-google-autocomplete-Du5iErAd.cjs +2 -0
  114. package/dist/vendor-react-hook-form-DowHtP8_.cjs +1 -0
  115. package/dist/vendor-react-is-DK4cIQ7j.cjs +1 -0
  116. package/dist/vendor-react-lottie-player-Afua51zh.cjs +1 -0
  117. package/dist/vendor-react-markdown-sVAdj9xV.cjs +1 -0
  118. package/dist/vendor-react-merge-refs-Daoz85kW.cjs +1 -0
  119. package/dist/vendor-react-number-format-QGmN0d2v.cjs +7 -0
  120. package/dist/vendor-react-onclickoutside-CjoT6SX4.cjs +1 -0
  121. package/dist/vendor-react-phone-number-input-BBnFN-wD.cjs +4 -0
  122. package/dist/vendor-react-popper-DEi6sOBD.cjs +1 -0
  123. package/dist/vendor-react-select-DufBhudz.cjs +4 -0
  124. package/dist/vendor-react-virtualized-auto-sizer-DS8s5Nqf.cjs +1 -0
  125. package/dist/vendor-react-vtree-CtDSz2Mv.cjs +1 -0
  126. package/dist/vendor-react-webcam-CPpkXthK.cjs +1 -0
  127. package/dist/vendor-react-window-CuU_qzaW.cjs +1 -0
  128. package/dist/vendor-react-window-infinite-loader-CdyCIjx6.cjs +1 -0
  129. package/dist/vendor-remark-gfm-Bou12kJi.cjs +1 -0
  130. package/dist/vendor-remark-parse-BYKtvo5n.cjs +1 -0
  131. package/dist/vendor-remark-rehype-CuqXXG-2.cjs +1 -0
  132. package/dist/vendor-rfdc-sZ2eP5eF.cjs +1 -0
  133. package/dist/vendor-simple-swizzle-BNELyqz6.cjs +1 -0
  134. package/dist/vendor-space-separated-tokens-0etuzMC1.cjs +1 -0
  135. package/dist/vendor-style-to-js-CUjGi3ge.cjs +1 -0
  136. package/dist/vendor-style-to-object--fzklQoy.cjs +1 -0
  137. package/dist/vendor-trim-lines-BO73c4j-.cjs +1 -0
  138. package/dist/vendor-trough-CZIkZM5d.cjs +1 -0
  139. package/dist/vendor-unified-hdBFtaBE.cjs +1 -0
  140. package/dist/vendor-unist-util-is-C5fG5pIe.cjs +1 -0
  141. package/dist/vendor-unist-util-position-DsgljCtl.cjs +1 -0
  142. package/dist/vendor-unist-util-stringify-position-DfmUoPWR.cjs +1 -0
  143. package/dist/vendor-unist-util-visit-Cyg51Aas.cjs +1 -0
  144. package/dist/vendor-unist-util-visit-parents-BFfGpcYZ.cjs +1 -0
  145. package/dist/vendor-us-bank-account-validator-DOz5Vc9n.cjs +1 -0
  146. package/dist/vendor-use-isomorphic-layout-effect-CkGv31zs.cjs +1 -0
  147. package/dist/vendor-use-resize-observer-FgrE0mfc.cjs +1 -0
  148. package/dist/vendor-utils-CN5UYrS0.cjs +1 -0
  149. package/dist/vendor-vfile-DagMcMZP.cjs +1 -0
  150. package/dist/vendor-vfile-message-DB4fwBOw.cjs +1 -0
  151. package/dist/vendor-warning-FOT2NNRo.cjs +1 -0
  152. package/dist/vendor-zwitch-Dyvby5gX.cjs +1 -0
  153. package/dist/zeni-card-trust-BVZY9sCS.cjs +1 -0
  154. package/dist/zeni-thanksgiving-logo-full-DUjzTkSv.cjs +1 -0
  155. package/package.json +6 -4
@@ -0,0 +1 @@
1
+ "use strict";const Et=require("./vendor-react-CzqSQR9J.cjs");var ie={},Xe={},Ye={},pt;function P(){return pt||(pt=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Log=t.LogLevel=void 0;const v=" DEBUG ",_=" INFO ",E=" WARN ",m=" ERROR ";function g(p){return p.unshift("[Statsig]"),p}t.LogLevel={None:0,Error:1,Warn:2,Info:3,Debug:4};class h{static info(...S){h.level>=t.LogLevel.Info&&console.info(_,...g(S))}static debug(...S){h.level>=t.LogLevel.Debug&&console.debug(v,...g(S))}static warn(...S){h.level>=t.LogLevel.Warn&&console.warn(E,...g(S))}static error(...S){h.level>=t.LogLevel.Error&&console.error(m,...g(S))}}t.Log=h,h.level=t.LogLevel.Warn})(Ye)),Ye}var bt;function ve(){return bt||(bt=1,(function(t){var v,_,E;Object.defineProperty(t,"__esModule",{value:!0}),t._getInstance=t._getStatsigGlobalFlag=t._getStatsigGlobal=void 0;const m=P(),g=()=>{try{return typeof __STATSIG__<"u"?__STATSIG__:o}catch{return o}};t._getStatsigGlobal=g;const h=s=>(0,t._getStatsigGlobal)()[s];t._getStatsigGlobalFlag=h;const p=s=>{const r=(0,t._getStatsigGlobal)();return s?r.instances&&r.instances[s]:(r.instances&&Object.keys(r.instances).length>1&&m.Log.warn("Call made to Statsig global instance without an SDK key but there is more than one client instance. If you are using mulitple clients, please specify the SDK key."),r.firstInstance)};t._getInstance=p;const S="__STATSIG__",a=typeof window<"u"?window:{},l=typeof Et.commonjsGlobal<"u"?Et.commonjsGlobal:{},n=typeof globalThis<"u"?globalThis:{},o=(E=(_=(v=a[S])!==null&&v!==void 0?v:l[S])!==null&&_!==void 0?_:n[S])!==null&&E!==void 0?E:{instance:t._getInstance};a[S]=o,l[S]=o,n[S]=o})(Xe)),Xe}var Ze={},wt;function vt(){return wt||(wt=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Diagnostics=void 0;const v=new Map,_="start",E="end",m="statsig::diagnostics";t.Diagnostics={_getMarkers:a=>v.get(a),_markInitOverallStart:a=>{p(a,g({},_,"overall"))},_markInitOverallEnd:(a,l,n)=>{p(a,g({success:l,error:l?void 0:{name:"InitializeError",message:"Failed to initialize"},evaluationDetails:n},E,"overall"))},_markInitNetworkReqStart:(a,l)=>{p(a,g(l,_,"initialize","network_request"))},_markInitNetworkReqEnd:(a,l)=>{p(a,g(l,E,"initialize","network_request"))},_markInitProcessStart:a=>{p(a,g({},_,"initialize","process"))},_markInitProcessEnd:(a,l)=>{p(a,g(l,E,"initialize","process"))},_clearMarkers:a=>{v.delete(a)},_formatError(a){if(a&&typeof a=="object")return{code:S(a,"code"),name:S(a,"name"),message:S(a,"message")}},_getDiagnosticsData(a,l,n,o){var s;return{success:a?.ok===!0,statusCode:a?.status,sdkRegion:(s=a?.headers)===null||s===void 0?void 0:s.get("x-statsig-region"),isDelta:n.includes('"is_delta":true')===!0?!0:void 0,attempt:l,error:t.Diagnostics._formatError(o)}},_enqueueDiagnosticsEvent(a,l,n,o){const s=t.Diagnostics._getMarkers(n);if(s==null||s.length<=0)return-1;const r=s[s.length-1].timestamp-s[0].timestamp;t.Diagnostics._clearMarkers(n);const e=h(a,{context:"initialize",markers:s.slice(),statsigOptions:o});return l.enqueue(e),r}};function g(a,l,n,o){return Object.assign({key:n,action:l,step:o,timestamp:Date.now()},a)}function h(a,l){return{eventName:m,user:a,value:null,metadata:l,time:Date.now()}}function p(a,l){var n;const o=(n=v.get(a))!==null&&n!==void 0?n:[];o.push(l),v.set(a,o)}function S(a,l){if(l in a)return a[l]}})(Ze)),Ze}var se={},pe={},be={},Ct;function Rn(){if(Ct)return be;Ct=1,Object.defineProperty(be,"__esModule",{value:!0}),be.EventBatch=void 0;let t=class{constructor(_){this.attempts=0,this.createdAt=Date.now(),this.events=_}incrementAttempts(){this.attempts++}};return be.EventBatch=t,be}var we={},kt;function mt(){return kt||(kt=1,Object.defineProperty(we,"__esModule",{value:!0}),we.EventRetryConstants=void 0,we.EventRetryConstants={MAX_RETRY_ATTEMPTS:8,DEFAULT_BATCH_SIZE:100,MAX_PENDING_BATCHES:40,TICK_INTERVAL_MS:1e3,QUICK_FLUSH_WINDOW_MS:200,MAX_LOCAL_STORAGE:500,get MAX_QUEUED_EVENTS(){return this.DEFAULT_BATCH_SIZE*this.MAX_PENDING_BATCHES}}),we}var Dt;function Ln(){if(Dt)return pe;Dt=1,Object.defineProperty(pe,"__esModule",{value:!0}),pe.BatchQueue=void 0;const t=Rn(),v=mt();class _{constructor(m=v.EventRetryConstants.DEFAULT_BATCH_SIZE){this._batches=[],this._batchSize=m}batchSize(){return this._batchSize}requeueBatch(m){return this._enqueueBatch(m)}hasFullBatch(){return this._batches.some(m=>m.events.length>=this._batchSize)}takeNextBatch(){return this._batches.shift()}takeAllBatches(){const m=this._batches;return this._batches=[],m}createBatches(m){let g=0,h=0;for(;g<m.length;){const p=m.slice(g,g+this._batchSize);h+=this._enqueueBatch(new t.EventBatch(p)),g+=this._batchSize}return h}_enqueueBatch(m){this._batches.push(m);let g=0;for(;this._batches.length>v.EventRetryConstants.MAX_PENDING_BATCHES;){const h=this._batches.shift();h&&(g+=h.events.length)}return g}}return pe.BatchQueue=_,pe}var oe={},et={},ae={},Ot;function St(){if(Ot)return ae;Ot=1,Object.defineProperty(ae,"__esModule",{value:!0}),ae._isTypeMatch=ae._typeOf=void 0;function t(_){return Array.isArray(_)?"array":typeof _}ae._typeOf=t;function v(_,E){const m=g=>Array.isArray(g)?"array":g===null?"null":typeof g;return m(_)===m(E)}return ae._isTypeMatch=v,ae}var It;function me(){return It||(It=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t._getSortedObject=t._DJB2Object=t._DJB2=void 0;const v=St(),_=g=>{let h=0;for(let p=0;p<g.length;p++){const S=g.charCodeAt(p);h=(h<<5)-h+S,h=h&h}return String(h>>>0)};t._DJB2=_;const E=(g,h)=>(0,t._DJB2)(JSON.stringify((0,t._getSortedObject)(g,h)));t._DJB2Object=E;const m=(g,h)=>{if(g==null)return null;const p=Object.keys(g).sort(),S={};return p.forEach(a=>{const l=g[a];if(h===0||(0,v._typeOf)(l)!=="object"){S[a]=l;return}S[a]=(0,t._getSortedObject)(l,h!=null?h-1:h)}),S};t._getSortedObject=m})(et)),et}var Tt;function Ve(){if(Tt)return oe;Tt=1,Object.defineProperty(oe,"__esModule",{value:!0}),oe._getStorageKey=oe._getUserStorageKey=void 0;const t=me();function v(E,m,g){var h;if(g)return g(E,m);const p=m&&m.customIDs?m.customIDs:{},S=[`uid:${(h=m?.userID)!==null&&h!==void 0?h:""}`,`cids:${Object.keys(p).sort((a,l)=>a.localeCompare(l)).map(a=>`${a}-${p[a]}`).join(",")}`,`k:${E}`];return(0,t._DJB2)(S.join("|"))}oe._getUserStorageKey=v;function _(E,m,g){return m?v(E,m,g):(0,t._DJB2)(`k:${E}`)}return oe._getStorageKey=_,oe}var le={},ue={},tt={},Mt;function je(){return Mt||(Mt=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.NetworkParam=t.NetworkDefault=t.Endpoint=void 0,t.Endpoint={_initialize:"initialize",_rgstr:"rgstr",_download_config_specs:"download_config_specs"},t.NetworkDefault={[t.Endpoint._rgstr]:"https://prodregistryv2.org/v1",[t.Endpoint._initialize]:"https://featureassets.org/v1",[t.Endpoint._download_config_specs]:"https://api.statsigcdn.com/v1"},t.NetworkParam={EventCount:"ec",SdkKey:"k",SdkType:"st",SdkVersion:"sv",Time:"t",SessionID:"sid",StatsigEncoded:"se",IsGzipped:"gz"}})(tt)),tt}var Ce={},Ft;function Qe(){if(Ft)return Ce;Ft=1,Object.defineProperty(Ce,"__esModule",{value:!0}),Ce.SDKType=void 0;const t={};let v;return Ce.SDKType={_get:_=>{var E;return((E=t[_])!==null&&E!==void 0?E:"js-mono")+(v??"")},_setClientType(_,E){t[_]=E},_setBindingType(_){(!v||v==="-react")&&(v="-"+_)}},Ce}var nt={},Rt;function Ne(){return Rt||(Rt=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.StatsigMetadataProvider=t.SDK_VERSION=void 0,t.SDK_VERSION="3.33.0";let v={sdkVersion:t.SDK_VERSION,sdkType:"js-mono"};t.StatsigMetadataProvider={get:()=>v,add:_=>{v=Object.assign(Object.assign({},v),_)}}})(nt)),nt}var rt={},it={},Lt;function V(){return Lt||(Lt=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t._cloneObject=t._getUnloadEvent=t._getCurrentPageUrlSafe=t._addDocumentEventListenerSafe=t._addWindowEventListenerSafe=t._isServerEnv=t._getDocumentSafe=t._getWindowSafe=void 0;const v=P(),_=()=>typeof window<"u"?window:null;t._getWindowSafe=_;const E=()=>{var l;const n=(0,t._getWindowSafe)();return(l=n?.document)!==null&&l!==void 0?l:null};t._getDocumentSafe=E;const m=()=>{if((0,t._getDocumentSafe)()!==null)return!1;const l=typeof process<"u"&&process.versions!=null&&process.versions.node!=null;return typeof EdgeRuntime=="string"||l};t._isServerEnv=m;const g=(l,n)=>{const o=(0,t._getWindowSafe)();typeof o?.addEventListener=="function"&&o.addEventListener(l,n)};t._addWindowEventListenerSafe=g;const h=(l,n)=>{const o=(0,t._getDocumentSafe)();typeof o?.addEventListener=="function"&&o.addEventListener(l,n)};t._addDocumentEventListenerSafe=h;const p=()=>{var l;try{return(l=(0,t._getWindowSafe)())===null||l===void 0?void 0:l.location.href.split(/[?#]/)[0]}catch{return}};t._getCurrentPageUrlSafe=p;const S=()=>{const l=(0,t._getWindowSafe)();return l&&"onpagehide"in l?"pagehide":"beforeunload"};t._getUnloadEvent=S;const a=(l,n)=>{try{return JSON.parse(JSON.stringify(n))}catch{return v.Log.error(`Failed to clone object ${l}`),null}};t._cloneObject=a})(it)),it}var At;function Be(){return At||(At=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t._notifyVisibilityChanged=t._subscribeToVisiblityChanged=t._isUnloading=t._isCurrentlyVisible=void 0;const v=V(),_="foreground",E="background",m=[];let g=_,h=!1;const p=()=>g===_;t._isCurrentlyVisible=p;const S=()=>h;t._isUnloading=S;const a=n=>{m.unshift(n)};t._subscribeToVisiblityChanged=a;const l=n=>{n!==g&&(g=n,m.forEach(o=>o(n)))};t._notifyVisibilityChanged=l,(0,v._addWindowEventListenerSafe)("focus",()=>{h=!1,(0,t._notifyVisibilityChanged)(_)}),(0,v._addWindowEventListenerSafe)("blur",()=>(0,t._notifyVisibilityChanged)(E)),(0,v._addDocumentEventListenerSafe)("visibilitychange",()=>{(0,t._notifyVisibilityChanged)(document.visibilityState==="visible"?_:E)}),(0,v._addWindowEventListenerSafe)((0,v._getUnloadEvent)(),()=>{h=!0,(0,t._notifyVisibilityChanged)(E)})})(rt)),rt}var Pt;function An(){if(Pt)return ue;Pt=1;var t=ue&&ue.__awaiter||function(p,S,a,l){function n(o){return o instanceof a?o:new a(function(s){s(o)})}return new(a||(a=Promise))(function(o,s){function r(u){try{i(l.next(u))}catch(d){s(d)}}function e(u){try{i(l.throw(u))}catch(d){s(d)}}function i(u){u.done?o(u.value):n(u.value).then(r,e)}i((l=l.apply(p,S||[])).next())})};Object.defineProperty(ue,"__esModule",{value:!0}),ue.EventSender=void 0;const v=P(),_=je(),E=Qe(),m=Ne(),g=Be();let h=class{constructor(S,a,l,n,o){this._sdkKey=S,this._network=a,this._emitter=l,this._options=o,this._logEventUrlConfig=n}setLogEventCompressionMode(S){this._network.setLogEventCompressionMode(S)}sendBatch(S){return t(this,void 0,void 0,function*(){var a,l,n;let o="event_sender_unexpected_exception";const s={};try{const e=(0,g._isUnloading)()&&this._network.isBeaconSupported()&&((l=(a=this._options)===null||a===void 0?void 0:a.networkConfig)===null||l===void 0?void 0:l.networkOverrideFunc)==null;o="event_sender_pre_logs_flushed_emitter_exception",this._emitter({name:"pre_logs_flushed",events:S.events}),o=e?"event_sender_unexpected_exception":"event_sender_post_exception";const i=e?this._sendEventsViaBeacon(S,s):yield this._sendEventsViaPost(S,s);return i.success?(o="event_sender_logs_flushed_emitter_exception",this._emitter({name:"logs_flushed",events:S.events}),i):Object.assign(Object.assign(Object.assign({success:!1,statusCode:i.statusCode,failurePath:i.failurePath},i.failureErrorMessage?{failureErrorMessage:i.failureErrorMessage}:{}),i.failureDiagnosticBucket?{failureDiagnosticBucket:i.failureDiagnosticBucket}:{}),i.failureDiagnosticMetadata?{failureDiagnosticMetadata:i.failureDiagnosticMetadata}:{})}catch(r){return v.Log.warn("Failed to send batch:",r),Object.assign(Object.assign(Object.assign({success:!1,statusCode:-1,failurePath:(n=s.path)!==null&&n!==void 0?n:o},s.errorMessage?{failureErrorMessage:s.errorMessage}:{}),s.diagnosticBucket?{failureDiagnosticBucket:s.diagnosticBucket}:{}),s.diagnosticMetadata?{failureDiagnosticMetadata:s.diagnosticMetadata}:{})}})}_sendEventsViaPost(S,a){return t(this,void 0,void 0,function*(){var l,n;const o=yield this._network.post(this._getRequestData(S),a),s=(l=o?.code)!==null&&l!==void 0?l:-1;return s===-1?Object.assign(Object.assign(Object.assign({success:!1,statusCode:-1,failurePath:(n=a.path)!==null&&n!==void 0?n:o===void 0?"event_sender_post_returned_undefined":"event_sender_post_returned_null"},a.errorMessage?{failureErrorMessage:a.errorMessage}:{}),a.diagnosticBucket?{failureDiagnosticBucket:a.diagnosticBucket}:{}),a.diagnosticMetadata?{failureDiagnosticMetadata:a.diagnosticMetadata}:{}):{success:s>=200&&s<300,statusCode:s}})}_sendEventsViaBeacon(S,a){var l;const n=this._network.beacon(this._getRequestData(S),a);return Object.assign(Object.assign(Object.assign({success:n,statusCode:n?200:-1,failurePath:n?void 0:(l=a.path)!==null&&l!==void 0?l:"beacon_send_false"},!n&&a.errorMessage?{failureErrorMessage:a.errorMessage}:{}),!n&&a.diagnosticBucket?{failureDiagnosticBucket:a.diagnosticBucket}:{}),!n&&a.diagnosticMetadata?{failureDiagnosticMetadata:a.diagnosticMetadata}:{})}_getRequestData(S){return{sdkKey:this._sdkKey,data:{events:S.events},urlConfig:this._logEventUrlConfig,retries:3,preserveFailedStatusCode:!0,isCompressable:!0,params:{[_.NetworkParam.EventCount]:String(S.events.length)},headers:{"statsig-event-count":String(S.events.length),"statsig-retry-count":String(S.attempts),"statsig-sdk-type":E.SDKType._get(this._sdkKey),"statsig-sdk-version":m.SDK_VERSION},credentials:"same-origin"}}};return ue.EventSender=h,ue}var ke={},Ut;function Pn(){if(Ut)return ke;Ut=1,Object.defineProperty(ke,"__esModule",{value:!0}),ke.FlushInterval=void 0;const t=1e3,v=6e4;let _=class{constructor(){this._currentIntervalMs=t,this._lastFlushAttemptTime=Date.now()}getCurrentIntervalMs(){return this._currentIntervalMs}markFlushAttempt(){this._lastFlushAttemptTime=Date.now()}getTimeSinceLastAttempt(){return Date.now()-this._lastFlushAttemptTime}hasReachedMaxInterval(){return this.getTimeSinceLastAttempt()>=v}getTimeTillMaxInterval(){return v-this.getTimeSinceLastAttempt()}hasCompletelyRecoveredFromBackoff(){return this._currentIntervalMs<=t}adjustForSuccess(){const m=this._currentIntervalMs;m!==t&&(this._currentIntervalMs=Math.max(t,Math.floor(m/2)))}adjustForFailure(){const m=this._currentIntervalMs;this._currentIntervalMs=Math.min(v,m*2)}getTimeUntilNextFlush(){return this.getCurrentIntervalMs()-this.getTimeSinceLastAttempt()}};return ke.FlushInterval=_,ke}var De={},Nt;function Un(){if(Nt)return De;Nt=1,Object.defineProperty(De,"__esModule",{value:!0}),De.FlushType=void 0;var t;return(function(v){v.ScheduledMaxTime="scheduled:max_time",v.ScheduledFullBatch="scheduled:full_batch",v.Limit="limit",v.Manual="manual",v.Shutdown="shutdown"})(t||(De.FlushType=t={})),De}var Oe={},W={},ce={},jt;function Nn(){if(jt)return ce;jt=1;var t=ce&&ce.__awaiter||function(p,S,a,l){function n(o){return o instanceof a?o:new a(function(s){s(o)})}return new(a||(a=Promise))(function(o,s){function r(u){try{i(l.next(u))}catch(d){s(d)}}function e(u){try{i(l.throw(u))}catch(d){s(d)}}function i(u){u.done?o(u.value):n(u.value).then(r,e)}i((l=l.apply(p,S||[])).next())})};Object.defineProperty(ce,"__esModule",{value:!0}),ce._fetchTxtRecords=void 0;const v=new Uint8Array([0,0,1,0,0,1,0,0,0,0,0,0,13,102,101,97,116,117,114,101,97,115,115,101,116,115,3,111,114,103,0,0,16,0,1]),_="https://cloudflare-dns.com/dns-query",E=["i","e","d"],m=200;function g(p){return t(this,void 0,void 0,function*(){const S=yield p(_,{method:"POST",headers:{"Content-Type":"application/dns-message",Accept:"application/dns-message"},body:v});if(!S.ok){const n=new Error("Failed to fetch TXT records from DNS");throw n.name="DnsTxtFetchError",n}const a=yield S.arrayBuffer(),l=new Uint8Array(a);return h(l)})}ce._fetchTxtRecords=g;function h(p){const S=p.findIndex((l,n)=>n<m&&String.fromCharCode(l)==="="&&E.includes(String.fromCharCode(p[n-1])));if(S===-1){const l=new Error("Failed to parse TXT records from DNS");throw l.name="DnsTxtParseError",l}let a="";for(let l=S-1;l<p.length;l++)a+=String.fromCharCode(p[l]);return a.split(",")}return ce}var st={},Bt;function Y(){return Bt||(Bt=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t._setObjectInStorage=t._getObjectFromStorage=t.Storage=void 0;const v=P(),_=V(),E={},m={isReady:()=>!0,isReadyResolver:()=>null,getProviderName:()=>"InMemory",getItem:n=>E[n]?E[n]:null,setItem:(n,o)=>{E[n]=o},removeItem:n=>{delete E[n]},getAllKeys:()=>Object.keys(E)};let g=null;try{const n=(0,_._getWindowSafe)();n&&n.localStorage&&typeof n.localStorage.getItem=="function"&&(g={isReady:()=>!0,isReadyResolver:()=>null,getProviderName:()=>"LocalStorage",getItem:o=>n.localStorage.getItem(o),setItem:(o,s)=>n.localStorage.setItem(o,s),removeItem:o=>n.localStorage.removeItem(o),getAllKeys:()=>Object.keys(n.localStorage)})}catch{v.Log.warn("Failed to setup localStorageProvider.")}let h=g??m,p=h;function S(n){try{return n()}catch(o){if(o instanceof Error&&o.name==="SecurityError")return t.Storage._setProvider(m),null;throw o}}t.Storage={isReady:()=>p.isReady(),isReadyResolver:()=>p.isReadyResolver(),getProviderName:()=>p.getProviderName(),getItem:n=>S(()=>p.getItem(n)),setItem:(n,o)=>S(()=>p.setItem(n,o)),removeItem:n=>p.removeItem(n),getAllKeys:()=>p.getAllKeys(),_setProvider:n=>{h=n,p=n},_setDisabled:n=>{n?p=m:p=h}};function a(n){const o=t.Storage.getItem(n);try{return JSON.parse(o??"null")}catch{return v.Log.error(`Failed to parse value for key "${n}"`),null}}t._getObjectFromStorage=a;function l(n,o){t.Storage.setItem(n,JSON.stringify(o))}t._setObjectInStorage=l})(st)),st}var qt;function jn(){if(qt)return W;qt=1;var t=W&&W.__awaiter||function(s,r,e,i){function u(d){return d instanceof e?d:new e(function(C){C(d)})}return new(e||(e=Promise))(function(d,C){function c(w){try{y(i.next(w))}catch(D){C(D)}}function f(w){try{y(i.throw(w))}catch(D){C(D)}}function y(w){w.done?d(w.value):u(w.value).then(c,f)}y((i=i.apply(s,r||[])).next())})};Object.defineProperty(W,"__esModule",{value:!0}),W._isDomainFailure=W.NetworkFallbackResolver=void 0;const v=Nn(),_=me(),E=P(),m=Y(),g=10080*60*1e3,h=14400*1e3;let p=class{constructor(r){var e;this._fallbackInfo=null,this._errorBoundary=null,this._dnsQueryCooldowns={},this._networkOverrideFunc=(e=r.networkConfig)===null||e===void 0?void 0:e.networkOverrideFunc}setErrorBoundary(r){this._errorBoundary=r}tryBumpExpiryTime(r,e){var i;const u=(i=this._fallbackInfo)===null||i===void 0?void 0:i[e.endpoint];u&&(u.expiryTime=Date.now()+g,l(r,Object.assign(Object.assign({},this._fallbackInfo),{[e.endpoint]:u})))}getActiveFallbackUrl(r,e){var i,u;if(e.customUrl!=null&&e.fallbackUrls!=null)return null;let d=this._fallbackInfo;d==null&&(d=(i=n(r))!==null&&i!==void 0?i:{},this._fallbackInfo=d);const C=d[e.endpoint];return!C||Date.now()>((u=C.expiryTime)!==null&&u!==void 0?u:0)||e.getChecksum()!==C.urlConfigChecksum?(delete d[e.endpoint],this._fallbackInfo=d,l(r,this._fallbackInfo),null):C.url?C.url:null}tryFetchUpdatedFallbackInfo(r,e,i,u){return t(this,void 0,void 0,function*(){var d,C;try{if(!S(i,u))return!1;const f=e.customUrl==null&&e.fallbackUrls==null?yield this._tryFetchFallbackUrlsFromNetwork(e):e.fallbackUrls,y=this._pickNewFallbackUrl((d=this._fallbackInfo)===null||d===void 0?void 0:d[e.endpoint],f);return y?(this._updateFallbackInfoWithNewUrl(r,e,y),!0):!1}catch(c){return(C=this._errorBoundary)===null||C===void 0||C.logError("tryFetchUpdatedFallbackInfo",c),!1}})}_updateFallbackInfoWithNewUrl(r,e,i){var u,d,C;const c={urlConfigChecksum:e.getChecksum(),url:i,expiryTime:Date.now()+g,previous:[]},f=e.endpoint,y=(u=this._fallbackInfo)===null||u===void 0?void 0:u[f];y&&c.previous.push(...y.previous),c.previous.length>10&&(c.previous=[]);const w=(C=(d=this._fallbackInfo)===null||d===void 0?void 0:d[f])===null||C===void 0?void 0:C.url;w!=null&&c.previous.push(w),this._fallbackInfo=Object.assign(Object.assign({},this._fallbackInfo),{[f]:c}),l(r,this._fallbackInfo)}_tryFetchFallbackUrlsFromNetwork(r){return t(this,void 0,void 0,function*(){var e;const i=this._dnsQueryCooldowns[r.endpoint];if(i&&Date.now()<i)return null;this._dnsQueryCooldowns[r.endpoint]=Date.now()+h;const u=[],d=yield(0,v._fetchTxtRecords)((e=this._networkOverrideFunc)!==null&&e!==void 0?e:fetch),C=o(r.defaultUrl);for(const c of d){if(!c.startsWith(r.endpointDnsKey+"="))continue;const f=c.split("=");if(f.length>1){let y=f[1];y.endsWith("/")&&(y=y.slice(0,-1)),u.push(`https://${y}${C}`)}}return u})}_pickNewFallbackUrl(r,e){var i;if(e==null)return null;const u=new Set((i=r?.previous)!==null&&i!==void 0?i:[]),d=r?.url;let C=null;for(const c of e){const f=c.endsWith("/")?c.slice(0,-1):c;if(!u.has(c)&&f!==d){C=f;break}}return C}};W.NetworkFallbackResolver=p;function S(s,r){var e;const i=(e=s?.toLowerCase())!==null&&e!==void 0?e:"";return r||i.includes("uncaught exception")||i.includes("failed to fetch")||i.includes("networkerror when attempting to fetch resource")}W._isDomainFailure=S;function a(s){return`statsig.network_fallback.${(0,_._DJB2)(s)}`}function l(s,r){const e=a(s);if(!r||Object.keys(r).length===0){m.Storage.removeItem(e);return}m.Storage.setItem(e,JSON.stringify(r))}function n(s){const r=a(s),e=m.Storage.getItem(r);if(!e)return null;try{return JSON.parse(e)}catch{return E.Log.error("Failed to parse FallbackInfo"),null}}function o(s){try{return new URL(s).pathname}catch{return null}}return W}var Ie={},Kt;function En(){if(Kt)return Ie;Kt=1,Object.defineProperty(Ie,"__esModule",{value:!0}),Ie.SDKFlags=void 0;const t={};return Ie.SDKFlags={setFlags:(v,_)=>{t[v]=_},get:(v,_)=>{var E,m;return(m=(E=t[v])===null||E===void 0?void 0:E[_])!==null&&m!==void 0?m:!1}},Ie}var ot={},Te={},$t;function yt(){if($t)return Te;$t=1,Object.defineProperty(Te,"__esModule",{value:!0}),Te.getUUID=void 0;function t(){if(typeof crypto<"u"&&typeof crypto.randomUUID=="function")return crypto.randomUUID();let v=new Date().getTime(),_=typeof performance<"u"&&performance.now&&performance.now()*1e3||0;return`xxxxxxxx-xxxx-4xxx-${"89ab"[Math.floor(Math.random()*4)]}xxx-xxxxxxxxxxxx`.replace(/[xy]/g,m=>{let g=Math.random()*16;return v>0?(g=(v+g)%16|0,v=Math.floor(v/16)):(g=(_+g)%16|0,_=Math.floor(_/16)),(m==="x"?g:g&7|8).toString(16)})}return Te.getUUID=t,Te}var xt;function qe(){return xt||(xt=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.StatsigSession=t.SessionID=void 0;const v=Ve(),_=P(),E=Y(),m=yt(),g=Be(),h=1800*1e3,p=14400*1e3,S=15e3,a={};(0,g._subscribeToVisiblityChanged)(c=>{c==="background"&&Object.values(a).forEach(f=>e(f))}),t.SessionID={get:c=>t.StatsigSession.get(c).data.sessionID},t.StatsigSession={get:(c,f=!0)=>{a[c]==null&&(a[c]=d(c));const y=a[c];return l(y,f)},overrideInitialSessionID:(c,f)=>{const y=Date.now(),w={data:{sessionID:c,startTime:y,lastUpdate:y},sdkKey:f,lastPersistedAt:Date.now(),storageKey:r(f)};e(w),a[f]=w},checkForIdleSession:c=>{const f=a[c];if(!f)return;n(f)&&e(f)}};function l(c,f){const y=Date.now();return n(c)?e(c):f&&(c.data.lastUpdate=y,i(c)),c}function n(c){var f;const y=c.data,w=o(y)||s(y);return w&&(c.data=C(),(f=__STATSIG__==null?void 0:__STATSIG__.instance(c.sdkKey))===null||f===void 0||f.$emt({name:"session_expired"})),w}function o({lastUpdate:c}){return Date.now()-c>h}function s({startTime:c}){return Date.now()-c>p}function r(c){return`statsig.session_id.${(0,v._getStorageKey)(c)}`}function e(c){try{(0,E._setObjectInStorage)(c.storageKey,c.data),c.lastPersistedAt=Date.now()}catch{_.Log.warn("Failed to save SessionID")}}function i(c){Date.now()-c.lastPersistedAt>S&&e(c)}function u(c){return(0,E._getObjectFromStorage)(c)}function d(c){const f=r(c),y=u(f);return y&&y.sessionID&&y.startTime&&y.lastUpdate?{data:y,sdkKey:c,lastPersistedAt:0,storageKey:f}:{data:C(),sdkKey:c,lastPersistedAt:0,storageKey:f}}function C(){return{sessionID:(0,m.getUUID)(),startTime:Date.now(),lastUpdate:Date.now()}}})(ot)),ot}var de={},Gt;function Ke(){if(Gt)return de;Gt=1,Object.defineProperty(de,"__esModule",{value:!0}),de.getCookieName=de.StableID=void 0;const t=Ve(),v=P(),_=V(),E=Y(),m=yt(),g={},h={},p={};de.StableID={cookiesEnabled:!1,randomID:Math.random().toString(36),get:r=>{if(p[r])return null;if(g[r]!=null)return g[r];let e=null;return e=n(r),e!=null?(g[r]=e,a(e,r),e):(e=l(r),e==null&&(e=(0,m.getUUID)()),a(e,r),o(e,r),g[r]=e,e)},setOverride:(r,e)=>{g[e]=r,a(r,e),o(r,e)},_setCookiesEnabled:(r,e)=>{h[r]=e},_setDisabled:(r,e)=>{p[r]=e}};function S(r){return`statsig.stable_id.${(0,t._getStorageKey)(r)}`}function a(r,e){const i=S(e);try{(0,E._setObjectInStorage)(i,r)}catch{v.Log.warn("Failed to save StableID to storage")}}function l(r){const e=S(r);return(0,E._getObjectFromStorage)(e)}function n(r){if(!h[r]||(0,_._getDocumentSafe)()==null)return null;const e=document.cookie.split(";");for(const i of e){const[u,d]=i.trim().split("=");if(u===s(r))return decodeURIComponent(d)}return null}function o(r,e){if(!h[e]||(0,_._getDocumentSafe)()==null)return;const i=new Date;i.setFullYear(i.getFullYear()+1),document.cookie=`${s(e)}=${encodeURIComponent(r)}; expires=${i.toUTCString()}; path=/`}function s(r){return`statsig.stable_id.${(0,t._getStorageKey)(r)}`}return de.getCookieName=s,de}var Me={},zt;function pn(){return zt||(zt=1,Object.defineProperty(Me,"__esModule",{value:!0}),Me.ErrorTag=void 0,Me.ErrorTag={NetworkError:"NetworkError"}),Me}var _e={},Vt;function $e(){return Vt||(Vt=1,Object.defineProperty(_e,"__esModule",{value:!0}),_e.LoggingEnabledOption=_e.LogEventCompressionMode=void 0,_e.LogEventCompressionMode={Disabled:"d",Enabled:"e",Forced:"f"},_e.LoggingEnabledOption={disabled:"disabled",browserOnly:"browser-only",always:"always"}),_e}var Qt;function bn(){return Qt||(Qt=1,(function(t){var v=Oe&&Oe.__awaiter||function(O,b,k,I){function T(F){return F instanceof k?F:new k(function(R){R(F)})}return new(k||(k=Promise))(function(F,R){function K(U){try{B(I.next(U))}catch(q){R(q)}}function z(U){try{B(I.throw(U))}catch(q){R(q)}}function B(U){U.done?F(U.value):T(U.value).then(K,z)}B((I=I.apply(O,b||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.NetworkCore=t.RETRYABLE_CODES=void 0,ve();const _=ve(),E=vt(),m=P(),g=je(),h=jn(),p=En(),S=Qe(),a=V(),l=qe(),n=Ke(),o=pn(),s=Ne(),r=$e(),e=Be(),i=1e4,u=500,d=3e4,C=1e3,c=50,f=c/C;t.RETRYABLE_CODES=new Set([408,500,502,503,504,522,524,599]);let y=class{constructor(b,k){this._emitter=k,this._errorBoundary=null,this._timeout=i,this._netConfig={},this._options={},this._leakyBucket={},this._lastUsedInitUrl=null,b&&(this._options=b),this._options.networkConfig&&(this._netConfig=this._options.networkConfig),this._netConfig.networkTimeoutMs&&(this._timeout=this._netConfig.networkTimeoutMs),this._fallbackResolver=new h.NetworkFallbackResolver(this._options),this.setLogEventCompressionMode(this._getLogEventCompressionMode(b))}setLogEventCompressionMode(b){this._options.logEventCompressionMode=b}setErrorBoundary(b){this._errorBoundary=b,this._errorBoundary.wrap(this),this._errorBoundary.wrap(this._fallbackResolver),this._fallbackResolver.setErrorBoundary(b)}isBeaconSupported(){return typeof navigator<"u"&&typeof navigator.sendBeacon=="function"}getLastUsedInitUrlAndReset(){const b=this._lastUsedInitUrl;return this._lastUsedInitUrl=null,b}beacon(b,k){if(!w(b))return k&&(k.path="beacon_invalid_sdk_key"),!1;const I=this._getInternalRequestArgs("POST",b),T=this._getPopulatedURL(I),F=navigator;try{const R=F.sendBeacon.bind(F)(T,I.body);return R||k&&(k.path="beacon_send_false"),R}catch(R){throw k&&(k.path="beacon_send_exception"),R}}post(b,k){return v(this,void 0,void 0,function*(){const I=this._getInternalRequestArgs("POST",b);return this._tryEncodeBody(I),yield this._tryToCompressBody(I),this._sendRequest(I,k)})}get(b){const k=this._getInternalRequestArgs("GET",b);return this._sendRequest(k)}_sendRequest(b,k){return v(this,void 0,void 0,function*(){var I,T,F,R;if(!w(b))return k&&(k.path="network_invalid_sdk_key"),null;if(this._netConfig.preventAllNetworkTraffic)return k&&(k.path="network_prevent_all_network_traffic"),null;const{method:K,body:z,retries:B,attempt:U}=b,q=b.urlConfig.endpoint;if(this._isRateLimited(q))return m.Log.warn(`Request to ${q} was blocked because you are making requests too frequently.`),k&&(k.path="network_rate_limited"),null;const G=U??1;let Q=!1;const J=this._getPopulatedURL(b),Ge=Date.now();let N=null;const We=(0,e._isUnloading)();try{const ne={method:K,body:z,headers:Object.assign({},b.headers),priority:b.priority,keepalive:We};te(b,G);const A=this._leakyBucket[q];A&&(A.lastRequestTime=Date.now(),this._leakyBucket[q]=A);const ye=(I=this._netConfig.networkOverrideFunc)!==null&&I!==void 0?I:fetch;let He;if(N=yield Promise.race([ye(J,ne).finally(()=>clearTimeout(He)),new Promise((Se,ze)=>{He=setTimeout(()=>{Q=!0,ze(new Error(`Timeout of ${this._timeout}ms expired.`))},this._timeout)})]),!N.ok){const Se=yield N.text().catch(()=>"No Text"),ze=new Error(`NetworkError: ${J} ${Se}`);throw ze.name="NetworkError",ze}const Ee=yield N.text();return Je(b,N,G,Ee),this._fallbackResolver.tryBumpExpiryTime(b.sdkKey,b.urlConfig),{body:Ee,code:N.status}}catch(ne){const A=L(ne),ye=Z(A??"",Q);if(Je(b,N,G,"",ne),(yield this._fallbackResolver.tryFetchUpdatedFallbackInfo(b.sdkKey,b.urlConfig,A,ye))&&(b.fallbackUrl=this._fallbackResolver.getActiveFallbackUrl(b.sdkKey,b.urlConfig)),!B||G>B||!t.RETRYABLE_CODES.has((T=N?.status)!==null&&T!==void 0?T:500)){(F=this._emitter)===null||F===void 0||F.call(this,{name:"error",error:ne,tag:o.ErrorTag.NetworkError,requestArgs:b});const Ee=`A networking error occurred during ${K} request to ${J}.`;if(m.Log.error(Ee,A,ne),(R=this._errorBoundary)===null||R===void 0||R.attachErrorIfNoneExists(Ee),b.preserveFailedStatusCode&&N!=null)return{body:null,code:N.status};if(N==null&&k){k.path=ye?"network_request_timed_out_no_response":"network_request_exception_no_response",A&&(k.errorMessage=A);try{const Se=ee(b,J,ye,Date.now()-Ge);k.diagnosticBucket=Se.bucket,k.diagnosticMetadata=Se.metadata}catch{}}return null}return yield Fn(G),this._sendRequest(Object.assign(Object.assign({},b),{retries:B,attempt:G+1}),k)}})}_getLogEventCompressionMode(b){let k=b?.logEventCompressionMode;return!k&&b?.disableCompression===!0&&(k=r.LogEventCompressionMode.Disabled),k||(k=r.LogEventCompressionMode.Enabled),k}_isRateLimited(b){var k;const I=Date.now(),T=(k=this._leakyBucket[b])!==null&&k!==void 0?k:{count:0,lastRequestTime:I},F=I-T.lastRequestTime,R=Math.floor(F*f);return T.count=Math.max(0,T.count-R),T.count>=c?!0:(T.count+=1,T.lastRequestTime=I,this._leakyBucket[b]=T,!1)}_getPopulatedURL(b){var k;const I=(k=b.fallbackUrl)!==null&&k!==void 0?k:b.urlConfig.getUrl();(b.urlConfig.endpoint===g.Endpoint._initialize||b.urlConfig.endpoint===g.Endpoint._download_config_specs)&&(this._lastUsedInitUrl=I);const T=Object.assign({[g.NetworkParam.SdkKey]:b.sdkKey,[g.NetworkParam.SdkType]:S.SDKType._get(b.sdkKey),[g.NetworkParam.SdkVersion]:s.SDK_VERSION,[g.NetworkParam.Time]:String(Date.now()),[g.NetworkParam.SessionID]:l.SessionID.get(b.sdkKey)},b.params),F=Object.keys(T).map(R=>`${encodeURIComponent(R)}=${encodeURIComponent(T[R])}`).join("&");return`${I}${F?`?${F}`:""}`}_tryEncodeBody(b){var k;const I=(0,a._getWindowSafe)(),T=b.body;if(!(!b.isStatsigEncodable||this._options.disableStatsigEncoding||typeof T!="string"||(0,_._getStatsigGlobalFlag)("no-encode")!=null||!I?.btoa))try{b.body=I.btoa(T).split("").reverse().join(""),b.params=Object.assign(Object.assign({},(k=b.params)!==null&&k!==void 0?k:{}),{[g.NetworkParam.StatsigEncoded]:"1"})}catch(F){m.Log.warn(`Request encoding failed for ${b.urlConfig.getUrl()}`,F)}}_tryToCompressBody(b){return v(this,void 0,void 0,function*(){var k;const I=b.body;if(!(typeof I!="string"||!M(b,this._options)))try{const T=new TextEncoder().encode(I),F=new CompressionStream("gzip"),R=F.writable.getWriter();R.write(T).catch(m.Log.error),R.close().catch(m.Log.error);const K=F.readable.getReader(),z=[];let B;for(;!(B=yield K.read()).done;)z.push(B.value);const U=z.reduce((Q,J)=>Q+J.length,0),q=new Uint8Array(U);let G=0;for(const Q of z)q.set(Q,G),G+=Q.length;b.body=q,b.params=Object.assign(Object.assign({},(k=b.params)!==null&&k!==void 0?k:{}),{[g.NetworkParam.IsGzipped]:"1"})}catch(T){m.Log.warn(`Request compression failed for ${b.urlConfig.getUrl()}`,T)}})}_getInternalRequestArgs(b,k){const I=this._fallbackResolver.getActiveFallbackUrl(k.sdkKey,k.urlConfig),T=Object.assign(Object.assign({},k),{method:b,fallbackUrl:I});return"data"in k&&D(T,k.data),T}};t.NetworkCore=y;const w=O=>O.sdkKey?!0:(m.Log.warn("Unable to make request without an SDK key"),!1),D=(O,b)=>{const{sdkKey:k,fallbackUrl:I}=O,T=n.StableID.get(k),F=l.SessionID.get(k),R=S.SDKType._get(k);O.body=JSON.stringify(Object.assign(Object.assign({},b),{statsigMetadata:Object.assign(Object.assign({},s.StatsigMetadataProvider.get()),{stableID:T,sessionID:F,sdkType:R,fallbackUrl:I})}))};function M(O,b){if(!O.isCompressable||(0,_._getStatsigGlobalFlag)("no-compress")!=null||typeof CompressionStream>"u"||typeof TextEncoder>"u")return!1;const k=O.urlConfig.customUrl!=null||O.urlConfig.fallbackUrls!=null,I=p.SDKFlags.get(O.sdkKey,"enable_log_event_compression")===!0;switch(b.logEventCompressionMode){case r.LogEventCompressionMode.Disabled:return!1;case r.LogEventCompressionMode.Enabled:return!(k&&!I);case r.LogEventCompressionMode.Forced:return!0;default:return!1}}function L(O){return typeof O=="string"?O:O instanceof Error?`${O.name}: ${O.message}`:"Unknown Error"}function Z(O,b){return O.includes("Timeout")||b}function ee(O,b,k,I){var T,F,R;const K=(0,a._getWindowSafe)(),z=K?.document,B=typeof navigator<"u"?navigator:null,U=(0,e._isUnloading)(),q=B&&typeof B.onLine=="boolean"?String(B.onLine):"unknown",G=(T=z?.visibilityState)!==null&&T!==void 0?T:"unknown",Q=Object.keys((F=O.headers)!==null&&F!==void 0?F:{}).length>0,J=x(b,(R=K?.location)===null||R===void 0?void 0:R.origin),Ge=O.urlConfig.customUrl!=null,N=O.fallbackUrl!=null,We=xe(I,[250,1e3,5e3,1e4]),ne=xe(re(O.body),[16384,65536,262144,1048576]);let A="unknown_no_response";return k?A="timeout":q==="false"?A="browser_offline":U?A="page_unloading":G==="hidden"?A="page_hidden":J&&Q?A="cross_origin_custom_headers_preflight_risk":Ge||N?A="custom_url_no_response":I<250&&(A="immediate_network_rejection"),{bucket:A,metadata:{elapsedMsBucket:We,bodySizeBucket:ne,online:q,visibilityState:G,isUnloading:String(U),crossOrigin:String(J),hasCustomUrl:String(Ge)}}}function x(O,b){return b?!O.startsWith(`${b}/`)&&!O.startsWith(`${b}?`)&&O!==b:!0}function re(O){return O==null?0:typeof O=="string"?O.length:O instanceof Uint8Array?O.byteLength:typeof Blob<"u"&&O instanceof Blob?O.size:-1}function xe(O,b){if(O<0)return"unknown";for(const k of b)if(O<k)return`<${k}`;return`>=${b[b.length-1]}`}function te(O,b){O.urlConfig.endpoint===g.Endpoint._initialize&&E.Diagnostics._markInitNetworkReqStart(O.sdkKey,{attempt:b})}function Je(O,b,k,I,T){O.urlConfig.endpoint===g.Endpoint._initialize&&E.Diagnostics._markInitNetworkReqEnd(O.sdkKey,E.Diagnostics._getDiagnosticsData(b,k,I,T))}function Fn(O){return v(this,void 0,void 0,function*(){yield new Promise(b=>setTimeout(b,Math.min(u*(O*O),d)))})}})(Oe)),Oe}var Jt;function Bn(){if(Jt)return le;Jt=1;var t=le&&le.__awaiter||function(r,e,i,u){function d(C){return C instanceof i?C:new i(function(c){c(C)})}return new(i||(i=Promise))(function(C,c){function f(D){try{w(u.next(D))}catch(M){c(M)}}function y(D){try{w(u.throw(D))}catch(M){c(M)}}function w(D){D.done?C(D.value):d(D.value).then(f,y)}w((u=u.apply(r,e||[])).next())})};Object.defineProperty(le,"__esModule",{value:!0}),le.FlushCoordinator=void 0;const v=mt(),_=An(),E=Pn(),m=Un(),g=me(),h=P(),p=bn(),S=V(),a=qe(),l=$e(),n=Y(),o=new Set(["network_request_timed_out_no_response","network_request_exception_no_response","event_sender_post_returned_null","event_sender_post_returned_undefined","event_sender_post_exception"]);let s=class{constructor(e,i,u,d,C,c,f,y,w,D){this._cooldownTimer=null,this._maxIntervalTimer=null,this._hasRunQuickFlush=!1,this._currentFlushPromise=null,this._creationTime=Date.now(),this._isShuttingDown=!1,this._storageKey=null,this._flushInterval=new E.FlushInterval,this._batchQueue=e,this._pendingEvents=i,this._onPrepareFlush=u,this._errorBoundary=D,this._sdkKey=d,this._loggingEnabled=w,this._eventSender=new _.EventSender(d,C,c,f,y)}setLoggingEnabled(e){this._loggingEnabled=e}setLogEventCompressionMode(e){this._eventSender.setLogEventCompressionMode(e)}startScheduledFlushCycle(){this._scheduleNextFlush()}stopScheduledFlushCycle(){this._clearAllTimers()}addEvent(e){this._pendingEvents.addToPendingEventsQueue(e),!this._currentFlushPromise&&this._pendingEvents.hasEventsForFullBatch()&&this.processLimitFlush()}processManualFlush(){return t(this,void 0,void 0,function*(){return this._currentFlushPromise&&(yield this._currentFlushPromise),this._currentFlushPromise=this._executeFlush(m.FlushType.Manual).finally(()=>{this._currentFlushPromise=null,this._scheduleNextFlush()}),this._currentFlushPromise})}processShutdown(){return t(this,void 0,void 0,function*(){return this._isShuttingDown=!0,this._clearAllTimers(),this._currentFlushPromise&&(yield this._currentFlushPromise),this._currentFlushPromise=this._executeFlush(m.FlushType.Shutdown).catch(e=>{h.Log.error(`Error during shutdown flush: ${e}`)}).finally(()=>{this._currentFlushPromise=null}),this._currentFlushPromise})}_executeFlush(e){return t(this,void 0,void 0,function*(){this._clearAllTimers();try{this._prepareQueueForFlush(e);const i=this._batchQueue.takeAllBatches();if(i.length===0)return;yield Promise.all(i.map(u=>this._processOneBatch(u,e)))}finally{this._isShuttingDown||this._scheduleNextFlush()}})}checkQuickFlush(){this._hasRunQuickFlush||Date.now()-this._creationTime>v.EventRetryConstants.QUICK_FLUSH_WINDOW_MS||(this._hasRunQuickFlush=!0,setTimeout(()=>{this.processManualFlush().catch(e=>{h.Log.warn("Quick flush failed:",e)})},v.EventRetryConstants.QUICK_FLUSH_WINDOW_MS))}_attemptScheduledFlush(){if(this._currentFlushPromise){this._scheduleNextFlush();return}const e=this.containsAtLeastOneFullBatch(),i=this._flushInterval.hasReachedMaxInterval();if(!e&&!i){this._scheduleNoopPollTick();return}this._flushInterval.markFlushAttempt();let u;e?u=m.FlushType.ScheduledFullBatch:u=m.FlushType.ScheduledMaxTime,this._currentFlushPromise=this._processNextBatch(u).then(()=>{}).catch(d=>{h.Log.error("Error during scheduled flush:",d)}).finally(()=>{this._currentFlushPromise=null,this._scheduleNextFlush()})}processLimitFlush(){this._flushInterval.hasCompletelyRecoveredFromBackoff()&&(this._currentFlushPromise||(this._currentFlushPromise=this._processLimitFlushInternal().catch(e=>{h.Log.error("Error during limit flush",e)}).finally(()=>{this._currentFlushPromise=null,this._scheduleNextFlush()})))}_processLimitFlushInternal(){return t(this,void 0,void 0,function*(){if(yield this._processNextBatch(m.FlushType.Limit))for(;this._flushInterval.hasCompletelyRecoveredFromBackoff()&&this.containsAtLeastOneFullBatch()&&(yield this._processNextBatch(m.FlushType.Limit)););})}_scheduleNextFlush(){if(this._clearAllTimers(),this._isShuttingDown)return;const e=Math.max(0,this._flushInterval.getTimeUntilNextFlush());this._cooldownTimer=setTimeout(()=>{this._cooldownTimer=null,a.StatsigSession.checkForIdleSession(this._sdkKey),this._attemptScheduledFlush()},e);const i=Math.max(0,this._flushInterval.getTimeTillMaxInterval());this._maxIntervalTimer=setTimeout(()=>{this._maxIntervalTimer=null,a.StatsigSession.checkForIdleSession(this._sdkKey),this._attemptScheduledFlush()},i)}_clearAllTimers(){this._cooldownTimer!==null&&(clearTimeout(this._cooldownTimer),this._cooldownTimer=null),this._maxIntervalTimer!==null&&(clearTimeout(this._maxIntervalTimer),this._maxIntervalTimer=null)}_scheduleNoopPollTick(){if(this._clearAllTimers(),this._isShuttingDown)return;this._cooldownTimer=setTimeout(()=>{this._cooldownTimer=null,a.StatsigSession.checkForIdleSession(this._sdkKey),this._attemptScheduledFlush()},v.EventRetryConstants.TICK_INTERVAL_MS);const e=Math.max(0,this._flushInterval.getTimeTillMaxInterval());this._maxIntervalTimer=setTimeout(()=>{this._maxIntervalTimer=null,a.StatsigSession.checkForIdleSession(this._sdkKey),this._attemptScheduledFlush()},e)}_processNextBatch(e){return t(this,void 0,void 0,function*(){this._prepareQueueForFlush(e);const i=this._batchQueue.takeNextBatch();return i?this._processOneBatch(i,e):!1})}_processOneBatch(e,i){return t(this,void 0,void 0,function*(){if(this._loggingEnabled!==l.LoggingEnabledOption.always&&(0,S._isServerEnv)())return this._flushInterval.adjustForSuccess(),!0;const u=yield this._eventSender.sendBatch(e);return u.success?(this._flushInterval.adjustForSuccess(),!0):(this._flushInterval.adjustForFailure(),this._handleFailure(e,i,u.statusCode,u.failurePath,u.failureErrorMessage,u.failureDiagnosticBucket,u.failureDiagnosticMetadata),!1)})}_prepareQueueForFlush(e){this._onPrepareFlush();const i=this.convertPendingEventsToBatches();i>0&&(h.Log.warn(`Dropped ${i} events`),this._errorBoundary.logDroppedEvents(i,"Batch queue limit reached during batching",{loggingInterval:this._flushInterval.getCurrentIntervalMs(),batchSize:this._batchQueue.batchSize(),maxPendingBatches:v.EventRetryConstants.MAX_PENDING_BATCHES,flushType:e,retries:"dropped before batching"}))}containsAtLeastOneFullBatch(){return this._pendingEvents.hasEventsForFullBatch()||this._batchQueue.hasFullBatch()}convertPendingEventsToBatches(){if(this._pendingEvents.isEmpty())return 0;const e=this._pendingEvents.takeAll();return this._batchQueue.createBatches(e)}_isRetryableBatch(e,i){return!!(p.RETRYABLE_CODES.has(e)||e===-1&&i&&o.has(i))}_handleFailure(e,i,u,d,C,c,f){if(i===m.FlushType.Shutdown){h.Log.warn(`${i} flush failed during shutdown. ${e.events.length} event(s) will be saved to storage for retry in next session.`),this._saveShutdownFailedEventsToStorage(e.events);return}if(!this._isRetryableBatch(u,d)){const w="non-retryable error";h.Log.warn(`${i} flush failed after ${e.attempts} attempt(s). ${e.events.length} event(s) will be dropped. Non-retryable error: ${u}`),this._errorBoundary.logEventRequestFailure(e.events.length,w,i,u,e.attempts,d,C,c,f);return}if(e.attempts>=v.EventRetryConstants.MAX_RETRY_ATTEMPTS){const w="max retry attempts exceeded";h.Log.warn(`${i} flush failed after ${e.attempts} attempt(s). ${e.events.length} event(s) will be dropped.`),this._errorBoundary.logEventRequestFailure(e.events.length,w,i,u,e.attempts,d,C,c,f);return}e.incrementAttempts();const y=this._batchQueue.requeueBatch(e);y>0&&(h.Log.warn(`Failed to requeue batch : dropped ${y} events due to full queue`),this._errorBoundary.logDroppedEvents(y,"Batch queue limit reached during requeue",{loggingInterval:this._flushInterval.getCurrentIntervalMs(),batchSize:this._batchQueue.batchSize(),maxPendingBatches:v.EventRetryConstants.MAX_PENDING_BATCHES,flushType:i,retries:e.attempts}))}loadAndRetryShutdownFailedEvents(){return t(this,void 0,void 0,function*(){const e=this._getStorageKey();try{n.Storage.isReady()||(yield n.Storage.isReadyResolver());const i=this._getShutdownFailedEventsFromStorage(e);if(i.length===0)return;h.Log.debug(`Loading ${i.length} failed shutdown event(s) from storage for retry`),n.Storage.removeItem(e),i.forEach(u=>{this.addEvent(u)}),yield this.processManualFlush()}catch(i){h.Log.warn("Failed to load and retry failed shutdown events:",i)}})}_getStorageKey(){return this._storageKey||(this._storageKey=`statsig.failed_shutdown_events.${(0,g._DJB2)(this._sdkKey)}`),this._storageKey}_saveShutdownFailedEventsToStorage(e){const i=this._getStorageKey();try{let d=[...this._getShutdownFailedEventsFromStorage(i),...e];d.length>v.EventRetryConstants.MAX_LOCAL_STORAGE&&(d=d.slice(-v.EventRetryConstants.MAX_LOCAL_STORAGE)),(0,n._setObjectInStorage)(i,d),h.Log.debug(`Saved ${e.length} failed shutdown event(s) to storage (total stored: ${d.length})`)}catch(u){h.Log.warn("Unable to save failed shutdown events to storage:",u)}}_getShutdownFailedEventsFromStorage(e){try{const i=(0,n._getObjectFromStorage)(e);return Array.isArray(i)?i:[]}catch{return[]}}};return le.FlushCoordinator=s,le}var Fe={},Wt;function qn(){if(Wt)return Fe;Wt=1,Object.defineProperty(Fe,"__esModule",{value:!0}),Fe.PendingEvents=void 0;const t=P();let v=class{constructor(E){this._pendingEvents=[],this._batchSize=E}addToPendingEventsQueue(E){this._pendingEvents.push(E),t.Log.debug("Enqueued Event:",E)}hasEventsForFullBatch(){return this._pendingEvents.length>=this._batchSize}takeAll(){const E=this._pendingEvents;return this._pendingEvents=[],E}isEmpty(){return this._pendingEvents.length===0}};return Fe.PendingEvents=v,Fe}var $={},Ht;function wn(){if(Ht)return $;Ht=1,Object.defineProperty($,"__esModule",{value:!0}),$._createLayerParameterExposure=$._createConfigExposure=$._mapExposures=$._createGateExposure=$._isExposureEvent=void 0;const t="statsig::config_exposure",v="statsig::gate_exposure",_="statsig::layer_exposure",E=(l,n,o,s,r)=>(o.bootstrapMetadata&&(s.bootstrapMetadata=o.bootstrapMetadata),{eventName:l,user:n,value:null,metadata:a(o,s),secondaryExposures:r,time:Date.now()}),m=({eventName:l})=>l===v||l===t||l===_;$._isExposureEvent=m;const g=(l,n,o)=>{var s,r,e;const i={gate:n.name,gateValue:String(n.value),ruleID:n.ruleID};return((s=n.__evaluation)===null||s===void 0?void 0:s.version)!=null&&(i.configVersion=n.__evaluation.version),E(v,l,n.details,i,h((e=(r=n.__evaluation)===null||r===void 0?void 0:r.secondary_exposures)!==null&&e!==void 0?e:[],o))};$._createGateExposure=g;function h(l,n){return l.map(o=>typeof o=="string"?(n??{})[o]:o).filter(o=>o!=null)}$._mapExposures=h;const p=(l,n,o)=>{var s,r,e,i;const u={config:n.name,ruleID:n.ruleID};return((s=n.__evaluation)===null||s===void 0?void 0:s.version)!=null&&(u.configVersion=n.__evaluation.version),((r=n.__evaluation)===null||r===void 0?void 0:r.passed)!=null&&(u.rulePassed=String(n.__evaluation.passed)),E(t,l,n.details,u,h((i=(e=n.__evaluation)===null||e===void 0?void 0:e.secondary_exposures)!==null&&i!==void 0?i:[],o))};$._createConfigExposure=p;const S=(l,n,o,s)=>{var r,e,i,u,d,C,c;const f=n.__evaluation,y=((r=f?.explicit_parameters)===null||r===void 0?void 0:r.includes(o))===!0;let w="",D=(e=f?.undelegated_secondary_exposures)!==null&&e!==void 0?e:[];y&&(w=(i=f.allocated_experiment_name)!==null&&i!==void 0?i:"",D=(u=f.secondary_exposures)!==null&&u!==void 0?u:[]);const M=(d=n.__evaluation)===null||d===void 0?void 0:d.parameter_rule_ids,L={config:n.name,parameterName:o,ruleID:(C=M?.[o])!==null&&C!==void 0?C:n.ruleID,allocatedExperiment:w,isExplicitParameter:String(y)};return((c=n.__evaluation)===null||c===void 0?void 0:c.version)!=null&&(L.configVersion=n.__evaluation.version),E(_,l,n.details,L,h(D,s))};$._createLayerParameterExposure=S;const a=(l,n)=>(n.reason=l.reason,l.lcut&&(n.lcut=String(l.lcut)),l.receivedAt&&(n.receivedAt=String(l.receivedAt)),n);return $}var Re={},Xt;function Cn(){if(Xt)return Re;Xt=1,Object.defineProperty(Re,"__esModule",{value:!0}),Re.UrlConfiguration=void 0;const t=me(),v=je(),_={[v.Endpoint._initialize]:"i",[v.Endpoint._rgstr]:"e",[v.Endpoint._download_config_specs]:"d"};let E=class{constructor(g,h,p,S){this.customUrl=null,this.fallbackUrls=null,this.endpoint=g,this.endpointDnsKey=_[g],h&&(this.customUrl=h),!h&&p&&(this.customUrl=p.endsWith("/")?`${p}${g}`:`${p}/${g}`),S&&(this.fallbackUrls=S);const a=v.NetworkDefault[g];this.defaultUrl=`${a}/${g}`}getUrl(){var g;return(g=this.customUrl)!==null&&g!==void 0?g:this.defaultUrl}getChecksum(){var g;const h=((g=this.fallbackUrls)!==null&&g!==void 0?g:[]).sort().join(",");return(0,t._DJB2)(this.customUrl+h)}};return Re.UrlConfiguration=E,Re}var Yt;function Dn(){if(Yt)return se;Yt=1;var t=se&&se.__awaiter||function(C,c,f,y){function w(D){return D instanceof f?D:new f(function(M){M(D)})}return new(f||(f=Promise))(function(D,M){function L(x){try{ee(y.next(x))}catch(re){M(re)}}function Z(x){try{ee(y.throw(x))}catch(re){M(re)}}function ee(x){x.done?D(x.value):w(x.value).then(L,Z)}ee((y=y.apply(C,c||[])).next())})};Object.defineProperty(se,"__esModule",{value:!0}),se.EventLogger=void 0;const v=Ln(),_=Ve(),E=mt(),m=Bn(),g=me(),h=P(),p=je(),S=qn(),a=V(),l=wn(),n=$e(),o=Y(),s=Cn(),r=Be(),e=1e3,i=6e5,u={};let d=class kn{static _safeFlushAndForget(c){var f;(f=u[c])===null||f===void 0||f.flush().catch(()=>{})}constructor(c,f,y,w,D){var M;this._sdkKey=c,this._emitter=f,this._network=y,this._options=w,this._errorBoundary=D,this._pendingEvents=null,this._batchQueue=null,this._flushCoordinator=null,this._lastExposureTimeMap={},this._nonExposedChecks={},this._isShuttingDown=!1,this._storageKey=null,this._pendingCompressionMode=null,this._loggingEnabled=(M=w?.loggingEnabled)!==null&&M!==void 0?M:w?.disableLogging===!0?n.LoggingEnabledOption.disabled:n.LoggingEnabledOption.browserOnly,w?.loggingEnabled&&w.disableLogging!==void 0&&h.Log.warn("Detected both loggingEnabled and disableLogging options. loggingEnabled takes precedence - please remove disableLogging.");const L=w?.networkConfig;this._logEventUrlConfig=new s.UrlConfiguration(p.Endpoint._rgstr,L?.logEventUrl,L?.api,L?.logEventFallbackUrls)}setLogEventCompressionMode(c){this._flushCoordinator?this._flushCoordinator.setLogEventCompressionMode(c):this._pendingCompressionMode=c}setLoggingEnabled(c){const f=this._loggingEnabled==="disabled",y=c!=="disabled";if(this._loggingEnabled=c,this._flushCoordinator&&this._flushCoordinator.setLoggingEnabled(c),f&&y){const w=this._loadStoredEvents();h.Log.debug(`Loaded ${w.length} stored event(s) from storage`),w.length>0&&(w.forEach(D=>{this._initFlushCoordinator().addEvent(D)}),this.flush().catch(D=>{h.Log.warn("Failed to flush events after enabling logging:",D)}))}}enqueue(c){var f;if(!this._shouldLogEvent(c))return;const y=this._normalizeEvent(c);if(this._loggingEnabled==="disabled"){this._storeEventToStorage(y);return}this._initFlushCoordinator().addEvent(y),(f=this._flushCoordinator)===null||f===void 0||f.checkQuickFlush()}incrementNonExposureCount(c){var f;const y=(f=this._nonExposedChecks[c])!==null&&f!==void 0?f:0;this._nonExposedChecks[c]=y+1}reset(){this.flush().catch(()=>{}),this._lastExposureTimeMap={}}start(){var c;const f=(0,a._isServerEnv)();if(f&&((c=this._options)===null||c===void 0?void 0:c.loggingEnabled)!=="always")return;const y=this._initFlushCoordinator();u[this._sdkKey]=this,f||(0,r._subscribeToVisiblityChanged)(w=>{w==="background"?kn._safeFlushAndForget(this._sdkKey):w==="foreground"&&y.startScheduledFlushCycle()}),y.loadAndRetryShutdownFailedEvents().catch(w=>{h.Log.warn("Failed to load failed shutdown events:",w)}),y.startScheduledFlushCycle()}stop(){return t(this,void 0,void 0,function*(){this._isShuttingDown=!0,this._flushCoordinator&&(yield this._flushCoordinator.processShutdown()),delete u[this._sdkKey],this._flushCoordinator=null,this._pendingEvents=null,this._batchQueue=null})}flush(){return t(this,void 0,void 0,function*(){if(this._flushCoordinator)return this._flushCoordinator.processManualFlush()})}appendAndResetNonExposedChecks(){if(Object.keys(this._nonExposedChecks).length===0)return;const c=Object.assign({},this._nonExposedChecks);this._nonExposedChecks={};const f=this._normalizeEvent({eventName:"statsig::non_exposed_checks",user:null,time:Date.now(),metadata:{checks:c}});this._flushCoordinator&&this._flushCoordinator.addEvent(f)}_shouldLogEvent(c){var f;if(((f=this._options)===null||f===void 0?void 0:f.loggingEnabled)!=="always"&&(0,a._isServerEnv)())return!1;if(!(0,l._isExposureEvent)(c))return!0;const y=c.user?c.user:{statsigEnvironment:void 0},w=(0,_._getUserStorageKey)(this._sdkKey,y),D=c.metadata?c.metadata:{},M=[c.eventName,w,D.gate,D.config,D.ruleID,D.allocatedExperiment,D.parameterName,String(D.isExplicitParameter),D.reason].join("|"),L=this._lastExposureTimeMap[M],Z=Date.now();return L&&Z-L<i?!1:(Object.keys(this._lastExposureTimeMap).length>e&&(this._lastExposureTimeMap={}),this._lastExposureTimeMap[M]=Z,!0)}_getCurrentPageUrl(){var c;if(((c=this._options)===null||c===void 0?void 0:c.includeCurrentPageUrlWithEvents)!==!1)return(0,a._getCurrentPageUrlSafe)()}_getStorageKey(){return this._storageKey||(this._storageKey=`statsig.pending_events.${(0,g._DJB2)(this._sdkKey)}`),this._storageKey}_initFlushCoordinator(){var c,f;if(this._flushCoordinator)return this._flushCoordinator;const y=(f=(c=this._options)===null||c===void 0?void 0:c.loggingBufferMaxSize)!==null&&f!==void 0?f:E.EventRetryConstants.DEFAULT_BATCH_SIZE;return this._pendingEvents=new S.PendingEvents(y),this._batchQueue=new v.BatchQueue(y),this._flushCoordinator=new m.FlushCoordinator(this._batchQueue,this._pendingEvents,()=>this.appendAndResetNonExposedChecks(),this._sdkKey,this._network,this._emitter,this._logEventUrlConfig,this._options,this._loggingEnabled,this._errorBoundary),this._pendingCompressionMode&&(this._flushCoordinator.setLogEventCompressionMode(this._pendingCompressionMode),this._pendingCompressionMode=null),this._flushCoordinator}_storeEventToStorage(c){const f=this._getStorageKey();try{let y=this._getEventsFromStorage(f);y.push(c),y.length>E.EventRetryConstants.MAX_LOCAL_STORAGE&&(y=y.slice(-E.EventRetryConstants.MAX_LOCAL_STORAGE)),(0,o._setObjectInStorage)(f,y)}catch{h.Log.warn("Unable to save events to storage")}}_getEventsFromStorage(c){try{const f=(0,o._getObjectFromStorage)(c);return Array.isArray(f)?f:[]}catch{return[]}}_loadStoredEvents(){const c=this._getStorageKey(),f=this._getEventsFromStorage(c);return f.length>0&&o.Storage.removeItem(c),f}_normalizeEvent(c){c.user&&(c.user=Object.assign({},c.user),delete c.user.privateAttributes);const f={},y=this._getCurrentPageUrl();return y&&(f.statsigMetadata={currentPage:y}),Object.assign(Object.assign({},c),f)}};return se.EventLogger=d,se}var Le={},Zt;function Kn(){if(Zt)return Le;Zt=1,Object.defineProperty(Le,"__esModule",{value:!0}),Le.PrecomputedEvaluationsContextHandle=void 0;const t=P(),v=V(),_=qe(),E=Ke();class m{constructor(h,p,S,a,l,n){this._sdkKey=h,this._getOptions=p,this._getErrorBoundary=S,this._getValues=a,this._getUser=l,this._getSdkInstanceID=n}get sdkKey(){return this._sdkKey}get options(){return this._getOptions()}get errorBoundary(){return this._getErrorBoundary()}get values(){return this._getValues()}get user(){let h=(0,v._cloneObject)("StatsigUser",this._getUser());return h==null&&(t.Log.error("Failed to clone user"),h={}),h}getSession(h=!0){return _.StatsigSession.get(this._sdkKey,h)}get stableID(){return E.StableID.get(this._sdkKey)}get sdkInstanceID(){return this._getSdkInstanceID()}toContext(h=!0){return{sdkKey:this.sdkKey,options:this.options,values:this.values,user:this.user,errorBoundary:this.errorBoundary,session:this.getSession(h),stableID:this.stableID,sdkInstanceID:this.sdkInstanceID}}}return Le.PrecomputedEvaluationsContextHandle=m,Le}var H={},X={},en;function On(){if(en)return X;en=1,Object.defineProperty(X,"__esModule",{value:!0}),X._getUnitIDFromUser=X._getFullUserHash=X._normalizeUser=void 0;const t=me(),v=P(),_=V();function E(h,p,S){const a=(0,_._cloneObject)("StatsigUser",h);return a==null?(v.Log.error("Failed to clone user"),{statsigEnvironment:void 0}):(p!=null&&p.environment!=null?a.statsigEnvironment=p.environment:S!=null&&(a.statsigEnvironment={tier:S}),a)}X._normalizeUser=E;function m(h){return h?(0,t._DJB2Object)(h):null}X._getFullUserHash=m;function g(h,p){var S,a,l;if(typeof p!="string")return h.userID;const n=p.toLowerCase();return n!=="userid"?(a=(S=h.customIDs)===null||S===void 0?void 0:S[p])!==null&&a!==void 0?a:(l=h.customIDs)===null||l===void 0?void 0:l[n]:h.userID}return X._getUnitIDFromUser=g,X}var Ae={},tn;function In(){if(tn)return Ae;tn=1,Object.defineProperty(Ae,"__esModule",{value:!0}),Ae._typedJsonParse=void 0;const t=P();function v(_,E,m){try{const g=JSON.parse(_);if(g&&typeof g=="object"&&E in g)return g}catch{}return t.Log.error(`Failed to parse ${m}`),null}return Ae._typedJsonParse=v,Ae}var nn;function $n(){if(nn)return H;nn=1;var t=H&&H.__awaiter||function(o,s,r,e){function i(u){return u instanceof r?u:new r(function(d){d(u)})}return new(r||(r=Promise))(function(u,d){function C(y){try{f(e.next(y))}catch(w){d(w)}}function c(y){try{f(e.throw(y))}catch(w){d(w)}}function f(y){y.done?u(y.value):i(y.value).then(C,c)}f((e=e.apply(o,s||[])).next())})};Object.defineProperty(H,"__esModule",{value:!0}),H._makeDataAdapterResult=H.DataAdapterCore=void 0;const v=P(),_=Ke(),E=On(),m=Y(),g=In(),h=10,p=8;let S=class{constructor(s,r){this._adapterName=s,this._cacheSuffix=r,this._options=null,this._sdkKey=null,this._cacheLimit=h,this._lastModifiedStoreKey=`statsig.last_modified_time.${r}`,this._inMemoryCache=new l}attach(s,r,e){this._sdkKey=s,this._options=r}getDataSync(s){const r=s&&(0,E._normalizeUser)(s,this._options),e=this._getCacheKey(r),i=this._inMemoryCache.get(e,r);if(i&&this._getIsCacheValueValid(i))return i;const u=this._loadFromCache(e);return u&&this._getIsCacheValueValid(u)?(this._inMemoryCache.add(e,u,this._cacheLimit),this._inMemoryCache.get(e,r)):null}setData(s,r){const e=r&&(0,E._normalizeUser)(r,this._options),i=this._getCacheKey(e);this._inMemoryCache.add(i,a("Bootstrap",s,null,e),this._cacheLimit)}_getIsCacheValueValid(s){return s.stableID==null||s.stableID===_.StableID.get(this._getSdkKey())}_getDataAsyncImpl(s,r,e){return t(this,void 0,void 0,function*(){m.Storage.isReady()||(yield m.Storage.isReadyResolver());const i=s??this.getDataSync(r),u=[this._fetchAndPrepFromNetwork(i,r,e)];return e?.timeoutMs&&u.push(new Promise(d=>setTimeout(d,e.timeoutMs)).then(()=>(v.Log.debug("Fetching latest value timed out"),null))),yield Promise.race(u)})}_prefetchDataImpl(s,r){return t(this,void 0,void 0,function*(){const e=s&&(0,E._normalizeUser)(s,this._options),i=this._getCacheKey(e),u=yield this._getDataAsyncImpl(null,e,r);u&&this._inMemoryCache.add(i,Object.assign(Object.assign({},u),{source:"Prefetch"}),this._cacheLimit)})}_fetchAndPrepFromNetwork(s,r,e){return t(this,void 0,void 0,function*(){var i;const u=(i=s?.data)!==null&&i!==void 0?i:null,d=s!=null&&this._isCachedResultValidFor204(s,r),C=yield this._fetchFromNetwork(u,r,e,d);if(!C)return v.Log.debug("No response returned for latest value"),null;const c=(0,g._typedJsonParse)(C,"has_updates","Response"),f=this._getSdkKey(),y=_.StableID.get(f);let w=null;if(c?.has_updates===!0)w=a("Network",C,y,r);else if(u&&c?.has_updates===!1)w=a("NetworkNotModified",u,y,r);else return null;const D=this._getCacheKey(r);return this._inMemoryCache.add(D,w,this._cacheLimit),this._writeToCache(D,w),w})}_getSdkKey(){return this._sdkKey!=null?this._sdkKey:(v.Log.error(`${this._adapterName} is not attached to a Client`),"")}_loadFromCache(s){var r;const e=(r=m.Storage.getItem)===null||r===void 0?void 0:r.call(m.Storage,s);if(e==null)return null;const i=(0,g._typedJsonParse)(e,"source","Cached Result");return i?Object.assign(Object.assign({},i),{source:"Cache"}):null}_writeToCache(s,r){const e=JSON.stringify(r);for(let i=0;i<p;i++)try{m.Storage.setItem(s,e);break}catch(u){if(!(u instanceof Error)||!(u.toString().includes("QuotaExceededError")||u.toString().includes("QUOTA_EXCEEDED_ERR"))||this._cacheLimit<=1)throw u;this._cacheLimit=Math.ceil(this._cacheLimit/2),this._runLocalStorageCacheEviction(s,this._cacheLimit-1)}this._runLocalStorageCacheEviction(s)}_runLocalStorageCacheEviction(s,r=this._cacheLimit){var e;const i=(e=(0,m._getObjectFromStorage)(this._lastModifiedStoreKey))!==null&&e!==void 0?e:{};i[s]=Date.now();const u=n(i,r);for(const d of u)delete i[d],m.Storage.removeItem(d);(0,m._setObjectInStorage)(this._lastModifiedStoreKey,i)}};H.DataAdapterCore=S;function a(o,s,r,e){return{source:o,data:s,receivedAt:Date.now(),stableID:r,fullUserHash:(0,E._getFullUserHash)(e)}}H._makeDataAdapterResult=a;class l{constructor(){this._data={}}get(s,r){var e;const i=this._data[s],u=i?.stableID,d=(e=r?.customIDs)===null||e===void 0?void 0:e.stableID;return d&&u&&d!==u?(v.Log.warn("'StatsigUser.customIDs.stableID' mismatch"),null):i}add(s,r,e){const i=n(this._data,e-1);for(const u of i)delete this._data[u];this._data[s]=r}merge(s){this._data=Object.assign(Object.assign({},this._data),s)}}function n(o,s){const r=Object.keys(o);return r.length<=s?[]:s===0?r:r.sort((e,i)=>{const u=o[e],d=o[i];return typeof u=="object"&&typeof d=="object"?u.receivedAt-d.receivedAt:u-d}).slice(0,r.length-s)}return H}var at={},rn;function xn(){return rn||(rn=1,Object.defineProperty(at,"__esModule",{value:!0})),at}var Pe={},sn;function Tn(){return sn||(sn=1,(function(t){var v=Pe&&Pe.__awaiter||function(n,o,s,r){function e(i){return i instanceof s?i:new s(function(u){u(i)})}return new(s||(s=Promise))(function(i,u){function d(f){try{c(r.next(f))}catch(y){u(y)}}function C(f){try{c(r.throw(f))}catch(y){u(y)}}function c(f){f.done?i(f.value):e(f.value).then(d,C)}c((r=r.apply(n,o||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorBoundary=t.EXCEPTION_ENDPOINT=void 0;const _=P(),E=Qe(),m=Ne();t.EXCEPTION_ENDPOINT="https://statsigapi.net/v1/sdk_exception";const g="[Statsig] UnknownError";let h=class{constructor(o,s,r,e){this._sdkKey=o,this._options=s,this._emitter=r,this._lastSeenError=e,this._seen=new Set}wrap(o,s){try{const r=o;a(r).forEach(e=>{const i=r[e];"$EB"in i||(r[e]=(...u)=>this._capture(s?`${s}:${e}`:e,()=>i.apply(o,u)),r[e].$EB=!0)})}catch(r){this._onError("eb:wrap",r)}}logError(o,s){this._onError(o,s)}logDroppedEvents(o,s,r){const e={eventCount:String(o),reason:s};r&&Object.keys(r).forEach(i=>{e[i]=String(r[i])}),this._onError("statsig::log_event_dropped_event_count",new Error(s),!0,e)}logEventRequestFailure(o,s,r,e,i,u,d,C,c){const f={eventCount:String(o),flushType:r,statusCode:String(e),reason:s,retries:String(i)};u&&(f.failurePath=u),typeof d=="string"&&d.length>0&&(f.failureErrorMessage=d),typeof C=="string"&&C.length>0&&(f.failureDiagnosticBucket=C),c&&Object.keys(c).forEach(y=>{const w=c[y];w.length>0&&(f[`failureDiagnostic_${y}`]=w)}),this._onError("statsig::log_event_failed",new Error(s),!0,f)}getLastSeenErrorAndReset(){const o=this._lastSeenError;return this._lastSeenError=void 0,o??null}attachErrorIfNoneExists(o){this._lastSeenError||(this._lastSeenError=p(o))}_capture(o,s){try{const r=s();return r&&r instanceof Promise?r.catch(e=>this._onError(o,e)):r}catch(r){return this._onError(o,r),null}}_onError(o,s,r=!1,e){try{_.Log.warn(`Caught error in ${o}`,{error:s}),v(this,void 0,void 0,function*(){var u,d,C,c,f,y,w;const D=s||Error(g),M=D instanceof Error,L=M?D.name:"No Name",Z=p(D);if(this._lastSeenError=Z,!r&&this._seen.has(L))return;if(this._seen.add(L),!((d=(u=this._options)===null||u===void 0?void 0:u.networkConfig)===null||d===void 0)&&d.preventAllNetworkTraffic){(C=this._emitter)===null||C===void 0||C.call(this,{name:"error",error:s,tag:o});return}const ee=E.SDKType._get(this._sdkKey),x=m.StatsigMetadataProvider.get(),re=M?D.stack:S(D),xe=Object.assign(Object.assign({tag:o,exception:L,info:re,statsigOptions:l(this._options)},Object.assign(Object.assign({},x),{sdkType:ee})),e??{}),te=(c=this._options)===null||c===void 0?void 0:c.networkConfig;yield((f=te?.networkOverrideFunc)!==null&&f!==void 0?f:fetch)((y=te?.sdkExceptionUrl)!==null&&y!==void 0?y:t.EXCEPTION_ENDPOINT,{method:"POST",headers:{"STATSIG-API-KEY":this._sdkKey,"STATSIG-SDK-TYPE":String(ee),"STATSIG-SDK-VERSION":String(x.sdkVersion),"Content-Type":"application/json"},body:JSON.stringify(xe)}),(w=this._emitter)===null||w===void 0||w.call(this,{name:"error",error:s,tag:o})}).then(()=>{}).catch(()=>{})}catch{}}};t.ErrorBoundary=h;function p(n){return n instanceof Error?n:typeof n=="string"?new Error(n):new Error("An unknown error occurred.")}function S(n){try{return JSON.stringify(n)}catch{return g}}function a(n){const o=new Set;let s=Object.getPrototypeOf(n);for(;s&&s!==Object.prototype;)Object.getOwnPropertyNames(s).filter(r=>typeof s?.[r]=="function").forEach(r=>o.add(r)),s=Object.getPrototypeOf(s);return Array.from(o)}function l(n){if(!n)return{};const o={};return Object.keys(n).forEach(s=>{const r=s,e=n[r];switch(typeof e){case"number":case"bigint":case"boolean":o[String(r)]=e;break;case"string":e.length<50?o[String(r)]=e:o[String(r)]="set";break;case"object":r==="environment"?o.environment=e:r==="networkConfig"?o.networkConfig=e:o[String(r)]=e!=null?"set":"unset";break}}),o}})(Pe)),Pe}var lt={},on;function Gn(){return on||(on=1,Object.defineProperty(lt,"__esModule",{value:!0})),lt}var ut={},an;function zn(){return an||(an=1,Object.defineProperty(ut,"__esModule",{value:!0})),ut}var ct={},ln;function Vn(){return ln||(ln=1,Object.defineProperty(ct,"__esModule",{value:!0})),ct}var he={},un;function Mn(){if(un)return he;un=1,Object.defineProperty(he,"__esModule",{value:!0}),he.createMemoKey=he.MemoPrefix=void 0,he.MemoPrefix={_gate:"g",_dynamicConfig:"c",_experiment:"e",_configList:"cl",_layer:"l",_paramStore:"p"};const t=new Set([]),v=new Set(["userPersistedValues"]);function _(E,m,g){let h=`${E}|${m}`;if(!g)return h;for(const p of Object.keys(g)){if(v.has(p))return;t.has(p)?h+=`|${p}=true`:h+=`|${p}=${g[p]}`}return h}return he.createMemoKey=_,he}var dt={},cn;function Qn(){return cn||(cn=1,Object.defineProperty(dt,"__esModule",{value:!0})),dt}var _t={},dn;function Jn(){return dn||(dn=1,Object.defineProperty(_t,"__esModule",{value:!0})),_t}var ht={},_n;function Wn(){return _n||(_n=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t._fastApproxSizeOf=void 0;const v=2,_=1,E=(m,g)=>{let h=0;const p=Object.keys(m);for(let S=0;S<p.length;S++){const a=p[S],l=m[a];if(h+=a.length,typeof l=="object"&&l!==null?h+=(0,t._fastApproxSizeOf)(l,g)+v:h+=String(l).length+_,h>=g)return h}return h};t._fastApproxSizeOf=E})(ht)),ht}var ge={},hn;function Hn(){if(hn)return ge;hn=1;var t=ge&&ge.__awaiter||function(r,e,i,u){function d(C){return C instanceof i?C:new i(function(c){c(C)})}return new(i||(i=Promise))(function(C,c){function f(D){try{w(u.next(D))}catch(M){c(M)}}function y(D){try{w(u.throw(D))}catch(M){c(M)}}function w(D){D.done?C(D.value):d(D.value).then(f,y)}w((u=u.apply(r,e||[])).next())})};Object.defineProperty(ge,"__esModule",{value:!0}),ge.StatsigClientBase=void 0,ve();const v=ve(),_=Tn(),E=Dn(),m=P(),g=Mn(),h=V(),p=qe(),S=Ke(),a=$e(),l=Y(),n=3e3;let o=class{constructor(e,i,u,d){var C,c,f,y;this.loadingStatus="Uninitialized",this._initializePromise=null,this._listeners={};const w=this.$emt.bind(this);d?.logLevel!=null&&(m.Log.level=d.logLevel),d?.disableStorage&&l.Storage._setDisabled(!0),d?.initialSessionID&&p.StatsigSession.overrideInitialSessionID(d.initialSessionID,e),d?.storageProvider&&l.Storage._setProvider(d.storageProvider),d?.enableCookies&&S.StableID._setCookiesEnabled(e,d.enableCookies),d?.disableStableID&&S.StableID._setDisabled(e,!0),this._sdkKey=e,this._options=d??{},this._memoCache={},this.overrideAdapter=(C=d?.overrideAdapter)!==null&&C!==void 0?C:null,this._errorBoundary=new _.ErrorBoundary(e,d,w),this._logger=new E.EventLogger(e,w,u,d,this._errorBoundary),this._errorBoundary.wrap(this),this._errorBoundary.wrap(i),this._errorBoundary.wrap(this._logger),u.setErrorBoundary(this._errorBoundary),this.dataAdapter=i,this.dataAdapter.attach(e,d,u),this.storageProvider=l.Storage,(y=(f=(c=this.overrideAdapter)===null||c===void 0?void 0:c.loadFromStorage)===null||f===void 0?void 0:f.call(c))===null||y===void 0||y.catch(D=>this._errorBoundary.logError("OA::loadFromStorage",D)),this._primeReadyRipcord(),s(e,this)}updateRuntimeOptions(e){e.loggingEnabled?(this._options.loggingEnabled=e.loggingEnabled,this._logger.setLoggingEnabled(e.loggingEnabled)):e.disableLogging!=null&&(this._options.disableLogging=e.disableLogging,this._logger.setLoggingEnabled(e.disableLogging?"disabled":"browser-only")),e.disableStorage!=null&&(this._options.disableStorage=e.disableStorage,l.Storage._setDisabled(e.disableStorage)),e.enableCookies!=null&&(this._options.enableCookies=e.enableCookies,S.StableID._setCookiesEnabled(this._sdkKey,e.enableCookies)),e.logEventCompressionMode?this._logger.setLogEventCompressionMode(e.logEventCompressionMode):e.disableCompression&&this._logger.setLogEventCompressionMode(a.LogEventCompressionMode.Disabled)}flush(){return this._logger.flush()}shutdown(){return t(this,void 0,void 0,function*(){this.$emt({name:"pre_shutdown"}),this._setStatus("Uninitialized",null),this._initializePromise=null,yield this._logger.stop()})}on(e,i){this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].push(i)}off(e,i){if(this._listeners[e]){const u=this._listeners[e].indexOf(i);u!==-1&&this._listeners[e].splice(u,1)}}$on(e,i){i.__isInternal=!0,this.on(e,i)}$emt(e){var i;const u=d=>{try{d(e)}catch(C){if(d.__isInternal===!0){this._errorBoundary.logError(`__emit:${e.name}`,C);return}m.Log.error("An error occurred in a StatsigClientEvent listener. This is not an issue with Statsig.",e)}};this._listeners[e.name]&&this._listeners[e.name].forEach(d=>u(d)),(i=this._listeners["*"])===null||i===void 0||i.forEach(u)}_setStatus(e,i){this.loadingStatus=e,this._memoCache={},this.$emt({name:"values_updated",status:e,values:i})}_enqueueExposure(e,i,u){if(u?.disableExposureLog===!0){this._logger.incrementNonExposureCount(e);return}this._logger.enqueue(i)}_memoize(e,i){return(u,d)=>{if(this._options.disableEvaluationMemoization)return i(u,d);const C=(0,g.createMemoKey)(e,u,d);return C?(C in this._memoCache||(Object.keys(this._memoCache).length>=n&&(this._memoCache={}),this._memoCache[C]=i(u,d)),this._memoCache[C]):i(u,d)}}};ge.StatsigClientBase=o;function s(r,e){var i;if((0,h._isServerEnv)())return;const u=(0,v._getStatsigGlobal)(),d=(i=u.instances)!==null&&i!==void 0?i:{},C=e;d[r]!=null&&m.Log.warn("Creating multiple Statsig clients with the same SDK key can lead to unexpected behavior. Multi-instance support requires different SDK keys."),d[r]=C,u.firstInstance||(u.firstInstance=C),u.instances=d,__STATSIG__=u}return ge}var Ue={},gn;function Xn(){return gn||(gn=1,Object.defineProperty(Ue,"__esModule",{value:!0}),Ue.DataAdapterCachePrefix=void 0,Ue.DataAdapterCachePrefix="statsig.cached"),Ue}var gt={},fn;function Yn(){return fn||(fn=1,Object.defineProperty(gt,"__esModule",{value:!0})),gt}var j={},vn;function Zn(){if(vn)return j;vn=1,Object.defineProperty(j,"__esModule",{value:!0}),j._makeTypedGet=j._mergeOverride=j._makeLayer=j._makeExperiment=j._makeDynamicConfig=j._makeFeatureGate=void 0;const t=P(),v=St();function _(a,l,n,o){var s;return{name:a,details:l,ruleID:(s=n?.rule_id)!==null&&s!==void 0?s:"",__evaluation:n,value:o}}function E(a,l,n){var o;return Object.assign(Object.assign({},_(a,l,n,n?.value===!0)),{idType:(o=n?.id_type)!==null&&o!==void 0?o:null})}j._makeFeatureGate=E;function m(a,l,n){var o,s;const r=(o=n?.value)!==null&&o!==void 0?o:{};return Object.assign(Object.assign({},_(a,l,n,r)),{idType:(s=n?.id_type)!==null&&s!==void 0?s:null,get:S(a,n?.value)})}j._makeDynamicConfig=m;function g(a,l,n){var o;const s=m(a,l,n);return Object.assign(Object.assign({},s),{groupName:(o=n?.group_name)!==null&&o!==void 0?o:null})}j._makeExperiment=g;function h(a,l,n,o){var s,r;return Object.assign(Object.assign({},_(a,l,n,void 0)),{get:S(a,n?.value,o),groupName:(s=n?.group_name)!==null&&s!==void 0?s:null,__value:(r=n?.value)!==null&&r!==void 0?r:{}})}j._makeLayer=h;function p(a,l,n,o){return Object.assign(Object.assign(Object.assign({},a),l),{get:S(a.name,n,o)})}j._mergeOverride=p;function S(a,l,n){return(o,s)=>{var r;const e=(r=l?.[o])!==null&&r!==void 0?r:null;return e==null?s??null:s!=null&&!(0,v._isTypeMatch)(e,s)?(t.Log.warn(`Parameter type mismatch. '${a}.${o}' was found to be type '${typeof e}' but fallback/return type is '${typeof s}'. See https://docs.statsig.com/client/javascript-sdk/#typed-getters`),s??null):(n?.(o),e)}}return j._makeTypedGet=S,j}var ft={},mn;function er(){return mn||(mn=1,Object.defineProperty(ft,"__esModule",{value:!0})),ft}var fe={},Sn;function tr(){if(Sn)return fe;Sn=1,Object.defineProperty(fe,"__esModule",{value:!0}),fe.UPDATE_DETAIL_ERROR_MESSAGES=fe.createUpdateDetails=void 0;const t=(v,_,E,m,g,h)=>({duration:E,source:_,success:v,error:m,sourceUrl:g,warnings:h});return fe.createUpdateDetails=t,fe.UPDATE_DETAIL_ERROR_MESSAGES={NO_NETWORK_DATA:"No data was returned from the network. This may be due to a network timeout if a timeout value was specified in the options or ad blocker error."},fe}var yn;function nr(){return yn||(yn=1,(function(t){var v=ie&&ie.__createBinding||(Object.create?(function(a,l,n,o){o===void 0&&(o=n);var s=Object.getOwnPropertyDescriptor(l,n);(!s||("get"in s?!l.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return l[n]}}),Object.defineProperty(a,o,s)}):(function(a,l,n,o){o===void 0&&(o=n),a[o]=l[n]})),_=ie&&ie.__exportStar||function(a,l){for(var n in a)n!=="default"&&!Object.prototype.hasOwnProperty.call(l,n)&&v(l,a,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.Storage=t.Log=t.EventLogger=t.Diagnostics=void 0,ve();const E=ve(),m=vt();Object.defineProperty(t,"Diagnostics",{enumerable:!0,get:function(){return m.Diagnostics}});const g=Dn();Object.defineProperty(t,"EventLogger",{enumerable:!0,get:function(){return g.EventLogger}});const h=P();Object.defineProperty(t,"Log",{enumerable:!0,get:function(){return h.Log}});const p=Ne(),S=Y();Object.defineProperty(t,"Storage",{enumerable:!0,get:function(){return S.Storage}}),_(ve(),t),_(Ve(),t),_(Kn(),t),_($n(),t),_(vt(),t),_(xn(),t),_(Tn(),t),_(Gn(),t),_(zn(),t),_(me(),t),_(Vn(),t),_(P(),t),_(Mn(),t),_(je(),t),_(bn(),t),_(Qn(),t),_(Jn(),t),_(V(),t),_(Qe(),t),_(qe(),t),_(Wn(),t),_(Ke(),t),_(Hn(),t),_(pn(),t),_(Xn(),t),_(wn(),t),_(Ne(),t),_($e(),t),_(Yn(),t),_(Zn(),t),_(er(),t),_(On(),t),_(Y(),t),_(In(),t),_(St(),t),_(Cn(),t),_(yt(),t),_(Be(),t),_(tr(),t),_(En(),t),Object.assign((0,E._getStatsigGlobal)(),{Log:h.Log,SDK_VERSION:p.SDK_VERSION})})(ie)),ie}exports.requireSrc=nr;
@@ -0,0 +1 @@
1
+ "use strict";const y=require("./vendor-@statsig-client-core-CcuuGlfw.cjs");var S={},D={},O={},I={},R;function V(){if(R)return I;R=1,Object.defineProperty(I,"__esModule",{value:!0}),I.V1InitializeContainer=void 0;const v=y.requireSrc();let u=class{constructor(c){this._values=c}getGate(c){return this._getResultFromLookup(this._values.feature_gates,c)}getConfig(c){return this._getResultFromLookup(this._values.dynamic_configs,c)}getLayer(c){return this._getResultFromLookup(this._values.layer_configs,c)}getParamStore(c){return this._getResultFromLookup(this._values.param_stores,c)}getConfigList(){return Object.keys(this._values.dynamic_configs)}getExposureMapping(){return this._values.exposures}_getResultFromLookup(c,g){var a,r;return c&&(r=(a=c[g])!==null&&a!==void 0?a:c[(0,v._DJB2)(g)])!==null&&r!==void 0?r:null}};return I.V1InitializeContainer=u,I}var C={},z;function G(){if(z)return C;z=1,Object.defineProperty(C,"__esModule",{value:!0}),C.V2InitializeContainer=void 0;const v=y.requireSrc();let u=class{constructor(c){this._values=c}getGate(c){var g,a,r;const n=this._getResultFromLookup(this._values.feature_gates,c);return n?{name:c,value:n.v===!0,rule_id:(g=n.r)!==null&&g!==void 0?g:"default",secondary_exposures:(a=n.s)!==null&&a!==void 0?a:[],id_type:(r=n.i)!==null&&r!==void 0?r:""}:null}getConfig(c){var g,a,r,n;const t=this._getResultFromLookup(this._values.dynamic_configs,c);return t?{name:c,value:(g=this._values.values[t.v])!==null&&g!==void 0?g:{},rule_id:t.r,secondary_exposures:(a=t.s)!==null&&a!==void 0?a:[],id_type:(r=t.i)!==null&&r!==void 0?r:"",is_user_in_experiment:t.ue===!0,passed:t.p===!0,group_name:(n=t.gn)!==null&&n!==void 0?n:void 0,is_experiment_active:t.ea===!0,group:t.r,is_device_based:t.i==="stableID"}:null}getLayer(c){var g,a,r,n,t,i;const e=this._getResultFromLookup(this._values.layer_configs,c);return e?{name:c,value:(g=this._values.values[e.v])!==null&&g!==void 0?g:{},rule_id:e.r,secondary_exposures:(a=e.s)!==null&&a!==void 0?a:[],is_user_in_experiment:e.ue===!0,group_name:(r=e.gn)!==null&&r!==void 0?r:void 0,is_experiment_active:e.ea===!0,group:e.r,is_device_based:e.i==="stableID",allocated_experiment_name:(n=e.ae)!==null&&n!==void 0?n:"",explicit_parameters:(t=e.ep)!==null&&t!==void 0?t:[],undelegated_secondary_exposures:(i=e.us)!==null&&i!==void 0?i:[],parameter_rule_ids:e.pr}:null}getParamStore(c){return this._getResultFromLookup(this._values.param_stores,c)}getConfigList(){return Object.keys(this._values.dynamic_configs)}getExposureMapping(){return this._values.exposures}_getResultFromLookup(c,g){var a,r;return c&&(r=(a=c[g])!==null&&a!==void 0?a:c[(0,v._DJB2)(g)])!==null&&r!==void 0?r:null}};return C.V2InitializeContainer=u,C}var A;function B(){if(A)return O;A=1,Object.defineProperty(O,"__esModule",{value:!0});const v=y.requireSrc(),u=V(),f=G();let c=class{constructor(a,r){this._sdkKey=a,this._options=r,this._valuesForExternalUse=null,this._values=null,this._source="Uninitialized",this._lcut=0,this._receivedAt=0,this._bootstrapMetadata=null,this._warnings=new Set}reset(){this._values=null,this._valuesForExternalUse=null,this._source="Loading",this._lcut=0,this._receivedAt=0,this._bootstrapMetadata=null,this._warnings.clear()}finalize(){this._values||(this._source="NoValues")}getValues(){return this._valuesForExternalUse}setValues(a,r){var n,t;if(!a)return!1;const i=(0,v._typedJsonParse)(a.data,"has_updates","EvaluationResponse");return i==null?!1:(this._source=a.source,i?.has_updates!==!0||((n=i.time)!==null&&n!==void 0?n:0)<this._lcut||(this._valuesForExternalUse=(0,v._typedJsonParse)(a.data,"has_updates","EvaluationResponse"),this._lcut=i.time,this._receivedAt=a.receivedAt,i.response_format==="init-v2"?this._values=new f.V2InitializeContainer(i):this._values=new u.V1InitializeContainer(i),this._bootstrapMetadata=this._extractBootstrapMetadata(a.source,i),a.source&&i.user&&this._setWarningState(r,i),v.SDKFlags.setFlags(this._sdkKey,(t=i.sdk_flags)!==null&&t!==void 0?t:{})),!0)}getWarnings(){if(this._warnings.size!==0)return Array.from(this._warnings)}getGate(a){const r=this._values?this._values.getGate(a):null;return this._getDetailedStoreResult(r)}getConfig(a){const r=this._values?this._values.getConfig(a):null;return this._getDetailedStoreResult(r)}getConfigList(){return this._values?this._values.getConfigList():[]}getLayer(a){const r=this._values?this._values.getLayer(a):null;return this._getDetailedStoreResult(r)}getParamStore(a){const r=this._values?this._values.getParamStore(a):null;return this._getDetailedStoreResult(r)}getSource(){return this._source}getExposureMapping(){var a;return(a=this._values)===null||a===void 0?void 0:a.getExposureMapping()}_extractBootstrapMetadata(a,r){if(a!=="Bootstrap")return null;const n={};return r.user&&(n.user=r.user),r.sdkInfo&&(n.generatorSDKInfo=r.sdkInfo),n.lcut=r.time,n}_getDetailedStoreResult(a){return{result:a,details:this._getDetails(a==null)}}_setWarningState(a,r){var n,t,i;const e=v.StableID.get(this._sdkKey);if(((n=a.customIDs)===null||n===void 0?void 0:n.stableID)!==e&&(!((t=a.customIDs)===null||t===void 0)&&t.stableID||e)){this._warnings.add("StableIDMismatch");return}if("user"in r){let s=r.user,o=Object.assign(Object.assign({},a),{analyticsOnlyMetadata:void 0,privateAttributes:void 0});!((i=this._options)===null||i===void 0)&&i.disableStableID&&(o=Object.assign(Object.assign({},o),{customIDs:Object.assign(Object.assign({},o.customIDs),{stableID:void 0})}),s=Object.assign(Object.assign({},s),{customIDs:Object.assign(Object.assign({},s.customIDs),{stableID:void 0})})),(0,v._getFullUserHash)(o)!==(0,v._getFullUserHash)(s)&&this._warnings.add("PartialUserMatch")}}getCurrentSourceDetails(){if(this._source==="Uninitialized"||this._source==="NoValues")return{reason:this._source};const a={reason:this._source,lcut:this._lcut,receivedAt:this._receivedAt};return this._warnings.size>0&&(a.warnings=Array.from(this._warnings)),a}_getDetails(a){var r,n;const t=this.getCurrentSourceDetails();let i=t.reason;const e=(r=t.warnings)!==null&&r!==void 0?r:[];this._source==="Bootstrap"&&e.length>0&&(i=i+e[0]),i!=="Uninitialized"&&i!=="NoValues"&&(i=`${i}:${a?"Unrecognized":"Recognized"}`);const s=this._source==="Bootstrap"&&(n=this._bootstrapMetadata)!==null&&n!==void 0?n:void 0;return s&&(t.bootstrapMetadata=s),Object.assign(Object.assign({},t),{reason:i})}};return O.default=c,O}var E={},x={},k;function $(){if(k)return x;k=1,Object.defineProperty(x,"__esModule",{value:!0}),x._resolveDeltasResponse=void 0;const v=y.requireSrc(),u=2;function f(r,n){const t=(0,v._typedJsonParse)(n,"checksum","DeltasEvaluationResponse");if(!t)return{hadBadDeltaChecksum:!0};const i=c(r,t),e=g(i),s=(0,v._DJB2Object)({feature_gates:e.feature_gates,dynamic_configs:e.dynamic_configs,layer_configs:e.layer_configs},u);return s===t.checksumV2?JSON.stringify(e):{hadBadDeltaChecksum:!0,badChecksum:s,badMergedConfigs:e,badFullResponse:t.deltas_full_response}}x._resolveDeltasResponse=f;function c(r,n){return Object.assign(Object.assign(Object.assign({},r),n),{feature_gates:Object.assign(Object.assign({},r.feature_gates),n.feature_gates),layer_configs:Object.assign(Object.assign({},r.layer_configs),n.layer_configs),dynamic_configs:Object.assign(Object.assign({},r.dynamic_configs),n.dynamic_configs)})}function g(r){const n=r;return a(r.deleted_gates,n.feature_gates),delete n.deleted_gates,a(r.deleted_configs,n.dynamic_configs),delete n.deleted_configs,a(r.deleted_layers,n.layer_configs),delete n.deleted_layers,n}function a(r,n){r?.forEach(t=>{delete n[t]})}return x}var L;function q(){if(L)return E;L=1;var v=E&&E.__awaiter||function(g,a,r,n){function t(i){return i instanceof r?i:new r(function(e){e(i)})}return new(r||(r=Promise))(function(i,e){function s(l){try{_(n.next(l))}catch(d){e(d)}}function o(l){try{_(n.throw(l))}catch(d){e(d)}}function _(l){l.done?i(l.value):t(l.value).then(s,o)}_((n=n.apply(g,a||[])).next())})};Object.defineProperty(E,"__esModule",{value:!0});const u=y.requireSrc(),f=$();class c extends u.NetworkCore{constructor(a,r){super(a,r);const n=a?.networkConfig;this._option=a,this._initializeUrlConfig=new u.UrlConfiguration(u.Endpoint._initialize,n?.initializeUrl,n?.api,n?.initializeFallbackUrls)}fetchEvaluations(a,r,n,t,i){return v(this,void 0,void 0,function*(){var e,s,o,_,l,d;const h=r?(0,u._typedJsonParse)(r,"has_updates","InitializeResponse"):null;let p={user:t,hash:(o=(s=(e=this._option)===null||e===void 0?void 0:e.networkConfig)===null||s===void 0?void 0:s.initializeHashAlgorithm)!==null&&o!==void 0?o:"djb2",deltasResponseRequested:!1,full_checksum:null};if(h?.has_updates){const m=h?.hash_used!==((d=(l=(_=this._option)===null||_===void 0?void 0:_.networkConfig)===null||l===void 0?void 0:l.initializeHashAlgorithm)!==null&&d!==void 0?d:"djb2");p=Object.assign(Object.assign({},p),{sinceTime:i&&!m?h.time:0,previousDerivedFields:"derived_fields"in h&&i?h.derived_fields:{},deltasResponseRequested:!0,full_checksum:h.full_checksum,partialUserMatchSinceTime:m?0:h.time})}return this._fetchEvaluations(a,h,p,n)})}_fetchEvaluations(a,r,n,t){return v(this,void 0,void 0,function*(){var i,e;const s=yield this.post({sdkKey:a,urlConfig:this._initializeUrlConfig,data:n,retries:2,isStatsigEncodable:!0,priority:t});if(s?.code===204)return'{"has_updates": false}';if(s?.code!==200)return(i=s?.body)!==null&&i!==void 0?i:null;if(r?.has_updates!==!0||((e=s.body)===null||e===void 0?void 0:e.includes('"is_delta":true'))!==!0||n.deltasResponseRequested!==!0)return s.body;const o=(0,f._resolveDeltasResponse)(r,s.body);return typeof o=="string"?o:this._fetchEvaluations(a,r,Object.assign(Object.assign(Object.assign({},n),o),{deltasResponseRequested:!1}),t)})}}return E.default=c,E}var U={},M;function K(){if(M)return U;M=1,Object.defineProperty(U,"__esModule",{value:!0}),U._makeParamStoreGetter=void 0;const v=y.requireSrc(),u={disableExposureLog:!0};function f(e){return e==null||e.disableExposureLog===!1}function c(e,s){return s!=null&&!(0,v._isTypeMatch)(e,s)}function g(e,s){return e.value}function a(e,s,o){return e.getFeatureGate(s.gate_name,f(o)?void 0:u).value?s.pass_value:s.fail_value}function r(e,s,o,_){const d=e.getDynamicConfig(s.config_name,f(_)?void 0:u).get(s.param_name);return c(d,o)?o:d}function n(e,s,o,_){const d=e.getExperiment(s.experiment_name,f(_)?void 0:u).get(s.param_name);return c(d,o)?o:d}function t(e,s,o,_){const d=e.getLayer(s.layer_name,f(_)?void 0:u).get(s.param_name);return c(d,o)?o:d}function i(e,s,o){return(_,l)=>{if(s==null)return l;const d=s[_];if(d==null||l!=null&&(0,v._typeOf)(l)!==d.param_type)return l;switch(d.ref_type){case"static":return g(d);case"gate":return a(e,d,o);case"dynamic_config":return r(e,d,l,o);case"experiment":return n(e,d,l,o);case"layer":return t(e,d,l,o);default:return l}}}return U._makeParamStoreGetter=i,U}var b={},j;function N(){if(j)return b;j=1;var v=b&&b.__awaiter||function(g,a,r,n){function t(i){return i instanceof r?i:new r(function(e){e(i)})}return new(r||(r=Promise))(function(i,e){function s(l){try{_(n.next(l))}catch(d){e(d)}}function o(l){try{_(n.throw(l))}catch(d){e(d)}}function _(l){l.done?i(l.value):t(l.value).then(s,o)}_((n=n.apply(g,a||[])).next())})};Object.defineProperty(b,"__esModule",{value:!0}),b.StatsigEvaluationsDataAdapter=void 0;const u=y.requireSrc(),f=q();let c=class extends u.DataAdapterCore{constructor(){super("EvaluationsDataAdapter","evaluations"),this._network=null,this._options=null}attach(a,r,n){super.attach(a,r,n),n!==null&&n instanceof f.default?this._network=n:this._network=new f.default(r??{})}getDataAsync(a,r,n){return this._getDataAsyncImpl(a,(0,u._normalizeUser)(r,this._options),n)}prefetchData(a,r){return this._prefetchDataImpl(a,r)}setData(a){const r=(0,u._typedJsonParse)(a,"has_updates","data");r&&"user"in r?super.setData(a,r.user):u.Log.error("StatsigUser not found. You may be using an older server SDK version. Please upgrade your SDK or use setDataLegacy.")}setDataLegacy(a,r){super.setData(a,r)}_fetchFromNetwork(a,r,n,t){return v(this,void 0,void 0,function*(){var i;const e=yield(i=this._network)===null||i===void 0?void 0:i.fetchEvaluations(this._getSdkKey(),a,n?.priority,r,t);return e??null})}_getCacheKey(a){var r;const n=(0,u._getStorageKey)(this._getSdkKey(),a,(r=this._options)===null||r===void 0?void 0:r.customUserCacheKeyFunc);return`${u.DataAdapterCachePrefix}.${this._cacheSuffix}.${n}`}_isCachedResultValidFor204(a,r){return a.fullUserHash!=null&&a.fullUserHash===(0,u._getFullUserHash)(r)}};return b.StatsigEvaluationsDataAdapter=c,b}var P;function T(){if(P)return D;P=1;var v=D&&D.__awaiter||function(n,t,i,e){function s(o){return o instanceof i?o:new i(function(_){_(o)})}return new(i||(i=Promise))(function(o,_){function l(p){try{h(e.next(p))}catch(m){_(m)}}function d(p){try{h(e.throw(p))}catch(m){_(m)}}function h(p){p.done?o(p.value):s(p.value).then(l,d)}h((e=e.apply(n,t||[])).next())})};Object.defineProperty(D,"__esModule",{value:!0});const u=y.requireSrc(),f=B(),c=q(),g=K(),a=N();let r=class w extends u.StatsigClientBase{static instance(t){const i=(0,u._getStatsigGlobal)().instance(t);return i instanceof w?i:(u.Log.warn((0,u._isServerEnv)()?"StatsigClient.instance is not supported in server environments":"Unable to find StatsigClient instance"),new w(t??"",{}))}constructor(t,i,e=null){var s,o;u.SDKType._setClientType(t,"javascript-client");const _=new c.default(e,d=>{this.$emt(d)});super(t,(s=e?.dataAdapter)!==null&&s!==void 0?s:new a.StatsigEvaluationsDataAdapter,_,e),this._possibleFirstTouchMetadata={},this.getFeatureGate=this._memoize(u.MemoPrefix._gate,this._getFeatureGateImpl.bind(this)),this.getDynamicConfig=this._memoize(u.MemoPrefix._dynamicConfig,this._getDynamicConfigImpl.bind(this)),this.getExperiment=this._memoize(u.MemoPrefix._experiment,this._getExperimentImpl.bind(this)),this.getConfigList=this._memoize(u.MemoPrefix._configList,this._getConfigListImpl.bind(this)),this.getLayer=this._memoize(u.MemoPrefix._layer,this._getLayerImpl.bind(this)),this.getParameterStore=this._memoize(u.MemoPrefix._paramStore,this._getParameterStoreImpl.bind(this)),this._store=new f.default(t,e??null),this._network=_,this._user=this._configureUser(i,e),this._sdkInstanceID=(0,u.getUUID)(),this._contextHandle=new u.PrecomputedEvaluationsContextHandle(t,()=>this._options,()=>this._errorBoundary,()=>this._store.getValues(),()=>this._user,()=>this._sdkInstanceID);const l=(o=e?.plugins)!==null&&o!==void 0?o:[];for(const d of l)d.bind(this)}initializeSync(t){var i;return this.loadingStatus!=="Uninitialized"?(0,u.createUpdateDetails)(!0,this._store.getSource(),-1,null,null,["MultipleInitializations",...(i=this._store.getWarnings())!==null&&i!==void 0?i:[]]):(this._logger.start(),this.updateUserSync(this._user,t))}initializeAsync(t){return v(this,void 0,void 0,function*(){return this._initializePromise?this._initializePromise:(this._initializePromise=this._initializeAsyncImpl(t),this._initializePromise)})}updateUserSync(t,i){const e=performance.now();try{return this._updateUserSyncImpl(t,i,e)}catch(s){const o=s instanceof Error?s:new Error(String(s));return this._createErrorUpdateDetails(o,e)}}_updateUserSyncImpl(t,i,e){var s;const o=[...(s=this._store.getWarnings())!==null&&s!==void 0?s:[]];this._resetForUser(t);const _=this.dataAdapter.getDataSync(this._user);_==null&&o.push("NoCachedValues"),this._store.setValues(_,this._user),this._finalizeUpdate(_);const l=i?.disableBackgroundCacheRefresh;return l===!0||l==null&&_?.source==="Bootstrap"?(0,u.createUpdateDetails)(!0,this._store.getSource(),performance.now()-e,this._errorBoundary.getLastSeenErrorAndReset(),this._network.getLastUsedInitUrlAndReset(),o):(this._runPostUpdate(_??null,this._user),(0,u.createUpdateDetails)(!0,this._store.getSource(),performance.now()-e,this._errorBoundary.getLastSeenErrorAndReset(),this._network.getLastUsedInitUrlAndReset(),o))}updateUserAsync(t,i){return v(this,void 0,void 0,function*(){const e=performance.now();try{return yield this._updateUserAsyncImpl(t,i)}catch(s){const o=s instanceof Error?s:new Error(String(s));return this._createErrorUpdateDetails(o,e)}})}_updateUserAsyncImpl(t,i){return v(this,void 0,void 0,function*(){this._resetForUser(t);const e=this._user;u.Diagnostics._markInitOverallStart(this._sdkKey);let s=this.dataAdapter.getDataSync(e);if(this._store.setValues(s,this._user),this._setStatus("Loading",s),s=yield this.dataAdapter.getDataAsync(s,e,i),e!==this._user)return(0,u.createUpdateDetails)(!1,this._store.getSource(),-1,new Error("User changed during update"),this._network.getLastUsedInitUrlAndReset());let o=!1;s!=null&&(u.Diagnostics._markInitProcessStart(this._sdkKey),o=this._store.setValues(s,this._user),u.Diagnostics._markInitProcessEnd(this._sdkKey,{success:o})),this._finalizeUpdate(s),o||(this._errorBoundary.attachErrorIfNoneExists(u.UPDATE_DETAIL_ERROR_MESSAGES.NO_NETWORK_DATA),this.$emt({name:"initialization_failure"})),u.Diagnostics._markInitOverallEnd(this._sdkKey,o,this._store.getCurrentSourceDetails());const _=u.Diagnostics._enqueueDiagnosticsEvent(this._user,this._logger,this._sdkKey,this._options);return(0,u.createUpdateDetails)(o,this._store.getSource(),_,this._errorBoundary.getLastSeenErrorAndReset(),this._network.getLastUsedInitUrlAndReset(),this._store.getWarnings())})}getContext(){let t=(0,u._cloneObject)("StatsigUser",this._user);return t==null&&(u.Log.error("Failed to clone user"),t={}),{sdkKey:this._sdkKey,options:this._options,values:this._store.getValues(),user:t,errorBoundary:this._errorBoundary,session:u.StatsigSession.get(this._sdkKey),stableID:u.StableID.get(this._sdkKey),sdkInstanceID:this._sdkInstanceID}}getContextHandle(){return this._contextHandle}checkGate(t,i){return this.getFeatureGate(t,i).value}logEvent(t,i,e){const s=typeof t=="string"?{eventName:t,value:i,metadata:e}:t;this.$emt({name:"log_event_called",event:s}),this._logger.enqueue(Object.assign(Object.assign({},s),{user:this._user,time:Date.now()}))}updateUserWithAnalyticsOnlyMetadata(t){this._user=this._configureUser(Object.assign(Object.assign({},this._user),{analyticsOnlyMetadata:t}),this._options)}_primeReadyRipcord(){this.$on("error",()=>{this.loadingStatus==="Loading"&&this._finalizeUpdate(null)})}_initializeAsyncImpl(t){return v(this,void 0,void 0,function*(){return u.Storage.isReady()||(yield u.Storage.isReadyResolver()),this._logger.start(),this.updateUserAsync(this._user,t)})}_createErrorUpdateDetails(t,i){var e;return(0,u.createUpdateDetails)(!1,this._store.getSource(),performance.now()-i,t,null,[...(e=this._store.getWarnings())!==null&&e!==void 0?e:[]])}_finalizeUpdate(t){this._store.finalize(),this._setStatus("Ready",t)}_runPostUpdate(t,i){this.dataAdapter.getDataAsync(t,i,{priority:"low"}).catch(e=>{u.Log.error("An error occurred after update.",e)})}_resetForUser(t){this._logger.reset(),this._store.reset(),this._user=this._configureUser(t,this._options)}_configureUser(t,i){var e,s,o;const _=(0,u._normalizeUser)(t,i),l=(e=_.customIDs)===null||e===void 0?void 0:e.stableID;if(l){const d=(o=(s=this.storageProvider).isReadyResolver)===null||o===void 0?void 0:o.call(s);d?d.then(()=>u.StableID.setOverride(l,this._sdkKey),()=>u.StableID.setOverride(l,this._sdkKey)):u.StableID.setOverride(l,this._sdkKey)}return Object.keys(this._possibleFirstTouchMetadata).length>0&&(_.analyticsOnlyMetadata=Object.assign(Object.assign({},_.analyticsOnlyMetadata),this._possibleFirstTouchMetadata)),_}_getFeatureGateImpl(t,i){var e,s;const{result:o,details:_}=this._store.getGate(t);this._checkUserHasIdForEvaluation(o?.id_type,t,"Gate"),this._checkInitializationStatus(_.reason);const l=(0,u._makeFeatureGate)(t,_,o),d=(s=(e=this.overrideAdapter)===null||e===void 0?void 0:e.getGateOverride)===null||s===void 0?void 0:s.call(e,l,this._user,i),h=d??l;return this._enqueueExposure(t,(0,u._createGateExposure)(this._user,h,this._store.getExposureMapping()),i),this.$emt({name:"gate_evaluation",gate:h}),h}_getDynamicConfigImpl(t,i){var e,s;const{result:o,details:_}=this._store.getConfig(t);this._checkUserHasIdForEvaluation(o?.id_type,t,"Dynamic config"),this._checkInitializationStatus(_.reason);const l=(0,u._makeDynamicConfig)(t,_,o),d=(s=(e=this.overrideAdapter)===null||e===void 0?void 0:e.getDynamicConfigOverride)===null||s===void 0?void 0:s.call(e,l,this._user,i),h=d??l;return this._enqueueExposure(t,(0,u._createConfigExposure)(this._user,h,this._store.getExposureMapping()),i),this.$emt({name:"dynamic_config_evaluation",dynamicConfig:h}),h}_getExperimentImpl(t,i){var e,s,o,_;const{result:l,details:d}=this._store.getConfig(t);this._checkUserHasIdForEvaluation(l?.id_type,t,"Experiment"),this._checkInitializationStatus(d.reason);const h=(0,u._makeExperiment)(t,d,l);h.__evaluation!=null&&(h.__evaluation.secondary_exposures=(0,u._mapExposures)((s=(e=h.__evaluation)===null||e===void 0?void 0:e.secondary_exposures)!==null&&s!==void 0?s:[],this._store.getExposureMapping()));const p=(_=(o=this.overrideAdapter)===null||o===void 0?void 0:o.getExperimentOverride)===null||_===void 0?void 0:_.call(o,h,this._user,i),m=p??h;return this._enqueueExposure(t,(0,u._createConfigExposure)(this._user,m,this._store.getExposureMapping()),i),this.$emt({name:"experiment_evaluation",experiment:m}),m}_getConfigListImpl(){return this._store.getConfigList()}_getLayerImpl(t,i){var e,s,o;const{result:_,details:l}=this._store.getLayer(t),d=(0,u._makeLayer)(t,l,_),h=(s=(e=this.overrideAdapter)===null||e===void 0?void 0:e.getLayerOverride)===null||s===void 0?void 0:s.call(e,d,this._user,i);i?.disableExposureLog&&this._logger.incrementNonExposureCount(t);const p=(0,u._mergeOverride)(d,h,(o=h?.__value)!==null&&o!==void 0?o:d.__value,m=>{i?.disableExposureLog||this._enqueueExposure(t,(0,u._createLayerParameterExposure)(this._user,p,m,this._store.getExposureMapping()),i)});return this.$emt({name:"layer_evaluation",layer:p}),p}_getParameterStoreImpl(t,i){var e,s;const{result:o,details:_}=this._store.getParamStore(t);this._logger.incrementNonExposureCount(t);const l={name:t,details:_,__configuration:o,get:(0,g._makeParamStoreGetter)(this,o,i)},d=(s=(e=this.overrideAdapter)===null||e===void 0?void 0:e.getParamStoreOverride)===null||s===void 0?void 0:s.call(e,l,i);return d!=null&&(l.__configuration=d.config,l.details=d.details,l.get=(0,g._makeParamStoreGetter)(this,d.config,i)),l}_checkUserHasIdForEvaluation(t,i,e){t&&((0,u._getUnitIDFromUser)(this._user,t)||u.Log.warn(`The user does not have the required id_type "${t}" for ${e} "${i}"`))}_checkInitializationStatus(t){(t==="Uninitialized"||t.startsWith("Loading"))&&u.Log.warn(`SDK initialization has not completed. Reason: ${t}`)}};return D.default=r,D}var F;function H(){return F||(F=1,(function(v){var u=S&&S.__createBinding||(Object.create?(function(r,n,t,i){i===void 0&&(i=t);var e=Object.getOwnPropertyDescriptor(n,t);(!e||("get"in e?!n.__esModule:e.writable||e.configurable))&&(e={enumerable:!0,get:function(){return n[t]}}),Object.defineProperty(r,i,e)}):(function(r,n,t,i){i===void 0&&(i=t),r[i]=n[t]})),f=S&&S.__exportStar||function(r,n){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(n,t)&&u(n,r,t)};Object.defineProperty(v,"__esModule",{value:!0}),v.StatsigClient=void 0;const c=y.requireSrc(),g=T();v.StatsigClient=g.default,f(y.requireSrc(),v);const a=Object.assign((0,c._getStatsigGlobal)(),{StatsigClient:g.default});v.default=a})(S)),S}exports.requireSrc=H;
@@ -0,0 +1 @@
1
+ "use strict";const v=require("./vendor-@statsig-client-core-CcuuGlfw.cjs"),p=require("react"),le=require("./vendor-react-CzqSQR9J.cjs"),$=require("./vendor-@statsig-js-client-C6n1oYZG.cjs");var h={},G={},E={},K;function U(){if(K)return E;K=1,Object.defineProperty(E,"__esModule",{value:!0}),E.isNoopClient=E.NoopEvaluationsClient=void 0;const e=v.requireSrc(),s={success:!1,error:Error("NoClient"),duration:0,source:"Uninitialized",sourceUrl:null},i=()=>{},c=()=>s,o=()=>Promise.resolve(),t=()=>Promise.resolve(s),n={reason:"Error:NoClient"},a=l=>(...g)=>{const _=typeof g[0]=="string"?g[0]:g[1];switch(l){case"gate":return(0,e._makeFeatureGate)(_,n,null);case"config":return(0,e._makeDynamicConfig)(_,n,null);case"layer":return(0,e._makeLayer)(_,n,null);case"param_store":return{name:_}}},r={attach:i,getDataSync:()=>null,getDataAsync:()=>Promise.resolve(null),setData:i,setDataLegacy:i,prefetchData:o},d={sdkKey:"",options:{},values:null,user:{userID:""},errorBoundary:{},session:{data:{sessionID:"",startTime:0,lastUpdate:0},sdkKey:"",lastPersistedAt:0,storageKey:""},stableID:"",storageProvider:e.Storage,sdkInstanceID:""},u=new e.PrecomputedEvaluationsContextHandle("",()=>({}),()=>({}),()=>null,()=>({userID:""}),()=>""),y={isNoop:!0,loadingStatus:"Uninitialized",initializeSync:c,initializeAsync:t,shutdown:o,flush:o,updateRuntimeOptions:i,updateUserSync:c,updateUserAsync:t,getContext:()=>Object.assign({},d),getContextHandle:()=>u,checkGate:()=>!1,getFeatureGate:a("gate"),getDynamicConfig:a("config"),getExperiment:a("config"),getLayer:a("layer"),getParameterStore:a("param_store"),logEvent:i,on:i,off:i,$on:i,$emt:i,dataAdapter:r};E.NoopEvaluationsClient=y;function S(l){return"isNoop"in l}return E.isNoopClient=S,E}var z;function b(){if(z)return G;z=1,Object.defineProperty(G,"__esModule",{value:!0});const e=p,s=U();return G.default=(0,e.createContext)({renderVersion:0,client:s.NoopEvaluationsClient,isLoading:!0}),G}var A={},O={},F={},T;function se(){if(T)return F;T=1,Object.defineProperty(F,"__esModule",{value:!0}),F.useStatsigInternalClientFactoryAsync=void 0;const e=p,s=v.requireSrc();function i(c,o){const t=(0,e.useMemo)(()=>{var r;return(r=(0,s._getInstance)(o.sdkKey))!==null&&r!==void 0?r:c(o)},[]),[n,a]=(0,e.useState)(t.loadingStatus!=="Ready");return(0,e.useMemo)(()=>{t.loadingStatus!=="Ready"&&t.initializeAsync().catch(s.Log.error).finally(()=>a(!1))},[]),{client:t,isLoading:n}}return F.useStatsigInternalClientFactoryAsync=i,F}var H;function oe(){if(H)return O;H=1,Object.defineProperty(O,"__esModule",{value:!0}),O.useClientAsyncInit=void 0;const e=$.requireSrc(),s=se();function i(c,o,t=null){return(0,s.useStatsigInternalClientFactoryAsync)(n=>new e.StatsigClient(n.sdkKey,n.initialUser,n.statsigOptions),{sdkKey:c,initialUser:o,statsigOptions:t})}return O.useClientAsyncInit=i,O}var J;function de(){if(J)return A;J=1,Object.defineProperty(A,"__esModule",{value:!0}),A.StatsigProvider=void 0;const e=le.requireJsxRuntime(),s=p,i=v.requireSrc(),c=b(),o=oe();function t(u){return"client"in u?(("sdkKey"in u||"user"in u)&&i.Log.warn("Both client and configuration props (sdkKey, user) were provided to StatsigProvider. The client prop will be used and the configuration props will be ignored."),(0,e.jsx)(a,Object.assign({},u))):(0,e.jsx)(n,Object.assign({},u))}A.StatsigProvider=t;function n(u){const[y,S]=(0,s.useState)(0),l=(0,o.useClientAsyncInit)(u.sdkKey,u.user,u.options).client,[g,_]=(0,s.useState)(!d(l));r(l,S,_);const I=(0,s.useMemo)(()=>({renderVersion:y,client:l,isLoading:g}),[y,l,g]);return(0,e.jsx)(c.default.Provider,{value:I,children:u.loadingComponent==null||!I.isLoading?u.children:u.loadingComponent})}function a(u){const[y,S]=(0,s.useState)(0),l=u.client,[g,_]=(0,s.useState)(!d(l));r(l,S,_);const I=(0,s.useMemo)(()=>({renderVersion:y,client:l,isLoading:g}),[y,l,g]);return(0,e.jsx)(c.default.Provider,{value:I,children:u.loadingComponent==null||!I.isLoading?u.children:u.loadingComponent})}function r(u,y,S){(0,s.useEffect)(()=>{const l=()=>{y(g=>g+1),S(!d(u))};return i.SDKType._setBindingType("react"),u.$on("values_updated",l),()=>{u.flush().catch(g=>i.Log.error("An error occurred during flush",g)),u.off("values_updated",l)}},[u,y])}function d(u){return"isNoop"in u||u.loadingStatus==="Ready"}return A}var L={},B={},W;function ue(){if(W)return B;W=1,Object.defineProperty(B,"__esModule",{value:!0}),B.useStatsigInternalClientFactoryBootstrap=void 0;const e=p,s=v.requireSrc();function i(c,o){const t=(0,e.useRef)((0,s._getInstance)(o.sdkKey));return(0,e.useMemo)(()=>{if(t.current)return t.current;const n=c(o);return t.current=n,o.useLegacyFormat?n.dataAdapter.setDataLegacy(o.initialValues,o.initialUser):n.dataAdapter.setData(o.initialValues),n.initializeSync(),n},[])}return B.useStatsigInternalClientFactoryBootstrap=i,B}var Q;function fe(){if(Q)return L;Q=1,Object.defineProperty(L,"__esModule",{value:!0}),L.useClientBootstrapInit=void 0;const e=$.requireSrc(),s=ue();function i(c,o,t,n=null,a){return(0,s.useStatsigInternalClientFactoryBootstrap)(r=>new e.StatsigClient(r.sdkKey,r.initialUser,r.statsigOptions),{sdkKey:c,initialUser:o,initialValues:t,statsigOptions:n,useLegacyFormat:a})}return L.useClientBootstrapInit=i,L}var R={},X;function ge(){if(X)return R;X=1,Object.defineProperty(R,"__esModule",{value:!0});const e=p,s=v.requireSrc(),i=U(),c=b();function o(t,n){const{client:a,renderVersion:r}=(0,e.useContext)(c.default);return(0,e.useMemo)(()=>(0,i.isNoopClient)(a)?(s.Log.warn(`useDynamicConfig hook failed to find a valid StatsigClient for dynamic config '${t}'.`),i.NoopEvaluationsClient.getDynamicConfig(t,n)):a.getDynamicConfig(t,n),[t,a,r,...n?Object.values(n):[]])}return R.default=o,R}var k={},Y;function Ce(){if(Y)return k;Y=1,Object.defineProperty(k,"__esModule",{value:!0});const e=p,s=v.requireSrc(),i=U(),c=b();function o(t,n){const{client:a,renderVersion:r}=(0,e.useContext)(c.default);return(0,e.useMemo)(()=>(0,i.isNoopClient)(a)?(s.Log.warn(`useExperiment hook failed to find a valid Statsig client for experiment '${t}'.`),i.NoopEvaluationsClient.getExperiment(t,n)):a.getExperiment(t,n),[t,a,r,...n?Object.values(n):[]])}return k.default=o,k}var x={},Z;function ye(){if(Z)return x;Z=1,Object.defineProperty(x,"__esModule",{value:!0});const e=p,s=v.requireSrc(),i=U(),c=b();function o(t,n){const{client:a,renderVersion:r}=(0,e.useContext)(c.default);return(0,e.useMemo)(()=>(0,i.isNoopClient)(a)?(s.Log.warn(`useFeatureGate hook failed to find a valid StatsigClient for gate '${t}'.`),i.NoopEvaluationsClient.getFeatureGate(t,n)):a.getFeatureGate(t,n),[t,a,r,...n?Object.values(n):[]])}return x.default=o,x}var V={},ee;function _e(){if(ee)return V;ee=1,Object.defineProperty(V,"__esModule",{value:!0});const e=p,s=v.requireSrc(),i=U(),c=b();function o(t,n){const{client:a,renderVersion:r}=(0,e.useContext)(c.default);return(0,e.useMemo)(()=>(0,i.isNoopClient)(a)?(s.Log.warn(`useGateValue hook failed to find a valid StatsigClient for gate '${t}'.`),i.NoopEvaluationsClient.checkGate(t,n)):a.checkGate(t,n),[t,a,r,...n?Object.values(n):[]])}return V.default=o,V}var w={},te;function Se(){if(te)return w;te=1,Object.defineProperty(w,"__esModule",{value:!0});const e=p,s=v.requireSrc(),i=U(),c=b();function o(t,n){const{client:a,renderVersion:r}=(0,e.useContext)(c.default);return(0,e.useMemo)(()=>(0,i.isNoopClient)(a)?(s.Log.warn(`useLayer hook failed to find a valid Statsig client for layer '${t}'.`),i.NoopEvaluationsClient.getLayer(t,n)):a.getLayer(t,n),[t,a,r,...n?Object.values(n):[]])}return w.default=o,w}var N={},ne;function ve(){if(ne)return N;ne=1,Object.defineProperty(N,"__esModule",{value:!0});const e=p,s=v.requireSrc(),i=U(),c=b();function o(t,n){const{client:a,renderVersion:r}=(0,e.useContext)(c.default);return(0,e.useMemo)(()=>(0,i.isNoopClient)(a)?(s.Log.warn(`useParameterStore hook failed to find a valid StatsigClient for parameter store '${t}'.`),i.NoopEvaluationsClient.getParameterStore(t,n)):a.getParameterStore(t,n),[t,a,r,...n?Object.values(n):[]])}return N.default=o,N}var D={},re;function ce(){if(re)return D;re=1,Object.defineProperty(D,"__esModule",{value:!0}),D.useStatsigClient=void 0;const e=p,s=v.requireSrc(),i=U(),c=b();function o(){const{client:t,renderVersion:n,isLoading:a}=(0,e.useContext)(c.default),r=(0,e.useMemo)(()=>(0,i.isNoopClient)(t)?(s.Log.warn("Attempting to retrieve a StatsigClient but none was set."),i.NoopEvaluationsClient):t,[t,n]),d=[r,n],u=(0,e.useCallback)((C,f)=>r.checkGate(C,f),d),y=(0,e.useCallback)((C,f)=>r.getFeatureGate(C,f),d),S=(0,e.useCallback)((C,f)=>r.getDynamicConfig(C,f),d),l=(0,e.useCallback)((C,f)=>r.getExperiment(C,f),d),g=(0,e.useCallback)((C,f)=>r.getLayer(C,f),d),_=(0,e.useCallback)((C,f)=>r.getParameterStore(C,f),d),I=(0,e.useCallback)((C,f,m)=>typeof C=="string"?r.logEvent(C,f,m):r.logEvent(C),d);return(0,e.useMemo)(()=>({client:r,checkGate:u,getFeatureGate:y,getDynamicConfig:S,getExperiment:l,getLayer:g,getParameterStore:_,logEvent:I,isLoading:a}),[r,u,y,S,l,g,_,I,a])}return D.useStatsigClient=o,D}var M={},ie;function pe(){if(ie)return M;ie=1,Object.defineProperty(M,"__esModule",{value:!0}),M.useStatsigUser=void 0;const e=p,s=b(),i=ce();function c(t){return t.getContextHandle().user}function o(){const{client:t}=(0,i.useStatsigClient)(),{renderVersion:n}=(0,e.useContext)(s.default);return{user:(0,e.useMemo)(()=>c(t),[t,n]),updateUserSync:(0,e.useCallback)(r=>(typeof r=="function"&&(r=r(c(t))),t.updateUserSync(r)),[t]),updateUserAsync:(0,e.useCallback)(r=>(typeof r=="function"&&(r=r(c(t))),t.updateUserAsync(r)),[t])}}return M.useStatsigUser=o,M}var ae;function Ie(){return ae||(ae=1,(function(e){var s=h&&h.__createBinding||(Object.create?(function(f,m,P,q){q===void 0&&(q=P);var j=Object.getOwnPropertyDescriptor(m,P);(!j||("get"in j?!m.__esModule:j.writable||j.configurable))&&(j={enumerable:!0,get:function(){return m[P]}}),Object.defineProperty(f,q,j)}):(function(f,m,P,q){q===void 0&&(q=P),f[q]=m[P]})),i=h&&h.__exportStar||function(f,m){for(var P in f)P!=="default"&&!Object.prototype.hasOwnProperty.call(m,P)&&s(m,f,P)};Object.defineProperty(e,"__esModule",{value:!0}),e.useStatsigUser=e.useStatsigInternalClientFactoryBootstrap=e.useStatsigInternalClientFactoryAsync=e.useStatsigClient=e.useParameterStore=e.useLayer=e.useGateValue=e.useFeatureGate=e.useExperiment=e.useDynamicConfig=e.useClientBootstrapInit=e.useClientAsyncInit=e.StatsigProvider=e.StatsigContext=void 0;const c=v.requireSrc(),o=b();e.StatsigContext=o.default;const t=de();Object.defineProperty(e,"StatsigProvider",{enumerable:!0,get:function(){return t.StatsigProvider}});const n=oe();Object.defineProperty(e,"useClientAsyncInit",{enumerable:!0,get:function(){return n.useClientAsyncInit}});const a=fe();Object.defineProperty(e,"useClientBootstrapInit",{enumerable:!0,get:function(){return a.useClientBootstrapInit}});const r=ge();e.useDynamicConfig=r.default;const d=Ce();e.useExperiment=d.default;const u=ye();e.useFeatureGate=u.default;const y=_e();e.useGateValue=y.default;const S=Se();e.useLayer=S.default;const l=ve();e.useParameterStore=l.default;const g=ce();Object.defineProperty(e,"useStatsigClient",{enumerable:!0,get:function(){return g.useStatsigClient}});const _=se();Object.defineProperty(e,"useStatsigInternalClientFactoryAsync",{enumerable:!0,get:function(){return _.useStatsigInternalClientFactoryAsync}});const I=ue();Object.defineProperty(e,"useStatsigInternalClientFactoryBootstrap",{enumerable:!0,get:function(){return I.useStatsigInternalClientFactoryBootstrap}});const C=pe();Object.defineProperty(e,"useStatsigUser",{enumerable:!0,get:function(){return C.useStatsigUser}}),i($.requireSrc(),e),Object.assign((0,c._getStatsigGlobal)(),{StatsigContext:o.default,StatsigProvider:t.StatsigProvider,useClientAsyncInit:n.useClientAsyncInit,useClientBootstrapInit:a.useClientBootstrapInit,useDynamicConfig:r.default,useExperiment:d.default,useFeatureGate:u.default,useGateValue:y.default,useLayer:S.default,useParameterStore:l.default,useStatsigClient:g.useStatsigClient,useStatsigInternalClientFactoryAsync:_.useStatsigInternalClientFactoryAsync,useStatsigInternalClientFactoryBootstrap:I.useStatsigInternalClientFactoryBootstrap,useStatsigUser:C.useStatsigUser})})(h)),h}var me=Ie();exports.srcExports=me;
@@ -0,0 +1,8 @@
1
+ "use strict";function c(o){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?c=function(r){return typeof r}:c=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},c(o)}var w="https://js.stripe.com/v3",m=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,v="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used",h=function(){for(var r=document.querySelectorAll('script[src^="'.concat(w,'"]')),e=0;e<r.length;e++){var t=r[e];if(m.test(t.src))return t}return null},p=function(r){var e=r&&!r.advancedFraudSignals?"?advancedFraudSignals=false":"",t=document.createElement("script");t.src="".concat(w).concat(e);var n=document.head||document.body;if(!n)throw new Error("Expected document.body not to be null. Stripe.js requires a <body> element.");return n.appendChild(t),t},E=function(r,e){!r||!r._registerWrapper||r._registerWrapper({name:"stripe-js",version:"4.6.0",startTime:e})},l=null,u=null,d=null,b=function(r){return function(){r(new Error("Failed to load Stripe.js"))}},g=function(r,e){return function(){window.Stripe?r(window.Stripe):e(new Error("Stripe.js not available"))}},L=function(r){return l!==null?l:(l=new Promise(function(e,t){if(typeof window>"u"||typeof document>"u"){e(null);return}if(window.Stripe&&r&&console.warn(v),window.Stripe){e(window.Stripe);return}try{var n=h();if(n&&r)console.warn(v);else if(!n)n=p(r);else if(n&&d!==null&&u!==null){var i;n.removeEventListener("load",d),n.removeEventListener("error",u),(i=n.parentNode)===null||i===void 0||i.removeChild(n),n=p(r)}d=g(e,t),u=b(t),n.addEventListener("load",d),n.addEventListener("error",u)}catch(a){t(a);return}}),l.catch(function(e){return l=null,Promise.reject(e)}))},P=function(r,e,t){if(r===null)return null;var n=r.apply(void 0,e);return E(n,t),n},S=function(r){var e=`invalid load parameters; expected object of shape
2
+
3
+ {advancedFraudSignals: boolean}
4
+
5
+ but received
6
+
7
+ `.concat(JSON.stringify(r),`
8
+ `);if(r===null||c(r)!=="object")throw new Error(e);if(Object.keys(r).length===1&&typeof r.advancedFraudSignals=="boolean")return r;throw new Error(e)},f,s=!1,y=function(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];s=!0;var n=Date.now();return L(f).then(function(i){return P(i,e,n)})};y.setLoadParameters=function(o){if(s&&f){var r=S(o),e=Object.keys(r),t=e.reduce(function(n,i){var a;return n&&o[i]===((a=f)===null||a===void 0?void 0:a[i])},!0);if(t)return}if(s)throw new Error("You cannot change load parameters after calling loadStripe");f=S(o)};exports.loadStripe=y;
@@ -0,0 +1 @@
1
+ "use strict";const h=typeof self=="object"?self:globalThis,w=(n,o)=>{switch(n){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+n)}return new h[n](o)},O=(n,o)=>{const s=(t,f)=>(n.set(f,t),t),u=t=>{if(n.has(t))return n.get(t);const[f,r]=o[t];switch(f){case 0:case-1:return s(r,t);case 1:{const e=s([],t);for(const c of r)e.push(u(c));return e}case 2:{const e=s({},t);for(const[c,I]of r)e[u(c)]=u(I);return e}case 3:return s(new Date(r),t);case 4:{const{source:e,flags:c}=r;return s(new RegExp(e,c),t)}case 5:{const e=s(new Map,t);for(const[c,I]of r)e.set(u(c),u(I));return e}case 6:{const e=s(new Set,t);for(const c of r)e.add(u(c));return e}case 7:{const{name:e,message:c}=r;return s(w(e,c),t)}case 8:return s(BigInt(r),t);case"BigInt":return s(Object(BigInt(r)),t);case"ArrayBuffer":return s(new Uint8Array(r).buffer,r);case"DataView":{const{buffer:e}=new Uint8Array(r);return s(new DataView(e),r)}}return s(w(f,r),t)};return u},p=n=>O(new Map,n)(0),R="",{toString:b}={},{keys:S}=Object,A=n=>{const o=typeof n;if(o!=="object"||!n)return[0,o];const s=b.call(n).slice(8,-1);switch(s){case"Array":return[1,R];case"Object":return[2,R];case"Date":return[3,R];case"RegExp":return[4,R];case"Map":return[5,R];case"Set":return[6,R];case"DataView":return[1,s]}return s.includes("Array")?[1,s]:s.includes("Error")?[7,s]:[2,s]},y=([n,o])=>n===0&&(o==="function"||o==="symbol"),B=(n,o,s,u)=>{const t=(r,e)=>{const c=u.push(r)-1;return s.set(e,c),c},f=r=>{if(s.has(r))return s.get(r);let[e,c]=A(r);switch(e){case 0:{let a=r;switch(c){case"bigint":e=8,a=r.toString();break;case"function":case"symbol":if(n)throw new TypeError("unable to serialize "+c);a=null;break;case"undefined":return t([-1],r)}return t([e,a],r)}case 1:{if(c){let i=r;return c==="DataView"?i=new Uint8Array(r.buffer):c==="ArrayBuffer"&&(i=new Uint8Array(r)),t([c,[...i]],r)}const a=[],E=t([e,a],r);for(const i of r)a.push(f(i));return E}case 2:{if(c)switch(c){case"BigInt":return t([c,r.toString()],r);case"Boolean":case"Number":case"String":return t([c,r.valueOf()],r)}if(o&&"toJSON"in r)return f(r.toJSON());const a=[],E=t([e,a],r);for(const i of S(r))(n||!y(A(r[i])))&&a.push([f(i),f(r[i])]);return E}case 3:return t([e,r.toISOString()],r);case 4:{const{source:a,flags:E}=r;return t([e,{source:a,flags:E}],r)}case 5:{const a=[],E=t([e,a],r);for(const[i,T]of r)(n||!(y(A(i))||y(A(T))))&&a.push([f(i),f(T)]);return E}case 6:{const a=[],E=t([e,a],r);for(const i of r)(n||!y(A(i)))&&a.push(f(i));return E}}const{message:I}=r;return t([e,{name:c,message:I}],r)};return f},g=(n,{json:o,lossy:s}={})=>{const u=[];return B(!(o||s),!!o,new Map,u)(n),u},P=typeof structuredClone=="function"?(n,o)=>o&&("json"in o||"lossy"in o)?p(g(n,o)):structuredClone(n):(n,o)=>p(g(n,o));exports.structuredClone=P;
@@ -0,0 +1 @@
1
+ "use strict";const s=require("./vendor-big.js-BfsYTtpv.cjs"),l=require("./vendor-lodash-CNz95YDD.cjs"),y={sortKey:"description",sortOrder:"ascending"},u=r=>{if(r.length===0)return;const n=r[0].amount;if(n?.currencyCode==null||n?.currencySymbol==null)return;let t=0;for(const e of r)t+=e.amount?.amount??0;return{amount:t,currencyCode:n.currencyCode,currencySymbol:n.currencySymbol}},f=r=>{const n=[],t=[];for(const e of r)e.postingType==="debit"?n.push(e):e.postingType==="credit"&&t.push(e);return{debitTotal:u(n),creditTotal:u(t)}},a=.005,m=(r,n)=>{let t=new s.Big(0),e=new s.Big(0);for(const i of r){const c=new s.Big(i.amount?.amount??0);i.postingType==="debit"?t=t.plus(c):i.postingType==="credit"&&(e=e.plus(c))}const o=t.minus(e).abs().lt(a),d=t.minus(n).abs().lt(a);return{debitTotal:t.toNumber(),creditTotal:e.toNumber(),isBalanced:o&&d}},p=r=>r==="descending"?"desc":"asc",b=(r,n,t)=>{const e=o=>{switch(n.sortKey){case"description":return t.description(o).toLowerCase();case"name":return t.name(o).toLowerCase();case"category":return t.category(o).toLowerCase();case"class":return t.class(o).toLowerCase();case"debit":return t.debit(o);case"credit":return t.credit(o);default:return t.description(o).toLowerCase()}};return l.orderBy([...r],[e],[p(n.sortOrder)])};exports.journalEntryDefaultSortConfig=y;exports.journalEntrySplitReconciliation=m;exports.journalEntryTotalsByPostingSide=f;exports.sortJournalEntryLines=b;
@@ -0,0 +1 @@
1
+ "use strict";const M=require("./vendor-react-CzqSQR9J.cjs");var O={exports:{}},X=O.exports,q;function Y(){return q||(q=1,(function(U,w){(function(c,s){U.exports=s()})(X,(()=>{return c={772:(n,e,t)=>{const r=t(826).remove,h=/[.*+?^${}()|[\]\\]/g,u=/[a-z0-9_]/i,l=/\s+/;n.exports=function(i,R,x){var g,m;m={insideWords:!1,findAllOccurrences:!1,requireMatchAll:!1},g=(g=x)||{},Object.keys(g).forEach((o=>{m[o]=!!g[o]})),x=m;const I=Array.from(i).map((o=>r(o)));let p=I.join("");return(R=r(R)).trim().split(l).filter((o=>o.length>0)).reduce(((o,f)=>{const A=f.length,b=!x.insideWords&&u.test(f[0])?"\\b":"",j=new RegExp(b+f.replace(h,"\\$&"),"i");let E,a;if(E=j.exec(p),x.requireMatchAll&&E===null)return p="",[];for(;E;){a=E.index;const k=A-I.slice(a,a+A).join("").length,y=a-I.slice(0,a).join("").length,d=[a+y,a+A+y+k];if(d[0]!==d[1]&&o.push(d),p=p.slice(0,a)+new Array(A+1).join(" ")+p.slice(a+A),!x.findAllOccurrences)break;E=j.exec(p)}return o}),[]).sort(((o,f)=>o[0]-f[0]))}},826:n=>{var e={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",Ấ:"A",Ắ:"A",Ẳ:"A",Ẵ:"A",Ặ:"A",Æ:"AE",Ầ:"A",Ằ:"A",Ȃ:"A",Ç:"C",Ḉ:"C",È:"E",É:"E",Ê:"E",Ë:"E",Ế:"E",Ḗ:"E",Ề:"E",Ḕ:"E",Ḝ:"E",Ȇ:"E",Ì:"I",Í:"I",Î:"I",Ï:"I",Ḯ:"I",Ȋ:"I",Ð:"D",Ñ:"N",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",Ố:"O",Ṍ:"O",Ṓ:"O",Ȏ:"O",Ù:"U",Ú:"U",Û:"U",Ü:"U",Ý:"Y",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",ấ:"a",ắ:"a",ẳ:"a",ẵ:"a",ặ:"a",æ:"ae",ầ:"a",ằ:"a",ȃ:"a",ç:"c",ḉ:"c",è:"e",é:"e",ê:"e",ë:"e",ế:"e",ḗ:"e",ề:"e",ḕ:"e",ḝ:"e",ȇ:"e",ì:"i",í:"i",î:"i",ï:"i",ḯ:"i",ȋ:"i",ð:"d",ñ:"n",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",ố:"o",ṍ:"o",ṓ:"o",ȏ:"o",ù:"u",ú:"u",û:"u",ü:"u",ý:"y",ÿ:"y",Ā:"A",ā:"a",Ă:"A",ă:"a",Ą:"A",ą:"a",Ć:"C",ć:"c",Ĉ:"C",ĉ:"c",Ċ:"C",ċ:"c",Č:"C",č:"c",C̆:"C",c̆:"c",Ď:"D",ď:"d",Đ:"D",đ:"d",Ē:"E",ē:"e",Ĕ:"E",ĕ:"e",Ė:"E",ė:"e",Ę:"E",ę:"e",Ě:"E",ě:"e",Ĝ:"G",Ǵ:"G",ĝ:"g",ǵ:"g",Ğ:"G",ğ:"g",Ġ:"G",ġ:"g",Ģ:"G",ģ:"g",Ĥ:"H",ĥ:"h",Ħ:"H",ħ:"h",Ḫ:"H",ḫ:"h",Ĩ:"I",ĩ:"i",Ī:"I",ī:"i",Ĭ:"I",ĭ:"i",Į:"I",į:"i",İ:"I",ı:"i",IJ:"IJ",ij:"ij",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",Ḱ:"K",ḱ:"k",K̆:"K",k̆:"k",Ĺ:"L",ĺ:"l",Ļ:"L",ļ:"l",Ľ:"L",ľ:"l",Ŀ:"L",ŀ:"l",Ł:"l",ł:"l",Ḿ:"M",ḿ:"m",M̆:"M",m̆:"m",Ń:"N",ń:"n",Ņ:"N",ņ:"n",Ň:"N",ň:"n",ʼn:"n",N̆:"N",n̆:"n",Ō:"O",ō:"o",Ŏ:"O",ŏ:"o",Ő:"O",ő:"o",Œ:"OE",œ:"oe",P̆:"P",p̆:"p",Ŕ:"R",ŕ:"r",Ŗ:"R",ŗ:"r",Ř:"R",ř:"r",R̆:"R",r̆:"r",Ȓ:"R",ȓ:"r",Ś:"S",ś:"s",Ŝ:"S",ŝ:"s",Ş:"S",Ș:"S",ș:"s",ş:"s",Š:"S",š:"s",Ţ:"T",ţ:"t",ț:"t",Ț:"T",Ť:"T",ť:"t",Ŧ:"T",ŧ:"t",T̆:"T",t̆:"t",Ũ:"U",ũ:"u",Ū:"U",ū:"u",Ŭ:"U",ŭ:"u",Ů:"U",ů:"u",Ű:"U",ű:"u",Ų:"U",ų:"u",Ȗ:"U",ȗ:"u",V̆:"V",v̆:"v",Ŵ:"W",ŵ:"w",Ẃ:"W",ẃ:"w",X̆:"X",x̆:"x",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Y̆:"Y",y̆:"y",Ź:"Z",ź:"z",Ż:"Z",ż:"z",Ž:"Z",ž:"z",ſ:"s",ƒ:"f",Ơ:"O",ơ:"o",Ư:"U",ư:"u",Ǎ:"A",ǎ:"a",Ǐ:"I",ǐ:"i",Ǒ:"O",ǒ:"o",Ǔ:"U",ǔ:"u",Ǖ:"U",ǖ:"u",Ǘ:"U",ǘ:"u",Ǚ:"U",ǚ:"u",Ǜ:"U",ǜ:"u",Ứ:"U",ứ:"u",Ṹ:"U",ṹ:"u",Ǻ:"A",ǻ:"a",Ǽ:"AE",ǽ:"ae",Ǿ:"O",ǿ:"o",Þ:"TH",þ:"th",Ṕ:"P",ṕ:"p",Ṥ:"S",ṥ:"s",X́:"X",x́:"x",Ѓ:"Г",ѓ:"г",Ќ:"К",ќ:"к",A̋:"A",a̋:"a",E̋:"E",e̋:"e",I̋:"I",i̋:"i",Ǹ:"N",ǹ:"n",Ồ:"O",ồ:"o",Ṑ:"O",ṑ:"o",Ừ:"U",ừ:"u",Ẁ:"W",ẁ:"w",Ỳ:"Y",ỳ:"y",Ȁ:"A",ȁ:"a",Ȅ:"E",ȅ:"e",Ȉ:"I",ȉ:"i",Ȍ:"O",ȍ:"o",Ȑ:"R",ȑ:"r",Ȕ:"U",ȕ:"u",B̌:"B",b̌:"b",Č̣:"C",č̣:"c",Ê̌:"E",ê̌:"e",F̌:"F",f̌:"f",Ǧ:"G",ǧ:"g",Ȟ:"H",ȟ:"h",J̌:"J",ǰ:"j",Ǩ:"K",ǩ:"k",M̌:"M",m̌:"m",P̌:"P",p̌:"p",Q̌:"Q",q̌:"q",Ř̩:"R",ř̩:"r",Ṧ:"S",ṧ:"s",V̌:"V",v̌:"v",W̌:"W",w̌:"w",X̌:"X",x̌:"x",Y̌:"Y",y̌:"y",A̧:"A",a̧:"a",B̧:"B",b̧:"b",Ḑ:"D",ḑ:"d",Ȩ:"E",ȩ:"e",Ɛ̧:"E",ɛ̧:"e",Ḩ:"H",ḩ:"h",I̧:"I",i̧:"i",Ɨ̧:"I",ɨ̧:"i",M̧:"M",m̧:"m",O̧:"O",o̧:"o",Q̧:"Q",q̧:"q",U̧:"U",u̧:"u",X̧:"X",x̧:"x",Z̧:"Z",z̧:"z"},t=Object.keys(e).join("|"),r=new RegExp(t,"g"),h=new RegExp(t,""),u=function(l){return l.replace(r,(function(i){return e[i]}))};n.exports=u,n.exports.has=function(l){return!!l.match(h)},n.exports.remove=u}},s={},(function n(e){var t=s[e];if(t!==void 0)return t.exports;var r=s[e]={exports:{}};return c[e](r,r.exports,n),r.exports})(772);var c,s}))})(O)),O.exports}var N=Y();const P=M.getDefaultExportFromCjs(N);var v={exports:{}},S=v.exports,C;function T(){return C||(C=1,(function(U,w){(function(c,s){U.exports=s()})(S,(()=>{return c={705:n=>{n.exports=function(e,t){const r=[];return t.length===0?r.push({text:e,highlight:!1}):t[0][0]>0&&r.push({text:e.slice(0,t[0][0]),highlight:!1}),t.forEach(((h,u)=>{const l=h[0],i=h[1];r.push({text:e.slice(l,i),highlight:!0}),u===t.length-1?i<e.length&&r.push({text:e.slice(i,e.length),highlight:!1}):i<t[u+1][0]&&r.push({text:e.slice(i,t[u+1][0]),highlight:!1})})),r}}},s={},(function n(e){var t=s[e];if(t!==void 0)return t.exports;var r=s[e]={exports:{}};return c[e](r,r.exports,n),r.exports})(705);var c,s}))})(v)),v.exports}var W=T();const z=M.getDefaultExportFromCjs(W);exports.match=P;exports.parse=z;
@@ -0,0 +1 @@
1
+ "use strict";function t(i){if(i)throw i}exports.bail=t;
@@ -0,0 +1 @@
1
+ "use strict";var O=20,S=1,p=1e6,j=1e6,_=-7,U=21,V=!1,M="[big.js] ",b=M+"Invalid ",B=b+"decimal places",L=b+"rounding mode",m=M+"Division by zero",h={},w=void 0,T=/^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i;function q(){function r(e){var t=this;if(!(t instanceof r))return e===w&&arguments.length===0?q():new r(e);if(e instanceof r)t.s=e.s,t.e=e.e,t.c=e.c.slice();else{if(typeof e!="string"){if(r.strict===!0&&typeof e!="bigint")throw TypeError(b+"value");e=e===0&&1/e<0?"-0":String(e)}z(t,e)}t.constructor=r}return r.prototype=h,r.DP=O,r.RM=S,r.NE=_,r.PE=U,r.strict=V,r.roundDown=0,r.roundHalfUp=1,r.roundHalfEven=2,r.roundUp=3,r}function z(r,e){var t,n,i;if(!T.test(e))throw Error(b+"number");for(r.s=e.charAt(0)=="-"?(e=e.slice(1),-1):1,(t=e.indexOf("."))>-1&&(e=e.replace(".","")),(n=e.search(/e/i))>0?(t<0&&(t=n),t+=+e.slice(n+1),e=e.substring(0,n)):t<0&&(t=e.length),i=e.length,n=0;n<i&&e.charAt(n)=="0";)++n;if(n==i)r.c=[r.e=0];else{for(;i>0&&e.charAt(--i)=="0";);for(r.e=t-n-1,r.c=[],t=0;n<=i;)r.c[t++]=+e.charAt(n++)}return r}function D(r,e,t,n){var i=r.c;if(t===w&&(t=r.constructor.RM),t!==0&&t!==1&&t!==2&&t!==3)throw Error(L);if(e<1)n=t===3&&(n||!!i[0])||e===0&&(t===1&&i[0]>=5||t===2&&(i[0]>5||i[0]===5&&(n||i[1]!==w))),i.length=1,n?(r.e=r.e-e+1,i[0]=1):i[0]=r.e=0;else if(e<i.length){if(n=t===1&&i[e]>=5||t===2&&(i[e]>5||i[e]===5&&(n||i[e+1]!==w||i[e-1]&1))||t===3&&(n||!!i[0]),i.length=e,n){for(;++i[--e]>9;)if(i[e]=0,e===0){++r.e,i.unshift(1);break}}for(e=i.length;!i[--e];)i.pop()}return r}function P(r,e,t){var n=r.e,i=r.c.join(""),s=i.length;if(e)i=i.charAt(0)+(s>1?"."+i.slice(1):"")+(n<0?"e":"e+")+n;else if(n<0){for(;++n;)i="0"+i;i="0."+i}else if(n>0)if(++n>s)for(n-=s;n--;)i+="0";else n<s&&(i=i.slice(0,n)+"."+i.slice(n));else s>1&&(i=i.charAt(0)+"."+i.slice(1));return r.s<0&&t?"-"+i:i}h.abs=function(){var r=new this.constructor(this);return r.s=1,r};h.cmp=function(r){var e,t=this,n=t.c,i=(r=new t.constructor(r)).c,s=t.s,u=r.s,o=t.e,f=r.e;if(!n[0]||!i[0])return n[0]?s:i[0]?-u:0;if(s!=u)return s;if(e=s<0,o!=f)return o>f^e?1:-1;for(u=(o=n.length)<(f=i.length)?o:f,s=-1;++s<u;)if(n[s]!=i[s])return n[s]>i[s]^e?1:-1;return o==f?0:o>f^e?1:-1};h.div=function(r){var e=this,t=e.constructor,n=e.c,i=(r=new t(r)).c,s=e.s==r.s?1:-1,u=t.DP;if(u!==~~u||u<0||u>p)throw Error(B);if(!i[0])throw Error(m);if(!n[0])return r.s=s,r.c=[r.e=0],r;var o,f,c,v,l,E=i.slice(),A=o=i.length,k=n.length,a=n.slice(0,o),g=a.length,x=r,R=x.c=[],I=0,N=u+(x.e=e.e-r.e)+1;for(x.s=s,s=N<0?0:N,E.unshift(0);g++<o;)a.push(0);do{for(c=0;c<10;c++){if(o!=(g=a.length))v=o>g?1:-1;else for(l=-1,v=0;++l<o;)if(i[l]!=a[l]){v=i[l]>a[l]?1:-1;break}if(v<0){for(f=g==o?i:E;g;){if(a[--g]<f[g]){for(l=g;l&&!a[--l];)a[l]=9;--a[l],a[g]+=10}a[g]-=f[g]}for(;!a[0];)a.shift()}else break}R[I++]=v?c:++c,a[0]&&v?a[g]=n[A]||0:a=[n[A]]}while((A++<k||a[0]!==w)&&s--);return!R[0]&&I!=1&&(R.shift(),x.e--,N--),I>N&&D(x,N,t.RM,a[0]!==w),x};h.eq=function(r){return this.cmp(r)===0};h.gt=function(r){return this.cmp(r)>0};h.gte=function(r){return this.cmp(r)>-1};h.lt=function(r){return this.cmp(r)<0};h.lte=function(r){return this.cmp(r)<1};h.minus=h.sub=function(r){var e,t,n,i,s=this,u=s.constructor,o=s.s,f=(r=new u(r)).s;if(o!=f)return r.s=-f,s.plus(r);var c=s.c.slice(),v=s.e,l=r.c,E=r.e;if(!c[0]||!l[0])return l[0]?r.s=-f:c[0]?r=new u(s):r.s=1,r;if(o=v-E){for((i=o<0)?(o=-o,n=c):(E=v,n=l),n.reverse(),f=o;f--;)n.push(0);n.reverse()}else for(t=((i=c.length<l.length)?c:l).length,o=f=0;f<t;f++)if(c[f]!=l[f]){i=c[f]<l[f];break}if(i&&(n=c,c=l,l=n,r.s=-r.s),(f=(t=l.length)-(e=c.length))>0)for(;f--;)c[e++]=0;for(f=e;t>o;){if(c[--t]<l[t]){for(e=t;e&&!c[--e];)c[e]=9;--c[e],c[t]+=10}c[t]-=l[t]}for(;c[--f]===0;)c.pop();for(;c[0]===0;)c.shift(),--E;return c[0]||(r.s=1,c=[E=0]),r.c=c,r.e=E,r};h.mod=function(r){var e,t=this,n=t.constructor,i=t.s,s=(r=new n(r)).s;if(!r.c[0])throw Error(m);return t.s=r.s=1,e=r.cmp(t)==1,t.s=i,r.s=s,e?new n(t):(i=n.DP,s=n.RM,n.DP=n.RM=0,t=t.div(r),n.DP=i,n.RM=s,this.minus(t.times(r)))};h.neg=function(){var r=new this.constructor(this);return r.s=-r.s,r};h.plus=h.add=function(r){var e,t,n,i=this,s=i.constructor;if(r=new s(r),i.s!=r.s)return r.s=-r.s,i.minus(r);var u=i.e,o=i.c,f=r.e,c=r.c;if(!o[0]||!c[0])return c[0]||(o[0]?r=new s(i):r.s=i.s),r;if(o=o.slice(),e=u-f){for(e>0?(f=u,n=c):(e=-e,n=o),n.reverse();e--;)n.push(0);n.reverse()}for(o.length-c.length<0&&(n=c,c=o,o=n),e=c.length,t=0;e;o[e]%=10)t=(o[--e]=o[e]+c[e]+t)/10|0;for(t&&(o.unshift(t),++f),e=o.length;o[--e]===0;)o.pop();return r.c=o,r.e=f,r};h.pow=function(r){var e=this,t=new e.constructor("1"),n=t,i=r<0;if(r!==~~r||r<-j||r>j)throw Error(b+"exponent");for(i&&(r=-r);r&1&&(n=n.times(e)),r>>=1,!!r;)e=e.times(e);return i?t.div(n):n};h.prec=function(r,e){if(r!==~~r||r<1||r>p)throw Error(b+"precision");return D(new this.constructor(this),r,e)};h.round=function(r,e){if(r===w)r=0;else if(r!==~~r||r<-p||r>p)throw Error(B);return D(new this.constructor(this),r+this.e+1,e)};h.sqrt=function(){var r,e,t,n=this,i=n.constructor,s=n.s,u=n.e,o=new i("0.5");if(!n.c[0])return new i(n);if(s<0)throw Error(M+"No square root");s=Math.sqrt(+P(n,!0,!0)),s===0||s===1/0?(e=n.c.join(""),e.length+u&1||(e+="0"),s=Math.sqrt(e),u=((u+1)/2|0)-(u<0||u&1),r=new i((s==1/0?"5e":(s=s.toExponential()).slice(0,s.indexOf("e")+1))+u)):r=new i(s+""),u=r.e+(i.DP+=4);do t=r,r=o.times(t.plus(n.div(t)));while(t.c.slice(0,u).join("")!==r.c.slice(0,u).join(""));return D(r,(i.DP-=4)+r.e+1,i.RM)};h.times=h.mul=function(r){var e,t=this,n=t.constructor,i=t.c,s=(r=new n(r)).c,u=i.length,o=s.length,f=t.e,c=r.e;if(r.s=t.s==r.s?1:-1,!i[0]||!s[0])return r.c=[r.e=0],r;for(r.e=f+c,u<o&&(e=i,i=s,s=e,c=u,u=o,o=c),e=new Array(c=u+o);c--;)e[c]=0;for(f=o;f--;){for(o=0,c=u+f;c>f;)o=e[c]+s[f]*i[c-f-1]+o,e[c--]=o%10,o=o/10|0;e[c]=o}for(o?++r.e:e.shift(),f=e.length;!e[--f];)e.pop();return r.c=e,r};h.toExponential=function(r,e){var t=this,n=t.c[0];if(r!==w){if(r!==~~r||r<0||r>p)throw Error(B);for(t=D(new t.constructor(t),++r,e);t.c.length<r;)t.c.push(0)}return P(t,!0,!!n)};h.toFixed=function(r,e){var t=this,n=t.c[0];if(r!==w){if(r!==~~r||r<0||r>p)throw Error(B);for(t=D(new t.constructor(t),r+t.e+1,e),r=r+t.e+1;t.c.length<r;)t.c.push(0)}return P(t,!1,!!n)};h.toJSON=h.toString=function(){var r=this,e=r.constructor;return P(r,r.e<=e.NE||r.e>=e.PE,!!r.c[0])};typeof Symbol<"u"&&(h[Symbol.for("nodejs.util.inspect.custom")]=h.toJSON);h.toNumber=function(){var r=+P(this,!0,!0);if(this.constructor.strict===!0&&!this.eq(r.toString()))throw Error(M+"Imprecise conversion");return r};h.toPrecision=function(r,e){var t=this,n=t.constructor,i=t.c[0];if(r!==w){if(r!==~~r||r<1||r>p)throw Error(b+"precision");for(t=D(new n(t),r,e);t.c.length<r;)t.c.push(0)}return P(t,r<=t.e||t.e<=n.NE||t.e>=n.PE,!!i)};h.valueOf=function(){var r=this,e=r.constructor;if(e.strict===!0)throw Error(M+"valueOf disallowed");return P(r,r.e<=e.NE||r.e>=e.PE,!0)};var C=q();exports.Big=C;
@@ -0,0 +1,20 @@
1
+ "use strict";function it(x,S){return S.forEach((function(D){D&&typeof D!="string"&&!Array.isArray(D)&&Object.keys(D).forEach((function(h){if(h!=="default"&&!(h in x)){var e=Object.getOwnPropertyDescriptor(D,h);Object.defineProperty(x,h,e.get?e:{enumerable:!0,get:function(){return D[h]}})}}))})),Object.freeze(x)}function qe(x,S){return new Promise((function(D,h){let e;return ot(x).then((function(t){try{return e=t,D(new Blob([S.slice(0,2),e,S.slice(2)],{type:"image/jpeg"}))}catch(u){return h(u)}}),h)}))}const ot=x=>new Promise(((S,D)=>{const h=new FileReader;h.addEventListener("load",(({target:{result:e}})=>{const t=new DataView(e);let u=0;if(t.getUint16(u)!==65496)return D("not a valid JPEG");for(u+=2;;){const f=t.getUint16(u);if(f===65498)break;const p=t.getUint16(u+2);if(f===65505&&t.getUint32(u+4)===1165519206){const y=u+10;let r;switch(t.getUint16(y)){case 18761:r=!0;break;case 19789:r=!1;break;default:return D("TIFF header contains invalid endian")}if(t.getUint16(y+2,r)!==42)return D("TIFF header contains invalid version");const i=t.getUint32(y+4,r),n=y+i+2+12*t.getUint16(y+i,r);for(let a=y+i+2;a<n;a+=12)if(t.getUint16(a,r)==274){if(t.getUint16(a+2,r)!==3)return D("Orientation data type is invalid");if(t.getUint32(a+4,r)!==1)return D("Orientation data count is invalid");t.setUint16(a+8,1,r);break}return S(e.slice(u,u+2+p))}u+=2+p}return S(new Blob)})),h.readAsArrayBuffer(x)}));var Te={},at={get exports(){return Te},set exports(x){Te=x}};(function(x){var S,D,h={};at.exports=h,h.parse=function(e,t){for(var u=h.bin.readUshort,f=h.bin.readUint,p=0,y={},r=new Uint8Array(e),i=r.length-4;f(r,i)!=101010256;)i--;p=i,p+=4;var n=u(r,p+=4);u(r,p+=2);var a=f(r,p+=2),d=f(r,p+=4);p+=4,p=d;for(var F=0;F<n;F++){f(r,p),p+=4,p+=4,p+=4,f(r,p+=4),a=f(r,p+=4);var C=f(r,p+=4),A=u(r,p+=4),H=u(r,p+2),T=u(r,p+4);p+=6;var I=f(r,p+=8);p+=4,p+=A+H+T,h._readLocal(r,I,y,a,C,t)}return y},h._readLocal=function(e,t,u,f,p,y){var r=h.bin.readUshort,i=h.bin.readUint;i(e,t),r(e,t+=4),r(e,t+=2);var n=r(e,t+=2);i(e,t+=2),i(e,t+=4),t+=4;var a=r(e,t+=8),d=r(e,t+=2);t+=2;var F=h.bin.readUTF8(e,t,a);if(t+=a,t+=d,y)u[F]={size:p,csize:f};else{var C=new Uint8Array(e.buffer,t);if(n==0)u[F]=new Uint8Array(C.buffer.slice(t,t+f));else{if(n!=8)throw"unknown compression method: "+n;var A=new Uint8Array(p);h.inflateRaw(C,A),u[F]=A}}},h.inflateRaw=function(e,t){return h.F.inflate(e,t)},h.inflate=function(e,t){return e[0],e[1],h.inflateRaw(new Uint8Array(e.buffer,e.byteOffset+2,e.length-6),t)},h.deflate=function(e,t){t==null&&(t={level:6});var u=0,f=new Uint8Array(50+Math.floor(1.1*e.length));f[u]=120,f[u+1]=156,u+=2,u=h.F.deflateRaw(e,f,u,t.level);var p=h.adler(e,0,e.length);return f[u+0]=p>>>24&255,f[u+1]=p>>>16&255,f[u+2]=p>>>8&255,f[u+3]=p>>>0&255,new Uint8Array(f.buffer,0,u+4)},h.deflateRaw=function(e,t){t==null&&(t={level:6});var u=new Uint8Array(50+Math.floor(1.1*e.length)),f=h.F.deflateRaw(e,u,f,t.level);return new Uint8Array(u.buffer,0,f)},h.encode=function(e,t){t==null&&(t=!1);var u=0,f=h.bin.writeUint,p=h.bin.writeUshort,y={};for(var r in e){var i=!h._noNeed(r)&&!t,n=e[r],a=h.crc.crc(n,0,n.length);y[r]={cpr:i,usize:n.length,crc:a,file:i?h.deflateRaw(n):n}}for(var r in y)u+=y[r].file.length+30+46+2*h.bin.sizeUTF8(r);u+=22;var d=new Uint8Array(u),F=0,C=[];for(var r in y){var A=y[r];C.push(F),F=h._writeHeader(d,F,r,A,0)}var H=0,T=F;for(var r in y)A=y[r],C.push(F),F=h._writeHeader(d,F,r,A,1,C[H++]);var I=F-T;return f(d,F,101010256),F+=4,p(d,F+=4,H),p(d,F+=2,H),f(d,F+=2,I),f(d,F+=4,T),F+=4,F+=2,d.buffer},h._noNeed=function(e){var t=e.split(".").pop().toLowerCase();return"png,jpg,jpeg,zip".indexOf(t)!=-1},h._writeHeader=function(e,t,u,f,p,y){var r=h.bin.writeUint,i=h.bin.writeUshort,n=f.file;return r(e,t,p==0?67324752:33639248),t+=4,p==1&&(t+=2),i(e,t,20),i(e,t+=2,0),i(e,t+=2,f.cpr?8:0),r(e,t+=2,0),r(e,t+=4,f.crc),r(e,t+=4,n.length),r(e,t+=4,f.usize),i(e,t+=4,h.bin.sizeUTF8(u)),i(e,t+=2,0),t+=2,p==1&&(t+=2,t+=2,r(e,t+=6,y),t+=4),t+=h.bin.writeUTF8(e,t,u),p==0&&(e.set(n,t),t+=n.length),t},h.crc={table:(function(){for(var e=new Uint32Array(256),t=0;t<256;t++){for(var u=t,f=0;f<8;f++)1&u?u=3988292384^u>>>1:u>>>=1;e[t]=u}return e})(),update:function(e,t,u,f){for(var p=0;p<f;p++)e=h.crc.table[255&(e^t[u+p])]^e>>>8;return e},crc:function(e,t,u){return 4294967295^h.crc.update(4294967295,e,t,u)}},h.adler=function(e,t,u){for(var f=1,p=0,y=t,r=t+u;y<r;){for(var i=Math.min(y+5552,r);y<i;)p+=f+=e[y++];f%=65521,p%=65521}return p<<16|f},h.bin={readUshort:function(e,t){return e[t]|e[t+1]<<8},writeUshort:function(e,t,u){e[t]=255&u,e[t+1]=u>>8&255},readUint:function(e,t){return 16777216*e[t+3]+(e[t+2]<<16|e[t+1]<<8|e[t])},writeUint:function(e,t,u){e[t]=255&u,e[t+1]=u>>8&255,e[t+2]=u>>16&255,e[t+3]=u>>24&255},readASCII:function(e,t,u){for(var f="",p=0;p<u;p++)f+=String.fromCharCode(e[t+p]);return f},writeASCII:function(e,t,u){for(var f=0;f<u.length;f++)e[t+f]=u.charCodeAt(f)},pad:function(e){return e.length<2?"0"+e:e},readUTF8:function(e,t,u){for(var f,p="",y=0;y<u;y++)p+="%"+h.bin.pad(e[t+y].toString(16));try{f=decodeURIComponent(p)}catch{return h.bin.readASCII(e,t,u)}return f},writeUTF8:function(e,t,u){for(var f=u.length,p=0,y=0;y<f;y++){var r=u.charCodeAt(y);if((4294967168&r)==0)e[t+p]=r,p++;else if((4294965248&r)==0)e[t+p]=192|r>>6,e[t+p+1]=128|r>>0&63,p+=2;else if((4294901760&r)==0)e[t+p]=224|r>>12,e[t+p+1]=128|r>>6&63,e[t+p+2]=128|r>>0&63,p+=3;else{if((4292870144&r)!=0)throw"e";e[t+p]=240|r>>18,e[t+p+1]=128|r>>12&63,e[t+p+2]=128|r>>6&63,e[t+p+3]=128|r>>0&63,p+=4}}return p},sizeUTF8:function(e){for(var t=e.length,u=0,f=0;f<t;f++){var p=e.charCodeAt(f);if((4294967168&p)==0)u++;else if((4294965248&p)==0)u+=2;else if((4294901760&p)==0)u+=3;else{if((4292870144&p)!=0)throw"e";u+=4}}return u}},h.F={},h.F.deflateRaw=function(e,t,u,f){var p=[[0,0,0,0,0],[4,4,8,4,0],[4,5,16,8,0],[4,6,16,16,0],[4,10,16,32,0],[8,16,32,32,0],[8,16,128,128,0],[8,32,128,256,0],[32,128,258,1024,1],[32,258,258,4096,1]][f],y=h.F.U,r=h.F._goodIndex;h.F._hash;var i=h.F._putsE,n=0,a=u<<3,d=0,F=e.length;if(f==0){for(;n<F;)i(t,a,n+(m=Math.min(65535,F-n))==F?1:0),a=h.F._copyExact(e,n,m,t,a+8),n+=m;return a>>>3}var C=y.lits,A=y.strt,H=y.prev,T=0,I=0,O=0,g=0,R=0,l=0;for(F>2&&(A[l=h.F._hash(e,0)]=0),n=0;n<F;n++){if(R=l,n+1<F-2){l=h.F._hash(e,n+1);var s=n+1&32767;H[s]=A[l],A[l]=s}if(d<=n){(T>14e3||I>26697)&&F-n>100&&(d<n&&(C[T]=n-d,T+=2,d=n),a=h.F._writeBlock(n==F-1||d==F?1:0,C,T,g,e,O,n-O,t,a),T=I=g=0,O=n);var b=0;n<F-2&&(b=h.F._bestMatch(e,n,H,R,Math.min(p[2],F-n),p[3]));var m=b>>>16,w=65535&b;if(b!=0){w=65535&b;var U=r(m=b>>>16,y.of0);y.lhst[257+U]++;var v=r(w,y.df0);y.dhst[v]++,g+=y.exb[U]+y.dxb[v],C[T]=m<<23|n-d,C[T+1]=w<<16|U<<8|v,T+=2,d=n+m}else y.lhst[e[n]]++;I++}}for(O==n&&e.length!=0||(d<n&&(C[T]=n-d,T+=2,d=n),a=h.F._writeBlock(1,C,T,g,e,O,n-O,t,a),T=0,I=0,T=I=g=0,O=n);(7&a)!=0;)a++;return a>>>3},h.F._bestMatch=function(e,t,u,f,p,y){var r=32767&t,i=u[r],n=r-i+32768&32767;if(i==r||f!=h.F._hash(e,t-n))return 0;for(var a=0,d=0,F=Math.min(32767,t);n<=F&&--y!=0&&i!=r;){if(a==0||e[t+a]==e[t+a-n]){var C=h.F._howLong(e,t,n);if(C>a){if(d=n,(a=C)>=p)break;n+2<C&&(C=n+2);for(var A=0,H=0;H<C-2;H++){var T=t-n+H+32768&32767,I=T-u[T]+32768&32767;I>A&&(A=I,i=T)}}}n+=(r=i)-(i=u[r])+32768&32767}return a<<16|d},h.F._howLong=function(e,t,u){if(e[t]!=e[t-u]||e[t+1]!=e[t+1-u]||e[t+2]!=e[t+2-u])return 0;var f=t,p=Math.min(e.length,t+258);for(t+=3;t<p&&e[t]==e[t-u];)t++;return t-f},h.F._hash=function(e,t){return(e[t]<<8|e[t+1])+(e[t+2]<<4)&65535},h.saved=0,h.F._writeBlock=function(e,t,u,f,p,y,r,i,n){var a,d,F,C,A,H,T,I,O,g=h.F.U,R=h.F._putsF,l=h.F._putsE;g.lhst[256]++,d=(a=h.F.getTrees())[0],F=a[1],C=a[2],A=a[3],H=a[4],T=a[5],I=a[6],O=a[7];var s=32+((n+3&7)==0?0:8-(n+3&7))+(r<<3),b=f+h.F.contSize(g.fltree,g.lhst)+h.F.contSize(g.fdtree,g.dhst),m=f+h.F.contSize(g.ltree,g.lhst)+h.F.contSize(g.dtree,g.dhst);m+=14+3*T+h.F.contSize(g.itree,g.ihst)+(2*g.ihst[16]+3*g.ihst[17]+7*g.ihst[18]);for(var w=0;w<286;w++)g.lhst[w]=0;for(w=0;w<30;w++)g.dhst[w]=0;for(w=0;w<19;w++)g.ihst[w]=0;var U=s<b&&s<m?0:b<m?1:2;if(R(i,n,e),R(i,n+1,U),n+=3,U==0){for(;(7&n)!=0;)n++;n=h.F._copyExact(p,y,r,i,n)}else{var v,_;if(U==1&&(v=g.fltree,_=g.fdtree),U==2){h.F.makeCodes(g.ltree,d),h.F.revCodes(g.ltree,d),h.F.makeCodes(g.dtree,F),h.F.revCodes(g.dtree,F),h.F.makeCodes(g.itree,C),h.F.revCodes(g.itree,C),v=g.ltree,_=g.dtree,l(i,n,A-257),l(i,n+=5,H-1),l(i,n+=5,T-4),n+=4;for(var c=0;c<T;c++)l(i,n+3*c,g.itree[1+(g.ordr[c]<<1)]);n+=3*T,n=h.F._codeTiny(I,g.itree,i,n),n=h.F._codeTiny(O,g.itree,i,n)}for(var o=y,P=0;P<u;P+=2){for(var E=t[P],k=E>>>23,N=o+(8388607&E);o<N;)n=h.F._writeLit(p[o++],v,i,n);if(k!=0){var z=t[P+1],Q=z>>16,L=z>>8&255,M=255&z;l(i,n=h.F._writeLit(257+L,v,i,n),k-g.of0[L]),n+=g.exb[L],R(i,n=h.F._writeLit(M,_,i,n),Q-g.df0[M]),n+=g.dxb[M],o+=k}}n=h.F._writeLit(256,v,i,n)}return n},h.F._copyExact=function(e,t,u,f,p){var y=p>>>3;return f[y]=u,f[y+1]=u>>>8,f[y+2]=255-f[y],f[y+3]=255-f[y+1],y+=4,f.set(new Uint8Array(e.buffer,t,u),y),p+(u+4<<3)},h.F.getTrees=function(){for(var e=h.F.U,t=h.F._hufTree(e.lhst,e.ltree,15),u=h.F._hufTree(e.dhst,e.dtree,15),f=[],p=h.F._lenCodes(e.ltree,f),y=[],r=h.F._lenCodes(e.dtree,y),i=0;i<f.length;i+=2)e.ihst[f[i]]++;for(i=0;i<y.length;i+=2)e.ihst[y[i]]++;for(var n=h.F._hufTree(e.ihst,e.itree,7),a=19;a>4&&e.itree[1+(e.ordr[a-1]<<1)]==0;)a--;return[t,u,n,p,r,a,f,y]},h.F.getSecond=function(e){for(var t=[],u=0;u<e.length;u+=2)t.push(e[u+1]);return t},h.F.nonZero=function(e){for(var t="",u=0;u<e.length;u+=2)e[u+1]!=0&&(t+=(u>>1)+",");return t},h.F.contSize=function(e,t){for(var u=0,f=0;f<t.length;f++)u+=t[f]*e[1+(f<<1)];return u},h.F._codeTiny=function(e,t,u,f){for(var p=0;p<e.length;p+=2){var y=e[p],r=e[p+1];f=h.F._writeLit(y,t,u,f);var i=y==16?2:y==17?3:7;y>15&&(h.F._putsE(u,f,r,i),f+=i)}return f},h.F._lenCodes=function(e,t){for(var u=e.length;u!=2&&e[u-1]==0;)u-=2;for(var f=0;f<u;f+=2){var p=e[f+1],y=f+3<u?e[f+3]:-1,r=f+5<u?e[f+5]:-1,i=f==0?-1:e[f-1];if(p==0&&y==p&&r==p){for(var n=f+5;n+2<u&&e[n+2]==p;)n+=2;(a=Math.min(n+1-f>>>1,138))<11?t.push(17,a-3):t.push(18,a-11),f+=2*a-2}else if(p==i&&y==p&&r==p){for(n=f+5;n+2<u&&e[n+2]==p;)n+=2;var a=Math.min(n+1-f>>>1,6);t.push(16,a-3),f+=2*a-2}else t.push(p,0)}return u>>>1},h.F._hufTree=function(e,t,u){var f=[],p=e.length,y=t.length,r=0;for(r=0;r<y;r+=2)t[r]=0,t[r+1]=0;for(r=0;r<p;r++)e[r]!=0&&f.push({lit:r,f:e[r]});var i=f.length,n=f.slice(0);if(i==0)return 0;if(i==1){var a=f[0].lit;return n=a==0?1:0,t[1+(a<<1)]=1,t[1+(n<<1)]=1,1}f.sort((function(I,O){return I.f-O.f}));var d=f[0],F=f[1],C=0,A=1,H=2;for(f[0]={lit:-1,f:d.f+F.f,l:d,r:F,d:0};A!=i-1;)d=C!=A&&(H==i||f[C].f<f[H].f)?f[C++]:f[H++],F=C!=A&&(H==i||f[C].f<f[H].f)?f[C++]:f[H++],f[A++]={lit:-1,f:d.f+F.f,l:d,r:F};var T=h.F.setDepth(f[A-1],0);for(T>u&&(h.F.restrictDepth(n,u,T),T=u),r=0;r<i;r++)t[1+(n[r].lit<<1)]=n[r].d;return T},h.F.setDepth=function(e,t){return e.lit!=-1?(e.d=t,t):Math.max(h.F.setDepth(e.l,t+1),h.F.setDepth(e.r,t+1))},h.F.restrictDepth=function(e,t,u){var f=0,p=1<<u-t,y=0;for(e.sort((function(i,n){return n.d==i.d?i.f-n.f:n.d-i.d})),f=0;f<e.length&&e[f].d>t;f++){var r=e[f].d;e[f].d=t,y+=p-(1<<u-r)}for(y>>>=u-t;y>0;)(r=e[f].d)<t?(e[f].d++,y-=1<<t-r-1):f++;for(;f>=0;f--)e[f].d==t&&y<0&&(e[f].d--,y++);y!=0&&console.log("debt left")},h.F._goodIndex=function(e,t){var u=0;return t[16|u]<=e&&(u|=16),t[8|u]<=e&&(u|=8),t[4|u]<=e&&(u|=4),t[2|u]<=e&&(u|=2),t[1|u]<=e&&(u|=1),u},h.F._writeLit=function(e,t,u,f){return h.F._putsF(u,f,t[e<<1]),f+t[1+(e<<1)]},h.F.inflate=function(e,t){var u=Uint8Array;if(e[0]==3&&e[1]==0)return t||new u(0);var f=h.F,p=f._bitsF,y=f._bitsE,r=f._decodeTiny,i=f.makeCodes,n=f.codes2map,a=f._get17,d=f.U,F=t==null;F&&(t=new u(e.length>>>2<<3));for(var C,A,H=0,T=0,I=0,O=0,g=0,R=0,l=0,s=0,b=0;H==0;)if(H=p(e,b,1),T=p(e,b+1,2),b+=3,T!=0){if(F&&(t=h.F._check(t,s+(1<<17))),T==1&&(C=d.flmap,A=d.fdmap,R=511,l=31),T==2){I=y(e,b,5)+257,O=y(e,b+5,5)+1,g=y(e,b+10,4)+4,b+=14;for(var m=0;m<38;m+=2)d.itree[m]=0,d.itree[m+1]=0;var w=1;for(m=0;m<g;m++){var U=y(e,b+3*m,3);d.itree[1+(d.ordr[m]<<1)]=U,U>w&&(w=U)}b+=3*g,i(d.itree,w),n(d.itree,w,d.imap),C=d.lmap,A=d.dmap,b=r(d.imap,(1<<w)-1,I+O,e,b,d.ttree);var v=f._copyOut(d.ttree,0,I,d.ltree);R=(1<<v)-1;var _=f._copyOut(d.ttree,I,O,d.dtree);l=(1<<_)-1,i(d.ltree,v),n(d.ltree,v,C),i(d.dtree,_),n(d.dtree,_,A)}for(;;){var c=C[a(e,b)&R];b+=15&c;var o=c>>>4;if(!(o>>>8))t[s++]=o;else{if(o==256)break;var P=s+o-254;if(o>264){var E=d.ldef[o-257];P=s+(E>>>3)+y(e,b,7&E),b+=7&E}var k=A[a(e,b)&l];b+=15&k;var N=k>>>4,z=d.ddef[N],Q=(z>>>4)+p(e,b,15&z);for(b+=15&z,F&&(t=h.F._check(t,s+(1<<17)));s<P;)t[s]=t[s++-Q],t[s]=t[s++-Q],t[s]=t[s++-Q],t[s]=t[s++-Q];s=P}}}else{(7&b)!=0&&(b+=8-(7&b));var L=4+(b>>>3),M=e[L-4]|e[L-3]<<8;F&&(t=h.F._check(t,s+M)),t.set(new u(e.buffer,e.byteOffset+L,M),s),b=L+M<<3,s+=M}return t.length==s?t:t.slice(0,s)},h.F._check=function(e,t){var u=e.length;if(t<=u)return e;var f=new Uint8Array(Math.max(u<<1,t));return f.set(e,0),f},h.F._decodeTiny=function(e,t,u,f,p,y){for(var r=h.F._bitsE,i=h.F._get17,n=0;n<u;){var a=e[i(f,p)&t];p+=15&a;var d=a>>>4;if(d<=15)y[n]=d,n++;else{var F=0,C=0;d==16?(C=3+r(f,p,2),p+=2,F=y[n-1]):d==17?(C=3+r(f,p,3),p+=3):d==18&&(C=11+r(f,p,7),p+=7);for(var A=n+C;n<A;)y[n]=F,n++}}return p},h.F._copyOut=function(e,t,u,f){for(var p=0,y=0,r=f.length>>>1;y<u;){var i=e[y+t];f[y<<1]=0,f[1+(y<<1)]=i,i>p&&(p=i),y++}for(;y<r;)f[y<<1]=0,f[1+(y<<1)]=0,y++;return p},h.F.makeCodes=function(e,t){for(var u,f,p,y,r=h.F.U,i=e.length,n=r.bl_count,a=0;a<=t;a++)n[a]=0;for(a=1;a<i;a+=2)n[e[a]]++;var d=r.next_code;for(u=0,n[0]=0,f=1;f<=t;f++)u=u+n[f-1]<<1,d[f]=u;for(p=0;p<i;p+=2)(y=e[p+1])!=0&&(e[p]=d[y],d[y]++)},h.F.codes2map=function(e,t,u){for(var f=e.length,p=h.F.U.rev15,y=0;y<f;y+=2)if(e[y+1]!=0)for(var r=y>>1,i=e[y+1],n=r<<4|i,a=t-i,d=e[y]<<a,F=d+(1<<a);d!=F;)u[p[d]>>>15-t]=n,d++},h.F.revCodes=function(e,t){for(var u=h.F.U.rev15,f=15-t,p=0;p<e.length;p+=2){var y=e[p]<<t-e[p+1];e[p]=u[y]>>>f}},h.F._putsE=function(e,t,u){u<<=7&t;var f=t>>>3;e[f]|=u,e[f+1]|=u>>>8},h.F._putsF=function(e,t,u){u<<=7&t;var f=t>>>3;e[f]|=u,e[f+1]|=u>>>8,e[f+2]|=u>>>16},h.F._bitsE=function(e,t,u){return(e[t>>>3]|e[1+(t>>>3)]<<8)>>>(7&t)&(1<<u)-1},h.F._bitsF=function(e,t,u){return(e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16)>>>(7&t)&(1<<u)-1},h.F._get17=function(e,t){return(e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16)>>>(7&t)},h.F._get25=function(e,t){return(e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16|e[3+(t>>>3)]<<24)>>>(7&t)},h.F.U=(S=Uint16Array,D=Uint32Array,{next_code:new S(16),bl_count:new S(16),ordr:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],of0:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],exb:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],ldef:new S(32),df0:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],dxb:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],ddef:new D(32),flmap:new S(512),fltree:[],fdmap:new S(32),fdtree:[],lmap:new S(32768),ltree:[],ttree:[],dmap:new S(32768),dtree:[],imap:new S(512),itree:[],rev15:new S(32768),lhst:new D(286),dhst:new D(30),ihst:new D(19),lits:new D(15e3),strt:new S(65536),prev:new S(32768)}),(function(){for(var e=h.F.U,t=0;t<32768;t++){var u=t;u=(4278255360&(u=(4042322160&(u=(3435973836&(u=(2863311530&u)>>>1|(1431655765&u)<<1))>>>2|(858993459&u)<<2))>>>4|(252645135&u)<<4))>>>8|(16711935&u)<<8,e.rev15[t]=(u>>>16|u<<16)>>>17}function f(p,y,r){for(;y--!=0;)p.push(0,r)}for(t=0;t<32;t++)e.ldef[t]=e.of0[t]<<3|e.exb[t],e.ddef[t]=e.df0[t]<<4|e.dxb[t];f(e.fltree,144,8),f(e.fltree,112,9),f(e.fltree,24,7),f(e.fltree,8,8),h.F.makeCodes(e.fltree,9),h.F.codes2map(e.fltree,9,e.flmap),h.F.revCodes(e.fltree,9),f(e.fdtree,32,5),h.F.makeCodes(e.fdtree,5),h.F.codes2map(e.fdtree,5,e.fdmap),h.F.revCodes(e.fdtree,5),f(e.itree,19,0),f(e.ltree,286,0),f(e.dtree,30,0),f(e.ttree,320,0)})()})();var ft=it({__proto__:null,default:Te},[Te]);const he=(function(){var x={nextZero(r,i){for(;r[i]!=0;)i++;return i},readUshort:(r,i)=>r[i]<<8|r[i+1],writeUshort(r,i,n){r[i]=n>>8&255,r[i+1]=255&n},readUint:(r,i)=>16777216*r[i]+(r[i+1]<<16|r[i+2]<<8|r[i+3]),writeUint(r,i,n){r[i]=n>>24&255,r[i+1]=n>>16&255,r[i+2]=n>>8&255,r[i+3]=255&n},readASCII(r,i,n){let a="";for(let d=0;d<n;d++)a+=String.fromCharCode(r[i+d]);return a},writeASCII(r,i,n){for(let a=0;a<n.length;a++)r[i+a]=n.charCodeAt(a)},readBytes(r,i,n){const a=[];for(let d=0;d<n;d++)a.push(r[i+d]);return a},pad:r=>r.length<2?`0${r}`:r,readUTF8(r,i,n){let a,d="";for(let F=0;F<n;F++)d+=`%${x.pad(r[i+F].toString(16))}`;try{a=decodeURIComponent(d)}catch{return x.readASCII(r,i,n)}return a}};function S(r,i,n,a){const d=i*n,F=t(a),C=Math.ceil(i*F/8),A=new Uint8Array(4*d),H=new Uint32Array(A.buffer),{ctype:T}=a,{depth:I}=a,O=x.readUshort;if(T==6){const E=d<<2;if(I==8)for(var g=0;g<E;g+=4)A[g]=r[g],A[g+1]=r[g+1],A[g+2]=r[g+2],A[g+3]=r[g+3];if(I==16)for(g=0;g<E;g++)A[g]=r[g<<1]}else if(T==2){const E=a.tabs.tRNS;if(E==null){if(I==8)for(g=0;g<d;g++){var R=3*g;H[g]=255<<24|r[R+2]<<16|r[R+1]<<8|r[R]}if(I==16)for(g=0;g<d;g++)R=6*g,H[g]=255<<24|r[R+4]<<16|r[R+2]<<8|r[R]}else{var l=E[0];const k=E[1],N=E[2];if(I==8)for(g=0;g<d;g++){var s=g<<2;R=3*g,H[g]=255<<24|r[R+2]<<16|r[R+1]<<8|r[R],r[R]==l&&r[R+1]==k&&r[R+2]==N&&(A[s+3]=0)}if(I==16)for(g=0;g<d;g++)s=g<<2,R=6*g,H[g]=255<<24|r[R+4]<<16|r[R+2]<<8|r[R],O(r,R)==l&&O(r,R+2)==k&&O(r,R+4)==N&&(A[s+3]=0)}}else if(T==3){const E=a.tabs.PLTE,k=a.tabs.tRNS,N=k?k.length:0;if(I==1)for(var b=0;b<n;b++){var m=b*C,w=b*i;for(g=0;g<i;g++){s=w+g<<2;var U=3*(v=r[m+(g>>3)]>>7-((7&g)<<0)&1);A[s]=E[U],A[s+1]=E[U+1],A[s+2]=E[U+2],A[s+3]=v<N?k[v]:255}}if(I==2)for(b=0;b<n;b++)for(m=b*C,w=b*i,g=0;g<i;g++)s=w+g<<2,U=3*(v=r[m+(g>>2)]>>6-((3&g)<<1)&3),A[s]=E[U],A[s+1]=E[U+1],A[s+2]=E[U+2],A[s+3]=v<N?k[v]:255;if(I==4)for(b=0;b<n;b++)for(m=b*C,w=b*i,g=0;g<i;g++)s=w+g<<2,U=3*(v=r[m+(g>>1)]>>4-((1&g)<<2)&15),A[s]=E[U],A[s+1]=E[U+1],A[s+2]=E[U+2],A[s+3]=v<N?k[v]:255;if(I==8)for(g=0;g<d;g++){var v;s=g<<2,U=3*(v=r[g]),A[s]=E[U],A[s+1]=E[U+1],A[s+2]=E[U+2],A[s+3]=v<N?k[v]:255}}else if(T==4){if(I==8)for(g=0;g<d;g++){s=g<<2;var _=r[c=g<<1];A[s]=_,A[s+1]=_,A[s+2]=_,A[s+3]=r[c+1]}if(I==16)for(g=0;g<d;g++){var c;s=g<<2,_=r[c=g<<2],A[s]=_,A[s+1]=_,A[s+2]=_,A[s+3]=r[c+2]}}else if(T==0)for(l=a.tabs.tRNS?a.tabs.tRNS:-1,b=0;b<n;b++){const E=b*C,k=b*i;if(I==1)for(var o=0;o<i;o++){var P=(_=255*(r[E+(o>>>3)]>>>7-(7&o)&1))==255*l?0:255;H[k+o]=P<<24|_<<16|_<<8|_}else if(I==2)for(o=0;o<i;o++)P=(_=85*(r[E+(o>>>2)]>>>6-((3&o)<<1)&3))==85*l?0:255,H[k+o]=P<<24|_<<16|_<<8|_;else if(I==4)for(o=0;o<i;o++)P=(_=17*(r[E+(o>>>1)]>>>4-((1&o)<<2)&15))==17*l?0:255,H[k+o]=P<<24|_<<16|_<<8|_;else if(I==8)for(o=0;o<i;o++)P=(_=r[E+o])==l?0:255,H[k+o]=P<<24|_<<16|_<<8|_;else if(I==16)for(o=0;o<i;o++)_=r[E+(o<<1)],P=O(r,E+(o<<1))==l?0:255,H[k+o]=P<<24|_<<16|_<<8|_}return A}function D(r,i,n,a){const d=t(r),F=Math.ceil(n*d/8),C=new Uint8Array((F+1+r.interlace)*a);return i=r.tabs.CgBI?e(i,C):h(i,C),r.interlace==0?i=u(i,r,0,n,a):r.interlace==1&&(i=(function(H,T){const I=T.width,O=T.height,g=t(T),R=g>>3,l=Math.ceil(I*g/8),s=new Uint8Array(O*l);let b=0;const m=[0,0,4,0,2,0,1],w=[0,4,0,2,0,1,0],U=[8,8,8,4,4,2,2],v=[8,8,4,4,2,2,1];let _=0;for(;_<7;){const o=U[_],P=v[_];let E=0,k=0,N=m[_];for(;N<O;)N+=o,k++;let z=w[_];for(;z<I;)z+=P,E++;const Q=Math.ceil(E*g/8);u(H,T,b,E,k);let L=0,M=m[_];for(;M<O;){let B=w[_],Z=b+L*Q<<3;for(;B<I;){var c;if(g==1&&(c=(c=H[Z>>3])>>7-(7&Z)&1,s[M*l+(B>>3)]|=c<<7-((7&B)<<0)),g==2&&(c=(c=H[Z>>3])>>6-(7&Z)&3,s[M*l+(B>>2)]|=c<<6-((3&B)<<1)),g==4&&(c=(c=H[Z>>3])>>4-(7&Z)&15,s[M*l+(B>>1)]|=c<<4-((1&B)<<2)),g>=8){const j=M*l+B*R;for(let W=0;W<R;W++)s[j+W]=H[(Z>>3)+W]}Z+=g,B+=P}L++,M+=o}E*k!=0&&(b+=k*(1+Q)),_+=1}return s})(i,r)),i}function h(r,i){return e(new Uint8Array(r.buffer,2,r.length-6),i)}var e=(function(){const r={H:{}};return r.H.N=function(i,n){const a=Uint8Array;let d,F,C=0,A=0,H=0,T=0,I=0,O=0,g=0,R=0,l=0;if(i[0]==3&&i[1]==0)return n||new a(0);const s=r.H,b=s.b,m=s.e,w=s.R,U=s.n,v=s.A,_=s.Z,c=s.m,o=n==null;for(o&&(n=new a(i.length>>>2<<5));C==0;)if(C=b(i,l,1),A=b(i,l+1,2),l+=3,A!=0){if(o&&(n=r.H.W(n,R+(1<<17))),A==1&&(d=c.J,F=c.h,O=511,g=31),A==2){H=m(i,l,5)+257,T=m(i,l+5,5)+1,I=m(i,l+10,4)+4,l+=14;let E=1;for(var P=0;P<38;P+=2)c.Q[P]=0,c.Q[P+1]=0;for(P=0;P<I;P++){const z=m(i,l+3*P,3);c.Q[1+(c.X[P]<<1)]=z,z>E&&(E=z)}l+=3*I,U(c.Q,E),v(c.Q,E,c.u),d=c.w,F=c.d,l=w(c.u,(1<<E)-1,H+T,i,l,c.v);const k=s.V(c.v,0,H,c.C);O=(1<<k)-1;const N=s.V(c.v,H,T,c.D);g=(1<<N)-1,U(c.C,k),v(c.C,k,d),U(c.D,N),v(c.D,N,F)}for(;;){const E=d[_(i,l)&O];l+=15&E;const k=E>>>4;if(!(k>>>8))n[R++]=k;else{if(k==256)break;{let N=R+k-254;if(k>264){const B=c.q[k-257];N=R+(B>>>3)+m(i,l,7&B),l+=7&B}const z=F[_(i,l)&g];l+=15&z;const Q=z>>>4,L=c.c[Q],M=(L>>>4)+b(i,l,15&L);for(l+=15&L;R<N;)n[R]=n[R++-M],n[R]=n[R++-M],n[R]=n[R++-M],n[R]=n[R++-M];R=N}}}}else{(7&l)!=0&&(l+=8-(7&l));const E=4+(l>>>3),k=i[E-4]|i[E-3]<<8;o&&(n=r.H.W(n,R+k)),n.set(new a(i.buffer,i.byteOffset+E,k),R),l=E+k<<3,R+=k}return n.length==R?n:n.slice(0,R)},r.H.W=function(i,n){const a=i.length;if(n<=a)return i;const d=new Uint8Array(a<<1);return d.set(i,0),d},r.H.R=function(i,n,a,d,F,C){const A=r.H.e,H=r.H.Z;let T=0;for(;T<a;){const I=i[H(d,F)&n];F+=15&I;const O=I>>>4;if(O<=15)C[T]=O,T++;else{let g=0,R=0;O==16?(R=3+A(d,F,2),F+=2,g=C[T-1]):O==17?(R=3+A(d,F,3),F+=3):O==18&&(R=11+A(d,F,7),F+=7);const l=T+R;for(;T<l;)C[T]=g,T++}}return F},r.H.V=function(i,n,a,d){let F=0,C=0;const A=d.length>>>1;for(;C<a;){const H=i[C+n];d[C<<1]=0,d[1+(C<<1)]=H,H>F&&(F=H),C++}for(;C<A;)d[C<<1]=0,d[1+(C<<1)]=0,C++;return F},r.H.n=function(i,n){const a=r.H.m,d=i.length;let F,C,A,H;const T=a.j;for(var I=0;I<=n;I++)T[I]=0;for(I=1;I<d;I+=2)T[i[I]]++;const O=a.K;for(F=0,T[0]=0,C=1;C<=n;C++)F=F+T[C-1]<<1,O[C]=F;for(A=0;A<d;A+=2)H=i[A+1],H!=0&&(i[A]=O[H],O[H]++)},r.H.A=function(i,n,a){const d=i.length,F=r.H.m.r;for(let C=0;C<d;C+=2)if(i[C+1]!=0){const A=C>>1,H=i[C+1],T=A<<4|H,I=n-H;let O=i[C]<<I;const g=O+(1<<I);for(;O!=g;)a[F[O]>>>15-n]=T,O++}},r.H.l=function(i,n){const a=r.H.m.r,d=15-n;for(let F=0;F<i.length;F+=2){const C=i[F]<<n-i[F+1];i[F]=a[C]>>>d}},r.H.M=function(i,n,a){a<<=7&n;const d=n>>>3;i[d]|=a,i[d+1]|=a>>>8},r.H.I=function(i,n,a){a<<=7&n;const d=n>>>3;i[d]|=a,i[d+1]|=a>>>8,i[d+2]|=a>>>16},r.H.e=function(i,n,a){return(i[n>>>3]|i[1+(n>>>3)]<<8)>>>(7&n)&(1<<a)-1},r.H.b=function(i,n,a){return(i[n>>>3]|i[1+(n>>>3)]<<8|i[2+(n>>>3)]<<16)>>>(7&n)&(1<<a)-1},r.H.Z=function(i,n){return(i[n>>>3]|i[1+(n>>>3)]<<8|i[2+(n>>>3)]<<16)>>>(7&n)},r.H.i=function(i,n){return(i[n>>>3]|i[1+(n>>>3)]<<8|i[2+(n>>>3)]<<16|i[3+(n>>>3)]<<24)>>>(7&n)},r.H.m=(function(){const i=Uint16Array,n=Uint32Array;return{K:new i(16),j:new i(16),X:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],S:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],T:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],q:new i(32),p:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],z:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],c:new n(32),J:new i(512),_:[],h:new i(32),$:[],w:new i(32768),C:[],v:[],d:new i(32768),D:[],u:new i(512),Q:[],r:new i(32768),s:new n(286),Y:new n(30),a:new n(19),t:new n(15e3),k:new i(65536),g:new i(32768)}})(),(function(){const i=r.H.m;for(var n=0;n<32768;n++){let d=n;d=(2863311530&d)>>>1|(1431655765&d)<<1,d=(3435973836&d)>>>2|(858993459&d)<<2,d=(4042322160&d)>>>4|(252645135&d)<<4,d=(4278255360&d)>>>8|(16711935&d)<<8,i.r[n]=(d>>>16|d<<16)>>>17}function a(d,F,C){for(;F--!=0;)d.push(0,C)}for(n=0;n<32;n++)i.q[n]=i.S[n]<<3|i.T[n],i.c[n]=i.p[n]<<4|i.z[n];a(i._,144,8),a(i._,112,9),a(i._,24,7),a(i._,8,8),r.H.n(i._,9),r.H.A(i._,9,i.J),r.H.l(i._,9),a(i.$,32,5),r.H.n(i.$,5),r.H.A(i.$,5,i.h),r.H.l(i.$,5),a(i.Q,19,0),a(i.C,286,0),a(i.D,30,0),a(i.v,320,0)})(),r.H.N})();function t(r){return[1,null,3,1,2,null,4][r.ctype]*r.depth}function u(r,i,n,a,d){let F=t(i);const C=Math.ceil(a*F/8);let A,H;F=Math.ceil(F/8);let T=r[n],I=0;if(T>1&&(r[n]=[0,0,1][T-2]),T==3)for(I=F;I<C;I++)r[I+1]=r[I+1]+(r[I+1-F]>>>1)&255;for(let O=0;O<d;O++)if(A=n+O*C,H=A+O+1,T=r[H-1],I=0,T==0)for(;I<C;I++)r[A+I]=r[H+I];else if(T==1){for(;I<F;I++)r[A+I]=r[H+I];for(;I<C;I++)r[A+I]=r[H+I]+r[A+I-F]}else if(T==2)for(;I<C;I++)r[A+I]=r[H+I]+r[A+I-C];else if(T==3){for(;I<F;I++)r[A+I]=r[H+I]+(r[A+I-C]>>>1);for(;I<C;I++)r[A+I]=r[H+I]+(r[A+I-C]+r[A+I-F]>>>1)}else{for(;I<F;I++)r[A+I]=r[H+I]+f(0,r[A+I-C],0);for(;I<C;I++)r[A+I]=r[H+I]+f(r[A+I-F],r[A+I-C],r[A+I-F-C])}return r}function f(r,i,n){const a=r+i-n,d=a-r,F=a-i,C=a-n;return d*d<=F*F&&d*d<=C*C?r:F*F<=C*C?i:n}function p(r,i,n){n.width=x.readUint(r,i),i+=4,n.height=x.readUint(r,i),i+=4,n.depth=r[i],i++,n.ctype=r[i],i++,n.compress=r[i],i++,n.filter=r[i],i++,n.interlace=r[i],i++}function y(r,i,n,a,d,F,C,A,H){const T=Math.min(i,d),I=Math.min(n,F);let O=0,g=0;for(let _=0;_<I;_++)for(let c=0;c<T;c++)if(C>=0&&A>=0?(O=_*i+c<<2,g=(A+_)*d+C+c<<2):(O=(-A+_)*i-C+c<<2,g=_*d+c<<2),H==0)a[g]=r[O],a[g+1]=r[O+1],a[g+2]=r[O+2],a[g+3]=r[O+3];else if(H==1){var R=r[O+3]*.00392156862745098,l=r[O]*R,s=r[O+1]*R,b=r[O+2]*R,m=a[g+3]*(1/255),w=a[g]*m,U=a[g+1]*m,v=a[g+2]*m;const o=1-R,P=R+m*o,E=P==0?0:1/P;a[g+3]=255*P,a[g+0]=(l+w*o)*E,a[g+1]=(s+U*o)*E,a[g+2]=(b+v*o)*E}else if(H==2)R=r[O+3],l=r[O],s=r[O+1],b=r[O+2],m=a[g+3],w=a[g],U=a[g+1],v=a[g+2],R==m&&l==w&&s==U&&b==v?(a[g]=0,a[g+1]=0,a[g+2]=0,a[g+3]=0):(a[g]=l,a[g+1]=s,a[g+2]=b,a[g+3]=R);else if(H==3){if(R=r[O+3],l=r[O],s=r[O+1],b=r[O+2],m=a[g+3],w=a[g],U=a[g+1],v=a[g+2],R==m&&l==w&&s==U&&b==v)continue;if(R<220&&m>20)return!1}return!0}return{decode:function(i){const n=new Uint8Array(i);let a=8;const d=x,F=d.readUshort,C=d.readUint,A={tabs:{},frames:[]},H=new Uint8Array(n.length);let T,I=0,O=0;const g=[137,80,78,71,13,10,26,10];for(var R=0;R<8;R++)if(n[R]!=g[R])throw"The input is not a PNG file!";for(;a<n.length;){const _=d.readUint(n,a);a+=4;const c=d.readASCII(n,a,4);if(a+=4,c=="IHDR")p(n,a,A);else if(c=="iCCP"){for(var l=a;n[l]!=0;)l++;d.readASCII(n,a,l-a),n[l+1];const o=n.slice(l+2,a+_);let P=null;try{P=h(o)}catch{P=e(o)}A.tabs[c]=P}else if(c=="CgBI")A.tabs[c]=n.slice(a,a+4);else if(c=="IDAT"){for(R=0;R<_;R++)H[I+R]=n[a+R];I+=_}else if(c=="acTL")A.tabs[c]={num_frames:C(n,a),num_plays:C(n,a+4)},T=new Uint8Array(n.length);else if(c=="fcTL"){O!=0&&((v=A.frames[A.frames.length-1]).data=D(A,T.slice(0,O),v.rect.width,v.rect.height),O=0);const o={x:C(n,a+12),y:C(n,a+16),width:C(n,a+4),height:C(n,a+8)};let P=F(n,a+22);P=F(n,a+20)/(P==0?100:P);const E={rect:o,delay:Math.round(1e3*P),dispose:n[a+24],blend:n[a+25]};A.frames.push(E)}else if(c=="fdAT"){for(R=0;R<_-4;R++)T[O+R]=n[a+R+4];O+=_-4}else if(c=="pHYs")A.tabs[c]=[d.readUint(n,a),d.readUint(n,a+4),n[a+8]];else if(c=="cHRM")for(A.tabs[c]=[],R=0;R<8;R++)A.tabs[c].push(d.readUint(n,a+4*R));else if(c=="tEXt"||c=="zTXt"){A.tabs[c]==null&&(A.tabs[c]={});var s=d.nextZero(n,a),b=d.readASCII(n,a,s-a),m=a+_-s-1;if(c=="tEXt")U=d.readASCII(n,s+1,m);else{var w=h(n.slice(s+2,s+2+m));U=d.readUTF8(w,0,w.length)}A.tabs[c][b]=U}else if(c=="iTXt"){A.tabs[c]==null&&(A.tabs[c]={}),s=0,l=a,s=d.nextZero(n,l),b=d.readASCII(n,l,s-l);const o=n[l=s+1];var U;n[l+1],l+=2,s=d.nextZero(n,l),d.readASCII(n,l,s-l),l=s+1,s=d.nextZero(n,l),d.readUTF8(n,l,s-l),m=_-((l=s+1)-a),o==0?U=d.readUTF8(n,l,m):(w=h(n.slice(l,l+m)),U=d.readUTF8(w,0,w.length)),A.tabs[c][b]=U}else if(c=="PLTE")A.tabs[c]=d.readBytes(n,a,_);else if(c=="hIST"){const o=A.tabs.PLTE.length/3;for(A.tabs[c]=[],R=0;R<o;R++)A.tabs[c].push(F(n,a+2*R))}else if(c=="tRNS")A.ctype==3?A.tabs[c]=d.readBytes(n,a,_):A.ctype==0?A.tabs[c]=F(n,a):A.ctype==2&&(A.tabs[c]=[F(n,a),F(n,a+2),F(n,a+4)]);else if(c=="gAMA")A.tabs[c]=d.readUint(n,a)/1e5;else if(c=="sRGB")A.tabs[c]=n[a];else if(c=="bKGD")A.ctype==0||A.ctype==4?A.tabs[c]=[F(n,a)]:A.ctype==2||A.ctype==6?A.tabs[c]=[F(n,a),F(n,a+2),F(n,a+4)]:A.ctype==3&&(A.tabs[c]=n[a]);else if(c=="IEND")break;a+=_,d.readUint(n,a),a+=4}var v;return O!=0&&((v=A.frames[A.frames.length-1]).data=D(A,T.slice(0,O),v.rect.width,v.rect.height)),A.data=D(A,H,A.width,A.height),delete A.compress,delete A.interlace,delete A.filter,A},toRGBA8:function(i){const n=i.width,a=i.height;if(i.tabs.acTL==null)return[S(i.data,n,a,i).buffer];const d=[];i.frames[0].data==null&&(i.frames[0].data=i.data);const F=n*a*4,C=new Uint8Array(F),A=new Uint8Array(F),H=new Uint8Array(F);for(let I=0;I<i.frames.length;I++){const O=i.frames[I],g=O.rect.x,R=O.rect.y,l=O.rect.width,s=O.rect.height,b=S(O.data,l,s,i);if(I!=0)for(var T=0;T<F;T++)H[T]=C[T];if(O.blend==0?y(b,l,s,C,n,a,g,R,0):O.blend==1&&y(b,l,s,C,n,a,g,R,1),d.push(C.buffer.slice(0)),O.dispose!=0){if(O.dispose==1)y(A,l,s,C,n,a,g,R,0);else if(O.dispose==2)for(T=0;T<F;T++)C[T]=H[T]}}return d},_paeth:f,_copyTile:y,_bin:x}})();(function(){const{_copyTile:x}=he,{_bin:S}=he,D=he._paeth;var h={table:(function(){const l=new Uint32Array(256);for(let s=0;s<256;s++){let b=s;for(let m=0;m<8;m++)1&b?b=3988292384^b>>>1:b>>>=1;l[s]=b}return l})(),update(l,s,b,m){for(let w=0;w<m;w++)l=h.table[255&(l^s[b+w])]^l>>>8;return l},crc:(l,s,b)=>4294967295^h.update(4294967295,l,s,b)};function e(l,s,b,m){s[b]+=l[0]*m>>4,s[b+1]+=l[1]*m>>4,s[b+2]+=l[2]*m>>4,s[b+3]+=l[3]*m>>4}function t(l){return Math.max(0,Math.min(255,l))}function u(l,s){const b=l[0]-s[0],m=l[1]-s[1],w=l[2]-s[2],U=l[3]-s[3];return b*b+m*m+w*w+U*U}function f(l,s,b,m,w,U,v){v==null&&(v=1);const _=m.length,c=[];for(var o=0;o<_;o++){const M=m[o];c.push([M>>>0&255,M>>>8&255,M>>>16&255,M>>>24&255])}for(o=0;o<_;o++){let M=4294967295;for(var P=0,E=0;E<_;E++){var k=u(c[o],c[E]);E!=o&&k<M&&(M=k,P=E)}}const N=new Uint32Array(w.buffer),z=new Int16Array(s*b*4),Q=[0,8,2,10,12,4,14,6,3,11,1,9,15,7,13,5];for(o=0;o<Q.length;o++)Q[o]=255*((Q[o]+.5)/16-.5);for(let M=0;M<b;M++)for(let B=0;B<s;B++){var L;o=4*(M*s+B),v!=2?L=[t(l[o]+z[o]),t(l[o+1]+z[o+1]),t(l[o+2]+z[o+2]),t(l[o+3]+z[o+3])]:(k=Q[4*(3&M)+(3&B)],L=[t(l[o]+k),t(l[o+1]+k),t(l[o+2]+k),t(l[o+3]+k)]),P=0;let Z=16777215;for(E=0;E<_;E++){const q=u(L,c[E]);q<Z&&(Z=q,P=E)}const j=c[P],W=[L[0]-j[0],L[1]-j[1],L[2]-j[2],L[3]-j[3]];v==1&&(B!=s-1&&e(W,z,o+4,7),M!=b-1&&(B!=0&&e(W,z,o+4*s-4,3),e(W,z,o+4*s,5),B!=s-1&&e(W,z,o+4*s+4,1))),U[o>>2]=P,N[o>>2]=m[P]}}function p(l,s,b,m,w){w==null&&(w={});const{crc:U}=h,v=S.writeUint,_=S.writeUshort,c=S.writeASCII;let o=8;const P=l.frames.length>1;let E,k=!1,N=33+(P?20:0);if(w.sRGB!=null&&(N+=13),w.pHYs!=null&&(N+=21),w.iCCP!=null&&(E=pako.deflate(w.iCCP),N+=21+E.length+4),l.ctype==3){for(var z=l.plte.length,Q=0;Q<z;Q++)l.plte[Q]>>>24!=255&&(k=!0);N+=8+3*z+4+(k?8+1*z+4:0)}for(var L=0;L<l.frames.length;L++)P&&(N+=38),N+=(j=l.frames[L]).cimg.length+12,L!=0&&(N+=4);N+=12;const M=new Uint8Array(N),B=[137,80,78,71,13,10,26,10];for(Q=0;Q<8;Q++)M[Q]=B[Q];if(v(M,o,13),o+=4,c(M,o,"IHDR"),o+=4,v(M,o,s),o+=4,v(M,o,b),o+=4,M[o]=l.depth,o++,M[o]=l.ctype,o++,M[o]=0,o++,M[o]=0,o++,M[o]=0,o++,v(M,o,U(M,o-17,17)),o+=4,w.sRGB!=null&&(v(M,o,1),o+=4,c(M,o,"sRGB"),o+=4,M[o]=w.sRGB,o++,v(M,o,U(M,o-5,5)),o+=4),w.iCCP!=null){const W=13+E.length;v(M,o,W),o+=4,c(M,o,"iCCP"),o+=4,c(M,o,"ICC profile"),o+=11,o+=2,M.set(E,o),o+=E.length,v(M,o,U(M,o-(W+4),W+4)),o+=4}if(w.pHYs!=null&&(v(M,o,9),o+=4,c(M,o,"pHYs"),o+=4,v(M,o,w.pHYs[0]),o+=4,v(M,o,w.pHYs[1]),o+=4,M[o]=w.pHYs[2],o++,v(M,o,U(M,o-13,13)),o+=4),P&&(v(M,o,8),o+=4,c(M,o,"acTL"),o+=4,v(M,o,l.frames.length),o+=4,v(M,o,w.loop!=null?w.loop:0),o+=4,v(M,o,U(M,o-12,12)),o+=4),l.ctype==3){for(v(M,o,3*(z=l.plte.length)),o+=4,c(M,o,"PLTE"),o+=4,Q=0;Q<z;Q++){const W=3*Q,q=l.plte[Q],V=255&q,ee=q>>>8&255,ye=q>>>16&255;M[o+W+0]=V,M[o+W+1]=ee,M[o+W+2]=ye}if(o+=3*z,v(M,o,U(M,o-3*z-4,3*z+4)),o+=4,k){for(v(M,o,z),o+=4,c(M,o,"tRNS"),o+=4,Q=0;Q<z;Q++)M[o+Q]=l.plte[Q]>>>24&255;o+=z,v(M,o,U(M,o-z-4,z+4)),o+=4}}let Z=0;for(L=0;L<l.frames.length;L++){var j=l.frames[L];P&&(v(M,o,26),o+=4,c(M,o,"fcTL"),o+=4,v(M,o,Z++),o+=4,v(M,o,j.rect.width),o+=4,v(M,o,j.rect.height),o+=4,v(M,o,j.rect.x),o+=4,v(M,o,j.rect.y),o+=4,_(M,o,m[L]),o+=2,_(M,o,1e3),o+=2,M[o]=j.dispose,o++,M[o]=j.blend,o++,v(M,o,U(M,o-30,30)),o+=4);const W=j.cimg;v(M,o,(z=W.length)+(L==0?0:4)),o+=4;const q=o;c(M,o,L==0?"IDAT":"fdAT"),o+=4,L!=0&&(v(M,o,Z++),o+=4),M.set(W,o),o+=z,v(M,o,U(M,q,o-q)),o+=4}return v(M,o,0),o+=4,c(M,o,"IEND"),o+=4,v(M,o,U(M,o-4,4)),o+=4,M.buffer}function y(l,s,b){for(let m=0;m<l.frames.length;m++){const w=l.frames[m];w.rect.width;const U=w.rect.height,v=new Uint8Array(U*w.bpl+U);w.cimg=a(w.img,U,w.bpp,w.bpl,v,s,b)}}function r(l,s,b,m,w){const U=w[0],v=w[1],_=w[2],c=w[3],o=w[4],P=w[5];let E=6,k=8,N=255;for(var z=0;z<l.length;z++){const ne=new Uint8Array(l[z]);for(var Q=ne.length,L=0;L<Q;L+=4)N&=ne[L+3]}const M=N!=255,B=(function($,G,te,oe,Y,se){const J=[];for(var K=0;K<$.length;K++){const ae=new Uint8Array($[K]),ue=new Uint32Array(ae.buffer);var le;let ce=0,ve=0,ge=G,Ue=te,De=oe?1:0;if(K!=0){const nt=se||oe||K==1||J[K-2].dispose!=0?1:2;let Le=0,Be=1e9;for(let Me=0;Me<nt;Me++){var be=new Uint8Array($[K-1-Me]);const rt=new Uint32Array($[K-1-Me]);let Ae=G,we=te,Ie=-1,Re=-1;for(let Fe=0;Fe<te;Fe++)for(let Ee=0;Ee<G;Ee++)ue[re=Fe*G+Ee]!=rt[re]&&(Ee<Ae&&(Ae=Ee),Ee>Ie&&(Ie=Ee),Fe<we&&(we=Fe),Fe>Re&&(Re=Fe));Ie==-1&&(Ae=we=Ie=Re=0),Y&&((1&Ae)==1&&Ae--,(1&we)==1&&we--);const We=(Ie-Ae+1)*(Re-we+1);We<Be&&(Be=We,Le=Me,ce=Ae,ve=we,ge=Ie-Ae+1,Ue=Re-we+1)}be=new Uint8Array($[K-1-Le]),Le==1&&(J[K-1].dispose=2),le=new Uint8Array(ge*Ue*4),x(be,G,te,le,ge,Ue,-ce,-ve,0),De=x(ae,G,te,le,ge,Ue,-ce,-ve,3)?1:0,De==1?n(ae,G,te,le,{x:ce,y:ve,width:ge,height:Ue}):x(ae,G,te,le,ge,Ue,-ce,-ve,0)}else le=ae.slice(0);J.push({rect:{x:ce,y:ve,width:ge,height:Ue},img:le,blend:De,dispose:0})}if(oe)for(K=0;K<J.length;K++){if((me=J[K]).blend==1)continue;const ae=me.rect,ue=J[K-1].rect,ce=Math.min(ae.x,ue.x),ve=Math.min(ae.y,ue.y),ge={x:ce,y:ve,width:Math.max(ae.x+ae.width,ue.x+ue.width)-ce,height:Math.max(ae.y+ae.height,ue.y+ue.height)-ve};J[K-1].dispose=1,K-1!=0&&i($,G,te,J,K-1,ge,Y),i($,G,te,J,K,ge,Y)}let xe=0;if($.length!=1)for(var re=0;re<J.length;re++){var me;xe+=(me=J[re]).rect.width*me.rect.height}return J})(l,s,b,U,v,_),Z={},j=[],W=[];if(m!=0){const ne=[];for(L=0;L<B.length;L++)ne.push(B[L].img.buffer);const $=(function(Y){let se=0;for(var J=0;J<Y.length;J++)se+=Y[J].byteLength;const K=new Uint8Array(se);let le=0;for(J=0;J<Y.length;J++){const be=new Uint8Array(Y[J]),xe=be.length;for(let re=0;re<xe;re+=4){let me=be[re],ae=be[re+1],ue=be[re+2];const ce=be[re+3];ce==0&&(me=ae=ue=0),K[le+re]=me,K[le+re+1]=ae,K[le+re+2]=ue,K[le+re+3]=ce}le+=xe}return K.buffer})(ne),G=F($,m);for(L=0;L<G.plte.length;L++)j.push(G.plte[L].est.rgba);let te=0;for(L=0;L<B.length;L++){const oe=(V=B[L]).img.length;var q=new Uint8Array(G.inds.buffer,te>>2,oe>>2);W.push(q);const Y=new Uint8Array(G.abuf,te,oe);P&&f(V.img,V.rect.width,V.rect.height,j,Y,q),V.img.set(Y),te+=oe}}else for(z=0;z<B.length;z++){var V=B[z];const ne=new Uint32Array(V.img.buffer);var ee=V.rect.width;for(Q=ne.length,q=new Uint8Array(Q),W.push(q),L=0;L<Q;L++){const $=ne[L];if(L!=0&&$==ne[L-1])q[L]=q[L-1];else if(L>ee&&$==ne[L-ee])q[L]=q[L-ee];else{let G=Z[$];if(G==null&&(Z[$]=G=j.length,j.push($),j.length>=300))break;q[L]=G}}}const ye=j.length;for(ye<=256&&o==0&&(k=ye<=2?1:ye<=4?2:ye<=16?4:8,k=Math.max(k,c)),z=0;z<B.length;z++){(V=B[z]).rect.x,V.rect.y,ee=V.rect.width;const ne=V.rect.height;let $=V.img;new Uint32Array($.buffer);let G=4*ee,te=4;if(ye<=256&&o==0){G=Math.ceil(k*ee/8);var de=new Uint8Array(G*ne);const oe=W[z];for(let Y=0;Y<ne;Y++){L=Y*G;const se=Y*ee;if(k==8)for(var X=0;X<ee;X++)de[L+X]=oe[se+X];else if(k==4)for(X=0;X<ee;X++)de[L+(X>>1)]|=oe[se+X]<<4-4*(1&X);else if(k==2)for(X=0;X<ee;X++)de[L+(X>>2)]|=oe[se+X]<<6-2*(3&X);else if(k==1)for(X=0;X<ee;X++)de[L+(X>>3)]|=oe[se+X]<<7-1*(7&X)}$=de,E=3,te=1}else if(M==0&&B.length==1){de=new Uint8Array(ee*ne*3);const oe=ee*ne;for(L=0;L<oe;L++){const Y=3*L,se=4*L;de[Y]=$[se],de[Y+1]=$[se+1],de[Y+2]=$[se+2]}$=de,E=2,te=3,G=3*ee}V.img=$,V.bpl=G,V.bpp=te}return{ctype:E,depth:k,plte:j,frames:B}}function i(l,s,b,m,w,U,v){const _=Uint8Array,c=Uint32Array,o=new _(l[w-1]),P=new c(l[w-1]),E=w+1<l.length?new _(l[w+1]):null,k=new _(l[w]),N=new c(k.buffer);let z=s,Q=b,L=-1,M=-1;for(let Z=0;Z<U.height;Z++)for(let j=0;j<U.width;j++){const W=U.x+j,q=U.y+Z,V=q*s+W,ee=N[V];ee==0||m[w-1].dispose==0&&P[V]==ee&&(E==null||E[4*V+3]!=0)||(W<z&&(z=W),W>L&&(L=W),q<Q&&(Q=q),q>M&&(M=q))}L==-1&&(z=Q=L=M=0),v&&((1&z)==1&&z--,(1&Q)==1&&Q--),U={x:z,y:Q,width:L-z+1,height:M-Q+1};const B=m[w];B.rect=U,B.blend=1,B.img=new Uint8Array(U.width*U.height*4),m[w-1].dispose==0?(x(o,s,b,B.img,U.width,U.height,-U.x,-U.y,0),n(k,s,b,B.img,U)):x(k,s,b,B.img,U.width,U.height,-U.x,-U.y,0)}function n(l,s,b,m,w){x(l,s,b,m,w.width,w.height,-w.x,-w.y,2)}function a(l,s,b,m,w,U,v){const _=[];let c,o=[0,1,2,3,4];U!=-1?o=[U]:(s*m>5e5||b==1)&&(o=[0]),v&&(c={level:0});const P=ft;for(var E=0;E<o.length;E++){for(let z=0;z<s;z++)d(w,l,z,m,b,o[E]);_.push(P.deflate(w,c))}let k,N=1e9;for(E=0;E<_.length;E++)_[E].length<N&&(k=E,N=_[E].length);return _[k]}function d(l,s,b,m,w,U){const v=b*m;let _=v+b;if(l[_]=U,_++,U==0)if(m<500)for(var c=0;c<m;c++)l[_+c]=s[v+c];else l.set(new Uint8Array(s.buffer,v,m),_);else if(U==1){for(c=0;c<w;c++)l[_+c]=s[v+c];for(c=w;c<m;c++)l[_+c]=s[v+c]-s[v+c-w]+256&255}else if(b==0){for(c=0;c<w;c++)l[_+c]=s[v+c];if(U==2)for(c=w;c<m;c++)l[_+c]=s[v+c];if(U==3)for(c=w;c<m;c++)l[_+c]=s[v+c]-(s[v+c-w]>>1)+256&255;if(U==4)for(c=w;c<m;c++)l[_+c]=s[v+c]-D(s[v+c-w],0,0)+256&255}else{if(U==2)for(c=0;c<m;c++)l[_+c]=s[v+c]+256-s[v+c-m]&255;if(U==3){for(c=0;c<w;c++)l[_+c]=s[v+c]+256-(s[v+c-m]>>1)&255;for(c=w;c<m;c++)l[_+c]=s[v+c]+256-(s[v+c-m]+s[v+c-w]>>1)&255}if(U==4){for(c=0;c<w;c++)l[_+c]=s[v+c]+256-D(0,s[v+c-m],0)&255;for(c=w;c<m;c++)l[_+c]=s[v+c]+256-D(s[v+c-w],s[v+c-m],s[v+c-w-m])&255}}}function F(l,s){const b=new Uint8Array(l),m=b.slice(0),w=new Uint32Array(m.buffer),U=C(m,s),v=U[0],_=U[1],c=b.length,o=new Uint8Array(c>>2);let P;if(b.length<2e7)for(var E=0;E<c;E+=4)P=A(v,k=b[E]*(1/255),N=b[E+1]*(1/255),z=b[E+2]*(1/255),Q=b[E+3]*(1/255)),o[E>>2]=P.ind,w[E>>2]=P.est.rgba;else for(E=0;E<c;E+=4){var k=b[E]*.00392156862745098,N=b[E+1]*(1/255),z=b[E+2]*(1/255),Q=b[E+3]*(1/255);for(P=v;P.left;)P=H(P.est,k,N,z,Q)<=0?P.left:P.right;o[E>>2]=P.ind,w[E>>2]=P.est.rgba}return{abuf:m.buffer,inds:o,plte:_}}function C(l,s,b){b==null&&(b=1e-4);const m=new Uint32Array(l.buffer),w={i0:0,i1:l.length,bst:null,est:null,tdst:0,left:null,right:null};w.bst=O(l,w.i0,w.i1),w.est=g(w.bst);const U=[w];for(;U.length<s;){let _=0,c=0;for(var v=0;v<U.length;v++)U[v].est.L>_&&(_=U[v].est.L,c=v);if(_<b)break;const o=U[c],P=T(l,m,o.i0,o.i1,o.est.e,o.est.eMq255);if(o.i0>=P||o.i1<=P){o.est.L=0;continue}const E={i0:o.i0,i1:P,bst:null,est:null,tdst:0,left:null,right:null};E.bst=O(l,E.i0,E.i1),E.est=g(E.bst);const k={i0:P,i1:o.i1,bst:null,est:null,tdst:0,left:null,right:null};for(k.bst={R:[],m:[],N:o.bst.N-E.bst.N},v=0;v<16;v++)k.bst.R[v]=o.bst.R[v]-E.bst.R[v];for(v=0;v<4;v++)k.bst.m[v]=o.bst.m[v]-E.bst.m[v];k.est=g(k.bst),o.left=E,o.right=k,U[c]=E,U.push(k)}for(U.sort(((_,c)=>c.bst.N-_.bst.N)),v=0;v<U.length;v++)U[v].ind=v;return[w,U]}function A(l,s,b,m,w){if(l.left==null)return l.tdst=(function(E,k,N,z,Q){const L=k-E[0],M=N-E[1],B=z-E[2],Z=Q-E[3];return L*L+M*M+B*B+Z*Z})(l.est.q,s,b,m,w),l;const U=H(l.est,s,b,m,w);let v=l.left,_=l.right;U>0&&(v=l.right,_=l.left);const c=A(v,s,b,m,w);if(c.tdst<=U*U)return c;const o=A(_,s,b,m,w);return o.tdst<c.tdst?o:c}function H(l,s,b,m,w){const{e:U}=l;return U[0]*s+U[1]*b+U[2]*m+U[3]*w-l.eMq}function T(l,s,b,m,w,U){for(m-=4;b<m;){for(;I(l,b,w)<=U;)b+=4;for(;I(l,m,w)>U;)m-=4;if(b>=m)break;const v=s[b>>2];s[b>>2]=s[m>>2],s[m>>2]=v,b+=4,m-=4}for(;I(l,b,w)>U;)b-=4;return b+4}function I(l,s,b){return l[s]*b[0]+l[s+1]*b[1]+l[s+2]*b[2]+l[s+3]*b[3]}function O(l,s,b){const m=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],w=[0,0,0,0],U=b-s>>2;for(let v=s;v<b;v+=4){const _=l[v]*.00392156862745098,c=l[v+1]*(1/255),o=l[v+2]*(1/255),P=l[v+3]*(1/255);w[0]+=_,w[1]+=c,w[2]+=o,w[3]+=P,m[0]+=_*_,m[1]+=_*c,m[2]+=_*o,m[3]+=_*P,m[5]+=c*c,m[6]+=c*o,m[7]+=c*P,m[10]+=o*o,m[11]+=o*P,m[15]+=P*P}return m[4]=m[1],m[8]=m[2],m[9]=m[6],m[12]=m[3],m[13]=m[7],m[14]=m[11],{R:m,m:w,N:U}}function g(l){const{R:s}=l,{m:b}=l,{N:m}=l,w=b[0],U=b[1],v=b[2],_=b[3],c=m==0?0:1/m,o=[s[0]-w*w*c,s[1]-w*U*c,s[2]-w*v*c,s[3]-w*_*c,s[4]-U*w*c,s[5]-U*U*c,s[6]-U*v*c,s[7]-U*_*c,s[8]-v*w*c,s[9]-v*U*c,s[10]-v*v*c,s[11]-v*_*c,s[12]-_*w*c,s[13]-_*U*c,s[14]-_*v*c,s[15]-_*_*c],P=o,E=R;let k=[Math.random(),Math.random(),Math.random(),Math.random()],N=0,z=0;if(m!=0)for(let L=0;L<16&&(k=E.multVec(P,k),z=Math.sqrt(E.dot(k,k)),k=E.sml(1/z,k),!(L!=0&&Math.abs(z-N)<1e-9));L++)N=z;const Q=[w*c,U*c,v*c,_*c];return{Cov:o,q:Q,e:k,L:N,eMq255:E.dot(E.sml(255,Q),k),eMq:E.dot(k,Q),rgba:(Math.round(255*Q[3])<<24|Math.round(255*Q[2])<<16|Math.round(255*Q[1])<<8|Math.round(255*Q[0])<<0)>>>0}}var R={multVec:(l,s)=>[l[0]*s[0]+l[1]*s[1]+l[2]*s[2]+l[3]*s[3],l[4]*s[0]+l[5]*s[1]+l[6]*s[2]+l[7]*s[3],l[8]*s[0]+l[9]*s[1]+l[10]*s[2]+l[11]*s[3],l[12]*s[0]+l[13]*s[1]+l[14]*s[2]+l[15]*s[3]],dot:(l,s)=>l[0]*s[0]+l[1]*s[1]+l[2]*s[2]+l[3]*s[3],sml:(l,s)=>[l*s[0],l*s[1],l*s[2],l*s[3]]};he.encode=function(s,b,m,w,U,v,_){w==null&&(w=0),_==null&&(_=!1);const c=r(s,b,m,w,[!1,!1,!1,0,_,!1]);return y(c,-1),p(c,b,m,U,v)},he.encodeLL=function(s,b,m,w,U,v,_,c){const o={ctype:0+(w==1?0:2)+(U==0?0:4),depth:v,frames:[]},P=(w+U)*v,E=P*b;for(let k=0;k<s.length;k++)o.frames.push({rect:{x:0,y:0,width:b,height:m},img:new Uint8Array(s[k]),blend:0,dispose:1,bpp:Math.ceil(P/8),bpl:Math.ceil(E/8)});return y(o,0,!0),p(o,b,m,_,c)},he.encode.compress=r,he.encode.dither=f,he.quantize=F,he.quantize.getKDtree=C,he.quantize.getNearest=A})();const Ge={toArrayBuffer(x,S){const D=x.width,h=x.height,e=D<<2,t=x.getContext("2d").getImageData(0,0,D,h),u=new Uint32Array(t.data.buffer),f=(32*D+31)/32<<2,p=f*h,y=122+p,r=new ArrayBuffer(y),i=new DataView(r),n=1<<20;let a,d,F,C,A=n,H=0,T=0,I=0;function O(l){i.setUint16(T,l,!0),T+=2}function g(l){i.setUint32(T,l,!0),T+=4}function R(l){T+=l}O(19778),g(y),R(4),g(122),g(108),g(D),g(-h>>>0),O(1),O(32),g(3),g(p),g(2835),g(2835),R(8),g(16711680),g(65280),g(255),g(4278190080),g(1466527264),(function l(){for(;H<h&&A>0;){for(C=122+H*f,a=0;a<e;)A--,d=u[I++],F=d>>>24,i.setUint32(C+a,d<<8|F),a+=4;H++}I<u.length?(A=n,setTimeout(l,Ge._dly)):S(r)})()},toBlob(x,S){this.toArrayBuffer(x,(D=>{S(new Blob([D],{type:"image/bmp"}))}))},_dly:9};var fe={CHROME:"CHROME",FIREFOX:"FIREFOX",DESKTOP_SAFARI:"DESKTOP_SAFARI",IE:"IE",IOS:"IOS",ETC:"ETC"},st={[fe.CHROME]:16384,[fe.FIREFOX]:11180,[fe.DESKTOP_SAFARI]:16384,[fe.IE]:8192,[fe.IOS]:4096,[fe.ETC]:8192};const Qe=typeof window<"u",Ke=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope,Pe=Qe&&window.cordova&&window.cordova.require&&window.cordova.require("cordova/modulemapper"),lt=(Qe||Ke)&&(Pe&&Pe.getOriginalSymbol(window,"File")||typeof File<"u"&&File),Ze=(Qe||Ke)&&(Pe&&Pe.getOriginalSymbol(window,"FileReader")||typeof FileReader<"u"&&FileReader);function Ne(x,S,D=Date.now()){return new Promise((h=>{const e=x.split(","),t=e[0].match(/:(.*?);/)[1],u=globalThis.atob(e[1]);let f=u.length;const p=new Uint8Array(f);for(;f--;)p[f]=u.charCodeAt(f);const y=new Blob([p],{type:t});y.name=S,y.lastModified=D,h(y)}))}function $e(x){return new Promise(((S,D)=>{const h=new Ze;h.onload=()=>S(h.result),h.onerror=e=>D(e),h.readAsDataURL(x)}))}function Xe(x){return new Promise(((S,D)=>{const h=new Image;h.onload=()=>S(h),h.onerror=e=>D(e),h.src=x}))}function _e(){if(_e.cachedResult!==void 0)return _e.cachedResult;let x=fe.ETC;const{userAgent:S}=navigator;return/Chrom(e|ium)/i.test(S)?x=fe.CHROME:/iP(ad|od|hone)/i.test(S)&&/WebKit/i.test(S)?x=fe.IOS:/Safari/i.test(S)?x=fe.DESKTOP_SAFARI:/Firefox/i.test(S)?x=fe.FIREFOX:(/MSIE/i.test(S)||document.documentMode)&&(x=fe.IE),_e.cachedResult=x,_e.cachedResult}function Ve(x,S){const D=_e(),h=st[D];let e=x,t=S,u=e*t;const f=e>t?t/e:e/t;for(;u>h*h;){const p=(h+e)/2,y=(h+t)/2;p<y?(t=y,e=y*f):(t=p*f,e=p),u=e*t}return{width:e,height:t}}function He(x,S){let D,h;try{if(D=new OffscreenCanvas(x,S),h=D.getContext("2d"),h===null)throw new Error("getContext of OffscreenCanvas returns null")}catch{D=document.createElement("canvas"),h=D.getContext("2d")}return D.width=x,D.height=S,[D,h]}function Ye(x,S){const{width:D,height:h}=Ve(x.width,x.height),[e,t]=He(D,h);return S&&/jpe?g/.test(S)&&(t.fillStyle="white",t.fillRect(0,0,e.width,e.height)),t.drawImage(x,0,0,e.width,e.height),e}function Se(){return Se.cachedResult!==void 0||(Se.cachedResult=["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&typeof document<"u"&&"ontouchend"in document),Se.cachedResult}function ke(x,S={}){return new Promise((function(D,h){let e,t;var u=function(){try{return t=Ye(e,S.fileType||x.type),D([e,t])}catch(p){return h(p)}},f=function(p){try{var y=function(r){try{throw r}catch(i){return h(i)}};try{let r;return $e(x).then((function(i){try{return r=i,Xe(r).then((function(n){try{return e=n,(function(){try{return u()}catch(a){return h(a)}})()}catch(a){return y(a)}}),y)}catch(n){return y(n)}}),y)}catch(r){y(r)}}catch(r){return h(r)}};try{if(Se()||[fe.DESKTOP_SAFARI,fe.MOBILE_SAFARI].includes(_e()))throw new Error("Skip createImageBitmap on IOS and Safari");return createImageBitmap(x).then((function(p){try{return e=p,u()}catch{return f()}}),f)}catch{f()}}))}function Oe(x,S,D,h,e=1){return new Promise((function(t,u){let f;if(S==="image/png"){let y,r,i;return y=x.getContext("2d"),{data:r}=y.getImageData(0,0,x.width,x.height),i=he.encode([r.buffer],x.width,x.height,4096*e),f=new Blob([i],{type:S}),f.name=D,f.lastModified=h,p.call(this)}{let y=function(){return p.call(this)};if(S==="image/bmp")return new Promise((r=>Ge.toBlob(x,r))).then((function(r){try{return f=r,f.name=D,f.lastModified=h,y.call(this)}catch(i){return u(i)}}).bind(this),u);{let r=function(){return y.call(this)};if(typeof OffscreenCanvas=="function"&&x instanceof OffscreenCanvas)return x.convertToBlob({type:S,quality:e}).then((function(i){try{return f=i,f.name=D,f.lastModified=h,r.call(this)}catch(n){return u(n)}}).bind(this),u);{let i;return i=x.toDataURL(S,e),Ne(i,D,h).then((function(n){try{return f=n,r.call(this)}catch(a){return u(a)}}).bind(this),u)}}}function p(){return t(f)}}))}function pe(x){x.width=0,x.height=0}function Ce(){return new Promise((function(x,S){let D,h,e,t;return Ce.cachedResult!==void 0?x(Ce.cachedResult):Ne("data:image/jpeg;base64,/9j/4QAiRXhpZgAATU0AKgAAAAgAAQESAAMAAAABAAYAAAAAAAD/2wCEAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAf/AABEIAAEAAgMBEQACEQEDEQH/xABKAAEAAAAAAAAAAAAAAAAAAAALEAEAAAAAAAAAAAAAAAAAAAAAAQEAAAAAAAAAAAAAAAAAAAAAEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwA/8H//2Q==","test.jpg",Date.now()).then((function(u){try{return D=u,ke(D).then((function(f){try{return h=f[1],Oe(h,D.type,D.name,D.lastModified).then((function(p){try{return e=p,pe(h),ke(e).then((function(y){try{return t=y[0],Ce.cachedResult=t.width===1&&t.height===2,x(Ce.cachedResult)}catch(r){return S(r)}}),S)}catch(y){return S(y)}}),S)}catch(p){return S(p)}}),S)}catch(f){return S(f)}}),S)}))}function Je(x){return new Promise(((S,D)=>{const h=new Ze;h.onload=e=>{const t=new DataView(e.target.result);if(t.getUint16(0,!1)!=65496)return S(-2);const u=t.byteLength;let f=2;for(;f<u;){if(t.getUint16(f+2,!1)<=8)return S(-1);const p=t.getUint16(f,!1);if(f+=2,p==65505){if(t.getUint32(f+=2,!1)!=1165519206)return S(-1);const y=t.getUint16(f+=6,!1)==18761;f+=t.getUint32(f+4,y);const r=t.getUint16(f,y);f+=2;for(let i=0;i<r;i++)if(t.getUint16(f+12*i,y)==274)return S(t.getUint16(f+12*i+8,y))}else{if((65280&p)!=65280)break;f+=t.getUint16(f,!1)}}return S(-1)},h.onerror=e=>D(e),h.readAsArrayBuffer(x)}))}function et(x,S){const{width:D}=x,{height:h}=x,{maxWidthOrHeight:e}=S;let t,u=x;return isFinite(e)&&(D>e||h>e)&&([u,t]=He(D,h),D>h?(u.width=e,u.height=h/D*e):(u.width=D/h*e,u.height=e),t.drawImage(x,0,0,u.width,u.height),pe(x)),u}function tt(x,S){const{width:D}=x,{height:h}=x,[e,t]=He(D,h);switch(S>4&&S<9?(e.width=h,e.height=D):(e.width=D,e.height=h),S){case 2:t.transform(-1,0,0,1,D,0);break;case 3:t.transform(-1,0,0,-1,D,h);break;case 4:t.transform(1,0,0,-1,0,h);break;case 5:t.transform(0,1,1,0,0,0);break;case 6:t.transform(0,1,-1,0,h,0);break;case 7:t.transform(0,-1,-1,0,h,D);break;case 8:t.transform(0,-1,1,0,0,D)}return t.drawImage(x,0,0,D,h),pe(x),e}function je(x,S,D=0){return new Promise((function(h,e){let t,u,f,p,y,r,i,n,a,d,F,C,A,H,T,I,O,g,R,l;function s(m=5){if(S.signal&&S.signal.aborted)throw S.signal.reason;t+=m,S.onProgress(Math.min(t,100))}function b(m){if(S.signal&&S.signal.aborted)throw S.signal.reason;t=Math.min(Math.max(m,t),100),S.onProgress(t)}return t=D,u=S.maxIteration||10,f=1024*S.maxSizeMB*1024,s(),ke(x,S).then((function(m){try{return[,p]=m,s(),y=et(p,S),s(),new Promise((function(w,U){var v;if(!(v=S.exifOrientation))return Je(x).then((function(c){try{return v=c,_.call(this)}catch(o){return U(o)}}).bind(this),U);function _(){return w(v)}return _.call(this)})).then((function(w){try{return r=w,s(),Ce().then((function(U){try{return i=U?y:tt(y,r),s(),n=S.initialQuality||1,a=S.fileType||x.type,Oe(i,a,x.name,x.lastModified,n).then((function(v){try{{let c=function(){if(u--&&(T>f||T>A)){let P,E;return P=l?.95*R.width:R.width,E=l?.95*R.height:R.height,[O,g]=He(P,E),g.drawImage(R,0,0,P,E),n*=a==="image/png"?.85:.95,Oe(O,a,x.name,x.lastModified,n).then((function(k){try{return I=k,pe(R),R=O,T=I.size,b(Math.min(99,Math.floor((H-T)/(H-f)*100))),c}catch(N){return e(N)}}),e)}return[1]},o=function(){return pe(R),pe(O),pe(y),pe(i),pe(p),b(100),h(I)};if(d=v,s(),F=d.size>f,C=d.size>x.size,!F&&!C)return b(100),h(d);var _;return A=x.size,H=d.size,T=H,R=i,l=!S.alwaysKeepResolution&&F,(_=(function(P){for(;P;){if(P.then)return void P.then(_,e);try{if(P.pop){if(P.length)return P.pop()?o.call(this):P;P=c}else P=P.call(this)}catch(E){return e(E)}}}).bind(this))(c)}}catch(c){return e(c)}}).bind(this),e)}catch(v){return e(v)}}).bind(this),e)}catch(U){return e(U)}}).bind(this),e)}catch(w){return e(w)}}).bind(this),e)}))}const ct=`
2
+ let scriptImported = false
3
+ self.addEventListener('message', async (e) => {
4
+ const { file, id, imageCompressionLibUrl, options } = e.data
5
+ options.onProgress = (progress) => self.postMessage({ progress, id })
6
+ try {
7
+ if (!scriptImported) {
8
+ // console.log('[worker] importScripts', imageCompressionLibUrl)
9
+ self.importScripts(imageCompressionLibUrl)
10
+ scriptImported = true
11
+ }
12
+ // console.log('[worker] self', self)
13
+ const compressedFile = await imageCompression(file, options)
14
+ self.postMessage({ file: compressedFile, id })
15
+ } catch (e) {
16
+ // console.error('[worker] error', e)
17
+ self.postMessage({ error: e.message + '\\n' + e.stack, id })
18
+ }
19
+ })
20
+ `;let ze;function ut(x,S){return new Promise(((D,h)=>{ze||(ze=(function(u){const f=[];return f.push(u),URL.createObjectURL(new Blob(f))})(ct));const e=new Worker(ze);e.addEventListener("message",(function(u){if(S.signal&&S.signal.aborted)e.terminate();else if(u.data.progress===void 0){if(u.data.error)return h(new Error(u.data.error)),void e.terminate();D(u.data.file),e.terminate()}else S.onProgress(u.data.progress)})),e.addEventListener("error",h),S.signal&&S.signal.addEventListener("abort",(()=>{h(S.signal.reason),e.terminate()})),e.postMessage({file:x,imageCompressionLibUrl:S.libURL,options:{...S,onProgress:void 0,signal:void 0}})}))}function ie(x,S){return new Promise((function(D,h){let e,t,u,f,p,y;if(e={...S},u=0,{onProgress:f}=e,e.maxSizeMB=e.maxSizeMB||Number.POSITIVE_INFINITY,p=typeof e.useWebWorker!="boolean"||e.useWebWorker,delete e.useWebWorker,e.onProgress=a=>{u=a,typeof f=="function"&&f(u)},!(x instanceof Blob||x instanceof lt))return h(new Error("The file given is not an instance of Blob or File"));if(!/^image/.test(x.type))return h(new Error("The file given is not an image"));if(y=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope,!p||typeof Worker!="function"||y)return je(x,e).then((function(a){try{return t=a,n.call(this)}catch(d){return h(d)}}).bind(this),h);var r=(function(){try{return n.call(this)}catch(a){return h(a)}}).bind(this),i=function(a){try{return je(x,e).then((function(d){try{return t=d,r()}catch(F){return h(F)}}),h)}catch(d){return h(d)}};try{return e.libURL=e.libURL||"https://cdn.jsdelivr.net/npm/browser-image-compression@2.0.2/dist/browser-image-compression.js",ut(x,e).then((function(a){try{return t=a,r()}catch{return i()}}),i)}catch{i()}function n(){try{t.name=x.name,t.lastModified=x.lastModified}catch{}try{e.preserveExif&&x.type==="image/jpeg"&&(!e.fileType||e.fileType&&e.fileType===x.type)&&(t=qe(x,t))}catch{}return D(t)}}))}ie.getDataUrlFromFile=$e,ie.getFilefromDataUrl=Ne,ie.loadImage=Xe,ie.drawImageInCanvas=Ye,ie.drawFileInCanvas=ke,ie.canvasToFile=Oe,ie.getExifOrientation=Je,ie.handleMaxWidthOrHeight=et,ie.followExifOrientation=tt,ie.cleanupCanvasMemory=pe,ie.isAutoOrientationInBrowser=Ce,ie.approximateBelowMaximumCanvasSizeOfBrowser=Ve,ie.copyExifWithoutOrientation=qe,ie.getBrowserName=_e,ie.version="2.0.2";exports.imageCompression=ie;
@@ -0,0 +1 @@
1
+ "use strict";function u(o,n){const e=String(o);if(typeof n!="string")throw new TypeError("Expected character");let i=0,t=e.indexOf(n);for(;t!==-1;)i++,t=e.indexOf(n,t+n.length);return i}exports.ccount=u;
@@ -0,0 +1 @@
1
+ "use strict";var n={exports:{}},f;function a(){if(f)return n.exports;f=1;function i(r){var s,e,t="";if(typeof r=="string"||typeof r=="number")t+=r;else if(typeof r=="object")if(Array.isArray(r)){var o=r.length;for(s=0;s<o;s++)r[s]&&(e=i(r[s]))&&(t&&(t+=" "),t+=e)}else for(e in r)r[e]&&(t&&(t+=" "),t+=e);return t}function u(){for(var r,s,e=0,t="",o=arguments.length;e<o;e++)(r=arguments[e])&&(s=i(r))&&(t&&(t+=" "),t+=s);return t}return n.exports=u,n.exports.clsx=u,n.exports}exports.requireClsx=a;
@@ -0,0 +1 @@
1
+ "use strict";const M=require("./vendor-react-CzqSQR9J.cjs"),O=require("./vendor-color-string-DlngRZWO.cjs"),q=require("./vendor-color-convert-DNxf_t0v.cjs");var m,F;function E(){if(F)return m;F=1;var v=O.requireColorString(),s=q.requireColorConvert(),p=[].slice,w=["keyword","gray","hex"],b={};Object.keys(s).forEach(function(r){b[p.call(s[r].labels).sort().join("")]=r});var g={};function i(r,t){if(!(this instanceof i))return new i(r,t);if(t&&t in w&&(t=null),t&&!(t in s))throw new Error("Unknown model: "+t);var n,a;if(r==null)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(r instanceof i)this.model=r.model,this.color=r.color.slice(),this.valpha=r.valpha;else if(typeof r=="string"){var h=v.get(r);if(h===null)throw new Error("Unable to parse color from string: "+r);this.model=h.model,a=s[this.model].channels,this.color=h.value.slice(0,a),this.valpha=typeof h.value[a]=="number"?h.value[a]:1}else if(r.length){this.model=t||"rgb",a=s[this.model].channels;var c=p.call(r,0,a);this.color=y(c,a),this.valpha=typeof r[a]=="number"?r[a]:1}else if(typeof r=="number")r&=16777215,this.model="rgb",this.color=[r>>16&255,r>>8&255,r&255],this.valpha=1;else{this.valpha=1;var l=Object.keys(r);"alpha"in r&&(l.splice(l.indexOf("alpha"),1),this.valpha=typeof r.alpha=="number"?r.alpha:0);var u=l.sort().join("");if(!(u in b))throw new Error("Unable to parse color from object: "+JSON.stringify(r));this.model=b[u];var f=s[this.model].labels,d=[];for(n=0;n<f.length;n++)d.push(r[f[n]]);this.color=y(d)}if(g[this.model])for(a=s[this.model].channels,n=0;n<a;n++){var x=g[this.model][n];x&&(this.color[n]=x(this.color[n]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}i.prototype={toString:function(){return this.string()},toJSON:function(){return this[this.model]()},string:function(r){var t=this.model in v.to?this:this.rgb();t=t.round(typeof r=="number"?r:1);var n=t.valpha===1?t.color:t.color.concat(this.valpha);return v.to[t.model](n)},percentString:function(r){var t=this.rgb().round(typeof r=="number"?r:1),n=t.valpha===1?t.color:t.color.concat(this.valpha);return v.to.rgb.percent(n)},array:function(){return this.valpha===1?this.color.slice():this.color.concat(this.valpha)},object:function(){for(var r={},t=s[this.model].channels,n=s[this.model].labels,a=0;a<t;a++)r[n[a]]=this.color[a];return this.valpha!==1&&(r.alpha=this.valpha),r},unitArray:function(){var r=this.rgb().color;return r[0]/=255,r[1]/=255,r[2]/=255,this.valpha!==1&&r.push(this.valpha),r},unitObject:function(){var r=this.rgb().object();return r.r/=255,r.g/=255,r.b/=255,this.valpha!==1&&(r.alpha=this.valpha),r},round:function(r){return r=Math.max(r||0,0),new i(this.color.map(A(r)).concat(this.valpha),this.model)},alpha:function(r){return arguments.length?new i(this.color.concat(Math.max(0,Math.min(1,r))),this.model):this.valpha},red:e("rgb",0,o(255)),green:e("rgb",1,o(255)),blue:e("rgb",2,o(255)),hue:e(["hsl","hsv","hsl","hwb","hcg"],0,function(r){return(r%360+360)%360}),saturationl:e("hsl",1,o(100)),lightness:e("hsl",2,o(100)),saturationv:e("hsv",1,o(100)),value:e("hsv",2,o(100)),chroma:e("hcg",1,o(100)),gray:e("hcg",2,o(100)),white:e("hwb",1,o(100)),wblack:e("hwb",2,o(100)),cyan:e("cmyk",0,o(100)),magenta:e("cmyk",1,o(100)),yellow:e("cmyk",2,o(100)),black:e("cmyk",3,o(100)),x:e("xyz",0,o(100)),y:e("xyz",1,o(100)),z:e("xyz",2,o(100)),l:e("lab",0,o(100)),a:e("lab",1),b:e("lab",2),keyword:function(r){return arguments.length?new i(r):s[this.model].keyword(this.color)},hex:function(r){return arguments.length?new i(r):v.to.hex(this.rgb().round().color)},rgbNumber:function(){var r=this.rgb().color;return(r[0]&255)<<16|(r[1]&255)<<8|r[2]&255},luminosity:function(){for(var r=this.rgb().color,t=[],n=0;n<r.length;n++){var a=r[n]/255;t[n]=a<=.03928?a/12.92:Math.pow((a+.055)/1.055,2.4)}return .2126*t[0]+.7152*t[1]+.0722*t[2]},contrast:function(r){var t=this.luminosity(),n=r.luminosity();return t>n?(t+.05)/(n+.05):(n+.05)/(t+.05)},level:function(r){var t=this.contrast(r);return t>=7.1?"AAA":t>=4.5?"AA":""},isDark:function(){var r=this.rgb().color,t=(r[0]*299+r[1]*587+r[2]*114)/1e3;return t<128},isLight:function(){return!this.isDark()},negate:function(){for(var r=this.rgb(),t=0;t<3;t++)r.color[t]=255-r.color[t];return r},lighten:function(r){var t=this.hsl();return t.color[2]+=t.color[2]*r,t},darken:function(r){var t=this.hsl();return t.color[2]-=t.color[2]*r,t},saturate:function(r){var t=this.hsl();return t.color[1]+=t.color[1]*r,t},desaturate:function(r){var t=this.hsl();return t.color[1]-=t.color[1]*r,t},whiten:function(r){var t=this.hwb();return t.color[1]+=t.color[1]*r,t},blacken:function(r){var t=this.hwb();return t.color[2]+=t.color[2]*r,t},grayscale:function(){var r=this.rgb().color,t=r[0]*.3+r[1]*.59+r[2]*.11;return i.rgb(t,t,t)},fade:function(r){return this.alpha(this.valpha-this.valpha*r)},opaquer:function(r){return this.alpha(this.valpha+this.valpha*r)},rotate:function(r){var t=this.hsl(),n=t.color[0];return n=(n+r)%360,n=n<0?360+n:n,t.color[0]=n,t},mix:function(r,t){if(!r||!r.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof r);var n=r.rgb(),a=this.rgb(),h=t===void 0?.5:t,c=2*h-1,l=n.alpha()-a.alpha(),u=((c*l===-1?c:(c+l)/(1+c*l))+1)/2,f=1-u;return i.rgb(u*n.red()+f*a.red(),u*n.green()+f*a.green(),u*n.blue()+f*a.blue(),n.alpha()*h+a.alpha()*(1-h))}},Object.keys(s).forEach(function(r){if(w.indexOf(r)===-1){var t=s[r].channels;i.prototype[r]=function(){if(this.model===r)return new i(this);if(arguments.length)return new i(arguments,r);var n=typeof arguments[t]=="number"?t:this.valpha;return new i(C(s[this.model][r].raw(this.color)).concat(n),r)},i[r]=function(n){return typeof n=="number"&&(n=y(p.call(arguments),t)),new i(n,r)}}});function k(r,t){return Number(r.toFixed(t))}function A(r){return function(t){return k(t,r)}}function e(r,t,n){return r=Array.isArray(r)?r:[r],r.forEach(function(a){(g[a]||(g[a]=[]))[t]=n}),r=r[0],function(a){var h;return arguments.length?(n&&(a=n(a)),h=this[r](),h.color[t]=a,h):(h=this[r]().color[t],n&&(h=n(h)),h)}}function o(r){return function(t){return Math.max(0,Math.min(r,t))}}function C(r){return Array.isArray(r)?r:[r]}function y(r,t){for(var n=0;n<t;n++)typeof r[n]!="number"&&(r[n]=0);return r}return m=i,m}var z=E();const S=M.getDefaultExportFromCjs(z);exports.Color=S;
@@ -0,0 +1 @@
1
+ "use strict";const z=require("./vendor-color-name-DMfyNIC_.cjs");var m={exports:{}},k;function q(){if(k)return m.exports;k=1;var p=z.requireColorName$1(),y={};for(var g in p)p.hasOwnProperty(g)&&(y[p[g]]=g);var u=m.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var b in u)if(u.hasOwnProperty(b)){if(!("channels"in u[b]))throw new Error("missing channels property: "+b);if(!("labels"in u[b]))throw new Error("missing channel labels property: "+b);if(u[b].labels.length!==u[b].channels)throw new Error("channel and label counts mismatch: "+b);var l=u[b].channels,c=u[b].labels;delete u[b].channels,delete u[b].labels,Object.defineProperty(u[b],"channels",{value:l}),Object.defineProperty(u[b],"labels",{value:c})}u.rgb.hsl=function(r){var n=r[0]/255,e=r[1]/255,a=r[2]/255,t=Math.min(n,e,a),v=Math.max(n,e,a),i=v-t,s,o,h;return v===t?s=0:n===v?s=(e-a)/i:e===v?s=2+(a-n)/i:a===v&&(s=4+(n-e)/i),s=Math.min(s*60,360),s<0&&(s+=360),h=(t+v)/2,v===t?o=0:h<=.5?o=i/(v+t):o=i/(2-v-t),[s,o*100,h*100]},u.rgb.hsv=function(r){var n,e,a,t,v,i=r[0]/255,s=r[1]/255,o=r[2]/255,h=Math.max(i,s,o),M=h-Math.min(i,s,o),w=function(O){return(h-O)/6/M+1/2};return M===0?t=v=0:(v=M/h,n=w(i),e=w(s),a=w(o),i===h?t=a-e:s===h?t=1/3+n-a:o===h&&(t=2/3+e-n),t<0?t+=1:t>1&&(t-=1)),[t*360,v*100,h*100]},u.rgb.hwb=function(r){var n=r[0],e=r[1],a=r[2],t=u.rgb.hsl(r)[0],v=1/255*Math.min(n,Math.min(e,a));return a=1-1/255*Math.max(n,Math.max(e,a)),[t,v*100,a*100]},u.rgb.cmyk=function(r){var n=r[0]/255,e=r[1]/255,a=r[2]/255,t,v,i,s;return s=Math.min(1-n,1-e,1-a),t=(1-n-s)/(1-s)||0,v=(1-e-s)/(1-s)||0,i=(1-a-s)/(1-s)||0,[t*100,v*100,i*100,s*100]};function f(r,n){return Math.pow(r[0]-n[0],2)+Math.pow(r[1]-n[1],2)+Math.pow(r[2]-n[2],2)}return u.rgb.keyword=function(r){var n=y[r];if(n)return n;var e=1/0,a;for(var t in p)if(p.hasOwnProperty(t)){var v=p[t],i=f(r,v);i<e&&(e=i,a=t)}return a},u.keyword.rgb=function(r){return p[r]},u.rgb.xyz=function(r){var n=r[0]/255,e=r[1]/255,a=r[2]/255;n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92,e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92,a=a>.04045?Math.pow((a+.055)/1.055,2.4):a/12.92;var t=n*.4124+e*.3576+a*.1805,v=n*.2126+e*.7152+a*.0722,i=n*.0193+e*.1192+a*.9505;return[t*100,v*100,i*100]},u.rgb.lab=function(r){var n=u.rgb.xyz(r),e=n[0],a=n[1],t=n[2],v,i,s;return e/=95.047,a/=100,t/=108.883,e=e>.008856?Math.pow(e,1/3):7.787*e+16/116,a=a>.008856?Math.pow(a,1/3):7.787*a+16/116,t=t>.008856?Math.pow(t,1/3):7.787*t+16/116,v=116*a-16,i=500*(e-a),s=200*(a-t),[v,i,s]},u.hsl.rgb=function(r){var n=r[0]/360,e=r[1]/100,a=r[2]/100,t,v,i,s,o;if(e===0)return o=a*255,[o,o,o];a<.5?v=a*(1+e):v=a+e-a*e,t=2*a-v,s=[0,0,0];for(var h=0;h<3;h++)i=n+1/3*-(h-1),i<0&&i++,i>1&&i--,6*i<1?o=t+(v-t)*6*i:2*i<1?o=v:3*i<2?o=t+(v-t)*(2/3-i)*6:o=t,s[h]=o*255;return s},u.hsl.hsv=function(r){var n=r[0],e=r[1]/100,a=r[2]/100,t=e,v=Math.max(a,.01),i,s;return a*=2,e*=a<=1?a:2-a,t*=v<=1?v:2-v,s=(a+e)/2,i=a===0?2*t/(v+t):2*e/(a+e),[n,i*100,s*100]},u.hsv.rgb=function(r){var n=r[0]/60,e=r[1]/100,a=r[2]/100,t=Math.floor(n)%6,v=n-Math.floor(n),i=255*a*(1-e),s=255*a*(1-e*v),o=255*a*(1-e*(1-v));switch(a*=255,t){case 0:return[a,o,i];case 1:return[s,a,i];case 2:return[i,a,o];case 3:return[i,s,a];case 4:return[o,i,a];case 5:return[a,i,s]}},u.hsv.hsl=function(r){var n=r[0],e=r[1]/100,a=r[2]/100,t=Math.max(a,.01),v,i,s;return s=(2-e)*a,v=(2-e)*t,i=e*t,i/=v<=1?v:2-v,i=i||0,s/=2,[n,i*100,s*100]},u.hwb.rgb=function(r){var n=r[0]/360,e=r[1]/100,a=r[2]/100,t=e+a,v,i,s,o;t>1&&(e/=t,a/=t),v=Math.floor(6*n),i=1-a,s=6*n-v,(v&1)!==0&&(s=1-s),o=e+s*(i-e);var h,M,w;switch(v){default:case 6:case 0:h=i,M=o,w=e;break;case 1:h=o,M=i,w=e;break;case 2:h=e,M=i,w=o;break;case 3:h=e,M=o,w=i;break;case 4:h=o,M=e,w=i;break;case 5:h=i,M=e,w=o;break}return[h*255,M*255,w*255]},u.cmyk.rgb=function(r){var n=r[0]/100,e=r[1]/100,a=r[2]/100,t=r[3]/100,v,i,s;return v=1-Math.min(1,n*(1-t)+t),i=1-Math.min(1,e*(1-t)+t),s=1-Math.min(1,a*(1-t)+t),[v*255,i*255,s*255]},u.xyz.rgb=function(r){var n=r[0]/100,e=r[1]/100,a=r[2]/100,t,v,i;return t=n*3.2406+e*-1.5372+a*-.4986,v=n*-.9689+e*1.8758+a*.0415,i=n*.0557+e*-.204+a*1.057,t=t>.0031308?1.055*Math.pow(t,1/2.4)-.055:t*12.92,v=v>.0031308?1.055*Math.pow(v,1/2.4)-.055:v*12.92,i=i>.0031308?1.055*Math.pow(i,1/2.4)-.055:i*12.92,t=Math.min(Math.max(0,t),1),v=Math.min(Math.max(0,v),1),i=Math.min(Math.max(0,i),1),[t*255,v*255,i*255]},u.xyz.lab=function(r){var n=r[0],e=r[1],a=r[2],t,v,i;return n/=95.047,e/=100,a/=108.883,n=n>.008856?Math.pow(n,1/3):7.787*n+16/116,e=e>.008856?Math.pow(e,1/3):7.787*e+16/116,a=a>.008856?Math.pow(a,1/3):7.787*a+16/116,t=116*e-16,v=500*(n-e),i=200*(e-a),[t,v,i]},u.lab.xyz=function(r){var n=r[0],e=r[1],a=r[2],t,v,i;v=(n+16)/116,t=e/500+v,i=v-a/200;var s=Math.pow(v,3),o=Math.pow(t,3),h=Math.pow(i,3);return v=s>.008856?s:(v-16/116)/7.787,t=o>.008856?o:(t-16/116)/7.787,i=h>.008856?h:(i-16/116)/7.787,t*=95.047,v*=100,i*=108.883,[t,v,i]},u.lab.lch=function(r){var n=r[0],e=r[1],a=r[2],t,v,i;return t=Math.atan2(a,e),v=t*360/2/Math.PI,v<0&&(v+=360),i=Math.sqrt(e*e+a*a),[n,i,v]},u.lch.lab=function(r){var n=r[0],e=r[1],a=r[2],t,v,i;return i=a/360*2*Math.PI,t=e*Math.cos(i),v=e*Math.sin(i),[n,t,v]},u.rgb.ansi16=function(r){var n=r[0],e=r[1],a=r[2],t=1 in arguments?arguments[1]:u.rgb.hsv(r)[2];if(t=Math.round(t/50),t===0)return 30;var v=30+(Math.round(a/255)<<2|Math.round(e/255)<<1|Math.round(n/255));return t===2&&(v+=60),v},u.hsv.ansi16=function(r){return u.rgb.ansi16(u.hsv.rgb(r),r[2])},u.rgb.ansi256=function(r){var n=r[0],e=r[1],a=r[2];if(n===e&&e===a)return n<8?16:n>248?231:Math.round((n-8)/247*24)+232;var t=16+36*Math.round(n/255*5)+6*Math.round(e/255*5)+Math.round(a/255*5);return t},u.ansi16.rgb=function(r){var n=r%10;if(n===0||n===7)return r>50&&(n+=3.5),n=n/10.5*255,[n,n,n];var e=(~~(r>50)+1)*.5,a=(n&1)*e*255,t=(n>>1&1)*e*255,v=(n>>2&1)*e*255;return[a,t,v]},u.ansi256.rgb=function(r){if(r>=232){var n=(r-232)*10+8;return[n,n,n]}r-=16;var e,a=Math.floor(r/36)/5*255,t=Math.floor((e=r%36)/6)/5*255,v=e%6/5*255;return[a,t,v]},u.rgb.hex=function(r){var n=((Math.round(r[0])&255)<<16)+((Math.round(r[1])&255)<<8)+(Math.round(r[2])&255),e=n.toString(16).toUpperCase();return"000000".substring(e.length)+e},u.hex.rgb=function(r){var n=r.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!n)return[0,0,0];var e=n[0];n[0].length===3&&(e=e.split("").map(function(s){return s+s}).join(""));var a=parseInt(e,16),t=a>>16&255,v=a>>8&255,i=a&255;return[t,v,i]},u.rgb.hcg=function(r){var n=r[0]/255,e=r[1]/255,a=r[2]/255,t=Math.max(Math.max(n,e),a),v=Math.min(Math.min(n,e),a),i=t-v,s,o;return i<1?s=v/(1-i):s=0,i<=0?o=0:t===n?o=(e-a)/i%6:t===e?o=2+(a-n)/i:o=4+(n-e)/i+4,o/=6,o%=1,[o*360,i*100,s*100]},u.hsl.hcg=function(r){var n=r[1]/100,e=r[2]/100,a=1,t=0;return e<.5?a=2*n*e:a=2*n*(1-e),a<1&&(t=(e-.5*a)/(1-a)),[r[0],a*100,t*100]},u.hsv.hcg=function(r){var n=r[1]/100,e=r[2]/100,a=n*e,t=0;return a<1&&(t=(e-a)/(1-a)),[r[0],a*100,t*100]},u.hcg.rgb=function(r){var n=r[0]/360,e=r[1]/100,a=r[2]/100;if(e===0)return[a*255,a*255,a*255];var t=[0,0,0],v=n%1*6,i=v%1,s=1-i,o=0;switch(Math.floor(v)){case 0:t[0]=1,t[1]=i,t[2]=0;break;case 1:t[0]=s,t[1]=1,t[2]=0;break;case 2:t[0]=0,t[1]=1,t[2]=i;break;case 3:t[0]=0,t[1]=s,t[2]=1;break;case 4:t[0]=i,t[1]=0,t[2]=1;break;default:t[0]=1,t[1]=0,t[2]=s}return o=(1-e)*a,[(e*t[0]+o)*255,(e*t[1]+o)*255,(e*t[2]+o)*255]},u.hcg.hsv=function(r){var n=r[1]/100,e=r[2]/100,a=n+e*(1-n),t=0;return a>0&&(t=n/a),[r[0],t*100,a*100]},u.hcg.hsl=function(r){var n=r[1]/100,e=r[2]/100,a=e*(1-n)+.5*n,t=0;return a>0&&a<.5?t=n/(2*a):a>=.5&&a<1&&(t=n/(2*(1-a))),[r[0],t*100,a*100]},u.hcg.hwb=function(r){var n=r[1]/100,e=r[2]/100,a=n+e*(1-n);return[r[0],(a-n)*100,(1-a)*100]},u.hwb.hcg=function(r){var n=r[1]/100,e=r[2]/100,a=1-e,t=a-n,v=0;return t<1&&(v=(a-t)/(1-t)),[r[0],t*100,v*100]},u.apple.rgb=function(r){return[r[0]/65535*255,r[1]/65535*255,r[2]/65535*255]},u.rgb.apple=function(r){return[r[0]/255*65535,r[1]/255*65535,r[2]/255*65535]},u.gray.rgb=function(r){return[r[0]/100*255,r[0]/100*255,r[0]/100*255]},u.gray.hsl=u.gray.hsv=function(r){return[0,0,r[0]]},u.gray.hwb=function(r){return[0,100,r[0]]},u.gray.cmyk=function(r){return[0,0,0,r[0]]},u.gray.lab=function(r){return[r[0],0,0]},u.gray.hex=function(r){var n=Math.round(r[0]/100*255)&255,e=(n<<16)+(n<<8)+n,a=e.toString(16).toUpperCase();return"000000".substring(a.length)+a},u.rgb.gray=function(r){var n=(r[0]+r[1]+r[2])/3;return[n/255*100]},m.exports}var x,F;function j(){if(F)return x;F=1;var p=q();function y(){for(var l={},c=Object.keys(p),f=c.length,r=0;r<f;r++)l[c[r]]={distance:-1,parent:null};return l}function g(l){var c=y(),f=[l];for(c[l].distance=0;f.length;)for(var r=f.pop(),n=Object.keys(p[r]),e=n.length,a=0;a<e;a++){var t=n[a],v=c[t];v.distance===-1&&(v.distance=c[r].distance+1,v.parent=r,f.unshift(t))}return c}function u(l,c){return function(f){return c(l(f))}}function b(l,c){for(var f=[c[l].parent,l],r=p[c[l].parent][l],n=c[l].parent;c[n].parent;)f.unshift(c[n].parent),r=u(p[c[n].parent][n],r),n=c[n].parent;return r.conversion=f,r}return x=function(l){for(var c=g(l),f={},r=Object.keys(c),n=r.length,e=0;e<n;e++){var a=r[e],t=c[a];t.parent!==null&&(f[a]=b(a,c))}return f},x}var d,C;function P(){if(C)return d;C=1;var p=q(),y=j(),g={},u=Object.keys(p);function b(c){var f=function(r){return r==null?r:(arguments.length>1&&(r=Array.prototype.slice.call(arguments)),c(r))};return"conversion"in c&&(f.conversion=c.conversion),f}function l(c){var f=function(r){if(r==null)return r;arguments.length>1&&(r=Array.prototype.slice.call(arguments));var n=c(r);if(typeof n=="object")for(var e=n.length,a=0;a<e;a++)n[a]=Math.round(n[a]);return n};return"conversion"in c&&(f.conversion=c.conversion),f}return u.forEach(function(c){g[c]={},Object.defineProperty(g[c],"channels",{value:p[c].channels}),Object.defineProperty(g[c],"labels",{value:p[c].labels});var f=y(c),r=Object.keys(f);r.forEach(function(n){var e=f[n];g[c][n]=l(e),g[c][n].raw=b(e)})}),d=g,d}exports.requireColorConvert=P;
@@ -0,0 +1 @@
1
+ "use strict";var e,a;function i(){return a||(a=1,e={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}),e}var r,l;function o(){return l||(l=1,r={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}),r}exports.requireColorName=i;exports.requireColorName$1=o;